Snapshot of commit d5ec1d5018ed24f1b4f32b1d09df6dbd7e2fc425

from branch master of git://git.jetbrains.org/idea/community.git
diff --git a/xml/dom-impl/dom-impl.iml b/xml/dom-impl/dom-impl.iml
new file mode 100644
index 0000000..cc3900c
--- /dev/null
+++ b/xml/dom-impl/dom-impl.iml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="dom-openapi" exported="" />
+    <orderEntry type="library" name="asm" level="project" />
+    <orderEntry type="library" name="CGLIB" level="project" />
+    <orderEntry type="module" module-name="resources" />
+    <orderEntry type="library" name="Xerces" level="project" />
+    <orderEntry type="module" module-name="xml" />
+    <orderEntry type="module" module-name="util" />
+    <orderEntry type="module" module-name="platform-api" />
+    <orderEntry type="module" module-name="platform-impl" />
+    <orderEntry type="module" module-name="lang-api" />
+    <orderEntry type="module" module-name="lang-impl" />
+    <orderEntry type="module" module-name="xml-openapi" />
+    <orderEntry type="library" name="DTDParser" level="project" />
+  </component>
+  <component name="copyright">
+    <Base>
+      <setting name="state" value="1" />
+    </Base>
+  </component>
+</module>
+
diff --git a/xml/dom-impl/src/META-INF/DomPlugin.xml b/xml/dom-impl/src/META-INF/DomPlugin.xml
new file mode 100644
index 0000000..71ce3f7
--- /dev/null
+++ b/xml/dom-impl/src/META-INF/DomPlugin.xml
@@ -0,0 +1,82 @@
+<idea-plugin>
+  <extensionPoints>
+    <extensionPoint name="dom.fileDescription"
+                    interface="com.intellij.util.xml.DomFileDescription"/>
+
+    <extensionPoint name="dom.implementation"
+                    beanClass="com.intellij.util.xml.impl.DomImplementationClassEP"/>
+
+    <extensionPoint name="dom.converter"
+                    beanClass="com.intellij.util.xml.impl.DomImplementationClassEP"/>
+
+    <extensionPoint name="dom.extender"
+                    beanClass="com.intellij.util.xml.reflect.DomExtenderEP"/>
+
+    <extensionPoint name="dom.customAnnotationChecker"
+                    interface="com.intellij.util.xml.highlighting.DomCustomAnnotationChecker"/>
+
+    <extensionPoint name="dom.uiControlsProvider"
+                    interface="com.intellij.util.Consumer"/>
+  </extensionPoints>
+
+  <extensions defaultExtensionNs="com.intellij">
+    <fileBasedIndex implementation="com.intellij.util.xml.DomFileIndex"/>
+
+    <filetype.stubBuilder filetype="XML" implementationClass="com.intellij.util.xml.stubs.builder.DomStubBuilder"/>
+    <stubElementTypeHolder class="com.intellij.util.xml.stubs.DomElementTypeHolder"/>
+
+    <applicationService serviceInterface="com.intellij.util.xml.impl.DomApplicationComponent"
+                        serviceImplementation="com.intellij.util.xml.impl.DomApplicationComponent"/>
+
+    <applicationService serviceInterface="com.intellij.util.xml.DomService"
+                        serviceImplementation="com.intellij.util.xml.impl.DomServiceImpl"/>
+
+    <applicationService serviceInterface="com.intellij.util.xml.ui.DomUIFactory"
+                        serviceImplementation="com.intellij.util.xml.ui.DomUIFactoryImpl"/>
+
+    <applicationService serviceInterface="com.intellij.util.xml.ElementPresentationManager"
+                        serviceImplementation="com.intellij.util.xml.ElementPresentationManagerImpl"/>
+
+    <applicationService serviceInterface="com.intellij.util.xml.ConverterManager"
+                        serviceImplementation="com.intellij.util.xml.impl.ConverterManagerImpl"/>
+
+    <projectService serviceInterface="com.intellij.util.xml.ui.CommittableUtil"
+                    serviceImplementation="com.intellij.util.xml.ui.CommittableUtil"/>
+
+    <projectService serviceInterface="com.intellij.util.xml.highlighting.DomElementAnnotationsManager"
+                    serviceImplementation="com.intellij.util.xml.highlighting.DomElementAnnotationsManagerImpl"/>
+
+    <projectService serviceInterface="com.intellij.util.xml.DomElementsNavigationManager"
+                    serviceImplementation="com.intellij.util.xml.impl.DomElementsNavigationManagerImpl"/>
+
+    <projectService serviceInterface="com.intellij.util.xml.DomManager"
+                    serviceImplementation="com.intellij.util.xml.impl.DomManagerImpl"/>
+    
+    <projectService serviceInterface="com.intellij.util.xml.actions.generate.DomTemplateRunner"
+                    serviceImplementation="com.intellij.util.xml.impl.DomTemplateRunnerImpl"/>
+
+    <metaDataContributor implementation="com.intellij.util.xml.impl.DomMetaDataContributor"/>
+    <semContributor implementation="com.intellij.util.xml.impl.DomSemContributor"/>
+
+    <annotator language="XML" implementationClass="com.intellij.util.xml.impl.DefaultDomAnnotator"/>
+    <lang.documentationProvider language="XML" implementationClass="com.intellij.util.xml.DomDocumentationProvider"/>
+
+    <usageTypeProvider implementation="com.intellij.util.xml.DomUsageTypeProvider"/>
+
+    <psi.referenceContributor language="XML" implementation="com.intellij.util.xml.impl.DomReferenceContributor"/>
+
+    <xml.elementDescriptorProvider implementation="com.intellij.util.xml.impl.DomDescriptorProvider"/>
+
+    <completion.contributor language="XML" implementationClass="com.intellij.util.xml.impl.DomCompletionContributor" id="dom" order="first, before xml"/>
+
+    <nameSuggestionProvider implementation="com.intellij.util.xml.DomNameSuggestionProvider" id="dom" order="first, before java"/>
+
+    <pom.declarationSearcher implementation="com.intellij.util.xml.impl.DomDeclarationSearcher"/>
+    <elementDescriptionProvider implementation="com.intellij.util.xml.impl.DefaultDomTargetDescriptionProvider" id="domDefault" order="last, before pomDefault"/>
+    <iconProvider implementation="com.intellij.util.xml.impl.DefaultDomTargetIconProvider" id="domDefault" order="last"/>
+    <iconProvider implementation="com.intellij.util.xml.DomFileIconProvider" id="domFileDefault" order="last"/>
+
+    <patterns.patternClass className="com.intellij.patterns.DomPatterns" alias="dom"/>
+    <xmlStructureViewBuilderProvider implementation="com.intellij.util.xml.structure.DomStructureViewBuilderProvider" order="last"/>
+  </extensions>
+</idea-plugin>
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/DTDModelLoader.java b/xml/dom-impl/src/com/intellij/util/dom/generator/DTDModelLoader.java
new file mode 100644
index 0000000..d4f23cd
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/DTDModelLoader.java
@@ -0,0 +1,339 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * XSD/DTD Model generator tool
+ *
+ * By Gregory Shrago
+ * 2002 - 2006
+ */
+package com.intellij.util.dom.generator;
+
+import com.wutka.dtd.*;
+import org.apache.xerces.xni.parser.XMLEntityResolver;
+
+import java.io.File;
+import java.util.*;
+
+/**
+ * @author Gregory.Shrago
+ * @author Konstantin Bulenkov
+ */
+public class DTDModelLoader implements ModelLoader {
+  private ModelDesc model;
+
+  public void loadModel(ModelDesc model, Collection<File> schemas, XMLEntityResolver resolver) throws Exception {
+    this.model = model;
+    for (File dtdFile : schemas) {
+      String fileName = dtdFile.getPath();
+      if (dtdFile.isDirectory() || !fileName.endsWith(".dtd") || fileName.endsWith("datatypes.dtd")) {
+        Util.log("skipping " + fileName);
+        continue;
+      }
+      Util.log("loading " + fileName+"..");
+      String ns = fileName.substring(fileName.lastIndexOf(File.separatorChar) + 1);
+      //loadDTDByXerces(ns, dtdFile, resolver);
+
+      loadDTDByWutka(ns, dtdFile);
+
+    }
+  }
+
+  private NamespaceDesc ensureNamespaceExists(String ns) {
+    if (!model.nsdMap.containsKey(ns)) {
+      Util.log("Adding default ns desc for: " + ns);
+      NamespaceDesc nsd = new NamespaceDesc(ns, model.nsdMap.get(""));
+      model.nsdMap.put(ns, nsd);
+    }
+    return model.nsdMap.get(ns);
+  }
+
+
+  private void loadDTDByWutka(String ns, File dtdFile) throws Exception {
+    DTDParser parser = new DTDParser(dtdFile, false);
+    // Parse the DTD and ask the parser to guess the root element
+    DTD dtd = parser.parse(true);
+    checkDTDRootElement(dtd);
+    processDTD(ns, dtd, model.jtMap, model.nsdMap);
+  }
+
+
+  private void processDTD(String namespace, DTD dtd, Map<String, TypeDesc> jtMap, Map<String, NamespaceDesc> nsdMap) {
+    final NamespaceDesc nsd = ensureNamespaceExists(namespace);
+    if (nsd.skip) return;
+    final ArrayList<String> resultQNames = new ArrayList<String>();
+    final DTDElement[] elements = new DTDElement[dtd.elements.size()];
+    int ptr = 1;
+
+    final HashSet<DTDElement> visitedElements = new HashSet<DTDElement>();
+    elements[0] = dtd.rootElement;
+
+    while (--ptr > -1) {
+      final DTDElement el = elements[ptr];
+      visitedElements.add(el);
+      final String typeName = model.toJavaTypeName(el.name, namespace);
+      final String typeQName = model.toJavaQualifiedTypeName(namespace, typeName, false);
+      if (resultQNames.contains(typeQName)) {
+        continue;
+      } else {
+        resultQNames.add(typeQName);
+      }
+      final TypeDesc td = new TypeDesc(el.name, namespace, typeName, TypeDesc.TypeEnum.CLASS);
+      boolean duplicates = false;
+      if ((el.content instanceof DTDAny) || (el.content instanceof DTDMixed)) {
+        FieldDesc fd = new FieldDesc(FieldDesc.SIMPLE, "value", "String", null, "null", false);
+        fd.realIndex = td.fdMap.size();
+        td.fdMap.put(fd.name, fd);
+      }
+      for (Object o : el.attributes.keySet()) {
+        String attrName = (String) o;
+        DTDAttribute attr = (DTDAttribute) el.attributes.get(attrName);
+        if (attr.decl == DTDDecl.FIXED || "ID".equals(attr.type)) {
+          continue;
+        }
+        boolean required = attr.decl == DTDDecl.REQUIRED;
+        FieldDesc fd1 = new FieldDesc(FieldDesc.ATTR, Util.toJavaFieldName(attrName), "String", null, "\"\"", required);
+        fd1.tagName = attrName;
+        fd1.documentation = "Attribute " + attrName + "";
+        fd1.realIndex = td.fdMap.size();
+        duplicates = Util.addToNameMap(td.fdMap, fd1, false) || duplicates;
+      }
+      final ArrayList<List<DTDItem>> choiceList = new ArrayList<List<DTDItem>>();
+      final LinkedList<Entry> plist = new LinkedList<Entry>();
+      if (el.content instanceof DTDContainer) {
+      //if ((el.content instanceof DTDChoice) || (el.content instanceof DTDSequence)) {
+        plist.add(new Entry(el.content, false, true));
+      }
+      while (!plist.isEmpty()) {
+        final Entry pentry = plist.removeFirst();
+
+        final DTDItem p = pentry.p;
+
+        if (p instanceof DTDName) {
+          final DTDName n = (DTDName) p;
+          final DTDElement nel = (DTDElement) dtd.elements.get(n.value);
+          final String pName = n.value;
+          final FieldDesc fd1 = new FieldDesc(FieldDesc.STR, Util.toJavaFieldName(pName), pName, null, "null", pentry.required && (n.cardinal == DTDCardinal.ONEMANY || n.cardinal == DTDCardinal.NONE));
+          fd1.tagName = pName;
+          if (nel != null) {
+            fd1.documentation = parseDTDItemDocumentation(dtd, nel, "Type " + nel.name + " documentation");
+          }
+          if (nel == null) {
+            fd1.type = model.toJavaTypeName(fd1.tagName, namespace);
+          } else if (nel.content instanceof DTDEmpty || nel.content instanceof DTDAny) {
+            boolean hasAttrFields = false;
+            boolean hasTextContents = nel.content instanceof DTDAny;
+            for (Object o : nel.attributes.values()) {
+              DTDAttribute attr = (DTDAttribute) o;
+              if (attr.decl != DTDDecl.FIXED && !"ID".equals(attr.type)) {
+                hasAttrFields = true;
+                break;
+              }
+            }
+            if (hasAttrFields || hasTextContents) {
+              fd1.clType = FieldDesc.OBJ;
+              fd1.type = model.toJavaTypeName(fd1.tagName, namespace);
+              fd1.contentQualifiedName = model.toJavaQualifiedTypeName(namespace, fd1.name, false);
+              fd1.def = "null";
+              // next type
+              if (!visitedElements.contains(nel)) {
+                elements[ptr++] = nel;
+              }
+            } else if (hasTextContents) {
+              fd1.clType = FieldDesc.STR;
+              fd1.type = "String";
+              fd1.def = "null";
+            } else {
+              fd1.clType = FieldDesc.BOOL;
+              fd1.type = "boolean";
+              fd1.def = "false";
+            }
+          } else if (nel.content instanceof DTDContainer) {
+            boolean hasAttrFields = false;
+            boolean hasTextField = false;
+            if ((nel.content instanceof DTDMixed) && ((DTDMixed) nel.content).getItemsVec().size() == 1) {
+              hasTextField = true;
+              for (Object o : nel.attributes.values()) {
+                final DTDAttribute attr = (DTDAttribute) o;
+                if (attr.decl != DTDDecl.FIXED && !"ID".equals(attr.type)) {
+                  hasAttrFields = true;
+                  break;
+                }
+              }
+            }
+            if (hasTextField && !hasAttrFields) {
+              fd1.clType = FieldDesc.STR;
+              fd1.type = "String";
+              fd1.def = "null";
+            } else {
+              fd1.clType = FieldDesc.OBJ;
+              fd1.type = model.toJavaTypeName(fd1.tagName, namespace);
+              fd1.contentQualifiedName = model.toJavaQualifiedTypeName(namespace, fd1.tagName, false);
+              // next type
+              if (!visitedElements.contains(nel)) {
+                elements[ptr++] = nel;
+              }
+            }
+          } else {
+            fd1.type = "ERROR:Name";
+          }
+          if ((pentry.many || n.cardinal.type >= 2) && fd1.clType != FieldDesc.BOOL) {
+            fd1.elementType = fd1.type;
+            fd1.elementName = fd1.name;
+            fd1.type = "List<" + fd1.elementType + ">";
+            fd1.name = Util.pluralize(fd1.name);
+            fd1.def = "new ArrayList(0)";
+            fd1.clType = -fd1.clType;
+            fd1.comment = "array of " + fd1.elementType;
+          }
+          fd1.realIndex = td.fdMap.size();
+          duplicates = Util.addToNameMap(td.fdMap, fd1, false) || duplicates;
+        } else if (p instanceof DTDContainer) {
+          final DTDContainer cont = (DTDContainer) p;
+          final boolean isChoice = cont instanceof DTDChoice;
+          // 0 - NONE, 1 - OPT, 2 - ZEROMANY, 3 - ONEMANY
+          final boolean required = !isChoice && pentry.required && p.cardinal != DTDCardinal.ZEROMANY && p.cardinal != DTDCardinal.OPTIONAL;
+          final boolean many = p.cardinal == DTDCardinal.ONEMANY || p.cardinal == DTDCardinal.ZEROMANY;
+          List<DTDItem> l = cont.getItemsVec();
+          if (!many && isChoice) {
+            choiceList.add(l);
+          }
+          for (DTDItem aL : l) {
+            plist.add(new Entry(aL, many, required));
+          }
+        } else {
+          Util.logerr("unknown item " + p);
+        }
+      }
+      td.duplicates = duplicates;
+      td.documentation = parseDTDItemDocumentation(dtd, el, "Type " + el.name + " documentation");
+      jtMap.put(model.toJavaQualifiedTypeName(namespace, td.name, false), td);
+      int i = 0;
+      for (FieldDesc fd : td.fdMap.values()) {
+        fd.idx = i++;
+      }
+      for (List<DTDItem> l : choiceList) {
+        ArrayList<DTDItem> clist = new ArrayList<DTDItem>();
+        LinkedList<DTDItem> elist = new LinkedList<DTDItem>();
+        for (i = 0; i < l.size(); i++) {
+          elist.add(l.get(i));
+        }
+        while (!elist.isEmpty()) {
+          DTDItem p = elist.removeFirst();
+          if (p instanceof DTDContainer) {
+            List<DTDItem> l2 = ((DTDContainer) p).getItemsVec();
+            for (DTDItem aL2 : l2) {
+              elist.addFirst(aL2);
+            }
+          } else if (p instanceof DTDName) {
+            clist.add(p);
+          }
+        }
+        boolean choiceOpt = true;
+        FieldDesc[] choice = new FieldDesc[clist.size()];
+        for (i = 0; i < choice.length; i++) {
+          DTDName p = (DTDName) clist.get(i);
+          String s = Util.toJavaFieldName(p.value);
+          FieldDesc fd = td.fdMap.get(s);
+          if (fd == null) {
+            fd = td.fdMap.get(Util.pluralize(s));
+            if (fd == null) {
+              Util.logerr("uknown choice element: " + s);
+              continue;
+            }
+          }
+          choice[i] = fd;
+          choice[i].choice = choice;
+          if (fd.required) choiceOpt = false;
+        }
+        for (i = 0; i < choice.length; i++) {
+          choice[i].choiceOpt = choiceOpt;
+        }
+      }
+    }
+    List<DTDEntity> entList = dtd.getItemsByType(DTDEntity.class);
+    for (DTDEntity entity : entList) {
+      String value = entity.value;
+      if (!value.startsWith("(") || !value.endsWith(")")) {
+        continue;
+      }
+      String typeName = model.toJavaTypeName(entity.name, namespace);
+      TypeDesc td = new TypeDesc(entity.name, namespace, typeName, TypeDesc.TypeEnum.ENUM);
+      StringTokenizer st = new StringTokenizer(value, "(|)");
+      while (st.hasMoreTokens()) {
+        final String s = st.nextToken();
+        td.fdMap.put(s, new FieldDesc(Util.computeEnumConstantName(s, td.name), s));
+      }
+      td.documentation = parseDTDItemDocumentation(dtd, entity, "Type " + entity.name + " documentation");
+      jtMap.put(model.toJavaQualifiedTypeName(namespace, td.name, true), td);
+    }
+  }
+
+  private static String parseDTDItemDocumentation(DTD dtd, DTDOutput obj, String title) {
+    int elementIndex = dtd.items.indexOf(obj);
+    if (elementIndex < 1) return null;
+    Object prev = dtd.items.get(elementIndex - 1);
+    if (!(prev instanceof DTDComment)) return null;
+    DTDComment comment = (DTDComment) prev;
+    return title + "\n" + "<pre>\n" + comment.getText() + "\n</pre>";
+  }
+
+  static class Entry {
+    boolean required;
+    boolean many;
+    DTDItem p;
+
+    Entry(DTDItem p, boolean many, boolean required) {
+      this.required = required;
+      this.many = many;
+      this.p = p;
+    }
+
+    Entry parent;
+    DTDItem it;
+    Vector choice;
+    int num;
+
+    Entry(Entry parent, DTDItem it, Vector choice, int num) {
+      this.parent = parent;
+      this.it = it;
+      this.choice = choice;
+      this.num = num;
+    }
+  }
+
+
+  private static void checkDTDRootElement(DTD dtd) throws Exception {
+    if (dtd.rootElement == null) {
+      StringBuffer sb = new StringBuffer("Empty root: possible elements: ");
+      HashMap map = new HashMap(dtd.elements);
+      for (Object o : dtd.elements.values()) {
+        DTDElement el = (DTDElement) o;
+        if (el.content instanceof DTDContainer) {
+          for (Object obj : ((DTDContainer) el.content).getItemsVec()) {
+            if (obj instanceof DTDName) {
+              map.remove(((DTDName) obj).value);
+            }
+          }
+        }
+      }
+      if (dtd.rootElement != null) return;
+      sb.append(map.size()).append(map.keySet());
+      throw new Exception(sb.toString());
+    }
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/DomGenDialog.java b/xml/dom-impl/src/com/intellij/util/dom/generator/DomGenDialog.java
new file mode 100644
index 0000000..8675b6b
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/DomGenDialog.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.dom.generator;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.DialogWrapper;
+
+import javax.swing.*;
+import java.io.File;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class DomGenDialog extends DialogWrapper{
+  final DomGenPanel panel;
+  final JComponent comp;
+
+  protected DomGenDialog(Project project) {
+    super(project);
+    panel = new DomGenPanel(project);
+    comp = panel.getComponent();
+    panel.restore();
+    setTitle("Generate Dom Model from XSD or DTD");
+    init();
+    getOKAction().putValue(Action.NAME, "Generate");
+  }
+
+  @Override
+  protected JComponent createCenterPanel() {
+    return comp;
+  }
+
+  @Override
+  protected void doOKAction() {
+    if (!panel.validate()) return;
+    final String location = panel.getLocation();
+    ModelLoader loader = location.toLowerCase().endsWith(".xsd") ? new XSDModelLoader() : new DTDModelLoader();
+    final JetBrainsEmitter emitter = new JetBrainsEmitter();
+    final MergingFileManager fileManager = new MergingFileManager();
+    if (panel.getAuthor().trim().length() > 0) {
+      emitter.setAuthor(panel.getAuthor());
+    }
+    final ModelGen modelGen = new ModelGen(loader, emitter, fileManager);
+    final NamespaceDesc desc = panel.getNamespaceDescriptor();
+    modelGen.setConfig(desc.name, location, desc, panel.getSkippedSchemas());
+    try {
+      final File output = new File(panel.getOutputDir());
+      modelGen.perform(output, new File(location).getParentFile());
+    } catch (Exception e) {
+      e.printStackTrace(System.err);
+    }
+    panel.saveAll();
+    super.doOKAction();
+  }
+
+  @Override
+  public void doCancelAction() {
+    panel.saveAll();
+    super.doCancelAction();
+  }
+
+  @Override
+  protected String getDimensionServiceKey() {
+    return getClass().getName();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/DomGenPanel.form b/xml/dom-impl/src/com/intellij/util/dom/generator/DomGenPanel.form
new file mode 100644
index 0000000..c914572
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/DomGenPanel.form
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.util.dom.generator.DomGenPanel">
+  <grid id="27dc6" binding="mainPanel" layout-manager="GridLayoutManager" row-count="8" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="20" y="20" width="424" height="262"/>
+    </constraints>
+    <properties/>
+    <clientProperties>
+      <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+    </clientProperties>
+    <border type="none" title="Dom Generator Config"/>
+    <children>
+      <component id="29b47" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="Namespace:"/>
+        </properties>
+      </component>
+      <vspacer id="e8ccd">
+        <constraints>
+          <grid row="7" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+        </constraints>
+      </vspacer>
+      <component id="f5680" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="Super Class:"/>
+        </properties>
+      </component>
+      <component id="20f66" class="javax.swing.JTextField" binding="mySuperClass">
+        <constraints>
+          <grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="327" height="22"/>
+          </grid>
+        </constraints>
+        <properties>
+          <text value="com.intellij.util.xml.DomElement"/>
+        </properties>
+      </component>
+      <component id="4a359" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="Package:"/>
+        </properties>
+      </component>
+      <component id="afd05" class="javax.swing.JTextField" binding="myPackage">
+        <constraints>
+          <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="327" height="22"/>
+          </grid>
+        </constraints>
+        <properties>
+          <text value="com.intellij.myFramework.model"/>
+        </properties>
+      </component>
+      <component id="d62dc" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="Output Dir:"/>
+        </properties>
+      </component>
+      <component id="6a48b" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myOutputDir" custom-create="true">
+        <constraints>
+          <grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="327" height="22"/>
+          </grid>
+        </constraints>
+        <properties/>
+      </component>
+      <component id="7fb9d" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="mySchemaLocation" custom-create="true">
+        <constraints>
+          <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="327" height="22"/>
+          </grid>
+        </constraints>
+        <properties/>
+      </component>
+      <component id="7940e" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="Scheme File:"/>
+        </properties>
+      </component>
+      <component id="833b2" class="javax.swing.JTextField" binding="myNamespace">
+        <constraints>
+          <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="327" height="22"/>
+          </grid>
+        </constraints>
+        <properties/>
+      </component>
+      <component id="bdaaf" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="Skip schemes:"/>
+        </properties>
+      </component>
+      <component id="f4732" class="javax.swing.JTextArea" binding="mySkipSchemas">
+        <constraints>
+          <grid row="6" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
+            <preferred-size width="150" height="50"/>
+          </grid>
+        </constraints>
+        <properties/>
+      </component>
+      <component id="54b59" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="@author:"/>
+        </properties>
+      </component>
+      <component id="b033e" class="javax.swing.JTextField" binding="myAuthor">
+        <constraints>
+          <grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="150" height="-1"/>
+          </grid>
+        </constraints>
+        <properties/>
+      </component>
+    </children>
+  </grid>
+</form>
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/DomGenPanel.java b/xml/dom-impl/src/com/intellij/util/dom/generator/DomGenPanel.java
new file mode 100644
index 0000000..29d956b
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/DomGenPanel.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.dom.generator;
+
+import com.intellij.ide.util.PropertiesComponent;
+import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
+import com.intellij.openapi.fileChooser.FileTypeDescriptor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.wm.IdeFocusManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.util.ArrayList;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class DomGenPanel {
+  private JPanel mainPanel;
+  private JTextField myNamespace;
+  private JTextField mySuperClass;
+  private TextFieldWithBrowseButton mySchemaLocation;
+  private JTextField myPackage;
+  private TextFieldWithBrowseButton myOutputDir;
+  private JTextArea mySkipSchemas;
+  private JTextField myAuthor;
+  private final Project myProject;
+
+  public DomGenPanel(Project project) {
+    myProject = project;
+  }
+
+  private void createUIComponents() {
+    mySchemaLocation = new TextFieldWithBrowseButton();
+    final String title = "Choose XSD or DTD schema";
+    mySchemaLocation.addBrowseFolderListener(title, "Make sure there are only necessary schemes in directory where your XSD or DTD schema is located", myProject, new FileTypeDescriptor(title, "xsd", "dtd"));
+    mySchemaLocation.getTextField().setEditable(false);
+    mySchemaLocation.addActionListener(new ActionListener() {
+      @Override
+      public void actionPerformed(ActionEvent e) {
+        final File file = new File(mySchemaLocation.getText());
+        if (file.exists() && file.getName().toLowerCase().endsWith(".xsd")) {
+          final VirtualFile vf = LocalFileSystem.getInstance().findFileByIoFile(file);
+          if (vf != null) {
+            final PsiFile psiFile = PsiManager.getInstance(myProject).findFile(vf);
+            if (psiFile instanceof XmlFile) {
+              final XmlDocument xml = ((XmlFile)psiFile).getDocument();
+              if (xml != null) {
+                final XmlTag rootTag = xml.getRootTag();
+                if (rootTag != null) {
+                  String target = null;
+                  ArrayList<String> ns = new ArrayList<String>();
+                  for (XmlAttribute attr : rootTag.getAttributes()) {
+                    if ("targetNamespace".equals(attr.getName())) {
+                      target = attr.getValue();
+                    }
+                    else if (attr.getName().startsWith("xmlns")) {
+                      ns.add(attr.getValue());
+                    }
+                  }
+
+                  ns.remove(target);
+                  if (target != null) {
+                    myNamespace.setText(target);
+                  }
+                  mySkipSchemas.setText(StringUtil.join(ArrayUtil.toStringArray(ns), "\n"));
+                }
+              }
+            }
+          }
+        }
+      }
+    });
+    myOutputDir = new TextFieldWithBrowseButton();
+    myOutputDir.addBrowseFolderListener("Select Output For Generated Files", "", myProject, FileChooserDescriptorFactory.getDirectoryChooserDescriptor("Output For Generated Files"));
+  }
+
+  public JComponent getComponent() {
+    return mainPanel;
+  }
+
+  public NamespaceDesc getNamespaceDescriptor() {
+    return new NamespaceDesc(myNamespace.getText().trim(), myPackage.getText().trim(), mySuperClass.getText().trim(), "", null, null, null, null);
+  }
+
+  public String getLocation() {
+    return mySchemaLocation.getText();
+  }
+
+  public String getOutputDir() {
+    return myOutputDir.getText();
+  }
+
+  private static final String PREFIX = "DomGenPanel.";
+  public void restore() {
+    myNamespace.setText(getValue("namespace", ""));
+    myPackage.setText(getValue("package", "com.intellij.myframework.model"));
+    mySchemaLocation.setText(getValue("schemaLocation", ""));
+    mySuperClass.setText(getValue("superClass", "com.intellij.util.xml.DomElement"));
+    myOutputDir.setText(getValue("output", ""));
+    mySkipSchemas.setText(getValue("skipSchemas", "http://www.w3.org/2001/XMLSchema\nhttp://www.w3.org/2001/XMLSchema-instance"));
+    myAuthor.setText(getValue("author", ""));
+  }
+
+  private static String getValue(String name, String defaultValue) {
+    return PropertiesComponent.getInstance().getOrInit(PREFIX + name, defaultValue);
+  }
+
+  private static void setValue(String name, String value) {
+    PropertiesComponent.getInstance().setValue(PREFIX + name, value);
+  }
+
+  public void saveAll() {
+    setValue("namespace", myNamespace.getText());
+    setValue("package", myPackage.getText());
+    setValue("schemaLocation", mySchemaLocation.getText());
+    setValue("superClass", mySuperClass.getText());
+    setValue("output", myOutputDir.getText());
+    setValue("skipSchemas", mySkipSchemas.getText());
+    setValue("author", myAuthor.getText());
+  }
+
+  public boolean validate() {
+    if (!new File(mySchemaLocation.getText()).exists()) {
+      Messages.showErrorDialog(myProject, "Schema location doesn't exist", "Error");
+      IdeFocusManager.getInstance(myProject).requestFocus(mySchemaLocation, true);
+      return false;
+    }
+
+    if (!new File(myOutputDir.getText()).exists()) {
+      Messages.showErrorDialog(myProject, "Output dir doesn't exist", "Error");
+      IdeFocusManager.getInstance(myProject).requestFocus(myOutputDir, true);
+      return false;
+    }
+
+    return true;
+  }
+
+  public String[] getSkippedSchemas() {
+    final String schemes = mySkipSchemas.getText().replaceAll("\r\n", "\n").trim();
+    if (schemes.length() > 0) {
+      return schemes.split("\n");
+    }
+    return new String[0];
+  }
+
+  public String getAuthor() {
+    return myAuthor.getText();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/Emitter.java b/xml/dom-impl/src/com/intellij/util/dom/generator/Emitter.java
new file mode 100644
index 0000000..49f9d83
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/Emitter.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * XSD/DTD Model generator tool
+ *
+ * By Gregory Shrago
+ * 2002 - 2006
+ */
+package com.intellij.util.dom.generator;
+
+import java.io.File;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public interface Emitter {
+  String JDOC_OPEN = "/**";
+  String JDOC_CONT = " * ";
+  String JDOC_CLOSE = " */";
+
+  void emit(FileManager fileManager, ModelDesc model, File outputRoot);
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/FieldDesc.java b/xml/dom-impl/src/com/intellij/util/dom/generator/FieldDesc.java
new file mode 100644
index 0000000..f7a3757
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/FieldDesc.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * XSD/DTD Model generator tool
+ *
+ * By Gregory Shrago
+ * 2002 - 2006
+ */
+package com.intellij.util.dom.generator;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class FieldDesc implements Comparable<FieldDesc> {
+  final static int STR = 1;
+  final static int BOOL = 2;
+  final static int OBJ = 3;
+  final static int ATTR = 4;
+  final static int DOUBLE = 5;
+  final static int SIMPLE = 6;
+
+  public FieldDesc(String name, String def) {
+    this.name = name;
+    this.def = def;
+  }
+
+  public FieldDesc(int clType, String name, String type, String elementType, String def, boolean required) {
+    this.clType = clType;
+    this.name = name;
+    this.type = type;
+    this.elementType = elementType;
+    this.def = def;
+    this.required = required;
+  }
+
+  int clType = STR;
+  String name;
+  String type;
+  String elementType;
+  String def;
+  boolean required;
+
+  int idx;
+  String tagName;
+  String elementName;
+  String comment;
+  FieldDesc[] choice;
+  boolean choiceOpt;
+
+  String documentation;
+  String simpleTypesString;
+  int duplicateIndex = -1;
+  int realIndex;
+  String contentQualifiedName;
+
+  public int compareTo(FieldDesc o) {
+    return name.compareTo(o.name);
+  }
+
+  public String toString() {
+    return "Field: " + name + ";" + type + ";" + elementName + ";" + elementType;
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/FileManager.java b/xml/dom-impl/src/com/intellij/util/dom/generator/FileManager.java
new file mode 100644
index 0000000..0eac71f
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/FileManager.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * XSD/DTD Model generator tool
+ *
+ * By Gregory Shrago
+ * 2002 - 2006
+ */
+package com.intellij.util.dom.generator;
+
+import java.io.File;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public interface FileManager {
+  public File releaseOutputFile(File outFile);
+  public File getOutputFile(File target);
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/GenerateDomModelAction.java b/xml/dom-impl/src/com/intellij/util/dom/generator/GenerateDomModelAction.java
new file mode 100644
index 0000000..ffd90a14
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/GenerateDomModelAction.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.dom.generator;
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.PlatformDataKeys;
+import com.intellij.openapi.project.Project;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class GenerateDomModelAction extends AnAction {
+  @Override
+  public void actionPerformed(AnActionEvent e) {
+    final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
+    if (project != null) {
+      new DomGenDialog(project).show();      
+    }
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/JetBrainsEmitter.java b/xml/dom-impl/src/com/intellij/util/dom/generator/JetBrainsEmitter.java
new file mode 100644
index 0000000..dadb504
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/JetBrainsEmitter.java
@@ -0,0 +1,679 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * XSD/DTD Model generator tool
+ *
+ * By Gregory Shrago
+ * 2002 - 2006
+ */
+package com.intellij.util.dom.generator;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.*;
+
+/**
+ * @author Gregory.Shrago
+ * @author Konstantin Bulenkov
+ */
+public class JetBrainsEmitter implements Emitter {
+  static final boolean NOT_COMPARE_MODE = true; // compare mode: skip package decl & all comments/javadoc
+  static final boolean JB_OFF = false;
+  static final boolean REPLACE_TYPES_WITH_INTERFACES = true;
+  private String AUTHOR = null;
+
+
+  public void emit(FileManager fileManager, ModelDesc model, File outputRoot) {
+    final NamespaceDesc nsdDef = model.nsdMap.get("");
+    final Set<String> simpleTypes = new TreeSet<String>();
+    for (TypeDesc td : model.jtMap.values()) {
+      generateClass(fileManager, td, model, outputRoot, simpleTypes);
+    }
+//        for (Iterator it = nsdMap.values().iterator(); it.hasNext(); ) {
+//            NamespaceDesc nsd = (NamespaceDesc) it.next();
+//            generateSuper(nsd, outputRoot);
+//            generateHelper(nsd, jtMap,  outputRoot);
+//        }
+    generateSuper(fileManager, nsdDef, model, outputRoot);
+    generateHelper(fileManager, nsdDef, model, outputRoot);
+
+    Util.log("SimpleTypes log:");
+    for (String s : simpleTypes) {
+      Util.log("  " + s);
+    }
+  }
+
+  public void generateClass(FileManager fileManager, TypeDesc td, ModelDesc model, File outDir, Set<String> simpleTypes) {
+    final Map<String, TypeDesc> jtMap = model.jtMap;
+    final Map<String, NamespaceDesc> nsdMap = model.nsdMap;
+    final NamespaceDesc nsd = nsdMap.get(nsdMap.containsKey(td.xsNamespace) ? td.xsNamespace : "");
+    final String typeName = td.name;
+    final String typeQName = model.getNSDPrefix(td) + typeName;
+    final String pkgName = typeQName.lastIndexOf('.') > -1 ? typeQName.substring(0, typeQName.lastIndexOf('.')) : "";
+
+    final File outFile = fileManager.getOutputFile(new File(outDir, toJavaFileName(typeQName)));
+    PrintWriter out = null;
+    try {
+      TreeSet<String> externalClasses = new TreeSet<String>();
+      if (td.type != TypeDesc.TypeEnum.ENUM) {
+        if (nsd.imports != null) {
+          StringTokenizer st = new StringTokenizer(nsd.imports, ";");
+          while (st.hasMoreTokens()) {
+            externalClasses.add(st.nextToken());
+          }
+        }
+        if (!model.getNSDPrefix("", nsd.superClass, false).equals(model.getNSDPrefix(td))) {
+          externalClasses
+            .add(model.getNSDPrefix("", nsd.superClass, false) + nsd.superClass.substring(nsd.superClass.lastIndexOf(".") + 1));
+        }
+        if (td.supers != null) {
+          for (TypeDesc tds : td.supers) {
+            String pkg1 = model.getNSDPrefix(tds);
+            String pkg2 = model.getNSDPrefix(td);
+            if (!pkg1.equals(pkg2)) {
+              externalClasses.add(model.getNSDPrefix(tds) + tds.name);
+            }
+          }
+        }
+        for (FieldDesc fd : td.fdMap.values()) {
+          if (fd.simpleTypesString != null && fd.simpleTypesString.indexOf(":fully-qualified-classType;") != -1) {
+            externalClasses.add("com.intellij.psi.PsiClass");
+          }
+          if (fd.contentQualifiedName != null && fd.contentQualifiedName.indexOf('.') > 0) {
+            String pkgNameFD = fd.contentQualifiedName.substring(0, fd.contentQualifiedName.lastIndexOf('.'));
+            if (!pkgNameFD.equals(pkgName)) {
+              externalClasses.add(fd.contentQualifiedName);
+            }
+          }
+          if (fd.clType < 0) {
+            externalClasses.add("java.util.List");
+          }
+          externalClasses.add("org.jetbrains.annotations.NotNull");
+          externalClasses.add("com.intellij.util.xml.*");
+        }
+      }
+
+      Util.log("Generating type: " + typeName + "..");
+      out = new PrintWriter(new FileWriter(outFile));
+      if (NOT_COMPARE_MODE) {
+        out.println("// Generated on " + new Date());
+        out.println("// DTD/Schema  :    " + nsd.name);
+      }
+      out.println("");
+      if (NOT_COMPARE_MODE && pkgName != null && pkgName.length() > 0) {
+        out.println("package " + pkgName + ";");
+      }
+      out.println();
+      if (td.type != TypeDesc.TypeEnum.ENUM) {
+        boolean javaLang = false;
+        boolean external = false;
+        for (String s : externalClasses) {
+          if (s.startsWith("java.")) {
+            javaLang = true;
+            continue;
+          }
+          external = true;
+          out.println("import " + s + ";");
+        }
+        if (javaLang) {
+          if (external) out.println();
+          for (String s : externalClasses) {
+            if (!s.startsWith("java.")) continue;
+            out.println("import " + s + ";");
+          }
+        }
+        out.println();
+      }
+      if (td.type == TypeDesc.TypeEnum.ENUM) {
+        boolean text = false;
+        for (Map.Entry<String, FieldDesc> e : td.fdMap.entrySet()) {
+          if (!e.getKey().equals(e.getValue().name)) {
+            text = true;
+            break;
+          }
+        }
+        if (NOT_COMPARE_MODE) {
+          out.println(JDOC_OPEN);
+          out.println(JDOC_CONT + td.xsNamespace + ":" + td.xsName + " enumeration.");
+          if (AUTHOR != null) out.println(JDOC_CONT + AUTHOR);
+          printDocumentation(out, td.documentation, JDOC_CONT);
+
+          out.println(JDOC_CLOSE);
+        }
+        out.print("public enum " + typeName + (text ? (JB_OFF ? "" : " implements com.intellij.util.xml.NamedEnum") : ""));
+        out.print(" {");
+        boolean first = true;
+        for (Map.Entry<String, FieldDesc> e : td.fdMap.entrySet()) {
+          String val = e.getKey();
+          FieldDesc id = e.getValue();
+          if (first) {
+            first = false;
+            out.println("");
+          }
+          else {
+            out.println(",");
+          }
+          if (text) {
+            out.print("\t" + id.name + " (\"" + val + "\")");
+          }
+          else {
+            out.print("\t" + id.name);
+          }
+        }
+        if (text) {
+          out.println(";");
+          out.println();
+          out.println("\tprivate final String value;");
+          out.println("\tprivate " + typeName + "(String value) { this.value = value; }");
+          out.println("\tpublic String getValue() { return value; }");
+        }
+        out.println();
+        out.println("}");
+        return;
+      }
+      if (NOT_COMPARE_MODE) {
+        out.println(JDOC_OPEN);
+        if (td.type == TypeDesc.TypeEnum.GROUP_INTERFACE) {
+          out.println(JDOC_CONT + td.xsNamespace + ":" + td.xsName + " model group interface.");
+        }
+        else {
+          out.println(JDOC_CONT + td.xsNamespace + ":" + td.xsName + " interface.");
+        }
+        printDocumentation(out, td.documentation, JDOC_CONT);
+        if (AUTHOR != null) out.println(JDOC_CONT + AUTHOR);
+        out.println(JDOC_CLOSE);
+      }
+      out.print("public interface " + typeName);
+      if (nsd.superClass != null || (td.supers != null && td.supers.length > 1)) {
+        boolean comma = false;
+        if (td.type != TypeDesc.TypeEnum.GROUP_INTERFACE) {
+          if (nsd.superClass != null) {
+            out.print(" extends " + nsd.superClass.substring(nsd.superClass.lastIndexOf(".") + 1));
+            comma = true;
+          }
+        }
+        if (td.supers != null && td.supers.length > 0) {
+          if (!comma) out.print(" extends ");
+          for (TypeDesc aSuper : td.supers) {
+            if (comma) {
+              out.print(", ");
+            }
+            else {
+              comma = true;
+            }
+            out.print(aSuper.name);
+          }
+        }
+      }
+      out.println(" {");
+
+      FieldDesc[] fields = td.fdMap.values().toArray(new FieldDesc[td.fdMap.size()]);
+      if (fields.length == 0) {
+        Util.logwarn("no fields in: " + td.xsName);
+      }
+      Arrays.sort(fields, new Comparator<FieldDesc>() {
+        public int compare(FieldDesc o1, FieldDesc o2) {
+          return o1.realIndex - o2.realIndex;
+        }
+      });
+      out.println("");
+      for (FieldDesc field : fields) {
+        String tagName = field.tagName;
+        String type = field.type;
+        String elementType = field.elementType;
+        String name = field.name;
+        String paramName = toJavaIdName(field.clType > 0 ? name : field.elementName);
+        String javaDocTagName = field.clType < 0 ? tagName + " children" : tagName != null ? tagName + " child" : "simple content";
+        boolean isAttr = field.clType == FieldDesc.ATTR;
+        boolean isList = field.clType < 0;
+
+        if (name.equals("class")) { // getClass method prohibited
+          name = "clazz";
+        }
+        boolean nameChanged = field.tagName != null &&
+                              !name
+                                .equals(isList ? Util.pluralize(Util.toJavaFieldName(field.tagName)) : Util.toJavaFieldName(field.tagName));
+
+        // annotations
+        // types replacement
+        String newType = field.clType < 0 ? elementType : type;
+        String converterString = null;
+        if (field.simpleTypesString != null) {
+          if (field.simpleTypesString.indexOf(":fully-qualified-classType;") != -1) { // localType, remoteType, etc.
+            newType = "PsiClass";
+            //converterString = (JB_OFF ? "//" : "")+"\t@Convert (PsiClassReferenceConverter.class)";
+          }
+          else if (field.simpleTypesString.indexOf(":ejb-linkType;") != -1) {
+          }
+          else if (field.simpleTypesString.indexOf(":ejb-ref-nameType;") != -1) { // jndi-nameType
+          }
+          else if (field.simpleTypesString.indexOf(":pathType;") != -1) {
+          }
+          else if (field.simpleTypesString.indexOf(":java-identifierType;") != -1) {
+            //out.println((JB_OFF ? "//" : "") +"\t@Convert (JavaIdentifierConverter.class)");
+          }
+          else if (field.simpleTypesString.indexOf(":QName;") != -1) {
+            // ???
+          }
+          else if (field.simpleTypesString.indexOf(":integer;") != -1) { // BigDecimal
+            newType = REPLACE_TYPES_WITH_INTERFACES ? "Integer" : "int";
+          }
+          else if (field.simpleTypesString.indexOf(":int;") != -1) {
+            newType = REPLACE_TYPES_WITH_INTERFACES ? "Integer" : "int";
+          }
+          else if (field.simpleTypesString.indexOf(":byte;") != -1) {
+            newType = REPLACE_TYPES_WITH_INTERFACES ? "Byte" : "byte";
+          }
+          else if (field.simpleTypesString.indexOf(":short;") != -1) {
+            newType = REPLACE_TYPES_WITH_INTERFACES ? "Short" : "short";
+          }
+          else if (field.simpleTypesString.indexOf(":long;") != -1) {
+            newType = REPLACE_TYPES_WITH_INTERFACES ? "Long" : "long";
+          }
+          else if (field.simpleTypesString.indexOf(":float;") != -1) {
+            newType = REPLACE_TYPES_WITH_INTERFACES ? "Float" : "float";
+          }
+          else if (field.simpleTypesString.indexOf(":double;") != -1) {
+            newType = REPLACE_TYPES_WITH_INTERFACES ? "Double" : "double";
+          }
+          else if (field.simpleTypesString.indexOf(":boolean;") != -1) { // true-falseType
+            newType = REPLACE_TYPES_WITH_INTERFACES ? "Boolean" : "boolean";
+          }
+          for (int idx = 0; idx != -1;) {
+            simpleTypes.add(field.simpleTypesString.substring(idx));
+            idx = field.simpleTypesString.indexOf(';', idx) + 1;
+            if (idx == 0) break;
+          }
+        }
+        if (REPLACE_TYPES_WITH_INTERFACES) {
+          switch (Math.abs(field.clType)) {
+            case FieldDesc.ATTR:
+              newType = "GenericAttributeValue<" + newType + ">";
+              break;
+            case FieldDesc.BOOL:
+              newType = "GenericDomValue<Boolean>";
+              break;
+            case FieldDesc.SIMPLE:
+              break;
+            case FieldDesc.STR:
+              newType = "GenericDomValue<" + newType + ">";
+              break;
+            case FieldDesc.OBJ: {
+              TypeDesc ftd = jtMap.get(field.contentQualifiedName);
+              if (ftd != null && ftd.type == TypeDesc.TypeEnum.ENUM) {
+                newType = "GenericDomValue<" + ftd.name + ">";
+              }
+              break;
+            }
+          }
+        }
+        if (newType != null && isList) {
+          elementType = newType;
+        }
+        else if (newType != null) {
+          type = newType;
+        }
+        if (isList) {
+          type = "List<" + elementType + ">";
+        }
+
+        StringBuffer sbAnnotations = new StringBuffer();
+        if (field.clType == FieldDesc.SIMPLE) {
+          //  sbAnnotations.append((JB_OFF ? "//" : "") +"\t@TagValue");
+        }
+        else if (isAttr && nameChanged) {
+          sbAnnotations.append((JB_OFF ? "//" : "") + "\t@Attribute (\"").append(tagName).append("\")");
+        }
+        else if (isList) {
+          // sbAnnotations.append((JB_OFF ? "//" : "") +"\t@SubTagList (\"" + tagName + "\")");
+          if (nameChanged) {
+            sbAnnotations.append((JB_OFF ? "//" : "") + "\t@SubTag (\"").append(tagName).append("\")");
+          }
+          else {
+            if (isBadTagName(tagName)) {
+              sbAnnotations.append((JB_OFF ? "//" : "") + "\t@SubTagList (\"").append(tagName).append("\")");
+            }
+          }
+        }
+        else {
+          if (field.duplicateIndex >= 0) {
+            sbAnnotations.append((JB_OFF ? "//" : "") + "\t@SubTag (value = \"").append(tagName).append("\", index = ")
+              .append(field.duplicateIndex - 1).append(")");
+          }
+          else if (field.clType == FieldDesc.BOOL) {
+            sbAnnotations.append((JB_OFF ? "//" : "") + "\t@SubTag (value = \"").append(tagName).append("\", indicator = true)");
+          }
+          else if (!name.equals(field.name)) {
+            sbAnnotations.append((JB_OFF ? "//" : "") + "\t@SubTag (\"").append(tagName).append("\")");
+          }
+        }
+        if (converterString != null) {
+          sbAnnotations.append("\n").append(converterString);
+        }
+        if (NOT_COMPARE_MODE && td.type != TypeDesc.TypeEnum.GROUP_INTERFACE) {
+          out.println("\t" + JDOC_OPEN);
+          final String text;
+          if (isList) {
+            text = "the list of " + javaDocTagName;
+          }
+          else {
+            text = "the value of the " + javaDocTagName;
+          }
+          out.println("\t" + JDOC_CONT + "Returns " + text + ".");
+          printDocumentation(out, field.documentation, "\t" + JDOC_CONT);
+          out.println("\t" + JDOC_CONT + "@return " + text + ".");
+          out.println("\t" + JDOC_CLOSE);
+        }
+        out.println((JB_OFF ? "//" : "") + "\t@NotNull");
+        if (td.type != TypeDesc.TypeEnum.GROUP_INTERFACE) {
+          if (sbAnnotations.length() > 0) out.println(sbAnnotations);
+          if (field.required) {
+            out.println((JB_OFF ? "//" : "") + "\t@Required");
+          }
+        }
+        out.print("\t");
+        //out.print("public ");
+        out.print(type);
+        out.print(" ");
+        out.print("get");
+        out.print(Util.capitalize(name));
+        out.println("();");
+
+        final boolean genAddRemoveInsteadOfSet = true;
+        if (!genAddRemoveInsteadOfSet || field.clType > 0) {
+          if (field.clType == FieldDesc.SIMPLE) {
+            if (NOT_COMPARE_MODE && td.type != TypeDesc.TypeEnum.GROUP_INTERFACE) {
+              out.println("\t" + JDOC_OPEN);
+              if (field.clType < 0) {
+                out.println("\t" + JDOC_CONT + "Sets the list of " + javaDocTagName + ".");
+              }
+              else {
+                out.println("\t" + JDOC_CONT + "Sets the value of the " + javaDocTagName + ".");
+              }
+              out.println("\t" + JDOC_CONT + "@param " + paramName + " the new value to set");
+              out.println("\t" + JDOC_CLOSE);
+              if (sbAnnotations.length() > 0) out.println(sbAnnotations);
+            }
+            out.print("\t");
+            //out.print("public ");
+            out.print("void set");
+            out.print(Util.capitalize(name));
+            out.print("(");
+            if (field.required) {
+              out.print((JB_OFF ? "" : "@NotNull "));
+            }
+            out.print(type);
+            out.print(" ");
+            out.print(paramName);
+            out.println(");");
+          }
+        }
+        else {
+          if (NOT_COMPARE_MODE && td.type != TypeDesc.TypeEnum.GROUP_INTERFACE) {
+            out.println("\t" + JDOC_OPEN);
+            out.println("\t" + JDOC_CONT + "Adds new child to the list of " + javaDocTagName + ".");
+            out.println("\t" + JDOC_CONT + "@return created child");
+            out.println("\t" + JDOC_CLOSE);
+            if (sbAnnotations.length() > 0) out.println(sbAnnotations);
+          }
+          out.print("\t");
+          //out.print("public ");
+          out.print(elementType + " add");
+          out.print(Util.capitalize(field.elementName));
+          out.println("();");
+        }
+
+        out.println("");
+        out.println("");
+      }
+      out.println("}");
+    }
+    catch (IOException ex) {
+      ex.printStackTrace();
+    }
+    finally {
+      try {
+        out.close();
+      }
+      catch (Exception ex) {
+      }
+      fileManager.releaseOutputFile(outFile);
+    }
+  }
+
+  private static boolean isBadTagName(String tagName) {
+    if (Character.isUpperCase(tagName.charAt(0))) return false;
+    final char[] chars = tagName.toCharArray();
+    for (int i = 1; i < chars.length; i++) {
+      if (Character.isUpperCase(chars[i])) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  private void generateSuper(FileManager fileManager, NamespaceDesc nsd, ModelDesc model, File outDir) {
+    if (nsd.superClass == null || nsd.superClass.length() == 0) return;
+    final String typeName = nsd.superClass.substring(nsd.superClass.lastIndexOf(".") + 1);
+    final String typeQName = model.toJavaQualifiedTypeName("", nsd.superClass, false);
+    String pkgName = typeQName.substring(0, typeQName.lastIndexOf('.'));
+    File outFile = new File(outDir, toJavaFileName(typeQName));
+    outFile = fileManager.getOutputFile(outFile);
+    PrintWriter out = null;
+    try {
+      Util.log("Generating type: " + typeName + "..");
+      out = new PrintWriter(new FileWriter(outFile));
+      out.println("// Generated on " + new Date());
+      out.println("// DTD/Schema  :    " + nsd.name);
+      out.println("");
+      if (pkgName != null) {
+        out.println("package " + pkgName + ";");
+      }
+      out.println("");
+      out.println("");
+      out.println(JDOC_OPEN);
+      out.println(JDOC_CONT + nsd.name + " base interface.");
+      if (AUTHOR != null) out.println(JDOC_CONT + AUTHOR);
+      out.println(JDOC_CLOSE);
+      out.print("public interface " + typeName + " ");
+      out.println("{");
+
+
+      out.println("}");
+    }
+    catch (IOException ex) {
+      ex.printStackTrace();
+    }
+    finally {
+      try {
+        if (out != null) {
+          out.close();
+        }
+      }
+      catch (Exception ex) {
+      }
+      fileManager.releaseOutputFile(outFile);
+    }
+  }
+
+  private void generateHelper(FileManager fileManager, NamespaceDesc nsd, ModelDesc model, File outDir) {
+    final Map<String, TypeDesc> jtMap = model.jtMap;
+    final Map<String, NamespaceDesc> nsdMap = model.nsdMap;
+    if (nsd.helperClass == null || nsd.helperClass.length() == 0) return;
+    ArrayList<TypeDesc> jtList = new ArrayList<TypeDesc>();
+    for (TypeDesc td : jtMap.values()) {
+      if (td.type != TypeDesc.TypeEnum.CLASS) continue;
+//            if (!nsd.name.equals(td.xsNamespace)) {
+//                continue;
+//            }
+      jtList.add(td);
+    }
+    if (jtList.size() == 0) return;
+
+    String typeName = nsd.helperClass.substring(nsd.helperClass.lastIndexOf(".") + 1);
+    final String typeQName = model.toJavaQualifiedTypeName("", nsd.helperClass, false);
+    String pkgName = typeQName.substring(0, typeQName.lastIndexOf('.'));
+    File outFile = new File(outDir, toJavaFileName(typeQName));
+    outFile = fileManager.getOutputFile(outFile);
+    PrintWriter out = null;
+    try {
+      Util.log("Generating type: " + typeName + "..");
+      out = new PrintWriter(new FileWriter(outFile));
+      out.println("// Generated on " + new Date());
+      out.println("// DTD/Schema  :    " + nsd.name);
+      out.println("");
+      if (pkgName != null) {
+        out.println("package " + pkgName + ";");
+      }
+      out.println("");
+      out.println("");
+      out.println(JDOC_OPEN);
+      out.println(JDOC_CONT + nsd.name + " helper class.");
+      if (AUTHOR != null) out.println(JDOC_CONT + AUTHOR);
+      out.println(JDOC_CLOSE);
+      out.print("public class " + typeName + " ");
+      out.println("{");
+      out.println("");
+      out.println("\tprivate interface GetName { String getName(Object o); }");
+      out.println("\tprivate static java.util.HashMap<Class, GetName> nameMap = new java.util.HashMap();");
+      out.println("\tstatic {");
+
+      for (TypeDesc td : jtList) {
+        ArrayList<FieldDesc> fields = new ArrayList<FieldDesc>(td.fdMap.values());
+        Collections.sort(fields, new Comparator<FieldDesc>() {
+          public int compare(FieldDesc o1, FieldDesc o2) {
+            return o1.realIndex - o2.realIndex;
+          }
+        });
+        int guessPriority = 0;
+        FieldDesc guessedField = null;
+        for (FieldDesc fd : fields) {
+          if (fd.clType == FieldDesc.STR || fd.clType == FieldDesc.SIMPLE || fd.clType == FieldDesc.ATTR) {
+            if (fd.name.equals("name") && guessPriority < 10) {
+              guessPriority = 10;
+              guessedField = fd;
+            }
+            else if (fd.name.endsWith("Name")) {
+              if ((fd.name.endsWith(Util.decapitalize(td.name + "Name")) || fd.realIndex < 2) && guessPriority < 10) {
+                guessPriority = 10;
+                guessedField = fd;
+              }
+              else if (fd.name.endsWith(Util.decapitalize("DisplayName")) && guessPriority < 5) {
+                guessPriority = 5;
+                guessedField = fd;
+              }
+              else if (guessPriority < 3) {
+                guessPriority = 3;
+                guessedField = fd;
+              }
+            }
+            else if (fd.name.equals("value") && guessPriority < 1) {
+              guessPriority = 1;
+              guessedField = fd;
+            }
+          }
+          else if ((fd.clType == -FieldDesc.OBJ || fd.clType == -FieldDesc.STR) && fd.name.endsWith("displayNames") && guessPriority < 5) {
+            guessPriority = 5;
+            guessedField = fd;
+          }
+        }
+        out.println();
+        String qname = model.getNSDPrefix(td) + td.name;
+        String tdNameString = "\"" + toPresentationName(td.name) + "\"";
+        out.println("\t\tnameMap.put(" + qname + ".class, new GetName() {");
+        out.println("\t\t\tpublic String getName(Object o) {");
+        if (guessedField != null) {
+          out.println("\t\t\t\t" + qname + " my = (" + qname + ") o;");
+          String getter = "my.get" + Util.capitalize(guessedField.name) + "()";
+          if (guessedField.clType > 0) {
+            out.println("\t\t\t\tString s = o==null? null:" + getter +
+                        (guessedField.clType == FieldDesc.STR || guessedField.clType == FieldDesc.ATTR ? ".getValue();" : ";"));
+            out.println("\t\t\t\treturn s==null?" + tdNameString + ":s;");
+          }
+          else {
+            out.println("\t\t\t\treturn (o!=null && " + getter + "!=null && " + getter + ".size()>0)?");
+            out.println("\t\t\t\t\tgetPresentationName(" + getter + ".get(0), null):" + tdNameString + ";");
+          }
+        }
+        else {
+          out.println("\t\t\t\treturn " + tdNameString + ";");
+        }
+        out.println("\t\t\t}");
+        out.println("\t\t});");
+      }
+      out.println("\t}");
+
+      out.println("\tpublic static String getPresentationName(Object o, String def) {");
+      out.println("\t\tGetName g = o!=null? nameMap.get(o.getClass().getInterfaces()[0]):null;");
+      out.println("\t\treturn g != null?g.getName(o):def;");
+      out.println("\t}");
+      out.println("}");
+    }
+    catch (IOException ex) {
+      ex.printStackTrace();
+    }
+    finally {
+      try {
+        out.close();
+      }
+      catch (Exception ex) {
+      }
+      fileManager.releaseOutputFile(outFile);
+    }
+  }
+
+  public static void printDocumentation(PrintWriter out, String str, String prefix) {
+    if (str == null) return;
+    StringTokenizer st = new StringTokenizer(str, "\n\r");
+    while (st.hasMoreTokens()) {
+      String line = prefix + st.nextToken();
+      out.println(line);
+    }
+  }
+
+  public static String toPresentationName(String typeName) {
+    StringBuffer sb = new StringBuffer(typeName.length() + 10);
+    boolean prevUp = true;
+    for (int i = 0; i < typeName.length(); i++) {
+      char c = typeName.charAt(i);
+      if (Character.isUpperCase(c) && !prevUp) {
+        sb.append(' ');
+      }
+      sb.append(c);
+      prevUp = Character.isUpperCase(c);
+    }
+    return sb.toString();
+  }
+
+  private static String toJavaFileName(String typeName) {
+    return typeName.replace('.', File.separatorChar) + ".java";
+  }
+
+  public static String toJavaIdName(String javaFieldName) {
+    if (Util.RESERVED_NAMES_MAP.containsKey(javaFieldName)) {
+      javaFieldName += "_";
+    }
+    return javaFieldName;
+  }
+
+
+  public void setAuthor(String author) {
+    AUTHOR = "@author " + author;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/Main.java b/xml/dom-impl/src/com/intellij/util/dom/generator/Main.java
new file mode 100644
index 0000000..4f84317
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/Main.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * XSD/DTD Model generator tool
+ *
+ * By Gregory Shrago
+ * 2002 - 2006
+ */
+package com.intellij.util.dom.generator;
+
+import java.io.File;
+
+/**
+ * @author Gregory.Shrago
+ * @author Konstantin Bulenkov
+ */
+public class Main {
+
+
+  public static void main(String argv[]) throws Exception {
+    if (argv.length != 4) {
+      System.out.println("Usage: Main <XSD or DTD> <input folder> <output folder> <config xml>");
+    }
+    String mode = argv[0];
+    final ModelLoader loader;
+    if (mode.equalsIgnoreCase("xsd")) {
+      loader = new XSDModelLoader();
+    }
+    else if (mode.equalsIgnoreCase("dtd")) {
+      loader = new DTDModelLoader();
+    }
+    else {
+      System.out.println("'"+mode+"' format not supported");
+      System.exit(-1);
+      return;
+    }
+    final File modelRoot = new File(argv[1]);
+    final File outputRoot = new File(argv[2]);
+    final File configXml = new File(argv[3]);
+
+    outputRoot.mkdirs();
+    final ModelGen modelGen = new ModelGen(loader);
+    modelGen.loadConfig(configXml);
+    modelGen.perform(outputRoot, modelRoot);
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/MergingFileManager.java b/xml/dom-impl/src/com/intellij/util/dom/generator/MergingFileManager.java
new file mode 100644
index 0000000..ac2ea31
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/MergingFileManager.java
@@ -0,0 +1,248 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * XSD/DTD Model generator tool
+ *
+ * By Gregory Shrago
+ * 2002 - 2006
+ */
+package com.intellij.util.dom.generator;
+
+import com.intellij.util.ArrayUtil;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.TreeSet;
+
+/**
+ * @author Gregory.Shrago
+ * @author Konstantin Bulenkov
+ */
+public class MergingFileManager implements FileManager {
+
+  public File getOutputFile(File target) {
+    File outFile = target;
+    if (!outFile.getParentFile().exists() && !outFile.getParentFile().mkdirs()) {
+      Util.logerr("parent mkdirs failed: " + outFile);
+      return null;
+    }
+    for (int i = 0; outFile.exists(); i++) {
+      outFile = new File(target.getParentFile(), target.getName() + ".tmp." + i);
+    }
+    return outFile;
+  }
+
+  public File releaseOutputFile(File outFile) {
+    int idx = outFile.getName().indexOf(".tmp.");
+    File target = outFile;
+    if (idx > -1) {
+      target = new File(outFile.getParentFile(), outFile.getName().substring(0, idx));
+      String[] curLines = loadFile(outFile);
+      String[] prevLines = loadFile(target);
+      String[] mergedLines = mergeLines(curLines, prevLines);
+      if (mergedLines != prevLines) {
+        if (mergedLines == curLines) {
+          if (target.exists() && !target.delete()) {
+            Util.logerr("file replace failed: " + target);
+            outFile.delete();
+          } else {
+            outFile.renameTo(target);
+            Util.logwarn("file replaced: " + target);
+          }
+        } else {
+          outFile.delete();
+          if (target.exists() && !target.delete()) {
+            Util.logerr("file replace failed: " + target);
+          } else {
+            writeFile(target, mergedLines);
+            Util.logwarn("file merged: " + target);
+          }
+        }
+      } else {
+        outFile.delete();
+      }
+    }
+    return target;
+  }
+
+  private static String[] mergeLines(String[] curLines, String[] prevLines) {
+    if (prevLines.length == 0) return curLines;
+    ArrayList<String> merged = new ArrayList<String>();
+    int curIdx = 0, prevIdx = 0;
+    String cur, prev;
+    boolean classScope = false;
+    boolean importMerged = false;
+    for (int i = 0; i < Math.max(curLines.length, prevLines.length); i++) {
+      cur = curIdx < curLines.length ? curLines[curIdx] : "";
+      prev = prevIdx < prevLines.length ? prevLines[prevIdx] : "";
+      if (classScope) {
+        merged.addAll(Arrays.asList(curLines).subList(curIdx, curLines.length));
+        break;
+      } else if (prev.trim().startsWith("import ") || cur.trim().startsWith("import ")) {
+        if (importMerged) continue;
+        importMerged = true;
+        int[] indices = new int[]{curIdx, prevIdx};
+        mergeImports(merged, curLines, prevLines, indices);
+        curIdx = indices[0];
+        prevIdx = indices[1];
+      } else if (cur.equals(prev)) {
+        if (cur.trim().startsWith("public interface ")
+                || cur.trim().startsWith("public enum ")) classScope = true;
+        merged.add(cur);
+        curIdx++;
+        prevIdx++;
+      } else if (prev.trim().startsWith("@")) {
+        merged.add(prev);
+        prevIdx++;
+      } else if (cur.trim().startsWith("@")) {
+        merged.add(cur);
+        curIdx++;
+      } else if (cur.trim().startsWith("package  ") && prev.trim().startsWith("package ")) {
+        merged.add(prev);
+        curIdx++;
+        prevIdx++;
+      } else if (cur.trim().startsWith("public interface ") && prev.trim().startsWith("public interface ")) {
+        classScope = true;
+        prevIdx = addAllStringsUpTo(merged, prevLines, prevIdx, "{");
+        curIdx = addAllStringsUpTo(null, curLines, curIdx, "{");
+      } else if (cur.trim().startsWith("* ")) {
+        curIdx = addAllStringsUpTo(merged, curLines, curIdx, "*/");
+        if (prev.trim().startsWith("* ") || prev.trim().endsWith("*/")) {
+          prevIdx = addAllStringsUpTo(null, prevLines, prevIdx, "*/");
+        }
+      } else {
+        merged.add(cur);
+        curIdx++;
+        prevIdx++;
+      }
+    }
+    String[] mergedLines = ArrayUtil.toStringArray(merged);
+    if (compareLines(mergedLines, prevLines, 2) == 0) {
+      return prevLines;
+    } else if (compareLines(mergedLines, curLines, 2) == 0) {
+      return curLines;
+    } else {
+      return mergedLines;
+    }
+  }
+
+  private static void mergeImports(ArrayList<String> merged, String[] curLines, String[] prevLines, int[] indices) {
+    TreeSet<String> externalClasses = new TreeSet<String>();
+    for (int i = 0; i < curLines.length; i++) {
+      String line = curLines[i].trim();
+      if (line.startsWith("import ") && line.endsWith(";")) {
+        indices[0] = i + 1;
+        final String name = line.substring("import ".length(), line.length() - 1).trim();
+        if (name.endsWith("*")) continue;
+        externalClasses.add(name);
+      }
+    }
+    for (int i = 0; i < prevLines.length; i++) {
+      String line = prevLines[i].trim();
+      if (line.startsWith("import ") && line.endsWith(";")) {
+        indices[1] = i + 1;
+        final String name = line.substring("import ".length(), line.length() - 1).trim();
+        if (name.endsWith("*")) continue;
+        externalClasses.add(name);
+      }
+    }
+    boolean javaLang = false;
+    for (String s : externalClasses) {
+      if (s.startsWith("java.")) {
+        javaLang = true;
+        continue;
+      }
+      merged.add("import " + s + ";");
+    }
+    if (javaLang) {
+      merged.add("");
+      for (String s : externalClasses) {
+        if (!s.startsWith("java.")) continue;
+        merged.add("import " + s + ";");
+      }
+    }
+  }
+
+  private static int addAllStringsUpTo(ArrayList<String> merged, String[] lines, int startIdx, String upTo) {
+    String str;
+    do {
+      str = startIdx < lines.length ? lines[startIdx] : upTo;
+      if (merged != null) merged.add(str);
+      startIdx++;
+    } while (!str.trim().endsWith(upTo) && startIdx < lines.length);
+    return startIdx;
+  }
+
+  private static int compareLines(String[] mergedLines, String[] curLines, int start) {
+    if (mergedLines.length < curLines.length) return -1;
+    if (mergedLines.length > curLines.length) return 1;
+    for (int i = start; i < mergedLines.length; i++) {
+      final int comp = mergedLines[i].compareTo(curLines[i]);
+      if (comp != 0) return comp;
+    }
+    return 0;
+  }
+
+
+  private static void writeFile(File target, String[] mergedLines) {
+    PrintWriter out = null;
+    try {
+      int lineCount = mergedLines.length;
+      while (lineCount > 0 && mergedLines[lineCount - 1].length() == 0) lineCount--;
+      out = new PrintWriter(new FileWriter(target));
+      for (int i = 0; i < lineCount; i++) {
+        String mergedLine = mergedLines[i];
+        out.println(mergedLine);
+      }
+    } catch (Exception ex) {
+      ex.printStackTrace();
+    } finally {
+      if (out != null) {
+        try {
+          out.close();
+        } catch (Exception e) {
+        }
+      }
+    }
+  }
+
+
+  private static String[] loadFile(File f1) {
+    if (!f1.exists()) return ArrayUtil.EMPTY_STRING_ARRAY;
+    ArrayList<String> list = new ArrayList<String>();
+    BufferedReader in = null;
+    try {
+      in = new BufferedReader(new FileReader(f1));
+      String str;
+      while ((str = in.readLine()) != null) {
+        list.add(str);
+      }
+    } catch (Exception ex) {
+      ex.printStackTrace();
+    } finally {
+      if (in != null) {
+        try {
+          in.close();
+        } catch (IOException e) {
+        }
+      }
+    }
+    return ArrayUtil.toStringArray(list);
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/ModelDesc.java b/xml/dom-impl/src/com/intellij/util/dom/generator/ModelDesc.java
new file mode 100644
index 0000000..e7c41f5
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/ModelDesc.java
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * XSD/DTD Model generator tool
+ *
+ * By Gregory Shrago
+ * 2002 - 2006
+ */
+package com.intellij.util.dom.generator;
+
+import org.apache.xerces.xs.XSObject;
+
+import javax.xml.namespace.QName;
+import java.io.PrintWriter;
+import java.util.*;
+
+/**
+ * @author Gregory.Shrago
+ * @author Konstantin Bulenkov
+ */
+public class ModelDesc {
+  final Map<String, String> name2replaceMap = new HashMap<String, String>();
+  final Map<QName, String> qname2FileMap = new HashMap<QName, String>();
+  final Map<String, NamespaceDesc> nsdMap = new HashMap<String, NamespaceDesc>();
+  final Map<String, TypeDesc> jtMap = new TreeMap<String, TypeDesc>();
+
+
+  public String getNSDPrefix(TypeDesc td) {
+    return getNSDPrefix(td.xsNamespace, td.name, td.type == TypeDesc.TypeEnum.ENUM);
+  }
+
+  public String getNSDPrefix(String namespace, String name, boolean isEnum) {
+    final int lastIdx = name.lastIndexOf(".");
+    if (lastIdx > -1) return name.substring(0, lastIdx + 1);
+    final NamespaceDesc nsd = getNSD(namespace);
+    if (isEnum && nsd.enumPkg != null) {
+      return nsd.enumPkg + ".";
+    }
+    if (nsd.pkgNames != null) {
+      final QName qname = new QName(namespace, name);
+      final String files = qname2FileMap.get(qname);
+      if (files != null) {
+        for (int i = 0; i < nsd.pkgNames.length; i += 2) {
+          String file = nsd.pkgNames[i];
+          String pkg = nsd.pkgNames[i + 1];
+          if (files.contains(":" + file + ":")) {
+            return pkg + ".";
+          }
+        }
+      }
+    }
+    return nsd.pkgName != null && nsd.pkgName.length() > 0 ? nsd.pkgName + "." : "";
+  }
+
+  public NamespaceDesc getNSD(String namespace) {
+    NamespaceDesc nsd = nsdMap.get(namespace);
+    if (nsd == null) {
+      nsd = nsdMap.get("");
+    }
+    return nsd;
+  }
+
+
+  public String toJavaTypeName(String tname, String ns) {
+    final int lastIndex = tname.lastIndexOf('.');
+    String xmlName = lastIndex>-1? tname.substring(lastIndex+1): tname;
+    NamespaceDesc nsd = getNSD(ns);
+    if (ns == null || !ns.endsWith(".dtd")) {
+      if (xmlName.endsWith(Util.ANONYMOUS_ELEM_TYPE_SUFFIX)) xmlName = xmlName.substring(0, xmlName.length() - Util.ANONYMOUS_ELEM_TYPE_SUFFIX.length());
+      else if (xmlName.endsWith(Util.ANONYMOUS_ATTR_TYPE_SUFFIX)) xmlName = xmlName.substring(0, xmlName.length() - Util.ANONYMOUS_ATTR_TYPE_SUFFIX.length());
+      else if (xmlName.endsWith(Util.TYPE_SUFFIX)) xmlName = xmlName.substring(0, xmlName.length() - Util.TYPE_SUFFIX.length());
+    }
+    String rc = Util.capitalize(Util.toJavaName(xmlName));
+    if (nsd.prefix != null && nsd.prefix.length()>0 && !rc.startsWith(nsd.prefix)) {
+      rc = nsd.prefix + rc;
+    }
+    if (Util.RESERVED_NAMES_MAP.containsKey(rc)) {
+      rc = Util.RESERVED_NAMES_MAP.get(rc);
+    }
+    if (name2replaceMap.containsKey(rc)) {
+      rc = Util.expandProperties(name2replaceMap.get(rc), nsd.props);
+    }
+    
+    return rc;
+  }
+
+  public String toJavaQualifiedTypeName(XSObject xs, Map<String, NamespaceDesc> nsdMap, boolean isEnum) {
+    String typeName = toJavaTypeName(xs.getName(), xs.getNamespace());
+    return getNSDPrefix(xs.getNamespace(), xs.getName(), isEnum) + typeName;
+  }
+
+  public String toJavaQualifiedTypeName(String namespace, String xmlname, boolean isEnum) {
+    return getNSDPrefix(namespace, xmlname, isEnum) + toJavaTypeName(xmlname, namespace);
+  }
+
+  void dump(final PrintWriter out) {
+//    out.println("-- qname2FileMap ---");
+//    out.println(qname2FileMap);
+    out.println("-- nsdMap ---");
+    for (Map.Entry<String, NamespaceDesc> entry : nsdMap.entrySet()) {
+      out.println("namespace key: "+entry.getKey());
+      dumpNamespace(entry.getValue(), out);
+    }
+    out.println("-- jtMap ---");
+    for (Map.Entry<String, TypeDesc> entry : jtMap.entrySet()) {
+      out.println("type key: "+entry.getKey());
+      dumpTypeDesc(entry.getValue(), out);
+    }
+  }
+
+  private void dumpTypeDesc(TypeDesc td, PrintWriter out) {
+    final ArrayList<String> superList;
+    if (td.supers !=null) {
+      superList = new ArrayList<String>();
+      for (TypeDesc aSuper : td.supers) {
+        superList.add(getNSDPrefix(aSuper)+aSuper.name);
+      }
+    } else superList = null;
+    out.println("  name      " + td.name);
+    out.println("  type      " + td.type);
+    out.println("  xsName    " + td.xsName);
+    out.println("  xsNS      " + td.xsNamespace);
+    out.println("  dups      " + td.duplicates);
+    out.println("  supers    " + (superList!=null?superList:"null"));
+    out.println("  doc       " + (td.documentation != null ? td.documentation.length() : "null"));
+    for (Map.Entry<String, FieldDesc> entry : td.fdMap.entrySet()) {
+      out.println("  field key: " + entry.getKey());
+      dumpFieldDesc(td, entry.getValue(), out);
+    }
+  }
+
+  private void dumpFieldDesc(TypeDesc td, FieldDesc fd, PrintWriter out) {
+    out.println("    name      " + fd.name);
+    if (td.type == TypeDesc.TypeEnum.ENUM) return;
+    out.println("    clType    " + fd.clType);
+    out.println("    required  " + fd.required);
+    out.println("    index     " + fd.idx+"/"+fd.realIndex);
+    out.println("    choiceOpt " + fd.choiceOpt);
+    out.println("    choice    " + (fd.choice!=null?fd.choice.length:"null"));
+    out.println("    content   " + fd.contentQualifiedName);
+    out.println("    dupIdx    " + fd.duplicateIndex);
+    out.println("    elName    " + fd.elementName);
+    out.println("    elType    " + fd.elementType);
+    out.println("    def       " + fd.def);
+    out.println("    doc       " + (fd.documentation != null? fd.documentation.length(): "null"));
+  }
+
+  private void dumpNamespace(NamespaceDesc value, PrintWriter out) {
+    if (value.skip) return;
+    out.println("  name     "+value.name);
+    out.println("  prefix   "+value.prefix);
+    out.println("  pkgName  "+value.pkgName);
+    out.println("  pkgNames "+(value.pkgNames != null?Arrays.asList(value.pkgNames):"null"));
+    out.println("  enumPkg  "+value.enumPkg);
+    out.println("  super    "+value.superClass);
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/ModelGen.java b/xml/dom-impl/src/com/intellij/util/dom/generator/ModelGen.java
new file mode 100644
index 0000000..e5625b3
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/ModelGen.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.dom.generator;
+
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
+import org.apache.xerces.xni.XMLResourceIdentifier;
+import org.apache.xerces.xni.XNIException;
+import org.apache.xerces.xni.parser.XMLEntityResolver;
+import org.apache.xerces.xni.parser.XMLInputSource;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.input.SAXBuilder;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import java.io.CharArrayReader;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Gregory.Shrago
+ * @author Konstantin Bulenkov
+ */
+public class ModelGen {
+  private final ModelDesc model = new ModelDesc();
+  private final Map<String, String> schemaLocationMap = new HashMap<String, String>();
+  private final ModelLoader loader;
+  private final Emitter emitter;
+  private final FileManager fileManager;
+
+
+  public ModelGen(ModelLoader loader) {
+    this(loader, new JetBrainsEmitter(), new MergingFileManager());
+  }
+
+  public ModelGen(ModelLoader loader, Emitter emitter, FileManager fileManager) {
+    this.loader = loader;
+    this.emitter = emitter;
+    this.fileManager = fileManager;
+  }
+
+  public ModelDesc getModel() {
+    return model;
+  }
+
+  public static Element loadXml(File configXml) throws Exception {
+    SAXBuilder saxBuilder = new SAXBuilder();
+    saxBuilder.setEntityResolver(new EntityResolver() {
+      public InputSource resolveEntity(String publicId,
+                                       String systemId)
+              throws SAXException, IOException {
+        return new InputSource(new CharArrayReader(new char[0]));
+      }
+    });
+    final Document document = saxBuilder.build(configXml);
+    return document.getRootElement();
+  }
+
+  public void loadConfig(File configXml) throws Exception {
+    loadConfig(loadXml(configXml));
+  }
+
+  public void setConfig(String schema, String location, NamespaceDesc desc, String... schemasToSkip) {
+    schemaLocationMap.put(schema, location);
+    for (String sch : schemasToSkip) {
+      if (sch != null && sch.length() > 0) {
+        model.nsdMap.put(sch, new NamespaceDesc(sch));
+      }
+    }
+    model.nsdMap.put("", new NamespaceDesc("", "", "com.intellij.util.xml.DomElement", "", null, null, null, null));
+    model.nsdMap.put(desc.name, desc);
+  }
+
+  public void loadConfig(Element element) {
+    final Element namespaceEl = element.getChild("namespaces");
+    for (Element e : (List<Element>) namespaceEl.getChildren("schemaLocation")) {
+      final String name = e.getAttributeValue("name");
+      final String file = e.getAttributeValue("file");
+      schemaLocationMap.put(name, file);
+    }
+    for (Element e : (List<Element>) namespaceEl.getChildren("reserved-name")) {
+      final String name = e.getAttributeValue("name");
+      final String replacement = e.getAttributeValue("replace-with");
+      model.name2replaceMap.put(name, replacement);
+    }
+    NamespaceDesc def = new NamespaceDesc("", "generated", "java.lang.Object", "", null, null, null, null);
+    for (Element nsElement : (List<Element>) namespaceEl.getChildren("namespace")) {
+      final String name = nsElement.getAttributeValue("name");
+      final NamespaceDesc nsDesc = new NamespaceDesc(name, def);
+
+      final String skip = nsElement.getAttributeValue("skip");
+      final String prefix = nsElement.getAttributeValue("prefix");
+      final String superC = nsElement.getAttributeValue("super");
+      final String imports = nsElement.getAttributeValue("imports");
+      final String packageS = nsElement.getAttributeValue("package");
+      final String packageEnumS = nsElement.getAttributeValue("enums");
+      final String interfaces = nsElement.getAttributeValue("interfaces");
+      final ArrayList<String> list = new ArrayList<String>();
+      for (Element pkgElement : (List<Element>) nsElement.getChildren("package")) {
+        final String pkgName = pkgElement.getAttributeValue("name");
+        final String fileName = pkgElement.getAttributeValue("file");
+        list.add(fileName);
+        list.add(pkgName);
+      }
+      for (Element pkgElement : (List<Element>) nsElement.getChildren("property")) {
+        final String propertyName = pkgElement.getAttributeValue("name");
+        final String propertyValue = pkgElement.getAttributeValue("value");
+        nsDesc.props.put(propertyName, propertyValue);
+      }
+
+      if (skip != null) nsDesc.skip = skip.equalsIgnoreCase("true");
+      if (prefix != null) nsDesc.prefix = prefix;
+      if (superC != null) nsDesc.superClass = superC;
+      if (imports != null) nsDesc.imports = imports;
+      if (packageS != null) nsDesc.pkgName = packageS;
+      if (packageEnumS != null) nsDesc.enumPkg = packageEnumS;
+      if (interfaces != null) nsDesc.intfs = interfaces;
+      if (!list.isEmpty()) nsDesc.pkgNames = ArrayUtil.toStringArray(list);
+      if (name.length() == 0) def = nsDesc;
+      model.nsdMap.put(name, nsDesc);
+    }
+  }
+
+  public void perform(final File outputRoot, final File... modelRoots) throws Exception {
+    loadModel(modelRoots);
+    emitter.emit(fileManager, model, outputRoot);
+
+    Util.log("Done.");
+  }
+
+  public void loadModel(final File... modelRoots) throws Exception {
+    XMLEntityResolver resolver = new XMLEntityResolver() {
+      public XMLInputSource resolveEntity(XMLResourceIdentifier xmlResourceIdentifier) throws XNIException, IOException {
+        String esid = xmlResourceIdentifier.getExpandedSystemId();
+        if (esid == null) {
+          final String location = schemaLocationMap.get(xmlResourceIdentifier.getNamespace());
+          if (location != null) {
+            esid = location;
+          } else {
+            return null;
+          }
+        }
+        // Util.log("resolving "+esid);
+        File f = null;
+        for (File root : modelRoots) {
+          if (root == null) continue;
+          if (root.isDirectory()) {
+            final String fileName = esid.substring(esid.lastIndexOf('/') + 1);
+            f = new File(root, fileName);
+          } else {
+            f = root;
+          }
+        }
+        if (f == null || !f.exists()) {
+          Util.logerr("unable to resolve: " + esid);
+          return null;
+        }
+        esid = f.getPath();
+        return new XMLInputSource(null, esid, null);
+      }
+    };
+    ArrayList<File> files = new ArrayList<File>();
+    for (File root : modelRoots) {
+      ContainerUtil.addAll(files, root.listFiles());
+    }
+    loader.loadModel(model, files, resolver);
+    Util.log(model.jtMap.size() + " java types loaded");
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/ModelLoader.java b/xml/dom-impl/src/com/intellij/util/dom/generator/ModelLoader.java
new file mode 100644
index 0000000..2e5d118
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/ModelLoader.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.dom.generator;
+
+import org.apache.xerces.xni.parser.XMLEntityResolver;
+
+import java.io.File;
+import java.util.Collection;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public interface ModelLoader {
+  void loadModel(ModelDesc model, Collection<File> files, XMLEntityResolver resolver) throws Exception;
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/NamespaceDesc.java b/xml/dom-impl/src/com/intellij/util/dom/generator/NamespaceDesc.java
new file mode 100644
index 0000000..8f24825e
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/NamespaceDesc.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * XSD/DTD Model generator tool
+ *
+ * By Gregory Shrago
+ * 2002 - 2006
+ */
+package com.intellij.util.dom.generator;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class NamespaceDesc {
+  public NamespaceDesc(String name,
+                       String pkgName,
+                       String superClass,
+                       String prefix,
+                       String factoryClass,
+                       String helperClass,
+                       String imports,
+                       String intfs) {
+    this.name = name;
+    this.pkgName = pkgName;
+    this.superClass = superClass;
+    this.prefix = prefix;
+    this.factoryClass = factoryClass;
+    this.helperClass = helperClass;
+    this.imports = imports;
+    this.intfs = intfs;
+  }
+
+  public NamespaceDesc(String name) {
+    this(name, "generated", "java.lang.Object", "", null, null, null, null);
+    skip = true;
+  }
+
+
+  public NamespaceDesc(String name, NamespaceDesc def) {
+    this.name = name;
+    this.pkgName = def.pkgName;
+    this.superClass = def.superClass;
+    this.prefix = def.prefix;
+    this.factoryClass = def.factoryClass;
+    this.helperClass = def.helperClass;
+    this.imports = def.imports;
+    this.intfs = def.intfs;
+  }
+
+  final Map<String, String> props = new HashMap<String, String>();
+  final String name;
+  String pkgName;
+  String superClass;
+  String prefix;
+  String factoryClass;
+  String helperClass;
+  String imports;
+  String intfs;
+  boolean skip;
+  String[] pkgNames;
+  String enumPkg;
+
+
+  public String toString() {
+    return "NS:"+name+" "+(skip?"skip":"")+pkgName;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/TypeDesc.java b/xml/dom-impl/src/com/intellij/util/dom/generator/TypeDesc.java
new file mode 100644
index 0000000..f51e71a
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/TypeDesc.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * XSD/DTD Model generator tool
+ *
+ * By Gregory Shrago
+ * 2002 - 2006
+ */
+package com.intellij.util.dom.generator;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class TypeDesc {
+  public enum TypeEnum {
+    CLASS, ENUM, GROUP_INTERFACE
+  }
+
+  public TypeDesc(String xsName, String xsNamespace, String name, TypeEnum type) {
+    this.xsName = xsName;
+    this.xsNamespace = xsNamespace;
+    this.name = name;
+    this.type = type;
+  }
+
+  TypeEnum type;
+  final String xsName;
+  final String xsNamespace;
+  final String name;
+  final Map<String, FieldDesc> fdMap = new TreeMap<String, FieldDesc>();
+  boolean duplicates;
+  String documentation;
+  TypeDesc[] supers;
+
+  public String toString() {
+    return (type == TypeEnum.ENUM ? "enum" : "type") + ": " + name + ";" + xsName + ";";
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/Util.java b/xml/dom-impl/src/com/intellij/util/dom/generator/Util.java
new file mode 100644
index 0000000..9180107
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/Util.java
@@ -0,0 +1,224 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * XSD/DTD Model generator tool
+ *
+ * By Gregory Shrago
+ * 2002 - 2006
+ */
+package com.intellij.util.dom.generator;
+
+import org.apache.xerces.xs.XSObject;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class Util {
+  public static final String ANONYMOUS_ELEM_TYPE_SUFFIX = "ElemType";
+  public static final String ANONYMOUS_ATTR_TYPE_SUFFIX = "AttrType";
+  public static final String TYPE_SUFFIX = "Type";
+  
+  //
+  // Constants
+  //
+  public static final String XSD_NS = "http://www.w3.org/2001/XMLSchema";
+
+  // reserved names map
+  public static final String[] RESERVED_NAMES_TABLE = {
+          "abstract", "default", "if", "private", "this",
+          "boolean", "do", "implements", "protected", "throw",
+          "break", "double", "import", "public", "throws",
+          "byte", "else", "instanceof", "return", "transient",
+          "case", "extends", "int", "short", "try",
+          "catch", "final", "interface", "static", "void",
+          "char", "finally", "long", "strictfp", "volatile",
+          "class", "float", "native", "super", "while",
+          "const", "for", "new", "switch",
+          "continue", "goto", "package", "synchronized"
+  };
+  public static final HashMap<String, String> RESERVED_NAMES_MAP;
+
+  static {
+    RESERVED_NAMES_MAP = new HashMap<String, String>();
+    for (String aRESERVED_NAMES_TABLE : RESERVED_NAMES_TABLE) {
+      // RESERVED_NAMES_MAP.put(RESERVED_NAMES_TABLE[i], RESERVED_NAMES_TABLE[i]+"_");
+      // as far as there is no actual field but setters/getters:
+      RESERVED_NAMES_MAP.put(aRESERVED_NAMES_TABLE, aRESERVED_NAMES_TABLE);
+    }
+    //RESERVED_NAMES_MAP.put("class", "clazz");
+  }
+
+
+  static void log(String str) {
+    System.out.println(str);
+  }
+
+  static void logwarn(String str) {
+    System.out.println("[warn] " + str);
+  }
+
+  static void logerr(String str) {
+    System.out.println("[error] " + str);
+  }
+
+  public static String pluralize(String suggestion) {
+    // return suggestion+"List";
+    final String VOWELS = "aeiouy";
+    if (suggestion.endsWith("s") || suggestion.endsWith("x") ||
+            suggestion.endsWith("ch")) {
+      suggestion += "es";
+    } else {
+      int len = suggestion.length();
+      if (suggestion.endsWith("y") && len > 1 && VOWELS.indexOf(suggestion.charAt(len - 2)) < 0) {
+        suggestion = suggestion.substring(0, len - 1) + "ies";
+      } else {
+        suggestion += "s";
+      }
+    }
+    return suggestion;
+  }
+
+  public static String toJavaFieldName(String xmlName) {
+    String rc = toJavaName(xmlName);
+    if (RESERVED_NAMES_MAP.containsKey(rc)) {
+      rc = RESERVED_NAMES_MAP.get(rc);
+    }
+    return rc;
+  }
+
+
+  public static String computeEnumConstantName(String val, String typeName) {
+    String id = val;
+    for (int i = 1; i < id.length(); i++) {
+      if (Character.isUpperCase(id.charAt(i))
+              && Character.isLowerCase(id.charAt(i - 1))) {
+        id = id.substring(0, i) + "_" + id.substring(i);
+        i++;
+      }
+    }
+    id = id.toUpperCase();
+    id = id.replace('.', '_').replace('-', '_');
+    if (id.length() < 2 || !Character.isJavaIdentifierStart(id.charAt(0))) {
+      id = typeName + "_" + id;
+    }
+    return id;
+  }
+
+
+  public static String capitalize(String str) {
+    return Character.toUpperCase(str.charAt(0)) + str.substring(1);
+  }
+
+  public static String decapitalize(String str) {
+    return Character.toLowerCase(str.charAt(0)) + str.substring(1);
+  }
+
+  public static String toJavaName(String xmlName) {
+    xmlName = xmlName.substring(xmlName.lastIndexOf(':') + 1);
+    StringTokenizer st = new StringTokenizer(xmlName, "-");
+    StringBuffer sb = new StringBuffer(st.nextToken());
+    while (st.hasMoreTokens()) {
+      sb.append(capitalize(st.nextToken()));
+    }
+    return sb.toString();
+  }
+
+  public static String toDefXmlTagName(XSObject xs) {
+    String xmlName = xs.getName();
+    if (xmlName.endsWith(TYPE_SUFFIX)) xmlName = xmlName.substring(0, xmlName.length() - 4);
+    return xmlName;
+  }
+
+  public static String toDefXmlTagName(String tname) {
+    String xmlName = tname;
+    if (xmlName.endsWith(TYPE_SUFFIX)) xmlName = xmlName.substring(0, xmlName.length() - TYPE_SUFFIX.length());
+    return xmlName;
+  }
+
+
+  public static boolean addToNameMap(Map<String, FieldDesc> fdMap, FieldDesc fd1, boolean merge) {
+    boolean duplicates = false;
+    FieldDesc fd2;
+    if ((fd2 = fdMap.remove(fd1.name)) != null) {
+      if (fd2.clType == FieldDesc.ATTR) {
+        // attr <-> field
+        fd2.name = fd1.name + "Attr";
+        fdMap.put(fd2.name, fd2);
+      } else if (merge) {
+        fdMap.put(fd2.name, fd2);
+        return false;
+      } else {
+        duplicates = true;
+        fd2.name = fd1.name + "1";
+        fd2.duplicateIndex = 1;
+        fdMap.put(fd2.name, fd2);
+        fd1.name = fd1.name + "2";
+        fd1.duplicateIndex = 2;
+      }
+    } else if ((fd2 = fdMap.get(fd1.name + "1")) != null) {
+      int id = 2;
+      while (fdMap.containsKey(fd1.name + id)) id++;
+      fd1.name = fd1.name + id;
+      fd1.duplicateIndex = id;
+    }
+    fdMap.put(fd1.name, fd1);
+    return duplicates;
+  }
+
+  public static String expandProperties(final String str, final Map<String, String> map) {
+    if (str.indexOf("${") == -1) return str;
+    int state = 0;
+    final StringBuilder result = new StringBuilder();
+    final StringBuilder variable = new StringBuilder();
+    for (int i=0; i<str.length(); i++) {
+      final char ch = str.charAt(i);
+      switch (state) {
+        case 0:
+          if (ch == '$') state = 1;
+          else result.append(ch);
+          break;
+        case 1:
+          if (ch == '{') {
+            state = 2;
+            variable.setLength(0);
+          }
+          else {
+            state = 0;
+            result.append('$').append(ch);
+          }
+          break;
+        case 2:
+          if (ch == '}') {
+            final String value = map.get(variable.toString());
+            result.append(value == null? variable : value);
+            state = 0;
+          }
+          else {
+            variable.append(ch);
+          }
+          break;
+      }
+    }
+    return result.toString();
+  }
+}
+
diff --git a/xml/dom-impl/src/com/intellij/util/dom/generator/XSDModelLoader.java b/xml/dom-impl/src/com/intellij/util/dom/generator/XSDModelLoader.java
new file mode 100644
index 0000000..c6cb362
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/dom/generator/XSDModelLoader.java
@@ -0,0 +1,681 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * XSD/DTD Model generator tool
+ *
+ * By Gregory Shrago
+ * 2002 - 2006
+ */
+package com.intellij.util.dom.generator;
+
+import org.apache.xerces.xs.*;
+import org.apache.xerces.impl.xs.XSComplexTypeDecl;
+import org.apache.xerces.impl.xs.XSParticleDecl;
+import org.apache.xerces.impl.xs.XSAttributeGroupDecl;
+import org.apache.xerces.impl.xs.XSElementDecl;
+import org.apache.xerces.impl.xs.util.XSObjectListImpl;
+import org.apache.xerces.impl.dv.XSSimpleType;
+import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl;
+import org.apache.xerces.xni.parser.XMLEntityResolver;
+import org.w3c.dom.bootstrap.DOMImplementationRegistry;
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMErrorHandler;
+import org.w3c.dom.DOMError;
+import org.w3c.dom.TypeInfo;
+
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.util.*;
+
+/**
+ * @author Gregory.Shrago
+ * @author Konstantin Bulenkov
+ */
+public class XSDModelLoader implements ModelLoader {
+  private static final boolean TEXT_ELEMENTS_ARE_COMPLEX = false;
+
+
+  private ModelDesc model;
+
+  public void loadModel(ModelDesc model, Collection<File> files, XMLEntityResolver resolver) throws Exception {
+    this.model = model;
+    processSchemas(files, resolver);
+  }
+
+  public static boolean checkComplexType(XSTypeDefinition td) {
+    if (td.getTypeCategory() != XSTypeDefinition.COMPLEX_TYPE) return false;
+    XSComplexTypeDefinition ctd = (XSComplexTypeDefinition) td;
+    if (ctd.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_ELEMENT) {
+      return true;
+    }
+    if ((td instanceof XSComplexTypeDecl) && ((XSComplexTypeDecl) td).getAbstract()) return true;
+    if (TEXT_ELEMENTS_ARE_COMPLEX) return true;
+    if (ctd.getAttributeUses() != null) {
+      for (int i = 0; i < ctd.getAttributeUses().getLength(); i++) {
+        XSSimpleTypeDefinition xsstd = ((XSAttributeUse) ctd.getAttributeUses().item(i)).getAttrDeclaration().getTypeDefinition();
+        if ("ID".equals(xsstd.getName())) continue;
+        return true;
+      }
+    }
+    return false;
+  }
+
+  public static boolean checkEnumType(XSTypeDefinition td) {
+    final XSSimpleTypeDefinition st;
+    if (td.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
+      XSComplexTypeDefinition ctd = (XSComplexTypeDefinition) td;
+      if (ctd.getContentType() != XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) return false;
+      if (ctd.getAttributeUses() != null) {
+        for (int i = 0; i < ctd.getAttributeUses().getLength(); i++) {
+          XSSimpleTypeDefinition xsstd = ((XSAttributeUse) ctd.getAttributeUses().item(i)).getAttrDeclaration().getTypeDefinition();
+          if ("ID".equals(xsstd.getName())) continue;
+          return false;
+        }
+      }
+      st = ctd.getSimpleType();
+    } else if (td.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
+      st = (XSSimpleTypeDefinition) td;
+    } else {
+      return false;
+    }
+    return st.getLexicalEnumeration() != null && st.getLexicalEnumeration().getLength() != 0;
+  }
+
+  private static boolean checkBooleanType(XSTypeDefinition td) {
+    if (td.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) return false;
+    final XSSimpleTypeDefinition st = ((XSSimpleTypeDefinition) td);
+    final XSObjectList facets = st.getFacets();
+    for (int i = 0; i < facets.getLength(); i++) {
+      final XSFacet facet = (XSFacet) facets.item(i);
+      if (facet.getFacetKind() == XSSimpleTypeDefinition.FACET_LENGTH) {
+        if ("0".equals(facet.getLexicalFacetValue())) {
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+
+
+  private XSModel loadSchema(File schemaFile, XMLEntityResolver resolver) throws Exception {
+    // get DOM Implementation using DOM Registry
+    System.setProperty(
+            DOMImplementationRegistry.PROPERTY,
+            "org.apache.xerces.dom.DOMXSImplementationSourceImpl");
+    DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
+    XSImplementation impl = (XSImplementation) registry.getDOMImplementation("XS-Loader");
+    XSLoader schemaLoader = impl.createXSLoader(null);
+    DOMConfiguration config = schemaLoader.getConfig();
+
+    // create Error Handler
+    DOMErrorHandler errorHandler = new DOMErrorHandler() {
+      public boolean handleError(DOMError domError) {
+        Util.log("DOMError: " + domError.getMessage());
+        Object relatedException = domError.getRelatedException();
+        if (relatedException != null) {
+          Util.log("DOMError: " + relatedException);
+          if (relatedException instanceof Throwable) {
+            ((Throwable) relatedException).printStackTrace(System.out);
+          }
+        }
+        return false;
+      }
+    };
+    // set error handler
+    config.setParameter("error-handler", errorHandler);
+    // set validation feature
+    config.setParameter("validate", Boolean.TRUE);
+    // parse document
+    config.setParameter("error-handler", errorHandler);
+    config.setParameter("http://apache.org/xml/properties/internal/entity-resolver", resolver);
+
+    XSModel model = schemaLoader.loadURI(schemaFile.getAbsolutePath());
+    if (model == null) return null;
+    XSNamedMap components = model.getComponents(XSConstants.ELEMENT_DECLARATION);
+    for (int i = 0; i < components.getLength(); i++) {
+      XSObject obj = components.item(i);
+      QName qname = new QName(obj.getNamespace(), obj.getName());
+      String file = this.model.qname2FileMap.get(qname);
+      this.model.qname2FileMap.put(qname, (file == null ? "" : file + ";") + schemaFile.getName());
+    }
+    components = model.getComponents(XSConstants.TYPE_DEFINITION);
+    for (int i = 0; i < components.getLength(); i++) {
+      XSObject obj = components.item(i);
+      QName qname = new QName(obj.getNamespace(), obj.getName());
+      String file = this.model.qname2FileMap.get(qname);
+      this.model.qname2FileMap.put(qname, (file == null ? "" : file) + ":" + schemaFile.getName() + ":");
+    }
+    return model;
+  }
+
+  public void processSchemas(Collection<File> schemas, XMLEntityResolver resolver) throws Exception {
+    Map<String, NamespaceDesc> nsdMap = model.nsdMap;
+    Map<String, TypeDesc> jtMap = model.jtMap;
+    final NamespaceDesc nsdDef = nsdMap.get("");
+    final ArrayList<XSModel> models = new ArrayList<XSModel>();
+    final HashMap<String, XSTypeDefinition> types = new HashMap<String, XSTypeDefinition>();
+    for (File schemaFile : schemas) {
+      String fileName = schemaFile.getPath();
+      if (schemaFile.isDirectory() || !fileName.endsWith(".xsd")) {
+        Util.log("skipping " + fileName);
+        continue;
+      }
+      Util.log("loading " + fileName + "..");
+
+      final XSModel model = loadSchema(schemaFile, resolver);
+      if (model == null) continue;
+
+      final StringList namespaceList = model.getNamespaces();
+      for (int i = 0; i < namespaceList.getLength(); i++) {
+        String ns = namespaceList.item(i);
+        if (!nsdMap.containsKey(ns)) {
+          Util.log("Adding default namespace desc for: " + ns);
+          NamespaceDesc nsd = new NamespaceDesc(ns, nsdDef);
+          nsdMap.put(ns, nsd);
+        }
+      }
+      models.add(model);
+      final XSNamedMap typeDefMap = model.getComponents(XSConstants.TYPE_DEFINITION);
+      for (int i = 0; i < typeDefMap.getLength(); i++) {
+        XSTypeDefinition o = (XSTypeDefinition) typeDefMap.item(i);
+        NamespaceDesc nsd = nsdMap.get(o.getNamespace());
+        if (nsd != null && nsd.skip) continue;
+        final String key = o.getName() + "," + o.getNamespace();
+        types.put(key, o);
+      }
+      final XSNamedMap elementDeclMap = model.getComponents(XSConstants.ELEMENT_DECLARATION);
+      for (int i = 0; i < elementDeclMap.getLength(); i++) {
+        XSElementDeclaration o = (XSElementDeclaration) elementDeclMap.item(i);
+        if (o.getTypeDefinition().getAnonymous() && (o.getTypeDefinition() instanceof XSComplexTypeDefinition)) {
+          //types.put(o.getName() + "," + o.getNamespace(), o);
+          XSComplexTypeDefinition ctd = makeTypeFromAnonymous(o);
+          NamespaceDesc nsd = nsdMap.get(o.getNamespace());
+          if (nsd != null && nsd.skip) continue;
+          final String key = ctd.getName() + "," + ctd.getNamespace();
+          types.put(key, ctd);
+        }
+      }
+    }
+    Util.log(types.size() + " elements loaded, processing..");
+    ArrayList<XSTypeDefinition> toProcess = new ArrayList<XSTypeDefinition>(types.values());
+    ArrayList<XSComplexTypeDefinition> toAdd = new ArrayList<XSComplexTypeDefinition>();
+    for (ListIterator<XSTypeDefinition> it = toProcess.listIterator(); it.hasNext();) {
+      XSTypeDefinition td = it.next();
+      Util.log("processing " + td.getName() + "," + td.getNamespace() + "..");
+      if (checkComplexType(td)) {
+        processType((XSComplexTypeDefinition) td, models, jtMap, nsdMap, toAdd);
+      } else if (checkEnumType(td)) {
+        processEnumType(td, jtMap, nsdMap);
+      }
+      if (toAdd.size() != 0) {
+        for (XSComplexTypeDefinition o : toAdd) {
+          final String key = o.getName() + "," + o.getNamespace();
+          if (!types.containsKey(key)) {
+            Util.log("  adding " + o.getName() + "," + o.getNamespace());
+            types.put(key, o);
+            it.add(o);
+            it.previous();
+          } else {
+            Util.logwarn(key + " already exists");
+          }
+        }
+        toAdd.clear();
+      }
+    }
+  }
+
+  private XSComplexTypeDefinition makeTypeFromAnonymous(XSObject o) {
+    final XSComplexTypeDecl ctd = new XSComplexTypeDecl();
+    if (o instanceof XSElementDeclaration && ((XSElementDeclaration) o).getTypeDefinition() instanceof XSComplexTypeDecl) {
+      final XSComplexTypeDecl ctd1 = (XSComplexTypeDecl) ((XSElementDeclaration) o).getTypeDefinition();
+      final XSObjectListImpl annotations = ctd1.getAnnotations() instanceof XSObjectListImpl ? (XSObjectListImpl) ctd1.getAnnotations() : new XSObjectListImpl();
+      ctd.setValues(o.getName(), ctd1.getNamespace(), ctd1.getBaseType(), ctd1.getDerivationMethod(),
+              ctd1.getFinal(), ctd1.getProhibitedSubstitutions(), ctd1.getContentType(),
+              ctd1.getAbstract(), ctd1.getAttrGrp(), (XSSimpleType) ctd1.getSimpleType(),
+              (XSParticleDecl) ctd1.getParticle(), annotations);
+      ctd.setName(o.getName() + Util.ANONYMOUS_ELEM_TYPE_SUFFIX);
+    } else if (o instanceof XSAttributeDeclaration) {
+      final XSSimpleTypeDecl ctd1 = (XSSimpleTypeDecl) ((XSAttributeDeclaration) o).getTypeDefinition();
+      final XSObjectListImpl annotations = ctd1.getAnnotations() instanceof XSObjectListImpl ? (XSObjectListImpl) ctd1.getAnnotations() : new XSObjectListImpl();
+      ctd.setValues(o.getName(), ctd1.getNamespace(), ctd1.getBaseType(), XSConstants.DERIVATION_RESTRICTION,
+              ctd1.getFinal(), (short) 0, XSComplexTypeDefinition.CONTENTTYPE_SIMPLE,
+              false, new XSAttributeGroupDecl(), ctd1,
+              null, annotations);
+      ctd.setName(o.getName() + Util.ANONYMOUS_ATTR_TYPE_SUFFIX);
+    }
+
+    model.qname2FileMap.put(new QName(ctd.getNamespace(), ctd.getName()), model.qname2FileMap.get(new QName(o.getNamespace(), o.getName())));
+    return ctd;
+  }
+
+  public void processEnumType(XSTypeDefinition def, Map<String, TypeDesc> jtMap, Map<String, NamespaceDesc> nsdMap) throws Exception {
+    boolean complexType = def instanceof XSComplexTypeDefinition;
+    if (!nsdMap.containsKey(def.getNamespace())) {
+      Util.log("Namespace desc not found for: " + def);
+    }
+    final String typeName = toJavaTypeName(def, nsdMap);
+    final TypeDesc td = new TypeDesc(def.getName(), def.getNamespace(), typeName, TypeDesc.TypeEnum.ENUM);
+    final XSComplexTypeDefinition ct = complexType ? (XSComplexTypeDefinition) def : null;
+    final XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) (complexType ? ((XSComplexTypeDefinition) def).getSimpleType() : def);
+    for (int i = 0; i < st.getLexicalEnumeration().getLength(); i++) {
+      final String s = st.getLexicalEnumeration().item(i);
+      td.fdMap.put(s, new FieldDesc(Util.computeEnumConstantName(s, td.name), s));
+    }
+
+    final XSObjectList anns = complexType ? ct.getAnnotations() : st.getAnnotations();
+
+    td.documentation = parseAnnotationString("Enumeration " + def.getNamespace() + ":" + def.getName() + " documentation", anns != null && anns.getLength() > 0 ? ((XSAnnotation) anns.item(0)).getAnnotationString() : null);
+    jtMap.put(model.toJavaQualifiedTypeName(def, nsdMap, true), td);
+  }
+
+  public void processType(XSComplexTypeDefinition def, List<XSModel> models, Map<String, TypeDesc> jtMap, Map<String, NamespaceDesc> nsdMap, ArrayList<XSComplexTypeDefinition> toAdd) throws Exception {
+    if (!nsdMap.containsKey(def.getNamespace())) {
+      Util.log("Namespace desc not found for: " + def);
+    }
+    String typeName = toJavaTypeName(def, nsdMap);
+    TypeDesc td = jtMap.get(model.toJavaQualifiedTypeName(def, nsdMap, false));
+    if (td != null) {
+      if (td.fdMap.size() == 0) {
+        // Util.log("Reusing forward decl: "+typeName);
+      } else {
+        Util.logerr("merging: type names collision: " + typeName);
+      }
+    } else {
+      td = new TypeDesc(def.getName(), def.getNamespace(), typeName, TypeDesc.TypeEnum.CLASS);
+    }
+    XSObjectList anns = def.getAnnotations();
+    td.documentation = parseAnnotationString("Type " + def.getNamespace() + ":" + def.getName() + " documentation",
+            anns != null && anns.getLength() > 0 ? ((XSAnnotation) anns.item(0)).getAnnotationString() : null);
+    TypeDesc tdBase = null;
+    if (checkComplexType(def.getBaseType())) {
+      XSComplexTypeDefinition base = (XSComplexTypeDefinition) def.getBaseType();
+      String typeNameBase = toJavaTypeName(base, nsdMap);
+      if ((tdBase = jtMap.get(model.toJavaQualifiedTypeName(base, nsdMap, false))) == null) {
+        // logwarn("forward decl: "+et);
+        tdBase = new TypeDesc(base.getName(), base.getNamespace(), typeNameBase, TypeDesc.TypeEnum.CLASS);
+        jtMap.put(model.toJavaQualifiedTypeName(base, nsdMap, false), tdBase);
+      }
+    }
+    if (def.getSimpleType() != null || def.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_MIXED) {
+      FieldDesc fd = new FieldDesc(FieldDesc.SIMPLE, "value", "String", null, "null", true);
+      fd.realIndex = td.fdMap.size();
+      td.fdMap.put(fd.name, fd);
+    }
+    XSObjectList attrs = def.getAttributeUses();
+    for (int i = 0; i < attrs.getLength(); i++) {
+      XSAttributeUse au = (XSAttributeUse) attrs.item(i);
+      XSAttributeDeclaration ad = au.getAttrDeclaration();
+      XSSimpleTypeDefinition atd = ad.getTypeDefinition();
+      XSAnnotation ann = ad.getAnnotation();
+      String documentation = parseAnnotationString("Attribute " + ad.getNamespace() + ":" + ad.getName() + " documentation", ann != null ? ann.getAnnotationString() : null);
+      // skip "ID" and "FIXED"
+      if ("ID".equals(atd.getName())) continue;
+      // "language", "dewey-versionType", "boolean"
+      if (ad.getConstraintType() == XSConstants.VC_FIXED) continue;
+      FieldDesc fd1 = new FieldDesc(FieldDesc.ATTR, Util.toJavaFieldName(ad.getName()), "String", null, "null", au.getRequired());
+      fd1.tagName = ad.getName();
+      fd1.documentation = documentation;
+      fd1.realIndex = td.fdMap.size();
+      td.duplicates = Util.addToNameMap(td.fdMap, fd1, false) || td.duplicates;
+      if (checkEnumType(ad.getTypeDefinition())) {
+        XSTypeDefinition etRoot = ad.getTypeDefinition();
+        if (etRoot.getAnonymous()) {
+          etRoot = makeTypeFromAnonymous(ad);
+          if (toAdd != null) toAdd.add((XSComplexTypeDefinition) etRoot);
+        }
+        fd1.type = toJavaTypeName(etRoot, nsdMap);
+        fd1.contentQualifiedName = model.toJavaQualifiedTypeName(etRoot, nsdMap, true);
+        // forward decl
+        if (jtMap.get(fd1.contentQualifiedName) == null) {
+          // logwarn("forward decl: "+et);
+          TypeDesc ftd = new TypeDesc(etRoot.getName(), etRoot.getNamespace(), fd1.type, TypeDesc.TypeEnum.ENUM);
+          jtMap.put(fd1.contentQualifiedName, ftd);
+//          // anonymous (simple type) enum
+//          if (ad.getTypeDefinition().getAnonymous()) {
+//            processEnumType(ad.getTypeDefinition(), jtMap, nsdMap);
+//          }
+        }
+      } else {
+        fd1.simpleTypesString = getSimpleTypesString(ad.getTypeDefinition());
+      }
+    }
+    LinkedList<PEntry> plist = new LinkedList<PEntry>();
+    if (def.getParticle() != null) {
+      plist.add(new PEntry(def.getParticle(), false));
+    }
+    processParticles(def, plist, nsdMap, jtMap, td, models, toAdd, tdBase);
+    jtMap.put(model.toJavaQualifiedTypeName(def, nsdMap, false), td);
+    if (td.fdMap.size() == 1 && def.getSimpleType() != null) {
+      // calc type hierarchy for simple content
+      FieldDesc fd = td.fdMap.get("value");
+      fd.simpleTypesString = getSimpleTypesString(def);
+    }
+  }
+
+  private static String getSimpleTypesString(XSTypeDefinition et) {
+    StringBuffer typesHierarchy = new StringBuffer();
+    while (et != null && !"anySimpleType".equals(et.getName()) && !"anyType".equals(et.getName()) && et.getNamespace() != null) {
+      typesHierarchy.append(et.getNamespace().substring(et.getNamespace().lastIndexOf("/") + 1)).append(":").append(et.getName()).append(";");
+      if (et instanceof XSSimpleType) {
+        XSSimpleType simpleType = (XSSimpleType) et;
+        if (simpleType.getVariety() == XSSimpleTypeDefinition.VARIETY_LIST
+                || simpleType.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
+          XSObjectList list = simpleType.getMemberTypes();
+          if (list.getLength() > 0) {
+            typesHierarchy.append("{");
+            for (int i = 0; i < list.getLength(); i++) {
+              typesHierarchy.append(getSimpleTypesString((XSTypeDefinition) list.item(i)));
+            }
+            typesHierarchy.append("}");
+          }
+        }
+      }
+      et = et.getBaseType();
+    }
+    return typesHierarchy.toString();
+  }
+
+  private TypeDesc processGroup(XSModelGroup modelGroup, List<XSModel> models, Map<String, TypeDesc> jtMap, Map<String, NamespaceDesc> nsdMap) {
+    XSModelGroupDefinition def = null;
+    for (XSModel xsModel : models) {
+      XSNamedMap map = xsModel.getComponents(XSConstants.MODEL_GROUP_DEFINITION);
+      for (int i = 0; i < map.getLength(); i++) {
+        XSModelGroupDefinition mg = (XSModelGroupDefinition) map.item(i);
+        final XSModelGroup xsModelGroup = mg.getModelGroup();
+        if (xsModelGroup == modelGroup || xsModelGroup.toString().equals(modelGroup.toString())) {
+          def = mg;
+          break;
+        }
+      }
+    }
+    if (def == null) return null;
+    if (!nsdMap.containsKey(def.getNamespace())) {
+      Util.log("Namespace desc not found for: " + def);
+    }
+    String typeName = toJavaTypeName(def, nsdMap);
+    final String typeQName = model.toJavaQualifiedTypeName(def, nsdMap, false);
+    TypeDesc td = jtMap.get(typeQName);
+    if (td != null) {
+      if (td.type == TypeDesc.TypeEnum.GROUP_INTERFACE) {
+        return td;
+      } else {
+        Util.logerr("type-group conflict: " + typeName);
+        return null;
+      }
+    } else {
+      td = new TypeDesc(def.getName(), def.getNamespace(), typeName, TypeDesc.TypeEnum.GROUP_INTERFACE);
+    }
+
+    XSAnnotation ann = def.getAnnotation();
+    td.documentation = parseAnnotationString("Type " + def.getNamespace() + ":" + def.getName() + " documentation",
+            ann == null ? null : ann.getAnnotationString());
+    td.type = TypeDesc.TypeEnum.GROUP_INTERFACE;
+    LinkedList<PEntry> plist = new LinkedList<PEntry>();
+    for (int i = 0; i < def.getModelGroup().getParticles().getLength(); i++) {
+      XSParticle p = (XSParticle) def.getModelGroup().getParticles().item(i);
+      plist.add(new PEntry(p, false));
+    }
+    processParticles(def, plist, nsdMap, jtMap, td, models, null, null);
+    jtMap.put(typeQName, td);
+    return td;
+  }
+
+  private void processParticles(XSObject def, LinkedList<PEntry> plist, Map<String, NamespaceDesc> nsdMap, Map<String, TypeDesc> jtMap, TypeDesc td, List<XSModel> models, ArrayList<XSComplexTypeDefinition> toAdd, TypeDesc baseClass) {
+    final boolean globalMerge = jtMap.containsKey(model.toJavaQualifiedTypeName(def, nsdMap, td.type == TypeDesc.TypeEnum.ENUM));
+    final HashMap<XSParticle, String> globalChoice = new HashMap<XSParticle, String>();
+    final ArrayList<XSObjectList> choiceList = new ArrayList<XSObjectList>();
+    final ArrayList<TypeDesc> supers = new ArrayList<TypeDesc>();
+    if (baseClass != null) {
+      supers.add(baseClass);
+    }
+    while (!plist.isEmpty()) {
+      final PEntry pentry = plist.removeFirst();
+      final XSParticle p = pentry.p;
+      if (p.getTerm() instanceof XSElementDecl) {
+        final XSElementDecl el = (XSElementDecl) p.getTerm();
+        if (el.getConstraintType() == XSConstants.VC_FIXED) continue;
+        XSTypeDefinition etRoot = el.getTypeDefinition();
+        XSTypeDefinition et = etRoot;
+        XSAnnotation ann = el.getAnnotation();
+        String documentation = parseAnnotationString("Element " + el.getNamespace() + ":" + el.getName() + " documentation", ann != null ? ann.getAnnotationString() : null);
+        final FieldDesc fd1 = new FieldDesc(FieldDesc.STR, Util.toJavaFieldName(el.getName()), et.getName(), null, "null", !pentry.many && p.getMinOccurs() > 0);
+        fd1.documentation = documentation;
+        fd1.tagName = el.getName();
+        while (et.getBaseType() != null && !"anySimpleType".equals(et.getBaseType().getName()) && !"anyType".equals(et.getBaseType().getName())) {
+          et = et.getBaseType();
+        }
+        if (checkEnumType(etRoot)) {
+          if (etRoot.getAnonymous()) {
+            etRoot = makeTypeFromAnonymous(el);
+            if (toAdd != null) toAdd.add((XSComplexTypeDefinition) etRoot);
+          }
+          fd1.type = toJavaTypeName(etRoot, nsdMap);
+          fd1.clType = FieldDesc.OBJ;
+          fd1.contentQualifiedName = model.toJavaQualifiedTypeName(etRoot, nsdMap, true);
+          // forward decl
+          if (!jtMap.containsKey(fd1.contentQualifiedName)) {
+            // logwarn("forward decl: "+et);
+            TypeDesc ftd = new TypeDesc(etRoot.getName(), etRoot.getNamespace(), fd1.type, TypeDesc.TypeEnum.ENUM);
+            jtMap.put(fd1.contentQualifiedName, ftd);
+          }
+        } else if (checkComplexType(etRoot)) {
+          if (etRoot.getAnonymous()) {
+            etRoot = makeTypeFromAnonymous(el);
+            if (toAdd != null) toAdd.add((XSComplexTypeDefinition) etRoot);
+          }
+          fd1.type = toJavaTypeName(etRoot, nsdMap);
+          fd1.clType = FieldDesc.OBJ;
+          fd1.contentQualifiedName = model.toJavaQualifiedTypeName(etRoot, nsdMap, false);
+          // forward decl
+          if (jtMap.get(fd1.contentQualifiedName) == null) {
+            //logwarn("forward decl: "+etRoot);
+            jtMap.put(fd1.contentQualifiedName, new TypeDesc(etRoot.getName(), etRoot.getNamespace(), fd1.type, TypeDesc.TypeEnum.CLASS));
+          }
+        } else if (checkBooleanType(etRoot)) {
+          fd1.type = "boolean";
+          fd1.clType = FieldDesc.BOOL;
+        } else {
+          if (etRoot instanceof XSComplexTypeDefinition) {
+            final XSComplexTypeDefinition ct = (XSComplexTypeDefinition) etRoot;
+            // XXX xerces2.7.1 wierd annotation inheritance bug fix
+            //ann = (XSAnnotation) (ct.getAnnotations()!=null && ct.getAnnotations().getLength()>0?ct.getAnnotations().item(0):null);
+            ann = (XSAnnotation) (ct.getAnnotations() != null && ct.getAnnotations().getLength() > 0 ? ct.getAnnotations().item(ct.getAnnotations().getLength() - 1) : null);
+            documentation = parseAnnotationString("Type " + ct.getNamespace() + ":" + ct.getName() + " documentation", ann != null ? ann.getAnnotationString() : null);
+            if (documentation != null) {
+              fd1.documentation = fd1.documentation != null ? fd1.documentation + "\n" + documentation : documentation;
+            }
+          }
+          fd1.simpleTypesString = getSimpleTypesString(etRoot);
+
+          // "fully-qualified-classType", "jndi-nameType", "transaction-typeType"
+          // "java-identifierType", "pathType"
+          fd1.type = et.getName();
+          if (fd1.type == null) {
+            fd1.type = "String";
+            fd1.def = "null";
+            fd1.clType = FieldDesc.STR;
+//            fd1.type = "boolean";
+//            fd1.def = "false";
+//            fd1.clType = FieldDesc.BOOL;
+          } else if (fd1.type.equals("string") || fd1.type.equals("anyURI")) {
+            fd1.type = "String";
+          } else if (fd1.type.equals("boolean")) {
+            fd1.type = "String";
+          } else if (fd1.type.equals("emptyType")) {
+            fd1.type = "boolean";
+            fd1.def = "false";
+            fd1.clType = FieldDesc.BOOL;
+          } else if (fd1.type.equals("decimal")) {
+            fd1.type = "String";
+            fd1.def = "\"0.0\"";
+          } else if (fd1.type.equals("QName")) {
+            fd1.type = "String";
+          } else if (fd1.type.equals("extensibleType")) {
+            fd1.type = "Object";
+          } else {
+            if (et.getBaseType() != null &&
+                ("anySimpleType".equals(et.getBaseType().getName())
+              || "anyType".equals(et.getBaseType().getName()))) {
+              fd1.type = "String";
+              fd1.def = "null";
+              fd1.clType = FieldDesc.STR;
+            } else {
+              fd1.type = "boolean";
+              fd1.def = "false";
+              fd1.clType = FieldDesc.BOOL;
+            }
+            Util.logwarn("using '" + fd1.type + "' for unknown base type: " + et.getName() + " for " + el);
+          }
+        }
+        if ((pentry.many || p.getMaxOccursUnbounded() || p.getMaxOccurs() > 1) && fd1.clType != FieldDesc.BOOL) {
+          fd1.elementType = fd1.type;
+          fd1.elementName = fd1.name;
+          fd1.type = "List<" + fd1.elementType + ">";
+          fd1.name = Util.pluralize(fd1.name);
+          fd1.def = "new ArrayList(0)";
+          fd1.clType = -fd1.clType;
+          fd1.comment = "array of " + fd1.elementType;
+        }
+        fd1.realIndex = td.fdMap.size();
+        boolean merge = globalMerge || globalChoice.containsKey(p) && globalChoice.values().contains(fd1.name);
+        td.duplicates = Util.addToNameMap(td.fdMap, fd1, merge) || td.duplicates;
+        globalChoice.put(p, fd1.name);
+      } else if (p.getTerm() instanceof XSModelGroup) {
+        boolean addToGlobalChoice = false;
+        boolean many = p.getMaxOccursUnbounded() || p.getMaxOccurs() > 1;
+        XSObjectList l = ((XSModelGroup) p.getTerm()).getParticles();
+        if (!many) {
+          if (((XSModelGroup) p.getTerm()).getCompositor() == XSModelGroup.COMPOSITOR_CHOICE) {
+            addToGlobalChoice = true;
+            choiceList.add(l);
+          } else {
+            // generate group interface???
+            XSModelGroup groupDef = (XSModelGroup) p.getTerm();
+            TypeDesc gtd = processGroup(groupDef, models, jtMap, nsdMap);
+            if (gtd != null) supers.add(gtd);
+          }
+        }
+        if (globalChoice.containsKey(p)) {
+          addToGlobalChoice = true;
+        }
+        for (int i = 0; i < l.getLength(); i++) {
+          final PEntry o = new PEntry((XSParticle) l.item(i), many);
+          plist.add(o);
+          if (addToGlobalChoice && !globalChoice.containsKey(o.p)) {
+            globalChoice.put(o.p, null);
+          }
+        }
+      }
+    }
+    int i = 0;
+    for (Iterator<FieldDesc> it = td.fdMap.values().iterator(); it.hasNext(); i++) {
+      FieldDesc fd = it.next();
+      fd.idx = i;
+    }
+    for (XSObjectList l : choiceList) {
+      final ArrayList<XSParticle> clist = new ArrayList<XSParticle>();
+      final LinkedList<XSParticle> elist = new LinkedList<XSParticle>();
+      for (i = 0; i < l.getLength(); i++) {
+        elist.add((XSParticle) l.item(i));
+      }
+      while (!elist.isEmpty()) {
+        final XSParticle p = elist.removeFirst();
+        if (p.getTerm() instanceof XSModelGroup) {
+          XSObjectList l2 = ((XSModelGroup) p.getTerm()).getParticles();
+          for (int i2 = 0; i2 < l2.getLength(); i2++) {
+            elist.addFirst((XSParticle) l2.item(i2));
+          }
+        } else if (p.getTerm() instanceof XSElementDecl) {
+          clist.add(p);
+        }
+      }
+      boolean choiceOpt = true;
+      FieldDesc[] choice = new FieldDesc[clist.size()];
+      for (i = 0; i < choice.length; i++) {
+        XSParticle p = clist.get(i);
+        XSElementDecl el = (XSElementDecl) p.getTerm();
+        String s = Util.toJavaFieldName(el.getName());
+        if (p.getMaxOccursUnbounded() || p.getMaxOccurs() > 1) {
+          s = Util.pluralize(s);
+        }
+        FieldDesc fd = td.fdMap.get(s);
+        if (fd == null) {
+          fd = td.fdMap.get(Util.pluralize(s));
+          if (fd == null) {
+            Util.logerr("uknown choice element: " + s);
+          }
+        }
+
+        if (fd != null) {
+          choice[i] = fd;
+          choice[i].choice = choice;
+          if (fd.required) choiceOpt = false;
+        }
+      }
+      for (i = 0; i < choice.length; i++) {
+        if (choice[i] != null) {
+          choice[i].choiceOpt = choiceOpt;
+        }
+      }
+    }
+    td.supers = supers.toArray(new TypeDesc[supers.size()]);
+  }
+  public static String parseAnnotationString(String title, String str) {
+    if (str == null) return null;
+    int idx = str.indexOf(":documentation");
+    if (idx == -1) idx = str.indexOf("<documentation");
+    if (idx == -1) return null;
+    idx = str.indexOf(">", idx + 1);
+    if (idx == -1) return null;
+    int idx2 = str.indexOf(":documentation", idx + 1);
+    if (idx2 == -1) idx2 = str.indexOf("</documentation", idx + 1);
+    idx2 = str.lastIndexOf("<", idx2 + 1);
+    str = str.substring(idx + 1, idx2).trim();
+
+    idx = str.indexOf("<![CDATA[");
+    if (idx > -1) {
+      idx = str.indexOf("[", idx + 3);
+      idx2 = str.indexOf("]]>", idx + 1);
+      str = str.substring(idx + 1, idx2);
+    }
+    return "<pre>\n<h3>" + title + "</h3>\n" + str + "\n</pre>";
+  }
+
+  public String toJavaTypeName(XSObject xs, Map<String, NamespaceDesc> nsdMap) {
+    String name = xs.getName();
+    if (name == null) {
+      if (xs instanceof TypeInfo) {
+        name = ((TypeInfo) xs).getTypeName();
+        if (name != null && name.startsWith("#")) {
+          name = name.substring(1);
+        }
+      }
+    }
+    return model.toJavaTypeName(name, xs.getNamespace());
+  }
+
+  public static class PEntry {
+    public PEntry(XSParticle p, boolean many) {
+      this.p = p;
+      this.many = many;
+    }
+
+    XSParticle p;
+    boolean many;
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/DomDocumentationProvider.java b/xml/dom-impl/src/com/intellij/util/xml/DomDocumentationProvider.java
new file mode 100644
index 0000000..0daaf2d
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/DomDocumentationProvider.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.lang.documentation.DocumentationProvider;
+import com.intellij.pom.PomTarget;
+import com.intellij.pom.PomTargetPsiElement;
+import com.intellij.psi.DelegatePsiTarget;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiManager;
+
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class DomDocumentationProvider implements DocumentationProvider {
+
+  public String getQuickNavigateInfo(final PsiElement element, PsiElement originalElement) {
+    return null;
+  }
+
+  public List<String> getUrlFor(final PsiElement element, final PsiElement originalElement) {
+    return null;
+  }
+
+  public String generateDoc(PsiElement element, final PsiElement originalElement) {
+    if (element instanceof PomTargetPsiElement) {
+      PomTarget target = ((PomTargetPsiElement)element).getTarget();
+      if (target instanceof DelegatePsiTarget) {
+        element = ((DelegatePsiTarget)target).getNavigationElement();
+      }
+    }
+    final DomElement domElement = DomUtil.getDomElement(element);
+    if (domElement == null) {
+      return null;
+    }
+    ElementPresentationTemplate template = domElement.getChildDescription().getPresentationTemplate();
+    if (template != null) {
+      String documentation = template.createPresentation(domElement).getDocumentation();
+      if (documentation != null) return documentation;
+    }
+    return ElementPresentationManager.getDocumentationForElement(domElement);
+  }
+
+  public PsiElement getDocumentationElementForLookupItem(final PsiManager psiManager, final Object object, final PsiElement element) {
+    return null;
+  }
+
+  public PsiElement getDocumentationElementForLink(final PsiManager psiManager, final String link, final PsiElement context) {
+    return null;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/DomFileIconProvider.java b/xml/dom-impl/src/com/intellij/util/xml/DomFileIconProvider.java
new file mode 100644
index 0000000..6cab77c
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/DomFileIconProvider.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.ide.IconProvider;
+import com.intellij.openapi.project.DumbAware;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class DomFileIconProvider extends IconProvider implements DumbAware {
+  @Override
+  public Icon getIcon(@NotNull PsiElement element, int flags) {
+    if (element instanceof XmlFile) {
+      DomFileDescription<?> description = DomManager.getDomManager(element.getProject()).getDomFileDescription((XmlFile)element);
+      return description == null ? null : description.getFileIcon(flags);
+    }
+    return null;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/DomFileIndex.java b/xml/dom-impl/src/com/intellij/util/xml/DomFileIndex.java
new file mode 100644
index 0000000..5e025a8
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/DomFileIndex.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.indexing.*;
+import com.intellij.util.io.EnumeratorStringDescriptor;
+import com.intellij.util.io.KeyDescriptor;
+import com.intellij.util.text.CharArrayUtil;
+import com.intellij.util.xml.impl.DomApplicationComponent;
+import gnu.trove.THashMap;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author peter
+ */
+public class DomFileIndex extends ScalarIndexExtension<String>{
+  public static final ID<String,Void> NAME = ID.create("DomFileIndex");
+  private static final FileBasedIndex.InputFilter INPUT_FILTER = new FileBasedIndex.InputFilter() {
+    @Override
+    public boolean acceptInput(final VirtualFile file) {
+      return file.getFileType() == StdFileTypes.XML;
+    }
+  };
+  private final DataIndexer<String,Void, FileContent> myDataIndexer;
+
+  public DomFileIndex() {
+    myDataIndexer = new DataIndexer<String, Void, FileContent>() {
+      @Override
+      @NotNull
+      public Map<String, Void> map(final FileContent inputData) {
+        final Set<String> namespaces = new THashSet<String>();
+        final XmlFileHeader header = NanoXmlUtil.parseHeader(CharArrayUtil.readerFromCharSequence(inputData.getContentAsText()));
+        ContainerUtil.addIfNotNull(header.getPublicId(), namespaces);
+        ContainerUtil.addIfNotNull(header.getSystemId(), namespaces);
+        ContainerUtil.addIfNotNull(header.getRootTagNamespace(), namespaces);
+        final String tagName = header.getRootTagLocalName();
+        if (StringUtil.isNotEmpty(tagName)) {
+          final THashMap<String, Void> result = new THashMap<String, Void>();
+          final DomApplicationComponent component = DomApplicationComponent.getInstance();
+          for (final DomFileDescription description : component.getFileDescriptions(tagName)) {
+            final String[] strings = description.getAllPossibleRootTagNamespaces();
+            if (strings.length == 0 || ContainerUtil.intersects(Arrays.asList(strings), namespaces)) {
+              result.put(description.getRootElementClass().getName(), null);
+            }
+          }
+          for (final DomFileDescription description : component.getAcceptingOtherRootTagNameDescriptions()) {
+            final String[] strings = description.getAllPossibleRootTagNamespaces();
+            if (strings.length == 0 || ContainerUtil.intersects(Arrays.asList(strings), namespaces)) {
+              result.put(description.getRootElementClass().getName(), null);
+            }
+          }
+          return result;
+        }
+        return Collections.emptyMap();
+      }
+    };
+  }
+
+  @Override
+  @NotNull
+  public ID<String, Void> getName() {
+    return NAME;
+  }
+
+  @Override
+  @NotNull
+  public DataIndexer<String, Void, FileContent> getIndexer() {
+    return myDataIndexer;
+  }
+
+  @Override
+  public KeyDescriptor<String> getKeyDescriptor() {
+    return new EnumeratorStringDescriptor();
+  }
+
+  @Override
+  public FileBasedIndex.InputFilter getInputFilter() {
+    return INPUT_FILTER;
+  }
+
+  @Override
+  public boolean dependsOnFileContent() {
+    return true;
+  }
+
+  @Override
+  public int getVersion() {
+    final DomApplicationComponent component = DomApplicationComponent.getInstance();
+    int result = 0;
+    for (DomFileDescription description : component.getAllFileDescriptions()) {
+      result += description.getVersion();
+      result += description.getRootTagName().hashCode(); // so that a plugin enabling/disabling could trigger the reindexing
+    }
+    return result;
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/DomNameSuggestionProvider.java b/xml/dom-impl/src/com/intellij/util/xml/DomNameSuggestionProvider.java
new file mode 100644
index 0000000..b322d8f
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/DomNameSuggestionProvider.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.codeStyle.SuggestedNameInfo;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.meta.PsiMetaOwner;
+import com.intellij.refactoring.rename.NameSuggestionProvider;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Set;
+
+/**
+ * @author Gregory.Shrago
+ */
+public class DomNameSuggestionProvider implements NameSuggestionProvider {
+  public SuggestedNameInfo getSuggestedNames(final PsiElement element, final PsiElement nameSuggestionContext, final Set<String> result) {
+    if (element instanceof PsiMetaOwner) {
+      final PsiMetaData psiMetaData = ((PsiMetaOwner)element).getMetaData();
+      if (psiMetaData instanceof DomMetaData) {
+        final DomMetaData domMetaData = (DomMetaData)psiMetaData;
+        final GenericDomValue value = domMetaData.getNameElement(domMetaData.getElement());
+        ContainerUtil.addIfNotNull(getNameFromNameValue(value, true), result);
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  private static String getNameFromNameValue(final Object o, final boolean local) {
+    if (o == null || o instanceof String) {
+      return (String)o;
+    }
+    else if (o instanceof GenericValue) {
+      final GenericValue value = (GenericValue)o;
+      if (!local) {
+        final Object name = value.getValue();
+        if (name != null) {
+          return String.valueOf(name);
+        }
+      }
+      return value.getStringValue();
+    }
+    else {
+      return String.valueOf(o);
+    }
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/DomUsageTypeProvider.java b/xml/dom-impl/src/com/intellij/util/xml/DomUsageTypeProvider.java
new file mode 100644
index 0000000..63e5943
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/DomUsageTypeProvider.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.usages.impl.rules.UsageType;
+import com.intellij.usages.impl.rules.UsageTypeProvider;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Gregory.Shrago
+ */
+public class DomUsageTypeProvider implements UsageTypeProvider {
+  @Nullable
+  public UsageType getUsageType(PsiElement element) {
+    final PsiFile psiFile = element.getContainingFile();
+    if (XMLLanguage.INSTANCE.equals(psiFile.getLanguage()) &&
+        DomManager.getDomManager(element.getProject()).getFileElement((XmlFile)psiFile, DomElement.class) != null) {
+      return DOM_USAGE_TYPE;
+    }
+    return null;
+  }
+
+  private static final UsageType DOM_USAGE_TYPE = new UsageType(DomBundle.message("dom.usage.type"));
+}
\ No newline at end of file
diff --git a/xml/dom-impl/src/com/intellij/util/xml/ElementPresentationManagerImpl.java b/xml/dom-impl/src/com/intellij/util/xml/ElementPresentationManagerImpl.java
new file mode 100644
index 0000000..d1d370d
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/ElementPresentationManagerImpl.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+import com.intellij.codeInsight.lookup.LookupElementBuilder;
+import com.intellij.psi.PsiElement;
+import com.intellij.util.Function;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class ElementPresentationManagerImpl extends ElementPresentationManager {
+
+  @NotNull
+  public <T> Object[] createVariants(Collection<T> elements, Function<T, String> namer, int iconFlags) {
+    List<Object> result = new ArrayList<Object>(elements.size());
+    for (T element : elements) {
+      String name = namer.fun(element);
+      if (name != null) {
+        Object value = createVariant(element, name, null);
+        result.add(value);
+      }
+    }
+    return result.toArray();
+  }
+
+  public Object createVariant(final Object variant, final String name, final PsiElement psiElement) {
+    final LookupElementBuilder builder;
+    if (psiElement != null) {
+      builder = LookupElementBuilder.create(psiElement, name);
+    }
+    else {
+      builder = LookupElementBuilder.create(name);
+    }
+    return builder.withIcon(ElementPresentationManager.getIcon(variant));
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/EnumConverter.java b/xml/dom-impl/src/com/intellij/util/xml/EnumConverter.java
new file mode 100644
index 0000000..fd24a9e
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/EnumConverter.java
@@ -0,0 +1,63 @@
+package com.intellij.util.xml;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.containers.ConcurrentFactoryMap;
+import com.intellij.xml.util.XmlUtil;
+import com.intellij.codeInsight.CodeInsightBundle;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+
+/**
+ * @author peter
+ */
+public class EnumConverter<T extends Enum> extends ResolvingConverter<T>{
+  private static final ConcurrentFactoryMap<Class,EnumConverter> ourCache = new ConcurrentFactoryMap<Class, EnumConverter>() {
+    @NotNull
+    protected EnumConverter create(final Class key) {
+      return new EnumConverter(key);
+    }
+  };
+  private final Class<T> myType;
+
+  private EnumConverter(final Class<T> aClass) {
+    myType = aClass;
+  }
+
+  public static <T extends Enum> EnumConverter<T>  createEnumConverter(Class<T> aClass) {
+    return ourCache.get(aClass);
+  }
+
+  private String getStringValue(final T anEnum) {
+    return NamedEnumUtil.getEnumValueByElement(anEnum);
+  }
+
+  public final T fromString(final String s, final ConvertContext context) {
+    return s==null?null:(T)NamedEnumUtil.getEnumElementByValue((Class)myType, s);
+  }
+
+  public final String toString(final T t, final ConvertContext context) {
+    return t == null? null:getStringValue(t);
+  }
+
+  public String getErrorMessage(@Nullable final String s, final ConvertContext context) {
+    return CodeInsightBundle.message("error.unknown.enum.value.message", s);
+  }
+
+  @NotNull
+  public Collection<? extends T> getVariants(final ConvertContext context) {
+    final XmlElement element = context.getXmlElement();
+    if (element instanceof XmlTag) {
+      final XmlTag simpleContent = XmlUtil.getSchemaSimpleContent((XmlTag)element);
+      if (simpleContent != null && XmlUtil.collectEnumerationValues(simpleContent, new HashSet<String>())) {
+        return Collections.emptyList();
+      }
+    }
+    return Arrays.asList(myType.getEnumConstants());
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/ModelMergerImpl.java b/xml/dom-impl/src/com/intellij/util/xml/ModelMergerImpl.java
new file mode 100644
index 0000000..0710b07
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/ModelMergerImpl.java
@@ -0,0 +1,422 @@
+package com.intellij.util.xml;
+
+import com.intellij.openapi.util.Pair;
+import com.intellij.util.ReflectionCache;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.SmartList;
+import com.intellij.util.containers.ConcurrentFactoryMap;
+import com.intellij.util.containers.ConcurrentSoftArrayHashMap;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.FactoryMap;
+import com.intellij.util.xml.impl.DomInvocationHandler;
+import com.intellij.util.xml.impl.DomManagerImpl;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import gnu.trove.THashSet;
+import net.sf.cglib.proxy.AdvancedProxy;
+import net.sf.cglib.proxy.InvocationHandler;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.*;
+
+/**
+ * @author peter
+ */
+public class ModelMergerImpl implements ModelMerger {
+  // [greg] the key should actually be the MergingStrategy class, but this will break the API
+  private final ConcurrentFactoryMap<Class, ConcurrentSoftArrayHashMap<Object, Object>> myMergedMap = new ConcurrentFactoryMap<Class, ConcurrentSoftArrayHashMap<Object, Object>>() {
+    protected ConcurrentSoftArrayHashMap<Object, Object> create(final Class key) {
+      return new ConcurrentSoftArrayHashMap<Object, Object>(ContainerUtil.identityStrategy());
+    }
+  };
+  private final List<Pair<InvocationStrategy,Class>> myInvocationStrategies = new ArrayList<Pair<InvocationStrategy,Class>>();
+  private final List<MergingStrategy> myMergingStrategies = new ArrayList<MergingStrategy>();
+  private final List<Class> myMergingStrategyClasses = new ArrayList<Class>();
+  private static final Class<MergedObject> MERGED_OBJECT_CLASS = MergedObject.class;
+
+  private final ConcurrentFactoryMap<Method,List<Pair<InvocationStrategy,Class>>> myAcceptsCache = new ConcurrentFactoryMap<Method,List<Pair<InvocationStrategy,Class>>>() {
+    protected List<Pair<InvocationStrategy,Class>> create(final Method method) {
+      List<Pair<InvocationStrategy,Class>> result = new ArrayList<Pair<InvocationStrategy,Class>>();
+      for (int i = myInvocationStrategies.size() - 1; i >= 0; i--) {
+        final Pair<InvocationStrategy, Class> pair = myInvocationStrategies.get(i);
+        if (pair.first.accepts(method)) {
+          result.add(pair);
+        }
+      }
+      return result;
+    }
+  };
+
+  public ModelMergerImpl() {
+    addInvocationStrategy(Object.class, new InvocationStrategy<Object>() {
+      public boolean accepts(final Method method) {
+        return true;
+      }
+
+      public Object invokeMethod(final JavaMethod javaMethod, final Object proxy, final Object[] args, final List<Object> implementations)
+        throws IllegalAccessException, InvocationTargetException {
+        final Method method = javaMethod.getMethod();
+        List<Object> results = getMergedImplementations(method, args, method.getReturnType(), implementations, isIntersectionMethod(javaMethod));
+        return results.isEmpty() ? null : results.get(0);
+      }
+    });
+
+    addInvocationStrategy(Object.class, new InvocationStrategy<Object>() {
+      public boolean accepts(final Method method) {
+        return Collection.class.isAssignableFrom(method.getReturnType());
+      }
+
+      public Object invokeMethod(final JavaMethod method, final Object proxy, final Object[] args, final List<Object> implementations)
+        throws IllegalAccessException, InvocationTargetException {
+
+        final Type type = DomReflectionUtil.extractCollectionElementType(method.getGenericReturnType());
+        assert type != null : "No generic return type in method " + method;
+        return getMergedImplementations(method.getMethod(), args, ReflectionUtil.getRawType(type), implementations, isIntersectionMethod(method));
+      }
+    });
+
+
+    addInvocationStrategy(Object.class, new InvocationStrategy<Object>() {
+      public boolean accepts(final Method method) {
+        return Object.class.equals(method.getDeclaringClass());
+      }
+
+      public Object invokeMethod(final JavaMethod method, final Object proxy, final Object[] args, final List<Object> implementations) {
+        @NonNls String methodName = method.getName();
+        if ("toString".equals(methodName)) {
+          return "Merger: " + implementations;
+        }
+        if ("hashCode".equals(methodName)) {
+          int result = 1;
+
+          for (Object element : implementations)
+            result = 31 * result + element.hashCode();
+
+          return result;
+        }
+        if ("equals".equals(methodName)) {
+          final Object arg = args[0];
+          return arg != null && arg instanceof MergedObject && implementations.equals(((MergedObject)arg).getImplementations());
+
+        }
+        return null;
+      }
+    });
+
+    addInvocationStrategy(Object.class, new InvocationStrategy<Object>() {
+      public boolean accepts(final Method method) {
+        return "isValid".equals(method.getName());
+      }
+
+      public Object invokeMethod(final JavaMethod method, final Object proxy, final Object[] args, final List<Object> implementations)
+        throws IllegalAccessException, InvocationTargetException {
+        for (final Object implementation : implementations) {
+          if (!((Boolean)method.invoke(implementation, args))) {
+            return Boolean.FALSE;
+          }
+        }
+        return Boolean.TRUE;
+      }
+    });
+
+    addInvocationStrategy(Object.class, new InvocationStrategy<Object>() {
+      public boolean accepts(final Method method) {
+        return void.class.equals(method.getReturnType());
+      }
+
+      public Object invokeMethod(final JavaMethod method, final Object proxy, final Object[] args, final List<Object> implementations)
+        throws IllegalAccessException, InvocationTargetException {
+        for (final Object t : implementations) {
+          method.invoke(t, args);
+        }
+        return null;
+      }
+    });
+
+    addInvocationStrategy(Object.class, new InvocationStrategy<Object>() {
+      public boolean accepts(final Method method) {
+        return MERGED_OBJECT_CLASS.equals(method.getDeclaringClass());
+      }
+
+      public Object invokeMethod(final JavaMethod method, final Object proxy, final Object[] args, final List<Object> implementations)
+        throws IllegalAccessException, InvocationTargetException {
+        assert "getImplementations".equals(method.getName());
+        return implementations;
+      }
+    });
+
+    addInvocationStrategy(DomElement.class, new InvocationStrategy<DomElement>() {
+      public boolean accepts(final Method method) {
+        return DomInvocationHandler.ACCEPT_METHOD.equals(method);
+      }
+
+      public Object invokeMethod(final JavaMethod method, final DomElement proxy, final Object[] args, final List<DomElement> implementations)
+        throws IllegalAccessException, InvocationTargetException {
+        final DomElementVisitor visitor = (DomElementVisitor)args[0];
+        ((DomManagerImpl)implementations.get(0).getManager()).getApplicationComponent().getVisitorDescription(visitor.getClass()).acceptElement(visitor, proxy);
+        return null;
+      }
+    });
+
+    addInvocationStrategy(DomElement.class, new InvocationStrategy<DomElement>() {
+      public boolean accepts(final Method method) {
+        return DomInvocationHandler.ACCEPT_CHILDREN_METHOD.equals(method);
+      }
+
+      public Object invokeMethod(final JavaMethod method, final DomElement proxy, final Object[] args, final List<DomElement> implementations)
+        throws IllegalAccessException, InvocationTargetException {
+        final DomElementVisitor visitor = (DomElementVisitor)args[0];
+        for (final AbstractDomChildrenDescription description : implementations.get(0).getGenericInfo().getChildrenDescriptions()) {
+          for (final DomElement value : description.getValues(proxy)) {
+            value.accept(visitor);
+          }
+        }
+        return null;
+      }
+    });
+
+  }
+
+  private boolean isIntersectionMethod(final JavaMethod javaMethod) {
+    return javaMethod.getMethod().getAnnotation(Intersect.class) != null;
+  }
+
+  public final <T> void addInvocationStrategy(Class<T> aClass, InvocationStrategy<T> strategy) {
+    myInvocationStrategies.add(Pair.<InvocationStrategy,Class>create(strategy, aClass));
+  }
+
+  public final <T> void addMergingStrategy(Class<T> aClass, MergingStrategy<T> strategy) {
+    myMergingStrategies.add(strategy);
+    myMergingStrategyClasses.add(aClass);
+  }
+
+  public <T> T mergeModels(final Class<T> aClass, final T... implementations) {
+    /*final Object o = myMergedMap.get(aClass).get(implementations);
+    if (o != null) {
+      return (T)o;
+    }*/
+    if (implementations.length == 1) return implementations[0];
+    final MergingInvocationHandler<T> handler = new MergingInvocationHandler<T>(aClass, Arrays.asList(implementations));
+    return _mergeModels(aClass, handler, implementations);
+  }
+
+  public <T> T mergeModels(final Class<T> aClass, final Collection<? extends T> implementations) {
+    return (T)mergeModels((Class)aClass, implementations.toArray());
+  }
+
+
+  private <T> T _mergeModels(final Class<? super T> aClass, final MergingInvocationHandler<T> handler, final T... implementations) {
+    final Set<Class> commonClasses = getCommonClasses(new THashSet<Class>(), implementations);
+    commonClasses.add(MERGED_OBJECT_CLASS);
+    commonClasses.add(aClass);
+    final T t = AdvancedProxy.<T>createProxy(handler, null, commonClasses.toArray(new Class[commonClasses.size()]));
+    //myMergedMap.get(aClass).put(implementations, t);
+    return t;
+  }
+
+  private static <T extends Collection<Class>> T getCommonClasses(final T result, final Object... implementations) {
+    if (implementations.length > 0) {
+      DomUtil.getAllInterfaces(implementations[0].getClass(), result);
+      for (int i = 1; i < implementations.length; i++) {
+        final ArrayList<Class> list1 = new ArrayList<Class>();
+        DomUtil.getAllInterfaces(implementations[i].getClass(), list1);
+        result.retainAll(list1);
+      }
+    }
+    return result;
+  }
+
+
+  private static final Map<Class<? extends Object>, Method> ourPrimaryKeyMethods = new HashMap<Class<? extends Object>, Method>();
+
+  public class MergingInvocationHandler<T> implements InvocationHandler {
+    private final Class<? super T> myClass;
+    private List<T> myImplementations;
+
+    public MergingInvocationHandler(final Class<T> aClass, final List<T> implementations) {
+      this(aClass);
+      for (final T implementation : implementations) {
+        if (implementation instanceof StableElement) {
+          throw new AssertionError("Stable values merging is prohibited: " + implementation);
+        }
+      }
+      myImplementations = implementations;
+    }
+
+    public MergingInvocationHandler(final Class<T> aClass) {
+      myClass = aClass;
+    }
+
+    @NotNull
+    private InvocationStrategy findStrategy(final Object proxy, final Method method) {
+      for (final Pair<InvocationStrategy, Class> pair : myAcceptsCache.get(method)) {
+        if (Object.class.equals(pair.second) || pair.second.isInstance(proxy)) {
+          return pair.first;
+        }
+      }
+      throw new AssertionError("impossible");
+    }
+
+    public Object invoke(Object proxy, final Method method, final Object[] args) throws Throwable {
+      try {
+        return findStrategy(proxy, method).invokeMethod(getJavaMethod(method), proxy, args, myImplementations);
+      }
+      catch (InvocationTargetException e) {
+        throw e.getCause();
+      }
+    }
+
+    private JavaMethod getJavaMethod(final Method method) {
+      if (ReflectionCache.isAssignable(MERGED_OBJECT_CLASS, method.getDeclaringClass())) {
+        return JavaMethod.getMethod(MERGED_OBJECT_CLASS, method);
+      }
+      if (ReflectionCache.isAssignable(method.getDeclaringClass(), myClass)) {
+        return JavaMethod.getMethod(myClass, method);
+      }
+      return JavaMethod.getMethod(method.getDeclaringClass(), method);
+    }
+  }
+
+  @Nullable
+  private static Object getPrimaryKey(Object implementation, final boolean singleValuedInvocation) {
+    final Method method = getPrimaryKeyMethod(implementation.getClass());
+    if (method != null) {
+      final Object o = DomReflectionUtil.invokeMethod(method, implementation);
+      return ReflectionCache.isAssignable(GenericValue.class, method.getReturnType()) ? ((GenericValue)o).getValue() : o;
+    }
+    else {
+      if (implementation instanceof GenericValue) {
+        return singleValuedInvocation? Boolean.TRUE : ((GenericValue)implementation).getValue();
+      }
+      else {
+        return null;
+      }
+    }
+  }
+
+  @Nullable
+  private static Method getPrimaryKeyMethod(final Class<? extends Object> aClass) {
+    Method method = ourPrimaryKeyMethods.get(aClass);
+    if (method == null) {
+      if (ourPrimaryKeyMethods.containsKey(aClass)) return null;
+
+      for (final Method method1 : aClass.getMethods()) {
+        if ((method = findPrimaryKeyAnnotatedMethod(method1, aClass)) != null) {
+          break;
+        }
+      }
+      ourPrimaryKeyMethods.put(aClass, method);
+    }
+    return method;
+  }
+
+  @Nullable
+  private static Method findPrimaryKeyAnnotatedMethod(final Method method, final Class aClass) {
+    return method.getReturnType() != void.class && method.getParameterTypes().length == 0 ? new JavaMethodSignature(method)
+      .findAnnotatedMethod(PrimaryKey.class, aClass) : null;
+  }
+
+  private List<Object> getMergedImplementations(final Method method,
+                                                final Object[] args,
+                                                final Class returnType,
+                                                final List<Object> implementations,
+                                                final boolean intersect) throws IllegalAccessException, InvocationTargetException {
+
+    final List<Object> results = new ArrayList<Object>();
+
+    if (ReflectionCache.isInterface(returnType)) {
+      final List<Object> orderedPrimaryKeys = new SmartList<Object>();
+      final FactoryMap<Object, List<Set<Object>>> map = new FactoryMap<Object, List<Set<Object>>>() {
+        @NotNull
+        protected List<Set<Object>> create(final Object key) {
+          orderedPrimaryKeys.add(key);
+          return new SmartList<Set<Object>>();
+        }
+      };
+      final FactoryMap<Object, int[]> counts = new FactoryMap<Object, int[]>() {
+        @NotNull
+        protected int[] create(final Object key) {
+          return new int[implementations.size()];
+        }
+      };
+      for (int i = 0; i < implementations.size(); i++) {
+        Object t = implementations.get(i);
+        final Object o = method.invoke(t, args);
+        if (o instanceof Collection) {
+          for (final Object o1 : (Collection)o) {
+            addToMaps(o1, counts, map, i, results, false, intersect);
+          }
+        }
+        else if (o != null) {
+          addToMaps(o, counts, map, i, results, true, intersect);
+        }
+
+      }
+
+      for (final Object primaryKey : orderedPrimaryKeys) {
+        for (final Set<Object> objects : map.get(primaryKey)) {
+          results.add(mergeImplementations(returnType, new ArrayList<Object>(objects)));
+        }
+      }
+    }
+    else {
+      HashSet<Object> map = new HashSet<Object>();
+      for (final Object t : implementations) {
+        final Object o = method.invoke(t, args);
+        if (o instanceof Collection) {
+          map.addAll((Collection<Object>)o);
+        }
+        else if (o != null) {
+          map.add(o);
+          break;
+        }
+      }
+      results.addAll(map);
+    }
+    return results;
+  }
+
+  protected final Object mergeImplementations(final Class returnType, final List<Object> implementations) {
+    for (int i = myMergingStrategies.size() - 1; i >= 0; i--) {
+      if (ReflectionCache.isAssignable(myMergingStrategyClasses.get(i), returnType)) {
+        final Object o = myMergingStrategies.get(i).mergeChildren(returnType, implementations);
+        if (o != null) {
+          return o;
+        }
+      }
+    }
+    if (implementations.size() == 1) {
+      return implementations.get(0);
+    }
+    return mergeModels(returnType, implementations);
+  }
+
+  private boolean addToMaps(final Object o,
+                            final FactoryMap<Object, int[]> counts,
+                            final FactoryMap<Object, List<Set<Object>>> map,
+                            final int index,
+                            final List<Object> results,
+                            final boolean singleValuedInvocation,
+                            final boolean intersect) throws IllegalAccessException, InvocationTargetException {
+    final Object primaryKey = getPrimaryKey(o, singleValuedInvocation);
+    if (primaryKey != null || singleValuedInvocation) {
+      final List<Set<Object>> list = map.get(primaryKey);
+      final int[] indices = counts.get(primaryKey);
+      int objIndex = intersect? indices[index] : indices[index]++;
+      if (list.size() <= objIndex) {
+        list.add(new LinkedHashSet<Object>());
+      }
+      list.get(objIndex).add(o);
+      return false;
+    }
+
+    results.add(o);
+    return true;
+  }
+
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomCollectionProblemDescriptorImpl.java b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomCollectionProblemDescriptorImpl.java
new file mode 100644
index 0000000..e6ea34f
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomCollectionProblemDescriptorImpl.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+
+/**
+ * @author peter
+ */
+public class DomCollectionProblemDescriptorImpl extends DomElementProblemDescriptorImpl implements DomCollectionProblemDescriptor {
+  private final DomCollectionChildDescription myChildDescription;
+
+  public DomCollectionProblemDescriptorImpl(final DomElement domElement,
+                                            final String message,
+                                            final HighlightSeverity type,
+                                            final DomCollectionChildDescription childDescription) {
+    super(domElement, message, type);
+    myChildDescription = childDescription;
+  }
+
+  public DomCollectionProblemDescriptorImpl(final DomElement domElement,
+                                            final String message,
+                                            final HighlightSeverity type,
+                                            final DomCollectionChildDescription childDescription,
+                                            final LocalQuickFix... fixes) {
+    super(domElement, message, type, fixes);
+    myChildDescription = childDescription;
+  }
+
+  public String toString() {
+    return super.toString() + "; " + myChildDescription;
+  }
+
+  public DomCollectionChildDescription getChildDescription() {
+    return myChildDescription;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementAnnotationHolderImpl.java b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementAnnotationHolderImpl.java
new file mode 100644
index 0000000..f381140
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementAnnotationHolderImpl.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.LocalQuickFixProvider;
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.SmartList;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.impl.ConvertContextImpl;
+import com.intellij.util.xml.impl.DomManagerImpl;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+public class DomElementAnnotationHolderImpl extends SmartList<DomElementProblemDescriptor> implements DomElementAnnotationHolder {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.highlighting.DomElementAnnotationHolderImpl");
+  private final SmartList<Annotation> myAnnotations = new SmartList<Annotation>();
+  private final boolean myOnTheFly;
+
+  public DomElementAnnotationHolderImpl(boolean onTheFly) {
+    myOnTheFly = onTheFly;
+  }
+
+  @Override
+  public boolean isOnTheFly() {
+    return myOnTheFly;
+  }
+
+  @NotNull
+  public DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, @Nullable String message, LocalQuickFix... fixes) {
+    return createProblem(domElement, HighlightSeverity.ERROR, message, fixes);
+  }
+
+  @NotNull
+  public DomElementProblemDescriptor createProblem(@NotNull DomElement domElement,
+                                                   DomCollectionChildDescription childDescription,
+                                                   @Nullable String message) {
+    return addProblem(new DomCollectionProblemDescriptorImpl(domElement, message, HighlightSeverity.ERROR, childDescription));
+  }
+
+  @NotNull
+  public final DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, HighlightSeverity highlightType, String message) {
+    return createProblem(domElement, highlightType, message, LocalQuickFix.EMPTY_ARRAY);
+  }
+
+  public DomElementProblemDescriptor createProblem(@NotNull final DomElement domElement,
+                                                   final HighlightSeverity highlightType,
+                                                   final String message,
+                                                   final LocalQuickFix[] fixes) {
+    return createProblem(domElement, highlightType, message, null, fixes);
+  }
+
+  public DomElementProblemDescriptor createProblem(@NotNull final DomElement domElement,
+                                                   final HighlightSeverity highlightType,
+                                                   final String message,
+                                                   final TextRange textRange,
+                                                   final LocalQuickFix... fixes) {
+    return addProblem(new DomElementProblemDescriptorImpl(domElement, message, highlightType, textRange, null, fixes));
+  }
+
+  public DomElementProblemDescriptor createProblem(@NotNull DomElement domElement,
+                                                   ProblemHighlightType highlightType,
+                                                   String message,
+                                                   @Nullable TextRange textRange,
+                                                   LocalQuickFix... fixes) {
+    return addProblem(new DomElementProblemDescriptorImpl(domElement, message, HighlightSeverity.ERROR, textRange, highlightType, fixes));
+  }
+
+  @NotNull
+  public DomElementResolveProblemDescriptor createResolveProblem(@NotNull GenericDomValue element, @NotNull PsiReference reference) {
+    return addProblem(new DomElementResolveProblemDescriptorImpl(element, reference, getQuickFixes(element, reference)));
+  }
+
+  @NotNull
+  public Annotation createAnnotation(@NotNull DomElement element, HighlightSeverity severity, @Nullable String message) {
+    final XmlElement xmlElement = element.getXmlElement();
+    LOG.assertTrue(xmlElement != null, "No XML element for " + element);
+    final TextRange range = xmlElement.getTextRange();
+    final int startOffset = range.getStartOffset();
+    final int endOffset = message == null ? startOffset : range.getEndOffset();
+    final Annotation annotation = new Annotation(startOffset, endOffset, severity, message, null);
+    myAnnotations.add(annotation);
+    return annotation;
+  }
+
+  public final SmartList<Annotation> getAnnotations() {
+    return myAnnotations;
+  }
+
+  public int getSize() {
+    return size();
+  }
+
+  private LocalQuickFix[] getQuickFixes(final GenericDomValue element, PsiReference reference) {
+    if (!myOnTheFly) return LocalQuickFix.EMPTY_ARRAY;
+
+    final List<LocalQuickFix> result = new SmartList<LocalQuickFix>();
+    final Converter converter = WrappingConverter.getDeepestConverter(element.getConverter(), element);
+    if (converter instanceof ResolvingConverter) {
+      final ResolvingConverter resolvingConverter = (ResolvingConverter)converter;
+      ContainerUtil
+        .addAll(result, resolvingConverter.getQuickFixes(new ConvertContextImpl(DomManagerImpl.getDomInvocationHandler(element))));
+    }
+    if (reference instanceof LocalQuickFixProvider) {
+      final LocalQuickFix[] localQuickFixes = ((LocalQuickFixProvider)reference).getQuickFixes();
+      if (localQuickFixes != null) {
+        ContainerUtil.addAll(result, localQuickFixes);
+      }
+    }
+    return result.isEmpty() ? LocalQuickFix.EMPTY_ARRAY : result.toArray(new LocalQuickFix[result.size()]);
+  }
+
+  public <T extends DomElementProblemDescriptor> T addProblem(final T problemDescriptor) {
+    add(problemDescriptor);
+    return problemDescriptor;
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementAnnotationsManagerImpl.java b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementAnnotationsManagerImpl.java
new file mode 100644
index 0000000..9da5e8c
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementAnnotationsManagerImpl.java
@@ -0,0 +1,322 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInsight.daemon.HighlightDisplayKey;
+import com.intellij.codeInspection.InspectionManager;
+import com.intellij.codeInspection.InspectionProfile;
+import com.intellij.codeInspection.InspectionProfileEntry;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.ModificationTracker;
+import com.intellij.profile.Profile;
+import com.intellij.profile.ProfileChangeAdapter;
+import com.intellij.profile.codeInspection.InspectionProfileManager;
+import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.util.PsiModificationTracker;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.EventDispatcher;
+import com.intellij.util.SmartList;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.impl.DomApplicationComponent;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.List;
+
+public class DomElementAnnotationsManagerImpl extends DomElementAnnotationsManager {
+  public static final Object LOCK = new Object();
+
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.highlighting.DomElementAnnotationsManagerImpl");
+  private static final Key<DomElementsProblemsHolderImpl> DOM_PROBLEM_HOLDER_KEY = Key.create("DomProblemHolder");
+  private static final Key<CachedValue<Boolean>> CACHED_VALUE_KEY = Key.create("DomProblemHolderCachedValue");
+  private final EventDispatcher<DomHighlightingListener> myDispatcher = EventDispatcher.create(DomHighlightingListener.class);
+
+  private static final DomElementsProblemsHolder EMPTY_PROBLEMS_HOLDER = new DomElementsProblemsHolder() {
+    @NotNull
+    public List<DomElementProblemDescriptor> getProblems(DomElement domElement) {
+      return Collections.emptyList();
+    }
+
+    public List<DomElementProblemDescriptor> getProblems(final DomElement domElement, boolean includeXmlProblems) {
+      return Collections.emptyList();
+    }
+
+    public List<DomElementProblemDescriptor> getProblems(final DomElement domElement,
+                                                         final boolean includeXmlProblems,
+                                                         final boolean withChildren) {
+      return Collections.emptyList();
+    }
+
+    public List<DomElementProblemDescriptor> getProblems(DomElement domElement,
+                                                         final boolean includeXmlProblems,
+                                                         final boolean withChildren,
+                                                         HighlightSeverity minSeverity) {
+      return Collections.emptyList();
+    }
+
+    public List<DomElementProblemDescriptor> getProblems(DomElement domElement, final boolean withChildren, HighlightSeverity minSeverity) {
+      return Collections.emptyList();
+    }
+
+    public List<DomElementProblemDescriptor> getAllProblems() {
+      return Collections.emptyList();
+    }
+
+    public List<DomElementProblemDescriptor> getAllProblems(@NotNull DomElementsInspection inspection) {
+      return Collections.emptyList();
+    }
+
+    public boolean isInspectionCompleted(@NotNull final DomElementsInspection inspectionClass) {
+      return false;
+    }
+
+  };
+  private final ModificationTracker myModificationTracker;
+  private final Project myProject;
+  private long myModificationCount;
+  
+  public DomElementAnnotationsManagerImpl(Project project) {
+    myProject = project;
+    myModificationTracker = new ModificationTracker() {
+      public long getModificationCount() {
+        return myModificationCount;
+      }
+    };
+    final ProfileChangeAdapter profileChangeAdapter = new ProfileChangeAdapter() {
+      public void profileActivated(Profile oldProfile, Profile profile) {
+        dropAnnotationsCache();
+      }
+
+      public void profileChanged(Profile profile) {
+        dropAnnotationsCache();
+      }
+    };
+
+    final InspectionProfileManager inspectionProfileManager = InspectionProfileManager.getInstance();
+    inspectionProfileManager.addProfileChangeListener(profileChangeAdapter, project);
+    Disposer.register(project, new Disposable() {
+      public void dispose() {
+        inspectionProfileManager.removeProfileChangeListener(profileChangeAdapter);
+      }
+    });
+  }
+
+  public void dropAnnotationsCache() {
+    myModificationCount++;
+  }
+
+  public final List<DomElementProblemDescriptor> appendProblems(@NotNull DomFileElement element, @NotNull DomElementAnnotationHolder annotationHolder, Class<? extends DomElementsInspection> inspectionClass) {
+    final DomElementAnnotationHolderImpl holderImpl = (DomElementAnnotationHolderImpl)annotationHolder;
+    synchronized (LOCK) {
+      final DomElementsProblemsHolderImpl holder = _getOrCreateProblemsHolder(element);
+      holder.appendProblems(holderImpl, inspectionClass);
+    }
+    myDispatcher.getMulticaster().highlightingFinished(element);
+    return Collections.unmodifiableList(holderImpl);
+  }
+
+  private DomElementsProblemsHolderImpl _getOrCreateProblemsHolder(final DomFileElement element) {
+    DomElementsProblemsHolderImpl holder;
+    final DomElement rootElement = element.getRootElement();
+    final XmlTag rootTag = rootElement.getXmlTag();
+    if (rootTag == null) return new DomElementsProblemsHolderImpl(element);
+
+    holder = rootTag.getUserData(DOM_PROBLEM_HOLDER_KEY);
+    if (isHolderOutdated(element.getFile()) || holder == null) {
+      holder = new DomElementsProblemsHolderImpl(element);
+      rootTag.putUserData(DOM_PROBLEM_HOLDER_KEY, holder);
+      final CachedValue<Boolean> cachedValue = CachedValuesManager.getManager(myProject).createCachedValue(new CachedValueProvider<Boolean>() {
+        public Result<Boolean> compute() {
+          return new Result<Boolean>(Boolean.FALSE, element, PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT, myModificationTracker, ProjectRootManager.getInstance(myProject));
+        }
+      }, false);
+      cachedValue.getValue();
+      element.getFile().putUserData(CACHED_VALUE_KEY, cachedValue);
+    }
+    return holder;
+  }
+
+  public static boolean isHolderUpToDate(DomElement element) {
+    synchronized (LOCK) {
+      return !isHolderOutdated(DomUtil.getFile(element));
+    }
+  }
+
+  public static void outdateProblemHolder(final DomElement element) {
+    synchronized (LOCK) {
+      DomUtil.getFile(element).putUserData(CACHED_VALUE_KEY, null);
+    }
+  }
+
+  private static boolean isHolderOutdated(final XmlFile file) {
+    final CachedValue<Boolean> cachedValue = file.getUserData(CACHED_VALUE_KEY);
+    return cachedValue == null || !cachedValue.hasUpToDateValue();
+  }
+
+  @NotNull
+  public DomElementsProblemsHolder getProblemHolder(DomElement element) {
+    if (element == null || !element.isValid()) return EMPTY_PROBLEMS_HOLDER;
+    final DomFileElement<DomElement> fileElement = DomUtil.getFileElement(element);
+
+    synchronized (LOCK) {
+      final XmlTag tag = fileElement.getRootElement().getXmlTag();
+      if (tag != null) {
+        final DomElementsProblemsHolder readyHolder = tag.getUserData(DOM_PROBLEM_HOLDER_KEY);
+        if (readyHolder != null) {
+          return readyHolder;
+        }
+      }
+      return EMPTY_PROBLEMS_HOLDER;
+    }
+  }
+
+  @NotNull
+  public DomElementsProblemsHolder getCachedProblemHolder(DomElement element) {
+    return getProblemHolder(element);
+  }
+
+  public static void annotate(final DomElement element, final DomElementAnnotationHolder holder, final Class rootClass) {
+    final DomElementsAnnotator annotator = DomApplicationComponent.getInstance().getAnnotator(rootClass);
+    if (annotator != null) {
+      annotator.annotate(element, holder);
+    }
+  }
+
+  public List<ProblemDescriptor> createProblemDescriptors(final InspectionManager manager, DomElementProblemDescriptor problemDescriptor) {
+    return ContainerUtil.createMaybeSingletonList(DomElementsHighlightingUtil.createProblemDescriptors(manager, problemDescriptor));
+  }
+
+  public boolean isHighlightingFinished(final DomElement[] domElements) {
+    for (final DomElement domElement : domElements) {
+      if (getHighlightStatus(domElement) != DomHighlightStatus.INSPECTIONS_FINISHED) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  public void addHighlightingListener(DomHighlightingListener listener, Disposable parentDisposable) {
+    myDispatcher.addListener(listener, parentDisposable);
+  }
+
+  public DomHighlightingHelper getHighlightingHelper() {
+    return DomHighlightingHelperImpl.INSTANCE;
+  }
+
+  @NotNull
+  public <T extends DomElement> List<DomElementProblemDescriptor> checkFileElement(@NotNull final DomFileElement<T> domFileElement,
+                                                                                   @NotNull final DomElementsInspection<T> inspection,
+                                                                                   boolean onTheFly) {
+    final DomElementsProblemsHolder problemHolder = getProblemHolder(domFileElement);
+    if (isHolderUpToDate(domFileElement) && problemHolder.isInspectionCompleted(inspection)) {
+      return problemHolder.getAllProblems(inspection);
+    }
+
+    final DomElementAnnotationHolder holder = new DomElementAnnotationHolderImpl(onTheFly);
+    inspection.checkFileElement(domFileElement, holder);
+    return appendProblems(domFileElement, holder, inspection.getClass());
+  }
+
+  public List<DomElementsInspection> getSuitableDomInspections(final DomFileElement fileElement, boolean enabledOnly) {
+    Class rootType = fileElement.getRootElementClass();
+    final InspectionProfile profile = getInspectionProfile(fileElement);
+    final List<DomElementsInspection> inspections = new SmartList<DomElementsInspection>();
+    for (final InspectionProfileEntry profileEntry : profile.getInspectionTools(fileElement.getFile())) {
+      if (!enabledOnly || profile.isToolEnabled(HighlightDisplayKey.find(profileEntry.getShortName()), fileElement.getFile())) {
+        ContainerUtil.addIfNotNull(getSuitableInspection(profileEntry, rootType), inspections);
+      }
+    }
+    return inspections;
+  }
+
+  protected InspectionProfile getInspectionProfile(final DomFileElement fileElement) {
+    return InspectionProjectProfileManager.getInstance(fileElement.getManager().getProject()).getInspectionProfile();
+  }
+
+  @Nullable
+  private static DomElementsInspection getSuitableInspection(InspectionProfileEntry entry, Class rootType) {
+    if (entry instanceof LocalInspectionToolWrapper) {
+      return getSuitableInspection(((LocalInspectionToolWrapper)entry).getTool(), rootType);
+    }
+
+    if (entry instanceof DomElementsInspection) {
+      if (((DomElementsInspection)entry).getDomClasses().contains(rootType)) {
+        return (DomElementsInspection) entry;
+      }
+    }
+    return null;
+  }
+
+  @Nullable public <T extends DomElement>  DomElementsInspection<T> getMockInspection(DomFileElement<T> root) {
+    if (root.getFileDescription().isAutomaticHighlightingEnabled()) {
+      return new MockAnnotatingDomInspection<T>(root.getRootElementClass());
+    }
+    if (getSuitableDomInspections(root, false).isEmpty()) {
+      return new MockDomInspection<T>(root.getRootElementClass());
+    }
+
+    return null;
+  }
+
+  private static boolean areInspectionsFinished(DomElementsProblemsHolderImpl holder, final List<DomElementsInspection> suitableInspections) {
+    for (final DomElementsInspection inspection : suitableInspections) {
+      if (!holder.isInspectionCompleted(inspection)) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  @NotNull
+  public DomHighlightStatus getHighlightStatus(final DomElement element) {
+    synchronized (LOCK) {
+      final DomFileElement<DomElement> root = DomUtil.getFileElement(element);
+      if (!isHolderOutdated(root.getFile())) {
+        final DomElementsProblemsHolder holder = getProblemHolder(element);
+        if (holder instanceof DomElementsProblemsHolderImpl) {
+          DomElementsProblemsHolderImpl holderImpl = (DomElementsProblemsHolderImpl)holder;
+          final List<DomElementsInspection> suitableInspections = getSuitableDomInspections(root, true);
+          final DomElementsInspection mockInspection = getMockInspection(root);
+          final boolean annotatorsFinished = mockInspection == null || holderImpl.isInspectionCompleted(mockInspection);
+          final boolean inspectionsFinished = areInspectionsFinished(holderImpl, suitableInspections);
+          if (annotatorsFinished) {
+            if (suitableInspections.isEmpty() || inspectionsFinished) return DomHighlightStatus.INSPECTIONS_FINISHED;
+            return DomHighlightStatus.ANNOTATORS_FINISHED;
+          }
+        }
+      }
+      return DomHighlightStatus.NONE;
+    }
+
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementProblemDescriptorImpl.java b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementProblemDescriptorImpl.java
new file mode 100644
index 0000000..d6b13e3
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementProblemDescriptorImpl.java
@@ -0,0 +1,232 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.*;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.*;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+public class DomElementProblemDescriptorImpl implements DomElementProblemDescriptor {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.highlighting.DomElementProblemDescriptorImpl");
+  private final DomElement myDomElement;
+  private final HighlightSeverity mySeverity;
+  private final String myMessage;
+  private final LocalQuickFix[] myFixes;
+  private List<Annotation> myAnnotations;
+  private Pair<TextRange, PsiElement> myPair;
+  public static final Pair<TextRange,PsiElement> NO_PROBLEM = new Pair<TextRange, PsiElement>(null, null);
+  private final ProblemHighlightType myHighlightType;
+
+  public DomElementProblemDescriptorImpl(@NotNull final DomElement domElement, final String message, final HighlightSeverity type) {
+    this(domElement, message, type, LocalQuickFix.EMPTY_ARRAY);
+  }
+
+  public DomElementProblemDescriptorImpl(@NotNull final DomElement domElement,
+                                         final String message,
+                                         final HighlightSeverity type,
+                                         @Nullable final TextRange textRange) {
+    this(domElement, message, type, textRange, null, LocalQuickFix.EMPTY_ARRAY);
+  }
+
+  public DomElementProblemDescriptorImpl(@NotNull final DomElement domElement,
+                                         final String message,
+                                         final HighlightSeverity type,
+                                         final LocalQuickFix... fixes) {
+    this(domElement, message, type, null, null, fixes);
+  }
+
+  public DomElementProblemDescriptorImpl(@NotNull final DomElement domElement,
+                                         final String message,
+                                         final HighlightSeverity type,
+                                         @Nullable final TextRange textRange,
+                                         ProblemHighlightType highlightType,
+                                         final LocalQuickFix... fixes) {
+    myDomElement = domElement;
+    final XmlElement element = domElement.getXmlElement();
+    if (element != null && !ApplicationManager.getApplication().isUnitTestMode()) {
+      //LOG.assertTrue(element.isPhysical(), "Problems may not be created for non-physical DOM elements");
+    }
+    mySeverity = type;
+    myMessage = message;
+    myFixes = fixes;
+
+    if (textRange != null) {
+      final PsiElement psiElement = getPsiElement();
+      LOG.assertTrue(psiElement != null, "Problems with explicit text range can't be created for DOM elements without underlying XML element");
+      assert psiElement.isValid();
+      myPair = new Pair<TextRange, PsiElement>(textRange, psiElement);
+    }
+    myHighlightType = highlightType;
+  }
+
+  @NotNull
+  public DomElement getDomElement() {
+    return myDomElement;
+  }
+
+  @NotNull
+  public HighlightSeverity getHighlightSeverity() {
+    return mySeverity;
+  }
+
+  @NotNull
+  public String getDescriptionTemplate() {
+    return myMessage == null ? "" : myMessage;
+  }
+
+  @NotNull
+  public LocalQuickFix[] getFixes() {
+    return myFixes;
+  }
+
+  @NotNull
+  public final List<Annotation> getAnnotations() {
+    if (myAnnotations == null) {
+      myAnnotations = ContainerUtil.createMaybeSingletonList(DomElementsHighlightingUtil.createAnnotation(this));
+    }
+    return myAnnotations;
+  }
+
+  public void highlightWholeElement() {
+    final PsiElement psiElement = getPsiElement();
+    if (psiElement instanceof XmlAttributeValue) {
+      assert psiElement.isValid() : psiElement;
+      final PsiElement attr = psiElement.getParent();
+      myPair = Pair.create(new TextRange(0, attr.getTextLength()), attr);
+    }
+    else if (psiElement != null) {
+      assert psiElement.isValid() : psiElement;
+      final XmlTag tag = (XmlTag)(psiElement instanceof XmlTag ? psiElement : psiElement.getParent());
+      myPair = new Pair<TextRange, PsiElement>(new TextRange(0, tag.getTextLength()), tag);
+    }
+  }
+
+  public Pair<TextRange,PsiElement> getProblemRange() {
+    if (myPair == null) {
+      myPair = computeProblemRange();
+    }
+    PsiElement element = myPair.second;
+    if (element != null) {
+      assert element.isValid();
+    }
+    return myPair;
+  }
+
+  @NotNull
+  protected Pair<TextRange,PsiElement> computeProblemRange() {
+    final PsiElement element = getPsiElement();
+
+    if (element != null) {
+      assert element.isValid() : element;
+      if (element instanceof XmlTag) {
+        return DomUtil.getProblemRange((XmlTag)element);
+      }
+
+      int length = element.getTextRange().getLength();
+      TextRange range = TextRange.from(0, length);
+      if (element instanceof XmlAttributeValue) {
+        final String value = ((XmlAttributeValue)element).getValue();
+        if (StringUtil.isNotEmpty(value)) {
+          range = TextRange.from(element.getText().indexOf(value), value.length());
+        }
+      }
+      return Pair.create(range, element);
+    }
+
+    final XmlTag tag = getParentXmlTag();
+    if (tag != null) {
+      return DomUtil.getProblemRange(tag);
+    }
+    return NO_PROBLEM;
+  }
+
+  public String toString() {
+    return myDomElement + "; " + myMessage;
+  }
+
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    final DomElementProblemDescriptorImpl that = (DomElementProblemDescriptorImpl)o;
+
+    if (myDomElement != null ? !myDomElement.equals(that.myDomElement) : that.myDomElement != null) return false;
+    if (!myMessage.equals(that.myMessage)) return false;
+    if (!mySeverity.equals(that.mySeverity)) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    int result;
+    result = (myDomElement != null ? myDomElement.hashCode() : 0);
+    result = 31 * result + mySeverity.hashCode();
+    result = 31 * result + myMessage.hashCode();
+    return result;
+  }
+
+  @Nullable
+  private PsiElement getPsiElement() {
+    if (myDomElement instanceof DomFileElement) {
+      return ((DomFileElement)myDomElement).getFile();
+    }
+
+    if (myDomElement instanceof GenericAttributeValue) {
+      final GenericAttributeValue attributeValue = (GenericAttributeValue)myDomElement;
+      final XmlAttributeValue value = attributeValue.getXmlAttributeValue();
+      return value != null && StringUtil.isNotEmpty(value.getText()) ? value : attributeValue.getXmlElement();
+    }
+    final XmlTag tag = myDomElement.getXmlTag();
+    if (myDomElement instanceof GenericValue && tag != null) {
+      final XmlText[] textElements = tag.getValue().getTextElements();
+      if (textElements.length > 0) {
+        return textElements[0];
+      }
+    }
+
+    return tag;
+  }
+
+  @Nullable
+  private XmlTag getParentXmlTag() {
+    DomElement parent = myDomElement.getParent();
+    while (parent != null) {
+      if (parent.getXmlTag() != null) return parent.getXmlTag();
+      parent = parent.getParent();
+    }
+    return null;
+  }
+
+  @Nullable
+  public ProblemHighlightType getHighlightType() {
+    return myHighlightType;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementResolveProblemDescriptorImpl.java b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementResolveProblemDescriptorImpl.java
new file mode 100644
index 0000000..6f1f9a2
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementResolveProblemDescriptorImpl.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.util.xml.GenericDomValue;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+*/
+class DomElementResolveProblemDescriptorImpl extends DomElementProblemDescriptorImpl implements DomElementResolveProblemDescriptor {
+  @NotNull private final PsiReference myReference;
+
+  public DomElementResolveProblemDescriptorImpl(@NotNull final GenericDomValue domElement, @NotNull final PsiReference reference, LocalQuickFix... quickFixes) {
+     super(domElement, reference instanceof FileReference ? ProblemsHolder.unresolvedReferenceMessage(reference) : XmlHighlightVisitor.getErrorDescription(reference), HighlightSeverity.ERROR, quickFixes);
+     myReference = reference;
+  }
+
+  @NotNull
+  public PsiReference getPsiReference() {
+    return myReference;
+  }
+
+  @NotNull
+  public GenericDomValue getDomElement() {
+    return (GenericDomValue)super.getDomElement();
+  }
+
+  @NotNull
+  protected Pair<TextRange, PsiElement> computeProblemRange() {
+    final PsiReference reference = myReference;
+    PsiElement element = reference.getElement();
+    if (element instanceof XmlAttributeValue && element.getTextLength() == 0) return NO_PROBLEM;
+
+    final TextRange referenceRange = reference.getRangeInElement();
+    if (referenceRange.isEmpty()) {
+      return element instanceof XmlAttributeValue
+             ? Pair.create(TextRange.from(referenceRange.getStartOffset() - 1, 2), element)
+             : Pair.create(TextRange.from(referenceRange.getStartOffset(), 1), element);
+    }
+    return Pair.create(referenceRange, element);
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementsErrorPanel.java b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementsErrorPanel.java
new file mode 100644
index 0000000..ff02ad0
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementsErrorPanel.java
@@ -0,0 +1,198 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
+import com.intellij.codeInsight.daemon.impl.TrafficLightRenderer;
+import com.intellij.icons.AllIcons;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Disposer;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.util.Alarm;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.DomChangeAdapter;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.ui.CommittablePanel;
+import com.intellij.util.xml.ui.Highlightable;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class DomElementsErrorPanel extends JPanel implements CommittablePanel, Highlightable {
+
+  private static final int ALARM_PERIOD = 241;
+
+  private final Project myProject;
+  private final DomElement[] myDomElements;
+
+  private final DomElementsTrafficLightRenderer myErrorStripeRenderer;
+  private final DomElementAnnotationsManagerImpl myAnnotationsManager;
+
+  private final Alarm myAlarm = new Alarm();
+
+  public DomElementsErrorPanel(final DomElement... domElements) {
+    assert domElements.length > 0;
+
+    myDomElements = domElements;
+    final DomManager domManager = domElements[0].getManager();
+    myProject = domManager.getProject();
+    myAnnotationsManager = (DomElementAnnotationsManagerImpl)DomElementAnnotationsManager.getInstance(myProject);
+
+    setPreferredSize(getDimension());
+
+    myErrorStripeRenderer = new DomElementsTrafficLightRenderer(DomUtil.getFile(domElements[0]));
+    Disposer.register(this, myErrorStripeRenderer);
+
+    addUpdateRequest();
+    domManager.addDomEventListener(new DomChangeAdapter() {
+      protected void elementChanged(DomElement element) {
+        addUpdateRequest();
+      }
+    }, this);
+  }
+
+  public void updateHighlighting() {
+    updatePanel();
+  }
+
+  private boolean areValid() {
+    for (final DomElement domElement : myDomElements) {
+      if (!domElement.isValid()) return false;
+    }
+    return true;
+  }
+
+  private void updatePanel() {
+    myAlarm.cancelAllRequests();
+
+    if (!areValid()) return;
+
+    repaint();
+    setToolTipText(myErrorStripeRenderer.getTooltipMessage());
+
+    if (!isHighlightingFinished()) {
+      addUpdateRequest();
+    }
+  }
+
+  private boolean isHighlightingFinished() {
+    return !areValid() || myAnnotationsManager.isHighlightingFinished(myDomElements);
+  }
+
+  private void addUpdateRequest() {
+    ApplicationManager.getApplication().invokeLater(new Runnable() {
+
+      public void run() {
+        myAlarm.addRequest(new Runnable() {
+          public void run() {
+            if (myProject.isOpen() && !myProject.isDisposed()) {
+              updatePanel();
+            }
+          }
+        }, ALARM_PERIOD);
+      }
+    });
+  }
+
+  protected void paintComponent(Graphics g) {
+    super.paintComponent(g);
+
+    myErrorStripeRenderer.paint(this, g, new Rectangle(0, 0, getWidth(), getHeight()));
+  }
+
+  public void dispose() {
+    myAlarm.cancelAllRequests();
+  }
+
+  public JComponent getComponent() {
+    return this;
+  }
+
+  public void commit() {
+  }
+
+  public void reset() {
+    updatePanel();
+  }
+
+  private static Dimension getDimension() {
+    return new Dimension(AllIcons.General.ErrorsInProgress.getIconWidth() + 2, AllIcons.General.ErrorsInProgress.getIconHeight() + 2);
+  }
+
+  private class DomElementsTrafficLightRenderer extends TrafficLightRenderer {
+
+    public DomElementsTrafficLightRenderer(final PsiFile xmlFile) {
+      super(xmlFile.getProject(),
+            PsiDocumentManager.getInstance(xmlFile.getProject()).getDocument(xmlFile), xmlFile);
+    }
+
+    protected DaemonCodeAnalyzerStatus getDaemonCodeAnalyzerStatus(boolean fillErrorsCount, SeverityRegistrar severityRegistrar) {
+      final DaemonCodeAnalyzerStatus status = super.getDaemonCodeAnalyzerStatus(fillErrorsCount, severityRegistrar);
+      if (status != null && isInspectionCompleted()) {
+        status.errorAnalyzingFinished = true;
+      }
+      return status;
+    }
+
+    @Override
+    protected void fillDaemonCodeAnalyzerErrorsStatus(DaemonCodeAnalyzerStatus status,
+                                                      boolean fillErrorsCount,
+                                                      SeverityRegistrar severityRegistrar) {
+      for (int i = 0; i < status.errorCount.length; i++) {
+        final HighlightSeverity minSeverity = severityRegistrar.getSeverityByIndex(i);
+        if (minSeverity == null) {
+          continue;
+        }
+
+        int sum = 0;
+        for (DomElement element : myDomElements) {
+          final DomElementsProblemsHolder holder = myAnnotationsManager.getCachedProblemHolder(element);
+          sum += (SeverityRegistrar.getInstance(getProject()).compare(minSeverity, HighlightSeverity.WARNING) >= 0 ? holder
+            .getProblems(element, true, true) : holder.getProblems(element, true, minSeverity)).size();
+        }
+        status.errorCount[i] = sum;
+      }
+    }
+
+    protected boolean isInspectionCompleted() {
+      return ContainerUtil.and(myDomElements, new Condition<DomElement>() {
+        public boolean value(final DomElement element) {
+          return myAnnotationsManager.getHighlightStatus(element) == DomHighlightStatus.INSPECTIONS_FINISHED;
+        }
+      });
+    }
+
+    protected boolean isErrorAnalyzingFinished() {
+      return ContainerUtil.and(myDomElements, new Condition<DomElement>() {
+        public boolean value(final DomElement element) {
+          return myAnnotationsManager.getHighlightStatus(element).compareTo(DomHighlightStatus.ANNOTATORS_FINISHED) >= 0;
+        }
+      });
+    }
+
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementsHighlightingUtil.java b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementsHighlightingUtil.java
new file mode 100644
index 0000000..8c2e60b
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementsHighlightingUtil.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInspection.InspectionManager;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.editor.colors.CodeInsightColors;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.util.Function;
+import com.intellij.xml.util.XmlStringUtil;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class DomElementsHighlightingUtil {
+  private DomElementsHighlightingUtil() {
+  }
+
+  @Nullable
+  public static ProblemDescriptor createProblemDescriptors(final InspectionManager manager, final DomElementProblemDescriptor problemDescriptor) {
+    final ProblemHighlightType type = getProblemHighlightType(problemDescriptor);
+    return createProblemDescriptors(problemDescriptor, new Function<Pair<TextRange, PsiElement>, ProblemDescriptor>() {
+      public ProblemDescriptor fun(final Pair<TextRange, PsiElement> s) {
+        return manager
+          .createProblemDescriptor(s.second, s.first, problemDescriptor.getDescriptionTemplate(), type, true, problemDescriptor.getFixes());
+      }
+    });
+  }
+
+  // TODO: move it to DomElementProblemDescriptorImpl
+  private static ProblemHighlightType getProblemHighlightType(final DomElementProblemDescriptor problemDescriptor) {
+    if (problemDescriptor.getHighlightType() != null) {
+      return problemDescriptor.getHighlightType();
+    }
+    if (problemDescriptor instanceof DomElementResolveProblemDescriptor) {
+      final TextRange range = ((DomElementResolveProblemDescriptor)problemDescriptor).getPsiReference().getRangeInElement();
+      if (range.getStartOffset() != range.getEndOffset()) {
+        return ProblemHighlightType.LIKE_UNKNOWN_SYMBOL;
+      }
+    }
+    return ProblemHighlightType.GENERIC_ERROR_OR_WARNING;
+  }
+
+  @Nullable
+  public static Annotation createAnnotation(final DomElementProblemDescriptor problemDescriptor) {
+
+    return createProblemDescriptors(problemDescriptor, new Function<Pair<TextRange, PsiElement>, Annotation>() {
+      public Annotation fun(final Pair<TextRange, PsiElement> s) {
+        String text = problemDescriptor.getDescriptionTemplate();
+        if (StringUtil.isEmpty(text)) text = null;
+        final HighlightSeverity severity = problemDescriptor.getHighlightSeverity();
+
+        TextRange range = s.first;
+        if (text == null) range = TextRange.from(range.getStartOffset(), 0);
+        range = range.shiftRight(s.second.getTextRange().getStartOffset());
+        final Annotation annotation = createAnnotation(severity, range, text);
+
+        if (problemDescriptor instanceof DomElementResolveProblemDescriptor) {
+          annotation.setTextAttributes(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES);
+        }
+
+        for(LocalQuickFix fix:problemDescriptor.getFixes()) {
+          if (fix instanceof IntentionAction) annotation.registerFix((IntentionAction)fix);
+        }
+        return annotation;
+      }
+    });
+  }
+
+  private static Annotation createAnnotation(final HighlightSeverity severity,
+                                             final TextRange range,
+                                             final String text) {
+    String tooltip = text == null ? null : "<html><body>" + XmlStringUtil.escapeString(text) + "</body></html>";
+    return new Annotation(range.getStartOffset(), range.getEndOffset(), severity, text, tooltip);
+  }
+
+  @Nullable
+  private static <T> T createProblemDescriptors(final DomElementProblemDescriptor problemDescriptor,
+                                                      final Function<Pair<TextRange, PsiElement>, T> creator) {
+
+    final Pair<TextRange, PsiElement> range = ((DomElementProblemDescriptorImpl)problemDescriptor).getProblemRange();
+    return range == DomElementProblemDescriptorImpl.NO_PROBLEM ? null : creator.fun(range);
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementsProblemsHolderImpl.java b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementsProblemsHolderImpl.java
new file mode 100644
index 0000000..dfa6f5c
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementsProblemsHolderImpl.java
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Factory;
+import com.intellij.util.Function;
+import com.intellij.util.SmartList;
+import com.intellij.util.containers.ConcurrentHashMap;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomElementVisitor;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.DomUtil;
+import gnu.trove.THashMap;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+public class DomElementsProblemsHolderImpl implements DomElementsProblemsHolder {
+  private final Map<DomElement, Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>>> myCachedErrors =
+    new ConcurrentHashMap<DomElement, Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>>>();
+  private final Map<DomElement, Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>>> myCachedChildrenErrors =
+    new ConcurrentHashMap<DomElement, Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>>>();
+  private final List<Annotation> myAnnotations = new ArrayList<Annotation>();
+
+  private final Function<DomElement, List<DomElementProblemDescriptor>> myDomProblemsGetter =
+    new Function<DomElement, List<DomElementProblemDescriptor>>() {
+      public List<DomElementProblemDescriptor> fun(final DomElement s) {
+        final Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>> map = myCachedErrors.get(s);
+        return map != null ? ContainerUtil.concat(map.values()) : Collections.<DomElementProblemDescriptor>emptyList();
+      }
+    };
+
+  private final DomFileElement myElement;
+
+  private static final Factory<Map<Class<? extends DomElementsInspection>,List<DomElementProblemDescriptor>>> CONCURRENT_HASH_MAP_FACTORY = new Factory<Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>>>() {
+    public Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>> create() {
+      return new ConcurrentHashMap<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>>();
+    }
+  };
+  private static final Factory<List<DomElementProblemDescriptor>> SMART_LIST_FACTORY = new Factory<List<DomElementProblemDescriptor>>() {
+    public List<DomElementProblemDescriptor> create() {
+      return new SmartList<DomElementProblemDescriptor>();
+    }
+  };
+  private final Set<Class<? extends DomElementsInspection>> myPassedInspections = new THashSet<Class<? extends DomElementsInspection>>();
+
+  public DomElementsProblemsHolderImpl(final DomFileElement element) {
+    myElement = element;
+  }
+
+  public final void appendProblems(final DomElementAnnotationHolderImpl holder, final Class<? extends DomElementsInspection> inspectionClass) {
+    if (isInspectionCompleted(inspectionClass)) return;
+
+    for (final DomElementProblemDescriptor descriptor : holder) {
+      addProblem(descriptor, inspectionClass);
+    }
+    myAnnotations.addAll(holder.getAnnotations());
+    myPassedInspections.add(inspectionClass);
+  }
+
+  public final boolean isInspectionCompleted(@NotNull final DomElementsInspection inspection) {
+    return isInspectionCompleted(inspection.getClass());
+  }
+
+  public final boolean isInspectionCompleted(final Class<? extends DomElementsInspection> inspectionClass) {
+    synchronized (DomElementAnnotationsManagerImpl.LOCK) {
+      return myPassedInspections.contains(inspectionClass);
+    }
+  }
+
+  public final List<Annotation> getAnnotations() {
+    return myAnnotations;
+  }
+
+  public final void addProblem(final DomElementProblemDescriptor descriptor, final Class<? extends DomElementsInspection> inspection) {
+    ContainerUtil.getOrCreate(ContainerUtil.getOrCreate(myCachedErrors, descriptor.getDomElement(), CONCURRENT_HASH_MAP_FACTORY), inspection,
+                              SMART_LIST_FACTORY).add(descriptor);
+    myCachedChildrenErrors.clear();
+  }
+
+  @NotNull
+  public synchronized List<DomElementProblemDescriptor> getProblems(DomElement domElement) {
+    if (domElement == null || !domElement.isValid()) return Collections.emptyList();
+    return myDomProblemsGetter.fun(domElement);
+  }
+
+  public List<DomElementProblemDescriptor> getProblems(final DomElement domElement, boolean includeXmlProblems) {
+    return getProblems(domElement);
+  }
+
+  public List<DomElementProblemDescriptor> getProblems(final DomElement domElement,
+                                                       final boolean includeXmlProblems,
+                                                       final boolean withChildren) {
+    if (!withChildren || domElement == null || !domElement.isValid()) {
+      return getProblems(domElement);
+    }
+
+    return ContainerUtil.concat(getProblemsMap(domElement).values());
+  }
+
+  public List<DomElementProblemDescriptor> getProblems(DomElement domElement,
+                                                       final boolean includeXmlProblems,
+                                                       final boolean withChildren,
+                                                       final HighlightSeverity minSeverity) {
+    return getProblems(domElement, withChildren, minSeverity);
+  }
+
+  public List<DomElementProblemDescriptor> getProblems(final DomElement domElement, final boolean withChildren, final HighlightSeverity minSeverity) {
+    return ContainerUtil.findAll(getProblems(domElement, true, withChildren), new Condition<DomElementProblemDescriptor>() {
+      public boolean value(final DomElementProblemDescriptor object) {
+        return SeverityRegistrar.getInstance(domElement.getManager().getProject()).compare(object.getHighlightSeverity(), minSeverity) >= 0;
+      }
+    });
+
+  }
+
+  @NotNull
+  private Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>> getProblemsMap(final DomElement domElement) {
+    final Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>> map = myCachedChildrenErrors.get(domElement);
+    if (map != null) {
+      return map;
+    }
+
+    final Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>> problems = new THashMap<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>>();
+    if (domElement == myElement) {
+      for (Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>> listMap : myCachedErrors.values()) {
+        mergeMaps(problems, listMap);
+      }
+    } else {
+      mergeMaps(problems, myCachedErrors.get(domElement));
+      if (DomUtil.hasXml(domElement)) {
+        domElement.acceptChildren(new DomElementVisitor() {
+          public void visitDomElement(DomElement element) {
+            mergeMaps(problems, getProblemsMap(element));
+          }
+        });
+      }
+    }
+
+    myCachedChildrenErrors.put(domElement, problems);
+    return problems;
+  }
+
+  private static <T> void mergeMaps(final Map<T, List<DomElementProblemDescriptor>> accumulator, @Nullable final Map<T, List<DomElementProblemDescriptor>> toAdd) {
+    if (toAdd == null) return;
+    for (final Map.Entry<T, List<DomElementProblemDescriptor>> entry : toAdd.entrySet()) {
+      ContainerUtil.getOrCreate(accumulator, entry.getKey(), SMART_LIST_FACTORY).addAll(entry.getValue());
+    }
+  }
+
+  public List<DomElementProblemDescriptor> getAllProblems() {
+    return getProblems(myElement, false, true);
+  }
+
+  public List<DomElementProblemDescriptor> getAllProblems(@NotNull DomElementsInspection inspection) {
+    if (!myElement.isValid()) {
+      return Collections.emptyList();
+    }
+    final List<DomElementProblemDescriptor> list = getProblemsMap(myElement).get(inspection.getClass());
+    return list != null ? new ArrayList<DomElementProblemDescriptor>(list) : Collections.<DomElementProblemDescriptor>emptyList();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomHighlightStatus.java b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomHighlightStatus.java
new file mode 100644
index 0000000..fb1cab7
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomHighlightStatus.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.highlighting;
+
+/**
+ * @author peter
+ */
+public enum DomHighlightStatus {
+  NONE,
+  ANNOTATORS_FINISHED,
+  INSPECTIONS_FINISHED
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomHighlightingHelperImpl.java b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomHighlightingHelperImpl.java
new file mode 100644
index 0000000..5e8614d
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomHighlightingHelperImpl.java
@@ -0,0 +1,287 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.ide.IdeBundle;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.ProcessingContext;
+import com.intellij.util.SmartList;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.impl.*;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import com.intellij.util.xml.reflect.DomGenericInfo;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class DomHighlightingHelperImpl extends DomHighlightingHelper {
+  public static final DomHighlightingHelperImpl INSTANCE = new DomHighlightingHelperImpl();
+  private final GenericValueReferenceProvider myProvider = new GenericValueReferenceProvider();
+  private final DomApplicationComponent myDomApplicationComponent = DomApplicationComponent.getInstance();
+
+  public void runAnnotators(DomElement element, DomElementAnnotationHolder holder, Class<? extends DomElement> rootClass) {
+    final DomElementsAnnotator annotator = myDomApplicationComponent.getAnnotator(rootClass);
+    if (annotator != null) {
+      annotator.annotate(element, holder);
+    }
+  }
+
+  @NotNull
+  public List<DomElementProblemDescriptor> checkRequired(final DomElement element, final DomElementAnnotationHolder holder) {
+    final Required required = element.getAnnotation(Required.class);
+    if (required != null) {
+      final XmlElement xmlElement = element.getXmlElement();
+      if (xmlElement == null) {
+        if (required.value()) {
+          final String xmlElementName = element.getXmlElementName();
+          if (element instanceof GenericAttributeValue) {
+            return Arrays.asList(holder.createProblem(element, IdeBundle.message("attribute.0.should.be.defined", xmlElementName)));
+          }
+          return Arrays.asList(
+            holder.createProblem(
+              element,
+              HighlightSeverity.ERROR,
+              IdeBundle.message("child.tag.0.should.be.defined", xmlElementName),
+              new AddRequiredSubtagFix(xmlElementName, element.getXmlElementNamespace(), element.getParent().getXmlTag())
+            )
+          );
+        }
+      }
+      else if (element instanceof GenericDomValue) {
+        return ContainerUtil.createMaybeSingletonList(checkRequiredGenericValue((GenericDomValue)element, required, holder));
+      }
+    }
+    if (DomUtil.hasXml(element)) {
+      final SmartList<DomElementProblemDescriptor> list = new SmartList<DomElementProblemDescriptor>();
+      final DomGenericInfo info = element.getGenericInfo();
+      for (final AbstractDomChildrenDescription description : info.getChildrenDescriptions()) {
+        if (description instanceof DomCollectionChildDescription && description.getValues(element).isEmpty()) {
+          final DomCollectionChildDescription childDescription = (DomCollectionChildDescription)description;
+          final Required annotation = description.getAnnotation(Required.class);
+          if (annotation != null && annotation.value()) {
+            list.add(holder.createProblem(element, childDescription, IdeBundle.message("child.tag.0.should.be.defined", ((DomCollectionChildDescription)description).getXmlElementName())));
+          }
+        }
+      }
+      return list;
+    }
+    return Collections.emptyList();
+  }
+
+  @NotNull
+  public List<DomElementProblemDescriptor> checkResolveProblems(GenericDomValue element, final DomElementAnnotationHolder holder) {
+    if (StringUtil.isEmpty(element.getStringValue())) {
+      final Required required = element.getAnnotation(Required.class);
+      if (required != null && !required.nonEmpty()) return Collections.emptyList();
+    }
+
+    final XmlElement valueElement = DomUtil.getValueElement(element);
+    if (valueElement != null && !isSoftReference(element)) {
+      final SmartList<DomElementProblemDescriptor> list = new SmartList<DomElementProblemDescriptor>();
+      final PsiReference[] psiReferences = myProvider.getReferencesByElement(valueElement, new ProcessingContext());
+      GenericDomValueReference domReference = ContainerUtil.findInstance(psiReferences, GenericDomValueReference.class);
+      final Converter converter = WrappingConverter.getDeepestConverter(element.getConverter(), element);
+      boolean hasBadResolve = false;
+      if (!(domReference != null && isDomResolveOK(element, domReference, converter))) {
+        for (final PsiReference reference : psiReferences) {
+          if (reference != domReference && hasBadResolve(reference)) {
+            hasBadResolve = true;
+            list.add(holder.createResolveProblem(element, reference));
+          }
+        }
+        final boolean isResolvingConverter = converter instanceof ResolvingConverter;
+        if (!hasBadResolve &&
+            (domReference != null || isResolvingConverter &&
+                                     hasBadResolve(domReference = new GenericDomValueReference(element)))) {
+          hasBadResolve = true;
+          final String errorMessage = converter
+            .getErrorMessage(element.getStringValue(), new ConvertContextImpl(DomManagerImpl.getDomInvocationHandler(element)));
+          if (errorMessage != null && XmlHighlightVisitor.getErrorDescription(domReference) != null) {
+            list.add(holder.createResolveProblem(element, domReference));
+          }
+        }
+      }
+      if (!hasBadResolve && psiReferences.length == 0 && element.getValue() == null && !PsiTreeUtil.hasErrorElements(valueElement)) {
+        final String errorMessage = converter
+          .getErrorMessage(element.getStringValue(), new ConvertContextImpl(DomManagerImpl.getDomInvocationHandler(element)));
+        if (errorMessage != null) {
+          list.add(holder.createProblem(element, errorMessage));
+        }
+      }
+      return list;
+    }
+    return Collections.emptyList();
+  }
+
+  private static boolean isDomResolveOK(GenericDomValue element, GenericDomValueReference domReference, Converter converter) {
+    return !hasBadResolve(domReference)
+      || converter instanceof ResolvingConverter && ((ResolvingConverter)converter).getAdditionalVariants(domReference.getConvertContext()).contains(element.getStringValue());
+  }
+
+  @NotNull
+  public List<DomElementProblemDescriptor> checkNameIdentity(DomElement element, final DomElementAnnotationHolder holder) {
+    final String elementName = ElementPresentationManager.getElementName(element);
+    if (StringUtil.isNotEmpty(elementName)) {
+      final DomElement domElement = DomUtil.findDuplicateNamedValue(element, elementName);
+      if (domElement != null) {
+        final String typeName = ElementPresentationManager.getTypeNameForObject(element);
+        final GenericDomValue genericDomValue = domElement.getGenericInfo().getNameDomElement(element);
+        if (genericDomValue != null) {
+          return Arrays.asList(holder.createProblem(genericDomValue, DomUtil.getFile(domElement).equals(DomUtil.getFile(element))
+                                                                     ? IdeBundle.message("model.highlighting.identity", typeName)
+                                                                     : IdeBundle.message("model.highlighting.identity.in.other.file", typeName,
+                                                                                         domElement.getXmlTag().getContainingFile().getName())));
+        }
+      }
+    }
+    return Collections.emptyList();
+  }
+
+  private static boolean hasBadResolve(PsiReference reference) {
+    return XmlHighlightVisitor.hasBadResolve(reference, true);
+  }
+
+  private static boolean isSoftReference(GenericDomValue value) {
+    final Resolve resolve = value.getAnnotation(Resolve.class);
+    if (resolve != null && resolve.soft()) return true;
+
+    final Convert convert = value.getAnnotation(Convert.class);
+    if (convert != null && convert.soft()) return true;
+
+    final Referencing referencing = value.getAnnotation(Referencing.class);
+    return referencing != null && referencing.soft();
+
+  }
+
+  @Nullable
+  private static DomElementProblemDescriptor checkRequiredGenericValue(final GenericDomValue child, final Required required,
+                                                                       final DomElementAnnotationHolder annotator) {
+    final String stringValue = child.getStringValue();
+    if (stringValue == null) return null;
+
+    if (required.nonEmpty() && isEmpty(child, stringValue)) {
+      return annotator.createProblem(child, IdeBundle.message("value.must.not.be.empty"));
+    }
+    if (required.identifier() && !isIdentifier(stringValue)) {
+      return annotator.createProblem(child, IdeBundle.message("value.must.be.identifier"));
+    }
+    return null;
+  }
+
+  private static boolean isIdentifier(final String s) {
+    if (StringUtil.isEmptyOrSpaces(s)) return false;
+
+    if (!Character.isJavaIdentifierStart(s.charAt(0))) return false;
+
+    for (int i = 1; i < s.length(); i++) {
+      if (!Character.isJavaIdentifierPart(s.charAt(i))) return false;
+    }
+
+    return true;
+  }
+
+  private static boolean isEmpty(final GenericDomValue child, final String stringValue) {
+    if (stringValue.trim().length() != 0) {
+      return false;
+    }
+    if (child instanceof GenericAttributeValue) {
+      final XmlAttributeValue value = ((GenericAttributeValue)child).getXmlAttributeValue();
+      if (value != null && value.getTextRange().isEmpty()) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+
+  private static class AddRequiredSubtagFix implements LocalQuickFix, IntentionAction {
+    private final String tagName;
+    private final String tagNamespace;
+    private final XmlTag parentTag;
+
+    public AddRequiredSubtagFix(@NotNull String _tagName, @NotNull String _tagNamespace, @NotNull XmlTag _parentTag) {
+      tagName = _tagName;
+      tagNamespace = _tagNamespace;
+      parentTag = _parentTag;
+    }
+
+    @NotNull
+    public String getName() {
+      return XmlBundle.message("insert.required.tag.fix", tagName);
+    }
+
+    @NotNull
+    public String getText() {
+      return getName();
+    }
+
+    @NotNull
+    public String getFamilyName() {
+      return getName();
+    }
+
+    public boolean isAvailable(@NotNull final Project project, final Editor editor, final PsiFile file) {
+      return true;
+    }
+
+    public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
+      doFix();
+    }
+
+    public boolean startInWriteAction() {
+      return true;
+    }
+
+    public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
+      doFix();
+    }
+
+    private void doFix() {
+      if (!CodeInsightUtilBase.prepareFileForWrite(parentTag.getContainingFile())) return;
+
+      try {
+        parentTag.add(parentTag.createChildTag(tagName, tagNamespace, null, false));
+      }
+      catch (IncorrectOperationException e) {
+        throw new RuntimeException(e);
+      }
+    }
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/highlighting/MockAnnotatingDomInspection.java b/xml/dom-impl/src/com/intellij/util/xml/highlighting/MockAnnotatingDomInspection.java
new file mode 100644
index 0000000..0f98632
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/highlighting/MockAnnotatingDomInspection.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.util.xml.DomElement;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.NonNls;
+
+/**
+ * @author peter
+ */
+public class MockAnnotatingDomInspection<T extends DomElement> extends BasicDomElementsInspection<T>{
+
+  public MockAnnotatingDomInspection(final Class<T> domClass) {
+    super(domClass);
+  }
+
+  protected void checkDomElement(DomElement element, DomElementAnnotationHolder holder, DomHighlightingHelper helper) {
+    for (final Class aClass : getDomClasses()) {
+      helper.runAnnotators(element, holder, aClass);
+    }
+  }
+
+  @Nls
+  @NotNull
+  public String getGroupDisplayName() {
+    throw new UnsupportedOperationException("Method getGroupDisplayName is not yet implemented in " + getClass().getName());
+  }
+
+  @Nls
+  @NotNull
+  public String getDisplayName() {
+    throw new UnsupportedOperationException("Method getDisplayName is not yet implemented in " + getClass().getName());
+  }
+
+  @NonNls
+  @NotNull
+  public String getShortName() {
+    throw new UnsupportedOperationException("Method getShortName is not yet implemented in " + getClass().getName());
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/highlighting/MockDomInspection.java b/xml/dom-impl/src/com/intellij/util/xml/highlighting/MockDomInspection.java
new file mode 100644
index 0000000..85460928
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/highlighting/MockDomInspection.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.highlighting;
+
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.NonNls;
+import com.intellij.util.xml.DomElement;
+
+/**
+ * @author peter
+ */
+public class MockDomInspection<T extends DomElement> extends BasicDomElementsInspection<T>{
+
+  public MockDomInspection(final Class<T> domClass) {
+    super(domClass);
+  }
+
+  @Nls
+  @NotNull
+  public String getGroupDisplayName() {
+    throw new UnsupportedOperationException("Method getGroupDisplayName is not yet implemented in " + getClass().getName());
+  }
+
+  @Nls
+  @NotNull
+  public String getDisplayName() {
+    throw new UnsupportedOperationException("Method getDisplayName is not yet implemented in " + getClass().getName());
+  }
+
+  @NonNls
+  @NotNull
+  public String getShortName() {
+    throw new UnsupportedOperationException("Method getShortName is not yet implemented in " + getClass().getName());
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/AbstractCollectionChildDescription.java b/xml/dom-impl/src/com/intellij/util/xml/impl/AbstractCollectionChildDescription.java
new file mode 100644
index 0000000..e409a70
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/AbstractCollectionChildDescription.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import com.intellij.util.xml.EvaluatedXmlName;
+
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public interface AbstractCollectionChildDescription extends AbstractDomChildrenDescription {
+  List<XmlTag> getSubTags(DomInvocationHandler handler, final XmlTag[] subTags, final XmlFile file);
+  EvaluatedXmlName createEvaluatedXmlName(DomInvocationHandler parent, XmlTag childTag);
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/AbstractDomChildDescriptionImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/AbstractDomChildDescriptionImpl.java
new file mode 100644
index 0000000..20a9702
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/AbstractDomChildDescriptionImpl.java
@@ -0,0 +1,207 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.ide.presentation.Presentation;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Factory;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.NotNullLazyValue;
+import com.intellij.openapi.util.NullableLazyValue;
+import com.intellij.pom.references.PomService;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.SmartPsiElementPointer;
+import com.intellij.util.xml.Stubbed;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import com.intellij.util.xml.reflect.DomExtensionImpl;
+import gnu.trove.THashMap;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author peter
+ */
+public abstract class AbstractDomChildDescriptionImpl implements AbstractDomChildrenDescription, Comparable<AbstractDomChildDescriptionImpl> {
+  private final Type myType;
+  private Map<Class, Annotation> myCustomAnnotations;
+  @Nullable private Map myUserMap;
+  private final NullableLazyValue<ElementPresentationTemplate> myPresentationTemplate = new NullableLazyValue<ElementPresentationTemplate>() {
+    @Override
+    protected ElementPresentationTemplate compute() {
+      Class clazz = ReflectionUtil.getRawType(getType());
+      Presentation presentation = DomApplicationComponent.getInstance().getInvocationCache(clazz).getClassAnnotation(Presentation.class);
+      return presentation == null ? null : new ElementPresentationTemplateImpl(presentation, clazz);
+    }
+  };
+
+  protected AbstractDomChildDescriptionImpl(final Type type) {
+    myType = type;
+  }
+
+  public final void addCustomAnnotation(@NotNull Annotation annotation) {
+    if (myCustomAnnotations == null) myCustomAnnotations = new THashMap<Class, Annotation>();
+    myCustomAnnotations.put(annotation.annotationType(), annotation);
+  }
+
+  private NotNullLazyValue<Boolean> myStubbed = new NotNullLazyValue<Boolean>() {
+    @NotNull
+    @Override
+    protected Boolean compute() {
+      return myType instanceof Class && DomReflectionUtil.findAnnotationDFS((Class)myType, Stubbed.class) != null ||
+             getAnnotation(Stubbed.class) != null;
+    }
+  };
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    AbstractDomChildDescriptionImpl that = (AbstractDomChildDescriptionImpl)o;
+
+    if (myCustomAnnotations != null ? !myCustomAnnotations.equals(that.myCustomAnnotations) : that.myCustomAnnotations != null)
+      return false;
+    if (!getType().equals(that.getType())) return false;
+    if (myUserMap != null ? !myUserMap.equals(that.myUserMap) : that.myUserMap != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = getType().hashCode();
+    result = 31 * result + (myCustomAnnotations != null ? myCustomAnnotations.hashCode() : 0);
+    result = 31 * result + (myUserMap != null ? myUserMap.hashCode() : 0);
+    return result;
+  }
+
+  public void setUserMap(final Map userMap) {
+    myUserMap = userMap;
+  }
+
+  @Nullable
+  public <T extends Annotation> T getAnnotation(final Class<T> annotationClass) {
+    return myCustomAnnotations == null ? null : (T)myCustomAnnotations.get(annotationClass);
+  }
+
+  public <T> T getUserData(final Key<T> key) {
+    return myUserMap == null ? null : (T)myUserMap.get(key);
+  }
+
+  @NotNull
+  public final List<? extends DomElement> getStableValues(@NotNull final DomElement parent) {
+    final List<? extends DomElement> list = getValues(parent);
+    final ArrayList<DomElement> result = new ArrayList<DomElement>(list.size());
+    final DomManager domManager = parent.getManager();
+    for (int i = 0; i < list.size(); i++) {
+      final int i1 = i;
+      result.add(domManager.createStableValue(new Factory<DomElement>() {
+        @Nullable
+        public DomElement create() {
+          if (!parent.isValid()) return null;
+
+          final List<? extends DomElement> domElements = getValues(parent);
+          return domElements.size() > i1 ? domElements.get(i1) : null;
+        }
+      }));
+    }
+    return result;
+  }
+
+
+  @NotNull
+  public final Type getType() {
+    return myType;
+  }
+
+  @NotNull
+  public DomNameStrategy getDomNameStrategy(@NotNull DomElement parent) {
+    final DomNameStrategy strategy = DomImplUtil.getDomNameStrategy(ReflectionUtil.getRawType(getType()), false);
+    return strategy == null ? parent.getNameStrategy() : strategy;
+  }
+
+  @Override
+  public boolean isValid() {
+    return true;
+  }
+
+  @Override
+  public void navigate(boolean requestFocus) {
+  }
+
+  @Override
+  public boolean canNavigate() {
+    return false;
+  }
+
+  @Override
+  public boolean canNavigateToSource() {
+    return false;
+  }
+
+  @Override
+  @Nullable
+  public ElementPresentationTemplate getPresentationTemplate() {
+    return myPresentationTemplate.getValue();
+  }
+
+  @Nullable
+  public PsiElement getDeclaration(final Project project) {
+    DomElement domDeclaration = getDomDeclaration();
+    if (domDeclaration != null) {
+      final DomTarget target = DomTarget.getTarget(domDeclaration);
+      if (target != null) {
+        return PomService.convertToPsi(target);
+      }
+      return domDeclaration.getXmlElement();
+    }
+    final DomAnchor anchor = getUserData(DomExtensionImpl.KEY_DOM_DECLARATION);
+    if (anchor != null) {
+      return anchor.getContainingFile();
+    }
+    final SmartPsiElementPointer<?> pointer = getUserData(DomExtensionImpl.DECLARING_ELEMENT_KEY);
+    if (pointer != null) {
+      final PsiElement element = pointer.getElement();
+      if (element != null) {
+        return element;
+      }
+    }
+
+    return PomService.convertToPsi(project, this);
+  }
+
+  @Override
+  public DomElement getDomDeclaration() {
+    final DomAnchor anchor = getUserData(DomExtensionImpl.KEY_DOM_DECLARATION);
+    if (anchor != null) {
+      return anchor.retrieveDomElement();
+    }
+    return null;
+  }
+
+  @Override
+  public boolean isStubbed() {
+    return myStubbed.getValue();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/AddChildInvocation.java b/xml/dom-impl/src/com/intellij/util/xml/impl/AddChildInvocation.java
new file mode 100644
index 0000000..1fbd101
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/AddChildInvocation.java
@@ -0,0 +1,29 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.util.Function;
+
+import java.lang.reflect.Type;
+
+/**
+ * @author peter
+ */
+public class AddChildInvocation implements Invocation{
+  private final CollectionChildDescriptionImpl myDescription;
+  private final Type myType;
+  private final Function<Object[],Integer> myIndexGetter;
+  private final Function<Object[], Type> myClassGetter;
+
+  public AddChildInvocation(final Function<Object[], Type> classGetter,
+                            final Function<Object[], Integer> indexGetter,
+                            final CollectionChildDescriptionImpl tagName,
+                            final Type type) {
+    myClassGetter = classGetter;
+    myIndexGetter = indexGetter;
+    myDescription = tagName;
+    myType = type;
+  }
+
+  public Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+    return handler.addCollectionChild(myDescription, myClassGetter.fun(args), myIndexGetter.fun(args));
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/AddToCompositeCollectionInvocation.java b/xml/dom-impl/src/com/intellij/util/xml/impl/AddToCompositeCollectionInvocation.java
new file mode 100644
index 0000000..da04e8e
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/AddToCompositeCollectionInvocation.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.EvaluatedXmlName;
+
+import java.lang.reflect.Type;
+import java.util.Set;
+
+/**
+ * @author peter
+*/
+class AddToCompositeCollectionInvocation implements Invocation {
+  private final CollectionChildDescriptionImpl myMainDescription;
+  private final Set<CollectionChildDescriptionImpl> myQnames;
+  private final Type myType;
+
+  public AddToCompositeCollectionInvocation(final CollectionChildDescriptionImpl tagName, final Set<CollectionChildDescriptionImpl> qnames, final Type type) {
+    myMainDescription = tagName;
+    myQnames = qnames;
+    myType = type;
+  }
+
+  public Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+    Set<XmlTag> set = ContainerUtil.newTroveSet();
+    for (final CollectionChildDescriptionImpl qname : myQnames) {
+      set.addAll(qname.getTagsGetter().fun(handler));
+    }
+
+    final XmlTag tag = handler.ensureTagExists();
+    int index = args != null && args.length == 1 ? (Integer)args[0] : Integer.MAX_VALUE;
+
+    XmlTag lastTag = null;
+    int i = 0;
+    final XmlTag[] tags = tag.getSubTags();
+    for (final XmlTag subTag : tags) {
+      if (i == index) break;
+      if (set.contains(subTag)) {
+        lastTag = subTag;
+        i++;
+      }
+    }
+    final DomManagerImpl manager = handler.getManager();
+    final boolean b = manager.setChanging(true);
+    try {
+      final EvaluatedXmlName evaluatedXmlName = handler.createEvaluatedXmlName(myMainDescription.getXmlName());
+      final XmlTag emptyTag = handler.createChildTag(evaluatedXmlName);
+      final XmlTag newTag;
+      if (lastTag == null) {
+        if (tags.length == 0) {
+          newTag = (XmlTag)tag.add(emptyTag);
+        }
+        else {
+          newTag = (XmlTag)tag.addBefore(emptyTag, tags[0]);
+        }
+      }
+      else {
+        newTag = (XmlTag)tag.addAfter(emptyTag, lastTag);
+      }
+
+      return new CollectionElementInvocationHandler(myType, newTag, myMainDescription, handler, null).getProxy();
+    }
+    finally {
+      manager.setChanging(b);
+    }
+  }
+
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/AttributeChildDescriptionImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/AttributeChildDescriptionImpl.java
new file mode 100644
index 0000000..cdba461
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/AttributeChildDescriptionImpl.java
@@ -0,0 +1,92 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.reflect.DomAttributeChildDescription;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class AttributeChildDescriptionImpl extends DomChildDescriptionImpl implements DomAttributeChildDescription<Void> {
+  private final JavaMethod myGetterMethod;
+
+  protected AttributeChildDescriptionImpl(final XmlName attributeName, @NotNull final JavaMethod getter) {
+    super(attributeName, getter.getGenericReturnType());
+    myGetterMethod = getter;
+  }
+
+  public AttributeChildDescriptionImpl(final XmlName attributeName, @NotNull Type type) {
+    super(attributeName, type);
+    myGetterMethod = null;
+  }
+
+  @NotNull
+  public DomNameStrategy getDomNameStrategy(@NotNull DomElement parent) {
+    final DomNameStrategy strategy = DomImplUtil.getDomNameStrategy(ReflectionUtil.getRawType(getType()), true);
+    return strategy == null ? parent.getNameStrategy() : strategy;
+  }
+
+
+  public final JavaMethod getGetterMethod() {
+    return myGetterMethod;
+  }
+
+  @Override
+  public String toString() {
+    return "Attribute:" + getXmlName();
+  }
+
+  @Nullable
+  public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+    final JavaMethod method = getGetterMethod();
+    return method == null ? super.getAnnotation(annotationClass) : method.getAnnotation(annotationClass);
+  }
+
+  @NotNull
+  public List<? extends DomElement> getValues(@NotNull DomElement parent) {
+    return Arrays.asList(getDomAttributeValue(parent));
+  }
+
+  @NotNull
+  public String getCommonPresentableName(@NotNull DomNameStrategy strategy) {
+    throw new UnsupportedOperationException("Method getCommonPresentableName is not yet implemented in " + getClass().getName());
+  }
+
+  public GenericAttributeValue getDomAttributeValue(DomElement parent) {
+    final DomInvocationHandler handler = DomManagerImpl.getDomInvocationHandler(parent);
+    if (handler != null) {
+      return getDomAttributeValue(handler);
+    }
+    return (GenericAttributeValue)myGetterMethod.invoke(parent, ArrayUtil.EMPTY_OBJECT_ARRAY);
+  }
+
+  public GenericAttributeValue getDomAttributeValue(final DomInvocationHandler handler) {
+    return (GenericAttributeValue)handler.getAttributeChild(this).getProxy();
+  }
+
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+    if (!super.equals(o)) return false;
+
+    final AttributeChildDescriptionImpl that = (AttributeChildDescriptionImpl)o;
+
+    if (myGetterMethod != null ? !myGetterMethod.equals(that.myGetterMethod) : that.myGetterMethod != null) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 29 * result + (myGetterMethod != null ? myGetterMethod.hashCode() : 0);
+    return result;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/AttributeChildInvocationHandler.java b/xml/dom-impl/src/com/intellij/util/xml/impl/AttributeChildInvocationHandler.java
new file mode 100644
index 0000000..e25a797
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/AttributeChildInvocationHandler.java
@@ -0,0 +1,174 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.Factory;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomElementVisitor;
+import com.intellij.util.xml.EvaluatedXmlName;
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.events.DomEvent;
+import com.intellij.util.xml.stubs.AttributeStub;
+import com.intellij.xml.util.XmlStringUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public class AttributeChildInvocationHandler extends DomInvocationHandler<AttributeChildDescriptionImpl, AttributeStub> {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.impl.AttributeChildInvocationHandler");
+
+  protected AttributeChildInvocationHandler(final EvaluatedXmlName attributeName,
+                                            final AttributeChildDescriptionImpl description,
+                                            final DomManagerImpl manager,
+                                            final DomParentStrategy strategy,
+                                            @Nullable AttributeStub stub) {
+    super(description.getType(), strategy, attributeName, description, manager, false, stub);
+  }
+
+  public void acceptChildren(DomElementVisitor visitor) {
+  }
+
+  protected final XmlTag setEmptyXmlTag() {
+    return ensureTagExists();
+  }
+
+  protected boolean isAttribute() {
+    return true;
+  }
+
+  protected XmlElement recomputeXmlElement(@NotNull final DomInvocationHandler parent) {
+    if (!parent.isValid()) return null;
+
+    final XmlTag tag = parent.getXmlTag();
+    if (tag == null) return null;
+
+    return tag.getAttribute(getXmlElementName(), getXmlApiCompatibleNamespace(parent));
+  }
+
+  @Nullable
+  private String getXmlApiCompatibleNamespace(DomInvocationHandler parent) {
+    final XmlTag tag = parent.getXmlTag();
+    if (tag == null) {
+      return null;
+    }
+
+    String ns = getXmlName().getNamespace(tag, parent.getFile());
+    // TODO: this seems ugly
+    return tag.getNamespace().equals(ns) ? null : ns;
+  }
+
+  public final XmlAttribute ensureXmlElementExists() {
+    XmlAttribute attribute = (XmlAttribute)getXmlElement();
+    if (attribute != null) return attribute;
+
+    final DomManagerImpl manager = getManager();
+    final boolean b = manager.setChanging(true);
+    try {
+      attribute = ensureTagExists().setAttribute(getXmlElementName(), getXmlApiCompatibleNamespace(getParentHandler()), "");
+      setXmlElement(attribute);
+      getManager().cacheHandler(DomManagerImpl.DOM_ATTRIBUTE_HANDLER_KEY, attribute, this);
+      final DomElement element = getProxy();
+      manager.fireEvent(new DomEvent(element, true));
+      return attribute;
+    }
+    catch (IncorrectOperationException e) {
+      LOG.error(e);
+      return null;
+    }
+    finally {
+      manager.setChanging(b);
+    }
+  }
+
+  public <T extends DomElement> T createStableCopy() {
+    final DomElement parentCopy = getParent().createStableCopy();
+    return getManager().createStableValue(new Factory<T>() {
+      public T create() {
+        return parentCopy.isValid() ? (T) getChildDescription().getValues(parentCopy).get(0) : null;
+      }
+    });
+  }
+
+  public final void undefineInternal() {
+    final XmlTag tag = getXmlTag();
+    if (tag != null) {
+      getManager().runChange(new Runnable() {
+        public void run() {
+          try {
+            setXmlElement(null);
+            tag.setAttribute(getXmlElementName(), getXmlApiCompatibleNamespace(getParentHandler()), null);
+          }
+          catch (IncorrectOperationException e) {
+            LOG.error(e);
+          }
+        }
+      });
+      fireUndefinedEvent();
+    }
+  }
+
+  @Nullable
+  public final XmlTag getXmlTag() {
+    final DomInvocationHandler handler = getParentHandler();
+    return handler == null ? null : handler.getXmlTag();
+  }
+
+  public final XmlTag ensureTagExists() {
+    final DomInvocationHandler parent = getParentHandler();
+    assert parent != null : "write operations should be performed on the DOM having a parent, your DOM may be not very fresh";
+    return parent.ensureTagExists();
+  }
+
+  @Nullable
+  protected String getValue() {
+    if (myStub != null) {
+      return myStub.getValue();
+    }
+    final XmlAttribute attribute = (XmlAttribute)getXmlElement();
+    if (attribute != null) {
+      final XmlAttributeValue value = attribute.getValueElement();
+      if (value != null && value.getTextLength() >= 2) {
+        return attribute.getDisplayValue();
+      }
+    }
+    return null;
+  }
+
+  public void copyFrom(final DomElement other) {
+    setValue(((GenericAttributeValue) other).getStringValue());
+  }
+
+  protected void setValue(@Nullable final String value) {
+    final XmlTag tag = ensureTagExists();
+    final String attributeName = getXmlElementName();
+    final String namespace = getXmlApiCompatibleNamespace(getParentHandler());
+    final String oldValue = StringUtil.unescapeXml(tag.getAttributeValue(attributeName, namespace));
+    final String newValue = XmlStringUtil.escapeString(value);
+    if (Comparing.equal(oldValue, newValue, true)) return;
+
+    getManager().runChange(new Runnable() {
+      public void run() {
+        try {
+          XmlAttribute attribute = tag.setAttribute(attributeName, namespace, newValue);
+          setXmlElement(attribute);
+          getManager().cacheHandler(DomManagerImpl.DOM_ATTRIBUTE_HANDLER_KEY, attribute, AttributeChildInvocationHandler.this);
+        }
+        catch (IncorrectOperationException e) {
+          LOG.error(e);
+        }
+      }
+    });
+    final DomElement proxy = getProxy();
+    final DomElement element = proxy;
+    getManager().fireEvent(oldValue != null ? new DomEvent(proxy, false) : new DomEvent(element, true));
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/ChildrenDescriptionsHolder.java b/xml/dom-impl/src/com/intellij/util/xml/impl/ChildrenDescriptionsHolder.java
new file mode 100644
index 0000000..259d7d7
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/ChildrenDescriptionsHolder.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.util.xml.XmlName;
+import gnu.trove.THashMap;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+/**
+ * @author peter
+ */
+public class ChildrenDescriptionsHolder<T extends DomChildDescriptionImpl> {
+  private final Map<XmlName, T> myMap = new THashMap<XmlName, T>();
+  private final ChildrenDescriptionsHolder<T> myDelegate;
+  private volatile List<T> myCached = null;
+
+  public ChildrenDescriptionsHolder(@Nullable final ChildrenDescriptionsHolder<T> delegate) {
+    myDelegate = delegate;
+  }
+
+  public ChildrenDescriptionsHolder() {
+    this(null);
+  }
+
+  final T addDescription(@NotNull T t) {
+    myMap.put(t.getXmlName(), t);
+    myCached = null;
+    return t;
+  }
+
+  final void addDescriptions(@NotNull Collection<T> collection) {
+    for (final T t : collection) {
+      addDescription(t);
+    }
+  }
+
+  @Nullable
+  final T getDescription(final XmlName name) {
+    final T t = myMap.get(name);
+    if (t != null) return t;
+    return myDelegate != null ? myDelegate.getDescription(name) : null;
+  }
+
+  @Nullable
+  final T getDescription(@NotNull final String localName, String namespaceKey) {
+    return getDescription(new XmlName(localName, namespaceKey));
+  }
+
+  @Nullable
+  final T findDescription(@NotNull final String localName) {
+    for (final XmlName xmlName : myMap.keySet()) {
+      if (xmlName.getLocalName().equals(localName)) return myMap.get(xmlName);
+    }
+    return myDelegate != null ? myDelegate.findDescription(localName) : null;
+  }
+
+  @NotNull
+  final List<T> getDescriptions() {
+    final ArrayList<T> result = new ArrayList<T>();
+    dumpDescriptions(result);
+    return result;
+  }
+
+  private List<T> getSortedDescriptions() {
+    List<T> cached = myCached;
+    if (cached != null) {
+      return cached;
+    }
+
+    cached = new ArrayList<T>(myMap.values());
+    Collections.sort(cached);
+    myCached = cached;
+    return cached;
+  }
+
+
+  final void dumpDescriptions(Collection<? super T> to) {
+    to.addAll(getSortedDescriptions());
+    if (myDelegate != null) {
+      myDelegate.dumpDescriptions(to);
+    }
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (!(o instanceof ChildrenDescriptionsHolder)) return false;
+
+    ChildrenDescriptionsHolder holder = (ChildrenDescriptionsHolder)o;
+
+    if (myDelegate != null ? !myDelegate.equals(holder.myDelegate) : holder.myDelegate != null) return false;
+    if (!myMap.equals(holder.myMap)) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = myMap.hashCode();
+    result = 31 * result + (myDelegate != null ? myDelegate.hashCode() : 0);
+    return result;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/CollectionChildDescriptionImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/CollectionChildDescriptionImpl.java
new file mode 100644
index 0000000..022bbc4
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/CollectionChildDescriptionImpl.java
@@ -0,0 +1,132 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.Function;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.NotNullFunction;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Type;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class CollectionChildDescriptionImpl extends DomChildDescriptionImpl implements DomCollectionChildDescription, AbstractCollectionChildDescription {
+  private final Collection<JavaMethod> myGetterMethods;
+  private final NotNullFunction<DomInvocationHandler, List<XmlTag>> myTagsGetter = new NotNullFunction<DomInvocationHandler, List<XmlTag>>() {
+    @NotNull
+    public List<XmlTag> fun(final DomInvocationHandler handler) {
+      XmlTag tag = handler.getXmlTag();
+      if (tag == null) {
+        return Collections.emptyList();
+      }
+      return DomImplUtil.findSubTags(tag, handler.createEvaluatedXmlName(getXmlName()), handler.getFile());
+    }
+  };
+
+  public CollectionChildDescriptionImpl(final XmlName tagName, final Type type, final Collection<JavaMethod> getterMethods) {
+    super(tagName, type);
+    myGetterMethods = getterMethods;
+  }
+
+  @Override
+  public String toString() {
+    return "CollectionChildDescription:" + getXmlName();
+  }
+
+  public NotNullFunction<DomInvocationHandler, List<XmlTag>> getTagsGetter() {
+    return myTagsGetter;
+  }
+
+  public DomElement addValue(@NotNull DomElement element) {
+    assert element.getGenericInfo().getCollectionChildrenDescriptions().contains(this);
+    return addChild(element, getType(), Integer.MAX_VALUE);
+  }
+
+  private DomElement addChild(final DomElement element, final Type type, final int index) {
+    try {
+      final DomInvocationHandler handler = DomManagerImpl.getDomInvocationHandler(element);
+      assert handler != null;
+      return handler.addCollectionChild(this, type, index);
+    }
+    catch (IncorrectOperationException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  public DomElement addValue(@NotNull DomElement element, int index) {
+    return addChild(element, getType(), index);
+  }
+
+  public DomElement addValue(@NotNull DomElement parent, Type type) {
+    return addValue(parent, type, Integer.MAX_VALUE);
+  }
+
+  public final DomElement addValue(@NotNull DomElement parent, Type type, int index) {
+    return addChild(parent, type, index);
+  }
+
+  @Nullable
+  public final JavaMethod getGetterMethod() {
+    final Collection<JavaMethod> methods = myGetterMethods;
+    return methods.isEmpty() ? null : methods.iterator().next();
+  }
+
+  @NotNull
+  public List<? extends DomElement> getValues(@NotNull final DomElement element) {
+    final DomInvocationHandler handler = DomManagerImpl.getDomInvocationHandler(element);
+    if (handler != null) {
+      return handler.getCollectionChildren(this, myTagsGetter);
+    }
+    final JavaMethod getterMethod = getGetterMethod();
+    if (getterMethod == null) {
+      final Collection<DomElement> collection = ModelMergerUtil.getFilteredImplementations(element);
+      return ContainerUtil.concat(collection, new Function<DomElement, Collection<? extends DomElement>>() {
+        public Collection<? extends DomElement> fun(final DomElement domElement) {
+          final DomInvocationHandler handler = DomManagerImpl.getDomInvocationHandler(domElement);
+          assert handler != null : domElement;
+          return handler.getCollectionChildren(CollectionChildDescriptionImpl.this, myTagsGetter);
+        }
+      });
+    }
+    return (List<? extends DomElement>)getterMethod.invoke(element, ArrayUtil.EMPTY_OBJECT_ARRAY);
+  }
+
+  @NotNull
+  public String getCommonPresentableName(@NotNull DomNameStrategy strategy) {
+    String words = strategy.splitIntoWords(getXmlElementName());
+    return StringUtil.capitalizeWords(words.endsWith("es") ? words: StringUtil.pluralize(words), true);
+  }
+
+  @Nullable
+  public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+    final JavaMethod method = getGetterMethod();
+    if (method != null) {
+      final T annotation = method.getAnnotation(annotationClass);
+      if (annotation != null) return annotation;
+    }
+
+    final Type elemType = getType();
+    return elemType instanceof AnnotatedElement ? ((AnnotatedElement)elemType).getAnnotation(annotationClass) : super.getAnnotation(annotationClass);
+  }
+
+  public List<XmlTag> getSubTags(final DomInvocationHandler handler, final XmlTag[] subTags, final XmlFile file) {
+    return DomImplUtil.findSubTags(subTags, handler.createEvaluatedXmlName(getXmlName()), file);
+  }
+
+  public EvaluatedXmlName createEvaluatedXmlName(final DomInvocationHandler parent, final XmlTag childTag) {
+    return parent.createEvaluatedXmlName(getXmlName());
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/CollectionElementInvocationHandler.java b/xml/dom-impl/src/com/intellij/util/xml/impl/CollectionElementInvocationHandler.java
new file mode 100644
index 0000000..1210474
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/CollectionElementInvocationHandler.java
@@ -0,0 +1,101 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.util.Factory;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.EvaluatedXmlName;
+import com.intellij.util.xml.events.DomEvent;
+import com.intellij.util.xml.stubs.ElementStub;
+import com.intellij.util.xml.stubs.StubParentStrategy;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.Type;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class CollectionElementInvocationHandler extends DomInvocationHandler<AbstractDomChildDescriptionImpl, ElementStub>{
+
+  public CollectionElementInvocationHandler(final Type type, @NotNull final XmlTag tag,
+                                            final AbstractCollectionChildDescription description,
+                                            final DomInvocationHandler parent,
+                                            @Nullable ElementStub stub) {
+    super(type, new PhysicalDomParentStrategy(tag, parent.getManager()), description.createEvaluatedXmlName(parent, tag),
+          (AbstractDomChildDescriptionImpl)description, parent.getManager(), true, stub);
+  }
+
+  public CollectionElementInvocationHandler(@NotNull EvaluatedXmlName tagName,
+                                            AbstractDomChildDescriptionImpl childDescription,
+                                            DomManagerImpl manager,
+                                            ElementStub stub) {
+    super(childDescription.getType(), new StubParentStrategy(stub), tagName, childDescription, manager, true, stub);
+
+  }
+
+  protected Type narrowType(@NotNull final Type nominalType) {
+    return getStub() == null ? getManager().getTypeChooserManager().getTypeChooser(nominalType).chooseType(getXmlTag()) : nominalType;
+  }
+
+  protected final XmlTag setEmptyXmlTag() {
+    throw new UnsupportedOperationException("CollectionElementInvocationHandler.setXmlTag() shouldn't be called;" +
+                                            "\nparent=" + getParent() + ";\n" +
+                                            "xmlElementName=" + getXmlElementName());
+  }
+
+  @Override
+  protected String checkValidity() {
+    final String s = super.checkValidity();
+    if (s != null) {
+      return s;
+    }
+
+    if (getXmlTag() == null) {
+      return "no XmlTag for collection element: " + getDomElementType();
+    }
+
+    return null;
+  }
+
+  public final void undefineInternal() {
+    final DomElement parent = getParent();
+    final XmlTag tag = getXmlTag();
+    if (tag == null) return;
+
+    getManager().cacheHandler(getCacheKey(), tag, null);
+    deleteTag(tag);
+    getManager().fireEvent(new DomEvent(parent, false));
+  }
+
+  public DomElement createPathStableCopy() {
+    final AbstractDomChildDescriptionImpl description = getChildDescription();
+    final DomElement parent = getParent();
+    assert parent != null;
+    final DomElement parentCopy = parent.createStableCopy();
+    final int index = description.getValues(parent).indexOf(getProxy());
+    return getManager().createStableValue(new Factory<DomElement>() {
+      @Nullable
+      public DomElement create() {
+        if (parentCopy.isValid()) {
+          final List<? extends DomElement> list = description.getValues(parentCopy);
+          if (list.size() > index) {
+            return list.get(index);
+          }
+        }
+        return null;
+      }
+    });
+  }
+
+  @Override
+  public int hashCode() {
+    ElementStub stub = getStub();
+    if (stub != null) {
+      return stub.getName().hashCode() + stub.id;
+    }
+    final XmlElement element = getXmlElement();
+    return element == null ? super.hashCode() : element.hashCode();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/ConvertAnnotationImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/ConvertAnnotationImpl.java
new file mode 100644
index 0000000..2fcb9eb
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/ConvertAnnotationImpl.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.util.xml.Convert;
+import com.intellij.util.xml.Converter;
+
+import java.lang.annotation.Annotation;
+
+/**
+ * @author peter
+*/
+public class ConvertAnnotationImpl implements Convert {
+  private final Converter myConverter;
+  private final boolean mySoft;
+
+  public ConvertAnnotationImpl(final Converter converter, final boolean soft) {
+    myConverter = converter;
+    mySoft = soft;
+  }
+
+  public Class<? extends Annotation> annotationType() {
+    return Convert.class;
+  }
+
+  public Converter getConverter() {
+    return myConverter;
+  }
+
+  public Class<? extends Converter> value() {
+    return myConverter.getClass();
+  }
+
+  public boolean soft() {
+    return mySoft;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (!(o instanceof ConvertAnnotationImpl)) return false;
+
+    ConvertAnnotationImpl that = (ConvertAnnotationImpl)o;
+
+    if (mySoft != that.mySoft) return false;
+    if (!myConverter.getClass().equals(that.myConverter.getClass())) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = myConverter.getClass().hashCode();
+    result = 31 * result + (mySoft ? 1 : 0);
+    return result;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/ConvertContextImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/ConvertContextImpl.java
new file mode 100644
index 0000000..2fd958e
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/ConvertContextImpl.java
@@ -0,0 +1,39 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.psi.PsiManager;
+import com.intellij.util.xml.AbstractConvertContext;
+import com.intellij.util.xml.DomElement;
+import com.intellij.openapi.module.Module;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class ConvertContextImpl extends AbstractConvertContext {
+  private final DomInvocationHandler myHandler;
+
+  public ConvertContextImpl(final DomInvocationHandler handler) {
+    myHandler = handler;
+  }
+
+  public ConvertContextImpl(DomElement element) {
+    this(DomManagerImpl.getDomInvocationHandler(element));
+  }
+
+  @NotNull
+  public final DomElement getInvocationElement() {
+    return myHandler.getProxy();
+  }
+
+  public PsiManager getPsiManager() {
+    return myHandler.getFile().getManager();
+  }
+
+  public Module getModule() {
+    final DomElement domElement = getInvocationElement();
+    if (domElement.getManager().isMockElement(domElement)) {
+      return getInvocationElement().getModule();
+    }
+    return super.getModule();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/ConverterManagerImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/ConverterManagerImpl.java
new file mode 100644
index 0000000..f2b6e6aa
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/ConverterManagerImpl.java
@@ -0,0 +1,74 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.paths.PathReference;
+import com.intellij.util.containers.ConcurrentInstanceMap;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.converters.PathReferenceConverter;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author peter
+ */
+class ConverterManagerImpl implements ConverterManager {
+
+  private final ImplementationClassCache myImplementationClassCache = new ImplementationClassCache(DomImplementationClassEP.CONVERTER_EP_NAME);
+
+  private final ConcurrentInstanceMap<Object> myConverterInstances = new ConcurrentInstanceMap<Object>() {
+    @NotNull
+    @Override
+    protected Object create(Class key) {
+      Class implementation = myImplementationClassCache.get(key);
+      return super.create(implementation == null ? key : implementation);
+    }
+  };
+  private final Map<Class,Converter> mySimpleConverters = new HashMap<Class, Converter>();
+
+  ConverterManagerImpl() {
+    mySimpleConverters.put(int.class, Converter.INTEGER_CONVERTER);
+    mySimpleConverters.put(Integer.class, Converter.INTEGER_CONVERTER);
+    mySimpleConverters.put(boolean.class, ResolvingConverter.BOOLEAN_CONVERTER);
+    mySimpleConverters.put(Boolean.class, ResolvingConverter.BOOLEAN_CONVERTER);
+    mySimpleConverters.put(String.class, Converter.EMPTY_CONVERTER);
+    mySimpleConverters.put(Object.class, Converter.EMPTY_CONVERTER);
+    mySimpleConverters.put(PathReference.class, PathReferenceConverter.INSTANCE);
+  }
+
+  public void addConverter(Class clazz, Converter converter) {
+    mySimpleConverters.put(clazz, converter);
+  }
+
+  @NotNull
+  public final Converter getConverterInstance(final Class<? extends Converter> converterClass) {
+    Converter converter = getInstance(converterClass);
+    assert converter != null: "Converter not found for " + converterClass;
+    return converter;
+  }
+
+  <T> T getInstance(Class<T> clazz) {
+    return (T)myConverterInstances.get(clazz);
+  }
+
+  @Nullable
+  public final Converter getConverterByClass(final Class<?> convertingClass) {
+    final Converter converter = mySimpleConverters.get(convertingClass);
+    if (converter != null) {
+      return converter;
+    }
+
+    if (Enum.class.isAssignableFrom(convertingClass)) {
+      return EnumConverter.createEnumConverter((Class<? extends Enum>)convertingClass);
+    }
+    if (DomElement.class.isAssignableFrom(convertingClass)) {
+      return DomResolveConverter.createConverter((Class<? extends DomElement>)convertingClass);
+    }
+    return null;
+  }
+
+  public <T extends Converter> void registerConverterImplementation(Class<T> converterInterface, T converterImpl) {
+    myConverterInstances.put(converterInterface, converterImpl);
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/CustomDomChildrenDescriptionImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/CustomDomChildrenDescriptionImpl.java
new file mode 100644
index 0000000..b99eda0
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/CustomDomChildrenDescriptionImpl.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.NotNullFunction;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.reflect.CustomDomChildrenDescription;
+import com.intellij.util.xml.reflect.DomExtensionImpl;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class CustomDomChildrenDescriptionImpl extends AbstractDomChildDescriptionImpl implements CustomDomChildrenDescription, AbstractCollectionChildDescription {
+  @Nullable private final JavaMethod myGetter;
+  public static final NotNullFunction<DomInvocationHandler,List<XmlTag>> CUSTOM_TAGS_GETTER = new NotNullFunction<DomInvocationHandler, List<XmlTag>>() {
+    @NotNull
+    public List<XmlTag> fun(final DomInvocationHandler handler) {
+      return DomImplUtil.getCustomSubTags(handler, handler.getXmlTag().getSubTags(), handler.getFile());
+    }
+  };
+
+  private final TagNameDescriptor myTagNameDescriptor;
+  private final AttributeDescriptor myAttributeDescriptor;
+
+
+  public CustomDomChildrenDescriptionImpl(@NotNull final JavaMethod getter) {
+    this(getter, DomReflectionUtil.extractCollectionElementType(getter.getGenericReturnType()),
+         TagNameDescriptor.EMPTY, TagNameDescriptor.EMPTY);
+  }
+
+  public CustomDomChildrenDescriptionImpl(DomExtensionImpl custom) {
+    this(null, custom.getType(), custom.getTagNameDescriptor(), custom.getAttributesDescriptor());
+  }
+
+  private CustomDomChildrenDescriptionImpl(@Nullable final JavaMethod getter, @NotNull Type type,
+                                          @Nullable TagNameDescriptor descriptor,
+                                          @Nullable AttributeDescriptor attributesDescriptor) {
+    super(type);
+    myGetter = getter;
+    myTagNameDescriptor = descriptor;
+    myAttributeDescriptor = attributesDescriptor;
+  }
+
+  @Nullable public JavaMethod getGetterMethod() {
+    return myGetter;
+  }
+
+  @NotNull
+  public List<? extends DomElement> getValues(@NotNull final DomInvocationHandler parent) {
+    if (!parent.getGenericInfo().checkInitialized()) {
+      return Collections.emptyList();
+    }
+    return parent.getCollectionChildren(this, CUSTOM_TAGS_GETTER);
+  }
+
+  @NotNull
+  public List<? extends DomElement> getValues(@NotNull final DomElement parent) {
+    final DomInvocationHandler handler = DomManagerImpl.getDomInvocationHandler(parent);
+    if (handler != null) return getValues(handler);
+
+    assert myGetter != null;
+    return (List<? extends DomElement>)myGetter.invoke(parent, ArrayUtil.EMPTY_OBJECT_ARRAY);
+  }
+
+  public int compareTo(final AbstractDomChildDescriptionImpl o) {
+    return equals(o) ? 0 : -1;
+  }
+
+  public List<XmlTag> getSubTags(final DomInvocationHandler handler, final XmlTag[] subTags, final XmlFile file) {
+    return DomImplUtil.getCustomSubTags(handler, subTags, file);
+  }
+
+  public EvaluatedXmlName createEvaluatedXmlName(final DomInvocationHandler parent, final XmlTag childTag) {
+    return new DummyEvaluatedXmlName(childTag.getLocalName(), childTag.getNamespace());
+  }
+
+  @Override
+  public TagNameDescriptor getTagNameDescriptor() {
+    return myTagNameDescriptor;
+  }
+
+  @Override
+  public AttributeDescriptor getCustomAttributeDescriptor() {
+    return myAttributeDescriptor;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    return obj instanceof CustomDomChildrenDescriptionImpl;
+  }
+
+  @Override
+  public int hashCode() {
+    return 239;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DefaultDomAnnotator.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DefaultDomAnnotator.java
new file mode 100644
index 0000000..40dea53
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DefaultDomAnnotator.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.lang.annotation.AnnotationHolder;
+import com.intellij.lang.annotation.Annotator;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.highlighting.*;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class DefaultDomAnnotator implements Annotator {
+
+  @Nullable
+  private static DomElement getDomElement(PsiElement psiElement, DomManager myDomManager) {
+    if (psiElement instanceof XmlTag) {
+      return myDomManager.getDomElement((XmlTag)psiElement);
+    }
+    if (psiElement instanceof XmlAttribute) {
+      return myDomManager.getDomElement((XmlAttribute)psiElement);
+    }
+    return null;
+  }
+
+  public <T extends DomElement> void runInspection(@Nullable final DomElementsInspection<T> inspection, final DomFileElement<T> fileElement, List<Annotation> toFill) {
+    if (inspection == null) return;
+    DomElementAnnotationsManagerImpl annotationsManager = getAnnotationsManager(fileElement);
+    if (DomElementAnnotationsManagerImpl.isHolderUpToDate(fileElement) && annotationsManager.getProblemHolder(fileElement).isInspectionCompleted(inspection)) return;
+
+    final DomElementAnnotationHolderImpl annotationHolder = new DomElementAnnotationHolderImpl(true);
+    inspection.checkFileElement(fileElement, annotationHolder);
+    annotationsManager.appendProblems(fileElement, annotationHolder, inspection.getClass());
+    for (final DomElementProblemDescriptor descriptor : annotationHolder) {
+      toFill.addAll(descriptor.getAnnotations());
+    }
+    toFill.addAll(annotationHolder.getAnnotations());
+  }
+
+  protected DomElementAnnotationsManagerImpl getAnnotationsManager(final DomElement element) {
+    return (DomElementAnnotationsManagerImpl)DomElementAnnotationsManager.getInstance(element.getManager().getProject());
+  }
+
+
+  public void annotate(final PsiElement psiElement, AnnotationHolder holder) {
+    final List<Annotation> list = (List<Annotation>)holder;
+
+    final DomManagerImpl domManager = DomManagerImpl.getDomManager(psiElement.getProject());
+    final DomFileDescription description = domManager.getDomFileDescription(psiElement);
+    if (description != null) {
+      final DomElement domElement = getDomElement(psiElement, domManager);
+      if (domElement != null) {
+        runInspection(domElement, list);
+      }
+    }
+  }
+
+  public final void runInspection(final DomElement domElement, final List<Annotation> list) {
+    final DomFileElement root = DomUtil.getFileElement(domElement);
+    runInspection(getAnnotationsManager(domElement).getMockInspection(root), root, list);
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DefaultDomTargetDescriptionProvider.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DefaultDomTargetDescriptionProvider.java
new file mode 100644
index 0000000..dd016e7
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DefaultDomTargetDescriptionProvider.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.pom.PomDescriptionProvider;
+import com.intellij.pom.PomTarget;
+import com.intellij.psi.ElementDescriptionLocation;
+import com.intellij.usageView.UsageViewNodeTextLocation;
+import com.intellij.usageView.UsageViewTypeLocation;
+import com.intellij.usageView.UsageViewLongNameLocation;
+import com.intellij.util.xml.*;
+import com.intellij.codeInsight.highlighting.HighlightUsagesDescriptionLocation;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class DefaultDomTargetDescriptionProvider extends PomDescriptionProvider {
+  public String getElementDescription(@NotNull PomTarget element, @NotNull ElementDescriptionLocation location) {
+    if (!(element instanceof DomTarget)) return null;
+
+    final DomTarget target = (DomTarget)element;
+
+    DomElement domElement = target.getDomElement();
+    final ElementPresentationTemplate template = domElement.getChildDescription().getPresentationTemplate();
+    final ElementPresentation presentation = template != null ? template.createPresentation(domElement) : domElement.getPresentation();
+
+    if (location == UsageViewTypeLocation.INSTANCE) {
+      return presentation.getTypeName();
+    }
+    if (location == UsageViewNodeTextLocation.INSTANCE || location == UsageViewLongNameLocation.INSTANCE) {
+      return presentation.getTypeName() + " " + StringUtil.notNullize(presentation.getElementName(), "''");
+    }
+    if (location instanceof HighlightUsagesDescriptionLocation) {
+      return presentation.getTypeName();
+    }
+    return null;
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DefaultDomTargetIconProvider.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DefaultDomTargetIconProvider.java
new file mode 100644
index 0000000..e5540c1
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DefaultDomTargetIconProvider.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.project.DumbAware;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.ElementPresentationManager;
+import com.intellij.util.xml.DomIconProvider;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+/**
+ * @author peter
+ */
+public class DefaultDomTargetIconProvider extends DomIconProvider implements DumbAware {
+  public Icon getIcon(@NotNull DomElement element, int flags) {
+    Icon icon = element.getPresentation().getIcon();
+    return icon == null ? ElementPresentationManager.getIconOld(element) : icon;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomAnchorImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomAnchorImpl.java
new file mode 100644
index 0000000..4fa7f61
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomAnchorImpl.java
@@ -0,0 +1,381 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiAnchor;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public abstract class DomAnchorImpl<T extends DomElement> implements DomAnchor<T> {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.impl.DomAnchorImpl");
+
+  public static <T extends DomElement> DomAnchorImpl<T> createAnchor(@NotNull T t) {
+    return createAnchor(t, false);
+  }
+
+  public static <T extends DomElement> DomAnchorImpl<T> createAnchor(@NotNull T t, boolean usePsi) {
+    if (usePsi) {
+      final XmlElement element = t.getXmlElement();
+      if (element != null) {
+        return new PsiBasedDomAnchor<T>(PsiAnchor.create(element), element.getProject());
+      }
+    }
+
+    final DomElement parent = t.getParent();
+    if (parent == null) {
+      LOG.error("Parent null: " + t);
+    }
+
+    if (parent instanceof DomFileElementImpl) {
+      final DomFileElementImpl fileElement = (DomFileElementImpl)parent;
+      //noinspection unchecked
+      return new RootAnchor<T>(fileElement.getFile(), fileElement.getRootElementClass());
+    }
+
+    final DomAnchorImpl<DomElement> parentAnchor = createAnchor(parent);
+    final String name = t.getGenericInfo().getElementName(t);
+    final AbstractDomChildrenDescription description = t.getChildDescription();
+    final List<? extends DomElement> values = description.getValues(parent);
+    if (name != null) {
+      int i = 0;
+      for (DomElement value : values) {
+        if (value.equals(t)) {
+          return new NamedAnchor<T>(parentAnchor, description, name, i);
+        }
+        if (name.equals(value.getGenericInfo().getElementName(value))) {
+          i++;
+        }
+      }
+    }
+
+    final int index = values.indexOf(t);
+    if (index < 0) {
+      diagnoseNegativeIndex2(t, parent, description, values);
+    }
+    return new IndexedAnchor<T>(parentAnchor, description, index);
+  }
+
+  private static <T extends DomElement> void diagnoseNegativeIndex2(T t,
+                                                                    DomElement parent,
+                                                                    AbstractDomChildrenDescription description,
+                                                                    List<? extends DomElement> values) {
+    final XmlTag parentTag = parent.getXmlTag();
+    StringBuilder diag = new StringBuilder("Index<0: description=" + description + "\nparent=" + parent + "\nt=" + t + "\nvalues=" + values + "\n");
+    for (int i = 0, size = values.size(); i < size; i++) {
+      DomElement value = values.get(i);
+      if (value.toString().equals(t.toString())) {
+        final XmlElement tElement = t.getXmlElement();
+        final XmlElement valElement = value.getXmlElement();
+        diag.append(" hasSame, i=" + i + 
+                    "; same=" + (value == t) +
+                    ", equal=" + value.equals(t) +
+                    ", equal2=" + t.equals(value) +
+                    ", t.physical=" + (tElement == null ? "null" : String.valueOf(tElement.isPhysical())) +
+                    ", value.physical=" + (valElement == null ? "null" : String.valueOf(valElement.isPhysical())) +
+                    ", sameElements=" + (tElement == value.getXmlElement()) +
+                    "\n");
+        if (tElement != null && valElement != null) {
+          diag.append("  sameFile=" + (tElement.getContainingFile() == valElement.getContainingFile()) + 
+                      ", sameParent=" + (tElement.getParent() == valElement.getParent()) +
+                      "\n");
+        }
+      }
+    }
+    
+    if (parentTag != null) {
+      diag.append("Parent tag: ").append(parentTag.getName()).append("\n");
+      if (t instanceof GenericAttributeValue) {
+        for (XmlAttribute attribute : parentTag.getAttributes()) {
+          diag.append(", attr: ").append(attribute.getName());
+        }
+        diag.append("\n");
+      } else {
+        for (XmlTag tag : parentTag.getSubTags()) {
+          diag.append("\n subtag: ").append(tag.getName());
+        }
+        diag.append("\n");
+      }
+    }
+    diag.append("Child name: ").append(t.getXmlElementName()).append(";").append(t.getXmlElementNamespaceKey());
+    LOG.error(diag);
+  }
+
+
+  @Override
+  public PsiElement getPsiElement() {
+    T t = retrieveDomElement();
+    return t == null ? null : t.getXmlElement();
+  }
+
+  @Nullable
+  public abstract T retrieveDomElement();
+
+  @NotNull
+  public abstract XmlFile getContainingFile();
+
+  private static class NamedAnchor<T extends DomElement> extends DomAnchorImpl<T> {
+    private final DomAnchorImpl myParent;
+    private final AbstractDomChildrenDescription myDescr;
+    private final String myName;
+    private final int myIndex;
+
+    private NamedAnchor(final DomAnchorImpl parent, final AbstractDomChildrenDescription descr, final String id, int index) {
+      myParent = parent;
+      myDescr = descr;
+      myName = id;
+      myIndex = index;
+    }
+
+    @Override
+    public boolean equals(final Object o) {
+      if (this == o) return true;
+      if (!(o instanceof NamedAnchor)) return false;
+
+      final NamedAnchor that = (NamedAnchor)o;
+
+      if (myDescr != null ? !myDescr.equals(that.myDescr) : that.myDescr != null) return false;
+      if (myName != null ? !myName.equals(that.myName) : that.myName != null) return false;
+      if (myParent != null ? !myParent.equals(that.myParent) : that.myParent != null) return false;
+      if (myIndex != that.myIndex) return false;
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      int result;
+      result = (myParent != null ? myParent.hashCode() : 0);
+      result = 31 * result + (myDescr != null ? myDescr.hashCode() : 0);
+      result = 31 * result + (myName != null ? myName.hashCode() : 0);
+      result = 31 * result + myIndex;
+      return result;
+    }
+
+    public T retrieveDomElement() {
+      final DomElement parent = myParent.retrieveDomElement();
+      if (parent == null) return null;
+
+      final List<? extends DomElement> list = myDescr.getValues(parent);
+      int i = 0;
+      for (final DomElement element : list) {
+        final String s = element.getGenericInfo().getElementName(element);
+        if (myName.equals(s)) {
+          if (i == myIndex) {
+            //noinspection unchecked
+            return (T)element;
+          }
+          i++;
+        }
+      }
+      return null;
+    }
+
+    @NotNull
+    public XmlFile getContainingFile() {
+      return myParent.getContainingFile();
+    }
+  }
+
+  private static class IndexedAnchor<T extends DomElement> extends DomAnchorImpl<T> {
+    private final DomAnchorImpl myParent;
+    private final AbstractDomChildrenDescription myDescr;
+    private final int myIndex;
+
+    private IndexedAnchor(final DomAnchorImpl parent, final AbstractDomChildrenDescription descr, final int index) {
+      myParent = parent;
+      myDescr = descr;
+      myIndex = index;
+    }
+
+    @Override
+    public boolean equals(final Object o) {
+      if (this == o) return true;
+      if (!(o instanceof IndexedAnchor)) return false;
+
+      final IndexedAnchor that = (IndexedAnchor)o;
+
+      if (myIndex != that.myIndex) return false;
+      if (myDescr != null ? !myDescr.equals(that.myDescr) : that.myDescr != null) return false;
+      if (myParent != null ? !myParent.equals(that.myParent) : that.myParent != null) return false;
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      int result;
+      result = (myParent != null ? myParent.hashCode() : 0);
+      result = 31 * result + (myDescr != null ? myDescr.hashCode() : 0);
+      result = 31 * result + myIndex;
+      return result;
+    }
+
+    public T retrieveDomElement() {
+      final DomElement parent = myParent.retrieveDomElement();
+      if (parent == null) return null;
+
+      final List<? extends DomElement> list = myDescr.getValues(parent);
+      if (myIndex < 0 || myIndex >= list.size()) return null;
+
+      //noinspection unchecked
+      return (T)list.get(myIndex);
+    }
+
+    @NotNull
+    public XmlFile getContainingFile() {
+      return myParent.getContainingFile();
+    }
+  }
+
+  private static class RootAnchor<T extends DomElement> extends DomAnchorImpl<T> {
+    private final XmlFile myFile;
+    private final Class<T> myClass;
+
+    private RootAnchor(final XmlFile file, final Class<T> aClass) {
+      myFile = file;
+      myClass = aClass;
+    }
+
+    @Override
+    public boolean equals(final Object o) {
+      if (this == o) return true;
+      if (!(o instanceof RootAnchor)) return false;
+
+      final RootAnchor that = (RootAnchor)o;
+
+      if (myClass != null ? !myClass.equals(that.myClass) : that.myClass != null) return false;
+      if (myFile != null ? !myFile.equals(that.myFile) : that.myFile != null) return false;
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      int result;
+      result = (myFile != null ? myFile.hashCode() : 0);
+      result = 31 * result + (myClass != null ? myClass.hashCode() : 0);
+      return result;
+    }
+
+    public T retrieveDomElement() {
+      final DomFileElement<T> fileElement = DomManager.getDomManager(myFile.getProject()).getFileElement(myFile, myClass);
+      return fileElement == null ? null : fileElement.getRootElement();
+    }
+
+    @NotNull
+    public XmlFile getContainingFile() {
+      return myFile;
+    }
+  }
+
+
+  private static class PsiBasedDomAnchor<T extends DomElement> extends DomAnchorImpl<T> {
+    private final PsiAnchor myAnchor;
+    private final Project myProject;
+
+    public PsiBasedDomAnchor(PsiAnchor anchor, Project project) {
+      myAnchor = anchor;
+      myProject = project;
+    }
+
+    @Override
+    public T retrieveDomElement() {
+      PsiElement psi = myAnchor.retrieve();
+      if (psi == null) return null;
+
+      if (psi instanceof XmlTag) {
+        return (T)DomManager.getDomManager(myProject).getDomElement((XmlTag)psi);
+      }
+      if (psi instanceof XmlAttribute) {
+        return (T)DomManager.getDomManager(myProject).getDomElement((XmlAttribute)psi);
+      }
+      return null;
+    }
+
+    @NotNull
+    @Override
+    public XmlFile getContainingFile() {
+      return (XmlFile)myAnchor.getFile();
+    }
+
+    @Override
+    public boolean equals(Object o) {
+      if (this == o) return true;
+      if (o == null || getClass() != o.getClass()) return false;
+
+      PsiBasedDomAnchor anchor = (PsiBasedDomAnchor)o;
+
+      if (myAnchor != null ? !myAnchor.equals(anchor.myAnchor) : anchor.myAnchor != null) return false;
+      if (myProject != null ? !myProject.equals(anchor.myProject) : anchor.myProject != null) return false;
+
+      return true;
+    }
+
+
+    @Override
+    public int hashCode() {
+      int result = myAnchor != null ? myAnchor.hashCode() : 0;
+      result = 31 * result + (myProject != null ? myProject.hashCode() : 0);
+      return result;
+    }
+  }
+
+  private static class StubAnchor<T extends DomElement> implements DomAnchor<T> {
+
+    private final DomInvocationHandler myHandler;
+
+    private StubAnchor(DomInvocationHandler handler) {
+      myHandler = handler;
+    }
+
+    @Nullable
+    @Override
+    public T retrieveDomElement() {
+      return (T)myHandler.getProxy();
+    }
+
+    @NotNull
+    @Override
+    public XmlFile getContainingFile() {
+      return myHandler.getFile();
+    }
+
+    @Nullable
+    @Override
+    public PsiElement getPsiElement() {
+      return myHandler.getXmlElement();
+    }
+  }
+
+  public static <T extends DomElement> DomAnchor<T> createStubAnchor(T element) {
+    DomInvocationHandler handler = DomManagerImpl.getDomInvocationHandler(element);
+    return handler.getStub() == null ? createAnchor(element, true) : new StubAnchor<T>(handler);
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomApplicationComponent.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomApplicationComponent.java
new file mode 100644
index 0000000..8df0195
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomApplicationComponent.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.util.ReflectionAssignabilityCache;
+import com.intellij.util.containers.ConcurrentFactoryMap;
+import com.intellij.util.containers.FactoryMap;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomElementVisitor;
+import com.intellij.util.xml.DomFileDescription;
+import com.intellij.util.xml.TypeChooserManager;
+import com.intellij.util.xml.highlighting.DomElementsAnnotator;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.TestOnly;
+
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import static com.intellij.util.containers.ContainerUtil.newArrayList;
+
+/**
+ * @author peter
+ */
+public class DomApplicationComponent {
+  private final FactoryMap<String,Set<DomFileDescription>> myRootTagName2FileDescription = new FactoryMap<String, Set<DomFileDescription>>() {
+    protected Set<DomFileDescription> create(final String key) {
+      return new THashSet<DomFileDescription>();
+    }
+  };
+  private final Set<DomFileDescription> myAcceptingOtherRootTagNamesDescriptions = new THashSet<DomFileDescription>();
+  private final ImplementationClassCache myCachedImplementationClasses = new ImplementationClassCache(DomImplementationClassEP.EP_NAME);
+  private final TypeChooserManager myTypeChooserManager = new TypeChooserManager();
+  final ReflectionAssignabilityCache assignabilityCache = new ReflectionAssignabilityCache();
+  private final FactoryMap<Class, DomElementsAnnotator> myClass2Annotator = new ConcurrentFactoryMap<Class, DomElementsAnnotator>() {
+
+    @Override
+    protected DomElementsAnnotator create(Class key) {
+      final DomFileDescription desc = findFileDescription(key);
+      return desc == null ? null : desc.createAnnotator();
+    }
+  };
+
+  private final ConcurrentFactoryMap<Type, StaticGenericInfo> myGenericInfos = new ConcurrentFactoryMap<Type, StaticGenericInfo>() {
+    @NotNull
+    protected StaticGenericInfo create(final Type type) {
+      return new StaticGenericInfo(type);
+    }
+  };
+  private final ConcurrentFactoryMap<Class, InvocationCache> myInvocationCaches = new ConcurrentFactoryMap<Class, InvocationCache>() {
+    @NotNull
+    protected InvocationCache create(final Class key) {
+      return new InvocationCache(key);
+    }
+  };
+  private final ConcurrentFactoryMap<Class<? extends DomElementVisitor>, VisitorDescription> myVisitorDescriptions =
+    new ConcurrentFactoryMap<Class<? extends DomElementVisitor>, VisitorDescription>() {
+      @NotNull
+      protected VisitorDescription create(final Class<? extends DomElementVisitor> key) {
+        return new VisitorDescription(key);
+      }
+    };
+
+
+  public DomApplicationComponent() {
+    for (final DomFileDescription description : Extensions.getExtensions(DomFileDescription.EP_NAME)) {
+      registerFileDescription(description);
+    }
+  }
+
+  public static DomApplicationComponent getInstance() {
+    return ServiceManager.getService(DomApplicationComponent.class);
+  }
+
+  public final synchronized Set<DomFileDescription> getFileDescriptions(String rootTagName) {
+    return myRootTagName2FileDescription.get(rootTagName);
+  }
+
+  public final synchronized Set<DomFileDescription> getAcceptingOtherRootTagNameDescriptions() {
+    return myAcceptingOtherRootTagNamesDescriptions;
+  }
+
+  public final synchronized void registerFileDescription(final DomFileDescription description) {
+    myRootTagName2FileDescription.get(description.getRootTagName()).add(description);
+    if (description.acceptsOtherRootTagNames()) {
+      myAcceptingOtherRootTagNamesDescriptions.add(description);
+    }
+
+    //noinspection unchecked
+    final Map<Class<? extends DomElement>, Class<? extends DomElement>> implementations = description.getImplementations();
+    for (final Map.Entry<Class<? extends DomElement>, Class<? extends DomElement>> entry : implementations.entrySet()) {
+      registerImplementation(entry.getKey(), entry.getValue(), null);
+    }
+
+    myTypeChooserManager.copyFrom(description.getTypeChooserManager());
+  }
+
+  public synchronized List<DomFileDescription> getAllFileDescriptions() {
+    final List<DomFileDescription> result = newArrayList();
+    for (Set<DomFileDescription> descriptions : myRootTagName2FileDescription.values()) {
+      result.addAll(descriptions);
+    }
+    result.addAll(myAcceptingOtherRootTagNamesDescriptions);
+    return result;
+  }
+
+  @Nullable
+  private synchronized DomFileDescription findFileDescription(Class rootElementClass) {
+    for (Set<DomFileDescription> descriptions : myRootTagName2FileDescription.values()) {
+      for (DomFileDescription description : descriptions) {
+        if (description.getRootElementClass() == rootElementClass) {
+          return description;
+        }
+      }
+    }
+
+    for (DomFileDescription description : myAcceptingOtherRootTagNamesDescriptions) {
+      if (description.getRootElementClass() == rootElementClass) {
+        return description;
+      }
+    }
+    return null;
+  }
+
+  public DomElementsAnnotator getAnnotator(Class rootElementClass) {
+    return myClass2Annotator.get(rootElementClass);
+  }
+
+  @Nullable
+  final Class<? extends DomElement> getImplementation(final Class concreteInterface) {
+    //noinspection unchecked
+    return myCachedImplementationClasses.get(concreteInterface);
+  }
+
+  public final void registerImplementation(Class<? extends DomElement> domElementClass, Class<? extends DomElement> implementationClass,
+                                           @Nullable final Disposable parentDisposable) {
+    myCachedImplementationClasses.registerImplementation(domElementClass, implementationClass, parentDisposable);
+  }
+
+  public TypeChooserManager getTypeChooserManager() {
+    return myTypeChooserManager;
+  }
+
+  public final StaticGenericInfo getStaticGenericInfo(final Type type) {
+    return myGenericInfos.get(type);
+  }
+
+  final InvocationCache getInvocationCache(final Class type) {
+    return myInvocationCaches.get(type);
+  }
+
+  public final VisitorDescription getVisitorDescription(Class<? extends DomElementVisitor> aClass) {
+    return myVisitorDescriptions.get(aClass);
+  }
+
+  @TestOnly
+  public void clearCachesInTests() {
+    myInvocationCaches.clear();
+    myGenericInfos.clear();
+    myCachedImplementationClasses.clear();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomChildDescriptionImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomChildDescriptionImpl.java
new file mode 100644
index 0000000..108e1e1a
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomChildDescriptionImpl.java
@@ -0,0 +1,60 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.XmlName;
+import com.intellij.util.xml.reflect.DomChildrenDescription;
+import org.jetbrains.annotations.NotNull;
+
+import java.lang.reflect.Type;
+
+/**
+ * @author peter
+ */
+public abstract class DomChildDescriptionImpl extends AbstractDomChildDescriptionImpl implements DomChildrenDescription {
+  private final XmlName myTagName;
+
+  protected DomChildDescriptionImpl(final XmlName tagName, @NotNull final Type type) {
+    super(type);
+    myTagName = tagName;
+  }
+
+  public String getName() {
+    return myTagName.getLocalName();
+  }
+
+  @NotNull
+  public String getXmlElementName() {
+    return myTagName.getLocalName();
+  }
+
+  @NotNull
+  public final XmlName getXmlName() {
+    return myTagName;
+  }
+
+  @NotNull
+  public String getCommonPresentableName(@NotNull DomElement parent) {
+    return getCommonPresentableName(getDomNameStrategy(parent));
+  }
+
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (!super.equals(o)) return false;
+
+    final DomChildDescriptionImpl that = (DomChildDescriptionImpl)o;
+
+    if (myTagName != null ? !myTagName.equals(that.myTagName) : that.myTagName != null) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 31 * result + (myTagName != null ? myTagName.hashCode() : 0);
+    return result;
+  }
+
+  public int compareTo(final AbstractDomChildDescriptionImpl o) {
+    return o instanceof DomChildDescriptionImpl ? myTagName.compareTo(((DomChildDescriptionImpl)o).myTagName) : 1;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomCompletionContributor.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomCompletionContributor.java
new file mode 100644
index 0000000..7d8b2cc
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomCompletionContributor.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.codeInsight.completion.*;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ProcessingContext;
+import com.intellij.util.containers.HashSet;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.util.XmlUtil;
+
+/**
+ * @author peter
+ */
+public class DomCompletionContributor extends CompletionContributor{
+  private final GenericValueReferenceProvider myProvider = new GenericValueReferenceProvider();
+
+  @Override
+  public void fillCompletionVariants(final CompletionParameters parameters, final CompletionResultSet result) {
+    if (parameters.getCompletionType() != CompletionType.BASIC) return;
+
+    if (domKnowsBetter(parameters, result)) {
+      result.stopHere();
+    }
+  }
+
+  private boolean domKnowsBetter(final CompletionParameters parameters, final CompletionResultSet result) {
+    final XmlAttributeValue element = PsiTreeUtil.getParentOfType(parameters.getPosition(), XmlAttributeValue.class);
+    if (element == null) {
+      return false;
+    }
+
+    if (isSchemaEnumerated(element)) {
+      return false;
+    }
+    final PsiElement parent = element.getParent();
+    if (parent instanceof XmlAttribute) {
+      XmlAttributeDescriptor descriptor = ((XmlAttribute)parent).getDescriptor();
+      if (descriptor != null && descriptor.getDefaultValue() != null) {
+        final PsiReference[] references = myProvider.getReferencesByElement(element, new ProcessingContext());
+        if (references.length > 0) {
+          return LegacyCompletionContributor.completeReference(parameters, result);
+        }
+      }
+    }
+    return false;
+  }
+
+  public static boolean isSchemaEnumerated(final PsiElement element) {
+    if (element instanceof XmlTag) {
+      final XmlTag simpleContent = XmlUtil.getSchemaSimpleContent((XmlTag)element);
+      if (simpleContent != null && XmlUtil.collectEnumerationValues(simpleContent, new HashSet<String>())) {
+        return true;
+      }                  
+    }
+    if (element instanceof XmlAttributeValue) {
+      final PsiElement parent = element.getParent();
+      if (parent instanceof XmlAttribute) {
+        final XmlAttributeDescriptor descriptor = ((XmlAttribute)parent).getDescriptor();
+        if (descriptor != null && descriptor.isEnumerated()) return true;
+      }
+    }
+    return false;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomDeclarationSearcher.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomDeclarationSearcher.java
new file mode 100644
index 0000000..937cec8
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomDeclarationSearcher.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.util.xml.AbstractDomDeclarationSearcher;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomTarget;
+import com.intellij.util.xml.NameValue;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public class DomDeclarationSearcher extends AbstractDomDeclarationSearcher {
+
+  @Nullable
+  protected DomTarget createDomTarget(DomElement parent, DomElement nameElement) {
+    final NameValue nameValue = nameElement.getAnnotation(NameValue.class);
+    if (nameValue != null && nameValue.referencable()) {
+      return DomTarget.getTarget(parent);
+    }
+    return null;
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomDescriptorProvider.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomDescriptorProvider.java
new file mode 100644
index 0000000..18ed303
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomDescriptorProvider.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.impl.source.xml.XmlElementDescriptorProvider;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.PsiElement;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.impl.dom.DomElementXmlDescriptor;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.DefinesXml;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author yole
+ */
+public class DomDescriptorProvider implements XmlElementDescriptorProvider {
+
+  @Nullable
+  public XmlElementDescriptor getDescriptor(final XmlTag tag) {
+    Project project = tag.getProject();
+    if (project.isDefault()) return null;
+    final DomElement domElement = DomManager.getDomManager(project).getDomElement(tag);
+    if (domElement != null) {
+      final DefinesXml definesXml = domElement.getAnnotation(DefinesXml.class);
+      if (definesXml != null) {
+        return new DomElementXmlDescriptor(domElement);
+      }
+      final PsiElement parent = tag.getParent();
+      if (parent instanceof XmlTag) {
+        final XmlElementDescriptor descriptor = ((XmlTag)parent).getDescriptor();
+
+        if (descriptor != null && descriptor instanceof DomElementXmlDescriptor) {
+          return descriptor.getElementDescriptor(tag, (XmlTag)parent);
+        }
+      }
+    }
+
+    return null;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomElementsNavigationManagerImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomElementsNavigationManagerImpl.java
new file mode 100644
index 0000000..6744005
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomElementsNavigationManagerImpl.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.fileEditor.OpenFileDescriptor;
+import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.*;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class DomElementsNavigationManagerImpl extends DomElementsNavigationManager {
+  private final Map<String, DomElementNavigationProvider> myProviders = new HashMap<String, DomElementNavigationProvider>();
+  private final Project myProject;
+
+  private final DomElementNavigationProvider myTextEditorProvider = new MyDomElementNavigateProvider();
+
+  public DomElementsNavigationManagerImpl(final Project project) {
+    myProject = project;
+    myProviders.put(myTextEditorProvider.getProviderName(), myTextEditorProvider);
+  }
+
+  public Set<DomElementNavigationProvider> getDomElementsNavigateProviders(DomElement domElement) {
+    Set<DomElementNavigationProvider> result = new HashSet<DomElementNavigationProvider>();
+
+    for (DomElementNavigationProvider navigateProvider : myProviders.values()) {
+      if (navigateProvider.canNavigate(domElement)) result.add(navigateProvider) ;
+    }
+    return result;
+  }
+
+  public DomElementNavigationProvider getDomElementsNavigateProvider(String providerName) {
+    return myProviders.get(providerName);
+  }
+
+  public void registerDomElementsNavigateProvider(DomElementNavigationProvider provider) {
+    myProviders.put(provider.getProviderName(), provider);
+  }
+
+  private class MyDomElementNavigateProvider extends DomElementNavigationProvider {
+
+    public String getProviderName() {
+      return DEFAULT_PROVIDER_NAME;
+    }
+
+    public void navigate(DomElement domElement, boolean requestFocus) {
+      if (!domElement.isValid()) return;
+
+      final DomFileElement<DomElement> fileElement = DomUtil.getFileElement(domElement);
+      if (fileElement == null) return;
+
+      VirtualFile file = fileElement.getFile().getVirtualFile();
+      if (file == null) return;
+
+      XmlElement xmlElement = domElement.getXmlElement();
+      if (xmlElement instanceof XmlAttribute) xmlElement = ((XmlAttribute)xmlElement).getValueElement();
+      final OpenFileDescriptor fileDescriptor = xmlElement != null ?
+        new OpenFileDescriptor(myProject, file, xmlElement.getTextOffset()) :
+        new OpenFileDescriptor(myProject, file);
+
+      FileEditorManagerEx.getInstanceEx(myProject).openTextEditor(fileDescriptor, requestFocus);
+    }
+
+    public boolean canNavigate(DomElement domElement) {
+      return domElement != null && domElement.isValid();
+    }
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomFileElementImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomFileElementImpl.java
new file mode 100644
index 0000000..305e706
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomFileElementImpl.java
@@ -0,0 +1,382 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtil;
+import com.intellij.openapi.util.Factory;
+import com.intellij.openapi.util.Key;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.reflect.*;
+import com.intellij.util.xml.stubs.FileStub;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author peter
+ */
+public class DomFileElementImpl<T extends DomElement> implements DomFileElement<T> {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.impl.DomFileElementImpl");
+  private static final DomGenericInfo EMPTY_DOM_GENERIC_INFO = new DomGenericInfo() {
+
+    @Nullable
+    public XmlElement getNameElement(DomElement element) {
+      return null;
+    }
+
+    @Nullable
+    public GenericDomValue getNameDomElement(DomElement element) {
+      return null;
+    }
+
+    @NotNull
+    public List<? extends CustomDomChildrenDescription> getCustomNameChildrenDescription() {
+      return Collections.emptyList();
+    }
+
+    @Nullable
+    public String getElementName(DomElement element) {
+      return null;
+    }
+
+    @NotNull
+    public List<DomChildrenDescription> getChildrenDescriptions() {
+      return Collections.emptyList();
+    }
+
+    @NotNull
+    public List<DomFixedChildDescription> getFixedChildrenDescriptions() {
+      return Collections.emptyList();
+    }
+
+    @NotNull
+    public List<DomCollectionChildDescription> getCollectionChildrenDescriptions() {
+      return Collections.emptyList();
+    }
+
+    @NotNull
+    public List<DomAttributeChildDescription> getAttributeChildrenDescriptions() {
+      return Collections.emptyList();
+    }
+
+    public boolean isTagValueElement() {
+      return false;
+    }
+
+    @Nullable
+    public DomFixedChildDescription getFixedChildDescription(String tagName) {
+      return null;
+    }
+
+    @Nullable
+    public DomFixedChildDescription getFixedChildDescription(@NonNls String tagName, @NonNls String namespace) {
+      return null;
+    }
+
+    @Nullable
+    public DomCollectionChildDescription getCollectionChildDescription(String tagName) {
+      return null;
+    }
+
+    @Nullable
+    public DomCollectionChildDescription getCollectionChildDescription(@NonNls String tagName, @NonNls String namespace) {
+      return null;
+    }
+
+    public DomAttributeChildDescription getAttributeChildDescription(String attributeName) {
+      return null;
+    }
+
+    @Nullable
+    public DomAttributeChildDescription getAttributeChildDescription(@NonNls String attributeName, @NonNls String namespace) {
+      return null;
+    }
+
+  };
+
+  private final XmlFile myFile;
+  private final DomFileDescription<T> myFileDescription;
+  private final DomRootInvocationHandler myRootHandler;
+  private final Class<T> myRootElementClass;
+  private final EvaluatedXmlNameImpl myRootTagName;
+  private final DomManagerImpl myManager;
+  private final Map<Key,Object> myUserData = new HashMap<Key, Object>();
+
+  protected DomFileElementImpl(final XmlFile file,
+                               final Class<T> rootElementClass,
+                               final EvaluatedXmlNameImpl rootTagName,
+                               final DomManagerImpl manager, final DomFileDescription<T> fileDescription,
+                               FileStub stub) {
+    myFile = file;
+    myRootElementClass = rootElementClass;
+    myRootTagName = rootTagName;
+    myManager = manager;
+    myFileDescription = fileDescription;
+    myRootHandler = new DomRootInvocationHandler(rootElementClass, new RootDomParentStrategy(this), this, rootTagName,
+                                                 stub == null ? null : stub.getRootTagStub());
+  }
+
+  @NotNull
+  public final XmlFile getFile() {
+    return myFile;
+  }
+
+  @NotNull
+  public XmlFile getOriginalFile() {
+    return (XmlFile)myFile.getOriginalFile();
+  }
+
+  @Nullable
+  public XmlTag getRootTag() {
+    if (!myFile.isValid()) {
+      return null;
+    }
+
+    final XmlDocument document = myFile.getDocument();
+    if (document != null) {
+      final XmlTag tag = document.getRootTag();
+      if (tag != null) {
+        if (tag.getTextLength() > 0 && getFileDescription().acceptsOtherRootTagNames()) return tag;
+        if (myRootTagName.getXmlName().getLocalName().equals(tag.getLocalName()) &&
+            myRootTagName.isNamespaceAllowed(this, tag.getNamespace())) {
+          return tag;
+        }
+      }
+    }
+    return null;
+  }
+
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (!(o instanceof DomFileElementImpl)) return false;
+
+    final DomFileElementImpl that = (DomFileElementImpl)o;
+
+    if (myFile != null ? !myFile.equals(that.myFile) : that.myFile != null) return false;
+    if (myRootElementClass != null ? !myRootElementClass.equals(that.myRootElementClass) : that.myRootElementClass != null) return false;
+    if (myRootTagName != null ? !myRootTagName.equals(that.myRootTagName) : that.myRootTagName != null) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    int result;
+    result = (myFile != null ? myFile.hashCode() : 0);
+    result = 31 * result + (myRootElementClass != null ? myRootElementClass.hashCode() : 0);
+    result = 31 * result + (myRootTagName != null ? myRootTagName.hashCode() : 0);
+    return result;
+  }
+
+  @NotNull
+  public final DomManagerImpl getManager() {
+    return myManager;
+  }
+
+  public final Type getDomElementType() {
+    return getClass();
+  }
+
+  @NotNull
+  public AbstractDomChildrenDescription getChildDescription() {
+    throw new UnsupportedOperationException("Method getChildDescription is not yet implemented in " + getClass().getName());
+  }
+
+  public DomNameStrategy getNameStrategy() {
+    return getRootHandler().getNameStrategy();
+  }
+
+  @NotNull
+  public ElementPresentation getPresentation() {
+    return new ElementPresentation() {
+
+      public @NonNls String getElementName() {
+        return "<ROOT>";
+      }
+
+      public @NonNls String getTypeName() {
+        return "<ROOT>";
+      }
+
+      public Icon getIcon() {
+        return null;
+      }
+    };
+  }
+
+  public GlobalSearchScope getResolveScope() {
+    return myFile.getResolveScope();
+  }
+
+  @Nullable
+  public <T extends DomElement> T getParentOfType(Class<T> requiredClass, boolean strict) {
+    return DomFileElement.class.isAssignableFrom(requiredClass) && !strict ? (T)this : null;
+  }
+
+  public Module getModule() {
+    return ModuleUtil.findModuleForPsiElement(getFile());
+  }
+
+  public void copyFrom(DomElement other) {
+    throw new UnsupportedOperationException("Method copyFrom is not yet implemented in " + getClass().getName());
+  }
+
+  public final <T extends DomElement> T createMockCopy(final boolean physical) {
+    throw new UnsupportedOperationException("Method createMockCopy is not yet implemented in " + getClass().getName());
+  }
+
+  public final <T extends DomElement> T createStableCopy() {
+    return myManager.createStableValue(new Factory<T>() {
+      @Nullable
+      public T create() {
+        return (T)myManager.getFileElement(myFile);
+      }
+    });
+  }
+
+  @NotNull
+  public String getXmlElementNamespace() {
+    return "";
+  }
+
+  @Nullable
+  @NonNls
+  public String getXmlElementNamespaceKey() {
+    return null;
+  }
+
+  @NotNull
+  public final T getRootElement() {
+    if (!isValid()) {
+      if (!myFile.isValid()) {
+        assert false: myFile + " is not valid";
+      } else {
+        final DomFileElementImpl<DomElement> fileElement = myManager.getFileElement(myFile);
+        if (fileElement == null) {
+          final FileDescriptionCachedValueProvider<DomElement> provider = myManager.getOrCreateCachedValueProvider(myFile);
+          String s = provider.getFileElementWithLogging();
+          LOG.error("Null, log=" + s);
+        } else {
+          assert false: this + " does not equal to " + fileElement;
+        }
+      }
+    }
+    return (T)getRootHandler().getProxy();
+  }
+
+  @NotNull
+  public Class<T> getRootElementClass() {
+    return myRootElementClass;
+  }
+
+  @NotNull
+  public DomFileDescription<T> getFileDescription() {
+    return myFileDescription;
+  }
+
+  @NotNull
+  protected final DomRootInvocationHandler getRootHandler() {
+    return myRootHandler;
+  }
+
+  public @NonNls String toString() {
+    return "File " + myFile.toString();
+  }
+
+  public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+    return null;
+  }
+
+  public final XmlTag getXmlTag() {
+    return null;
+  }
+
+  @NotNull
+  public <T extends DomElement> DomFileElementImpl<T> getRoot() {
+    return (DomFileElementImpl<T>)this;
+  }
+
+  @Nullable
+  public DomElement getParent() {
+    return null;
+  }
+
+  public final XmlTag ensureTagExists() {
+    return null;
+  }
+
+  public final XmlElement getXmlElement() {
+    return getFile();
+  }
+
+  public final XmlElement ensureXmlElementExists() {
+    return ensureTagExists();
+  }
+
+  public void undefine() {
+  }
+
+  public final boolean isValid() {
+    return checkValidity() == null;
+  }
+
+  @Override
+  public boolean exists() {
+    return true;
+  }
+
+  @Nullable
+  public String checkValidity() {
+    if (!myFile.isValid()) {
+      return "Invalid file";
+    }
+    final DomFileElementImpl<DomElement> fileElement = myManager.getFileElement(myFile);
+    if (!equals(fileElement)) {
+      return "file element changed: " + fileElement + "; fileType=" + myFile.getFileType();
+    }
+    return null;
+  }
+
+  @NotNull
+  public final DomGenericInfo getGenericInfo() {
+    return EMPTY_DOM_GENERIC_INFO;
+  }
+
+  @NotNull
+  public String getXmlElementName() {
+    return "";
+  }
+
+  public void accept(final DomElementVisitor visitor) {
+    myManager.getApplicationComponent().getVisitorDescription(visitor.getClass()).acceptElement(visitor, this);
+  }
+
+  public void acceptChildren(DomElementVisitor visitor) {
+    getRootElement().accept(visitor);
+  }
+
+  public <T> T getUserData(@NotNull Key<T> key) {
+    return (T)myUserData.get(key);
+  }
+
+  public <T> void putUserData(@NotNull Key<T> key, T value) {
+    myUserData.put(key, value);
+  }
+
+  public final long getModificationCount() {
+    return myFile.getModificationStamp();
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomGenericInfoEx.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomGenericInfoEx.java
new file mode 100644
index 0000000..64ffab0
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomGenericInfoEx.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.Processor;
+import com.intellij.util.xml.EvaluatedXmlName;
+import com.intellij.util.xml.JavaMethod;
+import com.intellij.util.xml.XmlName;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import com.intellij.util.xml.reflect.CustomDomChildrenDescription;
+import com.intellij.util.xml.reflect.DomGenericInfo;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public abstract class DomGenericInfoEx implements DomGenericInfo {
+
+  public abstract boolean checkInitialized();
+
+  @Nullable
+  public abstract Invocation createInvocation(final JavaMethod method);
+
+  @NotNull
+  public abstract List<AttributeChildDescriptionImpl> getAttributeChildrenDescriptions();
+
+  @Nullable
+  public final AbstractDomChildrenDescription findChildrenDescription(DomInvocationHandler handler, final String localName, String namespace,
+                                                               boolean attribute,
+                                                               final String qName) {
+    for (final AbstractDomChildrenDescription description : getChildrenDescriptions()) {
+      if (description instanceof DomChildDescriptionImpl && description instanceof AttributeChildDescriptionImpl == attribute) {
+        final XmlName xmlName = ((DomChildDescriptionImpl)description).getXmlName();
+        if (attribute && StringUtil.isEmpty(namespace) && xmlName.getLocalName().equals(localName)) return description;
+
+        final EvaluatedXmlName evaluatedXmlName = handler.createEvaluatedXmlName(xmlName);
+        if (DomImplUtil.isNameSuitable(evaluatedXmlName, localName, qName, namespace, handler.getFile())) {
+          return description;
+        }
+      }
+    }
+
+    List<? extends CustomDomChildrenDescription> list = getCustomNameChildrenDescription();
+    for (CustomDomChildrenDescription description : list) {
+      if (attribute) {
+        // todo
+      }
+      else if (description.getTagNameDescriptor() != null) {
+        return description;
+      }
+    }
+    return null;
+  }
+
+  public abstract boolean processAttributeChildrenDescriptions(Processor<AttributeChildDescriptionImpl> processor);
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomImplUtil.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomImplUtil.java
new file mode 100644
index 0000000..eaeac39
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomImplUtil.java
@@ -0,0 +1,317 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiInvalidElementAccessException;
+import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ReflectionCache;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import com.intellij.util.xml.reflect.DomFixedChildDescription;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.*;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author peter
+ */
+public class DomImplUtil {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.impl.DomImplUtil");
+
+  private DomImplUtil() {
+  }
+
+  public static void assertValidity(DomElement element, String msg) {
+    if (element instanceof DomFileElementImpl) {
+      final String s = ((DomFileElementImpl)element).checkValidity();
+      if (s != null) {
+        throw new AssertionError(s);
+      }
+      return;
+    }
+
+    final DomInvocationHandler handler = DomManagerImpl.getDomInvocationHandler(element);
+    assert handler != null;
+    try {
+      handler.assertValid();
+    }
+    catch (AssertionError e) {
+      throw new AssertionError(msg + e.getMessage());
+    }
+  }
+
+  public static boolean isTagValueGetter(final JavaMethod method) {
+    if (!isGetter(method)) {
+      return false;
+    }
+    if (hasTagValueAnnotation(method)) {
+      return true;
+    }
+    if ("getValue".equals(method.getName())) {
+      if (method.getAnnotation(SubTag.class) != null) return false;
+      if (method.getAnnotation(SubTagList.class) != null) return false;
+      if (method.getAnnotation(Convert.class) != null || method.getAnnotation(Resolve.class) != null) {
+        return !ReflectionCache.isAssignable(GenericDomValue.class, method.getReturnType());
+      }
+      if (ReflectionCache.isAssignable(DomElement.class, method.getReturnType())) return false;
+      return true;
+    }
+    return false;
+  }
+
+  private static boolean hasTagValueAnnotation(final JavaMethod method) {
+    return method.getAnnotation(TagValue.class) != null;
+  }
+
+  public static boolean isGetter(final JavaMethod method) {
+    @NonNls final String name = method.getName();
+    final boolean isGet = name.startsWith("get");
+    final boolean isIs = !isGet && name.startsWith("is");
+    if (!isGet && !isIs) {
+      return false;
+    }
+    if (method.getGenericParameterTypes().length != 0) {
+      return false;
+    }
+    final Type returnType = method.getGenericReturnType();
+    if (isGet) {
+      return returnType != void.class;
+    }
+    return DomReflectionUtil.canHaveIsPropertyGetterPrefix(returnType);
+  }
+
+
+  public static boolean isTagValueSetter(final JavaMethod method) {
+    boolean setter = method.getName().startsWith("set") && method.getGenericParameterTypes().length == 1 && method.getReturnType() == void.class;
+    return setter && (hasTagValueAnnotation(method) || "setValue".equals(method.getName()));
+  }
+
+  @Nullable
+  public static DomNameStrategy getDomNameStrategy(final Class<?> rawType, boolean isAttribute) {
+    Class aClass = null;
+    if (isAttribute) {
+      NameStrategyForAttributes annotation = DomReflectionUtil.findAnnotationDFS(rawType, NameStrategyForAttributes.class);
+      if (annotation != null) {
+        aClass = annotation.value();
+      }
+    }
+    if (aClass == null) {
+      NameStrategy annotation = DomReflectionUtil.findAnnotationDFS(rawType, NameStrategy.class);
+      if (annotation != null) {
+        aClass = annotation.value();
+      }
+    }
+    if (aClass != null) {
+      if (HyphenNameStrategy.class.equals(aClass)) return DomNameStrategy.HYPHEN_STRATEGY;
+      if (JavaNameStrategy.class.equals(aClass)) return DomNameStrategy.JAVA_STRATEGY;
+      try {
+        return (DomNameStrategy)aClass.newInstance();
+      }
+      catch (InstantiationException e) {
+        LOG.error(e);
+      }
+      catch (IllegalAccessException e) {
+        LOG.error(e);
+      }
+    }
+    return null;
+  }
+
+  public static List<XmlTag> findSubTags(@NotNull final XmlTag tag, final EvaluatedXmlName name, final XmlFile file) {
+    if (!tag.isValid()) {
+      throw new AssertionError("Invalid tag");
+    }
+    final XmlTag[] tags = tag.getSubTags();
+    if (tags.length == 0) {
+      return Collections.emptyList();
+    }
+
+    return ContainerUtil.findAll(tags, new Condition<XmlTag>() {
+      public boolean value(XmlTag childTag) {
+        try {
+          return isNameSuitable(name, childTag.getLocalName(), childTag.getName(), childTag.getNamespace(), file);
+        }
+        catch (PsiInvalidElementAccessException e) {
+          if (!childTag.isValid()) {
+            LOG.error("tag.getSubTags() returned invalid, " +
+                      "tag=" + tag + ", " +
+                      "containing file: " + tag.getContainingFile() +
+                      "subTag.parent=" + childTag.getNode().getTreeParent());
+            return false;
+          }
+          throw e;
+        }
+      }
+    });
+  }
+
+  public static List<XmlTag> findSubTags(final XmlTag[] tags, final EvaluatedXmlName name, final XmlFile file) {
+    if (tags.length == 0) {
+      return Collections.emptyList();
+    }
+
+    return ContainerUtil.findAll(tags, new Condition<XmlTag>() {
+      public boolean value(XmlTag childTag) {
+        return isNameSuitable(name, childTag, file);
+      }
+    });
+  }
+
+  public static boolean isNameSuitable(final XmlName name, final XmlTag tag, @NotNull final DomInvocationHandler handler, final XmlFile file) {
+    return isNameSuitable(handler.createEvaluatedXmlName(name), tag, file);
+  }
+
+  private static boolean isNameSuitable(final EvaluatedXmlName evaluatedXmlName, final XmlTag tag, final XmlFile file) {
+    if (!tag.isValid()) {
+      TreeElement parent = ((TreeElement) tag).getTreeParent();
+      throw new AssertionError("Invalid child tag of valid parent. Parent:" + (parent == null ? null : parent.getPsi().isValid()));
+    }
+    return isNameSuitable(evaluatedXmlName, tag.getLocalName(), tag.getName(), tag.getNamespace(), file);
+  }
+
+  public static boolean isNameSuitable(final EvaluatedXmlName evaluatedXmlName, final String localName, final String qName, final String namespace,
+                                       final XmlFile file) {
+    final String localName1 = evaluatedXmlName.getXmlName().getLocalName();
+    return (localName1.equals(localName) || localName1.equals(qName)) && evaluatedXmlName.isNamespaceAllowed(namespace, file,
+                                                                                                             !localName1.equals(qName));
+  }
+
+  @Nullable
+  public static XmlName createXmlName(@NotNull String name, Type type, @Nullable JavaMethod javaMethod) {
+    final Class<?> aClass = getErasure(type);
+    if (aClass == null) return null;
+    String key = getNamespaceKey(aClass);
+    if (key == null && javaMethod != null) {
+      for (final Method method : javaMethod.getHierarchy()) {
+        final String key1 = getNamespaceKey(method.getDeclaringClass());
+        if (key1 != null) {
+          return new XmlName(name, key1);
+        }
+      }
+    }
+    return new XmlName(name, key);
+  }
+
+  @Nullable
+  private static Class<?> getErasure(Type type) {
+    if (type instanceof Class) {
+      return (Class)type;
+    }
+    if (type instanceof ParameterizedType) {
+      return getErasure(((ParameterizedType)type).getRawType());
+    }
+    if (type instanceof TypeVariable) {
+      for (final Type bound : ((TypeVariable)type).getBounds()) {
+        final Class<?> aClass = getErasure(bound);
+        if (aClass != null) {
+          return aClass;
+        }
+      }
+    }
+    if (type instanceof WildcardType) {
+      final WildcardType wildcardType = (WildcardType)type;
+      for (final Type bound : wildcardType.getUpperBounds()) {
+        final Class<?> aClass = getErasure(bound);
+        if (aClass != null) {
+          return aClass;
+        }
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  private static String getNamespaceKey(@NotNull Class<?> type) {
+    final Namespace namespace = DomReflectionUtil.findAnnotationDFS(type, Namespace.class);
+    return namespace != null ? namespace.value() : null;
+  }
+
+  @Nullable
+  public static XmlName createXmlName(@NotNull final String name, final JavaMethod method) {
+    return createXmlName(name, method.getGenericReturnType(), method);
+  }
+
+  public static List<XmlTag> getCustomSubTags(final DomInvocationHandler handler, final XmlTag[] subTags, final XmlFile file) {
+    if (subTags.length == 0) {
+      return Collections.emptyList();
+    }
+
+    final DomGenericInfoEx info = handler.getGenericInfo();
+    final Set<XmlName> usedNames = new THashSet<XmlName>();
+    List<? extends DomCollectionChildDescription> collectionChildrenDescriptions = info.getCollectionChildrenDescriptions();
+    //noinspection ForLoopReplaceableByForEach
+    for (int i = 0, size = collectionChildrenDescriptions.size(); i < size; i++) {
+      DomCollectionChildDescription description = collectionChildrenDescriptions.get(i);
+      usedNames.add(description.getXmlName());
+    }
+    List<? extends DomFixedChildDescription> fixedChildrenDescriptions = info.getFixedChildrenDescriptions();
+    //noinspection ForLoopReplaceableByForEach
+    for (int i = 0, size = fixedChildrenDescriptions.size(); i < size; i++) {
+      DomFixedChildDescription description = fixedChildrenDescriptions.get(i);
+      usedNames.add(description.getXmlName());
+    }
+    return ContainerUtil.findAll(subTags, new Condition<XmlTag>() {
+      public boolean value(final XmlTag tag) {
+        if (StringUtil.isEmpty(tag.getName())) return false;
+
+        for (final XmlName name : usedNames) {
+          if (isNameSuitable(name, tag, handler, file)) {
+            return false;
+          }
+        }
+        return true;
+      }
+    });
+  }
+
+  static XmlFile getFile(DomElement domElement) {
+    if (domElement instanceof DomFileElement) {
+      return ((DomFileElement)domElement).getFile();
+    }
+    DomInvocationHandler handler = DomManagerImpl.getDomInvocationHandler(domElement);
+    assert handler != null : domElement;
+    while (handler != null && !(handler instanceof DomRootInvocationHandler) && handler.getXmlTag() == null) {
+      handler = handler.getParentHandler();
+    }
+    if (handler instanceof DomRootInvocationHandler) {
+      return ((DomRootInvocationHandler)handler).getParent().getFile();
+    }
+    assert handler != null;
+    XmlTag tag = handler.getXmlTag();
+    assert tag != null;
+    while (true) {
+      final PsiElement parentTag = PhysicalDomParentStrategy.getParentTagCandidate(tag);
+      if (!(parentTag instanceof XmlTag)) {
+        return (XmlFile)tag.getContainingFile();
+      }
+
+      tag = (XmlTag)parentTag;
+    }
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomImplementationClassEP.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomImplementationClassEP.java
new file mode 100644
index 0000000..c8eabc4
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomImplementationClassEP.java
@@ -0,0 +1,31 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.extensions.AbstractExtensionPointBean;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.util.xmlb.annotations.Attribute;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public class DomImplementationClassEP extends AbstractExtensionPointBean {
+  public static final ExtensionPointName<DomImplementationClassEP> EP_NAME = ExtensionPointName.create("com.intellij.dom.implementation");
+  public static final ExtensionPointName<DomImplementationClassEP> CONVERTER_EP_NAME = ExtensionPointName.create("com.intellij.dom.converter");
+
+  @Attribute("interfaceClass")
+  public String interfaceName;
+
+  @Attribute("implementationClass")
+  public String implementationName;
+
+
+  @Nullable
+  public Class getInterfaceClass() {
+    return findClassNoExceptions(interfaceName);
+  }
+
+  @Nullable
+  public Class getImplementationClass() {
+    return findClassNoExceptions(implementationName);
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java
new file mode 100644
index 0000000..663fb7f
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java
@@ -0,0 +1,881 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtil;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.util.NullableFactory;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.UserDataHolderBase;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiInvalidElementAccessException;
+import com.intellij.psi.SmartPointerManager;
+import com.intellij.psi.SmartPsiElementPointer;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.semantic.SemElement;
+import com.intellij.semantic.SemKey;
+import com.intellij.util.*;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.events.DomEvent;
+import com.intellij.util.xml.reflect.*;
+import com.intellij.util.xml.stubs.AttributeStub;
+import com.intellij.util.xml.stubs.DomStub;
+import com.intellij.util.xml.stubs.ElementStub;
+import com.intellij.util.xml.stubs.StubParentStrategy;
+import net.sf.cglib.proxy.AdvancedProxy;
+import net.sf.cglib.proxy.InvocationHandler;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public abstract class DomInvocationHandler<T extends AbstractDomChildDescriptionImpl, Stub extends DomStub> extends UserDataHolderBase implements InvocationHandler, DomElement,
+                                                                                                                            SemElement {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.impl.DomInvocationHandler");
+  public static final Method ACCEPT_METHOD = ReflectionUtil.getMethod(DomElement.class, "accept", DomElementVisitor.class);
+  public static final Method ACCEPT_CHILDREN_METHOD = ReflectionUtil.getMethod(DomElement.class, "acceptChildren", DomElementVisitor.class);
+  private static final JavaMethod ourGetValue = JavaMethod.getMethod(GenericValue.class, new JavaMethodSignature("getValue"));
+
+  private final Type myType;
+  private final DomManagerImpl myManager;
+  private final EvaluatedXmlName myTagName;
+  private final T myChildDescription;
+  private DomParentStrategy myParentStrategy;
+  private volatile long myLastModCount;
+
+  private final DomElement myProxy;
+  private DomGenericInfoEx myGenericInfo;
+  private final InvocationCache myInvocationCache;
+  private volatile Converter myScalarConverter = null;
+  private volatile SmartFMap<Method, Invocation> myAccessorInvocations = SmartFMap.emptyMap();
+  @Nullable protected final Stub myStub;
+
+  protected DomInvocationHandler(Type type, DomParentStrategy parentStrategy,
+                                 @NotNull final EvaluatedXmlName tagName,
+                                 final T childDescription,
+                                 final DomManagerImpl manager,
+                                 boolean dynamic,
+                                 @Nullable Stub stub) {
+    myManager = manager;
+    myParentStrategy = parentStrategy;
+    myTagName = tagName;
+    myChildDescription = childDescription;
+    myStub = stub;
+    myLastModCount = manager.getPsiModificationCount();
+
+    myType = narrowType(type);
+
+    final Class<?> rawType = getRawType();
+    myInvocationCache = manager.getApplicationComponent().getInvocationCache(rawType);
+    Class<? extends DomElement> implementation = manager.getApplicationComponent().getImplementation(rawType);
+    final boolean isInterface = ReflectionCache.isInterface(rawType);
+    if (implementation == null && !isInterface) {
+      implementation = (Class<? extends DomElement>)rawType;
+    }
+    myProxy = AdvancedProxy.createProxy(this, implementation, isInterface ? new Class[]{rawType} : ArrayUtil.EMPTY_CLASS_ARRAY);
+    refreshGenericInfo(dynamic);
+    if (stub != null) {
+      stub.setHandler(this);
+    }
+  }
+
+  protected Type narrowType(@NotNull Type nominalType) {
+    return nominalType;
+  }
+
+  @Nullable
+  public DomElement getParent() {
+    final DomInvocationHandler handler = getParentHandler();
+    return handler == null ? null : handler.getProxy();
+  }
+
+  protected final void assertValid() {
+    final String s = checkValidity();
+    if (s != null) {
+      throw new AssertionError(myType.toString() + " @" + hashCode() + "\nclass=" + getClass() + "\nxml=" + getXmlElement() + "; " + s);
+    }
+  }
+
+  @Nullable
+  final DomInvocationHandler getParentHandler() {
+    return getParentStrategy().getParentHandler();
+  }
+
+  @Nullable
+  public Stub getStub() {
+    return myStub;
+  }
+
+  @NotNull
+  public final Type getDomElementType() {
+    return myType;
+  }
+
+  @Nullable
+  protected String getValue() {
+    final XmlTag tag = getXmlTag();
+    return tag == null ? null : getTagValue(tag);
+  }
+
+  protected void setValue(@Nullable final String value) {
+    final XmlTag tag = ensureTagExists();
+    myManager.runChange(new Runnable() {
+      public void run() {
+        setTagValue(tag, value);
+      }
+    });
+    myManager.fireEvent(new DomEvent(getProxy(), false));
+  }
+
+  public void copyFrom(final DomElement other) {
+    if (other == getProxy()) return;
+    assert other.getDomElementType().equals(myType) : "Can't copy from " + other.getDomElementType() + " to " + myType;
+
+    if (!DomUtil.hasXml(other)) {
+      undefine();
+      return;
+    }
+
+    myManager.performAtomicChange(new Runnable() {
+      public void run() {
+        ensureXmlElementExists();
+        final DomGenericInfoEx genericInfo = getGenericInfo();
+        for (final AttributeChildDescriptionImpl description : genericInfo.getAttributeChildrenDescriptions()) {
+          description.getDomAttributeValue(DomInvocationHandler.this).setStringValue(description.getDomAttributeValue(other).getStringValue());
+        }
+        for (final DomFixedChildDescription description : genericInfo.getFixedChildrenDescriptions()) {
+          final List<? extends DomElement> list = description.getValues(getProxy());
+          final List<? extends DomElement> otherValues = description.getValues(other);
+          for (int i = 0; i < list.size(); i++) {
+            final DomElement otherValue = otherValues.get(i);
+            final DomElement value = list.get(i);
+            if (!DomUtil.hasXml(otherValue)) {
+              value.undefine();
+            }
+            else {
+              value.copyFrom(otherValue);
+            }
+          }
+        }
+        for (final DomCollectionChildDescription description : genericInfo.getCollectionChildrenDescriptions()) {
+          for (final DomElement value : description.getValues(getProxy())) {
+            value.undefine();
+          }
+          for (final DomElement otherValue : description.getValues(other)) {
+            description.addValue(getProxy(), otherValue.getDomElementType()).copyFrom(otherValue);
+          }
+        }
+
+        final String stringValue = DomManagerImpl.getDomInvocationHandler(other).getValue();
+        if (StringUtil.isNotEmpty(stringValue)) {
+          setValue(stringValue);
+        }
+      }
+    });
+
+    if (!myManager.getSemService().isInsideAtomicChange()) {
+      myManager.fireEvent(new DomEvent(myProxy, false));
+    }
+  }
+
+  public <T extends DomElement> T createStableCopy() {
+    XmlTag tag = getXmlTag();
+    if (tag != null && tag.isPhysical()) {
+      final DomElement existing = myManager.getDomElement(tag);
+      assert existing != null : existing + "\n---------\n" + tag.getParent().getText() + "\n-----------\n" + tag.getText();
+      assert getProxy().equals(existing) : existing + "\n---------\n" + tag.getParent().getText() + "\n-----------\n" + tag.getText() + "\n----\n" + this + " != " +
+                                           DomManagerImpl.getDomInvocationHandler(existing);
+      final SmartPsiElementPointer<XmlTag> pointer = SmartPointerManager.getInstance(myManager.getProject()).createLazyPointer(tag);
+      return myManager.createStableValue(new StableCopyFactory<T>(pointer, myType, getClass()));
+    }
+    return (T)createPathStableCopy();
+  }
+
+  protected DomElement createPathStableCopy() {
+    throw new UnsupportedOperationException();
+  }
+
+  public final <T extends DomElement> T createMockCopy(final boolean physical) {
+    final T copy = myManager.createMockElement((Class<? extends T>)getRawType(), getProxy().getModule(), physical);
+    copy.copyFrom(getProxy());
+    return copy;
+  }
+
+  @NotNull
+  public String getXmlElementNamespace() {
+    final DomInvocationHandler parent = getParentHandler();
+    assert parent != null : "this operation should be performed on the DOM having a physical parent, your DOM may be not very fresh";
+    final XmlElement element = parent.getXmlElement();
+    assert element != null;
+    return getXmlName().getNamespace(element, getFile());
+  }
+
+  @Nullable
+  public String getXmlElementNamespaceKey() {
+    return getXmlName().getXmlName().getNamespaceKey();
+  }
+
+  public final Module getModule() {
+    final Module module = ModuleUtil.findModuleForPsiElement(getFile());
+    return module != null ? module : DomUtil.getFile(this).getUserData(DomManagerImpl.MOCK_ELEMENT_MODULE);
+  }
+
+  public XmlTag ensureTagExists() {
+    assertValid();
+
+    XmlTag tag = getXmlTag();
+    if (tag != null) return tag;
+
+    tag = setEmptyXmlTag();
+    setXmlElement(tag);
+
+    final DomElement element = getProxy();
+    myManager.fireEvent(new DomEvent(element, true));
+    addRequiredChildren();
+    myManager.cacheHandler(getCacheKey(), tag, this);
+    return getXmlTag();
+  }
+
+  public XmlElement getXmlElement() {
+    return getParentStrategy().getXmlElement();
+  }
+
+  public boolean exists() {
+    return getParentStrategy().isPhysical();
+  }
+
+  private DomParentStrategy getParentStrategy() {
+    myParentStrategy = myParentStrategy.refreshStrategy(this);
+    return myParentStrategy;
+  }
+
+  public XmlElement ensureXmlElementExists() {
+    return ensureTagExists();
+  }
+
+  protected final XmlTag createChildTag(final EvaluatedXmlName tagName) {
+    final String localName = tagName.getXmlName().getLocalName();
+    if (localName.contains(":")) {
+      try {
+        return XmlElementFactory.getInstance(myManager.getProject()).createTagFromText("<" + localName + "/>");
+      }
+      catch (IncorrectOperationException e) {
+        LOG.error(e);
+      }
+    }
+
+    final XmlElement element = getXmlElement();
+    assert element != null;
+    return getXmlTag().createChildTag(localName, tagName.getNamespace(element, getFile()), null, false);
+  }
+
+  public final boolean isValid() {
+    return checkValidity() == null;
+  }
+
+  String toStringEx() {
+    return myType.toString() + " @" + hashCode() + "&handler=" + super.toString() + "&cd=" + myChildDescription + "&ps=" + myParentStrategy;
+  }
+
+  @Nullable
+  protected String checkValidity() {
+    ProgressManager.checkCanceled();
+    final DomParentStrategy parentStrategy = getParentStrategy();
+    String error = parentStrategy.checkValidity();
+    if (error != null) {
+      return "Strategy: " + error;
+    }
+
+    final long modCount = myManager.getPsiModificationCount();
+    if (myLastModCount == modCount) {
+      return null;
+    }
+
+    final XmlElement xmlElement = parentStrategy.getXmlElement();
+    if (xmlElement != null) {
+      final DomInvocationHandler actual = myManager.getDomHandler(xmlElement);
+      if (!equals(actual)) {
+        return "element changed: " + this.toStringEx() + "!=" + (actual == null ? null : actual.toStringEx());
+      }
+      myLastModCount = modCount;
+      return null;
+    }
+
+    final DomInvocationHandler parent = getParentHandler();
+    if (parent == null) {
+      return "no parent: " + getDomElementType();
+    }
+
+    error = parent.checkValidity();
+    if (error != null) {
+      return "parent: " + error;
+    }
+
+    myLastModCount = modCount;
+    return null;
+  }
+
+
+  @NotNull
+  public final DomGenericInfoEx getGenericInfo() {
+    return myGenericInfo;
+  }
+
+  protected abstract void undefineInternal();
+
+  public final void undefine() {
+    undefineInternal();
+  }
+
+  protected final void deleteTag(final XmlTag tag) {
+    final boolean changing = myManager.setChanging(true);
+    try {
+      tag.delete();
+    }
+    catch (IncorrectOperationException e) {
+      LOG.error(e);
+    }
+    finally {
+      myManager.setChanging(changing);
+    }
+  }
+
+  protected final void fireUndefinedEvent() {
+    myManager.fireEvent(new DomEvent(getProxy(), false));
+  }
+
+  protected abstract XmlTag setEmptyXmlTag();
+
+  protected void addRequiredChildren() {
+    for (final AbstractDomChildrenDescription description : getGenericInfo().getChildrenDescriptions()) {
+      if (description instanceof DomAttributeChildDescription) {
+        final Required required = description.getAnnotation(Required.class);
+
+        if (required != null && required.value()) {
+          description.getValues(getProxy()).get(0).ensureXmlElementExists();
+        }
+      }
+      else if (description instanceof DomFixedChildDescription) {
+        final DomFixedChildDescription childDescription = (DomFixedChildDescription)description;
+        List<? extends DomElement> values = null;
+        final int count = childDescription.getCount();
+        for (int i = 0; i < count; i++) {
+          final Required required = childDescription.getAnnotation(i, Required.class);
+          if (required != null && required.value()) {
+            if (values == null) {
+              values = description.getValues(getProxy());
+            }
+            values.get(i).ensureTagExists();
+          }
+        }
+      }
+    }
+  }
+
+  @NotNull
+  public final String getXmlElementName() {
+    return myTagName.getXmlName().getLocalName();
+  }
+
+  @NotNull
+  public final EvaluatedXmlName getXmlName() {
+    return myTagName;
+  }
+
+  public void accept(final DomElementVisitor visitor) {
+    ProgressManager.checkCanceled();
+    myManager.getApplicationComponent().getVisitorDescription(visitor.getClass()).acceptElement(visitor, getProxy());
+  }
+
+  @SuppressWarnings("ForLoopReplaceableByForEach")
+  public void acceptChildren(DomElementVisitor visitor) {
+    ProgressManager.checkCanceled();
+    final DomElement element = getProxy();
+    List<? extends AbstractDomChildrenDescription> descriptions = getGenericInfo().getChildrenDescriptions();
+    for (int i = 0, descriptionsSize = descriptions.size(); i < descriptionsSize; i++) {
+      AbstractDomChildrenDescription description = descriptions.get(i);
+      List<? extends DomElement> values = description.getValues(element);
+      for (int j = 0, valuesSize = values.size(); j < valuesSize; j++) {
+        DomElement value = values.get(j);
+        value.accept(visitor);
+      }
+    }
+  }
+
+  @NotNull
+  protected final Converter getScalarConverter() {
+    Converter converter = myScalarConverter;
+    if (converter == null) {
+      converter = myScalarConverter = createConverter(ourGetValue);
+    }
+    return converter;
+  }
+
+  @NotNull
+  private Converter createConverter(final JavaMethod method) {
+    final Type returnType = method.getGenericReturnType();
+    final Type type = returnType == void.class ? method.getGenericParameterTypes()[0] : returnType;
+    final Class parameter = ReflectionUtil.substituteGenericType(type, myType);
+    if (parameter == null) {
+      LOG.error(type + " " + myType);
+    }
+    Converter converter = getConverter(new AnnotatedElement() {
+      @Override
+      public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+        return myInvocationCache.getMethodAnnotation(method, annotationClass);
+      }
+    }, parameter);
+    if (converter == null && type instanceof TypeVariable) {
+      converter = getConverter(this, DomUtil.getGenericValueParameter(myType));
+    }
+    if (converter == null) {
+      converter =  myManager.getConverterManager().getConverterByClass(parameter);
+    }
+    if (converter == null) {
+      throw new AssertionError("No converter specified: String<->" + parameter.getName() + "; method=" + method + "; place=" + myChildDescription);
+    }
+    return converter;
+  }
+
+  public final T getChildDescription() {
+    return myChildDescription;
+  }
+
+  @Nullable
+  public <T extends Annotation> T getAnnotation(final Class<T> annotationClass) {
+    final AnnotatedElement childDescription = getChildDescription();
+    if (childDescription != null) {
+      final T annotation = childDescription.getAnnotation(annotationClass);
+      if (annotation != null) return annotation;
+    }
+
+    return getClassAnnotation(annotationClass);
+  }
+
+  protected <T extends Annotation> T getClassAnnotation(Class<T> annotationClass) {
+    return myInvocationCache.getClassAnnotation(annotationClass);
+  }
+
+  @Nullable
+  private Converter getConverter(final AnnotatedElement annotationProvider,
+                                 Class parameter) {
+    final Resolve resolveAnnotation = annotationProvider.getAnnotation(Resolve.class);
+    if (resolveAnnotation != null) {
+      final Class<? extends DomElement> aClass = resolveAnnotation.value();
+      if (!DomElement.class.equals(aClass)) {
+        return DomResolveConverter.createConverter(aClass);
+      } else {
+        LOG.assertTrue(parameter != null, "You should specify @Resolve#value() parameter");
+        return DomResolveConverter.createConverter(parameter);
+      }
+    }
+
+    final ConverterManager converterManager = myManager.getConverterManager();
+    Convert convertAnnotation = annotationProvider.getAnnotation(Convert.class);
+    if (convertAnnotation != null) {
+      if (convertAnnotation instanceof ConvertAnnotationImpl) {
+        return ((ConvertAnnotationImpl)convertAnnotation).getConverter();
+      }
+      return converterManager.getConverterInstance(convertAnnotation.value());
+    }
+
+    return null;
+  }
+
+  @NotNull
+  public final DomElement getProxy() {
+    return myProxy;
+  }
+
+  @NotNull
+  public final XmlFile getFile() {
+    return getParentStrategy().getContainingFile(this);
+  }
+
+  @NotNull
+  public DomNameStrategy getNameStrategy() {
+    final Class<?> rawType = getRawType();
+    final DomNameStrategy strategy = DomImplUtil.getDomNameStrategy(rawType, isAttribute());
+    if (strategy != null) {
+      return strategy;
+    }
+    final DomInvocationHandler handler = getParentHandler();
+    return handler == null ? DomNameStrategy.HYPHEN_STRATEGY : handler.getNameStrategy();
+  }
+
+  protected boolean isAttribute() {
+    return false;
+  }
+
+  @NotNull
+  public ElementPresentation getPresentation() {
+    ElementPresentationTemplate template = getChildDescription().getPresentationTemplate();
+    if (template != null) {
+      return template.createPresentation(getProxy());
+    }
+    return new ElementPresentation() {
+      public String getElementName() {
+        return ElementPresentationManager.getElementName(getProxy());
+      }
+
+      public String getTypeName() {
+        return ElementPresentationManager.getTypeNameForObject(getProxy());
+      }
+
+      public Icon getIcon() {
+        return ElementPresentationManager.getIconOld(getProxy());
+      }
+    };
+  }
+
+  public final GlobalSearchScope getResolveScope() {
+    return DomUtil.getFile(this).getResolveScope();
+  }
+
+  private static <T extends DomElement> T _getParentOfType(Class<T> requiredClass, DomElement element) {
+    while (element != null && !requiredClass.isInstance(element)) {
+      element = element.getParent();
+    }
+    return (T)element;
+  }
+
+  public final <T extends DomElement> T getParentOfType(Class<T> requiredClass, boolean strict) {
+    return _getParentOfType(requiredClass, strict ? getParent() : getProxy());
+  }
+
+  @NotNull
+  final IndexedElementInvocationHandler getFixedChild(final Pair<FixedChildDescriptionImpl, Integer> info) {
+    final FixedChildDescriptionImpl description = info.first;
+    XmlName xmlName = description.getXmlName();
+    final EvaluatedXmlName evaluatedXmlName = createEvaluatedXmlName(xmlName);
+    if (myStub != null && description.isStubbed()) {
+      List<DomStub> stubs = myStub.getChildrenByName(xmlName.getLocalName(), xmlName.getNamespaceKey());
+      DomStub stub = stubs.isEmpty() ? null : stubs.get(0);
+      DomParentStrategy strategy = stub == null ? new StubParentStrategy.Empty(myStub) : new StubParentStrategy(stub);
+      return new IndexedElementInvocationHandler(evaluatedXmlName, description, 0, strategy, myManager, (ElementStub)stub);
+    }
+    final XmlTag tag = getXmlTag();
+    final int index = info.second;
+    if (tag != null) {
+      if (!tag.isValid()) {
+        throw new PsiInvalidElementAccessException(tag);
+      }
+      final XmlTag[] subTags = tag.getSubTags();
+      for (int i = 0, subTagsLength = subTags.length; i < subTagsLength; i++) {
+        XmlTag xmlTag = subTags[i];
+        if (!xmlTag.isValid()) {
+          throw new PsiInvalidElementAccessException(xmlTag,
+                                                     "invalid children of valid tag: " + tag.getText() + "; subtag=" + xmlTag + "; index=" + i);
+        }
+      }
+      final List<XmlTag> tags = DomImplUtil.findSubTags(subTags, evaluatedXmlName, getFile());
+      if (tags.size() > index) {
+        final XmlTag child = tags.get(index);
+        final IndexedElementInvocationHandler semElement = myManager.getSemService().getSemElement(DomManagerImpl.DOM_INDEXED_HANDLER_KEY, child);
+        if (semElement == null) {
+          final IndexedElementInvocationHandler take2 = myManager.getSemService().getSemElement(DomManagerImpl.DOM_INDEXED_HANDLER_KEY, child);
+          throw new AssertionError("No DOM at XML. Parent=" + tag + "; child=" + child + "; index=" + index+ "; second attempt=" + take2);
+
+        }
+        return semElement;
+      }
+    }
+    return new IndexedElementInvocationHandler(evaluatedXmlName, description, index, new VirtualDomParentStrategy(this), myManager, null);
+  }
+
+  @NotNull
+  final AttributeChildInvocationHandler getAttributeChild(final AttributeChildDescriptionImpl description) {
+    final EvaluatedXmlName evaluatedXmlName = createEvaluatedXmlName(description.getXmlName());
+    if (myStub != null && description.isStubbed()) {
+      AttributeStub stub = myStub.getAttributeStub(description.getXmlName());
+      StubParentStrategy strategy = StubParentStrategy.createAttributeStrategy(stub, myStub);
+      return new AttributeChildInvocationHandler(evaluatedXmlName, description, myManager, strategy, stub);
+    }
+    final XmlTag tag = getXmlTag();
+    
+    if (tag != null) {
+      // TODO: this seems ugly
+      String ns = evaluatedXmlName.getNamespace(tag, getFile());
+      final XmlAttribute attribute = tag.getAttribute(description.getXmlName().getLocalName(), ns.equals(tag.getNamespace())? null:ns);
+      
+      if (attribute != null) {
+        LOG.assertTrue(attribute.isValid());
+        return myManager.getSemService().getSemElement(DomManagerImpl.DOM_ATTRIBUTE_HANDLER_KEY, attribute);
+      }
+    }
+    return new AttributeChildInvocationHandler(evaluatedXmlName, description, myManager, new VirtualDomParentStrategy(this), null);
+  }
+
+  @Nullable
+  public final Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+    try {
+      return findInvocation(method).invoke(this, args);
+    }
+    catch (InvocationTargetException ex) {
+      throw ex.getTargetException();
+    }
+  }
+
+  @NotNull
+  private Invocation findInvocation(Method method) {
+    Invocation invocation = myAccessorInvocations.get(method);
+    if (invocation != null) return invocation;
+
+    invocation = myInvocationCache.getInvocation(method);
+    if (invocation != null) return invocation;
+
+    JavaMethod javaMethod = myInvocationCache.getInternedMethod(method);
+    invocation = myGenericInfo.createInvocation(javaMethod);
+    if (invocation != null) {
+      myInvocationCache.putInvocation(method, invocation);
+      return invocation;
+    }
+
+    if (myInvocationCache.isTagValueGetter(javaMethod)) {
+      invocation = new GetInvocation(createConverter(javaMethod));
+    }
+    else if (myInvocationCache.isTagValueSetter(javaMethod)) {
+      invocation = new SetInvocation(createConverter(javaMethod));
+    }
+    else {
+      throw new RuntimeException("No implementation for method " + method.toString() + " in class " + myType);
+    }
+    myAccessorInvocations = myAccessorInvocations.plus(method, invocation);
+    return invocation;
+  }
+
+  private static void setTagValue(final XmlTag tag, final String value) {
+    tag.getValue().setText(value);
+  }
+
+  private static String getTagValue(final XmlTag tag) {
+    return tag.getValue().getTrimmedText();
+  }
+
+  public final String toString() {
+    if (ReflectionCache.isAssignable(GenericValue.class, getRawType())) {
+      return ((GenericValue)getProxy()).getStringValue();
+    }
+    return myType.toString() + " @" + hashCode();
+  }
+
+  protected final Class<?> getRawType() {
+    return ReflectionUtil.getRawType(myType);
+  }
+
+  @Nullable
+  public XmlTag getXmlTag() {
+    return (XmlTag) getXmlElement();
+  }
+
+  @Nullable
+  protected XmlElement recomputeXmlElement(@NotNull final DomInvocationHandler parentHandler) {
+    return null;
+  }
+
+  protected final void detach() {
+    setXmlElement(null);
+  }
+
+  final SemKey getCacheKey() {
+    if (this instanceof AttributeChildInvocationHandler) {
+      return DomManagerImpl.DOM_ATTRIBUTE_HANDLER_KEY;
+    }
+    if (this instanceof DomRootInvocationHandler) {
+      return DomManagerImpl.DOM_HANDLER_KEY;
+    }
+    if (this instanceof IndexedElementInvocationHandler) {
+      return DomManagerImpl.DOM_INDEXED_HANDLER_KEY;
+    }
+
+    if (getChildDescription() instanceof CustomDomChildrenDescription) {
+      return DomManagerImpl.DOM_CUSTOM_HANDLER_KEY;
+    }
+
+    return DomManagerImpl.DOM_COLLECTION_HANDLER_KEY;
+  }
+
+  protected final void setXmlElement(final XmlElement element) {
+    refreshGenericInfo(element != null && !isAttribute());
+    myParentStrategy = element == null ? myParentStrategy.clearXmlElement() : myParentStrategy.setXmlElement(element);
+  }
+
+  private void refreshGenericInfo(final boolean dynamic) {
+    final StaticGenericInfo staticInfo = myManager.getApplicationComponent().getStaticGenericInfo(myType);
+    myGenericInfo = dynamic ? new DynamicGenericInfo(this, staticInfo) : staticInfo;
+  }
+
+  @NotNull
+  public final DomManagerImpl getManager() {
+    return myManager;
+  }
+
+  public final DomElement addCollectionChild(final CollectionChildDescriptionImpl description, final Type type, int index) throws IncorrectOperationException {
+    final EvaluatedXmlName name = createEvaluatedXmlName(description.getXmlName());
+    final XmlTag tag = addEmptyTag(name, index);
+    final CollectionElementInvocationHandler handler = new CollectionElementInvocationHandler(type, tag, description, this, null);
+    myManager.fireEvent(new DomEvent(getProxy(), false));
+    getManager().getTypeChooserManager().getTypeChooser(description.getType()).distinguishTag(tag, type);
+    handler.addRequiredChildren();
+    return handler.getProxy();
+  }
+
+  protected final void createFixedChildrenTags(EvaluatedXmlName tagName, FixedChildDescriptionImpl description, int count) {
+    final XmlTag tag = ensureTagExists();
+    final List<XmlTag> subTags = DomImplUtil.findSubTags(tag, tagName, getFile());
+    if (subTags.size() < count) {
+      getFixedChild(Pair.create(description, count - 1)).ensureTagExists();
+    }
+  }
+
+  private XmlTag addEmptyTag(final EvaluatedXmlName tagName, int index) throws IncorrectOperationException {
+    final XmlTag tag = ensureTagExists();
+    final List<XmlTag> subTags = DomImplUtil.findSubTags(tag, tagName, getFile());
+    if (subTags.size() < index) {
+      index = subTags.size();
+    }
+    final boolean changing = myManager.setChanging(true);
+    try {
+      XmlTag newTag = createChildTag(tagName);
+      if (index == 0) {
+        if (subTags.isEmpty()) {
+          return (XmlTag)tag.add(newTag);
+        }
+
+        return (XmlTag)tag.addBefore(newTag, subTags.get(0));
+      }
+
+      return (XmlTag)tag.addAfter(newTag, subTags.get(index - 1));
+    }
+    finally {
+      myManager.setChanging(changing);
+    }
+  }
+
+  @NotNull
+  public final EvaluatedXmlName createEvaluatedXmlName(final XmlName xmlName) {
+    return getXmlName().evaluateChildName(xmlName);
+  }
+
+  public List<? extends DomElement> getCollectionChildren(final AbstractCollectionChildDescription description, final NotNullFunction<DomInvocationHandler, List<XmlTag>> tagsGetter) {
+    if (myStub != null && description.isStubbed()) {
+      if (description instanceof DomChildDescriptionImpl) {
+        XmlName xmlName = ((DomChildDescriptionImpl)description).getXmlName();
+        List<DomStub> stubs = myStub.getChildrenByName(xmlName.getLocalName(), xmlName.getNamespaceKey());
+        return ContainerUtil.map(stubs, new Function<DomStub, DomElement>() {
+          @Override
+          public DomElement fun(DomStub stub) {
+            return stub.getOrCreateHandler((DomChildDescriptionImpl)description, myManager).getProxy();
+          }
+        });
+      }
+      else if (description instanceof CustomDomChildrenDescriptionImpl) {
+        List<DomStub> stubs = myStub.getChildrenStubs();
+        return ContainerUtil.mapNotNull(stubs, new NullableFunction<DomStub, DomElement>() {
+          @Nullable
+          @Override
+          public DomElement fun(DomStub stub) {
+            if (stub instanceof ElementStub && ((ElementStub)stub).isCustom()) {
+              EvaluatedXmlName name = new DummyEvaluatedXmlName(stub.getName(), "");
+              return new CollectionElementInvocationHandler(name, (CustomDomChildrenDescriptionImpl)description, myManager, (ElementStub)stub).getProxy();
+            }
+            return null;
+          }
+        });
+      }
+    }
+    XmlTag tag = getXmlTag();
+    if (tag == null) return Collections.emptyList();
+
+    final List<XmlTag> subTags = tagsGetter.fun(this);
+    if (subTags.isEmpty()) return Collections.emptyList();
+
+    List<DomElement> elements = new ArrayList<DomElement>(subTags.size());
+    for (XmlTag subTag : subTags) {
+      final SemKey<? extends DomInvocationHandler> key = description instanceof CustomDomChildrenDescription ? DomManagerImpl.DOM_CUSTOM_HANDLER_KEY : DomManagerImpl.DOM_COLLECTION_HANDLER_KEY;
+      final DomInvocationHandler semElement = myManager.getSemService().getSemElement(key, subTag);
+      if (semElement == null) {
+        myManager.getSemService().getSemElement(key, subTag);
+        throw new AssertionError("No child for subTag '" + subTag.getName() + "' in tag '" + tag.getName() +"' using key " + key);
+      }
+      else {
+        elements.add(semElement.getProxy());
+      }
+    }
+    return Collections.unmodifiableList(elements);
+  }
+
+  private static class StableCopyFactory<T extends DomElement> implements NullableFactory<T> {
+    private final SmartPsiElementPointer<XmlTag> myPointer;
+    private final Type myType;
+    private final Class<? extends DomInvocationHandler> myHandlerClass;
+
+    public StableCopyFactory(final SmartPsiElementPointer<XmlTag> pointer,
+                             final Type type, final Class<? extends DomInvocationHandler> aClass) {
+      myPointer = pointer;
+      myType = type;
+      myHandlerClass = aClass;
+    }
+
+    public T create() {
+      final XmlTag tag = myPointer.getElement();
+      if (tag == null || !tag.isValid()) return null;
+
+      final DomElement element = DomManager.getDomManager(tag.getProject()).getDomElement(tag);
+      if (element == null || !element.getDomElementType().equals(myType)) return null;
+
+      final DomInvocationHandler handler = DomManagerImpl.getDomInvocationHandler(element);
+      if (handler == null || !handler.getClass().equals(myHandlerClass)) return null;
+
+      return (T)element;
+    }
+  }
+
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (o == null || !o.getClass().equals(getClass())) return false;
+
+    final DomInvocationHandler that = (DomInvocationHandler)o;
+    if (!myChildDescription.equals(that.myChildDescription)) return false;
+    if (!getParentStrategy().equals(that.getParentStrategy())) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    return myChildDescription.hashCode();
+  }
+}
+
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomManagerImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomManagerImpl.java
new file mode 100644
index 0000000..574355c
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomManagerImpl.java
@@ -0,0 +1,513 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.ide.highlighter.DomSupportEnabled;
+import com.intellij.ide.startup.StartupManagerEx;
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.ProjectFileIndex;
+import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.startup.StartupManager;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.util.Factory;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.vfs.*;
+import com.intellij.openapi.vfs.newvfs.NewVirtualFile;
+import com.intellij.pom.PomManager;
+import com.intellij.pom.PomModel;
+import com.intellij.pom.PomModelAspect;
+import com.intellij.pom.event.PomModelEvent;
+import com.intellij.pom.event.PomModelListener;
+import com.intellij.pom.xml.XmlAspect;
+import com.intellij.pom.xml.XmlChangeSet;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.PsiManagerEx;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.semantic.SemKey;
+import com.intellij.semantic.SemService;
+import com.intellij.util.EventDispatcher;
+import com.intellij.util.SmartList;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.events.DomEvent;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import com.intellij.util.xml.reflect.DomGenericInfo;
+import net.sf.cglib.proxy.AdvancedProxy;
+import net.sf.cglib.proxy.InvocationHandler;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author peter
+ */
+public final class DomManagerImpl extends DomManager {
+  private static final Key<Object> MOCK = Key.create("MockElement");
+  static final Key<WeakReference<DomFileElementImpl>> CACHED_FILE_ELEMENT = Key.create("CACHED_FILE_ELEMENT");
+  static final Key<DomFileDescription> MOCK_DESCRIPTION = Key.create("MockDescription");
+
+  static final SemKey<FileDescriptionCachedValueProvider> FILE_DESCRIPTION_KEY = SemKey.createKey("FILE_DESCRIPTION_KEY");
+  public static final SemKey<DomInvocationHandler> DOM_HANDLER_KEY = SemKey.createKey("DOM_HANDLER_KEY");
+  static final SemKey<IndexedElementInvocationHandler> DOM_INDEXED_HANDLER_KEY = DOM_HANDLER_KEY.subKey("DOM_INDEXED_HANDLER_KEY");
+  static final SemKey<CollectionElementInvocationHandler> DOM_COLLECTION_HANDLER_KEY = DOM_HANDLER_KEY.subKey("DOM_COLLECTION_HANDLER_KEY");
+  static final SemKey<CollectionElementInvocationHandler> DOM_CUSTOM_HANDLER_KEY = DOM_HANDLER_KEY.subKey("DOM_CUSTOM_HANDLER_KEY");
+  static final SemKey<AttributeChildInvocationHandler> DOM_ATTRIBUTE_HANDLER_KEY = DOM_HANDLER_KEY.subKey("DOM_ATTRIBUTE_HANDLER_KEY");
+
+  private final EventDispatcher<DomEventListener> myListeners = EventDispatcher.create(DomEventListener.class);
+  private final ConverterManagerImpl myConverterManager;
+
+  private final GenericValueReferenceProvider myGenericValueReferenceProvider = new GenericValueReferenceProvider();
+
+  private final Project myProject;
+  private final DomApplicationComponent myApplicationComponent;
+  private final PsiFileFactory myFileFactory;
+
+  private long myModificationCount;
+  private boolean myChanging;
+  private final ProjectFileIndex myFileIndex;
+  private final SemService mySemService;
+
+  public DomManagerImpl(final Project project, final XmlAspect xmlAspect) {
+    myProject = project;
+    mySemService = SemService.getSemService(project);
+    myConverterManager = (ConverterManagerImpl)ServiceManager.getService(ConverterManager.class);
+    myApplicationComponent = DomApplicationComponent.getInstance();
+    final PomModel pomModel = PomManager.getModel(project);
+    pomModel.addModelListener(new PomModelListener() {
+      public void modelChanged(PomModelEvent event) {
+        final XmlChangeSet changeSet = (XmlChangeSet)event.getChangeSet(xmlAspect);
+        if (changeSet != null && !myChanging) {
+          for (XmlFile file : changeSet.getChangedFiles()) {
+            DomFileElementImpl<DomElement> element = getCachedFileElement(file);
+            if (element != null) {
+              fireEvent(new DomEvent(element, false));
+            }
+          }
+        }
+      }
+
+      public boolean isAspectChangeInteresting(PomModelAspect aspect) {
+        return xmlAspect.equals(aspect);
+      }
+    }, project);
+
+    myFileFactory = PsiFileFactory.getInstance(project);
+
+    final PsiManager psiManager = PsiManager.getInstance(project);
+
+    final Runnable setupVfsListeners = new Runnable() {
+      public void run() {
+        final VirtualFileAdapter listener = new VirtualFileAdapter() {
+          private final List<DomEvent> myDeletionEvents = new SmartList<DomEvent>();
+
+          public void contentsChanged(VirtualFileEvent event) {
+            if (event.isFromSave()) return;
+
+            processVfsChange(event.getFile());
+          }
+
+          public void fileCreated(VirtualFileEvent event) {
+            processVfsChange(event.getFile());
+          }
+
+          public void beforeFileDeletion(final VirtualFileEvent event) {
+            if (!project.isDisposed()) {
+              beforeFileDeletion(event.getFile());
+            }
+          }
+
+          private void beforeFileDeletion(final VirtualFile file) {
+            if (file.isDirectory() && file instanceof NewVirtualFile) {
+              for (final VirtualFile child : ((NewVirtualFile)file).getCachedChildren()) {
+                beforeFileDeletion(child);
+              }
+              return;
+            }
+
+            if (file.isValid() && StdFileTypes.XML.equals(file.getFileType())) {
+              final PsiFile psiFile = getCachedPsiFile(file);
+              if (psiFile instanceof XmlFile) {
+                Collections.addAll(myDeletionEvents, recomputeFileElement((XmlFile)psiFile));
+              }
+            }
+          }
+
+          public void fileDeleted(VirtualFileEvent event) {
+            if (!myDeletionEvents.isEmpty()) {
+              if (!project.isDisposed()) {
+                for (DomEvent domEvent : myDeletionEvents) {
+                  fireEvent(domEvent);
+                }
+              }
+              myDeletionEvents.clear();
+            }
+          }
+
+          public void propertyChanged(VirtualFilePropertyEvent event) {
+            final VirtualFile file = event.getFile();
+            if (!file.isDirectory() && VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
+              processVfsChange(file);
+            }
+          }
+        };
+        VirtualFileManager.getInstance().addVirtualFileListener(listener, project);
+      }
+    };
+
+    final StartupManager startupManager = StartupManager.getInstance(project);
+    if (!((StartupManagerEx)startupManager).startupActivityPassed()) {
+      startupManager.registerStartupActivity(setupVfsListeners);
+    } else {
+      setupVfsListeners.run();
+    }
+
+    myFileIndex = ProjectRootManager.getInstance(project).getFileIndex();
+  }
+
+  private void processVfsChange(final VirtualFile file) {
+    processFileOrDirectoryChange(file);
+  }
+
+  public long getPsiModificationCount() {
+    return PsiManager.getInstance(getProject()).getModificationTracker().getModificationCount();
+  }
+
+  public <T extends DomInvocationHandler> void cacheHandler(SemKey<T> key, XmlElement element, T handler) {
+    mySemService.setCachedSemElement(key, element, handler);
+  }
+
+  private void processFileChange(final VirtualFile file) {
+    if (StdFileTypes.XML != file.getFileType()) return;
+    processFileChange(getCachedPsiFile(file));
+  }
+
+  private PsiFile getCachedPsiFile(VirtualFile file) {
+    return ((PsiManagerEx)PsiManager.getInstance(myProject)).getFileManager().getCachedPsiFile(file);
+  }
+
+  private void processFileChange(final PsiFile file) {
+    if (file != null && StdFileTypes.XML.equals(file.getFileType()) && file instanceof XmlFile) {
+      for (final DomEvent event : recomputeFileElement((XmlFile)file)) {
+        fireEvent(event);
+      }
+    }
+  }
+
+  static DomEvent[] recomputeFileElement(final XmlFile file) {
+    final DomFileElementImpl oldElement = getCachedFileElement(file);
+    return oldElement == null ? DomEvent.EMPTY_ARRAY : new DomEvent[]{new DomEvent(oldElement, false)};
+  }
+
+  private void processDirectoryChange(final VirtualFile directory) {
+    for (final VirtualFile file : directory.getChildren()) {
+      processFileOrDirectoryChange(file);
+    }
+  }
+
+  private void processFileOrDirectoryChange(final VirtualFile file) {
+    if (!myFileIndex.isInContent(file)) return;
+    if (!file.isDirectory()) {
+      processFileChange(file);
+    } else {
+      processDirectoryChange(file);
+    }
+  }
+
+  @SuppressWarnings({"MethodOverridesStaticMethodOfSuperclass"})
+  public static DomManagerImpl getDomManager(Project project) {
+    return (DomManagerImpl)DomManager.getDomManager(project);
+  }
+
+  public void addDomEventListener(DomEventListener listener, Disposable parentDisposable) {
+    myListeners.addListener(listener, parentDisposable);
+  }
+
+  public final ConverterManager getConverterManager() {
+    return myConverterManager;
+  }
+
+  public final void addPsiReferenceFactoryForClass(Class clazz, PsiReferenceFactory psiReferenceFactory) {
+    myGenericValueReferenceProvider.addReferenceProviderForClass(clazz, psiReferenceFactory);
+  }
+
+  public final ModelMerger createModelMerger() {
+    return new ModelMergerImpl();
+  }
+
+  final void fireEvent(DomEvent event) {
+    if (mySemService.isInsideAtomicChange()) return;
+    myModificationCount++;
+    myListeners.getMulticaster().eventOccured(event);
+  }
+
+  public final DomGenericInfo getGenericInfo(final Type type) {
+    return myApplicationComponent.getStaticGenericInfo(type);
+  }
+
+  @Nullable
+  public static DomInvocationHandler getDomInvocationHandler(DomElement proxy) {
+    if (proxy instanceof DomFileElement) {
+      return null;
+    }
+    if (proxy instanceof DomInvocationHandler) {
+      return (DomInvocationHandler)proxy;
+    }
+    final InvocationHandler handler = AdvancedProxy.getInvocationHandler(proxy);
+    if (handler instanceof StableInvocationHandler) {
+      final DomElement element = ((StableInvocationHandler<DomElement>)handler).getWrappedElement();
+      return element == null ? null : getDomInvocationHandler(element);
+    }
+    if (handler instanceof DomInvocationHandler) {
+      return (DomInvocationHandler)handler;
+    }
+    return null;
+  }
+
+  @NotNull
+  public static DomInvocationHandler getNotNullHandler(DomElement proxy) {
+    DomInvocationHandler handler = getDomInvocationHandler(proxy);
+    if (handler == null) {
+      throw new AssertionError("null handler for " + proxy);
+    }
+    return handler;
+  }
+
+  public static StableInvocationHandler getStableInvocationHandler(Object proxy) {
+    return (StableInvocationHandler)AdvancedProxy.getInvocationHandler(proxy);
+  }
+
+  public DomApplicationComponent getApplicationComponent() {
+    return myApplicationComponent;
+  }
+
+  public final Project getProject() {
+    return myProject;
+  }
+
+  @NotNull
+  public final <T extends DomElement> DomFileElementImpl<T> getFileElement(final XmlFile file, final Class<T> aClass, String rootTagName) {
+    //noinspection unchecked
+    if (file.getUserData(MOCK_DESCRIPTION) == null) {
+      file.putUserData(MOCK_DESCRIPTION, new MockDomFileDescription<T>(aClass, rootTagName, file));
+      mySemService.clearCache();
+    }
+    final DomFileElementImpl<T> fileElement = getFileElement(file);
+    assert fileElement != null;
+    return fileElement;
+  }
+
+
+  @SuppressWarnings({"unchecked"})
+  @NotNull
+  final <T extends DomElement> FileDescriptionCachedValueProvider<T> getOrCreateCachedValueProvider(final XmlFile xmlFile) {
+    return mySemService.getSemElement(FILE_DESCRIPTION_KEY, xmlFile);
+  }
+
+  public final Set<DomFileDescription> getFileDescriptions(String rootTagName) {
+    return myApplicationComponent.getFileDescriptions(rootTagName);
+  }
+
+  public final Set<DomFileDescription> getAcceptingOtherRootTagNameDescriptions() {
+    return myApplicationComponent.getAcceptingOtherRootTagNameDescriptions();
+  }
+
+  @NotNull
+  @NonNls
+  public final String getComponentName() {
+    return getClass().getName();
+  }
+
+  final void runChange(Runnable change) {
+    final boolean b = setChanging(true);
+    try {
+      change.run();
+    }
+    finally {
+      setChanging(b);
+    }
+  }
+
+  final boolean setChanging(final boolean changing) {
+    boolean oldChanging = myChanging;
+    if (changing) {
+      assert !oldChanging;
+    }
+    myChanging = changing;
+    return oldChanging;
+  }
+
+  @Nullable
+  public final <T extends DomElement> DomFileElementImpl<T> getFileElement(XmlFile file) {
+    if (file == null) return null;
+    if (!(file.getFileType() instanceof DomSupportEnabled)) return null;
+    final VirtualFile virtualFile = file.getVirtualFile();
+    if (virtualFile != null && virtualFile.isDirectory()) return null;
+    return this.<T>getOrCreateCachedValueProvider(file).getFileElement();
+  }
+
+  @Nullable
+  static <T extends DomElement> DomFileElementImpl<T> getCachedFileElement(@NotNull XmlFile file) {
+    WeakReference<DomFileElementImpl> ref = file.getUserData(CACHED_FILE_ELEMENT);
+    return ref == null ? null : ref.get();
+  }
+
+  @Nullable
+  public final <T extends DomElement> DomFileElementImpl<T> getFileElement(XmlFile file, Class<T> domClass) {
+    final DomFileDescription description = getDomFileDescription(file);
+    if (description != null && myApplicationComponent.assignabilityCache.isAssignable(domClass, description.getRootElementClass())) {
+      return getFileElement(file);
+    }
+    return null;
+  }
+
+  @Nullable
+  public final DomElement getDomElement(final XmlTag element) {
+    if (myChanging) return null;
+
+    final DomInvocationHandler handler = getDomHandler(element);
+    return handler != null ? handler.getProxy() : null;
+  }
+
+  @Nullable
+  public GenericAttributeValue getDomElement(final XmlAttribute attribute) {
+    if (myChanging) return null;
+
+    final AttributeChildInvocationHandler handler = mySemService.getSemElement(DOM_ATTRIBUTE_HANDLER_KEY, attribute);
+    return handler == null ? null : (GenericAttributeValue)handler.getProxy();
+  }
+
+  @Nullable
+  public DomInvocationHandler getDomHandler(final XmlElement tag) {
+    if (tag == null) return null;
+
+    List<DomInvocationHandler> cached = mySemService.getCachedSemElements(DOM_HANDLER_KEY, tag);
+    if (cached != null && !cached.isEmpty()) {
+      return cached.get(0);
+    }
+
+
+    return mySemService.getSemElement(DOM_HANDLER_KEY, tag);
+  }
+
+  @Nullable
+  public AbstractDomChildrenDescription findChildrenDescription(@NotNull final XmlTag tag, @NotNull final DomElement parent) {
+    return findChildrenDescription(tag, getDomInvocationHandler(parent));
+  }
+
+  static AbstractDomChildrenDescription findChildrenDescription(final XmlTag tag, final DomInvocationHandler parent) {
+    final DomGenericInfoEx info = parent.getGenericInfo();
+    return info.findChildrenDescription(parent, tag.getLocalName(), tag.getNamespace(), false, tag.getName());
+  }
+
+  public final boolean isDomFile(@Nullable PsiFile file) {
+    return file instanceof XmlFile && getFileElement((XmlFile)file) != null;
+  }
+
+  @Nullable
+  public final DomFileDescription<?> getDomFileDescription(PsiElement element) {
+    if (element instanceof XmlElement) {
+      final PsiFile psiFile = element.getContainingFile();
+      if (psiFile instanceof XmlFile) {
+        return getDomFileDescription((XmlFile)psiFile);
+      }
+    }
+    return null;
+  }
+
+  public final <T extends DomElement> T createMockElement(final Class<T> aClass, final Module module, final boolean physical) {
+    final XmlFile file = (XmlFile)myFileFactory.createFileFromText("a.xml", StdFileTypes.XML, "", (long)0, physical);
+    file.putUserData(MOCK_ELEMENT_MODULE, module);
+    file.putUserData(MOCK, new Object());
+    return getFileElement(file, aClass, "I_sincerely_hope_that_nobody_will_have_such_a_root_tag_name").getRootElement();
+  }
+
+  public final boolean isMockElement(DomElement element) {
+    return DomUtil.getFile(element).getUserData(MOCK) != null;
+  }
+
+  public final <T extends DomElement> T createStableValue(final Factory<T> provider) {
+    return createStableValue(provider, new Condition<T>() {
+      public boolean value(T t) {
+        return t.isValid();
+      }
+    });
+  }
+
+  public final <T> T createStableValue(final Factory<T> provider, final Condition<T> validator) {
+    final T initial = provider.create();
+    assert initial != null;
+    final StableInvocationHandler handler = new StableInvocationHandler<T>(initial, provider, validator);
+
+    final Set<Class> intf = new HashSet<Class>();
+    ContainerUtil.addAll(intf, initial.getClass().getInterfaces());
+    intf.add(StableElement.class);
+    //noinspection unchecked
+
+    return (T)AdvancedProxy.createProxy(initial.getClass().getSuperclass(), intf.toArray(new Class[intf.size()]),
+                                        handler);
+  }
+
+  public final <T extends DomElement> void registerFileDescription(final DomFileDescription<T> description, Disposable parentDisposable) {
+    registerFileDescription(description);
+    Disposer.register(parentDisposable, new Disposable() {
+      public void dispose() {
+        getFileDescriptions(description.getRootTagName()).remove(description);
+        getAcceptingOtherRootTagNameDescriptions().remove(description);
+      }
+    });
+  }
+
+  public final void registerFileDescription(final DomFileDescription description) {
+    mySemService.clearCache();
+
+    myApplicationComponent.registerFileDescription(description);
+  }
+
+  @NotNull
+  public final DomElement getResolvingScope(GenericDomValue element) {
+    final DomFileDescription description = DomUtil.getFileElement(element).getFileDescription();
+    return description.getResolveScope(element);
+  }
+
+  @Nullable
+  public final DomElement getIdentityScope(DomElement element) {
+    final DomFileDescription description = DomUtil.getFileElement(element).getFileDescription();
+    return description.getIdentityScope(element);
+  }
+
+  public TypeChooserManager getTypeChooserManager() {
+    return myApplicationComponent.getTypeChooserManager();
+  }
+
+  public long getModificationCount() {
+    return myModificationCount + PsiManager.getInstance(myProject).getModificationTracker().getOutOfCodeBlockModificationCount();
+  }
+
+  public void performAtomicChange(@NotNull Runnable change) {
+    mySemService.performAtomicChange(change);
+    if (!mySemService.isInsideAtomicChange()) {
+      myModificationCount++;
+    }
+  }
+
+  public SemService getSemService() {
+    return mySemService;
+  }
+
+
+  private final static Logger LOG = Logger.getInstance(DomManagerImpl.class);
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomMetaDataContributor.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomMetaDataContributor.java
new file mode 100644
index 0000000..4e93b54
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomMetaDataContributor.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.filters.ElementFilter;
+import com.intellij.psi.meta.MetaDataContributor;
+import com.intellij.psi.meta.MetaDataRegistrar;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.DomMetaData;
+
+/**
+ * @author yole
+ */
+public class DomMetaDataContributor implements MetaDataContributor {
+  @Override
+  public void contributeMetaData(MetaDataRegistrar registrar) {
+    registrar.registerMetaData(new ElementFilter() {
+      public boolean isAcceptable(Object element, PsiElement context) {
+        if (element instanceof XmlTag) {
+          final XmlTag tag = (XmlTag)element;
+          final DomElement domElement = DomManager.getDomManager(tag.getProject()).getDomElement(tag);
+          if (domElement != null) {
+            return domElement.getGenericInfo().getNameDomElement(domElement) != null;
+          }
+        }
+        return false;
+      }
+
+      public boolean isClassAcceptable(Class hintClass) {
+        return XmlTag.class.isAssignableFrom(hintClass);
+      }
+    }, DomMetaData.class);
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomParentStrategy.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomParentStrategy.java
new file mode 100644
index 0000000..96d373a
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomParentStrategy.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public interface DomParentStrategy {
+  @Nullable DomInvocationHandler getParentHandler();
+
+  @Nullable
+  XmlElement getXmlElement();
+
+  @NotNull DomParentStrategy refreshStrategy(final DomInvocationHandler handler);
+
+  @NotNull DomParentStrategy setXmlElement(@NotNull XmlElement element);
+
+  @NotNull DomParentStrategy clearXmlElement();
+
+  @Nullable
+  String checkValidity();
+
+  XmlFile getContainingFile(DomInvocationHandler handler);
+
+  boolean isPhysical();
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomReferenceContributor.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomReferenceContributor.java
new file mode 100644
index 0000000..8dbfe5f
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomReferenceContributor.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.psi.PsiReferenceContributor;
+import com.intellij.psi.PsiReferenceRegistrar;
+import com.intellij.patterns.XmlPatterns;
+
+/**
+ * @author peter
+ */
+public class DomReferenceContributor extends PsiReferenceContributor{
+  public void registerReferenceProviders(final PsiReferenceRegistrar registrar) {
+    registrar.registerReferenceProvider(XmlPatterns.xmlTag(), new GenericValueReferenceProvider());
+    registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue(), new GenericValueReferenceProvider());
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomRootInvocationHandler.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomRootInvocationHandler.java
new file mode 100644
index 0000000..3974011
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomRootInvocationHandler.java
@@ -0,0 +1,137 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.NullableFactory;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.DomNameStrategy;
+import com.intellij.util.xml.EvaluatedXmlName;
+import com.intellij.util.xml.stubs.ElementStub;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class DomRootInvocationHandler extends DomInvocationHandler<AbstractDomChildDescriptionImpl, ElementStub> {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.impl.DomRootInvocationHandler");
+  private final DomFileElementImpl<?> myParent;
+
+  public DomRootInvocationHandler(final Class aClass,
+                                  final RootDomParentStrategy strategy,
+                                  @NotNull final DomFileElementImpl fileElement,
+                                  @NotNull final EvaluatedXmlName tagName,
+                                  @Nullable ElementStub stub
+  ) {
+    super(aClass, strategy, tagName, new AbstractDomChildDescriptionImpl(aClass) {
+      @NotNull
+      public List<? extends DomElement> getValues(@NotNull final DomElement parent) {
+        throw new UnsupportedOperationException();
+      }
+
+      public int compareTo(final AbstractDomChildDescriptionImpl o) {
+        throw new UnsupportedOperationException();
+      }
+    }, fileElement.getManager(), true, stub);
+    myParent = fileElement;
+  }
+
+  public void undefineInternal() {
+    try {
+      final XmlTag tag = getXmlTag();
+      if (tag != null) {
+        deleteTag(tag);
+        detach();
+        fireUndefinedEvent();
+      }
+    }
+    catch (Exception e) {
+      LOG.error(e);
+    }
+  }
+
+  public boolean equals(final Object obj) {
+    if (!(obj instanceof DomRootInvocationHandler)) return false;
+
+    final DomRootInvocationHandler handler = (DomRootInvocationHandler)obj;
+    return myParent.equals(handler.myParent);
+  }
+
+  public int hashCode() {
+    return myParent.hashCode();
+  }
+
+  @NotNull
+  public String getXmlElementNamespace() {
+    return getXmlName().getNamespace(getFile(), getFile());
+  }
+
+  @Override
+  protected String checkValidity() {
+    final XmlTag tag = (XmlTag)getXmlElement();
+    if (tag != null && !tag.isValid()) {
+      return "invalid root tag";
+    }
+
+    final String s = myParent.checkValidity();
+    if (s != null) {
+      return "root: " + s;
+    }
+
+    return null;
+  }
+
+  @NotNull
+  public DomFileElementImpl getParent() {
+    return myParent;
+  }
+
+  public DomElement createPathStableCopy() {
+    final DomFileElement stableCopy = myParent.createStableCopy();
+    return getManager().createStableValue(new NullableFactory<DomElement>() {
+      public DomElement create() {
+        return stableCopy.isValid() ? stableCopy.getRootElement() : null;
+      }
+    });
+  }
+
+  protected XmlTag setEmptyXmlTag() {
+    final XmlTag[] result = new XmlTag[]{null};
+    getManager().runChange(new Runnable() {
+      public void run() {
+        try {
+          final String namespace = getXmlElementNamespace();
+          @NonNls final String nsDecl = StringUtil.isEmpty(namespace) ? "" : " xmlns=\"" + namespace + "\"";
+          final XmlFile xmlFile = getFile();
+          final XmlTag tag = XmlElementFactory.getInstance(xmlFile.getProject()).createTagFromText("<" + getXmlElementName() + nsDecl + "/>");
+          result[0] = ((XmlDocument)xmlFile.getDocument().replace(((XmlFile)tag.getContainingFile()).getDocument())).getRootTag();
+        }
+        catch (IncorrectOperationException e) {
+          LOG.error(e);
+        }
+      }
+    });
+    return result[0];
+  }
+
+  @NotNull
+  public final DomNameStrategy getNameStrategy() {
+    final Class<?> rawType = getRawType();
+    final DomNameStrategy strategy = DomImplUtil.getDomNameStrategy(rawType, isAttribute());
+    if (strategy != null) {
+      return strategy;
+    }
+    return DomNameStrategy.HYPHEN_STRATEGY;
+  }
+
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomSemContributor.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomSemContributor.java
new file mode 100644
index 0000000..9e44e4f
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomSemContributor.java
@@ -0,0 +1,279 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.util.NullableComputable;
+import com.intellij.openapi.util.RecursionGuard;
+import com.intellij.openapi.util.RecursionManager;
+import com.intellij.openapi.util.Ref;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.patterns.ElementPattern;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.semantic.SemContributor;
+import com.intellij.semantic.SemRegistrar;
+import com.intellij.semantic.SemService;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.NullableFunction;
+import com.intellij.util.Processor;
+import com.intellij.util.xml.EvaluatedXmlName;
+import com.intellij.util.xml.EvaluatedXmlNameImpl;
+import com.intellij.util.xml.XmlName;
+import com.intellij.util.xml.reflect.CustomDomChildrenDescription;
+import com.intellij.util.xml.reflect.DomChildrenDescription;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import com.intellij.util.xml.reflect.DomFixedChildDescription;
+import com.intellij.util.xml.stubs.DomStub;
+import com.intellij.util.xml.stubs.ElementStub;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.Type;
+import java.util.*;
+
+import static com.intellij.patterns.XmlPatterns.*;
+
+/**
+ * @author peter
+ */
+public class DomSemContributor extends SemContributor {
+  private final SemService mySemService;
+
+  public DomSemContributor(SemService semService) {
+    mySemService = semService;
+  }
+
+  public void registerSemProviders(SemRegistrar registrar) {
+    registrar.registerSemElementProvider(DomManagerImpl.FILE_DESCRIPTION_KEY, xmlFile(), new NullableFunction<XmlFile, FileDescriptionCachedValueProvider>() {
+      public FileDescriptionCachedValueProvider fun(XmlFile xmlFile) {
+        ApplicationManager.getApplication().assertReadAccessAllowed();
+        return new FileDescriptionCachedValueProvider(DomManagerImpl.getDomManager(xmlFile.getProject()), xmlFile);
+      }
+    });
+
+    registrar.registerSemElementProvider(DomManagerImpl.DOM_HANDLER_KEY, xmlTag().withParent(psiElement(XmlElementType.XML_DOCUMENT).withParent(xmlFile())), new NullableFunction<XmlTag, DomInvocationHandler>() {
+      public DomInvocationHandler fun(XmlTag xmlTag) {
+        final FileDescriptionCachedValueProvider provider =
+          mySemService.getSemElement(DomManagerImpl.FILE_DESCRIPTION_KEY, xmlTag.getContainingFile());
+        assert provider != null;
+        final DomFileElementImpl element = provider.getFileElement();
+        if (element != null) {
+          final DomRootInvocationHandler handler = element.getRootHandler();
+          if (handler.getXmlTag() == xmlTag) {
+            return handler;
+          }
+        }
+        return null;
+      }
+    });
+
+    final ElementPattern<XmlTag> nonRootTag = xmlTag().withParent(or(xmlTag(), xmlEntityRef().withParent(xmlTag())));
+    registrar.registerSemElementProvider(DomManagerImpl.DOM_INDEXED_HANDLER_KEY, nonRootTag, new NullableFunction<XmlTag, IndexedElementInvocationHandler>() {
+      public IndexedElementInvocationHandler fun(XmlTag tag) {
+        final XmlTag parentTag = PhysicalDomParentStrategy.getParentTag(tag);
+        assert parentTag != null;
+        DomInvocationHandler parent = getParentDom(parentTag);
+        if (parent == null) return null;
+
+        final String localName = tag.getLocalName();
+        final String namespace = tag.getNamespace();
+
+        final DomFixedChildDescription description =
+          findChildrenDescription(parent.getGenericInfo().getFixedChildrenDescriptions(), tag, parent);
+
+        if (description != null) {
+
+          final int totalCount = description.getCount();
+
+          int index = 0;
+          PsiElement current = tag;
+          while (true) {
+            current = current.getPrevSibling();
+            if (current == null) {
+              break;
+            }
+            if (current instanceof XmlTag) {
+              final XmlTag xmlTag = (XmlTag)current;
+              if (localName.equals(xmlTag.getLocalName()) && namespace.equals(xmlTag.getNamespace())) {
+                index++;
+                if (index >= totalCount) {
+                  return null;
+                }
+              }
+            }
+          }
+
+          final DomManagerImpl myDomManager = parent.getManager();
+          return new IndexedElementInvocationHandler(parent.createEvaluatedXmlName(description.getXmlName()), (FixedChildDescriptionImpl)description, index,
+                                              new PhysicalDomParentStrategy(tag, myDomManager), myDomManager, null);
+        }
+        return null;
+      }
+    });
+
+    registrar.registerSemElementProvider(DomManagerImpl.DOM_COLLECTION_HANDLER_KEY, nonRootTag, new NullableFunction<XmlTag, CollectionElementInvocationHandler>() {
+      public CollectionElementInvocationHandler fun(XmlTag tag) {
+        final XmlTag parentTag = PhysicalDomParentStrategy.getParentTag(tag);
+        assert parentTag != null;
+        DomInvocationHandler parent = getParentDom(parentTag);
+        if (parent == null) return null;
+
+        final DomCollectionChildDescription description = findChildrenDescription(parent.getGenericInfo().getCollectionChildrenDescriptions(), tag, parent);
+        if (description != null) {
+          DomStub parentStub = parent.getStub();
+          if (parentStub != null) {
+            int index = ArrayUtil.indexOf(parentTag.findSubTags(tag.getName(), tag.getNamespace()), tag);
+            ElementStub stub = parentStub.getElementStub(tag.getLocalName(), index);
+            if (stub != null) {
+              XmlName name = description.getXmlName();
+              EvaluatedXmlNameImpl evaluatedXmlName = EvaluatedXmlNameImpl.createEvaluatedXmlName(name, name.getNamespaceKey(), true);
+              return new CollectionElementInvocationHandler(evaluatedXmlName, (AbstractDomChildDescriptionImpl)description, parent.getManager(), stub);
+            }
+          }
+          return new CollectionElementInvocationHandler(description.getType(), tag, (AbstractCollectionChildDescription)description, parent, null);
+        }
+        return null;
+      }
+    });
+
+    registrar.registerSemElementProvider(DomManagerImpl.DOM_CUSTOM_HANDLER_KEY, nonRootTag, new NullableFunction<XmlTag, CollectionElementInvocationHandler>() {
+      private final RecursionGuard myGuard = RecursionManager.createGuard("customDomParent");
+
+      public CollectionElementInvocationHandler fun(XmlTag tag) {
+        if (StringUtil.isEmpty(tag.getName())) return null;
+
+        final XmlTag parentTag = PhysicalDomParentStrategy.getParentTag(tag);
+        assert parentTag != null;
+
+        DomInvocationHandler parent = myGuard.doPreventingRecursion(tag, true, new NullableComputable<DomInvocationHandler>() {
+          @Override
+          public DomInvocationHandler compute() {
+            return getParentDom(parentTag);
+          }
+        });
+        if (parent == null) return null;
+
+        DomGenericInfoEx info = parent.getGenericInfo();
+        final List<? extends CustomDomChildrenDescription> customs = info.getCustomNameChildrenDescription();
+        if (customs.isEmpty()) return null;
+
+        if (mySemService.getSemElement(DomManagerImpl.DOM_INDEXED_HANDLER_KEY, tag) == null &&
+            mySemService.getSemElement(DomManagerImpl.DOM_COLLECTION_HANDLER_KEY, tag) == null) {
+
+          String localName = tag.getLocalName();
+          XmlFile file = parent.getFile();
+          for (final DomFixedChildDescription description : info.getFixedChildrenDescriptions()) {
+            XmlName xmlName = description.getXmlName();
+            if (localName.equals(xmlName.getLocalName()) && DomImplUtil.isNameSuitable(xmlName, tag, parent, file)) {
+              return null;
+            }
+          }
+          for (CustomDomChildrenDescription description : customs) {
+            if (description.getTagNameDescriptor() != null) {
+             AbstractCollectionChildDescription desc = (AbstractCollectionChildDescription)description;
+             Type type = description.getType();
+             return new CollectionElementInvocationHandler(type, tag, desc, parent, null);
+            }
+          }
+        }
+
+        return null;
+      }
+    });
+
+    registrar.registerSemElementProvider(DomManagerImpl.DOM_ATTRIBUTE_HANDLER_KEY, xmlAttribute(), new NullableFunction<XmlAttribute, AttributeChildInvocationHandler>() {
+      public AttributeChildInvocationHandler fun(final XmlAttribute attribute) {
+        final XmlTag tag = PhysicalDomParentStrategy.getParentTag(attribute);
+        final DomInvocationHandler handler = getParentDom(tag);
+        if (handler == null) return null;
+
+        final String localName = attribute.getLocalName();
+        final Ref<AttributeChildInvocationHandler> result = Ref.create(null);
+        handler.getGenericInfo().processAttributeChildrenDescriptions(new Processor<AttributeChildDescriptionImpl>() {
+          public boolean process(AttributeChildDescriptionImpl description) {
+            if (description.getXmlName().getLocalName().equals(localName)) {
+              final EvaluatedXmlName evaluatedXmlName = handler.createEvaluatedXmlName(description.getXmlName());
+
+              final String ns = evaluatedXmlName.getNamespace(tag, handler.getFile());
+              //see XmlTagImpl.getAttribute(localName, namespace)
+              if (ns.equals(tag.getNamespace()) && localName.equals(attribute.getName()) ||
+                  ns.equals(attribute.getNamespace())) {
+                final DomManagerImpl myDomManager = handler.getManager();
+                final AttributeChildInvocationHandler attributeHandler =
+                  new AttributeChildInvocationHandler(evaluatedXmlName, description, myDomManager,
+                                                      new PhysicalDomParentStrategy(attribute, myDomManager), null);
+                result.set(attributeHandler);
+                return false;
+              }
+            }
+            return true;
+          }
+        });
+
+        return result.get();
+      }
+    });
+
+  }
+
+  @Nullable
+  private static DomInvocationHandler getParentDom(@NotNull XmlTag tag) {
+    LinkedHashSet<XmlTag> allParents = new LinkedHashSet<XmlTag>();
+    PsiElement each = tag;
+    while (each instanceof XmlTag && allParents.add((XmlTag)each)) {
+      each = PhysicalDomParentStrategy.getParentTagCandidate((XmlTag)each);
+    }
+    ArrayList<XmlTag> list = new ArrayList<XmlTag>(allParents);
+    Collections.reverse(list);
+    DomManagerImpl manager = DomManagerImpl.getDomManager(tag.getProject());
+    for (XmlTag xmlTag : list) {
+      manager.getDomHandler(xmlTag);
+    }
+
+    return manager.getDomHandler(tag);
+  }
+
+  @Nullable
+  private static <T extends DomChildrenDescription> T findChildrenDescription(List<T> descriptions, XmlTag tag, DomInvocationHandler parent) {
+    final String localName = tag.getLocalName();
+    String namespace = null;
+    final String qName = tag.getName();
+
+    final XmlFile file = parent.getFile();
+
+    //noinspection ForLoopReplaceableByForEach
+    for (int i = 0, size = descriptions.size(); i < size; i++) {
+      final T description = descriptions.get(i);
+      final XmlName xmlName = description.getXmlName();
+
+      if (localName.equals(xmlName.getLocalName()) || qName.equals(xmlName.getLocalName())) {
+        final EvaluatedXmlName evaluatedXmlName = parent.createEvaluatedXmlName(xmlName);
+        if (DomImplUtil.isNameSuitable(evaluatedXmlName,
+                                       localName,
+                                       qName,
+                                       namespace == null ? namespace = tag.getNamespace() : namespace,
+                                       file)) {
+          return description;
+        }
+      }
+    }
+    return null;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomServiceImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomServiceImpl.java
new file mode 100644
index 0000000..00c13e7
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomServiceImpl.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.impl;
+
+import com.intellij.ide.highlighter.XmlFileType;
+import com.intellij.ide.structureView.StructureViewBuilder;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.UserDataCache;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.VirtualFileWithId;
+import com.intellij.psi.PsiErrorElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.impl.PsiFileEx;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.stubs.ObjectStubTree;
+import com.intellij.psi.stubs.StubTreeLoader;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.xml.*;
+import com.intellij.util.Function;
+import com.intellij.util.indexing.FileBasedIndex;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.structure.DomStructureViewBuilder;
+import com.intellij.util.xml.stubs.FileStub;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author Gregory.Shrago
+ */
+public class DomServiceImpl extends DomService {
+  private static final Key<CachedValue<XmlFileHeader>> ROOT_TAG_NS_KEY = Key.create("rootTag&ns");
+  private static final UserDataCache<CachedValue<XmlFileHeader>,XmlFile,Object> ourRootTagCache = new UserDataCache<CachedValue<XmlFileHeader>, XmlFile, Object>() {
+    protected CachedValue<XmlFileHeader> compute(final XmlFile file, final Object o) {
+      return CachedValuesManager.getManager(file.getProject()).createCachedValue(new CachedValueProvider<XmlFileHeader>() {
+        public Result<XmlFileHeader> compute() {
+          return new Result<XmlFileHeader>(calcXmlFileHeader(file), file);
+        }
+      }, false);
+    }
+  };
+
+  @NotNull
+  private static XmlFileHeader calcXmlFileHeader(final XmlFile file) {
+
+    if (file instanceof PsiFileEx && ((PsiFileEx)file).isContentsLoaded() && file.getNode().isParsed()) {
+      return computeHeaderByPsi(file);
+    }
+
+    if (!XmlUtil.isStubBuilding(file) && file.getFileType() == XmlFileType.INSTANCE) {
+      VirtualFile virtualFile = file.getVirtualFile();
+      if (virtualFile instanceof VirtualFileWithId) {
+        ObjectStubTree tree = StubTreeLoader.getInstance().readFromVFile(file.getProject(), virtualFile);
+        if (tree != null) {
+          return ((FileStub)tree.getRoot()).getHeader();
+        }
+      }
+    }
+
+    if (!file.isValid()) return XmlFileHeader.EMPTY;
+    return NanoXmlUtil.parseHeader(file);
+  }
+
+  private static XmlFileHeader computeHeaderByPsi(XmlFile file) {
+    final XmlDocument document = file.getDocument();
+    if (document == null) {
+      return XmlFileHeader.EMPTY;
+    }
+
+    String publicId = null;
+    String systemId = null;
+    final XmlProlog prolog = document.getProlog();
+    if (prolog != null) {
+      final XmlDoctype doctype = prolog.getDoctype();
+      if (doctype != null) {
+        publicId = doctype.getPublicId();
+        systemId = doctype.getSystemId();
+        if (systemId == null) {
+          systemId = doctype.getDtdUri();
+        }
+      }
+    }
+
+    final XmlTag tag = document.getRootTag();
+    if (tag == null) {
+      return XmlFileHeader.EMPTY;
+    }
+
+    String localName = tag.getLocalName();
+    if (StringUtil.isNotEmpty(localName)) {
+      if (tag.getPrevSibling() instanceof PsiErrorElement) {
+        return XmlFileHeader.EMPTY;
+      }
+
+      String psiNs = tag.getNamespace();
+      return new XmlFileHeader(localName, psiNs == XmlUtil.EMPTY_URI || Comparing.equal(psiNs, systemId) ? null : psiNs, publicId,
+                               systemId);
+    }
+    return XmlFileHeader.EMPTY;
+  }
+
+  public ModelMerger createModelMerger() {
+    return new ModelMergerImpl();
+  }
+
+  @Override
+  public <T extends DomElement> DomAnchor<T> createAnchor(T domElement) {
+    return DomAnchorImpl.createAnchor(domElement);
+  }
+
+  @NotNull
+  public XmlFile getContainingFile(@NotNull DomElement domElement) {
+    if (domElement instanceof DomFileElement) {
+      return ((DomFileElement)domElement).getFile();
+    }
+    return DomManagerImpl.getNotNullHandler(domElement).getFile();
+  }
+
+  @NotNull
+  public EvaluatedXmlName getEvaluatedXmlName(@NotNull final DomElement element) {
+    return DomManagerImpl.getNotNullHandler(element).getXmlName();
+  }
+
+  @NotNull
+  public XmlFileHeader getXmlFileHeader(XmlFile file) {
+    return file.isValid() ? ourRootTagCache.get(ROOT_TAG_NS_KEY, file, null).getValue() : XmlFileHeader.EMPTY;
+  }
+
+
+  public Collection<VirtualFile> getDomFileCandidates(Class<? extends DomElement> description, Project project) {
+    return FileBasedIndex.getInstance().getContainingFiles(DomFileIndex.NAME, description.getName(), GlobalSearchScope.allScope(project));
+  }
+
+  public <T extends DomElement> List<DomFileElement<T>> getFileElements(final Class<T> clazz, final Project project, @Nullable final GlobalSearchScope scope) {
+    final Collection<VirtualFile> list = scope == null ? getDomFileCandidates(clazz, project) : getDomFileCandidates(clazz, project, scope);
+    final ArrayList<DomFileElement<T>> result = new ArrayList<DomFileElement<T>>(list.size());
+    for (VirtualFile file : list) {
+      final PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
+      if (psiFile instanceof XmlFile) {
+        final DomFileElement<T> element = DomManager.getDomManager(project).getFileElement((XmlFile)psiFile, clazz);
+        if (element != null) {
+          result.add(element);
+        }
+      }
+    }
+
+    return result;
+  }
+
+
+  public StructureViewBuilder createSimpleStructureViewBuilder(final XmlFile file, final Function<DomElement, StructureViewMode> modeProvider) {
+    return new DomStructureViewBuilder(file, modeProvider);
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomTemplateRunnerImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomTemplateRunnerImpl.java
new file mode 100644
index 0000000..97a66b9
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomTemplateRunnerImpl.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.codeInsight.template.Template;
+import com.intellij.codeInsight.template.TemplateManager;
+import com.intellij.codeInsight.template.impl.TemplateSettings;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.containers.HashMap;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.actions.generate.DomTemplateRunner;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class DomTemplateRunnerImpl extends DomTemplateRunner {
+  private final Project myProject;
+
+  public DomTemplateRunnerImpl(Project project) {
+    myProject = project;
+  }
+
+  public <T extends DomElement> void runTemplate(final T t, final String mappingId, final Editor editor) {
+       runTemplate(t, mappingId, editor, new HashMap<String, String>());
+  }
+
+  @Override
+  public <T extends DomElement> void runTemplate(T t, String mappingId, Editor editor,
+                                                 @NotNull Map<String, String> predefinedVars) {
+    final Template template = getTemplate(mappingId);
+    runTemplate(t, editor, template, predefinedVars);
+  }
+
+  public <T extends DomElement> void runTemplate(final T t, final Editor editor, @Nullable final Template template) {
+     runTemplate(t, editor, template, new HashMap<String, String>());
+  }
+
+  public <T extends DomElement> void runTemplate(final T t, final Editor editor, @Nullable final Template template, Map<String, String> predefinedVars) {
+    if (template != null) {
+      DomElement copy = t.createStableCopy();
+      PsiDocumentManager.getInstance(myProject).doPostponedOperationsAndUnblockDocument(editor.getDocument());
+      XmlTag tag = copy.getXmlTag();
+      assert tag != null;
+      editor.getCaretModel().moveToOffset(tag.getTextRange().getStartOffset());
+      copy.undefine();
+
+      PsiDocumentManager.getInstance(myProject).doPostponedOperationsAndUnblockDocument(editor.getDocument());
+
+      template.setToReformat(true);
+      TemplateManager.getInstance(myProject).startTemplate(editor, template, true, predefinedVars, null);
+    }
+  }
+
+  @Nullable
+  protected static Template getTemplate(final String mappingId) {
+    return mappingId != null ? TemplateSettings.getInstance().getTemplateById(mappingId) : null;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DynamicGenericInfo.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DynamicGenericInfo.java
new file mode 100644
index 0000000..a95cbe5
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DynamicGenericInfo.java
@@ -0,0 +1,277 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Computable;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.RecursionGuard;
+import com.intellij.openapi.util.RecursionManager;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.Function;
+import com.intellij.util.Processor;
+import com.intellij.util.containers.ConcurrentWeakHashMap;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.GenericDomValue;
+import com.intellij.util.xml.JavaMethod;
+import com.intellij.util.xml.reflect.*;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author peter
+ */
+public class DynamicGenericInfo extends DomGenericInfoEx {
+  private static final Key<ConcurrentWeakHashMap<ChildrenDescriptionsHolder, ChildrenDescriptionsHolder>> HOLDERS_CACHE = Key.create("DOM_CHILDREN_HOLDERS_CACHE");
+  private static final RecursionGuard ourGuard = RecursionManager.createGuard("dynamicGenericInfo");
+  private final StaticGenericInfo myStaticGenericInfo;
+  @NotNull private final DomInvocationHandler myInvocationHandler;
+  private volatile boolean myInitialized;
+  private volatile ChildrenDescriptionsHolder<AttributeChildDescriptionImpl> myAttributes;
+  private volatile ChildrenDescriptionsHolder<FixedChildDescriptionImpl> myFixeds;
+  private volatile ChildrenDescriptionsHolder<CollectionChildDescriptionImpl> myCollections;
+  private volatile List<CustomDomChildrenDescriptionImpl> myCustomChildren;
+
+  public DynamicGenericInfo(@NotNull final DomInvocationHandler handler, final StaticGenericInfo staticGenericInfo) {
+    myInvocationHandler = handler;
+    myStaticGenericInfo = staticGenericInfo;
+
+    myAttributes = staticGenericInfo.getAttributes();
+    myFixeds = staticGenericInfo.getFixed();
+    myCollections = staticGenericInfo.getCollections();
+  }
+
+  public Invocation createInvocation(final JavaMethod method) {
+    return myStaticGenericInfo.createInvocation(method);
+  }
+
+  public final boolean checkInitialized() {
+    if (myInitialized) return true;
+    myStaticGenericInfo.buildMethodMaps();
+
+    if (!myInvocationHandler.exists()) return true;
+
+    return ourGuard.doPreventingRecursion(myInvocationHandler, false, new Computable<Boolean>() {
+      @Override
+      public Boolean compute() {
+        DomExtensionsRegistrarImpl registrar = runDomExtenders();
+
+        //noinspection SynchronizationOnLocalVariableOrMethodParameter
+        synchronized (myInvocationHandler) {
+          if (!myInitialized) {
+            if (registrar != null) {
+              applyExtensions(registrar);
+            }
+            myInitialized = true;
+          }
+        }
+        return Boolean.TRUE;
+      }
+    }) == Boolean.TRUE;
+  }
+
+  private void applyExtensions(DomExtensionsRegistrarImpl registrar) {
+    XmlFile file = myInvocationHandler.getFile();
+
+    final List<DomExtensionImpl> fixeds = registrar.getFixeds();
+    final List<DomExtensionImpl> collections = registrar.getCollections();
+    final List<DomExtensionImpl> attributes = registrar.getAttributes();
+    if (!attributes.isEmpty()) {
+      ChildrenDescriptionsHolder<AttributeChildDescriptionImpl> newAttributes = new ChildrenDescriptionsHolder<AttributeChildDescriptionImpl>(myStaticGenericInfo.getAttributes());
+      for (final DomExtensionImpl extension : attributes) {
+        newAttributes.addDescription(extension.addAnnotations(new AttributeChildDescriptionImpl(extension.getXmlName(), extension.getType())));
+      }
+      myAttributes = internChildrenHolder(file, newAttributes);
+    }
+
+    if (!fixeds.isEmpty()) {
+      ChildrenDescriptionsHolder<FixedChildDescriptionImpl> newFixeds = new ChildrenDescriptionsHolder<FixedChildDescriptionImpl>(myStaticGenericInfo.getFixed());
+      for (final DomExtensionImpl extension : fixeds) {
+        //noinspection unchecked
+        newFixeds.addDescription(extension.addAnnotations(new FixedChildDescriptionImpl(extension.getXmlName(), extension.getType(), extension.getCount(), ArrayUtil.EMPTY_COLLECTION_ARRAY)));
+      }
+      myFixeds = internChildrenHolder(file, newFixeds);
+    }
+    if (!collections.isEmpty()) {
+      ChildrenDescriptionsHolder<CollectionChildDescriptionImpl> newCollections = new ChildrenDescriptionsHolder<CollectionChildDescriptionImpl>(myStaticGenericInfo.getCollections());
+      for (final DomExtensionImpl extension : collections) {
+        newCollections.addDescription(extension.addAnnotations(new CollectionChildDescriptionImpl(extension.getXmlName(), extension.getType(),
+                                                                                                  Collections.<JavaMethod>emptyList()
+        )));
+      }
+      myCollections = internChildrenHolder(file, newCollections);
+    }
+
+    final List<DomExtensionImpl> customs = registrar.getCustoms();
+    myCustomChildren = customs.isEmpty() ? null : ContainerUtil.map(customs, new Function<DomExtensionImpl, CustomDomChildrenDescriptionImpl>() {
+      @Override
+      public CustomDomChildrenDescriptionImpl fun(DomExtensionImpl extension) {
+        return new CustomDomChildrenDescriptionImpl(extension);
+      }
+    });
+  }
+
+  private static <T extends DomChildDescriptionImpl> ChildrenDescriptionsHolder<T> internChildrenHolder(XmlFile file, ChildrenDescriptionsHolder<T> holder) {
+    ConcurrentWeakHashMap<ChildrenDescriptionsHolder, ChildrenDescriptionsHolder> cache = file.getUserData(HOLDERS_CACHE);
+    if (cache == null) {
+      file.putUserData(HOLDERS_CACHE, cache = new ConcurrentWeakHashMap<ChildrenDescriptionsHolder, ChildrenDescriptionsHolder>());
+    }
+    ChildrenDescriptionsHolder existing = cache.get(holder);
+    if (existing != null) {
+      //noinspection unchecked
+      return existing;
+    }
+    cache.put(holder, holder);
+    return holder;
+  }
+
+  @Nullable
+  private DomExtensionsRegistrarImpl runDomExtenders() {
+    DomExtensionsRegistrarImpl registrar = null;
+    final DomElement domElement = myInvocationHandler.getProxy();
+    final Project project = myInvocationHandler.getManager().getProject();
+    for (final DomExtenderEP extenderEP : Extensions.getExtensions(DomExtenderEP.EP_NAME)) {
+      registrar = extenderEP.extend(project, domElement, registrar);
+    }
+
+    final AbstractDomChildDescriptionImpl description = myInvocationHandler.getChildDescription();
+    if (description != null) {
+      final List<DomExtender> extenders = description.getUserData(DomExtensionImpl.DOM_EXTENDER_KEY);
+      if (extenders != null) {
+        if (registrar == null) registrar = new DomExtensionsRegistrarImpl();
+        for (final DomExtender extender : extenders) {
+          //noinspection unchecked
+          extender.registerExtensions(domElement, registrar);
+        }
+      }
+    }
+    return registrar;
+  }
+
+  public XmlElement getNameElement(DomElement element) {
+    return myStaticGenericInfo.getNameElement(element);
+  }
+
+  public GenericDomValue getNameDomElement(DomElement element) {
+    return myStaticGenericInfo.getNameDomElement(element);
+  }
+
+  @NotNull
+  public List<? extends CustomDomChildrenDescription> getCustomNameChildrenDescription() {
+    checkInitialized();
+    if (myCustomChildren != null) return myCustomChildren;
+    return myStaticGenericInfo.getCustomNameChildrenDescription();
+  }
+
+  public String getElementName(DomElement element) {
+    return myStaticGenericInfo.getElementName(element);
+  }
+
+  @NotNull
+  public List<AbstractDomChildDescriptionImpl> getChildrenDescriptions() {
+    checkInitialized();
+    final ArrayList<AbstractDomChildDescriptionImpl> list = new ArrayList<AbstractDomChildDescriptionImpl>();
+    myAttributes.dumpDescriptions(list);
+    myFixeds.dumpDescriptions(list);
+    myCollections.dumpDescriptions(list);
+    list.addAll(myStaticGenericInfo.getCustomNameChildrenDescription());
+    return list;
+  }
+
+  @NotNull
+  public final List<FixedChildDescriptionImpl> getFixedChildrenDescriptions() {
+    checkInitialized();
+    return myFixeds.getDescriptions();
+  }
+
+  @NotNull
+  public final List<CollectionChildDescriptionImpl> getCollectionChildrenDescriptions() {
+    checkInitialized();
+    return myCollections.getDescriptions();
+  }
+
+  public FixedChildDescriptionImpl getFixedChildDescription(String tagName) {
+    checkInitialized();
+    return myFixeds.findDescription(tagName);
+  }
+
+  public DomFixedChildDescription getFixedChildDescription(@NonNls String tagName, @NonNls String namespace) {
+    checkInitialized();
+    return myFixeds.getDescription(tagName, namespace);
+  }
+
+  public CollectionChildDescriptionImpl getCollectionChildDescription(String tagName) {
+    checkInitialized();
+    return myCollections.findDescription(tagName);
+  }
+
+  public DomCollectionChildDescription getCollectionChildDescription(@NonNls String tagName, @NonNls String namespace) {
+    checkInitialized();
+    return myCollections.getDescription(tagName, namespace);
+  }
+
+  public AttributeChildDescriptionImpl getAttributeChildDescription(String attributeName) {
+    checkInitialized();
+    return myAttributes.findDescription(attributeName);
+  }
+
+
+  public DomAttributeChildDescription getAttributeChildDescription(@NonNls String attributeName, @NonNls String namespace) {
+    checkInitialized();
+    return myAttributes.getDescription(attributeName, namespace);
+  }
+
+  public boolean isTagValueElement() {
+    return myStaticGenericInfo.isTagValueElement();
+  }
+
+  @NotNull
+  public List<AttributeChildDescriptionImpl> getAttributeChildrenDescriptions() {
+    checkInitialized();
+    return myAttributes.getDescriptions();
+  }
+
+  @Override
+  public boolean processAttributeChildrenDescriptions(final Processor<AttributeChildDescriptionImpl> processor) {
+    final Set<AttributeChildDescriptionImpl> visited = new THashSet<AttributeChildDescriptionImpl>();
+    if (!myStaticGenericInfo.processAttributeChildrenDescriptions(new Processor<AttributeChildDescriptionImpl>() {
+      public boolean process(AttributeChildDescriptionImpl attributeChildDescription) {
+        visited.add(attributeChildDescription);
+        return processor.process(attributeChildDescription);
+      }
+    })) {
+      return false;
+    }
+    for (final AttributeChildDescriptionImpl description : getAttributeChildrenDescriptions()) {
+      if (!visited.contains(description) && !processor.process(description)) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/ElementPresentationTemplateImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/ElementPresentationTemplateImpl.java
new file mode 100644
index 0000000..c7362d8
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/ElementPresentationTemplateImpl.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.ide.TypePresentationServiceImpl;
+import com.intellij.ide.presentation.Presentation;
+import com.intellij.openapi.util.Ref;
+import com.intellij.util.xml.*;
+
+import javax.swing.*;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class ElementPresentationTemplateImpl extends TypePresentationServiceImpl.PresentationTemplateImpl implements ElementPresentationTemplate {
+
+  public ElementPresentationTemplateImpl(Presentation presentation, Class<?> aClass) {
+    super(presentation, aClass);
+  }
+
+  @Override
+  public ElementPresentation createPresentation(final DomElement element) {
+    return new ElementPresentation() {
+      @Override
+      public String getElementName() {
+        String name = ElementPresentationTemplateImpl.this.getName(element);
+        return name == null ? ElementPresentationManager.getElementName(element) : name;
+      }
+
+      @Override
+      public String getTypeName() {
+        String typeName = ElementPresentationTemplateImpl.this.getTypeName();
+        return typeName == null ? ElementPresentationManager.getTypeNameForObject(element) : typeName;
+      }
+
+      @Override
+      public Icon getIcon() {
+        return ElementPresentationTemplateImpl.this.getIcon(element, 0);
+      }
+
+      @Override
+      public String getDocumentation() {
+        final Ref<String> result = new Ref<String>();
+        element.acceptChildren(new DomElementVisitor() {
+          @Override
+          public void visitDomElement(DomElement element) {
+            if (element instanceof GenericValue && element.getChildDescription().getAnnotation(Documentation.class) != null) {
+              result.set(((GenericValue)element).getStringValue());
+            }
+          }
+        });
+        return result.isNull() ? super.getDocumentation() : result.get();
+      }
+    };
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/FileDescriptionCachedValueProvider.java b/xml/dom-impl/src/com/intellij/util/xml/impl/FileDescriptionCachedValueProvider.java
new file mode 100644
index 0000000..e3bccbd
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/FileDescriptionCachedValueProvider.java
@@ -0,0 +1,196 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.VirtualFileWithId;
+import com.intellij.psi.stubs.ObjectStubTree;
+import com.intellij.psi.stubs.StubTreeLoader;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.semantic.SemElement;
+import com.intellij.util.SmartList;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.HashSet;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.events.DomEvent;
+import com.intellij.util.xml.stubs.FileStub;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.ref.WeakReference;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author peter
+ */
+@SuppressWarnings({"HardCodedStringLiteral", "StringConcatenationInsideStringBufferAppend"})
+class FileDescriptionCachedValueProvider<T extends DomElement> implements SemElement{
+
+  private final XmlFile myXmlFile;
+  private volatile boolean myComputed;
+  private volatile DomFileElementImpl<T> myLastResult;
+  private final MyCondition myCondition = new MyCondition();
+
+  private final DomManagerImpl myDomManager;
+  private final DomService myDomService;
+
+  public FileDescriptionCachedValueProvider(final DomManagerImpl domManager, final XmlFile xmlFile) {
+    myDomManager = domManager;
+    myXmlFile = xmlFile;
+    myDomService = DomService.getInstance();
+  }
+
+  @Nullable
+  public final DomFileElementImpl<T> getFileElement() {
+    if (myComputed) return myLastResult;
+
+    DomFileElementImpl<T> result = _computeFileElement(false, myDomService.getXmlFileHeader(myXmlFile), null);
+
+    synchronized (myCondition) {
+      if (myComputed) return myLastResult;
+
+      myLastResult = result;
+      WeakReference<DomFileElementImpl> ref = result != null ? new WeakReference<DomFileElementImpl>(result) : null;
+      myXmlFile.putUserData(DomManagerImpl.CACHED_FILE_ELEMENT, ref);
+      myComputed = true;
+      return result;
+    }
+  }
+
+  @Nullable
+  private DomFileElementImpl<T> _computeFileElement(final boolean fireEvents,
+                                                    @NotNull final XmlFileHeader rootTagName, @Nullable StringBuilder sb) {
+    if (sb != null) {
+      sb.append(rootTagName).append("\n");
+    }
+
+    if (!myXmlFile.isValid()) {
+      return null;
+    }
+    if (sb != null) {
+      sb.append("File is valid\n");
+    }
+
+    final DomFileDescription<T> description = findFileDescription(rootTagName, sb);
+
+    final DomFileElementImpl oldValue = getLastValue();
+    if (sb != null) {
+      sb.append("last " + oldValue + "\n");
+    }
+    final List<DomEvent> events = fireEvents ? new SmartList<DomEvent>() : Collections.<DomEvent>emptyList();
+    if (oldValue != null) {
+      if (fireEvents) {
+        events.add(new DomEvent(oldValue, false));
+      }
+    }
+
+    if (description == null) {
+      return null;
+    }
+
+    final Class<T> rootElementClass = description.getRootElementClass();
+    final XmlName xmlName = DomImplUtil.createXmlName(description.getRootTagName(), rootElementClass, null);
+    assert xmlName != null;
+    final EvaluatedXmlNameImpl rootTagName1 = EvaluatedXmlNameImpl.createEvaluatedXmlName(xmlName, xmlName.getNamespaceKey(), false);
+
+    VirtualFile file = myXmlFile.getVirtualFile();
+    FileStub stub = null;
+    if (description.hasStubs() && file instanceof VirtualFileWithId) {
+      ApplicationManager.getApplication().assertReadAccessAllowed();
+      if (!XmlUtil.isStubBuilding(myXmlFile)) {
+        ObjectStubTree stubTree = StubTreeLoader.getInstance().readOrBuild(myXmlFile.getProject(), file, myXmlFile);
+        if (stubTree != null) {
+          stub = (FileStub)stubTree.getRoot();
+        }
+      }
+    }
+
+    DomFileElementImpl<T> result = new DomFileElementImpl<T>(myXmlFile, rootElementClass, rootTagName1, myDomManager, description, stub);
+    if (sb != null) {
+      sb.append("success " + result + "\n");
+    }
+
+    if (fireEvents) {
+      events.add(new DomEvent(result, true));
+    }
+    return result;
+  }
+
+  @Nullable
+  private DomFileDescription<T> findFileDescription(final XmlFileHeader rootTagName, @Nullable StringBuilder sb) {
+    final DomFileDescription<T> mockDescription = myXmlFile.getUserData(DomManagerImpl.MOCK_DESCRIPTION);
+    if (mockDescription != null) return mockDescription;
+
+    if (sb != null) {
+      sb.append("no mock\n");
+    }
+
+    final XmlFile originalFile = (XmlFile)myXmlFile.getOriginalFile();
+    if (sb != null) {
+      sb.append("original: " + originalFile + "\n");
+    }
+    if (originalFile != myXmlFile) {
+      final FileDescriptionCachedValueProvider<T> provider = myDomManager.getOrCreateCachedValueProvider(originalFile);
+      final DomFileElementImpl<T> element = provider.getFileElement();
+      if (sb != null) {
+        sb.append("originalDom " + element + "\n");
+      }
+      return element == null ? null : element.getFileDescription();
+    }
+
+    //noinspection unchecked
+    final Set<DomFileDescription> namedDescriptions = myDomManager.getFileDescriptions(rootTagName.getRootTagLocalName());
+    if (sb != null) {
+      sb.append("named " + new HashSet<DomFileDescription>(namedDescriptions) + "\n");
+    }
+    DomFileDescription<T> description = ContainerUtil.find(namedDescriptions, myCondition);
+    if (description == null) {
+      final Set<DomFileDescription> unnamed = myDomManager.getAcceptingOtherRootTagNameDescriptions();
+      description = ContainerUtil.find(unnamed, myCondition);
+    }
+    if (sb != null) {
+      sb.append("found " + description + "\n");
+    }
+    return description;
+  }
+
+  @Nullable
+  final DomFileElementImpl<T> getLastValue() {
+    return myLastResult;
+  }
+
+  public String getFileElementWithLogging() {
+    final XmlFileHeader rootTagName = myDomService.getXmlFileHeader(myXmlFile);
+    final StringBuilder log = new StringBuilder();
+    myLastResult = _computeFileElement(false, rootTagName, log);
+    return log.toString();
+  }
+
+  private class MyCondition implements Condition<DomFileDescription> {
+    public Module module;
+
+    public boolean value(final DomFileDescription description) {
+      return description.isMyFile(myXmlFile, module);
+    }
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/FixedChildDescriptionImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/FixedChildDescriptionImpl.java
new file mode 100644
index 0000000..04ac765
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/FixedChildDescriptionImpl.java
@@ -0,0 +1,115 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.SmartList;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomNameStrategy;
+import com.intellij.util.xml.JavaMethod;
+import com.intellij.util.xml.XmlName;
+import com.intellij.util.xml.reflect.DomFixedChildDescription;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class FixedChildDescriptionImpl extends DomChildDescriptionImpl implements DomFixedChildDescription {
+  private final Collection<JavaMethod>[] myGetterMethods;
+  private final int myCount;
+
+  public FixedChildDescriptionImpl(final XmlName tagName, final Type type, final int count, final Collection<JavaMethod>[] getterMethods) {
+    super(tagName, type);
+    assert getterMethods.length == count || getterMethods == ArrayUtil.EMPTY_COLLECTION_ARRAY;
+    myCount = count;
+    myGetterMethods = getterMethods;
+  }
+
+  public JavaMethod getGetterMethod(int index) {
+    if (myGetterMethods.length == 0) return null;
+
+    final Collection<JavaMethod> methods = myGetterMethods[index];
+    return methods == null || methods.isEmpty() ? null : methods.iterator().next();
+  }
+
+  @Nullable
+  public <T extends Annotation> T getAnnotation(int index, Class<? extends T> annotationClass) {
+    final JavaMethod method = getGetterMethod(index);
+    if (method != null) {
+      final T annotation = method.getAnnotation(annotationClass);
+      if (annotation != null) return annotation;
+    }
+
+    final Type elemType = getType();
+    if (elemType instanceof AnnotatedElement) {
+      T annotation = ((AnnotatedElement)elemType).getAnnotation(annotationClass);
+      if (annotation != null) return annotation;
+    }
+
+    return super.getAnnotation(annotationClass);
+  }
+
+  public int getCount() {
+    return myCount;
+  }
+
+  @NotNull
+  public List<? extends DomElement> getValues(@NotNull final DomElement element) {
+    final List<DomElement> result = new SmartList<DomElement>();
+    final DomInvocationHandler handler = DomManagerImpl.getDomInvocationHandler(element);
+    if (handler != null) {
+      for (int i = 0; i < myCount; i++) {
+        result.add(handler.getFixedChild(Pair.create(this, i)).getProxy());
+      }
+    }
+    else {
+      for (Collection<JavaMethod> methods : myGetterMethods) {
+        if (methods != null && !methods.isEmpty()) {
+          result.add((DomElement)methods.iterator().next().invoke(element, ArrayUtil.EMPTY_OBJECT_ARRAY));
+        }
+      }
+    }
+    return result;
+  }
+
+  @NotNull
+  public String getCommonPresentableName(@NotNull DomNameStrategy strategy) {
+    return StringUtil.capitalizeWords(strategy.splitIntoWords(getXmlElementName()), true);
+  }
+
+  @Nullable
+  public final <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+    return getAnnotation(0, annotationClass);
+  }
+
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+    if (!super.equals(o)) return false;
+
+    final FixedChildDescriptionImpl that = (FixedChildDescriptionImpl)o;
+
+    if (myCount != that.myCount) return false;
+    if (!Arrays.equals(myGetterMethods, that.myGetterMethods)) return false;
+
+    return true;
+  }
+
+  public String toString() {
+    return getXmlElementName() + " " + getGetterMethod(0) + " " + getType();
+  }
+
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 29 * result + myCount;
+    return result;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/GenericDomValueReference.java b/xml/dom-impl/src/com/intellij/util/xml/impl/GenericDomValueReference.java
new file mode 100644
index 0000000..b934fe3
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/GenericDomValueReference.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupValueFactory;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.pom.PomTarget;
+import com.intellij.pom.references.PomService;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.PsiReferenceBase;
+import com.intellij.psi.impl.PomTargetPsiElementImpl;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.*;
+import com.intellij.xml.util.XmlTagUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class GenericDomValueReference<T> extends PsiReferenceBase<XmlElement> implements EmptyResolveMessageProvider {
+  private final GenericDomValue<T> myGenericValue;
+
+  public GenericDomValueReference(GenericDomValue<T> domValue) {
+    super(DomUtil.getValueElement(domValue));
+    myGenericValue = domValue;
+    assert DomUtil.hasXml(domValue);
+    setRangeInElement(createTextRange());
+  }
+
+  protected final PsiManager getPsiManager() {
+    return PsiManager.getInstance(myGenericValue.getManager().getProject());
+  }
+
+  protected TextRange createTextRange() {
+    if (myGenericValue instanceof GenericAttributeValue) {
+      final GenericAttributeValue genericAttributeValue = (GenericAttributeValue)myGenericValue;
+      final XmlAttributeValue attributeValue = genericAttributeValue.getXmlAttributeValue();
+      if (attributeValue == null) {
+        return TextRange.from(0, genericAttributeValue.getXmlAttribute().getTextLength());
+      }
+
+      final int length = attributeValue.getTextLength();
+      return length < 2 ? TextRange.from(0, length) : new TextRange(1, length - 1);
+    }
+    final XmlTag tag = myGenericValue.getXmlTag();
+    assert tag != null;
+    return XmlTagUtil.getTrimmedValueRange(tag);
+  }
+
+  protected final GenericDomValue<T> getGenericValue() {
+    return myGenericValue;
+  }
+
+  public boolean isSoft() {
+    return true;
+  }
+
+  @Nullable
+  protected PsiElement resolveInner(T o) {
+    final Converter<T> converter = getConverter();
+    if (converter instanceof ResolvingConverter) {
+      return ((ResolvingConverter<T>)converter).resolve(o, getConvertContext());
+    }
+
+    if (o instanceof PsiElement) {
+      return (PsiElement)o;
+    }
+    if (o instanceof DomElement) {
+      DomTarget target = DomTarget.getTarget((DomElement)o);
+      return target == null ? null : PomService.convertToPsi(target);
+    }
+    if (o instanceof MergedObject) {
+      final List<T> list = ((MergedObject<T>)o).getImplementations();
+      for (final T o1 : list) {
+        final PsiElement psiElement = resolveInner(o1);
+        if (psiElement != null) {
+          return psiElement;
+        }
+      }
+    }
+    return o != null ? getElement() : null;
+  }
+
+  public boolean isReferenceTo(final PsiElement element) {
+    final Converter<T> converter = getConverter();
+    if (converter instanceof ResolvingConverter) {
+      T value = myGenericValue.getValue();
+      if (value instanceof DomElement && element instanceof PomTargetPsiElementImpl) {
+        PomTarget target = ((PomTargetPsiElementImpl)element).getTarget();
+        if (target instanceof DomTarget) {
+          if (value.equals(((DomTarget)target).getDomElement())) {
+            return true;
+          }
+        }
+      }
+      return ((ResolvingConverter<T>)converter).isReferenceTo(element, getStringValue(), value, getConvertContext());
+    }
+    return super.isReferenceTo(element);
+  }
+
+  private String getStringValue() {
+    return myGenericValue.getStringValue();
+  }
+
+  public Converter<T> getConverter() {
+    return WrappingConverter.getDeepestConverter(myGenericValue.getConverter(), myGenericValue);
+  }
+
+  @Nullable
+  public PsiElement resolve() {
+    final T value = myGenericValue.getValue();
+    return value == null ? null : resolveInner(value);
+  }
+
+  @NotNull
+  public String getCanonicalText() {
+    return StringUtil.notNullize(getStringValue());
+  }
+
+  public String getUnresolvedMessagePattern() {
+    final ConvertContextImpl context = getConvertContext();
+    return getConverter().getErrorMessage(getStringValue(), context);
+  }
+
+  public final ConvertContextImpl getConvertContext() {
+    return new ConvertContextImpl(DomManagerImpl.getDomInvocationHandler(myGenericValue));
+  }
+
+  public PsiElement handleElementRename(final String newElementName) throws IncorrectOperationException {
+    final Converter<T> converter = getConverter();
+    if (converter instanceof ResolvingConverter) {
+      ((ResolvingConverter)converter).handleElementRename(myGenericValue, getConvertContext(), newElementName);
+      return myGenericValue.getXmlTag();
+    }
+    return super.handleElementRename(newElementName);
+  }
+
+  public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+    final Converter<T> converter = getConverter();
+    if (converter instanceof ResolvingConverter) {
+      ((ResolvingConverter)converter).bindReference(myGenericValue, getConvertContext(), element);
+      return myGenericValue.getXmlTag();
+    }
+
+    if (element instanceof XmlTag) {
+      DomElement domElement = myGenericValue.getManager().getDomElement((XmlTag) element);
+      if (domElement != null) {
+        myGenericValue.setValue((T)domElement);
+      } else {
+        myGenericValue.setStringValue(((XmlTag)element).getName());
+      }
+      return myGenericValue.getXmlTag();
+    }
+    return null;
+  }
+
+  @NotNull
+  public Object[] getVariants() {
+    final Converter<T> converter = getConverter();
+    if (converter instanceof EnumConverter || converter == ResolvingConverter.BOOLEAN_CONVERTER) {
+      if (DomCompletionContributor.isSchemaEnumerated(getElement())) return ArrayUtil.EMPTY_OBJECT_ARRAY;
+    }
+
+    if (converter instanceof ResolvingConverter) {
+      final ResolvingConverter<T> resolvingConverter = (ResolvingConverter<T>)converter;
+      ArrayList<Object> result = new ArrayList<Object>();
+      final ConvertContext convertContext = getConvertContext();
+      for (T variant: resolvingConverter.getVariants(convertContext)) {
+        LookupElement lookupElement = resolvingConverter.createLookupElement(variant);
+        if (lookupElement != null) {
+          result.add(lookupElement);
+          continue;
+        }
+        String name = converter.toString(variant, convertContext);
+        if (name != null) {
+          result.add(ElementPresentationManager.getInstance().createVariant(variant, name, ((ResolvingConverter)converter).getPsiElement(variant)));
+        }
+      }
+      for (final String string : resolvingConverter.getAdditionalVariants(convertContext)) {
+        result.add(LookupValueFactory.createLookupValue(string, null));
+      }
+      return result.toArray();
+    }
+    return ArrayUtil.EMPTY_OBJECT_ARRAY;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/GenericValueReferenceProvider.java b/xml/dom-impl/src/com/intellij/util/xml/impl/GenericValueReferenceProvider.java
new file mode 100644
index 0000000..4040ade
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/GenericValueReferenceProvider.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.javaee.web.PsiReferenceConverter;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ProcessingContext;
+import com.intellij.util.ReflectionCache;
+import com.intellij.util.xml.*;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+/**
+ * @author peter
+ */
+public class GenericValueReferenceProvider extends PsiReferenceProvider {
+
+  private final static Logger LOG = Logger.getInstance("#com.intellij.util.xml.impl.GenericValueReferenceProvider");
+
+  private final Map<Class, PsiReferenceFactory> myProviders = new HashMap<Class, PsiReferenceFactory>();
+
+  public void addReferenceProviderForClass(Class clazz, PsiReferenceFactory provider) {
+    myProviders.put(clazz, provider);
+  }
+
+  @NotNull
+  public final PsiReference[] getReferencesByElement(@NotNull PsiElement psiElement, @NotNull final ProcessingContext context) {
+    final DomManager domManager = DomManager.getDomManager(psiElement.getProject());
+
+    final DomElement domElement;
+    if (psiElement instanceof XmlTag) {
+      domElement = domManager.getDomElement((XmlTag)psiElement);
+    } else if (psiElement instanceof XmlAttributeValue && psiElement.getParent() instanceof XmlAttribute) {
+      domElement = domManager.getDomElement((XmlAttribute)psiElement.getParent());
+    } else {
+      return PsiReference.EMPTY_ARRAY;
+    }
+
+    if (!(domElement instanceof GenericDomValue)) {
+      return PsiReference.EMPTY_ARRAY;
+    }
+
+    if (psiElement instanceof XmlTag) {
+      for (XmlText text : ((XmlTag)psiElement).getValue().getTextElements()) {
+        if (InjectedLanguageUtil.hasInjections((PsiLanguageInjectionHost)text)) return PsiReference.EMPTY_ARRAY;
+      }
+    } else {
+      if (InjectedLanguageUtil.hasInjections((PsiLanguageInjectionHost)psiElement)) return PsiReference.EMPTY_ARRAY;
+    }
+
+    final GenericDomValue domValue = (GenericDomValue)domElement;
+
+    final Referencing referencing = domValue.getAnnotation(Referencing.class);
+    final Object converter;
+    if (referencing == null) {
+      converter = WrappingConverter.getDeepestConverter(domValue.getConverter(), domValue);
+    }
+    else {
+      Class<? extends CustomReferenceConverter> clazz = referencing.value();
+      converter = ((ConverterManagerImpl)domManager.getConverterManager()).getInstance(clazz);
+    }
+    PsiReference[] references = createReferences(domValue, (XmlElement)psiElement, converter);
+    if (ApplicationManager.getApplication().isUnitTestMode()) {
+      for (PsiReference reference : references) {
+        if (!reference.isSoft()) {
+          LOG.error("dom reference should be soft: " + reference + " (created by " + converter + ")");
+        }
+      }
+    }
+    return references;
+  }
+
+  private static AbstractConvertContext createConvertContext(final PsiElement psiElement, final GenericDomValue domValue) {
+    return new AbstractConvertContext() {
+      @NotNull
+      public DomElement getInvocationElement() {
+        return domValue;
+      }
+
+      public PsiManager getPsiManager() {
+        return psiElement.getManager();
+      }
+    };
+  }
+
+  @Nullable
+  private static DomInvocationHandler getInvocationHandler(final GenericDomValue domValue) {
+    return DomManagerImpl.getDomInvocationHandler(domValue);
+  }
+
+  private PsiReference[] createReferences(final GenericDomValue domValue, final XmlElement psiElement, final Object converter) {
+    AbstractConvertContext context = createConvertContext(psiElement, domValue);
+
+    List<PsiReference> result = new ArrayList<PsiReference>();
+    String unresolvedText = ElementManipulators.getValueText(psiElement);
+
+    for (DomReferenceInjector each : DomUtil.getFileElement(domValue).getFileDescription().getReferenceInjectors()) {
+      Collections.addAll(result, each.inject(unresolvedText, psiElement, context));
+    }
+
+    Collections.addAll(result, doCreateReferences(domValue, psiElement, converter, context));
+
+    return result.toArray(new PsiReference[result.size()]);
+  }
+
+  @NotNull
+  private PsiReference[] doCreateReferences(GenericDomValue domValue, XmlElement psiElement, Object converter, ConvertContext context) {
+    if (converter instanceof CustomReferenceConverter) {
+      final PsiReference[] references =
+        ((CustomReferenceConverter)converter).createReferences(domValue, psiElement, context);
+
+      if (references.length == 0 && converter instanceof ResolvingConverter) {
+        return new PsiReference[]{new GenericDomValueReference(domValue)};
+      } else {
+        return references;
+      }
+    }
+    if (converter instanceof PsiReferenceConverter) {
+      return ((PsiReferenceConverter)converter).createReferences(psiElement, true);
+    }
+    if (converter instanceof ResolvingConverter) {
+      return new PsiReference[]{new GenericDomValueReference(domValue)};
+    }
+
+    final DomInvocationHandler invocationHandler = getInvocationHandler(domValue);
+    assert invocationHandler != null;
+    final Class clazz = DomUtil.getGenericValueParameter(invocationHandler.getDomElementType());
+    if (clazz == null) return PsiReference.EMPTY_ARRAY;
+
+    if (ReflectionCache.isAssignable(Integer.class, clazz)) {
+      return new PsiReference[]{new GenericDomValueReference<Integer>((GenericDomValue<Integer>)domValue) {
+        @NotNull
+        public Object[] getVariants() {
+          return new Object[]{"0"};
+        }
+      }};
+    }
+    if (ReflectionCache.isAssignable(String.class, clazz)) {
+      return PsiReference.EMPTY_ARRAY;
+    }
+    PsiReferenceFactory provider = myProviders.get(clazz);
+    if (provider != null) {
+      return provider.getReferencesByElement(psiElement);
+    }
+
+    return PsiReference.EMPTY_ARRAY;
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/GetAttributeChildInvocation.java b/xml/dom-impl/src/com/intellij/util/xml/impl/GetAttributeChildInvocation.java
new file mode 100644
index 0000000..c0bf0ef
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/GetAttributeChildInvocation.java
@@ -0,0 +1,16 @@
+package com.intellij.util.xml.impl;
+
+/**
+ * @author peter
+ */
+public class GetAttributeChildInvocation implements Invocation {
+  private final AttributeChildDescriptionImpl myDescription;
+
+  public GetAttributeChildInvocation(final AttributeChildDescriptionImpl description) {
+    myDescription = description;
+  }
+
+  public Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+    return handler.getAttributeChild(myDescription).getProxy();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/GetCollectionChildInvocation.java b/xml/dom-impl/src/com/intellij/util/xml/impl/GetCollectionChildInvocation.java
new file mode 100644
index 0000000..bf3a389
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/GetCollectionChildInvocation.java
@@ -0,0 +1,17 @@
+package com.intellij.util.xml.impl;
+
+/**
+ * @author peter
+ */
+public class GetCollectionChildInvocation implements Invocation {
+  private final CollectionChildDescriptionImpl myDescription;
+
+  public GetCollectionChildInvocation(final CollectionChildDescriptionImpl qname) {
+    myDescription = qname;
+  }
+
+  public Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+    return handler.getCollectionChildren(myDescription, myDescription.getTagsGetter());
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/GetCompositeCollectionInvocation.java b/xml/dom-impl/src/com/intellij/util/xml/impl/GetCompositeCollectionInvocation.java
new file mode 100644
index 0000000..97984c8
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/GetCompositeCollectionInvocation.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.containers.ContainerUtil;
+import gnu.trove.THashMap;
+
+import java.util.*;
+
+/**
+ * @author peter
+*/
+class GetCompositeCollectionInvocation implements Invocation {
+  private final Set<CollectionChildDescriptionImpl> myQnames;
+
+  public GetCompositeCollectionInvocation(final Set<CollectionChildDescriptionImpl> qnames) {
+    myQnames = qnames;
+  }
+
+  public Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+    Map<XmlTag,DomElement> map = new THashMap<XmlTag, DomElement>();
+    for (final CollectionChildDescriptionImpl qname : myQnames) {
+      for (DomElement element : handler.getCollectionChildren(qname, qname.getTagsGetter())) {
+        map.put(element.getXmlTag(), element);
+      }
+    }
+    final XmlTag tag = handler.getXmlTag();
+    if (tag == null) return Collections.emptyList();
+
+    final List<DomElement> list = new ArrayList<DomElement>();
+    for (final XmlTag subTag : tag.getSubTags()) {
+      ContainerUtil.addIfNotNull(map.get(subTag), list);
+    }
+    return list;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/GetFixedChildInvocation.java b/xml/dom-impl/src/com/intellij/util/xml/impl/GetFixedChildInvocation.java
new file mode 100644
index 0000000..1af0320
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/GetFixedChildInvocation.java
@@ -0,0 +1,18 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.util.Pair;
+
+/**
+ * @author peter
+ */
+public class GetFixedChildInvocation implements Invocation {
+  private final Pair<FixedChildDescriptionImpl,Integer> myPair;
+
+  public GetFixedChildInvocation(final Pair<FixedChildDescriptionImpl, Integer> pair) {
+    myPair = pair;
+  }
+
+  public Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+    return handler.getFixedChild(myPair).getProxy();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/GetInvocation.java b/xml/dom-impl/src/com/intellij/util/xml/impl/GetInvocation.java
new file mode 100644
index 0000000..41e85a96
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/GetInvocation.java
@@ -0,0 +1,92 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.Pair;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.util.PsiModificationTracker;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.Converter;
+import com.intellij.util.xml.DomReferenceInjector;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.SubTag;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class GetInvocation implements Invocation {
+  private static final Key<CachedValue<List<Pair<Converter,Object>>>> DOM_VALUE_KEY = Key.create("Dom element value key");
+  private final Converter myConverter;
+
+  protected GetInvocation(final Converter converter) {
+    assert converter != null;
+    myConverter = converter;
+  }
+
+  @Override
+  public Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+    if (myConverter == Converter.EMPTY_CONVERTER) {
+      return getValueInner(handler, myConverter);
+    }
+
+    CachedValue<List<Pair<Converter,Object>>> value = handler.getUserData(DOM_VALUE_KEY);
+    if (value == null) {
+      final DomManagerImpl domManager = handler.getManager();
+      final Project project = domManager.getProject();
+      final CachedValuesManager cachedValuesManager = CachedValuesManager.getManager(project);
+      handler.putUserData(DOM_VALUE_KEY, value = cachedValuesManager.createCachedValue(new CachedValueProvider<List<Pair<Converter,Object>>>() {
+        @Override
+        public Result<List<Pair<Converter,Object>>> compute() {
+          List<Pair<Converter, Object>> list = ContainerUtil.createEmptyCOWList();
+          return Result.create(list, PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT, domManager, ProjectRootManager.getInstance(project));
+        }
+      }, false));
+    }
+
+    return getOrCalcValue(handler, value.getValue());
+  }
+
+  @Nullable
+  private Object getOrCalcValue(final DomInvocationHandler<?, ?> handler, final List<Pair<Converter, Object>> list) {
+    if (!list.isEmpty()) {
+      //noinspection ForLoopReplaceableByForEach
+      for (int i = 0; i < list.size(); i++) {
+        Pair<Converter, Object> pair = list.get(i);
+        if (pair.first == myConverter) return pair.second;
+      }
+    }
+    final Object returnValue = getValueInner(handler, myConverter);
+    list.add(Pair.create(myConverter, returnValue));
+    return returnValue;
+  }
+
+  @Nullable
+  private static Object getValueInner(DomInvocationHandler<?, ?> handler, Converter converter) {
+    final SubTag annotation = handler.getAnnotation(SubTag.class);
+    if (annotation != null && annotation.indicator()) {
+      final boolean tagNotNull = handler.getXmlTag() != null;
+      if (converter == Converter.EMPTY_CONVERTER) {
+        return tagNotNull ? "" : null;
+      }
+      else {
+        return tagNotNull;
+      }
+    }
+
+    String tagValue = handler.getValue();
+    ConvertContextImpl context = new ConvertContextImpl(handler);
+
+    for (DomReferenceInjector each : DomUtil.getFileElement(handler).getFileDescription().getReferenceInjectors()) {
+      tagValue = each.resolveString(tagValue, context);
+    }
+
+    return converter.fromString(tagValue, context);
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/ImplementationClassCache.java b/xml/dom-impl/src/com/intellij/util/xml/impl/ImplementationClassCache.java
new file mode 100644
index 0000000..57625e8
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/ImplementationClassCache.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.util.Disposer;
+import com.intellij.util.ReflectionCache;
+import com.intellij.util.containers.ConcurrentFactoryMap;
+import com.intellij.util.containers.MultiMap;
+import com.intellij.util.xml.DomReflectionUtil;
+import com.intellij.util.xml.Implementation;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+/**
+ * @author peter
+ */
+class ImplementationClassCache {
+  private static final Comparator<Class> CLASS_COMPARATOR = new Comparator<Class>() {
+    public int compare(final Class o1, final Class o2) {
+      if (o1.isAssignableFrom(o2)) return 1;
+      if (o2.isAssignableFrom(o1)) return -1;
+      if (o1.equals(o2)) return 0;
+      throw new AssertionError("Incompatible implementation classes: " + o1 + " & " + o2);
+    }
+  };
+
+
+  private final MultiMap<String, DomImplementationClassEP> myImplementationClasses = new MultiMap<String, DomImplementationClassEP>();
+  private final ConcurrentFactoryMap<Class, Class> myCache = new ConcurrentFactoryMap<Class, Class>() {
+      @Nullable
+        protected Class create(final Class concreteInterface) {
+          final TreeSet<Class> set = new TreeSet<Class>(CLASS_COMPARATOR);
+          findImplementationClassDFS(concreteInterface, set);
+          if (!set.isEmpty()) {
+            return set.first();
+          }
+          final Implementation implementation = DomReflectionUtil.findAnnotationDFS(concreteInterface, Implementation.class);
+          return implementation == null ? null : implementation.value();
+        }
+    };
+
+  ImplementationClassCache(ExtensionPointName<DomImplementationClassEP> epName) {
+    for (DomImplementationClassEP ep : epName.getExtensions()) {
+      myImplementationClasses.putValue(ep.interfaceName, ep);
+    }
+  }
+
+  private void findImplementationClassDFS(final Class concreteInterface, SortedSet<Class> results) {
+    final Collection<DomImplementationClassEP> values = myImplementationClasses.get(concreteInterface.getName());
+    for (DomImplementationClassEP value : values) {
+      if (value.getInterfaceClass() == concreteInterface) {
+        results.add(value.getImplementationClass());
+        return;
+      }
+    }
+    for (final Class aClass1 : ReflectionCache.getInterfaces(concreteInterface)) {
+      findImplementationClassDFS(aClass1, results);
+    }
+  }
+
+  public final void registerImplementation(final Class domElementClass, final Class implementationClass,
+                                           @Nullable final Disposable parentDisposable) {
+    final DomImplementationClassEP ep = new DomImplementationClassEP() {
+      @Override
+      public Class getInterfaceClass() {
+        return domElementClass;
+      }
+
+      @Override
+      public Class getImplementationClass() {
+        return implementationClass;
+      }
+    };
+    myImplementationClasses.putValue(domElementClass.getName(), ep);
+    if (parentDisposable != null) {
+      Disposer.register(parentDisposable, new Disposable() {
+        public void dispose() {
+          myImplementationClasses.remove(domElementClass.getName());
+        }
+      });
+    }
+    myCache.clear();
+  }
+
+  public Class get(Class key) {
+    return myCache.get(key);
+  }
+
+  public void clear() {
+    myCache.clear();
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/IndexedElementInvocationHandler.java b/xml/dom-impl/src/com/intellij/util/xml/impl/IndexedElementInvocationHandler.java
new file mode 100644
index 0000000..9448c5f
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/IndexedElementInvocationHandler.java
@@ -0,0 +1,139 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.Factory;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.EvaluatedXmlName;
+import com.intellij.util.xml.reflect.DomFixedChildDescription;
+import com.intellij.util.xml.stubs.ElementStub;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.annotation.Annotation;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class IndexedElementInvocationHandler extends DomInvocationHandler<FixedChildDescriptionImpl, ElementStub>{
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.impl.IndexedElementInvocationHandler");
+  private final int myIndex;
+
+  public IndexedElementInvocationHandler(final EvaluatedXmlName tagName,
+                                         final FixedChildDescriptionImpl description,
+                                         final int index,
+                                         final DomParentStrategy strategy,
+                                         final DomManagerImpl manager,
+                                         @Nullable ElementStub stub) {
+    super(description.getType(), strategy, tagName, description, manager, strategy.getXmlElement() != null, stub);
+    myIndex = index;
+  }
+
+  @SuppressWarnings({"EqualsWhichDoesntCheckParameterClass"})
+  public boolean equals(final Object obj) {
+    return super.equals(obj) && myIndex == ((IndexedElementInvocationHandler)obj).myIndex;
+  }
+
+  public int hashCode() {
+    return super.hashCode() * 239 + myIndex;
+  }
+
+  protected XmlElement recomputeXmlElement(@NotNull final DomInvocationHandler parentHandler) {
+    final XmlTag tag = parentHandler.getXmlTag();
+    if (tag == null) return null;
+
+    final List<XmlTag> tags = DomImplUtil.findSubTags(tag, getXmlName(), parentHandler.getFile());
+    if (tags.size() <= myIndex) return null;
+
+    return tags.get(myIndex);
+  }
+
+  protected XmlTag setEmptyXmlTag() {
+    final DomInvocationHandler parent = getParentHandler();
+    assert parent != null : "write operations should be performed on the DOM having a parent, your DOM may be not very fresh";
+    final FixedChildDescriptionImpl description = getChildDescription();
+    final XmlFile xmlFile = getFile();
+    parent.createFixedChildrenTags(getXmlName(), description, myIndex);
+    final List<XmlTag> tags = DomImplUtil.findSubTags(parent.getXmlTag(), getXmlName(), xmlFile);
+    if (tags.size() > myIndex) {
+      return tags.get(myIndex);
+    }
+
+    final XmlTag[] newTag = new XmlTag[1];
+    getManager().runChange(new Runnable() {
+      public void run() {
+        try {
+          final XmlTag parentTag = parent.getXmlTag();
+          newTag[0] = (XmlTag)parentTag.add(parent.createChildTag(getXmlName()));
+        }
+        catch (IncorrectOperationException e) {
+          LOG.error(e);
+        }
+      }
+    });
+    return newTag[0];
+  }
+
+  public void undefineInternal() {
+    final DomInvocationHandler parent = getParentHandler();
+    assert parent != null : "write operations should be performed on the DOM having a parent, your DOM may be not very fresh";
+    final XmlTag parentTag = parent.getXmlTag();
+    if (parentTag == null) return;
+
+    final EvaluatedXmlName xmlElementName = getXmlName();
+    final FixedChildDescriptionImpl description = getChildDescription();
+
+    final int totalCount = description.getCount();
+
+    final List<XmlTag> subTags = DomImplUtil.findSubTags(parentTag, xmlElementName, getFile());
+    if (subTags.size() <= myIndex) {
+      return;
+    }
+
+    XmlTag tag = getXmlTag();
+    if (tag == null) return;
+
+    final boolean changing = getManager().setChanging(true);
+    try {
+      detach();
+      if (totalCount == myIndex + 1 && subTags.size() >= myIndex + 1) {
+        for (int i = myIndex; i < subTags.size(); i++) {
+          subTags.get(i).delete();
+        }
+      }
+      else if (subTags.size() == myIndex + 1) {
+        tag.delete();
+      } else {
+        setXmlElement((XmlTag) tag.replace(parent.createChildTag(getXmlName())));
+      }
+    }
+    catch (IncorrectOperationException e) {
+      LOG.error(e);
+    } finally {
+      getManager().setChanging(changing);
+    }
+    fireUndefinedEvent();
+  }
+
+  public final <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+    final T annotation = getChildDescription().getAnnotation(myIndex, annotationClass);
+    if (annotation != null) return annotation;
+
+    return getClassAnnotation(annotationClass);
+  }
+
+  public final DomElement createPathStableCopy() {
+    final DomFixedChildDescription description = getChildDescription();
+    final DomElement parentCopy = getParent().createStableCopy();
+    return getManager().createStableValue(new Factory<DomElement>() {
+      public DomElement create() {
+        return parentCopy.isValid() ? description.getValues(parentCopy).get(myIndex) : null;
+      }
+    });
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/Invocation.java b/xml/dom-impl/src/com/intellij/util/xml/impl/Invocation.java
new file mode 100644
index 0000000..6c6e3a0
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/Invocation.java
@@ -0,0 +1,12 @@
+package com.intellij.util.xml.impl;
+
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public interface Invocation {
+  @Nullable
+  Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable;
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/InvocationCache.java b/xml/dom-impl/src/com/intellij/util/xml/impl/InvocationCache.java
new file mode 100644
index 0000000..24b6bb1
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/InvocationCache.java
@@ -0,0 +1,218 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.progress.ProcessCanceledException;
+import com.intellij.openapi.util.Key;
+import com.intellij.pom.Navigatable;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.util.containers.ConcurrentFactoryMap;
+import com.intellij.util.xml.*;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author peter
+ */
+public class InvocationCache {
+  private static final Map<JavaMethodSignature, Invocation> ourCoreInvocations = new HashMap<JavaMethodSignature, Invocation>();
+  private final Map<Method, Invocation> myInvocations = new ConcurrentFactoryMap<Method, Invocation>() {
+    @Override
+    protected Invocation create(Method key) {
+      return ourCoreInvocations.get(new JavaMethodSignature(key));
+    }
+  };
+  private final Map<Method, JavaMethod> myJavaMethods = new ConcurrentFactoryMap<Method, JavaMethod>() {
+    @Override
+    protected JavaMethod create(Method key) {
+      return JavaMethod.getMethod(myType, key);
+    }
+  };
+  private final Map<JavaMethod, Boolean> myGetters = new ConcurrentFactoryMap<JavaMethod, Boolean>() {
+    @Override
+    protected Boolean create(JavaMethod key) {
+      return DomImplUtil.isTagValueGetter(key);
+    }
+  };
+  private final Map<JavaMethod, Boolean> mySetters = new ConcurrentFactoryMap<JavaMethod, Boolean>() {
+    @Override
+    protected Boolean create(JavaMethod key) {
+      return DomImplUtil.isTagValueSetter(key);
+    }
+  };
+  private final Map<JavaMethod, Map<Class, Object>> myMethodAnnotations = new ConcurrentFactoryMap<JavaMethod, Map<Class, Object>>() {
+    @Override
+    protected Map<Class, Object> create(final JavaMethod method) {
+      return new ConcurrentFactoryMap<Class, Object>() {
+        @Override
+        protected Object create(Class annoClass) {
+          return method.getAnnotation(annoClass);
+        }
+      };
+    }
+  };
+  private final Map<Class, Object> myClassAnnotations = new ConcurrentFactoryMap<Class, Object>() {
+    @Override
+    protected Object create(Class annoClass) {
+      return myType.getAnnotation(annoClass);
+    }
+  };
+  private final Class myType;
+
+  static {
+    addCoreInvocations(DomElement.class);
+    addCoreInvocations(Navigatable.class);
+    addCoreInvocations(AnnotatedElement.class);
+    addCoreInvocations(Object.class);
+    ourCoreInvocations.put(new JavaMethodSignature("getUserData", Key.class), new Invocation() {
+      public Object invoke(DomInvocationHandler<?, ?> handler, Object[] args) throws Throwable {
+        return handler.getUserData((Key<?>)args[0]);
+      }
+    });
+    ourCoreInvocations.put(new JavaMethodSignature("putUserData", Key.class, Object.class), new Invocation() {
+      public Object invoke(DomInvocationHandler<?, ?> handler, Object[] args) throws Throwable {
+        //noinspection unchecked
+        handler.putUserData((Key)args[0], args[1]);
+        return null;
+      }
+    });
+    ourCoreInvocations.put(new JavaMethodSignature("getXmlElement"), new Invocation() {
+      public Object invoke(DomInvocationHandler<?, ?> handler, Object[] args) throws Throwable {
+        return handler.getXmlElement();
+      }
+    });
+    ourCoreInvocations.put(new JavaMethodSignature("getXmlTag"), new Invocation() {
+      public Object invoke(DomInvocationHandler<?, ?> handler, Object[] args) throws Throwable {
+        return handler.getXmlTag();
+      }
+    });
+    ourCoreInvocations.put(new JavaMethodSignature("getParent"), new Invocation() {
+      public Object invoke(DomInvocationHandler<?, ?> handler, Object[] args) throws Throwable {
+        return handler.getParent();
+      }
+    });
+    ourCoreInvocations.put(new JavaMethodSignature("accept", DomElementVisitor.class), new Invocation() {
+      public Object invoke(DomInvocationHandler<?, ?> handler, Object[] args) throws Throwable {
+        handler.accept((DomElementVisitor)args[0]);
+        return null;
+      }
+    });
+    ourCoreInvocations.put(new JavaMethodSignature("acceptChildren", DomElementVisitor.class), new Invocation() {
+      public Object invoke(DomInvocationHandler<?, ?> handler, Object[] args) throws Throwable {
+        handler.acceptChildren((DomElementVisitor)args[0]);
+        return null;
+      }
+    });
+    ourCoreInvocations.put(new JavaMethodSignature("getAnnotation", Class.class), new Invocation() {
+      public Object invoke(DomInvocationHandler<?, ?> handler, Object[] args) throws Throwable {
+        //noinspection unchecked
+        return handler.getAnnotation((Class<Annotation>)args[0]);
+      }
+    });
+    ourCoreInvocations.put(new JavaMethodSignature("getRawText"), new Invocation() {
+      public final Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+        return handler.getValue();
+      }
+    });
+    ourCoreInvocations.put(new JavaMethodSignature("getXmlAttribute"), new Invocation() {
+      public final Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+        return handler.getXmlElement();
+      }
+    });
+    ourCoreInvocations.put(new JavaMethodSignature("getXmlAttributeValue"), new Invocation() {
+      @Nullable
+      public final Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+        final XmlAttribute attribute = (XmlAttribute)handler.getXmlElement();
+        return attribute != null ? attribute.getValueElement() : null;
+      }
+    });
+    ourCoreInvocations.put(new JavaMethodSignature("getConverter"), new Invocation() {
+      public final Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+        try {
+          return handler.getScalarConverter();
+        }
+        catch (Throwable e) {
+          final Throwable cause = e.getCause();
+          if (cause instanceof ProcessCanceledException) {
+            throw(ProcessCanceledException)cause;
+          }
+          throw new RuntimeException(e);
+        }
+      }
+    });
+  }
+
+  private static void addCoreInvocations(final Class<?> aClass) {
+    for (final Method method : aClass.getDeclaredMethods()) {
+      if ("equals".equals(method.getName())) {
+        ourCoreInvocations.put(new JavaMethodSignature(method), new Invocation() {
+          public Object invoke(DomInvocationHandler<?, ?> handler, Object[] args) throws Throwable {
+            final DomElement proxy = handler.getProxy();
+            final Object arg = args[0];
+            if (proxy == arg) return true;
+            if (arg == null) return false;
+
+            if (arg instanceof DomElement) {
+              final DomInvocationHandler handler1 = DomManagerImpl.getDomInvocationHandler(proxy);
+              return handler1 != null && handler1.equals(DomManagerImpl.getDomInvocationHandler((DomElement)arg));
+            }
+
+            return false;
+          }
+
+        });
+      }
+      else if ("hashCode".equals(method.getName())) {
+        ourCoreInvocations.put(new JavaMethodSignature(method), new Invocation() {
+          public Object invoke(DomInvocationHandler<?, ?> handler, Object[] args) throws Throwable {
+            return handler.hashCode();
+          }
+        });
+      }
+      else {
+        ourCoreInvocations.put(new JavaMethodSignature(method), new Invocation() {
+          public Object invoke(DomInvocationHandler<?, ?> handler, Object[] args) throws Throwable {
+            return method.invoke(handler, args);
+          }
+        });
+      }
+    }
+  }
+
+  public InvocationCache(Class type) {
+    myType = type;
+  }
+
+  @Nullable
+  public Invocation getInvocation(Method method) {
+    return myInvocations.get(method);
+  }
+
+  public JavaMethod getInternedMethod(Method method) {
+    return myJavaMethods.get(method);
+  }
+
+  public void putInvocation(Method method, Invocation invocation) {
+    myInvocations.put(method, invocation);
+  }
+
+  public boolean isTagValueGetter(JavaMethod method) {
+    return myGetters.get(method);
+  }
+
+  public boolean isTagValueSetter(JavaMethod method) {
+    return mySetters.get(method);
+  }
+
+  @Nullable
+  public <T extends Annotation> T getMethodAnnotation(JavaMethod method, Class<T> annoClass) {
+    return (T)myMethodAnnotations.get(method).get(annoClass);
+  }
+
+  @Nullable
+  public <T extends Annotation> T getClassAnnotation(Class<T> annoClass) {
+    return (T)myClassAnnotations.get(annoClass);
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/MockDomFileDescription.java b/xml/dom-impl/src/com/intellij/util/xml/impl/MockDomFileDescription.java
new file mode 100644
index 0000000..cad1544
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/MockDomFileDescription.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.DomFileDescription;
+import com.intellij.openapi.module.Module;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+*/
+public class MockDomFileDescription<T> extends DomFileDescription<T> {
+  private final XmlFile myFile;
+
+  public MockDomFileDescription(final Class<T> aClass, final String rootTagName, final XmlFile file) {
+    super(aClass, rootTagName);
+    myFile = file;
+  }
+
+  public boolean isMyFile(@NotNull final XmlFile xmlFile, final Module module) {
+    return myFile == xmlFile;
+  }
+
+  public boolean acceptsOtherRootTagNames() {
+    return true;
+  }
+
+  protected void initializeFileDescription() {
+  }
+
+  public boolean isAutomaticHighlightingEnabled() {
+    return false;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/PhysicalDomParentStrategy.java b/xml/dom-impl/src/com/intellij/util/xml/impl/PhysicalDomParentStrategy.java
new file mode 100644
index 0000000..f83280c
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/PhysicalDomParentStrategy.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.diagnostic.LogMessageEx;
+import com.intellij.diagnostic.errordialog.Attachment;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.impl.DebugUtil;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlEntityRef;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public class PhysicalDomParentStrategy implements DomParentStrategy {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.impl.PhysicalDomParentStrategy");
+  private XmlElement myElement;
+  private final DomManagerImpl myDomManager;
+
+  public PhysicalDomParentStrategy(@NotNull final XmlElement element, DomManagerImpl domManager) {
+    myElement = element;
+    myDomManager = domManager;
+  }
+
+  public DomInvocationHandler getParentHandler() {
+    final XmlTag parentTag = getParentTag(myElement);
+    assert parentTag != null;
+    return myDomManager.getDomHandler(parentTag);
+  }
+
+  public static XmlTag getParentTag(final XmlElement xmlElement) {
+    return (XmlTag)getParentTagCandidate(xmlElement);
+  }
+
+  public static PsiElement getParentTagCandidate(final XmlElement xmlElement) {
+    final PsiElement parent = xmlElement.getParent();
+    return parent instanceof XmlEntityRef ? parent.getParent() : parent;
+  }
+
+  @NotNull
+  public final XmlElement getXmlElement() {
+    return myElement;
+  }
+
+  @NotNull
+  public DomParentStrategy refreshStrategy(final DomInvocationHandler handler) {
+    return this;
+  }
+
+  @NotNull
+  public DomParentStrategy setXmlElement(@NotNull final XmlElement element) {
+    myElement = element;
+    return this;
+  }
+
+  @Override
+  public String toString() {
+    return "Physical:" + myElement;
+  }
+
+  @NotNull
+  public DomParentStrategy clearXmlElement() {
+    final DomInvocationHandler parent = getParentHandler();
+    assert parent != null : "write operations should be performed on the DOM having a parent, your DOM may be not very fresh";
+    return new VirtualDomParentStrategy(parent);
+  }
+
+  public String checkValidity() {
+    return myElement.isValid() ? null : "Invalid PSI";
+  }
+
+  @Override
+  public XmlFile getContainingFile(DomInvocationHandler handler) {
+    return DomImplUtil.getFile(handler);
+  }
+
+  @Override
+  public boolean isPhysical() {
+    return true;
+  }
+
+  @SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
+  public boolean equals(final Object o) {
+    return strategyEquals(this, o);
+  }
+
+  public static boolean strategyEquals(DomParentStrategy strategy, final Object o) {
+
+    if (strategy == o) return true;
+    if (!(o instanceof DomParentStrategy)) return false;
+    final XmlElement thatElement = ((DomParentStrategy)o).getXmlElement();
+    if (thatElement == null) return false;
+    XmlElement element = strategy.getXmlElement();
+    if (element == null) return false;
+
+    if (xmlElementsEqual(element, thatElement)) {
+      if (element != thatElement) {
+        final PsiElement nav1 = element.getNavigationElement();
+        final PsiElement nav2 = thatElement.getNavigationElement();
+        if (nav1 != nav2) {
+          PsiElement curContext = findIncluder(element);
+          PsiElement navContext = findIncluder(nav1);
+          LOG.error(LogMessageEx.createEvent(
+            "x:include processing error",
+            "nav1,nav2=" + nav1 + ", " + nav2 + ";\n" +
+            nav1.getContainingFile() + ":" + nav1.getTextRange().getStartOffset() + "!=" + nav2.getContainingFile() + ":" + nav2.getTextRange().getStartOffset() + ";\n" +
+            (nav1 == element) + ";" + (nav2 == thatElement) + ";\n" +
+            "contexts equal: " +  (curContext == navContext) + ";\n" +
+            "curContext?.physical=" + (curContext != null && curContext.isPhysical()) + ";\n" +
+            "navContext?.physical=" + (navContext != null && navContext.isPhysical()) + ";\n" +
+            "myElement.physical=" + element.isPhysical() + ";\n" +
+            "thatElement.physical=" + thatElement.isPhysical() + "\n" + DebugUtil.currentStackTrace(),
+            new Attachment("Including tag text 1.xml", curContext == null ? "null" : curContext.getText()),
+            new Attachment("Including tag text 2.xml", navContext == null ? "null" : navContext.getText())
+          ));
+          throw new AssertionError();
+        }
+      }
+      return true;
+    }
+    return false;
+  }
+
+  @Nullable
+  private static PsiElement findIncluder(PsiElement cur) {
+    while (cur != null && !cur.isPhysical()) {
+      cur = cur.getParent();
+    }
+    return cur;
+  }
+
+  private static boolean xmlElementsEqual(@NotNull final PsiElement fst, @NotNull final PsiElement snd) {
+    if (fst.equals(snd)) return true;
+
+    if (fst.isValid() && fst.isPhysical() || snd.isValid() && snd.isPhysical()) return false;
+    if (fst.getTextLength() != snd.getTextLength()) return false;
+    if (fst.getStartOffsetInParent() != snd.getStartOffsetInParent()) return false;
+
+    PsiElement nav1 = fst.getNavigationElement();
+    PsiElement nav2 = snd.getNavigationElement();
+    return nav1 != null && nav1.equals(nav2);
+  }
+
+  public int hashCode() {
+    if (!myElement.isPhysical()) {
+      return myElement.getNavigationElement().hashCode();
+    }
+
+    return myElement.hashCode();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/PropertyAccessorInvocation.java b/xml/dom-impl/src/com/intellij/util/xml/impl/PropertyAccessorInvocation.java
new file mode 100644
index 0000000..0d9ca11
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/PropertyAccessorInvocation.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.util.xml.JavaMethod;
+import com.intellij.util.ArrayUtil;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author peter
+*/
+class PropertyAccessorInvocation implements Invocation {
+  final int myLastElement;
+  private final JavaMethod[] myMethods;
+
+  public PropertyAccessorInvocation(final JavaMethod[] methods) {
+    myMethods = methods;
+    myLastElement = myMethods.length - 1;
+  }
+
+  public final Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+    return invoke(0, handler.getProxy());
+  }
+
+  private Object invoke(final int i, final Object object) throws IllegalAccessException, InvocationTargetException {
+    final Object o = myMethods[i].invoke(object, ArrayUtil.EMPTY_OBJECT_ARRAY);
+    if (i == myLastElement) return o;
+
+    if (o instanceof List) {
+      List<Object> result = new ArrayList<Object>();
+      for (Object o1 : (List)o) {
+        result.add(invoke(i + 1, o1));
+      }
+      return result;
+    }
+    return invoke(i + 1, o);
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/RootDomParentStrategy.java b/xml/dom-impl/src/com/intellij/util/xml/impl/RootDomParentStrategy.java
new file mode 100644
index 0000000..10861c0
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/RootDomParentStrategy.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class RootDomParentStrategy implements DomParentStrategy {
+  private final DomFileElementImpl myFileElement;
+
+  public RootDomParentStrategy(final DomFileElementImpl fileElement) {
+    myFileElement = fileElement;
+  }
+
+  @NotNull
+  public DomInvocationHandler getParentHandler() {
+    throw new UnsupportedOperationException("Method getParentHandler is not yet implemented in " + getClass().getName());
+  }
+
+  public XmlTag getXmlElement() {
+    return myFileElement.getRootTag();
+  }
+
+  @NotNull
+  public DomParentStrategy refreshStrategy(final DomInvocationHandler handler) {
+    return this;
+  }
+
+  @NotNull
+  public DomParentStrategy setXmlElement(@NotNull final XmlElement element) {
+    return this;
+  }
+
+  @NotNull
+  public DomParentStrategy clearXmlElement() {
+    return this;
+  }
+
+  @Override
+  public String checkValidity() {
+    return myFileElement.checkValidity();
+  }
+
+  @Override
+  public XmlFile getContainingFile(DomInvocationHandler handler) {
+    return myFileElement.getFile();
+  }
+
+  @Override
+  public boolean isPhysical() {
+    return true;
+  }
+
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (!(o instanceof RootDomParentStrategy)) return false;
+
+    final RootDomParentStrategy that = (RootDomParentStrategy)o;
+
+    if (!myFileElement.equals(that.myFileElement)) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    return myFileElement.hashCode();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/SetInvocation.java b/xml/dom-impl/src/com/intellij/util/xml/impl/SetInvocation.java
new file mode 100644
index 0000000..0a8e46a
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/SetInvocation.java
@@ -0,0 +1,37 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.util.xml.Converter;
+import com.intellij.util.xml.SubTag;
+
+/**
+ * @author peter
+ */
+public class SetInvocation implements Invocation {
+  private final Converter myConverter;
+
+  protected SetInvocation(final Converter converter) {
+    myConverter = converter;
+  }
+
+  public Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+    handler.assertValid();
+    final SubTag annotation = handler.getAnnotation(SubTag.class);
+    final Object arg = args[0];
+    if (annotation != null && annotation.indicator() && arg instanceof Boolean) {
+      if ((Boolean)arg) {
+        handler.ensureTagExists();
+      } else {
+        handler.undefineInternal();
+      }
+    } else {
+      String value = myConverter.toString(arg, new ConvertContextImpl(handler));
+      if (value == null) {
+        handler.undefineInternal();
+      } else {
+        handler.setValue(value);
+      }
+    }
+    return null;
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/StableInvocationHandler.java b/xml/dom-impl/src/com/intellij/util/xml/impl/StableInvocationHandler.java
new file mode 100644
index 0000000..d158301
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/StableInvocationHandler.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Factory;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.MergedObject;
+import com.intellij.util.xml.StableElement;
+import net.sf.cglib.proxy.AdvancedProxy;
+import net.sf.cglib.proxy.InvocationHandler;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author peter
+ */
+class StableInvocationHandler<T> implements InvocationHandler, StableElement {
+  private T myOldValue;
+  private T myCachedValue;
+  private final Set<Class> myClasses;
+  private final Factory<T> myProvider;
+  private final Condition<T> myValidator;
+
+  public StableInvocationHandler(final T initial, final Factory<T> provider, Condition<T> validator) {
+    myProvider = provider;
+    myCachedValue = initial;
+    myOldValue = initial;
+    myValidator = validator;
+    final Class superClass = initial.getClass().getSuperclass();
+    final Set<Class> classes = new HashSet<Class>();
+    ContainerUtil.addAll(classes, initial.getClass().getInterfaces());
+    ContainerUtil.addIfNotNull(superClass, classes);
+    classes.remove(MergedObject.class);
+    myClasses = classes;
+  }
+
+
+  public final Object invoke(Object proxy, final Method method, final Object[] args) throws Throwable {
+    if (StableElement.class.equals(method.getDeclaringClass())) {
+      try {
+        return method.invoke(this, args);
+      }
+      catch (InvocationTargetException e) {
+        throw e.getCause();
+      }
+    }
+
+    if (AdvancedProxy.FINALIZE_METHOD.equals(method)) return null;
+
+    if (isNotValid(myCachedValue)) {
+      if (myCachedValue != null) {
+        myOldValue = myCachedValue;
+      }
+      myCachedValue = myProvider.create();
+      if (isNotValid(myCachedValue)) {
+        if (AdvancedProxy.EQUALS_METHOD.equals(method)) {
+
+          final Object arg = args[0];
+          if (!(arg instanceof StableElement)) return false;
+
+          final StableInvocationHandler handler = DomManagerImpl.getStableInvocationHandler(arg);
+          if (handler == null || handler.getWrappedElement() != null) return false;
+
+          return Comparing.equal(myOldValue, handler.myOldValue);
+        }
+
+        if (myOldValue != null && Object.class.equals(method.getDeclaringClass())) {
+          return method.invoke(myOldValue, args);
+        }
+
+        if ("isValid".equals(method.getName())) {
+          return Boolean.FALSE;
+        }
+        throw new AssertionError("Calling methods on invalid value");
+      }
+    }
+
+    if (AdvancedProxy.EQUALS_METHOD.equals(method)) {
+      final Object arg = args[0];
+      if (arg instanceof StableElement) {
+        return myCachedValue.equals(((StableElement)arg).getWrappedElement());
+      }
+      return myCachedValue.equals(arg);
+
+    }
+    if (AdvancedProxy.HASHCODE_METHOD.equals(method)) {
+      return myCachedValue.hashCode();
+    }
+
+    try {
+      return method.invoke(myCachedValue, args);
+    }
+    catch (InvocationTargetException e) {
+      throw e.getCause();
+    }
+  }
+
+  public final void revalidate() {
+    final T t = myProvider.create();
+    if (!isNotValid(t) && !t.equals(myCachedValue)) {
+      myCachedValue = t;
+    }
+  }
+
+  public final void invalidate() {
+    if (!isNotValid(myCachedValue)) {
+      myCachedValue = null;
+    }
+  }
+
+  public final T getWrappedElement() {
+    if (isNotValid(myCachedValue)) {
+      myCachedValue = myProvider.create();
+    }
+    return myCachedValue;
+  }
+
+  public T getOldValue() {
+    return myOldValue;
+  }
+
+  private boolean isNotValid(final T t) {
+    if (t == null || !myValidator.value(t)) return true;
+    for (final Class aClass : myClasses) {
+      if (!aClass.isInstance(t)) return true;
+    }
+    return false;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/StaticGenericInfo.java b/xml/dom-impl/src/com/intellij/util/xml/impl/StaticGenericInfo.java
new file mode 100644
index 0000000..17e2e29
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/StaticGenericInfo.java
@@ -0,0 +1,322 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.util.Pair;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.*;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.reflect.*;
+import gnu.trove.THashMap;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NonNls;
+
+import java.lang.reflect.Type;
+import java.util.*;
+
+/**
+ * @author peter
+ */
+public class StaticGenericInfo extends DomGenericInfoEx {
+  private final Class myClass;
+
+  private final ChildrenDescriptionsHolder<AttributeChildDescriptionImpl> myAttributes = new ChildrenDescriptionsHolder<AttributeChildDescriptionImpl>();
+  private final ChildrenDescriptionsHolder<FixedChildDescriptionImpl> myFixed = new ChildrenDescriptionsHolder<FixedChildDescriptionImpl>();
+  private final ChildrenDescriptionsHolder<CollectionChildDescriptionImpl> myCollections = new ChildrenDescriptionsHolder<CollectionChildDescriptionImpl>();
+
+  private Map<JavaMethodSignature, Pair<FixedChildDescriptionImpl, Integer>> myFixedChildrenMethods;
+  private Map<JavaMethodSignature, CollectionChildDescriptionImpl> myCollectionChildrenGetterMethods;
+  private final Map<JavaMethodSignature, CollectionChildDescriptionImpl> myCollectionChildrenAdditionMethods = new THashMap<JavaMethodSignature, CollectionChildDescriptionImpl>();
+  private Map<JavaMethodSignature, AttributeChildDescriptionImpl> myAttributeChildrenMethods;
+
+  private final Map<JavaMethodSignature, Set<CollectionChildDescriptionImpl>> myCompositeChildrenMethods = new THashMap<JavaMethodSignature, Set<CollectionChildDescriptionImpl>>();
+  private final Map<JavaMethodSignature, Pair<CollectionChildDescriptionImpl, Set<CollectionChildDescriptionImpl>>> myCompositeCollectionAdditionMethods = new THashMap<JavaMethodSignature, Pair<CollectionChildDescriptionImpl, Set<CollectionChildDescriptionImpl>>>();
+
+  @Nullable private JavaMethod myNameValueGetter;
+  private boolean myValueElement;
+  private boolean myInitialized;
+  private CustomDomChildrenDescriptionImpl myCustomDescription;
+
+  public StaticGenericInfo(final Type type) {
+    myClass = ReflectionUtil.getRawType(type);
+  }
+
+  public final synchronized boolean buildMethodMaps() {
+    if (!myInitialized) {
+      final StaticGenericInfoBuilder builder = new StaticGenericInfoBuilder(myClass);
+      final JavaMethod customChildrenGetter = builder.getCustomChildrenGetter();
+      if (customChildrenGetter != null) {
+        myCustomDescription = new CustomDomChildrenDescriptionImpl(customChildrenGetter);
+      }
+
+      myAttributeChildrenMethods = builder.getAttributes();
+      myAttributes.addDescriptions(myAttributeChildrenMethods.values());
+
+      myFixedChildrenMethods = builder.getFixedGetters();
+      for (final Pair<FixedChildDescriptionImpl, Integer> pair : myFixedChildrenMethods.values()) {
+        myFixed.addDescription(pair.first);
+      }
+
+      myCollectionChildrenGetterMethods = builder.getCollectionGetters();
+      myCollections.addDescriptions(myCollectionChildrenGetterMethods.values());
+
+
+      for (final CollectionChildDescriptionImpl description : myCollectionChildrenGetterMethods.values()) {
+        final XmlName name = description.getXmlName();
+        addAdders(description, builder.collectionAdders.get(name));
+        addAdders(description, builder.collectionIndexAdders.get(name));
+        addAdders(description, builder.collectionIndexClassAdders.get(name));
+        addAdders(description, builder.collectionClassIndexAdders.get(name));
+        addAdders(description, builder.collectionClassAdders.get(name));
+      }
+
+      final NotNullFunction<String, CollectionChildDescriptionImpl> mapper = new NotNullFunction<String, CollectionChildDescriptionImpl>() {
+        @NotNull
+        public CollectionChildDescriptionImpl fun(final String xmlName) {
+          return ObjectUtils.assertNotNull(myCollections.findDescription(xmlName));
+        }
+      };
+      final Map<JavaMethodSignature, String[]> getters = builder.getCompositeCollectionGetters();
+      for (final JavaMethodSignature signature : getters.keySet()) {
+        myCompositeChildrenMethods.put(signature, ContainerUtil.map2Set(getters.get(signature), mapper));
+      }
+      final Map<JavaMethodSignature, Pair<String, String[]>> adders = builder.getCompositeCollectionAdders();
+      for (final JavaMethodSignature signature : adders.keySet()) {
+        final Pair<String, String[]> pair = adders.get(signature);
+        myCompositeCollectionAdditionMethods.put(signature, Pair.create(myCollections.findDescription(pair.first), ContainerUtil.map2Set(pair.second, mapper)));
+      }
+      myNameValueGetter = builder.getNameValueGetter();
+      myValueElement = builder.isValueElement();
+      myInitialized = true;
+    }
+    return true;
+  }
+
+  private void addAdders(final CollectionChildDescriptionImpl description, final Collection<JavaMethod> methods) {
+    if (methods != null) {
+      for (final JavaMethod method : methods) {
+        myCollectionChildrenAdditionMethods.put(method.getSignature(), description);
+      }
+    }
+  }
+
+  public boolean checkInitialized() {
+    return buildMethodMaps();
+  }
+
+  public final Invocation createInvocation(final JavaMethod method) {
+    buildMethodMaps();
+
+    final JavaMethodSignature signature = method.getSignature();
+    final PropertyAccessor accessor = method.getAnnotation(PropertyAccessor.class);
+    if (accessor != null) {
+      return new PropertyAccessorInvocation(DomReflectionUtil.getGetterMethods(accessor.value(), myClass));
+    }
+
+    if (myAttributeChildrenMethods.containsKey(signature)) {
+      return new GetAttributeChildInvocation(myAttributeChildrenMethods.get(signature));
+    }
+
+    if (myFixedChildrenMethods.containsKey(signature)) {
+      return new GetFixedChildInvocation(myFixedChildrenMethods.get(signature));
+    }
+
+    final Set<CollectionChildDescriptionImpl> qnames = myCompositeChildrenMethods.get(signature);
+    if (qnames != null) {
+      return new GetCompositeCollectionInvocation(qnames);
+    }
+
+    if (myCustomDescription != null && method.equals(myCustomDescription.getGetterMethod())) {
+      return new Invocation() {
+        @Nullable
+        public Object invoke(final DomInvocationHandler<?, ?> handler, final Object[] args) throws Throwable {
+          return myCustomDescription.getValues(handler);
+        }
+      };
+    }
+
+    final Pair<CollectionChildDescriptionImpl, Set<CollectionChildDescriptionImpl>> pair = myCompositeCollectionAdditionMethods.get(signature);
+    if (pair != null) {
+      return new AddToCompositeCollectionInvocation(pair.first, pair.second, method.getGenericReturnType());
+    }
+
+    CollectionChildDescriptionImpl description = myCollectionChildrenGetterMethods.get(signature);
+    if (description != null) {
+      return new GetCollectionChildInvocation(description);
+    }
+                                                      
+    description = myCollectionChildrenAdditionMethods.get(signature);
+    if (description != null) {
+      return new AddChildInvocation(getTypeGetter(method), getIndexGetter(method), description, description.getType());
+    }
+
+    return null;
+  }
+
+  private static Function<Object[], Type> getTypeGetter(final JavaMethod method) {
+    final Class<?>[] parameterTypes = method.getParameterTypes();
+    if (parameterTypes.length >= 1 && parameterTypes[0].equals(Class.class)) {
+      return new Function.First<Object, Type>();
+    }
+
+    if (parameterTypes.length == 2 && parameterTypes[1].equals(Class.class)) {
+      return new Function<Object[], Type>() {
+        public Type fun(final Object[] s) {
+          return (Type)s[1];
+        }
+      };
+    }
+
+    return new Function<Object[], Type>() {
+      public Type fun(final Object[] s) {
+        return method.getGenericReturnType();
+      }
+    };
+  }
+
+
+  private static Function<Object[], Integer> getIndexGetter(final JavaMethod method) {
+    final Class<?>[] parameterTypes = method.getParameterTypes();
+    if (parameterTypes.length >= 1 && parameterTypes[0].equals(int.class)) {
+      return new Function.First<Object, Integer>();
+    }
+
+    if (parameterTypes.length == 2 && parameterTypes[1].equals(int.class)) {
+      return new Function<Object[], Integer>() {
+        public Integer fun(final Object[] s) {
+          return (Integer)s[1];
+        }
+      };
+    }
+
+    return new ConstantFunction<Object[], Integer>(Integer.MAX_VALUE);
+  }
+
+  @Nullable
+  public XmlElement getNameElement(DomElement element) {
+    buildMethodMaps();
+
+    Object o = getNameObject(element);
+    if (o instanceof GenericAttributeValue) {
+      return ((GenericAttributeValue)o).getXmlAttributeValue();
+    } else if (o instanceof DomElement) {
+      return ((DomElement)o).getXmlTag();
+    }
+    else {
+      return null;
+    }
+  }
+
+  @Nullable
+  public GenericDomValue getNameDomElement(DomElement element) {
+    buildMethodMaps();
+
+    Object o = getNameObject(element);
+    return o instanceof GenericDomValue ? (GenericDomValue)o : null;
+  }
+
+  @NotNull
+  public List<? extends CustomDomChildrenDescriptionImpl> getCustomNameChildrenDescription() {
+    return myCustomDescription == null ? Collections.<CustomDomChildrenDescriptionImpl>emptyList() : Collections.singletonList(myCustomDescription);
+  }
+
+  @Nullable
+  private Object getNameObject(DomElement element) {
+    return myNameValueGetter == null ? null : myNameValueGetter.invoke(element);
+  }
+
+  @Nullable
+  public String getElementName(DomElement element) {
+    buildMethodMaps();
+    Object o = getNameObject(element);
+    return o == null || o instanceof String ? (String)o : ((GenericValue)o).getStringValue();
+  }
+
+  @NotNull
+  public List<AbstractDomChildDescriptionImpl> getChildrenDescriptions() {
+    buildMethodMaps();
+    final ArrayList<AbstractDomChildDescriptionImpl> list = new ArrayList<AbstractDomChildDescriptionImpl>();
+    myAttributes.dumpDescriptions(list);
+    myFixed.dumpDescriptions(list);
+    myCollections.dumpDescriptions(list);
+    list.addAll(getCustomNameChildrenDescription());
+    return list;
+  }
+
+  @NotNull
+  public List<? extends DomFixedChildDescription> getFixedChildrenDescriptions() {
+    buildMethodMaps();
+    return myFixed.getDescriptions();
+  }
+
+  @NotNull
+  public List<? extends DomCollectionChildDescription> getCollectionChildrenDescriptions() {
+    buildMethodMaps();
+    return myCollections.getDescriptions();
+  }
+
+  public boolean isTagValueElement() {
+    buildMethodMaps();
+    return myValueElement;
+  }
+
+  @NotNull
+  public List<AttributeChildDescriptionImpl> getAttributeChildrenDescriptions() {
+    buildMethodMaps();
+    return new ArrayList<AttributeChildDescriptionImpl>(myAttributeChildrenMethods.values());
+  }
+
+  @Override
+  public boolean processAttributeChildrenDescriptions(Processor<AttributeChildDescriptionImpl> processor) {
+    List<AttributeChildDescriptionImpl> descriptions = getAttributeChildrenDescriptions();
+    return ContainerUtil.process(descriptions, processor);
+  }
+
+  @Nullable
+  public DomFixedChildDescription getFixedChildDescription(@NonNls final String tagName) {
+    buildMethodMaps();
+    return myFixed.findDescription(tagName);
+  }
+
+  @Nullable
+  public DomFixedChildDescription getFixedChildDescription(@NonNls final String tagName, @NonNls final String namespaceKey) {
+    buildMethodMaps();
+    return myFixed.getDescription(tagName, namespaceKey);
+  }
+
+  @Nullable
+  public DomCollectionChildDescription getCollectionChildDescription(@NonNls final String tagName) {
+    buildMethodMaps();
+    return myCollections.findDescription(tagName);
+  }
+
+  @Nullable
+  public DomCollectionChildDescription getCollectionChildDescription(@NonNls final String tagName, @NonNls final String namespaceKey) {
+    buildMethodMaps();
+    return myCollections.getDescription(tagName, namespaceKey);
+  }
+
+  @Nullable
+  public DomAttributeChildDescription getAttributeChildDescription(@NonNls final String attributeName) {
+    buildMethodMaps();
+    return myAttributes.findDescription(attributeName);
+  }
+
+  @Nullable
+  public DomAttributeChildDescription getAttributeChildDescription(@NonNls final String attributeName, @NonNls final String namespaceKey) {
+    buildMethodMaps();
+    return myAttributes.getDescription(attributeName, namespaceKey);
+  }
+
+  public ChildrenDescriptionsHolder<AttributeChildDescriptionImpl> getAttributes() {
+    return myAttributes;
+  }
+
+  public ChildrenDescriptionsHolder<CollectionChildDescriptionImpl> getCollections() {
+    return myCollections;
+  }
+
+  public ChildrenDescriptionsHolder<FixedChildDescriptionImpl> getFixed() {
+    return myFixed;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/StaticGenericInfoBuilder.java b/xml/dom-impl/src/com/intellij/util/xml/impl/StaticGenericInfoBuilder.java
new file mode 100644
index 0000000..d70a401
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/StaticGenericInfoBuilder.java
@@ -0,0 +1,386 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.util.MultiValuesMap;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.ReflectionCache;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.SmartList;
+import com.intellij.util.containers.FactoryMap;
+import com.intellij.util.xml.*;
+import gnu.trove.THashMap;
+import gnu.trove.THashSet;
+import gnu.trove.TIntObjectHashMap;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Type;
+import java.util.*;
+
+/**
+ * @author peter
+ */
+public class StaticGenericInfoBuilder {
+  private static final Set ADDER_PARAMETER_TYPES = new THashSet<Class>(Arrays.asList(Class.class, int.class));
+  private final Class myClass;
+  private final MultiValuesMap<XmlName, JavaMethod> myCollectionGetters = new MultiValuesMap<XmlName, JavaMethod>();
+  final MultiValuesMap<XmlName, JavaMethod> collectionAdders = new MultiValuesMap<XmlName, JavaMethod>();
+  final MultiValuesMap<XmlName, JavaMethod> collectionClassAdders = new MultiValuesMap<XmlName, JavaMethod>();
+  final MultiValuesMap<XmlName, JavaMethod> collectionIndexAdders = new MultiValuesMap<XmlName, JavaMethod>();
+  final MultiValuesMap<XmlName, JavaMethod> collectionIndexClassAdders = new MultiValuesMap<XmlName, JavaMethod>();
+  final MultiValuesMap<XmlName, JavaMethod> collectionClassIndexAdders = new MultiValuesMap<XmlName, JavaMethod>();
+  private final Map<XmlName, Type> myCollectionChildrenTypes = new THashMap<XmlName, Type>();
+  private final Map<JavaMethodSignature, String[]> myCompositeCollectionGetters = new THashMap<JavaMethodSignature, String[]>();
+  private final Map<JavaMethodSignature, Pair<String,String[]>> myCompositeCollectionAdders = new THashMap<JavaMethodSignature, Pair<String,String[]>>();
+  private final FactoryMap<XmlName, TIntObjectHashMap<Collection<JavaMethod>>> myFixedChildrenGetters = new FactoryMap<XmlName, TIntObjectHashMap<Collection<JavaMethod>>>() {
+    protected TIntObjectHashMap<Collection<JavaMethod>> create(final XmlName key) {
+      return new TIntObjectHashMap<Collection<JavaMethod>>();
+    }
+  };
+  private final Map<JavaMethodSignature, AttributeChildDescriptionImpl> myAttributes = new THashMap<JavaMethodSignature, AttributeChildDescriptionImpl>();
+
+  private boolean myValueElement;
+  private JavaMethod myNameValueGetter;
+  private JavaMethod myCustomChildrenGetter;
+
+  public StaticGenericInfoBuilder(final Class aClass) {
+    myClass = aClass;
+
+    final Set<JavaMethod> methods = new THashSet<JavaMethod>();
+    InvocationCache invocationCache = DomApplicationComponent.getInstance().getInvocationCache(myClass);
+    for (final Method method : ReflectionCache.getMethods(myClass)) {
+      methods.add(invocationCache.getInternedMethod(method));
+    }
+    for (final JavaMethod method : methods) {
+      if (DomImplUtil.isGetter(method) && method.getAnnotation(NameValue.class) != null) {
+        myNameValueGetter = method;
+        break;
+      }
+    }
+
+    {
+      final Class implClass = DomApplicationComponent.getInstance().getImplementation(myClass);
+      if (implClass != null) {
+        for (Method method : ReflectionCache.getMethods(implClass)) {
+          final int modifiers = method.getModifiers();
+          if (!Modifier.isAbstract(modifiers) &&
+              !Modifier.isVolatile(modifiers) &&
+              new JavaMethodSignature(method).findMethod(myClass) != null) {
+            methods.remove(invocationCache.getInternedMethod(method));
+          }
+        }
+      }
+    }
+
+    for (Iterator<JavaMethod> iterator = methods.iterator(); iterator.hasNext();) {
+      final JavaMethod method = iterator.next();
+      if (isCoreMethod(method) || DomImplUtil.isTagValueSetter(method) || method.getAnnotation(PropertyAccessor.class) != null) {
+        iterator.remove();
+      }
+    }
+
+    for (Iterator<JavaMethod> iterator = methods.iterator(); iterator.hasNext();) {
+      final JavaMethod method = iterator.next();
+      if (DomImplUtil.isGetter(method) && processGetterMethod(method)) {
+        iterator.remove();
+      }
+    }
+
+    for (Iterator<JavaMethod> iterator = methods.iterator(); iterator.hasNext();) {
+      final JavaMethod method = iterator.next();
+      final SubTagsList subTagsList = method.getAnnotation(SubTagsList.class);
+      if (subTagsList != null && method.getName().startsWith("add")) {
+        final String localName = subTagsList.tagName();
+        assert StringUtil.isNotEmpty(localName);
+        final String[] set = subTagsList.value();
+        assert Arrays.asList(set).contains(localName);
+        myCompositeCollectionAdders.put(method.getSignature(), Pair.create(localName, set));
+        iterator.remove();
+      }
+      else if (isAddMethod(method)) {
+        final XmlName xmlName = extractTagName(method, "add");
+        if (myCollectionGetters.containsKey(xmlName)) {
+          MultiValuesMap<XmlName, JavaMethod> adders = getAddersMap(method);
+          if (adders != null) {
+            adders.put(xmlName, method);
+            iterator.remove();
+          }
+        }
+      }
+    }
+
+    //noinspection ConstantIfStatement
+    if (false) {
+      if (!methods.isEmpty()) {
+        StringBuilder sb = new StringBuilder(myClass + " should provide the following implementations:");
+        for (JavaMethod method : methods) {
+          sb.append("\n  ");
+          sb.append(method);
+        }
+        assert false : sb.toString();
+        //System.out.println(sb.toString());
+      }
+    }
+  }
+
+  @Nullable
+  private MultiValuesMap<XmlName, JavaMethod> getAddersMap(final JavaMethod method) {
+    final Class<?>[] parameterTypes = method.getParameterTypes();
+    switch (parameterTypes.length) {
+      case 0:
+        return collectionAdders;
+      case 1:
+        if (Class.class.equals(parameterTypes[0])) return collectionClassAdders;
+        if (isInt(parameterTypes[0])) return collectionIndexAdders;
+        break;
+      case 2:
+        if (isIndexClassAdder(parameterTypes[0], parameterTypes[1])) return collectionIndexClassAdders;
+        if (isIndexClassAdder(parameterTypes[1], parameterTypes[0])) return collectionClassIndexAdders;
+    }
+    return null;
+  }
+
+  private static boolean isIndexClassAdder(final Class<?> first, final Class<?> second) {
+    return isInt(first) && second.equals(Class.class);
+  }
+
+  private static boolean isInt(final Class<?> aClass) {
+    return aClass.equals(int.class) || aClass.equals(Integer.class);
+  }
+
+  private boolean isAddMethod(JavaMethod method) {
+    final XmlName tagName = extractTagName(method, "add");
+    if (tagName == null) return false;
+
+    final Type type = myCollectionChildrenTypes.get(tagName);
+    if (type == null || !ReflectionUtil.getRawType(type).isAssignableFrom(method.getReturnType())) return false;
+
+    return ADDER_PARAMETER_TYPES.containsAll(Arrays.asList(method.getParameterTypes()));
+  }
+
+  @Nullable
+  private XmlName extractTagName(JavaMethod method, @NonNls String prefix) {
+    final String name = method.getName();
+    if (!name.startsWith(prefix)) return null;
+
+    final SubTagList subTagAnnotation = method.getAnnotation(SubTagList.class);
+    if (subTagAnnotation != null && !StringUtil.isEmpty(subTagAnnotation.value())) {
+      return DomImplUtil.createXmlName(subTagAnnotation.value(), method);
+    }
+
+    final String tagName = getNameStrategy(false).convertName(name.substring(prefix.length()));
+    return StringUtil.isEmpty(tagName) ? null : DomImplUtil.createXmlName(tagName, method);
+  }
+
+  private static boolean isDomElement(final Type type) {
+    return type != null && DomElement.class.isAssignableFrom(ReflectionUtil.getRawType(type));
+  }
+
+  private boolean processGetterMethod(final JavaMethod method) {
+    if (DomImplUtil.isTagValueGetter(method)) {
+      myValueElement = true;
+      return true;
+    }
+
+    final Class returnType = method.getReturnType();
+    final boolean isAttributeValueMethod = GenericAttributeValue.class.isAssignableFrom(returnType);
+    final JavaMethodSignature signature = method.getSignature();
+    final Attribute annotation = method.getAnnotation(Attribute.class);
+    final boolean isAttributeMethod = annotation != null || isAttributeValueMethod;
+    if (annotation != null) {
+      assert
+        isAttributeValueMethod || GenericAttributeValue.class.isAssignableFrom(returnType) :
+        method + " should return GenericAttributeValue";
+    }
+    if (isAttributeMethod) {
+      final String s = annotation == null ? null : annotation.value();
+      String attributeName = StringUtil.isEmpty(s) ? getNameFromMethod(method, true) : s;
+      assert attributeName != null && StringUtil.isNotEmpty(attributeName) : "Can't guess attribute name from method name: " + method.getName();
+      final XmlName attrName = DomImplUtil.createXmlName(attributeName, method);
+      myAttributes.put(signature, new AttributeChildDescriptionImpl(attrName, method));
+      return true;
+    }
+
+    if (isDomElement(returnType)) {
+      final String qname = getSubTagName(method);
+      if (qname != null) {
+        final XmlName xmlName = DomImplUtil.createXmlName(qname, method);
+        assert !myCollectionChildrenTypes.containsKey(xmlName) : "Collection and fixed children cannot intersect: " + qname;
+        int index = 0;
+        final SubTag subTagAnnotation = method.getAnnotation(SubTag.class);
+        if (subTagAnnotation != null && subTagAnnotation.index() != 0) {
+          index = subTagAnnotation.index();
+        }
+        final TIntObjectHashMap<Collection<JavaMethod>> map = myFixedChildrenGetters.get(xmlName);
+        Collection<JavaMethod> methods = map.get(index);
+        if (methods == null) {
+          map.put(index, methods = new SmartList<JavaMethod>());
+        }
+        methods.add(method);
+        return true;
+      }
+    }
+
+    final Type type = DomReflectionUtil.extractCollectionElementType(method.getGenericReturnType());
+    if (isDomElement(type)) {
+      final CustomChildren customChildren = method.getAnnotation(CustomChildren.class);
+      if (customChildren != null) {
+        myCustomChildrenGetter = method;
+        return true;
+      }
+
+      final SubTagsList subTagsList = method.getAnnotation(SubTagsList.class);
+      if (subTagsList != null) {
+        myCompositeCollectionGetters.put(signature, subTagsList.value());
+        return true;
+      }
+
+      final String qname = getSubTagNameForCollection(method);
+      if (qname != null) {
+        XmlName xmlName = DomImplUtil.createXmlName(qname, type, method);
+        assert !myFixedChildrenGetters.containsKey(xmlName) : "Collection and fixed children cannot intersect: " + qname;
+        myCollectionChildrenTypes.put(xmlName, type);
+        myCollectionGetters.put(xmlName, method);
+        return true;
+      }
+    }
+
+    return false;
+  }
+
+  private static boolean isCoreMethod(final JavaMethod method) {
+    if (method.getSignature().findMethod(DomElement.class) != null) return true;
+
+    final Class<?> aClass = method.getDeclaringClass();
+    return aClass.equals(GenericAttributeValue.class) || aClass.equals(GenericDomValue.class) && "getConverter".equals(method.getName());
+  }
+
+  @Nullable
+  private String getSubTagName(final JavaMethod method) {
+    final SubTag subTagAnnotation = method.getAnnotation(SubTag.class);
+    if (subTagAnnotation == null || StringUtil.isEmpty(subTagAnnotation.value())) {
+      return getNameFromMethod(method, false);
+    }
+    return subTagAnnotation.value();
+  }
+
+  @Nullable
+  private String getSubTagNameForCollection(final JavaMethod method) {
+    final SubTagList subTagList = method.getAnnotation(SubTagList.class);
+    if (subTagList == null || StringUtil.isEmpty(subTagList.value())) {
+      final String propertyName = getPropertyName(method);
+      if (propertyName != null) {
+        final String singular = StringUtil.unpluralize(propertyName);
+        assert singular != null : "Can't unpluralize: " + propertyName;
+        return getNameStrategy(false).convertName(singular);
+      }
+      else {
+        return null;
+      }
+    }
+    return subTagList.value();
+  }
+
+  @Nullable
+  private String getNameFromMethod(final JavaMethod method, boolean isAttribute) {
+    final String propertyName = getPropertyName(method);
+    return propertyName == null ? null : getNameStrategy(isAttribute).convertName(propertyName);
+  }
+
+  @Nullable
+  private static String getPropertyName(JavaMethod method) {
+    return StringUtil.getPropertyName(method.getMethodName());
+  }
+
+  @NotNull
+  private DomNameStrategy getNameStrategy(boolean isAttribute) {
+    final DomNameStrategy strategy = DomImplUtil.getDomNameStrategy(ReflectionUtil.getRawType(myClass), isAttribute);
+    return strategy != null ? strategy : DomNameStrategy.HYPHEN_STRATEGY;
+  }
+
+  final JavaMethod getCustomChildrenGetter() {
+    return myCustomChildrenGetter;
+  }
+
+  final Map<JavaMethodSignature, AttributeChildDescriptionImpl> getAttributes() {
+    return myAttributes;
+  }
+
+  final Map<JavaMethodSignature, Pair<FixedChildDescriptionImpl, Integer>> getFixedGetters() {
+    final Map<JavaMethodSignature, Pair<FixedChildDescriptionImpl, Integer>> map = new THashMap<JavaMethodSignature, Pair<FixedChildDescriptionImpl, Integer>>();
+    final Set<XmlName> names = myFixedChildrenGetters.keySet();
+    for (final XmlName name : names) {
+      final TIntObjectHashMap<Collection<JavaMethod>> map1 = myFixedChildrenGetters.get(name);
+      int max = 0;
+      final int[] ints = map1.keys();
+      for (final int i : ints) {
+        max = Math.max(max, i);
+      }
+      int count = max + 1;
+      final Collection<JavaMethod>[] getters = new Collection[count];
+      for (final int i : ints) {
+        getters[i] = map1.get(i);
+      }
+      final FixedChildDescriptionImpl description = new FixedChildDescriptionImpl(name, map1.get(0).iterator().next().getGenericReturnType(), count, getters);
+      for (int i = 0; i < getters.length; i++) {
+        final Collection<JavaMethod> collection = getters[i];
+        for (final JavaMethod method : collection) {
+          map.put(method.getSignature(), Pair.create(description, i));
+        }
+      }
+    }
+    return map;
+  }
+
+  final Map<JavaMethodSignature, CollectionChildDescriptionImpl> getCollectionGetters() {
+    final Map<JavaMethodSignature, CollectionChildDescriptionImpl> getters = new THashMap<JavaMethodSignature, CollectionChildDescriptionImpl>();
+    for (final XmlName xmlName : myCollectionGetters.keySet()) {
+      final Collection<JavaMethod> collGetters = myCollectionGetters.get(xmlName);
+      final JavaMethod method = collGetters.iterator().next();
+
+
+      final CollectionChildDescriptionImpl description = new CollectionChildDescriptionImpl(xmlName, DomReflectionUtil.extractCollectionElementType(method.getGenericReturnType()),
+                                                                                            collGetters
+      );
+      for (final JavaMethod getter : collGetters) {
+        getters.put(getter.getSignature(), description);
+      }
+    }
+
+    return getters;
+  }
+
+  final Map<JavaMethodSignature, Pair<String, String[]>> getCompositeCollectionAdders() {
+    return myCompositeCollectionAdders;
+  }
+
+  final Map<JavaMethodSignature, String[]> getCompositeCollectionGetters() {
+    return myCompositeCollectionGetters;
+  }
+
+  public JavaMethod getNameValueGetter() {
+    return myNameValueGetter;
+  }
+
+  public boolean isValueElement() {
+    return myValueElement;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/VirtualDomParentStrategy.java b/xml/dom-impl/src/com/intellij/util/xml/impl/VirtualDomParentStrategy.java
new file mode 100644
index 0000000..73da7d6
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/VirtualDomParentStrategy.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class VirtualDomParentStrategy implements DomParentStrategy {
+  private final DomInvocationHandler myParentHandler;
+  private long myModCount;
+  private final PsiFile myModificationTracker;
+
+  public VirtualDomParentStrategy(@NotNull final DomInvocationHandler parentHandler) {
+    myParentHandler = parentHandler;
+    myModificationTracker = parentHandler.getFile();
+    myModCount = getModCount();
+  }
+
+  private long getModCount() {
+    return myModificationTracker.getModificationStamp();
+  }
+
+  @NotNull
+  public DomInvocationHandler getParentHandler() {
+    return myParentHandler;
+  }
+
+  public XmlElement getXmlElement() {
+    return null;
+  }
+
+  @NotNull
+  public synchronized DomParentStrategy refreshStrategy(final DomInvocationHandler handler) {
+    if (!myParentHandler.isValid()) return this;
+
+    final long modCount = getModCount();
+    if (modCount != myModCount) {
+      final XmlElement xmlElement = handler.recomputeXmlElement(myParentHandler);
+      if (xmlElement != null) {
+        return new PhysicalDomParentStrategy(xmlElement, DomManagerImpl.getDomManager(xmlElement.getProject()));
+      }
+      myModCount = modCount;
+    }
+    return this;
+  }
+
+  @NotNull
+  public DomParentStrategy setXmlElement(@NotNull final XmlElement element) {
+    return new PhysicalDomParentStrategy(element, DomManagerImpl.getDomManager(element.getProject()));
+  }
+
+  @NotNull
+  public synchronized DomParentStrategy clearXmlElement() {
+    myModCount = getModCount();
+    return this;
+  }
+
+  @Override
+  public synchronized String checkValidity() {
+    if (getModCount() == myModCount) {
+      return null;
+    }
+    return "mod count changed";
+  }
+
+  @Override
+  public XmlFile getContainingFile(DomInvocationHandler handler) {
+    return DomImplUtil.getFile(handler);
+  }
+
+  @Override
+  public boolean isPhysical() {
+    return false;
+  }
+
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (!(o instanceof VirtualDomParentStrategy)) return false;
+
+    final VirtualDomParentStrategy that = (VirtualDomParentStrategy)o;
+
+    if (!myParentHandler.equals(that.myParentHandler)) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    return myParentHandler.hashCode();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/VisitorDescription.java b/xml/dom-impl/src/com/intellij/util/xml/impl/VisitorDescription.java
new file mode 100644
index 0000000..80ea5cd
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/VisitorDescription.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.impl;
+
+import com.intellij.util.ReflectionCache;
+import com.intellij.util.containers.ConcurrentClassMap;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomElementVisitor;
+import com.intellij.util.xml.DomReflectionUtil;
+import org.jetbrains.annotations.NonNls;
+
+import java.lang.reflect.Method;
+
+/**
+ * @author peter
+ */
+public class VisitorDescription {
+  private final Class<? extends DomElementVisitor> myVisitorClass;
+  private final ConcurrentClassMap<Method> myMethods = new ConcurrentClassMap<Method>();
+  @NonNls private static final String VISIT = "visit";
+
+  public VisitorDescription(final Class<? extends DomElementVisitor> visitorClass) {
+    myVisitorClass = visitorClass;
+    for (final Method method : ReflectionCache.getMethods(visitorClass)) {
+      final Class<?>[] parameterTypes = method.getParameterTypes();
+      if (parameterTypes.length != 1) {
+        continue;
+      }
+      final Class<?> domClass = parameterTypes[0];
+      if (!ReflectionCache.isAssignable(DomElement.class, domClass)) {
+        continue;
+      }
+      final String methodName = method.getName();
+      if (VISIT.equals(methodName) || methodName.startsWith(VISIT) /*&& domClass.getSimpleName().equals(methodName.substring(VISIT.length()))*/) {
+        method.setAccessible(true);
+        myMethods.put(domClass, method);
+      }
+    }
+  }
+
+  public void acceptElement(DomElementVisitor visitor, DomElement element) {
+    final Method method = myMethods.get(element.getClass());
+    assert method != null : myVisitorClass + " can't accept element of type " + element.getClass();
+    DomReflectionUtil.invokeMethod(method, visitor, element);
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/reflect/DomExtenderEP.java b/xml/dom-impl/src/com/intellij/util/xml/reflect/DomExtenderEP.java
new file mode 100644
index 0000000..45ee3aa
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/reflect/DomExtenderEP.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.reflect;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.extensions.AbstractExtensionPointBean;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.project.Project;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xmlb.annotations.Attribute;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public class DomExtenderEP extends AbstractExtensionPointBean {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.reflect.DomExtenderEP");
+  public static final ExtensionPointName<DomExtenderEP> EP_NAME = ExtensionPointName.create("com.intellij.dom.extender");
+
+  @Attribute("domClass")
+  public String domClassName;
+  @Attribute("extenderClass")
+  public String extenderClassName;
+
+  private Class<?> myDomClass;
+  private DomExtender myExtender;
+
+
+  @Nullable
+  public DomExtensionsRegistrarImpl extend(@NotNull final Project project, @NotNull final DomElement element, @Nullable DomExtensionsRegistrarImpl registrar) {
+    if (myExtender == null) {
+      try {
+        myDomClass = findClass(domClassName);
+        myExtender = instantiate(extenderClassName, project.getPicoContainer());
+      }
+      catch(Exception e) {
+        LOG.error(e);
+        return null;
+      }
+    }
+    if (myDomClass.isInstance(element)) {
+      if (registrar == null) {
+        registrar = new DomExtensionsRegistrarImpl();
+      }
+      myExtender.registerExtensions(element, registrar);
+    }
+    return registrar;
+  }
+
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/reflect/DomExtensionImpl.java b/xml/dom-impl/src/com/intellij/util/xml/reflect/DomExtensionImpl.java
new file mode 100644
index 0000000..d3931dde
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/reflect/DomExtensionImpl.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.reflect;
+
+import com.intellij.openapi.util.Key;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.SmartPointerManager;
+import com.intellij.psi.SmartPsiElementPointer;
+import com.intellij.util.SmartList;
+import com.intellij.util.xml.Converter;
+import com.intellij.util.xml.DomAnchor;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.XmlName;
+import com.intellij.util.xml.impl.ConvertAnnotationImpl;
+import com.intellij.util.xml.impl.DomAnchorImpl;
+import com.intellij.util.xml.impl.DomChildDescriptionImpl;
+import gnu.trove.THashMap;
+import org.jetbrains.annotations.NotNull;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author peter
+ */
+public class DomExtensionImpl implements DomExtension {
+  public static final Key<DomAnchor> KEY_DOM_DECLARATION = Key.create("DOM_DECLARATION");
+  public static final Key<List<DomExtender>> DOM_EXTENDER_KEY = Key.create("Dom.Extender");
+  public static final Key<SmartPsiElementPointer<?>> DECLARING_ELEMENT_KEY = Key.create("Dom.Extension.PsiDeclaration");
+  private final XmlName myXmlName;
+  private final Type myType;
+  private Converter myConverter;
+  private final List<Annotation> myCustomAnnos = new SmartList<Annotation>();
+  private boolean mySoft;
+  private int myCount = 1;
+  private Map myUserMap;
+  private CustomDomChildrenDescription.TagNameDescriptor myTagNameDescriptor = CustomDomChildrenDescription.TagNameDescriptor.EMPTY;
+  private CustomDomChildrenDescription.AttributeDescriptor myAttributesDescriptor;
+
+  public DomExtensionImpl(final Type type, final XmlName xmlName) {
+    myType = type;
+    myXmlName = xmlName;
+  }
+
+  public void setTagNameDescriptor(CustomDomChildrenDescription.TagNameDescriptor tagNameDescriptor) {
+    myTagNameDescriptor = tagNameDescriptor;
+  }
+
+  public CustomDomChildrenDescription.TagNameDescriptor getTagNameDescriptor() {
+    return myTagNameDescriptor;
+  }
+
+  public CustomDomChildrenDescription.AttributeDescriptor getAttributesDescriptor() {
+    return myAttributesDescriptor;
+  }
+
+  public void setAttributesDescriptor(CustomDomChildrenDescription.AttributeDescriptor attributesDescriptor) {
+    myAttributesDescriptor = attributesDescriptor;
+  }
+
+  @NotNull
+  public XmlName getXmlName() {
+    return myXmlName;
+  }
+
+  @NotNull
+  public Type getType() {
+    return myType;
+  }
+
+  public DomExtension setDeclaringElement(@NotNull DomElement declaringElement) {
+    putUserData(KEY_DOM_DECLARATION, DomAnchorImpl.createAnchor(declaringElement, true));
+    return this;
+  }
+
+  @Override
+  public DomExtension setDeclaringElement(@NotNull PsiElement declaringElement) {
+    putUserData(DECLARING_ELEMENT_KEY, SmartPointerManager.getInstance(declaringElement.getProject()).createSmartPsiElementPointer(declaringElement));
+    return this;
+  }
+
+  public DomExtension setConverter(@NotNull Converter converter) {
+    return setConverter(converter, false);
+  }
+
+  public final DomExtension setConverter(@NotNull final Converter converter, final boolean soft) {
+    myConverter = converter;
+    mySoft = soft;
+    return this;
+  }
+
+  public DomExtension addCustomAnnotation(@NotNull final Annotation anno) {
+    myCustomAnnos.add(anno);
+    return this;
+  }
+
+  public <T> void putUserData(final Key<T> key, final T value) {
+    if (myUserMap == null) myUserMap = new THashMap();
+    myUserMap.put(key, value);
+  }
+
+  public DomExtension addExtender(final DomExtender extender) {
+    if (myUserMap == null || !myUserMap.containsKey(DOM_EXTENDER_KEY)) {
+      putUserData(DOM_EXTENDER_KEY, new SmartList<DomExtender>());
+    }
+    ((List<DomExtender>)myUserMap.get(DOM_EXTENDER_KEY)).add(extender);
+    return this;
+  }
+
+  public final DomExtensionImpl setCount(final int count) {
+    myCount = count;
+    return this;
+  }
+
+  public final int getCount() {
+    return myCount;
+  }
+
+  public final <T extends DomChildDescriptionImpl> T addAnnotations(T t) {
+    t.setUserMap(myUserMap);
+    if (myConverter != null) {
+      t.addCustomAnnotation(new ConvertAnnotationImpl(myConverter, mySoft));
+    }
+    for (final Annotation anno : myCustomAnnos) {
+      t.addCustomAnnotation(anno);
+    }
+    return t;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/reflect/DomExtensionsRegistrarImpl.java b/xml/dom-impl/src/com/intellij/util/xml/reflect/DomExtensionsRegistrarImpl.java
new file mode 100644
index 0000000..415b0f6
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/reflect/DomExtensionsRegistrarImpl.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.reflect;
+
+import com.intellij.util.ParameterizedTypeImpl;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.SmartList;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.XmlName;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author peter
+ */
+public class DomExtensionsRegistrarImpl implements DomExtensionsRegistrar {
+  private final List<DomExtensionImpl> myAttributes = new SmartList<DomExtensionImpl>();
+  private final List<DomExtensionImpl> myFixeds = new SmartList<DomExtensionImpl>();
+  private final List<DomExtensionImpl> myCollections = new SmartList<DomExtensionImpl>();
+  private final Set<Object> myDependencies = new THashSet<Object>();
+  private final List<DomExtensionImpl> myCustoms = new SmartList<DomExtensionImpl>();
+
+  public List<DomExtensionImpl> getAttributes() {
+    return myAttributes;
+  }
+  public List<DomExtensionImpl> getFixeds() {
+    return myFixeds;
+  }
+
+  public List<DomExtensionImpl> getCollections() {
+    return myCollections;
+  }
+
+  public List<DomExtensionImpl> getCustoms() {
+    return myCustoms;
+  }
+
+  @NotNull
+  public final DomExtension registerFixedNumberChildrenExtension(@NotNull final XmlName name, @NotNull final Type type, final int count) {
+    assert count > 0;
+    return addExtension(myFixeds, name, type).setCount(count);
+  }
+
+  @NotNull
+  public DomExtension registerFixedNumberChildExtension(@NotNull final XmlName name, @NotNull final Type type) {
+    return registerFixedNumberChildrenExtension(name, type, 1);
+  }
+
+  @NotNull
+  public DomExtension registerCollectionChildrenExtension(@NotNull final XmlName name, @NotNull final Type type) {
+    return addExtension(myCollections, name, type);
+  }
+
+  @NotNull
+  public DomExtension registerGenericAttributeValueChildExtension(@NotNull final XmlName name, final Type parameterType) {
+    return addExtension(myAttributes, name, new ParameterizedTypeImpl(GenericAttributeValue.class, parameterType));
+  }
+
+  @NotNull
+  public DomExtension registerAttributeChildExtension(@NotNull final XmlName name, @NotNull final Type type) {
+    assert GenericAttributeValue.class.isAssignableFrom(ReflectionUtil.getRawType(type));
+    return addExtension(myAttributes, name, type);
+  }
+
+  @NotNull
+  public DomExtension registerCustomChildrenExtension(@NotNull final Type type) {
+    return registerCustomChildrenExtension(type, CustomDomChildrenDescription.TagNameDescriptor.EMPTY);
+  }
+
+  @NotNull
+  @Override
+  public DomExtension registerCustomChildrenExtension(@NotNull Type type,
+                                                      @NotNull CustomDomChildrenDescription.TagNameDescriptor descriptor) {
+    DomExtensionImpl extension = addExtension(myCustoms, null, type);
+    extension.setTagNameDescriptor(descriptor);
+    return extension;
+  }
+
+  @NotNull
+  @Override
+  public DomExtension registerCustomChildrenExtension(@NotNull Type type,
+                                                      @NotNull CustomDomChildrenDescription.AttributeDescriptor attributeDescriptor) {
+
+    DomExtensionImpl extension = addExtension(myCustoms, null, type);
+    extension.setAttributesDescriptor(attributeDescriptor);
+    return extension;
+  }
+
+  private static DomExtensionImpl addExtension(final List<DomExtensionImpl> list, @Nullable final XmlName name, final Type type) {
+    final DomExtensionImpl extension = new DomExtensionImpl(type, name);
+    list.add(extension);
+    return extension;
+  }
+
+  public final void addDependencies(Object[] deps) {
+    ContainerUtil.addAll(myDependencies, deps);
+  }
+
+  public Object[] getDependencies() {
+    return myDependencies.toArray();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureTreeElement.java b/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureTreeElement.java
new file mode 100644
index 0000000..4794cf5
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureTreeElement.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.structure;
+
+import com.intellij.ide.structureView.StructureViewTreeElement;
+import com.intellij.ide.util.treeView.smartTree.TreeElement;
+import com.intellij.navigation.ItemPresentation;
+import com.intellij.util.Function;
+import com.intellij.util.xml.*;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.util.ArrayList;
+
+/**
+ * @author Gregory.Shrago
+ */
+public class DomStructureTreeElement implements StructureViewTreeElement, ItemPresentation {
+  private final DomElement myElement;
+  private final Function<DomElement, DomService.StructureViewMode> myDescriptor;
+  private final DomElementNavigationProvider myNavigationProvider;
+
+  public DomStructureTreeElement(@NotNull final DomElement element,
+                                 @NotNull final Function<DomElement,DomService.StructureViewMode> descriptor,
+                                 @Nullable final DomElementNavigationProvider navigationProvider) {
+    myElement = element;
+    myDescriptor = descriptor;
+    myNavigationProvider = navigationProvider;
+  }
+
+  public DomElement getElement() {
+    return myElement;
+  }
+
+  @Nullable
+  public Object getValue() {
+    return myElement.isValid() ? myElement.getXmlElement() : null;
+  }
+
+  public ItemPresentation getPresentation() {
+    return this;
+  }
+
+  public TreeElement[] getChildren() {
+    if (!myElement.isValid()) return EMPTY_ARRAY;
+    final ArrayList<TreeElement> result = new ArrayList<TreeElement>();
+    final DomElementVisitor elementVisitor = new DomElementVisitor() {
+      public void visitDomElement(final DomElement element) {
+        if (element instanceof GenericDomValue) return;
+        final DomService.StructureViewMode viewMode = myDescriptor.fun(element);
+        switch (viewMode) {
+          case SHOW:
+            result.add(createChildElement(element));
+            break;
+          case SHOW_CHILDREN:
+            DomUtil.acceptAvailableChildren(element, this);
+            break;
+          case SKIP:
+            break;
+        }
+      }
+    };
+    DomUtil.acceptAvailableChildren(myElement, elementVisitor);
+    return result.toArray(new TreeElement[result.size()]);
+  }
+
+  protected StructureViewTreeElement createChildElement(final DomElement element) {
+    return new DomStructureTreeElement(element, myDescriptor, myNavigationProvider);
+  }
+
+  public void navigate(boolean requestFocus) {
+    if (myNavigationProvider != null) myNavigationProvider.navigate(myElement, true);
+  }
+
+  public boolean canNavigate() {
+    return myNavigationProvider != null && myNavigationProvider.canNavigate(myElement);
+  }
+
+  public boolean canNavigateToSource() {
+    return myNavigationProvider != null && myNavigationProvider.canNavigate(myElement);
+  }
+
+  public String getPresentableText() {
+    if (!myElement.isValid()) return "<unknown>";
+    final ElementPresentation presentation = myElement.getPresentation();
+    final String name = presentation.getElementName();
+    return name != null? name : presentation.getTypeName();
+  }
+
+  @Nullable
+  public String getLocationString() {
+    return null;
+  }
+
+  @Nullable
+  public Icon getIcon(boolean open) {
+    if (!myElement.isValid()) return null;
+    return myElement.getPresentation().getIcon();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureViewBuilder.java b/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureViewBuilder.java
new file mode 100644
index 0000000..94ccf53
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureViewBuilder.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.structure;
+
+import com.intellij.ide.structureView.StructureView;
+import com.intellij.ide.structureView.StructureViewModel;
+import com.intellij.ide.structureView.TreeBasedStructureViewBuilder;
+import com.intellij.ide.structureView.newStructureView.StructureViewComponent;
+import com.intellij.ide.util.treeView.AbstractTreeNode;
+import com.intellij.openapi.fileEditor.FileEditor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.AsyncResult;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.Function;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.DomService;
+import org.jetbrains.annotations.NotNull;
+
+public class DomStructureViewBuilder extends TreeBasedStructureViewBuilder {
+  private final Function<DomElement, DomService.StructureViewMode> myDescriptor;
+  private final XmlFile myFile;
+
+  public DomStructureViewBuilder(final XmlFile file, final Function<DomElement,DomService.StructureViewMode> descriptor) {
+    myFile = file;
+    myDescriptor = descriptor;
+  }
+
+  @NotNull
+  public StructureViewModel createStructureViewModel() {
+    return new DomStructureViewTreeModel(myFile, myDescriptor);
+  }
+
+  public boolean isRootNodeShown() {
+    return true;
+  }
+
+  @NotNull
+  public StructureView createStructureView(final FileEditor fileEditor, final Project project) {
+    return new StructureViewComponent(fileEditor, createStructureViewModel(), project) {
+      public AsyncResult<AbstractTreeNode> expandPathToElement(final Object element) {
+        if (element instanceof XmlElement) {
+          final XmlElement xmlElement = (XmlElement)element;
+          XmlTag tag = PsiTreeUtil.getParentOfType(xmlElement, XmlTag.class, false);
+          while (tag != null) {
+            final DomElement domElement = DomManager.getDomManager(xmlElement.getProject()).getDomElement(tag);
+            if (domElement != null) {
+              for (DomElement curElement = domElement; curElement != null; curElement = curElement.getParent()) {
+                if (myDescriptor.fun(curElement) == DomService.StructureViewMode.SHOW) {
+                  return super.expandPathToElement(curElement.getXmlElement());
+                }
+              }
+            }
+            tag = PsiTreeUtil.getParentOfType(tag, XmlTag.class, true);
+          }
+
+        }
+        return super.expandPathToElement(element);
+      }
+    };
+  }
+}
\ No newline at end of file
diff --git a/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureViewBuilderProvider.java b/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureViewBuilderProvider.java
new file mode 100644
index 0000000..88007741
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureViewBuilderProvider.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.structure;
+
+import com.intellij.ide.structureView.StructureViewBuilder;
+import com.intellij.ide.structureView.xml.XmlStructureViewBuilderProvider;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.Function;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.DomService;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * This SHOULD NOT be subclassed!
+ *
+ * @author Dmitry Avdeev
+ *         Date: 6/7/12
+ */
+public final class DomStructureViewBuilderProvider implements XmlStructureViewBuilderProvider {
+
+  @Override
+  public StructureViewBuilder createStructureViewBuilder(@NotNull XmlFile file) {
+    if (DomManager.getDomManager(file.getProject()).getDomFileDescription(file) != null) {
+      return new DomStructureViewBuilder(file, DESCRIPTOR);
+    }
+    return null;
+  }
+
+  public static final Function<DomElement,DomService.StructureViewMode> DESCRIPTOR =
+    new Function<DomElement, DomService.StructureViewMode>() {
+      @Override
+      public DomService.StructureViewMode fun(DomElement element) {
+        return DomService.StructureViewMode.SHOW;
+      }
+    };
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureViewTreeModel.java b/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureViewTreeModel.java
new file mode 100644
index 0000000..41139a2
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureViewTreeModel.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.structure;
+
+import com.intellij.ide.structureView.StructureViewTreeElement;
+import com.intellij.ide.structureView.impl.xml.XmlFileTreeElement;
+import com.intellij.ide.structureView.impl.xml.XmlStructureViewTreeModel;
+import com.intellij.ide.util.treeView.smartTree.Sorter;
+import com.intellij.openapi.Disposable;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.Function;
+import com.intellij.util.xml.*;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Gregory.Shrago
+*/
+public class DomStructureViewTreeModel extends XmlStructureViewTreeModel implements Disposable {
+  private final XmlFile myFile;
+  private final DomElementNavigationProvider myNavigationProvider;
+  private final Function<DomElement, DomService.StructureViewMode> myDescriptor;
+
+  public DomStructureViewTreeModel(final XmlFile file, final Function<DomElement, DomService.StructureViewMode> descriptor) {
+    this(file, DomElementsNavigationManager.getManager(file.getProject()).getDomElementsNavigateProvider(DomElementsNavigationManager.DEFAULT_PROVIDER_NAME), descriptor);
+  }
+
+  public DomStructureViewTreeModel(final XmlFile file, final DomElementNavigationProvider navigationProvider, final Function<DomElement, DomService.StructureViewMode> descriptor) {
+    super(file);
+    myFile = file;
+    myNavigationProvider = navigationProvider;
+    myDescriptor = descriptor;
+  }
+
+  @NotNull
+  public StructureViewTreeElement getRoot() {
+    final DomFileElement<DomElement> fileElement = DomManager.getDomManager(myFile.getProject()).getFileElement(myFile, DomElement.class);
+    return fileElement == null?
+           new XmlFileTreeElement(myFile) :
+           new DomStructureTreeElement(fileElement.getRootElement().createStableCopy(), myDescriptor, myNavigationProvider);
+  }
+
+  protected DomElementNavigationProvider getNavigationProvider() {
+    return myNavigationProvider;
+  }
+
+  @NotNull
+  public Sorter[] getSorters() {
+    return new Sorter[]{Sorter.ALPHA_SORTER};
+  }
+
+  protected PsiFile getPsiFile() {
+    return myFile;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/stubs/AttributeStub.java b/xml/dom-impl/src/com/intellij/util/xml/stubs/AttributeStub.java
new file mode 100644
index 0000000..5526752
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/stubs/AttributeStub.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs;
+
+import com.intellij.psi.stubs.ObjectStubSerializer;
+import com.intellij.util.io.StringRef;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/2/12
+ */
+public class AttributeStub extends DomStub {
+
+  private final String myValue;
+
+  public AttributeStub(DomStub parent, StringRef name, StringRef namespace, String value) {
+    super(parent, name, namespace);
+    myValue = value;
+  }
+
+  public String getValue() {
+    return myValue;
+  }
+
+  @Override
+  public List<DomStub> getChildrenStubs() {
+    return Collections.emptyList();
+  }
+
+  @Override
+  public ObjectStubSerializer getStubType() {
+    return AttributeStubSerializer.INSTANCE;
+  }
+
+  @Override
+  public String toString() {
+    return getName() + ":" + getValue();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/stubs/AttributeStubSerializer.java b/xml/dom-impl/src/com/intellij/util/xml/stubs/AttributeStubSerializer.java
new file mode 100644
index 0000000..2a091a9
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/stubs/AttributeStubSerializer.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs;
+
+import com.intellij.psi.stubs.IndexSink;
+import com.intellij.psi.stubs.ObjectStubSerializer;
+import com.intellij.psi.stubs.StubInputStream;
+import com.intellij.psi.stubs.StubOutputStream;
+
+import java.io.IOException;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/3/12
+ */
+public class AttributeStubSerializer implements ObjectStubSerializer<AttributeStub, ElementStub> {
+
+  final static ObjectStubSerializer INSTANCE = new AttributeStubSerializer();
+
+  @Override
+  public String getExternalId() {
+    return "AttributeStub";
+  }
+
+  @Override
+  public void serialize(AttributeStub stub, StubOutputStream dataStream) throws IOException {
+    dataStream.writeName(stub.getName());
+    dataStream.writeName(stub.getNamespaceKey());
+    dataStream.writeUTFFast(stub.getValue() == null ? "" : stub.getValue());
+  }
+
+  @Override
+  public AttributeStub deserialize(StubInputStream dataStream, ElementStub parentStub) throws IOException {
+    return new AttributeStub(parentStub, dataStream.readName(), dataStream.readName(), dataStream.readUTFFast());
+  }
+
+  @Override
+  public void indexStub(AttributeStub stub, IndexSink sink) {
+  }
+
+  @Override
+  public String toString() {
+    return "Attribute";
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/stubs/DomElementTypeHolder.java b/xml/dom-impl/src/com/intellij/util/xml/stubs/DomElementTypeHolder.java
new file mode 100644
index 0000000..4e4fbeb
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/stubs/DomElementTypeHolder.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs;
+
+import com.intellij.psi.stubs.SerializationManager;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/2/12
+ */
+public class DomElementTypeHolder {
+
+  static {
+    SerializationManager.getInstance().registerSerializer(ElementStubSerializer.INSTANCE);
+    SerializationManager.getInstance().registerSerializer(AttributeStubSerializer.INSTANCE);
+    SerializationManager.getInstance().registerSerializer(FileStubSerializer.INSTANCE);
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/stubs/DomStub.java b/xml/dom-impl/src/com/intellij/util/xml/stubs/DomStub.java
new file mode 100644
index 0000000..9b94200
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/stubs/DomStub.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs;
+
+import com.intellij.openapi.util.Comparing;
+import com.intellij.psi.stubs.ObjectStubBase;
+import com.intellij.util.SmartList;
+import com.intellij.util.io.StringRef;
+import com.intellij.util.xml.EvaluatedXmlNameImpl;
+import com.intellij.util.xml.XmlName;
+import com.intellij.util.xml.impl.CollectionElementInvocationHandler;
+import com.intellij.util.xml.impl.DomChildDescriptionImpl;
+import com.intellij.util.xml.impl.DomInvocationHandler;
+import com.intellij.util.xml.impl.DomManagerImpl;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/2/12
+ */
+public abstract class DomStub extends ObjectStubBase<DomStub> {
+
+  protected final StringRef myLocalName;
+  private final StringRef myNamespace;
+  private DomInvocationHandler myHandler;
+
+  public DomStub(DomStub parent, @NotNull StringRef localName, StringRef namespace) {
+    super(parent);
+    myNamespace = namespace;
+    if (parent != null) {
+      ((ElementStub)parent).addChild(this);
+    }
+    myLocalName = localName;
+  }
+
+  public abstract List<DomStub> getChildrenStubs();
+
+  public int getChildIndex(DomStub child) {
+    List<DomStub> stubs = getChildrenByName(XmlUtil.getLocalName(child.getName()), child.getNamespaceKey());
+    return stubs.indexOf(child);
+  }
+
+  public String getName() {
+    return myLocalName.getString();
+  }
+
+  @Nullable
+  public String getNamespaceKey() {
+    return myNamespace == null ? null : myNamespace.getString();
+  }
+
+  public List<DomStub> getChildrenByName(final CharSequence name, @Nullable final String nsKey) {
+    final List<DomStub> stubs = getChildrenStubs();
+    if (stubs.isEmpty()) {
+      return Collections.emptyList();
+    }
+
+    final String s = nsKey == null ? "" : nsKey;
+    final List<DomStub> result = new SmartList<DomStub>();
+    //noinspection ForLoopReplaceableByForEach
+    for (int i = 0, size = stubs.size(); i < size; i++) {
+      final DomStub stub = stubs.get(i);
+      if (XmlUtil.getLocalName(stub.getName()).equals(name) &&
+          Comparing.equal(s, stub.getNamespaceKey())) {
+        result.add(stub);
+      }
+    }
+    return result;
+  }
+
+  @Nullable
+  public AttributeStub getAttributeStub(final XmlName name) {
+    final List<DomStub> stubs = getChildrenStubs();
+    if (stubs.isEmpty()) {
+      return null;
+    }
+
+    //noinspection ForLoopReplaceableByForEach
+    for (int i = 0, size = stubs.size(); i < size; i++) {
+      final DomStub stub = stubs.get(i);
+      if (stub instanceof AttributeStub &&
+          stub.getName().equals(name.getLocalName())) {
+        return (AttributeStub)stub;
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public ElementStub getElementStub(String name, int index) {
+    List<DomStub> stubs = getChildrenStubs();
+    int i = 0;
+    for (DomStub stub : stubs) {
+      if (stub instanceof ElementStub && name.equals(stub.getName()) && i++ == index) {
+        return (ElementStub)stub;
+      }
+    }
+    return null;
+  }
+
+  public synchronized DomInvocationHandler getOrCreateHandler(DomChildDescriptionImpl description, DomManagerImpl manager) {
+    if (myHandler == null) {
+      XmlName name = description.getXmlName();
+      EvaluatedXmlNameImpl evaluatedXmlName = EvaluatedXmlNameImpl.createEvaluatedXmlName(name, name.getNamespaceKey(), true);
+      myHandler = new CollectionElementInvocationHandler(evaluatedXmlName, description, manager, (ElementStub)this);
+    }
+    return myHandler;
+  }
+
+  public DomInvocationHandler getHandler() {
+    return myHandler;
+  }
+
+  public void setHandler(DomInvocationHandler handler) {
+    myHandler = handler;
+  }
+
+  public boolean isCustom() {
+    return false;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/stubs/ElementStub.java b/xml/dom-impl/src/com/intellij/util/xml/stubs/ElementStub.java
new file mode 100644
index 0000000..33002cc
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/stubs/ElementStub.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs;
+
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.stubs.ObjectStubSerializer;
+import com.intellij.util.SmartList;
+import com.intellij.util.io.StringRef;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/2/12
+ */
+public class ElementStub extends DomStub {
+
+  private final List<DomStub> myChildren = new SmartList<DomStub>();
+  private final boolean myCustom;
+
+  public ElementStub(@Nullable ElementStub parent, @NotNull StringRef name, @Nullable StringRef namespace, boolean custom) {
+    super(parent, name, namespace);
+    myCustom = custom;
+  }
+
+  void addChild(DomStub child) {
+    myChildren.add(child);
+  }
+
+  @Override
+  public List<DomStub> getChildrenStubs() {
+    return myChildren;
+  }
+
+  @Override
+  public ObjectStubSerializer getStubType() {
+    return ElementStubSerializer.INSTANCE;
+  }
+
+  @Override
+  public String toString() {
+    String key = getNamespaceKey();
+    return StringUtil.isEmpty(key) ? getName() : key + ":" + getName();
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (obj == this) return true;
+    return obj instanceof ElementStub && id == ((ElementStub)obj).id && myLocalName.equals(((ElementStub)obj).myLocalName);
+  }
+
+  public boolean isCustom() {
+    return myCustom;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/stubs/ElementStubSerializer.java b/xml/dom-impl/src/com/intellij/util/xml/stubs/ElementStubSerializer.java
new file mode 100644
index 0000000..8d03da8
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/stubs/ElementStubSerializer.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs;
+
+import com.intellij.psi.stubs.IndexSink;
+import com.intellij.psi.stubs.ObjectStubSerializer;
+import com.intellij.psi.stubs.StubInputStream;
+import com.intellij.psi.stubs.StubOutputStream;
+
+import java.io.IOException;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/3/12
+ */
+public class ElementStubSerializer implements ObjectStubSerializer<ElementStub, ElementStub> {
+
+  final static ObjectStubSerializer INSTANCE = new ElementStubSerializer();
+
+  @Override
+  public void serialize(ElementStub stub, StubOutputStream dataStream) throws IOException {
+    dataStream.writeName(stub.getName());
+    dataStream.writeName(stub.getNamespaceKey());
+    dataStream.writeBoolean(stub.isCustom());
+  }
+
+  @Override
+  public ElementStub deserialize(StubInputStream dataStream, ElementStub parentStub) throws IOException {
+    return new ElementStub(parentStub, dataStream.readName(), dataStream.readName(), dataStream.readBoolean());
+  }
+
+  @Override
+  public void indexStub(ElementStub stub, IndexSink sink) {
+  }
+
+  @Override
+  public String getExternalId() {
+    return "ElementStubSerializer";
+  }
+
+  @Override
+  public String toString() {
+    return "Element";
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/stubs/FileStub.java b/xml/dom-impl/src/com/intellij/util/xml/stubs/FileStub.java
new file mode 100644
index 0000000..e67ca02
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/stubs/FileStub.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs;
+
+import com.intellij.psi.stubs.ObjectStubSerializer;
+import com.intellij.psi.stubs.Stub;
+import com.intellij.util.io.StringRef;
+import com.intellij.util.xml.XmlFileHeader;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/8/12
+ */
+public class FileStub extends ElementStub {
+
+  private final XmlFileHeader myHeader;
+
+  public FileStub(StringRef tagName, StringRef tagNamespace, StringRef publicId, StringRef systemId) {
+    super(null, tagName, tagNamespace, false);
+    myHeader = new XmlFileHeader(tagName.getString(),
+                                 tagNamespace == null ? null : tagNamespace.getString(),
+                                 publicId == null ? null : publicId.getString(),
+                                 systemId == null ? null : systemId.getString());
+  }
+
+  public FileStub(XmlFileHeader header) {
+    super(null, StringRef.fromString(header.getRootTagLocalName()), StringRef.fromString(header.getRootTagNamespace()), false);
+    myHeader = header;
+  }
+
+  public XmlFileHeader getHeader() {
+    return myHeader;
+  }
+
+  @Nullable
+  public ElementStub getRootTagStub() {
+    List<? extends Stub> stubs = getChildrenStubs();
+    return stubs.isEmpty() ? null : (ElementStub)stubs.get(0);
+  }
+
+  @Override
+  public ObjectStubSerializer getStubType() {
+    return FileStubSerializer.INSTANCE;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/stubs/FileStubSerializer.java b/xml/dom-impl/src/com/intellij/util/xml/stubs/FileStubSerializer.java
new file mode 100644
index 0000000..ed460bac
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/stubs/FileStubSerializer.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs;
+
+import com.intellij.psi.stubs.*;
+import com.intellij.util.xml.XmlFileHeader;
+
+import java.io.IOException;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/8/12
+ */
+public class FileStubSerializer implements ObjectStubSerializer<FileStub, Stub> {
+
+  public static FileStubSerializer INSTANCE = new FileStubSerializer();
+
+  @Override
+  public String getExternalId() {
+    return "FileStubSerializer";
+  }
+
+  @Override
+  public void serialize(FileStub stub, StubOutputStream dataStream) throws IOException {
+    XmlFileHeader header = stub.getHeader();
+    dataStream.writeName(header.getRootTagLocalName());
+    dataStream.writeName(header.getRootTagNamespace());
+    dataStream.writeName(header.getPublicId());
+    dataStream.writeName(header.getSystemId());
+  }
+
+  @Override
+  public FileStub deserialize(StubInputStream dataStream, Stub parentStub) throws IOException {
+    return new FileStub(dataStream.readName(), dataStream.readName(), dataStream.readName(), dataStream.readName());
+  }
+
+  @Override
+  public void indexStub(FileStub stub, IndexSink sink) {
+  }
+
+  @Override
+  public String toString() {
+    return "File";
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/stubs/StubParentStrategy.java b/xml/dom-impl/src/com/intellij/util/xml/stubs/StubParentStrategy.java
new file mode 100644
index 0000000..392065e
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/stubs/StubParentStrategy.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.impl.*;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/9/12
+ */
+public class StubParentStrategy implements DomParentStrategy {
+
+  public static StubParentStrategy createAttributeStrategy(@Nullable AttributeStub stub, @NotNull final DomStub parent) {
+    if (stub == null) {
+      return new Empty(parent);
+    }
+    else {
+      return new StubParentStrategy(stub) {
+        @Override
+        public XmlElement getXmlElement() {
+          DomInvocationHandler parentHandler = getParentHandler();
+          XmlTag tag = parentHandler.getXmlTag();
+          if (tag == null) {
+            throw new AssertionError("can't find tag for " + parentHandler);
+          }
+          return tag.getAttribute(myStub.getName());
+        }
+      };
+    }
+  }
+
+  protected final DomStub myStub;
+
+  public StubParentStrategy(@NotNull DomStub stub) {
+    myStub = stub;
+  }
+
+  @Override
+  public DomInvocationHandler getParentHandler() {
+    DomStub parentStub = myStub.getParentStub();
+    return parentStub == null ? null : parentStub.getHandler();
+  }
+
+  @Override
+  public XmlElement getXmlElement() {
+    DomStub parentStub = myStub.getParentStub();
+    if (parentStub == null) return null;
+    int index = parentStub.getChildIndex(myStub);
+    if (index < 0) {
+      return null;
+    }
+    XmlTag parentTag = parentStub.getHandler().getXmlTag();
+    if (parentTag == null) return null;
+
+    // for custom elements, namespace information is lost
+    // todo: propagate ns info through DomChildDescriptions
+    XmlTag[] tags = parentTag.getSubTags();
+    int i = 0;
+    String nameToFind = myStub.isCustom() ? XmlUtil.findLocalNameByQualifiedName(myStub.getName()) : myStub.getName();
+    assert nameToFind != null;
+    for (XmlTag xmlTag : tags) {
+      if (myStub.isCustom()) {
+        if (nameToFind.equals(xmlTag.getLocalName())) {
+          if (index == i++) {
+            return xmlTag;
+          }
+        }
+      }
+      else if (nameToFind.equals(xmlTag.getName())) {
+        if (index == i++) {
+          return xmlTag;
+        }
+      }
+    }
+    return null;
+  }
+
+  @NotNull
+  @Override
+  public DomParentStrategy refreshStrategy(DomInvocationHandler handler) {
+    return this;
+  }
+
+  @NotNull
+  @Override
+  public DomParentStrategy setXmlElement(@NotNull XmlElement element) {
+    return new PhysicalDomParentStrategy(element, DomManagerImpl.getDomManager(element.getProject()));
+  }
+
+  @NotNull
+  @Override
+  public DomParentStrategy clearXmlElement() {
+    final DomInvocationHandler parent = getParentHandler();
+    assert parent != null : "write operations should be performed on the DOM having a parent, your DOM may be not very fresh";
+    return new VirtualDomParentStrategy(parent);
+  }
+
+  @Override
+  public String checkValidity() {
+    return null;
+  }
+
+  @Override
+  public XmlFile getContainingFile(DomInvocationHandler handler) {
+    return getParentHandler().getFile();
+  }
+
+  @Override
+  public boolean isPhysical() {
+    return true;
+  }
+
+  @SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
+  @Override
+  public boolean equals(Object obj) {
+    return PhysicalDomParentStrategy.strategyEquals(this, obj);
+  }
+
+  public static class Empty extends StubParentStrategy {
+    private final DomStub myParent;
+
+    public Empty(DomStub parent) {
+      super(parent);
+      myParent = parent;
+    }
+
+    @Override
+    public DomInvocationHandler getParentHandler() {
+      return myParent.getHandler();
+    }
+
+    @Override
+    public XmlElement getXmlElement() {
+      return null;
+    }
+
+    @Override
+    public boolean isPhysical() {
+      return false;
+    }
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/stubs/builder/DomStubBuilder.java b/xml/dom-impl/src/com/intellij/util/xml/stubs/builder/DomStubBuilder.java
new file mode 100644
index 0000000..d637974
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/stubs/builder/DomStubBuilder.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs.builder;
+
+import com.intellij.ide.highlighter.XmlFileType;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.project.ProjectCoreUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.stubs.BinaryFileStubBuilder;
+import com.intellij.psi.stubs.Stub;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.stubs.FileStub;
+import com.intellij.xml.util.XmlUtil;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/2/12
+ */
+public class DomStubBuilder implements BinaryFileStubBuilder {
+
+  private final static Logger LOG = Logger.getInstance(DomStubBuilder.class);
+
+  @Override
+  public boolean acceptsFile(VirtualFile file) {
+    return file.getFileType() == XmlFileType.INSTANCE && !ProjectCoreUtil.isProjectOrWorkspaceFile(file);
+  }
+
+  @Override
+  public Stub buildStubTree(VirtualFile file, byte[] content, Project project) {
+
+    PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
+    if (!(psiFile instanceof XmlFile)) return null;
+
+    XmlFile xmlFile = (XmlFile)psiFile;
+    DomManager manager = DomManager.getDomManager(project);
+    try {
+      xmlFile.putUserData(XmlUtil.BUILDING_DOM_STUBS, Boolean.TRUE);
+      DomFileElement<? extends DomElement> fileElement = manager.getFileElement(xmlFile);
+      if (fileElement == null || !fileElement.getFileDescription().hasStubs()) return null;
+
+      XmlFileHeader header = DomService.getInstance().getXmlFileHeader(xmlFile);
+      if (header.getRootTagLocalName() == null) {
+        LOG.error("null root tag for " + fileElement + " for " + file);
+      }
+      FileStub fileStub = new FileStub(header);
+      DomStubBuilderVisitor visitor = new DomStubBuilderVisitor(fileStub);
+      visitor.visitDomElement(fileElement.getRootElement());
+      return fileStub;
+    }
+    finally {
+      xmlFile.putUserData(XmlUtil.BUILDING_DOM_STUBS, null);
+    }
+  }
+
+  @Override
+  public int getStubVersion() {
+    int version = 9;
+    DomFileDescription[] descriptions = Extensions.getExtensions(DomFileDescription.EP_NAME);
+    for (DomFileDescription description : descriptions) {
+      version += description.getStubVersion();
+    }
+    return version;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/stubs/builder/DomStubBuilderVisitor.java b/xml/dom-impl/src/com/intellij/util/xml/stubs/builder/DomStubBuilderVisitor.java
new file mode 100644
index 0000000..ac11210
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/stubs/builder/DomStubBuilderVisitor.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs.builder;
+
+import com.intellij.util.xml.Stubbed;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.io.StringRef;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomElementVisitor;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import com.intellij.util.xml.reflect.CustomDomChildrenDescription;
+import com.intellij.util.xml.reflect.DomChildrenDescription;
+import com.intellij.util.xml.stubs.AttributeStub;
+import com.intellij.util.xml.stubs.ElementStub;
+import com.intellij.util.xml.stubs.FileStub;
+
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/7/12
+ */
+public class DomStubBuilderVisitor implements DomElementVisitor {
+
+  private ElementStub myRoot;
+
+  public DomStubBuilderVisitor(FileStub fileStub) {
+    myRoot = fileStub;
+  }
+
+  @Override
+  public void visitDomElement(DomElement element) {
+
+    if (element.getAnnotation(Stubbed.class) != null ||
+        element.getChildDescription().isStubbed()) {
+
+      XmlElement xmlElement = element.getXmlElement();
+      AbstractDomChildrenDescription description = element.getChildDescription();
+      String nsKey = description instanceof DomChildrenDescription ? ((DomChildrenDescription)description).getXmlName().getNamespaceKey() : "";
+      if (xmlElement instanceof XmlTag) {
+        ElementStub old = myRoot;
+        myRoot = new ElementStub(myRoot,
+                                 StringRef.fromString(((XmlTag)xmlElement).getName()),
+                                 StringRef.fromNullableString(nsKey),
+                                 description instanceof CustomDomChildrenDescription);
+        List<DomElement> children = DomUtil.getDefinedChildren(element, true, true);
+        for (DomElement child : children) {
+          visitDomElement(child);
+        }
+        if (old != null) {
+          myRoot = old;
+        }
+      }
+      else if (xmlElement instanceof XmlAttribute) {
+        new AttributeStub(myRoot, StringRef.fromString(((XmlAttribute)xmlElement).getLocalName()),
+                          StringRef.fromNullableString(nsKey),
+                          ((XmlAttribute)xmlElement).getValue());
+      }
+    }
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/tree/actions/AddDomElementActionGroup.java b/xml/dom-impl/src/com/intellij/util/xml/tree/actions/AddDomElementActionGroup.java
new file mode 100644
index 0000000..6727548
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/tree/actions/AddDomElementActionGroup.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.tree.actions;
+
+import com.intellij.openapi.actionSystem.ActionGroup;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class AddDomElementActionGroup extends ActionGroup {
+
+  private final AddElementInCollectionAction myAction = new AddElementInCollectionAction() {
+    protected boolean showAsPopup() {
+      return false;
+    }
+  };
+
+  public AnAction[] getChildren(@Nullable AnActionEvent e) {
+    return myAction.getChildren(e);
+  }
+
+  public void update(AnActionEvent e) {
+//    myAction.getChildren(e).length
+    getTemplatePresentation().setText(myAction.getTemplatePresentation().getText());
+    super.update(e);
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/tree/actions/AddElementInCollectionAction.java b/xml/dom-impl/src/com/intellij/util/xml/tree/actions/AddElementInCollectionAction.java
new file mode 100644
index 0000000..0828d3c
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/tree/actions/AddElementInCollectionAction.java
@@ -0,0 +1,218 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.tree.actions;
+
+import com.intellij.ide.TypePresentationService;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.DefaultActionGroup;
+import com.intellij.openapi.application.ApplicationBundle;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.ui.popup.ListPopup;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.ui.treeStructure.SimpleNode;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.MergedObject;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import com.intellij.util.xml.tree.BaseDomElementNode;
+import com.intellij.util.xml.tree.DomElementsGroupNode;
+import com.intellij.util.xml.tree.DomModelTreeView;
+import com.intellij.util.xml.ui.actions.AddDomElementAction;
+import com.intellij.util.xml.ui.actions.DefaultAddAction;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.lang.reflect.Type;
+import java.util.List;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class AddElementInCollectionAction extends AddDomElementAction {
+  private DomModelTreeView myTreeView;
+
+  public AddElementInCollectionAction() {
+  }
+
+  public AddElementInCollectionAction(final DomModelTreeView treeView) {
+    myTreeView = treeView;
+  }
+
+  protected DomModelTreeView getTreeView(AnActionEvent e) {
+    if (myTreeView != null) return myTreeView;
+
+    return DomModelTreeView.DATA_KEY.getData(e.getDataContext());
+  }
+
+  protected boolean isEnabled(final AnActionEvent e) {
+    final DomModelTreeView treeView = getTreeView(e);
+
+    final boolean enabled = treeView != null;
+    e.getPresentation().setEnabled(enabled);
+
+    return enabled;
+  }
+
+
+  protected void showPopup(final ListPopup groupPopup, final AnActionEvent e) {
+    if (myTreeView == null) {
+      if (e.getPlace().equals(DomModelTreeView.DOM_MODEL_TREE_VIEW_POPUP)) {
+        groupPopup.showInCenterOf(getTreeView(e).getTree());
+      }
+      else {
+        groupPopup.showInBestPositionFor(e.getDataContext());
+      }
+    }
+    else {
+      super.showPopup(groupPopup, e);
+    }
+  }
+
+  @NotNull
+  protected DomCollectionChildDescription[] getDomCollectionChildDescriptions(final AnActionEvent e) {
+    final DomModelTreeView view = getTreeView(e);
+
+    SimpleNode node = view.getTree().getSelectedNode();
+    if (node instanceof BaseDomElementNode) {
+      List<DomCollectionChildDescription> consolidated = ((BaseDomElementNode)node).getConsolidatedChildrenDescriptions();
+      if (consolidated.size() > 0) {
+        return consolidated.toArray(new DomCollectionChildDescription[consolidated.size()]);
+      }
+    }
+
+    final DomElementsGroupNode groupNode = getDomElementsGroupNode(view);
+
+    return groupNode == null
+           ? DomCollectionChildDescription.EMPTY_ARRAY
+           : new DomCollectionChildDescription[]{groupNode.getChildDescription()};
+  }
+
+  protected DomElement getParentDomElement(final AnActionEvent e) {
+    final DomModelTreeView view = getTreeView(e);
+    SimpleNode node = view.getTree().getSelectedNode();
+    if (node instanceof BaseDomElementNode) {
+      if (((BaseDomElementNode)node).getConsolidatedChildrenDescriptions().size() > 0) {
+        return ((BaseDomElementNode)node).getDomElement();
+      }
+    }
+    final DomElementsGroupNode groupNode = getDomElementsGroupNode(view);
+
+    return groupNode == null ? null : groupNode.getDomElement();
+  }
+
+  protected JComponent getComponent(AnActionEvent e) {
+    return getTreeView(e);
+  }
+
+  protected boolean showAsPopup() {
+    return true;
+  }
+
+  protected String getActionText(final AnActionEvent e) {
+    String text = ApplicationBundle.message("action.add");
+    if (e.getPresentation().isEnabled()) {
+      final DomElementsGroupNode selectedNode = getDomElementsGroupNode(getTreeView(e));
+      if (selectedNode != null) {
+        final Type type = selectedNode.getChildDescription().getType();
+
+        text += " " + TypePresentationService.getService().getTypePresentableName(ReflectionUtil.getRawType(type));
+      }
+    }
+    return text;
+  }
+
+  @Nullable
+  private static DomElementsGroupNode getDomElementsGroupNode(final DomModelTreeView treeView) {
+    SimpleNode simpleNode = treeView.getTree().getSelectedNode();
+    while (simpleNode != null) {
+      if (simpleNode instanceof DomElementsGroupNode) return (DomElementsGroupNode)simpleNode;
+
+      simpleNode = simpleNode.getParent();
+    }
+    return null;
+  }
+
+
+  protected AnAction createAddingAction(final AnActionEvent e,
+                                                final String name,
+                                                final Icon icon,
+                                                final Type type,
+                                                final DomCollectionChildDescription description) {
+
+    final DomElement parentDomElement = getParentDomElement(e);
+
+    if (parentDomElement instanceof MergedObject) {
+      final List<DomElement> implementations = (List<DomElement>)((MergedObject)parentDomElement).getImplementations();
+      final DefaultActionGroup actionGroup = new DefaultActionGroup(name, true);
+
+      for (DomElement implementation : implementations) {
+        final XmlFile xmlFile = DomUtil.getFile(implementation);
+        actionGroup.add(new MyDefaultAddAction(implementation, xmlFile.getName(), xmlFile.getIcon(0), e, type, description));
+      }
+      return actionGroup;
+    }
+
+    return new MyDefaultAddAction(parentDomElement, name, icon, e, type, description);
+  }
+
+  private class MyDefaultAddAction extends DefaultAddAction {
+    // we need this properties, don't remove it (shared dataContext assertion)
+    private final DomElement myParent;
+    private final DomModelTreeView myView;
+    private final Type myType;
+    private final DomCollectionChildDescription myDescription;
+
+    public MyDefaultAddAction(final DomElement parent,
+                              final String name,
+                              final Icon icon,
+                              final AnActionEvent e,
+                              final Type type,
+                              final DomCollectionChildDescription description) {
+      super(name, name, icon);
+      myType = type;
+      myDescription = description;
+      myParent = parent;
+      myView = getTreeView(e);
+    }
+
+    protected Type getElementType() {
+      return myType;
+    }
+
+    protected DomCollectionChildDescription getDomCollectionChildDescription() {
+      return myDescription;
+    }
+
+    protected DomElement getParentDomElement() {
+      return myParent;
+    }
+
+    protected void afterAddition(final DomElement newElement) {
+      final DomElement copy = newElement.createStableCopy();
+
+      ApplicationManager.getApplication().invokeLater(new Runnable() {
+        public void run() {
+          myView.setSelectedDomElement(copy);
+        }
+      });
+
+    }
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/tree/actions/BaseDomTreeAction.java b/xml/dom-impl/src/com/intellij/util/xml/tree/actions/BaseDomTreeAction.java
new file mode 100644
index 0000000..81d5ef3
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/tree/actions/BaseDomTreeAction.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.tree.actions;
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.util.xml.tree.DomModelTreeView;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+abstract public class BaseDomTreeAction extends AnAction {
+  private DomModelTreeView myTreeView;
+
+  protected BaseDomTreeAction() {
+  }
+
+  protected BaseDomTreeAction(DomModelTreeView treeView) {
+    myTreeView = treeView;
+  }
+
+  final public void update(AnActionEvent e) {
+    final DomModelTreeView treeView = getTreeView(e);
+
+    if (treeView != null) {
+      update(e, treeView);
+    }
+    else {
+      e.getPresentation().setEnabled(false);
+    }
+  }
+
+  protected DomModelTreeView getTreeView(AnActionEvent e) {
+    if (myTreeView != null) return myTreeView;
+
+    return DomModelTreeView.DATA_KEY.getData(e.getDataContext());
+  }
+
+  final public void actionPerformed(AnActionEvent e) {
+    final DomModelTreeView treeView = getTreeView(e);
+    if (treeView != null) {
+      actionPerformed(e, treeView);
+    }
+  }
+
+  public abstract void actionPerformed(AnActionEvent e, DomModelTreeView treeView);
+
+  public abstract void update(AnActionEvent e, DomModelTreeView treeView);
+}
+
diff --git a/xml/dom-impl/src/com/intellij/util/xml/tree/actions/DeleteDomElement.java b/xml/dom-impl/src/com/intellij/util/xml/tree/actions/DeleteDomElement.java
new file mode 100644
index 0000000..bbd2bf6
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/tree/actions/DeleteDomElement.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.tree.actions;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.application.ApplicationBundle;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.ui.treeStructure.SimpleNode;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.ElementPresentation;
+import com.intellij.util.xml.tree.BaseDomElementNode;
+import com.intellij.util.xml.tree.DomFileElementNode;
+import com.intellij.util.xml.tree.DomModelTreeView;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class DeleteDomElement extends BaseDomTreeAction {
+
+  public DeleteDomElement() {
+  }
+
+  public DeleteDomElement(final DomModelTreeView treeView) {
+    super(treeView);
+  }
+
+  public void actionPerformed(AnActionEvent e, DomModelTreeView treeView) {
+    final SimpleNode selectedNode = treeView.getTree().getSelectedNode();
+
+    if (selectedNode instanceof BaseDomElementNode) {
+
+      if (selectedNode instanceof DomFileElementNode) {
+        e.getPresentation().setVisible(false);
+        return;
+      }
+      
+      final DomElement domElement = ((BaseDomElementNode)selectedNode).getDomElement();
+
+      final int ret = Messages.showOkCancelDialog(getPresentationText(selectedNode) + "?", ApplicationBundle.message("action.remove"),
+                                                  Messages.getQuestionIcon());
+      if (ret == 0) {
+      new WriteCommandAction(domElement.getManager().getProject(), DomUtil.getFile(domElement)) {
+        protected void run(final Result result) throws Throwable {
+          domElement.undefine();
+        }
+      }.execute();
+      }
+    }
+  }
+
+  public void update(AnActionEvent e, DomModelTreeView treeView) {
+    final SimpleNode selectedNode = treeView.getTree().getSelectedNode();
+
+    if (selectedNode instanceof DomFileElementNode) {
+      e.getPresentation().setVisible(false);
+      return;
+    }
+
+    boolean enabled = false;
+    if (selectedNode instanceof BaseDomElementNode) {
+      final DomElement domElement = ((BaseDomElementNode)selectedNode).getDomElement();
+      if (domElement.isValid() && DomUtil.hasXml(domElement) && !(domElement.getParent() instanceof DomFileElement)) {
+        enabled = true;
+      }
+    }
+
+    e.getPresentation().setEnabled(enabled);
+
+
+    if (enabled) {
+      e.getPresentation().setText(getPresentationText(selectedNode));
+    }
+    else {
+      e.getPresentation().setText(ApplicationBundle.message("action.remove"));
+    }
+
+    e.getPresentation().setIcon(AllIcons.General.Remove);
+  }
+
+  private static String getPresentationText(final SimpleNode selectedNode) {
+    String removeString = ApplicationBundle.message("action.remove");
+    final ElementPresentation presentation = ((BaseDomElementNode)selectedNode).getDomElement().getPresentation();
+    removeString += " " + presentation.getTypeName() +
+                                (presentation.getElementName() == null || presentation.getElementName().trim().length() == 0? "" : ": " + presentation.getElementName());
+    return removeString;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/tree/actions/DomElementsToggleAction.java b/xml/dom-impl/src/com/intellij/util/xml/tree/actions/DomElementsToggleAction.java
new file mode 100644
index 0000000..9a1cb04
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/tree/actions/DomElementsToggleAction.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.tree.actions;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.ide.TypePresentationService;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.ToggleAction;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.ElementPresentationManager;
+import com.intellij.util.xml.tree.BaseDomElementNode;
+import com.intellij.util.xml.tree.DomModelTreeView;
+
+import javax.swing.*;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class DomElementsToggleAction extends ToggleAction {
+  private final DomModelTreeView myTreeView;
+  private final Class myClass;
+  private final Icon myIcon;
+  private final String myText;
+
+
+  public DomElementsToggleAction(final DomModelTreeView treeView, final Class aClass) {
+    myTreeView = treeView;
+    myClass = aClass;
+
+    Icon myIcon = ElementPresentationManager.getIcon(myClass);
+    if (myIcon == null) {
+      myIcon = AllIcons.Nodes.Pointcut;
+    }
+    this.myIcon = myIcon;
+
+    myText = TypePresentationService.getService().getTypePresentableName(myClass);
+
+    if(getHiders() == null) DomUtil.getFile(myTreeView.getRootElement()).putUserData(BaseDomElementNode.TREE_NODES_HIDERS_KEY, new HashMap<Class, Boolean>());
+
+    if(getHiders().get(myClass) == null) getHiders().put(myClass, true);
+  }
+
+  public void update(final AnActionEvent e) {
+    super.update(e);
+
+    e.getPresentation().setIcon(myIcon);
+    e.getPresentation().setText((getHiders().get(myClass) ? "Hide ":"Show ")+myText);
+
+    e.getPresentation().setEnabled(getHiders() != null && getHiders().get(myClass)!=null);
+  }
+
+  public boolean isSelected(AnActionEvent e) {
+    return getHiders().get(myClass);
+  }
+
+  private Map<Class, Boolean> getHiders() {
+    return DomUtil.getFile(myTreeView.getRootElement()).getUserData(BaseDomElementNode.TREE_NODES_HIDERS_KEY);
+  }
+
+  public void setSelected(AnActionEvent e, boolean state) {
+    getHiders().put(myClass, state);
+    myTreeView.getBuilder().updateFromRoot();
+  }
+}
+
diff --git a/xml/dom-impl/src/com/intellij/util/xml/tree/actions/GotoDomElementDeclarationAction.java b/xml/dom-impl/src/com/intellij/util/xml/tree/actions/GotoDomElementDeclarationAction.java
new file mode 100644
index 0000000..256a397
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/tree/actions/GotoDomElementDeclarationAction.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.tree.actions;
+
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.application.ApplicationBundle;
+import com.intellij.util.xml.tree.DomModelTreeView;
+import com.intellij.util.xml.tree.BaseDomElementNode;
+import com.intellij.util.xml.DomElementsNavigationManager;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomElementNavigationProvider;
+import com.intellij.ui.treeStructure.SimpleNode;
+import com.intellij.idea.ActionsBundle;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class GotoDomElementDeclarationAction extends BaseDomTreeAction {
+
+  public void actionPerformed(AnActionEvent e, DomModelTreeView treeView) {
+    final SimpleNode simpleNode = treeView.getTree().getSelectedNode();
+
+    if(simpleNode instanceof BaseDomElementNode) {
+      final DomElement domElement = ((BaseDomElementNode)simpleNode).getDomElement();
+      final DomElementNavigationProvider provider =
+        DomElementsNavigationManager.getManager(domElement.getManager().getProject()).getDomElementsNavigateProvider(DomElementsNavigationManager.DEFAULT_PROVIDER_NAME);
+
+      provider.navigate(domElement, true);
+
+    }
+  }
+
+  public void update(AnActionEvent e, DomModelTreeView treeView) {
+    e.getPresentation().setVisible(treeView.getTree().getSelectedNode() instanceof BaseDomElementNode);
+    e.getPresentation().setText(ActionsBundle.message("action.EditSource.text"));
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/ui/DomUIFactoryImpl.java b/xml/dom-impl/src/com/intellij/util/xml/ui/DomUIFactoryImpl.java
new file mode 100644
index 0000000..9952df6
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/ui/DomUIFactoryImpl.java
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.codeHighlighting.BackgroundEditorHighlighter;
+import com.intellij.codeHighlighting.HighlightingPass;
+import com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass;
+import com.intellij.codeInsight.daemon.impl.LocalInspectionsPass;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.event.DocumentAdapter;
+import com.intellij.openapi.editor.event.DocumentEvent;
+import com.intellij.openapi.editor.impl.EditorComponentImpl;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.ui.BooleanTableCellEditor;
+import com.intellij.ui.UserActivityListener;
+import com.intellij.ui.UserActivityWatcher;
+import com.intellij.util.Consumer;
+import com.intellij.util.Function;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.containers.ClassMap;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.highlighting.DomElementAnnotationsManagerImpl;
+import com.intellij.util.xml.highlighting.DomElementsErrorPanel;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.border.EmptyBorder;
+import javax.swing.table.TableCellEditor;
+import java.awt.*;
+import java.lang.reflect.Type;
+
+/**
+ * @author peter
+ */
+public class DomUIFactoryImpl extends DomUIFactory {
+
+  private final ClassMap<Function<DomWrapper<String>, BaseControl>> myCustomControlCreators = new ClassMap<Function<DomWrapper<String>, BaseControl>>();
+  private final ClassMap<Function<DomElement, TableCellEditor>> myCustomCellEditorCreators = new ClassMap<Function<DomElement, TableCellEditor>>();
+
+  public DomUIFactoryImpl() {
+    final Function<DomElement, TableCellEditor> booleanCreator = new Function<DomElement, TableCellEditor>() {
+      public TableCellEditor fun(final DomElement domElement) {
+        return new BooleanTableCellEditor();
+      }
+    };
+    registerCustomCellEditor(Boolean.class, booleanCreator);
+    registerCustomCellEditor(boolean.class, booleanCreator);
+    registerCustomCellEditor(String.class, new Function<DomElement, TableCellEditor>() {
+      public TableCellEditor fun(final DomElement domElement) {
+        return new DefaultCellEditor(removeBorder(new JTextField()));
+      }
+    });
+    Consumer<DomUIFactory>[] extensions = Extensions.getExtensions(EXTENSION_POINT_NAME);
+    for (Consumer<DomUIFactory> extension : extensions) {
+      extension.consume(this);
+    }
+  }
+
+  protected TableCellEditor createCellEditor(DomElement element, Class type) {
+    if (Enum.class.isAssignableFrom(type)) {
+      return new ComboTableCellEditor((Class<? extends Enum>)type, false);
+    }
+
+    final Function<DomElement, TableCellEditor> function = myCustomCellEditorCreators.get(type);
+    assert function != null : "Type not supported: " + type;
+    return function.fun(element);
+  }
+
+  public final UserActivityWatcher createEditorAwareUserActivityWatcher() {
+    return new UserActivityWatcher() {
+      private final DocumentAdapter myListener = new DocumentAdapter() {
+        public void documentChanged(DocumentEvent e) {
+          fireUIChanged();
+        }
+      };
+
+      protected void processComponent(final Component component) {
+        super.processComponent(component);
+        if (component instanceof EditorComponentImpl) {
+          ((EditorComponentImpl)component).getEditor().getDocument().addDocumentListener(myListener);
+        }
+      }
+
+      protected void unprocessComponent(final Component component) {
+        super.unprocessComponent(component);
+        if (component instanceof EditorComponentImpl) {
+          ((EditorComponentImpl)component).getEditor().getDocument().removeDocumentListener(myListener);
+        }
+      }
+    };
+  }
+
+  public void setupErrorOutdatingUserActivityWatcher(final CommittablePanel panel, final DomElement... elements) {
+    final UserActivityWatcher userActivityWatcher = createEditorAwareUserActivityWatcher();
+    userActivityWatcher.addUserActivityListener(new UserActivityListener() {
+      private boolean isProcessingChange;
+
+      public void stateChanged() {
+        if (isProcessingChange) return;
+        isProcessingChange = true;
+        try {
+          for (final DomElement element : elements) {
+            DomElementAnnotationsManagerImpl.outdateProblemHolder(element);
+          }
+          CommittableUtil.updateHighlighting(panel);
+        }
+        finally {
+          isProcessingChange = false;
+        }
+      }
+    }, panel);
+    userActivityWatcher.register(panel.getComponent());
+  }
+
+  @Nullable
+  public BaseControl createCustomControl(final Type type, DomWrapper<String> wrapper, final boolean commitOnEveryChange) {
+    final Function<DomWrapper<String>, BaseControl> factory = myCustomControlCreators.get(ReflectionUtil.getRawType(type));
+    return factory == null ? null : factory.fun(wrapper);
+  }
+
+  public CaptionComponent addErrorPanel(CaptionComponent captionComponent, DomElement... elements) {
+    captionComponent.initErrorPanel(new DomElementsErrorPanel(elements));
+    return captionComponent;
+  }
+
+  public BackgroundEditorHighlighter createDomHighlighter(final Project project, final PerspectiveFileEditor editor, final DomElement element) {
+    return new BackgroundEditorHighlighter() {
+      @NotNull
+      public HighlightingPass[] createPassesForEditor() {
+        if (!element.isValid()) return HighlightingPass.EMPTY_ARRAY;
+        
+        final XmlFile psiFile = DomUtil.getFile(element);
+
+        final PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(project);
+        final Document document = psiDocumentManager.getDocument(psiFile);
+        if (document == null) return HighlightingPass.EMPTY_ARRAY;
+
+        editor.commit();
+
+        psiDocumentManager.commitAllDocuments();
+
+        GeneralHighlightingPass ghp = new GeneralHighlightingPass(project, psiFile, document, 0, document.getTextLength(), true);
+        LocalInspectionsPass lip = new LocalInspectionsPass(psiFile, document, 0,
+                                                            document.getTextLength(), LocalInspectionsPass.EMPTY_PRIORITY_RANGE, true);
+        return new HighlightingPass[]{ghp, lip};
+      }
+
+      @NotNull
+      public HighlightingPass[] createPassesForVisibleArea() {
+        return createPassesForEditor();
+      }
+    };
+
+  }
+
+  public BaseControl createTextControl(DomWrapper<String> wrapper, final boolean commitOnEveryChange) {
+    return new TextControl(wrapper, commitOnEveryChange);
+  }
+
+  public void registerCustomControl(Class aClass, Function<DomWrapper<String>, BaseControl> creator) {
+    myCustomControlCreators.put(aClass, creator);
+  }
+
+  public void registerCustomCellEditor(final Class aClass, final Function<DomElement, TableCellEditor> creator) {
+    myCustomCellEditorCreators.put(aClass, creator);
+  }
+
+  private static <T extends JComponent> T removeBorder(final T component) {
+    component.setBorder(new EmptyBorder(0, 0, 0, 0));
+    return component;
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/ui/EditorTextFieldControl.java b/xml/dom-impl/src/com/intellij/util/xml/ui/EditorTextFieldControl.java
new file mode 100644
index 0000000..eb27a93
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/ui/EditorTextFieldControl.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.application.WriteAction;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.event.DocumentAdapter;
+import com.intellij.openapi.editor.event.DocumentEvent;
+import com.intellij.openapi.editor.event.DocumentListener;
+import com.intellij.openapi.editor.markup.EffectType;
+import com.intellij.openapi.editor.markup.MarkupModel;
+import com.intellij.openapi.editor.markup.TextAttributes;
+import com.intellij.openapi.project.Project;
+import com.intellij.ui.EditorTextField;
+import com.intellij.ui.SimpleTextAttributes;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.highlighting.DomElementAnnotationsManager;
+import com.intellij.util.xml.highlighting.DomElementProblemDescriptor;
+import com.intellij.util.xml.highlighting.DomElementsProblemsHolder;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public abstract class EditorTextFieldControl<T extends JComponent> extends BaseModifiableControl<T, String> {
+  private static final JTextField J_TEXT_FIELD = new JTextField() {
+    public void addNotify() {
+      throw new UnsupportedOperationException("Shouldn't be shown");
+    }
+
+    public void setVisible(boolean aFlag) {
+      throw new UnsupportedOperationException("Shouldn't be shown");
+    }
+  };
+  private final boolean myCommitOnEveryChange;
+  private final DocumentListener myListener = new DocumentAdapter() {
+    public void documentChanged(DocumentEvent e) {
+      setModified();
+      if (myCommitOnEveryChange) {
+        commit();
+      }
+    }
+  };
+
+  protected EditorTextFieldControl(final DomWrapper<String> domWrapper, final boolean commitOnEveryChange) {
+    super(domWrapper);
+    myCommitOnEveryChange = commitOnEveryChange;
+  }
+
+
+  protected EditorTextFieldControl(final DomWrapper<String> domWrapper) {
+    this(domWrapper, false);
+  }
+
+  protected abstract EditorTextField getEditorTextField(@NotNull T component);
+
+  protected void doReset() {
+    final EditorTextField textField = getEditorTextField(getComponent());
+    textField.getDocument().removeDocumentListener(myListener);
+    super.doReset();
+    textField.getDocument().addDocumentListener(myListener);
+  }
+
+  protected JComponent getComponentToListenFocusLost(final T component) {
+    return getEditorTextField(getComponent());
+  }
+
+  protected JComponent getHighlightedComponent(final T component) {
+    return J_TEXT_FIELD;
+  }
+
+  protected T createMainComponent(T boundedComponent) {
+    final Project project = getProject();
+    boundedComponent = createMainComponent(boundedComponent, project);
+
+    final EditorTextField editorTextField = getEditorTextField(boundedComponent);
+    editorTextField.setSupplementary(true);
+    editorTextField.getDocument().addDocumentListener(myListener);
+    return boundedComponent;
+  }
+
+  protected abstract T createMainComponent(T boundedComponent, Project project);
+
+  @NotNull
+  protected String getValue() {
+    return getEditorTextField(getComponent()).getText();
+  }
+
+  protected void setValue(final String value) {
+    CommandProcessor.getInstance().runUndoTransparentAction(new Runnable() {
+      public void run() {
+        new WriteAction() {
+          protected void run(Result result) throws Throwable {
+            final T component = getComponent();
+            final Document document = getEditorTextField(component).getDocument();
+            document.replaceString(0, document.getTextLength(), value == null ? "" : value);
+          }
+        }.execute();
+      }
+    });
+  }
+
+  protected void updateComponent() {
+    final DomElement domElement = getDomElement();
+    if (domElement == null || !domElement.isValid()) return;
+
+    final EditorTextField textField = getEditorTextField(getComponent());
+    final Project project = getProject();
+    ApplicationManager.getApplication().invokeLater(new Runnable() {
+      public void run() {
+        if (!project.isOpen()) return;
+        if (!getDomWrapper().isValid()) return;
+
+        final DomElement domElement = getDomElement();
+        if (domElement == null || !domElement.isValid()) return;
+
+        final DomElementAnnotationsManager manager = DomElementAnnotationsManager.getInstance(project);
+        final DomElementsProblemsHolder holder = manager.getCachedProblemHolder(domElement);
+        final List<DomElementProblemDescriptor> errorProblems = holder.getProblems(domElement);
+        final List<DomElementProblemDescriptor> warningProblems = new ArrayList<DomElementProblemDescriptor>(holder.getProblems(domElement, true, HighlightSeverity.WARNING));
+        warningProblems.removeAll(errorProblems);
+
+        Color background = getDefaultBackground();
+        if (errorProblems.size() > 0 && textField.getText().trim().length() == 0) {
+          background = getErrorBackground();
+        }
+        else if (warningProblems.size() > 0) {
+          background = getWarningBackground();
+        }
+
+        final Editor editor = textField.getEditor();
+        if (editor != null) {
+          final MarkupModel markupModel = editor.getMarkupModel();
+          markupModel.removeAllHighlighters();
+          if (!errorProblems.isEmpty() && editor.getDocument().getLineCount() > 0) {
+            final TextAttributes attributes = SimpleTextAttributes.ERROR_ATTRIBUTES.toTextAttributes();
+            attributes.setEffectType(EffectType.WAVE_UNDERSCORE);
+            attributes.setEffectColor(attributes.getForegroundColor());
+            markupModel.addLineHighlighter(0, 0, attributes);
+            editor.getContentComponent().setToolTipText(errorProblems.get(0).getDescriptionTemplate());
+          }
+        }
+
+        textField.setBackground(background);
+      }
+    });
+
+  }
+
+  public boolean canNavigate(final DomElement element) {
+    return getDomElement().equals(element);
+  }
+
+  public void navigate(final DomElement element) {
+    final EditorTextField field = getEditorTextField(getComponent());
+    SwingUtilities.invokeLater(new Runnable() {
+      public void run() {
+        field.requestFocus();
+        field.selectAll();
+      }
+    });
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/util/xml/ui/TextControl.java b/xml/dom-impl/src/com/intellij/util/xml/ui/TextControl.java
new file mode 100644
index 0000000..89cf4db
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/util/xml/ui/TextControl.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.ex.EditorEx;
+import com.intellij.openapi.fileTypes.FileTypes;
+import com.intellij.openapi.fileTypes.PlainTextLanguage;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.DialogBuilder;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiFileFactory;
+import com.intellij.ui.EditorTextField;
+import com.intellij.ui.ReferenceEditorWithBrowseButton;
+import com.intellij.ui.UIBundle;
+import com.intellij.util.Function;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+/**
+ * @author peter
+ */
+public class TextControl extends EditorTextFieldControl<TextPanel> {
+
+  public TextControl(final DomWrapper<String> domWrapper) {
+    super(domWrapper);
+  }
+
+  public TextControl(final DomWrapper<String> domWrapper, final boolean commitOnEveryChange) {
+    super(domWrapper, commitOnEveryChange);
+  }
+
+  protected EditorTextField getEditorTextField(@NotNull final TextPanel panel) {
+    final Component component = panel.getComponent(0);
+    if (component instanceof ReferenceEditorWithBrowseButton) {
+      return ((ReferenceEditorWithBrowseButton)component).getEditorTextField();
+    }
+    return (EditorTextField)component;
+  }
+
+  protected TextPanel createMainComponent(TextPanel boundedComponent, final Project project) {
+    if (boundedComponent == null) {
+      boundedComponent = new TextPanel();
+    }
+    boundedComponent.removeAll();
+    final Function<String, Document> factory = new Function<String, Document>() {
+      public Document fun(final String s) {
+        return PsiDocumentManager.getInstance(project)
+        .getDocument(PsiFileFactory.getInstance(project).createFileFromText("a.txt", PlainTextLanguage.INSTANCE, "", true, false));
+      }
+    };
+    final TextPanel boundedComponent1 = boundedComponent;
+    final EditorTextField editorTextField = new EditorTextField(factory.fun(""), project, FileTypes.PLAIN_TEXT) {
+      protected EditorEx createEditor() {
+        final EditorEx editor = super.createEditor();
+        return boundedComponent1 instanceof MultiLineTextPanel ? makeBigEditor(editor, ((MultiLineTextPanel)boundedComponent1).getRowCount()) : editor;
+      }
+      @Override
+      protected boolean isOneLineMode() {
+        return false;
+      }
+    };
+
+    if (boundedComponent instanceof BigTextPanel) {
+      final ReferenceEditorWithBrowseButton editor = new ReferenceEditorWithBrowseButton(null, editorTextField, factory);
+      boundedComponent.add(editor);
+      editor.addActionListener(new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+          EditorTextField textArea = new EditorTextField(editorTextField.getDocument(), project, FileTypes.PLAIN_TEXT) {
+            protected EditorEx createEditor() {
+              final EditorEx editor = super.createEditor();
+              editor.setEmbeddedIntoDialogWrapper(true);
+              return makeBigEditor(editor, 5);
+            }
+
+            @Override
+            protected boolean isOneLineMode() {
+              return false;
+            }
+          };
+
+          DialogBuilder builder = new DialogBuilder(project);
+          builder.setDimensionServiceKey("TextControl");
+          builder.setCenterPanel(textArea);
+          builder.setPreferedFocusComponent(textArea);
+          builder.setTitle(UIBundle.message("big.text.control.window.title"));
+          builder.addCloseButton();
+          builder.show();
+        }
+      });
+      return boundedComponent;
+    }
+
+    boundedComponent.add(editorTextField);
+    return boundedComponent;
+  }
+
+  private static EditorEx makeBigEditor(final EditorEx editor, int rowCount) {
+    editor.setVerticalScrollbarVisible(true);
+    final JTextArea area = new JTextArea(10, 50);
+    area.setRows(rowCount);
+    editor.getComponent().setPreferredSize(area.getPreferredSize());
+    return editor;
+  }
+
+
+}
diff --git a/xml/dom-impl/src/com/intellij/xml/impl/dom/AbstractDomChildrenDescriptor.java b/xml/dom-impl/src/com/intellij/xml/impl/dom/AbstractDomChildrenDescriptor.java
new file mode 100644
index 0000000..94f602b
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/xml/impl/dom/AbstractDomChildrenDescriptor.java
@@ -0,0 +1,254 @@
+package com.intellij.xml.impl.dom;
+
+import com.intellij.pom.PomTarget;
+import com.intellij.pom.references.PomService;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.EvaluatedXmlName;
+import com.intellij.util.xml.impl.AttributeChildDescriptionImpl;
+import com.intellij.util.xml.reflect.*;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementsGroup;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public abstract class AbstractDomChildrenDescriptor implements XmlElementDescriptor {
+  protected final DomManager myManager;
+
+  protected AbstractDomChildrenDescriptor(DomManager manager) {
+    myManager = manager;
+  }
+
+  public XmlElementDescriptor[] getElementsDescriptors(final XmlTag context) {
+    final DomElement domElement = myManager.getDomElement(context);
+    if (domElement == null) return EMPTY_ARRAY;
+
+    List<XmlElementDescriptor> xmlElementDescriptors = new ArrayList<XmlElementDescriptor>();
+
+    for (DomCollectionChildDescription childrenDescription : domElement.getGenericInfo().getCollectionChildrenDescriptions()) {
+      xmlElementDescriptors.add(new DomElementXmlDescriptor(childrenDescription, myManager));
+    }
+
+    for (DomFixedChildDescription childrenDescription : domElement.getGenericInfo().getFixedChildrenDescriptions()) {
+      xmlElementDescriptors.add(new DomElementXmlDescriptor(childrenDescription, myManager));
+    }
+
+    final List<? extends CustomDomChildrenDescription> customs = domElement.getGenericInfo().getCustomNameChildrenDescription();
+
+    for (final CustomDomChildrenDescription custom : customs) {
+      final CustomDomChildrenDescription.TagNameDescriptor tagNameDescriptor = custom.getTagNameDescriptor();
+      if (tagNameDescriptor == null) continue;
+      final XmlTag xmlTag = domElement.getXmlTag();
+      for (final EvaluatedXmlName name : tagNameDescriptor.getCompletionVariants(domElement)) {
+        AbstractDomChildrenDescriptor descriptor = new AbstractDomChildrenDescriptor(myManager) {
+          @Override
+          public String getDefaultName() {
+            final String ns = xmlTag != null ? name.getNamespace(xmlTag, (XmlFile)xmlTag.getContainingFile()) : null;
+            if (ns != null) {
+              final String prefix = xmlTag.getPrefixByNamespace(ns);
+              if (prefix != null) {
+                return prefix + ":" + name.getXmlName().getLocalName();
+              }
+            }
+            return name.getXmlName().getLocalName();
+          }
+
+          @Override
+          @Nullable
+          public PsiElement getDeclaration() {
+            final PomTarget target = tagNameDescriptor.findDeclaration(domElement, name);
+            return target == null ? null : PomService.convertToPsi(context.getProject(), target);
+          }
+        };
+        xmlElementDescriptors.add(descriptor);
+      }
+
+      xmlElementDescriptors.add(new AnyXmlElementDescriptor(this, getNSDescriptor()));
+    }
+
+    return xmlElementDescriptors.toArray(new XmlElementDescriptor[xmlElementDescriptors.size()]);
+  }
+
+  @Override
+  public XmlElementsGroup getTopGroup() {
+    return null;
+  }
+
+  @Nullable
+  public XmlElementDescriptor getElementDescriptor(@NotNull final XmlTag childTag, @Nullable XmlTag contextTag) {
+    DomElement domElement = myManager.getDomElement(childTag);
+    if (domElement == null) {
+      domElement = myManager.getDomElement(contextTag);
+      if (domElement != null) {
+        AbstractDomChildrenDescription description = myManager.findChildrenDescription(childTag, domElement);
+        if (description instanceof DomChildrenDescription) {
+          return new DomElementXmlDescriptor((DomChildrenDescription)description, myManager);
+        }
+      }
+      return null;
+    }
+
+    final DomElement parent = domElement.getParent();
+    if (parent == null) return new DomElementXmlDescriptor(domElement);
+
+    final AbstractDomChildrenDescription description = domElement.getChildDescription();
+    if (description instanceof CustomDomChildrenDescription) {
+      final DomElement finalDomElement = domElement;
+      return new AbstractDomChildrenDescriptor(myManager) {
+        @Override
+        public String getDefaultName() {
+          return finalDomElement.getXmlElementName();
+        }
+
+        @Override
+        @Nullable
+        public PsiElement getDeclaration() {
+          final PomTarget target = ((CustomDomChildrenDescription)description).getTagNameDescriptor().findDeclaration(finalDomElement);
+          if (target == description) {
+            return childTag;
+          }
+          return target == null ? null : PomService.convertToPsi(childTag.getProject(), target);
+        }
+
+      };
+    }
+    if (!(description instanceof DomChildrenDescription)) return null;
+
+    return new DomElementXmlDescriptor((DomChildrenDescription)description, myManager);
+  }
+
+  public XmlAttributeDescriptor[] getAttributesDescriptors(final @Nullable XmlTag context) {
+    if (context == null) return XmlAttributeDescriptor.EMPTY;
+
+    DomElement domElement = myManager.getDomElement(context);
+    if (domElement == null) return XmlAttributeDescriptor.EMPTY;
+
+    final List<? extends DomAttributeChildDescription> descriptions = domElement.getGenericInfo().getAttributeChildrenDescriptions();
+    List<XmlAttributeDescriptor> descriptors = new ArrayList<XmlAttributeDescriptor>();
+
+    for (DomAttributeChildDescription description : descriptions) {
+      descriptors.add(new DomAttributeXmlDescriptor(description, myManager.getProject()));
+    }
+    List<? extends CustomDomChildrenDescription> customs = domElement.getGenericInfo().getCustomNameChildrenDescription();
+    for (CustomDomChildrenDescription custom : customs) {
+      CustomDomChildrenDescription.AttributeDescriptor descriptor = custom.getCustomAttributeDescriptor();
+      if (descriptor != null) {
+        for (EvaluatedXmlName variant : descriptor.getCompletionVariants(domElement)) {
+          AttributeChildDescriptionImpl childDescription = new AttributeChildDescriptionImpl(variant.getXmlName(), String.class);
+          descriptors.add(new DomAttributeXmlDescriptor(childDescription, myManager.getProject()));
+        }
+      }
+    }
+    return descriptors.toArray(new XmlAttributeDescriptor[descriptors.size()]);
+  }
+
+  @Nullable
+  public XmlAttributeDescriptor getAttributeDescriptor(final String attributeName, final @Nullable XmlTag context) {
+    DomElement domElement = myManager.getDomElement(context);
+    if (domElement == null) return null;
+
+    for (DomAttributeChildDescription description : domElement.getGenericInfo().getAttributeChildrenDescriptions()) {
+      if (attributeName.equals(DomAttributeXmlDescriptor.getQualifiedAttributeName(context, description.getXmlName()))) {
+        return new DomAttributeXmlDescriptor(description, myManager.getProject());
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public XmlAttributeDescriptor getAttributeDescriptor(final XmlAttribute attribute) {
+    return getAttributeDescriptor(attribute.getName(), attribute.getParent());
+  }
+
+  public XmlNSDescriptor getNSDescriptor() {
+    return new XmlNSDescriptor() {
+      @Nullable
+      public XmlElementDescriptor getElementDescriptor(@NotNull final XmlTag tag) {
+        throw new UnsupportedOperationException("Method getElementDescriptor not implemented in " + getClass());
+      }
+
+      @NotNull
+      public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable final XmlDocument document) {
+        throw new UnsupportedOperationException("Method getRootElementsDescriptors not implemented in " + getClass());
+      }
+
+      @Nullable
+      public XmlFile getDescriptorFile() {
+        return null;
+      }
+
+      public boolean isHierarhyEnabled() {
+        throw new UnsupportedOperationException("Method isHierarhyEnabled not implemented in " + getClass());
+      }
+
+      @Nullable
+      public PsiElement getDeclaration() {
+        throw new UnsupportedOperationException("Method getDeclaration not implemented in " + getClass());
+      }
+
+      @NonNls
+      public String getName(final PsiElement context) {
+        throw new UnsupportedOperationException("Method getName not implemented in " + getClass());
+      }
+
+      @NonNls
+      public String getName() {
+        throw new UnsupportedOperationException("Method getName not implemented in " + getClass());
+      }
+
+      public void init(final PsiElement element) {
+        throw new UnsupportedOperationException("Method init not implemented in " + getClass());
+      }
+
+      public Object[] getDependences() {
+        throw new UnsupportedOperationException("Method getDependences not implemented in " + getClass());
+      }
+    };
+  }
+
+  public int getContentType() {
+    return CONTENT_TYPE_UNKNOWN;
+  }
+
+  @Override
+  public String getDefaultValue() {
+    return null;
+  }
+
+  public void init(final PsiElement element) {
+    throw new UnsupportedOperationException("Method init not implemented in " + getClass());
+  }
+
+  public Object[] getDependences() {
+    throw new UnsupportedOperationException("Method getDependences not implemented in " + getClass());
+  }
+
+  @NonNls
+  public String getName() {
+    return getDefaultName();
+  }
+
+  public String getQualifiedName() {
+    return getDefaultName();
+  }
+
+  @Override
+  public String getName(PsiElement context) {
+    return getDefaultName();
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/xml/impl/dom/DomAttributeXmlDescriptor.java b/xml/dom-impl/src/com/intellij/xml/impl/dom/DomAttributeXmlDescriptor.java
new file mode 100644
index 0000000..eb79b6e
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/xml/impl/dom/DomAttributeXmlDescriptor.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.dom;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.impl.DomInvocationHandler;
+import com.intellij.util.xml.impl.DomManagerImpl;
+import com.intellij.util.xml.reflect.DomAttributeChildDescription;
+import com.intellij.util.xml.XmlName;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author mike
+ */
+public class DomAttributeXmlDescriptor implements XmlAttributeDescriptor {
+  private final DomAttributeChildDescription myDescription;
+  private final Project myProject;
+
+  public DomAttributeXmlDescriptor(final DomAttributeChildDescription description, Project project) {
+    myDescription = description;
+    myProject = project;
+  }
+
+  public boolean isRequired() {
+    return false;
+  }
+
+  public boolean isFixed() {
+    return false;
+  }
+
+  public boolean hasIdType() {
+    return false;
+  }
+
+  public boolean hasIdRefType() {
+    return false;
+  }
+
+  @Nullable
+  public String getDefaultValue() {
+    return null;
+  }//todo: refactor to hierarchy of value descriptor?
+
+  public boolean isEnumerated() {
+    return false;
+  }
+
+  @Nullable
+  public String[] getEnumeratedValues() {
+    return null;
+  }
+
+  @Nullable
+  public String validateValue(final XmlElement context, final String value) {
+    return null;
+  }
+
+  @Nullable
+  public PsiElement getDeclaration() {
+    return myDescription.getDeclaration(myProject);
+  }
+
+  @NonNls
+  public String getName(final PsiElement context) {
+    return getQualifiedAttributeName(context, myDescription.getXmlName());
+  }
+
+  static String getQualifiedAttributeName(PsiElement context, XmlName xmlName) {
+    final String localName = xmlName.getLocalName();
+    if (context instanceof XmlTag) {
+      final XmlTag tag = (XmlTag)context;
+      final DomInvocationHandler handler = DomManagerImpl.getDomManager(context.getProject()).getDomHandler(tag);
+      if (handler != null) {
+        final String ns = handler.createEvaluatedXmlName(xmlName).getNamespace(tag, handler.getFile());
+        if (!ns.equals(XmlUtil.EMPTY_URI) && !ns.equals(tag.getNamespace())) {
+          final String prefix = tag.getPrefixByNamespace(ns);
+          if (StringUtil.isNotEmpty(prefix)) {
+            return prefix + ":" + localName;
+          }
+        }
+      }
+    }
+
+    return localName;
+  }
+
+  @NonNls
+  public String getName() {
+    return getLocalName();
+  }
+
+  private String getLocalName() {
+    return myDescription.getXmlName().getLocalName();
+  }
+
+  public void init(final PsiElement element) {
+    throw new UnsupportedOperationException("Method init not implemented in " + getClass());
+  }
+
+  public Object[] getDependences() {
+    throw new UnsupportedOperationException("Method getDependences not implemented in " + getClass());
+  }
+}
diff --git a/xml/dom-impl/src/com/intellij/xml/impl/dom/DomElementXmlDescriptor.java b/xml/dom-impl/src/com/intellij/xml/impl/dom/DomElementXmlDescriptor.java
new file mode 100644
index 0000000..018de44
--- /dev/null
+++ b/xml/dom-impl/src/com/intellij/xml/impl/dom/DomElementXmlDescriptor.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.dom;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.pom.references.PomService;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.reflect.DomChildrenDescription;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.List;
+
+/**
+ * @author mike
+ */
+public class DomElementXmlDescriptor extends AbstractDomChildrenDescriptor {
+  private final DomChildrenDescription myChildrenDescription;
+
+  public DomElementXmlDescriptor(@NotNull final DomElement domElement) {
+    super(domElement.getManager());
+    myChildrenDescription = new MyRootDomChildrenDescription(domElement);
+  }
+
+  public DomElementXmlDescriptor(@NotNull final DomChildrenDescription childrenDescription, final DomManager manager) {
+    super(manager);
+    myChildrenDescription = childrenDescription;
+  }
+
+  public String getDefaultName() {
+    return myChildrenDescription.getXmlElementName();
+  }
+
+  @Nullable
+  public PsiElement getDeclaration() {
+    return myChildrenDescription.getDeclaration(myManager.getProject());
+  }
+
+  @NonNls
+  public String getName(final PsiElement context) {
+    final String name = getDefaultName();
+    if (context instanceof XmlTag) {
+      XmlTag tag = (XmlTag)context;
+      final PsiFile file = tag.getContainingFile();
+      DomElement element = myManager.getDomElement(tag);
+      if (element == null && tag.getParentTag() != null) {
+        element = myManager.getDomElement(tag.getParentTag());
+      }
+      if (element != null && file instanceof XmlFile && !(myChildrenDescription instanceof MyRootDomChildrenDescription)) {
+        final String namespace = DomService.getInstance().getEvaluatedXmlName(element).evaluateChildName(myChildrenDescription.getXmlName()).getNamespace(tag, (XmlFile)file);
+        if (!tag.getNamespaceByPrefix("").equals(namespace)) {
+          final String s = tag.getPrefixByNamespace(namespace);
+          if (StringUtil.isNotEmpty(s)) {
+            return s + ":" + name;
+          }
+        }
+      }
+    }
+
+    return name;
+  }
+
+  private static class MyRootDomChildrenDescription implements DomChildrenDescription {
+    private final DomElement myDomElement;
+
+    public MyRootDomChildrenDescription(final DomElement domElement) {
+      myDomElement = domElement;
+    }
+
+    public String getName() {
+      return getXmlElementName();
+    }
+
+    public boolean isValid() {
+      return true;
+    }
+
+    public void navigate(boolean requestFocus) {
+    }
+
+    public boolean canNavigate() {
+      return false;
+    }
+
+    public boolean canNavigateToSource() {
+      return false;
+    }
+
+    @NotNull
+    public XmlName getXmlName() {
+      throw new UnsupportedOperationException("Method getXmlName not implemented in " + getClass());
+    }
+
+    @NotNull
+    public String getXmlElementName() {
+      return myDomElement.getXmlElementName();
+    }
+
+    @NotNull
+      public String getCommonPresentableName(@NotNull final DomNameStrategy strategy) {
+      throw new UnsupportedOperationException("Method getCommonPresentableName not implemented in " + getClass());
+    }
+
+    @NotNull
+      public String getCommonPresentableName(@NotNull final DomElement parent) {
+      throw new UnsupportedOperationException("Method getCommonPresentableName not implemented in " + getClass());
+    }
+
+    @NotNull
+      public List<? extends DomElement> getValues(@NotNull final DomElement parent) {
+      throw new UnsupportedOperationException("Method getValues not implemented in " + getClass());
+    }
+
+    @NotNull
+      public List<? extends DomElement> getStableValues(@NotNull final DomElement parent) {
+      throw new UnsupportedOperationException("Method getStableValues not implemented in " + getClass());
+    }
+
+    @NotNull
+      public Type getType() {
+      throw new UnsupportedOperationException("Method getType not implemented in " + getClass());
+    }
+
+    @NotNull
+      public DomNameStrategy getDomNameStrategy(@NotNull final DomElement parent) {
+      throw new UnsupportedOperationException("Method getDomNameStrategy not implemented in " + getClass());
+    }
+
+    public <T> T getUserData(final Key<T> key) {
+      return null;
+    }
+
+    @Override
+    public ElementPresentationTemplate getPresentationTemplate() {
+      return null;
+    }
+
+    @Nullable
+      public <T extends Annotation> T getAnnotation(final Class<T> annotationClass) {
+          throw new UnsupportedOperationException("Method getAnnotation not implemented in " + getClass());
+        }
+
+    @Nullable
+    public PsiElement getDeclaration(final Project project) {
+      return PomService.convertToPsi(project, this);
+    }
+
+    @Override
+    public DomElement getDomDeclaration() {
+      return myDomElement;
+    }
+
+    @Override
+    public boolean isStubbed() {
+      return false;
+    }
+  }
+
+}
diff --git a/xml/dom-openapi/dom-openapi.iml b/xml/dom-openapi/dom-openapi.iml
new file mode 100644
index 0000000..da874a7
--- /dev/null
+++ b/xml/dom-openapi/dom-openapi.iml
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="resources" />
+    <orderEntry type="module" module-name="xml-openapi" />
+    <orderEntry type="module" module-name="lang-api" />
+    <orderEntry type="module" module-name="platform-api" />
+    <orderEntry type="module" module-name="extensions" />
+    <orderEntry type="module" module-name="util" />
+    <orderEntry type="module" module-name="lang-impl" />
+  </component>
+  <component name="copyright">
+    <Base>
+      <setting name="state" value="0" />
+    </Base>
+    <LanguageOptions name="HTML">
+      <option name="templateOptions">
+        <value>
+          <option name="block" value="true" />
+          <option name="separateBefore" value="false" />
+          <option name="separateAfter" value="false" />
+          <option name="prefixLines" value="true" />
+          <option name="lenBefore" value="80" />
+          <option name="lenAfter" value="80" />
+          <option name="box" value="false" />
+          <option name="filler" value=" " />
+        </value>
+      </option>
+      <option name="notice" value="Copyright (c) &amp;#36;today.year, Your Corporation. All Rights Reserved." />
+      <option name="keyword" value="Copyright" />
+      <option name="fileTypeOverride" value="2" />
+      <option name="relativeBefore" value="true" />
+      <option name="addBlankAfter" value="true" />
+      <option name="fileLocation" value="1" />
+      <option name="useAlternate" value="false" />
+    </LanguageOptions>
+    <LanguageOptions name="JAVA">
+      <option name="templateOptions">
+        <value>
+          <option name="block" value="true" />
+          <option name="separateBefore" value="false" />
+          <option name="separateAfter" value="false" />
+          <option name="prefixLines" value="true" />
+          <option name="lenBefore" value="80" />
+          <option name="lenAfter" value="80" />
+          <option name="box" value="false" />
+          <option name="filler" value=" " />
+        </value>
+      </option>
+      <option name="notice" value="/*  * Copyright (c) 2000-05 JetBrains s.r.o. 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.  *  * -Redistribution in binary form must reproduct 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 JetBrains or IntelliJ IDEA  * may be used to endorse or promote products derived from this software  * without specific prior written permission.  *  * This software is provided &quot;AS IS,&quot; without a warranty of any kind. ALL  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING  * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE  * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. JETBRAINS AND ITS LICENSORS SHALL NOT  * BE LIABLE FOR ANY DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT  * OF OR RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR ITS  * DERIVATIVES. IN NO EVENT WILL JETBRAINS OR ITS LICENSORS BE LIABLE FOR ANY LOST  * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,  * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY  * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN  * IF JETBRAINS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  *  */" />
+      <option name="keyword" value="Copyright" />
+      <option name="fileTypeOverride" value="2" />
+      <option name="relativeBefore" value="true" />
+      <option name="addBlankAfter" value="true" />
+      <option name="fileLocation" value="1" />
+      <option name="useAlternate" value="false" />
+    </LanguageOptions>
+    <LanguageOptions name="JSP">
+      <option name="templateOptions">
+        <value>
+          <option name="block" value="true" />
+          <option name="separateBefore" value="false" />
+          <option name="separateAfter" value="false" />
+          <option name="prefixLines" value="true" />
+          <option name="lenBefore" value="80" />
+          <option name="lenAfter" value="80" />
+          <option name="box" value="false" />
+          <option name="filler" value=" " />
+        </value>
+      </option>
+      <option name="notice" value="Copyright (c) &amp;#36;today.year, Your Corporation. All Rights Reserved." />
+      <option name="keyword" value="Copyright" />
+      <option name="fileTypeOverride" value="2" />
+      <option name="relativeBefore" value="true" />
+      <option name="addBlankAfter" value="true" />
+      <option name="fileLocation" value="1" />
+      <option name="useAlternate" value="false" />
+    </LanguageOptions>
+    <LanguageOptions name="JavaScript">
+      <option name="templateOptions">
+        <value>
+          <option name="block" value="true" />
+          <option name="separateBefore" value="false" />
+          <option name="separateAfter" value="false" />
+          <option name="prefixLines" value="true" />
+          <option name="lenBefore" value="80" />
+          <option name="lenAfter" value="80" />
+          <option name="box" value="false" />
+          <option name="filler" value=" " />
+        </value>
+      </option>
+      <option name="notice" value="Copyright (c) &amp;#36;today.year, Your Corporation. All Rights Reserved." />
+      <option name="keyword" value="Copyright" />
+      <option name="fileTypeOverride" value="2" />
+      <option name="relativeBefore" value="true" />
+      <option name="addBlankAfter" value="true" />
+      <option name="fileLocation" value="1" />
+      <option name="useAlternate" value="false" />
+    </LanguageOptions>
+    <LanguageOptions name="Properties">
+      <option name="templateOptions">
+        <value>
+          <option name="block" value="true" />
+          <option name="separateBefore" value="false" />
+          <option name="separateAfter" value="false" />
+          <option name="prefixLines" value="true" />
+          <option name="lenBefore" value="80" />
+          <option name="lenAfter" value="80" />
+          <option name="box" value="false" />
+          <option name="filler" value=" " />
+        </value>
+      </option>
+      <option name="notice" value="Copyright (c) &amp;#36;today.year, Your Corporation. All Rights Reserved." />
+      <option name="keyword" value="Copyright" />
+      <option name="fileTypeOverride" value="2" />
+      <option name="relativeBefore" value="true" />
+      <option name="addBlankAfter" value="true" />
+      <option name="fileLocation" value="1" />
+      <option name="useAlternate" value="false" />
+    </LanguageOptions>
+    <LanguageOptions name="XML">
+      <option name="templateOptions">
+        <value>
+          <option name="block" value="true" />
+          <option name="separateBefore" value="false" />
+          <option name="separateAfter" value="false" />
+          <option name="prefixLines" value="true" />
+          <option name="lenBefore" value="80" />
+          <option name="lenAfter" value="80" />
+          <option name="box" value="false" />
+          <option name="filler" value=" " />
+        </value>
+      </option>
+      <option name="notice" value="Copyright (c) &amp;#36;today.year, Your Corporation. All Rights Reserved." />
+      <option name="keyword" value="Copyright" />
+      <option name="fileTypeOverride" value="2" />
+      <option name="relativeBefore" value="true" />
+      <option name="addBlankAfter" value="true" />
+      <option name="fileLocation" value="1" />
+      <option name="useAlternate" value="false" />
+    </LanguageOptions>
+    <LanguageOptions name="__TEMPLATE__">
+      <option name="templateOptions">
+        <value>
+          <option name="block" value="true" />
+          <option name="separateBefore" value="false" />
+          <option name="separateAfter" value="false" />
+          <option name="prefixLines" value="true" />
+          <option name="lenBefore" value="80" />
+          <option name="lenAfter" value="80" />
+          <option name="box" value="false" />
+          <option name="filler" value=" " />
+        </value>
+      </option>
+      <option name="notice" value="Copyright 2000-&amp;#36;{today.year} JetBrains s.r.o.&#10;&#10;Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10;you may not use this file except in compliance with the License.&#10;You may obtain a copy of the License at&#10;&#10;http://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10;See the License for the specific language governing permissions and&#10;limitations under the License." />
+      <option name="keyword" value="Copyright" />
+      <option name="fileTypeOverride" value="4" />
+      <option name="relativeBefore" value="true" />
+      <option name="addBlankAfter" value="true" />
+      <option name="fileLocation" value="1" />
+      <option name="useAlternate" value="false" />
+    </LanguageOptions>
+  </component>
+</module>
+
diff --git a/xml/dom-openapi/src/com/intellij/codeInsight/navigation/DomGotoRelatedItem.java b/xml/dom-openapi/src/com/intellij/codeInsight/navigation/DomGotoRelatedItem.java
new file mode 100644
index 0000000..f58e0bc
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/codeInsight/navigation/DomGotoRelatedItem.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.navigation;
+
+import com.intellij.navigation.GotoRelatedItem;
+import com.intellij.util.xml.DomElement;
+
+import javax.swing.*;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class DomGotoRelatedItem extends GotoRelatedItem {
+  private final DomElement myElement;
+
+  public DomGotoRelatedItem(DomElement element) {
+    this(element, "XML");
+  }
+
+  public DomGotoRelatedItem(DomElement element, String group) {
+    this(element, group, -1);
+  }
+
+  public DomGotoRelatedItem(DomElement element, String group, int mnemonic) {
+    super(element.getXmlElement(), group, mnemonic);
+    myElement = element;
+  }
+
+  @Override
+  public String getCustomName() {
+    return myElement.getPresentation().getElementName();
+  }
+
+  @Override
+  public Icon getCustomIcon() {
+    return myElement.getPresentation().getIcon();
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/codeInsight/navigation/NavigationGutterIconBuilder.java b/xml/dom-openapi/src/com/intellij/codeInsight/navigation/NavigationGutterIconBuilder.java
new file mode 100644
index 0000000..52c2153
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/codeInsight/navigation/NavigationGutterIconBuilder.java
@@ -0,0 +1,358 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.navigation;
+
+import com.intellij.codeHighlighting.Pass;
+import com.intellij.codeInsight.daemon.RelatedItemLineMarkerInfo;
+import com.intellij.ide.util.DefaultPsiElementCellRenderer;
+import com.intellij.ide.util.PsiElementListCellRenderer;
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.lang.annotation.AnnotationHolder;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.navigation.GotoRelatedItem;
+import com.intellij.openapi.editor.markup.GutterIconRenderer;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Computable;
+import com.intellij.openapi.util.NotNullLazyValue;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.SmartPointerManager;
+import com.intellij.psi.SmartPsiElementPointer;
+import com.intellij.util.ConstantFunction;
+import com.intellij.util.NotNullFunction;
+import com.intellij.util.NullableFunction;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.ElementPresentationManager;
+import com.intellij.util.xml.highlighting.DomElementAnnotationHolder;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.text.MessageFormat;
+import java.util.*;
+
+/**
+ * DOM-specific builder for {@link com.intellij.openapi.editor.markup.GutterIconRenderer}
+ * and {@link com.intellij.codeInsight.daemon.LineMarkerInfo}.
+ *
+ * @author peter
+ */
+public class NavigationGutterIconBuilder<T> {
+  @NonNls private static final String PATTERN = "&nbsp;&nbsp;&nbsp;&nbsp;{0}";
+  private static final NotNullFunction<PsiElement,Collection<? extends PsiElement>> DEFAULT_PSI_CONVERTOR = new NotNullFunction<PsiElement, Collection<? extends PsiElement>>() {
+    @NotNull
+    public Collection<? extends PsiElement> fun(final PsiElement element) {
+      return ContainerUtil.createMaybeSingletonList(element);
+    }
+  };
+
+  private final Icon myIcon;
+  private final NotNullFunction<T,Collection<? extends PsiElement>> myConverter;
+
+  private NotNullLazyValue<Collection<? extends T>> myTargets;
+  private boolean myLazy;
+  private String myTooltipText;
+  private String myPopupTitle;
+  private String myEmptyText;
+  private String myTooltipTitle;
+  private GutterIconRenderer.Alignment myAlignment = GutterIconRenderer.Alignment.CENTER;
+  private Computable<PsiElementListCellRenderer> myCellRenderer;
+  private NullableFunction<T,String> myNamer = ElementPresentationManager.namer();
+  private final NotNullFunction<T, Collection<? extends GotoRelatedItem>> myGotoRelatedItemProvider;
+  public static final NotNullFunction<DomElement,Collection<? extends PsiElement>> DEFAULT_DOM_CONVERTOR = new NotNullFunction<DomElement, Collection<? extends PsiElement>>() {
+    @NotNull
+    public Collection<? extends PsiElement> fun(final DomElement o) {
+      return ContainerUtil.createMaybeSingletonList(o.getXmlElement());
+    }
+  };
+  public static final NotNullFunction<DomElement, Collection<? extends GotoRelatedItem>> DOM_GOTO_RELATED_ITEM_PROVIDER = new NotNullFunction<DomElement, Collection<? extends GotoRelatedItem>>() {
+    @NotNull
+    @Override
+    public Collection<? extends GotoRelatedItem> fun(DomElement dom) {
+      if (dom.getXmlElement() != null) {
+        return Collections.singletonList(new DomGotoRelatedItem(dom));
+      }
+      return Collections.emptyList();
+    }
+  };
+  public static final NotNullFunction<PsiElement, Collection<? extends GotoRelatedItem>> PSI_GOTO_RELATED_ITEM_PROVIDER = new NotNullFunction<PsiElement, Collection<? extends GotoRelatedItem>>() {
+    @NotNull
+    @Override
+    public Collection<? extends GotoRelatedItem> fun(PsiElement dom) {
+      return Collections.singletonList(new GotoRelatedItem(dom, "XML"));
+    }
+  };
+
+  protected NavigationGutterIconBuilder(@NotNull final Icon icon, @NotNull NotNullFunction<T, Collection<? extends PsiElement>> converter) {
+    this(icon, converter, null);
+  }
+
+  protected NavigationGutterIconBuilder(@NotNull final Icon icon,
+                                        @NotNull NotNullFunction<T, Collection<? extends PsiElement>> converter,
+                                        final @Nullable NotNullFunction<T, Collection<? extends GotoRelatedItem>> gotoRelatedItemProvider) {
+    myIcon = icon;
+    myConverter = converter;
+    myGotoRelatedItemProvider = gotoRelatedItemProvider;
+  }
+
+  public static NavigationGutterIconBuilder<PsiElement> create(@NotNull final Icon icon) {
+    return create(icon, DEFAULT_PSI_CONVERTOR, PSI_GOTO_RELATED_ITEM_PROVIDER);
+  }
+
+  public static <T> NavigationGutterIconBuilder<T> create(@NotNull final Icon icon,
+                                                          @NotNull NotNullFunction<T, Collection<? extends PsiElement>> converter) {
+    return create(icon, converter, null);
+  }
+
+  public static <T> NavigationGutterIconBuilder<T> create(@NotNull final Icon icon,
+                                                          @NotNull NotNullFunction<T, Collection<? extends PsiElement>> converter,
+                                                          final @Nullable NotNullFunction<T, Collection<? extends GotoRelatedItem>> gotoRelatedItemProvider) {
+    return new NavigationGutterIconBuilder<T>(icon, converter, gotoRelatedItemProvider);
+  }
+
+  public NavigationGutterIconBuilder<T> setTarget(@Nullable T target) {
+    return setTargets(ContainerUtil.createMaybeSingletonList(target));
+  }
+
+  public NavigationGutterIconBuilder<T> setTargets(@NotNull T... targets) {
+    return setTargets(Arrays.asList(targets));
+  }
+
+  public NavigationGutterIconBuilder<T> setTargets(@NotNull final NotNullLazyValue<Collection<? extends T>> targets) {
+    myTargets = targets;
+    myLazy = true;
+    return this;
+  }
+
+  public NavigationGutterIconBuilder<T> setTargets(@NotNull final Collection<? extends T> targets) {
+    myTargets = new NotNullLazyValue<Collection<? extends T>>() {
+      @NotNull
+      public Collection<? extends T> compute() {
+        return targets;
+      }
+    };
+    return this;
+  }
+
+  public NavigationGutterIconBuilder<T> setTooltipText(@NotNull String tooltipText) {
+    myTooltipText = tooltipText;
+    return this;
+  }
+
+  public NavigationGutterIconBuilder<T> setAlignment(@NotNull final GutterIconRenderer.Alignment alignment) {
+    myAlignment = alignment;
+    return this;
+  }
+
+  public NavigationGutterIconBuilder<T> setPopupTitle(@NotNull String popupTitle) {
+    myPopupTitle = popupTitle;
+    return this;
+  }
+
+  public NavigationGutterIconBuilder<T> setEmptyPopupText(@NotNull String emptyText) {
+    myEmptyText = emptyText;
+    return this;
+  }
+
+  public NavigationGutterIconBuilder<T> setTooltipTitle(@NotNull final String tooltipTitle) {
+    myTooltipTitle = tooltipTitle;
+    return this;
+  }
+
+  public NavigationGutterIconBuilder<T> setNamer(@NotNull NullableFunction<T,String> namer) {
+    myNamer = namer;
+    return this;
+  }
+
+  public NavigationGutterIconBuilder<T> setCellRenderer(@NotNull final PsiElementListCellRenderer cellRenderer) {
+    myCellRenderer = new Computable.PredefinedValueComputable<PsiElementListCellRenderer>(cellRenderer);
+    return this;
+  }
+
+  @Nullable
+  public Annotation install(@NotNull DomElementAnnotationHolder holder, @Nullable DomElement element) {
+    if (!myLazy && myTargets.getValue().isEmpty() || element == null) return null;
+    return doInstall(holder.createAnnotation(element, HighlightSeverity.INFORMATION, null), element.getManager().getProject());
+  }
+
+  @Nullable
+  public Annotation install(@NotNull AnnotationHolder holder, @Nullable PsiElement element) {
+    if (!myLazy && myTargets.getValue().isEmpty() || element == null) return null;
+    return doInstall(holder.createInfoAnnotation(element, null), element.getProject());
+  }
+
+  private Annotation doInstall(@NotNull Annotation annotation, @NotNull Project project) {
+    final MyNavigationGutterIconRenderer renderer = createGutterIconRenderer(project);
+    annotation.setGutterIconRenderer(renderer);
+    annotation.setNeedsUpdateOnTyping(false);
+    return annotation;
+  }
+
+  public RelatedItemLineMarkerInfo<PsiElement> createLineMarkerInfo(@NotNull PsiElement element) {
+    final MyNavigationGutterIconRenderer renderer = createGutterIconRenderer(element.getProject());
+    final String tooltip = renderer.getTooltipText();
+    NotNullLazyValue<Collection<? extends GotoRelatedItem>> gotoTargets = new NotNullLazyValue<Collection<? extends GotoRelatedItem>>() {
+      @NotNull
+      @Override
+      protected Collection<? extends GotoRelatedItem> compute() {
+        if (myGotoRelatedItemProvider != null) {
+          return ContainerUtil.concat(myTargets.getValue(), myGotoRelatedItemProvider);
+        }
+        return Collections.emptyList();
+      }
+    };
+    return new RelatedItemLineMarkerInfo<PsiElement>(element, element.getTextRange(), renderer.getIcon(), Pass.UPDATE_OVERRIDEN_MARKERS,
+                                                     tooltip == null ? null : new ConstantFunction<PsiElement, String>(tooltip),
+                                                     renderer.isNavigateAction() ? renderer : null, renderer.getAlignment(),
+                                                     gotoTargets);
+  }
+
+  private void checkBuilt() {
+    assert myTargets != null : "Must have called .setTargets() before calling create()";
+  }
+
+  private MyNavigationGutterIconRenderer createGutterIconRenderer(@NotNull Project project) {
+    checkBuilt();
+    final SmartPointerManager manager = SmartPointerManager.getInstance(project);
+
+    NotNullLazyValue<List<SmartPsiElementPointer>> pointers = new NotNullLazyValue<List<SmartPsiElementPointer>>() {
+      @NotNull
+      public List<SmartPsiElementPointer> compute() {
+        Set<PsiElement> elements = new THashSet<PsiElement>();
+        Collection<? extends T> targets = myTargets.getValue();
+        final List<SmartPsiElementPointer> list = new ArrayList<SmartPsiElementPointer>(targets.size());
+        for (final T target : targets) {
+          for (final PsiElement psiElement : myConverter.fun(target)) {
+            if (elements.add(psiElement) && psiElement.isValid()) {
+              list.add(manager.createSmartPsiElementPointer(psiElement));
+            }
+          }
+        }
+        return list;
+      }
+    };
+
+    final boolean empty = isEmpty();
+
+    if (myTooltipText == null && !myLazy) {
+      final SortedSet<String> names = new TreeSet<String>();
+      for (T t : myTargets.getValue()) {
+        final String text = myNamer.fun(t);
+        if (text != null) {
+          names.add(MessageFormat.format(PATTERN, text));
+        }
+      }
+      @NonNls StringBuilder sb = new StringBuilder("<html><body>");
+      if (myTooltipTitle != null) {
+        sb.append(myTooltipTitle).append("<br>");
+      }
+      for (String name : names) {
+        sb.append(name).append("<br>");
+      }
+      sb.append("</body></html>");
+      myTooltipText = sb.toString();
+    }
+
+    Computable<PsiElementListCellRenderer> renderer =
+      myCellRenderer == null ? new Computable<PsiElementListCellRenderer>() {
+        @Override
+        public PsiElementListCellRenderer compute() {
+          return new DefaultPsiElementCellRenderer();
+        }
+      } : myCellRenderer;
+    return new MyNavigationGutterIconRenderer(this, myAlignment, myIcon, myTooltipText, pointers, renderer, empty);
+  }
+
+  private boolean isEmpty() {
+    if (myLazy) {
+      return false;
+    }
+
+    Set<PsiElement> elements = new THashSet<PsiElement>();
+    Collection<? extends T> targets = myTargets.getValue();
+    for (final T target : targets) {
+      for (final PsiElement psiElement : myConverter.fun(target)) {
+        if (elements.add(psiElement)) {
+          return false;
+        }
+      }
+    }
+    return true;
+  }
+
+  private static class MyNavigationGutterIconRenderer extends NavigationGutterIconRenderer {
+    private final Alignment myAlignment;
+    private final Icon myIcon;
+    private final String myTooltipText;
+    private final boolean myEmpty;
+
+    public MyNavigationGutterIconRenderer(@NotNull NavigationGutterIconBuilder builder,
+                                          final Alignment alignment,
+                                          final Icon icon,
+                                          @Nullable final String tooltipText,
+                                          @NotNull NotNullLazyValue<List<SmartPsiElementPointer>> pointers,
+                                          Computable<PsiElementListCellRenderer> cellRenderer,
+                                          boolean empty) {
+      super(builder.myPopupTitle, builder.myEmptyText, cellRenderer, pointers);
+      myAlignment = alignment;
+      myIcon = icon;
+      myTooltipText = tooltipText;
+      myEmpty = empty;
+    }
+
+    @Override
+    public boolean isNavigateAction() {
+      return !myEmpty;
+    }
+
+    @NotNull
+    public Icon getIcon() {
+      return myIcon;
+    }
+
+    @Nullable
+    public String getTooltipText() {
+      return myTooltipText;
+    }
+
+    public Alignment getAlignment() {
+      return myAlignment;
+    }
+
+    public boolean equals(final Object o) {
+      if (this == o) return true;
+      if (!super.equals(o)) return false;
+
+      final MyNavigationGutterIconRenderer that = (MyNavigationGutterIconRenderer)o;
+
+      if (myAlignment != that.myAlignment) return false;
+      if (myIcon != null ? !myIcon.equals(that.myIcon) : that.myIcon != null) return false;
+      if (myTooltipText != null ? !myTooltipText.equals(that.myTooltipText) : that.myTooltipText != null) return false;
+
+      return true;
+    }
+
+    public int hashCode() {
+      int result = super.hashCode();
+      result = 31 * result + (myAlignment != null ? myAlignment.hashCode() : 0);
+      result = 31 * result + (myIcon != null ? myIcon.hashCode() : 0);
+      result = 31 * result + (myTooltipText != null ? myTooltipText.hashCode() : 0);
+      return result;
+    }
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/codeInsight/navigation/NavigationGutterIconRenderer.java b/xml/dom-openapi/src/com/intellij/codeInsight/navigation/NavigationGutterIconRenderer.java
new file mode 100644
index 0000000..38aa920
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/codeInsight/navigation/NavigationGutterIconRenderer.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.navigation;
+
+import com.intellij.codeInsight.daemon.GutterIconNavigationHandler;
+import com.intellij.codeInsight.hint.HintUtil;
+import com.intellij.ide.util.PsiElementListCellRenderer;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.editor.markup.GutterIconRenderer;
+import com.intellij.openapi.ui.popup.Balloon;
+import com.intellij.openapi.ui.popup.JBPopup;
+import com.intellij.openapi.ui.popup.JBPopupFactory;
+import com.intellij.openapi.util.Computable;
+import com.intellij.openapi.util.NotNullLazyValue;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.SmartPsiElementPointer;
+import com.intellij.psi.util.PsiUtilCore;
+import com.intellij.ui.IdeBorderFactory;
+import com.intellij.ui.awt.RelativePoint;
+import com.intellij.util.NullableFunction;
+import com.intellij.util.PsiNavigateUtil;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.event.MouseEvent;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public abstract class NavigationGutterIconRenderer extends GutterIconRenderer implements GutterIconNavigationHandler<PsiElement>{
+  private final String myPopupTitle;
+  private final String myEmptyText;
+  private final Computable<PsiElementListCellRenderer> myCellRenderer;
+  private final NotNullLazyValue<List<SmartPsiElementPointer>> myPointers;
+
+  protected NavigationGutterIconRenderer(final String popupTitle, final String emptyText, @NotNull Computable<PsiElementListCellRenderer> cellRenderer,
+    @NotNull NotNullLazyValue<List<SmartPsiElementPointer>> pointers) {
+    myPopupTitle = popupTitle;
+    myEmptyText = emptyText;
+    myCellRenderer = cellRenderer;
+    myPointers = pointers;
+  }
+
+  public boolean isNavigateAction() {
+    return true;
+  }
+
+  public List<PsiElement> getTargetElements() {
+    return ContainerUtil.mapNotNull(myPointers.getValue(), new NullableFunction<SmartPsiElementPointer, PsiElement>() {
+      public PsiElement fun(final SmartPsiElementPointer smartPsiElementPointer) {
+        return smartPsiElementPointer.getElement();
+      }
+    });
+  }
+
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    final NavigationGutterIconRenderer renderer = (NavigationGutterIconRenderer)o;
+
+    if (myEmptyText != null ? !myEmptyText.equals(renderer.myEmptyText) : renderer.myEmptyText != null) return false;
+    if (!myPointers.getValue().equals(renderer.myPointers.getValue())) return false;
+    if (myPopupTitle != null ? !myPopupTitle.equals(renderer.myPopupTitle) : renderer.myPopupTitle != null) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    int result;
+    result = (myPopupTitle != null ? myPopupTitle.hashCode() : 0);
+    result = 31 * result + (myEmptyText != null ? myEmptyText.hashCode() : 0);
+    result = 31 * result + myPointers.getValue().hashCode();
+    return result;
+  }
+
+  @Nullable
+  public AnAction getClickAction() {
+    return new AnAction() {
+      public void actionPerformed(AnActionEvent e) {
+        navigate(e == null ? null : (MouseEvent)e.getInputEvent(), null);
+      }
+    };
+  }
+
+  public void navigate(@Nullable final MouseEvent event, @Nullable final PsiElement elt) {
+    final List<PsiElement> list = getTargetElements();
+    if (list.isEmpty()) {
+      if (myEmptyText != null) {
+        if (event != null) {
+          final JComponent label = HintUtil.createErrorLabel(myEmptyText);
+          label.setBorder(IdeBorderFactory.createEmptyBorder(2, 7, 2, 7));
+          JBPopupFactory.getInstance().createBalloonBuilder(label)
+            .setPreferredPosition(Balloon.Position.above)
+            .setFadeoutTime(3000)
+            .setFillColor(HintUtil.ERROR_COLOR)
+            .createBalloon()
+            .show(new RelativePoint(event), Balloon.Position.above);
+        }
+      }
+      return;
+    }
+    if (list.size() == 1) {
+      PsiNavigateUtil.navigate(list.iterator().next());
+    }
+    else {
+      if (event != null) {
+        final JBPopup popup = NavigationUtil.getPsiElementPopup(PsiUtilCore.toPsiElementArray(list), myCellRenderer.compute(), myPopupTitle);
+        popup.show(new RelativePoint(event));
+      }
+    }
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/javaee/web/PsiReferenceConverter.java b/xml/dom-openapi/src/com/intellij/javaee/web/PsiReferenceConverter.java
new file mode 100644
index 0000000..c1db0ed
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/javaee/web/PsiReferenceConverter.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.javaee.web;
+
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Can be implemented by {@link com.intellij.util.xml.Converter} instance
+ *
+ * @deprecated use {@link com.intellij.util.xml.CustomReferenceConverter} instead
+ * @author Dmitry Avdeev
+ */
+public interface PsiReferenceConverter {
+
+  /**
+   *
+   * @param psiElement underlying element for created references ({@link com.intellij.psi.PsiReference#getElement()})
+   * @param soft true if created references should be soft ({@link com.intellij.psi.PsiReference#isSoft()})
+   * @return empty array if the converter cannot get any references
+   */
+  @NotNull
+  PsiReference[] createReferences(@NotNull PsiElement psiElement, final boolean soft);
+}
diff --git a/xml/dom-openapi/src/com/intellij/patterns/DomElementPattern.java b/xml/dom-openapi/src/com/intellij/patterns/DomElementPattern.java
new file mode 100644
index 0000000..e68cf0d
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/patterns/DomElementPattern.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.patterns;
+
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomElementVisitor;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import com.intellij.util.xml.reflect.DomChildrenDescription;
+import com.intellij.util.ProcessingContext;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class DomElementPattern<T extends DomElement,Self extends DomElementPattern<T,Self>> extends TreeElementPattern<DomElement,T,Self> {
+  protected DomElementPattern(final Class<T> aClass) {
+    super(aClass);
+  }
+
+  protected DomElementPattern(@NotNull final InitialPatternCondition<T> condition) {
+    super(condition);
+  }
+
+  protected DomElement getParent(@NotNull DomElement t) {
+    return t.getParent();
+  }
+
+  protected DomElement[] getChildren(@NotNull final DomElement domElement) {
+    final List<DomElement> children = new ArrayList<DomElement>();
+    domElement.acceptChildren(new DomElementVisitor() {
+      public void visitDomElement(final DomElement element) {
+        children.add(element);
+      }
+    });
+    return children.toArray(new DomElement[children.size()]);
+  }
+
+  public static class Capture<T extends DomElement> extends DomElementPattern<T, Capture<T>> {
+    protected Capture(final Class<T> aClass) {
+      super(aClass);
+    }
+
+  }
+
+  public Self withChild(@NonNls @NotNull final String localName, final ElementPattern pattern) {
+    return with(new PatternCondition<T>("withChild") {
+      public boolean accepts(@NotNull final T t, final ProcessingContext context) {
+        for (final AbstractDomChildrenDescription description : t.getGenericInfo().getChildrenDescriptions()) {
+          if (!(description instanceof DomChildrenDescription) || localName.equals(((DomChildrenDescription)description).getXmlElementName())) {
+            for (final DomElement element : description.getValues(t)) {
+              if (localName.equals(element.getXmlElementName()) && pattern.getCondition().accepts(element, context)) {
+                return true;
+              }
+            }
+          }
+        }
+        return false;
+      }
+    });
+  }
+
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/patterns/DomPatterns.java b/xml/dom-openapi/src/com/intellij/patterns/DomPatterns.java
new file mode 100644
index 0000000..a5f2b3f
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/patterns/DomPatterns.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.patterns;
+
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ProcessingContext;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.DomTarget;
+import com.intellij.pom.PomTargetPsiElement;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class DomPatterns {
+
+  public static <T extends DomElement> DomElementPattern.Capture<T> domElement(Class<T> aClass) {
+    return new DomElementPattern.Capture<T>(aClass);
+  }
+
+  public static DomElementPattern.Capture<DomElement> domElement() {
+    return domElement(DomElement.class);
+  }
+
+  public static GenericDomValuePattern<?> genericDomValue() {
+    return new GenericDomValuePattern();
+  }
+
+  public static <T> GenericDomValuePattern<T> genericDomValue(ElementPattern<?> valuePattern) {
+    return ((GenericDomValuePattern)genericDomValue()).withValue(valuePattern);
+  }
+
+  public static <T> GenericDomValuePattern<T> genericDomValue(Class<T> aClass) {
+    return new GenericDomValuePattern<T>(aClass);
+  }
+
+  public static XmlElementPattern.Capture withDom(final ElementPattern<? extends DomElement> pattern) {
+    return new XmlElementPattern.Capture().with(new PatternCondition<XmlElement>("tagWithDom") {
+      public boolean accepts(@NotNull final XmlElement xmlElement, final ProcessingContext context) {
+        final DomManager manager = DomManager.getDomManager(xmlElement.getProject());
+        if (xmlElement instanceof XmlAttribute) {
+          return pattern.getCondition().accepts(manager.getDomElement((XmlAttribute)xmlElement), context);
+        }
+        return xmlElement instanceof XmlTag && pattern.getCondition().accepts(manager.getDomElement((XmlTag)xmlElement), context);
+      }
+    });
+  }
+
+  public static XmlTagPattern.Capture tagWithDom(String tagName, Class<? extends DomElement> aClass) {
+    return tagWithDom(tagName, domElement(aClass));
+  }
+
+  public static XmlTagPattern.Capture tagWithDom(String tagName, ElementPattern<? extends DomElement> domPattern) {
+    return XmlPatterns.xmlTag().withLocalName(tagName).and(withDom(domPattern));
+  }
+
+  public static PsiElementPattern.Capture<PomTargetPsiElement> domTargetElement(final ElementPattern<? extends DomElement> pattern) {
+    return PlatformPatterns.pomElement(withDomTarget(pattern));
+  }
+
+  public static ElementPattern<DomTarget> withDomTarget(final ElementPattern<? extends DomElement> pattern) {
+    return new ObjectPattern.Capture<DomTarget>(DomTarget.class).with(new PatternCondition<DomTarget>("withDomTarget") {
+      @Override
+      public boolean accepts(@NotNull final DomTarget target, final ProcessingContext context) {
+        return pattern.accepts(target.getDomElement(), context);
+      }
+    });
+  }
+
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/patterns/GenericDomValuePattern.java b/xml/dom-openapi/src/com/intellij/patterns/GenericDomValuePattern.java
new file mode 100644
index 0000000..f02965b
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/patterns/GenericDomValuePattern.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.patterns;
+
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.GenericDomValue;
+import com.intellij.util.ProcessingContext;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public class GenericDomValuePattern<T> extends DomElementPattern<GenericDomValue<T>, GenericDomValuePattern<T>>{
+  private static final InitialPatternCondition CONDITION = new InitialPatternCondition(GenericDomValue.class) {
+    public boolean accepts(@Nullable final Object o, final ProcessingContext context) {
+      return o instanceof GenericDomValue;
+    }
+  };
+
+  protected GenericDomValuePattern() {
+    super(CONDITION);
+  }
+
+  protected GenericDomValuePattern(final Class<T> aClass) {
+    super(new InitialPatternCondition(aClass) {
+      public boolean accepts(@Nullable final Object o, final ProcessingContext context) {
+        return o instanceof GenericDomValue && aClass.equals(DomUtil.getGenericValueParameter(((GenericDomValue)o).getDomElementType()));
+      }
+
+    });
+  }
+
+  public GenericDomValuePattern<T> withStringValue(final ElementPattern<String> pattern) {
+    return with(new PatternCondition<GenericDomValue<T>>("withStringValue") {
+      public boolean accepts(@NotNull final GenericDomValue<T> genericDomValue, final ProcessingContext context) {
+        return pattern.getCondition().accepts(genericDomValue.getStringValue(), context);
+      }
+
+    });
+  }
+
+  public GenericDomValuePattern<T> withValue(@NotNull final T value) {
+    return withValue(StandardPatterns.object(value));
+  }
+
+  public GenericDomValuePattern<T> withValue(final ElementPattern<?> pattern) {
+    return with(new PatternCondition<GenericDomValue<T>>("withValue") {
+      public boolean accepts(@NotNull final GenericDomValue<T> genericDomValue, final ProcessingContext context) {
+        return pattern.getCondition().accepts(genericDomValue.getValue(), context);
+      }
+    });
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/AbstractConvertContext.java b/xml/dom-openapi/src/com/intellij/util/xml/AbstractConvertContext.java
new file mode 100644
index 0000000..dd2c03f
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/AbstractConvertContext.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtil;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public abstract class AbstractConvertContext extends ConvertContext {
+
+  public static ConvertContext createConvertContext(final DomElement domElement) {
+    return new AbstractConvertContext() {
+      @NotNull
+      public DomElement getInvocationElement() {
+        return domElement;
+      }
+    };
+  }
+
+  public final XmlTag getTag() {
+    return getInvocationElement().getXmlTag();
+  }
+
+  @Nullable
+  public XmlElement getXmlElement() {
+    return getInvocationElement().getXmlElement();
+  }
+
+  @NotNull
+  public final XmlFile getFile() {
+    return DomUtil.getFile(getInvocationElement());
+  }
+
+  public Module getModule() {
+    final DomFileElement<DomElement> fileElement = DomUtil.getFileElement(getInvocationElement());
+    if (fileElement == null) {
+      final XmlElement xmlElement = getInvocationElement().getXmlElement();
+      return xmlElement == null? null : ModuleUtil.findModuleForPsiElement(xmlElement);
+    }
+    return fileElement.getRootElement().getModule();
+  }
+
+  public PsiManager getPsiManager() {
+    return getFile().getManager();
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/AbstractDomDeclarationSearcher.java b/xml/dom-openapi/src/com/intellij/util/xml/AbstractDomDeclarationSearcher.java
new file mode 100644
index 0000000..f11d5ad
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/AbstractDomDeclarationSearcher.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.pom.PomDeclarationSearcher;
+import com.intellij.pom.PomTarget;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiLanguageInjectionHost;
+import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.*;
+import com.intellij.util.Consumer;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Eugene Zhuravlev
+ *         Date: Jun 23, 2010
+ */
+public abstract class AbstractDomDeclarationSearcher extends PomDeclarationSearcher {
+
+  public void findDeclarationsAt(@NotNull PsiElement psiElement, int offsetInElement, Consumer<PomTarget> consumer) {
+    if (!(psiElement instanceof XmlToken)) return;
+
+    final IElementType tokenType = ((XmlToken)psiElement).getTokenType();
+
+    final DomManager domManager = DomManager.getDomManager(psiElement.getProject());
+    final DomElement nameElement;
+    if (tokenType == XmlTokenType.XML_DATA_CHARACTERS && psiElement.getParent() instanceof XmlText && psiElement.getParent().getParent() instanceof XmlTag) {
+      final XmlTag tag = (XmlTag)psiElement.getParent().getParent();
+      for (XmlText text : tag.getValue().getTextElements()) {
+        if (InjectedLanguageUtil.hasInjections((PsiLanguageInjectionHost)text)) {
+          return;
+        }
+      }
+
+      nameElement = domManager.getDomElement(tag);
+    } else if (tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN && psiElement.getParent() instanceof XmlAttributeValue && psiElement.getParent().getParent() instanceof XmlAttribute) {
+      final PsiElement attributeValue = psiElement.getParent();
+      if (InjectedLanguageUtil.hasInjections((PsiLanguageInjectionHost)attributeValue)) {
+        return;
+      }
+      nameElement = domManager.getDomElement((XmlAttribute)attributeValue.getParent());
+    } else {
+      return;
+    }
+
+    if (!(nameElement instanceof GenericDomValue)) {
+      return;
+    }
+
+    DomElement parent = nameElement.getParent();
+    if (parent == null) {
+      return;
+    }
+
+    final DomTarget target = createDomTarget(parent, nameElement);
+    if (target != null) {
+      consumer.consume(target);
+    }
+  }
+
+  @Nullable
+  protected abstract DomTarget createDomTarget(DomElement parent, DomElement nameElement);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/AnnotatedElement.java b/xml/dom-openapi/src/com/intellij/util/xml/AnnotatedElement.java
new file mode 100644
index 0000000..8892817
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/AnnotatedElement.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.annotation.Annotation;
+
+/**
+ * @author peter
+ */
+public interface AnnotatedElement {
+
+  @Nullable
+    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/Attribute.java b/xml/dom-openapi/src/com/intellij/util/xml/Attribute.java
new file mode 100644
index 0000000..6e4cf60
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/Attribute.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * Annotates DOM attribute children getters, that should return {@link com.intellij.util.xml.GenericAttributeValue}.
+ * The getters may be annotated with {@link com.intellij.util.xml.Convert()} annotation.
+ *
+ * @author peter
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface Attribute {
+  /**
+   * @return XML attribute name if it can't be inferred from the getter name (see {@link com.intellij.util.xml.NameStrategy()})
+   */
+  String value() default "";
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/Convert.java b/xml/dom-openapi/src/com/intellij/util/xml/Convert.java
new file mode 100644
index 0000000..1b7e1e7
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/Convert.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * All DOM methods that return something nontrivial, not String, Integer, Boolean, PsiClass, PsiType, or {@link com.intellij.util.xml.GenericValue}
+ * parameterized with all these elements, should be annotated with this annotation. The {@link #value()} parameter should
+ * specify {@link com.intellij.util.xml.Converter} class able to convert this custom type to and from {@link String}.
+ * Also DOM interfaces can be annotated, which will mean that all tag value methods inside will have the specified converter. 
+ *
+ * @author peter
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD, ElementType.TYPE})
+public @interface Convert {
+  /**
+   * @return Converter class
+   */
+  Class<? extends Converter> value();
+
+  /**
+   * @return whether the corresponding XML reference to be soft. Soft references are not highlighted as errors, if unresolved.
+   */
+  boolean soft() default false;
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ConvertContext.java b/xml/dom-openapi/src/com/intellij/util/xml/ConvertContext.java
new file mode 100644
index 0000000..2ee1b01
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ConvertContext.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public abstract class ConvertContext {
+
+  @NotNull
+  public abstract DomElement getInvocationElement();
+
+  @Nullable
+  public abstract XmlTag getTag();
+
+  @Nullable
+  public abstract XmlElement getXmlElement();
+
+  @Nullable
+  public XmlElement getReferenceXmlElement() {
+    final XmlElement element = getXmlElement();
+    if (element instanceof XmlTag) {
+      return element;
+    }
+    if (element instanceof XmlAttribute) {
+      return ((XmlAttribute)element).getValueElement();
+    }
+    return null;
+  }
+
+  @NotNull
+  public abstract XmlFile getFile();
+
+  @Nullable
+  public abstract Module getModule();
+  
+  public abstract PsiManager getPsiManager();
+
+  public Project getProject() {
+    return getPsiManager().getProject();
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/Converter.java b/xml/dom-openapi/src/com/intellij/util/xml/Converter.java
new file mode 100644
index 0000000..48a02fc
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/Converter.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.codeInsight.CodeInsightBundle;
+import com.intellij.ide.IdeBundle;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Base DOM class to convert objects of a definite type into {@link String} and back. Most often used with
+ * {@link com.intellij.util.xml.Convert} annotation with methods returning {@link com.intellij.util.xml.GenericDomValue}&lt;T&gt;.
+ *
+ * @see com.intellij.util.xml.ResolvingConverter
+ * @see com.intellij.util.xml.CustomReferenceConverter
+ *
+ * @param <T> Type to convert from/to.
+ *
+ * @author peter
+ */
+public abstract class Converter<T> {
+  @Nullable
+  public abstract T fromString(@Nullable @NonNls String s, final ConvertContext context);
+  @Nullable
+  public abstract String toString(@Nullable T t, final ConvertContext context);
+
+  /**
+   * @param s string value that couldn't be resolved
+   * @param context context
+   * @return error message used to highlight the errors somewhere in the UI, most often - like unresolved references in XML
+   */
+  @Nullable
+  public String getErrorMessage(@Nullable String s, final ConvertContext context) {
+    return CodeInsightBundle.message("error.cannot.convert.default.message", s);
+  }
+
+
+  /**
+   * @deprecated {@link com.intellij.util.xml.converters.values.NumberValueConverter}
+   */
+  @Deprecated
+  public static final Converter<Integer> INTEGER_CONVERTER = new Converter<Integer>() {
+    public Integer fromString(final String s, final ConvertContext context) {
+      if (s == null) return null;
+      try {
+        return Integer.decode(s);
+      }
+      catch (Exception e) {
+        return null;
+      }
+    }
+
+    public String toString(final Integer t, final ConvertContext context) {
+      return t == null? null: t.toString();
+    }
+
+    public String getErrorMessage(final String s, final ConvertContext context) {
+      return IdeBundle.message("value.should.be.integer");
+    }
+  };
+
+  @Deprecated
+  public static final Converter<String> EMPTY_CONVERTER = new Converter<String>() {
+    public String fromString(final String s, final ConvertContext context) {
+      return s;
+    }
+
+    public String toString(final String t, final ConvertContext context) {
+      return t;
+    }
+
+  };
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ConverterManager.java b/xml/dom-openapi/src/com/intellij/util/xml/ConverterManager.java
new file mode 100644
index 0000000..d7eccd6
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ConverterManager.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Dmitry Avdeev
+ * @see com.intellij.util.xml.DomManager#getConverterManager()
+ */
+public interface ConverterManager {
+
+  void addConverter(Class clazz, Converter converter);
+
+  @NotNull
+  Converter getConverterInstance(Class<? extends Converter> converterClass);
+
+  @Nullable
+  Converter getConverterByClass(Class<?> convertingClass);
+
+  /**
+   * Registers the given {@link Converter} implementation at runtime.
+   *
+   * @param converterInterface Interface defined in {@link DomElement} definition.
+   * @param converterImpl      Implementation to use.
+   * @deprecated use com.intellij.dom.converter extension instead
+   */
+  <T extends Converter> void registerConverterImplementation(Class<T> converterInterface, T converterImpl);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/CustomChildren.java b/xml/dom-openapi/src/com/intellij/util/xml/CustomChildren.java
new file mode 100644
index 0000000..b0c46a0
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/CustomChildren.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * Annotates a collection children getter, which should return parameterized {@link java.util.Collection} or {@link java.util.List}. The returned elements
+ * are those who don't belong to any of the usual collection children (see {@link com.intellij.util.xml.SubTagList}).
+ *
+ * @author peter
+ */
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface CustomChildren {
+}
\ No newline at end of file
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/CustomReferenceConverter.java b/xml/dom-openapi/src/com/intellij/util/xml/CustomReferenceConverter.java
new file mode 100644
index 0000000..096fdad
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/CustomReferenceConverter.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Can be implemented by {@link com.intellij.util.xml.Converter} instance, or used with
+ * {@link @com.intellij.util.xml.Referencing} annotation.
+ *
+ * @author peter
+ */
+public interface CustomReferenceConverter<T> {
+
+  /**
+   * Will be called on creating {@link com.intellij.psi.PsiReference}s for {@link com.intellij.util.xml.GenericDomValue}
+   * Returned {@link com.intellij.psi.PsiReference}s should be soft ({@link com.intellij.psi.PsiReference#isSoft()} should return <code>true</code>).
+   * To highlight unresolved references, create a {@link com.intellij.util.xml.highlighting.DomElementsInspection} and register it.
+   *
+   * @param value GenericDomValue in question
+   * @param element corresponding PSI element
+   * @param context {@link com.intellij.util.xml.ConvertContext}
+   * @return custom {@link com.intellij.psi.PsiReference}s for the value
+   */
+  @NotNull
+  PsiReference[] createReferences(GenericDomValue<T> value, PsiElement element, ConvertContext context);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DefinesXml.java b/xml/dom-openapi/src/com/intellij/util/xml/DefinesXml.java
new file mode 100644
index 0000000..c1d087e
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DefinesXml.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * @author mike
+ */
+@Retention(RetentionPolicy.RUNTIME)
+public @interface DefinesXml {
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/Documentation.java b/xml/dom-openapi/src/com/intellij/util/xml/Documentation.java
new file mode 100644
index 0000000..20e48ec
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/Documentation.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Marks a {@link GenericValue} getter as documentation text source.
+ * Element interface should be annotated with {@link com.intellij.ide.presentation.Presentation}
+ *
+ * @author Dmitry Avdeev
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD, ElementType.TYPE})
+public @interface Documentation {
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomAnchor.java b/xml/dom-openapi/src/com/intellij/util/xml/DomAnchor.java
new file mode 100644
index 0000000..bb288b6
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomAnchor.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.xml.util.PsiElementPointer;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Gregory.Shrago
+ * @see DomService#createAnchor(DomElement)
+ */
+public interface DomAnchor<T extends DomElement> extends PsiElementPointer {
+
+  @Nullable
+  T retrieveDomElement();
+
+  @NotNull
+  XmlFile getContainingFile();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomBundle.java b/xml/dom-openapi/src/com/intellij/util/xml/DomBundle.java
new file mode 100644
index 0000000..b1379dc
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomBundle.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+import com.intellij.CommonBundle;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.PropertyKey;
+
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
+import java.util.ResourceBundle;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class DomBundle {
+  private static Reference<ResourceBundle> ourBundle;
+
+  @NonNls protected static final String PATH_TO_BUNDLE = "messages.DomBundle";
+
+  private DomBundle() {
+  }
+
+  public static String message(@PropertyKey(resourceBundle = "messages.DomBundle")String key, Object... params) {
+    return CommonBundle.message(getBundle(), key, params);
+  }
+
+  private static ResourceBundle getBundle() {
+    ResourceBundle bundle = null;
+    if (ourBundle != null) bundle = ourBundle.get();
+    if (bundle == null) {
+      bundle = ResourceBundle.getBundle(PATH_TO_BUNDLE);
+      ourBundle = new SoftReference<ResourceBundle>(bundle);
+    }
+    return bundle;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomChangeAdapter.java b/xml/dom-openapi/src/com/intellij/util/xml/DomChangeAdapter.java
new file mode 100644
index 0000000..bd2fb57
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomChangeAdapter.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.util.xml.events.*;
+
+/**
+ * @author peter
+ */
+public abstract class DomChangeAdapter implements DomEventListener {
+
+  protected abstract void elementChanged(DomElement element);
+
+  @Override
+  public void eventOccured(DomEvent event) {
+    elementChanged(event.getElement());
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomElement.java b/xml/dom-openapi/src/com/intellij/util/xml/DomElement.java
new file mode 100644
index 0000000..4e86444
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomElement.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.util.UserDataHolder;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import com.intellij.util.xml.reflect.DomGenericInfo;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.Type;
+
+/**
+ * Base interface for DOM elements. Every DOM interface should extend this one.
+ *
+ * @author peter
+ */
+public interface DomElement extends AnnotatedElement, UserDataHolder {
+  DomElement[] EMPTY_ARRAY = new DomElement[0];
+
+  XmlTag getXmlTag();
+
+  /**
+   * Returns the underlying XML element/file.
+   *
+   * @return {@link com.intellij.psi.xml.XmlFile}, {@link com.intellij.psi.xml.XmlTag} or {@link com.intellij.psi.xml.XmlAttribute}
+   */
+  @Nullable
+  XmlElement getXmlElement();
+
+  DomElement getParent();
+
+  XmlTag ensureTagExists();
+
+  XmlElement ensureXmlElementExists();
+
+  /**
+   * Removes all corresponding XML content. In case of being collection member, invalidates the element.
+   */
+  void undefine();
+
+  boolean isValid();
+
+  /**
+   * @return true if corresponding XML element exists
+   */
+  boolean exists();
+
+  @NotNull
+  DomGenericInfo getGenericInfo();
+
+  @NotNull @NonNls String getXmlElementName();
+
+  @NotNull @NonNls String getXmlElementNamespace();
+
+  /**
+   * @return namespace key if this element or one of its ancestors is annotated with
+   * {@link Namespace}, or null otherwise, which means that namespace should be equal
+   * to that of the element's parent
+   */
+  @Nullable @NonNls String getXmlElementNamespaceKey();
+
+  void accept(final DomElementVisitor visitor);
+
+  void acceptChildren(DomElementVisitor visitor);
+
+  @NotNull
+  DomManager getManager();
+
+  @NotNull
+  Type getDomElementType();
+
+  AbstractDomChildrenDescription getChildDescription();
+
+  @NotNull
+  DomNameStrategy getNameStrategy();
+
+  @NotNull
+  ElementPresentation getPresentation();
+
+  GlobalSearchScope getResolveScope();
+
+  /**
+   * Walk up the DOM tree searching for element of requiredClass type
+   * @param requiredClass parent element's type
+   * @param strict
+   * <ul>
+   * <li>strict = false: if the current element is already of the correct type, then it is returned.</li>
+   * <li>strict = true: the returned element must be higher in the hierarchy.</li>
+   * </ul> 
+   * @return the parent of requiredClass type
+   */
+  @Nullable
+  <T extends DomElement> T getParentOfType(Class<T> requiredClass, boolean strict);
+
+  @Nullable
+  Module getModule();
+
+  void copyFrom(DomElement other);
+
+  <T extends DomElement> T createMockCopy(final boolean physical);
+
+  /**
+   * @return stable element (see {@link DomManager#createStableValue(com.intellij.openapi.util.Factory)}}),
+   * that holds the complete 'XPath' to this element in XML. If this element is in collection, and something
+   * is inserted before it, the stable copy behaviour may be unexpected. So use this method only when you
+   * are sure that nothing serious will happen during the lifetime of the stable copy. The most usual use
+   * case is when one creates something inside {@link com.intellij.openapi.command.WriteCommandAction} and
+   * wants to use it outside the action. Due to formatting done on the command finish the element may become
+   * invalidated, but the stable copy will survive, because nothing in fact has changed in its 'XPath'.
+   */
+  <T extends DomElement> T createStableCopy();
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomElementNavigationProvider.java b/xml/dom-openapi/src/com/intellij/util/xml/DomElementNavigationProvider.java
new file mode 100644
index 0000000..c6d291f
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomElementNavigationProvider.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public abstract class DomElementNavigationProvider {
+  public abstract String getProviderName();
+
+  public abstract void navigate(DomElement domElement, boolean requestFocus);
+
+  public abstract boolean canNavigate(DomElement domElement);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomElementVisitor.java b/xml/dom-openapi/src/com/intellij/util/xml/DomElementVisitor.java
new file mode 100644
index 0000000..4063a86
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomElementVisitor.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+/**
+ * Visitor is a very common design pattern. DOM model also has a visitor and it's called
+ * DomElementVisitor. The {@link DomElement} interface has methods {@link DomElement#accept(DomElementVisitor)}
+ * and {@link DomElement#acceptChildren(DomElementVisitor)}
+ * taking this visitor as a parameter. 
+ * <p>
+ * DomElementVisitor has only one method: {@link #visitDomElement(DomElement)}.
+ * Where is the Visitor pattern? Where are all those methods with names like <code>visitT(T)</code> that
+ * are usually found in it? There are no such methods, because the actual interfaces (<code>T</code>'s)
+ * aren't known to anyone except you. But when you instantiate the DomElementVisitor
+ * interface, you may add your own <code>visitT()</code> methods and they will be called! You may
+ * even name them just <code>visit()</code>, specify the type of the parameter and everything will be
+ * fine. 
+ * <p>
+ * For example, if you have two DOM element classes - <code>Foo</code> and <code>Bar</code>- your visitor
+ * may look like this:
+ * <pre>
+ *  class MyVisitor implements DomElementVisitor {
+ *    void visitDomElement(DomElement element) {}
+ *    void visitFoo(Foo foo) {}
+ *    void visitBar(Bar bar) {}
+ *  }
+ * </pre>
+ * @author peter
+ */
+public interface DomElementVisitor {
+  void visitDomElement(DomElement element);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomElementsNavigationManager.java b/xml/dom-openapi/src/com/intellij/util/xml/DomElementsNavigationManager.java
new file mode 100644
index 0000000..84952da
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomElementsNavigationManager.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.project.Project;
+
+import java.util.Set;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public abstract class DomElementsNavigationManager {
+  public static String DEFAULT_PROVIDER_NAME = "DEFAULT_PROVIDER_NAME";
+
+  public static DomElementsNavigationManager getManager(Project project) {
+    return ServiceManager.getService(project, DomElementsNavigationManager.class);
+  }
+
+  public abstract Set<DomElementNavigationProvider> getDomElementsNavigateProviders(DomElement domElement);
+
+  public abstract DomElementNavigationProvider getDomElementsNavigateProvider(String providerName);
+
+  public abstract void registerDomElementsNavigateProvider(DomElementNavigationProvider provider);
+
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomEventAdapter.java b/xml/dom-openapi/src/com/intellij/util/xml/DomEventAdapter.java
new file mode 100644
index 0000000..4935964
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomEventAdapter.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+/**
+ * @author peter
+ */
+@Deprecated
+public abstract class DomEventAdapter implements DomEventListener {
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomEventListener.java b/xml/dom-openapi/src/com/intellij/util/xml/DomEventListener.java
new file mode 100644
index 0000000..d6c8d3f
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.util.xml.events.*;
+
+import java.util.EventListener;
+
+/**
+ * @author peter
+ */
+public interface DomEventListener extends EventListener {
+
+  void eventOccured(DomEvent event);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomEventVisitor.java b/xml/dom-openapi/src/com/intellij/util/xml/DomEventVisitor.java
new file mode 100644
index 0000000..ac0970f
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomEventVisitor.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.util.xml.events.*;
+
+/**
+ * @author peter
+ */
+public interface DomEventVisitor {
+
+  void visitElementDefined(final DomEvent event);
+
+  void visitElementChangedEvent(final DomEvent event);
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomFileDescription.java b/xml/dom-openapi/src/com/intellij/util/xml/DomFileDescription.java
new file mode 100644
index 0000000..74dc6a8
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomFileDescription.java
@@ -0,0 +1,271 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.util.Iconable;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ConstantFunction;
+import com.intellij.util.NotNullFunction;
+import com.intellij.util.SmartList;
+import com.intellij.util.containers.ConcurrentHashMap;
+import com.intellij.util.containers.ConcurrentInstanceMap;
+import com.intellij.util.xml.highlighting.DomElementsAnnotator;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.lang.reflect.Type;
+import java.util.*;
+
+/**
+ * @author peter
+ *
+ * @see com.intellij.util.xml.MergingFileDescription
+ */
+public class DomFileDescription<T> {
+  public static final ExtensionPointName<DomFileDescription> EP_NAME = ExtensionPointName.create("com.intellij.dom.fileDescription");
+
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.DomFileDescription");
+  private final ConcurrentInstanceMap<ScopeProvider> myScopeProviders = new ConcurrentInstanceMap<ScopeProvider>();
+  protected final Class<T> myRootElementClass;
+  protected final String myRootTagName;
+  private final String[] myAllPossibleRootTagNamespaces;
+  private volatile boolean myInitialized;
+  private final Map<Class<? extends DomElement>,Class<? extends DomElement>> myImplementations = new HashMap<Class<? extends DomElement>, Class<? extends DomElement>>();
+  private final TypeChooserManager myTypeChooserManager = new TypeChooserManager();
+  private final List<DomReferenceInjector> myInjectors = new SmartList<DomReferenceInjector>();
+  private final Map<String, NotNullFunction<XmlTag,List<String>>> myNamespacePolicies = new ConcurrentHashMap<String, NotNullFunction<XmlTag, List<String>>>();
+
+  public DomFileDescription(final Class<T> rootElementClass, @NonNls final String rootTagName, @NonNls final String... allPossibleRootTagNamespaces) {
+    myRootElementClass = rootElementClass;
+    myRootTagName = rootTagName;
+    myAllPossibleRootTagNamespaces = allPossibleRootTagNamespaces;
+  }
+
+  public String[] getAllPossibleRootTagNamespaces() {
+    return myAllPossibleRootTagNamespaces;
+  }
+
+  /**
+   * Register an implementation class to provide additional functionality for DOM elements.
+   *
+   * @param domElementClass interface class.
+   * @param implementationClass abstract implementation class.
+   *
+   * @deprecated use dom.implementation extension point instead
+   * @see #initializeFileDescription()
+   */
+  public final <T extends DomElement> void registerImplementation(Class<T> domElementClass, Class<? extends T> implementationClass) {
+    myImplementations.put(domElementClass, implementationClass);
+  }
+
+  /**
+   * @param namespaceKey namespace identifier
+   * @see com.intellij.util.xml.Namespace
+   * @param policy function that takes XML file root tag and returns (maybe empty) list of possible namespace URLs or DTD public ids. This
+   * function shouldn't use DOM since it may be not initialized for the file at the moment
+   * @deprecated use {@link #registerNamespacePolicy(String, String...)} or override {@link #getAllowedNamespaces(String, com.intellij.psi.xml.XmlFile)} instead
+   */
+  protected final void registerNamespacePolicy(String namespaceKey, NotNullFunction<XmlTag,List<String>> policy) {
+    myNamespacePolicies.put(namespaceKey, policy);
+  }
+
+  /**
+   * @param namespaceKey namespace identifier
+   * @see com.intellij.util.xml.Namespace
+   * @param namespaces XML namespace or DTD public or system id value for the given namespaceKey
+   */
+  public final void registerNamespacePolicy(String namespaceKey, final String... namespaces) {
+    registerNamespacePolicy(namespaceKey, new ConstantFunction<XmlTag, List<String>>(Arrays.asList(namespaces)));
+  }
+
+  /**
+   * Consider using {@link DomService#getXmlFileHeader(com.intellij.psi.xml.XmlFile)} when implementing this.
+   */
+  @SuppressWarnings({"MethodMayBeStatic"})
+  @NotNull
+  public List<String> getAllowedNamespaces(@NotNull String namespaceKey, @NotNull XmlFile file) {
+    final NotNullFunction<XmlTag, List<String>> function = myNamespacePolicies.get(namespaceKey);
+    if (function instanceof ConstantFunction) {
+      return function.fun(null);
+    }
+
+    if (function != null) {
+      final XmlDocument document = file.getDocument();
+      if (document != null) {
+        final XmlTag tag = document.getRootTag();
+        if (tag != null) {
+          return function.fun(tag);
+        }
+      }
+    } else {
+      return Collections.singletonList(namespaceKey);
+    }
+    return Collections.emptyList();
+  }
+
+  /**
+   * @return some version. Override and change (e.g. <code>super.getVersion()+1</code>) when after some changes some files stopped being
+   * described by this description or vice versa, so that the
+   * {@link com.intellij.util.xml.DomService#getDomFileCandidates(Class, com.intellij.openapi.project.Project)} index is rebuilt correctly.
+   */
+  public int getVersion() {
+    return myRootTagName.hashCode();
+  }
+
+  protected final void registerTypeChooser(final Type aClass, final TypeChooser typeChooser) {
+    myTypeChooserManager.registerTypeChooser(aClass, typeChooser);
+  }
+
+  public final TypeChooserManager getTypeChooserManager() {
+    return myTypeChooserManager;
+  }
+
+  protected final void registerReferenceInjector(DomReferenceInjector injector) {
+    myInjectors.add(injector);
+  }
+
+  public List<DomReferenceInjector> getReferenceInjectors() {
+    return myInjectors;
+  }
+
+  public boolean isAutomaticHighlightingEnabled() {
+    return true;
+  }
+
+  @Nullable
+  public Icon getFileIcon(@Iconable.IconFlags int flags) {
+    return null;
+  }
+
+  /**
+   * The right place to call
+   * {@link #registerNamespacePolicy(String, String...)}
+   * and {@link #registerTypeChooser(java.lang.reflect.Type, TypeChooser)}.
+   */
+  protected void initializeFileDescription() {}
+
+  /**
+   * Create custom DOM annotator that will be used when error-highlighting DOM. The results will be collected to
+   * {@link com.intellij.util.xml.highlighting.DomElementsProblemsHolder}. The highlighting will be most probably done in an
+   * {@link com.intellij.util.xml.highlighting.BasicDomElementsInspection} instance.
+   * @return Annotator or null
+   */
+  @Nullable
+  public DomElementsAnnotator createAnnotator() {
+    return null;
+  }
+
+  public final Map<Class<? extends DomElement>,Class<? extends DomElement>> getImplementations() {
+    if (!myInitialized) {
+      initializeFileDescription();
+      myInitialized = true;
+    }
+    return myImplementations;
+  }
+
+  @NotNull
+  public final Class<T> getRootElementClass() {
+    return myRootElementClass;
+  }
+
+  public final String getRootTagName() {
+    return myRootTagName;
+  }
+
+  public boolean isMyFile(@NotNull XmlFile file, @Nullable final Module module) {
+    final Namespace namespace = DomReflectionUtil.findAnnotationDFS(myRootElementClass, Namespace.class);
+    if (namespace != null) {
+      final String key = namespace.value();
+      Set<String> allNs = new HashSet<String>(getAllowedNamespaces(key, file));
+      if (allNs.isEmpty()) {
+        return false;
+      }
+
+      XmlFileHeader header = DomService.getInstance().getXmlFileHeader(file);
+      return allNs.contains(header.getPublicId()) || allNs.contains(header.getSystemId()) || allNs.contains(header.getRootTagNamespace());
+    }
+
+    return true;
+  }
+
+  public boolean acceptsOtherRootTagNames() {
+    return false;
+  }
+
+  /**
+   * Get dependency items (the same, as in {@link com.intellij.psi.util.CachedValue}) for file. On any dependency item change, the
+   * {@link #isMyFile(com.intellij.psi.xml.XmlFile, Module)} method will be invoked once more to ensure that the file description still
+   * accepts this file 
+   * @param file XML file to get dependencies of
+   * @return dependency item set 
+   */
+  @NotNull
+  public Set<? extends Object> getDependencyItems(XmlFile file) {
+    return Collections.emptySet();
+  }
+
+  /**
+   * @param reference DOM reference
+   * @return element, whose all children will be searched for declaration
+   */
+  @NotNull
+  public DomElement getResolveScope(GenericDomValue<?> reference) {
+    final DomElement annotation = getScopeFromAnnotation(reference);
+    if (annotation != null) return annotation;
+
+    return DomUtil.getRoot(reference);
+  }
+
+  /**
+   * @param element DOM element
+   * @return element, whose direct children names will be compared by name. Basically it's parameter element's parent (see {@link ParentScopeProvider}).
+   */
+  @NotNull
+  public DomElement getIdentityScope(DomElement element) {
+    final DomElement annotation = getScopeFromAnnotation(element);
+    if (annotation != null) return annotation;
+
+    return element.getParent();
+  }
+
+  @Nullable
+  protected final DomElement getScopeFromAnnotation(final DomElement element) {
+    final Scope scope = element.getAnnotation(Scope.class);
+    if (scope != null) {
+      return myScopeProviders.get(scope.value()).getScope(element);
+    }
+    return null;
+  }
+
+  /**
+   * @see Stubbed
+   * @return false
+   */
+  public boolean hasStubs() {
+    return false;
+  }
+
+  public int getStubVersion() {
+    return 0;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomFileElement.java b/xml/dom-openapi/src/com/intellij/util/xml/DomFileElement.java
new file mode 100644
index 0000000..8697221
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomFileElement.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.util.ModificationTracker;
+import com.intellij.openapi.util.UserDataHolder;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public interface DomFileElement<T extends DomElement> extends DomElement, UserDataHolder, ModificationTracker {
+  @NotNull
+  XmlFile getFile();
+
+  @NotNull
+  XmlFile getOriginalFile();
+
+  @Nullable
+  XmlTag getRootTag();
+
+  @NotNull
+  T getRootElement();
+
+  @NotNull
+  Class<T> getRootElementClass();
+
+  @NotNull
+  DomFileDescription<T> getFileDescription();
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomIconProvider.java b/xml/dom-openapi/src/com/intellij/util/xml/DomIconProvider.java
new file mode 100644
index 0000000..fd47a61b
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomIconProvider.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.pom.PomIconProvider;
+import com.intellij.pom.PomTarget;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+
+/**
+ * @author peter
+ * @deprecated
+ * @see com.intellij.ide.presentation.Presentation
+ */
+public abstract class DomIconProvider extends PomIconProvider {
+  public Icon getIcon(@NotNull PomTarget target, int flags) {
+    if (target instanceof DomTarget) {
+      return getIcon(((DomTarget)target).getDomElement(), flags);
+    }
+    return null;
+  }
+
+  @Nullable
+  public abstract Icon getIcon(@NotNull DomElement element, int flags);
+}
\ No newline at end of file
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomManager.java b/xml/dom-openapi/src/com/intellij/util/xml/DomManager.java
new file mode 100644
index 0000000..01bc1d8
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomManager.java
@@ -0,0 +1,174 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.*;
+import com.intellij.psi.PsiReferenceFactory;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import com.intellij.util.xml.reflect.DomGenericInfo;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.Type;
+
+/**
+ * @author peter
+ */
+public abstract class DomManager implements ModificationTracker {
+  public static final Key<Module> MOCK_ELEMENT_MODULE = Key.create("MockElementModule");
+
+  private final static NotNullLazyKey<DomManager, Project> INSTANCE_CACHE = ServiceManager.createLazyKey(DomManager.class);
+
+  public static DomManager getDomManager(Project project) {
+    return INSTANCE_CACHE.getValue(project);
+  }
+
+  public abstract Project getProject();
+
+  /**
+   * @param file XML file
+   * @param domClass desired DOM element class 
+   * @return New or cached DOM file element for the given file. All registered {@link com.intellij.util.xml.DomFileDescription}s are
+   * asked if they are responsible for the file {@link com.intellij.util.xml.DomFileDescription#isMyFile(com.intellij.psi.xml.XmlFile, com.intellij.openapi.module.Module)}.
+   * If there is a {@link com.intellij.util.xml.DomFileDescription} that is responsible for the file, but its {@link DomFileDescription#getRootElementClass()}
+   * result is incompatible with domClass parameter, null is returned
+   */
+  @Nullable
+  public abstract <T extends DomElement> DomFileElement<T> getFileElement(XmlFile file, Class<T> domClass);
+
+  @Nullable
+  @Deprecated
+  /**
+   * @deprecated use {@link #getFileElement(XmlFile, Class)}
+   */
+  public abstract <T extends DomElement> DomFileElement<T> getFileElement(XmlFile file);
+
+  @NotNull
+  @Deprecated
+  /**
+   * @deprecated use {@link #getFileElement(XmlFile, Class)}
+   */
+  public abstract <T extends DomElement> DomFileElement<T> getFileElement(XmlFile file, Class<T> aClass, @NonNls String rootTagName);
+
+  public abstract void addDomEventListener(DomEventListener listener, Disposable parentDisposable);
+
+  /**
+   * @param type Type. Only {@link Class} and {@link java.lang.reflect.ParameterizedType} are allowed
+   * @return {@link com.intellij.util.xml.reflect.DomGenericInfo} instance for the desired type
+   */
+  public abstract DomGenericInfo getGenericInfo(Type type);
+
+  /**
+   * @param element tag
+   * @return DOM element for the given tag. If DOM isn't initialized for the containing file, it will be initialized
+   */
+  @Nullable
+  public abstract DomElement getDomElement(@Nullable final XmlTag element);
+
+  /**
+   * @param element attribute
+   * @return DOM element for the given XML attribute. If DOM isn't initialized for the containing file, it will be initialized
+   */
+  @Nullable
+  public abstract GenericAttributeValue getDomElement(final XmlAttribute element);
+
+  /**
+   * @param aClass Desired DOM element class
+   * @param module One may wish the result to think that it is in a particular module
+   * @param physical see {@link com.intellij.psi.PsiFile#isPhysical()}
+   * @return DOM element which doesn't have any real file under itself. A mock file is created for it. See
+   * {@link com.intellij.psi.PsiFileFactory#createFileFromText(String, com.intellij.openapi.fileTypes.FileType, CharSequence, long, boolean, boolean)}
+   */
+  public abstract <T extends DomElement> T createMockElement(Class<T> aClass, final Module module, final boolean physical);
+
+  /**
+   * @param element DOM element
+   * @return true if this element was created by {@link #createMockElement(Class, com.intellij.openapi.module.Module, boolean)} method
+   */
+  public abstract boolean isMockElement(DomElement element);
+
+  /**
+   * Creates DOM element of needed type, that is wrapper around real DOM element. Once the wrapped element
+   * becomes invalid, a new value is requested from provider parameter, so there's a possibility to
+   * restore the functionality. The resulting element will also implement StableElement interface.
+   *
+   * @param provider provides values to be wrapped
+   * @return stable DOM element
+   */
+  public abstract <T extends DomElement> T createStableValue(Factory<T> provider);
+
+  public abstract <T> T createStableValue(final Factory<T> provider, final Condition<T> validator);
+
+  /**
+   * Registers a new {@link com.intellij.util.xml.DomFileDescription} within the manager. The description parameter describes some DOM
+   * parameters and restrictions to the particular XML files, that need DOM support. Should be called on
+   * {@link com.intellij.openapi.components.ProjectComponent} loading.
+   * @param description The description in question
+   * @deprecated Make your file description an extension (see {@link com.intellij.util.xml.DomFileDescription#EP_NAME})
+   */
+  public abstract void registerFileDescription(DomFileDescription description);
+
+  /**
+   * @return {@link com.intellij.util.xml.ConverterManager} instance
+   * @deprecated This will be moved at the application level
+   */
+  public abstract ConverterManager getConverterManager();
+
+  @Deprecated
+  public abstract void addPsiReferenceFactoryForClass(Class clazz, PsiReferenceFactory psiReferenceFactory);
+
+  public abstract ModelMerger createModelMerger();
+
+
+  /**
+   * @param element reference element
+   * @return element that represents the resolve scope for the given reference. {@link com.intellij.util.xml.DomResolveConverter} uses
+   * this method to resolve DOM references. This result's subtree will be traversed recursively searching for the reference target. See
+   * {@link com.intellij.util.xml.Resolve} annotation.
+   */
+  @NotNull
+  public abstract DomElement getResolvingScope(GenericDomValue element);
+
+  /**
+   * @param element Named DOM element
+   * @return The scope within which the element's name identity will be checked by
+   * {@link com.intellij.util.xml.highlighting.DomHighlightingHelper#checkNameIdentity(DomElement, com.intellij.util.xml.highlighting.DomElementAnnotationHolder)}
+   */
+  @Nullable
+  public abstract DomElement getIdentityScope(DomElement element);
+
+  /**
+   * @return {@link com.intellij.util.xml.TypeChooserManager} instance
+   */
+  public abstract TypeChooserManager getTypeChooserManager();
+
+  @Nullable
+  public abstract AbstractDomChildrenDescription findChildrenDescription(@NotNull XmlTag templateChildTag, @NotNull DomElement parent);
+
+  @Nullable
+  public final DomFileDescription<?> getDomFileDescription(final XmlFile xmlFile) {
+    final DomFileElement<DomElement> element = getFileElement(xmlFile);
+    return element != null ? element.getFileDescription() : null;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomMetaData.java b/xml/dom-openapi/src/com/intellij/util/xml/DomMetaData.java
new file mode 100644
index 0000000..0975c4a
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomMetaData.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.meta.PsiPresentableMetaData;
+import com.intellij.psi.meta.PsiWritableMetaData;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+
+/**
+ * @author peter
+ */
+public class DomMetaData<T extends DomElement> implements PsiWritableMetaData, PsiPresentableMetaData, PsiMetaData {
+  private T myElement;
+  @Nullable
+  private GenericDomValue myNameElement;
+
+  public final PsiElement getDeclaration() {
+    return myElement.getXmlTag();
+  }
+
+  public T getElement() {
+    return myElement;
+  }
+
+  @NonNls
+  public String getName(PsiElement context) {
+    return getName();
+  }
+
+  @NonNls
+  public final String getName() {
+    final String s = ElementPresentationManager.getElementName(myElement);
+    if (s != null) return s;
+
+    final GenericDomValue value = getNameElement(myElement);
+    return value == null ? null : value.getStringValue();
+  }
+
+  public void init(PsiElement element) {
+    myElement = (T) DomManager.getDomManager(element.getProject()).getDomElement((XmlTag)element);
+    assert myElement != null : element;
+    myNameElement = getNameElement(myElement);
+  }
+
+  public void setElement(final T element) {
+    myElement = element;
+  }
+
+  @Nullable
+  protected GenericDomValue getNameElement(final T t) {
+    return myElement.getGenericInfo().getNameDomElement(t);
+  }
+
+  public Object[] getDependences() {
+    final PsiElement declaration = getDeclaration();
+    if (myElement != null && myElement.isValid()) {
+      return new Object[]{DomUtil.getRoot(myElement), declaration};
+    }
+    return new Object[]{declaration};
+  }
+
+  public void setName(String name) throws IncorrectOperationException {
+    if (myNameElement != null) {
+      myNameElement.setStringValue(name);
+    }
+  }
+
+  public String getTypeName() {
+    return ElementPresentationManager.getTypeNameForObject(myElement);
+  }
+
+  public Icon getIcon() {
+    return ElementPresentationManager.getIcon(myElement);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomNameStrategy.java b/xml/dom-openapi/src/com/intellij/util/xml/DomNameStrategy.java
new file mode 100644
index 0000000..5802b8e
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomNameStrategy.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+/**
+ * Specifies how method names are converted into XML element names
+ *
+ * @author peter
+ */
+public abstract class DomNameStrategy {
+
+  /**
+   * @param propertyName property name, i.e. method name without first 'get', 'set' or 'is'
+   * @return XML element name
+   */
+  public abstract String convertName(String propertyName);
+
+  /**
+   * Is used to get presentable DOM elements in UI  
+   * @param xmlElementName XML element name
+   * @return Presentable DOM element name
+   */
+  public abstract String splitIntoWords(final String xmlElementName);
+
+  /**
+   * This strategy splits property name into words, decapitalizes them and joins using hyphen as separator,
+   * e.g. getXmlElementName() will correspond to xml-element-name
+   */
+  public static final DomNameStrategy HYPHEN_STRATEGY = new HyphenNameStrategy();
+  /**
+   * This strategy decapitalizes property name, e.g. getXmlElementName() will correspond to xmlElementName
+   */
+  public static final DomNameStrategy JAVA_STRATEGY = new JavaNameStrategy();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomReferenceInjector.java b/xml/dom-openapi/src/com/intellij/util/xml/DomReferenceInjector.java
new file mode 100644
index 0000000..a89fdf1
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomReferenceInjector.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public interface DomReferenceInjector {
+  @Nullable String resolveString(@Nullable String unresolvedText, @NotNull ConvertContext context);
+
+  @NotNull PsiReference[] inject(@Nullable String unresolvedText, @NotNull PsiElement element, @NotNull ConvertContext context);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomReflectionUtil.java b/xml/dom-openapi/src/com/intellij/util/xml/DomReflectionUtil.java
new file mode 100644
index 0000000..46563b6
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomReflectionUtil.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.progress.ProcessCanceledException;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.ReflectionUtil;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.*;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class DomReflectionUtil {
+  private DomReflectionUtil() {
+  }
+
+  public static <T extends Annotation> T findAnnotationDFS(final Class<?> rawType, final Class<T> annotationType) {
+    T annotation = rawType.getAnnotation(annotationType);
+    if (annotation != null) return annotation;
+
+    for (Class aClass : rawType.getInterfaces()) {
+      annotation = findAnnotationDFS(aClass, annotationType);
+      if (annotation != null) {
+        return annotation;
+      }
+    }
+    return null;
+  }
+
+  public static boolean canHaveIsPropertyGetterPrefix(final Type type) {
+    return boolean.class.equals(type) || Boolean.class.equals(type)
+           || Boolean.class.equals(DomUtil.getGenericValueParameter(type));
+  }
+
+  public static JavaMethod[] getGetterMethods(final String[] path, final Class<? extends DomElement> startClass) {
+    final JavaMethod[] methods = new JavaMethod[path.length];
+    Class aClass = startClass;
+    for (int i = 0; i < path.length; i++) {
+      final JavaMethod getter = findGetter(aClass, path[i]);
+      assert getter != null : "Couldn't find getter for property " + path[i] + " in class " + aClass;
+      methods[i] = getter;
+      aClass = getter.getReturnType();
+      if (List.class.isAssignableFrom(aClass)) {
+        aClass = ReflectionUtil.getRawType(extractCollectionElementType(getter.getGenericReturnType()));
+      }
+    }
+    return methods;
+  }
+
+  @Nullable
+  public static JavaMethod findGetter(Class aClass, String propertyName) {
+    final String capitalized = StringUtil.capitalize(propertyName);
+    Method method = ReflectionUtil.getMethod(aClass, "get" + capitalized);
+    if (method != null) return JavaMethod.getMethod(aClass, method);
+
+    method = ReflectionUtil.getMethod(aClass, "is" + capitalized);
+    if (method == null) return null;
+
+    final JavaMethod javaMethod = JavaMethod.getMethod(aClass, method);
+    return canHaveIsPropertyGetterPrefix(javaMethod.getGenericReturnType()) ? javaMethod : null;
+  }
+
+  public static Object invokeMethod(final Method method, final Object object, final Object... args) {
+    try {
+      return method.invoke(object, args);
+    }
+    catch (IllegalArgumentException e) {
+      throw new RuntimeException("Calling method " + method + " on object " + object + " with arguments " + Arrays.asList(args), e);
+    }
+    catch (IllegalAccessException e) {
+      throw new RuntimeException(e);
+    }
+    catch (InvocationTargetException e) {
+      final Throwable cause = e.getCause();
+      if (cause instanceof ProcessCanceledException) {
+        throw (ProcessCanceledException)cause;
+      }
+      else if (cause instanceof Error) {
+        throw (Error)cause;
+      }
+      else if (cause instanceof RuntimeException) {
+        throw (RuntimeException) cause;
+      }
+      throw new RuntimeException(e);
+    }
+    catch (ProcessCanceledException e) {
+      throw e;
+    }
+    catch (Throwable throwable) {
+      throw new RuntimeException(throwable);
+    }
+  }
+
+  @Nullable
+  public static Type extractCollectionElementType(Type returnType) {
+    if (returnType instanceof ParameterizedType) {
+      ParameterizedType parameterizedType = (ParameterizedType)returnType;
+      final Type rawType = parameterizedType.getRawType();
+      if (rawType instanceof Class) {
+        final Class<?> rawClass = (Class<?>)rawType;
+        if (List.class.equals(rawClass) || Collection.class.equals(rawClass)) {
+          final Type[] arguments = ReflectionUtil.getActualTypeArguments(parameterizedType);
+          if (arguments.length == 1) {
+            final Type argument = arguments[0];
+            if (argument instanceof WildcardType) {
+              final Type[] upperBounds = ((WildcardType)argument).getUpperBounds();
+              if (upperBounds.length == 1) {
+                return upperBounds[0];
+              }
+            }
+            else if (argument instanceof ParameterizedType) {
+              if (DomUtil.getGenericValueParameter(argument) != null) {
+                return argument;
+              }
+            }
+            else if (argument instanceof Class) {
+              return argument;
+            }
+          }
+        }
+      }
+    }
+    return null;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomResolveConverter.java b/xml/dom-openapi/src/com/intellij/util/xml/DomResolveConverter.java
new file mode 100644
index 0000000..22a59e2
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomResolveConverter.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.codeInsight.CodeInsightBundle;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.ide.TypePresentationService;
+import com.intellij.openapi.project.Project;
+import com.intellij.pom.references.PomService;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.util.PsiModificationTracker;
+import com.intellij.util.containers.ConcurrentFactoryMap;
+import com.intellij.util.containers.FactoryMap;
+import com.intellij.util.containers.SoftFactoryMap;
+import com.intellij.util.xml.highlighting.ResolvingElementQuickFix;
+import gnu.trove.THashMap;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * Converter which resolves {@link com.intellij.util.xml.DomElement}s by name in a defined scope. The scope is taken
+ * from corresponding {@link com.intellij.util.xml.DomFileDescription#getResolveScope(GenericDomValue)}.
+ *
+ * @author peter
+ */
+public class DomResolveConverter<T extends DomElement> extends ResolvingConverter<T>{
+  private static final FactoryMap<Class<? extends DomElement>,DomResolveConverter> ourCache = new ConcurrentFactoryMap<Class<? extends DomElement>, DomResolveConverter>() {
+    @NotNull
+    protected DomResolveConverter create(final Class<? extends DomElement> key) {
+      return new DomResolveConverter(key);
+    }
+  };
+  private final boolean myAttribute;
+  private final SoftFactoryMap<DomElement, CachedValue<Map<String, DomElement>>> myResolveCache = new SoftFactoryMap<DomElement, CachedValue<Map<String, DomElement>>>() {
+    @NotNull
+    protected CachedValue<Map<String, DomElement>> create(final DomElement scope) {
+      final DomManager domManager = scope.getManager();
+      final Project project = domManager.getProject();
+      return CachedValuesManager.getManager(project).createCachedValue(new CachedValueProvider<Map<String, DomElement>>() {
+        public Result<Map<String, DomElement>> compute() {
+          final Map<String, DomElement> map = new THashMap<String, DomElement>();
+          visitDomElement(scope, map);
+          return new Result<Map<String, DomElement>>(map, PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT);
+        }
+
+        private void visitDomElement(DomElement element, final Map<String, DomElement> map) {
+          if (myClass.isInstance(element)) {
+            final String name = ElementPresentationManager.getElementName(element);
+            if (name != null && !map.containsKey(name)) {
+              map.put(name, element);
+            }
+          } else {
+            for (final DomElement child : DomUtil.getDefinedChildren(element, true, myAttribute)) {
+              visitDomElement(child, map);
+            }
+          }
+
+        }
+
+      }, false);
+    }
+  };
+
+  private final Class<T> myClass;
+
+  public DomResolveConverter(final Class<T> aClass) {
+    myClass = aClass;
+    myAttribute = GenericAttributeValue.class.isAssignableFrom(myClass);
+  }
+
+  public static <T extends DomElement> DomResolveConverter<T> createConverter(Class<T> aClass) {
+    return ourCache.get(aClass);
+  }
+
+  public final T fromString(final String s, final ConvertContext context) {
+    if (s == null) return null;
+    return (T) myResolveCache.get(getResolvingScope(context)).getValue().get(s);
+  }
+
+  @Override
+  public PsiElement getPsiElement(@Nullable T resolvedValue) {
+    if (resolvedValue == null) return null;
+    DomTarget target = DomTarget.getTarget(resolvedValue);
+    return target == null ? super.getPsiElement(resolvedValue) : PomService.convertToPsi(target);
+  }
+
+  @Override
+  public boolean isReferenceTo(@NotNull PsiElement element, String stringValue, @Nullable T resolveResult, ConvertContext context) {
+    return resolveResult != null && element.getManager().areElementsEquivalent(element, resolveResult.getXmlElement());
+  }
+
+  private static DomElement getResolvingScope(final ConvertContext context) {
+    final DomElement invocationElement = context.getInvocationElement();
+    return invocationElement.getManager().getResolvingScope((GenericDomValue)invocationElement);
+  }
+
+  public String getErrorMessage(final String s, final ConvertContext context) {
+
+    return CodeInsightBundle.message("error.cannot.resolve.0.1", TypePresentationService.getService().getTypePresentableName(myClass), s);
+  }
+
+  public final String toString(final T t, final ConvertContext context) {
+    if (t == null) return null;
+    return ElementPresentationManager.getElementName(t);
+  }
+
+  @NotNull
+  public Collection<? extends T> getVariants(final ConvertContext context) {
+    final DomElement reference = context.getInvocationElement();
+    final DomElement scope = reference.getManager().getResolvingScope((GenericDomValue)reference);
+    return (Collection<T>)myResolveCache.get(scope).getValue().values();
+  }
+
+  public LocalQuickFix[] getQuickFixes(final ConvertContext context) {
+    final DomElement element = context.getInvocationElement();
+    final GenericDomValue value = ((GenericDomValue)element).createStableCopy();
+    final String newName = value.getStringValue();
+    if (newName == null) return LocalQuickFix.EMPTY_ARRAY;
+    final DomElement scope = value.getManager().getResolvingScope(value);
+    return ResolvingElementQuickFix.createFixes(newName, myClass, scope);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomService.java b/xml/dom-openapi/src/com/intellij/util/xml/DomService.java
new file mode 100644
index 0000000..11a6b63
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomService.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+import com.intellij.ide.structureView.StructureViewBuilder;
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author Gregory.Shrago
+ */
+public abstract class DomService {
+  private static DomService ourCachedInstance = null;
+
+  public static DomService getInstance() {
+    if (ourCachedInstance == null) {
+      ourCachedInstance = ServiceManager.getService(DomService.class);
+    }
+    return ourCachedInstance;
+  }
+
+  /**
+   * @param rootElementClass class of root (file-level) element in DOM model
+   * @param project current project
+   * @param scope search scope
+   * @return files containing given root element
+   *
+   * @see #getFileElements(Class, com.intellij.openapi.project.Project, com.intellij.psi.search.GlobalSearchScope)
+   */
+  public Collection<VirtualFile> getDomFileCandidates(Class<? extends DomElement> rootElementClass, Project project, final GlobalSearchScope scope) {
+    return ContainerUtil.findAll(getDomFileCandidates(rootElementClass, project), new Condition<VirtualFile>() {
+      public boolean value(final VirtualFile file) {
+        return scope.contains(file);
+      }
+    });
+  }
+
+  public abstract Collection<VirtualFile> getDomFileCandidates(Class<? extends DomElement> description, Project project);
+
+  /**
+   * @param rootElementClass class of root (file-level) element in DOM model
+   * @param project          current project
+   * @param scope            search scope
+   * @return DOM file elements containing given root element
+   */
+  public abstract <T extends DomElement> List<DomFileElement<T>> getFileElements(Class<T> rootElementClass,
+                                                                                 final Project project,
+                                                                                 @Nullable GlobalSearchScope scope);
+
+  public abstract ModelMerger createModelMerger();
+
+  public abstract <T extends DomElement> DomAnchor<T> createAnchor(T domElement);
+
+  @NotNull
+  public abstract XmlFile getContainingFile(@NotNull DomElement domElement);
+
+  @NotNull
+  public abstract EvaluatedXmlName getEvaluatedXmlName(@NotNull DomElement element);
+
+  @NotNull
+  public abstract XmlFileHeader getXmlFileHeader(XmlFile file);
+
+  public enum StructureViewMode {
+    SHOW, SHOW_CHILDREN, SKIP
+  }
+  public abstract StructureViewBuilder createSimpleStructureViewBuilder(final XmlFile file, final Function<DomElement, StructureViewMode> modeProvider);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomTarget.java b/xml/dom-openapi/src/com/intellij/util/xml/DomTarget.java
new file mode 100644
index 0000000..9f061d0
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomTarget.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.pom.PomRenameableTarget;
+import com.intellij.pom.PsiDeclaredTarget;
+import com.intellij.psi.DelegatePsiTarget;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagValue;
+import com.intellij.xml.util.XmlTagUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public class DomTarget extends DelegatePsiTarget implements PsiDeclaredTarget, PomRenameableTarget {
+  private final DomElement myDomElement;
+  private final TextRange myRange;
+  private GenericDomValue myNameDomElement;
+
+  private DomTarget(DomElement domElement, PsiElement navigationElement, TextRange range, final GenericDomValue nameElement) {
+    super(navigationElement);
+    myDomElement = domElement;
+    myRange = range;
+    myNameDomElement = nameElement;
+  }
+
+  @Nullable
+  public static DomTarget getTarget(@NotNull DomElement element) {
+    final GenericDomValue nameElement = element.getGenericInfo().getNameDomElement(element);
+    if (nameElement == null) {
+      return null;
+    }
+
+    return getTarget(element, nameElement);
+  }
+
+  @Nullable
+  public static DomTarget getTarget(DomElement element, GenericDomValue nameElement) {
+    if (nameElement instanceof GenericAttributeValue) {
+      final GenericAttributeValue genericAttributeValue = (GenericAttributeValue)nameElement;
+      final XmlAttributeValue attributeValue = genericAttributeValue.getXmlAttributeValue();
+      if (attributeValue == null) {
+        return null;
+      }
+
+      final int length = attributeValue.getTextLength();
+      if (length >= 2) {
+        return new DomTarget(element, attributeValue, new TextRange(1, length - 1), nameElement);
+      }
+    }
+
+    final XmlTag tag = nameElement.getXmlTag();
+    if (tag == null) {
+      return null;
+    }
+
+    XmlTagValue tagValue = tag.getValue();
+    if (StringUtil.isEmpty(tagValue.getTrimmedText())) {
+      return null;
+    }
+
+    return new DomTarget(element, tag, XmlTagUtil.getTrimmedValueRange(tag), nameElement);
+  }
+
+  public TextRange getNameIdentifierRange() {
+    return myRange;
+  }
+
+  public boolean isWritable() {
+    return getNavigationElement().isWritable();
+  }
+
+  public Object setName(@NotNull String newName) {
+    myNameDomElement.setStringValue(newName);
+    return myDomElement;
+  }
+
+  @Nullable
+  public String getName() {
+    return myNameDomElement.getStringValue();
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+    if (!super.equals(o)) return false;
+
+    DomTarget domTarget = (DomTarget)o;
+
+    if (myDomElement != null ? !myDomElement.equals(domTarget.myDomElement) : domTarget.myDomElement != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 31 * result + (myDomElement != null ? myDomElement.hashCode() : 0);
+    result = 31 * result + (myRange != null ? myRange.hashCode() : 0);
+    return result;
+  }
+
+  public DomElement getDomElement() {
+    return myDomElement;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomUtil.java b/xml/dom-openapi/src/com/intellij/util/xml/DomUtil.java
new file mode 100644
index 0000000..5803c6c
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DomUtil.java
@@ -0,0 +1,499 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.ReflectionCache;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.SmartList;
+import com.intellij.util.containers.ConcurrentFactoryMap;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.reflect.*;
+import com.intellij.xml.util.XmlTagUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.util.*;
+
+/**
+ * @author peter
+ */
+public class DomUtil {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.DomUtil");
+  public static final TypeVariable<Class<GenericValue>> GENERIC_VALUE_TYPE_VARIABLE = ReflectionCache.getTypeParameters(GenericValue.class)[0];
+  private static final Class<Void> DUMMY = void.class;
+  private static final Key<DomFileElement> FILE_ELEMENT_KEY = Key.create("dom file element");
+
+  private static final ConcurrentFactoryMap<Type, Class> ourTypeParameters = new ConcurrentFactoryMap<Type, Class>() {
+    @NotNull
+    protected Class create(final Type key) {
+      final Class<?> result = ReflectionUtil.substituteGenericType(GENERIC_VALUE_TYPE_VARIABLE, key);
+      return result == null ? DUMMY : result;
+    }
+  };
+
+  private DomUtil() {
+  }
+
+  public static Class extractParameterClassFromGenericType(Type type) {
+    return getGenericValueParameter(type);
+  }
+
+  public static boolean isGenericValueType(Type type) {
+    return getGenericValueParameter(type) != null;
+  }
+
+  @Nullable
+  public static <T extends DomElement> T findByName(@NotNull Collection<T> list, @NonNls @NotNull String name) {
+    for (T element: list) {
+      String elementName = element.getGenericInfo().getElementName(element);
+      if (elementName != null && elementName.equals(name)) {
+        return element;
+      }
+    }
+    return null;
+  }
+
+  @NotNull
+  public static String[] getElementNames(@NotNull Collection<? extends DomElement> list) {
+    ArrayList<String> result = new ArrayList<String>(list.size());
+    if (list.size() > 0) {
+      for (DomElement element: list) {
+        String name = element.getGenericInfo().getElementName(element);
+        if (name != null) {
+          result.add(name);
+        }
+      }
+    }
+    return ArrayUtil.toStringArray(result);
+  }
+
+  @NotNull
+  public static List<XmlTag> getElementTags(@NotNull Collection<? extends DomElement> list) {
+    ArrayList<XmlTag> result = new ArrayList<XmlTag>(list.size());
+    for (DomElement element: list) {
+      XmlTag tag = element.getXmlTag();
+      if (tag != null) {
+        result.add(tag);
+      }
+    }
+    return result;
+  }
+
+  @NotNull
+  public static XmlTag[] getElementTags(@NotNull DomElement[] list) {
+    XmlTag[] result = new XmlTag[list.length];
+    int i = 0;
+    for (DomElement element: list) {
+      XmlTag tag = element.getXmlTag();
+      if (tag != null) {
+        result[i++] = tag;
+      }
+    }
+    return result;
+  }
+
+  @Nullable
+  public static List<JavaMethod> getFixedPath(DomElement element) {
+    assert element.isValid();
+    final LinkedList<JavaMethod> methods = new LinkedList<JavaMethod>();
+    while (true) {
+      final DomElement parent = element.getParent();
+      if (parent instanceof DomFileElement) {
+        break;
+      }
+      final JavaMethod method = getGetterMethod(element, parent);
+      if (method == null) {
+        return null;
+      }
+      methods.addFirst(method);
+      element = element.getParent();
+    }
+    return methods;
+  }
+
+  @Nullable
+  private static JavaMethod getGetterMethod(final DomElement element, final DomElement parent) {
+    final String xmlElementName = element.getXmlElementName();
+    final String namespace = element.getXmlElementNamespaceKey();
+    final DomGenericInfo genericInfo = parent.getGenericInfo();
+
+    if (element instanceof GenericAttributeValue) {
+      final DomAttributeChildDescription description = genericInfo.getAttributeChildDescription(xmlElementName, namespace);
+      assert description != null;
+      return description.getGetterMethod();
+    }
+
+    final DomFixedChildDescription description = genericInfo.getFixedChildDescription(xmlElementName, namespace);
+    return description != null ? description.getGetterMethod(description.getValues(parent).indexOf(element)) : null;
+  }
+
+  @Nullable
+  public static Class getGenericValueParameter(Type type) {
+    final Class aClass = ourTypeParameters.get(type);
+    return aClass == DUMMY ? null : aClass;
+  }
+
+  @Nullable
+  public static XmlElement getValueElement(GenericDomValue domValue) {
+    if (domValue instanceof GenericAttributeValue) {
+      final GenericAttributeValue value = (GenericAttributeValue)domValue;
+      final XmlAttributeValue attributeValue = value.getXmlAttributeValue();
+      return attributeValue == null ? value.getXmlAttribute() : attributeValue;
+    } else {
+      return domValue.getXmlTag();
+    }
+  }
+
+  public static List<? extends DomElement> getIdentitySiblings(DomElement element) {
+    final GenericDomValue nameDomElement = element.getGenericInfo().getNameDomElement(element);
+    if (nameDomElement == null) return Collections.emptyList();
+
+    final NameValue nameValue = nameDomElement.getAnnotation(NameValue.class);
+    if (nameValue == null || !nameValue.unique()) return Collections.emptyList();
+
+    final String stringValue = ElementPresentationManager.getElementName(element);
+    if (stringValue == null) return Collections.emptyList();
+
+    final DomElement scope = element.getManager().getIdentityScope(element);
+    if (scope == null) return Collections.emptyList();
+
+    final DomGenericInfo domGenericInfo = scope.getGenericInfo();
+    final String tagName = element.getXmlElementName();
+    final DomCollectionChildDescription childDescription =
+      domGenericInfo.getCollectionChildDescription(tagName, element.getXmlElementNamespaceKey());
+    if (childDescription != null) {
+      final ArrayList<DomElement> list = new ArrayList<DomElement>(childDescription.getValues(scope));
+      list.remove(element);
+      return list;
+    }
+    return Collections.emptyList();
+  }
+
+  public static <T> List<T> getChildrenOfType(@NotNull final DomElement parent, final Class<T> type) {
+    final List<T> result = new SmartList<T>();
+    parent.acceptChildren(new DomElementVisitor() {
+      public void visitDomElement(final DomElement element) {
+        if (type.isInstance(element)) {
+          result.add((T)element);
+        }
+      }
+    });
+    return result;
+  }
+
+  public static List<DomElement> getDefinedChildren(@NotNull final DomElement parent, final boolean tags, final boolean attributes) {
+    if (parent instanceof MergedObject) {
+      final SmartList<DomElement> result = new SmartList<DomElement>();
+      parent.acceptChildren(new DomElementVisitor() {
+        public void visitDomElement(final DomElement element) {
+          if (hasXml(element)) {
+            result.add(element);
+          }
+        }
+      });
+      return result;
+
+    }
+
+    ProgressManager.checkCanceled();
+
+    if (parent instanceof GenericAttributeValue) return Collections.emptyList();
+
+    if (parent instanceof DomFileElement) {
+      final DomFileElement element = (DomFileElement)parent;
+      return tags ? Arrays.asList(element.getRootElement()) : Collections.<DomElement>emptyList();
+    }
+
+    final XmlElement xmlElement = parent.getXmlElement();
+    if (xmlElement instanceof XmlTag) {
+      XmlTag tag = (XmlTag) xmlElement;
+      final DomManager domManager = parent.getManager();
+      final SmartList<DomElement> result = new SmartList<DomElement>();
+      if (attributes) {
+        for (final XmlAttribute attribute : tag.getAttributes()) {
+          if (!attribute.isValid()) {
+            throw new AssertionError("Invalid attr: parent.valid=" + tag.isValid());
+          }
+          GenericAttributeValue element = domManager.getDomElement(attribute);
+          checkHasXml(attribute, element);
+          ContainerUtil.addIfNotNull(element, result);
+        }
+      }
+      if (tags) {
+        for (final XmlTag subTag : tag.getSubTags()) {
+          if (!subTag.isValid()) {
+            throw new AssertionError("Invalid subtag: parent.valid=" + tag.isValid());
+          }
+          DomElement element = domManager.getDomElement(subTag);
+          checkHasXml(subTag, element);
+          ContainerUtil.addIfNotNull(element, result);
+        }
+      }
+      return result;
+    }
+    return Collections.emptyList();
+  }
+
+  private static void checkHasXml(XmlElement psi, DomElement dom) {
+    if (dom != null && dom.getXmlElement() == null) {
+      throw new AssertionError("No xml for dom " + dom + "; attr=" + psi + ", physical=" + psi.isPhysical());
+    }
+  }
+
+  public static <T> List<T> getDefinedChildrenOfType(@NotNull final DomElement parent, final Class<T> type, boolean tags, boolean attributes) {
+    return ContainerUtil.findAll(getDefinedChildren(parent, tags, attributes), type);
+  }
+
+  public static <T> List<T> getDefinedChildrenOfType(@NotNull final DomElement parent, final Class<T> type) {
+    return getDefinedChildrenOfType(parent, type, true, true);
+  }
+
+  @Nullable
+  public static DomElement findDuplicateNamedValue(DomElement element, String newName) {
+    return ElementPresentationManager.findByName(getIdentitySiblings(element), newName);
+  }
+
+  public static boolean isAncestor(@NotNull DomElement ancestor, @NotNull DomElement descendant, boolean strict) {
+    if (!strict && ancestor.equals(descendant)) return true;
+    final DomElement parent = descendant.getParent();
+    return parent != null && isAncestor(ancestor, parent, false);
+  }
+
+  public static void acceptAvailableChildren(final DomElement element, final DomElementVisitor visitor) {
+    final XmlTag tag = element.getXmlTag();
+    if (tag != null) {
+      for (XmlTag xmlTag : tag.getSubTags()) {
+        final DomElement childElement = element.getManager().getDomElement(xmlTag);
+        if (childElement != null) {
+          childElement.accept(visitor);
+        }
+      }
+    }
+  }
+
+  public static Collection<Class> getAllInterfaces(final Class aClass, final Collection<Class> result) {
+    final Class[] interfaces = ReflectionCache.getInterfaces(aClass);
+    ContainerUtil.addAll(result, interfaces);
+    if (aClass.getSuperclass() != null) {
+      getAllInterfaces(aClass.getSuperclass(), result);
+    }
+    for (Class anInterface : interfaces) {
+      getAllInterfaces(anInterface, result);
+    }
+    return result;
+  }
+
+  @Nullable
+  public static <T> T getParentOfType(final DomElement element, final Class<T> requiredClass, final boolean strict) {
+    for (DomElement curElement = strict && element != null? element.getParent() : element;
+         curElement != null;
+         curElement = curElement.getParent()) {
+      if (requiredClass.isInstance(curElement)) {
+        return (T)curElement;
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public static <T> T getContextElement(@Nullable final Editor editor, Class<T> clazz) {
+    final DomElement element = getContextElement(editor);
+    return getParentOfType(element, clazz, false);
+  }
+
+  @Nullable
+  public static DomElement getContextElement(@Nullable final Editor editor) {
+    if(editor == null) return null;
+
+    final Project project = editor.getProject();
+    if (project == null) return null;
+
+    final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
+    if (!(file instanceof XmlFile)) {
+      return null;
+    }
+
+    return getDomElement(file.findElementAt(editor.getCaretModel().getOffset()));
+  }
+
+  @Nullable
+  public static DomElement getDomElement(final Editor editor, final PsiFile file) {
+     return getDomElement(file.findElementAt(editor.getCaretModel().getOffset()));
+  }
+
+  @Nullable
+  public static DomElement getDomElement(@Nullable final PsiElement element) {
+    if (element == null) return null;
+
+    final Project project = element.getProject();
+    final DomManager domManager = DomManager.getDomManager(project);
+    final XmlAttribute attr = PsiTreeUtil.getParentOfType(element, XmlAttribute.class, false);
+    if (attr != null) {
+      final GenericAttributeValue value = domManager.getDomElement(attr);
+      if (value != null) return value;
+    }
+
+    XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class, false);
+    while (tag != null) {
+      final DomElement domElement = domManager.getDomElement(tag);
+      if(domElement != null) return domElement;
+
+      tag = tag.getParentTag();
+    }
+    return null;
+  }
+
+  @NotNull
+  public static <T extends DomElement> T getOriginalElement(@NotNull final T domElement) {
+    final XmlElement psiElement = domElement.getXmlElement();
+    if (psiElement == null) return domElement;
+
+    final PsiFile psiFile = psiElement.getContainingFile().getOriginalFile();
+    final TextRange range = psiElement.getTextRange();
+    final PsiElement element = psiFile.findElementAt(range.getStartOffset());
+    final int maxLength = range.getLength();
+    final boolean isAttribute = psiElement instanceof XmlAttribute;
+    final Class<? extends XmlElement> clazz = isAttribute ? XmlAttribute.class : XmlTag.class;
+    final DomManager domManager = domElement.getManager();
+    DomElement current = null;
+    for (XmlElement next = PsiTreeUtil.getParentOfType(element, clazz, false);
+         next != null && next.getTextLength() <= maxLength;
+         next = PsiTreeUtil.getParentOfType(next, clazz, true)) {
+      current = isAttribute? domManager.getDomElement((XmlAttribute)next) : domManager.getDomElement((XmlTag)next);
+      if (current != null && domElement.getClass() != current.getClass()) current = null;
+    }
+    return (T)current;
+  }
+
+  public static <T extends DomElement> T addElementAfter(@NotNull final T anchor) {
+    final DomElement parent = anchor.getParent();
+    final DomCollectionChildDescription childDescription = (DomCollectionChildDescription)anchor.getChildDescription();
+    assert parent != null;
+    final List<? extends DomElement> list = childDescription.getValues(parent);
+    final int i = list.indexOf(anchor);
+    assert i >= 0;
+    return (T)childDescription.addValue(parent, i + 1);
+  }
+
+  @Nullable
+  public static <T extends DomElement> T findDomElement(@Nullable final PsiElement element, final Class<T> beanClass) {
+    return findDomElement(element, beanClass, true);
+  }
+
+  @Nullable
+  public static <T extends DomElement> T findDomElement(@Nullable final PsiElement element, final Class<T> beanClass, boolean strict) {
+    if (element == null) return null;
+
+    XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class, strict);
+    DomElement domElement;
+
+    while (tag != null) {
+      domElement = DomManager.getDomManager(tag.getProject()).getDomElement(tag);
+
+      if (domElement != null) {
+        return domElement.getParentOfType(beanClass, false);
+      }
+      tag = tag.getParentTag();
+    }
+    return null;
+  }
+
+  public static <T extends DomElement> DomFileElement<T> getFileElement(@NotNull DomElement element) {
+
+    if (element instanceof DomFileElement) {
+      return (DomFileElement)element;
+    }
+    DomFileElement fileElement = element.getUserData(FILE_ELEMENT_KEY);
+    if (fileElement == null) {
+      DomElement parent = element.getParent();
+      if (parent != null) {
+        fileElement = getFileElement(parent);
+      }
+      element.putUserData(FILE_ELEMENT_KEY, fileElement);
+    }
+    return fileElement;
+  }
+
+  @NotNull
+  public static XmlFile getFile(@NotNull DomElement element) {
+    return DomService.getInstance().getContainingFile(element);
+  }
+
+  /**
+   * @param domElement DomElement to search root of
+   * @return the topmost valid DomElement being a parent of the given one. May be and may be not DomFileElement.
+   * If root tag has changed, file may lose its domness, so there will be no DomFileElement, but the inner DomElement's
+   * will be still alive because the underlying XML tags are valid
+   */
+  @NotNull
+  public static DomElement getRoot(@NotNull DomElement domElement) {
+    while (true) {
+      final DomElement parent = domElement.getParent();
+      if (parent == null) {
+        return domElement;
+      }
+      domElement = parent;
+    }
+  }
+
+  public static boolean hasXml(@NotNull DomElement element) {
+    return element.getXmlElement() != null;
+  }
+
+  public static Pair<TextRange, PsiElement> getProblemRange(final XmlTag tag) {
+    final PsiElement startToken = XmlTagUtil.getStartTagNameElement(tag);
+    if (startToken == null) {
+      return Pair.create(tag.getTextRange(), (PsiElement)tag);
+    }
+
+    return Pair.create(startToken.getTextRange().shiftRight(-tag.getTextRange().getStartOffset()), (PsiElement)tag);
+  }
+
+  @SuppressWarnings("ForLoopReplaceableByForEach")
+  public static <T extends DomElement> List<T> getChildrenOf(DomElement parent, final Class<T> type) {
+    final List<T> list = new SmartList<T>();
+    List<? extends AbstractDomChildrenDescription> descriptions = parent.getGenericInfo().getChildrenDescriptions();
+    for (int i = 0, descriptionsSize = descriptions.size(); i < descriptionsSize; i++) {
+      AbstractDomChildrenDescription description = descriptions.get(i);
+      if (description.getType() instanceof Class && type.isAssignableFrom((Class<?>)description.getType())) {
+        List<T> values = (List<T>)description.getValues(parent);
+        for (int j = 0, valuesSize = values.size(); j < valuesSize; j++) {
+          T value = values.get(j);
+          if (value.exists()) {
+            list.add(value);
+          }
+        }
+      }
+    }
+    return list;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DummyEvaluatedXmlName.java b/xml/dom-openapi/src/com/intellij/util/xml/DummyEvaluatedXmlName.java
new file mode 100644
index 0000000..30dbe7f
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/DummyEvaluatedXmlName.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class DummyEvaluatedXmlName implements EvaluatedXmlName {
+  private final XmlName myXmlName;
+  private final String myNamespace;
+
+  public DummyEvaluatedXmlName(final String localName, @NotNull final String namespace) {
+    this(new XmlName(localName), namespace);
+  }
+
+  public DummyEvaluatedXmlName(final XmlName xmlName, @NotNull final String namespace) {
+    myXmlName = xmlName;
+    myNamespace = namespace;
+  }
+
+  public XmlName getXmlName() {
+    return myXmlName;
+  }
+
+  public EvaluatedXmlName evaluateChildName(@NotNull final XmlName name) {
+    String namespaceKey = name.getNamespaceKey();
+    if (namespaceKey == null) {
+      return new DummyEvaluatedXmlName(name.getLocalName(), myNamespace);
+    }
+    return EvaluatedXmlNameImpl.createEvaluatedXmlName(name, namespaceKey, false);
+  }
+
+  public boolean isNamespaceAllowed(final String namespace, final XmlFile file, boolean qualified) {
+    return namespace.equals(myNamespace);
+  }
+
+  @NotNull
+  @NonNls
+  public String getNamespace(@NotNull final XmlElement parentElement, final XmlFile file) {
+    return myNamespace;
+  }
+
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    final DummyEvaluatedXmlName that = (DummyEvaluatedXmlName)o;
+
+    if (myNamespace != null ? !myNamespace.equals(that.myNamespace) : that.myNamespace != null) return false;
+    if (myXmlName != null ? !myXmlName.equals(that.myXmlName) : that.myXmlName != null) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    int result;
+    result = (myXmlName != null ? myXmlName.hashCode() : 0);
+    result = 31 * result + (myNamespace != null ? myNamespace.hashCode() : 0);
+    return result;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ElementPresentation.java b/xml/dom-openapi/src/com/intellij/util/xml/ElementPresentation.java
new file mode 100644
index 0000000..6e179c0
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ElementPresentation.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+
+/**
+ * @author peter
+ * @see com.intellij.util.xml.DomElement#getPresentation()
+ * @see ElementPresentationTemplate
+ */
+public abstract class ElementPresentation {
+  @Nullable
+  public abstract String getElementName();
+
+  public abstract String getTypeName();
+
+  @Nullable
+  public abstract Icon getIcon();
+
+  @Nullable
+  public String getDocumentation() { return null;}
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ElementPresentationManager.java b/xml/dom-openapi/src/com/intellij/util/xml/ElementPresentationManager.java
new file mode 100644
index 0000000..6f52560
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ElementPresentationManager.java
@@ -0,0 +1,275 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.ide.IconProvider;
+import com.intellij.ide.TypePresentationService;
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.project.DumbService;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Iconable;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.util.Function;
+import com.intellij.util.NullableFunction;
+import com.intellij.util.ReflectionCache;
+import com.intellij.util.containers.ConcurrentFactoryMap;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.lang.reflect.Method;
+import java.util.*;
+
+/**
+ * @author peter
+ */
+public abstract class ElementPresentationManager {
+  private static final ConcurrentFactoryMap<Class,Method> ourNameValueMethods = new ConcurrentFactoryMap<Class, Method>() {
+    @Nullable
+    protected Method create(final Class key) {
+      for (final Method method : ReflectionCache.getMethods(key)) {
+      if (JavaMethod.getMethod(key, method).getAnnotation(NameValue.class) != null) {
+        return method;
+      }
+    }
+    return null;
+    }
+  };
+
+  private final static Function<Object, String> DEFAULT_NAMER = new Function<Object, String>() {
+    @Nullable
+    public String fun(final Object element) {
+      return getElementName(element);
+    }
+  };
+
+  public static ElementPresentationManager getInstance() {
+    return ServiceManager.getService(ElementPresentationManager.class);
+  }
+
+  @NotNull
+  public <T> Object[] createVariants(Collection<T> elements) {
+    return createVariants(elements, (Function<T, String>)DEFAULT_NAMER);
+  }
+
+  @NotNull
+  public <T> Object[] createVariants(Collection<T> elements, int iconFlags) {
+    return createVariants(elements, (Function<T, String>)DEFAULT_NAMER, iconFlags);
+  }
+
+  @NotNull
+  public <T> Object[] createVariants(Collection<T> elements, Function<T, String> namer) {
+    return createVariants(elements, namer, 0);
+  }
+
+  /**
+   * Use {@link com.intellij.codeInsight.lookup.LookupElementBuilder}
+   */
+  @Deprecated
+  public abstract Object createVariant(final Object variant, final String name, final PsiElement psiElement);
+
+  @NotNull
+  public abstract <T> Object[] createVariants(Collection<T> elements, Function<T, String> namer, int iconFlags);
+
+
+  private static final List<Function<Object, String>> ourNameProviders = new ArrayList<Function<Object, String>>();
+  private static final List<Function<Object, String>> ourDocumentationProviders = new ArrayList<Function<Object, String>>();
+  private static final List<Function<Object, Icon>> ourIconProviders = new ArrayList<Function<Object, Icon>>();
+
+  static {
+    ourIconProviders.add(new NullableFunction<Object, Icon>() {
+      public Icon fun(final Object o) {
+        return o instanceof Iconable ? ((Iconable)o).getIcon(Iconable.ICON_FLAG_READ_STATUS) : null;
+      }
+    });
+  }
+
+  /**
+   * @deprecated
+   * @see com.intellij.ide.presentation.Presentation#provider()
+   */
+  public static void registerNameProvider(Function<Object, String> function) { ourNameProviders.add(function); }
+
+  /**
+   * @deprecated
+   * @see Documentation
+   */
+  public static void registerDocumentationProvider(Function<Object, String> function) { ourDocumentationProviders.add(function); }
+
+
+  public static final <T>NullableFunction<T, String> NAMER() {
+    return new NullableFunction<T, String>() {
+      public String fun(final T o) {
+        return getElementName(o);
+      }
+    };
+  }
+
+  public static final NullableFunction<Object, String> NAMER = new NullableFunction<Object, String>() {
+    public String fun(final Object o) {
+      return getElementName(o);
+    }
+  };
+  public static <T> NullableFunction<T, String> namer() {
+    //noinspection unchecked
+    return (NullableFunction<T, String>)NAMER;
+  }
+
+  @Nullable
+  public static String getElementName(Object element) {
+    for (final Function<Object, String> function : ourNameProviders) {
+      final String s = function.fun(element);
+      if (s != null) {
+        return s;
+      }
+    }
+    Object o = invokeNameValueMethod(element);
+    if (o == null || o instanceof String) return (String)o;
+    if (o instanceof GenericValue) {
+      final GenericValue gv = (GenericValue)o;
+      final String s = gv.getStringValue();
+      if (s == null) {
+        final Object value = gv.getValue();
+        if (value != null) {
+          return String.valueOf(value);
+        }
+      }
+      return s;
+    }
+    return null;
+  }
+
+  @Nullable
+  public static String getDocumentationForElement(Object element) {
+    for (final Function<Object, String> function : ourDocumentationProviders) {
+      final String s = function.fun(element);
+      if (s != null) {
+        return s;
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public static Object invokeNameValueMethod(final Object element) {
+    final Method nameValueMethod = findNameValueMethod(element.getClass());
+    if (nameValueMethod == null) {
+      return null;
+    }
+
+    return DomReflectionUtil.invokeMethod(nameValueMethod, element);
+  }
+
+  public static String getTypeNameForObject(Object o) {
+    final Object firstImpl = ModelMergerUtil.getFirstImplementation(o);
+    o = firstImpl != null ? firstImpl : o;
+    String typeName = TypePresentationService.getService().getTypeName(o);
+    if (typeName != null) return typeName;
+    if (o instanceof DomElement) {
+      final DomElement element = (DomElement)o;
+      return StringUtil.capitalizeWords(element.getNameStrategy().splitIntoWords(element.getXmlElementName()), true);
+    }
+    return TypePresentationService.getDefaultTypeName(o.getClass());
+  }
+
+  public static Icon getIcon(Object o) {
+    for (final Function<Object, Icon> function : ourIconProviders) {
+      final Icon icon = function.fun(o);
+      if (icon != null) {
+        return icon;
+      }
+    }
+    if (o instanceof DomElement) {
+      final DomElement domElement = (DomElement)o;
+      final boolean dumb = DumbService.getInstance(domElement.getManager().getProject()).isDumb();
+
+      for (final IconProvider provider : IconProvider.EXTENSION_POINT_NAME.getExtensions()) {
+        if (provider instanceof DomIconProvider) {
+          if (dumb && !DumbService.isDumbAware(provider)) {
+            continue;
+          }
+
+          final Icon icon = ((DomIconProvider)provider).getIcon(domElement, 0);
+          if (icon != null) {
+            return icon;
+          }
+        }
+      }
+    }
+
+    final Icon[] icons = getIconsForClass(o.getClass(), o);
+    if (icons != null && icons.length > 0) {
+      return icons[0];
+    }
+    return null;
+  }
+
+  @Nullable
+  public static Icon getIconOld(Object o) {
+    for (final Function<Object, Icon> function : ourIconProviders) {
+      final Icon icon = function.fun(o);
+      if (icon != null) {
+        return icon;
+      }
+    }
+    final Icon[] icons = getIconsForClass(o.getClass(), o);
+    if (icons != null && icons.length > 0) {
+      return icons[0];
+    }
+    return null;
+  }
+
+  @Nullable
+  private static <T> T getFirst(@Nullable final T[] array) {
+    return array == null || array.length == 0 ? null : array[0];
+  }
+
+
+  @Nullable
+  public static Icon getIconForClass(Class clazz) {
+    return getFirst(getIconsForClass(clazz, null));
+  }
+
+  @Nullable
+  private static Icon[] getIconsForClass(final Class clazz, @Nullable Object o) {
+    TypePresentationService service = TypePresentationService.getService();
+    final Icon icon = o == null ? service.getTypeIcon(clazz) : service.getIcon(o);
+    if (icon != null) {
+      return new Icon[]{icon};
+    }
+
+    return null;
+  }
+
+  public static Method findNameValueMethod(final Class<? extends Object> aClass) {
+    synchronized (ourNameValueMethods) {
+      return ourNameValueMethods.get(aClass);
+    }
+  }
+
+  @Nullable
+  public static <T> T findByName(Collection<T> collection, final String name) {
+    return ContainerUtil.find(collection, new Condition<T>() {
+      public boolean value(final T object) {
+        return Comparing.equal(name, getElementName(object), true);
+      }
+    });
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ElementPresentationTemplate.java b/xml/dom-openapi/src/com/intellij/util/xml/ElementPresentationTemplate.java
new file mode 100644
index 0000000..943ec50
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ElementPresentationTemplate.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public interface ElementPresentationTemplate {
+
+  ElementPresentation createPresentation(DomElement element);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/EvaluatedXmlName.java b/xml/dom-openapi/src/com/intellij/util/xml/EvaluatedXmlName.java
new file mode 100644
index 0000000..c715625
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/EvaluatedXmlName.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public interface EvaluatedXmlName {
+
+  XmlName getXmlName();
+
+  EvaluatedXmlName evaluateChildName(@NotNull XmlName name);
+
+  boolean isNamespaceAllowed(String namespace, final XmlFile file, boolean qualified);
+
+  @NotNull @NonNls
+  String getNamespace(@NotNull XmlElement parentElement, final XmlFile file);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/EvaluatedXmlNameImpl.java b/xml/dom-openapi/src/com/intellij/util/xml/EvaluatedXmlNameImpl.java
new file mode 100644
index 0000000..c2422f0
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/EvaluatedXmlNameImpl.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.xml.*;
+import com.intellij.util.containers.ConcurrentFactoryMap;
+import com.intellij.util.containers.ConcurrentHashMap;
+import com.intellij.util.containers.FactoryMap;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author peter
+ */
+public class EvaluatedXmlNameImpl implements EvaluatedXmlName {
+  private static final Key<CachedValue<FactoryMap<String,List<String>>>> NAMESPACE_PROVIDER_KEY = Key.create("NamespaceProvider");
+  private static final Map<EvaluatedXmlNameImpl,EvaluatedXmlNameImpl> ourInterned = new ConcurrentHashMap<EvaluatedXmlNameImpl,EvaluatedXmlNameImpl>();
+
+  private final XmlName myXmlName;
+  private final String myNamespaceKey;
+  private final boolean myEqualToParent;
+
+  private EvaluatedXmlNameImpl(@NotNull final XmlName xmlName, @Nullable final String namespaceKey, final boolean equalToParent) {
+    myXmlName = xmlName;
+    myNamespaceKey = namespaceKey;
+    myEqualToParent = equalToParent;
+  }
+
+  @NotNull
+  public final String getLocalName() {
+    return myXmlName.getLocalName();
+  }
+
+  public final XmlName getXmlName() {
+    return myXmlName;
+  }
+
+  public final EvaluatedXmlName evaluateChildName(@NotNull final XmlName name) {
+    String namespaceKey = name.getNamespaceKey();
+    final boolean equalToParent = Comparing.equal(namespaceKey, myNamespaceKey);
+    if (namespaceKey == null) {
+      namespaceKey = myNamespaceKey;
+    }
+    return createEvaluatedXmlName(name, namespaceKey, equalToParent);
+  }
+
+  public String toString() {
+    return (myNamespaceKey == null ? "" : myNamespaceKey + " : ") + myXmlName.getLocalName();
+  }
+
+  @Override
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (o == null || !(o instanceof EvaluatedXmlNameImpl)) return false;
+
+    final EvaluatedXmlNameImpl that = (EvaluatedXmlNameImpl)o;
+
+    if (myEqualToParent != that.myEqualToParent) return false;
+    if (myNamespaceKey != null ? !myNamespaceKey.equals(that.myNamespaceKey) : that.myNamespaceKey != null) return false;
+    if (!myXmlName.equals(that.myXmlName)) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = myXmlName.hashCode();
+    result = 31 * result + (myNamespaceKey != null ? myNamespaceKey.hashCode() : 0);
+    result = 31 * result + (myEqualToParent ? 1 : 0);
+    return result;
+  }
+
+  public final boolean isNamespaceAllowed(DomFileElement element, String namespace) {
+    if (myNamespaceKey == null || myEqualToParent) return true;
+    final XmlFile file = element.getFile();
+    return isNamespaceAllowed(namespace, getAllowedNamespaces(file));
+  }
+
+  @NotNull
+  private List<String> getAllowedNamespaces(final XmlFile file) {
+    CachedValue<FactoryMap<String, List<String>>> value = file.getUserData(NAMESPACE_PROVIDER_KEY);
+    if (value == null) {
+      file.putUserData(NAMESPACE_PROVIDER_KEY, value = CachedValuesManager.getManager(file.getProject()).createCachedValue(new CachedValueProvider<FactoryMap<String, List<String>>>() {
+          public Result<FactoryMap<String, List<String>>> compute() {
+            final FactoryMap<String, List<String>> map = new ConcurrentFactoryMap<String, List<String>>() {
+              protected List<String> create(final String key) {
+                final DomFileDescription<?> description = DomManager.getDomManager(file.getProject()).getDomFileDescription(file);
+                if (description == null) return Collections.emptyList();
+                return description.getAllowedNamespaces(key, file);
+              }
+            };
+            return Result.create(map, file);
+          }
+        }, false));
+    }
+
+    final List<String> list = value.getValue().get(myNamespaceKey);
+    assert list != null;
+    return list;
+  }
+
+  private static boolean isNamespaceAllowed(final String namespace, final List<String> list) {
+    return list.contains(namespace) || StringUtil.isEmpty(namespace) && list.isEmpty();
+
+  }
+
+  public final boolean isNamespaceAllowed(String namespace, final XmlFile file, boolean qualified) {
+    return myNamespaceKey == null || myEqualToParent && !qualified || isNamespaceAllowed(namespace, getNamespaceList(file));
+  }
+
+  @NotNull @NonNls
+  public final String getNamespace(@NotNull XmlElement parentElement, final XmlFile file) {
+    final String xmlElementNamespace = getXmlElementNamespace(parentElement);
+    if (myNamespaceKey != null && !myEqualToParent) {
+      final List<String> strings = getAllowedNamespaces(file);
+      if (!strings.isEmpty() && !strings.contains(xmlElementNamespace)) {
+        return strings.get(0);
+      }
+    }
+    return xmlElementNamespace;
+  }
+
+  private static String getXmlElementNamespace(final XmlElement parentElement) {
+    if (parentElement instanceof XmlTag) {
+      return ((XmlTag)parentElement).getNamespace();
+    }
+    if (parentElement instanceof XmlAttribute) {
+      return ((XmlAttribute)parentElement).getNamespace();
+    }
+    if (parentElement instanceof XmlFile) {
+      final XmlDocument document = ((XmlFile)parentElement).getDocument();
+      if (document != null) {
+        final XmlTag tag = document.getRootTag();
+        if (tag != null) {
+          return tag.getNamespace();
+        }
+      }
+      return "";
+    }
+    throw new AssertionError("Can't get namespace of " + parentElement);
+  }
+
+  private List<String> getNamespaceList(final XmlFile file) {
+    return getAllowedNamespaces(file);
+  }
+
+  public static EvaluatedXmlNameImpl createEvaluatedXmlName(@NotNull final XmlName xmlName, @Nullable final String namespaceKey, boolean equalToParent) {
+    final EvaluatedXmlNameImpl name = new EvaluatedXmlNameImpl(xmlName, namespaceKey, equalToParent);
+    final EvaluatedXmlNameImpl interned = ourInterned.get(name);
+    if (interned != null) {
+      return interned;
+    }
+    ourInterned.put(name, name);
+    return name;
+  }
+}
+                
\ No newline at end of file
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/GenericAttributeValue.java b/xml/dom-openapi/src/com/intellij/util/xml/GenericAttributeValue.java
new file mode 100644
index 0000000..08618de
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/GenericAttributeValue.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public interface GenericAttributeValue<T> extends GenericDomValue<T>{
+  @Nullable
+  XmlAttribute getXmlAttribute();
+  
+  @Nullable
+  XmlAttributeValue getXmlAttributeValue();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/GenericDomValue.java b/xml/dom-openapi/src/com/intellij/util/xml/GenericDomValue.java
new file mode 100644
index 0000000..ce75a5f
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/GenericDomValue.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public interface GenericDomValue<T> extends DomElement, MutableGenericValue<T>{
+
+  @NotNull
+  Converter<T> getConverter();
+
+  @TagValue
+  void setStringValue(String value);
+
+  void setValue(T value);
+
+  /**
+   * @return text of the value as it is specified in the underlying XML. No conversions or substitutions are made 
+   */
+  String getRawText();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/GenericValue.java b/xml/dom-openapi/src/com/intellij/util/xml/GenericValue.java
new file mode 100644
index 0000000..b64f4ba
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/GenericValue.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * This interface may be interpreted as a reference, whose text is {@link #getStringValue()}, and resolving to
+ * the result of {@link #getValue()} method.
+ *
+ * @author peter
+ */
+public interface GenericValue<T> {
+
+  /**
+   * @return the string representation of the value. Even if {@link #getValue()} returns null, this method
+   * can return something more descriptive.
+   */
+  @TagValue
+  @Nullable
+  String getStringValue();
+
+  /**
+   * @return resolved value (may take time). It's strongly recommended that even if T is {@link String}, one uses
+   * {@link #getStringValue()} method instead. 
+   */
+  @Nullable
+  T getValue();
+
+}
\ No newline at end of file
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/GenericValueUtil.java b/xml/dom-openapi/src/com/intellij/util/xml/GenericValueUtil.java
new file mode 100644
index 0000000..6085c20
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/GenericValueUtil.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+import com.intellij.openapi.util.Comparing;
+import com.intellij.util.NullableFunction;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author Gregory.Shrago
+ */
+public class GenericValueUtil {
+  private GenericValueUtil() {
+  }
+
+  public static NullableFunction<GenericValue, String> STRING_VALUE = new NullableFunction<GenericValue, String>() {
+    public String fun(final GenericValue genericValue) {
+      return genericValue.getStringValue();
+    }
+  };
+  public static NullableFunction<GenericValue, Object> OBJECT_VALUE = new NullableFunction<GenericValue, Object>() {
+    public Object fun(final GenericValue genericValue) {
+      return genericValue.getValue();
+    }
+  };
+
+
+  public static boolean containsString(final List<? extends GenericValue<?>> list, String value) {
+    for (GenericValue<?> o : list) {
+      if (Comparing.equal(value, o.getStringValue())) return true;
+    }
+    return false;
+  }
+
+  public static <T> boolean containsValue(final List<? extends GenericValue<? extends T>> list, T value) {
+    for (GenericValue<? extends T> o : list) {
+      if (Comparing.equal(value, o.getValue())) return true;
+    }
+    return false;
+  }
+
+  @NotNull
+  public static <T> Collection<T> getValueCollection(final Collection<? extends GenericValue<? extends T>> collection, Collection<T> result) {
+    for (GenericValue<? extends T> o : collection) {
+      ContainerUtil.addIfNotNull(o.getValue(), result);
+    }
+    return result;
+  }
+
+  @NotNull
+  public static Collection<String> getStringCollection(final Collection<? extends GenericValue> collection, Collection<String> result) {
+    for (GenericValue o : collection) {
+      ContainerUtil.addIfNotNull(o.getStringValue(), result);
+    }
+    return result;
+  }
+
+  @NotNull
+  public static Collection<String> getClassStringCollection(final Collection<? extends GenericValue> collection, Collection<String> result) {
+    for (GenericValue o : collection) {
+      final String value = o.getStringValue();
+      if (value != null) {
+        result.add(value.replace('$', '.'));
+      }
+    }
+    return result;
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/HyphenNameStrategy.java b/xml/dom-openapi/src/com/intellij/util/xml/HyphenNameStrategy.java
new file mode 100644
index 0000000..2242e0f
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/HyphenNameStrategy.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.codeStyle.NameUtil;
+import com.intellij.openapi.util.text.StringUtil;
+
+/**
+ * This strategy splits property name into words, decapitalizes them and joins using hyphen as separator,
+ * e.g. getXmlElementName() will correspond to xml-element-name
+ *
+ * @author peter
+ */
+public class HyphenNameStrategy extends DomNameStrategy {
+  public String convertName(String propertyName) {
+    final String[] words = NameUtil.nameToWords(propertyName);
+    for (int i = 0; i < words.length; i++) {
+      words[i] = StringUtil.decapitalize(words[i]);
+    }
+    return StringUtil.join(words, "-");
+  }
+
+  public String splitIntoWords(final String tagName) {
+    return tagName.replace('-', ' ');
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/Implementation.java b/xml/dom-openapi/src/com/intellij/util/xml/Implementation.java
new file mode 100644
index 0000000..6bd8d6b
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/Implementation.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies DOM interface implementation. Implementation should be abstract class with only
+ * non-DOM methods defined, it should implement the annotated interface.
+ *
+ * @deprecated use extension point com.intellij.util.xml.impl.DomImplementationClassEP#EP_NAME
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface Implementation {
+  Class<? extends DomElement> value();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/Intersect.java b/xml/dom-openapi/src/com/intellij/util/xml/Intersect.java
new file mode 100644
index 0000000..f70a86d
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/Intersect.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * Annotates methods with return values that should be merged with <b>AND</b> semantics by {@link ModelMerger}
+ *
+ * @author Gregory.Shrago
+ */
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Intersect {
+}
\ No newline at end of file
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/JavaMethod.java b/xml/dom-openapi/src/com/intellij/util/xml/JavaMethod.java
new file mode 100644
index 0000000..4111377
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/JavaMethod.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.util.SmartFMap;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public final class JavaMethod implements AnnotatedElement{
+  public static final JavaMethod[] EMPTY_ARRAY = new JavaMethod[0];
+  private static final Object NONE = new Object();
+
+  private final JavaMethodSignature mySignature;
+  private final Class myDeclaringClass;
+  private final Method myMethod;
+  private volatile SmartFMap<Class, Object> myAnnotationsMap = SmartFMap.emptyMap();
+
+  private JavaMethod(final Class declaringClass, final JavaMethodSignature signature) {
+    mySignature = signature;
+    myMethod = signature.findMethod(declaringClass);
+    assert myMethod != null : "No method " + signature + " in class " + declaringClass;
+    myDeclaringClass = myMethod.getDeclaringClass();
+  }
+
+  public final Class getDeclaringClass() {
+    return myDeclaringClass;
+  }
+
+  public final JavaMethodSignature getSignature() {
+    return mySignature;
+  }
+
+  public final List<Method> getHierarchy() {
+    return mySignature.getAllMethods(myDeclaringClass);
+  }
+
+  public String getMethodName() {
+    return mySignature.getMethodName();
+  }
+
+  public final Method getMethod() {
+    return myMethod;
+  }
+
+  public final Type[] getGenericParameterTypes() {
+    return myMethod.getGenericParameterTypes();
+  }
+
+  public final Type getGenericReturnType() {
+    return myMethod.getGenericReturnType();
+  }
+
+  public static JavaMethod getMethod(final Class declaringClass, final JavaMethodSignature signature) {
+    return new JavaMethod(declaringClass, signature);
+  }
+
+  public static JavaMethod getMethod(final Class declaringClass, final Method method) {
+    return getMethod(declaringClass, new JavaMethodSignature(method));
+  }
+
+  public final Object invoke(final Object o, final Object... args) {
+    return DomReflectionUtil.invokeMethod(myMethod, o, args);
+  }
+
+  public String toString() {
+    return "JavaMethod: " + myMethod.toString();
+  }
+
+  @NonNls
+  public final String getName() {
+    return myMethod.getName();
+  }
+
+  public final <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+    Object annotation = myAnnotationsMap.get(annotationClass);
+    if (annotation == null) {
+      myAnnotationsMap = myAnnotationsMap.plus(annotationClass, annotation = findAnnotation(annotationClass));
+    }
+    //noinspection unchecked
+    return annotation == NONE ? null : (T)annotation;
+  }
+
+  @NotNull private Object findAnnotation(Class<? extends Annotation> annotationClass) {
+    for (Method method : mySignature.getAllMethods(myDeclaringClass)) {
+      final Annotation annotation = method.getAnnotation(annotationClass);
+      if (annotation != null) {
+        return annotation;
+      }
+    }
+    return NONE;
+  }
+
+  @Override
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (!(o instanceof JavaMethod)) return false;
+
+    final JavaMethod that = (JavaMethod)o;
+
+    if (!myDeclaringClass.equals(that.myDeclaringClass)) return false;
+    if (!mySignature.equals(that.mySignature)) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = mySignature.hashCode();
+    result = 31 * result + myDeclaringClass.hashCode();
+    return result;
+  }
+
+  public final Class getReturnType() {
+    return myMethod.getReturnType();
+  }
+
+  public Class<?>[] getParameterTypes() {
+    return myMethod.getParameterTypes();
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/JavaMethodSignature.java b/xml/dom-openapi/src/com/intellij/util/xml/JavaMethodSignature.java
new file mode 100644
index 0000000..359ec5a
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/JavaMethodSignature.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.ReflectionCache;
+import com.intellij.util.ReflectionUtil;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.*;
+
+/**
+ * @author peter
+ */
+public class JavaMethodSignature {
+  private final String myMethodName;
+  private final Class[] myMethodParameters;
+
+  public JavaMethodSignature(final String methodName, final Class... methodParameters) {
+    myMethodName = methodName;
+    myMethodParameters = methodParameters.length == 0 ? ArrayUtil.EMPTY_CLASS_ARRAY : methodParameters;
+  }
+
+  public JavaMethodSignature(Method method) {
+    this(method.getName(), method.getParameterTypes());
+  }
+
+  public String getMethodName() {
+    return myMethodName;
+  }
+
+  @Nullable
+  public final Method findMethod(final Class aClass) {
+    Method method = getDeclaredMethod(aClass);
+    if (method == null && ReflectionCache.isInterface(aClass)) {
+      method = getDeclaredMethod(Object.class);
+    }
+    return method;
+  }
+
+  private void collectMethods(final Class aClass, List<Method> methods) {
+    addMethodWithSupers(aClass, findMethod(aClass), methods);
+  }
+
+  @Nullable
+  private Method getDeclaredMethod(final Class aClass) {
+    final Method method = ReflectionUtil.getMethod(aClass, myMethodName, myMethodParameters);
+    return method == null ? ReflectionUtil.getDeclaredMethod(aClass, myMethodName, myMethodParameters) : method;
+  }
+
+  private void addMethodWithSupers(final Class aClass, final Method method, List<Method> methods) {
+    if (method != null) {
+      methods.add(method);
+    }
+    final Class superClass = aClass.getSuperclass();
+    if (superClass != null) {
+      collectMethods(superClass, methods);
+    } else {
+      if (aClass.isInterface()) {
+        collectMethods(Object.class, methods);
+      }
+    }
+    for (final Class anInterface : aClass.getInterfaces()) {
+      collectMethods(anInterface, methods);
+    }
+  }
+
+  public final List<Method> getAllMethods(final Class startFrom) {
+    final ArrayList<Method> methods = new ArrayList<Method>();
+    collectMethods(startFrom, methods);
+    return methods;
+  }
+
+  @Nullable
+  public final <T extends Annotation> Method findAnnotatedMethod(final Class<T> annotationClass, final Class startFrom) {
+    for (Method method : getAllMethods(startFrom)) {
+      final T annotation = method.getAnnotation(annotationClass);
+      if (annotation != null && ReflectionCache.isAssignable(method.getDeclaringClass(), startFrom)) {
+        return method;
+      }
+    }
+    return null;
+  }
+
+  public String toString() {
+    return myMethodName + Arrays.asList(myMethodParameters);
+  }
+
+  @Override
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    final JavaMethodSignature that = (JavaMethodSignature)o;
+
+    if (!myMethodName.equals(that.myMethodName)) return false;
+    if (!Arrays.equals(myMethodParameters, that.myMethodParameters)) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = myMethodName.hashCode();
+    result = 31 * result + Arrays.hashCode(myMethodParameters);
+    return result;
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/JavaNameStrategy.java b/xml/dom-openapi/src/com/intellij/util/xml/JavaNameStrategy.java
new file mode 100644
index 0000000..e6cabb9
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/JavaNameStrategy.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.codeStyle.NameUtil;
+import com.intellij.util.Function;
+
+import java.util.Arrays;
+
+/**
+ * This strategy decapitalizes property name, e.g. getXmlElementName() will correspond to xmlElementName
+ *
+ * @author peter
+ */
+public class JavaNameStrategy extends DomNameStrategy {
+  public static final Function<String,String> DECAPITALIZE_FUNCTION = new Function<String, String>() {
+    public String fun(final String s) {
+      return StringUtil.decapitalize(s);
+    }
+  };
+
+  public final String convertName(String propertyName) {
+    return StringUtil.decapitalize(propertyName);
+  }
+
+  public final String splitIntoWords(final String tagName) {
+    return StringUtil.join(Arrays.asList(NameUtil.nameToWords(tagName)), DECAPITALIZE_FUNCTION, " ");
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/MergedObject.java b/xml/dom-openapi/src/com/intellij/util/xml/MergedObject.java
new file mode 100644
index 0000000..a68ae24
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/MergedObject.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.util.List;
+
+/**
+ * @author peter
+*/
+public interface MergedObject<V> {
+  List<V> getImplementations();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/MergingFileDescription.java b/xml/dom-openapi/src/com/intellij/util/xml/MergingFileDescription.java
new file mode 100644
index 0000000..1dbe3d4
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/MergingFileDescription.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.ArrayUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author peter
+ */
+public abstract class MergingFileDescription<T extends DomElement> extends DomFileDescription<T>{
+  private ModelMerger myMerger;
+
+  protected MergingFileDescription(final Class<T> rootElementClass, @NonNls final String rootTagName) {
+    super(rootElementClass, rootTagName);
+  }
+
+  @NotNull
+  protected abstract Set<XmlFile> getFilesToMerge(DomElement element);
+
+  @NotNull
+  public DomElement getResolveScope(GenericDomValue<?> reference) {
+    final DomElement annotation = getScopeFromAnnotation(reference);
+    if (annotation != null) return annotation;
+
+    final DomFileElement<T> element = DomUtil.getFileElement(reference);
+    return getMergedRoot(element);
+  }
+
+  public final T getMergedRoot(DomFileElement<T> element) {
+    final DomManager domManager = element.getManager();
+
+    XmlFile xmlFile = element.getFile();
+    Set<XmlFile> files = new HashSet<XmlFile>();
+    files.add(xmlFile);
+    final XmlFile originalFile = (XmlFile)xmlFile.getOriginalFile();
+    if (originalFile != xmlFile) {
+      final DomFileElement originalElement = domManager.getFileElement(originalFile);
+      if (originalElement != null) {
+        element = originalElement;
+      }
+    }
+
+    files.addAll(getFilesToMerge(element));
+
+
+    ArrayList<T> roots = new ArrayList<T>(files.size());
+    for (XmlFile file: files) {
+      final DomFileElement<T> fileElement = domManager.getFileElement(file);
+      if (fileElement != null) {
+        roots.add(fileElement.getRootElement());
+      }
+    }
+
+    if (roots.size() == 1) {
+      return roots.iterator().next();
+    }
+
+    if (myMerger == null) {
+      myMerger = DomService.getInstance().createModelMerger();
+    }
+    return myMerger.mergeModels(getRootElementClass(), roots);
+  }
+
+  @NotNull
+  public DomElement getIdentityScope(DomElement element) {
+    final DomElement annotation = getScopeFromAnnotation(element);
+    if (annotation != null) return annotation;
+
+    final List<JavaMethod> methods = DomUtil.getFixedPath(element.getParent());
+    if (methods == null) return super.getIdentityScope(element);
+
+    final DomFileElement<T> root = DomUtil.getFileElement(element);
+    Object o = getMergedRoot(root);
+    for (final JavaMethod method : methods) {
+      o = method.invoke(o, ArrayUtil.EMPTY_OBJECT_ARRAY);
+    }
+    return (DomElement)o;
+  }
+
+  public boolean isAutomaticHighlightingEnabled() {
+    return false;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ModelMerger.java b/xml/dom-openapi/src/com/intellij/util/xml/ModelMerger.java
new file mode 100644
index 0000000..b8f9c97
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ModelMerger.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author peter
+ * @see DomManager#createModelMerger() 
+ */
+public interface ModelMerger {
+  <T> T mergeModels(Class<T> aClass, T... implementations);
+
+  <T> T mergeModels(Class<T> aClass, Collection<? extends T> implementations);
+
+  <T> void addInvocationStrategy(Class<T> aClass, InvocationStrategy<T> strategy);
+
+  <T> void addMergingStrategy(Class<T> aClass, MergingStrategy<T> strategy);
+
+
+  abstract class InvocationStrategy<T> {
+    public abstract boolean accepts(Method method);
+    public abstract Object invokeMethod(JavaMethod method, final T proxy, final Object[] args, List<T> implementations) throws IllegalAccessException,
+                                                                                                        InvocationTargetException;
+  }
+
+  abstract class MergingStrategy<T> {
+    @Nullable
+    public abstract T mergeChildren(Class<T> type, List<T> implementations);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ModelMergerUtil.java b/xml/dom-openapi/src/com/intellij/util/xml/ModelMergerUtil.java
new file mode 100644
index 0000000..07fdd48
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ModelMergerUtil.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.util.Processor;
+import com.intellij.util.CommonProcessors;import com.intellij.util.ReflectionCache;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.*;
+
+/**
+ * @author peter
+ */
+public class ModelMergerUtil {
+
+  @Nullable
+  public static <T> T getFirstImplementation(final T t) {
+    T cur = t;
+    while (cur instanceof MergedObject) {
+      final List<T> implementations = ((MergedObject<T>)cur).getImplementations();
+      cur = implementations.isEmpty()? null : implementations.get(0);
+    }
+    return cur;
+  }
+
+  @Nullable
+  public static <T, V> V getImplementation(final Class<V> clazz, final Collection<T> elements) {
+    for (final T element : elements) {
+      final V implementation = getImplementation(element, clazz);
+      if (implementation != null) {
+        return implementation;
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public static <T, V> V getImplementation(final Class<V> clazz, final T... elements) {
+    return getImplementation(clazz, Arrays.asList(elements));
+  }
+
+  @Nullable
+  public static <T, V> V getImplementation(final T element, final Class<V> clazz) {
+    if (element == null) return null;
+    CommonProcessors.FindFirstProcessor<T> processor = new CommonProcessors.FindFirstProcessor<T>() {
+      public boolean process(final T t) {
+        return !ReflectionCache.isAssignable(clazz, t.getClass()) || super.process(t);
+      }
+    };
+    new ImplementationProcessor<T>(processor, true).process(element);
+    return (V)processor.getFoundValue();
+  }
+
+  @NotNull
+  public static <T, V> Collection<V> getImplementations(final T element, final Class<V> clazz) {
+    if (element == null) return Collections.emptyList();
+    CommonProcessors.CollectProcessor<T> processor = new CommonProcessors.CollectProcessor<T>() {
+      public boolean process(final T t) {
+        return !ReflectionCache.isAssignable(clazz, t.getClass()) || super.process(t);
+      }
+    };
+    new ImplementationProcessor<T>(processor, true).process(element);
+    return (Collection<V>)processor.getResults();
+  }
+
+  @NotNull
+  public static <T> List<T> getImplementations(T element) {
+    if (element instanceof MergedObject) {
+      final MergedObject<T> mergedObject = (MergedObject<T>)element;
+      return mergedObject.getImplementations();
+    }
+    else if (element != null) {
+      return Collections.singletonList(element);
+    }
+    else {
+      return Collections.emptyList();
+    }
+  }
+
+  @NotNull
+  public static <T> List<T> getFilteredImplementations(final T element) {
+    if (element == null) return Collections.emptyList();
+    final CommonProcessors.CollectProcessor<T> processor = new CommonProcessors.CollectProcessor<T>(new ArrayList<T>());
+    new ImplementationProcessor<T>(processor, false).process(element);
+    return (List<T>)processor.getResults();
+  }
+
+  @NotNull
+  public static <T> Processor<T> createFilteringProcessor(final Processor<T> processor) {
+    return new ImplementationProcessor<T>(processor, false);
+  }
+
+  public static class ImplementationProcessor<T> implements Processor<T> {
+    private final Processor<T> myProcessor;
+    private final boolean myProcessMerged;
+
+    public ImplementationProcessor(Processor<T> processor, final boolean processMerged) {
+      myProcessor = processor;
+      myProcessMerged = processMerged;
+    }
+
+    public boolean process(final T t) {
+      final boolean merged = t instanceof MergedObject;
+      if ((!merged || myProcessMerged) && !myProcessor.process(t)) {
+        return false;
+      }
+      if (merged && !ContainerUtil.process(((MergedObject<T>)t).getImplementations(), this)) {
+        return false;
+      }
+      return true;
+    }
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ModuleContentRootSearchScope.java b/xml/dom-openapi/src/com/intellij/util/xml/ModuleContentRootSearchScope.java
new file mode 100644
index 0000000..ad52b8b
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ModuleContentRootSearchScope.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.openapi.roots.ModuleRootManager;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.NotNull;
+
+public class ModuleContentRootSearchScope extends GlobalSearchScope {
+  private final ModuleRootManager myRootManager;
+  private final Module myModule;
+
+  public ModuleContentRootSearchScope(final Module module) {
+    super(module.getProject());
+    myRootManager = ModuleRootManager.getInstance(module);
+    myModule = module;
+  }
+
+  public boolean contains(final VirtualFile file) {
+    return myRootManager.getFileIndex().isInContent(file);
+  }
+
+  public int compare(final VirtualFile file1, final VirtualFile file2) {
+    return 0;
+  }
+
+  public boolean isSearchInModuleContent(@NotNull final Module aModule) {
+    return aModule == myModule;
+  }
+
+  public boolean isSearchInLibraries() {
+    return false;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/MutableGenericValue.java b/xml/dom-openapi/src/com/intellij/util/xml/MutableGenericValue.java
new file mode 100644
index 0000000..7197fdc
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/MutableGenericValue.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+/**
+ * @author Gregory.Shrago
+ */
+public interface MutableGenericValue<T> extends GenericValue<T> {
+
+  void setStringValue(String value);
+
+  void setValue(T value);
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/NameStrategy.java b/xml/dom-openapi/src/com/intellij/util/xml/NameStrategy.java
new file mode 100644
index 0000000..b6d29f7
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/NameStrategy.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * Specifies name strategy (see {@link com.intellij.util.xml.DomNameStrategy}) for this type and its subtree in XML
+ *
+ * @author peter
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface NameStrategy {
+  Class<? extends DomNameStrategy> value();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/NameStrategyForAttributes.java b/xml/dom-openapi/src/com/intellij/util/xml/NameStrategyForAttributes.java
new file mode 100644
index 0000000..de57f21
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/NameStrategyForAttributes.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * Sets separate naming convention for XML attributes
+ *
+ * @see NameStrategy
+ * @see GenericAttributeValue
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface NameStrategyForAttributes {
+  Class<? extends DomNameStrategy> value();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/NameValue.java b/xml/dom-openapi/src/com/intellij/util/xml/NameValue.java
new file mode 100644
index 0000000..c531917
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/NameValue.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Annotate a method returning either {@link String} or {@link com.intellij.util.xml.GenericValue} with @NameValue,
+ * and {@link com.intellij.util.xml.ElementPresentationManager#getElementName(Object)} will return the resulting String
+ * or {@link GenericValue#getStringValue()}.
+ *
+ * @author peter
+ */
+@Retention(RetentionPolicy.RUNTIME)
+public @interface NameValue {
+  /**
+   * @return whether the element's name should be unique in some scope ({@link com.intellij.util.xml.DomFileDescription#getIdentityScope(DomElement)}).
+   * If true, then duplicate values will be highlighted as errors.
+   */
+  boolean unique() default true;
+
+  /**
+   * @return Only usable if the annotated method returns {@link com.intellij.util.xml.GenericDomValue}<Something>.
+   * Then this flag controls, whether a reference should be created from the @NameValue child XML element to
+   * the XML element of the annotated DOM element. Such reference is useful in rename refactoring to act as
+   * an element's declaration.
+   */
+  boolean referencable() default true;
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/NamedEnum.java b/xml/dom-openapi/src/com/intellij/util/xml/NamedEnum.java
new file mode 100644
index 0000000..ea13fa9
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/NamedEnum.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+/**
+ * Wraps enumeration with value used in XML.
+ *
+ * @author peter
+ */
+public interface NamedEnum {
+  String getValue();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/NamedEnumUtil.java b/xml/dom-openapi/src/com/intellij/util/xml/NamedEnumUtil.java
new file mode 100644
index 0000000..060a7a5
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/NamedEnumUtil.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.util.Function;
+import com.intellij.util.ReflectionCache;
+import com.intellij.openapi.util.Comparing;
+
+/**
+ * @author peter
+ */
+public class NamedEnumUtil {
+  private static final Function<Enum, String> NAMED_SHOW = new Function<Enum, String>() {
+    public String fun(final Enum s) {
+      return ((NamedEnum) s).getValue();
+    }
+  };
+  private static final Function<Enum, String> SIMPLE_SHOW = new Function<Enum, String>() {
+    public String fun(final Enum s) {
+      return s.name();
+    }
+  };
+  
+  public static <T extends Enum> T getEnumElementByValue(final Class<T> enumClass, final String value, Function<Enum, String> show) {
+    for (final T t : enumClass.getEnumConstants()) {
+      if (Comparing.equal(value, show.fun(t))) {
+        return t;
+      }
+    }
+    return null;
+  }
+  public static <T extends Enum> T getEnumElementByValue(final Class<T> enumClass, final String value) {
+    return getEnumElementByValue(enumClass, value, getShow(enumClass));
+  }
+
+  private static <T extends Enum> Function<Enum, String> getShow(final Class<T> enumClass) {
+    return ReflectionCache.isAssignable(NamedEnum.class, enumClass) ? NAMED_SHOW : SIMPLE_SHOW;
+  }
+
+  public static <T extends Enum> String getEnumValueByElement(final T element) {
+    return element == null ? null : getShow(element.getClass()).fun(element);
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/Namespace.java b/xml/dom-openapi/src/com/intellij/util/xml/Namespace.java
new file mode 100644
index 0000000..98e862f
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/Namespace.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author peter
+ * @see com.intellij.util.xml.DomFileDescription#getAllowedNamespaces(String, com.intellij.psi.xml.XmlFile)
+ * @see com.intellij.util.xml.DomFileDescription#registerNamespacePolicy(String, String...)
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface Namespace {
+  /**
+   * @return logical namespace identifier
+   */
+  String value();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ParentScopeProvider.java b/xml/dom-openapi/src/com/intellij/util/xml/ParentScopeProvider.java
new file mode 100644
index 0000000..c84fa31
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ParentScopeProvider.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+/**
+ * @author peter
+ */
+public class ParentScopeProvider extends ScopeProvider{
+  public DomElement getScope(DomElement element) {
+    return element.getParent();
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/PrimaryKey.java b/xml/dom-openapi/src/com/intellij/util/xml/PrimaryKey.java
new file mode 100644
index 0000000..2ef451e
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/PrimaryKey.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * Annotates 'primary key' methods. Elements whose primary key methods return the same
+ * will be merged together in collection getters of elements merged with {@link com.intellij.util.xml.ModelMerger} 
+ *
+ * @author peter
+ */
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface PrimaryKey {
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/PropertyAccessor.java b/xml/dom-openapi/src/com/intellij/util/xml/PropertyAccessor.java
new file mode 100644
index 0000000..9addb59
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/PropertyAccessor.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates DOM methods that are shortcuts to long call chains. For example, if you often need
+ * to write getFoo().getBar().getZip(), you can instead create a method getFBZ() and annotate it
+ * with @PropertyAccessor({"foo", "bar", "zip"}).
+ *
+ * @author peter
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface PropertyAccessor {
+  /**
+   * @return list of property names corresponding to methods you want to replace calls to
+   */
+  String[] value();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/Referencing.java b/xml/dom-openapi/src/com/intellij/util/xml/Referencing.java
new file mode 100644
index 0000000..e472f08
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/Referencing.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * @author Dmitry Avdeev
+ *
+ * @see com.intellij.util.xml.CustomReferenceConverter
+ * @see com.intellij.util.xml.Convert
+ */
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Referencing {
+
+  Class<? extends CustomReferenceConverter> value();
+
+  /**
+   * @return whether the corresponding XML reference to be soft. Soft references are not highlighted as errors, if unresolved.
+   */
+  boolean soft() default false;
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/Required.java b/xml/dom-openapi/src/com/intellij/util/xml/Required.java
new file mode 100644
index 0000000..fda53fe
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/Required.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Specifies that the annotated method return value ({@link DomElement}) should have
+ * a non-null XML element under itself. And some other connected properties.
+ *
+ * @author peter
+ */
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Required {
+  /**
+   * @return whether the annotated method return value ({@link DomElement}) should have
+   * a non-null XML element under itself.
+   */
+  boolean value() default true;
+
+  /**
+   * @return whether the annotated method return value ({@link com.intellij.util.xml.GenericDomValue})
+   * should have non-empty value: {@link GenericDomValue#getStringValue()} != null
+   */
+  boolean nonEmpty() default true;
+
+  /**
+   * @return whether the annotated method return value ({@link com.intellij.util.xml.GenericDomValue})
+   * string value should be identifier: {@link GenericDomValue#getStringValue()}.
+   *
+   * @see com.intellij.psi.PsiNameHelper#isIdentifier(String)
+   */
+  boolean identifier() default false;
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/Resolve.java b/xml/dom-openapi/src/com/intellij/util/xml/Resolve.java
new file mode 100644
index 0000000..1f0936b
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/Resolve.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * A special case of {@link com.intellij.util.xml.Convert} annotation, used to convert
+ * {@link com.intellij.util.xml.DomElement} instances to and from string. Converter here is an
+ * instance of {@link com.intellij.util.xml.DomResolveConverter}.
+ * Uses {@link com.intellij.util.xml.NameValue} annotation to retrieve the DOM element's name.
+ *
+ * @author peter
+ */
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Resolve {
+  /**
+   * @return Class of target element. May be omitted, then the class from the annotated method return type is taken
+   */
+  Class<? extends DomElement> value() default DomElement.class;
+
+  /**
+   * @return whether the corresponding XML reference to be soft. Soft references are not highlighted as errors, if unresolved.
+   */
+  boolean soft() default false;
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ResolvingConverter.java b/xml/dom-openapi/src/com/intellij/util/xml/ResolvingConverter.java
new file mode 100644
index 0000000..f6aa635
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ResolvingConverter.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.codeInsight.CodeInsightBundle;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ * If converter extends this class, the corresponding XML {@link com.intellij.psi.PsiReference}
+ * will take completion variants from {@link #getVariants(ConvertContext)} method.
+ *
+ * @author peter
+ */
+public abstract class ResolvingConverter<T> extends Converter<T> {
+  @Deprecated
+  public static final ResolvingConverter EMPTY_CONVERTER = new ResolvingConverter() {
+    @NotNull
+    public Collection getVariants(final ConvertContext context) {
+      return Collections.emptyList();
+    }
+
+    public Object fromString(final String s, final ConvertContext context) {
+      return s;
+    }
+
+    public String toString(final Object t, final ConvertContext context) {
+      return String.valueOf(t);
+    }
+  };
+
+  /** @see com.intellij.util.xml.converters.values.BooleanValueConverter */
+  @Deprecated
+  public static final Converter<Boolean> BOOLEAN_CONVERTER = new ResolvingConverter<Boolean>() {
+    public Boolean fromString(final String s, final ConvertContext context) {
+      if ("true".equalsIgnoreCase(s)) {
+        return Boolean.TRUE;
+      }
+      if ("false".equalsIgnoreCase(s)) {
+        return Boolean.FALSE;
+      }
+      return null;
+    }
+
+    public String toString(final Boolean t, final ConvertContext context) {
+      return t == null? null:t.toString();
+    }
+
+    @NotNull
+    public Collection<? extends Boolean> getVariants(final ConvertContext context) {
+      final DomElement element = context.getInvocationElement();
+      if (element instanceof GenericDomValue) {
+        final SubTag annotation = element.getAnnotation(SubTag.class);
+        if (annotation != null && annotation.indicator()) return Collections.emptyList();
+      }
+
+      return Arrays.asList(Boolean.FALSE, Boolean.TRUE);
+    }
+  };
+
+  public String getErrorMessage(@Nullable String s, final ConvertContext context) {
+    return CodeInsightBundle.message("error.cannot.resolve.default.message", s);
+  }
+
+  /**
+   * @param context context
+   * @return reference completion variants
+   */
+  @NotNull
+  public abstract Collection<? extends T> getVariants(final ConvertContext context);
+
+  /**
+   * @return additional reference variants. They won't resolve to anywhere, but won't be highlighted as errors.
+   * They will also appear in the completion dropdown.
+   */
+  @Deprecated
+  @NotNull
+  public Set<String> getAdditionalVariants() {
+    return Collections.emptySet();
+  }
+  /**
+   * @return additional reference variants. They won't resolve to anywhere, but won't be highlighted as errors.
+   * They will also appear in the completion dropdown.
+   */
+  @NotNull
+  public Set<String> getAdditionalVariants(@NotNull final ConvertContext context) {
+    return getAdditionalVariants();
+  }
+
+  /**
+   * Delegate from {@link com.intellij.psi.PsiReference#handleElementRename(String)}
+   * @param genericValue generic value
+   * @param context context
+   * @param newElementName new element name
+   */
+  public void handleElementRename(final GenericDomValue<T> genericValue, final ConvertContext context,
+                                  final String newElementName) {
+    genericValue.setStringValue(newElementName);
+  }
+
+  /**
+   * Delegate from {@link com.intellij.psi.PsiReference#bindToElement(com.intellij.psi.PsiElement)}
+   * @param genericValue generic value
+   * @param context context
+   * @param newTarget new target
+   */
+  public void bindReference(final GenericDomValue<T> genericValue, final ConvertContext context, final PsiElement newTarget) {
+    if (newTarget instanceof XmlTag) {
+      DomElement domElement = genericValue.getManager().getDomElement((XmlTag) newTarget);
+      if (domElement != null) {
+        genericValue.setStringValue(ElementPresentationManager.getElementName(domElement));
+      }
+    }
+  }
+
+  /**
+   * @param resolvedValue {@link #fromString(String, ConvertContext)} result
+   * @return the PSI element to which the {@link com.intellij.psi.PsiReference} will resolve
+   */
+  @Nullable
+  public PsiElement getPsiElement(@Nullable T resolvedValue) {
+    if (resolvedValue instanceof PsiElement) {
+      return (PsiElement)resolvedValue;
+    }
+    if (resolvedValue instanceof DomElement) {
+      return ((DomElement)resolvedValue).getXmlElement();
+    }
+    return null;
+  }
+
+  /**
+   * Delegate from {@link com.intellij.psi.PsiReference#isReferenceTo(com.intellij.psi.PsiElement)}
+   * @param element element
+   * @param stringValue string value
+   * @param resolveResult resolve result
+   * @param context context
+   * @return is reference to?
+   */
+  public boolean isReferenceTo(@NotNull PsiElement element, final String stringValue, @Nullable T resolveResult,
+                               final ConvertContext context) {
+    return resolveResult != null && element.getManager().areElementsEquivalent(element, getPsiElement(resolveResult));
+  }
+
+  /**
+   * Delegate from {@link com.intellij.psi.PsiReference#resolve()}
+   * @param o {@link #fromString(String, ConvertContext)} result
+   * @param context context
+   * @return PSI element to resolve to. By default calls {@link #getPsiElement(Object)} method
+   */
+  @Nullable
+  public PsiElement resolve(final T o, final ConvertContext context) {
+    final PsiElement psiElement = getPsiElement(o);
+    return psiElement == null && o != null ? DomUtil.getValueElement((GenericDomValue)context.getInvocationElement()) : psiElement;
+  }
+
+  /**
+   * @param context context
+   * @return LocalQuickFix'es to correct non-resolved value (e.g. 'create from usage')
+   */
+  public LocalQuickFix[] getQuickFixes(final ConvertContext context) {
+    return LocalQuickFix.EMPTY_ARRAY;
+  }
+
+  /**
+   * Override to provide custom lookup elements in completion.
+   * <p/>
+   * Default is {@code null} which will create lookup via
+   * {@link ElementPresentationManager#createVariant(java.lang.Object, java.lang.String, com.intellij.psi.PsiElement)}.
+   *
+   * @param t DOM to create lookup element for.
+   * @return Lookup element.
+   */
+  @Nullable
+  public LookupElement createLookupElement(T t) {
+    return null;
+  }
+
+  /**
+   * Adds {@link #getVariants(ConvertContext)} functionality to a simple String value.
+   */
+  public static abstract class StringConverter extends ResolvingConverter<String> {
+
+    public String fromString(final String s, final ConvertContext context) {
+      return s;
+    }
+
+    public String toString(final String s, final ConvertContext context) {
+      return s;
+    }
+  }
+
+  /**
+   * Adds {@link #getVariants(ConvertContext)} functionality to an existing converter. 
+   */
+  public static abstract class WrappedResolvingConverter<T> extends ResolvingConverter<T> {
+
+    private final Converter<T> myWrappedConverter;
+
+    public WrappedResolvingConverter(Converter<T> converter) {
+
+      myWrappedConverter = converter;
+    }
+
+    public T fromString(final String s, final ConvertContext context) {
+      return myWrappedConverter.fromString(s, context);
+    }
+
+    public String toString(final T t, final ConvertContext context) {
+      return myWrappedConverter.toString(t, context);
+    }
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/RootScopeProvider.java b/xml/dom-openapi/src/com/intellij/util/xml/RootScopeProvider.java
new file mode 100644
index 0000000..79e1923
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/RootScopeProvider.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class RootScopeProvider extends ScopeProvider{
+
+  public DomElement getScope(@NotNull DomElement element) {
+    return DomUtil.getRoot(element);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/Scope.java b/xml/dom-openapi/src/com/intellij/util/xml/Scope.java
new file mode 100644
index 0000000..b4f0bca
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/Scope.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * {@link com.intellij.util.xml.DomFileDescription#getIdentityScope(DomElement)} and
+ * {@link com.intellij.util.xml.DomFileDescription#getResolveScope(GenericDomValue)}
+ * use this annotation first to get the corresponding scopes.
+ *
+ * @author peter
+ */
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Scope {
+  Class<? extends ScopeProvider> value();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ScopeProvider.java b/xml/dom-openapi/src/com/intellij/util/xml/ScopeProvider.java
new file mode 100644
index 0000000..2758132
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ScopeProvider.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Should be stateless, since its instances are cached.
+ * @author peter
+ * @see Scope
+ */
+public abstract class ScopeProvider {
+
+  /**
+   * @param element element
+   * @return scope to search within.
+   * For uniqueness checking should return element, whose direct children names will be compared.
+   * Basically it's parameter element's parent: {@link ParentScopeProvider}.
+   * Searches within all children of returned element.
+   */
+  @Nullable
+  public abstract DomElement getScope(@NotNull DomElement element);
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/StableElement.java b/xml/dom-openapi/src/com/intellij/util/xml/StableElement.java
new file mode 100644
index 0000000..88e409d
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/StableElement.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+/**
+ * @author peter
+ */
+public interface StableElement<T> {
+  void revalidate();
+  void invalidate();
+  T getWrappedElement();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/Stubbed.java b/xml/dom-openapi/src/com/intellij/util/xml/Stubbed.java
new file mode 100644
index 0000000..95d73a4
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/Stubbed.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = {ElementType.METHOD, ElementType.TYPE})
+public @interface Stubbed {
+
+  boolean stubAllAttributes() default false;
+}
\ No newline at end of file
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/SubTag.java b/xml/dom-openapi/src/com/intellij/util/xml/SubTag.java
new file mode 100644
index 0000000..778ee56
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/SubTag.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates DOM attribute children getters, that should return {@link DomElement}.
+ * The getters may be annotated with {@link com.intellij.util.xml.Convert} annotation, if it returns {@link GenericDomValue} inheritor.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface SubTag {
+  /**
+   * @return child XML tag name if it can't be inferred from the getter name (see {@link com.intellij.util.xml.NameStrategy})
+   */
+  String value() default "";
+
+  /**
+   * @return if there are several child XML tags with the same name (e.g. always 2), the number of the child tag we should deal with
+   */
+  int index() default 0;
+
+  /**
+   * @return for methods returning {@link com.intellij.util.xml.GenericDomValue}<{@link Boolean}>, defines, whether the Boolean.TRUE should
+   * correspond just to empty tag existence, and Boolean.FALSE - to non-existence. {@link #index()} should be always 0 in such a case.
+   */
+  boolean indicator() default false;
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/SubTagList.java b/xml/dom-openapi/src/com/intellij/util/xml/SubTagList.java
new file mode 100644
index 0000000..059bf52
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/SubTagList.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * Annotates a collection children getter, which should return generic {@link java.util.Collection} or {@link java.util.List}. 
+ *
+ * @author peter
+ */
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface SubTagList {
+
+  /**
+   * @return child XML tag name if it can't be inferred from the getter name (see {@link com.intellij.util.xml.NameStrategy})
+   */
+  String value() default "";
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/SubTagsList.java b/xml/dom-openapi/src/com/intellij/util/xml/SubTagsList.java
new file mode 100644
index 0000000..30e8599
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/SubTagsList.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * If you have several {@link com.intellij.util.xml.SubTagList} collections and you need to access them all at once, this
+  annotation will help. "value" property will hold the array of possible subtag names. One should have different
+  addition methods for each subtag name, each returning its own DomElement type, each may have an "index" parameter.
+  The element will be inserted in proper place in the "merged" collection, allowing you to mix elements of different
+  types (if Schema or DTD allows).
+ *
+ * @author peter
+ */
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface SubTagsList {
+  String[] value();
+  String tagName() default "";
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/TagValue.java b/xml/dom-openapi/src/com/intellij/util/xml/TagValue.java
new file mode 100644
index 0000000..1dd245b
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/TagValue.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * Annotates DOM XML tag or attribute value getters. The getters may be annotated with {@link com.intellij.util.xml.Convert} annotation.  
+ *
+ * @author peter
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface TagValue {
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/TypeChooser.java b/xml/dom-openapi/src/com/intellij/util/xml/TypeChooser.java
new file mode 100644
index 0000000..32b322d
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/TypeChooser.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+
+import java.lang.reflect.Type;
+
+/**
+ * @author peter
+ */
+public abstract class TypeChooser {
+  public abstract Type chooseType(XmlTag tag);
+  public abstract void distinguishTag(XmlTag tag, Type aClass) throws IncorrectOperationException;
+  public abstract Type[] getChooserTypes();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/TypeChooserManager.java b/xml/dom-openapi/src/com/intellij/util/xml/TypeChooserManager.java
new file mode 100644
index 0000000..5086052
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/TypeChooserManager.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.xml.XmlTag;
+
+import java.lang.reflect.Type;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * @author peter
+ */
+public class TypeChooserManager {
+  private final Map<Type, TypeChooser> myClassChoosers = new ConcurrentHashMap<Type, TypeChooser>();
+
+  public TypeChooser getTypeChooser(final Type type) {
+    final TypeChooser typeChooser = myClassChoosers.get(type);
+    return typeChooser != null ? typeChooser : new TypeChooser() {
+      public Type chooseType(final XmlTag tag) {
+        return type;
+      }
+
+      public void distinguishTag(final XmlTag tag, final Type aClass) {
+      }
+
+      public Type[] getChooserTypes() {
+        return new Type[]{type};
+      }
+    };
+  }
+
+  public void registerTypeChooser(final Type aClass, final TypeChooser typeChooser) {
+    myClassChoosers.put(aClass, typeChooser);
+  }
+
+  public void unregisterTypeChooser(Type aClass) {
+    myClassChoosers.remove(aClass);
+  }
+
+  public final void copyFrom(TypeChooserManager manager) {
+    myClassChoosers.putAll(manager.myClassChoosers);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/WrappingConverter.java b/xml/dom-openapi/src/com/intellij/util/xml/WrappingConverter.java
new file mode 100644
index 0000000..c80c89b
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/WrappingConverter.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml;
+
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Allows run-time choosing of {@link Converter}.
+ *
+ * @author Gregory.Shrago
+ */
+public abstract class WrappingConverter extends Converter<Object> {
+
+  public Object fromString(@Nullable @NonNls String s, final ConvertContext context) {
+    final List<Converter> converters = getConverters((GenericDomValue)context.getInvocationElement());
+    if (converters.isEmpty()) return s;
+    for (Converter converter : converters) {
+      final Object o = converter.fromString(s, context);
+      if (o != null) {
+        return o;
+      }
+    }
+    return null;
+  }
+
+  public String toString(@Nullable Object t, final ConvertContext context) {
+    final List<Converter> converters = getConverters((GenericDomValue)context.getInvocationElement());
+    if (converters.isEmpty()) return String.valueOf(t);
+    for (Converter converter : converters) {
+      final String s = converter.toString(t, context);
+      if (s != null) {
+        return s;
+      }
+    }
+    return null;
+  }
+
+  @NotNull
+  public List<Converter> getConverters(@NotNull final GenericDomValue domElement) {
+    final Converter converter = getConverter(domElement);
+    return converter == null ? Collections.<Converter>emptyList() : Collections.singletonList(converter);
+  }
+
+  @Nullable
+  public abstract Converter getConverter(@NotNull final GenericDomValue domElement);
+
+  public static Converter getDeepestConverter(final Converter converter, final GenericDomValue domValue) {
+    Converter cur = converter;
+    Converter next;
+    int guard = 0;
+    while (cur instanceof WrappingConverter) {
+      next = ((WrappingConverter)cur).getConverter(domValue);
+      if (next == null) break;
+      cur = next;
+      if (guard++ > 10) {
+        throw new RuntimeException("Too deep wrapping for " + converter);
+      }
+    }
+    return cur;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/XmlName.java b/xml/dom-openapi/src/com/intellij/util/xml/XmlName.java
new file mode 100644
index 0000000..a3a562e
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/XmlName.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.util.Comparing;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public class XmlName implements Comparable<XmlName> {
+  private final String myLocalName;
+  private final String myNamespaceKey;
+
+  private final int myHashCode;
+
+  public XmlName(@NotNull @NonNls final String localName) {
+    this(localName, null);
+  }
+
+  public XmlName(@NotNull @NonNls final String localName, @Nullable final String namespaceKey) {
+    myLocalName = localName;
+    myNamespaceKey = namespaceKey;
+
+    myHashCode = 31 * myLocalName.hashCode() + (myNamespaceKey != null ? myNamespaceKey.hashCode() : 0);
+  }
+
+  @NotNull
+  public final String getLocalName() {
+    return myLocalName;
+  }
+
+  @Nullable
+  public final String getNamespaceKey() {
+    return myNamespaceKey;
+  }
+
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    final XmlName xmlName = (XmlName)o;
+
+    if (!myLocalName.equals(xmlName.myLocalName)) return false;
+    if (Comparing.equal(myNamespaceKey, xmlName.myNamespaceKey)) return true;
+
+    if (myNamespaceKey != null ? !myNamespaceKey.equals(xmlName.myNamespaceKey) : xmlName.myNamespaceKey != null) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    return myHashCode;
+  }
+
+
+  public int compareTo(XmlName o) {
+    final int i = myLocalName.compareTo(o.myLocalName);
+    if (i != 0) {
+      return i;
+    }
+    return Comparing.compare(myNamespaceKey, o.myNamespaceKey);
+  }
+
+  public String toString() {
+    return myNamespaceKey + " : " + myLocalName;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/actions/generate/AbstractDomGenerateProvider.java b/xml/dom-openapi/src/com/intellij/util/xml/actions/generate/AbstractDomGenerateProvider.java
new file mode 100644
index 0000000..769d848
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/actions/generate/AbstractDomGenerateProvider.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.actions.generate;
+
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.codeStyle.NameUtil;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.containers.HashMap;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomElementNavigationProvider;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.Map;
+
+
+public abstract class AbstractDomGenerateProvider<T extends DomElement> extends DefaultGenerateElementProvider<T> {
+  public static final String NAMESPACE_PREFIX_VAR = "NS_PREFIX";
+
+  @Nullable private final String myMappingId;
+
+  public AbstractDomGenerateProvider(final String description, final Class<T> aClass) {
+    this(description, aClass, null);
+  }
+
+  public AbstractDomGenerateProvider(final String description, final Class<T> aClass, @Nullable String mappingId) {
+    super(description, aClass);
+    myMappingId = mappingId;
+  }
+
+  public T generate(final Project project, final Editor editor, final PsiFile file) {
+    DomElement parentDomElement = getParentDomElement(project, editor, file);
+
+    final T t = generate(parentDomElement, editor);
+
+    runTemplate(editor, file, t, getPredefinedVars(parentDomElement, t, editor, file));
+
+    return t;
+  }
+
+  protected Map<String, String> getPredefinedVars(@Nullable DomElement parentDomElement,
+                                                  @Nullable T t,
+                                                  @NotNull Editor editor,
+                                                  @NotNull PsiFile file) {
+    return createNamespacePrefixMap(parentDomElement);
+  }
+
+  @NotNull
+  public static Map<String, String> createNamespacePrefixMap(@Nullable DomElement domElement) {
+    Map<String, String> vars = new HashMap<String, String>();
+
+    addNamespacePrefix(domElement, vars);
+
+    return vars;
+  }
+
+  public static void addNamespacePrefix(@Nullable DomElement domElement, @NotNull Map<String, String> vars) {
+    if (domElement != null) {
+      XmlTag tag = domElement.getXmlTag();
+      if (tag != null) {
+        String namespacePrefix = tag.getNamespacePrefix();
+        if (!StringUtil.isEmptyOrSpaces(namespacePrefix)) {
+          vars.put(NAMESPACE_PREFIX_VAR, namespacePrefix + ":");
+        }
+      }
+    }
+  }
+
+  protected void runTemplate(final Editor editor, final PsiFile file, final T t, Map<String, String> predefinedVars) {
+    DomTemplateRunner.getInstance(file.getProject()).runTemplate(t, myMappingId, editor, predefinedVars);
+  }
+
+  protected abstract DomElement getParentDomElement(final Project project, final Editor editor, final PsiFile file);
+
+  @SuppressWarnings({"unchecked"})
+  protected void doNavigate(final DomElementNavigationProvider navigateProvider, final DomElement copy) {
+    final DomElement element = getElementToNavigate((T)copy);
+    if (element != null) {
+      super.doNavigate(navigateProvider, element);
+    }
+  }
+
+  @Nullable
+  protected DomElement getElementToNavigate(final T t) {
+    return t;
+  }
+
+  protected static String getDescription(final Class<? extends DomElement> aClass) {
+    return StringUtil.join(Arrays.asList(NameUtil.nameToWords(aClass.getSimpleName())), " ");
+  }
+
+  @Nullable
+  public String getMappingId() {
+    return myMappingId;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/actions/generate/DefaultGenerateElementProvider.java b/xml/dom-openapi/src/com/intellij/util/xml/actions/generate/DefaultGenerateElementProvider.java
new file mode 100644
index 0000000..a14ad68
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/actions/generate/DefaultGenerateElementProvider.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.actions.generate;
+
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import com.intellij.util.xml.ui.actions.generate.GenerateDomElementProvider;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public abstract class DefaultGenerateElementProvider<T extends DomElement> extends GenerateDomElementProvider<T> {
+  private final Class<T> myChildElementClass;
+
+  public DefaultGenerateElementProvider(final String name, Class<T> childElementClass) {
+    super(name);
+
+    myChildElementClass = childElementClass;
+  }
+
+
+  @Nullable
+  public T generate(final Project project, final Editor editor, final PsiFile file) {
+    return generate(getParentDomElement(project, editor, file), editor);
+  }
+
+  @Nullable
+  protected abstract DomElement getParentDomElement(final Project project, final Editor editor, final PsiFile file);
+
+  @SuppressWarnings({"unchecked"})
+  @Nullable
+  public T generate(@Nullable final DomElement parent, final Editor editor) {
+    if (parent == null) {
+      return null;
+    }
+
+    final List<? extends DomCollectionChildDescription> list = parent.getGenericInfo().getCollectionChildrenDescriptions();
+
+    for (DomCollectionChildDescription childDescription : list) {
+      if (ReflectionUtil.getRawType(childDescription.getType()).isAssignableFrom(myChildElementClass)) {
+
+        XmlTag parentTag = parent.getXmlTag();
+        if (editor != null && parentTag != null) {
+          int offset = editor.getCaretModel().getOffset();
+          PsiFile file = parentTag.getContainingFile();
+          PsiElement psiElement = file.findElementAt(offset);
+
+          if (psiElement instanceof PsiWhiteSpace && PsiTreeUtil.isAncestor(parentTag, psiElement, false)) {
+              Document document = editor.getDocument();
+            XmlTag childTag = parentTag.createChildTag(childDescription.getXmlElementName(), null, null, true);
+            String text = childTag.getText();
+            document.insertString(offset, text);
+            Project project = editor.getProject();
+            assert project != null;
+            PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
+            documentManager.commitDocument(document);
+            PsiElement element = file.findElementAt(offset + 1);
+            T domElement = DomUtil.findDomElement(element, myChildElementClass);
+            if (domElement != null) return domElement;
+            document.deleteString(offset, offset + text.length());
+            documentManager.commitDocument(document);
+          }
+        }
+
+        int index = getCollectionIndex(parent, childDescription, editor);
+
+        return index < 0
+               ? (T)childDescription.addValue(parent, myChildElementClass)
+               : (T)childDescription.addValue(parent, myChildElementClass, index);
+      }
+    }
+    return null;
+  }
+
+  private static int getCollectionIndex(final DomElement parent,
+                                        final DomCollectionChildDescription childDescription,
+                                        final Editor editor) {
+    int offset = editor.getCaretModel().getOffset();
+
+    for (int i = 0; i < childDescription.getValues(parent).size(); i++) {
+      DomElement element = childDescription.getValues(parent).get(i);
+      XmlElement xmlElement = element.getXmlElement();
+      if (xmlElement != null && xmlElement.getTextRange().getStartOffset() >= offset) {
+        return i;
+      }
+    }
+
+    return -1;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/actions/generate/DomTemplateRunner.java b/xml/dom-openapi/src/com/intellij/util/xml/actions/generate/DomTemplateRunner.java
new file mode 100644
index 0000000..0e28255
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/actions/generate/DomTemplateRunner.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.actions.generate;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.util.xml.DomElement;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Map;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public abstract class DomTemplateRunner {
+
+  public static DomTemplateRunner getInstance(Project project) {
+    return ServiceManager.getService(project, DomTemplateRunner.class);
+  }
+  
+  public abstract <T extends DomElement> void  runTemplate(final T t, final String mappingId, final Editor editor);
+
+  public abstract <T extends DomElement> void  runTemplate(final T t, final String mappingId, final Editor editor,@NotNull Map<String, String> predefinedVars);
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/converters/DelimitedListConverter.java b/xml/dom-openapi/src/com/intellij/util/xml/converters/DelimitedListConverter.java
new file mode 100644
index 0000000..e8b12e6
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/converters/DelimitedListConverter.java
@@ -0,0 +1,264 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: Sergey.Vasiliev
+ * Date: Nov 13, 2006
+ * Time: 4:37:22 PM
+ */
+package com.intellij.util.xml.converters;
+
+import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
+import com.intellij.openapi.util.Ref;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiReferenceBase;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.Function;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.ConvertContext;
+import com.intellij.util.xml.CustomReferenceConverter;
+import com.intellij.util.xml.GenericDomValue;
+import com.intellij.util.xml.ResolvingConverter;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+public abstract class DelimitedListConverter<T> extends ResolvingConverter<List<T>> implements CustomReferenceConverter<List<T>> {
+
+  protected final static Object[] EMPTY_ARRAY = ArrayUtil.EMPTY_OBJECT_ARRAY;
+
+  private final String myDelimiters;
+
+  public DelimitedListConverter(@NonNls @NotNull String delimiters) {
+
+    myDelimiters = delimiters;
+  }
+
+  @Nullable
+  protected abstract T convertString(final @Nullable String string, final ConvertContext context);
+
+  @Nullable
+  protected abstract String toString(@Nullable final T t);
+
+
+  protected abstract Object[] getReferenceVariants(final ConvertContext context, GenericDomValue<List<T>> genericDomValue);
+
+  @Nullable
+  protected abstract PsiElement resolveReference(@Nullable final T t, final ConvertContext context);
+
+  protected abstract String getUnresolvedMessage(String value);
+
+  @NotNull
+  public Collection<? extends List<T>> getVariants(final ConvertContext context) {
+    return Collections.emptyList();
+  }
+
+  public static <T> void filterVariants(List<T> variants, GenericDomValue<List<T>> genericDomValue) {
+    final List<T> list = genericDomValue.getValue();
+    if (list != null) {
+      for (Iterator<T> i = variants.iterator(); i.hasNext();) {
+        final T variant = i.next();
+        for (T existing : list) {
+          if (existing.equals(variant)) {
+            i.remove();
+            break;
+          }
+        }
+      }
+    }
+  }
+
+  protected char getDefaultDelimiter() {
+    return myDelimiters.charAt(0);
+  }
+
+  public List<T> fromString(@Nullable final String str, final ConvertContext context) {
+    if (str == null) {
+      return null;
+    }
+    List<T> values = new ArrayList<T>();
+
+    for (String s : StringUtil.tokenize(str, myDelimiters)) {
+      final T t = convertString(s.trim(), context);
+      if (t != null) {
+        values.add(t);
+      }
+    }
+    return values;
+  }
+
+  public String toString(final List<T> ts, final ConvertContext context) {
+    final StringBuffer buffer = new StringBuffer();
+    final char delimiter = getDefaultDelimiter();
+    for (T t : ts) {
+      final String s = toString(t);
+      if (s != null) {
+        if (buffer.length() != 0) {
+          buffer.append(delimiter);
+        }
+        buffer.append(s);
+      }
+    }
+    return buffer.toString();
+  }
+
+  @NotNull
+  public PsiReference[] createReferences(final GenericDomValue<List<T>> genericDomValue,
+                                         final PsiElement element,
+                                         final ConvertContext context) {
+
+    final String text = genericDomValue.getStringValue();
+    if (text == null) {
+      return PsiReference.EMPTY_ARRAY;
+    }
+
+    final ArrayList<PsiReference> references = new ArrayList<PsiReference>();
+    new DelimitedListProcessor(myDelimiters) {
+      protected void processToken(final int start, final int end, final boolean delimitersOnly) {
+        references.add(createPsiReference(element, start + 1, end + 1, context, genericDomValue, delimitersOnly));
+      }
+    }.processText(text);
+    return references.toArray(new PsiReference[references.size()]);
+  }
+
+  @NotNull
+  protected PsiReference createPsiReference(final PsiElement element,
+                                            int start,
+                                            int end,
+                                            final ConvertContext context,
+                                            final GenericDomValue<List<T>> genericDomValue,
+                                            final boolean delimitersOnly) {
+
+    return new MyPsiReference(element, new TextRange(start, end), context, genericDomValue, delimitersOnly);
+  }
+
+  protected class MyPsiReference extends PsiReferenceBase<PsiElement> implements EmptyResolveMessageProvider {
+    protected final ConvertContext myContext;
+    protected final GenericDomValue<List<T>> myGenericDomValue;
+    private final boolean myDelimitersOnly;
+
+    public MyPsiReference(final PsiElement element,
+                          final TextRange range,
+                          final ConvertContext context,
+                          final GenericDomValue<List<T>> genericDomValue,
+                          final boolean delimitersOnly) {
+      this(element, range, context, genericDomValue, true, delimitersOnly);
+    }
+
+    public MyPsiReference(final PsiElement element,
+                          final TextRange range,
+                          final ConvertContext context,
+                          final GenericDomValue<List<T>> genericDomValue,
+                          boolean soft,
+                          final boolean delimitersOnly) {
+      super(element, range, soft);
+      myContext = context;
+      myGenericDomValue = genericDomValue;
+      myDelimitersOnly = delimitersOnly;
+    }
+
+    @Nullable
+    public PsiElement resolve() {
+      if (myDelimitersOnly) {
+        return getElement();
+      }
+      final String value = getValue();
+      return resolveReference(convertString(value, myContext), myContext);
+    }
+
+    @NotNull
+    public Object[] getVariants() {
+      return getReferenceVariants(myContext, myGenericDomValue);
+    }
+
+    @Override
+    public PsiElement handleElementRename(final String newElementName) throws IncorrectOperationException {
+      final Ref<IncorrectOperationException> ref = new Ref<IncorrectOperationException>();
+      PsiElement element = referenceHandleElementRename(this, newElementName, getSuperElementRenameFunction(ref));
+      if (!ref.isNull()) {
+         throw ref.get();
+      }
+
+      return element;
+    }
+
+    @Override
+    public PsiElement bindToElement(@NotNull final PsiElement element) throws IncorrectOperationException {
+      final Ref<IncorrectOperationException> ref = new Ref<IncorrectOperationException>();
+      PsiElement bindElement =  referenceBindToElement(this, element, getSuperBindToElementFunction(ref), getSuperElementRenameFunction(ref));
+      if (!ref.isNull()) {
+         throw ref.get();
+      }
+
+      return bindElement;
+    }
+
+    private Function<PsiElement, PsiElement> getSuperBindToElementFunction(final Ref<IncorrectOperationException> ref) {
+      return new Function<PsiElement, PsiElement>() {
+        public PsiElement fun(final PsiElement s) {
+          try {
+            return MyPsiReference.super.bindToElement(s);
+          }
+          catch (IncorrectOperationException e) {
+            ref.set(e);
+          }
+          return null;
+        }
+      };
+    }
+
+    private Function<String, PsiElement> getSuperElementRenameFunction(final Ref<IncorrectOperationException> ref) {
+      return new Function<String, PsiElement>() {
+        public PsiElement fun(final String s) {
+          try {
+            return MyPsiReference.super.handleElementRename(s);
+          }
+          catch (IncorrectOperationException e) {
+            ref.set(e);
+          }
+          return null;
+        }
+      };
+    }
+
+
+    public String getUnresolvedMessagePattern() {
+      return getUnresolvedMessage(getValue());
+    }
+  }
+
+  protected PsiElement referenceBindToElement(final PsiReference psiReference, final PsiElement element,
+                                              final Function<PsiElement, PsiElement> superBindToElementFunction,
+                                              final Function<String, PsiElement> superElementRenameFunction)
+      throws IncorrectOperationException {
+    return superBindToElementFunction.fun(element);
+  }
+
+  protected PsiElement referenceHandleElementRename(final PsiReference psiReference,
+                                                    final String newName,
+                                                    final Function<String, PsiElement> superHandleElementRename)
+      throws IncorrectOperationException {
+
+    return superHandleElementRename.fun(newName);
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/converters/DelimitedListProcessor.java b/xml/dom-openapi/src/com/intellij/util/xml/converters/DelimitedListProcessor.java
new file mode 100644
index 0000000..ba05968
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/converters/DelimitedListProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.converters;
+
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public abstract class DelimitedListProcessor {
+
+  private final String myDelimiters;
+
+  public DelimitedListProcessor(final String delimiters) {
+    myDelimiters = delimiters;
+  }
+
+  public void processText(final @NotNull String text) {
+    int start;
+    int pos = 0;
+
+    do {
+      start = pos;
+      pos = skipDelimiters(text, pos);
+      if (pos == text.length()) {
+        processToken(start, pos, true);
+        break;
+      }
+      start = pos;
+      while (++pos < text.length() && !isDelimiter(text.charAt(pos))) {}
+      processToken(start, pos, false);
+      pos++;
+    } while(pos < text.length());
+
+  }
+
+  protected abstract void processToken(final int start, final int end, final boolean delimitersOnly);
+
+  protected int skipDelimiters(String s, int pos) {
+    while (pos < s.length()) {
+      final char ch = s.charAt(pos);
+      if (!isDelimiter(ch)) {
+        break;
+      }
+      pos++;
+    }
+    return pos;
+  }
+
+  protected boolean isDelimiter(char ch) {
+    return ch < ' ' || myDelimiters.indexOf(ch) != -1;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/converters/PathReferenceConverter.java b/xml/dom-openapi/src/com/intellij/util/xml/converters/PathReferenceConverter.java
new file mode 100644
index 0000000..c533e58
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/converters/PathReferenceConverter.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.converters;
+
+import com.intellij.util.xml.Converter;
+import com.intellij.util.xml.ConvertContext;
+import com.intellij.util.xml.CustomReferenceConverter;
+import com.intellij.util.xml.GenericDomValue;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.paths.PathReferenceManager;
+import com.intellij.openapi.paths.PathReference;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlElement;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class PathReferenceConverter extends Converter<PathReference> implements CustomReferenceConverter {
+  public final static Converter<PathReference> INSTANCE = new PathReferenceConverter();
+
+  public PathReference fromString(@Nullable final String s, final ConvertContext context) {
+    Module module = context.getModule();
+    final XmlElement element = context.getXmlElement();
+    return s == null || module == null || element == null ? null : PathReferenceManager.getInstance().getPathReference(s, module, element);
+  }
+
+  public String toString(final PathReference t, final ConvertContext context) {
+    return t == null ? null : t.getPath();
+  }
+
+  @NotNull
+  public PsiReference[] createReferences(final GenericDomValue genericDomValue, final PsiElement element, final ConvertContext context) {
+    return createReferences(element, true);
+  }
+
+  @NotNull
+  public PsiReference[] createReferences(@NotNull final PsiElement psiElement, final boolean soft) {
+    return PathReferenceManager.getInstance().createReferences(psiElement, soft);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/converters/QuotedValueConverter.java b/xml/dom-openapi/src/com/intellij/util/xml/converters/QuotedValueConverter.java
new file mode 100644
index 0000000..ec028e6
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/converters/QuotedValueConverter.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: Sergey.Vasiliev
+ * Date: Nov 13, 2006
+ * Time: 4:37:22 PM
+ */
+package com.intellij.util.xml.converters;
+
+import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.*;
+import com.intellij.util.xml.*;
+import com.intellij.xml.util.XmlTagTextUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collection;
+import java.util.Collections;
+
+public abstract class QuotedValueConverter<T> extends ResolvingConverter<T> implements CustomReferenceConverter<T> {
+
+  public static final char[] QUOTE_SIGNS = new char[] {'\'', '\"', '`'};
+
+  protected char[] getQuoteSigns() {
+    return QUOTE_SIGNS;
+  }
+
+  protected char getQuoteSign(final T t, final ConvertContext context) {
+    return 0;
+  }
+
+  @Nullable
+  protected abstract T convertString(final @Nullable String string, final ConvertContext context);
+
+  @Nullable
+  protected abstract String convertValue(@Nullable final T t, final ConvertContext context);
+
+  protected abstract Object[] getReferenceVariants(final ConvertContext context, GenericDomValue<T> genericDomValue,
+                                                   final TextRange rangeInElement);
+
+  @NotNull
+  protected abstract ResolveResult[] multiResolveReference(@Nullable final T t, final ConvertContext context);
+
+  protected abstract String getUnresolvedMessage(String value);
+
+  @NotNull
+  public Collection<? extends T> getVariants(final ConvertContext context) {
+    return Collections.emptyList();
+  }
+
+  public T fromString(final String str, final ConvertContext context) {
+    return convertString(unquote(str, getQuoteSigns()), context);
+  }
+
+  public String toString(final T ts, final ConvertContext context) {
+    final char delimiter = getQuoteSign(ts, context);
+    final String s = convertValue(ts, context);
+    return delimiter > 0? delimiter + s+ delimiter : s;
+  }
+
+  @NotNull
+  public PsiReference[] createReferences(final GenericDomValue<T> genericDomValue,
+                                         final PsiElement element,
+                                         final ConvertContext context) {
+    final String originalValue = genericDomValue.getStringValue();
+    if (originalValue == null) return PsiReference.EMPTY_ARRAY;
+    final String unquotedValue = unquote(originalValue, getQuoteSigns());
+    int startOffset = originalValue == unquotedValue? 0 : XmlTagTextUtil.escapeString(originalValue.substring(0, 1), false).length();
+    int endOffset = originalValue == unquotedValue || quotationIsNotClosed(originalValue)? 0 : startOffset;
+    final ElementManipulator<PsiElement> manipulator = ElementManipulators.getManipulator(element);
+    assert manipulator != null : "manipulator not found";
+    final TextRange range = manipulator.getRangeInElement(element);
+    return new PsiReference[]{createPsiReference(element, range.getStartOffset()+startOffset, range.getEndOffset() - endOffset, true, context, genericDomValue, startOffset != endOffset)};
+  }
+
+  @Nullable
+  public static String unquote(final String str) {
+    return unquote(str, QUOTE_SIGNS);
+  }
+
+  @Nullable
+  public static String unquote(final String str, final char[] quoteSigns) {
+    if (str != null && str.length() > 2) {
+      final char c = str.charAt(0);
+      for (char quote : quoteSigns) {
+        if (quote == c) {
+          return str.substring(1, c == str.charAt(str.length() - 1)? str.length() - 1 : str.length());
+        }
+      }
+    }
+    return str;
+  }
+
+  public static boolean quotationIsNotClosed(final String str) {
+    return StringUtil.isNotEmpty(str) && str.charAt(0) != str.charAt(str.length()-1);
+  }
+
+  @NotNull
+  protected PsiReference createPsiReference(final PsiElement element,
+                                            int start, int end,
+                                            final boolean isSoft,
+                                            final ConvertContext context,
+                                            final GenericDomValue<T> genericDomValue,
+                                            final boolean badQuotation) {
+
+    return new MyPsiReference(element, new TextRange(start, end), isSoft, context, genericDomValue, badQuotation);
+  }
+
+  protected class MyPsiReference extends PsiPolyVariantReferenceBase<PsiElement> implements EmptyResolveMessageProvider {
+    protected final ConvertContext myContext;
+    protected final GenericDomValue<T> myGenericDomValue;
+    private final boolean myBadQuotation;
+
+    public MyPsiReference(final PsiElement element, final TextRange range, final boolean isSoft, final ConvertContext context, final GenericDomValue<T> genericDomValue,
+                          final boolean badQuotation) {
+      super(element, range, isSoft);
+      myContext = context;
+      myGenericDomValue = genericDomValue;
+      myBadQuotation = badQuotation;
+    }
+
+    @NotNull
+    public ResolveResult[] multiResolve(final boolean incompleteCode) {
+      if (myBadQuotation) return ResolveResult.EMPTY_ARRAY;
+      final String value = getValue();
+      return multiResolveReference(convertString(value, myContext), myContext);
+    }
+
+    @NotNull
+    public Object[] getVariants() {
+      return getReferenceVariants(myContext, myGenericDomValue, getRangeInElement());
+    }
+
+    public String getUnresolvedMessagePattern() {
+      return myBadQuotation? DomBundle.message("message.invalid.value.quotation") : getUnresolvedMessage(getValue());
+    }
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/converters/values/BooleanValueConverter.java b/xml/dom-openapi/src/com/intellij/util/xml/converters/values/BooleanValueConverter.java
new file mode 100644
index 0000000..ed98cb7
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/converters/values/BooleanValueConverter.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.converters.values;
+
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.xml.ConvertContext;
+import com.intellij.util.xml.DomBundle;
+import com.intellij.util.xml.ResolvingConverter;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+public class BooleanValueConverter extends ResolvingConverter<String> {
+  @NonNls private static final String BOOLEAN = "boolean";
+
+  @NonNls private static final String[] VARIANTS = {"false", "true"};
+
+  private final boolean myAllowEmpty;
+
+  public static BooleanValueConverter getInstance(final boolean allowEmpty) {
+     return new BooleanValueConverter(allowEmpty);
+  }
+
+  public BooleanValueConverter() {
+    this(false);
+  }
+
+  public BooleanValueConverter(final boolean allowEmpty) {
+    myAllowEmpty = allowEmpty;
+  }
+
+  @NonNls
+  public String[] getAllValues() {
+    final String[] strings = ArrayUtil.mergeArrays(getTrueValues(), getFalseValues());
+
+    Arrays.sort(strings);
+
+    return strings;
+  }
+
+  @NonNls
+  public String[] getTrueValues() {
+    return new String[] {"true"};
+  }
+
+  @NonNls
+  public String[] getFalseValues() {
+    return new String[] {"false"};
+  }
+
+  public boolean isTrue(String s) {
+    return Arrays.binarySearch(getTrueValues(), s) >= 0;
+  }
+
+  public String fromString(@Nullable @NonNls final String stringValue, final ConvertContext context) {
+    if (stringValue != null && ((myAllowEmpty && stringValue.trim().length() == 0) || Arrays.binarySearch(getAllValues(), stringValue) >= 0)) {
+      return stringValue;
+    }
+    return null;
+  }
+
+  public String toString(@Nullable final String s, final ConvertContext context) {
+    return s;
+  }
+
+  @NotNull
+  public Collection<? extends String> getVariants(final ConvertContext context) {
+    return Arrays.asList(VARIANTS);
+  }
+
+  public String getErrorMessage(@Nullable final String s, final ConvertContext context) {
+    return DomBundle.message("value.converter.format.exception", s, BOOLEAN);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/converters/values/CharacterValueConverter.java b/xml/dom-openapi/src/com/intellij/util/xml/converters/values/CharacterValueConverter.java
new file mode 100644
index 0000000..d740a82
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/converters/values/CharacterValueConverter.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.converters.values;
+
+import com.intellij.util.xml.ConvertContext;
+import com.intellij.util.xml.Converter;
+import com.intellij.util.xml.DomBundle;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+public class CharacterValueConverter extends Converter<String> {
+  @NonNls private static final String UNICODE_PREFIX = "\\u";
+  private static final int UNICODE_LENGTH = 6;
+  private final boolean myAllowEmpty;
+
+  public CharacterValueConverter(final boolean allowEmpty) {
+    myAllowEmpty = allowEmpty;
+  }
+
+
+  public String fromString(@Nullable @NonNls String s, final ConvertContext context) {
+    if (s == null) return null;
+
+    if (myAllowEmpty && s.trim().length() == 0) return s;
+
+    if (s.trim().length() == 1) return s;
+
+    if (isUnicodeCharacterSequence(s)) {
+      try {
+        Integer.parseInt(s.substring(UNICODE_PREFIX.length()), 16);
+        return s;
+      }  catch (NumberFormatException e) {}
+
+    }
+    return null;
+  }
+
+  private static boolean isUnicodeCharacterSequence(String sequence) {
+    return sequence.startsWith(UNICODE_PREFIX) && sequence.length() == UNICODE_LENGTH;
+  }
+
+  public String toString(@Nullable String s, final ConvertContext context) {
+    return s;
+  }
+
+  public String getErrorMessage(@Nullable final String s, final ConvertContext context) {
+   return DomBundle.message("value.converter.format.exception", s, "char");
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/converters/values/NumberValueConverter.java b/xml/dom-openapi/src/com/intellij/util/xml/converters/values/NumberValueConverter.java
new file mode 100644
index 0000000..7aa3b9d
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/converters/values/NumberValueConverter.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.converters.values;
+
+import com.intellij.util.xml.ConvertContext;
+import com.intellij.util.xml.Converter;
+import com.intellij.util.xml.DomBundle;
+import com.intellij.util.xml.ResolvingConverter;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Collection;
+import java.util.Collections;
+
+public class NumberValueConverter extends ResolvingConverter<String> {
+
+  private final Class myNumberClass;
+  private final boolean myAllowEmpty;
+
+
+  public NumberValueConverter(@NotNull final Class numberClass, final boolean allowEmpty) {
+    myNumberClass = numberClass;
+    myAllowEmpty = allowEmpty;
+  }
+
+  public String fromString(@Nullable @NonNls final String s, final ConvertContext context) {
+    if (s == null) return null;
+
+    if (myAllowEmpty && s.trim().length() == 0) return s;
+
+    return parseNumber(s, myNumberClass) == null ? null : s;
+  }
+
+  public String toString(@Nullable final String s, final ConvertContext context) {
+    return null;
+  }
+
+  public String getErrorMessage(@Nullable final String s, final ConvertContext context) {
+    if (s == null) return super.getErrorMessage(s, context);
+
+    return  s.trim().length() == 0 ?
+          DomBundle.message("value.converter.format.exception.empty.string", myNumberClass.getName()) :
+          DomBundle.message("value.converter.format.exception", s, myNumberClass.getName());
+  }
+
+  @NotNull
+  @Override
+  public Collection<? extends String> getVariants(ConvertContext context) {
+    return Collections.emptySet();
+  }
+
+  @Nullable
+  public static Number parseNumber(@NotNull String text, @NotNull Class targetClass) {
+    try {
+      String trimmed = text.trim();
+
+      if (targetClass.equals(Byte.class) || targetClass.equals(byte.class)) {
+        return Byte.decode(trimmed);
+      }
+      else if (targetClass.equals(Short.class) || targetClass.equals(short.class)) {
+        return Short.decode(trimmed);
+      }
+      else if (targetClass.equals(Integer.class) || targetClass.equals(int.class)) {
+        return Integer.decode(trimmed);
+      }
+      else if (targetClass.equals(Long.class) || targetClass.equals(long.class)) {
+        return Long.decode(trimmed);
+      }
+      else if (targetClass.equals(BigInteger.class)) {
+        return decodeBigInteger(trimmed);
+      }
+      else if (targetClass.equals(Float.class) || targetClass.equals(float.class)) {
+        return Float.valueOf(trimmed);
+      }
+      else if (targetClass.equals(Double.class) || targetClass.equals(double.class)) {
+        return Double.valueOf(trimmed);
+      }
+      else if (targetClass.equals(BigDecimal.class) || targetClass.equals(Number.class)) {
+        return new BigDecimal(trimmed);
+      }
+    } catch (NumberFormatException ex) {
+      return null;
+    }
+    return null;
+  }
+
+  private static BigInteger decodeBigInteger(String value) {
+    int radix = 10;
+    int index = 0;
+    boolean negative = false;
+
+    // Handle minus sign, if present.
+    if (value.startsWith("-")) {
+      negative = true;
+      index++;
+    }
+
+    // Handle radix specifier, if present.
+    if (value.startsWith("0x", index) || value.startsWith("0X", index)) {
+      index += 2;
+      radix = 16;
+    }
+    else if (value.startsWith("#", index)) {
+      index++;
+      radix = 16;
+    }
+    else if (value.startsWith("0", index) && value.length() > 1 + index) {
+      index++;
+      radix = 8;
+    }
+
+    BigInteger result = new BigInteger(value.substring(index), radix);
+    return (negative ? result.negate() : result);
+  }
+}
\ No newline at end of file
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/events/DomEvent.java b/xml/dom-openapi/src/com/intellij/util/xml/events/DomEvent.java
new file mode 100644
index 0000000..0240198
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/events/DomEvent.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.events;
+
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomUtil;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class DomEvent {
+  public static final DomEvent[] EMPTY_ARRAY = new DomEvent[0];
+
+  private final DomElement myElement;
+  private final boolean myDefined;
+
+  public DomEvent(@NotNull final DomElement element, boolean defined) {
+    myDefined = defined;
+    myElement = DomUtil.getFileElement(element);
+  }
+
+  public final DomElement getElement() {
+    return myElement;
+  }
+
+  public boolean isDefined() {
+    return myDefined;
+  }
+
+  public String toString() {
+    return (myDefined ? "Defined " : "Changed ") + myElement;
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/AddDomElementQuickFix.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/AddDomElementQuickFix.java
new file mode 100644
index 0000000..b7a4a74
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/AddDomElementQuickFix.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.DomBundle;
+import com.intellij.util.xml.DomElement;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class AddDomElementQuickFix<T extends DomElement> implements LocalQuickFix {
+
+  protected final T myElement;
+  protected final String myName;
+
+  public AddDomElementQuickFix(@NotNull T element) {
+    myElement = (T)element.createStableCopy();
+    myName = computeName();
+  }
+
+  @NotNull
+  public String getName() {
+    return myName;
+  }
+
+  private String computeName() {
+    final String name = myElement.getXmlElementName();
+    return isTag() ?
+           DomBundle.message("add.element.fix.name", name) :
+           DomBundle.message("add.attribute.fix.name", name);
+  }
+
+  private boolean isTag() {
+    return myElement.getXmlElement() instanceof XmlTag;
+  }
+
+  @NotNull
+  public String getFamilyName() {
+    return DomBundle.message("quick.fixes.family");
+  }
+
+  public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
+    myElement.ensureXmlElementExists();
+  }
+}
\ No newline at end of file
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/BasicDomElementsInspection.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/BasicDomElementsInspection.java
new file mode 100644
index 0000000..6bc1224
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/BasicDomElementsInspection.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.GenericDomValue;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Provides basic inspection functionality (resolving, required values, duplicate names, custom annotations).
+ */
+public abstract class BasicDomElementsInspection<T extends DomElement> extends DomElementsInspection<T> {
+
+  public BasicDomElementsInspection(@NotNull Class<? extends T> domClass, Class<? extends T>... additionalClasses) {
+    super(domClass, additionalClasses);
+  }
+
+  /**
+   * One may want to create several inspections that check for unresolved DOM references of different types. Through
+   * this method one can control these types.
+   *
+   * @param value GenericDomValue containing references in question
+   * @return whether to check for resolve problems
+   */
+  protected boolean shouldCheckResolveProblems(GenericDomValue value) {
+    return true;
+  }
+
+  /**
+   * The default implementations checks for resolve problems (if {@link #shouldCheckResolveProblems(com.intellij.util.xml.GenericDomValue)}
+   * returns true), then runs annotators (see {@link com.intellij.util.xml.DomFileDescription#createAnnotator()}),
+   * checks for {@link com.intellij.util.xml.Required} and {@link com.intellij.util.xml.ExtendClass} annotation
+   * problems, checks for name identity (see {@link com.intellij.util.xml.NameValue} annotation) and custom annotation
+   * checkers (see {@link com.intellij.util.xml.highlighting.DomCustomAnnotationChecker}).
+   *
+   * @param element element to check
+   * @param holder  a place to add problems to
+   * @param helper  helper object
+   */
+  protected void checkDomElement(DomElement element, DomElementAnnotationHolder holder, DomHighlightingHelper helper) {
+    final int oldSize = holder.getSize();
+    if (element instanceof GenericDomValue) {
+      final GenericDomValue genericDomValue = (GenericDomValue) element;
+      if (shouldCheckResolveProblems(genericDomValue)) {
+        helper.checkResolveProblems(genericDomValue, holder);
+      }
+    }
+    for (final Class<? extends T> aClass : getDomClasses()) {
+      helper.runAnnotators(element, holder, aClass);
+    }
+    if (oldSize != holder.getSize()) return;
+
+    if (!helper.checkRequired(element, holder).isEmpty()) return;
+    if (!(element instanceof GenericAttributeValue) && !GenericDomValue.class.equals(ReflectionUtil.getRawType(element.getDomElementType()))) {
+      if (!helper.checkNameIdentity(element, holder).isEmpty()) return;
+    }
+
+    helper.checkCustomAnnotations(element, holder);
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomCollectionProblemDescriptor.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomCollectionProblemDescriptor.java
new file mode 100644
index 0000000..add1f2e
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomCollectionProblemDescriptor.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+
+/**
+ * @author peter
+ */
+public interface DomCollectionProblemDescriptor extends DomElementProblemDescriptor {
+  DomCollectionChildDescription getChildDescription();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomCustomAnnotationChecker.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomCustomAnnotationChecker.java
new file mode 100644
index 0000000..9d0c38f
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomCustomAnnotationChecker.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.util.xml.DomElement;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import org.jetbrains.annotations.NotNull;
+
+import java.lang.annotation.Annotation;
+import java.util.List;
+
+/**
+ * Basic DOM inspection (see {@link com.intellij.util.xml.highlighting.BasicDomElementsInspection})
+ * calls this annotator on all DOM elements with the given custom user-defined annotation.
+ *
+ * @author peter
+ */
+public abstract class DomCustomAnnotationChecker<T extends Annotation> {
+  public static final ExtensionPointName<DomCustomAnnotationChecker> EP_NAME = ExtensionPointName.create("com.intellij.dom.customAnnotationChecker");
+  
+  @NotNull
+  public abstract Class<T> getAnnotationClass();
+
+  public abstract List<DomElementProblemDescriptor> checkForProblems(@NotNull T t, @NotNull DomElement element, @NotNull DomElementAnnotationHolder holder, @NotNull DomHighlightingHelper helper);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementAnnotationHolder.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementAnnotationHolder.java
new file mode 100644
index 0000000..a1bee88
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementAnnotationHolder.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiReference;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.GenericDomValue;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public interface DomElementAnnotationHolder extends Iterable<DomElementProblemDescriptor>{
+
+  boolean isOnTheFly();
+
+  @NotNull
+  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, @Nullable String message, LocalQuickFix... fixes);
+
+  @NotNull
+  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, DomCollectionChildDescription childDescription, @Nullable String message);
+
+  @NotNull
+  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, HighlightSeverity highlightType, String message);
+
+  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, HighlightSeverity highlightType, String message, LocalQuickFix... fixes);
+
+  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, HighlightSeverity highlightType, String message, TextRange textRange, LocalQuickFix... fixes);
+
+  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, ProblemHighlightType highlightType, String message, @Nullable TextRange textRange, LocalQuickFix... fixes);
+
+  @NotNull
+  DomElementResolveProblemDescriptor createResolveProblem(@NotNull GenericDomValue element, @NotNull PsiReference reference);
+
+  /**
+   * Is useful only if called from {@link com.intellij.util.xml.highlighting.DomElementsAnnotator} instance
+   * @param element element
+   * @param severity highlight severity
+   * @param message description
+   * @return annotation
+   */
+  @NotNull
+  Annotation createAnnotation(@NotNull DomElement element, HighlightSeverity severity, @Nullable String message);
+
+  int getSize();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementAnnotationsManager.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementAnnotationsManager.java
new file mode 100644
index 0000000..364aca4
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementAnnotationsManager.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInspection.InspectionManager;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomFileElement;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.EventListener;
+import java.util.List;
+
+public abstract class DomElementAnnotationsManager {
+
+  public static DomElementAnnotationsManager getInstance(Project project) {
+    return ServiceManager.getService(project, DomElementAnnotationsManager.class);
+  }
+
+  @NotNull
+  public abstract DomElementsProblemsHolder getProblemHolder(DomElement element);
+
+  @NotNull
+  public abstract DomElementsProblemsHolder getCachedProblemHolder(DomElement element);
+
+  public abstract List<ProblemDescriptor> createProblemDescriptors(final InspectionManager manager, DomElementProblemDescriptor problemDescriptor);
+
+  public abstract boolean isHighlightingFinished(final DomElement[] domElements);
+
+  public abstract void addHighlightingListener(DomHighlightingListener listener, Disposable parentDisposable);
+
+  public abstract DomHighlightingHelper getHighlightingHelper();
+
+  /**
+   * Calls {@link com.intellij.util.xml.highlighting.DomElementsInspection#checkFileElement(com.intellij.util.xml.DomFileElement, DomElementAnnotationHolder)}
+   * with appropriate parameters if needed, saves the collected problems to {@link com.intellij.util.xml.highlighting.DomElementsProblemsHolder}, which
+   * can then be obtained from {@link #getProblemHolder(com.intellij.util.xml.DomElement)} method, and returns them.
+   *
+   * @param element file element being checked
+   * @param inspection inspection to run on the given file element
+   * @param onTheFly
+   * @return collected DOM problem descriptors
+   */
+  @NotNull
+  public abstract <T extends DomElement> List<DomElementProblemDescriptor> checkFileElement(@NotNull DomFileElement<T> element,
+                                                                                            @NotNull DomElementsInspection<T> inspection,
+                                                                                            boolean onTheFly);
+
+  public abstract void dropAnnotationsCache();
+
+  public interface DomHighlightingListener extends EventListener {
+
+    /**
+     * Called each time when an annotator or inspection has finished error-highlighting of a particular
+     * {@link com.intellij.util.xml.DomFileElement} 
+     * @param element file element whose highlighting has been finished
+     */
+    void highlightingFinished(@NotNull DomFileElement element);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementProblemDescriptor.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementProblemDescriptor.java
new file mode 100644
index 0000000..6c483af
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementProblemDescriptor.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInspection.CommonProblemDescriptor;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.util.xml.DomElement;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+public interface DomElementProblemDescriptor extends CommonProblemDescriptor {
+
+  @NotNull
+  DomElement getDomElement();
+  @NotNull
+  HighlightSeverity getHighlightSeverity();
+  @NotNull
+  LocalQuickFix[] getFixes();
+  @NotNull
+  List<Annotation> getAnnotations();
+
+  void highlightWholeElement();
+
+  @Nullable
+  ProblemHighlightType getHighlightType();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementResolveProblemDescriptor.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementResolveProblemDescriptor.java
new file mode 100644
index 0000000..b67b1a6
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementResolveProblemDescriptor.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.util.xml.GenericDomValue;
+import com.intellij.psi.PsiReference;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public interface DomElementResolveProblemDescriptor extends DomElementProblemDescriptor{
+  @NotNull
+  PsiReference getPsiReference();
+
+  @NotNull
+  GenericDomValue getDomElement();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsAnnotator.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsAnnotator.java
new file mode 100644
index 0000000..3e7257a
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsAnnotator.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.util.xml.DomElement;
+
+public interface DomElementsAnnotator {
+  void annotate(DomElement element, DomElementAnnotationHolder holder);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsInspection.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsInspection.java
new file mode 100644
index 0000000..fe7670e
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsInspection.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInspection.InspectionManager;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.codeInspection.XmlSuppressableInspectionTool;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.Consumer;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Dmitry Avdeev
+ * @see com.intellij.util.xml.highlighting.BasicDomElementsInspection
+ */
+public abstract class DomElementsInspection<T extends DomElement> extends XmlSuppressableInspectionTool {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.highlighting.DomElementsInspection");
+
+  private final Set<Class<? extends T>> myDomClasses;
+
+  public DomElementsInspection(Class<? extends T> domClass, @NotNull Class<? extends T>... additionalClasses) {
+    myDomClasses = new THashSet<Class<? extends T>>(Arrays.asList(additionalClasses));
+    myDomClasses.add(domClass);
+  }
+
+  /**
+   * This method is called internally in {@link DomElementAnnotationsManager#checkFileElement(com.intellij.util.xml.DomFileElement, DomElementsInspection, boolean)}
+   * it should add some problems to the annotation holder. The default implementation performs recursive tree traversal, and calls
+   * {@link #checkDomElement(com.intellij.util.xml.DomElement, DomElementAnnotationHolder, DomHighlightingHelper)} for each element. 
+   * @param domFileElement file element to check
+   * @param holder the place to store problems
+   */
+  public void checkFileElement(DomFileElement<T> domFileElement, final DomElementAnnotationHolder holder) {
+    final DomHighlightingHelper helper =
+      DomElementAnnotationsManager.getInstance(domFileElement.getManager().getProject()).getHighlightingHelper();
+    final Consumer<DomElement> consumer = new Consumer<DomElement>() {
+      public void consume(final DomElement element) {
+        checkChildren(element, this);
+        checkDomElement(element, holder, helper);
+      }
+    };
+    consumer.consume(domFileElement.getRootElement());
+  }
+
+  @SuppressWarnings({"MethodMayBeStatic"})
+  protected void checkChildren(final DomElement element, Consumer<DomElement> visitor) {
+    final XmlElement xmlElement = element.getXmlElement();
+    if (xmlElement instanceof XmlTag) {
+      for (final DomElement child : DomUtil.getDefinedChildren(element, true, true)) {
+        final XmlElement element1 = child.getXmlElement();
+        if (element1 == null) {
+          LOG.error("child=" + child + " of class " + child.getClass() + "; parent=" + element);
+        }
+        if (element1.isPhysical()) {
+          visitor.consume(child);
+        }
+      }
+
+      for (final AbstractDomChildrenDescription description : element.getGenericInfo().getChildrenDescriptions()) {
+        if (description.getAnnotation(Required.class) != null) {
+          for (final DomElement child : description.getValues(element)) {
+            if (!DomUtil.hasXml(child)) {
+              visitor.consume(child);
+            }
+          }
+        }
+      }
+    }
+  }
+
+  /**
+   * @return the classes passed earlier to the constructor
+   */
+  public final Set<Class<? extends T>> getDomClasses() {
+    return myDomClasses;
+  }
+
+  /**
+   * Not intended to be overridden or called by implementors.
+   * Override {@link #checkFileElement(com.intellij.util.xml.DomFileElement, DomElementAnnotationHolder)} (which is preferred) or
+   * {@link #checkDomElement(com.intellij.util.xml.DomElement, DomElementAnnotationHolder, DomHighlightingHelper)} instead.
+   */
+  @Nullable
+  public ProblemDescriptor[] checkFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) {
+    if (file instanceof XmlFile && (file.isPhysical() || ApplicationManager.getApplication().isUnitTestMode())) {
+      for (Class<? extends T> domClass: myDomClasses) {
+        final DomFileElement<? extends T> fileElement = DomManager.getDomManager(file.getProject()).getFileElement((XmlFile)file, domClass);
+        if (fileElement != null) {
+          //noinspection unchecked
+          return checkDomFile((DomFileElement<T>)fileElement, manager, isOnTheFly);
+        }
+      }
+    }
+    return null;
+  }
+
+  @NotNull
+  public HighlightDisplayLevel getDefaultLevel() {
+    return HighlightDisplayLevel.ERROR;
+  }
+
+  public boolean isEnabledByDefault() {
+    return true;
+  }
+
+  /**
+   * not intended to be overridden or called by implementors
+   */
+  @Nullable
+  protected ProblemDescriptor[] checkDomFile(@NotNull final DomFileElement<T> domFileElement,
+                                             @NotNull final InspectionManager manager,
+                                             @SuppressWarnings("UnusedParameters") final boolean isOnTheFly) {
+    final DomElementAnnotationsManager annotationsManager = DomElementAnnotationsManager.getInstance(manager.getProject());
+
+    final List<DomElementProblemDescriptor> list = annotationsManager.checkFileElement(domFileElement, this, isOnTheFly);
+    if (list.isEmpty()) return ProblemDescriptor.EMPTY_ARRAY;
+
+    List<ProblemDescriptor> problems =
+      ContainerUtil.concat(list, new Function<DomElementProblemDescriptor, Collection<? extends ProblemDescriptor>>() {
+        public Collection<ProblemDescriptor> fun(final DomElementProblemDescriptor s) {
+          return annotationsManager.createProblemDescriptors(manager, s);
+        }
+      });
+    return problems.toArray(new ProblemDescriptor[problems.size()]);
+  }
+
+  /**
+   * Check particular DOM element for problems. The inspection implementor should focus on this method.
+   * The default implementation throws {@link UnsupportedOperationException}.
+   * See {@link com.intellij.util.xml.highlighting.BasicDomElementsInspection}
+   * @param element element to check
+   * @param holder a place to add problems to
+   * @param helper helper object
+   */
+  protected void checkDomElement(DomElement element, DomElementAnnotationHolder holder, DomHighlightingHelper helper) {
+    throw new UnsupportedOperationException("checkDomElement() is not implemented in " + getClass().getName());
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsProblemsHolder.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsProblemsHolder.java
new file mode 100644
index 0000000..70d3926
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsProblemsHolder.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.util.xml.DomElement;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+public interface DomElementsProblemsHolder {
+
+  List<DomElementProblemDescriptor> getProblems(DomElement domElement);
+
+  @Deprecated
+  List<DomElementProblemDescriptor> getProblems(DomElement domElement, boolean includeXmlProblems);
+
+  /**
+   *
+   * @param domElement domElement
+   * @param includeXmlProblems IGNORED
+   * @param withChildren include children problems
+   * @return problems
+   */
+  List<DomElementProblemDescriptor> getProblems(DomElement domElement, boolean includeXmlProblems, boolean withChildren);
+
+  @Deprecated
+  List<DomElementProblemDescriptor> getProblems(DomElement domElement,
+                                                final boolean includeXmlProblems,
+                                                final boolean withChildren,
+                                                HighlightSeverity minSeverity);
+
+  List<DomElementProblemDescriptor> getProblems(DomElement domElement,
+                                                final boolean withChildren,
+                                                HighlightSeverity minSeverity);
+
+  List<DomElementProblemDescriptor> getAllProblems();
+
+  List<DomElementProblemDescriptor> getAllProblems(@NotNull DomElementsInspection inspection);
+
+  boolean isInspectionCompleted(@NotNull DomElementsInspection inspection);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomHighlightingHelper.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomHighlightingHelper.java
new file mode 100644
index 0000000..4b2db8b
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomHighlightingHelper.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.util.SmartList;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.GenericDomValue;
+import org.jetbrains.annotations.NotNull;
+
+import java.lang.annotation.Annotation;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public abstract class DomHighlightingHelper {
+  private final DomCustomAnnotationChecker[] myCustomCheckers = Extensions.getExtensions(DomCustomAnnotationChecker.EP_NAME);
+
+  @NotNull
+  public abstract List<DomElementProblemDescriptor> checkRequired(DomElement element, DomElementAnnotationHolder holder);
+
+  @NotNull
+  public abstract List<DomElementProblemDescriptor> checkResolveProblems(GenericDomValue element, DomElementAnnotationHolder holder);
+
+  @NotNull
+  public abstract List<DomElementProblemDescriptor> checkNameIdentity(DomElement element, DomElementAnnotationHolder holder);
+
+  public abstract void runAnnotators(DomElement element, DomElementAnnotationHolder holder, Class<? extends DomElement> rootClass);
+
+  /**
+   * Runs all registered {@link DomCustomAnnotationChecker}s.
+   *
+   * @param element Dom element to check.
+   * @param holder Holder instance.
+   * @return Collected problem descriptors. 
+   */
+  @NotNull
+  public List<DomElementProblemDescriptor> checkCustomAnnotations(final DomElement element, final DomElementAnnotationHolder holder) {
+    List<DomElementProblemDescriptor> result = null;
+    for (final DomCustomAnnotationChecker<?> checker : myCustomCheckers) {
+      final List<DomElementProblemDescriptor> list = checkAnno(element, checker, holder);
+      if (!list.isEmpty()) {
+        if (result == null) result = new SmartList<DomElementProblemDescriptor>();
+        result.addAll(list);
+      }
+    }
+    return result == null ? Collections.<DomElementProblemDescriptor>emptyList() : result;
+  }
+
+  private <T extends Annotation> List<DomElementProblemDescriptor> checkAnno(final DomElement element, final DomCustomAnnotationChecker<T> checker, DomElementAnnotationHolder holder) {
+    final T annotation = element.getAnnotation(checker.getAnnotationClass());
+    return annotation != null ? checker.checkForProblems(annotation, element, holder, this) : Collections.<DomElementProblemDescriptor>emptyList();
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/RemoveDomElementQuickFix.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/RemoveDomElementQuickFix.java
new file mode 100644
index 0000000..d24f7ca
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/RemoveDomElementQuickFix.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.util.xml.DomBundle;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomManager;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class RemoveDomElementQuickFix implements LocalQuickFix {
+
+  private final boolean myIsTag;
+  private final String myName;
+
+  public RemoveDomElementQuickFix(@NotNull DomElement element) {
+    myIsTag = element.getXmlElement() instanceof XmlTag;
+    myName = element.getXmlElementName();
+  }
+
+  @NotNull
+  public String getName() {
+    return myIsTag ?
+           DomBundle.message("remove.element.fix.name", myName) :
+           DomBundle.message("remove.attribute.fix.name", myName);
+  }
+
+  @NotNull
+  public String getFamilyName() {
+    return DomBundle.message("quick.fixes.family");
+  }
+
+  public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
+    if (myIsTag) {
+      final XmlTag tag = (XmlTag)descriptor.getPsiElement();
+      final XmlTag parentTag = tag.getParentTag();
+      final DomElement domElement = DomManager.getDomManager(project).getDomElement(tag);
+      assert domElement != null;
+      domElement.undefine();
+      if (parentTag != null && parentTag.isValid()) {
+        parentTag.collapseIfEmpty();
+      }
+    } else {
+      final DomElement domElement = DomManager.getDomManager(project).getDomElement((XmlAttribute)descriptor.getPsiElement());
+      assert domElement != null;
+      domElement.undefine();
+    }
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/ResolvingElementQuickFix.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/ResolvingElementQuickFix.java
new file mode 100644
index 0000000..5dafd7e
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/ResolvingElementQuickFix.java
@@ -0,0 +1,184 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.highlighting;
+
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.ide.DataManager;
+import com.intellij.ide.TypePresentationService;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.popup.JBPopupFactory;
+import com.intellij.openapi.ui.popup.PopupStep;
+import com.intellij.openapi.ui.popup.util.BaseListPopupStep;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.util.Consumer;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import com.intellij.util.xml.reflect.DomGenericInfo;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.lang.reflect.Type;
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+*/
+public class ResolvingElementQuickFix implements LocalQuickFix, IntentionAction {
+
+  private final Class<? extends DomElement> myClazz;
+  private final String myNewName;
+  private final List<DomElement> myParents;
+  private final DomCollectionChildDescription myChildDescription;
+  private String myTypeName;
+
+  public ResolvingElementQuickFix(final Class<? extends DomElement> clazz, final String newName, final List<DomElement> parents,
+                                  final DomCollectionChildDescription childDescription) {
+    myClazz = clazz;
+    myNewName = newName;
+    myParents = parents;
+    myChildDescription = childDescription;
+
+    myTypeName = TypePresentationService.getService().getTypePresentableName(myClazz);
+  }
+
+  public void setTypeName(final String typeName) {
+    myTypeName = typeName;
+  }
+
+  @NotNull
+  public String getName() {
+    return DomBundle.message("create.new.element", myTypeName, myNewName);
+  }
+
+  @NotNull
+  public String getText() {
+    return getName();
+  }
+
+  @NotNull
+  public String getFamilyName() {
+    return DomBundle.message("quick.fixes.family");
+  }
+
+  public boolean isAvailable(@NotNull final Project project, final Editor editor, final PsiFile file) {
+    return true;
+  }
+
+  public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
+    applyFix();
+  }
+
+  public boolean startInWriteAction() {
+    return false;
+  }
+
+  public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
+    applyFix();
+  }
+
+  private void applyFix() {
+    chooseParent(myParents, new Consumer<DomElement>() {
+      public void consume(final DomElement parent) {
+        new WriteCommandAction.Simple(parent.getManager().getProject(), DomUtil.getFile(parent)) {
+          protected void run() throws Throwable {
+            doFix(parent, myChildDescription, myNewName);
+          }
+        }.execute();
+      }
+    });
+  }
+
+  protected DomElement doFix(DomElement parent, final DomCollectionChildDescription childDescription, String newName) {
+    final DomElement domElement = childDescription.addValue(parent);
+    final GenericDomValue nameDomElement = domElement.getGenericInfo().getNameDomElement(domElement);
+    assert nameDomElement != null;
+    nameDomElement.setStringValue(newName);
+    return domElement;
+  }
+
+  protected static void chooseParent(final List<DomElement> files, final Consumer<DomElement> onChoose) {
+    switch (files.size()) {
+      case 0:
+        return;
+      case 1:
+        onChoose.consume(files.iterator().next());
+        return;
+      default:
+        JBPopupFactory.getInstance().createListPopup(new BaseListPopupStep<DomElement>(DomBundle.message("choose.file"), files) {
+          public PopupStep onChosen(final DomElement selectedValue, final boolean finalChoice) {
+            onChoose.consume(selectedValue);
+            return super.onChosen(selectedValue, finalChoice);
+          }
+
+          public Icon getIconFor(final DomElement aValue) {
+            return DomUtil.getFile(aValue).getIcon(0);
+          }
+
+          @NotNull
+          public String getTextFor(final DomElement value) {
+            final String name = DomUtil.getFile(value).getName();
+            assert name != null;
+            return name;
+          }
+        }).showInBestPositionFor(DataManager.getInstance().getDataContext());
+    }
+  }
+
+  @Nullable
+  public static <T extends DomElement> DomCollectionChildDescription getChildDescription(final List<DomElement> contexts, Class<T> clazz) {
+
+    if (contexts.size() == 0) {
+        return null;
+    }
+    final DomElement context = contexts.get(0);
+    final DomGenericInfo genericInfo = context.getGenericInfo();
+    final List<? extends DomCollectionChildDescription> descriptions = genericInfo.getCollectionChildrenDescriptions();
+    for (DomCollectionChildDescription description : descriptions) {
+      final Type type = description.getType();
+      if (type.equals(clazz)) {
+        return description;
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public static ResolvingElementQuickFix createFix(final String newName, final Class<? extends DomElement> clazz, final DomElement scope) {
+    final List<DomElement> parents = ModelMergerUtil.getImplementations(scope);
+    return createFix(newName, clazz, parents);
+  }
+
+  @Nullable
+  public static ResolvingElementQuickFix createFix(final String newName, final Class<? extends DomElement> clazz, final List<DomElement> parents) {
+    final DomCollectionChildDescription childDescription = getChildDescription(parents, clazz);
+    if (newName.length() > 0 && childDescription != null) {
+      return new ResolvingElementQuickFix(clazz, newName, parents, childDescription);
+    }
+    return null;
+  }
+
+  public static LocalQuickFix[] createFixes(final String newName, Class<? extends DomElement> clazz, final DomElement scope) {
+    final LocalQuickFix fix = createFix(newName, clazz, scope);
+    return fix != null ? new LocalQuickFix[] { fix } : LocalQuickFix.EMPTY_ARRAY;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/model/DomModel.java b/xml/dom-openapi/src/com/intellij/util/xml/model/DomModel.java
new file mode 100644
index 0000000..87ed3d0
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/model/DomModel.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.model;
+
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomFileElement;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public interface DomModel<T extends DomElement> {
+
+  /**
+   * Using this method may result in a large memory usage, since it will keep all the DOM and PSI for all the config files
+   * @return
+   */
+  @NotNull
+  @Deprecated
+  T getMergedModel();
+
+  @NotNull
+  Set<XmlFile> getConfigFiles();
+  
+  List<DomFileElement<T>> getRoots();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/model/DomModelCache.java b/xml/dom-openapi/src/com/intellij/util/xml/model/DomModelCache.java
new file mode 100644
index 0000000..1a1829e
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/model/DomModelCache.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.model;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.UserDataHolder;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public abstract class DomModelCache<T, H extends UserDataHolder> {
+
+  private final Key<CachedValue<T>> myKey;
+  private final Project myProject;
+
+  public DomModelCache(Project project, @NonNls String keyName) {
+    myProject = project;
+    myKey = new Key<CachedValue<T>>(keyName);
+  }
+
+  @Nullable
+  public T getCachedValue(final @NotNull H dataHolder) {
+    CachedValue<T> cachedValue = dataHolder.getUserData(myKey);
+    if (cachedValue == null) {
+      final CachedValueProvider<T> myProvider = new CachedValueProvider<T>() {
+        @Nullable
+        public Result<T> compute() {
+          return computeValue(dataHolder);
+        }
+      };
+      final CachedValuesManager manager = CachedValuesManager.getManager(myProject);
+      cachedValue = manager.createCachedValue(myProvider, false);
+      dataHolder.putUserData(myKey, cachedValue);
+    }
+    return cachedValue.getValue();
+  }
+
+  @NotNull
+  protected abstract CachedValueProvider.Result<T> computeValue(@NotNull H dataHolder);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/model/MultipleDomModelFactory.java b/xml/dom-openapi/src/com/intellij/util/xml/model/MultipleDomModelFactory.java
new file mode 100644
index 0000000..ea34b32
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/model/MultipleDomModelFactory.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.model;
+
+import com.intellij.openapi.util.UserDataHolder;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.DomElement;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public interface MultipleDomModelFactory<Scope extends UserDataHolder, T extends DomElement, M extends DomModel<T>> {
+  @NotNull
+  List<M> getAllModels(@NotNull Scope scope);
+
+  Set<XmlFile> getAllConfigFiles(@NotNull Scope scope);
+
+  @Nullable
+  M getCombinedModel(@Nullable Scope scope);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/model/SimpleModelFactory.java b/xml/dom-openapi/src/com/intellij/util/xml/model/SimpleModelFactory.java
new file mode 100644
index 0000000..f7b4a74
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/model/SimpleModelFactory.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.model;
+
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomFileElement;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Set;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public interface SimpleModelFactory<T extends DomElement, M extends DomModel<T>> {
+
+  @Nullable
+  M getModelByConfigFile(@Nullable XmlFile psiFile);
+
+  @Nullable
+  DomFileElement<T> createMergedModelRoot(Set<XmlFile> configFiles);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/model/gotosymbol/GoToSymbolProvider.java b/xml/dom-openapi/src/com/intellij/util/xml/model/gotosymbol/GoToSymbolProvider.java
new file mode 100644
index 0000000..1798e24
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/model/gotosymbol/GoToSymbolProvider.java
@@ -0,0 +1,197 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.model.gotosymbol;
+
+import com.intellij.navigation.ChooseByNameContributor;
+import com.intellij.navigation.ItemPresentation;
+import com.intellij.navigation.NavigationItem;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.FakePsiElement;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.ElementPresentationManager;
+import com.intellij.util.xml.GenericDomValue;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Base class for "Go To Symbol" contributors.
+ */
+public abstract class GoToSymbolProvider implements ChooseByNameContributor {
+
+  protected abstract void addNames(@NotNull Module module, Set<String> result);
+
+  protected abstract void addItems(@NotNull Module module, String name, List<NavigationItem> result);
+
+  protected abstract boolean acceptModule(final Module module);
+
+  protected static void addNewNames(@NotNull final List<? extends DomElement> elements, final Set<String> existingNames) {
+    for (DomElement name : elements) {
+      existingNames.add(name.getGenericInfo().getElementName(name));
+    }
+  }
+
+  @NotNull
+  public String[] getNames(final Project project, boolean includeNonProjectItems) {
+    Set<String> result = new HashSet<String>();
+    Module[] modules = ModuleManager.getInstance(project).getModules();
+    for (Module module : modules) {
+      if (acceptModule(module)) {
+        addNames(module, result);
+      }
+    }
+
+    return ArrayUtil.toStringArray(result);
+  }
+
+  @NotNull
+  public NavigationItem[] getItemsByName(final String name, final String pattern, final Project project, boolean includeNonProjectItems) {
+    List<NavigationItem> result = new ArrayList<NavigationItem>();
+    Module[] modules = ModuleManager.getInstance(project).getModules();
+    for (Module module : modules) {
+      if (acceptModule(module)) {
+        addItems(module, name, result);
+      }
+    }
+
+    return result.toArray(new NavigationItem[result.size()]);
+  }
+
+  @Nullable
+  protected static NavigationItem createNavigationItem(final DomElement domElement) {
+    final GenericDomValue name = domElement.getGenericInfo().getNameDomElement(domElement);
+    assert name != null;
+    final XmlElement psiElement = name.getXmlElement();
+    final String value = name.getStringValue();
+    if (psiElement == null || value == null) {
+      return null;
+    }
+    final Icon icon = ElementPresentationManager.getIcon(domElement);
+    return createNavigationItem(psiElement, value, icon);
+  }
+
+  @NotNull
+  protected static NavigationItem createNavigationItem(@NotNull final PsiElement element,
+                                                       @NotNull @NonNls final String text,
+                                                       @Nullable final Icon icon) {
+    return new BaseNavigationItem(element, text, icon);
+  }
+
+
+  /**
+   * Wraps one entry to display in "Go To Symbol" dialog.
+   */
+  public static class BaseNavigationItem extends FakePsiElement {
+
+    private final PsiElement myPsiElement;
+    private final String myText;
+    private final Icon myIcon;
+
+    /**
+     * Creates a new display item.
+     *
+     * @param psiElement The PsiElement to navigate to.
+     * @param text       Text to show for this element.
+     * @param icon       Icon to show for this element.
+     */
+    public BaseNavigationItem(@NotNull PsiElement psiElement, @NotNull @NonNls String text, @Nullable Icon icon) {
+      myPsiElement = psiElement;
+      myText = text;
+      myIcon = icon;
+    }
+
+    @NotNull
+    public PsiElement getNavigationElement() {
+      return myPsiElement;
+    }
+
+    public Icon getIcon(boolean flags) {
+      return myIcon;
+    }
+
+    public ItemPresentation getPresentation() {
+      return new ItemPresentation() {
+
+        public String getPresentableText() {
+          return myText;
+        }
+
+        @Nullable
+        public String getLocationString() {
+          return '(' + myPsiElement.getContainingFile().getName() + ')';
+        }
+
+        @Nullable
+        public Icon getIcon(boolean open) {
+          return myIcon;
+        }
+      };
+    }
+
+    public PsiElement getParent() {
+      return myPsiElement.getParent();
+    }
+
+    @NotNull
+    @Override
+    public Project getProject() {
+      return myPsiElement.getProject();
+    }
+
+    @Override
+    public PsiFile getContainingFile() {
+      return myPsiElement.getContainingFile();
+    }
+
+    @Override
+    public boolean isValid() {
+      return myPsiElement.isValid();
+    }
+
+    public boolean equals(final Object o) {
+      if (this == o) return true;
+      if (o == null || getClass() != o.getClass()) return false;
+
+      final BaseNavigationItem that = (BaseNavigationItem)o;
+
+      if (!myPsiElement.equals(that.myPsiElement)) return false;
+      if (!myText.equals(that.myText)) return false;
+
+      return true;
+    }
+
+    public int hashCode() {
+      int result;
+      result = myPsiElement.hashCode();
+      result = 31 * result + myText.hashCode();
+      return result;
+    }
+  }
+
+}
\ No newline at end of file
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/model/impl/BaseDomModelFactory.java b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/BaseDomModelFactory.java
new file mode 100644
index 0000000..70c0b2e
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/BaseDomModelFactory.java
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.model.impl;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.util.UserDataHolder;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiModificationTracker;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.ModelMerger;
+import com.intellij.util.xml.DomService;
+import com.intellij.util.xml.model.DomModel;
+import com.intellij.util.xml.model.MultipleDomModelFactory;
+import com.intellij.util.xml.model.SimpleModelFactory;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public abstract class BaseDomModelFactory<S extends UserDataHolder, T extends DomElement, M extends DomModel<T>, C extends PsiElement>
+    extends DomModelFactoryHelper<T> implements SimpleModelFactory<T, M>, MultipleDomModelFactory<S, T, M> {
+
+  private final Project myProject;
+  private final SimpleModelFactory<T,M> mySimpleDomModelFactory;
+  private final MultipleDomModelFactory<S, T, M> myMultipleDomModelFactory;
+
+  protected BaseDomModelFactory(@NotNull Class<T> aClass, final Project project, @NonNls String name) {
+    super(aClass, DomService.getInstance().createModelMerger());
+
+    myProject = project;
+
+    mySimpleDomModelFactory = createSimpleModelFactory(aClass, getModelMerger(), project, name);
+
+    myMultipleDomModelFactory = createMultipleDomModelFactory(aClass, getModelMerger(), project, name);
+  }
+
+  protected abstract S getModelScope(final XmlFile file);
+
+  @Nullable
+  protected abstract List<M> computeAllModels(@NotNull S scope);
+
+  protected abstract M createCombinedModel(@NotNull Set<XmlFile> configFiles, @NotNull DomFileElement<T> mergedModel, M firstModel, final S scope);
+
+  @Nullable
+  public M getModel(@NotNull C context){
+    final PsiFile psiFile = context.getContainingFile();
+    if (psiFile instanceof XmlFile) {
+      return getModelByConfigFile((XmlFile)psiFile);
+    }
+    return null;
+  }
+
+  @NotNull
+  public List<M> getAllModels(@NotNull S scope) {
+    return myMultipleDomModelFactory.getAllModels(scope);
+  }
+
+  @Nullable
+  public M getModelByConfigFile(@Nullable XmlFile psiFile) {
+    return mySimpleDomModelFactory.getModelByConfigFile(psiFile);
+  }
+
+  @NotNull
+  public Object[] computeDependencies(@Nullable M model, @Nullable S scope) {
+
+    final ArrayList<Object> dependencies = new ArrayList<Object>();
+    dependencies.add(PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT);
+    if (scope != null) {
+      dependencies.add(ProjectRootManager.getInstance(getProject()));
+    }
+    return ArrayUtil.toObjectArray(dependencies);
+  }
+
+  @Nullable
+  protected M computeModel(@NotNull XmlFile psiFile, @Nullable S scope) {
+    if (scope == null) {
+      return null;
+    }
+    final List<M> models = getAllModels(scope);
+    for (M model : models) {
+      final Set<XmlFile> configFiles = model.getConfigFiles();
+      if (configFiles.contains(psiFile)) {
+        return model;
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public M getCombinedModel(@Nullable S scope) {
+    return myMultipleDomModelFactory.getCombinedModel(scope);
+  }
+
+  @NotNull
+  public Set<XmlFile> getAllConfigFiles(@NotNull S scope) {
+    return myMultipleDomModelFactory.getAllConfigFiles(scope);
+  }
+
+  @Nullable
+  public DomFileElement<T> createMergedModelRoot(final Set<XmlFile> configFiles) {
+    return mySimpleDomModelFactory.createMergedModelRoot(configFiles);
+  }
+
+  private CachedMultipleDomModelFactory<S, T, M, C> createMultipleDomModelFactory(final Class<T> aClass,
+                                                                                  final ModelMerger modelMerger,
+                                                                                  final Project project,
+                                                                                  final String name) {
+    return new CachedMultipleDomModelFactory<S, T, M, C>(aClass, modelMerger, project, name) {
+      public M getModel(@NotNull final C context) {
+        return BaseDomModelFactory.this.getModel(context);
+      }
+
+      protected List<M> computeAllModels(@NotNull final S scope) {
+        return BaseDomModelFactory.this.computeAllModels(scope);
+      }
+
+      protected M createCombinedModel(final Set<XmlFile> configFiles,
+                                      final DomFileElement<T> mergedModel,
+                                      final M firstModel,
+                                      final S scope) {
+        return BaseDomModelFactory.this.createCombinedModel(configFiles, mergedModel, firstModel, scope);
+      }
+
+      @NotNull
+      public Object[] computeDependencies(@Nullable final M model, @Nullable final S scope) {
+        return BaseDomModelFactory.this.computeDependencies(model, scope);
+      }
+
+      public S getModelScope(@NotNull final XmlFile xmlFile) {
+        return BaseDomModelFactory.this.getModelScope(xmlFile);
+      }
+    };
+  }
+
+  private CachedSimpleDomModelFactory<T, M, S> createSimpleModelFactory(final Class<T> aClass,
+                                                                        final ModelMerger modelMerger,
+                                                                        final Project project,
+                                                                        final String name) {
+    return new CachedSimpleDomModelFactory<T, M, S>(aClass, modelMerger, project, name) {
+
+      protected M computeModel(@NotNull final XmlFile psiFile, @Nullable final S scope) {
+        return BaseDomModelFactory.this.computeModel(psiFile, scope);
+      }
+
+      @NotNull
+      public Object[] computeDependencies(@Nullable final M model, @Nullable final S scope) {
+        return BaseDomModelFactory.this.computeDependencies(model, scope);
+      }
+
+      public S getModelScope(@NotNull XmlFile file) {
+        return BaseDomModelFactory.this.getModelScope(file);
+      }
+    };
+  }
+
+  public Project getProject() {
+    return myProject;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/model/impl/CachedDomModelFactory.java b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/CachedDomModelFactory.java
new file mode 100644
index 0000000..0f1387a
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/CachedDomModelFactory.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.model.impl;
+
+import com.intellij.openapi.util.UserDataHolder;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.model.DomModel;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public interface CachedDomModelFactory <T extends DomElement, M extends DomModel<T>, Scope extends UserDataHolder> {
+  @NotNull
+  Object[] computeDependencies(@Nullable M model, @Nullable Scope scope);
+
+  Scope getModelScope(@NotNull XmlFile xmlFile);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/model/impl/CachedMultipleDomModelFactory.java b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/CachedMultipleDomModelFactory.java
new file mode 100644
index 0000000..fba3581
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/CachedMultipleDomModelFactory.java
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.model.impl;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.UserDataHolder;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.ModelMerger;
+import com.intellij.util.xml.model.DomModel;
+import com.intellij.util.xml.model.DomModelCache;
+import com.intellij.util.xml.model.MultipleDomModelFactory;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public abstract class CachedMultipleDomModelFactory<Scope extends UserDataHolder, T extends DomElement, M extends DomModel<T>, C extends PsiElement>
+    extends DomModelFactoryHelper<T>
+    implements CachedDomModelFactory<T,M,Scope>, MultipleDomModelFactory<Scope,T,M> {
+  
+    private final DomModelCache<M, Scope> myCombinedModelCache;
+    private final DomModelCache<List<M>, Scope> myAllModelsCache;
+
+
+    protected CachedMultipleDomModelFactory(@NotNull Class<T> aClass,
+                            @NotNull ModelMerger modelMerger,
+                            final Project project,
+                            @NonNls String name) {
+      super(aClass,modelMerger);
+
+      myCombinedModelCache = new DomModelCache<M, Scope>(project, name + " combined model") {
+        @NotNull
+        protected CachedValueProvider.Result<M> computeValue(@NotNull final Scope scope) {
+          final M combinedModel = computeCombinedModel(scope);
+          return new CachedValueProvider.Result<M>(combinedModel, computeDependencies(combinedModel, scope));
+        }
+      };
+
+      myAllModelsCache = new DomModelCache<List<M>, Scope>(project, name + " models list") {
+        @NotNull
+        protected CachedValueProvider.Result<List<M>> computeValue(@NotNull final Scope scope) {
+          final List<M> models = computeAllModels(scope);
+          return new CachedValueProvider.Result<List<M>>(models, computeDependencies(null, scope));
+        }
+      };
+    }
+
+    @Nullable
+    public abstract M getModel(@NotNull C context);
+
+    @NotNull
+    public List<M> getAllModels(@NotNull Scope scope) {
+
+      final List<M> models = myAllModelsCache.getCachedValue(scope);
+      if (models == null) {
+        return Collections.emptyList();
+      }
+      else {
+        return models;
+      }
+    }
+
+    @Nullable
+    protected abstract List<M> computeAllModels(@NotNull Scope scope);
+
+    @Nullable
+    public M getCombinedModel(@Nullable Scope scope) {
+      if (scope == null) {
+        return null;
+      }
+      return myCombinedModelCache.getCachedValue(scope);
+    }
+
+    @Nullable
+    protected M computeCombinedModel(@NotNull Scope scope) {
+      final List<M> models = getAllModels(scope);
+      switch (models.size()) {
+        case 0:
+          return null;
+        case 1:
+          return models.get(0);
+      }
+      final Set<XmlFile> configFiles = new LinkedHashSet<XmlFile>();
+      final LinkedHashSet<DomFileElement<T>> list = new LinkedHashSet<DomFileElement<T>>(models.size());
+      for (M model: models) {
+        final Set<XmlFile> files = model.getConfigFiles();
+        for (XmlFile file: files) {
+          ContainerUtil.addIfNotNull(getDomRoot(file), list);
+        }
+        configFiles.addAll(files);
+      }
+      final DomFileElement<T> mergedModel = getModelMerger().mergeModels(DomFileElement.class, list);
+      final M firstModel = models.get(0);
+      return createCombinedModel(configFiles, mergedModel, firstModel, scope);
+    }
+
+    /**
+     * Factory method to create combined model for given module.
+     * Used by {@link #computeCombinedModel(com.intellij.openapi.module.Module)}.
+     *
+     * @param configFiles file set including all files for all models returned by {@link #getAllModels(com.intellij.openapi.module.Module)}.
+     * @param mergedModel merged model for all models returned by {@link #getAllModels(com.intellij.openapi.module.Module)}.
+     * @param firstModel the first model returned by {@link #getAllModels(com.intellij.openapi.module.Module)}.
+     * @param scope
+     * @return combined model.
+     */
+    protected abstract M createCombinedModel(Set<XmlFile> configFiles, DomFileElement<T> mergedModel, M firstModel, final Scope scope);
+
+    @NotNull
+    public Set<XmlFile> getConfigFiles(@Nullable C context) {
+      if (context == null) {
+        return Collections.emptySet();
+      }
+      final M model = getModel(context);
+      if (model == null) {
+        return Collections.emptySet();
+      }
+      else {
+        return model.getConfigFiles();
+      }
+    }
+
+    @NotNull
+    public Set<XmlFile> getAllConfigFiles(@NotNull Scope scope) {
+      final HashSet<XmlFile> xmlFiles = new HashSet<XmlFile>();
+      for (M model: getAllModels(scope)) {
+        xmlFiles.addAll(model.getConfigFiles());
+      }
+      return xmlFiles;
+    }
+
+    public List<DomFileElement<T>> getFileElements(M model) {
+      final ArrayList<DomFileElement<T>> list = new ArrayList<DomFileElement<T>>(model.getConfigFiles().size());
+      for (XmlFile configFile: model.getConfigFiles()) {
+        final DomFileElement<T> element = DomManager.getDomManager(configFile.getProject()).getFileElement(configFile, myClass);
+        if (element != null) {
+          list.add(element);
+        }
+      }
+      return list;
+    }
+
+  }
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/model/impl/CachedSimpleDomModelFactory.java b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/CachedSimpleDomModelFactory.java
new file mode 100644
index 0000000..ec4f9d4
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/CachedSimpleDomModelFactory.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.model.impl;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.UserDataHolder;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.ModelMerger;
+import com.intellij.util.xml.model.DomModel;
+import com.intellij.util.xml.model.DomModelCache;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public abstract class CachedSimpleDomModelFactory<T extends DomElement, M extends DomModel<T>, Scope extends UserDataHolder> extends
+                                                                                                                             SimpleDomModelFactory<T, M>
+    implements CachedDomModelFactory<T,M,Scope> {
+
+  private final DomModelCache<M, XmlFile> myModelCache;
+
+  protected CachedSimpleDomModelFactory(@NotNull Class<T> aClass,
+                          @NotNull ModelMerger modelMerger,
+                          final Project project,
+                          @NonNls String name) {
+    super(aClass, modelMerger);
+
+    myModelCache = new DomModelCache<M, XmlFile>(project, name + " model") {
+       @NotNull
+       protected CachedValueProvider.Result<M> computeValue(@NotNull XmlFile file) {
+         file = (XmlFile)file.getOriginalFile();
+
+         final Scope scope = getModelScope(file);
+         final M model = computeModel(file, scope);
+         return new CachedValueProvider.Result<M>(model, computeDependencies(model, scope));
+      }
+    };
+  }
+
+  @Nullable
+  public M getModelByConfigFile(@Nullable XmlFile psiFile) {
+    if (psiFile == null) {
+      return null;
+    }
+    return myModelCache.getCachedValue(psiFile);
+  }
+
+  @Nullable
+  protected abstract M computeModel(@NotNull XmlFile psiFile, @Nullable Scope scope);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/model/impl/DomModelFactory.java b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/DomModelFactory.java
new file mode 100644
index 0000000..5f5f4dd
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/DomModelFactory.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.model.impl;
+
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtil;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.model.DomModel;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+public abstract class DomModelFactory<T extends DomElement, M extends DomModel<T>, C extends PsiElement> extends BaseDomModelFactory<Module, T, M, C> {
+
+  protected DomModelFactory(@NotNull Class<T> aClass, final Project project, @NonNls String name) {
+    super(aClass, project, name);
+  }
+
+  protected Module getModelScope(final XmlFile file) {
+
+    return ModuleUtil.findModuleForPsiElement(file);
+  }
+
+  @NotNull
+  public Set<XmlFile> getConfigFiles(@Nullable C context) {
+    if (context == null) {
+      return Collections.emptySet();
+    }
+    final M model = getModel(context);
+    if (model == null) {
+      return Collections.emptySet();
+    }
+    else {
+      return model.getConfigFiles();
+    }
+  }
+
+  public List<DomFileElement<T>> getFileElements(M model) {
+    final ArrayList<DomFileElement<T>> list = new ArrayList<DomFileElement<T>>(model.getConfigFiles().size());
+    for (XmlFile configFile : model.getConfigFiles()) {
+      final DomFileElement<T> element = DomManager.getDomManager(configFile.getProject()).getFileElement(configFile, myClass);
+      if (element != null) {
+        list.add(element);
+      }
+    }
+    return list;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/model/impl/DomModelFactoryHelper.java b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/DomModelFactoryHelper.java
new file mode 100644
index 0000000..7d4d3dd
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/DomModelFactoryHelper.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.model.impl;
+
+import com.intellij.util.xml.ModelMerger;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.DomElement;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class DomModelFactoryHelper<T extends DomElement> {
+  protected final Class<T> myClass;
+  protected final ModelMerger myModelMerger;
+
+  public DomModelFactoryHelper(@NotNull Class<T> aClass, @NotNull ModelMerger modelMerger) {
+    myClass = aClass;
+    myModelMerger = modelMerger;
+  }
+
+  @Nullable
+  public T getDom(@NotNull XmlFile configFile) {
+    final DomFileElement<T> element = getDomRoot(configFile);
+    return element == null ? null : element.getRootElement();
+  }
+
+  @Nullable
+  public DomFileElement<T> getDomRoot(@NotNull XmlFile configFile) {
+    return DomManager.getDomManager(configFile.getProject()).getFileElement(configFile, myClass);
+  }
+
+  public Class<T> getDomModelClass() {
+    return myClass;
+  }
+
+  public ModelMerger getModelMerger() {
+    return myModelMerger;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/model/impl/DomModelImpl.java b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/DomModelImpl.java
new file mode 100644
index 0000000..c104108
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/DomModelImpl.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.model.impl;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.NullableFunction;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.model.DomModel;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class DomModelImpl<T extends DomElement> implements DomModel<T> {
+
+  protected final DomFileElement<T> myMergedModel;
+  protected final Set<XmlFile> myConfigFiles;
+  private Class<T> myClass;
+  private Project myProject;
+
+  /**
+   * Using this method may result in a large memory usage, since it will keep all the DOM and PSI for all the config files
+   * @return
+   */
+  @Deprecated
+  public DomModelImpl(T mergedModel, @NotNull Set<XmlFile> configFiles) {
+    myMergedModel = DomUtil.getFileElement(mergedModel);
+    myConfigFiles = configFiles;
+  }
+
+  public DomModelImpl(DomFileElement<T> mergedModel, @NotNull Set<XmlFile> configFiles) {
+    myMergedModel = DomUtil.getFileElement(mergedModel);
+    myConfigFiles = configFiles;
+  }
+
+  public DomModelImpl(@NotNull Set<XmlFile> configFiles, Class<T> clazz, Project project) {
+    myProject = project;
+    myMergedModel = null;
+    myConfigFiles = configFiles;
+    myClass = clazz;
+  }
+
+  @NotNull
+  public T getMergedModel() {
+    if (myMergedModel == null) {
+      final DomManager domManager = DomManager.getDomManager(myProject);
+      return domManager.createModelMerger().mergeModels(myClass, ContainerUtil.mapNotNull(myConfigFiles, new NullableFunction<XmlFile, T>() {
+        public T fun(XmlFile xmlFile) {
+          DomFileElement<T> fileElement = domManager.getFileElement(xmlFile, myClass);
+          return fileElement == null ? null : fileElement.getRootElement();
+        }
+      }));
+    }
+    return myMergedModel.getRootElement();
+  }
+
+  @NotNull
+  public Set<XmlFile> getConfigFiles() {
+    return myConfigFiles;
+  }
+
+  @NotNull
+  public List<DomFileElement<T>> getRoots() {
+    if (myMergedModel == null) {
+      return ContainerUtil.mapNotNull(myConfigFiles, new NullableFunction<XmlFile, DomFileElement<T>>() {
+        public DomFileElement<T> fun(XmlFile xmlFile) {
+          return DomManager.getDomManager(xmlFile.getProject()).getFileElement(xmlFile, myClass);
+        }
+      });
+    }
+    return myMergedModel instanceof MergedObject ? ((MergedObject) myMergedModel).getImplementations() : Collections.singletonList(myMergedModel);
+  }
+
+  @NotNull
+  public Project getProject() {
+    return myProject;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/model/impl/SimpleDomModelFactory.java b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/SimpleDomModelFactory.java
new file mode 100644
index 0000000..72d0e3a
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/model/impl/SimpleDomModelFactory.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.model.impl;
+
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.ModelMerger;
+import com.intellij.util.xml.model.DomModel;
+import com.intellij.util.xml.model.SimpleModelFactory;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public abstract class SimpleDomModelFactory<T extends DomElement, M extends DomModel<T>> extends DomModelFactoryHelper<T> implements
+                                                                                                                         SimpleModelFactory<T, M> {
+
+  public SimpleDomModelFactory(@NotNull Class<T> aClass, @NotNull ModelMerger modelMerger) {
+    super(aClass, modelMerger);
+  }
+
+  @Nullable
+  public DomFileElement<T> createMergedModelRoot(Set<XmlFile> configFiles) {
+    List<DomFileElement<T>> configs = new ArrayList<DomFileElement<T>>(configFiles.size());
+    for (XmlFile configFile : configFiles) {
+      ContainerUtil.addIfNotNull(getDomRoot(configFile), configs);
+    }
+    return configs.isEmpty() ? null : getModelMerger().mergeModels(DomFileElement.class, configs);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/reflect/AbstractDomChildrenDescription.java b/xml/dom-openapi/src/com/intellij/util/xml/reflect/AbstractDomChildrenDescription.java
new file mode 100644
index 0000000..cd68639
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/reflect/AbstractDomChildrenDescription.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.reflect;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Key;
+import com.intellij.pom.PomTarget;
+import com.intellij.psi.PsiElement;
+import com.intellij.util.xml.AnnotatedElement;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomNameStrategy;
+import com.intellij.util.xml.ElementPresentationTemplate;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.Type;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public interface AbstractDomChildrenDescription extends AnnotatedElement, PomTarget {
+  @NotNull
+  List<? extends DomElement> getValues(@NotNull DomElement parent);
+
+  @NotNull
+  List<? extends DomElement> getStableValues(@NotNull DomElement parent);
+
+  @NotNull
+  Type getType();
+
+  @NotNull
+  DomNameStrategy getDomNameStrategy(@NotNull DomElement parent);
+
+  <T> T getUserData(Key<T> key);
+
+  @Nullable
+  ElementPresentationTemplate getPresentationTemplate();
+
+  @Nullable
+  PsiElement getDeclaration(Project project);
+
+  @Nullable
+  DomElement getDomDeclaration();
+
+  boolean isStubbed();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/reflect/CustomDomChildrenDescription.java b/xml/dom-openapi/src/com/intellij/util/xml/reflect/CustomDomChildrenDescription.java
new file mode 100644
index 0000000..e70c982
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/reflect/CustomDomChildrenDescription.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.reflect;
+
+import com.intellij.pom.PomTarget;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.EvaluatedXmlName;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ * @author peter
+ */
+public interface CustomDomChildrenDescription extends AbstractDomChildrenDescription {
+  @Nullable
+  TagNameDescriptor getTagNameDescriptor();
+
+  @Nullable
+  AttributeDescriptor getCustomAttributeDescriptor();
+
+  class TagNameDescriptor {
+
+    public static final AttributeDescriptor EMPTY = new AttributeDescriptor();
+
+    public Set<EvaluatedXmlName> getCompletionVariants(@NotNull DomElement parent) {
+      return Collections.emptySet();
+    }
+
+    @Nullable
+    public PomTarget findDeclaration(DomElement parent, @NotNull EvaluatedXmlName name) {
+      return null;
+    }
+
+    @Nullable
+    public PomTarget findDeclaration(@NotNull DomElement child) {
+      return child.getChildDescription();
+    }
+    
+  }
+
+  class AttributeDescriptor extends TagNameDescriptor {
+
+    public Type getElementType(DomElement child) {
+      throw new UnsupportedOperationException();
+    }
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomAttributeChildDescription.java b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomAttributeChildDescription.java
new file mode 100644
index 0000000..80e6077
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomAttributeChildDescription.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.reflect;
+
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.JavaMethod;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public interface DomAttributeChildDescription<T> extends DomChildrenDescription{
+  GenericAttributeValue<T> getDomAttributeValue(DomElement parent);
+
+  @Nullable
+  JavaMethod getGetterMethod();
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomChildrenDescription.java b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomChildrenDescription.java
new file mode 100644
index 0000000..9063903
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomChildrenDescription.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.reflect;
+
+import com.intellij.pom.PomNamedTarget;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomNameStrategy;
+import com.intellij.util.xml.XmlName;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public interface DomChildrenDescription extends AbstractDomChildrenDescription, PomNamedTarget {
+
+  @NotNull
+  XmlName getXmlName();
+
+  @NotNull
+  String getXmlElementName();
+
+  @NotNull
+  String getCommonPresentableName(@NotNull DomNameStrategy strategy);
+
+  @NotNull
+  String getCommonPresentableName(@NotNull DomElement parent);
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomCollectionChildDescription.java b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomCollectionChildDescription.java
new file mode 100644
index 0000000..26bf7a5
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomCollectionChildDescription.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.reflect;
+
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.JavaMethod;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.Type;
+
+/**
+ * @author peter
+ */
+public interface DomCollectionChildDescription extends DomChildrenDescription {
+
+  DomCollectionChildDescription[] EMPTY_ARRAY = new DomCollectionChildDescription[0];
+  
+  @Nullable
+  JavaMethod getGetterMethod();
+
+  DomElement addValue(@NotNull DomElement parent);
+  DomElement addValue(@NotNull DomElement parent, int index);
+  DomElement addValue(@NotNull DomElement parent, Type type);
+  DomElement addValue(@NotNull DomElement parent, Type type, int index);
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomExtender.java b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomExtender.java
new file mode 100644
index 0000000..938f564
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomExtender.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.reflect;
+
+import com.intellij.util.xml.DomElement;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Register DOM extenders via dom.extender extension point. Specify 2 attributes:
+ *   domClass - the DOM element class for which this extender will be called. Should be equal to T.
+ *   extenderClass - this class qualified name.
+ *
+ * @author peter
+ */
+public abstract class DomExtender<T extends DomElement> {
+
+  /**
+   * @param t DOM element where new children may be added to
+   * @param registrar a place to register your own DOM children descriptions
+   */
+  public abstract void registerExtensions(@NotNull T t, @NotNull final DomExtensionsRegistrar registrar);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomExtension.java b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomExtension.java
new file mode 100644
index 0000000..2974421
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomExtension.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.reflect;
+
+import com.intellij.openapi.util.Key;
+import com.intellij.psi.PsiElement;
+import com.intellij.util.xml.Converter;
+import com.intellij.util.xml.DomElement;
+import org.jetbrains.annotations.NotNull;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+/**
+ * @author peter
+ */
+public interface DomExtension {
+
+  @NotNull
+  Type getType();
+
+  DomExtension setDeclaringElement(@NotNull DomElement declaringElement);
+
+  DomExtension setDeclaringElement(@NotNull PsiElement declaringElement);
+
+  DomExtension setConverter(@NotNull Converter converter);
+
+  DomExtension setConverter(@NotNull Converter converter, boolean soft);
+
+  DomExtension addCustomAnnotation(@NotNull Annotation anno);
+
+  <T> void putUserData(Key<T> key, T value);
+
+  DomExtension addExtender(final DomExtender extender);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomExtensionsRegistrar.java b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomExtensionsRegistrar.java
new file mode 100644
index 0000000..5bd0072
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomExtensionsRegistrar.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.reflect;
+
+import com.intellij.util.xml.XmlName;
+import org.jetbrains.annotations.NotNull;
+
+import java.lang.reflect.Type;
+
+/**
+ * @author peter
+ */
+public interface DomExtensionsRegistrar {
+
+  @NotNull DomExtension registerFixedNumberChildExtension(@NotNull XmlName name, @NotNull Type type);
+
+  @NotNull DomExtension registerCollectionChildrenExtension(@NotNull XmlName name, @NotNull Type type);
+
+  @NotNull DomExtension registerGenericAttributeValueChildExtension(@NotNull XmlName name, final Type parameterType);
+
+  /**
+   * @param name attribute qualified name
+   * @param type should extend GenericAttributeValue
+   * @return dom extension object
+   */
+  @NotNull DomExtension registerAttributeChildExtension(@NotNull XmlName name, @NotNull final Type type);
+
+  /**
+   * @param type
+   * @return
+   * @see com.intellij.util.xml.CustomChildren
+   */
+  @NotNull DomExtension registerCustomChildrenExtension(@NotNull final Type type);
+
+  @NotNull DomExtension registerCustomChildrenExtension(@NotNull final Type type,
+                                                        @NotNull CustomDomChildrenDescription.TagNameDescriptor descriptor);
+
+  @NotNull DomExtension registerCustomChildrenExtension(@NotNull final Type type,
+                                                        @NotNull CustomDomChildrenDescription.AttributeDescriptor attributeDescriptor);
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomFixedChildDescription.java b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomFixedChildDescription.java
new file mode 100644
index 0000000..fcfde5c
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomFixedChildDescription.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.reflect;
+
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.JavaMethod;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.annotation.Annotation;
+
+/**
+ * @author peter
+ */
+public interface DomFixedChildDescription extends DomChildrenDescription {
+  int getCount();
+  JavaMethod getGetterMethod(int index);
+
+  @Nullable
+  <T extends Annotation> T getAnnotation(int index, Class<? extends T> annotationClass);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomGenericInfo.java b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomGenericInfo.java
new file mode 100644
index 0000000..3fc7b1c
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/reflect/DomGenericInfo.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.reflect;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.GenericDomValue;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public interface DomGenericInfo {
+
+  @Nullable
+  String getElementName(DomElement element);
+
+  @NotNull
+  List<? extends AbstractDomChildrenDescription> getChildrenDescriptions();
+
+  @NotNull
+  List<? extends DomFixedChildDescription> getFixedChildrenDescriptions();
+
+  @NotNull
+  List<? extends DomCollectionChildDescription> getCollectionChildrenDescriptions();
+
+  @NotNull
+  List<? extends DomAttributeChildDescription> getAttributeChildrenDescriptions();
+
+  @Nullable DomFixedChildDescription getFixedChildDescription(@NonNls String tagName);
+
+  @Nullable DomFixedChildDescription getFixedChildDescription(@NonNls String tagName, @NonNls String namespaceKey);
+
+  @Nullable DomCollectionChildDescription getCollectionChildDescription(@NonNls String tagName);
+
+  @Nullable DomCollectionChildDescription getCollectionChildDescription(@NonNls String tagName, @NonNls String namespaceKey);
+
+  @Nullable
+  DomAttributeChildDescription getAttributeChildDescription(@NonNls String attributeName);
+
+  @Nullable
+  DomAttributeChildDescription getAttributeChildDescription(@NonNls String attributeName, @NonNls String namespaceKey);
+
+  /**
+   * @return true, if there's no children in the element, only tag value accessors
+   */
+  boolean isTagValueElement();
+
+  /**
+   *
+   * @param element
+   * @return {@link com.intellij.psi.xml.XmlAttributeValue} or {@link com.intellij.psi.xml.XmlTag}
+   */
+  @Deprecated
+  @Nullable
+  XmlElement getNameElement(DomElement element);
+
+  @Nullable
+  GenericDomValue getNameDomElement(DomElement element);
+
+  @NotNull
+  List<? extends CustomDomChildrenDescription> getCustomNameChildrenDescription();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/tree/AbstractDomElementNode.java b/xml/dom-openapi/src/com/intellij/util/xml/tree/AbstractDomElementNode.java
new file mode 100644
index 0000000..e2c00c5
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/tree/AbstractDomElementNode.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.tree;
+
+import com.intellij.openapi.util.Key;
+import com.intellij.ui.SimpleTextAttributes;
+import com.intellij.ui.treeStructure.SimpleNode;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomUtil;
+
+import javax.swing.*;
+import java.lang.reflect.Type;
+import java.util.*;
+
+abstract public class AbstractDomElementNode extends SimpleNode {
+
+  public static final Key<Map<Class, Boolean>> TREE_NODES_HIDERS_KEY = Key.create("TREE_NODES_HIDERS_KEY");
+
+  private final static Comparator<Class> INHERITORS_COMPARATOR = new Comparator<Class>() {
+    public int compare(final Class o1, final Class o2) {
+      return o1.isAssignableFrom(o2) ? 1 : -1;
+    }
+  };
+
+  private boolean isExpanded;
+
+
+  protected AbstractDomElementNode(DomElement element) {
+    this(element, null);
+  }
+
+  public String toString() {
+    return getNodeName();
+  }
+
+  protected AbstractDomElementNode(DomElement element, SimpleNode parent) {
+    super(element.getManager().getProject(), parent);
+  }
+
+  abstract public DomElement getDomElement();
+
+  abstract public String getNodeName();
+
+  abstract public String getTagName();
+
+
+  public Icon getNodeIcon() {
+    return getDomElement().getPresentation().getIcon();
+  }
+
+  protected String getPropertyName() {
+    return getDomElement().getPresentation().getTypeName();
+  }
+
+  protected boolean shouldBeShown(final Type type) {
+    final Map<Class, Boolean> hiders = DomUtil.getFile(getDomElement()).getUserData(TREE_NODES_HIDERS_KEY);
+    if (type == null || hiders == null || hiders.size() == 0) return true;
+
+    final Class aClass = ReflectionUtil.getRawType(type);
+
+    List<Class> allParents = new ArrayList<Class>();
+    for (Map.Entry<Class, Boolean> entry : hiders.entrySet()) {
+      if (entry.getKey().isAssignableFrom(aClass)) {
+        allParents.add(entry.getKey());
+      }
+    }
+    if (allParents.size() == 0) return false;
+
+    Collections.sort(allParents, INHERITORS_COMPARATOR);
+
+    return hiders.get(allParents.get(0)).booleanValue();
+
+  }
+
+  protected SimpleTextAttributes getSimpleAttributes(@SimpleTextAttributes.StyleAttributeConstant final int style) {
+    return new SimpleTextAttributes(style, SimpleTextAttributes.REGULAR_ATTRIBUTES.getFgColor());
+  }
+
+  protected SimpleTextAttributes getWavedAttributes(@SimpleTextAttributes.StyleAttributeConstant int style) {
+    return new SimpleTextAttributes(style | SimpleTextAttributes.STYLE_WAVED, SimpleTextAttributes.REGULAR_ATTRIBUTES.getFgColor(), SimpleTextAttributes.ERROR_ATTRIBUTES.getFgColor());
+  }
+  public boolean isExpanded() {
+    return isExpanded;
+  }
+
+  public void setExpanded(final boolean expanded) {
+    isExpanded = expanded;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/tree/BaseDomElementNode.java b/xml/dom-openapi/src/com/intellij/util/xml/tree/BaseDomElementNode.java
new file mode 100644
index 0000000..92aaede
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/tree/BaseDomElementNode.java
@@ -0,0 +1,270 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.tree;
+
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Key;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.ui.SimpleTextAttributes;
+import com.intellij.ui.treeStructure.SimpleNode;
+import com.intellij.ui.treeStructure.SimpleTree;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.highlighting.DomElementAnnotationsManager;
+import com.intellij.util.xml.highlighting.DomElementProblemDescriptor;
+import com.intellij.util.xml.highlighting.DomElementsProblemsHolder;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import com.intellij.util.xml.reflect.DomFixedChildDescription;
+import com.intellij.util.xml.ui.TooltipUtils;
+import com.intellij.xml.XmlElementDescriptor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.awt.event.InputEvent;
+import java.awt.event.MouseEvent;
+import java.lang.reflect.Type;
+import java.util.*;
+
+
+public class BaseDomElementNode extends AbstractDomElementNode {
+  public static final Key<Comparator<AbstractDomElementNode>> COMPARATOR_KEY = Key.create("COMPARATOR_KEY");
+  public static final Key<List<Class>> CONSOLIDATED_NODES_KEY = Key.create("CONSOLIDATED_NODES_KEY");
+  public static final Key<List<Class>> FOLDER_NODES_KEY = Key.create("FOLDER_NODES_KEY");
+
+  private final DomElement myRootDomElement;
+  private final DomElement myDomElement;
+  private final String myTagName;
+  private final boolean folder;
+
+  public BaseDomElementNode(final DomElement modelElement) {
+    this(modelElement, modelElement, null);
+  }
+
+  public BaseDomElementNode(final DomElement modelElement, final DomElement modelRootElement, SimpleNode parent) {
+    super(modelElement, parent);
+
+    myDomElement = modelElement;
+    myRootDomElement = modelRootElement;
+    myTagName = modelElement.getXmlElementName();
+    folder = isMarkedType(modelElement.getDomElementType(), FOLDER_NODES_KEY);
+  }
+
+  public SimpleNode[] getChildren() {
+    return doGetChildren(myDomElement);
+  }
+
+  public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
+    if (inputEvent instanceof MouseEvent) {
+      inputEvent.consume();
+    }
+    final DomElement domElement = getDomElement();
+    if (domElement.isValid()) {
+      final DomElementNavigationProvider provider = DomElementsNavigationManager.getManager(domElement.getManager().getProject())
+        .getDomElementsNavigateProvider(DomElementsNavigationManager.DEFAULT_PROVIDER_NAME);
+
+      provider.navigate(domElement, true);
+    }
+  }
+
+  protected final SimpleNode[] doGetChildren(final DomElement element) {
+    if (!element.isValid()) return NO_CHILDREN;
+
+    List<SimpleNode> children = new ArrayList<SimpleNode>();
+    final XmlTag tag = element.getXmlTag();
+    
+    if (tag != null && !(tag.getContainingFile() instanceof XmlFile)) return NO_CHILDREN;
+    final XmlElementDescriptor xmlElementDescriptor = tag == null ? null : tag.getDescriptor();
+    final XmlElementDescriptor[] xmlDescriptors = xmlElementDescriptor == null ? null : xmlElementDescriptor.getElementsDescriptors(tag);
+
+    for (DomFixedChildDescription description : element.getGenericInfo().getFixedChildrenDescriptions()) {
+      String childName = description.getXmlElementName();
+      if (xmlDescriptors != null) {
+        if (findDescriptor(xmlDescriptors, childName) == -1) continue;
+      }
+      final List<? extends DomElement> values = description.getStableValues(element);
+      if (shouldBeShown(description.getType())) {
+        if (DomUtil.isGenericValueType(description.getType())) {
+          for (DomElement value : values) {
+            children.add(new GenericValueNode((GenericDomValue)value, this));
+          }
+        }
+        else {
+          for (DomElement domElement : values) {
+            children.add(new BaseDomElementNode(domElement, myRootDomElement, this));
+          }
+        }
+      }
+    }
+
+    for (DomCollectionChildDescription description : element.getGenericInfo().getCollectionChildrenDescriptions()) {
+      if (shouldBeShown(description.getType())) {
+        DomElementsGroupNode groupNode = new DomElementsGroupNode(element, description, this, myRootDomElement);
+        if (isMarkedType(description.getType(), CONSOLIDATED_NODES_KEY)) {
+          Collections.addAll(children, groupNode.getChildren());
+        }
+        else {
+          children.add(groupNode);
+        }
+      }
+    }
+
+    AbstractDomElementNode[] childrenNodes = children.toArray(new AbstractDomElementNode[children.size()]);
+
+    Comparator<AbstractDomElementNode> comparator = DomUtil.getFile(myDomElement).getUserData(COMPARATOR_KEY);
+    if (comparator == null) {
+      comparator = getDefaultComparator(element);
+    }
+    if (comparator != null) {
+      Arrays.sort(childrenNodes, comparator);
+    }
+
+    return childrenNodes;
+  }
+
+  @Nullable
+  protected Comparator<AbstractDomElementNode> getDefaultComparator(DomElement element) {
+    final XmlTag tag = element.getXmlTag();
+    if (tag != null) {
+      final XmlElementDescriptor descriptor = tag.getDescriptor();
+      if (descriptor != null) {
+        final XmlElementDescriptor[] childDescriptors = descriptor.getElementsDescriptors(tag);
+        if (childDescriptors != null && childDescriptors.length > 1) {
+          return new Comparator<AbstractDomElementNode>() {
+            public int compare(final AbstractDomElementNode o1, final AbstractDomElementNode o2) {
+              return findDescriptor(childDescriptors, o1.getTagName()) - findDescriptor(childDescriptors, o2.getTagName());
+            }
+          };
+        }
+      }
+    }
+    return null;
+  }
+
+  protected static int findDescriptor(XmlElementDescriptor[] descriptors, String name) {
+    for (int i = 0; i < descriptors.length; i++) {
+      if (descriptors[i].getDefaultName().equals(name)) {
+        return i;
+      }
+    }
+    return -1;
+  }
+
+  @NotNull
+  public List<DomCollectionChildDescription> getConsolidatedChildrenDescriptions() {
+    if (!myDomElement.isValid()) return Collections.emptyList();
+
+    final List<DomCollectionChildDescription> consolidated = new ArrayList<DomCollectionChildDescription>();
+    for (DomCollectionChildDescription description : myDomElement.getGenericInfo().getCollectionChildrenDescriptions()) {
+      if (isMarkedType(description.getType(), CONSOLIDATED_NODES_KEY)) {
+        consolidated.add(description);
+      }
+    }
+    return consolidated;
+  }
+
+  @NotNull
+  public Object[] getEqualityObjects() {
+    return new Object[]{myDomElement};
+  }
+
+  protected void doUpdate() {
+    if (!myDomElement.isValid()) return;
+    final Project project = myDomElement.getManager().getProject();
+    if (project.isDisposed()) return;
+
+    setUniformIcon(getNodeIcon());
+    clearColoredText();
+
+    final DomElementAnnotationsManager manager = DomElementAnnotationsManager.getInstance(project);
+    final DomElementsProblemsHolder holder = manager.getCachedProblemHolder(myDomElement);
+    final List<DomElementProblemDescriptor> problems =
+      holder.getProblems(myDomElement, highlightIfChildrenHaveProblems(), HighlightSeverity.ERROR);
+
+    if (problems.size() > 0) {
+      final String toolTip = TooltipUtils.getTooltipText(problems);
+      addColoredFragment(getNodeName(), toolTip, getWavedAttributes(SimpleTextAttributes.STYLE_PLAIN));
+      if (isShowContainingFileInfo()) {
+        addColoredFragment(" (" + DomUtil.getFile(myDomElement).getName() + ")", toolTip, SimpleTextAttributes.GRAY_ATTRIBUTES);
+      }
+    }
+    else if (myDomElement.getXmlTag() == null && !(myDomElement instanceof DomFileElement)) {
+      addColoredFragment(getNodeName(), folder ? SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES : SimpleTextAttributes.GRAYED_ATTRIBUTES);
+    }
+    else if (folder) {
+      addColoredFragment(getNodeName(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
+      final int childrenCount = getChildren().length;
+      addColoredFragment(" (" + childrenCount + ')', SimpleTextAttributes.GRAY_ATTRIBUTES);
+    }
+    else {
+      addColoredFragment(getNodeName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
+
+      if (isShowContainingFileInfo()) {
+        addColoredFragment(" (" + DomUtil.getFile(myDomElement).getName() + ")", SimpleTextAttributes.GRAY_ATTRIBUTES);
+      }
+    }
+  }
+
+  protected boolean isMarkedType(Type type, Key<List<Class>> key) {
+    if (type == null) {
+      return false;
+    }
+    final List<Class> classes = DomUtil.getFile(getDomElement()).getUserData(key);
+    if (classes != null) {
+      Class clazz = ReflectionUtil.getRawType(type);
+      return classes.contains(clazz);
+    }
+    return false;
+  }
+
+  protected boolean highlightIfChildrenHaveProblems() {
+    return true;
+  }
+
+  public String getNodeName() {
+    if (!myDomElement.isValid()) return "";
+
+    final String name = myDomElement.getPresentation().getElementName();
+    return name != null && name.trim().length() > 0 ? name : getPropertyName();
+  }
+
+  public String getTagName() {
+    return myTagName;
+  }
+
+  public DomElement getDomElement() {
+    return myDomElement;
+  }
+
+  public boolean isAutoExpandNode() {
+    return getParent() == null;
+  }
+
+  public boolean expandOnDoubleClick() {
+    return true;
+  }
+
+  public boolean isShowContainingFileInfo() {
+    if (!myRootDomElement.isValid()) return false;
+    DomElement root = myRootDomElement;
+    while (root instanceof StableElement) {
+      root = ((StableElement<DomElement>) root).getWrappedElement();
+    }
+    return root instanceof MergedObject && ((MergedObject)root).getImplementations().size() > 1;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/tree/DomElementsGroupNode.java b/xml/dom-openapi/src/com/intellij/util/xml/tree/DomElementsGroupNode.java
new file mode 100644
index 0000000..ea8ca19
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/tree/DomElementsGroupNode.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.tree;
+
+import com.intellij.ide.IdeBundle;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.ui.SimpleTextAttributes;
+import com.intellij.ui.treeStructure.SimpleNode;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.ElementPresentationManager;
+import com.intellij.util.xml.ElementPresentationTemplate;
+import com.intellij.util.xml.highlighting.DomElementAnnotationsManager;
+import com.intellij.util.xml.highlighting.DomElementProblemDescriptor;
+import com.intellij.util.xml.highlighting.DomElementsProblemsHolder;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.util.ArrayList;
+import java.util.List;
+
+public class DomElementsGroupNode extends AbstractDomElementNode {
+  private final DomElement myParentElement;
+  private final DomElement myRootDomElement;
+  private final String myChildrenTagName;
+  private final DomCollectionChildDescription myChildDescription;
+
+  public DomElementsGroupNode(final DomElement modelElement, DomCollectionChildDescription description, SimpleNode parent,
+                              final DomElement rootDomElement) {
+    super(modelElement, parent);
+    myParentElement = modelElement;
+    myChildDescription = description;
+    myChildrenTagName = description.getXmlElementName();
+    myRootDomElement = rootDomElement;
+  }
+
+  public SimpleNode[] getChildren() {
+    if (!myParentElement.isValid()) return NO_CHILDREN;
+
+    final List<SimpleNode> simpleNodes = new ArrayList<SimpleNode>();
+    for (DomElement domChild : myChildDescription.getStableValues(myParentElement)) {
+      if (shouldBeShown(domChild.getDomElementType())) {
+        simpleNodes.add(new BaseDomElementNode(domChild, myRootDomElement, this));
+      }
+    }
+    return simpleNodes.toArray(new SimpleNode[simpleNodes.size()]);
+  }
+
+  @NotNull
+  public Object[] getEqualityObjects() {
+    return new Object[]{myParentElement, myChildrenTagName};
+  }
+
+  protected void doUpdate() {
+    setUniformIcon(getNodeIcon());
+
+    clearColoredText();
+
+    final boolean showErrors = hasErrors();
+    final int childrenCount = getChildren().length;
+
+    if (childrenCount > 0) {
+      final SimpleTextAttributes textAttributes =
+        showErrors ? getWavedAttributes(SimpleTextAttributes.STYLE_BOLD) :  new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, SimpleTextAttributes.REGULAR_ATTRIBUTES.getFgColor());
+
+      addColoredFragment(getNodeName(), textAttributes);
+      addColoredFragment(" (" + childrenCount + ')', showErrors ? IdeBundle.message("dom.elements.tree.childs.contain.errors") : null,
+                         SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES);
+    }
+    else {
+      addColoredFragment(getNodeName(), SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
+    }
+  }
+
+  private boolean hasErrors() {
+    if (!myParentElement.isValid()) return false;
+
+    for (DomElement domElement : myChildDescription.getStableValues(myParentElement)) {
+      final DomElementAnnotationsManager annotationsManager = DomElementAnnotationsManager.getInstance(getProject());
+      final DomElementsProblemsHolder holder = annotationsManager.getCachedProblemHolder(domElement);
+      final List<DomElementProblemDescriptor> problems = holder.getProblems(domElement, true, HighlightSeverity.ERROR);
+      if (problems.size() > 0) return true;
+    }
+
+    return false;
+  }
+
+  public String getNodeName() {
+    if (!myParentElement.isValid()) return "";
+
+    return myChildDescription.getCommonPresentableName(myParentElement);
+  }
+
+  public String getTagName() {
+    return myChildrenTagName;
+  }
+
+  public DomElement getDomElement() {
+    return myParentElement;
+  }
+
+
+  public DomCollectionChildDescription getChildDescription() {
+    return myChildDescription;
+  }
+
+
+  public Icon getNodeIcon() {
+    Class clazz = ReflectionUtil.getRawType(myChildDescription.getType());
+//        Class arrayClass = Array.newInstance(clazz, 0).getClass();
+    ElementPresentationTemplate template = myChildDescription.getPresentationTemplate();
+    if (template != null) {
+      return template.createPresentation(null).getIcon();
+    }
+    return ElementPresentationManager.getIconForClass(clazz);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/tree/DomFileElementNode.java b/xml/dom-openapi/src/com/intellij/util/xml/tree/DomFileElementNode.java
new file mode 100644
index 0000000..6ce17cd
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/tree/DomFileElementNode.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.tree;
+
+import com.intellij.ui.treeStructure.SimpleNode;
+import com.intellij.util.xml.DomFileElement;
+
+public class DomFileElementNode extends BaseDomElementNode {
+  private final DomFileElement myFileElement;
+
+  public DomFileElementNode(final DomFileElement fileElement) {
+    super(fileElement);
+
+    myFileElement = fileElement;
+  }
+
+  public SimpleNode[] getChildren() {
+    return doGetChildren(myFileElement.getRootElement());
+  }
+
+
+  public DomFileElement getDomElement() {
+    return (DomFileElement)super.getDomElement();
+  }
+
+
+  public boolean isShowContainingFileInfo() {
+    return false;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/tree/DomModelTreeStructure.java b/xml/dom-openapi/src/com/intellij/util/xml/tree/DomModelTreeStructure.java
new file mode 100644
index 0000000..ceda5e16
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/tree/DomModelTreeStructure.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.tree;
+
+import com.intellij.ui.treeStructure.SimpleTreeStructure;
+import com.intellij.util.xml.DomElement;
+
+public class DomModelTreeStructure extends SimpleTreeStructure {
+  private final DomElement myDomElement;
+  private AbstractDomElementNode myRootNode;
+
+  public DomModelTreeStructure(DomElement root) {
+    myDomElement = root;
+  }
+
+  protected AbstractDomElementNode createRoot(DomElement rootElement) {
+    return new BaseDomElementNode(myDomElement);
+  }
+
+  public AbstractDomElementNode getRootElement() {
+    if (myRootNode == null) {
+      myRootNode = createRoot(myDomElement);
+    }
+    return myRootNode;
+  }
+
+
+  public DomElement getRootDomElement() {
+    return myDomElement;
+  }
+}
\ No newline at end of file
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/tree/DomModelTreeView.java b/xml/dom-openapi/src/com/intellij/util/xml/tree/DomModelTreeView.java
new file mode 100644
index 0000000..9f17824
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/tree/DomModelTreeView.java
@@ -0,0 +1,258 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.tree;
+
+import com.intellij.ide.util.treeView.AbstractTreeBuilder;
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.pom.Navigatable;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.ui.components.panels.Wrapper;
+import com.intellij.ui.treeStructure.SimpleNode;
+import com.intellij.ui.treeStructure.SimpleTree;
+import com.intellij.ui.treeStructure.SimpleTreeStructure;
+import com.intellij.ui.treeStructure.WeightBasedComparator;
+import com.intellij.ui.treeStructure.actions.CollapseAllAction;
+import com.intellij.ui.treeStructure.actions.ExpandAllAction;
+import com.intellij.util.ui.tree.TreeUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.highlighting.DomElementAnnotationsManager;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.event.TreeExpansionEvent;
+import javax.swing.event.TreeExpansionListener;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreeSelectionModel;
+import java.awt.*;
+
+public class DomModelTreeView extends Wrapper implements DataProvider, Disposable {
+  public static final DataKey<DomModelTreeView> DATA_KEY = DataKey.create("DOM_MODEL_TREE_VIEW_KEY");
+  @Deprecated @NonNls public static String DOM_MODEL_TREE_VIEW_KEY = DATA_KEY.getName();
+  @NonNls public static String DOM_MODEL_TREE_VIEW_POPUP = "DOM_MODEL_TREE_VIEW_POPUP";
+
+  private final SimpleTree myTree;
+  private final AbstractTreeBuilder myBuilder;
+  private DomManager myDomManager;
+  @Nullable private DomElement myRootElement;
+
+  public DomModelTreeView(@NotNull DomElement rootElement) {
+    this(rootElement, rootElement.getManager(), new DomModelTreeStructure(rootElement));
+  }
+
+  protected DomModelTreeView(DomElement rootElement, DomManager manager, SimpleTreeStructure treeStructure) {
+    myDomManager = manager;
+    myRootElement = rootElement;
+    myTree = new SimpleTree(new DefaultTreeModel(new DefaultMutableTreeNode()));
+    myTree.setRootVisible(isRootVisible());
+    myTree.setShowsRootHandles(true);
+    myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+
+    ToolTipManager.sharedInstance().registerComponent(myTree);
+    TreeUtil.installActions(myTree);
+
+    myBuilder = new AbstractTreeBuilder(myTree, (DefaultTreeModel)myTree.getModel(), treeStructure, WeightBasedComparator.INSTANCE, false);
+    Disposer.register(this, myBuilder);
+
+    myBuilder.setNodeDescriptorComparator(null);
+
+    myBuilder.initRootNode();
+
+    add(myTree, BorderLayout.CENTER);
+
+    myTree.addTreeExpansionListener(new TreeExpansionListener() {
+      public void treeExpanded(TreeExpansionEvent event) {
+        final SimpleNode simpleNode = myTree.getNodeFor(event.getPath());
+
+        if (simpleNode instanceof AbstractDomElementNode) {
+          ((AbstractDomElementNode)simpleNode).setExpanded(true);
+        }
+      }
+
+      public void treeCollapsed(TreeExpansionEvent event) {
+        final SimpleNode simpleNode = myTree.getNodeFor(event.getPath());
+
+        if (simpleNode instanceof AbstractDomElementNode) {
+          ((AbstractDomElementNode)simpleNode).setExpanded(false);
+          simpleNode.update();
+        }
+      }
+    });
+
+    myDomManager.addDomEventListener(new DomChangeAdapter() {
+      protected void elementChanged(DomElement element) {
+        if (element.isValid()) {
+          queueUpdate(DomUtil.getFile(element).getVirtualFile());
+        } else if (element instanceof DomFileElement) {
+          final XmlFile xmlFile = ((DomFileElement)element).getFile();
+          queueUpdate(xmlFile.getVirtualFile());
+        }
+      }
+    }, this);
+
+
+    final Project project = myDomManager.getProject();
+    DomElementAnnotationsManager.getInstance(project).addHighlightingListener(new DomElementAnnotationsManager.DomHighlightingListener() {
+      public void highlightingFinished(DomFileElement element) {
+        if (element.isValid()) {
+          queueUpdate(DomUtil.getFile(element).getVirtualFile());
+        }
+      }
+    }, this);
+
+    myTree.setPopupGroup(getPopupActions(), DOM_MODEL_TREE_VIEW_POPUP);
+  }
+
+  protected boolean isRightFile(final VirtualFile file) {
+    return myRootElement == null || (myRootElement.isValid() && file.equals(DomUtil.getFile(myRootElement).getVirtualFile()));
+  }
+
+  private void queueUpdate(final VirtualFile file) {
+    if (file == null) return;
+    if (getProject().isDisposed()) return;
+    ApplicationManager.getApplication().invokeLater(new Runnable() {
+      public void run() {
+        if (getProject().isDisposed()) return;
+        if (!file.isValid() || isRightFile(file)) {
+          myBuilder.updateFromRoot();
+        }
+      }
+    });
+  }
+
+  protected boolean isRootVisible() {
+    return true;
+  }
+
+  public final void updateTree() {
+    myBuilder.updateFromRoot();
+  }
+
+  public DomElement getRootElement() {
+    return myRootElement;
+  }
+
+  protected final Project getProject() {
+    return myDomManager.getProject();
+  }
+
+  public AbstractTreeBuilder getBuilder() {
+    return myBuilder;
+  }
+
+  public void dispose() {
+  }
+
+  public SimpleTree getTree() {
+    return myTree;
+  }
+
+  protected ActionGroup getPopupActions() {
+    DefaultActionGroup group = new DefaultActionGroup();
+
+    group.add(ActionManager.getInstance().getAction("DomElementsTreeView.TreePopup"));
+    group.addSeparator();
+
+    group.add(new ExpandAllAction(myTree));
+    group.add(new CollapseAllAction(myTree));
+
+    return group;
+  }
+
+  @Nullable
+  public Object getData(String dataId) {
+    if (DomModelTreeView.DATA_KEY.is(dataId)) {
+      return this;
+    }
+    final SimpleNode simpleNode = getTree().getSelectedNode();
+    if (simpleNode instanceof AbstractDomElementNode) {
+      final DomElement domElement = ((AbstractDomElementNode)simpleNode).getDomElement();
+      if (domElement != null && domElement.isValid()) {
+        if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
+          final XmlElement tag = domElement.getXmlElement();
+          if (tag instanceof Navigatable) {
+            return new Navigatable[] { (Navigatable)tag };
+          }
+        }
+      }
+    }
+    return null;
+  }
+
+  public void setSelectedDomElement(final DomElement domElement) {
+    if (domElement == null) return;
+
+    final SimpleNode node = getNodeFor(domElement);
+
+    if (node != null) {
+      getTree().setSelectedNode(getBuilder(), node, true);
+    }
+  }
+
+  @Nullable
+  private SimpleNode getNodeFor(final DomElement domElement) {
+    return visit((SimpleNode)myBuilder.getTreeStructure().getRootElement(), domElement);
+  }
+
+  @Nullable
+  private SimpleNode visit(SimpleNode simpleNode, DomElement domElement) {
+    boolean validCandidate = false;
+    if (simpleNode instanceof AbstractDomElementNode) {
+      final DomElement nodeElement = ((AbstractDomElementNode)simpleNode).getDomElement();
+      if (nodeElement != null) {
+        validCandidate = !(simpleNode instanceof DomElementsGroupNode);
+        if (validCandidate && nodeElement.equals(domElement)) {
+          return simpleNode;
+        }
+        if (!(nodeElement instanceof MergedObject) && !isParent(nodeElement, domElement)) {
+          return null;
+        }
+      }
+    }
+    final Object[] childElements = myBuilder.getTreeStructure().getChildElements(simpleNode);
+    if (childElements.length == 0 && validCandidate) { // leaf
+      return simpleNode;
+    }
+    for (Object child: childElements) {
+      SimpleNode result = visit((SimpleNode)child, domElement);
+      if (result != null) {
+        return result;
+      }
+    }
+    return validCandidate ? simpleNode : null;
+  }
+
+  private static boolean isParent(final DomElement potentialParent, final DomElement domElement) {
+    DomElement currParent = domElement;
+    while (currParent != null) {
+      if (currParent.equals(potentialParent)) return true;
+
+      currParent = currParent.getParent();
+    }
+    return false;
+  }
+
+}
+
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/tree/GenericValueNode.java b/xml/dom-openapi/src/com/intellij/util/xml/tree/GenericValueNode.java
new file mode 100644
index 0000000..d71a64c
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/tree/GenericValueNode.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.tree;
+
+import com.intellij.ui.treeStructure.SimpleNode;
+import com.intellij.util.xml.GenericDomValue;
+import com.intellij.util.xml.DomElement;
+import com.intellij.ui.SimpleTextAttributes;
+import org.jetbrains.annotations.NotNull;
+
+public class GenericValueNode extends AbstractDomElementNode {
+  protected GenericDomValue myModelElement;
+  protected String myTagName;
+
+  public GenericValueNode(final GenericDomValue modelElement, SimpleNode parent) {
+    super(modelElement, parent);
+
+    myModelElement = modelElement;
+    myTagName = modelElement.getXmlElementName();
+   }
+
+  public String getNodeName() {
+    return getPropertyName();
+  }
+
+  public String getTagName() {
+    return myTagName;
+  }
+
+  public DomElement getDomElement() {
+    return myModelElement;
+  }
+
+  protected void doUpdate() {
+    setUniformIcon(getNodeIcon());
+    clearColoredText();
+    final String stringValue = myModelElement.getStringValue();
+    final Object value = myModelElement.getValue();
+    if (value instanceof Boolean) {
+      addColoredFragment(getNodeName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
+      addColoredFragment("=", SimpleTextAttributes.REGULAR_ATTRIBUTES);
+      addColoredFragment(String.valueOf(value), SimpleTextAttributes.EXCLUDED_ATTRIBUTES);
+    } else if (stringValue != null) {
+      addColoredFragment(getNodeName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
+      addColoredFragment("=", SimpleTextAttributes.REGULAR_ATTRIBUTES);
+      addColoredFragment("\"" + stringValue + "\"", SimpleTextAttributes.EXCLUDED_ATTRIBUTES);
+    } else {
+      addColoredFragment(getNodeName(), SimpleTextAttributes.GRAYED_ATTRIBUTES);
+    }
+  }
+
+  public SimpleNode[] getChildren() {
+    return NO_CHILDREN;
+  }
+
+  @NotNull
+  public Object[] getEqualityObjects() {
+    return new Object[]{myModelElement};
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/AbstractDomElementComponent.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/AbstractDomElementComponent.java
new file mode 100644
index 0000000..a01f73f
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/AbstractDomElementComponent.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.ui.UIUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.highlighting.DomElementAnnotationsManager;
+
+import java.awt.*;
+
+
+/**
+ * User: Sergey.Vasiliev
+ * Date: Nov 18, 2005
+ */
+public abstract class AbstractDomElementComponent<T extends DomElement> extends CompositeCommittable implements CommittablePanel {
+  protected T myDomElement;
+
+  protected AbstractDomElementComponent(final T domElement) {
+    myDomElement = domElement;
+  }
+
+  public T getDomElement() {
+    return myDomElement;
+  }
+
+  protected static void setEnabled(Component component, boolean enabled) {
+    UIUtil.setEnabled(component, enabled, true);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/AbstractTableView.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/AbstractTableView.java
new file mode 100644
index 0000000..82df8a5
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/AbstractTableView.java
@@ -0,0 +1,356 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.ide.actions.ContextHelpAction;
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.ui.JBColor;
+import com.intellij.ui.PopupHandler;
+import com.intellij.ui.ScrollPaneFactory;
+import com.intellij.ui.table.TableView;
+import com.intellij.util.EventDispatcher;
+import com.intellij.util.PlatformIcons;
+import com.intellij.util.ui.ColumnInfo;
+import com.intellij.util.ui.ListTableModel;
+import com.intellij.util.ui.UIUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import javax.swing.border.MatteBorder;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.JTableHeader;
+import javax.swing.table.TableCellRenderer;
+import java.awt.*;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseMotionAdapter;
+import java.util.ArrayList;
+import java.util.EventListener;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public abstract class AbstractTableView<T> extends JPanel implements TypeSafeDataProvider {
+  private final MyTableView myTable = new MyTableView();
+  private final String myHelpID;
+  private final String myEmptyPaneText;
+  private final JPanel myInnerPanel;
+  private final Project myProject;
+  private TableCellRenderer[][] myCachedRenderers;
+  private EmptyPane myEmptyPane;
+  @NonNls private static final String TREE = "Tree";
+  @NonNls private static final String EMPTY_PANE = "EmptyPane";
+  private final EventDispatcher<ChangeListener> myDispatcher = EventDispatcher.create(ChangeListener.class);
+  private final MyListTableModel myTableModel = new MyListTableModel();
+
+  public AbstractTableView(final Project project) {
+    this(project, null, null);
+  }
+
+  public AbstractTableView(final Project project, final String emptyPaneText, final String helpID) {
+    super(new BorderLayout());
+    myProject = project;
+    myTableModel.setSortable(false);
+
+    myEmptyPaneText = emptyPaneText;
+    myHelpID = helpID;
+
+    //ToolTipHandlerProvider.getToolTipHandlerProvider().install(myTable);
+
+    final JTableHeader header = myTable.getTableHeader();
+    header.addMouseMotionListener(new MouseMotionAdapter() {
+      public void mouseMoved(MouseEvent e) {
+        updateTooltip(e);
+      }
+    });
+    header.addMouseListener(new MouseAdapter() {
+      public void mouseEntered(MouseEvent e) {
+        updateTooltip(e);
+      }
+    });
+    header.setReorderingAllowed(false);
+
+    myTable.setRowHeight(PlatformIcons.CLASS_ICON.getIconHeight());
+    myTable.setPreferredScrollableViewportSize(new Dimension(-1, 150));
+    myTable.setSelectionMode(allowMultipleRowsSelection() ? ListSelectionModel.MULTIPLE_INTERVAL_SELECTION : ListSelectionModel.SINGLE_SELECTION);
+
+    myInnerPanel = new JPanel(new CardLayout());
+    myInnerPanel.add(ScrollPaneFactory.createScrollPane(myTable), TREE);
+    if (getEmptyPaneText() != null) {
+      //noinspection HardCodedStringLiteral
+      myEmptyPane = new EmptyPane("<html>" + getEmptyPaneText() + "</html>");
+      final JComponent emptyPanel = myEmptyPane.getComponent();
+      myInnerPanel.add(emptyPanel, EMPTY_PANE);
+    }
+
+    add(myInnerPanel, BorderLayout.CENTER);
+
+    ToolTipManager.sharedInstance().registerComponent(myTable);
+  }
+  protected TableCellRenderer getTableCellRenderer(final int row, final int column, final TableCellRenderer superRenderer, final Object value) {
+    return getTableModel().getColumnInfos()[column].getCustomizedRenderer(value, new StripeTableCellRenderer(superRenderer));
+  }
+
+  protected final void installPopup(final String place, final DefaultActionGroup group) {
+    PopupHandler.installPopupHandler(myTable, group, place, ActionManager.getInstance());
+  }
+
+  public final void setToolbarActions(final AnAction... actions) {
+    final DefaultActionGroup actionGroup = new DefaultActionGroup();
+    for (final AnAction action : actions) {
+      actionGroup.add(action);
+    }
+    if (getHelpId() != null) {
+      actionGroup.add(Separator.getInstance());
+      actionGroup.add(new ContextHelpAction(getHelpId()));
+    }
+
+    final ActionManager actionManager = ActionManager.getInstance();
+    final ToolbarPosition position = getToolbarPosition();
+    final ActionToolbar myActionToolbar = actionManager.createActionToolbar(ActionPlaces.PROJECT_VIEW_TOOLBAR, actionGroup, position == ToolbarPosition.TOP || position == ToolbarPosition.BOTTOM);
+    myActionToolbar.setTargetComponent(myInnerPanel);
+    final JComponent toolbarComponent = myActionToolbar.getComponent();
+    final MatteBorder matteBorder = BorderFactory.createMatteBorder(0, 0, position == ToolbarPosition.TOP ? 1 : 0, 0, JBColor.DARK_GRAY);
+    toolbarComponent.setBorder(BorderFactory.createCompoundBorder(matteBorder, toolbarComponent.getBorder()));
+
+    getTable().getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+      public void valueChanged(ListSelectionEvent e) {
+        myActionToolbar.updateActionsImmediately();
+      }
+    });
+
+    add(toolbarComponent, position.getPosition());
+  }
+
+  protected final void setErrorMessages(String[] messages) {
+    final boolean empty = messages.length == 0;
+    final String tooltipText = TooltipUtils.getTooltipText(messages);
+    if (myEmptyPane != null) {
+      myEmptyPane.getComponent().setBackground(empty ? UIUtil.getTreeTextBackground() : BaseControl.ERROR_BACKGROUND);
+      myEmptyPane.getComponent().setToolTipText(tooltipText);
+    }
+    final JViewport viewport = (JViewport)myTable.getParent();
+    final Color tableBackground = empty ? UIUtil.getTableBackground() : BaseControl.ERROR_BACKGROUND;
+    viewport.setBackground(tableBackground);
+    viewport.setToolTipText(tooltipText);
+    myTable.setBackground(tableBackground);
+    myTable.setToolTipText(tooltipText);
+    if (tooltipText == null) ToolTipManager.sharedInstance().registerComponent(myTable);
+  }
+
+  protected final void initializeTable() {
+    myTable.setModelAndUpdateColumns(myTableModel);
+    if (getEmptyPaneText() != null) {
+      final CardLayout cardLayout = ((CardLayout)myInnerPanel.getLayout());
+      myTable.getModel().addTableModelListener(new TableModelListener() {
+        public void tableChanged(TableModelEvent e) {
+          cardLayout.show(myInnerPanel, myTable.getRowCount() == 0 ? EMPTY_PANE : TREE);
+        }
+      });
+    }
+    tuneTable(myTable);
+  }
+
+  protected void adjustColumnWidths() {
+    final ColumnInfo[] columnInfos = myTableModel.getColumnInfos();
+    for (int i = 0; i < columnInfos.length; i++) {
+      final int width = getColumnPreferredWidth(i);
+      if (width > 0) {
+        myTable.getColumnModel().getColumn(i).setPreferredWidth(width);
+      }
+    }
+  }
+
+  protected int getColumnPreferredWidth(final int i) {
+    final ColumnInfo columnInfo = myTableModel.getColumnInfos()[i];
+    final java.util.List items = myTableModel.getItems();
+    int width = -1;
+    for (int j = 0; j < items.size(); j++) {
+      final TableCellRenderer renderer = myTable.getCellRenderer(j, i);
+      final Component component = renderer.getTableCellRendererComponent(myTable, columnInfo.valueOf(items.get(j)), false, false, j, i);
+      width = Math.max(width, component.getPreferredSize().width);
+    }
+    return width;
+  }
+
+  protected String getEmptyPaneText() {
+    return myEmptyPaneText;
+  }
+
+  protected final void updateTooltip(final MouseEvent e) {
+    final int i = myTable.columnAtPoint(e.getPoint());
+    if (i >= 0) {
+      myTable.getTableHeader().setToolTipText(myTableModel.getColumnInfos()[i].getTooltipText());
+    }
+  }
+
+  protected void tuneTable(JTable table) {
+  }
+
+  protected boolean allowMultipleRowsSelection() {
+    return true;
+  }
+
+  public final JTable getTable() {
+    return myTable;
+  }
+
+  public final ListTableModel getTableModel() {
+    return myTableModel;
+  }
+
+  public void calcData(DataKey key, DataSink sink) {
+    if (PlatformDataKeys.HELP_ID.equals(key)) {
+      sink.put(PlatformDataKeys.HELP_ID, getHelpId());
+    }
+  }
+
+  private String getHelpId() {
+    return myHelpID;
+  }
+
+  public final void addChangeListener(ChangeListener listener) {
+    myDispatcher.addListener(listener);
+  }
+
+  public final void reset(ColumnInfo[] columnInfos, List<? extends T> data) {
+    final boolean columnsChanged = myTableModel.setColumnInfos(columnInfos);
+    final boolean dataChanged = !data.equals(myTableModel.getItems());
+    final int oldRowCount = myTableModel.getRowCount();
+    if ((dataChanged || columnsChanged) && myTable.isEditing()) {
+      myTable.getCellEditor().cancelCellEditing();
+    }
+
+    if (dataChanged) {
+      final int selectedRow = myTable.getSelectedRow();
+      myTableModel.setItems(new ArrayList<T>(data));
+      if (selectedRow >= 0 && selectedRow < myTableModel.getRowCount()) {
+        myTable.getSelectionModel().setSelectionInterval(selectedRow, selectedRow);
+      }
+    }
+
+    myTableModel.cacheValues();
+    final int rowCount = myTableModel.getRowCount();
+    final int columnCount = myTableModel.getColumnCount();
+    myCachedRenderers = new TableCellRenderer[rowCount][columnCount];
+    for (int row = 0; row < rowCount; row++) {
+      for (int column = 0; column < columnCount; column++) {
+        final TableCellRenderer superRenderer = myTable.getSuperCellRenderer(row, column);
+        myCachedRenderers[row][column] = getTableCellRenderer(row, column, superRenderer, myTableModel.getItems().get(row));
+      }
+    }
+    if (columnsChanged || oldRowCount == 0 && rowCount != 0) {
+      adjustColumnWidths();
+    }
+
+    myTable.revalidate();
+    myTable.repaint();
+  }
+
+  protected abstract void wrapValueSetting(@NotNull T t, Runnable valueSetter);
+
+  protected final void fireChanged() {
+    myDispatcher.getMulticaster().changed();
+  }
+
+  protected void dispose() {
+  }
+
+  public final Project getProject() {
+    return myProject;
+  }
+
+  protected ToolbarPosition getToolbarPosition() {
+    return ToolbarPosition.TOP;
+  }
+
+  private class MyListTableModel extends ListTableModel<T> {
+
+    private Object[][] myTableData;
+
+    public MyListTableModel() {
+      super(ColumnInfo.EMPTY_ARRAY);
+      setSortable(false);
+    }
+
+    public Object getValueAt(final int rowIndex, final int columnIndex) {
+      return myTableData[rowIndex][columnIndex];
+    }
+
+    void cacheValues() {
+      final int rowCount = getRowCount();
+      final int columnCount = getColumnCount();
+      final Object[][] objects = new Object[rowCount][columnCount];
+      for (int i = 0; i < rowCount; i++) {
+        for (int j = 0; j < columnCount; j++) {
+          objects[i][j] = super.getValueAt(i, j);
+        }
+      }
+      myTableData = objects;
+    }
+
+    public void setValueAt(final Object aValue, final int rowIndex, final int columnIndex) {
+      final Object oldValue = getValueAt(rowIndex, columnIndex);
+      if (!Comparing.equal(oldValue, aValue)) {
+        wrapValueSetting(getItems().get(rowIndex), new Runnable() {
+          public void run() {
+            MyListTableModel.super.setValueAt("".equals(aValue) ? null : aValue, rowIndex, columnIndex);
+          }
+        });
+      }
+    }
+
+  }
+
+  protected static enum ToolbarPosition {
+    TOP(BorderLayout.NORTH),
+    LEFT(BorderLayout.WEST),
+    RIGHT(BorderLayout.EAST),
+    BOTTOM(BorderLayout.SOUTH);
+
+    private final String myPosition;
+
+    private ToolbarPosition(final String position) {
+      myPosition = position;
+    }
+
+    public String getPosition() {
+      return myPosition;
+    }
+  }
+
+  public interface ChangeListener extends EventListener {
+    void changed();
+  }
+
+  protected class MyTableView extends TableView {
+
+    public final TableCellRenderer getSuperCellRenderer(int row, int column) {
+      return super.getCellRenderer(row, column);
+    }
+
+    public final TableCellRenderer getCellRenderer(int row, int column) {
+      return myCachedRenderers[row][column];
+    }
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/BaseControl.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/BaseControl.java
new file mode 100644
index 0000000..d6dbc13
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/BaseControl.java
@@ -0,0 +1,241 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.ui.SimpleTextAttributes;
+import com.intellij.util.EventDispatcher;
+import com.intellij.util.xml.DomElement;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * @author peter
+ */
+public abstract class BaseControl<Bound extends JComponent, T> extends DomUIControl implements Highlightable {
+  public static final Color ERROR_BACKGROUND = new Color(255,204,204);
+  public static final Color ERROR_FOREGROUND = SimpleTextAttributes.ERROR_ATTRIBUTES.getFgColor();
+  public static final Color WARNING_BACKGROUND = new Color(255,255,204);
+
+  private final EventDispatcher<CommitListener> myDispatcher = EventDispatcher.create(CommitListener.class);
+
+  private Bound myBoundComponent;
+  private final DomWrapper<T> myDomWrapper;
+  private boolean myCommitting;
+
+  private Color myDefaultForeground;
+  private Color myDefaultBackground;
+
+  protected BaseControl(final DomWrapper<T> domWrapper) {
+    myDomWrapper = domWrapper;
+  }
+
+  private void checkInitialized() {
+    if (myBoundComponent != null) return;
+
+    initialize(null);
+  }
+
+  protected JComponent getHighlightedComponent(Bound component) {
+    return component;
+  }
+
+  protected final Color getDefaultBackground() {
+    return myDefaultBackground;
+  }
+
+  protected final Color getDefaultForeground() {
+    return myDefaultForeground;
+  }
+
+  protected final Color getErrorBackground() {
+    return ERROR_BACKGROUND;
+  }
+
+  protected final Color getWarningBackground() {
+    return WARNING_BACKGROUND;
+  }
+
+  protected final Color getErrorForeground() {
+    return ERROR_FOREGROUND;
+  }
+
+
+  private void initialize(final Bound boundComponent) {
+    myBoundComponent = createMainComponent(boundComponent);
+    final JComponent highlightedComponent = getHighlightedComponent(myBoundComponent);
+    myDefaultForeground = highlightedComponent.getForeground();
+    myDefaultBackground = highlightedComponent.getBackground();
+    final JComponent component = getComponentToListenFocusLost(myBoundComponent);
+    if (component != null) {
+      component.addFocusListener(new FocusListener() {
+        public void focusGained(FocusEvent e) {
+        }
+
+        public void focusLost(FocusEvent e) {
+          if (!e.isTemporary() && isValid()) {
+            commit();
+          }
+        }
+      });
+    }
+
+    updateComponent();
+  }
+
+  @Nullable
+  protected JComponent getComponentToListenFocusLost(Bound component) {
+    return null;
+  }
+
+  protected abstract Bound createMainComponent(Bound boundedComponent);
+
+  public void bind(JComponent component) {
+    initialize((Bound)component);
+  }
+
+  public void addCommitListener(CommitListener listener) {
+    myDispatcher.addListener(listener);
+  }
+
+  public void removeCommitListener(CommitListener listener) {
+    myDispatcher.removeListener(listener);
+  }
+
+  public final DomElement getDomElement() {
+    return myDomWrapper.getWrappedElement();
+  }
+
+  public final DomWrapper<T> getDomWrapper() {
+    return myDomWrapper;
+  }
+
+  public final Bound getComponent() {
+    checkInitialized();
+    return myBoundComponent;
+  }
+
+  public void dispose() {
+  }
+
+  public final void commit() {
+    if (isValid() && !isCommitted()) {
+      setValueToXml(getValue());
+      updateComponent();
+    }
+  }
+
+  protected final boolean isValid() {
+    return myDomWrapper.isValid();
+  }
+
+  private static boolean valuesAreEqual(final Object valueInXml, final Object valueInControl) {
+    return "".equals(valueInControl) && null == valueInXml ||
+           equalModuloTrim(valueInXml, valueInControl) ||
+           Comparing.equal(valueInXml, valueInControl);
+  }
+
+  private static boolean equalModuloTrim(final Object valueInXml, final Object valueInControl) {
+    return valueInXml instanceof String && valueInControl instanceof String && ((String)valueInXml).trim().equals(((String)valueInControl).trim());
+  }
+
+  public final void reset() {
+    if (!myCommitting) {
+      doReset();
+      updateComponent();
+    }
+  }
+
+  public void updateHighlighting() {
+    updateComponent();
+  }
+
+  protected void updateComponent() {
+  }
+
+  protected void doReset() {
+    if (valuesDiffer()) {
+      setValue(getValueFromXml());
+    }
+  }
+
+  protected boolean isCommitted() {
+    return !valuesDiffer();
+  }
+
+  private boolean valuesDiffer() {
+    return !valuesAreEqual(getValueFromXml(), getValue());
+  }
+
+  private void setValueToXml(final T value) {
+    if (myCommitting) return;
+    myCommitting = true;
+    try {
+      final CommitListener multicaster = myDispatcher.getMulticaster();
+      multicaster.beforeCommit(this);
+      new WriteCommandAction(getProject(), getDomWrapper().getFile()) {
+        protected void run(Result result) throws Throwable {
+          doCommit(value);
+        }
+      }.execute();
+      multicaster.afterCommit(this);
+    }
+    finally {
+      myCommitting = false;
+    }
+  }
+
+  protected void doCommit(final T value) throws IllegalAccessException, InvocationTargetException {
+    myDomWrapper.setValue("".equals(value) ? null : value);
+  }
+
+  protected final Project getProject() {
+    return myDomWrapper.getProject();
+  }
+
+  private T getValueFromXml() {
+    try {
+      return myDomWrapper.getValue();
+    }
+    catch (IllegalAccessException e) {
+      throw new RuntimeException(e);
+    }
+    catch (InvocationTargetException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+
+  public boolean canNavigate(DomElement element) {
+    return false;
+  }
+
+  public void navigate(DomElement element) {
+  }
+
+  @Nullable
+  protected abstract T getValue();
+  protected abstract void setValue(T value);
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/BaseModifiableControl.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/BaseModifiableControl.java
new file mode 100644
index 0000000..3d0c4f9
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/BaseModifiableControl.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui;
+
+import javax.swing.*;
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * @author peter
+ */
+public abstract class BaseModifiableControl<Bound extends JComponent, T> extends BaseControl<Bound,T> {
+  private boolean myModified;
+
+  protected BaseModifiableControl(final DomWrapper<T> domWrapper) {
+    super(domWrapper);
+  }
+
+  protected final void setModified() {
+    myModified = true;
+  }
+
+  protected void doCommit(final T value) throws IllegalAccessException, InvocationTargetException {
+    super.doCommit(value);
+    myModified = false;
+  }
+
+  protected boolean isCommitted() {
+    return !myModified;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/BasicDomElementComponent.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/BasicDomElementComponent.java
new file mode 100644
index 0000000..7ba3553
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/BasicDomElementComponent.java
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Factory;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.GenericDomValue;
+import com.intellij.util.xml.highlighting.DomElementAnnotationsManager;
+import com.intellij.util.xml.reflect.DomChildrenDescription;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import com.intellij.util.xml.reflect.DomFixedChildDescription;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * User: Sergey.Vasiliev
+ * Date: Nov 17, 2005
+ */
+public abstract class BasicDomElementComponent<T extends DomElement> extends AbstractDomElementComponent<T> {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.ui.editors.BasicDomElementComponent");
+  private final Map<JComponent, DomUIControl> myBoundComponents = new HashMap<JComponent, DomUIControl>();
+
+  public BasicDomElementComponent(T domElement) {
+    super(domElement);
+  }
+
+  protected final void bindProperties() {
+    bindProperties(getDomElement());
+  }
+
+  protected boolean commitOnEveryChange(GenericDomValue element) {
+    return false;
+  }
+
+  protected final void bindProperties(final DomElement domElement) {
+    if (domElement == null) return;
+
+    DomElementAnnotationsManager.getInstance(domElement.getManager().getProject()).addHighlightingListener(new DomElementAnnotationsManager.DomHighlightingListener() {
+      public void highlightingFinished(@NotNull final DomFileElement element) {
+        ApplicationManager.getApplication().invokeLater(new Runnable() {
+          public void run() {
+            if (getComponent().isShowing() && element.isValid()) {
+              updateHighlighting();
+            }
+          }
+        });
+      }
+    }, this);
+
+    for (final AbstractDomChildrenDescription description : domElement.getGenericInfo().getChildrenDescriptions()) {
+      final JComponent boundComponent = getBoundComponent(description);
+      if (boundComponent != null) {
+        if (description instanceof DomFixedChildDescription && DomUtil.isGenericValueType(description.getType())) {
+          if ((description.getValues(domElement)).size() == 1) {
+            final GenericDomValue element = domElement.getManager().createStableValue(new Factory<GenericDomValue>() {
+              public GenericDomValue create() {
+                return domElement.isValid() ? (GenericDomValue)description.getValues(domElement).get(0) : null;
+              }
+            });
+            doBind(DomUIFactory.createControl(element, commitOnEveryChange(element)), boundComponent);
+          }
+          else {
+            //todo not bound
+
+          }
+        }
+        else if (description instanceof DomCollectionChildDescription) {
+          doBind(DomUIFactory.getDomUIFactory().createCollectionControl(domElement, (DomCollectionChildDescription)description), boundComponent);
+        }
+      }
+    }
+    reset();
+  }
+
+  protected void doBind(final DomUIControl control, final JComponent boundComponent) {
+    myBoundComponents.put(boundComponent, control);
+    control.bind(boundComponent);
+    addComponent(control);
+  }
+
+  private JComponent getBoundComponent(final AbstractDomChildrenDescription description) {
+    for (Field field : getClass().getDeclaredFields()) {
+      try {
+        field.setAccessible(true);
+
+        if (description instanceof DomChildrenDescription) {
+          final DomChildrenDescription childrenDescription = (DomChildrenDescription)description;
+          if (convertFieldName(field.getName(), childrenDescription).equals(childrenDescription.getXmlElementName()) && field.get(this) instanceof JComponent) {
+            return (JComponent)field.get(this);
+          }
+        }
+      }
+      catch (IllegalAccessException e) {
+        LOG.error(e);
+      }
+    }
+
+    return null;
+  }
+
+  private String convertFieldName(String propertyName, final DomChildrenDescription description) {
+    if (propertyName.startsWith("my")) propertyName = propertyName.substring(2);
+
+    String convertedName = description.getDomNameStrategy(getDomElement()).convertName(propertyName);
+
+    if (description instanceof DomCollectionChildDescription) {
+      final String unpluralizedStr = StringUtil.unpluralize(convertedName);
+
+      if (unpluralizedStr != null) return unpluralizedStr;
+    }
+    return convertedName;
+  }
+
+  public final Project getProject() {
+    return getDomElement().getManager().getProject();
+  }
+
+  public final Module getModule() {
+    return getDomElement().getModule();
+  }
+
+  protected final DomUIControl getDomControl(JComponent component) {
+    return myBoundComponents.get(component);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/BigStringComponent.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/BigStringComponent.java
new file mode 100644
index 0000000..e4a60e0
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/BigStringComponent.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.util.PlatformIcons;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+/**
+ * @author peter
+ */
+public class BigStringComponent extends TextFieldWithBrowseButton {
+  private final String myWindowTitle;
+
+  public BigStringComponent(String windowTitle) {
+    this(true, windowTitle);
+  }
+
+  public BigStringComponent(boolean hasBorder, String windowTitle) {
+    super();
+    myWindowTitle = windowTitle;
+    setButtonIcon(PlatformIcons.OPEN_EDIT_DIALOG_ICON);
+    addActionListener(new ActionListener() {
+      public void actionPerformed(ActionEvent e) {
+        Messages.showTextAreaDialog(getTextField(), myWindowTitle, "DescriptionDialogEditor");
+      }
+    });
+    if (!hasBorder) {
+      getTextField().setBorder(null);
+    }
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/BigTextPanel.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/BigTextPanel.java
new file mode 100644
index 0000000..10458cb
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/BigTextPanel.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+/**
+ * @author peter
+ */
+public class BigTextPanel extends TextPanel {
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/BooleanColumnInfo.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/BooleanColumnInfo.java
new file mode 100644
index 0000000..0b977a5
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/BooleanColumnInfo.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.ui.BooleanTableCellRenderer;
+import com.intellij.util.xml.GenericDomValue;
+
+import javax.swing.*;
+import javax.swing.table.TableCellEditor;
+
+/**
+ * @author peter
+ */
+public class BooleanColumnInfo extends DomColumnInfo<GenericDomValue<Boolean>, Boolean> {
+
+  public BooleanColumnInfo(final String name) {
+    super(name, new BooleanTableCellRenderer());
+  }
+
+  public TableCellEditor getEditor(GenericDomValue<Boolean> value) {
+    return new DefaultCellEditor(new JCheckBox());
+  }
+
+  public final Class<Boolean> getColumnClass() {
+    return Boolean.class;
+  }
+
+  public final void setValue(final GenericDomValue<Boolean> o, final Boolean aValue) {
+    o.setValue(aValue);
+  }
+
+  public final Boolean valueOf(GenericDomValue<Boolean> object) {
+    final Boolean value = object.getValue();
+    return value == null ? Boolean.FALSE : value;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/BooleanControl.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/BooleanControl.java
new file mode 100644
index 0000000..86f32c3
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/BooleanControl.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+/**
+ * @author peter
+ */
+public class BooleanControl extends BaseModifiableControl<JCheckBox, Boolean> {
+  private boolean myUndefined;
+
+  public BooleanControl(final DomWrapper<Boolean> domWrapper) {
+    super(domWrapper);
+  }
+
+  protected JCheckBox createMainComponent(JCheckBox boundComponent) {
+    JCheckBox checkBox = boundComponent == null ? new JCheckBox() : boundComponent;
+
+    checkBox.addActionListener(new ActionListener() {
+      public void actionPerformed(ActionEvent e) {
+        myUndefined = false;
+        setModified();
+        commit();
+        reset();
+      }
+    });
+    return checkBox;
+  }
+
+  protected Boolean getValue() {
+    return myUndefined ? null : getComponent().isSelected();
+  }
+
+  protected void setValue(final Boolean value) {
+    myUndefined = value == null;
+    getComponent().setSelected(value != null && value);
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/BooleanEnumControl.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/BooleanEnumControl.java
new file mode 100644
index 0000000..c567fcc
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/BooleanEnumControl.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.xml.NamedEnumUtil;
+
+import javax.swing.*;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+
+/**
+ * @author peter
+ */
+public class BooleanEnumControl extends BaseModifiableControl<JCheckBox, String> {
+  private boolean myUndefined;
+  private final String mySelectedValue;
+  private final String myUnselectedValue;
+
+  public BooleanEnumControl(final DomWrapper<String> domWrapper, String selectedValue, String unselectedValue) {
+    super(domWrapper);
+    mySelectedValue = selectedValue;
+    myUnselectedValue = unselectedValue;
+  }
+
+  public BooleanEnumControl(final DomWrapper<String> domWrapper, Class<? extends Enum> enumClass, boolean invertedOrder) {
+    this(domWrapper, NamedEnumUtil.getEnumValueByElement(enumClass.getEnumConstants()[invertedOrder ? 0 : 1]), NamedEnumUtil.getEnumValueByElement(enumClass.getEnumConstants()[invertedOrder ? 1 : 0]));
+    assert enumClass.getEnumConstants().length == 2 : enumClass;
+  }
+
+  protected JCheckBox createMainComponent(JCheckBox boundComponent) {
+    JCheckBox checkBox = boundComponent == null ? new JCheckBox() : boundComponent;
+
+    checkBox.addActionListener(new ActionListener() {
+      public void actionPerformed(ActionEvent e) {
+        myUndefined = false;
+        setModified();
+        commit();
+        reset();
+      }
+    });
+    return checkBox;
+  }
+
+  protected String getValue() {
+    return myUndefined ? null : (getComponent().isSelected() ? mySelectedValue : myUnselectedValue);
+  }
+
+  protected void setValue(final String value) {
+    myUndefined = value == null;
+    getComponent().setSelected(mySelectedValue.equals(value));
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/CaptionComponent.form b/xml/dom-openapi/src/com/intellij/util/xml/ui/CaptionComponent.form
new file mode 100644
index 0000000..49b6186
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/CaptionComponent.form
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.util.xml.ui.CaptionComponent">
+  <grid id="c1ca5" binding="myRootPanel" layout-manager="GridLayoutManager" row-count="2" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="5" left="5" bottom="5" right="5"/>
+    <constraints>
+      <xy x="147" y="112" width="138" height="86"/>
+    </constraints>
+    <properties>
+      <background color="-789275"/>
+    </properties>
+    <border type="etched"/>
+    <children>
+      <component id="612c1" class="javax.swing.JLabel" binding="myCaptionLabel">
+        <constraints>
+          <grid row="0" column="1" row-span="1" col-span="2" vsize-policy="3" hsize-policy="7" anchor="8" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <font name="Tahoma" size="11" style="1"/>
+          <labelFor value=""/>
+          <text value="Unknown"/>
+        </properties>
+      </component>
+      <component id="b900a" class="javax.swing.JLabel" binding="myDescriptionLabel">
+        <constraints>
+          <grid row="1" column="1" row-span="1" col-span="2" vsize-policy="3" hsize-policy="7" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <labelFor value=""/>
+          <text value=""/>
+        </properties>
+      </component>
+      <component id="71451" class="javax.swing.JLabel" binding="myIconLabel">
+        <constraints>
+          <grid row="0" column="0" row-span="2" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value=""/>
+          <visible value="false"/>
+        </properties>
+      </component>
+      <grid id="21953" binding="myErrorPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="0" column="3" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <background color="-789275"/>
+        </properties>
+        <border type="none"/>
+        <children/>
+      </grid>
+      <vspacer id="936da">
+        <constraints>
+          <grid row="1" column="3" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+        </constraints>
+      </vspacer>
+    </children>
+  </grid>
+</form>
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/CaptionComponent.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/CaptionComponent.java
new file mode 100644
index 0000000..4743fc99
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/CaptionComponent.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.util.Disposer;
+import com.intellij.util.xml.DomElement;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class CaptionComponent extends JPanel implements Committable, Highlightable {
+  private JPanel myRootPanel;
+  private JLabel myCaptionLabel;
+  private JLabel myDescriptionLabel;
+  private JLabel myIconLabel;
+  private JPanel myErrorPanel;
+  private CommittablePanel myCommittableErrorPanel;
+
+  private boolean myBordered = true;
+
+  public CaptionComponent() {
+    this(null);
+  }
+
+  public CaptionComponent(String text) {
+    this(text, null);
+  }
+
+  public CaptionComponent(String text, Icon icon) {
+    super(new BorderLayout());
+    updateBorder();
+    add(myRootPanel, BorderLayout.CENTER);
+
+    setText(text);
+    setIcon(icon);
+  }
+
+  private void updateBorder() {
+    if (myBordered) {
+      myRootPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.LIGHT_GRAY));
+    }
+    else {
+      myRootPanel.setBorder(BorderFactory.createEmptyBorder());
+    }
+  }
+
+  public void updateHighlighting() {
+    CommittableUtil.updateHighlighting(myCommittableErrorPanel);
+  }
+
+  public void setText(final String text) {
+    if (text == null) return;
+
+    myCaptionLabel.setText(text);
+  }
+
+  public String getText() {
+    return myCaptionLabel.getText();
+  }
+
+  public void setIcon(final Icon icon) {
+    myIconLabel.setVisible(icon != null);
+    myIconLabel.setIcon(icon);
+  }
+
+  public Icon getIcon() {
+    return myIconLabel.getIcon();
+  }
+
+  public boolean isBordered() {
+    return myBordered;
+  }
+
+  public String getDescriptionText() {
+    return myDescriptionLabel.getText();
+  }
+
+  public void setDescriptionText(final String text) {
+    myDescriptionLabel.setVisible(text != null && text.trim().length() > 0);
+
+    myDescriptionLabel.setText(text);
+  }
+
+  public final void setBordered(final boolean bordered) {
+    myBordered = bordered;
+    updateBorder();
+  }
+
+  public final void commit() {
+  }
+
+  public void reset() {
+    if (myCommittableErrorPanel != null) myCommittableErrorPanel.reset();
+  }
+
+  public final void dispose() {
+  }
+
+  public void initErrorPanel(final DomElement... elements) {
+    DomUIFactory.getDomUIFactory().addErrorPanel(this, elements);
+  }
+
+  public void initErrorPanel(final CommittablePanel errorPanel) {
+    myCommittableErrorPanel = errorPanel;
+    Disposer.register(this, errorPanel);
+    
+    final JComponent component = errorPanel.getComponent();
+
+    component.setBackground(getBackground());
+    
+    myErrorPanel.setLayout(new BorderLayout());
+    myErrorPanel.add(component, BorderLayout.CENTER);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/ChildGenericValueColumnInfo.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/ChildGenericValueColumnInfo.java
new file mode 100644
index 0000000..dfaa714
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/ChildGenericValueColumnInfo.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.GenericDomValue;
+import com.intellij.util.xml.reflect.DomFixedChildDescription;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+
+/**
+ * @author peter
+ */
+public class ChildGenericValueColumnInfo<T extends DomElement> extends DomColumnInfo<T, String> {
+  private final TableCellEditor myEditor;
+  private final DomFixedChildDescription myChildDescription;
+
+  public ChildGenericValueColumnInfo(final String name,
+                                     @NotNull final DomFixedChildDescription description,
+                                     final TableCellRenderer renderer,
+                                     final TableCellEditor editor) {
+    super(name, renderer);
+    myEditor = editor;
+    myChildDescription = description;
+  }
+
+  public ChildGenericValueColumnInfo(final String name, final DomFixedChildDescription description, final TableCellEditor editor) {
+    this(name, description, new DefaultTableCellRenderer(), editor);
+  }
+
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+    if (!super.equals(o)) return false;
+
+    final ChildGenericValueColumnInfo that = (ChildGenericValueColumnInfo)o;
+
+    if (!myChildDescription.equals(that.myChildDescription)) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 31 * result + myChildDescription.hashCode();
+    return result;
+  }
+
+  public final TableCellEditor getEditor(T value) {
+    return myEditor;
+  }
+
+  public final Class<T> getColumnClass() {
+    return (Class<T>)ReflectionUtil.getRawType(myChildDescription.getType());
+  }
+
+  public TableCellRenderer getCustomizedRenderer(final T domElement, final TableCellRenderer renderer) {
+    assert domElement.isValid();
+    return getErrorableCellRenderer(renderer, domElement);
+  }
+
+  public DefaultTableCellRenderer getErrorableCellRenderer(final TableCellRenderer renderer, final T domElement) {
+    return new ErrorableTableCellRenderer<GenericDomValue>(getGenericValue(domElement), renderer, domElement);
+  }
+
+  public void setValue(final T o, final String aValue) {
+    getGenericValue(o).setStringValue(aValue);
+  }
+
+  protected final GenericDomValue getGenericValue(final T o) {
+    return (GenericDomValue)myChildDescription.getValues(o).get(0);
+  }
+
+  public final String valueOf(T object) {
+    if (!object.isValid()) return null;
+    final String stringValue = getGenericValue(object).getStringValue();
+    return StringUtil.isEmpty(stringValue) ? getEmptyValuePresentation(object) : stringValue;
+  }
+
+  protected final DomFixedChildDescription getChildDescription() {
+    return myChildDescription;
+  }
+
+  protected String getEmptyValuePresentation(T object) {
+    return "";
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/ComboControl.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/ComboControl.java
new file mode 100644
index 0000000..db9c5ed
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/ComboControl.java
@@ -0,0 +1,333 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Factory;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.ui.JBColor;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.highlighting.DomElementAnnotationsManager;
+import com.intellij.util.xml.highlighting.DomElementProblemDescriptor;
+import com.intellij.util.xml.highlighting.DomElementsProblemsHolder;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.*;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class ComboControl extends BaseModifiableControl<JComboBox, String> {
+  private static final Pair<String, Icon> EMPTY = new ComboBoxItem(" ", null);
+  private final Factory<List<Pair<String, Icon>>> myDataFactory;
+  private boolean myNullable;
+  private final Map<String, Icon> myIcons = new HashMap<String, Icon>();
+  private final ItemListener myCommitListener = new ItemListener() {
+    public void itemStateChanged(ItemEvent e) {
+      setModified();
+      commit();
+    }
+  };
+
+  public ComboControl(final GenericDomValue genericDomValue, final Factory<List<Pair<String, Icon>>> dataFactory) {
+    this(new DomStringWrapper(genericDomValue), dataFactory);
+  }
+
+  public ComboControl(final DomWrapper<String> domWrapper, final Factory<List<Pair<String, Icon>>> dataFactory) {
+    super(domWrapper);
+    myDataFactory = dataFactory;
+    reset();
+  }
+
+  public ComboControl(final DomWrapper<String> domWrapper, final Class<? extends Enum> aClass) {
+    super(domWrapper);
+    myDataFactory = createEnumFactory(aClass);
+    reset();
+  }
+
+  public final boolean isNullable() {
+    return myNullable;
+  }
+
+  public final void setNullable(final boolean nullable) {
+    myNullable = nullable;
+  }
+
+  public ComboControl(final GenericDomValue<?> reference) {
+    this(reference, createResolvingFunction(reference));
+  }
+
+  public static Factory<List<Pair<String, Icon>>> createResolvingFunction(final GenericDomValue<?> reference) {
+    return new Factory<List<Pair<String, Icon>>>() {
+      public List<Pair<String, Icon>> create() {
+        final Converter converter = reference.getConverter();
+        if (converter instanceof ResolvingConverter) {
+          final AbstractConvertContext context = new AbstractConvertContext() {
+            @NotNull
+            public DomElement getInvocationElement() {
+              return reference;
+            }
+          };
+          final ResolvingConverter resolvingConverter = (ResolvingConverter)converter;
+          final Collection<Object> variants = resolvingConverter.getVariants(context);
+          final List<Pair<String, Icon>> all = ContainerUtil.map(variants, new Function<Object, Pair<String, Icon>>() {
+            public Pair<String, Icon> fun(final Object s) {
+              return Pair.create(ElementPresentationManager.getElementName(s), ElementPresentationManager.getIcon(s));
+            }
+          });
+          all.addAll(ContainerUtil.map(resolvingConverter.getAdditionalVariants(context), new Function() {
+            public Object fun(final Object s) {
+              return new Pair(s, null);
+            }
+          }));
+          return all;
+        }
+        return Collections.emptyList();
+      }
+    };
+  }
+
+  public static Factory<Collection<? extends Object>> createVariantsGetter(final GenericDomValue<?> reference) {
+    return new Factory<Collection<? extends Object>>() {
+      public Collection<? extends Object> create() {
+        final Converter converter = reference.getConverter();
+        if (converter instanceof ResolvingConverter) {
+          return ((ResolvingConverter)converter).getVariants(new AbstractConvertContext() {
+            @NotNull
+            public DomElement getInvocationElement() {
+              return reference;
+            }
+          });
+
+        }
+        return Collections.emptyList();
+      }
+    };
+  }
+
+  public static Factory<List<Pair<String, Icon>>> createPresentationFunction(final Factory<Collection<? extends Object>> variantFactory) {
+    return new Factory<List<Pair<String, Icon>>>() {
+      public List<Pair<String, Icon>> create() {
+
+        return ContainerUtil.map(variantFactory.create(), new Function<Object, Pair<String, Icon>>() {
+          public Pair<String, Icon> fun(final Object s) {
+            return Pair.create(ElementPresentationManager.getElementName(s), ElementPresentationManager.getIcon(s));
+          }
+        });
+
+      }
+    };
+  }
+
+  static Factory<List<Pair<String, Icon>>> createEnumFactory(final Class<? extends Enum> aClass) {
+    return new Factory<List<Pair<String, Icon>>>() {
+      public List<Pair<String, Icon>> create() {
+        return ContainerUtil.map2List(aClass.getEnumConstants(), new Function<Enum, Pair<String, Icon>>() {
+          public Pair<String, Icon> fun(final Enum s) {
+            return Pair.create(NamedEnumUtil.getEnumValueByElement(s), ElementPresentationManager.getIcon(s));
+          }
+        });
+      }
+    };
+  }
+
+  public static <T extends Enum> JComboBox createEnumComboBox(final Class<T> type) {
+    return tuneUpComboBox(new JComboBox(), createEnumFactory(type));
+  }
+
+  private static JComboBox tuneUpComboBox(final JComboBox comboBox, Factory<List<Pair<String, Icon>>> dataFactory) {
+    final List<Pair<String, Icon>> list = dataFactory.create();
+    final Set<String> standardValues = new HashSet<String>();
+    for (final Pair<String, Icon> pair : list) {
+      comboBox.addItem(new ComboBoxItem(pair));
+      standardValues.add(pair.first);
+    }
+    return initComboBox(comboBox, new Condition<String>() {
+      public boolean value(final String object) {
+        return standardValues.contains(object);
+      }
+    });
+  }
+
+  private static class ComboBoxItem extends Pair<String,Icon> {
+
+    public ComboBoxItem(String first, Icon second) {
+      super(first, second);
+    }
+
+    public ComboBoxItem(Pair<String,Icon> pair) {
+      super(pair.first, pair.second);
+    }
+
+    public String toString() {
+      return StringUtil.notNullize(first);
+    }
+  }
+
+  static JComboBox initComboBox(final JComboBox comboBox, final Condition<String> validity) {
+    comboBox.setEditable(false);
+    comboBox.setPrototypeDisplayValue(new ComboBoxItem("A", null));
+    comboBox.setRenderer(new DefaultListCellRenderer() {
+      public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+        super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+        final Pair<String, Icon> pair = (Pair<String, Icon>)value;
+        final String text = pair == null ? null : pair.first;
+        setText(text);
+        final Dimension dimension = getPreferredSize();
+        if (!validity.value(text)) {
+          setFont(getFont().deriveFont(Font.ITALIC));
+          setForeground(JBColor.RED);
+        }
+        setIcon(pair == null ? null : pair.second);
+        setPreferredSize(new Dimension(-1, dimension.height));
+        return this;
+      }
+    });
+    return comboBox;
+  }
+
+  protected JComboBox createMainComponent(final JComboBox boundedComponent) {
+    return initComboBox(boundedComponent == null ? new JComboBox() : boundedComponent, new Condition<String>() {
+      public boolean value(final String object) {
+        return isValidValue(object);
+      }
+    });
+  }
+
+  public boolean isValidValue(final String object) {
+    return myNullable && object == EMPTY.first || myIcons.containsKey(object);
+  }
+
+  private boolean dataChanged(List<Pair<String, Icon>> newData) {
+    final JComboBox comboBox = getComponent();
+    final int size = comboBox.getItemCount();
+    final List<Pair<String, Icon>> oldData = new ArrayList<Pair<String, Icon>>(size);
+    for (int i = 0; i < size; i++) {
+      oldData.add((Pair<String, Icon>)comboBox.getItemAt(i));
+    }
+
+    if (myNullable) {
+      final LinkedList<Pair<String, Icon>> list = new LinkedList<Pair<String, Icon>>(newData);
+      list.addFirst(EMPTY);
+      newData = list;
+    }
+
+    return !newData.equals(oldData);
+  }
+
+  protected boolean isCommitted() {
+    return getComponent().isPopupVisible() || super.isCommitted();
+  }
+
+  protected void doReset() {
+    final List<Pair<String, Icon>> data = myDataFactory.create();
+    final JComboBox comboBox = getComponent();
+    comboBox.removeItemListener(myCommitListener);
+    try {
+      if (!dataChanged(data)) {
+        super.doReset();
+        return;
+      }
+
+      final String oldValue = getValue();
+      myIcons.clear();
+      comboBox.removeAllItems();
+      if (myNullable) {
+        comboBox.addItem(EMPTY);
+      }
+      for (final Pair<String, Icon> s : data) {
+        comboBox.addItem(new ComboBoxItem(s));
+        myIcons.put(s.first, s.second);
+      }
+      setValue(oldValue);
+      super.doReset();
+    }
+    finally {
+      comboBox.addItemListener(myCommitListener);
+    }
+  }
+
+  @Nullable
+  protected final String getValue() {
+    final Pair<String, Icon> pair = (Pair<String, Icon>)getComponent().getSelectedItem();
+    return pair == null || pair == EMPTY ? null : pair.first;
+  }
+
+  protected final void setValue(final String value) {
+    final JComboBox component = getComponent();
+    if (!isValidValue(value)) {
+      component.setEditable(true);
+    }
+    component.setSelectedItem(new ComboBoxItem(value, myIcons.get(value)));
+    component.setEditable(false);
+  }
+
+
+  protected void updateComponent() {
+    final DomElement domElement = getDomElement();
+    if (domElement == null || !domElement.isValid()) return;
+
+    final JComboBox comboBox = getComponent();
+
+    final Project project = getProject();
+    ApplicationManager.getApplication().invokeLater(new Runnable() {
+      public void run() {
+        if (!project.isOpen()) return;
+        if (!getDomWrapper().isValid()) return;
+
+        final DomElement domElement = getDomElement();
+        if (domElement == null || !domElement.isValid()) return;
+
+        final DomElementAnnotationsManager manager = DomElementAnnotationsManager.getInstance(project);
+        final DomElementsProblemsHolder holder = manager.getCachedProblemHolder(domElement);
+        final List<DomElementProblemDescriptor> errorProblems = holder.getProblems(domElement);
+        final List<DomElementProblemDescriptor> warningProblems = holder.getProblems(domElement, true, HighlightSeverity.WARNING);
+
+        Color background = getDefaultBackground();
+        comboBox.setToolTipText(null);
+
+        if (errorProblems.size() > 0) {
+          background = getErrorBackground();
+          comboBox.setToolTipText(TooltipUtils.getTooltipText(errorProblems));
+        }
+        else if (warningProblems.size() > 0) {
+          background = getWarningBackground();
+          comboBox.setToolTipText(TooltipUtils.getTooltipText(warningProblems));
+        }
+
+            final Pair<String, Icon> pair = (Pair<String, Icon>)comboBox.getSelectedItem();
+            final String s = pair == null ? null : pair.first;
+            background = s != null && s.trim().length() > 0 ? getDefaultBackground() : background;
+
+        comboBox.setBackground(background);
+        comboBox.getEditor().getEditorComponent().setBackground(background);
+      }
+    });
+
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/ComboTableCellEditor.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/ComboTableCellEditor.java
new file mode 100644
index 0000000..8e0ef03
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/ComboTableCellEditor.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Factory;
+import com.intellij.openapi.util.Pair;
+import com.intellij.util.containers.HashMap;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author peter
+ */
+public class ComboTableCellEditor extends DefaultCellEditor {
+  private final boolean myNullable;
+  private final Factory<List<Pair<String, Icon>>> myDataFactory;
+  private Map<String, Icon> myData;
+  private static final Pair<String,Icon> EMPTY = Pair.create(" ", null);
+
+  public ComboTableCellEditor(Factory<List<Pair<String, Icon>>> dataFactory, final boolean nullable) {
+    super(new JComboBox());
+    myDataFactory = dataFactory;
+    myNullable = nullable;
+    setClickCountToStart(2);
+    JComboBox comboBox = (JComboBox)editorComponent;
+    comboBox.setBorder(null);
+    comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
+    ComboControl.initComboBox(comboBox, new Condition<String>() {
+      public boolean value(final String object) {
+        return myData != null && myData.containsKey(object) || myNullable && EMPTY.first == object;
+      }
+    });
+  }
+
+  public ComboTableCellEditor(Class<? extends Enum> anEnum, final boolean nullable) {
+    this(ComboControl.createEnumFactory(anEnum), nullable);
+  }
+
+  public Object getCellEditorValue() {
+    final Pair<String,Icon> cellEditorValue = (Pair<String,Icon>)super.getCellEditorValue();
+    return EMPTY == cellEditorValue || null == cellEditorValue ? null : cellEditorValue.first;
+  }
+
+  public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
+    final List<Pair<String, Icon>> list = myDataFactory.create();
+    myData = new HashMap<String,Icon>();
+
+    final JComboBox comboBox = (JComboBox)editorComponent;
+    comboBox.removeAllItems();
+    if (myNullable) {
+      comboBox.addItem(EMPTY);
+    }
+    for (final Pair<String, Icon> pair : list) {
+      myData.put(pair.first, pair.second);
+      comboBox.addItem(pair);
+    }
+    final Pair<Object, Icon> pair = Pair.create(value, myData.get(value));
+    comboBox.setEditable(true);
+    super.getTableCellEditorComponent(table, pair, isSelected, row, column);
+    comboBox.setEditable(false);
+    return comboBox;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/CommitAdapter.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/CommitAdapter.java
new file mode 100644
index 0000000..537fc1f
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/CommitAdapter.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+/**
+ * @author peter
+ */
+public abstract class CommitAdapter implements CommitListener{
+  public void beforeCommit(DomUIControl control) {
+  }
+
+  public void afterCommit(DomUIControl control) {
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/CommitListener.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/CommitListener.java
new file mode 100644
index 0000000..54c40b9
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/CommitListener.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import java.util.EventListener;
+
+/**
+ * @author peter
+ */
+public interface CommitListener extends EventListener {
+  void beforeCommit(DomUIControl control);
+  void afterCommit(DomUIControl control);
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/CommitablePanelUserActivityListener.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/CommitablePanelUserActivityListener.java
new file mode 100644
index 0000000..82ca2b9
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/CommitablePanelUserActivityListener.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui;
+
+import com.intellij.ui.UserActivityListener;
+import com.intellij.util.Alarm;
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.progress.ProgressIndicator;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class CommitablePanelUserActivityListener implements UserActivityListener, Disposable {
+  private final Committable myPanel;
+  private final Project myProject;
+  private final Alarm myAlarm = new Alarm();
+  private boolean myApplying;
+
+  public CommitablePanelUserActivityListener(Project project) {
+    this(null, project);
+  }
+
+  public CommitablePanelUserActivityListener(final Committable panel, Project project) {
+    myPanel = panel;
+    myProject = project;
+  }
+
+  final public void stateChanged() {
+    if (myApplying) return;
+    cancel();
+    cancelAllRequests();
+    myAlarm.addRequest(new Runnable() {
+      public void run() {
+        myApplying = true;
+        cancel();
+        try {
+          applyChanges();
+        }
+        finally {
+          myApplying = false;
+        }
+      }
+    }, 717);
+  }
+
+  private static void cancel() {
+    final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
+    if (indicator != null) {
+      indicator.cancel();
+    }
+  }
+
+  protected void applyChanges() {
+    if (myPanel != null) {
+      commit(myPanel);
+    }
+  }
+
+  protected final void commit(final Committable panel) {
+    ServiceManager.getService(getProject(), CommittableUtil.class).commit(panel);
+  }
+
+  protected final Project getProject() {
+    return myProject;
+  }
+
+  public final boolean isWaiting() {
+    return myAlarm.getActiveRequestCount() > 0;
+  }
+
+  public final void cancelAllRequests() {
+    myAlarm.cancelAllRequests();
+  }
+
+  public void dispose() {
+    cancelAllRequests();
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/Committable.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/Committable.java
new file mode 100644
index 0000000..8ba4190
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/Committable.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.Disposable;
+
+/**
+ * author: lesya
+ */
+public interface Committable extends Disposable {
+  void commit();
+
+  void reset();
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/CommittablePanel.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/CommittablePanel.java
new file mode 100644
index 0000000..6eb4f88
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/CommittablePanel.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import javax.swing.*;
+
+/**
+ * author: lesya
+ */
+public interface CommittablePanel extends Committable {
+  JComponent getComponent();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/CommittableUtil.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/CommittableUtil.java
new file mode 100644
index 0000000..8f4ba44
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/CommittableUtil.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public class CommittableUtil {
+
+  public void commit(@NotNull Committable committable) {
+    committable.commit();
+  }
+
+  public static void updateHighlighting(@Nullable Committable committable) {
+    if (committable instanceof Highlightable) {
+      ((Highlightable)committable).updateHighlighting();
+    }
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/CompositeCommittable.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/CompositeCommittable.java
new file mode 100644
index 0000000..edb0749
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/CompositeCommittable.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.util.Disposer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * author: lesya
+ */
+public class CompositeCommittable implements Committable, Highlightable {
+  private final List<Committable> myComponents = new ArrayList<Committable>();
+
+  public final <T extends Committable> T addComponent(T panel) {
+    myComponents.add(panel);
+    Disposer.register(this, panel);
+    return panel;
+  }
+
+  public void commit() {
+    for (final Committable committable : myComponents) {
+      committable.commit();
+    }
+  }
+
+  public void reset() {
+    for (final Committable committable : myComponents) {
+      committable.reset();
+    }
+  }
+
+  public void dispose() {
+  }
+
+  public List<Committable> getChildren() {
+    return myComponents;
+  }
+
+  public void updateHighlighting() {
+    for (final Committable component : myComponents) {
+      CommittableUtil.updateHighlighting(component);
+    }
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/DomCollectionControl.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomCollectionControl.java
new file mode 100644
index 0000000..ba69ab5
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomCollectionControl.java
@@ -0,0 +1,467 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.application.ApplicationBundle;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiUtilCore;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.ui.CommonActionsPanel;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.EventDispatcher;
+import com.intellij.util.IconUtil;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.HashSet;
+import com.intellij.util.ui.ColumnInfo;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.highlighting.DomCollectionProblemDescriptor;
+import com.intellij.util.xml.highlighting.DomElementAnnotationsManager;
+import com.intellij.util.xml.highlighting.DomElementProblemDescriptor;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import com.intellij.util.xml.ui.actions.AddDomElementAction;
+import com.intellij.util.xml.ui.actions.DefaultAddAction;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.*;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author peter
+ */
+public class DomCollectionControl<T extends DomElement> extends DomUIControl implements Highlightable, TypeSafeDataProvider {
+  private static final DataKey<DomCollectionControl> DOM_COLLECTION_CONTROL = DataKey.create("DomCollectionControl");
+
+  private final EventDispatcher<CommitListener> myDispatcher = EventDispatcher.create(CommitListener.class);
+  private DomTableView myCollectionPanel;
+
+  private final DomElement myParentDomElement;
+  private final DomCollectionChildDescription myChildDescription;
+  private List<T> myCollectionElements = new ArrayList<T>();
+  private ColumnInfo<T, ?>[] myColumnInfos;
+  private boolean myEditable = false;
+  public static final Icon ADD_ICON = IconUtil.getAddIcon();
+  public static final Icon EDIT_ICON = IconUtil.getEditIcon();
+  public static final Icon REMOVE_ICON = IconUtil.getRemoveIcon();
+
+  public DomCollectionControl(DomElement parentElement,
+                              DomCollectionChildDescription description,
+                              final boolean editable,
+                              ColumnInfo<T, ?>... columnInfos) {
+    myChildDescription = description;
+    myParentDomElement = parentElement;
+    myColumnInfos = columnInfos;
+    myEditable = editable;
+  }
+
+  public DomCollectionControl(DomElement parentElement,
+                              @NonNls String subTagName,
+                              final boolean editable,
+                              ColumnInfo<T, ?>... columnInfos) {
+    this(parentElement, parentElement.getGenericInfo().getCollectionChildDescription(subTagName), editable, columnInfos);
+  }
+
+  public DomCollectionControl(DomElement parentElement, DomCollectionChildDescription description) {
+    myChildDescription = description;
+    myParentDomElement = parentElement;
+  }
+
+  public DomCollectionControl(DomElement parentElement, @NonNls String subTagName) {
+    this(parentElement, parentElement.getGenericInfo().getCollectionChildDescription(subTagName));
+  }
+
+  public boolean isEditable() {
+    return myEditable;
+  }
+
+  public void bind(JComponent component) {
+    assert component instanceof DomTableView;
+
+    initialize((DomTableView)component);
+  }
+
+  public void addCommitListener(CommitListener listener) {
+    myDispatcher.addListener(listener);
+  }
+
+  public void removeCommitListener(CommitListener listener) {
+    myDispatcher.removeListener(listener);
+  }
+
+
+  public boolean canNavigate(DomElement element) {
+    final Class<DomElement> aClass = (Class<DomElement>)ReflectionUtil.getRawType(myChildDescription.getType());
+
+    final DomElement domElement = element.getParentOfType(aClass, false);
+
+    return domElement != null && myCollectionElements.contains(domElement);
+  }
+
+  public void navigate(DomElement element) {
+    final Class<DomElement> aClass = (Class<DomElement>)ReflectionUtil.getRawType(myChildDescription.getType());
+    final DomElement domElement = element.getParentOfType(aClass, false);
+
+    int index = myCollectionElements.indexOf(domElement);
+    if (index < 0) index = 0;
+
+    myCollectionPanel.getTable().setRowSelectionInterval(index, index);
+  }
+
+  public void calcData(final DataKey key, final DataSink sink) {
+    if (DOM_COLLECTION_CONTROL.equals(key)) {
+      sink.put(DOM_COLLECTION_CONTROL, this);
+    }
+  }
+
+  @Nullable
+  protected String getHelpId() {
+    return null;
+  }
+
+  @Nullable
+  protected String getEmptyPaneText() {
+    return null;
+  }
+
+  protected void initialize(final DomTableView boundComponent) {
+    if (boundComponent == null) {
+      myCollectionPanel = new DomTableView(getProject(), getEmptyPaneText(), getHelpId());
+    }
+    else {
+      myCollectionPanel = boundComponent;
+    }
+    myCollectionPanel.setToolbarActions(new AddAction(), new EditAction(), new RemoveAction());
+    myCollectionPanel.installPopup(ActionPlaces.J2EE_ATTRIBUTES_VIEW_POPUP, createPopupActionGroup());
+    myCollectionPanel.initializeTable();
+    myCollectionPanel.addCustomDataProvider(this);
+    myCollectionPanel.addChangeListener(new DomTableView.ChangeListener() {
+      public void changed() {
+        reset();
+      }
+    });
+    reset();
+  }
+
+  protected DefaultActionGroup createPopupActionGroup() {
+    final DefaultActionGroup group = new DefaultActionGroup();
+    group.addAll((DefaultActionGroup)ActionManager.getInstance().getAction("DomCollectionControl"));
+    return group;
+  }
+
+  protected ColumnInfo[] createColumnInfos(DomElement parent) {
+    return myColumnInfos;
+  }
+
+  protected final void doEdit() {
+    doEdit(myCollectionElements.get(myCollectionPanel.getTable().getSelectedRow()));
+  }
+
+  protected void doEdit(final T t) {
+    final DomEditorManager manager = getDomEditorManager(this);
+    if (manager != null) {
+      manager.openDomElementEditor(t);
+    }
+  }
+
+  protected void doRemove(final List<T> toDelete) {
+    Set<PsiFile> files = new HashSet<PsiFile>();
+    for (final T t : toDelete) {
+      final XmlElement element = t.getXmlElement();
+      if (element != null) {
+        ContainerUtil.addIfNotNull(element.getContainingFile(), files);
+      }
+    }
+
+    new WriteCommandAction(getProject(), PsiUtilCore.toPsiFileArray(files)) {
+      protected void run(Result result) throws Throwable {
+        for (final T t : toDelete) {
+          if (t.isValid()) {
+            t.undefine();
+          }
+        }
+      }
+    }.execute();
+  }
+
+  protected final void doRemove() {
+    ApplicationManager.getApplication().invokeLater(new Runnable() {
+      public void run() {
+        final int[] selected = myCollectionPanel.getTable().getSelectedRows();
+        if (selected == null || selected.length == 0) return;
+        final List<T> selectedElements = new ArrayList<T>(selected.length);
+        for (final int i : selected) {
+          selectedElements.add(myCollectionElements.get(i));
+        }
+
+        doRemove(selectedElements);
+        reset();
+        int selection = selected[0];
+        if (selection >= myCollectionElements.size()) {
+          selection = myCollectionElements.size() - 1;
+        }
+        if (selection >= 0) {
+          myCollectionPanel.getTable().setRowSelectionInterval(selection, selection);
+        }
+      }
+    });
+  }
+
+  protected static void performWriteCommandAction(final WriteCommandAction writeCommandAction) {
+    writeCommandAction.execute();
+  }
+
+  public void commit() {
+    final CommitListener listener = myDispatcher.getMulticaster();
+    listener.beforeCommit(this);
+    listener.afterCommit(this);
+    validate();
+  }
+
+  private void validate() {
+    DomElement domElement = getDomElement();
+    final List<DomElementProblemDescriptor> list =
+      DomElementAnnotationsManager.getInstance(getProject()).getCachedProblemHolder(domElement).getProblems(domElement);
+    final List<String> messages = new ArrayList<String>();
+    for (final DomElementProblemDescriptor descriptor : list) {
+      if (descriptor instanceof DomCollectionProblemDescriptor
+          && myChildDescription.equals(((DomCollectionProblemDescriptor)descriptor).getChildDescription())) {
+        messages.add(descriptor.getDescriptionTemplate());
+      }
+    }
+    myCollectionPanel.setErrorMessages(ArrayUtil.toStringArray(messages));
+    myCollectionPanel.repaint();
+  }
+
+  public void dispose() {
+    if (myCollectionPanel != null) {
+      myCollectionPanel.dispose();
+    }
+  }
+
+  protected final Project getProject() {
+    return myParentDomElement.getManager().getProject();
+  }
+
+  public DomTableView getComponent() {
+    if (myCollectionPanel == null) initialize(null);
+
+    return myCollectionPanel;
+  }
+
+  public final DomCollectionChildDescription getChildDescription() {
+    return myChildDescription;
+  }
+
+  public final DomElement getDomElement() {
+    return myParentDomElement;
+  }
+
+  public final void reset() {
+    myCollectionElements = new ArrayList<T>(getCollectionElements());
+    myCollectionPanel.reset(createColumnInfos(myParentDomElement), myCollectionElements);
+    validate();
+  }
+
+  public List<T> getCollectionElements() {
+    return (List<T>)myChildDescription.getValues(myParentDomElement);
+  }
+
+  @Nullable
+  protected AnAction[] createAdditionActions() {
+    return null;
+  }
+
+  protected DefaultAddAction createDefaultAction(final String name, final Icon icon, final Type type) {
+    return new ControlAddAction(name, name, icon) {
+      protected Type getElementType() {
+        return type;
+      }
+    };
+  }
+
+  protected final Class<? extends T> getCollectionElementClass() {
+    return (Class<? extends T>)ReflectionUtil.getRawType(myChildDescription.getType());
+  }
+
+
+  @Nullable
+  private static DomEditorManager getDomEditorManager(DomUIControl control) {
+    JComponent component = control.getComponent();
+    while (component != null && !(component instanceof DomEditorManager)) {
+      final Container parent = component.getParent();
+      if (!(parent instanceof JComponent)) {
+        return null;
+      }
+      component = (JComponent)parent;
+    }
+    return (DomEditorManager)component;
+  }
+
+  public void updateHighlighting() {
+    if (myCollectionPanel != null) {
+      myCollectionPanel.revalidate();
+      myCollectionPanel.repaint();
+    }
+  }
+
+  public class ControlAddAction extends DefaultAddAction<T> {
+
+    public ControlAddAction() {
+    }
+
+    public ControlAddAction(final String text) {
+      super(text);
+    }
+
+    public ControlAddAction(final String text, final String description, final Icon icon) {
+      super(text, description, icon);
+    }
+
+    protected final DomCollectionChildDescription getDomCollectionChildDescription() {
+      return myChildDescription;
+    }
+
+    protected final DomElement getParentDomElement() {
+      return myParentDomElement;
+    }
+
+    /**
+     * return negative value to disable auto-edit
+     * @return
+     */
+    protected int getColumnToEditAfterAddition() {
+      return 0;
+    }
+
+    protected void afterAddition(final JTable table, final int rowIndex) {
+      table.setRowSelectionInterval(rowIndex, rowIndex);
+      final int column = getColumnToEditAfterAddition();
+      if (column >= 0 ) {
+        table.editCellAt(rowIndex, column);
+      }
+    }
+
+    protected final void afterAddition(final T newElement) {
+      reset();
+      afterAddition(myCollectionPanel.getTable(), myCollectionElements.size() - 1);
+    }
+  }
+
+  public static DomCollectionControl getDomCollectionControl(final AnActionEvent e) {
+    return e.getData(DOM_COLLECTION_CONTROL);
+  }
+
+  public static class AddAction extends AddDomElementAction {
+
+    public AddAction() {
+      setShortcutSet(CommonActionsPanel.getCommonShortcut(CommonActionsPanel.Buttons.ADD));
+    }
+
+    protected boolean isEnabled(final AnActionEvent e) {
+      return getDomCollectionControl(e) != null;
+    }
+
+    protected DomCollectionControl getDomCollectionControl(final AnActionEvent e) {
+      return DomCollectionControl.getDomCollectionControl(e);
+    }
+
+    @NotNull
+    protected DomCollectionChildDescription[] getDomCollectionChildDescriptions(final AnActionEvent e) {
+      return new DomCollectionChildDescription[] {getDomCollectionControl(e).getChildDescription()};
+    }
+
+    protected DomElement getParentDomElement(final AnActionEvent e) {
+      return getDomCollectionControl(e).getDomElement();
+    }
+
+    protected JComponent getComponent(AnActionEvent e) {
+      return getDomCollectionControl(e).getComponent();
+    }
+
+    @NotNull
+    public AnAction[] getChildren(final AnActionEvent e) {
+      final DomCollectionControl control = getDomCollectionControl(e);
+      AnAction[] actions = control.createAdditionActions();
+      return actions == null ? super.getChildren(e) : actions;
+    }
+
+    protected DefaultAddAction createAddingAction(final AnActionEvent e,
+                                                  final String name,
+                                                  final Icon icon,
+                                                  final Type type,
+                                                  final DomCollectionChildDescription description) {
+      return getDomCollectionControl(e).createDefaultAction(name, icon, type);
+    }
+
+  }
+
+  public static class EditAction extends AnAction {
+
+    public EditAction() {
+      super(ApplicationBundle.message("action.edit"), null, DomCollectionControl.EDIT_ICON);
+      setShortcutSet(CommonActionsPanel.getCommonShortcut(CommonActionsPanel.Buttons.EDIT));
+    }
+
+    public void actionPerformed(AnActionEvent e) {
+      final DomCollectionControl control = DomCollectionControl.getDomCollectionControl(e);
+      control.doEdit();
+      control.reset();
+    }
+
+    public void update(AnActionEvent e) {
+      final DomCollectionControl control = DomCollectionControl.getDomCollectionControl(e);
+      final boolean visible = control != null && control.isEditable();
+      e.getPresentation().setVisible(visible);
+      e.getPresentation().setEnabled(visible && control.getComponent().getTable().getSelectedRowCount() == 1);
+    }
+  }
+
+  public static class RemoveAction extends AnAction {
+    public RemoveAction() {
+      super(ApplicationBundle.message("action.remove"), null, DomCollectionControl.REMOVE_ICON);
+      setShortcutSet(CommonActionsPanel.getCommonShortcut(CommonActionsPanel.Buttons.REMOVE));
+    }
+
+    public void actionPerformed(AnActionEvent e) {
+      final DomCollectionControl control = DomCollectionControl.getDomCollectionControl(e);
+      control.doRemove();
+      control.reset();
+    }
+
+    public void update(AnActionEvent e) {
+      final boolean enabled;
+      final DomCollectionControl control = DomCollectionControl.getDomCollectionControl(e);
+      if (control != null) {
+        final JTable table = control.getComponent().getTable();
+        enabled = table != null && table.getSelectedRowCount() > 0;
+      } else {
+        enabled = false;
+      }
+      e.getPresentation().setEnabled(enabled);
+    }
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/DomCollectionWrapper.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomCollectionWrapper.java
new file mode 100644
index 0000000..b2c25d91
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomCollectionWrapper.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import org.jetbrains.annotations.NotNull;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class DomCollectionWrapper<T> extends DomWrapper<T>{
+  private final DomElement myDomElement;
+  private final DomCollectionChildDescription myChildDescription;
+  private final Method mySetter;
+  private final Method myGetter;
+
+  public DomCollectionWrapper(final DomElement domElement,
+                              final DomCollectionChildDescription childDescription) {
+    this(domElement, childDescription, 
+         DomUIFactory.findMethod(ReflectionUtil.getRawType(childDescription.getType()), "setValue"),
+         DomUIFactory.findMethod(ReflectionUtil.getRawType(childDescription.getType()), "getValue"));
+  }
+
+  public DomCollectionWrapper(final DomElement domElement,
+                              final DomCollectionChildDescription childDescription,
+                              final Method setter,
+                              final Method getter) {
+    myDomElement = domElement;
+    myChildDescription = childDescription;
+    mySetter = setter;
+    myGetter = getter;
+  }
+
+  @NotNull
+  public DomElement getExistingDomElement() {
+    return myDomElement;
+  }
+
+  public DomElement getWrappedElement() {
+    final List<? extends DomElement> list = myChildDescription.getValues(myDomElement);
+    return list.isEmpty() ? null : list.get(0);
+  }
+
+  public void setValue(final T value) throws IllegalAccessException, InvocationTargetException {
+    final List<? extends DomElement> list = myChildDescription.getValues(myDomElement);
+    final DomElement domElement;
+    if (list.isEmpty()) {
+      domElement = myChildDescription.addValue(myDomElement);
+    } else {
+      domElement = list.get(0);
+    }
+    mySetter.invoke(domElement, value);
+  }
+
+  public T getValue() throws IllegalAccessException, InvocationTargetException {
+    if (!myDomElement.isValid()) return null;
+    final List<? extends DomElement> list = myChildDescription.getValues(myDomElement);
+    return list.isEmpty() ? null : (T)myGetter.invoke(list.get(0));
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/DomColumnInfo.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomColumnInfo.java
new file mode 100644
index 0000000..044bb44
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomColumnInfo.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.ui.ColumnInfo;
+
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellRenderer;
+
+/**
+ * @author peter
+ */
+public abstract class DomColumnInfo<T, Aspect> extends ColumnInfo<T, Aspect> {
+  private final TableCellRenderer myRenderer;
+
+  public DomColumnInfo(String name) {
+    this(name, new DefaultTableCellRenderer());
+  }
+
+  public DomColumnInfo(String name, final TableCellRenderer renderer) {
+    super(name);
+    myRenderer = renderer;
+  }
+
+  public boolean isCellEditable(final T o) {
+    return getEditor(o) != null;
+  }
+
+  public TableCellRenderer getRenderer(T value) {
+    return myRenderer;
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/DomEditorManager.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomEditorManager.java
new file mode 100644
index 0000000..420a138
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomEditorManager.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.xml.DomElement;
+
+/**
+ * @author peter
+ */
+public interface DomEditorManager {
+  void openDomElementEditor(DomElement domElement) ;
+  DomElement getCurrentEditedElement();
+
+  void commitCurrentEditor();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/DomFileEditor.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomFileEditor.java
new file mode 100644
index 0000000..c7c219d
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomFileEditor.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.codeHighlighting.BackgroundEditorHighlighter;
+import com.intellij.openapi.MnemonicHelper;
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.util.Factory;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.highlighting.DomElementAnnotationsManager;
+import com.intellij.util.xml.events.DomEvent;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * @author peter
+ */
+public class DomFileEditor<T extends BasicDomElementComponent> extends PerspectiveFileEditor implements CommittablePanel, Highlightable {
+  private final String myName;
+  private final Factory<? extends T> myComponentFactory;
+  private T myComponent;
+
+  public DomFileEditor(final DomElement element, final String name, final T component) {
+    this(element.getManager().getProject(), DomUtil.getFile(element).getVirtualFile(), name, component);
+  }
+
+  public DomFileEditor(final Project project, final VirtualFile file, final String name, final T component) {
+    this(project, file, name, new Factory<T>() {
+      public T create() {
+        return component;
+      }
+    });
+  }
+
+  public DomFileEditor(final Project project, final VirtualFile file, final String name, final Factory<? extends T> component) {
+    super(project, file);
+    myComponentFactory = component;
+    myName = name;
+    
+    DomElementAnnotationsManager.getInstance(project).addHighlightingListener(new DomElementAnnotationsManager.DomHighlightingListener() {
+      public void highlightingFinished(@NotNull DomFileElement element) {
+        if (isInitialised() && getComponent().isShowing() && element.isValid()) {
+          updateHighlighting();
+        }
+      }
+    }, this);
+  }
+
+  public void updateHighlighting() {
+    if (checkIsValid()) {
+      CommittableUtil.updateHighlighting(myComponent);
+    }
+  }
+
+  public void commit() {
+    if (checkIsValid() && isInitialised()) {
+      setShowing(false);
+      try {
+        ServiceManager.getService(getProject(), CommittableUtil.class).commit(myComponent);
+      }
+      finally {
+        setShowing(true);
+      }
+    }
+  }
+
+  @Nullable
+  public JComponent getPreferredFocusedComponent() {
+    ensureInitialized();
+    return myComponent.getComponent();
+  }
+
+  protected final T getDomComponent() {
+    return myComponent;
+  }
+
+  @NotNull
+  protected JComponent createCustomComponent() {
+    new MnemonicHelper().register(getComponent());
+    myComponent = myComponentFactory.create();
+    DomUIFactory.getDomUIFactory().setupErrorOutdatingUserActivityWatcher(this, getDomElement());
+    DomManager.getDomManager(getProject()).addDomEventListener(new DomEventListener() {
+      public void eventOccured(DomEvent event) {
+        checkIsValid();
+      }
+    }, this);
+    Disposer.register(this, myComponent);
+    return myComponent.getComponent();
+  }
+
+  @NotNull
+  public final String getName() {
+    return myName;
+  }
+
+  protected DomElement getSelectedDomElement() {
+    return DomUINavigationProvider.findDomElement(myComponent);
+  }
+
+  protected void setSelectedDomElement(DomElement domElement) {
+    final DomUIControl domControl = DomUINavigationProvider.findDomControl(myComponent, domElement);
+    if (domControl != null) {
+      domControl.navigate(domElement);
+    }
+  }
+
+  public BackgroundEditorHighlighter getBackgroundHighlighter() {
+    ensureInitialized();
+    return DomUIFactory.getDomUIFactory().createDomHighlighter(getProject(), this, getDomElement());
+  }
+
+  private DomElement getDomElement() {
+    return myComponent.getDomElement();
+  }
+
+
+  public boolean isValid() {
+    return super.isValid() && (!isInitialised() || getDomElement().isValid());
+  }
+
+  public void reset() {
+    if (checkIsValid()) {
+      myComponent.reset();
+    }
+  }
+
+  public static DomFileEditor createDomFileEditor(final String name,
+                                                  @Nullable final Icon icon,
+                                                  final DomElement element,
+                                                  final Factory<? extends CommittablePanel> committablePanel) {
+
+    final XmlFile file = DomUtil.getFile(element);
+    final Factory<BasicDomElementComponent> factory = new Factory<BasicDomElementComponent>() {
+      public BasicDomElementComponent create() {
+
+        CaptionComponent captionComponent = new CaptionComponent(name, icon);
+        captionComponent.initErrorPanel(element);
+        BasicDomElementComponent component = createComponentWithCaption(committablePanel.create(), captionComponent, element);
+        Disposer.register(component, captionComponent);
+        return component;
+      }
+    };
+    return new DomFileEditor<BasicDomElementComponent>(file.getProject(), file.getVirtualFile(), name, factory) {
+      public JComponent getPreferredFocusedComponent() {
+        return null;
+      }
+    };
+  }
+
+  public static BasicDomElementComponent createComponentWithCaption(final CommittablePanel committablePanel,
+                                                                    final CaptionComponent captionComponent,
+                                                                    final DomElement element) {
+    final JPanel panel = new JPanel(new BorderLayout());
+    panel.add(captionComponent, BorderLayout.NORTH);
+    panel.add(element.isValid() ? committablePanel.getComponent() : new JPanel(), BorderLayout.CENTER);
+
+    BasicDomElementComponent component = new BasicDomElementComponent(element) {
+      public JComponent getComponent() {
+        return panel;
+      }
+    };
+
+    component.addComponent(committablePanel);
+    component.addComponent(captionComponent);
+    return component;
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/DomFixedWrapper.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomFixedWrapper.java
new file mode 100644
index 0000000..7597791
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomFixedWrapper.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.GenericDomValue;
+import org.jetbrains.annotations.NotNull;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * @author peter
+ */
+public class DomFixedWrapper<T> extends DomWrapper<T>{
+  private final GenericDomValue myDomElement;
+
+  public DomFixedWrapper(final GenericDomValue<? extends T> domElement) {
+    myDomElement = domElement;
+  }
+
+  public DomElement getWrappedElement() {
+    return myDomElement;
+  }
+
+  public void setValue(final T value) throws IllegalAccessException, InvocationTargetException {
+    DomUIFactory.SET_VALUE_METHOD.invoke(getWrappedElement(), value);
+  }
+
+  public T getValue() throws IllegalAccessException, InvocationTargetException {
+    final DomElement element = getWrappedElement();
+    return element.isValid() ? (T)DomUIFactory.GET_VALUE_METHOD.invoke(element) : null;
+  }
+
+  @NotNull
+  public DomElement getExistingDomElement() {
+    return myDomElement;
+  }
+
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/DomStringWrapper.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomStringWrapper.java
new file mode 100644
index 0000000..b2e9c29
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomStringWrapper.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.GenericDomValue;
+import org.jetbrains.annotations.NotNull;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * @author peter
+ */
+public class DomStringWrapper extends DomWrapper<String>{
+  private final GenericDomValue myDomElement;
+
+  public DomStringWrapper(final GenericDomValue domElement) {
+    myDomElement = domElement;
+  }
+
+  @NotNull
+  public DomElement getExistingDomElement() {
+    return myDomElement;
+  }
+
+  public DomElement getWrappedElement() {
+    return myDomElement;
+  }
+
+  public void setValue(final String value) throws IllegalAccessException, InvocationTargetException {
+    myDomElement.setStringValue(value);
+  }
+
+  public String getValue() throws IllegalAccessException, InvocationTargetException {
+    return myDomElement.isValid() ? myDomElement.getStringValue() : null;
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/DomTableView.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomTableView.java
new file mode 100644
index 0000000..f25fbfc
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomTableView.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.project.Project;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.SmartList;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class DomTableView extends AbstractTableView<DomElement> {
+  private final List<TypeSafeDataProvider> myCustomDataProviders = new SmartList<TypeSafeDataProvider>();
+
+  public DomTableView(final Project project) {
+    super(project);
+  }
+
+  public DomTableView(final Project project, final String emptyPaneText, final String helpID) {
+    super(project, emptyPaneText, helpID);
+  }
+
+  public void addCustomDataProvider(TypeSafeDataProvider provider) {
+    myCustomDataProviders.add(provider);
+  }
+
+  public void calcData(final DataKey key, final DataSink sink) {
+    super.calcData(key, sink);
+    for (final TypeSafeDataProvider customDataProvider : myCustomDataProviders) {
+      customDataProvider.calcData(key, sink);
+    }
+  }
+
+  @Deprecated
+  protected final void installPopup(final DefaultActionGroup group) {
+    installPopup(ActionPlaces.J2EE_ATTRIBUTES_VIEW_POPUP, group);
+  }
+
+  protected void wrapValueSetting(@NotNull final DomElement domElement, final Runnable valueSetter) {
+    if (domElement.isValid()) {
+      new WriteCommandAction(getProject(), DomUtil.getFile(domElement)) {
+        protected void run(final Result result) throws Throwable {
+          valueSetter.run();
+        }
+      }.execute();
+      fireChanged();
+    }
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/DomUIControl.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomUIControl.java
new file mode 100644
index 0000000..db205a6
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomUIControl.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.xml.DomElement;
+
+import javax.swing.*;
+
+/**
+ * @author peter
+ * 
+ * @see DomUIFactory
+ */
+public abstract class DomUIControl<T extends DomElement> implements CommittablePanel {
+
+  public abstract T getDomElement();
+
+  public abstract void bind(JComponent component);
+
+  public abstract void addCommitListener(CommitListener listener);
+
+  public abstract void removeCommitListener(CommitListener listener);
+
+  public abstract boolean canNavigate(DomElement element);
+
+  public abstract void navigate(DomElement element);
+
+  public void addDependency(final DomUIControl control) {
+    control.addCommitListener(new CommitAdapter() {
+      @Override
+      public void afterCommit(final DomUIControl control) {
+        reset();
+      }
+    });
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/DomUIFactory.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomUIFactory.java
new file mode 100644
index 0000000..221b6f3
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomUIFactory.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.codeHighlighting.BackgroundEditorHighlighter;
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.project.Project;
+import com.intellij.ui.UserActivityWatcher;
+import com.intellij.util.Consumer;
+import com.intellij.util.Function;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.ui.ColumnInfo;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.GenericDomValue;
+import com.intellij.util.xml.Required;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.table.TableCellEditor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+
+/**
+ * @author peter
+ */
+public abstract class DomUIFactory {
+
+  public final static ExtensionPointName<Consumer<DomUIFactory>> EXTENSION_POINT_NAME = ExtensionPointName.create("com.intellij.dom.uiControlsProvider");
+
+  public static Method GET_VALUE_METHOD = ReflectionUtil.getMethod(GenericDomValue.class, "getValue");
+  public static Method SET_VALUE_METHOD = findMethod(GenericDomValue.class, "setValue");
+  public static Method GET_STRING_METHOD = ReflectionUtil.getMethod(GenericDomValue.class, "getStringValue");
+  public static Method SET_STRING_METHOD = findMethod(GenericDomValue.class, "setStringValue");
+
+  @NotNull
+  public static DomUIControl<GenericDomValue> createControl(GenericDomValue element) {
+    return createControl(element, false);
+  }
+
+  @NotNull
+  public static DomUIControl<GenericDomValue> createControl(GenericDomValue element, boolean commitOnEveryChange) {
+    return createGenericValueControl(DomUtil.getGenericValueParameter(element.getDomElementType()), element, commitOnEveryChange);
+  }
+
+  public static DomUIControl createSmallDescriptionControl(DomElement parent, final boolean commitOnEveryChange) {
+    return createLargeDescriptionControl(parent, commitOnEveryChange);
+  }
+
+  public static DomUIControl createLargeDescriptionControl(DomElement parent, final boolean commitOnEveryChange) {
+    return getDomUIFactory().createTextControl(new DomCollectionWrapper<String>(parent, parent.getGenericInfo().getCollectionChildDescription("description")), commitOnEveryChange);
+  }
+
+  @NotNull
+  private static BaseControl createGenericValueControl(final Type type, final GenericDomValue<?> element, boolean commitOnEveryChange) {
+    final DomStringWrapper stringWrapper = new DomStringWrapper(element);
+    final Class rawType = ReflectionUtil.getRawType(type);
+    if (type instanceof Class && Enum.class.isAssignableFrom(rawType)) {
+      return new ComboControl(stringWrapper, rawType);
+    }
+    if (DomElement.class.isAssignableFrom(rawType)) {
+      final ComboControl control = new ComboControl(element);
+      final Required annotation = element.getAnnotation(Required.class);
+      if (annotation == null || !annotation.value() || !annotation.nonEmpty()) {
+        control.setNullable(true);
+      }
+      return control;
+    }
+
+    final DomFixedWrapper wrapper = new DomFixedWrapper(element);
+    if (type.equals(boolean.class) || type.equals(Boolean.class)) {
+      return new BooleanControl(wrapper);
+    }
+    if (type.equals(String.class)) {
+      return getDomUIFactory().createTextControl(wrapper, commitOnEveryChange);
+    }
+
+    final BaseControl customControl = getDomUIFactory().createCustomControl(type, stringWrapper, commitOnEveryChange);
+    if (customControl != null) return customControl;
+
+    return getDomUIFactory().createTextControl(stringWrapper, commitOnEveryChange);
+  }
+
+  @Nullable
+  public static Method findMethod(Class clazz, @NonNls String methodName) {
+    for (Method method : clazz.getMethods()) {
+      if (methodName.equals(method.getName())) {
+        return method;
+      }
+    }
+    return null;
+  }
+
+  public static TableCellEditor createCellEditor(GenericDomValue genericDomValue) {
+    return getDomUIFactory().createCellEditor(genericDomValue, DomUtil.extractParameterClassFromGenericType(genericDomValue.getDomElementType()));
+  }
+
+  protected abstract TableCellEditor createCellEditor(DomElement element, Class type);
+
+  public abstract UserActivityWatcher createEditorAwareUserActivityWatcher();
+
+  public abstract void setupErrorOutdatingUserActivityWatcher(CommittablePanel panel, DomElement... elements);
+
+  public abstract BaseControl createTextControl(DomWrapper<String> wrapper, final boolean commitOnEveryChange);
+
+  public abstract void registerCustomControl(Class aClass, Function<DomWrapper<String>, BaseControl> creator);
+
+  public abstract void registerCustomCellEditor(Class aClass, Function<DomElement, TableCellEditor> creator);
+
+  @Nullable
+  public abstract BaseControl createCustomControl(final Type type, DomWrapper<String> wrapper, final boolean commitOnEveryChange);
+
+  public static BaseControl createTextControl(GenericDomValue value, final boolean commitOnEveryChange) {
+    return getDomUIFactory().createTextControl(new DomStringWrapper(value), commitOnEveryChange);
+  }
+
+  public static BaseControl createTextControl(DomWrapper<String> wrapper) {
+    return getDomUIFactory().createTextControl(wrapper, false);
+  }
+
+  public static DomUIFactory getDomUIFactory() {
+    return ServiceManager.getService(DomUIFactory.class);
+  }
+
+  public DomUIControl createCollectionControl(DomElement element, DomCollectionChildDescription description) {
+    final ColumnInfo columnInfo = createColumnInfo(description, element);
+    final Class aClass = DomUtil.extractParameterClassFromGenericType(description.getType());
+    return new DomCollectionControl<GenericDomValue<?>>(element, description, aClass == null, columnInfo);
+  }
+
+  public ColumnInfo createColumnInfo(final DomCollectionChildDescription description,
+                                     final DomElement element) {
+    final String presentableName = description.getCommonPresentableName(element);
+    final Class aClass = DomUtil.extractParameterClassFromGenericType(description.getType());
+    if (aClass != null) {
+      if (Boolean.class.equals(aClass) || boolean.class.equals(aClass)) {
+        return new BooleanColumnInfo(presentableName);
+      }
+
+      return new GenericValueColumnInfo(presentableName, aClass, createCellEditor(element, aClass));
+    }
+
+    return new StringColumnInfo(presentableName);
+  }
+
+  /**
+   * Adds an error-checking square that is usually found in the top-right ange of a text editor
+   * to the specified CaptionComponent.
+   * @param captionComponent The component to add error panel to
+   * @param elements DOM elements that will be error-checked
+   * @return captionComponent
+   */
+  public abstract CaptionComponent addErrorPanel(CaptionComponent captionComponent, DomElement... elements);
+
+  public abstract BackgroundEditorHighlighter createDomHighlighter(Project project, PerspectiveFileEditor editor, DomElement element);
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/DomUINavigationProvider.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomUINavigationProvider.java
new file mode 100644
index 0000000..7aa1e5f
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomUINavigationProvider.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomElementNavigationProvider;
+
+import java.awt.*;
+import java.util.List;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class DomUINavigationProvider extends DomElementNavigationProvider {
+  public static String DOM_UI_NAVIGATION_PROVIDER_NAME = "DOM_UI_NAVIGATION_PROVIDER_NAME";
+
+  private final CompositeCommittable myComponent;
+
+  public DomUINavigationProvider(final CompositeCommittable component) {
+    myComponent = component;
+  }
+
+
+  public String getProviderName() {
+    return DOM_UI_NAVIGATION_PROVIDER_NAME;
+  }
+
+  public void navigate(DomElement domElement, boolean requestFocus) {
+    final DomUIControl domUIControl = findDomControl(myComponent, domElement);
+    if(domUIControl != null) {
+      domUIControl.navigate(domElement);
+    }
+  }
+
+  public boolean canNavigate(DomElement domElement) {
+    return findDomControl(myComponent, domElement) != null;
+  }
+
+  public static DomElement findDomElement(final BasicDomElementComponent compositCommitable) {
+    final Component component = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
+    if (component != null) {
+      final DomElement domElement = findDomElement(compositCommitable, component);
+      if (domElement != null) {
+        return domElement;
+      }
+    }
+    return compositCommitable.getDomElement();
+  }
+
+  public static DomElement findDomElement(final CompositeCommittable compositCommitable, final Component component) {
+    final List<Committable> list = compositCommitable.getChildren();
+    for (Committable committable : list) {
+      if (committable instanceof DomUIControl) {
+        final DomUIControl uiControl = (DomUIControl)committable;
+        if (uiControl.getComponent().isAncestorOf(component)) {
+          return uiControl.getDomElement();
+        }
+      } else if (committable instanceof CompositeCommittable) {
+        final DomElement element = findDomElement((CompositeCommittable)committable, component);
+        if (element != null) return element;
+      }
+    }
+    return null;
+  }
+
+  public static DomUIControl findDomControl(final CompositeCommittable compositCommitable, final DomElement domElement) {
+    final List<Committable> list = compositCommitable.getChildren();
+    for (Committable committable : list) {
+      if (committable instanceof DomUIControl) {
+          if(((DomUIControl)committable).canNavigate(domElement)) {
+            return (DomUIControl)committable;
+          }
+      } else if (committable instanceof CompositeCommittable) {
+        final DomUIControl control = findDomControl((CompositeCommittable)committable, domElement);
+        if(control != null) return control;
+      }
+    }
+    return null;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/DomWrapper.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomWrapper.java
new file mode 100644
index 0000000..8dc1231
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/DomWrapper.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * @author peter
+ */
+public abstract class DomWrapper<T> {
+
+  @NotNull
+  public abstract DomElement getExistingDomElement();
+
+  @Nullable
+  public abstract DomElement getWrappedElement();
+
+  public abstract void setValue(T value) throws IllegalAccessException, InvocationTargetException;
+  public abstract T getValue() throws IllegalAccessException, InvocationTargetException;
+
+  public boolean isValid() {
+    return getExistingDomElement().isValid();
+  }
+
+  public Project getProject() {
+    return getExistingDomElement().getManager().getProject();
+  }
+
+  public GlobalSearchScope getResolveScope() {
+    return getExistingDomElement().getResolveScope();
+  }
+
+  public XmlFile getFile() {
+    return DomUtil.getFile(getExistingDomElement());
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/EditedElementDescription.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/EditedElementDescription.java
new file mode 100644
index 0000000..e87814e
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/EditedElementDescription.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.xml.DomElement;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public abstract class EditedElementDescription<T extends DomElement> {
+  @Nullable
+  public XmlFile getEditedFile() {
+    return null;
+  }
+  @Nullable
+  public abstract T find();
+  public abstract void initialize(T element);
+  public abstract T addElement();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/EditorContainerPanel.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/EditorContainerPanel.java
new file mode 100644
index 0000000..59be298
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/EditorContainerPanel.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * Base component to be associated with (bound to) DOM controls (see {@link com.intellij.util.xml.ui.DomUIControl})
+ * that have {@link com.intellij.openapi.editor.Editor}
+ * as their part. This includes simple text, PSI class, PSI type editing, etc. The controls themselves
+ * can be created in {@link com.intellij.util.xml.ui.DomUIFactory}.
+ *
+ * Adds an empty disable JTextField to itself to be visible if unbound (or in UI designer), which
+ * should be removed on binding.
+ *
+ * @author peter
+ */
+public class EditorContainerPanel extends JPanel {
+  public EditorContainerPanel() {
+    super(new BorderLayout());
+    setFocusable(false);
+    final JTextField field = new JTextField();
+    field.setEnabled(false);
+    add(field);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/EmptyPane.form b/xml/dom-openapi/src/com/intellij/util/xml/ui/EmptyPane.form
new file mode 100644
index 0000000..1b41b1c
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/EmptyPane.form
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.util.xml.ui.EmptyPane">
+  <grid id="88995" binding="myPanel" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="102" y="178" width="125" height="105"/>
+      <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <component id="32638" class="javax.swing.JLabel" binding="myLabel">
+        <constraints>
+          <xy x="42" y="5" width="40" height="14"/>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="#####"/>
+        </properties>
+      </component>
+      <vspacer id="2f10f">
+        <constraints>
+          <xy x="57" y="22" width="11" height="81"/>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+        </constraints>
+      </vspacer>
+    </children>
+  </grid>
+</form>
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/EmptyPane.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/EmptyPane.java
new file mode 100644
index 0000000..1027f12
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/EmptyPane.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui;
+
+import com.intellij.ui.treeStructure.Tree;
+import com.intellij.util.ui.UIUtil;
+
+import javax.swing.*;
+import java.awt.*;
+
+/** 
+ * @author cdr
+ */
+
+public class EmptyPane {
+  private JPanel myPanel;
+  private JLabel myLabel;
+
+  public EmptyPane(String text) {
+    final Color color = UIUtil.getSeparatorColor();
+    myLabel.setForeground(color);
+    myLabel.setText(text);
+    myPanel.setBackground(new Tree().getBackground());
+  }
+
+  public JComponent getComponent() {
+    return myPanel;
+  }
+
+  public void setText(String text) {
+    myLabel.setText(text);
+  }
+
+  public static void addToPanel(JPanel panel, String text) {
+    final EmptyPane emptyPane = new EmptyPane(text);
+    panel.setLayout(new BorderLayout());
+    panel.add(emptyPane.getComponent(), BorderLayout.CENTER);
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/ErrorableTableCellRenderer.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/ErrorableTableCellRenderer.java
new file mode 100644
index 0000000..7ce604e
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/ErrorableTableCellRenderer.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.ui.JBColor;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.highlighting.DomElementAnnotationsManager;
+import com.intellij.util.xml.highlighting.DomElementProblemDescriptor;
+import com.intellij.util.xml.highlighting.DomElementsProblemsHolder;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellRenderer;
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ErrorableTableCellRenderer<T extends DomElement> extends DefaultTableCellRenderer {
+  private final TableCellRenderer myRenderer;
+  private final DomElement myRowDomElement;
+  private final T myCellValueDomElement;
+  private final DomElement myRoot;
+
+  public ErrorableTableCellRenderer(@Nullable final T cellValueDomElement, final TableCellRenderer renderer, @NotNull final DomElement rowDomElement) {
+    myCellValueDomElement = cellValueDomElement;
+    myRenderer = renderer;
+    myRowDomElement = rowDomElement;
+
+    myRoot = DomUtil.getRoot(myRowDomElement);
+  }
+
+  public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+    final Component component = myRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+    if (!myRoot.isValid()) {
+      return component;
+    }
+
+    final DomElementAnnotationsManager annotationsManager = DomElementAnnotationsManager.getInstance(myRowDomElement.getManager().getProject());
+    final DomElementsProblemsHolder holder = annotationsManager.getCachedProblemHolder(myRoot);
+    final List<DomElementProblemDescriptor> errorProblems = holder.getProblems(myCellValueDomElement);
+    final List<DomElementProblemDescriptor> warningProblems = new ArrayList<DomElementProblemDescriptor>(holder.getProblems(myCellValueDomElement, true, HighlightSeverity.WARNING));
+    warningProblems.removeAll(errorProblems);
+
+    final boolean hasErrors = errorProblems.size() > 0;
+    if (hasErrors) {
+      component.setForeground(JBColor.RED);
+      if (component instanceof JComponent) {
+        ((JComponent)component).setToolTipText(TooltipUtils.getTooltipText(errorProblems));
+      }
+    }
+    else {
+      component.setForeground(isSelected ? table.getSelectionForeground() : table.getForeground());
+      if (component instanceof JComponent) {
+        ((JComponent)component).setToolTipText(null);
+      }
+    }
+
+    // highlight empty cell with errors
+    if (hasErrors && (value == null || value.toString().trim().length() == 0)) {
+      component.setBackground(BaseControl.ERROR_BACKGROUND);
+    }
+    else if (warningProblems.size() > 0) {
+      component.setBackground(BaseControl.WARNING_BACKGROUND);
+      if(isSelected) component.setForeground(JBColor.foreground);
+    }
+
+    final List<DomElementProblemDescriptor> errorDescriptors =
+      annotationsManager.getCachedProblemHolder(myRowDomElement).getProblems(myRowDomElement, true, true);
+
+    if (table.getModel().getColumnCount() - 1 == column) {
+      if (errorDescriptors.size() > 0) {
+        final JPanel wrapper = new JPanel(new BorderLayout());
+        wrapper.add(component, BorderLayout.CENTER);
+
+        wrapper.setBackground(component.getBackground());
+
+        final JLabel errorLabel = new JLabel(getErrorIcon());
+
+        wrapper.setToolTipText(TooltipUtils.getTooltipText(errorDescriptors));
+
+        wrapper.add(errorLabel, BorderLayout.EAST);
+
+        if (component instanceof JComponent) {
+          final JComponent jComponent = (JComponent)component;
+          wrapper.setBorder(jComponent.getBorder());
+          jComponent.setBorder(BorderFactory.createEmptyBorder());
+          jComponent.setToolTipText(TooltipUtils.getTooltipText(errorDescriptors));
+        }
+
+        return wrapper;
+      } else {
+        if (component instanceof JComponent) {
+          ((JComponent)component).setToolTipText(null);
+        }
+      }
+    }
+
+    return component;
+  }
+
+  private static Icon getErrorIcon() {
+    return AllIcons.General.ExclMark;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/GenericValueColumnInfo.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/GenericValueColumnInfo.java
new file mode 100644
index 0000000..033e609
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/GenericValueColumnInfo.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.xml.GenericDomValue;
+
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+
+/**
+ * @author peter
+ */
+public class GenericValueColumnInfo<T> extends DomColumnInfo<GenericDomValue<T>, String> {
+  private final Class<T> myColumnClass;
+  private final TableCellEditor myEditor;
+
+  public GenericValueColumnInfo(final String name, final Class<T> columnClass, final TableCellRenderer renderer, final TableCellEditor editor) {
+    super(name, renderer);
+    myColumnClass = columnClass;
+    myEditor = editor;
+  }
+
+  public GenericValueColumnInfo(final String name, final Class<T> columnClass, final TableCellEditor editor) {
+    this(name, columnClass, new DefaultTableCellRenderer(), editor);
+  }
+
+  public final TableCellEditor getEditor(GenericDomValue<T> value) {
+    return myEditor;
+  }
+
+  public final Class<T> getColumnClass() {
+    return myColumnClass;
+  }
+
+  public final void setValue(final GenericDomValue<T> o, final String aValue) {
+    o.setStringValue(aValue);
+  }
+
+  public final String valueOf(GenericDomValue<T> object) {
+    return object.getStringValue();
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/Highlightable.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/Highlightable.java
new file mode 100644
index 0000000..815a13e
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/Highlightable.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+/**
+ * @author peter
+ */
+public interface Highlightable {
+  void updateHighlighting();
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/MockDomElementsEditor.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/MockDomElementsEditor.java
new file mode 100644
index 0000000..5cd8a74
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/MockDomElementsEditor.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.util.Factory;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiUtilCore;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.StableElement;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.util.*;
+
+/**
+ * @author peter
+ */
+public class MockDomElementsEditor {
+  private final Map<EditedElementDescription<? extends DomElement>, DomElement> myDomElements = new HashMap<EditedElementDescription<? extends DomElement>, DomElement>();
+  private final Module myModule;
+  private CommittablePanel myContents;
+  private DomFileEditor myFileEditor;
+
+  public MockDomElementsEditor(final Module module) {
+    myModule = module;
+  }
+
+  protected final <T extends DomElement> T addEditedElement(final Class<T> aClass, final EditedElementDescription<T> description) {
+    final DomManager domManager = DomManager.getDomManager(myModule.getProject());
+    final T t = domManager.createStableValue(new Factory<T>() {
+      public T create() {
+        T t = description.find();
+        if (t == null) {
+          return createMockElement(aClass);
+        }
+        return t;
+      }
+    });
+    myDomElements.put(description, t);
+    return t;
+  }
+
+  protected <T extends DomElement> T createMockElement(final Class<T> aClass) {
+    return createMockElement(aClass, myModule);
+  }
+
+  protected final DomFileEditor initFileEditor(final BasicDomElementComponent component, final VirtualFile virtualFile, final String name) {
+    initFileEditor(component.getProject(), virtualFile, name, new Factory<BasicDomElementComponent>() {
+      public BasicDomElementComponent create() {
+        return component;
+      }
+    });
+    Disposer.register(myFileEditor, component);
+    return myFileEditor;
+  }
+
+  protected final DomFileEditor initFileEditor(final Project project, final VirtualFile virtualFile, final String name, final Factory<? extends BasicDomElementComponent> component) {
+    myFileEditor = new DomFileEditor<BasicDomElementComponent>(project, virtualFile, name, component) {
+      public JComponent getPreferredFocusedComponent() {
+        return null;
+      }
+
+      @NotNull
+      protected JComponent createCustomComponent() {
+        final JComponent customComponent = super.createCustomComponent();
+        myContents = getDomComponent();
+        return customComponent;
+      }
+
+      public void reset() {
+        for (final Map.Entry<EditedElementDescription<? extends DomElement>, DomElement> entry : myDomElements.entrySet()) {
+          final DomElement newValue = entry.getKey().find();
+          final DomElement oldValue = entry.getValue();
+          if (newValue != null && !newValue.equals(oldValue) || newValue == null && !oldValue.getManager().isMockElement(oldValue)) {
+            ((StableElement)oldValue).revalidate();
+          }
+        }
+        super.reset();
+      }
+
+      public void commit() {
+        super.commit();
+        final List<EditedElementDescription> descriptions = new ArrayList<EditedElementDescription>();
+        final Set<PsiFile> changedFiles = new HashSet<PsiFile>();
+        for (final Map.Entry<EditedElementDescription<? extends DomElement>, DomElement> entry : myDomElements.entrySet()) {
+          final EditedElementDescription description = entry.getKey();
+            final DomElement editedElement = entry.getValue();
+            if (description.find() == null && editedElement.getXmlTag() != null) {
+              descriptions.add(description);
+              final XmlFile xmlFile = description.getEditedFile();
+              if (xmlFile != null) {
+                changedFiles.add(xmlFile);
+              }
+            }
+        }
+        new WriteCommandAction(project, PsiUtilCore.toPsiFileArray(changedFiles)) {
+          protected void run(Result result) throws Throwable {
+            for (EditedElementDescription description : descriptions) {
+              final DomElement editedElement = myDomElements.get(description);
+              DomElement element = description.addElement();
+              element.copyFrom(editedElement);
+              description.initialize(element);
+              removeWatchedElement(editedElement);
+              ((StableElement)editedElement).invalidate();
+            }
+          }
+        }.execute();
+      }
+    };
+    final DomManager domManager = DomManager.getDomManager(project);
+    for (final DomElement element : myDomElements.values()) {
+      if (domManager.isMockElement(element)) {
+        myFileEditor.addWatchedElement(element);
+      }
+    }
+    return myFileEditor;
+  }
+
+  public final DomFileEditor getFileEditor() {
+    return myFileEditor;
+  }
+
+  private <T extends DomElement> T createMockElement(final Class<T> aClass, final Module module) {
+    final Project project = module.getProject();
+    ApplicationManager.getApplication().invokeLater(new Runnable() {
+      public void run() {
+        if (myFileEditor.isInitialised()) {
+          myContents.reset();
+        }
+      }
+    });
+    final DomManager domManager = DomManager.getDomManager(project);
+    final T mockElement = domManager.createMockElement(aClass, module, true);
+    if (myFileEditor != null) {
+      myFileEditor.addWatchedElement(mockElement);
+    }
+    return mockElement;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/MultiLineTextPanel.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/MultiLineTextPanel.java
new file mode 100644
index 0000000..f84aee2
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/MultiLineTextPanel.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+/**
+ * @author peter
+ */
+public class MultiLineTextPanel extends TextPanel{
+  private int myRowCount = 3;
+
+  public final int getRowCount() {
+    return myRowCount;
+  }
+
+  public final void setRowCount(final int rowCount) {
+    myRowCount = rowCount;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/PerspectiveFileEditor.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/PerspectiveFileEditor.java
new file mode 100644
index 0000000..b55bcdb
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/PerspectiveFileEditor.java
@@ -0,0 +1,290 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui;
+
+import com.intellij.codeHighlighting.BackgroundEditorHighlighter;
+import com.intellij.ide.structureView.StructureViewBuilder;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.ScrollType;
+import com.intellij.openapi.fileEditor.*;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.UserDataHolderBase;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.ui.components.panels.Wrapper;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.DomUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+
+/**
+ * @author Sergey.Vasiliev
+ */
+abstract public class PerspectiveFileEditor extends UserDataHolderBase implements DocumentsEditor, Committable {
+  private final Wrapper myWrapprer = new Wrapper();
+  private boolean myInitialised = false;
+
+  private final PropertyChangeSupport myPropertyChangeSupport = new PropertyChangeSupport(this);
+  private final Project myProject;
+  private final VirtualFile myFile;
+  private final UndoHelper myUndoHelper;
+  private boolean myInvalidated;
+
+  private static final FileEditorState FILE_EDITOR_STATE = new FileEditorState() {
+    public boolean canBeMergedWith(FileEditorState otherState, FileEditorStateLevel level) {
+      return true;
+    }
+  };
+
+  protected PerspectiveFileEditor(final Project project, final VirtualFile file) {
+    myProject = project;
+    myUndoHelper = new UndoHelper(project, this);
+    myFile = file;
+
+    FileEditorManager.getInstance(myProject).addFileEditorManagerListener(new FileEditorManagerAdapter() {
+      public void selectionChanged(FileEditorManagerEvent event) {
+        if (!isValid()) return;
+
+        ApplicationManager.getApplication().invokeLater(new Runnable() {
+          public void run() {
+            if (myUndoHelper.isShowing() && !getComponent().isShowing()) {
+              deselectNotify();
+            } else if (!myUndoHelper.isShowing() && getComponent().isShowing()) {
+              selectNotify();
+            }
+          }
+        });
+
+        final FileEditor oldEditor = event.getOldEditor();
+        final FileEditor newEditor = event.getNewEditor();
+        if (oldEditor == null || newEditor == null) return;
+        if (oldEditor.getComponent().isShowing() && newEditor.getComponent().isShowing()) return;
+
+        if (PerspectiveFileEditor.this.equals(oldEditor)) {
+          if (newEditor instanceof TextEditor) {
+            ensureInitialized();
+            setSelectionInTextEditor((TextEditor)newEditor, getSelectedDomElement());
+          }
+        }
+        else if (PerspectiveFileEditor.this.equals(newEditor)) {
+          if (oldEditor instanceof TextEditor) {
+            final DomElement element = getSelectedDomElementFromTextEditor((TextEditor)oldEditor);
+            if (element != null) {
+              ensureInitialized();
+              setSelectedDomElement(element);
+            }
+          }
+          else if (oldEditor instanceof PerspectiveFileEditor) {
+            ensureInitialized();
+            setSelectedDomElement(((PerspectiveFileEditor)oldEditor).getSelectedDomElement());
+          }
+        }
+      }
+    }, this);
+
+    myUndoHelper.startListeningDocuments();
+
+    final PsiFile psiFile = getPsiFile();
+    if (psiFile != null) {
+      final Document document = PsiDocumentManager.getInstance(getProject()).getDocument(psiFile);
+      if (document != null) {
+        addWatchedDocument(document);
+      }
+    }
+  }
+
+  @Nullable
+  abstract protected DomElement getSelectedDomElement();
+
+  abstract protected void setSelectedDomElement(DomElement domElement);
+
+  public final void addWatchedElement(@NotNull final DomElement domElement) {
+    addWatchedDocument(getDocumentManager().getDocument(DomUtil.getFile(domElement)));
+  }
+
+  public final void removeWatchedElement(@NotNull final DomElement domElement) {
+    removeWatchedDocument(getDocumentManager().getDocument(DomUtil.getFile(domElement)));
+  }
+
+  public final void addWatchedDocument(final Document document) {
+    myUndoHelper.addWatchedDocument(document);
+  }
+
+  public final void removeWatchedDocument(final Document document) {
+    myUndoHelper.removeWatchedDocument(document);
+  }
+
+  @Nullable
+  protected DomElement getSelectedDomElementFromTextEditor(final TextEditor textEditor) {
+    final PsiFile psiFile = getPsiFile();
+    if (psiFile == null) return null;
+    final PsiElement psiElement = psiFile.findElementAt(textEditor.getEditor().getCaretModel().getOffset());
+
+    if (psiElement == null) return null;
+
+    final XmlTag xmlTag = PsiTreeUtil.getParentOfType(psiElement, XmlTag.class);
+
+    return DomManager.getDomManager(myProject).getDomElement(xmlTag);
+  }
+
+  public void setSelectionInTextEditor(final TextEditor textEditor, final DomElement element) {
+    if (element != null && element.isValid()) {
+      final XmlTag tag = element.getXmlTag();
+      if (tag == null) return;
+
+      final PsiFile file = tag.getContainingFile();
+      if (file == null) return;
+
+      final Document document = getDocumentManager().getDocument(file);
+      if (document == null || !document.equals(textEditor.getEditor().getDocument())) return;
+
+      textEditor.getEditor().getCaretModel().moveToOffset(tag.getTextOffset());
+      textEditor.getEditor().getScrollingModel().scrollToCaret(ScrollType.CENTER);
+    }
+  }
+
+  protected final PsiDocumentManager getDocumentManager() {
+    return PsiDocumentManager.getInstance(myProject);
+  }
+
+  @Nullable
+  public final PsiFile getPsiFile() {
+    return PsiManager.getInstance(myProject).findFile(myFile);
+  }
+
+  public final Document[] getDocuments() {
+    return myUndoHelper.getDocuments();
+  }
+
+  public final Project getProject() {
+    return myProject;
+  }
+
+  public final VirtualFile getVirtualFile() {
+    return myFile;
+  }
+
+  public void dispose() {
+    if (myInvalidated) return;
+    myInvalidated = true;
+    myUndoHelper.stopListeningDocuments();
+  }
+
+  public final boolean isModified() {
+    return FileDocumentManager.getInstance().isFileModified(getVirtualFile());
+  }
+
+  public boolean isValid() {
+    return getVirtualFile().isValid();
+  }
+
+  public void selectNotify() {
+    if (!checkIsValid() || myInvalidated) return;
+    ensureInitialized();
+    setShowing(true);
+    reset();
+  }
+
+  protected final void setShowing(final boolean b) {
+    myUndoHelper.setShowing(b);
+  }
+
+  protected final synchronized void ensureInitialized() {
+    if (!isInitialised()) {
+      myWrapprer.setContent(createCustomComponent());
+      myInitialised = true;
+    }
+  }
+
+  public void deselectNotify() {
+    if (!checkIsValid() || myInvalidated) return;
+    setShowing(false);
+    commit();
+  }
+
+  public BackgroundEditorHighlighter getBackgroundHighlighter() {
+    return null;
+  }
+
+  public FileEditorLocation getCurrentLocation() {
+    return new FileEditorLocation() {
+      @NotNull
+      public FileEditor getEditor() {
+        return PerspectiveFileEditor.this;
+      }
+
+      public int compareTo(final FileEditorLocation fileEditorLocation) {
+        return 0;
+      }
+    };
+  }
+
+  public StructureViewBuilder getStructureViewBuilder() {
+    return null;
+  }
+
+  @NotNull
+  public FileEditorState getState(@NotNull FileEditorStateLevel level) {
+    return FILE_EDITOR_STATE;
+  }
+
+  public void setState(@NotNull FileEditorState state) {
+  }
+
+  public void addPropertyChangeListener(@NotNull PropertyChangeListener listener) {
+    myPropertyChangeSupport.addPropertyChangeListener(listener);
+  }
+
+  public void removePropertyChangeListener(@NotNull PropertyChangeListener listener) {
+    myPropertyChangeSupport.removePropertyChangeListener(listener);
+  }
+
+  protected boolean checkIsValid() {
+    if (!myInvalidated && !isValid()) {
+      myInvalidated = true;
+      myPropertyChangeSupport.firePropertyChange(FileEditor.PROP_VALID, Boolean.TRUE, Boolean.FALSE);
+    }
+    return !myInvalidated;
+  }
+
+  @NotNull
+  public JComponent getComponent() {
+    return getWrapper();
+  }
+
+  @NotNull
+  protected abstract JComponent createCustomComponent();
+
+  public Wrapper getWrapper() {
+    return myWrapprer;
+  }
+
+  protected final synchronized boolean isInitialised() {
+    return myInitialised;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/PerspectiveFileEditorProvider.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/PerspectiveFileEditorProvider.java
new file mode 100644
index 0000000..882f213
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/PerspectiveFileEditorProvider.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.fileEditor.*;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jdom.Element;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public abstract class PerspectiveFileEditorProvider extends WeighedFileEditorProvider {
+  @NotNull
+  public abstract PerspectiveFileEditor createEditor(@NotNull Project project, @NotNull VirtualFile file);
+
+  public void disposeEditor(@NotNull FileEditor editor) {
+    Disposer.dispose(editor);
+  }
+
+  @NotNull
+  public FileEditorState readState(@NotNull Element sourceElement, @NotNull Project project, @NotNull VirtualFile file) {
+    return new FileEditorState() {
+      public boolean canBeMergedWith(FileEditorState otherState, FileEditorStateLevel level) {
+        return true;
+      }
+    };
+  }
+
+  public void writeState(@NotNull FileEditorState state, @NotNull Project project, @NotNull Element targetElement) {
+  }
+
+  @NotNull
+  @NonNls
+  public final String getEditorTypeId() {
+    return getComponentName();
+  }
+
+  @NotNull
+  public final FileEditorPolicy getPolicy() {
+    return FileEditorPolicy.PLACE_AFTER_DEFAULT_EDITOR;
+  }
+
+  @NonNls
+  public final String getComponentName() {
+    return getClass().getName();
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/PsiClassPanel.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/PsiClassPanel.java
new file mode 100644
index 0000000..c864c7c
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/PsiClassPanel.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui;
+
+/**
+ * @author peter
+ */
+public class PsiClassPanel extends EditorContainerPanel {
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/PsiTypePanel.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/PsiTypePanel.java
new file mode 100644
index 0000000..8663118
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/PsiTypePanel.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+/**
+ * @author peter
+ */
+public class PsiTypePanel extends EditorContainerPanel {
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/StringColumnInfo.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/StringColumnInfo.java
new file mode 100644
index 0000000..edb3f41
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/StringColumnInfo.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.xml.DomElement;
+
+/**
+ * @author peter
+ */
+public class StringColumnInfo<T extends DomElement> extends DomColumnInfo<T, String> {
+  public StringColumnInfo(final String name) {
+    super(name);
+  }
+
+  public String valueOf(final T object) {
+    return object.getPresentation().getTypeName();
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/StripeTableCellRenderer.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/StripeTableCellRenderer.java
new file mode 100644
index 0000000..9853719
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/StripeTableCellRenderer.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import javax.swing.table.TableCellRenderer;
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * @author peter
+ */
+public class StripeTableCellRenderer implements TableCellRenderer {
+  private final TableCellRenderer myRenderer;
+  private static final double FACTOR = 0.92;
+
+  public StripeTableCellRenderer(final TableCellRenderer renderer) {
+    myRenderer = renderer;
+  }
+
+
+  public StripeTableCellRenderer() {
+    this(null);
+  }
+
+  public static Color darken(Color color) {
+    return new Color(Math.max((int)(color.getRed()  *FACTOR), 0),
+                     Math.max((int)(color.getGreen()*FACTOR), 0),
+                     Math.max((int)(color.getBlue() *FACTOR), 0));
+  }
+
+  public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+    final JComponent component = (JComponent)getRenderer(row, column).getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+    if (row % 2 != 0 && !isSelected) {
+      component.setBackground(darken(table.getBackground()));
+    } else {
+      component.setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
+    }
+    component.setOpaque(true);
+    return component;
+  }
+
+  protected TableCellRenderer getRenderer(int row, int column) {
+    return myRenderer;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/TextPanel.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/TextPanel.java
new file mode 100644
index 0000000..d6bed9d
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/TextPanel.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+/**
+ * @author peter
+ */
+public class TextPanel extends EditorContainerPanel {
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/TooltipUtils.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/TooltipUtils.java
new file mode 100644
index 0000000..4aefe41
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/TooltipUtils.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui;
+
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.xml.highlighting.DomElementProblemDescriptor;
+import org.jetbrains.annotations.NonNls;
+
+import java.util.List;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class TooltipUtils {
+  @NonNls private static final String MESSAGE_DELIMITER = "<hr size=1 noshade>";
+
+  public static String getTooltipText(List<DomElementProblemDescriptor> annotations) {
+    if (annotations.size() == 0) return null;
+
+    return getTooltipText(getMessages(annotations));
+  }
+  
+  public static String getTooltipText(List<DomElementProblemDescriptor> annotations, String[] messages) {
+    return getTooltipText(ArrayUtil.mergeArrays(getMessages(annotations), messages));
+  }
+
+  private static String[] getMessages(final List<DomElementProblemDescriptor> problems) {
+    String[] messages = new String[problems.size()];
+    for (int i = 0; i < problems.size(); i++) {
+      messages[i] = problems.get(i).getDescriptionTemplate();
+    }
+    return messages;
+  }
+
+  public static String getTooltipText(String[] messages) {
+    if (messages.length == 0) return null;
+
+    StringBuilder text = new StringBuilder("<html><body><table><tr><td>&nbsp;</td><td>");
+    int len = messages.length > 10 ? 10 : messages.length;
+    for (int i = 0; i < len; i++) {
+      if (i != 0) {
+        text.append(MESSAGE_DELIMITER);
+      }
+      text.append(messages[i]);
+    }
+    if (messages.length > 10) {
+      text.append(MESSAGE_DELIMITER);
+      text.append("...");
+    }
+    text.append("</td><td>&nbsp;</td></tr></table></body></html>");
+    return  text.toString();
+  }
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/UndoHelper.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/UndoHelper.java
new file mode 100644
index 0000000..8af5568
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/UndoHelper.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import com.intellij.openapi.command.CommandAdapter;
+import com.intellij.openapi.command.CommandEvent;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.event.DocumentAdapter;
+import com.intellij.openapi.editor.event.DocumentEvent;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiDocumentManager;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author peter
+ */
+public class UndoHelper {
+  private final Project myProject;
+  private boolean myShowing;
+  private final Set<Document> myCurrentDocuments = new HashSet<Document>();
+  private boolean myDirty;
+  private final DocumentAdapter myDocumentAdapter = new DocumentAdapter() {
+    public void documentChanged(DocumentEvent e) {
+      if (myShowing) {
+        myDirty = true;
+      }
+    }
+  };
+
+  public UndoHelper(final Project project, final Committable committable) {
+    myProject = project;
+    final PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(project);
+    CommandProcessor.getInstance().addCommandListener(new CommandAdapter() {
+      public void commandStarted(CommandEvent event) {
+        undoTransparentActionStarted();
+      }
+
+      public void undoTransparentActionStarted() {
+        myDirty = false;
+      }
+
+      public void undoTransparentActionFinished() {
+        if (myDirty) {
+          psiDocumentManager.commitAllDocuments();
+          committable.reset();
+        }
+      }
+
+      public void commandFinished(CommandEvent event) {
+        undoTransparentActionFinished();
+      }
+    }, committable);
+  }
+
+  public final void startListeningDocuments() {
+    for (final Document document : myCurrentDocuments) {
+      document.addDocumentListener(myDocumentAdapter);
+    }
+  }
+
+  public final void stopListeningDocuments() {
+    for (final Document document : myCurrentDocuments) {
+      document.removeDocumentListener(myDocumentAdapter);
+    }
+  }
+
+  public final void setShowing(final boolean showing) {
+    commitAllDocuments();
+    myShowing = showing;
+  }
+
+  public boolean isShowing() {
+    return myShowing;
+  }
+
+  public final void commitAllDocuments() {
+    final PsiDocumentManager manager = getDocumentManager();
+    for (final Document document : myCurrentDocuments) {
+      manager.commitDocument(document);
+    }
+  }
+
+  private PsiDocumentManager getDocumentManager() {
+    return PsiDocumentManager.getInstance(myProject);
+  }
+
+  public final void addWatchedDocument(final Document document) {
+    stopListeningDocuments();
+    myCurrentDocuments.add(document);
+    startListeningDocuments();
+  }
+
+  public final void removeWatchedDocument(final Document document) {
+    stopListeningDocuments();
+    myCurrentDocuments.remove(document);
+    startListeningDocuments();
+  }
+
+  public final Document[] getDocuments() {
+    return myCurrentDocuments.toArray(new Document[myCurrentDocuments.size()]);
+  }
+
+
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/Warning.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/Warning.java
new file mode 100644
index 0000000..e59ddee
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/Warning.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui;
+
+import javax.swing.*;
+
+public class Warning {
+  private final String myWarning;
+  private final JComponent myComponent;
+
+  public Warning(String warning, JComponent component) {
+    myWarning = warning;
+    myComponent = component;
+  }
+
+
+  public String toString() {
+    return getWarning();
+  }
+
+  public String getWarning() {
+    return myWarning;
+  }
+
+  public JComponent getComponent() {
+    return myComponent;
+  }
+
+}
\ No newline at end of file
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/AddDomElementAction.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/AddDomElementAction.java
new file mode 100644
index 0000000..b892201
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/AddDomElementAction.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui.actions;
+
+import com.intellij.ide.TypePresentationService;
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.application.ApplicationBundle;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.popup.JBPopupFactory;
+import com.intellij.openapi.ui.popup.ListPopup;
+import com.intellij.ui.CommonActionsPanel;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.ElementPresentationManager;
+import com.intellij.util.xml.TypeChooser;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import com.intellij.util.xml.ui.DomCollectionControl;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.*;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public abstract class AddDomElementAction extends AnAction {
+
+  public AddDomElementAction() {
+    super(ApplicationBundle.message("action.add"), null, DomCollectionControl.ADD_ICON);
+  }
+
+  public void update(AnActionEvent e) {
+    if (!isEnabled(e)) {
+      e.getPresentation().setEnabled(false);
+      return;
+    }
+
+    final AnAction[] actions = getChildren(e);
+    for (final AnAction action : actions) {
+      e.getPresentation().setEnabled(true);
+      action.update(e);
+      if (e.getPresentation().isEnabled()) {
+        break;
+      }
+    }
+    if (actions.length == 1) {
+      e.getPresentation().setText(actions[0].getTemplatePresentation().getText());
+    } else {
+      final String actionText = getActionText(e);
+      if (!actionText.endsWith("...")) {
+        e.getPresentation().setText(actionText + (actions.length > 1 ? "..." : ""));
+      }
+    }
+    e.getPresentation().setIcon(DomCollectionControl.ADD_ICON);
+
+    super.update(e);
+  }
+
+  public void actionPerformed(AnActionEvent e) {
+    final AnAction[] actions = getChildren(e);
+    if (actions.length > 1) {
+      final DefaultActionGroup group = new DefaultActionGroup();
+      for (final AnAction action : actions) {
+        group.add(action);
+      }
+
+      final DataContext dataContext = e.getDataContext();
+      final ListPopup groupPopup =
+        JBPopupFactory.getInstance().createActionGroupPopup(null,
+                                                            group, dataContext, JBPopupFactory.ActionSelectionAid.NUMBERING, true);
+
+      showPopup(groupPopup, e);
+    }
+    else if (actions.length == 1) {
+      actions[0].actionPerformed(e);
+    }
+  }
+
+  protected String getActionText(final AnActionEvent e) {
+    return e.getPresentation().getText();
+  }
+
+  protected boolean isEnabled(final AnActionEvent e) {
+    return true;
+  }
+
+  protected void showPopup(final ListPopup groupPopup, final AnActionEvent e) {
+    final Component component = e.getInputEvent().getComponent();
+
+    if (component instanceof ActionButtonComponent) {
+      groupPopup.showUnderneathOf(component);
+    } else {
+      groupPopup.showInBestPositionFor(e.getDataContext());
+    }
+  }
+
+  @NotNull
+  public AnAction[] getChildren(final AnActionEvent e) {
+    Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
+    if (project == null) return AnAction.EMPTY_ARRAY;
+
+    DomCollectionChildDescription[] descriptions = getDomCollectionChildDescriptions(e);
+    final List<AnAction> actions = new ArrayList<AnAction>();
+    for (DomCollectionChildDescription description : descriptions) {
+      final TypeChooser chooser = DomManager.getDomManager(project).getTypeChooserManager().getTypeChooser(description.getType());
+      for (Type type : chooser.getChooserTypes()) {
+
+        final Class<?> rawType = ReflectionUtil.getRawType(type);
+
+        String name = TypePresentationService.getService().getTypePresentableName(rawType);
+        Icon icon = null;
+        if (!showAsPopup() || descriptions.length == 1) {
+//          if (descriptions.length > 1) {
+            icon = ElementPresentationManager.getIconForClass(rawType);
+//          }
+        }
+        actions.add(createAddingAction(e, ApplicationBundle.message("action.add") + " " + name, icon, type, description));
+      }
+    }
+    if (actions.size() > 1 && showAsPopup()) {
+      ActionGroup group = new ActionGroup() {
+        @NotNull
+        public AnAction[] getChildren(@Nullable AnActionEvent e) {
+          return actions.toArray(new AnAction[actions.size()]);
+        }
+      };
+      return new AnAction[]{new ShowPopupAction(group)};
+    }
+    else {
+      if (actions.size() > 1) {
+        actions.add(Separator.getInstance());
+      } else if (actions.size() == 1) {
+
+      }
+    }
+    return actions.toArray(new AnAction[actions.size()]);
+  }
+
+  protected abstract AnAction createAddingAction(final AnActionEvent e,
+                                                 final String name,
+                                                 final Icon icon,
+                                                 final Type type,
+                                                 final DomCollectionChildDescription description);
+
+  @NotNull
+  protected abstract DomCollectionChildDescription[] getDomCollectionChildDescriptions(final AnActionEvent e);
+
+  @Nullable
+  protected abstract DomElement getParentDomElement(final AnActionEvent e);
+
+  protected abstract JComponent getComponent(AnActionEvent e);
+
+  protected boolean showAsPopup() {
+    return true;
+  }
+
+  protected class ShowPopupAction extends AnAction {
+
+    protected final ActionGroup myGroup;
+
+    protected ShowPopupAction(ActionGroup group) {
+      super(ApplicationBundle.message("action.add"), null, DomCollectionControl.ADD_ICON);
+      myGroup = group;
+      setShortcutSet(CommonActionsPanel.getCommonShortcut(CommonActionsPanel.Buttons.ADD));
+    }
+
+    public void actionPerformed(AnActionEvent e) {
+      final ListPopup groupPopup =
+        JBPopupFactory.getInstance().createActionGroupPopup(null,
+                                                            myGroup, e.getDataContext(), JBPopupFactory.ActionSelectionAid.NUMBERING, true);
+
+      showPopup(groupPopup, e);
+    }
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/DefaultAddAction.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/DefaultAddAction.java
new file mode 100644
index 0000000..a564e03
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/DefaultAddAction.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui.actions;
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.application.ApplicationBundle;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.psi.SmartPointerManager;
+import com.intellij.psi.SmartPsiElementPointer;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.lang.reflect.Type;
+
+/**
+ * User: Sergey.Vasiliev
+ * Date: Mar 1, 2006
+ */
+public abstract class DefaultAddAction<T extends DomElement> extends AnAction {
+
+  public DefaultAddAction() {
+    super(ApplicationBundle.message("action.add"));
+  }
+
+  public DefaultAddAction(String text) {
+    super(text);
+  }
+
+  public DefaultAddAction(String text, String description, Icon icon) {
+    super(text, description, icon);
+  }
+
+
+  protected Type getElementType() {
+    return getDomCollectionChildDescription().getType();
+  }
+
+  protected void tuneNewValue(T t) {
+  }
+
+  protected abstract DomCollectionChildDescription getDomCollectionChildDescription();
+
+  protected abstract DomElement getParentDomElement();
+
+  protected void afterAddition(@NotNull T newElement) {
+  }
+
+  public final void actionPerformed(final AnActionEvent e) {
+    final T result = performElementAddition();
+    if (result != null) {
+      afterAddition(result);
+    }
+  }
+
+  @Nullable
+  protected T performElementAddition() {
+    final DomElement parent = getParentDomElement();
+    final DomManager domManager = parent.getManager();
+    final TypeChooser[] oldChoosers = new TypeChooser[]{null};
+    final Type[] aClass = new Type[]{null};
+    final StableElement<T> result = new WriteCommandAction<StableElement<T>>(domManager.getProject(), DomUtil.getFile(parent)) {
+      protected void run(Result<StableElement<T>> result) throws Throwable {
+        final DomElement parentDomElement = getParentDomElement();
+        final T t = (T)getDomCollectionChildDescription().addValue(parentDomElement, getElementType());
+        tuneNewValue(t);
+        aClass[0] = parent.getGenericInfo().getCollectionChildDescription(t.getXmlElementName()).getType();
+        oldChoosers[0] = domManager.getTypeChooserManager().getTypeChooser(aClass[0]);
+        final SmartPsiElementPointer pointer =
+          SmartPointerManager.getInstance(getProject()).createSmartPsiElementPointer(t.getXmlTag());
+        domManager.getTypeChooserManager().registerTypeChooser(aClass[0], new TypeChooser() {
+          public Type chooseType(final XmlTag tag) {
+            if (tag == pointer.getElement()) {
+              return getElementType();
+            }
+            return oldChoosers[0].chooseType(tag);
+          }
+
+          public void distinguishTag(final XmlTag tag, final Type aClass) throws IncorrectOperationException {
+            oldChoosers[0].distinguishTag(tag, aClass);
+          }
+
+          public Type[] getChooserTypes() {
+            return oldChoosers[0].getChooserTypes();
+          }
+        });
+        result.setResult((StableElement<T>)t.createStableCopy());
+      }
+    }.execute().getResultObject();
+    if (result != null) {
+      domManager.getTypeChooserManager().registerTypeChooser(aClass[0], oldChoosers[0]);
+      return result.getWrappedElement();
+    }
+    return null;
+  }
+}
\ No newline at end of file
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/generate/CreateDomElementAction.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/generate/CreateDomElementAction.java
new file mode 100644
index 0000000..2d3d1ed
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/generate/CreateDomElementAction.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.ui.actions.generate;
+
+import com.intellij.codeInsight.actions.SimpleCodeInsightAction;
+import com.intellij.codeInsight.template.Expression;
+import com.intellij.codeInsight.template.TemplateBuilder;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.ElementManipulators;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomUtil;
+import com.intellij.util.xml.GenericDomValue;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public abstract class CreateDomElementAction<T extends DomElement> extends SimpleCodeInsightAction {
+
+  private final Class<T> myContextClass;
+
+  public CreateDomElementAction(Class<T> contextClass) {
+    myContextClass = contextClass;
+  }
+
+  @Override
+  public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) {
+    DomElement element = createElement(getContextElement(editor), editor, file, project);
+  }
+
+  @Nullable
+  protected abstract DomElement createElement(T context, Editor editor, PsiFile file, Project project);
+
+  @Override
+  protected boolean isValidForFile(Project project, Editor editor, PsiFile file) {
+    return getContextElement(editor) != null;
+  }
+
+  @Nullable
+  protected T getContextElement(Editor editor) {
+    return DomUtil.getContextElement(editor, myContextClass);
+  }
+
+  public static void replaceElementValue(TemplateBuilder builder, GenericDomValue element, Expression expression) {
+    element.setStringValue("");
+    XmlElement xmlElement = element.getXmlElement();
+    builder.replaceElement(xmlElement, ElementManipulators.getValueTextRange(xmlElement), expression);
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/generate/GenerateDomElementAction.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/generate/GenerateDomElementAction.java
new file mode 100644
index 0000000..dad9336
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/generate/GenerateDomElementAction.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui.actions.generate;
+
+import com.intellij.codeInsight.CodeInsightActionHandler;
+import com.intellij.codeInsight.actions.CodeInsightAction;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiFile;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public class GenerateDomElementAction extends CodeInsightAction {
+
+  protected final GenerateDomElementProvider myProvider;
+
+  public GenerateDomElementAction(@NotNull final GenerateDomElementProvider generateProvider, @Nullable Icon icon) {
+    getTemplatePresentation().setDescription(generateProvider.getDescription());
+    getTemplatePresentation().setText(generateProvider.getDescription());
+    getTemplatePresentation().setIcon(icon);
+
+    myProvider = generateProvider;
+    
+  }
+
+  public GenerateDomElementAction(final GenerateDomElementProvider generateProvider) {
+      this(generateProvider, null);
+  }
+
+  protected CodeInsightActionHandler getHandler() {
+    return new CodeInsightActionHandler() {
+      public void invoke(@NotNull final Project project, @NotNull final Editor editor, @NotNull final PsiFile file) {
+        final Runnable runnable = new Runnable() {
+          public void run() {
+            final DomElement element = myProvider.generate(project, editor, file);
+            myProvider.navigate(element);
+          }
+        };
+        
+        if (GenerateDomElementAction.this.startInWriteAction()) {
+          new WriteCommandAction(project, file) {
+            protected void run(final Result result) throws Throwable {
+              runnable.run();
+            }
+          }.execute();
+        }
+        else {
+          runnable.run();
+        }
+      }
+
+      public boolean startInWriteAction() {
+        return false;
+      }
+    };
+  }
+
+  protected boolean startInWriteAction() {
+    return true;
+  }
+
+  protected boolean isValidForFile(final Project project, final Editor editor, final PsiFile file) {
+    final DomElement element = DomUtil.getContextElement(editor);
+    return element != null && myProvider.isAvailableForElement(element);
+  }
+
+  public GenerateDomElementProvider getProvider() {
+    return myProvider;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/generate/GenerateDomElementProvider.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/generate/GenerateDomElementProvider.java
new file mode 100644
index 0000000..810a778
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/actions/generate/GenerateDomElementProvider.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.util.xml.ui.actions.generate;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiFile;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomElementNavigationProvider;
+import com.intellij.util.xml.DomElementsNavigationManager;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * User: Sergey.Vasiliev
+ */
+public abstract class GenerateDomElementProvider<T extends DomElement> {
+  private final String myDescription;
+
+  public GenerateDomElementProvider(String description) {
+    myDescription = description;
+  }
+
+  public boolean isAvailableForElement(@NotNull DomElement contextElement) {
+    return true;
+  }
+  
+  @Nullable
+  public abstract T generate(final Project project, final Editor editor, final PsiFile file);
+
+  public void navigate(final DomElement element) {
+    if (element != null && element.isValid()) {
+      final DomElement copy = element.createStableCopy();
+      final Project project = element.getManager().getProject();
+      final DomElementNavigationProvider navigateProvider = getNavigationProviderName(project);
+
+      if (navigateProvider != null && navigateProvider.canNavigate(copy)) {
+        ApplicationManager.getApplication().invokeLater(new Runnable() {
+          public void run() {
+            if (!project.isDisposed()) {
+              doNavigate(navigateProvider, copy);
+            }
+          }
+        });
+      }
+    }
+  }
+
+  protected void doNavigate(final DomElementNavigationProvider navigateProvider, final DomElement copy) {
+    navigateProvider.navigate(copy, true);
+  }
+
+  protected static DomElementNavigationProvider getNavigationProviderName(Project project) {
+    return DomElementsNavigationManager.getManager(project)
+      .getDomElementsNavigateProvider(DomElementsNavigationManager.DEFAULT_PROVIDER_NAME);
+  }
+
+  public String getDescription() {
+    return myDescription == null ? "" : myDescription;
+  }
+}
diff --git a/xml/dom-openapi/src/com/intellij/xml/util/PsiElementPointer.java b/xml/dom-openapi/src/com/intellij/xml/util/PsiElementPointer.java
new file mode 100644
index 0000000..7e4398d
--- /dev/null
+++ b/xml/dom-openapi/src/com/intellij/xml/util/PsiElementPointer.java
@@ -0,0 +1,12 @@
+package com.intellij.xml.util;
+
+import org.jetbrains.annotations.Nullable;
+import com.intellij.psi.PsiElement;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public interface PsiElementPointer {
+  @Nullable
+  PsiElement getPsiElement();
+}
diff --git a/xml/dom-tests/dom-tests.iml b/xml/dom-tests/dom-tests.iml
new file mode 100644
index 0000000..ca2f81f
--- /dev/null
+++ b/xml/dom-tests/dom-tests.iml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="dom-impl" />
+    <orderEntry type="library" name="CGLIB" level="project" />
+    <orderEntry type="module" module-name="xml" />
+    <orderEntry type="module" module-name="testFramework-java" />
+    <orderEntry type="module" module-name="java-psi-impl" />
+    <orderEntry type="module" module-name="java-impl" scope="TEST" />
+  </component>
+  <component name="copyright">
+    <Base>
+      <setting name="state" value="1" />
+    </Base>
+  </component>
+</module>
+
diff --git a/xml/dom-tests/testData/performance.xml b/xml/dom-tests/testData/performance.xml
new file mode 100644
index 0000000..49f57b1
--- /dev/null
+++ b/xml/dom-tests/testData/performance.xml
@@ -0,0 +1,1182 @@
+<component>
+  <actions>
+    <action id="CaptureMemorySnapShot" class="xcom.intellij.util.CaptureMemorySnapshotAction" text="Capture memory snapshot" description="Capture memory snapshot" icon="/actions/profileMemory.png" />
+    <action id="CaptureCPUUsageData" class="xcom.intellij.util.CaptureCPUUsageDataAction" text="Capture cpu usage data" description="Capture cpu usage data" icon="/actions/profuleCPU.png" />
+    <action id="ContextHelp" class="xcom.intellij.ide.actions.ContextHelpAction" text="Conte_xt Help" description="Show context help"/>
+    <action id="RunConfiguration" text="Select Run/Debug Configuration" description="Select Run/Debug Configuration" class="xcom.intellij.execution.actions.RunConfigurationAction"/>
+    <action id="ShowIntentionActions" text="Show Intention Actions" class="xcom.intellij.codeInsight.intention.actions.ShowIntentionActionsAction"/>
+    <action id="ToggleReadOnlyAttribute" text="Toggle Read-Only Attribute" description="Toggle read-only attribute of current file" class="xcom.intellij.ide.actions.ToggleReadOnlyAttributeAction"/>
+    <action id="TogglePopupHints" text="Toggle Popup Hints for Current File" class="xcom.intellij.ide.actions.TogglePopupHintsAction"/>
+    <action id="RunGc" text="Run Garbage Collector" class="xcom.intellij.ide.actions.RunGcAction"/>
+    <action id="ShowPopupMenu" text="Show Context Menu" class="xcom.intellij.ide.actions.ShowPopupMenuAction"/>
+    <action id="CloseWindow" text="Close Active Window" class="xcom.intellij.ide.actions.CloseWindowAction"/>
+
+    <action id="Vcs.ShowHistory" class="xcom.intellij.openapi.vcs.actions.FileHistoryAction" text="Show File History" description="Show history of file"/>
+    <action id="Vcs.ShowHistoryForBlock" class="xcom.intellij.openapi.vcs.actions.SelectedBlockHistoryAction" text="Show History _for Selection" description="Show history for editor selection"/>
+    <action id="Vcs.ShowTabbedFileHistory" class="xcom.intellij.openapi.vcs.actions.TabbedShowHistoryAction" text="_Show History" description="Show history of file"/>
+
+    <group id="RunContextGroup" popup="false">
+      <action id="CreateRunConfiguration" text="Create Run Configuration" description="Create run configuration from context" class="xcom.intellij.execution.actions.CreateAction"/>
+    </group>
+    <group id="RunContextPopupGroup" popup="false" text="Run Configurations">
+      <reference ref="RunContextGroup"/>
+    </group>
+    <!--Editor -->
+    <group id="EditorActions" text="Editor Actions">
+
+      <action id="EditorChooseLookupItem" class="xcom.intellij.codeInsight.lookup.impl.actions.ChooseItemAction" text="Choose Lookup Item"/>
+      <action id="EditorChooseLookupItemReplace" class="xcom.intellij.codeInsight.lookup.impl.actions.ChooseItemReplaceAction" text="Choose Lookup Item Replace"/>
+
+      <action id="NextTemplateVariable" text="Next Template Variable" class="xcom.intellij.codeInsight.template.impl.actions.NextVariableAction"/>
+      <action id="PreviousTemplateVariable" text="Previous Template Variable" class="xcom.intellij.codeInsight.template.impl.actions.PreviousVariableAction"/>
+
+      <action id="NextParameter" text="Next Parameter" class="xcom.intellij.codeInsight.hint.actions.NextParameterAction"/>
+      <action id="PrevParameter" text="Prev Parameter" class="xcom.intellij.codeInsight.hint.actions.PrevParameterAction"/>
+
+      <action id="EditorPageUp" class="xcom.intellij.openapi.editor.actions.PageUpAction" text="Page Up"/>
+      <action id="EditorPageDown" class="xcom.intellij.openapi.editor.actions.PageDownAction" text="Page Down"/>
+      <action id="EditorPageUpWithSelection" class="xcom.intellij.openapi.editor.actions.PageUpWithSelectionAction" text="Page Up with Selection"/>
+      <action id="EditorPageDownWithSelection" class="xcom.intellij.openapi.editor.actions.PageDownWithSelectionAction" text="Page Up with Selection"/>
+      <action id="EditorCopy" class="xcom.intellij.openapi.editor.actions.CopyAction" text="Copy"/>
+      <action id="EditorCut" class="xcom.intellij.openapi.editor.actions.CutAction" text="Cut"/>
+      <action id="EditorPaste" class="xcom.intellij.openapi.editor.actions.PasteAction" text="Paste"/>
+      <action id="EditorPasteFromX11" class="xcom.intellij.openapi.editor.actions.PasteFromX11Action" text="Paste from X clipboard"/>
+      <action id="EditorDelete" class="xcom.intellij.openapi.editor.actions.DeleteAction" text="Delete"/>
+      <action id="EditorBackSpace" class="xcom.intellij.openapi.editor.actions.BackspaceAction" text="Backspace"/>
+      <action id="EditorMoveToPageTop" class="xcom.intellij.openapi.editor.actions.PageTopAction" text="Move Caret to Page Top"/>
+      <action id="EditorMoveToPageBottom" class="xcom.intellij.openapi.editor.actions.PageBottomAction" text="Move Caret to Page Bottom"/>
+      <action id="EditorMoveToPageTopWithSelection" class="xcom.intellij.openapi.editor.actions.PageTopWithSelectionAction" text="Move Caret to Page Top with Selection"/>
+      <action id="EditorMoveToPageBottomWithSelection" class="xcom.intellij.openapi.editor.actions.PageBottomWithSelectionAction" text="Move Caret to Page Bottom with Selection"/>
+      <action id="EditorEnter" class="xcom.intellij.openapi.editor.actions.EnterAction" text="Enter"/>
+      <action id="EditorEscape" class="xcom.intellij.openapi.editor.actions.EscapeAction" text="Escape"/>
+      <action id="EditorUp" class="xcom.intellij.openapi.editor.actions.MoveCaretUpAction" text="Up"/>
+      <action id="EditorDown" class="xcom.intellij.openapi.editor.actions.MoveCaretDownAction" text="Down"/>
+      <action id="EditorLeft" class="xcom.intellij.openapi.editor.actions.MoveCaretLeftAction" text="Left"/>
+      <action id="EditorRight" class="xcom.intellij.openapi.editor.actions.MoveCaretRightAction" text="Right"/>
+      <action id="EditorUpWithSelection" class="xcom.intellij.openapi.editor.actions.MoveCaretUpWithSelectionAction" text="Up with Selection"/>
+      <action id="EditorDownWithSelection" class="xcom.intellij.openapi.editor.actions.MoveCaretDownWithSelectionAction" text="Down with Selection"/>
+      <action id="EditorLeftWithSelection" class="xcom.intellij.openapi.editor.actions.MoveCaretLeftWithSelectionAction" text="Left with Selection"/>
+      <action id="EditorRightWithSelection" class="xcom.intellij.openapi.editor.actions.MoveCaretRightWithSelectionAction" text="Right with Selection"/>
+      <action id="EditorIndentSelection" class="xcom.intellij.openapi.editor.actions.IndentSelectionAction" text="Indent Selection"/>
+      <action id="EditorUnindentSelection" class="xcom.intellij.openapi.editor.actions.UnindentSelectionAction" text="Unindent Selection"/>
+      <action id="EditorTab" class="xcom.intellij.openapi.editor.actions.TabAction" text="Tab"/>
+      <action id="EmacsStyleIndent" class="xcom.intellij.openapi.editor.actions.EmacsStyleIndentAction" text="Emacs Tab"/>
+      <action id="EditorScrollUp" class="xcom.intellij.openapi.editor.actions.ScrollUpAction" text="Scroll Up"/>
+      <action id="EditorScrollDown" class="xcom.intellij.openapi.editor.actions.ScrollDownAction" text="Scroll Down"/>
+      <action id="EditorMoveUpAndScroll" class="xcom.intellij.openapi.editor.actions.MoveUpAndScrollAction" text="Move Up and Scroll"/>
+      <action id="EditorMoveDownAndScroll" class="xcom.intellij.openapi.editor.actions.MoveDownAndScrollAction" text="Move Down and Scroll"/>
+      <action id="EditorMoveUpAndScrollWithSelection" class="xcom.intellij.openapi.editor.actions.MoveUpWithSelectionAndScrollAction" text="Move Up and Scroll with Selection"/>
+      <action id="EditorMoveDownAndScrollWithSelection" class="xcom.intellij.openapi.editor.actions.MoveDownWithSelectionAndScrollAction" text="Move Down and Scroll with Selection"/>
+      <action id="EditorLineStart" class="xcom.intellij.openapi.editor.actions.LineStartAction" text="Move Caret to Line Start"/>
+      <action id="EditorLineEnd" class="xcom.intellij.openapi.editor.actions.LineEndAction" text="Move Caret to Line End"/>
+      <action id="EditorCutLineEnd" class="xcom.intellij.openapi.editor.actions.CutLineEndAction" text="Cut up to Line End"/>
+      <action id="EditorTextStart" class="xcom.intellij.openapi.editor.actions.TextStartAction" text="Move Caret to Text Start"/>
+      <action id="EditorTextEnd" class="xcom.intellij.openapi.editor.actions.TextEndAction" text="Move Caret to Text End"/>
+      <action id="EditorLineStartWithSelection" class="xcom.intellij.openapi.editor.actions.LineStartWithSelectionAction" text="Move Caret to Line Start with Selection"/>
+      <action id="EditorLineEndWithSelection" class="xcom.intellij.openapi.editor.actions.LineEndWithSelectionAction" text="Move Caret to Line End with Selection"/>
+      <action id="EditorTextStartWithSelection" class="xcom.intellij.openapi.editor.actions.TextStartWithSelectionAction" text="Move Caret to Text Start with Selection"/>
+      <action id="EditorTextEndWithSelection" class="xcom.intellij.openapi.editor.actions.TextEndWithSelectionAction" text="Move Caret to Text End with Selection"/>
+      <action id="EditorNextWord" class="xcom.intellij.openapi.editor.actions.NextWordAction" text="Move Caret to Next Word"/>
+      <action id="EditorPreviousWord" class="xcom.intellij.openapi.editor.actions.PreviousWordAction" text="Move Caret to Previous Word"/>
+      <action id="EditorNextWordWithSelection" class="xcom.intellij.openapi.editor.actions.NextWordWithSelectionAction" text="Move Caret to Next Word with Selection"/>
+      <action id="EditorPreviousWordWithSelection" class="xcom.intellij.openapi.editor.actions.PreviousWordWithSelectionAction" text="Move Caret to Previous Word with Selection"/>
+      <action id="EditorCodeBlockStart" class="xcom.intellij.codeInsight.editorActions.CodeBlockStartAction" text="Move Caret to Code Block Start"/>
+      <action id="EditorCodeBlockEnd" class="xcom.intellij.codeInsight.editorActions.CodeBlockEndAction" text="Move Caret to Code Block End"/>
+      <action id="EditorCodeBlockStartWithSelection" class="xcom.intellij.codeInsight.editorActions.CodeBlockStartWithSelectionAction" text="Move Caret to Code Block Start with Selection"/>
+      <action id="EditorCodeBlockEndWithSelection" class="xcom.intellij.codeInsight.editorActions.CodeBlockEndWithSelectionAction" text="Move Caret to Code Block End with Selection"/>
+      <action id="EditorDeleteToWordStart" class="xcom.intellij.openapi.editor.actions.DeleteToWordStartAction" text="Delete to Word Start"/>
+      <action id="EditorDeleteToWordEnd" class="xcom.intellij.openapi.editor.actions.DeleteToWordEndAction" text="Delete to Word End"/>
+      <action id="EditorDeleteLine" class="xcom.intellij.openapi.editor.actions.DeleteLineAtCaretAction" text="Delete Line at Caret"/>
+      <action id="EditorDuplicate" class="xcom.intellij.openapi.editor.actions.DuplicateAction" text="Duplicate Line or Block"/>
+      <action id="EditorSelectWord" class="xcom.intellij.openapi.editor.actions.SelectWordAtCaretAction" text="Select Word at Caret"/>
+      <action id="EditorUnSelectWord" class="xcom.intellij.openapi.editor.actions.UnselectWordAtCaretAction" text="Unselect Word at Caret"/>
+      <action id="EditorToggleInsertState" class="xcom.intellij.openapi.editor.actions.ToggleInsertStateAction" text="Toggle Insert/Overwrite"/>
+      <action id="EditorToggleColumnMode" class="xcom.intellij.openapi.editor.actions.ToggleColumnModeAction" text="Column Mode" description="Toggle editor column mode"/>
+      <action id="EditorToggleShowWhitespaces" class="xcom.intellij.openapi.editor.actions.ToggleShowWhitespacesAction" text="Sh_ow Whitespaces" description="Toggle display whitespaces in current editor"/>
+      <action id="EditorToggleShowLineNumbers" class="xcom.intellij.openapi.editor.actions.ToggleShowLineNumbersAction" text="Show Line _Numbers" description="Toggle display line numbers in current editor"/>
+      <action id="EditorScrollToCenter" class="xcom.intellij.openapi.editor.actions.ScrollToCenterAction" text="Scroll to Center"/>
+      <action id="EditorToggleCase" class="xcom.intellij.openapi.editor.actions.ToggleCaseAction" text="Toggle Case"/>
+      <action id="EditorJoinLines" class="xcom.intellij.openapi.editor.actions.JoinLinesAction" text="Join Lines"/>
+      <action id="EditorSelectLine" class="xcom.intellij.openapi.editor.actions.SelectLineAction" text="Select Line at Caret"/>
+      <action id="EditorSplitLine" class="xcom.intellij.openapi.editor.actions.SplitLineAction" text="Split Line"/>
+      <action id="EditorStartNewLine" class="xcom.intellij.openapi.editor.actions.StartNewLineAction" text="Start New Line"/>
+      <action id="EditorCompleteStatement" class="xcom.intellij.codeInsight.editorActions.smartEnter.SmartEnterAction" text="Complete Current Statement"/>
+    </group>
+
+    <action id="ExpandAll" class="xcom.intellij.ide.actions.ExpandAllAction" text="Expand All" icon="/actions/expandall.png"/>
+    <action id="CollapseAll" class="xcom.intellij.ide.actions.CollapseAllAction" text="Collapse All" icon="/actions/collapseall.png"/>
+    <action id="ExportToTextFile" class="xcom.intellij.ide.actions.ExportToTextFileAction" text="Export to Text File" icon="/actions/export.png"/>
+    <action id="ExpandTreeNode" text="Expand Tree Node" class="xcom.intellij.ide.actions.tree.ExpandTreeNodeAction"/>
+    <action id="CollapseTreeNode" text="Collapse Tree Node" class="xcom.intellij.ide.actions.tree.CollapseTreeNodeAction"/>
+    <action id="FullyExpandTreeNode" text="Fully Expand Tree Node" class="xcom.intellij.ide.actions.tree.FullyExpandTreeNodeAction"/>
+
+    <group id="J2EEGenerateGroup">
+      <action id="CreateSessionBean" text="_Session Bean" class="xcom.intellij.javaee.module.view.ejb.actions.CreateSessionBeanAction" icon="/nodes/ejbSession.png"/>
+      <action id="CreateContainerManagedEntityBeanAction" text="_CMP Entity Bean" class="xcom.intellij.javaee.module.view.ejb.actions.CreateCMPEntityBeanAction" icon="/nodes/ejbEntity.png"/>
+      <action id="CreateBeanManagedEntityBeanAction" text="_BMP Entity Bean" class="xcom.intellij.javaee.module.view.ejb.actions.CreateBMPEntityBeanAction" icon="/nodes/ejbEntity.png"/>
+      <action id="CreateMessageBean" text="_Message Bean" class="xcom.intellij.javaee.module.view.ejb.actions.CreateMessageBeanAction" icon="/nodes/ejbMessage.png"/>
+      <action id="CreateTransferObject" text="_Transfer Object" class="xcom.intellij.javaee.module.view.ejb.actions.CreateTransferObjectAction" icon="/nodes/class.png"/>
+      <action id="CreateCMPField" text="_CMP Field" class="xcom.intellij.javaee.module.view.ejb.actions.CreateCmpFieldAction" icon="/nodes/ejbCmpField.png"/>
+      <action id="CreateEJBRelationship" text="EJB _Relationship" class="xcom.intellij.javaee.module.view.ejb.actions.CreateEjbRelationshipAction" icon="/nodes/ejbCmrField.png"/>
+
+      <action id="CreateJSPAction" text="_Jsp" class="xcom.intellij.javaee.module.view.web.CreateJspAction" description="Create new JSP file in this directory" icon="/fileTypes/jsp.png"/>
+      <action id="CreateServletAction" text="_Servlet" class="xcom.intellij.javaee.module.view.web.servlet.CreateServletAction" description="Create new Servlet" icon="/nodes/servlet.png"/>
+      <action id="CreateFilterAction" text="_Filter" class="xcom.intellij.javaee.module.view.web.filter.CreateFilterAction" description="Create new Servlet Filter" icon="/ant/filter.png"/>
+    </group>
+    <group id="GenerateGroup" text="_Generate">
+      <action id="GenerateConstructor" text="Constructor" class="xcom.intellij.codeInsight.generation.actions.GenerateConstructorAction"/>
+      <action id="GenerateGetter" text="Getter" class="xcom.intellij.codeInsight.generation.actions.GenerateGetterAction"/>
+      <action id="GenerateSetter" text="Setter" class="xcom.intellij.codeInsight.generation.actions.GenerateSetterAction"/>
+      <action id="GenerateGetterAndSetter" text="Getter and Setter" class="xcom.intellij.codeInsight.generation.actions.GenerateGetterAndSetterAction"/>
+      <action id="GenerateEquals" text="equals() and hashCode()" class="xcom.intellij.codeInsight.generation.actions.GenerateEqualsAction"/>
+      <action id="OverrideMethods" class="xcom.intellij.codeInsight.generation.actions.OverrideMethodsAction" text="_Override Methods..." description="Override base class methods in the current class"/>
+      <action id="ImplementMethods" class="xcom.intellij.codeInsight.generation.actions.ImplementMethodsAction" text="_Implement Methods..." description="Implement base interface/class methods in the current class"/>
+      <action id="GenerateSuperMethodCall" text="super method call" class="xcom.intellij.codeInsight.generation.actions.GenerateSuperMethodCallAction"/>
+    </group>
+
+    <action id="NextDiff" class="xcom.intellij.openapi.diff.actions.NextDiffAction" text="Move to the next difference" description="Move to the next difference" icon="/actions/moveDown.png"/>
+    <action id="PreviousDiff" class="xcom.intellij.openapi.diff.actions.PreviousDiffAction" text="Move to the previous difference" description="Move to the previous difference" icon="/actions/moveUp.png"/>
+
+    <action id="CheckinProject" class="xcom.intellij.openapi.vcs.actions.CommonCheckinProjectAction" text="Check In Project">
+      <keyboard-shortcut first-keystroke="control K" keymap="$default"/>
+    </action>
+    <action id="CheckinFiles" class="xcom.intellij.openapi.vcs.actions.CommonCheckinFilesAction" text="Check In"/>
+    <action id="UpdateFiles" class="xcom.intellij.openapi.vcs.update.CommonUpdateFileOrDirectoryAction" text="Update"/>
+    <action id="CheckStatusForFiles" class="xcom.intellij.openapi.vcs.update.CommonStatusFileOrDirectoryAction" text="Check Status"/>
+
+    <group id="NewGroup" text="New" popup="true">
+      <action id="NewClass" text="Class" class="xcom.intellij.ide.actions.CreateClassAction"/>
+      <action id="NewInterface" text="Interface" class="xcom.intellij.ide.actions.CreateInterfaceAction"/>
+      <action id="NewEnum" text="Enum" class="xcom.intellij.ide.actions.CreateEnumAction"/>
+      <action id="NewAnnotationType" text="@Interface" class="xcom.intellij.ide.actions.CreateAnnotationTypeAction"/>
+      <action id="NewFile" text="File" class="xcom.intellij.ide.actions.CreateFileAction"/>
+      <action id="NewDir" text="Directory/Package" class="xcom.intellij.ide.actions.CreateDirectoryOrPackageAction"/>
+      <separator/>
+      <action id="NewFromTemplate" text="From Template" class="xcom.intellij.ide.fileTemplates.actions.CreateFromTemplateGroup"/>
+      <separator/>
+      <action id="NewDialog" text="Dialog" class="xcom.intellij.uiDesigner.actions.CreateDialogAction"/>
+      <separator/>
+      <reference ref="J2EEGenerateGroup"/>
+    </group>
+
+    <action id="CompareTwoFiles" class="xcom.intellij.openapi.diff.actions.CompareFiles" text="Compare Two _Files" description="Compare two selected files"/>
+    <action id="CompareFileWithEditor" class="xcom.intellij.openapi.diff.actions.CompareFileWithEditor" text="Co_mpare File with Editor" description="Compare selected file with editor"/>
+
+    <group id="VcsGroups" class="xcom.intellij.openapi.vcs.actions.VcsActionGroup" text="Version Control" popup="true">
+
+      <group class="xcom.intellij.openapi.vcs.actions.VcsActionGroup" id="VcsGlobalGroup" test="Version Control" text="Version Control">
+        <action id="Vcs.FileView" class="xcom.intellij.openapi.vcs.actions.FileViewAction" text="Show File _View" description="Show version control related information for all local files"/>
+        <reference ref="CheckinProject"/>
+        <action id="Vcs.UpdateProject" class="xcom.intellij.openapi.vcs.update.CommonUpdateProjectAction" text="Update Project">
+          <keyboard-shortcut first-keystroke="control T" keymap="$default"/>
+        </action>
+        <action id="Vcs.ProjectStatus" class="xcom.intellij.openapi.vcs.update.CommonStatusProjectAction" text="Check Project Status">
+        </action>
+      </group>
+
+      <separator/>
+      <action id="Vcs.MarkSourcesAsCurrent" class="xcom.intellij.openapi.vcs.actions.MarkSourcesAsCurrent" text="Mark Project as Current" description="Mark sources as up-to-date"/>
+    </group>
+    <group class="xcom.intellij.openapi.vcs.actions.VcsActionGroup" id="VcsGroup" test="Version Control" text="Version Control"/>
+
+    <group id="VssGlobalGroup"
+      class="xcom.intellij.vssSupport.actions.VssGroup"
+      text="SourceSa_fe"
+      test="SourceSafe"
+      popup="true" >
+      <add-to-group group-id="VcsGroups" anchor="last"/>
+      <action id="Vss.RunExplorer" class="xcom.intellij.vssSupport.actions.RunExplorerAction" text="Open SourceSafe _Explorer" description="Open SourceSafe explorer"/>
+    </group>
+
+    <group id="VssFilePopupGroup"
+      class="xcom.intellij.vssSupport.actions.VssGroup"
+      text="SourceSa_fe"
+      test="SourceSafe"
+      popup="true" >
+      <add-to-group group-id="VcsGroup" anchor="last"/>
+    </group>
+
+
+    <group id="VssGroup">
+      <add-to-group group-id="VssGlobalGroup" anchor="last"/>
+      <add-to-group group-id="VssFilePopupGroup" anchor="last"/>
+      <action id="Vss.Checkout" class="xcom.intellij.vssSupport.actions.CheckoutAction" text="Check _Out..." description="Check out the file(s) from SourceSafe database for editing"/>
+      <action id="Vss.Checkin" class="xcom.intellij.vssSupport.actions.CheckinAction" text="Check _In..." description="Update SourceSafe database with changes made to the checked out file(s)"/>
+      <action id="Vss.Add" class="xcom.intellij.vssSupport.actions.AddAction" text="_Add File..." description="Add new file to the SourceSafe database"/>
+      <action id="Vss.Undocheckout" class="xcom.intellij.vssSupport.actions.UndocheckoutAction" text="_Undo Check Out..." description="Cancel a check out, voiding all changes"/>
+      <separator/>
+      <action id="Vss.Diff" class="xcom.intellij.vssSupport.actions.DiffAction"
+        text="_Compare with SourceSafe Version..."
+        description="Compare SourceSafe and local version of file"/>
+
+      <action id="Vss.Get"
+        class="xcom.intellij.vssSupport.actions.GetAction"
+        text="_Get Latest Version..."
+        description="Retrieve the most recent version of the file(s)"/>
+    </group>
+
+    <group class="xcom.intellij.openapi.vcs.actions.VcsGroupsWrapper" id="VcsFileGroupPopup" test="Version Control"
+      text="Version Control" popup="true">
+    </group>
+
+    <group id="VersionControlsGroup">
+      <group id="LocalVcsGroup" class="xcom.intellij.localVcs.actions.LocalVcsGroup" text="Local _History" popup="true">
+        <action id="LocalVcs.ShowHistory" class="xcom.intellij.localVcs.actions.ShowHistoryAction" text="Show _History" description="Show local history"/>
+        <action id="LocalVcs.HistoryForBlock" class="xcom.intellij.localVcs.actions.HistoryForSelectedBlockAction" text="Show History for _Selection" description="Show local history for editor selection"/>
+        <action id="LocalVcs.AddLabel" class="xcom.intellij.localVcs.actions.AddLabelAction" text="Add _Label..." description="Add label"/>
+      </group>
+      <reference ref="VcsFileGroupPopup"/>
+    </group>
+
+    <group id="MainMenu">
+
+      <!-- File  -->
+      <group text="_File" id="FileMenu">
+        <action id="NewProject" class="xcom.intellij.ide.actions.NewProjectAction" text="_New Project..." description="Create a new project"/>
+        <action id="NewModule" class="xcom.intellij.openapi.roots.ui.configuration.actions.NewModuleAction" text="New _Module..." description="Add new module to the project"/>
+        <action id="OpenProject" class="xcom.intellij.ide.actions.OpenProjectAction" text="_Open Project..." description="Open an existing project"/>
+        <action id="OpenFile" class="xcom.intellij.ide.actions.OpenFileAction" text="_Open File..." icon="/actions/menu-open.png" description="Open file in editor"/>
+        <group id="$LRU" class="xcom.intellij.ide.actions.RecentProjectsGroup" text="_Reopen" popup="true" description="List of recently opened projects"/>
+        <action id="CloseProject" class="xcom.intellij.ide.actions.CloseProjectAction" text="Close Pro_ject" description="Close current project"/>
+
+        <separator/>
+        <action id="ShowSettings" class="xcom.intellij.ide.actions.ShowSettingsAction" text="Se_ttings" icon="/general/ideOptions.png" description="Configure application and current project settings"/>
+        <action id="TemplateProjectProperties" class="xcom.intellij.ide.actions.TemplateProjectPropertiesAction" text="Templ_ate Project Settings" description="Configure template settings for all new projects"/>
+        <separator/>
+        <action id="SaveAll" class="xcom.intellij.ide.actions.SaveAllAction" text="_Save All" icon="/actions/menu-saveall.png" description="Save all files and settings"/>
+        <action id="ExportSettings" class="xcom.intellij.ide.actions.ExportSettingsAction" text="_Export Settings..." description="Export global settings"/>
+        <action id="ImportSettings" class="xcom.intellij.ide.actions.ImportSettingsAction" text="_Import Settings..." description="Import global settings"/>
+        <action id="Synchronize" class="xcom.intellij.ide.actions.SynchronizeAction" text="S_ynchronize" icon="/actions/sync.png" description="Detect all externally changed files and reload them from disk"/>
+        <action id="ReloadFromDisk" class="xcom.intellij.ide.actions.ReloadFromDiskAction" text="Reload from Dis_k" description="Reload current file from disk and lose all changes"/>
+        <separator/>
+        <action id="ExportToHTML" class="xcom.intellij.codeEditor.printing.ExportToHTMLAction" text="Export to _HTML..." description="Save file content in HTML format with syntax coloring"/>
+        <action id="Print" class="xcom.intellij.codeEditor.printing.PrintAction" text="_Print..." description="Print file"/>
+        <separator/>
+        <action id="Exit" class="xcom.intellij.ide.actions.ExitAction" text="E_xit" description="Quit IDEA"/>
+      </group>
+
+      <!-- Edit -->
+      <group text="_Edit" id="EditMenu">
+        <action id="$Undo" class="xcom.intellij.ide.actions.UndoAction" text="_Undo" icon="/actions/undo.png" description="Undo last operation"/>
+        <action id="$Redo" class="xcom.intellij.ide.actions.RedoAction" text="_Redo" icon="/actions/redo.png" description="Redo last undone operation"/>
+        <separator/>
+        <group id="CutCopyPasteGroup">
+          <action id="$Cut" class="xcom.intellij.ide.actions.CutAction" text="Cu_t" icon="/actions/menu-cut.png" description="Cut to clipboard"/>
+          <action id="$Copy" class="xcom.intellij.ide.actions.CopyAction" text="_Copy" icon="/actions/copy.png" description="Copy to clipboard"/>
+          <action id="CopyPaths" class="xcom.intellij.ide.actions.CopyPathsAction" text="C_opy Paths" description="Copy paths corresponding to selected files or directories to clipboard"/>
+          <action id="$Paste" class="xcom.intellij.ide.actions.PasteAction" text="_Paste" icon="/actions/menu-paste.png" description="Paste from clipboard"/>
+          <action id="PasteMultiple" class="xcom.intellij.openapi.editor.actions.MultiplePasteAction" text="Past_e..." description="Paste from recent clipboards"/>
+          <reference ref="EditorToggleColumnMode"/>
+        </group>
+        <separator/>
+        <action id="$SelectAll" class="xcom.intellij.ide.actions.SelectAllAction" text="Select _All" description="Select all"/>
+        <separator/>
+        <action id="NewElement" class="xcom.intellij.ide.actions.NewElementAction" text="_New..." description="Create new class, interface, file or directory"/>
+        <action id="$Delete" class="xcom.intellij.ide.actions.DeleteAction" text="_Delete" description="Delete selected item"/>
+        <separator/>
+        <action id="ToggleBookmark" class="xcom.intellij.ide.bookmarks.actions.ToggleBookmarkAction" text="Toggle _Bookmark" description="Toggle bookmark at the current location"/>
+        <action id="ShowBookmarks" class="xcom.intellij.ide.bookmarks.actions.ShowBookmarksAction" text="_Show Bookmarks" description="Show list of all bookmarks"/>
+      </group>
+
+      <!-- Search -->
+      <group text="_Search" id="SearchMenu">
+        <action id="Find" class="xcom.intellij.openapi.editor.actions.FindAction" text="_Find..." icon="/actions/menu-find.png" description="Find a string in active editor"/>
+        <action id="Replace" class="xcom.intellij.openapi.editor.actions.ReplaceAction" text="_Replace..." icon="/actions/menu-replace.png" description="Replace a string in active editor with another string"/>
+        <action id="FindNext" class="xcom.intellij.ide.actions.SearchAgainAction" text="Find _Next" description="Repeat the last Find/Replace operation"/>
+        <action id="FindPrevious" class="xcom.intellij.ide.actions.SearchBackAction" text="Find Pre_vious" description="Repeat the last Find/Replace operation in reverse direction"/>
+        <action id="FindWordAtCaret" class="xcom.intellij.openapi.editor.actions.FindWordAtCaretAction" text="Find _Word at Caret" description="Find next occurrence of the word at caret"/>
+        <action id="IncrementalSearch" class="xcom.intellij.codeInsight.navigation.actions.IncrementalSearchAction" text="Incrementa_l Search" description="Start incremental search (searches string as you type)"/>
+        <separator/>
+        <action id="FindUsages" class="xcom.intellij.find.actions.FindUsagesAction" text="Find _Usages..." description="Find usages of the symbol at caret"/>
+        <action id="FindUsagesInFile" class="xcom.intellij.find.actions.FindUsagesInFileAction" text="F_ind Usages in File..." description="Find usages of the symbol at caret in active editor"/>
+        <action id="HighlightUsagesInFile" class="xcom.intellij.codeInsight.highlighting.actions.HighlightUsagesAction" text="_Highlight Usages in File" description="Highlight usages of the symbol at caret in active editor"/>
+        <separator/>
+        <action id="FindInPath" class="xcom.intellij.find.actions.FindInPathAction" text="Find in _Path..." description="Find a string in multiple files"/>
+        <action id="ReplaceInPath" class="xcom.intellij.find.actions.ReplaceInPathAction" text="Repl_ace in Path..." description="Replace a string in multiple files with another string"/>
+      </group>
+
+      <!-- View -->
+      <group text="_View" id="ViewMenu">
+        <action id="ViewToolBar" class="xcom.intellij.ide.actions.ViewToolbarAction" text="_Toolbar" description="Show/hide the main toolbar"/>
+        <action id="ViewStatusBar" class="xcom.intellij.ide.actions.ViewStatusBarAction" text="_Status Bar" description="Show/hide the status bar"/>
+        <reference ref="EditorToggleShowWhitespaces"/>
+        <reference ref="EditorToggleShowLineNumbers"/>
+        <separator/>
+        <action id="ToggleFullScreenMode" class="xcom.intellij.ide.actions.ToggleFullScreenModeAction" text="F_ull Screen" description="Maximize window to full screen"/>
+        <separator/>
+        <group id="CodeEditorViewGroup" class="xcom.intellij.ide.actions.CodeEditorActionGroup">
+          <action id="FileStructurePopup" class="xcom.intellij.ide.actions.ViewStructureAction" text="_File Structure Popup" description="Popup structure of the current file for quick navigation"/>
+          <action id="SelectIn" class="xcom.intellij.ide.actions.SelectInAction" text="Se_lect In..." description="Select the current class or method in any view"/>
+          <action id="QuickJavaDoc" class="xcom.intellij.codeInsight.javadoc.actions.ShowQuickDocInfoAction" text="_Quick JavaDoc" description="Show a popup window with JavaDoc for the symbol at caret"/>
+          <action id="QuickImplementations" class="xcom.intellij.codeInsight.hint.actions.ShowImplementationsAction" text="Quick _Implementations" description="Show a popup window with the symbol (and its implementations) code"/>
+          <action id="ParameterInfo" class="xcom.intellij.codeInsight.hint.actions.ShowParameterInfoAction" text="_Parameter Info" description="Show parameters of the method call at caret"/>
+          <action id="EditorContextInfo" class="xcom.intellij.codeInsight.hint.actions.ShowContainerInfoAction" text="_Context Info" description="Show the current method or class declaration when it is not visible"/>
+          <action id="ShowErrorDescription" class="xcom.intellij.codeInsight.daemon.impl.actions.ShowErrorDescriptionAction" text="E_rror Description" description="Show description of error or warning at caret"/>
+        </group>
+        <separator/>
+        <group id="CommanderViewGroup" class="xcom.intellij.ide.actions.CommanderViewActionGroup">
+          <action id="CommanderSyncViews" class="xcom.intellij.ide.actions.SyncViewsAction" text="S_ynchronize Views" description="Synchronize both panels"/>
+          <action id="CommanderSwapPanels" class="xcom.intellij.ide.actions.SwapPanelsAction" text="Swap _Panels" description="Swap the panels"/>
+          <reference ref="CompareTwoFiles"/>
+          <reference ref="CompareFileWithEditor"/>
+        </group>
+        <separator/>
+        <group id="ProjectViewGroup" class="xcom.intellij.ide.projectView.actions.ProjectViewActionGroup">
+          <action id="ProjectViewChangeView" class="xcom.intellij.ide.projectView.actions.ChangeProjectViewAction" text="Change View" description="Choose Project, Sourcepath or Classpath tree in the Project View window"/>
+        </group>
+        <separator/>
+        <action id="EditSource" class="xcom.intellij.ide.actions.EditSourceAction" text="_Jump to Source" description="Open editor for the selected item and give focus to it"/>
+        <action id="ViewSource" class="xcom.intellij.ide.actions.ViewSourceAction" text="Sho_w Source" description="Open editor for the selected item"/>
+        <separator/>
+        <action id="ExternalJavaDoc" class="xcom.intellij.ide.actions.ExternalJavaDocAction" text="External Java_Doc" description="Open browser with JavaDoc for the selected item"/>
+        <action id="RecentFiles" class="xcom.intellij.ide.actions.ShowRecentFilesAction" text="Rece_nt Files..." description="Show list of recently edited files"/>
+
+        <action id="QuickChangeScheme" class="xcom.intellij.ide.actions.QuickChangeSchemesAction" text="_Quick Switch Scheme..." description="Change current code style scheme, color&amp;fonts scheme, keymap or Look&amp;Feel"/>
+        <separator/>
+        <action id="TypeHierarchy" class="xcom.intellij.ide.hierarchy.actions.BrowseTypeHierarchyAction" text="Type _Hierarchy" description="Browse hierarchy for the selected class"/>
+        <action id="MethodHierarchy" class="xcom.intellij.ide.hierarchy.actions.BrowseMethodHierarchyAction" text="_Method Hierarchy" description="Browse method hierarchy for the selected method"/>
+        <action id="CallHierarchy" class="xcom.intellij.ide.hierarchy.actions.BrowseCallHierarchyAction" text="Call Hierarch_y" description="Browse call hierarchy for the selected method"/>
+        <separator/>
+        <group id="FoldingGroup" class="xcom.intellij.codeInsight.folding.impl.actions.FoldingGroup" text="Foldin_g" popup="true">
+          <action id="ExpandRegion" class="xcom.intellij.codeInsight.folding.impl.actions.ExpandRegionAction" text="E_xpand" description="Expand folding region at caret"/>
+          <action id="CollapseRegion" class="xcom.intellij.codeInsight.folding.impl.actions.CollapseRegionAction" text="_Collapse" description="Collapse folding region at caret"/>
+          <separator/>
+          <action id="ExpandAllRegions" class="xcom.intellij.codeInsight.folding.impl.actions.ExpandAllRegionsAction" text="_Expand All" description="Expand all folding regions"/>
+          <action id="CollapseAllRegions" class="xcom.intellij.codeInsight.folding.impl.actions.CollapseAllRegionsAction" text="Collapse _All" description="Collapse all folding regions"/>
+          <separator/>
+          <action id="ExpandJavadocs" class="xcom.intellij.codeInsight.folding.impl.actions.ExpandJavadocsAction" text="Expand Java_docs" description="Expand all javadoc comments"/>
+          <action id="CollapseJavadocs" class="xcom.intellij.codeInsight.folding.impl.actions.CollapseJavadocsAction" text="Collapse _Javadocs" description="Collapse all javadoc comments"/>
+          <separator/>
+          <action id="CollapseSelection" class="xcom.intellij.codeInsight.folding.impl.actions.CollapseSelectionAction" text="Fold _Selection / Remove region" description="Fold selected block"/>
+          <action id="CollapseBlock" class="xcom.intellij.codeInsight.folding.impl.actions.CollapseBlockAction" text="Fold Code Block" description="Fold current code block"/>
+        </group>
+      </group>
+
+      <!-- Go to -->
+      <group text="_Go To" id="GoToMenu">
+        <action id="GotoClass" class="xcom.intellij.ide.actions.GotoClassAction" text="_Class..." description="Quickly navigate to a class by name"/>
+        <action id="GotoFile" class="xcom.intellij.ide.actions.GotoFileAction" text="_File..." description="Quickly navigate to a file by name"/>
+        <action id="GotoSymbol" class="xcom.intellij.ide.actions.GotoSymbolAction" text="_Symbol..." description="Quickly navigate to any symbol by name"/>
+        <action id="GotoLine" class="xcom.intellij.ide.actions.GotoLineAction" text="_Line..." description="Navigate to a line in editor by its number"/>
+        <separator/>
+        <action id="GotoDeclaration" class="xcom.intellij.codeInsight.navigation.actions.GotoDeclarationAction" text="_Declaration" description="Navigate to the declaration of the symbol at caret"/>
+        <action id="GotoDefinition" class="xcom.intellij.codeInsight.navigation.actions.GotoDefinitionAction" text="_Definition" description="Navigate to the definitions of the current value"/>
+        <action id="GotoUsage" class="xcom.intellij.codeInsight.navigation.actions.GotoUsageAction" text="_Usage" description="Navigate to the usages of the current value"/>
+        <action id="GotoImplementation" class="xcom.intellij.codeInsight.navigation.actions.GotoImplementationAction" text="I_mplementation(s)" description="Navigate to the implementation(s) of the selected class or method"/>
+        <action id="SmartGotoImplementation" class="xcom.intellij.codeInsight.navigation.actions.SmartGotoImplementationAction" text="_Called Implementation(s)" description="Navigate to the implementation(s) of the selected method"/>
+        <action id="GotoTypeDeclaration" class="xcom.intellij.codeInsight.navigation.actions.GotoTypeDeclarationAction" text="_Type Declaration" description="Navigate to the declaration of the symbol's type at caret"/>
+        <action id="GotoSuperMethod" class="xcom.intellij.codeInsight.navigation.actions.GotoSuperAction" text="S_uper Method" description="Navigate to the declaration of the method that current method overrides or implements"/>
+        <action id="GotoAspect" class="xcom.intellij.codeInsight.navigation.actions.GotoAspectAction" text="_Aspect" description="Navigate to the declaration of the advice, error or warning declaration that affects a join point at caret"/>
+        <separator/>
+        <action id="GotoNextError" class="xcom.intellij.codeInsight.daemon.impl.actions.GotoNextErrorAction" text="_Next Highlighted Error" description="Navigate to the next highlighted error in the active editor"/>
+        <action id="GotoPreviousError" class="xcom.intellij.codeInsight.daemon.impl.actions.GotoPreviousErrorAction" text="_Previous Highlighted Error" description="Navigate to the previous highlighted error in the active editor"/>
+        <separator/>
+        <action id="MethodDown" class="xcom.intellij.codeInsight.navigation.actions.MethodDownAction" text="N_ext Method" description="Navigate to the next method in the active editor"/>
+
+
+        <action id="MethodUp" class="xcom.intellij.codeInsight.navigation.actions.MethodUpAction" text="Prev_ious Method" description="Navigate to the previous method in the active editor"/>
+        <separator/>
+        <action id="GotoNextBookmark" class="xcom.intellij.ide.bookmarks.actions.NextBookmarkAction" text="Ne_xt Bookmark" description="Navigate to the next bookmark in the active editor"/>
+        <action id="GotoPreviousBookmark" class="xcom.intellij.ide.bookmarks.actions.PreviousBookmarkAction" text="P_revious Bookmark" description="Navigate to the previous bookmark in the active editor"/>
+        <separator/>
+        <action id="Back" class="xcom.intellij.ide.actions.BackAction" text="_Back" icon="/actions/back.png" description="Undo last navigation operation"/>
+        <action id="Forward" class="xcom.intellij.ide.actions.ForwardAction" text="For_ward" icon="/actions/forward.png" description="Redo last undone navigation operation"/>
+        <action id="JumpToLastChange" class="xcom.intellij.ide.actions.JumpToLastEditAction" text="La_st Edit Location" description="Move through the most recent change points"/>
+        <separator/>
+        <action id="PreviousOccurence" class="xcom.intellij.ide.actions.PreviousOccurenceAction" text="Previ_ous Occurrence" icon="/actions/previousOccurence.png" description="Navigate to the previous occurrence"/>
+        <action id="NextOccurence" class="xcom.intellij.ide.actions.NextOccurenceAction" text="Ne_xt Occurrence" icon="/actions/nextOccurence.png" description="Navigate to the next occurrence"/>
+        <separator/>
+        <action id="VcsShowNextChangeMarker" class="xcom.intellij.openapi.vcs.actions.ShowNextChangeMarkerAction" text="Go To Next Change" description="Next change" icon="/actions/nextOccurence.png"/>
+        <action id="VcsShowPrevChangeMarker" class="xcom.intellij.openapi.vcs.actions.ShowPrevChangeMarkerAction" text="Go To Prev Change" description="Prev change" icon="/actions/previousOccurence.png"/>
+      </group>
+
+      <!--  Code  -->
+      <group id="CodeMenu" class="xcom.intellij.codeInsight.actions.CodeGroup" text="Co_de">
+        <reference ref="OverrideMethods"/>
+        <reference ref="ImplementMethods"/>
+        <action id="DelegateMethod" class="xcom.intellij.codeInsight.generation.actions.GenerateDelegateAction" text="_Delegate Methods..." description="Generate delegate method to a field/getter"/>
+        <separator/>
+        <action id="SurroundWith" class="xcom.intellij.codeInsight.generation.actions.SurroundWithAction" text="_Surround With..." description="Surround selected code fragment with if, while, try/catch or other construct"/>
+        <!-- Alt-Ins in Java code-->
+        <action id="Generate" text="_Generate..." description="Generate constructor, getter or setter method, or EJB components" class="xcom.intellij.codeInsight.generation.actions.GenerateAction"/>
+        <separator/>
+        <group id="CodeCompletionGroup" class="xcom.intellij.codeInsight.completion.actions.CodeCompletionGroup" text="_Complete Code" popup="true">
+          <action id="CodeCompletion" class="xcom.intellij.codeInsight.completion.actions.CodeCompletionAction" text="Basic" description="Complete code"/>
+          <action id="WordCompletion" class="xcom.intellij.codeInsight.completion.actions.WordCompletionAction" text="Complete Word" description="Complete word"/>
+          <action id="SmartTypeCompletion" class="xcom.intellij.codeInsight.completion.actions.SmartCodeCompletionAction" text="SmartType" description="Complete code basing on expected type"/>
+          <action id="ClassNameCompletion" class="xcom.intellij.codeInsight.completion.actions.ClassNameCompletionAction" text="Class Name" description="Complete class name and add import for it"/>
+        </group>
+        <separator/>
+        <action id="InsertLiveTemplate" class="xcom.intellij.codeInsight.template.impl.actions.ListTemplatesAction" text="Insert Live _Template..." description="Show popup list of live templates starting with the specified prefix"/>
+        <action id="SurroundWithLiveTemplate" class="xcom.intellij.codeInsight.template.impl.actions.SurroundWithTemplateAction" text="Surround with Live Tem_plate..." description="Surrounds the selection with one of the template"/>
+        <separator/>
+        <action id="CommentByLineComment" class="xcom.intellij.codeInsight.generation.actions.CommentByLineCommentAction" text="Comment with _Line Comment" description="Comment/uncomment current line or selected block with line comments"/>
+        <action id="CommentByBlockComment" class="xcom.intellij.codeInsight.generation.actions.CommentByBlockCommentAction" text="Comment with _Block Comment" description="Comment/uncomment code with block comments"/>
+        <action id="AutoIndentLines" class="xcom.intellij.codeInsight.generation.actions.AutoIndentLinesAction" text="_Auto-Indent Lines" description="Indent current line or selected block according to the code style settings"/>
+      </group>
+
+      <group id="AnalyzeMenu" text="Analy_ze" popup="true">
+        <action id="InspectCode" class="xcom.intellij.codeInspection.actions.CodeInspectionAction" text="_Inspect Code..." description="Inspect code"/>
+        <action id="ViewOfflineInspection" class="xcom.intellij.codeInspection.actions.ViewOfflineResultsAction" text="View _Offline Inspection Results..." description="Load offline inspection results"/>
+        <action id="ShowPackageDeps" class="xcom.intellij.packageDependencies.actions.AnalyzeDependenciesAction" text="Analyze _Dependencies..." description="Browse code choosen analysis item depends on" />
+        <action id="DupLocate" class="xcom.intellij.dupLocator.DuplocateAction" text="_Locate Duplicates..." description="Locate duplicate code in project" />
+      </group>
+
+      <!-- Refactor -->
+      <group id="RefactoringMenu" class="xcom.intellij.refactoring.actions.RefactoringGroup" text="_Refactor" popup="true">
+        <action id="RenameElement" class="xcom.intellij.refactoring.actions.RenameElementAction" text="_Rename..." description="Rename the selected symbol and correct all references"/>
+        <action id="ChangeSignature" class="xcom.intellij.refactoring.actions.ChangeSignatureAction" text="Change _Signature..." description="Change signature of the selected method or class and correct all references"/>
+        <action id="MakeMethodStatic" class="xcom.intellij.refactoring.actions.MakeStaticAction" text="Make Method S_tatic..." description="Convert method to static and correct all references"/>
+        <action id="ConvertToInstanceMethod" class="xcom.intellij.refactoring.actions.ConvertToInstanceMethodAction" text="C_onvert To Instance Method..." description="Convert static method to instance method and correct all references"/>
+        <separator/>
+        <action id="Move" class="xcom.intellij.refactoring.actions.MoveAction" text="_Move..." description="Move the selected class, package or static member to another package or class and correct all references"/>
+        <action id="CopyElement" class="xcom.intellij.ide.actions.CopyElementAction" text="C_opy..." description="Create a copy of the selected class, file(s) or directory(es)"/>
+        <action id="CloneElement" class="xcom.intellij.ide.actions.CloneElementAction" text="Clo_ne..." description="Create a copy of the selected class, file or directory in the same package/directory"/>
+        <action id="SafeDelete" class="xcom.intellij.refactoring.actions.SafeDeleteAction" text="Safe _Delete..." description="Delete the selected class, method or field, checking for usages"/>
+        <separator/>
+        <action id="ExtractMethod" class="xcom.intellij.refactoring.actions.ExtractMethodAction" text="E_xtract Method..." description="Turn the selected code fragment into a method"/>
+        <action id="MethodDuplicates" class="xcom.intellij.refactoring.actions.MethodDuplicatesAction" text="Replace Method Code Duplicates..." description="Finds code in current file that can be transformed into a call of selected method"/>
+        <action id="IntroduceVariable" class="xcom.intellij.refactoring.actions.IntroduceVariableAction" text="Introduce _Variable..." description="Put a result of the selected expression into a variable"/>
+        <action id="IntroduceField" class="xcom.intellij.refactoring.actions.IntroduceFieldAction" text="Introduce _Field..." description="Put a result of the selected expression into a field"/>
+        <action id="IntroduceConstant" class="xcom.intellij.refactoring.actions.IntroduceConstantAction" text="Introduce _Constant..." description="Replace selected expression with a constant (static final field)"/>
+        <action id="IntroduceParameter" class="xcom.intellij.refactoring.actions.IntroduceParameterAction" text="Introduce _Parameter..." description="Turn the selected expression into method parameter"/>
+        <separator/>
+        <action id="ExtractModule" class="xcom.intellij.refactoring.actions.ExtractModuleAction" text="Extract _Interface..." description="Extract interface from the selected class"/>
+        <action id="ExtractSuperclass" class="xcom.intellij.refactoring.actions.ExtractSuperclassAction" text="Extract S_uperclass..." description="Extract superclass from the selected class"/>
+        <action id="TurnRefsToSuper" class="xcom.intellij.refactoring.actions.TurnRefsToSuperAction" text="Use Interface _Where Possible..." description="Change usages of a class to those of its superclass or interface"/>
+        <action id="MembersPullUp" class="xcom.intellij.refactoring.actions.PullUpAction" text="Pu_ll Members Up..." description="Pull class members to superclass or implemented interface"/>
+        <action id="MemberPushDown" class="xcom.intellij.refactoring.actions.PushDownAction" text="Pus_h Members Down..." description="Push class members down to directly inheriting subclasses"/>
+        <action id="InheritanceToDelegation" class="xcom.intellij.refactoring.actions.InheritanceToDelegationAction" text="Replace Inheritance with Dele_gation..." description="Replace inheritance with delegation"/>
+        <separator/>
+        <action id="Inline" class="xcom.intellij.refactoring.actions.InlineAction" text="Inli_ne..." description="Inline the selected method or variable"/>
+        <action id="AnonymousToInner" class="xcom.intellij.refactoring.actions.AnonymousToInnerAction" text="Convert Anon_ymous to Inner..." description="Convert anonymous class into an inner class"/>
+        <action id="EncapsulateFields" class="xcom.intellij.refactoring.actions.EncapsulateFieldsAction" text="_Encapsulate Fields..." description="Replace direct access to fields in the selected class with use of accessor methods"/>
+        <action id="ReplaceTempWithQuery" class="xcom.intellij.refactoring.actions.TempWithQueryAction" text="Replace Temp with _Query..." description="Turn the selected variable into a method"/>
+        <action id="ReplaceConstructorWithFactory" class="xcom.intellij.refactoring.actions.ReplaceConstructorWithFactoryAction" text="Replace Constructor with F_actory Method..." description="Create a static factory method and use it instead of a constructor"/>
+        <separator/>
+        <action id="Generify" class="xcom.intellij.refactoring.actions.TypeCookAction" text="Generify..." description="Convert your code to use generic types"/>
+        <action id="Type Migration" class="xcom.intellij.refactoring.actions.TypeMigrationAction" text="Type Migration..." description="Migrate one type to another"/>
+        <separator/>
+        <action id="ExtractInclude" class="xcom.intellij.refactoring.actions.ExtractIncludeAction" text="Extract Include File..." description="Turn the selected code fragment into included file"/>
+      </group>
+
+      <!-- Build -->
+      <group text="_Build" id="BuildMenu">
+        <action id="CompileProject" class="xcom.intellij.compiler.actions.CompileProjectAction" text="_Rebuild Project" description="Recompile all files in the project"/>
+        <action id="CompileDirty" class="xcom.intellij.compiler.actions.CompileDirtyAction" text="Make _Project" icon="/actions/compile.png" description="Compile all modified and dependent files in the project"/>
+        <action id="MakeModule" class="xcom.intellij.compiler.actions.MakeModuleAction" text="Make _Module" description="Compile all modified and dependent files in the module"/>
+        <action id="Compile" class="xcom.intellij.compiler.actions.CompileAction" text="_Compile" description="Compile the selected file or package"/>
+        <separator/>
+        <action id="GenerateAntBuild" class="xcom.intellij.compiler.actions.GenerateAntBuildAction" text="_Generate Ant Build" description="Generate Ant Build File from the Project"/>
+        <separator/>
+        <group id="AntBuildGroup" class="xcom.intellij.ant.actions.AntBuildGroup"/>
+      </group>
+
+
+      <group text="R_un" id="RunMenu">
+        <group id="RunnerActions" text="Run/Debug" />
+        <action id="editRunConfigurations" text="Edit Configurations" class="xcom.intellij.execution.actions.EditRunConfigurationsAction" description="Open edit Run/Debug configurations dialog"/>
+        <action id="Stop" text="Stop" class="xcom.intellij.execution.actions.StopAction" description="Stop process" icon="/actions/suspend.png"/>
+        <action id="Hotswap" class="xcom.intellij.debugger.actions.HotSwapAction" text="_Reload Changed Classes" description="Reload all changed classes into application being debugged (HotSwap)"/>
+        <separator/>
+        <action id="StepOver" class="xcom.intellij.debugger.actions.StepOverAction" text="Step _Over" icon="/actions/traceOver.png" description="Step to the next line in this file"/>
+        <action id="StepInto" class="xcom.intellij.debugger.actions.StepIntoAction" text="Step _Into" icon="/actions/traceInto.png" description="Step to the next line executed"/>
+        <action id="StepOut" class="xcom.intellij.debugger.actions.StepOutAction" text="Step Ou_t" icon="/actions/stepOut.png" description="Step to the first line executed after returning from this method"/>
+        <action id="ForceStepOver" class="xcom.intellij.debugger.actions.ForceStepOverAction" text="Fo_rce Step Over" icon="/actions/traceOver.png" description="Step over, disable all breakpoints before stepping."/>
+        <action id="ForceStepInto" class="xcom.intellij.debugger.actions.ForceStepIntoAction" text="Fo_rce Step Into" icon="/actions/forceStepInto.png" description="Step into, ignore stepping filters for libraries, constructors, etc."/>
+        <action id="RunToCursor" class="xcom.intellij.debugger.actions.RunToCursorAction" text="Run to _Cursor" icon="/actions/runToCursor.png" description="Run to the line where the caret is"/>
+        <action id="ForceRunToCursor" class="xcom.intellij.debugger.actions.ForceRunToCursorAction" text="Force Run to C_ursor" description="Run to the line where the caret is, ignoring any breakpoints"/>
+        <action id="Debugger.PopFrame" class="xcom.intellij.debugger.actions.PopFrameAction" text="Pop Frame" icon="/actions/popFrame.png" description="Moves execution point back to the method call dropping current method frames from the stack"/>
+        <action id="Pause" class="xcom.intellij.debugger.actions.PauseAction" text="_Pause Program" icon="/actions/pause.png" description="Suspend program execution and enable debugging"/>
+        <action id="Resume" class="xcom.intellij.debugger.actions.ResumeAction" text="Resume Pro_gram" icon="/actions/resume.png" description="Resume program execution"/>
+        <separator/>
+        <action id="EvaluateExpression" class="xcom.intellij.debugger.actions.EvaluateAction" text="_Evaluate Expression..." icon="/debugger/evaluateExpression.png" description="Evaluate arbitrary expression"/>
+        <action id="QuickEvaluateExpression" class="xcom.intellij.debugger.actions.QuickEvaluateAction" text="_Quick Evaluate Expression" description="Evaluate selected expression"/>
+        <action id="ShowExecutionPoint" class="xcom.intellij.debugger.actions.ShowExecutionPointAction" text="Show E_xecution Point" icon="/debugger/showCurrentFrame.png" description="Show the current program execution point"/>
+        <separator/>
+        <action id="ToggleLineBreakpoint" class="xcom.intellij.debugger.actions.ToggleLineBreakpointAction" text="Toggle  _Line Breakpoint" description="Toggle line breakpoint at caret"/>
+        <action id="ToggleMethodBreakpoint" class="xcom.intellij.debugger.actions.ToggleMethodBreakpointAction" text="Toggle  _Method Breakpoint" description="Toggle method breakpoint for the method at caret"/>
+        <action id="ToggleFieldBreakpoint" class="xcom.intellij.debugger.actions.ToggleFieldBreakpointAction" text="Toggle  _Field Watchpoint" description="Toggle field watchpoint for the field at caret"/>
+        <action id="ToggleBreakpointEnabled" class="xcom.intellij.debugger.actions.ToggleBreakpointEnabledAction" text="Toggle Breakpoint Enabled" icon="/actions/toggleBreakpoint.png" description="Enable/disable breakpoint at the current line"/>
+        <action id="ViewBreakpoints" class="xcom.intellij.debugger.actions.ViewBreakpointsAction" text="_View Breakpoints" icon="/debugger/viewBreakpoints.png" description="View and manage all breakpoints and watchpoints"/>
+        <separator/>
+        <action id="ExportThreads" class="xcom.intellij.debugger.actions.ExportThreadsAction" text="Export T_hreads..." description="Save all threads information to a text file or clipboard"/>
+      </group>
+
+      <!-- Tools -->
+      <group text="_Tools" id="ToolsMenu" configurable="true">
+        <action id="ReformatCode" class="xcom.intellij.codeInsight.actions.ReformatCodeAction" text="_Reformat Code..." description="Reformat code"/>
+        <action id="OptimizeImports" class="xcom.intellij.codeInsight.actions.OptimizeImportsAction" text="_Optimize Imports..." description="Remove unused imports and reorder/reorganize imports"/>
+        <action id="SaveAsTemplate" class="xcom.intellij.codeInsight.template.actions.SaveAsTemplateAction" text="Save as L_ive Template..." description="Save the selected text as live template"/>
+        <action id="SaveFileAsTemplate" class="xcom.intellij.ide.actions.SaveFileAsTemplateAction" text="Save File as Temp_late..." description="Save current file as template"/>
+        <action id="GenerateJavadoc" class="xcom.intellij.javadoc.actions.GenerateJavadocAction" text="Generate Java_Doc..." description="Run the JavaDoc tool"/>
+        <separator/>
+        <group id="Macros" text="_Macros" description="View, Change, Record, Play Macros" popup="true">
+          <group id="StanardMacroActions">
+            <action id="PlaybackLastMacro" class="xcom.intellij.ide.actionMacro.actions.PlaybackLastMacroAction" text="Playback _Last Macro" description="Playback last used macro"/>
+            <action id="StartStopMacroRecording" class="xcom.intellij.ide.actionMacro.actions.StartStopMacroRecordingAction" text="Start/Stop Macro _Recording" description="Start/Stop recording of a new macro"/>
+            <action id="EditMacros" class="xcom.intellij.ide.actionMacro.actions.EditMacrosAction" text="_Edit Macros..." description="Configure existing macros"/>
+          </group>
+          <separator/>
+          <group id="PlaySavedMacroActions" class="xcom.intellij.ide.actionMacro.actions.MacrosGroup"/>
+        </group>
+        <separator/>
+        <action id="Migrate" class="xcom.intellij.refactoring.actions.MigrateAction" text="Mi_grate..." description="Open migration dialog"/>
+        <separator/>
+        <group>
+          <action id="ValidateXml" class="xcom.intellij.xml.actions.ValidateXmlAction" text="_Validate" description="Validate the current xml file"/>
+          <action id="AddAntBuildFile" class="xcom.intellij.ant.actions.AddAntBuildFile" text="Add as Ant Build File" description="Add current XML file to the list of project's Ant build files"/>
+        </group>
+        <separator/>
+        <reference ref="LocalVcsGroup"/>
+        <separator/>
+        <action id="GenerateDTD" class="xcom.intellij.codeInsight.actions.GenerateDTDAction" text="Generate DTD from XML file"/>
+
+        <separator/>
+        <group id="ExternalToolsGroup" text="External Tools" class="xcom.intellij.tools.ExternalToolsGroup"/>
+        <separator/>
+        <action id="DataSources" class="xcom.intellij.javaee.dataSource.DataSourcesManagementAction" text="Data Sources..." description="Manage JDBC Data Sources"/>
+        <separator/>
+
+        <group text="Unscramble" popup="true">
+          <action id="Unscramble" class="xcom.intellij.unscramble.UnscrambleAction" text="_Unscramble Stacktrace..."/>
+          <action id="UnscrambleFromClipboard" class="xcom.intellij.unscramble.UnscrambleFromClipboardAction" text="Unscramble Stacktrace From Clipboard..."/>
+        </group>
+
+        <group text="Internal Actions" internal="true" popup="true">
+          <action id="PsiViewer" internal="true" class="xcom.intellij.internal.psiView.PsiViewerAction" text="View PSI Structure"/>
+          <action id="DebugListen" internal="true" class="xcom.intellij.debugger.actions.ThrowDebugExceptionAction" text="Throw Debug Exception"/>
+          <action id="VirtualFileInfo" internal="true" class="xcom.intellij.openapi.vfs.impl.local.VirtualFileInfoAction" text="Virtual File Info"/>
+          <action id="Merge3Files" internal="true" class="xcom.intellij.openapi.diff.actions.MergeFilesAction" text="Merge"/>
+<!--
+<action class="xcom.intellij.localVcs.CheckFileContentProviderAction" id="CheckFileContentProvider" text="Check File Content Provider"></action>
+-->
+          <separator/>
+          <group text="Memory Management" id="MemoryManagement" popup="true">
+            <action id="ScanRefs" internal="true" class="xcom.intellij.internal.scanReferences.actions.ScanRefsAction" text="Scan Refs..."/>
+            <action id="ScanRefsByList" internal="true" class="xcom.intellij.internal.scanReferences.actions.ScanRefsByListAction" text="Scan Refs by List"/>
+            <action id="PrintRefsDump" internal="true" class="xcom.intellij.internal.scanReferences.actions.PrintRefsDumpAction" text="Print Refs Dump"/>
+            <action id="ClearDocumentHistory" internal="true" class="xcom.intellij.internal.scanReferences.actions.ClearDocumentHistoryAction" text="Clear Undo Queue"/>
+            <action id="SaveDump" internal="true" class="xcom.intellij.internal.saveDump.SaveDumpAction" text="Save Dump" description=""/>
+            <action id="DumpPsiMemoryCaches" internal="true" class="xcom.intellij.psi.impl.DumpPsiMemoryCaches" text="Dump what is cached in PSI"/>
+            <action id="AllocationsHistoryAction" internal="true" class="xcom.intellij.internal.scanReferences.allocations.ShowAllocationsAction" text="View Allocations History"/>
+          </group>
+          <action internal="true" id="DecodeBytesAction" class="xcom.intellij.internal.encodings.DecodeBytesAction" text="Decode Bytes"/>
+          <separator/>
+          <action id="LocalVcs.ShowStatistics" class="xcom.intellij.localVcs.actions.ShowStatistics" text="Show Local VCS Statistics..." description="Show Local VCS statistics" internal="true"/>
+          <action id="LocalVcs.ShowRepHistory" class="xcom.intellij.localVcs.actions.PringRepositoryHistoryAction" text="Repository History" internal="true"/>
+          <separator/>
+          <action id="Compile2" class="xcom.intellij.intellijac.CompileAction" text="_Compile(Intellijac)..." description="" internal="true"/>
+          <action id="DropAnError" internal="true" class="xcom.intellij.diagnostic.DropAnErrorAction" text="Drop an error"/>
+
+          <separator/>
+          <action id="Use new code formatter" class="xcom.intellij.psi.impl.source.codeStyle.NewCodeFormatterAction" text="Use New Code Formatter" description="Use New Code Formatter"/>
+
+        </group>
+      </group>
+
+      <reference ref="VcsGroups"/>
+
+      <!-- Window -->
+      <group text="_Window" id="WindowMenu">
+        <group id="ToolWindowsGroup" class="xcom.intellij.ide.actions.ToolWindowsGroup" popup="true" text="T_ool Windows"/>
+        <separator/>
+        <action id="StoreDefaultLayout" class="xcom.intellij.ide.actions.StoreDefaultLayoutAction" text="Store Current Layout as Defa_ult" description="Store current layout as default"/>
+        <action id="RestoreDefaultLayout" class="xcom.intellij.ide.actions.RestoreDefaultLayoutAction" text="Restore Default Layout" description="Restore default layout"/>
+        <separator/>
+        <action id="HideActiveWindow" class="xcom.intellij.ide.actions.HideToolWindowAction" text="_Hide Active Window" description="Hide active tool window"/>
+        <action id="HideAllWindows" class="xcom.intellij.ide.actions.HideAllToolWindowsAction" text="Hi_de All Windows" description="Hide all tool windows"/>
+        <action id="JumpToLastWindow" class="xcom.intellij.ide.actions.JumpToLastWindowAction" text="_Jump to Last Window" description="Activate last focused tool window"/>
+        <separator/>
+        <action id="TogglePinnedMode" class="xcom.intellij.ide.actions.TogglePinnedModeAction" text="_Pinned Mode" description="Pin/unpin active tool window"/>
+        <action id="ToggleDockMode" class="xcom.intellij.ide.actions.ToggleDockModeAction" text="Dock_ed Mode" description="Dock/undock active tool window"/>
+        <action id="ToggleFloatingMode" class="xcom.intellij.ide.actions.ToggleFloatingModeAction" text="_Floating Mode" description="Float/unfloat active tool window"/>
+        <separator/>
+        <action id="NextTab" class="xcom.intellij.ide.actions.NextTabAction" text="Select _Next Tab" description="Activate next tab"/>
+        <action id="PreviousTab" class="xcom.intellij.ide.actions.PreviousTabAction" text="Select Previ_ous Tab" description="Activate previous tab"/>
+        <action id="CloseActiveTab" class="xcom.intellij.ide.actions.CloseActiveTabAction" text="Close Active _Tab" description="Close active tool window tab"/>
+        <action id="PinActiveTab" class="xcom.intellij.ide.actions.PinActiveTabAction" text="Pin _Active Tab" description="Pin active tool window or editor tab"/>
+        <separator/>
+        <action id="CloseEditor" class="xcom.intellij.ide.actions.CloseEditorAction" text="_Close Active Editor" description="Close active editor"/>
+        <action id="CloseAllEditors" class="xcom.intellij.ide.actions.CloseAllEditorsAction" text="Close A_ll Editors" description="Close all editors in active tab group"/>
+        <action id="CloseAllEditorsButActive" class="xcom.intellij.ide.actions.CloseAllEditorsButActiveAction" text="Close All Editors B_ut Active" description="Close all open editors except the active one"/>
+        <action id="CloseAllUnmodifiedEditors" class="xcom.intellij.ide.actions.CloseAllUnmodifiedEditorsAction" text="Close All Unmodified Editors" description="Close all nonmodified editors"/>
+        <separator/>
+        <action id="SplitHorisontal"        class="xcom.intellij.ide.actions.SplitHorizontalAction" text="Split Vertically" description="Split editor area into 2 tab groups and move the current tab to the right group"/>
+        <action id="SplitVertical"          class="xcom.intellij.ide.actions.SplitVerticalAction"   text="Split Horizontally" description="Split editor area into 2 tab groups and move the current tab to the bottom group"/>
+        <action id="ChangeSplitOrientation" class="xcom.intellij.ide.actions.ChangeSplitterOrientationAction" text="Change Splitter Orientation" description="Changes orientation of splitter"/>
+        <action id="Unsplit"                class="xcom.intellij.ide.actions.UnsplitAction"         text="Unsplit"     description="Unsplit Window"/>
+        <action id="UnsplitAll"             class="xcom.intellij.ide.actions.UnsplitAllAction"      text="Unsplit All" description="Remove all splitters"/>
+        <action id="NextSplitter"           class="xcom.intellij.ide.actions.NextSplitAction"       text="Goto Next Splitter"     description="Goto next splitter window"/>
+        <action id="PrevSplitter"           class="xcom.intellij.ide.actions.PrevSplitAction"       text="Goto Previons Splitter"     description="Goto previous splitter window"/>
+      </group>
+
+      <!-- Help -->
+      <group text="_Help" id="HelpMenu">
+        <action id="HelpTopics" class="xcom.intellij.ide.actions.HelpTopicsAction" text="Help _Topics" icon="/actions/menu-help.png" description="Show help contents"/>
+        <action id="ShowTips" class="xcom.intellij.ide.actions.ShowTipsAction" text="Tip of the _Day" description="Show Tips of the Day"/>
+        <action id="ProductivityGude" class="xcom.intellij.featureStatistics.actions.ShowFeatureUsageStatisticsAction" text="_Productivity Guide" description="Show productivity features usages statistics"/>
+        <action id="OnlineDocAction" class="xcom.intellij.ide.actions.OnlineDocAction" text="_Online Documentation" description="Show online documentation"/>
+        <separator/>
+        <action id="Register" class="xcom.intellij.ide.actions.RegisterAction" text="_Register..." description="Enter registration data"/>
+        <action id="About" class="xcom.intellij.ide.actions.AboutAction" text="_About" description="Show information about IDEA"/>
+      </group>
+
+      <group id="OtherMenu" class="xcom.intellij.ide.actions.OtherGroup" text="Other" description="Actions that are not properly registered"/>
+    </group>
+
+    <group id="MainToolBar" text="Main Toolbar" configurable="true">
+      <reference ref="OpenFile"/>
+      <reference ref="SaveAll"/>
+      <reference ref="Synchronize"/>
+      <separator/>
+      <reference ref="$Undo"/>
+      <reference ref="$Redo"/>
+      <separator/>
+      <reference ref="$Cut"/>
+      <reference ref="$Copy"/>
+      <reference ref="$Paste"/>
+      <separator/>
+
+      <reference ref="Find"/>
+      <reference ref="Replace"/>
+      <separator/>
+      <reference ref="Back"/>
+      <reference ref="Forward"/>
+      <separator/>
+      <reference ref="CompileDirty"/>
+      <reference ref="RunConfiguration"/>
+      <reference ref="RunnerActions"/>
+      <separator/>
+      <reference ref="ShowSettings"/>
+      <separator/>
+      <reference ref="HelpTopics"/>
+      <separator/>
+      <reference ref="CaptureMemorySnapShot"/>
+      <reference ref="CaptureCPUUsageData"/>
+    </group>
+
+    <group id="Bookmarks" text="Bookmarks">
+      <reference ref="ToggleBookmark"/>
+      <reference ref="ShowBookmarks"/>
+      <reference ref="GotoNextBookmark"/>
+      <reference ref="GotoPreviousBookmark"/>
+
+      <action id="ToggleBookmark0" text="Toggle Bookmark 0" class="xcom.intellij.ide.bookmarks.actions.ToggleBookmark0Action"/>
+      <action id="ToggleBookmark1" text="Toggle Bookmark 1" class="xcom.intellij.ide.bookmarks.actions.ToggleBookmark1Action"/>
+      <action id="ToggleBookmark2" text="Toggle Bookmark 2" class="xcom.intellij.ide.bookmarks.actions.ToggleBookmark2Action"/>
+      <action id="ToggleBookmark3" text="Toggle Bookmark 3" class="xcom.intellij.ide.bookmarks.actions.ToggleBookmark3Action"/>
+      <action id="ToggleBookmark4" text="Toggle Bookmark 4" class="xcom.intellij.ide.bookmarks.actions.ToggleBookmark4Action"/>
+      <action id="ToggleBookmark5" text="Toggle Bookmark 5" class="xcom.intellij.ide.bookmarks.actions.ToggleBookmark5Action"/>
+      <action id="ToggleBookmark6" text="Toggle Bookmark 6" class="xcom.intellij.ide.bookmarks.actions.ToggleBookmark6Action"/>
+      <action id="ToggleBookmark7" text="Toggle Bookmark 7" class="xcom.intellij.ide.bookmarks.actions.ToggleBookmark7Action"/>
+      <action id="ToggleBookmark8" text="Toggle Bookmark 8" class="xcom.intellij.ide.bookmarks.actions.ToggleBookmark8Action"/>
+      <action id="ToggleBookmark9" text="Toggle Bookmark 9" class="xcom.intellij.ide.bookmarks.actions.ToggleBookmark9Action"/>
+
+      <action id="GotoBookmark0" text="Go to Bookmark 0" class="xcom.intellij.ide.bookmarks.actions.GotoBookmark0Action"/>
+      <action id="GotoBookmark1" text="Go to Bookmark 1" class="xcom.intellij.ide.bookmarks.actions.GotoBookmark1Action"/>
+      <action id="GotoBookmark2" text="Go to Bookmark 2" class="xcom.intellij.ide.bookmarks.actions.GotoBookmark2Action"/>
+      <action id="GotoBookmark3" text="Go to Bookmark 3" class="xcom.intellij.ide.bookmarks.actions.GotoBookmark3Action"/>
+      <action id="GotoBookmark4" text="Go to Bookmark 4" class="xcom.intellij.ide.bookmarks.actions.GotoBookmark4Action"/>
+      <action id="GotoBookmark5" text="Go to Bookmark 5" class="xcom.intellij.ide.bookmarks.actions.GotoBookmark5Action"/>
+      <action id="GotoBookmark6" text="Go to Bookmark 6" class="xcom.intellij.ide.bookmarks.actions.GotoBookmark6Action"/>
+      <action id="GotoBookmark7" text="Go to Bookmark 7" class="xcom.intellij.ide.bookmarks.actions.GotoBookmark7Action"/>
+      <action id="GotoBookmark8" text="Go to Bookmark 8" class="xcom.intellij.ide.bookmarks.actions.GotoBookmark8Action"/>
+      <action id="GotoBookmark9" text="Go to Bookmark 9" class="xcom.intellij.ide.bookmarks.actions.GotoBookmark9Action"/>
+    </group>
+
+    <group id="DebuggerActions">
+      <action id="Debugger.AdjustArrayRange" class="xcom.intellij.debugger.actions.AdjustArrayRangeAction" text="Adjust Range..."/>
+      <action id="Debugger.Inspect" class="xcom.intellij.debugger.actions.InspectAction" text="Inspect"/>
+      <action id="Debugger.CopyValue" class="xcom.intellij.debugger.actions.CopyValueAction" text="Copy Value"/>
+      <action id="Debugger.CustomizeContextView" class="xcom.intellij.debugger.actions.CustomizeContextViewAction" text="Customize Data Views..."/>
+      <action id="Debugger.CustomizeThreadsView" class="xcom.intellij.debugger.actions.CustomizeThreadsViewAction" text="Customize Threads View..."/>
+      <action id="Debugger.NewWatch" class="xcom.intellij.debugger.actions.NewWatchAction" text="New Watch..."/>
+      <action id="Debugger.EditWatch" class="xcom.intellij.debugger.actions.EditWatchAction" text="Edit Watch"/>
+      <action id="Debugger.EditFrameSource" class="xcom.intellij.debugger.actions.EditFrameSourceAction" text="EditFrameSource"/>
+      <action id="Debugger.EditNodeSource" class="xcom.intellij.debugger.actions.EditSourceAction" text="EditNodeSource"/>
+      <reference ref="Debugger.PopFrame"/>
+      <action id="Debugger.RemoveAllWatches" class="xcom.intellij.debugger.actions.RemoveAllWatchesAction" text="Remove All Watches"/>
+      <action id="Debugger.RemoveWatch" class="xcom.intellij.debugger.actions.RemoveWatchAction" text="Remove Watch"/>
+      <action id="Debugger.ViewAsGroup" class="xcom.intellij.debugger.actions.ViewAsGroup" text="View as"/>
+      <action id="Debugger.SetValue" class="xcom.intellij.debugger.actions.SetValueAction" text="Set Value..."/>
+      <!--<action id="Debugger.ShowAsHex" class="xcom.intellij.debugger.actions.ShowAsHexAction" text="Show as Hex"/>-->
+      <action id="Debugger.ShowFrame" class="xcom.intellij.debugger.actions.ShowFrameAction" text="Show Frame"/>
+      <action id="Debugger.ResumeThread" class="xcom.intellij.debugger.actions.ResumeThreadAction" text="Resume"/>
+      <action id="Debugger.FreezeThread" class="xcom.intellij.debugger.actions.FreezeThreadAction" text="Freeze"/>
+      <action id="Debugger.ToggleStepThreadSuspendPolicy" class="xcom.intellij.debugger.actions.ToggleStepThreadSuspendPolicyAction" text="Suspend All Threads While Stepping" icon="/debugger/suspend_all.png"/>
+      <action id="Debugger.AddToWatch" class="xcom.intellij.debugger.actions.AddToWatchAction" text="Add to Watches"/>
+    </group>
+
+    <group id="Debugger.Representation">
+      <action id="Debugger.AutoRenderer" class="xcom.intellij.debugger.actions.AutoRendererAction" text="Auto"/>
+    </group>
+
+    <group id="EditorPopupMenu" configurable="true" text="Editor Popup Menu" description="Editor Popup Menu">
+      <action id="Add to migration roots" class="xcom.intellij.refactoring.actions.TypeMigrationAddRootAction" text="_Add to migration roots" description="Add selected element to migration roots"/>
+      <reference ref="CutCopyPasteGroup"/>
+      <separator/>
+      <reference ref="FindUsages"/>
+      <reference ref="FindJoinpointsByPointcutAction"/>
+      <reference ref="AnalyzeMenu"/>
+      <reference ref="RefactoringMenu"/>
+      <separator/>
+      <reference ref="FoldingGroup"/>
+      <separator/>
+      <reference ref="CloseEditor"/>
+      <separator/>
+      <group id="EditorPopupMenu.GoTo" text="Go To" description="Go To Editor Popup Menu Group"  popup="true">
+        <reference ref="GotoDeclaration"/>
+        <reference ref="GotoImplementation"/>
+        <reference ref="GotoTypeDeclaration"/>
+        <reference ref="GotoSuperMethod"/>
+      </group>
+      <reference ref="Generate"/>
+      <separator/>
+      <reference ref="EvaluateExpression"/>
+      <reference ref="RunToCursor"/>
+      <reference ref="ForceRunToCursor"/>
+      <reference ref="Debugger.AddToWatch"/>
+      <separator/>
+      <reference ref="ToggleFieldBreakpoint"/>
+      <separator/>
+      <reference ref="Compile"/>
+      <reference ref="RunContextPopupGroup"/>
+      <reference ref="ValidateXml"/>
+      <action id="ValidateJsp" class="xcom.intellij.javaee.module.view.web.ValidateJSPAction" text="_Validate JSP" description="Validate selected JSP files"/>
+      <action id="PackageFile" class="xcom.intellij.javaee.module.view.web.PackageFileAction" text="_Package file" description="Add selected file into exploded deployment directory or J2EE archive" />
+      <reference ref="AddAntBuildFile"/>
+      <separator/>
+      <reference ref="VersionControlsGroup"/>
+      <separator/>
+      <action id="CompareClipboardWithSelection" class="xcom.intellij.openapi.diff.actions.CompareClipboardWithSelection" text="Compare with _Clipboard" description="Compare current selection with clipboard"/>
+      <reference ref="ExternalToolsGroup"/>
+    </group>
+
+    <group id="ChangeScheme">
+      <action id="ChangeColorScheme" class="xcom.intellij.ide.actions.QuickChangeColorSchemeAction" text="Switch Color Scheme" description="Change current color scheme"/>
+      <action id="ChangeCodeStyleScheme" class="xcom.intellij.ide.actions.QuickChangeCodeStyleSchemeAction" text="Switch Code Style Scheme" description="Change current code style scheme"/>
+      <action id="ChangeKeymap" class="xcom.intellij.ide.actions.QuickChangeKeymapAction" text="Switch Keymap" description="Change current keymap"/>
+      <action id="ChangeLaf" class="xcom.intellij.ide.actions.QuickChangeLookAndFeel" text="Switch Look&amp;Feel" description="Change current Look&amp;Feel"/>
+    </group>
+
+    <group id="EditorTabPopupMenu">
+      <reference ref="Compile"/>
+      <reference ref="RunContextPopupGroup"/>
+      <reference ref="ValidateXml"/>
+      <separator/>
+      <reference ref="VersionControlsGroup"/>
+      <separator/>
+      <reference ref="ExternalToolsGroup"/>
+    </group>
+
+    <action id="ModuleSettings" text="Module Settings..." description="Open settings dialog for selected module" class="xcom.intellij.ide.actions.ShowModulePropertiesAction"/>
+    <group id="MoveModuleToGroup" text="Move Module to Group" description="Open settings dialog for selected module" class="xcom.intellij.ide.projectView.impl.MoveModuleToGroup" popup="true"/>
+
+    <group id="ProjectViewPopupMenu">
+      <reference ref="NewGroup"/>
+      <action id="AssociateWithFileType" text="Associate with File Type" description="Associate selected file with one of file types" class="xcom.intellij.ide.actions.AssociateFileType"/>
+      <separator/>
+      <reference ref="CutCopyPasteGroup"/>
+      <reference ref="EditSource"/>
+      <separator/>
+      <reference ref="FindUsages"/>
+      <reference ref="FindInPath"/>
+      <reference ref="ReplaceInPath"/>
+      <reference ref="FindJoinpointsByPointcutAction"/>
+      <reference ref="AnalyzeMenu"/>
+      <reference ref="RefactoringMenu"/>
+      <reference ref="ValidateXml"/>
+      <reference ref="AddAntBuildFile"/>
+      <separator/>
+      <reference ref="TypeHierarchy"/>
+      <reference ref="ReformatCode"/>
+      <reference ref="OptimizeImports"/>
+      <reference ref="$Delete"/>
+      <separator/>
+      <reference ref="ToggleMethodBreakpoint"/>
+      <reference ref="ToggleFieldBreakpoint"/>
+      <separator/>
+      <reference ref="ValidateJsp"/>
+      <reference ref="PackageFile"/>
+      <reference ref="MakeModule"/>
+      <reference ref="Compile"/>
+      <reference ref="RunContextPopupGroup"/>
+      <separator/>
+      <reference ref="VersionControlsGroup"/>
+      <reference ref="CompareTwoFiles"/>
+      <reference ref="CompareFileWithEditor"/>
+      <separator/>
+      <reference ref="ExternalToolsGroup"/>
+      <separator/>
+      <reference ref="ModuleSettings"/>
+      <reference ref="MoveModuleToGroup"/>
+    </group>
+
+    <group id="J2EEViewPopupMenu">
+      <action id="OpenCustomEditor" class="xcom.intellij.ide.actions.EditSourceAction" text="_Edit..." description="Open editor for the selected item"/>
+      <reference ref="NewGroup"/>
+      <reference ref="CutCopyPasteGroup"/>
+      <separator/>
+      <reference ref="AssociateWithFileType"/>
+      <separator/>
+      <reference ref="FindUsages"/>
+      <reference ref="FindInPath"/>
+      <reference ref="ReplaceInPath"/>
+      <reference ref="FindJoinpointsByPointcutAction"/>
+      <reference ref="InspectCode"/>
+      <reference ref="ShowPackageDeps"/>
+      <reference ref="RefactoringMenu"/>
+      <reference ref="ValidateXml"/>
+      <reference ref="AddAntBuildFile"/>
+      <separator/>
+      <reference ref="TypeHierarchy"/>
+      <reference ref="ReformatCode"/>
+      <reference ref="OptimizeImports"/>
+      <reference ref="$Delete"/>
+      <separator/>
+      <reference ref="ToggleMethodBreakpoint"/>
+      <reference ref="ToggleFieldBreakpoint"/>
+      <separator/>
+      <reference ref="ValidateJsp"/>
+      <reference ref="MakeModule"/>
+      <reference ref="PackageFile"/>
+      <reference ref="Compile"/>
+      <reference ref="RunContextPopupGroup"/>
+      <separator/>
+      <reference ref="VersionControlsGroup"/>
+      <reference ref="CompareTwoFiles"/>
+      <reference ref="CompareFileWithEditor"/>
+      <separator/>
+      <reference ref="ExternalToolsGroup"/>
+      <separator/>
+      <reference ref="ModuleSettings"/>
+    </group>
+
+    <group id="StructureViewPopupMenu">
+      <reference ref="EditSource"/>
+      <separator/>
+      <reference ref="FindUsages"/>
+      <reference ref="RefactoringMenu"/>
+      <reference ref="FindJoinpointsByPointcutAction"/>
+      <separator/>
+      <reference ref="CutCopyPasteGroup"/>
+      <separator/>
+      <reference ref="RunContextPopupGroup"/>
+      <separator/>
+      <reference ref="ToggleMethodBreakpoint"/>
+      <reference ref="ToggleFieldBreakpoint"/>
+      <separator/>
+      <reference ref="Compile"/>
+      <reference ref="VersionControlsGroup"/>
+      <separator/>
+      <reference ref="CompareTwoFiles"/>
+    </group>
+
+    <group id="TypeHierarchyPopupMenu">
+      <action id="TypeHierarchy.BaseOnThisType" text="Base On This Type" class="xcom.intellij.ide.hierarchy.type.TypeHierarchyBrowser$BaseOnThisTypeAction" description="Show hierarchy for selected class/interface"/>
+      <reference ref="EditSource"/>
+      <separator/>
+      <reference ref="FindUsages"/>
+      <reference ref="RefactoringMenu"/>
+      <separator/>
+      <reference ref="RunContextPopupGroup"/>
+      <separator/>
+      <reference ref="ReformatCode"/>
+      <reference ref="OptimizeImports"/>
+      <reference ref="$Delete"/>
+      <separator/>
+      <reference ref="Compile"/>
+      <reference ref="VersionControlsGroup"/>
+
+      <separator/>
+      <reference ref="ExternalToolsGroup"/>
+      <separator/>
+      <reference ref="CompareTwoFiles"/>
+      <reference ref="CompareFileWithEditor"/>
+    </group>
+
+    <group id="MethodHierarchyPopupMenu">
+      <action id="MethodHierarchy.ImplementMethodAction" text="Implement Method" description="Implement Method (from Method Hierarchy)" class="xcom.intellij.ide.hierarchy.method.ImplementMethodAction"/>
+      <action id="MethodHierarchy.OverrideMethodAction" text="Override Method" description="Override Method (from Method Hierarchy)" class="xcom.intellij.ide.hierarchy.method.OverrideMethodAction"/>
+      <separator/>
+      <action id="MethodHierarchy.BaseOnThisType" text="Base On This Type" class="xcom.intellij.ide.hierarchy.method.MethodHierarchyBrowser$BaseOnThisMethodAction" description="Show hierarchy for method of selected class/interface"/>
+      <reference ref="EditSource"/>
+      <separator/>
+      <reference ref="FindUsages"/>
+      <reference ref="RefactoringMenu"/>
+      <separator/>
+      <reference ref="Compile"/>
+      <reference ref="RunContextPopupGroup"/>
+      <separator/>
+      <reference ref="ReformatCode"/>
+      <reference ref="OptimizeImports"/>
+      <separator/>
+      <reference ref="VersionControlsGroup"/>
+      <separator/>
+      <reference ref="ExternalToolsGroup"/>
+      <separator/>
+      <reference ref="CompareTwoFiles"/>
+      <reference ref="CompareFileWithEditor"/>
+    </group>
+
+    <group id="CallHierarchyPopupMenu">
+      <action id="CallHierarchy.BaseOnThisType" text="Base On This Method" class="xcom.intellij.ide.hierarchy.call.CallHierarchyBrowser$BaseOnThisMethodAction" description="Show call hierarchy for selected method"/>
+      <reference ref="EditSource"/>
+      <separator/>
+      <reference ref="FindUsages"/>
+      <reference ref="RefactoringMenu"/>
+      <separator/>
+      <reference ref="Compile"/>
+      <reference ref="RunContextPopupGroup"/>
+      <separator/>
+
+      <reference ref="ReformatCode"/>
+      <reference ref="OptimizeImports"/>
+      <separator/>
+      <reference ref="VersionControlsGroup"/>
+
+      <separator/>
+      <reference ref="ExternalToolsGroup"/>
+      <separator/>
+      <reference ref="CompareTwoFiles"/>
+      <reference ref="CompareFileWithEditor"/>
+    </group>
+
+    <group id="CommanderPopupMenu">
+      <reference ref="NewGroup"/>
+      <reference ref="AssociateWithFileType"/>
+      <separator/>
+      <reference ref="CutCopyPasteGroup"/>
+      <reference ref="EditSource"/>
+      <separator/>
+      <reference ref="FindUsages"/>
+      <reference ref="FindInPath"/>
+      <reference ref="ReplaceInPath"/>
+      <reference ref="FindJoinpointsByPointcutAction"/>
+      <reference ref="InspectCode"/>
+      <reference ref="ShowPackageDeps"/>
+      <reference ref="RefactoringMenu"/>
+      <reference ref="ValidateXml"/>
+      <reference ref="AddAntBuildFile"/>
+      <separator/>
+      <reference ref="TypeHierarchy"/>
+      <reference ref="ReformatCode"/>
+      <reference ref="OptimizeImports"/>
+      <reference ref="$Delete"/>
+      <separator/>
+      <reference ref="Compile"/>
+      <reference ref="RunContextPopupGroup"/>
+      <separator/>
+      <reference ref="VersionControlsGroup"/>
+
+      <reference ref="CompareTwoFiles"/>
+      <reference ref="CompareFileWithEditor"/>
+      <separator/>
+      <reference ref="ExternalToolsGroup"/>
+    </group>
+
+    <group id="Lvcs.DirectoryHistoryPopup">
+      <action id="Lvcs.ShowLvcsDiffAction" text="Compare Versions" class="xcom.intellij.localVcs.ui.ShowLvcsDiffAction"
+        description="Show changes" icon="/actions/diff.png"/>
+      <action id="Lvcs.RollbackFileAction" text="Rollback File" class="xcom.intellij.localVcs.ui.RollbackFileAction"
+        description="Rollback" icon="/actions/rollback.png"/>
+    </group>
+
+
+    <group id="Vcs.CheckinProjectPopup">
+      <action id="Vcs.ShowDiffAction" text="Show Changes" class="xcom.intellij.openapi.vcs.actions.ShowDiffAction" description="Show changes" icon="/actions/diff.png"/>
+      <action id="Vcs.RollbackChanges" text="Rollback Changes" class="xcom.intellij.openapi.vcs.actions.RollbackChangesAction" description="Rollback changes" icon="/actions/rollback.png"/>
+      <action id="Vcs.EditSourceAction" text="Edit Source" class="xcom.intellij.openapi.vcs.actions.EditSourceAction" description="Edit source" icon="/actions/editSource.png"/>
+      <separator/>
+      <action id="Vcs.ExcludeAction" text="Exclude from Commit" class="xcom.intellij.openapi.vcs.actions.ExcludeAction" description="Exclude from commit" icon="/actions/exclude.png"/>
+      <action id="Vcs.IncludeAction" text="Include into Commit" class="xcom.intellij.openapi.vcs.actions.IncludeAction" description="Include into commit" icon="/general/add.png"/>
+      <separator/>
+    </group>
+
+    <group id="Vcs.FileViewPopup" text="FileView">
+      <reference ref="CutCopyPasteGroup"/>
+      <reference ref="EditSource"/>
+      <separator/>
+      <reference ref="RefactoringMenu"/>
+      <reference ref="ValidateXml"/>
+      <reference ref="AddAntBuildFile"/>
+      <separator/>
+      <reference ref="TypeHierarchy"/>
+      <reference ref="ReformatCode"/>
+      <reference ref="OptimizeImports"/>
+      <reference ref="$Delete"/>
+      <separator/>
+      <reference ref="VcsGroup"/>
+      <reference ref="CompareTwoFiles"/>
+      <reference ref="CompareFileWithEditor"/>
+      <separator/>
+      <reference ref="ExternalToolsGroup"/>
+    </group>
+
+    <group id="Vcs.CheckinProjectToolbar">
+      <reference ref="Vcs.ShowDiffAction"/>
+      <reference ref="Vcs.ExcludeAction"/>
+      <reference ref="Vcs.IncludeAction"/>
+      <reference ref="Vcs.RollbackChanges"/>
+      <separator/>
+      <reference ref="Vcs.EditSourceAction"/>
+    </group>
+
+    <group id="TestTreePopupMenu">
+      <action id="openAssertEqualsDiff" text="View assertEquals Difference" class="xcom.intellij.execution.junit2.ui.actions.ViewAssertEqualsDiffAction"/>
+      <separator/>
+      <reference ref="RunContextGroup"/>
+      <separator/>
+      <reference ref="EditSource"/>
+      <reference ref="ViewSource"/>
+    </group>
+
+    <group id="TestStatisticsTablePopupMenu">
+      <reference ref="RunContextGroup"/>
+      <separator/>
+      <reference ref="EditSource"/>
+      <reference ref="ViewSource"/>
+      <separator/>
+      <action id="JUnitTesting.SelectInTree" class="xcom.intellij.execution.junit2.ui.actions.SelectInTreeAction" text="Select in Tree"/>
+    </group>
+
+
+    <group id="Debugger.FramePanelPopup">
+      <reference ref="Debugger.AdjustArrayRange"/>
+      <reference ref="Debugger.Inspect"/>
+      <reference ref="Debugger.SetValue"/>
+      <reference ref="Debugger.EditNodeSource"/>
+      <separator/>
+      <!--<reference ref="Debugger.ShowAsHex"/>-->
+      <reference ref="Debugger.ViewAsGroup"/>
+      <separator/>
+      <reference ref="Debugger.AddToWatch"/>
+      <separator/>
+      <reference ref="ToggleFieldBreakpoint"/>
+      <separator/>
+      <reference ref="Debugger.CopyValue"/>
+      <reference ref="Debugger.CustomizeContextView"/>
+    </group>
+
+    <group id="Debugger.EvaluationDialogPopup">
+      <reference ref="Debugger.AdjustArrayRange"/>
+      <reference ref="Debugger.Inspect"/>
+      <reference ref="Debugger.SetValue"/>
+      <reference ref="Debugger.EditNodeSource"/>
+      <separator/>
+      <!--<reference ref="Debugger.ShowAsHex"/>-->
+      <reference ref="Debugger.ViewAsGroup"/>
+      <separator/>
+      <reference ref="Debugger.AddToWatch"/>
+      <separator/>
+      <reference ref="ToggleFieldBreakpoint"/>
+      <separator/>
+      <reference ref="Debugger.CopyValue"/>
+      <reference ref="Debugger.CustomizeContextView"/>
+    </group>
+
+    <group id="Debugger.InspectPanelPopup">
+      <reference ref="Debugger.AdjustArrayRange"/>
+      <reference ref="Debugger.Inspect"/>
+      <reference ref="Debugger.SetValue"/>
+      <reference ref="Debugger.EditNodeSource"/>
+      <separator/>
+      <reference ref="Debugger.AddToWatch"/>
+      <separator/>
+      <!--<reference ref="Debugger.ShowAsHex"/>-->
+      <reference ref="Debugger.ViewAsGroup"/>
+      <separator/>
+      <reference ref="ToggleFieldBreakpoint"/>
+      <separator/>
+      <reference ref="Debugger.CopyValue"/>
+      <reference ref="Debugger.CustomizeContextView"/>
+    </group>
+
+    <group id="Debugger.ThreadsPanelPopup">
+      <reference ref="Debugger.ResumeThread"/>
+      <reference ref="Debugger.FreezeThread"/>
+      <reference ref="Debugger.ShowFrame"/>
+      <reference ref="Debugger.PopFrame"/>
+      <reference ref="Debugger.EditFrameSource"/>
+      <!--<reference ref="EditSource"/>-->
+      <separator/>
+      <reference ref="ExportThreads"/>
+      <separator/>
+      <reference ref="Debugger.CustomizeThreadsView"/>
+    </group>
+
+    <group id="Debugger.WatchesPanelPopup">
+      <reference ref="Debugger.NewWatch"/>
+      <reference ref="Debugger.EditWatch"/>
+      <reference ref="Debugger.RemoveWatch"/>
+      <reference ref="Debugger.RemoveAllWatches"/>
+      <separator/>
+      <reference ref="Debugger.AdjustArrayRange"/>
+      <reference ref="Debugger.Inspect"/>
+      <reference ref="Debugger.SetValue"/>
+      <reference ref="Debugger.EditNodeSource"/>
+      <separator/>
+      <!--<reference ref="Debugger.ShowAsHex"/>-->
+      <reference ref="Debugger.ViewAsGroup"/>
+      <separator/>
+      <reference ref="Debugger.AddToWatch"/>
+      <separator/>
+      <reference ref="ToggleFieldBreakpoint"/>
+      <separator/>
+      <reference ref="Debugger.CopyValue"/>
+      <reference ref="Debugger.CustomizeContextView"/>
+    </group>
+
+    <!-- *********************** GUI designer actions ********************* -->
+
+    <group id="GuiDesigner.EditorPopupMenu">
+      <action id="GuiDesigner.PreviewForm" class="xcom.intellij.uiDesigner.actions.PreviewFormAction" text="Preview" icon="/com/intellij/uiDesigner/icons/preview.png" description="Preview form" />
+      <action id="GuiDesigner.DataBindingWizard" class="xcom.intellij.uiDesigner.actions.DataBindingWizardAction" text="Data Binding Wizard..." icon="/com/intellij/uiDesigner/icons/dataBindingWizard.png"/>
+      <separator/>
+      <reference ref="$Cut"/>
+      <reference ref="$Copy"/>
+      <reference ref="$Paste"/>
+      <separator/>
+      <action id="GuiDesigner.LayOutHorizontally" class="xcom.intellij.uiDesigner.actions.LayOutHorizontallyAction" text="Lay Out Horizontally" icon="/com/intellij/uiDesigner/icons/horizontal.png"/>
+      <action id="GuiDesigner.LayOutVertically" class="xcom.intellij.uiDesigner.actions.LayOutVerticallyAction" text="Lay Out Vertically" icon="/com/intellij/uiDesigner/icons/vertical.png"/>
+      <action id="GuiDesigner.LayOutInGrid" class="xcom.intellij.uiDesigner.actions.LayOutInAGridAction" text="Lay Out In a Grid" icon="/com/intellij/uiDesigner/icons/grid.png"/>
+      <action id="GuiDesigner.BreakLayout" class="xcom.intellij.uiDesigner.actions.BreakLayoutAction" text="Break Layout" icon="/com/intellij/uiDesigner/icons/break.png"/>
+      <separator/>
+      <reference ref="EditSource"/>
+      <action id="GuiDesigner.ExpandSelection" class="xcom.intellij.uiDesigner.actions.ExpandSelectionAction" text="Expand Selection" description="Expand selection structurally" />
+      <action id="GuiDesigner.ShrinkSelection" class="xcom.intellij.uiDesigner.actions.ShrinkSelectionAction" text="Shrink Selection" description="Shrink selection structurally" />
+      <separator/>
+      <reference ref="VersionControlsGroup"/>
+      <separator/>
+    </group>
+
+    <group id="GuiDesigner.ComponentTreePopupMenu">
+      <reference ref="EditSource"/>
+      <reference ref="GuiDesigner.ExpandSelection"/>
+      <reference ref="GuiDesigner.ShrinkSelection"/>
+      <separator/>
+      <reference ref="$Cut"/>
+      <reference ref="$Copy"/>
+      <reference ref="$Paste"/>
+    </group>
+
+    <group id="GuiDesigner.PropertyInspectorPopupMenu">
+      <action id="GuiDesigner.QuickJavadoc" class="xcom.intellij.uiDesigner.actions.ShowJavadocAction" text="_Quick JavaDoc" description="Show a popup window with JavaDoc for selected property"/>
+      <reference ref="EditSource"/>
+    </group>
+
+    <!-- ****************************************************************** -->
+
+    <group id="StructuralSearchActions">
+      <action id="StructuralSearchPlugin.StructuralSearchAction" class="xcom.intellij.structuralsearch.plugin.StructuralSearchAction" text="_Search Structurally..." description="Structural Search">
+        <add-to-group group-id="SearchMenu" anchor="last"/>
+      </action>
+
+      <action id="StructuralSearchPlugin.StructuralReplaceAction" class="xcom.intellij.structuralsearch.plugin.StructuralReplaceAction" text="Replace Str_ucturally..." description="Structural Replace">
+        <add-to-group group-id="SearchMenu" anchor="last"/>
+      </action>
+    </group>
+
+  </actions>
+</component>
diff --git a/xml/dom-tests/testData/stubs/converters.xml b/xml/dom-tests/testData/stubs/converters.xml
new file mode 100644
index 0000000..a5b0feb
--- /dev/null
+++ b/xml/dom-tests/testData/stubs/converters.xml
@@ -0,0 +1,3 @@
+<foo>
+  <bar string="xxx" int="666" class="java.lang.String"/>
+</foo>
\ No newline at end of file
diff --git a/xml/dom-tests/testData/stubs/extender.xml b/xml/dom-tests/testData/stubs/extender.xml
new file mode 100644
index 0000000..ecaa271
--- /dev/null
+++ b/xml/dom-tests/testData/stubs/extender.xml
@@ -0,0 +1,4 @@
+<foo>
+  <bar extend="xxx"></bar>
+  <bar></bar>
+</foo>
\ No newline at end of file
diff --git a/xml/dom-tests/testData/stubs/foo.xml b/xml/dom-tests/testData/stubs/foo.xml
new file mode 100644
index 0000000..4fb8f5b
--- /dev/null
+++ b/xml/dom-tests/testData/stubs/foo.xml
@@ -0,0 +1,4 @@
+<foo>
+  <bar string="xxx" int="666"></bar>
+  <bar></bar>
+</foo>
\ No newline at end of file
diff --git a/xml/dom-tests/testData/stubs/incompleteAttribute.xml b/xml/dom-tests/testData/stubs/incompleteAttribute.xml
new file mode 100644
index 0000000..4c0ea70
--- /dev/null
+++ b/xml/dom-tests/testData/stubs/incompleteAttribute.xml
@@ -0,0 +1,3 @@
+<foo>
+  <bar string></bar>
+</foo>
\ No newline at end of file
diff --git a/xml/dom-tests/testData/stubs/nullTag.xml b/xml/dom-tests/testData/stubs/nullTag.xml
new file mode 100644
index 0000000..21f7485
--- /dev/null
+++ b/xml/dom-tests/testData/stubs/nullTag.xml
@@ -0,0 +1,3 @@
+<!DOCTYPE beans PUBLIC "-//FOO" "http://foo.dtd">
+
+<foo
\ No newline at end of file
diff --git a/xml/dom-tests/testData/stubs/parent.xml b/xml/dom-tests/testData/stubs/parent.xml
new file mode 100644
index 0000000..1a9462e
--- /dev/null
+++ b/xml/dom-tests/testData/stubs/parent.xml
@@ -0,0 +1,5 @@
+<foo>
+  <bar notStubbed = "foo">
+    <notStubbed> </notStubbed>
+  </bar>
+</foo>
\ No newline at end of file
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DelimitedListProcessorTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DelimitedListProcessorTest.java
new file mode 100644
index 0000000..a206e43
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DelimitedListProcessorTest.java
@@ -0,0 +1,29 @@
+package com.intellij.util.xml;
+
+import com.intellij.util.xml.converters.DelimitedListProcessor;
+import junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class DelimitedListProcessorTest extends TestCase {
+
+  public void testProcessor() {
+    doTest("a; ; ", Arrays.asList("a", " ", " "));
+  }
+
+  private void doTest(final String text, final List<String> expected) {
+    final ArrayList<String> tokens = new ArrayList<String>();
+    new DelimitedListProcessor(";") {
+      @Override
+      protected void processToken(final int start, final int end, final boolean delimitersOnly) {
+        tokens.add(text.substring(start, end));
+      }
+    }.processText(text);
+    assertEquals(expected, tokens);
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomAnnotationsTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomAnnotationsTest.java
new file mode 100644
index 0000000..f6d8692
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomAnnotationsTest.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.codeInspection.InspectionManager;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.psi.PsiClass;
+import com.intellij.psi.PsiFileFactory;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.highlighting.*;
+
+import java.util.Arrays;
+
+/**
+ * @author peter
+ */
+public class DomAnnotationsTest extends DomTestCase{
+
+  @Override
+  protected <T extends DomElement> T createElement(final String xml, final Class<T> aClass) {
+    final String name = "a.xml";
+    final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText(name, StdFileTypes.XML, xml, 0,
+                                                                                                              true);
+    final XmlTag tag = file.getDocument().getRootTag();
+    final String rootTagName = tag != null ? tag.getName() : "root";
+    final T element = getDomManager().getFileElement(file, aClass, rootTagName).getRootElement();
+    assertNotNull(element);
+    assertSame(tag, element.getXmlTag());
+    return element;
+  }
+
+  public void testResolveProblemsAreReportedOnlyOnce() throws Throwable {
+    final MyElement myElement = createElement("<a><my-class>abc</my-class></a>", MyElement.class);
+    
+    new MockDomInspection(MyElement.class).checkFile(DomUtil.getFile(myElement), InspectionManager.getInstance(getProject()), true);
+    final DomElementsProblemsHolder holder = DomElementAnnotationsManager.getInstance(getProject()).getProblemHolder(myElement);
+
+    final DomElement element = myElement.getMyClass();
+    assertEquals(0, holder.getProblems(myElement).size());
+    assertEquals(0, holder.getProblems(myElement).size());
+    assertEquals(1, holder.getProblems(element).size());
+    assertEquals(1, holder.getProblems(element).size());
+    assertEquals(1, holder.getProblems(myElement, true, true).size());
+    assertEquals(1, holder.getProblems(myElement, true, true).size());
+  }
+
+  public void testMinSeverity() throws Throwable {
+    final MyElement element = createElement("<a/>", MyElement.class);
+    final DomElementsProblemsHolderImpl holder = new DomElementsProblemsHolderImpl(DomUtil.getFileElement(element));
+    final DomElementProblemDescriptorImpl error = new DomElementProblemDescriptorImpl(element, "abc", HighlightSeverity.ERROR);
+    final DomElementProblemDescriptorImpl warning = new DomElementProblemDescriptorImpl(element, "abc", HighlightSeverity.WARNING);
+    holder.addProblem(error, MockDomInspection.class);
+    holder.addProblem(warning, MockDomInspection.class);
+    assertEquals(Arrays.asList(error), holder.getProblems(element, true, true, HighlightSeverity.ERROR));
+    assertEquals(Arrays.asList(error, warning), holder.getProblems(element, true, true, HighlightSeverity.WARNING));
+  }
+
+  public interface MyElement extends DomElement{
+    GenericDomValue<PsiClass> getMyClass();
+  }
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomBasicsTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomBasicsTest.java
new file mode 100644
index 0000000..fb6829c7
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomBasicsTest.java
@@ -0,0 +1,606 @@
+package com.intellij.util.xml;
+
+import com.intellij.mock.MockModule;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.util.Factory;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.events.DomEvent;
+import com.intellij.util.xml.impl.*;
+import com.intellij.util.xml.reflect.DomAttributeChildDescription;
+import com.intellij.util.xml.reflect.DomCollectionChildDescription;
+import com.intellij.util.xml.reflect.DomFixedChildDescription;
+import com.intellij.util.xml.reflect.DomGenericInfo;
+
+import java.lang.reflect.ParameterizedType;
+import java.util.*;
+
+/**
+ * @author peter
+ */
+public class DomBasicsTest extends DomTestCase {
+  @Override
+  protected void invokeTestRunnable(final Runnable runnable) throws Exception {
+    new WriteCommandAction.Simple(null) {
+      @Override
+      protected void run() throws Throwable {
+        runnable.run();
+      }
+    }.execute().throwException();
+  }
+
+  public void testFileElementCaching() throws Throwable {
+    final XmlFile file = createXmlFile("<a/>");
+    final DomManagerImpl manager = getDomManager();
+    final DomFileElementImpl<DomElement> fileElement = manager.getFileElement(file, DomElement.class, "a");
+    assertEquals(fileElement, manager.getFileElement(file, DomElement.class, "a"));
+    assertCached(fileElement, file);
+
+    assertEquals(fileElement.getRootElement(), fileElement.getRootElement());
+  }
+
+  public void testElementCaching() throws Throwable {
+    final MyElement element = createElement("<a><child/></a>");
+    assertSame(element.getChild(), element.getChild());
+    assertSame(element.getXmlTag().getSubTags()[0], element.getChild().getXmlTag());
+    assertCached(element.getChild(), element.getChild().getXmlTag());
+  }
+
+  public void testGetParentAndRoot() throws Throwable {
+    final XmlFile file = createXmlFile("<a><foo/><child-element/><child-element/></a>");
+    final DomFileElementImpl<MyElement> fileElement = getDomManager().getFileElement(file, MyElement.class, "a");
+    assertNull(fileElement.getParent());
+    assertSame(fileElement, DomUtil.getFileElement(fileElement));
+
+    final MyElement rootElement = fileElement.getRootElement();
+    assertSame(fileElement, rootElement.getParent());
+    assertSame(fileElement, DomUtil.getFileElement(rootElement));
+
+    assertParent(rootElement.getFoo(), rootElement);
+    assertParent(rootElement.getChildElements().get(0), rootElement);
+    assertParent(rootElement.getChildElements().get(1), rootElement);
+  }
+
+  private static void assertParent(final DomElement element, final DomElement parent) {
+    assertEquals(parent, element.getParent());
+  }
+
+  public void testEnsureTagExists() throws Throwable {
+    final MyElement element = createElement("<a/>");
+    myCallRegistry.clear();
+    final MyElement child = element.getChild();
+    assertNull(child.getXmlTag());
+
+    child.ensureTagExists();
+    final XmlTag[] subTags = element.getXmlTag().getSubTags();
+    assertEquals(1, subTags.length);
+    final XmlTag childTag = subTags[0];
+    assertEquals("child", childTag.getName());
+    assertCached(child, childTag);
+    assertSame(child.getXmlTag(), childTag);
+
+    final DomElement element1 = child;
+    myCallRegistry.putExpected(new DomEvent(element1, true));
+    myCallRegistry.assertResultsAndClear();
+
+    final MyElement childElement = element.addChildElement();
+    final XmlTag childElementTag = childElement.getXmlTag();
+    assertSame(childElementTag, childElement.ensureTagExists());
+  }
+
+  public void testEnsureRootTagExists() throws Throwable {
+    final MyElement rootElement = createEmptyElement();
+    myCallRegistry.clear();
+    assertNull(rootElement.getXmlTag());
+    rootElement.ensureTagExists();
+    final DomElement element = rootElement;
+    myCallRegistry.putExpected(new DomEvent(element, true));
+
+    assertCached(rootElement, assertRootTag(rootElement));
+    myCallRegistry.assertResultsAndClear();
+  }
+
+  private XmlTag assertRootTag(final DomElement rootElement) {
+    return assertRootTag(DomUtil.getFile(rootElement));
+  }
+
+  private static XmlTag assertRootTag(final XmlFile file) {
+    final XmlTag rootTag = file.getDocument().getRootTag();
+    assertNotNull(rootTag);
+    assertEquals("root", rootTag.getName());
+    return rootTag;
+  }
+
+  protected MyElement createEmptyElement() throws IncorrectOperationException {
+    final XmlFile file = createXmlFile("");
+    return getDomManager().getFileElement(file, MyElement.class, "root").getRootElement();
+  }
+
+  public void testFile() throws Throwable {
+    final XmlFile file = createXmlFile("<a>foo</a>");
+    DomFileElementImpl<MyElement> fileElement = getDomManager().getFileElement(file, MyElement.class, "a");
+    final MyElement rootElement = fileElement.getRootElement();
+    assertNotNull(rootElement);
+    assertEquals("foo", rootElement.getValue());
+  }
+
+  public void testAcceptChidren() throws Throwable {
+    final MyElement element = createElement("<a><child-element/><child/><child-element/></a>");
+    final Set<DomElement> visited = new HashSet<DomElement>();
+    element.acceptChildren(new DomElementVisitor() {
+      @Override
+      public void visitDomElement(DomElement element) {
+        visited.add(element);
+      }
+    });
+    final MyElement foo = element.getFoo();
+    final MyElement child = element.getChild();
+    final MyElement child1 = element.getChildElements().get(0);
+    final MyElement child2 = element.getChildElements().get(1);
+    final GenericDomValue<Boolean> genericValue = element.getGenericValue();
+    assertSameElements(visited, foo, child, child1, child2, genericValue, element.getAttr());
+  }
+
+  public void testChildrenReflection() throws Throwable {
+    final MyElement element =
+      createElement("<a><child/><child-element/><child-element/></a>");
+    final DomGenericInfo info = element.getGenericInfo();
+
+    final DomFixedChildDescription foo = info.getFixedChildDescription("foo");
+    assertFixedChildDescription(foo, element.getFoo(), "foo");
+
+    final DomFixedChildDescription child = info.getFixedChildDescription("child");
+    assertFixedChildDescription(child, element.getChild(), "child");
+
+    final DomFixedChildDescription genericChild = info.getFixedChildDescription("generic-value");
+    assertGenericChildDescription(genericChild, element.getGenericValue(), "generic-value");
+
+    final DomCollectionChildDescription collectionChild = info.getCollectionChildDescription("child-element");
+    assertEquals(element.getChildElements(), collectionChild.getValues(element));
+    assertEquals("child-element", collectionChild.getXmlElementName());
+    assertEquals(MyElement.class, collectionChild.getType());
+    assertEquals(MyElement.class.getMethod("getChildElements"), collectionChild.getGetterMethod().getMethod());
+
+    assertEquals(new HashSet(Arrays.asList(foo, child, collectionChild, genericChild,
+                                           info.getAttributeChildrenDescriptions().get(0))),
+                 new HashSet(info.getChildrenDescriptions()));
+  }
+
+  private void assertFixedChildDescription(final DomFixedChildDescription description,
+                                           final DomElement child,
+                                           final String tagName) throws NoSuchMethodException {
+    assertEquals(1, description.getCount());
+    assertEquals(Arrays.asList(child), description.getValues(child.getParent()));
+    assertEquals(tagName, description.getXmlElementName());
+    assertEquals(MyElement.class, description.getType());
+    assertEquals(JavaMethod.getMethod(MyElement.class, new JavaMethodSignature("get" + StringUtil.capitalize(tagName))), description.getGetterMethod(0));
+  }
+
+  private static void assertGenericChildDescription(final DomFixedChildDescription description,
+                                             final DomElement child,
+                                             final String tagName) throws NoSuchMethodException {
+    assertEquals(1, description.getCount());
+    assertEquals(Arrays.asList(child), description.getValues(child.getParent()));
+    assertEquals(tagName, description.getXmlElementName());
+    assertEquals(GenericDomValue.class, ((ParameterizedType)description.getType()).getRawType());
+    assertEquals(JavaMethod.getMethod(MyElement.class, new JavaMethodSignature("getGenericValue")), description.getGetterMethod(0));
+  }
+
+  public void testGetDomElementType() throws Throwable {
+    final MyElement element = createElement("<a/>");
+    assertEquals(MyElement.class.getMethod("getGenericValue").getGenericReturnType(), element.getGenericValue().getDomElementType());
+  }
+
+  public void testAddChildrenByReflection() throws Throwable {
+    final MyElement element =
+      createElement("<a><child-element/></a>");
+    final DomGenericInfo info = element.getGenericInfo();
+    final DomCollectionChildDescription collectionChild = info.getCollectionChildDescription("child-element");
+    final List<? extends DomElement> values = collectionChild.getValues(element);
+
+    MyElement newChild = (MyElement) collectionChild.addValue(element);
+    List<DomElement> newChildren = Arrays.asList(values.get(0), newChild);
+    assertEquals(newChildren, element.getChildElements());
+    assertEquals(newChildren, collectionChild.getValues(element));
+
+    MyElement lastChild = (MyElement) collectionChild.addValue(element, 0);
+    newChildren = Arrays.asList(lastChild, values.get(0), newChild);
+    assertEquals(newChildren, element.getChildElements());
+    assertEquals(newChildren, collectionChild.getValues(element));
+  }
+
+  public void testGetPresentableName() throws Throwable {
+    assertCollectionPresentableName("Aaas", "aaa", DomNameStrategy.HYPHEN_STRATEGY);
+    assertCollectionPresentableName("Aaa Bbbs", "aaa-bbb", DomNameStrategy.HYPHEN_STRATEGY);
+
+    assertCollectionPresentableName("Aaas", "aaa", DomNameStrategy.JAVA_STRATEGY);
+    assertCollectionPresentableName("Aaa Children", "aaaChild", DomNameStrategy.JAVA_STRATEGY);
+
+    assertFixedPresentableName("Aaa Bbbs", "aaa-bbbs", DomNameStrategy.HYPHEN_STRATEGY);
+    assertFixedPresentableName("Aaa Child", "aaaChild", DomNameStrategy.JAVA_STRATEGY);
+  }
+
+  private void assertCollectionPresentableName(final String expected, final String tagName, final DomNameStrategy strategy) {
+    assertEquals(expected, new CollectionChildDescriptionImpl(new XmlName(tagName), DomElement.class, null).getCommonPresentableName(strategy));
+  }
+
+  private void assertFixedPresentableName(final String expected, final String tagName, final DomNameStrategy strategy) {
+    assertEquals(expected, new FixedChildDescriptionImpl(new XmlName(tagName), DomElement.class, 0, new Collection[0]).getCommonPresentableName(strategy));
+  }
+
+  public void testNameStrategy() throws Throwable {
+    assertTrue(createElement("<a/>").getNameStrategy() instanceof HyphenNameStrategy);
+
+    final AnotherElement anotherElement = createElement("<a/>", AnotherElement.class);
+    assertTrue(anotherElement.getNameStrategy() instanceof JavaNameStrategy);
+    assertTrue(anotherElement.getChild().getNameStrategy() instanceof JavaNameStrategy);
+  }
+
+  public void testModificationCount() throws Throwable {
+    final MyElement element = createElement("<a/>");
+    final long count = DomUtil.getFileElement(element).getModificationCount();
+    element.addChildElement();
+    assertTrue(DomUtil.getFileElement(element).getModificationCount() > count);
+  }
+
+  public void testIsTagValueElement() throws Throwable {
+    assertTrue(getDomManager().getGenericInfo(MyElement.class).isTagValueElement());
+    assertFalse(getDomManager().getGenericInfo(AnotherElement.class).isTagValueElement());
+  }
+
+  public void testAttributeChildrenGenerics() throws Throwable {
+    final StaticGenericInfo genericInfo = DomApplicationComponent.getInstance().getStaticGenericInfo(MyElement.class);
+    final List<? extends DomAttributeChildDescription> descriptions = genericInfo.getAttributeChildrenDescriptions();
+    assertEquals(1, descriptions.size());
+    final DomAttributeChildDescription description = descriptions.get(0);
+
+    final MyElement element = createElement("");
+    assertEquals(element.getAttr(), description.getValues(element).get(0));
+    assertEquals(element.getAttr(), description.getDomAttributeValue(element));
+  }
+
+  private MyElement createElement(final String xml) throws IncorrectOperationException {
+    return createElement(xml, MyElement.class);
+  }
+
+  public void testSubPropertyAccessing() throws Throwable {
+    final MyElement element = createElement("");
+    final GenericAttributeValue<String> attr = element.getChild().getChild().getAttr();
+    assertNotNull(attr);
+    assertEquals(element.getChildChildAttr(), attr);
+
+    final GenericAttributeValue<String> attr1 = element.getChild().addChildElement().getAttr();
+    final GenericAttributeValue<String> attr2 = element.getChild().addChildElement().getAttr();
+    assertOrderedEquals(element.getChildChildrenAttr(), attr1, attr2);
+  }
+
+  public void testInstanceImplementation() throws Throwable {
+    MyElement element = createElement("");
+    final Object o = new Object();
+    element.setObject(o);
+    assertSame(o, element.getObject());
+
+    element = createElement("", InheritedElement.class);
+    element.setObject(o);
+    assertSame(o, element.getObject());
+    assertSame(o, element.getObject());
+  }
+
+  public void testSeveralInstanceImplementations() throws Throwable {
+    InheritedElement element = createElement("", InheritedElement.class);
+    final Object o = new Object();
+    element.setObject(o);
+    assertSame(o, element.getObject());
+    assertSame(o, element._getObject());
+    element.setString("foo");
+    assertEquals("foo", element.getString());
+  }
+
+  public void testVisitor() throws Throwable {
+    final Integer[] visits = new Integer[]{0, 0, 0};
+    DomElementVisitor visitor = new MyVisitor() {
+      @Override
+      public void visit(InheritedElement element) {
+        visits[0]++;
+      }
+
+      @Override
+      public void visitDomElement(DomElement element) {
+        visits[1]++;
+      }
+
+      @Override
+      public void visitMyElement(MyElement element) {
+        visits[2]++;
+      }
+    };
+
+    createElement("", MyElement.class).accept(visitor);
+    final List<Integer> visitsList = Arrays.asList(visits);
+    assertEquals(Arrays.asList(0, 0, 1), visitsList);
+
+    createElement("", InheritedElement.class).accept(visitor);
+    assertEquals(Arrays.asList(1, 0, 1), visitsList);
+
+    createElement("", AnotherElement.class).accept(visitor);
+    assertEquals(Arrays.asList(1, 1, 1), visitsList);
+
+    createElement("", DomElement.class).accept(visitor);
+    assertEquals(Arrays.asList(1, 2, 1), visitsList);
+    
+    createElement("", InheritedElement.class).accept(new DomElementVisitor() {
+      @Override
+      public void visitDomElement(DomElement element) {
+        visits[1]++;
+      }
+    });
+    assertEquals(Arrays.asList(1, 3, 1), visitsList);
+  }
+
+  public void testRegisteringImplementation() throws Throwable {
+    DomApplicationComponent.getInstance().registerImplementation(AnotherElement.class, EmptyImpl.class, getTestRootDisposable());
+    DomApplicationComponent.getInstance().registerImplementation(DomElement.class, BaseImpl.class, getTestRootDisposable());
+    final AnotherElement element = createElement("", AnotherElement.class);
+    assertTrue(element.getClass().getSuperclass().getName(), element instanceof EmptyImpl);
+  }
+
+  public void testMockElements() throws Throwable {
+    Module module = new MockModule(getTestRootDisposable());
+    final MyElement element = getDomManager().createMockElement(MyElement.class, module, false);
+    assertSame(module, element.getModule());
+    assertTrue(element.isValid());
+    assertNull(element.getXmlTag());
+    assertEquals(element, DomUtil.getFileElement(element).getRootElement());
+    assertFalse(DomUtil.getFile(element).isPhysical());
+
+    final MyElement element2 = getDomManager().createMockElement(MyElement.class, null, false);
+    assertNull(element2.getModule());
+    assertNull(element2.getXmlTag());
+    element2.addChildElement().getGenericValue().setStringValue("xxx");
+    assertNotNull(element2.getXmlTag());
+    final MyElement oldChild = element2.getChild();
+
+    element.getAttr().setValue("attr");
+    element.getGenericValue().setValue(Boolean.TRUE);
+    element.getChild().getGenericValue().setStringValue("abc");
+    element.addChildElement().getGenericValue().setStringValue("def");
+
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        element2.copyFrom(element);
+      }
+    }.execute();
+    assertEquals("attr", element2.getAttr().getValue());
+    assertEquals("true", element2.getGenericValue().getStringValue());
+
+    final MyElement newChild = element2.getChild();
+    assertEquals("abc", newChild.getGenericValue().getStringValue());
+
+    final List<MyElement> childElements = element2.getChildElements();
+    assertEquals(1, childElements.size());
+    assertEquals("def", childElements.get(0).getGenericValue().getStringValue());
+  }
+
+  public void testCopyingFromEmptyToEmpty() throws Throwable {
+    Module module = new MockModule(getTestRootDisposable());
+    MyElement element1 = getDomManager().createMockElement(MyElement.class, module, false);
+    MyElement element2 = getDomManager().createMockElement(MyElement.class, module, false);
+    element2.copyFrom(element1);
+    assertNull(element2.getXmlTag());
+  }
+
+  public void testCopyingFromNonEmptyToEmpty() throws Throwable {
+    Module module = new MockModule(getTestRootDisposable());
+    final MyElement element1 = getDomManager().createMockElement(MyElement.class, module, false);
+    final MyElement element2 = getDomManager().createMockElement(MyElement.class, module, false);
+    element2.ensureTagExists();
+    assertNull(element2.getChild().getChild().getGenericValue().getStringValue());
+    element1.getChild().getChild().getGenericValue().setStringValue("abc");
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        element2.copyFrom(element1);
+      }
+    }.execute();
+    assertEquals("abc", element2.getChild().getChild().getGenericValue().getStringValue());
+  }
+
+  public void testStableValues() throws Throwable {
+    final MyElement[] element = new MyElement[]{null};
+    final MyElement stable = getDomManager().createStableValue(new Factory<MyElement>() {
+      @Override
+      public MyElement create() {
+        try {
+          return element[0] = createElement("<root/>").addChildElement();
+        }
+        catch (IncorrectOperationException e) {
+          throw new RuntimeException(e);
+        }
+      }
+    });
+    assertNotNull(element[0]);
+    assertSame(element[0], ((StableElement)stable).getWrappedElement());
+    assertEquals(element[0], stable);
+    assertEquals(stable, element[0]);
+    MyElement oldElement = element[0];
+    assertFalse(stable.getChild().equals(stable));
+    final GenericDomValue<Boolean> oldGenericValue = stable.getGenericValue();
+    assertEquals(oldGenericValue, oldElement.getGenericValue());
+    assertEquals(stable.getChild(), oldElement.getChild());
+    assertSame(element[0], oldElement);
+    final MyElement child1 = stable.addChildElement();
+    final MyElement child2 = stable.addChildElement();
+
+    MyElement oldChild1 = oldElement.getChildElements().get(0);
+    assertEquals(oldChild1, child1);
+    assertEquals(child1, oldChild1);
+    final MyElement oldElement1 = oldElement;
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        oldElement1.undefine();
+      }
+    }.execute();
+    assertFalse(oldChild1.isValid());
+
+    assertFalse(oldElement.isValid());
+    assertFalse(element[0].isValid());
+    assertTrue(stable.isValid());
+    assertTrue(element[0].isValid());
+    assertNotSame(element[0], oldElement);
+
+    assertFalse(child1.isValid());
+    assertFalse(child2.isValid());
+    assertEquals(DomUtil.getFileElement(element[0]), DomUtil.getFileElement(stable));
+    assertEquals(element[0].getParent(), stable.getParent());
+
+    oldElement = element[0];
+    oldChild1 = oldElement.getChild();
+    ((StableElement)stable).invalidate();
+    assertTrue(oldElement.isValid());
+    assertTrue(oldChild1.isValid());
+    assertFalse(oldElement.equals(((StableElement)stable).getWrappedElement()));
+  }
+
+  public void testStable_Revalidate() throws Throwable {
+    final MyElement[] element = new MyElement[]{createElement("")};
+    final MyElement stable = getDomManager().createStableValue(new Factory<MyElement>() {
+      @Override
+      public MyElement create() {
+        return element[0];
+      }
+    });
+    MyElement oldElement = element[0];
+    ((StableElement) stable).revalidate();
+    assertSame(oldElement, ((StableElement) stable).getWrappedElement());
+    
+    element[0] = createElement("");
+    assertTrue(oldElement.isValid());
+    ((StableElement) stable).revalidate();
+    assertTrue(oldElement.isValid());
+    assertNotSame(oldElement, ((StableElement) stable).getWrappedElement());
+    assertSame(element[0], ((StableElement) stable).getWrappedElement());
+  }
+
+  public void testStable_Invalidate() throws Throwable {
+    final MyElement oldElement = createElement("");
+    final MyElement[] element = new MyElement[]{oldElement};
+    final MyElement stable = getDomManager().createStableValue(new Factory<MyElement>() {
+      @Override
+      public MyElement create() {
+        return element[0];
+      }
+    });
+    element[0] = null;
+    ((StableElement) stable).invalidate();
+    assertTrue(stable.equals(stable));
+    assertEquals(oldElement.toString(), stable.toString());
+  }
+
+  public void testStableCopies() throws Throwable {
+    final MyElement element = createElement("<a><child-element/><child-element><child/></child-element></a>");
+    final MyElement parent = element.getChildElements().get(1);
+    final MyElement child = parent.getChild();
+    final MyElement copy = (MyElement) child.createStableCopy();
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        parent.undefine();
+        element.addChildElement().getChild().ensureXmlElementExists();
+      }
+    }.execute();
+    assertFalse(child.isValid());
+    assertTrue(copy.isValid());
+  }
+
+  @Implementation(Impl.class)
+  public interface MyElement extends DomElement {
+    GenericAttributeValue<String> getAttr();
+
+    String getValue();
+
+    MyElement getFoo();
+
+    MyElement getChild();
+    MyElement addChildElement();
+    @SuppressWarnings({"UnusedDeclaration"})
+    MyElement addChildElement(int index);
+
+    List<MyElement> getChildElements();
+
+    GenericDomValue<Boolean> getGenericValue();
+
+    Object getObject();
+
+    void setObject(Object o);
+
+    @PropertyAccessor({"child", "child", "attr"})
+    GenericAttributeValue<String> getChildChildAttr();
+
+    @PropertyAccessor({"child", "childElements", "attr"})
+    List<GenericAttributeValue<String>> getChildChildrenAttr();
+
+  }
+
+  public static abstract class Impl implements MyElement {
+    private Object myObject;
+
+    public Object _getObject() {
+      return myObject;
+    }
+
+    @Override
+    public Object getObject() {
+      return myObject;
+    }
+
+    @Override
+    public void setObject(final Object object) {
+      myObject = object;
+    }
+
+  }
+
+  public static abstract class AnotherImpl extends Impl implements InheritedElement{
+    private String myString;
+
+    @Override
+    public String getString() {
+      return myString;
+    }
+
+    @Override
+    public void setString(final String string) {
+      myString = string;
+    }
+  }
+
+  @NameStrategy(JavaNameStrategy.class)
+  public interface AnotherElement extends DomElement {
+    DomElement getChild();
+  }
+
+  public static abstract class BaseImpl implements DomElement{}
+
+  public static abstract class EmptyImpl extends BaseImpl implements AnotherElement{}
+
+  @Implementation(AnotherImpl.class)
+  public interface InheritedElement extends MyElement, DomElement {
+    String getString();
+
+    void setString(final String string);
+
+    Object _getObject();
+  }
+
+  public interface MyVisitor extends DomElementVisitor{
+    void visitMyElement(MyElement element);
+    void visit(InheritedElement element);
+  }
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomChildrenTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomChildrenTest.java
new file mode 100644
index 0000000..169c66b
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomChildrenTest.java
@@ -0,0 +1,614 @@
+package com.intellij.util.xml;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.Consumer;
+import com.intellij.util.Function;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.events.DomEvent;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class DomChildrenTest extends DomTestCase {
+
+  private MyElement createElement(final String xml) throws IncorrectOperationException {
+    return createElement(xml, MyElement.class);
+  }
+
+  public void testGetChild() throws Throwable {
+    final MyElement element = createElement("<a>" + "<child>foo</child>" + "</a>");
+    element.toString();
+    assertEquals("foo", element.getMyChild().getValue());
+    assertEquals("foo", element.getChild().getValue());
+    assertSame(element.getChild(), element.getMyChild());
+    assertNull(element.getChild239().getXmlTag());
+  }
+
+  public void testGetChild239() throws Throwable {
+    final MyElement element = createElement("<a><child/><child-239/></a>");
+    assertNotNull(element.getChild239().getXmlTag());
+  }
+
+  public void testGetChildren() throws Throwable {
+    final MyElement element = createElement("<a>" + "<child-element>foo</child-element>" + "<child-element>bar</child-element>" + "</a>");
+    assertSubBars(element.getMyChildren());
+    assertSubBars(element.getChildElements());
+    assertSubBars(element.getMyChildren2());
+  }
+
+  public void testGetChildrenMultipleTimes() throws Throwable {
+    final MyElement element = createElement("<a>" + "<child-element>" + " <child-element/>" + "</child-element>" + "</a>");
+    for (int i = 0; i < 239; i++) {
+      final List<MyElement> children = element.getChildElements();
+      final MyElement child = children.get(0);
+      final List<MyElement> children1 = child.getChildElements();
+      final MyElement child1 = children1.get(0);
+      assertNotNull(child1.getChild());
+    }
+  }
+
+  private void assertSubBars(final List<? extends MyElement> subBars) {
+    assertEquals(2, subBars.size());
+    assertEquals("foo", subBars.get(0).getValue());
+    assertEquals("bar", subBars.get(1).getValue());
+  }
+
+  public void testClassChoosers() throws Throwable {
+    getTypeChooserManager().registerTypeChooser(MyAbstractElement.class, new MyTypeChooser());
+    try {
+      MyElement element = createElement("<a>" +
+                                        "<abstract-child>Foo</abstract-child>" +
+                                        "<abstract-element>Foo</abstract-element>" +
+                                        "<abstract-element>bar</abstract-element>" + "</a>");
+      assertFalse(element.getAbstractChild()instanceof MyBarConcreteElement);
+      final List<MyAbstractElement> abstractElements = element.getAbstractElements();
+      assertTrue(abstractElements.get(0)instanceof MyFooConcreteElement);
+      assertTrue(abstractElements.get(1)instanceof MyBarConcreteElement);
+    }
+    finally {
+      getTypeChooserManager().unregisterTypeChooser(MyAbstractElement.class);
+    }
+  }
+
+  public void testAddConcreteElements() throws Throwable {
+    getTypeChooserManager().registerTypeChooser(MyAbstractElement.class, new MyTypeChooser());
+    try {
+      MyElement element = createElement("<a/>");
+      element.addBarChild();
+      element.addFooChild();
+      element.addAbstractElement(MyFooConcreteElement.class);
+      element.addAbstractElement(MyFooConcreteElement.class, 1);
+      element.addAbstractElement(2, MyBarConcreteElement.class);
+      Class[] classes = new Class[]{MyBarConcreteElement.class, MyFooConcreteElement.class, MyBarConcreteElement.class,
+        MyFooConcreteElement.class, MyFooConcreteElement.class};
+      final List<MyAbstractElement> abstractElements = element.getAbstractElements();
+      for (int i = 0; i < abstractElements.size(); i++) {
+        MyAbstractElement abstractElement = abstractElements.get(i);
+        assertTrue(String.valueOf(i) + " " + abstractElement.getClass(), classes[i].isInstance(abstractElement));
+        assertEquals(String.valueOf(i), classes[i].getName(), abstractElement.getXmlTag().getAttributeValue("foo"));
+      }
+    }
+    finally {
+      getTypeChooserManager().unregisterTypeChooser(MyAbstractElement.class);
+    }
+  }
+
+  public void testIndexedChild() throws Throwable {
+    MyElement element = createElement("<a>" + "<child>foo</child>" + "<child>bar</child>" + "</a>");
+    assertCached(element.getChild2(), element.getXmlTag().getSubTags()[1]);
+    assertEquals(0, element.getChildElements().size());
+  }
+
+  public void testDefiningIndexedChild() throws Throwable {
+    final MyElement element = createElement("<a/>");
+    final XmlTag tag = element.getChild2().ensureTagExists();
+    final XmlTag[] subTags = element.getXmlTag().findSubTags("child");
+    assertEquals(2, subTags.length);
+    assertSame(tag, subTags[1]);
+
+    assertCached(element.getChild(), subTags[0]);
+    final DomElement element1 = element.getChild();
+    putExpected(new DomEvent(element1, true));
+    final DomElement element2 = element.getChild().getAttr();
+    putExpected(new DomEvent(element2, true));
+    final DomElement element3 = element.getChild().isGenericValue();
+    putExpected(new DomEvent(element3, true));
+    final DomElement element4 = element.getChild2();
+    putExpected(new DomEvent(element4, true));
+    final DomElement element5 = element.getChild2().getAttr();
+    putExpected(new DomEvent(element5, true));
+    final DomElement element6 = element.getChild2().isGenericValue();
+    putExpected(new DomEvent(element6, true));
+    assertResultsAndClear();
+  }
+
+  public void testAddChild() throws Throwable {
+    final MyElement element = createElement("<a><child-element/></a>");
+    assertEquals(1, element.getChildElements().size());
+    final MyElement firstChild = element.getChildElements().get(0);
+    final XmlTag firstChildTag = element.getXmlTag().findSubTags("child-element")[0];
+    assertCached(firstChild, firstChildTag);
+
+    final MyElement child = element.addChildElement();
+    assertEquals(Arrays.asList(firstChild, child), element.getChildElements());
+    final XmlTag childTag = element.getXmlTag().findSubTags("child-element")[1];
+    putExpected(new DomEvent(element, false));
+    final DomElement element1 = child.getAttr();
+    putExpected(new DomEvent(element1, true));
+    final DomElement element2 = child.isGenericValue();
+    putExpected(new DomEvent(element2, true));
+
+    final MyElement newChild = element.addChildElement(1);
+    assertEquals(Arrays.asList(firstChild, newChild, child), element.getChildElements());
+    final XmlTag newChildTag = element.getXmlTag().findSubTags("child-element")[1];
+    putExpected(new DomEvent(element, false));
+    final DomElement element3 = newChild.getAttr();
+    putExpected(new DomEvent(element3, true));
+    final DomElement element4 = newChild.isGenericValue();
+    putExpected(new DomEvent(element4, true));
+
+    final MyElement lastChild = element.addChildElement(239);
+    assertEquals(Arrays.asList(firstChild, newChild, child, lastChild), element.getChildElements());
+    final XmlTag lastChildTag = element.getXmlTag().findSubTags("child-element")[3];
+    putExpected(new DomEvent(element, false));
+    final DomElement element5 = lastChild.getAttr();
+    putExpected(new DomEvent(element5, true));
+    final DomElement element6 = lastChild.isGenericValue();
+    putExpected(new DomEvent(element6, true));
+    assertResultsAndClear();
+
+    assertCached(firstChild, firstChildTag);
+    assertCached(newChild, newChildTag);
+    assertCached(child, childTag);
+    assertCached(lastChild, lastChildTag);
+
+    assertSame(firstChildTag, element.getXmlTag().findSubTags("child-element")[0]);
+    assertSame(newChildTag, element.getXmlTag().findSubTags("child-element")[1]);
+    assertSame(childTag, element.getXmlTag().findSubTags("child-element")[2]);
+    assertSame(lastChildTag, element.getXmlTag().findSubTags("child-element")[3]);
+  }
+
+  public void testUndefineCollectionChild() throws Throwable {
+    final MyElement element = createElement("<a><child-element/><child-element/><child-element/></a>");
+    final MyElement child1 = element.getChildElements().get(0);
+    final MyElement child2 = element.getChildElements().get(1);
+    final MyElement child3 = element.getChildElements().get(2);
+
+    final List<XmlTag> oldChildren = new ArrayList<XmlTag>(Arrays.asList(element.getXmlTag().getSubTags()));
+
+    assertTrue(child2.isValid());
+    assertEquals(element, child2.getParent());
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        child2.undefine();
+        assertFalse(child2.isValid());
+
+        oldChildren.remove(1);
+        assertEquals(oldChildren, Arrays.asList(element.getXmlTag().getSubTags()));
+
+        assertEquals(Arrays.asList(child1, child3), element.getChildElements());
+        assertCached(child1, element.getXmlTag().findSubTags("child-element")[0]);
+        assertCached(child3, element.getXmlTag().findSubTags("child-element")[1]);
+      }
+    });
+
+
+    myCallRegistry.putExpected(new DomEvent(element, false));
+    myCallRegistry.assertResultsAndClear();
+  }
+
+  public void testUndefineFixedChild() throws Throwable {
+    new WriteCommandAction.Simple(getProject()) {
+      @Override
+      protected void run() throws Throwable {
+        final MyElement child = createElement("<a><child/></a>").getChild();
+
+        incModCount();
+        child.ensureTagExists();
+        assertTrue(child.isValid());
+        assertNotNull(child.getXmlElement());
+
+        incModCount();
+        child.undefine();
+        assertTrue(child.isValid());
+        assertNull(child.getXmlElement());
+
+        child.ensureTagExists();
+        incModCount();
+        assertTrue(child.isValid());
+        assertNotNull(child.getXmlElement());
+      }
+    }.execute().throwException();
+  }
+
+  public void testAttributes() throws Throwable {
+    final MyElement element = createElement("<a/>");
+    final GenericAttributeValue<String> attr = element.getAttr();
+    assertSame(element.getXmlTag(), attr.getXmlTag());
+    assertNull(attr.getValue());
+    assertNull(attr.getXmlAttribute());
+
+    assertEquals(attr, element.getAttr());
+    attr.setValue("239");
+    assertEquals("239", attr.getValue());
+    final XmlAttribute attribute = element.getXmlTag().getAttribute("attr", null);
+    assertSame(attribute, attr.getXmlAttribute());
+    assertSame(attribute, attr.getXmlElement());
+    assertSame(attribute, attr.ensureXmlElementExists());
+    assertSame(attribute.getValueElement(), attr.getXmlAttributeValue());
+
+    attr.setValue(null);
+    assertFalse(attribute.isValid());
+    assertNull(element.getXmlTag().getAttributeValue("attr"));
+    assertNull(attr.getValue());
+    assertNull(attr.getXmlAttribute());
+  }
+
+  public void testUndefineLastFixedChildWithNotEmptyCollection() throws Throwable {
+    new WriteCommandAction.Simple(getProject()) {
+      @Override
+      protected void run() throws Throwable {
+        final MyElement element = createElement("<a>" + "<child>1</child>" + "<child attr=\"\">2</child>" + "<child/></a>");
+        final MyElement child = element.getChild();
+        final MyElement child2 = element.getChild2();
+
+        assertEquals("", child2.getAttr().getValue());
+        assertTrue(child.isValid());
+        assertTrue(child2.isValid());
+        child.undefine();
+
+        assertTrue(child.isValid());
+        assertTrue(child2.isValid());
+        assertTrue(child2.equals(element.getChild2()));
+        assertNotNull(child.getXmlTag());
+
+        child2.undefine();
+
+        assertTrue(child.isValid());
+        assertTrue(child2.isValid());
+        assertTrue(child2.equals(element.getChild2()));
+        assertEquals(child, element.getChild());
+        assertEquals("", child.getValue());
+        assertNull(element.getChild2().getValue());
+
+        myCallRegistry.putExpected(new DomEvent(child, false));
+        myCallRegistry.putExpected(new DomEvent(child2, false));
+        myCallRegistry.assertResultsAndClear();
+      }
+    }.execute().throwException();
+  }
+
+  public void testUndefineNotLastFixedChild() throws Throwable {
+    new WriteCommandAction.Simple(getProject()) {
+      @Override
+      protected void run() throws Throwable {
+        final MyElement element = createElement("<a>" + "<child>1</child>" + "<child attr=\"\">2</child>" + "</a>");
+        final MyElement child = element.getChild();
+        final MyElement child2 = element.getChild2();
+
+        assertTrue(child.isValid());
+        assertTrue(child2.isValid());
+        child.undefine();
+        assertTrue(child.isValid());
+        assertTrue(child2.isValid());
+        assertEquals(element, child.getParent());
+        assertEquals(element, child2.getParent());
+        assertEquals(child, element.getChild());
+        assertEquals(child2, element.getChild2());
+
+        myCallRegistry.putExpected(new DomEvent(child, false));
+        myCallRegistry.assertResultsAndClear();
+
+        XmlTag[] subTags = element.getXmlTag().getSubTags();
+        assertEquals(2, subTags.length);
+        assertCached(child, subTags[0]);
+        assertCached(child2, subTags[1]);
+      }
+    }.execute().throwException();
+  }
+
+  public void testUndefineLastFixedChild() throws Throwable {
+    new WriteCommandAction.Simple(getProject()) {
+      @Override
+      protected void run() throws Throwable {
+        final MyElement element =
+          createElement("<a>" + "<child>1</child>" + "<child attr=\"\">2</child>" + "<child attr=\"\">2</child>" + "</a>");
+        final MyElement child = element.getChild();
+        final MyElement child2 = element.getChild2();
+        child2.undefine();
+
+        myCallRegistry.putExpected(new DomEvent(child2, false));
+        myCallRegistry.assertResultsAndClear();
+
+        XmlTag[] subTags = element.getXmlTag().getSubTags();
+        assertTrue(child.isValid());
+        assertTrue(child2.isValid());
+        assertEquals(1, subTags.length);
+        assertNull(child2.getXmlTag());
+
+        assertEquals(element, child.getParent());
+        assertEquals(element, child2.getParent());
+      }
+    }.execute().throwException();
+  }
+
+  public void testUndefineFixedChildWithNoTag() throws Throwable {
+    new WriteCommandAction.Simple(getProject()) {
+      @Override
+      protected void run() throws Throwable {
+        final MyElement element = createElement("<a/>");
+        final MyElement child = element.getChild();
+        child.undefine();
+
+        myCallRegistry.assertResultsAndClear();
+        assertTrue(child.isValid());
+        assertEquals(0, element.getXmlTag().getSubTags().length);
+
+        assertSame(element, child.getParent());
+      }
+    }.execute().throwException();
+  }
+
+  public void testGenericValuesCollection() throws Throwable {
+    final MyElement element = createElement("<a><generic-child>239</generic-child></a>");
+    assertEquals(239, (int)element.getGenericChildren().get(0).getValue());
+  }
+
+  public void testIsBooleanGenericValueMethod() throws Throwable {
+    assertNull(createElement("").isGenericValue().getValue());
+  }
+
+  public void testGetParentOfType() throws Throwable {
+    getTypeChooserManager().registerTypeChooser(MyAbstractElement.class, new MyTypeChooser());
+    try {
+      final MyElement element = createElement("");
+      final MyAbstractElement abstractChild = element.getAbstractChild();
+      final MyElement child239 = abstractChild.getChild239();
+
+      assertSame(child239, child239.getParentOfType(MyElement.class, false));
+      assertSame(abstractChild, child239.getParentOfType(MyElement.class, true));
+      assertSame(abstractChild, child239.getParentOfType(MyAbstractElement.class, true));
+      assertSame(DomUtil.getFileElement(element), child239.getParentOfType(DomFileElement.class, false));
+      assertSame(DomUtil.getFileElement(element), DomUtil.getFileElement(element).getParentOfType(DomFileElement.class, false));
+      assertNull(DomUtil.getFileElement(element).getParentOfType(DomFileElement.class, true));
+    }
+    finally {
+      getTypeChooserManager().unregisterTypeChooser(MyAbstractElement.class);
+    }
+  }
+
+  public void testChildrenValidAfterUndefine() throws Throwable {
+    final MyElement element = createElement("<a><child/></a>");
+    final MyElement child = element.getChild();
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        element.undefine();
+      }
+    });
+
+    assertTrue(element.isValid());
+    assertFalse(child.isValid());
+  }
+
+  public void testGetCompositeCollection() throws Throwable {
+    final MyElement element = createElement("");
+    final MyFooConcreteElement foo = element.addFooChild();
+    final MyElement child = element.addChildElement();
+    final MyBarConcreteElement bar = element.addBarChild();
+    assertEquals(Arrays.asList(foo, bar, child), element.getCompositeList());
+  }
+
+  public void testAddToCompositeCollection() throws Throwable {
+    final MyElement element = createElement("");
+    final MyBarConcreteElement bar = element.addBarComposite();
+    final MyElement child = element.addChildComposite();
+    final MyElement child2 = element.addChildElement();
+    final MyFooConcreteElement foo1 = element.addFooComposite(2);
+    final MyFooConcreteElement foo2 = element.addFooComposite(0);
+    assertEquals(Arrays.asList(foo2, bar, child, foo1, child2), element.getCompositeList());
+  }
+
+  public void testCreateElementWithRequiredChild() throws Throwable {
+    final MyElement element = createElement("").addChildElement();
+    assertNotNull(element.getAttr().getXmlAttribute());
+    assertNotNull(element.isGenericValue().getXmlTag());
+    assertTrue(element.getMyChildren2().isEmpty());
+  }
+
+  public void testSetRequiredChildValue() throws Throwable {
+    final MyElement element = createElement("<a/>").getChild();
+    element.isGenericValue().setStringValue("true");
+    assertEquals(1, element.getXmlTag().findSubTags("generic-value").length);
+    assertTrue(element.isGenericValue().getValue());
+  }
+
+  public void testGetFixedPath() throws Throwable {
+    final MyElement element = createElement("");
+    final MyElement child2 = element.getChild2();
+    assertEquals(Arrays.asList("getChild2", "getChild2", "getChild239", "getAbstractChild", "getChild2"),
+                 getFixedPath(child2.getChild2().getChild239().getAbstractChild().getChild2()));
+    assertEquals(Arrays.asList("getChild2"), getFixedPath(child2));
+    assertEquals(Arrays.asList(), getFixedPath(element));
+    assertEquals(Arrays.asList("getAttr"), getFixedPath(element.getAttr()));
+    assertNull(DomUtil.getFixedPath(element.addChildElement().getChild()));
+  }
+
+  public void testGetDomElementCustomChild() throws Throwable {
+    final MyElement myElement = createElement("<a><abstract-child/><generic-value/><bar/></a>", MyElement.class);
+    final XmlTag tag = myElement.getXmlTag();
+    assertEquals(1, myElement.getCustomChildren().size());
+    assertInstanceOf(getDomManager().getDomElement(tag.getSubTags()[0]), MyAbstractElement.class);
+    assertInstanceOf(getDomManager().getDomElement(tag.getSubTags()[1]), GenericDomValue.class);
+    assertInstanceOf(getDomManager().getDomElement(tag.getSubTags()[2]), MyElement.class);
+  }
+
+  public void testNoChildrenForMalformedTags() throws Throwable {
+    final MyElement myElement = createElement("<a><</a>", MyElement.class);
+    final XmlTag tag = myElement.getXmlTag();
+    assertEquals(0, myElement.getCustomChildren().size());
+  }
+
+  public void testCustomNameChildren() throws Throwable {
+    final MyElement myElement = createElement("<a><foo/><bar/><foo xmlns=\"z\"/></a>", MyElement.class);
+    final XmlTag tag = myElement.getXmlTag();
+    final List<MyElement> customChildren = myElement.getCustomChildren();
+    assertOrderedEquals(customChildren, myElement.getGenericInfo().getCustomNameChildrenDescription().get(0).getValues(myElement));
+    assertOrderedCollection(customChildren, new Consumer<MyElement>() {
+      @Override
+      public void consume(final MyElement element) {
+        assertInstanceOf(element, MyElement.class);
+        assertEquals(tag.getSubTags()[0], element.getXmlTag());
+      }
+    }, new Consumer<MyElement>() {
+      @Override
+      public void consume(final MyElement element) {
+        assertInstanceOf(element, MyElement.class);
+        assertEquals(tag.getSubTags()[1], element.getXmlTag());
+      }
+    }, new Consumer<MyElement>() {
+      @Override
+      public void consume(final MyElement element) {
+        assertInstanceOf(element, MyElement.class);
+        assertEquals(tag.getSubTags()[2], element.getXmlTag());
+      }
+    });
+  }
+
+  private List<String> getFixedPath(final DomElement element) {
+    return ContainerUtil.map2List(DomUtil.getFixedPath(element), new Function<JavaMethod, String>() {
+      @Override
+      public String fun(final JavaMethod s) {
+        return s.getName();
+      }
+    });
+  }
+
+  public void testElementsWithoutXmlGetItLater() throws Throwable {
+    final MyElement element = createElement("<a/>");
+    final MyElement child = element.getChild();
+    final MyElement child2 = element.getChild2();
+    final PsiElement tag = element.getXmlTag().add(createTag("<child/>"));
+    incModCount();
+
+    assertTrue(child.isValid());
+    assertEquals(tag, child.getXmlTag());
+
+    assertTrue(child2.isValid());
+    assertNull(child2.getXmlTag());
+  }
+
+  public void testHigherOrderFixedsAreNotCustom() {
+    final MyElement element = createElement("<a><child/><child/><child/></a>");
+    XmlTag third = element.getXmlTag().getSubTags()[2];
+    assertNull(getDomManager().getDomElement(third));
+    assertEmpty(element.getCustomChildren());
+  }
+
+
+  public interface MyElement extends DomElement {
+    @Attribute
+    @Required
+    GenericAttributeValue<String> getAttr();
+
+    String getValue();
+
+    @SubTag("child")
+    MyElement getMyChild();
+
+    MyElement getChild();
+
+    @SubTag(value = "child", index = 1)
+    MyElement getChild2();
+
+    MyElement getChild239();
+
+    @SubTagList("child-element")
+    List<? extends MyElement> getMyChildren();
+
+    @CustomChildren
+    List<MyElement> getCustomChildren();
+
+    @SubTagList("child-element")
+    @Required
+    List<MyElement> getMyChildren2();
+
+    List<MyElement> getChildElements();
+
+    MyElement addChildElement();
+
+    MyElement addChildElement(int index);
+
+    MyAbstractElement getAbstractChild();
+
+    List<MyAbstractElement> getAbstractElements();
+
+    @SubTagList("abstract-element")
+    MyBarConcreteElement addBarChild();
+
+    @SubTagList("abstract-element")
+    MyFooConcreteElement addFooChild();
+
+    <T extends MyAbstractElement> T addAbstractElement(Class<T> aClass);
+
+    <T extends MyAbstractElement> T addAbstractElement(Class<T> aClass, int index);
+
+    <T extends MyAbstractElement> T addAbstractElement(int index, Class<T> aClass);
+
+    List<GenericDomValue<Integer>> getGenericChildren();
+
+    @Required
+    GenericDomValue<Boolean> isGenericValue();
+
+    @SubTagsList({"child-element", "abstract-element"})
+    List<MyElement> getCompositeList();
+
+    @SubTagsList(value = {"child-element", "abstract-element"}, tagName = "abstract-element")
+    MyBarConcreteElement addBarComposite();
+
+    @SubTagsList(value = {"child-element", "abstract-element"}, tagName = "child-element")
+    MyElement addChildComposite();
+
+    @SubTagsList(value = {"child-element", "abstract-element"}, tagName = "abstract-element")
+    MyFooConcreteElement addFooComposite(int index);
+
+  }
+
+  public interface MyAbstractElement extends MyElement {
+  }
+
+  public interface MyFooConcreteElement extends MyAbstractElement {
+    MyFooConcreteElement getFoo();
+  }
+
+  public interface MyBarConcreteElement extends MyAbstractElement {
+  }
+
+  private static class MyTypeChooser extends TypeChooser {
+    @Override
+    public Type chooseType(final XmlTag tag) {
+      return tag != null && tag.getText().contains("Foo") ? MyFooConcreteElement.class : MyBarConcreteElement.class;
+    }
+
+    @Override
+    public void distinguishTag(final XmlTag tag, final Type aClass) throws IncorrectOperationException {
+      tag.setAttribute("foo", ((Class)aClass).getName());
+    }
+
+    @Override
+    public Type[] getChooserTypes() {
+      return ArrayUtil.EMPTY_CLASS_ARRAY;
+    }
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomConcurrencyStressTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomConcurrencyStressTest.java
new file mode 100644
index 0000000..c38cd10
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomConcurrencyStressTest.java
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2000-2007 JetBrains s.r.o. All Rights Reserved.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.util.Ref;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.semantic.SemService;
+import com.intellij.testFramework.PlatformTestUtil;
+import com.intellij.testFramework.Timings;
+import com.intellij.util.xml.impl.DomFileElementImpl;
+import com.intellij.util.xml.reflect.DomExtender;
+import com.intellij.util.xml.reflect.DomExtenderEP;
+import com.intellij.util.xml.reflect.DomExtensionsRegistrar;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+
+/**
+ * @author peter
+ */
+public class DomConcurrencyStressTest extends DomTestCase {
+  private static final int ITERATIONS = Timings.adjustAccordingToMySpeed(239, true);
+
+  public void testInternalDomLocksReadConsistency() throws Throwable {
+    getDomManager().registerFileDescription(new DomFileDescription(MyElement.class, "a"), myTestRootDisposable);
+
+    registerExtender(MyElement.class, MyExtender.class);
+
+
+    final XmlFile file = createXmlFile("<a attr=\"1\" attr2=\"2\">" +
+                                       "<foo-child><foo-child/><custom-foo/></foo-child>" +
+                                       "<bar-child><foo-child/></bar-child>" +
+                                       "<foo-element>" +
+                                       "  <foo-child/>" +
+                                       "  <foo-child><foo-child attr=\"\"/></foo-child>" +
+                                       "  <custom-foo/>" +
+                                       "  <custom-bar/>" +
+                                       "</foo-element>" +
+                                       "<custom-bar/>" +
+                                       "<custom-bar>" +
+                                       "  <foo-child/>" +
+                                       "  <foo-element/>" +
+                                       "  <foo-element/>" +
+                                       "  <custom-bar/>" +
+                                       "</custom-bar>" +
+                                       "<custom-bar attr=\"\">" +
+                                       "  <foo-child/>" +
+                                       "  <some-child/>" +
+                                       "  <custom-bar/>" +
+                                       "</custom-bar>" +
+                                       "<child/>" +
+                                       "<child/>" +
+                                       "<bool/>" +
+                                       "</a>");
+
+    System.out.println("ITERATIONS =" + ITERATIONS);
+    runThreads(42, new Runnable() {
+      @Override
+      public void run() {
+        for (int i = 0; i < ITERATIONS; i++) {
+          ApplicationManager.getApplication().runReadAction(new Runnable() {
+            public void run() {
+              final DomFileElementImpl<DomElement> element = getDomManager().getFileElement(file);
+              assertNotNull(element);
+              element.getRootElement().accept(new DomElementVisitor() {
+                @Override
+                public void visitDomElement(final DomElement element) {
+                  if (DomUtil.hasXml(element)) {
+                    element.acceptChildren(this);
+                  }
+                }
+              });
+            }
+          });
+
+          SemService.getSemService(getProject()).clearCache();
+        }
+      }
+    });
+  }
+
+  private void registerExtender(final Class elementClass, final Class extenderClass) {
+    final DomExtenderEP extenderEP = new DomExtenderEP();
+    extenderEP.domClassName = elementClass.getName();
+    extenderEP.extenderClassName = extenderClass.getName();
+    PlatformTestUtil.registerExtension(Extensions.getRootArea(), DomExtenderEP.EP_NAME, extenderEP, myTestRootDisposable);
+  }
+
+  private static void runThreads(int threadCount, final Runnable runnable) throws Throwable {
+    final Ref<Throwable> exc = Ref.create(null);
+
+    final CountDownLatch reads = new CountDownLatch(threadCount);
+    for (int j = 0; j < threadCount; j++) {
+      new Thread(){
+        @Override
+        public void run() {
+          try {
+            runnable.run();
+          }
+          catch (Throwable e) {
+            exc.set(e);
+          } finally {
+            reads.countDown();
+          }
+        }
+      }.start();
+    }
+    reads.await();
+    if (!exc.isNull()) {
+      throw exc.get();
+    }
+  }
+
+  public interface MyElement extends DomElement {
+    MyElement getFooChild();
+    MyElement getBarChild();
+
+    MyElement getSomeChild();
+
+    List<MyElement> getFooElements();
+    MyElement addFooElement();
+
+    List<MyElement> getChildren();
+    MyElement addChild();
+
+    GenericAttributeValue<String> getAttr();
+    GenericAttributeValue<String> getAttr2();
+
+    @SubTag(indicator = true)
+    GenericDomValue<Boolean> getBool();
+
+  }
+
+  public static class MyExtender extends DomExtender<MyElement> {
+    private final Random myRandom = new Random();
+
+    @Override
+    public void registerExtensions(@NotNull MyElement myElement, @NotNull DomExtensionsRegistrar registrar) {
+      for (MyElement element : myElement.getFooElements()) {
+          element.getFooElements();
+        }
+      if (myRandom.nextInt(20) < 2) {
+          try {
+            Thread.sleep(1);
+          }
+          catch (InterruptedException ignored) {
+          }
+        }
+      registrar.registerFixedNumberChildExtension(new XmlName("custom-foo", null), MyElement.class);
+      myElement.getSomeChild().getFooElements();
+      myElement.getFooChild().getFooChild().getAttr();
+      myElement.getAttr();
+      registrar.registerCollectionChildrenExtension(new XmlName("custom-bar", null), MyElement.class);
+    }
+  }
+
+  public void testBigCustomFile() throws Throwable {
+    getDomManager().registerFileDescription(new DomFileDescription(MyAllCustomElement.class, "component"), myTestRootDisposable);
+
+    registerExtender(MyAllCustomElement.class, MyAllCustomExtender.class);
+
+    VirtualFile bigXml = LocalFileSystem.getInstance().findFileByPath(
+      PlatformTestUtil.getCommunityPath() + "/xml/dom-tests/testData/performance.xml");
+    assert bigXml != null;
+    final XmlFile file = (XmlFile)PsiManager.getInstance(ourProject).findFile(bigXml);
+
+    runThreads(42, new Runnable() {
+
+      @Override
+      public void run() {
+        final Random random = new Random();
+        for (int i = 0; i < ITERATIONS; i++) {
+          ApplicationManager.getApplication().runReadAction(new Runnable() {
+            public void run() {
+              int offset = random.nextInt(file.getTextLength() - 10);
+              XmlTag tag = PsiTreeUtil.findElementOfClassAtOffset(file, offset, XmlTag.class, false);
+              assert tag != null : offset;
+              DomElement element = DomUtil.getDomElement(tag);
+              assert element instanceof MyAllCustomElement : element;
+            }
+          });
+
+          if (random.nextInt(50) == 0) {
+            SemService.getSemService(getProject()).clearCache();
+          }
+        }
+      }
+    });
+
+  }
+
+  public interface MyAllCustomElement extends DomElement {}
+
+  public static class MyAllCustomExtender extends DomExtender<MyAllCustomElement> {
+    @Override
+    public void registerExtensions(@NotNull MyAllCustomElement element, @NotNull DomExtensionsRegistrar registrar) {
+      try {
+        DomElement parent = element;
+        while (parent != null) {
+          for (DomElement child : DomUtil.getDefinedChildren(parent, true, true)) {
+            DomElement childParent = child.getParent();
+            if (!parent.equals(childParent)) {
+              String parentText = parent.getXmlTag().getText();
+              String childText = child.getXmlElement().getText();
+              child.getParent();
+              parent.equals(childParent);
+              throw new AssertionError(parent.getXmlElement() + "; " + childParent + "; " + child.getXmlElement().getText());
+            }
+          }
+
+          parent = parent.getParent();
+        }
+      }
+      catch (StackOverflowError e) {
+        System.out.println(Thread.currentThread() + ":    " + element.getXmlTag().getName() + element.getXmlTag().hashCode());
+        throw e;
+      }
+      registrar.registerCustomChildrenExtension(MyAllCustomElement.class);
+    }
+  }
+
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomExtensionsTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomExtensionsTest.java
new file mode 100644
index 0000000..7977a8d
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomExtensionsTest.java
@@ -0,0 +1,309 @@
+/*
+ * Copyright (c) 2000-2007 JetBrains s.r.o. All Rights Reserved.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.util.Key;
+import com.intellij.testFramework.IdeaTestUtil;
+import com.intellij.util.Consumer;
+import com.intellij.util.ParameterizedTypeImpl;
+import com.intellij.util.ReflectionUtil;
+import com.intellij.util.xml.reflect.*;
+import org.jetbrains.annotations.NotNull;
+
+import java.lang.reflect.ParameterizedType;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class DomExtensionsTest extends DomTestCase {
+  private static final Key<Boolean> BOOL_KEY = Key.create("aaa");
+
+  public void testExtendAttributes() throws Throwable {
+    registerDomExtender(AttrDomExtender.class);
+    assertEmpty(getCustomChildren(createElement("<a foo=\"xxx\"/>", MyElement.class)));
+
+    MyElement element = createElement("<a attr=\"foo\" foo=\"true\"/>", MyElement.class);
+    final GenericAttributeValue child = assertInstanceOf(assertOneElement(getCustomChildren(element)), GenericAttributeValue.class);
+    assertEquals("true", child.getStringValue());
+    assertEquals(Boolean.TRUE, child.getValue());
+    assertEquals(Boolean.class, DomUtil.getGenericValueParameter(child.getDomElementType()));
+    assertSame(element.getXmlTag().getAttribute("foo"), child.getXmlElement());
+
+    child.setStringValue("xxx");
+    assertEquals("xxx", child.getStringValue());
+    assertEquals("xxx", element.getXmlTag().getAttributeValue("foo"));
+
+    element = createElement("<a attr=\"foo\" foo=\"true\"/>", MyElement.class);
+    final GenericAttributeValue value = getDomManager().getDomElement(element.getXmlTag().getAttribute("foo"));
+    assertNotNull(value);
+    assertEquals(value, assertOneElement(getCustomChildren(element)));
+    assertNotNull(element.getGenericInfo().getAttributeChildDescription("foo"));
+  }
+
+  public void testCustomAttributeChildClass() throws Throwable {
+    registerDomExtender(AttrDomExtender3.class);
+    final MyElement element = createElement("<a attr=\"xxx\"/>", MyElement.class);
+    assertEquals("xxx", assertInstanceOf(assertOneElement(getCustomChildren(element)), MyAttribute.class).getXmlElementName());
+  }
+
+  public void testUserData() throws Throwable {
+    registerDomExtender(AttrDomExtender3.class);
+    final MyElement element = createElement("<a attr=\"xxx\"/>", MyElement.class);
+    final DomAttributeChildDescription description = element.getGenericInfo().getAttributeChildDescription("xxx");
+    assertNotNull(description);
+    assertSame(Boolean.TRUE, description.getUserData(BOOL_KEY));
+  }
+
+  public void testUseCustomConverter() throws Throwable {
+    registerDomExtender(AttrDomExtender2.class);
+    final MyElement myElement = createElement("<a attr=\"xxx\" xxx=\"zzz\" yyy=\"zzz\"/>", MyElement.class);
+    assertUnorderedCollection(getCustomChildren(myElement), new Consumer<DomElement>() {
+      @Override
+      public void consume(final DomElement element) {
+        final StringBuffer stringBuffer = ((GenericAttributeValue<StringBuffer>)element).getValue();
+        assertEquals("zzz", stringBuffer.toString());
+        assertInstanceOf(((GenericAttributeValue<StringBuffer>)element).getConverter(), StringBufferConverter.class);
+        assertNotNull(myElement.getGenericInfo().getAttributeChildDescription("xxx"));
+
+        Convert convert = element.getAnnotation(Convert.class);
+        assertNotNull(convert);
+        assertEquals(StringBufferConverter.class, convert.value());
+        assertTrue(convert.soft());
+      }
+    }, new Consumer<DomElement>() {
+      @Override
+      public void consume(final DomElement element) {
+        final StringBuffer stringBuffer = ((GenericAttributeValue<StringBuffer>)element).getValue();
+        assertEquals("zzz", stringBuffer.toString());
+        assertInstanceOf(((GenericAttributeValue<StringBuffer>)element).getConverter(), StringBufferConverter.class);
+        assertNotNull(myElement.getGenericInfo().getAttributeChildDescription("yyy"));
+
+        Convert convert = element.getAnnotation(Convert.class);
+        assertNotNull(convert);
+        assertEquals(StringBufferConverter.class, convert.value());
+        assertFalse(convert.soft());
+      }
+    });
+  }
+
+  public void testFixedChildren() throws Throwable {
+    registerDomExtender(FixedDomExtender.class);
+    final MyElement myElement = createElement("<a attr=\"xxx\"><xxx>zzz</xxx><yyy attr=\"foo\"/><yyy attr=\"bar\"/></a>", MyElement.class);
+    assertUnorderedCollection(getCustomChildren(myElement), new Consumer<DomElement>() {
+      @Override
+      public void consume(final DomElement element) {
+        assertEquals(GenericDomValue.class, ReflectionUtil.getRawType(element.getDomElementType()));
+        final StringBuffer stringBuffer = ((GenericDomValue<StringBuffer>)element).getValue();
+        assertEquals("zzz", stringBuffer.toString());
+        assertInstanceOf(((GenericDomValue<StringBuffer>)element).getConverter(), MyStringBufferConverter.class);
+        assertNotNull(myElement.getGenericInfo().getFixedChildDescription("xxx"));
+
+        Convert convert = element.getAnnotation(Convert.class);
+        assertNotNull(convert);
+        assertEquals(MyStringBufferConverter.class, convert.value());
+        assertTrue(convert.soft());
+
+        assertNotNull(element.getGenericInfo().getAttributeChildDescription("aaa"));
+      }
+    }, new Consumer<DomElement>() {
+      @Override
+      public void consume(final DomElement element) {
+        assertEquals("foo", ((MyElement) element).getAttr().getValue());
+        assertNull(element.getAnnotation(Convert.class));
+      }
+    }, new Consumer<DomElement>() {
+      @Override
+      public void consume(final DomElement element) {
+        assertEquals("bar", ((MyElement) element).getAttr().getValue());
+        assertNull(element.getAnnotation(Convert.class));
+      }
+    });
+    final DomFixedChildDescription description = myElement.getGenericInfo().getFixedChildDescription("yyy");
+    assertNotNull(description);
+    assertEquals(2, description.getCount());
+  }
+
+  public void testCollectionChildren() throws Throwable {
+    registerDomExtender(CollectionDomExtender.class);
+    final MyElement myElement = createElement("<a attr=\"xxx\"><xxx>zzz</xxx><xxx attr=\"foo\"/></a>", MyElement.class);
+    assertUnorderedCollection(getCustomChildren(myElement), new Consumer<DomElement>() {
+      @Override
+      public void consume(final DomElement element) {
+        assertEquals("foo", ((MyElement) element).getAttr().getValue());
+        assertNull(element.getAnnotation(Convert.class));
+      }
+    }, new Consumer<DomElement>() {
+      @Override
+      public void consume(final DomElement element) {
+        assertNull(((MyElement) element).getAttr().getValue());
+        assertNull(element.getAnnotation(Convert.class));
+      }
+    });
+    assertNotNull(myElement.getGenericInfo().getCollectionChildDescription("xxx"));
+  }
+
+  public void testCollectionAdders() throws Throwable {
+    registerDomExtender(CollectionDomExtender.class);
+    final MyElement myElement = createElement("<a attr=\"xxx\"></a>", MyElement.class);
+    final DomCollectionChildDescription description = myElement.getGenericInfo().getCollectionChildDescription("xxx");
+    final DomElement element2 = description.addValue(myElement);
+    final DomElement element0 = description.addValue(myElement, 0);
+    final DomElement element3 = description.addValue(myElement, MyConcreteElement.class);
+    final DomElement element1 = description.addValue(myElement, MyConcreteElement.class, 1);
+    assertSameElements(getCustomChildren(myElement), element0, element1, element2, element3);
+  }
+
+  public void testCustomChildrenAccessFromExtender() throws Throwable {
+    registerDomExtender(MyCustomChildrenElement.class, CustomDomExtender.class);
+    final MyCustomChildrenElement myElement = createElement("<a><xx/><yy/><concrete-child/><some-concrete-child/></a>", MyCustomChildrenElement.class);
+    final DomCollectionChildDescription description = myElement.getGenericInfo().getCollectionChildDescription("xx");
+    assertNotNull(description);
+    assertInstanceOf(assertOneElement(description.getValues(myElement)), MyDynamicElement.class);
+    assertInstanceOf(assertOneElement(myElement.getCustomChidren()), MyCustomElement.class);
+    assertInstanceOf(assertOneElement(myElement.getConcreteChildren()), MyConcreteElement.class);
+    assertNotNull(assertInstanceOf(myElement.getSomeConcreteChild(), MyConcreteElement.class).getXmlTag());
+  }
+
+  public void testFirstChildRedefinitionOnExtending() throws Exception {
+    registerDomExtender(MyCustomChildrenElement.class, ModestDomExtender.class);
+
+    final MyCustomChildrenElement myElement = createElement("<a><concrete-child/><concrete-child/></a>", MyCustomChildrenElement.class);
+    final List<MyConcreteElement> list = myElement.getConcreteChildren();
+    final List<MyConcreteElement> list2 = myElement.getConcreteChildren();
+    assertSame(list.get(0), list2.get(0));
+    assertSame(list.get(1), list2.get(1));
+  }
+
+  public static List<DomElement> getCustomChildren(final DomElement element) {
+    final List<DomElement> children = new ArrayList<DomElement>();
+    element.acceptChildren(new DomElementVisitor() {
+      @Override
+      public void visitDomElement(final DomElement element) {
+        if (!"attr".equals(element.getXmlElementName())) {
+          children.add(element);
+        }
+      }
+    });
+    return children;
+  }
+
+  public void registerDomExtender(Class<? extends DomExtender<MyElement>> extender) {
+    registerDomExtender(MyElement.class, extender);
+  }
+
+  public <T extends DomElement> void registerDomExtender(final Class<T> domClass, final Class<? extends DomExtender<T>> extenderClass) {
+    final DomExtenderEP extenderEP = new DomExtenderEP();
+    extenderEP.domClassName = domClass.getName();
+    extenderEP.extenderClassName = extenderClass.getName();
+    IdeaTestUtil.registerExtension(Extensions.getRootArea(), DomExtenderEP.EP_NAME, extenderEP, myTestRootDisposable);
+  }
+
+
+  public interface MyElement extends DomElement {
+    GenericAttributeValue<String> getAttr();
+  }
+
+  public interface MyCustomChildrenElement extends DomElement {
+    @CustomChildren List<MyCustomElement> getCustomChidren();
+
+    List<MyConcreteElement> getConcreteChildren();
+
+    MyConcreteElement getSomeConcreteChild();
+  }
+
+  public interface MyConcreteElement extends MyElement {
+  }
+  public interface MyCustomElement extends MyElement {
+  }
+  public interface MyDynamicElement extends MyElement {
+  }
+
+  public static class AttrDomExtender extends DomExtender<MyElement> {
+    @Override
+    public void registerExtensions(@NotNull final MyElement element, @NotNull final DomExtensionsRegistrar registrar) {
+      final String value = element.getAttr().getValue();
+      if (value != null) {
+        registrar.registerGenericAttributeValueChildExtension(new XmlName(value), Boolean.class);
+      }
+    }
+  }
+
+  public static class AttrDomExtender2 extends DomExtender<MyElement> {
+    @Override
+    public void registerExtensions(@NotNull final MyElement element, @NotNull final DomExtensionsRegistrar registrar) {
+      final String value = element.getAttr().getValue();
+      if (value != null) {
+        registrar.registerGenericAttributeValueChildExtension(new XmlName(value), StringBuffer.class).setConverter(new StringBufferConverter(), true);
+        registrar.registerGenericAttributeValueChildExtension(new XmlName("yyy"), StringBuffer.class).setConverter(new StringBufferConverter(), false);
+      }
+    }
+  }
+
+
+
+  public static class AttrDomExtender3 extends DomExtender<MyElement> {
+
+    @Override
+    public void registerExtensions(@NotNull final MyElement element, @NotNull final DomExtensionsRegistrar registrar) {
+      final String value = element.getAttr().getValue();
+      if (value != null) {
+        registrar.registerAttributeChildExtension(new XmlName(value), MyAttribute.class).putUserData(BOOL_KEY, Boolean.TRUE);
+      }
+    }
+  }
+
+  public static class FixedDomExtender extends DomExtender<MyElement> {
+    @Override
+    public void registerExtensions(@NotNull final MyElement element, @NotNull final DomExtensionsRegistrar registrar) {
+      final String value = element.getAttr().getValue();
+      if (value != null) {
+        final ParameterizedType type = new ParameterizedTypeImpl(GenericDomValue.class, StringBuffer.class);
+        final DomExtension extension =
+          registrar.registerFixedNumberChildExtension(new XmlName(value), type).setConverter(new MyStringBufferConverter(true), true);
+        extension.addExtender(new DomExtender<GenericDomValue<StringBuffer>>(){
+
+          @Override
+          public void registerExtensions(@NotNull final GenericDomValue<StringBuffer> stringBufferGenericDomValue, @NotNull final DomExtensionsRegistrar registrar) {
+            registrar.registerGenericAttributeValueChildExtension(new XmlName("aaa"), String.class);
+          }
+        });
+        ((DomExtensionsRegistrarImpl)registrar).registerFixedNumberChildrenExtension(new XmlName("yyy"), MyElement.class, 2);
+      }
+    }
+  }
+  public static class CollectionDomExtender extends DomExtender<MyElement> {
+    @Override
+    public void registerExtensions(@NotNull final MyElement element, @NotNull final DomExtensionsRegistrar registrar) {
+      final String value = element.getAttr().getValue();
+      if (value != null) {
+        registrar.registerCollectionChildrenExtension(new XmlName(value), MyElement.class).setConverter(new MyStringBufferConverter(true), true);
+      }
+    }
+  }
+
+  public static class CustomDomExtender extends DomExtender<MyCustomChildrenElement> {
+    @Override
+    public void registerExtensions(@NotNull final MyCustomChildrenElement element, @NotNull final DomExtensionsRegistrar registrar) {
+      assertEmpty(element.getCustomChidren());
+      registrar.registerCollectionChildrenExtension(new XmlName("xx"), MyDynamicElement.class);
+    }
+  }
+
+  public static class ModestDomExtender extends DomExtender<MyCustomChildrenElement> {
+    @Override
+    public void registerExtensions(@NotNull final MyCustomChildrenElement element, @NotNull final DomExtensionsRegistrar registrar) {
+      registrar.registerCollectionChildrenExtension(new XmlName("xx"), MyDynamicElement.class);
+    }
+  }
+
+  public static class MyStringBufferConverter extends StringBufferConverter {
+    public MyStringBufferConverter(boolean b) {
+    }
+  }
+  public static interface MyAttribute extends GenericAttributeValue<Boolean> {}
+}
+
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomFileDescriptionTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomFileDescriptionTest.java
new file mode 100644
index 0000000..7d76e0e
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomFileDescriptionTest.java
@@ -0,0 +1,232 @@
+/*
+ * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
+ */
+/*
+ * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.module.Module;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.impl.DomFileElementImpl;
+import com.intellij.util.xml.impl.MockDomFileDescription;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author peter
+ */
+public class DomFileDescriptionTest extends DomHardCoreTestCase {
+  private XmlFile myFooElementFile;
+  private XmlFile myBarElementFile;
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+
+    myFooElementFile = new WriteCommandAction<XmlFile>(getProject()) {
+      @Override
+      protected void run(Result<XmlFile> result) throws Throwable {
+        result.setResult((XmlFile)createFile("a.xml", "<a/>"));
+      }
+    }.execute().getResultObject();
+
+    getDomManager().registerFileDescription(new MockDomFileDescription<FooElement>(FooElement.class, "a", myFooElementFile), getTestRootDisposable());
+
+    myBarElementFile = new WriteCommandAction<XmlFile>(getProject()) {
+      @Override
+      protected void run(Result<XmlFile> result) throws Throwable {
+        result.setResult((XmlFile)createFile("b.xml", "<b/>"));
+      }
+    }.execute().getResultObject();
+
+    getDomManager().registerFileDescription(new DomFileDescription<BarElement>(BarElement.class, "b") {
+
+      @Override
+      public boolean isMyFile(@NotNull final XmlFile file, final Module module) {
+        return myFooElementFile.getText().contains("239");
+      }
+
+      @Override
+      public boolean isAutomaticHighlightingEnabled() {
+        return false;
+      }
+    }, getTestRootDisposable());
+
+    assertResultsAndClear();
+  }
+
+  public void testNoInitialDomnessInB() throws Throwable {
+    assertFalse(getDomManager().isDomFile(myBarElementFile));
+    assertNull(getDomManager().getFileElement(myBarElementFile));
+  }
+
+  public void testIsDomValue() throws Throwable {
+    final XmlFile file = (XmlFile)createFile("a.xml", "<b>42</b>");
+    getDomManager().registerFileDescription(new DomFileDescription(MyElement.class, "b") {
+
+      @Override
+      public boolean isMyFile(@NotNull final XmlFile file, final Module module) {
+        return /*super.isMyFile(file, module) && */file.getText().contains("239");
+      }
+    }, getTestRootDisposable());
+
+
+    assertFalse(getDomManager().isDomFile(file));
+    assertNull(getDomManager().getFileElement(file));
+
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        file.getDocument().getRootTag().getValue().setText("239");
+      }
+    }.execute();
+    assertTrue(getDomManager().isDomFile(file));
+    final DomFileElementImpl<MyElement> root = getDomManager().getFileElement(file);
+    assertNotNull(root);
+    final MyElement child = root.getRootElement().getChild();
+    assertTrue(root.isValid());
+    assertTrue(child.isValid());
+
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        file.getDocument().getRootTag().getValue().setText("57121");
+      }
+    }.execute();
+    assertFalse(getDomManager().isDomFile(file));
+    assertNull(getDomManager().getFileElement(file));
+    assertFalse(root.isValid());
+    assertFalse(child.isValid());
+  }
+
+  public void testCopyFileDescriptionFromOriginalFile() throws Throwable {
+    final XmlFile file = (XmlFile)createFile("a.xml", "<b>42</b>");
+
+    getDomManager().registerFileDescription(new MockDomFileDescription(MyElement.class, "b", file), getTestRootDisposable());
+    file.setName("b.xml");
+    assertTrue(getDomManager().isDomFile(file));
+    final XmlFile copy = (XmlFile)file.copy();
+    assertTrue(getDomManager().isDomFile(copy));
+    assertFalse(getDomManager().getFileElement(file).equals(getDomManager().getFileElement(copy)));
+  }
+
+  public void testDependantFileDescriptionCauseStackOverflow() throws Throwable {
+    final XmlFile interestingFile = (XmlFile)createFile("a.xml", "<b>42</b>");
+
+    getDomManager().registerFileDescription(new MockDomFileDescription(MyElement.class, "b", (XmlFile)null), getTestRootDisposable());
+    for (int i = 0; i < 239; i++) {
+      getDomManager().registerFileDescription(new MockDomFileDescription(AbstractElement.class, "b", (XmlFile)null) {
+        @Override
+        @NotNull
+        public Set getDependencyItems(final XmlFile file) {
+          getDomManager().isDomFile(interestingFile);
+          return super.getDependencyItems(file);
+        }
+      }, getTestRootDisposable());
+    }
+
+    getDomManager().isDomFile(interestingFile);
+  }
+
+  public void testCheckNamespace() throws Throwable {
+    getDomManager().registerFileDescription(new DomFileDescription(NamespacedElement.class, "xxx", "bar"){
+
+      @Override
+      protected void initializeFileDescription() {
+        registerNamespacePolicy("foo", "bar");
+      }
+    }, getTestRootDisposable());
+
+    final PsiFile file = createFile("xxx.xml", "<xxx/>");
+    assertFalse(getDomManager().isDomFile(file));
+
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        ((XmlFile)file).getDocument().getRootTag().setAttribute("xmlns", "bar");
+      }
+    }.execute();
+
+    assertTrue(getDomManager().isDomFile(file));
+
+  }
+
+  public void testCheckDtdPublicId() throws Throwable {
+    getDomManager().registerFileDescription(new DomFileDescription(NamespacedElement.class, "xxx", "bar"){
+
+      @Override
+      protected void initializeFileDescription() {
+        registerNamespacePolicy("foo", "bar");
+      }
+    }, getTestRootDisposable());
+
+    final PsiFile file = createFile("xxx.xml", "<xxx/>");
+    assertFalse(getDomManager().isDomFile(file));
+
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        final Document document = getDocument(file);
+        document.insertString(0, "<!DOCTYPE xxx PUBLIC \"bar\" \"http://java.sun.com/dtd/ejb-jar_2_0.dtd\">\n");
+        commitDocument(document);
+      }
+    }.execute();
+
+    assertTrue(getDomManager().isDomFile(file));
+  }
+
+  public void testChangeCustomDomness() throws Throwable {
+    getDomManager().registerFileDescription(new DomFileDescription(MyElement.class, "xxx"){
+      @Override
+      public boolean isMyFile(@NotNull final XmlFile file, @Nullable final Module module) {
+        return file.getText().contains("foo");
+      }
+    }, getTestRootDisposable());
+    final XmlFile file = (XmlFile)createFile("xxx.xml", "<xxx zzz=\"foo\"><boy/><boy/><xxx/>");
+    final MyElement boy = getDomManager().getFileElement(file, MyElement.class).getRootElement().getBoys().get(0);
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        file.getDocument().getRootTag().setAttribute("zzz", "bar");
+      }
+    }.execute();
+    assertFalse(getDomManager().isDomFile(file));
+    assertFalse(boy.isValid());
+  }
+
+  public interface AbstractElement extends GenericDomValue<String> {
+    GenericAttributeValue<String> getAttr();
+  }
+
+  public interface FooElement extends AbstractElement {
+  }
+
+  public interface BarElement extends AbstractElement {
+  }
+
+  public interface ZipElement extends AbstractElement {
+  }
+
+  public interface MyElement extends DomElement {
+
+    MyElement getChild();
+
+    List<MyElement> getBoys();
+
+  }
+
+  @Namespace("foo")
+  public interface NamespacedElement extends DomElement {
+
+  }
+
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomHardCoreTestCase.java b/xml/dom-tests/tests/com/intellij/util/xml/DomHardCoreTestCase.java
new file mode 100644
index 0000000..dc092fc
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomHardCoreTestCase.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.codeInsight.CodeInsightTestCase;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.PresentableLookupValue;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagValue;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.events.DomEvent;
+import com.intellij.util.xml.impl.DomApplicationComponent;
+import com.intellij.util.xml.impl.DomManagerImpl;
+
+/**
+ * @author peter
+ */
+public abstract class DomHardCoreTestCase extends CodeInsightTestCase {
+  private CallRegistry<DomEvent> myCallRegistry;
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+    myCallRegistry = new CallRegistry<DomEvent>();
+    getDomManager().addDomEventListener(new DomEventListener() {
+      @Override
+      public void eventOccured(DomEvent event) {
+        myCallRegistry.putActual(event);
+      }
+    }, myProject);
+  }
+
+  @Override
+  protected void tearDown() throws Exception {
+    DomApplicationComponent.getInstance().clearCachesInTests();
+    super.tearDown();
+  }
+
+  protected DomManagerImpl getDomManager() {
+    return DomManagerImpl.getDomManager(getProject());
+  }
+
+  protected <T extends DomElement> T createElement(final String xml, final Class<T> aClass) throws IncorrectOperationException {
+    return DomTestCase.createElement(getDomManager(), xml, aClass);
+  }
+
+  protected void assertEventCount(final int size) {
+    assertEquals(myCallRegistry.toString(), size, myCallRegistry.getSize());
+  }
+
+  protected void putExpected(final DomEvent event) {
+    myCallRegistry.putExpected(event);
+  }
+
+  protected void assertResultsAndClear() {
+    myCallRegistry.assertResultsAndClear();
+  }
+
+  protected PsiReference assertReference(final GenericDomValue value) {
+    return assertReference(value, value.getXmlTag());
+  }
+
+  protected PsiReference assertReference(final GenericDomValue value, PsiElement resolveTo) {
+    final XmlTagValue tagValue = value.getXmlTag().getValue();
+    final TextRange textRange = tagValue.getTextRange();
+    final String s = value.getStringValue();
+    final int i = tagValue.getText().indexOf(s);
+    return assertReference(value, resolveTo, textRange.getStartOffset() + i + s.length());
+  }
+
+  protected PsiReference assertReference(final GenericDomValue value, PsiElement resolveTo, int offset) {
+    final XmlTag tag = value.getXmlTag();
+    final PsiReference reference = tag.getContainingFile().findReferenceAt(offset);
+    assertNotNull(reference);
+    assertEquals(resolveTo, reference.resolve());
+    return reference;
+  }
+
+  protected PsiReference getReference(final GenericAttributeValue value) {
+    final XmlAttributeValue attributeValue = value.getXmlAttributeValue();
+    final PsiReference reference = attributeValue.getContainingFile().findReferenceAt(attributeValue.getTextRange().getStartOffset() + 1);
+    assertNotNull(reference);
+    assertEquals(attributeValue, reference.resolve());
+    return reference;
+  }
+
+  protected void assertVariants(PsiReference reference, String... variants) {
+    Object[] refVariants = reference.getVariants();
+    assertNotNull(refVariants);
+    assertEquals(refVariants.length, variants.length);
+    int i = 0;
+    for (String variant : variants) {
+      Object refVariant = refVariants[i++];
+      if (refVariant instanceof LookupElement) {
+        assertEquals(variant, ((LookupElement)refVariant).getLookupString());
+      }
+      else if (refVariant instanceof PresentableLookupValue) {
+        assertEquals(variant, ((PresentableLookupValue)refVariant).getPresentation());
+      }
+      else {
+        assertEquals(variant, refVariant.toString());
+      }
+    }
+  }
+
+  protected DomReferencesTest.MyElement createElement(final String xml) throws IncorrectOperationException {
+    return createElement(xml, DomReferencesTest.MyElement.class);
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomHighlightingLiteTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomHighlightingLiteTest.java
new file mode 100644
index 0000000..dc21e4d
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomHighlightingLiteTest.java
@@ -0,0 +1,333 @@
+/*
+ * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.codeInsight.daemon.HighlightDisplayKey;
+import com.intellij.codeInspection.InspectionManager;
+import com.intellij.codeInspection.InspectionProfile;
+import com.intellij.codeInspection.InspectionToolProvider;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.codeInspection.ex.InspectionToolRegistrar;
+import com.intellij.ide.ui.search.SearchableOptionsRegistrar;
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.mock.MockInspectionProfile;
+import com.intellij.profile.codeInspection.InspectionProfileManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiType;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.testFramework.MockSchemesManagerFactory;
+import com.intellij.util.xml.highlighting.*;
+import com.intellij.util.xml.impl.DefaultDomAnnotator;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+
+/**
+ * @author peter
+ */
+public class DomHighlightingLiteTest extends DomTestCase {
+  private DomElementAnnotationsManagerImpl myAnnotationsManager;
+  private MockDomFileElement myElement;
+  private MockInspectionProfile myInspectionProfile;
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+
+    final InspectionToolRegistrar registrar = new InspectionToolRegistrar(SearchableOptionsRegistrar.getInstance());
+    registrar.registerTools(new InspectionToolProvider[0]);
+    final InspectionProfileManager inspectionProfileManager = new InspectionProfileManager(registrar, new MockSchemesManagerFactory());
+    myInspectionProfile = new MockInspectionProfile();
+    myAnnotationsManager = new DomElementAnnotationsManagerImpl(getProject()) {
+
+      @Override
+      protected InspectionProfile getInspectionProfile(final DomFileElement fileElement) {
+
+        return myInspectionProfile;
+      }
+    };
+
+    final XmlFile file = createXmlFile("<a/>");
+    final MockDomElement rootElement = new MockDomElement() {
+      @Override
+      @Nullable
+      public XmlElement getXmlElement() {
+        return getXmlTag();
+      }
+
+      @Override
+      public XmlTag getXmlTag() {
+        return file.getDocument().getRootTag();
+      }
+
+      @Override
+      public Type getDomElementType() {
+        return DomElement.class;
+      }
+    };
+
+    myElement = new MockDomFileElement() {
+      @Override
+      @Nullable
+      public XmlElement getXmlElement() {
+        return file;
+      }
+
+      @Override
+      @NotNull
+      public XmlFile getFile() {
+        return file;
+      }
+
+      @Override
+      public DomElement getParent() {
+        return null;
+      }
+
+      @Override
+      @NotNull
+      public DomElement getRootElement() {
+        return rootElement;
+      }
+
+      @Override
+      public Class getRootElementClass() {
+        return DomElement.class;
+      }
+
+      @Override
+      public boolean isValid() {
+        return true;
+      }
+    };
+  }
+
+  public void testEmptyProblemDescriptorInTheBeginning() throws Throwable {
+    assertEmptyHolder(myAnnotationsManager.getProblemHolder(myElement));
+  }
+
+  private static void assertEmptyHolder(final DomElementsProblemsHolder holder) {
+    assertFalse(holder instanceof DomElementsProblemsHolderImpl);
+    assertEmpty(holder.getAllProblems());
+  }
+
+  public void testProblemDescriptorIsCreated() throws Throwable {
+    myAnnotationsManager.appendProblems(myElement, createHolder(), MyDomElementsInspection.class);
+    final DomElementsProblemsHolderImpl holder = assertNotEmptyHolder(myAnnotationsManager.getProblemHolder(myElement));
+    assertEmpty(holder.getAllProblems());
+    assertEmpty(holder.getAllProblems(new MyDomElementsInspection()));
+  }
+
+  private static DomElementAnnotationHolderImpl createHolder() {
+    return new DomElementAnnotationHolderImpl(true);
+  }
+
+  private static DomElementsProblemsHolderImpl assertNotEmptyHolder(final DomElementsProblemsHolder holder1) {
+    return assertInstanceOf(holder1, DomElementsProblemsHolderImpl.class);
+  }
+
+  public void testInspectionMarkedAsPassedAfterAppend() throws Throwable {
+    myAnnotationsManager.appendProblems(myElement, createHolder(), MyDomElementsInspection.class);
+    final DomElementsProblemsHolderImpl holder = (DomElementsProblemsHolderImpl)myAnnotationsManager.getProblemHolder(myElement);
+    assertTrue(holder.isInspectionCompleted(MyDomElementsInspection.class));
+    assertFalse(holder.isInspectionCompleted(DomElementsInspection.class));
+  }
+
+  public void testHolderRecreationAfterChange() throws Throwable {
+    myAnnotationsManager.appendProblems(myElement, createHolder(), MyDomElementsInspection.class);
+    assertTrue(DomElementAnnotationsManagerImpl.isHolderUpToDate(myElement));
+    final DomElementsProblemsHolder holder = myAnnotationsManager.getProblemHolder(myElement);
+
+    myElement.incModificationCount();
+    assertFalse(DomElementAnnotationsManagerImpl.isHolderUpToDate(myElement));
+    assertSame(holder, myAnnotationsManager.getProblemHolder(myElement));
+
+    myAnnotationsManager.appendProblems(myElement, createHolder(), MyDomElementsInspection.class);
+    assertNotSame(holder, assertNotEmptyHolder(myAnnotationsManager.getProblemHolder(myElement)));
+  }
+
+  public void testMockDomInspection() throws Throwable {
+    myElement.setFileDescription(new MyNonHighlightingDomFileDescription());
+    assertInstanceOf(myAnnotationsManager.getMockInspection(myElement), MockDomInspection.class);
+  }
+
+  public void testMockAnnotatingDomInspection() throws Throwable {
+    myElement.setFileDescription(new DomFileDescription(DomElement.class, "a"));
+    assertInstanceOf(myAnnotationsManager.getMockInspection(myElement), MockAnnotatingDomInspection.class);
+  }
+
+  public void testNoMockInspection() throws Throwable {
+    myElement.setFileDescription(new MyNonHighlightingDomFileDescription());
+    myInspectionProfile.setInspectionTools(new MyDomElementsInspection());
+    assertNull(myAnnotationsManager.getMockInspection(myElement));
+  }
+
+  public void testDefaultAnnotator() throws Throwable {
+    final DefaultDomAnnotator annotator = new DefaultDomAnnotator() {
+      @Override
+      protected DomElementAnnotationsManagerImpl getAnnotationsManager(final DomElement element) {
+        return myAnnotationsManager;
+      }
+    };
+    final StringBuilder s = new StringBuilder();
+    final ArrayList<Annotation> toFill = new ArrayList<Annotation>();
+    final MyDomElementsInspection inspection = new MyDomElementsInspection() {
+
+      @Override
+      public void checkFileElement(final DomFileElement fileElement, final DomElementAnnotationHolder holder) {
+        s.append("visited");
+      }
+    };
+    annotator.runInspection(inspection, myElement, toFill);
+    assertEquals("visited", s.toString());
+    final DomElementsProblemsHolderImpl holder = assertNotEmptyHolder(myAnnotationsManager.getProblemHolder(myElement));
+    assertEmpty(toFill);
+
+    annotator.runInspection(inspection, myElement, toFill);
+    assertEquals("visited", s.toString());
+    assertSame(holder, assertNotEmptyHolder(myAnnotationsManager.getProblemHolder(myElement)));
+    assertEmpty(toFill);
+  }
+
+  public void testHighlightStatus_MockDomInspection() throws Throwable {
+    myElement.setFileDescription(new MyNonHighlightingDomFileDescription());
+    assertEquals(DomHighlightStatus.NONE, myAnnotationsManager.getHighlightStatus(myElement));
+
+    myAnnotationsManager.appendProblems(myElement, createHolder(), MockDomInspection.class);
+    assertEquals(DomHighlightStatus.INSPECTIONS_FINISHED, myAnnotationsManager.getHighlightStatus(myElement));
+  }
+  public void testHighlightStatus_MockAnnotatingDomInspection() throws Throwable {
+    myElement.setFileDescription(new DomFileDescription(DomElement.class, "a"));
+
+    myAnnotationsManager.appendProblems(myElement, createHolder(), MockAnnotatingDomInspection.class);
+    assertEquals(DomHighlightStatus.INSPECTIONS_FINISHED, myAnnotationsManager.getHighlightStatus(myElement));
+  }
+
+  public void testHighlightStatus_OtherInspections() throws Throwable {
+    myElement.setFileDescription(new DomFileDescription(DomElement.class, "a"));
+    final MyDomElementsInspection inspection = new MyDomElementsInspection() {
+
+      @Override
+      public ProblemDescriptor[] checkFile(@NotNull final PsiFile file, @NotNull final InspectionManager manager,
+                                           final boolean isOnTheFly) {
+        myAnnotationsManager.appendProblems(myElement, createHolder(), this.getClass());
+        return new ProblemDescriptor[0];
+      }
+
+      @Override
+      public void checkFileElement(final DomFileElement fileElement, final DomElementAnnotationHolder holder) {
+      }
+    };
+    HighlightDisplayKey.register(inspection.getShortName());
+    myInspectionProfile.setInspectionTools(inspection);
+
+    myAnnotationsManager.appendProblems(myElement, createHolder(), MockAnnotatingDomInspection.class);
+    assertEquals(DomHighlightStatus.ANNOTATORS_FINISHED, myAnnotationsManager.getHighlightStatus(myElement));
+
+    myAnnotationsManager.appendProblems(myElement, createHolder(), inspection.getClass());
+    assertEquals(DomHighlightStatus.INSPECTIONS_FINISHED, myAnnotationsManager.getHighlightStatus(myElement));
+  }
+
+  public void testHighlightStatus_OtherInspections2() throws Throwable {
+    myElement.setFileDescription(new DomFileDescription(DomElement.class, "a"));
+    final MyDomElementsInspection inspection = new MyDomElementsInspection() {
+
+      @Override
+      public ProblemDescriptor[] checkFile(@NotNull final PsiFile file, @NotNull final InspectionManager manager,
+                                           final boolean isOnTheFly) {
+        myAnnotationsManager.appendProblems(myElement, createHolder(), this.getClass());
+        return new ProblemDescriptor[0];
+      }
+
+      @Override
+      public void checkFileElement(final DomFileElement fileElement, final DomElementAnnotationHolder holder) {
+      }
+    };
+    HighlightDisplayKey.register(inspection.getShortName());
+    myInspectionProfile.setInspectionTools(inspection);
+    myInspectionProfile.setEnabled(inspection, false);
+
+    myAnnotationsManager.appendProblems(myElement, createHolder(), MockAnnotatingDomInspection.class);
+    assertEquals(DomHighlightStatus.INSPECTIONS_FINISHED, myAnnotationsManager.getHighlightStatus(myElement));
+  }
+
+  public void testRequiredAttributeWithoutAttributeValue() throws Throwable {
+    final MyElement element = createElement("<a id />", MyElement.class);
+    new MyBasicDomElementsInspection().checkDomElement(element.getId(), createHolder(), DomHighlightingHelperImpl.INSTANCE);
+  }
+
+  private class MyDomElementsInspection extends DomElementsInspection {
+    public MyDomElementsInspection() {
+      super(DomElement.class);
+    }
+
+    @Override
+    @NotNull
+    public String getGroupDisplayName() {
+      throw new UnsupportedOperationException("Method getGroupDisplayName is not yet implemented in " + getClass().getName());
+    }
+
+    @Override
+    @NotNull
+    public String getDisplayName() {
+      throw new UnsupportedOperationException("Method getDisplayName is not yet implemented in " + getClass().getName());
+    }
+
+    @Override
+    @NotNull
+    public String getShortName() {
+      return "xxx";
+    }
+  }
+
+  private class MyBasicDomElementsInspection extends BasicDomElementsInspection {
+    public MyBasicDomElementsInspection() {
+      super(DomElement.class);
+    }
+
+    @Override
+    @NotNull
+    public String getGroupDisplayName() {
+      throw new UnsupportedOperationException("Method getGroupDisplayName is not yet implemented in " + getClass().getName());
+    }
+
+    @Override
+    @NotNull
+    public String getDisplayName() {
+      throw new UnsupportedOperationException("Method getDisplayName is not yet implemented in " + getClass().getName());
+    }
+
+    @Override
+    protected void checkDomElement(final DomElement element, final DomElementAnnotationHolder holder, final DomHighlightingHelper helper) {
+      super.checkDomElement(element, holder, helper);
+    }
+
+    @Override
+    @NotNull
+    public String getShortName() {
+      return "xxx";
+    }
+  }
+
+
+  private static class MyNonHighlightingDomFileDescription extends DomFileDescription {
+    public MyNonHighlightingDomFileDescription() {
+      super(DomElement.class, "a");
+    }
+
+    @Override
+    public boolean isAutomaticHighlightingEnabled() {
+      return false;
+    }
+  }
+
+  public interface MyElement extends DomElement {
+    @Convert(soft=true, value=JvmPsiTypeConverter.class)
+    @Required GenericAttributeValue<PsiType> getId();
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomIncludesTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomIncludesTest.java
new file mode 100644
index 0000000..20e19b8
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomIncludesTest.java
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 2000-2005 by JetBrains s.r.o. All Rights Reserved.
+ * Use is subject to license terms.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.codeInsight.navigation.actions.GotoDeclarationAction;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.pom.PomTargetPsiElement;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.testFramework.Timings;
+import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase;
+import com.intellij.util.Consumer;
+import com.intellij.util.xml.impl.DomFileElementImpl;
+import com.intellij.util.xml.impl.DomManagerImpl;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ * @author peter
+ */
+public class DomIncludesTest extends JavaCodeInsightFixtureTestCase {
+
+  public void testGetChildrenHonorsIncludes() throws Throwable {
+    final MyElement rootElement = createDomFile("a.xml", "<root xmlns:xi=\"http://www.w3.org/2001/XInclude\">" +
+                            "<xi:include href=\"b.xml\" xpointer=\"xpointer(/xxx/*)\"/>" +
+                            "<child xxx=\"a\"/>" +
+                            "</root>");
+    createFile("b.xml", "<xxx><child xxx=\"b\"/></xxx>");
+    final List<DomIncludesTest.Child> children = rootElement.getChildren();
+    Consumer<MyElement> consumer1 = new Consumer<MyElement>() {
+      @Override
+      public void consume(final MyElement element) {
+        assertFalse(element.getXmlElement().isPhysical());
+        assertEquals(rootElement, element.getParent());
+        assertEquals(DomUtil.getFileElement(rootElement), DomUtil.getFileElement(element));
+        assertEquals("b", element.getXxx().getValue());
+      }
+    };
+    Consumer<MyElement> consumer2 = new Consumer<MyElement>() {
+      @Override
+      public void consume(final MyElement element) {
+        assertTrue(element.getXmlElement().isPhysical());
+        assertEquals(rootElement, element.getParent());
+        assertEquals(DomUtil.getFileElement(rootElement), DomUtil.getFileElement(element));
+        assertEquals("a", element.getXxx().getValue());
+      }
+    };
+    assertOrderedCollection(children, new Consumer[] { consumer1, consumer2 });
+  }
+
+  public void testNamespaces() throws Throwable {
+    final MyElement rootElement = createDomFile("a.xml", "<root xmlns:xi=\"http://www.w3.org/2001/XInclude\" xmlns:foo=\"foo\">" +
+                            "<xi:include href=\"b.xml\" xpointer=\"xpointer(/xxx/*)\"/>" +
+                            "<foo:boy xxx=\"a\"/>" +
+                            "</root>");
+    DomUtil.getFileElement(rootElement).getFileDescription().registerNamespacePolicy("foo", "foo");
+
+    createFile("b.xml", "<xxx xmlns:foo=\"foo\"><foo:boy xxx=\"b\"/></xxx>");
+    final List<Boy> children = rootElement.getBoys();
+    assertOrderedCollection(children, new Consumer<Boy>() {
+      @Override
+      public void consume(final Boy element) {
+        assertFalse(element.getXmlElement().isPhysical());
+        assertEquals(rootElement, element.getParent());
+        assertEquals(DomUtil.getFileElement(rootElement), DomUtil.getFileElement(element));
+        assertEquals("b", element.getXxx().getValue());
+      }
+    }, new Consumer<Boy>() {
+      @Override
+      public void consume(final Boy element) {
+        assertTrue(element.getXmlElement().isPhysical());
+        assertEquals(rootElement, element.getParent());
+        assertEquals(DomUtil.getFileElement(rootElement), DomUtil.getFileElement(element));
+        assertEquals("a", element.getXxx().getValue());
+      }
+    });
+  }
+
+  public void testEqualsWithMultiThreadedIncludes() throws Throwable {
+    final MyElement rootElement = createDomFile("a.xml", "<root xmlns:xi=\"http://www.w3.org/2001/XInclude\">" +
+                            "<xi:include href=\"b.xml\" xpointer=\"xpointer(/xxx/*)\"/>" +
+                            "</root>");
+
+    final PsiFile fileB = createFile("b.xml",
+                                    "<xxx><boy/><xi:include href=\"c.xml\" xpointer=\"xpointer(/xxx/*)\"/><child/><xi:include href=\"c.xml\" xpointer=\"xpointer(/xxx/*)\"/></xxx>");
+    final PsiFile fileC = createFile("c.xml",
+                                    "<xxx><child/><xi:include href=\"d.xml\" xpointer=\"xpointer(/xxx/*)\"/><boy/><xi:include href=\"d.xml\" xpointer=\"xpointer(/xxx/*)\"/></xxx>");
+    final PsiFile fileD = createFile("d.xml",
+                                    "<xxx><boy/><xi:include href=\"e.xml\" xpointer=\"xpointer(/xxx/*)\"/><child/><xi:include href=\"e.xml\" xpointer=\"xpointer(/xxx/*)\"/></xxx>");
+    final PsiFile fileE = createFile("e.xml",
+                                    "<xxx><boy/><child/><boy/><child/><boy/><child/><boy/><child/><boy/><child/><boy/><child/></xxx>");
+    final int threadCount = 100;
+    final int iterationCount = Timings.adjustAccordingToMySpeed(800, true);
+    System.out.println("iterationCount = " + iterationCount);
+
+    final CountDownLatch finished = new CountDownLatch(threadCount);
+    final AtomicReference<Exception> ex = new AtomicReference<Exception>();
+
+    Thread[] threads = new Thread[threadCount];
+    for (int j = 0; j < threadCount; j++) {
+      Thread thread = new Thread() {
+        @Override
+        public void run() {
+          for (int k = 0; k < iterationCount; k++) {
+            ApplicationManager.getApplication().runReadAction(new Runnable() {
+              public void run() {
+                try {
+                  final List<Boy> boys = rootElement.getBoys();
+                  Thread.yield();
+                  final List<Child> children = rootElement.getChildren();
+                  Thread.yield();
+                  assertEquals(boys, rootElement.getBoys());
+                  assertEquals(children, rootElement.getChildren());
+                }
+                catch (Exception e) {
+                  ex.set(e);
+                }
+                finally {
+                  finished.countDown();
+                }
+              }
+            });
+            Thread.yield();
+          }
+        }
+      };
+      threads[j] = thread;
+      thread.start();
+    }
+
+    for (int i = 0; i < iterationCount; i++) {
+      ApplicationManager.getApplication().runWriteAction(new Runnable() {
+        public void run() {
+          fileB.getViewProvider().getDocument().insertString(0, " ");
+          fileD.getViewProvider().getDocument().insertString(0, " ");
+          PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); //clear xinclude caches
+        }
+      });
+      Thread.sleep(10);
+      ApplicationManager.getApplication().runWriteAction(new Runnable() {
+        public void run() {
+          fileC.getViewProvider().getDocument().insertString(0, " ");
+          fileE.getViewProvider().getDocument().insertString(0, " ");
+          PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); //clear xinclude caches
+        }
+      });
+      Thread.sleep(10);
+    }
+
+    finished.await();
+    for (Thread thread : threads) {
+      thread.join();
+    }
+    final Exception exception = ex.get();
+    if (exception != null) {
+      throw exception;
+    }
+  }
+
+  public void testNavigationToIncluded() throws Throwable {
+    final MyElement rootElement = createDomFile("a.xml", "<root xmlns:xi=\"http://www.w3.org/2001/XInclude\">" +
+                            "<xi:include href=\"b.xml\" xpointer=\"xpointer(/xxx/*)\"/>" +
+                            "<child ref=\"b\"/>" +
+                            "</root>");
+    final XmlFile includedFile = (XmlFile) createFile("b.xml", "<xxx><child xxx=\"b\"/></xxx>");
+    final List<Child> children = rootElement.getChildren();
+    final MyElement domTarget = children.get(0);
+    final GenericAttributeValue<Child> ref = children.get(1).getRef();
+    final MyElement value = ref.getValue();
+    assertEquals(domTarget, value);
+
+    myFixture.configureFromTempProjectFile("a.xml");
+
+    final int offset = ref.getXmlAttributeValue().getTextRange().getStartOffset() + 1;
+    myFixture.getEditor().getCaretModel().moveToOffset(offset);
+    final PsiElement target = GotoDeclarationAction.findTargetElement(getProject(), myFixture.getEditor(), offset);
+    PsiElement element = ((DomTarget)((PomTargetPsiElement)target).getTarget()).getNavigationElement();
+//    assertSame(PomService.convertToPsi(DomTarget.getTarget(domTarget)), target);
+    assertSame(includedFile.getDocument().getRootTag().getSubTags()[0].getAttributes()[0].getValueElement(), element);
+  }
+
+  private MyElement createDomFile(final String fileName, final String fileText) throws IOException {
+    final XmlFile xmlFile = (XmlFile) createFile(fileName, fileText);
+    final DomFileElementImpl<MyElement> element = getDomManager().getFileElement(xmlFile, MyElement.class, xmlFile.getDocument().getRootTag().getName());
+    return element.getRootElement();
+  }
+
+  private PsiFile createFile(final String fileName, final String fileText) throws IOException {
+    final VirtualFile file = myFixture.getTempDirFixture().createFile(fileName);
+    VfsUtil.saveText(file, fileText);
+    return getPsiManager().findFile(file);
+  }
+
+  private DomManagerImpl getDomManager() {
+    return DomManagerImpl.getDomManager(getProject());
+  }
+
+  public interface MyElement extends DomElement {
+
+    List<Child> getChildren();
+
+    List<Boy> getBoys();
+
+    @NameValue
+    GenericAttributeValue<String> getXxx();
+
+    GenericAttributeValue<Child> getRef();
+
+  }
+
+  @Namespace("foo")
+  public interface Boy extends MyElement {
+
+  }
+
+  public interface Child extends MyElement {
+
+  }
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomModelMergingTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomModelMergingTest.java
new file mode 100644
index 0000000..6dc47ed
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomModelMergingTest.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.command.WriteCommandAction;
+
+import java.util.*;
+
+/**
+ * @author peter
+ */
+public class DomModelMergingTest extends DomTestCase{
+  private ModelMerger myMerger;
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+    myMerger = new ModelMergerImpl();
+  }
+
+  public void testVisitor() throws Throwable {
+    final MyElement element1 = createElement("", MyElement.class);
+    final MyElement foo1 = element1.getFoo();
+    final MyElement bar1 = element1.addBar();
+    final MyElement bar2 = element1.addBar();
+
+    final MyElement element2 = createElement("", MyElement.class);
+    final MyElement foo2 = element2.getFoo();
+    final MyElement bar3 = element2.addBar();
+
+    final MyElement element = myMerger.mergeModels(MyElement.class, element1, element2);
+    final MyElement foo = element.getFoo();
+    assertEquals(foo, myMerger.mergeModels(MyElement.class, foo1, foo2));
+
+    final int[] count = new int[]{0};
+    element.accept(new DomElementVisitor() {
+      @Override
+      public void visitDomElement(DomElement _element) {
+        count[0]++;
+        assertEquals(_element, element);
+      }
+    });
+    assertEquals(1, count[0]);
+
+    count[0] = 0;
+    final Set<DomElement> result = new HashSet<DomElement>();
+    element.acceptChildren(new DomElementVisitor() {
+      @Override
+      public void visitDomElement(DomElement element) {
+        count[0]++;
+        result.add(element);
+      }
+    });
+    assertEquals(new HashSet(Arrays.asList(foo, bar1, bar2, bar3)).toString().replace(",", "\n"), result.toString().replace(",", "\n"));
+    assertEquals(new HashSet(Arrays.asList(foo, bar1, bar2, bar3)), result);
+    assertEquals(4, count[0]);
+  }
+
+  public void testValidity() throws Throwable {
+    new WriteCommandAction.Simple(getProject()) {
+      @Override
+      protected void run() throws Throwable {
+        final MyElement element = createElement("", MyElement.class);
+        final MyElement bar1 = element.addBar();
+        final MyElement bar2 = element.addBar();
+        final MyElement merged = myMerger.mergeModels(MyElement.class, bar1, bar2);
+        assertTrue(merged.isValid());
+        bar2.undefine();
+        assertFalse(merged.isValid());
+      }
+    }.execute().throwException();
+  }
+
+  public interface MyElement extends DomElement {
+    MyElement getFoo();
+    List<MyElement> getBars();
+    MyElement addBar();
+  }
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomNamespacesTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomNamespacesTest.java
new file mode 100644
index 0000000..9c24fa5
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomNamespacesTest.java
@@ -0,0 +1,354 @@
+/*
+ * Copyright (c) 2000-2005 by JetBrains s.r.o. All Rights Reserved.
+ * Use is subject to license terms.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.impl.DomFileElementImpl;
+import com.intellij.util.xml.reflect.DomGenericInfo;
+
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class DomNamespacesTest extends DomTestCase {
+
+  public void testUseExistingNamespace() throws Throwable {
+    final MyElement element = createElement("<a xmlns=\"foo\" xmlns:bar=\"bar\"/>", MyElement.class);
+    registerNamespacePolicies(element);
+
+    final XmlTag fooChildTag = element.getFooChild().ensureTagExists();
+    assertEquals("foo-child", fooChildTag.getName());
+    assertEquals("foo", fooChildTag.getNamespace());
+    assertEquals("", fooChildTag.getNamespacePrefix());
+
+    final XmlTag barChildTag = element.getBarChild().ensureTagExists();
+    assertEquals("bar:bar-child", barChildTag.getName());
+    assertEquals("bar", barChildTag.getNamespace());
+    assertEquals("bar", barChildTag.getNamespacePrefix());
+  }
+
+  public void testDefineNewNamespace() throws Throwable {
+    final MyElement element = createElement("<a/>", MyElement.class);
+    registerNamespacePolicies(element);
+
+    final XmlTag fooChildTag = element.getFooChild().ensureTagExists();
+    assertEquals("foo-child", fooChildTag.getName());
+    assertEquals("foo", fooChildTag.getNamespace());
+    assertEquals("", fooChildTag.getNamespacePrefix());
+    assertEquals("foo", fooChildTag.getAttributeValue("xmlns"));
+
+    final XmlTag barChildTag = element.getBarChild().ensureTagExists();
+    assertEquals("bar-child", barChildTag.getName());
+    assertEquals("bar", barChildTag.getNamespace());
+    assertEquals("", barChildTag.getNamespacePrefix());
+    assertEquals("bar", barChildTag.getAttributeValue("xmlns"));
+  }
+
+  public void testCollectionChildNamespace() throws Throwable {
+    final MyElement element = createElement("<a xmlns:foo=\"foo\"/>", MyElement.class);
+    registerNamespacePolicies(element);
+
+    final XmlTag fooChildTag = element.addFooElement().getXmlTag();
+    assertEquals("foo:foo-element", fooChildTag.getName());
+    assertEquals("foo", fooChildTag.getNamespace());
+    assertEquals("foo", fooChildTag.getNamespacePrefix());
+    assertNull(fooChildTag.getAttributeValue("xmlns"));
+  }
+
+  public void testNoNamespaceForFixedChild() throws Throwable {
+    final MyElement element = createElement("<a xmlns:foo=\"foo\"/>", MyElement.class);
+    registerNamespacePolicies(element);
+
+    final XmlTag childTag = element.getSomeChild().ensureTagExists();
+    assertEquals("some-child", childTag.getName());
+    assertEquals("", childTag.getNamespace());
+    assertEquals("", childTag.getNamespacePrefix());
+    assertNull(childTag.getAttributeValue("xmlns"));
+  }
+
+  public void testNoNamespaceForCollectionChild() throws Throwable {
+    final MyElement element = createElement("<a xmlns:foo=\"foo\"/>", MyElement.class);
+    registerNamespacePolicies(element);
+
+    final XmlTag childTag = element.addChild().getXmlTag();
+    assertEquals("child", childTag.getName());
+    assertEquals("", childTag.getNamespace());
+    assertEquals("", childTag.getNamespacePrefix());
+    assertNull(childTag.getAttributeValue("xmlns"));
+  }
+
+  public void testNamespaceEqualToParent() throws Throwable {
+    final MyElement element = createElement("<a xmlns=\"foo\"/>", MyElement.class);
+    registerNamespacePolicies(element);
+
+    final XmlTag childTag = element.addChild().getXmlTag();
+    assertEquals("child", childTag.getName());
+    assertEquals("foo", childTag.getNamespace());
+    assertEquals("", childTag.getNamespacePrefix());
+    assertNull(childTag.getAttributeValue("xmlns"));
+  }
+
+  public void testNamespaceEqualToParent2() throws Throwable {
+    final MyElement root = createElement("<a xmlns=\"foo\"/>", MyElement.class);
+    registerNamespacePolicies(root);
+    final MyFooElement element = root.addFooElement();
+
+    final MyElement child = element.addChild();
+    final XmlTag childTag = child.getXmlTag();
+    assertEquals("child", childTag.getName());
+    assertEquals("foo", childTag.getNamespace());
+    assertEquals("", childTag.getNamespacePrefix());
+    assertNull(childTag.getAttributeValue("xmlns"));
+
+    assertEquals("foo", element.getXmlElementNamespaceKey());
+    assertNull(child.getXmlElementNamespaceKey());
+  }
+
+  public void testHardcodedNamespacePrefix() throws Throwable {
+    final XmlFile xmlFile = createXmlFile("<a xmlns:sys=\"\"/>");
+    final MyElement element = getDomManager().getFileElement(xmlFile, MyElement.class, "a").getRootElement();
+    final MyElement hardcodedElement = element.getHardcodedElement();
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        hardcodedElement.ensureTagExists();
+      }
+    }.execute();
+    assertTrue(element.isValid());
+    assertTrue(hardcodedElement.isValid());
+    assertNotNull(hardcodedElement.getXmlElement());
+    assertEquals("<sys:aaa/>", hardcodedElement.getXmlElement().getText());
+    assertEquals("sys:aaa", hardcodedElement.getXmlTag().getName());
+
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        hardcodedElement.getHardcodedElement().getHardcodedElement().ensureTagExists();
+      }
+    }.execute();
+
+    assertTrue(element.isValid());
+    assertTrue(hardcodedElement.isValid());
+    assertNotNull(hardcodedElement.getXmlElement());
+    assertEquals("sys:aaa", hardcodedElement.getHardcodedElement().getHardcodedElement().getXmlTag().getName());
+
+    assertEquals(1, element.getXmlTag().getSubTags().length);
+  }
+
+  public void testAutoChooseNamespaceIfPresent() throws Throwable {
+    final MyElement root = createElement("<a xmlns=\"foo\"/>", MyElement.class);
+    getDomManager().getDomFileDescription(root.getXmlElement()).registerNamespacePolicy("foo", "bar", "foo");
+
+    final XmlTag fooChildTag = root.getFooChild().ensureTagExists();
+    assertEquals("foo-child", fooChildTag.getName());
+    assertEquals("foo", fooChildTag.getNamespace());
+    assertEquals("", fooChildTag.getNamespacePrefix());
+    assertEquals(0, fooChildTag.getAttributes().length);
+  }
+
+  public void testNonemptyRootTagPrefix() throws Throwable {
+    getDomManager().registerFileDescription(new DomFileDescription<MyFooElement>(MyFooElement.class, "a", "foons") {
+
+      @Override
+      protected void initializeFileDescription() {
+        super.initializeFileDescription();
+        registerNamespacePolicy("foo", "foons");
+      }
+    }, getTestRootDisposable());
+
+    final XmlFile psiFile = createXmlFile("<f:a xmlns:f=\"foons\"/>");
+    final DomFileElementImpl<MyFooElement> element = getDomManager().getFileElement(psiFile, MyFooElement.class);
+    assertNotNull(element);
+
+    final MyFooElement root = element.getRootElement();
+    assertNotNull(root);
+    assertSame(psiFile.getDocument().getRootTag(), root.getXmlElement());
+  }
+
+  public void testSpringAopLike() throws Throwable {
+    getDomManager().registerFileDescription(new DomFileDescription<MyBeans>(MyBeans.class, "beans", "beans", "aop") {
+
+      @Override
+      protected void initializeFileDescription() {
+        super.initializeFileDescription();
+        registerNamespacePolicy("beans", "beans");
+        registerNamespacePolicy("aop", "aop");
+      }
+    }, getTestRootDisposable());
+
+    final XmlFile psiFile = createXmlFile("<beans xmlns=\"beans\" xmlns:aop=\"aop\">" +
+                                          "<aop:config>" +
+                                          "<aop:pointcut/>" +
+                                          "</aop:config>" +
+                                          "</beans>");
+    final MyBeans beans = getDomManager().getFileElement(psiFile, MyBeans.class).getRootElement();
+    final DomElement pointcut =
+      getDomManager().getDomElement(beans.getXmlTag().findFirstSubTag("aop:config").findFirstSubTag("aop:pointcut"));
+    assertNotNull(pointcut);
+    final MyAopConfig aopConfig = beans.getConfig();
+    assertEquals(assertOneElement(aopConfig.getPointcuts()), pointcut);
+  }
+
+  public void testSpringUtilLike() throws Throwable {
+    getDomManager().registerFileDescription(new DomFileDescription<MyBeans>(MyBeans.class, "beans", "beans", "util") {
+
+      @Override
+      protected void initializeFileDescription() {
+        super.initializeFileDescription();
+        registerNamespacePolicy("beans", "beans");
+        registerNamespacePolicy("util", "util");
+      }
+    }, getTestRootDisposable());
+
+    final XmlFile psiFile = createXmlFile("<beans xmlns=\"beans\" xmlns:util=\"util\">" +
+                                          "<util:list>" +
+                                          "<ref>aaa</ref>" +
+                                          "<util:child>bbb</util:child>" +
+                                          "</util:list></beans>");
+
+    final MyList listOrSet = assertInstanceOf(getDomManager().getFileElement(psiFile, MyBeans.class).getRootElement().getList(), MyList.class);
+    assertNotNull(listOrSet.getXmlTag());
+
+    final XmlTag listTag = psiFile.getDocument().getRootTag().findFirstSubTag("util:list");
+    assertNotNull(getDomManager().getDomElement(listTag.findFirstSubTag("ref")));
+    assertNotNull(getDomManager().getDomElement(listTag.findFirstSubTag("util:child")));
+
+    assertEquals("aaa", listOrSet.getRef().getValue());
+    assertEquals("bbb", listOrSet.getChild().getValue());
+  }
+
+  private void registerNamespacePolicies(final MyElement element) {
+    registerNamespacePolicies(element, "foo", "bar");
+  }
+
+  private void registerNamespacePolicies(final MyElement element, final String foo, final String bar) {
+    final DomFileDescription description = getDomManager().getDomFileDescription(element.getXmlElement());
+    description.registerNamespacePolicy("foo", foo);
+    description.registerNamespacePolicy("bar", bar);
+  }
+
+  public void testFindChildDescriptionWithoutNamespace() throws Throwable {
+    final DomGenericInfo info = getDomManager().getGenericInfo(MyListOrSet.class);
+    assertNotNull(info.getAttributeChildDescription("attr"));
+    assertNotNull(info.getAttributeChildDescription("attr").getType());
+    assertNotNull(info.getCollectionChildDescription("child"));
+    assertNotNull(info.getCollectionChildDescription("child").getType());
+    assertNotNull(info.getFixedChildDescription("ref"));
+    assertNotNull(info.getFixedChildDescription("ref").getType());
+  }
+
+  public void testCopyFromHonorsNamespaces() throws Throwable {
+    final MyElement element = createElement("<a xmlns=\"foo\" xmlns:bar=\"bar\"/>", MyElement.class);
+    registerNamespacePolicies(element);
+
+    final MyElement element2 = createElement("<f:a xmlns:f=\"foo1\" xmlns:b=\"bar1\" xmlns=\"foo1\">" +
+                                             "<foo-child/>" +
+                                             "<b:bar-child/>" +
+                                             "<f:some-child/>" +
+                                             "<f:foo-element attr-2=\"239\" attr=\"42\"/>" +
+                                             "<f:foo-element/>" +
+                                             "<f:bool/>" +
+                                             "<sys:aaa/>" +
+                                             "</f:a>", MyElement.class);
+    registerNamespacePolicies(element2, "foo1", "bar1");
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        element.copyFrom(element2);
+      }
+    }.execute();
+
+    assertEquals("<a xmlns=\"foo\" xmlns:bar=\"bar\">" +
+                 "<bar:bar-child/>" +
+                 "<bool/>" +
+                 "<foo-child/>" +
+                 "<some-child/>" +
+                 "<sys:aaa/>" +
+                 "<foo-element attr=\"42\" attr-2=\"239\"/>" +
+                 "<foo-element/>" +
+                 "</a>",
+                 element.getXmlTag().getText());
+  }
+
+  public void testAttributeWithAnotherNamespace() throws Throwable {
+    final MyElement element = createElement("<a xmlns=\"foo\" xmlns:bar=\"bar\"><foo-child bar:my-attribute=\"xxx\"/></a>", MyElement.class);
+    registerNamespacePolicies(element);
+    final MyFooElement fooElement = element.getFooChild();
+    final MyAttribute myAttribute = fooElement.getMyAttribute();
+    assertNotNull(myAttribute.getXmlAttribute());
+    assertEquals("xxx", myAttribute.getStringValue());
+  }
+
+  public interface MyElement extends DomElement {
+    MyFooElement getFooChild();
+    MyBarElement getBarChild();
+
+    MyElement getSomeChild();
+
+    List<MyFooElement> getFooElements();
+    MyFooElement addFooElement();
+
+    List<MyElement> getChildren();
+    MyElement addChild();
+
+    GenericAttributeValue<String> getAttr();
+    GenericAttributeValue<String> getAttr2();
+
+    @SubTag(indicator = true)
+    GenericDomValue<Boolean> getBool();
+
+    @SubTag("sys:aaa")
+    MyElement getHardcodedElement();
+  }
+
+  @Namespace("foo")
+  public interface MyFooElement extends MyElement {
+    MyAttribute getMyAttribute();
+  }
+
+  @Namespace("bar")
+  public interface MyBarElement extends MyElement {
+
+  }
+
+  @Namespace("bar")
+  public interface MyAttribute extends GenericAttributeValue<String> {
+
+  }
+
+  @Namespace("beans")
+  public interface MyBeans extends DomElement {
+    MyAopConfig getConfig();
+    MyList getList();
+  }
+
+  @Namespace("aop")
+  public interface MyAopConfig extends DomElement {
+    List<MySpringPointcut> getPointcuts();
+  }
+
+  @Namespace("aop")
+  public interface MySpringPointcut extends DomElement {
+
+  }
+
+  @Namespace("beans")
+  public interface MyListOrSet extends DomElement {
+    GenericDomValue<String> getRef();
+    List<GenericDomValue<String>> getChildren();
+    GenericAttributeValue<String> getAttr();
+  }
+
+  @Namespace("util")
+  public interface MyList extends MyListOrSet {
+    GenericDomValue<String> getChild();
+  }
+
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomPerformanceTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomPerformanceTest.java
new file mode 100644
index 0000000..6e6b15b
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomPerformanceTest.java
@@ -0,0 +1,196 @@
+/*
+ * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
+                                                    */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.impl.PsiManagerImpl;
+import com.intellij.psi.impl.meta.MetaRegistry;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.testFramework.PlatformTestUtil;
+import com.intellij.util.ThrowableRunnable;
+import com.intellij.xml.impl.dtd.XmlNSDescriptorImpl;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.BufferedWriter;
+import java.io.OutputStreamWriter;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class DomPerformanceTest extends DomHardCoreTestCase{
+
+  public void testVisitorPerformance() throws Throwable {
+    final MyElement element = createElement("<root xmlns=\"adsf\" targetNamespace=\"adsf\"/>", MyElement.class);
+
+    MetaRegistry.bindDataToElement(DomUtil.getFile(element).getDocument(), new XmlNSDescriptorImpl());
+
+    final MyElement child = element.addChildElement();
+    child.getAttr().setValue("239");
+    child.getChild239().getAttr().setValue("42");
+    child.getChild().getAttr().setValue("42xx");
+    child.getChild2().getAttr().setValue("42yy");
+    child.addChildElement().getChild().addFooChild().getAttr().setValue("xxx");
+    child.addChildElement().addFooChild().getAttr().setValue("yyy");
+    child.addChildElement().addFooChild().addBarChild().addBarChild().addChildElement().getChild().getAttr().setValue("xxx");
+    child.addChildElement().addBarComposite().setValue("ssss");
+    child.addBarChild().getChild2().getAttr().setValue("234178956023");
+
+    PlatformTestUtil.startPerformanceTest(getTestName(false), 80000, new ThrowableRunnable() {
+      @Override
+      public void run() throws Exception {
+        for (int i = 0; i < 239; i++) {
+          element.addChildElement().copyFrom(child);
+        }
+      }
+    }).cpuBound().attempts(1).assertTiming();
+
+    final MyElement newElement = createElement(DomUtil.getFile(element).getText(), MyElement.class);
+
+    PlatformTestUtil.startPerformanceTest(getTestName(false), 200, new ThrowableRunnable() {
+      @Override
+      public void run() throws Exception {
+        newElement.acceptChildren(new DomElementVisitor() {
+          @Override
+          public void visitDomElement(DomElement element) {
+            element.acceptChildren(this);
+          }
+        });
+
+      }
+    }).cpuBound().assertTiming();
+  }
+
+  public void testShouldntParseNonDomFiles() throws Throwable {
+    for (int i = 0; i < 420; i++) {
+      getDomManager().registerFileDescription(new DomFileDescription(MyChildElement.class, "foo") {
+
+        @Override
+        public boolean isMyFile(@NotNull final XmlFile file, final Module module) {
+          fail();
+          return super.isMyFile(file, module);
+        }
+      }, getTestRootDisposable());
+      getDomManager().registerFileDescription(new DomFileDescription(MyChildElement.class, "bar") {
+
+        @Override
+        public boolean isMyFile(@NotNull final XmlFile file, final Module module) {
+          fail();
+          return super.isMyFile(file, module);
+        }
+      }, getTestRootDisposable());
+    }
+
+    getDomManager().createMockElement(MyChildElement.class, null, true);
+
+    @NotNull final VirtualFile virtualFile = createFile("a.xml", "").getVirtualFile();
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+
+        final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(virtualFile.getOutputStream(this)));
+        writer.write("<root>\n");
+        for (int i = 0; i < 23942; i++) {
+          writer.write("<bar/>\n");
+        }
+        writer.write("</root>");
+        writer.close();
+        virtualFile.refresh(false, false);
+      }
+    }.execute();
+
+    ((PsiManagerImpl)getPsiManager()).getFileManager().cleanupForNextTest();
+    final XmlFile file = (XmlFile)getPsiManager().findFile(virtualFile);
+    assertFalse(file.getNode().isParsed());
+    assertTrue(StringUtil.isNotEmpty(file.getText()));
+    PlatformTestUtil.startPerformanceTest("", 100, new ThrowableRunnable() {
+      @Override
+      public void run() throws Exception {
+        assertNull(getDomManager().getFileElement(file));
+      }
+    }).cpuBound().assertTiming();
+  }
+
+  public void testDontParseNamespacedDomFiles() throws Exception {
+    getDomManager().registerFileDescription(new DomFileDescription(MyNamespacedElement.class, "foo") {
+      @Override
+      protected void initializeFileDescription() {
+        registerNamespacePolicy("project", "project");
+      }
+    }, getTestRootDisposable());
+
+    XmlFile file = (XmlFile)createFile("a.xml", "<foo xmlns=\"project\"/>");
+    assertFalse(file.getNode().isParsed());
+    assertNotNull(DomManager.getDomManager(getProject()).getFileElement(file, MyNamespacedElement.class));
+
+    file = (XmlFile)createFile("a.xml", "<foo xmlns=\"project2\"/>");
+    assertFalse(file.getNode().isParsed());
+    assertNull(DomManager.getDomManager(getProject()).getFileElement(file, MyNamespacedElement.class));
+  }
+
+  @Namespace("project")
+  public interface MyNamespacedElement extends DomElement {
+
+  }
+  public interface MyChildElement extends DomElement {
+    @Attribute
+    @Required
+    GenericAttributeValue<String> getAttr();
+
+    List<MyFooConcreteElement> getFooChildren();
+
+    MyFooConcreteElement addFooChild();
+  }
+
+  public interface MyElement extends DomElement {
+    @Attribute
+    @Required
+    GenericAttributeValue<String> getAttr();
+
+    String getValue();
+
+    void setValue(String s);
+
+    MyChildElement getChild();
+
+    @SubTag(value = "child", index = 1)
+    MyChildElement getChild2();
+
+    MyChildElement getChild239();
+
+    List<MyElement> getChildElements();
+
+    MyElement addChildElement();
+
+    List<MyAbstractElement> getAbstractElements();
+
+    @SubTagList("abstract-element")
+    MyBarConcreteElement addBarChild();
+
+    @SubTagList("abstract-element")
+    MyFooConcreteElement addFooChild();
+
+    @SubTagsList({"child-element", "abstract-element"})
+    List<MyElement> getCompositeList();
+
+    @SubTagsList(value = {"child-element", "abstract-element"}, tagName = "abstract-element")
+    MyBarConcreteElement addBarComposite();
+
+  }
+
+  public interface MyAbstractElement extends MyElement {
+  }
+
+  public interface MyFooConcreteElement extends MyAbstractElement {
+  }
+
+  public interface MyBarConcreteElement extends MyAbstractElement {
+  }
+
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomReferenceInjectorTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomReferenceInjectorTest.java
new file mode 100644
index 0000000..cc0cb5b
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomReferenceInjectorTest.java
@@ -0,0 +1,456 @@
+package com.intellij.util.xml;
+
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.*;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.search.SearchScope;
+import com.intellij.psi.scope.PsiScopeProcessor;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.lang.Language;
+import com.intellij.lang.ASTNode;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NonNls;
+
+import javax.swing.*;
+
+public class DomReferenceInjectorTest extends DomHardCoreTestCase {
+  public void testBasic() throws Exception {
+    MyElement element = createElement("<a><value>abc${prop}def</value></a>", MyElement.class);
+    assertEquals("abc${prop}def", element.getValue().getStringValue());
+    assertEquals("abc${prop}def", element.getValue().getValue());
+  }
+
+  public void testWithInjector() throws Exception {
+    MyElement element = createElement("<a><value>abc${prop}def</value></a>", MyElement.class);
+
+    registerInjectorFor(element, null);
+
+    assertEquals("abcFOOdef", element.getValue().getStringValue());
+    assertEquals("abcFOOdef", element.getValue().getValue());
+  }
+
+  public void testCorrectlyCalculateOffsetWithInjector() throws Exception {
+    MyElement element = createElement("<a><value>   abc${prop}def   </value></a>", MyElement.class);
+
+    registerInjectorFor(element, null);
+
+    assertEquals("abcFOOdef", element.getValue().getStringValue());
+    assertEquals("abcFOOdef", element.getValue().getValue());
+  }
+
+  public void testWithInjectorAndConverter() throws Exception {
+    MyElement element = createElement("<a><converted-value>abc${prop}def</converted-value></a>", MyElement.class);
+
+    registerInjectorFor(element, null);
+
+    assertEquals("abcFOOdef", element.getConvertedValue().getStringValue());
+    assertEquals("abcBARdef", element.getConvertedValue().getValue());
+  }
+
+  public void testReference() throws Exception {
+    String text = "<a><value>abc${prop}def</value></a>";
+    MyElement element = createElement(text, MyElement.class);
+
+    MyPsiElement targetElement = new MyPsiElement();
+    registerInjectorFor(element, targetElement);
+
+    assertEquals("abcFOOdef", element.getValue().getStringValue());
+    assertEquals("abcFOOdef", element.getValue().getValue());
+    
+    assertReference(element.getValue(), targetElement, text.indexOf("${prop}") + 1);
+  }
+
+  public void testAttribute() throws Exception {
+    String text = "<a attr=\"abc${prop}def\"/>";
+    MyElement element = createElement(text, MyElement.class);
+
+    MyPsiElement targetElement = new MyPsiElement();
+    registerInjectorFor(element, targetElement);
+
+    assertEquals("abcFOOdef", element.getAttr().getStringValue());
+    assertEquals("abcFOOdef", element.getAttr().getValue());
+
+    assertReference(element.getAttr(), targetElement, text.indexOf("${prop}") + 1);
+  }
+
+  private void registerInjectorFor(DomElement element, PsiElement targetElement) {
+    DomUtil.getFileElement(element).getFileDescription().registerReferenceInjector(new MyInjector(targetElement));
+  }
+
+  public interface MyElement extends DomElement {
+    GenericDomValue<String> getValue();
+
+    @Convert(MyConverter.class)
+    GenericDomValue<String> getConvertedValue();
+
+    GenericAttributeValue<String> getAttr();
+  }
+
+  public static class MyConverter extends Converter<String> {
+    @Override
+    public String fromString(@Nullable @NonNls String s, ConvertContext context) {
+      return s == null ? null : s.replaceAll("FOO", "BAR");
+    }
+
+    @Override
+    public String toString(@Nullable String s, ConvertContext context) {
+      return s;
+    }
+  }
+
+  public static class MyPsiElement implements PsiElement {
+    @Override
+    @NotNull
+    public Project getProject() throws PsiInvalidElementAccessException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    @NotNull
+    public Language getLanguage() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiManager getManager() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    @NotNull
+    public PsiElement[] getChildren() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement getParent() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement getFirstChild() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement getLastChild() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement getNextSibling() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement getPrevSibling() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiFile getContainingFile() throws PsiInvalidElementAccessException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public TextRange getTextRange() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int getStartOffsetInParent() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int getTextLength() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement findElementAt(int offset) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiReference findReferenceAt(int offset) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int getTextOffset() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public String getText() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    @NotNull
+    public char[] textToCharArray() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement getNavigationElement() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement getOriginalElement() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean textMatches(@NotNull @NonNls CharSequence text) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean textMatches(@NotNull PsiElement element) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean textContains(char c) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void accept(@NotNull PsiElementVisitor visitor) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void acceptChildren(@NotNull PsiElementVisitor visitor) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement copy() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement add(@NotNull PsiElement element) throws IncorrectOperationException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement addBefore(@NotNull PsiElement element, PsiElement anchor) throws IncorrectOperationException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement addAfter(@NotNull PsiElement element, PsiElement anchor) throws IncorrectOperationException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void checkAdd(@NotNull PsiElement element) throws IncorrectOperationException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement addRange(PsiElement first, PsiElement last) throws IncorrectOperationException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement addRangeBefore(@NotNull PsiElement first, @NotNull PsiElement last, PsiElement anchor)
+      throws IncorrectOperationException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement addRangeAfter(PsiElement first, PsiElement last, PsiElement anchor) throws IncorrectOperationException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void delete() throws IncorrectOperationException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void checkDelete() throws IncorrectOperationException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void deleteChildRange(PsiElement first, PsiElement last) throws IncorrectOperationException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement replace(@NotNull PsiElement newElement) throws IncorrectOperationException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean isValid() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean isWritable() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiReference getReference() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    @NotNull
+    public PsiReference[] getReferences() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public <T> T getCopyableUserData(Key<T> key) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public <T> void putCopyableUserData(Key<T> key, T value) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean processDeclarations(@NotNull PsiScopeProcessor processor,
+                                       @NotNull ResolveState state,
+                                       @Nullable PsiElement lastParent,
+                                       @NotNull PsiElement place) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PsiElement getContext() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean isPhysical() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    @NotNull
+    public GlobalSearchScope getResolveScope() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    @NotNull
+    public SearchScope getUseScope() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ASTNode getNode() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean isEquivalentTo(PsiElement another) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public <T> T getUserData(@NotNull Key<T> key) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public <T> void putUserData(@NotNull Key<T> key, @Nullable T value) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Icon getIcon(int flags) {
+      throw new UnsupportedOperationException();
+    }
+  }
+
+  private static class MyInjector implements DomReferenceInjector {
+    private final PsiElement myMyTargetElement;
+
+    public MyInjector(PsiElement myTargetElement) {
+      myMyTargetElement = myTargetElement;
+    }
+
+    @Override
+    public String resolveString(@Nullable String unresolvedText, @NotNull ConvertContext context) {
+      return unresolvedText == null ? null : unresolvedText.replaceAll("\\$\\{prop\\}", "FOO");
+    }
+
+    @Override
+    @NotNull
+    public PsiReference[] inject(@Nullable String unresolvedText, @NotNull final PsiElement element, @NotNull ConvertContext context) {
+      final String prop = "${prop}";
+      int index = unresolvedText == null ? -1 : unresolvedText.indexOf(prop);
+      if (index == -1) return PsiReference.EMPTY_ARRAY;
+
+      TextRange textRange = ElementManipulators.getValueTextRange(element);
+      final TextRange refRange = TextRange.from(textRange.getStartOffset() + index, prop.length());
+
+      return new PsiReference[] {
+        new PsiReference() {
+          @Override
+          public PsiElement getElement() {
+            return element;
+          }
+
+          @Override
+          public TextRange getRangeInElement() {
+            return refRange;
+          }
+
+          @Override
+          public PsiElement resolve() {
+            return myMyTargetElement;
+          }
+
+          @Override
+          @NotNull
+          public String getCanonicalText() {
+            return prop;
+          }
+
+          @Override
+          public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
+            return null;
+          }
+
+          @Override
+          public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+            return null;
+          }
+
+          @Override
+          public boolean isReferenceTo(PsiElement element) {
+            return false;
+          }
+
+          @Override
+          @NotNull
+          public Object[] getVariants() {
+            return EMPTY_ARRAY;
+          }
+
+          @Override
+          public boolean isSoft() {
+            return true;
+          }
+        }
+      };
+    }
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomReferencesTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomReferencesTest.java
new file mode 100644
index 0000000..1dae0c7
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomReferencesTest.java
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.*;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagValue;
+import com.intellij.util.xml.impl.GenericDomValueReference;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.*;
+
+/**
+ * @author peter
+ */
+public class DomReferencesTest extends DomHardCoreTestCase {
+
+  public void testMetaData() throws Throwable {
+    final MyElement element = createElement("");
+    element.getName().setValue("A");
+    final XmlTag tag = element.getXmlTag();
+    final DomMetaData metaData = assertInstanceOf(tag.getMetaData(), DomMetaData.class);
+    assertEquals(tag, metaData.getDeclaration());
+    assertOrderedEquals(metaData.getDependences(), DomUtil.getFileElement(element), tag);
+    assertEquals("A", metaData.getName());
+    assertEquals("A", metaData.getName(null));
+
+    metaData.setName("B");
+    assertEquals("B", element.getName().getValue());
+  }
+
+  public void testNameReference() throws Throwable {
+    final MyElement element = createElement("<a><name>abc</name></a>");
+    final DomTarget target = DomTarget.getTarget(element);
+    assertNotNull(target);
+    final XmlTag tag = element.getName().getXmlTag();
+    assertNull(tag.getContainingFile().findReferenceAt(tag.getValue().getTextRange().getStartOffset()));
+  }
+
+  public void testProcessingInstruction() throws Throwable {
+    createElement("<a><?xml version=\"1.0\"?></a>").getXmlTag().accept(new PsiRecursiveElementVisitor() {
+      @Override public void visitElement(PsiElement element) {
+        super.visitElement(element);
+        for (final PsiReference reference : element.getReferences()) {
+          assertFalse(reference instanceof GenericDomValueReference);
+        }
+      }
+    });
+  }
+
+  public void testBooleanReference() throws Throwable {
+    final MyElement element = createElement("<a><boolean>true</boolean></a>");
+    assertVariants(assertReference(element.getBoolean()), "false", "true");
+  }
+
+  public void testBooleanAttributeReference() throws Throwable {
+    final MyElement element = createElement("<a boolean-attribute=\"true\"/>");
+    final PsiReference reference = getReference(element.getBooleanAttribute());
+    assertVariants(reference, "false", "true");
+
+    final XmlAttributeValue xmlAttributeValue = element.getBooleanAttribute().getXmlAttributeValue();
+    final PsiElement psiElement = reference.getElement();
+    assertEquals(xmlAttributeValue, psiElement);
+
+    assertEquals(new TextRange(0, "true".length()).shiftRight(1), reference.getRangeInElement());
+  }
+
+  public void testEnumReference() throws Throwable {
+    assertVariants(assertReference(createElement("<a><enum>239</enum></a>").getEnum(), null), "A", "B", "C");
+    assertVariants(assertReference(createElement("<a><enum>A</enum></a>").getEnum()), "A", "B", "C");
+  }
+
+  public void testPsiClass() throws Throwable {
+    final MyElement element = createElement("<a><psi-class>java.lang.String</psi-class></a>");
+    assertReference(element.getPsiClass(), PsiType.getJavaLangString(getPsiManager(), GlobalSearchScope.allScope(getProject())).resolve(),
+                    element.getPsiClass().getXmlTag().getValue().getTextRange().getEndOffset() - 1);
+  }
+
+  public void testPsiType() throws Throwable {
+    final MyElement element = createElement("<a><psi-type>java.lang.String</psi-type></a>");
+    assertReference(element.getPsiType(), PsiType.getJavaLangString(getPsiManager(), GlobalSearchScope.allScope(getProject())).resolve());
+  }
+
+  public void testIndentedPsiType() throws Throwable {
+    final MyElement element = createElement("<a><psi-type>  java.lang.Strin   </psi-type></a>");
+    final PsiReference psiReference = assertReference(element.getPsiType(), null);
+    assertEquals(new TextRange(22, 22 + "Strin".length()), psiReference.getRangeInElement());
+  }
+
+  public void testPsiPrimitiveType() throws Throwable {
+    final MyElement element = createElement("<a><psi-type>int</psi-type></a>");
+    assertReference(element.getPsiType());
+  }
+  
+  public void testPsiPrimitiveTypeArray() throws Throwable {
+    final MyElement element = createElement("<a><psi-type>int[]</psi-type></a>");
+    final GenericDomValue value = element.getPsiType();
+    final XmlTagValue tagValue = value.getXmlTag().getValue();
+    final int i = tagValue.getText().indexOf(value.getStringValue());
+    assertReference(value, value.getXmlTag(), tagValue.getTextRange().getStartOffset() + i + "int".length());
+  }
+
+  public void testPsiUnknownType() throws Throwable {
+    final MyElement element = createElement("<a><psi-type>#$^%*$</psi-type></a>");
+    assertReference(element.getPsiType(), null);
+  }
+
+  public void testPsiArrayType() throws Throwable {
+    final MyElement element = createElement("<a><psi-type>java.lang.String[]</psi-type></a>");
+    final XmlTag tag = element.getPsiType().getXmlTag();
+    final TextRange valueRange = tag.getValue().getTextRange();
+    final PsiReference reference = tag.getContainingFile().findReferenceAt(valueRange.getStartOffset() + "java.lang.".length());
+    assertNotNull(reference);
+    assertEquals(PsiType.getJavaLangString(getPsiManager(), GlobalSearchScope.allScope(getProject())).resolve(), reference.resolve());
+    assertEquals("<psi-type>java.lang.".length(), reference.getRangeInElement().getStartOffset());
+    assertEquals("String".length(), reference.getRangeInElement().getLength());
+  }
+
+  public void testJvmArrayType() throws Throwable {
+    final MyElement element = createElement("<a><jvm-psi-type>[Ljava.lang.String;</jvm-psi-type></a>");
+    final XmlTag tag = element.getJvmPsiType().getXmlTag();
+    final TextRange valueRange = tag.getValue().getTextRange();
+    final PsiReference reference = tag.getContainingFile().findReferenceAt(valueRange.getEndOffset() - 1);
+    assertNotNull(reference);
+    assertEquals(PsiType.getJavaLangString(getPsiManager(), GlobalSearchScope.allScope(getProject())).resolve(), reference.resolve());
+    assertEquals("<jvm-psi-type>[Ljava.lang.".length(), reference.getRangeInElement().getStartOffset());
+    assertEquals("String".length(), reference.getRangeInElement().getLength());
+  }
+
+  public void testCustomResolving() throws Throwable {
+    final MyElement element = createElement("<a><string-buffer>239</string-buffer></a>");
+    assertVariants(assertReference(element.getStringBuffer()), "239", "42", "foo", "zzz");
+  }
+
+  public void testAdditionalValues() throws Throwable {
+    final MyElement element = createElement("<a><string-buffer>zzz</string-buffer></a>");
+    final XmlTag tag = element.getStringBuffer().getXmlTag();
+    assertTrue(tag.getContainingFile().findReferenceAt(tag.getValue().getTextRange().getStartOffset()).isSoft());
+  }
+
+  public interface MyElement extends DomElement {
+    GenericDomValue<Boolean> getBoolean();
+
+    GenericAttributeValue<Boolean> getBooleanAttribute();
+
+    @Convert(MyStringConverter.class)
+    GenericDomValue<String> getConvertedString();
+
+    GenericDomValue<MyEnum> getEnum();
+
+    @NameValue GenericDomValue<String> getName();
+
+    GenericDomValue<PsiClass> getPsiClass();
+
+    GenericDomValue<PsiType> getPsiType();
+
+    @Convert(JvmPsiTypeConverter.class)
+    GenericDomValue<PsiType> getJvmPsiType();
+
+    List<GenericDomValue<MyEnum>> getEnumChildren();
+
+    @Convert(MyStringBufferConverter.class)
+    GenericDomValue<StringBuffer> getStringBuffer();
+
+    MyAbstractElement getChild();
+
+    MyElement getRecursiveChild();
+
+    List<MyGenericValue> getMyGenericValues();
+
+    MyGenericValue getMyAnotherGenericValue();
+  }
+
+  @Convert(MyStringConverter.class)
+  public interface MyGenericValue extends GenericDomValue<String> {
+
+  }
+
+  public interface MySomeInterface {
+    GenericValue<PsiType> getFoo();
+  }
+
+  public interface MyAbstractElement extends DomElement {
+    GenericAttributeValue<String> getFubar239();
+    GenericAttributeValue<Runnable> getFubar();
+  }
+
+  public interface MyFooElement extends MyAbstractElement, MySomeInterface {
+    @Override
+    GenericDomValue<PsiType> getFoo();
+
+    GenericAttributeValue<Set> getFubar2();
+  }
+
+  public interface MyBarElement extends MyAbstractElement {
+    GenericDomValue<StringBuffer> getBar();
+  }
+
+
+  public enum MyEnum {
+    A,B,C
+  }
+
+  public static class MyStringConverter extends ResolvingConverter<String> {
+
+    @Override
+    @NotNull
+    public Collection<? extends String> getVariants(final ConvertContext context) {
+      return Collections.emptyList();
+    }
+
+    @Override
+    public String fromString(final String s, final ConvertContext context) {
+      return s;
+    }
+
+    @Override
+    public String toString(final String s, final ConvertContext context) {
+      return s;
+    }
+  }
+
+  public static class MyStringBufferConverter extends ResolvingConverter<StringBuffer> {
+
+    @Override
+    public StringBuffer fromString(final String s, final ConvertContext context) {
+      return s == null ? null : new StringBuffer(s);
+    }
+
+    @Override
+    public String toString(final StringBuffer t, final ConvertContext context) {
+      return t == null ? null : t.toString();
+    }
+
+    @Override
+    public Collection<? extends StringBuffer> getVariants(final ConvertContext context) {
+      return Arrays.asList(new StringBuffer("239"), new StringBuffer("42"), new StringBuffer("foo"));
+    }
+
+    @Override
+    public Set<String> getAdditionalVariants() {
+      return Collections.singleton("zzz");
+    }
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomSaxParserTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomSaxParserTest.java
new file mode 100644
index 0000000..93c5e11
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomSaxParserTest.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2000-2005 by JetBrains s.r.o. All Rights Reserved.
+ * Use is subject to license terms.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiFileFactory;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
+import org.jetbrains.annotations.Nullable;
+import org.xml.sax.SAXException;
+
+import java.io.IOException;
+
+/**
+ * @author peter
+ */
+public class DomSaxParserTest extends LightCodeInsightFixtureTestCase {
+
+  public void testGetRootTagNameWithoutNamespace() throws Throwable {
+    assertData("<root>", "root", null, null, null);
+  }
+
+  public void testGetRootTagNameWithNamespaceWithEmptyPrefix() throws Throwable {
+    assertData("<root xmlns=\"foo\">", "root", "foo", null, null);
+  }
+
+  public void testGetRootTagNameWithUnfinishedAttribute() throws Throwable {
+    XmlFile file = createXmlFile("<root xmlns=\"foo\" aaa>");
+    ensureParsed(file);
+    final XmlFileHeader header = DomService.getInstance().getXmlFileHeader(file);
+    assertEquals(new XmlFileHeader("root", "foo", null, null), header);
+  }
+
+  public void testGetRootTagNameWithNamespaceWithNonEmptyPrefix() throws Throwable {
+    assertData("<bar:root xmlns=\"foo\" xmlns:bar=\"b\">", "root", "b", null, null);
+  }
+
+  public void testGetRootTagNameWithDtdNamespace() throws Throwable {
+    assertData("<!DOCTYPE ejb-jar PUBLIC\n" +
+               "\"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN\"\n" +
+               "\"http://java.sun.com/dtd/ejb-jar_2_0.dtd\"><root>", "root", null, "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN", "http://java.sun.com/dtd/ejb-jar_2_0.dtd");
+  }
+
+  public void testGetRootTagNameWithDtdNamespace2() throws Throwable {
+    assertData("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+               "<!DOCTYPE ejb-jar PUBLIC\n" +
+               "\"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN\"\n" +
+               "\"http://java.sun.com/dtd/ejb-jar_2_0.dtd\"><root>", "root", null, "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN", "http://java.sun.com/dtd/ejb-jar_2_0.dtd");
+  }
+
+  public void testNoTag() throws Throwable {
+    assertData("aaaaaaaaaaaaaaaaaaaaa", null, null, null, null);
+  }
+
+  public void testEmptyFile() throws Throwable {
+    assertData("", null, null, null, null);
+  }
+
+  public void testInvalidContent() throws Throwable {
+    assertData("<?xmlmas8v6708986><OKHD POH:&*$%*&*I8yo9", null, null, null, null);
+  }
+
+  public void testInvalidContent2() throws Throwable {
+    assertData("?xmlmas8v6708986><OKHD POH:&*$%*&*I8yo9", null, null, null, null);
+  }
+
+  private static PsiElement ensureParsed(PsiFile file) {
+    return file.findElementAt(2);
+  }
+
+  public void testInvalidContent3() throws Throwable {
+    assertData("<?xmlmas8v67089", null, null, null, null);
+  }
+
+  public void testSubtag() throws Throwable {
+    assertData("<root><foo/>", "root", null, null, null);
+  }
+
+  public void testSpring() throws Throwable {
+    assertData("<?xml version=\"1.0\" encoding=\"gbk\"?>\n" + "\n" + "\n" +
+               "<beans xmlns=\"http://www.springframework.org/schema/beans\"\n" +
+               "       xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+               "       xmlns:aop=\"http://www.springframework.org/schema/aop\"\n" +
+               "       xmlns:tx=\"http://www.springframework.org/schema/tx\"\n" +
+               "       xsi:schemaLocation=\"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd\n" +
+               "           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd\n" +
+               "           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd\">\n" +
+               "</beans>", "beans", "http://www.springframework.org/schema/beans", null, null);
+  }
+
+  public void testInternalDtd() throws Throwable {
+    assertData("<?xml version=\"1.0\"?>\n" +
+               "<!DOCTYPE \n" + 
+               "        hibernate-mapping SYSTEM\n" +
+               "\t\t\t\"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\"\n" + "[\n" +
+               "<!ENTITY % globals SYSTEM \"classpath://auction/persistence/globals.dtd\">\n" + "%globals;\n" + "]><a/>", "a", null, null, "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd");
+  }
+
+  private void assertData(final String start, @Nullable final String localName, @Nullable String namespace, @Nullable String publicId, @Nullable String systemId) throws IOException, SAXException {
+    XmlFileHeader expected = new XmlFileHeader(localName, namespace, publicId, systemId);
+
+    XmlFile file = createXmlFile(start);
+    assert !file.getNode().isParsed();
+    assertEquals(expected, DomService.getInstance().getXmlFileHeader(file));
+
+    ensureParsed(file);
+    assert file.getNode().isParsed();
+    assertEquals(expected, DomService.getInstance().getXmlFileHeader(file));
+  }
+
+  private XmlFile createXmlFile(String text) {
+    return (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("a.xml", XMLLanguage.INSTANCE, text, false, false, false);
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomSimpleValuesTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomSimpleValuesTest.java
new file mode 100644
index 0000000..4fcdcf0
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomSimpleValuesTest.java
@@ -0,0 +1,539 @@
+package com.intellij.util.xml;
+
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.psi.*;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.events.DomEvent;
+import com.intellij.util.xml.ui.DomUIFactory;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class DomSimpleValuesTest extends DomTestCase {
+
+  private MyElement createElement(final String xml) throws IncorrectOperationException {
+    return createElement(xml, MyElement.class);
+  }
+
+  public void testGetValue() throws Throwable {
+    final String text = "<a>foo</a>";
+    assertEquals("foo", createElement(text).getTagValue());
+    assertEquals("foo", createElement(text).getValue());
+  }
+
+  public void testSetValue() throws Throwable {
+    final MyElement element = createElement("<a/>");
+    assertEquals("", element.getValue());
+    element.setValue(239);
+    assertEquals("239", element.getValue());
+    assertEquals("239", element.getXmlTag().getValue().getText());
+    myCallRegistry.putExpected(new DomEvent(element, false));
+
+    myCallRegistry.assertResultsAndClear();
+  }
+
+  public void testDefineAndSet() throws Throwable {
+    final MyElement element = getDomManager().getFileElement(createXmlFile(""), MyElement.class, "root").getRootElement();
+    myCallRegistry.clear();
+    assertNull(element.getXmlTag());
+    element.setValue(42);
+    assertNotNull(element.getXmlTag());
+    assertEquals("42", element.getXmlTag().getValue().getText());
+    final DomElement element1 = element;
+    myCallRegistry.putExpected(new DomEvent(element1, true));
+    myCallRegistry.putExpected(new DomEvent(element, false));
+
+    element.setValue((Integer)null);
+    assertNull(element.getXmlTag());
+    assertEquals(null, element.getValue());
+
+    myCallRegistry.putExpected(new DomEvent(element, false));
+    myCallRegistry.assertResultsAndClear();
+  }
+
+
+  public void testSimpleConverters() throws Throwable {
+    assertEquals(239, createElement("<a>239</a>").getInt());
+    assertEquals(true, createElement("<a>true</a>").getBoolean());
+    assertEquals("true", createElement("<a>true</a>").getBuffer().toString());
+
+    try {
+      createElement("<a>true</a>").getInt();
+      fail();
+    }
+    catch (NullPointerException e) {
+    }
+    try {
+      createElement("<a>42</a>").getBoolean();
+      fail();
+    }
+    catch (NullPointerException e) {
+    }
+  }
+
+  public void testComment() throws Throwable {
+    assertEquals(239, createElement("<a>" +
+                                    "  <!-- some comment-->" +
+                                    "  239" +
+                                    "  <!-- some another comment-->" +
+                                    "</a>").getInt());
+  }
+
+  public void testPsiClassConverter() throws Throwable {
+    final String className = Object.class.getName();
+    final PsiClass objectClass = getJavaFacade().findClass(className, GlobalSearchScope.allScope(getProject()));
+    assertEquals(objectClass, createElement("<a>" + className + "</a>").getPsiClass());
+
+    assertNull(createElement("<a>abcdef</a>").getPsiClass());
+  }
+
+  public void testEnums() throws Throwable {
+    final MyElement element = createElement("<a/>", MyElement.class);
+    assertNull(element.getEnum());
+
+    element.setEnum(DomTestCase.MyEnum.BAR);
+    assertEquals(DomTestCase.MyEnum.BAR, element.getEnum());
+    assertEquals(DomTestCase.MyEnum.BAR.getValue(), element.getXmlTag().getValue().getText());
+
+    element.setEnum(null);
+    assertNull(element.getEnum());
+    assertNull(element.getXmlTag());
+
+    element.setValue(239);
+    assertNull(element.getEnum());
+  }
+
+  public void testAttributeValues() throws Throwable {
+    final MyElement element = createElement("<a attra=\"foo\"/>");
+    final GenericAttributeValue<String> attributeValue = element.getAttributeValue();
+    assertEquals("attra", attributeValue.getXmlElementName());
+    assertEquals("foo", attributeValue.getValue());
+
+    final GenericAttributeValue<Integer> attr = element.getAttr();
+    attr.setValue(239);
+    assertEquals(239, (int)attr.getValue());
+    assertEquals("239", element.getXmlTag().getAttributeValue("attr"));
+    final DomElement element1 = attr;
+    myCallRegistry.putExpected(new DomEvent(element1, true));
+    myCallRegistry.assertResultsAndClear();
+
+    attr.setValue(42);
+    myCallRegistry.putExpected(new DomEvent(attr, false));
+    myCallRegistry.assertResultsAndClear();
+
+    attr.setValue(null);
+    assertNull(attr.getValue());
+    assertNull(element.getXmlTag().getAttributeValue("attr"));
+    assertNull(element.getXmlTag().getAttribute("attr", ""));
+    myCallRegistry.putExpected(new DomEvent(attr, false));
+    myCallRegistry.assertResultsAndClear();
+
+    assertEquals("some-attribute", element.getSomeAttribute().getXmlElementName());
+
+    assertNull(createElement("<a attra\"attr\"/>").getAttributeValue().getStringValue());
+    assertNull(createElement("<a attra\"\"/>").getAttributeValue().getStringValue());
+    assertNull(createElement("<a attra\"/>").getAttributeValue().getStringValue());
+  }
+
+  public void testGenericValue() throws Throwable {
+    final MyElement element = createElement("<a><generic-child>239</generic-child></a>");
+    final GenericDomValue<Integer> integerChild = element.getGenericChild();
+    assertEquals(239, (int)integerChild.getValue());
+    assertEquals("239", integerChild.getStringValue());
+    integerChild.setValue(42);
+    assertEquals(42, (int)integerChild.getValue());
+    assertEquals("42", integerChild.getStringValue());
+  }
+
+  public void testAnnotatedGenericValue() throws Throwable {
+    final MyElement element = createElement("<a><buffer>239</buffer></a>");
+    element.getGenericChild().getValue();
+    final GenericDomValue<StringBuffer> genericChild2 = element.getGenericChild2();
+    assertEquals("239", genericChild2.getValue().toString());
+  }
+
+  public void testSpecialCharacters() throws Throwable {
+    final MyElement element = createElement("");
+    element.setValue("<");
+    assertEquals("<", element.getValue());
+    assertEquals("<![CDATA[<]]>", element.getXmlTag().getValue().getText());
+
+    element.getAttributeValue().setValue("<");
+    assertEquals("<", element.getAttributeValue().getValue());
+    assertEquals("\"&lt;\"", element.getXmlTag().getAttribute("attra", null).getValueElement().getText());
+  }
+
+  public void testIndicators() throws Throwable {
+    final MyElement element = createElement("<a><indicator/></a>");
+    final GenericDomValue<Boolean> indicator = element.getIndicator();
+    assertTrue(indicator.getValue());
+
+    indicator.setValue(false);
+    assertFalse(indicator.getValue());
+    assertNull(indicator.getStringValue());
+    assertNull(indicator.getXmlTag());
+    assertEquals(0, element.getXmlTag().getSubTags().length);
+    putExpected(new DomEvent(indicator, false));
+    assertResultsAndClear();
+
+    indicator.setValue(true);
+    assertTrue(indicator.getValue());
+    assertEquals("", indicator.getStringValue());
+    assertSame(indicator.getXmlTag(), element.getXmlTag().getSubTags()[0]);
+    final DomElement element1 = indicator;
+    putExpected(new DomEvent(element1, true));
+    assertResultsAndClear();
+
+    final XmlTag tag = element.getXmlTag();
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        tag.add(createTag("<indicator/>"));
+        tag.add(createTag("<indicator/>"));
+      }
+    }.execute();
+
+    assertTrue(element.isValid());
+    assertTrue(element.getIndicator().getValue());
+    element.getIndicator().setValue(false);
+    assertFalse(element.getIndicator().getValue());
+    assertEquals(0, element.getXmlTag().findSubTags("indicator").length);
+  }
+
+  public void testConcreteGenericValue() throws Throwable {
+    final ConcreteGeneric generic = createElement("", ConcreteGeneric.class);
+    generic.setValue("abc");
+    assertEquals("abc", generic.getValue());
+
+    DomUIFactory.SET_VALUE_METHOD.invoke(generic, "def");
+    assertEquals("def", DomUIFactory.GET_VALUE_METHOD.invoke(generic));
+  }
+
+  public void testConcreteGenericValueWithMethods() throws Throwable {
+    final ConcreteGenericWithMethods generic = createElement("", ConcreteGenericWithMethods.class);
+    generic.setValue("abc");
+    assertEquals("abc", generic.getValue());
+
+    DomUIFactory.SET_VALUE_METHOD.invoke(generic, "def");
+    assertEquals("def", DomUIFactory.GET_VALUE_METHOD.invoke(generic));
+  }
+
+  public void testNameValueInPresentation() throws Throwable {
+    final MyElement element = createElement("");
+    element.getAttr().setValue(23942);
+    assertEquals("23942", element.getPresentation().getElementName());
+  }
+
+  public void testResolveToDomElement() throws Throwable {
+    final RootInterface element = createElement("", RootInterface.class);
+    final MyElement child1 = element.addChild();
+    child1.getAttr().setValue(555);
+    final MyElement child2 = element.addChild();
+    child2.getAttr().setValue(777);
+
+    final GenericDomValue<MyElement> resolve = child2.getResolve();
+    resolve.setStringValue("777");
+    assertEquals(child2, resolve.getValue());
+
+    resolve.setValue(child1);
+    assertEquals("555", resolve.getStringValue());
+    assertEquals(child1, resolve.getValue());
+
+    resolve.setStringValue("239");
+    assertNull(resolve.getValue());
+
+    final GenericDomValue<MyElement> resolve2 = child2.getResolve2();
+    resolve2.setStringValue("777");
+    assertEquals(child2, resolve2.getValue());
+  }
+
+  public void testPlainPsiTypeConverter() throws Throwable {
+    assertNull(createElement("").getPsiType());
+    assertSame(PsiType.INT, createElement("<a>int</a>").getPsiType());
+    final PsiType psiType = createElement("<a>java.lang.String</a>").getPsiType();
+    assertEquals(CommonClassNames.JAVA_LANG_STRING, assertInstanceOf(psiType, PsiClassType.class).getCanonicalText());
+
+    final PsiType arrayType = createElement("<a>int[]</a>").getPsiType();
+    assertTrue(arrayType instanceof PsiArrayType);
+    assertSame(PsiType.INT, ((PsiArrayType) arrayType).getComponentType());
+  }
+
+  public void testJvmPsiTypeConverter() throws Throwable {
+    assertNull(createElement("").getJvmPsiType());
+    assertNotNull(createElement("<a>int</a>").getJvmPsiType());
+    final PsiClassType string = PsiType.getJavaLangString(getPsiManager(), GlobalSearchScope.allScope(getProject()));
+    final PsiType psiType = createElement("<a>java.lang.String</a>").getJvmPsiType();
+    assertEquals(CommonClassNames.JAVA_LANG_STRING, assertInstanceOf(psiType, PsiClassType.class).getCanonicalText());
+
+    final PsiArrayType intArray = assertInstanceOf(createElement("<a>[I</a>").getJvmPsiType(), PsiArrayType.class);
+    final PsiArrayType stringArray = assertInstanceOf(createElement("<a>[Ljava.lang.String;</a>").getJvmPsiType(), PsiArrayType.class);
+    assertSame(PsiType.INT, intArray.getComponentType());
+    assertEquals(CommonClassNames.JAVA_LANG_STRING, assertInstanceOf(stringArray.getComponentType(), PsiClassType.class).getCanonicalText());
+
+    assertJvmPsiTypeToString(intArray, "[I");
+    assertJvmPsiTypeToString(stringArray, "[Ljava.lang.String;");
+    assertJvmPsiTypeToString(string, "java.lang.String");
+  }
+
+  public void testValueCaching() throws Throwable {
+    final GenericDomValue<String> element = createElement("<a><cached-value/></a>", MyElement.class).getCachedValue();
+    assertEquals(0, ((MyConverter) element.getConverter()).fromStringCalls);
+    assertEquals("", element.getValue());
+    assertEquals(1, ((MyConverter) element.getConverter()).fromStringCalls);
+    assertEquals("", element.getValue());
+    assertEquals(1, ((MyConverter) element.getConverter()).fromStringCalls);
+    element.setValue("1");
+    assertEquals(1, ((MyConverter) element.getConverter()).fromStringCalls);
+    assertEquals("1", element.getValue());
+    assertEquals(2, ((MyConverter) element.getConverter()).fromStringCalls);
+  }
+
+
+  private void assertJvmPsiTypeToString(final PsiType type, final String expected) throws IncorrectOperationException {
+    final MyElement element = createElement("");
+    element.setJvmPsiType(type);
+    assertEquals(expected, element.getValue());
+  }
+
+  public void testJavaStyledElement() throws IncorrectOperationException {
+    JavaStyledElement element = createElement("<tag javaStyledAttribute=\"666\"></tag>", JavaStyledElement.class);
+    assertEquals(element.getJavaStyledAttribute().getXmlElementName(), "javaStyledAttribute");
+  }
+
+  public void testGenericValueListConverter() throws Throwable {
+    final MyElement element = createElement("<a><string-buffer>abc</string-buffer></a>");
+    assertEquals("abc", element.getStringBuffers().get(0).getValue().toString());
+  }
+
+  public void testConvertAnnotationOnType() throws Throwable {
+    final MyElement element =
+      createElement("<a>" + "<my-generic-value>abc</my-generic-value>" + "<my-foo-generic-value>abc</my-foo-generic-value>" + "");
+    assertEquals("bar", element.getMyGenericValue().getValue());
+    assertEquals("foo", element.getMyFooGenericValue().getValue());
+  }
+  
+  public void testEntities() throws Throwable {
+    final MyElement element = createElement("<!DOCTYPE a SYSTEM \"aaa\"\n" +
+                                            "[<!ENTITY idgenerator    \"identity\">]>\n" +
+                                            "<a attra=\"a&lt;b\" some-attribute=\"&idgenerator;\">&xxx;+&idgenerator;+&amp;</a>");
+    assertEquals("a<b", element.getAttributeValue().getValue());
+    assertEquals("identity", element.getSomeAttribute().getValue());
+//    assertEquals("&xxx;+identity+&", element.getValue());
+  }
+
+  public interface RootInterface extends DomElement {
+    List<MyElement> getChildren();
+    MyElement addChild();
+  }
+
+
+  public interface MyElement extends DomElement {
+    @Attribute("attra")
+    GenericAttributeValue<String> getAttributeValue();
+
+    @NameValue
+    GenericAttributeValue<Integer> getAttr();
+
+    GenericAttributeValue<String> getSomeAttribute();
+
+    String getValue();
+
+    void setValue(Integer value);
+
+    @TagValue()
+    int getInt();
+
+    void setValue(String value);
+
+    @TagValue()
+    boolean getBoolean();
+
+    @TagValue()
+    PsiType getPsiType();
+
+    @Convert(JvmPsiTypeConverter.class)
+    @TagValue()
+    PsiType getJvmPsiType();
+
+    @TagValue()
+    @Convert(JvmPsiTypeConverter.class)
+    void setJvmPsiType(PsiType psiType);
+
+    @TagValue()
+    DomTestCase.MyEnum getEnum();
+
+    @TagValue
+    void setEnum(DomTestCase.MyEnum value);
+
+    @TagValue()
+    @Convert(StringBufferConverter.class)
+    StringBuffer getBuffer();
+
+    @TagValue()
+    PsiClass getPsiClass();
+
+    @TagValue()
+    String getTagValue();
+
+    GenericDomValue<Integer> getGenericChild();
+
+    @SubTag("buffer")
+    @Convert(StringBufferConverter.class)
+    GenericDomValue<StringBuffer> getGenericChild2();
+
+    @SubTag(indicator = true)
+    GenericDomValue<Boolean> getIndicator();
+
+    @Resolve(MyElement.class)
+    GenericDomValue<MyElement> getResolve();
+
+    GenericDomValue<MyElement> getResolve2();
+
+    @Convert(StringBufferConverter.class)
+    List<GenericDomValue<StringBuffer>> getStringBuffers();
+
+    @Convert(MyConverter.class) GenericDomValue<String> getCachedValue();
+
+    MyGenericValue getMyGenericValue();
+
+    @Convert(FooConverter.class)
+    MyGenericValue getMyFooGenericValue();
+
+  }
+
+  @Convert(BarConverter.class)
+  public interface MyGenericValue extends GenericDomValue<String> {
+  }
+
+  @NameStrategyForAttributes(JavaNameStrategy.class)
+  public interface JavaStyledElement extends DomElement {
+    GenericAttributeValue<String> getJavaStyledAttribute();
+  }
+
+  public interface ConcreteGeneric extends GenericDomValue<String> {
+  }
+
+  public interface ConcreteGenericWithMethods extends GenericDomValue<String> {
+    @Override
+    String getValue();
+
+    @Override
+    void setValue(String s);
+  }
+
+  public void testFuhrer() throws Throwable {
+    final FieldGroup group = createElement("<field-group>\n" +
+                                           "<group-name>myGroup</load-group-name>\n" +
+                                           "<field-name>myField1</field-name>\n" +
+                                           "<field-name>myField2</field-name>\n" +
+                                           "</field-group>",
+                                           FieldGroup.class);
+    assertEquals(2, group.getFieldNames().size());
+    assertEquals("myField1", group.getFieldNames().get(0).getValue().getName().getValue());
+    assertEquals(null, group.getFieldNames().get(1).getValue());
+  }
+
+  public interface JavaeeModelElement {
+  }
+
+  public interface JavaeeDomModelElement extends JavaeeModelElement, DomElement {
+}
+
+  public interface FieldGroup extends JavaeeDomModelElement {
+
+    GenericDomValue<String> getGroupName();
+
+    List<GroupField> getFieldNames();
+
+    GroupField addFieldName();
+  }
+
+  public interface GroupField extends JavaeeDomModelElement {
+
+    @Convert(value = CmpFieldConverter.class)
+    CmpField getValue();
+
+    @Convert(value = CmpFieldConverter.class)
+    void setValue(CmpField value);
+  }
+
+  public static class CmpFieldConverter extends ResolvingConverter<CmpField> {
+
+    @Override
+    public CmpField fromString(String s, ConvertContext context) {
+      return ElementPresentationManager.findByName(getVariants(context), s);
+    }
+
+    @Override
+    public String toString(CmpField t, ConvertContext context) {
+      return t == null ? null : t.getName().getValue();
+    }
+
+    @Override
+    @NotNull
+    public Collection<CmpField> getVariants(ConvertContext context) {
+      final DomElement element = context.getInvocationElement();
+      return Arrays.asList(createCmpField(null, element), createCmpField("myField1", element), createCmpField("def", element));
+    }
+
+    private CmpField createCmpField(String name, DomElement element) {
+      final CmpField mockElement = element.getManager().createMockElement(CmpField.class, element.getModule(), false);
+      mockElement.getName().setValue(name);
+      return mockElement;
+    }
+  }
+
+  public interface CmpField extends JavaeeDomModelElement {
+    @NameValue
+    public GenericDomValue<String> getName();
+  }
+
+  public static class MyConverter extends Converter<String> {
+    public int fromStringCalls = 0;
+
+    @Override
+    public String fromString(@Nullable @NonNls String s, final ConvertContext context) {
+      fromStringCalls++;
+      return s;
+    }
+
+    @Override
+    public String toString(@Nullable String s, final ConvertContext context) {
+      return s;
+    }
+  }
+
+  public static class FooConverter extends Converter<String> {
+    @Override
+    public String fromString(@Nullable @NonNls final String s, final ConvertContext context) {
+      return s == null ? null : "foo";
+    }
+
+    @Override
+    public String toString(@Nullable final String s, final ConvertContext context) {
+      return s;
+    }
+  }
+  public static class BarConverter extends Converter<String> {
+    @Override
+    public String fromString(@Nullable @NonNls final String s, final ConvertContext context) {
+      return s == null ? null : "bar";
+    }
+
+    @Override
+    public String toString(@Nullable final String s, final ConvertContext context) {
+      return s;
+    }
+  }
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomTestCase.java b/xml/dom-tests/tests/com/intellij/util/xml/DomTestCase.java
new file mode 100644
index 0000000..ce036c1
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomTestCase.java
@@ -0,0 +1,135 @@
+package com.intellij.util.xml;
+
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.psi.PsiFileFactory;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.impl.PsiModificationTrackerImpl;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.testFramework.LightIdeaTestCase;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.events.DomEvent;
+import com.intellij.util.xml.impl.DomApplicationComponent;
+import com.intellij.util.xml.impl.DomFileElementImpl;
+import com.intellij.util.xml.impl.DomInvocationHandler;
+import com.intellij.util.xml.impl.DomManagerImpl;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public abstract class DomTestCase extends LightIdeaTestCase {
+  protected CallRegistry<DomEvent> myCallRegistry;
+  private final DomEventListener myListener = new DomEventListener() {
+    @Override
+    public void eventOccured(DomEvent event) {
+      myCallRegistry.putActual(event);
+    }
+  };
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+    myCallRegistry = new CallRegistry<DomEvent>();
+    getDomManager().addDomEventListener(myListener, myTestRootDisposable);
+  }
+
+  @Override
+  protected void tearDown() throws Exception {
+    DomApplicationComponent.getInstance().clearCachesInTests();
+    super.tearDown();
+  }
+
+  protected void assertCached(final DomElement element, final XmlElement xmlElement) {
+    assertNotNull(xmlElement);
+    assertSame(element.getXmlTag(), xmlElement);
+    final DomInvocationHandler cachedElement = getCachedHandler(xmlElement);
+    assertNotNull(cachedElement);
+    assertEquals(element, cachedElement.getProxy());
+  }
+
+  protected void assertCached(final DomFileElementImpl element, final XmlFile file) {
+    assertNotNull(file);
+    assertEquals(element, getDomManager().getFileElement(file));
+  }
+
+  protected XmlTag createTag(final String text) throws IncorrectOperationException {
+    return XmlElementFactory.getInstance(getProject()).createTagFromText(text);
+  }
+
+  protected DomManagerImpl getDomManager() {
+    return (DomManagerImpl)DomManager.getDomManager(getProject());
+  }
+
+  protected static XmlFile createXmlFile(@NonNls final String text) throws IncorrectOperationException {
+    return (XmlFile)createLightFile("a.xml", text);
+  }
+
+
+  protected <T extends DomElement> T createElement(final String xml, final Class<T> aClass) throws IncorrectOperationException {
+    final DomManagerImpl domManager = getDomManager();
+    T element = createElement(domManager, xml, aClass);
+    myCallRegistry.clear();
+    return element;
+  }
+
+  protected static <T extends DomElement> T createElement(final DomManager domManager, final String xml, final Class<T> aClass)
+    throws IncorrectOperationException {
+    final String name = "a.xml";
+    final XmlFile file = (XmlFile)PsiFileFactory.getInstance(domManager.getProject()).createFileFromText(name, xml);
+    final XmlTag tag = file.getDocument().getRootTag();
+    final String rootTagName = tag != null ? tag.getName() : "root";
+    final T element = domManager.getFileElement(file, aClass, rootTagName).getRootElement();
+    assertNotNull(element);
+    assertSame(tag, element.getXmlTag());
+    return element;
+  }
+
+  protected void putExpected(final DomEvent event) {
+    myCallRegistry.putExpected(event);
+  }
+
+  protected void assertResultsAndClear() {
+    myCallRegistry.assertResultsAndClear();
+  }
+
+  protected TypeChooserManager getTypeChooserManager() {
+    return getDomManager().getTypeChooserManager();
+  }
+
+  protected static void incModCount() {
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        ((PsiModificationTrackerImpl)getPsiManager().getModificationTracker()).incCounter();
+      }
+    }.execute();
+  }
+
+  @Nullable
+  public DomInvocationHandler getCachedHandler(XmlElement element) {
+    final List<DomInvocationHandler> option = getDomManager().getSemService().getCachedSemElements(DomManagerImpl.DOM_HANDLER_KEY, element);
+    return option == null || option.isEmpty() ? null : option.get(0);
+  }
+
+  public enum MyEnum implements NamedEnum {
+    FOO("foo"),
+    BAR("bar");
+
+    private final String myName;
+
+    MyEnum(final String name) {
+      myName = name;
+    }
+
+    @Override
+    public String getValue() {
+      return myName;
+    }
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomVirtualFileEventsTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomVirtualFileEventsTest.java
new file mode 100644
index 0000000..5ceb27d
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/DomVirtualFileEventsTest.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.testFramework.PsiTestUtil;
+import com.intellij.util.xml.events.DomEvent;
+import com.intellij.util.xml.impl.DomFileElementImpl;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class DomVirtualFileEventsTest extends DomHardCoreTestCase{
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+    getDomManager().registerFileDescription(new DomFileDescription(MyElement.class, "a") {
+
+      @Override
+      public boolean isMyFile(@NotNull final XmlFile file, final Module module) {
+        return super.isMyFile(file, module) && file.getName().contains("a");
+      }
+    }, getTestRootDisposable());
+  }
+
+  public void testCreateFile() throws Throwable {
+    new WriteCommandAction.Simple(myProject) {
+      @Override
+      protected void run() throws Throwable {
+        final VirtualFile dir = getVirtualFile(createTempDirectory());
+        PsiTestUtil.addSourceContentToRoots(getModule(), dir);
+        final VirtualFile childData = dir.createChildData(this, "abc.xml");
+        System.gc();
+        System.gc();
+        System.gc();
+        System.gc();
+        assertResultsAndClear();
+        VfsUtil.saveText(childData, "<a/>");
+        assertEventCount(0);
+        assertResultsAndClear();
+      }
+    }.execute().throwException();
+  }
+
+  public void testDeleteFile() throws Throwable {
+    new WriteCommandAction.Simple(getProject()) {
+      @Override
+      protected void run() throws Throwable {
+        final VirtualFile dir = getVirtualFile(createTempDirectory());
+        PsiTestUtil.addSourceContentToRoots(getModule(), dir);
+        final VirtualFile childData = dir.createChildData(this, "abc.xml");
+        assertResultsAndClear();
+        VfsUtil.saveText(childData, "<a/>");
+        final DomFileElementImpl<DomElement> fileElement = getFileElement(childData);
+        assertResultsAndClear();
+
+        childData.delete(this);
+        assertEventCount(1);
+        putExpected(new DomEvent(fileElement, false));
+        assertResultsAndClear();
+        assertFalse(fileElement.isValid());
+      }
+    }.execute().throwException();
+  }
+
+  public void testRenameFile() throws Throwable {
+    new WriteCommandAction.Simple(getProject()) {
+      @Override
+      protected void run() throws Throwable {
+        final VirtualFile dir = getVirtualFile(createTempDirectory());
+        PsiTestUtil.addSourceContentToRoots(getModule(), dir);
+        final VirtualFile data = dir.createChildData(this, "abc.xml");
+        VfsUtil.saveText(data, "<a/>");
+        final DomFileElementImpl<DomElement> fileElement = getFileElement(data);
+        assertEventCount(0);
+        assertResultsAndClear();
+
+        data.rename(this, "deaf.xml");
+        assertEventCount(1);
+        putExpected(new DomEvent(fileElement, false));
+        assertResultsAndClear();
+        assertEquals(fileElement, getFileElement(data));
+        assertTrue(fileElement.isValid());
+
+        data.rename(this, "fff.xml");
+        assertEventCount(1);
+        putExpected(new DomEvent(fileElement, false));
+        assertResultsAndClear();
+        assertNull(getFileElement(data));
+        assertFalse(fileElement.isValid());
+      }
+    }.execute().throwException();
+  }
+
+  private DomFileElementImpl<DomElement> getFileElement(final VirtualFile file) {
+    return getDomManager().getFileElement((XmlFile)getPsiManager().findFile(file));
+  }
+
+  public interface MyElement extends DomElement {
+  }
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/MockDomElement.java b/xml/dom-tests/tests/com/intellij/util/xml/MockDomElement.java
new file mode 100644
index 0000000..d861ead
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/MockDomElement.java
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.util.UserDataHolderBase;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.reflect.DomGenericInfo;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+/**
+ * @author peter
+ */
+public class MockDomElement extends UserDataHolderBase implements DomElement{
+  @Override
+  @Nullable
+  public XmlTag getXmlTag() {
+    throw new UnsupportedOperationException("Method getXmlTag is not yet implemented in " + getClass().getName());
+  }
+
+  @NotNull
+  public <T extends DomElement> DomFileElement<T> getRoot() {
+    throw new UnsupportedOperationException("Method getRoot is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @Nullable
+  public DomElement getParent() {
+    throw new UnsupportedOperationException("Method getParent is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public XmlTag ensureTagExists() {
+    throw new UnsupportedOperationException("Method ensureTagExists is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @Nullable
+  public XmlElement getXmlElement() {
+    throw new UnsupportedOperationException("Method getXmlElement is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public XmlElement ensureXmlElementExists() {
+    throw new UnsupportedOperationException("Method ensureXmlElementExists is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public void undefine() {
+    throw new UnsupportedOperationException("Method undefine is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public boolean isValid() {
+    throw new UnsupportedOperationException("Method isValid is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public boolean exists() {
+    throw new UnsupportedOperationException("Method exists is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  public DomGenericInfo getGenericInfo() {
+    throw new UnsupportedOperationException("Method getGenericInfo is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  @NonNls
+  public String getXmlElementName() {
+    throw new UnsupportedOperationException("Method getXmlElementName is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  @NonNls
+  public String getXmlElementNamespace() {
+    throw new UnsupportedOperationException("Method getXmlElementNamespace is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @Nullable
+  @NonNls
+  public String getXmlElementNamespaceKey() {
+    throw new UnsupportedOperationException("Method getXmlElementNamespaceKey is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public void accept(final DomElementVisitor visitor) {
+    throw new UnsupportedOperationException("Method accept is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public void acceptChildren(DomElementVisitor visitor) {
+    throw new UnsupportedOperationException("Method acceptChildren is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  public DomManager getManager() {
+    throw new UnsupportedOperationException("Method getManager is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public Type getDomElementType() {
+    throw new UnsupportedOperationException("Method getDomElementType is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  public AbstractDomChildrenDescription getChildDescription() {
+    throw new UnsupportedOperationException("Method getChildDescription is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public DomNameStrategy getNameStrategy() {
+    throw new UnsupportedOperationException("Method getNameStrategy is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  public ElementPresentation getPresentation() {
+    throw new UnsupportedOperationException("Method getPresentation is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public GlobalSearchScope getResolveScope() {
+    throw new UnsupportedOperationException("Method getResolveScope is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @Nullable
+  public <T extends DomElement> T getParentOfType(Class<T> requiredClass, boolean strict) {
+    throw new UnsupportedOperationException("Method getParentOfType is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @Nullable
+  public Module getModule() {
+    throw new UnsupportedOperationException("Method getModule is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public void copyFrom(DomElement other) {
+    throw new UnsupportedOperationException("Method copyFrom is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public <T extends DomElement> T createMockCopy(final boolean physical) {
+    throw new UnsupportedOperationException("Method createMockCopy is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public <T extends DomElement> T createStableCopy() {
+    return (T)this;
+  }
+
+  @Override
+  @Nullable
+  public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+    throw new UnsupportedOperationException("Method getAnnotation is not yet implemented in " + getClass().getName());
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/MockDomFileElement.java b/xml/dom-tests/tests/com/intellij/util/xml/MockDomFileElement.java
new file mode 100644
index 0000000..b2bbb5f
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/MockDomFileElement.java
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.util.UserDataHolderBase;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.reflect.DomGenericInfo;
+import com.intellij.util.xml.reflect.AbstractDomChildrenDescription;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+/**
+ * @author peter
+ */
+public class MockDomFileElement extends UserDataHolderBase implements DomFileElement<DomElement>{
+  private long myModCount = 0;
+  private DomFileDescription myFileDescription;
+
+  public void setFileDescription(final DomFileDescription fileDescription) {
+    myFileDescription = fileDescription;
+  }
+
+  @Override
+  @NotNull
+  public XmlFile getFile() {
+    throw new UnsupportedOperationException("Method getFile is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  public XmlFile getOriginalFile() {
+    throw new UnsupportedOperationException("Method getOriginalFile is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public XmlTag getRootTag() {
+    throw new UnsupportedOperationException("Method getRootTag is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  public DomElement getRootElement() {
+    throw new UnsupportedOperationException("Method getRootElement is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public Class getRootElementClass() {
+    throw new UnsupportedOperationException("Method getRootElementType is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  public DomFileDescription getFileDescription() {
+    return myFileDescription;
+  }
+
+  @Override
+  @Nullable
+  public XmlTag getXmlTag() {
+    throw new UnsupportedOperationException("Method getXmlTag is not yet implemented in " + getClass().getName());
+  }
+
+  @NotNull
+  public <T extends DomElement> DomFileElement<T> getRoot() {
+    return (DomFileElement<T>)this;
+  }
+
+  @Override
+  @Nullable
+  public DomElement getParent() {
+    throw new UnsupportedOperationException("Method getParent is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public XmlTag ensureTagExists() {
+    throw new UnsupportedOperationException("Method ensureTagExists is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @Nullable
+  public XmlElement getXmlElement() {
+    throw new UnsupportedOperationException("Method getXmlElement is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public XmlElement ensureXmlElementExists() {
+    throw new UnsupportedOperationException("Method ensureXmlElementExists is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public void undefine() {
+    throw new UnsupportedOperationException("Method undefine is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public boolean isValid() {
+    throw new UnsupportedOperationException("Method isValid is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public boolean exists() {
+    throw new UnsupportedOperationException("Method exists is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  public DomGenericInfo getGenericInfo() {
+    throw new UnsupportedOperationException("Method getGenericInfo is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  @NonNls
+  public String getXmlElementName() {
+    throw new UnsupportedOperationException("Method getXmlElementName is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  @NonNls
+  public String getXmlElementNamespace() {
+    throw new UnsupportedOperationException("Method getXmlElementNamespace is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @Nullable
+  @NonNls
+  public String getXmlElementNamespaceKey() {
+    throw new UnsupportedOperationException("Method getXmlElementNamespaceKey is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public void accept(final DomElementVisitor visitor) {
+    throw new UnsupportedOperationException("Method accept is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public void acceptChildren(DomElementVisitor visitor) {
+  }
+
+  @Override
+  @NotNull
+  public DomManager getManager() {
+    throw new UnsupportedOperationException("Method getManager is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public Type getDomElementType() {
+    throw new UnsupportedOperationException("Method getDomElementType is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  public AbstractDomChildrenDescription getChildDescription() {
+    throw new UnsupportedOperationException("Method getChildDescription is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public DomNameStrategy getNameStrategy() {
+    throw new UnsupportedOperationException("Method getNameStrategy is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  public ElementPresentation getPresentation() {
+    throw new UnsupportedOperationException("Method getPresentation is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public GlobalSearchScope getResolveScope() {
+    throw new UnsupportedOperationException("Method getResolveScope is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @Nullable
+  public <T extends DomElement> T getParentOfType(Class<T> requiredClass, boolean strict) {
+    throw new UnsupportedOperationException("Method getParentOfType is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @Nullable
+  public Module getModule() {
+    throw new UnsupportedOperationException("Method getModule is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public void copyFrom(DomElement other) {
+    throw new UnsupportedOperationException("Method copyFrom is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public <T extends DomElement> T createMockCopy(final boolean physical) {
+    throw new UnsupportedOperationException("Method createMockCopy is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public <T extends DomElement> T createStableCopy() {
+    throw new UnsupportedOperationException("Method createStableCopy is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @Nullable
+  public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+    throw new UnsupportedOperationException("Method getAnnotation is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public long getModificationCount() {
+    return myModCount;
+  }
+
+  public void incModificationCount() {
+    myModCount++;
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/MockGenericAttributeValue.java b/xml/dom-tests/tests/com/intellij/util/xml/MockGenericAttributeValue.java
new file mode 100644
index 0000000..15b7a04
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/MockGenericAttributeValue.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2000-2007 JetBrains s.r.o. All Rights Reserved.
+ */
+package com.intellij.util.xml;
+
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class MockGenericAttributeValue extends MockDomElement implements GenericAttributeValue<Object> {
+  @Override
+  public XmlAttribute getXmlAttribute() {
+    throw new UnsupportedOperationException("Method getXmlAttribute is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public XmlAttributeValue getXmlAttributeValue() {
+    throw new UnsupportedOperationException("Method getXmlAttributeValue is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  @NotNull
+  public Converter getConverter() {
+    throw new UnsupportedOperationException("Method getConverter is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public void setStringValue(String value) {
+    throw new UnsupportedOperationException("Method setStringValue is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public void setValue(Object value) {
+    throw new UnsupportedOperationException("Method setValue is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public String getStringValue() {
+    throw new UnsupportedOperationException("Method getStringValue is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public String getRawText() {
+    throw new UnsupportedOperationException("Method getRawText is not yet implemented in " + getClass().getName());
+  }
+
+  @Override
+  public Object getValue() {
+    throw new UnsupportedOperationException("Method getValue is not yet implemented in " + getClass().getName());
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/NameStrategyTest.java b/xml/dom-tests/tests/com/intellij/util/xml/NameStrategyTest.java
new file mode 100644
index 0000000..fba2b08
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/NameStrategyTest.java
@@ -0,0 +1,44 @@
+package com.intellij.util.xml;
+
+import junit.framework.TestCase;
+
+/**
+ * @author peter
+ */
+public class NameStrategyTest extends TestCase {
+
+  public void testHyphenStrategy() throws Throwable {
+    assertEquals("aaa-bbb-ccc", DomNameStrategy.HYPHEN_STRATEGY.convertName("aaaBbbCcc"));
+    assertEquals("aaa-bbb-ccc", DomNameStrategy.HYPHEN_STRATEGY.convertName("AaaBbbCcc"));
+    assertEquals("aaa", DomNameStrategy.HYPHEN_STRATEGY.convertName("Aaa"));
+    assertEquals("aaa", DomNameStrategy.HYPHEN_STRATEGY.convertName("aaa"));
+    assertEquals("AAA-bbb", DomNameStrategy.HYPHEN_STRATEGY.convertName("AAABbb"));
+    assertEquals("aaa-BBB", DomNameStrategy.HYPHEN_STRATEGY.convertName("AaaBBB"));
+  }
+
+  public void testHyphenStrategySplit() throws Throwable {
+    assertEquals("aaa bbb ccc", DomNameStrategy.HYPHEN_STRATEGY.splitIntoWords("aaa-bbb-ccc"));
+    assertEquals("Aaa", DomNameStrategy.HYPHEN_STRATEGY.splitIntoWords("Aaa"));
+    assertEquals("aaa", DomNameStrategy.HYPHEN_STRATEGY.splitIntoWords("aaa"));
+    assertEquals("AAA bbb", DomNameStrategy.HYPHEN_STRATEGY.splitIntoWords("AAA-bbb"));
+    assertEquals("aaa BBB", DomNameStrategy.HYPHEN_STRATEGY.splitIntoWords("aaa-BBB"));
+  }
+
+  public void testJavaStrategy() throws Throwable {
+    assertEquals("aaaBbbCcc", DomNameStrategy.JAVA_STRATEGY.convertName("aaaBbbCcc"));
+    assertEquals("aaaBbbCcc", DomNameStrategy.JAVA_STRATEGY.convertName("AaaBbbCcc"));
+    assertEquals("aaa", DomNameStrategy.JAVA_STRATEGY.convertName("Aaa"));
+    assertEquals("aaa", DomNameStrategy.JAVA_STRATEGY.convertName("aaa"));
+    assertEquals("AAABbb", DomNameStrategy.JAVA_STRATEGY.convertName("AAABbb"));
+    assertEquals("aaaBBB", DomNameStrategy.JAVA_STRATEGY.convertName("AaaBBB"));
+  }
+
+  public void testJavaStrategySplit() throws Throwable {
+    assertEquals("aaa bbb ccc", DomNameStrategy.JAVA_STRATEGY.splitIntoWords("aaaBbbCcc"));
+    assertEquals("aaa", DomNameStrategy.JAVA_STRATEGY.splitIntoWords("Aaa"));
+    assertEquals("aaa", DomNameStrategy.JAVA_STRATEGY.splitIntoWords("aaa"));
+    assertEquals("AAA bbb", DomNameStrategy.JAVA_STRATEGY.splitIntoWords("AAABbb"));
+    assertEquals("aaa BBB", DomNameStrategy.JAVA_STRATEGY.splitIntoWords("aaaBBB"));
+  }
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/ProxyTest.java b/xml/dom-tests/tests/com/intellij/util/xml/ProxyTest.java
new file mode 100644
index 0000000..bf3b3d4
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/ProxyTest.java
@@ -0,0 +1,171 @@
+package com.intellij.util.xml;
+
+import com.intellij.util.ArrayUtil;
+import junit.framework.TestCase;
+import net.sf.cglib.proxy.AdvancedProxy;
+import net.sf.cglib.proxy.InvocationHandler;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class ProxyTest extends TestCase {
+
+  public void testExtendClass() throws Throwable {
+    final List<String> invocations = new ArrayList<String>();
+    Implementation implementation = AdvancedProxy.createProxy(Implementation.class, new Class[]{Interface3.class}, new InvocationHandler(){
+      @Override
+      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+        invocations.add(method.getName());
+        if (Object.class.equals(method.getDeclaringClass())) {
+          return method.invoke(this, args);
+        }
+        return Implementation.class.getMethod("getField").invoke(proxy);
+      }
+    }, "239");
+    implementation.hashCode();
+    implementation.method();
+    assertEquals("239", implementation.getFoo());
+    implementation.setField("42");
+    assertEquals("42", implementation.getBar());
+    assertEquals("42", implementation.toString());
+    assertEquals(Arrays.asList("hashCode", "getFoo", "getFoo", "getBar"), invocations);
+
+    assertEquals("42", Interface1.class.getMethod("getFoo").invoke(implementation));
+
+    assertEquals("42", Interface3.class.getMethod("bar").invoke(implementation));
+
+    assertEquals("42", Interface1.class.getMethod("foo").invoke(implementation));
+    assertEquals("42", Interface2.class.getMethod("foo").invoke(implementation));
+    assertEquals("42", Interface2.class.getMethod("foo").invoke(implementation));
+    assertEquals("42", Implementation.class.getMethod("foo").invoke(implementation));
+  }
+
+  public interface Interface1 {
+    Object getFoo();
+    Object foo();
+  }
+
+  public interface Interface2 extends Interface1 {
+    @Override
+    CharSequence getFoo();
+    @Override
+    CharSequence foo();
+  }
+
+  public interface Interface3 extends Interface1 {
+    @Override
+    String foo();
+    String bar();
+  }
+
+  private abstract static class Implementation implements Interface2 {
+    private String myField;
+
+    protected Implementation(final String field) {
+      myField = field;
+    }
+
+    public String getField() {
+      return myField;
+    }
+
+    public void setField(final String field) {
+      myField = field;
+    }
+
+    public void method() {
+      getFoo();
+    }
+
+    public String toString() {
+      return myField;
+    }
+
+    @Override
+    public abstract String getFoo();
+
+    public abstract String getBar();
+
+  }
+
+  public void testAddInterfaces() throws Throwable {
+    final BaseImpl proxy = AdvancedProxy.createProxy(BaseImpl.class, BaseIEx.class);
+    assertEquals(proxy.sayA(), "a");
+    assertEquals(((BaseI)proxy).sayA(), "a");
+    assertEquals(((BaseIEx)proxy).sayA(), "a");
+  }
+
+  public interface BaseI {
+    Object sayA();
+  }
+
+  public interface BaseIEx extends BaseI {
+    @Override
+    CharSequence sayA();
+  }
+
+  public static abstract class BaseImpl implements BaseI {
+    @Override
+    public String sayA() {
+      return "a";
+    }
+  }
+
+  public static abstract class AbstractBase implements BaseI {
+    @Override
+    public abstract String sayA();
+
+    public abstract static class AbstractBaseImpl extends AbstractBase {}
+  }
+
+  public void testCovariantFromInterface() throws Throwable {
+    final AbstractBase.AbstractBaseImpl proxy = AdvancedProxy.createProxy(AbstractBase.AbstractBaseImpl.class, ArrayUtil.EMPTY_CLASS_ARRAY,
+                                                                          new InvocationHandler() {
+                                                                            @Override
+                                                                            public Object invoke(Object proxy, Method method, Object[] args)
+                                                                              throws Throwable {
+                                                                              return "a";
+                                                                            }
+                                                                          }, false, new Object[0]);
+    assertEquals(proxy.sayA(), "a");
+    assertEquals(((AbstractBase)proxy).sayA(), "a");
+    assertEquals(((BaseI)proxy).sayA(), "a");
+  }
+
+  public static class CovariantFromBaseClassTest {
+    public static interface Intf {
+      String sayA();
+    }
+
+    public static class Base {
+      public Object sayA() {
+        return "beeee";
+      }
+    }
+
+    public abstract static class Impl extends Base implements Intf {
+      @Override
+      public abstract String sayA();
+    }
+  }
+
+  public void testCovariantFromBaseClass() throws Throwable {
+    final CovariantFromBaseClassTest.Impl proxy = AdvancedProxy.createProxy(CovariantFromBaseClassTest.Impl.class,
+                                                                            ArrayUtil.EMPTY_CLASS_ARRAY, new InvocationHandler() {
+        @Override
+        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+          return "a";
+        }
+      }, false, new Object[0]);
+    assertEquals(proxy.sayA(), "a");
+    assertEquals(((CovariantFromBaseClassTest.Base)proxy).sayA(), "a");
+    assertEquals(((CovariantFromBaseClassTest.Intf)proxy).sayA(), "a");
+  }
+
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/SimpleValuesIncrementalUpdateTest.java b/xml/dom-tests/tests/com/intellij/util/xml/SimpleValuesIncrementalUpdateTest.java
new file mode 100644
index 0000000..fe40382
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/SimpleValuesIncrementalUpdateTest.java
@@ -0,0 +1,81 @@
+package com.intellij.util.xml;
+
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.events.DomEvent;
+
+/**
+ * @author peter
+ */
+public class SimpleValuesIncrementalUpdateTest extends DomTestCase{
+
+  public void testAttributeChange() throws Throwable {
+    final MyElement element = createElement("<a/>");
+    element.getXmlTag().setAttribute("attr", "foo");
+    putExpected(new DomEvent(element, false));
+    assertResultsAndClear();
+    assertTrue(element.getAttr().isValid());
+
+    element.getXmlTag().setAttribute("bttr", "foo");
+    element.getXmlTag().setAttribute("attr", "bar");
+    putExpected(new DomEvent(element, false));
+    putExpected(new DomEvent(element, false));
+    assertResultsAndClear();
+    assertTrue(element.getAttr().isValid());
+
+    element.getXmlTag().setAttribute("attr", null);
+    putExpected(new DomEvent(element, false));
+    assertResultsAndClear();
+    assertTrue(element.getAttr().isValid());
+  }
+
+  public void testAttributeValueChangeAsXmlElementChange() throws Throwable {
+    final MyElement element = createElement("<a attr=\"foo\"/>");
+    final GenericAttributeValue<String> attr = element.getAttr();
+    attr.getXmlAttributeValue().getFirstChild().replace(createTag("<a attr=\"bar\"/>").getAttribute("attr", null).getValueElement().getFirstChild());
+    putExpected(new DomEvent(element, false));
+    assertResultsAndClear();
+    assertTrue(attr.isValid());
+  }
+
+  public void testTagValueChange() throws Throwable {
+    final MyElement element = createElement("<a><child> </child></a>").getChild();
+    element.getXmlTag().getValue().setText("abc");
+    putExpected(new DomEvent(element, false));
+    assertResultsAndClear();
+
+    element.getXmlTag().getValue().setText(null);
+    putExpected(new DomEvent(element, false));
+    assertResultsAndClear();
+  }
+
+  public void testAttrXmlEmptyUri() throws Throwable {
+    final MyElement element = createElement("<a xmlns=\"foo\"><ns-child attr=\"239\"/></a>" , MyElement.class);
+    getDomManager().getDomFileDescription(element.getXmlElement()).registerNamespacePolicy("foo", "foo");
+
+    final GenericAttributeValue<String> attr = element.getNsChild().getAttr();
+    attr.getXmlTag().setAttribute("attr", "42");
+    putExpected(new DomEvent(element.getNsChild(), false));
+    assertResultsAndClear();
+  }
+
+  private MyElement createElement(final String xml) throws IncorrectOperationException {
+    return createElement(xml, MyElement.class);
+  }
+
+  public interface MyElement extends DomElement{
+    GenericAttributeValue<String> getAttr();
+
+    Integer getValue();
+
+    MyElement getChild();
+
+    MyNsElement getNsChild();
+  }
+
+  @Namespace("foo")
+  public interface MyNsElement extends DomElement{
+    GenericAttributeValue<String> getAttr();
+
+  }
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/StringBufferConverter.java b/xml/dom-tests/tests/com/intellij/util/xml/StringBufferConverter.java
new file mode 100644
index 0000000..2a8df5c
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/StringBufferConverter.java
@@ -0,0 +1,17 @@
+package com.intellij.util.xml;
+
+/**
+ * @author peter
+ */
+public class StringBufferConverter extends Converter<StringBuffer> {
+  @Override
+  public StringBuffer fromString(final String s, final ConvertContext context) {
+    return s==null?null:new StringBuffer(s);
+  }
+
+  @Override
+  public String toString(final StringBuffer t, final ConvertContext context) {
+    return t==null?null:t.toString();
+  }
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/impl/IncrementalUpdateEventsTest.java b/xml/dom-tests/tests/com/intellij/util/xml/impl/IncrementalUpdateEventsTest.java
new file mode 100644
index 0000000..9df3cce
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/impl/IncrementalUpdateEventsTest.java
@@ -0,0 +1,133 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomTestCase;
+import com.intellij.util.xml.SubTag;
+import com.intellij.util.xml.events.DomEvent;
+
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class IncrementalUpdateEventsTest extends DomTestCase {
+  private MyElement myElement;
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+    myElement = createElement("<a><child/><child/><child-element/><child-element/></a>");
+  }
+
+  public void testRemove0() throws IncorrectOperationException {
+    deleteTag(0);
+    putExpected(new DomEvent(myElement, false));
+    assertResultsAndClear();
+
+    deleteTag(0);
+    putExpected(new DomEvent(myElement, false));
+    assertResultsAndClear();
+
+    deleteTag(0);
+    putExpected(new DomEvent(myElement, false));
+    assertResultsAndClear();
+
+    deleteTag(0);
+    putExpected(new DomEvent(myElement, false));
+    assertResultsAndClear();
+  }
+
+  public void testRemove1() throws IncorrectOperationException {
+    deleteTag(1);
+    putExpected(new DomEvent(myElement, false));
+    assertResultsAndClear();
+  }
+
+  public void testRemove2() throws IncorrectOperationException {
+    deleteTag(2);
+    putExpected(new DomEvent(myElement, false));
+    assertResultsAndClear();
+
+    deleteTag(2);
+    putExpected(new DomEvent(myElement, false));
+    assertResultsAndClear();
+  }
+
+  public void testRemove3() throws IncorrectOperationException {
+    deleteTag(3);
+    putExpected(new DomEvent(myElement, false));
+    assertResultsAndClear();
+  }
+
+  public void testAdd0() throws Throwable {
+    addChildTag(0);
+    putExpected(new DomEvent(myElement, false));
+    assertResultsAndClear();
+  }
+
+  public void testAdd1() throws Throwable {
+    addChildTag(1);
+    putExpected(new DomEvent(myElement, false));
+    assertResultsAndClear();
+  }
+
+  public void testAdd2() throws Throwable {
+    addChildElementTag(2);
+    putExpected(new DomEvent(myElement, false));
+    assertResultsAndClear();
+  }
+
+  public void testAdd3() throws Throwable {
+    addChildElementTag(3);
+    putExpected(new DomEvent(myElement, false));
+    assertResultsAndClear();
+  }
+
+  public void testAdd4() throws Throwable {
+    final XmlTag tag = myElement.getXmlTag();
+    tag.addAfter(createTag("<child-element/>"), tag.getSubTags()[3]);
+    putExpected(new DomEvent(myElement, false));
+    assertResultsAndClear();
+  }
+
+  private MyElement getChild(final int index) {
+    return myElement.getChildElements().get(index);
+  }
+
+  private void addChildTag(int index) throws IncorrectOperationException {
+    final XmlTag tag = myElement.getXmlTag();
+    tag.addBefore(createTag("<child/>"), tag.getSubTags()[index]);
+  }
+
+  private void addChildElementTag(int index) throws IncorrectOperationException {
+    final XmlTag tag = myElement.getXmlTag();
+    tag.addBefore(createTag("<child-element/>"), tag.getSubTags()[index]);
+  }
+
+
+  private void deleteTag(final int index) throws IncorrectOperationException {
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        myElement.getXmlTag().getSubTags()[index].delete();
+      }
+    });
+  }
+
+  private MyElement createElement(final String xml) throws IncorrectOperationException {
+    return createElement(xml, MyElement.class);
+  }
+
+  public interface MyElement extends DomElement {
+    MyElement getChild();
+
+    @SubTag(value = "child", index = 1)
+    MyElement getChild2();
+
+    List<MyElement> getChildElements();
+  }
+
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/impl/TreeIncrementalUpdateTest.java b/xml/dom-tests/tests/com/intellij/util/xml/impl/TreeIncrementalUpdateTest.java
new file mode 100644
index 0000000..7d69ccf
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/impl/TreeIncrementalUpdateTest.java
@@ -0,0 +1,694 @@
+package com.intellij.util.xml.impl;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.events.DomEvent;
+
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class TreeIncrementalUpdateTest extends DomTestCase {
+
+  public void testRenameCollectionTag() throws Throwable {
+    final MyElement rootElement = createPhysicalElement(
+        "<?xml version='1.0' encoding='UTF-8'?>\n" + "<a>\n" + " <boy>\n" + " </boy>\n" + " <girl/>\n" + "</a>");
+    myCallRegistry.clear();
+    assertEquals(1, rootElement.getBoys().size());
+    assertEquals(1, rootElement.getGirls().size());
+    final MyElement oldBoy = rootElement.getBoys().get(0);
+    final XmlTag tag = oldBoy.getXmlTag();
+    assertNotNull(tag);
+    final int offset = tag.getTextOffset();
+    final int endoffset = offset+tag.getTextLength();
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        rootElement.getGirls().get(0).undefine();
+        final Document document = getDocument(DomUtil.getFile(rootElement));
+        PsiDocumentManager.getInstance(getProject()).doPostponedOperationsAndUnblockDocument(document);
+        document.replaceString(offset+1, offset+1+"boy".length(), "girl");
+        commitDocument(document);
+      }
+    }.execute();
+    assertFalse(oldBoy.isValid());
+    assertEquals(0, rootElement.getBoys().size());
+    assertEquals(1, rootElement.getGirls().size());
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        final Document document = getDocument(DomUtil.getFile(rootElement));
+        document.replaceString(endoffset - "boy".length(), endoffset, "girl");
+        commitDocument(document);
+      }
+    }.execute();
+    assertEquals(0, rootElement.getBoys().size());
+    assertEquals(1, rootElement.getGirls().size());
+  }
+
+  private MyElement createPhysicalElement(final String text) throws IncorrectOperationException {
+    final XmlFile file = (XmlFile)createFile("file.xml", text);
+    final DomFileElementImpl<MyElement> fileElement = getDomManager().getFileElement(file, MyElement.class, "a");
+    final MyElement rootElement = fileElement.getRootElement();
+    return rootElement;
+  }
+
+  public void testRenameFixedTag() throws Throwable {
+    final XmlFile file = (XmlFile)createFile("file.xml", "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                                                         "<a>\n" +
+                                                         " <aboy>\n" +
+                                                         " </aboy>\n" +
+                                                         " <agirl/>\n" +
+                                                         "</a>");
+    final DomFileElementImpl<MyElement> fileElement = getDomManager().getFileElement(file, MyElement.class, "a");
+    myCallRegistry.clear();
+    final MyElement rootElement = fileElement.getRootElement();
+    assertNotNull(rootElement.getAboy().getXmlElement());
+    assertNotNull(rootElement.getAgirl().getXmlElement());
+    final MyElement oldBoy = rootElement.getAboy();
+    final XmlTag tag = oldBoy.getXmlTag();
+    assertNotNull(tag);
+    final int offset = tag.getTextOffset();
+    final int endoffset = offset+tag.getTextLength();
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        rootElement.getAgirl().undefine();
+        final Document document = getDocument(file);
+        PsiDocumentManager.getInstance(getProject()).doPostponedOperationsAndUnblockDocument(document);
+        document.replaceString(offset+1, offset+1+"aboy".length(), "agirl");
+        commitDocument(document);
+      }
+    }.execute();
+    assertFalse(oldBoy.isValid());
+    assertNull(rootElement.getAboy().getXmlElement());
+    assertNotNull(rootElement.getAgirl().getXmlElement());
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        final Document document = getDocument(file);
+        document.replaceString(endoffset - "aboy".length(), endoffset, "agirl");
+        commitDocument(document);
+      }
+    }.execute();
+    assertNull(rootElement.getAboy().getXmlElement());
+    assertNotNull(rootElement.getAgirl().getXmlElement());
+  }
+
+  public void testDocumentChange() throws Throwable {
+    final XmlFile file = (XmlFile)createFile("file.xml", "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                                                         "<a>\n" +
+                                                         " <child>\n" +
+                                                         "  <child/>\n" +
+                                                         " </child>\n" +
+                                                         "</a>");
+    final DomFileElementImpl<MyElement> fileElement =
+      getDomManager().getFileElement(file, MyElement.class, "a");
+    myCallRegistry.clear();
+    final MyElement rootElement = fileElement.getRootElement();
+    final MyElement oldLeaf = rootElement.getChild().getChild();
+    final XmlTag oldLeafTag = oldLeaf.getXmlTag();
+
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        final Document document = getDocument(file);
+        document.replaceString(0, document.getText().length(), "<a/>");
+        commitDocument(document);
+      }
+    }.execute();
+    assertFalse(oldLeafTag.isValid());
+
+    putExpected(new DomEvent(fileElement, false));
+    assertResultsAndClear();
+
+    assertEquals(fileElement.getRootElement(), rootElement);
+    assertTrue(rootElement.isValid());
+
+    assertFalse(oldLeaf.isValid());
+
+    assertTrue(rootElement.getChild().isValid());
+    assertNull(rootElement.getChild().getXmlTag());
+    assertNull(rootElement.getChild().getChild().getXmlTag());
+  }
+
+  public void testDocumentChange2() throws Throwable {
+    final XmlFile file = (XmlFile)createFile("file.xml", "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                                                         "<!DOCTYPE ejb-jar PUBLIC \"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN\" \"http://java.sun.com/dtd/ejb-jar_2_0.dtd\">\n" +
+                                                         "<a>\n" +
+                                                         " <child>\n" +
+                                                         "  <child/>\n" +
+                                                         " </child>\n" +
+                                                         "</a>");
+    final DomFileElementImpl<MyElement> fileElement =
+      getDomManager().getFileElement(file, MyElement.class, "a");
+    myCallRegistry.clear();
+    final MyElement rootElement = fileElement.getRootElement();
+    final MyElement oldLeaf = rootElement.getChild().getChild();
+    final XmlTag oldLeafTag = oldLeaf.getXmlTag();
+
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        file.getDocument().getProlog().delete();
+        final XmlTag tag = file.getDocument().getRootTag();
+        tag.setAttribute("xmlns", "something");
+        tag.setAttribute("xmlns:xsi", "something");
+      }
+    }.execute();
+
+    assertTrue(oldLeafTag.isValid());
+
+    putExpected(new DomEvent(fileElement, false));
+    putExpected(new DomEvent(rootElement, false));
+    putExpected(new DomEvent(rootElement, false));
+    assertResultsAndClear();
+
+    assertEquals(fileElement.getRootElement(), rootElement);
+    assertTrue(rootElement.isValid());
+
+    assertTrue(rootElement.getChild().isValid());
+    assertTrue(rootElement.getChild().getXmlTag().isValid());
+    assertTrue(rootElement.getChild().getChild().getXmlTag().isValid());
+  }
+
+  public void testMoveUp() throws Throwable {
+    final XmlFile file = (XmlFile)createFile("file.xml", "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                                                         "<a>\n" +
+                                                         " <child>\n" +
+                                                         "  <aboy />\n" +
+                                                         "  <agirl/>\n" +
+                                                         " </child>\n" +
+                                                         "</a>");
+    final DomFileElementImpl<MyElement> fileElement = getDomManager().getFileElement(file, MyElement.class, "a");
+    myCallRegistry.clear();
+    final MyElement rootElement = fileElement.getRootElement();
+    rootElement.getChild().getAboy();
+    rootElement.getChild().getAgirl();
+
+    final Document document = getDocument(file);
+    final int len = "<agirl/>".length();
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        final int agirl = document.getText().indexOf("<agirl/>");
+        final int boy = document.getText().indexOf("<aboy />");
+        document.replaceString(agirl, agirl + len, "<aboy />");
+        document.replaceString(boy, boy + len, "<agirl/>");
+        commitDocument(document);
+      }
+    }.execute();
+
+    assertTrue(rootElement.isValid());
+    final XmlTag tag1 = rootElement.getXmlTag().getSubTags()[0];
+    assertEquals(getDomManager().getDomElement(tag1.findFirstSubTag("agirl")), rootElement.getChild().getAgirl());
+    assertEquals(getDomManager().getDomElement(tag1.findFirstSubTag("aboy")), rootElement.getChild().getAboy());
+  }
+
+  public void testRemoveAttributeParent() throws Throwable {
+    final XmlFile file = (XmlFile)createFile("file.xml", "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                                                         "<!DOCTYPE ejb-jar PUBLIC \"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN\" \"http://java.sun.com/dtd/ejb-jar_2_0.dtd\">\n" +
+                                                         "<a>\n" +
+                                                         " <child-element xxx=\"239\"/>\n" +
+                                                         "</a>");
+    final DomFileElementImpl<MyElement> fileElement =
+      getDomManager().getFileElement(file, MyElement.class, "a");
+    myCallRegistry.clear();
+    final MyElement rootElement = fileElement.getRootElement();
+    final MyElement oldLeaf = rootElement.getChildElements().get(0);
+    final GenericAttributeValue<String> xxx = oldLeaf.getXxx();
+    final XmlTag oldLeafTag = oldLeaf.getXmlTag();
+
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        oldLeafTag.delete();
+      }
+    }.execute();
+
+    assertFalse(oldLeaf.isValid());
+    assertFalse(xxx.isValid());
+  }
+
+  public void testTypeBeforeRootTag() throws Throwable {
+    getDomManager().registerFileDescription(new DomFileDescription<MyElement>(MyElement.class, "a"), getTestRootDisposable());
+
+    final XmlFile file = (XmlFile)createFile("file.xml", "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                                                         "<a/>");
+
+    assertTrue(getDomManager().isDomFile(file));
+    final DomFileElementImpl<MyElement> fileElement = getDomManager().getFileElement(file, MyElement.class);
+    assertTrue(fileElement.isValid());
+    myCallRegistry.clear();
+
+    putExpected(new DomEvent(fileElement, false));
+
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        final Document document = getDocument(file);
+        final int i = document.getText().indexOf("<a");
+        document.insertString(i, "a");
+        commitDocument(document);
+      }
+    }.execute();
+
+    assertFalse(getDomManager().isDomFile(file));
+    assertFalse(fileElement.isValid());
+    assertResultsAndClear();
+  }
+
+  private void assertNoCache(XmlTag tag) {
+    assertNull(tag.getText(), getCachedHandler(tag));
+    if (tag.isValid()) {
+      for (XmlTag xmlTag : tag.getSubTags()) {
+        assertNoCache(xmlTag);
+      }
+    }
+  }
+
+  private MyElement createElement(final String xml) throws IncorrectOperationException {
+    return createElement(xml, MyElement.class);
+  }
+
+  public void testAddCollectionElement() throws Throwable {
+    final MyElement element = createElement("<a><child/><child/><child-element/></a>");
+    final MyElement child = element.getChild();
+    final MyElement child2 = element.getChild2();
+    final MyElement firstChild = element.getChildElements().get(0);
+    element.getXmlTag().add(createTag("<child-element/>"));
+    final XmlTag[] subTags = element.getXmlTag().getSubTags();
+    assertEquals(2, element.getChildElements().size());
+    assertEquals(firstChild, element.getChildElements().get(0));
+    MyElement nextChild = element.getChildElements().get(1);
+
+    putExpected(new DomEvent(element, false));
+    assertResultsAndClear();
+  }
+
+  public void testAddFixedElement() throws Throwable {
+    final MyElement element = createPhysicalElement("<a>" +
+                                            "<child/>" +
+                                            "<child><child/></child>" +
+                                            "<child/></a>");
+    final MyElement child = element.getChild();
+    final MyElement child2 = element.getChild2();
+    final XmlTag leafTag = child2.getChild().getXmlTag();
+
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        element.getXmlTag().addAfter(createTag("<child/>"), child.getXmlTag());
+      }
+    }.execute();
+
+    assertNoCache(leafTag);
+
+    final XmlTag[] subTags = element.getXmlTag().getSubTags();
+
+    assertFalse(child2.isValid());
+    assertEquals(child, element.getChild());
+    assertFalse(child2.equals(element.getChild2()));
+
+    assertCached(child, subTags[0]);
+    assertNoCache(subTags[2]);
+    assertNoCache(subTags[3]);
+
+    putExpected(new DomEvent(element, false));
+    putExpected(new DomEvent(element, false));
+    assertResultsAndClear();
+  }
+
+  public void testAddFixedElementCanDefineIt() throws Throwable {
+    final MyElement element = createElement("<a></a>");
+    final MyElement child = element.getChild();
+
+    element.getXmlTag().add(createTag("<child/>"));
+
+    final XmlTag[] subTags = element.getXmlTag().getSubTags();
+
+    assertTrue(child.equals(element.getChild()));
+    assertTrue(element.getChild().equals(child));
+
+    assertCached(element.getChild(), subTags[0]);
+
+    putExpected(new DomEvent(element, false));
+    assertResultsAndClear();
+  }
+
+  public void testActuallyRemoveCollectionElement() throws Throwable {
+    final MyElement element = createElement("<a><child-element><child/></child-element><child-element/></a>");
+    final MyElement child = element.getChild();
+    final MyElement child2 = element.getChild2();
+    final MyElement firstChild = element.getChildElements().get(0);
+    final MyElement lastChild = element.getChildElements().get(1);
+
+    final XmlTag tag = element.getXmlTag();
+    final XmlTag childTag = tag.getSubTags()[0];
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        childTag.delete();
+      }
+    });
+
+    putExpected(new DomEvent(element, false));
+    assertResultsAndClear();
+
+    assertEquals(child, element.getChild());
+    assertEquals(child2, element.getChild2());
+    assertEquals(Arrays.asList(lastChild), element.getChildElements());
+    assertCached(lastChild, tag.getSubTags()[0]);
+  }
+
+  public void testCustomChildrenEvents() throws Throwable {
+    final Sepulka element = createElement("<a><foo/><bar/></a>", Sepulka.class);
+    final List<MyElement> list = element.getCustomChildren();
+    final XmlTag tag = element.getXmlTag();
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tag.getSubTags()[0].delete();
+        tag.getSubTags()[0].delete();
+      }
+    });
+
+    tag.add(createTag("<goo/>"));
+    putExpected(new DomEvent(element, false));
+    putExpected(new DomEvent(element, false));
+    putExpected(new DomEvent(element, false));
+    assertResultsAndClear();
+
+    assertEquals(1, element.getCustomChildren().size());
+  }
+
+  public void testRemoveFixedElement() throws Throwable {
+    final MyElement element = createElement("<a>" +
+                                            "<child/>" +
+                                            "<child><child/></child>" +
+                                            "<child><child/></child>" +
+                                            "</a>");
+    final MyElement child = element.getChild();
+    final MyElement child2 = element.getChild2();
+    final MyElement oldLeaf = child2.getChild();
+    final XmlTag tag = element.getXmlTag();
+    XmlTag leafTag = tag.getSubTags()[2].getSubTags()[0];
+    assertNoCache(leafTag);
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tag.getSubTags()[1].delete();
+
+        assertFalse(oldLeaf.isValid());
+
+        putExpected(new DomEvent(element, false));
+        assertResultsAndClear();
+
+        assertEquals(child, element.getChild());
+        assertFalse(child2.isValid());
+
+        tag.getSubTags()[1].delete();
+      }
+    });
+
+    putExpected(new DomEvent(element, false));
+    assertResultsAndClear();
+  }
+
+  public void testRootTagAppearsLater() throws Throwable {
+    final XmlFile file = createXmlFile("");
+    final DomFileElementImpl<MyElement> fileElement = getDomManager().getFileElement(file, MyElement.class, "root");
+    myCallRegistry.clear();
+
+    assertNull(fileElement.getRootElement().getXmlTag());
+
+    file.getDocument().replace(createXmlFile("<root/>").getDocument());
+    final XmlTag rootTag = fileElement.getRootTag();
+    assertEquals(rootTag, file.getDocument().getRootTag());
+    putExpected(new DomEvent(fileElement.getRootElement(), false));
+    assertResultsAndClear();
+  }
+
+  public void testAnotherChildren() throws Throwable {
+    final MyElement element = createElement("<a><child/></a>");
+    element.getXmlTag().add(createTag("<another-child/>"));
+    assertEquals(1, element.getAnotherChildren().size());
+
+    putExpected(new DomEvent(element, false));
+    assertResultsAndClear();
+  }
+
+  public void testInvalidateParent() throws Throwable {
+    final MyElement root = getDomManager().createMockElement(MyElement.class, null, true);
+    new WriteCommandAction<MyElement>(getProject()) {
+      @Override
+      protected void run(Result<MyElement> result) throws Throwable {
+        root.getChild().ensureTagExists();
+        root.getChild2().ensureTagExists();
+        final MyElement element = root.addChildElement().getChild();
+        result.setResult(element);
+        element.ensureTagExists().getValue().setText("abc");
+        root.addChildElement();
+        root.addChildElement();
+      }
+    }.execute().getResultObject();
+    assertTrue(root.isValid());
+    final MyElement element = root.getChildElements().get(0).getChild();
+    assertTrue(element.isValid());
+    final MyElement child = element.getChild();
+    final MyElement genericValue = child.getChild();
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        final Document document = getDocument(DomUtil.getFile(element));
+        final TextRange range = element.getXmlTag().getTextRange();
+        document.replaceString(range.getStartOffset(), range.getEndOffset(), "");
+        commitDocument(document);
+      }
+    }.execute();
+    assertFalse(genericValue.isValid());
+    assertFalse(child.isValid());
+    assertFalse(element.isValid());
+  }
+
+  public void testCollectionChildValidAfterFormattingReparse() throws Throwable {
+    final MyElement root = getDomManager().createMockElement(MyElement.class, null, true);
+    final MyElement element = new WriteCommandAction<MyElement>(getProject()) {
+      @Override
+      protected void run(Result<MyElement> result) throws Throwable {
+        result.setResult(root.addChildElement());
+      }
+    }.execute().getResultObject();
+    assertTrue(root.isValid());
+    assertNotNull(element.getXmlElement());
+  }
+
+  public void testChangeImplementationClass() throws Throwable {
+    getTypeChooserManager().registerTypeChooser(MyElement.class, createClassChooser());
+    try {
+      final MyElement element = getDomManager().createMockElement(MyElement.class, getModule(), true);
+      final DomFileElement<MyElement> root = DomUtil.getFileElement(element);
+      
+      new WriteCommandAction(getProject()) {
+        @Override
+        protected void run(Result result) throws Throwable {
+          element.addChildElement().addChildElement();
+        }
+      }.execute();
+
+      final MyElement child = element.getChildElements().get(0);
+      MyElement grandChild = child.getChildElements().get(0);
+      assertTrue(child instanceof BarInterface);
+      assertTrue(grandChild instanceof BarInterface);
+
+      grandChild = element.getChildElements().get(0).getChildElements().get(0);
+      final XmlTag tag = grandChild.getXmlTag();
+      assertTrue(grandChild.isValid());
+      assertEquals(grandChild, root.getRootElement().getChildElements().get(0).getChildElements().get(0));
+      assertNotNull(element.getXmlTag());
+      assertNotNull(child.getXmlTag());
+      assertNotNull(tag);
+      assertTrue(tag.isValid());
+
+      myCallRegistry.clear();
+
+      new WriteCommandAction(getProject()) {
+        @Override
+        protected void run(Result result) throws Throwable {
+          tag.add(XmlElementFactory.getInstance(getProject()).createTagFromText("<foo/>"));
+        }
+      }.execute();
+
+      assertTrue(root.isValid());
+      assertTrue(element.isValid());
+      assertTrue(grandChild.isValid());
+      final MyElement newChild = root.getRootElement().getChildElements().get(0);
+      assertTrue(newChild instanceof BarInterface);
+
+      final MyElement newGrandChild = newChild.getChildElements().get(0);
+      assertTrue(newGrandChild.isValid());
+      assertTrue(newGrandChild instanceof FooInterface);
+
+      putExpected(new DomEvent(child, false));
+      putExpected(new DomEvent(grandChild, false));
+      assertResultsAndClear();
+    } finally {
+      getTypeChooserManager().unregisterTypeChooser(MyElement.class);
+    }
+  }
+
+  public void testChangeImplementationClass_InCollection() throws Throwable {
+    getTypeChooserManager().registerTypeChooser(MyElement.class, createClassChooser());
+    try {
+      final MyElement element = getDomManager().createMockElement(MyElement.class, getModule(), true);
+      final DomFileElement<MyElement> root = DomUtil.getFileElement(element);
+      new WriteCommandAction<MyElement>(getProject()) {
+        @Override
+        protected void run(Result<MyElement> result) throws Throwable {
+          element.addChildElement().addChildElement();
+        }
+      }.execute().getResultObject();
+      final MyElement child = element.getChildElements().get(0);
+      final MyElement grandChild = child.getChildElements().get(0);
+      assertTrue(child instanceof BarInterface);
+      assertTrue(grandChild instanceof BarInterface);
+
+      assertTrue(element.isValid());
+      assertTrue(child.isValid());
+      assertTrue(grandChild.isValid());
+
+      assertNotNull(element.getXmlTag());
+      assertNotNull(child.getXmlTag());
+
+      final XmlTag tag = grandChild.getXmlTag();
+      assertNotNull(tag);
+
+      myCallRegistry.clear();
+
+      new WriteCommandAction(getProject()) {
+        @Override
+        protected void run(Result result) throws Throwable {
+          tag.add(XmlElementFactory.getInstance(getProject()).createTagFromText("<foo/>"));
+        }
+      }.execute();
+
+      assertTrue(root.isValid());
+      assertTrue(element.isValid());
+
+      assertTrue(child.isValid());
+      final MyElement newChild = element.getChildElements().get(0);
+      assertTrue(newChild.isValid());
+      assertTrue(newChild.getClass().toString(), newChild instanceof BarInterface);
+
+      assertTrue(grandChild.isValid());
+      final MyElement newGrandChild = newChild.getChildElements().get(0);
+      assertTrue(newGrandChild.isValid());
+      assertTrue(newGrandChild instanceof FooInterface);
+
+      putExpected(new DomEvent(child, false));
+      putExpected(new DomEvent(grandChild, false));
+      assertResultsAndClear();
+    } finally {
+      getTypeChooserManager().unregisterTypeChooser(MyElement.class);
+    }
+  }
+  /*
+
+  public void testCommentTag() throws Throwable {
+    final String prefix = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+                        "<!DOCTYPE application PUBLIC \"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN\" \"http://java.sun.com/dtd/application_1_3.dtd\">\n" +
+                        "<application>\n" + "  <display-name>MyAppa</display-name>\n" + "    <description>ss</description>\n" +
+                        "    <module id=\"MyWebApp2\">\n" + "        <web>    a\n" + "            <web-uri>MyWebApp2.war</web-uri>\n" +
+                        "            ";
+    final String infix = "<context-root>MyWebApp2</context-root>";
+    String suffix = "\n" + "        </web>\n" + "    </module>\n" +
+                        "    <module id=\"MyWebApp22\">\n" + "        <web>\n" + "            <web-uri>MyWebApp2.war</web-uri>\n" +
+                        "            <context-root>MyWebApp2</context-root>\n" + "        </web>\n" + "    </module>\n" +
+                        "    <module id=\"MyEjb32\">\n" + "        <ejb>MyEjb32.jar</ejb>\n" + "    </module>\n" +
+                        "    <module id=\"MyEjb4\">\n" + "        <ejb>MyEjb4.jar</ejb>\n" + "    </module>\n" + "    <security-role>\n" +
+                        "        <description>asdf</description>\n" + "        <role-name>nameasdf</role-name>\n" +
+                        "    </security-role>\n" + "\n" + "</application>";
+
+    final XmlFile file = (XmlFile)createFile("web.xml", prefix + infix + suffix);
+    final JavaeeApplication javaeeApplication = getDomManager().getFileElement(file, JavaeeApplication.class).getRootElement();
+    assertEquals("MyWebApp2", javaeeApplication.getModules().get(0).getWeb().getContextRoot().getValue());
+
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        final Document document = getDocument(file);
+        document.insertString(prefix.length() + infix.length(), "-->");
+        document.insertString(prefix.length(), "<!--");
+        commitDocument(document);
+      }
+    }.execute();
+    assertTrue(javaeeApplication.isValid());
+    assertTrue(javaeeApplication.getModules().get(0).getWeb().getContextRoot().isValid());
+    assertTrue(javaeeApplication.getModules().get(0).getWeb().isValid());
+    assertNull(javaeeApplication.getModules().get(0).getWeb().getContextRoot().getXmlElement());
+  }
+
+  */
+
+  private static TypeChooser createClassChooser() {
+    return new TypeChooser() {
+      @Override
+      public Type chooseType(final XmlTag tag) {
+        return tag != null && tag.findFirstSubTag("foo") != null
+               ? FooInterface.class
+               : BarInterface.class;
+      }
+
+      @Override
+      public void distinguishTag(final XmlTag tag, final Type aClass)
+        throws IncorrectOperationException {
+        if (FooInterface.class.equals(aClass) && tag.findFirstSubTag("foo") == null) {
+          tag.add(XmlElementFactory.getInstance(getProject()).createTagFromText("<foo/>"));
+        }
+      }
+
+      @Override
+      public Type[] getChooserTypes() {
+        return new Class[]{FooInterface.class,
+                           BarInterface.class};
+      }
+    };
+  }
+
+
+  public interface MyElement extends DomElement{
+    MyElement getChild();
+    @SubTag(value="child",index=1) MyElement getChild2();
+    List<MyElement> getChildElements();
+    List<MyElement> getBoys();
+    List<MyElement> getGirls();
+    List<MyElement> getAnotherChildren();
+    MyElement addChildElement();
+    GenericAttributeValue<String> getXxx();
+
+    MyElement getAboy();
+    MyElement getAgirl();
+  }
+
+  public interface FooInterface extends MyElement {
+  }
+
+  public interface BarInterface extends MyElement {
+  }
+
+  public interface Sepulka extends DomElement{
+    @CustomChildren
+    List<MyElement> getCustomChildren();
+  }
+
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubBuilderTest.java b/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubBuilderTest.java
new file mode 100644
index 0000000..faca1b6
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubBuilderTest.java
@@ -0,0 +1,73 @@
+package com.intellij.util.xml.stubs;
+
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.stubs.ObjectStubTree;
+import com.intellij.psi.stubs.StubTreeLoader;
+import com.intellij.testFramework.PlatformTestUtil;
+import com.intellij.util.xml.XmlName;
+import com.intellij.util.xml.reflect.DomExtender;
+import com.intellij.util.xml.reflect.DomExtenderEP;
+import com.intellij.util.xml.reflect.DomExtensionsRegistrar;
+import com.intellij.util.xml.stubs.model.Bar;
+import com.intellij.util.xml.stubs.model.Custom;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/3/12
+ */
+public class DomStubBuilderTest extends DomStubTest {
+
+  public void testDomLoading() throws Exception {
+    getRootStub("foo.xml");
+  }
+
+  public void testFoo() throws Exception {
+    doBuilderTest("foo.xml", "File:foo\n" +
+                             "  Element:foo\n" +
+                             "    Element:bar\n" +
+                             "      Attribute:string:xxx\n" +
+                             "      Attribute:int:666\n" +
+                             "    Element:bar\n");
+  }
+
+  public void testIncompleteAttribute() throws Exception {
+    doBuilderTest("incompleteAttribute.xml", "File:foo\n" +
+                                             "  Element:foo\n" +
+                                             "    Element:bar\n" +
+                                             "      Attribute:string:\n");
+  }
+
+  public void testDomExtension() throws Exception {
+    DomExtenderEP ep = new DomExtenderEP();
+    ep.domClassName = Bar.class.getName();
+    ep.extenderClassName = TestExtender.class.getName();
+    PlatformTestUtil.registerExtension(Extensions.getRootArea(), DomExtenderEP.EP_NAME, ep, myTestRootDisposable);
+
+    doBuilderTest("extender.xml", "File:foo\n" +
+                                  "  Element:foo\n" +
+                                  "    Element:bar\n" +
+                                  "      Attribute:extend:xxx\n" +
+                                  "    Element:bar\n");
+  }
+
+  public void testNullTag() throws Exception {
+    PsiFile psiFile = myFixture.configureByFile("nullTag.xml");
+
+    StubTreeLoader loader = StubTreeLoader.getInstance();
+    VirtualFile file = psiFile.getVirtualFile();
+    assertTrue(loader.canHaveStub(file));
+    ObjectStubTree stubTree = loader.readFromVFile(getProject(), file);
+    assertNull(stubTree); // no stubs for invalid XML
+  }
+
+  public static class TestExtender extends DomExtender<Bar> {
+
+    @Override
+    public void registerExtensions(@NotNull Bar bar, @NotNull DomExtensionsRegistrar registrar) {
+      registrar.registerAttributeChildExtension(new XmlName("extend"), Custom.class);
+    }
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubTest.java b/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubTest.java
new file mode 100644
index 0000000..2f0b09a
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubTest.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs;
+
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.DebugUtil;
+import com.intellij.psi.impl.PsiManagerImpl;
+import com.intellij.psi.stubs.ObjectStubTree;
+import com.intellij.psi.stubs.StubTreeLoader;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture;
+import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomFileDescription;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.DomManager;
+import com.intellij.util.xml.impl.DomApplicationComponent;
+import com.intellij.util.xml.impl.DomManagerImpl;
+import com.intellij.util.xml.stubs.model.Foo;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/8/12
+ */
+public abstract class DomStubTest extends LightCodeInsightFixtureTestCase {
+
+  private static final String HTTP_FOO_DTD = "http://foo.dtd";
+  private static final DomFileDescription<Foo> DOM_FILE_DESCRIPTION = new DomFileDescription<Foo>(Foo.class, "foo", HTTP_FOO_DTD) {
+    @Override
+    public boolean hasStubs() {
+      return true;
+    }
+
+    @Override
+    protected void initializeFileDescription() {
+      registerNamespacePolicy("foo", HTTP_FOO_DTD);
+    }
+  };
+
+  @Override
+  public void setUp() throws Exception {
+    super.setUp();
+    ((DomManagerImpl)DomManager.getDomManager(getProject())).registerFileDescription(DOM_FILE_DESCRIPTION, getTestRootDisposable());
+  }
+
+  @Override
+  protected void tearDown() throws Exception {
+    DomApplicationComponent.getInstance().clearCachesInTests();
+    super.tearDown();
+  }
+
+  @Override
+  protected String getBasePath() {
+    return "/xml/dom-tests/testData/stubs";
+  }
+
+  protected ElementStub getRootStub(String filePath) {
+    return getRootStub(filePath, myFixture);
+  }
+
+  public static ElementStub getRootStub(String filePath, JavaCodeInsightTestFixture fixture) {
+    PsiFile psiFile = fixture.configureByFile(filePath);
+
+    StubTreeLoader loader = StubTreeLoader.getInstance();
+    VirtualFile file = psiFile.getVirtualFile();
+    assertTrue(loader.canHaveStub(file));
+    ObjectStubTree stubTree = loader.readFromVFile(fixture.getProject(), file);
+    assertNotNull(stubTree);
+    ElementStub root = (ElementStub)stubTree.getRoot();
+    assertNotNull(root);
+    return root;
+  }
+
+  protected void doBuilderTest(String file, String stubText) {
+    ElementStub stub = getRootStub(file);
+    assertEquals(stubText, DebugUtil.stubTreeToString(stub));
+  }
+
+  protected <T extends DomElement> DomFileElement<T> prepare(String path, Class<T> domClass) {
+    XmlFile file = prepareFile(path);
+
+    DomFileElement<T> fileElement = DomManager.getDomManager(getProject()).getFileElement(file, domClass);
+    assertNotNull(fileElement);
+    return fileElement;
+  }
+
+  protected XmlFile prepareFile(String path) {
+    XmlFile file = (XmlFile)myFixture.configureByFile(path);
+    assertFalse(file.getNode().isParsed());
+    VirtualFile virtualFile = file.getVirtualFile();
+    assertNotNull(virtualFile);
+    ObjectStubTree tree = StubTreeLoader.getInstance().readOrBuild(getProject(), virtualFile, file);
+    assertNotNull(tree);
+
+    ((PsiManagerImpl)getPsiManager()).cleanupForNextTest();
+
+    file = (XmlFile)getPsiManager().findFile(virtualFile);
+    assertNotNull(file);
+    return file;
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubUsingTest.java b/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubUsingTest.java
new file mode 100644
index 0000000..92afd1c
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubUsingTest.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs;
+
+import com.intellij.openapi.vfs.VirtualFileFilter;
+import com.intellij.psi.PsiClass;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.PsiManagerImpl;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.*;
+import com.intellij.util.xml.stubs.model.Bar;
+import com.intellij.util.xml.stubs.model.Foo;
+import com.intellij.util.xml.stubs.model.NotStubbed;
+
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/8/12
+ */
+public class DomStubUsingTest extends DomStubTest {
+
+  public void testFoo() throws Exception {
+
+    DomFileElement<Foo> fileElement = prepare("foo.xml", Foo.class);
+    PsiFile file = fileElement.getFile();
+    assertFalse(file.getNode().isParsed());
+
+    Foo foo = fileElement.getRootElement();
+    List<Bar> bars = foo.getBars();
+    assertFalse(file.getNode().isParsed());
+
+    assertEquals(2, bars.size());
+    Bar bar = bars.get(0);
+    String value = bar.getString().getStringValue();
+    assertEquals("xxx", value);
+
+    Object o = bar.getString().getValue();
+    assertEquals("xxx", o);
+
+    Integer integer = bar.getInt().getValue();
+    assertEquals(666, integer.intValue());
+
+    assertFalse(file.getNode().isParsed());
+
+    Bar emptyBar = bars.get(1);
+    GenericAttributeValue<String> string = emptyBar.getString();
+    assertNull(string.getXmlElement());
+
+    assertFalse(file.getNode().isParsed());
+  }
+
+  public void testAccessingPsi() throws Exception {
+    DomFileElement<Foo> element = prepare("foo.xml", Foo.class);
+    assertNotNull(element.getXmlElement());
+
+    XmlTag tag = element.getRootTag();
+    assertNotNull(tag);
+
+    Foo foo = element.getRootElement();
+    assertNotNull(foo.getXmlTag());
+
+    Bar bar = foo.getBars().get(0);
+    assertNotNull(bar.getXmlElement());
+
+    XmlAttribute attribute = bar.getString().getXmlAttribute();
+    assertNotNull(attribute);
+  }
+
+  public void testConverters() throws Exception {
+    DomFileElement<Foo> element = prepare("converters.xml", Foo.class);
+    Bar bar = element.getRootElement().getBars().get(0);
+    PsiClass value = bar.getClazz().getValue();
+    assertNotNull(value);
+    assertEquals("java.lang.String", value.getQualifiedName());
+    assertFalse(element.getFile().getNode().isParsed());
+  }
+
+  public void testParent() throws Exception {
+    DomFileElement<Foo> element = prepare("parent.xml", Foo.class);
+
+    Bar bar = element.getRootElement().getBars().get(0);
+    GenericAttributeValue<Integer> notStubbed = bar.getNotStubbed();
+    DomElement parent = notStubbed.getParent();
+    assertEquals(bar, parent);
+
+    NotStubbed child = bar.getNotStubbeds().get(0);
+    parent = child.getParent();
+    assertEquals(bar, parent);
+  }
+
+  public void testChildrenOfType() throws Exception {
+
+    DomFileElement<Foo> element = prepare("foo.xml", Foo.class);
+    Foo foo = element.getRootElement();
+    List<Bar> bars = DomUtil.getChildrenOf(foo, Bar.class);
+    assertEquals(2, bars.size());
+  }
+
+  public void testFileLoading() throws Exception {
+    XmlFile file = prepareFile("foo.xml");
+    ((PsiManagerImpl)getPsiManager()).setAssertOnFileLoadingFilter(VirtualFileFilter.ALL);
+    try {
+      DomManager.getDomManager(getProject()).getFileElement(file, Foo.class);
+    }
+    finally {
+      ((PsiManagerImpl)getPsiManager()).setAssertOnFileLoadingFilter(VirtualFileFilter.NONE);
+    }
+  }
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/Bar.java b/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/Bar.java
new file mode 100644
index 0000000..5ca79ee
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/Bar.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs.model;
+
+import com.intellij.psi.PsiClass;
+import com.intellij.util.xml.Stubbed;
+import com.intellij.util.xml.Attribute;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.SubTagList;
+
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/7/12
+ */
+public interface Bar extends DomElement {
+
+  @Stubbed
+  GenericAttributeValue<String> getString();
+
+  @Stubbed
+  GenericAttributeValue<Integer> getInt();
+
+  @Stubbed
+  @Attribute("class")
+  GenericAttributeValue<PsiClass> getClazz();
+
+  GenericAttributeValue<Integer> getNotStubbed();
+
+  @SubTagList("notStubbed")
+  List<NotStubbed> getNotStubbeds();
+
+  NotStubbed addNotStubbed();
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/Custom.java b/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/Custom.java
new file mode 100644
index 0000000..ecdaad0
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/Custom.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs.model;
+
+import com.intellij.util.xml.Stubbed;
+import com.intellij.util.xml.GenericAttributeValue;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/15/12
+ */
+@Stubbed
+public interface Custom extends GenericAttributeValue<String> {
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/Foo.java b/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/Foo.java
new file mode 100644
index 0000000..1b94aaf
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/Foo.java
@@ -0,0 +1,19 @@
+package com.intellij.util.xml.stubs.model;
+
+import com.intellij.util.xml.Stubbed;
+import com.intellij.util.xml.DomElement;
+
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/3/12
+ */
+@Stubbed
+public interface Foo extends DomElement {
+
+  @Stubbed
+  List<Bar> getBars();
+
+  Bar addBar();
+}
diff --git a/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/NotStubbed.java b/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/NotStubbed.java
new file mode 100644
index 0000000..1592269
--- /dev/null
+++ b/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/NotStubbed.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.util.xml.stubs.model;
+
+import com.intellij.util.xml.DomElement;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 8/17/12
+ */
+public interface NotStubbed extends DomElement {
+}
diff --git a/xml/impl/resources/com/intellij/codeInsight/completion/XmlNameCompletionConfidence.java b/xml/impl/resources/com/intellij/codeInsight/completion/XmlNameCompletionConfidence.java
new file mode 100644
index 0000000..77a54ec
--- /dev/null
+++ b/xml/impl/resources/com/intellij/codeInsight/completion/XmlNameCompletionConfidence.java
@@ -0,0 +1,25 @@
+package com.intellij.codeInsight.completion;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.ThreeState;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class XmlNameCompletionConfidence extends CompletionConfidence{
+  @NotNull
+  @Override
+  public ThreeState shouldFocusLookup(@NotNull CompletionParameters parameters) {
+    final ASTNode node = parameters.getPosition().getNode();
+    if (node == null) return ThreeState.UNSURE;
+
+    final IElementType elementType = node.getElementType();
+    if (elementType == XmlTokenType.XML_NAME || elementType == XmlTokenType.XML_TAG_NAME) {
+      return ThreeState.YES;
+    }
+    return ThreeState.UNSURE;
+  }
+}
diff --git a/xml/impl/resources/inspectionDescriptions/CheckDtdRefs.html b/xml/impl/resources/inspectionDescriptions/CheckDtdRefs.html
new file mode 100644
index 0000000..cb613ce5
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/CheckDtdRefs.html
@@ -0,0 +1,8 @@
+<html>
+<body>
+<font face="verdana" size="-1">Checks consistency of <b>DTD</b> specific references, e.g. references to XML entity or to DTD element declaration.
+  The validation works in DTD or XML file types.<br>
+</font>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/CheckEmptyScriptTag.html b/xml/impl/resources/inspectionDescriptions/CheckEmptyScriptTag.html
new file mode 100644
index 0000000..4b748cd
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/CheckEmptyScriptTag.html
@@ -0,0 +1,9 @@
+<html>
+<body>
+<font face="verdana" size="-1">Reports empty tags (like <b>script</b>) that do not work in some browsers.
+  The validation works in html or jsp file types.<br>
+</font>
+
+
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/CheckImageSize.html b/xml/impl/resources/inspectionDescriptions/CheckImageSize.html
new file mode 100644
index 0000000..9f9bcb0
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/CheckImageSize.html
@@ -0,0 +1,7 @@
+<html>
+<body>
+<font face="verdana" size="-1">This inspection highlights <b>width</b> and <b>height</b> attribute values of <b>IMG</b> tag
+  that are different from the width and height of the original image.<br>
+</font>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/CheckTagEmptyBody.html b/xml/impl/resources/inspectionDescriptions/CheckTagEmptyBody.html
new file mode 100644
index 0000000..f4f4305
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/CheckTagEmptyBody.html
@@ -0,0 +1,8 @@
+<html>
+<body>
+<font face="verdana" size="-1">Reports <b>empty</b> tag body.
+  The validation works in XML / JSP / JSPX / HTML/ XHTML file types.<br>
+</font>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/CheckValidXmlInScriptTagBody.html b/xml/impl/resources/inspectionDescriptions/CheckValidXmlInScriptTagBody.html
new file mode 100644
index 0000000..ae12a39
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/CheckValidXmlInScriptTagBody.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+<font face="verdana" size="-1">This inspection checks that the <b>script</b> tag content is valid XML.<br>
+</font>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/CheckXmlFileWithXercesValidator.html b/xml/impl/resources/inspectionDescriptions/CheckXmlFileWithXercesValidator.html
new file mode 100644
index 0000000..4d9a080
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/CheckXmlFileWithXercesValidator.html
@@ -0,0 +1,8 @@
+<html>
+<body>
+<font face="verdana" size="-1">Thoroughly checks XML files for DTD / schema compliance using Xerces validator.
+  The validation works in XML or XHTML file types.<br>
+</font>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/HtmlDeprecatedTag.html b/xml/impl/resources/inspectionDescriptions/HtmlDeprecatedTag.html
new file mode 100644
index 0000000..42f98ca
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/HtmlDeprecatedTag.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+<font face="verdana" size="-1">This inspection highlights deprecated HTML tags and provides ability to replace them with CSS or with other tags for some of them.<br>
+</font>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/HtmlExtraClosingTag.html b/xml/impl/resources/inspectionDescriptions/HtmlExtraClosingTag.html
new file mode 100644
index 0000000..3a2cc85
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/HtmlExtraClosingTag.html
@@ -0,0 +1,7 @@
+<html>
+<body>
+<font face="verdana" size="-1">This inspection spots extra closing tag for the empty elements like IMG or BR.<br>
+</font>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/HtmlFormInputWithoutLabel.html b/xml/impl/resources/inspectionDescriptions/HtmlFormInputWithoutLabel.html
new file mode 100644
index 0000000..680c983
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/HtmlFormInputWithoutLabel.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+<font face="verdana" size="-1">This inspection highlights form elements without required associated label and provides ability to create a new label.<br>
+</font>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/HtmlNonExistentInternetResource.html b/xml/impl/resources/inspectionDescriptions/HtmlNonExistentInternetResource.html
new file mode 100644
index 0000000..67b9ac9
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/HtmlNonExistentInternetResource.html
@@ -0,0 +1,7 @@
+<html>
+<body>
+<font face="verdana" size="-1">
+This inspection highlights links to non-existent web resources.
+</font>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/HtmlPathReference.html b/xml/impl/resources/inspectionDescriptions/HtmlPathReference.html
new file mode 100644
index 0000000..54d0ed0
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/HtmlPathReference.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+Highlights unresolved file references in HTML.
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/HtmlPresentationalElement.html b/xml/impl/resources/inspectionDescriptions/HtmlPresentationalElement.html
new file mode 100644
index 0000000..3a0609a
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/HtmlPresentationalElement.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+<font face="verdana" size="-1">This inspection highlights pure presentational HTML tags and provides ability to replace them with CSS or with other tags.<br>
+</font>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/HtmlUnknownAttribute.html b/xml/impl/resources/inspectionDescriptions/HtmlUnknownAttribute.html
new file mode 100644
index 0000000..6cf45ee
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/HtmlUnknownAttribute.html
@@ -0,0 +1,7 @@
+<html>
+<body>
+<font face="verdana" size="-1">This inspection highlights unknown HTML tag attributes as invalid, and lets mark such attributes as Custom to avoid highlighting them as invalid.<br>
+</font>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/HtmlUnknownTag.html b/xml/impl/resources/inspectionDescriptions/HtmlUnknownTag.html
new file mode 100644
index 0000000..afa4948
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/HtmlUnknownTag.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+<font face="verdana" size="-1">This inspection highlights unknown HTML tags, and lets mark such tags as Custom to avoid highlighting them as unknown in future.<br>
+</font>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/HtmlUnknownTarget.html b/xml/impl/resources/inspectionDescriptions/HtmlUnknownTarget.html
new file mode 100644
index 0000000..506b1d6
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/HtmlUnknownTarget.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+<font face="verdana" size="-1">This inspection checks unresolved file references in HTML.<br>
+</font>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/RequiredAttributes.html b/xml/impl/resources/inspectionDescriptions/RequiredAttributes.html
new file mode 100644
index 0000000..2011632
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/RequiredAttributes.html
@@ -0,0 +1,7 @@
+<html>
+<body>
+<font face="verdana" size="-1">This inspection reports XML/HTML tags with missing mandatory attributes.
+  You can specify attribute names that should not be reported. 
+</font>
+</body>
+</html>
diff --git a/xml/impl/resources/inspectionDescriptions/XmlDuplicatedId.html b/xml/impl/resources/inspectionDescriptions/XmlDuplicatedId.html
new file mode 100644
index 0000000..99c6e61
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/XmlDuplicatedId.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+<font face="verdana" size="-1">This inspection checks for duplicate "id" attributes in XML.
+</font>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/XmlHighlighting.html b/xml/impl/resources/inspectionDescriptions/XmlHighlighting.html
new file mode 100644
index 0000000..e3c9068
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/XmlHighlighting.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+Highlights XML validation problems in the results of batch code inspection.
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/XmlPathReference.html b/xml/impl/resources/inspectionDescriptions/XmlPathReference.html
new file mode 100644
index 0000000..94c9e12
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/XmlPathReference.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+Highlights unresolved file references in XML.
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/XmlUnboundNsPrefix.html b/xml/impl/resources/inspectionDescriptions/XmlUnboundNsPrefix.html
new file mode 100644
index 0000000..2821e9f
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/XmlUnboundNsPrefix.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+<font face="verdana" size="-1">This inspection checks for unbound namespace prefixes in XML
+</font>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/XmlUnusedNamespaceDeclaration.html b/xml/impl/resources/inspectionDescriptions/XmlUnusedNamespaceDeclaration.html
new file mode 100644
index 0000000..7722c64
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/XmlUnusedNamespaceDeclaration.html
@@ -0,0 +1,7 @@
+<html>
+<body>
+<span style="font-family: verdana,serif; font-size: smaller;">
+  Checks for unused namespace declarations and location hints in XML
+</span>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/inspectionDescriptions/XmlWrongRootElement.html b/xml/impl/resources/inspectionDescriptions/XmlWrongRootElement.html
new file mode 100644
index 0000000..81bf01c
--- /dev/null
+++ b/xml/impl/resources/inspectionDescriptions/XmlWrongRootElement.html
@@ -0,0 +1,7 @@
+<html>
+<body>
+<font face="verdana" size="-1">This inspection checks if root tag name is the same as in &lt;doctype&gt;.<br>
+</font>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/intentionDescriptions/AddSchemaPrefixIntention/after.xml.template b/xml/impl/resources/intentionDescriptions/AddSchemaPrefixIntention/after.xml.template
new file mode 100644
index 0000000..e46b614
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/AddSchemaPrefixIntention/after.xml.template
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<<spot>xs</spot>:schema targetNamespace="http://mySchema"
+        xmlns:<spot>xs</spot>="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <<spot>xs</spot>:element name="myElement" type="my:TYPE"/>
+    <<spot>xs</spot>:simpleType name="TYPE" id="TYPE">
+        <<spot>xs</spot>:restriction base="<spot>xs</spot>:integer">
+            <<spot>xs</spot>:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </<spot>xs</spot>:restriction>
+    </<spot>xs</spot>:simpleType>
+</<spot>xs</spot>:schema>
diff --git a/xml/impl/resources/intentionDescriptions/AddSchemaPrefixIntention/before.xml.template b/xml/impl/resources/intentionDescriptions/AddSchemaPrefixIntention/before.xml.template
new file mode 100644
index 0000000..2e2b85a
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/AddSchemaPrefixIntention/before.xml.template
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://mySchema"
+        <spot>xmlns</spot>="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <element name="myElement" type="my:TYPE"/>
+    <simpleType name="TYPE" id="TYPE">
+        <restriction base="integer">
+            <minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </restriction>
+    </simpleType>
+</schema>
diff --git a/xml/impl/resources/intentionDescriptions/AddSchemaPrefixIntention/description.html b/xml/impl/resources/intentionDescriptions/AddSchemaPrefixIntention/description.html
new file mode 100644
index 0000000..c0094d0
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/AddSchemaPrefixIntention/description.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+<span style="font-family: verdana,serif; font-size: smaller;">Inserts namespace prefix</span>
+</body>
+</html>
diff --git a/xml/impl/resources/intentionDescriptions/AddXsiSchemaLocationForExtResourceAction/after.xml.template b/xml/impl/resources/intentionDescriptions/AddXsiSchemaLocationForExtResourceAction/after.xml.template
new file mode 100644
index 0000000..b50cd04
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/AddXsiSchemaLocationForExtResourceAction/after.xml.template
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        <spot>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd"</spot>>
+          
+</schema>
\ No newline at end of file
diff --git a/xml/impl/resources/intentionDescriptions/AddXsiSchemaLocationForExtResourceAction/before.xml.template b/xml/impl/resources/intentionDescriptions/AddXsiSchemaLocationForExtResourceAction/before.xml.template
new file mode 100644
index 0000000..e9667d7
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/AddXsiSchemaLocationForExtResourceAction/before.xml.template
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="<spot>http://www.w3.org/2001/XMLSchema</spot>">
+
+</schema>
\ No newline at end of file
diff --git a/xml/impl/resources/intentionDescriptions/AddXsiSchemaLocationForExtResourceAction/description.html b/xml/impl/resources/intentionDescriptions/AddXsiSchemaLocationForExtResourceAction/description.html
new file mode 100644
index 0000000..5742887
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/AddXsiSchemaLocationForExtResourceAction/description.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+Adds xsi:schemaLocation attribute.
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/intentionDescriptions/ConvertSchemaPrefixToDefaultIntention/after.xml.template b/xml/impl/resources/intentionDescriptions/ConvertSchemaPrefixToDefaultIntention/after.xml.template
new file mode 100644
index 0000000..2e2b85a
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/ConvertSchemaPrefixToDefaultIntention/after.xml.template
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://mySchema"
+        <spot>xmlns</spot>="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <element name="myElement" type="my:TYPE"/>
+    <simpleType name="TYPE" id="TYPE">
+        <restriction base="integer">
+            <minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </restriction>
+    </simpleType>
+</schema>
diff --git a/xml/impl/resources/intentionDescriptions/ConvertSchemaPrefixToDefaultIntention/before.xml.template b/xml/impl/resources/intentionDescriptions/ConvertSchemaPrefixToDefaultIntention/before.xml.template
new file mode 100644
index 0000000..e46b614
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/ConvertSchemaPrefixToDefaultIntention/before.xml.template
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<<spot>xs</spot>:schema targetNamespace="http://mySchema"
+        xmlns:<spot>xs</spot>="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <<spot>xs</spot>:element name="myElement" type="my:TYPE"/>
+    <<spot>xs</spot>:simpleType name="TYPE" id="TYPE">
+        <<spot>xs</spot>:restriction base="<spot>xs</spot>:integer">
+            <<spot>xs</spot>:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </<spot>xs</spot>:restriction>
+    </<spot>xs</spot>:simpleType>
+</<spot>xs</spot>:schema>
diff --git a/xml/impl/resources/intentionDescriptions/ConvertSchemaPrefixToDefaultIntention/description.html b/xml/impl/resources/intentionDescriptions/ConvertSchemaPrefixToDefaultIntention/description.html
new file mode 100644
index 0000000..6bc2fed
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/ConvertSchemaPrefixToDefaultIntention/description.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+<span style="font-family: verdana,serif; font-size: smaller;">Removes selected namespace prefix</span>
+</body>
+</html>
diff --git a/xml/impl/resources/intentionDescriptions/ManuallySetupExtResourceAction/after.xml.template b/xml/impl/resources/intentionDescriptions/ManuallySetupExtResourceAction/after.xml.template
new file mode 100644
index 0000000..731cb77
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/ManuallySetupExtResourceAction/after.xml.template
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation=<spot>"http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd"</spot>>
+
+</schema>
diff --git a/xml/impl/resources/intentionDescriptions/ManuallySetupExtResourceAction/before.xml.template b/xml/impl/resources/intentionDescriptions/ManuallySetupExtResourceAction/before.xml.template
new file mode 100644
index 0000000..8cf142f
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/ManuallySetupExtResourceAction/before.xml.template
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation=<spot>"http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd"</spot>>
+
+</schema>
\ No newline at end of file
diff --git a/xml/impl/resources/intentionDescriptions/ManuallySetupExtResourceAction/description.html b/xml/impl/resources/intentionDescriptions/ManuallySetupExtResourceAction/description.html
new file mode 100644
index 0000000..960e034
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/ManuallySetupExtResourceAction/description.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+Allows to map given namespace to an XML schema file (DTD or XSD).
+</body>
+</html>
diff --git a/xml/impl/resources/intentionDescriptions/XmlChooseColorIntentionAction/after.xml.template b/xml/impl/resources/intentionDescriptions/XmlChooseColorIntentionAction/after.xml.template
new file mode 100644
index 0000000..c01695f
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/XmlChooseColorIntentionAction/after.xml.template
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+    <tag attr="<spot>abcdef</spot>"/>
+</root>
diff --git a/xml/impl/resources/intentionDescriptions/XmlChooseColorIntentionAction/before.xml.template b/xml/impl/resources/intentionDescriptions/XmlChooseColorIntentionAction/before.xml.template
new file mode 100644
index 0000000..187344c
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/XmlChooseColorIntentionAction/before.xml.template
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+    <tag attr="<spot>123456</spot>"/>
+</root>
\ No newline at end of file
diff --git a/xml/impl/resources/intentionDescriptions/XmlChooseColorIntentionAction/description.html b/xml/impl/resources/intentionDescriptions/XmlChooseColorIntentionAction/description.html
new file mode 100644
index 0000000..18345fe2
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/XmlChooseColorIntentionAction/description.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+Allows to call Color Chooser for attributes
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/intentionDescriptions/XmlSplitTagAction/after.html.template b/xml/impl/resources/intentionDescriptions/XmlSplitTagAction/after.html.template
new file mode 100644
index 0000000..7a1a0b6
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/XmlSplitTagAction/after.html.template
@@ -0,0 +1,6 @@
+<html>
+<body>
+<p>this tag should be <spot></p>
+<p></spot>splitted at caret position</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/intentionDescriptions/XmlSplitTagAction/before.html.template b/xml/impl/resources/intentionDescriptions/XmlSplitTagAction/before.html.template
new file mode 100644
index 0000000..c24ed93
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/XmlSplitTagAction/before.html.template
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>this tag should be <spot></spot>splitted at caret position</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/impl/resources/intentionDescriptions/XmlSplitTagAction/description.html b/xml/impl/resources/intentionDescriptions/XmlSplitTagAction/description.html
new file mode 100644
index 0000000..f3afa2c
--- /dev/null
+++ b/xml/impl/resources/intentionDescriptions/XmlSplitTagAction/description.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+This intention splits current tag at caret position<br><br>
+</body>
+</html>
diff --git a/xml/impl/resources/liveTemplates/html_xml.xml b/xml/impl/resources/liveTemplates/html_xml.xml
new file mode 100644
index 0000000..4d5626d
--- /dev/null
+++ b/xml/impl/resources/liveTemplates/html_xml.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templateSet group="html/xml">
+  <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.tag.pair" 
+      name="t" toReformat="true" toShortenFQNames="true" value="&lt;$TAG$ $ATTRS$&gt;$END$&lt;/$TAG_NAME$&gt;">
+    <variable name="TAG" expression="" defaultValue="" alwaysStopAt="true" />
+    <variable name="ATTRS" expression="" defaultValue="&quot;&quot;" alwaysStopAt="false" />
+    <variable name="TAG_NAME" expression="firstWord(TAG)" defaultValue="&quot;&quot;" alwaysStopAt="false" />
+    <context>
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_COMMENT" value="true" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="XML" value="true" />
+      <option name="HTML" value="true" />
+      <option name="JSP" value="true" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.surround.tag"
+    name="T" toReformat="true" toShortenFQNames="true" value="&lt;$TAG$&gt;$SELECTION$&lt;/$TAGNAME$&gt;&#13;&#10;">
+    <variable name="TAG" expression="" defaultValue="" alwaysStopAt="true" />
+    <variable name="SELECTION" expression="" defaultValue="" alwaysStopAt="false" />
+    <variable name="TAGNAME" expression="firstWord(TAG)" defaultValue="&quot;&quot;" alwaysStopAt="false" />
+    <context>
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="XML" value="true" />
+      <option name="HTML" value="false" />
+      <option name="JSP" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.surround.tag.in.htmlorjsp"
+    name="T2" toReformat="false" toShortenFQNames="false" value="&lt;$TAG$&gt;$SELECTION$&lt;/$TAGNAME$&gt;">
+    <variable name="TAG" expression="" defaultValue="" alwaysStopAt="true" />
+    <variable name="SELECTION" expression="" defaultValue="" alwaysStopAt="false" />
+    <variable name="TAGNAME" expression="firstWord(TAG)" defaultValue="&quot;&quot;" alwaysStopAt="false" />
+    <context>
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="XML" value="false" />
+      <option name="HTML" value="true" />
+      <option name="JSP" value="true" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.surround.cdata.in.xmlorhtmlorjsp"
+    name="CD" toReformat="false" toShortenFQNames="false" value="&lt;![CDATA[&#10;$SELECTION$&#10;]]&gt;">
+    <variable name="SELECTION" expression="" defaultValue="" alwaysStopAt="false" />
+    <context>
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="XML" value="true" />
+      <option name="HTML" value="true" />
+      <option name="JSP" value="true" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+</templateSet>
+
diff --git a/xml/impl/resources/liveTemplates/zen_html.xml b/xml/impl/resources/liveTemplates/zen_html.xml
new file mode 100644
index 0000000..43025dc
--- /dev/null
+++ b/xml/impl/resources/liveTemplates/zen_html.xml
@@ -0,0 +1,766 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templateSet group="Zen HTML">
+  <template description="" name="html:xs" toReformat="true" toShortenFQNames="true" value="&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;&#10;&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;$ENV_LANG$&quot;&gt;&#10;&lt;head&gt;&#10;  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=UTF-8&quot; /&gt;&#10;  &lt;title&gt;&lt;/title&gt;&#10;&lt;/head&gt;&#10;&lt;body&gt;&#10;  $END$&#10;&lt;/body&gt;&#10;&lt;/html&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;en&quot;" expression="" name="ENV_LANG"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="html:4t" toReformat="true" toShortenFQNames="true" value="&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;&#10;&lt;html lang=&quot;$ENV_LANG$&quot;&gt;&#10;&lt;head&gt;&#10;  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;&#10;  &lt;title&gt;&lt;/title&gt;&#10;&lt;/head&gt;&#10;&lt;body&gt;&#10;  $END$&#10;&lt;/body&gt;&#10;&lt;/html&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;en&quot;" expression="" name="ENV_LANG"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="cc:ie6" toReformat="true" toShortenFQNames="true" value="&lt;!--[if lte IE 6]&gt;&#10;  $END$&#10;&lt;![endif]--&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="html:4s" toReformat="true" toShortenFQNames="true" value="&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;&#10;&lt;html lang=&quot;$ENV_LANG$&quot;&gt;&#10;&lt;head&gt;&#10;  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;&#10;  &lt;title&gt;&lt;/title&gt;&#10;&lt;/head&gt;&#10;&lt;body&gt;&#10;  $END$&#10;&lt;/body&gt;&#10;&lt;/html&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;en&quot;" expression="" name="ENV_LANG"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="cc:noie" toReformat="true" toShortenFQNames="true" value="&lt;!--[if !IE]&gt;&lt;!--&gt;&#10;  $END$&#10;&lt;!--&lt;![endif]--&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="html:5" toReformat="true" toShortenFQNames="true" value="&lt;!DOCTYPE HTML&gt;&#10;&lt;html lang=&quot;$ENV_LOCALE$&quot;&gt;&#10;&lt;head&gt;&#10;  &lt;meta charset=&quot;UTF-8&quot;&gt;&#10;  &lt;title&gt;&lt;/title&gt;&#10;&lt;/head&gt;&#10;&lt;body&gt;&#10;  $END$&#10;&lt;/body&gt;&#10;&lt;/html&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;en-US&quot;" expression="" name="ENV_LOCALE"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="cc:ie" toReformat="true" toShortenFQNames="true" value="&lt;!--[if IE]&gt;&#10;  $END$&#10;&lt;![endif]--&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="html:xt" toReformat="true" toShortenFQNames="true" value="&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;&#10;&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;$ENV_LANG$&quot;&gt;&#10;&lt;head&gt;&#10;  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=UTF-8&quot; /&gt;&#10;  &lt;title&gt;&lt;/title&gt;&#10;&lt;/head&gt;&#10;&lt;body&gt;&#10;  $END$&#10;&lt;/body&gt;&#10;&lt;/html&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;en&quot;" expression="" name="ENV_LANG"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="html:xxs" toReformat="true" toShortenFQNames="true" value="&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;&#10;&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;$ENV_LANG$&quot;&gt;&#10;&lt;head&gt;&#10;  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=UTF-8&quot; /&gt;&#10;  &lt;title&gt;&lt;/title&gt;&#10;&lt;/head&gt;&#10;&lt;body&gt;&#10;  $END$&#10;&lt;/body&gt;&#10;&lt;/html&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;en&quot;" expression="" name="ENV_LANG"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;a href=&quot;http://...&quot;&gt;...&lt;/a&gt;" name="a:link" toReformat="true" toShortenFQNames="true" value="&lt;a href=&quot;http://$VAR0$&quot;&gt;$END$&lt;/a&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;datetime-local&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:datetime-local" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;datetime-local&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;reset&quot; value=&quot;...&quot;&gt;" name="input:reset" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;reset&quot; value=&quot;$VAR0$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;colgroup&gt;...&lt;/colgroup&gt;" name="colg" toReformat="true" toShortenFQNames="true" value="&lt;colgroup&gt;$END$&lt;/colgroup&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;style type=&quot;text/css&quot;&gt;...&lt;/style&gt;" name="style" toReformat="true" toShortenFQNames="true" value="&lt;style type=&quot;text/css&quot;&gt;$END$&lt;/style&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;address&gt;...&lt;/address&gt;" name="adr" toReformat="true" toShortenFQNames="true" value="&lt;address&gt;$END$&lt;/address&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;img src=&quot;...&quot; alt=&quot;...&quot;&gt;" name="img" toReformat="true" toShortenFQNames="true" value="&lt;img src=&quot;$VAR0$&quot; alt=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;bdo dir=&quot;ltr&quot;&gt;...&lt;/bdo&gt;" name="bdo:l" toReformat="true" toShortenFQNames="true" value="&lt;bdo dir=&quot;ltr&quot;&gt;$END$&lt;/bdo&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;param name=&quot;...&quot; value=&quot;...&quot;&gt;" name="param" toReformat="true" toShortenFQNames="true" value="&lt;param name=&quot;$VAR0$&quot; value=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="colgroup+" toReformat="true" toShortenFQNames="true" value="&lt;colgroup&gt;&#10;  &lt;col&gt;&#10;&lt;/colgroup&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;form action=&quot;...&quot; method=&quot;post&quot;&gt;...&lt;/form&gt;" name="form:post" toReformat="true" toShortenFQNames="true" value="&lt;form action=&quot;$VAR0$&quot; method=&quot;post&quot;&gt;$END$&lt;/form&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;bdo dir=&quot;rtl&quot;&gt;...&lt;/bdo&gt;" name="bdo:r" toReformat="true" toShortenFQNames="true" value="&lt;bdo dir=&quot;rtl&quot;&gt;$END$&lt;/bdo&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;figure&gt;...&lt;/figure&gt;" name="fig" toReformat="true" toShortenFQNames="true" value="&lt;figure&gt;$END$&lt;/figure&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;radio&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:radio" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;radio&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;...print.css&quot; media=&quot;print&quot;&gt;" name="link:print" toReformat="true" toShortenFQNames="true" value="&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;$END$print.css&quot; media=&quot;print&quot;&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;option&gt;...&lt;/option&gt;" name="opt" toReformat="true" toShortenFQNames="true" value="&lt;option&gt;$END$&lt;/option&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;image&quot; src=&quot;...&quot; alt=&quot;...&quot;&gt;" name="input:i" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;image&quot; src=&quot;$VAR0$&quot; alt=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;hidden&quot; name=&quot;...&quot;&gt;" name="input:h" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;hidden&quot; name=&quot;$VAR0$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;file&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:f" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;file&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;checkbox&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:c" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;checkbox&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;button&quot; value=&quot;...&quot;&gt;" name="input:b" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;button&quot; value=&quot;$VAR0$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;abbr title=&quot;...&quot;&gt;...&lt;/abbr&gt;" name="abbr" toReformat="true" toShortenFQNames="true" value="&lt;abbr title=&quot;$VAR0$&quot;&gt;$END$&lt;/abbr&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;text&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:t" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;text&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;password&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:p" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;password&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;submit&quot; value=&quot;...&quot;&gt;" name="input:s" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;submit&quot; value=&quot;$VAR0$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;radio&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:r" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;radio&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;iframe&gt;...&lt;/iframe&gt;" name="ifr" toReformat="true" toShortenFQNames="true" value="&lt;iframe&gt;$END$&lt;/iframe&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;embed&gt;" name="emb" toReformat="true" toShortenFQNames="true" value="&lt;embed&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="optg+" toReformat="true" toShortenFQNames="true" value="&lt;optgroup&gt;&#10;  &lt;option value=&quot;$VAR0$&quot;&gt;$END$&lt;/option&gt;&#10;&lt;/optgroup&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;command&gt;" name="cmd" toReformat="true" toShortenFQNames="true" value="&lt;command&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;link rel=&quot;alternate&quot; type=&quot;application/atom+xml&quot; title=&quot;Atom&quot; href=&quot;atom.xml&quot;&gt;" name="link:atom" toReformat="true" toShortenFQNames="true" value="&lt;link rel=&quot;alternate&quot; type=&quot;application/atom+xml&quot; title=&quot;Atom&quot; href=&quot;atom.xml&quot;&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="table+" toReformat="true" toShortenFQNames="true" value="&lt;table&gt;&#10;  &lt;tr&gt;&#10;    &lt;td&gt;$END$&lt;/td&gt;&#10;  &lt;/tr&gt;&#10;&lt;/table&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;article&gt;...&lt;/article&gt;" name="art" toReformat="true" toShortenFQNames="true" value="&lt;article&gt;$END$&lt;/article&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;search&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:search" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;search&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;area shape=&quot;rect&quot; coords=&quot;...&quot; href=&quot;...&quot; alt=&quot;...&quot;&gt;" name="area:r" toReformat="true" toShortenFQNames="true" value="&lt;area shape=&quot;rect&quot; coords=&quot;$VAR0$&quot; href=&quot;$VAR1$&quot; alt=&quot;$VAR2$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR2"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;area shape=&quot;poly&quot; coords=&quot;...&quot; href=&quot;...&quot; alt=&quot;...&quot;&gt;" name="area:p" toReformat="true" toShortenFQNames="true" value="&lt;area shape=&quot;poly&quot; coords=&quot;$VAR0$&quot; href=&quot;$VAR1$&quot; alt=&quot;$VAR2$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR2"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;date&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:date" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;date&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;video src=&quot;...&quot;&gt;...&lt;/video&gt;" name="video" toReformat="true" toShortenFQNames="true" value="&lt;video src=&quot;$VAR0$&quot;&gt;$END$&lt;/video&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;button&quot; value=&quot;...&quot;&gt;" name="input:button" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;button&quot; value=&quot;$VAR0$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;area shape=&quot;default&quot; href=&quot;...&quot; alt=&quot;...&quot;&gt;" name="area:d" toReformat="true" toShortenFQNames="true" value="&lt;area shape=&quot;default&quot; href=&quot;$VAR0$&quot; alt=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;area shape=&quot;circle&quot; coords=&quot;...&quot; href=&quot;...&quot; alt=&quot;...&quot;&gt;" name="area:c" toReformat="true" toShortenFQNames="true" value="&lt;area shape=&quot;circle&quot; coords=&quot;$VAR0$&quot; href=&quot;$VAR1$&quot; alt=&quot;$VAR2$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR2"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;output&gt;...&lt;/output&gt;" name="out" toReformat="true" toShortenFQNames="true" value="&lt;output&gt;$END$&lt;/output&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;footer&gt;...&lt;/footer&gt;" name="ftr" toReformat="true" toShortenFQNames="true" value="&lt;footer&gt;$END$&lt;/footer&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;dialog&gt;...&lt;/dialog&gt;" name="dlg" toReformat="true" toShortenFQNames="true" value="&lt;dialog&gt;$END$&lt;/dialog&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;script type=&quot;text/javascript&quot; src=&quot;...&quot;&gt;...&lt;/script&gt;" name="script:src" toReformat="true" toShortenFQNames="true" value="&lt;script type=&quot;text/javascript&quot; src=&quot;$VAR0$&quot;&gt;$END$&lt;/script&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;form action=&quot;...&quot; method=&quot;get&quot;&gt;...&lt;/form&gt;" name="form:get" toReformat="true" toShortenFQNames="true" value="&lt;form action=&quot;$VAR0$&quot; method=&quot;get&quot;&gt;$END$&lt;/form&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;" name="meta:utf" toReformat="true" toShortenFQNames="true" value="&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;label for=&quot;...&quot;&gt;...&lt;/label&gt;" name="label" toReformat="true" toShortenFQNames="true" value="&lt;label for=&quot;$VAR0$&quot;&gt;$END$&lt;/label&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;time&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:time" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;time&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/x-icon&quot; href=&quot;...favicon.ico&quot;&gt;" name="link:favicon" toReformat="true" toShortenFQNames="true" value="&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/x-icon&quot; href=&quot;$END$favicon.ico&quot;&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;menu type=&quot;toolbar&quot;&gt;...&lt;/menu&gt;" name="menu:toolbar" toReformat="true" toShortenFQNames="true" value="&lt;menu type=&quot;toolbar&quot;&gt;$END$&lt;/menu&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;progress&gt;...&lt;/progress&gt;" name="prog" toReformat="true" toShortenFQNames="true" value="&lt;progress&gt;$END$&lt;/progress&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;email&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:email" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;email&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;optgroup&gt;...&lt;/optgroup&gt;" name="optg" toReformat="true" toShortenFQNames="true" value="&lt;optgroup&gt;$END$&lt;/optgroup&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;strong&gt;...&lt;/strong&gt;" name="str" toReformat="true" toShortenFQNames="true" value="&lt;strong&gt;$END$&lt;/strong&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;legend&gt;...&lt;/legend&gt;" name="leg" toReformat="true" toShortenFQNames="true" value="&lt;legend&gt;$END$&lt;/legend&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;acronym title=&quot;...&quot;&gt;...&lt;/acronym&gt;" name="acronym" toReformat="true" toShortenFQNames="true" value="&lt;acronym title=&quot;$VAR0$&quot;&gt;$END$&lt;/acronym&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="ol+" toReformat="true" toShortenFQNames="true" value="&lt;ol&gt;&#10;  &lt;li&gt;$END$&lt;/li&gt;&#10;&lt;/ol&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="tr+" toReformat="true" toShortenFQNames="true" value="&lt;tr&gt;&#10;  &lt;td&gt;$END$&lt;/td&gt;&#10;&lt;/tr&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="optgroup+" toReformat="true" toShortenFQNames="true" value="&lt;optgroup&gt;&#10;  &lt;option value=&quot;$VAR0$&quot;&gt;$END$&lt;/option&gt;&#10;&lt;/optgroup&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;base href=&quot;...&quot;&gt;" name="base" toReformat="true" toShortenFQNames="true" value="&lt;base href=&quot;$VAR0$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;blockquote&gt;...&lt;/blockquote&gt;" name="bq" toReformat="true" toShortenFQNames="true" value="&lt;blockquote&gt;$END$&lt;/blockquote&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;source&gt;...&lt;/source&gt;" name="src" toReformat="true" toShortenFQNames="true" value="&lt;source&gt;$END$&lt;/source&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;object&gt;...&lt;/object&gt;" name="obj" toReformat="true" toShortenFQNames="true" value="&lt;object&gt;$END$&lt;/object&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="dl+" toReformat="true" toShortenFQNames="true" value="&lt;dl&gt;&#10;  &lt;dt&gt;$VAR0$&lt;/dt&gt;&#10;  &lt;dd&gt;$END$&lt;/dd&gt;&#10;&lt;/dl&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;script type=&quot;text/javascript&quot;&gt;...&lt;/script&gt;" name="script" toReformat="true" toShortenFQNames="true" value="&lt;script type=&quot;text/javascript&quot;&gt;$END$&lt;/script&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;acronym&gt;...&lt;/acronym&gt;" name="acr" toReformat="true" toShortenFQNames="true" value="&lt;acronym&gt;$END$&lt;/acronym&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;password&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:password" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;password&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;file&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:file" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;file&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;textarea&gt;...&lt;/textarea&gt;" name="tarea" toReformat="true" toShortenFQNames="true" value="&lt;textarea&gt;$END$&lt;/textarea&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;select name=&quot;...&quot; id=&quot;...&quot;&gt;...&lt;/select&gt;" name="select" toReformat="true" toShortenFQNames="true" value="&lt;select name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;$END$&lt;/select&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;number&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:number" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;number&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;range&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:range" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;range&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;area shape=&quot;...&quot; coords=&quot;...&quot; href=&quot;...&quot; alt=&quot;...&quot;&gt;" name="area" toReformat="true" toShortenFQNames="true" value="&lt;area shape=&quot;$VAR0$&quot; coords=&quot;$VAR1$&quot; href=&quot;$VAR2$&quot; alt=&quot;$VAR3$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR2"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR3"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;image&quot; src=&quot;...&quot; alt=&quot;...&quot;&gt;" name="input:image" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;image&quot; src=&quot;$VAR0$&quot; alt=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="ul+" toReformat="true" toShortenFQNames="true" value="&lt;ul&gt;&#10;  &lt;li&gt;$END$&lt;/li&gt;&#10;&lt;/ul&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;month&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:month" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;month&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;fieldset&gt;...&lt;/fieldset&gt;" name="fset" toReformat="true" toShortenFQNames="true" value="&lt;fieldset&gt;$END$&lt;/fieldset&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=Win-1251&quot;&gt;" name="meta:win" toReformat="true" toShortenFQNames="true" value="&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=Win-1251&quot;&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;menu type=&quot;toolbar&quot;&gt;...&lt;/menu&gt;" name="menu:t" toReformat="true" toShortenFQNames="true" value="&lt;menu type=&quot;toolbar&quot;&gt;$END$&lt;/menu&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;form action=&quot;...&quot;&gt;...&lt;/form&gt;" name="form" toReformat="true" toShortenFQNames="true" value="&lt;form action=&quot;$VAR0$&quot;&gt;$END$&lt;/form&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;menu type=&quot;context&quot;&gt;...&lt;/menu&gt;" name="menu:c" toReformat="true" toShortenFQNames="true" value="&lt;menu type=&quot;context&quot;&gt;$END$&lt;/menu&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;link rel=&quot;stylesheet&quot; href=&quot;...&quot;&gt;" name="link" toReformat="true" toShortenFQNames="true" value="&lt;link rel=&quot;stylesheet&quot; href=&quot;$VAR0$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;...&quot;&gt;" name="input" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;$VAR0$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;link rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;RSS&quot; href=&quot;...rss.xml&quot;&gt;" name="link:rss" toReformat="true" toShortenFQNames="true" value="&lt;link rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;RSS&quot; href=&quot;$END$rss.xml&quot;&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="select+" toReformat="true" toShortenFQNames="true" value="&lt;select name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;&#10;  &lt;option value=&quot;$VAR2$&quot;&gt;$END$&lt;/option&gt;&#10;&lt;/select&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR2"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;header&gt;...&lt;/header&gt;" name="hdr" toReformat="true" toShortenFQNames="true" value="&lt;header&gt;$END$&lt;/header&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;caption&gt;...&lt;/caption&gt;" name="cap" toReformat="true" toShortenFQNames="true" value="&lt;caption&gt;$END$&lt;/caption&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;details&gt;...&lt;/details&gt;" name="det" toReformat="true" toShortenFQNames="true" value="&lt;details&gt;$END$&lt;/details&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;link rel=&quot;apple-touch-icon&quot; href=&quot;...favicon.png&quot;&gt;" name="link:touch" toReformat="true" toShortenFQNames="true" value="&lt;link rel=&quot;apple-touch-icon&quot; href=&quot;$END$favicon.png&quot;&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;iframe src=&quot;...&quot; frameborder=&quot;0&quot;&gt;...&lt;/iframe&gt;" name="iframe" toReformat="true" toShortenFQNames="true" value="&lt;iframe src=&quot;$VAR0$&quot; frameborder=&quot;0&quot;&gt;$END$&lt;/iframe&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;....css&quot; media=&quot;all&quot;&gt;" name="link:css" toReformat="true" toShortenFQNames="true" value="&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;$END$.css&quot; media=&quot;all&quot;&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;week&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:week" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;week&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;embed src=&quot;...&quot; type=&quot;...&quot;&gt;" name="embed" toReformat="true" toShortenFQNames="true" value="&lt;embed src=&quot;$VAR0$&quot; type=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;datagrid&gt;...&lt;/datagrid&gt;" name="datag" toReformat="true" toShortenFQNames="true" value="&lt;datagrid&gt;$END$&lt;/datagrid&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;datetime&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:datetime" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;datetime&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;option value=&quot;...&quot;&gt;...&lt;/option&gt;" name="option" toReformat="true" toShortenFQNames="true" value="&lt;option value=&quot;$VAR0$&quot;&gt;$END$&lt;/option&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;...&lt;/html&gt;" name="html:xml" toReformat="true" toShortenFQNames="true" value="&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;$END$&lt;/html&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;button&gt;...&lt;/button&gt;" name="btn" toReformat="true" toShortenFQNames="true" value="&lt;button&gt;$END$&lt;/button&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;url&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:url" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;url&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;menu type=&quot;context&quot;&gt;...&lt;/menu&gt;" name="menu:context" toReformat="true" toShortenFQNames="true" value="&lt;menu type=&quot;context&quot;&gt;$END$&lt;/menu&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="colg+" toReformat="true" toShortenFQNames="true" value="&lt;colgroup&gt;&#10;  &lt;col&gt;&#10;&lt;/colgroup&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;map name=&quot;...&quot;&gt;...&lt;/map&gt;" name="map" toReformat="true" toShortenFQNames="true" value="&lt;map name=&quot;$VAR0$&quot;&gt;$END$&lt;/map&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;color&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:color" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;color&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=7&quot;&gt;" name="meta:compat" toReformat="true" toShortenFQNames="true" value="&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=7&quot;&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;hidden&quot; name=&quot;...&quot;&gt;" name="input:hidden" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;hidden&quot; name=&quot;$VAR0$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;object data=&quot;...&quot; type=&quot;...&quot;&gt;...&lt;/object&gt;" name="object" toReformat="true" toShortenFQNames="true" value="&lt;object data=&quot;$VAR0$&quot; type=&quot;$VAR1$&quot;&gt;$END$&lt;/object&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;a href=&quot;mailto:...&quot;&gt;...&lt;/a&gt;" name="a:mail" toReformat="true" toShortenFQNames="true" value="&lt;a href=&quot;mailto:$VAR0$&quot;&gt;$END$&lt;/a&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;a href=&quot;...&quot;&gt;...&lt;/a&gt;" name="a" toReformat="true" toShortenFQNames="true" value="&lt;a href=&quot;$VAR0$&quot;&gt;$END$&lt;/a&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;datalist&gt;...&lt;/datalist&gt;" name="datal" toReformat="true" toShortenFQNames="true" value="&lt;datalist&gt;$END$&lt;/datalist&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;keygen&gt;" name="kg" toReformat="true" toShortenFQNames="true" value="&lt;keygen&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;textarea name=&quot;...&quot; id=&quot;...&quot; cols=&quot;30&quot; rows=&quot;10&quot;&gt;...&lt;/textarea&gt;" name="textarea" toReformat="true" toShortenFQNames="true" value="&lt;textarea name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot; cols=&quot;30&quot; rows=&quot;10&quot;&gt;$END$&lt;/textarea&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="map+" toReformat="true" toShortenFQNames="true" value="&lt;map name=&quot;$VAR0$&quot;&gt;&#10;  &lt;area shape=&quot;$VAR1$&quot; coords=&quot;$VAR2$&quot; href=&quot;$VAR3$&quot; alt=&quot;$VAR4$&quot;&gt;&#10;&lt;/map&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR2"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR3"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR4"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;submit&quot; value=&quot;...&quot;&gt;" name="input:submit" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;submit&quot; value=&quot;$VAR0$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;text&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:text" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;text&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;input type=&quot;checkbox&quot; name=&quot;...&quot; id=&quot;...&quot;&gt;" name="input:checkbox" toReformat="true" toShortenFQNames="true" value="&lt;input type=&quot;checkbox&quot; name=&quot;$VAR0$&quot; id=&quot;$VAR1$&quot;&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;fieldset&gt;...&lt;/fieldset&gt;" name="fst" toReformat="true" toShortenFQNames="true" value="&lt;fieldset&gt;$END$&lt;/fieldset&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;section&gt;...&lt;/section&gt;" name="sect" toReformat="true" toShortenFQNames="true" value="&lt;section&gt;$END$&lt;/section&gt;">
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;audio src=&quot;...&quot;&gt;...&lt;/audio&gt;" name="audio" toReformat="true" toShortenFQNames="true" value="&lt;audio src=&quot;$VAR0$&quot;&gt;$END$&lt;/audio&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;bdo dir=&quot;...&quot;&gt;...&lt;/bdo&gt;" name="bdo" toReformat="true" toShortenFQNames="true" value="&lt;bdo dir=&quot;$VAR0$&quot;&gt;$END$&lt;/bdo&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="HTML_TEXT" value="true"/>
+    </context>
+  </template>
+</templateSet>
diff --git a/xml/impl/resources/liveTemplates/zen_xsl.xml b/xml/impl/resources/liveTemplates/zen_xsl.xml
new file mode 100644
index 0000000..dbd599b
--- /dev/null
+++ b/xml/impl/resources/liveTemplates/zen_xsl.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templateSet group="Zen XSL">
+  <template description="&lt;xsl:template match=&quot;...&quot; mode=&quot;...&quot;&gt;...&lt;/xsl:template&gt;" name="tmatch" toReformat="true" toShortenFQNames="true" value="&lt;xsl:template match=&quot;$VAR0$&quot; mode=&quot;$VAR1$&quot;&gt;$END$&lt;/xsl:template&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:param name=&quot;...&quot; select=&quot;...&quot; /&gt;" name="par" toReformat="true" toShortenFQNames="true" value="&lt;xsl:param name=&quot;$VAR0$&quot; select=&quot;$VAR1$&quot; /&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:copy-of select=&quot;...&quot; /&gt;" name="co" toReformat="true" toShortenFQNames="true" value="&lt;xsl:copy-of select=&quot;$VAR0$&quot; /&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:attribute name=&quot;...&quot;&gt;...&lt;/xsl:attribute&gt;" name="attr" toReformat="true" toShortenFQNames="true" value="&lt;xsl:attribute name=&quot;$VAR0$&quot;&gt;$END$&lt;/xsl:attribute&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:value-of select=&quot;...&quot; /&gt;" name="val" toReformat="true" toShortenFQNames="true" value="&lt;xsl:value-of select=&quot;$VAR0$&quot; /&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:when test=&quot;...&quot;&gt;...&lt;/xsl:when&gt;" name="xsl:when" toReformat="true" toShortenFQNames="true" value="&lt;xsl:when test=&quot;$VAR0$&quot;&gt;$END$&lt;/xsl:when&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:for-each select=&quot;...&quot;&gt;...&lt;/xsl:for-each&gt;" name="each" toReformat="true" toShortenFQNames="true" value="&lt;xsl:for-each select=&quot;$VAR0$&quot;&gt;$END$&lt;/xsl:for-each&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:variable name=&quot;...&quot;&gt;...&lt;/xsl:variable&gt;" name="var" toReformat="true" toShortenFQNames="true" value="&lt;xsl:variable name=&quot;$VAR0$&quot;&gt;$END$&lt;/xsl:variable&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:when test=&quot;...&quot;&gt;...&lt;/xsl:when&gt;" name="wh" toReformat="true" toShortenFQNames="true" value="&lt;xsl:when test=&quot;$VAR0$&quot;&gt;$END$&lt;/xsl:when&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:template name=&quot;...&quot;&gt;...&lt;/xsl:template&gt;" name="tn" toReformat="true" toShortenFQNames="true" value="&lt;xsl:template name=&quot;$VAR0$&quot;&gt;$END$&lt;/xsl:template&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:apply-templates select=&quot;...&quot; mode=&quot;...&quot; /&gt;" name="ap" toReformat="true" toShortenFQNames="true" value="&lt;xsl:apply-templates select=&quot;$VAR0$&quot; mode=&quot;$VAR1$&quot; /&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:template match=&quot;...&quot; mode=&quot;...&quot;&gt;...&lt;/xsl:template&gt;" name="tm" toReformat="true" toShortenFQNames="true" value="&lt;xsl:template match=&quot;$VAR0$&quot; mode=&quot;$VAR1$&quot;&gt;$END$&lt;/xsl:template&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:call-template name=&quot;...&quot; /&gt;" name="call" toReformat="true" toShortenFQNames="true" value="&lt;xsl:call-template name=&quot;$VAR0$&quot; /&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="" name="choose+" toReformat="true" toShortenFQNames="true" value="&lt;xsl:choose&gt;&#10;  &lt;xsl:when test=&quot;$VAR0$&quot;&gt;$VAR1$&lt;/xsl:when&gt;&#10;  &lt;xsl:otherwise&gt;$END$&lt;/xsl:otherwise&gt;&#10;&lt;/xsl:choose&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:variable name=&quot;...&quot; select=&quot;...&quot; /&gt;" name="vare" toReformat="true" toShortenFQNames="true" value="&lt;xsl:variable name=&quot;$VAR0$&quot; select=&quot;$VAR1$&quot; /&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:with-param name=&quot;...&quot; select=&quot;...&quot; /&gt;" name="wp" toReformat="true" toShortenFQNames="true" value="&lt;xsl:with-param name=&quot;$VAR0$&quot; select=&quot;$VAR1$&quot; /&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR1"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:template name=&quot;...&quot;&gt;...&lt;/xsl:template&gt;" name="tname" toReformat="true" toShortenFQNames="true" value="&lt;xsl:template name=&quot;$VAR0$&quot;&gt;$END$&lt;/xsl:template&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+  <template description="&lt;xsl:if test=&quot;...&quot;&gt;...&lt;/xsl:if&gt;" name="if" toReformat="true" toShortenFQNames="true" value="&lt;xsl:if test=&quot;$VAR0$&quot;&gt;$END$&lt;/xsl:if&gt;">
+    <variable alwaysStopAt="true" defaultValue="&quot;&quot;" expression="" name="VAR0"/>
+    <context>
+      <option name="XSL_TEXT" value="true"/>
+    </context>
+  </template>
+</templateSet>
diff --git a/xml/impl/resources/standardSchemas/XMLSchema-instance.xsd b/xml/impl/resources/standardSchemas/XMLSchema-instance.xsd
new file mode 100644
index 0000000..e57428f
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/XMLSchema-instance.xsd
@@ -0,0 +1,25 @@
+<?xml version='1.0'?>
+<xs:schema targetNamespace="http://www.w3.org/2001/XMLSchema-instance"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:annotation>
+   <xs:documentation xmlns="http://www.w3.org/1999/xhtml">
+    <h1>XML Schema instance namespace</h1>
+    <p>See <a href="http://www.w3.org/TR/xmlschema-1/">The XML Schema draft recommendation</a> for an introduction</p>
+
+
+    <hr />
+    $Date: 2004/06/09 12:44:55 $<br />
+    $Id: XMLSchema-instance.xsd,v 1.1 2004/06/09 12:44:55 max Exp $
+  </xs:documentation>
+ </xs:annotation>
+ <xs:attribute name="type">
+  <xs:annotation>
+   <xs:documentation>No definitions are provided here, as
+                     this schema is never used as such</xs:documentation>
+  </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="nill"/>
+ <xs:attribute name="schemaLocation"/>
+ <xs:attribute name="noNamespaceSchemaLocation"/>
+</xs:schema>
diff --git a/xml/impl/resources/standardSchemas/XMLSchema.dtd b/xml/impl/resources/standardSchemas/XMLSchema.dtd
new file mode 100644
index 0000000..d3c70b3
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/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/xml/impl/resources/standardSchemas/XMLSchema.xsd b/xml/impl/resources/standardSchemas/XMLSchema.xsd
new file mode 100644
index 0000000..07e8e42
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/XMLSchema.xsd
@@ -0,0 +1,2468 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<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/xml/impl/resources/standardSchemas/catalog.xsd b/xml/impl/resources/standardSchemas/catalog.xsd
new file mode 100644
index 0000000..5b932b4
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/catalog.xsd
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'
+           xmlns:er='urn:oasis:names:tc:entity:xmlns:xml:catalog'
+           targetNamespace='urn:oasis:names:tc:entity:xmlns:xml:catalog'
+           elementFormDefault='qualified'>
+
+  <!-- $Id: catalog.xsd 226060 2003-04-22 14:53:32Z ndw $ -->
+
+  <xs:simpleType name='pubIdChars'>
+    <!-- A string of the characters defined as pubIdChar in production 13
+         of the Second Edition of the XML 1.0 Recommendation. Does not include
+         the whitespace characters because they're normalized by XML parsing. -->
+    <xs:restriction base='xs:string'>
+      <xs:pattern value="[a-zA-Z0-9-'()+,./:=?;!*#@$_%]*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name='publicIdentifier'>
+    <xs:restriction base='er:pubIdChars'/>
+  </xs:simpleType>
+
+  <xs:simpleType name='partialPublicIdentifier'>
+    <xs:restriction base='er:pubIdChars'/>
+  </xs:simpleType>
+
+  <xs:simpleType name='systemOrPublic'>
+    <xs:restriction base='xs:string'>
+      <xs:enumeration value='system'/>
+      <xs:enumeration value='public'/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <!-- The global attribute xml:base is not explicitly declared; -->
+  <!-- it is allowed by the anyAttribute declarations. -->
+
+  <xs:complexType name='catalog'>
+    <xs:choice minOccurs='1' maxOccurs='unbounded'>
+      <xs:element ref='er:public'/>
+      <xs:element ref='er:system'/>
+      <xs:element ref='er:uri'/>
+      <xs:element ref='er:rewriteSystem'/>
+      <xs:element ref='er:rewriteURI'/>
+      <xs:element ref='er:delegatePublic'/>
+      <xs:element ref='er:delegateSystem'/>
+      <xs:element ref='er:delegateURI'/>
+      <xs:element ref='er:nextCatalog'/>
+      <xs:element ref='er:group'/>
+      <xs:any namespace='##other' processContents='skip'/>
+    </xs:choice>
+    <xs:attribute name='id' type='xs:ID'/>
+    <xs:attribute name='prefer' type='er:systemOrPublic'/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+
+  <xs:complexType name='public'>
+    <xs:complexContent>
+      <xs:restriction base="xs:anyType">
+        <xs:attribute name="publicId" type="er:publicIdentifier"
+                       use="required"/>
+        <xs:attribute name="uri" type="xs:anyURI" use="required"/>
+        <xs:attribute name='id' type='xs:ID'/>
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name='system'>
+    <xs:complexContent>
+      <xs:restriction base="xs:anyType">
+        <xs:attribute name="systemId" type="xs:string"
+                       use="required"/>
+        <xs:attribute name="uri" type="xs:anyURI" use="required"/>
+        <xs:attribute name='id' type='xs:ID'/>
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name='uri'>
+    <xs:complexContent>
+      <xs:restriction base="xs:anyType">
+        <xs:attribute name="name" type="xs:anyURI"
+                       use="required"/>
+        <xs:attribute name="uri" type="xs:anyURI" use="required"/>
+        <xs:attribute name='id' type='xs:ID'/>
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name='rewriteSystem'>
+    <xs:complexContent>
+      <xs:restriction base="xs:anyType">
+        <xs:attribute name="systemIdStartString"
+                       type="xs:string"
+                       use="required"/>
+        <xs:attribute name="rewritePrefix" type="xs:string" use="required"/>
+        <xs:attribute name='id' type='xs:ID'/>
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name='rewriteURI'>
+    <xs:complexContent>
+      <xs:restriction base="xs:anyType">
+        <xs:attribute name="uriIdStartString"
+                       type="xs:string"
+                       use="required"/>
+        <xs:attribute name="rewritePrefix" type="xs:string" use="required"/>
+        <xs:attribute name='id' type='xs:ID'/>
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name='delegatePublic'>
+    <xs:complexContent>
+      <xs:restriction base="xs:anyType">
+        <xs:attribute name="publicIdStartString"
+                       type="er:partialPublicIdentifier"
+                       use="required"/>
+        <xs:attribute name="catalog" type="xs:anyURI" use="required"/>
+        <xs:attribute name='id' type='xs:ID'/>
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name='delegateSystem'>
+    <xs:complexContent>
+      <xs:restriction base="xs:anyType">
+        <xs:attribute name="systemIdStartString"
+                       type="xs:string"
+                       use="required"/>
+        <xs:attribute name="catalog" type="xs:anyURI" use="required"/>
+        <xs:attribute name='id' type='xs:ID'/>
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name='delegateURI'>
+    <xs:complexContent>
+      <xs:restriction base="xs:anyType">
+        <xs:attribute name="uriStartString"
+                       type="xs:string"
+                       use="required"/>
+        <xs:attribute name="catalog" type="xs:anyURI" use="required"/>
+        <xs:attribute name='id' type='xs:ID'/>
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name='nextCatalog'>
+    <xs:complexContent>
+      <xs:restriction base="xs:anyType">
+        <xs:attribute name="catalog" type="xs:anyURI" use="required"/>
+        <xs:attribute name='id' type='xs:ID'/>
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name='group'>
+    <xs:choice minOccurs='1' maxOccurs='unbounded'>
+      <xs:element ref='er:public'/>
+      <xs:element ref='er:system'/>
+      <xs:element ref='er:uri'/>
+      <xs:element ref='er:rewriteSystem'/>
+      <xs:element ref='er:rewriteURI'/>
+      <xs:element ref='er:delegatePublic'/>
+      <xs:element ref='er:delegateSystem'/>
+      <xs:element ref='er:delegateURI'/>
+      <xs:element ref='er:nextCatalog'/>
+      <xs:any namespace='##other' processContents='skip'/>
+    </xs:choice>
+    <xs:attribute name='prefer' type='er:systemOrPublic'/>
+    <xs:attribute name='id' type='xs:ID'/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+
+  <xs:element name="catalog" type="er:catalog"/>
+  <xs:element name="public" type="er:public"/>
+  <xs:element name="system" type="er:system"/>
+  <xs:element name="uri" type="er:uri"/>
+  <xs:element name="rewriteSystem" type="er:rewriteSystem"/>
+  <xs:element name="rewriteURI" type="er:rewriteURI"/>
+  <xs:element name="delegatePublic" type="er:delegatePublic"/>
+  <xs:element name="delegateSystem" type="er:delegateSystem"/>
+  <xs:element name="delegateURI" type="er:delegateURI"/>
+  <xs:element name="nextCatalog" type="er:nextCatalog"/>
+  <xs:element name="group" type="er:group"/>
+
+</xs:schema>
diff --git a/xml/impl/resources/standardSchemas/datatypes.dtd b/xml/impl/resources/standardSchemas/datatypes.dtd
new file mode 100644
index 0000000..ed07e4e
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/datatypes.dtd
@@ -0,0 +1,203 @@
+<!--
+        DTD for XML Schemas: Part 2: Datatypes
+        $Id: datatypes.dtd,v 1.23 2001/03/16 17:36:30 ht Exp $
+        Note this DTD is NOT normative, or even definitive. - - the
+        prose copy in the datatypes REC is the definitive version
+        (which shouldn't differ from this one except for this comment
+        and entity expansions, but just in case)
+  -->
+
+<!--
+        This DTD cannot be used on its own, it is intended
+        only for incorporation in XMLSchema.dtd, q.v.
+  -->
+
+<!-- Define all the element names, with optional prefix -->
+<!ENTITY % simpleType "%p;simpleType">
+<!ENTITY % restriction "%p;restriction">
+<!ENTITY % list "%p;list">
+<!ENTITY % union "%p;union">
+<!ENTITY % maxExclusive "%p;maxExclusive">
+<!ENTITY % minExclusive "%p;minExclusive">
+<!ENTITY % maxInclusive "%p;maxInclusive">
+<!ENTITY % minInclusive "%p;minInclusive">
+<!ENTITY % totalDigits "%p;totalDigits">
+<!ENTITY % fractionDigits "%p;fractionDigits">
+<!ENTITY % length "%p;length">
+<!ENTITY % minLength "%p;minLength">
+<!ENTITY % maxLength "%p;maxLength">
+<!ENTITY % enumeration "%p;enumeration">
+<!ENTITY % whiteSpace "%p;whiteSpace">
+<!ENTITY % pattern "%p;pattern">
+
+<!--
+        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 % simpleTypeAttrs "">
+<!ENTITY % restrictionAttrs "">
+<!ENTITY % listAttrs "">
+<!ENTITY % unionAttrs "">
+<!ENTITY % maxExclusiveAttrs "">
+<!ENTITY % minExclusiveAttrs "">
+<!ENTITY % maxInclusiveAttrs "">
+<!ENTITY % minInclusiveAttrs "">
+<!ENTITY % totalDigitsAttrs "">
+<!ENTITY % fractionDigitsAttrs "">
+<!ENTITY % lengthAttrs "">
+<!ENTITY % minLengthAttrs "">
+<!ENTITY % maxLengthAttrs "">
+<!ENTITY % enumerationAttrs "">
+<!ENTITY % whiteSpaceAttrs "">
+<!ENTITY % patternAttrs "">
+
+<!-- Define some entities for informative use as attribute
+        types -->
+<!ENTITY % URIref "CDATA">
+<!ENTITY % XPathExpr "CDATA">
+<!ENTITY % QName "NMTOKEN">
+<!ENTITY % QNames "NMTOKENS">
+<!ENTITY % NCName "NMTOKEN">
+<!ENTITY % nonNegativeInteger "NMTOKEN">
+<!ENTITY % boolean "(true|false)">
+<!ENTITY % simpleDerivationSet "CDATA">
+<!--
+        #all or space-separated list drawn from derivationChoice
+  -->
+
+<!--
+        Note that the use of 'facet' below is less restrictive
+        than is really intended:  There should in fact be no
+        more than one of each of minInclusive, minExclusive,
+        maxInclusive, maxExclusive, totalDigits, fractionDigits,
+        length, maxLength, minLength within datatype,
+        and the min- and max- variants of Inclusive and Exclusive
+        are mutually exclusive. On the other hand,  pattern and
+        enumeration may repeat.
+  -->
+<!ENTITY % minBound "(%minInclusive; | %minExclusive;)">
+<!ENTITY % maxBound "(%maxInclusive; | %maxExclusive;)">
+<!ENTITY % bounds "%minBound; | %maxBound;">
+<!ENTITY % numeric "%totalDigits; | %fractionDigits;">
+<!ENTITY % ordered "%bounds; | %numeric;">
+<!ENTITY % unordered
+   "%pattern; | %enumeration; | %whiteSpace; | %length; |
+   %maxLength; | %minLength;">
+<!ENTITY % facet "%ordered; | %unordered;">
+<!ENTITY % facetAttr
+        "value CDATA #REQUIRED
+        id ID #IMPLIED">
+<!ENTITY % fixedAttr "fixed %boolean; #IMPLIED">
+<!ENTITY % facetModel "(%annotation;)?">
+<!ELEMENT %simpleType;
+        ((%annotation;)?, (%restriction; | %list; | %union;))>
+<!ATTLIST %simpleType;
+    name      %NCName; #IMPLIED
+    final     %simpleDerivationSet; #IMPLIED
+    id        ID       #IMPLIED
+    %simpleTypeAttrs;>
+<!-- name is required at top level -->
+<!ELEMENT %restriction; ((%annotation;)?,
+                         (%restriction1; |
+                          ((%simpleType;)?,(%facet;)*)),
+                         (%attrDecls;))>
+<!ATTLIST %restriction;
+    base      %QName;                  #IMPLIED
+    id        ID       #IMPLIED
+    %restrictionAttrs;>
+<!--
+        base and simpleType child are mutually exclusive,
+        one is required.
+
+        restriction is shared between simpleType and
+        simpleContent and complexContent (in XMLSchema.xsd).
+        restriction1 is for the latter cases, when this
+        is restricting a complex type, as is attrDecls.
+  -->
+<!ELEMENT %list; ((%annotation;)?,(%simpleType;)?)>
+<!ATTLIST %list;
+    itemType      %QName;             #IMPLIED
+    id        ID       #IMPLIED
+    %listAttrs;>
+<!--
+        itemType and simpleType child are mutually exclusive,
+        one is required
+  -->
+<!ELEMENT %union; ((%annotation;)?,(%simpleType;)*)>
+<!ATTLIST %union;
+    id            ID       #IMPLIED
+    memberTypes   %QNames;            #IMPLIED
+    %unionAttrs;>
+<!--
+        At least one item in memberTypes or one simpleType
+        child is required
+  -->
+
+<!ELEMENT %maxExclusive; %facetModel;>
+<!ATTLIST %maxExclusive;
+        %facetAttr;
+        %fixedAttr;
+        %maxExclusiveAttrs;>
+<!ELEMENT %minExclusive; %facetModel;>
+<!ATTLIST %minExclusive;
+        %facetAttr;
+        %fixedAttr;
+        %minExclusiveAttrs;>
+
+<!ELEMENT %maxInclusive; %facetModel;>
+<!ATTLIST %maxInclusive;
+        %facetAttr;
+        %fixedAttr;
+        %maxInclusiveAttrs;>
+<!ELEMENT %minInclusive; %facetModel;>
+<!ATTLIST %minInclusive;
+        %facetAttr;
+        %fixedAttr;
+        %minInclusiveAttrs;>
+
+<!ELEMENT %totalDigits; %facetModel;>
+<!ATTLIST %totalDigits;
+        %facetAttr;
+        %fixedAttr;
+        %totalDigitsAttrs;>
+<!ELEMENT %fractionDigits; %facetModel;>
+<!ATTLIST %fractionDigits;
+        %facetAttr;
+        %fixedAttr;
+        %fractionDigitsAttrs;>
+
+<!ELEMENT %length; %facetModel;>
+<!ATTLIST %length;
+        %facetAttr;
+        %fixedAttr;
+        %lengthAttrs;>
+<!ELEMENT %minLength; %facetModel;>
+<!ATTLIST %minLength;
+        %facetAttr;
+        %fixedAttr;
+        %minLengthAttrs;>
+<!ELEMENT %maxLength; %facetModel;>
+<!ATTLIST %maxLength;
+        %facetAttr;
+        %fixedAttr;
+        %maxLengthAttrs;>
+
+<!-- This one can be repeated -->
+<!ELEMENT %enumeration; %facetModel;>
+<!ATTLIST %enumeration;
+        %facetAttr;
+        %enumerationAttrs;>
+
+<!ELEMENT %whiteSpace; %facetModel;>
+<!ATTLIST %whiteSpace;
+        %facetAttr;
+        %fixedAttr;
+        %whiteSpaceAttrs;>
+
+<!-- This one can be repeated -->
+<!ELEMENT %pattern; %facetModel;>
+<!ATTLIST %pattern;
+        %facetAttr;
+        %patternAttrs;>
diff --git a/xml/impl/resources/standardSchemas/html5/xhtml5.xsd b/xml/impl/resources/standardSchemas/html5/xhtml5.xsd
new file mode 100644
index 0000000..7158a7e
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/html5/xhtml5.xsd
@@ -0,0 +1,4611 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xs:schema [
+<!ENTITY % HTMLlat1 PUBLIC
+       "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+       "../xhtml-lat1.ent">
+    %HTMLlat1;
+
+    <!ENTITY % HTMLsymbol PUBLIC
+       "-//W3C//ENTITIES Symbols for XHTML//EN"
+       "../xhtml-symbol.ent">
+    %HTMLsymbol;
+
+    <!ENTITY % HTMLspecial PUBLIC
+       "-//W3C//ENTITIES Special for XHTML//EN"
+       "../xhtml-special.ent">
+    %HTMLspecial;
+]>
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/1999/xhtml"
+           xmlns:xhtml="http://www.w3.org/1999/xhtml">
+
+  <!-- ##################################################################### -->
+  <!--
+                            (This only affects mixed-version modules; wholly HTML5
+                             modules should simply be left out of the inclusion list.)
+  -->
+  <!--  (xml:base on elements other than <html>) -->
+  <!-- ##################################################################### -->
+
+  <xs:group name="common.elem.anything">
+    <xs:annotation>
+      <xs:documentation>Any element from any namespace</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:any processContents="skip"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:complexType name="common.inner.anything" mixed="true">
+    <xs:annotation>
+      <xs:documentation>Any content from any namespace</xs:documentation>
+    </xs:annotation>
+    <xs:group minOccurs="0" maxOccurs="unbounded" ref="common.elem.anything"/>
+  </xs:complexType>
+  <!-- ##################################################################### -->
+  <xs:group name="common.elem.metadata">
+    <xs:annotation>
+      <xs:documentation>Common Element Classes #</xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:element ref="xhtml:link"/>
+      <xs:group ref="xhtml:style.elem"/>
+      <xs:group ref="xhtml:meta.name.elem"/>
+      <xs:group ref="xhtml:meta.http-equiv.refresh.elem"/>
+      <xs:group ref="xhtml:meta.http-equiv.default-style.elem"/>
+      <xs:group ref="xhtml:meta.http-equiv.content-language.elem"/>
+      <xs:group ref="xhtml:meta.charset.elem"/>
+      <xs:group ref="xhtml:script.elem"/>
+      <xs:group ref="xhtml:command.elem"/>
+    </xs:choice>
+  </xs:group>
+  <xs:group name="common.elem.phrasing">
+    <xs:annotation>
+      <xs:documentation>Phrase Elements</xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:group ref="xhtml:a.elem.phrasing"/>
+      <xs:element ref="xhtml:em"/>
+      <xs:element ref="xhtml:strong"/>
+      <xs:element ref="xhtml:small"/>
+      <xs:element ref="xhtml:mark"/>
+      <xs:element ref="xhtml:abbr"/>
+      <xs:element ref="xhtml:dfn"/>
+      <xs:element ref="xhtml:i"/>
+      <xs:element ref="xhtml:b"/>
+      <xs:element ref="xhtml:code"/>
+      <xs:element ref="xhtml:var"/>
+      <xs:element ref="xhtml:samp"/>
+      <xs:element ref="xhtml:kbd"/>
+      <xs:element ref="xhtml:sup"/>
+      <xs:element ref="xhtml:sub"/>
+      <xs:element ref="xhtml:q"/>
+      <xs:element ref="xhtml:cite"/>
+      <xs:element ref="xhtml:span"/>
+      <xs:element ref="xhtml:bdo"/>
+      <xs:element ref="xhtml:br"/>
+      <xs:element ref="xhtml:wbr"/>
+      <xs:element ref="xhtml:s"/>
+      <xs:group ref="xhtml:ins.elem.phrasing"/>
+      <xs:group ref="xhtml:del.elem.phrasing"/>
+      <xs:element ref="xhtml:img"/>
+      <xs:element ref="xhtml:embed"/>
+      <xs:group ref="xhtml:object.elem.phrasing"/>
+      <xs:element ref="xhtml:iframe"/>
+      <xs:group ref="xhtml:map.elem.phrasing"/>
+      <xs:element ref="xhtml:area"/>
+      <xs:element ref="xhtml:ruby"/>
+      <xs:group ref="xhtml:video.elem.phrasing"/>
+      <xs:group ref="xhtml:audio.elem.phrasing"/>
+      <xs:group ref="xhtml:script.elem"/>
+      <xs:group ref="xhtml:input.elem"/>
+      <xs:element ref="xhtml:textarea"/>
+      <xs:element ref="xhtml:select"/>
+      <xs:group ref="xhtml:button.elem"/>
+      <xs:element ref="xhtml:label"/>
+      <xs:element ref="xhtml:output"/>
+      <xs:element ref="xhtml:datalist"/>
+      <xs:element ref="xhtml:keygen"/>
+      <xs:element ref="xhtml:progress"/>
+      <xs:group ref="xhtml:command.elem"/>
+      <xs:element ref="xhtml:bb"/>
+      <xs:group ref="xhtml:canvas.elem.phrasing"/>
+      <xs:element ref="xhtml:time"/>
+      <xs:element ref="xhtml:meter"/>
+    </xs:choice>
+  </xs:group>
+  <xs:group name="common.elem.flow">
+    <xs:annotation>
+      <xs:documentation>Prose Elements</xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:group ref="common.elem.phrasing"/>
+      <xs:group ref="xhtml:a.elem.flow"/>
+      <xs:element ref="xhtml:p"/>
+      <xs:element ref="xhtml:hr"/>
+      <xs:element ref="xhtml:pre"/>
+      <xs:element ref="xhtml:ul"/>
+      <xs:element ref="xhtml:ol"/>
+      <xs:element ref="xhtml:dl"/>
+      <xs:element ref="xhtml:div"/>
+      <xs:element ref="xhtml:h1"/>
+      <xs:element ref="xhtml:h2"/>
+      <xs:element ref="xhtml:h3"/>
+      <xs:element ref="xhtml:h4"/>
+      <xs:element ref="xhtml:h5"/>
+      <xs:element ref="xhtml:h6"/>
+      <xs:element ref="xhtml:hgroup"/>
+      <xs:element ref="xhtml:address"/>
+      <xs:element ref="xhtml:blockquote"/>
+      <xs:element ref="xhtml:section"/>
+      <xs:element ref="xhtml:nav"/>
+      <xs:element ref="xhtml:article"/>
+      <xs:element ref="xhtml:aside"/>
+      <xs:element ref="xhtml:header"/>
+      <xs:element ref="xhtml:footer"/>
+      <xs:element ref="xhtml:dialog"/>
+      <xs:group ref="xhtml:ins.elem.flow"/>
+      <xs:group ref="xhtml:del.elem.flow"/>
+      <xs:group ref="xhtml:object.elem.flow"/>
+      <xs:group ref="xhtml:map.elem.flow"/>
+      <xs:group ref="xhtml:video.elem.flow"/>
+      <xs:group ref="xhtml:audio.elem.flow"/>
+      <xs:element ref="xhtml:figure"/>
+      <xs:element ref="xhtml:table"/>
+      <xs:element ref="xhtml:form"/>
+      <xs:element ref="xhtml:fieldset"/>
+      <xs:element ref="xhtml:datagrid"/>
+      <xs:element ref="xhtml:menu"/>
+      <xs:group ref="xhtml:canvas.elem.flow"/>
+      <xs:element ref="xhtml:details"/>
+    </xs:choice>
+  </xs:group>
+  <!-- ##################################################################### -->
+  <xs:group name="common.inner.metadata">
+    <xs:annotation>
+      <xs:documentation>Common Content Models #</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:group minOccurs="0" maxOccurs="unbounded" ref="common.elem.metadata"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="common.inner.phrasing">
+    <xs:annotation>
+      <xs:documentation>Phrase Content</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:group minOccurs="0" maxOccurs="unbounded" ref="common.elem.phrasing"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="common.inner.flow">
+    <xs:annotation>
+      <xs:documentation>Prose Content</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:group minOccurs="0" maxOccurs="unbounded" ref="common.elem.flow"/>
+    </xs:sequence>
+  </xs:group>
+  <!-- REVISIT <style scoped> -->
+  <!-- ##################################################################### -->
+  <!-- ##################################################################### -->
+  <!-- When updating, check <bdo> definition too -->
+  <xs:attributeGroup name="common.attrs">
+    <xs:annotation>
+      <xs:documentation>Common Attributes #</xs:documentation>
+    </xs:annotation>
+    <xs:attributeGroup ref="common.attrs.basic"/>
+    <xs:attributeGroup ref="common.attrs.i18n"/>
+    <xs:attributeGroup ref="common.attrs.present"/>
+    <xs:attributeGroup ref="common.attrs.other"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="common.attrs.basic">
+    <xs:attribute name="id" type="common.data.id"/>
+    <xs:attribute ref="xml:id"/>
+    <xs:attribute name="class" type="common.data.tokens"/>
+    <xs:attribute name="title"/>
+    <xs:attribute name="role"/>
+    <xs:attribute ref="xml:base"/>
+    <xs:attribute ref="xml:space"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="common.attrs.i18n">
+    <xs:attribute name="dir">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="ltr"/>
+          <xs:enumeration value="rtl"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attributeGroup ref="common.attrs.language"/>
+  </xs:attributeGroup>
+  <!--
+    This lang definition is a hack for enviroments where
+    the HTML5 parser maps lang to xml:lang.
+    Sameness check left to Schematron
+  -->
+  <xs:attributeGroup name="common.attrs.language">
+    <xs:attribute ref="xml:lang"/>
+    <xs:attribute name="lang" type="common.data.langcode"/>
+  </xs:attributeGroup>
+  <!--
+    	common.attrs.language =
+    		(	common.attrs.lang
+    		|	common.attrs.xmllang
+    		)
+    	common.attrs.lang =
+    		attribute lang {
+    			common.data.langcode
+    		} & HTMLonly
+    	common.attrs.xmllang =
+    		attribute xml:lang {
+    			common.data.langcode
+    		} & XMLonly
+  -->
+  <xs:attributeGroup name="common.attrs.present">
+    <xs:attribute name="style" type="xs:string"/>
+    <xs:attribute name="tabindex" type="common.data.integer"/>
+    <xs:attribute name="accesskey" type="common.data.keylabellist"/>
+  </xs:attributeGroup>
+  <!-- REVISIT move style to a module and bundle tabindex with ARIA -->
+  <xs:attributeGroup name="common.attrs.other">
+    <xs:attributeGroup ref="xhtml:common.attrs.scripting"/>
+    <xs:attributeGroup ref="xhtml:common.attrs.interact"/>
+  </xs:attributeGroup>
+  <!-- ##################################################################### -->
+  <xs:simpleType name="common.data.tokens">
+    <xs:annotation>
+      <xs:documentation>Common Datatypes #</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKENS"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.browsing-context">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.browsing-context-or-keyword">
+    <xs:restriction base="xs:NMTOKEN">
+      <xs:pattern value="_(blank|self|parent|top)|[A-Za-z]\c*"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.charset">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[uU][tT][fF]-8"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="SandboxType">
+    <xs:union>
+      <xs:simpleType>
+        <xs:restriction>
+          <xs:simpleType>
+            <xs:list>
+              <xs:simpleType>
+                <xs:restriction base="xs:token">
+                  <xs:enumeration value="allow-same-origin"/>
+                  <xs:enumeration value="allow-forms"/>
+                  <xs:enumeration value="allow-scripts"/>
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:list>
+          </xs:simpleType>
+          <xs:maxLength value="3"/>
+        </xs:restriction>
+      </xs:simpleType>
+      <xs:simpleType>
+        <xs:restriction>
+          <xs:simpleType>
+            <xs:list>
+              <xs:simpleType>
+                <xs:restriction base="xs:token">
+                  <xs:enumeration value="allow-same-origin"/>
+                  <xs:enumeration value="allow-scripts"/>
+                  <xs:enumeration value="allow-forms"/>
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:list>
+          </xs:simpleType>
+          <xs:maxLength value="3"/>
+        </xs:restriction>
+      </xs:simpleType>
+      <xs:simpleType>
+        <xs:restriction>
+          <xs:simpleType>
+            <xs:list>
+              <xs:simpleType>
+                <xs:restriction base="xs:token">
+                  <xs:enumeration value="allow-forms"/>
+                  <xs:enumeration value="allow-same-origin"/>
+                  <xs:enumeration value="allow-scripts"/>
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:list>
+          </xs:simpleType>
+          <xs:maxLength value="3"/>
+        </xs:restriction>
+      </xs:simpleType>
+      <xs:simpleType>
+        <xs:restriction>
+          <xs:simpleType>
+            <xs:list>
+              <xs:simpleType>
+                <xs:restriction base="xs:token">
+                  <xs:enumeration value="allow-forms"/>
+                  <xs:enumeration value="allow-scripts"/>
+                  <xs:enumeration value="allow-same-origin"/>
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:list>
+          </xs:simpleType>
+          <xs:maxLength value="3"/>
+        </xs:restriction>
+      </xs:simpleType>
+      <xs:simpleType>
+        <xs:restriction>
+          <xs:simpleType>
+            <xs:list>
+              <xs:simpleType>
+                <xs:restriction base="xs:token">
+                  <xs:enumeration value="allow-scripts"/>
+                  <xs:enumeration value="allow-same-origin"/>
+                  <xs:enumeration value="allow-forms"/>
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:list>
+          </xs:simpleType>
+          <xs:maxLength value="3"/>
+        </xs:restriction>
+      </xs:simpleType>
+      <xs:simpleType>
+        <xs:restriction>
+          <xs:simpleType>
+            <xs:list>
+              <xs:simpleType>
+                <xs:restriction base="xs:token">
+                  <xs:enumeration value="allow-scripts"/>
+                  <xs:enumeration value="allow-forms"/>
+                  <xs:enumeration value="allow-same-origin"/>
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:list>
+          </xs:simpleType>
+          <xs:maxLength value="3"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:union>
+  </xs:simpleType>
+
+  <!--
+    		xsd:string {
+    			pattern = "()|([^_].*)|(_[bB][lL][aA][nN][kK])|(_[sS][eE][lL][fF])|(_[pP][aA][rR][eE][nN][tT])|(_[tT][oO][pP])"
+    		}
+  -->
+  <xs:simpleType name="common.data.id">
+    <xs:annotation>
+      <xs:documentation>IDs and IDREFs</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:ID"/>
+  </xs:simpleType>
+  <!--
+    		xsd:string {
+    			pattern = "\S+"
+    		}
+  -->
+  <xs:simpleType name="common.data.idref">
+    <xs:restriction base="xs:ID"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.idrefs">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.name">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <!-- FIXME -->
+  <xs:simpleType name="common.data.hash-name">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <!--
+    		xsd:string {
+    			pattern = "#.+"
+    		}
+  -->
+  <xs:simpleType name="common.data.integer">
+    <xs:annotation>
+      <xs:documentation>Numerical</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="-?[0-9]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <!--
+    		xsd:string {
+    			pattern = "-?[0-9]+"
+    		}
+  -->
+  <xs:simpleType name="common.data.integer.positive">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="0*[1-9][0-9]*"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <!--
+    		xsd:string {
+    			pattern = "0*[1-9][0-9]*"
+    		}
+  -->
+  <xs:simpleType name="common.data.integer.non-negative">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[0-9]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <!--
+    		xsd:string {
+    			pattern = "[0-9]+"
+    		}
+  -->
+  <!--
+    	common.data.percent =
+    		xsd:string {
+    			pattern = "(100)|([1-9]?[0-9](\.[0-9]+)?)%"
+    		}
+  -->
+  <xs:simpleType name="common.data.float">
+    <xs:restriction base="xs:float">
+      <xs:pattern value="-?[0-9]+(\.[0-9]+)?([eE]-?[0-9]+)?"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <!--
+    		xsd:string {
+    			pattern = "-?[0-9]+(\.[0-9]+)?([eE]-?[0-9]+)?"
+    		}
+  -->
+  <xs:simpleType name="common.data.float.positive">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="(0*[1-9][0-9]*(\.[0-9]+)?)|([0-9]+(\.0*[1-9][0-9]*)?)([eE]-?[0-9]+)?"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <!--
+    		xsd:string {
+    			pattern = "(0*[1-9][0-9]*(\.[0-9]+)?)|([0-9]+(\.0*[1-9][0-9]*)?)([eE]-?[0-9]+)?"
+    		}
+  -->
+  <xs:simpleType name="common.data.float.non-negative">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[0-9]+(\.[0-9]+)?([eE]-?[0-9]+)?"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <!--
+    		xsd:string {
+    			pattern = "[0-9]+(\.[0-9]+)?([eE]-?[0-9]+)?"
+    		}
+  -->
+  <xs:simpleType name="common.data.datetime">
+    <xs:annotation>
+      <xs:documentation>Temporal</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.date-or-time">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.uri">
+    <xs:annotation>
+      <xs:documentation>IRIs</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:anyURI"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.uris">
+    <xs:list itemType="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.uri.absolute">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.sizes">
+    <xs:annotation>
+      <xs:documentation>&lt;link type='icon'&gt; sizes</xs:documentation>
+    </xs:annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base="xs:string">
+              <xs:pattern value="[1-9][0-9]*x[1-9][0-9]*"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value="1"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.mimetype">
+    <xs:annotation>
+      <xs:documentation>MIME types</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.meta-charset">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.refresh">
+    <xs:annotation>
+      <xs:documentation>Refresh</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.default-style">
+    <xs:annotation>
+      <xs:documentation>Default style</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <!-- 		w:default-style -->
+  <xs:simpleType name="common.data.mediaquery">
+    <xs:annotation>
+      <xs:documentation>Media Queries</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.langcode">
+    <xs:annotation>
+      <xs:documentation>Language Codes</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:language"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.keylabellist">
+    <xs:annotation>
+      <xs:documentation>List of Key Labels</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.microdata-identifier">
+    <xs:annotation>
+      <xs:documentation>Microdata Identifier</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="common.data.zero">
+    <xs:annotation>
+      <xs:documentation>Zero</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <!-- ##################################################################### -->
+  <!-- ##################################################################### -->
+  <xs:attributeGroup name="common-form.attrs.form">
+    <xs:annotation>
+      <xs:documentation>WF2 Module Hook #</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="form" type="common.data.idref"/>
+  </xs:attributeGroup>
+  <!-- ##################################################################### -->
+  <!-- ##################################################################### -->
+
+  <xs:element name="html">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:html.inner">
+          <xs:attributeGroup ref="xhtml:html.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="html.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="manifest" type="common.data.uri"/>
+  </xs:attributeGroup>
+  <xs:complexType name="html.inner">
+    <xs:sequence>
+      <xs:element ref="xhtml:head"/>
+      <xs:element ref="xhtml:body"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="head">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:head.inner">
+          <xs:attributeGroup ref="xhtml:head.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="head.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <!--
+    		head.attrs.profile =
+    			attribute profile {
+    				common.data.uris #REVISIT should these be absolute (zero or more)
+    			}
+  -->
+  <xs:complexType name="head.inner">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="xhtml:title"/>
+      <xs:element ref="xhtml:base"/>
+      <xs:group ref="common.inner.metadata"/>
+    </xs:choice>
+  </xs:complexType>
+  <!--
+    	head.inner =
+    		(	meta.elem.encoding?
+    		,	(	title.elem
+    			&	base.elem? # REVISIT need a non-schema checker or Schematron
+    			&	common.inner.metadata
+    			)
+    		)
+  -->
+  <xs:element name="body">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:body.inner">
+          <xs:attributeGroup ref="xhtml:body.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="body.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="onafterprint" type="xs:string"/>
+    <xs:attribute name="onbeforeprint" type="xs:string"/>
+    <xs:attribute name="onbeforeunload" type="xs:string"/>
+    <xs:attribute name="onhashchange" type="xs:string"/>
+    <xs:attribute name="onmessage" type="xs:string"/>
+    <xs:attribute name="onoffline" type="xs:string"/>
+    <xs:attribute name="ononline" type="xs:string"/>
+    <xs:attribute name="onpopstate" type="xs:string"/>
+    <xs:attribute name="onredo" type="xs:string"/>
+    <xs:attribute name="onresize" type="xs:string"/>
+    <xs:attribute name="onstorage" type="xs:string"/>
+    <xs:attribute name="onundo" type="xs:string"/>
+    <xs:attribute name="onunload" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:complexType name="body.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:element name="title">
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="xhtml:title.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="title.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:element name="base">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:base.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="base.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="href" type="common.data.uri"/>
+    <xs:attribute name="target" type="common.data.browsing-context-or-keyword"/>
+  </xs:attributeGroup>
+  <xs:element name="link">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:link.attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="link.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:shared-hyperlink.attrs.href"/>
+    <xs:attributeGroup ref="xhtml:shared-hyperlink.attrs.rel"/>
+    <xs:attribute name="hreflang" type="common.data.langcode"/>
+    <xs:attribute name="media" type="common.data.mediaquery"/>
+    <xs:attribute name="type" type="common.data.mimetype"/>
+    <xs:attribute name="sizes">
+      <xs:simpleType>
+        <xs:union memberTypes="xs:string"/>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:group name="style.elem">
+    <xs:annotation>
+      <xs:documentation>Global Style: &lt;style&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="style">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:style.inner">
+              <xs:attributeGroup ref="xhtml:style.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="style.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="type" type="common.data.mimetype"/>
+    <xs:attribute name="media" type="common.data.mediaquery"/>
+  </xs:attributeGroup>
+  <xs:complexType name="style.inner">
+    <xs:complexContent>
+      <xs:extension base="common.inner.anything"/>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:group name="style.elem.scoped">
+    <xs:annotation>
+      <xs:documentation>Scoped Style: &lt;style scoped&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="style">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:style.inner">
+              <xs:attributeGroup ref="xhtml:style.scoped.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="style.scoped.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="type" type="common.data.mimetype"/>
+    <xs:attribute name="media" type="common.data.mediaquery"/>
+    <xs:attributeGroup ref="xhtml:style.attrs.scoped"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="style.attrs.scoped">
+    <xs:attribute name="scoped" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="scoped"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:element name="meta">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:common.attrs"/>
+      <xs:attributeGroup ref="xhtml:meta.name.attrs"/>
+      <xs:attributeGroup ref="xhtml:meta.http-equiv.refresh.attrs"/>
+      <xs:attributeGroup ref="xhtml:meta.charset.attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:group name="meta.name.elem">
+    <xs:annotation>
+      <xs:documentation>Name-Value Metadata: &lt;meta name&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="meta"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="meta.name.attrs">
+    <xs:attributeGroup ref="xhtml:meta.name.attrs.name"/>
+    <xs:attributeGroup ref="xhtml:meta.name.attrs.content"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="meta.name.attrs.name">
+    <xs:attribute name="name" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="meta.name.attrs.content">
+    <xs:attribute name="content" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:group name="meta.http-equiv.refresh.elem">
+    <xs:annotation>
+      <xs:documentation>"refresh" pragma directive: &lt;meta http-equiv='refresh'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="meta"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="meta.http-equiv.refresh.attrs">
+    <xs:attribute name="http-equiv" type="xs:string"/>
+  </xs:attributeGroup>
+  <!--
+    not quite right per spec
+    if the definition is
+    reused in another language
+  -->
+  <xs:group name="meta.http-equiv.default-style.elem">
+    <xs:annotation>
+      <xs:documentation>"default-style" pragma directive: &lt;meta http-equiv='default-style'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="meta"/>
+    </xs:sequence>
+  </xs:group>
+  <!--
+    not quite right per spec
+    if the definition is
+    reused in another language
+  -->
+  <xs:group name="meta.http-equiv.content-language.elem">
+    <xs:annotation>
+      <xs:documentation>"content-language" pragma directive: &lt;meta http-equiv='content-language'&gt; (obsolete)</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="meta"/>
+    </xs:sequence>
+  </xs:group>
+  <!--
+    not quite right per spec
+    if the definition is
+    reused in another language
+  -->
+  <xs:group name="meta.charset.elem">
+    <xs:annotation>
+      <xs:documentation>Inline Character Encoding Statement for HTML: &lt;meta charset&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="meta"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="meta.charset.attrs">
+    <xs:attributeGroup ref="xhtml:meta.charset.attrs.charset"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="meta.charset.attrs.charset">
+    <xs:attribute name="charset" type="common.data.charset"/>
+  </xs:attributeGroup>
+
+  <!-- ##################################################################### -->
+  <xs:group name="a.elem.phrasing">
+    <xs:annotation>
+      <xs:documentation>RELAX NG Schema for HTML 5: Phrase Markup #</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+  <xs:element name="a">
+    <xs:complexType>
+      <xs:complexContent>
+            <xs:extension base="xhtml:a.inner.phrasing">
+          <xs:attributeGroup ref="xhtml:a.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="a.elem.flow">
+    <xs:sequence>
+      <xs:element name="a">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:a.inner.flow">
+              <xs:attributeGroup ref="xhtml:a.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="a.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="name" type="common.data.id"/>
+    <xs:attribute name="href" type="common.data.uri"/>
+    <xs:attribute name="target" type="common.data.browsing-context-or-keyword"/>
+    <xs:attribute name="rel" type="common.data.tokens"/>
+    <xs:attribute name="hreflang" type="common.data.langcode"/>
+    <xs:attribute name="media" type="common.data.mediaquery"/>
+    <xs:attribute name="type" type="common.data.mimetype"/>
+    <xs:attribute name="ping" type="common.data.uris"/>
+  </xs:attributeGroup>
+  <xs:complexType name="a.inner.phrasing" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:complexType name="a.inner.flow" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:attributeGroup name="shared-hyperlink.attrs.href">
+    <xs:annotation>
+      <xs:documentation>Shared hyperlink attributes</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="href" use="required" type="common.data.uri"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="shared-hyperlink.attrs.rel">
+    <xs:attribute name="rel" use="required" type="common.data.tokens"/>
+  </xs:attributeGroup>
+  <xs:element name="em">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:em.inner">
+          <xs:attributeGroup ref="xhtml:em.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="em.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="em.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="strong">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:strong.inner">
+          <xs:attributeGroup ref="xhtml:strong.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="strong.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="strong.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="small">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:small.inner">
+          <xs:attributeGroup ref="xhtml:small.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="small.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="small.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="mark">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:mark.inner">
+          <xs:attributeGroup ref="xhtml:mark.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="mark.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="mark.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="abbr">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:abbr.inner">
+          <xs:attributeGroup ref="xhtml:abbr.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="abbr.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="abbr.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="dfn">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:dfn.inner">
+          <xs:attributeGroup ref="xhtml:dfn.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="dfn.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="dfn.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="i">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:i.inner">
+          <xs:attributeGroup ref="xhtml:i.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="i.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="i.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="b">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:b.inner">
+          <xs:attributeGroup ref="xhtml:b.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="b.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="b.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="code">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:code.inner">
+          <xs:attributeGroup ref="xhtml:code.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="code.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="code.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="var">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:var.inner">
+          <xs:attributeGroup ref="xhtml:var.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="var.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="var.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="samp">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:samp.inner">
+          <xs:attributeGroup ref="xhtml:samp.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="samp.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="samp.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="kbd">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:kbd.inner">
+          <xs:attributeGroup ref="xhtml:kbd.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="kbd.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="kbd.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="sup">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:sup.inner">
+          <xs:attributeGroup ref="xhtml:sup.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="sup.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="sup.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="sub">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:sub.inner">
+          <xs:attributeGroup ref="xhtml:sub.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="sub.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="sub.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="q">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:q.inner">
+          <xs:attributeGroup ref="xhtml:q.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="q.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="cite" type="common.data.uri"/>
+  </xs:attributeGroup>
+  <xs:complexType name="q.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="cite">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:cite.inner">
+          <xs:attributeGroup ref="xhtml:cite.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="cite.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="cite.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="span">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:span.inner">
+          <xs:attributeGroup ref="xhtml:span.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="span.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="span.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <!-- REVISIT allow ol and ul? -->
+  <xs:element name="bdo">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:bdo.inner">
+          <xs:attributeGroup ref="xhtml:bdo.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="bdo.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <!-- dir required in Schematron -->
+  <xs:complexType name="bdo.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="br">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:br.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="wbr">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:common.attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="s">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:common.attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="br.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+
+  <!-- ##################################################################### -->
+  <xs:element name="p">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:p.inner">
+          <xs:attributeGroup ref="xhtml:p.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="p.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="p.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <!-- REVISIT lists in span? -->
+  <xs:element name="hr">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:hr.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="hr.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <!-- ##################################################################### -->
+  <xs:element name="pre">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:pre.inner">
+          <xs:attributeGroup ref="xhtml:pre.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="pre.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="pre.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <!-- ##################################################################### -->
+  <xs:element name="ul">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:ul.inner">
+          <xs:attributeGroup ref="xhtml:ul.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="ul.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="ul.inner">
+    <xs:group minOccurs="0" maxOccurs="unbounded" ref="xhtml:li.elem"/>
+  </xs:complexType>
+  <xs:group name="li.elem">
+    <xs:annotation>
+      <xs:documentation>Unordered List Item: &lt;li&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="li">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:li.inner">
+              <xs:attributeGroup ref="xhtml:li.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="li.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="li.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:element name="ol">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:ol.inner">
+          <xs:attributeGroup ref="xhtml:ol.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="ol.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="start" type="common.data.integer"/>
+    <xs:attribute name="reversed">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="reversed"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="ol.attrs.reversed">
+    <xs:attribute name="reversed" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="reversed"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:complexType name="ol.inner">
+    <xs:group minOccurs="0" maxOccurs="unbounded" ref="xhtml:oli.elem"/>
+  </xs:complexType>
+  <xs:group name="oli.elem">
+    <xs:annotation>
+      <xs:documentation>Ordered List Item: &lt;li&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="li">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:oli.inner">
+              <xs:attributeGroup ref="xhtml:oli.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="oli.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="value" type="common.data.integer"/>
+  </xs:attributeGroup>
+  <xs:complexType name="oli.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <!-- ##################################################################### -->
+  <xs:element name="dl">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:dl.inner">
+          <xs:attributeGroup ref="xhtml:dl.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="dl.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="dl.inner">
+    <xs:sequence minOccurs="0" maxOccurs="unbounded">
+      <xs:element maxOccurs="unbounded" ref="xhtml:dt"/>
+      <xs:group maxOccurs="unbounded" ref="xhtml:dd.elem"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="dt">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:dt.inner">
+          <xs:attributeGroup ref="xhtml:dt.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="dt.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="dt.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:group name="dd.elem">
+    <xs:annotation>
+      <xs:documentation>Definition Description: &lt;dd&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="dd">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:dd.inner">
+              <xs:attributeGroup ref="xhtml:dd.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="dd.elem.phrasing">
+    <xs:sequence>
+      <xs:element name="dd">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:dd.inner.phrasing">
+              <xs:attributeGroup ref="xhtml:dd.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="dd.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="dd.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:complexType name="dd.inner.phrasing" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <!-- ##################################################################### -->
+  <xs:element name="div">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:div.inner">
+          <xs:attributeGroup ref="xhtml:div.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="div.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="div.inner" mixed="true">
+    <xs:sequence>
+      <xs:group minOccurs="0" maxOccurs="unbounded" ref="xhtml:style.elem.scoped"/>
+      <xs:group ref="common.inner.flow"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="legend">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:legend.inner">
+          <xs:attributeGroup ref="xhtml:legend.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="figcaption">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:figcaption.inner">
+          <xs:attributeGroup ref="xhtml:figcaption.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="legend.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="legend.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+
+  <!-- ##################################################################### -->
+  <xs:element name="h1">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:h1.inner">
+          <xs:attributeGroup ref="xhtml:h1.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="h1.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="h1.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="h2">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:h2.inner">
+          <xs:attributeGroup ref="xhtml:h2.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="h2.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="h2.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="h3">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:h3.inner">
+          <xs:attributeGroup ref="xhtml:h3.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="h3.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="h3.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="h4">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:h4.inner">
+          <xs:attributeGroup ref="xhtml:h4.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="h4.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="h4.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="h5">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:h5.inner">
+          <xs:attributeGroup ref="xhtml:h5.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="h5.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="h5.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="h6">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:h6.inner">
+          <xs:attributeGroup ref="xhtml:h6.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="h6.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="h6.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="hgroup">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:hgroup.inner">
+          <xs:attributeGroup ref="xhtml:hgroup.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="hgroup.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="hgroup.inner">
+    <xs:choice maxOccurs="unbounded">
+      <xs:element ref="xhtml:h1"/>
+      <xs:element ref="xhtml:h2"/>
+      <xs:element ref="xhtml:h3"/>
+      <xs:element ref="xhtml:h4"/>
+      <xs:element ref="xhtml:h5"/>
+      <xs:element ref="xhtml:h6"/>
+    </xs:choice>
+  </xs:complexType>
+  <!-- ##################################################################### -->
+  <xs:element name="address">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:address.inner">
+          <xs:attributeGroup ref="xhtml:address.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="address.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="address.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <!-- ##################################################################### -->
+  <xs:element name="blockquote">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:blockquote.inner">
+          <xs:attributeGroup ref="xhtml:blockquote.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="blockquote.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="cite" type="common.data.uri"/>
+  </xs:attributeGroup>
+  <xs:complexType name="blockquote.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+
+  <xs:complexType name="figcaption.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:attributeGroup name="figcaption.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+
+  <!-- ##################################################################### -->
+  <xs:element name="section">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:section.inner">
+          <xs:attributeGroup ref="xhtml:section.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="section.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="section.inner" mixed="true">
+    <xs:sequence>
+      <xs:group minOccurs="0" maxOccurs="unbounded" ref="xhtml:style.elem.scoped"/>
+      <xs:group ref="common.inner.flow"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="nav">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:nav.inner">
+          <xs:attributeGroup ref="xhtml:nav.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="nav.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="nav.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:element name="article">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:article.inner">
+          <xs:attributeGroup ref="xhtml:article.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="article.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="pubdate" type="common.data.datetime"/>
+  </xs:attributeGroup>
+  <xs:complexType name="article.inner" mixed="true">
+    <xs:sequence>
+      <xs:group minOccurs="0" maxOccurs="unbounded" ref="xhtml:style.elem"/>
+      <xs:group ref="common.inner.flow"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="aside">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:aside.inner">
+          <xs:attributeGroup ref="xhtml:aside.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="aside.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="aside.inner" mixed="true">
+    <xs:sequence>
+      <xs:group minOccurs="0" maxOccurs="unbounded" ref="xhtml:style.elem"/>
+      <xs:group ref="common.inner.flow"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="header">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:header.inner">
+          <xs:attributeGroup ref="xhtml:header.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="header.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="header.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:element name="footer">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:footer.inner">
+          <xs:attributeGroup ref="xhtml:footer.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="footer.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="footer.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:element name="dialog">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:dialog.inner">
+          <xs:attributeGroup ref="xhtml:dialog.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="dialog.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="dialog.inner">
+    <xs:sequence minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="xhtml:dt"/>
+      <xs:group ref="xhtml:dd.elem"/>
+    </xs:sequence>
+  </xs:complexType>
+
+  <!-- ##################################################################### -->
+  <xs:attributeGroup name="edit.attrs.cite">
+    <xs:annotation>
+      <xs:documentation>RELAX NG Schema for HTML 5: Revision Annotations #</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="cite" use="required" type="common.data.uri"/>
+  </xs:attributeGroup>
+  <xs:group name="ins.elem.flow">
+    <xs:annotation>
+      <xs:documentation>Inserts: &lt;ins&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="ins">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:ins.inner.flow">
+              <xs:attributeGroup ref="xhtml:ins.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="ins.elem.phrasing">
+    <xs:sequence>
+      <xs:element name="ins">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:ins.inner.phrasing">
+              <xs:attributeGroup ref="xhtml:ins.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="ins.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="cite" type="common.data.uri"/>
+    <xs:attribute name="datetime" type="common.data.datetime"/>
+  </xs:attributeGroup>
+  <xs:complexType name="ins.inner.flow" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:complexType name="ins.inner.phrasing" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:group name="del.elem.flow">
+    <xs:annotation>
+      <xs:documentation>Deletions: &lt;del&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+  <xs:element name="del">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:del.inner.flow">
+          <xs:attributeGroup ref="xhtml:del.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="del.elem.phrasing">
+    <xs:sequence>
+      <xs:element name="del">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:del.inner.phrasing">
+              <xs:attributeGroup ref="xhtml:del.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="del.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="cite" type="common.data.uri"/>
+    <xs:attribute name="datetime" type="common.data.datetime"/>
+  </xs:attributeGroup>
+  <xs:complexType name="del.inner.flow" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:complexType name="del.inner.phrasing" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+
+  <!-- ##################################################################### -->
+  <xs:element name="img">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:img.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="img.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:img.attrs.src"/>
+    <xs:attribute name="alt"/>
+    <xs:attribute name="height" type="common.data.integer.non-negative"/>
+    <xs:attribute name="width" type="common.data.integer.non-negative"/>
+    <xs:attribute name="usemap" type="common.data.hash-name"/>
+    <xs:attribute name="ismap">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="ismap"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="border" type="common.data.zero"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="img.attrs.src">
+    <xs:attribute name="src" use="required" type="common.data.uri"/>
+  </xs:attributeGroup>
+  <xs:element name="embed">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:embed.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="embed.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="src" type="common.data.uri"/>
+    <xs:attribute name="type" type="common.data.mimetype"/>
+    <xs:attribute name="height" type="common.data.integer.positive"/>
+    <xs:attribute name="width" type="common.data.integer.positive"/>
+    <xs:attributeGroup ref="xhtml:embed.attrs.other"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="embed.attrs.other">
+    <xs:anyAttribute namespace="##local" processContents="skip"/>
+  </xs:attributeGroup>
+  <xs:group name="object.elem.flow">
+    <xs:annotation>
+      <xs:documentation>Generic Objects: &lt;object&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+  <xs:element name="object">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:object.inner.flow">
+          <xs:attributeGroup ref="xhtml:object.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="object.elem.phrasing">
+    <xs:sequence>
+      <xs:element name="object">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:object.inner.phrasing">
+              <xs:attributeGroup ref="xhtml:object.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="object.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="data" type="common.data.uri"/>
+    <xs:attribute name="type" type="common.data.mimetype"/>
+    <xs:attribute name="height" type="common.data.integer.positive"/>
+    <xs:attribute name="width" type="common.data.integer.positive"/>
+    <xs:attribute name="usemap" type="common.data.hash-name"/>
+    <xs:attribute name="name" type="common.data.browsing-context"/>
+    <xs:attributeGroup ref="common-form.attrs.form"/>
+  </xs:attributeGroup>
+  <xs:complexType name="object.inner.flow" mixed="true">
+    <xs:sequence>
+      <xs:element minOccurs="0" maxOccurs="unbounded" ref="xhtml:param"/>
+      <xs:group ref="common.inner.flow"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="object.inner.phrasing" mixed="true">
+    <xs:sequence>
+      <xs:element minOccurs="0" maxOccurs="unbounded" ref="xhtml:param"/>
+      <xs:group ref="common.inner.phrasing"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="param">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:param.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="param.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:param.attrs.name"/>
+    <xs:attributeGroup ref="xhtml:param.attrs.value"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="param.attrs.name">
+    <xs:attribute name="name" use="required" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="param.attrs.value">
+    <xs:attribute name="value" use="required" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:element name="iframe">
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="xhtml:iframe.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="iframe.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="src" type="common.data.uri"/>
+    <xs:attribute name="name" type="common.data.browsing-context"/>
+    <xs:attribute name="width" type="common.data.integer.positive"/>
+    <xs:attribute name="height" type="common.data.integer.positive"/>
+    <xs:attribute name="sandbox" type="SandboxType"/>
+    <xs:attribute name="seamless">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="seamless"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="srcdoc" type="xs:string"/>
+  </xs:attributeGroup>
+
+  <xs:group name="map.elem.flow">
+    <xs:annotation>
+      <xs:documentation>Map Definition: &lt;map&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="map">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:map.inner.flow">
+              <xs:attributeGroup ref="xhtml:map.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="map.elem.phrasing">
+    <xs:sequence>
+      <xs:element name="map">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:map.inner.phrasing">
+              <xs:attributeGroup ref="xhtml:map.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="map.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:map.attrs.name"/>
+  </xs:attributeGroup>
+  <!-- REVISIT make id required in Schematron -->
+  <xs:attributeGroup name="map.attrs.name">
+    <xs:attribute name="name" use="required" type="common.data.name"/>
+  </xs:attributeGroup>
+  <xs:complexType name="map.inner.flow" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:complexType name="map.inner.phrasing" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="area">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:area.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="area.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="alt"/>
+    <xs:attribute name="href" type="common.data.uri"/>
+    <xs:attribute name="target" type="common.data.browsing-context-or-keyword"/>
+    <xs:attribute name="ping" type="common.data.uris"/>
+    <xs:attribute name="rel" type="common.data.tokens"/>
+    <xs:attribute name="media" type="common.data.mediaquery"/>
+    <xs:attribute name="hreflang" type="common.data.langcode"/>
+    <xs:attribute name="type" type="common.data.mimetype"/>
+    <xs:attributeGroup ref="xhtml:area.attrs.shape"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="area.attrs.shape">
+    <xs:attribute name="shape" type="xs:string"/>
+    <xs:attribute name="coords" type="xs:string"/>
+  </xs:attributeGroup>
+
+  <!-- ##################################################################### -->
+  <xs:element name="ruby">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:ruby.inner">
+          <xs:attributeGroup ref="xhtml:ruby.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="ruby.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="ruby.inner" mixed="true">
+    <xs:sequence maxOccurs="unbounded">
+      <xs:group ref="common.inner.phrasing"/>
+      <xs:choice>
+        <xs:element ref="xhtml:rt"/>
+        <xs:sequence>
+          <xs:group ref="xhtml:rp.elem.start"/>
+          <xs:element ref="xhtml:rt"/>
+          <xs:group ref="xhtml:rp.elem.end"/>
+        </xs:sequence>
+      </xs:choice>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="rt">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:rt.inner">
+          <xs:attributeGroup ref="xhtml:rt.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="rt.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="rt.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:group name="rp.elem.start">
+    <xs:annotation>
+      <xs:documentation>Ruby Parenthesis: &lt;rp&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="rp">
+        <xs:complexType>
+          <xs:simpleContent>
+            <xs:extension base="xhtml:rp.inner.start">
+              <xs:attributeGroup ref="xhtml:rp.attrs"/>
+            </xs:extension>
+          </xs:simpleContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="rp.elem.end">
+    <xs:sequence>
+      <xs:element name="rp">
+        <xs:complexType>
+          <xs:simpleContent>
+            <xs:extension base="xhtml:rp.inner.end">
+              <xs:attributeGroup ref="xhtml:rp.attrs"/>
+            </xs:extension>
+          </xs:simpleContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="rp.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:simpleType name="rp.inner.start">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="rp.inner.end">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <!-- ##################################################################### -->
+  <!-- src not included -->
+  <xs:attributeGroup name="media.attrs">
+    <xs:annotation>
+      <xs:documentation>RELAX NG Schema for HTML 5: Advanced Embedded Content #</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="autoplay">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autoplay"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autobuffer">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autobuffer"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="controls">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="controls"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="loop">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="loop"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:element name="source">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:source.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="source.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:source.attrs.src"/>
+    <xs:attribute name="type" type="common.data.mimetype"/>
+    <xs:attribute name="media" type="common.data.mediaquery"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="source.attrs.src">
+    <xs:attribute name="src" use="required" type="common.data.uri"/>
+  </xs:attributeGroup>
+  <xs:complexType name="media.source" mixed="true">
+    <xs:annotation>
+      <xs:documentation>Media Source</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element minOccurs="0" maxOccurs="unbounded" ref="xhtml:source"/>
+    </xs:sequence>
+    <xs:attribute name="src" type="common.data.uri"/>
+  </xs:complexType>
+  <xs:attributeGroup name="media.attrs.src">
+    <xs:attribute name="src" use="required" type="common.data.uri"/>
+  </xs:attributeGroup>
+  <xs:group name="video.elem.flow">
+    <xs:annotation>
+      <xs:documentation>Video: &lt;video&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="video">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:video.inner.flow">
+              <xs:attributeGroup ref="xhtml:video.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="video.elem.phrasing">
+    <xs:sequence>
+      <xs:element name="video">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:video.inner.phrasing">
+              <xs:attributeGroup ref="xhtml:video.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="video.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:media.attrs"/>
+    <xs:attribute name="poster" type="common.data.uri"/>
+    <xs:attribute name="height" type="common.data.integer.positive"/>
+    <xs:attribute name="width" type="common.data.integer.positive"/>
+  </xs:attributeGroup>
+  <xs:complexType name="video.inner.flow" mixed="true">
+    <xs:complexContent>
+      <xs:extension base="xhtml:media.source">
+        <xs:group ref="common.inner.flow"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:complexType name="video.inner.phrasing" mixed="true">
+    <xs:complexContent>
+      <xs:extension base="xhtml:media.source">
+        <xs:group ref="common.inner.phrasing"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:group name="audio.elem.flow">
+    <xs:annotation>
+      <xs:documentation>Audio: &lt;audio&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="audio">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:audio.inner.flow">
+              <xs:attributeGroup ref="xhtml:audio.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="audio.elem.phrasing">
+    <xs:sequence>
+      <xs:element name="audio">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:audio.inner.phrasing">
+              <xs:attributeGroup ref="xhtml:audio.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="audio.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:media.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="audio.inner.flow" mixed="true">
+    <xs:complexContent>
+      <xs:extension base="xhtml:media.source">
+        <xs:group ref="common.inner.flow"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:complexType name="audio.inner.phrasing" mixed="true">
+    <xs:complexContent>
+      <xs:extension base="xhtml:media.source">
+        <xs:group ref="common.inner.phrasing"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="figure">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:figure.inner">
+          <xs:attributeGroup ref="xhtml:figure.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="figure.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="figure.inner" mixed="true">
+    <xs:choice>
+      <xs:sequence>
+        <xs:element ref="xhtml:legend"/>
+        <xs:group ref="common.inner.flow"/>
+      </xs:sequence>
+      <xs:sequence>
+        <xs:group ref="common.inner.flow"/>
+        <xs:element minOccurs="0" ref="xhtml:legend"/>
+      </xs:sequence>
+      <xs:sequence>
+        <xs:element ref="xhtml:figcaption"/>
+        <xs:group ref="common.inner.flow"/>
+      </xs:sequence>
+      <xs:sequence>
+        <xs:group ref="common.inner.flow"/>
+        <xs:element minOccurs="0" ref="xhtml:figcaption"/>
+      </xs:sequence>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:element name="script">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:script.inner.embedded">
+          <xs:attributeGroup ref="xhtml:script.attrs.embedded"/>
+          <xs:attributeGroup ref="xhtml:script.attrs.imported"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <!-- ##################################################################### -->
+  <xs:group name="script.elem.embedded">
+    <xs:annotation>
+      <xs:documentation>RELAX NG Schema for HTML 5: Core Scripting #</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="script"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="script.attrs.embedded">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="type" type="common.data.mimetype"/>
+    <xs:attribute name="language" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:group name="script.elem.imported">
+    <xs:sequence>
+      <xs:element ref="script"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="script.attrs.imported">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:script.attrs.src"/>
+    <xs:attribute name="defer">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="defer"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="async">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="async"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="type" type="common.data.mimetype"/>
+    <xs:attribute name="charset" type="common.data.charset"/>
+    <xs:attribute name="language" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="script.attrs.src">
+    <xs:attribute name="src" use="optional" type="common.data.uri"/>
+  </xs:attributeGroup>
+  <xs:complexType name="script.inner.embedded">
+    <xs:complexContent>
+      <xs:extension base="common.inner.anything"/>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:group name="script.elem">
+    <xs:choice>
+      <xs:group ref="xhtml:script.elem.embedded"/>
+      <xs:group ref="xhtml:script.elem.imported"/>
+    </xs:choice>
+  </xs:group>
+  <xs:group name="noscript.inner.head">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="xhtml:link"/>
+        <xs:group ref="xhtml:meta.http-equiv.default-style.elem"/>
+        <xs:group ref="xhtml:meta.http-equiv.refresh.elem"/>
+        <xs:group ref="xhtml:style.elem"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="noscript.inner.phrasing">
+    <xs:sequence>
+      <xs:group ref="common.inner.phrasing"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="noscript.inner.flow">
+    <xs:sequence>
+      <xs:group ref="common.inner.flow"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="noscript.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <!-- ##################################################################### -->
+  <xs:attributeGroup name="common.attrs.scripting">
+    <xs:annotation>
+      <xs:documentation>Event Handler Attribute Definitions</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="onabort" type="xs:string"/>
+    <xs:attribute name="onblur" type="xs:string"/>
+    <xs:attribute name="oncanplay" type="xs:string"/>
+    <xs:attribute name="oncanplaythrough" type="xs:string"/>
+    <xs:attribute name="onchange" type="xs:string"/>
+    <xs:attribute name="onclick" type="xs:string"/>
+    <xs:attribute name="oncontextmenu" type="xs:string"/>
+    <xs:attribute name="ondblclick" type="xs:string"/>
+    <xs:attribute name="ondrag" type="xs:string"/>
+    <xs:attribute name="ondragend" type="xs:string"/>
+    <xs:attribute name="ondragenter" type="xs:string"/>
+    <xs:attribute name="ondragleave" type="xs:string"/>
+    <xs:attribute name="ondragover" type="xs:string"/>
+    <xs:attribute name="ondragstart" type="xs:string"/>
+    <xs:attribute name="ondrop" type="xs:string"/>
+    <xs:attribute name="ondurationchange" type="xs:string"/>
+    <xs:attribute name="onemptied" type="xs:string"/>
+    <xs:attribute name="onended" type="xs:string"/>
+    <xs:attribute name="onerror" type="xs:string"/>
+    <xs:attribute name="onfocus" type="xs:string"/>
+    <xs:attribute name="onformchange" type="xs:string"/>
+    <xs:attribute name="onforminput" type="xs:string"/>
+    <xs:attribute name="oninput" type="xs:string"/>
+    <xs:attribute name="oninvalid" type="xs:string"/>
+    <xs:attribute name="onkeydown" type="xs:string"/>
+    <xs:attribute name="onkeypress" type="xs:string"/>
+    <xs:attribute name="onkeyup" type="xs:string"/>
+    <xs:attribute name="onload" type="xs:string"/>
+    <xs:attribute name="onloadeddata" type="xs:string"/>
+    <xs:attribute name="onloadedmetadata" type="xs:string"/>
+    <xs:attribute name="onloadstart" type="xs:string"/>
+    <xs:attribute name="onmousedown" type="xs:string"/>
+    <xs:attribute name="onmousemove" type="xs:string"/>
+    <xs:attribute name="onmouseout" type="xs:string"/>
+    <xs:attribute name="onmouseover" type="xs:string"/>
+    <xs:attribute name="onmouseup" type="xs:string"/>
+    <xs:attribute name="onmousewheel" type="xs:string"/>
+    <xs:attribute name="onpause" type="xs:string"/>
+    <xs:attribute name="onplay" type="xs:string"/>
+    <xs:attribute name="onplaying" type="xs:string"/>
+    <xs:attribute name="onprogress" type="xs:string"/>
+    <xs:attribute name="onratechange" type="xs:string"/>
+    <xs:attribute name="onreadystatechange" type="xs:string"/>
+    <xs:attribute name="onscroll" type="xs:string"/>
+    <xs:attribute name="onseeked" type="xs:string"/>
+    <xs:attribute name="onseeking" type="xs:string"/>
+    <xs:attribute name="onselect" type="xs:string"/>
+    <xs:attribute name="onshow" type="xs:string"/>
+    <xs:attribute name="onstalled" type="xs:string"/>
+    <xs:attribute name="onsubmit" type="xs:string"/>
+    <xs:attribute name="onsuspend" type="xs:string"/>
+    <xs:attribute name="ontimeupdate" type="xs:string"/>
+    <xs:attribute name="onvolumechange" type="xs:string"/>
+    <xs:attribute name="onwaiting" type="xs:string"/>
+  </xs:attributeGroup>
+
+  <!-- ##################################################################### -->
+  <xs:attributeGroup name="tables.attrs.alignment">
+    <xs:annotation>
+      <xs:documentation>RELAX NG Schema for HTML 5: Tables #</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="align">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="left"/>
+          <xs:enumeration value="center"/>
+          <xs:enumeration value="right"/>
+          <xs:enumeration value="justify"/>
+          <xs:enumeration value="char"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="char">
+      <xs:simpleType>
+        <xs:restriction base="xs:string">
+          <xs:pattern value="."/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="valign">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="top"/>
+          <xs:enumeration value="middle"/>
+          <xs:enumeration value="bottom"/>
+          <xs:enumeration value="baseline"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:element name="table">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:table.inner">
+          <xs:attributeGroup ref="xhtml:table.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="table.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="summary" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:complexType name="table.inner">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="xhtml:caption"/>
+      <xs:element minOccurs="0" maxOccurs="unbounded" ref="xhtml:colgroup"/>
+      <xs:element minOccurs="0" ref="xhtml:thead"/>
+      <xs:choice>
+        <xs:sequence>
+          <xs:element ref="xhtml:tfoot"/>
+          <xs:choice>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="xhtml:tbody"/>
+            <xs:element maxOccurs="unbounded" ref="xhtml:tr"/>
+          </xs:choice>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:choice>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="xhtml:tbody"/>
+            <xs:element maxOccurs="unbounded" ref="xhtml:tr"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="xhtml:tfoot"/>
+        </xs:sequence>
+      </xs:choice>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="caption">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:caption.inner">
+          <xs:attributeGroup ref="xhtml:caption.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="caption.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="caption.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <!-- ##################################################################### -->
+  <xs:element name="colgroup">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:colgroup.inner">
+          <xs:attributeGroup ref="xhtml:colgroup.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="colgroup.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="colgroup.inner">
+    <xs:sequence>
+      <xs:element minOccurs="0" maxOccurs="unbounded" ref="xhtml:col"/>
+    </xs:sequence>
+    <xs:attribute name="span" type="common.data.integer.positive"/>
+  </xs:complexType>
+  <xs:element name="col">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:col.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="col.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="span" type="common.data.integer.positive"/>
+  </xs:attributeGroup>
+  <xs:element name="thead">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:thead.inner">
+          <xs:attributeGroup ref="xhtml:thead.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="thead.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="thead.inner">
+    <xs:sequence>
+      <xs:element minOccurs="0" maxOccurs="unbounded" ref="xhtml:tr"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="tfoot">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:tfoot.inner">
+          <xs:attributeGroup ref="xhtml:tfoot.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="tfoot.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="tfoot.inner">
+    <xs:sequence>
+      <xs:element minOccurs="0" maxOccurs="unbounded" ref="xhtml:tr"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="tbody">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:tbody.inner">
+          <xs:attributeGroup ref="xhtml:tbody.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="tbody.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="tbody.inner">
+    <xs:sequence>
+      <xs:element minOccurs="0" maxOccurs="unbounded" ref="xhtml:tr"/>
+    </xs:sequence>
+  </xs:complexType>
+  <!-- ##################################################################### -->
+  <xs:element name="tr">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:tr.inner">
+          <xs:attributeGroup ref="xhtml:tr.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="tr.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="tr.inner">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="xhtml:td"/>
+      <xs:element ref="xhtml:th"/>
+    </xs:choice>
+  </xs:complexType>
+  <xs:attributeGroup name="tables.attrs.cell-structure">
+    <xs:annotation>
+      <xs:documentation>Common Table Cell Attributes</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="colspan" type="common.data.integer.positive"/>
+    <xs:attribute name="rowspan" type="common.data.integer.non-negative"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="tables.attrs.define-headers">
+    <xs:attribute name="scope">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="row"/>
+          <xs:enumeration value="col"/>
+          <xs:enumeration value="rowgroup"/>
+          <xs:enumeration value="colgroup"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:element name="td">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:td.inner">
+          <xs:attributeGroup ref="xhtml:td.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="td.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:tables.attrs.cell-structure"/>
+    <xs:attribute name="headers" type="common.data.idrefs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="td.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:element name="th">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:th.inner">
+          <xs:attributeGroup ref="xhtml:th.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="th.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:tables.attrs.cell-structure"/>
+    <xs:attribute name="scope">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="row"/>
+          <xs:enumeration value="col"/>
+          <xs:enumeration value="rowgroup"/>
+          <xs:enumeration value="colgroup"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="headers" type="common.data.idrefs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="th.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+
+  <!-- ##################################################################### -->
+  <xs:simpleType name="form.data.mimetypelist">
+    <xs:annotation>
+      <xs:documentation>RELAX NG Schema for HTML 5: Datatypes related to forms #</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="form.data.charsetlist">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <!--
+    FIXME should be a "a space- and/or comma-delimited
+    list of charset values"
+  -->
+  <xs:simpleType name="form.data.pattern">
+    <xs:annotation>
+      <xs:documentation>ECMAScript Regular Expression</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="form.data.datetime-local">
+    <xs:annotation>
+      <xs:documentation>Temporal</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="form.data.date">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="form.data.month">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="form.data.week">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="form.data.time">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="form.data.emailaddress">
+    <xs:annotation>
+      <xs:documentation>Email</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="form.data.emailaddresslist">
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="form.data.color">
+    <xs:annotation>
+      <xs:documentation>Color</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <!-- ##################################################################### -->
+  <xs:attributeGroup name="common-form.attrs">
+    <xs:annotation>
+      <xs:documentation>RELAX NG Schema for HTML 5: Web Forms 1.0 markup #</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="name" type="xs:string"/>
+    <xs:attribute name="disabled">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="disabled"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attributeGroup ref="common-form.attrs.form"/>
+  </xs:attributeGroup>
+
+  <!-- REVISIT tabindex goes in common.attrs -->
+  <xs:attributeGroup name="input.attrs.checked">
+    <xs:annotation>
+      <xs:documentation>Shared attributes for &lt;input&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="checked">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="checked"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:element name="input">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:input.text.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.password.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.checkbox.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.radio.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.button.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.submit.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.reset.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.file.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.hidden.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.image.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.datetime.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.datetime-local.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.date.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.month.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.time.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.week.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.number.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.range.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.email.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.url.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.search.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.tel.attrs"/>
+      <xs:attributeGroup ref="xhtml:input.color.attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:group name="input.text.elem">
+    <xs:annotation>
+      <xs:documentation>Text Field: &lt;input type='text'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.text.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="maxlength" type="common.data.integer.positive"/>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="size" type="common.data.integer.positive"/>
+    <xs:attribute name="value" type="xs:string"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="pattern" type="xhtml:form.data.pattern"/>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="placeholder" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:group name="input.elem">
+    <xs:choice>
+      <xs:group ref="xhtml:input.text.elem"/>
+      <xs:group ref="xhtml:input.password.elem"/>
+      <xs:group ref="xhtml:input.checkbox.elem"/>
+      <xs:group ref="xhtml:input.radio.elem"/>
+      <xs:group ref="xhtml:input.button.elem"/>
+      <xs:group ref="xhtml:input.submit.elem"/>
+      <xs:group ref="xhtml:input.reset.elem"/>
+      <xs:group ref="xhtml:input.file.elem"/>
+      <xs:group ref="xhtml:input.hidden.elem"/>
+      <xs:group ref="xhtml:input.image.elem"/>
+      <xs:group ref="xhtml:input.datetime.elem"/>
+      <xs:group ref="xhtml:input.datetime-local.elem"/>
+      <xs:group ref="xhtml:input.date.elem"/>
+      <xs:group ref="xhtml:input.month.elem"/>
+      <xs:group ref="xhtml:input.time.elem"/>
+      <xs:group ref="xhtml:input.week.elem"/>
+      <xs:group ref="xhtml:input.number.elem"/>
+      <xs:group ref="xhtml:input.range.elem"/>
+      <xs:group ref="xhtml:input.email.elem"/>
+      <xs:group ref="xhtml:input.url.elem"/>
+      <xs:group ref="xhtml:input.search.elem"/>
+      <xs:group ref="xhtml:input.tel.elem"/>
+      <xs:group ref="xhtml:input.color.elem"/>
+    </xs:choice>
+  </xs:group>
+  <xs:group name="input.password.elem">
+    <xs:annotation>
+      <xs:documentation>Password Field: &lt;input type='password'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.password.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="maxlength" type="common.data.integer.positive"/>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="size" type="common.data.integer.positive"/>
+    <xs:attribute name="value" type="xs:string"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="pattern" type="xhtml:form.data.pattern"/>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="placeholder" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="input.attrs.type">
+    <xs:attribute name="type">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="text"/>
+          <xs:enumeration value="password"/>
+          <xs:enumeration value="checkbox"/>
+          <xs:enumeration value="radio"/>
+          <xs:enumeration value="button"/>
+          <xs:enumeration value="submit"/>
+          <xs:enumeration value="reset"/>
+          <xs:enumeration value="file"/>
+          <xs:enumeration value="hidden"/>
+          <xs:enumeration value="image"/>
+          <xs:enumeration value="datetime"/>
+          <xs:enumeration value="datetime-local"/>
+          <xs:enumeration value="date"/>
+          <xs:enumeration value="month"/>
+          <xs:enumeration value="time"/>
+          <xs:enumeration value="week"/>
+          <xs:enumeration value="number"/>
+          <xs:enumeration value="range"/>
+          <xs:enumeration value="email"/>
+          <xs:enumeration value="url"/>
+          <xs:enumeration value="search"/>
+          <xs:enumeration value="tel"/>
+          <xs:enumeration value="color"/>
+
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:group name="input.checkbox.elem">
+    <xs:annotation>
+      <xs:documentation>Checkbox: &lt;input type='checkbox'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.checkbox.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="checked">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="checked"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="value" type="xs:string"/>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:group name="input.radio.elem">
+    <xs:annotation>
+      <xs:documentation>Radiobutton: &lt;input type='radio'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.radio.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="checked">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="checked"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="value" type="xs:string"/>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:group name="input.button.elem">
+    <xs:annotation>
+      <xs:documentation>Scripting Hook Button: &lt;input type='button'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.button.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="value" type="xs:string"/>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <!-- REVISIT should this be enabled by a scripting module only? -->
+  <xs:group name="input.submit.elem">
+    <xs:annotation>
+      <xs:documentation>Submit Button: &lt;input type='submit'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.submit.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="value" type="xs:string"/>
+    <xs:attribute name="formaction" type="common.data.uri"/>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="formenctype" type="xhtml:shared-form.attrs.formenctype.data"/>
+    <xs:attribute name="formmethod" type="xhtml:shared-form.attrs.formmethod.data"/>
+    <xs:attribute name="formtarget" type="common.data.browsing-context-or-keyword"/>
+    <xs:attribute name="formnovalidate">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="formnovalidate"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:group name="input.reset.elem">
+    <xs:annotation>
+      <xs:documentation>Reset Button: &lt;input type='reset'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.reset.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="value" type="xs:string"/>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <!-- REVISIT does reset make sense outside a form? -->
+  <xs:group name="input.file.elem">
+    <xs:annotation>
+      <xs:documentation>File Upload: &lt;input type='file'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.file.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="accept" type="xhtml:form.data.mimetypelist"/>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="multiple">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="multiple"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:group name="input.hidden.elem">
+    <xs:annotation>
+      <xs:documentation>Hidden String: &lt;input type='hidden'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.hidden.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="value" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:group name="input.image.elem">
+    <xs:annotation>
+      <xs:documentation>Image Submit Button: &lt;input type='image'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.image.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attributeGroup ref="xhtml:input.image.attrs.alt"/>
+    <xs:attribute name="src" type="common.data.uri"/>
+    <xs:attribute name="formaction" type="common.data.uri"/>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="formenctype" type="xhtml:shared-form.attrs.formenctype.data"/>
+    <xs:attribute name="formmethod" type="xhtml:shared-form.attrs.formmethod.data"/>
+    <xs:attribute name="formtarget" type="common.data.browsing-context-or-keyword"/>
+    <xs:attribute name="formnovalidate">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="formnovalidate"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="height" type="common.data.integer.positive"/>
+    <xs:attribute name="width" type="common.data.integer.positive"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="input.image.attrs.alt">
+    <xs:attribute name="alt" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:element name="textarea">
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="xhtml:textarea.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="textarea.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="maxlength" type="common.data.integer.positive"/>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="placeholder" type="xs:string"/>
+    <xs:attribute name="rows" type="common.data.integer.positive"/>
+    <xs:attribute name="wrap" type="xs:string"/>
+    <xs:attribute name="cols" type="common.data.integer.positive"/>
+  </xs:attributeGroup>
+  <!-- This is ugly. -->
+  <!--
+    Due to limitations with interleave, handling single/multiple selection
+    enforcement in RELAX NG seems to be possible but really awkward.
+    Tried it. Leaving it to Schematron.
+  -->
+  <xs:element name="option">
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="xhtml:option.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="option.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="disabled">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="disabled"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="selected">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="selected"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="label" type="xs:string"/>
+    <xs:attribute name="value" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:element name="optgroup">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:optgroup.inner">
+          <xs:attributeGroup ref="xhtml:optgroup.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="optgroup.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:optgroup.attrs.label"/>
+    <xs:attribute name="disabled">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="disabled"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="optgroup.attrs.label">
+    <xs:attribute name="label" use="required" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:complexType name="optgroup.inner">
+    <xs:sequence>
+      <xs:element minOccurs="0" maxOccurs="unbounded" ref="xhtml:option"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="select">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:select.inner">
+          <xs:attributeGroup ref="xhtml:select.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="select.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attribute name="size" type="common.data.integer.positive"/>
+    <xs:attribute name="multiple">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="multiple"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:complexType name="select.inner">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="xhtml:optgroup"/>
+      <xs:element ref="xhtml:option"/>
+    </xs:choice>
+  </xs:complexType>
+  <xs:complexType name="button.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+
+  <xs:element name="button">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:button.inner">
+          <xs:attributeGroup ref="xhtml:button.submit.attrs"/>
+          <xs:attributeGroup ref="xhtml:button.reset.attrs"/>
+          <xs:attributeGroup ref="xhtml:button.button.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:group name="button.submit.elem">
+    <xs:annotation>
+      <xs:documentation>Complex Submit Button: &lt;button type='submit'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="button"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="button.submit.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="button.attrs.type"/>
+    <xs:attribute name="value" type="xs:string"/>
+    <xs:attribute name="formaction" type="common.data.uri"/>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="formenctype" type="xhtml:shared-form.attrs.formenctype.data"/>
+    <xs:attribute name="formmethod" type="xhtml:shared-form.attrs.formmethod.data"/>
+    <xs:attribute name="formtarget" type="common.data.browsing-context-or-keyword"/>
+    <xs:attribute name="formnovalidate">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="formnovalidate"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:group name="button.elem">
+    <xs:choice>
+      <xs:group ref="xhtml:button.submit.elem"/>
+      <xs:group ref="xhtml:button.reset.elem"/>
+      <xs:group ref="xhtml:button.button.elem"/>
+    </xs:choice>
+  </xs:group>
+  <xs:group name="button.reset.elem">
+    <xs:annotation>
+      <xs:documentation>Complex Reset Button: &lt;button type='reset'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="button"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="button.reset.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:button.attrs.type"/>
+    <xs:attribute name="value" type="xs:string"/>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="button.attrs.type">
+    <xs:attribute name="type">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="submit"/>
+          <xs:enumeration value="reset"/>
+          <xs:enumeration value="button"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:group name="button.button.elem">
+    <xs:annotation>
+      <xs:documentation>Complex Push Button: &lt;button type='button'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="button"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="button.button.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:button.attrs.type"/>
+    <xs:attribute name="value" type="xs:string"/>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:element name="form">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:form.inner">
+          <xs:attributeGroup ref="xhtml:form.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="form.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="action" type="common.data.uri"/>
+    <xs:attribute name="method" type="xhtml:form.attrs.method.data"/>
+    <xs:attribute name="enctype" type="xhtml:form.attrs.enctype.data"/>
+    <xs:attribute name="name" type="xs:string"/>
+    <xs:attribute name="accept-charset" type="xhtml:form.data.charsetlist"/>
+    <xs:attribute name="novalidate">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="novalidate"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="target" type="common.data.browsing-context-or-keyword"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:simpleType name="form.attrs.method.data">
+    <xs:union>
+      <xs:simpleType>
+        <xs:union memberTypes="xs:string"/>
+      </xs:simpleType>
+      <xs:simpleType>
+        <xs:union memberTypes="xs:string"/>
+      </xs:simpleType>
+    </xs:union>
+  </xs:simpleType>
+  <xs:simpleType name="form.attrs.enctype.data">
+    <xs:union memberTypes="xs:string">
+      <xs:simpleType>
+        <xs:union memberTypes="xs:string"/>
+      </xs:simpleType>
+    </xs:union>
+  </xs:simpleType>
+  <xs:complexType name="form.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:element name="fieldset">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:fieldset.inner">
+          <xs:attributeGroup ref="xhtml:fieldset.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="fieldset.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="fieldset.inner" mixed="true">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="xhtml:legend"/>
+      <xs:group ref="common.inner.flow"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="label">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:label.inner">
+          <xs:attributeGroup ref="xhtml:label.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="label.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="for" type="common.data.idref"/>
+    <xs:attributeGroup ref="common-form.attrs.form"/>
+  </xs:attributeGroup>
+  <xs:complexType name="label.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:simpleType name="shared-form.attrs.formenctype.data">
+    <xs:union memberTypes="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="shared-form.attrs.formmethod.data">
+    <xs:union memberTypes="xs:string"/>
+  </xs:simpleType>
+  <xs:group name="input.datetime.elem">
+    <xs:annotation>
+      <xs:documentation>Global Date and Time: &lt;input type='datetime'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.datetime.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="min" type="common.data.datetime"/>
+    <xs:attribute name="max" type="common.data.datetime"/>
+    <xs:attribute name="step">
+      <xs:simpleType>
+        <xs:union memberTypes="xs:string"/>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="value" type="common.data.datetime"/>
+  </xs:attributeGroup>
+  <xs:group name="input.datetime-local.elem">
+    <xs:annotation>
+      <xs:documentation>Date and Time with No Time Zone Information: &lt;input type='datetime-local'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.datetime-local.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="min" type="xhtml:form.data.datetime-local"/>
+    <xs:attribute name="max" type="xhtml:form.data.datetime-local"/>
+    <xs:attribute name="step">
+      <xs:simpleType>
+        <xs:union memberTypes="xs:string"/>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="value" type="xhtml:form.data.datetime-local"/>
+  </xs:attributeGroup>
+  <xs:group name="input.date.elem">
+    <xs:annotation>
+      <xs:documentation>Date: &lt;input type='date'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.date.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="min" type="xhtml:form.data.date"/>
+    <xs:attribute name="max" type="xhtml:form.data.date"/>
+    <xs:attribute name="step">
+      <xs:simpleType>
+        <xs:union memberTypes="xs:string"/>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="value" type="xhtml:form.data.date"/>
+  </xs:attributeGroup>
+  <xs:group name="input.month.elem">
+    <xs:annotation>
+      <xs:documentation>Year and Month: &lt;input type='month'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.month.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="min" type="xhtml:form.data.month"/>
+    <xs:attribute name="max" type="xhtml:form.data.month"/>
+    <xs:attribute name="step">
+      <xs:simpleType>
+        <xs:union memberTypes="xs:string"/>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="value" type="xhtml:form.data.month"/>
+  </xs:attributeGroup>
+  <xs:group name="input.time.elem">
+    <xs:annotation>
+      <xs:documentation>Time without Time Zone Information: &lt;input type='time'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.time.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="min" type="xhtml:form.data.time"/>
+    <xs:attribute name="max" type="xhtml:form.data.time"/>
+    <xs:attribute name="step">
+      <xs:simpleType>
+        <xs:union memberTypes="xs:string"/>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="value" type="xhtml:form.data.time"/>
+  </xs:attributeGroup>
+  <xs:group name="input.week.elem">
+    <xs:annotation>
+      <xs:documentation>Year and Week: &lt;input type='week'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.week.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="min" type="xhtml:form.data.week"/>
+    <xs:attribute name="max" type="xhtml:form.data.week"/>
+    <xs:attribute name="step">
+      <xs:simpleType>
+        <xs:union memberTypes="xs:string"/>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="value" type="xhtml:form.data.week"/>
+  </xs:attributeGroup>
+  <xs:group name="input.number.elem">
+    <xs:annotation>
+      <xs:documentation>Number: &lt;input type='number'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.number.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="min" type="common.data.float"/>
+    <xs:attribute name="max" type="common.data.float"/>
+    <xs:attribute name="step">
+      <xs:simpleType>
+        <xs:union memberTypes="xs:string"/>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="value" type="common.data.float"/>
+  </xs:attributeGroup>
+  <xs:group name="input.range.elem">
+    <xs:annotation>
+      <xs:documentation>Imprecise Number: &lt;input type='range'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.range.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="min" type="common.data.float"/>
+    <xs:attribute name="max" type="common.data.float"/>
+    <xs:attribute name="step">
+      <xs:simpleType>
+        <xs:union memberTypes="xs:string"/>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="value" type="common.data.float"/>
+  </xs:attributeGroup>
+  <xs:group name="input.email.elem">
+    <xs:annotation>
+      <xs:documentation>Email Address: &lt;input type='email'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.email.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="maxlength" type="common.data.integer.positive"/>
+    <xs:attribute name="pattern" type="xhtml:form.data.pattern"/>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="size" type="common.data.integer.positive"/>
+    <xs:attribute name="placeholder" type="xs:string"/>
+    <xs:attribute name="value">
+      <xs:simpleType>
+        <xs:union memberTypes="xhtml:form.data.emailaddresslist xhtml:form.data.emailaddress"/>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="multiple">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="multiple"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:group name="input.url.elem">
+    <xs:annotation>
+      <xs:documentation>IRI: &lt;input type='url'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.url.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="maxlength" type="common.data.integer.positive"/>
+    <xs:attribute name="pattern" type="xhtml:form.data.pattern"/>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="size" type="common.data.integer.positive"/>
+    <xs:attribute name="placeholder" type="xs:string"/>
+    <xs:attribute name="value">
+      <xs:simpleType>
+        <xs:union memberTypes="xs:string"/>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:group name="input.search.elem">
+    <xs:annotation>
+      <xs:documentation>Search: &lt;input type='search'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.search.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="maxlength" type="common.data.integer.positive"/>
+    <xs:attribute name="pattern" type="xhtml:form.data.pattern"/>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="size" type="common.data.integer.positive"/>
+    <xs:attribute name="placeholder" type="xs:string"/>
+    <xs:attribute name="value" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:group name="input.tel.elem">
+    <xs:annotation>
+      <xs:documentation>Telephone Number: &lt;input type='tel'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.tel.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="maxlength" type="common.data.integer.positive"/>
+    <xs:attribute name="pattern" type="xhtml:form.data.pattern"/>
+    <xs:attribute name="readonly">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="readonly"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="required"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="size" type="common.data.integer.positive"/>
+    <xs:attribute name="placeholder" type="xs:string"/>
+    <xs:attribute name="value" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:group name="input.color.elem">
+    <xs:annotation>
+      <xs:documentation>Color: &lt;input type='color'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="input"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="input.color.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+    <xs:attributeGroup ref="xhtml:input.attrs.type"/>
+    <xs:attribute name="autocomplete">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="on"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="list" type="common.data.idref"/>
+    <xs:attribute name="value" type="xhtml:form.data.color"/>
+  </xs:attributeGroup>
+  <xs:element name="output">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:output.inner">
+          <xs:attributeGroup ref="xhtml:output.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="output.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="name" type="xs:string"/>
+    <xs:attributeGroup ref="common-form.attrs.form"/>
+    <xs:attribute name="for" type="common.data.idrefs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="output.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="datalist">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:datalist.inner">
+          <xs:attributeGroup ref="xhtml:datalist.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:complexType name="datalist.inner" mixed="true">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="xhtml:option"/>
+      <xs:group ref="common.inner.phrasing"/>
+    </xs:choice>
+  </xs:complexType>
+  <xs:attributeGroup name="datalist.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:element name="keygen">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:keygen.attrs"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="keygen.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="challenge" type="xs:string"/>
+    <xs:attribute name="keytype" type="xs:string"/>
+    <xs:attribute name="autofocus">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="autofocus"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attributeGroup ref="xhtml:common-form.attrs"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="common.attrs.interact">
+    <xs:annotation>
+      <xs:documentation>RELAX NG Schema for HTML 5: Web Application Features #</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="contextmenu" type="common.data.idref"/>
+    <xs:attribute name="contenteditable">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="true"/>
+          <xs:enumeration value="false"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="draggable">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="true"/>
+          <xs:enumeration value="false"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="hidden">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="hidden"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="spellcheck">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="true"/>
+          <xs:enumeration value="false"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="common.attrs.contenteditable">
+    <xs:annotation>
+      <xs:documentation>Editable Content: contenteditable</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="contenteditable">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="true"/>
+          <xs:enumeration value="false"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="common.attrs.draggable">
+    <xs:annotation>
+      <xs:documentation>Draggable Element: draggable</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="draggable">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="true"/>
+          <xs:enumeration value="false"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="common.attrs.hidden">
+    <xs:annotation>
+      <xs:documentation>Hidden Element: hidden</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="hidden">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="hidden"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="common.attrs.spellcheck">
+    <xs:annotation>
+      <xs:documentation>Spellchecking and grammar checking: spellcheck</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="spellcheck">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="true"/>
+          <xs:enumeration value="false"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:element name="progress">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:progress.inner">
+          <xs:attributeGroup ref="xhtml:progress.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="progress.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="value" type="common.data.float.non-negative"/>
+    <xs:attribute name="max" type="common.data.float.positive"/>
+  </xs:attributeGroup>
+  <xs:complexType name="progress.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <!-- Cannot enforce textContent format here -->
+  <xs:element name="datagrid">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:datagrid.inner">
+          <xs:attributeGroup ref="xhtml:datagrid.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="datagrid.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="multiple">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="multiple"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="disabled">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="disabled"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:complexType name="datagrid.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+
+  <xs:element name="command">
+    <xs:complexType>
+      <xs:attributeGroup ref="xhtml:command.command.attrs"/>
+      <xs:attributeGroup ref="xhtml:command.radio.attrs"/>
+      <xs:attributeGroup ref="xhtml:command.checkbox.attrs"/>
+
+    </xs:complexType>
+  </xs:element>
+
+  <xs:group name="command.command.elem">
+    <xs:annotation>
+      <xs:documentation>Command with an associated action: &lt;command type='command'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="command"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="command.command.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="command.attrs.type"/>
+    <xs:attributeGroup ref="xhtml:common-command.attrs"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="command.attrs.type">
+    <xs:attribute name="type">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="radio"/>
+          <xs:enumeration value="command"/>
+          <xs:enumeration value="checkbox"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:group name="command.elem">
+    <xs:choice>
+      <xs:group ref="xhtml:command.command.elem"/>
+      <xs:group ref="xhtml:command.radio.elem"/>
+      <xs:group ref="xhtml:command.checkbox.elem"/>
+    </xs:choice>
+  </xs:group>
+  <xs:group name="command.radio.elem">
+    <xs:annotation>
+      <xs:documentation>Selection of one item from a list of items: &lt;command type='radio'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="command"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="command.radio.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:command.attrs.type"/>
+    <xs:attributeGroup ref="xhtml:command.radio.attrs.radiogroup"/>
+    <xs:attribute name="checked">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="checked"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attributeGroup ref="xhtml:common-command.attrs"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="command.radio.attrs.radiogroup">
+    <xs:attribute name="radiogroup" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:group name="command.checkbox.elem">
+    <xs:annotation>
+      <xs:documentation>State or option that can be toggled: &lt;command type='checkbox'&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element ref="command"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="command.checkbox.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attributeGroup ref="xhtml:command.attrs.type"/>
+    <xs:attribute name="checked">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="checked"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attributeGroup ref="xhtml:common-command.attrs"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="common-command.attrs">
+    <xs:attribute name="label" type="xs:string"/>
+    <xs:attribute name="icon" type="common.data.uri"/>
+    <xs:attribute name="disabled">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="disabled"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:element name="bb">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:bb.inner">
+          <xs:attributeGroup ref="xhtml:bb.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="bb.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="type" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="bb.attrs.type">
+    <xs:attribute name="type">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="makeapp"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:complexType name="bb.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="menu">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:menu.inner">
+          <xs:attributeGroup ref="xhtml:menu.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="menu.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="type">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="toolbar"/>
+          <xs:enumeration value="context"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="label" type="xs:string"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="menu.attrs.type">
+    <xs:attribute name="type">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="toolbar"/>
+          <xs:enumeration value="context"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:complexType name="menu.inner" mixed="true">
+    <xs:choice>
+      <xs:group minOccurs="0" maxOccurs="unbounded" ref="xhtml:mli.elem"/>
+      <xs:group ref="common.inner.flow"/>
+    </xs:choice>
+  </xs:complexType>
+  <!-- REVISIT allow nested menus -->
+  <xs:group name="mli.elem">
+    <xs:annotation>
+      <xs:documentation>Menu Item: &lt;li&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="li">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:mli.inner">
+              <xs:attributeGroup ref="xhtml:mli.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="mli.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+  </xs:attributeGroup>
+  <xs:complexType name="mli.inner" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:group name="canvas.elem.flow">
+    <xs:annotation>
+      <xs:documentation>Canvas for Dynamic Graphics: &lt;canvas&gt;</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="canvas">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:canvas.inner.flow">
+              <xs:attributeGroup ref="xhtml:canvas.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="canvas.elem.phrasing">
+    <xs:sequence>
+      <xs:element name="canvas">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="xhtml:canvas.inner.phrasing">
+              <xs:attributeGroup ref="xhtml:canvas.attrs"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="canvas.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="height" type="common.data.integer.non-negative"/>
+    <xs:attribute name="width" type="common.data.integer.non-negative"/>
+  </xs:attributeGroup>
+  <xs:complexType name="canvas.inner.flow" mixed="true">
+    <xs:group ref="common.inner.flow"/>
+  </xs:complexType>
+  <xs:complexType name="canvas.inner.phrasing" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <xs:element name="details">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:details.inner">
+          <xs:attributeGroup ref="xhtml:details.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="details.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="open">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="open"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="details.attrs.open">
+    <xs:attribute name="open">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="open"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:complexType name="details.inner" mixed="true">
+    <xs:sequence>
+      <xs:element ref="xhtml:legend"/>
+      <xs:group ref="common.inner.flow"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="time">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:time.inner">
+          <xs:attributeGroup ref="xhtml:time.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="time.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="datetime" type="common.data.date-or-time"/>
+  </xs:attributeGroup>
+  <xs:complexType name="time.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+  <!-- Cannot enforce textContent format here -->
+  <xs:element name="meter">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xhtml:meter.inner">
+          <xs:attributeGroup ref="xhtml:meter.attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="meter.attrs">
+    <xs:attributeGroup ref="common.attrs"/>
+    <xs:attribute name="value" type="common.data.float"/>
+    <xs:attribute name="min" type="common.data.float"/>
+    <xs:attribute name="low" type="common.data.float"/>
+    <xs:attribute name="high" type="common.data.float"/>
+    <xs:attribute name="max" type="common.data.float"/>
+    <xs:attribute name="optimum" type="common.data.float"/>
+  </xs:attributeGroup>
+
+  <xs:complexType name="meter.inner" mixed="true">
+    <xs:group ref="common.inner.phrasing"/>
+  </xs:complexType>
+
+  <xs:attribute name="id" type="xs:NCName"/>
+  <xs:attribute name="base" type="common.data.uri"/>
+  <xs:attribute name="space">
+    <xs:simpleType>
+      <xs:restriction base="xs:string">
+        <xs:enumeration value="preserve"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:attribute>
+  <xs:attribute name="lang" type="common.data.langcode"/>
+</xs:schema>
+
diff --git a/xml/impl/resources/standardSchemas/plugin-repository.dtd b/xml/impl/resources/standardSchemas/plugin-repository.dtd
new file mode 100644
index 0000000..2c551fa
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/plugin-repository.dtd
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!ELEMENT plugin-repository (category*)>
+<!ELEMENT category (category | idea-plugin)*>
+<!ATTLIST category
+    name CDATA #REQUIRED>
+<!ELEMENT idea-plugin (name | description | change-notes | version | vendor | idea-version ? | depends)+>
+<!ATTLIST idea-plugin
+    downloads CDATA #REQUIRED
+    size CDATA #REQUIRED
+    url CDATA #IMPLIED
+    date CDATA #REQUIRED>
+
+<!--
+    <name> is a unique Plugin identifier
+-->
+<!ELEMENT name (#PCDATA)>
+<!--
+    <description> is a short description of plugin and it functionality
+-->
+<!ELEMENT description (#PCDATA)>
+<!--
+    <version> specified current plugin version.
+-->
+<!ELEMENT version (#PCDATA)>
+<!--
+    <vendor> tag now could have an 'url' and 'email' attributes
+-->
+<!ELEMENT vendor (#PCDATA)>
+<!ATTLIST vendor
+    url CDATA #IMPLIED
+    email CDATA #IMPLIED>
+
+<!--
+    Plugin change notes
+ -->
+<!ELEMENT idea-version EMPTY>
+<!ATTLIST idea-version
+    min CDATA #IMPLIED
+    max CDATA #IMPLIED
+    since-build CDATA #IMPLIED>
+
+<!ELEMENT change-notes (#PCDATA)>
+
+<!ELEMENT depends (#PCDATA)>
diff --git a/xml/impl/resources/standardSchemas/plugin.dtd b/xml/impl/resources/standardSchemas/plugin.dtd
new file mode 100644
index 0000000..c1cb334
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/plugin.dtd
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!ELEMENT idea-plugin (name | id? | description | version | vendor | change-notes? | idea-version | category | resource-bundle | depends* | extensions* | application-components? | project-components? | module-components? | actions? | helpset)+>
+<!ATTLIST idea-plugin
+    url CDATA #IMPLIED
+    version CDATA #IMPLIED>
+<!--
+    <name> is a unique Plugin identifier
+-->
+<!ELEMENT name (#PCDATA)>
+<!--
+    <id> is a unique Plugin identifier, if not specified, id is considered equal to "name"
+-->
+<!ELEMENT id (#PCDATA)>
+<!--
+    <description> is a short description of plugin and it functionality
+-->
+<!ELEMENT description (#PCDATA)>
+<!--
+    <version> specified current plugin version.
+-->
+<!ELEMENT version (#PCDATA)>
+
+<!--
+    <vendor> tag now could have 'url', 'email' and 'logo' attributes;
+    'logo' should contain path to a 16 x 16 icon that will appear near the plugin name in the IDEA Welcome Screen 
+-->
+<!ELEMENT vendor (#PCDATA)>
+<!ATTLIST vendor
+    url CDATA #IMPLIED
+    email CDATA #IMPLIED
+    logo CDATA #IMPLIED>
+
+<!--
+    Plugin category (displayed in plugin manager) e.g. inspection, Misc, Fun Stuff, etc
+-->
+<!ELEMENT category (#PCDATA)>
+
+<!--
+    Fully qualified name of bundle used by this plugin e.g. com.mycompany.MyBundle
+-->
+<!ELEMENT resource-bundle (#PCDATA)>
+
+<!--
+    Possible extensions element
+-->
+<!ELEMENT errorHandler (#PCDATA)>
+<!ATTLIST errorHandler implementation CDATA #REQUIRED>
+
+<!--
+    Possible extensions element
+-->
+<!ELEMENT indexPatternProvider (#PCDATA)>
+<!ATTLIST indexPatternProvider implementation CDATA #REQUIRED>
+
+<!--
+    <idea-version> tag specified version of IDEA which
+    plugin could work with
+-->
+<!ELEMENT idea-version EMPTY>
+<!-- min / max attributes are left for compatibility -->
+
+<!ATTLIST idea-version
+    since-build CDATA #REQUIRED
+    until-build CDATA #IMPLIED
+    min CDATA #IMPLIED
+    max CDATA #IMPLIED
+    >
+
+<!-- change notes of current version -->
+<!ELEMENT change-notes (#PCDATA)>
+
+<!ELEMENT depends (#PCDATA)>
+<!ATTLIST depends
+   optional (true | false) #IMPLIED
+   config-file CDATA #IMPLIED
+   >
+
+<!-- extensions. Most relaxed constraints since content of the particular extension cannot be expressed with DTD
+  defaultExtensionNs - namespace prepended to referenced extension name to get qname,
+  xmlns same as previous, left for compatibility 
+ -->
+<!ELEMENT extensions ANY>
+<!ATTLIST extensions
+   defaultExtensionNs CDATA #REQUIRED
+   xmlns CDATA #IMPLIED
+   >
+
+<!ELEMENT application-components (component*)>
+<!ELEMENT project-components (component*)>
+<!ELEMENT module-components (component*)>
+<!ELEMENT component (implementation-class | interface-class? | option*)+>
+<!ELEMENT actions (action+ | group+)*>
+<!ELEMENT implementation-class (#PCDATA)>
+<!ELEMENT interface-class (#PCDATA)>
+<!ELEMENT option EMPTY>
+<!ATTLIST option
+    name CDATA #REQUIRED
+    value CDATA #REQUIRED>
+<!ELEMENT action (keyboard-shortcut? | mouse-shortcut? | shortcut? | add-to-group?)+>
+<!--
+    <action> tag has required 'id' attribute
+    which mean an action ID. Some existing plugins
+    have an uncompatible XML ID for this attribute.
+    :((
+ -->
+<!ATTLIST action
+    description CDATA #IMPLIED
+    class CDATA #REQUIRED
+    text CDATA #REQUIRED
+    id CDATA #REQUIRED
+    icon CDATA #IMPLIED
+    popup (true | false) #IMPLIED>
+<!ELEMENT keyboard-shortcut EMPTY>
+<!ATTLIST keyboard-shortcut
+    first-keystroke CDATA #REQUIRED
+    second-keystroke CDATA #IMPLIED
+    keymap CDATA #REQUIRED
+    use-shortcut-of CDATA #IMPLIED>
+<!ELEMENT mouse-shortcut EMPTY>
+<!ATTLIST mouse-shortcut
+    keystroke CDATA #REQUIRED
+    keymap CDATA #REQUIRED>
+<!ELEMENT shortcut EMPTY>
+<!ATTLIST shortcut
+    first-keystroke CDATA #REQUIRED
+    second-keystroke CDATA #IMPLIED
+    keymap CDATA #REQUIRED>
+<!ELEMENT group (reference* | separator* | action* | add-to-group*)+>
+<!ATTLIST group
+    id ID #IMPLIED
+    class CDATA #IMPLIED
+    text CDATA #IMPLIED
+    description CDATA #IMPLIED
+    popup (true | false) #IMPLIED
+    icon CDATA #IMPLIED>
+<!ELEMENT reference EMPTY>
+<!ATTLIST reference
+    ref CDATA #REQUIRED>
+<!ELEMENT add-to-group EMPTY>
+<!--
+    <add-to-group> tag use an 'id' attribute
+    to specify which group will be used.
+    It should be very useful if
+    we'll have a set of existing group IDs
+-->
+<!ATTLIST add-to-group
+    anchor (first | last | before | after) #REQUIRED
+    group-id CDATA #REQUIRED
+    relative-to-action CDATA #IMPLIED>
+<!ELEMENT separator EMPTY>
+
+<!-- helpset is a name of file from PLUGIN/help/ folder
+  Example: <helpset file="myhelp.jar" path="/Help.hs"/>
+ -->
+<!ELEMENT helpset EMPTY>
+<!ATTLIST helpset
+  file CDATA #REQUIRED
+  path CDATA #REQUIRED>
\ No newline at end of file
diff --git a/xml/impl/resources/standardSchemas/xhtml-lat1.ent b/xml/impl/resources/standardSchemas/xhtml-lat1.ent
new file mode 100644
index 0000000..ffee223
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml-lat1.ent
@@ -0,0 +1,196 @@
+<!-- Portions (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+-->
+<!-- Character entity set. Typical invocation:
+    <!ENTITY % HTMLlat1 PUBLIC
+       "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
+    %HTMLlat1;
+-->
+
+<!ENTITY nbsp   "&#160;"> <!-- no-break space = non-breaking space,
+                                  U+00A0 ISOnum -->
+<!ENTITY iexcl  "&#161;"> <!-- inverted exclamation mark, U+00A1 ISOnum -->
+<!ENTITY cent   "&#162;"> <!-- cent sign, U+00A2 ISOnum -->
+<!ENTITY pound  "&#163;"> <!-- pound sign, U+00A3 ISOnum -->
+<!ENTITY curren "&#164;"> <!-- currency sign, U+00A4 ISOnum -->
+<!ENTITY yen    "&#165;"> <!-- yen sign = yuan sign, U+00A5 ISOnum -->
+<!ENTITY brvbar "&#166;"> <!-- broken bar = broken vertical bar,
+                                  U+00A6 ISOnum -->
+<!ENTITY sect   "&#167;"> <!-- section sign, U+00A7 ISOnum -->
+<!ENTITY uml    "&#168;"> <!-- diaeresis = spacing diaeresis,
+                                  U+00A8 ISOdia -->
+<!ENTITY copy   "&#169;"> <!-- copyright sign, U+00A9 ISOnum -->
+<!ENTITY ordf   "&#170;"> <!-- feminine ordinal indicator, U+00AA ISOnum -->
+<!ENTITY laquo  "&#171;"> <!-- left-pointing double angle quotation mark
+                                  = left pointing guillemet, U+00AB ISOnum -->
+<!ENTITY not    "&#172;"> <!-- not sign = angled dash,
+                                  U+00AC ISOnum -->
+<!ENTITY shy    "&#173;"> <!-- soft hyphen = discretionary hyphen,
+                                  U+00AD ISOnum -->
+<!ENTITY reg    "&#174;"> <!-- registered sign = registered trade mark sign,
+                                  U+00AE ISOnum -->
+<!ENTITY macr   "&#175;"> <!-- macron = spacing macron = overline
+                                  = APL overbar, U+00AF ISOdia -->
+<!ENTITY deg    "&#176;"> <!-- degree sign, U+00B0 ISOnum -->
+<!ENTITY plusmn "&#177;"> <!-- plus-minus sign = plus-or-minus sign,
+                                  U+00B1 ISOnum -->
+<!ENTITY sup2   "&#178;"> <!-- superscript two = superscript digit two
+                                  = squared, U+00B2 ISOnum -->
+<!ENTITY sup3   "&#179;"> <!-- superscript three = superscript digit three
+                                  = cubed, U+00B3 ISOnum -->
+<!ENTITY acute  "&#180;"> <!-- acute accent = spacing acute,
+                                  U+00B4 ISOdia -->
+<!ENTITY micro  "&#181;"> <!-- micro sign, U+00B5 ISOnum -->
+<!ENTITY para   "&#182;"> <!-- pilcrow sign = paragraph sign,
+                                  U+00B6 ISOnum -->
+<!ENTITY middot "&#183;"> <!-- middle dot = Georgian comma
+                                  = Greek middle dot, U+00B7 ISOnum -->
+<!ENTITY cedil  "&#184;"> <!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
+<!ENTITY sup1   "&#185;"> <!-- superscript one = superscript digit one,
+                                  U+00B9 ISOnum -->
+<!ENTITY ordm   "&#186;"> <!-- masculine ordinal indicator,
+                                  U+00BA ISOnum -->
+<!ENTITY raquo  "&#187;"> <!-- right-pointing double angle quotation mark
+                                  = right pointing guillemet, U+00BB ISOnum -->
+<!ENTITY frac14 "&#188;"> <!-- vulgar fraction one quarter
+                                  = fraction one quarter, U+00BC ISOnum -->
+<!ENTITY frac12 "&#189;"> <!-- vulgar fraction one half
+                                  = fraction one half, U+00BD ISOnum -->
+<!ENTITY frac34 "&#190;"> <!-- vulgar fraction three quarters
+                                  = fraction three quarters, U+00BE ISOnum -->
+<!ENTITY iquest "&#191;"> <!-- inverted question mark
+                                  = turned question mark, U+00BF ISOnum -->
+<!ENTITY Agrave "&#192;"> <!-- latin capital letter A with grave
+                                  = latin capital letter A grave,
+                                  U+00C0 ISOlat1 -->
+<!ENTITY Aacute "&#193;"> <!-- latin capital letter A with acute,
+                                  U+00C1 ISOlat1 -->
+<!ENTITY Acirc  "&#194;"> <!-- latin capital letter A with circumflex,
+                                  U+00C2 ISOlat1 -->
+<!ENTITY Atilde "&#195;"> <!-- latin capital letter A with tilde,
+                                  U+00C3 ISOlat1 -->
+<!ENTITY Auml   "&#196;"> <!-- latin capital letter A with diaeresis,
+                                  U+00C4 ISOlat1 -->
+<!ENTITY Aring  "&#197;"> <!-- latin capital letter A with ring above
+                                  = latin capital letter A ring,
+                                  U+00C5 ISOlat1 -->
+<!ENTITY AElig  "&#198;"> <!-- latin capital letter AE
+                                  = latin capital ligature AE,
+                                  U+00C6 ISOlat1 -->
+<!ENTITY Ccedil "&#199;"> <!-- latin capital letter C with cedilla,
+                                  U+00C7 ISOlat1 -->
+<!ENTITY Egrave "&#200;"> <!-- latin capital letter E with grave,
+                                  U+00C8 ISOlat1 -->
+<!ENTITY Eacute "&#201;"> <!-- latin capital letter E with acute,
+                                  U+00C9 ISOlat1 -->
+<!ENTITY Ecirc  "&#202;"> <!-- latin capital letter E with circumflex,
+                                  U+00CA ISOlat1 -->
+<!ENTITY Euml   "&#203;"> <!-- latin capital letter E with diaeresis,
+                                  U+00CB ISOlat1 -->
+<!ENTITY Igrave "&#204;"> <!-- latin capital letter I with grave,
+                                  U+00CC ISOlat1 -->
+<!ENTITY Iacute "&#205;"> <!-- latin capital letter I with acute,
+                                  U+00CD ISOlat1 -->
+<!ENTITY Icirc  "&#206;"> <!-- latin capital letter I with circumflex,
+                                  U+00CE ISOlat1 -->
+<!ENTITY Iuml   "&#207;"> <!-- latin capital letter I with diaeresis,
+                                  U+00CF ISOlat1 -->
+<!ENTITY ETH    "&#208;"> <!-- latin capital letter ETH, U+00D0 ISOlat1 -->
+<!ENTITY Ntilde "&#209;"> <!-- latin capital letter N with tilde,
+                                  U+00D1 ISOlat1 -->
+<!ENTITY Ograve "&#210;"> <!-- latin capital letter O with grave,
+                                  U+00D2 ISOlat1 -->
+<!ENTITY Oacute "&#211;"> <!-- latin capital letter O with acute,
+                                  U+00D3 ISOlat1 -->
+<!ENTITY Ocirc  "&#212;"> <!-- latin capital letter O with circumflex,
+                                  U+00D4 ISOlat1 -->
+<!ENTITY Otilde "&#213;"> <!-- latin capital letter O with tilde,
+                                  U+00D5 ISOlat1 -->
+<!ENTITY Ouml   "&#214;"> <!-- latin capital letter O with diaeresis,
+                                  U+00D6 ISOlat1 -->
+<!ENTITY times  "&#215;"> <!-- multiplication sign, U+00D7 ISOnum -->
+<!ENTITY Oslash "&#216;"> <!-- latin capital letter O with stroke
+                                  = latin capital letter O slash,
+                                  U+00D8 ISOlat1 -->
+<!ENTITY Ugrave "&#217;"> <!-- latin capital letter U with grave,
+                                  U+00D9 ISOlat1 -->
+<!ENTITY Uacute "&#218;"> <!-- latin capital letter U with acute,
+                                  U+00DA ISOlat1 -->
+<!ENTITY Ucirc  "&#219;"> <!-- latin capital letter U with circumflex,
+                                  U+00DB ISOlat1 -->
+<!ENTITY Uuml   "&#220;"> <!-- latin capital letter U with diaeresis,
+                                  U+00DC ISOlat1 -->
+<!ENTITY Yacute "&#221;"> <!-- latin capital letter Y with acute,
+                                  U+00DD ISOlat1 -->
+<!ENTITY THORN  "&#222;"> <!-- latin capital letter THORN,
+                                  U+00DE ISOlat1 -->
+<!ENTITY szlig  "&#223;"> <!-- latin small letter sharp s = ess-zed,
+                                  U+00DF ISOlat1 -->
+<!ENTITY agrave "&#224;"> <!-- latin small letter a with grave
+                                  = latin small letter a grave,
+                                  U+00E0 ISOlat1 -->
+<!ENTITY aacute "&#225;"> <!-- latin small letter a with acute,
+                                  U+00E1 ISOlat1 -->
+<!ENTITY acirc  "&#226;"> <!-- latin small letter a with circumflex,
+                                  U+00E2 ISOlat1 -->
+<!ENTITY atilde "&#227;"> <!-- latin small letter a with tilde,
+                                  U+00E3 ISOlat1 -->
+<!ENTITY auml   "&#228;"> <!-- latin small letter a with diaeresis,
+                                  U+00E4 ISOlat1 -->
+<!ENTITY aring  "&#229;"> <!-- latin small letter a with ring above
+                                  = latin small letter a ring,
+                                  U+00E5 ISOlat1 -->
+<!ENTITY aelig  "&#230;"> <!-- latin small letter ae
+                                  = latin small ligature ae, U+00E6 ISOlat1 -->
+<!ENTITY ccedil "&#231;"> <!-- latin small letter c with cedilla,
+                                  U+00E7 ISOlat1 -->
+<!ENTITY egrave "&#232;"> <!-- latin small letter e with grave,
+                                  U+00E8 ISOlat1 -->
+<!ENTITY eacute "&#233;"> <!-- latin small letter e with acute,
+                                  U+00E9 ISOlat1 -->
+<!ENTITY ecirc  "&#234;"> <!-- latin small letter e with circumflex,
+                                  U+00EA ISOlat1 -->
+<!ENTITY euml   "&#235;"> <!-- latin small letter e with diaeresis,
+                                  U+00EB ISOlat1 -->
+<!ENTITY igrave "&#236;"> <!-- latin small letter i with grave,
+                                  U+00EC ISOlat1 -->
+<!ENTITY iacute "&#237;"> <!-- latin small letter i with acute,
+                                  U+00ED ISOlat1 -->
+<!ENTITY icirc  "&#238;"> <!-- latin small letter i with circumflex,
+                                  U+00EE ISOlat1 -->
+<!ENTITY iuml   "&#239;"> <!-- latin small letter i with diaeresis,
+                                  U+00EF ISOlat1 -->
+<!ENTITY eth    "&#240;"> <!-- latin small letter eth, U+00F0 ISOlat1 -->
+<!ENTITY ntilde "&#241;"> <!-- latin small letter n with tilde,
+                                  U+00F1 ISOlat1 -->
+<!ENTITY ograve "&#242;"> <!-- latin small letter o with grave,
+                                  U+00F2 ISOlat1 -->
+<!ENTITY oacute "&#243;"> <!-- latin small letter o with acute,
+                                  U+00F3 ISOlat1 -->
+<!ENTITY ocirc  "&#244;"> <!-- latin small letter o with circumflex,
+                                  U+00F4 ISOlat1 -->
+<!ENTITY otilde "&#245;"> <!-- latin small letter o with tilde,
+                                  U+00F5 ISOlat1 -->
+<!ENTITY ouml   "&#246;"> <!-- latin small letter o with diaeresis,
+                                  U+00F6 ISOlat1 -->
+<!ENTITY divide "&#247;"> <!-- division sign, U+00F7 ISOnum -->
+<!ENTITY oslash "&#248;"> <!-- latin small letter o with stroke,
+                                  = latin small letter o slash,
+                                  U+00F8 ISOlat1 -->
+<!ENTITY ugrave "&#249;"> <!-- latin small letter u with grave,
+                                  U+00F9 ISOlat1 -->
+<!ENTITY uacute "&#250;"> <!-- latin small letter u with acute,
+                                  U+00FA ISOlat1 -->
+<!ENTITY ucirc  "&#251;"> <!-- latin small letter u with circumflex,
+                                  U+00FB ISOlat1 -->
+<!ENTITY uuml   "&#252;"> <!-- latin small letter u with diaeresis,
+                                  U+00FC ISOlat1 -->
+<!ENTITY yacute "&#253;"> <!-- latin small letter y with acute,
+                                  U+00FD ISOlat1 -->
+<!ENTITY thorn  "&#254;"> <!-- latin small letter thorn,
+                                  U+00FE ISOlat1 -->
+<!ENTITY yuml   "&#255;"> <!-- latin small letter y with diaeresis,
+                                  U+00FF ISOlat1 -->
diff --git a/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile10-flat.dtd b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile10-flat.dtd
new file mode 100644
index 0000000..5066cd1
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile10-flat.dtd
@@ -0,0 +1,3223 @@
+<!-- XHTML Mobile 1.0 DTD  ...................................................... -->
+<!-- file: xhtml-mobile10.dtd -->
+<!-- 
+     This is XHTML Mobile profile, a proper subset of XHTML.
+     
+     	@Wireless Application Protocol Forum, Ltd. 2001.
+
+	Terms and conditions of use are available from the Wireless Application Protocol Forum Ltd. 
+	Web site (http://www.wapforum.org/what/copyright.htm).
+    
+-->
+<!-- This is the driver file for version 1.0 of the XHTML Mobile DTD.
+
+     This DTD is identified by the PUBLIC and SYSTEM identifiers:
+
+     PUBLIC: "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
+     SYSTEM: "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"
+-->
+<!ENTITY % XHTML.version  "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" >
+
+<!-- Use this URI to identify the default namespace:
+
+         "http://www.w3.org/1999/xhtml"
+
+     See the Qualified Names module for information
+     on the use of namespace prefixes in the DTD.
+-->
+<!ENTITY % NS.prefixed "IGNORE" >
+<!ENTITY % XHTML.prefix  "" >
+
+<!-- For example, if you are using XHTML Mobile 1.0 directly, use
+     the FPI in the DOCTYPE declaration, with the xmlns attribute
+     on the document element to identify the default namespace:
+
+         <?xml version="1.0"?>
+         <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
+             "http://www.wapforum.org/DTD/xhtml-mobile10.dtd" >
+         <html xmlns="http://www.w3.org/1999/xhtml"
+               xml:lang="en" >
+         ...
+         </html>
+-->
+
+<!-- reserved for future use with document profiles -->
+<!ENTITY % XHTML.profile  "" >
+
+<!-- Inline Style Module  ........................................ -->
+<!ENTITY % xhtml-inlstyle.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Inline Style 1.0//EN"
+            "../xhtml11/xhtml-inlstyle-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Inline Style Module  ........................................... -->
+<!-- file: xhtml-inlstyle-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-inlstyle-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Inline Style 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-inlstyle-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Inline Style
+
+     This module declares the 'style' attribute, used to support inline
+     style markup. This module must be instantiated prior to the XHTML
+     Common Attributes module in order to be included in %Core.attrib;.
+-->
+
+<!ENTITY % style.attrib
+     "style        CDATA                    #IMPLIED"
+>
+
+
+<!ENTITY % Core.extra.attrib
+     "%style.attrib;"
+>
+
+<!-- end of xhtml-inlstyle-1.mod -->
+
+
+<!-- Document Model ........................................ -->
+<!ENTITY % xhtml-model.mod
+     PUBLIC "-//WAPFORUM//ENTITIES XHTML Mobile 1.0 Document Model 1.0//EN"
+            "xhtml-mobile10-model-1.mod" >
+
+<!-- XHTML Framework ........................................ -->
+<!ENTITY % XHTML.bidi  "IGNORE" >
+<!ENTITY % xhtml-framework.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
+            "../xhtml11/xhtml-framework-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Modular Framework Module  ...................................... -->
+<!-- file: xhtml-framework-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-framework-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-framework-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Modular Framework
+
+     This required module instantiates the modules needed
+     to support the XHTML modularization model, including:
+
+        +  notations
+        +  datatypes
+        +  namespace-qualified names
+        +  common attributes
+        +  document model
+        +  character entities
+
+     The Intrinsic Events module is ignored by default but
+     occurs in this module because it must be instantiated
+     prior to Attributes but after Datatypes.
+-->
+
+<!ENTITY % xhtml-arch.module "IGNORE" >
+<![%xhtml-arch.module;[
+<!ENTITY % xhtml-arch.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Base Architecture 1.0//EN"
+            "xhtml-arch-1.mod" >
+%xhtml-arch.mod;]]>
+
+<!ENTITY % xhtml-notations.module "INCLUDE" >
+<![%xhtml-notations.module;[
+<!ENTITY % xhtml-notations.mod
+     PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN"
+            "xhtml-notations-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Notations Module  .............................................. -->
+<!-- file: xhtml-notations-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-notations-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-notations-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Notations
+
+     defines the following notations, many of these imported from
+     other specifications and standards. When an existing FPI is
+     known, it is incorporated here.
+-->
+
+<!-- XML Notations ..................................... -->
+<!-- SGML and XML Notations ............................ -->
+
+<!-- W3C XML 1.0 Recommendation -->
+<!NOTATION w3c-xml
+     PUBLIC "ISO 8879//NOTATION Extensible Markup Language (XML) 1.0//EN" >
+
+<!-- XML 1.0 CDATA -->
+<!NOTATION cdata
+     PUBLIC "-//W3C//NOTATION XML 1.0: CDATA//EN" >
+
+<!-- SGML Formal Public Identifiers -->
+<!NOTATION fpi
+     PUBLIC "ISO 8879:1986//NOTATION Formal Public Identifier//EN" >
+
+<!-- XHTML Notations ................................... -->
+
+<!-- Length defined for cellpadding/cellspacing -->
+
+<!-- nn for pixels or nn% for percentage length -->
+<!NOTATION length
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Length//EN" >
+
+<!-- space-separated list of link types -->
+<!NOTATION linkTypes
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: LinkTypes//EN" >
+
+<!-- single or comma-separated list of media descriptors -->
+<!NOTATION mediaDesc
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: MediaDesc//EN" >
+
+<!-- pixel, percentage, or relative -->
+<!NOTATION multiLength
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: MultiLength//EN" >
+
+<!-- one or more digits (NUMBER) -->
+<!NOTATION number
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Number//EN" >
+
+<!-- integer representing length in pixels -->
+<!NOTATION pixels
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Pixels//EN" >
+
+<!-- script expression -->
+<!NOTATION script
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Script//EN" >
+
+<!-- textual content -->
+<!NOTATION text
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Text//EN" >
+
+<!-- Imported Notations ................................ -->
+
+<!-- a single character from [ISO10646] -->
+<!NOTATION character
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Character//EN" >
+
+<!-- a character encoding, as per [RFC2045] -->
+<!NOTATION charset
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Charset//EN" >
+
+<!-- a space separated list of character encodings, as per [RFC2045] -->
+<!NOTATION charsets
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Charsets//EN" >
+
+<!-- media type, as per [RFC2045] -->
+<!NOTATION contentType
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: ContentType//EN" >
+
+<!-- comma-separated list of media types, as per [RFC2045] -->
+<!NOTATION contentTypes
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: ContentTypes//EN" >
+
+<!-- date and time information. ISO date format -->
+<!NOTATION datetime
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Datetime//EN" >
+
+<!-- a language code, as per [RFC3066] -->
+<!NOTATION languageCode
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: LanguageCode//EN" >
+
+<!-- a Uniform Resource Identifier, see [URI] -->
+<!NOTATION uri
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: URI//EN" >
+
+<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
+<!NOTATION uris
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: URIs//EN" >
+
+<!-- end of xhtml-notations-1.mod -->
+]]>
+
+<!ENTITY % xhtml-datatypes.module "INCLUDE" >
+<![%xhtml-datatypes.module;[
+<!ENTITY % xhtml-datatypes.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
+            "../xhtml11/xhtml-datatypes-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Datatypes Module  .............................................. -->
+<!-- file: xhtml-datatypes-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-datatypes-1.mod,v 4.1 2001/04/06 19:23:32 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-datatypes-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Datatypes
+
+     defines containers for the following datatypes, many of
+     these imported from other specifications and standards.
+-->
+
+<!-- Length defined for cellpadding/cellspacing -->
+
+<!-- nn for pixels or nn% for percentage length -->
+<!ENTITY % Length.datatype "CDATA" >
+
+<!-- space-separated list of link types -->
+<!ENTITY % LinkTypes.datatype "NMTOKENS" >
+
+<!-- single or comma-separated list of media descriptors -->
+<!ENTITY % MediaDesc.datatype "CDATA" >
+
+<!-- pixel, percentage, or relative -->
+<!ENTITY % MultiLength.datatype "CDATA" >
+
+<!-- one or more digits (NUMBER) -->
+<!ENTITY % Number.datatype "CDATA" >
+
+<!-- integer representing length in pixels -->
+<!ENTITY % Pixels.datatype "CDATA" >
+
+<!-- script expression -->
+<!ENTITY % Script.datatype "CDATA" >
+
+<!-- textual content -->
+<!ENTITY % Text.datatype "CDATA" >
+
+<!-- Imported Datatypes ................................ -->
+
+<!-- a single character from [ISO10646] -->
+<!ENTITY % Character.datatype "CDATA" >
+
+<!-- a character encoding, as per [RFC2045] -->
+<!ENTITY % Charset.datatype "CDATA" >
+
+<!-- a space separated list of character encodings, as per [RFC2045] -->
+<!ENTITY % Charsets.datatype "CDATA" >
+
+<!-- Color specification using color name or sRGB (#RRGGBB) values -->
+<!ENTITY % Color.datatype "CDATA" >
+
+<!-- media type, as per [RFC2045] -->
+<!ENTITY % ContentType.datatype "CDATA" >
+
+<!-- comma-separated list of media types, as per [RFC2045] -->
+<!ENTITY % ContentTypes.datatype "CDATA" >
+
+<!-- date and time information. ISO date format -->
+<!ENTITY % Datetime.datatype "CDATA" >
+
+<!-- formal public identifier, as per [ISO8879] -->
+<!ENTITY % FPI.datatype "CDATA" >
+
+<!-- a language code, as per [RFC3066] -->
+<!ENTITY % LanguageCode.datatype "NMTOKEN" >
+
+<!-- a Uniform Resource Identifier, see [URI] -->
+<!ENTITY % URI.datatype "CDATA" >
+
+<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
+<!ENTITY % URIs.datatype "CDATA" >
+
+<!-- end of xhtml-datatypes-1.mod -->
+]]>
+
+<!-- placeholder for XLink support module -->
+<!ENTITY % xhtml-xlink.mod "" >
+
+
+<!ENTITY % xhtml-qname.module "INCLUDE" >
+<![%xhtml-qname.module;[
+<!ENTITY % xhtml-qname.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
+            "../xhtml11/xhtml-qname-1.mod" >
+<!-- ....................................................................... -->
+<!-- XHTML Qname Module  ................................................... -->
+<!-- file: xhtml-qname-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-qname-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-qname-1.mod"
+
+     Revisions:
+#2000-10-22: added qname declarations for ruby elements
+     ....................................................................... -->
+
+<!-- XHTML Qname (Qualified Name) Module
+
+     This module is contained in two parts, labeled Section 'A' and 'B':
+
+       Section A declares parameter entities to support namespace-
+       qualified names, namespace declarations, and name prefixing
+       for XHTML and extensions.
+
+       Section B declares parameter entities used to provide
+       namespace-qualified names for all XHTML element types:
+
+         %applet.qname;   the xmlns-qualified name for <applet>
+         %base.qname;     the xmlns-qualified name for <base>
+         ...
+
+     XHTML extensions would create a module similar to this one.
+     Included in the XHTML distribution is a template module
+     ('template-qname-1.mod') suitable for this purpose.
+-->
+
+<!-- Section A: XHTML XML Namespace Framework :::::::::::::::::::: -->
+
+<!-- 1. Declare a %XHTML.prefixed; conditional section keyword, used
+        to activate namespace prefixing. The default value should
+        inherit '%NS.prefixed;' from the DTD driver, so that unless
+        overridden, the default behaviour follows the overall DTD
+        prefixing scheme.
+-->
+<!ENTITY % NS.prefixed "IGNORE" >
+<!ENTITY % XHTML.prefixed "%NS.prefixed;" >
+
+<!-- 2. Declare a parameter entity (eg., %XHTML.xmlns;) containing
+        the URI reference used to identify the XHTML namespace:
+-->
+<!ENTITY % XHTML.xmlns  "http://www.w3.org/1999/xhtml" >
+
+<!-- 3. Declare parameter entities (eg., %XHTML.prefix;) containing
+        the default namespace prefix string(s) to use when prefixing
+        is enabled. This may be overridden in the DTD driver or the
+        internal subset of an document instance. If no default prefix
+        is desired, this may be declared as an empty string.
+
+     NOTE: As specified in [XMLNAMES], the namespace prefix serves
+     as a proxy for the URI reference, and is not in itself significant.
+-->
+<!ENTITY % XHTML.prefix  "" >
+
+<!-- 4. Declare parameter entities (eg., %XHTML.pfx;) containing the
+        colonized prefix(es) (eg., '%XHTML.prefix;:') used when
+        prefixing is active, an empty string when it is not.
+-->
+<![%XHTML.prefixed;[
+<!ENTITY % XHTML.pfx  "%XHTML.prefix;:" >
+]]>
+<!ENTITY % XHTML.pfx  "" >
+
+<!-- declare qualified name extensions here ............ -->
+<!ENTITY % xhtml-qname-extra.mod "" >
+
+
+<!-- 5. The parameter entity %XHTML.xmlns.extra.attrib; may be
+        redeclared to contain any non-XHTML namespace declaration
+        attributes for namespaces embedded in XHTML. The default
+        is an empty string.  XLink should be included here if used
+        in the DTD.
+-->
+<!ENTITY % XHTML.xmlns.extra.attrib "" >
+
+<!-- The remainder of Section A is only followed in XHTML, not extensions. -->
+
+<!-- Declare a parameter entity %NS.decl.attrib; containing
+     all XML Namespace declarations used in the DTD, plus the
+     xmlns declaration for XHTML, its form dependent on whether
+     prefixing is active.
+-->
+<![%XHTML.prefixed;[
+<!ENTITY % NS.decl.attrib
+     "xmlns:%XHTML.prefix;  %URI.datatype;   #FIXED '%XHTML.xmlns;'
+      %XHTML.xmlns.extra.attrib;"
+>
+]]>
+<!ENTITY % NS.decl.attrib
+     "%XHTML.xmlns.extra.attrib;"
+>
+
+<!-- This is a placeholder for future XLink support.
+-->
+<!ENTITY % XLINK.xmlns.attrib "" >
+
+<!-- Declare a parameter entity %NS.decl.attrib; containing all
+     XML namespace declaration attributes used by XHTML, including
+     a default xmlns attribute when prefixing is inactive.
+-->
+<![%XHTML.prefixed;[
+<!ENTITY % XHTML.xmlns.attrib
+     "%NS.decl.attrib;
+      %XLINK.xmlns.attrib;"
+>
+]]>
+<!ENTITY % XHTML.xmlns.attrib
+     "xmlns        %URI.datatype;           #FIXED '%XHTML.xmlns;'
+      %XLINK.xmlns.attrib;"
+>
+
+<!-- placeholder for qualified name redeclarations -->
+<!ENTITY % xhtml-qname.redecl "" >
+
+
+<!-- Section B: XHTML Qualified Names ::::::::::::::::::::::::::::: -->
+
+<!-- 6. This section declares parameter entities used to provide
+        namespace-qualified names for all XHTML element types.
+-->
+
+<!-- module:  xhtml-applet-1.mod -->
+<!ENTITY % applet.qname  "%XHTML.pfx;applet" >
+
+<!-- module:  xhtml-base-1.mod -->
+<!ENTITY % base.qname    "%XHTML.pfx;base" >
+
+<!-- module:  xhtml-bdo-1.mod -->
+<!ENTITY % bdo.qname     "%XHTML.pfx;bdo" >
+
+<!-- module:  xhtml-blkphras-1.mod -->
+<!ENTITY % address.qname "%XHTML.pfx;address" >
+<!ENTITY % blockquote.qname  "%XHTML.pfx;blockquote" >
+<!ENTITY % pre.qname     "%XHTML.pfx;pre" >
+<!ENTITY % h1.qname      "%XHTML.pfx;h1" >
+<!ENTITY % h2.qname      "%XHTML.pfx;h2" >
+<!ENTITY % h3.qname      "%XHTML.pfx;h3" >
+<!ENTITY % h4.qname      "%XHTML.pfx;h4" >
+<!ENTITY % h5.qname      "%XHTML.pfx;h5" >
+<!ENTITY % h6.qname      "%XHTML.pfx;h6" >
+
+<!-- module:  xhtml-blkpres-1.mod -->
+<!ENTITY % hr.qname      "%XHTML.pfx;hr" >
+
+<!-- module:  xhtml-blkstruct-1.mod -->
+<!ENTITY % div.qname     "%XHTML.pfx;div" >
+<!ENTITY % p.qname       "%XHTML.pfx;p" >
+
+<!-- module:  xhtml-edit-1.mod -->
+<!ENTITY % ins.qname     "%XHTML.pfx;ins" >
+<!ENTITY % del.qname     "%XHTML.pfx;del" >
+
+<!-- module:  xhtml-form-1.mod -->
+<!ENTITY % form.qname    "%XHTML.pfx;form" >
+<!ENTITY % label.qname   "%XHTML.pfx;label" >
+<!ENTITY % input.qname   "%XHTML.pfx;input" >
+<!ENTITY % select.qname  "%XHTML.pfx;select" >
+<!ENTITY % optgroup.qname  "%XHTML.pfx;optgroup" >
+<!ENTITY % option.qname  "%XHTML.pfx;option" >
+<!ENTITY % textarea.qname  "%XHTML.pfx;textarea" >
+<!ENTITY % fieldset.qname  "%XHTML.pfx;fieldset" >
+<!ENTITY % legend.qname  "%XHTML.pfx;legend" >
+<!ENTITY % button.qname  "%XHTML.pfx;button" >
+
+<!-- module:  xhtml-hypertext-1.mod -->
+<!ENTITY % a.qname       "%XHTML.pfx;a" >
+
+<!-- module:  xhtml-image-1.mod -->
+<!ENTITY % img.qname     "%XHTML.pfx;img" >
+
+<!-- module:  xhtml-inlphras-1.mod -->
+<!ENTITY % abbr.qname    "%XHTML.pfx;abbr" >
+<!ENTITY % acronym.qname "%XHTML.pfx;acronym" >
+<!ENTITY % cite.qname    "%XHTML.pfx;cite" >
+<!ENTITY % code.qname    "%XHTML.pfx;code" >
+<!ENTITY % dfn.qname     "%XHTML.pfx;dfn" >
+<!ENTITY % em.qname      "%XHTML.pfx;em" >
+<!ENTITY % kbd.qname     "%XHTML.pfx;kbd" >
+<!ENTITY % q.qname       "%XHTML.pfx;q" >
+<!ENTITY % samp.qname    "%XHTML.pfx;samp" >
+<!ENTITY % strong.qname  "%XHTML.pfx;strong" >
+<!ENTITY % var.qname     "%XHTML.pfx;var" >
+
+<!-- module:  xhtml-inlpres-1.mod -->
+<!ENTITY % b.qname       "%XHTML.pfx;b" >
+<!ENTITY % big.qname     "%XHTML.pfx;big" >
+<!ENTITY % i.qname       "%XHTML.pfx;i" >
+<!ENTITY % small.qname   "%XHTML.pfx;small" >
+<!ENTITY % sub.qname     "%XHTML.pfx;sub" >
+<!ENTITY % sup.qname     "%XHTML.pfx;sup" >
+<!ENTITY % tt.qname      "%XHTML.pfx;tt" >
+
+<!-- module:  xhtml-inlstruct-1.mod -->
+<!ENTITY % br.qname      "%XHTML.pfx;br" >
+<!ENTITY % span.qname    "%XHTML.pfx;span" >
+
+<!-- module:  xhtml-ismap-1.mod (also csismap, ssismap) -->
+<!ENTITY % map.qname     "%XHTML.pfx;map" >
+<!ENTITY % area.qname    "%XHTML.pfx;area" >
+
+<!-- module:  xhtml-link-1.mod -->
+<!ENTITY % link.qname    "%XHTML.pfx;link" >
+
+<!-- module:  xhtml-list-1.mod -->
+<!ENTITY % dl.qname      "%XHTML.pfx;dl" >
+<!ENTITY % dt.qname      "%XHTML.pfx;dt" >
+<!ENTITY % dd.qname      "%XHTML.pfx;dd" >
+<!ENTITY % ol.qname      "%XHTML.pfx;ol" >
+<!ENTITY % ul.qname      "%XHTML.pfx;ul" >
+<!ENTITY % li.qname      "%XHTML.pfx;li" >
+
+<!-- module:  xhtml-meta-1.mod -->
+<!ENTITY % meta.qname    "%XHTML.pfx;meta" >
+
+<!-- module:  xhtml-param-1.mod -->
+<!ENTITY % param.qname   "%XHTML.pfx;param" >
+
+<!-- module:  xhtml-object-1.mod -->
+<!ENTITY % object.qname  "%XHTML.pfx;object" >
+
+<!-- module:  xhtml-script-1.mod -->
+<!ENTITY % script.qname  "%XHTML.pfx;script" >
+<!ENTITY % noscript.qname  "%XHTML.pfx;noscript" >
+
+<!-- module:  xhtml-struct-1.mod -->
+<!ENTITY % html.qname    "%XHTML.pfx;html" >
+<!ENTITY % head.qname    "%XHTML.pfx;head" >
+<!ENTITY % title.qname   "%XHTML.pfx;title" >
+<!ENTITY % body.qname    "%XHTML.pfx;body" >
+
+<!-- module:  xhtml-style-1.mod -->
+<!ENTITY % style.qname   "%XHTML.pfx;style" >
+
+<!-- module:  xhtml-table-1.mod -->
+<!ENTITY % table.qname   "%XHTML.pfx;table" >
+<!ENTITY % caption.qname "%XHTML.pfx;caption" >
+<!ENTITY % thead.qname   "%XHTML.pfx;thead" >
+<!ENTITY % tfoot.qname   "%XHTML.pfx;tfoot" >
+<!ENTITY % tbody.qname   "%XHTML.pfx;tbody" >
+<!ENTITY % colgroup.qname  "%XHTML.pfx;colgroup" >
+<!ENTITY % col.qname     "%XHTML.pfx;col" >
+<!ENTITY % tr.qname      "%XHTML.pfx;tr" >
+<!ENTITY % th.qname      "%XHTML.pfx;th" >
+<!ENTITY % td.qname      "%XHTML.pfx;td" >
+
+<!-- module:  xhtml-ruby-1.mod -->
+
+<!ENTITY % ruby.qname    "%XHTML.pfx;ruby" >
+<!ENTITY % rbc.qname     "%XHTML.pfx;rbc" >
+<!ENTITY % rtc.qname     "%XHTML.pfx;rtc" >
+<!ENTITY % rb.qname      "%XHTML.pfx;rb" >
+<!ENTITY % rt.qname      "%XHTML.pfx;rt" >
+<!ENTITY % rp.qname      "%XHTML.pfx;rp" >
+
+<!-- Provisional XHTML 2.0 Qualified Names  ...................... -->
+
+<!-- module:  xhtml-image-2.mod -->
+<!ENTITY % alt.qname     "%XHTML.pfx;alt" >
+
+<!-- end of xhtml-qname-1.mod -->
+]]>
+
+<!ENTITY % xhtml-events.module "IGNORE" >
+<![%xhtml-events.module;[
+<!ENTITY % xhtml-events.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN"
+            "xhtml-events-1.mod" >
+%xhtml-events.mod;]]>
+
+<!ENTITY % xhtml-attribs.module "INCLUDE" >
+<![%xhtml-attribs.module;[
+<!ENTITY % xhtml-attribs.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
+            "../xhtml11/xhtml-attribs-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Common Attributes Module  ...................................... -->
+<!-- file: xhtml-attribs-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-attribs-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-attribs-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Common Attributes
+
+     This module declares many of the common attributes for the XHTML DTD.
+     %NS.decl.attrib; is declared in the XHTML Qname module.
+-->
+
+<!ENTITY % id.attrib
+     "id           ID                       #IMPLIED"
+>
+
+<!ENTITY % class.attrib
+     "class        NMTOKENS                 #IMPLIED"
+>
+
+<!ENTITY % title.attrib
+     "title        %Text.datatype;          #IMPLIED"
+>
+
+<!ENTITY % Core.extra.attrib "" >
+
+<!ENTITY % Core.attrib
+     "%XHTML.xmlns.attrib;
+      %id.attrib;
+      %class.attrib;
+      %title.attrib;
+      %Core.extra.attrib;"
+>
+
+<!ENTITY % lang.attrib
+     "xml:lang     %LanguageCode.datatype;  #IMPLIED"
+>
+
+<![%XHTML.bidi;[
+<!ENTITY % dir.attrib
+     "dir          ( ltr | rtl )            #IMPLIED"
+>
+
+<!ENTITY % I18n.attrib
+     "%dir.attrib;
+      %lang.attrib;"
+>
+
+]]>
+<!ENTITY % I18n.attrib
+     "%lang.attrib;"
+>
+
+<!ENTITY % Common.extra.attrib "" >
+
+<!-- intrinsic event attributes declared previously
+-->
+<!ENTITY % Events.attrib "" >
+
+<!ENTITY % Common.attrib
+     "%Core.attrib;
+      %I18n.attrib;
+      %Events.attrib;
+      %Common.extra.attrib;"
+>
+
+<!-- end of xhtml-attribs-1.mod -->
+]]>
+
+<!-- placeholder for content model redeclarations -->
+<!ENTITY % xhtml-model.redecl "" >
+
+
+<!ENTITY % xhtml-model.module "INCLUDE" >
+<![%xhtml-model.module;[
+<!-- instantiate the Document Model module declared in the DTD driver
+-->
+<!-- ....................................................................... -->
+<!-- XHTML Mobile 1.0 Document Model Module
+.................................... -->
+<!-- file: xhtml-mobile10-model-1.mod
+
+     This is XHTML Mobile, a proper subset of XHTML.
+     	@Wireless Application Protocol Forum, Ltd. 2001.
+
+	Terms and conditions of use are available from the Wireless
+	Application Protocol Forum Ltd.
+	Web site (http://www.wapforum.org/what/copyright.htm).
+
+-->
+<!-- XHTML Mobile Document Model
+
+     This module describes the groupings of elements that make up
+     common content models for XHTML elements.
+-->
+
+<!-- Optional Elements in head  .............. -->
+
+<!ENTITY % HeadOpts.mix
+
+     "( %meta.qname; | %link.qname; | %object.qname; | %style.qname;
+     )*" >
+
+<!-- Miscellaneous Elements  ................. -->
+
+<!ENTITY % Misc.class "" >
+
+<!-- Inline Elements  ........................ -->
+
+<!ENTITY % InlStruct.class "%br.qname; | %span.qname;" >
+
+<!ENTITY % InlPhras.class
+     "| %em.qname; | %strong.qname; | %dfn.qname; | %code.qname;
+      | %samp.qname; | %kbd.qname; | %var.qname; | %cite.qname;
+      | %abbr.qname; | %acronym.qname; | %q.qname;" >
+
+<!ENTITY % InlPres.class
+     "| %i.qname; | %b.qname; | %big.qname; | %small.qname; " >
+
+
+<!ENTITY % I18n.class "" >
+
+<!ENTITY % Anchor.class "| %a.qname;" >
+
+<!ENTITY % InlSpecial.class "| %img.qname; | %object.qname;" >
+
+<!ENTITY % InlForm.class
+     "| %input.qname; | %select.qname; | %textarea.qname;
+      | %label.qname;"
+>
+
+<!ENTITY % Inline.extra "" >
+
+<!ENTITY % Inline.class
+     "%InlStruct.class;
+      %InlPhras.class;
+      %InlPres.class;
+      %Anchor.class;
+      %InlSpecial.class;
+      %InlForm.class;
+      %Inline.extra;"
+>
+
+<!ENTITY % InlNoAnchor.class
+     "%InlStruct.class;
+      %InlPhras.class;
+      %InlPres.class;
+      %InlSpecial.class;
+      %InlForm.class;
+      %Inline.extra;"
+>
+
+<!ENTITY % InlNoAnchor.mix
+     "%InlNoAnchor.class;
+      %Misc.class;"
+>
+
+<!ENTITY % Inline.mix
+     "%Inline.class;
+      %Misc.class;"
+>
+
+<!-- Block Elements  ......................... -->
+
+<!ENTITY % Heading.class
+     "%h1.qname; | %h2.qname; | %h3.qname;
+      | %h4.qname; | %h5.qname; | %h6.qname;"
+>
+<!ENTITY % List.class  "%ul.qname; | %ol.qname; | %dl.qname;" >
+
+<!ENTITY % Table.class "| %table.qname;" >
+
+<!ENTITY % Form.class  "| %form.qname;" >
+
+<!ENTITY % Fieldset.class  "| %fieldset.qname;" >
+
+<!ENTITY % BlkStruct.class "%p.qname; | %div.qname;" >
+
+<!ENTITY % BlkPhras.class
+     "| %pre.qname; | %blockquote.qname; | %address.qname;"
+>
+
+<!ENTITY % BlkPres.class "| %hr.qname;" >
+
+<!ENTITY % BlkSpecial.class
+     "%Table.class;
+      %Form.class;
+      %Fieldset.class;"
+>
+
+<!ENTITY % Block.extra "" >
+
+<!ENTITY % Block.class
+     "%BlkStruct.class;
+      %BlkPhras.class;
+      %BlkPres.class;
+      %BlkSpecial.class;
+      %Block.extra;"
+>
+
+<!ENTITY % BlkNoForm.mix
+     "%Heading.class;
+      | %List.class;
+      | %BlkStruct.class;
+      %BlkPhras.class;
+      %BlkPres.class;
+      %Table.class;
+      %Block.extra;
+      %Misc.class;"
+>
+
+<!ENTITY % Block.mix
+     "%Heading.class;
+      | %List.class;
+      | %Block.class;
+      %Misc.class;"
+>
+
+<!-- All Content Elements  ................... -->
+
+<!-- declares all content except tables
+-->
+<!ENTITY % FlowNoTable.mix
+     "%Heading.class;
+      | %List.class;
+      | %BlkStruct.class;
+      %BlkPhras.class;
+      %Form.class;
+      %Block.extra;
+      | %Inline.class;
+      %Misc.class;"
+>
+
+
+<!ENTITY % Flow.mix
+     "%Heading.class;
+      | %List.class;
+      | %Block.class;
+      | %Inline.class;
+      %Misc.class;"
+>
+
+<!-- end of xhtml-mobile10-model-1.mod -->
+
+]]>
+
+<!ENTITY % xhtml-charent.module "INCLUDE" >
+<![%xhtml-charent.module;[
+<!ENTITY % xhtml-charent.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
+            "../xhtml11/xhtml-charent-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Character Entities Module  ......................................... -->
+<!-- file: xhtml-charent-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-charent-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-charent-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Character Entities for XHTML
+
+     This module declares the set of character entities for XHTML,
+     including the Latin 1, Symbol and Special character collections.
+-->
+
+<!ENTITY % xhtml-lat1
+    PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+           "../xhtml11/xhtml-lat1.ent" >
+<!-- ...................................................................... -->
+<!-- XML-compatible ISO Latin 1 Character Entity Set for XHTML ............ -->
+<!-- file: xhtml-lat1.ent
+
+     Typical invocation:
+
+       <!ENTITY % xhtml-lat1
+           PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+                  "xhtml-lat1.ent" >
+       %xhtml-lat1;
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+       SYSTEM "../xhtml11/xhtml-lat1.ent"
+
+     Revision:  $Id: xhtml-lat1.ent,v 4.1 2001/04/10 09:34:14 altheim Exp $ SMI
+
+     Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with conforming
+     SGML systems and applications as defined in ISO 8879, provided
+     this notice is included in all copies.
+-->
+
+<!ENTITY nbsp   "&#160;" ><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
+<!ENTITY iexcl  "&#161;" ><!-- inverted exclamation mark, U+00A1 ISOnum -->
+<!ENTITY cent   "&#162;" ><!-- cent sign, U+00A2 ISOnum -->
+<!ENTITY pound  "&#163;" ><!-- pound sign, U+00A3 ISOnum -->
+<!ENTITY curren "&#164;" ><!-- currency sign, U+00A4 ISOnum -->
+<!ENTITY yen    "&#165;" ><!-- yen sign = yuan sign, U+00A5 ISOnum -->
+<!ENTITY brvbar "&#166;" ><!-- broken bar = broken vertical bar, U+00A6 ISOnum -->
+<!ENTITY sect   "&#167;" ><!-- section sign, U+00A7 ISOnum -->
+<!ENTITY uml    "&#168;" ><!-- diaeresis = spacing diaeresis, U+00A8 ISOdia -->
+<!ENTITY copy   "&#169;" ><!-- copyright sign, U+00A9 ISOnum -->
+<!ENTITY ordf   "&#170;" ><!-- feminine ordinal indicator, U+00AA ISOnum -->
+<!ENTITY laquo  "&#171;" ><!-- left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum -->
+<!ENTITY not    "&#172;" ><!-- not sign, U+00AC ISOnum -->
+<!ENTITY shy    "&#173;" ><!-- soft hyphen = discretionary hyphen, U+00AD ISOnum -->
+<!ENTITY reg    "&#174;" ><!-- registered sign = registered trade mark sign, U+00AE ISOnum -->
+<!ENTITY macr   "&#175;" ><!-- macron = spacing macron = overline = APL overbar, U+00AF ISOdia -->
+<!ENTITY deg    "&#176;" ><!-- degree sign, U+00B0 ISOnum -->
+<!ENTITY plusmn "&#177;" ><!-- plus-minus sign = plus-or-minus sign, U+00B1 ISOnum -->
+<!ENTITY sup2   "&#178;" ><!-- superscript two = superscript digit two = squared, U+00B2 ISOnum -->
+<!ENTITY sup3   "&#179;" ><!-- superscript three = superscript digit three = cubed, U+00B3 ISOnum -->
+<!ENTITY acute  "&#180;" ><!-- acute accent = spacing acute, U+00B4 ISOdia -->
+<!ENTITY micro  "&#181;" ><!-- micro sign, U+00B5 ISOnum -->
+<!ENTITY para   "&#182;" ><!-- pilcrow sign = paragraph sign, U+00B6 ISOnum -->
+<!ENTITY middot "&#183;" ><!-- middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum -->
+<!ENTITY cedil  "&#184;" ><!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
+<!ENTITY sup1   "&#185;" ><!-- superscript one = superscript digit one, U+00B9 ISOnum -->
+<!ENTITY ordm   "&#186;" ><!-- masculine ordinal indicator, U+00BA ISOnum -->
+<!ENTITY raquo  "&#187;" ><!-- right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum -->
+<!ENTITY frac14 "&#188;" ><!-- vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum -->
+<!ENTITY frac12 "&#189;" ><!-- vulgar fraction one half = fraction one half, U+00BD ISOnum -->
+<!ENTITY frac34 "&#190;" ><!-- vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum -->
+<!ENTITY iquest "&#191;" ><!-- inverted question mark = turned question mark, U+00BF ISOnum -->
+<!ENTITY Agrave "&#192;" ><!-- latin capital A with grave = latin capital A grave, U+00C0 ISOlat1 -->
+<!ENTITY Aacute "&#193;" ><!-- latin capital A with acute, U+00C1 ISOlat1 -->
+<!ENTITY Acirc  "&#194;" ><!-- latin capital A with circumflex, U+00C2 ISOlat1 -->
+<!ENTITY Atilde "&#195;" ><!-- latin capital A with tilde, U+00C3 ISOlat1 -->
+<!ENTITY Auml   "&#196;" ><!-- latin capital A with diaeresis, U+00C4 ISOlat1 -->
+<!ENTITY Aring  "&#197;" ><!-- latin capital A with ring above = latin capital A ring, U+00C5 ISOlat1 -->
+<!ENTITY AElig  "&#198;" ><!-- latin capital AE = latin capital ligature AE, U+00C6 ISOlat1 -->
+<!ENTITY Ccedil "&#199;" ><!-- latin capital C with cedilla, U+00C7 ISOlat1 -->
+<!ENTITY Egrave "&#200;" ><!-- latin capital E with grave, U+00C8 ISOlat1 -->
+<!ENTITY Eacute "&#201;" ><!-- latin capital E with acute, U+00C9 ISOlat1 -->
+<!ENTITY Ecirc  "&#202;" ><!-- latin capital E with circumflex, U+00CA ISOlat1 -->
+<!ENTITY Euml   "&#203;" ><!-- latin capital E with diaeresis, U+00CB ISOlat1 -->
+<!ENTITY Igrave "&#204;" ><!-- latin capital I with grave, U+00CC ISOlat1 -->
+<!ENTITY Iacute "&#205;" ><!-- latin capital I with acute, U+00CD ISOlat1 -->
+<!ENTITY Icirc  "&#206;" ><!-- latin capital I with circumflex, U+00CE ISOlat1 -->
+<!ENTITY Iuml   "&#207;" ><!-- latin capital I with diaeresis, U+00CF ISOlat1 -->
+<!ENTITY ETH    "&#208;" ><!-- latin capital ETH, U+00D0 ISOlat1 -->
+<!ENTITY Ntilde "&#209;" ><!-- latin capital N with tilde, U+00D1 ISOlat1 -->
+<!ENTITY Ograve "&#210;" ><!-- latin capital O with grave, U+00D2 ISOlat1 -->
+<!ENTITY Oacute "&#211;" ><!-- latin capital O with acute, U+00D3 ISOlat1 -->
+<!ENTITY Ocirc  "&#212;" ><!-- latin capital O with circumflex, U+00D4 ISOlat1 -->
+<!ENTITY Otilde "&#213;" ><!-- latin capital O with tilde, U+00D5 ISOlat1 -->
+<!ENTITY Ouml   "&#214;" ><!-- latin capital O with diaeresis, U+00D6 ISOlat1 -->
+<!ENTITY times  "&#215;" ><!-- multiplication sign, U+00D7 ISOnum -->
+<!ENTITY Oslash "&#216;" ><!-- latin capital O with stroke = latin capital O slash, U+00D8 ISOlat1 -->
+<!ENTITY Ugrave "&#217;" ><!-- latin capital U with grave, U+00D9 ISOlat1 -->
+<!ENTITY Uacute "&#218;" ><!-- latin capital U with acute, U+00DA ISOlat1 -->
+<!ENTITY Ucirc  "&#219;" ><!-- latin capital U with circumflex, U+00DB ISOlat1 -->
+<!ENTITY Uuml   "&#220;" ><!-- latin capital U with diaeresis, U+00DC ISOlat1 -->
+<!ENTITY Yacute "&#221;" ><!-- latin capital Y with acute, U+00DD ISOlat1 -->
+<!ENTITY THORN  "&#222;" ><!-- latin capital THORN, U+00DE ISOlat1 -->
+<!ENTITY szlig  "&#223;" ><!-- latin small sharp s = ess-zed, U+00DF ISOlat1 -->
+<!ENTITY agrave "&#224;" ><!-- latin small a with grave = latin small a grave, U+00E0 ISOlat1 -->
+<!ENTITY aacute "&#225;" ><!-- latin small a with acute, U+00E1 ISOlat1 -->
+<!ENTITY acirc  "&#226;" ><!-- latin small a with circumflex, U+00E2 ISOlat1 -->
+<!ENTITY atilde "&#227;" ><!-- latin small a with tilde, U+00E3 ISOlat1 -->
+<!ENTITY auml   "&#228;" ><!-- latin small a with diaeresis, U+00E4 ISOlat1 -->
+<!ENTITY aring  "&#229;" ><!-- latin small a with ring above = latin small a ring, U+00E5 ISOlat1 -->
+<!ENTITY aelig  "&#230;" ><!-- latin small ae = latin small ligature ae, U+00E6 ISOlat1 -->
+<!ENTITY ccedil "&#231;" ><!-- latin small c with cedilla, U+00E7 ISOlat1 -->
+<!ENTITY egrave "&#232;" ><!-- latin small e with grave, U+00E8 ISOlat1 -->
+<!ENTITY eacute "&#233;" ><!-- latin small e with acute, U+00E9 ISOlat1 -->
+<!ENTITY ecirc  "&#234;" ><!-- latin small e with circumflex, U+00EA ISOlat1 -->
+<!ENTITY euml   "&#235;" ><!-- latin small e with diaeresis, U+00EB ISOlat1 -->
+<!ENTITY igrave "&#236;" ><!-- latin small i with grave, U+00EC ISOlat1 -->
+<!ENTITY iacute "&#237;" ><!-- latin small i with acute, U+00ED ISOlat1 -->
+<!ENTITY icirc  "&#238;" ><!-- latin small i with circumflex, U+00EE ISOlat1 -->
+<!ENTITY iuml   "&#239;" ><!-- latin small i with diaeresis, U+00EF ISOlat1 -->
+<!ENTITY eth    "&#240;" ><!-- latin small eth, U+00F0 ISOlat1 -->
+<!ENTITY ntilde "&#241;" ><!-- latin small n with tilde, U+00F1 ISOlat1 -->
+<!ENTITY ograve "&#242;" ><!-- latin small o with grave, U+00F2 ISOlat1 -->
+<!ENTITY oacute "&#243;" ><!-- latin small o with acute, U+00F3 ISOlat1 -->
+<!ENTITY ocirc  "&#244;" ><!-- latin small o with circumflex, U+00F4 ISOlat1 -->
+<!ENTITY otilde "&#245;" ><!-- latin small o with tilde, U+00F5 ISOlat1 -->
+<!ENTITY ouml   "&#246;" ><!-- latin small o with diaeresis, U+00F6 ISOlat1 -->
+<!ENTITY divide "&#247;" ><!-- division sign, U+00F7 ISOnum -->
+<!ENTITY oslash "&#248;" ><!-- latin small o with stroke, = latin small o slash, U+00F8 ISOlat1 -->
+<!ENTITY ugrave "&#249;" ><!-- latin small u with grave, U+00F9 ISOlat1 -->
+<!ENTITY uacute "&#250;" ><!-- latin small u with acute, U+00FA ISOlat1 -->
+<!ENTITY ucirc  "&#251;" ><!-- latin small u with circumflex, U+00FB ISOlat1 -->
+<!ENTITY uuml   "&#252;" ><!-- latin small u with diaeresis, U+00FC ISOlat1 -->
+<!ENTITY yacute "&#253;" ><!-- latin small y with acute, U+00FD ISOlat1 -->
+<!ENTITY thorn  "&#254;" ><!-- latin small thorn with, U+00FE ISOlat1 -->
+<!ENTITY yuml   "&#255;" ><!-- latin small y with diaeresis, U+00FF ISOlat1 -->
+<!-- end of xhtml-lat1.ent -->
+
+
+<!ENTITY % xhtml-symbol
+    PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+           "../xhtml11/xhtml-symbol.ent" >
+<!-- ...................................................................... -->
+<!-- ISO Math, Greek and Symbolic Character Entity Set for XHTML .......... -->
+<!-- file: xhtml-symbol.ent
+
+     Typical invocation:
+
+       <!ENTITY % xhtml-symbol
+           PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+                  "xhtml-symbol.ent" >
+       %xhtml-symbol;
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+       SYSTEM "../xhtml11/xhtml-symbol.ent"
+
+     Revision:  $Id: xhtml-symbol.ent,v 4.1 2001/04/10 09:34:14 altheim Exp $ SMI
+
+     Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with conforming
+     SGML systems and applications as defined in ISO 8879, provided
+     this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+     New names (i.e., not in ISO 8879 [SGML] list) do not clash with
+     any existing ISO 8879 entity names. ISO 10646 [ISO10646] character
+     numbers are given for each character, in hex. Entity values are
+     decimal conversions of the ISO 10646 values and refer to the
+     document character set. Names are Unicode [UNICODE] names.
+-->
+
+<!-- Latin Extended-B -->
+<!ENTITY fnof     "&#402;" ><!-- latin small f with hook = function
+                              = florin, U+0192 ISOtech -->
+
+<!-- Greek -->
+<!ENTITY Alpha    "&#913;" ><!-- greek capital letter alpha, U+0391 -->
+<!ENTITY Beta     "&#914;" ><!-- greek capital letter beta, U+0392 -->
+<!ENTITY Gamma    "&#915;" ><!-- greek capital letter gamma, U+0393 ISOgrk3 -->
+<!ENTITY Delta    "&#916;" ><!-- greek capital letter delta, U+0394 ISOgrk3 -->
+<!ENTITY Epsilon  "&#917;" ><!-- greek capital letter epsilon, U+0395 -->
+<!ENTITY Zeta     "&#918;" ><!-- greek capital letter zeta, U+0396 -->
+<!ENTITY Eta      "&#919;" ><!-- greek capital letter eta, U+0397 -->
+<!ENTITY Theta    "&#920;" ><!-- greek capital letter theta, U+0398 ISOgrk3 -->
+<!ENTITY Iota     "&#921;" ><!-- greek capital letter iota, U+0399 -->
+<!ENTITY Kappa    "&#922;" ><!-- greek capital letter kappa, U+039A -->
+<!ENTITY Lambda   "&#923;" ><!-- greek capital letter lambda, U+039B ISOgrk3 -->
+<!ENTITY Mu       "&#924;" ><!-- greek capital letter mu, U+039C -->
+<!ENTITY Nu       "&#925;" ><!-- greek capital letter nu, U+039D -->
+<!ENTITY Xi       "&#926;" ><!-- greek capital letter xi, U+039E ISOgrk3 -->
+<!ENTITY Omicron  "&#927;" ><!-- greek capital letter omicron, U+039F -->
+<!ENTITY Pi       "&#928;" ><!-- greek capital letter pi, U+03A0 ISOgrk3 -->
+<!ENTITY Rho      "&#929;" ><!-- greek capital letter rho, U+03A1 -->
+<!-- there is no Sigmaf, and no U+03A2 character either -->
+<!ENTITY Sigma    "&#931;" ><!-- greek capital letter sigma, U+03A3 ISOgrk3 -->
+<!ENTITY Tau      "&#932;" ><!-- greek capital letter tau, U+03A4 -->
+<!ENTITY Upsilon  "&#933;" ><!-- greek capital letter upsilon,
+                              U+03A5 ISOgrk3 -->
+<!ENTITY Phi      "&#934;" ><!-- greek capital letter phi, U+03A6 ISOgrk3 -->
+<!ENTITY Chi      "&#935;" ><!-- greek capital letter chi, U+03A7 -->
+<!ENTITY Psi      "&#936;" ><!-- greek capital letter psi, U+03A8 ISOgrk3 -->
+<!ENTITY Omega    "&#937;" ><!-- greek capital letter omega, U+03A9 ISOgrk3 -->
+<!ENTITY alpha    "&#945;" ><!-- greek small letter alpha, U+03B1 ISOgrk3 -->
+<!ENTITY beta     "&#946;" ><!-- greek small letter beta, U+03B2 ISOgrk3 -->
+<!ENTITY gamma    "&#947;" ><!-- greek small letter gamma, U+03B3 ISOgrk3 -->
+<!ENTITY delta    "&#948;" ><!-- greek small letter delta, U+03B4 ISOgrk3 -->
+<!ENTITY epsilon  "&#949;" ><!-- greek small letter epsilon, U+03B5 ISOgrk3 -->
+<!ENTITY zeta     "&#950;" ><!-- greek small letter zeta, U+03B6 ISOgrk3 -->
+<!ENTITY eta      "&#951;" ><!-- greek small letter eta, U+03B7 ISOgrk3 -->
+<!ENTITY theta    "&#952;" ><!-- greek small letter theta, U+03B8 ISOgrk3 -->
+<!ENTITY iota     "&#953;" ><!-- greek small letter iota, U+03B9 ISOgrk3 -->
+<!ENTITY kappa    "&#954;" ><!-- greek small letter kappa, U+03BA ISOgrk3 -->
+<!ENTITY lambda   "&#955;" ><!-- greek small letter lambda, U+03BB ISOgrk3 -->
+<!ENTITY mu       "&#956;" ><!-- greek small letter mu, U+03BC ISOgrk3 -->
+<!ENTITY nu       "&#957;" ><!-- greek small letter nu, U+03BD ISOgrk3 -->
+<!ENTITY xi       "&#958;" ><!-- greek small letter xi, U+03BE ISOgrk3 -->
+<!ENTITY omicron  "&#959;" ><!-- greek small letter omicron, U+03BF NEW -->
+<!ENTITY pi       "&#960;" ><!-- greek small letter pi, U+03C0 ISOgrk3 -->
+<!ENTITY rho      "&#961;" ><!-- greek small letter rho, U+03C1 ISOgrk3 -->
+<!ENTITY sigmaf   "&#962;" ><!-- greek small letter final sigma, U+03C2 ISOgrk3 -->
+<!ENTITY sigma    "&#963;" ><!-- greek small letter sigma, U+03C3 ISOgrk3 -->
+<!ENTITY tau      "&#964;" ><!-- greek small letter tau, U+03C4 ISOgrk3 -->
+<!ENTITY upsilon  "&#965;" ><!-- greek small letter upsilon, U+03C5 ISOgrk3 -->
+<!ENTITY phi      "&#966;" ><!-- greek small letter phi, U+03C6 ISOgrk3 -->
+<!ENTITY chi      "&#967;" ><!-- greek small letter chi, U+03C7 ISOgrk3 -->
+<!ENTITY psi      "&#968;" ><!-- greek small letter psi, U+03C8 ISOgrk3 -->
+<!ENTITY omega    "&#969;" ><!-- greek small letter omega, U+03C9 ISOgrk3 -->
+<!ENTITY thetasym "&#977;" ><!-- greek small letter theta symbol, U+03D1 NEW -->
+<!ENTITY upsih    "&#978;" ><!-- greek upsilon with hook symbol, U+03D2 NEW -->
+<!ENTITY piv      "&#982;" ><!-- greek pi symbol, U+03D6 ISOgrk3 -->
+
+<!-- General Punctuation -->
+<!ENTITY bull     "&#8226;" ><!-- bullet = black small circle, U+2022 ISOpub  -->
+<!-- bullet is NOT the same as bullet operator, U+2219 -->
+<!ENTITY hellip   "&#8230;" ><!-- horizontal ellipsis = three dot leader, U+2026 ISOpub  -->
+<!ENTITY prime    "&#8242;" ><!-- prime = minutes = feet, U+2032 ISOtech -->
+<!ENTITY Prime    "&#8243;" ><!-- double prime = seconds = inches, U+2033 ISOtech -->
+<!ENTITY oline    "&#8254;" ><!-- overline = spacing overscore, U+203E NEW -->
+<!ENTITY frasl    "&#8260;" ><!-- fraction slash, U+2044 NEW -->
+
+<!-- Letterlike Symbols -->
+<!ENTITY weierp   "&#8472;" ><!-- script capital P = power set = Weierstrass p, U+2118 ISOamso -->
+<!ENTITY image    "&#8465;" ><!-- blackletter capital I = imaginary part, U+2111 ISOamso -->
+<!ENTITY real     "&#8476;" ><!-- blackletter capital R = real part symbol, U+211C ISOamso -->
+<!ENTITY trade    "&#8482;" ><!-- trade mark sign, U+2122 ISOnum -->
+<!ENTITY alefsym  "&#8501;" ><!-- alef symbol = first transfinite cardinal, U+2135 NEW -->
+<!-- alef symbol is NOT the same as hebrew letter alef, U+05D0 although
+     the same glyph could be used to depict both characters -->
+
+<!-- Arrows -->
+<!ENTITY larr     "&#8592;" ><!-- leftwards arrow, U+2190 ISOnum -->
+<!ENTITY uarr     "&#8593;" ><!-- upwards arrow, U+2191 ISOnum-->
+<!ENTITY rarr     "&#8594;" ><!-- rightwards arrow, U+2192 ISOnum -->
+<!ENTITY darr     "&#8595;" ><!-- downwards arrow, U+2193 ISOnum -->
+<!ENTITY harr     "&#8596;" ><!-- left right arrow, U+2194 ISOamsa -->
+<!ENTITY crarr    "&#8629;" ><!-- downwards arrow with corner leftwards
+                               = carriage return, U+21B5 NEW -->
+<!ENTITY lArr     "&#8656;" ><!-- leftwards double arrow, U+21D0 ISOtech -->
+<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow
+    but also does not have any other character for that function. So ? lArr can
+    be used for 'is implied by' as ISOtech suggests -->
+<!ENTITY uArr     "&#8657;" ><!-- upwards double arrow, U+21D1 ISOamsa -->
+<!ENTITY rArr     "&#8658;" ><!-- rightwards double arrow, U+21D2 ISOtech -->
+<!-- Unicode does not say this is the 'implies' character but does not have
+     another character with this function so ?
+     rArr can be used for 'implies' as ISOtech suggests -->
+<!ENTITY dArr     "&#8659;" ><!-- downwards double arrow, U+21D3 ISOamsa -->
+<!ENTITY hArr     "&#8660;" ><!-- left right double arrow, U+21D4 ISOamsa -->
+
+<!-- Mathematical Operators -->
+<!ENTITY forall   "&#8704;" ><!-- for all, U+2200 ISOtech -->
+<!ENTITY part     "&#8706;" ><!-- partial differential, U+2202 ISOtech  -->
+<!ENTITY exist    "&#8707;" ><!-- there exists, U+2203 ISOtech -->
+<!ENTITY empty    "&#8709;" ><!-- empty set = null set = diameter, U+2205 ISOamso -->
+<!ENTITY nabla    "&#8711;" ><!-- nabla = backward difference, U+2207 ISOtech -->
+<!ENTITY isin     "&#8712;" ><!-- element of, U+2208 ISOtech -->
+<!ENTITY notin    "&#8713;" ><!-- not an element of, U+2209 ISOtech -->
+<!ENTITY ni       "&#8715;" ><!-- contains as member, U+220B ISOtech -->
+<!-- should there be a more memorable name than 'ni'? -->
+<!ENTITY prod     "&#8719;" ><!-- n-ary product = product sign, U+220F ISOamsb -->
+<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
+     the same glyph might be used for both -->
+<!ENTITY sum      "&#8721;" ><!-- n-ary sumation, U+2211 ISOamsb -->
+<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
+     though the same glyph might be used for both -->
+<!ENTITY minus    "&#8722;" ><!-- minus sign, U+2212 ISOtech -->
+<!ENTITY lowast   "&#8727;" ><!-- asterisk operator, U+2217 ISOtech -->
+<!ENTITY radic    "&#8730;" ><!-- square root = radical sign, U+221A ISOtech -->
+<!ENTITY prop     "&#8733;" ><!-- proportional to, U+221D ISOtech -->
+<!ENTITY infin    "&#8734;" ><!-- infinity, U+221E ISOtech -->
+<!ENTITY ang      "&#8736;" ><!-- angle, U+2220 ISOamso -->
+<!ENTITY and      "&#8743;" ><!-- logical and = wedge, U+2227 ISOtech -->
+<!ENTITY or       "&#8744;" ><!-- logical or = vee, U+2228 ISOtech -->
+<!ENTITY cap      "&#8745;" ><!-- intersection = cap, U+2229 ISOtech -->
+<!ENTITY cup      "&#8746;" ><!-- union = cup, U+222A ISOtech -->
+<!ENTITY int      "&#8747;" ><!-- integral, U+222B ISOtech -->
+<!ENTITY there4   "&#8756;" ><!-- therefore, U+2234 ISOtech -->
+<!ENTITY sim      "&#8764;" ><!-- tilde operator = varies with = similar to, U+223C ISOtech -->
+<!-- tilde operator is NOT the same character as the tilde, U+007E,
+     although the same glyph might be used to represent both  -->
+<!ENTITY cong     "&#8773;" ><!-- approximately equal to, U+2245 ISOtech -->
+<!ENTITY asymp    "&#8776;" ><!-- almost equal to = asymptotic to, U+2248 ISOamsr -->
+<!ENTITY ne       "&#8800;" ><!-- not equal to, U+2260 ISOtech -->
+<!ENTITY equiv    "&#8801;" ><!-- identical to, U+2261 ISOtech -->
+<!ENTITY le       "&#8804;" ><!-- less-than or equal to, U+2264 ISOtech -->
+<!ENTITY ge       "&#8805;" ><!-- greater-than or equal to, U+2265 ISOtech -->
+<!ENTITY sub      "&#8834;" ><!-- subset of, U+2282 ISOtech -->
+<!ENTITY sup      "&#8835;" ><!-- superset of, U+2283 ISOtech -->
+<!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol
+     font encoding and is not included. Should it be, for symmetry?
+     It is in ISOamsn  -->
+<!ENTITY nsub     "&#8836;" ><!-- not a subset of, U+2284 ISOamsn -->
+<!ENTITY sube     "&#8838;" ><!-- subset of or equal to, U+2286 ISOtech -->
+<!ENTITY supe     "&#8839;" ><!-- superset of or equal to, U+2287 ISOtech -->
+<!ENTITY oplus    "&#8853;" ><!-- circled plus = direct sum, U+2295 ISOamsb -->
+<!ENTITY otimes   "&#8855;" ><!-- circled times = vector product, U+2297 ISOamsb -->
+<!ENTITY perp     "&#8869;" ><!-- up tack = orthogonal to = perpendicular, U+22A5 ISOtech -->
+<!ENTITY sdot     "&#8901;" ><!-- dot operator, U+22C5 ISOamsb -->
+<!-- dot operator is NOT the same character as U+00B7 middle dot -->
+
+<!-- Miscellaneous Technical -->
+<!ENTITY lceil    "&#8968;" ><!-- left ceiling = apl upstile, U+2308 ISOamsc  -->
+<!ENTITY rceil    "&#8969;" ><!-- right ceiling, U+2309 ISOamsc  -->
+<!ENTITY lfloor   "&#8970;" ><!-- left floor = apl downstile, U+230A ISOamsc  -->
+<!ENTITY rfloor   "&#8971;" ><!-- right floor, U+230B ISOamsc  -->
+<!ENTITY lang     "&#9001;" ><!-- left-pointing angle bracket = bra, U+2329 ISOtech -->
+<!-- lang is NOT the same character as U+003C 'less than'
+     or U+2039 'single left-pointing angle quotation mark' -->
+<!ENTITY rang     "&#9002;" ><!-- right-pointing angle bracket = ket, U+232A ISOtech -->
+<!-- rang is NOT the same character as U+003E 'greater than'
+     or U+203A 'single right-pointing angle quotation mark' -->
+
+<!-- Geometric Shapes -->
+<!ENTITY loz      "&#9674;" ><!-- lozenge, U+25CA ISOpub -->
+
+<!-- Miscellaneous Symbols -->
+<!ENTITY spades   "&#9824;" ><!-- black spade suit, U+2660 ISOpub -->
+<!-- black here seems to mean filled as opposed to hollow -->
+<!ENTITY clubs    "&#9827;" ><!-- black club suit = shamrock, U+2663 ISOpub -->
+<!ENTITY hearts   "&#9829;" ><!-- black heart suit = valentine, U+2665 ISOpub -->
+<!ENTITY diams    "&#9830;" ><!-- black diamond suit, U+2666 ISOpub -->
+
+<!-- end of xhtml-symbol.ent -->
+
+
+<!ENTITY % xhtml-special
+    PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+           "../xhtml11/xhtml-special.ent" >
+<!-- ...................................................................... -->
+<!-- XML-compatible ISO Special Character Entity Set for XHTML ............ -->
+<!-- file: xhtml-special.ent
+
+     Typical invocation:
+
+       <!ENTITY % xhtml-special
+           PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+                  "xhtml-special.ent" >
+       %xhtml-special;
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+       SYSTEM "../xhtml11/xhtml-special.ent"
+
+     Revision:  $Id: xhtml-special.ent,v 4.1 2001/04/10 09:34:14 altheim Exp $ SMI
+
+     Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with conforming
+     SGML systems and applications as defined in ISO 8879, provided
+     this notice is included in all copies.
+
+     Revisions:
+2000-10-28: added &apos; and altered XML Predefined Entities for compatibility
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+     New names (i.e., not in ISO 8879 [SGML] list) do not clash with
+     any existing ISO 8879 entity names. ISO 10646 [ISO10646] character
+     numbers are given for each character, in hex. Entity values are
+     decimal conversions of the ISO 10646 values and refer to the
+     document character set. Names are Unicode [UNICODE] names.
+-->
+
+<!-- C0 Controls and Basic Latin -->
+<!ENTITY lt      "&#38;&#60;" ><!-- less-than sign, U+003C ISOnum -->
+<!ENTITY gt      "&#62;" ><!-- greater-than sign, U+003E ISOnum -->
+<!ENTITY amp     "&#38;&#38;" ><!-- ampersand, U+0026 ISOnum -->
+<!ENTITY apos    "&#39;" ><!-- apostrophe, U+0027 ISOnum -->
+<!ENTITY quot    "&#34;" ><!-- quotation mark = APL quote, U+0022 ISOnum -->
+
+<!-- Latin Extended-A -->
+<!ENTITY OElig   "&#338;" ><!-- latin capital ligature OE, U+0152 ISOlat2 -->
+<!ENTITY oelig   "&#339;" ><!-- latin small ligature oe, U+0153 ISOlat2 -->
+
+<!-- ligature is a misnomer, this is a separate character in some languages -->
+<!ENTITY Scaron  "&#352;" ><!-- latin capital letter S with caron, U+0160 ISOlat2 -->
+<!ENTITY scaron  "&#353;" ><!-- latin small letter s with caron, U+0161 ISOlat2 -->
+<!ENTITY Yuml    "&#376;" ><!-- latin capital letter Y with diaeresis, U+0178 ISOlat2 -->
+
+<!-- Spacing Modifier Letters -->
+<!ENTITY circ    "&#710;" ><!-- modifier letter circumflex accent, U+02C6 ISOpub -->
+<!ENTITY tilde   "&#732;" ><!-- small tilde, U+02DC ISOdia -->
+
+<!-- General Punctuation -->
+<!ENTITY ensp    "&#8194;" ><!-- en space, U+2002 ISOpub -->
+<!ENTITY emsp    "&#8195;" ><!-- em space, U+2003 ISOpub -->
+<!ENTITY thinsp  "&#8201;" ><!-- thin space, U+2009 ISOpub -->
+<!ENTITY zwnj    "&#8204;" ><!-- zero width non-joiner, U+200C NEW RFC 2070 -->
+<!ENTITY zwj     "&#8205;" ><!-- zero width joiner, U+200D NEW RFC 2070 -->
+<!ENTITY lrm     "&#8206;" ><!-- left-to-right mark, U+200E NEW RFC 2070 -->
+<!ENTITY rlm     "&#8207;" ><!-- right-to-left mark, U+200F NEW RFC 2070 -->
+<!ENTITY ndash   "&#8211;" ><!-- en dash, U+2013 ISOpub -->
+<!ENTITY mdash   "&#8212;" ><!-- em dash, U+2014 ISOpub -->
+<!ENTITY lsquo   "&#8216;" ><!-- left single quotation mark, U+2018 ISOnum -->
+<!ENTITY rsquo   "&#8217;" ><!-- right single quotation mark, U+2019 ISOnum -->
+<!ENTITY sbquo   "&#8218;" ><!-- single low-9 quotation mark, U+201A NEW -->
+<!ENTITY ldquo   "&#8220;" ><!-- left double quotation mark, U+201C ISOnum -->
+<!ENTITY rdquo   "&#8221;" ><!-- right double quotation mark, U+201D ISOnum -->
+<!ENTITY bdquo   "&#8222;" ><!-- double low-9 quotation mark, U+201E NEW -->
+<!ENTITY dagger  "&#8224;" ><!-- dagger, U+2020 ISOpub -->
+<!ENTITY Dagger  "&#8225;" ><!-- double dagger, U+2021 ISOpub -->
+<!ENTITY permil  "&#8240;" ><!-- per mille sign, U+2030 ISOtech -->
+
+<!-- lsaquo is proposed but not yet ISO standardized -->
+<!ENTITY lsaquo  "&#8249;" ><!-- single left-pointing angle quotation mark, U+2039 ISO proposed -->
+<!-- rsaquo is proposed but not yet ISO standardized -->
+<!ENTITY rsaquo  "&#8250;" ><!-- single right-pointing angle quotation mark, U+203A ISO proposed -->
+<!ENTITY euro    "&#8364;" ><!-- euro sign, U+20AC NEW -->
+
+<!-- end of xhtml-special.ent -->
+
+
+<!-- end of xhtml-charent-1.mod -->
+]]>
+
+<!-- end of xhtml-framework-1.mod -->
+
+
+<!-- XHTML Core Modules ........................................ -->
+<!ENTITY % pre.content
+     "( #PCDATA
+      | %InlStruct.class;
+      %InlPhras.class;
+      %Anchor.class;
+      %Inline.extra; )*"
+>
+
+<!ENTITY % xhtml-text.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
+            "../xhtml11/xhtml-text-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Text Module  ................................................... -->
+<!-- file: xhtml-text-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-text-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-text-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Textual Content
+
+     The Text module includes declarations for all core
+     text container elements and their attributes.
+-->
+
+<!ENTITY % xhtml-inlstruct.module "INCLUDE" >
+<![%xhtml-inlstruct.module;[
+<!ENTITY % xhtml-inlstruct.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
+            "../xhtml11/xhtml-inlstruct-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Inline Structural Module  ...................................... -->
+<!-- file: xhtml-inlstruct-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-inlstruct-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-inlstruct-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Inline Structural
+
+        br, span
+
+     This module declares the elements and their attributes
+     used to support inline-level structural markup.
+-->
+
+<!-- br: forced line break ............................. -->
+
+<!ENTITY % br.element  "INCLUDE" >
+<![%br.element;[
+
+<!ENTITY % br.content  "EMPTY" >
+<!ENTITY % br.qname  "br" >
+<!ELEMENT %br.qname;  %br.content; >
+
+<!-- end of br.element -->]]>
+
+<!ENTITY % br.attlist  "INCLUDE" >
+<![%br.attlist;[
+<!ATTLIST %br.qname;
+      %Core.attrib;
+>
+<!-- end of br.attlist -->]]>
+
+<!-- span: generic inline container .................... -->
+
+<!ENTITY % span.element  "INCLUDE" >
+<![%span.element;[
+<!ENTITY % span.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % span.qname  "span" >
+<!ELEMENT %span.qname;  %span.content; >
+<!-- end of span.element -->]]>
+
+<!ENTITY % span.attlist  "INCLUDE" >
+<![%span.attlist;[
+<!ATTLIST %span.qname;
+      %Common.attrib;
+>
+<!-- end of span.attlist -->]]>
+
+<!-- end of xhtml-inlstruct-1.mod -->
+]]>
+
+<!ENTITY % xhtml-inlphras.module "INCLUDE" >
+<![%xhtml-inlphras.module;[
+<!ENTITY % xhtml-inlphras.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
+            "../xhtml11/xhtml-inlphras-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Inline Phrasal Module  ......................................... -->
+<!-- file: xhtml-inlphras-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-inlphras-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-inlphras-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Inline Phrasal
+
+        abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var
+
+     This module declares the elements and their attributes used to
+     support inline-level phrasal markup.
+-->
+
+<!ENTITY % abbr.element  "INCLUDE" >
+<![%abbr.element;[
+<!ENTITY % abbr.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % abbr.qname  "abbr" >
+<!ELEMENT %abbr.qname;  %abbr.content; >
+<!-- end of abbr.element -->]]>
+
+<!ENTITY % abbr.attlist  "INCLUDE" >
+<![%abbr.attlist;[
+<!ATTLIST %abbr.qname;
+      %Common.attrib;
+>
+<!-- end of abbr.attlist -->]]>
+
+<!ENTITY % acronym.element  "INCLUDE" >
+<![%acronym.element;[
+<!ENTITY % acronym.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % acronym.qname  "acronym" >
+<!ELEMENT %acronym.qname;  %acronym.content; >
+<!-- end of acronym.element -->]]>
+
+<!ENTITY % acronym.attlist  "INCLUDE" >
+<![%acronym.attlist;[
+<!ATTLIST %acronym.qname;
+      %Common.attrib;
+>
+<!-- end of acronym.attlist -->]]>
+
+<!ENTITY % cite.element  "INCLUDE" >
+<![%cite.element;[
+<!ENTITY % cite.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % cite.qname  "cite" >
+<!ELEMENT %cite.qname;  %cite.content; >
+<!-- end of cite.element -->]]>
+
+<!ENTITY % cite.attlist  "INCLUDE" >
+<![%cite.attlist;[
+<!ATTLIST %cite.qname;
+      %Common.attrib;
+>
+<!-- end of cite.attlist -->]]>
+
+<!ENTITY % code.element  "INCLUDE" >
+<![%code.element;[
+<!ENTITY % code.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % code.qname  "code" >
+<!ELEMENT %code.qname;  %code.content; >
+<!-- end of code.element -->]]>
+
+<!ENTITY % code.attlist  "INCLUDE" >
+<![%code.attlist;[
+<!ATTLIST %code.qname;
+      %Common.attrib;
+>
+<!-- end of code.attlist -->]]>
+
+<!ENTITY % dfn.element  "INCLUDE" >
+<![%dfn.element;[
+<!ENTITY % dfn.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % dfn.qname  "dfn" >
+<!ELEMENT %dfn.qname;  %dfn.content; >
+<!-- end of dfn.element -->]]>
+
+<!ENTITY % dfn.attlist  "INCLUDE" >
+<![%dfn.attlist;[
+<!ATTLIST %dfn.qname;
+      %Common.attrib;
+>
+<!-- end of dfn.attlist -->]]>
+
+<!ENTITY % em.element  "INCLUDE" >
+<![%em.element;[
+<!ENTITY % em.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % em.qname  "em" >
+<!ELEMENT %em.qname;  %em.content; >
+<!-- end of em.element -->]]>
+
+<!ENTITY % em.attlist  "INCLUDE" >
+<![%em.attlist;[
+<!ATTLIST %em.qname;
+      %Common.attrib;
+>
+<!-- end of em.attlist -->]]>
+
+<!ENTITY % kbd.element  "INCLUDE" >
+<![%kbd.element;[
+<!ENTITY % kbd.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % kbd.qname  "kbd" >
+<!ELEMENT %kbd.qname;  %kbd.content; >
+<!-- end of kbd.element -->]]>
+
+<!ENTITY % kbd.attlist  "INCLUDE" >
+<![%kbd.attlist;[
+<!ATTLIST %kbd.qname;
+      %Common.attrib;
+>
+<!-- end of kbd.attlist -->]]>
+
+<!ENTITY % q.element  "INCLUDE" >
+<![%q.element;[
+<!ENTITY % q.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % q.qname  "q" >
+<!ELEMENT %q.qname;  %q.content; >
+<!-- end of q.element -->]]>
+
+<!ENTITY % q.attlist  "INCLUDE" >
+<![%q.attlist;[
+<!ATTLIST %q.qname;
+      %Common.attrib;
+      cite         %URI.datatype;           #IMPLIED
+>
+<!-- end of q.attlist -->]]>
+
+<!ENTITY % samp.element  "INCLUDE" >
+<![%samp.element;[
+<!ENTITY % samp.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % samp.qname  "samp" >
+<!ELEMENT %samp.qname;  %samp.content; >
+<!-- end of samp.element -->]]>
+
+<!ENTITY % samp.attlist  "INCLUDE" >
+<![%samp.attlist;[
+<!ATTLIST %samp.qname;
+      %Common.attrib;
+>
+<!-- end of samp.attlist -->]]>
+
+<!ENTITY % strong.element  "INCLUDE" >
+<![%strong.element;[
+<!ENTITY % strong.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % strong.qname  "strong" >
+<!ELEMENT %strong.qname;  %strong.content; >
+<!-- end of strong.element -->]]>
+
+<!ENTITY % strong.attlist  "INCLUDE" >
+<![%strong.attlist;[
+<!ATTLIST %strong.qname;
+      %Common.attrib;
+>
+<!-- end of strong.attlist -->]]>
+
+<!ENTITY % var.element  "INCLUDE" >
+<![%var.element;[
+<!ENTITY % var.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % var.qname  "var" >
+<!ELEMENT %var.qname;  %var.content; >
+<!-- end of var.element -->]]>
+
+<!ENTITY % var.attlist  "INCLUDE" >
+<![%var.attlist;[
+<!ATTLIST %var.qname;
+      %Common.attrib;
+>
+<!-- end of var.attlist -->]]>
+
+<!-- end of xhtml-inlphras-1.mod -->
+]]>
+
+<!ENTITY % xhtml-blkstruct.module "INCLUDE" >
+<![%xhtml-blkstruct.module;[
+<!ENTITY % xhtml-blkstruct.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
+            "../xhtml11/xhtml-blkstruct-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Block Structural Module  ....................................... -->
+<!-- file: xhtml-blkstruct-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-blkstruct-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-blkstruct-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Block Structural
+
+        div, p
+
+     This module declares the elements and their attributes used to
+     support block-level structural markup.
+-->
+
+<!ENTITY % div.element  "INCLUDE" >
+<![%div.element;[
+<!ENTITY % div.content
+     "( #PCDATA | %Flow.mix; )*"
+>
+<!ENTITY % div.qname  "div" >
+<!ELEMENT %div.qname;  %div.content; >
+<!-- end of div.element -->]]>
+
+<!ENTITY % div.attlist  "INCLUDE" >
+<![%div.attlist;[
+<!ATTLIST %div.qname;
+      %Common.attrib;
+>
+<!-- end of div.attlist -->]]>
+
+<!ENTITY % p.element  "INCLUDE" >
+<![%p.element;[
+<!ENTITY % p.content
+     "( #PCDATA | %Inline.mix; )*" >
+<!ENTITY % p.qname  "p" >
+<!ELEMENT %p.qname;  %p.content; >
+<!-- end of p.element -->]]>
+
+<!ENTITY % p.attlist  "INCLUDE" >
+<![%p.attlist;[
+<!ATTLIST %p.qname;
+      %Common.attrib;
+>
+<!-- end of p.attlist -->]]>
+
+<!-- end of xhtml-blkstruct-1.mod -->
+]]>
+
+<!ENTITY % xhtml-blkphras.module "INCLUDE" >
+<![%xhtml-blkphras.module;[
+<!ENTITY % xhtml-blkphras.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
+            "../xhtml11/xhtml-blkphras-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Block Phrasal Module  .......................................... -->
+<!-- file: xhtml-blkphras-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-blkphras-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-blkphras-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Block Phrasal
+
+        address, blockquote, pre, h1, h2, h3, h4, h5, h6
+
+     This module declares the elements and their attributes used to
+     support block-level phrasal markup.
+-->
+
+<!ENTITY % address.element  "INCLUDE" >
+<![%address.element;[
+<!ENTITY % address.content
+     "( #PCDATA | %Inline.mix; )*" >
+<!ENTITY % address.qname  "address" >
+<!ELEMENT %address.qname;  %address.content; >
+<!-- end of address.element -->]]>
+
+<!ENTITY % address.attlist  "INCLUDE" >
+<![%address.attlist;[
+<!ATTLIST %address.qname;
+      %Common.attrib;
+>
+<!-- end of address.attlist -->]]>
+
+<!ENTITY % blockquote.element  "INCLUDE" >
+<![%blockquote.element;[
+<!ENTITY % blockquote.content
+     "( %Block.mix; )+"
+>
+<!ENTITY % blockquote.qname  "blockquote" >
+<!ELEMENT %blockquote.qname;  %blockquote.content; >
+<!-- end of blockquote.element -->]]>
+
+<!ENTITY % blockquote.attlist  "INCLUDE" >
+<![%blockquote.attlist;[
+<!ATTLIST %blockquote.qname;
+      %Common.attrib;
+      cite         %URI.datatype;           #IMPLIED
+>
+<!-- end of blockquote.attlist -->]]>
+
+<!ENTITY % pre.element  "INCLUDE" >
+<![%pre.element;[
+<!ENTITY % pre.content
+     "( #PCDATA
+      | %InlStruct.class;
+      %InlPhras.class;
+      | %tt.qname; | %i.qname; | %b.qname;
+      %I18n.class;
+      %Anchor.class;
+      | %script.qname; | %map.qname;
+      %Inline.extra; )*"
+>
+<!ENTITY % pre.qname  "pre" >
+<!ELEMENT %pre.qname;  %pre.content; >
+<!-- end of pre.element -->]]>
+
+<!ENTITY % pre.attlist  "INCLUDE" >
+<![%pre.attlist;[
+<!ATTLIST %pre.qname;
+      %Common.attrib;
+      xml:space    ( preserve )             #FIXED 'preserve'
+>
+<!-- end of pre.attlist -->]]>
+
+<!-- ...................  Heading Elements  ................... -->
+
+<!ENTITY % Heading.content  "( #PCDATA | %Inline.mix; )*" >
+
+<!ENTITY % h1.element  "INCLUDE" >
+<![%h1.element;[
+<!ENTITY % h1.qname  "h1" >
+<!ELEMENT %h1.qname;  %Heading.content; >
+<!-- end of h1.element -->]]>
+
+<!ENTITY % h1.attlist  "INCLUDE" >
+<![%h1.attlist;[
+<!ATTLIST %h1.qname;
+      %Common.attrib;
+>
+<!-- end of h1.attlist -->]]>
+
+<!ENTITY % h2.element  "INCLUDE" >
+<![%h2.element;[
+<!ENTITY % h2.qname  "h2" >
+<!ELEMENT %h2.qname;  %Heading.content; >
+<!-- end of h2.element -->]]>
+
+<!ENTITY % h2.attlist  "INCLUDE" >
+<![%h2.attlist;[
+<!ATTLIST %h2.qname;
+      %Common.attrib;
+>
+<!-- end of h2.attlist -->]]>
+
+<!ENTITY % h3.element  "INCLUDE" >
+<![%h3.element;[
+<!ENTITY % h3.qname  "h3" >
+<!ELEMENT %h3.qname;  %Heading.content; >
+<!-- end of h3.element -->]]>
+
+<!ENTITY % h3.attlist  "INCLUDE" >
+<![%h3.attlist;[
+<!ATTLIST %h3.qname;
+      %Common.attrib;
+>
+<!-- end of h3.attlist -->]]>
+
+<!ENTITY % h4.element  "INCLUDE" >
+<![%h4.element;[
+<!ENTITY % h4.qname  "h4" >
+<!ELEMENT %h4.qname;  %Heading.content; >
+<!-- end of h4.element -->]]>
+
+<!ENTITY % h4.attlist  "INCLUDE" >
+<![%h4.attlist;[
+<!ATTLIST %h4.qname;
+      %Common.attrib;
+>
+<!-- end of h4.attlist -->]]>
+
+<!ENTITY % h5.element  "INCLUDE" >
+<![%h5.element;[
+<!ENTITY % h5.qname  "h5" >
+<!ELEMENT %h5.qname;  %Heading.content; >
+<!-- end of h5.element -->]]>
+
+<!ENTITY % h5.attlist  "INCLUDE" >
+<![%h5.attlist;[
+<!ATTLIST %h5.qname;
+      %Common.attrib;
+>
+<!-- end of h5.attlist -->]]>
+
+<!ENTITY % h6.element  "INCLUDE" >
+<![%h6.element;[
+<!ENTITY % h6.qname  "h6" >
+<!ELEMENT %h6.qname;  %Heading.content; >
+<!-- end of h6.element -->]]>
+
+<!ENTITY % h6.attlist  "INCLUDE" >
+<![%h6.attlist;[
+<!ATTLIST %h6.qname;
+      %Common.attrib;
+>
+<!-- end of h6.attlist -->]]>
+
+<!-- end of xhtml-blkphras-1.mod -->
+]]>
+
+<!-- end of xhtml-text-1.mod -->
+
+
+<!ENTITY % xhtml-hypertext.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
+            "../xhtml11/xhtml-hypertext-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Hypertext Module  .............................................. -->
+<!-- file: xhtml-hypertext-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-hypertext-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-hypertext-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Hypertext
+
+        a
+
+     This module declares the anchor ('a') element type, which
+     defines the source of a hypertext link. The destination
+     (or link 'target') is identified via its 'id' attribute
+     rather than the 'name' attribute as was used in HTML.
+-->
+
+<!-- ............  Anchor Element  ............ -->
+
+<!ENTITY % a.element  "INCLUDE" >
+<![%a.element;[
+<!ENTITY % a.content
+     "( #PCDATA | %InlNoAnchor.mix; )*"
+>
+<!ENTITY % a.qname  "a" >
+<!ELEMENT %a.qname;  %a.content; >
+<!-- end of a.element -->]]>
+
+<!ENTITY % a.attlist  "INCLUDE" >
+<![%a.attlist;[
+<!ATTLIST %a.qname;
+      %Common.attrib;
+      href         %URI.datatype;           #IMPLIED
+      charset      %Charset.datatype;       #IMPLIED
+      type         %ContentType.datatype;   #IMPLIED
+      hreflang     %LanguageCode.datatype;  #IMPLIED
+      rel          %LinkTypes.datatype;     #IMPLIED
+      rev          %LinkTypes.datatype;     #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+>
+<!-- end of a.attlist -->]]>
+
+<!-- end of xhtml-hypertext-1.mod -->
+
+
+<!ENTITY % xhtml-list.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
+            "../xhtml11/xhtml-list-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Lists Module  .................................................. -->
+<!-- file: xhtml-list-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-list-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-list-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Lists
+
+        dl, dt, dd, ol, ul, li
+
+     This module declares the list-oriented element types
+     and their attributes.
+-->
+
+<!ENTITY % dl.qname  "dl" >
+<!ENTITY % dt.qname  "dt" >
+<!ENTITY % dd.qname  "dd" >
+<!ENTITY % ol.qname  "ol" >
+<!ENTITY % ul.qname  "ul" >
+<!ENTITY % li.qname  "li" >
+
+<!-- dl: Definition List ............................... -->
+
+<!ENTITY % dl.element  "INCLUDE" >
+<![%dl.element;[
+<!ENTITY % dl.content  "( %dt.qname; | %dd.qname; )+" >
+<!ELEMENT %dl.qname;  %dl.content; >
+<!-- end of dl.element -->]]>
+
+<!ENTITY % dl.attlist  "INCLUDE" >
+<![%dl.attlist;[
+<!ATTLIST %dl.qname;
+      %Common.attrib;
+>
+<!-- end of dl.attlist -->]]>
+
+<!-- dt: Definition Term ............................... -->
+
+<!ENTITY % dt.element  "INCLUDE" >
+<![%dt.element;[
+<!ENTITY % dt.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %dt.qname;  %dt.content; >
+<!-- end of dt.element -->]]>
+
+<!ENTITY % dt.attlist  "INCLUDE" >
+<![%dt.attlist;[
+<!ATTLIST %dt.qname;
+      %Common.attrib;
+>
+<!-- end of dt.attlist -->]]>
+
+<!-- dd: Definition Description ........................ -->
+
+<!ENTITY % dd.element  "INCLUDE" >
+<![%dd.element;[
+<!ENTITY % dd.content
+     "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %dd.qname;  %dd.content; >
+<!-- end of dd.element -->]]>
+
+<!ENTITY % dd.attlist  "INCLUDE" >
+<![%dd.attlist;[
+<!ATTLIST %dd.qname;
+      %Common.attrib;
+>
+<!-- end of dd.attlist -->]]>
+
+<!-- ol: Ordered List (numbered styles) ................ -->
+
+<!ENTITY % ol.element  "INCLUDE" >
+<![%ol.element;[
+<!ENTITY % ol.content  "( %li.qname; )+" >
+<!ELEMENT %ol.qname;  %ol.content; >
+<!-- end of ol.element -->]]>
+
+<!ENTITY % ol.attlist  "INCLUDE" >
+<![%ol.attlist;[
+<!ATTLIST %ol.qname;
+      %Common.attrib;
+>
+<!-- end of ol.attlist -->]]>
+
+<!-- ul: Unordered List (bullet styles) ................ -->
+
+<!ENTITY % ul.element  "INCLUDE" >
+<![%ul.element;[
+<!ENTITY % ul.content  "( %li.qname; )+" >
+<!ELEMENT %ul.qname;  %ul.content; >
+<!-- end of ul.element -->]]>
+
+<!ENTITY % ul.attlist  "INCLUDE" >
+<![%ul.attlist;[
+<!ATTLIST %ul.qname;
+      %Common.attrib;
+>
+<!-- end of ul.attlist -->]]>
+
+<!-- li: List Item ..................................... -->
+
+<!ENTITY % li.element  "INCLUDE" >
+<![%li.element;[
+<!ENTITY % li.content
+     "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %li.qname;  %li.content; >
+<!-- end of li.element -->]]>
+
+<!ENTITY % li.attlist  "INCLUDE" >
+<![%li.attlist;[
+<!ATTLIST %li.qname;
+      %Common.attrib;
+>
+<!-- end of li.attlist -->]]>
+
+<!-- end of xhtml-list-1.mod -->
+
+<!-- Extend lists with value and start attributes -->
+<!ATTLIST %li.qname;
+      value        %Number.datatype;         #IMPLIED
+>
+<!ATTLIST %ol.qname;
+      start        %Number.datatype;        #IMPLIED
+>
+
+<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
+
+<!-- Image Module  ............................................... -->
+<!ENTITY % xhtml-image.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
+            "../xhtml11/xhtml-image-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Images Module  ................................................. -->
+<!-- file: xhtml-image-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Rovision: $Id: xhtml-image-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-image-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Images
+
+        img
+
+     This module provides markup to support basic image embedding.
+-->
+
+<!-- To avoid problems with text-only UAs as well as to make
+     image content understandable and navigable to users of
+     non-visual UAs, you need to provide a description with
+     the 'alt' attribute, and avoid server-side image maps.
+-->
+
+<!ENTITY % img.element  "INCLUDE" >
+<![%img.element;[
+<!ENTITY % img.content  "EMPTY" >
+<!ENTITY % img.qname  "img" >
+<!ELEMENT %img.qname;  %img.content; >
+<!-- end of img.element -->]]>
+
+<!ENTITY % img.attlist  "INCLUDE" >
+<![%img.attlist;[
+<!ATTLIST %img.qname;
+      %Common.attrib;
+      src          %URI.datatype;           #REQUIRED
+      alt          %Text.datatype;          #REQUIRED
+      longdesc     %URI.datatype;           #IMPLIED
+      height       %Length.datatype;        #IMPLIED
+      width        %Length.datatype;        #IMPLIED
+>
+<!-- end of img.attlist -->]]>
+
+<!-- end of xhtml-image-1.mod -->
+
+
+<!-- Tables Module ............................................... -->
+<!ENTITY % xhtml-table.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN"
+            "../xhtml11/xhtml-basic-table-1.mod" >
+<!-- ....................................................................... -->
+<!-- XHTML Basic Table Module  ............................................. -->
+<!-- file: xhtml-basic-table-1.mod
+
+     This is XHTML Basic, a proper subset of XHTML.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-basic-table-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-basic-table-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Basic Tables
+
+        table, caption, tr, th, td
+
+     This table module declares elements and attributes defining
+     a table model based fundamentally on features found in the
+     widely-deployed HTML 3.2 table model.  While this module
+     mimics the content model and table attributes of HTML 3.2
+     tables, the element types declared herein also includes all
+     HTML 4 common and most of the HTML 4 table attributes.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % table.qname  "table" >
+<!ENTITY % caption.qname  "caption" >
+<!ENTITY % tr.qname  "tr" >
+<!ENTITY % th.qname  "th" >
+<!ENTITY % td.qname  "td" >
+
+<!-- horizontal alignment attributes for cell contents
+-->
+<!ENTITY % CellHAlign.attrib
+     "align        ( left
+                   | center
+                   | right )                #IMPLIED"
+>
+
+<!-- vertical alignment attributes for cell contents
+-->
+<!ENTITY % CellVAlign.attrib
+     "valign       ( top
+                   | middle
+                   | bottom )               #IMPLIED"
+>
+
+<!-- scope is simpler than axes attribute for common tables
+-->
+<!ENTITY % scope.attrib
+     "scope        ( row | col  )           #IMPLIED"
+>
+
+<!-- table: Table Element .............................. -->
+
+<!ENTITY % table.element  "INCLUDE" >
+<![%table.element;[
+<!ENTITY % table.content
+     "( %caption.qname;?, %tr.qname;+ )"
+>
+<!ELEMENT %table.qname;  %table.content; >
+<!-- end of table.element -->]]>
+
+<!ENTITY % table.attlist  "INCLUDE" >
+<![%table.attlist;[
+<!ATTLIST %table.qname;
+      %Common.attrib;
+      summary      %Text.datatype;          #IMPLIED
+>
+<!-- end of table.attlist -->]]>
+
+<!-- caption: Table Caption ............................ -->
+
+<!ENTITY % caption.element  "INCLUDE" >
+<![%caption.element;[
+<!ENTITY % caption.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %caption.qname;  %caption.content; >
+<!-- end of caption.element -->]]>
+
+<!ENTITY % caption.attlist  "INCLUDE" >
+<![%caption.attlist;[
+<!ATTLIST %caption.qname;
+      %Common.attrib;
+>
+<!-- end of caption.attlist -->]]>
+
+<!-- tr: Table Row ..................................... -->
+
+<!ENTITY % tr.element  "INCLUDE" >
+<![%tr.element;[
+<!ENTITY % tr.content  "( %th.qname; | %td.qname; )+" >
+<!ELEMENT %tr.qname;  %tr.content; >
+<!-- end of tr.element -->]]>
+
+<!ENTITY % tr.attlist  "INCLUDE" >
+<![%tr.attlist;[
+<!ATTLIST %tr.qname;
+      %Common.attrib;
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of tr.attlist -->]]>
+
+<!-- th: Table Header Cell ............................. -->
+
+<!-- th is for header cells, td for data,
+     but for cells acting as both use td
+-->
+
+<!ENTITY % th.element  "INCLUDE" >
+<![%th.element;[
+<!ENTITY % th.content
+     "( #PCDATA | %FlowNoTable.mix; )*"
+>
+<!ELEMENT %th.qname;  %th.content; >
+<!-- end of th.element -->]]>
+
+<!ENTITY % th.attlist  "INCLUDE" >
+<![%th.attlist;[
+<!ATTLIST %th.qname;
+      %Common.attrib;
+      abbr         %Text.datatype;          #IMPLIED
+      axis         CDATA                    #IMPLIED
+      headers      IDREFS                   #IMPLIED
+      %scope.attrib;
+      rowspan      %Number.datatype;        '1'
+      colspan      %Number.datatype;        '1'
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of th.attlist -->]]>
+
+<!-- td: Table Data Cell ............................... -->
+
+<!ENTITY % td.element  "INCLUDE" >
+<![%td.element;[
+<!ENTITY % td.content
+     "( #PCDATA | %FlowNoTable.mix; )*"
+>
+<!ELEMENT %td.qname;  %td.content; >
+<!-- end of td.element -->]]>
+
+<!ENTITY % td.attlist  "INCLUDE" >
+<![%td.attlist;[
+<!ATTLIST %td.qname;
+      %Common.attrib;
+      abbr         %Text.datatype;          #IMPLIED
+      axis         CDATA                    #IMPLIED
+      headers      IDREFS                   #IMPLIED
+      %scope.attrib;
+      rowspan      %Number.datatype;        '1'
+      colspan      %Number.datatype;        '1'
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of td.attlist -->]]>
+
+<!-- end of xhtml-basic-table-1.mod -->
+
+
+<!-- Forms Module  ...............................................
+	XHTML basic forms module extended with optgroup and fieldset
+-->
+<!ELEMENT %optgroup.qname; (%option.qname;)+>
+<!ATTLIST %optgroup.qname;
+	%Common.attrib;
+	label %Text.datatype; #REQUIRED
+>
+<!ENTITY % select.content "( %optgroup.qname; | %option.qname; )+">
+<!ELEMENT %fieldset.qname; (#PCDATA | %Flow.mix;)*>
+<!ATTLIST %fieldset.qname;
+	%Common.attrib;
+>
+<!ENTITY % form.content "( %BlkNoForm.mix; | %fieldset.qname; )+">
+<!ENTITY % xhtml-form.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Basic Forms 1.0//EN"
+            "../xhtml11/xhtml-basic-form-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Simplified Forms Module  ....................................... -->
+<!-- file: xhtml-basic-form-1.mod
+
+     This is XHTML Basic, a proper subset of XHTML.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-basic-form-1.mod,v 4.1 2001/04/05 06:57:40 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Basic Forms 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-basic-form-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Basic Forms
+
+     This forms module is based on the HTML 3.2 forms model, with
+     the WAI-requested addition of the label element. While this
+     module essentially mimics the content model and attributes of
+     HTML 3.2 forms, the element types declared herein also include
+     all HTML 4 common attributes.
+
+        form, label, input, select, option, textarea
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % form.qname  "form" >
+<!ENTITY % label.qname  "label" >
+<!ENTITY % input.qname  "input" >
+<!ENTITY % select.qname  "select" >
+<!ENTITY % option.qname  "option" >
+<!ENTITY % textarea.qname  "textarea" >
+
+<!-- %BlkNoForm.mix; includes all non-form block elements,
+     plus %Misc.class;
+-->
+<!ENTITY % BlkNoForm.mix
+     "%Heading.class;
+      | %List.class;
+      | %BlkStruct.class;
+      %BlkPhras.class;
+      %BlkPres.class;
+      | %table.qname;
+      %Block.extra;
+      %Misc.class;"
+>
+
+<!-- form: Form Element ................................ -->
+
+<!ENTITY % form.element  "INCLUDE" >
+<![%form.element;[
+<!ENTITY % form.content
+     "( %BlkNoForm.mix; )+"
+>
+<!ELEMENT %form.qname;  %form.content; >
+<!-- end of form.element -->]]>
+
+<!ENTITY % form.attlist  "INCLUDE" >
+<![%form.attlist;[
+<!ATTLIST %form.qname;
+      %Common.attrib;
+      action       %URI.datatype;           #REQUIRED
+      method       ( get | post )           'get'
+      enctype      %ContentType.datatype;   'application/x-www-form-urlencoded'
+>
+<!-- end of form.attlist -->]]>
+
+<!-- label: Form Field Label Text ...................... -->
+
+<!ENTITY % label.element  "INCLUDE" >
+<![%label.element;[
+<!-- Each label must not contain more than ONE field
+-->
+<!ENTITY % label.content
+     "( #PCDATA
+      | %input.qname; | %select.qname; | %textarea.qname;
+      | %InlStruct.class;
+      %InlPhras.class;
+      %I18n.class;
+      %InlPres.class;
+      %InlSpecial.class;
+      %Misc.class; )*"
+>
+<!ELEMENT %label.qname;  %label.content; >
+<!-- end of label.element -->]]>
+
+<!ENTITY % label.attlist  "INCLUDE" >
+<![%label.attlist;[
+<!ATTLIST %label.qname;
+      %Common.attrib;
+      for          IDREF                    #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of label.attlist -->]]>
+
+<!-- input: Form Control ............................... -->
+
+<!ENTITY % input.element  "INCLUDE" >
+<![%input.element;[
+<!ENTITY % input.content  "EMPTY" >
+<!ELEMENT %input.qname;  %input.content; >
+<!-- end of input.element -->]]>
+
+<!-- Basic Forms removes 'image' and 'file' input types.
+-->
+<!ENTITY % input.attlist  "INCLUDE" >
+<![%input.attlist;[
+<!ENTITY % InputType.class
+     "( text | password | checkbox | radio
+      | submit | reset | hidden )"
+>
+<!-- attribute name required for all but submit & reset
+-->
+<!ATTLIST %input.qname;
+      %Common.attrib;
+      type         %InputType.class;        'text'
+      name         CDATA                    #IMPLIED
+      value        CDATA                    #IMPLIED
+      checked      ( checked )              #IMPLIED
+      size         CDATA                    #IMPLIED
+      maxlength    %Number.datatype;        #IMPLIED
+      src          %URI.datatype;           #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of input.attlist -->]]>
+
+<!-- select: Option Selector ........................... -->
+
+<!ENTITY % select.element  "INCLUDE" >
+<![%select.element;[
+<!ENTITY % select.content  "( %option.qname; )+" >
+<!ELEMENT %select.qname;  %select.content; >
+<!-- end of select.element -->]]>
+
+<!ENTITY % select.attlist  "INCLUDE" >
+<![%select.attlist;[
+<!ATTLIST %select.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      size         %Number.datatype;        #IMPLIED
+      multiple     ( multiple )             #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+>
+<!-- end of select.attlist -->]]>
+
+<!-- option: Selectable Choice ......................... -->
+
+<!ENTITY % option.element  "INCLUDE" >
+<![%option.element;[
+<!ENTITY % option.content  "( #PCDATA )" >
+<!ELEMENT %option.qname;  %option.content; >
+<!-- end of option.element -->]]>
+
+<!ENTITY % option.attlist  "INCLUDE" >
+<![%option.attlist;[
+<!ATTLIST %option.qname;
+      %Common.attrib;
+      selected     ( selected )             #IMPLIED
+      value        CDATA                    #IMPLIED
+>
+<!-- end of option.attlist -->]]>
+
+<!-- textarea: Multi-Line Text Field ................... -->
+
+<!ENTITY % textarea.element  "INCLUDE" >
+<![%textarea.element;[
+<!ENTITY % textarea.content  "( #PCDATA )" >
+<!ELEMENT %textarea.qname;  %textarea.content; >
+<!-- end of textarea.element -->]]>
+
+<!ENTITY % textarea.attlist  "INCLUDE" >
+<![%textarea.attlist;[
+<!ATTLIST %textarea.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      rows         %Number.datatype;        #REQUIRED
+      cols         %Number.datatype;        #REQUIRED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of textarea.attlist -->]]>
+
+<!-- end of xhtml-basic-form-1.mod -->
+
+
+<!-- Link Element Module  ........................................ -->
+<!ENTITY % xhtml-link.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
+            "../xhtml11/xhtml-link-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Link Element Module  ........................................... -->
+<!-- file: xhtml-link-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-link-1.mod,v 4.1 2001/04/05 06:57:40 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-link-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Link element
+
+        link
+
+     This module declares the link element type and its attributes,
+     which could (in principle) be used to define document-level links
+     to external resources such as:
+
+     a) for document specific toolbars/menus, e.g. start, contents,
+        previous, next, index, end, help
+     b) to link to a separate style sheet (rel="stylesheet")
+     c) to make a link to a script (rel="script")
+     d) by style sheets to control how collections of html nodes are
+        rendered into printed documents
+     e) to make a link to a printable version of this document
+        e.g. a postscript or pdf version (rel="alternate" media="print")
+-->
+
+<!-- link: Media-Independent Link ...................... -->
+
+<!ENTITY % link.element  "INCLUDE" >
+<![%link.element;[
+<!ENTITY % link.content  "EMPTY" >
+<!ENTITY % link.qname  "link" >
+<!ELEMENT %link.qname;  %link.content; >
+<!-- end of link.element -->]]>
+
+<!ENTITY % link.attlist  "INCLUDE" >
+<![%link.attlist;[
+<!ATTLIST %link.qname;
+      %Common.attrib;
+      charset      %Charset.datatype;       #IMPLIED
+      href         %URI.datatype;           #IMPLIED
+      hreflang     %LanguageCode.datatype;  #IMPLIED
+      type         %ContentType.datatype;   #IMPLIED
+      rel          %LinkTypes.datatype;     #IMPLIED
+      rev          %LinkTypes.datatype;     #IMPLIED
+      media        %MediaDesc.datatype;     #IMPLIED
+>
+<!-- end of link.attlist -->]]>
+
+<!-- end of xhtml-link-1.mod -->
+
+
+<!-- Document Metainformation Module  ............................ -->
+<!ENTITY % xhtml-meta.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
+            "../xhtml11/xhtml-meta-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Document Metainformation Module  ............................... -->
+<!-- file: xhtml-meta-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-meta-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-meta-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Meta Information
+
+        meta
+
+     This module declares the meta element type and its attributes,
+     used to provide declarative document metainformation.
+-->
+
+<!-- meta: Generic Metainformation ..................... -->
+
+<!ENTITY % meta.element  "INCLUDE" >
+<![%meta.element;[
+<!ENTITY % meta.content  "EMPTY" >
+<!ENTITY % meta.qname  "meta" >
+<!ELEMENT %meta.qname;  %meta.content; >
+<!-- end of meta.element -->]]>
+
+<!ENTITY % meta.attlist  "INCLUDE" >
+<![%meta.attlist;[
+<!ATTLIST %meta.qname;
+      %XHTML.xmlns.attrib;
+      %I18n.attrib;
+      http-equiv   NMTOKEN                  #IMPLIED
+      name         NMTOKEN                  #IMPLIED
+      content      CDATA                    #REQUIRED
+      scheme       CDATA                    #IMPLIED
+>
+<!-- end of meta.attlist -->]]>
+
+<!-- end of xhtml-meta-1.mod -->
+
+
+<!-- Base Element Module  ........................................ -->
+<!ENTITY % xhtml-base.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
+            "../xhtml11/xhtml-base-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Base Element Module  ........................................... -->
+<!-- file: xhtml-base-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-base-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-base-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Base element
+
+        base
+
+     This module declares the base element type and its attributes,
+     used to define a base URI against which relative URIs in the
+     document will be resolved.
+
+     Note that this module also redeclares the content model for
+     the head element to include the base element.
+-->
+
+<!-- base: Document Base URI ........................... -->
+
+<!ENTITY % base.element  "INCLUDE" >
+<![%base.element;[
+<!ENTITY % base.content  "EMPTY" >
+<!ENTITY % base.qname  "base" >
+<!ELEMENT %base.qname;  %base.content; >
+<!-- end of base.element -->]]>
+
+<!ENTITY % base.attlist  "INCLUDE" >
+<![%base.attlist;[
+<!ATTLIST %base.qname;
+      %XHTML.xmlns.attrib;
+      href         %URI.datatype;           #REQUIRED
+>
+<!-- end of base.attlist -->]]>
+
+<!ENTITY % head.content
+    "( %HeadOpts.mix;,
+     ( ( %title.qname;, %HeadOpts.mix;, ( %base.qname;, %HeadOpts.mix; )? )
+     | ( %base.qname;, %HeadOpts.mix;, ( %title.qname;, %HeadOpts.mix; ))))"
+>
+
+<!-- end of xhtml-base-1.mod -->
+
+
+<!-- Stylesheets Module  ......................................... -->
+<!ENTITY % xhtml-style.mod PUBLIC "-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN"
+            "../xhtml11/xhtml-style-1.mod">
+<!-- ...................................................................... -->
+<!-- XHTML Document Style Sheet Module  ................................... -->
+<!-- file: xhtml-style-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-style-1.mod,v 4.1 2001/04/05 06:57:40 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//DTD XHTML Style Sheets 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-style-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Style Sheets
+
+        style
+
+     This module declares the style element type and its attributes,
+     used to embed style sheet information in the document head element.
+-->
+
+<!-- style: Style Sheet Information .................... -->
+
+<!ENTITY % style.element  "INCLUDE" >
+<![%style.element;[
+<!ENTITY % style.content  "( #PCDATA )" >
+<!ENTITY % style.qname  "style" >
+<!ELEMENT %style.qname;  %style.content; >
+<!-- end of style.element -->]]>
+
+<!ENTITY % style.attlist  "INCLUDE" >
+<![%style.attlist;[
+<!ATTLIST %style.qname;
+      %XHTML.xmlns.attrib;
+      %title.attrib;
+      %I18n.attrib;
+      type         %ContentType.datatype;   #REQUIRED
+      media        %MediaDesc.datatype;     #IMPLIED
+      xml:space    ( preserve )             #FIXED 'preserve'
+>
+<!-- end of style.attlist -->]]>
+
+<!-- end of xhtml-style-1.mod -->
+
+
+<!-- Param Element Module  ....................................... -->
+<!ENTITY % xhtml-param.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
+            "../xhtml11/xhtml-param-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Param Element Module  ..................................... -->
+<!-- file: xhtml-param-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-param-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-param-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Parameters for Java Applets and Embedded Objects
+
+        param
+
+     This module provides declarations for the param element,
+     used to provide named property values for the applet
+     and object elements.
+-->
+
+<!-- param: Named Property Value ....................... -->
+
+<!ENTITY % param.element  "INCLUDE" >
+<![%param.element;[
+<!ENTITY % param.content  "EMPTY" >
+<!ENTITY % param.qname  "param" >
+<!ELEMENT %param.qname;  %param.content; >
+<!-- end of param.element -->]]>
+
+<!ENTITY % param.attlist  "INCLUDE" >
+<![%param.attlist;[
+<!ATTLIST %param.qname;
+      %XHTML.xmlns.attrib;
+      %id.attrib;
+      name         CDATA                    #REQUIRED
+      value        CDATA                    #IMPLIED
+      valuetype    ( data | ref | object )  'data'
+      type         %ContentType.datatype;   #IMPLIED
+>
+<!-- end of param.attlist -->]]>
+
+<!-- end of xhtml-param-1.mod -->
+
+
+<!-- Embedded Object Module  ..................................... -->
+<!ENTITY % xhtml-object.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
+            "../xhtml11/xhtml-object-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Embedded Object Module  ........................................ -->
+<!-- file: xhtml-object-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-object-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-object-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Embedded Objects
+
+        object
+
+     This module declares the object element type and its attributes, used
+     to embed external objects as part of XHTML pages. In the document,
+     place param elements prior to other content within the object element.
+
+     Note that use of this module requires instantiation of the Param
+     Element Module.
+-->
+
+<!-- object: Generic Embedded Object ................... -->
+
+<!ENTITY % object.element  "INCLUDE" >
+<![%object.element;[
+<!ENTITY % object.content
+     "( #PCDATA | %Flow.mix; | %param.qname; )*"
+>
+<!ENTITY % object.qname  "object" >
+<!ELEMENT %object.qname;  %object.content; >
+<!-- end of object.element -->]]>
+
+<!ENTITY % object.attlist  "INCLUDE" >
+<![%object.attlist;[
+<!ATTLIST %object.qname;
+      %Common.attrib;
+      declare      ( declare )              #IMPLIED
+      classid      %URI.datatype;           #IMPLIED
+      codebase     %URI.datatype;           #IMPLIED
+      data         %URI.datatype;           #IMPLIED
+      type         %ContentType.datatype;   #IMPLIED
+      codetype     %ContentType.datatype;   #IMPLIED
+      archive      %URIs.datatype;          #IMPLIED
+      standby      %Text.datatype;          #IMPLIED
+      height       %Length.datatype;        #IMPLIED
+      width        %Length.datatype;        #IMPLIED
+      name         CDATA                    #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+>
+<!-- end of object.attlist -->]]>
+
+<!-- end of xhtml-object-1.mod -->
+
+
+<!-- Document Structure Module  ..................................... -->
+<!ENTITY % xhtml-struct.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
+            "../xhtml11/xhtml-struct-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Structure Module  .............................................. -->
+<!-- file: xhtml-struct-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-struct-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-struct-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Document Structure
+
+        title, head, body, html
+
+     The Structure Module defines the major structural elements and
+     their attributes.
+
+     Note that the content model of the head element type is redeclared
+     when the Base Module is included in the DTD.
+
+     The parameter entity containing the XML namespace URI value used
+     for XHTML is '%XHTML.xmlns;', defined in the Qualified Names module.
+-->
+
+<!-- title: Document Title ............................. -->
+
+<!-- The title element is not considered part of the flow of text.
+     It should be displayed, for example as the page header or
+     window title. Exactly one title is required per document.
+-->
+
+<!ENTITY % title.element  "INCLUDE" >
+<![%title.element;[
+<!ENTITY % title.content  "( #PCDATA )" >
+<!ENTITY % title.qname  "title" >
+<!ELEMENT %title.qname;  %title.content; >
+<!-- end of title.element -->]]>
+
+<!ENTITY % title.attlist  "INCLUDE" >
+<![%title.attlist;[
+<!ATTLIST %title.qname;
+      %XHTML.xmlns.attrib;
+      %I18n.attrib;
+>
+<!-- end of title.attlist -->]]>
+
+<!-- head: Document Head ............................... -->
+
+<!ENTITY % head.element  "INCLUDE" >
+<![%head.element;[
+<!ENTITY % head.content
+    "( %HeadOpts.mix;, %title.qname;, %HeadOpts.mix; )"
+>
+<!ENTITY % head.qname  "head" >
+<!ELEMENT %head.qname;  %head.content; >
+<!-- end of head.element -->]]>
+
+<!ENTITY % head.attlist  "INCLUDE" >
+<![%head.attlist;[
+<!-- reserved for future use with document profiles
+-->
+<!ENTITY % profile.attrib
+     "profile      %URI.datatype;           '%XHTML.profile;'"
+>
+
+<!ATTLIST %head.qname;
+      %XHTML.xmlns.attrib;
+      %I18n.attrib;
+      %profile.attrib;
+>
+<!-- end of head.attlist -->]]>
+
+<!-- body: Document Body ............................... -->
+
+<!ENTITY % body.element  "INCLUDE" >
+<![%body.element;[
+<!ENTITY % body.content
+     "( %Block.mix; )+"
+>
+<!ENTITY % body.qname  "body" >
+<!ELEMENT %body.qname;  %body.content; >
+<!-- end of body.element -->]]>
+
+<!ENTITY % body.attlist  "INCLUDE" >
+<![%body.attlist;[
+<!ATTLIST %body.qname;
+      %Common.attrib;
+>
+<!-- end of body.attlist -->]]>
+
+<!-- html: XHTML Document Element ...................... -->
+
+<!ENTITY % html.element  "INCLUDE" >
+<![%html.element;[
+<!ENTITY % html.content  "( %head.qname;, %body.qname; )" >
+<!ENTITY % html.qname  "html" >
+<!ELEMENT %html.qname;  %html.content; >
+<!-- end of html.element -->]]>
+
+<!ENTITY % html.attlist  "INCLUDE" >
+<![%html.attlist;[
+<!-- version attribute value defined in driver
+-->
+<!ENTITY % XHTML.version.attrib
+     "version      %FPI.datatype;           #FIXED '%XHTML.version;'"
+>
+
+<!-- see the Qualified Names module for information
+     on how to extend XHTML using XML namespaces
+-->
+<!ATTLIST %html.qname;
+      %XHTML.xmlns.attrib;
+      %XHTML.version.attrib;
+      %I18n.attrib;
+>
+<!-- end of html.attlist -->]]>
+
+<!-- end of xhtml-struct-1.mod -->
+
+
+<!-- Block Presentation ........................................ -->
+<!ENTITY % xhtml-blkpres.mod PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
+ 		"../xhtml11/xhtml-blkpres-1.mod">
+<!-- ...................................................................... -->
+<!-- XHTML Block Presentation Module  ..................................... -->
+<!-- file: xhtml-blkpres-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-blkpres-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-blkpres-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Block Presentational Elements
+
+        hr
+
+     This module declares the elements and their attributes used to
+     support block-level presentational markup.
+-->
+
+<!ENTITY % hr.element  "INCLUDE" >
+<![%hr.element;[
+<!ENTITY % hr.content  "EMPTY" >
+<!ENTITY % hr.qname  "hr" >
+<!ELEMENT %hr.qname;  %hr.content; >
+<!-- end of hr.element -->]]>
+
+<!ENTITY % hr.attlist  "INCLUDE" >
+<![%hr.attlist;[
+<!ATTLIST %hr.qname;
+      %Common.attrib;
+>
+<!-- end of hr.attlist -->]]>
+
+<!-- end of xhtml-blkpres-1.mod -->
+
+
+<!-- ========================================== -->
+<!--
+	Inline Presentation: b, big, i, small
+-->
+<!ENTITY % sub.element "IGNORE">
+<!ENTITY % sub.attlist "IGNORE">
+<!ENTITY % sup.element "IGNORE">
+<!ENTITY % sup.attlist "IGNORE">
+<!ENTITY % tt.element "IGNORE">
+<!ENTITY % tt.attlist "IGNORE">
+<!ENTITY % xhtml-inlpres.mod PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
+		"../xhtml11/xhtml-inlpres-1.mod">
+<!-- ...................................................................... -->
+<!-- XHTML Inline Presentation Module  .................................... -->
+<!-- file: xhtml-inlpres-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-inlpres-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
+       SYSTEM "../xhtml11/xhtml-inlpres-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Inline Presentational Elements
+
+        b, big, i, small, sub, sup, tt
+
+     This module declares the elements and their attributes used to
+     support inline-level presentational markup.
+-->
+
+<!ENTITY % b.element  "INCLUDE" >
+<![%b.element;[
+<!ENTITY % b.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % b.qname  "b" >
+<!ELEMENT %b.qname;  %b.content; >
+<!-- end of b.element -->]]>
+
+<!ENTITY % b.attlist  "INCLUDE" >
+<![%b.attlist;[
+<!ATTLIST %b.qname;
+      %Common.attrib;
+>
+<!-- end of b.attlist -->]]>
+
+<!ENTITY % big.element  "INCLUDE" >
+<![%big.element;[
+<!ENTITY % big.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % big.qname  "big" >
+<!ELEMENT %big.qname;  %big.content; >
+<!-- end of big.element -->]]>
+
+<!ENTITY % big.attlist  "INCLUDE" >
+<![%big.attlist;[
+<!ATTLIST %big.qname;
+      %Common.attrib;
+>
+<!-- end of big.attlist -->]]>
+
+<!ENTITY % i.element  "INCLUDE" >
+<![%i.element;[
+<!ENTITY % i.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % i.qname  "i" >
+<!ELEMENT %i.qname;  %i.content; >
+<!-- end of i.element -->]]>
+
+<!ENTITY % i.attlist  "INCLUDE" >
+<![%i.attlist;[
+<!ATTLIST %i.qname;
+      %Common.attrib;
+>
+<!-- end of i.attlist -->]]>
+
+<!ENTITY % small.element  "INCLUDE" >
+<![%small.element;[
+<!ENTITY % small.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % small.qname  "small" >
+<!ELEMENT %small.qname;  %small.content; >
+<!-- end of small.element -->]]>
+
+<!ENTITY % small.attlist  "INCLUDE" >
+<![%small.attlist;[
+<!ATTLIST %small.qname;
+      %Common.attrib;
+>
+<!-- end of small.attlist -->]]>
+
+<!ENTITY % sub.element  "INCLUDE" >
+<![%sub.element;[
+<!ENTITY % sub.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % sub.qname  "sub" >
+<!ELEMENT %sub.qname;  %sub.content; >
+<!-- end of sub.element -->]]>
+
+<!ENTITY % sub.attlist  "INCLUDE" >
+<![%sub.attlist;[
+<!ATTLIST %sub.qname;
+      %Common.attrib;
+>
+<!-- end of sub.attlist -->]]>
+
+<!ENTITY % sup.element  "INCLUDE" >
+<![%sup.element;[
+<!ENTITY % sup.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % sup.qname  "sup" >
+<!ELEMENT %sup.qname;  %sup.content; >
+<!-- end of sup.element -->]]>
+
+<!ENTITY % sup.attlist  "INCLUDE" >
+<![%sup.attlist;[
+<!ATTLIST %sup.qname;
+      %Common.attrib;
+>
+<!-- end of sup.attlist -->]]>
+
+<!ENTITY % tt.element  "INCLUDE" >
+<![%tt.element;[
+<!ENTITY % tt.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % tt.qname  "tt" >
+<!ELEMENT %tt.qname;  %tt.content; >
+<!-- end of tt.element -->]]>
+
+<!ENTITY % tt.attlist  "INCLUDE" >
+<![%tt.attlist;[
+<!ATTLIST %tt.qname;
+      %Common.attrib;
+>
+<!-- end of tt.attlist -->]]>
+
+<!-- end of xhtml-inlpres-1.mod -->
+
+
+<!-- end of XHTML Mobile 1.0 DTD  ........................................... -->
\ No newline at end of file
diff --git a/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile10-model-1.mod b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile10-model-1.mod
new file mode 100644
index 0000000..3ca3da8
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile10-model-1.mod
@@ -0,0 +1,167 @@
+<!-- ....................................................................... -->
+<!-- XHTML Mobile 1.0 Document Model Module
+.................................... -->
+<!-- file: xhtml-mobile10-model-1.mod
+
+     This is XHTML Mobile, a proper subset of XHTML.
+     	@Wireless Application Protocol Forum, Ltd. 2001.
+
+	Terms and conditions of use are available from the Wireless
+	Application Protocol Forum Ltd.
+	Web site (http://www.wapforum.org/what/copyright.htm).
+
+-->
+<!-- XHTML Mobile Document Model
+
+     This module describes the groupings of elements that make up
+     common content models for XHTML elements.
+-->
+
+<!-- Optional Elements in head  .............. -->
+
+<!ENTITY % HeadOpts.mix
+
+     "( %meta.qname; | %link.qname; | %object.qname; | %style.qname;
+     )*" >
+
+<!-- Miscellaneous Elements  ................. -->
+
+<!ENTITY % Misc.class "" >
+
+<!-- Inline Elements  ........................ -->
+
+<!ENTITY % InlStruct.class "%br.qname; | %span.qname;" >
+
+<!ENTITY % InlPhras.class
+     "| %em.qname; | %strong.qname; | %dfn.qname; | %code.qname;
+      | %samp.qname; | %kbd.qname; | %var.qname; | %cite.qname;
+      | %abbr.qname; | %acronym.qname; | %q.qname;" >
+
+<!ENTITY % InlPres.class
+     "| %i.qname; | %b.qname; | %big.qname; | %small.qname; " >
+
+
+<!ENTITY % I18n.class "" >
+
+<!ENTITY % Anchor.class "| %a.qname;" >
+
+<!ENTITY % InlSpecial.class "| %img.qname; | %object.qname;" >
+
+<!ENTITY % InlForm.class
+     "| %input.qname; | %select.qname; | %textarea.qname;
+      | %label.qname;"
+>
+
+<!ENTITY % Inline.extra "" >
+
+<!ENTITY % Inline.class
+     "%InlStruct.class;
+      %InlPhras.class;
+      %InlPres.class;
+      %Anchor.class;
+      %InlSpecial.class;
+      %InlForm.class;
+      %Inline.extra;"
+>
+
+<!ENTITY % InlNoAnchor.class
+     "%InlStruct.class;
+      %InlPhras.class;
+      %InlPres.class;      
+      %InlSpecial.class;
+      %InlForm.class;
+      %Inline.extra;"
+>
+
+<!ENTITY % InlNoAnchor.mix
+     "%InlNoAnchor.class;
+      %Misc.class;"
+>
+
+<!ENTITY % Inline.mix
+     "%Inline.class;
+      %Misc.class;"
+>
+
+<!-- Block Elements  ......................... -->
+
+<!ENTITY % Heading.class
+     "%h1.qname; | %h2.qname; | %h3.qname;
+      | %h4.qname; | %h5.qname; | %h6.qname;"
+>
+<!ENTITY % List.class  "%ul.qname; | %ol.qname; | %dl.qname;" >
+
+<!ENTITY % Table.class "| %table.qname;" >
+
+<!ENTITY % Form.class  "| %form.qname;" >
+
+<!ENTITY % Fieldset.class  "| %fieldset.qname;" >
+
+<!ENTITY % BlkStruct.class "%p.qname; | %div.qname;" >
+
+<!ENTITY % BlkPhras.class
+     "| %pre.qname; | %blockquote.qname; | %address.qname;"
+>
+
+<!ENTITY % BlkPres.class "| %hr.qname;" >
+
+<!ENTITY % BlkSpecial.class
+     "%Table.class;
+      %Form.class;
+      %Fieldset.class;"
+>
+
+<!ENTITY % Block.extra "" >
+
+<!ENTITY % Block.class
+     "%BlkStruct.class;
+      %BlkPhras.class;
+      %BlkPres.class;
+      %BlkSpecial.class;
+      %Block.extra;"
+>
+
+<!ENTITY % BlkNoForm.mix
+     "%Heading.class;
+      | %List.class;
+      | %BlkStruct.class;
+      %BlkPhras.class;
+      %BlkPres.class;
+      %Table.class;
+      %Block.extra;
+      %Misc.class;"
+>
+
+<!ENTITY % Block.mix
+     "%Heading.class;
+      | %List.class;
+      | %Block.class;
+      %Misc.class;"
+>
+
+<!-- All Content Elements  ................... -->
+
+<!-- declares all content except tables
+-->
+<!ENTITY % FlowNoTable.mix
+     "%Heading.class;
+      | %List.class;
+      | %BlkStruct.class;
+      %BlkPhras.class;
+      %Form.class;
+      %Block.extra;
+      | %Inline.class;
+      %Misc.class;"
+>
+
+
+<!ENTITY % Flow.mix
+     "%Heading.class;
+      | %List.class;
+      | %Block.class;
+      | %Inline.class;
+      %Misc.class;"
+>
+
+<!-- end of xhtml-mobile10-model-1.mod -->
+
diff --git a/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile10.dtd b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile10.dtd
new file mode 100644
index 0000000..fbd62a7
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile10.dtd
@@ -0,0 +1,189 @@
+<!-- XHTML Mobile 1.0 DTD  ...................................................... -->
+<!-- file: xhtml-mobile10.dtd -->
+<!-- 
+     This is XHTML Mobile profile, a proper subset of XHTML.
+     
+     	@Wireless Application Protocol Forum, Ltd. 2001.
+
+	Terms and conditions of use are available from the Wireless Application Protocol Forum Ltd. 
+	Web site (http://www.wapforum.org/what/copyright.htm).
+    
+-->
+<!-- This is the driver file for version 1.0 of the XHTML Mobile DTD.
+
+     This DTD is identified by the PUBLIC and SYSTEM identifiers:
+
+     PUBLIC: "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
+     SYSTEM: "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"
+-->
+<!ENTITY % XHTML.version  "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" >
+
+<!-- Use this URI to identify the default namespace:
+
+         "http://www.w3.org/1999/xhtml"
+
+     See the Qualified Names module for information
+     on the use of namespace prefixes in the DTD.
+-->
+<!ENTITY % NS.prefixed "IGNORE" >
+<!ENTITY % XHTML.prefix  "" >
+
+<!-- For example, if you are using XHTML Mobile 1.0 directly, use
+     the FPI in the DOCTYPE declaration, with the xmlns attribute
+     on the document element to identify the default namespace:
+
+         <?xml version="1.0"?>
+         <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
+             "http://www.wapforum.org/DTD/xhtml-mobile10.dtd" >
+         <html xmlns="http://www.w3.org/1999/xhtml"
+               xml:lang="en" >
+         ...
+         </html>
+-->
+
+<!-- reserved for future use with document profiles -->
+<!ENTITY % XHTML.profile  "" >
+
+<!-- Inline Style Module  ........................................ -->
+<!ENTITY % xhtml-inlstyle.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Inline Style 1.0//EN"
+            "../xhtml11/xhtml-inlstyle-1.mod" >
+%xhtml-inlstyle.mod;
+
+<!-- Document Model ........................................ -->
+<!ENTITY % xhtml-model.mod
+     PUBLIC "-//WAPFORUM//ENTITIES XHTML Mobile 1.0 Document Model 1.0//EN"
+            "xhtml-mobile10-model-1.mod" >
+
+<!-- XHTML Framework ........................................ -->
+<!ENTITY % XHTML.bidi  "IGNORE" >
+<!ENTITY % xhtml-framework.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
+            "../xhtml11/xhtml-framework-1.mod" >
+%xhtml-framework.mod;
+
+<!-- XHTML Core Modules ........................................ -->
+<!ENTITY % pre.content
+     "( #PCDATA
+      | %InlStruct.class;
+      %InlPhras.class;
+      %Anchor.class;
+      %Inline.extra; )*"
+>
+
+<!ENTITY % xhtml-text.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
+            "../xhtml11/xhtml-text-1.mod" >
+%xhtml-text.mod;
+
+<!ENTITY % xhtml-hypertext.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
+            "../xhtml11/xhtml-hypertext-1.mod" >
+%xhtml-hypertext.mod;
+
+<!ENTITY % xhtml-list.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
+            "../xhtml11/xhtml-list-1.mod" >
+%xhtml-list.mod;
+<!-- Extend lists with value and start attributes --> 
+<!ATTLIST %li.qname;
+      value        %Number.datatype;         #IMPLIED
+>
+<!ATTLIST %ol.qname;
+      start        %Number.datatype;        #IMPLIED
+>
+
+<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
+
+<!-- Image Module  ............................................... -->
+<!ENTITY % xhtml-image.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
+            "../xhtml11/xhtml-image-1.mod" >
+%xhtml-image.mod;
+
+<!-- Tables Module ............................................... -->
+<!ENTITY % xhtml-table.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN"
+            "../xhtml11/xhtml-basic-table-1.mod" >
+%xhtml-table.mod;
+
+<!-- Forms Module  ............................................... 
+	XHTML basic forms module extended with optgroup and fieldset
+-->
+<!ELEMENT %optgroup.qname; (%option.qname;)+>
+<!ATTLIST %optgroup.qname;
+	%Common.attrib; 
+	label %Text.datatype; #REQUIRED
+>
+<!ENTITY % select.content "( %optgroup.qname; | %option.qname; )+">
+<!ELEMENT %fieldset.qname; (#PCDATA | %Flow.mix;)*>
+<!ATTLIST %fieldset.qname;
+	%Common.attrib; 
+>
+<!ENTITY % form.content "( %BlkNoForm.mix; | %fieldset.qname; )+">
+<!ENTITY % xhtml-form.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Basic Forms 1.0//EN"
+            "../xhtml11/xhtml-basic-form-1.mod" >
+%xhtml-form.mod;
+
+<!-- Link Element Module  ........................................ -->
+<!ENTITY % xhtml-link.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
+            "../xhtml11/xhtml-link-1.mod" >
+%xhtml-link.mod;
+
+<!-- Document Metainformation Module  ............................ -->
+<!ENTITY % xhtml-meta.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
+            "../xhtml11/xhtml-meta-1.mod" >
+%xhtml-meta.mod;
+
+<!-- Base Element Module  ........................................ -->
+<!ENTITY % xhtml-base.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
+            "../xhtml11/xhtml-base-1.mod" >
+%xhtml-base.mod;
+
+<!-- Stylesheets Module  ......................................... -->
+<!ENTITY % xhtml-style.mod PUBLIC "-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN"
+            "../xhtml11/xhtml-style-1.mod">
+%xhtml-style.mod;
+
+<!-- Param Element Module  ....................................... -->
+<!ENTITY % xhtml-param.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
+            "../xhtml11/xhtml-param-1.mod" >
+%xhtml-param.mod;
+
+<!-- Embedded Object Module  ..................................... -->
+<!ENTITY % xhtml-object.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
+            "../xhtml11/xhtml-object-1.mod" >
+%xhtml-object.mod;
+
+<!-- Document Structure Module  ..................................... -->
+<!ENTITY % xhtml-struct.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
+            "../xhtml11/xhtml-struct-1.mod" >
+%xhtml-struct.mod;
+
+<!-- Block Presentation ........................................ -->
+<!ENTITY % xhtml-blkpres.mod PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
+ 		"../xhtml11/xhtml-blkpres-1.mod">
+%xhtml-blkpres.mod;
+
+<!-- ========================================== -->
+<!-- 
+	Inline Presentation: b, big, i, small		
+-->
+<!ENTITY % sub.element "IGNORE">
+<!ENTITY % sub.attlist "IGNORE">
+<!ENTITY % sup.element "IGNORE">
+<!ENTITY % sup.attlist "IGNORE">
+<!ENTITY % tt.element "IGNORE">
+<!ENTITY % tt.attlist "IGNORE">
+<!ENTITY % xhtml-inlpres.mod PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
+		"../xhtml11/xhtml-inlpres-1.mod">
+%xhtml-inlpres.mod;
+
+<!-- end of XHTML Mobile 1.0 DTD  ........................................... -->
\ No newline at end of file
diff --git a/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile12-form.mod b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile12-form.mod
new file mode 100644
index 0000000..415fc61
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile12-form.mod
@@ -0,0 +1,351 @@
+<!--
+    FILE INFORMATION
+
+    OMA Permanent Document
+       File: OMA-SUP-MOD_xhtml_mobile12-form-V1_2-20080331-A
+       Type: Text
+
+    Public Reachable Information
+       Path: http://www.openmobilealliance.org/tech/DTD
+       Name: xhtml-mobile12-form.mod
+
+    NORMATIVE INFORMATION
+
+    Information about this file can be found in the specification
+     OMA-TS-XHTMLMP-V1_2-20080331-A available at
+       http://www.openmobilealliance.org/
+
+    Send comments to [email protected]
+	
+    LEGAL DISCLAIMER
+
+    Use of this document is subject to all of the terms and conditions
+    of the Use Agreement located at
+        http://www.openmobilealliance.org/UseAgreement.html
+
+    You may use this document or any part of the document for internal
+    or educational purposes only, provided you do not modify, edit or
+    take out of context the information in this document in any manner.
+    Information contained in this document may be used, at your sole
+    risk, for any purposes.
+
+    You may not use this document in any other manner without the prior
+    written permission of the Open Mobile Alliance.  The Open Mobile
+    Alliance authorizes you to copy this document, provided that you
+    retain all copyright and other proprietary notices contained in the
+    original materials on any copies of the materials and that you
+    comply strictly with these terms.  This copyright permission does
+    not constitute an endorsement of the products or services.  The
+    Open Mobile Alliance assumes no responsibility for errors or
+    omissions in this document.
+
+    Each Open Mobile Alliance member has agreed to use reasonable
+    endeavors to inform the Open Mobile Alliance in a timely manner of
+    Essential IPR as it becomes aware that the Essential IPR is related
+    to the prepared or published specification.  However, the members
+    do not have an obligation to conduct IPR searches.  The declared
+    Essential IPR is publicly available to members and non-members of
+    the Open Mobile Alliance and may be found on the "OMA IPR
+    Declarations" list at http://www.openmobilealliance.org/ipr.html.
+    The Open Mobile Alliance has not conducted an independent IPR review
+    of this document and the information contained herein, and makes no
+    representations or warranties regarding third party IPR, including
+    without limitation patents, copyrights or trade secret rights.  This
+    document may contain inventions for which you must obtain licenses
+    from third parties before making, using or selling the inventions.
+    Defined terms above are set forth in the schedule to the Open Mobile
+    Alliance Application Form.
+
+    NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE
+    MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER
+    OR ITS AFFILIATES REGARDING ANY OF THE IPR'S REPRESENTED ON THE "OMA
+    IPR DECLARATIONS" LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY,
+    COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR     
+    NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL.
+
+    THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY
+    DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR
+    EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF
+    DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS.
+
+    Copyright 2008 Open Mobile Alliance Ltd.  All Rights Reserved.
+    Used with the permission of the Open Mobile Alliance Ltd. under the
+    terms set forth above.
+-->
+
+<!-- Forms
+
+        form, label, input, select, optgroup, option,
+        textarea, fieldset, legend, button
+
+     This module declares markup to provide support for online
+     forms, based on the features found in HTML 4 forms.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % form.qname  "form" >
+<!ENTITY % label.qname  "label" >
+<!ENTITY % input.qname  "input" >
+<!ENTITY % select.qname  "select" >
+<!ENTITY % optgroup.qname  "optgroup" >
+<!ENTITY % option.qname  "option" >
+<!ENTITY % textarea.qname  "textarea" >
+<!ENTITY % fieldset.qname  "fieldset" >
+<!ENTITY % legend.qname  "legend" >
+<!ENTITY % button.qname  "button" >
+
+<!-- %BlkNoForm.mix; includes all non-form block elements,
+     plus %Misc.class;
+-->
+<!ENTITY % BlkNoForm.mix
+     "%Heading.class;
+      | %List.class;
+      | %BlkStruct.class;
+      %BlkPhras.class;
+      %BlkPres.class;
+      %Table.class;
+      %Block.extra;
+      %Misc.class;"
+>
+
+<!-- form: Form Element ................................ -->
+
+<!ENTITY % form.element  "INCLUDE" >
+<![%form.element;[
+<!ENTITY % form.content
+     "( %BlkNoForm.mix;
+      | %fieldset.qname; )+"
+>
+<!ELEMENT %form.qname;  %form.content; >
+<!-- end of form.element -->]]>
+
+<!ENTITY % form.attlist  "INCLUDE" >
+<![%form.attlist;[
+<!ATTLIST %form.qname;
+      %Common.attrib;
+      action       %URI.datatype;           #REQUIRED
+      method       ( get | post )           'get'
+      enctype      %ContentType.datatype;   'application/x-www-form-urlencoded'
+      accept-charset %Charsets.datatype;    #IMPLIED
+      accept       %ContentTypes.datatype;  #IMPLIED
+>
+<!-- end of form.attlist -->]]>
+
+<!-- label: Form Field Label Text ...................... -->
+
+<!-- Each label must not contain more than ONE field
+-->
+
+<!ENTITY % label.element  "INCLUDE" >
+<![%label.element;[
+<!ENTITY % label.content
+     "( #PCDATA
+      | %input.qname; | %select.qname; | %textarea.qname; | %button.qname;
+      | %InlStruct.class;
+      %InlPhras.class;
+      %I18n.class;
+      %InlPres.class;
+      %Anchor.class;
+      %InlSpecial.class;
+      %Inline.extra;
+      %Misc.class; )*"
+>
+<!ELEMENT %label.qname;  %label.content; >
+<!-- end of label.element -->]]>
+
+<!ENTITY % label.attlist  "INCLUDE" >
+<![%label.attlist;[
+<!ATTLIST %label.qname;
+      %Common.attrib;
+      for          IDREF                    #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of label.attlist -->]]>
+
+<!-- input: Form Control ............................... -->
+
+<!ENTITY % input.element  "INCLUDE" >
+<![%input.element;[
+<!ENTITY % input.content  "EMPTY" >
+<!ELEMENT %input.qname;  %input.content; >
+<!-- end of input.element -->]]>
+
+<!ENTITY % input.attlist  "INCLUDE" >
+<![%input.attlist;[
+<!ENTITY % InputType.class
+     "( text | password | checkbox | radio | submit
+      | reset | file | hidden | image | button )"
+>
+<!-- attribute 'name' required for all but submit & reset
+-->
+<!ATTLIST %input.qname;
+      %Common.attrib;
+      type         %InputType.class;        'text'
+      name         CDATA                    #IMPLIED
+      value        CDATA                    #IMPLIED
+      checked      ( checked )              #IMPLIED
+      disabled     ( disabled )             #IMPLIED
+      readonly     ( readonly )             #IMPLIED
+      size         %Number.datatype;        #IMPLIED
+      maxlength    %Number.datatype;        #IMPLIED
+      src          %URI.datatype;           #IMPLIED
+      alt          %Text.datatype;          #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+      accept       %ContentTypes.datatype;  #IMPLIED
+      inputmode    CDATA                    #IMPLIED
+>
+<!-- end of input.attlist -->]]>
+
+<!-- select: Option Selector ........................... -->
+
+<!ENTITY % select.element  "INCLUDE" >
+<![%select.element;[
+<!ENTITY % select.content
+     "( %optgroup.qname; | %option.qname; )+"
+>
+<!ELEMENT %select.qname;  %select.content; >
+<!-- end of select.element -->]]>
+
+<!ENTITY % select.attlist  "INCLUDE" >
+<![%select.attlist;[
+<!ATTLIST %select.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      size         %Number.datatype;        #IMPLIED
+      multiple     ( multiple )             #IMPLIED
+      disabled     ( disabled )             #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+>
+<!-- end of select.attlist -->]]>
+
+<!-- optgroup: Option Group ............................ -->
+
+<!ENTITY % optgroup.element  "INCLUDE" >
+<![%optgroup.element;[
+<!ENTITY % optgroup.content  "( %option.qname; )+" >
+<!ELEMENT %optgroup.qname;  %optgroup.content; >
+<!-- end of optgroup.element -->]]>
+
+<!ENTITY % optgroup.attlist  "INCLUDE" >
+<![%optgroup.attlist;[
+<!ATTLIST %optgroup.qname;
+      %Common.attrib;
+      disabled     ( disabled )             #IMPLIED
+      label        %Text.datatype;          #REQUIRED
+>
+<!-- end of optgroup.attlist -->]]>
+
+<!-- option: Selectable Choice ......................... -->
+
+<!ENTITY % option.element  "INCLUDE" >
+<![%option.element;[
+<!ENTITY % option.content  "( #PCDATA )" >
+<!ELEMENT %option.qname;  %option.content; >
+<!-- end of option.element -->]]>
+
+<!ENTITY % option.attlist  "INCLUDE" >
+<![%option.attlist;[
+<!ATTLIST %option.qname;
+      %Common.attrib;
+      selected     ( selected )             #IMPLIED
+      disabled     ( disabled )             #IMPLIED
+      label        %Text.datatype;          #IMPLIED
+      value        CDATA                    #IMPLIED
+>
+<!-- end of option.attlist -->]]>
+
+<!-- textarea: Multi-Line Text Field ................... -->
+
+<!ENTITY % textarea.element  "INCLUDE" >
+<![%textarea.element;[
+<!ENTITY % textarea.content  "( #PCDATA )" >
+<!ELEMENT %textarea.qname;  %textarea.content; >
+<!-- end of textarea.element -->]]>
+
+<!ENTITY % textarea.attlist  "INCLUDE" >
+<![%textarea.attlist;[
+<!ATTLIST %textarea.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      rows         %Number.datatype;        #REQUIRED
+      cols         %Number.datatype;        #REQUIRED
+      disabled     ( disabled )             #IMPLIED
+      readonly     ( readonly )             #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+      inputmode    CDATA                    #IMPLIED
+>
+<!-- end of textarea.attlist -->]]>
+
+<!-- fieldset: Form Control Group ...................... -->
+
+<!-- #PCDATA is to solve the mixed content problem,
+     per specification only whitespace is allowed
+-->
+
+<!ENTITY % fieldset.element  "INCLUDE" >
+<![%fieldset.element;[
+<!ENTITY % fieldset.content
+     "( #PCDATA | %legend.qname; | %Flow.mix; )*"
+>
+<!ELEMENT %fieldset.qname;  %fieldset.content; >
+<!-- end of fieldset.element -->]]>
+
+<!ENTITY % fieldset.attlist  "INCLUDE" >
+<![%fieldset.attlist;[
+<!ATTLIST %fieldset.qname;
+      %Common.attrib;
+>
+<!-- end of fieldset.attlist -->]]>
+
+<!-- legend: Fieldset Legend ........................... -->
+
+<!ENTITY % legend.element  "INCLUDE" >
+<![%legend.element;[
+<!ENTITY % legend.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %legend.qname;  %legend.content; >
+<!-- end of legend.element -->]]>
+
+<!ENTITY % legend.attlist  "INCLUDE" >
+<![%legend.attlist;[
+<!ATTLIST %legend.qname;
+      %Common.attrib;
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of legend.attlist -->]]>
+
+<!-- button: Push Button ............................... -->
+
+<!ENTITY % button.element  "INCLUDE" >
+<![%button.element;[
+<!ENTITY % button.content
+     "( #PCDATA
+      | %BlkNoForm.mix;
+      | %InlStruct.class;
+      %InlPhras.class;
+      %InlPres.class;
+      %I18n.class;
+      %InlSpecial.class;
+      %Inline.extra; )*"
+>
+<!ELEMENT %button.qname;  %button.content; >
+<!-- end of button.element -->]]>
+
+<!ENTITY % button.attlist  "INCLUDE" >
+<![%button.attlist;[
+<!ATTLIST %button.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      value        CDATA                    #IMPLIED
+      type         ( button | submit | reset ) 'submit'
+      disabled     ( disabled )             #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of button.attlist -->]]>
+
+<!-- end of xhtml-form-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile12-model-1.mod b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile12-model-1.mod
new file mode 100644
index 0000000..9beb71a
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile12-model-1.mod
@@ -0,0 +1,237 @@
+<!--
+    FILE INFORMATION
+
+    OMA Permanent Document
+       File: OMA-SUP-MOD_xhtml_mobile12-model-1-V1_2-20080331-A
+       Type: Text
+
+    Public Reachable Information
+       Path: http://www.openmobilealliance.org/tech/DTD
+       Name: xhtml-mobile12-model-1.mod
+
+    NORMATIVE INFORMATION
+
+    Information about this file can be found in the specification
+    OMA-TS-XHTMLMP-V1_2-20080331-A available at
+       http://www.openmobilealliance.org/
+
+    Send comments to [email protected]
+	
+    LEGAL DISCLAIMER
+
+    Use of this document is subject to all of the terms and conditions
+    of the Use Agreement located at
+        http://www.openmobilealliance.org/UseAgreement.html
+
+    You may use this document or any part of the document for internal
+    or educational purposes only, provided you do not modify, edit or
+    take out of context the information in this document in any manner.
+    Information contained in this document may be used, at your sole
+    risk, for any purposes.
+
+    You may not use this document in any other manner without the prior
+    written permission of the Open Mobile Alliance.  The Open Mobile
+    Alliance authorizes you to copy this document, provided that you
+    retain all copyright and other proprietary notices contained in the
+    original materials on any copies of the materials and that you
+    comply strictly with these terms.  This copyright permission does
+    not constitute an endorsement of the products or services.  The
+    Open Mobile Alliance assumes no responsibility for errors or
+    omissions in this document.
+
+    Each Open Mobile Alliance member has agreed to use reasonable
+    endeavors to inform the Open Mobile Alliance in a timely manner of
+    Essential IPR as it becomes aware that the Essential IPR is related
+    to the prepared or published specification.  However, the members
+    do not have an obligation to conduct IPR searches.  The declared
+    Essential IPR is publicly available to members and non-members of
+    the Open Mobile Alliance and may be found on the "OMA IPR
+    Declarations" list at http://www.openmobilealliance.org/ipr.html.
+    The Open Mobile Alliance has not conducted an independent IPR review
+    of this document and the information contained herein, and makes no
+    representations or warranties regarding third party IPR, including
+    without limitation patents, copyrights or trade secret rights.  This
+    document may contain inventions for which you must obtain licenses
+    from third parties before making, using or selling the inventions.
+    Defined terms above are set forth in the schedule to the Open Mobile
+    Alliance Application Form.
+
+    NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE
+    MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER
+    OR ITS AFFILIATES REGARDING ANY OF THE IPR'S REPRESENTED ON THE "OMA
+    IPR DECLARATIONS" LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY,
+    COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR     
+    NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL.
+
+    THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY
+    DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR
+    EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF
+    DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS.
+
+    Copyright 2008 Open Mobile Alliance Ltd.  All Rights Reserved.
+    Used with the permission of the Open Mobile Alliance Ltd. under the
+    terms set forth above.
+-->
+<!-- XHTML Mobile Document Model
+
+     This module describes the groupings of elements that make up
+     common content models for XHTML elements.
+-->
+
+<!-- Optional Elements in head  .............. -->
+
+<!ENTITY % HeadOpts.mix
+
+     "( %script.qname; | %meta.qname; | %link.qname; | %object.qname; | %style.qname;
+     )*" >
+
+
+<!-- Miscellaneous Elements  ................. -->
+
+<!ENTITY % Script.class "| %script.qname; | %noscript.qname;" >
+
+<!ENTITY % Misc.extra "" >
+
+<!ENTITY % Misc.class
+      "%Script.class;
+      %Misc.extra;"
+>
+
+<!-- Inline Elements  ........................ -->
+
+<!ENTITY % InlStruct.class "%br.qname; | %span.qname;" >
+
+<!ENTITY % InlPhras.class
+     "| %em.qname; | %strong.qname; | %dfn.qname; | %code.qname;
+      | %samp.qname; | %kbd.qname; | %var.qname; | %cite.qname;
+      | %abbr.qname; | %acronym.qname; | %q.qname;" >
+
+<!ENTITY % InlPres.class
+     "| %i.qname; | %b.qname; | %big.qname; | %small.qname; " >
+
+
+<!ENTITY % I18n.class "" >
+
+<!ENTITY % Anchor.class "| %a.qname;" >
+
+<!ENTITY % InlSpecial.class "| %img.qname; | %object.qname;" >
+
+<!ENTITY % InlForm.class
+     "| %input.qname; | %select.qname; | %textarea.qname;
+      | %label.qname; | %button.qname;"
+>
+<!-- yam added button.qname 060612 -->
+
+<!ENTITY % Inline.extra "" >
+
+<!ENTITY % Inline.class
+     "%InlStruct.class;
+      %InlPhras.class;
+      %InlPres.class;
+      %Anchor.class;
+      %InlSpecial.class;
+      %InlForm.class;
+      %Inline.extra;"
+>
+
+<!ENTITY % InlNoAnchor.class
+     "%InlStruct.class;
+      %InlPhras.class;
+      %InlPres.class;      
+      %InlSpecial.class;
+      %InlForm.class;
+      %Inline.extra;"
+>
+
+<!ENTITY % InlNoAnchor.mix
+     "%InlNoAnchor.class;
+      %Misc.class;"
+>
+
+<!ENTITY % Inline.mix
+     "%Inline.class;
+      %Misc.class;"
+>
+
+<!-- Block Elements  ......................... -->
+
+<!ENTITY % Heading.class
+     "%h1.qname; | %h2.qname; | %h3.qname;
+      | %h4.qname; | %h5.qname; | %h6.qname;"
+>
+<!ENTITY % List.class  "%ul.qname; | %ol.qname; | %dl.qname;" >
+
+<!ENTITY % Table.class "| %table.qname;" >
+
+<!ENTITY % Form.class  "| %form.qname;" >
+
+<!ENTITY % Fieldset.class  "| %fieldset.qname;" >
+
+<!ENTITY % BlkStruct.class "%p.qname; | %div.qname;" >
+
+<!ENTITY % BlkPhras.class
+     "| %pre.qname; | %blockquote.qname; | %address.qname;"
+>
+
+<!ENTITY % BlkPres.class "| %hr.qname;" >
+
+<!ENTITY % BlkSpecial.class
+     "%Table.class;
+      %Form.class;
+      %Fieldset.class;"
+>
+
+<!ENTITY % Block.extra "" >
+
+<!ENTITY % Block.class
+     "%BlkStruct.class;
+      %BlkPhras.class;
+      %BlkPres.class;
+      %BlkSpecial.class;
+      %Block.extra;"
+>
+
+<!ENTITY % BlkNoForm.mix
+     "%Heading.class;
+      | %List.class;
+      | %BlkStruct.class;
+      %BlkPhras.class;
+      %BlkPres.class;
+      %Table.class;
+      %Block.extra;
+      %Misc.class;"
+>
+
+<!ENTITY % Block.mix
+     "%Heading.class;
+      | %List.class;
+      | %Block.class;
+      %Misc.class;"
+>
+
+<!-- All Content Elements  ................... -->
+
+<!-- declares all content except tables
+-->
+<!ENTITY % FlowNoTable.mix
+     "%Heading.class;
+      | %List.class;
+      | %BlkStruct.class;
+      %BlkPhras.class;
+      %Form.class;
+      %Block.extra;
+      | %Inline.class;
+      %Misc.class;"
+>
+
+
+<!ENTITY % Flow.mix
+     "%Heading.class;
+      | %List.class;
+      | %Block.class;
+      | %Inline.class;
+      %Misc.class;"
+>
+
+<!-- end of xhtml-mobile12-model-1.mod -->
+
diff --git a/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile12.dtd b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile12.dtd
new file mode 100644
index 0000000..745c736
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtml-mobile12.dtd
@@ -0,0 +1,248 @@
+<!--
+    FILE INFORMATION
+
+    OMA Permanent Document
+       File: OMA-SUP-DTD_xhtml_mobile12-V1_2-20080331-A
+       Type: Text
+
+    Public Reachable Information
+       Path: http://www.openmobilealliance.org/tech/DTD
+       Name: xhtml-mobile12.dtd
+
+    NORMATIVE INFORMATION
+
+    Information about this file can be found in the specification
+     OMA-TS-XHTMLMP-V1_2-20080331-A available at
+       http://www.openmobilealliance.org/
+
+    Send comments to [email protected]
+	
+    LEGAL DISCLAIMER
+
+    Use of this document is subject to all of the terms and conditions
+    of the Use Agreement located at
+        http://www.openmobilealliance.org/UseAgreement.html
+
+    You may use this document or any part of the document for internal
+    or educational purposes only, provided you do not modify, edit or
+    take out of context the information in this document in any manner.
+    Information contained in this document may be used, at your sole
+    risk, for any purposes.
+
+    You may not use this document in any other manner without the prior
+    written permission of the Open Mobile Alliance.  The Open Mobile
+    Alliance authorizes you to copy this document, provided that you
+    retain all copyright and other proprietary notices contained in the
+    original materials on any copies of the materials and that you
+    comply strictly with these terms.  This copyright permission does
+    not constitute an endorsement of the products or services.  The
+    Open Mobile Alliance assumes no responsibility for errors or
+    omissions in this document.
+
+    Each Open Mobile Alliance member has agreed to use reasonable
+    endeavors to inform the Open Mobile Alliance in a timely manner of
+    Essential IPR as it becomes aware that the Essential IPR is related
+    to the prepared or published specification.  However, the members
+    do not have an obligation to conduct IPR searches.  The declared
+    Essential IPR is publicly available to members and non-members of
+    the Open Mobile Alliance and may be found on the "OMA IPR
+    Declarations" list at http://www.openmobilealliance.org/ipr.html.
+    The Open Mobile Alliance has not conducted an independent IPR review
+    of this document and the information contained herein, and makes no
+    representations or warranties regarding third party IPR, including
+    without limitation patents, copyrights or trade secret rights.  This
+    document may contain inventions for which you must obtain licenses
+    from third parties before making, using or selling the inventions.
+    Defined terms above are set forth in the schedule to the Open Mobile
+    Alliance Application Form.
+
+    NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE
+    MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER
+    OR ITS AFFILIATES REGARDING ANY OF THE IPR'S REPRESENTED ON THE "OMA
+    IPR DECLARATIONS" LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY,
+    COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR     
+    NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL.
+
+    THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY
+    DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR
+    EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF
+    DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS.
+
+    Copyright 2008 Open Mobile Alliance Ltd.  All Rights Reserved.
+    Used with the permission of the Open Mobile Alliance Ltd. under the
+    terms set forth above.
+-->
+<!-- This is the driver file for version 1.2 of the XHTML Mobile DTD.
+
+     This DTD is identified by the PUBLIC and SYSTEM identifiers:
+
+     PUBLIC: "-//OMA//DTD XHTML Mobile 1.2//EN"
+     SYSTEM: "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd"
+-->
+<!ENTITY % XHTML.version  "-//OMA//DTD XHTML Mobile 1.2//EN" >
+
+<!-- Use this URI to identify the default namespace:
+
+         "http://www.w3.org/1999/xhtml"
+
+     See the Qualified Names module for information
+     on the use of namespace prefixes in the DTD.
+-->
+<!ENTITY % NS.prefixed "IGNORE" >
+<!ENTITY % XHTML.prefix  "" >
+
+<!-- For example, if you are using XHTML Mobile 1.2 directly, use
+     the FPI in the DOCTYPE declaration, with the xmlns attribute
+     on the document element to identify the default namespace:
+
+         <?xml version="1.0"?>
+         <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
+             "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd" >
+         <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+         ...
+         </html>
+-->
+
+<!-- Reserved for future use with document profiles -->
+<!ENTITY % XHTML.profile  "" >
+
+<!-- Intrinsic Events Module  ................................................... -->
+<!ENTITY % xhtml-events.module "INCLUDE" >
+
+<!-- Inline Style Module  ....................................................... -->
+<!ENTITY % xhtml-inlstyle.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Inline Style 1.0//EN"
+            "../xhtml11/xhtml-inlstyle-1.mod" >
+%xhtml-inlstyle.mod;
+
+<!-- Document Model ............................................................. -->
+<!ENTITY % xhtml-model.mod
+     PUBLIC "-//OMA//ENTITIES XHTML Mobile 1.2 Document Model 1.0//EN"
+            "xhtml-mobile12-model-1.mod" >
+
+<!-- XHTML Framework ............................................................ -->
+<!ENTITY % XHTML.bidi  "IGNORE" >
+<!ENTITY % xhtml-framework.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
+            "../xhtml11/xhtml-framework-1.mod" >
+%xhtml-framework.mod;
+
+<!-- XHTML Core Modules ......................................................... -->
+<!ENTITY % pre.content
+     "( #PCDATA
+      | %InlStruct.class;
+      %InlPhras.class;
+      %Anchor.class;
+      %Inline.extra; )*"
+>
+
+<!ENTITY % xhtml-text.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
+            "../xhtml11/xhtml-text-1.mod" >
+%xhtml-text.mod;
+
+<!ENTITY % xhtml-hypertext.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
+            "../xhtml11/xhtml-hypertext-1.mod" >
+%xhtml-hypertext.mod;
+
+<!ENTITY % xhtml-list.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
+            "../xhtml11/xhtml-list-1.mod" >
+%xhtml-list.mod;
+<!-- Extend lists with value and start attributes --> 
+<!ATTLIST %li.qname;
+      value        %Number.datatype;         #IMPLIED
+>
+<!ATTLIST %ol.qname;
+      start        %Number.datatype;        #IMPLIED
+>
+
+<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
+
+<!-- Image Module  ............................................... -->
+<!ENTITY % xhtml-image.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
+            "../xhtml11/xhtml-image-1.mod" >
+%xhtml-image.mod;
+
+<!-- Tables Module ............................................... -->
+<!ENTITY % xhtml-table.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN"
+            "../xhtml11/xhtml-basic-table-1.mod" >
+%xhtml-table.mod;
+
+<!-- Forms Module  ............................................... 
+	XHTML Form with an inputmode extension from XForm 1.0
+-->
+
+<!ENTITY % xhtml-form.mod
+     PUBLIC "-//OMA//ELEMENTS XHTML MP 1.2 Forms 1.0//EN"
+            "xhtmlmp12-form-1.mod" >
+%xhtml-form.mod;
+
+<!-- Link Element Module  ........................................ -->
+<!ENTITY % xhtml-link.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
+            "../xhtml11/xhtml-link-1.mod" >
+%xhtml-link.mod;
+
+<!-- Document Metainformation Module  ............................ -->
+<!ENTITY % xhtml-meta.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
+            "../xhtml11/xhtml-meta-1.mod" >
+%xhtml-meta.mod;
+
+<!-- Base Element Module  ........................................ -->
+<!ENTITY % xhtml-base.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
+            "../xhtml11/xhtml-base-1.mod" >
+%xhtml-base.mod;
+
+<!-- Scripting Module  ........................................... -->
+<!ENTITY % xhtml-script.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN"
+            "../xhtml11/xhtml-script-1.mod" >
+%xhtml-script.mod;
+
+<!-- Style Sheets Module  ......................................... -->
+<!ENTITY % xhtml-style.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN"
+            "../xhtml11/xhtml-style-1.mod" >
+%xhtml-style.mod;
+
+<!-- Param Element Module  ....................................... -->
+<!ENTITY % xhtml-param.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
+            "../xhtml11/xhtml-param-1.mod" >
+%xhtml-param.mod;
+
+<!-- Embedded Object Module  ..................................... -->
+<!ENTITY % xhtml-object.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
+            "../xhtml11/xhtml-object-1.mod" >
+%xhtml-object.mod;
+
+<!-- Document Structure Module  ..................................... -->
+<!ENTITY % xhtml-struct.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
+            "../xhtml11/xhtml-struct-1.mod" >
+%xhtml-struct.mod;
+
+<!-- Block Presentation ........................................ -->
+<!ENTITY % xhtml-blkpres.mod PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
+ 		"../xhtml11/xhtml-blkpres-1.mod" >
+%xhtml-blkpres.mod;
+
+<!-- ========================================== -->
+<!--
+      XHTMLMP 1.2 Inline Presentation: all of XHTML Mod Presentation module
+(b, big, hr, i, small, sub, sup, tt) not just the subset (b, big, hr, i,
+small) as in XHTMLMP 1.1
+-->
+<!ENTITY % xhtml-inlpres.mod PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
+		"../xhtml11/xhtml-inlpres-1.mod">
+%xhtml-inlpres.mod;
+
+<!-- end of XHTML Mobile 1.2 DTD  ........................................... -->
+
diff --git a/xml/impl/resources/standardSchemas/xhtml-mobile/xhtmlmp12-form-1.mod b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtmlmp12-form-1.mod
new file mode 100644
index 0000000..97c8521
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml-mobile/xhtmlmp12-form-1.mod
@@ -0,0 +1,306 @@
+
+<!-- saved from url=(0096)http://dev.w3.org/2007/mobileok-ref/dtd/www.openmobilealliance.org/tech/DTD/xhtmlmp12-form-1.mod -->
+<HTML><BODY><PRE style="word-wrap: break-word; white-space: pre-wrap;">&lt;!-- ...................................................................... --&gt;
+&lt;!-- XHTMLMP1.2 Forms Module  .................................................. --&gt;
+&lt;!-- file: xhtmlmp12-form-1.mod
+
+     This is a xhtmlmp12-form-1.mod with inputmode attribute.
+
+     (C) 2006 Open Mobile Alliance Ltd.  All Rights Reserved.	
+
+     LEGAL DISCLAIMER
+
+     Use of this document is subject to all of the terms and conditions
+     of the Use Agreement located at
+	http://www.openmobilealliance.org/UseAgreement.html
+
+    NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE
+    MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER
+    OR ITS AFFILIATES REGARDING ANY OF THE IPRS REPRESENTED ON THE OMA
+    IPR DECLARATIONS LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY,
+    COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR
+    NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL.
+
+    THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY
+    DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR
+    EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF
+    DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS.
+     ....................................................................... --&gt;
+
+&lt;!-- Forms
+
+        form, label, input, select, optgroup, option,
+        textarea, fieldset, legend, button
+
+     This module declares markup to provide support for online
+     forms, based on the features found in HTML 4 forms.
+--&gt;
+
+&lt;!-- declare qualified element type names:
+--&gt;
+&lt;!ENTITY % form.qname  "form" &gt;
+&lt;!ENTITY % label.qname  "label" &gt;
+&lt;!ENTITY % input.qname  "input" &gt;
+&lt;!ENTITY % select.qname  "select" &gt;
+&lt;!ENTITY % optgroup.qname  "optgroup" &gt;
+&lt;!ENTITY % option.qname  "option" &gt;
+&lt;!ENTITY % textarea.qname  "textarea" &gt;
+&lt;!ENTITY % fieldset.qname  "fieldset" &gt;
+&lt;!ENTITY % legend.qname  "legend" &gt;
+&lt;!ENTITY % button.qname  "button" &gt;
+
+&lt;!-- %BlkNoForm.mix; includes all non-form block elements,
+     plus %Misc.class;
+--&gt;
+&lt;!ENTITY % BlkNoForm.mix
+     "%Heading.class;
+      | %List.class;
+      | %BlkStruct.class;
+      %BlkPhras.class;
+      %BlkPres.class;
+      %Table.class;
+      %Block.extra;
+      %Misc.class;"
+&gt;
+
+&lt;!-- form: Form Element ................................ --&gt;
+
+&lt;!ENTITY % form.element  "INCLUDE" &gt;
+&lt;![%form.element;[
+&lt;!ENTITY % form.content
+     "( %BlkNoForm.mix;
+      | %fieldset.qname; )+"
+&gt;
+&lt;!ELEMENT %form.qname;  %form.content; &gt;
+&lt;!-- end of form.element --&gt;]]&gt;
+
+&lt;!ENTITY % form.attlist  "INCLUDE" &gt;
+&lt;![%form.attlist;[
+&lt;!ATTLIST %form.qname;
+      %Common.attrib;
+      action       %URI.datatype;           #REQUIRED
+      method       ( get | post )           'get'
+      enctype      %ContentType.datatype;   'application/x-www-form-urlencoded'
+      accept-charset %Charsets.datatype;    #IMPLIED
+      accept       %ContentTypes.datatype;  #IMPLIED
+&gt;
+&lt;!-- end of form.attlist --&gt;]]&gt;
+
+&lt;!-- label: Form Field Label Text ...................... --&gt;
+
+&lt;!-- Each label must not contain more than ONE field
+--&gt;
+
+&lt;!ENTITY % label.element  "INCLUDE" &gt;
+&lt;![%label.element;[
+&lt;!ENTITY % label.content
+     "( #PCDATA
+      | %input.qname; | %select.qname; | %textarea.qname; | %button.qname;
+      | %InlStruct.class;
+      %InlPhras.class;
+      %I18n.class;
+      %InlPres.class;
+      %Anchor.class;
+      %InlSpecial.class;
+      %Inline.extra;
+      %Misc.class; )*"
+&gt;
+&lt;!ELEMENT %label.qname;  %label.content; &gt;
+&lt;!-- end of label.element --&gt;]]&gt;
+
+&lt;!ENTITY % label.attlist  "INCLUDE" &gt;
+&lt;![%label.attlist;[
+&lt;!ATTLIST %label.qname;
+      %Common.attrib;
+      for          IDREF                    #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+&gt;
+&lt;!-- end of label.attlist --&gt;]]&gt;
+
+&lt;!-- input: Form Control ............................... --&gt;
+
+&lt;!ENTITY % input.element  "INCLUDE" &gt;
+&lt;![%input.element;[
+&lt;!ENTITY % input.content  "EMPTY" &gt;
+&lt;!ELEMENT %input.qname;  %input.content; &gt;
+&lt;!-- end of input.element --&gt;]]&gt;
+
+&lt;!ENTITY % input.attlist  "INCLUDE" &gt;
+&lt;![%input.attlist;[
+&lt;!ENTITY % InputType.class
+     "( text | password | checkbox | radio | submit
+      | reset | file | hidden | image | button )"
+&gt;
+&lt;!-- attribute 'name' required for all but submit &amp; reset
+--&gt;
+&lt;!ATTLIST %input.qname;
+      %Common.attrib;
+      type         %InputType.class;        'text'
+      name         CDATA                    #IMPLIED
+      value        CDATA                    #IMPLIED
+      checked      ( checked )              #IMPLIED
+      disabled     ( disabled )             #IMPLIED
+      readonly     ( readonly )             #IMPLIED
+      size         %Number.datatype;        #IMPLIED
+      maxlength    %Number.datatype;        #IMPLIED
+      src          %URI.datatype;           #IMPLIED
+      alt          %Text.datatype;          #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+      accept       %ContentTypes.datatype;  #IMPLIED
+      inputmode    CDATA                    #IMPLIED
+&gt;
+&lt;!-- end of input.attlist --&gt;]]&gt;
+
+&lt;!-- select: Option Selector ........................... --&gt;
+
+&lt;!ENTITY % select.element  "INCLUDE" &gt;
+&lt;![%select.element;[
+&lt;!ENTITY % select.content
+     "( %optgroup.qname; | %option.qname; )+"
+&gt;
+&lt;!ELEMENT %select.qname;  %select.content; &gt;
+&lt;!-- end of select.element --&gt;]]&gt;
+
+&lt;!ENTITY % select.attlist  "INCLUDE" &gt;
+&lt;![%select.attlist;[
+&lt;!ATTLIST %select.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      size         %Number.datatype;        #IMPLIED
+      multiple     ( multiple )             #IMPLIED
+      disabled     ( disabled )             #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+&gt;
+&lt;!-- end of select.attlist --&gt;]]&gt;
+
+&lt;!-- optgroup: Option Group ............................ --&gt;
+
+&lt;!ENTITY % optgroup.element  "INCLUDE" &gt;
+&lt;![%optgroup.element;[
+&lt;!ENTITY % optgroup.content  "( %option.qname; )+" &gt;
+&lt;!ELEMENT %optgroup.qname;  %optgroup.content; &gt;
+&lt;!-- end of optgroup.element --&gt;]]&gt;
+
+&lt;!ENTITY % optgroup.attlist  "INCLUDE" &gt;
+&lt;![%optgroup.attlist;[
+&lt;!ATTLIST %optgroup.qname;
+      %Common.attrib;
+      disabled     ( disabled )             #IMPLIED
+      label        %Text.datatype;          #REQUIRED
+&gt;
+&lt;!-- end of optgroup.attlist --&gt;]]&gt;
+
+&lt;!-- option: Selectable Choice ......................... --&gt;
+
+&lt;!ENTITY % option.element  "INCLUDE" &gt;
+&lt;![%option.element;[
+&lt;!ENTITY % option.content  "( #PCDATA )" &gt;
+&lt;!ELEMENT %option.qname;  %option.content; &gt;
+&lt;!-- end of option.element --&gt;]]&gt;
+
+&lt;!ENTITY % option.attlist  "INCLUDE" &gt;
+&lt;![%option.attlist;[
+&lt;!ATTLIST %option.qname;
+      %Common.attrib;
+      selected     ( selected )             #IMPLIED
+      disabled     ( disabled )             #IMPLIED
+      label        %Text.datatype;          #IMPLIED
+      value        CDATA                    #IMPLIED
+&gt;
+&lt;!-- end of option.attlist --&gt;]]&gt;
+
+&lt;!-- textarea: Multi-Line Text Field ................... --&gt;
+
+&lt;!ENTITY % textarea.element  "INCLUDE" &gt;
+&lt;![%textarea.element;[
+&lt;!ENTITY % textarea.content  "( #PCDATA )" &gt;
+&lt;!ELEMENT %textarea.qname;  %textarea.content; &gt;
+&lt;!-- end of textarea.element --&gt;]]&gt;
+
+&lt;!ENTITY % textarea.attlist  "INCLUDE" &gt;
+&lt;![%textarea.attlist;[
+&lt;!ATTLIST %textarea.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      rows         %Number.datatype;        #REQUIRED
+      cols         %Number.datatype;        #REQUIRED
+      disabled     ( disabled )             #IMPLIED
+      readonly     ( readonly )             #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+      inputmode    CDATA                    #IMPLIED
+&gt;
+&lt;!-- end of textarea.attlist --&gt;]]&gt;
+
+&lt;!-- fieldset: Form Control Group ...................... --&gt;
+
+&lt;!-- #PCDATA is to solve the mixed content problem,
+     per specification only whitespace is allowed
+--&gt;
+
+&lt;!ENTITY % fieldset.element  "INCLUDE" &gt;
+&lt;![%fieldset.element;[
+&lt;!ENTITY % fieldset.content
+     "( #PCDATA | %legend.qname; | %Flow.mix; )*"
+&gt;
+&lt;!ELEMENT %fieldset.qname;  %fieldset.content; &gt;
+&lt;!-- end of fieldset.element --&gt;]]&gt;
+
+&lt;!ENTITY % fieldset.attlist  "INCLUDE" &gt;
+&lt;![%fieldset.attlist;[
+&lt;!ATTLIST %fieldset.qname;
+      %Common.attrib;
+&gt;
+&lt;!-- end of fieldset.attlist --&gt;]]&gt;
+
+&lt;!-- legend: Fieldset Legend ........................... --&gt;
+
+&lt;!ENTITY % legend.element  "INCLUDE" &gt;
+&lt;![%legend.element;[
+&lt;!ENTITY % legend.content
+     "( #PCDATA | %Inline.mix; )*"
+&gt;
+&lt;!ELEMENT %legend.qname;  %legend.content; &gt;
+&lt;!-- end of legend.element --&gt;]]&gt;
+
+&lt;!ENTITY % legend.attlist  "INCLUDE" &gt;
+&lt;![%legend.attlist;[
+&lt;!ATTLIST %legend.qname;
+      %Common.attrib;
+      accesskey    %Character.datatype;     #IMPLIED
+&gt;
+&lt;!-- end of legend.attlist --&gt;]]&gt;
+
+&lt;!-- button: Push Button ............................... --&gt;
+
+&lt;!ENTITY % button.element  "INCLUDE" &gt;
+&lt;![%button.element;[
+&lt;!ENTITY % button.content
+     "( #PCDATA
+      | %BlkNoForm.mix;
+      | %InlStruct.class;
+      %InlPhras.class;
+      %InlPres.class;
+      %I18n.class;
+      %InlSpecial.class;
+      %Inline.extra; )*"
+&gt;
+&lt;!ELEMENT %button.qname;  %button.content; &gt;
+&lt;!-- end of button.element --&gt;]]&gt;
+
+&lt;!ENTITY % button.attlist  "INCLUDE" &gt;
+&lt;![%button.attlist;[
+&lt;!ATTLIST %button.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      value        CDATA                    #IMPLIED
+      type         ( button | submit | reset ) 'submit'
+      disabled     ( disabled )             #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+&gt;
+&lt;!-- end of button.attlist --&gt;]]&gt;
+
+&lt;!-- end of xhtml-form-1.mod --&gt;
+</PRE></BODY></HTML>
\ No newline at end of file
diff --git a/xml/impl/resources/standardSchemas/xhtml-special.ent b/xml/impl/resources/standardSchemas/xhtml-special.ent
new file mode 100644
index 0000000..ca358b2
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml-special.ent
@@ -0,0 +1,80 @@
+<!-- Special characters for XHTML -->
+
+<!-- Character entity set. Typical invocation:
+     <!ENTITY % HTMLspecial PUBLIC
+        "-//W3C//ENTITIES Special for XHTML//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
+     %HTMLspecial;
+-->
+
+<!-- Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+     New names (i.e., not in ISO 8879 list) do not clash with any
+     existing ISO 8879 entity names. ISO 10646 character numbers
+     are given for each character, in hex. values are decimal
+     conversions of the ISO 10646 values and refer to the document
+     character set. Names are Unicode names. 
+-->
+
+<!-- C0 Controls and Basic Latin -->
+<!ENTITY quot    "&#34;"> <!--  quotation mark, U+0022 ISOnum -->
+<!ENTITY amp     "&#38;#38;"> <!--  ampersand, U+0026 ISOnum -->
+<!ENTITY lt      "&#38;#60;"> <!--  less-than sign, U+003C ISOnum -->
+<!ENTITY gt      "&#62;"> <!--  greater-than sign, U+003E ISOnum -->
+<!ENTITY apos	 "&#39;"> <!--  apostrophe = APL quote, U+0027 ISOnum -->
+
+<!-- Latin Extended-A -->
+<!ENTITY OElig   "&#338;"> <!--  latin capital ligature OE,
+                                    U+0152 ISOlat2 -->
+<!ENTITY oelig   "&#339;"> <!--  latin small ligature oe, U+0153 ISOlat2 -->
+<!-- ligature is a misnomer, this is a separate character in some languages -->
+<!ENTITY Scaron  "&#352;"> <!--  latin capital letter S with caron,
+                                    U+0160 ISOlat2 -->
+<!ENTITY scaron  "&#353;"> <!--  latin small letter s with caron,
+                                    U+0161 ISOlat2 -->
+<!ENTITY Yuml    "&#376;"> <!--  latin capital letter Y with diaeresis,
+                                    U+0178 ISOlat2 -->
+
+<!-- Spacing Modifier Letters -->
+<!ENTITY circ    "&#710;"> <!--  modifier letter circumflex accent,
+                                    U+02C6 ISOpub -->
+<!ENTITY tilde   "&#732;"> <!--  small tilde, U+02DC ISOdia -->
+
+<!-- General Punctuation -->
+<!ENTITY ensp    "&#8194;"> <!-- en space, U+2002 ISOpub -->
+<!ENTITY emsp    "&#8195;"> <!-- em space, U+2003 ISOpub -->
+<!ENTITY thinsp  "&#8201;"> <!-- thin space, U+2009 ISOpub -->
+<!ENTITY zwnj    "&#8204;"> <!-- zero width non-joiner,
+                                    U+200C NEW RFC 2070 -->
+<!ENTITY zwj     "&#8205;"> <!-- zero width joiner, U+200D NEW RFC 2070 -->
+<!ENTITY lrm     "&#8206;"> <!-- left-to-right mark, U+200E NEW RFC 2070 -->
+<!ENTITY rlm     "&#8207;"> <!-- right-to-left mark, U+200F NEW RFC 2070 -->
+<!ENTITY ndash   "&#8211;"> <!-- en dash, U+2013 ISOpub -->
+<!ENTITY mdash   "&#8212;"> <!-- em dash, U+2014 ISOpub -->
+<!ENTITY lsquo   "&#8216;"> <!-- left single quotation mark,
+                                    U+2018 ISOnum -->
+<!ENTITY rsquo   "&#8217;"> <!-- right single quotation mark,
+                                    U+2019 ISOnum -->
+<!ENTITY sbquo   "&#8218;"> <!-- single low-9 quotation mark, U+201A NEW -->
+<!ENTITY ldquo   "&#8220;"> <!-- left double quotation mark,
+                                    U+201C ISOnum -->
+<!ENTITY rdquo   "&#8221;"> <!-- right double quotation mark,
+                                    U+201D ISOnum -->
+<!ENTITY bdquo   "&#8222;"> <!-- double low-9 quotation mark, U+201E NEW -->
+<!ENTITY dagger  "&#8224;"> <!-- dagger, U+2020 ISOpub -->
+<!ENTITY Dagger  "&#8225;"> <!-- double dagger, U+2021 ISOpub -->
+<!ENTITY permil  "&#8240;"> <!-- per mille sign, U+2030 ISOtech -->
+<!ENTITY lsaquo  "&#8249;"> <!-- single left-pointing angle quotation mark,
+                                    U+2039 ISO proposed -->
+<!-- lsaquo is proposed but not yet ISO standardized -->
+<!ENTITY rsaquo  "&#8250;"> <!-- single right-pointing angle quotation mark,
+                                    U+203A ISO proposed -->
+<!-- rsaquo is proposed but not yet ISO standardized -->
+
+<!-- Currency Symbols -->
+<!ENTITY euro   "&#8364;"> <!--  euro sign, U+20AC NEW -->
diff --git a/xml/impl/resources/standardSchemas/xhtml-symbol.ent b/xml/impl/resources/standardSchemas/xhtml-symbol.ent
new file mode 100644
index 0000000..63c2abf
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml-symbol.ent
@@ -0,0 +1,237 @@
+<!-- Mathematical, Greek and Symbolic characters for XHTML -->
+
+<!-- Character entity set. Typical invocation:
+     <!ENTITY % HTMLsymbol PUBLIC
+        "-//W3C//ENTITIES Symbols for XHTML//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent">
+     %HTMLsymbol;
+-->
+
+<!-- Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+     New names (i.e., not in ISO 8879 list) do not clash with any
+     existing ISO 8879 entity names. ISO 10646 character numbers
+     are given for each character, in hex. values are decimal
+     conversions of the ISO 10646 values and refer to the document
+     character set. Names are Unicode names. 
+-->
+
+<!-- Latin Extended-B -->
+<!ENTITY fnof     "&#402;"> <!-- latin small letter f with hook = function
+                                    = florin, U+0192 ISOtech -->
+
+<!-- Greek -->
+<!ENTITY Alpha    "&#913;"> <!-- greek capital letter alpha, U+0391 -->
+<!ENTITY Beta     "&#914;"> <!-- greek capital letter beta, U+0392 -->
+<!ENTITY Gamma    "&#915;"> <!-- greek capital letter gamma,
+                                    U+0393 ISOgrk3 -->
+<!ENTITY Delta    "&#916;"> <!-- greek capital letter delta,
+                                    U+0394 ISOgrk3 -->
+<!ENTITY Epsilon  "&#917;"> <!-- greek capital letter epsilon, U+0395 -->
+<!ENTITY Zeta     "&#918;"> <!-- greek capital letter zeta, U+0396 -->
+<!ENTITY Eta      "&#919;"> <!-- greek capital letter eta, U+0397 -->
+<!ENTITY Theta    "&#920;"> <!-- greek capital letter theta,
+                                    U+0398 ISOgrk3 -->
+<!ENTITY Iota     "&#921;"> <!-- greek capital letter iota, U+0399 -->
+<!ENTITY Kappa    "&#922;"> <!-- greek capital letter kappa, U+039A -->
+<!ENTITY Lambda   "&#923;"> <!-- greek capital letter lamda,
+                                    U+039B ISOgrk3 -->
+<!ENTITY Mu       "&#924;"> <!-- greek capital letter mu, U+039C -->
+<!ENTITY Nu       "&#925;"> <!-- greek capital letter nu, U+039D -->
+<!ENTITY Xi       "&#926;"> <!-- greek capital letter xi, U+039E ISOgrk3 -->
+<!ENTITY Omicron  "&#927;"> <!-- greek capital letter omicron, U+039F -->
+<!ENTITY Pi       "&#928;"> <!-- greek capital letter pi, U+03A0 ISOgrk3 -->
+<!ENTITY Rho      "&#929;"> <!-- greek capital letter rho, U+03A1 -->
+<!-- there is no Sigmaf, and no U+03A2 character either -->
+<!ENTITY Sigma    "&#931;"> <!-- greek capital letter sigma,
+                                    U+03A3 ISOgrk3 -->
+<!ENTITY Tau      "&#932;"> <!-- greek capital letter tau, U+03A4 -->
+<!ENTITY Upsilon  "&#933;"> <!-- greek capital letter upsilon,
+                                    U+03A5 ISOgrk3 -->
+<!ENTITY Phi      "&#934;"> <!-- greek capital letter phi,
+                                    U+03A6 ISOgrk3 -->
+<!ENTITY Chi      "&#935;"> <!-- greek capital letter chi, U+03A7 -->
+<!ENTITY Psi      "&#936;"> <!-- greek capital letter psi,
+                                    U+03A8 ISOgrk3 -->
+<!ENTITY Omega    "&#937;"> <!-- greek capital letter omega,
+                                    U+03A9 ISOgrk3 -->
+
+<!ENTITY alpha    "&#945;"> <!-- greek small letter alpha,
+                                    U+03B1 ISOgrk3 -->
+<!ENTITY beta     "&#946;"> <!-- greek small letter beta, U+03B2 ISOgrk3 -->
+<!ENTITY gamma    "&#947;"> <!-- greek small letter gamma,
+                                    U+03B3 ISOgrk3 -->
+<!ENTITY delta    "&#948;"> <!-- greek small letter delta,
+                                    U+03B4 ISOgrk3 -->
+<!ENTITY epsilon  "&#949;"> <!-- greek small letter epsilon,
+                                    U+03B5 ISOgrk3 -->
+<!ENTITY zeta     "&#950;"> <!-- greek small letter zeta, U+03B6 ISOgrk3 -->
+<!ENTITY eta      "&#951;"> <!-- greek small letter eta, U+03B7 ISOgrk3 -->
+<!ENTITY theta    "&#952;"> <!-- greek small letter theta,
+                                    U+03B8 ISOgrk3 -->
+<!ENTITY iota     "&#953;"> <!-- greek small letter iota, U+03B9 ISOgrk3 -->
+<!ENTITY kappa    "&#954;"> <!-- greek small letter kappa,
+                                    U+03BA ISOgrk3 -->
+<!ENTITY lambda   "&#955;"> <!-- greek small letter lamda,
+                                    U+03BB ISOgrk3 -->
+<!ENTITY mu       "&#956;"> <!-- greek small letter mu, U+03BC ISOgrk3 -->
+<!ENTITY nu       "&#957;"> <!-- greek small letter nu, U+03BD ISOgrk3 -->
+<!ENTITY xi       "&#958;"> <!-- greek small letter xi, U+03BE ISOgrk3 -->
+<!ENTITY omicron  "&#959;"> <!-- greek small letter omicron, U+03BF NEW -->
+<!ENTITY pi       "&#960;"> <!-- greek small letter pi, U+03C0 ISOgrk3 -->
+<!ENTITY rho      "&#961;"> <!-- greek small letter rho, U+03C1 ISOgrk3 -->
+<!ENTITY sigmaf   "&#962;"> <!-- greek small letter final sigma,
+                                    U+03C2 ISOgrk3 -->
+<!ENTITY sigma    "&#963;"> <!-- greek small letter sigma,
+                                    U+03C3 ISOgrk3 -->
+<!ENTITY tau      "&#964;"> <!-- greek small letter tau, U+03C4 ISOgrk3 -->
+<!ENTITY upsilon  "&#965;"> <!-- greek small letter upsilon,
+                                    U+03C5 ISOgrk3 -->
+<!ENTITY phi      "&#966;"> <!-- greek small letter phi, U+03C6 ISOgrk3 -->
+<!ENTITY chi      "&#967;"> <!-- greek small letter chi, U+03C7 ISOgrk3 -->
+<!ENTITY psi      "&#968;"> <!-- greek small letter psi, U+03C8 ISOgrk3 -->
+<!ENTITY omega    "&#969;"> <!-- greek small letter omega,
+                                    U+03C9 ISOgrk3 -->
+<!ENTITY thetasym "&#977;"> <!-- greek theta symbol,
+                                    U+03D1 NEW -->
+<!ENTITY upsih    "&#978;"> <!-- greek upsilon with hook symbol,
+                                    U+03D2 NEW -->
+<!ENTITY piv      "&#982;"> <!-- greek pi symbol, U+03D6 ISOgrk3 -->
+
+<!-- General Punctuation -->
+<!ENTITY bull     "&#8226;"> <!-- bullet = black small circle,
+                                     U+2022 ISOpub  -->
+<!-- bullet is NOT the same as bullet operator, U+2219 -->
+<!ENTITY hellip   "&#8230;"> <!-- horizontal ellipsis = three dot leader,
+                                     U+2026 ISOpub  -->
+<!ENTITY prime    "&#8242;"> <!-- prime = minutes = feet, U+2032 ISOtech -->
+<!ENTITY Prime    "&#8243;"> <!-- double prime = seconds = inches,
+                                     U+2033 ISOtech -->
+<!ENTITY oline    "&#8254;"> <!-- overline = spacing overscore,
+                                     U+203E NEW -->
+<!ENTITY frasl    "&#8260;"> <!-- fraction slash, U+2044 NEW -->
+
+<!-- Letterlike Symbols -->
+<!ENTITY weierp   "&#8472;"> <!-- script capital P = power set
+                                     = Weierstrass p, U+2118 ISOamso -->
+<!ENTITY image    "&#8465;"> <!-- black-letter capital I = imaginary part,
+                                     U+2111 ISOamso -->
+<!ENTITY real     "&#8476;"> <!-- black-letter capital R = real part symbol,
+                                     U+211C ISOamso -->
+<!ENTITY trade    "&#8482;"> <!-- trade mark sign, U+2122 ISOnum -->
+<!ENTITY alefsym  "&#8501;"> <!-- alef symbol = first transfinite cardinal,
+                                     U+2135 NEW -->
+<!-- alef symbol is NOT the same as hebrew letter alef,
+     U+05D0 although the same glyph could be used to depict both characters -->
+
+<!-- Arrows -->
+<!ENTITY larr     "&#8592;"> <!-- leftwards arrow, U+2190 ISOnum -->
+<!ENTITY uarr     "&#8593;"> <!-- upwards arrow, U+2191 ISOnum-->
+<!ENTITY rarr     "&#8594;"> <!-- rightwards arrow, U+2192 ISOnum -->
+<!ENTITY darr     "&#8595;"> <!-- downwards arrow, U+2193 ISOnum -->
+<!ENTITY harr     "&#8596;"> <!-- left right arrow, U+2194 ISOamsa -->
+<!ENTITY crarr    "&#8629;"> <!-- downwards arrow with corner leftwards
+                                     = carriage return, U+21B5 NEW -->
+<!ENTITY lArr     "&#8656;"> <!-- leftwards double arrow, U+21D0 ISOtech -->
+<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow
+    but also does not have any other character for that function. So lArr can
+    be used for 'is implied by' as ISOtech suggests -->
+<!ENTITY uArr     "&#8657;"> <!-- upwards double arrow, U+21D1 ISOamsa -->
+<!ENTITY rArr     "&#8658;"> <!-- rightwards double arrow,
+                                     U+21D2 ISOtech -->
+<!-- Unicode does not say this is the 'implies' character but does not have 
+     another character with this function so rArr can be used for 'implies'
+     as ISOtech suggests -->
+<!ENTITY dArr     "&#8659;"> <!-- downwards double arrow, U+21D3 ISOamsa -->
+<!ENTITY hArr     "&#8660;"> <!-- left right double arrow,
+                                     U+21D4 ISOamsa -->
+
+<!-- Mathematical Operators -->
+<!ENTITY forall   "&#8704;"> <!-- for all, U+2200 ISOtech -->
+<!ENTITY part     "&#8706;"> <!-- partial differential, U+2202 ISOtech  -->
+<!ENTITY exist    "&#8707;"> <!-- there exists, U+2203 ISOtech -->
+<!ENTITY empty    "&#8709;"> <!-- empty set = null set, U+2205 ISOamso -->
+<!ENTITY nabla    "&#8711;"> <!-- nabla = backward difference,
+                                     U+2207 ISOtech -->
+<!ENTITY isin     "&#8712;"> <!-- element of, U+2208 ISOtech -->
+<!ENTITY notin    "&#8713;"> <!-- not an element of, U+2209 ISOtech -->
+<!ENTITY ni       "&#8715;"> <!-- contains as member, U+220B ISOtech -->
+<!ENTITY prod     "&#8719;"> <!-- n-ary product = product sign,
+                                     U+220F ISOamsb -->
+<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
+     the same glyph might be used for both -->
+<!ENTITY sum      "&#8721;"> <!-- n-ary summation, U+2211 ISOamsb -->
+<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
+     though the same glyph might be used for both -->
+<!ENTITY minus    "&#8722;"> <!-- minus sign, U+2212 ISOtech -->
+<!ENTITY lowast   "&#8727;"> <!-- asterisk operator, U+2217 ISOtech -->
+<!ENTITY radic    "&#8730;"> <!-- square root = radical sign,
+                                     U+221A ISOtech -->
+<!ENTITY prop     "&#8733;"> <!-- proportional to, U+221D ISOtech -->
+<!ENTITY infin    "&#8734;"> <!-- infinity, U+221E ISOtech -->
+<!ENTITY ang      "&#8736;"> <!-- angle, U+2220 ISOamso -->
+<!ENTITY and      "&#8743;"> <!-- logical and = wedge, U+2227 ISOtech -->
+<!ENTITY or       "&#8744;"> <!-- logical or = vee, U+2228 ISOtech -->
+<!ENTITY cap      "&#8745;"> <!-- intersection = cap, U+2229 ISOtech -->
+<!ENTITY cup      "&#8746;"> <!-- union = cup, U+222A ISOtech -->
+<!ENTITY int      "&#8747;"> <!-- integral, U+222B ISOtech -->
+<!ENTITY there4   "&#8756;"> <!-- therefore, U+2234 ISOtech -->
+<!ENTITY sim      "&#8764;"> <!-- tilde operator = varies with = similar to,
+                                     U+223C ISOtech -->
+<!-- tilde operator is NOT the same character as the tilde, U+007E,
+     although the same glyph might be used to represent both  -->
+<!ENTITY cong     "&#8773;"> <!-- approximately equal to, U+2245 ISOtech -->
+<!ENTITY asymp    "&#8776;"> <!-- almost equal to = asymptotic to,
+                                     U+2248 ISOamsr -->
+<!ENTITY ne       "&#8800;"> <!-- not equal to, U+2260 ISOtech -->
+<!ENTITY equiv    "&#8801;"> <!-- identical to, U+2261 ISOtech -->
+<!ENTITY le       "&#8804;"> <!-- less-than or equal to, U+2264 ISOtech -->
+<!ENTITY ge       "&#8805;"> <!-- greater-than or equal to,
+                                     U+2265 ISOtech -->
+<!ENTITY sub      "&#8834;"> <!-- subset of, U+2282 ISOtech -->
+<!ENTITY sup      "&#8835;"> <!-- superset of, U+2283 ISOtech -->
+<!ENTITY nsub     "&#8836;"> <!-- not a subset of, U+2284 ISOamsn -->
+<!ENTITY sube     "&#8838;"> <!-- subset of or equal to, U+2286 ISOtech -->
+<!ENTITY supe     "&#8839;"> <!-- superset of or equal to,
+                                     U+2287 ISOtech -->
+<!ENTITY oplus    "&#8853;"> <!-- circled plus = direct sum,
+                                     U+2295 ISOamsb -->
+<!ENTITY otimes   "&#8855;"> <!-- circled times = vector product,
+                                     U+2297 ISOamsb -->
+<!ENTITY perp     "&#8869;"> <!-- up tack = orthogonal to = perpendicular,
+                                     U+22A5 ISOtech -->
+<!ENTITY sdot     "&#8901;"> <!-- dot operator, U+22C5 ISOamsb -->
+<!-- dot operator is NOT the same character as U+00B7 middle dot -->
+
+<!-- Miscellaneous Technical -->
+<!ENTITY lceil    "&#8968;"> <!-- left ceiling = APL upstile,
+                                     U+2308 ISOamsc  -->
+<!ENTITY rceil    "&#8969;"> <!-- right ceiling, U+2309 ISOamsc  -->
+<!ENTITY lfloor   "&#8970;"> <!-- left floor = APL downstile,
+                                     U+230A ISOamsc  -->
+<!ENTITY rfloor   "&#8971;"> <!-- right floor, U+230B ISOamsc  -->
+<!ENTITY lang     "&#9001;"> <!-- left-pointing angle bracket = bra,
+                                     U+2329 ISOtech -->
+<!-- lang is NOT the same character as U+003C 'less than sign' 
+     or U+2039 'single left-pointing angle quotation mark' -->
+<!ENTITY rang     "&#9002;"> <!-- right-pointing angle bracket = ket,
+                                     U+232A ISOtech -->
+<!-- rang is NOT the same character as U+003E 'greater than sign' 
+     or U+203A 'single right-pointing angle quotation mark' -->
+
+<!-- Geometric Shapes -->
+<!ENTITY loz      "&#9674;"> <!-- lozenge, U+25CA ISOpub -->
+
+<!-- Miscellaneous Symbols -->
+<!ENTITY spades   "&#9824;"> <!-- black spade suit, U+2660 ISOpub -->
+<!-- black here seems to mean filled as opposed to hollow -->
+<!ENTITY clubs    "&#9827;"> <!-- black club suit = shamrock,
+                                     U+2663 ISOpub -->
+<!ENTITY hearts   "&#9829;"> <!-- black heart suit = valentine,
+                                     U+2665 ISOpub -->
+<!ENTITY diams    "&#9830;"> <!-- black diamond suit, U+2666 ISOpub -->
diff --git a/xml/impl/resources/standardSchemas/xhtml.dtd b/xml/impl/resources/standardSchemas/xhtml.dtd
new file mode 100644
index 0000000..9e5ccc9
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml.dtd
@@ -0,0 +1,1201 @@
+<!--
+   Extensible HTML version 1.0 Transitional DTD
+
+   This is the same as HTML 4 Transitional except for
+   changes due to the differences between XML and SGML.
+
+   Namespace = http://www.w3.org/1999/xhtml
+
+   For further information, see: http://www.w3.org/TR/xhtml1
+
+   Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
+   All Rights Reserved.
+
+   This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+   SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+
+   $Revision: 1.1 $
+   $Date: 2004/06/09 12:44:55 $
+
+-->
+
+<!--================ Character mnemonic entities =========================-->
+
+<!ENTITY % HTMLlat1 PUBLIC
+   "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+   "xhtml-lat1.ent">
+%HTMLlat1;
+
+<!ENTITY % HTMLsymbol PUBLIC
+   "-//W3C//ENTITIES Symbols for XHTML//EN"
+   "xhtml-symbol.ent">
+%HTMLsymbol;
+
+<!ENTITY % HTMLspecial PUBLIC
+   "-//W3C//ENTITIES Special for XHTML//EN"
+   "xhtml-special.ent">
+%HTMLspecial;
+
+<!--================== Imported Names ====================================-->
+
+<!ENTITY % ContentType "CDATA">
+    <!-- media type, as per [RFC2045] -->
+
+<!ENTITY % ContentTypes "CDATA">
+    <!-- comma-separated list of media types, as per [RFC2045] -->
+
+<!ENTITY % Charset "CDATA">
+    <!-- a character encoding, as per [RFC2045] -->
+
+<!ENTITY % Charsets "CDATA">
+    <!-- a space separated list of character encodings, as per [RFC2045] -->
+
+<!ENTITY % LanguageCode "NMTOKEN">
+    <!-- a language code, as per [RFC3066] -->
+
+<!ENTITY % Character "CDATA">
+    <!-- a single character, as per section 2.2 of [XML] -->
+
+<!ENTITY % Number "CDATA">
+    <!-- one or more digits -->
+
+<!ENTITY % LinkTypes "CDATA">
+    <!-- space-separated list of link types -->
+
+<!ENTITY % MediaDesc "CDATA">
+    <!-- single or comma-separated list of media descriptors -->
+
+<!ENTITY % URI "CDATA">
+    <!-- a Uniform Resource Identifier, see [RFC2396] -->
+
+<!ENTITY % UriList "CDATA">
+    <!-- a space separated list of Uniform Resource Identifiers -->
+
+<!ENTITY % Datetime "CDATA">
+    <!-- date and time information. ISO date format -->
+
+<!ENTITY % Script "CDATA">
+    <!-- script expression -->
+
+<!ENTITY % StyleSheet "CDATA">
+    <!-- style sheet data -->
+
+<!ENTITY % Text "CDATA">
+    <!-- used for titles etc. -->
+
+<!ENTITY % FrameTarget "NMTOKEN">
+    <!-- render in this frame -->
+
+<!ENTITY % Length "CDATA">
+    <!-- nn for pixels or nn% for percentage length -->
+
+<!ENTITY % MultiLength "CDATA">
+    <!-- pixel, percentage, or relative -->
+
+<!ENTITY % Pixels "CDATA">
+    <!-- integer representing length in pixels -->
+
+<!-- these are used for image maps -->
+
+<!ENTITY % Shape "(rect|circle|poly|default)">
+
+<!ENTITY % Coords "CDATA">
+    <!-- comma separated list of lengths -->
+
+<!-- used for object, applet, img, input and iframe -->
+<!ENTITY % ImgAlign "(top|middle|bottom|left|right)">
+
+<!-- a color using sRGB: #RRGGBB as Hex values -->
+<!ENTITY % Color "CDATA">
+
+<!-- There are also 16 widely known color names with their sRGB values:
+
+    Black  = #000000    Green  = #008000
+    Silver = #C0C0C0    Lime   = #00FF00
+    Gray   = #808080    Olive  = #808000
+    White  = #FFFFFF    Yellow = #FFFF00
+    Maroon = #800000    Navy   = #000080
+    Red    = #FF0000    Blue   = #0000FF
+    Purple = #800080    Teal   = #008080
+    Fuchsia= #FF00FF    Aqua   = #00FFFF
+-->
+
+<!--=================== Generic Attributes ===============================-->
+
+<!-- core attributes common to most elements
+  id       document-wide unique id
+  class    space separated list of classes
+  style    associated style info
+  title    advisory title/amplification
+-->
+<!ENTITY % coreattrs
+ "id          ID             #IMPLIED
+  class       CDATA          #IMPLIED
+  style       %StyleSheet;   #IMPLIED
+  title       %Text;         #IMPLIED"
+  >
+
+<!-- internationalization attributes
+  lang        language code (backwards compatible)
+  xml:lang    language code (as per XML 1.0 spec)
+  dir         direction for weak/neutral text
+-->
+<!ENTITY % i18n
+ "lang        %LanguageCode; #IMPLIED
+  xml:lang    %LanguageCode; #IMPLIED
+  dir         (ltr|rtl)      #IMPLIED"
+  >
+
+<!-- attributes for common UI events
+  onclick     a pointer button was clicked
+  ondblclick  a pointer button was double clicked
+  onmousedown a pointer button was pressed down
+  onmouseup   a pointer button was released
+  onmousemove a pointer was moved onto the element
+  onmouseout  a pointer was moved away from the element
+  onkeypress  a key was pressed and released
+  onkeydown   a key was pressed down
+  onkeyup     a key was released
+-->
+<!ENTITY % events
+ "onclick     %Script;       #IMPLIED
+  ondblclick  %Script;       #IMPLIED
+  onmousedown %Script;       #IMPLIED
+  onmouseup   %Script;       #IMPLIED
+  onmouseover %Script;       #IMPLIED
+  onmousemove %Script;       #IMPLIED
+  onmouseout  %Script;       #IMPLIED
+  onkeypress  %Script;       #IMPLIED
+  onkeydown   %Script;       #IMPLIED
+  onkeyup     %Script;       #IMPLIED"
+  >
+
+<!-- attributes for elements that can get the focus
+  accesskey   accessibility key character
+  tabindex    position in tabbing order
+  onfocus     the element got the focus
+  onblur      the element lost the focus
+-->
+<!ENTITY % focus
+ "accesskey   %Character;    #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED"
+  >
+
+<!ENTITY % attrs "%coreattrs; %i18n; %events;">
+
+<!-- text alignment for p, div, h1-h6. The default is
+     align="left" for ltr headings, "right" for rtl -->
+
+<!ENTITY % TextAlign "align (left|center|right|justify) #IMPLIED">
+
+<!--=================== Text Elements ====================================-->
+
+<!ENTITY % special.extra
+   "object | applet | img | map | iframe">
+
+<!ENTITY % special.basic
+	"br | span | bdo">
+
+<!ENTITY % special
+   "%special.basic; | %special.extra;">
+
+<!ENTITY % fontstyle.extra "big | small | font | basefont">
+
+<!ENTITY % fontstyle.basic "tt | i | b | u
+                      | s | strike ">
+
+<!ENTITY % fontstyle "%fontstyle.basic; | %fontstyle.extra;">
+
+<!ENTITY % phrase.extra "sub | sup">
+<!ENTITY % phrase.basic "em | strong | dfn | code | q |
+                   samp | kbd | var | cite | abbr | acronym">
+
+<!ENTITY % phrase "%phrase.basic; | %phrase.extra;">
+
+<!ENTITY % inline.forms "input | select | textarea | label | button">
+
+<!-- these can occur at block or inline level -->
+<!ENTITY % misc.inline "ins | del | script">
+
+<!-- these can only occur at block level -->
+<!ENTITY % misc "noscript | %misc.inline;">
+
+<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">
+
+<!-- %Inline; covers inline or "text-level" elements -->
+<!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*">
+
+<!--================== Block level elements ==============================-->
+
+<!ENTITY % heading "h1|h2|h3|h4|h5|h6">
+<!ENTITY % lists "ul | ol | dl | menu | dir">
+<!ENTITY % blocktext "pre | hr | blockquote | address | center | noframes">
+
+<!ENTITY % block
+    "p | %heading; | div | %lists; | %blocktext; | isindex |fieldset | table">
+
+<!-- %Flow; mixes block and inline and is used for list items etc. -->
+<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">
+
+<!--================== Content models for exclusions =====================-->
+
+<!-- a elements use %Inline; excluding a -->
+
+<!ENTITY % a.content
+   "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc.inline;)*">
+
+<!-- pre uses %Inline excluding img, object, applet, big, small,
+     font, or basefont -->
+
+<!ENTITY % pre.content
+   "(#PCDATA | a | %special.basic; | %fontstyle.basic; | %phrase.basic; |
+	   %inline.forms; | %misc.inline;)*">
+
+<!-- form uses %Flow; excluding form -->
+
+<!ENTITY % form.content "(#PCDATA | %block; | %inline; | %misc;)*">
+
+<!-- button uses %Flow; but excludes a, form, form controls, iframe -->
+
+<!ENTITY % button.content
+   "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |
+      table | br | span | bdo | object | applet | img | map |
+      %fontstyle; | %phrase; | %misc;)*">
+
+<!--================ Document Structure ==================================-->
+
+<!-- the namespace URI designates the document profile -->
+
+<!ELEMENT html (head, body)>
+<!ATTLIST html
+  %i18n;
+  id          ID             #IMPLIED
+  xmlns       %URI;          #FIXED 'http://www.w3.org/1999/xhtml'
+  >
+
+<!--================ Document Head =======================================-->
+
+<!ENTITY % head.misc "(script|style|meta|link|object|isindex)*">
+
+<!-- content model is %head.misc; combined with a single
+     title and an optional base element in any order -->
+
+<!ELEMENT head (%head.misc;,
+     ((title, %head.misc;, (base, %head.misc;)?) |
+      (base, %head.misc;, (title, %head.misc;))))>
+
+<!ATTLIST head
+  %i18n;
+  id          ID             #IMPLIED
+  profile     %URI;          #IMPLIED
+  >
+
+<!-- The title element is not considered part of the flow of text.
+       It should be displayed, for example as the page header or
+       window title. Exactly one title is required per document.
+    -->
+<!ELEMENT title (#PCDATA)>
+<!ATTLIST title
+  %i18n;
+  id          ID             #IMPLIED
+  >
+
+<!-- document base URI -->
+
+<!ELEMENT base EMPTY>
+<!ATTLIST base
+  id          ID             #IMPLIED
+  href        %URI;          #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!-- generic metainformation -->
+<!ELEMENT meta EMPTY>
+<!ATTLIST meta
+  %i18n;
+  id          ID             #IMPLIED
+  http-equiv  CDATA          #IMPLIED
+  name        CDATA          #IMPLIED
+  content     CDATA          #REQUIRED
+  scheme      CDATA          #IMPLIED
+  >
+
+<!--
+  Relationship values can be used in principle:
+
+   a) for document specific toolbars/menus when used
+      with the link element in document head e.g.
+        start, contents, previous, next, index, end, help
+   b) to link to a separate style sheet (rel="stylesheet")
+   c) to make a link to a script (rel="script")
+   d) by stylesheets to control how collections of
+      html nodes are rendered into printed documents
+   e) to make a link to a printable version of this document
+      e.g. a PostScript or PDF version (rel="alternate" media="print")
+-->
+
+<!ELEMENT link EMPTY>
+<!ATTLIST link
+  %attrs;
+  charset     %Charset;      #IMPLIED
+  href        %URI;          #IMPLIED
+  hreflang    %LanguageCode; #IMPLIED
+  type        %ContentType;  #IMPLIED
+  rel         %LinkTypes;    #IMPLIED
+  rev         %LinkTypes;    #IMPLIED
+  media       %MediaDesc;    #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!-- style info, which may include CDATA sections -->
+<!ELEMENT style (#PCDATA)>
+<!ATTLIST style
+  %i18n;
+  id          ID             #IMPLIED
+  type        %ContentType;  #REQUIRED
+  media       %MediaDesc;    #IMPLIED
+  title       %Text;         #IMPLIED
+  xml:space   (preserve)     #FIXED 'preserve'
+  >
+
+<!-- script statements, which may include CDATA sections -->
+<!ELEMENT script (#PCDATA)>
+<!ATTLIST script
+  id          ID             #IMPLIED
+  charset     %Charset;      #IMPLIED
+  type        %ContentType;  #REQUIRED
+  language    CDATA          #IMPLIED
+  src         %URI;          #IMPLIED
+  defer       (defer)        #IMPLIED
+  xml:space   (preserve)     #FIXED 'preserve'
+  >
+
+<!-- alternate content container for non script-based rendering -->
+
+<!ELEMENT noscript %Flow;>
+<!ATTLIST noscript
+  %attrs;
+  >
+
+<!--======================= Frames =======================================-->
+
+<!-- inline subwindow -->
+
+<!ELEMENT iframe %Flow;>
+<!ATTLIST iframe
+  %coreattrs;
+  longdesc    %URI;          #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  src         %URI;          #IMPLIED
+  frameborder (1|0)          "1"
+  marginwidth %Pixels;       #IMPLIED
+  marginheight %Pixels;      #IMPLIED
+  scrolling   (yes|no|auto)  "auto"
+  align       %ImgAlign;     #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  >
+
+<!-- alternate content container for non frame-based rendering -->
+
+<!ELEMENT noframes %Flow;>
+<!ATTLIST noframes
+  %attrs;
+  >
+
+<!--=================== Document Body ====================================-->
+
+<!ELEMENT body %Flow;>
+<!ATTLIST body
+  %attrs;
+  onload      %Script;       #IMPLIED
+  onunload    %Script;       #IMPLIED
+  background  %URI;          #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  text        %Color;        #IMPLIED
+  link        %Color;        #IMPLIED
+  vlink       %Color;        #IMPLIED
+  alink       %Color;        #IMPLIED
+  >
+
+<!ELEMENT div %Flow;>  <!-- generic language/style container -->
+<!ATTLIST div
+  %attrs;
+  %TextAlign;
+  >
+
+<!--=================== Paragraphs =======================================-->
+
+<!ELEMENT p %Inline;>
+<!ATTLIST p
+  %attrs;
+  %TextAlign;
+  >
+
+<!--=================== Headings =========================================-->
+
+<!--
+  There are six levels of headings from h1 (the most important)
+  to h6 (the least important).
+-->
+
+<!ELEMENT h1  %Inline;>
+<!ATTLIST h1
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h2 %Inline;>
+<!ATTLIST h2
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h3 %Inline;>
+<!ATTLIST h3
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h4 %Inline;>
+<!ATTLIST h4
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h5 %Inline;>
+<!ATTLIST h5
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h6 %Inline;>
+<!ATTLIST h6
+  %attrs;
+  %TextAlign;
+  >
+
+<!--=================== Lists ============================================-->
+
+<!-- Unordered list bullet styles -->
+
+<!ENTITY % ULStyle "(disc|square|circle)">
+
+<!-- Unordered list -->
+
+<!ELEMENT ul (li)+>
+<!ATTLIST ul
+  %attrs;
+  type        %ULStyle;     #IMPLIED
+  compact     (compact)     #IMPLIED
+  >
+
+<!-- Ordered list numbering style
+
+    1   arabic numbers      1, 2, 3, ...
+    a   lower alpha         a, b, c, ...
+    A   upper alpha         A, B, C, ...
+    i   lower roman         i, ii, iii, ...
+    I   upper roman         I, II, III, ...
+
+    The style is applied to the sequence number which by default
+    is reset to 1 for the first list item in an ordered list.
+-->
+<!ENTITY % OLStyle "CDATA">
+
+<!-- Ordered (numbered) list -->
+
+<!ELEMENT ol (li)+>
+<!ATTLIST ol
+  %attrs;
+  type        %OLStyle;      #IMPLIED
+  compact     (compact)      #IMPLIED
+  start       %Number;       #IMPLIED
+  >
+
+<!-- single column list (DEPRECATED) -->
+<!ELEMENT menu (li)+>
+<!ATTLIST menu
+  %attrs;
+  compact     (compact)     #IMPLIED
+  >
+
+<!-- multiple column list (DEPRECATED) -->
+<!ELEMENT dir (li)+>
+<!ATTLIST dir
+  %attrs;
+  compact     (compact)     #IMPLIED
+  >
+
+<!-- LIStyle is constrained to: "(%ULStyle;|%OLStyle;)" -->
+<!ENTITY % LIStyle "CDATA">
+
+<!-- list item -->
+
+<!ELEMENT li %Flow;>
+<!ATTLIST li
+  %attrs;
+  type        %LIStyle;      #IMPLIED
+  value       %Number;       #IMPLIED
+  >
+
+<!-- definition lists - dt for term, dd for its definition -->
+
+<!ELEMENT dl (dt|dd)+>
+<!ATTLIST dl
+  %attrs;
+  compact     (compact)      #IMPLIED
+  >
+
+<!ELEMENT dt %Inline;>
+<!ATTLIST dt
+  %attrs;
+  >
+
+<!ELEMENT dd %Flow;>
+<!ATTLIST dd
+  %attrs;
+  >
+
+<!--=================== Address ==========================================-->
+
+<!-- information on author -->
+
+<!ELEMENT address (#PCDATA | %inline; | %misc.inline; | p)*>
+<!ATTLIST address
+  %attrs;
+  >
+
+<!--=================== Horizontal Rule ==================================-->
+
+<!ELEMENT hr EMPTY>
+<!ATTLIST hr
+  %attrs;
+  align       (left|center|right) #IMPLIED
+  noshade     (noshade)      #IMPLIED
+  size        %Pixels;       #IMPLIED
+  width       %Length;       #IMPLIED
+  >
+
+<!--=================== Preformatted Text ================================-->
+
+<!-- content is %Inline; excluding
+        "img|object|applet|big|small|sub|sup|font|basefont" -->
+
+<!ELEMENT pre %pre.content;>
+<!ATTLIST pre
+  %attrs;
+  width       %Number;      #IMPLIED
+  xml:space   (preserve)    #FIXED 'preserve'
+  >
+
+<!--=================== Block-like Quotes ================================-->
+
+<!ELEMENT blockquote %Flow;>
+<!ATTLIST blockquote
+  %attrs;
+  cite        %URI;          #IMPLIED
+  >
+
+<!--=================== Text alignment ===================================-->
+
+<!-- center content -->
+<!ELEMENT center %Flow;>
+<!ATTLIST center
+  %attrs;
+  >
+
+<!--=================== Inserted/Deleted Text ============================-->
+
+<!--
+  ins/del are allowed in block and inline content, but its
+  inappropriate to include block content within an ins element
+  occurring in inline content.
+-->
+<!ELEMENT ins %Flow;>
+<!ATTLIST ins
+  %attrs;
+  cite        %URI;          #IMPLIED
+  datetime    %Datetime;     #IMPLIED
+  >
+
+<!ELEMENT del %Flow;>
+<!ATTLIST del
+  %attrs;
+  cite        %URI;          #IMPLIED
+  datetime    %Datetime;     #IMPLIED
+  >
+
+<!--================== The Anchor Element ================================-->
+
+<!-- content is %Inline; except that anchors shouldn't be nested -->
+
+<!ELEMENT a %a.content;>
+<!ATTLIST a
+  %attrs;
+  %focus;
+  charset     %Charset;      #IMPLIED
+  type        %ContentType;  #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  href        %URI;          #IMPLIED
+  hreflang    %LanguageCode; #IMPLIED
+  rel         %LinkTypes;    #IMPLIED
+  rev         %LinkTypes;    #IMPLIED
+  shape       %Shape;        "rect"
+  coords      %Coords;       #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!--===================== Inline Elements ================================-->
+
+<!ELEMENT span %Inline;> <!-- generic language/style container -->
+<!ATTLIST span
+  %attrs;
+  >
+
+<!ELEMENT bdo %Inline;>  <!-- I18N BiDi over-ride -->
+<!ATTLIST bdo
+  %coreattrs;
+  %events;
+  lang        %LanguageCode; #IMPLIED
+  xml:lang    %LanguageCode; #IMPLIED
+  dir         (ltr|rtl)      #REQUIRED
+  >
+
+<!ELEMENT br EMPTY>   <!-- forced line break -->
+<!ATTLIST br
+  %coreattrs;
+  clear       (left|all|right|none) "none"
+  >
+
+<!ELEMENT em %Inline;>   <!-- emphasis -->
+<!ATTLIST em %attrs;>
+
+<!ELEMENT strong %Inline;>   <!-- strong emphasis -->
+<!ATTLIST strong %attrs;>
+
+<!ELEMENT dfn %Inline;>   <!-- definitional -->
+<!ATTLIST dfn %attrs;>
+
+<!ELEMENT code %Inline;>   <!-- program code -->
+<!ATTLIST code %attrs;>
+
+<!ELEMENT samp %Inline;>   <!-- sample -->
+<!ATTLIST samp %attrs;>
+
+<!ELEMENT kbd %Inline;>  <!-- something user would type -->
+<!ATTLIST kbd %attrs;>
+
+<!ELEMENT var %Inline;>   <!-- variable -->
+<!ATTLIST var %attrs;>
+
+<!ELEMENT cite %Inline;>   <!-- citation -->
+<!ATTLIST cite %attrs;>
+
+<!ELEMENT abbr %Inline;>   <!-- abbreviation -->
+<!ATTLIST abbr %attrs;>
+
+<!ELEMENT acronym %Inline;>   <!-- acronym -->
+<!ATTLIST acronym %attrs;>
+
+<!ELEMENT q %Inline;>   <!-- inlined quote -->
+<!ATTLIST q
+  %attrs;
+  cite        %URI;          #IMPLIED
+  >
+
+<!ELEMENT sub %Inline;> <!-- subscript -->
+<!ATTLIST sub %attrs;>
+
+<!ELEMENT sup %Inline;> <!-- superscript -->
+<!ATTLIST sup %attrs;>
+
+<!ELEMENT tt %Inline;>   <!-- fixed pitch font -->
+<!ATTLIST tt %attrs;>
+
+<!ELEMENT i %Inline;>   <!-- italic font -->
+<!ATTLIST i %attrs;>
+
+<!ELEMENT b %Inline;>   <!-- bold font -->
+<!ATTLIST b %attrs;>
+
+<!ELEMENT big %Inline;>   <!-- bigger font -->
+<!ATTLIST big %attrs;>
+
+<!ELEMENT small %Inline;>   <!-- smaller font -->
+<!ATTLIST small %attrs;>
+
+<!ELEMENT u %Inline;>   <!-- underline -->
+<!ATTLIST u %attrs;>
+
+<!ELEMENT s %Inline;>   <!-- strike-through -->
+<!ATTLIST s %attrs;>
+
+<!ELEMENT strike %Inline;>   <!-- strike-through -->
+<!ATTLIST strike %attrs;>
+
+<!ELEMENT basefont EMPTY>  <!-- base font size -->
+<!ATTLIST basefont
+  id          ID             #IMPLIED
+  size        CDATA          #REQUIRED
+  color       %Color;        #IMPLIED
+  face        CDATA          #IMPLIED
+  >
+
+<!ELEMENT font %Inline;> <!-- local change to font -->
+<!ATTLIST font
+  %coreattrs;
+  %i18n;
+  size        CDATA          #IMPLIED
+  color       %Color;        #IMPLIED
+  face        CDATA          #IMPLIED
+  >
+
+<!--==================== Object ======================================-->
+<!--
+  object is used to embed objects as part of HTML pages.
+  param elements should precede other content. Parameters
+  can also be expressed as attribute/value pairs on the
+  object element itself when brevity is desired.
+-->
+
+<!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*>
+<!ATTLIST object
+  %attrs;
+  declare     (declare)      #IMPLIED
+  classid     %URI;          #IMPLIED
+  codebase    %URI;          #IMPLIED
+  data        %URI;          #IMPLIED
+  type        %ContentType;  #IMPLIED
+  codetype    %ContentType;  #IMPLIED
+  archive     %UriList;      #IMPLIED
+  standby     %Text;         #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  usemap      %URI;          #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  align       %ImgAlign;     #IMPLIED
+  border      %Pixels;       #IMPLIED
+  hspace      %Pixels;       #IMPLIED
+  vspace      %Pixels;       #IMPLIED
+  >
+
+<!--
+  param is used to supply a named property value.
+  In XML it would seem natural to follow RDF and support an
+  abbreviated syntax where the param elements are replaced
+  by attribute value pairs on the object start tag.
+-->
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+  id          ID             #IMPLIED
+  name        CDATA          #REQUIRED
+  value       CDATA          #IMPLIED
+  valuetype   (data|ref|object) "data"
+  type        %ContentType;  #IMPLIED
+  >
+
+<!--=================== Java applet ==================================-->
+<!--
+  One of code or object attributes must be present.
+  Place param elements before other content.
+-->
+<!ELEMENT applet (#PCDATA | param | %block; | form | %inline; | %misc;)*>
+<!ATTLIST applet
+  %coreattrs;
+  codebase    %URI;          #IMPLIED
+  archive     CDATA          #IMPLIED
+  code        CDATA          #IMPLIED
+  object      CDATA          #IMPLIED
+  alt         %Text;         #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  width       %Length;       #REQUIRED
+  height      %Length;       #REQUIRED
+  align       %ImgAlign;     #IMPLIED
+  hspace      %Pixels;       #IMPLIED
+  vspace      %Pixels;       #IMPLIED
+  >
+
+<!--=================== Images ===========================================-->
+
+<!--
+   To avoid accessibility problems for people who aren't
+   able to see the image, you should provide a text
+   description using the alt and longdesc attributes.
+   In addition, avoid the use of server-side image maps.
+-->
+
+<!ELEMENT img EMPTY>
+<!ATTLIST img
+  %attrs;
+  src         %URI;          #REQUIRED
+  alt         %Text;         #REQUIRED
+  name        NMTOKEN        #IMPLIED
+  longdesc    %URI;          #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  usemap      %URI;          #IMPLIED
+  ismap       (ismap)        #IMPLIED
+  align       %ImgAlign;     #IMPLIED
+  border      %Length;       #IMPLIED
+  hspace      %Pixels;       #IMPLIED
+  vspace      %Pixels;       #IMPLIED
+  >
+
+<!-- usemap points to a map element which may be in this document
+  or an external document, although the latter is not widely supported -->
+
+<!--================== Client-side image maps ============================-->
+
+<!-- These can be placed in the same document or grouped in a
+     separate document although this isn't yet widely supported -->
+
+<!ELEMENT map ((%block; | form | %misc;)+ | area+)>
+<!ATTLIST map
+  %i18n;
+  %events;
+  id          ID             #REQUIRED
+  class       CDATA          #IMPLIED
+  style       %StyleSheet;   #IMPLIED
+  title       %Text;         #IMPLIED
+  name        CDATA          #IMPLIED
+  >
+
+<!ELEMENT area EMPTY>
+<!ATTLIST area
+  %attrs;
+  %focus;
+  shape       %Shape;        "rect"
+  coords      %Coords;       #IMPLIED
+  href        %URI;          #IMPLIED
+  nohref      (nohref)       #IMPLIED
+  alt         %Text;         #REQUIRED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!--================ Forms ===============================================-->
+
+<!ELEMENT form %form.content;>   <!-- forms shouldn't be nested -->
+
+<!ATTLIST form
+  %attrs;
+  action      %URI;          #REQUIRED
+  method      (get|post)     "get"
+  name        NMTOKEN        #IMPLIED
+  enctype     %ContentType;  "application/x-www-form-urlencoded"
+  onsubmit    %Script;       #IMPLIED
+  onreset     %Script;       #IMPLIED
+  accept      %ContentTypes; #IMPLIED
+  accept-charset %Charsets;  #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!--
+  Each label must not contain more than ONE field
+  Label elements shouldn't be nested.
+-->
+<!ELEMENT label %Inline;>
+<!ATTLIST label
+  %attrs;
+  for         IDREF          #IMPLIED
+  accesskey   %Character;    #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED
+  >
+
+<!ENTITY % InputType
+  "(text | password | checkbox |
+    radio | submit | reset |
+    file | hidden | image | button)"
+   >
+
+<!-- the name attribute is required for all but submit & reset -->
+
+<!ELEMENT input EMPTY>     <!-- form control -->
+<!ATTLIST input
+  %attrs;
+  %focus;
+  type        %InputType;    "text"
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED
+  checked     (checked)      #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  readonly    (readonly)     #IMPLIED
+  size        CDATA          #IMPLIED
+  maxlength   %Number;       #IMPLIED
+  src         %URI;          #IMPLIED
+  alt         CDATA          #IMPLIED
+  usemap      %URI;          #IMPLIED
+  onselect    %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  accept      %ContentTypes; #IMPLIED
+  align       %ImgAlign;     #IMPLIED
+  >
+
+<!ELEMENT select (optgroup|option)+>  <!-- option selector -->
+<!ATTLIST select
+  %attrs;
+  name        CDATA          #IMPLIED
+  size        %Number;       #IMPLIED
+  multiple    (multiple)     #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  >
+
+<!ELEMENT optgroup (option)+>   <!-- option group -->
+<!ATTLIST optgroup
+  %attrs;
+  disabled    (disabled)     #IMPLIED
+  label       %Text;         #REQUIRED
+  >
+
+<!ELEMENT option (#PCDATA)>     <!-- selectable choice -->
+<!ATTLIST option
+  %attrs;
+  selected    (selected)     #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  label       %Text;         #IMPLIED
+  value       CDATA          #IMPLIED
+  >
+
+<!ELEMENT textarea (#PCDATA)>     <!-- multi-line text field -->
+<!ATTLIST textarea
+  %attrs;
+  %focus;
+  name        CDATA          #IMPLIED
+  rows        %Number;       #REQUIRED
+  cols        %Number;       #REQUIRED
+  disabled    (disabled)     #IMPLIED
+  readonly    (readonly)     #IMPLIED
+  onselect    %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  >
+
+<!--
+  The fieldset element is used to group form fields.
+  Only one legend element should occur in the content
+  and if present should only be preceded by whitespace.
+-->
+<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>
+<!ATTLIST fieldset
+  %attrs;
+  >
+
+<!ENTITY % LAlign "(top|bottom|left|right)">
+
+<!ELEMENT legend %Inline;>     <!-- fieldset label -->
+<!ATTLIST legend
+  %attrs;
+  accesskey   %Character;    #IMPLIED
+  align       %LAlign;       #IMPLIED
+  >
+
+<!--
+ Content is %Flow; excluding a, form, form controls, iframe
+-->
+<!ELEMENT button %button.content;>  <!-- push button -->
+<!ATTLIST button
+  %attrs;
+  %focus;
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED
+  type        (button|submit|reset) "submit"
+  disabled    (disabled)     #IMPLIED
+  >
+
+<!-- single-line text input control (DEPRECATED) -->
+<!ELEMENT isindex EMPTY>
+<!ATTLIST isindex
+  %coreattrs;
+  %i18n;
+  prompt      %Text;         #IMPLIED
+  >
+
+<!--======================= Tables =======================================-->
+
+<!-- Derived from IETF HTML table standard, see [RFC1942] -->
+
+<!--
+ The border attribute sets the thickness of the frame around the
+ table. The default units are screen pixels.
+
+ The frame attribute specifies which parts of the frame around
+ the table should be rendered. The values are not the same as
+ CALS to avoid a name clash with the valign attribute.
+-->
+<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
+
+<!--
+ The rules attribute defines which rules to draw between cells:
+
+ If rules is absent then assume:
+     "none" if border is absent or border="0" otherwise "all"
+-->
+
+<!ENTITY % TRules "(none | groups | rows | cols | all)">
+
+<!-- horizontal placement of table relative to document -->
+<!ENTITY % TAlign "(left|center|right)">
+
+<!-- horizontal alignment attributes for cell contents
+
+  char        alignment char, e.g. char=':'
+  charoff     offset for alignment char
+-->
+<!ENTITY % cellhalign
+  "align      (left|center|right|justify|char) #IMPLIED
+   char       %Character;    #IMPLIED
+   charoff    %Length;       #IMPLIED"
+  >
+
+<!-- vertical alignment attributes for cell contents -->
+<!ENTITY % cellvalign
+  "valign     (top|middle|bottom|baseline) #IMPLIED"
+  >
+
+<!ELEMENT table
+     (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
+<!ELEMENT caption  %Inline;>
+<!ELEMENT thead    (tr)+>
+<!ELEMENT tfoot    (tr)+>
+<!ELEMENT tbody    (tr)+>
+<!ELEMENT colgroup (col)*>
+<!ELEMENT col      EMPTY>
+<!ELEMENT tr       (th|td)+>
+<!ELEMENT th       %Flow;>
+<!ELEMENT td       %Flow;>
+
+<!ATTLIST table
+  %attrs;
+  summary     %Text;         #IMPLIED
+  width       %Length;       #IMPLIED
+  border      %Pixels;       #IMPLIED
+  frame       %TFrame;       #IMPLIED
+  rules       %TRules;       #IMPLIED
+  cellspacing %Length;       #IMPLIED
+  cellpadding %Length;       #IMPLIED
+  align       %TAlign;       #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  >
+
+<!ENTITY % CAlign "(top|bottom|left|right)">
+
+<!ATTLIST caption
+  %attrs;
+  align       %CAlign;       #IMPLIED
+  >
+
+<!--
+colgroup groups a set of col elements. It allows you to group
+several semantically related columns together.
+-->
+<!ATTLIST colgroup
+  %attrs;
+  span        %Number;       "1"
+  width       %MultiLength;  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!--
+ col elements define the alignment properties for cells in
+ one or more columns.
+
+ The width attribute specifies the width of the columns, e.g.
+
+     width=64        width in screen pixels
+     width=0.5*      relative width of 0.5
+
+ The span attribute causes the attributes of one
+ col element to apply to more than one column.
+-->
+<!ATTLIST col
+  %attrs;
+  span        %Number;       "1"
+  width       %MultiLength;  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!--
+    Use thead to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    tbody sections are rendered in scrolling panel.
+
+    Use tfoot to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    tbody sections are rendered in scrolling panel.
+
+    Use multiple tbody sections when rules are needed
+    between groups of table rows.
+-->
+<!ATTLIST thead
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tfoot
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tbody
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tr
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  bgcolor     %Color;        #IMPLIED
+  >
+
+<!-- Scope is simpler than headers attribute for common tables -->
+<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
+
+<!-- th is for headers, td for data and for cells acting as both -->
+
+<!ATTLIST th
+  %attrs;
+  abbr        %Text;         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       %Scope;        #IMPLIED
+  rowspan     %Number;       "1"
+  colspan     %Number;       "1"
+  %cellhalign;
+  %cellvalign;
+  nowrap      (nowrap)       #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  width       %Length;       #IMPLIED
+  height      %Length;       #IMPLIED
+  >
+
+<!ATTLIST td
+  %attrs;
+  abbr        %Text;         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       %Scope;        #IMPLIED
+  rowspan     %Number;       "1"
+  colspan     %Number;       "1"
+  %cellhalign;
+  %cellvalign;
+  nowrap      (nowrap)       #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  width       %Length;       #IMPLIED
+  height      %Length;       #IMPLIED
+  >
+
diff --git a/xml/impl/resources/standardSchemas/xhtml1-frameset.dtd b/xml/impl/resources/standardSchemas/xhtml1-frameset.dtd
new file mode 100644
index 0000000..0a0f7f0
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml1-frameset.dtd
@@ -0,0 +1,1235 @@
+<!--
+   Extensible HTML version 1.0 Frameset DTD
+
+   This is the same as HTML 4 Frameset except for
+   changes due to the differences between XML and SGML.
+
+   Namespace = http://www.w3.org/1999/xhtml
+
+   For further information, see: http://www.w3.org/TR/xhtml1
+
+   Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
+   All Rights Reserved. 
+
+   This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+   PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+   SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
+
+   $Revision: 1.1 $
+   $Date: 2004/09/17 17:05:38 $
+
+-->
+
+<!--================ Character mnemonic entities =========================-->
+
+<!ENTITY % HTMLlat1 PUBLIC
+   "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+   "xhtml-lat1.ent">
+%HTMLlat1;
+
+<!ENTITY % HTMLsymbol PUBLIC
+   "-//W3C//ENTITIES Symbols for XHTML//EN"
+   "xhtml-symbol.ent">
+%HTMLsymbol;
+
+<!ENTITY % HTMLspecial PUBLIC
+   "-//W3C//ENTITIES Special for XHTML//EN"
+   "xhtml-special.ent">
+%HTMLspecial;
+
+<!--================== Imported Names ====================================-->
+
+<!ENTITY % ContentType "CDATA">
+    <!-- media type, as per [RFC2045] -->
+
+<!ENTITY % ContentTypes "CDATA">
+    <!-- comma-separated list of media types, as per [RFC2045] -->
+
+<!ENTITY % Charset "CDATA">
+    <!-- a character encoding, as per [RFC2045] -->
+
+<!ENTITY % Charsets "CDATA">
+    <!-- a space separated list of character encodings, as per [RFC2045] -->
+
+<!ENTITY % LanguageCode "NMTOKEN">
+    <!-- a language code, as per [RFC3066] -->
+
+<!ENTITY % Character "CDATA">
+    <!-- a single character, as per section 2.2 of [XML] -->
+
+<!ENTITY % Number "CDATA">
+    <!-- one or more digits -->
+
+<!ENTITY % LinkTypes "CDATA">
+    <!-- space-separated list of link types -->
+
+<!ENTITY % MediaDesc "CDATA">
+    <!-- single or comma-separated list of media descriptors -->
+
+<!ENTITY % URI "CDATA">
+    <!-- a Uniform Resource Identifier, see [RFC2396] -->
+
+<!ENTITY % UriList "CDATA">
+    <!-- a space separated list of Uniform Resource Identifiers -->
+
+<!ENTITY % Datetime "CDATA">
+    <!-- date and time information. ISO date format -->
+
+<!ENTITY % Script "CDATA">
+    <!-- script expression -->
+
+<!ENTITY % StyleSheet "CDATA">
+    <!-- style sheet data -->
+
+<!ENTITY % Text "CDATA">
+    <!-- used for titles etc. -->
+
+<!ENTITY % FrameTarget "NMTOKEN">
+    <!-- render in this frame -->
+
+<!ENTITY % Length "CDATA">
+    <!-- nn for pixels or nn% for percentage length -->
+
+<!ENTITY % MultiLength "CDATA">
+    <!-- pixel, percentage, or relative -->
+
+<!ENTITY % MultiLengths "CDATA">
+    <!-- comma-separated list of MultiLength -->
+
+<!ENTITY % Pixels "CDATA">
+    <!-- integer representing length in pixels -->
+
+<!-- these are used for image maps -->
+
+<!ENTITY % Shape "(rect|circle|poly|default)">
+
+<!ENTITY % Coords "CDATA">
+    <!-- comma separated list of lengths -->
+
+<!-- used for object, applet, img, input and iframe -->
+<!ENTITY % ImgAlign "(top|middle|bottom|left|right)">
+
+<!-- a color using sRGB: #RRGGBB as Hex values -->
+<!ENTITY % Color "CDATA">
+
+<!-- There are also 16 widely known color names with their sRGB values:
+
+    Black  = #000000    Green  = #008000
+    Silver = #C0C0C0    Lime   = #00FF00
+    Gray   = #808080    Olive  = #808000
+    White  = #FFFFFF    Yellow = #FFFF00
+    Maroon = #800000    Navy   = #000080
+    Red    = #FF0000    Blue   = #0000FF
+    Purple = #800080    Teal   = #008080
+    Fuchsia= #FF00FF    Aqua   = #00FFFF
+-->
+
+<!--=================== Generic Attributes ===============================-->
+
+<!-- core attributes common to most elements
+  id       document-wide unique id
+  class    space separated list of classes
+  style    associated style info
+  title    advisory title/amplification
+-->
+<!ENTITY % coreattrs
+ "id          ID             #IMPLIED
+  class       CDATA          #IMPLIED
+  style       %StyleSheet;   #IMPLIED
+  title       %Text;         #IMPLIED"
+  >
+
+<!-- internationalization attributes
+  lang        language code (backwards compatible)
+  xml:lang    language code (as per XML 1.0 spec)
+  dir         direction for weak/neutral text
+-->
+<!ENTITY % i18n
+ "lang        %LanguageCode; #IMPLIED
+  xml:lang    %LanguageCode; #IMPLIED
+  dir         (ltr|rtl)      #IMPLIED"
+  >
+
+<!-- attributes for common UI events
+  onclick     a pointer button was clicked
+  ondblclick  a pointer button was double clicked
+  onmousedown a pointer button was pressed down
+  onmouseup   a pointer button was released
+  onmousemove a pointer was moved onto the element
+  onmouseout  a pointer was moved away from the element
+  onkeypress  a key was pressed and released
+  onkeydown   a key was pressed down
+  onkeyup     a key was released
+-->
+<!ENTITY % events
+ "onclick     %Script;       #IMPLIED
+  ondblclick  %Script;       #IMPLIED
+  onmousedown %Script;       #IMPLIED
+  onmouseup   %Script;       #IMPLIED
+  onmouseover %Script;       #IMPLIED
+  onmousemove %Script;       #IMPLIED
+  onmouseout  %Script;       #IMPLIED
+  onkeypress  %Script;       #IMPLIED
+  onkeydown   %Script;       #IMPLIED
+  onkeyup     %Script;       #IMPLIED"
+  >
+
+<!-- attributes for elements that can get the focus
+  accesskey   accessibility key character
+  tabindex    position in tabbing order
+  onfocus     the element got the focus
+  onblur      the element lost the focus
+-->
+<!ENTITY % focus
+ "accesskey   %Character;    #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED"
+  >
+
+<!ENTITY % attrs "%coreattrs; %i18n; %events;">
+
+<!-- text alignment for p, div, h1-h6. The default is
+     align="left" for ltr headings, "right" for rtl -->
+
+<!ENTITY % TextAlign "align (left|center|right|justify) #IMPLIED">
+
+<!--=================== Text Elements ====================================-->
+
+<!ENTITY % special.extra
+   "object | applet | img | map | iframe">
+	
+<!ENTITY % special.basic
+	"br | span | bdo">
+
+<!ENTITY % special
+   "%special.basic; | %special.extra;">
+
+<!ENTITY % fontstyle.extra "big | small | font | basefont">
+
+<!ENTITY % fontstyle.basic "tt | i | b | u
+                      | s | strike ">
+
+<!ENTITY % fontstyle "%fontstyle.basic; | %fontstyle.extra;">
+
+<!ENTITY % phrase.extra "sub | sup">
+<!ENTITY % phrase.basic "em | strong | dfn | code | q |
+                   samp | kbd | var | cite | abbr | acronym">
+
+<!ENTITY % phrase "%phrase.basic; | %phrase.extra;">
+
+<!ENTITY % inline.forms "input | select | textarea | label | button">
+
+<!-- these can occur at block or inline level -->
+<!ENTITY % misc.inline "ins | del | script">
+
+<!-- these can only occur at block level -->
+<!ENTITY % misc "noscript | %misc.inline;">
+
+
+<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">
+
+<!-- %Inline; covers inline or "text-level" elements -->
+<!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*">
+
+<!--================== Block level elements ==============================-->
+
+<!ENTITY % heading "h1|h2|h3|h4|h5|h6">
+<!ENTITY % lists "ul | ol | dl | menu | dir">
+<!ENTITY % blocktext "pre | hr | blockquote | address | center">
+
+<!ENTITY % block
+    "p | %heading; | div | %lists; | %blocktext; | isindex | fieldset | table">
+
+<!-- %Flow; mixes block and inline and is used for list items etc. -->
+<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">
+
+<!--================== Content models for exclusions =====================-->
+
+<!-- a elements use %Inline; excluding a -->
+
+<!ENTITY % a.content
+   "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc.inline;)*">
+
+<!-- pre uses %Inline excluding img, object, applet, big, small,
+     sub, sup, font, or basefont -->
+
+<!ENTITY % pre.content
+   "(#PCDATA | a | %special.basic; | %fontstyle.basic; | %phrase.basic; |
+	   %inline.forms; | %misc.inline;)*">
+
+
+<!-- form uses %Flow; excluding form -->
+
+<!ENTITY % form.content "(#PCDATA | %block; | %inline; | %misc;)*">
+
+<!-- button uses %Flow; but excludes a, form, form controls, iframe -->
+
+<!ENTITY % button.content
+   "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |
+      table | br | span | bdo | object | applet | img | map |
+      %fontstyle; | %phrase; | %misc;)*">
+
+<!--================ Document Structure ==================================-->
+
+<!-- the namespace URI designates the document profile -->
+
+<!ELEMENT html (head, frameset)>
+<!ATTLIST html
+  %i18n;
+  id          ID             #IMPLIED
+  xmlns       %URI;          #FIXED 'http://www.w3.org/1999/xhtml'
+  >
+
+<!--================ Document Head =======================================-->
+
+<!ENTITY % head.misc "(script|style|meta|link|object|isindex)*">
+
+<!-- content model is %head.misc; combined with a single
+     title and an optional base element in any order -->
+
+<!ELEMENT head (%head.misc;,
+     ((title, %head.misc;, (base, %head.misc;)?) |
+      (base, %head.misc;, (title, %head.misc;))))>
+
+<!ATTLIST head
+  %i18n;
+  id          ID             #IMPLIED
+  profile     %URI;          #IMPLIED
+  >
+
+<!-- The title element is not considered part of the flow of text.
+       It should be displayed, for example as the page header or
+       window title. Exactly one title is required per document.
+    -->
+<!ELEMENT title (#PCDATA)>
+<!ATTLIST title 
+  %i18n;
+  id          ID             #IMPLIED
+  >
+
+<!-- document base URI -->
+
+<!ELEMENT base EMPTY>
+<!ATTLIST base
+  id          ID             #IMPLIED
+  href        %URI;          #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!-- generic metainformation -->
+<!ELEMENT meta EMPTY>
+<!ATTLIST meta
+  %i18n;
+  id          ID             #IMPLIED
+  http-equiv  CDATA          #IMPLIED
+  name        CDATA          #IMPLIED
+  content     CDATA          #REQUIRED
+  scheme      CDATA          #IMPLIED
+  >
+
+<!--
+  Relationship values can be used in principle:
+
+   a) for document specific toolbars/menus when used
+      with the link element in document head e.g.
+        start, contents, previous, next, index, end, help
+   b) to link to a separate style sheet (rel="stylesheet")
+   c) to make a link to a script (rel="script")
+   d) by stylesheets to control how collections of
+      html nodes are rendered into printed documents
+   e) to make a link to a printable version of this document
+      e.g. a PostScript or PDF version (rel="alternate" media="print")
+-->
+
+<!ELEMENT link EMPTY>
+<!ATTLIST link
+  %attrs;
+  charset     %Charset;      #IMPLIED
+  href        %URI;          #IMPLIED
+  hreflang    %LanguageCode; #IMPLIED
+  type        %ContentType;  #IMPLIED
+  rel         %LinkTypes;    #IMPLIED
+  rev         %LinkTypes;    #IMPLIED
+  media       %MediaDesc;    #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!-- style info, which may include CDATA sections -->
+<!ELEMENT style (#PCDATA)>
+<!ATTLIST style
+  %i18n;
+  id          ID             #IMPLIED
+  type        %ContentType;  #REQUIRED
+  media       %MediaDesc;    #IMPLIED
+  title       %Text;         #IMPLIED
+  xml:space   (preserve)     #FIXED 'preserve'
+  >
+
+<!-- script statements, which may include CDATA sections -->
+<!ELEMENT script (#PCDATA)>
+<!ATTLIST script
+  id          ID             #IMPLIED
+  charset     %Charset;      #IMPLIED
+  type        %ContentType;  #REQUIRED
+  language    CDATA          #IMPLIED
+  src         %URI;          #IMPLIED
+  defer       (defer)        #IMPLIED
+  xml:space   (preserve)     #FIXED 'preserve'
+  >
+
+<!-- alternate content container for non script-based rendering -->
+
+<!ELEMENT noscript %Flow;>
+<!ATTLIST noscript
+  %attrs;
+  >
+
+<!--======================= Frames =======================================-->
+
+<!-- only one noframes element permitted per document -->
+
+<!ELEMENT frameset (frameset|frame|noframes)*>
+<!ATTLIST frameset
+  %coreattrs;
+  rows        %MultiLengths; #IMPLIED
+  cols        %MultiLengths; #IMPLIED
+  onload      %Script;       #IMPLIED
+  onunload    %Script;       #IMPLIED
+  >
+
+<!-- reserved frame names start with "_" otherwise starts with letter -->
+
+<!-- tiled window within frameset -->
+
+<!ELEMENT frame EMPTY>
+<!ATTLIST frame
+  %coreattrs;
+  longdesc    %URI;          #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  src         %URI;          #IMPLIED
+  frameborder (1|0)          "1"
+  marginwidth %Pixels;       #IMPLIED
+  marginheight %Pixels;      #IMPLIED
+  noresize    (noresize)     #IMPLIED
+  scrolling   (yes|no|auto)  "auto"
+  >
+
+<!-- inline subwindow -->
+
+<!ELEMENT iframe %Flow;>
+<!ATTLIST iframe
+  %coreattrs;
+  longdesc    %URI;          #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  src         %URI;          #IMPLIED
+  frameborder (1|0)          "1"
+  marginwidth %Pixels;       #IMPLIED
+  marginheight %Pixels;      #IMPLIED
+  scrolling   (yes|no|auto)  "auto"
+  align       %ImgAlign;     #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  >
+
+<!-- alternate content container for non frame-based rendering -->
+
+<!ELEMENT noframes (body)>
+<!ATTLIST noframes
+  %attrs;
+  >
+
+<!--=================== Document Body ====================================-->
+
+<!ELEMENT body %Flow;>
+<!ATTLIST body
+  %attrs;
+  onload      %Script;       #IMPLIED
+  onunload    %Script;       #IMPLIED
+  background  %URI;          #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  text        %Color;        #IMPLIED
+  link        %Color;        #IMPLIED
+  vlink       %Color;        #IMPLIED
+  alink       %Color;        #IMPLIED
+  >
+
+<!ELEMENT div %Flow;>  <!-- generic language/style container -->
+<!ATTLIST div
+  %attrs;
+  %TextAlign;
+  >
+
+<!--=================== Paragraphs =======================================-->
+
+<!ELEMENT p %Inline;>
+<!ATTLIST p
+  %attrs;
+  %TextAlign;
+  >
+
+<!--=================== Headings =========================================-->
+
+<!--
+  There are six levels of headings from h1 (the most important)
+  to h6 (the least important).
+-->
+
+<!ELEMENT h1  %Inline;>
+<!ATTLIST h1
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h2 %Inline;>
+<!ATTLIST h2
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h3 %Inline;>
+<!ATTLIST h3
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h4 %Inline;>
+<!ATTLIST h4
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h5 %Inline;>
+<!ATTLIST h5
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h6 %Inline;>
+<!ATTLIST h6
+  %attrs;
+  %TextAlign;
+  >
+
+<!--=================== Lists ============================================-->
+
+<!-- Unordered list bullet styles -->
+
+<!ENTITY % ULStyle "(disc|square|circle)">
+
+<!-- Unordered list -->
+
+<!ELEMENT ul (li)+>
+<!ATTLIST ul
+  %attrs;
+  type        %ULStyle;     #IMPLIED
+  compact     (compact)     #IMPLIED
+  >
+
+<!-- Ordered list numbering style
+
+    1   arabic numbers      1, 2, 3, ...
+    a   lower alpha         a, b, c, ...
+    A   upper alpha         A, B, C, ...
+    i   lower roman         i, ii, iii, ...
+    I   upper roman         I, II, III, ...
+
+    The style is applied to the sequence number which by default
+    is reset to 1 for the first list item in an ordered list.
+-->
+<!ENTITY % OLStyle "CDATA">
+
+<!-- Ordered (numbered) list -->
+
+<!ELEMENT ol (li)+>
+<!ATTLIST ol
+  %attrs;
+  type        %OLStyle;      #IMPLIED
+  compact     (compact)      #IMPLIED
+  start       %Number;       #IMPLIED
+  >
+
+<!-- single column list (DEPRECATED) --> 
+<!ELEMENT menu (li)+>
+<!ATTLIST menu
+  %attrs;
+  compact     (compact)     #IMPLIED
+  >
+
+<!-- multiple column list (DEPRECATED) --> 
+<!ELEMENT dir (li)+>
+<!ATTLIST dir
+  %attrs;
+  compact     (compact)     #IMPLIED
+  >
+
+<!-- LIStyle is constrained to: "(%ULStyle;|%OLStyle;)" -->
+<!ENTITY % LIStyle "CDATA">
+
+<!-- list item -->
+
+<!ELEMENT li %Flow;>
+<!ATTLIST li
+  %attrs;
+  type        %LIStyle;      #IMPLIED
+  value       %Number;       #IMPLIED
+  >
+
+<!-- definition lists - dt for term, dd for its definition -->
+
+<!ELEMENT dl (dt|dd)+>
+<!ATTLIST dl
+  %attrs;
+  compact     (compact)      #IMPLIED
+  >
+
+<!ELEMENT dt %Inline;>
+<!ATTLIST dt
+  %attrs;
+  >
+
+<!ELEMENT dd %Flow;>
+<!ATTLIST dd
+  %attrs;
+  >
+
+<!--=================== Address ==========================================-->
+
+<!-- information on author -->
+
+<!ELEMENT address (#PCDATA | %inline; | %misc.inline; | p)*>
+<!ATTLIST address
+  %attrs;
+  >
+
+<!--=================== Horizontal Rule ==================================-->
+
+<!ELEMENT hr EMPTY>
+<!ATTLIST hr
+  %attrs;
+  align       (left|center|right) #IMPLIED
+  noshade     (noshade)      #IMPLIED
+  size        %Pixels;       #IMPLIED
+  width       %Length;       #IMPLIED
+  >
+
+<!--=================== Preformatted Text ================================-->
+
+<!-- content is %Inline; excluding 
+        "img|object|applet|big|small|sub|sup|font|basefont" -->
+
+<!ELEMENT pre %pre.content;>
+<!ATTLIST pre
+  %attrs;
+  width       %Number;      #IMPLIED
+  xml:space   (preserve)    #FIXED 'preserve'
+  >
+
+<!--=================== Block-like Quotes ================================-->
+
+<!ELEMENT blockquote %Flow;>
+<!ATTLIST blockquote
+  %attrs;
+  cite        %URI;          #IMPLIED
+  >
+
+<!--=================== Text alignment ===================================-->
+
+<!-- center content -->
+<!ELEMENT center %Flow;>
+<!ATTLIST center
+  %attrs;
+  >
+
+<!--=================== Inserted/Deleted Text ============================-->
+
+
+<!--
+  ins/del are allowed in block and inline content, but its
+  inappropriate to include block content within an ins element
+  occurring in inline content.
+-->
+<!ELEMENT ins %Flow;>
+<!ATTLIST ins
+  %attrs;
+  cite        %URI;          #IMPLIED
+  datetime    %Datetime;     #IMPLIED
+  >
+
+<!ELEMENT del %Flow;>
+<!ATTLIST del
+  %attrs;
+  cite        %URI;          #IMPLIED
+  datetime    %Datetime;     #IMPLIED
+  >
+
+<!--================== The Anchor Element ================================-->
+
+<!-- content is %Inline; except that anchors shouldn't be nested -->
+
+<!ELEMENT a %a.content;>
+<!ATTLIST a
+  %attrs;
+  %focus;
+  charset     %Charset;      #IMPLIED
+  type        %ContentType;  #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  href        %URI;          #IMPLIED
+  hreflang    %LanguageCode; #IMPLIED
+  rel         %LinkTypes;    #IMPLIED
+  rev         %LinkTypes;    #IMPLIED
+  shape       %Shape;        "rect"
+  coords      %Coords;       #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!--===================== Inline Elements ================================-->
+
+<!ELEMENT span %Inline;> <!-- generic language/style container -->
+<!ATTLIST span
+  %attrs;
+  >
+
+<!ELEMENT bdo %Inline;>  <!-- I18N BiDi over-ride -->
+<!ATTLIST bdo
+  %coreattrs;
+  %events;
+  lang        %LanguageCode; #IMPLIED
+  xml:lang    %LanguageCode; #IMPLIED
+  dir         (ltr|rtl)      #REQUIRED
+  >
+
+<!ELEMENT br EMPTY>   <!-- forced line break -->
+<!ATTLIST br
+  %coreattrs;
+  clear       (left|all|right|none) "none"
+  >
+
+<!ELEMENT em %Inline;>   <!-- emphasis -->
+<!ATTLIST em %attrs;>
+
+<!ELEMENT strong %Inline;>   <!-- strong emphasis -->
+<!ATTLIST strong %attrs;>
+
+<!ELEMENT dfn %Inline;>   <!-- definitional -->
+<!ATTLIST dfn %attrs;>
+
+<!ELEMENT code %Inline;>   <!-- program code -->
+<!ATTLIST code %attrs;>
+
+<!ELEMENT samp %Inline;>   <!-- sample -->
+<!ATTLIST samp %attrs;>
+
+<!ELEMENT kbd %Inline;>  <!-- something user would type -->
+<!ATTLIST kbd %attrs;>
+
+<!ELEMENT var %Inline;>   <!-- variable -->
+<!ATTLIST var %attrs;>
+
+<!ELEMENT cite %Inline;>   <!-- citation -->
+<!ATTLIST cite %attrs;>
+
+<!ELEMENT abbr %Inline;>   <!-- abbreviation -->
+<!ATTLIST abbr %attrs;>
+
+<!ELEMENT acronym %Inline;>   <!-- acronym -->
+<!ATTLIST acronym %attrs;>
+
+<!ELEMENT q %Inline;>   <!-- inlined quote -->
+<!ATTLIST q
+  %attrs;
+  cite        %URI;          #IMPLIED
+  >
+
+<!ELEMENT sub %Inline;> <!-- subscript -->
+<!ATTLIST sub %attrs;>
+
+<!ELEMENT sup %Inline;> <!-- superscript -->
+<!ATTLIST sup %attrs;>
+
+<!ELEMENT tt %Inline;>   <!-- fixed pitch font -->
+<!ATTLIST tt %attrs;>
+
+<!ELEMENT i %Inline;>   <!-- italic font -->
+<!ATTLIST i %attrs;>
+
+<!ELEMENT b %Inline;>   <!-- bold font -->
+<!ATTLIST b %attrs;>
+
+<!ELEMENT big %Inline;>   <!-- bigger font -->
+<!ATTLIST big %attrs;>
+
+<!ELEMENT small %Inline;>   <!-- smaller font -->
+<!ATTLIST small %attrs;>
+
+<!ELEMENT u %Inline;>   <!-- underline -->
+<!ATTLIST u %attrs;>
+
+<!ELEMENT s %Inline;>   <!-- strike-through -->
+<!ATTLIST s %attrs;>
+
+<!ELEMENT strike %Inline;>   <!-- strike-through -->
+<!ATTLIST strike %attrs;>
+
+<!ELEMENT basefont EMPTY>  <!-- base font size -->
+<!ATTLIST basefont
+  id          ID             #IMPLIED
+  size        CDATA          #REQUIRED
+  color       %Color;        #IMPLIED
+  face        CDATA          #IMPLIED
+  >
+
+<!ELEMENT font %Inline;> <!-- local change to font -->
+<!ATTLIST font
+  %coreattrs;
+  %i18n;
+  size        CDATA          #IMPLIED
+  color       %Color;        #IMPLIED
+  face        CDATA          #IMPLIED
+  >
+
+<!--==================== Object ======================================-->
+<!--
+  object is used to embed objects as part of HTML pages.
+  param elements should precede other content. Parameters
+  can also be expressed as attribute/value pairs on the
+  object element itself when brevity is desired.
+-->
+
+<!ELEMENT object (#PCDATA | param | %block; | form |%inline; | %misc;)*>
+<!ATTLIST object
+  %attrs;
+  declare     (declare)      #IMPLIED
+  classid     %URI;          #IMPLIED
+  codebase    %URI;          #IMPLIED
+  data        %URI;          #IMPLIED
+  type        %ContentType;  #IMPLIED
+  codetype    %ContentType;  #IMPLIED
+  archive     %UriList;      #IMPLIED
+  standby     %Text;         #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  usemap      %URI;          #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  align       %ImgAlign;     #IMPLIED
+  border      %Pixels;       #IMPLIED
+  hspace      %Pixels;       #IMPLIED
+  vspace      %Pixels;       #IMPLIED
+  >
+
+<!--
+  param is used to supply a named property value.
+  In XML it would seem natural to follow RDF and support an
+  abbreviated syntax where the param elements are replaced
+  by attribute value pairs on the object start tag.
+-->
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+  id          ID             #IMPLIED
+  name        CDATA          #REQUIRED
+  value       CDATA          #IMPLIED
+  valuetype   (data|ref|object) "data"
+  type        %ContentType;  #IMPLIED
+  >
+
+<!--=================== Java applet ==================================-->
+<!--
+  One of code or object attributes must be present.
+  Place param elements before other content.
+-->
+<!ELEMENT applet (#PCDATA | param | %block; | form | %inline; | %misc;)*>
+<!ATTLIST applet
+  %coreattrs;
+  codebase    %URI;          #IMPLIED
+  archive     CDATA          #IMPLIED
+  code        CDATA          #IMPLIED
+  object      CDATA          #IMPLIED
+  alt         %Text;         #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  width       %Length;       #REQUIRED
+  height      %Length;       #REQUIRED
+  align       %ImgAlign;     #IMPLIED
+  hspace      %Pixels;       #IMPLIED
+  vspace      %Pixels;       #IMPLIED
+  >
+
+<!--=================== Images ===========================================-->
+
+<!--
+   To avoid accessibility problems for people who aren't
+   able to see the image, you should provide a text
+   description using the alt and longdesc attributes.
+   In addition, avoid the use of server-side image maps.
+-->
+
+<!ELEMENT img EMPTY>
+<!ATTLIST img
+  %attrs;
+  src         %URI;          #REQUIRED
+  alt         %Text;         #REQUIRED
+  name        NMTOKEN        #IMPLIED
+  longdesc    %URI;          #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  usemap      %URI;          #IMPLIED
+  ismap       (ismap)        #IMPLIED
+  align       %ImgAlign;     #IMPLIED
+  border      %Pixels;       #IMPLIED
+  hspace      %Pixels;       #IMPLIED
+  vspace      %Pixels;       #IMPLIED
+  >
+
+<!-- usemap points to a map element which may be in this document
+  or an external document, although the latter is not widely supported -->
+
+<!--================== Client-side image maps ============================-->
+
+<!-- These can be placed in the same document or grouped in a
+     separate document although this isn't yet widely supported -->
+
+<!ELEMENT map ((%block; | form | %misc;)+ | area+)>
+<!ATTLIST map
+  %i18n;
+  %events;
+  id          ID             #REQUIRED
+  class       CDATA          #IMPLIED
+  style       %StyleSheet;   #IMPLIED
+  title       %Text;         #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  >
+
+<!ELEMENT area EMPTY>
+<!ATTLIST area
+  %attrs;
+  %focus;
+  shape       %Shape;        "rect"
+  coords      %Coords;       #IMPLIED
+  href        %URI;          #IMPLIED
+  nohref      (nohref)       #IMPLIED
+  alt         %Text;         #REQUIRED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!--================ Forms ===============================================-->
+
+<!ELEMENT form %form.content;>   <!-- forms shouldn't be nested -->
+
+<!ATTLIST form
+  %attrs;
+  action      %URI;          #REQUIRED
+  method      (get|post)     "get"
+  name        NMTOKEN        #IMPLIED
+  enctype     %ContentType;  "application/x-www-form-urlencoded"
+  onsubmit    %Script;       #IMPLIED
+  onreset     %Script;       #IMPLIED
+  accept      %ContentTypes; #IMPLIED
+  accept-charset %Charsets;  #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!--
+  Each label must not contain more than ONE field
+  Label elements shouldn't be nested.
+-->
+<!ELEMENT label %Inline;>
+<!ATTLIST label
+  %attrs;
+  for         IDREF          #IMPLIED
+  accesskey   %Character;    #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED
+  >
+
+<!ENTITY % InputType
+  "(text | password | checkbox |
+    radio | submit | reset |
+    file | hidden | image | button)"
+   >
+
+<!-- the name attribute is required for all but submit & reset -->
+
+<!ELEMENT input EMPTY>     <!-- form control -->
+<!ATTLIST input
+  %attrs;
+  %focus;
+  type        %InputType;    "text"
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED
+  checked     (checked)      #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  readonly    (readonly)     #IMPLIED
+  size        CDATA          #IMPLIED
+  maxlength   %Number;       #IMPLIED
+  src         %URI;          #IMPLIED
+  alt         CDATA          #IMPLIED
+  usemap      %URI;          #IMPLIED
+  onselect    %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  accept      %ContentTypes; #IMPLIED
+  align       %ImgAlign;     #IMPLIED
+  >
+
+<!ELEMENT select (optgroup|option)+>  <!-- option selector -->
+<!ATTLIST select
+  %attrs;
+  name        CDATA          #IMPLIED
+  size        %Number;       #IMPLIED
+  multiple    (multiple)     #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  >
+
+<!ELEMENT optgroup (option)+>   <!-- option group -->
+<!ATTLIST optgroup
+  %attrs;
+  disabled    (disabled)     #IMPLIED
+  label       %Text;         #REQUIRED
+  >
+
+<!ELEMENT option (#PCDATA)>     <!-- selectable choice -->
+<!ATTLIST option
+  %attrs;
+  selected    (selected)     #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  label       %Text;         #IMPLIED
+  value       CDATA          #IMPLIED
+  >
+
+<!ELEMENT textarea (#PCDATA)>     <!-- multi-line text field -->
+<!ATTLIST textarea
+  %attrs;
+  %focus;
+  name        CDATA          #IMPLIED
+  rows        %Number;       #REQUIRED
+  cols        %Number;       #REQUIRED
+  disabled    (disabled)     #IMPLIED
+  readonly    (readonly)     #IMPLIED
+  onselect    %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  >
+
+<!--
+  The fieldset element is used to group form fields.
+  Only one legend element should occur in the content
+  and if present should only be preceded by whitespace.
+-->
+<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>
+<!ATTLIST fieldset
+  %attrs;
+  >
+
+<!ENTITY % LAlign "(top|bottom|left|right)">
+
+<!ELEMENT legend %Inline;>     <!-- fieldset label -->
+<!ATTLIST legend
+  %attrs;
+  accesskey   %Character;    #IMPLIED
+  align       %LAlign;       #IMPLIED
+  >
+
+<!--
+ Content is %Flow; excluding a, form, form controls, iframe
+--> 
+<!ELEMENT button %button.content;>  <!-- push button -->
+<!ATTLIST button
+  %attrs;
+  %focus;
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED
+  type        (button|submit|reset) "submit"
+  disabled    (disabled)     #IMPLIED
+  >
+
+<!-- single-line text input control (DEPRECATED) -->
+<!ELEMENT isindex EMPTY>
+<!ATTLIST isindex
+  %coreattrs;
+  %i18n;
+  prompt      %Text;         #IMPLIED
+  >
+
+<!--======================= Tables =======================================-->
+
+<!-- Derived from IETF HTML table standard, see [RFC1942] -->
+
+<!--
+ The border attribute sets the thickness of the frame around the
+ table. The default units are screen pixels.
+
+ The frame attribute specifies which parts of the frame around
+ the table should be rendered. The values are not the same as
+ CALS to avoid a name clash with the valign attribute.
+-->
+<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
+
+<!--
+ The rules attribute defines which rules to draw between cells:
+
+ If rules is absent then assume:
+     "none" if border is absent or border="0" otherwise "all"
+-->
+
+<!ENTITY % TRules "(none | groups | rows | cols | all)">
+  
+<!-- horizontal placement of table relative to document -->
+<!ENTITY % TAlign "(left|center|right)">
+
+<!-- horizontal alignment attributes for cell contents
+
+  char        alignment char, e.g. char=":"
+  charoff     offset for alignment char
+-->
+<!ENTITY % cellhalign
+  "align      (left|center|right|justify|char) #IMPLIED
+   char       %Character;    #IMPLIED
+   charoff    %Length;       #IMPLIED"
+  >
+
+<!-- vertical alignment attributes for cell contents -->
+<!ENTITY % cellvalign
+  "valign     (top|middle|bottom|baseline) #IMPLIED"
+  >
+
+<!ELEMENT table
+     (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
+<!ELEMENT caption  %Inline;>
+<!ELEMENT thead    (tr)+>
+<!ELEMENT tfoot    (tr)+>
+<!ELEMENT tbody    (tr)+>
+<!ELEMENT colgroup (col)*>
+<!ELEMENT col      EMPTY>
+<!ELEMENT tr       (th|td)+>
+<!ELEMENT th       %Flow;>
+<!ELEMENT td       %Flow;>
+
+<!ATTLIST table
+  %attrs;
+  summary     %Text;         #IMPLIED
+  width       %Length;       #IMPLIED
+  border      %Pixels;       #IMPLIED
+  frame       %TFrame;       #IMPLIED
+  rules       %TRules;       #IMPLIED
+  cellspacing %Length;       #IMPLIED
+  cellpadding %Length;       #IMPLIED
+  align       %TAlign;       #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  >
+
+<!ENTITY % CAlign "(top|bottom|left|right)">
+
+<!ATTLIST caption
+  %attrs;
+  align       %CAlign;       #IMPLIED
+  >
+
+<!--
+colgroup groups a set of col elements. It allows you to group
+several semantically related columns together.
+-->
+<!ATTLIST colgroup
+  %attrs;
+  span        %Number;       "1"
+  width       %MultiLength;  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!--
+ col elements define the alignment properties for cells in
+ one or more columns.
+
+ The width attribute specifies the width of the columns, e.g.
+
+     width=64        width in screen pixels
+     width=0.5*      relative width of 0.5
+
+ The span attribute causes the attributes of one
+ col element to apply to more than one column.
+-->
+<!ATTLIST col
+  %attrs;
+  span        %Number;       "1"
+  width       %MultiLength;  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!--
+    Use thead to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    tbody sections are rendered in scrolling panel.
+
+    Use tfoot to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    tbody sections are rendered in scrolling panel.
+
+    Use multiple tbody sections when rules are needed
+    between groups of table rows.
+-->
+<!ATTLIST thead
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tfoot
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tbody
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tr
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  bgcolor     %Color;        #IMPLIED
+  >
+
+<!-- Scope is simpler than headers attribute for common tables -->
+<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
+
+<!-- th is for headers, td for data and for cells acting as both -->
+
+<!ATTLIST th
+  %attrs;
+  abbr        %Text;         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       %Scope;        #IMPLIED
+  rowspan     %Number;       "1"
+  colspan     %Number;       "1"
+  %cellhalign;
+  %cellvalign;
+  nowrap      (nowrap)       #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  width       %Pixels;       #IMPLIED
+  height      %Pixels;       #IMPLIED
+  >
+
+<!ATTLIST td
+  %attrs;
+  abbr        %Text;         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       %Scope;        #IMPLIED
+  rowspan     %Number;       "1"
+  colspan     %Number;       "1"
+  %cellhalign;
+  %cellvalign;
+  nowrap      (nowrap)       #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  width       %Pixels;       #IMPLIED
+  height      %Pixels;       #IMPLIED
+  >
+
diff --git a/xml/impl/resources/standardSchemas/xhtml1-frameset.xsd b/xml/impl/resources/standardSchemas/xhtml1-frameset.xsd
new file mode 100644
index 0000000..741c9ab
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml1-frameset.xsd
@@ -0,0 +1,2848 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema version="1.0" xml:lang="en"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.w3.org/1999/xhtml"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:xml="http://www.w3.org/XML/1998/namespace"
+    elementFormDefault="qualified">
+
+  <xs:annotation>
+    <xs:documentation>
+    XHTML 1.0 (Second Edition) Frameset in XML Schema
+
+    This is the same as HTML 4 Frameset except for
+    changes due to the differences between XML and SGML.
+
+    Namespace = http://www.w3.org/1999/xhtml
+
+    For further information, see: http://www.w3.org/TR/xhtml1
+
+    Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
+    All Rights Reserved.
+
+    The DTD version is identified by the PUBLIC and SYSTEM identifiers:
+
+    PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
+
+    $Id: xhtml1-frameset.xsd,v 1.5 2002/08/28 09:53:29 mimasa Exp $
+    </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>
+    ================ Character mnemonic entities =========================
+
+    XHTML entity sets are identified by the PUBLIC and SYSTEM identifiers:
+
+    PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent"
+
+    PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent"
+
+    PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent"
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Imported Names ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="ContentType">
+    <xs:annotation>
+      <xs:documentation>
+      media type, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="ContentTypes">
+    <xs:annotation>
+      <xs:documentation>
+      comma-separated list of media types, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Charset">
+    <xs:annotation>
+      <xs:documentation>
+      a character encoding, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Charsets">
+    <xs:annotation>
+      <xs:documentation>
+      a space separated list of character encodings, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="LanguageCode">
+    <xs:annotation>
+      <xs:documentation>
+      a language code, as per [RFC3066]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:language"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Character">
+    <xs:annotation>
+      <xs:documentation>
+      a single character, as per section 2.2 of [XML]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:length value="1" fixed="true"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Number">
+    <xs:annotation>
+      <xs:documentation>
+      one or more digits
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger">
+      <xs:pattern value="[0-9]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="tabindexNumber">
+    <xs:annotation>
+      <xs:documentation>
+      tabindex attribute specifies the position of the current element
+      in the tabbing order for the current document. This value must be
+      a number between 0 and 32767. User agents should ignore leading zeros.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="Number">
+      <xs:minInclusive value="0"/>
+      <xs:maxInclusive value="32767"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="LinkTypes">
+    <xs:annotation>
+      <xs:documentation>
+      space-separated list of link types
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKENS"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="MediaDesc">
+    <xs:annotation>
+      <xs:documentation>
+      single or comma-separated list of media descriptors
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[^,]+(,\s*[^,]+)*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="URI">
+    <xs:annotation>
+      <xs:documentation>
+      a Uniform Resource Identifier, see [RFC2396]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:anyURI"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="UriList">
+    <xs:annotation>
+      <xs:documentation>
+      a space separated list of Uniform Resource Identifiers
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Datetime">
+    <xs:annotation>
+      <xs:documentation>
+      date and time information. ISO date format
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:dateTime"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Script">
+    <xs:annotation>
+      <xs:documentation>
+      script expression
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="StyleSheet">
+    <xs:annotation>
+      <xs:documentation>
+      style sheet data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Text">
+    <xs:annotation>
+      <xs:documentation>
+      used for titles etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="FrameTarget">
+    <xs:annotation>
+      <xs:documentation>
+      render in this frame
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKEN">
+      <xs:pattern value="_(blank|self|parent|top)|[A-Za-z]\c*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Length">
+    <xs:annotation>
+      <xs:documentation>
+      nn for pixels or nn% for percentage length
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[\-+]?(\d+|\d+(\.\d+)?%)"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="MultiLength">
+    <xs:annotation>
+      <xs:documentation>
+      pixel, percentage, or relative
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[\-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="MultiLengths">
+    <xs:annotation>
+      <xs:documentation>
+      comma-separated list of MultiLength
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern
+          value="[\-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*(,\s*[\-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*)*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Pixels">
+    <xs:annotation>
+      <xs:documentation>
+      integer representing length in pixels
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger"/>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    these are used for image maps
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="Shape">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="rect"/>
+      <xs:enumeration value="circle"/>
+      <xs:enumeration value="poly"/>
+      <xs:enumeration value="default"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Coords">
+    <xs:annotation>
+      <xs:documentation>
+      comma separated list of lengths
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern
+          value="[\-+]?(\d+|\d+(\.\d+)?%)(,\s*[\-+]?(\d+|\d+(\.\d+)?%))*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="ImgAlign">
+    <xs:annotation>
+      <xs:documentation>
+      used for object, applet, img, input and iframe
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="top"/>
+      <xs:enumeration value="middle"/>
+      <xs:enumeration value="bottom"/>
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Color">
+    <xs:annotation>
+      <xs:documentation>
+      a color using sRGB: #RRGGBB as Hex values
+
+      There are also 16 widely known color names with their sRGB values:
+
+      Black  = #000000    Green  = #008000
+      Silver = #C0C0C0    Lime   = #00FF00
+      Gray   = #808080    Olive  = #808000
+      White  = #FFFFFF    Yellow = #FFFF00
+      Maroon = #800000    Navy   = #000080
+      Red    = #FF0000    Blue   = #0000FF
+      Purple = #800080    Teal   = #008080
+      Fuchsia= #FF00FF    Aqua   = #00FFFF
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[A-Za-z]+|#[0-9A-Fa-f]{3}|#[0-9A-Fa-f]{6}"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Generic Attributes ===============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attributeGroup name="coreattrs">
+    <xs:annotation>
+      <xs:documentation>
+      core attributes common to most elements
+      id       document-wide unique id
+      class    space separated list of classes
+      style    associated style info
+      title    advisory title/amplification
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="id" type="xs:ID"/>
+    <xs:attribute name="class" type="xs:NMTOKENS"/>
+    <xs:attribute name="style" type="StyleSheet"/>
+    <xs:attribute name="title" type="Text"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="i18n">
+    <xs:annotation>
+      <xs:documentation>
+      internationalization attributes
+      lang        language code (backwards compatible)
+      xml:lang    language code (as per XML 1.0 spec)
+      dir         direction for weak/neutral text
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="lang" type="LanguageCode"/>
+    <xs:attribute ref="xml:lang"/>
+    <xs:attribute name="dir">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="ltr"/>
+          <xs:enumeration value="rtl"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="events">
+    <xs:annotation>
+      <xs:documentation>
+      attributes for common UI events
+      onclick     a pointer button was clicked
+      ondblclick  a pointer button was double clicked
+      onmousedown a pointer button was pressed down
+      onmouseup   a pointer button was released
+      onmousemove a pointer was moved onto the element
+      onmouseout  a pointer was moved away from the element
+      onkeypress  a key was pressed and released
+      onkeydown   a key was pressed down
+      onkeyup     a key was released
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="onclick" type="Script"/>
+    <xs:attribute name="ondblclick" type="Script"/>
+    <xs:attribute name="onmousedown" type="Script"/>
+    <xs:attribute name="onmouseup" type="Script"/>
+    <xs:attribute name="onmouseover" type="Script"/>
+    <xs:attribute name="onmousemove" type="Script"/>
+    <xs:attribute name="onmouseout" type="Script"/>
+    <xs:attribute name="onkeypress" type="Script"/>
+    <xs:attribute name="onkeydown" type="Script"/>
+    <xs:attribute name="onkeyup" type="Script"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="focus">
+    <xs:annotation>
+      <xs:documentation>
+      attributes for elements that can get the focus
+      accesskey   accessibility key character
+      tabindex    position in tabbing order
+      onfocus     the element got the focus
+      onblur      the element lost the focus
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="accesskey" type="Character"/>
+    <xs:attribute name="tabindex" type="tabindexNumber"/>
+    <xs:attribute name="onfocus" type="Script"/>
+    <xs:attribute name="onblur" type="Script"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="attrs">
+    <xs:attributeGroup ref="coreattrs"/>
+    <xs:attributeGroup ref="i18n"/>
+    <xs:attributeGroup ref="events"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="TextAlign">
+    <xs:annotation>
+      <xs:documentation>
+      text alignment for p, div, h1-h6. The default is
+      align="left" for ltr headings, "right" for rtl
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="align">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="left"/>
+          <xs:enumeration value="center"/>
+          <xs:enumeration value="right"/>
+          <xs:enumeration value="justify"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Text Elements ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="special.extra">
+    <xs:choice>
+      <xs:element ref="object"/>
+      <xs:element ref="applet"/>
+      <xs:element ref="img"/>
+      <xs:element ref="map"/>
+      <xs:element ref="iframe"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="special.basic">
+    <xs:choice>
+      <xs:element ref="br"/>
+      <xs:element ref="span"/>
+      <xs:element ref="bdo"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="special">
+    <xs:choice>
+      <xs:group ref="special.basic"/>
+      <xs:group ref="special.extra"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle.extra">
+    <xs:choice>
+      <xs:element ref="big"/>
+      <xs:element ref="small"/>
+      <xs:element ref="font"/>
+      <xs:element ref="basefont"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle.basic">
+    <xs:choice>
+      <xs:element ref="tt"/>
+      <xs:element ref="i"/>
+      <xs:element ref="b"/>
+      <xs:element ref="u"/>
+      <xs:element ref="s"/>
+      <xs:element ref="strike"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle">
+    <xs:choice>
+      <xs:group ref="fontstyle.basic"/>
+      <xs:group ref="fontstyle.extra"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase.extra">
+    <xs:choice>
+      <xs:element ref="sub"/>
+      <xs:element ref="sup"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase.basic">
+    <xs:choice>
+      <xs:element ref="em"/>
+      <xs:element ref="strong"/>
+      <xs:element ref="dfn"/>
+      <xs:element ref="code"/>
+      <xs:element ref="q"/>
+      <xs:element ref="samp"/>
+      <xs:element ref="kbd"/>
+      <xs:element ref="var"/>
+      <xs:element ref="cite"/>
+      <xs:element ref="abbr"/>
+      <xs:element ref="acronym"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase">
+    <xs:choice>
+      <xs:group ref="phrase.basic"/>
+      <xs:group ref="phrase.extra"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="inline.forms">
+    <xs:choice>
+      <xs:element ref="input"/>
+      <xs:element ref="select"/>
+      <xs:element ref="textarea"/>
+      <xs:element ref="label"/>
+      <xs:element ref="button"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="misc.inline">
+    <xs:annotation>
+      <xs:documentation>
+      these can only occur at block level
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:element ref="ins"/>
+      <xs:element ref="del"/>
+      <xs:element ref="script"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="misc">
+    <xs:annotation>
+      <xs:documentation>
+      these can only occur at block level
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:element ref="noscript"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="inline">
+    <xs:choice>
+      <xs:element ref="a"/>
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="inline.forms"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="Inline" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      "Inline" covers inline or "text-level" element
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="inline"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Block level elements ==============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="heading">
+    <xs:choice>
+      <xs:element ref="h1"/>
+      <xs:element ref="h2"/>
+      <xs:element ref="h3"/>
+      <xs:element ref="h4"/>
+      <xs:element ref="h5"/>
+      <xs:element ref="h6"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="lists">
+    <xs:choice>
+      <xs:element ref="ul"/>
+      <xs:element ref="ol"/>
+      <xs:element ref="dl"/>
+      <xs:element ref="menu"/>
+      <xs:element ref="dir"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="blocktext">
+    <xs:choice>
+      <xs:element ref="pre"/>
+      <xs:element ref="hr"/>
+      <xs:element ref="blockquote"/>
+      <xs:element ref="address"/>
+      <xs:element ref="center"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="block">
+    <xs:choice>
+      <xs:element ref="p"/>
+      <xs:group ref="heading"/>
+      <xs:element ref="div"/>
+      <xs:group ref="lists"/>
+      <xs:group ref="blocktext"/>
+      <xs:element ref="isindex"/>
+      <xs:element ref="fieldset"/>
+      <xs:element ref="table"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="Flow" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      "Flow" mixes block and inline and is used for list items etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:element ref="form"/>
+      <xs:group ref="inline"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Content models for exclusions =====================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:complexType name="a.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      a elements use "Inline" excluding a
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="inline.forms"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="pre.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      pre uses "Inline" excluding img, object, applet, big, small,
+      sub, sup, font, or basefont
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="a"/>
+      <xs:group ref="special.basic"/>
+      <xs:group ref="fontstyle.basic"/>
+      <xs:group ref="phrase.basic"/>
+      <xs:group ref="inline.forms"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="form.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      form uses "Flow" excluding form
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:group ref="inline"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="button.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      button uses "Flow" but excludes a, form, form controls, iframe
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="p"/>
+      <xs:group ref="heading"/>
+      <xs:element ref="div"/>
+      <xs:group ref="lists"/>
+      <xs:group ref="blocktext"/>
+      <xs:element ref="table"/>
+      <xs:element ref="br"/>
+      <xs:element ref="span"/>
+      <xs:element ref="bdo"/>
+      <xs:element ref="object"/>
+      <xs:element ref="applet"/>
+      <xs:element ref="img"/>
+      <xs:element ref="map"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Document Structure ==================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="html">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="head"/>
+        <xs:element ref="frameset"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Document Head =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="head.misc">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="script"/>
+        <xs:element ref="style"/>
+        <xs:element ref="meta"/>
+        <xs:element ref="link"/>
+        <xs:element ref="object"/>
+        <xs:element ref="isindex"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:group>
+
+  <xs:element name="head">
+    <xs:annotation>
+      <xs:documentation>
+      content model is "head.misc" combined with a single
+      title and an optional base element in any order
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="head.misc"/>
+        <xs:choice>
+          <xs:sequence>
+            <xs:element ref="title"/>
+            <xs:group ref="head.misc"/>
+            <xs:sequence minOccurs="0">
+              <xs:element ref="base"/>
+              <xs:group ref="head.misc"/>
+            </xs:sequence>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element ref="base"/>
+            <xs:group ref="head.misc"/>
+            <xs:element ref="title"/>
+            <xs:group ref="head.misc"/>
+          </xs:sequence>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="profile" type="URI"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="title">
+    <xs:annotation>
+      <xs:documentation>
+      The title element is not considered part of the flow of text.
+      It should be displayed, for example as the page header or
+      window title. Exactly one title is required per document.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="base">
+    <xs:annotation>
+      <xs:documentation>
+      document base URI
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="target" type="FrameTarget"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="meta">
+    <xs:annotation>
+      <xs:documentation>
+      generic metainformation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="http-equiv"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="content" use="required"/>
+      <xs:attribute name="scheme"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="link">
+    <xs:annotation>
+      <xs:documentation>
+      Relationship values can be used in principle:
+
+      a) for document specific toolbars/menus when used
+         with the link element in document head e.g.
+           start, contents, previous, next, index, end, help
+      b) to link to a separate style sheet (rel="stylesheet")
+      c) to make a link to a script (rel="script")
+      d) by stylesheets to control how collections of
+         html nodes are rendered into printed documents
+      e) to make a link to a printable version of this document
+         e.g. a PostScript or PDF version (rel="alternate" media="print")
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="charset" type="Charset"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="hreflang" type="LanguageCode"/>
+      <xs:attribute name="type" type="ContentType"/>
+      <xs:attribute name="rel" type="LinkTypes"/>
+      <xs:attribute name="rev" type="LinkTypes"/>
+      <xs:attribute name="media" type="MediaDesc"/>
+      <xs:attribute name="target" type="FrameTarget"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="style">
+    <xs:annotation>
+      <xs:documentation>
+      style info, which may include CDATA sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="type" use="required" type="ContentType"/>
+      <xs:attribute name="media" type="MediaDesc"/>
+      <xs:attribute name="title" type="Text"/>
+      <xs:attribute ref="xml:space" fixed="preserve"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="script">
+    <xs:annotation>
+      <xs:documentation>
+      script statements, which may include CDATA sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="charset" type="Charset"/>
+      <xs:attribute name="type" use="required" type="ContentType"/>
+      <xs:attribute name="language"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="defer">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="defer"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute ref="xml:space" fixed="preserve"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="noscript">
+    <xs:annotation>
+      <xs:documentation>
+      alternate content container for non script-based rendering
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ======================= Frames =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="frameset">
+    <xs:annotation>
+      <xs:documentation>
+      only one noframes element permitted per document
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="frameset"/>
+        <xs:element ref="frame"/>
+        <xs:element ref="noframes"/>
+      </xs:choice>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attribute name="rows" type="MultiLengths"/>
+      <xs:attribute name="cols" type="MultiLengths"/>
+      <xs:attribute name="onload" type="Script"/>
+      <xs:attribute name="onunload" type="Script"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    reserved frame names start with "_" otherwise starts with letter
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="frame">
+    <xs:annotation>
+      <xs:documentation>
+      tiled window within frameset
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attribute name="longdesc" type="URI"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="frameborder" default="1">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="1"/>
+            <xs:enumeration value="0"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="marginwidth" type="Pixels"/>
+      <xs:attribute name="marginheight" type="Pixels"/>
+      <xs:attribute name="noresize">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="noresize"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="scrolling" default="auto">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="yes"/>
+            <xs:enumeration value="no"/>
+            <xs:enumeration value="auto"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="iframe">
+    <xs:annotation>
+      <xs:documentation>
+      inline subwindow
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attribute name="longdesc" type="URI"/>
+          <xs:attribute name="name" type="xs:NMTOKEN"/>
+          <xs:attribute name="src" type="URI"/>
+          <xs:attribute name="frameborder" default="1">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="1"/>
+                <xs:enumeration value="0"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="marginwidth" type="Pixels"/>
+          <xs:attribute name="marginheight" type="Pixels"/>
+          <xs:attribute name="scrolling" default="auto">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="yes"/>
+                <xs:enumeration value="no"/>
+                <xs:enumeration value="auto"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="align" type="ImgAlign"/>
+          <xs:attribute name="height" type="Length"/>
+          <xs:attribute name="width" type="Length"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+<!--
+  <xs:element name="noframes">
+    <xs:annotation>
+      <xs:documentation>
+      alternate content container for non frame-based rendering
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="body">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+-->
+  <xs:element name="noframes">
+    <xs:annotation>
+      <xs:documentation>
+      alternate content container for non frame-based rendering
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="body"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Document Body ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="body">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="onload" type="Script"/>
+          <xs:attribute name="onunload" type="Script"/>
+          <xs:attribute name="background" type="URI"/>
+          <xs:attribute name="bgcolor" type="Color"/>
+          <xs:attribute name="text" type="Color"/>
+          <xs:attribute name="link" type="Color"/>
+          <xs:attribute name="vlink" type="Color"/>
+          <xs:attribute name="alink" type="Color"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="div">
+    <xs:annotation>
+      <xs:documentation>
+      generic language/style container
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Paragraphs =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="p">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Headings =========================================
+
+    There are six levels of headings from h1 (the most important)
+    to h6 (the least important).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="h1">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h2">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h3">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h4">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h5">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h6">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Lists ============================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="ULStyle">
+    <xs:annotation>
+      <xs:documentation>
+      Unordered list bullet styles
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="disc"/>
+      <xs:enumeration value="square"/>
+      <xs:enumeration value="circle"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="ul">
+    <xs:annotation>
+      <xs:documentation>
+      Unordered list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="type" type="ULStyle"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="OLStyle">
+    <xs:annotation>
+      <xs:documentation>
+      Ordered list numbering style
+
+      1   arabic numbers      1, 2, 3, ...
+      a   lower alpha         a, b, c, ...
+      A   upper alpha         A, B, C, ...
+      i   lower roman         i, ii, iii, ...
+      I   upper roman         I, II, III, ...
+
+      The style is applied to the sequence number which by default
+      is reset to 1 for the first list item in an ordered list.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:element name="ol">
+    <xs:annotation>
+      <xs:documentation>
+      Ordered (numbered) list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="type" type="OLStyle"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="start" type="Number"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="menu">
+    <xs:annotation>
+      <xs:documentation>
+      single column list (DEPRECATED)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dir">
+    <xs:annotation>
+      <xs:documentation>
+      multiple column list (DEPRECATED)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="LIStyle">
+    <xs:annotation>
+      <xs:documentation>
+      LIStyle is constrained to: "(ULStyle|OLStyle)"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:element name="li">
+    <xs:annotation>
+      <xs:documentation>
+      list item
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="type" type="LIStyle"/>
+          <xs:attribute name="value" type="Number"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    definition lists - dt for term, dd for its definition
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="dl">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="dt"/>
+        <xs:element ref="dd"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dt">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dd">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Address ==========================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="address">
+    <xs:annotation>
+      <xs:documentation>
+      information on author
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="inline"/>
+        <xs:group ref="misc.inline"/>
+        <xs:element ref="p"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Horizontal Rule ==================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="hr">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="noshade">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="noshade"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="size" type="Pixels"/>
+      <xs:attribute name="width" type="Length"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Preformatted Text ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="pre">
+    <xs:annotation>
+      <xs:documentation>
+      content is "Inline" excluding
+         "img|object|applet|big|small|sub|sup|font|basefont"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="pre.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="width" type="Number"/>
+          <xs:attribute ref="xml:space" fixed="preserve"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Block-like Quotes ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="blockquote">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Text alignment ===================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="center">
+    <xs:annotation>
+      <xs:documentation>
+      center content
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Inserted/Deleted Text ============================
+
+    ins/del are allowed in block and inline content, but its
+    inappropriate to include block content within an ins element
+    occurring in inline content.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="ins">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+          <xs:attribute name="datetime" type="Datetime"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="del">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+          <xs:attribute name="datetime" type="Datetime"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== The Anchor Element ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="a">
+    <xs:annotation>
+      <xs:documentation>
+      content is "Inline" except that anchors shouldn't be nested
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="a.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="focus"/>
+          <xs:attribute name="charset" type="Charset"/>
+          <xs:attribute name="type" type="ContentType"/>
+          <xs:attribute name="name" type="xs:ID"/>
+          <xs:attribute name="href" type="URI"/>
+          <xs:attribute name="hreflang" type="LanguageCode"/>
+          <xs:attribute name="rel" type="LinkTypes"/>
+          <xs:attribute name="rev" type="LinkTypes"/>
+          <xs:attribute name="shape" default="rect" type="Shape"/>
+          <xs:attribute name="coords" type="Coords"/>
+          <xs:attribute name="target" type="FrameTarget"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ===================== Inline Elements ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="span">
+    <xs:annotation>
+      <xs:documentation>
+      generic language/style container
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="bdo">
+    <xs:annotation>
+      <xs:documentation>
+      I18N BiDi over-ride
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attributeGroup ref="events"/>
+          <xs:attribute name="lang" type="LanguageCode"/>
+          <xs:attribute ref="xml:lang"/>
+          <xs:attribute name="dir" use="required">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="ltr"/>
+                <xs:enumeration value="rtl"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="br">
+    <xs:annotation>
+      <xs:documentation>
+      forced line break
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attribute name="clear" default="none">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="all"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="none"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="em">
+    <xs:annotation>
+      <xs:documentation>
+      emphasis
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="strong">
+    <xs:annotation>
+      <xs:documentation>
+      strong emphasis
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dfn">
+    <xs:annotation>
+      <xs:documentation>
+      definitional
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="code">
+    <xs:annotation>
+      <xs:documentation>
+      program code
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="samp">
+    <xs:annotation>
+      <xs:documentation>
+      sample
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="kbd">
+    <xs:annotation>
+      <xs:documentation>
+      something user would type
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="var">
+    <xs:annotation>
+      <xs:documentation>
+      variable
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="cite">
+    <xs:annotation>
+      <xs:documentation>
+      citation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="abbr">
+    <xs:annotation>
+      <xs:documentation>
+      abbreviation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="acronym">
+    <xs:annotation>
+      <xs:documentation>
+      acronym
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="q">
+    <xs:annotation>
+      <xs:documentation>
+      inlined quote
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="sub">
+    <xs:annotation>
+      <xs:documentation>
+      subscript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="sup">
+    <xs:annotation>
+      <xs:documentation>
+      superscript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tt">
+    <xs:annotation>
+      <xs:documentation>
+      fixed pitch font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="i">
+    <xs:annotation>
+      <xs:documentation>
+      italic font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="b">
+    <xs:annotation>
+      <xs:documentation>
+      bold font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="big">
+    <xs:annotation>
+      <xs:documentation>
+      bigger font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="small">
+    <xs:annotation>
+      <xs:documentation>
+      smaller font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="u">
+    <xs:annotation>
+      <xs:documentation>
+      underline
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="s">
+    <xs:annotation>
+      <xs:documentation>
+      strike-through
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="strike">
+    <xs:annotation>
+      <xs:documentation>
+      strike-through
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="basefont">
+    <xs:annotation>
+      <xs:documentation>
+      base font size
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="size" use="required"/>
+      <xs:attribute name="color" type="Color"/>
+      <xs:attribute name="face"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="font">
+    <xs:annotation>
+      <xs:documentation>
+      local change to font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attributeGroup ref="i18n"/>
+          <xs:attribute name="size"/>
+          <xs:attribute name="color" type="Color"/>
+          <xs:attribute name="face"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ==================== Object ======================================
+
+    object is used to embed objects as part of HTML pages.
+    param elements should precede other content. Parameters
+    can also be expressed as attribute/value pairs on the
+    object element itself when brevity is desired.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="object">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="param"/>
+        <xs:group ref="block"/>
+        <xs:element ref="form"/>
+        <xs:group ref="inline"/>
+        <xs:group ref="misc"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="declare">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="declare"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="classid" type="URI"/>
+      <xs:attribute name="codebase" type="URI"/>
+      <xs:attribute name="data" type="URI"/>
+      <xs:attribute name="type" type="ContentType"/>
+      <xs:attribute name="codetype" type="ContentType"/>
+      <xs:attribute name="archive" type="UriList"/>
+      <xs:attribute name="standby" type="Text"/>
+      <xs:attribute name="height" type="Length"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="usemap" type="URI"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="tabindex" type="Number"/>
+      <xs:attribute name="align" type="ImgAlign"/>
+      <xs:attribute name="border" type="Pixels"/>
+      <xs:attribute name="hspace" type="Pixels"/>
+      <xs:attribute name="vspace" type="Pixels"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="param">
+    <xs:annotation>
+      <xs:documentation>
+      param is used to supply a named property value.
+      In XML it would seem natural to follow RDF and support an
+      abbreviated syntax where the param elements are replaced
+      by attribute value pairs on the object start tag.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="value"/>
+      <xs:attribute name="valuetype" default="data">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="data"/>
+            <xs:enumeration value="ref"/>
+            <xs:enumeration value="object"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="type" type="ContentType"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Java applet ==================================
+
+    One of code or object attributes must be present.
+    Place param elements before other content.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="applet">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="param"/>
+        <xs:group ref="block"/>
+        <xs:element ref="form"/>
+        <xs:group ref="inline"/>
+        <xs:group ref="misc"/>
+      </xs:choice>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attribute name="codebase" type="URI"/>
+      <xs:attribute name="archive"/>
+      <xs:attribute name="code"/>
+      <xs:attribute name="object"/>
+      <xs:attribute name="alt" type="Text"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="width" use="required" type="Length"/>
+      <xs:attribute name="height" use="required" type="Length"/>
+      <xs:attribute name="align" type="ImgAlign"/>
+      <xs:attribute name="hspace" type="Pixels"/>
+      <xs:attribute name="vspace" type="Pixels"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Images ===========================================
+
+    To avoid accessibility problems for people who aren't
+    able to see the image, you should provide a text
+    description using the alt and longdesc attributes.
+    In addition, avoid the use of server-side image maps.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="img">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="src" use="required" type="URI"/>
+      <xs:attribute name="alt" use="required" type="Text"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="longdesc" type="URI"/>
+      <xs:attribute name="height" type="Length"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="usemap" type="URI">
+  <xs:annotation>
+    <xs:documentation>
+          usemap points to a map element which may be in this document
+          or an external document, although the latter is not widely supported
+          </xs:documentation>
+  </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name="ismap">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="ismap"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align" type="ImgAlign"/>
+      <xs:attribute name="border" type="Length"/>
+      <xs:attribute name="hspace" type="Pixels"/>
+      <xs:attribute name="vspace" type="Pixels"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Client-side image maps ============================
+
+    These can be placed in the same document or grouped in a
+    separate document although this isn't yet widely supported
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="map">
+    <xs:complexType>
+      <xs:choice>
+        <xs:choice maxOccurs="unbounded">
+          <xs:group ref="block"/>
+          <xs:element ref="form"/>
+          <xs:group ref="misc"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="area"/>
+      </xs:choice>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attributeGroup ref="events"/>
+      <xs:attribute name="id" use="required" type="xs:ID"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style" type="StyleSheet"/>
+      <xs:attribute name="title" type="Text"/>
+      <xs:attribute name="name"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="area">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="shape" default="rect" type="Shape"/>
+      <xs:attribute name="coords" type="Coords"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="nohref">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="nohref"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="alt" use="required" type="Text"/>
+      <xs:attribute name="target" type="FrameTarget"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Forms ===============================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="form">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="form.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="action" use="required" type="URI"/>
+          <xs:attribute name="name" type="xs:NMTOKEN"/>
+          <xs:attribute name="method" default="get">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="get"/>
+                <xs:enumeration value="post"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="enctype" type="ContentType"
+              default="application/x-www-form-urlencoded"/>
+          <xs:attribute name="onsubmit" type="Script"/>
+          <xs:attribute name="onreset" type="Script"/>
+          <xs:attribute name="accept" type="ContentTypes"/>
+          <xs:attribute name="accept-charset" type="Charsets"/>
+          <xs:attribute name="target" type="FrameTarget"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="label">
+    <xs:annotation>
+      <xs:documentation>
+      Each label must not contain more than ONE field
+      Label elements shouldn't be nested.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="for" type="xs:IDREF"/>
+          <xs:attribute name="accesskey" type="Character"/>
+          <xs:attribute name="onfocus" type="Script"/>
+          <xs:attribute name="onblur" type="Script"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="InputType">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="text"/>
+      <xs:enumeration value="password"/>
+      <xs:enumeration value="checkbox"/>
+      <xs:enumeration value="radio"/>
+      <xs:enumeration value="submit"/>
+      <xs:enumeration value="reset"/>
+      <xs:enumeration value="file"/>
+      <xs:enumeration value="hidden"/>
+      <xs:enumeration value="image"/>
+      <xs:enumeration value="button"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="input">
+    <xs:annotation>
+      <xs:documentation>
+      form control
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="type" default="text" type="InputType"/>
+      <xs:attribute name="name">
+  <xs:annotation>
+    <xs:documentation>
+          the name attribute is required for all but submit &amp; reset
+          </xs:documentation>
+  </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name="value"/>
+      <xs:attribute name="checked">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="checked"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="readonly">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="readonly"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="size"/>
+      <xs:attribute name="maxlength" type="Number"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="alt"/>
+      <xs:attribute name="usemap" type="URI"/>
+      <xs:attribute name="onselect" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+      <xs:attribute name="accept" type="ContentTypes"/>
+      <xs:attribute name="align" type="ImgAlign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="select">
+    <xs:annotation>
+      <xs:documentation>
+      option selector
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="optgroup"/>
+        <xs:element ref="option"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="size" type="Number"/>
+      <xs:attribute name="multiple">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="multiple"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="tabindex" type="tabindexNumber"/>
+      <xs:attribute name="onfocus" type="Script"/>
+      <xs:attribute name="onblur" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="optgroup">
+    <xs:annotation>
+      <xs:documentation>
+      option group
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="option"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="label" use="required" type="Text"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="option">
+    <xs:annotation>
+      <xs:documentation>
+      selectable choice
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="selected">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="selected"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="label" type="Text"/>
+      <xs:attribute name="value"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="textarea">
+    <xs:annotation>
+      <xs:documentation>
+      multi-line text field
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="rows" use="required" type="Number"/>
+      <xs:attribute name="cols" use="required" type="Number"/>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="readonly">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="readonly"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="onselect" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="fieldset">
+    <xs:annotation>
+      <xs:documentation>
+      The fieldset element is used to group form fields.
+      Only one legend element should occur in the content
+      and if present should only be preceded by whitespace.
+
+      NOTE: this content model is different from the XHTML 1.0 DTD,
+      closer to the intended content model in HTML4 DTD
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:sequence>
+        <xs:element ref="legend"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:group ref="block"/>
+          <xs:element ref="form"/>
+          <xs:group ref="inline"/>
+          <xs:group ref="misc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="LAlign">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="top"/>
+      <xs:enumeration value="bottom"/>
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="legend">
+    <xs:annotation>
+      <xs:documentation>
+      fieldset label
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="accesskey" type="Character"/>
+          <xs:attribute name="align" type="LAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="button">
+    <xs:annotation>
+      <xs:documentation>
+      Content is "Flow" excluding a, form and form controls
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="button.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="focus"/>
+          <xs:attribute name="name"/>
+          <xs:attribute name="value"/>
+          <xs:attribute name="type" default="submit">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="button"/>
+                <xs:enumeration value="submit"/>
+                <xs:enumeration value="reset"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="disabled">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="disabled"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="isindex">
+    <xs:annotation>
+      <xs:documentation>
+      single-line text input control (DEPRECATED)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="prompt" type="Text"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ======================= Tables =======================================
+
+    Derived from IETF HTML table standard, see [RFC1942]
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="TFrame">
+    <xs:annotation>
+      <xs:documentation>
+      The border attribute sets the thickness of the frame around the
+      table. The default units are screen pixels.
+
+      The frame attribute specifies which parts of the frame around
+      the table should be rendered. The values are not the same as
+      CALS to avoid a name clash with the valign attribute.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="void"/>
+      <xs:enumeration value="above"/>
+      <xs:enumeration value="below"/>
+      <xs:enumeration value="hsides"/>
+      <xs:enumeration value="lhs"/>
+      <xs:enumeration value="rhs"/>
+      <xs:enumeration value="vsides"/>
+      <xs:enumeration value="box"/>
+      <xs:enumeration value="border"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="TRules">
+    <xs:annotation>
+      <xs:documentation>
+      The rules attribute defines which rules to draw between cells:
+
+      If rules is absent then assume:
+          "none" if border is absent or border="0" otherwise "all"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="none"/>
+      <xs:enumeration value="groups"/>
+      <xs:enumeration value="rows"/>
+      <xs:enumeration value="cols"/>
+      <xs:enumeration value="all"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="TAlign">
+    <xs:annotation>
+      <xs:documentation>
+      horizontal placement of table relative to document
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="center"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:attributeGroup name="cellhalign">
+    <xs:annotation>
+      <xs:documentation>
+      horizontal alignment attributes for cell contents
+
+      char        alignment char, e.g. char=":"
+      charoff     offset for alignment char
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="align">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="left"/>
+          <xs:enumeration value="center"/>
+          <xs:enumeration value="right"/>
+          <xs:enumeration value="justify"/>
+          <xs:enumeration value="char"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="char" type="Character"/>
+    <xs:attribute name="charoff" type="Length"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="cellvalign">
+    <xs:annotation>
+      <xs:documentation>
+      vertical alignment attributes for cell contents
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="valign">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="top"/>
+          <xs:enumeration value="middle"/>
+          <xs:enumeration value="bottom"/>
+          <xs:enumeration value="baseline"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:element name="table">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="caption"/>
+        <xs:choice>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="colgroup"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="thead"/>
+        <xs:element minOccurs="0" ref="tfoot"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="tbody"/>
+          <xs:element maxOccurs="unbounded" ref="tr"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="summary" type="Text"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="border" type="Pixels"/>
+      <xs:attribute name="frame" type="TFrame"/>
+      <xs:attribute name="rules" type="TRules"/>
+      <xs:attribute name="cellspacing" type="Length"/>
+      <xs:attribute name="cellpadding" type="Length"/>
+      <xs:attribute name="align" type="TAlign"/>
+      <xs:attribute name="bgcolor" type="Color"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="CAlign">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="top"/>
+      <xs:enumeration value="bottom"/>
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="caption">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="align" type="CAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    Use thead to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    tbody sections are rendered in scrolling panel.
+
+    Use tfoot to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    tbody sections are rendered in scrolling panel.
+
+    Use multiple tbody sections when rules are needed
+    between groups of table rows.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="thead">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tfoot">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tbody">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="colgroup">
+    <xs:annotation>
+      <xs:documentation>
+      colgroup groups a set of col elements. It allows you to group
+      several semantically related columns together.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="span" default="1" type="Number"/>
+      <xs:attribute name="width" type="MultiLength"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="col">
+    <xs:annotation>
+      <xs:documentation>
+      col elements define the alignment properties for cells in
+      one or more columns.
+
+      The width attribute specifies the width of the columns, e.g.
+
+          width=64        width in screen pixels
+          width=0.5*      relative width of 0.5
+
+      The span attribute causes the attributes of one
+      col element to apply to more than one column.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="span" default="1" type="Number"/>
+      <xs:attribute name="width" type="MultiLength"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tr">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="th"/>
+        <xs:element ref="td"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+      <xs:attribute name="bgcolor" type="Color"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="Scope">
+    <xs:annotation>
+      <xs:documentation>
+      Scope is simpler than headers attribute for common tables
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="row"/>
+      <xs:enumeration value="col"/>
+      <xs:enumeration value="rowgroup"/>
+      <xs:enumeration value="colgroup"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    th is for headers, td for data and for cells acting as both
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="th">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="abbr" type="Text"/>
+          <xs:attribute name="axis"/>
+          <xs:attribute name="headers" type="xs:IDREFS"/>
+          <xs:attribute name="scope" type="Scope"/>
+          <xs:attribute name="rowspan" default="1" type="Number"/>
+          <xs:attribute name="colspan" default="1" type="Number"/>
+          <xs:attributeGroup ref="cellhalign"/>
+          <xs:attributeGroup ref="cellvalign"/>
+          <xs:attribute name="nowrap">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="nowrap"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="bgcolor" type="Color"/>
+          <xs:attribute name="width" type="Length"/>
+          <xs:attribute name="height" type="Length"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="td">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="abbr" type="Text"/>
+          <xs:attribute name="axis"/>
+          <xs:attribute name="headers" type="xs:IDREFS"/>
+          <xs:attribute name="scope" type="Scope"/>
+          <xs:attribute name="rowspan" default="1" type="Number"/>
+          <xs:attribute name="colspan" default="1" type="Number"/>
+          <xs:attributeGroup ref="cellhalign"/>
+          <xs:attributeGroup ref="cellvalign"/>
+          <xs:attribute name="nowrap">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="nowrap"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="bgcolor" type="Color"/>
+          <xs:attribute name="width" type="Length"/>
+          <xs:attribute name="height" type="Length"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/impl/resources/standardSchemas/xhtml1-strict.dtd b/xml/impl/resources/standardSchemas/xhtml1-strict.dtd
new file mode 100644
index 0000000..c775f8b
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml1-strict.dtd
@@ -0,0 +1,978 @@
+<!--
+   Extensible HTML version 1.0 Strict DTD
+
+   This is the same as HTML 4 Strict except for
+   changes due to the differences between XML and SGML.
+
+   Namespace = http://www.w3.org/1999/xhtml
+
+   For further information, see: http://www.w3.org/TR/xhtml1
+
+   Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
+   All Rights Reserved. 
+
+   This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+   PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+   SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+
+   $Revision: 1.1 $
+   $Date: 2004/09/17 17:05:38 $
+
+-->
+
+<!--================ Character mnemonic entities =========================-->
+
+<!ENTITY % HTMLlat1 PUBLIC
+   "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+   "xhtml-lat1.ent">
+%HTMLlat1;
+
+<!ENTITY % HTMLsymbol PUBLIC
+   "-//W3C//ENTITIES Symbols for XHTML//EN"
+   "xhtml-symbol.ent">
+%HTMLsymbol;
+
+<!ENTITY % HTMLspecial PUBLIC
+   "-//W3C//ENTITIES Special for XHTML//EN"
+   "xhtml-special.ent">
+%HTMLspecial;
+
+<!--================== Imported Names ====================================-->
+
+<!ENTITY % ContentType "CDATA">
+    <!-- media type, as per [RFC2045] -->
+
+<!ENTITY % ContentTypes "CDATA">
+    <!-- comma-separated list of media types, as per [RFC2045] -->
+
+<!ENTITY % Charset "CDATA">
+    <!-- a character encoding, as per [RFC2045] -->
+
+<!ENTITY % Charsets "CDATA">
+    <!-- a space separated list of character encodings, as per [RFC2045] -->
+
+<!ENTITY % LanguageCode "NMTOKEN">
+    <!-- a language code, as per [RFC3066] -->
+
+<!ENTITY % Character "CDATA">
+    <!-- a single character, as per section 2.2 of [XML] -->
+
+<!ENTITY % Number "CDATA">
+    <!-- one or more digits -->
+
+<!ENTITY % LinkTypes "CDATA">
+    <!-- space-separated list of link types -->
+
+<!ENTITY % MediaDesc "CDATA">
+    <!-- single or comma-separated list of media descriptors -->
+
+<!ENTITY % URI "CDATA">
+    <!-- a Uniform Resource Identifier, see [RFC2396] -->
+
+<!ENTITY % UriList "CDATA">
+    <!-- a space separated list of Uniform Resource Identifiers -->
+
+<!ENTITY % Datetime "CDATA">
+    <!-- date and time information. ISO date format -->
+
+<!ENTITY % Script "CDATA">
+    <!-- script expression -->
+
+<!ENTITY % StyleSheet "CDATA">
+    <!-- style sheet data -->
+
+<!ENTITY % Text "CDATA">
+    <!-- used for titles etc. -->
+
+<!ENTITY % Length "CDATA">
+    <!-- nn for pixels or nn% for percentage length -->
+
+<!ENTITY % MultiLength "CDATA">
+    <!-- pixel, percentage, or relative -->
+
+<!ENTITY % Pixels "CDATA">
+    <!-- integer representing length in pixels -->
+
+<!-- these are used for image maps -->
+
+<!ENTITY % Shape "(rect|circle|poly|default)">
+
+<!ENTITY % Coords "CDATA">
+    <!-- comma separated list of lengths -->
+
+<!--=================== Generic Attributes ===============================-->
+
+<!-- core attributes common to most elements
+  id       document-wide unique id
+  class    space separated list of classes
+  style    associated style info
+  title    advisory title/amplification
+-->
+<!ENTITY % coreattrs
+ "id          ID             #IMPLIED
+  class       CDATA          #IMPLIED
+  style       %StyleSheet;   #IMPLIED
+  title       %Text;         #IMPLIED"
+  >
+
+<!-- internationalization attributes
+  lang        language code (backwards compatible)
+  xml:lang    language code (as per XML 1.0 spec)
+  dir         direction for weak/neutral text
+-->
+<!ENTITY % i18n
+ "lang        %LanguageCode; #IMPLIED
+  xml:lang    %LanguageCode; #IMPLIED
+  dir         (ltr|rtl)      #IMPLIED"
+  >
+
+<!-- attributes for common UI events
+  onclick     a pointer button was clicked
+  ondblclick  a pointer button was double clicked
+  onmousedown a pointer button was pressed down
+  onmouseup   a pointer button was released
+  onmousemove a pointer was moved onto the element
+  onmouseout  a pointer was moved away from the element
+  onkeypress  a key was pressed and released
+  onkeydown   a key was pressed down
+  onkeyup     a key was released
+-->
+<!ENTITY % events
+ "onclick     %Script;       #IMPLIED
+  ondblclick  %Script;       #IMPLIED
+  onmousedown %Script;       #IMPLIED
+  onmouseup   %Script;       #IMPLIED
+  onmouseover %Script;       #IMPLIED
+  onmousemove %Script;       #IMPLIED
+  onmouseout  %Script;       #IMPLIED
+  onkeypress  %Script;       #IMPLIED
+  onkeydown   %Script;       #IMPLIED
+  onkeyup     %Script;       #IMPLIED"
+  >
+
+<!-- attributes for elements that can get the focus
+  accesskey   accessibility key character
+  tabindex    position in tabbing order
+  onfocus     the element got the focus
+  onblur      the element lost the focus
+-->
+<!ENTITY % focus
+ "accesskey   %Character;    #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED"
+  >
+
+<!ENTITY % attrs "%coreattrs; %i18n; %events;">
+
+<!--=================== Text Elements ====================================-->
+
+<!ENTITY % special.pre
+   "br | span | bdo | map">
+
+
+<!ENTITY % special
+   "%special.pre; | object | img ">
+
+<!ENTITY % fontstyle "tt | i | b | big | small ">
+
+<!ENTITY % phrase "em | strong | dfn | code | q |
+                   samp | kbd | var | cite | abbr | acronym | sub | sup ">
+
+<!ENTITY % inline.forms "input | select | textarea | label | button">
+
+<!-- these can occur at block or inline level -->
+<!ENTITY % misc.inline "ins | del | script">
+
+<!-- these can only occur at block level -->
+<!ENTITY % misc "noscript | %misc.inline;">
+
+<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">
+
+<!-- %Inline; covers inline or "text-level" elements -->
+<!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*">
+
+<!--================== Block level elements ==============================-->
+
+<!ENTITY % heading "h1|h2|h3|h4|h5|h6">
+<!ENTITY % lists "ul | ol | dl">
+<!ENTITY % blocktext "pre | hr | blockquote | address">
+
+<!ENTITY % block
+     "p | %heading; | div | %lists; | %blocktext; | fieldset | table">
+
+<!ENTITY % Block "(%block; | form | %misc;)*">
+
+<!-- %Flow; mixes block and inline and is used for list items etc. -->
+<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">
+
+<!--================== Content models for exclusions =====================-->
+
+<!-- a elements use %Inline; excluding a -->
+
+<!ENTITY % a.content
+   "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc.inline;)*">
+
+<!-- pre uses %Inline excluding big, small, sup or sup -->
+
+<!ENTITY % pre.content
+   "(#PCDATA | a | %fontstyle; | %phrase; | %special.pre; | %misc.inline;
+      | %inline.forms;)*">
+
+<!-- form uses %Block; excluding form -->
+
+<!ENTITY % form.content "(%block; | %misc;)*">
+
+<!-- button uses %Flow; but excludes a, form and form controls -->
+
+<!ENTITY % button.content
+   "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |
+    table | %special; | %fontstyle; | %phrase; | %misc;)*">
+
+<!--================ Document Structure ==================================-->
+
+<!-- the namespace URI designates the document profile -->
+
+<!ELEMENT html (head, body)>
+<!ATTLIST html
+  %i18n;
+  id          ID             #IMPLIED
+  xmlns       %URI;          #FIXED 'http://www.w3.org/1999/xhtml'
+  >
+
+<!--================ Document Head =======================================-->
+
+<!ENTITY % head.misc "(script|style|meta|link|object)*">
+
+<!-- content model is %head.misc; combined with a single
+     title and an optional base element in any order -->
+
+<!ELEMENT head (%head.misc;,
+     ((title, %head.misc;, (base, %head.misc;)?) |
+      (base, %head.misc;, (title, %head.misc;))))>
+
+<!ATTLIST head
+  %i18n;
+  id          ID             #IMPLIED
+  profile     %URI;          #IMPLIED
+  >
+
+<!-- The title element is not considered part of the flow of text.
+       It should be displayed, for example as the page header or
+       window title. Exactly one title is required per document.
+    -->
+<!ELEMENT title (#PCDATA)>
+<!ATTLIST title 
+  %i18n;
+  id          ID             #IMPLIED
+  >
+
+<!-- document base URI -->
+
+<!ELEMENT base EMPTY>
+<!ATTLIST base
+  href        %URI;          #REQUIRED
+  id          ID             #IMPLIED
+  >
+
+<!-- generic metainformation -->
+<!ELEMENT meta EMPTY>
+<!ATTLIST meta
+  %i18n;
+  id          ID             #IMPLIED
+  http-equiv  CDATA          #IMPLIED
+  name        CDATA          #IMPLIED
+  content     CDATA          #REQUIRED
+  scheme      CDATA          #IMPLIED
+  >
+
+<!--
+  Relationship values can be used in principle:
+
+   a) for document specific toolbars/menus when used
+      with the link element in document head e.g.
+        start, contents, previous, next, index, end, help
+   b) to link to a separate style sheet (rel="stylesheet")
+   c) to make a link to a script (rel="script")
+   d) by stylesheets to control how collections of
+      html nodes are rendered into printed documents
+   e) to make a link to a printable version of this document
+      e.g. a PostScript or PDF version (rel="alternate" media="print")
+-->
+
+<!ELEMENT link EMPTY>
+<!ATTLIST link
+  %attrs;
+  charset     %Charset;      #IMPLIED
+  href        %URI;          #IMPLIED
+  hreflang    %LanguageCode; #IMPLIED
+  type        %ContentType;  #IMPLIED
+  rel         %LinkTypes;    #IMPLIED
+  rev         %LinkTypes;    #IMPLIED
+  media       %MediaDesc;    #IMPLIED
+  >
+
+<!-- style info, which may include CDATA sections -->
+<!ELEMENT style (#PCDATA)>
+<!ATTLIST style
+  %i18n;
+  id          ID             #IMPLIED
+  type        %ContentType;  #REQUIRED
+  media       %MediaDesc;    #IMPLIED
+  title       %Text;         #IMPLIED
+  xml:space   (preserve)     #FIXED 'preserve'
+  >
+
+<!-- script statements, which may include CDATA sections -->
+<!ELEMENT script (#PCDATA)>
+<!ATTLIST script
+  id          ID             #IMPLIED
+  charset     %Charset;      #IMPLIED
+  type        %ContentType;  #REQUIRED
+  src         %URI;          #IMPLIED
+  defer       (defer)        #IMPLIED
+  xml:space   (preserve)     #FIXED 'preserve'
+  >
+
+<!-- alternate content container for non script-based rendering -->
+
+<!ELEMENT noscript %Block;>
+<!ATTLIST noscript
+  %attrs;
+  >
+
+<!--=================== Document Body ====================================-->
+
+<!ELEMENT body %Block;>
+<!ATTLIST body
+  %attrs;
+  onload          %Script;   #IMPLIED
+  onunload        %Script;   #IMPLIED
+  >
+
+<!ELEMENT div %Flow;>  <!-- generic language/style container -->
+<!ATTLIST div
+  %attrs;
+  >
+
+<!--=================== Paragraphs =======================================-->
+
+<!ELEMENT p %Inline;>
+<!ATTLIST p
+  %attrs;
+  >
+
+<!--=================== Headings =========================================-->
+
+<!--
+  There are six levels of headings from h1 (the most important)
+  to h6 (the least important).
+-->
+
+<!ELEMENT h1  %Inline;>
+<!ATTLIST h1
+   %attrs;
+   >
+
+<!ELEMENT h2 %Inline;>
+<!ATTLIST h2
+   %attrs;
+   >
+
+<!ELEMENT h3 %Inline;>
+<!ATTLIST h3
+   %attrs;
+   >
+
+<!ELEMENT h4 %Inline;>
+<!ATTLIST h4
+   %attrs;
+   >
+
+<!ELEMENT h5 %Inline;>
+<!ATTLIST h5
+   %attrs;
+   >
+
+<!ELEMENT h6 %Inline;>
+<!ATTLIST h6
+   %attrs;
+   >
+
+<!--=================== Lists ============================================-->
+
+<!-- Unordered list -->
+
+<!ELEMENT ul (li)+>
+<!ATTLIST ul
+  %attrs;
+  >
+
+<!-- Ordered (numbered) list -->
+
+<!ELEMENT ol (li)+>
+<!ATTLIST ol
+  %attrs;
+  >
+
+<!-- list item -->
+
+<!ELEMENT li %Flow;>
+<!ATTLIST li
+  %attrs;
+  >
+
+<!-- definition lists - dt for term, dd for its definition -->
+
+<!ELEMENT dl (dt|dd)+>
+<!ATTLIST dl
+  %attrs;
+  >
+
+<!ELEMENT dt %Inline;>
+<!ATTLIST dt
+  %attrs;
+  >
+
+<!ELEMENT dd %Flow;>
+<!ATTLIST dd
+  %attrs;
+  >
+
+<!--=================== Address ==========================================-->
+
+<!-- information on author -->
+
+<!ELEMENT address %Inline;>
+<!ATTLIST address
+  %attrs;
+  >
+
+<!--=================== Horizontal Rule ==================================-->
+
+<!ELEMENT hr EMPTY>
+<!ATTLIST hr
+  %attrs;
+  >
+
+<!--=================== Preformatted Text ================================-->
+
+<!-- content is %Inline; excluding "img|object|big|small|sub|sup" -->
+
+<!ELEMENT pre %pre.content;>
+<!ATTLIST pre
+  %attrs;
+  xml:space (preserve) #FIXED 'preserve'
+  >
+
+<!--=================== Block-like Quotes ================================-->
+
+<!ELEMENT blockquote %Block;>
+<!ATTLIST blockquote
+  %attrs;
+  cite        %URI;          #IMPLIED
+  >
+
+<!--=================== Inserted/Deleted Text ============================-->
+
+<!--
+  ins/del are allowed in block and inline content, but its
+  inappropriate to include block content within an ins element
+  occurring in inline content.
+-->
+<!ELEMENT ins %Flow;>
+<!ATTLIST ins
+  %attrs;
+  cite        %URI;          #IMPLIED
+  datetime    %Datetime;     #IMPLIED
+  >
+
+<!ELEMENT del %Flow;>
+<!ATTLIST del
+  %attrs;
+  cite        %URI;          #IMPLIED
+  datetime    %Datetime;     #IMPLIED
+  >
+
+<!--================== The Anchor Element ================================-->
+
+<!-- content is %Inline; except that anchors shouldn't be nested -->
+
+<!ELEMENT a %a.content;>
+<!ATTLIST a
+  %attrs;
+  %focus;
+  charset     %Charset;      #IMPLIED
+  type        %ContentType;  #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  href        %URI;          #IMPLIED
+  hreflang    %LanguageCode; #IMPLIED
+  rel         %LinkTypes;    #IMPLIED
+  rev         %LinkTypes;    #IMPLIED
+  shape       %Shape;        "rect"
+  coords      %Coords;       #IMPLIED
+  >
+
+<!--===================== Inline Elements ================================-->
+
+<!ELEMENT span %Inline;> <!-- generic language/style container -->
+<!ATTLIST span
+  %attrs;
+  >
+
+<!ELEMENT bdo %Inline;>  <!-- I18N BiDi over-ride -->
+<!ATTLIST bdo
+  %coreattrs;
+  %events;
+  lang        %LanguageCode; #IMPLIED
+  xml:lang    %LanguageCode; #IMPLIED
+  dir         (ltr|rtl)      #REQUIRED
+  >
+
+<!ELEMENT br EMPTY>   <!-- forced line break -->
+<!ATTLIST br
+  %coreattrs;
+  >
+
+<!ELEMENT em %Inline;>   <!-- emphasis -->
+<!ATTLIST em %attrs;>
+
+<!ELEMENT strong %Inline;>   <!-- strong emphasis -->
+<!ATTLIST strong %attrs;>
+
+<!ELEMENT dfn %Inline;>   <!-- definitional -->
+<!ATTLIST dfn %attrs;>
+
+<!ELEMENT code %Inline;>   <!-- program code -->
+<!ATTLIST code %attrs;>
+
+<!ELEMENT samp %Inline;>   <!-- sample -->
+<!ATTLIST samp %attrs;>
+
+<!ELEMENT kbd %Inline;>  <!-- something user would type -->
+<!ATTLIST kbd %attrs;>
+
+<!ELEMENT var %Inline;>   <!-- variable -->
+<!ATTLIST var %attrs;>
+
+<!ELEMENT cite %Inline;>   <!-- citation -->
+<!ATTLIST cite %attrs;>
+
+<!ELEMENT abbr %Inline;>   <!-- abbreviation -->
+<!ATTLIST abbr %attrs;>
+
+<!ELEMENT acronym %Inline;>   <!-- acronym -->
+<!ATTLIST acronym %attrs;>
+
+<!ELEMENT q %Inline;>   <!-- inlined quote -->
+<!ATTLIST q
+  %attrs;
+  cite        %URI;          #IMPLIED
+  >
+
+<!ELEMENT sub %Inline;> <!-- subscript -->
+<!ATTLIST sub %attrs;>
+
+<!ELEMENT sup %Inline;> <!-- superscript -->
+<!ATTLIST sup %attrs;>
+
+<!ELEMENT tt %Inline;>   <!-- fixed pitch font -->
+<!ATTLIST tt %attrs;>
+
+<!ELEMENT i %Inline;>   <!-- italic font -->
+<!ATTLIST i %attrs;>
+
+<!ELEMENT b %Inline;>   <!-- bold font -->
+<!ATTLIST b %attrs;>
+
+<!ELEMENT big %Inline;>   <!-- bigger font -->
+<!ATTLIST big %attrs;>
+
+<!ELEMENT small %Inline;>   <!-- smaller font -->
+<!ATTLIST small %attrs;>
+
+<!--==================== Object ======================================-->
+<!--
+  object is used to embed objects as part of HTML pages.
+  param elements should precede other content. Parameters
+  can also be expressed as attribute/value pairs on the
+  object element itself when brevity is desired.
+-->
+
+<!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*>
+<!ATTLIST object
+  %attrs;
+  declare     (declare)      #IMPLIED
+  classid     %URI;          #IMPLIED
+  codebase    %URI;          #IMPLIED
+  data        %URI;          #IMPLIED
+  type        %ContentType;  #IMPLIED
+  codetype    %ContentType;  #IMPLIED
+  archive     %UriList;      #IMPLIED
+  standby     %Text;         #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  usemap      %URI;          #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  >
+
+<!--
+  param is used to supply a named property value.
+  In XML it would seem natural to follow RDF and support an
+  abbreviated syntax where the param elements are replaced
+  by attribute value pairs on the object start tag.
+-->
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+  id          ID             #IMPLIED
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED
+  valuetype   (data|ref|object) "data"
+  type        %ContentType;  #IMPLIED
+  >
+
+<!--=================== Images ===========================================-->
+
+<!--
+   To avoid accessibility problems for people who aren't
+   able to see the image, you should provide a text
+   description using the alt and longdesc attributes.
+   In addition, avoid the use of server-side image maps.
+   Note that in this DTD there is no name attribute. That
+   is only available in the transitional and frameset DTD.
+-->
+
+<!ELEMENT img EMPTY>
+<!ATTLIST img
+  %attrs;
+  src         %URI;          #REQUIRED
+  alt         %Text;         #REQUIRED
+  longdesc    %URI;          #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  usemap      %URI;          #IMPLIED
+  ismap       (ismap)        #IMPLIED
+  >
+
+<!-- usemap points to a map element which may be in this document
+  or an external document, although the latter is not widely supported -->
+
+<!--================== Client-side image maps ============================-->
+
+<!-- These can be placed in the same document or grouped in a
+     separate document although this isn't yet widely supported -->
+
+<!ELEMENT map ((%block; | form | %misc;)+ | area+)>
+<!ATTLIST map
+  %i18n;
+  %events;
+  id          ID             #REQUIRED
+  class       CDATA          #IMPLIED
+  style       %StyleSheet;   #IMPLIED
+  title       %Text;         #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  >
+
+<!ELEMENT area EMPTY>
+<!ATTLIST area
+  %attrs;
+  %focus;
+  shape       %Shape;        "rect"
+  coords      %Coords;       #IMPLIED
+  href        %URI;          #IMPLIED
+  nohref      (nohref)       #IMPLIED
+  alt         %Text;         #REQUIRED
+  >
+
+<!--================ Forms ===============================================-->
+<!ELEMENT form %form.content;>   <!-- forms shouldn't be nested -->
+
+<!ATTLIST form
+  %attrs;
+  action      %URI;          #REQUIRED
+  method      (get|post)     "get"
+  enctype     %ContentType;  "application/x-www-form-urlencoded"
+  onsubmit    %Script;       #IMPLIED
+  onreset     %Script;       #IMPLIED
+  accept      %ContentTypes; #IMPLIED
+  accept-charset %Charsets;  #IMPLIED
+  >
+
+<!--
+  Each label must not contain more than ONE field
+  Label elements shouldn't be nested.
+-->
+<!ELEMENT label %Inline;>
+<!ATTLIST label
+  %attrs;
+  for         IDREF          #IMPLIED
+  accesskey   %Character;    #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED
+  >
+
+<!ENTITY % InputType
+  "(text | password | checkbox |
+    radio | submit | reset |
+    file | hidden | image | button)"
+   >
+
+<!-- the name attribute is required for all but submit & reset -->
+
+<!ELEMENT input EMPTY>     <!-- form control -->
+<!ATTLIST input
+  %attrs;
+  %focus;
+  type        %InputType;    "text"
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED
+  checked     (checked)      #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  readonly    (readonly)     #IMPLIED
+  size        CDATA          #IMPLIED
+  maxlength   %Number;       #IMPLIED
+  src         %URI;          #IMPLIED
+  alt         CDATA          #IMPLIED
+  usemap      %URI;          #IMPLIED
+  onselect    %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  accept      %ContentTypes; #IMPLIED
+  >
+
+<!ELEMENT select (optgroup|option)+>  <!-- option selector -->
+<!ATTLIST select
+  %attrs;
+  name        CDATA          #IMPLIED
+  size        %Number;       #IMPLIED
+  multiple    (multiple)     #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  >
+
+<!ELEMENT optgroup (option)+>   <!-- option group -->
+<!ATTLIST optgroup
+  %attrs;
+  disabled    (disabled)     #IMPLIED
+  label       %Text;         #REQUIRED
+  >
+
+<!ELEMENT option (#PCDATA)>     <!-- selectable choice -->
+<!ATTLIST option
+  %attrs;
+  selected    (selected)     #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  label       %Text;         #IMPLIED
+  value       CDATA          #IMPLIED
+  >
+
+<!ELEMENT textarea (#PCDATA)>     <!-- multi-line text field -->
+<!ATTLIST textarea
+  %attrs;
+  %focus;
+  name        CDATA          #IMPLIED
+  rows        %Number;       #REQUIRED
+  cols        %Number;       #REQUIRED
+  disabled    (disabled)     #IMPLIED
+  readonly    (readonly)     #IMPLIED
+  onselect    %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  >
+
+<!--
+  The fieldset element is used to group form fields.
+  Only one legend element should occur in the content
+  and if present should only be preceded by whitespace.
+-->
+<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>
+<!ATTLIST fieldset
+  %attrs;
+  >
+
+<!ELEMENT legend %Inline;>     <!-- fieldset label -->
+<!ATTLIST legend
+  %attrs;
+  accesskey   %Character;    #IMPLIED
+  >
+
+<!--
+ Content is %Flow; excluding a, form and form controls
+--> 
+<!ELEMENT button %button.content;>  <!-- push button -->
+<!ATTLIST button
+  %attrs;
+  %focus;
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED
+  type        (button|submit|reset) "submit"
+  disabled    (disabled)     #IMPLIED
+  >
+
+<!--======================= Tables =======================================-->
+
+<!-- Derived from IETF HTML table standard, see [RFC1942] -->
+
+<!--
+ The border attribute sets the thickness of the frame around the
+ table. The default units are screen pixels.
+
+ The frame attribute specifies which parts of the frame around
+ the table should be rendered. The values are not the same as
+ CALS to avoid a name clash with the valign attribute.
+-->
+<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
+
+<!--
+ The rules attribute defines which rules to draw between cells:
+
+ If rules is absent then assume:
+     "none" if border is absent or border="0" otherwise "all"
+-->
+
+<!ENTITY % TRules "(none | groups | rows | cols | all)">
+  
+<!-- horizontal alignment attributes for cell contents
+
+  char        alignment char, e.g. char=':'
+  charoff     offset for alignment char
+-->
+<!ENTITY % cellhalign
+  "align      (left|center|right|justify|char) #IMPLIED
+   char       %Character;    #IMPLIED
+   charoff    %Length;       #IMPLIED"
+  >
+
+<!-- vertical alignment attributes for cell contents -->
+<!ENTITY % cellvalign
+  "valign     (top|middle|bottom|baseline) #IMPLIED"
+  >
+
+<!ELEMENT table
+     (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
+<!ELEMENT caption  %Inline;>
+<!ELEMENT thead    (tr)+>
+<!ELEMENT tfoot    (tr)+>
+<!ELEMENT tbody    (tr)+>
+<!ELEMENT colgroup (col)*>
+<!ELEMENT col      EMPTY>
+<!ELEMENT tr       (th|td)+>
+<!ELEMENT th       %Flow;>
+<!ELEMENT td       %Flow;>
+
+<!ATTLIST table
+  %attrs;
+  summary     %Text;         #IMPLIED
+  width       %Length;       #IMPLIED
+  border      %Pixels;       #IMPLIED
+  frame       %TFrame;       #IMPLIED
+  rules       %TRules;       #IMPLIED
+  cellspacing %Length;       #IMPLIED
+  cellpadding %Length;       #IMPLIED
+  >
+
+<!ATTLIST caption
+  %attrs;
+  >
+
+<!--
+colgroup groups a set of col elements. It allows you to group
+several semantically related columns together.
+-->
+<!ATTLIST colgroup
+  %attrs;
+  span        %Number;       "1"
+  width       %MultiLength;  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!--
+ col elements define the alignment properties for cells in
+ one or more columns.
+
+ The width attribute specifies the width of the columns, e.g.
+
+     width=64        width in screen pixels
+     width=0.5*      relative width of 0.5
+
+ The span attribute causes the attributes of one
+ col element to apply to more than one column.
+-->
+<!ATTLIST col
+  %attrs;
+  span        %Number;       "1"
+  width       %MultiLength;  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!--
+    Use thead to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    tbody sections are rendered in scrolling panel.
+
+    Use tfoot to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    tbody sections are rendered in scrolling panel.
+
+    Use multiple tbody sections when rules are needed
+    between groups of table rows.
+-->
+<!ATTLIST thead
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tfoot
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tbody
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tr
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+
+<!-- Scope is simpler than headers attribute for common tables -->
+<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
+
+<!-- th is for headers, td for data and for cells acting as both -->
+
+<!ATTLIST th
+  %attrs;
+  abbr        %Text;         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       %Scope;        #IMPLIED
+  rowspan     %Number;       "1"
+  colspan     %Number;       "1"
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST td
+  %attrs;
+  abbr        %Text;         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       %Scope;        #IMPLIED
+  rowspan     %Number;       "1"
+  colspan     %Number;       "1"
+  %cellhalign;
+  %cellvalign;
+  >
+
diff --git a/xml/impl/resources/standardSchemas/xhtml1-strict.xsd b/xml/impl/resources/standardSchemas/xhtml1-strict.xsd
new file mode 100644
index 0000000..fb70899
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml1-strict.xsd
@@ -0,0 +1,2212 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema version="1.0" xml:lang="en"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.w3.org/1999/xhtml"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:xml="http://www.w3.org/XML/1998/namespace"
+    elementFormDefault="qualified">
+
+  <xs:annotation>
+    <xs:documentation>
+    XHTML 1.0 (Second Edition) Strict in XML Schema
+
+    This is the same as HTML 4 Strict except for
+    changes due to the differences between XML and SGML.
+
+    Namespace = http://www.w3.org/1999/xhtml
+
+    For further information, see: http://www.w3.org/TR/xhtml1
+
+    Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
+    All Rights Reserved.
+
+    The DTD version is identified by the PUBLIC and SYSTEM identifiers:
+
+    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+
+    $Id: xhtml1-strict.xsd,v 1.2 2002/08/28 08:05:44 mimasa Exp $
+    </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>
+    ================ Character mnemonic entities =========================
+
+    XHTML entity sets are identified by the PUBLIC and SYSTEM identifiers:
+
+    PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent"
+
+    PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent"
+
+    PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent"
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Imported Names ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="ContentType">
+    <xs:annotation>
+      <xs:documentation>
+      media type, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="ContentTypes">
+    <xs:annotation>
+      <xs:documentation>
+      comma-separated list of media types, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Charset">
+    <xs:annotation>
+      <xs:documentation>
+      a character encoding, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Charsets">
+    <xs:annotation>
+      <xs:documentation>
+      a space separated list of character encodings, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="LanguageCode">
+    <xs:annotation>
+      <xs:documentation>
+      a language code, as per [RFC3066]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:language"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Character">
+    <xs:annotation>
+      <xs:documentation>
+      a single character, as per section 2.2 of [XML]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:length value="1" fixed="true"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Number">
+    <xs:annotation>
+      <xs:documentation>
+      one or more digits
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger">
+      <xs:pattern value="[0-9]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="tabindexNumber">
+    <xs:annotation>
+      <xs:documentation>
+      tabindex attribute specifies the position of the current element
+      in the tabbing order for the current document. This value must be
+      a number between 0 and 32767. User agents should ignore leading zeros.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="Number">
+      <xs:minInclusive value="0"/>
+      <xs:maxInclusive value="32767"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="LinkTypes">
+    <xs:annotation>
+      <xs:documentation>
+      space-separated list of link types
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKENS"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="MediaDesc">
+    <xs:annotation>
+      <xs:documentation>
+      single or comma-separated list of media descriptors
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[^,]+(,\s*[^,]+)*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="URI">
+    <xs:annotation>
+      <xs:documentation>
+      a Uniform Resource Identifier, see [RFC2396]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:anyURI"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="UriList">
+    <xs:annotation>
+      <xs:documentation>
+      a space separated list of Uniform Resource Identifiers
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Datetime">
+    <xs:annotation>
+      <xs:documentation>
+      date and time information. ISO date format
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:dateTime"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Script">
+    <xs:annotation>
+      <xs:documentation>
+      script expression
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="StyleSheet">
+    <xs:annotation>
+      <xs:documentation>
+      style sheet data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Text">
+    <xs:annotation>
+      <xs:documentation>
+      used for titles etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Length">
+    <xs:annotation>
+      <xs:documentation>
+      nn for pixels or nn% for percentage length
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[\-+]?(\d+|\d+(\.\d+)?%)"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="MultiLength">
+    <xs:annotation>
+      <xs:documentation>
+      pixel, percentage, or relative
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[\-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Pixels">
+    <xs:annotation>
+      <xs:documentation>
+      integer representing length in pixels
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger"/>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    these are used for image maps
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="Shape">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="rect"/>
+      <xs:enumeration value="circle"/>
+      <xs:enumeration value="poly"/>
+      <xs:enumeration value="default"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Coords">
+    <xs:annotation>
+      <xs:documentation>
+      comma separated list of lengths
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern
+          value="[\-+]?(\d+|\d+(\.\d+)?%)(,\s*[\-+]?(\d+|\d+(\.\d+)?%))*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Generic Attributes ===============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attributeGroup name="coreattrs">
+    <xs:annotation>
+      <xs:documentation>
+      core attributes common to most elements
+      id       document-wide unique id
+      class    space separated list of classes
+      style    associated style info
+      title    advisory title/amplification
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="id" type="xs:ID"/>
+    <xs:attribute name="class" type="xs:NMTOKENS"/>
+    <xs:attribute name="style" type="StyleSheet"/>
+    <xs:attribute name="title" type="Text"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="i18n">
+    <xs:annotation>
+      <xs:documentation>
+      internationalization attributes
+      lang        language code (backwards compatible)
+      xml:lang    language code (as per XML 1.0 spec)
+      dir         direction for weak/neutral text
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="lang" type="LanguageCode"/>
+    <xs:attribute ref="xml:lang"/>
+    <xs:attribute name="dir">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="ltr"/>
+          <xs:enumeration value="rtl"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="events">
+    <xs:annotation>
+      <xs:documentation>
+      attributes for common UI events
+      onclick     a pointer button was clicked
+      ondblclick  a pointer button was double clicked
+      onmousedown a pointer button was pressed down
+      onmouseup   a pointer button was released
+      onmousemove a pointer was moved onto the element
+      onmouseout  a pointer was moved away from the element
+      onkeypress  a key was pressed and released
+      onkeydown   a key was pressed down
+      onkeyup     a key was released
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="onclick" type="Script"/>
+    <xs:attribute name="ondblclick" type="Script"/>
+    <xs:attribute name="onmousedown" type="Script"/>
+    <xs:attribute name="onmouseup" type="Script"/>
+    <xs:attribute name="onmouseover" type="Script"/>
+    <xs:attribute name="onmousemove" type="Script"/>
+    <xs:attribute name="onmouseout" type="Script"/>
+    <xs:attribute name="onkeypress" type="Script"/>
+    <xs:attribute name="onkeydown" type="Script"/>
+    <xs:attribute name="onkeyup" type="Script"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="focus">
+    <xs:annotation>
+      <xs:documentation>
+      attributes for elements that can get the focus
+      accesskey   accessibility key character
+      tabindex    position in tabbing order
+      onfocus     the element got the focus
+      onblur      the element lost the focus
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="accesskey" type="Character"/>
+    <xs:attribute name="tabindex" type="tabindexNumber"/>
+    <xs:attribute name="onfocus" type="Script"/>
+    <xs:attribute name="onblur" type="Script"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="attrs">
+    <xs:attributeGroup ref="coreattrs"/>
+    <xs:attributeGroup ref="i18n"/>
+    <xs:attributeGroup ref="events"/>
+  </xs:attributeGroup>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Text Elements ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="special.pre">
+    <xs:choice>
+      <xs:element ref="br"/>
+      <xs:element ref="span"/>
+      <xs:element ref="bdo"/>
+      <xs:element ref="map"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="special">
+    <xs:choice>
+      <xs:group ref="special.pre"/>
+      <xs:element ref="object"/>
+      <xs:element ref="img"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle">
+    <xs:choice>
+      <xs:element ref="tt"/>
+      <xs:element ref="i"/>
+      <xs:element ref="b"/>
+      <xs:element ref="big"/>
+      <xs:element ref="small"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase">
+    <xs:choice>
+      <xs:element ref="em"/>
+      <xs:element ref="strong"/>
+      <xs:element ref="dfn"/>
+      <xs:element ref="code"/>
+      <xs:element ref="q"/>
+      <xs:element ref="samp"/>
+      <xs:element ref="kbd"/>
+      <xs:element ref="var"/>
+      <xs:element ref="cite"/>
+      <xs:element ref="abbr"/>
+      <xs:element ref="acronym"/>
+      <xs:element ref="sub"/>
+      <xs:element ref="sup"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="inline.forms">
+    <xs:choice>
+      <xs:element ref="input"/>
+      <xs:element ref="select"/>
+      <xs:element ref="textarea"/>
+      <xs:element ref="label"/>
+      <xs:element ref="button"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="misc.inline">
+    <xs:choice>
+      <xs:element ref="ins"/>
+      <xs:element ref="del"/>
+      <xs:element ref="script"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="misc">
+    <xs:annotation>
+      <xs:documentation>
+      these can only occur at block level
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:element ref="noscript"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="inline">
+    <xs:choice>
+      <xs:element ref="a"/>
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="inline.forms"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="Inline" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      "Inline" covers inline or "text-level" elements
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="inline"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Block level elements ==============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="heading">
+    <xs:choice>
+      <xs:element ref="h1"/>
+      <xs:element ref="h2"/>
+      <xs:element ref="h3"/>
+      <xs:element ref="h4"/>
+      <xs:element ref="h5"/>
+      <xs:element ref="h6"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="lists">
+    <xs:choice>
+      <xs:element ref="ul"/>
+      <xs:element ref="ol"/>
+      <xs:element ref="dl"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="blocktext">
+    <xs:choice>
+      <xs:element ref="pre"/>
+      <xs:element ref="hr"/>
+      <xs:element ref="blockquote"/>
+      <xs:element ref="address"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="block">
+    <xs:choice>
+      <xs:element ref="p"/>
+      <xs:group ref="heading"/>
+      <xs:element ref="div"/>
+      <xs:group ref="lists"/>
+      <xs:group ref="blocktext"/>
+      <xs:element ref="fieldset"/>
+      <xs:element ref="table"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="Block">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:element ref="form"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="Flow" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      "Flow" mixes block and inline and is used for list items etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:element ref="form"/>
+      <xs:group ref="inline"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Content models for exclusions =====================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:complexType name="a.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      a elements use "Inline" excluding a
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="inline.forms"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="pre.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      pre uses "Inline" excluding big, small, sup or sup
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="a"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="special.pre"/>
+      <xs:group ref="misc.inline"/>
+      <xs:group ref="inline.forms"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="form.content">
+    <xs:annotation>
+      <xs:documentation>
+      form uses "Block" excluding form
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="button.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      button uses "Flow" but excludes a, form and form controls
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="p"/>
+      <xs:group ref="heading"/>
+      <xs:element ref="div"/>
+      <xs:group ref="lists"/>
+      <xs:group ref="blocktext"/>
+      <xs:element ref="table"/>
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Document Structure ==================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="html">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="head"/>
+        <xs:element ref="body"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Document Head =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="head.misc">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="script"/>
+        <xs:element ref="style"/>
+        <xs:element ref="meta"/>
+        <xs:element ref="link"/>
+        <xs:element ref="object"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:group>
+
+  <xs:element name="head">
+    <xs:annotation>
+      <xs:documentation>
+      content model is "head.misc" combined with a single
+      title and an optional base element in any order
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="head.misc"/>
+        <xs:choice>
+          <xs:sequence>
+            <xs:element ref="title"/>
+            <xs:group ref="head.misc"/>
+            <xs:sequence minOccurs="0">
+              <xs:element ref="base"/>
+              <xs:group ref="head.misc"/>
+            </xs:sequence>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element ref="base"/>
+            <xs:group ref="head.misc"/>
+            <xs:element ref="title"/>
+            <xs:group ref="head.misc"/>
+          </xs:sequence>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="profile" type="URI"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="title">
+    <xs:annotation>
+      <xs:documentation>
+      The title element is not considered part of the flow of text.
+      It should be displayed, for example as the page header or
+      window title. Exactly one title is required per document.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="base">
+    <xs:annotation>
+      <xs:documentation>
+      document base URI
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="href" use="required" type="URI"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="meta">
+    <xs:annotation>
+      <xs:documentation>
+      generic metainformation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="http-equiv"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="content" use="required"/>
+      <xs:attribute name="scheme"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="link">
+    <xs:annotation>
+      <xs:documentation>
+      Relationship values can be used in principle:
+
+      a) for document specific toolbars/menus when used
+         with the link element in document head e.g.
+           start, contents, previous, next, index, end, help
+      b) to link to a separate style sheet (rel="stylesheet")
+      c) to make a link to a script (rel="script")
+      d) by stylesheets to control how collections of
+         html nodes are rendered into printed documents
+      e) to make a link to a printable version of this document
+         e.g. a PostScript or PDF version (rel="alternate" media="print")
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="charset" type="Charset"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="hreflang" type="LanguageCode"/>
+      <xs:attribute name="type" type="ContentType"/>
+      <xs:attribute name="rel" type="LinkTypes"/>
+      <xs:attribute name="rev" type="LinkTypes"/>
+      <xs:attribute name="media" type="MediaDesc"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="style">
+    <xs:annotation>
+      <xs:documentation>
+      style info, which may include CDATA sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="type" use="required" type="ContentType"/>
+      <xs:attribute name="media" type="MediaDesc"/>
+      <xs:attribute name="title" type="Text"/>
+      <xs:attribute ref="xml:space" fixed="preserve"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="script">
+    <xs:annotation>
+      <xs:documentation>
+      script statements, which may include CDATA sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="charset" type="Charset"/>
+      <xs:attribute name="type" use="required" type="ContentType"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="defer">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="defer"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute ref="xml:space" fixed="preserve"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="noscript">
+    <xs:annotation>
+      <xs:documentation>
+      alternate content container for non script-based rendering
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="Block">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Document Body ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="body">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="Block">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="onload" type="Script"/>
+          <xs:attribute name="onunload" type="Script"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="div">
+    <xs:annotation>
+      <xs:documentation>
+      generic language/style container
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Paragraphs =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="p">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Headings =========================================
+
+    There are six levels of headings from h1 (the most important)
+    to h6 (the least important).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="h1">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h2">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h3">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h4">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h5">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h6">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Lists ============================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="ul">
+    <xs:annotation>
+      <xs:documentation>
+      Unordered list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="ol">
+    <xs:annotation>
+      <xs:documentation>
+      Ordered (numbered) list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="li">
+    <xs:annotation>
+      <xs:documentation>
+      list item
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    definition lists - dt for term, dd for its definition
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="dl">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="dt"/>
+        <xs:element ref="dd"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dt">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dd">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Address ==========================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="address">
+    <xs:annotation>
+      <xs:documentation>
+      information on author
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Horizontal Rule ==================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="hr">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Preformatted Text ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="pre">
+    <xs:annotation>
+      <xs:documentation>
+      content is "Inline" excluding "img|object|big|small|sub|sup"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="pre.content">
+           <xs:attributeGroup ref="attrs"/>
+           <xs:attribute ref="xml:space" fixed="preserve"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Block-like Quotes ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="blockquote">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="Block">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Inserted/Deleted Text ============================
+
+    ins/del are allowed in block and inline content, but its
+    inappropriate to include block content within an ins element
+    occurring in inline content.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="ins">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+          <xs:attribute name="datetime" type="Datetime"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="del">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+          <xs:attribute name="datetime" type="Datetime"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== The Anchor Element ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="a">
+    <xs:annotation>
+      <xs:documentation>
+      content is "Inline" except that anchors shouldn't be nested
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="a.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="focus"/>
+          <xs:attribute name="charset" type="Charset"/>
+          <xs:attribute name="type" type="ContentType"/>
+          <xs:attribute name="name" type="xs:ID"/>
+          <xs:attribute name="href" type="URI"/>
+          <xs:attribute name="hreflang" type="LanguageCode"/>
+          <xs:attribute name="rel" type="LinkTypes"/>
+          <xs:attribute name="rev" type="LinkTypes"/>
+          <xs:attribute name="shape" default="rect" type="Shape"/>
+          <xs:attribute name="coords" type="Coords"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ===================== Inline Elements ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="span">
+    <xs:annotation>
+      <xs:documentation>
+      generic language/style container
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="bdo">
+    <xs:annotation>
+      <xs:documentation>
+      I18N BiDi over-ride
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attributeGroup ref="events"/>
+          <xs:attribute name="lang" type="LanguageCode"/>
+          <xs:attribute ref="xml:lang"/>
+          <xs:attribute name="dir" use="required">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="ltr"/>
+                <xs:enumeration value="rtl"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="br">
+    <xs:annotation>
+      <xs:documentation>
+      forced line break
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="coreattrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="em">
+    <xs:annotation>
+      <xs:documentation>
+      emphasis
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="strong">
+    <xs:annotation>
+      <xs:documentation>
+      strong emphasis
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dfn">
+    <xs:annotation>
+      <xs:documentation>
+      definitional
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="code">
+    <xs:annotation>
+      <xs:documentation>
+      program code
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="samp">
+    <xs:annotation>
+      <xs:documentation>
+      sample
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="kbd">
+    <xs:annotation>
+      <xs:documentation>
+      something user would type
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="var">
+    <xs:annotation>
+      <xs:documentation>
+      variable
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="cite">
+    <xs:annotation>
+      <xs:documentation>
+      citation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="abbr">
+    <xs:annotation>
+      <xs:documentation>
+      abbreviation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="acronym">
+    <xs:annotation>
+      <xs:documentation>
+      acronym
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="q">
+    <xs:annotation>
+      <xs:documentation>
+      inlined quote
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="sub">
+    <xs:annotation>
+      <xs:documentation>
+      subscript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="sup">
+    <xs:annotation>
+      <xs:documentation>
+      superscript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tt">
+    <xs:annotation>
+      <xs:documentation>
+      fixed pitch font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="i">
+    <xs:annotation>
+      <xs:documentation>
+      italic font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="b">
+    <xs:annotation>
+      <xs:documentation>
+      bold font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="big">
+    <xs:annotation>
+      <xs:documentation>
+      bigger font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="small">
+    <xs:annotation>
+      <xs:documentation>
+      smaller font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ==================== Object ======================================
+
+    object is used to embed objects as part of HTML pages.
+    param elements should precede other content. Parameters
+    can also be expressed as attribute/value pairs on the
+    object element itself when brevity is desired.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="object">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="param"/>
+        <xs:group ref="block"/>
+        <xs:element ref="form"/>
+        <xs:group ref="inline"/>
+        <xs:group ref="misc"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="declare">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="declare"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="classid" type="URI"/>
+      <xs:attribute name="codebase" type="URI"/>
+      <xs:attribute name="data" type="URI"/>
+      <xs:attribute name="type" type="ContentType"/>
+      <xs:attribute name="codetype" type="ContentType"/>
+      <xs:attribute name="archive" type="UriList"/>
+      <xs:attribute name="standby" type="Text"/>
+      <xs:attribute name="height" type="Length"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="usemap" type="URI"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="tabindex" type="tabindexNumber"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="param">
+    <xs:annotation>
+      <xs:documentation>
+      param is used to supply a named property value.
+      In XML it would seem natural to follow RDF and support an
+      abbreviated syntax where the param elements are replaced
+      by attribute value pairs on the object start tag.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="value"/>
+      <xs:attribute name="valuetype" default="data">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="data"/>
+            <xs:enumeration value="ref"/>
+            <xs:enumeration value="object"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="type" type="ContentType"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Images ===========================================
+
+    To avoid accessibility problems for people who aren't
+    able to see the image, you should provide a text
+    description using the alt and longdesc attributes.
+    In addition, avoid the use of server-side image maps.
+    Note that in this DTD there is no name attribute. That
+    is only available in the transitional and frameset DTD.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="img">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="src" use="required" type="URI"/>
+      <xs:attribute name="alt" use="required" type="Text"/>
+      <xs:attribute name="longdesc" type="URI"/>
+      <xs:attribute name="height" type="Length"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="usemap" type="URI">
+  <xs:annotation>
+    <xs:documentation>
+          usemap points to a map element which may be in this document
+          or an external document, although the latter is not widely supported
+          </xs:documentation>
+  </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name="ismap">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="ismap"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Client-side image maps ============================
+
+    These can be placed in the same document or grouped in a
+    separate document although this isn't yet widely supported
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="map">
+    <xs:complexType>
+      <xs:choice>
+        <xs:choice maxOccurs="unbounded">
+          <xs:group ref="block"/>
+          <xs:element ref="form"/>
+          <xs:group ref="misc"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="area"/>
+      </xs:choice>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attributeGroup ref="events"/>
+      <xs:attribute name="id" use="required" type="xs:ID"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style" type="StyleSheet"/>
+      <xs:attribute name="title" type="Text"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="area">
+    <xs:complexType>
+        <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="shape" default="rect" type="Shape"/>
+      <xs:attribute name="coords" type="Coords"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="nohref">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="nohref"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="alt" use="required" type="Text"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Forms ===============================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="form">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="form.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="action" use="required" type="URI"/>
+          <xs:attribute name="name" type="xs:NMTOKEN"/>
+          <xs:attribute name="method" default="get">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="get"/>
+                <xs:enumeration value="post"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="enctype" type="ContentType"
+              default="application/x-www-form-urlencoded"/>
+          <xs:attribute name="onsubmit" type="Script"/>
+          <xs:attribute name="onreset" type="Script"/>
+          <xs:attribute name="accept" type="ContentTypes"/>
+          <xs:attribute name="accept-charset" type="Charsets"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="label">
+    <xs:annotation>
+      <xs:documentation>
+      Each label must not contain more than ONE field
+      Label elements shouldn't be nested.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="for" type="xs:IDREF"/>
+          <xs:attribute name="accesskey" type="Character"/>
+          <xs:attribute name="onfocus" type="Script"/>
+          <xs:attribute name="onblur" type="Script"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="InputType">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="text"/>
+      <xs:enumeration value="password"/>
+      <xs:enumeration value="checkbox"/>
+      <xs:enumeration value="radio"/>
+      <xs:enumeration value="submit"/>
+      <xs:enumeration value="reset"/>
+      <xs:enumeration value="file"/>
+      <xs:enumeration value="hidden"/>
+      <xs:enumeration value="image"/>
+      <xs:enumeration value="button"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="input">
+    <xs:annotation>
+      <xs:documentation>
+      form control
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="type" default="text" type="InputType"/>
+      <xs:attribute name="name">
+  <xs:annotation>
+    <xs:documentation>
+          the name attribute is required for all but submit &amp; reset
+          </xs:documentation>
+  </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name="value"/>
+      <xs:attribute name="checked">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="checked"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="readonly">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="readonly"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="size"/>
+      <xs:attribute name="maxlength" type="Number"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="alt"/>
+      <xs:attribute name="usemap" type="URI"/>
+      <xs:attribute name="onselect" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+      <xs:attribute name="accept" type="ContentTypes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="select">
+    <xs:annotation>
+      <xs:documentation>
+      option selector
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="optgroup"/>
+        <xs:element ref="option"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="size" type="Number"/>
+      <xs:attribute name="multiple">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="multiple"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="tabindex" type="tabindexNumber"/>
+      <xs:attribute name="onfocus" type="Script"/>
+      <xs:attribute name="onblur" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="optgroup">
+    <xs:annotation>
+      <xs:documentation>
+      option group
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="option"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="label" use="required" type="Text"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="option">
+    <xs:annotation>
+      <xs:documentation>
+      selectable choice
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="selected">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="selected"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="label" type="Text"/>
+      <xs:attribute name="value"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="textarea">
+    <xs:annotation>
+      <xs:documentation>
+      multi-line text field
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="rows" use="required" type="Number"/>
+      <xs:attribute name="cols" use="required" type="Number"/>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="readonly">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="readonly"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="onselect" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="fieldset">
+    <xs:annotation>
+      <xs:documentation>
+      The fieldset element is used to group form fields.
+      Only one legend element should occur in the content
+      and if present should only be preceded by whitespace.
+
+      NOTE: this content model is different from the XHTML 1.0 DTD,
+      closer to the intended content model in HTML4 DTD
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:sequence>
+        <xs:element ref="legend"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:group ref="block"/>
+          <xs:element ref="form"/>
+          <xs:group ref="inline"/>
+          <xs:group ref="misc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="legend">
+    <xs:annotation>
+      <xs:documentation>
+      fieldset label
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="accesskey" type="Character"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="button">
+    <xs:annotation>
+      <xs:documentation>
+      Content is "Flow" excluding a, form and form controls
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="button.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="focus"/>
+          <xs:attribute name="name"/>
+          <xs:attribute name="value"/>
+          <xs:attribute name="type" default="submit">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="button"/>
+                <xs:enumeration value="submit"/>
+                <xs:enumeration value="reset"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="disabled">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="disabled"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ======================= Tables =======================================
+
+    Derived from IETF HTML table standard, see [RFC1942]
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="TFrame">
+    <xs:annotation>
+      <xs:documentation>
+      The border attribute sets the thickness of the frame around the
+      table. The default units are screen pixels.
+
+      The frame attribute specifies which parts of the frame around
+      the table should be rendered. The values are not the same as
+      CALS to avoid a name clash with the valign attribute.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="void"/>
+      <xs:enumeration value="above"/>
+      <xs:enumeration value="below"/>
+      <xs:enumeration value="hsides"/>
+      <xs:enumeration value="lhs"/>
+      <xs:enumeration value="rhs"/>
+      <xs:enumeration value="vsides"/>
+      <xs:enumeration value="box"/>
+      <xs:enumeration value="border"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="TRules">
+    <xs:annotation>
+      <xs:documentation>
+      The rules attribute defines which rules to draw between cells:
+
+      If rules is absent then assume:
+          "none" if border is absent or border="0" otherwise "all"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="none"/>
+      <xs:enumeration value="groups"/>
+      <xs:enumeration value="rows"/>
+      <xs:enumeration value="cols"/>
+      <xs:enumeration value="all"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:attributeGroup name="cellhalign">
+    <xs:annotation>
+      <xs:documentation>
+      horizontal alignment attributes for cell contents
+
+      char        alignment char, e.g. char=':'
+      charoff     offset for alignment char
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="align">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="left"/>
+          <xs:enumeration value="center"/>
+          <xs:enumeration value="right"/>
+          <xs:enumeration value="justify"/>
+          <xs:enumeration value="char"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="char" type="Character"/>
+    <xs:attribute name="charoff" type="Length"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="cellvalign">
+    <xs:annotation>
+      <xs:documentation>
+      vertical alignment attributes for cell contents
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="valign">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="top"/>
+          <xs:enumeration value="middle"/>
+          <xs:enumeration value="bottom"/>
+          <xs:enumeration value="baseline"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:element name="table">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="caption"/>
+        <xs:choice>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="colgroup"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="thead"/>
+        <xs:element minOccurs="0" ref="tfoot"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="tbody"/>
+          <xs:element maxOccurs="unbounded" ref="tr"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="summary" type="Text"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="border" type="Pixels"/>
+      <xs:attribute name="frame" type="TFrame"/>
+      <xs:attribute name="rules" type="TRules"/>
+      <xs:attribute name="cellspacing" type="Length"/>
+      <xs:attribute name="cellpadding" type="Length"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="caption">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    Use thead to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    tbody sections are rendered in scrolling panel.
+
+    Use tfoot to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    tbody sections are rendered in scrolling panel.
+
+    Use multiple tbody sections when rules are needed
+    between groups of table rows.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="thead">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tfoot">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tbody">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="colgroup">
+    <xs:annotation>
+      <xs:documentation>
+      colgroup groups a set of col elements. It allows you to group
+      several semantically related columns together.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="span" default="1" type="Number"/>
+      <xs:attribute name="width" type="MultiLength"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="col">
+    <xs:annotation>
+      <xs:documentation>
+      col elements define the alignment properties for cells in
+      one or more columns.
+
+      The width attribute specifies the width of the columns, e.g.
+
+          width=64        width in screen pixels
+          width=0.5*      relative width of 0.5
+
+      The span attribute causes the attributes of one
+      col element to apply to more than one column.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="span" default="1" type="Number"/>
+      <xs:attribute name="width" type="MultiLength"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tr">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="th"/>
+        <xs:element ref="td"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="Scope">
+    <xs:annotation>
+      <xs:documentation>
+      Scope is simpler than headers attribute for common tables
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="row"/>
+      <xs:enumeration value="col"/>
+      <xs:enumeration value="rowgroup"/>
+      <xs:enumeration value="colgroup"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    th is for headers, td for data and for cells acting as both
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="th">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="abbr" type="Text"/>
+          <xs:attribute name="axis"/>
+          <xs:attribute name="headers" type="xs:IDREFS"/>
+          <xs:attribute name="scope" type="Scope"/>
+          <xs:attribute name="rowspan" default="1" type="Number"/>
+          <xs:attribute name="colspan" default="1" type="Number"/>
+          <xs:attributeGroup ref="cellhalign"/>
+          <xs:attributeGroup ref="cellvalign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="td">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="abbr" type="Text"/>
+          <xs:attribute name="axis"/>
+          <xs:attribute name="headers" type="xs:IDREFS"/>
+          <xs:attribute name="scope" type="Scope"/>
+          <xs:attribute name="rowspan" default="1" type="Number"/>
+          <xs:attribute name="colspan" default="1" type="Number"/>
+          <xs:attributeGroup ref="cellhalign"/>
+          <xs:attributeGroup ref="cellvalign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/impl/resources/standardSchemas/xhtml1-transitional.dtd b/xml/impl/resources/standardSchemas/xhtml1-transitional.dtd
new file mode 100644
index 0000000..ff132b4
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml1-transitional.dtd
@@ -0,0 +1,1213 @@
+<!--
+   Extensible HTML version 1.0 Transitional DTD
+
+   This is the same as HTML 4 Transitional except for
+   changes due to the differences between XML and SGML.
+
+   Namespace = http://www.w3.org/1999/xhtml
+
+   For further information, see: http://www.w3.org/TR/xhtml1
+
+   Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
+   All Rights Reserved. 
+
+   This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+   SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+
+   $Revision: 1.1 $
+   $Date: 2004/09/17 17:05:38 $
+
+-->
+
+<!--================ Character mnemonic entities =========================-->
+
+<!ENTITY % HTMLlat1 PUBLIC
+   "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+   "xhtml-lat1.ent">
+%HTMLlat1;
+
+<!ENTITY % HTMLsymbol PUBLIC
+   "-//W3C//ENTITIES Symbols for XHTML//EN"
+   "xhtml-symbol.ent">
+%HTMLsymbol;
+
+<!ENTITY % HTMLspecial PUBLIC
+   "-//W3C//ENTITIES Special for XHTML//EN"
+   "xhtml-special.ent">
+%HTMLspecial;
+
+<!--================== Imported Names ====================================-->
+
+<!ENTITY % ContentType "CDATA">
+    <!-- media type, as per [RFC2045] -->
+
+<!ENTITY % ContentTypes "CDATA">
+    <!-- comma-separated list of media types, as per [RFC2045] -->
+
+<!ENTITY % Charset "CDATA">
+    <!-- a character encoding, as per [RFC2045] -->
+
+<!ENTITY % Charsets "CDATA">
+    <!-- a space separated list of character encodings, as per [RFC2045] -->
+
+<!ENTITY % LanguageCode "NMTOKEN">
+    <!-- a language code, as per [RFC3066] -->
+
+<!ENTITY % Character "CDATA">
+    <!-- a single character, as per section 2.2 of [XML] -->
+
+<!ENTITY % Number "CDATA">
+    <!-- one or more digits -->
+
+<!ENTITY % LinkTypes "CDATA">
+    <!-- space-separated list of link types -->
+
+<!ENTITY % MediaDesc "CDATA">
+    <!-- single or comma-separated list of media descriptors -->
+
+<!ENTITY % URI "CDATA">
+    <!-- a Uniform Resource Identifier, see [RFC2396] -->
+
+<!ENTITY % UriList "CDATA">
+    <!-- a space separated list of Uniform Resource Identifiers -->
+
+<!ENTITY % Datetime "CDATA">
+    <!-- date and time information. ISO date format -->
+
+<!ENTITY % Script "CDATA">
+    <!-- script expression -->
+
+<!ENTITY % StyleSheet "CDATA">
+    <!-- style sheet data -->
+
+<!ENTITY % Text "CDATA">
+    <!-- used for titles etc. -->
+
+<!ENTITY % FrameTarget "NMTOKEN">
+    <!-- render in this frame -->
+
+<!ENTITY % Length "CDATA">
+    <!-- nn for pixels or nn% for percentage length -->
+
+<!ENTITY % MultiLength "CDATA">
+    <!-- pixel, percentage, or relative -->
+
+<!ENTITY % Pixels "CDATA">
+    <!-- integer representing length in pixels -->
+
+<!-- these are used for image maps -->
+
+<!ENTITY % Shape "(rect|circle|poly|default)">
+
+<!ENTITY % Coords "CDATA">
+    <!-- comma separated list of lengths -->
+
+<!-- used for object, applet, img, input and iframe -->
+<!ENTITY % ImgAlign "(top|middle|bottom|left|right)">
+
+<!-- a color using sRGB: #RRGGBB as Hex values -->
+<!ENTITY % Color "CDATA">
+
+<!-- There are also 16 widely known color names with their sRGB values:
+
+    Black  = #000000    Green  = #008000
+    Silver = #C0C0C0    Lime   = #00FF00
+    Gray   = #808080    Olive  = #808000
+    White  = #FFFFFF    Yellow = #FFFF00
+    Maroon = #800000    Navy   = #000080
+    Red    = #FF0000    Blue   = #0000FF
+    Purple = #800080    Teal   = #008080
+    Fuchsia= #FF00FF    Aqua   = #00FFFF
+-->
+
+<!--=================== Generic Attributes ===============================-->
+
+<!-- core attributes common to most elements
+  id       document-wide unique id
+  class    space separated list of classes
+  style    associated style info
+  title    advisory title/amplification
+-->
+<!ENTITY % coreattrs
+ "id          ID             #IMPLIED
+  class       CDATA          #IMPLIED
+  style       %StyleSheet;   #IMPLIED
+  title       %Text;         #IMPLIED"
+  >
+
+<!-- internationalization attributes
+  lang        language code (backwards compatible)
+  xml:lang    language code (as per XML 1.0 spec)
+  dir         direction for weak/neutral text
+-->
+<!ENTITY % i18n
+ "lang        %LanguageCode; #IMPLIED
+  xml:lang    %LanguageCode; #IMPLIED
+  dir         (ltr|rtl)      #IMPLIED"
+  >
+
+<!-- attributes for common UI events
+  onclick     a pointer button was clicked
+  ondblclick  a pointer button was double clicked
+  onmousedown a pointer button was pressed down
+  onmouseup   a pointer button was released
+  onmousemove a pointer was moved onto the element
+  onmouseout  a pointer was moved away from the element
+  onkeypress  a key was pressed and released
+  onkeydown   a key was pressed down
+  onkeyup     a key was released
+-->
+<!ENTITY % events
+ "onclick     %Script;       #IMPLIED
+  ondblclick  %Script;       #IMPLIED
+  onmousedown %Script;       #IMPLIED
+  onmouseup   %Script;       #IMPLIED
+  onmouseover %Script;       #IMPLIED
+  onmousemove %Script;       #IMPLIED
+  onmouseout  %Script;       #IMPLIED
+  onkeypress  %Script;       #IMPLIED
+  onkeydown   %Script;       #IMPLIED
+  onkeyup     %Script;       #IMPLIED"
+  >
+
+<!-- attributes for elements that can get the focus
+  accesskey   accessibility key character
+  tabindex    position in tabbing order
+  onfocus     the element got the focus
+  onblur      the element lost the focus
+-->
+<!ENTITY % focus
+ "accesskey   %Character;    #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED"
+  >
+
+<!ENTITY % attrs "%coreattrs; %i18n; %events;">
+
+<!-- text alignment for p, div, h1-h6. The default is
+     align="left" for ltr headings, "right" for rtl -->
+
+<!ENTITY % TextAlign "align (left|center|right|justify) #IMPLIED">
+
+<!--=================== Text Elements ====================================-->
+
+<!ENTITY % special.extra
+   "object | applet | img | map | iframe">
+	
+<!ENTITY % special.basic
+	"br | span | bdo">
+
+<!ENTITY % special
+   "%special.basic; | %special.extra;">
+
+<!ENTITY % fontstyle.extra "big | small | font | basefont">
+
+<!ENTITY % fontstyle.basic "tt | i | b | u
+                      | s | strike ">
+
+<!ENTITY % fontstyle "%fontstyle.basic; | %fontstyle.extra;">
+
+<!ENTITY % phrase.extra "sub | sup">
+<!ENTITY % phrase.basic "em | strong | dfn | code | q |
+                   samp | kbd | var | cite | abbr | acronym">
+
+<!ENTITY % phrase "%phrase.basic; | %phrase.extra;">
+
+<!ENTITY % inline.forms "input | select | textarea | label | button">
+
+<!-- these can occur at block or inline level -->
+<!ENTITY % misc.inline "ins | del | script">
+
+<!-- these can only occur at block level -->
+<!ENTITY % misc "noscript | %misc.inline;">
+
+<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">
+
+<!-- %Inline; covers inline or "text-level" elements -->
+<!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*">
+
+<!--================== Block level elements ==============================-->
+
+<!ENTITY % heading "h1|h2|h3|h4|h5|h6">
+<!ENTITY % lists "ul | ol | dl | menu | dir">
+<!ENTITY % blocktext "pre | hr | blockquote | address | center | noframes">
+
+<!ENTITY % block
+    "p | %heading; | div | %lists; | %blocktext; | isindex |fieldset | table">
+
+<!-- %Flow; mixes block and inline and is used for list items etc. -->
+<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">
+
+<!--================== Content models for exclusions =====================-->
+
+<!-- a elements use %Inline; excluding a -->
+
+<!ENTITY % a.content
+   "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc.inline;)*">
+
+<!-- pre uses %Inline excluding img, object, applet, big, small,
+     font, or basefont -->
+
+<!ENTITY % pre.content
+   "(#PCDATA | a | %special.basic; | %fontstyle.basic; | %phrase.basic; |
+	   %inline.forms; | %misc.inline;)*">
+
+<!-- form uses %Flow; excluding form -->
+
+<!ENTITY % form.content "(#PCDATA | %block; | %inline; | %misc;)*">
+
+<!-- button uses %Flow; but excludes a, form, form controls, iframe -->
+
+<!ENTITY % button.content
+   "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |
+      table | br | span | bdo | object | applet | img | map |
+      %fontstyle; | %phrase; | %misc;)*">
+
+<!--================ Document Structure ==================================-->
+
+<!-- the namespace URI designates the document profile -->
+
+<!ELEMENT html (head, body)>
+<!ATTLIST html
+  %i18n;
+  id          ID             #IMPLIED
+  xmlns       %URI;          #FIXED 'http://www.w3.org/1999/xhtml'
+  >
+
+<!--================ Document Head =======================================-->
+
+<!ENTITY % head.misc "(script|style|meta|link|object|isindex)*">
+
+<!-- content model is %head.misc; combined with a single
+     title and an optional base element in any order -->
+
+<!ELEMENT head (%head.misc;,
+     ((title, %head.misc;, (base, %head.misc;)?) |
+      (base, %head.misc;, (title, %head.misc;))))>
+
+<!ATTLIST head
+  %i18n;
+  id          ID             #IMPLIED
+  profile     %URI;          #IMPLIED
+  >
+
+<!-- The title element is not considered part of the flow of text.
+       It should be displayed, for example as the page header or
+       window title. Exactly one title is required per document.
+    -->
+<!ELEMENT title (#PCDATA)>
+<!ATTLIST title 
+  %i18n;
+  id          ID             #IMPLIED
+  >
+
+<!-- document base URI -->
+
+<!ELEMENT base EMPTY>
+<!ATTLIST base
+  id          ID             #IMPLIED
+  href        %URI;          #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!-- generic metainformation -->
+<!ELEMENT meta EMPTY>
+<!ATTLIST meta
+  %i18n;
+  id          ID             #IMPLIED
+  http-equiv  CDATA          #IMPLIED
+  name        CDATA          #IMPLIED
+  content     CDATA          #REQUIRED
+  scheme      CDATA          #IMPLIED
+  >
+
+<!--
+  Relationship values can be used in principle:
+
+   a) for document specific toolbars/menus when used
+      with the link element in document head e.g.
+        start, contents, previous, next, index, end, help
+   b) to link to a separate style sheet (rel="stylesheet")
+   c) to make a link to a script (rel="script")
+   d) by stylesheets to control how collections of
+      html nodes are rendered into printed documents
+   e) to make a link to a printable version of this document
+      e.g. a PostScript or PDF version (rel="alternate" media="print")
+-->
+
+<!ELEMENT link EMPTY>
+<!ATTLIST link
+  %attrs;
+  charset     %Charset;      #IMPLIED
+  href        %URI;          #IMPLIED
+  hreflang    %LanguageCode; #IMPLIED
+  type        %ContentType;  #IMPLIED
+  rel         %LinkTypes;    #IMPLIED
+  rev         %LinkTypes;    #IMPLIED
+  media       %MediaDesc;    #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!-- style info, which may include CDATA sections -->
+<!ELEMENT style (#PCDATA)>
+<!ATTLIST style
+  %i18n;
+  id          ID             #IMPLIED
+  type        %ContentType;  #REQUIRED
+  media       %MediaDesc;    #IMPLIED
+  title       %Text;         #IMPLIED
+  xml:space   (preserve)     #FIXED 'preserve'
+  >
+
+<!-- script statements, which may include CDATA sections -->
+<!ELEMENT script (#PCDATA)>
+<!ATTLIST script
+  id          ID             #IMPLIED
+  charset     %Charset;      #IMPLIED
+  type        %ContentType;  #REQUIRED
+  language    CDATA          #IMPLIED
+  src         %URI;          #IMPLIED
+  defer       (defer)        #IMPLIED
+  xml:space   (preserve)     #FIXED 'preserve'
+  >
+
+<!-- alternate content container for non script-based rendering -->
+
+<!ELEMENT noscript %Flow;>
+<!ATTLIST noscript
+  %attrs;
+  >
+
+<!--======================= Frames =======================================-->
+
+<!-- inline subwindow -->
+
+<!ELEMENT iframe %Flow;>
+<!ATTLIST iframe
+  %coreattrs;
+  longdesc    %URI;          #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  src         %URI;          #IMPLIED
+  frameborder (1|0)          "1"
+  marginwidth %Pixels;       #IMPLIED
+  marginheight %Pixels;      #IMPLIED
+  scrolling   (yes|no|auto)  "auto"
+  align       %ImgAlign;     #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  >
+
+<!-- alternate content container for non frame-based rendering -->
+
+<!ELEMENT noframes %Flow;>
+<!ATTLIST noframes
+  %attrs;
+  >
+
+<!--=================== Document Body ====================================-->
+
+<!ELEMENT body %Flow;>
+<!ATTLIST body
+  %attrs;
+  onload      %Script;       #IMPLIED
+  onunload    %Script;       #IMPLIED
+  background  %URI;          #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  text        %Color;        #IMPLIED
+  link        %Color;        #IMPLIED
+  vlink       %Color;        #IMPLIED
+  alink       %Color;        #IMPLIED
+  >
+
+<!ELEMENT div %Flow;>  <!-- generic language/style container -->
+<!ATTLIST div
+  %attrs;
+  %TextAlign;
+  >
+
+<!--=================== Paragraphs =======================================-->
+
+<!ELEMENT p %Inline;>
+<!ATTLIST p
+  %attrs;
+  %TextAlign;
+  >
+
+<!--=================== Headings =========================================-->
+
+<!--
+  There are six levels of headings from h1 (the most important)
+  to h6 (the least important).
+-->
+
+<!ELEMENT h1  %Inline;>
+<!ATTLIST h1
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h2 %Inline;>
+<!ATTLIST h2
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h3 %Inline;>
+<!ATTLIST h3
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h4 %Inline;>
+<!ATTLIST h4
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h5 %Inline;>
+<!ATTLIST h5
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h6 %Inline;>
+<!ATTLIST h6
+  %attrs;
+  %TextAlign;
+  >
+
+<!--=================== Lists ============================================-->
+
+<!-- Unordered list bullet styles -->
+
+<!ENTITY % ULStyle "(disc|square|circle)">
+
+<!-- Unordered list -->
+
+<!ELEMENT ul (li)+>
+<!ATTLIST ul
+  %attrs;
+  type        %ULStyle;     #IMPLIED
+  compact     (compact)     #IMPLIED
+  >
+
+<!-- Ordered list numbering style
+
+    1   arabic numbers      1, 2, 3, ...
+    a   lower alpha         a, b, c, ...
+    A   upper alpha         A, B, C, ...
+    i   lower roman         i, ii, iii, ...
+    I   upper roman         I, II, III, ...
+
+    The style is applied to the sequence number which by default
+    is reset to 1 for the first list item in an ordered list.
+-->
+<!ENTITY % OLStyle "CDATA">
+
+<!-- Ordered (numbered) list -->
+
+<!ELEMENT ol (li)+>
+<!ATTLIST ol
+  %attrs;
+  type        %OLStyle;      #IMPLIED
+  compact     (compact)      #IMPLIED
+  start       %Number;       #IMPLIED
+  >
+
+<!-- single column list (DEPRECATED) --> 
+<!ELEMENT menu (li)+>
+<!ATTLIST menu
+  %attrs;
+  compact     (compact)     #IMPLIED
+  >
+
+<!-- multiple column list (DEPRECATED) --> 
+<!ELEMENT dir (li)+>
+<!ATTLIST dir
+  %attrs;
+  compact     (compact)     #IMPLIED
+  >
+
+<!-- LIStyle is constrained to: "(%ULStyle;|%OLStyle;)" -->
+<!ENTITY % LIStyle "CDATA">
+
+<!-- list item -->
+
+<!ELEMENT li %Flow;>
+<!ATTLIST li
+  %attrs;
+  type        %LIStyle;      #IMPLIED
+  value       %Number;       #IMPLIED
+  >
+
+<!-- definition lists - dt for term, dd for its definition -->
+
+<!ELEMENT dl (dt|dd)+>
+<!ATTLIST dl
+  %attrs;
+  compact     (compact)      #IMPLIED
+  >
+
+<!ELEMENT dt %Inline;>
+<!ATTLIST dt
+  %attrs;
+  >
+
+<!ELEMENT dd %Flow;>
+<!ATTLIST dd
+  %attrs;
+  >
+
+<!--=================== Address ==========================================-->
+
+<!-- information on author -->
+
+<!ELEMENT address (#PCDATA | %inline; | %misc.inline; | p)*>
+<!ATTLIST address
+  %attrs;
+  >
+
+<!--=================== Horizontal Rule ==================================-->
+
+<!ELEMENT hr EMPTY>
+<!ATTLIST hr
+  %attrs;
+  align       (left|center|right) #IMPLIED
+  noshade     (noshade)      #IMPLIED
+  size        %Pixels;       #IMPLIED
+  width       %Length;       #IMPLIED
+  >
+
+<!--=================== Preformatted Text ================================-->
+
+<!-- content is %Inline; excluding 
+        "img|object|applet|big|small|sub|sup|font|basefont" -->
+
+<!ELEMENT pre %pre.content;>
+<!ATTLIST pre
+  %attrs;
+  width       %Number;      #IMPLIED
+  xml:space   (preserve)    #FIXED 'preserve'
+  >
+
+<!--=================== Block-like Quotes ================================-->
+
+<!ELEMENT blockquote %Flow;>
+<!ATTLIST blockquote
+  %attrs;
+  cite        %URI;          #IMPLIED
+  >
+
+<!--=================== Text alignment ===================================-->
+
+<!-- center content -->
+<!ELEMENT center %Flow;>
+<!ATTLIST center
+  %attrs;
+  >
+
+<!--=================== Inserted/Deleted Text ============================-->
+
+<!--
+  ins/del are allowed in block and inline content, but its
+  inappropriate to include block content within an ins element
+  occurring in inline content.
+-->
+<!ELEMENT ins %Flow;>
+<!ATTLIST ins
+  %attrs;
+  cite        %URI;          #IMPLIED
+  datetime    %Datetime;     #IMPLIED
+  >
+
+<!ELEMENT del %Flow;>
+<!ATTLIST del
+  %attrs;
+  cite        %URI;          #IMPLIED
+  datetime    %Datetime;     #IMPLIED
+  >
+
+<!--================== The Anchor Element ================================-->
+
+<!-- content is %Inline; except that anchors shouldn't be nested -->
+
+<!ELEMENT a %a.content;>
+<!ATTLIST a
+  %attrs;
+  %focus;
+  charset     %Charset;      #IMPLIED
+  type        %ContentType;  #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  href        %URI;          #IMPLIED
+  hreflang    %LanguageCode; #IMPLIED
+  rel         %LinkTypes;    #IMPLIED
+  rev         %LinkTypes;    #IMPLIED
+  shape       %Shape;        "rect"
+  coords      %Coords;       #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!--===================== Inline Elements ================================-->
+
+<!ELEMENT span %Inline;> <!-- generic language/style container -->
+<!ATTLIST span
+  %attrs;
+  >
+
+<!ELEMENT bdo %Inline;>  <!-- I18N BiDi over-ride -->
+<!ATTLIST bdo
+  %coreattrs;
+  %events;
+  lang        %LanguageCode; #IMPLIED
+  xml:lang    %LanguageCode; #IMPLIED
+  dir         (ltr|rtl)      #REQUIRED
+  >
+
+<!ELEMENT br EMPTY>   <!-- forced line break -->
+<!ATTLIST br
+  %coreattrs;
+  clear       (left|all|right|none) "none"
+  >
+
+<!ELEMENT em %Inline;>   <!-- emphasis -->
+<!ATTLIST em %attrs;>
+
+<!ELEMENT strong %Inline;>   <!-- strong emphasis -->
+<!ATTLIST strong %attrs;>
+
+<!ELEMENT dfn %Inline;>   <!-- definitional -->
+<!ATTLIST dfn %attrs;>
+
+<!ELEMENT code %Inline;>   <!-- program code -->
+<!ATTLIST code %attrs;>
+
+<!ELEMENT samp %Inline;>   <!-- sample -->
+<!ATTLIST samp %attrs;>
+
+<!ELEMENT kbd %Inline;>  <!-- something user would type -->
+<!ATTLIST kbd %attrs;>
+
+<!ELEMENT var %Inline;>   <!-- variable -->
+<!ATTLIST var %attrs;>
+
+<!ELEMENT cite %Inline;>   <!-- citation -->
+<!ATTLIST cite %attrs;>
+
+<!ELEMENT abbr %Inline;>   <!-- abbreviation -->
+<!ATTLIST abbr %attrs;>
+
+<!ELEMENT acronym %Inline;>   <!-- acronym -->
+<!ATTLIST acronym %attrs;>
+
+<!ELEMENT q %Inline;>   <!-- inlined quote -->
+<!ATTLIST q
+  %attrs;
+  cite        %URI;          #IMPLIED
+  >
+
+<!ELEMENT sub %Inline;> <!-- subscript -->
+<!ATTLIST sub %attrs;>
+
+<!ELEMENT sup %Inline;> <!-- superscript -->
+<!ATTLIST sup %attrs;>
+
+<!ELEMENT tt %Inline;>   <!-- fixed pitch font -->
+<!ATTLIST tt %attrs;>
+
+<!ELEMENT i %Inline;>   <!-- italic font -->
+<!ATTLIST i %attrs;>
+
+<!ELEMENT b %Inline;>   <!-- bold font -->
+<!ATTLIST b %attrs;>
+
+<!ELEMENT big %Inline;>   <!-- bigger font -->
+<!ATTLIST big %attrs;>
+
+<!ELEMENT small %Inline;>   <!-- smaller font -->
+<!ATTLIST small %attrs;>
+
+<!ELEMENT u %Inline;>   <!-- underline -->
+<!ATTLIST u %attrs;>
+
+<!ELEMENT s %Inline;>   <!-- strike-through -->
+<!ATTLIST s %attrs;>
+
+<!ELEMENT strike %Inline;>   <!-- strike-through -->
+<!ATTLIST strike %attrs;>
+
+<!ELEMENT basefont EMPTY>  <!-- base font size -->
+<!ATTLIST basefont
+  id          ID             #IMPLIED
+  size        CDATA          #REQUIRED
+  color       %Color;        #IMPLIED
+  face        CDATA          #IMPLIED
+  >
+
+<!ELEMENT font %Inline;> <!-- local change to font -->
+<!ATTLIST font
+  %coreattrs;
+  %i18n;
+  size        CDATA          #IMPLIED
+  color       %Color;        #IMPLIED
+  face        CDATA          #IMPLIED
+  >
+
+<!ELEMENT embed EMPTY> 
+<!ATTLIST embed
+  alt           CDATA          #IMPLIED
+  width         %Length;       #IMPLIED
+  height        %Length;       #IMPLIED
+  hidden        CDATA          #IMPLIED
+  pluginspage   %URI;          #IMPLIED
+  src           %URI;          #IMPLIED
+  type          CDATA          #IMPLIED
+  wmode         CDATA          #IMPLIED
+  >
+
+<!--==================== Object ======================================-->
+<!--
+  object is used to embed objects as part of HTML pages.
+  param elements should precede other content. Parameters
+  can also be expressed as attribute/value pairs on the
+  object element itself when brevity is desired.
+-->
+
+<!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*>
+<!ATTLIST object
+  %attrs;
+  declare     (declare)      #IMPLIED
+  classid     %URI;          #IMPLIED
+  codebase    %URI;          #IMPLIED
+  data        %URI;          #IMPLIED
+  type        %ContentType;  #IMPLIED
+  codetype    %ContentType;  #IMPLIED
+  archive     %UriList;      #IMPLIED
+  standby     %Text;         #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  usemap      %URI;          #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  align       %ImgAlign;     #IMPLIED
+  border      %Pixels;       #IMPLIED
+  hspace      %Pixels;       #IMPLIED
+  vspace      %Pixels;       #IMPLIED
+  >
+
+<!--
+  param is used to supply a named property value.
+  In XML it would seem natural to follow RDF and support an
+  abbreviated syntax where the param elements are replaced
+  by attribute value pairs on the object start tag.
+-->
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+  id          ID             #IMPLIED
+  name        CDATA          #REQUIRED
+  value       CDATA          #IMPLIED
+  valuetype   (data|ref|object) "data"
+  type        %ContentType;  #IMPLIED
+  >
+
+<!--=================== Java applet ==================================-->
+<!--
+  One of code or object attributes must be present.
+  Place param elements before other content.
+-->
+<!ELEMENT applet (#PCDATA | param | %block; | form | %inline; | %misc;)*>
+<!ATTLIST applet
+  %coreattrs;
+  codebase    %URI;          #IMPLIED
+  archive     CDATA          #IMPLIED
+  code        CDATA          #IMPLIED
+  object      CDATA          #IMPLIED
+  alt         %Text;         #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  width       %Length;       #REQUIRED
+  height      %Length;       #REQUIRED
+  align       %ImgAlign;     #IMPLIED
+  hspace      %Pixels;       #IMPLIED
+  vspace      %Pixels;       #IMPLIED
+  >
+
+<!--=================== Images ===========================================-->
+
+<!--
+   To avoid accessibility problems for people who aren't
+   able to see the image, you should provide a text
+   description using the alt and longdesc attributes.
+   In addition, avoid the use of server-side image maps.
+-->
+
+<!ELEMENT img EMPTY>
+<!ATTLIST img
+  %attrs;
+  src         %URI;          #REQUIRED
+  alt         %Text;         #REQUIRED
+  name        NMTOKEN        #IMPLIED
+  longdesc    %URI;          #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  usemap      %URI;          #IMPLIED
+  ismap       (ismap)        #IMPLIED
+  align       %ImgAlign;     #IMPLIED
+  border      %Length;       #IMPLIED
+  hspace      %Pixels;       #IMPLIED
+  vspace      %Pixels;       #IMPLIED
+  >
+
+<!-- usemap points to a map element which may be in this document
+  or an external document, although the latter is not widely supported -->
+
+<!--================== Client-side image maps ============================-->
+
+<!-- These can be placed in the same document or grouped in a
+     separate document although this isn't yet widely supported -->
+
+<!ELEMENT map ((%block; | form | %misc;)+ | area+)>
+<!ATTLIST map
+  %i18n;
+  %events;
+  id          ID             #IMPLIED
+  class       CDATA          #IMPLIED
+  style       %StyleSheet;   #IMPLIED
+  title       %Text;         #IMPLIED
+  name        CDATA          #REQUIRED
+  >
+
+<!ELEMENT area EMPTY>
+<!ATTLIST area
+  %attrs;
+  %focus;
+  shape       %Shape;        "rect"
+  coords      %Coords;       #IMPLIED
+  href        %URI;          #IMPLIED
+  nohref      (nohref)       #IMPLIED
+  alt         %Text;         #REQUIRED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!--================ Forms ===============================================-->
+
+<!ELEMENT form %form.content;>   <!-- forms shouldn't be nested -->
+
+<!ATTLIST form
+  %attrs;
+  action      %URI;          #REQUIRED
+  method      (get|post)     "get"
+  name        NMTOKEN        #IMPLIED
+  enctype     %ContentType;  "application/x-www-form-urlencoded"
+  onsubmit    %Script;       #IMPLIED
+  onreset     %Script;       #IMPLIED
+  accept      %ContentTypes; #IMPLIED
+  accept-charset %Charsets;  #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!--
+  Each label must not contain more than ONE field
+  Label elements shouldn't be nested.
+-->
+<!ELEMENT label %Inline;>
+<!ATTLIST label
+  %attrs;
+  for         IDREF          #IMPLIED
+  accesskey   %Character;    #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED
+  >
+
+<!ENTITY % InputType
+  "(text | password | checkbox |
+    radio | submit | reset |
+    file | hidden | image | button)"
+   >
+
+<!-- the name attribute is required for all but submit & reset -->
+
+<!ELEMENT input EMPTY>     <!-- form control -->
+<!ATTLIST input
+  %attrs;
+  %focus;
+  type        %InputType;    "text"
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED
+  checked     (checked)      #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  readonly    (readonly)     #IMPLIED
+  size        CDATA          #IMPLIED
+  maxlength   %Number;       #IMPLIED
+  src         %URI;          #IMPLIED
+  alt         CDATA          #IMPLIED
+  usemap      %URI;          #IMPLIED
+  onselect    %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  accept      %ContentTypes; #IMPLIED
+  align       %ImgAlign;     #IMPLIED
+  >
+
+<!ELEMENT select (optgroup|option)+>  <!-- option selector -->
+<!ATTLIST select
+  %attrs;
+  name        CDATA          #IMPLIED
+  size        %Number;       #IMPLIED
+  multiple    (multiple)     #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  >
+
+<!ELEMENT optgroup (option)+>   <!-- option group -->
+<!ATTLIST optgroup
+  %attrs;
+  disabled    (disabled)     #IMPLIED
+  label       %Text;         #REQUIRED
+  >
+
+<!ELEMENT option (#PCDATA)>     <!-- selectable choice -->
+<!ATTLIST option
+  %attrs;
+  selected    (selected)     #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  label       %Text;         #IMPLIED
+  value       CDATA          #IMPLIED
+  >
+
+<!ELEMENT textarea (#PCDATA)>     <!-- multi-line text field -->
+<!ATTLIST textarea
+  %attrs;
+  %focus;
+  name        CDATA          #IMPLIED
+  rows        %Number;       #REQUIRED
+  cols        %Number;       #REQUIRED
+  disabled    (disabled)     #IMPLIED
+  readonly    (readonly)     #IMPLIED
+  onselect    %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  >
+
+<!--
+  The fieldset element is used to group form fields.
+  Only one legend element should occur in the content
+  and if present should only be preceded by whitespace.
+-->
+<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>
+<!ATTLIST fieldset
+  %attrs;
+  >
+
+<!ENTITY % LAlign "(top|bottom|left|right)">
+
+<!ELEMENT legend %Inline;>     <!-- fieldset label -->
+<!ATTLIST legend
+  %attrs;
+  accesskey   %Character;    #IMPLIED
+  align       %LAlign;       #IMPLIED
+  >
+
+<!--
+ Content is %Flow; excluding a, form, form controls, iframe
+--> 
+<!ELEMENT button %button.content;>  <!-- push button -->
+<!ATTLIST button
+  %attrs;
+  %focus;
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED
+  type        (button|submit|reset) "submit"
+  disabled    (disabled)     #IMPLIED
+  >
+
+<!-- single-line text input control (DEPRECATED) -->
+<!ELEMENT isindex EMPTY>
+<!ATTLIST isindex
+  %coreattrs;
+  %i18n;
+  prompt      %Text;         #IMPLIED
+  >
+
+<!--======================= Tables =======================================-->
+
+<!-- Derived from IETF HTML table standard, see [RFC1942] -->
+
+<!--
+ The border attribute sets the thickness of the frame around the
+ table. The default units are screen pixels.
+
+ The frame attribute specifies which parts of the frame around
+ the table should be rendered. The values are not the same as
+ CALS to avoid a name clash with the valign attribute.
+-->
+<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
+
+<!--
+ The rules attribute defines which rules to draw between cells:
+
+ If rules is absent then assume:
+     "none" if border is absent or border="0" otherwise "all"
+-->
+
+<!ENTITY % TRules "(none | groups | rows | cols | all)">
+  
+<!-- horizontal placement of table relative to document -->
+<!ENTITY % TAlign "(left|center|right)">
+
+<!-- horizontal alignment attributes for cell contents
+
+  char        alignment char, e.g. char=':'
+  charoff     offset for alignment char
+-->
+<!ENTITY % cellhalign
+  "align      (left|center|right|justify|char) #IMPLIED
+   char       %Character;    #IMPLIED
+   charoff    %Length;       #IMPLIED"
+  >
+
+<!-- vertical alignment attributes for cell contents -->
+<!ENTITY % cellvalign
+  "valign     (top|middle|bottom|baseline) #IMPLIED"
+  >
+
+<!ELEMENT table
+     (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
+<!ELEMENT caption  %Inline;>
+<!ELEMENT thead    (tr)+>
+<!ELEMENT tfoot    (tr)+>
+<!ELEMENT tbody    (tr)+>
+<!ELEMENT colgroup (col)*>
+<!ELEMENT col      EMPTY>
+<!ELEMENT tr       (th|td)+>
+<!ELEMENT th       %Flow;>
+<!ELEMENT td       %Flow;>
+
+<!ATTLIST table
+  %attrs;
+  summary     %Text;         #IMPLIED
+  width       %Length;       #IMPLIED
+  border      %Pixels;       #IMPLIED
+  frame       %TFrame;       #IMPLIED
+  rules       %TRules;       #IMPLIED
+  cellspacing %Length;       #IMPLIED
+  cellpadding %Length;       #IMPLIED
+  align       %TAlign;       #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  >
+
+<!ENTITY % CAlign "(top|bottom|left|right)">
+
+<!ATTLIST caption
+  %attrs;
+  align       %CAlign;       #IMPLIED
+  >
+
+<!--
+colgroup groups a set of col elements. It allows you to group
+several semantically related columns together.
+-->
+<!ATTLIST colgroup
+  %attrs;
+  span        %Number;       "1"
+  width       %MultiLength;  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!--
+ col elements define the alignment properties for cells in
+ one or more columns.
+
+ The width attribute specifies the width of the columns, e.g.
+
+     width=64        width in screen pixels
+     width=0.5*      relative width of 0.5
+
+ The span attribute causes the attributes of one
+ col element to apply to more than one column.
+-->
+<!ATTLIST col
+  %attrs;
+  span        %Number;       "1"
+  width       %MultiLength;  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!--
+    Use thead to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    tbody sections are rendered in scrolling panel.
+
+    Use tfoot to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    tbody sections are rendered in scrolling panel.
+
+    Use multiple tbody sections when rules are needed
+    between groups of table rows.
+-->
+<!ATTLIST thead
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tfoot
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tbody
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tr
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  bgcolor     %Color;        #IMPLIED
+  >
+
+<!-- Scope is simpler than headers attribute for common tables -->
+<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
+
+<!-- th is for headers, td for data and for cells acting as both -->
+
+<!ATTLIST th
+  %attrs;
+  abbr        %Text;         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       %Scope;        #IMPLIED
+  rowspan     %Number;       "1"
+  colspan     %Number;       "1"
+  %cellhalign;
+  %cellvalign;
+  nowrap      (nowrap)       #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  width       %Length;       #IMPLIED
+  height      %Length;       #IMPLIED
+  >
+
+<!ATTLIST td
+  %attrs;
+  abbr        %Text;         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       %Scope;        #IMPLIED
+  rowspan     %Number;       "1"
+  colspan     %Number;       "1"
+  %cellhalign;
+  %cellvalign;
+  nowrap      (nowrap)       #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  width       %Length;       #IMPLIED
+  height      %Length;       #IMPLIED
+  >
+
diff --git a/xml/impl/resources/standardSchemas/xhtml1-transitional.xsd b/xml/impl/resources/standardSchemas/xhtml1-transitional.xsd
new file mode 100644
index 0000000..c77b53e
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml1-transitional.xsd
@@ -0,0 +1,2786 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xs:schema [
+<!ENTITY % HTMLlat1 PUBLIC
+       "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+       "xhtml-lat1.ent">
+    %HTMLlat1;
+
+    <!ENTITY % HTMLsymbol PUBLIC
+       "-//W3C//ENTITIES Symbols for XHTML//EN"
+       "xhtml-symbol.ent">
+    %HTMLsymbol;
+
+    <!ENTITY % HTMLspecial PUBLIC
+       "-//W3C//ENTITIES Special for XHTML//EN"
+       "xhtml-special.ent">
+    %HTMLspecial;
+]>
+
+<xs:schema version="1.0" xml:lang="en"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.w3.org/1999/xhtml"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:xml="http://www.w3.org/XML/1998/namespace"
+    elementFormDefault="qualified">
+
+  <xs:annotation>
+    <xs:documentation>
+    XHTML 1.0 (Second Edition) Transitional in XML Schema
+
+    This is the same as HTML 4 Transitional except for
+    changes due to the differences between XML and SGML.
+
+    Namespace = http://www.w3.org/1999/xhtml
+
+    For further information, see: http://www.w3.org/TR/xhtml1
+
+    Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
+    All Rights Reserved.
+
+    The DTD version is identified by the PUBLIC and SYSTEM identifiers:
+
+    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+
+    $Id: xhtml1-transitional.xsd,v 1.5 2002/08/28 09:53:29 mimasa Exp $
+    </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>
+    ================ Character mnemonic entities =========================
+
+    XHTML entity sets are identified by the PUBLIC and SYSTEM identifiers:
+
+    PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent"
+
+    PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent"
+
+    PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent"
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Imported Names ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="ContentType">
+    <xs:annotation>
+      <xs:documentation>
+      media type, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="ContentTypes">
+    <xs:annotation>
+      <xs:documentation>
+      comma-separated list of media types, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Charset">
+    <xs:annotation>
+      <xs:documentation>
+      a character encoding, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Charsets">
+    <xs:annotation>
+      <xs:documentation>
+      a space separated list of character encodings, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="LanguageCode">
+    <xs:annotation>
+      <xs:documentation>
+      a language code, as per [RFC3066]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:language"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Character">
+    <xs:annotation>
+      <xs:documentation>
+      a single character, as per section 2.2 of [XML]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:length value="1" fixed="true"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Number">
+    <xs:annotation>
+      <xs:documentation>
+      one or more digits
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger">
+      <xs:pattern value="[0-9]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="tabindexNumber">
+    <xs:annotation>
+      <xs:documentation>
+      tabindex attribute specifies the position of the current element
+      in the tabbing order for the current document. This value must be
+      a number between 0 and 32767. User agents should ignore leading zeros.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="Number">
+      <xs:minInclusive value="0"/>
+      <xs:maxInclusive value="32767"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="LinkTypes">
+    <xs:annotation>
+      <xs:documentation>
+      space-separated list of link types
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKENS"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="MediaDesc">
+    <xs:annotation>
+      <xs:documentation>
+      single or comma-separated list of media descriptors
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[^,]+(,\s*[^,]+)*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="URI">
+    <xs:annotation>
+      <xs:documentation>
+      a Uniform Resource Identifier, see [RFC2396]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:anyURI"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="UriList">
+    <xs:annotation>
+      <xs:documentation>
+      a space separated list of Uniform Resource Identifiers
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Datetime">
+    <xs:annotation>
+      <xs:documentation>
+      date and time information. ISO date format
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:dateTime"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Script">
+    <xs:annotation>
+      <xs:documentation>
+      script expression
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="StyleSheet">
+    <xs:annotation>
+      <xs:documentation>
+      style sheet data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Text">
+    <xs:annotation>
+      <xs:documentation>
+      used for titles etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="FrameTarget">
+    <xs:annotation>
+      <xs:documentation>
+      render in this frame
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKEN">
+      <xs:pattern value="_(blank|self|parent|top)|[A-Za-z]\c*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Length">
+    <xs:annotation>
+      <xs:documentation>
+      nn for pixels or nn% for percentage length
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[\-+]?(\d+|\d+(\.\d+)?%)"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="MultiLength">
+    <xs:annotation>
+      <xs:documentation>
+      pixel, percentage, or relative
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[\-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Pixels">
+    <xs:annotation>
+      <xs:documentation>
+      integer representing length in pixels
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger"/>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    these are used for image maps
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="Shape">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="rect"/>
+      <xs:enumeration value="circle"/>
+      <xs:enumeration value="poly"/>
+      <xs:enumeration value="default"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Coords">
+    <xs:annotation>
+      <xs:documentation>
+      comma separated list of lengths
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern
+          value="[\-+]?(\d+|\d+(\.\d+)?%)(,\s*[\-+]?(\d+|\d+(\.\d+)?%))*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="ImgAlign">
+    <xs:annotation>
+      <xs:documentation>
+      used for object, applet, img, input and iframe
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="top"/>
+      <xs:enumeration value="middle"/>
+      <xs:enumeration value="bottom"/>
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Color">
+    <xs:annotation>
+      <xs:documentation>
+      a color using sRGB: #RRGGBB as Hex values
+
+      There are also 16 widely known color names with their sRGB values:
+
+      Black  = #000000    Green  = #008000
+      Silver = #C0C0C0    Lime   = #00FF00
+      Gray   = #808080    Olive  = #808000
+      White  = #FFFFFF    Yellow = #FFFF00
+      Maroon = #800000    Navy   = #000080
+      Red    = #FF0000    Blue   = #0000FF
+      Purple = #800080    Teal   = #008080
+      Fuchsia= #FF00FF    Aqua   = #00FFFF
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[A-Za-z]+|#[0-9A-Fa-f]{3}|#[0-9A-Fa-f]{6}"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Generic Attributes ===============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attributeGroup name="coreattrs">
+    <xs:annotation>
+      <xs:documentation>
+      core attributes common to most elements
+      id       document-wide unique id
+      class    space separated list of classes
+      style    associated style info
+      title    advisory title/amplification
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="id" type="xs:ID"/>
+    <xs:attribute name="class" type="xs:NMTOKENS"/>
+    <xs:attribute name="style" type="StyleSheet"/>
+    <xs:attribute name="title" type="Text"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="i18n">
+    <xs:annotation>
+      <xs:documentation>
+      internationalization attributes
+      lang        language code (backwards compatible)
+      xml:lang    language code (as per XML 1.0 spec)
+      dir         direction for weak/neutral text
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="lang" type="LanguageCode"/>
+    <xs:attribute ref="xml:lang"/>
+    <xs:attribute name="dir">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="ltr"/>
+          <xs:enumeration value="rtl"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="events">
+    <xs:annotation>
+      <xs:documentation>
+      attributes for common UI events
+      onclick     a pointer button was clicked
+      ondblclick  a pointer button was double clicked
+      onmousedown a pointer button was pressed down
+      onmouseup   a pointer button was released
+      onmousemove a pointer was moved onto the element
+      onmouseout  a pointer was moved away from the element
+      onkeypress  a key was pressed and released
+      onkeydown   a key was pressed down
+      onkeyup     a key was released
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="onclick" type="Script"/>
+    <xs:attribute name="ondblclick" type="Script"/>
+    <xs:attribute name="onmousedown" type="Script"/>
+    <xs:attribute name="onmouseup" type="Script"/>
+    <xs:attribute name="onmouseover" type="Script"/>
+    <xs:attribute name="onmousemove" type="Script"/>
+    <xs:attribute name="onmouseout" type="Script"/>
+    <xs:attribute name="onkeypress" type="Script"/>
+    <xs:attribute name="onkeydown" type="Script"/>
+    <xs:attribute name="onkeyup" type="Script"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="focus">
+    <xs:annotation>
+      <xs:documentation>
+      attributes for elements that can get the focus
+      accesskey   accessibility key character
+      tabindex    position in tabbing order
+      onfocus     the element got the focus
+      onblur      the element lost the focus
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="accesskey" type="Character"/>
+    <xs:attribute name="tabindex" type="tabindexNumber"/>
+    <xs:attribute name="onfocus" type="Script"/>
+    <xs:attribute name="onblur" type="Script"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="attrs">
+    <xs:attributeGroup ref="coreattrs"/>
+    <xs:attributeGroup ref="i18n"/>
+    <xs:attributeGroup ref="events"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="TextAlign">
+    <xs:annotation>
+      <xs:documentation>
+      text alignment for p, div, h1-h6. The default is
+      align="left" for ltr headings, "right" for rtl
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="align">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="left"/>
+          <xs:enumeration value="center"/>
+          <xs:enumeration value="right"/>
+          <xs:enumeration value="justify"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Text Elements ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="special.extra">
+    <xs:choice>
+      <xs:element ref="object"/>
+      <xs:element ref="applet"/>
+      <xs:element ref="img"/>
+      <xs:element ref="map"/>
+      <xs:element ref="iframe"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="special.basic">
+    <xs:choice>
+      <xs:element ref="br"/>
+      <xs:element ref="span"/>
+      <xs:element ref="bdo"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="special">
+    <xs:choice>
+      <xs:group ref="special.basic"/>
+      <xs:group ref="special.extra"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle.extra">
+    <xs:choice>
+      <xs:element ref="big"/>
+      <xs:element ref="small"/>
+      <xs:element ref="font"/>
+      <xs:element ref="basefont"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle.basic">
+    <xs:choice>
+      <xs:element ref="tt"/>
+      <xs:element ref="i"/>
+      <xs:element ref="b"/>
+      <xs:element ref="u"/>
+      <xs:element ref="s"/>
+      <xs:element ref="strike"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle">
+    <xs:choice>
+      <xs:group ref="fontstyle.basic"/>
+      <xs:group ref="fontstyle.extra"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase.extra">
+    <xs:choice>
+      <xs:element ref="sub"/>
+      <xs:element ref="sup"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase.basic">
+    <xs:choice>
+      <xs:element ref="em"/>
+      <xs:element ref="strong"/>
+      <xs:element ref="dfn"/>
+      <xs:element ref="code"/>
+      <xs:element ref="q"/>
+      <xs:element ref="samp"/>
+      <xs:element ref="kbd"/>
+      <xs:element ref="var"/>
+      <xs:element ref="cite"/>
+      <xs:element ref="abbr"/>
+      <xs:element ref="acronym"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase">
+    <xs:choice>
+      <xs:group ref="phrase.basic"/>
+      <xs:group ref="phrase.extra"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="inline.forms">
+    <xs:choice>
+      <xs:element ref="input"/>
+      <xs:element ref="select"/>
+      <xs:element ref="textarea"/>
+      <xs:element ref="label"/>
+      <xs:element ref="button"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="misc.inline">
+    <xs:annotation>
+      <xs:documentation>
+      these can only occur at block level
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:element ref="ins"/>
+      <xs:element ref="del"/>
+      <xs:element ref="script"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="misc">
+    <xs:annotation>
+      <xs:documentation>
+      these can only occur at block level
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:element ref="noscript"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="inline">
+    <xs:choice>
+      <xs:element ref="a"/>
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="inline.forms"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="Inline" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      "Inline" covers inline or "text-level" element
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="inline"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Block level elements ==============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="heading">
+    <xs:choice>
+      <xs:element ref="h1"/>
+      <xs:element ref="h2"/>
+      <xs:element ref="h3"/>
+      <xs:element ref="h4"/>
+      <xs:element ref="h5"/>
+      <xs:element ref="h6"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="lists">
+    <xs:choice>
+      <xs:element ref="ul"/>
+      <xs:element ref="ol"/>
+      <xs:element ref="dl"/>
+      <xs:element ref="menu"/>
+      <xs:element ref="dir"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="blocktext">
+    <xs:choice>
+      <xs:element ref="pre"/>
+      <xs:element ref="hr"/>
+      <xs:element ref="blockquote"/>
+      <xs:element ref="address"/>
+      <xs:element ref="center"/>
+      <xs:element ref="noframes"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="block">
+    <xs:choice>
+      <xs:element ref="p"/>
+      <xs:group ref="heading"/>
+      <xs:element ref="div"/>
+      <xs:group ref="lists"/>
+      <xs:group ref="blocktext"/>
+      <xs:element ref="isindex"/>
+      <xs:element ref="fieldset"/>
+      <xs:element ref="table"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="Flow" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      "Flow" mixes block and inline and is used for list items etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:element ref="form"/>
+      <xs:element ref="embed"/>
+      <xs:group ref="inline"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Content models for exclusions =====================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:complexType name="a.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      a elements use "Inline" excluding a
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="inline.forms"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="pre.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      pre uses "Inline" excluding img, object, applet, big, small,
+      font, or basefont
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="a"/>
+      <xs:group ref="special.basic"/>
+      <xs:group ref="fontstyle.basic"/>
+      <xs:group ref="phrase.basic"/>
+      <xs:group ref="inline.forms"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="form.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      form uses "Flow" excluding form
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:group ref="inline"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="button.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      button uses "Flow" but excludes a, form, form controls, iframe
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="p"/>
+      <xs:group ref="heading"/>
+      <xs:element ref="div"/>
+      <xs:group ref="lists"/>
+      <xs:group ref="blocktext"/>
+      <xs:element ref="table"/>
+      <xs:element ref="br"/>
+      <xs:element ref="span"/>
+      <xs:element ref="bdo"/>
+      <xs:element ref="object"/>
+      <xs:element ref="applet"/>
+      <xs:element ref="img"/>
+      <xs:element ref="map"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Document Structure ==================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="html">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="head"/>
+        <xs:element ref="body"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Document Head =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="head.misc">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="script"/>
+        <xs:element ref="style"/>
+        <xs:element ref="meta"/>
+        <xs:element ref="link"/>
+        <xs:element ref="object"/>
+        <xs:element ref="isindex"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:group>
+
+  <xs:element name="head">
+    <xs:annotation>
+      <xs:documentation>
+      content model is "head.misc" combined with a single
+      title and an optional base element in any order
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="head.misc"/>
+        <xs:choice>
+          <xs:sequence>
+            <xs:element ref="title"/>
+            <xs:group ref="head.misc"/>
+            <xs:sequence minOccurs="0">
+              <xs:element ref="base"/>
+              <xs:group ref="head.misc"/>
+            </xs:sequence>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element ref="base"/>
+            <xs:group ref="head.misc"/>
+            <xs:element ref="title"/>
+            <xs:group ref="head.misc"/>
+          </xs:sequence>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="profile" type="URI"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="title">
+    <xs:annotation>
+      <xs:documentation>
+      The title element is not considered part of the flow of text.
+      It should be displayed, for example as the page header or
+      window title. Exactly one title is required per document.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="base">
+    <xs:annotation>
+      <xs:documentation>
+      document base URI
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="target" type="FrameTarget"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="meta">
+    <xs:annotation>
+      <xs:documentation>
+      generic metainformation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="http-equiv"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="content" use="required"/>
+      <xs:attribute name="scheme"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="link">
+    <xs:annotation>
+      <xs:documentation>
+      Relationship values can be used in principle:
+
+      a) for document specific toolbars/menus when used
+         with the link element in document head e.g.
+           start, contents, previous, next, index, end, help
+      b) to link to a separate style sheet (rel="stylesheet")
+      c) to make a link to a script (rel="script")
+      d) by stylesheets to control how collections of
+         html nodes are rendered into printed documents
+      e) to make a link to a printable version of this document
+         e.g. a PostScript or PDF version (rel="alternate" media="print")
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="charset" type="Charset"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="hreflang" type="LanguageCode"/>
+      <xs:attribute name="type" type="ContentType"/>
+      <xs:attribute name="rel" type="LinkTypes"/>
+      <xs:attribute name="rev" type="LinkTypes"/>
+      <xs:attribute name="media" type="MediaDesc"/>
+      <xs:attribute name="target" type="FrameTarget"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="style">
+    <xs:annotation>
+      <xs:documentation>
+      style info, which may include CDATA sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="type" use="required" type="ContentType"/>
+      <xs:attribute name="media" type="MediaDesc"/>
+      <xs:attribute name="title" type="Text"/>
+      <xs:attribute ref="xml:space" fixed="preserve"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="script">
+    <xs:annotation>
+      <xs:documentation>
+      script statements, which may include CDATA sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="charset" type="Charset"/>
+      <xs:attribute name="type" use="required" type="ContentType"/>
+      <xs:attribute name="language"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="defer">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="defer"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute ref="xml:space" fixed="preserve"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="noscript">
+    <xs:annotation>
+      <xs:documentation>
+      alternate content container for non script-based rendering
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ======================= Frames =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="iframe">
+    <xs:annotation>
+      <xs:documentation>
+      inline subwindow
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attribute name="longdesc" type="URI"/>
+          <xs:attribute name="name" type="xs:NMTOKEN"/>
+          <xs:attribute name="src" type="URI"/>
+          <xs:attribute name="frameborder" default="1">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="1"/>
+                <xs:enumeration value="0"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="marginwidth" type="Pixels"/>
+          <xs:attribute name="marginheight" type="Pixels"/>
+          <xs:attribute name="scrolling" default="auto">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="yes"/>
+                <xs:enumeration value="no"/>
+                <xs:enumeration value="auto"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="align" type="ImgAlign"/>
+          <xs:attribute name="height" type="Length"/>
+          <xs:attribute name="width" type="Length"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="noframes">
+    <xs:annotation>
+      <xs:documentation>
+      alternate content container for non frame-based rendering
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Document Body ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="body">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="onload" type="Script"/>
+          <xs:attribute name="onunload" type="Script"/>
+          <xs:attribute name="background" type="URI"/>
+          <xs:attribute name="bgcolor" type="Color"/>
+          <xs:attribute name="text" type="Color"/>
+          <xs:attribute name="link" type="Color"/>
+          <xs:attribute name="vlink" type="Color"/>
+          <xs:attribute name="alink" type="Color"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="div">
+    <xs:annotation>
+      <xs:documentation>
+      generic language/style container
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Paragraphs =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="p">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Headings =========================================
+
+    There are six levels of headings from h1 (the most important)
+    to h6 (the least important).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="h1">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h2">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h3">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h4">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h5">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h6">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Lists ============================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="ULStyle">
+    <xs:annotation>
+      <xs:documentation>
+      Unordered list bullet styles
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="disc"/>
+      <xs:enumeration value="square"/>
+      <xs:enumeration value="circle"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="ul">
+    <xs:annotation>
+      <xs:documentation>
+      Unordered list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="type" type="ULStyle"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="OLStyle">
+    <xs:annotation>
+      <xs:documentation>
+      Ordered list numbering style
+
+      1   arabic numbers      1, 2, 3, ...
+      a   lower alpha         a, b, c, ...
+      A   upper alpha         A, B, C, ...
+      i   lower roman         i, ii, iii, ...
+      I   upper roman         I, II, III, ...
+
+      The style is applied to the sequence number which by default
+      is reset to 1 for the first list item in an ordered list.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:element name="ol">
+    <xs:annotation>
+      <xs:documentation>
+      Ordered (numbered) list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="type" type="OLStyle"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="start" type="Number"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="menu">
+    <xs:annotation>
+      <xs:documentation>
+      single column list (DEPRECATED)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dir">
+    <xs:annotation>
+      <xs:documentation>
+      multiple column list (DEPRECATED)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="LIStyle">
+    <xs:annotation>
+      <xs:documentation>
+      LIStyle is constrained to: "(ULStyle|OLStyle)"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:element name="li">
+    <xs:annotation>
+      <xs:documentation>
+      list item
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="type" type="LIStyle"/>
+          <xs:attribute name="value" type="Number"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    definition lists - dt for term, dd for its definition
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="dl">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="dt"/>
+        <xs:element ref="dd"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dt">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dd">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Address ==========================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="address">
+    <xs:annotation>
+      <xs:documentation>
+      information on author
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="inline"/>
+        <xs:group ref="misc.inline"/>
+        <xs:element ref="p"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Horizontal Rule ==================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="hr">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="noshade">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="noshade"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="size" type="Pixels"/>
+      <xs:attribute name="width" type="Length"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Preformatted Text ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="pre">
+    <xs:annotation>
+      <xs:documentation>
+      content is "Inline" excluding
+         "img|object|applet|big|small|sub|sup|font|basefont"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="pre.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="width" type="Number"/>
+          <xs:attribute ref="xml:space" fixed="preserve"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Block-like Quotes ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="blockquote">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Text alignment ===================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="center">
+    <xs:annotation>
+      <xs:documentation>
+      center content
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Inserted/Deleted Text ============================
+
+    ins/del are allowed in block and inline content, but its
+    inappropriate to include block content within an ins element
+    occurring in inline content.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="ins">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+          <xs:attribute name="datetime" type="Datetime"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="del">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+          <xs:attribute name="datetime" type="Datetime"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== The Anchor Element ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="a">
+    <xs:annotation>
+      <xs:documentation>
+      content is "Inline" except that anchors shouldn't be nested
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="a.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="focus"/>
+          <xs:attribute name="charset" type="Charset"/>
+          <xs:attribute name="type" type="ContentType"/>
+          <xs:attribute name="name" type="xs:ID"/>
+          <xs:attribute name="href" type="URI"/>
+          <xs:attribute name="hreflang" type="LanguageCode"/>
+          <xs:attribute name="rel" type="LinkTypes"/>
+          <xs:attribute name="rev" type="LinkTypes"/>
+          <xs:attribute name="shape" default="rect" type="Shape"/>
+          <xs:attribute name="coords" type="Coords"/>
+          <xs:attribute name="target" type="FrameTarget"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ===================== Inline Elements ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="span">
+    <xs:annotation>
+      <xs:documentation>
+      generic language/style container
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="bdo">
+    <xs:annotation>
+      <xs:documentation>
+      I18N BiDi over-ride
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attributeGroup ref="events"/>
+          <xs:attribute name="lang" type="LanguageCode"/>
+          <xs:attribute ref="xml:lang"/>
+          <xs:attribute name="dir" use="required">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="ltr"/>
+                <xs:enumeration value="rtl"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="br">
+    <xs:annotation>
+      <xs:documentation>
+      forced line break
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attribute name="clear" default="none">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="all"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="none"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="em">
+    <xs:annotation>
+      <xs:documentation>
+      emphasis
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="strong">
+    <xs:annotation>
+      <xs:documentation>
+      strong emphasis
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dfn">
+    <xs:annotation>
+      <xs:documentation>
+      definitional
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="code">
+    <xs:annotation>
+      <xs:documentation>
+      program code
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="samp">
+    <xs:annotation>
+      <xs:documentation>
+      sample
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="kbd">
+    <xs:annotation>
+      <xs:documentation>
+      something user would type
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="var">
+    <xs:annotation>
+      <xs:documentation>
+      variable
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="cite">
+    <xs:annotation>
+      <xs:documentation>
+      citation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="abbr">
+    <xs:annotation>
+      <xs:documentation>
+      abbreviation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="acronym">
+    <xs:annotation>
+      <xs:documentation>
+      acronym
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="q">
+    <xs:annotation>
+      <xs:documentation>
+      inlined quote
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="sub">
+    <xs:annotation>
+      <xs:documentation>
+      subscript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="sup">
+    <xs:annotation>
+      <xs:documentation>
+      superscript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tt">
+    <xs:annotation>
+      <xs:documentation>
+      fixed pitch font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="i">
+    <xs:annotation>
+      <xs:documentation>
+      italic font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="b">
+    <xs:annotation>
+      <xs:documentation>
+      bold font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="big">
+    <xs:annotation>
+      <xs:documentation>
+      bigger font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="small">
+    <xs:annotation>
+      <xs:documentation>
+      smaller font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="u">
+    <xs:annotation>
+      <xs:documentation>
+      underline
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="s">
+    <xs:annotation>
+      <xs:documentation>
+      strike-through
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="strike">
+    <xs:annotation>
+      <xs:documentation>
+      strike-through
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="basefont">
+    <xs:annotation>
+      <xs:documentation>
+      base font size
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="size" use="required"/>
+      <xs:attribute name="color" type="Color"/>
+      <xs:attribute name="face"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="font">
+    <xs:annotation>
+      <xs:documentation>
+      local change to font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attributeGroup ref="i18n"/>
+          <xs:attribute name="size"/>
+          <xs:attribute name="color" type="Color"/>
+          <xs:attribute name="face"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ==================== Object ======================================
+
+    object is used to embed objects as part of HTML pages.
+    param elements should precede other content. Parameters
+    can also be expressed as attribute/value pairs on the
+    object element itself when brevity is desired.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="object">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="param"/>
+        <xs:group ref="block"/>
+        <xs:element ref="form"/>
+        <xs:group ref="inline"/>
+        <xs:group ref="misc"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="declare">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="declare"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="classid" type="URI"/>
+      <xs:attribute name="codebase" type="URI"/>
+      <xs:attribute name="data" type="URI"/>
+      <xs:attribute name="type" type="ContentType"/>
+      <xs:attribute name="codetype" type="ContentType"/>
+      <xs:attribute name="archive" type="UriList"/>
+      <xs:attribute name="standby" type="Text"/>
+      <xs:attribute name="height" type="Length"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="usemap" type="URI"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="tabindex" type="Number"/>
+      <xs:attribute name="align" type="ImgAlign"/>
+      <xs:attribute name="border" type="Pixels"/>
+      <xs:attribute name="hspace" type="Pixels"/>
+      <xs:attribute name="vspace" type="Pixels"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="param">
+    <xs:annotation>
+      <xs:documentation>
+      param is used to supply a named property value.
+      In XML it would seem natural to follow RDF and support an
+      abbreviated syntax where the param elements are replaced
+      by attribute value pairs on the object start tag.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="value"/>
+      <xs:attribute name="valuetype" default="data">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="data"/>
+            <xs:enumeration value="ref"/>
+            <xs:enumeration value="object"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="type" type="ContentType"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Java applet ==================================
+
+    One of code or object attributes must be present.
+    Place param elements before other content.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="applet">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="param"/>
+        <xs:group ref="block"/>
+        <xs:element ref="form"/>
+        <xs:group ref="inline"/>
+        <xs:group ref="misc"/>
+      </xs:choice>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attribute name="codebase" type="URI"/>
+      <xs:attribute name="archive"/>
+      <xs:attribute name="code"/>
+      <xs:attribute name="object"/>
+      <xs:attribute name="alt" type="Text"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="width" use="required" type="Length"/>
+      <xs:attribute name="height" use="required" type="Length"/>
+      <xs:attribute name="align" type="ImgAlign"/>
+      <xs:attribute name="hspace" type="Pixels"/>
+      <xs:attribute name="vspace" type="Pixels"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Images ===========================================
+
+    To avoid accessibility problems for people who aren't
+    able to see the image, you should provide a text
+    description using the alt and longdesc attributes.
+    In addition, avoid the use of server-side image maps.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="img">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="src" use="required" type="URI"/>
+      <xs:attribute name="alt" use="required" type="Text"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="longdesc" type="URI"/>
+      <xs:attribute name="height" type="Length"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="usemap" type="URI">
+  <xs:annotation>
+    <xs:documentation>
+          usemap points to a map element which may be in this document
+          or an external document, although the latter is not widely supported
+          </xs:documentation>
+  </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name="ismap">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="ismap"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align" type="ImgAlign"/>
+      <xs:attribute name="border" type="Length"/>
+      <xs:attribute name="hspace" type="Pixels"/>
+      <xs:attribute name="vspace" type="Pixels"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Client-side image maps ============================
+
+    These can be placed in the same document or grouped in a
+    separate document although this isn't yet widely supported
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="map">
+    <xs:complexType>
+      <xs:choice>
+        <xs:choice maxOccurs="unbounded">
+          <xs:group ref="block"/>
+          <xs:element ref="form"/>
+          <xs:group ref="misc"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="area"/>
+      </xs:choice>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attributeGroup ref="events"/>
+      <xs:attribute name="id" use="required" type="xs:ID"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style" type="StyleSheet"/>
+      <xs:attribute name="title" type="Text"/>
+      <xs:attribute name="name"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="area">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="shape" default="rect" type="Shape"/>
+      <xs:attribute name="coords" type="Coords"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="nohref">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="nohref"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="alt" use="required" type="Text"/>
+      <xs:attribute name="target" type="FrameTarget"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Forms ===============================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="form">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="form.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="action" use="required" type="URI"/>
+          <xs:attribute name="name" type="xs:NMTOKEN"/>
+          <xs:attribute name="method" default="get">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="get"/>
+                <xs:enumeration value="post"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="enctype" type="ContentType"
+              default="application/x-www-form-urlencoded"/>
+          <xs:attribute name="onsubmit" type="Script"/>
+          <xs:attribute name="onreset" type="Script"/>
+          <xs:attribute name="accept" type="ContentTypes"/>
+          <xs:attribute name="accept-charset" type="Charsets"/>
+          <xs:attribute name="target" type="FrameTarget"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="label">
+    <xs:annotation>
+      <xs:documentation>
+      Each label must not contain more than ONE field
+      Label elements shouldn't be nested.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="for" type="xs:IDREF"/>
+          <xs:attribute name="accesskey" type="Character"/>
+          <xs:attribute name="onfocus" type="Script"/>
+          <xs:attribute name="onblur" type="Script"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="InputType">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="text"/>
+      <xs:enumeration value="password"/>
+      <xs:enumeration value="checkbox"/>
+      <xs:enumeration value="radio"/>
+      <xs:enumeration value="submit"/>
+      <xs:enumeration value="reset"/>
+      <xs:enumeration value="file"/>
+      <xs:enumeration value="hidden"/>
+      <xs:enumeration value="image"/>
+      <xs:enumeration value="button"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="input">
+    <xs:annotation>
+      <xs:documentation>
+      form control
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="type" default="text" type="InputType"/>
+      <xs:attribute name="name">
+  <xs:annotation>
+    <xs:documentation>
+          the name attribute is required for all but submit &amp; reset
+          </xs:documentation>
+  </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name="value"/>
+      <xs:attribute name="checked">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="checked"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="readonly">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="readonly"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="size"/>
+      <xs:attribute name="maxlength" type="Number"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="alt"/>
+      <xs:attribute name="usemap" type="URI"/>
+      <xs:attribute name="onselect" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+      <xs:attribute name="accept" type="ContentTypes"/>
+      <xs:attribute name="align" type="ImgAlign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="select">
+    <xs:annotation>
+      <xs:documentation>
+      option selector
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="optgroup"/>
+        <xs:element ref="option"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="size" type="Number"/>
+      <xs:attribute name="multiple">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="multiple"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="tabindex" type="tabindexNumber"/>
+      <xs:attribute name="onfocus" type="Script"/>
+      <xs:attribute name="onblur" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="optgroup">
+    <xs:annotation>
+      <xs:documentation>
+      option group
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="option"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="label" use="required" type="Text"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="option">
+    <xs:annotation>
+      <xs:documentation>
+      selectable choice
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="selected">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="selected"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="label" type="Text"/>
+      <xs:attribute name="value"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="textarea">
+    <xs:annotation>
+      <xs:documentation>
+      multi-line text field
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="rows" use="required" type="Number"/>
+      <xs:attribute name="cols" use="required" type="Number"/>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="readonly">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="readonly"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="onselect" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="fieldset">
+    <xs:annotation>
+      <xs:documentation>
+      The fieldset element is used to group form fields.
+      Only one legend element should occur in the content
+      and if present should only be preceded by whitespace.
+
+      NOTE: this content model is different from the XHTML 1.0 DTD,
+      closer to the intended content model in HTML4 DTD
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:sequence>
+        <xs:element ref="legend"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:group ref="block"/>
+          <xs:element ref="form"/>
+          <xs:group ref="inline"/>
+          <xs:group ref="misc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="LAlign">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="top"/>
+      <xs:enumeration value="bottom"/>
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="legend">
+    <xs:annotation>
+      <xs:documentation>
+      fieldset label
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="accesskey" type="Character"/>
+          <xs:attribute name="align" type="LAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="button">
+    <xs:annotation>
+      <xs:documentation>
+      Content is "Flow" excluding a, form and form controls
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="button.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="focus"/>
+          <xs:attribute name="name"/>
+          <xs:attribute name="value"/>
+          <xs:attribute name="type" default="submit">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="button"/>
+                <xs:enumeration value="submit"/>
+                <xs:enumeration value="reset"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="disabled">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="disabled"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="isindex">
+    <xs:annotation>
+      <xs:documentation>
+      single-line text input control (DEPRECATED)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="prompt" type="Text"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ======================= Tables =======================================
+
+    Derived from IETF HTML table standard, see [RFC1942]
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="TFrame">
+    <xs:annotation>
+      <xs:documentation>
+      The border attribute sets the thickness of the frame around the
+      table. The default units are screen pixels.
+
+      The frame attribute specifies which parts of the frame around
+      the table should be rendered. The values are not the same as
+      CALS to avoid a name clash with the valign attribute.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="void"/>
+      <xs:enumeration value="above"/>
+      <xs:enumeration value="below"/>
+      <xs:enumeration value="hsides"/>
+      <xs:enumeration value="lhs"/>
+      <xs:enumeration value="rhs"/>
+      <xs:enumeration value="vsides"/>
+      <xs:enumeration value="box"/>
+      <xs:enumeration value="border"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="TRules">
+    <xs:annotation>
+      <xs:documentation>
+      The rules attribute defines which rules to draw between cells:
+
+      If rules is absent then assume:
+          "none" if border is absent or border="0" otherwise "all"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="none"/>
+      <xs:enumeration value="groups"/>
+      <xs:enumeration value="rows"/>
+      <xs:enumeration value="cols"/>
+      <xs:enumeration value="all"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="TAlign">
+    <xs:annotation>
+      <xs:documentation>
+      horizontal placement of table relative to document
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="center"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:attributeGroup name="cellhalign">
+    <xs:annotation>
+      <xs:documentation>
+      horizontal alignment attributes for cell contents
+
+      char        alignment char, e.g. char=':'
+      charoff     offset for alignment char
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="align">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="left"/>
+          <xs:enumeration value="center"/>
+          <xs:enumeration value="right"/>
+          <xs:enumeration value="justify"/>
+          <xs:enumeration value="char"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="char" type="Character"/>
+    <xs:attribute name="charoff" type="Length"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="cellvalign">
+    <xs:annotation>
+      <xs:documentation>
+      vertical alignment attributes for cell contents
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="valign">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="top"/>
+          <xs:enumeration value="middle"/>
+          <xs:enumeration value="bottom"/>
+          <xs:enumeration value="baseline"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:element name="table">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="caption"/>
+        <xs:choice>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="colgroup"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="thead"/>
+        <xs:element minOccurs="0" ref="tfoot"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="tbody"/>
+          <xs:element maxOccurs="unbounded" ref="tr"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="summary" type="Text"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="border" type="Pixels"/>
+      <xs:attribute name="frame" type="TFrame"/>
+      <xs:attribute name="rules" type="TRules"/>
+      <xs:attribute name="cellspacing" type="Length"/>
+      <xs:attribute name="cellpadding" type="Length"/>
+      <xs:attribute name="align" type="TAlign"/>
+      <xs:attribute name="bgcolor" type="Color"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="CAlign">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="top"/>
+      <xs:enumeration value="bottom"/>
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="caption">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="align" type="CAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    Use thead to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    tbody sections are rendered in scrolling panel.
+
+    Use tfoot to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    tbody sections are rendered in scrolling panel.
+
+    Use multiple tbody sections when rules are needed
+    between groups of table rows.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="thead">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tfoot">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tbody">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="colgroup">
+    <xs:annotation>
+      <xs:documentation>
+      colgroup groups a set of col elements. It allows you to group
+      several semantically related columns together.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="span" default="1" type="Number"/>
+      <xs:attribute name="width" type="MultiLength"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="col">
+    <xs:annotation>
+      <xs:documentation>
+      col elements define the alignment properties for cells in
+      one or more columns.
+
+      The width attribute specifies the width of the columns, e.g.
+
+          width=64        width in screen pixels
+          width=0.5*      relative width of 0.5
+
+      The span attribute causes the attributes of one
+      col element to apply to more than one column.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="span" default="1" type="Number"/>
+      <xs:attribute name="width" type="MultiLength"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tr">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="th"/>
+        <xs:element ref="td"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+      <xs:attribute name="bgcolor" type="Color"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="Scope">
+    <xs:annotation>
+      <xs:documentation>
+      Scope is simpler than headers attribute for common tables
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="row"/>
+      <xs:enumeration value="col"/>
+      <xs:enumeration value="rowgroup"/>
+      <xs:enumeration value="colgroup"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    th is for headers, td for data and for cells acting as both
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="th">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="abbr" type="Text"/>
+          <xs:attribute name="axis"/>
+          <xs:attribute name="headers" type="xs:IDREFS"/>
+          <xs:attribute name="scope" type="Scope"/>
+          <xs:attribute name="rowspan" default="1" type="Number"/>
+          <xs:attribute name="colspan" default="1" type="Number"/>
+          <xs:attributeGroup ref="cellhalign"/>
+          <xs:attributeGroup ref="cellvalign"/>
+          <xs:attribute name="nowrap">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="nowrap"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="bgcolor" type="Color"/>
+          <xs:attribute name="width" type="Length"/>
+          <xs:attribute name="height" type="Length"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="td">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="abbr" type="Text"/>
+          <xs:attribute name="axis"/>
+          <xs:attribute name="headers" type="xs:IDREFS"/>
+          <xs:attribute name="scope" type="Scope"/>
+          <xs:attribute name="rowspan" default="1" type="Number"/>
+          <xs:attribute name="colspan" default="1" type="Number"/>
+          <xs:attributeGroup ref="cellhalign"/>
+          <xs:attributeGroup ref="cellvalign"/>
+          <xs:attribute name="nowrap">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="nowrap"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="bgcolor" type="Color"/>
+          <xs:attribute name="width" type="Length"/>
+          <xs:attribute name="height" type="Length"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="embed">
+    <xs:complexType>
+      <xs:attribute name="alt" type="Text" />
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="height" type="Length"/>
+      <xs:attribute name="hidden" type="xs:boolean"/>
+      <xs:attribute name="pluginspage" type="URI"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="type" type="xs:string"/>
+      <xs:attribute name="wmode" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/impl/resources/standardSchemas/xhtml1.dtd b/xml/impl/resources/standardSchemas/xhtml1.dtd
new file mode 100644
index 0000000..60ab4ae
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml1.dtd
@@ -0,0 +1,1201 @@
+<!--
+   Extensible HTML version 1.0 Transitional DTD
+
+   This is the same as HTML 4 Transitional except for
+   changes due to the differences between XML and SGML.
+
+   Namespace = http://www.w3.org/1999/xhtml
+
+   For further information, see: http://www.w3.org/TR/xhtml1
+
+   Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
+   All Rights Reserved. 
+
+   This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+   SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+
+   $Revision: 1.1 $
+   $Date: 2004/09/17 17:05:38 $
+
+-->
+
+<!--================ Character mnemonic entities =========================-->
+
+<!ENTITY % HTMLlat1 PUBLIC
+   "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+   "xhtml-lat1.ent">
+%HTMLlat1;
+
+<!ENTITY % HTMLsymbol PUBLIC
+   "-//W3C//ENTITIES Symbols for XHTML//EN"
+   "xhtml-symbol.ent">
+%HTMLsymbol;
+
+<!ENTITY % HTMLspecial PUBLIC
+   "-//W3C//ENTITIES Special for XHTML//EN"
+   "xhtml-special.ent">
+%HTMLspecial;
+
+<!--================== Imported Names ====================================-->
+
+<!ENTITY % ContentType "CDATA">
+    <!-- media type, as per [RFC2045] -->
+
+<!ENTITY % ContentTypes "CDATA">
+    <!-- comma-separated list of media types, as per [RFC2045] -->
+
+<!ENTITY % Charset "CDATA">
+    <!-- a character encoding, as per [RFC2045] -->
+
+<!ENTITY % Charsets "CDATA">
+    <!-- a space separated list of character encodings, as per [RFC2045] -->
+
+<!ENTITY % LanguageCode "NMTOKEN">
+    <!-- a language code, as per [RFC3066] -->
+
+<!ENTITY % Character "CDATA">
+    <!-- a single character, as per section 2.2 of [XML] -->
+
+<!ENTITY % Number "CDATA">
+    <!-- one or more digits -->
+
+<!ENTITY % LinkTypes "CDATA">
+    <!-- space-separated list of link types -->
+
+<!ENTITY % MediaDesc "CDATA">
+    <!-- single or comma-separated list of media descriptors -->
+
+<!ENTITY % URI "CDATA">
+    <!-- a Uniform Resource Identifier, see [RFC2396] -->
+
+<!ENTITY % UriList "CDATA">
+    <!-- a space separated list of Uniform Resource Identifiers -->
+
+<!ENTITY % Datetime "CDATA">
+    <!-- date and time information. ISO date format -->
+
+<!ENTITY % Script "CDATA">
+    <!-- script expression -->
+
+<!ENTITY % StyleSheet "CDATA">
+    <!-- style sheet data -->
+
+<!ENTITY % Text "CDATA">
+    <!-- used for titles etc. -->
+
+<!ENTITY % FrameTarget "NMTOKEN">
+    <!-- render in this frame -->
+
+<!ENTITY % Length "CDATA">
+    <!-- nn for pixels or nn% for percentage length -->
+
+<!ENTITY % MultiLength "CDATA">
+    <!-- pixel, percentage, or relative -->
+
+<!ENTITY % Pixels "CDATA">
+    <!-- integer representing length in pixels -->
+
+<!-- these are used for image maps -->
+
+<!ENTITY % Shape "(rect|circle|poly|default)">
+
+<!ENTITY % Coords "CDATA">
+    <!-- comma separated list of lengths -->
+
+<!-- used for object, applet, img, input and iframe -->
+<!ENTITY % ImgAlign "(top|middle|bottom|left|right)">
+
+<!-- a color using sRGB: #RRGGBB as Hex values -->
+<!ENTITY % Color "CDATA">
+
+<!-- There are also 16 widely known color names with their sRGB values:
+
+    Black  = #000000    Green  = #008000
+    Silver = #C0C0C0    Lime   = #00FF00
+    Gray   = #808080    Olive  = #808000
+    White  = #FFFFFF    Yellow = #FFFF00
+    Maroon = #800000    Navy   = #000080
+    Red    = #FF0000    Blue   = #0000FF
+    Purple = #800080    Teal   = #008080
+    Fuchsia= #FF00FF    Aqua   = #00FFFF
+-->
+
+<!--=================== Generic Attributes ===============================-->
+
+<!-- core attributes common to most elements
+  id       document-wide unique id
+  class    space separated list of classes
+  style    associated style info
+  title    advisory title/amplification
+-->
+<!ENTITY % coreattrs
+ "id          ID             #IMPLIED
+  class       CDATA          #IMPLIED
+  style       %StyleSheet;   #IMPLIED
+  title       %Text;         #IMPLIED"
+  >
+
+<!-- internationalization attributes
+  lang        language code (backwards compatible)
+  xml:lang    language code (as per XML 1.0 spec)
+  dir         direction for weak/neutral text
+-->
+<!ENTITY % i18n
+ "lang        %LanguageCode; #IMPLIED
+  xml:lang    %LanguageCode; #IMPLIED
+  dir         (ltr|rtl)      #IMPLIED"
+  >
+
+<!-- attributes for common UI events
+  onclick     a pointer button was clicked
+  ondblclick  a pointer button was double clicked
+  onmousedown a pointer button was pressed down
+  onmouseup   a pointer button was released
+  onmousemove a pointer was moved onto the element
+  onmouseout  a pointer was moved away from the element
+  onkeypress  a key was pressed and released
+  onkeydown   a key was pressed down
+  onkeyup     a key was released
+-->
+<!ENTITY % events
+ "onclick     %Script;       #IMPLIED
+  ondblclick  %Script;       #IMPLIED
+  onmousedown %Script;       #IMPLIED
+  onmouseup   %Script;       #IMPLIED
+  onmouseover %Script;       #IMPLIED
+  onmousemove %Script;       #IMPLIED
+  onmouseout  %Script;       #IMPLIED
+  onkeypress  %Script;       #IMPLIED
+  onkeydown   %Script;       #IMPLIED
+  onkeyup     %Script;       #IMPLIED"
+  >
+
+<!-- attributes for elements that can get the focus
+  accesskey   accessibility key character
+  tabindex    position in tabbing order
+  onfocus     the element got the focus
+  onblur      the element lost the focus
+-->
+<!ENTITY % focus
+ "accesskey   %Character;    #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED"
+  >
+
+<!ENTITY % attrs "%coreattrs; %i18n; %events;">
+
+<!-- text alignment for p, div, h1-h6. The default is
+     align="left" for ltr headings, "right" for rtl -->
+
+<!ENTITY % TextAlign "align (left|center|right|justify) #IMPLIED">
+
+<!--=================== Text Elements ====================================-->
+
+<!ENTITY % special.extra
+   "object | applet | img | map | iframe">
+	
+<!ENTITY % special.basic
+	"br | span | bdo">
+
+<!ENTITY % special
+   "%special.basic; | %special.extra;">
+
+<!ENTITY % fontstyle.extra "big | small | font | basefont">
+
+<!ENTITY % fontstyle.basic "tt | i | b | u
+                      | s | strike ">
+
+<!ENTITY % fontstyle "%fontstyle.basic; | %fontstyle.extra;">
+
+<!ENTITY % phrase.extra "sub | sup">
+<!ENTITY % phrase.basic "em | strong | dfn | code | q |
+                   samp | kbd | var | cite | abbr | acronym">
+
+<!ENTITY % phrase "%phrase.basic; | %phrase.extra;">
+
+<!ENTITY % inline.forms "input | select | textarea | label | button">
+
+<!-- these can occur at block or inline level -->
+<!ENTITY % misc.inline "ins | del | script">
+
+<!-- these can only occur at block level -->
+<!ENTITY % misc "noscript | %misc.inline;">
+
+<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">
+
+<!-- %Inline; covers inline or "text-level" elements -->
+<!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*">
+
+<!--================== Block level elements ==============================-->
+
+<!ENTITY % heading "h1|h2|h3|h4|h5|h6">
+<!ENTITY % lists "ul | ol | dl | menu | dir">
+<!ENTITY % blocktext "pre | hr | blockquote | address | center | noframes">
+
+<!ENTITY % block
+    "p | %heading; | div | %lists; | %blocktext; | isindex |fieldset | table">
+
+<!-- %Flow; mixes block and inline and is used for list items etc. -->
+<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">
+
+<!--================== Content models for exclusions =====================-->
+
+<!-- a elements use %Inline; excluding a -->
+
+<!ENTITY % a.content
+   "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc.inline;)*">
+
+<!-- pre uses %Inline excluding img, object, applet, big, small,
+     font, or basefont -->
+
+<!ENTITY % pre.content
+   "(#PCDATA | a | %special.basic; | %fontstyle.basic; | %phrase.basic; |
+	   %inline.forms; | %misc.inline;)*">
+
+<!-- form uses %Flow; excluding form -->
+
+<!ENTITY % form.content "(#PCDATA | %block; | %inline; | %misc;)*">
+
+<!-- button uses %Flow; but excludes a, form, form controls, iframe -->
+
+<!ENTITY % button.content
+   "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |
+      table | br | span | bdo | object | applet | img | map |
+      %fontstyle; | %phrase; | %misc;)*">
+
+<!--================ Document Structure ==================================-->
+
+<!-- the namespace URI designates the document profile -->
+
+<!ELEMENT html (head, body)>
+<!ATTLIST html
+  %i18n;
+  id          ID             #IMPLIED
+  xmlns       %URI;          #FIXED 'http://www.w3.org/1999/xhtml'
+  >
+
+<!--================ Document Head =======================================-->
+
+<!ENTITY % head.misc "(script|style|meta|link|object|isindex)*">
+
+<!-- content model is %head.misc; combined with a single
+     title and an optional base element in any order -->
+
+<!ELEMENT head (%head.misc;,
+     ((title, %head.misc;, (base, %head.misc;)?) |
+      (base, %head.misc;, (title, %head.misc;))))>
+
+<!ATTLIST head
+  %i18n;
+  id          ID             #IMPLIED
+  profile     %URI;          #IMPLIED
+  >
+
+<!-- The title element is not considered part of the flow of text.
+       It should be displayed, for example as the page header or
+       window title. Exactly one title is required per document.
+    -->
+<!ELEMENT title (#PCDATA)>
+<!ATTLIST title 
+  %i18n;
+  id          ID             #IMPLIED
+  >
+
+<!-- document base URI -->
+
+<!ELEMENT base EMPTY>
+<!ATTLIST base
+  id          ID             #IMPLIED
+  href        %URI;          #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!-- generic metainformation -->
+<!ELEMENT meta EMPTY>
+<!ATTLIST meta
+  %i18n;
+  id          ID             #IMPLIED
+  http-equiv  CDATA          #IMPLIED
+  name        CDATA          #IMPLIED
+  content     CDATA          #REQUIRED
+  scheme      CDATA          #IMPLIED
+  >
+
+<!--
+  Relationship values can be used in principle:
+
+   a) for document specific toolbars/menus when used
+      with the link element in document head e.g.
+        start, contents, previous, next, index, end, help
+   b) to link to a separate style sheet (rel="stylesheet")
+   c) to make a link to a script (rel="script")
+   d) by stylesheets to control how collections of
+      html nodes are rendered into printed documents
+   e) to make a link to a printable version of this document
+      e.g. a PostScript or PDF version (rel="alternate" media="print")
+-->
+
+<!ELEMENT link EMPTY>
+<!ATTLIST link
+  %attrs;
+  charset     %Charset;      #IMPLIED
+  href        %URI;          #IMPLIED
+  hreflang    %LanguageCode; #IMPLIED
+  type        %ContentType;  #IMPLIED
+  rel         %LinkTypes;    #IMPLIED
+  rev         %LinkTypes;    #IMPLIED
+  media       %MediaDesc;    #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!-- style info, which may include CDATA sections -->
+<!ELEMENT style (#PCDATA)>
+<!ATTLIST style
+  %i18n;
+  id          ID             #IMPLIED
+  type        %ContentType;  #REQUIRED
+  media       %MediaDesc;    #IMPLIED
+  title       %Text;         #IMPLIED
+  xml:space   (preserve)     #FIXED 'preserve'
+  >
+
+<!-- script statements, which may include CDATA sections -->
+<!ELEMENT script (#PCDATA)>
+<!ATTLIST script
+  id          ID             #IMPLIED
+  charset     %Charset;      #IMPLIED
+  type        %ContentType;  #REQUIRED
+  language    CDATA          #IMPLIED
+  src         %URI;          #IMPLIED
+  defer       (defer)        #IMPLIED
+  xml:space   (preserve)     #FIXED 'preserve'
+  >
+
+<!-- alternate content container for non script-based rendering -->
+
+<!ELEMENT noscript %Flow;>
+<!ATTLIST noscript
+  %attrs;
+  >
+
+<!--======================= Frames =======================================-->
+
+<!-- inline subwindow -->
+
+<!ELEMENT iframe %Flow;>
+<!ATTLIST iframe
+  %coreattrs;
+  longdesc    %URI;          #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  src         %URI;          #IMPLIED
+  frameborder (1|0)          "1"
+  marginwidth %Pixels;       #IMPLIED
+  marginheight %Pixels;      #IMPLIED
+  scrolling   (yes|no|auto)  "auto"
+  align       %ImgAlign;     #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  >
+
+<!-- alternate content container for non frame-based rendering -->
+
+<!ELEMENT noframes %Flow;>
+<!ATTLIST noframes
+  %attrs;
+  >
+
+<!--=================== Document Body ====================================-->
+
+<!ELEMENT body %Flow;>
+<!ATTLIST body
+  %attrs;
+  onload      %Script;       #IMPLIED
+  onunload    %Script;       #IMPLIED
+  background  %URI;          #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  text        %Color;        #IMPLIED
+  link        %Color;        #IMPLIED
+  vlink       %Color;        #IMPLIED
+  alink       %Color;        #IMPLIED
+  >
+
+<!ELEMENT div %Flow;>  <!-- generic language/style container -->
+<!ATTLIST div
+  %attrs;
+  %TextAlign;
+  >
+
+<!--=================== Paragraphs =======================================-->
+
+<!ELEMENT p %Inline;>
+<!ATTLIST p
+  %attrs;
+  %TextAlign;
+  >
+
+<!--=================== Headings =========================================-->
+
+<!--
+  There are six levels of headings from h1 (the most important)
+  to h6 (the least important).
+-->
+
+<!ELEMENT h1  %Inline;>
+<!ATTLIST h1
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h2 %Inline;>
+<!ATTLIST h2
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h3 %Inline;>
+<!ATTLIST h3
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h4 %Inline;>
+<!ATTLIST h4
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h5 %Inline;>
+<!ATTLIST h5
+  %attrs;
+  %TextAlign;
+  >
+
+<!ELEMENT h6 %Inline;>
+<!ATTLIST h6
+  %attrs;
+  %TextAlign;
+  >
+
+<!--=================== Lists ============================================-->
+
+<!-- Unordered list bullet styles -->
+
+<!ENTITY % ULStyle "(disc|square|circle)">
+
+<!-- Unordered list -->
+
+<!ELEMENT ul (li)+>
+<!ATTLIST ul
+  %attrs;
+  type        %ULStyle;     #IMPLIED
+  compact     (compact)     #IMPLIED
+  >
+
+<!-- Ordered list numbering style
+
+    1   arabic numbers      1, 2, 3, ...
+    a   lower alpha         a, b, c, ...
+    A   upper alpha         A, B, C, ...
+    i   lower roman         i, ii, iii, ...
+    I   upper roman         I, II, III, ...
+
+    The style is applied to the sequence number which by default
+    is reset to 1 for the first list item in an ordered list.
+-->
+<!ENTITY % OLStyle "CDATA">
+
+<!-- Ordered (numbered) list -->
+
+<!ELEMENT ol (li)+>
+<!ATTLIST ol
+  %attrs;
+  type        %OLStyle;      #IMPLIED
+  compact     (compact)      #IMPLIED
+  start       %Number;       #IMPLIED
+  >
+
+<!-- single column list (DEPRECATED) --> 
+<!ELEMENT menu (li)+>
+<!ATTLIST menu
+  %attrs;
+  compact     (compact)     #IMPLIED
+  >
+
+<!-- multiple column list (DEPRECATED) --> 
+<!ELEMENT dir (li)+>
+<!ATTLIST dir
+  %attrs;
+  compact     (compact)     #IMPLIED
+  >
+
+<!-- LIStyle is constrained to: "(%ULStyle;|%OLStyle;)" -->
+<!ENTITY % LIStyle "CDATA">
+
+<!-- list item -->
+
+<!ELEMENT li %Flow;>
+<!ATTLIST li
+  %attrs;
+  type        %LIStyle;      #IMPLIED
+  value       %Number;       #IMPLIED
+  >
+
+<!-- definition lists - dt for term, dd for its definition -->
+
+<!ELEMENT dl (dt|dd)+>
+<!ATTLIST dl
+  %attrs;
+  compact     (compact)      #IMPLIED
+  >
+
+<!ELEMENT dt %Inline;>
+<!ATTLIST dt
+  %attrs;
+  >
+
+<!ELEMENT dd %Flow;>
+<!ATTLIST dd
+  %attrs;
+  >
+
+<!--=================== Address ==========================================-->
+
+<!-- information on author -->
+
+<!ELEMENT address (#PCDATA | %inline; | %misc.inline; | p)*>
+<!ATTLIST address
+  %attrs;
+  >
+
+<!--=================== Horizontal Rule ==================================-->
+
+<!ELEMENT hr EMPTY>
+<!ATTLIST hr
+  %attrs;
+  align       (left|center|right) #IMPLIED
+  noshade     (noshade)      #IMPLIED
+  size        %Pixels;       #IMPLIED
+  width       %Length;       #IMPLIED
+  >
+
+<!--=================== Preformatted Text ================================-->
+
+<!-- content is %Inline; excluding 
+        "img|object|applet|big|small|sub|sup|font|basefont" -->
+
+<!ELEMENT pre %pre.content;>
+<!ATTLIST pre
+  %attrs;
+  width       %Number;      #IMPLIED
+  xml:space   (preserve)    #FIXED 'preserve'
+  >
+
+<!--=================== Block-like Quotes ================================-->
+
+<!ELEMENT blockquote %Flow;>
+<!ATTLIST blockquote
+  %attrs;
+  cite        %URI;          #IMPLIED
+  >
+
+<!--=================== Text alignment ===================================-->
+
+<!-- center content -->
+<!ELEMENT center %Flow;>
+<!ATTLIST center
+  %attrs;
+  >
+
+<!--=================== Inserted/Deleted Text ============================-->
+
+<!--
+  ins/del are allowed in block and inline content, but its
+  inappropriate to include block content within an ins element
+  occurring in inline content.
+-->
+<!ELEMENT ins %Flow;>
+<!ATTLIST ins
+  %attrs;
+  cite        %URI;          #IMPLIED
+  datetime    %Datetime;     #IMPLIED
+  >
+
+<!ELEMENT del %Flow;>
+<!ATTLIST del
+  %attrs;
+  cite        %URI;          #IMPLIED
+  datetime    %Datetime;     #IMPLIED
+  >
+
+<!--================== The Anchor Element ================================-->
+
+<!-- content is %Inline; except that anchors shouldn't be nested -->
+
+<!ELEMENT a %a.content;>
+<!ATTLIST a
+  %attrs;
+  %focus;
+  charset     %Charset;      #IMPLIED
+  type        %ContentType;  #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  href        %URI;          #IMPLIED
+  hreflang    %LanguageCode; #IMPLIED
+  rel         %LinkTypes;    #IMPLIED
+  rev         %LinkTypes;    #IMPLIED
+  shape       %Shape;        "rect"
+  coords      %Coords;       #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!--===================== Inline Elements ================================-->
+
+<!ELEMENT span %Inline;> <!-- generic language/style container -->
+<!ATTLIST span
+  %attrs;
+  >
+
+<!ELEMENT bdo %Inline;>  <!-- I18N BiDi over-ride -->
+<!ATTLIST bdo
+  %coreattrs;
+  %events;
+  lang        %LanguageCode; #IMPLIED
+  xml:lang    %LanguageCode; #IMPLIED
+  dir         (ltr|rtl)      #REQUIRED
+  >
+
+<!ELEMENT br EMPTY>   <!-- forced line break -->
+<!ATTLIST br
+  %coreattrs;
+  clear       (left|all|right|none) "none"
+  >
+
+<!ELEMENT em %Inline;>   <!-- emphasis -->
+<!ATTLIST em %attrs;>
+
+<!ELEMENT strong %Inline;>   <!-- strong emphasis -->
+<!ATTLIST strong %attrs;>
+
+<!ELEMENT dfn %Inline;>   <!-- definitional -->
+<!ATTLIST dfn %attrs;>
+
+<!ELEMENT code %Inline;>   <!-- program code -->
+<!ATTLIST code %attrs;>
+
+<!ELEMENT samp %Inline;>   <!-- sample -->
+<!ATTLIST samp %attrs;>
+
+<!ELEMENT kbd %Inline;>  <!-- something user would type -->
+<!ATTLIST kbd %attrs;>
+
+<!ELEMENT var %Inline;>   <!-- variable -->
+<!ATTLIST var %attrs;>
+
+<!ELEMENT cite %Inline;>   <!-- citation -->
+<!ATTLIST cite %attrs;>
+
+<!ELEMENT abbr %Inline;>   <!-- abbreviation -->
+<!ATTLIST abbr %attrs;>
+
+<!ELEMENT acronym %Inline;>   <!-- acronym -->
+<!ATTLIST acronym %attrs;>
+
+<!ELEMENT q %Inline;>   <!-- inlined quote -->
+<!ATTLIST q
+  %attrs;
+  cite        %URI;          #IMPLIED
+  >
+
+<!ELEMENT sub %Inline;> <!-- subscript -->
+<!ATTLIST sub %attrs;>
+
+<!ELEMENT sup %Inline;> <!-- superscript -->
+<!ATTLIST sup %attrs;>
+
+<!ELEMENT tt %Inline;>   <!-- fixed pitch font -->
+<!ATTLIST tt %attrs;>
+
+<!ELEMENT i %Inline;>   <!-- italic font -->
+<!ATTLIST i %attrs;>
+
+<!ELEMENT b %Inline;>   <!-- bold font -->
+<!ATTLIST b %attrs;>
+
+<!ELEMENT big %Inline;>   <!-- bigger font -->
+<!ATTLIST big %attrs;>
+
+<!ELEMENT small %Inline;>   <!-- smaller font -->
+<!ATTLIST small %attrs;>
+
+<!ELEMENT u %Inline;>   <!-- underline -->
+<!ATTLIST u %attrs;>
+
+<!ELEMENT s %Inline;>   <!-- strike-through -->
+<!ATTLIST s %attrs;>
+
+<!ELEMENT strike %Inline;>   <!-- strike-through -->
+<!ATTLIST strike %attrs;>
+
+<!ELEMENT basefont EMPTY>  <!-- base font size -->
+<!ATTLIST basefont
+  id          ID             #IMPLIED
+  size        CDATA          #REQUIRED
+  color       %Color;        #IMPLIED
+  face        CDATA          #IMPLIED
+  >
+
+<!ELEMENT font %Inline;> <!-- local change to font -->
+<!ATTLIST font
+  %coreattrs;
+  %i18n;
+  size        CDATA          #IMPLIED
+  color       %Color;        #IMPLIED
+  face        CDATA          #IMPLIED
+  >
+
+<!--==================== Object ======================================-->
+<!--
+  object is used to embed objects as part of HTML pages.
+  param elements should precede other content. Parameters
+  can also be expressed as attribute/value pairs on the
+  object element itself when brevity is desired.
+-->
+
+<!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*>
+<!ATTLIST object
+  %attrs;
+  declare     (declare)      #IMPLIED
+  classid     %URI;          #IMPLIED
+  codebase    %URI;          #IMPLIED
+  data        %URI;          #IMPLIED
+  type        %ContentType;  #IMPLIED
+  codetype    %ContentType;  #IMPLIED
+  archive     %UriList;      #IMPLIED
+  standby     %Text;         #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  usemap      %URI;          #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  align       %ImgAlign;     #IMPLIED
+  border      %Pixels;       #IMPLIED
+  hspace      %Pixels;       #IMPLIED
+  vspace      %Pixels;       #IMPLIED
+  >
+
+<!--
+  param is used to supply a named property value.
+  In XML it would seem natural to follow RDF and support an
+  abbreviated syntax where the param elements are replaced
+  by attribute value pairs on the object start tag.
+-->
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+  id          ID             #IMPLIED
+  name        CDATA          #REQUIRED
+  value       CDATA          #IMPLIED
+  valuetype   (data|ref|object) "data"
+  type        %ContentType;  #IMPLIED
+  >
+
+<!--=================== Java applet ==================================-->
+<!--
+  One of code or object attributes must be present.
+  Place param elements before other content.
+-->
+<!ELEMENT applet (#PCDATA | param | %block; | form | %inline; | %misc;)*>
+<!ATTLIST applet
+  %coreattrs;
+  codebase    %URI;          #IMPLIED
+  archive     CDATA          #IMPLIED
+  code        CDATA          #IMPLIED
+  object      CDATA          #IMPLIED
+  alt         %Text;         #IMPLIED
+  name        NMTOKEN        #IMPLIED
+  width       %Length;       #REQUIRED
+  height      %Length;       #REQUIRED
+  align       %ImgAlign;     #IMPLIED
+  hspace      %Pixels;       #IMPLIED
+  vspace      %Pixels;       #IMPLIED
+  >
+
+<!--=================== Images ===========================================-->
+
+<!--
+   To avoid accessibility problems for people who aren't
+   able to see the image, you should provide a text
+   description using the alt and longdesc attributes.
+   In addition, avoid the use of server-side image maps.
+-->
+
+<!ELEMENT img EMPTY>
+<!ATTLIST img
+  %attrs;
+  src         %URI;          #REQUIRED
+  alt         %Text;         #REQUIRED
+  name        NMTOKEN        #IMPLIED
+  longdesc    %URI;          #IMPLIED
+  height      %Length;       #IMPLIED
+  width       %Length;       #IMPLIED
+  usemap      %URI;          #IMPLIED
+  ismap       (ismap)        #IMPLIED
+  align       %ImgAlign;     #IMPLIED
+  border      %Length;       #IMPLIED
+  hspace      %Pixels;       #IMPLIED
+  vspace      %Pixels;       #IMPLIED
+  >
+
+<!-- usemap points to a map element which may be in this document
+  or an external document, although the latter is not widely supported -->
+
+<!--================== Client-side image maps ============================-->
+
+<!-- These can be placed in the same document or grouped in a
+     separate document although this isn't yet widely supported -->
+
+<!ELEMENT map ((%block; | form | %misc;)+ | area+)>
+<!ATTLIST map
+  %i18n;
+  %events;
+  id          ID             #REQUIRED
+  class       CDATA          #IMPLIED
+  style       %StyleSheet;   #IMPLIED
+  title       %Text;         #IMPLIED
+  name        CDATA          #IMPLIED
+  >
+
+<!ELEMENT area EMPTY>
+<!ATTLIST area
+  %attrs;
+  %focus;
+  shape       %Shape;        "rect"
+  coords      %Coords;       #IMPLIED
+  href        %URI;          #IMPLIED
+  nohref      (nohref)       #IMPLIED
+  alt         %Text;         #REQUIRED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!--================ Forms ===============================================-->
+
+<!ELEMENT form %form.content;>   <!-- forms shouldn't be nested -->
+
+<!ATTLIST form
+  %attrs;
+  action      %URI;          #REQUIRED
+  method      (get|post)     "get"
+  name        NMTOKEN        #IMPLIED
+  enctype     %ContentType;  "application/x-www-form-urlencoded"
+  onsubmit    %Script;       #IMPLIED
+  onreset     %Script;       #IMPLIED
+  accept      %ContentTypes; #IMPLIED
+  accept-charset %Charsets;  #IMPLIED
+  target      %FrameTarget;  #IMPLIED
+  >
+
+<!--
+  Each label must not contain more than ONE field
+  Label elements shouldn't be nested.
+-->
+<!ELEMENT label %Inline;>
+<!ATTLIST label
+  %attrs;
+  for         IDREF          #IMPLIED
+  accesskey   %Character;    #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED
+  >
+
+<!ENTITY % InputType
+  "(text | password | checkbox |
+    radio | submit | reset |
+    file | hidden | image | button)"
+   >
+
+<!-- the name attribute is required for all but submit & reset -->
+
+<!ELEMENT input EMPTY>     <!-- form control -->
+<!ATTLIST input
+  %attrs;
+  %focus;
+  type        %InputType;    "text"
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED
+  checked     (checked)      #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  readonly    (readonly)     #IMPLIED
+  size        CDATA          #IMPLIED
+  maxlength   %Number;       #IMPLIED
+  src         %URI;          #IMPLIED
+  alt         CDATA          #IMPLIED
+  usemap      %URI;          #IMPLIED
+  onselect    %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  accept      %ContentTypes; #IMPLIED
+  align       %ImgAlign;     #IMPLIED
+  >
+
+<!ELEMENT select (optgroup|option)+>  <!-- option selector -->
+<!ATTLIST select
+  %attrs;
+  name        CDATA          #IMPLIED
+  size        %Number;       #IMPLIED
+  multiple    (multiple)     #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  tabindex    %Number;       #IMPLIED
+  onfocus     %Script;       #IMPLIED
+  onblur      %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  >
+
+<!ELEMENT optgroup (option)+>   <!-- option group -->
+<!ATTLIST optgroup
+  %attrs;
+  disabled    (disabled)     #IMPLIED
+  label       %Text;         #REQUIRED
+  >
+
+<!ELEMENT option (#PCDATA)>     <!-- selectable choice -->
+<!ATTLIST option
+  %attrs;
+  selected    (selected)     #IMPLIED
+  disabled    (disabled)     #IMPLIED
+  label       %Text;         #IMPLIED
+  value       CDATA          #IMPLIED
+  >
+
+<!ELEMENT textarea (#PCDATA)>     <!-- multi-line text field -->
+<!ATTLIST textarea
+  %attrs;
+  %focus;
+  name        CDATA          #IMPLIED
+  rows        %Number;       #REQUIRED
+  cols        %Number;       #REQUIRED
+  disabled    (disabled)     #IMPLIED
+  readonly    (readonly)     #IMPLIED
+  onselect    %Script;       #IMPLIED
+  onchange    %Script;       #IMPLIED
+  >
+
+<!--
+  The fieldset element is used to group form fields.
+  Only one legend element should occur in the content
+  and if present should only be preceded by whitespace.
+-->
+<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>
+<!ATTLIST fieldset
+  %attrs;
+  >
+
+<!ENTITY % LAlign "(top|bottom|left|right)">
+
+<!ELEMENT legend %Inline;>     <!-- fieldset label -->
+<!ATTLIST legend
+  %attrs;
+  accesskey   %Character;    #IMPLIED
+  align       %LAlign;       #IMPLIED
+  >
+
+<!--
+ Content is %Flow; excluding a, form, form controls, iframe
+--> 
+<!ELEMENT button %button.content;>  <!-- push button -->
+<!ATTLIST button
+  %attrs;
+  %focus;
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED
+  type        (button|submit|reset) "submit"
+  disabled    (disabled)     #IMPLIED
+  >
+
+<!-- single-line text input control (DEPRECATED) -->
+<!ELEMENT isindex EMPTY>
+<!ATTLIST isindex
+  %coreattrs;
+  %i18n;
+  prompt      %Text;         #IMPLIED
+  >
+
+<!--======================= Tables =======================================-->
+
+<!-- Derived from IETF HTML table standard, see [RFC1942] -->
+
+<!--
+ The border attribute sets the thickness of the frame around the
+ table. The default units are screen pixels.
+
+ The frame attribute specifies which parts of the frame around
+ the table should be rendered. The values are not the same as
+ CALS to avoid a name clash with the valign attribute.
+-->
+<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
+
+<!--
+ The rules attribute defines which rules to draw between cells:
+
+ If rules is absent then assume:
+     "none" if border is absent or border="0" otherwise "all"
+-->
+
+<!ENTITY % TRules "(none | groups | rows | cols | all)">
+  
+<!-- horizontal placement of table relative to document -->
+<!ENTITY % TAlign "(left|center|right)">
+
+<!-- horizontal alignment attributes for cell contents
+
+  char        alignment char, e.g. char=':'
+  charoff     offset for alignment char
+-->
+<!ENTITY % cellhalign
+  "align      (left|center|right|justify|char) #IMPLIED
+   char       %Character;    #IMPLIED
+   charoff    %Length;       #IMPLIED"
+  >
+
+<!-- vertical alignment attributes for cell contents -->
+<!ENTITY % cellvalign
+  "valign     (top|middle|bottom|baseline) #IMPLIED"
+  >
+
+<!ELEMENT table
+     (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
+<!ELEMENT caption  %Inline;>
+<!ELEMENT thead    (tr)+>
+<!ELEMENT tfoot    (tr)+>
+<!ELEMENT tbody    (tr)+>
+<!ELEMENT colgroup (col)*>
+<!ELEMENT col      EMPTY>
+<!ELEMENT tr       (th|td)+>
+<!ELEMENT th       %Flow;>
+<!ELEMENT td       %Flow;>
+
+<!ATTLIST table
+  %attrs;
+  summary     %Text;         #IMPLIED
+  width       %Length;       #IMPLIED
+  border      %Pixels;       #IMPLIED
+  frame       %TFrame;       #IMPLIED
+  rules       %TRules;       #IMPLIED
+  cellspacing %Length;       #IMPLIED
+  cellpadding %Length;       #IMPLIED
+  align       %TAlign;       #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  >
+
+<!ENTITY % CAlign "(top|bottom|left|right)">
+
+<!ATTLIST caption
+  %attrs;
+  align       %CAlign;       #IMPLIED
+  >
+
+<!--
+colgroup groups a set of col elements. It allows you to group
+several semantically related columns together.
+-->
+<!ATTLIST colgroup
+  %attrs;
+  span        %Number;       "1"
+  width       %MultiLength;  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!--
+ col elements define the alignment properties for cells in
+ one or more columns.
+
+ The width attribute specifies the width of the columns, e.g.
+
+     width=64        width in screen pixels
+     width=0.5*      relative width of 0.5
+
+ The span attribute causes the attributes of one
+ col element to apply to more than one column.
+-->
+<!ATTLIST col
+  %attrs;
+  span        %Number;       "1"
+  width       %MultiLength;  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!--
+    Use thead to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    tbody sections are rendered in scrolling panel.
+
+    Use tfoot to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    tbody sections are rendered in scrolling panel.
+
+    Use multiple tbody sections when rules are needed
+    between groups of table rows.
+-->
+<!ATTLIST thead
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tfoot
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tbody
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tr
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  bgcolor     %Color;        #IMPLIED
+  >
+
+<!-- Scope is simpler than headers attribute for common tables -->
+<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
+
+<!-- th is for headers, td for data and for cells acting as both -->
+
+<!ATTLIST th
+  %attrs;
+  abbr        %Text;         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       %Scope;        #IMPLIED
+  rowspan     %Number;       "1"
+  colspan     %Number;       "1"
+  %cellhalign;
+  %cellvalign;
+  nowrap      (nowrap)       #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  width       %Length;       #IMPLIED
+  height      %Length;       #IMPLIED
+  >
+
+<!ATTLIST td
+  %attrs;
+  abbr        %Text;         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       %Scope;        #IMPLIED
+  rowspan     %Number;       "1"
+  colspan     %Number;       "1"
+  %cellhalign;
+  %cellvalign;
+  nowrap      (nowrap)       #IMPLIED
+  bgcolor     %Color;        #IMPLIED
+  width       %Length;       #IMPLIED
+  height      %Length;       #IMPLIED
+  >
+
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-attribs-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-attribs-1.mod
new file mode 100644
index 0000000..865634b
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-attribs-1.mod
@@ -0,0 +1,142 @@
+<!-- ...................................................................... -->
+<!-- XHTML Common Attributes Module  ...................................... -->
+<!-- file: xhtml-attribs-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-attribs-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-attribs-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Common Attributes
+
+     This module declares many of the common attributes for the XHTML DTD.
+     %NS.decl.attrib; is declared in the XHTML Qname module.
+
+	 Note that this file was extended in XHTML Modularization 1.1 to 
+	 include declarations of "global" versions of the attribute collections.
+	 The global versions of the attributes are for use on elements in other 
+	 namespaces.  The global version of "common" includes the xmlns declaration
+	 for the prefixed version of the xhtml namespace.  If you are only using a
+	 specific attribute or an individual attribute collection, you must also
+	 include the XHTML.xmlns.attrib.prefixed PE on your elements.
+-->
+
+<!ENTITY % id.attrib
+     "id           ID                       #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.id.attrib
+     "%XHTML.prefix;:id           ID        #IMPLIED"
+>
+]]>
+
+<!ENTITY % class.attrib
+     "class        NMTOKENS                 #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.class.attrib
+     "%XHTML.prefix;:class        NMTOKENS                 #IMPLIED"
+>
+]]>
+
+<!ENTITY % title.attrib
+     "title        %Text.datatype;          #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.title.attrib
+     "%XHTML.prefix;:title        %Text.datatype;          #IMPLIED"
+>
+]]>
+
+<!ENTITY % Core.extra.attrib "" >
+
+<!ENTITY % Core.attrib
+     "%XHTML.xmlns.attrib;
+      %id.attrib;
+      %class.attrib;
+      %title.attrib;
+      xml:space    ( preserve )             #FIXED 'preserve'
+      %Core.extra.attrib;"
+>
+
+<!ENTITY % XHTML.global.core.extra.attrib "" >
+
+<![%XHTML.global.attrs.prefixed;[
+
+<!ENTITY % XHTML.global.core.attrib
+     "%XHTML.global.id.attrib;
+      %XHTML.global.class.attrib;
+      %XHTML.global.title.attrib;
+      %XHTML.global.core.extra.attrib;"
+>
+]]>
+
+<!ENTITY % XHTML.global.core.attrib "" >
+
+
+<!ENTITY % lang.attrib
+     "xml:lang     %LanguageCode.datatype;  #IMPLIED"
+>
+
+<![%XHTML.bidi;[
+<!ENTITY % dir.attrib
+     "dir          ( ltr | rtl )            #IMPLIED"
+>
+
+<!ENTITY % I18n.attrib
+     "%dir.attrib;
+      %lang.attrib;"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY XHTML.global.i18n.attrib
+     "%XHTML.prefix;:dir          ( ltr | rtl )            #IMPLIED
+      %lang.attrib;"
+>
+]]>
+<!ENTITY XHTML.global.i18n.attrib "" >
+
+]]>
+<!ENTITY % I18n.attrib
+     "%lang.attrib;"
+>
+<!ENTITY % XHTML.global.i18n.attrib
+     "%lang.attrib;"
+>
+
+<!ENTITY % Common.extra.attrib "" >
+<!ENTITY % XHTML.global.common.extra.attrib "" >
+
+<!-- intrinsic event attributes declared previously
+-->
+<!ENTITY % Events.attrib "" >
+
+<!ENTITY % XHTML.global.events.attrib "" >
+
+<!ENTITY % Common.attrib
+     "%Core.attrib;
+      %I18n.attrib;
+      %Events.attrib;
+      %Common.extra.attrib;"
+>
+
+<!ENTITY % XHTML.global.common.attrib
+     "%XHTML.xmlns.attrib.prefixed;
+      %XHTML.global.core.attrib;
+	  %XHTML.global.i18n.attrib;
+	  %XHTML.global.events.attrib;
+	  %XHTML.global.common.extra.attrib;"
+>
+
+<!-- end of xhtml-attribs-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-base-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-base-1.mod
new file mode 100644
index 0000000..ba47b40
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-base-1.mod
@@ -0,0 +1,53 @@
+<!-- ...................................................................... -->
+<!-- XHTML Base Element Module  ........................................... -->
+<!-- file: xhtml-base-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-base-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-base-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Base element
+
+        base
+
+     This module declares the base element type and its attributes,
+     used to define a base URI against which relative URIs in the
+     document will be resolved.
+
+     Note that this module also redeclares the content model for
+     the head element to include the base element.
+-->
+
+<!-- base: Document Base URI ........................... -->
+
+<!ENTITY % base.element  "INCLUDE" >
+<![%base.element;[
+<!ENTITY % base.content  "EMPTY" >
+<!ENTITY % base.qname  "base" >
+<!ELEMENT %base.qname;  %base.content; >
+<!-- end of base.element -->]]>
+
+<!ENTITY % base.attlist  "INCLUDE" >
+<![%base.attlist;[
+<!ATTLIST %base.qname;
+      %XHTML.xmlns.attrib;
+      href         %URI.datatype;           #REQUIRED
+>
+<!-- end of base.attlist -->]]>
+
+<!ENTITY % head.content
+    "( %HeadOpts.mix;,
+     ( ( %title.qname;, %HeadOpts.mix;, ( %base.qname;, %HeadOpts.mix; )? )
+     | ( %base.qname;, %HeadOpts.mix;, ( %title.qname;, %HeadOpts.mix; ))))"
+>
+
+<!-- end of xhtml-base-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-basic-form-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-basic-form-1.mod
new file mode 100644
index 0000000..de1b7df
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-basic-form-1.mod
@@ -0,0 +1,188 @@
+
+<!-- saved from url=(0042)http://www.rddl.org/xhtml-basic-form-1.mod -->
+<HTML><BODY><PRE style="word-wrap: break-word; white-space: pre-wrap;">&lt;!-- ...................................................................... --&gt;
+&lt;!-- XHTML Simplified Forms Module  ....................................... --&gt;
+&lt;!-- file: xhtml-basic-form-1.mod
+
+     This is XHTML Basic, a proper subset of XHTML.
+     Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-basic-form-1.mod,v 1.10 2000/10/16 21:15:23 radams Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Basic Forms 1.0//EN"  
+       SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-basic-form-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... --&gt;
+
+&lt;!-- Basic Forms
+
+     This forms module is based on the HTML 3.2 forms model, with
+     the WAI-requested addition of the label element. While this 
+     module essentially mimics the content model and attributes of 
+     HTML 3.2 forms, the element types declared herein also include
+     all HTML 4 common attributes.
+
+        form, label, input, select, option, textarea
+--&gt;
+
+&lt;!-- declare qualified element type names:
+--&gt;
+&lt;!ENTITY % form.qname  "form" &gt;
+&lt;!ENTITY % label.qname  "label" &gt;
+&lt;!ENTITY % input.qname  "input" &gt;
+&lt;!ENTITY % select.qname  "select" &gt;
+&lt;!ENTITY % option.qname  "option" &gt;
+&lt;!ENTITY % textarea.qname  "textarea" &gt;
+
+&lt;!-- %BlkNoForm.mix; includes all non-form block elements,
+     plus %Misc.class;
+--&gt;
+&lt;!ENTITY % BlkNoForm.mix
+     "%Heading.class;
+      | %List.class;
+      | %BlkStruct.class;
+      %BlkPhras.class;
+      %BlkPres.class;
+      | %table.qname; 
+      %Block.extra;
+      %Misc.class;"
+&gt;
+
+&lt;!-- form: Form Element ................................ --&gt;
+
+&lt;!ENTITY % form.element  "INCLUDE" &gt;
+&lt;![%form.element;[
+&lt;!ENTITY % form.content
+     "( %BlkNoForm.mix; )+"
+&gt;
+&lt;!ELEMENT %form.qname;  %form.content; &gt;
+&lt;!-- end of form.element --&gt;]]&gt;
+
+&lt;!ENTITY % form.attlist  "INCLUDE" &gt;
+&lt;![%form.attlist;[
+&lt;!ATTLIST %form.qname;
+      %Common.attrib;
+      action       %URI.datatype;           #REQUIRED
+      method       ( get | post )           'get'
+      enctype      %ContentType.datatype;   'application/x-www-form-urlencoded'
+&gt;
+&lt;!-- end of form.attlist --&gt;]]&gt;
+
+&lt;!-- label: Form Field Label Text ...................... --&gt;
+
+&lt;!ENTITY % label.element  "INCLUDE" &gt;
+&lt;![%label.element;[
+&lt;!-- Each label must not contain more than ONE field
+--&gt;
+&lt;!ENTITY % label.content
+     "( #PCDATA 
+      | %input.qname; | %select.qname; | %textarea.qname;
+      | %InlStruct.class;
+      %InlPhras.class;
+      %I18n.class;
+      %InlPres.class;
+      %InlSpecial.class;
+      %Misc.class; )*"
+&gt;
+&lt;!ELEMENT %label.qname;  %label.content; &gt;
+&lt;!-- end of label.element --&gt;]]&gt;
+
+&lt;!ENTITY % label.attlist  "INCLUDE" &gt;
+&lt;![%label.attlist;[
+&lt;!ATTLIST %label.qname;
+      %Common.attrib;
+      for          IDREF                    #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+&gt;
+&lt;!-- end of label.attlist --&gt;]]&gt;
+
+&lt;!-- input: Form Control ............................... --&gt;
+
+&lt;!ENTITY % input.element  "INCLUDE" &gt;
+&lt;![%input.element;[
+&lt;!ENTITY % input.content  "EMPTY" &gt;
+&lt;!ELEMENT %input.qname;  %input.content; &gt;
+&lt;!-- end of input.element --&gt;]]&gt;
+
+&lt;!-- Basic Forms removes 'image' and 'file' input types.
+--&gt;
+&lt;!ENTITY % input.attlist  "INCLUDE" &gt;
+&lt;![%input.attlist;[
+&lt;!ENTITY % InputType.class
+     "( text | password | checkbox | radio 
+      | submit | reset | hidden )"
+&gt;
+&lt;!-- attribute name required for all but submit &amp; reset
+--&gt;
+&lt;!ATTLIST %input.qname;
+      %Common.attrib;
+      type         %InputType.class;        'text'
+      name         CDATA                    #IMPLIED
+      value        CDATA                    #IMPLIED
+      checked      ( checked )              #IMPLIED
+      size         CDATA                    #IMPLIED
+      maxlength    %Number.datatype;        #IMPLIED
+      src          %URI.datatype;           #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+&gt;
+&lt;!-- end of input.attlist --&gt;]]&gt;
+
+&lt;!-- select: Option Selector ........................... --&gt;
+
+&lt;!ENTITY % select.element  "INCLUDE" &gt;
+&lt;![%select.element;[
+&lt;!ENTITY % select.content  "( %option.qname; )+" &gt;
+&lt;!ELEMENT %select.qname;  %select.content; &gt;
+&lt;!-- end of select.element --&gt;]]&gt;
+
+&lt;!ENTITY % select.attlist  "INCLUDE" &gt;
+&lt;![%select.attlist;[
+&lt;!ATTLIST %select.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      size         %Number.datatype;        #IMPLIED
+      multiple     ( multiple )             #IMPLIED
+&gt;
+&lt;!-- end of select.attlist --&gt;]]&gt;
+
+&lt;!-- option: Selectable Choice ......................... --&gt;
+
+&lt;!ENTITY % option.element  "INCLUDE" &gt;
+&lt;![%option.element;[
+&lt;!ENTITY % option.content  "( #PCDATA )" &gt;
+&lt;!ELEMENT %option.qname;  %option.content; &gt;
+&lt;!-- end of option.element --&gt;]]&gt;
+
+&lt;!ENTITY % option.attlist  "INCLUDE" &gt;
+&lt;![%option.attlist;[
+&lt;!ATTLIST %option.qname;
+      %Common.attrib;
+      selected     ( selected )             #IMPLIED
+      value        CDATA                    #IMPLIED
+&gt;
+&lt;!-- end of option.attlist --&gt;]]&gt;
+
+&lt;!-- textarea: Multi-Line Text Field ................... --&gt;
+
+&lt;!ENTITY % textarea.element  "INCLUDE" &gt;
+&lt;![%textarea.element;[
+&lt;!ENTITY % textarea.content  "( #PCDATA )" &gt;
+&lt;!ELEMENT %textarea.qname;  %textarea.content; &gt;
+&lt;!-- end of textarea.element --&gt;]]&gt;
+
+&lt;!ENTITY % textarea.attlist  "INCLUDE" &gt;
+&lt;![%textarea.attlist;[
+&lt;!ATTLIST %textarea.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      rows         %Number.datatype;        #REQUIRED
+      cols         %Number.datatype;        #REQUIRED
+      accesskey    %Character.datatype;     #IMPLIED
+&gt;
+&lt;!-- end of textarea.attlist --&gt;]]&gt;
+
+&lt;!-- end of xhtml-basic-form-1.mod --&gt;
+</PRE></BODY></HTML>
\ No newline at end of file
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-basic-table-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-basic-table-1.mod
new file mode 100644
index 0000000..170164e
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-basic-table-1.mod
@@ -0,0 +1,167 @@
+<!-- ....................................................................... -->
+<!-- XHTML Basic Table Module  ............................................. -->
+<!-- file: xhtml-basic-table-1.mod
+
+     This is XHTML Basic, a proper subset of XHTML.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-basic-table-1.mod,v 1.1 2010/07/29 13:42:46 bertails Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-basic-table-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Basic Tables
+
+        table, caption, tr, th, td
+
+     This table module declares elements and attributes defining
+     a table model based fundamentally on features found in the
+     widely-deployed HTML 3.2 table model.  While this module
+     mimics the content model and table attributes of HTML 3.2
+     tables, the element types declared herein also includes all
+     HTML 4 common and most of the HTML 4 table attributes.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % table.qname  "table" >
+<!ENTITY % caption.qname  "caption" >
+<!ENTITY % tr.qname  "tr" >
+<!ENTITY % th.qname  "th" >
+<!ENTITY % td.qname  "td" >
+
+<!-- horizontal alignment attributes for cell contents
+-->
+<!ENTITY % CellHAlign.attrib
+     "align        ( left
+                   | center
+                   | right )                #IMPLIED"
+>
+
+<!-- vertical alignment attributes for cell contents
+-->
+<!ENTITY % CellVAlign.attrib
+     "valign       ( top
+                   | middle
+                   | bottom )               #IMPLIED"
+>
+
+<!-- scope is simpler than axes attribute for common tables
+-->
+<!ENTITY % scope.attrib
+     "scope        ( row | col  )           #IMPLIED"
+>
+
+<!-- table: Table Element .............................. -->
+
+<!ENTITY % table.element  "INCLUDE" >
+<![%table.element;[
+<!ENTITY % table.content
+     "( %caption.qname;?, %tr.qname;+ )"
+>
+<!ELEMENT %table.qname;  %table.content; >
+<!-- end of table.element -->]]>
+
+<!ENTITY % table.attlist  "INCLUDE" >
+<![%table.attlist;[
+<!ATTLIST %table.qname;
+      %Common.attrib;
+      summary      %Text.datatype;          #IMPLIED
+      width        %Length.datatype;        #IMPLIED
+>
+<!-- end of table.attlist -->]]>
+
+<!-- caption: Table Caption ............................ -->
+
+<!ENTITY % caption.element  "INCLUDE" >
+<![%caption.element;[
+<!ENTITY % caption.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %caption.qname;  %caption.content; >
+<!-- end of caption.element -->]]>
+
+<!ENTITY % caption.attlist  "INCLUDE" >
+<![%caption.attlist;[
+<!ATTLIST %caption.qname;
+      %Common.attrib;
+>
+<!-- end of caption.attlist -->]]>
+
+<!-- tr: Table Row ..................................... -->
+
+<!ENTITY % tr.element  "INCLUDE" >
+<![%tr.element;[
+<!ENTITY % tr.content  "( %th.qname; | %td.qname; )+" >
+<!ELEMENT %tr.qname;  %tr.content; >
+<!-- end of tr.element -->]]>
+
+<!ENTITY % tr.attlist  "INCLUDE" >
+<![%tr.attlist;[
+<!ATTLIST %tr.qname;
+      %Common.attrib;
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of tr.attlist -->]]>
+
+<!-- th: Table Header Cell ............................. -->
+
+<!-- th is for header cells, td for data,
+     but for cells acting as both use td
+-->
+
+<!ENTITY % th.element  "INCLUDE" >
+<![%th.element;[
+<!ENTITY % th.content
+     "( #PCDATA | %FlowNoTable.mix; )*"
+>
+<!ELEMENT %th.qname;  %th.content; >
+<!-- end of th.element -->]]>
+
+<!ENTITY % th.attlist  "INCLUDE" >
+<![%th.attlist;[
+<!ATTLIST %th.qname;
+      %Common.attrib;
+      abbr         %Text.datatype;          #IMPLIED
+      axis         CDATA                    #IMPLIED
+      headers      IDREFS                   #IMPLIED
+      %scope.attrib;
+      rowspan      %Number.datatype;        '1'
+      colspan      %Number.datatype;        '1'
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of th.attlist -->]]>
+
+<!-- td: Table Data Cell ............................... -->
+
+<!ENTITY % td.element  "INCLUDE" >
+<![%td.element;[
+<!ENTITY % td.content
+     "( #PCDATA | %FlowNoTable.mix; )*"
+>
+<!ELEMENT %td.qname;  %td.content; >
+<!-- end of td.element -->]]>
+
+<!ENTITY % td.attlist  "INCLUDE" >
+<![%td.attlist;[
+<!ATTLIST %td.qname;
+      %Common.attrib;
+      abbr         %Text.datatype;          #IMPLIED
+      axis         CDATA                    #IMPLIED
+      headers      IDREFS                   #IMPLIED
+      %scope.attrib;
+      rowspan      %Number.datatype;        '1'
+      colspan      %Number.datatype;        '1'
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of td.attlist -->]]>
+
+<!-- end of xhtml-basic-table-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-blkphras-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-blkphras-1.mod
new file mode 100644
index 0000000..9172463
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-blkphras-1.mod
@@ -0,0 +1,164 @@
+<!-- ...................................................................... -->
+<!-- XHTML Block Phrasal Module  .......................................... -->
+<!-- file: xhtml-blkphras-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-blkphras-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-blkphras-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Block Phrasal
+
+        address, blockquote, pre, h1, h2, h3, h4, h5, h6
+
+     This module declares the elements and their attributes used to
+     support block-level phrasal markup.
+-->
+
+<!ENTITY % address.element  "INCLUDE" >
+<![%address.element;[
+<!ENTITY % address.content
+     "( #PCDATA | %Inline.mix; )*" >
+<!ENTITY % address.qname  "address" >
+<!ELEMENT %address.qname;  %address.content; >
+<!-- end of address.element -->]]>
+
+<!ENTITY % address.attlist  "INCLUDE" >
+<![%address.attlist;[
+<!ATTLIST %address.qname;
+      %Common.attrib;
+>
+<!-- end of address.attlist -->]]>
+
+<!ENTITY % blockquote.element  "INCLUDE" >
+<![%blockquote.element;[
+<!ENTITY % blockquote.content
+     "( %Block.mix; )*"
+>
+<!ENTITY % blockquote.qname  "blockquote" >
+<!ELEMENT %blockquote.qname;  %blockquote.content; >
+<!-- end of blockquote.element -->]]>
+
+<!ENTITY % blockquote.attlist  "INCLUDE" >
+<![%blockquote.attlist;[
+<!ATTLIST %blockquote.qname;
+      %Common.attrib;
+      cite         %URI.datatype;           #IMPLIED
+>
+<!-- end of blockquote.attlist -->]]>
+
+<!ENTITY % pre.element  "INCLUDE" >
+<![%pre.element;[
+<!ENTITY % pre.content
+     "( #PCDATA
+      | %InlStruct.class;
+      %InlPhras.class;
+      | %tt.qname; | %i.qname; | %b.qname;
+      %I18n.class;
+      %Anchor.class;
+      | %map.qname;
+      %Misc.class;
+      %Inline.extra; )*"
+>
+<!ENTITY % pre.qname  "pre" >
+<!ELEMENT %pre.qname;  %pre.content; >
+<!-- end of pre.element -->]]>
+
+<!ENTITY % pre.attlist  "INCLUDE" >
+<![%pre.attlist;[
+<!ATTLIST %pre.qname;
+      %Common.attrib;
+>
+<!-- end of pre.attlist -->]]>
+
+<!-- ...................  Heading Elements  ................... -->
+
+<!ENTITY % Heading.content  "( #PCDATA | %Inline.mix; )*" >
+
+<!ENTITY % h1.element  "INCLUDE" >
+<![%h1.element;[
+<!ENTITY % h1.qname  "h1" >
+<!ELEMENT %h1.qname;  %Heading.content; >
+<!-- end of h1.element -->]]>
+
+<!ENTITY % h1.attlist  "INCLUDE" >
+<![%h1.attlist;[
+<!ATTLIST %h1.qname;
+      %Common.attrib;
+>
+<!-- end of h1.attlist -->]]>
+
+<!ENTITY % h2.element  "INCLUDE" >
+<![%h2.element;[
+<!ENTITY % h2.qname  "h2" >
+<!ELEMENT %h2.qname;  %Heading.content; >
+<!-- end of h2.element -->]]>
+
+<!ENTITY % h2.attlist  "INCLUDE" >
+<![%h2.attlist;[
+<!ATTLIST %h2.qname;
+      %Common.attrib;
+>
+<!-- end of h2.attlist -->]]>
+
+<!ENTITY % h3.element  "INCLUDE" >
+<![%h3.element;[
+<!ENTITY % h3.qname  "h3" >
+<!ELEMENT %h3.qname;  %Heading.content; >
+<!-- end of h3.element -->]]>
+
+<!ENTITY % h3.attlist  "INCLUDE" >
+<![%h3.attlist;[
+<!ATTLIST %h3.qname;
+      %Common.attrib;
+>
+<!-- end of h3.attlist -->]]>
+
+<!ENTITY % h4.element  "INCLUDE" >
+<![%h4.element;[
+<!ENTITY % h4.qname  "h4" >
+<!ELEMENT %h4.qname;  %Heading.content; >
+<!-- end of h4.element -->]]>
+
+<!ENTITY % h4.attlist  "INCLUDE" >
+<![%h4.attlist;[
+<!ATTLIST %h4.qname;
+      %Common.attrib;
+>
+<!-- end of h4.attlist -->]]>
+
+<!ENTITY % h5.element  "INCLUDE" >
+<![%h5.element;[
+<!ENTITY % h5.qname  "h5" >
+<!ELEMENT %h5.qname;  %Heading.content; >
+<!-- end of h5.element -->]]>
+
+<!ENTITY % h5.attlist  "INCLUDE" >
+<![%h5.attlist;[
+<!ATTLIST %h5.qname;
+      %Common.attrib;
+>
+<!-- end of h5.attlist -->]]>
+
+<!ENTITY % h6.element  "INCLUDE" >
+<![%h6.element;[
+<!ENTITY % h6.qname  "h6" >
+<!ELEMENT %h6.qname;  %Heading.content; >
+<!-- end of h6.element -->]]>
+
+<!ENTITY % h6.attlist  "INCLUDE" >
+<![%h6.attlist;[
+<!ATTLIST %h6.qname;
+      %Common.attrib;
+>
+<!-- end of h6.attlist -->]]>
+
+<!-- end of xhtml-blkphras-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-blkpres-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-blkpres-1.mod
new file mode 100644
index 0000000..c342f8b
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-blkpres-1.mod
@@ -0,0 +1,40 @@
+<!-- ...................................................................... -->
+<!-- XHTML Block Presentation Module  ..................................... -->
+<!-- file: xhtml-blkpres-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-blkpres-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-blkpres-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Block Presentational Elements
+
+        hr
+
+     This module declares the elements and their attributes used to
+     support block-level presentational markup.
+-->
+
+<!ENTITY % hr.element  "INCLUDE" >
+<![%hr.element;[
+<!ENTITY % hr.content  "EMPTY" >
+<!ENTITY % hr.qname  "hr" >
+<!ELEMENT %hr.qname;  %hr.content; >
+<!-- end of hr.element -->]]>
+
+<!ENTITY % hr.attlist  "INCLUDE" >
+<![%hr.attlist;[
+<!ATTLIST %hr.qname;
+      %Common.attrib;
+>
+<!-- end of hr.attlist -->]]>
+
+<!-- end of xhtml-blkpres-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-blkstruct-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-blkstruct-1.mod
new file mode 100644
index 0000000..ce6a95c
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-blkstruct-1.mod
@@ -0,0 +1,57 @@
+<!-- ...................................................................... -->
+<!-- XHTML Block Structural Module  ....................................... -->
+<!-- file: xhtml-blkstruct-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-blkstruct-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-blkstruct-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Block Structural
+
+        div, p
+
+     This module declares the elements and their attributes used to
+     support block-level structural markup.
+-->
+
+<!ENTITY % div.element  "INCLUDE" >
+<![%div.element;[
+<!ENTITY % div.content
+     "( #PCDATA | %Flow.mix; )*"
+>
+<!ENTITY % div.qname  "div" >
+<!ELEMENT %div.qname;  %div.content; >
+<!-- end of div.element -->]]>
+
+<!ENTITY % div.attlist  "INCLUDE" >
+<![%div.attlist;[
+<!ATTLIST %div.qname;
+      %Common.attrib;
+>
+<!-- end of div.attlist -->]]>
+
+<!ENTITY % p.element  "INCLUDE" >
+<![%p.element;[
+<!ENTITY % p.content
+     "( #PCDATA | %Inline.mix; )*" >
+<!ENTITY % p.qname  "p" >
+<!ELEMENT %p.qname;  %p.content; >
+<!-- end of p.element -->]]>
+
+<!ENTITY % p.attlist  "INCLUDE" >
+<![%p.attlist;[
+<!ATTLIST %p.qname;
+      %Common.attrib;
+>
+<!-- end of p.attlist -->]]>
+
+<!-- end of xhtml-blkstruct-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-charent-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-charent-1.mod
new file mode 100644
index 0000000..824c3ed
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-charent-1.mod
@@ -0,0 +1,39 @@
+<!-- ...................................................................... -->
+<!-- XHTML Character Entities Module  ......................................... -->
+<!-- file: xhtml-charent-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-charent-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-charent-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Character Entities for XHTML
+
+     This module declares the set of character entities for XHTML,
+     including the Latin 1, Symbol and Special character collections.
+-->
+
+<!ENTITY % xhtml-lat1
+    PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+           "xhtml-lat1.ent" >
+%xhtml-lat1;
+
+<!ENTITY % xhtml-symbol
+    PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+           "xhtml-symbol.ent" >
+%xhtml-symbol;
+
+<!ENTITY % xhtml-special
+    PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+           "xhtml-special.ent" >
+%xhtml-special;
+
+<!-- end of xhtml-charent-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-csismap-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-csismap-1.mod
new file mode 100644
index 0000000..09b3720
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-csismap-1.mod
@@ -0,0 +1,114 @@
+<!-- ...................................................................... -->
+<!-- XHTML Client-side Image Map Module  .................................. -->
+<!-- file: xhtml-csismap-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-csismap-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Client-side Image Maps 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-csismap-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Client-side Image Maps
+
+        area, map
+
+     This module declares elements and attributes to support client-side
+     image maps. This requires that the Image Module (or a module
+     declaring the img element type) be included in the DTD.
+
+     These can be placed in the same document or grouped in a
+     separate document, although the latter isn't widely supported
+-->
+
+<!ENTITY % area.element  "INCLUDE" >
+<![%area.element;[
+<!ENTITY % area.content  "EMPTY" >
+<!ENTITY % area.qname  "area" >
+<!ELEMENT %area.qname;  %area.content; >
+<!-- end of area.element -->]]>
+
+<!ENTITY % Shape.datatype "( rect | circle | poly | default )">
+<!ENTITY % Coords.datatype "CDATA" >
+
+<!ENTITY % area.attlist  "INCLUDE" >
+<![%area.attlist;[
+<!ATTLIST %area.qname;
+      %Common.attrib;
+      href         %URI.datatype;           #IMPLIED
+      shape        %Shape.datatype;         'rect'
+      coords       %Coords.datatype;        #IMPLIED
+      nohref       ( nohref )               #IMPLIED
+      alt          %Text.datatype;          #REQUIRED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of area.attlist -->]]>
+
+<!-- modify anchor attribute definition list
+     to allow for client-side image maps
+-->
+<!ATTLIST %a.qname;
+      shape        %Shape.datatype;         'rect'
+      coords       %Coords.datatype;        #IMPLIED
+>
+
+<!-- modify img attribute definition list
+     to allow for client-side image maps
+-->
+<!ATTLIST %img.qname;
+      usemap       IDREF                    #IMPLIED
+>
+
+<!-- modify form input attribute definition list
+     to allow for client-side image maps
+-->
+<!ATTLIST %input.qname;
+      usemap       IDREF                    #IMPLIED
+>
+
+<!-- modify object attribute definition list
+     to allow for client-side image maps
+-->
+<!ATTLIST %object.qname;
+      usemap       IDREF                    #IMPLIED
+>
+
+<!-- 'usemap' points to the 'id' attribute of a <map> element,
+     which must be in the same document; support for external
+     document maps was not widely supported in HTML and is
+     eliminated in XHTML.
+
+     It is considered an error for the element pointed to by
+     a usemap IDREF to occur in anything but a <map> element.
+-->
+
+<!ENTITY % map.element  "INCLUDE" >
+<![%map.element;[
+<!ENTITY % map.content
+     "(( %Block.mix; ) | %area.qname; )+"
+>
+<!ENTITY % map.qname  "map" >
+<!ELEMENT %map.qname;  %map.content; >
+<!-- end of map.element -->]]>
+
+<!ENTITY % map.attlist  "INCLUDE" >
+<![%map.attlist;[
+<!ATTLIST %map.qname;
+      %XHTML.xmlns.attrib;
+      id           ID                       #REQUIRED
+      %class.attrib;
+      %title.attrib;
+      %Core.extra.attrib;
+      %I18n.attrib;
+      %Events.attrib;
+>
+<!-- end of map.attlist -->]]>
+
+<!-- end of xhtml-csismap-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-datatypes-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-datatypes-1.mod
new file mode 100644
index 0000000..7e07ff1
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-datatypes-1.mod
@@ -0,0 +1,100 @@
+<!-- ...................................................................... -->
+<!-- XHTML Datatypes Module  .............................................. -->
+<!-- file: xhtml-datatypes-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-datatypes-1.mod,v 4.1 2001/04/06 19:23:32 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-datatypes-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Datatypes
+
+     defines containers for the following datatypes, many of
+     these imported from other specifications and standards.
+-->
+
+<!-- Length defined for cellpadding/cellspacing -->
+
+<!-- nn for pixels or nn% for percentage length -->
+<!ENTITY % Length.datatype "CDATA" >
+
+<!-- space-separated list of link types -->
+<!ENTITY % LinkTypes.datatype "NMTOKENS" >
+
+<!-- single or comma-separated list of media descriptors -->
+<!ENTITY % MediaDesc.datatype "CDATA" >
+
+<!-- pixel, percentage, or relative -->
+<!ENTITY % MultiLength.datatype "CDATA" >
+
+<!-- one or more digits (NUMBER) -->
+<!ENTITY % Number.datatype "CDATA" >
+
+<!-- integer representing length in pixels -->
+<!ENTITY % Pixels.datatype "CDATA" >
+
+<!-- script expression -->
+<!ENTITY % Script.datatype "CDATA" >
+
+<!-- textual content -->
+<!ENTITY % Text.datatype "CDATA" >
+
+<!-- Placeholder Compact URI-related types -->
+<!ENTITY % CURIE.datatype "CDATA" >
+<!ENTITY % CURIEs.datatype "CDATA" >
+<!ENTITY % SafeCURIE.datatype "CDATA" >
+<!ENTITY % SafeCURIEs.datatype "CDATA" >
+<!ENTITY % URIorSafeCURIE.datatype "CDATA" >
+<!ENTITY % URIorSafeCURIEs.datatype "CDATA" >
+
+<!-- Imported Datatypes ................................ -->
+
+<!-- a single character from [ISO10646] -->
+<!ENTITY % Character.datatype "CDATA" >
+
+<!-- a character encoding, as per [RFC2045] -->
+<!ENTITY % Charset.datatype "CDATA" >
+
+<!-- a space separated list of character encodings, as per [RFC2045] -->
+<!ENTITY % Charsets.datatype "CDATA" >
+
+<!-- Color specification using color name or sRGB (#RRGGBB) values -->
+<!ENTITY % Color.datatype "CDATA" >
+
+<!-- media type, as per [RFC2045] -->
+<!ENTITY % ContentType.datatype "CDATA" >
+
+<!-- comma-separated list of media types, as per [RFC2045] -->
+<!ENTITY % ContentTypes.datatype "CDATA" >
+
+<!-- date and time information. ISO date format -->
+<!ENTITY % Datetime.datatype "CDATA" >
+
+<!-- formal public identifier, as per [ISO8879] -->
+<!ENTITY % FPI.datatype "CDATA" >
+
+<!-- a language code, as per [RFC3066] or its successor -->
+<!ENTITY % LanguageCode.datatype "CDATA" >
+
+<!-- a comma separated list of language code ranges -->
+<!ENTITY % LanguageCodes.datatype "CDATA" >
+
+<!-- a qualified name , as per [XMLNS] or its successor -->
+<!ENTITY % QName.datatype "CDATA" >
+<!ENTITY % QNames.datatype "CDATA" >
+
+<!-- a Uniform Resource Identifier, see [URI] -->
+<!ENTITY % URI.datatype "CDATA" >
+
+<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
+<!ENTITY % URIs.datatype "CDATA" >
+
+<!-- end of xhtml-datatypes-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-edit-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-edit-1.mod
new file mode 100644
index 0000000..b2a328e
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-edit-1.mod
@@ -0,0 +1,66 @@
+<!-- ...................................................................... -->
+<!-- XHTML Editing Elements Module  ....................................... -->
+<!-- file: xhtml-edit-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-edit-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Editing Markup 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-edit-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Editing Elements
+
+        ins, del
+
+     This module declares element types and attributes used to indicate
+     inserted and deleted content while editing a document.
+-->
+
+<!-- ins: Inserted Text  ............................... -->
+
+<!ENTITY % ins.element  "INCLUDE" >
+<![%ins.element;[
+<!ENTITY % ins.content
+     "( #PCDATA | %Flow.mix; )*"
+>
+<!ENTITY % ins.qname  "ins" >
+<!ELEMENT %ins.qname;  %ins.content; >
+<!-- end of ins.element -->]]>
+
+<!ENTITY % ins.attlist  "INCLUDE" >
+<![%ins.attlist;[
+<!ATTLIST %ins.qname;
+      %Common.attrib;
+      cite         %URI.datatype;           #IMPLIED
+      datetime     %Datetime.datatype;      #IMPLIED
+>
+<!-- end of ins.attlist -->]]>
+
+<!-- del: Deleted Text  ................................ -->
+
+<!ENTITY % del.element  "INCLUDE" >
+<![%del.element;[
+<!ENTITY % del.content
+     "( #PCDATA | %Flow.mix; )*"
+>
+<!ENTITY % del.qname  "del" >
+<!ELEMENT %del.qname;  %del.content; >
+<!-- end of del.element -->]]>
+
+<!ENTITY % del.attlist  "INCLUDE" >
+<![%del.attlist;[
+<!ATTLIST %del.qname;
+      %Common.attrib;
+      cite         %URI.datatype;           #IMPLIED
+      datetime     %Datetime.datatype;      #IMPLIED
+>
+<!-- end of del.attlist -->]]>
+
+<!-- end of xhtml-edit-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-events-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-events-1.mod
new file mode 100644
index 0000000..03fd46c
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-events-1.mod
@@ -0,0 +1,135 @@
+<!-- ...................................................................... -->
+<!-- XHTML Intrinsic Events Module  ....................................... -->
+<!-- file: xhtml-events-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-events-1.mod,v 4.1 2001/04/10 09:42:30 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-events-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Intrinsic Event Attributes
+
+     These are the event attributes defined in HTML 4,
+     Section 18.2.3 "Intrinsic Events". This module must be
+     instantiated prior to the Attributes Module but after
+     the Datatype Module in the Modular Framework module.
+
+    "Note: Authors of HTML documents are advised that changes
+     are likely to occur in the realm of intrinsic events
+     (e.g., how scripts are bound to events). Research in
+     this realm is carried on by members of the W3C Document
+     Object Model Working Group (see the W3C Web site at
+     http://www.w3.org/ for more information)."
+-->
+<!-- NOTE: Because the ATTLIST declarations in this module occur
+     before their respective ELEMENT declarations in other
+     modules, there may be a dependency on this module that
+     should be considered if any of the parameter entities used
+     for element type names (eg., %a.qname;) are redeclared.
+-->
+
+<!ENTITY % Events.attrib
+     "onclick      %Script.datatype;        #IMPLIED
+      ondblclick   %Script.datatype;        #IMPLIED
+      onmousedown  %Script.datatype;        #IMPLIED
+      onmouseup    %Script.datatype;        #IMPLIED
+      onmouseover  %Script.datatype;        #IMPLIED
+      onmousemove  %Script.datatype;        #IMPLIED
+      onmouseout   %Script.datatype;        #IMPLIED
+      onkeypress   %Script.datatype;        #IMPLIED
+      onkeydown    %Script.datatype;        #IMPLIED
+      onkeyup      %Script.datatype;        #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.events.attrib
+     "%XHTML.prefix;:onclick      %Script.datatype;        #IMPLIED
+      %XHTML.prefix;:ondblclick   %Script.datatype;        #IMPLIED
+      %XHTML.prefix;:onmousedown  %Script.datatype;        #IMPLIED
+      %XHTML.prefix;:onmouseup    %Script.datatype;        #IMPLIED
+      %XHTML.prefix;:onmouseover  %Script.datatype;        #IMPLIED
+      %XHTML.prefix;:onmousemove  %Script.datatype;        #IMPLIED
+      %XHTML.prefix;:onmouseout   %Script.datatype;        #IMPLIED
+      %XHTML.prefix;:onkeypress   %Script.datatype;        #IMPLIED
+      %XHTML.prefix;:onkeydown    %Script.datatype;        #IMPLIED
+      %XHTML.prefix;:onkeyup      %Script.datatype;        #IMPLIED"
+>
+]]>
+
+<!-- additional attributes on anchor element
+-->
+<!ATTLIST %a.qname;
+     onfocus      %Script.datatype;         #IMPLIED
+     onblur       %Script.datatype;         #IMPLIED
+>
+
+<!-- additional attributes on form element
+-->
+<!ATTLIST %form.qname;
+      onsubmit     %Script.datatype;        #IMPLIED
+      onreset      %Script.datatype;        #IMPLIED
+>
+
+<!-- additional attributes on label element
+-->
+<!ATTLIST %label.qname;
+      onfocus      %Script.datatype;        #IMPLIED
+      onblur       %Script.datatype;        #IMPLIED
+>
+
+<!-- additional attributes on input element
+-->
+<!ATTLIST %input.qname;
+      onfocus      %Script.datatype;        #IMPLIED
+      onblur       %Script.datatype;        #IMPLIED
+      onselect     %Script.datatype;        #IMPLIED
+      onchange     %Script.datatype;        #IMPLIED
+>
+
+<!-- additional attributes on select element
+-->
+<!ATTLIST %select.qname;
+      onfocus      %Script.datatype;        #IMPLIED
+      onblur       %Script.datatype;        #IMPLIED
+      onchange     %Script.datatype;        #IMPLIED
+>
+
+<!-- additional attributes on textarea element
+-->
+<!ATTLIST %textarea.qname;
+      onfocus      %Script.datatype;        #IMPLIED
+      onblur       %Script.datatype;        #IMPLIED
+      onselect     %Script.datatype;        #IMPLIED
+      onchange     %Script.datatype;        #IMPLIED
+>
+
+<!-- additional attributes on button element
+-->
+<!ATTLIST %button.qname;
+      onfocus      %Script.datatype;        #IMPLIED
+      onblur       %Script.datatype;        #IMPLIED
+>
+
+<!-- additional attributes on body element
+-->
+<!ATTLIST %body.qname;
+      onload       %Script.datatype;        #IMPLIED
+      onunload     %Script.datatype;        #IMPLIED
+>
+
+<!-- additional attributes on area element
+-->
+<!ATTLIST %area.qname;
+      onfocus      %Script.datatype;        #IMPLIED
+      onblur       %Script.datatype;        #IMPLIED
+>
+
+<!-- end of xhtml-events-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-form-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-form-1.mod
new file mode 100644
index 0000000..467ea02
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-form-1.mod
@@ -0,0 +1,291 @@
+<!-- ...................................................................... -->
+<!-- XHTML Forms Module  .................................................. -->
+<!-- file: xhtml-form-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-form-1.mod,v 4.1 2001/04/10 09:42:30 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-form-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Forms
+
+        form, label, input, select, optgroup, option,
+        textarea, fieldset, legend, button
+
+     This module declares markup to provide support for online
+     forms, based on the features found in HTML 4 forms.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % form.qname  "form" >
+<!ENTITY % label.qname  "label" >
+<!ENTITY % input.qname  "input" >
+<!ENTITY % select.qname  "select" >
+<!ENTITY % optgroup.qname  "optgroup" >
+<!ENTITY % option.qname  "option" >
+<!ENTITY % textarea.qname  "textarea" >
+<!ENTITY % fieldset.qname  "fieldset" >
+<!ENTITY % legend.qname  "legend" >
+<!ENTITY % button.qname  "button" >
+
+<!-- %BlkNoForm.mix; includes all non-form block elements,
+     plus %Misc.class;
+-->
+<!ENTITY % BlkNoForm.mix
+     "%Heading.class;
+      | %List.class;
+      | %BlkStruct.class;
+      %BlkPhras.class;
+      %BlkPres.class;
+      %Table.class;
+      %Block.extra;
+      %Misc.class;"
+>
+
+<!-- form: Form Element ................................ -->
+
+<!ENTITY % form.element  "INCLUDE" >
+<![%form.element;[
+<!ENTITY % form.content
+     "( %BlkNoForm.mix;
+      | %fieldset.qname; )+"
+>
+<!ELEMENT %form.qname;  %form.content; >
+<!-- end of form.element -->]]>
+
+<!ENTITY % form.attlist  "INCLUDE" >
+<![%form.attlist;[
+<!ATTLIST %form.qname;
+      %Common.attrib;
+      action       %URI.datatype;           #REQUIRED
+      method       ( get | post )           'get'
+      enctype      %ContentType.datatype;   'application/x-www-form-urlencoded'
+      accept-charset %Charsets.datatype;    #IMPLIED
+      accept       %ContentTypes.datatype;  #IMPLIED
+>
+<!-- end of form.attlist -->]]>
+
+<!-- label: Form Field Label Text ...................... -->
+
+<!-- Each label must not contain more than ONE field
+-->
+
+<!ENTITY % label.element  "INCLUDE" >
+<![%label.element;[
+<!ENTITY % label.content
+     "( #PCDATA
+      | %input.qname; | %select.qname; | %textarea.qname; | %button.qname;
+      | %InlStruct.class;
+      %InlPhras.class;
+      %I18n.class;
+      %InlPres.class;
+      %Anchor.class;
+      %InlSpecial.class;
+      %Inline.extra;
+      %Misc.class; )*"
+>
+<!ELEMENT %label.qname;  %label.content; >
+<!-- end of label.element -->]]>
+
+<!ENTITY % label.attlist  "INCLUDE" >
+<![%label.attlist;[
+<!ATTLIST %label.qname;
+      %Common.attrib;
+      for          IDREF                    #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of label.attlist -->]]>
+
+<!-- input: Form Control ............................... -->
+
+<!ENTITY % input.element  "INCLUDE" >
+<![%input.element;[
+<!ENTITY % input.content  "EMPTY" >
+<!ELEMENT %input.qname;  %input.content; >
+<!-- end of input.element -->]]>
+
+<!ENTITY % input.attlist  "INCLUDE" >
+<![%input.attlist;[
+<!ENTITY % InputType.class
+     "( text | password | checkbox | radio | submit
+      | reset | file | hidden | image | button )"
+>
+<!-- attribute 'name' required for all but submit & reset
+-->
+<!ATTLIST %input.qname;
+      %Common.attrib;
+      type         %InputType.class;        'text'
+      name         CDATA                    #IMPLIED
+      value        CDATA                    #IMPLIED
+      checked      ( checked )              #IMPLIED
+      disabled     ( disabled )             #IMPLIED
+      readonly     ( readonly )             #IMPLIED
+      size         %Number.datatype;        #IMPLIED
+      maxlength    %Number.datatype;        #IMPLIED
+      src          %URI.datatype;           #IMPLIED
+      alt          %Text.datatype;          #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+      accept       %ContentTypes.datatype;  #IMPLIED
+>
+<!-- end of input.attlist -->]]>
+
+<!-- select: Option Selector ........................... -->
+
+<!ENTITY % select.element  "INCLUDE" >
+<![%select.element;[
+<!ENTITY % select.content
+     "( %optgroup.qname; | %option.qname; )+"
+>
+<!ELEMENT %select.qname;  %select.content; >
+<!-- end of select.element -->]]>
+
+<!ENTITY % select.attlist  "INCLUDE" >
+<![%select.attlist;[
+<!ATTLIST %select.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      size         %Number.datatype;        #IMPLIED
+      multiple     ( multiple )             #IMPLIED
+      disabled     ( disabled )             #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+>
+<!-- end of select.attlist -->]]>
+
+<!-- optgroup: Option Group ............................ -->
+
+<!ENTITY % optgroup.element  "INCLUDE" >
+<![%optgroup.element;[
+<!ENTITY % optgroup.content  "( %option.qname; )+" >
+<!ELEMENT %optgroup.qname;  %optgroup.content; >
+<!-- end of optgroup.element -->]]>
+
+<!ENTITY % optgroup.attlist  "INCLUDE" >
+<![%optgroup.attlist;[
+<!ATTLIST %optgroup.qname;
+      %Common.attrib;
+      disabled     ( disabled )             #IMPLIED
+      label        %Text.datatype;          #REQUIRED
+>
+<!-- end of optgroup.attlist -->]]>
+
+<!-- option: Selectable Choice ......................... -->
+
+<!ENTITY % option.element  "INCLUDE" >
+<![%option.element;[
+<!ENTITY % option.content  "( #PCDATA )" >
+<!ELEMENT %option.qname;  %option.content; >
+<!-- end of option.element -->]]>
+
+<!ENTITY % option.attlist  "INCLUDE" >
+<![%option.attlist;[
+<!ATTLIST %option.qname;
+      %Common.attrib;
+      selected     ( selected )             #IMPLIED
+      disabled     ( disabled )             #IMPLIED
+      label        %Text.datatype;          #IMPLIED
+      value        CDATA                    #IMPLIED
+>
+<!-- end of option.attlist -->]]>
+
+<!-- textarea: Multi-Line Text Field ................... -->
+
+<!ENTITY % textarea.element  "INCLUDE" >
+<![%textarea.element;[
+<!ENTITY % textarea.content  "( #PCDATA )" >
+<!ELEMENT %textarea.qname;  %textarea.content; >
+<!-- end of textarea.element -->]]>
+
+<!ENTITY % textarea.attlist  "INCLUDE" >
+<![%textarea.attlist;[
+<!ATTLIST %textarea.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      rows         %Number.datatype;        #REQUIRED
+      cols         %Number.datatype;        #REQUIRED
+      disabled     ( disabled )             #IMPLIED
+      readonly     ( readonly )             #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of textarea.attlist -->]]>
+
+<!-- fieldset: Form Control Group ...................... -->
+
+<!-- #PCDATA is to solve the mixed content problem,
+     per specification only whitespace is allowed
+-->
+
+<!ENTITY % fieldset.element  "INCLUDE" >
+<![%fieldset.element;[
+<!ENTITY % fieldset.content
+     "( #PCDATA | %legend.qname; | %Flow.mix; )*"
+>
+<!ELEMENT %fieldset.qname;  %fieldset.content; >
+<!-- end of fieldset.element -->]]>
+
+<!ENTITY % fieldset.attlist  "INCLUDE" >
+<![%fieldset.attlist;[
+<!ATTLIST %fieldset.qname;
+      %Common.attrib;
+>
+<!-- end of fieldset.attlist -->]]>
+
+<!-- legend: Fieldset Legend ........................... -->
+
+<!ENTITY % legend.element  "INCLUDE" >
+<![%legend.element;[
+<!ENTITY % legend.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %legend.qname;  %legend.content; >
+<!-- end of legend.element -->]]>
+
+<!ENTITY % legend.attlist  "INCLUDE" >
+<![%legend.attlist;[
+<!ATTLIST %legend.qname;
+      %Common.attrib;
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of legend.attlist -->]]>
+
+<!-- button: Push Button ............................... -->
+
+<!ENTITY % button.element  "INCLUDE" >
+<![%button.element;[
+<!ENTITY % button.content
+     "( #PCDATA
+      | %BlkNoForm.mix;
+      | %InlStruct.class;
+      %InlPhras.class;
+      %InlPres.class;
+      %I18n.class;
+      %InlSpecial.class;
+      %Inline.extra; )*"
+>
+<!ELEMENT %button.qname;  %button.content; >
+<!-- end of button.element -->]]>
+
+<!ENTITY % button.attlist  "INCLUDE" >
+<![%button.attlist;[
+<!ATTLIST %button.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      value        CDATA                    #IMPLIED
+      type         ( button | submit | reset ) 'submit'
+      disabled     ( disabled )             #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of button.attlist -->]]>
+
+<!-- end of xhtml-form-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-framework-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-framework-1.mod
new file mode 100644
index 0000000..7d9d972
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-framework-1.mod
@@ -0,0 +1,97 @@
+<!-- ...................................................................... -->
+<!-- XHTML Modular Framework Module  ...................................... -->
+<!-- file: xhtml-framework-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-framework-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-framework-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Modular Framework
+
+     This required module instantiates the modules needed
+     to support the XHTML modularization model, including:
+
+        +  datatypes
+        +  namespace-qualified names
+        +  common attributes
+        +  document model
+        +  character entities
+
+     The Intrinsic Events module is ignored by default but
+     occurs in this module because it must be instantiated
+     prior to Attributes but after Datatypes.
+-->
+
+<!ENTITY % xhtml-arch.module "IGNORE" >
+<![%xhtml-arch.module;[
+<!ENTITY % xhtml-arch.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Base Architecture 1.0//EN"
+            "xhtml-arch-1.mod" >
+%xhtml-arch.mod;]]>
+
+<!ENTITY % xhtml-notations.module "IGNORE" >
+<![%xhtml-notations.module;[
+<!ENTITY % xhtml-notations.mod
+     PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN"
+            "xhtml-notations-1.mod" >
+%xhtml-notations.mod;]]>
+
+<!ENTITY % xhtml-datatypes.module "INCLUDE" >
+<![%xhtml-datatypes.module;[
+<!ENTITY % xhtml-datatypes.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
+            "xhtml-datatypes-1.mod" >
+%xhtml-datatypes.mod;]]>
+
+<!-- placeholder for XLink support module -->
+<!ENTITY % xhtml-xlink.mod "" >
+%xhtml-xlink.mod;
+
+<!ENTITY % xhtml-qname.module "INCLUDE" >
+<![%xhtml-qname.module;[
+<!ENTITY % xhtml-qname.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
+            "xhtml-qname-1.mod" >
+%xhtml-qname.mod;]]>
+
+<!ENTITY % xhtml-events.module "IGNORE" >
+<![%xhtml-events.module;[
+<!ENTITY % xhtml-events.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN"
+            "xhtml-events-1.mod" >
+%xhtml-events.mod;]]>
+
+<!ENTITY % xhtml-attribs.module "INCLUDE" >
+<![%xhtml-attribs.module;[
+<!ENTITY % xhtml-attribs.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
+            "xhtml-attribs-1.mod" >
+%xhtml-attribs.mod;]]>
+
+<!-- placeholder for content model redeclarations -->
+<!ENTITY % xhtml-model.redecl "" >
+%xhtml-model.redecl;
+
+<!ENTITY % xhtml-model.module "INCLUDE" >
+<![%xhtml-model.module;[
+<!-- instantiate the Document Model module declared in the DTD driver
+-->
+%xhtml-model.mod;]]>
+
+<!ENTITY % xhtml-charent.module "INCLUDE" >
+<![%xhtml-charent.module;[
+<!ENTITY % xhtml-charent.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
+            "xhtml-charent-1.mod" >
+%xhtml-charent.mod;]]>
+
+<!-- end of xhtml-framework-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-hypertext-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-hypertext-1.mod
new file mode 100644
index 0000000..7a7d8ca
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-hypertext-1.mod
@@ -0,0 +1,54 @@
+<!-- ...................................................................... -->
+<!-- XHTML Hypertext Module  .............................................. -->
+<!-- file: xhtml-hypertext-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-hypertext-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-hypertext-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Hypertext
+
+        a
+
+     This module declares the anchor ('a') element type, which
+     defines the source of a hypertext link. The destination
+     (or link 'target') is identified via its 'id' attribute
+     rather than the 'name' attribute as was used in HTML.
+-->
+
+<!-- ............  Anchor Element  ............ -->
+
+<!ENTITY % a.element  "INCLUDE" >
+<![%a.element;[
+<!ENTITY % a.content
+     "( #PCDATA | %InlNoAnchor.mix; )*"
+>
+<!ENTITY % a.qname  "a" >
+<!ELEMENT %a.qname;  %a.content; >
+<!-- end of a.element -->]]>
+
+<!ENTITY % a.attlist  "INCLUDE" >
+<![%a.attlist;[
+<!ATTLIST %a.qname;
+      %Common.attrib;
+      href         %URI.datatype;           #IMPLIED
+      charset      %Charset.datatype;       #IMPLIED
+      type         %ContentType.datatype;   #IMPLIED
+      hreflang     %LanguageCode.datatype;  #IMPLIED
+      rel          %LinkTypes.datatype;     #IMPLIED
+      rev          %LinkTypes.datatype;     #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+>
+<!-- end of a.attlist -->]]>
+
+<!-- end of xhtml-hypertext-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-image-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-image-1.mod
new file mode 100644
index 0000000..01b6f2c
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-image-1.mod
@@ -0,0 +1,50 @@
+<!-- ...................................................................... -->
+<!-- XHTML Images Module  ................................................. -->
+<!-- file: xhtml-image-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Rovision: $Id: xhtml-image-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-image-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Images
+
+        img
+
+     This module provides markup to support basic image embedding.
+-->
+
+<!-- To avoid problems with text-only UAs as well as to make
+     image content understandable and navigable to users of
+     non-visual UAs, you need to provide a description with
+     the 'alt' attribute, and avoid server-side image maps.
+-->
+
+<!ENTITY % img.element  "INCLUDE" >
+<![%img.element;[
+<!ENTITY % img.content  "EMPTY" >
+<!ENTITY % img.qname  "img" >
+<!ELEMENT %img.qname;  %img.content; >
+<!-- end of img.element -->]]>
+
+<!ENTITY % img.attlist  "INCLUDE" >
+<![%img.attlist;[
+<!ATTLIST %img.qname;
+      %Common.attrib;
+      src          %URI.datatype;           #REQUIRED
+      alt          %Text.datatype;          #REQUIRED
+      longdesc     %URI.datatype;           #IMPLIED
+      height       %Length.datatype;        #IMPLIED
+      width        %Length.datatype;        #IMPLIED
+>
+<!-- end of img.attlist -->]]>
+
+<!-- end of xhtml-image-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-inlphras-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-inlphras-1.mod
new file mode 100644
index 0000000..d749b2e
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-inlphras-1.mod
@@ -0,0 +1,203 @@
+<!-- ...................................................................... -->
+<!-- XHTML Inline Phrasal Module  ......................................... -->
+<!-- file: xhtml-inlphras-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-inlphras-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlphras-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Inline Phrasal
+
+        abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var
+
+     This module declares the elements and their attributes used to
+     support inline-level phrasal markup.
+-->
+
+<!ENTITY % abbr.element  "INCLUDE" >
+<![%abbr.element;[
+<!ENTITY % abbr.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % abbr.qname  "abbr" >
+<!ELEMENT %abbr.qname;  %abbr.content; >
+<!-- end of abbr.element -->]]>
+
+<!ENTITY % abbr.attlist  "INCLUDE" >
+<![%abbr.attlist;[
+<!ATTLIST %abbr.qname;
+      %Common.attrib;
+>
+<!-- end of abbr.attlist -->]]>
+
+<!ENTITY % acronym.element  "INCLUDE" >
+<![%acronym.element;[
+<!ENTITY % acronym.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % acronym.qname  "acronym" >
+<!ELEMENT %acronym.qname;  %acronym.content; >
+<!-- end of acronym.element -->]]>
+
+<!ENTITY % acronym.attlist  "INCLUDE" >
+<![%acronym.attlist;[
+<!ATTLIST %acronym.qname;
+      %Common.attrib;
+>
+<!-- end of acronym.attlist -->]]>
+
+<!ENTITY % cite.element  "INCLUDE" >
+<![%cite.element;[
+<!ENTITY % cite.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % cite.qname  "cite" >
+<!ELEMENT %cite.qname;  %cite.content; >
+<!-- end of cite.element -->]]>
+
+<!ENTITY % cite.attlist  "INCLUDE" >
+<![%cite.attlist;[
+<!ATTLIST %cite.qname;
+      %Common.attrib;
+>
+<!-- end of cite.attlist -->]]>
+
+<!ENTITY % code.element  "INCLUDE" >
+<![%code.element;[
+<!ENTITY % code.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % code.qname  "code" >
+<!ELEMENT %code.qname;  %code.content; >
+<!-- end of code.element -->]]>
+
+<!ENTITY % code.attlist  "INCLUDE" >
+<![%code.attlist;[
+<!ATTLIST %code.qname;
+      %Common.attrib;
+>
+<!-- end of code.attlist -->]]>
+
+<!ENTITY % dfn.element  "INCLUDE" >
+<![%dfn.element;[
+<!ENTITY % dfn.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % dfn.qname  "dfn" >
+<!ELEMENT %dfn.qname;  %dfn.content; >
+<!-- end of dfn.element -->]]>
+
+<!ENTITY % dfn.attlist  "INCLUDE" >
+<![%dfn.attlist;[
+<!ATTLIST %dfn.qname;
+      %Common.attrib;
+>
+<!-- end of dfn.attlist -->]]>
+
+<!ENTITY % em.element  "INCLUDE" >
+<![%em.element;[
+<!ENTITY % em.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % em.qname  "em" >
+<!ELEMENT %em.qname;  %em.content; >
+<!-- end of em.element -->]]>
+
+<!ENTITY % em.attlist  "INCLUDE" >
+<![%em.attlist;[
+<!ATTLIST %em.qname;
+      %Common.attrib;
+>
+<!-- end of em.attlist -->]]>
+
+<!ENTITY % kbd.element  "INCLUDE" >
+<![%kbd.element;[
+<!ENTITY % kbd.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % kbd.qname  "kbd" >
+<!ELEMENT %kbd.qname;  %kbd.content; >
+<!-- end of kbd.element -->]]>
+
+<!ENTITY % kbd.attlist  "INCLUDE" >
+<![%kbd.attlist;[
+<!ATTLIST %kbd.qname;
+      %Common.attrib;
+>
+<!-- end of kbd.attlist -->]]>
+
+<!ENTITY % q.element  "INCLUDE" >
+<![%q.element;[
+<!ENTITY % q.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % q.qname  "q" >
+<!ELEMENT %q.qname;  %q.content; >
+<!-- end of q.element -->]]>
+
+<!ENTITY % q.attlist  "INCLUDE" >
+<![%q.attlist;[
+<!ATTLIST %q.qname;
+      %Common.attrib;
+      cite         %URI.datatype;           #IMPLIED
+>
+<!-- end of q.attlist -->]]>
+
+<!ENTITY % samp.element  "INCLUDE" >
+<![%samp.element;[
+<!ENTITY % samp.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % samp.qname  "samp" >
+<!ELEMENT %samp.qname;  %samp.content; >
+<!-- end of samp.element -->]]>
+
+<!ENTITY % samp.attlist  "INCLUDE" >
+<![%samp.attlist;[
+<!ATTLIST %samp.qname;
+      %Common.attrib;
+>
+<!-- end of samp.attlist -->]]>
+
+<!ENTITY % strong.element  "INCLUDE" >
+<![%strong.element;[
+<!ENTITY % strong.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % strong.qname  "strong" >
+<!ELEMENT %strong.qname;  %strong.content; >
+<!-- end of strong.element -->]]>
+
+<!ENTITY % strong.attlist  "INCLUDE" >
+<![%strong.attlist;[
+<!ATTLIST %strong.qname;
+      %Common.attrib;
+>
+<!-- end of strong.attlist -->]]>
+
+<!ENTITY % var.element  "INCLUDE" >
+<![%var.element;[
+<!ENTITY % var.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % var.qname  "var" >
+<!ELEMENT %var.qname;  %var.content; >
+<!-- end of var.element -->]]>
+
+<!ENTITY % var.attlist  "INCLUDE" >
+<![%var.attlist;[
+<!ATTLIST %var.qname;
+      %Common.attrib;
+>
+<!-- end of var.attlist -->]]>
+
+<!-- end of xhtml-inlphras-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-inlpres-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-inlpres-1.mod
new file mode 100644
index 0000000..8717d54
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-inlpres-1.mod
@@ -0,0 +1,138 @@
+<!-- ...................................................................... -->
+<!-- XHTML Inline Presentation Module  .................................... -->
+<!-- file: xhtml-inlpres-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-inlpres-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlpres-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Inline Presentational Elements
+
+        b, big, i, small, sub, sup, tt
+
+     This module declares the elements and their attributes used to
+     support inline-level presentational markup.
+-->
+
+<!ENTITY % b.element  "INCLUDE" >
+<![%b.element;[
+<!ENTITY % b.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % b.qname  "b" >
+<!ELEMENT %b.qname;  %b.content; >
+<!-- end of b.element -->]]>
+
+<!ENTITY % b.attlist  "INCLUDE" >
+<![%b.attlist;[
+<!ATTLIST %b.qname;
+      %Common.attrib;
+>
+<!-- end of b.attlist -->]]>
+
+<!ENTITY % big.element  "INCLUDE" >
+<![%big.element;[
+<!ENTITY % big.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % big.qname  "big" >
+<!ELEMENT %big.qname;  %big.content; >
+<!-- end of big.element -->]]>
+
+<!ENTITY % big.attlist  "INCLUDE" >
+<![%big.attlist;[
+<!ATTLIST %big.qname;
+      %Common.attrib;
+>
+<!-- end of big.attlist -->]]>
+
+<!ENTITY % i.element  "INCLUDE" >
+<![%i.element;[
+<!ENTITY % i.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % i.qname  "i" >
+<!ELEMENT %i.qname;  %i.content; >
+<!-- end of i.element -->]]>
+
+<!ENTITY % i.attlist  "INCLUDE" >
+<![%i.attlist;[
+<!ATTLIST %i.qname;
+      %Common.attrib;
+>
+<!-- end of i.attlist -->]]>
+
+<!ENTITY % small.element  "INCLUDE" >
+<![%small.element;[
+<!ENTITY % small.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % small.qname  "small" >
+<!ELEMENT %small.qname;  %small.content; >
+<!-- end of small.element -->]]>
+
+<!ENTITY % small.attlist  "INCLUDE" >
+<![%small.attlist;[
+<!ATTLIST %small.qname;
+      %Common.attrib;
+>
+<!-- end of small.attlist -->]]>
+
+<!ENTITY % sub.element  "INCLUDE" >
+<![%sub.element;[
+<!ENTITY % sub.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % sub.qname  "sub" >
+<!ELEMENT %sub.qname;  %sub.content; >
+<!-- end of sub.element -->]]>
+
+<!ENTITY % sub.attlist  "INCLUDE" >
+<![%sub.attlist;[
+<!ATTLIST %sub.qname;
+      %Common.attrib;
+>
+<!-- end of sub.attlist -->]]>
+
+<!ENTITY % sup.element  "INCLUDE" >
+<![%sup.element;[
+<!ENTITY % sup.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % sup.qname  "sup" >
+<!ELEMENT %sup.qname;  %sup.content; >
+<!-- end of sup.element -->]]>
+
+<!ENTITY % sup.attlist  "INCLUDE" >
+<![%sup.attlist;[
+<!ATTLIST %sup.qname;
+      %Common.attrib;
+>
+<!-- end of sup.attlist -->]]>
+
+<!ENTITY % tt.element  "INCLUDE" >
+<![%tt.element;[
+<!ENTITY % tt.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % tt.qname  "tt" >
+<!ELEMENT %tt.qname;  %tt.content; >
+<!-- end of tt.element -->]]>
+
+<!ENTITY % tt.attlist  "INCLUDE" >
+<![%tt.attlist;[
+<!ATTLIST %tt.qname;
+      %Common.attrib;
+>
+<!-- end of tt.attlist -->]]>
+
+<!-- end of xhtml-inlpres-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-inlstruct-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-inlstruct-1.mod
new file mode 100644
index 0000000..3d43d28
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-inlstruct-1.mod
@@ -0,0 +1,62 @@
+<!-- ...................................................................... -->
+<!-- XHTML Inline Structural Module  ...................................... -->
+<!-- file: xhtml-inlstruct-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-inlstruct-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlstruct-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Inline Structural
+
+        br, span
+
+     This module declares the elements and their attributes
+     used to support inline-level structural markup.
+-->
+
+<!-- br: forced line break ............................. -->
+
+<!ENTITY % br.element  "INCLUDE" >
+<![%br.element;[
+
+<!ENTITY % br.content  "EMPTY" >
+<!ENTITY % br.qname  "br" >
+<!ELEMENT %br.qname;  %br.content; >
+
+<!-- end of br.element -->]]>
+
+<!ENTITY % br.attlist  "INCLUDE" >
+<![%br.attlist;[
+<!ATTLIST %br.qname;
+      %Core.attrib;
+>
+<!-- end of br.attlist -->]]>
+
+<!-- span: generic inline container .................... -->
+
+<!ENTITY % span.element  "INCLUDE" >
+<![%span.element;[
+<!ENTITY % span.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % span.qname  "span" >
+<!ELEMENT %span.qname;  %span.content; >
+<!-- end of span.element -->]]>
+
+<!ENTITY % span.attlist  "INCLUDE" >
+<![%span.attlist;[
+<!ATTLIST %span.qname;
+      %Common.attrib;
+>
+<!-- end of span.attlist -->]]>
+
+<!-- end of xhtml-inlstruct-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-inlstyle-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-inlstyle-1.mod
new file mode 100644
index 0000000..305680f
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-inlstyle-1.mod
@@ -0,0 +1,34 @@
+<!-- ...................................................................... -->
+<!-- XHTML Inline Style Module  ........................................... -->
+<!-- file: xhtml-inlstyle-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-inlstyle-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Inline Style 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlstyle-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Inline Style
+
+     This module declares the 'style' attribute, used to support inline
+     style markup. This module must be instantiated prior to the XHTML
+     Common Attributes module in order to be included in %Core.attrib;.
+-->
+
+<!ENTITY % style.attrib
+     "style        CDATA                    #IMPLIED"
+>
+
+
+<!ENTITY % Core.extra.attrib
+     "%style.attrib;"
+>
+
+<!-- end of xhtml-inlstyle-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-lat1.ent b/xml/impl/resources/standardSchemas/xhtml11/xhtml-lat1.ent
new file mode 100644
index 0000000..929aa3d
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-lat1.ent
@@ -0,0 +1,121 @@
+<!-- ...................................................................... -->
+<!-- XML-compatible ISO Latin 1 Character Entity Set for XHTML ............ -->
+<!-- file: xhtml-lat1.ent
+
+     Typical invocation:
+
+       <!ENTITY % xhtml-lat1
+           PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+                  "xhtml-lat1.ent" >
+       %xhtml-lat1;
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-lat1.ent"
+
+     Revision:  $Id: xhtml-lat1.ent,v 4.1 2001/04/10 09:34:14 altheim Exp $ SMI
+
+     Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with conforming
+     SGML systems and applications as defined in ISO 8879, provided
+     this notice is included in all copies.
+-->
+
+<!ENTITY nbsp   "&#160;" ><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
+<!ENTITY iexcl  "&#161;" ><!-- inverted exclamation mark, U+00A1 ISOnum -->
+<!ENTITY cent   "&#162;" ><!-- cent sign, U+00A2 ISOnum -->
+<!ENTITY pound  "&#163;" ><!-- pound sign, U+00A3 ISOnum -->
+<!ENTITY curren "&#164;" ><!-- currency sign, U+00A4 ISOnum -->
+<!ENTITY yen    "&#165;" ><!-- yen sign = yuan sign, U+00A5 ISOnum -->
+<!ENTITY brvbar "&#166;" ><!-- broken bar = broken vertical bar, U+00A6 ISOnum -->
+<!ENTITY sect   "&#167;" ><!-- section sign, U+00A7 ISOnum -->
+<!ENTITY uml    "&#168;" ><!-- diaeresis = spacing diaeresis, U+00A8 ISOdia -->
+<!ENTITY copy   "&#169;" ><!-- copyright sign, U+00A9 ISOnum -->
+<!ENTITY ordf   "&#170;" ><!-- feminine ordinal indicator, U+00AA ISOnum -->
+<!ENTITY laquo  "&#171;" ><!-- left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum -->
+<!ENTITY not    "&#172;" ><!-- not sign, U+00AC ISOnum -->
+<!ENTITY shy    "&#173;" ><!-- soft hyphen = discretionary hyphen, U+00AD ISOnum -->
+<!ENTITY reg    "&#174;" ><!-- registered sign = registered trade mark sign, U+00AE ISOnum -->
+<!ENTITY macr   "&#175;" ><!-- macron = spacing macron = overline = APL overbar, U+00AF ISOdia -->
+<!ENTITY deg    "&#176;" ><!-- degree sign, U+00B0 ISOnum -->
+<!ENTITY plusmn "&#177;" ><!-- plus-minus sign = plus-or-minus sign, U+00B1 ISOnum -->
+<!ENTITY sup2   "&#178;" ><!-- superscript two = superscript digit two = squared, U+00B2 ISOnum -->
+<!ENTITY sup3   "&#179;" ><!-- superscript three = superscript digit three = cubed, U+00B3 ISOnum -->
+<!ENTITY acute  "&#180;" ><!-- acute accent = spacing acute, U+00B4 ISOdia -->
+<!ENTITY micro  "&#181;" ><!-- micro sign, U+00B5 ISOnum -->
+<!ENTITY para   "&#182;" ><!-- pilcrow sign = paragraph sign, U+00B6 ISOnum -->
+<!ENTITY middot "&#183;" ><!-- middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum -->
+<!ENTITY cedil  "&#184;" ><!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
+<!ENTITY sup1   "&#185;" ><!-- superscript one = superscript digit one, U+00B9 ISOnum -->
+<!ENTITY ordm   "&#186;" ><!-- masculine ordinal indicator, U+00BA ISOnum -->
+<!ENTITY raquo  "&#187;" ><!-- right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum -->
+<!ENTITY frac14 "&#188;" ><!-- vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum -->
+<!ENTITY frac12 "&#189;" ><!-- vulgar fraction one half = fraction one half, U+00BD ISOnum -->
+<!ENTITY frac34 "&#190;" ><!-- vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum -->
+<!ENTITY iquest "&#191;" ><!-- inverted question mark = turned question mark, U+00BF ISOnum -->
+<!ENTITY Agrave "&#192;" ><!-- latin capital A with grave = latin capital A grave, U+00C0 ISOlat1 -->
+<!ENTITY Aacute "&#193;" ><!-- latin capital A with acute, U+00C1 ISOlat1 -->
+<!ENTITY Acirc  "&#194;" ><!-- latin capital A with circumflex, U+00C2 ISOlat1 -->
+<!ENTITY Atilde "&#195;" ><!-- latin capital A with tilde, U+00C3 ISOlat1 -->
+<!ENTITY Auml   "&#196;" ><!-- latin capital A with diaeresis, U+00C4 ISOlat1 -->
+<!ENTITY Aring  "&#197;" ><!-- latin capital A with ring above = latin capital A ring, U+00C5 ISOlat1 -->
+<!ENTITY AElig  "&#198;" ><!-- latin capital AE = latin capital ligature AE, U+00C6 ISOlat1 -->
+<!ENTITY Ccedil "&#199;" ><!-- latin capital C with cedilla, U+00C7 ISOlat1 -->
+<!ENTITY Egrave "&#200;" ><!-- latin capital E with grave, U+00C8 ISOlat1 -->
+<!ENTITY Eacute "&#201;" ><!-- latin capital E with acute, U+00C9 ISOlat1 -->
+<!ENTITY Ecirc  "&#202;" ><!-- latin capital E with circumflex, U+00CA ISOlat1 -->
+<!ENTITY Euml   "&#203;" ><!-- latin capital E with diaeresis, U+00CB ISOlat1 -->
+<!ENTITY Igrave "&#204;" ><!-- latin capital I with grave, U+00CC ISOlat1 -->
+<!ENTITY Iacute "&#205;" ><!-- latin capital I with acute, U+00CD ISOlat1 -->
+<!ENTITY Icirc  "&#206;" ><!-- latin capital I with circumflex, U+00CE ISOlat1 -->
+<!ENTITY Iuml   "&#207;" ><!-- latin capital I with diaeresis, U+00CF ISOlat1 -->
+<!ENTITY ETH    "&#208;" ><!-- latin capital ETH, U+00D0 ISOlat1 -->
+<!ENTITY Ntilde "&#209;" ><!-- latin capital N with tilde, U+00D1 ISOlat1 -->
+<!ENTITY Ograve "&#210;" ><!-- latin capital O with grave, U+00D2 ISOlat1 -->
+<!ENTITY Oacute "&#211;" ><!-- latin capital O with acute, U+00D3 ISOlat1 -->
+<!ENTITY Ocirc  "&#212;" ><!-- latin capital O with circumflex, U+00D4 ISOlat1 -->
+<!ENTITY Otilde "&#213;" ><!-- latin capital O with tilde, U+00D5 ISOlat1 -->
+<!ENTITY Ouml   "&#214;" ><!-- latin capital O with diaeresis, U+00D6 ISOlat1 -->
+<!ENTITY times  "&#215;" ><!-- multiplication sign, U+00D7 ISOnum -->
+<!ENTITY Oslash "&#216;" ><!-- latin capital O with stroke = latin capital O slash, U+00D8 ISOlat1 -->
+<!ENTITY Ugrave "&#217;" ><!-- latin capital U with grave, U+00D9 ISOlat1 -->
+<!ENTITY Uacute "&#218;" ><!-- latin capital U with acute, U+00DA ISOlat1 -->
+<!ENTITY Ucirc  "&#219;" ><!-- latin capital U with circumflex, U+00DB ISOlat1 -->
+<!ENTITY Uuml   "&#220;" ><!-- latin capital U with diaeresis, U+00DC ISOlat1 -->
+<!ENTITY Yacute "&#221;" ><!-- latin capital Y with acute, U+00DD ISOlat1 -->
+<!ENTITY THORN  "&#222;" ><!-- latin capital THORN, U+00DE ISOlat1 -->
+<!ENTITY szlig  "&#223;" ><!-- latin small sharp s = ess-zed, U+00DF ISOlat1 -->
+<!ENTITY agrave "&#224;" ><!-- latin small a with grave = latin small a grave, U+00E0 ISOlat1 -->
+<!ENTITY aacute "&#225;" ><!-- latin small a with acute, U+00E1 ISOlat1 -->
+<!ENTITY acirc  "&#226;" ><!-- latin small a with circumflex, U+00E2 ISOlat1 -->
+<!ENTITY atilde "&#227;" ><!-- latin small a with tilde, U+00E3 ISOlat1 -->
+<!ENTITY auml   "&#228;" ><!-- latin small a with diaeresis, U+00E4 ISOlat1 -->
+<!ENTITY aring  "&#229;" ><!-- latin small a with ring above = latin small a ring, U+00E5 ISOlat1 -->
+<!ENTITY aelig  "&#230;" ><!-- latin small ae = latin small ligature ae, U+00E6 ISOlat1 -->
+<!ENTITY ccedil "&#231;" ><!-- latin small c with cedilla, U+00E7 ISOlat1 -->
+<!ENTITY egrave "&#232;" ><!-- latin small e with grave, U+00E8 ISOlat1 -->
+<!ENTITY eacute "&#233;" ><!-- latin small e with acute, U+00E9 ISOlat1 -->
+<!ENTITY ecirc  "&#234;" ><!-- latin small e with circumflex, U+00EA ISOlat1 -->
+<!ENTITY euml   "&#235;" ><!-- latin small e with diaeresis, U+00EB ISOlat1 -->
+<!ENTITY igrave "&#236;" ><!-- latin small i with grave, U+00EC ISOlat1 -->
+<!ENTITY iacute "&#237;" ><!-- latin small i with acute, U+00ED ISOlat1 -->
+<!ENTITY icirc  "&#238;" ><!-- latin small i with circumflex, U+00EE ISOlat1 -->
+<!ENTITY iuml   "&#239;" ><!-- latin small i with diaeresis, U+00EF ISOlat1 -->
+<!ENTITY eth    "&#240;" ><!-- latin small eth, U+00F0 ISOlat1 -->
+<!ENTITY ntilde "&#241;" ><!-- latin small n with tilde, U+00F1 ISOlat1 -->
+<!ENTITY ograve "&#242;" ><!-- latin small o with grave, U+00F2 ISOlat1 -->
+<!ENTITY oacute "&#243;" ><!-- latin small o with acute, U+00F3 ISOlat1 -->
+<!ENTITY ocirc  "&#244;" ><!-- latin small o with circumflex, U+00F4 ISOlat1 -->
+<!ENTITY otilde "&#245;" ><!-- latin small o with tilde, U+00F5 ISOlat1 -->
+<!ENTITY ouml   "&#246;" ><!-- latin small o with diaeresis, U+00F6 ISOlat1 -->
+<!ENTITY divide "&#247;" ><!-- division sign, U+00F7 ISOnum -->
+<!ENTITY oslash "&#248;" ><!-- latin small o with stroke, = latin small o slash, U+00F8 ISOlat1 -->
+<!ENTITY ugrave "&#249;" ><!-- latin small u with grave, U+00F9 ISOlat1 -->
+<!ENTITY uacute "&#250;" ><!-- latin small u with acute, U+00FA ISOlat1 -->
+<!ENTITY ucirc  "&#251;" ><!-- latin small u with circumflex, U+00FB ISOlat1 -->
+<!ENTITY uuml   "&#252;" ><!-- latin small u with diaeresis, U+00FC ISOlat1 -->
+<!ENTITY yacute "&#253;" ><!-- latin small y with acute, U+00FD ISOlat1 -->
+<!ENTITY thorn  "&#254;" ><!-- latin small thorn with, U+00FE ISOlat1 -->
+<!ENTITY yuml   "&#255;" ><!-- latin small y with diaeresis, U+00FF ISOlat1 -->
+<!-- end of xhtml-lat1.ent -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-link-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-link-1.mod
new file mode 100644
index 0000000..2b4f92c
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-link-1.mod
@@ -0,0 +1,59 @@
+<!-- ...................................................................... -->
+<!-- XHTML Link Element Module  ........................................... -->
+<!-- file: xhtml-link-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-link-1.mod,v 4.1 2001/04/05 06:57:40 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-link-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Link element
+
+        link
+
+     This module declares the link element type and its attributes,
+     which could (in principle) be used to define document-level links
+     to external resources such as:
+
+     a) for document specific toolbars/menus, e.g. start, contents,
+        previous, next, index, end, help
+     b) to link to a separate style sheet (rel="stylesheet")
+     c) to make a link to a script (rel="script")
+     d) by style sheets to control how collections of html nodes are
+        rendered into printed documents
+     e) to make a link to a printable version of this document
+        e.g. a postscript or pdf version (rel="alternate" media="print")
+-->
+
+<!-- link: Media-Independent Link ...................... -->
+
+<!ENTITY % link.element  "INCLUDE" >
+<![%link.element;[
+<!ENTITY % link.content  "EMPTY" >
+<!ENTITY % link.qname  "link" >
+<!ELEMENT %link.qname;  %link.content; >
+<!-- end of link.element -->]]>
+
+<!ENTITY % link.attlist  "INCLUDE" >
+<![%link.attlist;[
+<!ATTLIST %link.qname;
+      %Common.attrib;
+      charset      %Charset.datatype;       #IMPLIED
+      href         %URI.datatype;           #IMPLIED
+      hreflang     %LanguageCode.datatype;  #IMPLIED
+      type         %ContentType.datatype;   #IMPLIED
+      rel          %LinkTypes.datatype;     #IMPLIED
+      rev          %LinkTypes.datatype;     #IMPLIED
+      media        %MediaDesc.datatype;     #IMPLIED
+>
+<!-- end of link.attlist -->]]>
+
+<!-- end of xhtml-link-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-list-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-list-1.mod
new file mode 100644
index 0000000..6c85f20
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-list-1.mod
@@ -0,0 +1,129 @@
+<!-- ...................................................................... -->
+<!-- XHTML Lists Module  .................................................. -->
+<!-- file: xhtml-list-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-list-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-list-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Lists
+
+        dl, dt, dd, ol, ul, li
+
+     This module declares the list-oriented element types
+     and their attributes.
+-->
+
+<!ENTITY % dl.qname  "dl" >
+<!ENTITY % dt.qname  "dt" >
+<!ENTITY % dd.qname  "dd" >
+<!ENTITY % ol.qname  "ol" >
+<!ENTITY % ul.qname  "ul" >
+<!ENTITY % li.qname  "li" >
+
+<!-- dl: Definition List ............................... -->
+
+<!ENTITY % dl.element  "INCLUDE" >
+<![%dl.element;[
+<!ENTITY % dl.content  "( %dt.qname; | %dd.qname; )+" >
+<!ELEMENT %dl.qname;  %dl.content; >
+<!-- end of dl.element -->]]>
+
+<!ENTITY % dl.attlist  "INCLUDE" >
+<![%dl.attlist;[
+<!ATTLIST %dl.qname;
+      %Common.attrib;
+>
+<!-- end of dl.attlist -->]]>
+
+<!-- dt: Definition Term ............................... -->
+
+<!ENTITY % dt.element  "INCLUDE" >
+<![%dt.element;[
+<!ENTITY % dt.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %dt.qname;  %dt.content; >
+<!-- end of dt.element -->]]>
+
+<!ENTITY % dt.attlist  "INCLUDE" >
+<![%dt.attlist;[
+<!ATTLIST %dt.qname;
+      %Common.attrib;
+>
+<!-- end of dt.attlist -->]]>
+
+<!-- dd: Definition Description ........................ -->
+
+<!ENTITY % dd.element  "INCLUDE" >
+<![%dd.element;[
+<!ENTITY % dd.content
+     "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %dd.qname;  %dd.content; >
+<!-- end of dd.element -->]]>
+
+<!ENTITY % dd.attlist  "INCLUDE" >
+<![%dd.attlist;[
+<!ATTLIST %dd.qname;
+      %Common.attrib;
+>
+<!-- end of dd.attlist -->]]>
+
+<!-- ol: Ordered List (numbered styles) ................ -->
+
+<!ENTITY % ol.element  "INCLUDE" >
+<![%ol.element;[
+<!ENTITY % ol.content  "( %li.qname; )+" >
+<!ELEMENT %ol.qname;  %ol.content; >
+<!-- end of ol.element -->]]>
+
+<!ENTITY % ol.attlist  "INCLUDE" >
+<![%ol.attlist;[
+<!ATTLIST %ol.qname;
+      %Common.attrib;
+>
+<!-- end of ol.attlist -->]]>
+
+<!-- ul: Unordered List (bullet styles) ................ -->
+
+<!ENTITY % ul.element  "INCLUDE" >
+<![%ul.element;[
+<!ENTITY % ul.content  "( %li.qname; )+" >
+<!ELEMENT %ul.qname;  %ul.content; >
+<!-- end of ul.element -->]]>
+
+<!ENTITY % ul.attlist  "INCLUDE" >
+<![%ul.attlist;[
+<!ATTLIST %ul.qname;
+      %Common.attrib;
+>
+<!-- end of ul.attlist -->]]>
+
+<!-- li: List Item ..................................... -->
+
+<!ENTITY % li.element  "INCLUDE" >
+<![%li.element;[
+<!ENTITY % li.content
+     "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %li.qname;  %li.content; >
+<!-- end of li.element -->]]>
+
+<!ENTITY % li.attlist  "INCLUDE" >
+<![%li.attlist;[
+<!ATTLIST %li.qname;
+      %Common.attrib;
+>
+<!-- end of li.attlist -->]]>
+
+<!-- end of xhtml-list-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-meta-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-meta-1.mod
new file mode 100644
index 0000000..24a0b22
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-meta-1.mod
@@ -0,0 +1,47 @@
+<!-- ...................................................................... -->
+<!-- XHTML Document Metainformation Module  ............................... -->
+<!-- file: xhtml-meta-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-meta-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-meta-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Meta Information
+
+        meta
+
+     This module declares the meta element type and its attributes,
+     used to provide declarative document metainformation.
+-->
+
+<!-- meta: Generic Metainformation ..................... -->
+
+<!ENTITY % meta.element  "INCLUDE" >
+<![%meta.element;[
+<!ENTITY % meta.content  "EMPTY" >
+<!ENTITY % meta.qname  "meta" >
+<!ELEMENT %meta.qname;  %meta.content; >
+<!-- end of meta.element -->]]>
+
+<!ENTITY % meta.attlist  "INCLUDE" >
+<![%meta.attlist;[
+<!ATTLIST %meta.qname;
+      %XHTML.xmlns.attrib;
+      %I18n.attrib;
+      http-equiv   NMTOKEN                  #IMPLIED
+      name         NMTOKEN                  #IMPLIED
+      content      CDATA                    #REQUIRED
+      scheme       CDATA                    #IMPLIED
+>
+<!-- end of meta.attlist -->]]>
+
+<!-- end of xhtml-meta-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-object-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-object-1.mod
new file mode 100644
index 0000000..0d14cc5
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-object-1.mod
@@ -0,0 +1,60 @@
+<!-- ...................................................................... -->
+<!-- XHTML Embedded Object Module  ........................................ -->
+<!-- file: xhtml-object-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-object-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-object-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Embedded Objects
+
+        object
+
+     This module declares the object element type and its attributes, used
+     to embed external objects as part of XHTML pages. In the document,
+     place param elements prior to other content within the object element.
+
+     Note that use of this module requires instantiation of the Param
+     Element Module.
+-->
+
+<!-- object: Generic Embedded Object ................... -->
+
+<!ENTITY % object.element  "INCLUDE" >
+<![%object.element;[
+<!ENTITY % object.content
+     "( #PCDATA | %Flow.mix; | %param.qname; )*"
+>
+<!ENTITY % object.qname  "object" >
+<!ELEMENT %object.qname;  %object.content; >
+<!-- end of object.element -->]]>
+
+<!ENTITY % object.attlist  "INCLUDE" >
+<![%object.attlist;[
+<!ATTLIST %object.qname;
+      %Common.attrib;
+      declare      ( declare )              #IMPLIED
+      classid      %URI.datatype;           #IMPLIED
+      codebase     %URI.datatype;           #IMPLIED
+      data         %URI.datatype;           #IMPLIED
+      type         %ContentType.datatype;   #IMPLIED
+      codetype     %ContentType.datatype;   #IMPLIED
+      archive      %URIs.datatype;          #IMPLIED
+      standby      %Text.datatype;          #IMPLIED
+      height       %Length.datatype;        #IMPLIED
+      width        %Length.datatype;        #IMPLIED
+      name         CDATA                    #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+>
+<!-- end of object.attlist -->]]>
+
+<!-- end of xhtml-object-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-param-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-param-1.mod
new file mode 100644
index 0000000..c101bed
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-param-1.mod
@@ -0,0 +1,48 @@
+<!-- ...................................................................... -->
+<!-- XHTML Param Element Module  ..................................... -->
+<!-- file: xhtml-param-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-param-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-param-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Parameters for Java Applets and Embedded Objects
+
+        param
+
+     This module provides declarations for the param element,
+     used to provide named property values for the applet
+     and object elements.
+-->
+
+<!-- param: Named Property Value ....................... -->
+
+<!ENTITY % param.element  "INCLUDE" >
+<![%param.element;[
+<!ENTITY % param.content  "EMPTY" >
+<!ENTITY % param.qname  "param" >
+<!ELEMENT %param.qname;  %param.content; >
+<!-- end of param.element -->]]>
+
+<!ENTITY % param.attlist  "INCLUDE" >
+<![%param.attlist;[
+<!ATTLIST %param.qname;
+      %XHTML.xmlns.attrib;
+      %id.attrib;
+      name         CDATA                    #REQUIRED
+      value        CDATA                    #IMPLIED
+      valuetype    ( data | ref | object )  'data'
+      type         %ContentType.datatype;   #IMPLIED
+>
+<!-- end of param.attlist -->]]>
+
+<!-- end of xhtml-param-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-pres-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-pres-1.mod
new file mode 100644
index 0000000..6a2f34de
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-pres-1.mod
@@ -0,0 +1,38 @@
+<!-- ...................................................................... -->
+<!-- XHTML Presentation Module ............................................ -->
+<!-- file: xhtml-pres-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-pres-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Presentation 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-pres-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Presentational Elements
+
+     This module defines elements and their attributes for
+     simple presentation-related markup.
+-->
+
+<!ENTITY % xhtml-inlpres.module "INCLUDE" >
+<![%xhtml-inlpres.module;[
+<!ENTITY % xhtml-inlpres.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
+            "xhtml-inlpres-1.mod" >
+%xhtml-inlpres.mod;]]>
+
+<!ENTITY % xhtml-blkpres.module "INCLUDE" >
+<![%xhtml-blkpres.module;[
+<!ENTITY % xhtml-blkpres.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
+            "xhtml-blkpres-1.mod" >
+%xhtml-blkpres.mod;]]>
+
+<!-- end of xhtml-pres-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-qname-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-qname-1.mod
new file mode 100644
index 0000000..c7586a5
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-qname-1.mod
@@ -0,0 +1,318 @@
+<!-- ....................................................................... -->
+<!-- XHTML Qname Module  ................................................... -->
+<!-- file: xhtml-qname-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-qname-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-qname-1.mod"
+
+     Revisions:
+	   #2000-10-22: added qname declarations for ruby elements
+     ....................................................................... -->
+
+<!-- XHTML Qname (Qualified Name) Module
+
+     This module is contained in two parts, labeled Section 'A' and 'B':
+
+       Section A declares parameter entities to support namespace-
+       qualified names, namespace declarations, and name prefixing
+       for XHTML and extensions.
+
+       Section B declares parameter entities used to provide
+       namespace-qualified names for all XHTML element types:
+
+         %applet.qname;   the xmlns-qualified name for <applet>
+         %base.qname;     the xmlns-qualified name for <base>
+         ...
+
+     XHTML extensions would create a module similar to this one.
+     Included in the XHTML distribution is a template module
+     ('template-qname-1.mod') suitable for this purpose.
+-->
+
+<!-- Section A: XHTML XML Namespace Framework :::::::::::::::::::: -->
+
+<!-- 1. Declare a %XHTML.prefixed; conditional section keyword, used
+        to activate namespace prefixing. The default value should
+        inherit '%NS.prefixed;' from the DTD driver, so that unless
+        overridden, the default behaviour follows the overall DTD
+        prefixing scheme.
+-->
+<!ENTITY % NS.prefixed "IGNORE" >
+<!ENTITY % XHTML.prefixed "%NS.prefixed;" >
+
+<!-- By default, we always permit XHTML attribute collections to have
+     namespace-qualified prefixes as well.
+-->
+<!ENTITY % XHTML.global.attrs.prefixed "INCLUDE" >
+<!-- By default, we allow the XML Schema attributes on the root
+     element.
+-->
+<!ENTITY % XHTML.xsi.attrs "INCLUDE" >
+
+<!-- 2. Declare a parameter entity (eg., %XHTML.xmlns;) containing
+        the URI reference used to identify the XHTML namespace:
+-->
+<!ENTITY % XHTML.xmlns  "http://www.w3.org/1999/xhtml" >
+
+<!-- 3. Declare parameter entities (eg., %XHTML.prefix;) containing
+        the default namespace prefix string(s) to use when prefixing
+        is enabled. This may be overridden in the DTD driver or the
+        internal subset of an document instance. If no default prefix
+        is desired, this may be declared as an empty string.
+
+     NOTE: As specified in [XMLNAMES], the namespace prefix serves
+     as a proxy for the URI reference, and is not in itself significant.
+-->
+<!ENTITY % XHTML.prefix  "xhtml" >
+
+<!-- 4. Declare parameter entities (eg., %XHTML.pfx;) containing the
+        colonized prefix(es) (eg., '%XHTML.prefix;:') used when
+        prefixing is active, an empty string when it is not.
+-->
+<![%XHTML.prefixed;[
+<!ENTITY % XHTML.pfx  "%XHTML.prefix;:" >
+]]>
+<!ENTITY % XHTML.pfx  "" >
+
+<!-- declare qualified name extensions here ............ -->
+<!ENTITY % xhtml-qname-extra.mod "" >
+%xhtml-qname-extra.mod;
+
+<!-- 5. The parameter entity %XHTML.xmlns.extra.attrib; may be
+        redeclared to contain any non-XHTML namespace declaration
+        attributes for namespaces embedded in XHTML. The default
+        is an empty string.  XLink should be included here if used
+        in the DTD.
+-->
+<!ENTITY % XHTML.xmlns.extra.attrib "" >
+
+<!-- The remainder of Section A is only followed in XHTML, not extensions. -->
+
+<!-- Declare a parameter entity %NS.decl.attrib; containing
+     all XML Namespace declarations used in the DTD, plus the
+     xmlns declaration for XHTML, its form dependent on whether
+     prefixing is active.
+-->
+<!ENTITY % XHTML.xmlns.attrib.prefixed
+     "xmlns:%XHTML.prefix;  %URI.datatype;   #FIXED '%XHTML.xmlns;'"
+>
+<![%XHTML.prefixed;[
+<!ENTITY % NS.decl.attrib
+     "%XHTML.xmlns.attrib.prefixed;
+      %XHTML.xmlns.extra.attrib;"
+>
+]]>
+<!ENTITY % NS.decl.attrib
+     "%XHTML.xmlns.extra.attrib;"
+>
+
+<!-- Declare a parameter entity %XSI.prefix as a prefix to use for XML
+     Schema Instance attributes.
+-->
+<!ENTITY % XSI.prefix "xsi" >
+
+<!ENTITY % XSI.xmlns "http://www.w3.org/2001/XMLSchema-instance" >
+
+<!-- Declare a parameter entity %XSI.xmlns.attrib as support for the
+     schemaLocation attribute, since this is legal throughout the DTD.
+-->
+<!ENTITY % XSI.xmlns.attrib
+     "xmlns:%XSI.prefix;  %URI.datatype;   #FIXED '%XSI.xmlns;'" >
+
+<!-- This is a placeholder for future XLink support.
+-->
+<!ENTITY % XLINK.xmlns.attrib "" >
+
+<!-- This is the attribute for the XML Schema namespace - XHTML
+     Modularization is also expressed in XML Schema, and it needs to
+	 be legal to declare the XML Schema namespace and the
+	 schemaLocation attribute on the root element of XHTML family
+	 documents.
+-->
+<![%XHTML.xsi.attrs;[
+<!ENTITY % XSI.prefix "xsi" >
+<!ENTITY % XSI.pfx "%XSI.prefix;:" >
+<!ENTITY % XSI.xmlns "http://www.w3.org/2001/XMLSchema-instance" >
+
+<!ENTITY % XSI.xmlns.attrib
+     "xmlns:%XSI.prefix;  %URI.datatype;    #FIXED '%XSI.xmlns;'"
+>
+]]>
+<!ENTITY % XSI.prefix "" >
+<!ENTITY % XSI.pfx "" >
+<!ENTITY % XSI.xmlns.attrib "" >
+
+
+<!-- Declare a parameter entity %NS.decl.attrib; containing all
+     XML namespace declaration attributes used by XHTML, including
+     a default xmlns attribute when prefixing is inactive.
+-->
+<![%XHTML.prefixed;[
+<!ENTITY % XHTML.xmlns.attrib
+     "%NS.decl.attrib;
+      %XSI.xmlns.attrib;
+      %XLINK.xmlns.attrib;"
+>
+]]>
+<!ENTITY % XHTML.xmlns.attrib
+     "xmlns        %URI.datatype;           #FIXED '%XHTML.xmlns;'
+      %NS.decl.attrib;
+      %XSI.xmlns.attrib;
+      %XLINK.xmlns.attrib;"
+>
+
+<!-- placeholder for qualified name redeclarations -->
+<!ENTITY % xhtml-qname.redecl "" >
+%xhtml-qname.redecl;
+
+<!-- Section B: XHTML Qualified Names ::::::::::::::::::::::::::::: -->
+
+<!-- 6. This section declares parameter entities used to provide
+        namespace-qualified names for all XHTML element types.
+-->
+
+<!-- module:  xhtml-applet-1.mod -->
+<!ENTITY % applet.qname  "%XHTML.pfx;applet" >
+
+<!-- module:  xhtml-base-1.mod -->
+<!ENTITY % base.qname    "%XHTML.pfx;base" >
+
+<!-- module:  xhtml-bdo-1.mod -->
+<!ENTITY % bdo.qname     "%XHTML.pfx;bdo" >
+
+<!-- module:  xhtml-blkphras-1.mod -->
+<!ENTITY % address.qname "%XHTML.pfx;address" >
+<!ENTITY % blockquote.qname  "%XHTML.pfx;blockquote" >
+<!ENTITY % pre.qname     "%XHTML.pfx;pre" >
+<!ENTITY % h1.qname      "%XHTML.pfx;h1" >
+<!ENTITY % h2.qname      "%XHTML.pfx;h2" >
+<!ENTITY % h3.qname      "%XHTML.pfx;h3" >
+<!ENTITY % h4.qname      "%XHTML.pfx;h4" >
+<!ENTITY % h5.qname      "%XHTML.pfx;h5" >
+<!ENTITY % h6.qname      "%XHTML.pfx;h6" >
+
+<!-- module:  xhtml-blkpres-1.mod -->
+<!ENTITY % hr.qname      "%XHTML.pfx;hr" >
+
+<!-- module:  xhtml-blkstruct-1.mod -->
+<!ENTITY % div.qname     "%XHTML.pfx;div" >
+<!ENTITY % p.qname       "%XHTML.pfx;p" >
+
+<!-- module:  xhtml-edit-1.mod -->
+<!ENTITY % ins.qname     "%XHTML.pfx;ins" >
+<!ENTITY % del.qname     "%XHTML.pfx;del" >
+
+<!-- module:  xhtml-form-1.mod -->
+<!ENTITY % form.qname    "%XHTML.pfx;form" >
+<!ENTITY % label.qname   "%XHTML.pfx;label" >
+<!ENTITY % input.qname   "%XHTML.pfx;input" >
+<!ENTITY % select.qname  "%XHTML.pfx;select" >
+<!ENTITY % optgroup.qname  "%XHTML.pfx;optgroup" >
+<!ENTITY % option.qname  "%XHTML.pfx;option" >
+<!ENTITY % textarea.qname  "%XHTML.pfx;textarea" >
+<!ENTITY % fieldset.qname  "%XHTML.pfx;fieldset" >
+<!ENTITY % legend.qname  "%XHTML.pfx;legend" >
+<!ENTITY % button.qname  "%XHTML.pfx;button" >
+
+<!-- module:  xhtml-hypertext-1.mod -->
+<!ENTITY % a.qname       "%XHTML.pfx;a" >
+
+<!-- module:  xhtml-image-1.mod -->
+<!ENTITY % img.qname     "%XHTML.pfx;img" >
+
+<!-- module:  xhtml-inlphras-1.mod -->
+<!ENTITY % abbr.qname    "%XHTML.pfx;abbr" >
+<!ENTITY % acronym.qname "%XHTML.pfx;acronym" >
+<!ENTITY % cite.qname    "%XHTML.pfx;cite" >
+<!ENTITY % code.qname    "%XHTML.pfx;code" >
+<!ENTITY % dfn.qname     "%XHTML.pfx;dfn" >
+<!ENTITY % em.qname      "%XHTML.pfx;em" >
+<!ENTITY % kbd.qname     "%XHTML.pfx;kbd" >
+<!ENTITY % q.qname       "%XHTML.pfx;q" >
+<!ENTITY % samp.qname    "%XHTML.pfx;samp" >
+<!ENTITY % strong.qname  "%XHTML.pfx;strong" >
+<!ENTITY % var.qname     "%XHTML.pfx;var" >
+
+<!-- module:  xhtml-inlpres-1.mod -->
+<!ENTITY % b.qname       "%XHTML.pfx;b" >
+<!ENTITY % big.qname     "%XHTML.pfx;big" >
+<!ENTITY % i.qname       "%XHTML.pfx;i" >
+<!ENTITY % small.qname   "%XHTML.pfx;small" >
+<!ENTITY % sub.qname     "%XHTML.pfx;sub" >
+<!ENTITY % sup.qname     "%XHTML.pfx;sup" >
+<!ENTITY % tt.qname      "%XHTML.pfx;tt" >
+
+<!-- module:  xhtml-inlstruct-1.mod -->
+<!ENTITY % br.qname      "%XHTML.pfx;br" >
+<!ENTITY % span.qname    "%XHTML.pfx;span" >
+
+<!-- module:  xhtml-ismap-1.mod (also csismap, ssismap) -->
+<!ENTITY % map.qname     "%XHTML.pfx;map" >
+<!ENTITY % area.qname    "%XHTML.pfx;area" >
+
+<!-- module:  xhtml-link-1.mod -->
+<!ENTITY % link.qname    "%XHTML.pfx;link" >
+
+<!-- module:  xhtml-list-1.mod -->
+<!ENTITY % dl.qname      "%XHTML.pfx;dl" >
+<!ENTITY % dt.qname      "%XHTML.pfx;dt" >
+<!ENTITY % dd.qname      "%XHTML.pfx;dd" >
+<!ENTITY % ol.qname      "%XHTML.pfx;ol" >
+<!ENTITY % ul.qname      "%XHTML.pfx;ul" >
+<!ENTITY % li.qname      "%XHTML.pfx;li" >
+
+<!-- module:  xhtml-meta-1.mod -->
+<!ENTITY % meta.qname    "%XHTML.pfx;meta" >
+
+<!-- module:  xhtml-param-1.mod -->
+<!ENTITY % param.qname   "%XHTML.pfx;param" >
+
+<!-- module:  xhtml-object-1.mod -->
+<!ENTITY % object.qname  "%XHTML.pfx;object" >
+
+<!-- module:  xhtml-script-1.mod -->
+<!ENTITY % script.qname  "%XHTML.pfx;script" >
+<!ENTITY % noscript.qname  "%XHTML.pfx;noscript" >
+
+<!-- module:  xhtml-struct-1.mod -->
+<!ENTITY % html.qname    "%XHTML.pfx;html" >
+<!ENTITY % head.qname    "%XHTML.pfx;head" >
+<!ENTITY % title.qname   "%XHTML.pfx;title" >
+<!ENTITY % body.qname    "%XHTML.pfx;body" >
+
+<!-- module:  xhtml-style-1.mod -->
+<!ENTITY % style.qname   "%XHTML.pfx;style" >
+
+<!-- module:  xhtml-table-1.mod -->
+<!ENTITY % table.qname   "%XHTML.pfx;table" >
+<!ENTITY % caption.qname "%XHTML.pfx;caption" >
+<!ENTITY % thead.qname   "%XHTML.pfx;thead" >
+<!ENTITY % tfoot.qname   "%XHTML.pfx;tfoot" >
+<!ENTITY % tbody.qname   "%XHTML.pfx;tbody" >
+<!ENTITY % colgroup.qname  "%XHTML.pfx;colgroup" >
+<!ENTITY % col.qname     "%XHTML.pfx;col" >
+<!ENTITY % tr.qname      "%XHTML.pfx;tr" >
+<!ENTITY % th.qname      "%XHTML.pfx;th" >
+<!ENTITY % td.qname      "%XHTML.pfx;td" >
+
+<!-- module:  xhtml-ruby-1.mod -->
+
+<!ENTITY % ruby.qname    "%XHTML.pfx;ruby" >
+<!ENTITY % rbc.qname     "%XHTML.pfx;rbc" >
+<!ENTITY % rtc.qname     "%XHTML.pfx;rtc" >
+<!ENTITY % rb.qname      "%XHTML.pfx;rb" >
+<!ENTITY % rt.qname      "%XHTML.pfx;rt" >
+<!ENTITY % rp.qname      "%XHTML.pfx;rp" >
+
+<!-- Provisional XHTML 2.0 Qualified Names  ...................... -->
+
+<!-- module:  xhtml-image-2.mod -->
+<!ENTITY % alt.qname     "%XHTML.pfx;alt" >
+
+<!-- end of xhtml-qname-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-ruby-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-ruby-1.mod
new file mode 100644
index 0000000..a44bb3f
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-ruby-1.mod
@@ -0,0 +1,242 @@
+<!-- ...................................................................... -->
+<!-- XHTML Ruby Module .................................................... -->
+<!-- file: xhtml-ruby-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1999-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-ruby-1.mod,v 4.0 2001/04/03 23:14:33 altheim Exp $
+
+     This module is based on the W3C Ruby Annotation Specification:
+
+        http://www.w3.org/TR/ruby
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Ruby 1.0//EN"
+       SYSTEM "http://www.w3.org/TR/ruby/xhtml-ruby-1.mod"
+
+     ...................................................................... -->
+
+<!-- Ruby Elements
+
+        ruby, rbc, rtc, rb, rt, rp
+
+     This module declares the elements and their attributes used to
+     support ruby annotation markup.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % ruby.qname  "ruby" >
+<!ENTITY % rbc.qname  "rbc" >
+<!ENTITY % rtc.qname  "rtc" >
+<!ENTITY % rb.qname  "rb" >
+<!ENTITY % rt.qname  "rt" >
+<!ENTITY % rp.qname  "rp" >
+
+<!-- rp fallback is included by default.
+-->
+<!ENTITY % Ruby.fallback "INCLUDE" >
+<!ENTITY % Ruby.fallback.mandatory "IGNORE" >
+
+<!-- Complex ruby is included by default; it may be 
+     overridden by other modules to ignore it.
+-->
+<!ENTITY % Ruby.complex "INCLUDE" >
+
+<!-- Fragments for the content model of the ruby element -->
+<![%Ruby.fallback;[
+<![%Ruby.fallback.mandatory;[
+<!ENTITY % Ruby.content.simple 
+     "( %rb.qname;, %rp.qname;, %rt.qname;, %rp.qname; )"
+>
+]]>
+<!ENTITY % Ruby.content.simple 
+     "( %rb.qname;, ( %rt.qname; | ( %rp.qname;, %rt.qname;, %rp.qname; ) ) )"
+>
+]]>
+<!ENTITY % Ruby.content.simple "( %rb.qname;, %rt.qname; )" >
+
+<![%Ruby.complex;[
+<!ENTITY % Ruby.content.complex 
+     "| ( %rbc.qname;, %rtc.qname;, %rtc.qname;? )"
+>
+]]>
+<!ENTITY % Ruby.content.complex "" >
+
+<!-- Content models of the rb and the rt elements are intended to
+     allow other inline-level elements of its parent markup language,
+     but it should not include ruby descendent elements. The following
+     parameter entity %NoRuby.content; can be used to redefine
+     those content models with minimum effort.  It's defined as
+     '( #PCDATA )' by default.
+-->
+<!ENTITY % NoRuby.content "( #PCDATA )" >
+
+<!-- one or more digits (NUMBER) -->
+<!ENTITY % Number.datatype "CDATA" >
+
+<!-- ruby element ...................................... -->
+
+<!ENTITY % ruby.element  "INCLUDE" >
+<![%ruby.element;[
+<!ENTITY % ruby.content
+     "( %Ruby.content.simple; %Ruby.content.complex; )"
+>
+<!ELEMENT %ruby.qname;  %ruby.content; >
+<!-- end of ruby.element -->]]>
+
+<![%Ruby.complex;[
+<!-- rbc (ruby base component) element ................. -->
+
+<!ENTITY % rbc.element  "INCLUDE" >
+<![%rbc.element;[
+<!ENTITY % rbc.content
+     "(%rb.qname;)+"
+>
+<!ELEMENT %rbc.qname;  %rbc.content; >
+<!-- end of rbc.element -->]]>
+
+<!-- rtc (ruby text component) element ................. -->
+
+<!ENTITY % rtc.element  "INCLUDE" >
+<![%rtc.element;[
+<!ENTITY % rtc.content
+     "(%rt.qname;)+"
+>
+<!ELEMENT %rtc.qname;  %rtc.content; >
+<!-- end of rtc.element -->]]>
+]]>
+
+<!-- rb (ruby base) element ............................ -->
+
+<!ENTITY % rb.element  "INCLUDE" >
+<![%rb.element;[
+<!-- %rb.content; uses %NoRuby.content; as its content model,
+     which is '( #PCDATA )' by default. It may be overridden
+     by other modules to allow other inline-level elements
+     of its parent markup language, but it should not include
+     ruby descendent elements.
+-->
+<!ENTITY % rb.content "%NoRuby.content;" >
+<!ELEMENT %rb.qname;  %rb.content; >
+<!-- end of rb.element -->]]>
+
+<!-- rt (ruby text) element ............................ -->
+
+<!ENTITY % rt.element  "INCLUDE" >
+<![%rt.element;[
+<!-- %rt.content; uses %NoRuby.content; as its content model,
+     which is '( #PCDATA )' by default. It may be overridden
+     by other modules to allow other inline-level elements
+     of its parent markup language, but it should not include
+     ruby descendent elements.
+-->
+<!ENTITY % rt.content "%NoRuby.content;" >
+
+<!ELEMENT %rt.qname;  %rt.content; >
+<!-- end of rt.element -->]]>
+
+<!-- rbspan attribute is used for complex ruby only ...... -->
+<![%Ruby.complex;[
+<!ENTITY % rt.attlist  "INCLUDE" >
+<![%rt.attlist;[
+<!ATTLIST %rt.qname;
+      rbspan         %Number.datatype;      "1"
+>
+<!-- end of rt.attlist -->]]>
+]]>
+
+<!-- rp (ruby parenthesis) element ..................... -->
+
+<![%Ruby.fallback;[
+<!ENTITY % rp.element  "INCLUDE" >
+<![%rp.element;[
+<!ENTITY % rp.content
+     "( #PCDATA )"
+>
+<!ELEMENT %rp.qname;  %rp.content; >
+<!-- end of rp.element -->]]>
+]]>
+
+<!-- Ruby Common Attributes
+
+     The following optional ATTLIST declarations provide an easy way
+     to define common attributes for ruby elements.  These declarations
+     are ignored by default.
+
+     Ruby elements are intended to have common attributes of its
+     parent markup language.  For example, if a markup language defines
+     common attributes as a parameter entity %attrs;, you may add
+     those attributes by just declaring the following parameter entities
+
+         <!ENTITY % Ruby.common.attlists  "INCLUDE" >
+         <!ENTITY % Ruby.common.attrib  "%attrs;" >
+
+     before including the Ruby module.
+-->
+
+<!ENTITY % Ruby.common.attlists  "IGNORE" >
+<![%Ruby.common.attlists;[
+<!ENTITY % Ruby.common.attrib  "" >
+
+<!-- common attributes for ruby ........................ -->
+
+<!ENTITY % Ruby.common.attlist  "INCLUDE" >
+<![%Ruby.common.attlist;[
+<!ATTLIST %ruby.qname;
+      %Ruby.common.attrib;
+>
+<!-- end of Ruby.common.attlist -->]]>
+
+<![%Ruby.complex;[
+<!-- common attributes for rbc ......................... -->
+
+<!ENTITY % Rbc.common.attlist  "INCLUDE" >
+<![%Rbc.common.attlist;[
+<!ATTLIST %rbc.qname;
+      %Ruby.common.attrib;
+>
+<!-- end of Rbc.common.attlist -->]]>
+
+<!-- common attributes for rtc ......................... -->
+
+<!ENTITY % Rtc.common.attlist  "INCLUDE" >
+<![%Rtc.common.attlist;[
+<!ATTLIST %rtc.qname;
+      %Ruby.common.attrib;
+>
+<!-- end of Rtc.common.attlist -->]]>
+]]>
+
+<!-- common attributes for rb .......................... -->
+
+<!ENTITY % Rb.common.attlist  "INCLUDE" >
+<![%Rb.common.attlist;[
+<!ATTLIST %rb.qname;
+      %Ruby.common.attrib;
+>
+<!-- end of Rb.common.attlist -->]]>
+
+<!-- common attributes for rt .......................... -->
+
+<!ENTITY % Rt.common.attlist  "INCLUDE" >
+<![%Rt.common.attlist;[
+<!ATTLIST %rt.qname;
+      %Ruby.common.attrib;
+>
+<!-- end of Rt.common.attlist -->]]>
+
+<![%Ruby.fallback;[
+<!-- common attributes for rp .......................... -->
+
+<!ENTITY % Rp.common.attlist  "INCLUDE" >
+<![%Rp.common.attlist;[
+<!ATTLIST %rp.qname;
+      %Ruby.common.attrib;
+>
+<!-- end of Rp.common.attlist -->]]>
+]]>
+]]>
+
+<!-- end of xhtml-ruby-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-script-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-script-1.mod
new file mode 100644
index 0000000..aa702f1
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-script-1.mod
@@ -0,0 +1,67 @@
+<!-- ...................................................................... -->
+<!-- XHTML Document Scripting Module  ..................................... -->
+<!-- file: xhtml-script-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-script-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-script-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Scripting
+
+        script, noscript
+
+     This module declares element types and attributes used to provide
+     support for executable scripts as well as an alternate content
+     container where scripts are not supported.
+-->
+
+<!-- script: Scripting Statement ....................... -->
+
+<!ENTITY % script.element  "INCLUDE" >
+<![%script.element;[
+<!ENTITY % script.content  "( #PCDATA )" >
+<!ENTITY % script.qname  "script" >
+<!ELEMENT %script.qname;  %script.content; >
+<!-- end of script.element -->]]>
+
+<!ENTITY % script.attlist  "INCLUDE" >
+<![%script.attlist;[
+<!ATTLIST %script.qname;
+      %XHTML.xmlns.attrib;
+	  %id.attrib;
+      xml:space    ( preserve )             #FIXED 'preserve'
+      charset      %Charset.datatype;       #IMPLIED
+      type         %ContentType.datatype;   #REQUIRED
+      src          %URI.datatype;           #IMPLIED
+      defer        ( defer )                #IMPLIED
+>
+<!-- end of script.attlist -->]]>
+
+<!-- noscript: No-Script Alternate Content ............. -->
+
+<!ENTITY % noscript.element  "INCLUDE" >
+<![%noscript.element;[
+<!ENTITY % noscript.content
+     "( %Block.mix; )+"
+>
+<!ENTITY % noscript.qname  "noscript" >
+<!ELEMENT %noscript.qname;  %noscript.content; >
+<!-- end of noscript.element -->]]>
+
+<!ENTITY % noscript.attlist  "INCLUDE" >
+<![%noscript.attlist;[
+<!ATTLIST %noscript.qname;
+      %Common.attrib;
+>
+<!-- end of noscript.attlist -->]]>
+
+<!-- end of xhtml-script-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-special.ent b/xml/impl/resources/standardSchemas/xhtml11/xhtml-special.ent
new file mode 100644
index 0000000..0af4654
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-special.ent
@@ -0,0 +1,82 @@
+<!-- ...................................................................... -->
+<!-- XML-compatible ISO Special Character Entity Set for XHTML ............ -->
+<!-- file: xhtml-special.ent
+
+     Typical invocation:
+
+       <!ENTITY % xhtml-special
+           PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+                  "xhtml-special.ent" >
+       %xhtml-special;
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-special.ent"
+
+     Revision:  $Id: xhtml-special.ent,v 4.1 2001/04/10 09:34:14 altheim Exp $ SMI
+
+     Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with conforming
+     SGML systems and applications as defined in ISO 8879, provided
+     this notice is included in all copies.
+
+     Revisions:
+2000-10-28: added &apos; and altered XML Predefined Entities for compatibility
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+     New names (i.e., not in ISO 8879 [SGML] list) do not clash with
+     any existing ISO 8879 entity names. ISO 10646 [ISO10646] character
+     numbers are given for each character, in hex. Entity values are
+     decimal conversions of the ISO 10646 values and refer to the
+     document character set. Names are Unicode [UNICODE] names.
+-->
+
+<!-- C0 Controls and Basic Latin -->
+<!ENTITY lt      "&#38;#60;" ><!-- less-than sign, U+003C ISOnum -->
+<!ENTITY gt      "&#62;" ><!-- greater-than sign, U+003E ISOnum -->
+<!ENTITY amp     "&#38;#38;" ><!-- ampersand, U+0026 ISOnum -->
+<!ENTITY apos    "&#39;" ><!-- The Apostrophe (Apostrophe Quote, APL Quote), U+0027 ISOnum -->
+<!ENTITY quot    "&#34;" ><!-- quotation mark (Quote Double), U+0022 ISOnum -->
+
+<!-- Latin Extended-A -->
+<!ENTITY OElig   "&#338;" ><!-- latin capital ligature OE, U+0152 ISOlat2 -->
+<!ENTITY oelig   "&#339;" ><!-- latin small ligature oe, U+0153 ISOlat2 -->
+
+<!-- ligature is a misnomer, this is a separate character in some languages -->
+<!ENTITY Scaron  "&#352;" ><!-- latin capital letter S with caron, U+0160 ISOlat2 -->
+<!ENTITY scaron  "&#353;" ><!-- latin small letter s with caron, U+0161 ISOlat2 -->
+<!ENTITY Yuml    "&#376;" ><!-- latin capital letter Y with diaeresis, U+0178 ISOlat2 -->
+
+<!-- Spacing Modifier Letters -->
+<!ENTITY circ    "&#710;" ><!-- modifier letter circumflex accent, U+02C6 ISOpub -->
+<!ENTITY tilde   "&#732;" ><!-- small tilde, U+02DC ISOdia -->
+
+<!-- General Punctuation -->
+<!ENTITY ensp    "&#8194;" ><!-- en space, U+2002 ISOpub -->
+<!ENTITY emsp    "&#8195;" ><!-- em space, U+2003 ISOpub -->
+<!ENTITY thinsp  "&#8201;" ><!-- thin space, U+2009 ISOpub -->
+<!ENTITY zwnj    "&#8204;" ><!-- zero width non-joiner, U+200C NEW RFC 2070 -->
+<!ENTITY zwj     "&#8205;" ><!-- zero width joiner, U+200D NEW RFC 2070 -->
+<!ENTITY lrm     "&#8206;" ><!-- left-to-right mark, U+200E NEW RFC 2070 -->
+<!ENTITY rlm     "&#8207;" ><!-- right-to-left mark, U+200F NEW RFC 2070 -->
+<!ENTITY ndash   "&#8211;" ><!-- en dash, U+2013 ISOpub -->
+<!ENTITY mdash   "&#8212;" ><!-- em dash, U+2014 ISOpub -->
+<!ENTITY lsquo   "&#8216;" ><!-- left single quotation mark, U+2018 ISOnum -->
+<!ENTITY rsquo   "&#8217;" ><!-- right single quotation mark, U+2019 ISOnum -->
+<!ENTITY sbquo   "&#8218;" ><!-- single low-9 quotation mark, U+201A NEW -->
+<!ENTITY ldquo   "&#8220;" ><!-- left double quotation mark, U+201C ISOnum -->
+<!ENTITY rdquo   "&#8221;" ><!-- right double quotation mark, U+201D ISOnum -->
+<!ENTITY bdquo   "&#8222;" ><!-- double low-9 quotation mark, U+201E NEW -->
+<!ENTITY dagger  "&#8224;" ><!-- dagger, U+2020 ISOpub -->
+<!ENTITY Dagger  "&#8225;" ><!-- double dagger, U+2021 ISOpub -->
+<!ENTITY permil  "&#8240;" ><!-- per mille sign, U+2030 ISOtech -->
+
+<!-- lsaquo is proposed but not yet ISO standardized -->
+<!ENTITY lsaquo  "&#8249;" ><!-- single left-pointing angle quotation mark, U+2039 ISO proposed -->
+<!-- rsaquo is proposed but not yet ISO standardized -->
+<!ENTITY rsaquo  "&#8250;" ><!-- single right-pointing angle quotation mark, U+203A ISO proposed -->
+<!ENTITY euro    "&#8364;" ><!-- euro sign, U+20AC NEW -->
+
+<!-- end of xhtml-special.ent -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-ssismap-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-ssismap-1.mod
new file mode 100644
index 0000000..4e2b8d7
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-ssismap-1.mod
@@ -0,0 +1,32 @@
+<!-- ...................................................................... -->
+<!-- XHTML Server-side Image Map Module  .................................. -->
+<!-- file: xhtml-ssismap-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-ssismap-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Server-side Image Maps 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-ssismap-1.mod"
+
+     Revisions:
+#2000-10-22: added declaration for 'ismap' on <input>
+     ....................................................................... -->
+
+<!-- Server-side Image Maps
+
+     This adds the 'ismap' attribute to the img and input elements
+     to support server-side processing of a user selection.
+-->
+
+<!ATTLIST %img.qname;
+      ismap        ( ismap )                #IMPLIED
+>
+
+<!ATTLIST %input.qname;
+      ismap        ( ismap )                #IMPLIED
+>
+
+<!-- end of xhtml-ssismap-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-struct-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-struct-1.mod
new file mode 100644
index 0000000..580eb92
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-struct-1.mod
@@ -0,0 +1,136 @@
+<!-- ...................................................................... -->
+<!-- XHTML Structure Module  .............................................. -->
+<!-- file: xhtml-struct-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-struct-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-struct-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Document Structure
+
+        title, head, body, html
+
+     The Structure Module defines the major structural elements and
+     their attributes.
+
+     Note that the content model of the head element type is redeclared
+     when the Base Module is included in the DTD.
+
+     The parameter entity containing the XML namespace URI value used
+     for XHTML is '%XHTML.xmlns;', defined in the Qualified Names module.
+-->
+
+<!-- title: Document Title ............................. -->
+
+<!-- The title element is not considered part of the flow of text.
+     It should be displayed, for example as the page header or
+     window title. Exactly one title is required per document.
+-->
+
+<!ENTITY % title.element  "INCLUDE" >
+<![%title.element;[
+<!ENTITY % title.content  "( #PCDATA )" >
+<!ENTITY % title.qname  "title" >
+<!ELEMENT %title.qname;  %title.content; >
+<!-- end of title.element -->]]>
+
+<!ENTITY % title.attlist  "INCLUDE" >
+<![%title.attlist;[
+<!ATTLIST %title.qname;
+      %XHTML.xmlns.attrib;
+      %I18n.attrib;
+>
+<!-- end of title.attlist -->]]>
+
+<!-- head: Document Head ............................... -->
+
+<!ENTITY % head.element  "INCLUDE" >
+<![%head.element;[
+<!ENTITY % head.content
+    "( %HeadOpts.mix;, %title.qname;, %HeadOpts.mix; )"
+>
+<!ENTITY % head.qname  "head" >
+<!ELEMENT %head.qname;  %head.content; >
+<!-- end of head.element -->]]>
+
+<!ENTITY % head.attlist  "INCLUDE" >
+<![%head.attlist;[
+<!-- reserved for future use with document profiles
+-->
+<!ENTITY % profile.attrib
+     "profile      %URI.datatype;           '%XHTML.profile;'"
+>
+
+<!ATTLIST %head.qname;
+      %XHTML.xmlns.attrib;
+      %I18n.attrib;
+      %profile.attrib;
+      %id.attrib;
+>
+<!-- end of head.attlist -->]]>
+
+<!-- body: Document Body ............................... -->
+
+<!ENTITY % body.element  "INCLUDE" >
+<![%body.element;[
+<!ENTITY % body.content
+     "( %Block.mix; )*"
+>
+<!ENTITY % body.qname  "body" >
+<!ELEMENT %body.qname;  %body.content; >
+<!-- end of body.element -->]]>
+
+<!ENTITY % body.attlist  "INCLUDE" >
+<![%body.attlist;[
+<!ATTLIST %body.qname;
+      %Common.attrib;
+>
+<!-- end of body.attlist -->]]>
+
+<!-- html: XHTML Document Element ...................... -->
+
+<!ENTITY % html.element  "INCLUDE" >
+<![%html.element;[
+<!ENTITY % html.content  "( %head.qname;, %body.qname; )" >
+<!ENTITY % html.qname  "html" >
+<!ELEMENT %html.qname;  %html.content; >
+<!-- end of html.element -->]]>
+
+<![%XHTML.xsi.attrs;[
+<!-- define a parameter for the XSI schemaLocation attribute -->
+<!ENTITY % XSI.schemaLocation.attrib
+     "%XSI.pfx;schemaLocation  %URIs.datatype;    #IMPLIED"
+>
+]]>
+<!ENTITY % XSI.schemaLocation.attrib "">
+
+<!ENTITY % html.attlist  "INCLUDE" >
+<![%html.attlist;[
+<!-- version attribute value defined in driver
+-->
+<!ENTITY % XHTML.version.attrib
+     "version      %FPI.datatype;           #FIXED '%XHTML.version;'"
+>
+
+<!-- see the Qualified Names module for information
+     on how to extend XHTML using XML namespaces
+-->
+<!ATTLIST %html.qname;
+      %XHTML.xmlns.attrib;
+      %XSI.schemaLocation.attrib;
+      %XHTML.version.attrib;
+      %I18n.attrib;
+      %id.attrib;
+>
+<!-- end of html.attlist -->]]>
+
+<!-- end of xhtml-struct-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-style-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-style-1.mod
new file mode 100644
index 0000000..3105b2a
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-style-1.mod
@@ -0,0 +1,48 @@
+<!-- ...................................................................... -->
+<!-- XHTML Document Style Sheet Module  ................................... -->
+<!-- file: xhtml-style-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-style-1.mod,v 4.1 2001/04/05 06:57:40 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//DTD XHTML Style Sheets 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-style-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Style Sheets
+
+        style
+
+     This module declares the style element type and its attributes,
+     used to embed style sheet information in the document head element.
+-->
+
+<!-- style: Style Sheet Information .................... -->
+
+<!ENTITY % style.element  "INCLUDE" >
+<![%style.element;[
+<!ENTITY % style.content  "( #PCDATA )" >
+<!ENTITY % style.qname  "style" >
+<!ELEMENT %style.qname;  %style.content; >
+<!-- end of style.element -->]]>
+
+<!ENTITY % style.attlist  "INCLUDE" >
+<![%style.attlist;[
+<!ATTLIST %style.qname;
+      %XHTML.xmlns.attrib;
+      %id.attrib;
+      %title.attrib;
+      %I18n.attrib;
+      xml:space    ( preserve )             #FIXED 'preserve'
+      type         %ContentType.datatype;   #REQUIRED
+      media        %MediaDesc.datatype;     #IMPLIED
+>
+<!-- end of style.attlist -->]]>
+
+<!-- end of xhtml-style-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-symbol.ent b/xml/impl/resources/standardSchemas/xhtml11/xhtml-symbol.ent
new file mode 100644
index 0000000..e92a1c7
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-symbol.ent
@@ -0,0 +1,204 @@
+<!-- ...................................................................... -->
+<!-- ISO Math, Greek and Symbolic Character Entity Set for XHTML .......... -->
+<!-- file: xhtml-symbol.ent
+
+     Typical invocation:
+
+       <!ENTITY % xhtml-symbol
+           PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+                  "xhtml-symbol.ent" >
+       %xhtml-symbol;
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-symbol.ent"
+
+     Revision:  $Id: xhtml-symbol.ent,v 4.1 2001/04/10 09:34:14 altheim Exp $ SMI
+
+     Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with conforming
+     SGML systems and applications as defined in ISO 8879, provided
+     this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+     New names (i.e., not in ISO 8879 [SGML] list) do not clash with
+     any existing ISO 8879 entity names. ISO 10646 [ISO10646] character
+     numbers are given for each character, in hex. Entity values are
+     decimal conversions of the ISO 10646 values and refer to the
+     document character set. Names are Unicode [UNICODE] names.
+-->
+
+<!-- Latin Extended-B -->
+<!ENTITY fnof     "&#402;" ><!-- latin small f with hook = function
+                              = florin, U+0192 ISOtech -->
+
+<!-- Greek -->
+<!ENTITY Alpha    "&#913;" ><!-- greek capital letter alpha, U+0391 -->
+<!ENTITY Beta     "&#914;" ><!-- greek capital letter beta, U+0392 -->
+<!ENTITY Gamma    "&#915;" ><!-- greek capital letter gamma, U+0393 ISOgrk3 -->
+<!ENTITY Delta    "&#916;" ><!-- greek capital letter delta, U+0394 ISOgrk3 -->
+<!ENTITY Epsilon  "&#917;" ><!-- greek capital letter epsilon, U+0395 -->
+<!ENTITY Zeta     "&#918;" ><!-- greek capital letter zeta, U+0396 -->
+<!ENTITY Eta      "&#919;" ><!-- greek capital letter eta, U+0397 -->
+<!ENTITY Theta    "&#920;" ><!-- greek capital letter theta, U+0398 ISOgrk3 -->
+<!ENTITY Iota     "&#921;" ><!-- greek capital letter iota, U+0399 -->
+<!ENTITY Kappa    "&#922;" ><!-- greek capital letter kappa, U+039A -->
+<!ENTITY Lambda   "&#923;" ><!-- greek capital letter lambda, U+039B ISOgrk3 -->
+<!ENTITY Mu       "&#924;" ><!-- greek capital letter mu, U+039C -->
+<!ENTITY Nu       "&#925;" ><!-- greek capital letter nu, U+039D -->
+<!ENTITY Xi       "&#926;" ><!-- greek capital letter xi, U+039E ISOgrk3 -->
+<!ENTITY Omicron  "&#927;" ><!-- greek capital letter omicron, U+039F -->
+<!ENTITY Pi       "&#928;" ><!-- greek capital letter pi, U+03A0 ISOgrk3 -->
+<!ENTITY Rho      "&#929;" ><!-- greek capital letter rho, U+03A1 -->
+<!-- there is no Sigmaf, and no U+03A2 character either -->
+<!ENTITY Sigma    "&#931;" ><!-- greek capital letter sigma, U+03A3 ISOgrk3 -->
+<!ENTITY Tau      "&#932;" ><!-- greek capital letter tau, U+03A4 -->
+<!ENTITY Upsilon  "&#933;" ><!-- greek capital letter upsilon,
+                              U+03A5 ISOgrk3 -->
+<!ENTITY Phi      "&#934;" ><!-- greek capital letter phi, U+03A6 ISOgrk3 -->
+<!ENTITY Chi      "&#935;" ><!-- greek capital letter chi, U+03A7 -->
+<!ENTITY Psi      "&#936;" ><!-- greek capital letter psi, U+03A8 ISOgrk3 -->
+<!ENTITY Omega    "&#937;" ><!-- greek capital letter omega, U+03A9 ISOgrk3 -->
+<!ENTITY alpha    "&#945;" ><!-- greek small letter alpha, U+03B1 ISOgrk3 -->
+<!ENTITY beta     "&#946;" ><!-- greek small letter beta, U+03B2 ISOgrk3 -->
+<!ENTITY gamma    "&#947;" ><!-- greek small letter gamma, U+03B3 ISOgrk3 -->
+<!ENTITY delta    "&#948;" ><!-- greek small letter delta, U+03B4 ISOgrk3 -->
+<!ENTITY epsilon  "&#949;" ><!-- greek small letter epsilon, U+03B5 ISOgrk3 -->
+<!ENTITY zeta     "&#950;" ><!-- greek small letter zeta, U+03B6 ISOgrk3 -->
+<!ENTITY eta      "&#951;" ><!-- greek small letter eta, U+03B7 ISOgrk3 -->
+<!ENTITY theta    "&#952;" ><!-- greek small letter theta, U+03B8 ISOgrk3 -->
+<!ENTITY iota     "&#953;" ><!-- greek small letter iota, U+03B9 ISOgrk3 -->
+<!ENTITY kappa    "&#954;" ><!-- greek small letter kappa, U+03BA ISOgrk3 -->
+<!ENTITY lambda   "&#955;" ><!-- greek small letter lambda, U+03BB ISOgrk3 -->
+<!ENTITY mu       "&#956;" ><!-- greek small letter mu, U+03BC ISOgrk3 -->
+<!ENTITY nu       "&#957;" ><!-- greek small letter nu, U+03BD ISOgrk3 -->
+<!ENTITY xi       "&#958;" ><!-- greek small letter xi, U+03BE ISOgrk3 -->
+<!ENTITY omicron  "&#959;" ><!-- greek small letter omicron, U+03BF NEW -->
+<!ENTITY pi       "&#960;" ><!-- greek small letter pi, U+03C0 ISOgrk3 -->
+<!ENTITY rho      "&#961;" ><!-- greek small letter rho, U+03C1 ISOgrk3 -->
+<!ENTITY sigmaf   "&#962;" ><!-- greek small letter final sigma, U+03C2 ISOgrk3 -->
+<!ENTITY sigma    "&#963;" ><!-- greek small letter sigma, U+03C3 ISOgrk3 -->
+<!ENTITY tau      "&#964;" ><!-- greek small letter tau, U+03C4 ISOgrk3 -->
+<!ENTITY upsilon  "&#965;" ><!-- greek small letter upsilon, U+03C5 ISOgrk3 -->
+<!ENTITY phi      "&#966;" ><!-- greek small letter phi, U+03C6 ISOgrk3 -->
+<!ENTITY chi      "&#967;" ><!-- greek small letter chi, U+03C7 ISOgrk3 -->
+<!ENTITY psi      "&#968;" ><!-- greek small letter psi, U+03C8 ISOgrk3 -->
+<!ENTITY omega    "&#969;" ><!-- greek small letter omega, U+03C9 ISOgrk3 -->
+<!ENTITY thetasym "&#977;" ><!-- greek small letter theta symbol, U+03D1 NEW -->
+<!ENTITY upsih    "&#978;" ><!-- greek upsilon with hook symbol, U+03D2 NEW -->
+<!ENTITY piv      "&#982;" ><!-- greek pi symbol, U+03D6 ISOgrk3 -->
+
+<!-- General Punctuation -->
+<!ENTITY bull     "&#8226;" ><!-- bullet = black small circle, U+2022 ISOpub  -->
+<!-- bullet is NOT the same as bullet operator, U+2219 -->
+<!ENTITY hellip   "&#8230;" ><!-- horizontal ellipsis = three dot leader, U+2026 ISOpub  -->
+<!ENTITY prime    "&#8242;" ><!-- prime = minutes = feet, U+2032 ISOtech -->
+<!ENTITY Prime    "&#8243;" ><!-- double prime = seconds = inches, U+2033 ISOtech -->
+<!ENTITY oline    "&#8254;" ><!-- overline = spacing overscore, U+203E NEW -->
+<!ENTITY frasl    "&#8260;" ><!-- fraction slash, U+2044 NEW -->
+
+<!-- Letterlike Symbols -->
+<!ENTITY weierp   "&#8472;" ><!-- script capital P = power set = Weierstrass p, U+2118 ISOamso -->
+<!ENTITY image    "&#8465;" ><!-- blackletter capital I = imaginary part, U+2111 ISOamso -->
+<!ENTITY real     "&#8476;" ><!-- blackletter capital R = real part symbol, U+211C ISOamso -->
+<!ENTITY trade    "&#8482;" ><!-- trade mark sign, U+2122 ISOnum -->
+<!ENTITY alefsym  "&#8501;" ><!-- alef symbol = first transfinite cardinal, U+2135 NEW -->
+<!-- alef symbol is NOT the same as hebrew letter alef, U+05D0 although
+     the same glyph could be used to depict both characters -->
+
+<!-- Arrows -->
+<!ENTITY larr     "&#8592;" ><!-- leftwards arrow, U+2190 ISOnum -->
+<!ENTITY uarr     "&#8593;" ><!-- upwards arrow, U+2191 ISOnum-->
+<!ENTITY rarr     "&#8594;" ><!-- rightwards arrow, U+2192 ISOnum -->
+<!ENTITY darr     "&#8595;" ><!-- downwards arrow, U+2193 ISOnum -->
+<!ENTITY harr     "&#8596;" ><!-- left right arrow, U+2194 ISOamsa -->
+<!ENTITY crarr    "&#8629;" ><!-- downwards arrow with corner leftwards
+                               = carriage return, U+21B5 NEW -->
+<!ENTITY lArr     "&#8656;" ><!-- leftwards double arrow, U+21D0 ISOtech -->
+<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow
+    but also does not have any other character for that function. So ? lArr can
+    be used for 'is implied by' as ISOtech suggests -->
+<!ENTITY uArr     "&#8657;" ><!-- upwards double arrow, U+21D1 ISOamsa -->
+<!ENTITY rArr     "&#8658;" ><!-- rightwards double arrow, U+21D2 ISOtech -->
+<!-- Unicode does not say this is the 'implies' character but does not have
+     another character with this function so ?
+     rArr can be used for 'implies' as ISOtech suggests -->
+<!ENTITY dArr     "&#8659;" ><!-- downwards double arrow, U+21D3 ISOamsa -->
+<!ENTITY hArr     "&#8660;" ><!-- left right double arrow, U+21D4 ISOamsa -->
+
+<!-- Mathematical Operators -->
+<!ENTITY forall   "&#8704;" ><!-- for all, U+2200 ISOtech -->
+<!ENTITY part     "&#8706;" ><!-- partial differential, U+2202 ISOtech  -->
+<!ENTITY exist    "&#8707;" ><!-- there exists, U+2203 ISOtech -->
+<!ENTITY empty    "&#8709;" ><!-- empty set = null set, U+2205 ISOamso -->
+<!ENTITY nabla    "&#8711;" ><!-- nabla = backward difference, U+2207 ISOtech -->
+<!ENTITY isin     "&#8712;" ><!-- element of, U+2208 ISOtech -->
+<!ENTITY notin    "&#8713;" ><!-- not an element of, U+2209 ISOtech -->
+<!ENTITY ni       "&#8715;" ><!-- contains as member, U+220B ISOtech -->
+<!-- should there be a more memorable name than 'ni'? -->
+<!ENTITY prod     "&#8719;" ><!-- n-ary product = product sign, U+220F ISOamsb -->
+<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
+     the same glyph might be used for both -->
+<!ENTITY sum      "&#8721;" ><!-- n-ary sumation, U+2211 ISOamsb -->
+<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
+     though the same glyph might be used for both -->
+<!ENTITY minus    "&#8722;" ><!-- minus sign, U+2212 ISOtech -->
+<!ENTITY lowast   "&#8727;" ><!-- asterisk operator, U+2217 ISOtech -->
+<!ENTITY radic    "&#8730;" ><!-- square root = radical sign, U+221A ISOtech -->
+<!ENTITY prop     "&#8733;" ><!-- proportional to, U+221D ISOtech -->
+<!ENTITY infin    "&#8734;" ><!-- infinity, U+221E ISOtech -->
+<!ENTITY ang      "&#8736;" ><!-- angle, U+2220 ISOamso -->
+<!ENTITY and      "&#8743;" ><!-- logical and = wedge, U+2227 ISOtech -->
+<!ENTITY or       "&#8744;" ><!-- logical or = vee, U+2228 ISOtech -->
+<!ENTITY cap      "&#8745;" ><!-- intersection = cap, U+2229 ISOtech -->
+<!ENTITY cup      "&#8746;" ><!-- union = cup, U+222A ISOtech -->
+<!ENTITY int      "&#8747;" ><!-- integral, U+222B ISOtech -->
+<!ENTITY there4   "&#8756;" ><!-- therefore, U+2234 ISOtech -->
+<!ENTITY sim      "&#8764;" ><!-- tilde operator = varies with = similar to, U+223C ISOtech -->
+<!-- tilde operator is NOT the same character as the tilde, U+007E,
+     although the same glyph might be used to represent both  -->
+<!ENTITY cong     "&#8773;" ><!-- approximately equal to, U+2245 ISOtech -->
+<!ENTITY asymp    "&#8776;" ><!-- almost equal to = asymptotic to, U+2248 ISOamsr -->
+<!ENTITY ne       "&#8800;" ><!-- not equal to, U+2260 ISOtech -->
+<!ENTITY equiv    "&#8801;" ><!-- identical to, U+2261 ISOtech -->
+<!ENTITY le       "&#8804;" ><!-- less-than or equal to, U+2264 ISOtech -->
+<!ENTITY ge       "&#8805;" ><!-- greater-than or equal to, U+2265 ISOtech -->
+<!ENTITY sub      "&#8834;" ><!-- subset of, U+2282 ISOtech -->
+<!ENTITY sup      "&#8835;" ><!-- superset of, U+2283 ISOtech -->
+<!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol
+     font encoding and is not included. Should it be, for symmetry?
+     It is in ISOamsn  -->
+<!ENTITY nsub     "&#8836;" ><!-- not a subset of, U+2284 ISOamsn -->
+<!ENTITY sube     "&#8838;" ><!-- subset of or equal to, U+2286 ISOtech -->
+<!ENTITY supe     "&#8839;" ><!-- superset of or equal to, U+2287 ISOtech -->
+<!ENTITY oplus    "&#8853;" ><!-- circled plus = direct sum, U+2295 ISOamsb -->
+<!ENTITY otimes   "&#8855;" ><!-- circled times = vector product, U+2297 ISOamsb -->
+<!ENTITY perp     "&#8869;" ><!-- up tack = orthogonal to = perpendicular, U+22A5 ISOtech -->
+<!ENTITY sdot     "&#8901;" ><!-- dot operator, U+22C5 ISOamsb -->
+<!-- dot operator is NOT the same character as U+00B7 middle dot -->
+
+<!-- Miscellaneous Technical -->
+<!ENTITY lceil    "&#8968;" ><!-- left ceiling = apl upstile, U+2308 ISOamsc  -->
+<!ENTITY rceil    "&#8969;" ><!-- right ceiling, U+2309 ISOamsc  -->
+<!ENTITY lfloor   "&#8970;" ><!-- left floor = apl downstile, U+230A ISOamsc  -->
+<!ENTITY rfloor   "&#8971;" ><!-- right floor, U+230B ISOamsc  -->
+<!ENTITY lang     "&#9001;" ><!-- left-pointing angle bracket = bra, U+2329 ISOtech -->
+<!-- lang is NOT the same character as U+003C 'less than'
+     or U+2039 'single left-pointing angle quotation mark' -->
+<!ENTITY rang     "&#9002;" ><!-- right-pointing angle bracket = ket, U+232A ISOtech -->
+<!-- rang is NOT the same character as U+003E 'greater than'
+     or U+203A 'single right-pointing angle quotation mark' -->
+
+<!-- Geometric Shapes -->
+<!ENTITY loz      "&#9674;" ><!-- lozenge, U+25CA ISOpub -->
+
+<!-- Miscellaneous Symbols -->
+<!ENTITY spades   "&#9824;" ><!-- black spade suit, U+2660 ISOpub -->
+<!-- black here seems to mean filled as opposed to hollow -->
+<!ENTITY clubs    "&#9827;" ><!-- black club suit = shamrock, U+2663 ISOpub -->
+<!ENTITY hearts   "&#9829;" ><!-- black heart suit = valentine, U+2665 ISOpub -->
+<!ENTITY diams    "&#9830;" ><!-- black diamond suit, U+2666 ISOpub -->
+
+<!-- end of xhtml-symbol.ent -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-table-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-table-1.mod
new file mode 100644
index 0000000..3fc0360
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-table-1.mod
@@ -0,0 +1,333 @@
+<!-- ...................................................................... -->
+<!-- XHTML Table Module  .................................................. -->
+<!-- file: xhtml-table-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-table-1.mod,v 4.1 2001/04/10 09:42:30 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Tables 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-table-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Tables
+
+        table, caption, thead, tfoot, tbody, colgroup, col, tr, th, td
+
+     This module declares element types and attributes used to provide
+     table markup similar to HTML 4, including features that enable
+     better accessibility for non-visual user agents.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % table.qname  "table" >
+<!ENTITY % caption.qname  "caption" >
+<!ENTITY % thead.qname  "thead" >
+<!ENTITY % tfoot.qname  "tfoot" >
+<!ENTITY % tbody.qname  "tbody" >
+<!ENTITY % colgroup.qname  "colgroup" >
+<!ENTITY % col.qname  "col" >
+<!ENTITY % tr.qname  "tr" >
+<!ENTITY % th.qname  "th" >
+<!ENTITY % td.qname  "td" >
+
+<!-- The frame attribute specifies which parts of the frame around
+     the table should be rendered. The values are not the same as
+     CALS to avoid a name clash with the valign attribute.
+-->
+<!ENTITY % frame.attrib
+     "frame        ( void
+                   | above
+                   | below
+                   | hsides
+                   | lhs
+                   | rhs
+                   | vsides
+                   | box
+                   | border )               #IMPLIED"
+>
+
+<!-- The rules attribute defines which rules to draw between cells:
+
+     If rules is absent then assume:
+
+       "none" if border is absent or border="0" otherwise "all"
+-->
+<!ENTITY % rules.attrib
+     "rules        ( none
+                   | groups
+                   | rows
+                   | cols
+                   | all )                  #IMPLIED"
+>
+
+<!-- horizontal alignment attributes for cell contents
+-->
+<!ENTITY % CellHAlign.attrib
+     "align        ( left
+                   | center
+                   | right
+                   | justify
+                   | char )                 #IMPLIED
+      char         %Character.datatype;     #IMPLIED
+      charoff      %Length.datatype;        #IMPLIED"
+>
+
+<!-- vertical alignment attribute for cell contents
+-->
+<!ENTITY % CellVAlign.attrib
+     "valign       ( top
+                   | middle
+                   | bottom
+                   | baseline )             #IMPLIED"
+>
+
+<!-- scope is simpler than axes attribute for common tables
+-->
+<!ENTITY % scope.attrib
+     "scope        ( row
+                   | col
+                   | rowgroup
+                   | colgroup )             #IMPLIED"
+>
+
+<!-- table: Table Element .............................. -->
+
+<!ENTITY % table.element  "INCLUDE" >
+<![%table.element;[
+<!ENTITY % table.content
+     "( %caption.qname;?, ( %col.qname;* | %colgroup.qname;* ),
+      (( %thead.qname;?, %tfoot.qname;?, %tbody.qname;+ ) | ( %tr.qname;+ )))"
+>
+<!ELEMENT %table.qname;  %table.content; >
+<!-- end of table.element -->]]>
+
+<!ENTITY % table.attlist  "INCLUDE" >
+<![%table.attlist;[
+<!ATTLIST %table.qname;
+      %Common.attrib;
+      summary      %Text.datatype;          #IMPLIED
+      width        %Length.datatype;        #IMPLIED
+      border       %Pixels.datatype;        #IMPLIED
+      %frame.attrib;
+      %rules.attrib;
+      cellspacing  %Length.datatype;        #IMPLIED
+      cellpadding  %Length.datatype;        #IMPLIED
+>
+<!-- end of table.attlist -->]]>
+
+<!-- caption: Table Caption ............................ -->
+
+<!ENTITY % caption.element  "INCLUDE" >
+<![%caption.element;[
+<!ENTITY % caption.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %caption.qname;  %caption.content; >
+<!-- end of caption.element -->]]>
+
+<!ENTITY % caption.attlist  "INCLUDE" >
+<![%caption.attlist;[
+<!ATTLIST %caption.qname;
+      %Common.attrib;
+>
+<!-- end of caption.attlist -->]]>
+
+<!-- thead: Table Header ............................... -->
+
+<!-- Use thead to duplicate headers when breaking table
+     across page boundaries, or for static headers when
+     tbody sections are rendered in scrolling panel.
+-->
+
+<!ENTITY % thead.element  "INCLUDE" >
+<![%thead.element;[
+<!ENTITY % thead.content  "( %tr.qname; )+" >
+<!ELEMENT %thead.qname;  %thead.content; >
+<!-- end of thead.element -->]]>
+
+<!ENTITY % thead.attlist  "INCLUDE" >
+<![%thead.attlist;[
+<!ATTLIST %thead.qname;
+      %Common.attrib;
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of thead.attlist -->]]>
+
+<!-- tfoot: Table Footer ............................... -->
+
+<!-- Use tfoot to duplicate footers when breaking table
+     across page boundaries, or for static footers when
+     tbody sections are rendered in scrolling panel.
+-->
+
+<!ENTITY % tfoot.element  "INCLUDE" >
+<![%tfoot.element;[
+<!ENTITY % tfoot.content  "( %tr.qname; )+" >
+<!ELEMENT %tfoot.qname;  %tfoot.content; >
+<!-- end of tfoot.element -->]]>
+
+<!ENTITY % tfoot.attlist  "INCLUDE" >
+<![%tfoot.attlist;[
+<!ATTLIST %tfoot.qname;
+      %Common.attrib;
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of tfoot.attlist -->]]>
+
+<!-- tbody: Table Body ................................. -->
+
+<!-- Use multiple tbody sections when rules are needed
+     between groups of table rows.
+-->
+
+<!ENTITY % tbody.element  "INCLUDE" >
+<![%tbody.element;[
+<!ENTITY % tbody.content  "( %tr.qname; )+" >
+<!ELEMENT %tbody.qname;  %tbody.content; >
+<!-- end of tbody.element -->]]>
+
+<!ENTITY % tbody.attlist  "INCLUDE" >
+<![%tbody.attlist;[
+<!ATTLIST %tbody.qname;
+      %Common.attrib;
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of tbody.attlist -->]]>
+
+<!-- colgroup: Table Column Group ...................... -->
+
+<!-- colgroup groups a set of col elements. It allows you
+     to group several semantically-related columns together.
+-->
+
+<!ENTITY % colgroup.element  "INCLUDE" >
+<![%colgroup.element;[
+<!ENTITY % colgroup.content  "( %col.qname; )*" >
+<!ELEMENT %colgroup.qname;  %colgroup.content; >
+<!-- end of colgroup.element -->]]>
+
+<!ENTITY % colgroup.attlist  "INCLUDE" >
+<![%colgroup.attlist;[
+<!ATTLIST %colgroup.qname;
+      %Common.attrib;
+      span         %Number.datatype;        '1'
+      width        %MultiLength.datatype;   #IMPLIED
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of colgroup.attlist -->]]>
+
+<!-- col: Table Column ................................. -->
+
+<!-- col elements define the alignment properties for
+     cells in one or more columns.
+
+     The width attribute specifies the width of the
+     columns, e.g.
+
+       width="64"        width in screen pixels
+       width="0.5*"      relative width of 0.5
+
+     The span attribute causes the attributes of one
+     col element to apply to more than one column.
+-->
+
+<!ENTITY % col.element  "INCLUDE" >
+<![%col.element;[
+<!ENTITY % col.content  "EMPTY" >
+<!ELEMENT %col.qname;  %col.content; >
+<!-- end of col.element -->]]>
+
+<!ENTITY % col.attlist  "INCLUDE" >
+<![%col.attlist;[
+<!ATTLIST %col.qname;
+      %Common.attrib;
+      span         %Number.datatype;        '1'
+      width        %MultiLength.datatype;   #IMPLIED
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of col.attlist -->]]>
+
+<!-- tr: Table Row ..................................... -->
+
+<!ENTITY % tr.element  "INCLUDE" >
+<![%tr.element;[
+<!ENTITY % tr.content  "( %th.qname; | %td.qname; )+" >
+<!ELEMENT %tr.qname;  %tr.content; >
+<!-- end of tr.element -->]]>
+
+<!ENTITY % tr.attlist  "INCLUDE" >
+<![%tr.attlist;[
+<!ATTLIST %tr.qname;
+      %Common.attrib;
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of tr.attlist -->]]>
+
+<!-- th: Table Header Cell ............................. -->
+
+<!-- th is for header cells, td for data,
+     but for cells acting as both use td
+-->
+
+<!ENTITY % th.element  "INCLUDE" >
+<![%th.element;[
+<!ENTITY % th.content
+     "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %th.qname;  %th.content; >
+<!-- end of th.element -->]]>
+
+<!ENTITY % th.attlist  "INCLUDE" >
+<![%th.attlist;[
+<!ATTLIST %th.qname;
+      %Common.attrib;
+      abbr         %Text.datatype;          #IMPLIED
+      axis         CDATA                    #IMPLIED
+      headers      IDREFS                   #IMPLIED
+      %scope.attrib;
+      rowspan      %Number.datatype;        '1'
+      colspan      %Number.datatype;        '1'
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of th.attlist -->]]>
+
+<!-- td: Table Data Cell ............................... -->
+
+<!ENTITY % td.element  "INCLUDE" >
+<![%td.element;[
+<!ENTITY % td.content
+     "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %td.qname;  %td.content; >
+<!-- end of td.element -->]]>
+
+<!ENTITY % td.attlist  "INCLUDE" >
+<![%td.attlist;[
+<!ATTLIST %td.qname;
+      %Common.attrib;
+      abbr         %Text.datatype;          #IMPLIED
+      axis         CDATA                    #IMPLIED
+      headers      IDREFS                   #IMPLIED
+      %scope.attrib;
+      rowspan      %Number.datatype;        '1'
+      colspan      %Number.datatype;        '1'
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of td.attlist -->]]>
+
+<!-- end of xhtml-table-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-target-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-target-1.mod
new file mode 100644
index 0000000..3739ef1
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-target-1.mod
@@ -0,0 +1,53 @@
+<!-- ...................................................................... -->
+<!-- XHTML Target Module  ................................................. -->
+<!-- file: xhtml-target-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-target-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Target 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-target-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Target 
+
+        target
+
+     This module declares the 'target' attribute used for opening windows
+-->
+
+<!-- render in this frame --> 
+<!ENTITY % FrameTarget.datatype "CDATA" >
+
+<!-- add 'target' attribute to 'a' element -->
+<!ATTLIST %a.qname;
+      target       %FrameTarget.datatype;   #IMPLIED
+>
+
+<!-- add 'target' attribute to 'area' element -->
+<!ATTLIST %area.qname;
+      target       %FrameTarget.datatype;   #IMPLIED
+>
+
+<!-- add 'target' attribute to 'link' element -->
+<!ATTLIST %link.qname;
+      target       %FrameTarget.datatype;   #IMPLIED
+>
+
+<!-- add 'target' attribute to 'form' element -->
+<!ATTLIST %form.qname;
+      target       %FrameTarget.datatype;   #IMPLIED
+>
+
+<!-- add 'target' attribute to 'base' element -->
+<!ATTLIST %base.qname;
+      target       %FrameTarget.datatype;   #IMPLIED
+>
+
+<!-- end of xhtml-target-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml-text-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml-text-1.mod
new file mode 100644
index 0000000..07ccb81
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml-text-1.mod
@@ -0,0 +1,52 @@
+<!-- ...................................................................... -->
+<!-- XHTML Text Module  ................................................... -->
+<!-- file: xhtml-text-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-text-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-text-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Textual Content
+
+     The Text module includes declarations for all core
+     text container elements and their attributes.
+-->
+
+<!ENTITY % xhtml-inlstruct.module "INCLUDE" >
+<![%xhtml-inlstruct.module;[
+<!ENTITY % xhtml-inlstruct.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
+            "xhtml-inlstruct-1.mod" >
+%xhtml-inlstruct.mod;]]>
+
+<!ENTITY % xhtml-inlphras.module "INCLUDE" >
+<![%xhtml-inlphras.module;[
+<!ENTITY % xhtml-inlphras.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
+            "xhtml-inlphras-1.mod" >
+%xhtml-inlphras.mod;]]>
+
+<!ENTITY % xhtml-blkstruct.module "INCLUDE" >
+<![%xhtml-blkstruct.module;[
+<!ENTITY % xhtml-blkstruct.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
+            "xhtml-blkstruct-1.mod" >
+%xhtml-blkstruct.mod;]]>
+
+<!ENTITY % xhtml-blkphras.module "INCLUDE" >
+<![%xhtml-blkphras.module;[
+<!ENTITY % xhtml-blkphras.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
+            "xhtml-blkphras-1.mod" >
+%xhtml-blkphras.mod;]]>
+
+<!-- end of xhtml-text-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml11-model-1.mod b/xml/impl/resources/standardSchemas/xhtml11/xhtml11-model-1.mod
new file mode 100644
index 0000000..4d9fcd9
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml11-model-1.mod
@@ -0,0 +1,250 @@
+<!-- ....................................................................... -->
+<!-- XHTML 1.1 Document Model Module  ...................................... -->
+<!-- file: xhtml11-model-1.mod
+
+     This is XHTML 1.1, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2008 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml11-model-1.mod,v 1.16 2008/06/21 18:52:27 ahby Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML 1.1 Document Model 1.0//EN"
+       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml11-model-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- XHTML 1.1 Document Model
+
+     This module describes the groupings of elements that make up
+     common content models for XHTML elements.
+
+     XHTML has three basic content models:
+
+         %Inline.mix;  character-level elements
+         %Block.mix;   block-like elements, eg., paragraphs and lists
+         %Flow.mix;    any block or inline elements
+
+     Any parameter entities declared in this module may be used
+     to create element content models, but the above three are
+     considered 'global' (insofar as that term applies here).
+
+     The reserved word '#PCDATA' (indicating a text string) is now
+     included explicitly with each element declaration that is
+     declared as mixed content, as XML requires that this token
+     occur first in a content model specification.
+-->
+<!-- Extending the Model
+
+     While in some cases this module may need to be rewritten to
+     accommodate changes to the document model, minor extensions
+     may be accomplished by redeclaring any of the three *.extra;
+     parameter entities to contain extension element types as follows:
+
+         %Misc.extra;    whose parent may be any block or
+                         inline element.
+
+         %Inline.extra;  whose parent may be any inline element.
+
+         %Block.extra;   whose parent may be any block element.
+
+     If used, these parameter entities must be an OR-separated
+     list beginning with an OR separator ("|"), eg., "| a | b | c"
+
+     All block and inline *.class parameter entities not part
+     of the *struct.class classes begin with "| " to allow for
+     exclusion from mixes.
+-->
+
+<!-- ..............  Optional Elements in head  .................. -->
+
+<!ENTITY % HeadOpts.mix
+     "( %script.qname; | %style.qname; | %meta.qname;
+      | %link.qname; | %object.qname; )*"
+>
+
+<!-- .................  Miscellaneous Elements  .................. -->
+
+<!-- ins and del are used to denote editing changes
+-->
+<!ENTITY % Edit.class "| %ins.qname; | %del.qname;" >
+
+<!-- script and noscript are used to contain scripts
+     and alternative content
+-->
+<!ENTITY % Script.class "| %script.qname; | %noscript.qname;" >
+
+<!ENTITY % Misc.extra "" >
+
+<!-- These elements are neither block nor inline, and can
+     essentially be used anywhere in the document body.
+-->
+<!ENTITY % Misc.class
+     "%Edit.class;
+      %Script.class;
+      %Misc.extra;"
+>
+
+<!-- ....................  Inline Elements  ...................... -->
+
+<!ENTITY % InlStruct.class "%br.qname; | %span.qname;" >
+
+<!ENTITY % InlPhras.class
+     "| %em.qname; | %strong.qname; | %dfn.qname; | %code.qname;
+      | %samp.qname; | %kbd.qname; | %var.qname; | %cite.qname;
+      | %abbr.qname; | %acronym.qname; | %q.qname;" >
+
+<!ENTITY % InlPres.class
+     "| %tt.qname; | %i.qname; | %b.qname; | %big.qname;
+      | %small.qname; | %sub.qname; | %sup.qname;" >
+
+<!ENTITY % I18n.class "| %bdo.qname;" >
+
+<!ENTITY % Anchor.class "| %a.qname;" >
+
+<!ENTITY % InlSpecial.class
+     "| %img.qname; | %map.qname;
+      | %object.qname;" >
+
+<!ENTITY % InlForm.class
+     "| %input.qname; | %select.qname; | %textarea.qname;
+      | %label.qname; | %button.qname;" >
+
+<!ENTITY % Inline.extra "" >
+
+<!ENTITY % Ruby.class "| %ruby.qname;" >
+
+<!-- %Inline.class; includes all inline elements,
+     used as a component in mixes
+-->
+<!ENTITY % Inline.class
+     "%InlStruct.class;
+      %InlPhras.class;
+      %InlPres.class;
+      %I18n.class;
+      %Anchor.class;
+      %InlSpecial.class;
+      %InlForm.class;
+      %Ruby.class;
+      %Inline.extra;"
+>
+
+<!-- %InlNoRuby.class; includes all inline elements
+     except ruby, used as a component in mixes
+-->
+<!ENTITY % InlNoRuby.class
+     "%InlStruct.class;
+      %InlPhras.class;
+      %InlPres.class;
+      %I18n.class;
+      %Anchor.class;
+      %InlSpecial.class;
+      %InlForm.class;
+      %Inline.extra;"
+>
+
+<!-- %NoRuby.content; includes all inlines except ruby
+-->
+<!ENTITY % NoRuby.content
+     "( #PCDATA
+      | %InlNoRuby.class;
+      %Misc.class; )*"
+>
+
+<!-- %InlNoAnchor.class; includes all non-anchor inlines,
+     used as a component in mixes
+-->
+<!ENTITY % InlNoAnchor.class
+     "%InlStruct.class;
+      %InlPhras.class;
+      %InlPres.class;
+      %I18n.class;
+      %InlSpecial.class;
+      %InlForm.class;
+      %Ruby.class;
+      %Inline.extra;"
+>
+
+<!-- %InlNoAnchor.mix; includes all non-anchor inlines
+-->
+<!ENTITY % InlNoAnchor.mix
+     "%InlNoAnchor.class;
+      %Misc.class;"
+>
+
+<!-- %Inline.mix; includes all inline elements, including %Misc.class;
+-->
+<!ENTITY % Inline.mix
+     "%Inline.class;
+      %Misc.class;"
+>
+
+<!-- .....................  Block Elements  ...................... -->
+
+<!-- In the HTML 4.0 DTD, heading and list elements were included
+     in the %block; parameter entity. The %Heading.class; and
+     %List.class; parameter entities must now be included explicitly
+     on element declarations where desired.
+-->
+
+<!ENTITY % Heading.class
+     "%h1.qname; | %h2.qname; | %h3.qname;
+      | %h4.qname; | %h5.qname; | %h6.qname;" >
+
+<!ENTITY % List.class "%ul.qname; | %ol.qname; | %dl.qname;" >
+
+<!ENTITY % Table.class "| %table.qname;" >
+
+<!ENTITY % Form.class  "| %form.qname;" >
+
+<!ENTITY % Fieldset.class  "| %fieldset.qname;" >
+
+<!ENTITY % BlkStruct.class "%p.qname; | %div.qname;" >
+
+<!ENTITY % BlkPhras.class
+     "| %pre.qname; | %blockquote.qname; | %address.qname;" >
+
+<!ENTITY % BlkPres.class "| %hr.qname;" >
+
+<!ENTITY % BlkSpecial.class
+     "%Table.class;
+      %Form.class;
+      %Fieldset.class;"
+>
+
+<!ENTITY % Block.extra "" >
+
+<!-- %Block.class; includes all block elements,
+     used as an component in mixes
+-->
+<!ENTITY % Block.class
+     "%BlkStruct.class;
+      %BlkPhras.class;
+      %BlkPres.class;
+      %BlkSpecial.class;
+      %Block.extra;"
+>
+
+<!-- %Block.mix; includes all block elements plus %Misc.class;
+-->
+<!ENTITY % Block.mix
+     "%Heading.class;
+      | %List.class;
+      | %Block.class;
+      %Misc.class;"
+>
+
+<!-- ................  All Content Elements  .................. -->
+
+<!-- %Flow.mix; includes all text content, block and inline
+-->
+<!ENTITY % Flow.mix
+     "%Heading.class;
+      | %List.class;
+      | %Block.class;
+      | %Inline.class;
+      %Misc.class;"
+>
+
+<!-- end of xhtml11-model-1.mod -->
diff --git a/xml/impl/resources/standardSchemas/xhtml11/xhtml11.dtd b/xml/impl/resources/standardSchemas/xhtml11/xhtml11.dtd
new file mode 100644
index 0000000..bc67157
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xhtml11/xhtml11.dtd
@@ -0,0 +1,317 @@
+<!-- ....................................................................... -->
+<!-- XHTML 1.1 DTD  ........................................................ -->
+<!-- file: xhtml11.dtd
+-->
+
+<!-- XHTML 1.1 DTD
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+
+     The Extensible HyperText Markup Language (XHTML)
+     Copyright 1998-2007 World Wide Web Consortium
+        (Massachusetts Institute of Technology, European Research Consortium
+         for Informatics and Mathematics, Keio University).
+         All Rights Reserved.
+
+     Permission to use, copy, modify and distribute the XHTML DTD and its 
+     accompanying documentation for any purpose and without fee is hereby 
+     granted in perpetuity, provided that the above copyright notice and 
+     this paragraph appear in all copies.  The copyright holders make no 
+     representation about the suitability of the DTD for any purpose.
+
+     It is provided "as is" without expressed or implied warranty.
+
+        Author:     Murray M. Altheim <[email protected]>
+        Revision:   $Id: xhtml11.dtd,v 1.1 2007/02/15 23:14:56 jean-gui Exp $
+
+-->
+<!-- This is the driver file for version 1.1 of the XHTML DTD.
+
+     Please use this public identifier to identify it:
+
+         "-//W3C//DTD XHTML 1.1//EN"
+-->
+<!ENTITY % XHTML.version  "-//W3C//DTD XHTML 1.1//EN" >
+
+<!-- Use this URI to identify the default namespace:
+
+         "http://www.w3.org/1999/xhtml"
+
+     See the Qualified Names module for information
+     on the use of namespace prefixes in the DTD.
+
+	 Note that XHTML namespace elements are not prefixed by default,
+	 but the XHTML namespace prefix is defined as "xhtml" so that
+	 other markup languages can extend this one and use the XHTML
+	 prefixed global attributes if required.
+
+-->
+<!ENTITY % NS.prefixed "IGNORE" >
+<!ENTITY % XHTML.prefix "xhtml" >
+
+<!-- Be sure to include prefixed global attributes - we don't need
+     them, but languages that extend XHTML 1.1 might.
+-->
+<!ENTITY % XHTML.global.attrs.prefixed "INCLUDE" >
+
+<!-- Reserved for use with the XLink namespace:
+-->
+<!ENTITY % XLINK.xmlns "" >
+<!ENTITY % XLINK.xmlns.attrib "" >
+
+<!-- For example, if you are using XHTML 1.1 directly, use the public
+     identifier in the DOCTYPE declaration, with the namespace declaration
+     on the document element to identify the default namespace:
+
+       <?xml version="1.0"?>
+       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+                             "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+       <html xmlns="http://www.w3.org/1999/xhtml"
+             xml:lang="en">
+       ...
+       </html>
+
+     Revisions:
+     (none)
+-->
+
+<!-- reserved for future use with document profiles -->
+<!ENTITY % XHTML.profile  "" >
+
+<!-- ensure XHTML Notations are disabled -->
+<!ENTITY % xhtml-notations.module "IGNORE" >
+
+<!-- Bidirectional Text features
+     This feature-test entity is used to declare elements
+     and attributes used for bidirectional text support.
+-->
+<!ENTITY % XHTML.bidi  "INCLUDE" >
+
+<!--<?doc type="doctype" role="title" { XHTML 1.1 } ?>-->
+
+<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
+
+<!-- Pre-Framework Redeclaration placeholder  .................... -->
+<!-- this serves as a location to insert markup declarations
+     into the DTD prior to the framework declarations.
+-->
+<!ENTITY % xhtml-prefw-redecl.module "IGNORE" >
+<![%xhtml-prefw-redecl.module;[
+%xhtml-prefw-redecl.mod;
+<!-- end of xhtml-prefw-redecl.module -->]]>
+
+<!ENTITY % xhtml-events.module "INCLUDE" >
+
+<!-- Inline Style Module  ........................................ -->
+<!ENTITY % xhtml-inlstyle.module "INCLUDE" >
+<![%xhtml-inlstyle.module;[
+<!ENTITY % xhtml-inlstyle.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Inline Style 1.0//EN"
+            "xhtml-inlstyle-1.mod" >
+%xhtml-inlstyle.mod;]]>
+
+<!-- declare Document Model module instantiated in framework
+-->
+<!ENTITY % xhtml-model.mod
+     PUBLIC "-//W3C//ENTITIES XHTML 1.1 Document Model 1.0//EN"
+            "xhtml11-model-1.mod" >
+
+<!-- Modular Framework Module (required) ......................... -->
+<!ENTITY % xhtml-framework.module "INCLUDE" >
+<![%xhtml-framework.module;[
+<!ENTITY % xhtml-framework.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
+            "xhtml-framework-1.mod" >
+%xhtml-framework.mod;]]>
+
+<!-- Post-Framework Redeclaration placeholder  ................... -->
+<!-- this serves as a location to insert markup declarations
+     into the DTD following the framework declarations.
+-->
+<!ENTITY % xhtml-postfw-redecl.module "IGNORE" >
+<![%xhtml-postfw-redecl.module;[
+%xhtml-postfw-redecl.mod;
+<!-- end of xhtml-postfw-redecl.module -->]]>
+
+<!-- Text Module (Required)  ..................................... -->
+<!ENTITY % xhtml-text.module "INCLUDE" >
+<![%xhtml-text.module;[
+<!ENTITY % xhtml-text.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
+            "xhtml-text-1.mod" >
+%xhtml-text.mod;]]>
+
+<!-- Hypertext Module (required) ................................. -->
+<!ENTITY % xhtml-hypertext.module "INCLUDE" >
+<![%xhtml-hypertext.module;[
+<!ENTITY % xhtml-hypertext.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
+            "xhtml-hypertext-1.mod" >
+%xhtml-hypertext.mod;]]>
+
+<!-- Lists Module (required)  .................................... -->
+<!ENTITY % xhtml-list.module "INCLUDE" >
+<![%xhtml-list.module;[
+<!ENTITY % xhtml-list.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
+            "xhtml-list-1.mod" >
+%xhtml-list.mod;]]>
+
+<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
+
+<!-- Edit Module  ................................................ -->
+<!ENTITY % xhtml-edit.module "INCLUDE" >
+<![%xhtml-edit.module;[
+<!ENTITY % xhtml-edit.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Editing Elements 1.0//EN"
+            "xhtml-edit-1.mod" >
+%xhtml-edit.mod;]]>
+
+<!-- BIDI Override Module  ....................................... -->
+<!ENTITY % xhtml-bdo.module "%XHTML.bidi;" >
+<![%xhtml-bdo.module;[
+<!ENTITY % xhtml-bdo.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML BIDI Override Element 1.0//EN"
+            "xhtml-bdo-1.mod" >
+%xhtml-bdo.mod;]]>
+
+<!-- Ruby Module  ................................................ -->
+<!ENTITY % Ruby.common.attlists "INCLUDE" >
+<!ENTITY % Ruby.common.attrib "%Common.attrib;" >
+<!ENTITY % xhtml-ruby.module "INCLUDE" >
+<![%xhtml-ruby.module;[
+<!ENTITY % xhtml-ruby.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Ruby 1.0//EN"
+            "xhtml-ruby-1.mod" >
+%xhtml-ruby.mod;]]>
+
+<!-- Presentation Module  ........................................ -->
+<!ENTITY % xhtml-pres.module "INCLUDE" >
+<![%xhtml-pres.module;[
+<!ENTITY % xhtml-pres.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Presentation 1.0//EN"
+            "xhtml-pres-1.mod" >
+%xhtml-pres.mod;]]>
+
+<!-- Link Element Module  ........................................ -->
+<!ENTITY % xhtml-link.module "INCLUDE" >
+<![%xhtml-link.module;[
+<!ENTITY % xhtml-link.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
+            "xhtml-link-1.mod" >
+%xhtml-link.mod;]]>
+
+<!-- Document Metainformation Module  ............................ -->
+<!ENTITY % xhtml-meta.module "INCLUDE" >
+<![%xhtml-meta.module;[
+<!ENTITY % xhtml-meta.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
+            "xhtml-meta-1.mod" >
+%xhtml-meta.mod;]]>
+
+<!-- Base Element Module  ........................................ -->
+<!ENTITY % xhtml-base.module "INCLUDE" >
+<![%xhtml-base.module;[
+<!ENTITY % xhtml-base.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
+            "xhtml-base-1.mod" >
+%xhtml-base.mod;]]>
+
+<!-- Scripting Module  ........................................... -->
+<!ENTITY % xhtml-script.module "INCLUDE" >
+<![%xhtml-script.module;[
+<!ENTITY % xhtml-script.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN"
+            "xhtml-script-1.mod" >
+%xhtml-script.mod;]]>
+
+<!-- Style Sheets Module  ......................................... -->
+<!ENTITY % xhtml-style.module "INCLUDE" >
+<![%xhtml-style.module;[
+<!ENTITY % xhtml-style.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN"
+            "xhtml-style-1.mod" >
+%xhtml-style.mod;]]>
+
+<!-- Image Module  ............................................... -->
+<!ENTITY % xhtml-image.module "INCLUDE" >
+<![%xhtml-image.module;[
+<!ENTITY % xhtml-image.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
+            "xhtml-image-1.mod" >
+%xhtml-image.mod;]]>
+
+<!-- Client-side Image Map Module  ............................... -->
+<!ENTITY % xhtml-csismap.module "INCLUDE" >
+<![%xhtml-csismap.module;[
+<!ENTITY % xhtml-csismap.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Client-side Image Maps 1.0//EN"
+            "xhtml-csismap-1.mod" >
+%xhtml-csismap.mod;]]>
+
+<!-- Server-side Image Map Module  ............................... -->
+<!ENTITY % xhtml-ssismap.module "INCLUDE" >
+<![%xhtml-ssismap.module;[
+<!ENTITY % xhtml-ssismap.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Server-side Image Maps 1.0//EN"
+            "xhtml-ssismap-1.mod" >
+%xhtml-ssismap.mod;]]>
+
+<!-- Param Element Module  ....................................... -->
+<!ENTITY % xhtml-param.module "INCLUDE" >
+<![%xhtml-param.module;[
+<!ENTITY % xhtml-param.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
+            "xhtml-param-1.mod" >
+%xhtml-param.mod;]]>
+
+<!-- Embedded Object Module  ..................................... -->
+<!ENTITY % xhtml-object.module "INCLUDE" >
+<![%xhtml-object.module;[
+<!ENTITY % xhtml-object.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
+            "xhtml-object-1.mod" >
+%xhtml-object.mod;]]>
+
+<!-- Tables Module ............................................... -->
+<!ENTITY % xhtml-table.module "INCLUDE" >
+<![%xhtml-table.module;[
+<!ENTITY % xhtml-table.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Tables 1.0//EN"
+            "xhtml-table-1.mod" >
+%xhtml-table.mod;]]>
+
+<!-- Forms Module  ............................................... -->
+<!ENTITY % xhtml-form.module "INCLUDE" >
+<![%xhtml-form.module;[
+<!ENTITY % xhtml-form.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN"
+            "xhtml-form-1.mod" >
+%xhtml-form.mod;]]>
+
+<!-- Target Attribute Module  .................................... -->
+<!ENTITY % xhtml-target.module "INCLUDE" >
+<![%xhtml-target.module;[
+<!ENTITY % xhtml-target.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Target 1.0//EN"
+            "xhtml-target-1.mod" >
+%xhtml-target.mod;]]>
+
+<!-- Legacy Markup ............................................... -->
+<!ENTITY % xhtml-legacy.module "IGNORE" >
+<![%xhtml-legacy.module;[
+<!ENTITY % xhtml-legacy.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Legacy Markup 1.0//EN"
+            "xhtml-legacy-1.mod" >
+%xhtml-legacy.mod;]]>
+
+<!-- Document Structure Module (required)  ....................... -->
+<!ENTITY % xhtml-struct.module "INCLUDE" >
+<![%xhtml-struct.module;[
+<!ENTITY % xhtml-struct.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
+            "xhtml-struct-1.mod" >
+%xhtml-struct.mod;]]>
+
+<!-- end of XHTML 1.1 DTD  ................................................. -->
+<!-- ....................................................................... -->
diff --git a/xml/impl/resources/standardSchemas/xinclude.xsd b/xml/impl/resources/standardSchemas/xinclude.xsd
new file mode 100644
index 0000000..c0e0a0b
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/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/xml/impl/resources/standardSchemas/xml.xsd b/xml/impl/resources/standardSchemas/xml.xsd
new file mode 100644
index 0000000..47c929f
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xml.xsd
@@ -0,0 +1,145 @@
+<?xml version='1.0'?>
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+
+ <xs:annotation>
+  <xs:documentation>
+   See http://www.w3.org/XML/1998/namespace.html and
+   http://www.w3.org/TR/REC-xml for information about this namespace.
+
+    This schema document describes the XML namespace, in a form
+    suitable for import by other schema documents.
+
+    Note that local names in this namespace are intended to be defined
+    only by the World Wide Web Consortium or its subgroups.  The
+    following names are currently defined in this namespace and should
+    not be used with conflicting semantics by any Working Group,
+    specification, or document instance:
+
+    base (as an attribute name): denotes an attribute whose value
+         provides a URI to be used as the base for interpreting any
+         relative URIs in the scope of the element on which it
+         appears; its value is inherited.  This name is reserved
+         by virtue of its definition in the XML Base specification.
+
+    id   (as an attribute name): denotes an attribute whose value
+         should be interpreted as if declared to be of type ID.
+         This name is reserved by virtue of its definition in the
+         xml:id specification.
+
+    lang (as an attribute name): denotes an attribute whose value
+         is a language code for the natural language of the content of
+         any element; its value is inherited.  This name is reserved
+         by virtue of its definition in the XML specification.
+
+    space (as an attribute name): denotes an attribute whose
+         value is a keyword indicating what whitespace processing
+         discipline is intended for the content of the element; its
+         value is inherited.  This name is reserved by virtue of its
+         definition in the XML specification.
+
+    Father (in any context at all): denotes Jon Bosak, the chair of
+         the original XML Working Group.  This name is reserved by
+         the following decision of the W3C XML Plenary and
+         XML Coordination groups:
+
+             In appreciation for his vision, leadership and dedication
+             the W3C XML Plenary on this 10th day of February, 2000
+             reserves for Jon Bosak in perpetuity the XML name
+             xml:Father
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+  <xs:documentation>This schema defines attributes and an attribute group
+        suitable for use by
+        schemas wishing to allow xml:base, xml:lang, xml:space or xml:id
+        attributes on elements they define.
+
+        To enable this, such a schema must import this schema
+        for the XML namespace, e.g. as follows:
+        &lt;schema . . .>
+         . . .
+         &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+                    schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+
+        Subsequently, qualified reference to any of the attributes
+        or the group defined below will have the desired effect, e.g.
+
+        &lt;type . . .>
+         . . .
+         &lt;attributeGroup ref="xml:specialAttrs"/>
+
+         will define a type which will schema-validate an instance
+         element with any of those attributes</xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+  <xs:documentation>In keeping with the XML Schema WG's standard versioning
+   policy, this schema document will persist at
+   http://www.w3.org/2007/08/xml.xsd.
+   At the date of issue it can also be found at
+   http://www.w3.org/2001/xml.xsd.
+   The schema document at that URI may however change in the future,
+   in order to remain compatible with the latest version of XML Schema
+   itself, or with the XML namespace itself.  In other words, if the XML
+   Schema or XML namespaces change, the version of this document at
+   http://www.w3.org/2001/xml.xsd will change
+   accordingly; the version at
+   http://www.w3.org/2007/08/xml.xsd will not change.
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:attribute name="lang">
+  <xs:annotation>
+   <xs:documentation>Attempting to install the relevant ISO 2- and 3-letter
+         codes as the enumerated possible values is probably never
+         going to be a realistic possibility.  See
+         RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry
+         at http://www.iana.org/assignments/lang-tag-apps.htm for
+         further information.
+
+         The union allows for the 'un-declaration' of xml:lang with
+         the empty string.</xs:documentation>
+  </xs:annotation>
+  <xs:simpleType>
+   <xs:union memberTypes="xs:language">
+    <xs:simpleType>
+     <xs:restriction base="xs:string">
+      <xs:enumeration value=""/>
+     </xs:restriction>
+    </xs:simpleType>
+   </xs:union>
+  </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="space">
+  <xs:simpleType>
+   <xs:restriction base="xs:NCName">
+    <xs:enumeration value="default"/>
+    <xs:enumeration value="preserve"/>
+   </xs:restriction>
+  </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="base" type="xs:anyURI">
+  <xs:annotation>
+   <xs:documentation>See http://www.w3.org/TR/xmlbase/ for
+                     information about this attribute.</xs:documentation>
+  </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="id" type="xs:ID">
+  <xs:annotation>
+   <xs:documentation>See http://www.w3.org/TR/xml-id/ for
+                     information about this attribute.</xs:documentation>
+  </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+  <xs:attribute ref="xml:base"/>
+  <xs:attribute ref="xml:lang"/>
+  <xs:attribute ref="xml:space"/>
+  <xs:attribute ref="xml:id"/>
+ </xs:attributeGroup>
+
+</xs:schema>
diff --git a/xml/impl/resources/standardSchemas/xslt-1_0.xsd b/xml/impl/resources/standardSchemas/xslt-1_0.xsd
new file mode 100644
index 0000000..f805b2c
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xslt-1_0.xsd
@@ -0,0 +1,1244 @@
+<?xml version="1.0" ?>
+
+<!--
+
+This is an updated version of the XSLT schema originally published by WebMethods
+in March 2001. This version complies with the current W3C XML Schema
+recommendation. To use this schema, start you stylesheet with:
+
+    <xsl:stylesheet version="1.0"
+            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="http://www.w3.org/1999/XSL/Transform http://www.orbeon.com/1999/XSL/Transform">
+
+If you have any question or comment, please feel free to contact us:
+
+    Orbeon, Inc.
+    http://www.orbeon.com/
+    [email protected]
+
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+DISCLAIMER OF WARRANTY
+
+THIS CODE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
+THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A
+PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY
+AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED
+CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL
+DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
+SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY
+CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED
+CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+LIMITATION OF LIABILITY
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY
+INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK
+STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY
+SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM
+SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH
+LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF
+INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION
+MAY NOT APPLY TO YOU.
+
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+This free of charge Software is provided on an "AS IS" basis, without
+warranty of any kind. The entire risk as to the quality and performance of
+the software is borne by you. Should the software prove defective, you and
+only you assume the entire cost of any service and repair.
+
+WEBMETHODS DOES NOT MAKE ANY EXPRESS OR IMPLIED WARRANTIES OF ANY KIND
+INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF TITLE, MERCHANTABILITY OR
+FITNESS FOR A PARTICULAR PURPOSE, OR WARRANTIES ARISING BY STATUTE, COURSE
+OF DEALING, CUSTOM OR USAGE, TRADE PRACTICE OR OTHERWISE.
+
+IN NO EVENT WILL WEBMETHODS BE LIABLE FOR ANY LOST REVENUES, PROFITS,
+BUSINESS OR INTERRUPTION OF BUSINESS OR OTHER SPECIAL, INDIRECT, INCIDENTAL
+OR CONSEQUENTIAL DAMAGES, EVEN IF WEBMETHODS HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES, AND NOTWITHSTANDING ANY FAILURE OF ESSENTIAL
+PURPOSE OF ANY LIMITED REMEDY OF ANY KIND, HOWEVER CAUSED AND UNDER ANY
+THEORY OF LIABILITY.
+
+
+
+
+
+
+
+Schema for XSLT 1.0 Recommendation, http://www.w3.org/TR/1999/REC-xslt-19991116
+Using XML Schema CR Drafts,
+
+- Part 1, http://www.w3.org/TR/2000/CR-xmlschema-1-20001024/
+- Part 2, http://www.w3.org/TR/2000/CR-xmlschema-2-20001024/
+
+Author: Asir S Vedamuthu
+Member, XML Schema WG representing webMethods, Inc.
+Member, XML Schema Processor design and implementation team at webMethods
+
+webMethods, Inc.
+3930 Pender Drive
+Fairfax VA 22030
+
+(703) 450-2500
+
+Date - February 28th, 2001
+Version - 0.4
+
+This work is a product of the W3C XML Schema WG Task Force for authoring schema
+for W3C Recommendations as an illustration of the XML Schema Language. This schema
+is illustrative and non-normative. Internal names created by this schema follows the
+same convention used by XSLT 1.0 specification.
+
+Comments were stolen from the XSLT 1.0 specification,
+    http://www.w3.org/TR/1999/REC-xslt-19991116#element-syntax-summary
+
+Asir intends to update this schema as the XML Schema drafts advance from CR to
+PR and then REC. Expected changes are,
+
+[1] XML Schema Namespace URI
+[2] Change attribute declaration syntax
+
+
+KNOWN ISSUES,
+
+(a) XML Schema Definition Language cannot capture a unique wild card expression in XSLT: "In addition, the xsl:stylesheet element may contain any element not from the XSLT namespace, provided that the expanded-name of the element has a non-null namespace URI" - http://www.w3.org/TR/1999/REC-xslt-19991116#stylesheet-element (This will not be an issue as per XML Schema PR)
+
+
+Revision History
+
+0.1 - Created
+0.2 - Fixed minor typos
+0.3 - Implemented suggestions and added fragments from James Clark
+0.4 - Fixed a minor typo
+
+Acknowledgement
+
+The following have contributed material to this draft:
+
+- James Clark, [email protected]
+
+
+Please send your comments and suggestions to [email protected]
+
+
+-->
+
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd"
+        targetNamespace="http://www.w3.org/1999/XSL/Transform"
+        elementFormDefault="qualified">
+
+
+  <import namespace="http://www.w3.org/XML/1998/namespace"
+          schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+  <!--<import namespace="http://www.w3.org/2001/XMLSchema" />-->
+
+
+
+  <!-- *** import schema for xpath
+         authored by C. M. Sperberg-McQueen [[email protected]]
+         Chair, XML Schema WG
+
+  <import namespace="http://www.w3.org/TR/2001/WD-xptr-20010108/"
+      schemaLocation="xpath.xsd"/>
+  -->
+
+
+  <!-- *** result elements *** -->
+  <!-- ***                  *** -->
+
+  <!--     There are three ways that you can construct a
+          schema for XSLT stylesheets that create instances of a
+          particular result structure
+
+          (a)    Declare all your result elements as a member of
+              xsl:result-element substitution group
+
+          (b) Redefine model group xsl:result-element to accomodate
+              the desired structure
+
+          (c)    Do nothing. This schema is designed to allow any element node
+              or nodes if they have any namespace other than the XSLT
+              namespace or not namespace qualified
+
+          I recommend (a) or (b)
+
+          In addition, I added a an attributeGroup util, 'result-element'
+          for your convenience
+
+  -->
+
+  <element name="result-element" abstract="true" type="anyType"/>
+
+
+  <attributeGroup name="result-element">
+    <attribute name="extension-element-prefixes" form="qualified" type="string"/>
+    <attribute name="exclude-result-prefixes" form="qualified" type="string"/>
+    <attribute name="use-attribute-sets" form="qualified" type="xsl:QNames"/>
+    <attribute name="version" form="qualified" type="NMTOKEN"/>
+    <anyAttribute namespace="##other" processContents="skip"/>
+  </attributeGroup>
+
+
+  <group name="result-element">
+    <choice>
+      <element ref="xsl:result-element"/>
+      <any namespace="##other" processContents="skip"/>
+      <any namespace="##local" processContents="skip"/>
+    </choice>
+  </group>
+
+
+
+
+
+  <!-- *** Style Sheet Elements *** -->
+  <!-- ***                       *** -->
+
+
+  <element name="stylesheet" type="xsl:wrapper"/>
+  <element name="transform" type="xsl:wrapper"/>
+
+  <complexType name="wrapper">
+    <complexContent>
+      <extension base="xsl:anyType">
+        <sequence>
+          <element ref="xsl:import" minOccurs="0" maxOccurs="unbounded"/>
+          <choice  minOccurs="0" maxOccurs="unbounded">
+            <element ref="xsl:top-level-element"/>
+            <element ref="xsl:variable"/>
+            <any namespace="##other" processContents="skip"/> <!-- weaker than XSLT 1.0 -->
+          </choice>
+        </sequence>
+        <attribute name="id" type="ID"/>
+        <attribute name="extension-element-prefixes" type="xsl:tokens"/>
+        <attribute name="exclude-result-prefixes" type="xsl:tokens"/>
+        <attribute name="version" type="decimal" use="required"/>
+        <attribute ref="xml:space"/>
+      </extension>
+    </complexContent>
+  </complexType>
+
+
+
+
+
+
+  <!-- *** top level elements *** -->
+  <!-- ***                    *** -->
+
+
+  <element name="top-level-element" type="xsl:anyType" abstract="true"/>
+  <element name="top-level-element-and-char-instruction" type="xsl:anyType" abstract="true"/>
+
+  <element name="attribute-set" substitutionGroup="xsl:top-level-element">
+
+    <!-- ***
+
+    <xsl:attribute-set
+      name = qname
+      use-attribute-sets = qnames>
+      Content: xsl:attribute*
+    </xsl:attribute-set>
+
+    -->
+
+    <complexType>
+      <complexContent>
+        <extension base="xsl:anyType">
+          <sequence minOccurs="0" maxOccurs="unbounded">
+            <element ref="xsl:attribute"/>
+          </sequence>
+          <attributeGroup ref="xsl:name"/>
+          <attributeGroup ref="xsl:use-attribute-sets"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="decimal-format" substitutionGroup="xsl:top-level-element">
+
+    <!-- ***
+
+   <xsl:decimal-format
+     name = qname
+     decimal-separator = char
+     grouping-separator = char
+     infinity = string
+     minus-sign = char
+     NaN = string
+     percent = char
+     per-mille = char
+     zero-digit = char
+     digit = char
+     pattern-separator = char />
+
+    -->
+
+    <complexType>
+      <complexContent>
+        <extension base="xsl:anyType">
+          <attribute name="name" type="xsl:QName"/>
+          <attribute name="decimal-separator" type="string" use="optional" default="."/>
+          <attribute name="grouping-separator" type="string" use="optional" default=","/>
+          <attribute name="infinity" type="string" use="optional" default="Infinity"/>
+          <attribute name="minus-sign" type="string" use="optional" default="-"/>
+          <attribute name="NaN" type="string" use="optional" default="NaN"/>
+          <attribute name="percent" type="string" use="optional" default="%"/>
+          <attribute name="per-mille" type="string" use="optional" default="&#x2030;"/>
+          <attribute name="zero-digit" type="string" use="optional" default="0"/>
+          <attribute name="digit" type="string" use="optional" default="#"/>
+          <attribute name="pattern-separator" type="string" use="optional" default=";"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="include" substitutionGroup="xsl:top-level-element" type="xsl:combine-stylesheets">
+
+    <!-- ***
+
+        <xsl:include
+          href = uri-reference />
+
+    -->
+
+  </element>
+
+
+  <element name="key" substitutionGroup="xsl:top-level-element">
+
+    <!-- ***
+
+        <xsl:key
+          name = qname
+          match = pattern
+            use = expression />
+
+    -->
+
+    <complexType>
+      <complexContent>
+        <extension base="xsl:anyType">
+          <attributeGroup ref="xsl:name"/>
+          <attribute name="match" type="xsl:pattern" use="required"/>
+          <attribute name="use" type="xsl:expression" use="required"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="namespace-alias" substitutionGroup="xsl:top-level-element">
+
+    <!-- ***
+
+    -->
+
+    <complexType>
+      <complexContent>
+        <extension base="xsl:anyType">
+          <attribute name="stylesheet-prefix" type="xsl:prefix" use="required"/>
+          <attribute name="result-prefix" type="xsl:prefix" use="required"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="output" substitutionGroup="xsl:top-level-element">
+
+    <!-- ***
+
+        <xsl:output
+          method = "xml" | "html" | "text" | qname-but-not-ncname
+          version = nmtoken
+          encoding = string
+          omit-xml-declaration = "yes" | "no"
+          standalone = "yes" | "no"
+          doctype-public = string
+          doctype-system = string
+          cdata-section-elements = qnames
+          indent = "yes" | "no"
+          media-type = string />
+
+    -->
+
+    <complexType>
+
+      <complexContent>
+        <extension base="xsl:anyType">
+          <attribute name="method">
+            <simpleType>
+              <union>
+                <simpleType>
+                  <restriction base="string">
+                    <enumeration value="xml"/>
+                    <enumeration value="html"/>
+                    <enumeration value="text"/>
+                  </restriction>
+                </simpleType>
+                <simpleType>
+                  <restriction base="xsl:QName">
+                    <pattern value="\c*:\c*"/>
+                  </restriction>
+                </simpleType>
+              </union>
+            </simpleType>
+          </attribute>
+
+          <attribute name="version" type="NMTOKEN"/>
+          <attribute name="encoding" type="string"/>
+          <attribute name="omit-xml-declaration" type="xsl:YesOrNo"/>
+          <attribute name="standalone" type="xsl:YesOrNo"/>
+          <attribute name="doctype-public" type="string"/>
+          <attribute name="doctype-system" type="string"/>
+          <attribute name="cdata-section-elements" type="xsl:QNames"/>
+          <attribute name="indent" type="xsl:YesOrNo"/>
+          <attribute name="media-type" type="string"/>
+        </extension>
+      </complexContent>
+
+    </complexType>
+
+  </element>
+
+
+  <element name="param" substitutionGroup="xsl:top-level-element" type="xsl:variable">
+
+    <!-- ***
+
+        <xsl:param
+          name = qname
+          select = expression>
+          Content: template
+        </xsl:param>
+
+    -->
+
+  </element>
+
+
+  <element name="preserve-space" substitutionGroup="xsl:top-level-element" type="xsl:preserve-space">
+
+    <!-- ***
+
+        <xsl:preserve-space
+          elements = tokens />
+
+    -->
+  </element>
+
+  <complexType name="preserve-space">
+    <complexContent>
+      <extension base="xsl:anyType">
+        <attribute name="elements" type="xsl:element-names" use="required"/>
+      </extension>
+    </complexContent>
+  </complexType>
+
+  <element name="strip-space" substitutionGroup="xsl:preserve-space" type="xsl:preserve-space"/>
+
+
+  <element name="template" substitutionGroup="xsl:top-level-element">
+
+    <!-- ***
+
+        <xsl:template
+          match = pattern
+          name = qname
+          priority = number
+          mode = qname>
+          Content: (xsl:param*, template)
+        </xsl:template>
+
+    -->
+
+    <complexType mixed="true">
+
+      <complexContent>
+        <extension base="xsl:anyType">
+          <sequence>
+            <element ref="xsl:param" minOccurs="0" maxOccurs="unbounded"/>
+            <choice minOccurs="0" maxOccurs="unbounded">
+              <element ref="xsl:top-level-element-and-char-instruction"/>
+              <element ref="xsl:instruction"/>
+              <group ref="xsl:result-element"/>
+            </choice>
+          </sequence>
+          <attribute name="match" type="xsl:pattern"/>
+          <attribute name="name" type="xsl:QName"/>
+          <attribute name="priority" type="decimal"/>
+          <attribute name="mode" type="xsl:QName"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+
+    </complexType>
+
+  </element>
+
+
+  <!-- *** top level elements and char instructions *** -->
+  <!-- ***                                          *** -->
+
+
+  <element name="variable" type="xsl:variable" substitutionGroup="xsl:char-instruction">
+
+    <!-- ***
+
+        <xsl:variable
+          name = qname
+          select = expression>
+          Content: template
+        </xsl:variable>
+
+    -->
+
+  </element>
+
+
+
+
+  <!-- *** instructions *** -->
+  <!-- ***               *** -->
+
+
+  <element name="instruction" type="xsl:anyType" abstract="true"/>
+
+  <element name="char-instruction" type="xsl:anyType" abstract="true"
+           substitutionGroup="xsl:instruction"/>
+
+  <element name="apply-imports" type="xsl:anyType" substitutionGroup="xsl:char-instruction">
+
+    <!-- ***
+
+        <xsl:apply-imports />
+
+    -->
+
+  </element>
+
+
+  <element name="apply-templates" substitutionGroup="xsl:char-instruction">
+
+
+    <!-- ***
+
+    <xsl:apply-templates
+      select = node-set-expression
+      mode = qname>
+      Content: (xsl:sort | xsl:with-param)*
+    </xsl:apply-templates>
+
+    -->
+
+    <complexType>
+
+      <complexContent>
+        <extension base="xsl:anyType">
+          <choice minOccurs="0" maxOccurs="unbounded">
+            <element ref="xsl:sort"/>
+            <element ref="xsl:with-param"/>
+          </choice>
+          <attribute name="select" type="xsl:expression" use="optional" default="node()"/>
+          <attribute name="mode" type="xsl:QName"/>
+        </extension>
+      </complexContent>
+
+    </complexType>
+
+  </element>
+
+
+  <element name="attribute" type="xsl:attribute-type" substitutionGroup="xsl:instruction"/>
+
+
+  <element name="call-template" substitutionGroup="xsl:char-instruction">
+
+    <!-- ***
+
+    <xsl:call-template
+      name = qname>
+      Content: xsl:with-param*
+    </xsl:call-template>
+
+    -->
+
+    <complexType>
+      <complexContent>
+        <extension base="xsl:anyType">
+          <sequence minOccurs="0" maxOccurs="unbounded">
+            <element ref="xsl:with-param"/>
+          </sequence>
+          <attributeGroup ref="xsl:name"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="choose" substitutionGroup="xsl:char-instruction">
+
+
+    <!-- ***
+
+        <xsl:choose>
+          Content: (xsl:when+, xsl:otherwise?)
+        </xsl:choose>
+
+    -->
+
+    <complexType>
+      <complexContent>
+        <extension base="xsl:anyType">
+          <sequence>
+            <element ref="xsl:when" minOccurs="1" maxOccurs="unbounded"/>
+            <element ref="xsl:otherwise" minOccurs="0"/>
+          </sequence>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+  <element name="comment" substitutionGroup="xsl:instruction">
+
+    <!-- ***
+
+        <xsl:comment>
+          Content: template
+        </xsl:comment>
+
+    -->
+
+    <complexType mixed="true">
+      <complexContent>
+        <extension base="xsl:anyType">
+          <choice minOccurs="0" maxOccurs="unbounded">
+            <element ref="xsl:char-instruction"/>
+            <element ref="xsl:top-level-element-and-char-instruction"/>
+          </choice>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="copy" substitutionGroup="xsl:char-instruction">
+
+    <!-- ***
+
+    <xsl:copy
+      use-attribute-sets = qnames>
+      Content: template
+    </xsl:copy>
+
+    -->
+
+    <complexType mixed="true">
+      <complexContent>
+        <extension base="xsl:anyType">
+          <group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+          <attribute ref="xml:space"/>
+          <attributeGroup ref="xsl:use-attribute-sets"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="copy-of" substitutionGroup="xsl:char-instruction">
+
+    <!-- ***
+
+        <xsl:copy-of
+          select = expression />
+
+    -->
+
+    <complexType mixed="true">
+      <complexContent>
+        <extension base="xsl:anyType">
+          <attributeGroup ref="xsl:select-required"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="element" substitutionGroup="xsl:instruction">
+
+    <!-- ***
+
+        <xsl:element
+          name = { qname }
+          namespace = { uri-reference }
+          use-attribute-sets = qnames>
+          Content: template
+        </xsl:element>
+    -->
+
+    <complexType mixed="true">
+      <complexContent>
+        <extension base="xsl:anyType">
+          <group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+          <attributeGroup ref="xsl:name-avt"/>
+          <attribute name="namespace" type="xsl:expr-avt"/>
+          <attributeGroup ref="xsl:use-attribute-sets"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="fallback" substitutionGroup="xsl:char-instruction">
+
+    <!-- ***
+
+        <xsl:fallback>
+          Content: template
+        </xsl:fallback>
+
+    -->
+
+    <complexType mixed="true">
+      <complexContent>
+        <extension base="xsl:anyType">
+          <group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="for-each" substitutionGroup="xsl:char-instruction">
+
+    <!-- ***
+
+        <xsl:for-each
+          select = node-set-expression>
+          Content: (xsl:sort*, template)
+        </xsl:for-each>
+
+    -->
+
+    <complexType mixed="true">
+      <complexContent>
+        <extension base="xsl:anyType">
+          <sequence>
+            <element ref="xsl:sort" minOccurs="0" maxOccurs="unbounded"/>
+            <choice minOccurs="0" maxOccurs="unbounded">
+              <element ref="xsl:top-level-element-and-char-instruction"/>
+              <element ref="xsl:instruction"/>
+              <group ref="xsl:result-element"/>
+            </choice>
+          </sequence>
+          <attributeGroup ref="xsl:select-required"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+  <element name="if" substitutionGroup="xsl:char-instruction">
+
+    <!-- ***
+
+        <xsl:if
+          test = boolean-expression>
+          Content: template
+        </xsl:if>
+
+    -->
+
+    <complexType mixed="true">
+      <complexContent>
+        <extension base="xsl:anyType">
+          <group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+          <attribute name="test" type="xsl:expression" use="required"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="message" substitutionGroup="xsl:char-instruction">
+
+    <!-- ***
+
+        <xsl:message
+          terminate = "yes" | "no">
+          Content: template
+        </xsl:message>
+
+    -->
+
+    <complexType mixed="true">
+
+      <complexContent>
+        <extension base="xsl:anyType">
+          <group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+          <attribute ref="xml:space"/>
+          <attribute name="terminate" use="optional" default="no" type="xsl:YesOrNo"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="number" substitutionGroup="xsl:char-instruction">
+
+    <!-- ***
+
+        <xsl:number
+          level = "single" | "multiple" | "any"
+          count = pattern
+          from = pattern
+          value = number-expression
+          format = { string }
+          lang = { nmtoken }
+          letter-value = { "alphabetic" | "traditional" }
+          grouping-separator = { char }
+            grouping-size = { number } />
+
+    -->
+
+    <complexType>
+
+      <complexContent>
+        <extension base="xsl:anyType">
+          <attribute name="level" use="optional" default="single">
+            <simpleType>
+              <restriction base="NMTOKEN">
+                <enumeration value="single"/>
+                <enumeration value="multiple"/>
+                <enumeration value="any"/>
+              </restriction>
+            </simpleType>
+          </attribute>
+
+          <attribute name="count" type="xsl:pattern"/>
+          <attribute name="from" type="xsl:pattern"/>
+          <attribute name="value" type="xsl:expression"/>
+          <attribute name="format" type="xsl:expr-avt" use="optional" default="1"/>
+          <attribute name="lang" type="xsl:expr-avt"/>
+          <attribute name="letter-value" type="xsl:expr-avt"/>
+          <attribute name="grouping-separator" type="xsl:expr-avt"/>
+          <attribute name="grouping-size" type="xsl:expr-avt"/>
+        </extension>
+      </complexContent>
+
+    </complexType>
+
+  </element>
+
+
+  <element name="processing-instruction" substitutionGroup="xsl:instruction">
+
+    <!-- ***
+
+        <xsl:processing-instruction
+          name = { ncname }>
+          Content: template
+        </xsl:processing-instruction>
+
+    -->
+
+    <complexType mixed="true">
+
+      <complexContent>
+        <extension base="xsl:anyType">
+          <choice minOccurs="0" maxOccurs="unbounded">
+            <element ref="xsl:char-instruction"/>
+            <element ref="xsl:top-level-element-and-char-instruction"/>
+          </choice>
+          <attributeGroup ref="xsl:name-avt"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="text" substitutionGroup="xsl:char-instruction">
+
+    <!-- ***
+
+        <xsl:text
+          disable-output-escaping = "yes" | "no">
+          Content: #PCDATA
+        </xsl:text>
+
+    -->
+
+    <complexType mixed="true">
+      <complexContent>
+        <extension base="xsl:anyType">
+          <attributeGroup ref="xsl:disable-output-escaping"/>
+          <attribute ref="xml:lang"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="value-of" substitutionGroup="xsl:char-instruction">
+
+    <!-- ***
+
+        <xsl:value-of
+          select = string-expression
+          disable-output-escaping = "yes" | "no" />
+
+    -->
+
+    <complexType>
+      <complexContent>
+        <extension base="xsl:anyType">
+          <attributeGroup ref="xsl:select-required"/>
+          <attributeGroup ref="xsl:disable-output-escaping"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+
+  <!-- *** orphans *** -->
+  <!-- ***          *** -->
+
+  <element name="import" type="xsl:combine-stylesheets">
+
+    <!-- ***
+
+      <xsl:import
+            href = uri-reference />
+    -->
+
+  </element>
+
+
+  <element name="otherwise">
+
+    <!-- ***
+
+        <xsl:otherwise>
+          Content: template
+        </xsl:otherwise>
+
+    -->
+
+    <complexType mixed="true">
+      <complexContent>
+        <extension base="xsl:anyType">
+          <group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="sort">
+
+    <!-- ***
+
+        xsl:sort
+          select = string-expression
+          lang = { nmtoken }
+          data-type = { "text" | "number" | qname-but-not-ncname }
+          order = { "ascending" | "descending" }
+          case-order = { "upper-first" | "lower-first" } />
+
+    -->
+
+    <complexType>
+      <complexContent>
+        <extension base="xsl:anyType">
+          <attribute name="select" type="xsl:expression" use="optional" default="."/>
+          <attribute name="lang" type="xsl:expr-avt"/>
+          <attribute name="data-type" use="optional" default="text">
+            <simpleType>
+              <union memberTypes="xsl:expr-avt">
+                <simpleType>
+                  <restriction base="string">
+                    <enumeration value="text" />
+                    <enumeration value="number" />
+                  </restriction>
+                </simpleType>
+              </union>
+            </simpleType>
+          </attribute>
+          <attribute name="order" use="optional" default="ascending">
+            <simpleType>
+              <union memberTypes="xsl:expr-avt">
+                <simpleType>
+                  <restriction base="string">
+                    <enumeration value="ascending" />
+                    <enumeration value="descending" />
+                  </restriction>
+                </simpleType>
+              </union>
+            </simpleType>
+          </attribute>
+          <attribute name="case-order">
+            <simpleType>
+              <union memberTypes="xsl:expr-avt">
+                <simpleType>
+                  <restriction base="string">
+                    <enumeration value="upper-first" />
+                    <enumeration value="lower-first" />
+                  </restriction>
+                </simpleType>
+              </union>
+            </simpleType>
+          </attribute>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="when">
+
+    <!-- ***
+        <xsl:when
+          test = boolean-expression>
+          Content: template
+        </xsl:when>
+    -->
+
+    <complexType mixed="true">
+      <complexContent>
+        <extension base="xsl:anyType">
+          <group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+          <attribute name="test" type="xsl:expression" use="required"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+
+  </element>
+
+
+  <element name="with-param" type="xsl:variable">
+
+    <!-- ***
+
+        <xsl:with-param
+          name = qname
+          select = expression>
+          Content: template
+        </xsl:with-param>
+    -->
+
+  </element>
+
+
+
+
+
+
+  <!-- *** utils - internal types and groups *** -->
+  <!-- *** not for public use                *** -->
+  <!-- ***                                   *** -->
+
+  <complexType name="attribute-type" mixed="true">
+
+    <!-- ***
+
+     <xsl:attribute
+       name = { qname }
+       namespace = { uri-reference }>
+       Content: template
+     </xsl:attribute>
+
+    -->
+    <complexContent>
+      <extension base="xsl:anyType">
+        <choice minOccurs="0" maxOccurs="unbounded">
+          <element ref="xsl:char-instruction"/>
+          <element ref="xsl:top-level-element-and-char-instruction"/>
+        </choice>
+
+        <attributeGroup ref="xsl:name-avt"/>
+        <attribute name="namespace" type="xsl:expr-avt"/>
+        <attribute ref="xml:space"/>
+      </extension>
+    </complexContent>
+
+  </complexType>
+
+
+  <simpleType name="tokens">
+    <list itemType="token"/>
+  </simpleType>
+
+  <simpleType name="QNames">
+    <list itemType="xsl:QName"/>
+  </simpleType>
+
+  <attributeGroup name="name">
+    <attribute name="name" type="xsl:QName" use="required"/>
+  </attributeGroup>
+
+  <attributeGroup name="name-avt">
+    <attribute name="name" type="xsl:expr-avt" use="required"/>
+  </attributeGroup>
+
+  <attributeGroup name="select-optional">
+    <attribute name="select" type="xsl:expression"/>
+  </attributeGroup>
+
+  <attributeGroup name="select-required">
+    <attribute name="select" type="xsl:expression" use="required"/>
+  </attributeGroup>
+
+  <attributeGroup name="use-attribute-sets">
+    <attribute name="use-attribute-sets" type="xsl:QNames"/>
+  </attributeGroup>
+
+
+
+
+  <group name="template">
+    <choice>
+      <element ref="xsl:top-level-element-and-char-instruction"/>
+      <element ref="xsl:instruction"/>
+      <group ref="xsl:result-element"/>
+    </choice>
+  </group>
+
+  <complexType name="combine-stylesheets">
+    <complexContent>
+      <extension base="xsl:anyType">
+        <attribute name="href" type="anyURI" use="required"/>
+      </extension>
+    </complexContent>
+  </complexType>
+
+  <simpleType name="YesOrNo">
+    <restriction base="string">
+      <enumeration value="yes"/>
+      <enumeration value="no"/>
+    </restriction>
+  </simpleType>
+
+  <simpleType name="QName">
+    <union memberTypes="NCName QName"/>
+  </simpleType>
+
+  <simpleType name="element-names">
+    <list>
+      <simpleType>
+        <union memberTypes="QName">
+          <simpleType>
+            <restriction base="string">
+              <pattern value="\*"/>
+              <pattern value="\i\c*:\*"/>
+            </restriction>
+          </simpleType>
+        </union>
+      </simpleType>
+    </list>
+  </simpleType>
+
+  <attributeGroup name="disable-output-escaping">
+    <attribute name="disable-output-escaping" type="xsl:YesOrNo"
+               use="optional" default="no"/>
+  </attributeGroup>
+
+  <complexType name="variable" mixed="true">
+    <complexContent>
+      <extension base="xsl:anyType">
+        <group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+        <attributeGroup ref="xsl:name"/>
+        <attributeGroup ref="xsl:select-optional"/>
+        <attribute name="as" use="optional" /> <!-- supported by Saxon XSLT Processor -->
+      </extension>
+    </complexContent>
+  </complexType>
+
+
+  <simpleType name="expr-avt">
+    <restriction base="string">
+      <!-- <pattern
+     value="([^\{\}]|\{\{|\}\})*\{([^&quot;'\{\}]|&quot;[^&quot;]*&quot;|'[^']*')+\}([^\{\}]|\{\{|\}\}|\{([^&quot;'\{\}]|&quot;[^&quot;]*&quot;|'[^']*')+\})*"/> -->
+    </restriction>
+  </simpleType>
+
+  <simpleType name="expression">
+    <restriction base="string">
+      <!-- ****
+
+      patterns go here
+
+      -->
+    </restriction>
+  </simpleType>
+
+  <simpleType name="pattern">
+    <restriction base="string">
+      <!-- ***
+
+      patterns go here
+
+      -->
+    </restriction>
+  </simpleType>
+
+  <simpleType name="prefix">
+    <union memberTypes="NCName">
+      <simpleType>
+        <restriction base="string">
+          <enumeration value="#default"/>
+        </restriction>
+      </simpleType>
+    </union>
+  </simpleType>
+
+
+  <complexType name="anyType">
+    <anyAttribute namespace="##other" processContents="skip"/>
+  </complexType>
+</schema>
diff --git a/xml/impl/resources/standardSchemas/xslt-2_0.xsd b/xml/impl/resources/standardSchemas/xslt-2_0.xsd
new file mode 100644
index 0000000..f268991
--- /dev/null
+++ b/xml/impl/resources/standardSchemas/xslt-2_0.xsd
@@ -0,0 +1,1152 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/1999/XSL/Transform" elementFormDefault="qualified" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<xs:annotation>
+  <xs:documentation>
+
+    This is a schema for XSLT 2.0 stylesheets.
+
+    It defines all the elements that appear in the XSLT namespace; it also
+    provides hooks that allow the inclusion of user-defined literal result elements,
+    extension instructions, and top-level data elements.
+
+    The schema is derived (with kind permission) from a schema for XSLT 1.0 stylesheets
+    produced by Asir S Vedamuthu of WebMethods Inc.
+
+    This schema is available for use under the conditions of the W3C Software License
+    published at http://www.w3.org/Consortium/Legal/copyright-software-19980720
+
+    The schema is organized as follows:
+
+    PART A: definitions of complex types and model groups used as the basis
+            for element definitions
+    PART B: definitions of individual XSLT elements
+    PART C: definitions for literal result elements
+    PART D: definitions of simple types used in attribute definitions
+
+    This schema does not attempt to define all the constraints that apply to a valid
+    XSLT 2.0 stylesheet module. It is the intention that all valid stylesheet modules
+    should conform to this schema; however, the schema is non-normative and in the event
+    of any conflict, the text of the Recommendation takes precedence.
+
+    This schema does not implement the special rules that apply when a stylesheet
+    has sections that use forwards-compatible-mode. In this mode, setting version="3.0"
+    allows elements from the XSLT namespace to be used that are not defined in XSLT 2.0.
+
+    Simplified stylesheets (those with a literal result element as the outermost element)
+    will validate against this schema only if validation starts in lax mode.
+
+    This version is dated 2005-02-11
+    Authors: Michael H Kay, Saxonica Limited
+             Jeni Tennison, Jeni Tennison Consulting Ltd.
+
+  </xs:documentation>
+</xs:annotation>
+<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<!--
+The declaration of xml:space and xml:lang may need to be commented out because
+of problems processing the schema using various tools
+-->
+
+<xs:import namespace="http://www.w3.org/XML/1998/namespace"
+  schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+
+<!--
+    An XSLT stylesheet may contain an in-line schema within an xsl:import-schema element,
+    so the Schema for schemas needs to be imported
+-->
+
+<xs:import namespace="http://www.w3.org/2001/XMLSchema"
+                  schemaLocation="http://www.w3.org/2001/XMLSchema.xsd"/>
+
+<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<xs:annotation>
+  <xs:documentation>
+    PART A: definitions of complex types and model groups used as the basis
+            for element definitions
+  </xs:documentation>
+</xs:annotation>
+<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<xs:complexType name="generic-element-type" mixed="true">
+  <xs:attribute name="default-collation" type="xsl:uri-list"/>
+  <xs:attribute name="exclude-result-prefixes" type="xsl:prefix-list-or-all"/>
+  <xs:attribute name="extension-element-prefixes" type="xsl:prefix-list"/>
+  <xs:attribute name="use-when" type="xsl:expression"/>
+  <xs:attribute name="xpath-default-namespace" type="xs:anyURI"/>
+  <xs:anyAttribute namespace="##other" processContents="lax"/>
+</xs:complexType>
+
+<xs:complexType name="versioned-element-type" mixed="true">
+  <xs:complexContent>
+    <xs:extension base="xsl:generic-element-type">
+      <xs:attribute name="version" type="xs:decimal" use="optional"/>
+    </xs:extension>
+  </xs:complexContent>
+</xs:complexType>
+
+<xs:complexType name="element-only-versioned-element-type" mixed="false">
+  <xs:complexContent>
+    <xs:restriction base="xsl:versioned-element-type">
+      <xs:anyAttribute namespace="##other" processContents="lax"/>
+    </xs:restriction>
+  </xs:complexContent>
+</xs:complexType>
+
+<xs:complexType name="sequence-constructor">
+  <xs:complexContent mixed="true">
+    <xs:extension base="xsl:versioned-element-type">
+      <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:extension>
+  </xs:complexContent>
+</xs:complexType>
+
+<xs:group name="sequence-constructor-group">
+  <xs:choice>
+    <xs:element ref="xsl:variable"/>
+    <xs:element ref="xsl:instruction"/>
+    <xs:group ref="xsl:result-elements"/>
+  </xs:choice>
+</xs:group>
+
+<xs:element name="declaration" type="xsl:generic-element-type" abstract="true"/>
+
+<xs:element name="instruction" type="xsl:versioned-element-type" abstract="true"/>
+
+<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<xs:annotation>
+  <xs:documentation>
+    PART B: definitions of individual XSLT elements
+    Elements are listed in alphabetical order.
+  </xs:documentation>
+</xs:annotation>
+<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<xs:element name="analyze-string" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:sequence>
+          <xs:element ref="xsl:matching-substring" minOccurs="0"/>
+          <xs:element ref="xsl:non-matching-substring" minOccurs="0"/>
+          <xs:element ref="xsl:fallback" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+        <xs:attribute name="select" type="xsl:expression" use="required"/>
+        <xs:attribute name="regex" type="xsl:avt" use="required"/>
+        <xs:attribute name="flags" type="xsl:avt" default=""/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="apply-imports" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:sequence>
+          <xs:element ref="xsl:with-param" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="apply-templates" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="xsl:sort"/>
+          <xs:element ref="xsl:with-param"/>
+        </xs:choice>
+        <xs:attribute name="select" type="xsl:expression" default="child::node()"/>
+        <xs:attribute name="mode" type="xsl:mode"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="attribute" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="name" type="xsl:avt" use="required"/>
+        <xs:attribute name="namespace" type="xsl:avt"/>
+        <xs:attribute name="select" type="xsl:expression"/>
+        <xs:attribute name="separator" type="xsl:avt"/>
+        <xs:attribute name="type" type="xsl:QName"/>
+        <xs:attribute name="validation" type="xsl:validation-type"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="attribute-set" substitutionGroup="xsl:declaration">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="xsl:attribute"/>
+        </xs:sequence>
+        <xs:attribute name="name" type="xsl:QName" use="required"/>
+        <xs:attribute name="use-attribute-sets" type="xsl:QNames" default=""/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="call-template" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:sequence>
+          <xs:element ref="xsl:with-param" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+        <xs:attribute name="name" type="xsl:QName" use="required"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="character-map" substitutionGroup="xsl:declaration">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:sequence>
+          <xs:element ref="xsl:output-character" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+        <xs:attribute name="name" type="xsl:QName" use="required"/>
+        <xs:attribute name="use-character-maps" type="xsl:QNames" default=""/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="choose" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:sequence>
+          <xs:element ref="xsl:when" maxOccurs="unbounded"/>
+          <xs:element ref="xsl:otherwise" minOccurs="0"/>
+        </xs:sequence>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="comment" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="select" type="xsl:expression"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="copy" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="copy-namespaces" type="xsl:yes-or-no" default="yes"/>
+        <xs:attribute name="inherit-namespaces" type="xsl:yes-or-no" default="yes"/>
+        <xs:attribute name="use-attribute-sets" type="xsl:QNames" default=""/>
+        <xs:attribute name="type" type="xsl:QName"/>
+        <xs:attribute name="validation" type="xsl:validation-type"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="copy-of" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:versioned-element-type">
+        <xs:attribute name="select" type="xsl:expression" use="required"/>
+        <xs:attribute name="copy-namespaces" type="xsl:yes-or-no" default="yes"/>
+        <xs:attribute name="type" type="xsl:QName"/>
+        <xs:attribute name="validation" type="xsl:validation-type"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="decimal-format" substitutionGroup="xsl:declaration">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:attribute name="name" type="xsl:QName"/>
+        <xs:attribute name="decimal-separator" type="xsl:char" default="."/>
+        <xs:attribute name="grouping-separator" type="xsl:char" default=","/>
+        <xs:attribute name="infinity" type="xs:string" default="Infinity"/>
+        <xs:attribute name="minus-sign" type="xsl:char" default="-"/>
+        <xs:attribute name="NaN" type="xs:string" default="NaN"/>
+        <xs:attribute name="percent" type="xsl:char" default="%"/>
+        <xs:attribute name="per-mille" type="xsl:char" default="&#x2030;"/>
+        <xs:attribute name="zero-digit" type="xsl:char" default="0"/>
+        <xs:attribute name="digit" type="xsl:char" default="#"/>
+        <xs:attribute name="pattern-separator" type="xsl:char" default=";"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="element" substitutionGroup="xsl:instruction">
+  <xs:complexType mixed="true">
+    <xs:complexContent>
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="name" type="xsl:avt" use="required"/>
+        <xs:attribute name="namespace" type="xsl:avt"/>
+        <xs:attribute name="inherit-namespaces" type="xsl:yes-or-no" default="yes"/>
+        <xs:attribute name="use-attribute-sets" type="xsl:QNames" default=""/>
+        <xs:attribute name="type" type="xsl:QName"/>
+        <xs:attribute name="validation" type="xsl:validation-type"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="fallback" substitutionGroup="xsl:instruction" type="xsl:sequence-constructor"/>
+
+<xs:element name="for-each" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:versioned-element-type">
+        <xs:sequence>
+          <xs:element ref="xsl:sort" minOccurs="0" maxOccurs="unbounded"/>
+          <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+        <xs:attribute name="select" type="xsl:expression" use="required"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="for-each-group" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:versioned-element-type">
+        <xs:sequence>
+          <xs:element ref="xsl:sort" minOccurs="0" maxOccurs="unbounded"/>
+          <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+        <xs:attribute name="select" type="xsl:expression" use="required"/>
+        <xs:attribute name="group-by" type="xsl:expression"/>
+        <xs:attribute name="group-adjacent" type="xsl:expression"/>
+        <xs:attribute name="group-starting-with" type="xsl:pattern"/>
+        <xs:attribute name="group-ending-with" type="xsl:pattern"/>
+        <xs:attribute name="collation" type="xs:anyURI"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="function" substitutionGroup="xsl:declaration">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:versioned-element-type">
+        <xs:sequence>
+          <xs:element ref="xsl:param" minOccurs="0" maxOccurs="unbounded"/>
+          <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+        <xs:attribute name="name" type="xsl:QName" use="required"/>
+        <xs:attribute name="override" type="xsl:yes-or-no" default="yes"/>
+        <xs:attribute name="as" type="xsl:sequence-type" default="item()*"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="if" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="test" type="xsl:expression" use="required"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="import">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:attribute name="href" type="xs:anyURI" use="required"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="import-schema" substitutionGroup="xsl:declaration">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:sequence>
+          <xs:element ref="xs:schema" minOccurs="0" maxOccurs="1"/>
+        </xs:sequence>
+        <xs:attribute name="namespace" type="xs:anyURI"/>
+        <xs:attribute name="schema-location" type="xs:anyURI"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="include" substitutionGroup="xsl:declaration">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="xsl:element-only-versioned-element-type">
+          <xs:attribute name="href" type="xs:anyURI" use="required"/>
+        </xs:extension>
+      </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="key" substitutionGroup="xsl:declaration">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="name" type="xsl:QName" use="required"/>
+        <xs:attribute name="match" type="xsl:pattern" use="required"/>
+        <xs:attribute name="use" type="xsl:expression"/>
+        <xs:attribute name="collation" type="xs:anyURI"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="matching-substring" type="xsl:sequence-constructor"/>
+
+<xs:element name="message" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="select" type="xsl:expression"/>
+        <xs:attribute name="terminate" type="xsl:avt" default="no"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="namespace" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="name" type="xsl:avt" use="required"/>
+        <xs:attribute name="select" type="xsl:expression"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="namespace-alias" substitutionGroup="xsl:declaration">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:attribute name="stylesheet-prefix" type="xsl:prefix-or-default" use="required"/>
+        <xs:attribute name="result-prefix" type="xsl:prefix-or-default" use="required"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="next-match" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="xsl:with-param"/>
+          <xs:element ref="xsl:fallback"/>
+        </xs:choice>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="non-matching-substring" type="xsl:sequence-constructor"/>
+
+<xs:element name="number" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:versioned-element-type">
+        <xs:attribute name="value" type="xsl:expression"/>
+        <xs:attribute name="select" type="xsl:expression"/>
+        <xs:attribute name="level" type="xsl:level" default="single"/>
+        <xs:attribute name="count" type="xsl:pattern"/>
+        <xs:attribute name="from" type="xsl:pattern"/>
+        <xs:attribute name="format" type="xsl:avt" default="1"/>
+        <xs:attribute name="lang" type="xsl:avt"/>
+        <xs:attribute name="letter-value" type="xsl:avt"/>
+        <xs:attribute name="ordinal" type="xsl:avt"/>
+        <xs:attribute name="grouping-separator" type="xsl:avt"/>
+        <xs:attribute name="grouping-size" type="xsl:avt"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="otherwise" type="xsl:sequence-constructor"/>
+
+<xs:element name="output" substitutionGroup="xsl:declaration">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:generic-element-type">
+        <xs:attribute name="name" type="xsl:QName"/>
+        <xs:attribute name="method" type="xsl:method"/>
+        <xs:attribute name="byte-order-mark" type="xsl:yes-or-no"/>
+        <xs:attribute name="cdata-section-elements" type="xsl:QNames"/>
+        <xs:attribute name="doctype-public" type="xs:string"/>
+        <xs:attribute name="doctype-system" type="xs:string"/>
+        <xs:attribute name="encoding" type="xs:string"/>
+        <xs:attribute name="escape-uri-attributes" type="xsl:yes-or-no"/>
+        <xs:attribute name="include-content-type" type="xsl:yes-or-no"/>
+        <xs:attribute name="indent" type="xsl:yes-or-no"/>
+        <xs:attribute name="media-type" type="xs:string"/>
+        <xs:attribute name="normalization-form" type="xs:NMTOKEN"/>
+        <xs:attribute name="omit-xml-declaration" type="xsl:yes-or-no"/>
+        <xs:attribute name="standalone" type="xsl:yes-or-no-or-omit"/>
+        <xs:attribute name="undeclare-prefixes" type="xsl:yes-or-no"/>
+        <xs:attribute name="use-character-maps" type="xsl:QNames"/>
+        <xs:attribute name="version" type="xs:NMTOKEN"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="output-character">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:attribute name="character" type="xsl:char" use="required"/>
+        <xs:attribute name="string" type="xs:string" use="required"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="param">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="name" type="xsl:QName" use="required"/>
+        <xs:attribute name="select" type="xsl:expression"/>
+        <xs:attribute name="as" type="xsl:sequence-type"/>
+        <xs:attribute name="required" type="xsl:yes-or-no"/>
+        <xs:attribute name="tunnel" type="xsl:yes-or-no"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="perform-sort" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:versioned-element-type">
+        <xs:sequence>
+          <xs:element ref="xsl:sort" minOccurs="1" maxOccurs="unbounded"/>
+          <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+        <xs:attribute name="select" type="xsl:expression"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="preserve-space" substitutionGroup="xsl:declaration">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:attribute name="elements" type="xsl:nametests" use="required"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="processing-instruction" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="name" type="xsl:avt" use="required"/>
+        <xs:attribute name="select" type="xsl:expression"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="result-document" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="format" type="xsl:avt"/>
+        <xs:attribute name="href" type="xsl:avt"/>
+        <xs:attribute name="type" type="xsl:QName"/>
+        <xs:attribute name="validation" type="xsl:validation-type"/>
+        <xs:attribute name="method" type="xsl:avt"/>
+        <xs:attribute name="byte-order-mark" type="xsl:avt"/>
+        <xs:attribute name="cdata-section-elements" type="xsl:avt"/>
+        <xs:attribute name="doctype-public" type="xsl:avt"/>
+        <xs:attribute name="doctype-system" type="xsl:avt"/>
+        <xs:attribute name="encoding" type="xsl:avt"/>
+        <xs:attribute name="escape-uri-attributes" type="xsl:avt"/>
+        <xs:attribute name="include-content-type" type="xsl:avt"/>
+        <xs:attribute name="indent" type="xsl:avt"/>
+        <xs:attribute name="media-type" type="xsl:avt"/>
+        <xs:attribute name="normalization-form" type="xsl:avt"/>
+        <xs:attribute name="omit-xml-declaration" type="xsl:avt"/>
+        <xs:attribute name="standalone" type="xsl:avt"/>
+        <xs:attribute name="undeclare-prefixes" type="xsl:avt"/>
+        <xs:attribute name="use-character-maps" type="xsl:QNames"/>
+        <xs:attribute name="output-version" type="xsl:avt"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="sequence" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="select" type="xsl:expression"/>
+        <xs:attribute name="as" type="xsl:sequence-type"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="sort">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="select" type="xsl:expression"/>
+        <xs:attribute name="lang" type="xsl:avt"/>
+        <xs:attribute name="data-type" default="text">
+          <xs:simpleType>
+            <xs:union memberTypes="xsl:avt">
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:enumeration value="text" />
+                  <xs:enumeration value="number" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:union>
+          </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute name="order" default="ascending">
+          <xs:simpleType>
+            <xs:union memberTypes="xsl:avt">
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:enumeration value="ascending" />
+                  <xs:enumeration value="descending" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:union>
+          </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute name="case-order">
+          <xs:simpleType>
+            <xs:union memberTypes="xsl:avt">
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:enumeration value="upp-first" />
+                  <xs:enumeration value="lower-first" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:union>
+          </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute name="collation" type="xsl:avt"/>
+        <xs:attribute name="stable" type="xsl:yes-or-no"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="strip-space" substitutionGroup="xsl:declaration">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:element-only-versioned-element-type">
+        <xs:attribute name="elements" type="xsl:nametests" use="required"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="stylesheet" substitutionGroup="xsl:transform"/>
+
+<xs:element name="template" substitutionGroup="xsl:declaration">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:versioned-element-type">
+        <xs:sequence>
+          <xs:element ref="xsl:param" minOccurs="0" maxOccurs="unbounded"/>
+          <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+        <xs:attribute name="match" type="xsl:pattern"/>
+        <xs:attribute name="priority" type="xs:decimal"/>
+        <xs:attribute name="mode" type="xsl:modes"/>
+        <xs:attribute name="name" type="xsl:QName"/>
+        <xs:attribute name="as" type="xsl:sequence-type" default="item()*"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:complexType name="text-element-base-type">
+  <xs:simpleContent>
+    <xs:restriction base="xsl:versioned-element-type">
+      <xs:simpleType>
+        <xs:restriction base="xs:string"/>
+      </xs:simpleType>
+      <xs:anyAttribute namespace="##other" processContents="lax"/>
+    </xs:restriction>
+  </xs:simpleContent>
+</xs:complexType>
+
+<xs:element name="text" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:simpleContent>
+      <xs:extension base="xsl:text-element-base-type">
+        <xs:attribute name="disable-output-escaping" type="xsl:yes-or-no" default="no"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:complexType name="transform-element-base-type">
+  <xs:complexContent>
+    <xs:restriction base="xsl:element-only-versioned-element-type">
+      <xs:attribute name="version" type="xs:decimal" use="required"/>
+      <xs:anyAttribute namespace="##other" processContents="lax"/>
+    </xs:restriction>
+  </xs:complexContent>
+</xs:complexType>
+
+<xs:element name="transform">
+  <xs:complexType>
+    <xs:complexContent>
+      <xs:extension base="xsl:transform-element-base-type">
+        <xs:sequence>
+          <xs:element ref="xsl:import" minOccurs="0" maxOccurs="unbounded"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="xsl:declaration"/>
+            <xs:element ref="xsl:variable"/>
+            <xs:element ref="xsl:param"/>
+            <xs:any namespace="##other" processContents="lax"/> <!-- weaker than XSLT 1.0 -->
+          </xs:choice>
+        </xs:sequence>
+        <xs:attribute name="id" type="xs:ID"/>
+        <xs:attribute name="default-validation" type="xsl:validation-strip-or-preserve" default="strip"/>
+        <xs:attribute name="input-type-annotations" type="xsl:input-type-annotations-type" default="unspecified"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="value-of" substitutionGroup="xsl:instruction">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="select" type="xsl:expression"/>
+        <xs:attribute name="separator" type="xsl:avt"/>
+        <xs:attribute name="disable-output-escaping" type="xsl:yes-or-no" default="no"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="variable">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="name" type="xsl:QName" use="required"/>
+        <xs:attribute name="select" type="xsl:expression" use="optional"/>
+        <xs:attribute name="as" type="xsl:sequence-type" use="optional"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="when">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="test" type="xsl:expression" use="required"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="with-param">
+  <xs:complexType>
+    <xs:complexContent mixed="true">
+      <xs:extension base="xsl:sequence-constructor">
+        <xs:attribute name="name" type="xsl:QName" use="required"/>
+        <xs:attribute name="select" type="xsl:expression"/>
+        <xs:attribute name="as" type="xsl:sequence-type"/>
+        <xs:attribute name="tunnel" type="xsl:yes-or-no"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+</xs:element>
+
+<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<xs:annotation>
+  <xs:documentation>
+    PART C: definition of literal result elements
+
+    There are three ways to define the literal result elements
+    permissible in a stylesheet.
+
+    (a) do nothing. This allows any element to be used as a literal
+        result element, provided it is not in the XSLT namespace
+
+    (b) declare all permitted literal result elements as members
+        of the xsl:literal-result-element substitution group
+
+    (c) redefine the model group xsl:result-elements to accommodate
+        all permitted literal result elements.
+
+    Literal result elements are allowed to take certain attributes
+    in the XSLT namespace. These are defined in the attribute group
+    literal-result-element-attributes, which can be included in the
+    definition of any literal result element.
+
+  </xs:documentation>
+</xs:annotation>
+<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<xs:element name="literal-result-element" abstract="true" type="xs:anyType"/>
+
+<xs:attributeGroup name="literal-result-element-attributes">
+  <xs:attribute name="default-collation" form="qualified" type="xsl:uri-list"/>
+  <xs:attribute name="extension-element-prefixes" form="qualified" type="xsl:prefixes"/>
+  <xs:attribute name="exclude-result-prefixes" form="qualified" type="xsl:prefixes"/>
+  <xs:attribute name="xpath-default-namespace" form="qualified" type="xs:anyURI"/>
+  <xs:attribute name="inherit-namespaces" form="qualified" type="xsl:yes-or-no" default="yes"/>
+  <xs:attribute name="use-attribute-sets" form="qualified" type="xsl:QNames" default=""/>
+  <xs:attribute name="use-when" form="qualified" type="xsl:expression"/>
+  <xs:attribute name="version" form="qualified" type="xs:decimal"/>
+  <xs:attribute name="type" form="qualified" type="xsl:QName"/>
+  <xs:attribute name="validation" form="qualified" type="xsl:validation-type"/>
+</xs:attributeGroup>
+
+<xs:group name="result-elements">
+  <xs:choice>
+    <xs:element ref="xsl:literal-result-element"/>
+    <xs:any namespace="##other" processContents="lax"/>
+    <xs:any namespace="##local" processContents="lax"/>
+  </xs:choice>
+</xs:group>
+
+
+<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<xs:annotation>
+  <xs:documentation>
+    PART D: definitions of simple types used in stylesheet attributes
+  </xs:documentation>
+</xs:annotation>
+<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<xs:simpleType name="avt">
+  <xs:annotation>
+    <xs:documentation>
+      This type is used for all attributes that allow an attribute value template.
+      The general rules for the syntax of attribute value templates, and the specific
+      rules for each such attribute, are described in the XSLT 2.0 Recommendation.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:string"/>
+</xs:simpleType>
+
+<xs:simpleType name="char">
+  <xs:annotation>
+    <xs:documentation>
+      A string containing exactly one character.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:string">
+    <xs:length value="1"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="expression">
+  <xs:annotation>
+    <xs:documentation>
+      An XPath 2.0 expression.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:token">
+    <xs:pattern value=".+"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="input-type-annotations-type">
+  <xs:annotation>
+    <xs:documentation>
+      Describes how type annotations in source documents are handled.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:token">
+    <xs:enumeration value="preserve"/>
+    <xs:enumeration value="strip"/>
+    <xs:enumeration value="unspecified"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="level">
+  <xs:annotation>
+    <xs:documentation>
+      The level attribute of xsl:number:
+      one of single, multiple, or any.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:NCName">
+    <xs:enumeration value="single"/>
+    <xs:enumeration value="multiple"/>
+    <xs:enumeration value="any"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="mode">
+  <xs:annotation>
+    <xs:documentation>
+      The mode attribute of xsl:apply-templates:
+      either a QName, or #current, or #default.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:union memberTypes="xsl:QName">
+    <xs:simpleType>
+      <xs:restriction base="xs:token">
+        <xs:enumeration value="#default"/>
+        <xs:enumeration value="#current"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:union>
+</xs:simpleType>
+
+<xs:simpleType name="modes">
+  <xs:annotation>
+    <xs:documentation>
+      The mode attribute of xsl:template:
+      either a list, each member being either a QName or #default;
+      or the value #all
+    </xs:documentation>
+  </xs:annotation>
+  <xs:union>
+    <xs:simpleType>
+      <xs:list>
+        <xs:simpleType>
+          <xs:union memberTypes="xsl:QName">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="#default"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:union>
+        </xs:simpleType>
+      </xs:list>
+    </xs:simpleType>
+    <xs:simpleType>
+      <xs:restriction base="xs:token">
+        <xs:enumeration value="#all"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:union>
+</xs:simpleType>
+
+<xs:simpleType name="nametests">
+  <xs:annotation>
+    <xs:documentation>
+      A list of NameTests, as defined in the XPath 2.0 Recommendation.
+      Each NameTest is either a QName, or "*", or "prefix:*", or "*:localname"
+    </xs:documentation>
+  </xs:annotation>
+  <xs:list>
+    <xs:simpleType>
+      <xs:union memberTypes="xsl:QName">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="*"/>
+          </xs:restriction>
+        </xs:simpleType>
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:pattern value="\i\c*:\*"/>
+            <xs:pattern value="\*:\i\c*"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:union>
+    </xs:simpleType>
+  </xs:list>
+</xs:simpleType>
+
+<xs:simpleType name="prefixes">
+  <xs:list itemType="xs:NCName"/>
+</xs:simpleType>
+
+<xs:simpleType name="prefix-list-or-all">
+  <xs:union memberTypes="xsl:prefix-list">
+    <xs:simpleType>
+      <xs:restriction base="xs:token">
+        <xs:enumeration value="#all"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:union>
+</xs:simpleType>
+
+<xs:simpleType name="prefix-list">
+  <xs:list itemType="xsl:prefix-or-default"/>
+</xs:simpleType>
+
+<xs:simpleType name="method">
+  <xs:annotation>
+    <xs:documentation>
+      The method attribute of xsl:output:
+      Either one of the recognized names "xml", "xhtml", "html", "text",
+      or a QName that must include a prefix.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:union>
+    <xs:simpleType>
+      <xs:restriction base="xs:NCName">
+        <xs:enumeration value="xml"/>
+        <xs:enumeration value="xhtml"/>
+        <xs:enumeration value="html"/>
+        <xs:enumeration value="text"/>
+      </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType>
+      <xs:restriction base="xsl:QName">
+        <xs:pattern value="\c*:\c*"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:union>
+</xs:simpleType>
+
+<xs:simpleType name="pattern">
+  <xs:annotation>
+    <xs:documentation>
+      A match pattern as defined in the XSLT 2.0 Recommendation.
+      The syntax for patterns is a restricted form of the syntax for
+      XPath 2.0 expressions.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xsl:expression"/>
+</xs:simpleType>
+
+<xs:simpleType name="prefix-or-default">
+  <xs:annotation>
+    <xs:documentation>
+      Either a namespace prefix, or #default.
+      Used in the xsl:namespace-alias element.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:union memberTypes="xs:NCName">
+    <xs:simpleType>
+      <xs:restriction base="xs:token">
+        <xs:enumeration value="#default"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:union>
+</xs:simpleType>
+
+<xs:simpleType name="QNames">
+  <xs:annotation>
+    <xs:documentation>
+      A list of QNames.
+      Used in the [xsl:]use-attribute-sets attribute of various elements,
+      and in the cdata-section-elements attribute of xsl:output
+    </xs:documentation>
+  </xs:annotation>
+  <xs:list itemType="xsl:QName"/>
+</xs:simpleType>
+
+<xs:simpleType name="QName">
+  <xs:annotation>
+    <xs:documentation>
+      A QName.
+      This schema does not use the built-in type xs:QName, but rather defines its own
+      QName type. Although xs:QName would define the correct validation on these attributes,
+      a schema processor would expand unprefixed QNames incorrectly when constructing the PSVI,
+      because (as defined in XML Schema errata) an unprefixed xs:QName is assumed to be in
+      the default namespace, which is not the correct assumption for XSLT.
+      The data type is defined as a restriction of the built-in type Name, restricted
+      so that it can only contain one colon which must not be the first or last character.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:Name">
+    <xs:pattern value="([^:]+:)?[^:]+"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="sequence-type">
+  <xs:annotation>
+    <xs:documentation>
+      The description of a data type, conforming to the
+      SequenceType production defined in the XPath 2.0 Recommendation
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:token">
+    <xs:pattern value=".+"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="uri-list">
+  <xs:list itemType="xs:anyURI"/>
+</xs:simpleType>
+
+<xs:simpleType name="validation-strip-or-preserve">
+  <xs:annotation>
+    <xs:documentation>
+      Describes different ways of type-annotating an element or attribute.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xsl:validation-type">
+    <xs:enumeration value="preserve"/>
+    <xs:enumeration value="strip"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="validation-type">
+  <xs:annotation>
+    <xs:documentation>
+      Describes different ways of type-annotating an element or attribute.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:token">
+    <xs:enumeration value="strict"/>
+    <xs:enumeration value="lax"/>
+    <xs:enumeration value="preserve"/>
+    <xs:enumeration value="strip"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="yes-or-no">
+  <xs:annotation>
+    <xs:documentation>
+      One of the values "yes" or "no".
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:token">
+    <xs:enumeration value="yes"/>
+    <xs:enumeration value="no"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="yes-or-no-or-omit">
+  <xs:annotation>
+    <xs:documentation>
+      One of the values "yes" or "no" or "omit".
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:token">
+    <xs:enumeration value="yes"/>
+    <xs:enumeration value="no"/>
+    <xs:enumeration value="omit"/>
+  </xs:restriction>
+</xs:simpleType>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/application/options/CodeStyleHtmlPanel.form b/xml/impl/src/com/intellij/application/options/CodeStyleHtmlPanel.form
new file mode 100644
index 0000000..01f7df0
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/CodeStyleHtmlPanel.form
@@ -0,0 +1,347 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.application.options.CodeStyleHtmlPanel">
+  <grid id="97358" binding="myPanel" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="4" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="4" y="8" width="828" height="588"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <xy id="3dbb2" binding="myPreviewPanel" layout-manager="XYLayout" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <border type="none"/>
+        <children/>
+      </xy>
+      <grid id="1b801" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <border type="none"/>
+        <children>
+          <scrollpane id="3e3f1" class="com.intellij.ui.components.JBScrollPane" binding="myJBScrollPane" custom-create="true">
+            <constraints>
+              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="0" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <horizontalScrollBarPolicy value="31"/>
+            </properties>
+            <border type="empty"/>
+            <children>
+              <grid id="b4cfb" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+                <margin top="0" left="0" bottom="0" right="0"/>
+                <constraints/>
+                <properties/>
+                <border type="none"/>
+                <children>
+                  <grid id="ca5bb" layout-manager="GridLayoutManager" row-count="7" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+                    <margin top="0" left="0" bottom="0" right="0"/>
+                    <constraints>
+                      <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties/>
+                    <border type="none"/>
+                    <children>
+                      <component id="121a0" class="javax.swing.JLabel">
+                        <constraints>
+                          <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="1" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <text resource-bundle="messages/ApplicationBundle" key="label.or.if.tag.size.more.than"/>
+                        </properties>
+                      </component>
+                      <component id="547a0" class="javax.swing.JTextField" binding="myDoNotAlignChildrenMinSize">
+                        <constraints>
+                          <grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="1" anchor="8" fill="0" indent="0" use-parent-layout="false">
+                            <preferred-size width="50" height="-1"/>
+                          </grid>
+                        </constraints>
+                        <properties/>
+                      </component>
+                      <component id="a3eda" class="javax.swing.JLabel">
+                        <constraints>
+                          <grid row="3" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="4" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <text resource-bundle="messages/ApplicationBundle" key="label.lines"/>
+                        </properties>
+                      </component>
+                      <component id="fe20d" class="javax.swing.JLabel">
+                        <constraints>
+                          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <text resource-bundle="messages/ApplicationBundle" key="label.insert.new.line.before"/>
+                        </properties>
+                      </component>
+                      <component id="160eb" class="javax.swing.JLabel">
+                        <constraints>
+                          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <text resource-bundle="messages/ApplicationBundle" key="label.remove.new.line.before"/>
+                        </properties>
+                      </component>
+                      <component id="93fdf" class="javax.swing.JLabel">
+                        <constraints>
+                          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <text resource-bundle="messages/ApplicationBundle" key="label.do.not.indent.children.of"/>
+                        </properties>
+                      </component>
+                      <component id="d6b64" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myInsertNewLineTagNames">
+                        <constraints>
+                          <grid row="0" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
+                            <preferred-size width="100" height="-1"/>
+                          </grid>
+                        </constraints>
+                        <properties>
+                          <text value=""/>
+                        </properties>
+                      </component>
+                      <component id="47f60" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myRemoveNewLineTagNames">
+                        <constraints>
+                          <grid row="1" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
+                            <preferred-size width="100" height="-1"/>
+                          </grid>
+                        </constraints>
+                        <properties>
+                          <text value=""/>
+                        </properties>
+                      </component>
+                      <component id="655c2" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myDoNotAlignChildrenTagNames">
+                        <constraints>
+                          <grid row="2" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
+                            <preferred-size width="100" height="-1"/>
+                          </grid>
+                        </constraints>
+                        <properties>
+                          <text value=""/>
+                        </properties>
+                      </component>
+                      <component id="c0d93" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myInlineElementsTagNames">
+                        <constraints>
+                          <grid row="4" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
+                            <preferred-size width="100" height="-1"/>
+                          </grid>
+                        </constraints>
+                        <properties>
+                          <text value=""/>
+                        </properties>
+                      </component>
+                      <component id="9646b" class="javax.swing.JLabel">
+                        <constraints>
+                          <grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <text resource-bundle="messages/ApplicationBundle" key="inline.elements"/>
+                        </properties>
+                      </component>
+                      <component id="1ade9" class="javax.swing.JLabel">
+                        <constraints>
+                          <grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <text resource-bundle="messages/ApplicationBundle" key="label.keep.white.spaces.inside"/>
+                        </properties>
+                      </component>
+                      <component id="a2288" class="javax.swing.JLabel">
+                        <constraints>
+                          <grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <text resource-bundle="messages/ApplicationBundle" key="don.t.break.if.inline.content"/>
+                        </properties>
+                      </component>
+                      <component id="77303" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myKeepWhiteSpacesTagNames">
+                        <constraints>
+                          <grid row="5" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
+                            <preferred-size width="100" height="-1"/>
+                          </grid>
+                        </constraints>
+                        <properties>
+                          <text value=""/>
+                        </properties>
+                      </component>
+                      <component id="c854c" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myDontBreakIfInlineContent">
+                        <constraints>
+                          <grid row="6" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
+                            <preferred-size width="100" height="-1"/>
+                          </grid>
+                        </constraints>
+                        <properties>
+                          <text value=""/>
+                        </properties>
+                      </component>
+                    </children>
+                  </grid>
+                  <grid id="b8acc" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+                    <margin top="0" left="0" bottom="0" right="0"/>
+                    <constraints>
+                      <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties/>
+                    <border type="none"/>
+                    <children>
+                      <grid id="c0323" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+                        <margin top="0" left="0" bottom="0" right="0"/>
+                        <constraints>
+                          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties/>
+                        <border type="none"/>
+                        <children>
+                          <component id="8a13c" class="javax.swing.JCheckBox" binding="myAlignAttributes">
+                            <constraints>
+                              <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                            </constraints>
+                            <properties>
+                              <margin top="0" left="0" bottom="0" right="0"/>
+                              <text resource-bundle="messages/ApplicationBundle" key="checkbox.align.attributes"/>
+                            </properties>
+                          </component>
+                          <component id="165dc" class="javax.swing.JCheckBox" binding="myAlignText">
+                            <constraints>
+                              <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                            </constraints>
+                            <properties>
+                              <margin top="0" left="0" bottom="0" right="0"/>
+                              <text resource-bundle="messages/ApplicationBundle" key="checkbox.align.text"/>
+                            </properties>
+                          </component>
+                          <component id="959da" class="javax.swing.JCheckBox" binding="myKeepWhiteSpaces">
+                            <constraints>
+                              <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                            </constraints>
+                            <properties>
+                              <margin top="0" left="0" bottom="0" right="0"/>
+                              <text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.white.spaces"/>
+                            </properties>
+                          </component>
+                          <component id="bfd7f" class="javax.swing.JCheckBox" binding="myWrapText">
+                            <constraints>
+                              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                            </constraints>
+                            <properties>
+                              <text resource-bundle="messages/ApplicationBundle" key="checkbox.wrap.text"/>
+                            </properties>
+                          </component>
+                        </children>
+                      </grid>
+                      <grid id="6063" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+                        <margin top="0" left="0" bottom="0" right="0"/>
+                        <constraints>
+                          <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties/>
+                        <clientProperties>
+                          <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+                        </clientProperties>
+                        <border type="etched" title-resource-bundle="messages/ApplicationBundle" title-key="title.spaces"/>
+                        <children>
+                          <component id="f4575" class="javax.swing.JCheckBox" binding="mySpacesAroundEquality">
+                            <constraints>
+                              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                            </constraints>
+                            <properties>
+                              <text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.around.equals.in.attribute"/>
+                            </properties>
+                          </component>
+                          <component id="8f9a9" class="javax.swing.JCheckBox" binding="mySpacesAroundTagName">
+                            <constraints>
+                              <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                            </constraints>
+                            <properties>
+                              <text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.around.tag.name"/>
+                            </properties>
+                          </component>
+                          <component id="2830e" class="javax.swing.JCheckBox" binding="mySpaceInEmptyTag">
+                            <constraints>
+                              <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                            </constraints>
+                            <properties>
+                              <text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.in.empty.tag"/>
+                            </properties>
+                          </component>
+                        </children>
+                      </grid>
+                    </children>
+                  </grid>
+                  <grid id="6dece" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+                    <margin top="0" left="0" bottom="0" right="0"/>
+                    <constraints>
+                      <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties/>
+                    <border type="none"/>
+                    <children>
+                      <component id="c888a" class="javax.swing.JCheckBox" binding="myShouldKeepBlankLines">
+                        <constraints>
+                          <grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <margin top="0" left="0" bottom="0" right="0"/>
+                          <text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.line.breaks"/>
+                        </properties>
+                      </component>
+                      <component id="d4efa" class="javax.swing.JLabel">
+                        <constraints>
+                          <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <text resource-bundle="messages/ApplicationBundle" key="label.wrap.attributes"/>
+                        </properties>
+                      </component>
+                      <component id="e4b98" class="javax.swing.JLabel">
+                        <constraints>
+                          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <text resource-bundle="messages/ApplicationBundle" key="editbox.keep.blank.lines"/>
+                        </properties>
+                      </component>
+                      <component id="18182" class="javax.swing.JTextField" binding="myKeepBlankLines">
+                        <constraints>
+                          <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
+                            <preferred-size width="50" height="-1"/>
+                          </grid>
+                        </constraints>
+                        <properties>
+                          <columns value="3"/>
+                        </properties>
+                      </component>
+                      <component id="8bb88" class="javax.swing.JComboBox" binding="myWrapAttributes">
+                        <constraints>
+                          <grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <enabled value="true"/>
+                        </properties>
+                      </component>
+                      <component id="f6beb" class="javax.swing.JCheckBox" binding="myShouldKeepLineBreaksInText">
+                        <constraints>
+                          <grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <margin top="0" left="0" bottom="0" right="0"/>
+                          <text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.line.breaks.in.text"/>
+                        </properties>
+                      </component>
+                    </children>
+                  </grid>
+                </children>
+              </grid>
+            </children>
+          </scrollpane>
+        </children>
+      </grid>
+    </children>
+  </grid>
+</form>
diff --git a/xml/impl/src/com/intellij/application/options/CodeStyleHtmlPanel.java b/xml/impl/src/com/intellij/application/options/CodeStyleHtmlPanel.java
new file mode 100644
index 0000000..bde6a85f
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/CodeStyleHtmlPanel.java
@@ -0,0 +1,276 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options;
+
+import com.intellij.ide.highlighter.XmlHighlighterFactory;
+import com.intellij.openapi.application.ApplicationBundle;
+import com.intellij.openapi.editor.colors.EditorColorsScheme;
+import com.intellij.openapi.editor.highlighter.EditorHighlighter;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.ui.components.JBScrollPane;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.PlatformIcons;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+public class CodeStyleHtmlPanel extends CodeStyleAbstractPanel {
+
+  private JTextField myKeepBlankLines;
+  private JComboBox myWrapAttributes;
+  private JCheckBox myAlignAttributes;
+  private JCheckBox myKeepWhiteSpaces;
+
+  private JPanel myPanel;
+  private JPanel myPreviewPanel;
+
+  private JCheckBox mySpacesAroundEquality;
+  private JCheckBox mySpacesAroundTagName;
+  private JCheckBox myAlignText;
+  private TextFieldWithBrowseButton myInsertNewLineTagNames;
+  private TextFieldWithBrowseButton myRemoveNewLineTagNames;
+  private TextFieldWithBrowseButton myDoNotAlignChildrenTagNames;
+  private TextFieldWithBrowseButton myKeepWhiteSpacesTagNames;
+  private TextFieldWithBrowseButton myInlineElementsTagNames;
+  private JTextField myDoNotAlignChildrenMinSize;
+  private JCheckBox myShouldKeepBlankLines;
+  private JCheckBox mySpaceInEmptyTag;
+  private JCheckBox myWrapText;
+  private JCheckBox myShouldKeepLineBreaksInText;
+  private TextFieldWithBrowseButton myDontBreakIfInlineContent;
+  private JBScrollPane myJBScrollPane;
+
+  public CodeStyleHtmlPanel(CodeStyleSettings settings) {
+    super(settings);
+    installPreviewPanel(myPreviewPanel);
+
+    fillWrappingCombo(myWrapAttributes);
+
+    customizeField(ApplicationBundle.message("title.insert.new.line.before.tags"), myInsertNewLineTagNames);
+    customizeField(ApplicationBundle.message("title.remove.line.breaks.before.tags"), myRemoveNewLineTagNames);
+    customizeField(ApplicationBundle.message("title.do.not.indent.children.of"), myDoNotAlignChildrenTagNames);
+    customizeField(ApplicationBundle.message("title.inline.elements"), myInlineElementsTagNames);
+    customizeField(ApplicationBundle.message("title.keep.whitespaces.inside"), myKeepWhiteSpacesTagNames);
+    customizeField(ApplicationBundle.message("title.dont.wrap.if.inline.content"), myDontBreakIfInlineContent);
+
+    myInsertNewLineTagNames.getTextField().setColumns(5);
+    myRemoveNewLineTagNames.getTextField().setColumns(5);
+    myDoNotAlignChildrenTagNames.getTextField().setColumns(5);
+    myKeepWhiteSpacesTagNames.getTextField().setColumns(5);
+    myInlineElementsTagNames.getTextField().setColumns(5);
+    myDontBreakIfInlineContent.getTextField().setColumns(5);
+
+
+    addPanelToWatch(myPanel);
+  }
+
+  protected EditorHighlighter createHighlighter(final EditorColorsScheme scheme) {
+    return XmlHighlighterFactory.createXMLHighlighter(scheme);
+  }
+
+  private void createUIComponents() {
+    myJBScrollPane = new JBScrollPane() {
+      @Override
+      public Dimension getPreferredSize() {
+        Dimension prefSize = super.getPreferredSize();
+        return new Dimension(prefSize.width + 15, prefSize.height);
+      }
+    };
+  }
+
+  private static void customizeField(final String title, final TextFieldWithBrowseButton uiField) {
+    uiField.getTextField().setEditable(false);
+    uiField.setButtonIcon(PlatformIcons.OPEN_EDIT_DIALOG_ICON);
+    uiField.addActionListener(new ActionListener() {
+      public void actionPerformed(ActionEvent e) {
+        final TagListDialog tagListDialog = new TagListDialog(title);
+        tagListDialog.setData(createCollectionOn(uiField.getText()));
+        tagListDialog.show();
+        if (tagListDialog.isOK()) {
+          uiField.setText(createStringOn(tagListDialog.getData()));
+        }
+      }
+
+      private String createStringOn(final ArrayList<String> data) {
+        return StringUtil.join(ArrayUtil.toStringArray(data), ",");
+      }
+
+      private ArrayList<String> createCollectionOn(final String data) {
+        if (data == null) {
+          return new ArrayList<String>();
+        }
+        return new ArrayList<String>(Arrays.asList(data.split(",")));
+      }
+
+    });
+  }
+
+  protected int getRightMargin() {
+    return 60;
+  }
+
+  public void apply(CodeStyleSettings settings) {
+    settings.HTML_KEEP_BLANK_LINES = getIntValue(myKeepBlankLines);
+    settings.HTML_ATTRIBUTE_WRAP = ourWrappings[myWrapAttributes.getSelectedIndex()];
+    settings.HTML_TEXT_WRAP = myWrapText.isSelected() ? CodeStyleSettings.WRAP_AS_NEEDED : CodeStyleSettings.DO_NOT_WRAP;
+    settings.HTML_SPACE_INSIDE_EMPTY_TAG = mySpaceInEmptyTag.isSelected();
+    settings.HTML_ALIGN_ATTRIBUTES = myAlignAttributes.isSelected();
+    settings.HTML_ALIGN_TEXT = myAlignText.isSelected();
+    settings.HTML_KEEP_WHITESPACES = myKeepWhiteSpaces.isSelected();
+    settings.HTML_SPACE_AROUND_EQUALITY_IN_ATTRINUTE = mySpacesAroundEquality.isSelected();
+    settings.HTML_SPACE_AFTER_TAG_NAME = mySpacesAroundTagName.isSelected();
+
+    settings.HTML_ELEMENTS_TO_INSERT_NEW_LINE_BEFORE = myInsertNewLineTagNames.getText();
+    settings.HTML_ELEMENTS_TO_REMOVE_NEW_LINE_BEFORE = myRemoveNewLineTagNames.getText();
+    settings.HTML_DO_NOT_INDENT_CHILDREN_OF = myDoNotAlignChildrenTagNames.getText();
+    settings.HTML_DO_NOT_ALIGN_CHILDREN_OF_MIN_LINES = getIntValue(myDoNotAlignChildrenMinSize);
+    settings.HTML_INLINE_ELEMENTS = myInlineElementsTagNames.getText();
+    settings.HTML_DONT_ADD_BREAKS_IF_INLINE_CONTENT = myDontBreakIfInlineContent.getText();
+    settings.HTML_KEEP_WHITESPACES_INSIDE = myKeepWhiteSpacesTagNames.getText();
+    settings.HTML_KEEP_LINE_BREAKS = myShouldKeepBlankLines.isSelected();
+    settings.HTML_KEEP_LINE_BREAKS_IN_TEXT = myShouldKeepLineBreaksInText.isSelected();
+  }
+
+  private static int getIntValue(JTextField keepBlankLines) {
+    try {
+      return Integer.parseInt(keepBlankLines.getText());
+    }
+    catch (NumberFormatException e) {
+      return 0;
+    }
+  }
+
+  protected void resetImpl(final CodeStyleSettings settings) {
+    myKeepBlankLines.setText(String.valueOf(settings.HTML_KEEP_BLANK_LINES));
+    myWrapAttributes.setSelectedIndex(getIndexForWrapping(settings.HTML_ATTRIBUTE_WRAP));
+    myWrapText.setSelected(settings.HTML_TEXT_WRAP != CodeStyleSettings.DO_NOT_WRAP);
+    mySpaceInEmptyTag.setSelected(settings.HTML_SPACE_INSIDE_EMPTY_TAG);
+    myAlignAttributes.setSelected(settings.HTML_ALIGN_ATTRIBUTES);
+    myAlignText.setSelected(settings.HTML_ALIGN_TEXT);
+    myKeepWhiteSpaces.setSelected(settings.HTML_KEEP_WHITESPACES);
+    mySpacesAroundTagName.setSelected(settings.HTML_SPACE_AFTER_TAG_NAME);
+    mySpacesAroundEquality.setSelected(settings.HTML_SPACE_AROUND_EQUALITY_IN_ATTRINUTE);
+    myShouldKeepBlankLines.setSelected(settings.HTML_KEEP_LINE_BREAKS);
+    myShouldKeepLineBreaksInText.setSelected(settings.HTML_KEEP_LINE_BREAKS_IN_TEXT);
+
+    myInsertNewLineTagNames.setText(settings.HTML_ELEMENTS_TO_INSERT_NEW_LINE_BEFORE);
+    myRemoveNewLineTagNames.setText(settings.HTML_ELEMENTS_TO_REMOVE_NEW_LINE_BEFORE);
+    myDoNotAlignChildrenTagNames.setText(settings.HTML_DO_NOT_INDENT_CHILDREN_OF);
+    myDoNotAlignChildrenMinSize.setText(String.valueOf(settings.HTML_DO_NOT_ALIGN_CHILDREN_OF_MIN_LINES));
+    myInlineElementsTagNames.setText(settings.HTML_INLINE_ELEMENTS);
+    myDontBreakIfInlineContent.setText(settings.HTML_DONT_ADD_BREAKS_IF_INLINE_CONTENT);
+    myKeepWhiteSpacesTagNames.setText(settings.HTML_KEEP_WHITESPACES_INSIDE);
+  }
+
+  public boolean isModified(CodeStyleSettings settings) {
+    if (settings.HTML_KEEP_BLANK_LINES != getIntValue(myKeepBlankLines)) {
+      return true;
+    }
+    if (settings.HTML_ATTRIBUTE_WRAP != ourWrappings[myWrapAttributes.getSelectedIndex()]) {
+      return true;
+    }
+
+    if ((settings.HTML_TEXT_WRAP == CodeStyleSettings.WRAP_AS_NEEDED) != myWrapText.isSelected()) {
+      return true;
+    }
+
+    if (settings.HTML_SPACE_INSIDE_EMPTY_TAG != mySpaceInEmptyTag.isSelected()) {
+      return true;
+    }
+
+    if (settings.HTML_ALIGN_ATTRIBUTES != myAlignAttributes.isSelected()) {
+      return true;
+    }
+
+    if (settings.HTML_ALIGN_TEXT != myAlignText.isSelected()) {
+      return true;
+    }
+
+    if (settings.HTML_KEEP_WHITESPACES != myKeepWhiteSpaces.isSelected()) {
+      return true;
+    }
+
+    if (settings.HTML_SPACE_AROUND_EQUALITY_IN_ATTRINUTE != mySpacesAroundEquality.isSelected()) {
+      return true;
+    }
+
+    if (settings.HTML_SPACE_AFTER_TAG_NAME != mySpacesAroundTagName.isSelected()) {
+      return true;
+    }
+
+    if (!Comparing.equal(settings.HTML_ELEMENTS_TO_INSERT_NEW_LINE_BEFORE, myInsertNewLineTagNames.getText().trim())) {
+      return true;
+    }
+
+    if (!Comparing.equal(settings.HTML_ELEMENTS_TO_REMOVE_NEW_LINE_BEFORE, myRemoveNewLineTagNames.getText().trim())) {
+      return true;
+    }
+
+    if (!Comparing.equal(settings.HTML_DO_NOT_INDENT_CHILDREN_OF, myDoNotAlignChildrenTagNames.getText().trim())) {
+      return true;
+    }
+
+    if (settings.HTML_DO_NOT_ALIGN_CHILDREN_OF_MIN_LINES != getIntValue(myDoNotAlignChildrenMinSize)) {
+      return true;
+    }
+
+    if (!Comparing.equal(settings.HTML_INLINE_ELEMENTS, myInlineElementsTagNames.getText().trim())) return true;
+    if (!Comparing.equal(settings.HTML_DONT_ADD_BREAKS_IF_INLINE_CONTENT, myDontBreakIfInlineContent.getText().trim())) return true;
+
+    if (!Comparing.equal(settings.HTML_KEEP_WHITESPACES_INSIDE, myKeepWhiteSpacesTagNames.getText().trim())) {
+      return true;
+    }
+
+    if (myShouldKeepBlankLines.isSelected() != settings.HTML_KEEP_LINE_BREAKS) {
+      return true;
+    }
+
+    if (myShouldKeepLineBreaksInText.isSelected() != settings.HTML_KEEP_LINE_BREAKS_IN_TEXT) {
+      return true;
+    }
+
+    return false;
+  }
+
+  public JComponent getPanel() {
+    return myPanel;
+  }
+
+  protected String getPreviewText() {
+    return readFromFile(this.getClass(), "preview.html.template");
+
+  }
+
+  @NotNull
+  protected FileType getFileType() {
+    return StdFileTypes.HTML;
+  }
+
+  protected void prepareForReformat(final PsiFile psiFile) {
+    //psiFile.putUserData(PsiUtil.FILE_LANGUAGE_LEVEL_KEY, LanguageLevel.HIGHEST);
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/CodeStyleXmlPanel.form b/xml/impl/src/com/intellij/application/options/CodeStyleXmlPanel.form
new file mode 100644
index 0000000..28d48d08
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/CodeStyleXmlPanel.form
@@ -0,0 +1,233 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.application.options.CodeStyleXmlPanel">
+  <grid id="634cb" binding="myPanel" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="4" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="12" y="7" width="679" height="672"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <scrollpane id="a9b52" class="com.intellij.ui.components.JBScrollPane" binding="myJBScrollPane" custom-create="true">
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="0" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <horizontalScrollBarPolicy value="31"/>
+        </properties>
+        <border type="empty"/>
+        <children>
+          <grid id="265f" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+            <margin top="0" left="0" bottom="0" right="0"/>
+            <constraints/>
+            <properties/>
+            <border type="none"/>
+            <children>
+              <grid id="417cd" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+                <margin top="0" left="0" bottom="0" right="0"/>
+                <constraints>
+                  <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+                </constraints>
+                <properties/>
+                <border type="none"/>
+                <children>
+                  <grid id="367a8" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+                    <margin top="0" left="0" bottom="0" right="0"/>
+                    <constraints>
+                      <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties/>
+                    <border type="none"/>
+                    <children>
+                      <component id="8a13c" class="javax.swing.JCheckBox" binding="myAlignAttributes">
+                        <constraints>
+                          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <margin top="0" left="0" bottom="0" right="0"/>
+                          <text resource-bundle="messages/ApplicationBundle" key="checkbox.align.attributes"/>
+                        </properties>
+                      </component>
+                      <component id="959da" class="javax.swing.JCheckBox" binding="myKeepWhiteSpaces">
+                        <constraints>
+                          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <margin top="0" left="0" bottom="0" right="0"/>
+                          <text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.white.spaces"/>
+                        </properties>
+                      </component>
+                      <component id="c5160" class="javax.swing.JCheckBox" binding="myWrapText">
+                        <constraints>
+                          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <margin top="2" left="0" bottom="2" right="3"/>
+                          <text resource-bundle="messages/ApplicationBundle" key="checkbox.wrap.text"/>
+                        </properties>
+                      </component>
+                    </children>
+                  </grid>
+                  <grid id="6063" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+                    <margin top="0" left="0" bottom="0" right="0"/>
+                    <constraints>
+                      <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties/>
+                    <clientProperties>
+                      <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+                      <html.disable class="java.lang.Boolean" value="true"/>
+                    </clientProperties>
+                    <border type="etched" title-resource-bundle="messages/ApplicationBundle" title-key="title.spaces"/>
+                    <children>
+                      <component id="f4575" class="javax.swing.JCheckBox" binding="mySpacesAroundEquality">
+                        <constraints>
+                          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <margin top="0" left="0" bottom="0" right="0"/>
+                          <text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.around.equals.in.attribute"/>
+                        </properties>
+                      </component>
+                      <component id="8f9a9" class="javax.swing.JCheckBox" binding="mySpacesAfterTagName">
+                        <constraints>
+                          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <margin top="0" left="0" bottom="0" right="0"/>
+                          <text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.around.tag.name"/>
+                        </properties>
+                      </component>
+                      <component id="e8439" class="javax.swing.JCheckBox" binding="myInEmptyTag">
+                        <constraints>
+                          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties>
+                          <margin top="0" left="0" bottom="0" right="0"/>
+                          <text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.in.empty.tag"/>
+                        </properties>
+                      </component>
+                    </children>
+                  </grid>
+                </children>
+              </grid>
+              <grid id="e7045" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+                <margin top="0" left="0" bottom="0" right="0"/>
+                <constraints>
+                  <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+                </constraints>
+                <properties/>
+                <border type="none"/>
+                <children>
+                  <component id="d4efa" class="javax.swing.JLabel">
+                    <constraints>
+                      <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties>
+                      <text resource-bundle="messages/ApplicationBundle" key="label.wrap.attributes"/>
+                    </properties>
+                  </component>
+                  <component id="8bb88" class="javax.swing.JComboBox" binding="myWrapAttributes">
+                    <constraints>
+                      <grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties>
+                      <enabled value="true"/>
+                    </properties>
+                  </component>
+                  <component id="f230c" class="javax.swing.JLabel">
+                    <constraints>
+                      <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties>
+                      <text resource-bundle="messages/ApplicationBundle" key="editbox.keep.blank.lines"/>
+                    </properties>
+                  </component>
+                  <component id="d9f7d" class="javax.swing.JCheckBox" binding="myKeepLineBreaksInText">
+                    <constraints>
+                      <grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties>
+                      <margin top="0" left="0" bottom="0" right="0"/>
+                      <text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.line.breaks.in.text"/>
+                    </properties>
+                  </component>
+                  <component id="18182" class="javax.swing.JTextField" binding="myKeepBlankLines">
+                    <constraints>
+                      <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
+                        <preferred-size width="50" height="-1"/>
+                      </grid>
+                    </constraints>
+                    <properties>
+                      <columns value="3"/>
+                    </properties>
+                  </component>
+                  <component id="3cead" class="javax.swing.JCheckBox" binding="myKeepLineBreaks">
+                    <constraints>
+                      <grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties>
+                      <margin top="0" left="0" bottom="0" right="0"/>
+                      <text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.line.breaks"/>
+                    </properties>
+                  </component>
+                </children>
+              </grid>
+              <grid id="bcc6c" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+                <margin top="0" left="0" bottom="0" right="0"/>
+                <constraints>
+                  <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+                </constraints>
+                <properties/>
+                <clientProperties>
+                  <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+                </clientProperties>
+                <border type="etched" title="CDATA"/>
+                <children>
+                  <component id="a3e4f" class="javax.swing.JLabel">
+                    <constraints>
+                      <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties>
+                      <labelFor value="ecfb8"/>
+                      <text value="Whitespace around:"/>
+                    </properties>
+                  </component>
+                  <component id="9ab20" class="javax.swing.JCheckBox" binding="myKeepWhitespaceInsideCDATACheckBox">
+                    <constraints>
+                      <grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties>
+                      <text value="Keep whitespace inside"/>
+                    </properties>
+                  </component>
+                  <component id="ecfb8" class="javax.swing.JComboBox" binding="myWhiteSpaceAroundCDATA">
+                    <constraints>
+                      <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties>
+                      <model>
+                        <item value="Preserve"/>
+                        <item value="Remove (keep with tags)"/>
+                        <item value="Add new lines"/>
+                      </model>
+                    </properties>
+                  </component>
+                </children>
+              </grid>
+            </children>
+          </grid>
+        </children>
+      </scrollpane>
+      <xy id="3dbb2" binding="myPreviewPanel" layout-manager="XYLayout" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <border type="none"/>
+        <children/>
+      </xy>
+    </children>
+  </grid>
+</form>
diff --git a/xml/impl/src/com/intellij/application/options/CodeStyleXmlPanel.java b/xml/impl/src/com/intellij/application/options/CodeStyleXmlPanel.java
new file mode 100644
index 0000000..b7f0bd3
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/CodeStyleXmlPanel.java
@@ -0,0 +1,187 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options;
+
+import com.intellij.ide.highlighter.XmlHighlighterFactory;
+import com.intellij.openapi.editor.colors.EditorColorsScheme;
+import com.intellij.openapi.editor.highlighter.EditorHighlighter;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.formatter.xml.XmlCodeStyleSettings;
+import com.intellij.ui.components.JBScrollPane;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.awt.*;
+
+public class CodeStyleXmlPanel extends CodeStyleAbstractPanel{
+  private JTextField myKeepBlankLines;
+  private JComboBox myWrapAttributes;
+  private JCheckBox myAlignAttributes;
+  private JCheckBox myKeepWhiteSpaces;
+
+  private JPanel myPanel;
+  private JPanel myPreviewPanel;
+
+  private JCheckBox mySpacesAroundEquality;
+  private JCheckBox mySpacesAfterTagName;
+  private JCheckBox myKeepLineBreaks;
+  private JCheckBox myInEmptyTag;
+  private JCheckBox myWrapText;
+  private JCheckBox myKeepLineBreaksInText;
+  private JComboBox myWhiteSpaceAroundCDATA;
+  private JCheckBox myKeepWhitespaceInsideCDATACheckBox;
+  private JBScrollPane myJBScrollPane;
+
+  public CodeStyleXmlPanel(CodeStyleSettings settings) {
+    super(settings);
+    installPreviewPanel(myPreviewPanel);
+
+    fillWrappingCombo(myWrapAttributes);
+
+    addPanelToWatch(myPanel);
+  }
+
+  protected EditorHighlighter createHighlighter(final EditorColorsScheme scheme) {
+    return XmlHighlighterFactory.createXMLHighlighter(scheme);
+  }
+
+  protected int getRightMargin() {
+    return 60;
+  }
+
+  public void apply(CodeStyleSettings settings) {
+    XmlCodeStyleSettings xmlSettings = settings.getCustomSettings(XmlCodeStyleSettings.class);
+    xmlSettings.XML_KEEP_BLANK_LINES = getIntValue(myKeepBlankLines);
+    xmlSettings.XML_KEEP_LINE_BREAKS = myKeepLineBreaks.isSelected();
+    xmlSettings.XML_KEEP_LINE_BREAKS_IN_TEXT = myKeepLineBreaksInText.isSelected();
+    xmlSettings.XML_ATTRIBUTE_WRAP = ourWrappings[myWrapAttributes.getSelectedIndex()];
+    xmlSettings.XML_TEXT_WRAP = myWrapText.isSelected() ? CodeStyleSettings.WRAP_AS_NEEDED : CodeStyleSettings.DO_NOT_WRAP;
+    xmlSettings.XML_ALIGN_ATTRIBUTES = myAlignAttributes.isSelected();
+    xmlSettings.XML_KEEP_WHITESPACES = myKeepWhiteSpaces.isSelected();
+    xmlSettings.XML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE = mySpacesAroundEquality.isSelected();
+    xmlSettings.XML_SPACE_AFTER_TAG_NAME = mySpacesAfterTagName.isSelected();
+    xmlSettings.XML_SPACE_INSIDE_EMPTY_TAG = myInEmptyTag.isSelected();
+    xmlSettings.XML_WHITE_SPACE_AROUND_CDATA = myWhiteSpaceAroundCDATA.getSelectedIndex();
+    xmlSettings.XML_KEEP_WHITE_SPACES_INSIDE_CDATA = myKeepWhitespaceInsideCDATACheckBox.isSelected();
+  }
+
+  private int getIntValue(JTextField keepBlankLines) {
+    try {
+      return Integer.parseInt(keepBlankLines.getText());
+    }
+    catch (NumberFormatException e) {
+      return 0;
+    }
+  }
+
+  protected void resetImpl(final CodeStyleSettings settings) {
+    XmlCodeStyleSettings xmlSettings = settings.getCustomSettings(XmlCodeStyleSettings.class);
+    myKeepBlankLines.setText(String.valueOf(xmlSettings.XML_KEEP_BLANK_LINES));
+    myWrapAttributes.setSelectedIndex(getIndexForWrapping(xmlSettings.XML_ATTRIBUTE_WRAP));
+    myAlignAttributes.setSelected(xmlSettings.XML_ALIGN_ATTRIBUTES);
+    myKeepWhiteSpaces.setSelected(xmlSettings.XML_KEEP_WHITESPACES);
+    mySpacesAfterTagName.setSelected(xmlSettings.XML_SPACE_AFTER_TAG_NAME);
+    mySpacesAroundEquality.setSelected(xmlSettings.XML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE);
+    myKeepLineBreaks.setSelected(xmlSettings.XML_KEEP_LINE_BREAKS);
+    myKeepLineBreaksInText.setSelected(xmlSettings.XML_KEEP_LINE_BREAKS_IN_TEXT);
+    myInEmptyTag.setSelected(xmlSettings.XML_SPACE_INSIDE_EMPTY_TAG);
+    myWrapText.setSelected(wrapText(settings));
+    myWhiteSpaceAroundCDATA.setSelectedIndex(xmlSettings.XML_WHITE_SPACE_AROUND_CDATA);
+    myKeepWhitespaceInsideCDATACheckBox.setSelected(xmlSettings.XML_KEEP_WHITE_SPACES_INSIDE_CDATA);
+  }
+
+  public boolean isModified(CodeStyleSettings settings) {
+    XmlCodeStyleSettings xmlSettings = settings.getCustomSettings(XmlCodeStyleSettings.class);
+    if (myWrapText.isSelected() != wrapText(settings)) {
+      return true;
+    }
+    if (xmlSettings.XML_KEEP_BLANK_LINES != getIntValue(myKeepBlankLines)) {
+      return true;
+    }
+    if (xmlSettings.XML_ATTRIBUTE_WRAP != ourWrappings[myWrapAttributes.getSelectedIndex()]) {
+      return true;
+    }
+    if (xmlSettings.XML_ALIGN_ATTRIBUTES != myAlignAttributes.isSelected()) {
+      return true;
+    }
+    if (xmlSettings.XML_KEEP_WHITESPACES != myKeepWhiteSpaces.isSelected()) {
+      return true;
+    }
+
+    if (xmlSettings.XML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE != mySpacesAroundEquality.isSelected()){
+      return true;
+    }
+
+    if (xmlSettings.XML_SPACE_AFTER_TAG_NAME != mySpacesAfterTagName.isSelected()){
+      return true;
+    }
+
+    if (xmlSettings.XML_KEEP_LINE_BREAKS != myKeepLineBreaks.isSelected()) {
+      return true;
+    }
+
+    if (xmlSettings.XML_KEEP_LINE_BREAKS_IN_TEXT != myKeepLineBreaksInText.isSelected()) {
+      return true;
+    }
+
+    if (xmlSettings.XML_SPACE_INSIDE_EMPTY_TAG != myInEmptyTag.isSelected()){
+      return true;
+    }
+    if (xmlSettings.XML_WHITE_SPACE_AROUND_CDATA != myWhiteSpaceAroundCDATA.getSelectedIndex()) {
+      return true;
+    }
+    if (xmlSettings.XML_KEEP_WHITE_SPACES_INSIDE_CDATA != this.myKeepWhitespaceInsideCDATACheckBox.isSelected()) {
+      return true;
+    }
+
+    return false;
+  }
+
+  private boolean wrapText(final CodeStyleSettings settings) {
+    XmlCodeStyleSettings xmlSettings = settings.getCustomSettings(XmlCodeStyleSettings.class);
+    return xmlSettings.XML_TEXT_WRAP == CodeStyleSettings.WRAP_AS_NEEDED;
+  }
+
+  public JComponent getPanel() {
+    return myPanel;
+  }
+
+  protected String getPreviewText() {
+    return readFromFile(getClass(), "preview.xml.template");
+  }
+
+  @NotNull
+  protected FileType getFileType() {
+    return StdFileTypes.XML;
+  }
+
+  protected void prepareForReformat(final PsiFile psiFile) {
+    //psiFile.putUserData(PsiUtil.FILE_LANGUAGE_LEVEL_KEY, LanguageLevel.HIGHEST);
+  }
+
+  private void createUIComponents() {
+    myJBScrollPane = new JBScrollPane() {
+      @Override
+      public Dimension getPreferredSize() {
+        Dimension prefSize = super.getPreferredSize();
+        return new Dimension(prefSize.width + 15, prefSize.height);
+      }
+    };
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/HtmlCodeStyleMainPanel.java b/xml/impl/src/com/intellij/application/options/HtmlCodeStyleMainPanel.java
new file mode 100644
index 0000000..ba622bf
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/HtmlCodeStyleMainPanel.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options;
+
+import com.intellij.lang.Language;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Rustam Vishnyakov
+ */
+public class HtmlCodeStyleMainPanel extends TabbedLanguageCodeStylePanel {
+  protected HtmlCodeStyleMainPanel(CodeStyleSettings currentSettings, CodeStyleSettings settings) {
+    super(HTMLLanguage.INSTANCE, currentSettings, settings);
+  }
+
+  @Override
+  protected void initTabs(CodeStyleSettings settings) {
+    addIndentOptionsTab(settings);
+    addTab(new CodeStyleHtmlPanel(settings));
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/HtmlCodeStyleSettingsProvider.java b/xml/impl/src/com/intellij/application/options/HtmlCodeStyleSettingsProvider.java
new file mode 100644
index 0000000..0d2edf5
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/HtmlCodeStyleSettingsProvider.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options;
+
+import com.intellij.openapi.application.ApplicationBundle;
+import com.intellij.openapi.options.Configurable;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.codeStyle.CodeStyleSettingsProvider;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author yole
+ */
+public class HtmlCodeStyleSettingsProvider extends CodeStyleSettingsProvider {
+  @NotNull
+  public Configurable createSettingsPage(final CodeStyleSettings settings, final CodeStyleSettings originalSettings) {
+    return new CodeStyleAbstractConfigurable(settings, originalSettings, ApplicationBundle.message("title.html")) {
+      protected CodeStyleAbstractPanel createPanel(final CodeStyleSettings settings) {
+        return new HtmlCodeStyleMainPanel(settings, originalSettings);
+      }
+
+      public String getHelpTopic() {
+        return "reference.settingsdialog.IDE.globalcodestyle.html";
+      }
+    };
+  }
+
+  @Override
+  public String getConfigurableDisplayName() {
+    return ApplicationBundle.message("title.html");
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/HtmlLanguageCodeStyleSettings.java b/xml/impl/src/com/intellij/application/options/HtmlLanguageCodeStyleSettings.java
new file mode 100644
index 0000000..aa36d1b
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/HtmlLanguageCodeStyleSettings.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options;
+
+import com.intellij.lang.Language;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
+import com.intellij.psi.codeStyle.LanguageCodeStyleSettingsProvider;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Rustam Vishnyakov
+ */
+public class HtmlLanguageCodeStyleSettings extends LanguageCodeStyleSettingsProvider {
+  @NotNull
+  @Override
+  public Language getLanguage() {
+    return HTMLLanguage.INSTANCE;
+  }
+
+  @Override
+  public String getCodeSample(@NotNull SettingsType settingsType) {
+    return CodeStyleAbstractPanel.readFromFile(this.getClass(), "preview.html.template");
+  }
+
+  @Override
+  public CommonCodeStyleSettings getDefaultCommonSettings() {
+    CommonCodeStyleSettings defaultSettings = new CommonCodeStyleSettings(HTMLLanguage.INSTANCE);
+    defaultSettings.initIndentOptions();
+    return defaultSettings;
+  }
+
+  @Override
+  public IndentOptionsEditor getIndentOptionsEditor() {
+    return new SmartIndentOptionsEditor();
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/TagListDialog.java b/xml/impl/src/com/intellij/application/options/TagListDialog.java
new file mode 100644
index 0000000..9cdb941
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/TagListDialog.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options;
+
+import com.intellij.openapi.application.ApplicationBundle;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.ui.AnActionButton;
+import com.intellij.ui.AnActionButtonRunnable;
+import com.intellij.ui.ToolbarDecorator;
+import com.intellij.ui.components.JBList;
+
+import javax.swing.*;
+import java.util.ArrayList;
+
+public class TagListDialog extends DialogWrapper {
+  private final JPanel myPanel;
+  private final JList myList = new JBList(new DefaultListModel());
+  private ArrayList<String> myData;
+
+  public TagListDialog(String title) {
+    super(true);
+    myPanel = ToolbarDecorator.createDecorator(myList)
+      .setAddAction(new AnActionButtonRunnable() {
+        @Override
+        public void run(AnActionButton button) {
+          final String tagName = Messages.showInputDialog(ApplicationBundle.message("editbox.enter.tag.name"),
+                                                          ApplicationBundle.message("title.tag.name"), Messages.getQuestionIcon());
+          if (tagName != null) {
+            while (myData.contains(tagName)) {
+              myData.remove(tagName);
+            }
+            myData.add(tagName);
+            updateData();
+            myList.setSelectedIndex(myData.size() - 1);
+          }
+        }
+      }).setRemoveAction(new AnActionButtonRunnable() {
+        @Override
+        public void run(AnActionButton button) {
+          int selectedIndex = myList.getSelectedIndex();
+          if (selectedIndex >= 0) {
+            myData.remove(selectedIndex);
+            updateData();
+            if (selectedIndex >= myData.size()) {
+              selectedIndex -= 1;
+            }
+            if (selectedIndex >= 0) {
+              myList.setSelectedIndex(selectedIndex);
+            }
+          }
+        }
+      }).disableUpDownActions().createPanel();
+    setTitle(title);
+    init();
+  }
+
+  public void setData(ArrayList<String> data) {
+    myData = data;
+    updateData();
+    if (!myData.isEmpty()) {
+      myList.setSelectedIndex(0);
+    }
+  }
+
+  private void updateData() {
+    final DefaultListModel model = ((DefaultListModel)myList.getModel());
+    model.clear();
+    for (String data : myData) {
+      model.addElement(data);
+    }
+  }
+
+  public ArrayList<String> getData() {
+    return myData;
+  }
+
+  protected JComponent createCenterPanel() {
+    return myPanel;
+  }
+
+  public JComponent getPreferredFocusedComponent() {
+    return myList;
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/XmlAutoImportOptionsProvider.form b/xml/impl/src/com/intellij/application/options/XmlAutoImportOptionsProvider.form
new file mode 100644
index 0000000..cd42e37
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/XmlAutoImportOptionsProvider.form
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.application.options.XmlAutoImportOptionsProvider">
+  <grid id="ccd60" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="20" y="20" width="175" height="59"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="0" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <border type="etched" title="XML"/>
+        <clientProperties>
+          <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+        </clientProperties>
+        <children>
+          <component id="5cbfc" class="javax.swing.JCheckBox" binding="myShowAutoImportPopups" default-binding="true">
+            <constraints>
+              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text resource-bundle="messages/ApplicationBundle" key="checkbox.show.import.popup"/>
+            </properties>
+          </component>
+        </children>
+      </grid>
+    </children>
+  </grid>
+</form>
diff --git a/xml/impl/src/com/intellij/application/options/XmlAutoImportOptionsProvider.java b/xml/impl/src/com/intellij/application/options/XmlAutoImportOptionsProvider.java
new file mode 100644
index 0000000..23e7083
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/XmlAutoImportOptionsProvider.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options;
+
+import com.intellij.application.options.editor.AutoImportOptionsProvider;
+import com.intellij.openapi.options.ConfigurationException;
+
+import javax.swing.*;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlAutoImportOptionsProvider implements AutoImportOptionsProvider {
+
+  private JPanel myPanel;
+  private JCheckBox myShowAutoImportPopups;
+
+  public JComponent createComponent() {
+    return myPanel;
+  }
+
+  public boolean isModified() {
+    return XmlSettings.getInstance().SHOW_XML_ADD_IMPORT_HINTS != myShowAutoImportPopups.isSelected();
+  }
+
+  public void apply() throws ConfigurationException {
+    XmlSettings.getInstance().SHOW_XML_ADD_IMPORT_HINTS = myShowAutoImportPopups.isSelected();
+  }
+
+  public void reset() {
+    myShowAutoImportPopups.setSelected(XmlSettings.getInstance().SHOW_XML_ADD_IMPORT_HINTS);    
+  }
+
+  public void disposeUIResources() {
+
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/XmlCodeStyleMainPanel.java b/xml/impl/src/com/intellij/application/options/XmlCodeStyleMainPanel.java
new file mode 100644
index 0000000..e465fb0
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/XmlCodeStyleMainPanel.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options;
+
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.codeStyle.CodeStyleSettingsProvider;
+
+/**
+ * @author Rustam Vishnyakov
+ */
+public class XmlCodeStyleMainPanel extends TabbedLanguageCodeStylePanel {
+  protected XmlCodeStyleMainPanel(CodeStyleSettings currentSettings, CodeStyleSettings settings) {
+    super(XMLLanguage.INSTANCE, currentSettings, settings);
+  }
+
+  @Override
+  protected void initTabs(CodeStyleSettings settings) {
+    addIndentOptionsTab(settings);
+    addTab(new CodeStyleXmlPanel(settings));
+
+    for (CodeStyleSettingsProvider provider : Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME)) {
+      if (provider.getLanguage() == XMLLanguage.INSTANCE && !provider.hasSettingsPage()) {
+        createTab(provider);
+      }
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/XmlCodeStyleSettingsProvider.java b/xml/impl/src/com/intellij/application/options/XmlCodeStyleSettingsProvider.java
new file mode 100644
index 0000000..62ae4f8
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/XmlCodeStyleSettingsProvider.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options;
+
+import com.intellij.openapi.application.ApplicationBundle;
+import com.intellij.openapi.options.Configurable;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.codeStyle.CodeStyleSettingsProvider;
+import com.intellij.psi.codeStyle.CustomCodeStyleSettings;
+import com.intellij.psi.formatter.xml.XmlCodeStyleSettings;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author yole
+ */
+public class XmlCodeStyleSettingsProvider extends CodeStyleSettingsProvider {
+
+  public static final String CONFIGURABLE_DISPLAY_NAME = ApplicationBundle.message("title.xml");
+
+  @NotNull
+  public Configurable createSettingsPage(final CodeStyleSettings settings, final CodeStyleSettings originalSettings) {
+    return new CodeStyleAbstractConfigurable(settings, originalSettings, ApplicationBundle.message("title.xml")){
+      protected CodeStyleAbstractPanel createPanel(final CodeStyleSettings settings) {
+        return new XmlCodeStyleMainPanel(getCurrentSettings(), settings);
+      }
+
+      public String getHelpTopic() {
+        return "reference.settingsdialog.IDE.globalcodestyle.xml";
+      }
+    };
+  }
+
+  @Override
+  public String getConfigurableDisplayName() {
+    return CONFIGURABLE_DISPLAY_NAME;
+  }
+
+  @Override
+  public CustomCodeStyleSettings createCustomSettings(CodeStyleSettings settings) {
+    return new XmlCodeStyleSettings(settings);
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/XmlLanguageCodeStyleSettingsProvider.java b/xml/impl/src/com/intellij/application/options/XmlLanguageCodeStyleSettingsProvider.java
new file mode 100644
index 0000000..0541efe
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/XmlLanguageCodeStyleSettingsProvider.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options;
+
+import com.intellij.lang.Language;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
+import com.intellij.psi.codeStyle.LanguageCodeStyleSettingsProvider;
+import com.intellij.util.PlatformUtils;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Rustam Vishnyakov
+ */
+public class XmlLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSettingsProvider {
+  @NotNull
+  @Override
+  public Language getLanguage() {
+    return XMLLanguage.INSTANCE;
+  }
+
+  @Override
+  public String getCodeSample(@NotNull SettingsType settingsType) {
+    if (settingsType == SettingsType.INDENT_SETTINGS) {
+      return CodeStyleAbstractPanel.readFromFile(getClass(), "preview.xml.template");
+    }
+    return "";
+  }
+
+  @Override
+  public CommonCodeStyleSettings getDefaultCommonSettings() {
+    CommonCodeStyleSettings xmlSettings = new CommonCodeStyleSettings(getLanguage());
+    CommonCodeStyleSettings.IndentOptions indentOptions = xmlSettings.initIndentOptions();
+    // HACK [yole]
+    if (PlatformUtils.isRubyMine()) {
+      indentOptions.INDENT_SIZE = 2;
+    }
+    return xmlSettings;
+  }
+
+  @Override
+  public IndentOptionsEditor getIndentOptionsEditor() {
+    return new SmartIndentOptionsEditor();
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/XmlSettings.java b/xml/impl/src/com/intellij/application/options/XmlSettings.java
new file mode 100644
index 0000000..5dd5a468
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/XmlSettings.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options;
+
+import com.intellij.openapi.application.PathManager;
+import com.intellij.openapi.components.*;
+import com.intellij.util.xmlb.XmlSerializerUtil;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.File;
+
+/**
+ * @author Dmitry Avdeev
+ */
+
+@State(
+  name="XmlSettings",
+  storages= {
+    @Storage(
+      file = StoragePathMacros.APP_CONFIG + "/editor.codeinsight.xml"
+    )}
+)
+public class XmlSettings implements PersistentStateComponent<XmlSettings>, ExportableComponent {
+
+  public boolean SHOW_XML_ADD_IMPORT_HINTS = true;
+
+  public static XmlSettings getInstance() {
+    return ServiceManager.getService(XmlSettings.class);
+  }
+
+  public XmlSettings getState() {
+    return this;
+  }
+
+  public void loadState(final XmlSettings state) {
+    XmlSerializerUtil.copyBean(state, this);
+  }
+
+  @NotNull
+  public File[] getExportFiles() {
+    return new File[]{PathManager.getOptionsFile("editor.codeinsight")};
+  }
+
+  @NotNull
+  public String getPresentableName() {
+    return XmlBundle.message("xml.settings");
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/editor/WebEditorAppearanceConfigurable.java b/xml/impl/src/com/intellij/application/options/editor/WebEditorAppearanceConfigurable.java
new file mode 100644
index 0000000..da3701d
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/editor/WebEditorAppearanceConfigurable.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options.editor;
+
+import com.intellij.openapi.options.BeanConfigurable;
+import com.intellij.openapi.options.UnnamedConfigurable;
+import com.intellij.xml.XmlBundle;
+
+/**
+ * @author yole
+ */
+public class WebEditorAppearanceConfigurable extends BeanConfigurable<WebEditorOptions> implements UnnamedConfigurable {
+  public WebEditorAppearanceConfigurable() {
+    super(WebEditorOptions.getInstance());
+    checkBox("breadcrumbsEnabled", XmlBundle.message("xml.editor.options.breadcrumbs.title"));
+    checkBox("breadcrumbsEnabledInXml", XmlBundle.message("xml.editor.options.breadcrumbs.for.xml.title"));
+    checkBox("showCssColorPreviewInGutter", "Show CSS color preview icon in gutter");
+    checkBox("showCssInlineColorPreview", "Show CSS color preview as background");
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/editor/WebEditorOptions.java b/xml/impl/src/com/intellij/application/options/editor/WebEditorOptions.java
new file mode 100644
index 0000000..570014a
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/editor/WebEditorOptions.java
@@ -0,0 +1,195 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options.editor;
+
+import com.intellij.codeInsight.template.impl.TemplateSettings;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.PathManager;
+import com.intellij.openapi.components.*;
+import com.intellij.util.xmlb.XmlSerializerUtil;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.File;
+
+/**
+ * @author spleaner
+ */
+@State(
+  name="XmlEditorOptions",
+  storages= {
+    @Storage(
+      file = StoragePathMacros.APP_CONFIG + "/editor.xml"
+    )}
+)
+public class WebEditorOptions implements PersistentStateComponent<WebEditorOptions>, ExportableComponent {
+
+  private boolean myBreadcrumbsEnabled = true;
+  private boolean myBreadcrumbsEnabledInXml = false;
+  private boolean myShowCssColorPreviewInGutter = true;
+  private boolean myShowCssInlineColorPreview = false;
+  private boolean myAutomaticallyInsertClosingTag = true;
+  private boolean myAutomaticallyInsertRequiredAttributes = true;
+  private boolean myAutomaticallyInsertRequiredSubTags = true;
+  private boolean myAutomaticallyStartAttribute = true;
+  private boolean myZenCodingEnabled = true;
+  private int myZenCodingExpandShortcut = TemplateSettings.TAB_CHAR;
+
+  private boolean myTagTreeHighlightingEnabled = true;
+  private int myTagTreeHighlightingLevelCount = 6;
+  private int myTagTreeHighlightingOpacity = 10;
+
+  public static WebEditorOptions getInstance() {
+    return ServiceManager.getService(WebEditorOptions.class);
+  }
+
+  public WebEditorOptions() {
+    setTagTreeHighlightingEnabled(!ApplicationManager.getApplication().isUnitTestMode());
+  }
+
+  public void setBreadcrumbsEnabled(boolean b) {
+    myBreadcrumbsEnabled = b;
+  }
+
+  public boolean isBreadcrumbsEnabled() {
+    return myBreadcrumbsEnabled;
+  }
+
+  public void setBreadcrumbsEnabledInXml(boolean b) {
+    myBreadcrumbsEnabledInXml = b;
+  }
+
+  public boolean isBreadcrumbsEnabledInXml() {
+    return myBreadcrumbsEnabledInXml;
+  }
+
+  public boolean isShowCssInlineColorPreview() {
+    return myShowCssInlineColorPreview;
+  }
+
+  public void setShowCssInlineColorPreview(final boolean showCssInlineColorPreview) {
+    myShowCssInlineColorPreview = showCssInlineColorPreview;
+  }
+
+  public boolean isShowCssColorPreviewInGutter() {
+    return myShowCssColorPreviewInGutter;
+  }
+
+  public void setShowCssColorPreviewInGutter(final boolean showCssColorPreviewInGutter) {
+    myShowCssColorPreviewInGutter = showCssColorPreviewInGutter;
+  }
+
+  public boolean isAutomaticallyInsertClosingTag() {
+    return myAutomaticallyInsertClosingTag;
+  }
+
+  public void setAutomaticallyInsertClosingTag(final boolean automaticallyInsertClosingTag) {
+    myAutomaticallyInsertClosingTag = automaticallyInsertClosingTag;
+  }
+
+  public boolean isAutomaticallyInsertRequiredAttributes() {
+    return myAutomaticallyInsertRequiredAttributes;
+  }
+
+  public void setAutomaticallyInsertRequiredAttributes(final boolean automaticallyInsertRequiredAttributes) {
+    myAutomaticallyInsertRequiredAttributes = automaticallyInsertRequiredAttributes;
+  }
+
+  public int getZenCodingExpandShortcut() {
+    return myZenCodingExpandShortcut;
+  }
+
+  public void setZenCodingExpandShortcut(int zenCodingExpandShortcut) {
+    myZenCodingExpandShortcut = zenCodingExpandShortcut;
+  }
+
+  public boolean isAutomaticallyStartAttribute() {
+    return myAutomaticallyStartAttribute;
+  }
+
+  public boolean isZenCodingEnabled() {
+    return myZenCodingEnabled;
+  }
+
+  public void setAutomaticallyStartAttribute(final boolean automaticallyStartAttribute) {
+    myAutomaticallyStartAttribute = automaticallyStartAttribute;
+  }
+
+  public void setZenCodingEnabled(boolean zenCodingEnabled) {
+    myZenCodingEnabled = zenCodingEnabled;
+  }
+
+  public boolean isAutomaticallyInsertRequiredSubTags() {
+    return myAutomaticallyInsertRequiredSubTags;
+  }
+
+  public void setAutomaticallyInsertRequiredSubTags(boolean automaticallyInsertRequiredSubTags) {
+    myAutomaticallyInsertRequiredSubTags = automaticallyInsertRequiredSubTags;
+  }
+
+  public void setTagTreeHighlightingLevelCount(int tagTreeHighlightingLevelCount) {
+    myTagTreeHighlightingLevelCount = tagTreeHighlightingLevelCount;
+  }
+
+  public int getTagTreeHighlightingLevelCount() {
+    return myTagTreeHighlightingLevelCount;
+  }
+
+  public void setTagTreeHighlightingOpacity(int tagTreeHighlightingOpacity) {
+    myTagTreeHighlightingOpacity = tagTreeHighlightingOpacity;
+  }
+
+  public int getTagTreeHighlightingOpacity() {
+    return myTagTreeHighlightingOpacity;
+  }
+
+  public void setTagTreeHighlightingEnabled(boolean tagTreeHighlightingEnabled) {
+    myTagTreeHighlightingEnabled = tagTreeHighlightingEnabled;
+  }
+
+  public boolean isTagTreeHighlightingEnabled() {
+    return myTagTreeHighlightingEnabled;
+  }
+
+  @NotNull
+  public File[] getExportFiles() {
+    return new File[]{PathManager.getOptionsFile("editor")};
+  }
+
+  @NotNull
+  public String getPresentableName() {
+    return XmlBundle.message("xml.options");
+  }
+
+  @Nullable
+  public Object clone() {
+    try {
+      return super.clone();
+    }
+    catch (CloneNotSupportedException e) {
+      return null;
+    }
+  }
+
+  public WebEditorOptions getState() {
+    return this;
+  }
+
+  public void loadState(final WebEditorOptions state) {
+    XmlSerializerUtil.copyBean(state, this);
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsForm.form b/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsForm.form
new file mode 100644
index 0000000..0030a840
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsForm.form
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.application.options.editor.WebEditorOptionsProvider">
+  <grid id="27dc6" binding="myWholePanel" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="20" y="20" width="362" height="400"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <grid id="247ce" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="2" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <clientProperties>
+          <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+        </clientProperties>
+        <border type="none" title-resource-bundle="messages/XmlBundle" title-key="xml.editor.options.misc.title"/>
+        <children>
+          <component id="f6c8c" class="javax.swing.JCheckBox" binding="myAutomaticallyInsertClosingTagCheckBox" default-binding="true">
+            <constraints>
+              <grid row="0" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="Automatically insert closing tag"/>
+            </properties>
+          </component>
+          <component id="9f825" class="javax.swing.JCheckBox" binding="myAutomaticallyInsertRequiredAttributesCheckBox" default-binding="true">
+            <constraints>
+              <grid row="1" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="Automatically insert required attributes"/>
+            </properties>
+          </component>
+          <component id="4bf74" class="javax.swing.JCheckBox" binding="myAutomaticallyStartAttributeAfterCheckBox" default-binding="true">
+            <constraints>
+              <grid row="3" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <selected value="false"/>
+              <text value="Automatically start attribute"/>
+            </properties>
+          </component>
+          <component id="ba426" class="javax.swing.JCheckBox" binding="myEnableZenCodingCheckBox">
+            <constraints>
+              <grid row="4" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="Enable Zen Coding"/>
+            </properties>
+          </component>
+          <component id="7c51c" class="javax.swing.JLabel">
+            <constraints>
+              <grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="3" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="Expand abbreviation with"/>
+            </properties>
+          </component>
+          <component id="ed567" class="javax.swing.JComboBox" binding="myZenCodingExpandShortcutCombo">
+            <constraints>
+              <grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties/>
+          </component>
+          <hspacer id="8ee6f">
+            <constraints>
+              <grid row="5" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+            </constraints>
+          </hspacer>
+          <component id="c21d3" class="javax.swing.JCheckBox" binding="myAutomaticallyInsertRequiredSubTagsCheckBox" default-binding="true">
+            <constraints>
+              <grid row="2" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="Automatically insert required subtags"/>
+            </properties>
+          </component>
+        </children>
+      </grid>
+      <vspacer id="e0bcf">
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+        </constraints>
+      </vspacer>
+    </children>
+  </grid>
+</form>
diff --git a/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsProvider.java b/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsProvider.java
new file mode 100644
index 0000000..eb1ff2a
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsProvider.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.application.options.editor;
+
+import com.intellij.codeInsight.CodeInsightBundle;
+import com.intellij.codeInsight.template.impl.TemplateSettings;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+/**
+ * @author spleaner
+ */
+public class WebEditorOptionsProvider implements EditorOptionsProvider {
+  private JPanel myWholePanel;
+  private JCheckBox myAutomaticallyInsertClosingTagCheckBox;
+  private JCheckBox myAutomaticallyInsertRequiredAttributesCheckBox;
+  private JCheckBox myAutomaticallyInsertRequiredSubTagsCheckBox;
+  private JCheckBox myAutomaticallyStartAttributeAfterCheckBox;
+  private JCheckBox myEnableZenCodingCheckBox;
+  private JComboBox myZenCodingExpandShortcutCombo;
+
+  private static final String SPACE = CodeInsightBundle.message("template.shortcut.space");
+  private static final String TAB = CodeInsightBundle.message("template.shortcut.tab");
+  private static final String ENTER = CodeInsightBundle.message("template.shortcut.enter");
+
+  {
+    myZenCodingExpandShortcutCombo.addItem(SPACE);
+    myZenCodingExpandShortcutCombo.addItem(TAB);
+    myZenCodingExpandShortcutCombo.addItem(ENTER);
+    myEnableZenCodingCheckBox.addActionListener(new ActionListener() {
+      public void actionPerformed(ActionEvent e) {
+        myZenCodingExpandShortcutCombo.setEnabled(myEnableZenCodingCheckBox.isSelected());
+      }
+    });
+  }
+
+  public String getDisplayName() {
+    return XmlBundle.message("web.editor.configuration.title");
+  }
+
+  public String getHelpTopic() {
+    return null;
+  }
+
+  public JComponent createComponent() {
+    return myWholePanel;
+  }
+
+  private char getSelectedZenCodingExpandShortcut() {
+    Object selectedItem = myZenCodingExpandShortcutCombo.getSelectedItem();
+    if (TAB.equals(selectedItem)) {
+      return TemplateSettings.TAB_CHAR;
+    }
+    else if (ENTER.equals(selectedItem)) {
+      return TemplateSettings.ENTER_CHAR;
+    }
+    return TemplateSettings.SPACE_CHAR;
+  }
+
+  public boolean isModified() {
+    final WebEditorOptions xmlEditorOptions = WebEditorOptions.getInstance();
+    return xmlEditorOptions.isAutomaticallyInsertClosingTag() != myAutomaticallyInsertClosingTagCheckBox.isSelected() ||
+           xmlEditorOptions.isAutomaticallyInsertRequiredAttributes() != myAutomaticallyInsertRequiredAttributesCheckBox.isSelected() ||
+           xmlEditorOptions.isAutomaticallyStartAttribute() != myAutomaticallyStartAttributeAfterCheckBox.isSelected() ||
+           xmlEditorOptions.isZenCodingEnabled() != myEnableZenCodingCheckBox.isSelected() ||
+           xmlEditorOptions.getZenCodingExpandShortcut() != getSelectedZenCodingExpandShortcut() ||
+           xmlEditorOptions.isAutomaticallyInsertRequiredSubTags() != myAutomaticallyInsertRequiredSubTagsCheckBox.isSelected();
+  }
+
+  public void apply() throws ConfigurationException {
+    final WebEditorOptions xmlEditorOptions = WebEditorOptions.getInstance();
+    xmlEditorOptions.setAutomaticallyInsertClosingTag(myAutomaticallyInsertClosingTagCheckBox.isSelected());
+    xmlEditorOptions.setAutomaticallyInsertRequiredAttributes(myAutomaticallyInsertRequiredAttributesCheckBox.isSelected());
+    xmlEditorOptions.setAutomaticallyInsertRequiredSubTags(myAutomaticallyInsertRequiredSubTagsCheckBox.isSelected());
+    xmlEditorOptions.setAutomaticallyStartAttribute(myAutomaticallyStartAttributeAfterCheckBox.isSelected());
+    xmlEditorOptions.setZenCodingEnabled(myEnableZenCodingCheckBox.isSelected());
+    xmlEditorOptions.setZenCodingExpandShortcut(getSelectedZenCodingExpandShortcut());
+  }
+
+  public void reset() {
+    final WebEditorOptions xmlEditorOptions = WebEditorOptions.getInstance();
+    myAutomaticallyInsertClosingTagCheckBox.setSelected(xmlEditorOptions.isAutomaticallyInsertClosingTag());
+    myAutomaticallyInsertRequiredAttributesCheckBox.setSelected(xmlEditorOptions.isAutomaticallyInsertRequiredAttributes());
+    myAutomaticallyInsertRequiredSubTagsCheckBox.setSelected(xmlEditorOptions.isAutomaticallyInsertRequiredSubTags());
+    myAutomaticallyStartAttributeAfterCheckBox.setSelected(xmlEditorOptions.isAutomaticallyStartAttribute());
+    myEnableZenCodingCheckBox.setSelected(xmlEditorOptions.isZenCodingEnabled());
+    myZenCodingExpandShortcutCombo.setEnabled(xmlEditorOptions.isZenCodingEnabled());
+
+    char shortcut = (char)WebEditorOptions.getInstance().getZenCodingExpandShortcut();
+    if (shortcut == TemplateSettings.TAB_CHAR) {
+      myZenCodingExpandShortcutCombo.setSelectedItem(TAB);
+    }
+    else if (shortcut == TemplateSettings.ENTER_CHAR) {
+      myZenCodingExpandShortcutCombo.setSelectedItem(ENTER);
+    }
+    else {
+      myZenCodingExpandShortcutCombo.setSelectedItem(SPACE);
+    }
+  }
+
+  public void disposeUIResources() {
+  }
+
+  @NotNull
+  public String getId() {
+    return "editor.preferences.webOptions";
+  }
+
+  public Runnable enableSearch(final String option) {
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/application/options/editor/XmlCodeFoldingOptionsProvider.java b/xml/impl/src/com/intellij/application/options/editor/XmlCodeFoldingOptionsProvider.java
new file mode 100644
index 0000000..2c685df
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/editor/XmlCodeFoldingOptionsProvider.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * User: anna
+ * Date: 14-Feb-2008
+ */
+package com.intellij.application.options.editor;
+
+import com.intellij.openapi.application.ApplicationBundle;
+import com.intellij.openapi.options.BeanConfigurable;
+
+public class XmlCodeFoldingOptionsProvider extends BeanConfigurable<XmlFoldingSettings> implements CodeFoldingOptionsProvider {
+  public XmlCodeFoldingOptionsProvider() {
+    super(XmlFoldingSettings.getInstance());
+    checkBox("COLLAPSE_XML_TAGS", ApplicationBundle.message("checkbox.collapse.xml.tags"));
+    checkBox("COLLAPSE_HTML_STYLE_ATTRIBUTE", ApplicationBundle.message("checkbox.collapse.html.style.attribute"));
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/application/options/editor/XmlFoldingSettings.java b/xml/impl/src/com/intellij/application/options/editor/XmlFoldingSettings.java
new file mode 100644
index 0000000..05b3e8e
--- /dev/null
+++ b/xml/impl/src/com/intellij/application/options/editor/XmlFoldingSettings.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.application.options.editor;
+
+import com.intellij.openapi.application.PathManager;
+import com.intellij.openapi.components.*;
+import com.intellij.util.xmlb.XmlSerializerUtil;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.File;
+
+
+@State(
+  name="XmlFoldingSettings",
+  storages= {
+    @Storage(
+      file = StoragePathMacros.APP_CONFIG + "/editor.codeinsight.xml"
+    )}
+)
+public class XmlFoldingSettings implements PersistentStateComponent<XmlFoldingSettings>, ExportableComponent {
+
+  public static XmlFoldingSettings getInstance() {
+    return ServiceManager.getService(XmlFoldingSettings.class);
+  }
+
+  public boolean isCollapseXmlTags() {
+    return COLLAPSE_XML_TAGS;
+  }
+
+  public void setCollapseXmlTags(boolean value) {
+    COLLAPSE_XML_TAGS = value;
+  }
+
+  public boolean isCollapseHtmlStyleAttribute() {
+    return COLLAPSE_HTML_STYLE_ATTRIBUTE;
+  }
+
+  public void setCollapseHtmlStyleAttribute(boolean value) {
+    this.COLLAPSE_HTML_STYLE_ATTRIBUTE = value;
+  }
+
+  @SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_XML_TAGS = false;
+  @SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_HTML_STYLE_ATTRIBUTE = true;
+
+  @NotNull
+  public File[] getExportFiles() {
+    return new File[]{PathManager.getOptionsFile("editor.codeinsight")};
+  }
+
+  @NotNull
+  public String getPresentableName() {
+    return XmlBundle.message("xml.folding.settings");
+  }
+
+  public XmlFoldingSettings getState() {
+    return this;
+  }
+
+  public void loadState(final XmlFoldingSettings state) {
+    XmlSerializerUtil.copyBean(state, this);
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/actions/GenerateDTDAction.java b/xml/impl/src/com/intellij/codeInsight/actions/GenerateDTDAction.java
new file mode 100644
index 0000000..1aa5ae4
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/actions/GenerateDTDAction.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.actions;
+
+import com.intellij.codeInsight.CodeInsightActionHandler;
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlProcessingInstruction;
+import com.intellij.psi.xml.XmlProlog;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 22.05.2003
+ * Time: 13:46:54
+ * To change this template use Options | File Templates.
+ */
+public class GenerateDTDAction extends BaseCodeInsightAction{
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.actions.GenerateDTDAction");
+  protected CodeInsightActionHandler getHandler(){
+    return new CodeInsightActionHandler(){
+      public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) {
+        final XmlDocument document = findSuitableXmlDocument(file);
+        if (document != null) {
+          final @NonNls StringBuffer buffer = new StringBuffer();
+          buffer.append("<!DOCTYPE " + document.getRootTag().getName() + " [\n");
+          buffer.append(XmlUtil.generateDocumentDTD(document, true));
+          buffer.append("]>\n");
+          XmlFile tempFile;
+            try{
+              final XmlProlog prolog = document.getProlog();
+              final PsiElement childOfType = PsiTreeUtil.getChildOfType(prolog, XmlProcessingInstruction.class);
+              if (childOfType != null) {
+                final String text = childOfType.getText();
+                buffer.insert(0,text);
+                final PsiElement nextSibling = childOfType.getNextSibling();
+                if (nextSibling instanceof PsiWhiteSpace) {
+                  buffer.insert(text.length(),nextSibling.getText());
+                }
+              }
+              tempFile = (XmlFile)PsiFileFactory.getInstance(file.getProject()).createFileFromText("dummy.xml", buffer.toString());
+              prolog.replace(tempFile.getDocument().getProlog());
+            }
+          catch (IncorrectOperationException e) {
+            LOG.error(e);
+          }
+        }
+      }
+
+      public boolean startInWriteAction(){
+        return true;
+      }
+    };
+  }
+
+  @Nullable
+  private static XmlDocument findSuitableXmlDocument(@Nullable PsiFile psiFile) {
+    if (psiFile instanceof XmlFile) {
+      final VirtualFile virtualFile = psiFile.getVirtualFile();
+      if (virtualFile != null && virtualFile.isWritable()) {
+        final XmlDocument document = ((XmlFile)psiFile).getDocument();
+        if (document != null && document.getRootTag() != null) {
+          return document;
+        }
+      }
+    }
+    return null;
+  }
+
+  public void update(AnActionEvent event) {
+    super.update(event);
+
+    final DataContext dataContext = event.getDataContext();
+    final Presentation presentation = event.getPresentation();
+    Editor editor = PlatformDataKeys.EDITOR.getData(dataContext);
+    Project project = PlatformDataKeys.PROJECT.getData(dataContext);
+
+    final boolean enabled;
+    if (editor != null && project != null) {
+      PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
+      enabled = findSuitableXmlDocument(file) != null;
+    }
+    else {
+      enabled = false;
+    }
+
+    presentation.setEnabled(enabled);
+    if (ActionPlaces.isPopupPlace(event.getPlace())) {
+      presentation.setVisible(enabled);
+    }
+  }
+
+  protected boolean isValidForFile(Project project, Editor editor, PsiFile file){
+    return file instanceof XmlFile;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/completion/DtdCompletionData.java b/xml/impl/src/com/intellij/codeInsight/completion/DtdCompletionData.java
new file mode 100644
index 0000000..cdc9649
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/completion/DtdCompletionData.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: Maxim.Mossienko
+ * Date: Oct 19, 2006
+ * Time: 9:41:42 PM
+ */
+package com.intellij.codeInsight.completion;
+
+import com.intellij.codeInsight.TailType;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.filters.*;
+import com.intellij.psi.filters.position.LeftNeighbour;
+import com.intellij.psi.filters.position.XmlTokenTypeFilter;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlEntityDecl;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 05.06.2003
+ * Time: 18:55:15
+ * To change this template use Options | File Templates.
+ */
+public class DtdCompletionData extends CompletionData {
+  public DtdCompletionData() {
+    final LeftNeighbour entityFilter = new LeftNeighbour(new XmlTextFilter("%"));
+
+    declareFinalScope(XmlToken.class);
+
+    {
+      final CompletionVariant variant = new CompletionVariant(
+        new AndFilter(
+          new LeftNeighbour(
+            new OrFilter(
+              new XmlTextFilter(new String[] {"#", "!", "(", ",", "|", "["}),
+              new XmlTokenTypeFilter(XmlTokenType.XML_NAME)
+            )
+          ),
+          new NotFilter(entityFilter)
+        )
+      );
+      variant.includeScopeClass(XmlToken.class, true);
+      variant.addCompletion(
+        new String[] {
+          "#PCDATA","#IMPLIED","#REQUIRED","#FIXED","<!ATTLIST", "<!ELEMENT", "<!NOTATION", "INCLUDE", "IGNORE", "CDATA", "ID" , "IDREF", "EMPTY", "ANY",
+          "IDREFS", "ENTITIES", "ENTITY", "<!ENTITY", "NMTOKEN", "NMTOKENS", "SYSTEM", "PUBLIC"
+        },
+        TailType.NONE
+      );
+      variant.setInsertHandler(new MyInsertHandler());
+      registerVariant(variant);
+    }
+
+    {
+      final CompletionVariant variant = new CompletionVariant(entityFilter);
+      variant.includeScopeClass(XmlToken.class, true);
+      variant.addCompletion(new DtdEntityGetter());
+      variant.setInsertHandler(new XmlCompletionData.EntityRefInsertHandler());
+      registerVariant(variant);
+    }
+  }
+
+  public String findPrefix(PsiElement insertedElement, int offset) {
+    final PsiElement prevLeaf = PsiTreeUtil.prevLeaf(insertedElement);
+    final PsiElement prevPrevLeaf = prevLeaf != null ? PsiTreeUtil.prevLeaf(prevLeaf):null;
+    String prefix = super.findPrefix(insertedElement, offset);
+
+    if (prevLeaf != null) {
+      final String prevLeafText = prevLeaf.getText();
+
+      if("#".equals(prevLeafText)) {
+        prefix = "#" + prefix;
+      } else if ("!".equals(prevLeafText) && prevPrevLeaf != null && "<".equals(prevPrevLeaf.getText())) {
+        prefix = "<!" + prefix;
+      }
+    }
+
+    return prefix;
+  }
+
+  static class DtdEntityGetter implements ContextGetter {
+
+    public Object[] get(final PsiElement context, CompletionContext completionContext) {
+      final List<String> results = new LinkedList<String>();
+
+      final PsiElementProcessor processor = new PsiElementProcessor() {
+        public boolean execute(@NotNull final PsiElement element) {
+          if (element instanceof XmlEntityDecl) {
+            final XmlEntityDecl xmlEntityDecl = (XmlEntityDecl)element;
+            if (xmlEntityDecl.isInternalReference()) {
+              results.add(xmlEntityDecl.getName());
+            }
+          }
+          return true;
+        }
+      };
+
+      XmlUtil.processXmlElements((XmlFile)context.getContainingFile().getOriginalFile(), processor, true);
+      return ArrayUtil.toObjectArray(results);
+    }
+  }
+  static class MyInsertHandler extends BasicInsertHandler {
+
+    public void handleInsert(InsertionContext context, LookupElement item) {
+      super.handleInsert(context, item);
+
+      if (item.getObject().toString().startsWith("<!")) {
+        PsiDocumentManager.getInstance(context.getProject()).commitAllDocuments();
+
+        int caretOffset = context.getEditor().getCaretModel().getOffset();
+        PsiElement tag = PsiTreeUtil.getParentOfType(context.getFile().findElementAt(caretOffset), PsiNamedElement.class);
+
+        if (tag == null) {
+          context.getEditor().getDocument().insertString(caretOffset, " >");
+          context.getEditor().getCaretModel().moveToOffset(caretOffset + 1);
+        }
+      }
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/completion/ExtendedTagInsertHandler.java b/xml/impl/src/com/intellij/codeInsight/completion/ExtendedTagInsertHandler.java
new file mode 100644
index 0000000..644dcb9
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/completion/ExtendedTagInsertHandler.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.completion;
+
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.featureStatistics.FeatureUsageTracker;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.RangeMarker;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlExtension;
+import com.intellij.xml.XmlSchemaProvider;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ * @author Dmitry Avdeev
+*/
+public class ExtendedTagInsertHandler extends XmlTagInsertHandler {
+
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.completion.ExtendedTagInsertHandler");
+
+  protected final String myElementName;
+  @Nullable protected final String myNamespace;
+  @Nullable protected final String myNamespacePrefix;
+
+  public ExtendedTagInsertHandler(final String elementName, @Nullable final String namespace, @Nullable final String namespacePrefix) {
+    myElementName = elementName;
+    myNamespace = namespace;
+    myNamespacePrefix = namespacePrefix;
+  }
+
+  public void handleInsert(final InsertionContext context, final LookupElement item) {
+
+    final XmlFile contextFile = (XmlFile)context.getFile();
+    final XmlExtension extension = XmlExtension.getExtension(contextFile);
+    final XmlFile file = extension.getContainingFile(contextFile);
+    final Project project = context.getProject();
+
+    assert file != null;
+    final PsiElement psiElement = file.findElementAt(context.getStartOffset());
+    assert psiElement != null;
+    if (isNamespaceBound(psiElement)) {
+      doDefault(context, item);
+      return;
+    }
+
+    final Editor editor = context.getEditor();
+    final Document document = editor.getDocument();
+    PsiDocumentManager.getInstance(project).commitDocument(document);
+
+    final int caretOffset = editor.getCaretModel().getOffset();
+    final RangeMarker caretMarker = document.createRangeMarker(caretOffset, caretOffset);
+    caretMarker.setGreedyToRight(true);
+
+    final XmlExtension.Runner<String, IncorrectOperationException> runAfter =
+      new XmlExtension.Runner<String, IncorrectOperationException>() {
+
+        public void run(final String namespacePrefix) {
+
+          PsiDocumentManager.getInstance(project).commitDocument(document);
+          final PsiElement element = file.findElementAt(context.getStartOffset());
+          if (element != null) {
+            qualifyWithPrefix(namespacePrefix, element, document);
+            PsiDocumentManager.getInstance(project).commitDocument(document);
+          }
+          editor.getCaretModel().moveToOffset(caretMarker.getEndOffset());
+          PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(document);
+          doDefault(context, item);
+        }
+      };
+
+    try {
+      final String prefixByNamespace = getPrefixByNamespace(file, myNamespace);
+      if (myNamespacePrefix != null || StringUtil.isEmpty(prefixByNamespace)) {
+        final String nsPrefix = myNamespacePrefix == null ? suggestPrefix(file, myNamespace) : myNamespacePrefix;
+        extension.insertNamespaceDeclaration(file, editor, Collections.singleton(myNamespace), nsPrefix, runAfter);
+        FeatureUsageTracker.getInstance().triggerFeatureUsed(XmlCompletionContributor.TAG_NAME_COMPLETION_FEATURE);
+      } else {
+        runAfter.run(prefixByNamespace);    // qualify && complete
+      }
+    }
+    catch (IncorrectOperationException e) {
+      LOG.error(e);
+    }
+  }
+
+  protected void doDefault(final InsertionContext context, final LookupElement item) {
+    ExtendedTagInsertHandler.super.handleInsert(context, item);
+  }
+
+  protected boolean isNamespaceBound(PsiElement psiElement) {
+    PsiElement parent = psiElement.getParent();
+    if (!(parent instanceof XmlTag)) return false;
+    final XmlTag tag = (XmlTag)parent;
+    final XmlElementDescriptor tagDescriptor = tag.getDescriptor();
+    final String tagNamespace = tag.getNamespace();
+    assert myNamespace != null;
+    return tagDescriptor != null && !(tagDescriptor instanceof AnyXmlElementDescriptor) && myNamespace.equals(tagNamespace);
+  }
+
+  @Nullable
+  public static String getPrefixByNamespace(XmlFile file, final String namespace) {
+    final XmlTag tag = file.getRootTag();
+    return tag == null ? null : tag.getPrefixByNamespace(namespace);
+  }
+
+  @Nullable
+  public static String suggestPrefix(XmlFile file, @Nullable String namespace) {
+    if (namespace == null) {
+      return null;
+    }
+    for (XmlSchemaProvider provider : XmlSchemaProvider.getAvailableProviders(file)) {
+      String prefix = provider.getDefaultPrefix(namespace, file);
+      if (prefix != null) {
+        return prefix;
+      }
+    }
+    return null; 
+  }
+
+  protected Set<String> getNamespaces(final XmlFile file) {
+    return XmlExtension.getExtension(file).getNamespacesByTagName(myElementName, file);
+  }
+
+  protected void qualifyWithPrefix(final String namespacePrefix, final PsiElement element, final Document document) {
+    qualifyWithPrefix(namespacePrefix, element);
+  }
+
+  public static void qualifyWithPrefix(final String namespacePrefix, final PsiElement element) {
+    final PsiElement tag = element.getParent();
+    if (tag instanceof XmlTag) {
+      final String prefix = ((XmlTag)tag).getNamespacePrefix();
+      if (!prefix.equals(namespacePrefix)) {
+        final String name = namespacePrefix + ":" + ((XmlTag)tag).getLocalName();
+        try {
+          ((XmlTag)tag).setName(name);
+        }
+        catch (IncorrectOperationException e) {
+          LOG.error(e);
+        }
+      }
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/completion/HtmlCompletionData.java b/xml/impl/src/com/intellij/codeInsight/completion/HtmlCompletionData.java
new file mode 100644
index 0000000..dbf7393
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/completion/HtmlCompletionData.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.completion;
+
+import com.intellij.lang.Language;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.filters.AndFilter;
+import com.intellij.psi.filters.ElementFilter;
+import com.intellij.psi.filters.OrFilter;
+import com.intellij.psi.filters.TextContainFilter;
+import com.intellij.psi.filters.getters.HtmlAttributeValueGetter;
+import com.intellij.psi.filters.getters.XmlAttributeValueGetter;
+import com.intellij.psi.filters.position.XmlTokenTypeFilter;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import org.jetbrains.annotations.NonNls;
+
+/**
+ * @author Maxim.Mossienko
+ */
+@SuppressWarnings({"RefusedBequest"})
+public class HtmlCompletionData extends XmlCompletionData {
+  private boolean myCaseInsensitive;
+  private static final @NonNls String JAVASCRIPT_LANGUAGE_ID = "JavaScript";
+  private static final @NonNls String STYLE_TAG = "style";
+  private static final @NonNls String SCRIPT_TAG = "script";
+
+  public HtmlCompletionData() {
+    this(true);
+  }
+
+  protected HtmlCompletionData(boolean _caseInsensitive) {
+    myCaseInsensitive = _caseInsensitive;
+  }
+
+  protected ElementFilter createXmlEntityCompletionFilter() {
+    if (isCaseInsensitive()) {
+      return new AndFilter(
+        new OrFilter (
+          new XmlTokenTypeFilter(XmlTokenType.XML_DATA_CHARACTERS),
+          new XmlTokenTypeFilter(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN)
+        ),
+        new TextContainFilter("&")
+      );
+    }
+    
+    return super.createXmlEntityCompletionFilter();
+  }
+
+  private boolean equalNames(String str,String str2) {
+    if (!myCaseInsensitive) return str.equals(str2);
+    return str.equalsIgnoreCase(str2);
+  }
+
+  protected boolean isCaseInsensitive() {
+    return true;
+  }
+
+  public final boolean isCaseSensitive() {
+    return !isCaseInsensitive();
+  }
+
+  protected void setCaseInsensitive(final boolean caseInsensitive) {
+    myCaseInsensitive = caseInsensitive;
+  }
+
+  protected XmlAttributeValueGetter getAttributeValueGetter() {
+    return new HtmlAttributeValueGetter(!isCaseInsensitive());
+  }
+
+  protected ElementFilter createTagCompletionFilter() {
+    return new ElementFilter() {
+      public boolean isAcceptable(Object element, PsiElement context) {
+        String name = ((XmlTag)context).getName();
+
+        if (element instanceof PsiElement && 
+            ((PsiElement)element).getParent() == context) {
+          return true;
+        }
+
+        if (equalNames(name, STYLE_TAG) ||
+            equalNames(name,SCRIPT_TAG)) {
+          return false;
+        }
+
+        if ( isStyleAttributeContext((PsiElement)element) ) return false;
+        return true;
+      }
+
+      public boolean isClassAcceptable(Class hintClass) {
+        return true;
+      }
+    };
+  }
+
+  protected ElementFilter createAttributeCompletionFilter() {
+    return new ElementFilter() {
+      public boolean isAcceptable(Object element, PsiElement context) {
+        if (isStyleAttributeContext(context)) return false;
+        return true;
+      }
+
+      public boolean isClassAcceptable(Class hintClass) {
+        return true;
+      }
+    };
+  }
+
+  protected ElementFilter createAttributeValueCompletionFilter() {
+    return new ElementFilter() {
+      public boolean isAcceptable(Object element, PsiElement context) {
+        if (isStyleAttributeContext(context)) return false;
+        if ( isScriptContext((PsiElement)element) ) return false;
+        return true;
+      }
+
+      public boolean isClassAcceptable(Class hintClass) {
+        return true;
+      }
+    };
+  }
+
+  private static boolean isScriptContext(PsiElement element) {
+    final Language language = element.getLanguage();
+
+    return language.getID().equals(JAVASCRIPT_LANGUAGE_ID);
+  }
+
+  private boolean isStyleAttributeContext(PsiElement position) {
+    XmlAttribute parentOfType = PsiTreeUtil.getParentOfType(position, XmlAttribute.class, false);
+
+    if (parentOfType != null) {
+      String name = parentOfType.getName();
+      if (myCaseInsensitive) return STYLE_TAG.equalsIgnoreCase(name);
+      return STYLE_TAG.equals(name); //name.endsWith("style");
+    }
+
+    return false;
+  }
+
+  public void registerVariant(CompletionVariant variant) {
+    super.registerVariant(variant);
+    if (isCaseInsensitive()) variant.setCaseInsensitive(true);
+  }
+
+  public String findPrefix(PsiElement insertedElement, int offset) {
+    String prefix = super.findPrefix(insertedElement, offset);
+
+    boolean searchForEntities =
+      insertedElement instanceof XmlToken &&
+      ( ((XmlToken)insertedElement).getTokenType() == XmlTokenType.XML_DATA_CHARACTERS ||
+        ((XmlToken)insertedElement).getTokenType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN
+      );
+
+    if (searchForEntities) {
+      if (prefix.startsWith("&")) {
+        prefix = prefix.substring(1);
+      } else if (prefix.contains("&")) {
+        prefix = prefix.substring(prefix.indexOf("&") + 1);
+      }
+    }
+
+    return prefix;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/completion/XHtmlCompletionData.java b/xml/impl/src/com/intellij/codeInsight/completion/XHtmlCompletionData.java
new file mode 100644
index 0000000..c7ce4e6
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/completion/XHtmlCompletionData.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.completion;
+
+/**
+ * @author maxim
+ */
+public class XHtmlCompletionData extends HtmlCompletionData {
+  public XHtmlCompletionData() {
+    super(false);
+  }
+
+  protected boolean isCaseInsensitive() {
+    return false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/completion/XmlAttributeInsertHandler.java b/xml/impl/src/com/intellij/codeInsight/completion/XmlAttributeInsertHandler.java
new file mode 100644
index 0000000..20b3611
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/completion/XmlAttributeInsertHandler.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.completion;
+
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.ScrollType;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.util.text.CharArrayUtil;
+import com.intellij.xml.util.HtmlUtil;
+
+/**
+* @author peter
+*/
+public class XmlAttributeInsertHandler implements InsertHandler<LookupElement> {
+  public static final XmlAttributeInsertHandler INSTANCE = new XmlAttributeInsertHandler();
+
+  public void handleInsert(InsertionContext context, LookupElement item) {
+    final Editor editor = context.getEditor();
+
+    final Document document = editor.getDocument();
+    final int caretOffset = editor.getCaretModel().getOffset();
+    PsiFile file = PsiDocumentManager.getInstance(editor.getProject()).getPsiFile(document);
+    if (file.getLanguage() == HTMLLanguage.INSTANCE &&
+        HtmlUtil.isSingleHtmlAttribute((String)item.getObject())) {
+      return;
+    }
+
+    final CharSequence chars = document.getCharsSequence();
+    if (!CharArrayUtil.regionMatches(chars, caretOffset, "=\"") && !CharArrayUtil.regionMatches(chars, caretOffset, "='")) {
+      PsiElement fileContext = file.getContext();
+      String toInsert= "=\"\"";
+
+      if(fileContext != null) {
+        if (fileContext.getText().startsWith("\"")) toInsert = "=''";
+      }
+      
+      if (caretOffset >= document.getTextLength() || "/> \n\t\r".indexOf(document.getCharsSequence().charAt(caretOffset)) < 0) {
+        document.insertString(caretOffset, toInsert + " ");
+      }
+      else {
+        document.insertString(caretOffset, toInsert);
+      }
+
+      if ('=' == context.getCompletionChar()) {
+        context.setAddCompletionChar(false); // IDEA-19449
+      }
+    }
+
+    editor.getCaretModel().moveToOffset(caretOffset + 2);
+    editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
+    editor.getSelectionModel().removeSelection();
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/completion/XmlCharFilter.java b/xml/impl/src/com/intellij/codeInsight/completion/XmlCharFilter.java
new file mode 100644
index 0000000..9f09962
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/completion/XmlCharFilter.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: mike
+ * Date: Jul 23, 2002
+ * Time: 3:15:07 PM
+ * To change template for new class use 
+ * Code Style | Class Templates options (Tools | IDE Options).
+ */
+package com.intellij.codeInsight.completion;
+
+import com.intellij.codeInsight.editorActions.XmlAutoPopupHandler;
+import com.intellij.codeInsight.lookup.CharFilter;
+import com.intellij.codeInsight.lookup.Lookup;
+import com.intellij.lang.Language;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiErrorElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlText;
+
+public class XmlCharFilter extends CharFilter {
+
+  public static boolean isInXmlContext(Lookup lookup) {
+    if (!lookup.isCompletion()) return false;
+
+    PsiElement psiElement = lookup.getPsiElement();
+    PsiFile file = lookup.getPsiFile();
+    if (!(file instanceof XmlFile) && psiElement != null) {
+      file = psiElement.getContainingFile();
+    }
+
+
+    if (file instanceof XmlFile) {
+      if (psiElement != null) {
+        PsiElement elementToTest = psiElement;
+        if (elementToTest instanceof PsiWhiteSpace) {
+          elementToTest = elementToTest.getParent(); // JSPX has whitespace with language Java
+        }
+
+        final Language language = elementToTest.getLanguage();
+        if (!(language instanceof XMLLanguage)) {
+          return false;
+        }
+      }
+      return true;
+    }
+    return false;
+  }
+
+  public static boolean isWithinTag(Lookup lookup) {
+    if (isInXmlContext(lookup)) {
+      PsiElement psiElement = lookup.getPsiElement();
+      final PsiElement parentElement = psiElement.getParent() != null ? psiElement.getParent():null;
+      String s;
+      return parentElement != null &&
+             ( parentElement instanceof XmlTag ||
+               ( parentElement instanceof PsiErrorElement &&
+                 parentElement.getParent() instanceof XmlDocument
+               ) ||
+                 ((parentElement instanceof XmlDocument || parentElement instanceof XmlText) &&
+                  ((s = psiElement.getText()).equals("<") || s.equals("\""))));
+    }
+    return false;
+  }
+
+  public Result acceptChar(char c, final int prefixLength, final Lookup lookup) {
+    if (!isInXmlContext(lookup)) return null;
+
+    if (Character.isJavaIdentifierPart(c)) return Result.ADD_TO_PREFIX;
+    switch(c){
+      case '-':
+      case ':':
+        return Result.ADD_TO_PREFIX;
+      case '/':
+        if (isWithinTag(lookup)) {
+          if (prefixLength > 0) {
+            return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
+          }
+          XmlAutoPopupHandler.autoPopupXmlLookup(lookup.getEditor().getProject(), lookup.getEditor());
+          return Result.HIDE_LOOKUP;
+        }
+        return Result.ADD_TO_PREFIX;
+
+      case '>': if (prefixLength > 0) {
+        return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
+      }
+
+      case '\'':
+      case '\"':
+        return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
+      default:
+        return null;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/completion/XmlCompletionContributor.java b/xml/impl/src/com/intellij/codeInsight/completion/XmlCompletionContributor.java
new file mode 100644
index 0000000..3979367
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/completion/XmlCompletionContributor.java
@@ -0,0 +1,214 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.completion;
+
+import com.intellij.codeInsight.lookup.InsertHandlerDecorator;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupElementBuilder;
+import com.intellij.codeInsight.lookup.LookupElementDecorator;
+import com.intellij.featureStatistics.FeatureUsageTracker;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.actionSystem.IdeActions;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.Ref;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.patterns.PlatformPatterns;
+import com.intellij.patterns.XmlPatterns;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.Consumer;
+import com.intellij.util.ProcessingContext;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.XmlExtension;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlCompletionContributor extends CompletionContributor {
+  public static final Key<Boolean> WORD_COMPLETION_COMPATIBLE = Key.create("WORD_COMPLETION_COMPATIBLE");
+
+  @NonNls public static final String TAG_NAME_COMPLETION_FEATURE = "tag.name.completion";
+  private static final InsertHandlerDecorator<LookupElement> QUOTE_EATER = new InsertHandlerDecorator<LookupElement>() {
+    public void handleInsert(InsertionContext context, LookupElementDecorator<LookupElement> item) {
+      final char completionChar = context.getCompletionChar();
+      if (completionChar == '\'' || completionChar == '\"') {
+        context.setAddCompletionChar(false);
+        item.getDelegate().handleInsert(context);
+
+        final Editor editor = context.getEditor();
+        final Document document = editor.getDocument();
+        int tailOffset = editor.getCaretModel().getOffset();
+        if (document.getTextLength() > tailOffset) {
+          final char c = document.getCharsSequence().charAt(tailOffset);
+          if (c == completionChar || completionChar == '\'') {
+            editor.getCaretModel().moveToOffset(tailOffset + 1);
+          }
+        }
+      } else {
+        item.getDelegate().handleInsert(context);
+      }
+    }
+  };
+
+  public XmlCompletionContributor() {
+    extend(CompletionType.BASIC,
+           PlatformPatterns.psiElement().inside(XmlPatterns.xmlAttributeValue()),
+           new CompletionProvider<CompletionParameters>() {
+             @Override
+             protected void addCompletions(@NotNull CompletionParameters parameters,
+                                           ProcessingContext context,
+                                           @NotNull final CompletionResultSet result) {
+               final XmlAttributeValue attributeValue = PsiTreeUtil.getParentOfType(parameters.getPosition(), XmlAttributeValue.class, false);
+               if (attributeValue == null) {
+                 // we are injected, only getContext() returns attribute value
+                 return;
+               }
+
+               final Set<String> usedWords = new THashSet<String>();
+               final Ref<Boolean> addWordVariants = Ref.create(true);
+               result.runRemainingContributors(parameters, new Consumer<CompletionResult>() {
+                 public void consume(CompletionResult r) {
+                   if (r.getLookupElement().getUserData(WORD_COMPLETION_COMPATIBLE) == null) {
+                     addWordVariants.set(false);
+                   }
+                   usedWords.add(r.getLookupElement().getLookupString());
+                   result.passResult(r.withLookupElement(LookupElementDecorator.withInsertHandler(r.getLookupElement(), QUOTE_EATER)));
+                 }
+               });
+               if (addWordVariants.get().booleanValue()) {
+                 addWordVariants.set(attributeValue.getReferences().length == 0);
+               }
+
+               if (addWordVariants.get().booleanValue() && parameters.getInvocationCount() > 0) {
+                 WordCompletionContributor.addWordCompletionVariants(result, parameters, usedWords);
+               }
+             }
+           });
+  }
+
+  public static boolean isXmlNameCompletion(final CompletionParameters parameters) {
+    final ASTNode node = parameters.getPosition().getNode();
+    return node != null && node.getElementType() == XmlTokenType.XML_NAME;
+  }
+
+  public void fillCompletionVariants(final CompletionParameters parameters, final CompletionResultSet result) {
+    super.fillCompletionVariants(parameters, result);
+    if (result.isStopped()) {
+      return;
+    }
+
+    final PsiElement element = parameters.getPosition();
+
+    if (parameters.isExtendedCompletion()) {
+      completeTagName(parameters, result);
+    }
+
+    else if (parameters.getCompletionType() == CompletionType.SMART) {
+      new XmlSmartCompletionProvider().complete(parameters, result, element);
+    }
+  }
+
+  static void completeTagName(CompletionParameters parameters, CompletionResultSet result) {
+    PsiElement element = parameters.getPosition();
+    if (!isXmlNameCompletion(parameters)) return;
+    result.stopHere();
+    PsiElement parent = element.getParent();
+    if (!(parent instanceof XmlTag) ||
+        !(parameters.getOriginalFile() instanceof XmlFile)) {
+      return;
+    }
+    final XmlTag tag = (XmlTag)parent;
+    final String namespace = tag.getNamespace();
+    final String prefix = result.getPrefixMatcher().getPrefix();
+    final int pos = prefix.indexOf(':');
+
+    final PsiReference reference = tag.getReference();
+    String namespacePrefix = tag.getNamespacePrefix();
+
+    if (reference != null && !namespace.isEmpty() && !namespacePrefix.isEmpty()) {
+      // fallback to simple completion
+      final Set<LookupElement> set = new HashSet<LookupElement>();
+      new XmlCompletionData().completeReference(reference, set, element, parameters.getOriginalFile(), parameters.getOffset());
+      for (final LookupElement item : set) {
+        result.addElement(item);
+      }
+    }
+    else {
+
+      final CompletionResultSet newResult = result.withPrefixMatcher(pos >= 0 ? prefix.substring(pos + 1) : prefix);
+
+      final XmlFile file = (XmlFile)parameters.getOriginalFile();
+      final List<Pair<String,String>> names = XmlExtension.getExtension(file).getAvailableTagNames(file, tag);
+      for (Pair<String, String> pair : names) {
+        final String name = pair.getFirst();
+        final String ns = pair.getSecond();
+        final LookupElement item = createLookupElement(name, ns, ns, namespacePrefix.isEmpty() ? null : namespacePrefix);
+        newResult.addElement(item);
+      }
+    }
+  }
+
+  public static LookupElement createLookupElement(final String name,
+                                                  final String namespace,
+                                                  final String tailText, @Nullable String namespacePrefix) {
+    LookupElementBuilder builder =
+      LookupElementBuilder.create(Pair.create(name, namespace), name).withInsertHandler(
+        new ExtendedTagInsertHandler(name, namespace, namespacePrefix));
+    if (!StringUtil.isEmpty(namespace)) {
+      builder = builder.withTypeText(tailText, true);
+    }
+    return builder;
+  }
+
+  @Override
+  public String advertise(@NotNull final CompletionParameters parameters) {
+    if (isXmlNameCompletion(parameters) && parameters.getCompletionType() == CompletionType.BASIC) {
+      if (FeatureUsageTracker.getInstance().isToBeAdvertisedInLookup(TAG_NAME_COMPLETION_FEATURE, parameters.getPosition().getProject())) {
+        final String shortcut = getActionShortcut(IdeActions.ACTION_CODE_COMPLETION);
+        if (shortcut != null) {
+          return XmlBundle.message("tag.name.completion.hint", shortcut);
+        }
+
+      }
+    }
+    return super.advertise(parameters);
+  }
+
+  public void beforeCompletion(@NotNull final CompletionInitializationContext context) {
+    final int offset = context.getStartOffset();
+    final XmlAttributeValue attributeValue = PsiTreeUtil.findElementOfClassAtOffset(context.getFile(), offset, XmlAttributeValue.class, true);
+    if (attributeValue != null && offset == attributeValue.getTextRange().getStartOffset()) {
+      context.setDummyIdentifier("");
+    }
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/completion/XmlCompletionData.java b/xml/impl/src/com/intellij/codeInsight/completion/XmlCompletionData.java
new file mode 100644
index 0000000..00d6c1e
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/completion/XmlCompletionData.java
@@ -0,0 +1,280 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.completion;
+
+import com.intellij.codeInsight.TailType;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupValueFactory;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.editor.CaretModel;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.filters.*;
+import com.intellij.psi.filters.getters.XmlAttributeValueGetter;
+import com.intellij.psi.filters.position.LeftNeighbour;
+import com.intellij.psi.filters.position.XmlTokenTypeFilter;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 05.06.2003
+ * Time: 18:55:15
+ * To change this template use Options | File Templates.
+ */
+public class XmlCompletionData extends CompletionData {
+  public XmlCompletionData() {
+    declareFinalScope(XmlTag.class);
+    declareFinalScope(XmlAttribute.class);
+    declareFinalScope(XmlAttributeValue.class);
+
+    {
+      final CompletionVariant variant = new CompletionVariant(createTagCompletionFilter());
+      variant.includeScopeClass(XmlTag.class);
+      variant.addCompletionFilter(TrueFilter.INSTANCE);
+      registerVariant(variant);
+    }
+
+    {
+      final CompletionVariant variant = new CompletionVariant(createAttributeCompletionFilter());
+      variant.includeScopeClass(XmlAttribute.class);
+      variant.addCompletionFilter(TrueFilter.INSTANCE);
+      registerVariant(variant);
+    }
+
+    {
+      final CompletionVariant variant = new CompletionVariant(createAttributeValueCompletionFilter());
+      variant.includeScopeClass(XmlAttributeValue.class);
+      variant.addCompletion(getAttributeValueGetter(), TailType.NONE);
+      variant.addCompletionFilter(TrueFilter.INSTANCE, TailType.NONE);
+      registerVariant(variant);
+    }
+
+    final ElementFilter entityCompletionFilter = createXmlEntityCompletionFilter();
+
+    {
+      final CompletionVariant variant = new CompletionVariant(
+        new AndFilter(new XmlTokenTypeFilter(XmlTokenType.XML_DATA_CHARACTERS), new NotFilter(entityCompletionFilter), new ElementFilter() {
+          public boolean isAcceptable(Object element, PsiElement context) {
+            XmlTag tag = PsiTreeUtil.getParentOfType(context, XmlTag.class, false);
+            if (tag != null) {
+              return XmlUtil.getSchemaSimpleContent(tag) != null;
+            }
+            return false;
+          }
+
+          public boolean isClassAcceptable(Class hintClass) {
+            return true;
+          }
+        }));
+      variant.includeScopeClass(XmlToken.class, true);
+      variant.addCompletion(new SimpleTagContentEnumerationValuesGetter(), TailType.NONE);
+
+      registerVariant(variant);
+    }
+    
+    {
+      final CompletionVariant variant = new CompletionVariant(
+        new AndFilter(new XmlTokenTypeFilter(XmlTokenType.XML_DATA_CHARACTERS), new NotFilter(entityCompletionFilter)));
+      variant.includeScopeClass(XmlToken.class, true);
+      registerVariant(variant);
+    }
+
+    {
+      final CompletionVariant variant = new CompletionVariant(entityCompletionFilter);
+      variant.includeScopeClass(XmlToken.class, true);
+      variant.addCompletion(new EntityRefGetter());
+      variant.setInsertHandler(new EntityRefInsertHandler());
+      registerVariant(variant);
+    }
+  }
+
+  protected ElementFilter createXmlEntityCompletionFilter() {
+    return new AndFilter(new LeftNeighbour(new XmlTextFilter("&")), new OrFilter(new XmlTokenTypeFilter(XmlTokenType.XML_DATA_CHARACTERS),
+                                                                                 new XmlTokenTypeFilter(
+                                                                                     XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN)));
+  }
+
+  protected XmlAttributeValueGetter getAttributeValueGetter() {
+    return new XmlAttributeValueGetter();
+  }
+
+  protected ElementFilter createAttributeCompletionFilter() {
+    return TrueFilter.INSTANCE;
+  }
+
+  protected ElementFilter createAttributeValueCompletionFilter() {
+    return TrueFilter.INSTANCE;
+  }
+
+  protected ElementFilter createTagCompletionFilter() {
+    return TrueFilter.INSTANCE;
+  }
+
+  private static class SimpleTagContentEnumerationValuesGetter implements ContextGetter {
+    public Object[] get(final PsiElement context, CompletionContext completionContext) {
+      XmlTag tag = PsiTreeUtil.getParentOfType(context, XmlTag.class, false);
+      if (tag != null) {
+        final XmlTag simpleContent = XmlUtil.getSchemaSimpleContent(tag);
+        if (simpleContent != null) {
+          final HashSet<String> variants = new HashSet<String>();
+          XmlUtil.collectEnumerationValues(simpleContent, variants);
+          return ArrayUtil.toObjectArray(variants);
+        }
+      }
+
+      return ArrayUtil.EMPTY_OBJECT_ARRAY;
+    }
+  }
+
+  protected static class EntityRefGetter implements ContextGetter {
+
+    @Nullable
+    private static Object getLookupItem(@Nullable final XmlEntityDecl decl) {
+      if (decl == null) {
+        return null;
+      }
+
+      final String name = decl.getName();
+      if (name == null) {
+        return null;
+      }
+
+      final XmlAttributeValue value = decl.getValueElement();
+      final ASTNode node = value.getNode();
+      if (node != null) {
+        final ASTNode[] nodes = node.getChildren(TokenSet.create(XmlTokenType.XML_CHAR_ENTITY_REF));
+        if (nodes.length == 1) {
+          final String valueText = nodes[0].getText();
+          final int i = valueText.indexOf('#');
+          if (i > 0) {
+            String s = valueText.substring(i + 1);
+            if (s.endsWith(";")) {
+              s = s.substring(0, s.length() - 1);
+            }
+
+            try {
+              final int unicodeChar = Integer.valueOf(s).intValue();
+              return LookupValueFactory.createLookupValueWithHint(name, null, new String(Character.toChars(unicodeChar)));
+            }
+            catch (NumberFormatException e) {
+              return null;
+            }
+          }
+        }
+      }
+
+      return null;
+    }
+
+    public Object[] get(final PsiElement context, CompletionContext completionContext) {
+      XmlFile containingFile = null;
+      XmlFile descriptorFile = null;
+      final XmlTag tag = PsiTreeUtil.getParentOfType(context, XmlTag.class);
+
+      if (tag != null) {
+        containingFile = (XmlFile)tag.getContainingFile();
+        descriptorFile = findDescriptorFile(tag, containingFile);
+      }
+
+      boolean isHtml5 = false;
+      if (tag == null || (isHtml5 = HtmlUtil.isHtml5Context(tag))) {  // Html5 RNG does not have entities
+        final XmlDocument document = PsiTreeUtil.getParentOfType(context, XmlDocument.class);
+
+        if (document != null) {
+          containingFile = (XmlFile)document.getContainingFile();
+
+          final FileType ft = containingFile.getFileType();
+
+          if(ft != StdFileTypes.XML) {
+            final String namespace = ft == StdFileTypes.XHTML || ft == StdFileTypes.JSPX || isHtml5? XmlUtil.XHTML_URI:XmlUtil.HTML_URI;
+            final XmlNSDescriptor nsDescriptor = document.getDefaultNSDescriptor(namespace, true);
+
+            if (nsDescriptor != null) {
+              descriptorFile = nsDescriptor.getDescriptorFile();
+            }
+          }
+        }
+      }
+
+      if (descriptorFile != null) {
+        final List<Object> results = new ArrayList<Object>();
+        final boolean acceptSystemEntities = containingFile.getFileType() == StdFileTypes.XML;
+
+        final PsiElementProcessor processor = new PsiElementProcessor() {
+          public boolean execute(@NotNull final PsiElement element) {
+            if (element instanceof XmlEntityDecl) {
+              final XmlEntityDecl xmlEntityDecl = (XmlEntityDecl)element;
+              if (xmlEntityDecl.isInternalReference() || acceptSystemEntities) {
+                final String name = xmlEntityDecl.getName();
+                final Object _item = getLookupItem(xmlEntityDecl);
+                results.add(_item == null ? name : _item);
+              }
+            }
+            return true;
+          }
+        };
+
+        XmlUtil.processXmlElements(descriptorFile, processor, true);
+        if (descriptorFile != containingFile && containingFile.getFileType() == StdFileTypes.XML) {
+          final XmlProlog element = containingFile.getDocument().getProlog();
+          if (element != null) XmlUtil.processXmlElements(element, processor, true);
+        }
+
+        return ArrayUtil.toObjectArray(results);
+      }
+
+      return ArrayUtil.EMPTY_OBJECT_ARRAY;
+    }
+  }
+
+  public static XmlFile findDescriptorFile(final XmlTag tag, final XmlFile containingFile) {
+    final XmlElementDescriptor descriptor = tag.getDescriptor();
+    final XmlNSDescriptor nsDescriptor = descriptor != null ? descriptor.getNSDescriptor() : null;
+    XmlFile descriptorFile = nsDescriptor != null
+                             ? nsDescriptor.getDescriptorFile()
+                             : containingFile.getDocument().getProlog().getDoctype() != null ? containingFile : null;
+    if (nsDescriptor != null && (descriptorFile == null || descriptorFile.getName().equals(containingFile.getName() + ".dtd"))) {
+      descriptorFile = containingFile;
+    }
+    return descriptorFile;
+  }
+
+  protected static class EntityRefInsertHandler extends BasicInsertHandler {
+    public void handleInsert(InsertionContext context, LookupElement item) {
+      super.handleInsert(context, item);
+      context.setAddCompletionChar(false);
+      final CaretModel caretModel = context.getEditor().getCaretModel();
+      context.getEditor().getDocument().insertString(caretModel.getOffset(), ";");
+      caretModel.moveToOffset(caretModel.getOffset() + 1);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/completion/XmlNoVariantsDelegator.java b/xml/impl/src/com/intellij/codeInsight/completion/XmlNoVariantsDelegator.java
new file mode 100644
index 0000000..9166b67
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/completion/XmlNoVariantsDelegator.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.completion;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 12/19/11
+ */
+public class XmlNoVariantsDelegator extends CompletionContributor {
+
+  @Override
+  public void fillCompletionVariants(final CompletionParameters parameters, final CompletionResultSet result) {
+    final boolean empty = result.runRemainingContributors(parameters, true).isEmpty();
+
+    if (!empty && parameters.getInvocationCount() == 0) {
+      result.restartCompletionWhenNothingMatches();
+    }
+
+    if (empty && parameters.getCompletionType() == CompletionType.BASIC) {
+      XmlCompletionContributor.completeTagName(parameters, result);
+    }
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/completion/XmlSmartCompletionProvider.java b/xml/impl/src/com/intellij/codeInsight/completion/XmlSmartCompletionProvider.java
new file mode 100644
index 0000000..5321d85
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/completion/XmlSmartCompletionProvider.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.completion;
+
+import com.intellij.codeInsight.lookup.LookupElementBuilder;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.impl.source.xml.XmlContentDFA;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.impl.schema.XmlElementDescriptorImpl;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlSmartCompletionProvider {
+
+  public void complete(CompletionParameters parameters, final CompletionResultSet result, PsiElement element) {
+    if (!XmlCompletionContributor.isXmlNameCompletion(parameters)) {
+      return;
+    }
+    result.stopHere();
+    if (!(element.getParent() instanceof XmlTag)) {
+      return;
+    }
+
+    final XmlTag tag = (XmlTag)element.getParent();
+    final XmlTag parentTag = tag.getParentTag();
+    if (parentTag == null) return;
+    final XmlContentDFA dfa = XmlContentDFA.getContentDFA(parentTag);
+    if (dfa == null) return;
+    ApplicationManager.getApplication().runReadAction(new Runnable() {
+      @Override
+      public void run() {
+        for (XmlTag subTag : parentTag.getSubTags()) {
+          if (subTag == tag) {
+            break;
+          }
+          dfa.transition(subTag);
+        }
+        List<XmlElementDescriptor> elements = dfa.getPossibleElements();
+        for (XmlElementDescriptor elementDescriptor: elements) {
+          addElementToResult(elementDescriptor, result);
+        }
+      }
+    });
+  }
+
+  private static void addElementToResult(@NotNull XmlElementDescriptor descriptor, CompletionResultSet result) {
+    XmlTagInsertHandler insertHandler = XmlTagInsertHandler.INSTANCE;
+    if (descriptor instanceof XmlElementDescriptorImpl) {
+      String name = descriptor.getName();
+      if (name != null) {
+        insertHandler = new ExtendedTagInsertHandler(name, ((XmlElementDescriptorImpl)descriptor).getNamespace(), null);
+      }
+    }
+    result.addElement(createLookupElement(descriptor).withInsertHandler(insertHandler));
+  }
+
+  public static LookupElementBuilder createLookupElement(@NotNull XmlElementDescriptor descriptor) {
+    LookupElementBuilder builder = LookupElementBuilder.create(descriptor.getName());
+    if (descriptor instanceof XmlElementDescriptorImpl) {
+      builder = builder.withTypeText(((XmlElementDescriptorImpl)descriptor).getNamespace(), true);
+    }
+    return builder;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/completion/XmlSmartEnterProcessor.java b/xml/impl/src/com/intellij/codeInsight/completion/XmlSmartEnterProcessor.java
new file mode 100644
index 0000000..e01a7e4
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/completion/XmlSmartEnterProcessor.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.completion;
+
+import com.intellij.codeInsight.editorActions.smartEnter.SmartEnterProcessor;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.text.CharArrayUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author spleaner
+ */
+public class XmlSmartEnterProcessor extends SmartEnterProcessor {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.completion.XmlSmartEnterProcessor");
+
+  public boolean process(@NotNull final Project project, @NotNull final Editor editor, @NotNull final PsiFile psiFile) {
+    /*if (!completeEndTag(project, editor, psiFile)) {
+      return XmlZenCodingTemplate.startZenCoding(editor, psiFile, null);
+    }
+    return true;*/
+    return completeEndTag(project, editor, psiFile);
+  }
+
+  private boolean completeEndTag(Project project, Editor editor, PsiFile psiFile) {
+    final PsiElement atCaret = getStatementAtCaret(editor, psiFile);
+    XmlTag tagAtCaret = PsiTreeUtil.getParentOfType(atCaret, XmlTag.class);
+    if (tagAtCaret == null) {
+      return false;
+    }
+    try {
+      final ASTNode emptyTagEnd = XmlChildRole.EMPTY_TAG_END_FINDER.findChild(tagAtCaret.getNode());
+      final ASTNode endTagEnd = XmlChildRole.START_TAG_END_FINDER.findChild(tagAtCaret.getNode());
+      final Document doc = editor.getDocument();
+      if (emptyTagEnd == null && endTagEnd == null) {
+        int insertionOffset = tagAtCaret.getTextRange().getEndOffset();
+        int caretAt = editor.getCaretModel().getOffset();
+        final CharSequence text = doc.getCharsSequence();
+        final int probableCommaOffset = CharArrayUtil.shiftForward(text, insertionOffset, " \t");
+        final PsiElement siebling = tagAtCaret.getNextSibling();
+        int caretTo = caretAt;
+        char ch;
+
+        if (caretAt < probableCommaOffset) {
+          final XmlAttribute xmlAttribute = PsiTreeUtil.getParentOfType(atCaret, XmlAttribute.class, false, XmlTag.class);
+
+          CharSequence tagNameText = null;
+          if (xmlAttribute != null) {
+            final ASTNode node = tagAtCaret.getNode();
+            if (node != null) {
+              final ASTNode tagName = XmlChildRole.START_TAG_NAME_FINDER.findChild(node);
+              if (tagName != null) {
+                tagNameText = tagName.getText();
+              }
+            }
+
+            final XmlAttributeValue valueElement = xmlAttribute.getValueElement();
+            final TextRange textRange = xmlAttribute.getTextRange();
+            caretAt = valueElement == null
+                      ? textRange.getStartOffset()
+                      : getClosingQuote(xmlAttribute).length() == 0 ? textRange.getEndOffset() : caretAt;
+          }
+
+          if (tagNameText == null) {
+            tagNameText = text.subSequence(tagAtCaret.getTextRange().getStartOffset() + 1, caretAt);
+          }
+
+          final PsiElement element = psiFile.findElementAt(probableCommaOffset);
+          final XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class);
+          final CharSequence text2insert = getClosingPart(xmlAttribute, tagAtCaret, false);
+
+          if (tag != null && tag.getTextRange().getStartOffset() == probableCommaOffset) {
+            doc.insertString(caretAt, text2insert);
+            if (shouldInsertClosingTag(xmlAttribute, tagAtCaret)) {
+              doc.insertString(tag.getTextRange().getEndOffset() + text2insert.length(), "</" + tagAtCaret.getName() + ">");
+            }
+
+            caretTo = tag.getTextRange().getEndOffset() + text2insert.length();
+          }
+          else {
+            doc.insertString(caretAt, text2insert);
+            if (shouldInsertClosingTag(xmlAttribute, tagAtCaret)) {
+              doc.insertString(probableCommaOffset + text2insert.length(), "</" + tagNameText + ">");
+            }
+
+            caretTo = probableCommaOffset + text2insert.length();
+          }
+        }
+        else if (siebling instanceof XmlTag && siebling.getTextRange().getStartOffset() == caretAt) {
+          final XmlAttribute xmlAttribute = PsiTreeUtil.getParentOfType(atCaret, XmlAttribute.class, false, XmlTag.class);
+          final CharSequence text2insert = getClosingPart(xmlAttribute, tagAtCaret, false);
+
+          doc.insertString(caretAt, text2insert);
+          if (shouldInsertClosingTag(xmlAttribute, tagAtCaret)) {
+            doc.insertString(siebling.getTextRange().getEndOffset() + text2insert.length(), "</" + tagAtCaret.getName() + ">");
+          }
+
+          caretTo = siebling.getTextRange().getEndOffset() + text2insert.length();
+        }
+        else if (probableCommaOffset >= text.length() || ((ch = text.charAt(probableCommaOffset)) != '/' && ch != '>')) {
+          final XmlAttribute xmlAttribute = PsiTreeUtil.getParentOfType(atCaret, XmlAttribute.class, false, XmlTag.class);
+          final CharSequence text2insert = getClosingPart(xmlAttribute, tagAtCaret, true);
+
+          doc.insertString(insertionOffset, text2insert);
+          caretTo = insertionOffset + text2insert.length();
+        }
+
+        commitChanges(project, editor, psiFile, caretTo, null);
+
+        return true;
+      }
+      else {
+        final XmlTag unclosedTag = findClosestUnclosedTag(tagAtCaret);
+        if (unclosedTag == null) {
+          return false;
+        }
+
+        final String closingTagString = "</" + unclosedTag.getName() + ">";
+
+        final XmlTag parentTag = unclosedTag.getParentTag();
+        final ASTNode parentEndTagNode = parentTag != null ? XmlChildRole.CLOSING_TAG_START_FINDER.findChild(parentTag.getNode()) : null;
+        final int offset = parentEndTagNode != null
+                           ? parentEndTagNode.getTextRange().getStartOffset()
+                           : unclosedTag.getTextRange().getEndOffset();
+
+        doc.insertString(offset, closingTagString);
+        commitChanges(project, editor, psiFile, offset, parentTag != null ? parentTag : unclosedTag);
+        return true;
+      }
+    }
+    catch (IncorrectOperationException e) {
+      LOG.error(e);
+    }
+    return false;
+  }
+
+  private void commitChanges(Project project, Editor editor, PsiFile psiFile, int caretOffset, @Nullable XmlTag tagToReformat) {
+    if (isUncommited(project)) {
+      commit(editor);
+      if (tagToReformat == null) {
+        tagToReformat = PsiTreeUtil.getParentOfType(getStatementAtCaret(editor, psiFile), XmlTag.class);
+      }
+      editor.getCaretModel().moveToOffset(caretOffset);
+    }
+    if (tagToReformat != null) {
+      reformat(tagToReformat);
+    }
+    commit(editor);
+  }
+
+  @Nullable
+  private static XmlTag findClosestUnclosedTag(final XmlTag tag) {
+    XmlTag unclosedTag = tag;
+    while (unclosedTag != null) {
+      final PsiElement lastChild = unclosedTag.getLastChild();
+      if (isTagUnclosed(lastChild)) {
+        return unclosedTag;
+      }
+      final XmlTag prevTag = PsiTreeUtil.getPrevSiblingOfType(unclosedTag, XmlTag.class);
+      unclosedTag = prevTag != null ? prevTag : PsiTreeUtil.getParentOfType(unclosedTag, XmlTag.class);
+    }
+    return null;
+  }
+
+  protected static boolean isTagUnclosed(PsiElement lastChild) {
+  //strange approach, but it's universal for xml and html
+    return lastChild != null &&
+           lastChild.getNode().getElementType() != XmlTokenType.XML_TAG_END &&
+           lastChild.getNode().getElementType() != XmlTokenType.XML_EMPTY_ELEMENT_END;
+  }
+
+  protected boolean shouldInsertClosingTag(final XmlAttribute xmlAttribute, final XmlTag tagAtCaret) {
+    return true;
+  }
+
+  protected String getClosingPart(final XmlAttribute xmlAttribute, final XmlTag tagAtCaret, final boolean emptyTag) {
+    return getClosingQuote(xmlAttribute) + (emptyTag ? "/>" : ">");
+  }
+
+  @NotNull
+  protected static CharSequence getClosingQuote(@Nullable final XmlAttribute attribute) {
+    if (attribute == null) {
+      return "";
+    }
+
+    final XmlAttributeValue element = attribute.getValueElement();
+    if (element == null) {
+      return "";
+    }
+
+    final String s = element.getText();
+    if (s != null && s.length() > 0) {
+      if (s.charAt(0) == '"' && s.charAt(s.length() - 1) != '"') {
+        return "\"";
+      }
+      else if (s.charAt(0) == '\'' && s.charAt(s.length() - 1) != '\'') {
+        return "'";
+      }
+    }
+
+    return "";
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/completion/XmlTagInsertHandler.java b/xml/impl/src/com/intellij/codeInsight/completion/XmlTagInsertHandler.java
new file mode 100644
index 0000000..5294534
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/completion/XmlTagInsertHandler.java
@@ -0,0 +1,405 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.completion;
+
+import com.intellij.application.options.editor.WebEditorOptions;
+import com.intellij.codeInsight.TailType;
+import com.intellij.codeInsight.lookup.Lookup;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupItem;
+import com.intellij.codeInsight.template.Template;
+import com.intellij.codeInsight.template.TemplateEditingAdapter;
+import com.intellij.codeInsight.template.TemplateManager;
+import com.intellij.codeInsight.template.impl.MacroCallNode;
+import com.intellij.codeInsight.template.macro.CompleteMacro;
+import com.intellij.codeInsight.template.macro.CompleteSmartMacro;
+import com.intellij.codeInspection.InspectionProfile;
+import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
+import com.intellij.codeInspection.htmlInspections.RequiredAttributesInspection;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.command.undo.UndoManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.RangeMarker;
+import com.intellij.openapi.editor.ScrollType;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.xml.*;
+import com.intellij.xml.actions.GenerateXmlTagAction;
+import com.intellij.xml.impl.schema.XmlElementDescriptorImpl;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+public class XmlTagInsertHandler implements InsertHandler<LookupElement> {
+
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.completion.XmlTagInsertHandler");
+  public static final XmlTagInsertHandler INSTANCE = new XmlTagInsertHandler();
+
+  public void handleInsert(InsertionContext context, LookupElement item) {
+    Project project = context.getProject();
+    Editor editor = context.getEditor();
+    // Need to insert " " to prevent creating tags like <tagThis is my text
+    final int offset = editor.getCaretModel().getOffset();
+    editor.getDocument().insertString(offset, " ");
+    PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
+    PsiElement current = context.getFile().findElementAt(context.getStartOffset());
+    editor.getDocument().deleteString(offset, offset + 1);
+
+    final XmlTag tag = PsiTreeUtil.getContextOfType(current, XmlTag.class, true);
+
+    if (tag == null) return;
+
+    if (context.getCompletionChar() != Lookup.COMPLETE_STATEMENT_SELECT_CHAR) {
+      context.setAddCompletionChar(false);
+    }
+
+    final XmlElementDescriptor descriptor = tag.getDescriptor();
+
+    if (XmlUtil.getTokenOfType(tag, XmlTokenType.XML_TAG_END) == null &&
+        XmlUtil.getTokenOfType(tag, XmlTokenType.XML_EMPTY_ELEMENT_END) == null) {
+
+      if (descriptor != null) {
+        insertIncompleteTag(context.getCompletionChar(), editor, project, descriptor, tag);
+      }
+    }
+    else if (context.getCompletionChar() == Lookup.REPLACE_SELECT_CHAR) {
+      PsiDocumentManager.getInstance(project).commitAllDocuments();
+
+      int caretOffset = editor.getCaretModel().getOffset();
+
+      PsiElement otherTag = PsiTreeUtil.getParentOfType(context.getFile().findElementAt(caretOffset), XmlTag.class);
+
+      PsiElement endTagStart = XmlUtil.getTokenOfType(otherTag, XmlTokenType.XML_END_TAG_START);
+
+      if (endTagStart != null) {
+        PsiElement sibling = endTagStart.getNextSibling();
+
+        assert sibling != null;
+        ASTNode node = sibling.getNode();
+        assert node != null;
+        if (node.getElementType() == XmlTokenType.XML_NAME) {
+          int sOffset = sibling.getTextRange().getStartOffset();
+          int eOffset = sibling.getTextRange().getEndOffset();
+
+          editor.getDocument().deleteString(sOffset, eOffset);
+          assert otherTag != null;
+          editor.getDocument().insertString(sOffset, ((XmlTag)otherTag).getName());
+        }
+      }
+
+      editor.getCaretModel().moveToOffset(caretOffset + 1);
+      editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
+      editor.getSelectionModel().removeSelection();
+    }
+
+    if (context.getCompletionChar() == ' ' && TemplateManager.getInstance(project).getActiveTemplate(editor) != null) {
+      return;
+    }
+
+    final TailType tailType = LookupItem.handleCompletionChar(editor, item, context.getCompletionChar());
+    tailType.processTail(editor, editor.getCaretModel().getOffset());
+  }
+
+  private static void insertIncompleteTag(char completionChar,
+                                          final Editor editor,
+                                          final Project project,
+                                          XmlElementDescriptor descriptor,
+                                          XmlTag tag) {
+    TemplateManager templateManager = TemplateManager.getInstance(project);
+    Template template = templateManager.createTemplate("", "");
+
+    template.setToIndent(true);
+
+    // temp code
+    PsiFile containingFile = tag.getContainingFile();
+    boolean htmlCode = HtmlUtil.hasHtml(containingFile);
+    template.setToReformat(!htmlCode);
+
+    StringBuilder indirectRequiredAttrs = addRequiredAttributes(descriptor, tag, template, containingFile);
+    final boolean chooseAttributeName = addTail(completionChar, descriptor, htmlCode, tag, template, indirectRequiredAttrs);
+
+    templateManager.startTemplate(editor, template, new TemplateEditingAdapter() {
+      private RangeMarker myAttrValueMarker;
+
+      @Override
+      public void waitingForInput(Template template) {
+        int offset = editor.getCaretModel().getOffset();
+        myAttrValueMarker = editor.getDocument().createRangeMarker(offset + 1, offset + 4);
+      }
+
+      public void templateFinished(final Template template, boolean brokenOff) {
+        final int offset = editor.getCaretModel().getOffset();
+
+        if (chooseAttributeName && offset >= 3) {
+          char c = editor.getDocument().getCharsSequence().charAt(offset - 3);
+          if (c == '/' || (c == ' ' && brokenOff)) {
+            new WriteCommandAction.Simple(project) {
+              protected void run() throws Throwable {
+                editor.getDocument().replaceString(offset - 2, offset + 1, ">");
+              }
+            }.execute();
+          }
+        }
+      }
+
+      public void templateCancelled(final Template template) {
+        if (myAttrValueMarker == null) {
+          return;
+        }
+
+        final UndoManager manager = UndoManager.getInstance(project);
+        if (manager.isUndoInProgress() || manager.isRedoInProgress()) {
+          return;
+        }
+
+        if (chooseAttributeName) {
+          final int startOffset = myAttrValueMarker.getStartOffset();
+          final int endOffset = myAttrValueMarker.getEndOffset();
+          new WriteCommandAction.Simple(project) {
+            protected void run() throws Throwable {
+              editor.getDocument().replaceString(startOffset, endOffset, ">");
+            }
+          }.execute();
+        }
+      }
+    });
+  }
+
+  @Nullable
+  private static StringBuilder addRequiredAttributes(XmlElementDescriptor descriptor,
+                                                     @Nullable XmlTag tag,
+                                                     Template template,
+                                                     PsiFile containingFile) {
+
+    boolean htmlCode = HtmlUtil.hasHtml(containingFile);
+    Set<String> notRequiredAttributes = Collections.emptySet();
+
+    if (tag instanceof HtmlTag) {
+      final InspectionProfile profile = InspectionProjectProfileManager.getInstance(tag.getProject()).getInspectionProfile();
+      LocalInspectionToolWrapper localInspectionToolWrapper = (LocalInspectionToolWrapper) profile.getInspectionTool(
+        RequiredAttributesInspection.SHORT_NAME, tag);
+      RequiredAttributesInspection inspection = localInspectionToolWrapper != null ?
+        (RequiredAttributesInspection) localInspectionToolWrapper.getTool(): null;
+
+      if (inspection != null) {
+        StringTokenizer tokenizer = new StringTokenizer(inspection.getAdditionalEntries(0));
+        notRequiredAttributes = new HashSet<String>();
+
+        while(tokenizer.hasMoreElements()) notRequiredAttributes.add(tokenizer.nextToken());
+      }
+    }
+
+    XmlAttributeDescriptor[] attributes = descriptor.getAttributesDescriptors(tag);
+    StringBuilder indirectRequiredAttrs = null;
+
+    if (WebEditorOptions.getInstance().isAutomaticallyInsertRequiredAttributes()) {
+      final XmlExtension extension = XmlExtension.getExtension(containingFile);
+
+      for (XmlAttributeDescriptor attributeDecl : attributes) {
+        String attributeName = attributeDecl.getName(tag);
+
+        if (attributeDecl.isRequired() && (tag == null || tag.getAttributeValue(attributeName) == null)) {
+          if (!notRequiredAttributes.contains(attributeName)) {
+            if (!extension.isIndirectSyntax(attributeDecl)) {
+              template.addTextSegment(" " + attributeName + "=\"");
+              template.addVariable(new MacroCallNode(new CompleteMacro()), true);
+              template.addTextSegment("\"");
+            }
+            else {
+              if (indirectRequiredAttrs == null) indirectRequiredAttrs = new StringBuilder();
+              indirectRequiredAttrs.append("\n<jsp:attribute name=\"").append(attributeName).append("\"></jsp:attribute>\n");
+            }
+          }
+        }
+        else if (attributeDecl.isRequired() && attributeDecl.isFixed() && attributeDecl.getDefaultValue() != null && !htmlCode) {
+          template.addTextSegment(" " + attributeName + "=\"" + attributeDecl.getDefaultValue() + "\"");
+        }
+      }
+    }
+    return indirectRequiredAttrs;
+  }
+
+  protected static boolean addTail(char completionChar,
+                                   XmlElementDescriptor descriptor,
+                                   boolean isHtmlCode,
+                                   XmlTag tag,
+                                   Template template,
+                                   StringBuilder indirectRequiredAttrs) {
+
+    if (completionChar == '>' || (completionChar == '/' && indirectRequiredAttrs != null)) {
+      template.addTextSegment(">");
+      boolean toInsertCDataEnd = false;
+
+      if (descriptor instanceof XmlElementDescriptorWithCDataContent) {
+        final XmlElementDescriptorWithCDataContent cDataContainer = (XmlElementDescriptorWithCDataContent)descriptor;
+
+        if (cDataContainer.requiresCdataBracesInContext(tag)) {
+          template.addTextSegment("<![CDATA[\n");
+          toInsertCDataEnd = true;
+        }
+      }
+
+      if (indirectRequiredAttrs != null) template.addTextSegment(indirectRequiredAttrs.toString());
+      template.addEndVariable();
+
+      if (toInsertCDataEnd) template.addTextSegment("\n]]>");
+
+      if ((!(tag instanceof HtmlTag) || !HtmlUtil.isSingleHtmlTag(tag.getName())) && tag.getAttributes().length == 0) {
+        if (WebEditorOptions.getInstance().isAutomaticallyInsertClosingTag()) {
+          final String name = descriptor.getName(tag);
+          if (name != null) {
+            template.addTextSegment("</");
+            template.addTextSegment(name);
+            template.addTextSegment(">");
+          }
+        }
+      }
+    }
+    else if (completionChar == '/') {
+      template.addTextSegment("/>");
+    }
+    else if (completionChar == ' ' && template.getSegmentsCount() == 0) {
+      if (WebEditorOptions.getInstance().isAutomaticallyStartAttribute() &&
+          (descriptor.getAttributesDescriptors(tag).length > 0 || isTagFromHtml(tag) && !HtmlUtil.isTagWithoutAttributes(tag.getName()))) {
+        completeAttribute(template);
+        return true;
+      }
+    }
+    else if (completionChar == Lookup.AUTO_INSERT_SELECT_CHAR || completionChar == Lookup.NORMAL_SELECT_CHAR || completionChar == Lookup.REPLACE_SELECT_CHAR) {
+      if (WebEditorOptions.getInstance().isAutomaticallyInsertClosingTag() && isHtmlCode && HtmlUtil.isSingleHtmlTag(tag.getName())) {
+        template.addTextSegment(tag instanceof HtmlTag ? ">" : "/>");
+      }
+      else {
+        if (needAlLeastOneAttribute(tag) && WebEditorOptions.getInstance().isAutomaticallyStartAttribute() && tag.getAttributes().length == 0
+            && template.getSegmentsCount() == 0) {
+          completeAttribute(template);
+          return true;
+        }
+        else {
+          completeTagTail(template, descriptor, tag.getContainingFile(), tag, true);
+        }
+      }
+    }
+
+    return false;
+  }
+
+  private static void completeAttribute(Template template) {
+    template.addTextSegment(" ");
+    template.addVariable(new MacroCallNode(new CompleteMacro()), true);
+    template.addTextSegment("=\"");
+    template.addEndVariable();
+    template.addTextSegment("\"");
+  }
+
+  private static boolean needAlLeastOneAttribute(XmlTag tag) {
+    for (XmlTagRuleProvider ruleProvider : XmlTagRuleProvider.EP_NAME.getExtensions()) {
+      for (XmlTagRuleProvider.Rule rule : ruleProvider.getTagRule(tag)) {
+        if (rule.needAtLeastOneAttribute(tag)) {
+          return true;
+        }
+      }
+    }
+
+    return false;
+  }
+
+  private static boolean addRequiredSubTags(Template template, XmlElementDescriptor descriptor, PsiFile file, XmlTag context) {
+
+    if (!WebEditorOptions.getInstance().isAutomaticallyInsertRequiredSubTags()) return false;
+    List<XmlElementDescriptor> requiredSubTags = GenerateXmlTagAction.getRequiredSubTags(descriptor);
+    if (!requiredSubTags.isEmpty()) {
+      template.addTextSegment(">");
+      template.setToReformat(true);
+    }
+    for (XmlElementDescriptor subTag : requiredSubTags) {
+      if (subTag == null) { // placeholder for smart completion
+        template.addTextSegment("<");
+        template.addVariable(new MacroCallNode(new CompleteSmartMacro()), true);
+        continue;
+      }
+      String qname = subTag.getName();
+      if (subTag instanceof XmlElementDescriptorImpl) {
+        String prefixByNamespace = context.getPrefixByNamespace(((XmlElementDescriptorImpl)subTag).getNamespace());
+        if (StringUtil.isNotEmpty(prefixByNamespace)) {
+          qname = prefixByNamespace + ":" + subTag.getName();
+        }
+      }
+      template.addTextSegment("<" + qname);
+      addRequiredAttributes(subTag, null, template, file);
+      completeTagTail(template, subTag, file, context, false);
+    }
+    if (!requiredSubTags.isEmpty()) {
+      addTagEnd(template, descriptor, context);
+    }
+    return !requiredSubTags.isEmpty();
+  }
+
+  private static void completeTagTail(Template template, XmlElementDescriptor descriptor, PsiFile file, XmlTag context, boolean firstLevel) {
+    boolean completeIt = !firstLevel || descriptor.getAttributesDescriptors(null).length == 0;
+    switch (descriptor.getContentType()) {
+      case XmlElementDescriptor.CONTENT_TYPE_UNKNOWN:
+        return;
+      case XmlElementDescriptor.CONTENT_TYPE_EMPTY:
+        if (completeIt) {
+          template.addTextSegment("/>");
+        }
+        break;
+      case XmlElementDescriptor.CONTENT_TYPE_MIXED:
+         if (completeIt) {
+           template.addTextSegment(">");
+           if (firstLevel) {
+             template.addEndVariable();
+           }
+           else {
+             template.addVariable(new MacroCallNode(new CompleteMacro()), true);
+           }
+           addTagEnd(template, descriptor, context);
+         }
+         break;
+       default:
+         if (!addRequiredSubTags(template, descriptor, file, context)) {
+           if (completeIt) {
+             template.addTextSegment(">");
+             template.addEndVariable();
+             addTagEnd(template, descriptor, context);
+           }
+         }
+         break;
+    }
+  }
+
+  private static void addTagEnd(Template template, XmlElementDescriptor descriptor, XmlTag context) {
+    template.addTextSegment("</" + descriptor.getName(context) + ">");
+  }
+
+  private static boolean isTagFromHtml(final XmlTag tag) {
+    final String ns = tag.getNamespace();
+    return XmlUtil.XHTML_URI.equals(ns) || XmlUtil.HTML_URI.equals(ns);
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/XmlErrorMessages.java b/xml/impl/src/com/intellij/codeInsight/daemon/XmlErrorMessages.java
new file mode 100644
index 0000000..dab60a7
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/XmlErrorMessages.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon;
+
+import com.intellij.CommonBundle;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.PropertyKey;
+
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
+import java.util.ResourceBundle;
+
+/**
+ * @author max
+ */
+public class XmlErrorMessages {
+  private static Reference<ResourceBundle> ourBundle;
+
+  @NonNls private static final String BUNDLE = "messages.XmlErrorMessages";
+
+  private XmlErrorMessages() {
+  }
+
+  public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) {
+    return CommonBundle.message(getBundle(), key, params);
+  }
+
+  private static ResourceBundle getBundle() {
+    ResourceBundle bundle = null;
+    if (ourBundle != null) bundle = ourBundle.get();
+    if (bundle == null) {
+      bundle = ResourceBundle.getBundle(BUNDLE);
+      ourBundle = new SoftReference<ResourceBundle>(bundle);
+    }
+    return bundle;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/AddSchemaPrefixIntention.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/AddSchemaPrefixIntention.java
new file mode 100644
index 0000000..e7d6565
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/AddSchemaPrefixIntention.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.InputValidator;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.XmlRecursiveElementVisitor;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.SchemaReferencesProvider;
+import com.intellij.psi.impl.source.xml.SchemaPrefixReference;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class AddSchemaPrefixIntention extends PsiElementBaseIntentionAction {
+  public static final String NAME = "Insert Namespace Prefix";
+
+  public AddSchemaPrefixIntention() {
+    setText(NAME);
+  }
+
+  @NotNull
+  @Override
+  public String getFamilyName() {
+    return NAME;
+  }
+
+  @Override
+  public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
+    final XmlAttribute xmlns = getXmlnsDeclaration(element);
+    if (xmlns == null) return;
+    final String namespace = xmlns.getValue();
+    final XmlTag tag = xmlns.getParent();
+
+    if (tag != null) {
+      final Set<String> ns = tag.getLocalNamespaceDeclarations().keySet();
+      final String nsPrefix = Messages.showInputDialog(project, "Namespace Prefix:", NAME, Messages.getInformationIcon(), "",
+                               new InputValidator() {
+                                 @Override
+                                 public boolean checkInput(String inputString) {
+                                   return !ns.contains(inputString);
+                                 }
+
+                                 @Override
+                                 public boolean canClose(String inputString) {
+                                   return checkInput(inputString);
+                                 }
+                               });
+      if (nsPrefix == null) return;
+      final List<XmlTag> tags = new ArrayList<XmlTag>();
+      final List<XmlAttributeValue> values = new ArrayList<XmlAttributeValue>();
+      new WriteCommandAction(project, NAME, tag.getContainingFile()) {
+        @Override
+        protected void run(Result result) throws Throwable {
+          tag.accept(new XmlRecursiveElementVisitor() {
+            @Override
+            public void visitXmlTag(XmlTag tag) {
+              if (namespace.equals(tag.getNamespace()) && tag.getNamespacePrefix().length() == 0) {
+                tags.add(tag);
+              }
+              super.visitXmlTag(tag);
+            }
+
+            @Override
+            public void visitXmlAttributeValue(XmlAttributeValue value) {
+              PsiReference ref = null;
+              boolean skip = false;
+              for (PsiReference reference : value.getReferences()) {
+                if (reference instanceof SchemaReferencesProvider.TypeOrElementOrAttributeReference) {
+                  ref = reference;
+                } else if (reference instanceof SchemaPrefixReference) {
+                  skip = true;
+                  break;
+                }
+              }
+              if (!skip && ref != null) {
+                final PsiElement xmlElement = ref.resolve();
+                if (xmlElement instanceof XmlElement) {
+                  final XmlTag tag = PsiTreeUtil.getParentOfType(xmlElement, XmlTag.class, false);
+                  if (tag != null) {
+                    if (namespace.equals(tag.getNamespace())) {
+                      if (ref.getRangeInElement().getLength() == value.getValue().length()) { //no ns prefix
+                        values.add(value);
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          });
+          for (XmlAttributeValue value : values) {
+            ((XmlAttribute)value.getParent()).setValue(nsPrefix + ":" + value.getValue());
+          }
+          for (XmlTag xmlTag : tags) {
+            xmlTag.setName(nsPrefix + ":" + xmlTag.getLocalName());
+          }
+          xmlns.setName("xmlns:" + nsPrefix);
+        }
+      }.execute();
+    }
+  }
+
+  @Override
+  public boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiElement element) {
+    return getXmlnsDeclaration(element) != null;
+  }
+
+  @Nullable
+  private static XmlAttribute getXmlnsDeclaration(PsiElement element) {
+    final PsiElement parent = element.getParent();
+    if (parent instanceof XmlTag) {
+      XmlTag tag = (XmlTag)parent;
+      if (tag.getNamespacePrefix().length() == 0) {
+        while (tag != null) {
+          final XmlAttribute attr = tag.getAttribute("xmlns");
+          if (attr != null) return attr;
+          tag = tag.getParentTag();
+        }
+      }
+    } else if (parent instanceof XmlAttribute && ((XmlAttribute)parent).getName().equals("xmlns")) {
+      return (XmlAttribute)parent;
+    }
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/ConvertSchemaPrefixToDefaultIntention.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/ConvertSchemaPrefixToDefaultIntention.java
new file mode 100644
index 0000000..34c4809
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/ConvertSchemaPrefixToDefaultIntention.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.XmlRecursiveElementVisitor;
+import com.intellij.psi.impl.source.xml.SchemaPrefix;
+import com.intellij.psi.impl.source.xml.SchemaPrefixReference;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class ConvertSchemaPrefixToDefaultIntention extends PsiElementBaseIntentionAction {
+  public static final String NAME = "Set Namespace Prefix to Empty";
+
+  public ConvertSchemaPrefixToDefaultIntention() {
+    setText(NAME);
+  }
+
+  @Override
+  public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
+    final XmlAttribute xmlns = getXmlnsDeclaration(element);
+    if (xmlns == null) return;
+    SchemaPrefixReference prefixRef = null;
+    for (PsiReference ref : xmlns.getReferences()) {
+      if (ref instanceof SchemaPrefixReference) {
+        prefixRef = (SchemaPrefixReference)ref;
+        break;
+      }
+    }
+    if (prefixRef == null) return;
+
+    final SchemaPrefix prefix = prefixRef.resolve();
+    final String ns = prefixRef.getNamespacePrefix();
+    final ArrayList<XmlTag> tags = new ArrayList<XmlTag>();
+    final ArrayList<XmlAttribute> attrs = new ArrayList<XmlAttribute>();
+    xmlns.getParent().accept(new XmlRecursiveElementVisitor() {
+      @Override
+      public void visitXmlTag(XmlTag tag) {
+        if (ns.equals(tag.getNamespacePrefix())) {
+          tags.add(tag);
+        }
+        super.visitXmlTag(tag);
+      }
+
+      @Override
+      public void visitXmlAttributeValue(XmlAttributeValue value) {
+        if (value.getValue().startsWith(ns + ":")) {
+          for (PsiReference ref : value.getReferences()) {
+            if (ref instanceof SchemaPrefixReference && ref.isReferenceTo(prefix)) {
+              attrs.add((XmlAttribute)value.getParent());
+            }
+          }
+        }
+      }
+    });
+    new WriteCommandAction(project, "Convert namespace prefix to default", xmlns.getContainingFile()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        final int index = ns.length() + 1;
+        for (XmlTag tag : tags) {
+          final String s = tag.getName().substring(index);
+          if (s.length() > 0) {
+            tag.setName(s);
+          }
+        }
+        for (XmlAttribute attr : attrs) {
+          attr.setValue(attr.getValue().substring(index));
+        }
+        xmlns.setName("xmlns");
+      }
+    }.execute();
+  }
+
+  @Override
+  public boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiElement element) {
+    return getXmlnsDeclaration(element) != null;
+  }
+
+  @NotNull
+  @Override
+  public String getFamilyName() {
+    return NAME;
+  }
+
+  @Nullable
+  private static XmlAttribute getXmlnsDeclaration(PsiElement element) {
+    final PsiElement parent = element.getParent();
+    if (parent == null) return null;
+    for (PsiReference ref : parent.getReferences()) {
+      if (ref instanceof SchemaPrefixReference) {
+        final PsiElement elem = ref.resolve();
+        if (elem != null) {
+          final PsiElement attr = elem.getParent();
+          if (attr instanceof XmlAttribute) {
+            final PsiElement tag = attr.getParent();
+            if (tag instanceof XmlTag && ((XmlTag)tag).getAttribute("xmlns") == null) {
+              return (XmlAttribute)attr;
+            }
+          }
+        }
+      }
+    }
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/CreateNSDeclarationIntentionFix.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/CreateNSDeclarationIntentionFix.java
new file mode 100644
index 0000000..21c8b0d
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/CreateNSDeclarationIntentionFix.java
@@ -0,0 +1,425 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.application.options.XmlSettings;
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.completion.ExtendedTagInsertHandler;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInsight.daemon.impl.ShowAutoImportPass;
+import com.intellij.codeInsight.daemon.impl.VisibleHighlightingPassFactory;
+import com.intellij.codeInsight.hint.HintManager;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInspection.HintAction;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.RangeMarker;
+import com.intellij.openapi.fileEditor.FileEditorManager;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.popup.PopupChooserBuilder;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiAnchor;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.cache.impl.id.IdTableBuilding;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.ui.components.JBList;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlExtension;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import com.intellij.xml.impl.schema.XmlNSDescriptorImpl;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class CreateNSDeclarationIntentionFix implements HintAction, LocalQuickFix {
+
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.analysis.CreateNSDeclarationIntentionFix");
+
+  private final String myNamespacePrefix;
+  private final PsiAnchor myElement;
+  private final PsiAnchor myToken;
+
+  @NotNull
+  private XmlFile getFile() {
+    return (XmlFile)myElement.getFile();
+  }
+
+  @Nullable
+  public static CreateNSDeclarationIntentionFix createFix(@NotNull final PsiElement element, @NotNull final String namespacePrefix) {
+    PsiFile file = element.getContainingFile();
+    return file instanceof XmlFile ? new CreateNSDeclarationIntentionFix(element, namespacePrefix) : null;
+  }
+
+  protected CreateNSDeclarationIntentionFix(@NotNull final PsiElement element,
+                                            @NotNull final String namespacePrefix) {
+    this(element, namespacePrefix, null);
+  }
+
+  public CreateNSDeclarationIntentionFix(@NotNull final PsiElement element,
+                                         final String namespacePrefix,
+                                         @Nullable final XmlToken token) {
+    myNamespacePrefix = namespacePrefix;
+    myElement = PsiAnchor.create(element);
+    myToken = token == null ? null : PsiAnchor.create(token);
+  }
+
+  @Override
+  @NotNull
+  public String getText() {
+    final String alias = StringUtil.capitalize(getXmlExtension().getNamespaceAlias(getFile()));
+    return XmlErrorMessages.message("create.namespace.declaration.quickfix", alias);
+  }
+
+  private XmlExtension getXmlExtension() {
+    return XmlExtension.getExtension(getFile());
+  }
+
+  @Override
+  @NotNull
+  public String getName() {
+    return getFamilyName();
+  }
+
+  @Override
+  @NotNull
+  public String getFamilyName() {
+    return getText();
+  }
+
+  @Override
+  public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
+    final PsiFile containingFile = descriptor.getPsiElement().getContainingFile();
+    Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
+    final PsiFile file = editor != null ? PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()):null;
+    if (file == null || !Comparing.equal(file.getVirtualFile(), containingFile.getVirtualFile())) return;
+
+    try { invoke(project, editor, containingFile); } catch (IncorrectOperationException ex) {
+      LOG.error(ex);
+    }
+  }
+
+  @Override
+  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
+    PsiElement element = myElement.retrieve();
+    return element != null && element.isValid();
+  }
+
+  @Override
+  public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
+    if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
+
+    final PsiElement element = myElement.retrieve();
+    if (element == null) return;
+    final Set<String> set = getXmlExtension().guessUnboundNamespaces(element, getFile());
+    final String[] namespaces = ArrayUtil.toStringArray(set);
+    Arrays.sort(namespaces);
+
+    runActionOverSeveralAttributeValuesAfterLettingUserSelectTheNeededOne(
+      namespaces,
+      project,
+      new StringToAttributeProcessor() {
+        @Override
+        public void doSomethingWithGivenStringToProduceXmlAttributeNowPlease(@NotNull final String namespace) throws IncorrectOperationException {
+          String prefix = myNamespacePrefix;
+          if (StringUtil.isEmpty(prefix)) {
+            final XmlExtension extension = getXmlExtension();
+            final XmlFile xmlFile = extension.getContainingFile(element);
+            prefix = ExtendedTagInsertHandler.getPrefixByNamespace(xmlFile, namespace);
+            if (StringUtil.isNotEmpty(prefix)) {
+              // namespace already declared
+              ExtendedTagInsertHandler.qualifyWithPrefix(prefix, element);
+              return;
+            }
+            else {
+              prefix = ExtendedTagInsertHandler.suggestPrefix(xmlFile, namespace);
+              if (!StringUtil.isEmpty(prefix)) {
+                ExtendedTagInsertHandler.qualifyWithPrefix(prefix, element);
+                PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(editor.getDocument());
+              }
+            }
+          }
+          final int offset = editor.getCaretModel().getOffset();
+          final RangeMarker marker = editor.getDocument().createRangeMarker(offset, offset);
+          final XmlExtension extension = XmlExtension.getExtension(file);
+          extension.insertNamespaceDeclaration((XmlFile)file, editor, Collections.singleton(namespace), prefix, new XmlExtension.Runner<String, IncorrectOperationException>() {
+            @Override
+            public void run(final String param) throws IncorrectOperationException {
+              if (!namespace.isEmpty()) {
+                editor.getCaretModel().moveToOffset(marker.getStartOffset());
+              }
+            }
+          });
+        }
+      }, getTitle(),
+      this,
+      editor);
+  }
+
+  private String getTitle() {
+    return XmlErrorMessages.message("select.namespace.title", StringUtil.capitalize(getXmlExtension().getNamespaceAlias(getFile())));
+  }
+
+  @Override
+  public boolean startInWriteAction() {
+    return true;
+  }
+
+  @Override
+  public boolean showHint(final Editor editor) {
+    if (myToken == null) return false;
+    XmlToken token = (XmlToken)myToken.retrieve();
+    if (token == null) return false;
+    if (!XmlSettings.getInstance().SHOW_XML_ADD_IMPORT_HINTS || myNamespacePrefix.isEmpty()) {
+      return false;
+    }
+    final PsiElement element = myElement.retrieve();
+    if (element == null) return false;
+    final Set<String> namespaces = getXmlExtension().guessUnboundNamespaces(element, getFile());
+    if (!namespaces.isEmpty()) {
+      final String message = ShowAutoImportPass.getMessage(namespaces.size() > 1, namespaces.iterator().next());
+      final String title = getTitle();
+      final ImportNSAction action = new ImportNSAction(namespaces, getFile(), element, editor, title);
+      if (element instanceof XmlTag) {
+        if (VisibleHighlightingPassFactory.calculateVisibleRange(editor).contains(token.getTextRange())) {
+          HintManager.getInstance().showQuestionHint(editor, message,
+                                                     token.getTextOffset(),
+                                                     token.getTextOffset() + myNamespacePrefix.length(), action);
+          return true;        
+        }
+      } else {
+        HintManager.getInstance().showQuestionHint(editor, message,
+                                                   element.getTextOffset(),
+                                                   element.getTextRange().getEndOffset(), action);
+        return true;
+      }
+    }
+    return false;
+  }
+
+  private static boolean checkIfGivenXmlHasTheseWords(final String name, final XmlFile tldFileByUri) {
+    if (name == null || name.isEmpty()) return true;
+    final List<String> list = StringUtil.getWordsIn(name);
+    final String[] words = ArrayUtil.toStringArray(list);
+    final boolean[] wordsFound = new boolean[words.length];
+    final int[] wordsFoundCount = new int[1];
+
+    IdTableBuilding.ScanWordProcessor wordProcessor = new IdTableBuilding.ScanWordProcessor() {
+      @Override
+      public void run(final CharSequence chars, @Nullable char[] charsArray, int start, int end) {
+        if (wordsFoundCount[0] == words.length) return;
+        final int foundWordLen = end - start;
+
+        Next:
+        for (int i = 0; i < words.length; ++i) {
+          final String localName = words[i];
+          if (wordsFound[i] || localName.length() != foundWordLen) continue;
+
+          for (int j = 0; j < localName.length(); ++j) {
+            if (chars.charAt(start + j) != localName.charAt(j)) continue Next;
+          }
+
+          wordsFound[i] = true;
+          wordsFoundCount[0]++;
+          break;
+        }
+      }
+    };
+
+    final CharSequence contents = tldFileByUri.getViewProvider().getContents();
+
+    IdTableBuilding.scanWords(wordProcessor, contents, 0, contents.length());
+
+    return wordsFoundCount[0] == words.length;
+  }
+
+  public interface StringToAttributeProcessor {
+    void doSomethingWithGivenStringToProduceXmlAttributeNowPlease(@NonNls @NotNull String attrName) throws IncorrectOperationException;
+  }
+
+
+  public static void runActionOverSeveralAttributeValuesAfterLettingUserSelectTheNeededOne(@NotNull final String[] namespacesToChooseFrom,
+                                                                                           final Project project, final StringToAttributeProcessor onSelection,
+                                                                                           String title,
+                                                                                           final IntentionAction requestor,
+                                                                                           final Editor editor) throws IncorrectOperationException {
+    
+    if (namespacesToChooseFrom.length > 1 && !ApplicationManager.getApplication().isUnitTestMode()) {
+      final JList list = new JBList(namespacesToChooseFrom);
+      list.setCellRenderer(XmlNSRenderer.INSTANCE);
+      Runnable runnable = new Runnable() {
+        @Override
+        public void run() {
+          final int index = list.getSelectedIndex();
+          if (index < 0) return;
+          PsiDocumentManager.getInstance(project).commitAllDocuments();
+
+          CommandProcessor.getInstance().executeCommand(
+            project,
+            new Runnable() {
+              @Override
+              public void run() {
+                ApplicationManager.getApplication().runWriteAction(
+                  new Runnable() {
+                    @Override
+                    public void run() {
+                      try {
+                        onSelection.doSomethingWithGivenStringToProduceXmlAttributeNowPlease(namespacesToChooseFrom[index]);
+                      } catch (IncorrectOperationException ex) {
+                        throw new RuntimeException(ex);
+                      }
+                    }
+                  }
+                );
+              }
+            },
+            requestor.getText(),
+            requestor.getFamilyName()
+          );
+        }
+      };
+
+      new PopupChooserBuilder(list).
+        setTitle(title).
+        setItemChoosenCallback(runnable).
+        createPopup().
+        showInBestPositionFor(editor);
+    } else {
+      onSelection.doSomethingWithGivenStringToProduceXmlAttributeNowPlease(namespacesToChooseFrom.length == 0 ? "" : namespacesToChooseFrom[0]);
+    }
+  }
+
+  public static void processExternalUris(final MetaHandler metaHandler,
+                                         final PsiFile file,
+                                         final ExternalUriProcessor processor,
+                                         final boolean showProgress) {
+    if (!showProgress || ApplicationManager.getApplication().isUnitTestMode()) {
+      processExternalUrisImpl(metaHandler, file, processor);
+    }
+    else {
+      ProgressManager.getInstance().runProcessWithProgressSynchronously(
+        new Runnable() {
+          @Override
+          public void run() {
+            processExternalUrisImpl(metaHandler, file, processor);
+          }
+        },
+        XmlErrorMessages.message("finding.acceptable.uri"),
+        false,
+        file.getProject()
+      );
+    }
+  }
+
+  public interface MetaHandler {
+    boolean isAcceptableMetaData(PsiMetaData metadata, final String url);
+    String searchFor();
+  }
+
+  public static class TagMetaHandler implements MetaHandler {
+    private final String myName;
+    
+
+    public TagMetaHandler(final String name) {
+      myName = name;
+    }
+
+    @Override
+    public boolean isAcceptableMetaData(final PsiMetaData metaData, final String url) {
+      if (metaData instanceof XmlNSDescriptorImpl) {
+        final XmlNSDescriptorImpl nsDescriptor = (XmlNSDescriptorImpl)metaData;
+
+        final XmlElementDescriptor descriptor = nsDescriptor.getElementDescriptor(searchFor(), url);
+        return descriptor != null && !(descriptor instanceof AnyXmlElementDescriptor);
+      }
+      return false;
+    }
+
+    @Override
+    public String searchFor() {
+      return myName;
+    }
+  }
+
+  private static void processExternalUrisImpl(final MetaHandler metaHandler,
+                                              final PsiFile file,
+                                              final ExternalUriProcessor processor) {
+    final ProgressIndicator pi = ProgressManager.getInstance().getProgressIndicator();
+
+    final String searchFor = metaHandler.searchFor();
+
+    if (pi != null) pi.setText(XmlErrorMessages.message("looking.in.schemas"));
+    final ExternalResourceManager instanceEx = ExternalResourceManager.getInstance();
+    final String[] availableUrls = instanceEx.getResourceUrls(null, true);
+    int i = 0;
+
+    for (String url : availableUrls) {
+      if (pi != null) {
+        pi.setFraction((double)i / availableUrls.length);
+        pi.setText2(url);
+        ++i;
+      }
+      final XmlFile xmlFile = XmlUtil.findNamespace(file, url);
+
+      if (xmlFile != null) {
+        final boolean wordFound = checkIfGivenXmlHasTheseWords(searchFor, xmlFile);
+        if (!wordFound) continue;
+        final XmlDocument document = xmlFile.getDocument();
+        assert document != null;
+        final PsiMetaData metaData = document.getMetaData();
+
+        if (metaHandler.isAcceptableMetaData(metaData, url)) {
+          final XmlNSDescriptorImpl descriptor = metaData instanceof XmlNSDescriptorImpl ? (XmlNSDescriptorImpl)metaData:null;
+          final String defaultNamespace = descriptor != null ? descriptor.getDefaultNamespace():url;
+
+          // Skip rare stuff
+          if (!XmlUtil.XML_SCHEMA_URI2.equals(defaultNamespace) && !XmlUtil.XML_SCHEMA_URI3.equals(defaultNamespace)) {
+            processor.process(defaultNamespace, url);
+          }
+        }
+      }
+    }
+  }
+
+  public interface ExternalUriProcessor {
+    void process(@NotNull String uri,@Nullable final String url);
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/HtmlUnknownTargetInspection.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/HtmlUnknownTargetInspection.java
new file mode 100644
index 0000000..c682036
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/HtmlUnknownTargetInspection.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class HtmlUnknownTargetInspection extends XmlPathReferenceInspection {
+
+  @NotNull
+  @Override
+  public String getShortName() {
+    return "HtmlUnknownTarget";
+  }
+
+  @Override
+  protected boolean isForHtml() {
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/ImportNSAction.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/ImportNSAction.java
new file mode 100644
index 0000000..cbf1771
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/ImportNSAction.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.codeInsight.hint.QuestionAction;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.RangeMarker;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.popup.PopupChooserBuilder;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.ui.components.JBList;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlExtension;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ * @author Dmitry Avdeev
+*/
+public class ImportNSAction implements QuestionAction {
+  private final Set<String> myNamespaces;
+  private final XmlFile myFile;
+  private final PsiElement myElement;
+  private final Editor myEditor;
+  private final String myTitle;
+
+  public ImportNSAction(final Set<String> namespaces, XmlFile file, @NotNull PsiElement element, Editor editor, final String title) {
+
+    myNamespaces = namespaces;
+    myFile = file;
+    myElement = element;
+    myEditor = editor;
+    myTitle = title;
+  }
+
+  public boolean execute() {
+    final Object[] objects = myNamespaces.toArray();
+    Arrays.sort(objects);
+    final JList list = new JBList(objects);
+    list.setCellRenderer(XmlNSRenderer.INSTANCE);
+    list.setSelectedIndex(0);
+    final int offset = myElement.getTextOffset();
+    final RangeMarker marker = myEditor.getDocument().createRangeMarker(offset, offset);
+    final Runnable runnable = new Runnable() {
+
+      public void run() {
+        final String namespace = (String)list.getSelectedValue();
+        if (namespace != null) {
+            final Project project = myFile.getProject();
+            new WriteCommandAction.Simple(project, myFile) {
+
+              protected void run() throws Throwable {
+                final XmlExtension extension = XmlExtension.getExtension(myFile);
+                final String prefix = extension.getNamespacePrefix(myElement);
+                extension.insertNamespaceDeclaration(myFile,
+                                                     myEditor,
+                                                     Collections.singleton(namespace),
+                                                     prefix,
+                                                     new XmlExtension.Runner<String, IncorrectOperationException>() {
+                    public void run(final String s) throws IncorrectOperationException {
+                      PsiDocumentManager.getInstance(myFile.getProject()).doPostponedOperationsAndUnblockDocument(myEditor.getDocument());
+                      PsiElement element = myFile.findElementAt(marker.getStartOffset());
+                      if (element != null) {
+                        extension.qualifyWithPrefix(s, element, myEditor.getDocument());
+                      }
+                    }
+                  }
+                );
+              }
+            }.execute();
+        }
+      }
+    };
+    if (list.getModel().getSize() == 1) {
+      runnable.run();
+    } else {
+      new PopupChooserBuilder(list).
+        setTitle(myTitle).
+        setItemChoosenCallback(runnable).
+        createPopup().
+        showInBestPositionFor(myEditor);
+    }
+
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/InsertRequiredAttributeFix.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/InsertRequiredAttributeFix.java
new file mode 100644
index 0000000..ff3b754
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/InsertRequiredAttributeFix.java
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInsight.intention.HighPriorityAction;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupElementBuilder;
+import com.intellij.codeInsight.template.*;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.source.SourceTreeToPsiMap;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlExtension;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * User: anna
+ * Date: 18-Nov-2005
+ */
+public class InsertRequiredAttributeFix implements IntentionAction, LocalQuickFix, HighPriorityAction {
+  private final XmlTag myTag;
+  private final String myAttrName;
+  private final String[] myValues;
+  @NonNls
+  private static final String NAME_TEMPLATE_VARIABLE = "name";
+
+  public InsertRequiredAttributeFix(final XmlTag tag, final String attrName,final String[] values) {
+    myTag = tag;
+    myAttrName = attrName;
+    myValues = values;
+  }
+
+  @NotNull
+  public String getText() {
+    return XmlErrorMessages.message("insert.required.attribute.quickfix.text", myAttrName);
+  }
+
+  @NotNull
+  public String getName() {
+    return getText();
+  }
+
+  @NotNull
+  public String getFamilyName() {
+    return XmlErrorMessages.message("insert.required.attribute.quickfix.family");
+  }
+
+  public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
+    invoke(project, null, myTag.getContainingFile());
+  }
+
+  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
+    return myTag.isValid();
+  }
+
+  public void invoke(@NotNull final Project project, final Editor editor, PsiFile file) {
+    if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
+    ASTNode treeElement = SourceTreeToPsiMap.psiElementToTree(myTag);
+
+    final XmlElementDescriptor descriptor = myTag.getDescriptor();
+    if (descriptor == null) {
+      return;
+    }
+    final XmlAttributeDescriptor attrDescriptor = descriptor.getAttributeDescriptor(myAttrName, myTag);
+    boolean indirectSyntax = XmlExtension.getExtension(myTag.getContainingFile()).isIndirectSyntax(attrDescriptor);
+
+    PsiElement anchor = SourceTreeToPsiMap.treeElementToPsi(
+      XmlChildRole.EMPTY_TAG_END_FINDER.findChild(treeElement)
+    );
+
+    final boolean anchorIsEmptyTag = anchor != null;
+
+    if (anchor == null) {
+      anchor = SourceTreeToPsiMap.treeElementToPsi(
+        XmlChildRole.START_TAG_END_FINDER.findChild(treeElement)
+      );
+    }
+
+    if (anchor == null) return;
+
+    final Template template = TemplateManager.getInstance(project).createTemplate("", "");
+    if (indirectSyntax) {
+      if (anchorIsEmptyTag) template.addTextSegment(">");
+      template.addTextSegment("<jsp:attribute name=\"" + myAttrName + "\">");
+    } else {
+      template.addTextSegment(" " + myAttrName + "=\"");
+    }
+
+    Expression expression = new Expression() {
+      TextResult result = new TextResult("");
+
+      public Result calculateResult(ExpressionContext context) {
+        return result;
+      }
+
+      public Result calculateQuickResult(ExpressionContext context) {
+        return null;
+      }
+
+      public LookupElement[] calculateLookupItems(ExpressionContext context) {
+        final LookupElement[] items = new LookupElement[myValues == null ? 0 : myValues.length];
+
+        if (myValues != null) {
+          for (int i = 0; i < items.length; i++) {
+            items[i] = LookupElementBuilder.create(myValues[i]);
+          }
+        }
+        return items;
+      }
+    };
+    template.addVariable(NAME_TEMPLATE_VARIABLE, expression, expression, true);
+    if (indirectSyntax) {
+      template.addTextSegment("</jsp:attribute>");
+      template.addEndVariable();
+      if (anchorIsEmptyTag) template.addTextSegment("</" + myTag.getName() + ">");
+    } else {
+      template.addTextSegment("\"");
+    }
+
+    final PsiElement anchor1 = anchor;
+
+    final boolean indirectSyntax1 = indirectSyntax;
+    final Runnable runnable = new Runnable() {
+      public void run() {
+        ApplicationManager.getApplication().runWriteAction(
+          new Runnable() {
+            public void run() {
+              int textOffset = anchor1.getTextOffset();
+              if (!anchorIsEmptyTag && indirectSyntax1) ++textOffset;
+              editor.getCaretModel().moveToOffset(textOffset);
+              if (anchorIsEmptyTag && indirectSyntax1) {
+                editor.getDocument().deleteString(textOffset,textOffset + 2);
+              }
+              TemplateManager.getInstance(project).startTemplate(editor, template);
+            }
+          }
+        );
+      }
+    };
+
+    if (!ApplicationManager.getApplication().isUnitTestMode()) {
+      Runnable commandRunnable = new Runnable() {
+        public void run() {
+          CommandProcessor.getInstance().executeCommand(
+            project,
+            runnable,
+            getText(),
+            getFamilyName()
+          );
+        }
+      };
+
+      ApplicationManager.getApplication().invokeLater(commandRunnable);
+    }
+    else {
+      runnable.run();
+    }
+  }
+
+  public boolean startInWriteAction() {
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/RemoveAttributeIntentionFix.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/RemoveAttributeIntentionFix.java
new file mode 100644
index 0000000..4814d65a
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/RemoveAttributeIntentionFix.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInspection.LocalQuickFixAndIntentionActionOnPsiElement;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlAttribute;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class RemoveAttributeIntentionFix extends LocalQuickFixAndIntentionActionOnPsiElement {
+  private final String myLocalName;
+
+  public RemoveAttributeIntentionFix(final String localName, final @NotNull XmlAttribute attribute) {
+    super(attribute);
+    myLocalName = localName;
+  }
+
+  @NotNull
+  public String getText() {
+    return XmlErrorMessages.message("remove.attribute.quickfix.text", myLocalName);
+  }
+
+  @NotNull
+  public String getFamilyName() {
+    return XmlErrorMessages.message("remove.attribute.quickfix.family");
+  }
+
+  @Override
+  public void invoke(@NotNull Project project,
+                     @NotNull PsiFile file,
+                     @Nullable("is null when called from inspection") Editor editor,
+                     @NotNull PsiElement startElement,
+                     @NotNull PsiElement endElement) {
+    if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
+    PsiElement next = findNextAttribute((XmlAttribute)startElement);
+    startElement.delete();
+
+    if (next != null && editor != null) {
+      editor.getCaretModel().moveToOffset(next.getTextRange().getStartOffset());
+    }
+  }
+
+  @Nullable
+  private static PsiElement findNextAttribute(final XmlAttribute attribute) {
+    PsiElement nextSibling = attribute.getNextSibling();
+    while (nextSibling != null) {
+      if (nextSibling instanceof XmlAttribute) return nextSibling;
+      nextSibling =  nextSibling.getNextSibling();
+    }
+    return null;
+  }
+
+  public boolean startInWriteAction() {
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlErrorQuickFixProvider.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlErrorQuickFixProvider.java
new file mode 100644
index 0000000..9372cb3
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlErrorQuickFixProvider.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.psi.PsiErrorElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.editor.Editor;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+public class XmlErrorQuickFixProvider implements ErrorQuickFixProvider {
+  @NonNls private static final String AMP_ENTITY = "&amp;";
+
+  public void registerErrorQuickFix(final PsiErrorElement element, final HighlightInfo highlightInfo) {
+    if (PsiTreeUtil.getParentOfType(element, XmlTag.class) != null) {
+      registerXmlErrorQuickFix(element,highlightInfo);
+    }
+  }
+
+  private static void registerXmlErrorQuickFix(final PsiErrorElement element, final HighlightInfo highlightInfo) {
+    final String text = element.getErrorDescription();
+    if (text != null && text.startsWith(XmlErrorMessages.message("unescaped.ampersand"))) {
+      QuickFixAction.registerQuickFixAction(highlightInfo, new IntentionAction() {
+        @NotNull
+        public String getText() {
+          return XmlErrorMessages.message("escape.ampersand.quickfix");
+        }
+
+        @NotNull
+        public String getFamilyName() {
+          return getText();
+        }
+
+        public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
+          return true;
+        }
+
+        public void invoke(@NotNull Project project, Editor editor, PsiFile file) {
+          if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
+          final int textOffset = element.getTextOffset();
+          editor.getDocument().replaceString(textOffset,textOffset + 1,AMP_ENTITY);
+        }
+
+        public boolean startInWriteAction() {
+          return true;
+        }
+      });
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitor.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitor.java
new file mode 100644
index 0000000..96b111a
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitor.java
@@ -0,0 +1,777 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.BundleBase;
+import com.intellij.codeInsight.daemon.*;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
+import com.intellij.codeInsight.daemon.impl.HighlightVisitor;
+import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
+import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
+import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixActionRegistrarImpl;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInsight.quickfix.UnresolvedReferenceQuickFixProvider;
+import com.intellij.codeInspection.InspectionProfile;
+import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
+import com.intellij.codeInspection.htmlInspections.RequiredAttributesInspection;
+import com.intellij.codeInspection.htmlInspections.XmlEntitiesInspection;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.dtd.DTDLanguage;
+import com.intellij.lang.injection.InjectedLanguageManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.markup.TextAttributes;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.UserDataCache;
+import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
+import com.intellij.psi.*;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.impl.source.SourceTreeToPsiMap;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceOwner;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.templateLanguages.OuterLanguageElement;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlExtension;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import com.intellij.xml.util.AnchorReference;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlTagUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+/**
+ * @author Mike
+ */
+public class XmlHighlightVisitor extends XmlElementVisitor implements HighlightVisitor, Validator.ValidationHost {
+  private static final Logger LOG = Logger.getInstance("com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor");
+  private static final UserDataCache<Boolean, PsiElement, Object> DO_NOT_VALIDATE =
+    new UserDataCache<Boolean, PsiElement, Object>("do not validate") {
+    @Override
+    protected Boolean compute(PsiElement parent, Object p) {
+      OuterLanguageElement element = PsiTreeUtil.getChildOfType(parent, OuterLanguageElement.class);
+
+      if (element == null) {
+        // JspOuterLanguageElement is located under XmlText
+        for (PsiElement child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
+          if (child instanceof XmlText) {
+            element = PsiTreeUtil.getChildOfType(child, OuterLanguageElement.class);
+            if (element != null) {
+              break;
+            }
+          }
+        }
+      }
+      if (element == null) return false;
+      PsiFile containingFile = parent.getContainingFile();
+      return containingFile.getViewProvider().getBaseLanguage() != containingFile.getLanguage();
+    }
+  };
+  private static boolean ourDoJaxpTesting;
+
+  private static final TextAttributes NONEMPTY_TEXT_ATTRIBUTES = new TextAttributes() {
+    public boolean isEmpty() {
+      return false;
+    }
+  };
+  private HighlightInfoHolder myHolder;
+
+  public XmlHighlightVisitor() {
+  }
+
+  private void addElementsForTag(XmlTag tag,
+                                 String localizedMessage,
+                                 HighlightInfoType type,
+                                 IntentionAction quickFixAction) {
+    addElementsForTagWithManyQuickFixes(tag, localizedMessage, type, quickFixAction);
+  }
+
+  private void addElementsForTagWithManyQuickFixes(XmlTag tag,
+                                                   String localizedMessage,
+                                                   HighlightInfoType type, IntentionAction... quickFixActions) {
+    bindMessageToTag(tag, type, -1, localizedMessage, quickFixActions);
+  }
+
+  @Override public void visitXmlToken(XmlToken token) {
+    IElementType tokenType = token.getTokenType();
+    if (tokenType == XmlTokenType.XML_NAME || tokenType == XmlTokenType.XML_TAG_NAME) {
+      PsiElement element = token.getPrevSibling();
+      while(element instanceof PsiWhiteSpace) element = element.getPrevSibling();
+
+      if (element instanceof XmlToken) {
+        if (((XmlToken)element).getTokenType() == XmlTokenType.XML_START_TAG_START) {
+          PsiElement parent = element.getParent();
+
+          if (parent instanceof XmlTag && !(token.getNextSibling() instanceof OuterLanguageElement)) {
+            checkTag((XmlTag)parent);
+          }
+        }
+      } else {
+        PsiElement parent = token.getParent();
+
+        if (parent instanceof XmlAttribute && !(token.getNextSibling() instanceof OuterLanguageElement)) {
+          checkAttribute((XmlAttribute) parent);
+        }
+      }
+    } else if (tokenType == XmlTokenType.XML_DATA_CHARACTERS && token.getParent() instanceof XmlText) {
+      if (token.textContains(']') && token.textContains('>')) {
+
+        String s = token.getText();
+        String marker = "]]>";
+        int i = s.indexOf(marker);
+
+        if (i != -1 ) {                              // TODO: fix
+          XmlTag tag = PsiTreeUtil.getParentOfType(token, XmlTag.class);
+          if (tag != null && XmlExtension.getExtensionByElement(tag).shouldBeHighlightedAsTag(tag) && !skipValidation(tag)) {
+            TextRange textRange = token.getTextRange();
+            int start = textRange.getStartOffset() + i;
+            HighlightInfo info = HighlightInfo.createHighlightInfo(
+              tag instanceof HtmlTag ? HighlightInfoType.WARNING : HighlightInfoType.ERROR,
+              start, start + marker.length(),
+              XmlErrorMessages.message("cdata.end.should.not.appear.in.content.unless.to.mark.end.of.cdata.section")
+            );
+            addToResults(info);
+          }
+        }
+      }
+    }
+  }
+
+  private void checkTag(XmlTag tag) {
+    if (ourDoJaxpTesting) return;
+
+    if (!myHolder.hasErrorResults()) {
+      checkTagByDescriptor(tag);
+    }
+
+    if (!myHolder.hasErrorResults()) {
+      if (!skipValidation(tag)) {
+        final XmlElementDescriptor descriptor = tag.getDescriptor();
+
+        if (tag instanceof HtmlTag &&
+            ( descriptor instanceof AnyXmlElementDescriptor ||
+              descriptor == null
+            )
+           ) {
+          return;
+        }
+
+        checkReferences(tag);
+      }
+    }
+  }
+
+  private void bindMessageToTag(final XmlTag tag, final HighlightInfoType warning, final int messageLength, final String localizedMessage, IntentionAction... quickFixActions) {
+    XmlToken childByRole = XmlTagUtil.getStartTagNameElement(tag);
+
+    bindMessageToAstNode(childByRole, warning, 0, messageLength, localizedMessage, quickFixActions);
+    childByRole = XmlTagUtil.getEndTagNameElement(tag);
+    bindMessageToAstNode(childByRole, warning, 0, messageLength, localizedMessage, quickFixActions);
+  }
+
+
+  @Override
+  public void visitXmlProcessingInstruction(XmlProcessingInstruction processingInstruction) {
+    super .visitXmlProcessingInstruction(processingInstruction);
+    PsiElement parent = processingInstruction.getParent();
+
+    if (parent instanceof XmlProlog && processingInstruction.getText().startsWith("<?xml")) {
+      for(PsiElement e = PsiTreeUtil.prevLeaf(processingInstruction); e != null; e = PsiTreeUtil.prevLeaf(e)) {
+        if (e instanceof PsiWhiteSpace && PsiTreeUtil.prevLeaf(e) != null ||
+            e instanceof OuterLanguageElement) {
+          continue;
+        }
+        PsiElement eParent = e.getParent();
+        if (eParent instanceof PsiComment) e = eParent;
+        if (eParent instanceof XmlProcessingInstruction) break;
+  
+        addToResults(HighlightInfo.createHighlightInfo(
+          HighlightInfoType.ERROR,
+          e,
+          XmlErrorMessages.message("xml.declaration.should.precede.all.document.content")
+        ));
+      }
+    }
+  }
+
+  private void bindMessageToAstNode(final PsiElement childByRole,
+                                    final HighlightInfoType warning,
+                                    final int offset,
+                                    int length,
+                                    final String localizedMessage, IntentionAction... quickFixActions) {
+    if(childByRole != null) {
+      final TextRange textRange = childByRole.getTextRange();
+      if (length == -1) length = textRange.getLength();
+      final int startOffset = textRange.getStartOffset() + offset;
+
+      HighlightInfo highlightInfo = HighlightInfo.createHighlightInfo(
+        warning,
+        childByRole, startOffset, startOffset + length,
+        localizedMessage, HighlightInfo.htmlEscapeToolTip(localizedMessage)
+      );
+
+      if (highlightInfo == null) {
+        highlightInfo = HighlightInfo.createHighlightInfo(
+          warning,
+          new TextRange(startOffset, startOffset + length),
+          localizedMessage,
+          localizedMessage, NONEMPTY_TEXT_ATTRIBUTES
+        );
+      }
+
+      for (final IntentionAction quickFixAction : quickFixActions) {
+        if (quickFixAction == null) continue;
+        QuickFixAction.registerQuickFixAction(highlightInfo, textRange, quickFixAction);
+      }
+      addToResults(highlightInfo);
+    }
+  }
+
+  private void checkTagByDescriptor(final XmlTag tag) {
+    String name = tag.getName();
+
+    XmlElementDescriptor elementDescriptor;
+
+    final PsiElement parent = tag.getParent();
+    if (parent instanceof XmlTag) {
+      XmlTag parentTag = (XmlTag)parent;
+
+      elementDescriptor = XmlUtil.getDescriptorFromContext(tag);
+
+      final XmlElementDescriptor parentDescriptor = parentTag.getDescriptor();
+
+      if (parentDescriptor != null && elementDescriptor == null && shouldBeValidated(tag)) {
+        if (tag instanceof HtmlTag) {
+          //XmlEntitiesInspection inspection = getInspectionProfile(tag, HtmlStyleLocalInspection.SHORT_NAME);
+          //if (inspection != null /*&& isAdditionallyDeclared(inspection.getAdditionalEntries(XmlEntitiesInspection.UNKNOWN_TAG), name)*/) {
+            return;
+          //}
+        }
+
+        addElementsForTag(
+          tag,
+          XmlErrorMessages.message("element.is.not.allowed.here", name),
+          getTagProblemInfoType(tag),
+          null
+        );
+        return;
+      }
+
+      if (elementDescriptor instanceof AnyXmlElementDescriptor ||
+          elementDescriptor == null
+         ) {
+        elementDescriptor = tag.getDescriptor();
+      }
+
+      if (elementDescriptor == null) return;
+    }
+    else {
+      //root tag
+      elementDescriptor = tag.getDescriptor();
+
+     if (elementDescriptor == null) {
+       addElementsForTag(tag, XmlErrorMessages.message("element.must.be.declared", name), HighlightInfoType.WRONG_REF, null);
+       return;
+      }
+    }
+
+    checkRequiredAttributes(tag, name, elementDescriptor);
+
+    if (elementDescriptor instanceof Validator) {
+      //noinspection unchecked
+      ((Validator<XmlTag>)elementDescriptor).validate(tag,this);
+    }
+  }
+
+  private void checkRequiredAttributes(XmlTag tag, String name, XmlElementDescriptor elementDescriptor) {
+    XmlAttributeDescriptor[] attributeDescriptors = elementDescriptor.getAttributesDescriptors(tag);
+    Set<String> requiredAttributes = null;
+
+    for (XmlAttributeDescriptor attribute : attributeDescriptors) {
+      if (attribute != null && attribute.isRequired()) {
+        if (requiredAttributes == null) {
+          requiredAttributes = new HashSet<String>();
+        }
+        requiredAttributes.add(attribute.getName(tag));
+      }
+    }
+
+    if (requiredAttributes != null) {
+      for (final String attrName : requiredAttributes) {
+        if (tag.getAttributeValue(attrName) == null &&
+            !XmlExtension.getExtension(tag.getContainingFile()).isRequiredAttributeImplicitlyPresent(tag, attrName)) {
+
+          final InsertRequiredAttributeFix insertRequiredAttributeIntention = new InsertRequiredAttributeFix(
+              tag, attrName, null);
+          final String localizedMessage = XmlErrorMessages.message("element.doesnt.have.required.attribute", name, attrName);
+          final InspectionProfile profile = InspectionProjectProfileManager.getInstance(tag.getProject()).getInspectionProfile();
+          final LocalInspectionToolWrapper toolWrapper =
+            (LocalInspectionToolWrapper)profile.getInspectionTool(RequiredAttributesInspection.SHORT_NAME, tag);
+          if (toolWrapper != null) {
+            RequiredAttributesInspection inspection = (RequiredAttributesInspection)toolWrapper.getTool();
+            reportOneTagProblem(
+              tag,
+              attrName,
+              localizedMessage,
+              insertRequiredAttributeIntention,
+              HighlightDisplayKey.find(RequiredAttributesInspection.SHORT_NAME),
+              inspection,
+              XmlEntitiesInspection.NOT_REQUIRED_ATTRIBUTE
+            );
+          }
+        }
+      }
+    }
+  }
+
+  private void reportOneTagProblem(final XmlTag tag,
+                                   final String name,
+                                   final String localizedMessage,
+                                   final IntentionAction basicIntention,
+                                   final HighlightDisplayKey key,
+                                   final XmlEntitiesInspection inspection,
+                                   final int type) {
+    boolean htmlTag = false;
+
+    if (tag instanceof HtmlTag) {
+      htmlTag = true;
+      if(isAdditionallyDeclared(inspection.getAdditionalEntries(type), name)) return;
+    }
+
+    final InspectionProfile profile = InspectionProjectProfileManager.getInstance(tag.getProject()).getInspectionProfile();
+    final IntentionAction intentionAction = inspection.getIntentionAction(name, type);
+    if (htmlTag && profile.isToolEnabled(key, tag)) {
+      addElementsForTagWithManyQuickFixes(
+        tag,
+        localizedMessage,
+        isInjectedHtmlTagForWhichNoProblemsReporting((HtmlTag)tag) ?
+          HighlightInfoType.INFORMATION :
+          SeverityRegistrar.getInstance(tag.getProject()).getHighlightInfoTypeBySeverity(profile.getErrorLevel(key, tag).getSeverity()),
+        intentionAction,
+        basicIntention);
+    } else if (!htmlTag) {
+      addElementsForTag(
+        tag,
+        localizedMessage,
+        HighlightInfoType.ERROR,
+        basicIntention
+      );
+    }
+  }
+
+  private static boolean isAdditionallyDeclared(final String additional, String name) {
+    name = name.toLowerCase();
+    if (!additional.contains(name)) return false;
+
+    StringTokenizer tokenizer = new StringTokenizer(additional, ", ");
+    while (tokenizer.hasMoreTokens()) {
+      if (name.equals(tokenizer.nextToken())) {
+        return true;
+      }
+    }
+
+    return false;
+  }
+
+  private static HighlightInfoType getTagProblemInfoType(XmlTag tag) {
+    if (tag instanceof HtmlTag && XmlUtil.HTML_URI.equals(tag.getNamespace())) {
+      if (isInjectedHtmlTagForWhichNoProblemsReporting((HtmlTag)tag)) return HighlightInfoType.INFORMATION;
+      return HighlightInfoType.WARNING;
+    }
+    return HighlightInfoType.WRONG_REF;
+  }
+
+  private static boolean isInjectedHtmlTagForWhichNoProblemsReporting(HtmlTag tag) {
+    PsiElement context =
+      InjectedLanguageManager.getInstance(tag.getContainingFile().getProject()).getInjectionHost(tag.getContainingFile());
+    return context != null && skipValidation(context);
+  }
+
+  public static boolean skipValidation(PsiElement context) {
+    return DO_NOT_VALIDATE.get(context, null);
+  }
+
+  public static void setSkipValidation(@NotNull PsiElement element) {
+    DO_NOT_VALIDATE.put(element, Boolean.TRUE);
+  }
+
+  @Override public void visitXmlAttribute(XmlAttribute attribute) {}
+
+  private void checkAttribute(XmlAttribute attribute) {
+    XmlTag tag = attribute.getParent();
+
+    final String name = attribute.getName();
+
+    if (XmlExtension.getExtension(attribute.getContainingFile()).needWhitespaceBeforeAttribute()) {
+      PsiElement prevLeaf = PsiTreeUtil.prevLeaf(attribute);
+
+      if (!(prevLeaf instanceof PsiWhiteSpace)) {
+        TextRange textRange = attribute.getTextRange();
+        addToResults(HighlightInfo.createHighlightInfo(
+          tag instanceof HtmlTag ? HighlightInfoType.WARNING : HighlightInfoType.ERROR,
+          textRange.getStartOffset(),
+          textRange.getStartOffset(),
+          XmlErrorMessages.message("attribute.should.be.preceded.with.space")
+        ));
+      }
+    }
+
+    if (attribute.isNamespaceDeclaration()) {
+      checkReferences(attribute.getValueElement());
+      return;
+    }
+    final String namespace = attribute.getNamespace();
+
+    if (XmlUtil.XML_SCHEMA_INSTANCE_URI.equals(namespace)) {
+      checkReferences(attribute.getValueElement());
+      return;
+    }
+
+    XmlElementDescriptor elementDescriptor = tag.getDescriptor();
+    if (elementDescriptor == null ||
+        elementDescriptor instanceof AnyXmlElementDescriptor ||
+        ourDoJaxpTesting) {
+      return;
+    }
+
+    XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor(attribute);
+
+    if (attributeDescriptor == null) {
+      if (!XmlUtil.attributeFromTemplateFramework(name, tag)) {
+        final String localizedMessage = XmlErrorMessages.message("attribute.is.not.allowed.here", name);
+        final HighlightInfo highlightInfo = reportAttributeProblem(tag, name, attribute, localizedMessage);
+        if (highlightInfo != null) {
+          PsiFile file = tag.getContainingFile();
+          if (file != null) {
+            XmlExtension.getExtension(file).createAddAttributeFix(attribute, highlightInfo);
+          }
+        }
+      }
+    }
+    else {
+      checkDuplicateAttribute(tag, attribute);
+
+      if (tag instanceof HtmlTag &&
+          attribute.getValueElement() == null &&
+          !HtmlUtil.isSingleHtmlAttribute(name)
+         ) {
+        final String localizedMessage = XmlErrorMessages.message("empty.attribute.is.not.allowed", name);
+        reportAttributeProblem(tag, name, attribute, localizedMessage);
+      }
+
+      // we skip resolve of attribute references since there is separate check when taking attribute descriptors
+      PsiReference[] attrRefs = attribute.getReferences();
+      doCheckRefs(attribute, attrRefs, attribute.getNamespacePrefix().length() > 0 ? 2 : 1);
+    }
+  }
+
+  @Nullable
+  private HighlightInfo reportAttributeProblem(final XmlTag tag,
+                                               final String localName,
+                                               final XmlAttribute attribute,
+                                               final String localizedMessage) {
+
+    final RemoveAttributeIntentionFix removeAttributeIntention = new RemoveAttributeIntentionFix(localName,attribute);
+
+    if (!(tag instanceof HtmlTag)) {
+      final HighlightInfoType tagProblemInfoType = HighlightInfoType.WRONG_REF;
+
+      final ASTNode node = SourceTreeToPsiMap.psiElementToTree(attribute);
+      assert node != null;
+      final ASTNode child = XmlChildRole.ATTRIBUTE_NAME_FINDER.findChild(node);
+      assert child != null;
+      final HighlightInfo highlightInfo = HighlightInfo.createHighlightInfo(
+        tagProblemInfoType, child,
+        localizedMessage
+      );
+      addToResults(highlightInfo);
+
+      QuickFixAction.registerQuickFixAction(highlightInfo, removeAttributeIntention);
+
+      return highlightInfo;
+    }
+
+    return null;
+  }
+
+  private void checkDuplicateAttribute(XmlTag tag, final XmlAttribute attribute) {
+    if (skipValidation(tag)) {
+      return;
+    }
+
+    final XmlAttribute[] attributes = tag.getAttributes();
+    final PsiFile containingFile = tag.getContainingFile();
+    final XmlExtension extension = containingFile instanceof XmlFile ?
+                                   XmlExtension.getExtension(containingFile) :
+                                   XmlExtension.DEFAULT_EXTENSION;
+    for (XmlAttribute tagAttribute : attributes) {
+      ProgressManager.checkCanceled();
+      if (attribute != tagAttribute && Comparing.strEqual(attribute.getName(), tagAttribute.getName())) {
+        final String localName = attribute.getLocalName();
+
+        if (extension.canBeDuplicated(tagAttribute)) continue; // multiple import attributes are allowed in jsp directive
+
+        HighlightInfo highlightInfo = HighlightInfo.createHighlightInfo(
+          getTagProblemInfoType(tag),
+          XmlChildRole.ATTRIBUTE_NAME_FINDER.findChild(SourceTreeToPsiMap.psiElementToTree(attribute)),
+          XmlErrorMessages.message("duplicate.attribute", localName));
+        addToResults(highlightInfo);
+
+        IntentionAction intentionAction = new RemoveAttributeIntentionFix(localName, attribute);
+
+        QuickFixAction.registerQuickFixAction(highlightInfo, intentionAction);
+      }
+    }
+  }
+
+  @Override public void visitXmlDocument(final XmlDocument document) {
+    if (document.getLanguage() == DTDLanguage.INSTANCE) {
+      final PsiMetaData psiMetaData = document.getMetaData();
+      if (psiMetaData instanceof Validator) {
+        //noinspection unchecked
+        ((Validator<XmlDocument>)psiMetaData).validate(document, this);
+      }
+    }
+  }
+
+  @Override public void visitXmlTag(XmlTag tag) {
+  }
+
+  @Override public void visitXmlAttributeValue(XmlAttributeValue value) {
+    checkReferences(value);
+
+    final PsiElement parent = value.getParent();
+    if (!(parent instanceof XmlAttribute)) {
+      return;
+    }
+
+    XmlAttribute attribute = (XmlAttribute)parent;
+
+    XmlTag tag = attribute.getParent();
+
+    XmlElementDescriptor elementDescriptor = tag.getDescriptor();
+    XmlAttributeDescriptor attributeDescriptor = elementDescriptor != null ? elementDescriptor.getAttributeDescriptor(attribute):null;
+
+    if (attributeDescriptor != null && !skipValidation(value)) {
+      String error = attributeDescriptor.validateValue(value, attribute.getValue());
+
+      if (error != null) {
+        addToResults(HighlightInfo.createHighlightInfo(
+            getTagProblemInfoType(tag),
+            value,
+            error));
+      }
+    }
+  }
+
+  private void checkReferences(PsiElement value) {
+    if (value == null) return;
+
+    doCheckRefs(value, value.getReferences(), 0);
+  }
+
+  private void doCheckRefs(final PsiElement value, final PsiReference[] references, int start) {
+    for (int i = start; i < references.length; ++i) {
+      PsiReference reference = references[i];
+      ProgressManager.checkCanceled();
+      if (isUrlReference(reference)) continue;
+      if (!hasBadResolve(reference, false)) {
+        continue;
+      }
+      String description = getErrorDescription(reference);
+
+      final int startOffset = reference.getElement().getTextRange().getStartOffset();
+      final TextRange referenceRange = reference.getRangeInElement();
+
+      // logging for IDEADEV-29655
+      if (referenceRange.getStartOffset() > referenceRange.getEndOffset()) {
+        LOG.error("Reference range start offset > end offset:  " + reference +
+        ", start offset: " + referenceRange.getStartOffset() + ", end offset: " + referenceRange.getEndOffset());
+      }
+
+      HighlightInfoType type = getTagProblemInfoType(PsiTreeUtil.getParentOfType(value, XmlTag.class));
+      if (value instanceof XmlAttributeValue) {
+        PsiElement parent = value.getParent();
+        if (parent instanceof XmlAttribute) {
+          String name = ((XmlAttribute)parent).getName().toLowerCase();
+          if (type.getSeverity(null).compareTo(HighlightInfoType.WARNING.getSeverity(null)) > 0 && name.endsWith("stylename")) {
+            type = HighlightInfoType.WARNING;
+          }
+        }
+      }
+      HighlightInfo info = HighlightInfo.createHighlightInfo(
+        type,
+        startOffset + referenceRange.getStartOffset(),
+        startOffset + referenceRange.getEndOffset(),
+        description
+      );
+      addToResults(info);
+      if (reference instanceof QuickFixProvider) ((QuickFixProvider)reference).registerQuickfix(info, reference);
+      UnresolvedReferenceQuickFixProvider.registerReferenceFixes(reference, new QuickFixActionRegistrarImpl(info));
+    }
+  }
+
+  public static boolean isUrlReference(PsiReference reference) {
+    if (reference instanceof FileReferenceOwner || reference instanceof AnchorReference) {
+      return true;
+    }
+    return false;
+  }
+
+  public static String getErrorDescription(final PsiReference reference) {
+    String message;
+    if (reference instanceof EmptyResolveMessageProvider) {
+      message = ((EmptyResolveMessageProvider)reference).getUnresolvedMessagePattern();
+    }
+    else {
+      //noinspection UnresolvedPropertyKey
+      message = PsiBundle.message("cannot.resolve.symbol");
+    }
+
+    String description;
+    try {
+      description = BundleBase.format(message, reference.getCanonicalText()); // avoid double formatting
+    }
+    catch (IllegalArgumentException ex) {
+      // unresolvedMessage provided by third-party reference contains wrong format string (e.g. {}), tolerate it
+      description = message;
+    }
+    return description;
+  }
+
+  public static boolean hasBadResolve(final PsiReference reference, boolean checkSoft) {
+    if (!checkSoft && reference.isSoft()) return false;
+    if (reference instanceof PsiPolyVariantReference) {
+      return ((PsiPolyVariantReference)reference).multiResolve(false).length == 0;
+    }
+    return reference.resolve() == null;
+  }
+
+  @Override public void visitXmlDoctype(XmlDoctype xmlDoctype) {
+    if (skipValidation(xmlDoctype)) return;
+    checkReferences(xmlDoctype);
+  }
+
+  private void addToResults(final HighlightInfo info) {
+    myHolder.add(info);
+  }
+
+  public static void setDoJaxpTesting(boolean doJaxpTesting) {
+    ourDoJaxpTesting = doJaxpTesting;
+  }
+
+  public void addMessage(PsiElement context, String message, int type) {
+    if (message != null && message.length() > 0) {
+      if (context instanceof XmlTag && XmlExtension.getExtension(context.getContainingFile()).shouldBeHighlightedAsTag((XmlTag)context)) {
+        HighlightInfoType infoType = type == ERROR ? HighlightInfoType.ERROR : type == WARNING ? HighlightInfoType.WARNING : HighlightInfoType.WEAK_WARNING;
+        addElementsForTag((XmlTag)context, message, infoType, null);
+      }
+      else {
+        addToResults(HighlightInfo.createHighlightInfo(HighlightInfoType.WRONG_REF, context, message));
+      }
+    }
+  }
+
+  public void addMessage(final PsiElement context, final String message, final ErrorType type, final IntentionAction... fixes) {
+    if (message != null && message.length() > 0) {
+      final PsiFile containingFile = context.getContainingFile();
+      final HighlightInfoType defaultInfoType = type == ErrorType.ERROR ? HighlightInfoType.ERROR : type == ErrorType.WARNING ? HighlightInfoType.WARNING : HighlightInfoType.WEAK_WARNING;
+
+      if (context instanceof XmlTag && XmlExtension.getExtension(containingFile).shouldBeHighlightedAsTag((XmlTag)context)) {
+        addElementsForTagWithManyQuickFixes((XmlTag)context, message, defaultInfoType, fixes);
+      }
+      else {
+        final PsiElement contextOfFile = InjectedLanguageManager.getInstance(containingFile.getProject()).getInjectionHost(containingFile);
+        final HighlightInfo highlightInfo;
+
+        if (contextOfFile != null) {
+          TextRange range = InjectedLanguageManager.getInstance(context.getProject()).injectedToHost(context, context.getTextRange());
+          highlightInfo = HighlightInfo.createHighlightInfo(defaultInfoType, range, message);
+        }
+        else {
+          highlightInfo = HighlightInfo.createHighlightInfo(HighlightInfoType.WRONG_REF, context, message);
+        }
+
+        if (fixes != null) {
+          for (final IntentionAction quickFixAction : fixes) {
+            if (quickFixAction == null) continue;
+            QuickFixAction.registerQuickFixAction(highlightInfo, quickFixAction);
+          }
+        }
+        addToResults(highlightInfo);
+      }
+    }
+  }
+
+  public boolean suitableForFile(@NotNull final PsiFile file) {
+    return file instanceof XmlFile;
+  }
+
+  public void visit(@NotNull final PsiElement element) {
+    element.accept(this);
+  }
+
+  public boolean analyze(@NotNull final PsiFile file,
+                         final boolean updateWholeFile,
+                         @NotNull HighlightInfoHolder holder,
+                         @NotNull Runnable action) {
+    myHolder = holder;
+    try {
+      action.run();
+    }
+    finally {
+      myHolder = null;
+    }
+    return true;
+  }
+
+  @NotNull
+  public HighlightVisitor clone() {
+    return new XmlHighlightVisitor();
+  }
+
+  public int order() {
+    return 1;
+  }
+
+  public static String getUnquotedValue(XmlAttributeValue value, XmlTag tag) {
+    String unquotedValue = value.getValue();
+
+    if (tag instanceof HtmlTag) {
+      unquotedValue = unquotedValue.toLowerCase();
+    }
+
+    return unquotedValue;
+  }
+
+  public static boolean shouldBeValidated(@NotNull XmlTag tag) {
+    PsiElement parent = tag.getParent();
+    if (parent instanceof XmlTag) {
+      return !skipValidation(parent) && !XmlUtil.tagFromTemplateFramework(tag);
+    }
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitorBasedInspection.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitorBasedInspection.java
new file mode 100644
index 0000000..50a9665
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitorBasedInspection.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.HighlightInfoFilter;
+import com.intellij.codeInspection.*;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.XmlRecursiveElementVisitor;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author yole
+ */
+public class XmlHighlightVisitorBasedInspection extends GlobalSimpleInspectionTool {
+  @NotNull
+  @Override
+  public HighlightDisplayLevel getDefaultLevel() {
+    return HighlightDisplayLevel.ERROR;
+  }
+
+  @Override
+  public void checkFile(@NotNull final PsiFile file,
+                        @NotNull final InspectionManager manager,
+                        @NotNull ProblemsHolder problemsHolder,
+                        @NotNull final GlobalInspectionContext globalContext,
+                        @NotNull final ProblemDescriptionsProcessor problemDescriptionsProcessor) {
+    HighlightInfoHolder myHolder = new HighlightInfoHolder(file, HighlightInfoFilter.EMPTY_ARRAY) {
+      @Override
+      public boolean add(@Nullable HighlightInfo info) {
+        if (info != null) {
+          GlobalInspectionUtil.createProblem(
+            file,
+            info,
+            new TextRange(info.startOffset, info.endOffset),
+            null,
+            manager,
+            problemDescriptionsProcessor,
+            globalContext
+          );
+        }
+        return true;
+      }
+    };
+    final XmlHighlightVisitor highlightVisitor = new XmlHighlightVisitor();
+    highlightVisitor.analyze(file, true, myHolder, new Runnable() {
+      @Override
+      public void run() {
+        file.accept(new XmlRecursiveElementVisitor() {
+          @Override
+          public void visitElement(PsiElement element) {
+            highlightVisitor.visit(element);
+            super.visitElement(element);
+          }
+        });
+      }
+    });
+
+  }
+
+  @Nls
+  @NotNull
+  @Override
+  public String getGroupDisplayName() {
+    return InspectionProfileEntry.GENERAL_GROUP_NAME;
+  }
+
+  @Nls
+  @NotNull
+  @Override
+  public String getDisplayName() {
+    return "XML highlighting";
+  }
+
+  @NotNull
+  @Override
+  public String getShortName() {
+    return "XmlHighlighting";
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlNSRenderer.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlNSRenderer.java
new file mode 100644
index 0000000..3dc1b02
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlNSRenderer.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.openapi.editor.colors.EditorColorsManager;
+import com.intellij.openapi.editor.colors.EditorColorsScheme;
+import com.intellij.ui.ColoredListCellRenderer;
+import com.intellij.ui.SimpleTextAttributes;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlNSRenderer extends ColoredListCellRenderer {
+
+  public static final XmlNSRenderer INSTANCE = new XmlNSRenderer();
+
+  public XmlNSRenderer() {
+    EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
+    setFont(new Font(scheme.getEditorFontName(), Font.PLAIN, scheme.getEditorFontSize()));
+  }
+
+  protected void customizeCellRenderer(final JList list,
+                                       final Object value,
+                                       final int index,
+                                       final boolean selected,
+                                       final boolean hasFocus) {
+    append(value.toString(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
+    setIcon(AllIcons.Nodes.Static);
+    setPaintFocusBorder(false);
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlPathReferenceInspection.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlPathReferenceInspection.java
new file mode 100644
index 0000000..555fa15
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlPathReferenceInspection.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.codeInspection.XmlSuppressableInspectionTool;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiElementVisitor;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.XmlElementVisitor;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlDoctype;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.util.HtmlUtil;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 9/3/12
+ */
+public class XmlPathReferenceInspection extends XmlSuppressableInspectionTool {
+
+  @NotNull
+  @Override
+  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
+    return new XmlElementVisitor() {
+      @Override
+      public void visitXmlAttributeValue(XmlAttributeValue value) {
+        checkRefs(value, holder, isOnTheFly);
+      }
+
+      @Override
+      public void visitXmlDoctype(XmlDoctype xmlDoctype) {
+        checkRefs(xmlDoctype, holder, isOnTheFly);
+      }
+
+      @Override
+      public void visitXmlTag(XmlTag tag) {
+        checkRefs(tag, holder, isOnTheFly);
+      }
+    };
+  }
+  
+  private void checkRefs(PsiElement element, ProblemsHolder holder, boolean isOnTheFly) {
+    PsiReference[] references = element.getReferences();
+    for (PsiReference reference : references) {
+      if (!XmlHighlightVisitor.isUrlReference(reference)) {
+        continue;
+      }
+      boolean isHtml = HtmlUtil.isHtmlTagContainingFile(element);
+      if (isHtml ^ isForHtml()) {
+        continue;
+      }
+      if (!isHtml && XmlHighlightVisitor.skipValidation(element)) {
+        continue;
+      }
+      if (XmlHighlightVisitor.hasBadResolve(reference, false)) {
+        holder.registerProblem(reference, ProblemsHolder.unresolvedReferenceMessage(reference),
+                               isHtml ? ProblemHighlightType.GENERIC_ERROR_OR_WARNING : ProblemHighlightType.LIKE_UNKNOWN_SYMBOL);
+      }
+    }
+  }
+
+  protected boolean isForHtml() {
+    return false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlUnboundNsPrefixInspection.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlUnboundNsPrefixInspection.java
new file mode 100644
index 0000000..777c3ac
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlUnboundNsPrefixInspection.java
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.codeInspection.XmlSuppressableInspectionTool;
+import com.intellij.lang.injection.InjectedLanguageManager;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.source.xml.SchemaPrefixReference;
+import com.intellij.psi.templateLanguages.OuterLanguageElement;
+import com.intellij.psi.xml.*;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlExtension;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import com.intellij.xml.util.XmlTagUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlUnboundNsPrefixInspection extends XmlSuppressableInspectionTool {
+
+  @NonNls private static final String XML = "xml";
+
+  @NotNull
+  @Override
+  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
+    return new XmlElementVisitor() {
+
+      private Boolean isXml;
+
+      private boolean isXmlFile(XmlElement element) {
+        if (isXml == null) {
+          final PsiFile file = element.getContainingFile();
+          isXml = file instanceof XmlFile && !InjectedLanguageManager.getInstance(element.getProject()).isInjectedFragment(file);
+        }
+        return isXml.booleanValue();
+      }
+
+      @Override
+      public void visitXmlToken(final XmlToken token) {
+        if (isXmlFile(token) && token.getTokenType() == XmlTokenType.XML_NAME) {
+          PsiElement element = token.getPrevSibling();
+          while(element instanceof PsiWhiteSpace) element = element.getPrevSibling();
+
+          if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_START_TAG_START) {
+            PsiElement parent = element.getParent();
+
+            if (parent instanceof XmlTag && !(token.getNextSibling() instanceof OuterLanguageElement)) {
+              XmlTag tag = (XmlTag)parent;
+              checkUnboundNamespacePrefix(tag, tag, tag.getNamespacePrefix(), token, holder, isOnTheFly);
+            }
+          }
+        }
+      }
+
+      @Override
+      public void visitXmlAttribute(final XmlAttribute attribute) {
+        if (!isXmlFile(attribute)) {
+          return;
+        }
+        final String namespace = attribute.getNamespace();
+        if (attribute.isNamespaceDeclaration() || XmlUtil.XML_SCHEMA_INSTANCE_URI.equals(namespace)) {
+          return;
+        }
+
+        XmlTag tag = attribute.getParent();
+        XmlElementDescriptor elementDescriptor = tag.getDescriptor();
+        if (elementDescriptor == null ||
+            elementDescriptor instanceof AnyXmlElementDescriptor) {
+          return;
+        }
+
+
+        final String name = attribute.getName();
+
+        checkUnboundNamespacePrefix(attribute, tag, XmlUtil.findPrefixByQualifiedName(name), null, holder, isOnTheFly);
+      }
+
+      @Override
+      public void visitXmlAttributeValue(XmlAttributeValue value) {
+        PsiReference[] references = value.getReferences();
+        for (PsiReference reference : references) {
+          if (reference instanceof SchemaPrefixReference) {
+            if (!XML.equals(((SchemaPrefixReference)reference).getNamespacePrefix()) && reference.resolve() == null) {
+              holder.registerProblem(reference, XmlErrorMessages.message("unbound.namespace",
+                                                                         ((SchemaPrefixReference)reference).getNamespacePrefix()), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL);
+            }
+          }
+        }
+      }
+    };
+  }
+
+  private static void checkUnboundNamespacePrefix(final XmlElement element, final XmlTag context, String namespacePrefix, final XmlToken token,
+                                                  final ProblemsHolder holder, boolean isOnTheFly) {
+
+    if (namespacePrefix.length() == 0 && (!(element instanceof XmlTag) || !(element.getParent() instanceof XmlDocument))
+      || XML.equals(namespacePrefix)) {
+      return;
+    }
+
+    final String namespaceByPrefix = context.getNamespaceByPrefix(namespacePrefix);
+    if (namespaceByPrefix.length() != 0) {
+      return;
+    }
+    PsiFile psiFile = context.getContainingFile();
+    if (!(psiFile instanceof XmlFile)) return;
+    final XmlFile containingFile = (XmlFile)psiFile;
+    if (!HighlightLevelUtil.shouldInspect(containingFile)) return;
+
+    final XmlExtension extension = XmlExtension.getExtension(containingFile);
+    if (extension.getPrefixDeclaration(context, namespacePrefix) != null) {
+      return;
+    }
+
+    final String localizedMessage = isOnTheFly ? XmlErrorMessages.message("unbound.namespace", namespacePrefix) : XmlErrorMessages.message("unbound.namespace.no.param");
+
+    if (namespacePrefix.length() == 0) {
+      final XmlTag tag = (XmlTag)element;
+      if (!XmlUtil.JSP_URI.equals(tag.getNamespace())) {
+        reportTagProblem(tag, localizedMessage, null, ProblemHighlightType.INFORMATION, 
+                         isOnTheFly ? new CreateNSDeclarationIntentionFix(context, namespacePrefix, token) : null,
+                         holder);
+      }
+      return;
+    }
+
+    final int prefixLength = namespacePrefix.length();
+    final TextRange range = new TextRange(0, prefixLength);
+    final HighlightInfoType infoType = extension.getHighlightInfoType(containingFile);
+    final ProblemHighlightType highlightType = infoType == HighlightInfoType.ERROR ? ProblemHighlightType.ERROR : ProblemHighlightType.LIKE_UNKNOWN_SYMBOL;
+    if (element instanceof XmlTag) {
+      final CreateNSDeclarationIntentionFix fix = isOnTheFly ? new CreateNSDeclarationIntentionFix(context, namespacePrefix, token) : null;
+      reportTagProblem(element, localizedMessage, range, highlightType, fix, holder);
+    } else {
+      holder.registerProblem(element, localizedMessage, highlightType, range);
+    }
+  }
+
+  private static void reportTagProblem(final XmlElement element, final String localizedMessage, final TextRange range, final ProblemHighlightType highlightType,
+                                       final CreateNSDeclarationIntentionFix fix,
+                                       final ProblemsHolder holder) {
+
+    XmlToken nameToken = XmlTagUtil.getStartTagNameElement((XmlTag)element);
+    if (nameToken != null) {
+      holder.registerProblem(nameToken, localizedMessage, highlightType, range, fix);
+    }
+    nameToken = XmlTagUtil.getEndTagNameElement((XmlTag)element);
+    if (nameToken != null) {
+      holder.registerProblem(nameToken, localizedMessage, highlightType, range, fix);
+    }
+  }
+
+
+  @NotNull
+  public HighlightDisplayLevel getDefaultLevel() {
+    return HighlightDisplayLevel.WARNING;
+  }
+
+  public boolean isEnabledByDefault() {
+    return true;
+  }
+
+  @NotNull
+  public String getGroupDisplayName() {
+    return XmlBundle.message("xml.inspections.group.name");
+  }
+
+  @NotNull
+  public String getDisplayName() {
+    return XmlBundle.message("xml.inspections.unbound.prefix");
+  }
+
+  @NotNull
+  @NonNls
+  public String getShortName() {
+    return "XmlUnboundNsPrefix";
+  }
+}
+
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlUnusedNamespaceInspection.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlUnusedNamespaceInspection.java
new file mode 100644
index 0000000..b5d8245
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlUnusedNamespaceInspection.java
@@ -0,0 +1,383 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.daemon.ImplicitUsageProvider;
+import com.intellij.codeInspection.*;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.URLReference;
+import com.intellij.psi.impl.source.xml.SchemaPrefix;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.XmlExtension;
+import com.intellij.xml.util.XmlRefCountHolder;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlUnusedNamespaceInspection extends XmlSuppressableInspectionTool {
+
+  private static final String NAMESPACE_LOCATION_IS_NEVER_USED = "Namespace location is never used";
+
+  @NotNull
+  @Override
+  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) {
+
+    return new XmlElementVisitor() {
+
+      @Override
+      public void visitXmlAttribute(XmlAttribute attribute) {
+        if (!attribute.isNamespaceDeclaration()) {
+          checkUnusedLocations(attribute, holder);
+          return;
+        }
+        XmlRefCountHolder refCountHolder = XmlRefCountHolder.getRefCountHolder(attribute);
+        if (refCountHolder == null) return;
+
+        String namespace = attribute.getValue();
+        String declaredPrefix = getDeclaredPrefix(attribute);
+        if (namespace != null && !refCountHolder.isInUse(declaredPrefix)) {
+
+          ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
+          for (ImplicitUsageProvider provider : implicitUsageProviders) {
+            if (provider.isImplicitUsage(attribute)) return;
+          }
+
+          XmlAttributeValue value = attribute.getValueElement();
+          assert value != null;
+          holder.registerProblem(attribute, "Namespace declaration is never used", ProblemHighlightType.LIKE_UNUSED_SYMBOL,
+                                 new RemoveNamespaceDeclarationFix(declaredPrefix, false));
+
+          XmlTag parent = attribute.getParent();
+          if (declaredPrefix.length() == 0) {
+            XmlAttribute location = getDefaultLocation(parent);
+            if (location != null) {
+              holder.registerProblem(location, NAMESPACE_LOCATION_IS_NEVER_USED, ProblemHighlightType.LIKE_UNUSED_SYMBOL,
+                                     new RemoveNamespaceDeclarationFix(declaredPrefix, true));
+            }
+          }
+          else if (!refCountHolder.isUsedNamespace(namespace)) {
+            for (PsiReference reference : getLocationReferences(namespace, parent)) {
+              if (!XmlHighlightVisitor.hasBadResolve(reference, false))
+              holder.registerProblemForReference(reference, ProblemHighlightType.LIKE_UNUSED_SYMBOL, NAMESPACE_LOCATION_IS_NEVER_USED,
+                                                 new RemoveNamespaceDeclarationFix(declaredPrefix, true));
+            }
+          }
+        }
+      }
+    };
+  }
+
+  private static void removeReferencesOrAttribute(PsiReference[] references) {
+    if (references.length == 0) {
+      return;
+    }
+    
+    XmlAttributeValue element = (XmlAttributeValue)references[0].getElement();
+    XmlAttribute attribute = (XmlAttribute)element.getParent();
+    if (element.getReferences().length == references.length) { // all refs to be removed
+      attribute.delete();
+      return;
+    }
+
+    PsiFile file = element.getContainingFile();
+    Project project = file.getProject();
+    SmartPsiElementPointer<XmlAttribute> pointer = SmartPointerManager.getInstance(project).createSmartPsiElementPointer(attribute);
+    for (PsiReference reference : references) {
+      RemoveNamespaceDeclarationFix.removeReferenceText(reference);
+    }
+
+    // trimming the result
+    PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
+    Document document = documentManager.getDocument(file);
+    assert document != null;
+    documentManager.commitDocument(document);
+    String trimmed = element.getValue().trim();
+    XmlAttribute pointerElement = pointer.getElement();
+    assert pointerElement != null;
+    pointerElement.setValue(trimmed);
+  }
+
+  private static void checkUnusedLocations(XmlAttribute attribute, ProblemsHolder holder) {
+    if (XmlUtil.XML_SCHEMA_INSTANCE_URI.equals(attribute.getNamespace())) {
+      XmlRefCountHolder refCountHolder = XmlRefCountHolder.getRefCountHolder(attribute);
+      if (refCountHolder == null) return;
+
+      if (XmlUtil.NO_NAMESPACE_SCHEMA_LOCATION_ATT.equals(attribute.getLocalName())) {
+        if (refCountHolder.isInUse("")) return;
+        holder.registerProblem(attribute, NAMESPACE_LOCATION_IS_NEVER_USED, ProblemHighlightType.LIKE_UNUSED_SYMBOL,
+                               new RemoveNamespaceLocationFix(""));
+      }
+      else if (XmlUtil.SCHEMA_LOCATION_ATT.equals(attribute.getLocalName())) {
+        XmlAttributeValue value = attribute.getValueElement();
+        if (value == null) return;
+        PsiReference[] references = value.getReferences();
+        for (int i = 0, referencesLength = references.length; i < referencesLength; i++) {
+          PsiReference reference = references[i];
+          if (reference instanceof URLReference) {
+            String ns = getNamespaceFromReference(reference);
+            if (ArrayUtil.indexOf(attribute.getParent().knownNamespaces(), ns) == -1 && !refCountHolder.isUsedNamespace(ns)) {
+              if (!XmlHighlightVisitor.hasBadResolve(reference, false)) {
+                holder.registerProblemForReference(reference, ProblemHighlightType.LIKE_UNUSED_SYMBOL, NAMESPACE_LOCATION_IS_NEVER_USED,
+                                                   new RemoveNamespaceLocationFix(ns));
+              }
+              for (int j = i + 1; j < referencesLength; j++) {
+                PsiReference nextRef = references[j];
+                if (nextRef instanceof URLReference) break;
+                if (!XmlHighlightVisitor.hasBadResolve(nextRef, false)) {
+                  holder.registerProblemForReference(nextRef, ProblemHighlightType.LIKE_UNUSED_SYMBOL, NAMESPACE_LOCATION_IS_NEVER_USED,
+                                                     new RemoveNamespaceLocationFix(ns));
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+
+  private static String getDeclaredPrefix(XmlAttribute attribute) {
+    return attribute.getName().contains(":") ? attribute.getLocalName() : "";
+  }
+
+  @Nullable
+  private static XmlAttribute getDefaultLocation(XmlTag parent) {
+    return parent.getAttribute(XmlUtil.NO_NAMESPACE_SCHEMA_LOCATION_ATT, XmlUtil.XML_SCHEMA_INSTANCE_URI);
+  }
+
+  private static PsiReference[] getLocationReferences(String namespace, XmlTag tag) {
+    XmlAttribute locationAttr = tag.getAttribute(XmlUtil.SCHEMA_LOCATION_ATT, XmlUtil.XML_SCHEMA_INSTANCE_URI);
+    if (locationAttr == null) {
+      return PsiReference.EMPTY_ARRAY;
+    }
+    XmlAttributeValue value = locationAttr.getValueElement();
+    assert value != null;
+    return getLocationReferences(namespace, value);
+  }
+
+  private static PsiReference[] getLocationReferences(String namespace, XmlAttributeValue value) {
+    PsiReference[] references = value.getReferences();
+    for (int i = 0, referencesLength = references.length; i < referencesLength; i+=2) {
+      PsiReference reference = references[i];
+      if (namespace.equals(getNamespaceFromReference(reference))) {
+        if (i + 1 < referencesLength) {
+          return new PsiReference[] { references[i + 1], reference };
+        }
+        else {
+          return new PsiReference[] { reference };
+        }
+      }
+    }
+    return PsiReference.EMPTY_ARRAY;
+  }
+
+  private static String getNamespaceFromReference(PsiReference reference) {
+    return reference.getRangeInElement().substring(reference.getElement().getText());
+  }
+
+  @NotNull
+  public HighlightDisplayLevel getDefaultLevel() {
+    return HighlightDisplayLevel.WARNING;
+  }
+
+  public boolean isEnabledByDefault() {
+    return true;
+  }
+
+  @Nls
+  @NotNull
+  @Override
+  public String getGroupDisplayName() {
+    return XmlBundle.message("xml.inspections.group.name");
+  }
+
+  @Nls
+  @NotNull
+  @Override
+  public String getDisplayName() {
+    return "Unused XML schema declaration";
+  }
+
+  @NotNull
+  @Override
+  public String getShortName() {
+    return "XmlUnusedNamespaceDeclaration";
+  }
+
+  public static class RemoveNamespaceDeclarationFix implements LocalQuickFix {
+
+    public static final String NAME = "Remove unused namespace declaration";
+
+    protected final String myPrefix;
+    private final boolean myLocationFix;
+
+    private RemoveNamespaceDeclarationFix(@Nullable String prefix, boolean locationFix) {
+      myPrefix = prefix;
+      myLocationFix = locationFix;
+    }
+
+    @NotNull
+    public String getName() {
+      return NAME;
+    }
+
+    @NotNull
+    public String getFamilyName() {
+      return XmlBundle.message("xml.inspections.group.name");
+    }
+
+    public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
+      doFix(project, descriptor, true);
+    }
+
+    @Nullable
+    public SmartPsiElementPointer<XmlTag> doFix(Project project, ProblemDescriptor descriptor, boolean reformat) {
+      PsiElement element = descriptor.getPsiElement();
+      if (element instanceof XmlAttributeValue) {
+        element = element.getParent();
+      }
+      else if (!(element instanceof XmlAttribute)) {
+        return null;
+      }
+      XmlAttribute attribute = (XmlAttribute)element;
+      XmlTag parent = attribute.getParent();
+
+      if (!CodeInsightUtilBase.prepareFileForWrite(parent.getContainingFile())) return null;
+
+      SmartPsiElementPointer<XmlTag> pointer = SmartPointerManager.getInstance(project).createSmartPsiElementPointer(parent);
+
+      doRemove(project, attribute, parent);
+
+      if (reformat) {
+        reformatStartTag(project, pointer);
+      }
+      return pointer;
+    }
+
+    public static void reformatStartTag(Project project, SmartPsiElementPointer<XmlTag> pointer) {
+      PsiDocumentManager manager = PsiDocumentManager.getInstance(project);
+      PsiFile file = pointer.getContainingFile();
+      assert file != null;
+      Document document = manager.getDocument(file);
+      assert document != null;
+      manager.commitDocument(document);
+      XmlTag tag = pointer.getElement();
+      assert tag != null;
+      XmlUtil.reformatTagStart(tag);
+    }
+
+    protected void doRemove(Project project, XmlAttribute attribute, XmlTag parent) {
+      if (!attribute.isNamespaceDeclaration()) {
+        SchemaPrefix schemaPrefix = XmlExtension.DEFAULT_EXTENSION.getPrefixDeclaration(parent, myPrefix);
+        if (schemaPrefix != null) {
+          attribute = schemaPrefix.getDeclaration();
+        }
+      }
+      String namespace = attribute.getValue();
+      String prefix = getDeclaredPrefix(attribute);
+
+      PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
+      Document document = documentManager.getDocument(attribute.getContainingFile());
+      assert document != null;
+      attribute.delete();
+      if (prefix.length() == 0) {
+        XmlAttribute locationAttr = getDefaultLocation(parent);
+        if (locationAttr != null) {
+          locationAttr.delete();
+        }
+      }
+      else {
+        documentManager.doPostponedOperationsAndUnblockDocument(document);
+        PsiReference[] references = getLocationReferences(namespace, parent);
+        removeReferencesOrAttribute(references);
+        documentManager.commitDocument(document);
+      }
+    }
+
+    public static void removeReferenceText(PsiReference ref) {
+      PsiElement element = ref.getElement();
+      PsiFile file = element.getContainingFile();
+      TextRange range = ref.getRangeInElement().shiftRight(element.getTextRange().getStartOffset());
+      PsiDocumentManager manager = PsiDocumentManager.getInstance(file.getProject());
+      Document document = manager.getDocument(file);
+      assert document != null;
+      manager.doPostponedOperationsAndUnblockDocument(document);
+      document.deleteString(range.getStartOffset(), range.getEndOffset());
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+      return obj instanceof RemoveNamespaceDeclarationFix &&
+             Comparing.equal(myPrefix, ((RemoveNamespaceDeclarationFix)obj).myPrefix) &&
+             (myLocationFix || ((RemoveNamespaceDeclarationFix)obj).myLocationFix);
+    }
+
+    @Override
+    public int hashCode() {
+      return myPrefix == null ? 0 : myPrefix.hashCode();
+    }
+  }
+
+  public static class RemoveNamespaceLocationFix extends RemoveNamespaceDeclarationFix {
+
+    public static final String NAME = "Remove unused namespace location";
+
+    private RemoveNamespaceLocationFix(String namespace) {
+      super(namespace, true);
+    }
+
+    @NotNull
+    @Override
+    public String getName() {
+      return NAME;
+    }
+
+    @Override
+    protected void doRemove(Project project, XmlAttribute attribute, XmlTag parent) {
+      if (myPrefix.length() == 0) {
+        attribute.delete();
+      }
+      else {
+        XmlAttributeValue value = attribute.getValueElement();
+        if (value == null) {
+          return;
+        }
+        PsiReference[] references = getLocationReferences(myPrefix, value);
+        removeReferencesOrAttribute(references);
+      }
+    }
+
+    @SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
+    @Override
+    public boolean equals(Object obj) {
+      return this == obj;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/encoding/XmlEncodingReference.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/encoding/XmlEncodingReference.java
new file mode 100644
index 0000000..59d9879
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/encoding/XmlEncodingReference.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis.encoding;
+
+import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupElementBuilder;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.vfs.CharsetToolkit;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author cdr
+*/
+public class XmlEncodingReference implements PsiReference, EmptyResolveMessageProvider, Comparable<XmlEncodingReference> {
+  private final XmlAttributeValue myValue;
+
+  private final String myCharsetName;
+  private final TextRange myRangeInElement;
+  private final int myPriority;
+
+  public XmlEncodingReference(XmlAttributeValue value, final String charsetName, final TextRange rangeInElement, int priority) {
+    myValue = value;
+    myCharsetName = charsetName;
+    myRangeInElement = rangeInElement;
+    myPriority = priority;
+  }
+
+  public PsiElement getElement() {
+    return myValue;
+  }
+
+  public TextRange getRangeInElement() {
+    return myRangeInElement;
+  }
+
+  @Nullable
+  public PsiElement resolve() {
+    return CharsetToolkit.forName(myCharsetName) == null ? null : myValue;
+    //if (ApplicationManager.getApplication().isUnitTestMode()) return myValue; // tests do not have full JDK
+    //String fqn = charset.getClass().getName();
+    //return myValue.getManager().findClass(fqn, GlobalSearchScope.allScope(myValue.getProject()));
+  }
+
+  public String getUnresolvedMessagePattern() {
+    //noinspection UnresolvedPropertyKey
+    return XmlErrorMessages.message("unknown.encoding.0");
+  }
+
+  @NotNull
+  public String getCanonicalText() {
+    return myCharsetName;
+  }
+
+  public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
+    return null;
+  }
+
+  public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+    return null;
+  }
+
+  public boolean isReferenceTo(PsiElement element) {
+    return false;
+  }
+
+  @NotNull
+  public Object[] getVariants() {
+    Charset[] charsets = CharsetToolkit.getAvailableCharsets();
+    List<LookupElement> suggestions = new ArrayList<LookupElement>(charsets.length);
+    for (Charset charset : charsets) {
+      suggestions.add(LookupElementBuilder.create(charset.name()).withCaseSensitivity(false));
+    }
+    return suggestions.toArray(new LookupElement[suggestions.size()]);
+  }
+
+  public boolean isSoft() {
+    return false;
+  }
+
+  public int compareTo(XmlEncodingReference ref) {
+    return myPriority - ref.myPriority;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/encoding/XmlEncodingReferenceProvider.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/encoding/XmlEncodingReferenceProvider.java
new file mode 100644
index 0000000..ffe0b62
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/encoding/XmlEncodingReferenceProvider.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis.encoding;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiReferenceProvider;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.util.ProcessingContext;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author cdr
+ */
+public class XmlEncodingReferenceProvider extends PsiReferenceProvider {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.analysis.encoding.XmlEncodingReferenceProvider");
+  @NonNls private static final String CHARSET_PREFIX = "charset=";
+
+  @NotNull
+  public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull final ProcessingContext context) {
+    LOG.assertTrue(element instanceof XmlAttributeValue);
+    XmlAttributeValue value = (XmlAttributeValue)element;
+
+    return new PsiReference[]{new XmlEncodingReference(value, value.getValue(), xmlAttributeValueRange(value), 0)};
+  }
+
+  protected static TextRange xmlAttributeValueRange(final XmlAttributeValue xmlAttributeValue) {
+    ASTNode valueNode = XmlChildRole.ATTRIBUTE_VALUE_VALUE_FINDER.findChild(xmlAttributeValue.getNode());
+    PsiElement toHighlight = valueNode == null ? xmlAttributeValue : valueNode.getPsi();
+    TextRange childRange = toHighlight.getTextRange();
+    TextRange range = xmlAttributeValue.getTextRange();
+    return childRange.shiftRight(-range.getStartOffset());
+  }
+
+  public static PsiReference[] extractFromContentAttribute(final XmlAttributeValue value) {
+    String text = value.getValue();
+    int start = text.indexOf(CHARSET_PREFIX);
+    if (start != -1) {
+      start += CHARSET_PREFIX.length();
+      int end = text.indexOf(';', start);
+      if (end == -1) end = text.length();
+      String charsetName = text.substring(start, end);
+      TextRange textRange = new TextRange(start, end).shiftRight(xmlAttributeValueRange(value).getStartOffset());
+      return new PsiReference[]{new XmlEncodingReference(value, charsetName, textRange, 0)};
+    }
+    return PsiReference.EMPTY_ARRAY;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddXsiSchemaLocationForExtResourceAction.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddXsiSchemaLocationForExtResourceAction.java
new file mode 100644
index 0000000..7a6752a
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddXsiSchemaLocationForExtResourceAction.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.quickfix;
+
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInsight.daemon.impl.analysis.CreateNSDeclarationIntentionFix;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.codeStyle.CodeStyleManager;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author maxim.mossienko
+ */
+public class AddXsiSchemaLocationForExtResourceAction extends BaseExtResourceAction {
+  @NonNls private static final String XMLNS_XSI_ATTR_NAME = "xmlns:xsi";
+  @NonNls private static final String XSI_SCHEMA_LOCATION_ATTR_NAME = "xsi:schemaLocation";
+  public static final String KEY = "add.xsi.schema.location.for.external.resource";
+
+  protected String getQuickFixKeyId() {
+    return KEY;
+  }
+
+  protected void doInvoke(@NotNull final PsiFile file, final int offset, @NotNull final String uri, final Editor editor) throws IncorrectOperationException {
+    final XmlTag tag = PsiTreeUtil.getParentOfType(file.findElementAt(offset), XmlTag.class);
+    if (tag == null) return;
+    final List<String> schemaLocations = new ArrayList<String>();
+
+    CreateNSDeclarationIntentionFix.processExternalUris(new CreateNSDeclarationIntentionFix.TagMetaHandler(tag.getLocalName()), file, new CreateNSDeclarationIntentionFix.ExternalUriProcessor() {
+      public void process(@NotNull final String currentUri, final String url) {
+        if (currentUri.equals(uri) && url != null) schemaLocations.add(url);
+      }
+
+    }, true);
+
+    CreateNSDeclarationIntentionFix.runActionOverSeveralAttributeValuesAfterLettingUserSelectTheNeededOne(
+      ArrayUtil.toStringArray(schemaLocations), file.getProject(), new CreateNSDeclarationIntentionFix.StringToAttributeProcessor() {
+        public void doSomethingWithGivenStringToProduceXmlAttributeNowPlease(@NotNull final String attrName) throws IncorrectOperationException {
+          doIt(file, editor, uri, tag, attrName);
+        }
+      }, XmlErrorMessages.message("select.namespace.location.title"), this, editor);
+  }
+
+  private static void doIt(final PsiFile file, final Editor editor, final String uri, final XmlTag tag, final String s) throws IncorrectOperationException {
+    if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
+    final XmlElementFactory elementFactory = XmlElementFactory.getInstance(file.getProject());
+
+    if (tag.getAttributeValue(XMLNS_XSI_ATTR_NAME) == null) {
+      tag.add(elementFactory.createXmlAttribute(XMLNS_XSI_ATTR_NAME, XmlUtil.XML_SCHEMA_INSTANCE_URI));
+    }
+
+    final XmlAttribute locationAttribute = tag.getAttribute(XSI_SCHEMA_LOCATION_ATTR_NAME);
+    final String toInsert = uri + " " + s;
+    int offset = s.length();
+
+    if (locationAttribute == null) {
+      tag.add(elementFactory.createXmlAttribute(XSI_SCHEMA_LOCATION_ATTR_NAME, toInsert));
+    } else {
+      final String newValue = locationAttribute.getValue() + "\n" + toInsert;
+      locationAttribute.setValue(newValue);
+    }
+
+    CodeStyleManager.getInstance(file.getProject()).reformat(tag);
+
+    @SuppressWarnings("ConstantConditions")
+    final TextRange range = tag.getAttribute(XSI_SCHEMA_LOCATION_ATTR_NAME).getValueElement().getTextRange();
+    final TextRange textRange = new TextRange(range.getEndOffset() - offset - 1, range.getEndOffset() - 1);
+    editor.getCaretModel().moveToOffset(textRange.getStartOffset());
+  }
+
+  @Override
+  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
+    if (!(file instanceof XmlFile)) return false;
+
+    PsiElement element = file.findElementAt(editor.getCaretModel().getOffset());
+    XmlAttributeValue value = PsiTreeUtil.getParentOfType(element, XmlAttributeValue.class);
+    if (value == null) return false;
+    XmlAttribute attribute = PsiTreeUtil.getParentOfType(value, XmlAttribute.class);
+    if (attribute != null && attribute.isNamespaceDeclaration()) {
+      setText(XmlBundle.message(getQuickFixKeyId()));
+      return true;
+    }
+    return false;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/BaseExtResourceAction.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/BaseExtResourceAction.java
new file mode 100644
index 0000000..9feb95a
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/BaseExtResourceAction.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.quickfix;
+
+import com.intellij.codeInsight.intention.impl.BaseIntentionAction;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.URIReferenceProvider;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.URLReference;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author mike
+ */
+abstract class BaseExtResourceAction extends BaseIntentionAction {
+
+  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
+    if (!(file instanceof XmlFile)) return false;
+
+    int offset = editor.getCaretModel().getOffset();
+    String uri = findUri(file, offset);
+    if (uri == null || !isAcceptableUri(uri)) return false;
+
+    setText(XmlBundle.message(getQuickFixKeyId()));
+    return true;
+  }
+
+  protected boolean isAcceptableUri(final String uri) {
+    return true;
+  }
+
+  protected abstract String getQuickFixKeyId();
+
+  @NotNull
+  public String getFamilyName() {
+    return XmlBundle.message(getQuickFixKeyId());
+  }
+
+  public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
+    int offset = editor.getCaretModel().getOffset();
+
+    PsiDocumentManager.getInstance(project).commitAllDocuments();
+
+    final String uri = findUri(file, offset);
+    if (uri == null) return;
+
+    doInvoke(file, offset, uri, editor);
+  }
+
+  protected abstract void doInvoke(final @NotNull PsiFile file, final int offset, final @NotNull String uri, final Editor editor)
+    throws IncorrectOperationException;
+
+  @Nullable
+  public static String findUri(PsiFile file, int offset) {
+    PsiReference currentRef = file.getViewProvider().findReferenceAt(offset, file.getLanguage());
+    if (currentRef == null) currentRef = file.getViewProvider().findReferenceAt(offset);
+    if (currentRef instanceof URLReference ||
+        currentRef instanceof URIReferenceProvider.DependentNSReference) {
+      return currentRef.getCanonicalText();
+    }
+    return null;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    return obj instanceof ManuallySetupExtResourceAction;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/FetchExtResourceAction.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/FetchExtResourceAction.java
new file mode 100644
index 0000000..9d114d2
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/FetchExtResourceAction.java
@@ -0,0 +1,523 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.quickfix;
+
+import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.openapi.application.AccessToken;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.PathManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.fileTypes.FileTypeManager;
+import com.intellij.openapi.fileTypes.FileTypes;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.progress.Task;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.WatchedRootsProvider;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.util.Computable;
+import com.intellij.openapi.util.Ref;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.impl.source.xml.XmlEntityRefImpl;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.net.HttpConfigurable;
+import com.intellij.util.net.IOExceptionDialog;
+import com.intellij.util.net.NetUtils;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.*;
+
+/**
+ * @author mike
+ */
+public class FetchExtResourceAction extends BaseExtResourceAction implements WatchedRootsProvider {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.intention.FetchDtdAction");
+  private static final @NonNls String HTML_MIME = "text/html";
+  private static final @NonNls String HTTP_PROTOCOL = "http://";
+  private static final @NonNls String HTTPS_PROTOCOL = "https://";
+  private static final @NonNls String FTP_PROTOCOL = "ftp://";
+  private static final @NonNls String EXT_RESOURCES_FOLDER = "extResources";
+
+  protected String getQuickFixKeyId() {
+    return "fetch.external.resource";
+  }
+
+  protected boolean isAcceptableUri(final String uri) {
+    return uri.startsWith(HTTP_PROTOCOL) || uri.startsWith(FTP_PROTOCOL) || uri.startsWith(HTTPS_PROTOCOL);
+  }
+
+  public static String findUrl(PsiFile file, int offset, String uri) {
+    final PsiElement currentElement = file.findElementAt(offset);
+    final XmlAttribute attribute = PsiTreeUtil.getParentOfType(currentElement, XmlAttribute.class);
+
+    if (attribute != null) {
+      final XmlTag tag = PsiTreeUtil.getParentOfType(currentElement, XmlTag.class);
+
+      if (tag != null) {
+        final String prefix = tag.getPrefixByNamespace(XmlUtil.XML_SCHEMA_INSTANCE_URI);
+        if (prefix != null) {
+          final String attrValue = tag.getAttributeValue(XmlUtil.SCHEMA_LOCATION_ATT, XmlUtil.XML_SCHEMA_INSTANCE_URI);
+          if (attrValue != null) {
+            final StringTokenizer tokenizer = new StringTokenizer(attrValue);
+
+            while (tokenizer.hasMoreElements()) {
+              if (uri.equals(tokenizer.nextToken())) {
+                if (!tokenizer.hasMoreElements()) return uri;
+                final String url = tokenizer.nextToken();
+
+                return url.startsWith(HTTP_PROTOCOL) ? url : uri;
+              }
+
+              if (!tokenizer.hasMoreElements()) return uri;
+              tokenizer.nextToken(); // skip file location
+            }
+          }
+        }
+      }
+    }
+    return uri;
+  }
+
+  @NotNull
+  public Set<String> getRootsToWatch() {
+    final File path = new File(getExternalResourcesPath());
+    if (!path.exists() && !path.mkdirs()) {
+      LOG.warn("Unable to create: " + path);
+    }
+    return Collections.singleton(path.getAbsolutePath());
+  }
+
+  static class FetchingResourceIOException extends IOException {
+    private final String url;
+
+    FetchingResourceIOException(Throwable cause, String url) {
+      initCause(cause);
+      this.url = url;
+    }
+  }
+
+  protected void doInvoke(@NotNull final PsiFile file, final int offset, @NotNull final String uri, final Editor editor)
+    throws IncorrectOperationException {
+    final String url = findUrl(file, offset, uri);
+    final Project project = file.getProject();
+
+    if (ApplicationManager.getApplication().isUnitTestMode()) {
+      return;
+    }
+
+    ProgressManager.getInstance().run(new Task.Backgroundable(project, XmlBundle.message("fetching.resource.title")) {
+      @Override
+      public void run(@NotNull ProgressIndicator indicator) {
+        while (true) {
+          try {
+            HttpConfigurable.getInstance().prepareURL(url);
+            fetchDtd(project, uri, url, indicator);
+            ApplicationManager.getApplication().invokeLater(new Runnable() {
+              @Override
+              public void run() {
+                DaemonCodeAnalyzer.getInstance(project).restart(file);
+              }
+            });
+            return;
+          }
+          catch (IOException ex) {
+            LOG.info(ex);
+            @SuppressWarnings("InstanceofCatchParameter")
+            String problemUrl = ex instanceof FetchingResourceIOException ? ((FetchingResourceIOException)ex).url : url;
+            String message = XmlBundle.message("error.fetching.title");
+
+            if (!url.equals(problemUrl)) {
+              message = XmlBundle.message("error.fetching.dependent.resource.title");
+            }
+
+            if (!IOExceptionDialog.showErrorDialog(message, XmlBundle.message("error.fetching.resource", problemUrl))) {
+              break; // cancel fetching
+            }
+          }
+        }
+      }
+    });
+  }
+
+  private void fetchDtd(final Project project, final String dtdUrl, final String url, final ProgressIndicator indicator) throws IOException {
+    final String extResourcesPath = getExternalResourcesPath();
+    final File extResources = new File(extResourcesPath);
+    LOG.assertTrue(extResources.mkdirs() || extResources.exists(), extResources);
+
+    final PsiManager psiManager = PsiManager.getInstance(project);
+    ApplicationManager.getApplication().invokeAndWait(new Runnable() {
+      public void run() {
+        @SuppressWarnings("deprecation")
+        final AccessToken token = ApplicationManager.getApplication().acquireWriteActionLock(FetchExtResourceAction.class);
+        try {
+          final String path = FileUtil.toSystemIndependentName(extResources.getAbsolutePath());
+          final VirtualFile vFile = LocalFileSystem.getInstance().refreshAndFindFileByPath(path);
+          LOG.assertTrue(vFile != null, path);
+        }
+        finally {
+          token.finish();
+        }
+      }
+    }, indicator.getModalityState());
+
+    final List<String> downloadedResources = new LinkedList<String>();
+    final List<String> resourceUrls = new LinkedList<String>();
+    final IOException[] nestedException = new IOException[1];
+
+    try {
+      final String resPath = fetchOneFile(indicator, url, project, extResourcesPath, null);
+      if (resPath == null) return;
+      resourceUrls.add(dtdUrl);
+      downloadedResources.add(resPath);
+
+      VirtualFile virtualFile = findFileByPath(resPath, dtdUrl, indicator);
+
+      Set<String> linksToProcess = new HashSet<String>();
+      Set<String> processedLinks = new HashSet<String>();
+      Map<String, String> baseUrls = new HashMap<String, String>();
+      VirtualFile contextFile = virtualFile;
+      linksToProcess.addAll(extractEmbeddedFileReferences(virtualFile, null, psiManager));
+
+      while (!linksToProcess.isEmpty()) {
+        String s = linksToProcess.iterator().next();
+        linksToProcess.remove(s);
+        processedLinks.add(s);
+
+        final boolean absoluteUrl = s.startsWith(HTTP_PROTOCOL);
+        String resourceUrl;
+        if (absoluteUrl) {
+          resourceUrl = s;
+        }
+        else {
+          String baseUrl = baseUrls.get(s);
+          if (baseUrl == null) baseUrl = url;
+
+          resourceUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1) + s;
+        }
+
+        String resourcePath;
+
+        String refname = s.substring(s.lastIndexOf('/') + 1);
+        if (absoluteUrl) refname = Integer.toHexString(s.hashCode()) + "_" + refname;
+        try {
+          resourcePath = fetchOneFile(indicator, resourceUrl, project, extResourcesPath, refname);
+        }
+        catch (IOException e) {
+          nestedException[0] = new FetchingResourceIOException(e, resourceUrl);
+          break;
+        }
+
+        if (resourcePath == null) break;
+
+        virtualFile = findFileByPath(resourcePath, absoluteUrl ? s : null, indicator);
+        downloadedResources.add(resourcePath);
+
+        if (absoluteUrl) {
+          resourceUrls.add(s);
+        }
+
+        final List<String> newLinks = extractEmbeddedFileReferences(virtualFile, contextFile, psiManager);
+        for (String u : newLinks) {
+          baseUrls.put(u, resourceUrl);
+          if (!processedLinks.contains(u)) linksToProcess.add(u);
+        }
+      }
+    }
+    catch (IOException ex) {
+      nestedException[0] = ex;
+    }
+    if (nestedException[0] != null) {
+      cleanup(resourceUrls, downloadedResources);
+      throw nestedException[0];
+    }
+  }
+
+  private static VirtualFile findFileByPath(final String resPath, final @Nullable String dtdUrl, ProgressIndicator indicator) {
+    final Ref<VirtualFile> ref = new Ref<VirtualFile>();
+    ApplicationManager.getApplication().invokeAndWait(new Runnable() {
+      public void run() {
+        ApplicationManager.getApplication().runWriteAction(new Runnable() {
+          public void run() {
+            ref.set(LocalFileSystem.getInstance().refreshAndFindFileByPath(resPath.replace(File.separatorChar, '/')));
+            if (dtdUrl != null) {
+              ExternalResourceManager.getInstance().addResource(dtdUrl, resPath);
+            }
+          }
+        });
+      }
+    }, indicator.getModalityState());
+    return ref.get();
+  }
+
+  public static String getExternalResourcesPath() {
+    return PathManager.getSystemPath() + File.separator + EXT_RESOURCES_FOLDER;
+  }
+
+  private void cleanup(final List<String> resourceUrls, final List<String> downloadedResources) {
+    ApplicationManager.getApplication().invokeLater(new Runnable() {
+      public void run() {
+        ApplicationManager.getApplication().runWriteAction(new Runnable() {
+          public void run() {
+            for (String resourcesUrl : resourceUrls) {
+              ExternalResourceManager.getInstance().removeResource(resourcesUrl);
+            }
+
+            for (String downloadedResource : downloadedResources) {
+              VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByIoFile(new File(downloadedResource));
+              if (virtualFile != null) {
+                try {
+                  virtualFile.delete(this);
+                }
+                catch (IOException ignore) {
+
+                }
+              }
+            }
+          }
+        });
+      }
+    });
+  }
+
+  @Nullable
+  private static String fetchOneFile(final ProgressIndicator indicator,
+                                     final String resourceUrl,
+                                     final Project project,
+                                     String extResourcesPath,
+                                     @Nullable String refname) throws IOException {
+    SwingUtilities.invokeLater(
+      new Runnable() {
+        public void run() {
+          indicator.setText(XmlBundle.message("fetching.progress.indicator", resourceUrl));
+        }
+      }
+    );
+
+    FetchResult result = fetchData(project, resourceUrl, indicator);
+    if (result == null) return null;
+
+    if (!ApplicationManager.getApplication().isUnitTestMode() &&
+        result.contentType != null &&
+        result.contentType.contains(HTML_MIME) &&
+        new String(result.bytes).contains("<html")) {
+      ApplicationManager.getApplication().invokeLater(new Runnable() {
+        public void run() {
+          Messages.showMessageDialog(project,
+                                     XmlBundle.message("invalid.url.no.xml.file.at.location", resourceUrl),
+                                     XmlBundle.message("invalid.url.title"),
+                                     Messages.getErrorIcon());
+        }
+      }, indicator.getModalityState());
+      return null;
+    }
+
+    int slashIndex = resourceUrl.lastIndexOf('/');
+    String resPath = extResourcesPath + File.separatorChar;
+
+    if (refname != null) { // resource is known under ref.name so need to save it
+      resPath += refname;
+      int refNameSlashIndex = resPath.lastIndexOf('/');
+      if (refNameSlashIndex != -1) {
+        final File parent = new File(resPath.substring(0, refNameSlashIndex));
+        if (!parent.mkdirs() || !parent.exists()) {
+          LOG.warn("Unable to create: " + parent);
+        }
+      }
+    }
+    else {
+      resPath += Integer.toHexString(resourceUrl.hashCode()) + "_" + resourceUrl.substring(slashIndex + 1);
+    }
+
+    final int lastDoPosInResourceUrl = resourceUrl.lastIndexOf('.', slashIndex);
+    if (lastDoPosInResourceUrl == -1 ||
+        FileTypeManager.getInstance().getFileTypeByExtension(resourceUrl.substring(lastDoPosInResourceUrl + 1)) == FileTypes.UNKNOWN) {
+      // remote url does not contain file with extension
+      resPath += "." + StdFileTypes.XML.getDefaultExtension();
+    }
+
+    File res = new File(resPath);
+
+    FileOutputStream out = new FileOutputStream(res);
+    try {
+      out.write(result.bytes);
+    }
+    finally {
+      out.close();
+    }
+    return resPath;
+  }
+
+  private static List<String> extractEmbeddedFileReferences(XmlFile file, XmlFile context) {
+    final List<String> result = new LinkedList<String>();
+    if (context != null) {
+      XmlEntityRefImpl.copyEntityCaches(file, context);
+    }
+
+    XmlUtil.processXmlElements(
+      file,
+      new PsiElementProcessor() {
+        public boolean execute(@NotNull PsiElement element) {
+          if (element instanceof XmlEntityDecl) {
+            String candidateName = null;
+
+            for (PsiElement e = element.getLastChild(); e != null; e = e.getPrevSibling()) {
+              if (e instanceof XmlAttributeValue && candidateName == null) {
+                candidateName = e.getText().substring(1, e.getTextLength() - 1);
+              }
+              else if (e instanceof XmlToken &&
+                       candidateName != null &&
+                       (((XmlToken)e).getTokenType() == XmlTokenType.XML_DOCTYPE_PUBLIC ||
+                        ((XmlToken)e).getTokenType() == XmlTokenType.XML_DOCTYPE_SYSTEM
+                       )
+                ) {
+                if (!result.contains(candidateName)) {
+                  result.add(candidateName);
+                }
+                break;
+              }
+            }
+          }
+          else if (element instanceof XmlTag) {
+            final XmlTag tag = (XmlTag)element;
+            String schemaLocation = tag.getAttributeValue(XmlUtil.SCHEMA_LOCATION_ATT);
+
+            if (schemaLocation != null) {
+              final PsiReference[] references = tag.getAttribute(XmlUtil.SCHEMA_LOCATION_ATT, null).getValueElement().getReferences();
+              if (references.length > 0) {
+                final String namespace = tag.getAttributeValue("namespace");
+
+                if (namespace != null && schemaLocation.indexOf('/') == -1) {
+                  result.add(namespace.substring(0, namespace.lastIndexOf('/') + 1) + schemaLocation);
+                }
+                else {
+                  result.add(schemaLocation);
+                }
+              }
+            }
+
+            final String prefix = tag.getPrefixByNamespace(XmlUtil.XML_SCHEMA_INSTANCE_URI);
+            if (prefix != null) {
+              schemaLocation = tag.getAttributeValue("schemaLocation", XmlUtil.XML_SCHEMA_INSTANCE_URI);
+
+              if (schemaLocation != null) {
+                final StringTokenizer tokenizer = new StringTokenizer(schemaLocation);
+
+                while (tokenizer.hasMoreTokens()) {
+                  tokenizer.nextToken();
+                  if (!tokenizer.hasMoreTokens()) break;
+                  String location = tokenizer.nextToken();
+
+                  if (!result.contains(location)) {
+                    result.add(location);
+                  }
+                }
+              }
+            }
+          }
+
+          return true;
+        }
+      },
+      true,
+      true
+    );
+    return result;
+  }
+
+  public static List<String> extractEmbeddedFileReferences(final VirtualFile vFile, @Nullable final VirtualFile contextVFile, final PsiManager psiManager) {
+    return ApplicationManager.getApplication().runReadAction(new Computable<List<String>>() {
+      @Override
+      public List<String> compute() {
+        PsiFile file = psiManager.findFile(vFile);
+
+        if (file instanceof XmlFile) {
+          PsiFile contextFile = contextVFile != null ? psiManager.findFile(contextVFile) : null;
+          return extractEmbeddedFileReferences((XmlFile)file, contextFile instanceof XmlFile ? (XmlFile)contextFile : null);
+        }
+
+        return Collections.emptyList();
+      }
+    });
+  }
+
+  static class FetchResult {
+    byte[] bytes;
+    String contentType;
+  }
+
+  @Nullable
+  private static FetchResult fetchData(final Project project, final String dtdUrl, ProgressIndicator indicator) throws IOException {
+
+    try {
+      URL url = new URL(dtdUrl);
+      HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection();
+      urlConnection.addRequestProperty("accept", "text/xml,application/xml,text/html,*/*");
+      int contentLength = urlConnection.getContentLength();
+
+      ByteArrayOutputStream out = new ByteArrayOutputStream();
+      InputStream in = urlConnection.getInputStream();
+      String contentType;
+      try {
+        contentType = urlConnection.getContentType();
+        NetUtils.copyStreamContent(indicator, in, out, contentLength);
+      }
+      finally {
+        in.close();
+      }
+
+      FetchResult result = new FetchResult();
+      result.bytes = out.toByteArray();
+      result.contentType = contentType;
+
+      return result;
+    }
+    catch (MalformedURLException e) {
+      if (!ApplicationManager.getApplication().isUnitTestMode()) {
+        ApplicationManager.getApplication().invokeLater(new Runnable() {
+          public void run() {
+            Messages.showMessageDialog(project,
+                                       XmlBundle.message("invalid.url.message", dtdUrl),
+                                       XmlBundle.message("invalid.url.title"),
+                                       Messages.getErrorIcon());
+          }
+        }, indicator.getModalityState());
+      }
+    }
+
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/IgnoreExtResourceAction.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/IgnoreExtResourceAction.java
new file mode 100644
index 0000000..54d922b
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/IgnoreExtResourceAction.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.quickfix;
+
+import com.intellij.javaee.ExternalResourceManagerEx;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author mike
+ */
+public class IgnoreExtResourceAction extends BaseExtResourceAction {
+  protected String getQuickFixKeyId() {
+    return "ignore.external.resource.text";
+  }
+
+  protected void doInvoke(@NotNull final PsiFile file, final int offset, @NotNull final String uri, final Editor editor) throws IncorrectOperationException {
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        ExternalResourceManagerEx.getInstanceEx().addIgnoredResource(uri);
+      }
+    });
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ManuallySetupExtResourceAction.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ManuallySetupExtResourceAction.java
new file mode 100644
index 0000000..06f9865
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ManuallySetupExtResourceAction.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.quickfix;
+
+import com.intellij.javaee.MapExternalResourceDialog;
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.psi.PsiFile;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author mike
+ */
+public class ManuallySetupExtResourceAction extends BaseExtResourceAction {
+
+  protected String getQuickFixKeyId() {
+    return "manually.setup.external.resource";
+  }
+
+  protected void doInvoke(@NotNull final PsiFile file, final int offset, @NotNull final String uri, final Editor editor) throws IncorrectOperationException {
+    final MapExternalResourceDialog dialog = new MapExternalResourceDialog(uri, file.getProject(), file, null);
+    dialog.show();
+    if (dialog.isOK()) {
+      ApplicationManager.getApplication().runWriteAction(new Runnable() {
+        @Override
+        public void run() {
+          String location = dialog.getResourceLocation();
+          ExternalResourceManager.getInstance().addResource(dialog.getUri(), location);
+        }
+      });
+    }
+  }
+
+  public boolean startInWriteAction() {
+    return false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeBreadcrumbsPresentationProvider.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeBreadcrumbsPresentationProvider.java
new file mode 100644
index 0000000..9f524f04
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeBreadcrumbsPresentationProvider.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.tagTreeHighlighting;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.breadcrumbs.BreadcrumbsPresentationProvider;
+import com.intellij.xml.breadcrumbs.CrumbPresentation;
+import com.intellij.xml.breadcrumbs.DefaultCrumbsPresentation;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.awt.*;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class XmlTagTreeBreadcrumbsPresentationProvider extends BreadcrumbsPresentationProvider {
+  private static boolean isMyContext(@NotNull PsiElement deepestElement) {
+    final PsiFile file = deepestElement.getContainingFile();
+    if (file == null || !XmlTagTreeHighlightingUtil.isTagTreeHighlightingActive(file)) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public CrumbPresentation[] getCrumbPresentations(@NotNull PsiElement[] elements) {
+    if (elements.length == 0 || !isMyContext(elements[elements.length - 1])) {
+      return null;
+    }
+
+    if (!XmlTagTreeHighlightingUtil.containsTagsWithSameName(elements)) {
+      return null;
+    }
+
+    final CrumbPresentation[] result = new CrumbPresentation[elements.length];
+    final Color[] baseColors = XmlTagTreeHighlightingUtil.getBaseColors();
+    int index = 0;
+
+    for (int i = result.length - 1; i >= 0; i--) {
+      if (elements[i] instanceof XmlTag) {
+        final Color color = baseColors[index % baseColors.length];
+        result[i] = new MyCrumbPresentation(color);
+        index++;
+      }
+    }
+    return result;
+  }
+
+  private static class MyCrumbPresentation extends DefaultCrumbsPresentation {
+    private final Color myColor;
+
+    private MyCrumbPresentation(@Nullable Color color) {
+      myColor = color;
+    }
+
+    @Override
+    public Color getBackgroundColor(boolean selected, boolean hovered, boolean light) {
+      final Color baseColor = super.getBackgroundColor(selected, hovered, light);
+      return myColor != null
+             ? XmlTagTreeHighlightingUtil.makeTransparent(myColor, baseColor, 0.1)
+             : baseColor;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingColors.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingColors.java
new file mode 100644
index 0000000..f146ea7
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingColors.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.tagTreeHighlighting;
+
+import com.intellij.application.options.editor.WebEditorOptions;
+import com.intellij.openapi.editor.colors.ColorKey;
+import com.intellij.util.ui.PlatformColors;
+import org.jetbrains.annotations.NotNull;
+
+import java.awt.*;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class XmlTagTreeHighlightingColors {
+  private static ColorKey[] ourColorKeys = null;
+
+  private static final Color[] DEFAULT_COLORS = new Color[]{Color.RED, Color.YELLOW, Color.GREEN, Color.CYAN, PlatformColors.BLUE, Color.MAGENTA};
+
+  private XmlTagTreeHighlightingColors() {
+  }
+
+  @NotNull
+  public static ColorKey[] getColorKeys() {
+    final int levelCount = WebEditorOptions.getInstance().getTagTreeHighlightingLevelCount();
+
+    if (ourColorKeys == null || ourColorKeys.length != levelCount) {
+      ourColorKeys = new ColorKey[levelCount];
+
+      for (int i = 0; i < ourColorKeys.length; i++) {
+        ourColorKeys[i] = ColorKey.createColorKey("HTML_TAG_TREE_LEVEL" + i, DEFAULT_COLORS[i % DEFAULT_COLORS.length]);
+      }
+    }
+
+    return ourColorKeys;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingConfigurable.form b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingConfigurable.form
new file mode 100644
index 0000000..44f6766
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingConfigurable.form
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.codeInsight.daemon.impl.tagTreeHighlighting.XmlTagTreeHighlightingConfigurable">
+  <grid id="27dc6" binding="myContentPanel" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="20" y="20" width="303" height="97"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <component id="b5068" class="javax.swing.JCheckBox" binding="myEnableTagTreeHighlightingCheckBox">
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="Enable HTML/XML tag tree highlighting"/>
+        </properties>
+      </component>
+      <grid id="30544" binding="myLevelsPanel" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <border type="none"/>
+        <children>
+          <component id="84b2a" class="javax.swing.JLabel">
+            <constraints>
+              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="3" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <labelFor value="f41b2"/>
+              <text value="Levels to highlight:"/>
+            </properties>
+          </component>
+          <component id="f41b2" class="javax.swing.JSpinner" binding="myLevelsSpinner">
+            <constraints>
+              <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
+                <preferred-size width="50" height="-1"/>
+                <maximum-size width="50" height="-1"/>
+              </grid>
+            </constraints>
+            <properties/>
+          </component>
+          <component id="c1d38" class="javax.swing.JLabel">
+            <constraints>
+              <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="3" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <labelFor value="dd25f"/>
+              <text value="Opacity:"/>
+            </properties>
+          </component>
+          <component id="dd25f" class="javax.swing.JSpinner" binding="myOpacitySpinner">
+            <constraints>
+              <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
+                <preferred-size width="50" height="-1"/>
+                <maximum-size width="50" height="-1"/>
+              </grid>
+            </constraints>
+            <properties/>
+          </component>
+        </children>
+      </grid>
+      <hspacer id="dd839">
+        <constraints>
+          <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+        </constraints>
+      </hspacer>
+    </children>
+  </grid>
+</form>
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingConfigurable.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingConfigurable.java
new file mode 100644
index 0000000..ace1e2b
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingConfigurable.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.tagTreeHighlighting;
+
+import com.intellij.application.options.editor.WebEditorOptions;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.fileEditor.FileEditor;
+import com.intellij.openapi.fileEditor.FileEditorManager;
+import com.intellij.openapi.fileEditor.TextEditor;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.options.UnnamedConfigurable;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.project.ProjectManager;
+import com.intellij.util.ui.UIUtil;
+import com.intellij.xml.breadcrumbs.BreadcrumbsXmlWrapper;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class XmlTagTreeHighlightingConfigurable implements UnnamedConfigurable {
+  private JCheckBox myEnableTagTreeHighlightingCheckBox;
+  private JSpinner myLevelsSpinner;
+  private JPanel myLevelsPanel;
+  private JPanel myContentPanel;
+  private JSpinner myOpacitySpinner;
+
+  public XmlTagTreeHighlightingConfigurable() {
+    myLevelsSpinner.setModel(new SpinnerNumberModel(1, 1, 50, 1));
+    myOpacitySpinner.setModel(new SpinnerNumberModel(0.0, 0.0, 1.0, 0.05));
+
+    myEnableTagTreeHighlightingCheckBox.addActionListener(new ActionListener() {
+      @Override
+      public void actionPerformed(ActionEvent e) {
+        final boolean enabled = myEnableTagTreeHighlightingCheckBox.isSelected();
+        UIUtil.setEnabled(myLevelsPanel, enabled, true);
+      }
+    });
+  }
+
+  @Override
+  public JComponent createComponent() {
+    return myContentPanel;
+  }
+
+  @Override
+  public boolean isModified() {
+    final WebEditorOptions options = WebEditorOptions.getInstance();
+
+    if (myEnableTagTreeHighlightingCheckBox.isSelected() != options.isTagTreeHighlightingEnabled()) {
+      return true;
+    }
+
+    if (getLevelCount() != options.getTagTreeHighlightingLevelCount()) {
+      return true;
+    }
+
+    if (getOpacity() != options.getTagTreeHighlightingOpacity()) {
+      return true;
+    }
+
+    return false;
+  }
+
+  @Override
+  public void apply() throws ConfigurationException {
+    final WebEditorOptions options = WebEditorOptions.getInstance();
+
+    options.setTagTreeHighlightingEnabled(myEnableTagTreeHighlightingCheckBox.isSelected());
+    options.setTagTreeHighlightingLevelCount(getLevelCount());
+    options.setTagTreeHighlightingOpacity(getOpacity());
+
+    clearTagTreeHighlighting();
+  }
+
+  private int getLevelCount() {
+    return ((Integer)myLevelsSpinner.getValue()).intValue();
+  }
+
+  private int getOpacity() {
+    return (int)(((Double)myOpacitySpinner.getValue()).doubleValue() * 100);
+  }
+
+  private static void clearTagTreeHighlighting() {
+    for (Project project : ProjectManager.getInstance().getOpenProjects()) {
+      for (FileEditor fileEditor : FileEditorManager.getInstance(project).getAllEditors()) {
+        if (fileEditor instanceof TextEditor) {
+          final Editor editor = ((TextEditor)fileEditor).getEditor();
+          XmlTagTreeHighlightingPass.clearHighlightingAndLineMarkers(editor, project);
+
+          final BreadcrumbsXmlWrapper breadcrumbsXmlWrapper = BreadcrumbsXmlWrapper.getBreadcrumbsComponent(editor);
+          if (breadcrumbsXmlWrapper != null) {
+            breadcrumbsXmlWrapper.queueUpdate(editor);
+          }
+        }
+      }
+    }
+  }
+
+  @Override
+  public void reset() {
+    final WebEditorOptions options = WebEditorOptions.getInstance();
+    final boolean enabled = options.isTagTreeHighlightingEnabled();
+
+    myEnableTagTreeHighlightingCheckBox.setSelected(enabled);
+    myLevelsSpinner.setValue(options.getTagTreeHighlightingLevelCount());
+    myOpacitySpinner.setValue(options.getTagTreeHighlightingOpacity() * 0.01);
+    UIUtil.setEnabled(myLevelsPanel, enabled, true);
+  }
+
+  @Override
+  public void disposeUIResources() {
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingPass.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingPass.java
new file mode 100644
index 0000000..9ad8d1a
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingPass.java
@@ -0,0 +1,311 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.tagTreeHighlighting;
+
+import com.intellij.application.options.editor.WebEditorOptions;
+import com.intellij.codeHighlighting.TextEditorHighlightingPass;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
+import com.intellij.codeInsight.daemon.impl.UpdateHighlightersUtil;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.colors.TextAttributesKey;
+import com.intellij.openapi.editor.ex.EditorEx;
+import com.intellij.openapi.editor.ex.MarkupModelEx;
+import com.intellij.openapi.editor.impl.DocumentMarkupModel;
+import com.intellij.openapi.editor.markup.*;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.ui.Gray;
+import com.intellij.xml.breadcrumbs.BreadcrumbsInfoProvider;
+import com.intellij.xml.breadcrumbs.BreadcrumbsXmlWrapper;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class XmlTagTreeHighlightingPass extends TextEditorHighlightingPass {
+  private static final Key<List<RangeHighlighter>> TAG_TREE_HIGHLIGHTERS_IN_EDITOR_KEY = Key.create("TAG_TREE_HIGHLIGHTERS_IN_EDITOR_KEY");
+
+  private static final HighlightInfoType TYPE = new HighlightInfoType.HighlightInfoTypeImpl(HighlightSeverity.INFORMATION, TextAttributesKey
+    .createTextAttributesKey("TAG_TREE_HIGHLIGHTING_KEY"));
+
+  private final PsiFile myFile;
+  private final EditorEx myEditor;
+  private final BreadcrumbsInfoProvider myInfoProvider;
+
+  private final List<Pair<TextRange, TextRange>> myPairsToHighlight = new ArrayList<Pair<TextRange, TextRange>>();
+
+  public XmlTagTreeHighlightingPass(@NotNull PsiFile file, @NotNull EditorEx editor) {
+    super(file.getProject(), editor.getDocument(), true);
+    myFile = file;
+    myEditor = editor;
+    final FileViewProvider viewProvider = file.getManager().findViewProvider(file.getVirtualFile());
+    myInfoProvider = BreadcrumbsXmlWrapper.findInfoProvider(viewProvider);
+  }
+
+  @Override
+  public void doCollectInformation(@NotNull ProgressIndicator progress) {
+    if (ApplicationManager.getApplication().isUnitTestMode()) {
+      return;
+    }
+
+    if (!WebEditorOptions.getInstance().isTagTreeHighlightingEnabled()) {
+      return;
+    }
+
+    final PsiElement[] elements =
+      BreadcrumbsXmlWrapper.getLinePsiElements(myEditor.getCaretModel().getOffset(), myFile.getVirtualFile(), myProject, myInfoProvider);
+
+    if (elements == null || elements.length == 0) {
+      return;
+    }
+
+    if (!XmlTagTreeHighlightingUtil.containsTagsWithSameName(elements)) {
+      return;
+    }
+
+    for (int i = elements.length - 1; i >= 0; i--) {
+      if (elements[i] instanceof XmlTag) {
+        myPairsToHighlight.add(getTagRanges((XmlTag)elements[i]));
+      }
+    }
+  }
+
+  @Nullable
+  private static Pair<TextRange, TextRange> getTagRanges(XmlTag tag) {
+    final ASTNode tagNode = tag.getNode();
+    return new Pair<TextRange, TextRange>(getStartTagRange(tagNode), getEndTagRange(tagNode));
+  }
+
+  @Nullable
+  private static TextRange getStartTagRange(ASTNode tagNode) {
+    final ASTNode startTagStart = XmlChildRole.START_TAG_START_FINDER.findChild(tagNode);
+    if (startTagStart == null) {
+      return null;
+    }
+
+    ASTNode tagName = startTagStart.getTreeNext();
+    if (tagName == null || tagName.getElementType() != XmlTokenType.XML_NAME) {
+      return null;
+    }
+
+    ASTNode next = tagName.getTreeNext();
+    if (next != null && next.getElementType() == XmlTokenType.XML_TAG_END) {
+      tagName = next;
+    }
+
+    return new TextRange(startTagStart.getStartOffset(), tagName.getTextRange().getEndOffset());
+  }
+
+  @Nullable
+  private static TextRange getEndTagRange(ASTNode tagNode) {
+    final ASTNode endTagStart = XmlChildRole.CLOSING_TAG_START_FINDER.findChild(tagNode);
+    if (endTagStart == null) {
+      return null;
+    }
+
+    ASTNode endTagEnd = endTagStart;
+    while (endTagEnd != null && endTagEnd.getElementType() != XmlTokenType.XML_TAG_END) {
+      endTagEnd = endTagEnd.getTreeNext();
+    }
+
+    if (endTagEnd == null) {
+      return null;
+    }
+
+    return new TextRange(endTagStart.getStartOffset(), endTagEnd.getTextRange().getEndOffset());
+  }
+
+  @Override
+  public void doApplyInformationToEditor() {
+    final List<HighlightInfo> infos = getHighlights();
+    UpdateHighlightersUtil.setHighlightersToEditor(myProject, myDocument, 0, myFile.getTextLength(), infos, getColorsScheme(), getId());
+  }
+
+  public List<HighlightInfo> getHighlights() {
+    clearLineMarkers(myEditor);
+
+    final int count = myPairsToHighlight.size();
+    final List<HighlightInfo> highlightInfos = new ArrayList<HighlightInfo>(count * 2);
+    final MarkupModel markupModel = myEditor.getMarkupModel();
+
+    final Color[] baseColors = XmlTagTreeHighlightingUtil.getBaseColors();
+    final Color[] colorsForEditor = toColorsForEditor(baseColors);
+    final Color[] colorsForLineMarkers = toColorsForLineMarkers(baseColors);
+
+    final List<RangeHighlighter> newHighlighters = new ArrayList<RangeHighlighter>();
+
+    assert colorsForEditor.length > 0;
+
+    for (int i = 0; i < count && i < baseColors.length; i++) {
+      Pair<TextRange, TextRange> pair = myPairsToHighlight.get(i);
+
+      if (pair == null || (pair.first == null && pair.second == null)) {
+        continue;
+      }
+
+      Color color = colorsForEditor[i];
+
+      if (color == null) {
+        continue;
+      }
+
+      if (pair.first != null && !pair.first.isEmpty()) {
+        highlightInfos.add(createHighlightInfo(color, pair.first));
+      }
+
+      if (pair.second != null && !pair.second.isEmpty()) {
+        highlightInfos.add(createHighlightInfo(color, pair.second));
+      }
+
+      final int start = pair.first != null ? pair.first.getStartOffset() : pair.second.getStartOffset();
+      final int end = pair.second != null ? pair.second.getEndOffset() : pair.first.getEndOffset();
+
+      final Color lineMarkerColor = colorsForLineMarkers[i];
+      if (lineMarkerColor != null && start != end) {
+        final RangeHighlighter highlighter = createHighlighter(markupModel, new TextRange(start, end), lineMarkerColor);
+        newHighlighters.add(highlighter);
+      }
+    }
+
+    myEditor.putUserData(TAG_TREE_HIGHLIGHTERS_IN_EDITOR_KEY, newHighlighters);
+
+    return highlightInfos;
+  }
+
+  private static void clearLineMarkers(Editor editor) {
+    final List<RangeHighlighter> oldHighlighters = editor.getUserData(TAG_TREE_HIGHLIGHTERS_IN_EDITOR_KEY);
+
+    if (oldHighlighters != null) {
+      final MarkupModelEx markupModel = (MarkupModelEx)editor.getMarkupModel();
+
+      for (RangeHighlighter highlighter : oldHighlighters) {
+        if (markupModel.containsHighlighter(highlighter)) {
+          highlighter.dispose();
+        }
+      }
+      editor.putUserData(TAG_TREE_HIGHLIGHTERS_IN_EDITOR_KEY, null);
+    }
+  }
+
+  @NotNull
+  private static HighlightInfo createHighlightInfo(Color color, @NotNull TextRange range) {
+    return new HighlightInfo(new TextAttributes(null, color, null, null, Font.PLAIN), null, TYPE, range.getStartOffset(),
+                             range.getEndOffset(), null, null, HighlightSeverity.INFORMATION, false, null, false);
+  }
+
+  @NotNull
+  private static RangeHighlighter createHighlighter(final MarkupModel mm, final @NotNull TextRange range, final Color color) {
+    final RangeHighlighter highlighter =
+      mm.addRangeHighlighter(range.getStartOffset(), range.getEndOffset(), 0, null, HighlighterTargetArea.LINES_IN_RANGE);
+
+    highlighter.setLineMarkerRenderer(new LineMarkerRenderer() {
+      public void paint(Editor editor, Graphics g, Rectangle r) {
+        int height = r.height + editor.getLineHeight();
+        g.setColor(color);
+        g.fillRect(r.x, r.y, 2, height);
+      }
+    });
+    return highlighter;
+  }
+
+
+  private static Color[] toColorsForLineMarkers(Color[] baseColors) {
+    final Color[] colors = new Color[baseColors.length];
+    final Color tagBackground = Gray._239;
+    final double transparency = 0.4;
+    final double factor = 0.8;
+
+    for (int i = 0; i < colors.length; i++) {
+      final Color color = baseColors[i];
+
+      if (color == null) {
+        colors[i] = null;
+        continue;
+      }
+
+      int r = (int)(color.getRed() * factor);
+      int g = (int)(color.getGreen() * factor);
+      int b = (int)(color.getBlue() * factor);
+
+      r = (int)(tagBackground.getRed() * (1 - transparency) + r * transparency);
+      g = (int)(tagBackground.getGreen() * (1 - transparency) + g * transparency);
+      b = (int)(tagBackground.getBlue() * (1 - transparency) + b * transparency);
+
+      colors[i] = new Color(r, g, b);
+    }
+
+    return colors;
+  }
+
+  private Color[] toColorsForEditor(Color[] baseColors) {
+    final Color tagBackground = myEditor.getBackgroundColor();
+
+    if (tagBackground == null) {
+      return baseColors;
+    }
+
+    final Color[] resultColors = new Color[baseColors.length];
+    // todo: make configurable
+    final double transparency = WebEditorOptions.getInstance().getTagTreeHighlightingOpacity() * 0.01;
+
+    for (int i = 0; i < resultColors.length; i++) {
+      final Color color = baseColors[i];
+
+      final Color color1 = color != null
+                           ? XmlTagTreeHighlightingUtil.makeTransparent(color, tagBackground, transparency)
+                           : null;
+      resultColors[i] = color1;
+    }
+
+    return resultColors;
+  }
+
+  public static void clearHighlightingAndLineMarkers(final Editor editor, @NotNull Project project) {
+    final MarkupModel markupModel = DocumentMarkupModel.forDocument(editor.getDocument(), project, true);
+
+    for (RangeHighlighter highlighter : markupModel.getAllHighlighters()) {
+      Object tooltip = highlighter.getErrorStripeTooltip();
+
+      if (!(tooltip instanceof HighlightInfo)) {
+        continue;
+      }
+
+      if (((HighlightInfo)tooltip).type == TYPE) {
+        highlighter.dispose();
+      }
+    }
+
+    clearLineMarkers(editor);
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingPassFactory.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingPassFactory.java
new file mode 100644
index 0000000..ca06e72
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingPassFactory.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.tagTreeHighlighting;
+
+import com.intellij.codeHighlighting.Pass;
+import com.intellij.codeHighlighting.TextEditorHighlightingPass;
+import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory;
+import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar;
+import com.intellij.openapi.components.AbstractProjectComponent;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.ex.EditorEx;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class XmlTagTreeHighlightingPassFactory extends AbstractProjectComponent implements TextEditorHighlightingPassFactory {
+
+  public XmlTagTreeHighlightingPassFactory(Project project, TextEditorHighlightingPassRegistrar registrar) {
+    super(project);
+    registrar.registerTextEditorHighlightingPass(this, new int[]{Pass.UPDATE_ALL}, null, false, -1);
+  }
+
+  public TextEditorHighlightingPass createHighlightingPass(@NotNull final PsiFile file, @NotNull final Editor editor) {
+    if (editor.isOneLineMode()) return null;
+
+    if (!XmlTagTreeHighlightingUtil.isTagTreeHighlightingActive(file)) return null;
+    if (!(editor instanceof EditorEx)) return null;
+
+    return new XmlTagTreeHighlightingPass(file, (EditorEx)editor);
+  }
+}
+
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingUtil.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingUtil.java
new file mode 100644
index 0000000..f5a388a
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingUtil.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.daemon.impl.tagTreeHighlighting;
+
+import com.intellij.application.options.editor.WebEditorOptions;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.editor.colors.ColorKey;
+import com.intellij.openapi.editor.colors.EditorColorsManager;
+import com.intellij.openapi.editor.colors.EditorColorsScheme;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.containers.HashSet;
+import org.jetbrains.annotations.NotNull;
+
+import java.awt.*;
+import java.util.Set;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+class XmlTagTreeHighlightingUtil {
+  private XmlTagTreeHighlightingUtil() {
+  }
+
+  static boolean containsTagsWithSameName(PsiElement[] elements) {
+    final Set<String> names = new HashSet<String>();
+
+    for (PsiElement element : elements) {
+      if (element instanceof XmlTag) {
+        final String name = ((XmlTag)element).getName();
+        if (!names.add(name)) {
+          return true;
+        }
+      }
+    }
+
+    return false;
+  }
+
+  static boolean isTagTreeHighlightingActive(PsiFile file) {
+    if (ApplicationManager.getApplication().isUnitTestMode()) {
+      return false;
+    }
+
+    if (!hasXmlViewProvider(file)) {
+      return false;
+    }
+
+    if (!WebEditorOptions.getInstance().isTagTreeHighlightingEnabled()) {
+      return false;
+    }
+    return true;
+  }
+
+  private static boolean hasXmlViewProvider(@NotNull PsiFile file) {
+    for (PsiFile f : file.getViewProvider().getAllFiles()) {
+      if (f instanceof XmlFile) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  static Color makeTransparent(@NotNull Color color, @NotNull Color backgroundColor, double transparency) {
+    int r = makeTransparent(transparency, color.getRed(), backgroundColor.getRed());
+    int g = makeTransparent(transparency, color.getGreen(), backgroundColor.getGreen());
+    int b = makeTransparent(transparency, color.getBlue(), backgroundColor.getBlue());
+
+    return new Color(r, g, b);
+  }
+
+  private static int makeTransparent(double transparency, int channel, int backgroundChannel) {
+    final int result = (int)(backgroundChannel * (1 - transparency) + channel * transparency);
+    if (result < 0) {
+      return 0;
+    }
+    if (result > 255) {
+      return 255;
+    }
+    return result;
+  }
+
+  static Color[] getBaseColors() {
+    final ColorKey[] colorKeys = XmlTagTreeHighlightingColors.getColorKeys();
+    final Color[] colors = new Color[colorKeys.length];
+
+    final EditorColorsScheme colorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
+
+    for (int i = 0; i < colors.length; i++) {
+      colors[i] = colorsScheme.getColor(colorKeys[i]);
+    }
+
+    return colors;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/DtdSelectioner.java b/xml/impl/src/com/intellij/codeInsight/editorActions/DtdSelectioner.java
new file mode 100644
index 0000000..9f884a8
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/DtdSelectioner.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttlistDecl;
+import com.intellij.psi.xml.XmlElementDecl;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.editor.Editor;
+
+import java.util.List;
+import java.util.ArrayList;
+
+public class DtdSelectioner implements ExtendWordSelectionHandler {
+  public boolean canSelect(PsiElement e) {
+    return e instanceof XmlAttlistDecl || e instanceof XmlElementDecl;
+  }
+
+  public List<TextRange> select(PsiElement e, CharSequence editorText, int cursorOffset, Editor editor) {
+    PsiElement[] children = e.getChildren();
+
+    PsiElement first = null;
+    PsiElement last = null;
+    for (PsiElement child : children) {
+      if (child instanceof XmlToken) {
+        XmlToken token = (XmlToken)child;
+        if (token.getTokenType() == XmlTokenType.XML_TAG_END) {
+          last = token;
+          break;
+        }
+        if (token.getTokenType() == XmlTokenType.XML_ELEMENT_DECL_START ||
+            token.getTokenType() == XmlTokenType.XML_ATTLIST_DECL_START
+           ) {
+          first = token;
+        }
+      }
+    }
+
+    List<TextRange> result = new ArrayList<TextRange>(1);
+    if (first != null && last != null) {
+      final int offset = last.getTextRange().getEndOffset() + 1;
+        result.addAll(ExtendWordSelectionHandlerBase.expandToWholeLine(editorText,
+                                        new TextRange(first.getTextRange().getStartOffset(), offset < editorText.length() ? offset:editorText.length()),
+                                        false));
+    }
+
+    return result;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/EnterBetweenXmlTagsHandler.java b/xml/impl/src/com/intellij/codeInsight/editorActions/EnterBetweenXmlTagsHandler.java
new file mode 100644
index 0000000..6637bef
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/EnterBetweenXmlTagsHandler.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.codeInsight.editorActions.enter.EnterHandlerDelegateAdapter;
+import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.actionSystem.PlatformDataKeys;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
+import com.intellij.openapi.editor.ex.EditorEx;
+import com.intellij.openapi.editor.highlighter.EditorHighlighter;
+import com.intellij.openapi.editor.highlighter.HighlighterIterator;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Ref;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTokenType;
+import org.jetbrains.annotations.NotNull;
+
+public class EnterBetweenXmlTagsHandler extends EnterHandlerDelegateAdapter {
+  public Result preprocessEnter(@NotNull final PsiFile file, @NotNull final Editor editor, @NotNull final Ref<Integer> caretOffset, @NotNull final Ref<Integer> caretAdvance,
+                                @NotNull final DataContext dataContext, final EditorActionHandler originalHandler) {
+    final Project project = PlatformDataKeys.PROJECT.getData(dataContext);
+    
+    if (file instanceof XmlFile && isBetweenXmlTags(project, editor, file, caretOffset.get().intValue())) {
+      originalHandler.execute(editor, dataContext);
+      return Result.DefaultForceIndent;
+    }
+    return Result.Continue;
+  }
+
+  private static boolean isBetweenXmlTags(Project project, Editor editor, PsiFile file, int offset) {
+    if (offset == 0) return false;
+    CharSequence chars = editor.getDocument().getCharsSequence();
+    if (chars.charAt(offset - 1) != '>') return false;
+
+    EditorHighlighter highlighter = ((EditorEx)editor).getHighlighter();
+    HighlighterIterator iterator = highlighter.createIterator(offset - 1);
+    if (iterator.getTokenType() != XmlTokenType.XML_TAG_END) return false;
+    
+    if (isAtTheEndOfEmptyTag(project, editor, file, iterator)) {
+      return false;
+    }
+    
+    iterator.retreat();
+
+    int retrieveCount = 1;
+    while(!iterator.atEnd()) {
+      final IElementType tokenType = iterator.getTokenType();
+      if (tokenType == XmlTokenType.XML_END_TAG_START) return false;
+      if (tokenType == XmlTokenType.XML_START_TAG_START) break;
+      ++retrieveCount;
+      iterator.retreat();
+    }
+
+    for(int i = 0; i < retrieveCount; ++i) iterator.advance();
+    iterator.advance();
+    return !iterator.atEnd() && iterator.getTokenType() == XmlTokenType.XML_END_TAG_START;
+  }
+
+  private static boolean isAtTheEndOfEmptyTag(Project project, Editor editor, PsiFile file, HighlighterIterator iterator) {
+    if (iterator.getTokenType() != XmlTokenType.XML_TAG_END) {
+      return false;
+    }
+
+    PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
+    final PsiElement element = file.findElementAt(iterator.getStart());
+
+    if (element == null) {
+      return false;
+    }
+
+    final PsiElement parent = element.getParent();
+    return parent instanceof XmlTag &&
+           parent.getTextRange().getEndOffset() == iterator.getEnd();
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/HtmlQuoteHandler.java b/xml/impl/src/com/intellij/codeInsight/editorActions/HtmlQuoteHandler.java
new file mode 100644
index 0000000..1c66926
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/HtmlQuoteHandler.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.highlighter.HighlighterIterator;
+
+/**
+ * @author peter
+*/
+public class HtmlQuoteHandler implements QuoteHandler {
+  private QuoteHandler myBaseQuoteHandler;
+
+  public HtmlQuoteHandler() {
+    this(new XmlQuoteHandler());
+  }
+
+  public HtmlQuoteHandler(QuoteHandler _baseHandler) {
+    myBaseQuoteHandler = _baseHandler;
+  }
+
+  public boolean isClosingQuote(HighlighterIterator iterator, int offset) {
+    if (myBaseQuoteHandler.isClosingQuote(iterator, offset)) return true;
+    return false;
+  }
+
+  public boolean isOpeningQuote(HighlighterIterator iterator, int offset) {
+    if (myBaseQuoteHandler.isOpeningQuote(iterator, offset)) return true;
+
+    return false;
+  }
+
+  public boolean hasNonClosedLiteral(Editor editor, HighlighterIterator iterator, int offset) {
+    if (myBaseQuoteHandler.hasNonClosedLiteral(editor,iterator, offset)) return true;
+
+    return false;
+  }
+
+  public boolean isInsideLiteral(HighlighterIterator iterator) {
+    if (myBaseQuoteHandler.isInsideLiteral(iterator)) return true;
+
+    return false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/HtmlSelectioner.java b/xml/impl/src/com/intellij/codeInsight/editorActions/HtmlSelectioner.java
new file mode 100644
index 0000000..0bd36fb
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/HtmlSelectioner.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: mike
+ * Date: Jul 18, 2002
+ * Time: 10:30:17 PM
+ * To change template for new class use 
+ * Code Style | Class Templates options (Tools | IDE Options).
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.codeInsight.editorActions.wordSelection.AbstractWordSelectioner;
+import com.intellij.codeInsight.highlighting.BraceMatchingUtil;
+import com.intellij.ide.highlighter.HighlighterFactory;
+import com.intellij.lang.Language;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.highlighter.EditorHighlighter;
+import com.intellij.openapi.editor.highlighter.HighlighterIterator;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.util.HtmlUtil;
+
+import java.util.List;
+
+public class HtmlSelectioner extends AbstractWordSelectioner {
+
+  public boolean canSelect(PsiElement e) {
+    return canSelectElement(e);
+  }
+
+  static boolean canSelectElement(final PsiElement e) {
+    if (e instanceof XmlToken) {
+      return HtmlUtil.hasHtml(e.getContainingFile());
+    }
+    return false;
+  }
+
+  public List<TextRange> select(PsiElement e, CharSequence editorText, int cursorOffset, Editor editor) {
+    List<TextRange> result;
+
+    if (!(e instanceof XmlToken) ||
+        XmlTokenSelectioner.shouldSelectToken((XmlToken)e) ||
+        ((XmlToken)e).getTokenType() == XmlTokenType.XML_DATA_CHARACTERS) {
+      result = super.select(e, editorText, cursorOffset, editor);
+    }
+    else {
+      result = ContainerUtil.newArrayList();
+    }
+
+    final PsiElement parent = e.getParent();
+    if (parent instanceof XmlComment) {
+      result.addAll(expandToWholeLine(editorText, parent.getTextRange(), true));
+    }
+
+    PsiFile psiFile = e.getContainingFile();
+    FileType fileType = psiFile.getVirtualFile().getFileType();
+
+    addAttributeSelection(result, e);
+    final FileViewProvider fileViewProvider = psiFile.getViewProvider();
+    for (Language lang : fileViewProvider.getLanguages()) {
+      final PsiFile langFile = fileViewProvider.getPsi(lang);
+      if (langFile != psiFile) addAttributeSelection(result, fileViewProvider.findElementAt(cursorOffset, lang));
+    }
+
+    EditorHighlighter highlighter = HighlighterFactory.createHighlighter(e.getProject(), psiFile.getVirtualFile());
+    highlighter.setText(editorText);
+
+    addTagSelection(editorText, cursorOffset, fileType, highlighter, result);
+
+    return result;
+  }
+
+  private static void addTagSelection(CharSequence editorText,
+                                      int cursorOffset,
+                                      FileType fileType,
+                                      EditorHighlighter highlighter,
+                                      List<TextRange> result) {
+    int start = cursorOffset;
+
+    while (true) {
+      if (start < 0) return;
+      HighlighterIterator i = highlighter.createIterator(start);
+      if (i.atEnd()) return;
+
+      while (true) {
+        if (i.getTokenType() == XmlTokenType.XML_START_TAG_START) break;
+        i.retreat();
+        if (i.atEnd()) return;
+      }
+
+      start = i.getStart();
+      final boolean matched = BraceMatchingUtil.matchBrace(editorText, fileType, i, true);
+
+      if (matched) {
+        final int tagEnd = i.getEnd();
+        result.add(new TextRange(start, tagEnd));
+
+        HighlighterIterator j = highlighter.createIterator(start);
+        while (!j.atEnd() && j.getTokenType() != XmlTokenType.XML_TAG_END) j.advance();
+        while (!i.atEnd() && i.getTokenType() != XmlTokenType.XML_END_TAG_START) i.retreat();
+
+        if (!i.atEnd() && !j.atEnd()) {
+          result.add(new TextRange(j.getEnd(), i.getStart()));
+        }
+        if (!j.atEnd()) {
+          result.add(new TextRange(start, j.getEnd()));
+        }
+        if (!i.atEnd()) {
+          result.add(new TextRange(i.getStart(), tagEnd));
+        }
+      }
+
+      start--;
+    }
+  }
+
+  private static void addAttributeSelection(List<TextRange> result, PsiElement e) {
+    final XmlAttribute attribute = PsiTreeUtil.getParentOfType(e, XmlAttribute.class);
+
+    if (attribute != null) {
+      result.add(attribute.getTextRange());
+      final XmlAttributeValue value = attribute.getValueElement();
+
+      if (value != null) {
+        final TextRange range = value.getTextRange();
+        result.add(range);
+        if (value.getFirstChild() != null &&
+            value.getFirstChild().getNode().getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER) {
+          result.add(new TextRange(range.getStartOffset() + 1, range.getEndOffset() - 1));
+        }
+      }
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlAutoPopupHandler.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlAutoPopupHandler.java
new file mode 100644
index 0000000..97cbbce
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlAutoPopupHandler.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.codeInsight.AutoPopupController;
+import com.intellij.lang.Language;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Ref;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
+import com.intellij.psi.templateLanguages.TemplateLanguageFileViewProvider;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.util.XmlUtil;
+
+public class XmlAutoPopupHandler extends TypedHandlerDelegate {
+  public Result checkAutoPopup(final char charTyped, final Project project, final Editor editor, final PsiFile file) {
+    final boolean isXmlLikeFile = file.getLanguage() instanceof XMLLanguage || file.getViewProvider().getBaseLanguage() instanceof XMLLanguage;
+    boolean spaceInTag = isXmlLikeFile && charTyped == ' ';
+
+    if (spaceInTag) {
+      spaceInTag = false;
+      final PsiElement at = file.findElementAt(editor.getCaretModel().getOffset());
+
+      if (at != null) {
+        final PsiElement parent = at.getParent();
+        if (parent instanceof XmlTag) {
+          spaceInTag = true;
+        }
+      }
+    }
+
+    if ((charTyped == '<' || charTyped == '{' || charTyped == '/' || spaceInTag) && isXmlLikeFile) {
+      autoPopupXmlLookup(project, editor);
+      return Result.STOP;
+    }
+    return Result.CONTINUE;
+  }
+
+  public static void autoPopupXmlLookup(final Project project, final Editor editor){
+    AutoPopupController.getInstance(project).autoPopupMemberLookup(editor, new Condition<PsiFile>() {
+      @Override
+      public boolean value(PsiFile file) {
+        int offset = editor.getCaretModel().getOffset();
+
+        PsiElement lastElement = InjectedLanguageUtil.findElementAtNoCommit(file, offset - 1);
+        if (lastElement instanceof PsiFile) { //the very end of an injected file
+          lastElement = file.findElementAt(offset - 1);
+        }
+        if (lastElement == null || !lastElement.isValid()) return false;
+
+        if (doCompleteIfNeeded(offset, file, lastElement)) {
+          return true;
+        }
+
+        FileViewProvider fileViewProvider = file.getViewProvider();
+        Language templateDataLanguage;
+
+        final PsiElement parent = lastElement.getParent();
+        if (fileViewProvider instanceof TemplateLanguageFileViewProvider &&
+            (templateDataLanguage = ((TemplateLanguageFileViewProvider)fileViewProvider).getTemplateDataLanguage()) != parent.getLanguage()) {
+          lastElement = fileViewProvider.findElementAt(offset - 1, templateDataLanguage);
+          if (lastElement == null || !lastElement.isValid()) return false;
+          return doCompleteIfNeeded(offset, file, lastElement);
+        }
+        return false;
+      }
+    });
+  }
+
+  private static boolean doCompleteIfNeeded(int offset, PsiFile file, PsiElement lastElement) {
+    final Ref<Boolean> isRelevantLanguage = new Ref<Boolean>();
+    final Ref<Boolean> isAnt = new Ref<Boolean>();
+    String text = lastElement.getText();
+    final int len = offset - lastElement.getTextRange().getStartOffset();
+    if (len < text.length()) {
+      text = text.substring(0, len);
+    }
+    if (text.equals("<") && isLanguageRelevant(lastElement, file, isRelevantLanguage, isAnt) ||
+        text.equals(" ") && isLanguageRelevant(lastElement, file, isRelevantLanguage, isAnt) ||
+        text.endsWith("${") && isLanguageRelevant(lastElement, file, isRelevantLanguage, isAnt) && isAnt.get().booleanValue() ||
+        text.endsWith("@{") && isLanguageRelevant(lastElement, file, isRelevantLanguage, isAnt) && isAnt.get().booleanValue() ||
+        text.endsWith("</") && isLanguageRelevant(lastElement, file, isRelevantLanguage, isAnt)) {
+      return true;
+    }
+
+    return false;
+  }
+
+  private static boolean isLanguageRelevant(final PsiElement element,
+                                            final PsiFile file,
+                                            final Ref<Boolean> isRelevantLanguage,
+                                            final Ref<Boolean> isAnt) {
+    Boolean isAntFile = isAnt.get();
+    if (isAntFile == null) {
+      isAntFile = XmlUtil.isAntFile(file);
+      isAnt.set(isAntFile);
+    }
+    Boolean result = isRelevantLanguage.get();
+    if (result == null) {
+      Language language = element.getLanguage();
+      PsiElement parent = element.getParent();
+      if (element instanceof PsiWhiteSpace && parent != null) {
+        language = parent.getLanguage();
+      }
+      result = language instanceof XMLLanguage || isAntFile.booleanValue();
+      isRelevantLanguage.set(result);
+    }
+    return result.booleanValue();
+  }
+
+
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlBasicWordSelectionFilter.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlBasicWordSelectionFilter.java
new file mode 100644
index 0000000..d17ddc0
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlBasicWordSelectionFilter.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.openapi.util.Condition;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlElement;
+
+/**
+ * @author yole
+ */
+public class XmlBasicWordSelectionFilter implements Condition<PsiElement> {
+  public boolean value(final PsiElement e) {
+    return !(e instanceof XmlToken) &&
+           !(e instanceof XmlElement);
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlCDATAContentSelectioner.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlCDATAContentSelectioner.java
new file mode 100644
index 0000000..fe440e0
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlCDATAContentSelectioner.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.psi.impl.source.tree.CompositePsiElement;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.editor.Editor;
+
+import java.util.List;
+
+public class XmlCDATAContentSelectioner extends ExtendWordSelectionHandlerBase {
+  public boolean canSelect(PsiElement e) {
+    return e instanceof CompositePsiElement &&
+           ((CompositePsiElement)e).getElementType() == XmlElementType.XML_CDATA;
+  }
+
+  public List<TextRange> select(PsiElement e, CharSequence editorText, int cursorOffset, Editor editor) {
+    List<TextRange> result = super.select(e, editorText, cursorOffset, editor);
+    PsiElement[] children = e.getChildren();
+
+    PsiElement first = null;
+    PsiElement last = null;
+    for (PsiElement child : children) {
+      if (child instanceof XmlToken) {
+        XmlToken token = (XmlToken)child;
+        if (token.getTokenType() == XmlTokenType.XML_CDATA_START) {
+          first = token.getNextSibling();
+        }
+        if (token.getTokenType() == XmlTokenType.XML_CDATA_END) {
+          last = token.getPrevSibling();
+          break;
+        }
+      }
+    }
+
+    if (first != null && last != null) {
+      result.addAll(expandToWholeLine(editorText,
+                                      new TextRange(first.getTextRange().getStartOffset(),
+                                                    last.getTextRange().getEndOffset()),
+                                      false));
+    }
+
+    return result;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlCopyPastePreProcessor.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlCopyPastePreProcessor.java
new file mode 100644
index 0000000..70c0429
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlCopyPastePreProcessor.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.RawText;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.source.tree.TreeUtil;
+import com.intellij.psi.impl.source.xml.behavior.EncodeEachSymbolPolicy;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.util.PsiUtilCore;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlText;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlCopyPastePreProcessor implements CopyPastePreProcessor {
+
+  private static final EncodeEachSymbolPolicy ENCODE_EACH_SYMBOL_POLICY = new EncodeEachSymbolPolicy();
+
+  @Nullable
+  public String preprocessOnCopy(PsiFile file, int[] startOffsets, int[] endOffsets, String text) {
+    return null;
+  }
+
+  public String preprocessOnPaste(Project project, PsiFile file, Editor editor, String text, RawText rawText) {
+    final Document document = editor.getDocument();
+    PsiDocumentManager.getInstance(project).commitDocument(document);
+    int caretOffset = editor.getCaretModel().getOffset();
+    PsiElement element = PsiUtilCore.getElementAtOffset(file, caretOffset);
+
+    ASTNode node = element.getNode();
+    if (node != null) {
+      boolean hasMarkup = text.indexOf('>') >= 0 || text.indexOf('<') >= 0;
+      if (element.getTextOffset() == caretOffset &&
+          node.getElementType() == XmlElementType.XML_END_TAG_START &&
+          node.getTreePrev().getElementType() == XmlElementType.XML_TAG_END) {
+
+         return hasMarkup ? text : encode(text, element);
+      } else {
+        XmlElement parent = PsiTreeUtil.getParentOfType(element, XmlText.class, XmlAttributeValue.class);
+        if (parent != null) {
+          if (parent instanceof XmlText && hasMarkup) {
+            return text;
+          }
+
+          if (TreeUtil.findParent(node, XmlElementType.XML_CDATA) == null &&
+              TreeUtil.findParent(node, XmlElementType.XML_COMMENT) == null) {
+            return encode(text, element);
+          }
+        }
+      }
+    }
+    return text;
+  }
+
+  private static String encode(String text, PsiElement element) {
+    ASTNode astNode = ENCODE_EACH_SYMBOL_POLICY.encodeXmlTextContents(text, element);
+    return astNode.getTreeParent().getText();
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlElementSelectioner.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlElementSelectioner.java
new file mode 100644
index 0000000..a0b5121
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlElementSelectioner.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+
+class XmlElementSelectioner extends ExtendWordSelectionHandlerBase {
+  public boolean canSelect(PsiElement e) {
+    return e instanceof XmlAttribute || e instanceof XmlAttributeValue;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlGtTypedHandler.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlGtTypedHandler.java
new file mode 100644
index 0000000..b3bf0c2
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlGtTypedHandler.java
@@ -0,0 +1,259 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.application.options.editor.WebEditorOptions;
+import com.intellij.codeInsight.highlighting.BraceMatchingUtil;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.ScrollType;
+import com.intellij.openapi.editor.ex.EditorEx;
+import com.intellij.openapi.editor.highlighter.HighlighterIterator;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.*;
+import com.intellij.psi.codeStyle.CodeStyleManager;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.impl.source.xml.XmlTokenImpl;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementDescriptorWithCDataContent;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+
+public class XmlGtTypedHandler extends TypedHandlerDelegate {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.editorActions.TypedHandler");
+
+  public Result beforeCharTyped(final char c, final Project project, final Editor editor, final PsiFile editedFile, final FileType fileType) {
+    final WebEditorOptions webEditorOptions = WebEditorOptions.getInstance();
+    if (c == '>' && webEditorOptions != null && webEditorOptions.isAutomaticallyInsertClosingTag()
+        && (editedFile.getLanguage() instanceof XMLLanguage || editedFile.getViewProvider().getBaseLanguage() instanceof XMLLanguage)) {
+      PsiDocumentManager.getInstance(project).commitAllDocuments();
+
+      PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
+      FileViewProvider provider = editedFile.getViewProvider();
+      int offset = editor.getCaretModel().getOffset();
+
+      PsiElement element, elementAtCaret = null;
+
+      if (offset < editor.getDocument().getTextLength()) {
+        elementAtCaret = element = provider.findElementAt(offset, XMLLanguage.class);
+        
+        if (!(element instanceof PsiWhiteSpace)) {
+          boolean nonAcceptableDelimiter = true;
+
+          if (element instanceof XmlToken) {
+            IElementType tokenType = ((XmlToken)element).getTokenType();
+
+            if (tokenType == XmlTokenType.XML_START_TAG_START || tokenType == XmlTokenType.XML_END_TAG_START) {
+              if (offset > 0) {
+                PsiElement previousElement = provider.findElementAt(offset - 1, XMLLanguage.class);
+
+                if (previousElement instanceof XmlToken) {
+                  tokenType = ((XmlToken)previousElement).getTokenType();
+                  element = previousElement;
+                  nonAcceptableDelimiter = false;
+                }
+              }
+            } else if (tokenType == XmlTokenType.XML_NAME) {
+              if (element.getNextSibling() instanceof PsiErrorElement) {
+                nonAcceptableDelimiter = false;
+              }
+            }
+
+            if (tokenType == XmlTokenType.XML_TAG_END ||
+                tokenType == XmlTokenType.XML_EMPTY_ELEMENT_END && element.getTextOffset() == offset - 1
+               ) {
+              editor.getCaretModel().moveToOffset(offset + 1);
+              editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
+              return Result.STOP;
+            }
+          }
+          if (nonAcceptableDelimiter) return Result.CONTINUE;
+        } else {
+          // check if right after empty end
+          PsiElement previousElement = provider.findElementAt(offset - 1, XMLLanguage.class);
+          if (previousElement instanceof XmlToken) {
+            final IElementType tokenType = ((XmlToken)previousElement).getTokenType();
+
+            if (tokenType == XmlTokenType.XML_EMPTY_ELEMENT_END) {
+              return Result.STOP;
+            }
+          }
+        }
+
+        PsiElement parent = element.getParent();
+        if (parent instanceof XmlText) {
+          final String text = parent.getText();
+          // check /
+          final int index = offset - parent.getTextOffset() - 1;
+
+          if (index >= 0 && text.charAt(index)=='/') {
+            return Result.CONTINUE; // already seen /
+          }
+          element = parent.getPrevSibling();
+        } else if (parent instanceof XmlTag && !(element.getPrevSibling() instanceof XmlTag)) {
+          element = parent;
+        } else if (parent instanceof XmlAttributeValue) {
+          element = parent;
+        }
+      }
+      else {
+        element = provider.findElementAt(editor.getDocument().getTextLength() - 1, XMLLanguage.class);
+        if (element == null) return Result.CONTINUE;
+        element = element.getParent();
+      }
+
+      if (offset > 0 && offset <= editor.getDocument().getTextLength()) {
+        if (editor.getDocument().getCharsSequence().charAt(offset - 1) == '/') { // Some languages (e.g. GSP) allow character '/' in tag name.
+          return Result.CONTINUE;
+        }
+      }
+
+      if (element instanceof XmlAttributeValue) {
+        element = element.getParent().getParent();
+      }
+
+      while(element instanceof PsiWhiteSpace) element = element.getPrevSibling();
+      if (element instanceof XmlDocument) {   // hack for closing tags in RHTML
+        element = element.getLastChild();
+      }
+      if (element == null) return Result.CONTINUE;
+      if (!(element instanceof XmlTag)) {
+        if (element instanceof XmlTokenImpl &&
+            element.getPrevSibling() !=null &&
+            element.getPrevSibling().getText().equals("<")
+           ) {
+          // tag is started and there is another text in the end
+          editor.getDocument().insertString(offset, "</" + element.getText() + ">");
+        }
+        return Result.CONTINUE;
+      }
+
+      XmlTag tag = (XmlTag)element;
+      if (XmlUtil.getTokenOfType(tag, XmlTokenType.XML_TAG_END) != null) return Result.CONTINUE;
+      if (XmlUtil.getTokenOfType(tag, XmlTokenType.XML_EMPTY_ELEMENT_END) != null) return Result.CONTINUE;
+      final XmlToken startToken = XmlUtil.getTokenOfType(tag, XmlTokenType.XML_START_TAG_START);
+      if (startToken == null || !startToken.getText().equals("<")) return Result.CONTINUE;
+
+      String name = tag.getName();
+      if (elementAtCaret instanceof XmlToken && ((XmlToken)elementAtCaret).getTokenType() == XmlTokenType.XML_NAME) {
+        name = name.substring(0, offset - elementAtCaret.getTextOffset());
+      }
+      if (tag instanceof HtmlTag && HtmlUtil.isSingleHtmlTag(name)) return Result.CONTINUE;
+      if ("".equals(name)) return Result.CONTINUE;
+
+      int tagOffset = tag.getTextRange().getStartOffset();
+
+      final XmlToken nameToken = XmlUtil.getTokenOfType(tag, XmlTokenType.XML_NAME);
+      if (nameToken != null && nameToken.getTextRange().getStartOffset() > offset) return Result.CONTINUE;
+
+      HighlighterIterator iterator = ((EditorEx) editor).getHighlighter().createIterator(tagOffset);
+      if (BraceMatchingUtil.matchBrace(editor.getDocument().getCharsSequence(), editedFile.getFileType(), iterator, true,true)) {
+        PsiElement parent = tag.getParent();
+        boolean hasBalance = true;
+        
+        while(parent instanceof XmlTag && name.equals(((XmlTag)parent).getName())) {
+          ASTNode astNode = XmlChildRole.CLOSING_TAG_NAME_FINDER.findChild(parent.getNode());
+          if (astNode == null) {
+            hasBalance = false;
+            break;
+          }
+
+          parent = parent.getParent();
+        }
+        
+        if (hasBalance) {
+          hasBalance = false;
+          for(ASTNode node=parent.getNode().getLastChildNode(); node != null; node = node.getTreePrev()) {
+            ASTNode leaf = node;
+            if (leaf.getElementType() == TokenType.ERROR_ELEMENT) {
+              ASTNode firstChild = leaf.getFirstChildNode();
+              if (firstChild != null) leaf = firstChild;
+              else {
+                PsiElement psiElement = PsiTreeUtil.nextLeaf(leaf.getPsi());
+                leaf = psiElement != null ? psiElement.getNode() : null;
+              }
+              if (leaf != null && leaf.getElementType() == TokenType.WHITE_SPACE) {
+                PsiElement psiElement = PsiTreeUtil.nextLeaf(leaf.getPsi());
+                if (psiElement != null) leaf = psiElement.getNode();
+              }
+            }
+            
+            if (leaf != null && leaf.getElementType() == XmlTokenType.XML_END_TAG_START) {
+              ASTNode treeNext = leaf.getTreeNext();
+              IElementType treeNextType;
+              if (treeNext != null && 
+                  ((treeNextType = treeNext.getElementType()) == XmlTokenType.XML_NAME ||
+                   treeNextType == XmlTokenType.XML_TAG_NAME
+                  )
+                ) {
+                if (name.equals(treeNext.getText())) {
+                  ASTNode parentEndName = parent instanceof XmlTag ?
+                                          XmlChildRole.CLOSING_TAG_NAME_FINDER.findChild(parent.getNode()):null;
+                  hasBalance = !(parent instanceof XmlTag) || 
+                    parentEndName != null && !parentEndName.getText().equals(name);
+                  break;
+                }
+              }
+            }
+          }
+        }
+        
+        if (hasBalance) return Result.CONTINUE; 
+      }
+
+      TextRange cdataReformatRange = null;
+      final XmlElementDescriptor descriptor = tag.getDescriptor();
+
+      if (descriptor instanceof XmlElementDescriptorWithCDataContent) {
+        final XmlElementDescriptorWithCDataContent cDataContainer = (XmlElementDescriptorWithCDataContent)descriptor;
+
+        if (cDataContainer.requiresCdataBracesInContext(tag)) {
+          int rangeStart = offset;
+          @NonNls final String cDataStart = "><![CDATA[";
+          final String inserted = cDataStart + "\n]]>";
+          editor.getDocument().insertString(offset, inserted);
+          final int newoffset = offset + cDataStart.length();
+          editor.getCaretModel().moveToOffset(newoffset);
+          offset += inserted.length();
+          cdataReformatRange = new TextRange(rangeStart, offset + 1);
+        }
+      }
+
+      editor.getDocument().insertString(offset, "</" + name + ">");
+
+      if (cdataReformatRange != null) {
+        PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
+        try {          
+          CodeStyleManager.getInstance(project).reformatText(file, cdataReformatRange.getStartOffset(), cdataReformatRange.getEndOffset());
+        }
+        catch (IncorrectOperationException e) {
+          LOG.error(e);
+        }
+      }
+      return cdataReformatRange != null ? Result.STOP : Result.CONTINUE;
+    }
+    return Result.CONTINUE;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlLineSelectioner.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlLineSelectioner.java
new file mode 100644
index 0000000..76a25de
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlLineSelectioner.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.codeInsight.editorActions.wordSelection.PlainTextLineSelectioner;
+
+import java.util.List;
+
+/**
+ * @author yole
+ */
+public class XmlLineSelectioner extends ExtendWordSelectionHandlerBase {
+  public boolean canSelect(final PsiElement e) {
+    return e instanceof XmlToken && ((XmlToken)e).getTokenType() == XmlTokenType.XML_DATA_CHARACTERS;
+  }
+
+  @Override
+  public List<TextRange> select(final PsiElement e, final CharSequence editorText, final int cursorOffset, final Editor editor) {
+    return PlainTextLineSelectioner.selectPlainTextLine(e, editorText, cursorOffset);
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlQuoteHandler.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlQuoteHandler.java
new file mode 100644
index 0000000..1f87de2
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlQuoteHandler.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.highlighter.HighlighterIterator;
+import com.intellij.psi.xml.XmlTokenType;
+
+/**
+ * @author peter
+*/
+public class XmlQuoteHandler implements QuoteHandler {
+  public boolean isClosingQuote(HighlighterIterator iterator, int offset) {
+    return iterator.getTokenType() == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER;
+  }
+
+  public boolean isOpeningQuote(HighlighterIterator iterator, int offset) {
+    return iterator.getTokenType() == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;
+  }
+
+  public boolean hasNonClosedLiteral(Editor editor, HighlighterIterator iterator, int offset) {
+    return true;
+  }
+
+  public boolean isInsideLiteral(HighlighterIterator iterator) {
+    return false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlSlashTypedHandler.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlSlashTypedHandler.java
new file mode 100644
index 0000000..8794fe0
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlSlashTypedHandler.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.EditorModificationUtil;
+import com.intellij.openapi.editor.ScrollType;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.source.tree.TreeUtil;
+import com.intellij.psi.templateLanguages.OuterLanguageElement;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.xml.util.XmlUtil;
+
+public class XmlSlashTypedHandler extends TypedHandlerDelegate {
+  public Result beforeCharTyped(final char c, final Project project, final Editor editor, final PsiFile editedFile, final FileType fileType) {
+    if ((editedFile.getLanguage() instanceof XMLLanguage || editedFile.getViewProvider().getBaseLanguage() instanceof XMLLanguage) && c == '/') {
+      PsiDocumentManager.getInstance(project).commitAllDocuments();
+
+      PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
+      final int offset = editor.getCaretModel().getOffset();
+      FileViewProvider provider = file.getViewProvider();
+      PsiElement element = provider.findElementAt(offset, XMLLanguage.class);
+
+      if (element instanceof XmlToken) {
+        final IElementType tokenType = ((XmlToken)element).getTokenType();
+
+        if (tokenType == XmlTokenType.XML_EMPTY_ELEMENT_END &&
+            offset == element.getTextOffset()
+           ) {
+          editor.getCaretModel().moveToOffset(offset + 1);
+          editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
+          return Result.STOP;
+        } else if (tokenType == XmlTokenType.XML_TAG_END &&
+                   offset == element.getTextOffset()
+                  ) {
+          final ASTNode parentNode = element.getParent().getNode();
+          final ASTNode child = XmlChildRole.CLOSING_TAG_START_FINDER.findChild(parentNode);
+
+          if (child != null && offset + 1 == child.getTextRange().getStartOffset()) {
+            editor.getDocument().replaceString(offset + 1, parentNode.getTextRange().getEndOffset(),"");
+          }
+        }
+      }
+    }
+    return Result.CONTINUE;
+  }
+
+  public Result charTyped(final char c, final Project project, final Editor editor, final PsiFile editedFile) {
+    if ((editedFile.getLanguage() instanceof XMLLanguage || editedFile.getViewProvider().getBaseLanguage() instanceof XMLLanguage) && c == '/') {
+      PsiDocumentManager.getInstance(project).commitAllDocuments();
+
+      PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
+      FileViewProvider provider = file.getViewProvider();
+      final int offset = editor.getCaretModel().getOffset();
+      PsiElement element = provider.findElementAt(offset - 1, XMLLanguage.class);
+      if (element == null) return Result.CONTINUE;
+      if (!(element.getLanguage() instanceof XMLLanguage)) return Result.CONTINUE;
+
+      ASTNode prevLeaf = element.getNode();
+      final String prevLeafText = prevLeaf != null ? prevLeaf.getText():null;
+      if (prevLeaf != null && !"/".equals(prevLeafText)) {
+        if (!"/".equals(prevLeafText.trim())) return Result.CONTINUE;
+      }
+      while((prevLeaf = TreeUtil.prevLeaf(prevLeaf)) != null && prevLeaf.getElementType() == XmlTokenType.XML_WHITE_SPACE);
+      if(prevLeaf instanceof OuterLanguageElement) {
+        element = file.getViewProvider().findElementAt(offset - 1, file.getLanguage());
+        prevLeaf = element.getNode();
+        while((prevLeaf = TreeUtil.prevLeaf(prevLeaf)) != null && prevLeaf.getElementType() == XmlTokenType.XML_WHITE_SPACE);
+      }
+      if(prevLeaf == null) return Result.CONTINUE;
+
+      XmlTag tag = PsiTreeUtil.getParentOfType(prevLeaf.getPsi(), XmlTag.class);
+      if(tag == null) { // prevLeaf maybe in one tree and element in another
+        PsiElement element2 = provider.findElementAt(prevLeaf.getStartOffset(), XMLLanguage.class);
+        tag = PsiTreeUtil.getParentOfType(element2, XmlTag.class);
+        if (tag == null) return Result.CONTINUE;
+      }
+
+      final XmlToken startToken = XmlUtil.getTokenOfType(tag, XmlTokenType.XML_START_TAG_START);
+      if (startToken == null || !startToken.getText().equals("<")) return Result.CONTINUE;
+      if (XmlUtil.getTokenOfType(tag, XmlTokenType.XML_TAG_END) != null) return Result.CONTINUE;
+      if (XmlUtil.getTokenOfType(tag, XmlTokenType.XML_EMPTY_ELEMENT_END) != null) return Result.CONTINUE;
+      if (PsiTreeUtil.getParentOfType(element, XmlAttributeValue.class) != null) return Result.CONTINUE;
+
+      EditorModificationUtil.insertStringAtCaret(editor, ">");
+      return Result.STOP;
+    }
+    return Result.CONTINUE;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlTagSelectioner.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlTagSelectioner.java
new file mode 100644
index 0000000..cc05cea
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlTagSelectioner.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.xml.*;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.editor.Editor;
+
+import java.util.List;
+
+public class XmlTagSelectioner extends ExtendWordSelectionHandlerBase {
+  public boolean canSelect(PsiElement e) {
+    return e instanceof XmlTag;
+  }
+
+  public List<TextRange> select(PsiElement e, CharSequence editorText, int cursorOffset, Editor editor) {
+    List<TextRange> result = super.select(e, editorText, cursorOffset, editor);
+    PsiElement[] children = e.getChildren();
+
+    addTagContentSelection(children, result, editorText);
+
+    PsiElement prev = e.getPrevSibling();
+    while (prev instanceof PsiWhiteSpace || prev instanceof XmlText || prev instanceof XmlComment) {
+      if (prev instanceof XmlText && prev.getText().trim().length() > 0) break;
+      if (prev instanceof XmlComment) {
+        result.addAll(expandToWholeLine(editorText,
+                                        new TextRange(prev.getTextRange().getStartOffset(),
+                                                      e.getTextRange().getEndOffset()),
+                                        false));
+      }
+      prev = prev.getPrevSibling();
+    }
+
+    return result;
+  }
+
+  private static void addTagContentSelection(final PsiElement[] children, final List<TextRange> result, final CharSequence editorText) {
+    PsiElement first = null;
+    PsiElement last = null;
+    for (PsiElement child : children) {
+      if (child instanceof XmlToken) {
+        XmlToken token = (XmlToken)child;
+        if (token.getTokenType() == XmlTokenType.XML_TAG_END) {
+          first = token.getNextSibling();
+        }
+        if (token.getTokenType() == XmlTokenType.XML_END_TAG_START) {
+          last = token.getPrevSibling();
+          break;
+        }
+      }
+    }
+
+    if (first != null && last != null) {
+      result.addAll(expandToWholeLine(editorText,
+                                      new TextRange(first.getTextRange().getStartOffset(),
+                                                    last.getTextRange().getEndOffset()),
+                                      false));
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlTokenSelectioner.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlTokenSelectioner.java
new file mode 100644
index 0000000..c7e4b51
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlTokenSelectioner.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.editor.Editor;
+
+import java.util.List;
+import java.util.ArrayList;
+
+class XmlTokenSelectioner extends ExtendWordSelectionHandlerBase {
+  public boolean canSelect(PsiElement e) {
+    return e instanceof XmlToken &&
+           !HtmlSelectioner.canSelectElement(e);
+  }
+
+  public List<TextRange> select(PsiElement e, CharSequence editorText, int cursorOffset, Editor editor) {
+    XmlToken token = (XmlToken)e;
+
+    if (shouldSelectToken(token)) {
+      List<TextRange> ranges = super.select(e, editorText, cursorOffset, editor);
+      SelectWordUtil.addWordSelection(editor.getSettings().isCamelWords(), editorText, cursorOffset, ranges);
+      return ranges;
+    }
+    else {
+      List<TextRange> result = new ArrayList<TextRange>();
+      SelectWordUtil.addWordSelection(editor.getSettings().isCamelWords(), editorText, cursorOffset, result);
+      return result;
+    }
+  }
+
+  static boolean shouldSelectToken(final XmlToken token) {
+    return token.getTokenType() != XmlTokenType.XML_DATA_CHARACTERS &&
+          token.getTokenType() != XmlTokenType.XML_START_TAG_START &&
+          token.getTokenType() != XmlTokenType.XML_END_TAG_START &&
+          token.getTokenType() != XmlTokenType.XML_EMPTY_ELEMENT_END &&
+          token.getTokenType() != XmlTokenType.XML_TAG_END;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/moveUpDown/XmlMover.java b/xml/impl/src/com/intellij/codeInsight/editorActions/moveUpDown/XmlMover.java
new file mode 100644
index 0000000..3ef95ed
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/moveUpDown/XmlMover.java
@@ -0,0 +1,280 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.editorActions.moveUpDown;
+
+import com.intellij.lang.injection.InjectedLanguageManager;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.impl.source.xml.TagNameReference;
+import com.intellij.psi.impl.source.xml.XmlDocumentImpl;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlText;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import org.jetbrains.annotations.NotNull;
+
+class XmlMover extends LineMover {
+  //private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.editor.actions.moveUpDown.XmlMover");
+
+  public boolean checkAvailable(@NotNull final Editor editor, @NotNull final PsiFile file, @NotNull final MoveInfo info, final boolean down) {
+    if (!(file instanceof XmlFile)) {
+      return false;
+    }
+    if (!super.checkAvailable(editor, file, info, down)) return false;
+
+    // updated moved range end to cover multiline tag start
+    final Document document = editor.getDocument();
+    int movedLineStart = document.getLineStartOffset(info.toMove.startLine);
+    final int movedLineEnd = document.getLineEndOffset(info.toMove.endLine - 1);
+
+    PsiElement movedEndElement = file.findElementAt(movedLineEnd);
+    if (movedEndElement instanceof PsiWhiteSpace) movedEndElement = PsiTreeUtil.prevLeaf(movedEndElement);
+    PsiElement movedStartElement = file.findElementAt(movedLineStart);
+    if (movedStartElement instanceof PsiWhiteSpace) movedStartElement = PsiTreeUtil.nextLeaf(movedStartElement);
+
+    if (movedEndElement == null || movedStartElement == null) return false;
+    final PsiNamedElement namedParentAtEnd = PsiTreeUtil.getParentOfType(movedEndElement, PsiNamedElement.class);
+    final PsiNamedElement namedParentAtStart = PsiTreeUtil.getParentOfType(movedStartElement, PsiNamedElement.class);
+
+    if (checkInjections(movedEndElement, movedStartElement)) return false;
+
+    XmlTag nearestTag = PsiTreeUtil.getParentOfType(movedStartElement, XmlTag.class);
+    if (nearestTag != null &&
+        ( "script".equals(nearestTag.getLocalName()) ||
+          (nearestTag instanceof HtmlTag && "script".equalsIgnoreCase(nearestTag.getLocalName()))
+        )
+      ) {
+      return false;
+    }
+
+    PsiNamedElement movedParent = null;
+
+    if (namedParentAtEnd == namedParentAtStart) movedParent = namedParentAtEnd;
+    else if (namedParentAtEnd instanceof XmlAttribute && namedParentAtStart instanceof XmlTag && namedParentAtEnd.getParent() == namedParentAtStart) {
+      movedParent = namedParentAtStart;
+    } else if (namedParentAtStart instanceof XmlAttribute && namedParentAtEnd instanceof XmlTag && namedParentAtStart.getParent() == namedParentAtEnd) {
+      movedParent = namedParentAtEnd;
+    }
+
+    if (movedParent == null) {
+      return false;
+    }
+
+    final TextRange textRange = movedParent.getTextRange();
+
+    if (movedParent instanceof XmlTag) {
+      final XmlTag tag = (XmlTag)movedParent;
+      PsiElement parent = tag.getParent();
+      if (!(parent instanceof XmlTag) && PsiTreeUtil.getChildrenOfType(parent, XmlTag.class).length < 2) {
+        // the only top-level tag
+        return info.prohibitMove();
+      }
+      final TextRange valueRange = tag.getValue().getTextRange();
+      final int valueStart = valueRange.getStartOffset();
+
+      if (movedLineStart < valueStart && valueStart + 1 < document.getTextLength()) {
+        movedLineStart = updateMovedRegionEnd(document, movedLineStart, valueStart + 1, info, down);
+      }
+      if (movedLineStart < valueStart) {
+        movedLineStart = updateMovedRegionStart(document, movedLineStart, tag.getTextRange().getStartOffset(), info, down);
+      }
+    } else if (movedParent instanceof XmlAttribute) {
+      final int endOffset = textRange.getEndOffset() + 1;
+      if (endOffset < document.getTextLength()) movedLineStart = updateMovedRegionEnd(document, movedLineStart, endOffset, info, down);
+      movedLineStart = updateMovedRegionStart(document, movedLineStart, textRange.getStartOffset(), info, down);
+    }
+
+    final TextRange moveDestinationRange = new TextRange(
+      document.getLineStartOffset(info.toMove2.startLine),
+      document.getLineStartOffset(info.toMove2.endLine) - 1
+    );
+
+    if (movedParent instanceof XmlAttribute) {
+      final XmlTag parent = ((XmlAttribute)movedParent).getParent();
+
+      if (parent != null) {
+        final TextRange valueRange = parent.getValue().getTextRange();
+
+        // Do not move attributes out of tags
+        if ( (down && moveDestinationRange.getEndOffset() >= valueRange.getStartOffset()) ||
+             (!down && moveDestinationRange.getStartOffset() <= parent.getTextRange().getStartOffset())
+          ) {
+          return info.prohibitMove();
+        }
+      }
+    }
+
+    if (down) {
+      PsiElement updatedElement = file.findElementAt(moveDestinationRange.getEndOffset());
+      if (updatedElement instanceof PsiWhiteSpace) updatedElement = PsiTreeUtil.prevLeaf(updatedElement);
+
+      if (updatedElement != null) {
+        final PsiNamedElement targetParent = PsiTreeUtil.getParentOfType(updatedElement, movedParent.getClass());
+
+        if (targetParent instanceof XmlTag) {
+          if (targetParent == movedParent) return false;
+          if (moveTags(info, (XmlTag)movedParent, (XmlTag)targetParent, down)) return true;
+
+          final XmlTag tag = (XmlTag)targetParent;
+          final int offset = tag.isEmpty() ? tag.getTextRange().getStartOffset() : tag.getValue().getTextRange().getStartOffset();
+          updatedMovedIntoEnd(document, info, offset);
+          if (tag.isEmpty()) {
+            info.toMove2 = new LineRange(targetParent);
+          }
+        } else if (targetParent instanceof XmlAttribute) {
+          updatedMovedIntoEnd(document, info, targetParent.getTextRange().getEndOffset());
+        }
+      }
+    } else {
+      PsiElement updatedElement = file.findElementAt(moveDestinationRange.getStartOffset());
+      if (updatedElement instanceof PsiWhiteSpace) updatedElement = PsiTreeUtil.nextLeaf(updatedElement);
+
+      if (updatedElement != null) {
+        final PsiNamedElement targetParent = PsiTreeUtil.getParentOfType(updatedElement, movedParent.getClass());
+
+        if (targetParent instanceof XmlTag) {
+          final XmlTag tag = (XmlTag)targetParent;
+          final TextRange tagValueRange = tag.getValue().getTextRange();
+
+          // We need to update destination range to jump over tag start
+          final XmlTag[] subtags = tag.getSubTags();
+          if ((tagValueRange.contains(movedLineStart) && subtags.length > 0 && subtags[0] == movedParent) ||
+              ( tagValueRange.getLength() == 0 && tag.getTextRange().intersects(moveDestinationRange))
+             ) {
+            final int line = document.getLineNumber(tag.getTextRange().getStartOffset());
+            final LineRange toMove2 = info.toMove2;
+            info.toMove2 = new LineRange(Math.min(line, toMove2.startLine), toMove2.endLine);
+          }
+          if (targetParent == movedParent) return false;
+          if (moveTags(info, (XmlTag)movedParent, (XmlTag)targetParent, down)) return true;
+
+        } else if (targetParent instanceof XmlAttribute) {
+          final int line = document.getLineNumber(targetParent.getTextRange().getStartOffset());
+          final LineRange toMove2 = info.toMove2;
+          info.toMove2 = new LineRange(Math.min(line, toMove2.startLine), toMove2.endLine);
+        }
+      }
+    }
+
+    if (movedParent instanceof XmlTag) {
+      // it's quite simple after all...
+      info.toMove = new LineRange(movedParent);
+    }
+    return true;
+  }
+
+  private static boolean moveTags(MoveInfo info, XmlTag moved, XmlTag target, boolean down) {
+    if (target.getParent() == moved) {
+      // we are going to jump into our own children
+      // this can mean that target computed incorrectly
+      XmlTag next = down ? PsiTreeUtil.getNextSiblingOfType(moved, XmlTag.class) :
+                           PsiTreeUtil.getPrevSiblingOfType(moved, XmlTag.class);
+      if (next == null) return info.prohibitMove();
+      info.toMove = new LineRange(moved);
+      info.toMove2 = new LineRange(next);
+      return true;
+    }
+    else if (moved.getParent() == target) {
+      return false;
+    }
+
+    LineRange targetRange = new LineRange(target);
+    if (targetRange.contains(info.toMove2)) {
+      // we are going to jump into sibling tag
+      XmlElementDescriptor descriptor = moved.getDescriptor();
+      if (descriptor == null) return false;
+      XmlNSDescriptor nsDescriptor = descriptor.getNSDescriptor();
+      if (nsDescriptor == null) return false;
+      XmlFile descriptorFile = nsDescriptor.getDescriptorFile();
+      if (descriptorFile == null || XmlDocumentImpl.isAutoGeneratedSchema(descriptorFile)) return false;
+      if (!TagNameReference.couldContain(target, moved)) {
+        info.toMove = new LineRange(moved);
+        info.toMove2 = targetRange;
+        return true;
+      }
+    }
+
+    return false;
+  }
+
+  private static boolean checkInjections(PsiElement movedEndElement, PsiElement movedStartElement) {
+    final XmlText text = PsiTreeUtil.getParentOfType(movedStartElement, XmlText.class);
+    final XmlText text2 = PsiTreeUtil.getParentOfType(movedEndElement, XmlText.class);
+
+    // Let's do not care about injections for this mover
+    if ( ( text != null && InjectedLanguageManager.getInstance(text.getProject()).getInjectedPsiFiles(text) != null) ||
+         ( text2 != null && InjectedLanguageManager.getInstance(text2.getProject()).getInjectedPsiFiles(text2) != null)) {
+      return true;
+    }
+    return false;
+  }
+
+  private static void updatedMovedIntoEnd(final Document document, @NotNull final MoveInfo info, final int offset) {
+    if (offset + 1 < document.getTextLength()) {
+      final int line = document.getLineNumber(offset + 1);
+      final LineRange toMove2 = info.toMove2;
+      if (toMove2 == null) return;
+      info.toMove2 = new LineRange(toMove2.startLine, Math.min(Math.max(line, toMove2.endLine), document.getLineCount() - 1));
+    }
+  }
+
+  private static int updateMovedRegionStart(final Document document,
+                                            int movedLineStart,
+                                            final int offset,
+                                            @NotNull final MoveInfo info,
+                                            final boolean down) {
+    final int line = document.getLineNumber(offset);
+    final LineRange toMove = info.toMove;
+    int delta = toMove.startLine - line;
+    info.toMove = new LineRange(Math.min(line, toMove.startLine), toMove.endLine);
+
+    // update moved range
+    if (delta > 0 && !down) {
+      final LineRange toMove2 = info.toMove2;
+      info.toMove2 = new LineRange(toMove2.startLine - delta, toMove2.endLine - delta);
+      movedLineStart = document.getLineStartOffset(toMove.startLine);
+    }
+    return movedLineStart;
+  }
+
+  private static int updateMovedRegionEnd(final Document document,
+                                          int movedLineStart,
+                                          final int valueStart,
+                                          @NotNull final MoveInfo info,
+                                          final boolean down) {
+    final int line = document.getLineNumber(valueStart);
+    final LineRange toMove = info.toMove;
+    int delta = line - toMove.endLine;
+    info.toMove = new LineRange(toMove.startLine, Math.max(line, toMove.endLine));
+
+    // update moved range
+    if (delta > 0 && down) {
+      final LineRange toMove2 = info.toMove2;
+      info.toMove2 = new LineRange(toMove2.startLine + delta, Math.min(toMove2.endLine + delta, document.getLineCount() - 1));
+      movedLineStart = document.getLineStartOffset(toMove.startLine);
+    }
+    return movedLineStart;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/folding/impl/XmlElementSignatureProvider.java b/xml/impl/src/com/intellij/codeInsight/folding/impl/XmlElementSignatureProvider.java
new file mode 100644
index 0000000..2d7f7e0
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/folding/impl/XmlElementSignatureProvider.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.folding.impl;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.util.HtmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.StringTokenizer;
+
+/**
+ * @author yole
+ */
+public class XmlElementSignatureProvider extends AbstractElementSignatureProvider {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.folding.impl.XmlElementSignatureProvider");
+
+  public String getSignature(@NotNull PsiElement element) {
+    if (element instanceof XmlTag) {
+      XmlTag tag = (XmlTag)element;
+      PsiElement parent = tag.getParent();
+
+      StringBuilder buffer = new StringBuilder();
+      buffer.append("tag").append(ELEMENT_TOKENS_SEPARATOR);
+      String name = tag.getName();
+      buffer.append(name.length() == 0 ? "<unnamed>" : name);
+
+      buffer.append(ELEMENT_TOKENS_SEPARATOR);
+      buffer.append(getChildIndex(tag, parent, name, XmlTag.class));
+
+      if (parent instanceof XmlTag) {
+        String parentSignature = getSignature(parent);
+        buffer.append(";");
+        buffer.append(parentSignature);
+      }
+
+      return buffer.toString();
+    }
+    return null;
+  }
+
+  @Override
+  protected PsiElement restoreBySignatureTokens(@NotNull PsiFile file,
+                                                @NotNull PsiElement parent,
+                                                @NotNull String type,
+                                                @NotNull StringTokenizer tokenizer,
+                                                @Nullable StringBuilder processingInfoStorage)
+  {
+    if (type.equals("tag")) {
+      String name = tokenizer.nextToken();
+
+      if (parent instanceof XmlFile) {
+        parent = ((XmlFile)parent).getDocument();
+        if (parent == null) {
+          return null;
+        }
+      }
+
+      try {
+        int index = Integer.parseInt(tokenizer.nextToken());
+        PsiElement result = restoreElementInternal(parent, name, index, XmlTag.class);
+
+        if (result == null &&
+            file.getFileType() == StdFileTypes.JSP) {
+          //TODO: FoldingBuilder API, psi roots, etc?
+          if (parent instanceof XmlDocument) {
+            // html tag, not found in jsp tree
+            result = restoreElementInternal(HtmlUtil.getRealXmlDocument((XmlDocument)parent), name, index, XmlTag.class);
+          }
+          else if (name.equals("<unnamed>") && parent != null) {
+            // scriplet/declaration missed because null name
+            result = restoreElementInternal(parent, "", index, XmlTag.class);
+          }
+        }
+
+        return result;
+      }
+      catch (NumberFormatException e) {
+        LOG.error(e);
+        return null;
+      }
+    }
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/highlighting/HtmlClosingTagErrorFilter.java b/xml/impl/src/com/intellij/codeInsight/highlighting/HtmlClosingTagErrorFilter.java
new file mode 100644
index 0000000..7b8ab24
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/highlighting/HtmlClosingTagErrorFilter.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.highlighting;
+
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiErrorElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+public class HtmlClosingTagErrorFilter extends HighlightErrorFilter {
+
+  public boolean shouldHighlightErrorElement(@NotNull final PsiErrorElement element) {
+    final PsiFile psiFile = element.getContainingFile();
+    if (psiFile == null || (psiFile.getViewProvider().getBaseLanguage() != HTMLLanguage.INSTANCE
+                            && HTMLLanguage.INSTANCE != element.getLanguage())) return true;
+
+    final PsiElement[] children = element.getChildren();
+    if (children.length > 0) {
+      if (children[0] instanceof XmlToken && XmlTokenType.XML_END_TAG_START == ((XmlToken)children[0]).getTokenType()) {
+        if (XmlErrorMessages.message("xml.parsing.closing.tag.matches.nothing").equals(element.getErrorDescription())) {
+          return false;
+        }
+      }
+    }
+
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/highlighting/XmlReadWriteAccessDetector.java b/xml/impl/src/com/intellij/codeInsight/highlighting/XmlReadWriteAccessDetector.java
new file mode 100644
index 0000000..aff0c38
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/highlighting/XmlReadWriteAccessDetector.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.highlighting;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlElementDecl;
+import com.intellij.psi.xml.XmlComment;
+
+/**
+ * @author yole
+ */
+public class XmlReadWriteAccessDetector extends ReadWriteAccessDetector {
+  public boolean isReadWriteAccessible(final PsiElement element) {
+    return element instanceof XmlAttributeValue ||
+        element instanceof XmlTag ||
+        element instanceof XmlElementDecl ||
+        element instanceof XmlComment; // e.g. <!--@elvariable name="xxx" type="yyy"-->
+  }
+
+  public boolean isDeclarationWriteAccess(final PsiElement element) {
+    return false;
+  }
+
+  public Access getReferenceAccess(final PsiElement referencedElement, final PsiReference reference) {
+    PsiElement refElement = reference.getElement();
+    return ( refElement instanceof XmlAttributeValue &&
+              (!(referencedElement instanceof XmlTag) || refElement.getParent().getParent() == referencedElement)
+            ) ||
+            refElement instanceof XmlElementDecl ||
+            refElement instanceof XmlComment   // e.g. <!--@elvariable name="xxx" type="yyy"-->
+           ? Access.Write : Access.Read;
+
+  }
+
+  public Access getExpressionAccess(final PsiElement expression) {
+    return expression instanceof XmlAttributeValue ? Access.Write : Access.Read;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/hint/TagDeclarationRangeHandler.java b/xml/impl/src/com/intellij/codeInsight/hint/TagDeclarationRangeHandler.java
new file mode 100644
index 0000000..34fe453
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/hint/TagDeclarationRangeHandler.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.hint;
+
+import org.jetbrains.annotations.NotNull;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+
+public class TagDeclarationRangeHandler implements DeclarationRangeHandler {
+  @NotNull
+  public TextRange getDeclarationRange(@NotNull final PsiElement container) {
+    XmlTag xmlTag = (XmlTag)container;
+    int endOffset = xmlTag.getTextRange().getStartOffset();
+
+    for (PsiElement child = xmlTag.getFirstChild(); child != null; child = child.getNextSibling()) {
+      endOffset = child.getTextRange().getEndOffset();
+      if (child instanceof XmlToken) {
+        XmlToken token = (XmlToken)child;
+        IElementType tokenType = token.getTokenType();
+        if (tokenType == XmlTokenType.XML_EMPTY_ELEMENT_END || tokenType == XmlTokenType.XML_TAG_END) break;
+      }
+    }
+
+    return new TextRange(xmlTag.getTextRange().getStartOffset(), endOffset);
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/hint/XmlImplementationTextSelectioner.java b/xml/impl/src/com/intellij/codeInsight/hint/XmlImplementationTextSelectioner.java
new file mode 100644
index 0000000..977a0dd
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/hint/XmlImplementationTextSelectioner.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * User: anna
+ * Date: 01-Feb-2008
+ */
+package com.intellij.codeInsight.hint;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+
+public class XmlImplementationTextSelectioner implements ImplementationTextSelectioner {
+  private static final Logger LOG = Logger.getInstance("#" + XmlImplementationTextSelectioner.class.getName());
+
+  public int getTextStartOffset(@NotNull final PsiElement parent) {
+    return parent.getTextRange().getStartOffset();
+  }
+
+  public int getTextEndOffset(@NotNull PsiElement element) {
+    if (element instanceof XmlAttributeValue) {
+      final XmlTag xmlTag = PsiTreeUtil.getParentOfType(element, XmlTag.class);// for convenience
+      if (xmlTag != null) return xmlTag.getTextRange().getEndOffset();
+      LOG.assertTrue(false);
+    }
+    return element.getTextRange().getEndOffset();
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/hint/api/impls/XmlParameterInfoHandler.java b/xml/impl/src/com/intellij/codeInsight/hint/api/impls/XmlParameterInfoHandler.java
new file mode 100644
index 0000000..798a3d9
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/hint/api/impls/XmlParameterInfoHandler.java
@@ -0,0 +1,220 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.hint.api.impls;
+
+import com.intellij.codeInsight.CodeInsightBundle;
+import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.MutableLookupElement;
+import com.intellij.lang.parameterInfo.*;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.Function;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.Comparator;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class XmlParameterInfoHandler implements ParameterInfoHandler<XmlTag,XmlElementDescriptor> {
+  private static final Comparator<XmlAttributeDescriptor> COMPARATOR = new Comparator<XmlAttributeDescriptor>() {
+    public int compare(final XmlAttributeDescriptor o1, final XmlAttributeDescriptor o2) {
+      return o1.getName().compareTo(o2.getName());
+    }
+  };
+
+  public Object[] getParametersForLookup(LookupElement item, ParameterInfoContext context) {
+    if (!(item instanceof MutableLookupElement)) return null;
+    final Object lookupItem = item.getObject();
+    if (lookupItem instanceof XmlElementDescriptor) return new Object[]{lookupItem};
+    return null;
+  }
+
+  public Object[] getParametersForDocumentation(final XmlElementDescriptor p, final ParameterInfoContext context) {
+    return getSortedDescriptors(p);
+  }
+
+  public static XmlAttributeDescriptor[] getSortedDescriptors(final XmlElementDescriptor p) {
+    final XmlAttributeDescriptor[] xmlAttributeDescriptors = p.getAttributesDescriptors(null);
+    Arrays.sort(xmlAttributeDescriptors, COMPARATOR);
+    return xmlAttributeDescriptors;
+  }
+
+  public boolean couldShowInLookup() {
+    return true;
+  }
+
+  public XmlTag findElementForParameterInfo(final CreateParameterInfoContext context) {
+    final XmlTag tag = findXmlTag(context.getFile(), context.getOffset());
+    final XmlElementDescriptor descriptor = tag != null ? tag.getDescriptor() : null;
+
+    if (descriptor == null) {
+      DaemonCodeAnalyzer.getInstance(context.getProject()).updateVisibleHighlighters(context.getEditor());
+      return null;
+    }
+
+    context.setItemsToShow(new Object[] {descriptor});
+    return tag;
+  }
+
+  public void showParameterInfo(final @NotNull XmlTag element, final CreateParameterInfoContext context) {
+    context.showHint(element, element.getTextRange().getStartOffset() + 1, this);
+  }
+
+  public XmlTag findElementForUpdatingParameterInfo(final UpdateParameterInfoContext context) {
+    final XmlTag tag = findXmlTag(context.getFile(), context.getOffset());
+    if (tag != null) {
+      final PsiElement currentXmlTag = context.getParameterOwner();
+      if (currentXmlTag == null || currentXmlTag == tag) return tag;
+    }
+
+    return null;
+  }
+
+  public void updateParameterInfo(@NotNull final XmlTag o, final UpdateParameterInfoContext context) {
+    if (context.getParameterOwner() == null || o.equals(context.getParameterOwner())) {
+      context.setParameterOwner( o );
+    } else {
+      context.removeHint();
+    }
+  }
+
+  public String getParameterCloseChars() {
+    return null;
+  }
+
+  public boolean tracksParameterIndex() {
+    return false;
+  }
+
+  @Nullable
+  private static XmlTag findXmlTag(PsiFile file, int offset){
+    if (!(file instanceof XmlFile)) return null;
+
+    PsiElement element = file.findElementAt(offset);
+    if (element == null) return null;
+    element = element.getParent();
+
+    while (element != null) {
+      if (element instanceof XmlTag) {
+        XmlTag tag = (XmlTag)element;
+
+        final PsiElement[] children = tag.getChildren();
+
+        if (offset <= children[0].getTextRange().getStartOffset()) return null;
+
+        for (PsiElement child : children) {
+          final TextRange range = child.getTextRange();
+          if (range.getStartOffset() <= offset && range.getEndOffset() > offset) return tag;
+
+          if (child instanceof XmlToken) {
+            XmlToken token = (XmlToken)child;
+            if (token.getTokenType() == XmlTokenType.XML_TAG_END) return null;
+          }
+        }
+
+        return null;
+      }
+
+      element = element.getParent();
+    }
+
+    return null;
+  }
+
+  public void updateUI(XmlElementDescriptor o, final ParameterInfoUIContext context) {
+    updateElementDescriptor(
+      o,
+      context,
+      new Function<String, Boolean>() {
+        final XmlTag parameterOwner  = (XmlTag)context.getParameterOwner();
+
+        public Boolean fun(String s) {
+          return parameterOwner != null ? parameterOwner.getAttributeValue(s) != null:false;
+        }
+      });
+  }
+
+  public static void updateElementDescriptor(XmlElementDescriptor descriptor, ParameterInfoUIContext context,
+                                             Function<String, Boolean> attributePresentFun) {
+    final XmlAttributeDescriptor[] attributes = descriptor != null ? getSortedDescriptors(descriptor) : XmlAttributeDescriptor.EMPTY;
+
+    StringBuffer buffer = new StringBuffer();
+    int highlightStartOffset = -1;
+    int highlightEndOffset = -1;
+
+    if (attributes.length == 0) {
+      buffer.append(CodeInsightBundle.message("xml.tag.info.no.attributes"));
+    }
+    else {
+      StringBuffer text1 = new StringBuffer(" ");
+      StringBuffer text2 = new StringBuffer(" ");
+      StringBuffer text3 = new StringBuffer(" ");
+
+      for (XmlAttributeDescriptor attribute : attributes) {
+        if (Boolean.TRUE.equals(attributePresentFun.fun(attribute.getName()))) {
+          if (!(text1.toString().equals(" "))) {
+            text1.append(", ");
+          }
+          text1.append(attribute.getName());
+        }
+        else if (attribute.isRequired()) {
+          if (!(text2.toString().equals(" "))) {
+            text2.append(", ");
+          }
+          text2.append(attribute.getName());
+        }
+        else {
+          if (!(text3.toString().equals(" "))) {
+            text3.append(", ");
+          }
+          text3.append(attribute.getName());
+        }
+      }
+
+      if (!text1.toString().equals(" ") && !text2.toString().equals(" ")) {
+        text1.append(", ");
+      }
+
+      if (!text2.toString().equals(" ") && !text3.toString().equals(" ")) {
+        text2.append(", ");
+      }
+
+      if (!text1.toString().equals(" ") && !text3.toString().equals(" ") && text2.toString().equals(" ")) {
+        text1.append(", ");
+      }
+
+      buffer.append(text1);
+      highlightStartOffset = buffer.length();
+      buffer.append(text2);
+      highlightEndOffset = buffer.length();
+      buffer.append(text3);
+    }
+
+    context.setupUIComponentPresentation(buffer.toString(), highlightStartOffset, highlightEndOffset, false,
+                                         false, true, context.getDefaultParameterColor());
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/intentions/XmlChooseColorIntentionAction.java b/xml/impl/src/com/intellij/codeInsight/intentions/XmlChooseColorIntentionAction.java
new file mode 100644
index 0000000..5bfdb3b
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/intentions/XmlChooseColorIntentionAction.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.intentions;
+
+import com.intellij.codeInsight.CodeInsightBundle;
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.ui.ColorChooser;
+import com.intellij.ui.ColorUtil;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class XmlChooseColorIntentionAction extends PsiElementBaseIntentionAction {
+  public XmlChooseColorIntentionAction() {
+    setText(CodeInsightBundle.message("intention.color.chooser.dialog"));
+  }
+
+  public boolean isAvailable(@NotNull final Project project, final Editor editor, @NotNull final PsiElement element) {
+    final PsiElement parent = element.getParent();
+    return parent instanceof XmlAttributeValue && ColorUtil.fromHex(((XmlAttributeValue)parent).getValue(), null) != null;
+  }
+
+  @NotNull
+  public String getFamilyName() {
+    return getText();
+  }
+
+  @Override
+  public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
+    if (!CodeInsightUtilBase.preparePsiElementForWrite(element)) return;
+    invokeForLiteral(editor.getComponent(), element);
+  }
+
+  private void invokeForLiteral(JComponent editorComponent, PsiElement element) {
+    final XmlAttributeValue literal = PsiTreeUtil.getParentOfType(element, XmlAttributeValue.class);
+    if (literal == null) return;
+    final String text = StringUtil.unquoteString(literal.getValue());
+    final String hexPrefix = text.startsWith("#") ? "#" : "";
+
+    Color oldColor;
+    try {
+      oldColor = Color.decode(text);
+    }
+    catch (NumberFormatException e) {
+      oldColor = Color.GRAY;
+    }
+    Color color = ColorChooser.chooseColor(editorComponent, getText(), oldColor, true);
+    if (color == null) return;
+    if (!Comparing.equal(color, oldColor)) {
+      final String newText =  hexPrefix + ColorUtil.toHex(color);
+      final PsiManager manager = literal.getManager();
+      final XmlAttribute newAttribute = XmlElementFactory.getInstance(manager.getProject()).createXmlAttribute("name", newText);
+      literal.replace(newAttribute.getValueElement());
+    }
+  }
+}
+
diff --git a/xml/impl/src/com/intellij/codeInsight/navigation/XmlMethodNavigationOffsetProvider.java b/xml/impl/src/com/intellij/codeInsight/navigation/XmlMethodNavigationOffsetProvider.java
new file mode 100644
index 0000000..136ddf8
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/navigation/XmlMethodNavigationOffsetProvider.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.navigation;
+
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+
+import java.util.ArrayList;
+
+/**
+ * @author yole
+ */
+public class XmlMethodNavigationOffsetProvider implements MethodNavigationOffsetProvider {
+  @Override
+  public int[] getMethodNavigationOffsets(final PsiFile file, final int caretOffset) {
+    if (file instanceof XmlFile) {
+      PsiElement element = file;
+      PsiElement elementAt = file.findElementAt(caretOffset);
+      elementAt = PsiTreeUtil.getParentOfType(elementAt, XmlTag.class);
+      if (elementAt != null) element = elementAt;
+
+      ArrayList<PsiElement> array = new ArrayList<PsiElement>();
+      addNavigationElements(array, element);
+      return MethodUpDownUtil.offsetsFromElements(array);
+    }
+    return null;
+  }
+
+  private static void addNavigationElements(ArrayList<PsiElement> array, PsiElement element) {
+    PsiElement parent = element instanceof XmlFile ? element : element.getParent();
+
+    if (parent != null) {
+      PsiElement[] children = parent.getChildren();
+      for (PsiElement child : children) {
+        if (child instanceof XmlTag) {
+          array.add(child);
+        }
+      }
+    }
+    final PsiElement parentElement = element.getParent();
+    if (parentElement != null) {
+      addNavigationElements(array, parentElement);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/HtmlContextType.java b/xml/impl/src/com/intellij/codeInsight/template/HtmlContextType.java
new file mode 100644
index 0000000..5fe1dbf
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/HtmlContextType.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template;
+
+import com.intellij.codeInsight.CodeInsightBundle;
+import com.intellij.lang.Language;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.xhtml.XHTMLLanguage;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author yole
+ */
+public class HtmlContextType extends FileTypeBasedContextType {
+  public HtmlContextType() {
+    super("HTML", CodeInsightBundle.message("dialog.edit.template.checkbox.html"), StdFileTypes.HTML);
+  }
+
+  @Override
+  public boolean isInContext(@NotNull PsiFile file, int offset) {
+    return isMyLanguage(file.getLanguage()) && !XmlContextType.isEmbeddedContent(file, offset);
+  }
+
+  static boolean isMyLanguage(Language language) {
+    return language.isKindOf(HTMLLanguage.INSTANCE) || language.isKindOf(XHTMLLanguage.INSTANCE);
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/codeInsight/template/HtmlTextContextType.java b/xml/impl/src/com/intellij/codeInsight/template/HtmlTextContextType.java
new file mode 100644
index 0000000..5a61b4e
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/HtmlTextContextType.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template;
+
+import com.intellij.codeInsight.CodeInsightBundle;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiErrorElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlComment;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlText;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class HtmlTextContextType extends TemplateContextType {
+  protected HtmlTextContextType() {
+    super("HTML_TEXT", CodeInsightBundle.message("dialog.edit.template.checkbox.html.text"), HtmlContextType.class);
+  }
+
+  @Override
+  public boolean isInContext(@NotNull PsiFile file, int offset) {
+    if (!HtmlContextType.isMyLanguage(file.getLanguage())) {
+      return false;
+    }
+    PsiElement element = file.findElementAt(offset);
+    return element == null || isInContext(element);
+  }
+
+  public static boolean isInContext(@NotNull PsiElement element) {
+    if (PsiTreeUtil.getParentOfType(element, XmlComment.class) != null) {
+      return false;
+    }
+    if (PsiTreeUtil.getParentOfType(element, XmlText.class) != null) {
+      return true;
+    }
+    PsiElement parent = element.getParent();
+    if (parent instanceof PsiErrorElement) {
+      parent = parent.getParent();
+    }
+    return parent instanceof XmlDocument;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/XmlContextType.java b/xml/impl/src/com/intellij/codeInsight/template/XmlContextType.java
new file mode 100644
index 0000000..478fc00
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/XmlContextType.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template;
+
+import com.intellij.codeInsight.CodeInsightBundle;
+import com.intellij.lang.Language;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiUtilBase;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author yole
+ */
+public class XmlContextType extends TemplateContextType {
+  public XmlContextType() {
+    super("XML", CodeInsightBundle.message("dialog.edit.template.checkbox.xml"));
+  }
+
+  @Override
+  public boolean isInContext(@NotNull PsiFile file, int offset) {
+    return file.getLanguage().isKindOf(XMLLanguage.INSTANCE) && !isEmbeddedContent(file, offset) &&
+           !HtmlContextType.isMyLanguage(PsiUtilBase.getLanguageAtOffset(file, offset)) &&
+           file.getFileType() != StdFileTypes.JSPX && file.getFileType() != StdFileTypes.JSP;
+  }
+
+  public static boolean isEmbeddedContent(@NotNull final PsiFile file, final int offset) {
+    Language languageAtOffset = PsiUtilBase.getLanguageAtOffset(file, offset);
+    return !(languageAtOffset.isKindOf(XMLLanguage.INSTANCE) || languageAtOffset instanceof XMLLanguage);
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/XmlDefaultLiveTemplatesProvider.java b/xml/impl/src/com/intellij/codeInsight/template/XmlDefaultLiveTemplatesProvider.java
new file mode 100644
index 0000000..9b13138
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/XmlDefaultLiveTemplatesProvider.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template;
+
+import com.intellij.codeInsight.template.impl.DefaultLiveTemplatesProvider;
+
+/**
+ * @author yole
+ */
+public class XmlDefaultLiveTemplatesProvider implements DefaultLiveTemplatesProvider {
+  public String[] getDefaultLiveTemplateFiles() {
+    return new String[] { "/liveTemplates/html_xml", "/liveTemplates/zen_html", "/liveTemplates/zen_xsl" };
+  }
+
+  @Override
+  public String[] getHiddenLiveTemplateFiles() {
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/XslTextContextType.java b/xml/impl/src/com/intellij/codeInsight/template/XslTextContextType.java
new file mode 100644
index 0000000..7f22c59
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/XslTextContextType.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ * 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.
+ */
+package com.intellij.codeInsight.template;
+
+import com.intellij.codeInsight.CodeInsightBundle;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class XslTextContextType extends TemplateContextType {
+  protected XslTextContextType() {
+    super("XSL_TEXT", CodeInsightBundle.message("dialog.edit.template.checkbox.xsl.text"), XmlContextType.class);
+  }
+
+  @Override
+  public boolean isInContext(@NotNull PsiFile file, int offset) {
+    if (file.getFileType() == StdFileTypes.XML && FileUtil.getExtension(file.getName()).equals("xsl")) {
+      PsiElement element = file.findElementAt(offset);
+      return element == null || HtmlTextContextType.isInContext(element);
+    }
+    return false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/ZenCodingTemplate.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/ZenCodingTemplate.java
new file mode 100644
index 0000000..29bac40
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/ZenCodingTemplate.java
@@ -0,0 +1,890 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding;
+
+import com.intellij.application.options.editor.WebEditorOptions;
+import com.intellij.codeInsight.CodeInsightBundle;
+import com.intellij.codeInsight.template.*;
+import com.intellij.codeInsight.template.impl.TemplateImpl;
+import com.intellij.codeInsight.template.impl.TemplateState;
+import com.intellij.codeInsight.template.zencoding.filters.ZenCodingFilter;
+import com.intellij.codeInsight.template.zencoding.generators.XmlZenCodingGenerator;
+import com.intellij.codeInsight.template.zencoding.generators.ZenCodingGenerator;
+import com.intellij.codeInsight.template.zencoding.nodes.*;
+import com.intellij.codeInsight.template.zencoding.tokens.*;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.command.undo.UndoConstants;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.EditorModificationUtil;
+import com.intellij.openapi.editor.ScrollType;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.ui.InputValidatorEx;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.LocalTimeCounter;
+import com.intellij.xml.XmlBundle;
+import org.apache.xerces.util.XML11Char;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class ZenCodingTemplate implements CustomLiveTemplate {
+  public static final char MARKER = '\0';
+  private static final String DELIMS = ">+*|()[]{}.#,='\" \0";
+  public static final String ATTRS = "ATTRS";
+  private static final String ID = "id";
+  private static final String CLASS = "class";
+  private static final String DEFAULT_TAG = "div";
+
+  private static int parseNonNegativeInt(@NotNull String s) {
+    try {
+      return Integer.parseInt(s);
+    }
+    catch (Throwable ignored) {
+    }
+    return -1;
+  }
+
+  private static boolean isXML11ValidQName(String str) {
+    final int colon = str.indexOf(':');
+    if (colon == 0 || colon == str.length() - 1) {
+      return false;
+    }
+    if (colon > 0) {
+      final String prefix = str.substring(0, colon);
+      final String localPart = str.substring(colon + 1);
+      return XML11Char.isXML11ValidNCName(prefix) && XML11Char.isXML11ValidNCName(localPart);
+    }
+    return XML11Char.isXML11ValidNCName(str);
+  }
+
+  private static boolean isHtml(CustomTemplateCallback callback) {
+    FileType type = callback.getFileType();
+    return type == StdFileTypes.HTML || type == StdFileTypes.XHTML;
+  }
+
+  private static void addMissingAttributes(XmlTag tag, List<Pair<String, String>> value) {
+    List<Pair<String, String>> attr2value = new ArrayList<Pair<String, String>>(value);
+    for (Iterator<Pair<String, String>> iterator = attr2value.iterator(); iterator.hasNext();) {
+      Pair<String, String> pair = iterator.next();
+      if (tag.getAttribute(pair.first) != null) {
+        iterator.remove();
+      }
+    }
+    addAttributesBefore(tag, attr2value);
+  }
+
+  private static void addAttributesBefore(XmlTag tag, List<Pair<String, String>> attr2value) {
+    XmlAttribute firstAttribute = ArrayUtil.getFirstElement(tag.getAttributes());
+    XmlElementFactory factory = XmlElementFactory.getInstance(tag.getProject());
+    for (Pair<String, String> pair : attr2value) {
+      XmlAttribute xmlAttribute = factory.createXmlAttribute(pair.first, "");
+      if (firstAttribute != null) {
+        tag.addBefore(xmlAttribute, firstAttribute);
+      }
+      else {
+        tag.add(xmlAttribute);
+      }
+    }
+  }
+
+  @Nullable
+  private static ZenCodingGenerator findApplicableDefaultGenerator(@NotNull PsiElement context, boolean wrapping) {
+    for (ZenCodingGenerator generator : ZenCodingGenerator.getInstances()) {
+      if (generator.isMyContext(context, wrapping) && generator.isAppliedByDefault(context)) {
+        return generator;
+      }
+    }
+    return null;
+  }
+
+  @NotNull
+  private static XmlFile parseXmlFileInTemplate(String templateString, CustomTemplateCallback callback, boolean createPhysicalFile) {
+    XmlFile xmlFile = (XmlFile)PsiFileFactory.getInstance(callback.getProject())
+      .createFileFromText("dummy.xml", StdFileTypes.XML, templateString, LocalTimeCounter.currentTime(), createPhysicalFile);
+    VirtualFile vFile = xmlFile.getVirtualFile();
+    if (vFile != null) {
+      vFile.putUserData(UndoConstants.DONT_RECORD_UNDO, Boolean.TRUE);
+    }
+    return xmlFile;
+  }
+
+  @Nullable
+  private static ZenCodingNode parse(@NotNull String text, @NotNull CustomTemplateCallback callback, ZenCodingGenerator generator) {
+    List<ZenCodingToken> tokens = lex(text);
+    if (tokens == null) {
+      return null;
+    }
+    if (generator != null && !validate(tokens, generator)) {
+      return null;
+    }
+    MyParser parser = new MyParser(tokens, callback, generator);
+    ZenCodingNode node = parser.parse();
+    if (parser.myIndex != tokens.size() || node instanceof TextNode) {
+      return null;
+    }
+    return node;
+  }
+  
+  private static boolean validate(@NotNull List<ZenCodingToken> tokens, @NotNull ZenCodingGenerator generator) {
+    for (ZenCodingToken token : tokens) {
+      if (token instanceof TextToken && !(generator instanceof XmlZenCodingGenerator)) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  @Nullable
+  private static List<ZenCodingToken> lex(@NotNull String text) {
+    text += MARKER;
+    final List<ZenCodingToken> result = new ArrayList<ZenCodingToken>();
+
+    boolean inQuotes = false;
+    boolean inApostrophes = false;
+    int bracesStack = 0;
+
+    StringBuilder builder = new StringBuilder();
+    for (int i = 0; i < text.length(); i++) {
+      final char c = text.charAt(i);
+
+      if (inQuotes) {
+        builder.append(c);
+        if (c == '"') {
+          inQuotes = false;
+          result.add(new StringLiteralToken(builder.toString()));
+          builder = new StringBuilder();
+        }
+        continue;
+      }
+
+      if (inApostrophes) {
+        builder.append(c);
+        if (c == '\'') {
+          inApostrophes = false;
+          result.add(new StringLiteralToken(builder.toString()));
+          builder = new StringBuilder();
+        }
+        continue;
+      }
+
+      if (bracesStack > 0) {
+        builder.append(c);
+        if (c == '}') {
+          bracesStack--;
+          if (bracesStack == 0) {
+            result.add(new TextToken(builder.toString()));
+            builder = new StringBuilder();
+          }
+        }
+        else if (c == '{') {
+          bracesStack++;
+        }
+        continue;
+      }
+
+      if (DELIMS.indexOf(c) < 0) {
+        builder.append(c);
+      }
+      else {
+        // handle special case: ul+ template
+        if (c == '+' && (i == text.length() - 2 || text.charAt(i + 1) == ')')) {
+          builder.append(c);
+          continue;
+        }
+
+        if (builder.length() > 0) {
+          final String tokenText = builder.toString();
+          final int n = parseNonNegativeInt(tokenText);
+          if (n >= 0) {
+            result.add(new NumberToken(n));
+          }
+          else {
+            result.add(new IdentifierToken(tokenText));
+          }
+          builder = new StringBuilder();
+        }
+        if (c == '"') {
+          inQuotes = true;
+          builder.append(c);
+        }
+        else if (c == '\'') {
+          inApostrophes = true;
+          builder.append(c);
+        }
+        else if (c == '{') {
+          bracesStack = 1;
+          builder.append(c);
+        }
+        else if (c == '(') {
+          result.add(ZenCodingTokens.OPENING_R_BRACKET);
+        }
+        else if (c == ')') {
+          result.add(ZenCodingTokens.CLOSING_R_BRACKET);
+        }
+        else if (c == '[') {
+          result.add(ZenCodingTokens.OPENING_SQ_BRACKET);
+        }
+        else if (c == ']') {
+          result.add(ZenCodingTokens.CLOSING_SQ_BRACKET);
+        }
+        else if (c == '=') {
+          result.add(ZenCodingTokens.EQ);
+        }
+        else if (c == '.') {
+          result.add(ZenCodingTokens.DOT);
+        }
+        else if (c == '#') {
+          result.add(ZenCodingTokens.SHARP);
+        }
+        else if (c == ',') {
+          result.add(ZenCodingTokens.COMMA);
+        }
+        else if (c == ' ') {
+          result.add(ZenCodingTokens.SPACE);
+        }
+        else if (c == '|') {
+          result.add(ZenCodingTokens.PIPE);
+        }
+        else if (c != MARKER) {
+          result.add(new OperationToken(c));
+        }
+      }
+    }
+    if (bracesStack != 0 || inQuotes || inApostrophes) {
+      return null;
+    }
+    return result;
+  }
+
+
+  public static boolean checkTemplateKey(@NotNull String key, CustomTemplateCallback callback, ZenCodingGenerator generator) {
+    return parse(key, callback, generator) != null;
+  }
+
+  public void expand(String key, @NotNull CustomTemplateCallback callback) {
+    ZenCodingGenerator defaultGenerator = findApplicableDefaultGenerator(callback.getContext(), false);
+    assert defaultGenerator != null;
+    expand(key, callback, null, defaultGenerator);
+  }
+
+  @Nullable
+  private static ZenCodingGenerator findApplicableGenerator(ZenCodingNode node, PsiElement context, boolean wrapping) {
+    ZenCodingGenerator defaultGenerator = null;
+    List<ZenCodingGenerator> generators = ZenCodingGenerator.getInstances();
+    for (ZenCodingGenerator generator : generators) {
+      if (defaultGenerator == null && generator.isMyContext(context, wrapping) && generator.isAppliedByDefault(context)) {
+        defaultGenerator = generator;
+      }
+    }
+    while (node instanceof FilterNode) {
+      FilterNode filterNode = (FilterNode)node;
+      String suffix = filterNode.getFilter();
+      for (ZenCodingGenerator generator : generators) {
+        if (generator.isMyContext(context, wrapping)) {
+          if (suffix != null && suffix.equals(generator.getSuffix())) {
+            return generator;
+          }
+        }
+      }
+      node = filterNode.getNode();
+    }
+    return defaultGenerator;
+  }
+
+  private static List<ZenCodingFilter> getFilters(ZenCodingNode node, PsiElement context) {
+    List<ZenCodingFilter> result = new ArrayList<ZenCodingFilter>();
+
+    while (node instanceof FilterNode) {
+      FilterNode filterNode = (FilterNode)node;
+      String filterSuffix = filterNode.getFilter();
+      boolean filterFound = false;
+      for (ZenCodingFilter filter : ZenCodingFilter.getInstances()) {
+        if (filter.isMyContext(context) && filter.getSuffix().equals(filterSuffix)) {
+          filterFound = true;
+          result.add(filter);
+        }
+      }
+      assert filterFound;
+      node = filterNode.getNode();
+    }
+
+    for (ZenCodingFilter filter : ZenCodingFilter.getInstances()) {
+      if (filter.isMyContext(context) && filter.isAppliedByDefault(context)) {
+        result.add(filter);
+      }
+    }
+
+    Collections.reverse(result);
+    return result;
+  }
+
+
+  private static void expand(String key,
+                             @NotNull CustomTemplateCallback callback,
+                             String surroundedText,
+                             @NotNull ZenCodingGenerator defaultGenerator) {
+    ZenCodingNode node = parse(key, callback, defaultGenerator);
+    assert node != null;
+    if (surroundedText == null) {
+      if (node instanceof TemplateNode) {
+        if (key.equals(((TemplateNode)node).getTemplateToken().getKey()) &&
+            callback.findApplicableTemplates(key).size() > 1) {
+          callback.startTemplate();
+          return;
+        }
+      }
+      callback.deleteTemplateKey(key);
+    }
+
+    PsiElement context = callback.getContext();
+    ZenCodingGenerator generator = findApplicableGenerator(node, context, false);
+    List<ZenCodingFilter> filters = getFilters(node, context);
+
+    expand(node, generator, filters, surroundedText, callback);
+  }
+
+  private static void expand(ZenCodingNode node,
+                             ZenCodingGenerator generator,
+                             List<ZenCodingFilter> filters,
+                             String surroundedText,
+                             CustomTemplateCallback callback) {
+    if (surroundedText != null) {
+      surroundedText = surroundedText.trim();
+    }
+    List<GenerationNode> genNodes = node.expand(-1, surroundedText, callback, true);
+    LiveTemplateBuilder builder = new LiveTemplateBuilder();
+    int end = -1;
+    for (int i = 0, genNodesSize = genNodes.size(); i < genNodesSize; i++) {
+      GenerationNode genNode = genNodes.get(i);
+      TemplateImpl template = genNode.generate(callback, generator, filters, true);
+      int e = builder.insertTemplate(builder.length(), template, null);
+      if (end == -1 && end < builder.length()) {
+        end = e;
+      }
+    }
+
+    callback.startTemplate(builder.buildTemplate(), null, new TemplateEditingAdapter() {
+      private TextRange myEndVarRange;
+      private Editor myEditor;
+
+      @Override
+      public void beforeTemplateFinished(TemplateState state, Template template) {
+        int variableNumber = state.getCurrentVariableNumber();
+        if (variableNumber >= 0 && template instanceof TemplateImpl) {
+          TemplateImpl t = (TemplateImpl)template;
+          while (variableNumber < t.getVariableCount()) {
+            String varName = t.getVariableNameAt(variableNumber);
+            if (LiveTemplateBuilder.isEndVariable(varName)) {
+              myEndVarRange = state.getVariableRange(varName);
+              myEditor = state.getEditor();
+              break;
+            }
+            variableNumber++;
+          }
+        }
+      }
+
+      @Override
+      public void templateFinished(Template template, boolean brokenOff) {
+        if (brokenOff && myEndVarRange != null && myEditor != null) {
+          int offset = myEndVarRange.getStartOffset();
+          if (offset >= 0 && offset != myEditor.getCaretModel().getOffset()) {
+            myEditor.getCaretModel().moveToOffset(offset);
+            myEditor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
+          }
+        }
+      }
+    });
+  }
+
+  public void wrap(final String selection,
+                   @NotNull final CustomTemplateCallback callback
+  ) {
+    InputValidatorEx validator = new InputValidatorEx() {
+      public String getErrorText(String inputString) {
+        if (!checkTemplateKey(inputString, callback)) {
+          return XmlBundle.message("zen.coding.incorrect.abbreviation.error");
+        }
+        return null;
+      }
+
+      public boolean checkInput(String inputString) {
+        return getErrorText(inputString) == null;
+      }
+
+      public boolean canClose(String inputString) {
+        return checkInput(inputString);
+      }
+    };
+    final String abbreviation = Messages
+      .showInputDialog(callback.getProject(), XmlBundle.message("zen.coding.enter.abbreviation.dialog.label"),
+                       XmlBundle.message("zen.coding.title"), Messages.getQuestionIcon(), "", validator);
+    if (abbreviation != null) {
+      doWrap(selection, abbreviation, callback);
+    }
+  }
+
+  public static boolean checkTemplateKey(String inputString, CustomTemplateCallback callback) {
+    ZenCodingGenerator generator = findApplicableDefaultGenerator(callback.getContext(), true);
+    assert generator != null;
+    return checkTemplateKey(inputString, callback, generator);
+  }
+
+  public boolean isApplicable(PsiFile file, int offset, boolean wrapping) {
+    WebEditorOptions webEditorOptions = WebEditorOptions.getInstance();
+    if (!webEditorOptions.isZenCodingEnabled()) {
+      return false;
+    }
+    if (file == null) {
+      return false;
+    }
+    PsiDocumentManager.getInstance(file.getProject()).commitAllDocuments();
+    PsiElement element = CustomTemplateCallback.getContext(file, offset);
+    return findApplicableDefaultGenerator(element, wrapping) != null;
+  }
+
+  protected static void doWrap(final String selection,
+                               final String abbreviation,
+                               final CustomTemplateCallback callback) {
+    final ZenCodingGenerator defaultGenerator = findApplicableDefaultGenerator(callback.getContext(), true);
+    assert defaultGenerator != null;
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        CommandProcessor.getInstance().executeCommand(callback.getProject(), new Runnable() {
+          public void run() {
+            callback.fixInitialState(true);
+            ZenCodingNode node = parse(abbreviation, callback, defaultGenerator);
+            assert node != null;
+            PsiElement context = callback.getContext();
+            ZenCodingGenerator generator = findApplicableGenerator(node, context, true);
+            List<ZenCodingFilter> filters = getFilters(node, context);
+
+            EditorModificationUtil.deleteSelectedText(callback.getEditor());
+            PsiDocumentManager.getInstance(callback.getProject()).commitAllDocuments();
+
+            expand(node, generator, filters, selection, callback);
+          }
+        }, CodeInsightBundle.message("insert.code.template.command"), null);
+      }
+    });
+  }
+
+  @NotNull
+  public String getTitle() {
+    return XmlBundle.message("zen.coding.title");
+  }
+
+  public char getShortcut() {
+    return (char)WebEditorOptions.getInstance().getZenCodingExpandShortcut();
+  }
+
+  protected static boolean containsAttrsVar(TemplateImpl template) {
+    for (int i = 0; i < template.getVariableCount(); i++) {
+      String varName = template.getVariableNameAt(i);
+      if (ATTRS.equals(varName)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  public String computeTemplateKey(@NotNull CustomTemplateCallback callback) {
+    ZenCodingGenerator generator = findApplicableDefaultGenerator(callback.getContext(), false);
+    if (generator == null) return null;
+    return generator.computeTemplateKey(callback);
+  }
+
+  public boolean supportsWrapping() {
+    return true;
+  }
+
+  public static boolean checkFilterSuffix(@NotNull String suffix) {
+    for (ZenCodingGenerator generator : ZenCodingGenerator.getInstances()) {
+      if (suffix.equals(generator.getSuffix())) {
+        return true;
+      }
+    }
+    for (ZenCodingFilter filter : ZenCodingFilter.getInstances()) {
+      if (suffix.equals(filter.getSuffix())) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  public static boolean doSetTemplate(final TemplateToken token, TemplateImpl template, CustomTemplateCallback callback) {
+    token.setTemplate(template);
+    final XmlFile xmlFile = parseXmlFileInTemplate(template.getString(), callback, true);
+    token.setFile(xmlFile);
+    XmlDocument document = xmlFile.getDocument();
+    final XmlTag tag = document != null ? document.getRootTag() : null;
+    if (token.getAttribute2Value().size() > 0 && tag == null) {
+      return false;
+    }
+    if (tag != null) {
+      if (!containsAttrsVar(template) && token.getAttribute2Value().size() > 0) {
+        ApplicationManager.getApplication().runWriteAction(new Runnable() {
+          public void run() {
+            addMissingAttributes(tag, token.getAttribute2Value());
+          }
+        });
+      }
+    }
+    return true;
+  }
+
+  private static class MyParser {
+    private final List<ZenCodingToken> myTokens;
+    private final CustomTemplateCallback myCallback;
+    private final ZenCodingGenerator myGenerator;
+    private int myIndex = 0;
+
+    private MyParser(List<ZenCodingToken> tokens, CustomTemplateCallback callback, ZenCodingGenerator generator) {
+      myTokens = tokens;
+      myCallback = callback;
+      myGenerator = generator;
+    }
+
+    @Nullable
+    private ZenCodingNode parse() {
+      ZenCodingNode add = parseAddOrMore();
+      if (add == null) {
+        return null;
+      }
+
+      ZenCodingNode result = add;
+
+      while (true) {
+        ZenCodingToken token = nextToken();
+        if (token != ZenCodingTokens.PIPE) {
+          return result;
+        }
+
+        myIndex++;
+        token = nextToken();
+        if (!(token instanceof IdentifierToken)) {
+          return null;
+        }
+
+        final String filterSuffix = ((IdentifierToken)token).getText();
+        if (!checkFilterSuffix(filterSuffix)) {
+          return null;
+        }
+
+        myIndex++;
+        result = new FilterNode(result, filterSuffix);
+      }
+    }
+
+    @Nullable
+    private ZenCodingNode parseAddOrMore() {
+      ZenCodingNode mul = parseMul();
+      if (mul == null) {
+        return null;
+      }
+      ZenCodingToken operationToken = nextToken();
+      if (!(operationToken instanceof OperationToken)) {
+        return mul;
+      }
+      char sign = ((OperationToken)operationToken).getSign();
+      if (sign == '+') {
+        myIndex++;
+        ZenCodingNode add2 = parseAddOrMore();
+        if (add2 == null) {
+          return null;
+        }
+        return new AddOperationNode(mul, add2);
+      }
+      else if (sign == '>') {
+        myIndex++;
+        ZenCodingNode more2 = parseAddOrMore();
+        if (more2 == null) {
+          return null;
+        }
+        return new MoreOperationNode(mul, more2);
+      }
+      return null;
+    }
+
+    @Nullable
+    private ZenCodingNode parseMul() {
+      ZenCodingNode exp = parseExpressionInBraces();
+      if (exp == null) {
+        return null;
+      }
+      ZenCodingToken operationToken = nextToken();
+      if (!(operationToken instanceof OperationToken)) {
+        return exp;
+      }
+      if (((OperationToken)operationToken).getSign() != '*') {
+        return exp;
+      }
+      myIndex++;
+      ZenCodingToken numberToken = nextToken();
+      if (numberToken instanceof NumberToken) {
+        myIndex++;
+        return new MulOperationNode(exp, ((NumberToken)numberToken).getNumber());
+      }
+      return new UnaryMulOperationNode(exp);
+    }
+
+    @Nullable
+    private ZenCodingNode parseExpressionInBraces() {
+      ZenCodingToken token = nextToken();
+      if (token == ZenCodingTokens.OPENING_R_BRACKET) {
+        myIndex++;
+        ZenCodingNode add = parseAddOrMore();
+        if (add == null) {
+          return null;
+        }
+        ZenCodingToken closingBrace = nextToken();
+        if (closingBrace != ZenCodingTokens.CLOSING_R_BRACKET) {
+          return null;
+        }
+        myIndex++;
+        return add;
+      }
+      else if (token instanceof TextToken) {
+        myIndex++;
+        return new TextNode((TextToken)token);
+
+      }
+
+      final ZenCodingNode templateNode = parseTemplate();
+      if (templateNode == null) {
+        return null;
+      }
+
+      token = nextToken();
+      if (token instanceof TextToken) {
+        myIndex++;
+        return new MoreOperationNode(templateNode, new TextNode((TextToken)token));
+      }
+      return templateNode;
+    }
+
+    @Nullable
+    private ZenCodingNode parseTemplate() {
+      final ZenCodingToken token = nextToken();
+      String templateKey = isHtml(myCallback) ? DEFAULT_TAG : null;
+      boolean mustHaveSelector = true;
+
+      if (token instanceof IdentifierToken) {
+        templateKey = ((IdentifierToken)token).getText();
+        mustHaveSelector = false;
+        myIndex++;
+      }
+
+      if (templateKey == null) {
+        return null;
+      }
+
+      final TemplateImpl template = myCallback.findApplicableTemplate(templateKey);
+      if (template == null && !isXML11ValidQName(templateKey)) {
+        return null;
+      }
+
+      final List<Pair<String, String>> attrList = parseSelectors();
+      if (mustHaveSelector && attrList.size() == 0) {
+        return null;
+      }
+
+      final TemplateToken templateToken = new TemplateToken(templateKey, attrList);
+
+      if (!setTemplate(templateToken, template)) {
+        return null;
+      }
+      return new TemplateNode(templateToken);
+    }
+
+    @SuppressWarnings("unchecked")
+    @NotNull
+    private List<Pair<String, String>> parseSelectors() {
+      final List<Pair<String, String>> result = new ArrayList<Pair<String, String>>();
+
+      int classAttrPosition = -1;
+      int idAttrPosition = -1;
+
+      final StringBuilder classAttrBuilder = new StringBuilder();
+      final StringBuilder idAttrBuilder = new StringBuilder();
+
+      while (true) {
+        final List<Pair<String, String>> attrList = parseSelector();
+        if (attrList == null) {
+          if (classAttrPosition != -1) {
+            result.set(classAttrPosition, new Pair<String, String>(CLASS, classAttrBuilder.toString()));
+          }
+          if (idAttrPosition != -1) {
+            result.set(idAttrPosition, new Pair<String, String>(ID, idAttrBuilder.toString()));
+          }
+          return result;
+        }
+
+        for (Pair<String, String> attr : attrList) {
+          if (CLASS.equals(attr.first)) {
+            if (classAttrBuilder.length() > 0) {
+              classAttrBuilder.append(' ');
+            }
+            classAttrBuilder.append(attr.second);
+            if (classAttrPosition == -1) {
+              classAttrPosition = result.size();
+              result.add(attr);
+            }
+          }
+          else if (ID.equals(attr.first)) {
+            if (idAttrBuilder.length() > 0) {
+              idAttrBuilder.append(' ');
+            }
+            idAttrBuilder.append(attr.second);
+            if (idAttrPosition == -1) {
+              idAttrPosition = result.size();
+              result.add(attr);
+            }
+          }
+          else {
+            result.add(attr);
+          }
+        }
+      }
+    }
+
+    @Nullable
+    private List<Pair<String, String>> parseSelector() {
+      ZenCodingToken token = nextToken();
+      if (token == ZenCodingTokens.OPENING_SQ_BRACKET) {
+        myIndex++;
+        final List<Pair<String, String>> attrList = parseAttributeList();
+        if (attrList == null || nextToken() != ZenCodingTokens.CLOSING_SQ_BRACKET) {
+          return null;
+        }
+        myIndex++;
+        return attrList;
+      }
+
+      if (token == ZenCodingTokens.DOT || token == ZenCodingTokens.SHARP) {
+        final String name = token == ZenCodingTokens.DOT ? CLASS : ID;
+        myIndex++;
+        token = nextToken();
+        final String value = getAttributeValueByToken(token);
+        myIndex++;
+        return value != null ? Collections.singletonList(new Pair<String, String>(name, value)) : null;
+      }
+
+      return null;
+    }
+
+    private boolean setTemplate(final TemplateToken token, TemplateImpl template) {
+      if (template == null) {
+        template = myGenerator.createTemplateByKey(token.getKey());
+      }
+      if (template == null) {
+        return false;
+      }
+      return doSetTemplate(token, template, myCallback);
+    }
+
+    @Nullable
+    private List<Pair<String, String>> parseAttributeList() {
+      final List<Pair<String, String>> result = new ArrayList<Pair<String, String>>();
+      while (true) {
+        final Pair<String, String> attribute = parseAttribute();
+        if (attribute == null) {
+          return result;
+        }
+        result.add(attribute);
+
+        final ZenCodingToken token = nextToken();
+        if (token != ZenCodingTokens.COMMA && token != ZenCodingTokens.SPACE) {
+          return result;
+        }
+        myIndex++;
+      }
+    }
+
+    @Nullable
+    private Pair<String, String> parseAttribute() {
+      ZenCodingToken token = nextToken();
+      if (!(token instanceof IdentifierToken)) {
+        return null;
+      }
+
+      final String name = ((IdentifierToken)token).getText();
+
+      myIndex++;
+      token = nextToken();
+      if (token != ZenCodingTokens.EQ) {
+        return new Pair<String, String>(name, "");
+      }
+
+      myIndex++;
+      final StringBuilder attrValueBuilder = new StringBuilder();
+      String value;
+      do {
+        token = nextToken();
+        value = token != null && token == ZenCodingTokens.SHARP ? token.toString() : getAttributeValueByToken(token);
+        if (value != null) {
+          attrValueBuilder.append(value);
+          myIndex++;
+        }
+      }
+      while (value != null);
+      return new Pair<String, String>(name, attrValueBuilder.toString());
+    }
+
+    @Nullable
+    private static String getAttributeValueByToken(ZenCodingToken token) {
+      if (token instanceof StringLiteralToken) {
+        final String text = ((StringLiteralToken)token).getText();
+        return text.substring(1, text.length() - 1);
+      }
+      else if (token instanceof IdentifierToken) {
+        return ((IdentifierToken)token).getText();
+      }
+      else if (token instanceof NumberToken) {
+        return Integer.toString(((NumberToken)token).getNumber());
+      }
+      return null;
+    }
+
+    @Nullable
+    private ZenCodingToken nextToken() {
+      if (myIndex < myTokens.size()) {
+        return myTokens.get(myIndex);
+      }
+      return null;
+    }
+
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/ZenCodingUtil.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/ZenCodingUtil.java
new file mode 100644
index 0000000..a72a2ed
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/ZenCodingUtil.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class ZenCodingUtil {
+  private static final char NUMBER_IN_ITERATION_PLACE_HOLDER = '$';
+  private static final String SURROUNDED_TEXT_MARKER = "$#";
+
+  private ZenCodingUtil() {
+  }
+
+  public static boolean containsSurroundedTextMarker(@NotNull String s) {
+    return s.contains(SURROUNDED_TEXT_MARKER);
+  }
+
+  public static String replaceMarkers(String s, int numberInIteration, @Nullable String surroundedText) {
+    final String by = Integer.toString(numberInIteration + 1);
+    StringBuilder builder = new StringBuilder(s.length());
+    int j = -1;
+    int i = 0;
+    int n = s.length();
+    while (i <= n) {
+      char c = i < n ? s.charAt(i) : 0;
+      if (c == NUMBER_IN_ITERATION_PLACE_HOLDER && (i == n - 1 || s.charAt(i + 1) != '#')) {
+        if (j == -1) {
+          j = i;
+        }
+      }
+      else {
+        if (j != -1) {
+          for (int k = 0, m = i - j - by.length(); k < m; k++) {
+            builder.append('0');
+          }
+          builder.append(by);
+          j = -1;
+        }
+        if (i < n) {
+          if (c == NUMBER_IN_ITERATION_PLACE_HOLDER && surroundedText != null) {
+            builder.append(surroundedText);
+            i++;
+          }
+          else {
+            builder.append(c);
+          }
+        }
+      }
+      i++;
+    }
+    return builder.toString();
+  }
+
+  public static String getValue(String value, int numberInIteration, String surroundedText) {
+    String s = replaceMarkers(value, numberInIteration, surroundedText);
+    return s.replace("\"", "&quot;");
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/CommentZenCodingFilter.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/CommentZenCodingFilter.java
new file mode 100644
index 0000000..612487f
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/CommentZenCodingFilter.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.filters;
+
+import com.intellij.codeInsight.template.zencoding.tokens.TemplateToken;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class CommentZenCodingFilter extends ZenCodingFilter {
+  private static String buildCommentString(@Nullable String classAttr, @Nullable String idAttr) {
+    StringBuilder builder = new StringBuilder();
+    if (idAttr != null) {
+      builder.append('#').append(idAttr);
+    }
+    if (classAttr != null) {
+      builder.append('.').append(classAttr);
+    }
+    return builder.toString();
+  }
+
+  @NotNull
+  @Override
+  public String filterText(@NotNull String text, @NotNull TemplateToken token) {
+    XmlDocument document = token.getFile().getDocument();
+    if (document != null) {
+      XmlTag tag = document.getRootTag();
+      if (tag != null) {
+        String classAttr = tag.getAttributeValue("class");
+        String idAttr = tag.getAttributeValue("id");
+        if (classAttr != null || idAttr != null) {
+          String commentString = buildCommentString(classAttr, idAttr);
+          return "<!-- " + commentString + " -->\n" + text + "\n<!-- /" + commentString + " -->";
+        }
+      }
+    }
+    return text;
+  }
+
+  @NotNull
+  @Override
+  public String getSuffix() {
+    return "c";
+  }
+
+  @Override
+  public boolean isMyContext(@NotNull PsiElement context) {
+    return context.getLanguage() instanceof XMLLanguage;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/EscapeZenCodingFilter.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/EscapeZenCodingFilter.java
new file mode 100644
index 0000000..8c3abe8
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/EscapeZenCodingFilter.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.filters;
+
+import com.intellij.codeInsight.template.zencoding.tokens.TemplateToken;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class EscapeZenCodingFilter extends ZenCodingFilter {
+  @NotNull
+  @Override
+  public String filterText(@NotNull String s, @NotNull TemplateToken token) {
+    s = s.replace("&", "&amp;");
+    s = s.replace("<", "&lt;");
+    s = s.replace(">", "&gt;");
+    return s;
+  }
+
+  @NotNull
+  @Override
+  public String getSuffix() {
+    return "e";
+  }
+
+  @Override
+  public boolean isMyContext(@NotNull PsiElement context) {
+    return context.getLanguage() instanceof XMLLanguage;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/TrimZenCodingFilter.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/TrimZenCodingFilter.java
new file mode 100644
index 0000000..f6c26f1
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/TrimZenCodingFilter.java
@@ -0,0 +1,43 @@
+package com.intellij.codeInsight.template.zencoding.filters;
+
+import com.intellij.codeInsight.template.zencoding.nodes.GenerationNode;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.regex.Pattern;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class TrimZenCodingFilter extends ZenCodingFilter {
+  private static final Pattern PATTERN = Pattern.compile("^([\\s|\u00a0])?[\\d|#|\\-|\\*|\u2022]+\\.?\\s*");
+
+  @NotNull
+  @Override
+  public String getSuffix() {
+    return "t";
+  }
+
+  @Override
+  public boolean isMyContext(@NotNull PsiElement context) {
+    return context.getLanguage() instanceof XMLLanguage;
+  }
+
+  @NotNull
+  @Override
+  public GenerationNode filterNode(@NotNull GenerationNode node) {
+    doFilter(node);
+    return node;
+  }
+
+  private static void doFilter(GenerationNode node) {
+    final String surroundedText = node.getSurroundedText();
+    if (surroundedText != null) {
+      node.setSurroundedText(PATTERN.matcher(surroundedText).replaceAll(""));
+    }
+    for (GenerationNode child : node.getChildren()) {
+      doFilter(child);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/XslZenCodingFilter.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/XslZenCodingFilter.java
new file mode 100644
index 0000000..3a05ca2
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/XslZenCodingFilter.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.filters;
+
+import com.intellij.codeInsight.template.zencoding.generators.XmlZenCodingGenerator;
+import com.intellij.codeInsight.template.zencoding.generators.XmlZenCodingGeneratorImpl;
+import com.intellij.codeInsight.template.zencoding.nodes.GenerationNode;
+import com.intellij.codeInsight.template.zencoding.tokens.TemplateToken;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class XslZenCodingFilter extends ZenCodingFilter {
+  private final XmlZenCodingGenerator myDelegate = new XmlZenCodingGeneratorImpl();
+  @NonNls private static final String SELECT_ATTR_NAME = "select";
+
+  @NotNull
+  @Override
+  public GenerationNode filterNode(@NotNull final GenerationNode node) {
+    TemplateToken token = node.getTemplateToken();
+    if (token != null) {
+      TemplateToken xmlToken = token;
+      XmlDocument document = xmlToken.getFile().getDocument();
+      if (document != null) {
+        final XmlTag tag = document.getRootTag();
+        if (tag != null) {
+          for (Pair<String, String> pair : xmlToken.getAttribute2Value()) {
+            if (SELECT_ATTR_NAME.equals(pair.first)) {
+              return node;
+            }
+          }
+          ApplicationManager.getApplication().runWriteAction(new Runnable() {
+            @Override
+            public void run() {
+              if (isOurTag(tag, node.getChildren().size() > 0)) {
+                XmlAttribute attribute = tag.getAttribute(SELECT_ATTR_NAME);
+                if (attribute != null) {
+                  attribute.delete();
+                }
+              }
+            }
+          });
+          return node;
+        }
+      }
+    }
+    return node;
+  }
+
+  private static boolean isOurTag(XmlTag tag, boolean hasChildren) {
+    if (hasChildren) {
+      String name = tag.getLocalName();
+      return name.equals("with-param") || name.equals("variable");
+    }
+    return false;
+  }
+
+  @Override
+  public boolean isMyContext(@NotNull PsiElement context) {
+    return myDelegate.isMyContext(context, true) ||
+           myDelegate.isMyContext(context, false);
+  }
+
+  @NotNull
+  @Override
+  public String getSuffix() {
+    return "xsl";
+  }
+
+  @Override
+  public boolean isAppliedByDefault(@NotNull PsiElement context) {
+    VirtualFile vFile = context.getContainingFile().getVirtualFile();
+    return vFile != null && "xsl".equals(vFile.getExtension());
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/ZenCodingFilter.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/ZenCodingFilter.java
new file mode 100644
index 0000000..5ab6ada
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/filters/ZenCodingFilter.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.filters;
+
+import com.intellij.codeInsight.template.zencoding.nodes.GenerationNode;
+import com.intellij.codeInsight.template.zencoding.tokens.TemplateToken;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public abstract class ZenCodingFilter {
+  public static final ExtensionPointName<ZenCodingFilter> EP_NAME =
+    new ExtensionPointName<ZenCodingFilter>("com.intellij.xml.zenCodingFilter");
+
+  private static final ZenCodingFilter[] ourStandartFilters = new ZenCodingFilter[]{
+    new XslZenCodingFilter(),
+    new CommentZenCodingFilter(),
+    new EscapeZenCodingFilter(),
+    new TrimZenCodingFilter()
+  };
+
+  @NotNull
+  public String filterText(@NotNull String text, @NotNull TemplateToken token) {
+    return text;
+  }
+
+  @NotNull
+  public GenerationNode filterNode(@NotNull GenerationNode node) {
+    return node;
+  }
+
+  @NotNull
+  public abstract String getSuffix();
+
+  public abstract boolean isMyContext(@NotNull PsiElement context);
+
+  public boolean isAppliedByDefault(@NotNull PsiElement context) {
+    return false;
+  }
+
+  public static List<ZenCodingFilter> getInstances() {
+    List<ZenCodingFilter> generators = new ArrayList<ZenCodingFilter>();
+    Collections.addAll(generators, ourStandartFilters);
+    Collections.addAll(generators, EP_NAME.getExtensions());
+    return generators;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/generators/XmlZenCodingGenerator.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/generators/XmlZenCodingGenerator.java
new file mode 100644
index 0000000..07f22e5
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/generators/XmlZenCodingGenerator.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.generators;
+
+import com.intellij.codeInsight.template.impl.TemplateImpl;
+import com.intellij.codeInsight.template.zencoding.tokens.TemplateToken;
+import com.intellij.openapi.util.Pair;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.util.HtmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public abstract class XmlZenCodingGenerator extends ZenCodingGenerator {
+  @Override
+  public TemplateImpl generateTemplate(@NotNull TemplateToken token, boolean hasChildren, @NotNull PsiElement context) {
+    String s = toString(token, hasChildren, context);
+    TemplateImpl template = token.getTemplate().copy();
+    template.setString(s);
+    return template;
+  }
+
+  @Override
+  public TemplateImpl createTemplateByKey(@NotNull String key) {
+    StringBuilder builder = new StringBuilder("<");
+    builder.append(key).append('>');
+    if (!HtmlUtil.isSingleHtmlTag(key)) {
+      builder.append("$END$</").append(key).append('>');
+    }
+    return new TemplateImpl("", builder.toString(), "");
+  }
+
+  @NotNull
+  private String toString(@NotNull TemplateToken token, boolean hasChildren, @NotNull PsiElement context) {
+    XmlFile file = token.getFile();
+    XmlDocument document = file.getDocument();
+    if (document != null) {
+      XmlTag tag = document.getRootTag();
+      if (tag != null) {
+        return toString(tag, token.getAttribute2Value(), hasChildren, context);
+      }
+    }
+    return file.getText();
+  }
+
+  public abstract String toString(@NotNull XmlTag tag,
+                                  @NotNull List<Pair<String, String>> attribute2Value,
+                                  boolean hasChildren,
+                                  @NotNull PsiElement context);
+
+  @NotNull
+  public abstract String buildAttributesString(@NotNull List<Pair<String, String>> attribute2value,
+                                               boolean hasChildren,
+                                               int numberInIteration,
+                                               @Nullable String surroundedText);
+
+  public abstract boolean isMyContext(@NotNull PsiElement context, boolean wrapping);
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/generators/XmlZenCodingGeneratorImpl.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/generators/XmlZenCodingGeneratorImpl.java
new file mode 100644
index 0000000..b9ee262
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/generators/XmlZenCodingGeneratorImpl.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.generators;
+
+import com.intellij.codeInsight.template.HtmlTextContextType;
+import com.intellij.codeInsight.template.zencoding.ZenCodingUtil;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.Language;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.fileEditor.FileDocumentManager;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class XmlZenCodingGeneratorImpl extends XmlZenCodingGenerator {
+  public static final XmlZenCodingGeneratorImpl INSTANCE = new XmlZenCodingGeneratorImpl();
+
+  private static boolean isTrueXml(FileType type) {
+    return type == StdFileTypes.XHTML || type == StdFileTypes.JSPX || type == StdFileTypes.XML;
+  }
+
+  @NotNull
+  public String toString(@NotNull XmlTag tag,
+                         @NotNull List<Pair<String, String>> attribute2Value,
+                         boolean hasChildren,
+                         @NotNull PsiElement context) {
+    FileType fileType = context.getContainingFile().getFileType();
+    if (isTrueXml(fileType)) {
+      closeUnclosingTags(tag);
+    }
+    return tag.getContainingFile().getText();
+  }
+
+  @NotNull
+  public String buildAttributesString(@NotNull List<Pair<String, String>> attribute2value,
+                                      boolean hasChildren,
+                                      int numberInIteration,
+                                      @Nullable String surroundedText) {
+    StringBuilder result = new StringBuilder();
+    for (Iterator<Pair<String, String>> it = attribute2value.iterator(); it.hasNext();) {
+      Pair<String, String> pair = it.next();
+      String name = pair.first;
+      String value = ZenCodingUtil.getValue(pair.second, numberInIteration, surroundedText);
+      result.append(getAttributeString(name, value));
+      if (it.hasNext()) {
+        result.append(' ');
+      }
+    }
+    return result.toString();
+  }
+
+  public boolean isMyContext(@NotNull PsiElement context, boolean wrapping) {
+    return isMyLanguage(context.getLanguage()) && (wrapping || HtmlTextContextType.isInContext(context));
+  }
+
+  protected boolean isMyLanguage(Language language) {
+    return language instanceof XMLLanguage;
+  }
+
+  public String getSuffix() {
+    return "html";
+  }
+
+  public boolean isAppliedByDefault(@NotNull PsiElement context) {
+    return true;
+  }
+
+  private static String getAttributeString(String name, String value) {
+    return name + "=\"" + value + '"';
+  }
+
+  @SuppressWarnings({"ConstantConditions"})
+  private static void closeUnclosingTags(@NotNull XmlTag root) {
+    final List<SmartPsiElementPointer<XmlTag>> tagToClose = new ArrayList<SmartPsiElementPointer<XmlTag>>();
+    Project project = root.getProject();
+    final SmartPointerManager pointerManager = SmartPointerManager.getInstance(project);
+    root.accept(new XmlRecursiveElementVisitor() {
+      @Override
+      public void visitXmlTag(final XmlTag tag) {
+        if (!isTagClosed(tag)) {
+          tagToClose.add(pointerManager.createLazyPointer(tag));
+        }
+      }
+    });
+    PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
+    for (final SmartPsiElementPointer<XmlTag> pointer : tagToClose) {
+      final XmlTag tag = pointer.getElement();
+      if (tag != null) {
+        final ASTNode child = XmlChildRole.START_TAG_END_FINDER.findChild(tag.getNode());
+        if (child != null) {
+          final int offset = child.getTextRange().getStartOffset();
+          VirtualFile file = tag.getContainingFile().getVirtualFile();
+          if (file != null) {
+            final Document document = FileDocumentManager.getInstance().getDocument(file);
+            documentManager.doPostponedOperationsAndUnblockDocument(document);
+            ApplicationManager.getApplication().runWriteAction(new Runnable() {
+              public void run() {
+                document.replaceString(offset, tag.getTextRange().getEndOffset(), "/>");
+              }
+            });
+          }
+        }
+      }
+    }
+    documentManager.commitAllDocuments();
+  }
+
+  private static boolean isTagClosed(@NotNull XmlTag tag) {
+    ASTNode node = tag.getNode();
+    assert node != null;
+    final ASTNode emptyTagEnd = XmlChildRole.EMPTY_TAG_END_FINDER.findChild(node);
+    final ASTNode endTagEnd = XmlChildRole.CLOSING_TAG_START_FINDER.findChild(node);
+    return emptyTagEnd != null || endTagEnd != null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/generators/ZenCodingGenerator.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/generators/ZenCodingGenerator.java
new file mode 100644
index 0000000..abd3926
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/generators/ZenCodingGenerator.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.generators;
+
+import com.intellij.codeInsight.template.CustomTemplateCallback;
+import com.intellij.codeInsight.template.impl.TemplateImpl;
+import com.intellij.codeInsight.template.zencoding.ZenCodingTemplate;
+import com.intellij.codeInsight.template.zencoding.tokens.TemplateToken;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiErrorElement;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.impl.source.tree.LeafPsiElement;
+import com.intellij.psi.xml.XmlTokenType;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public abstract class ZenCodingGenerator {
+  private static final ExtensionPointName<ZenCodingGenerator> EP_NAME =
+    new ExtensionPointName<ZenCodingGenerator>("com.intellij.xml.zenCodingGenerator");
+
+  public abstract TemplateImpl generateTemplate(@NotNull TemplateToken token, boolean hasChildren, @NotNull PsiElement context);
+
+  @Nullable
+  public TemplateImpl createTemplateByKey(@NotNull String key) {
+    return null;
+  }
+
+  public abstract boolean isMyContext(@NotNull PsiElement context, boolean wrapping);
+
+  @Nullable
+  public String getSuffix() {
+    return null;
+  }
+
+  public abstract boolean isAppliedByDefault(@NotNull PsiElement context);
+
+  public static List<ZenCodingGenerator> getInstances() {
+    List<ZenCodingGenerator> generators = new ArrayList<ZenCodingGenerator>();
+    Collections.addAll(generators, XmlZenCodingGeneratorImpl.INSTANCE);
+    Collections.addAll(generators, EP_NAME.getExtensions());
+    return generators;
+  }
+
+  @Nullable
+  public String computeTemplateKey(@NotNull CustomTemplateCallback callback) {
+    Editor editor = callback.getEditor();
+    PsiElement element = callback.getContext();
+    int line = editor.getCaretModel().getLogicalPosition().line;
+    int lineStart = editor.getDocument().getLineStartOffset(line);
+    int elementStart = -1;
+    do {
+      PsiElement e = element;
+      while ((e instanceof LeafPsiElement && ((LeafPsiElement)e).getElementType() == XmlTokenType.XML_DATA_CHARACTERS) ||
+             e instanceof PsiWhiteSpace || e instanceof PsiErrorElement) {
+        elementStart = e.getTextRange().getStartOffset();
+        e = e.getPrevSibling();
+      }
+      if (elementStart >= 0) {
+        int startOffset = elementStart > lineStart ? elementStart : lineStart;
+        String key = computeKey(editor, startOffset);
+        if (key != null) {
+          while (key.length() > 0 && !ZenCodingTemplate.checkTemplateKey(key, callback, this)) {
+            key = key.substring(1);
+          }
+          if (key.length() > 0) {
+            return key;
+          }
+        }
+      }
+      element = element.getParent();
+    }
+    while (element != null && elementStart > lineStart);
+    return null;
+  }
+
+  @Nullable
+  protected static String computeKey(Editor editor, int startOffset) {
+    int offset = editor.getCaretModel().getOffset();
+    String s = editor.getDocument().getCharsSequence().subSequence(startOffset, offset).toString();
+    int index = 0;
+    while (index < s.length() && Character.isWhitespace(s.charAt(index))) {
+      index++;
+    }
+    String key = s.substring(index);
+    int lastWhitespaceIndex = -1;
+    int lastQuoteIndex = -1;
+    int lastApostropheIndex = -1;
+    boolean inBrackets = false;
+    int bracesStack = 0;
+
+    for (int i = 0; i < key.length(); i++) {
+      char c = key.charAt(i);
+      if (lastQuoteIndex >= 0 || lastApostropheIndex >= 0) {
+        if (c == '"') {
+          lastQuoteIndex = -1;
+        }
+        else if (c == '\'') lastApostropheIndex = -1;
+      }
+      else if (Character.isWhitespace(c)) {
+        lastWhitespaceIndex = i;
+      }
+      else if (c == '"') {
+        lastQuoteIndex = i;
+      }
+      else if (c == '\'') {
+        lastApostropheIndex = i;
+      }
+      else if (c == '[') {
+        inBrackets = true;
+      }
+      else if (c == ']' && inBrackets) {
+        lastWhitespaceIndex = -1;
+        inBrackets = false;
+      }
+      else if (c == '{') {
+        bracesStack++;
+      }
+      else if (c == '}' && bracesStack > 0) {
+        bracesStack--;
+        if (bracesStack == 0) {
+          lastWhitespaceIndex = -1;
+        }
+      }
+    }
+    if (lastQuoteIndex >= 0 || lastApostropheIndex >= 0) {
+      int max = Math.max(lastQuoteIndex, lastApostropheIndex);
+      return max < key.length() - 1 ? key.substring(max) : null;
+    }
+    if (lastWhitespaceIndex >= 0 && lastWhitespaceIndex < key.length() - 1) {
+      return key.substring(lastWhitespaceIndex + 1);
+    }
+    return key;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/AddOperationNode.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/AddOperationNode.java
new file mode 100644
index 0000000..1894ae7
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/AddOperationNode.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.nodes;
+
+import com.intellij.codeInsight.template.CustomTemplateCallback;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class AddOperationNode extends ZenCodingNode {
+  private final ZenCodingNode myLeftOperand;
+  private final ZenCodingNode myRightOperand;
+
+  public AddOperationNode(ZenCodingNode leftOperand, ZenCodingNode rightOperand) {
+    myLeftOperand = leftOperand;
+    myRightOperand = rightOperand;
+  }
+
+  public ZenCodingNode getLeftOperand() {
+    return myLeftOperand;
+  }
+
+  public ZenCodingNode getRightOperand() {
+    return myRightOperand;
+  }
+
+  @NotNull
+  @Override
+  public List<GenerationNode> expand(int numberInIteration,
+                                     String surroundedText,
+                                     CustomTemplateCallback callback,
+                                     boolean insertSurroundedTextAtTheEnd) {
+    List<GenerationNode> result = new ArrayList<GenerationNode>();
+    List<GenerationNode> leftNodes = myLeftOperand.expand(numberInIteration, surroundedText, callback, false);
+    result.addAll(leftNodes);
+    result.addAll(myRightOperand.expand(numberInIteration, surroundedText, callback, insertSurroundedTextAtTheEnd));
+    return result;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/FilterNode.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/FilterNode.java
new file mode 100644
index 0000000..7ff67f1
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/FilterNode.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.nodes;
+
+import com.intellij.codeInsight.template.CustomTemplateCallback;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class FilterNode extends ZenCodingNode {
+  private final ZenCodingNode myNode;
+  private final String myFilter;
+
+  public FilterNode(ZenCodingNode node, String filter) {
+    myNode = node;
+    myFilter = filter;
+  }
+
+  public ZenCodingNode getNode() {
+    return myNode;
+  }
+
+  public String getFilter() {
+    return myFilter;
+  }
+
+  @NotNull
+  @Override
+  public List<GenerationNode> expand(int numberInIteration,
+                                     String surroundedText,
+                                     CustomTemplateCallback callback,
+                                     boolean insertSurroundedTextAtTheEnd) {
+    return myNode.expand(numberInIteration, surroundedText, callback, insertSurroundedTextAtTheEnd);
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/GenerationNode.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/GenerationNode.java
new file mode 100644
index 0000000..a07b521
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/GenerationNode.java
@@ -0,0 +1,401 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.nodes;
+
+import com.intellij.codeInsight.template.CustomTemplateCallback;
+import com.intellij.codeInsight.template.LiveTemplateBuilder;
+import com.intellij.codeInsight.template.impl.TemplateImpl;
+import com.intellij.codeInsight.template.zencoding.ZenCodingTemplate;
+import com.intellij.codeInsight.template.zencoding.ZenCodingUtil;
+import com.intellij.codeInsight.template.zencoding.generators.XmlZenCodingGenerator;
+import com.intellij.codeInsight.template.zencoding.generators.XmlZenCodingGeneratorImpl;
+import com.intellij.codeInsight.template.zencoding.filters.ZenCodingFilter;
+import com.intellij.codeInsight.template.zencoding.generators.ZenCodingGenerator;
+import com.intellij.codeInsight.template.zencoding.tokens.TemplateToken;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Pair;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiFileFactory;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.LocalTimeCounter;
+import com.intellij.util.containers.HashMap;
+import com.intellij.util.containers.HashSet;
+import com.intellij.util.containers.IntArrayList;
+import com.intellij.xml.util.HtmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class GenerationNode {
+  private final TemplateToken myTemplateToken;
+  private final List<GenerationNode> myChildren;
+  private final int myNumberInIteration;
+  private String mySurroundedText;
+  private final boolean myInsertSurroundedTextAtTheEnd;
+
+  private boolean myContainsSurroundedTextMarker = false;
+
+  public GenerationNode(TemplateToken templateToken,
+                        List<GenerationNode> children,
+                        int numberInIteration,
+                        String surroundedText,
+                        boolean insertSurroundedTextAtTheEnd) {
+    myTemplateToken = templateToken;
+    myChildren = children;
+    myNumberInIteration = numberInIteration;
+    mySurroundedText = surroundedText;
+    myInsertSurroundedTextAtTheEnd = insertSurroundedTextAtTheEnd;
+  }
+
+  public List<GenerationNode> getChildren() {
+    return myChildren;
+  }
+
+  public void addChildren(Collection<GenerationNode> child) {
+    myChildren.addAll(child);
+  }
+
+  public boolean isLeaf() {
+    return myChildren.size() == 0;
+  }
+
+  private boolean isBlockTag() {
+    if (myTemplateToken != null) {
+      XmlFile xmlFile = myTemplateToken.getFile();
+      XmlDocument document = xmlFile.getDocument();
+      if (document != null) {
+        XmlTag tag = document.getRootTag();
+        if (tag != null) {
+          return HtmlUtil.isHtmlBlockTagL(tag.getName());
+        }
+      }
+    }
+    return false;
+  }
+
+  @NotNull
+  public TemplateImpl generate(@NotNull CustomTemplateCallback callback,
+                                @Nullable ZenCodingGenerator generator,
+                                @NotNull Collection<ZenCodingFilter> filters,
+                                boolean insertSurroundedText) {
+    myContainsSurroundedTextMarker = !(insertSurroundedText && myInsertSurroundedTextAtTheEnd);
+
+    GenerationNode generationNode = this;
+    for (ZenCodingFilter filter : filters) {
+      generationNode = filter.filterNode(generationNode);
+    }
+
+    if (generationNode != this) {
+      return generationNode.generate(callback, generator, Collections.<ZenCodingFilter>emptyList(), insertSurroundedText);
+    }
+
+    LiveTemplateBuilder builder = new LiveTemplateBuilder();
+    int end = -1;
+
+    boolean hasChildren = myChildren.size() > 0;
+
+    TemplateImpl parentTemplate;
+    Map<String, String> predefinedValues;
+    if (myTemplateToken instanceof TemplateToken && generator instanceof XmlZenCodingGenerator) {
+      TemplateToken xmlTemplateToken = myTemplateToken;
+      List<Pair<String, String>> attr2value = new ArrayList<Pair<String, String>>(xmlTemplateToken.getAttribute2Value());
+      parentTemplate = invokeXmlTemplate(xmlTemplateToken, callback, generator, hasChildren, attr2value);
+      predefinedValues =
+        buildPredefinedValues(attr2value, (XmlZenCodingGenerator)generator, hasChildren);
+    }
+    else {
+      parentTemplate = invokeTemplate(myTemplateToken, hasChildren, callback, generator);
+      predefinedValues = null;
+    }
+
+    String s = parentTemplate.getString();
+    for (ZenCodingFilter filter : filters) {
+      s = filter.filterText(s, myTemplateToken);
+    }
+    parentTemplate = parentTemplate.copy();
+    parentTemplate.setString(s);
+
+    final String txt = hasChildren || myContainsSurroundedTextMarker ? null : mySurroundedText;
+    parentTemplate = expandTemplate(parentTemplate, predefinedValues, txt);
+
+    int offset = builder.insertTemplate(0, parentTemplate, null);
+    int newOffset = gotoChild(callback.getProject(), builder.getText(), offset, 0, builder.length());
+    if (offset < builder.length() && newOffset != offset) {
+      end = offset;
+    }
+    offset = newOffset;
+    if (end == -1 && offset < builder.length() && myChildren.size() == 0) {
+      end = offset;
+    }
+    LiveTemplateBuilder.Marker marker = offset < builder.length() ? builder.createMarker(offset) : null;
+
+    CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(callback.getProject());
+    String tabStr;
+    if (callback.isInInjectedFragment()) {
+      tabStr = "";
+    }
+    else if (settings.useTabCharacter(callback.getFileType())) {
+      tabStr = "\t";
+    }
+    else {
+      StringBuilder tab = new StringBuilder();
+      int tabSize = settings.getTabSize(callback.getFileType());
+      while (tabSize-- > 0) {
+        tab.append(' ');
+      }
+      tabStr = tab.toString();
+    }
+
+    for (int i = 0, myChildrenSize = myChildren.size(); i < myChildrenSize; i++) {
+      GenerationNode child = myChildren.get(i);
+      TemplateImpl childTemplate = child.generate(callback, generator, filters, !myContainsSurroundedTextMarker);
+
+      boolean blockTag = child.isBlockTag();
+
+      if (blockTag && !isNewLineBefore(builder.getText(), offset)) {
+        builder.insertText(offset, "\n" + tabStr, false);
+        offset += tabStr.length() + 1;
+      }
+
+      int e = builder.insertTemplate(offset, childTemplate, null);
+      offset = marker != null ? marker.getEndOffset() : builder.length();
+
+      if (blockTag && !isNewLineAfter(builder.getText(), offset)) {
+        builder.insertText(offset, "\n" + tabStr, false);
+        offset += tabStr.length() + 1;
+      }
+
+      if (end == -1 && e < offset) {
+        end = e;
+      }
+    }
+    /*if (end != -1) {
+      builder.insertVariableSegment(end, TemplateImpl.END);
+    }*/
+    return builder.buildTemplate();
+  }
+
+  private static TemplateImpl invokeTemplate(TemplateToken token,
+                                             boolean hasChildren,
+                                             final CustomTemplateCallback callback,
+                                             @Nullable ZenCodingGenerator generator) {
+    TemplateImpl template = token.getTemplate();
+    if (generator != null) {
+      assert template != null;
+      template = generator.generateTemplate(token, hasChildren, callback.getContext());
+      removeVariablesWhichHasNoSegment(template);
+    }
+
+    return template;
+  }
+
+  private TemplateImpl invokeXmlTemplate(final TemplateToken token,
+                                                CustomTemplateCallback callback,
+                                                @Nullable ZenCodingGenerator generator,
+                                                final boolean hasChildren,
+                                                final List<Pair<String, String>> attr2value) {
+    /*assert generator == null || generator instanceof XmlZenCodingGenerator :
+      "The generator cannot process TemplateToken because it doesn't inherit XmlZenCodingGenerator";*/
+
+    TemplateImpl template = token.getTemplate();
+    assert template != null;
+
+    final XmlFile xmlFile = token.getFile();
+    XmlDocument document = xmlFile.getDocument();
+    if (document != null) {
+      final XmlTag tag = document.getRootTag();
+      if (tag != null) {
+        ApplicationManager.getApplication().runWriteAction(new Runnable() {
+          public void run() {
+            XmlTag tag1 = hasChildren ? expandEmptyTagIfNeccessary(tag) : tag;
+            setAttributeValues(tag1, attr2value);
+            token.setFile((XmlFile)tag1.getContainingFile());
+          }
+        });
+      }
+    }
+    template =
+      (generator != null ? generator : XmlZenCodingGeneratorImpl.INSTANCE).generateTemplate(token, hasChildren, callback.getContext());
+    removeVariablesWhichHasNoSegment(template);
+    return template;
+  }
+
+  @NotNull
+  private static TemplateImpl expandTemplate(@NotNull TemplateImpl template,
+                                             Map<String, String> predefinedVarValues,
+                                             String surroundedText) {
+    LiveTemplateBuilder builder = new LiveTemplateBuilder();
+    if (predefinedVarValues == null && surroundedText == null) {
+      return template;
+    }
+    int offset = builder.insertTemplate(0, template, predefinedVarValues);
+    if (surroundedText != null) {
+      builder.insertText(offset, surroundedText, true);
+      /*if (offset < builder.length()) {
+        builder.insertVariableSegment(offset, TemplateImpl.END);
+      }*/
+    }
+    return builder.buildTemplate();
+  }
+
+  @NotNull
+  private static XmlTag expandEmptyTagIfNeccessary(@NotNull XmlTag tag) {
+    StringBuilder builder = new StringBuilder();
+    boolean flag = false;
+
+    for (PsiElement child : tag.getChildren()) {
+      if (child instanceof XmlToken && XmlTokenType.XML_EMPTY_ELEMENT_END.equals(((XmlToken)child).getTokenType())) {
+        flag = true;
+        break;
+      }
+      builder.append(child.getText());
+    }
+
+    if (flag) {
+      builder.append("></").append(tag.getName()).append('>');
+      final XmlTag tag1 = XmlElementFactory.getInstance(tag.getProject()).createTagFromText(builder.toString(), XMLLanguage.INSTANCE);
+      return tag1;
+    }
+    return tag;
+  }
+
+  private static int gotoChild(Project project, CharSequence text, int offset, int start, int end) {
+    PsiFile file = PsiFileFactory.getInstance(project)
+      .createFileFromText("dummy.xml", StdFileTypes.XML, text, LocalTimeCounter.currentTime(), false);
+
+    PsiElement element = file.findElementAt(offset);
+    if (offset < end && element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_END_TAG_START) {
+      return offset;
+    }
+
+    int newOffset = -1;
+    XmlTag tag = PsiTreeUtil.findElementOfClassAtRange(file, start, end, XmlTag.class);
+    if (tag != null) {
+      for (PsiElement child : tag.getChildren()) {
+        if (child instanceof XmlToken && ((XmlToken)child).getTokenType() == XmlTokenType.XML_END_TAG_START) {
+          newOffset = child.getTextOffset();
+        }
+      }
+    }
+
+    if (newOffset >= 0) {
+      return newOffset;
+    }
+
+    return offset;
+  }
+
+  private static void removeVariablesWhichHasNoSegment(TemplateImpl template) {
+    Set<String> segments = new HashSet<String>();
+    for (int i = 0; i < template.getSegmentsCount(); i++) {
+      segments.add(template.getSegmentName(i));
+    }
+    IntArrayList varsToRemove = new IntArrayList();
+    for (int i = 0; i < template.getVariableCount(); i++) {
+      String varName = template.getVariableNameAt(i);
+      if (!segments.contains(varName)) {
+        varsToRemove.add(i);
+      }
+    }
+    for (int i = 0; i < varsToRemove.size(); i++) {
+      template.removeVariable(varsToRemove.get(i));
+    }
+  }
+
+  @Nullable
+  private Map<String, String> buildPredefinedValues(List<Pair<String, String>> attribute2value,
+                                                    @Nullable XmlZenCodingGenerator generator,
+                                                    boolean hasChildren) {
+    if (generator == null) {
+      return Collections.emptyMap();
+    }
+
+    for (Pair<String, String> pair : attribute2value) {
+      if (ZenCodingUtil.containsSurroundedTextMarker(pair.second)) {
+        myContainsSurroundedTextMarker = true;
+        break;
+      }
+    }
+
+    String attributes = generator.buildAttributesString(attribute2value, hasChildren, myNumberInIteration, mySurroundedText);
+    attributes = attributes.length() > 0 ? ' ' + attributes : null;
+    Map<String, String> predefinedValues = null;
+    if (attributes != null) {
+      predefinedValues = new HashMap<String, String>();
+      predefinedValues.put(ZenCodingTemplate.ATTRS, attributes);
+    }
+    return predefinedValues;
+  }
+
+  private void setAttributeValues(XmlTag tag, List<Pair<String, String>> attr2value) {
+    for (Iterator<Pair<String, String>> iterator = attr2value.iterator(); iterator.hasNext();) {
+      Pair<String, String> pair = iterator.next();
+      if (tag.getAttribute(pair.first) != null) {
+        if (ZenCodingUtil.containsSurroundedTextMarker(pair.second)) {
+          myContainsSurroundedTextMarker = true;
+        }
+        tag.setAttribute(pair.first, ZenCodingUtil.getValue(pair.second, myNumberInIteration, mySurroundedText));
+        iterator.remove();
+      }
+    }
+  }
+
+  private static boolean isNewLineBefore(CharSequence text, int offset) {
+    int i = offset - 1;
+    while (i >= 0 && Character.isWhitespace(text.charAt(i))) {
+      if (text.charAt(i) == '\n') {
+        return true;
+      }
+      i--;
+    }
+    return i < 0;
+  }
+
+  private static boolean isNewLineAfter(CharSequence text, int offset) {
+    int i = offset;
+    while (i < text.length() && Character.isWhitespace(text.charAt(i))) {
+      if (text.charAt(i) == '\n') {
+        return true;
+      }
+      i++;
+    }
+    return i == text.length();
+  }
+
+  public TemplateToken getTemplateToken() {
+    return myTemplateToken;
+  }
+
+  public String getSurroundedText() {
+    return mySurroundedText;
+  }
+
+  public void setSurroundedText(String surroundedText) {
+    mySurroundedText = surroundedText;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/MoreOperationNode.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/MoreOperationNode.java
new file mode 100644
index 0000000..8e32e50
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/MoreOperationNode.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.nodes;
+
+import com.intellij.codeInsight.template.CustomTemplateCallback;
+import com.intellij.openapi.util.text.LineTokenizer;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class MoreOperationNode extends ZenCodingNode {
+  private final ZenCodingNode myLeftOperand;
+  private final ZenCodingNode myRightOperand;
+
+  public MoreOperationNode(ZenCodingNode leftOperand, ZenCodingNode rightOperand) {
+    myLeftOperand = leftOperand;
+    myRightOperand = rightOperand;
+  }
+
+  public ZenCodingNode getLeftOperand() {
+    return myLeftOperand;
+  }
+
+  public ZenCodingNode getRightOperand() {
+    return myRightOperand;
+  }
+
+  private static void addChildrenToAllLeafs(GenerationNode root, Collection<GenerationNode> children) {
+    if (root.isLeaf()) {
+      root.addChildren(children);
+    }
+    else {
+      for (GenerationNode child : root.getChildren()) {
+        addChildrenToAllLeafs(child, children);
+      }
+    }
+  }
+
+  @NotNull
+  @Override
+  public List<GenerationNode> expand(int numberInIteration,
+                                     String surroundedText,
+                                     CustomTemplateCallback callback,
+                                     boolean insertSurroundedTextAtTheEnd) {
+    if (myLeftOperand instanceof MulOperationNode || (myLeftOperand instanceof UnaryMulOperationNode && surroundedText != null)) {
+      List<GenerationNode> result = new ArrayList<GenerationNode>();
+      if (myLeftOperand instanceof MulOperationNode) {
+        MulOperationNode mul = (MulOperationNode)myLeftOperand;
+        for (int i = 0; i < mul.getRightOperand(); i++) {
+          List<GenerationNode> parentNodes = mul.getLeftOperand().expand(i, surroundedText, callback, insertSurroundedTextAtTheEnd);
+          List<GenerationNode> innerNodes = myRightOperand.expand(i, surroundedText, callback, insertSurroundedTextAtTheEnd);
+          for (GenerationNode parentNode : parentNodes) {
+            addChildrenToAllLeafs(parentNode, innerNodes);
+          }
+          result.addAll(parentNodes);
+        }
+      }
+      else {
+        UnaryMulOperationNode unaryMul = (UnaryMulOperationNode)myLeftOperand;
+        String[] lines = LineTokenizer.tokenize(surroundedText, false);
+        for (int i = 0; i < lines.length; i++) {
+          String line = lines[i].trim();
+          List<GenerationNode> parentNodes = unaryMul.getOperand().expand(i, line, callback, insertSurroundedTextAtTheEnd);
+          List<GenerationNode> innerNodes = myRightOperand.expand(i, line, callback, insertSurroundedTextAtTheEnd);
+          for (GenerationNode parentNode : parentNodes) {
+            addChildrenToAllLeafs(parentNode, innerNodes);
+          }
+          result.addAll(parentNodes);
+        }
+      }
+      return result;
+    }
+    List<GenerationNode> leftGenNodes = myLeftOperand.expand(numberInIteration, surroundedText, callback, insertSurroundedTextAtTheEnd);
+    for (GenerationNode leftGenNode : leftGenNodes) {
+      List<GenerationNode> rightGenNodes = myRightOperand.expand(numberInIteration, surroundedText, callback, insertSurroundedTextAtTheEnd);
+      addChildrenToAllLeafs(leftGenNode, rightGenNodes);
+    }
+    return leftGenNodes;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/MulOperationNode.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/MulOperationNode.java
new file mode 100644
index 0000000..bb5b324
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/MulOperationNode.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.nodes;
+
+import com.intellij.codeInsight.template.CustomTemplateCallback;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class MulOperationNode extends ZenCodingNode {
+  private final ZenCodingNode myLeftOperand;
+  private final int myRightOperand;
+
+  public MulOperationNode(ZenCodingNode leftOperand, int rightOperand) {
+    myLeftOperand = leftOperand;
+    myRightOperand = rightOperand;
+  }
+
+  public ZenCodingNode getLeftOperand() {
+    return myLeftOperand;
+  }
+
+  public int getRightOperand() {
+    return myRightOperand;
+  }
+
+  @NotNull
+  @Override
+  public List<GenerationNode> expand(int numberInIteration,
+                                     String surroundedText,
+                                     CustomTemplateCallback callback,
+                                     boolean insertSurroundedTextAtTheEnd) {
+    List<GenerationNode> result = new ArrayList<GenerationNode>();
+    for (int i = 0; i < myRightOperand; i++) {
+      result.addAll(myLeftOperand.expand(i, surroundedText, callback, insertSurroundedTextAtTheEnd));
+    }
+    return result;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/TemplateNode.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/TemplateNode.java
new file mode 100644
index 0000000..7a9040d
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/TemplateNode.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.nodes;
+
+import com.intellij.codeInsight.template.CustomTemplateCallback;
+import com.intellij.codeInsight.template.zencoding.tokens.TemplateToken;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class TemplateNode extends ZenCodingNode {
+  private final TemplateToken myTemplateToken;
+
+  public TemplateNode(TemplateToken templateToken) {
+    myTemplateToken = templateToken;
+  }
+
+  public TemplateToken getTemplateToken() {
+    return myTemplateToken;
+  }
+
+  @NotNull
+  @Override
+  public List<GenerationNode> expand(int numberInIteration,
+                                     String surroundedText,
+                                     CustomTemplateCallback callback,
+                                     boolean insertSurroundedTextAtTheEnd) {
+    GenerationNode node =
+      new GenerationNode(myTemplateToken, new ArrayList<GenerationNode>(), numberInIteration, surroundedText, insertSurroundedTextAtTheEnd);
+    return Arrays.asList(node);
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/TextNode.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/TextNode.java
new file mode 100644
index 0000000..8e7eba7
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/TextNode.java
@@ -0,0 +1,48 @@
+package com.intellij.codeInsight.template.zencoding.nodes;
+
+import com.intellij.codeInsight.template.CustomTemplateCallback;
+import com.intellij.codeInsight.template.impl.TemplateImpl;
+import com.intellij.codeInsight.template.zencoding.ZenCodingTemplate;
+import com.intellij.codeInsight.template.zencoding.ZenCodingUtil;
+import com.intellij.codeInsight.template.zencoding.tokens.TemplateToken;
+import com.intellij.codeInsight.template.zencoding.tokens.TextToken;
+import com.intellij.openapi.util.Pair;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class TextNode extends ZenCodingNode {
+  private final String myText;
+
+  public TextNode(@NotNull TextToken textToken) {
+    final String text = textToken.getText();
+    myText = text.substring(1, text.length() - 1);
+  }
+
+  public String getText() {
+    return myText;
+  }
+
+  @NotNull
+  @Override
+  public List<GenerationNode> expand(int numberInIteration,
+                                     String surroundedText,
+                                     CustomTemplateCallback callback,
+                                     boolean insertSurroundedTextAtTheEnd) {
+    final TemplateToken templateToken = new TemplateToken("", Collections.<Pair<String, String>>emptyList());
+    final boolean containsSurroundedTextMarker = ZenCodingUtil.containsSurroundedTextMarker(myText);
+
+    final String text = ZenCodingUtil.replaceMarkers(myText.replace("${nl}", "\n"), numberInIteration, surroundedText);
+    final TemplateImpl template = new TemplateImpl("", text, "");
+    ZenCodingTemplate.doSetTemplate(templateToken, template, callback);
+
+    final GenerationNode node = new GenerationNode(templateToken, new ArrayList<GenerationNode>(), numberInIteration,
+                                                   containsSurroundedTextMarker ? null : surroundedText, insertSurroundedTextAtTheEnd);
+    return Collections.singletonList(node);
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/UnaryMulOperationNode.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/UnaryMulOperationNode.java
new file mode 100644
index 0000000..7efb182
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/UnaryMulOperationNode.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.nodes;
+
+import com.intellij.codeInsight.template.CustomTemplateCallback;
+import com.intellij.openapi.util.text.LineTokenizer;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class UnaryMulOperationNode extends ZenCodingNode {
+  private final ZenCodingNode myOperand;
+
+  public UnaryMulOperationNode(ZenCodingNode operand) {
+    myOperand = operand;
+  }
+
+  public ZenCodingNode getOperand() {
+    return myOperand;
+  }
+
+  @NotNull
+  @Override
+  public List<GenerationNode> expand(int numberInIteration,
+                                     String surroundedText,
+                                     CustomTemplateCallback callback,
+                                     boolean insertSurroundedTextAtTheEnd) {
+    if (surroundedText == null) {
+      return myOperand.expand(numberInIteration, surroundedText, callback, insertSurroundedTextAtTheEnd);
+    }
+    String[] lines = LineTokenizer.tokenize(surroundedText, false);
+    List<GenerationNode> result = new ArrayList<GenerationNode>();
+    for (int i = 0; i < lines.length; i++) {
+      result.addAll(myOperand.expand(i, lines[i].trim(), callback, insertSurroundedTextAtTheEnd));
+    }
+    return result;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/ZenCodingNode.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/ZenCodingNode.java
new file mode 100644
index 0000000..f1993ad
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/nodes/ZenCodingNode.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.nodes;
+
+import com.intellij.codeInsight.template.CustomTemplateCallback;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public abstract class ZenCodingNode {
+  @NotNull
+  public abstract List<GenerationNode> expand(int numberInIteration,
+                                              String surroundedText,
+                                              CustomTemplateCallback callback,
+                                              boolean insertSurroundedTextAtTheEnd);
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/FilterToken.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/FilterToken.java
new file mode 100644
index 0000000..739c9b6
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/FilterToken.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.tokens;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class FilterToken extends ZenCodingToken {
+  private final String mySuffix;
+
+  public FilterToken(String suffix) {
+    mySuffix = suffix;
+  }
+
+  public String getSuffix() {
+    return mySuffix;
+  }
+
+  @Override
+  public String toString() {
+    return "|" + mySuffix;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/IdentifierToken.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/IdentifierToken.java
new file mode 100644
index 0000000..2c42ebb
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/IdentifierToken.java
@@ -0,0 +1,23 @@
+package com.intellij.codeInsight.template.zencoding.tokens;
+
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class IdentifierToken extends ZenCodingToken {
+  private final String myText;
+
+  public IdentifierToken(@NotNull String text) {
+    myText = text;
+  }
+
+  @Override
+  public String toString() {
+    return myText;
+  }
+
+  public String getText() {
+    return myText;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/NumberToken.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/NumberToken.java
new file mode 100644
index 0000000..5d4ae7c
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/NumberToken.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.tokens;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class NumberToken extends ZenCodingToken {
+  private final int myNumber;
+
+  public NumberToken(int number) {
+    myNumber = number;
+  }
+
+  public int getNumber() {
+    return myNumber;
+  }
+
+  @Override
+  public String toString() {
+    return Integer.toString(myNumber);
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/OperationToken.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/OperationToken.java
new file mode 100644
index 0000000..5c7c843
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/OperationToken.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.tokens;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class OperationToken extends ZenCodingToken {
+  private final char mySign;
+
+  public OperationToken(char sign) {
+    mySign = sign;
+  }
+
+  public char getSign() {
+    return mySign;
+  }
+
+  @Override
+  public String toString() {
+    return Character.toString(mySign);
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/StringLiteralToken.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/StringLiteralToken.java
new file mode 100644
index 0000000..1c8428a
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/StringLiteralToken.java
@@ -0,0 +1,21 @@
+package com.intellij.codeInsight.template.zencoding.tokens;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class StringLiteralToken extends ZenCodingToken {
+  private final String myText;
+
+  public StringLiteralToken(String text) {
+    myText = text;
+  }
+
+  @Override
+  public String toString() {
+    return myText;
+  }
+
+  public String getText() {
+    return myText;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/TemplateToken.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/TemplateToken.java
new file mode 100644
index 0000000..3bd3e5f
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/TemplateToken.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.tokens;
+
+import com.intellij.codeInsight.template.impl.TemplateImpl;
+import com.intellij.openapi.util.Pair;
+import com.intellij.psi.xml.XmlFile;
+
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class TemplateToken extends ZenCodingToken {
+  private final String myKey;
+  private TemplateImpl myTemplate;
+  private final List<Pair<String, String>> myAttribute2Value;
+  private XmlFile myFile;
+
+  public TemplateToken(String key, List<Pair<String, String>> attribute2value) {
+    myKey = key;
+    myAttribute2Value = attribute2value;
+  }
+
+  public List<Pair<String, String>> getAttribute2Value() {
+    return myAttribute2Value;
+  }
+
+  public XmlFile getFile() {
+    return myFile;
+  }
+
+  public void setFile(XmlFile file) {
+    myFile = file;
+  }
+
+   public String getKey() {
+    return myKey;
+  }
+
+  public void setTemplate(TemplateImpl template) {
+    myTemplate = template;
+  }
+
+  public TemplateImpl getTemplate() {
+    return myTemplate;
+  }
+
+  public String toString() {
+    return "TEMPLATE";
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/TextToken.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/TextToken.java
new file mode 100644
index 0000000..e216302
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/TextToken.java
@@ -0,0 +1,21 @@
+package com.intellij.codeInsight.template.zencoding.tokens;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class TextToken extends ZenCodingToken {
+  private final String myText;
+
+  public TextToken(String text) {
+    myText = text;
+  }
+
+  public String getText() {
+    return myText;
+  }
+
+  @Override
+  public String toString() {
+    return myText;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/ZenCodingToken.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/ZenCodingToken.java
new file mode 100644
index 0000000..b38c98e
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/ZenCodingToken.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template.zencoding.tokens;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public abstract class ZenCodingToken {
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/ZenCodingTokenImpl.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/ZenCodingTokenImpl.java
new file mode 100644
index 0000000..749279c
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/ZenCodingTokenImpl.java
@@ -0,0 +1,17 @@
+package com.intellij.codeInsight.template.zencoding.tokens;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class ZenCodingTokenImpl extends ZenCodingToken {
+  private final String myString;
+
+  public ZenCodingTokenImpl(String string) {
+    myString = string;
+  }
+
+  @Override
+  public String toString() {
+    return myString;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/ZenCodingTokens.java b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/ZenCodingTokens.java
new file mode 100644
index 0000000..8911153
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInsight/template/zencoding/tokens/ZenCodingTokens.java
@@ -0,0 +1,21 @@
+package com.intellij.codeInsight.template.zencoding.tokens;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class ZenCodingTokens {
+  private ZenCodingTokens() {
+  }
+
+  public static final ZenCodingToken CLOSING_R_BRACKET = new ZenCodingTokenImpl(")");
+  public static final ZenCodingToken OPENING_R_BRACKET = new ZenCodingTokenImpl("(");
+  public static final ZenCodingToken OPENING_SQ_BRACKET = new ZenCodingTokenImpl("[");
+  public static final ZenCodingToken CLOSING_SQ_BRACKET = new ZenCodingTokenImpl("]");
+  public static final ZenCodingToken PIPE = new ZenCodingTokenImpl("|");
+  public static final ZenCodingToken MARKER = new ZenCodingTokenImpl("&");
+  public static final ZenCodingToken EQ = new ZenCodingTokenImpl("=");
+  public static final ZenCodingToken SPACE = new ZenCodingTokenImpl(" ");
+  public static final ZenCodingToken COMMA = new ZenCodingTokenImpl(",");
+  public static final ZenCodingToken DOT = new ZenCodingTokenImpl(".");
+  public static final ZenCodingToken SHARP = new ZenCodingTokenImpl("#");
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/AddCustomTagOrAttributeIntentionAction.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/AddCustomTagOrAttributeIntentionAction.java
new file mode 100644
index 0000000..faa6174
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/AddCustomTagOrAttributeIntentionAction.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.CommonBundle;
+import com.intellij.codeInspection.InspectionProfile;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ModifiableModel;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.IOException;
+
+/**
+ * @author spleaner
+ */
+public class AddCustomTagOrAttributeIntentionAction implements LocalQuickFix {
+  private final String myName;
+  private final int myType;
+  private final String myInspectionName;
+
+  public AddCustomTagOrAttributeIntentionAction(@NotNull String shortName, String name, int type) {
+    myInspectionName = shortName;
+    myName = name;
+    myType = type;
+  }
+
+  @NotNull
+  public String getName() {
+    if (myType == XmlEntitiesInspection.UNKNOWN_TAG) {
+      return XmlBundle.message("add.custom.html.tag", myName);
+    }
+
+    if (myType == XmlEntitiesInspection.UNKNOWN_ATTRIBUTE) {
+      return XmlBundle.message("add.custom.html.attribute", myName);
+    }
+
+    if (myType == XmlEntitiesInspection.NOT_REQUIRED_ATTRIBUTE) {
+      return XmlBundle.message("add.optional.html.attribute", myName);
+    }
+
+    return getFamilyName();
+  }
+
+  @NotNull
+  public String getFamilyName() {
+    return XmlBundle.message("fix.html.family");
+  }
+
+  public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
+    final PsiElement element = descriptor.getPsiElement();
+    final PsiFile file = element.getContainingFile();
+
+    final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
+    final InspectionProfile inspectionProfile = profileManager.getInspectionProfile();
+    final ModifiableModel model = inspectionProfile.getModifiableModel();
+    final LocalInspectionToolWrapper wrapper = (LocalInspectionToolWrapper)model.getInspectionTool(myInspectionName, element);
+    final HtmlUnknownTagInspection inspection = (HtmlUnknownTagInspection)wrapper.getTool();
+    inspection.addCustomPropertyName(myName);
+    try {
+      model.commit();
+    }
+    catch (IOException e) {
+      Messages.showErrorDialog(project, e.getMessage(), CommonBundle.getErrorTitle());
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/AddHtmlTagOrAttributeToCustomsIntention.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/AddHtmlTagOrAttributeToCustomsIntention.java
new file mode 100644
index 0000000..9b8d732
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/AddHtmlTagOrAttributeToCustomsIntention.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.CommonBundle;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInspection.InspectionProfile;
+import com.intellij.codeInspection.ModifiableModel;
+import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.IOException;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class AddHtmlTagOrAttributeToCustomsIntention implements IntentionAction {
+  private final String myName;
+  private final int myType;
+  private final String myInspectionName;
+
+  public AddHtmlTagOrAttributeToCustomsIntention(String shortName, String name, int type) {
+    myInspectionName = shortName;
+    myName = name;
+    myType = type;
+  }
+
+  @NotNull
+  public String getText() {
+    if (myType == XmlEntitiesInspection.UNKNOWN_TAG) {
+      return XmlBundle.message("add.custom.html.tag", myName);
+    }
+
+    if (myType == XmlEntitiesInspection.UNKNOWN_ATTRIBUTE) {
+      return XmlBundle.message("add.custom.html.attribute", myName);
+    }
+
+    if (myType == XmlEntitiesInspection.NOT_REQUIRED_ATTRIBUTE) {
+      return XmlBundle.message("add.optional.html.attribute", myName);
+    }
+
+    return getFamilyName();
+  }
+
+  @NotNull
+  public String getFamilyName() {
+    return XmlBundle.message("fix.html.family");
+  }
+
+  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
+    return true;
+  }
+
+  public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
+    final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
+    final InspectionProfile inspectionProfile = profileManager.getInspectionProfile();
+    final ModifiableModel model = inspectionProfile.getModifiableModel();
+    final LocalInspectionToolWrapper wrapper = (LocalInspectionToolWrapper)model.getInspectionTool(myInspectionName, file);
+    final XmlEntitiesInspection xmlEntitiesInspection = (XmlEntitiesInspection)wrapper.getTool();
+    xmlEntitiesInspection.setAdditionalEntries(myType, appendName(xmlEntitiesInspection.getAdditionalEntries(myType)));
+    try {
+      model.commit();
+    }
+    catch (IOException e) {
+      Messages.showErrorDialog(project, e.getMessage(), CommonBundle.getErrorTitle());
+    }
+  }
+
+  public boolean startInWriteAction() {
+    return false;
+  }
+
+  private String appendName(String toAppend) {
+    if (toAppend.length() > 0) {
+      toAppend += "," + myName;
+    }
+    else {
+      toAppend = myName;
+    }
+    return toAppend;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlExtraClosingTagInspection.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlExtraClosingTagInspection.java
new file mode 100644
index 0000000..923866e
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlExtraClosingTagInspection.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlTagUtil;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+public class HtmlExtraClosingTagInspection extends HtmlLocalInspectionTool {
+
+  @Nls
+  @NotNull
+  public String getDisplayName() {
+    return XmlBundle.message("html.inspection.extra.closing.tag");
+  }
+
+  @NonNls
+  @NotNull
+  public String getShortName() {
+    return "HtmlExtraClosingTag";
+  }
+
+  @NotNull
+  public HighlightDisplayLevel getDefaultLevel() {
+    return HighlightDisplayLevel.ERROR;
+  }
+
+  protected void checkTag(@NotNull final XmlTag tag, @NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
+    final XmlToken endTagName = XmlTagUtil.getEndTagNameElement(tag);
+
+    if (endTagName != null && tag instanceof HtmlTag && HtmlUtil.isSingleHtmlTag(tag.getName())) {
+      holder.registerProblem(endTagName, XmlErrorMessages.message("extra.closing.tag.for.empty.element"),
+                             ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new RemoveExtraClosingTagIntentionAction());
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlLocalInspectionTool.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlLocalInspectionTool.java
new file mode 100644
index 0000000..6d44429
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlLocalInspectionTool.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.codeInspection.XmlSuppressableInspectionTool;
+import com.intellij.codeInspection.XmlInspectionGroupNames;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiElementVisitor;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.XmlElementVisitor;
+import com.intellij.psi.templateLanguages.OuterLanguageElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+public abstract class HtmlLocalInspectionTool extends XmlSuppressableInspectionTool {
+
+  @Nls
+  @NotNull
+  public String getGroupDisplayName() {
+    return XmlInspectionGroupNames.HTML_INSPECTIONS;
+  }
+
+  public boolean isEnabledByDefault() {
+    return true;
+  }
+
+  protected void checkTag(@NotNull final XmlTag tag, @NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
+    // should be overridden
+  }
+
+  protected void checkAttribute(@NotNull final XmlAttribute attribute, @NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
+    // should be overridden
+  }
+
+  @NotNull
+  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
+    return new XmlElementVisitor() {
+      @Override public void visitXmlToken(final XmlToken token) {
+        if (token.getTokenType() == XmlTokenType.XML_NAME) {
+          PsiElement element = token.getPrevSibling();
+          while(element instanceof PsiWhiteSpace) element = element.getPrevSibling();
+
+          if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_START_TAG_START) {
+            PsiElement parent = element.getParent();
+
+            if (parent instanceof XmlTag && !(token.getNextSibling() instanceof OuterLanguageElement)) {
+              XmlTag tag = (XmlTag)parent;
+              checkTag(tag, holder, isOnTheFly);
+            }
+          }
+        }
+      }
+
+      @Override public void visitXmlAttribute(final XmlAttribute attribute) {
+        checkAttribute(attribute, holder, isOnTheFly);
+      }
+    };
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlUnknownAttributeInspection.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlUnknownAttributeInspection.java
new file mode 100644
index 0000000..9dac096
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlUnknownAttributeInspection.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+public class HtmlUnknownAttributeInspection extends HtmlUnknownTagInspection {
+
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.htmlInspections.HtmlUnknownAttributeInspection");
+  @NonNls public static final String ATTRIBUTE_SHORT_NAME = "HtmlUnknownAttribute";
+
+  public HtmlUnknownAttributeInspection() {
+    super("");
+  }
+
+  @Nls
+  @NotNull
+  public String getDisplayName() {
+    return XmlBundle.message("html.inspections.unknown.attribute");
+  }
+
+  @NonNls
+  @NotNull
+  public String getShortName() {
+    return ATTRIBUTE_SHORT_NAME;
+  }
+
+  protected String getCheckboxTitle() {
+    return XmlBundle.message("html.inspections.unknown.tag.attribute.checkbox.title");
+  }
+
+  protected String getPanelTitle() {
+    return XmlBundle.message("html.inspections.unknown.tag.attribute.title");
+  }
+
+  @NotNull
+  protected Logger getLogger() {
+    return LOG;
+  }
+
+  protected void checkTag(@NotNull final XmlTag tag, @NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
+    // does nothing! this method should be overridden empty!
+  }
+
+  protected void checkAttribute(@NotNull final XmlAttribute attribute, @NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
+    final XmlTag tag = attribute.getParent();
+
+    if (tag instanceof HtmlTag) {
+      XmlElementDescriptor elementDescriptor = tag.getDescriptor();
+      if (elementDescriptor == null || elementDescriptor instanceof AnyXmlElementDescriptor) {
+        return;
+      }
+
+      XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor(attribute);
+
+      final String name = attribute.getName();
+
+      if (attributeDescriptor == null && !attribute.isNamespaceDeclaration()) {
+        if (!XmlUtil.attributeFromTemplateFramework(name, tag) &&
+            (!isCustomValuesEnabled() || !isCustomValue(name))) {
+          final ASTNode node = attribute.getNode();
+          assert node != null;
+          final PsiElement nameElement = XmlChildRole.ATTRIBUTE_NAME_FINDER.findChild(node).getPsi();
+
+          boolean maySwitchToHtml5 = HtmlUtil.isCustomHtml5Attribute(name) && !HtmlUtil.hasNonHtml5Doctype(tag);
+          LocalQuickFix[] quickfixes = new LocalQuickFix[maySwitchToHtml5 ? 3 : 2];
+          quickfixes[0] = new AddCustomTagOrAttributeIntentionAction(getShortName(), name, XmlEntitiesInspection.UNKNOWN_ATTRIBUTE);
+          quickfixes[1] = new RemoveAttributeIntentionAction(name);
+          if (maySwitchToHtml5) {
+            quickfixes[2] = new SwitchToHtml5WithHighPriorityAction();
+          }
+
+          if (nameElement.getTextLength() > 0)
+            holder.registerProblem(nameElement, XmlErrorMessages.message("attribute.is.not.allowed.here", name),
+                                 ProblemHighlightType.GENERIC_ERROR_OR_WARNING, quickfixes);
+        }
+      }
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlUnknownTagInspection.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlUnknownTagInspection.java
new file mode 100644
index 0000000..08ab3339
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlUnknownTagInspection.java
@@ -0,0 +1,265 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInsight.daemon.impl.analysis.CreateNSDeclarationIntentionFix;
+import com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.JDOMExternalizableStringList;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.impl.source.html.dtd.HtmlElementDescriptorImpl;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.ui.DocumentAdapter;
+import com.intellij.ui.FieldPanel;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlTagUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.border.EmptyBorder;
+import javax.swing.event.DocumentEvent;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+/**
+ * @author spleaner
+ */
+public class HtmlUnknownTagInspection extends HtmlLocalInspectionTool {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.htmlInspections.HtmlUnknownTagInspection");
+
+  public JDOMExternalizableStringList myValues;
+  public boolean myCustomValuesEnabled = true;
+  @NonNls public static final String TAG_SHORT_NAME = "HtmlUnknownTag";
+
+  public HtmlUnknownTagInspection() {
+    this("nobr,noembed,comment,noscript,embed,script");
+  }
+
+  protected HtmlUnknownTagInspection(@NonNls @NotNull final String defaultValues) {
+    myValues = reparseProperties(defaultValues);
+  }
+
+  @Nls
+  @NotNull
+  public String getDisplayName() {
+    return XmlBundle.message("html.inspections.unknown.tag");
+  }
+
+  @NonNls
+  @NotNull
+  public String getShortName() {
+    return TAG_SHORT_NAME;
+  }
+
+  @Nullable
+  public JComponent createOptionsPanel() {
+    final JPanel result = new JPanel(new BorderLayout());
+
+    final JPanel internalPanel = new JPanel(new BorderLayout());
+    result.add(internalPanel, BorderLayout.NORTH);
+
+    final FieldPanel additionalAttributesPanel = new FieldPanel(null, getPanelTitle(), null, null);
+    additionalAttributesPanel.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
+      protected void textChanged(DocumentEvent e) {
+        final Document document = e.getDocument();
+        try {
+          final String text = document.getText(0, document.getLength());
+          if (text != null) {
+            myValues = reparseProperties(text.trim());
+          }
+        }
+        catch (BadLocationException e1) {
+          getLogger().error(e1);
+        }
+      }
+    });
+
+    final JCheckBox checkBox = new JCheckBox(getCheckboxTitle());
+    checkBox.setSelected(myCustomValuesEnabled);
+    checkBox.addActionListener(new ActionListener() {
+      public void actionPerformed(ActionEvent e) {
+        final boolean b = checkBox.isSelected();
+        if (b != myCustomValuesEnabled) {
+          myCustomValuesEnabled = b;
+          additionalAttributesPanel.setEnabled(myCustomValuesEnabled);
+        }
+      }
+    });
+
+    internalPanel.add(checkBox, BorderLayout.NORTH);
+    internalPanel.add(additionalAttributesPanel, BorderLayout.CENTER);
+
+    additionalAttributesPanel.setPreferredSize(new Dimension(150, additionalAttributesPanel.getPreferredSize().height));
+    additionalAttributesPanel.setEnabled(myCustomValuesEnabled);
+    additionalAttributesPanel.setText(createPropertiesString());
+
+    return result;
+  }
+
+  @NotNull
+  protected Logger getLogger() {
+    return LOG;
+  }
+
+  private String createPropertiesString() {
+    final StringBuffer buffer = new StringBuffer();
+    for (final String property : myValues) {
+      if (buffer.length() == 0) {
+        buffer.append(property);
+      }
+      else {
+        buffer.append(',');
+        buffer.append(property);
+      }
+    }
+
+    return buffer.toString();
+  }
+
+  public String getAdditionalEntries() {
+    return createPropertiesString();
+  }
+
+  protected String getCheckboxTitle() {
+    return XmlBundle.message("html.inspections.unknown.tag.checkbox.title");
+  }
+
+  protected static JDOMExternalizableStringList reparseProperties(@NotNull final String properties) {
+    final JDOMExternalizableStringList result = new JDOMExternalizableStringList();
+
+    final StringTokenizer tokenizer = new StringTokenizer(properties, ",");
+    while (tokenizer.hasMoreTokens()) {
+      result.add(tokenizer.nextToken().toLowerCase().trim());
+    }
+
+    return result;
+  }
+
+  public void setAdditionalValues(@NotNull final String values) {
+    myValues = reparseProperties(values);
+  }
+
+  protected String getPanelTitle() {
+    return XmlBundle.message("html.inspections.unknown.tag.title");
+  }
+
+  protected boolean isCustomValue(@NotNull final String value) {
+    return myValues.contains(value.toLowerCase());
+  }
+
+  public void addCustomPropertyName(@NotNull final String text) {
+    final String s = text.trim().toLowerCase();
+    if (!isCustomValue(s)) {
+      myValues.add(s);
+    }
+
+    if (!isCustomValuesEnabled()) {
+      myCustomValuesEnabled = true;
+    }
+  }
+
+  public boolean isCustomValuesEnabled() {
+    return myCustomValuesEnabled;
+  }
+
+  private static boolean isAbstractDescriptor(XmlElementDescriptor descriptor) {
+    return descriptor == null || descriptor instanceof AnyXmlElementDescriptor;
+  }
+
+  // this hack is needed, because we temporarily ignore svg and mathML namespaces
+  // todo: provide schemas for svg and mathML and remove this in IDEA XI
+  private static boolean isInSpecialHtml5Namespace(XmlTag tag) {
+    final String ns = tag.getNamespace();
+    return HtmlUtil.SVG_NAMESPACE.equals(ns) || HtmlUtil.MATH_ML_NAMESPACE.endsWith(ns);
+  }
+
+  protected void checkTag(@NotNull final XmlTag tag, @NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
+    if (!(tag instanceof HtmlTag) || !XmlHighlightVisitor.shouldBeValidated(tag) || isInSpecialHtml5Namespace(tag)) {
+      return;
+    }
+
+    XmlElementDescriptor descriptorFromContext = XmlUtil.getDescriptorFromContext(tag);
+
+    PsiElement parent = tag.getParent();
+    XmlElementDescriptor parentDescriptor = parent instanceof XmlTag ? ((XmlTag)parent).getDescriptor() : null;
+
+    XmlElementDescriptor ownDescriptor = isAbstractDescriptor(descriptorFromContext)
+                                         ? tag.getDescriptor()
+                                         : descriptorFromContext;
+
+    if (isAbstractDescriptor(ownDescriptor) ||
+        (parentDescriptor instanceof HtmlElementDescriptorImpl &&
+         ownDescriptor instanceof HtmlElementDescriptorImpl &&
+         isAbstractDescriptor(descriptorFromContext))) {
+
+      final String name = tag.getName();
+
+      if (!isCustomValuesEnabled() || !isCustomValue(name)) {
+        final AddCustomTagOrAttributeIntentionAction action =
+          new AddCustomTagOrAttributeIntentionAction(getShortName(), name, XmlEntitiesInspection.UNKNOWN_TAG);
+
+        // todo: support "element is not allowed" message for html5
+        // some tags in html5 cannot be found in xhtml5.xsd if they are located in incorrect context, so they get any-element descriptor (ex. "canvas: tag)
+        final String message = isAbstractDescriptor(ownDescriptor)
+                               ? XmlErrorMessages.message("unknown.html.tag", name)
+                               : XmlErrorMessages.message("element.is.not.allowed.here", name);
+
+        final PsiElement startTagName = XmlTagUtil.getStartTagNameElement(tag);
+        assert startTagName != null;
+        final PsiElement endTagName = XmlTagUtil.getEndTagNameElement(tag);
+
+        List<LocalQuickFix> quickfixes = new ArrayList<LocalQuickFix>();
+        quickfixes.add(action);
+        if (isOnTheFly) {
+          ContainerUtil.addIfNotNull(CreateNSDeclarationIntentionFix.createFix(startTagName, ""), quickfixes);
+        }
+        if (HtmlUtil.isHtml5Tag(name) && !HtmlUtil.hasNonHtml5Doctype(tag)) {
+          quickfixes.add(new SwitchToHtml5WithHighPriorityAction());
+        }
+        ProblemHighlightType highlightType = tag.getContainingFile().getContext() == null ?
+                                             ProblemHighlightType.GENERIC_ERROR_OR_WARNING :
+                                             ProblemHighlightType.INFORMATION;
+        if (startTagName.getTextLength() > 0) {
+          holder.registerProblem(startTagName, message, highlightType, quickfixes.toArray(new LocalQuickFix[quickfixes.size()]));
+        }
+
+        if (endTagName != null) {
+          holder.registerProblem(endTagName, message, highlightType, quickfixes.toArray(new LocalQuickFix[quickfixes.size()]));
+        }
+      }
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/RemoveAttributeIntentionAction.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/RemoveAttributeIntentionAction.java
new file mode 100644
index 0000000..a4eb248
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/RemoveAttributeIntentionAction.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+public class RemoveAttributeIntentionAction implements LocalQuickFix {
+  private final String myLocalName;
+
+  public RemoveAttributeIntentionAction(final String localName) {
+    myLocalName = localName;
+  }
+
+  @NotNull
+  public String getName() {
+    return XmlErrorMessages.message("remove.attribute.quickfix.text", myLocalName);
+  }
+
+  @NotNull
+  public String getFamilyName() {
+    return XmlErrorMessages.message("remove.attribute.quickfix.family");
+  }
+
+  public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
+    PsiElement e = descriptor.getPsiElement();
+    final XmlAttribute myAttribute = PsiTreeUtil.getParentOfType(e, XmlAttribute.class);
+    if (myAttribute == null) return;
+
+    if (!CodeInsightUtilBase.prepareFileForWrite(myAttribute.getContainingFile())) {
+      return;
+    }
+
+    new WriteCommandAction(project) {
+      protected void run(final Result result) throws Throwable {
+        myAttribute.delete();
+      }
+    }.execute();
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/RemoveExtraClosingTagIntentionAction.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/RemoveExtraClosingTagIntentionAction.java
new file mode 100644
index 0000000..0610645
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/RemoveExtraClosingTagIntentionAction.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.Document;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiErrorElement;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+public class RemoveExtraClosingTagIntentionAction implements LocalQuickFix, IntentionAction {
+  @NotNull
+  public String getFamilyName() {
+    return XmlErrorMessages.message("remove.extra.closing.tag.quickfix");
+  }
+
+  @NotNull
+  public String getName() {
+    return XmlErrorMessages.message("remove.extra.closing.tag.quickfix");
+  }
+
+
+  @NotNull
+  public String getText() {
+    return getName();
+  }
+
+  public boolean isAvailable(@NotNull final Project project, final Editor editor, final PsiFile file) {
+    return true;
+  }
+
+  public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
+    final int offset = editor.getCaretModel().getOffset();
+    final PsiElement psiElement = file.findElementAt(offset);
+    if (psiElement == null || !psiElement.isValid() || !(psiElement instanceof XmlToken)) {
+      return;
+    }
+
+    if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
+    doFix(psiElement);
+  }
+
+  public boolean startInWriteAction() {
+    return true;
+  }
+
+  private static void doFix(@NotNull final PsiElement element) throws IncorrectOperationException {
+    final XmlToken endNameToken = (XmlToken)element;
+    final PsiElement tagElement = endNameToken.getParent();
+    if (!(tagElement instanceof XmlTag) && !(tagElement instanceof PsiErrorElement)) return;
+
+    if (tagElement instanceof PsiErrorElement) {
+      tagElement.delete();
+    }
+    else {
+      final ASTNode astNode = tagElement.getNode();
+      if (astNode != null) {
+        final ASTNode endTagStart = XmlChildRole.CLOSING_TAG_START_FINDER.findChild(astNode);
+        if (endTagStart != null) {
+          final Document document = PsiDocumentManager.getInstance(element.getProject()).getDocument(tagElement.getContainingFile());
+          if (document != null) {
+            document.deleteString(endTagStart.getStartOffset(), tagElement.getLastChild().getTextRange().getEndOffset());
+          }
+        }
+      }
+    }
+  }
+
+  public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
+    final PsiElement element = descriptor.getPsiElement();
+    if (!element.isValid() || !(element instanceof XmlToken)) return;
+    if (!CodeInsightUtilBase.prepareFileForWrite(element.getContainingFile())) return;
+
+    new WriteCommandAction(project) {
+      protected void run(final Result result) throws Throwable {
+        doFix(element);
+      }
+    }.execute();
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/RenameTagBeginOrEndIntentionAction.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/RenameTagBeginOrEndIntentionAction.java
new file mode 100644
index 0000000..8356b78
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/RenameTagBeginOrEndIntentionAction.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.*;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.util.XmlTagUtil;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+public class RenameTagBeginOrEndIntentionAction implements IntentionAction {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.htmlInspections.RenameTagBeginOrEndIntentionAction");
+
+  private final boolean myStart;
+  private final String myTargetName;
+  private final String mySourceName;
+
+  RenameTagBeginOrEndIntentionAction(@NotNull final String targetName, @NotNull final String sourceName, final boolean start) {
+    myTargetName = targetName;
+    mySourceName = sourceName;
+    myStart = start;
+  }
+
+  @NotNull
+  public String getFamilyName() {
+    return getName();
+  }
+
+  @NotNull
+  public String getText() {
+    return getName();
+  }
+
+  public boolean isAvailable(@NotNull final Project project, final Editor editor, final PsiFile file) {
+    return true;
+  }
+
+  public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
+    final int offset = editor.getCaretModel().getOffset();
+    PsiElement psiElement = file.findElementAt(offset);
+
+    if (psiElement == null || !psiElement.isValid()) return;
+    if (!CodeInsightUtilBase.prepareFileForWrite(psiElement.getContainingFile())) return;
+
+    if (psiElement instanceof PsiWhiteSpace) psiElement = PsiTreeUtil.prevLeaf(psiElement);
+    if (psiElement instanceof XmlToken) {
+      final IElementType tokenType = ((XmlToken)psiElement).getTokenType();
+      if (tokenType != XmlTokenType.XML_NAME) {
+        if (tokenType == XmlTokenType.XML_TAG_END) {
+          psiElement = psiElement.getPrevSibling();
+          if (psiElement == null) return;
+        }
+      }
+
+      PsiElement target = null;
+      final String text = psiElement.getText();
+      if (!myTargetName.equals(text)) {
+        target = psiElement;
+      }
+      else {
+        // we're in the other
+        PsiElement parent = psiElement.getParent();
+        if (parent instanceof PsiErrorElement) {
+          parent = parent.getParent();
+        }
+
+        if (parent instanceof XmlTag) {
+          if (myStart) {
+            target = XmlTagUtil.getStartTagNameElement((XmlTag)parent);
+          }
+          else {
+            target = XmlTagUtil.getEndTagNameElement((XmlTag)parent);
+            if (target == null) {
+              final PsiErrorElement errorElement = PsiTreeUtil.getChildOfType(parent, PsiErrorElement.class);
+              target = XmlWrongClosingTagNameInspection.findEndTagName(errorElement);
+            }
+          }
+        }
+      }
+
+      if (target != null) {
+        final Document document = PsiDocumentManager.getInstance(project).getDocument(file);
+        if (document != null) {
+          final TextRange textRange = target.getTextRange();
+          document.replaceString(textRange.getStartOffset(), textRange.getEndOffset(), myTargetName);
+        }
+      }
+
+    }
+  }
+
+  public boolean startInWriteAction() {
+    return true;
+  }
+
+  @NotNull
+  public String getName() {
+    return myStart
+           ? XmlErrorMessages.message("rename.start.tag.name.intention", mySourceName, myTargetName)
+           : XmlErrorMessages.message("rename.end.tag.name.intention", mySourceName, myTargetName);
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/RequiredAttributesInspection.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/RequiredAttributesInspection.java
new file mode 100644
index 0000000..d4cdffe
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/RequiredAttributesInspection.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInspection.InspectionsBundle;
+import com.intellij.codeInspection.XmlSuppressableInspectionTool;
+import com.intellij.codeInspection.XmlInspectionGroupNames;
+import com.intellij.codeInspection.ex.UnfairLocalInspectionTool;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.ui.DocumentAdapter;
+import com.intellij.ui.FieldPanel;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.event.DocumentEvent;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import java.awt.*;
+
+/**
+ * User: anna
+ * Date: 18-Nov-2005
+ */
+public class RequiredAttributesInspection extends XmlSuppressableInspectionTool implements XmlEntitiesInspection, UnfairLocalInspectionTool {
+
+  public String myAdditionalRequiredHtmlAttributes = "";
+
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.htmlInspections.RequiredAttributesInspection");
+  @NonNls public static final String SHORT_NAME = "RequiredAttributes";
+
+  @NotNull
+  public String getGroupDisplayName() {
+    return XmlInspectionGroupNames.HTML_INSPECTIONS;
+  }
+
+  @NotNull
+  public String getDisplayName() {
+    return InspectionsBundle.message("inspection.required.attributes.display.name");
+  }
+
+  @NotNull
+  @NonNls
+  public String getShortName() {
+    return SHORT_NAME;
+  }
+
+  @Nullable
+  public JComponent createOptionsPanel() {
+    JPanel panel = new JPanel(new BorderLayout());
+    FieldPanel additionalAttributesPanel = new FieldPanel(InspectionsBundle.message("inspection.javadoc.html.not.required.label.text"),
+                                                          InspectionsBundle.message("inspection.javadoc.html.not.required.dialog.title"),
+                                                          null, null);
+
+    panel.add(additionalAttributesPanel, BorderLayout.NORTH);
+    additionalAttributesPanel.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
+      protected void textChanged(DocumentEvent e) {
+        final Document document = e.getDocument();
+        try {
+          final String text = document.getText(0, document.getLength());
+          if (text != null) {
+            myAdditionalRequiredHtmlAttributes = text.trim();
+          }
+        }
+        catch (BadLocationException e1) {
+          RequiredAttributesInspection.LOG.error(e1);
+        }
+      }
+    });
+    additionalAttributesPanel.setText(myAdditionalRequiredHtmlAttributes);
+    return panel;
+  }
+
+  public IntentionAction getIntentionAction(String name, int type) {
+    return new AddHtmlTagOrAttributeToCustomsIntention(getShortName(), name, type);
+  }
+
+  public String getAdditionalEntries(int type) {
+    return myAdditionalRequiredHtmlAttributes;
+  }
+
+  public void setAdditionalEntries(int type, String additionalEntries) {
+    myAdditionalRequiredHtmlAttributes = additionalEntries;
+  }
+
+  public boolean isEnabledByDefault() {
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/SwitchToHtml5Action.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/SwitchToHtml5Action.java
new file mode 100644
index 0000000..cf6bee3
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/SwitchToHtml5Action.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.javaee.ExternalResourceManagerEx;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiFile;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.Html5SchemaProvider;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class SwitchToHtml5Action implements LocalQuickFix, IntentionAction {
+
+  @NotNull
+  @Override
+  public String getName() {
+    return XmlErrorMessages.message("switch.to.html5.quickfix.text");
+  }
+
+  @NotNull
+  @Override
+  public String getText() {
+    return getFamilyName();
+  }
+
+  @NotNull
+  @Override
+  public String getFamilyName() {
+    return getName();
+  }
+
+  @Override
+  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
+    return true;
+  }
+
+  @Override
+  public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
+    applyFix(project);
+  }
+
+  @Override
+  public boolean startInWriteAction() {
+    return true;
+  }
+
+  @Override
+  public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
+    applyFix(project);
+  }
+
+  private static void applyFix(Project project) {
+    ExternalResourceManagerEx.getInstanceEx().setDefaultHtmlDoctype(Html5SchemaProvider.HTML5_SCHEMA_LOCATION, project);
+    DaemonCodeAnalyzer.getInstance(project).restart();
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/SwitchToHtml5WithHighPriorityAction.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/SwitchToHtml5WithHighPriorityAction.java
new file mode 100644
index 0000000..7a6b2ad
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/SwitchToHtml5WithHighPriorityAction.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeInsight.intention.HighPriorityAction;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class SwitchToHtml5WithHighPriorityAction extends SwitchToHtml5Action implements HighPriorityAction {
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlEntitiesInspection.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlEntitiesInspection.java
new file mode 100644
index 0000000..fdad047
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlEntitiesInspection.java
@@ -0,0 +1,18 @@
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.psi.PsiElement;
+
+/**
+ * User: anna
+ * Date: 16-Dec-2005
+ */
+public interface XmlEntitiesInspection {
+  int UNKNOWN_TAG = 1;
+  int UNKNOWN_ATTRIBUTE = 2;
+  int NOT_REQUIRED_ATTRIBUTE = 3;
+  
+  IntentionAction getIntentionAction(String name, int type);
+  String getAdditionalEntries(int type);
+  void setAdditionalEntries(int type, String additionalEntries);
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlInspectionToolProvider.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlInspectionToolProvider.java
new file mode 100644
index 0000000..287591f
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlInspectionToolProvider.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeInsight.daemon.impl.analysis.*;
+import com.intellij.codeInspection.InspectionToolProvider;
+import com.intellij.xml.util.*;
+
+/**
+ * @author yole
+ */
+public class XmlInspectionToolProvider implements InspectionToolProvider {
+  public Class[] getInspectionClasses() {
+    return new Class[] {
+      CheckTagEmptyBodyInspection.class,
+      CheckDtdReferencesInspection.class,
+      CheckEmptyTagInspection.class,
+      CheckValidXmlInScriptBodyInspection.class,
+      CheckXmlFileWithXercesValidatorInspection.class,
+      XmlDuplicatedIdInspection.class,
+      RequiredAttributesInspection.class,
+      HtmlExtraClosingTagInspection.class,
+      XmlWrongRootElementInspection.class,
+      HtmlUnknownTagInspection.class,
+      HtmlUnknownAttributeInspection.class,
+      XmlUnboundNsPrefixInspection.class,
+      XmlUnusedNamespaceInspection.class,
+      XmlHighlightVisitorBasedInspection.class,
+      XmlPathReferenceInspection.class,
+      HtmlUnknownTargetInspection.class
+    };
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlWrongClosingTagNameInspection.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlWrongClosingTagNameInspection.java
new file mode 100644
index 0000000..39119e0
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlWrongClosingTagNameInspection.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.LanguageParserDefinitions;
+import com.intellij.lang.ParserDefinition;
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.lang.annotation.AnnotationHolder;
+import com.intellij.lang.annotation.Annotator;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiErrorElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlTagUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author spleaner
+ */
+public class XmlWrongClosingTagNameInspection implements Annotator {
+
+  public void annotate(final PsiElement psiElement, final AnnotationHolder holder) {
+    if (psiElement instanceof XmlToken) {
+      final PsiElement parent = psiElement.getParent();
+      if (parent instanceof XmlTag) {
+        final XmlTag tag = (XmlTag)parent;
+        final XmlToken start = XmlTagUtil.getStartTagNameElement(tag);
+        XmlToken endTagName = XmlTagUtil.getEndTagNameElement(tag);
+        if (endTagName != null && !(tag instanceof HtmlTag) && !tag.getName().equals(endTagName.getText())) {
+          registerProblem(holder, tag, start, endTagName);
+        }
+        else if (endTagName == null && !(tag instanceof HtmlTag && HtmlUtil.isSingleHtmlTag(tag.getName()))) {
+          final PsiErrorElement errorElement = PsiTreeUtil.getChildOfType(tag, PsiErrorElement.class);
+          endTagName = findEndTagName(errorElement);
+          if (endTagName != null) {
+            registerProblem(holder, tag, start, endTagName);
+          }
+        }
+      }
+      else if (parent instanceof PsiErrorElement) {
+        if (XmlTokenType.XML_NAME == ((XmlToken)psiElement).getTokenType()) {
+          final PsiFile psiFile = psiElement.getContainingFile();
+          
+          if (psiFile != null && (HTMLLanguage.INSTANCE == psiFile.getViewProvider().getBaseLanguage() || HTMLLanguage.INSTANCE == parent.getLanguage())) {
+            final String message = XmlErrorMessages.message("xml.parsing.closing.tag.matches.nothing");
+
+            if (message.equals(((PsiErrorElement)parent).getErrorDescription()) &&
+                psiFile.getContext() == null
+               ) {
+              final Annotation annotation = holder.createWarningAnnotation(parent, message);
+              annotation.registerFix(new RemoveExtraClosingTagIntentionAction());
+            }
+          }
+        }
+      }
+    }
+  }
+
+  private static void registerProblem(@NotNull final AnnotationHolder holder,
+                                      @NotNull final XmlTag tag,
+                                      @Nullable final XmlToken start,
+                                      @NotNull final XmlToken end) {
+    PsiElement context = tag.getContainingFile().getContext();
+    if (context != null) {
+      ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(context.getLanguage());
+      if (parserDefinition != null) {
+        ASTNode contextNode = context.getNode();
+        if (contextNode != null && contextNode.getChildren(parserDefinition.getStringLiteralElements()) != null) {
+          // TODO: we should check for concatenations here
+          return;
+        }
+      }
+    }
+    final String tagName = (tag instanceof HtmlTag) ? tag.getName().toLowerCase() : tag.getName();
+    final String endTokenText = (tag instanceof HtmlTag) ? end.getText().toLowerCase() : end.getText();
+
+    final RenameTagBeginOrEndIntentionAction renameEndAction = new RenameTagBeginOrEndIntentionAction(tagName, endTokenText, false);
+    final RenameTagBeginOrEndIntentionAction renameStartAction = new RenameTagBeginOrEndIntentionAction(endTokenText, tagName, true);
+
+    if (start != null) {
+      final Annotation annotation = holder.createErrorAnnotation(start, XmlErrorMessages.message("tag.has.wrong.closing.tag.name"));
+      annotation.registerFix(renameEndAction);
+      annotation.registerFix(renameStartAction);
+    }
+
+    final Annotation annotation = holder.createErrorAnnotation(end, XmlErrorMessages.message("wrong.closing.tag.name"));
+    annotation.registerFix(new RemoveExtraClosingTagIntentionAction());
+    annotation.registerFix(renameEndAction);
+    annotation.registerFix(renameStartAction);
+  }
+
+  @Nullable
+  static XmlToken findEndTagName(@Nullable final PsiErrorElement element) {
+    if (element == null) return null;
+
+    final ASTNode astNode = element.getNode();
+    if (astNode == null) return null;
+
+    ASTNode current = astNode.getLastChildNode();
+    ASTNode prev = current;
+
+    while (current != null) {
+      final IElementType elementType = prev.getElementType();
+
+      if ((elementType == XmlElementType.XML_NAME || elementType == XmlElementType.XML_TAG_NAME) &&
+          current.getElementType() == XmlElementType.XML_END_TAG_START) {
+        return (XmlToken)prev.getPsi();
+      }
+
+      prev = current;
+      current = current.getTreePrev();
+    }
+
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlWrongRootElementInspection.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlWrongRootElementInspection.java
new file mode 100644
index 0000000..a1f408e
--- /dev/null
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlWrongRootElementInspection.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection.htmlInspections;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor;
+import com.intellij.codeInspection.*;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+public class XmlWrongRootElementInspection extends HtmlLocalInspectionTool {
+
+  @Nls
+  @NotNull
+  public String getGroupDisplayName() {
+    return XmlInspectionGroupNames.XML_INSPECTIONS;
+  }
+
+  @Nls
+  @NotNull
+  public String getDisplayName() {
+    return XmlBundle.message("xml.inspection.wrong.root.element");
+  }
+
+  @NonNls
+  @NotNull
+  public String getShortName() {
+    return "XmlWrongRootElement";
+  }
+
+  @NotNull
+  public HighlightDisplayLevel getDefaultLevel() {
+    return HighlightDisplayLevel.ERROR;
+  }
+
+  protected void checkTag(@NotNull final XmlTag tag, @NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
+    if (!(tag.getParent() instanceof XmlTag)) {
+      final PsiFile psiFile = tag.getContainingFile();
+      if (!(psiFile instanceof XmlFile)) {
+        return;
+      }
+
+      XmlFile xmlFile = (XmlFile) psiFile;
+
+      final XmlDocument document = xmlFile.getDocument();
+      if (document == null) {
+        return;
+      }
+
+      XmlProlog prolog = document.getProlog();
+      if (prolog == null || XmlHighlightVisitor.skipValidation(prolog)) {
+        return;
+      }
+
+      final XmlDoctype doctype = prolog.getDoctype();
+
+      if (doctype == null) {
+        return;
+      }
+
+      XmlElement nameElement = doctype.getNameElement();
+
+      if (nameElement == null) {
+        return;
+      }
+
+      String name = tag.getName();
+      String text = nameElement.getText();
+      if (tag instanceof HtmlTag) {
+        name = name.toLowerCase();
+        text = text.toLowerCase();
+      }
+
+      if (!name.equals(text)) {
+        name = XmlUtil.findLocalNameByQualifiedName(name);
+
+        if (!name.equals(text)) {
+          if (tag instanceof HtmlTag) {
+            return; // it is legal to have html / head / body omitted
+          }
+          final LocalQuickFix localQuickFix = new MyLocalQuickFix(doctype.getNameElement().getText());
+
+          holder.registerProblem(XmlChildRole.START_TAG_NAME_FINDER.findChild(tag.getNode()).getPsi(),
+            XmlErrorMessages.message("wrong.root.element"),
+            ProblemHighlightType.LIKE_UNKNOWN_SYMBOL, localQuickFix
+          );
+
+          final ASTNode astNode = XmlChildRole.CLOSING_TAG_NAME_FINDER.findChild(tag.getNode());
+          if (astNode != null) {
+            holder.registerProblem(astNode.getPsi(),
+              XmlErrorMessages.message("wrong.root.element"),
+              ProblemHighlightType.LIKE_UNKNOWN_SYMBOL, localQuickFix
+            );
+          }
+        }
+      }
+    }
+  }
+
+  private static class MyLocalQuickFix implements LocalQuickFix {
+    private final String myText;
+
+    public MyLocalQuickFix(String text) {
+      myText = text;
+    }
+
+    @NotNull
+    public String getName() {
+      return XmlBundle.message("change.root.element.to", myText);
+    }
+
+    @NotNull
+    public String getFamilyName() {
+      return getName();
+    }
+
+    public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
+      final XmlTag myTag = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), XmlTag.class);
+
+      if (!CodeInsightUtilBase.prepareFileForWrite(myTag.getContainingFile())) {
+        return;
+      }
+
+      new WriteCommandAction(project) {
+        protected void run(final Result result) throws Throwable {
+          myTag.setName(myText);
+        }
+      }.execute();
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/featureStatistics/XmlProductivityFeatureProvider.java b/xml/impl/src/com/intellij/featureStatistics/XmlProductivityFeatureProvider.java
new file mode 100644
index 0000000..78d4479
--- /dev/null
+++ b/xml/impl/src/com/intellij/featureStatistics/XmlProductivityFeatureProvider.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.featureStatistics;
+
+import com.intellij.codeInsight.completion.XmlCompletionContributor;
+import com.intellij.xml.XmlBundle;
+
+import java.util.Collections;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlProductivityFeatureProvider extends ProductivityFeaturesProvider {
+  public FeatureDescriptor[] getFeatureDescriptors() {
+    return new FeatureDescriptor[] { new FeatureDescriptor(XmlCompletionContributor.TAG_NAME_COMPLETION_FEATURE,
+                                                           "completion",
+                                                           "TagNameCompletion.html",
+                                                           XmlBundle.message("tag.name.completion.display.name"),
+                                                           0,
+                                                           1,
+                                                           Collections.<String>emptySet(),
+                                                           3,
+                                                           this)};
+  }
+
+  public GroupDescriptor[] getGroupDescriptors() {
+    return new GroupDescriptor[0];
+  }
+
+  public ApplicabilityFilter[] getApplicabilityFilters() {
+    return new ApplicabilityFilter[0];
+  }
+}
diff --git a/xml/impl/src/com/intellij/html/HtmlLineMarkerProvider.java b/xml/impl/src/com/intellij/html/HtmlLineMarkerProvider.java
new file mode 100644
index 0000000..a9c9a33
--- /dev/null
+++ b/xml/impl/src/com/intellij/html/HtmlLineMarkerProvider.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.html;
+
+import com.intellij.codeInsight.daemon.LineMarkerInfo;
+import com.intellij.codeInsight.daemon.LineMarkerProvider;
+import com.intellij.codeInsight.daemon.LineMarkerProviders;
+import com.intellij.lang.Language;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiWhiteSpace;
+import gnu.trove.THashMap;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Maxim.Mossienko
+ *         Date: Oct 14, 2008
+ *         Time: 11:38:46 PM
+ */
+public class HtmlLineMarkerProvider implements LineMarkerProvider {
+  private final Map<Language, LineMarkerProvider> embeddedLanguagesLineMarkerProviders = new THashMap<Language, LineMarkerProvider>();
+
+  public LineMarkerInfo getLineMarkerInfo(@NotNull final PsiElement element) {
+    if (element instanceof PsiWhiteSpace) return null;
+    final Language language = element.getLanguage();
+
+    if (!(language instanceof XMLLanguage)) {
+      final LineMarkerProvider markerProvider = getLineMarkerProviderFromLanguage(language, embeddedLanguagesLineMarkerProviders);
+
+      if (markerProvider != null) return markerProvider.getLineMarkerInfo(element);
+    }
+    return null;
+  }
+
+  private static LineMarkerProvider getLineMarkerProviderFromLanguage(final Language language,
+                                                               final Map<Language, LineMarkerProvider> embeddedLanguagesLineMarkerProviders) {
+    final LineMarkerProvider markerProvider;
+
+    if (!embeddedLanguagesLineMarkerProviders.containsKey(language)) {
+      embeddedLanguagesLineMarkerProviders.put(language, markerProvider = LineMarkerProviders.INSTANCE.forLanguage(language));
+    } else {
+      markerProvider = embeddedLanguagesLineMarkerProviders.get(language);
+    }
+    return markerProvider;
+  }
+
+  public void collectSlowLineMarkers(@NotNull final List<PsiElement> elements, @NotNull final Collection<LineMarkerInfo> result) {
+    Map<Language, LineMarkerProvider> localEmbeddedLanguagesLineMarkerProviders = null;
+    Map<LineMarkerProvider, List<PsiElement>> embeddedLineMarkersWorkItems = null;
+
+    for(PsiElement element:elements) {
+      if(element instanceof PsiWhiteSpace) continue;
+      final Language language = element.getLanguage();
+
+      if (!(language instanceof XMLLanguage)) {
+        if(localEmbeddedLanguagesLineMarkerProviders == null) {
+          localEmbeddedLanguagesLineMarkerProviders = new THashMap<Language, LineMarkerProvider>();
+        }
+
+        final LineMarkerProvider lineMarkerProvider = getLineMarkerProviderFromLanguage(language, localEmbeddedLanguagesLineMarkerProviders);
+
+        if (lineMarkerProvider != null) {
+          if (embeddedLineMarkersWorkItems == null) embeddedLineMarkersWorkItems = new THashMap<LineMarkerProvider, List<PsiElement>>();
+          List<PsiElement> elementList = embeddedLineMarkersWorkItems.get(lineMarkerProvider);
+
+          if (elementList == null) {
+            elementList = new ArrayList<PsiElement>(5);
+            embeddedLineMarkersWorkItems.put(lineMarkerProvider, elementList);
+          }
+
+          elementList.add(element);
+        }
+      }
+    }
+
+    if (embeddedLineMarkersWorkItems != null) {
+      for(Map.Entry<LineMarkerProvider, List<PsiElement>> entry:embeddedLineMarkersWorkItems.entrySet()) {
+        entry.getKey().collectSlowLineMarkers(entry.getValue(), result);
+      }
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/html/impl/Html5CustomAttributeDescriptorsProvider.java b/xml/impl/src/com/intellij/html/impl/Html5CustomAttributeDescriptorsProvider.java
new file mode 100644
index 0000000..a75e395
--- /dev/null
+++ b/xml/impl/src/com/intellij/html/impl/Html5CustomAttributeDescriptorsProvider.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.html.impl;
+
+import com.intellij.html.index.Html5CustomAttributesIndex;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.Processor;
+import com.intellij.util.indexing.FileBasedIndex;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlAttributeDescriptorsProvider;
+import com.intellij.xml.impl.schema.AnyXmlAttributeDescriptor;
+import com.intellij.xml.util.HtmlUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class Html5CustomAttributeDescriptorsProvider implements XmlAttributeDescriptorsProvider {
+  @Override
+  public XmlAttributeDescriptor[] getAttributeDescriptors(XmlTag tag) {
+    if (tag == null || !HtmlUtil.isHtml5Context(tag)) {
+      return XmlAttributeDescriptor.EMPTY;
+    }
+    final List<String> currentAttrs = new ArrayList<String>();
+    for (XmlAttribute attribute : tag.getAttributes()) {
+      currentAttrs.add(attribute.getName());
+    }
+    final List<XmlAttributeDescriptor> result = new ArrayList<XmlAttributeDescriptor>();
+    FileBasedIndex.getInstance().processAllKeys(Html5CustomAttributesIndex.INDEX_ID, new Processor<String>() {
+      @Override
+      public boolean process(String s) {
+        boolean add = true;
+        for (String attr : currentAttrs) {
+          if (attr.startsWith(s)) {
+            add = false;
+          }
+        }
+        if (add) {
+          result.add(new AnyXmlAttributeDescriptor(s));
+        }
+        return true;
+      }
+    }, tag.getProject());
+
+    return result.toArray(new XmlAttributeDescriptor[result.size()]);
+  }
+
+  @Override
+  public XmlAttributeDescriptor getAttributeDescriptor(String attributeName, XmlTag context) {
+    if (context != null && HtmlUtil.isHtml5Context(context) && HtmlUtil.isCustomHtml5Attribute(attributeName)) {
+      return new AnyXmlAttributeDescriptor(attributeName);
+    }
+    return null;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaElementDescriptor.java b/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaElementDescriptor.java
new file mode 100644
index 0000000..52a1920
--- /dev/null
+++ b/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaElementDescriptor.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.html.impl;
+
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.*;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import com.intellij.xml.impl.schema.XmlElementDescriptorImpl;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class RelaxedHtmlFromSchemaElementDescriptor extends XmlElementDescriptorImpl {
+
+  RelaxedHtmlFromSchemaElementDescriptor(XmlTag tag) {
+    super(tag);
+  }
+
+  public XmlElementDescriptor getElementDescriptor(XmlTag childTag, XmlTag contextTag) {
+    XmlElementDescriptor elementDescriptor = super.getElementDescriptor(childTag, contextTag);
+
+    if (elementDescriptor == null) {
+      return getRelaxedDescriptor(this, childTag);
+    }
+
+    return elementDescriptor;
+  }
+
+  public XmlElementDescriptor[] getElementsDescriptors(final XmlTag context) {
+    return ArrayUtil.mergeArrays(
+      super.getElementsDescriptors(context),
+      HtmlUtil.getCustomTagDescriptors(context)
+    );
+  }
+
+  public static XmlElementDescriptor getRelaxedDescriptor(XmlElementDescriptor base, final XmlTag childTag) {
+    final String namespace = childTag.getNamespace();
+    final XmlExtension extension = XmlExtension.getExtensionByElement(childTag);
+    if(!XmlUtil.XHTML_URI.equals(namespace) && 
+       ( base.getContentType() != XmlElementDescriptor.CONTENT_TYPE_EMPTY ||
+         (extension != null && extension.isCustomTagAllowed(childTag)) // allow custom tag
+       ) ) {
+      return new AnyXmlElementDescriptor(base,childTag.getNSDescriptor(namespace,true));
+    }
+    return null;
+  }
+
+  public XmlAttributeDescriptor[] getAttributesDescriptors(final XmlTag context) {
+    return addAttrDescriptorsForFacelets(context, super.getAttributesDescriptors(context));
+  }
+
+  public static XmlAttributeDescriptor[] addAttrDescriptorsForFacelets(final XmlTag context,
+                                                                       XmlAttributeDescriptor[] descriptors) {
+    if (context == null) {
+      return descriptors;
+    }
+    for (XmlAttributeDescriptorsProvider provider: Extensions.getExtensions(XmlAttributeDescriptorsProvider.EP_NAME)) {
+      descriptors = ArrayUtil.mergeArrays(descriptors, provider.getAttributeDescriptors(context), XmlAttributeDescriptor.ARRAY_FACTORY);
+    }
+    return descriptors;
+  }
+
+  @Override
+  public XmlAttributeDescriptor getAttributeDescriptor(XmlAttribute attribute) {
+    return getAttributeDescriptor(attribute.getName(), attribute.getParent());
+  }
+
+  public XmlAttributeDescriptor getAttributeDescriptor(String attributeName, final XmlTag context) {
+    final XmlAttributeDescriptor descriptor = super.getAttributeDescriptor(attributeName.toLowerCase(), context);
+    if (descriptor != null) return descriptor;
+
+    return getAttributeDescriptorFromFacelets(attributeName, context);
+  }
+
+  @Nullable
+  public static XmlAttributeDescriptor getAttributeDescriptorFromFacelets(final String attributeName, final XmlTag context) {
+    if (context == null) {
+      return null;
+    }
+    for (XmlAttributeDescriptorsProvider provider: Extensions.getExtensions(XmlAttributeDescriptorsProvider.EP_NAME)) {
+      final XmlAttributeDescriptor descriptor = provider.getAttributeDescriptor(attributeName, context);
+      if (descriptor != null) {
+        return descriptor;
+      }
+    }
+    return null;
+  }
+
+  public boolean allowElementsFromNamespace(final String namespace, final XmlTag context) {
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaNSDescriptor.java b/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaNSDescriptor.java
new file mode 100644
index 0000000..06a9bc97
--- /dev/null
+++ b/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaNSDescriptor.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.html.impl;
+
+import com.intellij.html.RelaxedHtmlNSDescriptor;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import com.intellij.xml.impl.schema.XmlNSDescriptorImpl;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class RelaxedHtmlFromSchemaNSDescriptor extends XmlNSDescriptorImpl implements RelaxedHtmlNSDescriptor {
+  public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
+    XmlElementDescriptor elementDescriptor = super.getElementDescriptor(tag);
+
+    String namespace;
+    if (elementDescriptor == null && 
+        !((namespace = tag.getNamespace()).equals(XmlUtil.XHTML_URI))) {
+      return new AnyXmlElementDescriptor(
+        null, 
+        XmlUtil.HTML_URI.equals(namespace) ? this : tag.getNSDescriptor(tag.getNamespace(), true)
+      );
+    }
+
+    return elementDescriptor;
+  }
+
+  protected XmlElementDescriptor createElementDescriptor(final XmlTag tag) {
+    return new RelaxedHtmlFromSchemaElementDescriptor(tag);
+  }
+
+  @NotNull
+  public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable final XmlDocument doc) {
+    return ArrayUtil.mergeArrays(super.getRootElementsDescriptors(doc), HtmlUtil.getCustomTagDescriptors(doc));
+  }
+}
diff --git a/xml/impl/src/com/intellij/html/index/Html5CustomAttributesIndex.java b/xml/impl/src/com/intellij/html/index/Html5CustomAttributesIndex.java
new file mode 100644
index 0000000..152018c
--- /dev/null
+++ b/xml/impl/src/com/intellij/html/index/Html5CustomAttributesIndex.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.html.index;
+
+import com.intellij.lang.Language;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.xhtml.XHTMLLanguage;
+import com.intellij.lexer.HtmlHighlightingLexer;
+import com.intellij.lexer.Lexer;
+import com.intellij.lexer.XHtmlHighlightingLexer;
+import com.intellij.openapi.fileTypes.LanguageFileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.ex.temp.TempFileSystem;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.containers.HashMap;
+import com.intellij.util.indexing.*;
+import com.intellij.util.io.EnumeratorStringDescriptor;
+import com.intellij.util.io.KeyDescriptor;
+import com.intellij.xml.util.HtmlUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class Html5CustomAttributesIndex extends ScalarIndexExtension<String> {
+  public static final ID<String, Void> INDEX_ID = ID.create("html5.custom.attributes.index");
+
+  private final DataIndexer<String, Void, FileContent> myIndexer = new DataIndexer<String, Void, FileContent>() {
+    @Override
+    @NotNull
+    public Map<String, Void> map(FileContent inputData) {
+      CharSequence input = inputData.getContentAsText();
+      Language language = ((LanguageFileType)inputData.getFileType()).getLanguage();
+      if (language == HTMLLanguage.INSTANCE || language == XHTMLLanguage.INSTANCE) {
+        final Lexer lexer = (language == HTMLLanguage.INSTANCE ? new HtmlHighlightingLexer() : new XHtmlHighlightingLexer());
+        lexer.start(input);
+        Map<String, Void> result = new HashMap<String, Void>();
+        IElementType tokenType = lexer.getTokenType();
+        while (tokenType != null) {
+          if (tokenType == XmlTokenType.XML_NAME) {
+            String xmlName = input.subSequence(lexer.getTokenStart(), lexer.getTokenEnd()).toString();
+            if (HtmlUtil.isCustomHtml5Attribute(xmlName)) {
+              result.put(xmlName, null);
+            }
+          }
+          else if (tokenType == XmlTokenType.XML_DOCTYPE_PUBLIC || tokenType == XmlTokenType.XML_DOCTYPE_SYSTEM) {
+            // this is not an HTML5 context
+            break;
+          }
+          lexer.advance();
+          tokenType = lexer.getTokenType();
+        }
+        return result;
+      }
+      return Collections.emptyMap();
+    }
+  };
+
+  private final FileBasedIndex.InputFilter myInputFilter = new FileBasedIndex.InputFilter() {
+    @Override
+    public boolean acceptInput(final VirtualFile file) {
+      return (file.getFileSystem() == LocalFileSystem.getInstance() || file.getFileSystem() instanceof TempFileSystem) &&
+             file.getFileType() == StdFileTypes.HTML || file.getFileType() == StdFileTypes.XHTML;
+    }
+  };
+
+  @NotNull
+  @Override
+  public ID<String, Void> getName() {
+    return INDEX_ID;
+  }
+
+  @NotNull
+  @Override
+  public DataIndexer<String, Void, FileContent> getIndexer() {
+    return myIndexer;
+  }
+
+  @Override
+  public KeyDescriptor<String> getKeyDescriptor() {
+    return new EnumeratorStringDescriptor();
+  }
+
+  @Override
+  public FileBasedIndex.InputFilter getInputFilter() {
+    return myInputFilter;
+  }
+
+  @Override
+  public boolean dependsOnFileContent() {
+    return true;
+  }
+
+  @Override
+  public int getVersion() {
+    return 1;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/actions/CreateHtmlFileAction.java b/xml/impl/src/com/intellij/ide/actions/CreateHtmlFileAction.java
new file mode 100644
index 0000000..cbf690c
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/actions/CreateHtmlFileAction.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.actions;
+
+import com.intellij.ide.fileTemplates.FileTemplateManager;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.project.DumbAware;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiDirectory;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NonNls;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class CreateHtmlFileAction extends CreateFileFromTemplateAction implements DumbAware {
+
+  @NonNls private static final String DEFAULT_HTML_TEMPLATE_PROPERTY = "DefaultHtmlFileTemplate";
+
+  public CreateHtmlFileAction() {
+    super(XmlBundle.message("new.html.file.action"), XmlBundle.message("new.html.file.action.description"), StdFileTypes.HTML.getIcon());
+  }
+
+  @Override
+  protected String getDefaultTemplateProperty() {
+    return DEFAULT_HTML_TEMPLATE_PROPERTY;
+  }
+
+  @Override
+  protected void buildDialog(Project project, PsiDirectory directory, CreateFileFromTemplateDialog.Builder builder) {
+    builder
+      .setTitle(XmlBundle.message("new.html.file.action"))
+      .addKind("HTML file", StdFileTypes.HTML.getIcon(), FileTemplateManager.INTERNAL_HTML5_TEMPLATE_NAME)
+      .addKind("HTML4 file", StdFileTypes.HTML.getIcon(), FileTemplateManager.INTERNAL_HTML_TEMPLATE_NAME)
+      .addKind("XHTML file", StdFileTypes.XHTML.getIcon(), FileTemplateManager.INTERNAL_XHTML_TEMPLATE_NAME);
+  }
+
+  @Override
+  protected String getActionName(PsiDirectory directory, String newName, String templateName) {
+    return XmlBundle.message("new.html.file.action");
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    return obj instanceof CreateHtmlFileAction;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/BrowserSelector.java b/xml/impl/src/com/intellij/ide/browsers/BrowserSelector.java
new file mode 100644
index 0000000..7733e8d
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/BrowserSelector.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers;
+
+import com.intellij.ide.BrowserSettings;
+import com.intellij.ui.ListCellRendererWrapper;
+import com.intellij.openapi.options.ShowSettingsUtil;
+import com.intellij.openapi.ui.ComboBox;
+import com.intellij.openapi.util.IconLoader;
+import com.intellij.ui.ComboboxWithBrowseButton;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.PlatformIcons;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author nik
+ */
+public class BrowserSelector {
+  private ComboboxWithBrowseButton myBrowserComboWithBrowse;
+  private boolean myAllowDefaultBrowser;
+
+  public BrowserSelector(boolean allowDefaultBrowser) {
+    myAllowDefaultBrowser = allowDefaultBrowser;
+    myBrowserComboWithBrowse = new ComboboxWithBrowseButton(new ComboBox());
+    myBrowserComboWithBrowse.addActionListener(new ActionListener() {
+      public void actionPerformed(ActionEvent e) {
+        final ShowSettingsUtil util = ShowSettingsUtil.getInstance();
+        util.editConfigurable(myBrowserComboWithBrowse, new BrowserSettings());
+
+        final BrowsersConfiguration.BrowserFamily selectedItem = getSelectedBrowser();
+        initBrowsersComboModel();
+        if (selectedItem != null) {
+          setSelectedBrowser(selectedItem);
+        }
+      }
+    });
+
+    final JComboBox comboBox = myBrowserComboWithBrowse.getComboBox();
+    comboBox.setRenderer(new ListCellRendererWrapper<BrowsersConfiguration.BrowserFamily>() {
+      @Override
+      public void customize(JList list,
+                            BrowsersConfiguration.BrowserFamily value,
+                            int index,
+                            boolean selected,
+                            boolean hasFocus) {
+        final Icon baseIcon = value != null ? value.getIcon() : PlatformIcons.WEB_ICON;
+        final Icon icon = myBrowserComboWithBrowse.isEnabled() ? baseIcon : IconLoader.getDisabledIcon(baseIcon);
+        setIcon(icon);
+        setText(value != null ? value.getName() : "Default");
+      }
+    });
+
+    initBrowsersComboModel();
+  }
+
+  public JComponent getMainComponent() {
+    return myBrowserComboWithBrowse;
+  }
+
+  private void initBrowsersComboModel() {
+    final List<BrowsersConfiguration.BrowserFamily> activeBrowsers = new ArrayList<BrowsersConfiguration.BrowserFamily>();
+    if (myAllowDefaultBrowser) {
+      activeBrowsers.add(null);
+    }
+    activeBrowsers.addAll(BrowsersConfiguration.getInstance().getActiveBrowsers());
+
+    myBrowserComboWithBrowse.getComboBox().setModel(new DefaultComboBoxModel(ArrayUtil.toObjectArray(activeBrowsers)));
+  }
+
+  @Nullable
+  public BrowsersConfiguration.BrowserFamily getSelectedBrowser() {
+    return (BrowsersConfiguration.BrowserFamily)myBrowserComboWithBrowse.getComboBox().getSelectedItem();
+  }
+
+  @Nullable
+  public String getSelectedBrowserFamilyName() {
+    final BrowsersConfiguration.BrowserFamily browser = getSelectedBrowser();
+    return browser != null ? browser.getName() : null;
+  }
+
+  public void setSelectedBrowser(@Nullable BrowsersConfiguration.BrowserFamily selectedItem) {
+    myBrowserComboWithBrowse.getComboBox().setSelectedItem(selectedItem);
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/BrowserSettingsProviderImpl.java b/xml/impl/src/com/intellij/ide/browsers/BrowserSettingsProviderImpl.java
new file mode 100644
index 0000000..e639095
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/BrowserSettingsProviderImpl.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers;
+
+import com.intellij.ide.BrowserSettingsProvider;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.options.ConfigurationException;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+/**
+ * @author spleaner
+ */
+public class BrowserSettingsProviderImpl extends BrowserSettingsProvider {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.ide.browsers.BrowserSettingsProviderImpl");
+  
+  private WebBrowsersPanel mySettingsPanel;
+  private final BrowsersConfiguration myConfiguration;
+
+  public BrowserSettingsProviderImpl(@NotNull final BrowsersConfiguration configuration) {
+    myConfiguration = configuration;
+  }
+
+  @Override
+  public void applySettingsFromWindowsRegistry() {
+    if (mySettingsPanel != null)
+      mySettingsPanel.applySettingsFromWindowsRegistry();
+  }
+
+  public JComponent createComponent() {
+    if (mySettingsPanel == null) {
+      mySettingsPanel = new WebBrowsersPanel(myConfiguration);
+    }
+
+    return mySettingsPanel;
+  }
+
+  public boolean isModified() {
+    LOG.assertTrue(mySettingsPanel != null);
+    return mySettingsPanel.isModified();
+  }
+
+  public void apply() throws ConfigurationException {
+    LOG.assertTrue(mySettingsPanel != null);
+    mySettingsPanel.apply();
+  }
+
+  public void reset() {
+    LOG.assertTrue(mySettingsPanel != null);
+    mySettingsPanel.reset();
+  }
+
+  public void disposeUIResources() {
+    mySettingsPanel.dispose();
+    mySettingsPanel = null;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/BrowserSpecificSettings.java b/xml/impl/src/com/intellij/ide/browsers/BrowserSpecificSettings.java
new file mode 100644
index 0000000..2af780a
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/BrowserSpecificSettings.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers;
+
+import com.intellij.openapi.options.Configurable;
+import com.intellij.util.ArrayUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.NonNls;
+
+/**
+ * @author nik
+ */
+public abstract class BrowserSpecificSettings {
+
+  public abstract Configurable createConfigurable();
+
+  @NotNull @NonNls
+  public String[] getAdditionalParameters() {
+    return ArrayUtil.EMPTY_STRING_ARRAY;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/BrowsersConfiguration.java b/xml/impl/src/com/intellij/ide/browsers/BrowsersConfiguration.java
new file mode 100644
index 0000000..4702fe6
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/BrowsersConfiguration.java
@@ -0,0 +1,282 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.ide.BrowserUtil;
+import com.intellij.ide.browsers.chrome.ChromeSettings;
+import com.intellij.ide.browsers.firefox.FirefoxSettings;
+import com.intellij.ide.browsers.impl.DefaultUrlOpener;
+import com.intellij.openapi.components.*;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
+import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.util.io.WindowsRegistryUtil;
+import com.intellij.util.containers.HashMap;
+import com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters;
+import com.intellij.util.xmlb.XmlSerializer;
+import com.intellij.xml.XmlBundle;
+import org.jdom.Element;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author spleaner
+ */
+@State(name = "WebBrowsersConfiguration", storages = {@Storage(file = StoragePathMacros.APP_CONFIG + "/browsers.xml")})
+public class BrowsersConfiguration implements PersistentStateComponent<Element> {
+  public enum BrowserFamily {
+    EXPLORER(XmlBundle.message("browsers.explorer"), "iexplore", null, null, AllIcons.Xml.Browsers.Explorer16),
+    SAFARI(XmlBundle.message("browsers.safari"), "safari", null, "Safari", AllIcons.Xml.Browsers.Safari16),
+    OPERA(XmlBundle.message("browsers.opera"), "opera", "opera", "Opera", AllIcons.Xml.Browsers.Opera16),
+    FIREFOX(XmlBundle.message("browsers.firefox"), "firefox", "firefox", "Firefox", AllIcons.Xml.Browsers.Firefox16) {
+      @Override
+      public BrowserSpecificSettings createBrowserSpecificSettings() {
+        return new FirefoxSettings();
+      }
+    },
+    CHROME(XmlBundle.message("browsers.chrome"), "chrome", "google-chrome", "Google Chrome", AllIcons.Xml.Browsers.Chrome16) {
+      @Override
+      public BrowserSpecificSettings createBrowserSpecificSettings() {
+        return new ChromeSettings();
+      }
+    };
+
+    private final String myName;
+    private final String myWindowsPath;
+    private final String myUnixPath;
+    private final String myMacPath;
+    private final Icon myIcon;
+
+    BrowserFamily(final String name,
+                  @NonNls final String windowsPath,
+                  @NonNls final String unixPath,
+                  @NonNls final String macPath,
+                  final Icon icon) {
+      myName = name;
+      myWindowsPath = windowsPath;
+      myUnixPath = unixPath;
+      myMacPath = macPath;
+      myIcon = icon;
+    }
+
+    @Nullable
+    public BrowserSpecificSettings createBrowserSpecificSettings() {
+      return null;
+    }
+
+    @Nullable
+    public String getExecutionPath() {
+      if (SystemInfo.isWindows) {
+        return myWindowsPath;
+      }
+      else if (SystemInfo.isMac) {
+        return myMacPath;
+      }
+      else if (SystemInfo.isUnix) {
+        return myUnixPath;
+      }
+
+      return null;
+    }
+
+    public String getName() {
+      return myName;
+    }
+
+    public Icon getIcon() {
+      return myIcon;
+    }
+  }
+
+  private final Map<BrowserFamily, WebBrowserSettings> myBrowserToSettingsMap = new HashMap<BrowserFamily, WebBrowserSettings>();
+
+  @SuppressWarnings({"HardCodedStringLiteral"})
+  public Element getState() {
+    @NonNls Element element = new Element("WebBrowsersConfiguration");
+    for (BrowserFamily browserFamily : myBrowserToSettingsMap.keySet()) {
+      final Element browser = new Element("browser");
+      browser.setAttribute("family", browserFamily.toString());
+      final WebBrowserSettings value = myBrowserToSettingsMap.get(browserFamily);
+      browser.setAttribute("path", value.getPath());
+      browser.setAttribute("active", Boolean.toString(value.isActive()));
+      final BrowserSpecificSettings specificSettings = value.getBrowserSpecificSettings();
+      if (specificSettings != null) {
+        final Element settingsElement = new Element("settings");
+        XmlSerializer.serializeInto(specificSettings, settingsElement, new SkipDefaultValuesSerializationFilters());
+        browser.addContent(settingsElement);
+      }
+      element.addContent(browser);
+    }
+
+    return element;
+  }
+
+  @SuppressWarnings({"unchecked"})
+  public void loadState(@NonNls Element element) {
+    for (@NonNls Element child : (Iterable<? extends Element>)element.getChildren("browser")) {
+      String family = child.getAttributeValue("family");
+      final String path = child.getAttributeValue("path");
+      final String active = child.getAttributeValue("active");
+      final BrowserFamily browserFamily;
+      Element settingsElement = child.getChild("settings");
+
+      try {
+        browserFamily = BrowserFamily.valueOf(family);
+        BrowserSpecificSettings specificSettings = null;
+        if (settingsElement != null) {
+          specificSettings = browserFamily.createBrowserSpecificSettings();
+          XmlSerializer.deserializeInto(specificSettings, settingsElement);
+        }
+        myBrowserToSettingsMap.put(browserFamily, new WebBrowserSettings(path, Boolean.parseBoolean(active), specificSettings));
+      }
+      catch (IllegalArgumentException e) {
+        // skip
+      }
+    }
+  }
+
+  public List<BrowserFamily> getActiveBrowsers() {
+    final List<BrowserFamily> browsers = new ArrayList<BrowserFamily>();
+    for (BrowserFamily family : BrowserFamily.values()) {
+      if (getBrowserSettings(family).isActive()) {
+        browsers.add(family);
+      }
+    }
+    return browsers;
+  }
+
+  public void updateBrowserValue(final BrowserFamily family, final String path, boolean isActive) {
+    final WebBrowserSettings settings = getBrowserSettings(family);
+    myBrowserToSettingsMap.put(family, new WebBrowserSettings(path, isActive, settings.getBrowserSpecificSettings()));
+  }
+
+  public void updateBrowserSpecificSettings(BrowserFamily family, BrowserSpecificSettings specificSettings) {
+    final WebBrowserSettings settings = getBrowserSettings(family);
+    myBrowserToSettingsMap.put(family, new WebBrowserSettings(settings.getPath(), settings.isActive(), specificSettings));
+  }
+
+  @NotNull
+  public WebBrowserSettings getBrowserSettings(@NotNull final BrowserFamily browserFamily) {
+    WebBrowserSettings result = myBrowserToSettingsMap.get(browserFamily);
+    if (result == null) {
+      final String path = browserFamily.getExecutionPath();
+      result = new WebBrowserSettings(path == null ? "" : path, path != null, null);
+      myBrowserToSettingsMap.put(browserFamily, result);
+    }
+
+    return result;
+  }
+
+  public static BrowsersConfiguration getInstance() {
+    return ServiceManager.getService(BrowsersConfiguration.class);
+  }
+
+  public static void launchBrowser(final @Nullable BrowserFamily family, @NotNull final String url) {
+    if (family == null) {
+      BrowserUtil.launchBrowser(url);
+    }
+    else {
+      for (UrlOpener urlOpener : UrlOpener.EP_NAME.getExtensions()) {
+        if (urlOpener.openUrl(family, url)) {
+          return;
+        }
+      }
+    }
+  }
+
+  public static void launchBrowser(final @NotNull BrowserFamily family, @NotNull final String url, String... parameters) {
+    launchBrowser(family, url, false, parameters);
+  }
+
+  public static void launchBrowser(final @NotNull BrowserFamily family,
+                                   @Nullable final String url,
+                                   final boolean forceOpenNewInstanceOnMac,
+                                   String... parameters) {
+    DefaultUrlOpener.launchBrowser(family, url, parameters, Conditions.<String>alwaysTrue(), forceOpenNewInstanceOnMac);
+  }
+
+  public static void launchBrowser(final @NotNull BrowserFamily family,
+                                   @NotNull final String url,
+                                   final boolean forceOpenNewInstanceOnMac,
+                                   final Condition<String> browserSpecificParametersFilter,
+                                   String... parameters) {
+    DefaultUrlOpener.launchBrowser(family, url, parameters, browserSpecificParametersFilter, forceOpenNewInstanceOnMac);
+  }
+
+  @Nullable
+  public static BrowserFamily findFamilyByName(@Nullable String name) {
+    for (BrowserFamily family : BrowserFamily.values()) {
+      if (family.getName().equals(name)) {
+        return family;
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Gets data from Windows registry, may take some time to run (up to ~300ms)
+   *
+   * @return Map[BrowserFamily -> "path to .exe"]
+   */
+  @NotNull
+  public static EnumMap<BrowserFamily, String> getWindowsBrowsersEXE() {
+    EnumMap<BrowserFamily, String> map = new EnumMap<BrowserFamily, String>(BrowserFamily.class);
+    if (SystemInfo.isWindows) {
+      List<String> sections = WindowsRegistryUtil.readRegistryBranch("HKEY_LOCAL_MACHINE\\SOFTWARE\\Clients\\StartMenuInternet");
+      for (String section : sections) {
+        BrowserFamily family = getFamily(section);
+        if (family == null) {
+          continue; //We ignore "unknown" browsers like Maxthon, RockMelt, SeaMonkey, Deepnet Explorer, Avant Browser etc.
+        }
+        String pathToExe = WindowsRegistryUtil.readRegistryDefault(
+          "HKLM\\SOFTWARE\\Clients\\StartMenuInternet\\" + section + "\\shell\\open\\command");
+        if (pathToExe != null) {
+          map.put(family, pathToExe);
+        }
+      }
+    }
+    return map;
+  }
+
+  @Nullable
+  private static BrowserFamily getFamily(String registryName) {
+    registryName = registryName.toLowerCase();
+    if (registryName.contains("firefox")) {
+      return BrowserFamily.FIREFOX;
+    }
+    if (registryName.contains("iexplore")) {
+      return BrowserFamily.EXPLORER;
+    }
+    if (registryName.contains("opera")) {
+      return BrowserFamily.OPERA;
+    }
+    if (registryName.contains("safari")) {
+      return BrowserFamily.SAFARI;
+    }
+    if (registryName.contains("google")) {
+      return BrowserFamily.CHROME;
+    }
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/OpenFileInBrowserAction.java b/xml/impl/src/com/intellij/ide/browsers/OpenFileInBrowserAction.java
new file mode 100644
index 0000000..2326b1c
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/OpenFileInBrowserAction.java
@@ -0,0 +1,77 @@
+package com.intellij.ide.browsers;
+
+import com.intellij.ide.BrowserUtil;
+import com.intellij.ide.browsers.impl.WebBrowserServiceImpl;
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.DumbAwareAction;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.psi.PsiFile;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.util.HtmlUtil;
+
+import java.awt.event.InputEvent;
+
+public class OpenFileInBrowserAction extends DumbAwareAction {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.ide.browsers.OpenFileInBrowserAction");
+
+  public void update(AnActionEvent e) {
+    final DataContext dataContext = e.getDataContext();
+    final PsiFile file = LangDataKeys.PSI_FILE.getData(dataContext);
+    final Presentation presentation = e.getPresentation();
+
+    if (file != null && file.getVirtualFile() != null) {
+      presentation.setVisible(true);
+
+      final WebBrowserUrlProvider browserUrlProvider = WebBrowserServiceImpl.getProvider(file);
+      final boolean isHtmlFile = HtmlUtil.isHtmlFile(file);
+      presentation.setEnabled(browserUrlProvider != null || isHtmlFile);
+      String text = getTemplatePresentation().getText();
+      String description = getTemplatePresentation().getDescription();
+
+      if (browserUrlProvider != null) {
+        final String customText = browserUrlProvider.getOpenInBrowserActionText(file);
+        if (customText != null) {
+          text = customText;
+        }
+        final String customDescription = browserUrlProvider.getOpenInBrowserActionDescription(file);
+        if (customDescription != null) {
+          description = customDescription;
+        }
+        if (isHtmlFile) {
+          description += " (hold Shift to open URL of local file)";
+        }
+      }
+
+      presentation.setText(text);
+      presentation.setDescription(description);
+      if (ActionPlaces.isPopupPlace(e.getPlace())) {
+        presentation.setVisible(presentation.isEnabled());
+      }
+    } else {
+      presentation.setVisible(false);
+      presentation.setEnabled(false);
+    }
+  }
+
+  public void actionPerformed(AnActionEvent e) {
+    final DataContext dataContext = e.getDataContext();
+    final PsiFile psiFile = LangDataKeys.PSI_FILE.getData(dataContext);
+    LOG.assertTrue(psiFile != null);
+    try {
+      final InputEvent event = e.getInputEvent();
+      final String url = WebBrowserService.getInstance().getUrlToOpen(psiFile, event != null && event.isShiftDown());
+      if (url != null) {
+        ApplicationManager.getApplication().saveAll();
+        BrowserUtil.launchBrowser(url);
+      }
+    }
+    catch (WebBrowserUrlProvider.BrowserException e1) {
+      Messages.showErrorDialog(e1.getMessage(), XmlBundle.message("browser.error"));
+    }
+    catch (Exception e1) {
+      LOG.error(e1);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/OpenUrlHyperlinkInfo.java b/xml/impl/src/com/intellij/ide/browsers/OpenUrlHyperlinkInfo.java
new file mode 100644
index 0000000..880afc2
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/OpenUrlHyperlinkInfo.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers;
+
+import com.intellij.execution.filters.HyperlinkWithPopupMenuInfo;
+import com.intellij.ide.BrowserUtil;
+import com.intellij.openapi.actionSystem.ActionGroup;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.DefaultActionGroup;
+import com.intellij.openapi.ide.CopyPasteManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Condition;
+import com.intellij.util.PlatformIcons;
+import org.jetbrains.annotations.NotNull;
+
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.MouseEvent;
+
+/**
+ * @author nik
+ */
+public class OpenUrlHyperlinkInfo implements HyperlinkWithPopupMenuInfo {
+  private String myUrl;
+  private final Condition<BrowsersConfiguration.BrowserFamily> mySuitableBrowsers;
+
+  public OpenUrlHyperlinkInfo(@NotNull String url) {
+    this(url, Condition.TRUE);
+  }
+
+  public OpenUrlHyperlinkInfo(@NotNull String url, @NotNull Condition<BrowsersConfiguration.BrowserFamily> suitableBrowsers) {
+    myUrl = url;
+    mySuitableBrowsers = suitableBrowsers;
+  }
+
+  @Override
+  public ActionGroup getPopupMenuGroup(@NotNull MouseEvent event) {
+    final DefaultActionGroup group = new DefaultActionGroup();
+    for (BrowsersConfiguration.BrowserFamily family : BrowsersConfiguration.getInstance().getActiveBrowsers()) {
+      if (mySuitableBrowsers.value(family)) {
+        group.add(new OpenUrlInBrowserAction(family));
+      }
+    }
+    group.addAll(new CopyUrlToClipboardAction());
+
+    return group;
+  }
+
+  @Override
+  public void navigate(Project project) {
+    BrowserUtil.launchBrowser(myUrl);
+  }
+
+  private class CopyUrlToClipboardAction extends AnAction {
+    private CopyUrlToClipboardAction() {
+      super("Copy URL", "Copy URL to clipboard", PlatformIcons.COPY_ICON);
+    }
+
+    @Override
+    public void actionPerformed(AnActionEvent e) {
+      CopyPasteManager.getInstance().setContents(new StringSelection(myUrl));
+    }
+  }
+
+  private class OpenUrlInBrowserAction extends AnAction {
+    private final BrowsersConfiguration.BrowserFamily myFamily;
+
+    public OpenUrlInBrowserAction(@NotNull BrowsersConfiguration.BrowserFamily family) {
+      super("Open in " + family.getName(), "Open URL in " + family.getName(), family.getIcon());
+      myFamily = family;
+    }
+
+    @Override
+    public void actionPerformed(AnActionEvent e) {
+      BrowsersConfiguration.launchBrowser(myFamily, myUrl);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/UrlOpener.java b/xml/impl/src/com/intellij/ide/browsers/UrlOpener.java
new file mode 100644
index 0000000..36ba41e
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/UrlOpener.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+
+public abstract class UrlOpener {
+  public static final ExtensionPointName<UrlOpener> EP_NAME = ExtensionPointName.create("org.jetbrains.urlOpener");
+
+  public abstract boolean openUrl(BrowsersConfiguration.BrowserFamily family, String url);
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/WebBrowserSettings.java b/xml/impl/src/com/intellij/ide/browsers/WebBrowserSettings.java
new file mode 100644
index 0000000..e7b391d
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/WebBrowserSettings.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers;
+
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author nik
+ */
+public class WebBrowserSettings {
+  private final String myPath;
+  private final boolean myActive;
+  private final BrowserSpecificSettings myBrowserSpecificSettings;
+
+  public WebBrowserSettings(String path, boolean active, BrowserSpecificSettings browserSpecificSettings) {
+    myPath = path;
+    myActive = active;
+    myBrowserSpecificSettings = browserSpecificSettings;
+  }
+
+  public String getPath() {
+    return myPath;
+  }
+
+  public boolean isActive() {
+    return myActive;
+  }
+
+  @Nullable
+  public BrowserSpecificSettings getBrowserSpecificSettings() {
+    return myBrowserSpecificSettings;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/WebBrowsersPanel.java b/xml/impl/src/com/intellij/ide/browsers/WebBrowsersPanel.java
new file mode 100644
index 0000000..e5f53e7
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/WebBrowsersPanel.java
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers;
+
+import com.intellij.ide.IdeBundle;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.options.ShowSettingsUtil;
+import com.intellij.ui.IdeBorderFactory;
+import com.intellij.util.containers.HashMap;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.EnumMap;
+import java.util.Map;
+import java.util.concurrent.ExecutionException;
+
+/**
+ * @author spleaner
+ */
+public class WebBrowsersPanel extends JPanel {
+  private final JPanel mySettingsPanel;
+  private Map<BrowsersConfiguration.BrowserFamily, Pair<JCheckBox, TextFieldWithBrowseButton>> myBrowserSettingsMap =
+    new HashMap<BrowsersConfiguration.BrowserFamily, Pair<JCheckBox, TextFieldWithBrowseButton>>();
+  private final BrowsersConfiguration myConfiguration;
+
+  public WebBrowsersPanel(final BrowsersConfiguration configuration) {
+    setLayout(new BorderLayout());
+
+    myConfiguration = configuration;
+
+    mySettingsPanel = new JPanel();
+    mySettingsPanel.setLayout(new BoxLayout(mySettingsPanel, BoxLayout.Y_AXIS));
+
+    add(mySettingsPanel, BorderLayout.NORTH);
+
+    createIndividualSettings(BrowsersConfiguration.BrowserFamily.FIREFOX, mySettingsPanel);
+    createIndividualSettings(BrowsersConfiguration.BrowserFamily.EXPLORER, mySettingsPanel);
+    createIndividualSettings(BrowsersConfiguration.BrowserFamily.SAFARI, mySettingsPanel);
+    createIndividualSettings(BrowsersConfiguration.BrowserFamily.CHROME, mySettingsPanel);
+    createIndividualSettings(BrowsersConfiguration.BrowserFamily.OPERA, mySettingsPanel);
+  }
+
+  private void createIndividualSettings(@NotNull final BrowsersConfiguration.BrowserFamily family, final JPanel container) {
+    final JPanel result = new JPanel();
+
+    result.setBorder(IdeBorderFactory.createTitledBorder(family.getName(), true));
+
+    result.setLayout(new BoxLayout(result, BoxLayout.Y_AXIS));
+
+    final TextFieldWithBrowseButton field = new TextFieldWithBrowseButton();
+    FileChooserDescriptor descriptor = SystemInfo.isMac
+                                       ? FileChooserDescriptorFactory.createSingleFolderDescriptor()
+                                       : FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor();
+    field.addBrowseFolderListener(IdeBundle.message("title.select.path.to.browser"), null, null, descriptor);
+
+    result.add(field);
+
+    final JPanel bottomPanel = new JPanel(new BorderLayout());
+
+    final JPanel activePanel = new JPanel();
+    activePanel.setLayout(new BoxLayout(activePanel, BoxLayout.X_AXIS));
+
+    final JCheckBox checkBox = new JCheckBox();
+    activePanel.add(checkBox);
+    final JLabel label = new JLabel(XmlBundle.message("browser.active"));
+    label.setLabelFor(checkBox);
+    activePanel.add(label);
+    bottomPanel.add(activePanel, BorderLayout.WEST);
+
+    final JButton resetButton = new JButton(XmlBundle.message("browser.default.settings"));
+    resetButton.addActionListener(new ActionListener() {
+      public void actionPerformed(final ActionEvent e) {
+        field.getTextField().setText(family.getExecutionPath());
+      }
+    });
+
+    JPanel buttonsPanel = new JPanel(new BorderLayout());
+    if (family.createBrowserSpecificSettings() != null) {
+      final JButton editSettingsButton = new JButton(XmlBundle.message("button.text.settings"));
+      editSettingsButton.addActionListener(new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+          editSettings(family);
+        }
+      });
+      buttonsPanel.add(editSettingsButton, BorderLayout.CENTER);
+    }
+    buttonsPanel.add(resetButton, BorderLayout.EAST);
+
+    bottomPanel.add(buttonsPanel, BorderLayout.EAST);
+
+    result.add(bottomPanel);
+    container.add(result);
+
+    final WebBrowserSettings settings = myConfiguration.getBrowserSettings(family);
+    field.getTextField().setText(settings.getPath());
+    checkBox.setSelected(settings.isActive());
+
+    myBrowserSettingsMap.put(family, Pair.create(checkBox, field));
+  }
+
+  private void editSettings(BrowsersConfiguration.BrowserFamily family) {
+    BrowserSpecificSettings settings = myConfiguration.getBrowserSettings(family).getBrowserSpecificSettings();
+    if (settings == null) {
+      settings = family.createBrowserSpecificSettings();
+    }
+
+    if (ShowSettingsUtil.getInstance().editConfigurable(mySettingsPanel, settings.createConfigurable())) {
+      myConfiguration.updateBrowserSpecificSettings(family, settings);
+    }
+  }
+
+  public void applySettingsFromWindowsRegistry() {
+    if (!SystemInfo.isWindows) {
+      return;
+    }
+    ApplicationManager.getApplication()
+      .executeOnPooledThread(new SwingWorker<EnumMap<BrowsersConfiguration.BrowserFamily, String>, Void>() {
+        @Override
+        protected EnumMap<BrowsersConfiguration.BrowserFamily, String> doInBackground() throws Exception {
+          return BrowsersConfiguration.getWindowsBrowsersEXE();
+        }
+
+        @Override
+        protected void done() {
+          EnumMap<BrowsersConfiguration.BrowserFamily, String> map = null;
+          try {
+            map = get();
+          }
+          catch (InterruptedException ignored) {
+          }
+          catch (ExecutionException ignored) {
+          }
+          if (myBrowserSettingsMap == null) {
+            return;//we are disposed
+          }
+          if (map != null && !map.isEmpty()) {
+            for (BrowsersConfiguration.BrowserFamily family : BrowsersConfiguration.BrowserFamily.values()) {
+              Pair<JCheckBox, TextFieldWithBrowseButton> pair = myBrowserSettingsMap.get(family);
+              String pathToExe = map.get(family);
+              if (pathToExe != null) {
+                pair.first.setSelected(true);
+                pair.second.setText(pathToExe);
+              }
+              else {
+                pair.first.setSelected(false);
+              }
+            }
+          }
+        }
+      });
+  }
+
+
+  public void dispose() {
+    myBrowserSettingsMap = null;
+  }
+
+  public boolean isModified() {
+    for (BrowsersConfiguration.BrowserFamily family : BrowsersConfiguration.BrowserFamily.values()) {
+      final WebBrowserSettings old = myConfiguration.getBrowserSettings(family);
+      final Pair<JCheckBox, TextFieldWithBrowseButton> settings = myBrowserSettingsMap.get(family);
+
+      if (old.isActive() != settings.first.isSelected() || !old.getPath().equals(settings.second.getText())) {
+        return true;
+      }
+    }
+
+    return false;
+  }
+
+  public void apply() {
+    for (BrowsersConfiguration.BrowserFamily family : myBrowserSettingsMap.keySet()) {
+      final Pair<JCheckBox, TextFieldWithBrowseButton> buttonPair = myBrowserSettingsMap.get(family);
+      myConfiguration.updateBrowserValue(family, buttonPair.second.getText(), buttonPair.first.isSelected());
+    }
+  }
+
+  public void reset() {
+    for (BrowsersConfiguration.BrowserFamily family : myBrowserSettingsMap.keySet()) {
+      final Pair<JCheckBox, TextFieldWithBrowseButton> buttonPair = myBrowserSettingsMap.get(family);
+      final WebBrowserSettings settings = myConfiguration.getBrowserSettings(family);
+      buttonPair.first.setSelected(settings.isActive());
+      buttonPair.second.getTextField().setText(settings.getPath());
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/chrome/ChromeSettings.java b/xml/impl/src/com/intellij/ide/browsers/chrome/ChromeSettings.java
new file mode 100644
index 0000000..81f9044
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/chrome/ChromeSettings.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers.chrome;
+
+import com.intellij.execution.configurations.ParametersList;
+import com.intellij.ide.browsers.BrowserSpecificSettings;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.xmlb.annotations.Tag;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author nik
+ */
+public class ChromeSettings extends BrowserSpecificSettings {
+  @NonNls public static final String USER_DATA_DIR_ARG = "--user-data-dir=";
+  private String myCommandLineOptions = "";
+  private String myUserDataDirectoryPath;
+  private boolean myUseCustomProfile;
+
+  public ChromeSettings() {
+  }
+
+  @Nullable
+  @Tag("user-data-dir")
+  public String getUserDataDirectoryPath() {
+    return myUserDataDirectoryPath;
+  }
+
+  @Tag("use-custom-profile")
+  public boolean isUseCustomProfile() {
+    return myUseCustomProfile;
+  }
+
+  @Tag("command-line-options")
+  public String getCommandLineOptions() {
+    return myCommandLineOptions;
+  }
+
+  public void setCommandLineOptions(String commandLineOptions) {
+    myCommandLineOptions = commandLineOptions;
+  }
+
+  public void setUserDataDirectoryPath(String userDataDirectoryPath) {
+    myUserDataDirectoryPath = userDataDirectoryPath;
+  }
+
+  public void setUseCustomProfile(boolean useCustomProfile) {
+    myUseCustomProfile = useCustomProfile;
+  }
+
+  @NotNull
+  @Override
+  public String[] getAdditionalParameters() {
+    String[] cliOptions = ParametersList.parse(myCommandLineOptions);
+    if (myUseCustomProfile && myUserDataDirectoryPath != null) {
+      return ArrayUtil.mergeArrays(cliOptions, USER_DATA_DIR_ARG + FileUtil.toSystemDependentName(myUserDataDirectoryPath));
+    }
+    else {
+      return cliOptions;
+    }
+  }
+
+  @Override
+  public ChromeSettingsConfigurable createConfigurable() {
+    return new ChromeSettingsConfigurable(this);
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/chrome/ChromeSettingsConfigurable.form b/xml/impl/src/com/intellij/ide/browsers/chrome/ChromeSettingsConfigurable.form
new file mode 100644
index 0000000..12051d9
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/chrome/ChromeSettingsConfigurable.form
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.ide.browsers.chrome.ChromeSettingsConfigurable">
+  <grid id="27dc6" binding="myMainPanel" layout-manager="GridLayoutManager" row-count="5" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="20" y="20" width="500" height="400"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <component id="6d1fc" class="javax.swing.JCheckBox" binding="myUseCustomProfileCheckBox">
+        <constraints>
+          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="&amp;Use custom profile directory:"/>
+        </properties>
+      </component>
+      <vspacer id="eb956">
+        <constraints>
+          <grid row="4" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+        </constraints>
+      </vspacer>
+      <component id="e97dd" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myUserDataDirField">
+        <constraints>
+          <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="2" use-parent-layout="false">
+            <preferred-size width="350" height="-1"/>
+          </grid>
+        </constraints>
+        <properties/>
+      </component>
+      <component id="3fc23" class="com.intellij.ui.RawCommandLineEditor" binding="myCommandLineOptionsEditor">
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="7" anchor="0" fill="1" indent="2" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+      </component>
+      <component id="4b3a7" class="javax.swing.JLabel" binding="myCommandLineOptionsLabel">
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="&amp;Command line options:"/>
+        </properties>
+      </component>
+    </children>
+  </grid>
+</form>
diff --git a/xml/impl/src/com/intellij/ide/browsers/chrome/ChromeSettingsConfigurable.java b/xml/impl/src/com/intellij/ide/browsers/chrome/ChromeSettingsConfigurable.java
new file mode 100644
index 0000000..9e8b681
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/chrome/ChromeSettingsConfigurable.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers.chrome;
+
+import com.intellij.openapi.application.PathManager;
+import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
+import com.intellij.openapi.options.Configurable;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.ui.RawCommandLineEditor;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * @author nik
+ */
+public class ChromeSettingsConfigurable implements Configurable {
+  private final ChromeSettings mySettings;
+  private JPanel myMainPanel;
+  private JCheckBox myUseCustomProfileCheckBox;
+  private TextFieldWithBrowseButton myUserDataDirField;
+  private JLabel myCommandLineOptionsLabel;
+  private RawCommandLineEditor myCommandLineOptionsEditor;
+  private final String myDefaultUserDirPath;
+
+  public ChromeSettingsConfigurable(@NotNull ChromeSettings settings) {
+    mySettings = settings;
+    myUserDataDirField.addBrowseFolderListener("Select User Data Directory", "Specifies the directory that user data (your \"profile\") is kept in", null,
+                                               FileChooserDescriptorFactory.createSingleFolderDescriptor());
+    myUseCustomProfileCheckBox.addActionListener(new ActionListener() {
+      @Override
+      public void actionPerformed(ActionEvent e) {
+        myUserDataDirField.setEnabled(myUseCustomProfileCheckBox.isSelected());
+      }
+    });
+    myDefaultUserDirPath = getDefaultUserDataPath();
+    myCommandLineOptionsEditor.setDialogCaption("Chrome Command Line Options");
+    myCommandLineOptionsLabel.setLabelFor(myCommandLineOptionsEditor.getTextField());
+  }
+
+  @Override
+  public JComponent createComponent() {
+    return myMainPanel;
+  }
+
+  @Override
+  public boolean isModified() {
+    if (myUseCustomProfileCheckBox.isSelected() != mySettings.isUseCustomProfile()
+        || !myCommandLineOptionsEditor.getText().equals(mySettings.getCommandLineOptions())) {
+      return true;
+    }
+
+    String configuredPath = getConfiguredUserDataDirPath();
+    String storedPath = mySettings.getUserDataDirectoryPath();
+    if (myDefaultUserDirPath.equals(configuredPath) && storedPath == null) return false;
+    return !configuredPath.equals(storedPath);
+  }
+
+
+  private String getConfiguredUserDataDirPath() {
+    return FileUtil.toSystemIndependentName(myUserDataDirField.getText());
+  }
+
+  @Override
+  public void apply() throws ConfigurationException {
+    mySettings.setCommandLineOptions(myCommandLineOptionsEditor.getText());
+    mySettings.setUseCustomProfile(myUseCustomProfileCheckBox.isSelected());
+    mySettings.setUserDataDirectoryPath(getConfiguredUserDataDirPath());
+  }
+
+  @Override
+  public void reset() {
+    myCommandLineOptionsEditor.setText(mySettings.getCommandLineOptions());
+    myUseCustomProfileCheckBox.setSelected(mySettings.isUseCustomProfile());
+    myUserDataDirField.setEnabled(mySettings.isUseCustomProfile());
+    String path = mySettings.getUserDataDirectoryPath();
+    if (path != null) {
+      myUserDataDirField.setText(FileUtil.toSystemDependentName(path));
+    }
+    else {
+      myUserDataDirField.setText(myDefaultUserDirPath);
+    }
+  }
+
+  public void enableRecommendedOptions() {
+    if (!myUseCustomProfileCheckBox.isSelected()) {
+      myUseCustomProfileCheckBox.doClick(0);
+    }
+  }
+
+  private static String getDefaultUserDataPath() {
+    File dir = new File(PathManager.getConfigPath(), "chrome-user-data");
+    try {
+      return dir.getCanonicalPath();
+    }
+    catch (IOException e) {
+      return dir.getAbsolutePath();
+    }
+  }
+
+  @Override
+  public void disposeUIResources() {
+  }
+
+  @Nls
+  @Override
+  public String getDisplayName() {
+    return "Chrome Settings";
+  }
+
+  @Override
+  public String getHelpTopic() {
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxProfile.java b/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxProfile.java
new file mode 100644
index 0000000..133ee83
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxProfile.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers.firefox;
+
+import java.io.File;
+
+/**
+ * @author nik
+ */
+public class FirefoxProfile {
+  private final String myName;
+  private final String myPath;
+  private final boolean myDefault;
+  private final boolean myRelative;
+
+  public FirefoxProfile(String name, String path, boolean aDefault, boolean relative) {
+    myName = name;
+    myPath = path;
+    myDefault = aDefault;
+    myRelative = relative;
+  }
+
+  public String getName() {
+    return myName;
+  }
+
+  public String getPath() {
+    return myPath;
+  }
+
+  public boolean isRelative() {
+    return myRelative;
+  }
+
+  public boolean isDefault() {
+    return myDefault;
+  }
+
+  public File getProfileDirectory(File profilesIniFile) {
+    return myRelative ? new File(profilesIniFile.getParentFile(), myPath) : new File(myPath);
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxSettings.java b/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxSettings.java
new file mode 100644
index 0000000..618a015
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxSettings.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers.firefox;
+
+import com.intellij.ide.browsers.BrowserSpecificSettings;
+import com.intellij.openapi.options.Configurable;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.xmlb.annotations.Tag;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * @author nik
+ */
+public class FirefoxSettings extends BrowserSpecificSettings {
+  private String myProfilesIniPath;
+  private String myProfile;
+
+  public FirefoxSettings() {
+  }
+
+  public FirefoxSettings(String profilesIniPath, String profile) {
+    myProfilesIniPath = profilesIniPath;
+    myProfile = profile;
+  }
+
+  @Nullable
+  @Tag("profiles-ini-path")
+  public String getProfilesIniPath() {
+    return myProfilesIniPath;
+  }
+
+  public void setProfilesIniPath(String profilesIniPath) {
+    myProfilesIniPath = profilesIniPath;
+  }
+
+  @Nullable
+  @Tag("profile")
+  public String getProfile() {
+    return myProfile;
+  }
+
+  public void setProfile(String profile) {
+    myProfile = profile;
+  }
+
+  @Override
+  public Configurable createConfigurable() {
+    return new FirefoxSettingsConfigurable(this);
+  }
+
+  @Nullable
+  public File getProfilesIniFile() {
+    if (myProfilesIniPath != null) {
+      return new File(FileUtil.toSystemDependentName(myProfilesIniPath));
+    }
+    return FirefoxUtil.getDefaultProfileIniPath();
+  }
+
+  @NotNull
+  @Override
+  public String[] getAdditionalParameters() {
+    final List<FirefoxProfile> profiles = FirefoxUtil.computeProfiles(getProfilesIniFile());
+    if (profiles.size() >= 2) {
+      final FirefoxProfile profile = FirefoxUtil.findProfileByNameOrDefault(myProfile, profiles);
+      if (profile != null && !profile.isDefault()) {
+        return new String[] {"-P", profile.getName()};
+      }
+    }
+    return ArrayUtil.EMPTY_STRING_ARRAY;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxSettingsConfigurable.form b/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxSettingsConfigurable.form
new file mode 100644
index 0000000..bd1e753
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxSettingsConfigurable.form
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.ide.browsers.firefox.FirefoxSettingsConfigurable">
+  <grid id="27dc6" binding="myMainPanel" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="20" y="20" width="500" height="400"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <vspacer id="90b50">
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+        </constraints>
+      </vspacer>
+      <grid id="735f0" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <border type="none"/>
+        <children>
+          <grid id="f9834" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+            <margin top="0" left="0" bottom="0" right="0"/>
+            <constraints>
+              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties/>
+            <border type="none"/>
+            <children>
+              <component id="852e3" class="javax.swing.JLabel">
+                <constraints>
+                  <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                </constraints>
+                <properties>
+                  <text resource-bundle="messages/XmlBundle" key="label.text.path.to.profiles.ini"/>
+                </properties>
+              </component>
+              <hspacer id="d637d">
+                <constraints>
+                  <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+                </constraints>
+              </hspacer>
+            </children>
+          </grid>
+          <component id="a31a5" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myProfilesIniPathField">
+            <constraints>
+              <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="2" use-parent-layout="false">
+                <preferred-size width="350" height="-1"/>
+              </grid>
+            </constraints>
+            <properties/>
+          </component>
+          <grid id="baf65" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+            <margin top="0" left="0" bottom="0" right="0"/>
+            <constraints>
+              <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties/>
+            <border type="none"/>
+            <children>
+              <component id="11a5c" class="javax.swing.JLabel">
+                <constraints>
+                  <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                </constraints>
+                <properties>
+                  <labelFor value="c6e14"/>
+                  <text resource-bundle="messages/XmlBundle" key="label.text.profile"/>
+                </properties>
+              </component>
+              <hspacer id="d3289">
+                <constraints>
+                  <grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+                </constraints>
+              </hspacer>
+              <component id="c6e14" class="javax.swing.JComboBox" binding="myProfileCombobox">
+                <constraints>
+                  <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
+                </constraints>
+                <properties/>
+              </component>
+            </children>
+          </grid>
+        </children>
+      </grid>
+    </children>
+  </grid>
+</form>
diff --git a/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxSettingsConfigurable.java b/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxSettingsConfigurable.java
new file mode 100644
index 0000000..fb92f51
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxSettingsConfigurable.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers.firefox;
+
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import com.intellij.openapi.options.Configurable;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.ui.DocumentAdapter;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.event.DocumentEvent;
+import java.io.File;
+import java.util.List;
+
+/**
+ * @author nik
+ */
+public class FirefoxSettingsConfigurable implements Configurable {
+  private static final FileChooserDescriptor PROFILES_INI_CHOOSER_DESCRIPTOR = createProfilesIniChooserDescriptor();
+
+  private JPanel myMainPanel;
+  private JComboBox myProfileCombobox;
+  private TextFieldWithBrowseButton myProfilesIniPathField;
+  private final FirefoxSettings mySettings;
+  private String myLastProfilesIniPath;
+  private String myDefaultProfilesIniPath;
+  private String myDefaultProfile;
+
+  public FirefoxSettingsConfigurable(FirefoxSettings settings) {
+    mySettings = settings;
+    myProfilesIniPathField.addBrowseFolderListener(XmlBundle.message("chooser.title.select.profiles.ini.file"), null, null, PROFILES_INI_CHOOSER_DESCRIPTOR);
+    myProfilesIniPathField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
+      @Override
+      protected void textChanged(DocumentEvent e) {
+        updateProfilesList();
+      }
+    });
+  }
+
+  public static FileChooserDescriptor createProfilesIniChooserDescriptor() {
+    return new FileChooserDescriptor(true, false, false, false, false, false) {
+      @Override
+      public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
+        if (!file.isDirectory() && !file.getName().equals(FirefoxUtil.PROFILES_INI_FILE)) {
+          return false;
+        }
+        return super.isFileVisible(file, showHiddenFiles);
+      }
+    };
+  }
+
+  public JComponent createComponent() {
+    return myMainPanel;
+  }
+
+  public boolean isModified() {
+    return !Comparing.equal(mySettings.getProfile(), getConfiguredProfileName()) ||
+           !Comparing.equal(mySettings.getProfilesIniPath(), getConfiguredProfileIniPath());
+  }
+
+  @Nullable
+  private String getConfiguredProfileIniPath() {
+    final String path = myProfilesIniPathField.getText();
+    if (myDefaultProfilesIniPath.equals(path)) {
+      return null;
+    }
+    return FileUtil.toSystemIndependentName(path);
+  }
+
+  @Nullable
+  private String getConfiguredProfileName() {
+    final String selected = (String)myProfileCombobox.getSelectedItem();
+    if (Comparing.equal(myDefaultProfile, selected)) {
+      return null;
+    }
+    return selected;
+  }
+
+  public void apply() throws ConfigurationException {
+    mySettings.setProfile(getConfiguredProfileName());
+    mySettings.setProfilesIniPath(getConfiguredProfileIniPath());
+  }
+
+  public void reset() {
+    final File defaultFile = FirefoxUtil.getDefaultProfileIniPath();
+    myDefaultProfilesIniPath = defaultFile != null ? defaultFile.getAbsolutePath() : "";
+
+    final String path = mySettings.getProfilesIniPath();
+    myProfilesIniPathField.setText(path != null ? FileUtil.toSystemDependentName(path) : myDefaultProfilesIniPath);
+    updateProfilesList();
+    final String profileName = mySettings.getProfile();
+    myProfileCombobox.setSelectedItem(profileName != null ? profileName : myDefaultProfile);
+  }
+
+  private void updateProfilesList() {
+    final String profilesIniPath = myProfilesIniPathField.getText();
+    if (myLastProfilesIniPath != null && myLastProfilesIniPath.equals(profilesIniPath)) return;
+
+    myProfileCombobox.removeAllItems();
+    final List<FirefoxProfile> profiles = FirefoxUtil.computeProfiles(new File(profilesIniPath));
+    final FirefoxProfile defaultProfile = FirefoxUtil.getDefaultProfile(profiles);
+    myDefaultProfile = defaultProfile != null ? defaultProfile.getName() : null;
+    for (FirefoxProfile profile : profiles) {
+      myProfileCombobox.addItem(profile.getName());
+    }
+    if (!profiles.isEmpty()) {
+      myProfileCombobox.setSelectedIndex(0);
+    }
+    myLastProfilesIniPath = profilesIniPath;
+  }
+
+  public void disposeUIResources() {
+  }
+
+  @Nls
+  public String getDisplayName() {
+    return XmlBundle.message("display.name.firefox.settings");
+  }
+
+  public String getHelpTopic() {
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxUtil.java b/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxUtil.java
new file mode 100644
index 0000000..5541052
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/firefox/FirefoxUtil.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers.firefox;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.SystemProperties;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author nik
+ */
+public class FirefoxUtil {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.ide.browsers.firefox.FirefoxUtil");
+  @NonNls public static final String PROFILES_INI_FILE = "profiles.ini";
+
+  private FirefoxUtil() {
+  }
+
+  @Nullable
+  public static File getDefaultProfileIniPath() {
+    File[] roots = getProfilesDirs();
+    for (File profilesDir : roots) {
+      File profilesFile = new File(profilesDir, PROFILES_INI_FILE);
+      if (profilesFile.isFile()) {
+        return profilesFile;
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public static File getFirefoxExtensionsDir(FirefoxSettings settings) {
+    File profilesFile = settings.getProfilesIniFile();
+    if (profilesFile != null && profilesFile.exists()) {
+      List<FirefoxProfile> profiles = computeProfiles(profilesFile);
+      FirefoxProfile profile = findProfileByNameOrDefault(settings.getProfile(), profiles);
+      if (profile != null) {
+        File profileDir = profile.getProfileDirectory(profilesFile);
+        if (profileDir.isDirectory()) {
+          return new File(profileDir, "extensions");
+        }
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public static FirefoxProfile findProfileByNameOrDefault(@Nullable String name, List<FirefoxProfile> profiles) {
+    for (FirefoxProfile profile : profiles) {
+      if (profile.getName().equals(name)) {
+        return profile;
+      }
+    }
+    return getDefaultProfile(profiles);
+  }
+
+  @Nullable
+  public static FirefoxProfile getDefaultProfile(List<FirefoxProfile> profiles) {
+    if (profiles.isEmpty()) return null;
+
+    for (FirefoxProfile profile : profiles) {
+      if (profile.isDefault()) {
+        return profile;
+      }
+    }
+    return profiles.get(0);
+  }
+
+  @NotNull
+  public static List<FirefoxProfile> computeProfiles(File profilesFile) {
+    if (!profilesFile.isFile()) {
+      return Collections.emptyList();
+    }
+
+    try {
+      BufferedReader reader = new BufferedReader(new FileReader(profilesFile));
+      try {
+        final List<FirefoxProfile> profiles = new ArrayList<FirefoxProfile>();
+        boolean insideProfile = false;
+        String currentName = null;
+        String currentPath = null;
+        boolean isDefault = false;
+        boolean isRelative = false;
+        boolean eof = false;
+        while (!eof) {
+          @NonNls String line = reader.readLine();
+          if (line == null) {
+            eof = true;
+            line = "[]";
+          }
+          else {
+            line = line.trim();
+          }
+
+          if (line.startsWith("[") && line.endsWith("]")) {
+            if (!StringUtil.isEmpty(currentPath) && !StringUtil.isEmpty(currentName)) {
+              profiles.add(new FirefoxProfile(currentName, currentPath, isDefault, isRelative));
+            }
+            currentName = null;
+            currentPath = null;
+            isDefault = false;
+            isRelative = false;
+            insideProfile = StringUtil.startsWithIgnoreCase(line, "[Profile");
+            continue;
+          }
+
+          final int i = line.indexOf('=');
+          if (i != -1 && insideProfile) {
+            @NonNls String name = line.substring(0, i).trim();
+            @NonNls String value = line.substring(i + 1).trim();
+            if (name.equalsIgnoreCase("path")) {
+              currentPath = value;
+            }
+            else if (name.equalsIgnoreCase("name")) {
+              currentName = value;
+            }
+            else if (name.equalsIgnoreCase("default") && value.equals("1")) {
+              isDefault = true;
+            }
+            else if (name.equalsIgnoreCase("isrelative") && value.equals("1")) {
+              isRelative = true;
+            }
+          }
+        }
+        return profiles;
+      }
+      finally {
+        reader.close();
+      }
+    }
+    catch (IOException e) {
+      LOG.info(e);
+    }
+    return Collections.emptyList();
+  }
+
+  private static File[] getProfilesDirs() {
+    final String userHome = SystemProperties.getUserHome();
+    if (SystemInfo.isMac) {
+      return new File[] {
+        new File(userHome, "Library" + File.separator + "Mozilla" + File.separator + "Firefox"),
+        new File(userHome, "Library" + File.separator + "Application Support" + File.separator + "Firefox"),
+      };
+    }
+    if (SystemInfo.isUnix) {
+      return new File[] {new File(userHome, ".mozilla" + File.separator + "firefox")};
+    }
+
+    String localPath = "Mozilla" + File.separator + "Firefox";
+    return new File[] {
+      new File(System.getenv("APPDATA"), localPath),
+      new File(userHome, "AppData" + File.separator + "Roaming" + File.separator + localPath),
+      new File(userHome, "Application Data" + File.separator + localPath)
+    };
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/impl/DefaultUrlOpener.java b/xml/impl/src/com/intellij/ide/browsers/impl/DefaultUrlOpener.java
new file mode 100644
index 0000000..fc50f4d
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/impl/DefaultUrlOpener.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers.impl;
+
+import com.intellij.execution.util.ExecUtil;
+import com.intellij.ide.BrowserUtil;
+import com.intellij.ide.browsers.BrowserSpecificSettings;
+import com.intellij.ide.browsers.BrowsersConfiguration;
+import com.intellij.ide.browsers.UrlOpener;
+import com.intellij.ide.browsers.WebBrowserSettings;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
+import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class DefaultUrlOpener extends UrlOpener {
+  private static final Logger LOG = Logger.getInstance(DefaultUrlOpener.class);
+
+  @Override
+  public boolean openUrl(BrowsersConfiguration.BrowserFamily family, @Nullable String url) {
+    return launchBrowser(family, url, ArrayUtil.EMPTY_STRING_ARRAY, Conditions.<String>alwaysTrue(), false);
+  }
+
+  public static boolean launchBrowser(final BrowsersConfiguration.BrowserFamily family,
+                                      @Nullable String url,
+                                      @NotNull String[] additionalParameters,
+                                      @NotNull Condition<String> browserSpecificParametersFilter,
+                                      final boolean forceOpenNewInstanceOnMac) {
+    final WebBrowserSettings settings = BrowsersConfiguration.getInstance().getBrowserSettings(family);
+    final String path = settings.getPath();
+    if (StringUtil.isEmpty(path)) {
+      Messages.showErrorDialog(XmlBundle.message("browser.path.not.specified", family.getName()), XmlBundle.message("browser.path.not.specified.title"));
+      return false;
+    }
+
+    try {
+      BrowserSpecificSettings specificSettings = settings.getBrowserSpecificSettings();
+      List<String> parameters = specificSettings == null
+                                ? (additionalParameters.length == 0 ? Collections.<String>emptyList() : new ArrayList<String>())
+                                : ContainerUtil.findAll(specificSettings.getAdditionalParameters(), browserSpecificParametersFilter);
+      Collections.addAll(parameters, additionalParameters);
+      doLaunchBrowser(path, url == null ? null : BrowserUtil.escapeUrl(url), forceOpenNewInstanceOnMac, parameters);
+      return true;
+    }
+    catch (IOException e) {
+      Messages.showErrorDialog(e.getMessage(), XmlBundle.message("browser.error"));
+      return false;
+    }
+  }
+
+  private static void doLaunchBrowser(String browserPath, @Nullable String url, boolean forceOpenNewInstanceOnMac, List<String> browserArgs)
+    throws IOException {
+    List<String> command = BrowserUtil.getOpenBrowserCommand(browserPath);
+    addArgs(command, browserArgs, url, forceOpenNewInstanceOnMac);
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("Launching browser: " + StringUtil.join(command, " "));
+    }
+    new ProcessBuilder(command).start();
+  }
+
+  private static void addArgs(List<String> command, List<String> browserArgs, @Nullable String url, boolean forceOpenNewInstanceOnMac) {
+    if (SystemInfo.isMac && ExecUtil.getOpenCommandPath().equals(command.get(0))) {
+      if (forceOpenNewInstanceOnMac) {
+        command.add("-n");
+      }
+      if (url != null) {
+        command.add(url);
+      }
+
+      if (!browserArgs.isEmpty()) {
+        if (BrowserUtil.isOpenCommandSupportArgs()) {
+          command.add("--args");
+          command.addAll(browserArgs);
+        }
+        else {
+          LOG.warn(
+            "'open' command doesn't allow to pass command line arguments so they will be ignored: " + StringUtil.join(browserArgs, " "));
+        }
+      }
+    }
+    else {
+      if (url != null) {
+        command.add(url);
+      }
+      command.addAll(browserArgs);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/browsers/impl/WebBrowserServiceImpl.java b/xml/impl/src/com/intellij/ide/browsers/impl/WebBrowserServiceImpl.java
new file mode 100644
index 0000000..4cfdc0c
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/browsers/impl/WebBrowserServiceImpl.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers.impl;
+
+import com.intellij.ide.browsers.WebBrowserService;
+import com.intellij.ide.browsers.WebBrowserUrlProvider;
+import com.intellij.openapi.project.DumbService;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.impl.http.HttpVirtualFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.xml.util.HtmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author nik
+ */
+public class WebBrowserServiceImpl extends WebBrowserService {
+  @Override
+  public boolean canOpenInBrowser(@NotNull PsiElement psiElement) {
+    final PsiFile psiFile = psiElement instanceof PsiFile ? (PsiFile)psiElement : psiElement.getContainingFile();
+    return psiFile != null && psiFile.getVirtualFile() != null &&
+           (HtmlUtil.isHtmlFile(psiFile) || getProvider(psiElement) != null);
+  }
+
+  @Override
+  @Nullable
+  public String getUrlToOpen(@NotNull PsiElement psiElement, boolean preferLocalUrl) throws WebBrowserUrlProvider.BrowserException {
+    final PsiFile psiFile = psiElement instanceof PsiFile ? (PsiFile)psiElement : psiElement.getContainingFile();
+    if (psiFile == null) {
+      return null;
+    }
+    VirtualFile virtualFile = psiFile.getVirtualFile();
+    if (virtualFile == null) {
+      return null;
+    }
+    if (virtualFile instanceof HttpVirtualFile) {
+      return virtualFile.getUrl();
+    }
+
+    if (!(preferLocalUrl && HtmlUtil.isHtmlFile(psiFile))) {
+      WebBrowserUrlProvider provider = getProvider(psiElement);
+      if (provider != null) {
+        try {
+          return provider.getUrl(psiElement, psiFile, virtualFile);
+        }
+        catch (WebBrowserUrlProvider.BrowserException e) {
+          if (!HtmlUtil.isHtmlFile(psiFile)) {
+            throw e;
+          }
+        }
+      }
+    }
+    return VfsUtil.toUri(virtualFile).toASCIIString();
+  }
+
+  @Nullable
+  public String getUrlToOpen(@NotNull PsiElement psiElement) {
+    try {
+      return getUrlToOpen(psiElement, false);
+    }
+    catch (WebBrowserUrlProvider.BrowserException e) {
+      return null;
+    }
+  }
+
+  @Nullable
+  public static WebBrowserUrlProvider getProvider(@Nullable PsiElement element) {
+    if (element == null) {
+      return null;
+    }
+
+    final List<WebBrowserUrlProvider> allProviders = Arrays.asList(WebBrowserUrlProvider.EP_NAME.getExtensions());
+    for (WebBrowserUrlProvider urlProvider : DumbService.getInstance(element.getProject()).filterByDumbAwareness(allProviders)) {
+      if (urlProvider.canHandleElement(element)) {
+        return urlProvider;
+      }
+    }
+
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/highlighter/DTDFileType.java b/xml/impl/src/com/intellij/ide/highlighter/DTDFileType.java
new file mode 100644
index 0000000..276837d
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/highlighter/DTDFileType.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.highlighter;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.ide.IdeBundle;
+import com.intellij.lang.dtd.DTDLanguage;
+import com.intellij.openapi.fileTypes.LanguageFileType;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+public class DTDFileType extends LanguageFileType {
+  public static final DTDFileType INSTANCE = new DTDFileType();
+
+  public DTDFileType() {
+    super(DTDLanguage.INSTANCE);
+  }
+
+  @NotNull
+  public String getName() {
+    return "DTD";
+  }
+
+  @NotNull
+  public String getDescription() {
+    return IdeBundle.message("filetype.description.dtd");
+  }
+
+  @NotNull
+  public String getDefaultExtension() {
+    return "dtd";
+  }
+
+  public Icon getIcon() {
+    return AllIcons.FileTypes.Dtd;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/highlighter/DomSupportEnabled.java b/xml/impl/src/com/intellij/ide/highlighter/DomSupportEnabled.java
new file mode 100644
index 0000000..ff27af0
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/highlighter/DomSupportEnabled.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.highlighter;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: zajac
+ * Date: 15.04.11
+ * Time: 14:57
+ * To change this template use File | Settings | File Templates.
+ */
+public interface DomSupportEnabled {
+}
diff --git a/xml/impl/src/com/intellij/ide/highlighter/HtmlFileHighlighter.java b/xml/impl/src/com/intellij/ide/highlighter/HtmlFileHighlighter.java
new file mode 100644
index 0000000..daff833
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/highlighter/HtmlFileHighlighter.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.highlighter;
+
+import com.intellij.lexer.HtmlHighlightingLexer;
+import com.intellij.lexer.Lexer;
+import com.intellij.openapi.editor.HighlighterColors;
+import com.intellij.openapi.editor.XmlHighlighterColors;
+import com.intellij.openapi.editor.colors.TextAttributesKey;
+import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlTokenType;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+public class HtmlFileHighlighter extends SyntaxHighlighterBase {
+  private static final Map<IElementType, TextAttributesKey> keys1;
+  private static final Map<IElementType, TextAttributesKey> keys2;
+
+  static {
+    keys1 = new HashMap<IElementType, TextAttributesKey>();
+    keys2 = new HashMap<IElementType, TextAttributesKey>();
+
+    keys1.put(XmlTokenType.XML_COMMENT_START, XmlHighlighterColors.HTML_COMMENT);
+    keys1.put(XmlTokenType.XML_COMMENT_END, XmlHighlighterColors.HTML_COMMENT);
+    keys1.put(XmlTokenType.XML_COMMENT_CHARACTERS, XmlHighlighterColors.HTML_COMMENT);
+    keys1.put(XmlTokenType.XML_CONDITIONAL_COMMENT_END, XmlHighlighterColors.HTML_COMMENT);
+    keys1.put(XmlTokenType.XML_CONDITIONAL_COMMENT_END_START, XmlHighlighterColors.HTML_COMMENT);
+    keys1.put(XmlTokenType.XML_CONDITIONAL_COMMENT_START, XmlHighlighterColors.HTML_COMMENT);
+    keys1.put(XmlTokenType.XML_CONDITIONAL_COMMENT_START_END, XmlHighlighterColors.HTML_COMMENT);
+
+    keys1.put(XmlTokenType.XML_START_TAG_START, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_END_TAG_START, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_TAG_END, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_EMPTY_ELEMENT_END, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_TAG_NAME, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.TAG_WHITE_SPACE, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_NAME, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_TAG_CHARACTERS, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_EQ, XmlHighlighterColors.HTML_TAG);
+
+    keys2.put(XmlTokenType.XML_TAG_NAME, XmlHighlighterColors.HTML_TAG_NAME);
+    keys2.put(XmlTokenType.XML_NAME, XmlHighlighterColors.HTML_ATTRIBUTE_NAME);
+    keys2.put(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN, XmlHighlighterColors.HTML_ATTRIBUTE_VALUE);
+    keys2.put(XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER, XmlHighlighterColors.HTML_ATTRIBUTE_VALUE);
+    keys2.put(XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER, XmlHighlighterColors.HTML_ATTRIBUTE_VALUE);
+    keys2.put(XmlTokenType.XML_EQ, XmlHighlighterColors.HTML_ATTRIBUTE_NAME);
+
+    keys1.put(XmlTokenType.XML_PI_START, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_PI_END, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_PI_TARGET, XmlHighlighterColors.HTML_TAG);
+    keys2.put(XmlTokenType.XML_PI_TARGET, XmlHighlighterColors.HTML_TAG_NAME);
+    
+    keys1.put(XmlTokenType.XML_DOCTYPE_START, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_DOCTYPE_END, XmlHighlighterColors.HTML_TAG);
+    keys1.put(XmlTokenType.XML_DOCTYPE_PUBLIC, XmlHighlighterColors.HTML_TAG);
+
+    keys2.put(XmlTokenType.XML_CHAR_ENTITY_REF, XmlHighlighterColors.HTML_ENTITY_REFERENCE);
+    keys2.put(XmlTokenType.XML_ENTITY_REF_TOKEN, XmlHighlighterColors.HTML_ENTITY_REFERENCE);
+
+    keys1.put(XmlTokenType.XML_BAD_CHARACTER, HighlighterColors.BAD_CHARACTER);
+  }
+
+  @NotNull
+  public Lexer getHighlightingLexer() {
+    return new HtmlHighlightingLexer();
+  }
+
+  @NotNull
+  public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {
+    return pack(XmlHighlighterColors.HTML_CODE, pack(keys1.get(tokenType), keys2.get(tokenType)));
+  }
+
+  public static final void registerEmbeddedTokenAttributes(Map<IElementType, TextAttributesKey> _keys1,
+                                                           Map<IElementType, TextAttributesKey> _keys2) {
+    if (_keys1 != null) {
+      for (Iterator<IElementType> iterator = _keys1.keySet().iterator(); iterator.hasNext();) {
+        IElementType iElementType = iterator.next();
+        keys1.put(iElementType,_keys1.get(iElementType));
+      }
+    }
+
+    if (_keys2 != null) {
+      for (Iterator<IElementType> iterator = _keys2.keySet().iterator(); iterator.hasNext();) {
+        IElementType iElementType = iterator.next();
+        keys2.put(iElementType,_keys2.get(iElementType));
+      }
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/highlighter/HtmlFileType.java b/xml/impl/src/com/intellij/ide/highlighter/HtmlFileType.java
new file mode 100644
index 0000000..f0638e0
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/highlighter/HtmlFileType.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.highlighter;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.ide.IdeBundle;
+import com.intellij.lang.Language;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.CharsetToolkit;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.Charset;
+
+public class HtmlFileType extends XmlLikeFileType {
+  @NonNls public static final String DOT_DEFAULT_EXTENSION = ".html";
+
+  public final static HtmlFileType INSTANCE = new HtmlFileType();
+
+  private HtmlFileType() {
+    super(HTMLLanguage.INSTANCE);
+  }
+
+  HtmlFileType(Language language) {
+    super(language);
+  }
+
+  @NotNull
+  public String getName() {
+    return "HTML";
+  }
+
+  @NotNull
+  public String getDescription() {
+    return IdeBundle.message("filetype.description.html");
+  }
+
+  @NotNull
+  public String getDefaultExtension() {
+    return "html";
+  }
+
+  public Icon getIcon() {
+    return AllIcons.FileTypes.Html;
+  }
+
+  public String getCharset(@NotNull final VirtualFile file, final byte[] content) {
+    String charset = XmlUtil.extractXmlEncodingFromProlog(content);
+    if (charset != null) return charset;
+    @NonNls String strContent;
+    try {
+      strContent = new String(content, "ISO-8859-1");
+    }
+    catch (UnsupportedEncodingException e) {
+      return null;
+    }
+    Charset c = HtmlUtil.detectCharsetFromMetaHttpEquiv(strContent);
+    return c == null ? null : c.name();
+  }
+
+  public Charset extractCharsetFromFileContent(@Nullable final Project project, @Nullable final VirtualFile file, @NotNull final String content) {
+    String name = XmlUtil.extractXmlEncodingFromProlog(content);
+    Charset charset = CharsetToolkit.forName(name);
+
+    if (charset != null) {
+      return charset;
+    }
+    return HtmlUtil.detectCharsetFromMetaHttpEquiv(content);
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/highlighter/HtmlHighlighterFactory.java b/xml/impl/src/com/intellij/ide/highlighter/HtmlHighlighterFactory.java
new file mode 100644
index 0000000..67a3616
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/highlighter/HtmlHighlighterFactory.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.ide.highlighter;
+
+import com.intellij.openapi.editor.colors.EditorColorsScheme;
+import com.intellij.openapi.editor.highlighter.EditorHighlighter;
+import com.intellij.openapi.fileTypes.SyntaxHighlighter;
+
+public class HtmlHighlighterFactory {
+  public static EditorHighlighter createHTMLHighlighter(EditorColorsScheme settings){
+    SyntaxHighlighter highlighter = new HtmlFileHighlighter();
+    return HighlighterFactory.createHighlighter(highlighter, settings);
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/ide/highlighter/XHtmlFileType.java b/xml/impl/src/com/intellij/ide/highlighter/XHtmlFileType.java
new file mode 100644
index 0000000..9d282e2
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/highlighter/XHtmlFileType.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.highlighter;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.ide.IdeBundle;
+import com.intellij.lang.xhtml.XHTMLLanguage;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+public class XHtmlFileType extends HtmlFileType {
+  public static final XHtmlFileType INSTANCE = new XHtmlFileType();
+
+  private XHtmlFileType() {
+    super(XHTMLLanguage.INSTANCE);
+  }
+
+  @NotNull
+  public String getName() {
+    return "XHTML";
+  }
+
+  @NotNull
+  public String getDescription() {
+    return IdeBundle.message("filetype.description.xhtml");
+  }
+
+  @NotNull
+  public String getDefaultExtension() {
+    return "xhtml";
+  }
+
+  public Icon getIcon() {
+    return AllIcons.FileTypes.Xhtml;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/highlighter/XmlFileHighlighter.java b/xml/impl/src/com/intellij/ide/highlighter/XmlFileHighlighter.java
new file mode 100644
index 0000000..4b68ad9
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/highlighter/XmlFileHighlighter.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.highlighter;
+
+import com.intellij.lexer.DtdLexer;
+import com.intellij.lexer.Lexer;
+import com.intellij.lexer.XHtmlHighlightingLexer;
+import com.intellij.lexer.XmlHighlightingLexer;
+import com.intellij.openapi.editor.HighlighterColors;
+import com.intellij.openapi.editor.XmlHighlighterColors;
+import com.intellij.openapi.editor.colors.TextAttributesKey;
+import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlTokenType;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+public class XmlFileHighlighter extends SyntaxHighlighterBase {
+  private static final Map<IElementType, TextAttributesKey> keys1;
+  private static final Map<IElementType, TextAttributesKey> keys2;
+
+  static {
+    keys1 = new HashMap<IElementType, TextAttributesKey>();
+    keys2 = new HashMap<IElementType, TextAttributesKey>();
+
+    keys1.put(XmlTokenType.XML_DATA_CHARACTERS, XmlHighlighterColors.XML_TAG_DATA);
+
+    keys1.put(XmlTokenType.XML_COMMENT_START, XmlHighlighterColors.XML_COMMENT);
+    keys1.put(XmlTokenType.XML_COMMENT_END, XmlHighlighterColors.XML_COMMENT);
+    keys1.put(XmlTokenType.XML_COMMENT_CHARACTERS, XmlHighlighterColors.XML_COMMENT);
+    keys1.put(XmlTokenType.XML_CONDITIONAL_COMMENT_END, XmlHighlighterColors.XML_COMMENT);
+    keys1.put(XmlTokenType.XML_CONDITIONAL_COMMENT_END_START, XmlHighlighterColors.XML_COMMENT);
+    keys1.put(XmlTokenType.XML_CONDITIONAL_COMMENT_START, XmlHighlighterColors.XML_COMMENT);
+    keys1.put(XmlTokenType.XML_CONDITIONAL_COMMENT_START_END, XmlHighlighterColors.XML_COMMENT);
+
+    keys1.put(XmlTokenType.XML_START_TAG_START, XmlHighlighterColors.XML_TAG);
+    keys1.put(XmlTokenType.XML_END_TAG_START, XmlHighlighterColors.XML_TAG);
+    keys1.put(XmlTokenType.XML_TAG_END, XmlHighlighterColors.XML_TAG);
+    keys1.put(XmlTokenType.XML_EMPTY_ELEMENT_END, XmlHighlighterColors.XML_TAG);
+    keys1.put(XmlTokenType.XML_TAG_NAME, XmlHighlighterColors.XML_TAG);
+    keys1.put(XmlTokenType.TAG_WHITE_SPACE, XmlHighlighterColors.XML_TAG);
+    keys1.put(XmlTokenType.XML_NAME, XmlHighlighterColors.XML_TAG);
+    keys1.put(XmlTokenType.XML_CONDITIONAL_IGNORE, XmlHighlighterColors.XML_TAG);
+    keys1.put(XmlTokenType.XML_CONDITIONAL_INCLUDE, XmlHighlighterColors.XML_TAG);
+    keys1.put(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN, XmlHighlighterColors.XML_TAG);
+    keys1.put(XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER, XmlHighlighterColors.XML_TAG);
+    keys1.put(XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER, XmlHighlighterColors.XML_TAG);
+    keys1.put(XmlTokenType.XML_EQ, XmlHighlighterColors.XML_TAG);
+    keys1.put(XmlTokenType.XML_TAG_CHARACTERS, XmlHighlighterColors.XML_TAG);
+
+    keys2.put(XmlTokenType.XML_TAG_NAME, XmlHighlighterColors.XML_TAG_NAME);
+    keys2.put(XmlTokenType.XML_CONDITIONAL_INCLUDE, XmlHighlighterColors.XML_TAG_NAME);
+    keys2.put(XmlTokenType.XML_CONDITIONAL_INCLUDE, XmlHighlighterColors.XML_TAG_NAME);
+    keys2.put(XmlTokenType.XML_NAME, XmlHighlighterColors.XML_ATTRIBUTE_NAME);
+    keys2.put(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN, XmlHighlighterColors.XML_ATTRIBUTE_VALUE);
+    keys2.put(XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER, XmlHighlighterColors.XML_ATTRIBUTE_VALUE);
+    keys2.put(XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER, XmlHighlighterColors.XML_ATTRIBUTE_VALUE);
+    keys2.put(XmlTokenType.XML_EQ, XmlHighlighterColors.XML_ATTRIBUTE_NAME);
+    keys2.put(XmlTokenType.XML_TAG_CHARACTERS, XmlHighlighterColors.XML_ATTRIBUTE_VALUE);
+
+    keys1.put(XmlTokenType.XML_BAD_CHARACTER, HighlighterColors.BAD_CHARACTER);
+
+    keys1.put(XmlTokenType.XML_DECL_START, XmlHighlighterColors.XML_TAG);
+    keys2.put(XmlTokenType.XML_DECL_START, XmlHighlighterColors.XML_TAG_NAME);
+
+    keys1.put(XmlTokenType.XML_CONDITIONAL_SECTION_START, XmlHighlighterColors.XML_PROLOGUE);
+    keys2.put(XmlTokenType.XML_CONDITIONAL_SECTION_START, XmlHighlighterColors.XML_TAG_NAME);
+
+    keys1.put(XmlTokenType.XML_CONDITIONAL_SECTION_END, XmlHighlighterColors.XML_PROLOGUE);
+    keys2.put(XmlTokenType.XML_CONDITIONAL_SECTION_END, XmlHighlighterColors.XML_TAG_NAME);
+
+    keys1.put(XmlTokenType.XML_DECL_END, XmlHighlighterColors.XML_PROLOGUE);
+    keys2.put(XmlTokenType.XML_DECL_END, XmlHighlighterColors.XML_TAG_NAME);
+
+    keys1.put(XmlTokenType.XML_PI_START, XmlHighlighterColors.XML_PROLOGUE);
+    keys1.put(XmlTokenType.XML_PI_END, XmlHighlighterColors.XML_PROLOGUE); 
+    keys1.put(XmlTokenType.XML_DOCTYPE_END, XmlHighlighterColors.XML_PROLOGUE);
+    keys2.put(XmlTokenType.XML_DOCTYPE_END, XmlHighlighterColors.XML_TAG_NAME);
+
+    keys1.put(XmlTokenType.XML_DOCTYPE_START, XmlHighlighterColors.XML_TAG);
+    keys2.put(XmlTokenType.XML_DOCTYPE_START, XmlHighlighterColors.XML_TAG_NAME);
+
+    keys1.put(XmlTokenType.XML_DOCTYPE_SYSTEM, XmlHighlighterColors.XML_TAG);
+    keys2.put(XmlTokenType.XML_DOCTYPE_SYSTEM, XmlHighlighterColors.XML_TAG_NAME);
+
+    keys1.put(XmlTokenType.XML_DOCTYPE_PUBLIC, XmlHighlighterColors.XML_TAG);
+    keys2.put(XmlTokenType.XML_DOCTYPE_PUBLIC, XmlHighlighterColors.XML_TAG_NAME);
+
+    keys1.put(XmlTokenType.XML_DOCTYPE_PUBLIC, XmlHighlighterColors.XML_TAG);
+    keys2.put(XmlTokenType.XML_DOCTYPE_PUBLIC, XmlHighlighterColors.XML_TAG_NAME);
+
+    keys1.put(XmlTokenType.XML_ATTLIST_DECL_START, XmlHighlighterColors.XML_TAG);
+    keys2.put(XmlTokenType.XML_ATTLIST_DECL_START, XmlHighlighterColors.XML_TAG_NAME);
+
+    keys1.put(XmlTokenType.XML_ELEMENT_DECL_START, XmlHighlighterColors.XML_TAG);
+    keys2.put(XmlTokenType.XML_ELEMENT_DECL_START, XmlHighlighterColors.XML_TAG_NAME);
+
+    keys1.put(XmlTokenType.XML_ENTITY_DECL_START, XmlHighlighterColors.XML_TAG);
+    keys2.put(XmlTokenType.XML_ENTITY_DECL_START, XmlHighlighterColors.XML_TAG_NAME);
+
+    keys2.put(XmlTokenType.XML_CHAR_ENTITY_REF, XmlHighlighterColors.XML_ENTITY_REFERENCE);
+    keys2.put(XmlTokenType.XML_ENTITY_REF_TOKEN, XmlHighlighterColors.XML_ENTITY_REFERENCE);
+  }
+
+  private boolean myIsDtd;
+  private boolean myIsXHtml;
+
+  public XmlFileHighlighter() {
+    this(false);
+  }
+
+  public XmlFileHighlighter(boolean dtd) {
+    myIsDtd = dtd;
+  }
+
+  public XmlFileHighlighter(boolean dtd, boolean xhtml) {
+    myIsDtd = dtd;
+    myIsXHtml = xhtml;
+  }
+
+  @NotNull
+  public Lexer getHighlightingLexer() {
+    if (myIsDtd) {
+      return new DtdLexer(true);
+    } else if (myIsXHtml) {
+      return new XHtmlHighlightingLexer();
+    } else {
+      return new XmlHighlightingLexer();
+    }
+  }
+
+  @NotNull
+  public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {
+    return pack(keys1.get(tokenType), keys2.get(tokenType));
+  }
+
+  public static final void registerEmbeddedTokenAttributes(Map<IElementType, TextAttributesKey> _keys1,
+                                                           Map<IElementType, TextAttributesKey> _keys2) {
+    if (_keys1!=null) {
+      for (Iterator<IElementType> iterator = _keys1.keySet().iterator(); iterator.hasNext();) {
+        IElementType iElementType = iterator.next();
+        keys1.put(iElementType,_keys1.get(iElementType));
+      }
+    }
+
+    if (_keys2!=null) {
+      for (Iterator<IElementType> iterator = _keys2.keySet().iterator(); iterator.hasNext();) {
+        IElementType iElementType = iterator.next();
+        keys2.put(iElementType,_keys2.get(iElementType));
+      }
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/highlighter/XmlFileType.java b/xml/impl/src/com/intellij/ide/highlighter/XmlFileType.java
new file mode 100644
index 0000000..7c0447d
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/highlighter/XmlFileType.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.highlighter;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.ide.IdeBundle;
+import com.intellij.lang.xml.XMLLanguage;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+public class XmlFileType extends XmlLikeFileType implements DomSupportEnabled {
+  public static final XmlFileType INSTANCE = new XmlFileType();
+  @NonNls public static final String DEFAULT_EXTENSION = "xml";
+  @NonNls public static final String DOT_DEFAULT_EXTENSION = "."+DEFAULT_EXTENSION;
+
+  private XmlFileType() {
+    super(XMLLanguage.INSTANCE);
+  }
+
+  @NotNull
+  public String getName() {
+    return "XML";
+  }
+
+  @NotNull
+  public String getDescription() {
+    return IdeBundle.message("filetype.description.xml");
+  }
+
+  @NotNull
+  public String getDefaultExtension() {
+    return DEFAULT_EXTENSION;
+  }
+
+  public Icon getIcon() {
+    return AllIcons.FileTypes.Xml;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/highlighter/XmlHighlighterFactory.java b/xml/impl/src/com/intellij/ide/highlighter/XmlHighlighterFactory.java
new file mode 100644
index 0000000..5e9faf4
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/highlighter/XmlHighlighterFactory.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.ide.highlighter;
+
+import com.intellij.openapi.editor.colors.EditorColorsScheme;
+import com.intellij.openapi.editor.highlighter.EditorHighlighter;
+
+public class XmlHighlighterFactory {
+  public static EditorHighlighter createXMLHighlighter(EditorColorsScheme settings){
+    return HighlighterFactory.createHighlighter(new XmlFileHighlighter(), settings);
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/ide/highlighter/XmlLikeFileType.java b/xml/impl/src/com/intellij/ide/highlighter/XmlLikeFileType.java
new file mode 100644
index 0000000..5ac4888
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/highlighter/XmlLikeFileType.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.highlighter;
+
+import com.intellij.lang.Language;
+import com.intellij.openapi.fileTypes.LanguageFileType;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.CharsetToolkit;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.nio.charset.Charset;
+
+public abstract class XmlLikeFileType extends LanguageFileType {
+  public XmlLikeFileType(Language language) {
+    super(language);
+  }
+  public String getCharset(@NotNull VirtualFile file, final byte[] content) {
+    String charset = XmlUtil.extractXmlEncodingFromProlog(content);
+    return charset == null ? CharsetToolkit.UTF8 : charset;
+  }
+
+  public Charset extractCharsetFromFileContent(final Project project, @Nullable final VirtualFile file, @NotNull final String content) {
+    String name = XmlUtil.extractXmlEncodingFromProlog(content);
+    Charset charset = CharsetToolkit.forName(name);
+    return charset == null ? CharsetToolkit.UTF8_CHARSET : charset;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/structureView/impl/xml/AbstractXmlTagTreeElement.java b/xml/impl/src/com/intellij/ide/structureView/impl/xml/AbstractXmlTagTreeElement.java
new file mode 100644
index 0000000..fde4906
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/structureView/impl/xml/AbstractXmlTagTreeElement.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.structureView.impl.xml;
+
+import com.intellij.ide.structureView.StructureViewTreeElement;
+import com.intellij.ide.structureView.xml.XmlStructureViewElementProvider;
+import com.intellij.ide.structureView.impl.common.PsiTreeElementBase;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+
+import java.util.Collection;
+
+public abstract class AbstractXmlTagTreeElement<T extends XmlElement> extends PsiTreeElementBase<T> {
+  protected AbstractXmlTagTreeElement(final T psiElement) {
+    super(psiElement);
+  }
+
+  protected static Collection<StructureViewTreeElement> getStructureViewTreeElements(XmlTag[] subTags) {
+    final XmlStructureViewElementProvider[] providers =
+      (XmlStructureViewElementProvider[])Extensions.getExtensions(XmlStructureViewElementProvider.EXTENSION_POINT_NAME);
+
+    return ContainerUtil.map2List(subTags, new Function<XmlTag, StructureViewTreeElement>() {
+      public StructureViewTreeElement fun(final XmlTag xmlTag) {
+        for (final XmlStructureViewElementProvider provider : providers) {
+          final StructureViewTreeElement element = provider.createCustomXmlTagTreeElement(xmlTag);
+          if (element != null) {
+            return element;
+          }
+        }
+        return new XmlTagTreeElement(xmlTag);
+      }
+    });
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/structureView/impl/xml/DtdFileTreeElement.java b/xml/impl/src/com/intellij/ide/structureView/impl/xml/DtdFileTreeElement.java
new file mode 100644
index 0000000..9947657
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/structureView/impl/xml/DtdFileTreeElement.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.structureView.impl.xml;
+
+import com.intellij.ide.structureView.StructureViewTreeElement;
+import com.intellij.ide.structureView.impl.common.PsiTreeElementBase;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.xml.*;
+import com.intellij.util.PlatformIcons;
+import com.intellij.xml.impl.dtd.XmlElementDescriptorImpl;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.util.*;
+
+public class DtdFileTreeElement extends PsiTreeElementBase<XmlFile> {
+  public DtdFileTreeElement(XmlFile file) {
+    super(file);
+  }
+
+  @NotNull
+  public Collection<StructureViewTreeElement> getChildrenBase() {
+    return collectElements(getElement().getDocument());
+  }
+
+  static List<StructureViewTreeElement> collectElements(final XmlElement element) {
+    final List<StructureViewTreeElement> elements = new ArrayList<StructureViewTreeElement>();
+
+    XmlUtil.processXmlElements(element, new PsiElementProcessor() {
+      public boolean execute(@NotNull final PsiElement element) {
+        if (element instanceof XmlElementDecl ||
+            element instanceof XmlEntityDecl) {
+          elements.add(new DtdTreeElement((PsiNamedElement)element));
+        }
+        return true;
+      }
+    }, false);
+    return elements;
+  }
+
+  public String getPresentableText() {
+    return getElement().getName();
+  }
+
+  private static class DtdTreeElement extends PsiTreeElementBase<PsiNamedElement> {
+    @NonNls private static final String IMPLIED = "implied";
+    @NonNls private static final String REQUIRED = "required";
+    @NonNls private static final String FIXED = "fixed";
+    @NonNls private static final String ID = "id";
+    @NonNls private static final String IDREF = "idref";
+    @NonNls private static final String ENUM = "enum";
+
+    public DtdTreeElement(final PsiNamedElement element) {
+      super(element);
+    }
+
+    @NotNull
+    public Collection<StructureViewTreeElement> getChildrenBase() {
+      return Collections.emptyList();
+    }
+
+    public String getPresentableText() {
+      final PsiNamedElement namedElement = getElement();
+      return namedElement != null ? namedElement.getName():"";
+    }
+
+    public Icon getIcon(final boolean open) {
+      return PlatformIcons.XML_TAG_ICON;
+    }
+
+    public String getLocationString() {
+      final XmlElement owner = (XmlElement)getElement();
+
+      final XmlAttlistDecl[] attLists= owner instanceof XmlElementDecl ? XmlElementDescriptorImpl.getCachedAttDecls(owner): XmlAttlistDecl.EMPTY_ARRAY;
+
+      if (attLists.length > 0) {
+        Map<String,XmlAttributeDecl> attrMap = null;
+
+        final String name = getElement().getName();
+        for(XmlAttlistDecl a:attLists) {
+          final String aname = a.getName();
+          if (!Comparing.equal(aname, name)) continue;
+          if (attrMap == null) attrMap = new LinkedHashMap<String, XmlAttributeDecl>();
+
+          for(XmlAttributeDecl d : a.getAttributeDecls()) {
+            attrMap.put(d.getName(), d);
+          }
+        }
+
+        StringBuilder b = null;
+        if (attrMap != null) {
+          for(Map.Entry<String,XmlAttributeDecl> e:attrMap.entrySet()) {
+            if (b == null) b = new StringBuilder();
+            else b.append(", ");
+            b.append(e.getKey());
+            final XmlAttributeDecl attributeDecl = e.getValue();
+            String type = null;
+
+            if (attributeDecl.isIdAttribute()) {
+              type = ID;
+            } else if (attributeDecl.isIdRefAttribute()) {
+              type = IDREF;
+            } else if (attributeDecl.isEnumerated()) {
+              type = ENUM;
+            }
+
+            if (attributeDecl.isAttributeFixed()) {
+              if (type == null) type = FIXED;
+              else type += " " + FIXED;
+            } else if (attributeDecl.isAttributeRequired()) {
+              if (type == null) type = REQUIRED;
+              else type += " " + REQUIRED;
+            } else if (attributeDecl.isAttributeImplied()) {
+              if (type == null) type = IMPLIED;
+              else type += " " + IMPLIED;
+            }
+
+            if (type != null) b.append(':').append(type);
+            final XmlAttributeValue value = attributeDecl.getDefaultValue();
+
+            if (value != null) b.append("=").append(value);
+          }
+        }
+
+        if (b != null) return b.toString();
+     }
+     return super.getLocationString();
+    }
+
+    public String toString() {
+      final String s = getLocationString();
+      final String name = getElement().getName();
+      if (s == null || s.length() == 0) return name;
+      return name + " (" + s + ")";
+    }
+  }
+
+
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/ide/structureView/impl/xml/XmlFileTreeElement.java b/xml/impl/src/com/intellij/ide/structureView/impl/xml/XmlFileTreeElement.java
new file mode 100644
index 0000000..e1cd6a2
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/structureView/impl/xml/XmlFileTreeElement.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.structureView.impl.xml;
+
+import com.intellij.ide.structureView.StructureViewTreeElement;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.*;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+public class XmlFileTreeElement extends AbstractXmlTagTreeElement<XmlFile> {
+  public XmlFileTreeElement(XmlFile file) {
+    super(file);
+  }
+
+  @NotNull
+  public Collection<StructureViewTreeElement> getChildrenBase() {
+    final XmlDocument document = getElement().getDocument();
+    List<XmlTag> rootTags = new ArrayList<XmlTag>();
+    if (document != null) {
+      for (PsiElement element : document.getChildren())
+        if (element instanceof XmlTag) rootTags.add((XmlTag)element);
+    }
+
+    Collection<StructureViewTreeElement> structureViewTreeElements =
+      getStructureViewTreeElements(rootTags.toArray(new XmlTag[rootTags.size()]));
+
+    Collection<StructureViewTreeElement> dtdStructureViewTreeElements = null;
+    final XmlProlog prolog = document != null ? document.getProlog():null;
+    if (prolog != null) {
+      final XmlDoctype doctype = prolog.getDoctype();
+
+      if (doctype != null) {
+        final XmlMarkupDecl xmlMarkupDecl = doctype.getMarkupDecl();
+        if (xmlMarkupDecl != null) {
+          dtdStructureViewTreeElements = DtdFileTreeElement.collectElements(xmlMarkupDecl);
+        }
+      }
+    }
+
+    if (dtdStructureViewTreeElements != null) {
+      final ArrayList<StructureViewTreeElement> result = new ArrayList<StructureViewTreeElement>(
+        dtdStructureViewTreeElements.size() + structureViewTreeElements.size()
+      );
+
+      result.addAll(dtdStructureViewTreeElements);
+      result.addAll(structureViewTreeElements);
+      structureViewTreeElements = result;
+    }
+    return structureViewTreeElements;
+  }
+
+  public String getPresentableText() {
+    return getElement().getName();
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/structureView/impl/xml/XmlStructureViewTreeModel.java b/xml/impl/src/com/intellij/ide/structureView/impl/xml/XmlStructureViewTreeModel.java
new file mode 100644
index 0000000..71212d1
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/structureView/impl/xml/XmlStructureViewTreeModel.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.structureView.impl.xml;
+
+import com.intellij.ide.structureView.StructureViewExtension;
+import com.intellij.ide.structureView.StructureViewFactoryEx;
+import com.intellij.ide.structureView.StructureViewTreeElement;
+import com.intellij.ide.structureView.TextEditorBasedStructureViewModel;
+import com.intellij.ide.util.treeView.smartTree.Sorter;
+import com.intellij.lang.dtd.DTDLanguage;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.*;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Collection;
+
+public class XmlStructureViewTreeModel extends TextEditorBasedStructureViewModel{
+  private final XmlFile myFile;
+  private static final Class[] myClasses = new Class[]{XmlTag.class, XmlFile.class, XmlEntityDecl.class, XmlElementDecl.class, XmlAttlistDecl.class, XmlConditionalSection.class};
+  private static final Sorter[] mySorters = {Sorter.ALPHA_SORTER};
+
+  public XmlStructureViewTreeModel(XmlFile file) {
+    super(file);
+    myFile = file;
+  }
+
+  @NotNull
+  public StructureViewTreeElement getRoot() {
+    if (myFile.getLanguage() == DTDLanguage.INSTANCE) return new DtdFileTreeElement(myFile);
+    return new XmlFileTreeElement(myFile);
+  }
+
+  public boolean shouldEnterElement(final Object element) {
+    return element instanceof XmlTag && ((XmlTag)element).getSubTags().length > 0;
+  }
+
+  protected PsiFile getPsiFile() {
+    return myFile;
+  }
+
+  @NotNull
+  protected Class[] getSuitableClasses() {
+    return myClasses;
+  }
+
+  public Object getCurrentEditorElement() {
+    final Object editorElement = super.getCurrentEditorElement();
+    if (editorElement instanceof XmlTag) {
+      final Collection<StructureViewExtension> structureViewExtensions =
+          StructureViewFactoryEx.getInstanceEx(myFile.getProject()).getAllExtensions(XmlTag.class);
+      for(StructureViewExtension extension:structureViewExtensions) {
+        final Object element = extension.getCurrentEditorElement(getEditor(), (PsiElement)editorElement);
+        if (element != null) return element;
+      }
+    }
+    return editorElement;
+  }
+
+  @NotNull
+  public Sorter[] getSorters() {
+    return mySorters;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/structureView/impl/xml/XmlTagTreeElement.java b/xml/impl/src/com/intellij/ide/structureView/impl/xml/XmlTagTreeElement.java
new file mode 100644
index 0000000..86a6350
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/structureView/impl/xml/XmlTagTreeElement.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.structureView.impl.xml;
+
+import com.intellij.ide.structureView.StructureViewTreeElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collection;
+
+public class XmlTagTreeElement extends AbstractXmlTagTreeElement<XmlTag>{
+  @NonNls private static final String ID_ATTR_NAME = "id";
+  @NonNls private static final String NAME_ATTR_NAME = "name";
+
+  public XmlTagTreeElement(XmlTag tag) {
+    super(tag);
+  }
+
+ @NotNull
+ public Collection<StructureViewTreeElement> getChildrenBase() {
+    return getStructureViewTreeElements(getElement().getSubTags());
+  }
+
+  public String getPresentableText() {
+    final XmlTag element = getElement();
+    String id = element.getAttributeValue(ID_ATTR_NAME);
+    if (id == null) id = element.getAttributeValue(NAME_ATTR_NAME);
+    id = toCanonicalForm(id);
+
+    if (id != null) return id + ":" + element.getLocalName();
+    return element.getName();
+  }
+
+  public String getLocationString() {
+    final StringBuffer buffer = new StringBuffer();
+    final XmlTag element = getElement();
+    final XmlAttribute[] attributes = element.getAttributes();
+
+    String id = element.getAttributeValue(ID_ATTR_NAME);
+    String usedAttrName = null;
+
+    if (id == null) {
+      id = element.getAttributeValue(NAME_ATTR_NAME);
+      if (id != null) usedAttrName = NAME_ATTR_NAME;
+    }
+    else {
+      usedAttrName = ID_ATTR_NAME;
+    }
+
+    id = toCanonicalForm(id);
+
+    for (XmlAttribute attribute : attributes) {
+      if (buffer.length() != 0) {
+        buffer.append(" ");
+      }
+
+      final String name = attribute.getName();
+      if (usedAttrName != null &&
+          id != null &&
+          usedAttrName.equals(name)
+        ) {
+        continue; // we output this name in name
+      }
+
+      buffer.append(name);
+      buffer.append("=");
+      buffer.append("\"");
+      buffer.append(attribute.getValue());
+      buffer.append("\"");
+    }
+    return buffer.toString();
+  }
+
+  @Nullable
+  protected static String toCanonicalForm(@Nullable String id) {
+    if (id != null) {
+      id = id.trim();
+      if (id.length() == 0) id = null;
+    }
+    return id;
+  }
+}
diff --git a/xml/impl/src/com/intellij/ide/util/treeView/XmlDoctypeNodeDescriptor.java b/xml/impl/src/com/intellij/ide/util/treeView/XmlDoctypeNodeDescriptor.java
new file mode 100644
index 0000000..ea771e3
--- /dev/null
+++ b/xml/impl/src/com/intellij/ide/util/treeView/XmlDoctypeNodeDescriptor.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.util.treeView;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiElement;
+
+/**
+ * @author Mike
+ */
+public class XmlDoctypeNodeDescriptor  extends SmartElementDescriptor {
+  public XmlDoctypeNodeDescriptor(Project project, NodeDescriptor parentDescriptor, PsiElement element) {
+    super(project, parentDescriptor, element);
+    //noinspection HardCodedStringLiteral
+    myName = "DOCTYPE";
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/DefaultHtmlDoctypeInitialConfigurator.java b/xml/impl/src/com/intellij/javaee/DefaultHtmlDoctypeInitialConfigurator.java
new file mode 100644
index 0000000..772dd19
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/DefaultHtmlDoctypeInitialConfigurator.java
@@ -0,0 +1,20 @@
+package com.intellij.javaee;
+
+import com.intellij.ide.util.PropertiesComponent;
+import com.intellij.openapi.project.ProjectManager;
+import com.intellij.xml.Html5SchemaProvider;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class DefaultHtmlDoctypeInitialConfigurator {
+
+  public DefaultHtmlDoctypeInitialConfigurator(ProjectManager projectManager,
+                                               PropertiesComponent propertiesComponent) {
+    if (!propertiesComponent.getBoolean("DefaultHtmlDoctype.MigrateToHtml5", false)) {
+      propertiesComponent.setValue("DefaultHtmlDoctype.MigrateToHtml5", Boolean.TRUE.toString());
+      ExternalResourceManagerEx.getInstanceEx()
+        .setDefaultHtmlDoctype(Html5SchemaProvider.HTML5_SCHEMA_LOCATION, projectManager.getDefaultProject());
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/EditLocationDialog.java b/xml/impl/src/com/intellij/javaee/EditLocationDialog.java
new file mode 100644
index 0000000..443e0d6
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/EditLocationDialog.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.openapi.fileChooser.FileChooser;
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.ui.FixedSizeButton;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.xml.XmlBundle;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+
+public class EditLocationDialog extends DialogWrapper {
+
+  private JTextField myTfUrl;
+  private JTextField myTfPath;
+  private FixedSizeButton myBtnBrowseLocalPath;
+  private final Project myProject;
+  private final boolean myShowPath;
+
+  private final String myTitle;
+  private final String myName;
+  private final String myLocation;
+  private boolean myTfShared = true;
+
+  public EditLocationDialog(Project project, boolean showPath) {
+    super(project, true);
+    myProject = project;
+    myShowPath = showPath;
+    myTitle = XmlBundle.message("dialog.title.external.resource");
+    myName = XmlBundle.message("label.edit.external.resource.uri");
+    myLocation = XmlBundle.message("label.edit.external.resource.path");
+    init();
+  }
+
+  public EditLocationDialog(Project project, boolean showPath, String title, String name, String location) {
+    super(project, true);
+    myProject = project;
+    myShowPath = showPath;
+    myTitle = title;
+    myName = name;
+    myLocation = location;
+    init();
+  }
+
+  protected JComponent createCenterPanel() {
+    JPanel panel = new JPanel(new GridBagLayout());
+
+    panel.add(
+        new JLabel(myName),
+        new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 3, 5), 0, 0)
+    );
+    panel.add(
+        myTfUrl,
+        new GridBagConstraints(0, 1, 2, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0)
+    );
+
+    myTfUrl.setPreferredSize(new Dimension(350, myTfUrl.getPreferredSize().height));
+
+  if (myShowPath) {
+      panel.add(
+          new JLabel(myLocation),
+          new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 3, 5), 0, 0)
+      );
+      panel.add(
+          myTfPath,
+          new GridBagConstraints(0, 3, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 10, 0), 0, 0)
+      );
+      panel.add(
+          myBtnBrowseLocalPath,
+          new GridBagConstraints(1, 3, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 10, 5), 0, 0)
+      );
+
+      //
+    TextFieldWithBrowseButton.MyDoClickAction.addTo(myBtnBrowseLocalPath, myTfPath);
+    myBtnBrowseLocalPath.addActionListener(
+          new ActionListener() {
+            public void actionPerformed(ActionEvent ignored) {
+              FileChooserDescriptor descriptor = getChooserDescriptor();
+              VirtualFile file = FileChooser.chooseFile(descriptor, myProject, null);
+              if (file != null) {
+                myTfPath.setText(file.getPath().replace('/', File.separatorChar));
+              }
+            }
+          }
+      );
+    }
+
+    //
+
+    return panel;
+  }
+
+  public JComponent getPreferredFocusedComponent() {
+    return myTfUrl;
+  }
+
+  public NameLocationPair getPair() {
+    String path = myTfPath.getText().trim();
+    String url = myTfUrl.getText().trim();
+    return new NameLocationPair(url, path, myTfShared);
+  }
+
+  protected FileChooserDescriptor getChooserDescriptor(){
+    return new FileChooserDescriptor(true, false, false, false, true, false);
+  }
+
+  protected void init() {
+    setTitle(myTitle);
+    myTfUrl = new JTextField();
+    myTfPath = new JTextField();
+    myBtnBrowseLocalPath = new FixedSizeButton(myTfPath);
+    super.init();
+  }
+
+  /**
+   * Initializes editor with the passed data.
+   */
+  public void init(NameLocationPair origin) {
+    myTfUrl.setText(origin.myName);
+    myTfPath.setText(origin.myLocation);
+    myTfShared = origin.myShared;
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/ExternalResourceConfigurable.java b/xml/impl/src/com/intellij/javaee/ExternalResourceConfigurable.java
new file mode 100644
index 0000000..086f8fe
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/ExternalResourceConfigurable.java
@@ -0,0 +1,378 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.options.BaseConfigurable;
+import com.intellij.openapi.options.Configurable;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.vfs.JarFileSystem;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.ui.AddEditRemovePanel;
+import com.intellij.ui.table.JBTable;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.ui.UIUtil;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableColumn;
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class ExternalResourceConfigurable extends BaseConfigurable
+  implements Configurable.NoScroll {
+  private JPanel myPanel;
+  private List<NameLocationPair> myPairs;
+  private List<String> myIgnoredUrls;
+  private String myDefaultHtmlDoctype;
+  private AddEditRemovePanel<NameLocationPair> myExtPanel;
+  private AddEditRemovePanel<String> myIgnorePanel;
+  private HtmlLanguageLevelForm myHtmlLanguageLevelForm;
+  @Nullable private final Project myProject;
+  private final List<NameLocationPair> myNewPairs;
+
+  @SuppressWarnings("UnusedDeclaration")
+  public ExternalResourceConfigurable(@Nullable Project project) {
+    this(project, Collections.<NameLocationPair>emptyList());
+  }
+
+  public ExternalResourceConfigurable(@Nullable Project project, List<NameLocationPair> newResources) {
+    myProject = project;
+    myNewPairs = newResources;
+  }
+
+  public String getDisplayName() {
+    return XmlBundle.message("display.name.edit.external.resource");
+  }
+
+  public JComponent createComponent() {
+    myPanel = new JPanel(new GridBagLayout()) {
+      public Dimension getPreferredSize() {
+        return new Dimension(-1, 400);
+      }
+    };
+
+    myExtPanel = new AddEditRemovePanel<NameLocationPair>(new ExtUrlsTableModel(), myPairs, XmlBundle.message("label.edit.external.resource.configure.external.resources")) {
+      protected NameLocationPair addItem() {
+        return addExtLocation();
+      }
+
+      protected boolean removeItem(NameLocationPair o) {
+        setModified(true);
+        return true;
+      }
+
+      protected NameLocationPair editItem(NameLocationPair o) {
+        return editExtLocation(o);
+      }
+    };
+
+    myExtPanel.setRenderer(1, new PathRenderer());
+
+    JTable table = myExtPanel.getTable();
+    if (myProject != null) {
+      TableColumn column = table.getColumn(table.getColumnName(2));
+      column.setMaxWidth(50);
+      column.setCellEditor(JBTable.createBooleanEditor());
+    }
+
+    table.getModel().addTableModelListener(new TableModelListener() {
+      public void tableChanged(TableModelEvent e) {
+        setModified(true);
+      }
+    });
+    myIgnorePanel = new AddEditRemovePanel<String>(new IgnoredUrlsModel(), myIgnoredUrls, XmlBundle.message("label.edit.external.resource.configure.ignored.resources")) {
+      protected String addItem() {
+        return addIgnoreLocation();
+      }
+
+      protected boolean removeItem(String o) {
+        setModified(true);
+        return true;
+      }
+
+      protected String editItem(String o) {
+        return editIgnoreLocation(o);
+      }
+    };
+    if (myProject != null) {
+      myHtmlLanguageLevelForm = new HtmlLanguageLevelForm(myProject);
+      myHtmlLanguageLevelForm.addListener(new HtmlLanguageLevelForm.MyListener() {
+        @Override
+        public void doctypeChanged() {
+          if (!myHtmlLanguageLevelForm.getDoctype().equals(myDefaultHtmlDoctype)) {
+            setModified(true);
+          }
+        }
+      });
+    }
+
+    myPanel.add(myExtPanel,
+                new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
+    myPanel.add(myIgnorePanel,
+                new GridBagConstraints(0, 1, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
+    if (myProject != null) {
+      myPanel.add(myHtmlLanguageLevelForm.getContentPanel(),
+                  new GridBagConstraints(0, 2, 1, 1, 1, 0, GridBagConstraints.SOUTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0),
+                                         0, 0));
+    }
+
+    myExtPanel.setData(myPairs);
+    myIgnorePanel.setData(myIgnoredUrls);
+
+    myExtPanel.getEmptyText().setText(XmlBundle.message("no.external.resources"));
+    myIgnorePanel.getEmptyText().setText(XmlBundle.message("no.ignored.resources"));
+
+    return myPanel;
+  }
+
+  public void apply() {
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        ExternalResourceManagerEx manager = ExternalResourceManagerEx.getInstanceEx();
+
+        if (myProject == null) {
+          manager.clearAllResources();
+        }
+        else {
+          manager.clearAllResources(myProject);
+        }
+        for (Object myPair : myPairs) {
+          NameLocationPair pair = (NameLocationPair)myPair;
+          String s = FileUtil.toSystemIndependentName(pair.myLocation);
+          if (myProject == null || pair.myShared) {
+            manager.addResource(pair.myName, s);
+          }
+          else {
+            manager.addResource(pair.myName, s, myProject);
+          }
+        }
+
+        for (Object myIgnoredUrl : myIgnoredUrls) {
+          String url = (String)myIgnoredUrl;
+          manager.addIgnoredResource(url);
+        }
+        if (myProject != null) {
+          manager.setDefaultHtmlDoctype(myHtmlLanguageLevelForm.getDoctype(), myProject);
+        }
+      }
+    });
+
+    setModified(false);
+  }
+
+  public void reset() {
+
+    myPairs = new ArrayList<NameLocationPair>(myNewPairs);
+    ExternalResourceManagerEx manager = ExternalResourceManagerEx.getInstanceEx();
+
+    String[] urls = manager.getAvailableUrls();
+    for (String url : urls) {
+      String loc = myProject == null ? manager.getResourceLocation(url, (String)null) : manager.getResourceLocation(url, myProject);
+      myPairs.add(new NameLocationPair(url, FileUtil.toSystemDependentName(loc), true));
+    }
+    if (myProject != null) {
+      urls = manager.getAvailableUrls(myProject);
+      for (String url : urls) {
+        String loc = manager.getResourceLocation(url, myProject);
+        myPairs.add(new NameLocationPair(url, FileUtil.toSystemDependentName(loc), false));
+      }
+    }
+
+    Collections.sort(myPairs);
+
+    myIgnoredUrls = new ArrayList<String>();
+    final String[] ignoredResources = manager.getIgnoredResources();
+    ContainerUtil.addAll(myIgnoredUrls, ignoredResources);
+
+    Collections.sort(myIgnoredUrls);
+
+    if (myExtPanel != null) {
+      myExtPanel.setData(myPairs);
+      myIgnorePanel.setData(myIgnoredUrls);
+      if (!myNewPairs.isEmpty()) {
+        ListSelectionModel selectionModel = myExtPanel.getTable().getSelectionModel();
+        selectionModel.clearSelection();
+        for (NameLocationPair newPair : myNewPairs) {
+          int index = myPairs.indexOf(newPair);
+          selectionModel.addSelectionInterval(index, index);
+        }
+      }
+     }
+
+    if (myProject != null) {
+      myDefaultHtmlDoctype = manager.getDefaultHtmlDoctype(myProject);
+      myHtmlLanguageLevelForm.resetFromDoctype(myDefaultHtmlDoctype);
+    }
+
+    setModified(!myNewPairs.isEmpty());
+  }
+
+  public void disposeUIResources() {
+    myPanel = null;
+    myExtPanel = null;
+    myIgnorePanel = null;
+    myHtmlLanguageLevelForm = null;
+  }
+
+  public String getHelpTopic() {
+    return "preferences.externalResources";
+  }
+
+  @Nullable
+  private NameLocationPair addExtLocation() {
+    MapExternalResourceDialog dialog = new MapExternalResourceDialog(null, myProject, null, null);
+    dialog.show();
+    if (!dialog.isOK()) return null;
+    setModified(true);
+    return new NameLocationPair(dialog.getUri(), dialog.getResourceLocation(), false);
+  }
+
+  @Nullable
+  private NameLocationPair editExtLocation(Object o) {
+    NameLocationPair pair = (NameLocationPair)o;
+    MapExternalResourceDialog dialog = new MapExternalResourceDialog(pair.getName(), myProject, null, pair.getLocation());
+    dialog.show();
+    if (!dialog.isOK()) {
+      return null;
+    }
+    setModified(true);
+    return new NameLocationPair(dialog.getUri(), dialog.getResourceLocation(), pair.myShared);
+  }
+
+  @Nullable
+  private String addIgnoreLocation() {
+    EditLocationDialog dialog = new EditLocationDialog(null, false);
+    dialog.show();
+    if (!dialog.isOK()) return null;
+    setModified(true);
+    return dialog.getPair().myName;
+  }
+
+  @Nullable
+  private String editIgnoreLocation(Object o) {
+    EditLocationDialog dialog = new EditLocationDialog(null, false);
+    dialog.init(new NameLocationPair(o.toString(), null, false));
+    dialog.show();
+    if (!dialog.isOK()) return null;
+    setModified(true);
+    return dialog.getPair().myName;
+  }
+
+  private static class PathRenderer extends DefaultTableCellRenderer {
+    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+      final Component rendererComponent = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+      if (value != null) {
+        String loc = value.toString().replace('\\', '/');
+        final int jarDelimIndex = loc.indexOf(JarFileSystem.JAR_SEPARATOR);
+        final VirtualFile path;
+
+        if (jarDelimIndex != -1) {
+          path = JarFileSystem.getInstance().findFileByPath(loc);
+        } else {
+          path = LocalFileSystem.getInstance().findFileByPath(loc);
+        }
+
+        setForeground(path != null ? isSelected ? UIUtil.getTableSelectionForeground() : Color.black : new Color(210, 0, 0));
+      }
+      return rendererComponent;
+    }
+  }
+
+  private static class IgnoredUrlsModel extends AddEditRemovePanel.TableModel<String> {
+    private final String[] myNames = {XmlBundle.message("column.name.edit.external.resource.uri")};
+
+    public int getColumnCount() {
+      return myNames.length;
+    }
+
+    public Object getField(String o, int columnIndex) {
+      return o;
+    }
+
+    public Class getColumnClass(int columnIndex) {
+      return String.class;
+    }
+
+    public boolean isEditable(int column) {
+      return false;
+    }
+
+    public void setValue(Object aValue, String data, int columnIndex) {
+
+    }
+
+    public String getColumnName(int column) {
+      return myNames[column];
+    }
+  }
+
+  private class ExtUrlsTableModel extends AddEditRemovePanel.TableModel<NameLocationPair> {
+    final String[] myNames;
+
+    {
+      List<String> names = new ArrayList<String>();
+      names.add(XmlBundle.message("column.name.edit.external.resource.uri"));
+      names.add(XmlBundle.message("column.name.edit.external.resource.location"));
+      if (myProject != null) {
+        names.add("Project");
+      }
+      myNames = ArrayUtil.toStringArray(names);
+    }
+
+    public int getColumnCount() {
+      return myNames.length;
+    }
+
+    public Object getField(NameLocationPair pair, int columnIndex) {
+      switch (columnIndex) {
+        case 0:
+          return pair.myName;
+        case 1:
+          return pair.myLocation;
+        case 2:
+          return !pair.myShared;
+      }
+
+      return "";
+    }
+
+    public Class getColumnClass(int columnIndex) {
+      return columnIndex == 2 ? Boolean.class : String.class;
+    }
+
+    public boolean isEditable(int column) {
+      return column == 2;
+    }
+
+    public void setValue(Object aValue, NameLocationPair data, int columnIndex) {
+      data.myShared = !((Boolean)aValue).booleanValue();
+    }
+
+    public String getColumnName(int column) {
+      return myNames[column];
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/ExternalResourceListener.java b/xml/impl/src/com/intellij/javaee/ExternalResourceListener.java
new file mode 100644
index 0000000..0bca97c
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/ExternalResourceListener.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+/**
+ * @author mike
+ */
+public interface ExternalResourceListener {
+  void externalResourceChanged();
+}
diff --git a/xml/impl/src/com/intellij/javaee/ExternalResourceManagerEx.java b/xml/impl/src/com/intellij/javaee/ExternalResourceManagerEx.java
new file mode 100644
index 0000000..00e93a4
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/ExternalResourceManagerEx.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.openapi.project.Project;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * author: lesya
+ */
+public abstract class ExternalResourceManagerEx extends ExternalResourceManager {
+  public static ExternalResourceManagerEx getInstanceEx(){
+    return (ExternalResourceManagerEx)getInstance();
+  }
+
+  public abstract void removeResource(String url, @NotNull Project project);
+
+  public abstract void addResource(@NonNls String url, @NonNls String location, @NotNull Project project);
+
+  public abstract String[] getAvailableUrls();
+  public abstract String[] getAvailableUrls(Project project);
+
+  public abstract void clearAllResources();
+  public abstract void clearAllResources(Project project);
+
+  public abstract void addIgnoredResource(String url);
+  public abstract void removeIgnoredResource(String url);
+
+  public abstract boolean isIgnoredResource(String url);
+
+  public abstract String[] getIgnoredResources();
+
+  public abstract void addExternalResourceListener(ExternalResourceListener listener);
+
+  public abstract void removeExternalResourceListener(ExternalResourceListener listener);
+
+  @Nullable
+  public abstract String getUserResourse(Project project, String url, String version);
+  @Nullable
+  public abstract String getStdResource(String url, String version);
+
+  @NotNull
+  public abstract String getDefaultHtmlDoctype(@NotNull Project project);
+
+  public abstract void setDefaultHtmlDoctype(@NotNull String defaultHtmlDoctype, @NotNull Project project);
+
+  public abstract String getCatalogPropertiesFile();
+  public abstract void setCatalogPropertiesFile(@Nullable String filePath);
+
+  public abstract long getModificationCount(@NotNull Project project);
+}
diff --git a/xml/impl/src/com/intellij/javaee/ExternalResourceManagerImpl.java b/xml/impl/src/com/intellij/javaee/ExternalResourceManagerImpl.java
new file mode 100644
index 0000000..9e53742
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/ExternalResourceManagerImpl.java
@@ -0,0 +1,585 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.application.options.PathMacrosImpl;
+import com.intellij.application.options.ReplacePathToMacroMap;
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.components.*;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.*;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.HashMap;
+import com.intellij.xml.Html5SchemaProvider;
+import com.intellij.xml.XmlSchemaProvider;
+import com.intellij.xml.util.XmlUtil;
+import org.jdom.Element;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.TestOnly;
+
+import java.io.File;
+import java.net.URL;
+import java.util.*;
+
+/**
+ * @author mike
+ */
+@State(name = "ExternalResourceManagerImpl",
+       storages = {@Storage( file = StoragePathMacros.APP_CONFIG + "/other.xml")})
+public class ExternalResourceManagerImpl extends ExternalResourceManagerEx implements JDOMExternalizable {
+  static final Logger LOG = Logger.getInstance("#com.intellij.j2ee.openapi.impl.ExternalResourceManagerImpl");
+
+  @NonNls public static final String J2EE_1_3 = "http://java.sun.com/dtd/";
+  @NonNls public static final String J2EE_1_2 = "http://java.sun.com/j2ee/dtds/";
+  @NonNls public static final String J2EE_NS = "http://java.sun.com/xml/ns/j2ee/";
+  @NonNls public static final String JAVAEE_NS = "http://java.sun.com/xml/ns/javaee/";
+  private static final String CATALOG_PROPERTIES_ELEMENT = "CATALOG_PROPERTIES";
+
+
+  private final Map<String, Map<String, String>> myResources = new HashMap<String, Map<String, String>>();
+  private final Set<String> myResourceLocations = new HashSet<String>();
+
+  private final Set<String> myIgnoredResources = new HashSet<String>();
+
+  private final AtomicNotNullLazyValue<Map<String, Map<String, Resource>>> myStdResources = new AtomicNotNullLazyValue<Map<String, Map<String, Resource>>>() {
+        
+    @NotNull
+    @Override
+    protected Map<String, Map<String, Resource>> compute() {
+      return computeStdResources();
+    }
+  };
+
+  private String myDefaultHtmlDoctype = HTML5_DOCTYPE_ELEMENT;
+
+  private String myCatalogPropertiesFile;
+  private XMLCatalogManager myCatalogManager;
+  private static final String HTML5_DOCTYPE_ELEMENT = "HTML5";
+
+  protected Map<String, Map<String, Resource>> computeStdResources() {
+    ResourceRegistrarImpl registrar = new ResourceRegistrarImpl();
+    for (StandardResourceProvider provider : Extensions.getExtensions(StandardResourceProvider.EP_NAME)) {
+      provider.registerResources(registrar);
+    }
+    StandardResourceEP[] extensions = Extensions.getExtensions(StandardResourceEP.EP_NAME);
+    for (StandardResourceEP extension : extensions) {
+      registrar.addStdResource(extension.url, extension.version, extension.resourcePath, null, extension.getLoaderForClass());
+    }
+
+    myIgnoredResources.addAll(registrar.getIgnored());
+    return registrar.getResources();
+  }
+
+  private final List<ExternalResourceListener> myListeners = new ArrayList<ExternalResourceListener>();
+  private long myModificationCount = 0;
+  private final PathMacrosImpl myPathMacros;
+  @NonNls private static final String RESOURCE_ELEMENT = "resource";
+  @NonNls private static final String URL_ATTR = "url";
+  @NonNls private static final String LOCATION_ATTR = "location";
+  @NonNls private static final String IGNORED_RESOURCE_ELEMENT = "ignored-resource";
+  @NonNls private static final String HTML_DEFAULT_DOCTYPE_ELEMENT = "default-html-doctype";
+  private static final String DEFAULT_VERSION = null;
+  @NonNls public static final String STANDARD_SCHEMAS = "/standardSchemas/";
+
+  public ExternalResourceManagerImpl(PathMacrosImpl pathMacros) {
+    myPathMacros = pathMacros;
+  }
+
+  public static boolean isStandardResource(VirtualFile file) {
+    VirtualFile parent = file.getParent();
+    return parent != null && parent.getName().equals("standardSchemas");
+  }
+
+  public boolean isUserResource(VirtualFile file) {
+    return myResourceLocations.contains(file.getUrl());
+  }
+
+  @Nullable
+  static <T> Map<String, T> getMap(@NotNull final Map<String, Map<String, T>> resources,
+                                    @Nullable final String version,
+                                    final boolean create) {
+    Map<String, T> map = resources.get(version);
+    if (map == null) {
+      if (create) {
+        map = ContainerUtil.newHashMap();
+        resources.put(version, map);
+      }
+      else if (version == null || !version.equals(DEFAULT_VERSION)) {
+        map = resources.get(DEFAULT_VERSION);
+      }
+    }
+
+    return map;
+  }
+
+  public String getResourceLocation(String url) {
+    return getResourceLocation(url, DEFAULT_VERSION);
+  }
+
+  public String getResourceLocation(@NonNls String url, String version) {
+    String result = getUserResource(url, version);
+    if (result == null) {
+      XMLCatalogManager manager = getCatalogManager();
+      if (manager != null) {
+        result = manager.resolve(url);
+      }
+    }
+    if (result == null) {
+      result = getStdResource(url, version);
+    }
+    if (result == null) {
+      result = url;
+    }
+    return result;
+  }
+
+  @Override
+  @Nullable
+  public String getUserResourse(Project project, String url, String version) {
+    String resourse = getProjectResources(project).getUserResource(url, version);
+    return resourse == null ? getUserResource(url, version) : resourse;
+  }
+
+  @Override
+  @Nullable
+  public String getStdResource(String url, String version) {
+    Map<String, Resource> map = getMap(myStdResources.getValue(), version, false);
+    if (map != null) {
+      Resource resource = map.get(url);
+      return resource == null ? null : resource.getResourceUrl();
+    }
+    else {
+      return null;
+    }
+  }
+
+  @Nullable
+  private String getUserResource(String url, String version) {
+    Map<String, String> map = getMap(myResources, version, false);
+    return map != null ? map.get(url) : null;
+  }
+
+  public String getResourceLocation(@NonNls String url, @NotNull Project project) {
+    String location = getProjectResources(project).getResourceLocation(url);
+    return location == null || location.equals(url) ? getResourceLocation(url) : location;
+  }
+
+  public String getResourceLocation(@NonNls String url, String version, @NotNull Project project) {
+    String location = getProjectResources(project).getResourceLocation(url, version);
+    return location == null || location.equals(url) ? getResourceLocation(url, version) : location;
+  }
+
+  @Nullable
+  public PsiFile getResourceLocation(@NotNull @NonNls final String url, @NotNull final PsiFile baseFile, final String version) {
+    final XmlFile schema = XmlSchemaProvider.findSchema(url, baseFile);
+    if (schema != null) {
+      return schema;
+    }
+    final String location = getResourceLocation(url, version, baseFile.getProject());
+    return XmlUtil.findXmlFile(baseFile, location);
+  }
+
+  public String[] getResourceUrls(FileType fileType, final boolean includeStandard) {
+    return getResourceUrls(fileType, DEFAULT_VERSION, includeStandard);
+  }
+
+  public String[] getResourceUrls(@Nullable final FileType fileType, @NonNls final String version, final boolean includeStandard) {
+    final List<String> result = new LinkedList<String>();
+    addResourcesFromMap(result, version, myResources);
+
+    if (includeStandard) {
+      addResourcesFromMap(result, version, myStdResources.getValue());
+    }
+
+    return ArrayUtil.toStringArray(result);
+  }
+
+  private static <T> void addResourcesFromMap(final List<String> result,
+                                          String version,
+                                          Map<String, Map<String, T>> resourcesMap) {
+    Map<String, T> resources = getMap(resourcesMap, version, false);
+    if (resources == null) return;
+    result.addAll(resources.keySet());
+  }
+
+  @TestOnly
+  public static void addTestResource(final String url, final String location, Disposable parentDisposable) {
+    final ExternalResourceManagerImpl instance = (ExternalResourceManagerImpl)getInstance();
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        instance.addResource(url, location);
+      }
+    });
+    Disposer.register(parentDisposable, new Disposable() {
+      @Override
+      public void dispose() {
+        ApplicationManager.getApplication().runWriteAction(new Runnable() {
+          public void run() {
+            instance.removeResource(url);
+          }
+        });
+      }
+    });
+  }
+  public void addResource(String url, String location) {
+    addResource(url, DEFAULT_VERSION, location);
+  }
+
+  public void addResource(@NonNls String url, @NonNls String version, @NonNls String location) {
+    ApplicationManager.getApplication().assertWriteAccessAllowed();
+    addSilently(url, version, location);
+    fireExternalResourceChanged();
+  }
+
+  private void addSilently(String url, String version, String location) {
+    final Map<String, String> map = getMap(myResources, version, true);
+    assert map != null;
+    map.put(url, location);
+    myResourceLocations.add(location);
+    myModificationCount++;
+  }
+
+  public void removeResource(String url) {
+    removeResource(url, DEFAULT_VERSION);
+  }
+
+  public void removeResource(String url, String version) {
+    ApplicationManager.getApplication().assertWriteAccessAllowed();
+    Map<String, String> map = getMap(myResources, version, false);
+    if (map != null) {
+      String location = map.remove(url);
+      if (location != null) {
+        myResourceLocations.remove(location);
+      }
+      myModificationCount++;
+      fireExternalResourceChanged();
+    }
+  }
+
+  @Override
+  public void removeResource(String url, @NotNull Project project) {
+    getProjectResources(project).removeResource(url);
+  }
+
+  @Override
+  public void addResource(@NonNls String url, @NonNls String location, @NotNull Project project) {
+    getProjectResources(project).addResource(url, location);
+  }
+
+  public String[] getAvailableUrls() {
+    Set<String> urls = new HashSet<String>();
+    for (Map<String, String> map : myResources.values()) {
+      urls.addAll(map.keySet());
+    }
+    return ArrayUtil.toStringArray(urls);
+  }
+
+  @Override
+  public String[] getAvailableUrls(Project project) {
+    return getProjectResources(project).getAvailableUrls();
+  }
+
+  public void clearAllResources() {
+    myResources.clear();
+    myIgnoredResources.clear();
+  }
+
+  public void clearAllResources(Project project) {
+    ApplicationManager.getApplication().assertWriteAccessAllowed();
+    clearAllResources();
+    getProjectResources(project).clearAllResources();
+    myModificationCount++;
+    fireExternalResourceChanged();
+  }
+
+  public void addIgnoredResource(String url) {
+    ApplicationManager.getApplication().assertWriteAccessAllowed();
+    addIgnoredSilently(url);
+    fireExternalResourceChanged();
+  }
+
+  private void addIgnoredSilently(String url) {
+    myIgnoredResources.add(url);
+    myModificationCount++;
+  }
+
+  public void removeIgnoredResource(String url) {
+    ApplicationManager.getApplication().assertWriteAccessAllowed();
+    if (myIgnoredResources.remove(url)) {
+      myModificationCount++;
+      fireExternalResourceChanged();
+    }
+  }
+
+  public boolean isIgnoredResource(String url) {
+    myStdResources.getValue();  // ensure ignored resources are loaded
+    return myIgnoredResources.contains(url) || isImplicitNamespaceDescriptor(url);
+  }
+
+  private static boolean isImplicitNamespaceDescriptor(String url) {
+    for (ImplicitNamespaceDescriptorProvider namespaceDescriptorProvider : Extensions
+      .getExtensions(ImplicitNamespaceDescriptorProvider.EP_NAME)) {
+      if (namespaceDescriptorProvider.getNamespaceDescriptor(null, url, null) != null) return true;
+    }
+    return false;
+  }
+
+  public String[] getIgnoredResources() {
+    myStdResources.getValue();  // ensure ignored resources are loaded
+    return ArrayUtil.toStringArray(myIgnoredResources);
+  }
+
+  public long getModificationCount() {
+    return myModificationCount;
+  }
+
+  @Override
+  public long getModificationCount(@NotNull Project project) {
+    return getProjectResources(project).getModificationCount();
+  }
+
+  public void readExternal(Element element) throws InvalidDataException {
+    final ExpandMacroToPathMap macroExpands = new ExpandMacroToPathMap();
+    myPathMacros.addMacroExpands(macroExpands);
+    macroExpands.substitute(element, SystemInfo.isFileSystemCaseSensitive);
+
+    myModificationCount++;
+    for (final Object o1 : element.getChildren(RESOURCE_ELEMENT)) {
+      Element e = (Element)o1;
+      addSilently(e.getAttributeValue(URL_ATTR), DEFAULT_VERSION, e.getAttributeValue(LOCATION_ATTR).replace('/', File.separatorChar));
+    }
+
+    for (final Object o : element.getChildren(IGNORED_RESOURCE_ELEMENT)) {
+      Element e = (Element)o;
+      addIgnoredSilently(e.getAttributeValue(URL_ATTR));
+    }
+
+    Element child = element.getChild(HTML_DEFAULT_DOCTYPE_ELEMENT);
+    if (child != null) {
+      String text = child.getText();
+      if (FileUtil.toSystemIndependentName(text).endsWith("idea.jar!/resources/html5-schema/html5.rnc")) {
+        text = HTML5_DOCTYPE_ELEMENT;
+      }
+      myDefaultHtmlDoctype = text;
+    }
+    Element catalogElement = element.getChild(CATALOG_PROPERTIES_ELEMENT);
+    if (catalogElement != null) {
+      myCatalogPropertiesFile = catalogElement.getTextTrim();
+    }
+  }
+
+  public void writeExternal(Element element) throws WriteExternalException {
+    final String[] urls = getAvailableUrls();
+    for (String url : urls) {
+      if (url == null) continue;
+      String location = getResourceLocation(url);
+      if (location == null) continue;
+      final Element e = new Element(RESOURCE_ELEMENT);
+
+      e.setAttribute(URL_ATTR, url);
+      e.setAttribute(LOCATION_ATTR, location.replace(File.separatorChar, '/'));
+      element.addContent(e);
+    }
+
+    final String[] ignoredResources = getIgnoredResources();
+    for (String ignoredResource : ignoredResources) {
+      final Element e = new Element(IGNORED_RESOURCE_ELEMENT);
+
+      e.setAttribute(URL_ATTR, ignoredResource);
+      element.addContent(e);
+    }
+
+    if (myDefaultHtmlDoctype != null && !HTML5_DOCTYPE_ELEMENT.equals(myDefaultHtmlDoctype)) {
+      final Element e = new Element(HTML_DEFAULT_DOCTYPE_ELEMENT);
+      e.setText(myDefaultHtmlDoctype);
+      element.addContent(e);
+    }
+    if (myCatalogPropertiesFile != null) {
+      Element properties = new Element(CATALOG_PROPERTIES_ELEMENT);
+      properties.setText(myCatalogPropertiesFile);
+      element.addContent(properties);
+    }
+    final ReplacePathToMacroMap macroReplacements = new ReplacePathToMacroMap();
+    PathMacrosImpl.getInstanceEx().addMacroReplacements(macroReplacements);
+    macroReplacements.substitute(element, SystemInfo.isFileSystemCaseSensitive);
+  }
+
+  public void addExternalResourceListener(ExternalResourceListener listener) {
+    myListeners.add(listener);
+  }
+
+  public void removeExternalResourceListener(ExternalResourceListener listener) {
+    myListeners.remove(listener);
+  }
+
+  private void fireExternalResourceChanged() {
+    for (ExternalResourceListener listener : myListeners.toArray(new ExternalResourceListener[myListeners.size()])) {
+      listener.externalResourceChanged();
+    }
+  }
+
+  Collection<Map<String, Resource>> getStandardResources() {
+    return myStdResources.getValue().values();
+  }
+
+
+  private static final NotNullLazyKey<ProjectResources, Project> INSTANCE_CACHE = ServiceManager.createLazyKey(ProjectResources.class);
+
+  private static ExternalResourceManagerImpl getProjectResources(Project project) {
+    return INSTANCE_CACHE.getValue(project);
+  }
+
+  @Override
+  @NotNull
+  public String getDefaultHtmlDoctype(@NotNull Project project) {
+    final String doctype = getProjectResources(project).myDefaultHtmlDoctype;
+    if (XmlUtil.XHTML_URI.equals(doctype)) {
+      return XmlUtil.XHTML4_SCHEMA_LOCATION;
+    }
+    else if (HTML5_DOCTYPE_ELEMENT.equals(doctype)) {
+      return Html5SchemaProvider.HTML5_SCHEMA_LOCATION;
+    }
+    else {
+      return doctype;
+    }
+  }
+
+  @Override
+  public void setDefaultHtmlDoctype(@NotNull String defaultHtmlDoctype, @NotNull Project project) {
+    getProjectResources(project).setDefaultHtmlDoctype(defaultHtmlDoctype);
+  }
+
+  @Override
+  public String getCatalogPropertiesFile() {
+    return myCatalogPropertiesFile;
+  }
+
+  @Override
+  public void setCatalogPropertiesFile(String filePath) {
+    myCatalogManager = null;
+    myCatalogPropertiesFile = filePath;
+    myModificationCount++;
+  }
+
+  @Nullable
+  private XMLCatalogManager getCatalogManager() {
+    if (myCatalogManager == null && myCatalogPropertiesFile != null) {
+      myCatalogManager = new XMLCatalogManager(myCatalogPropertiesFile);
+    }
+    return myCatalogManager;
+  }
+
+  private void setDefaultHtmlDoctype(String defaultHtmlDoctype) {
+    myModificationCount++;
+
+    if (Html5SchemaProvider.HTML5_SCHEMA_LOCATION.equals(defaultHtmlDoctype)) {
+      myDefaultHtmlDoctype = HTML5_DOCTYPE_ELEMENT;
+    }
+    else {
+      myDefaultHtmlDoctype = defaultHtmlDoctype;
+    }
+    fireExternalResourceChanged();
+  }
+
+  @TestOnly
+  public static void registerResourceTemporarily(final String url, final String location, Disposable disposable) {
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        getInstance().addResource(url, location);
+      }
+    });
+
+    Disposer.register(disposable, new Disposable() {
+      @Override
+      public void dispose() {
+        ApplicationManager.getApplication().runWriteAction(new Runnable() {
+          public void run() {
+            getInstance().removeResource(url);
+          }
+        });
+      }
+    });
+  }
+
+  static class Resource {
+    String file;
+    ClassLoader classLoader;
+    Class clazz;
+
+    @Nullable
+    String getResourceUrl() {
+
+      if (classLoader == null && clazz == null) return file;
+
+      final URL resource = clazz == null ? classLoader.getResource(file) : clazz.getResource(file);
+      classLoader = null;
+      clazz = null;
+      if (resource == null) {
+        String message = "Cannot find standard resource. filename:" + file + " class=" + classLoader;
+        if (ApplicationManager.getApplication().isUnitTestMode()) {
+          LOG.error(message);
+        }
+        else {
+          LOG.warn(message);
+        }
+
+        return null;
+      }
+
+      String path = FileUtil.unquote(resource.toString());
+      // this is done by FileUtil for windows
+      path = path.replace('\\','/');
+      file = path;
+      return path;
+    }
+
+
+    @Override
+    public boolean equals(Object o) {
+      if (this == o) return true;
+      if (o == null || getClass() != o.getClass()) return false;
+
+      Resource resource = (Resource)o;
+
+      if (classLoader != resource.classLoader) return false;
+      if (clazz != resource.clazz) return false;
+      if (file != null ? !file.equals(resource.file) : resource.file != null) return false;
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return file.hashCode();
+    }
+
+    @Override
+    public String toString() {
+      return file + " for " + classLoader;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/ExternalResourcesRootsProvider.java b/xml/impl/src/com/intellij/javaee/ExternalResourcesRootsProvider.java
new file mode 100644
index 0000000..40fb2a7
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/ExternalResourcesRootsProvider.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.codeInsight.daemon.impl.quickfix.FetchExtResourceAction;
+import com.intellij.openapi.util.NotNullLazyValue;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.indexing.IndexableSetContributor;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class ExternalResourcesRootsProvider extends IndexableSetContributor {
+
+  private final NotNullLazyValue<Set<String>> myStandardResources = new NotNullLazyValue<Set<String>>() {
+    @NotNull
+    @Override
+    protected Set<String> compute() {
+      ExternalResourceManagerImpl manager = (ExternalResourceManagerImpl)ExternalResourceManager.getInstance();
+      Collection<Map<String,ExternalResourceManagerImpl.Resource>> resources = manager.getStandardResources();
+      Set<ExternalResourceManagerImpl.Resource> dirs = new HashSet<ExternalResourceManagerImpl.Resource>();
+      Set<String> set = new HashSet<String>();
+      for (Map<String, ExternalResourceManagerImpl.Resource> map : resources) {
+        for (ExternalResourceManagerImpl.Resource resource : map.values()) {
+          ExternalResourceManagerImpl.Resource dir = new ExternalResourceManagerImpl.Resource();
+          int i = resource.file.lastIndexOf('/');
+          dir.file = i > 0 ? resource.file.substring(0, i) : resource.file;
+          dir.classLoader = resource.classLoader;
+          dir.clazz = resource.clazz;
+          if (dirs.add(dir)) {
+            String url = resource.getResourceUrl();
+            if (url != null) {
+              set.add(url.substring(0, url.lastIndexOf('/')));
+            }
+          }
+        }
+      }
+      return set;
+    }
+  };
+
+  public Set<VirtualFile> getAdditionalRootsToIndex() {
+
+    HashSet<VirtualFile> roots = new HashSet<VirtualFile>();
+    for (String url : myStandardResources.getValue()) {
+      VirtualFile file = VfsUtil.findRelativeFile(url, null);
+      if (file != null) {
+        roots.add(file);
+      }
+    }
+
+    String path = FetchExtResourceAction.getExternalResourcesPath();
+    VirtualFile extResources = LocalFileSystem.getInstance().findFileByPath(path);
+    ContainerUtil.addIfNotNull(extResources, roots);
+    
+    return roots;
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/HtmlLanguageLevelForm.form b/xml/impl/src/com/intellij/javaee/HtmlLanguageLevelForm.form
new file mode 100644
index 0000000..60ecb1c
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/HtmlLanguageLevelForm.form
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.javaee.HtmlLanguageLevelForm">
+  <grid id="27dc6" binding="myContentPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="20" y="20" width="326" height="138"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <grid id="adc9b" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <clientProperties>
+          <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+        </clientProperties>
+        <border type="none" title="Default HTML language level"/>
+        <children>
+          <component id="aad8c" class="javax.swing.JRadioButton" binding="myHtml4RadioButton">
+            <constraints>
+              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="HTML 4 (&quot;http://www.w3.org/TR/html4/loose.dtd&quot;)"/>
+            </properties>
+          </component>
+          <component id="bb372" class="javax.swing.JRadioButton" binding="myHtml5RadioButton">
+            <constraints>
+              <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="HTML 5"/>
+            </properties>
+          </component>
+          <grid id="6ae8e" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+            <margin top="0" left="0" bottom="0" right="0"/>
+            <constraints>
+              <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties/>
+            <border type="none"/>
+            <children>
+              <component id="192c4" class="javax.swing.JRadioButton" binding="myOtherRadioButton" default-binding="true">
+                <constraints>
+                  <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                </constraints>
+                <properties>
+                  <text value="Other doctype:"/>
+                </properties>
+              </component>
+              <grid id="88e81" binding="myOtherDoctypeWrapper" layout-manager="BorderLayout" hgap="0" vgap="0">
+                <constraints>
+                  <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+                </constraints>
+                <properties/>
+                <border type="none"/>
+                <children/>
+              </grid>
+            </children>
+          </grid>
+        </children>
+      </grid>
+    </children>
+  </grid>
+  <buttonGroups>
+    <group name="buttonGroup1">
+      <member id="aad8c"/>
+      <member id="bb372"/>
+      <member id="192c4"/>
+    </group>
+  </buttonGroups>
+</form>
diff --git a/xml/impl/src/com/intellij/javaee/HtmlLanguageLevelForm.java b/xml/impl/src/com/intellij/javaee/HtmlLanguageLevelForm.java
new file mode 100644
index 0000000..5f31930
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/HtmlLanguageLevelForm.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.openapi.editor.event.DocumentAdapter;
+import com.intellij.openapi.editor.event.DocumentEvent;
+import com.intellij.openapi.project.Project;
+import com.intellij.ui.TextFieldWithAutoCompletion;
+import com.intellij.util.ui.UIUtil;
+import com.intellij.xml.Html5SchemaProvider;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class HtmlLanguageLevelForm {
+  private JRadioButton myHtml4RadioButton;
+  private JRadioButton myHtml5RadioButton;
+  private JRadioButton myOtherRadioButton;
+  private JPanel myContentPanel;
+  private JPanel myOtherDoctypeWrapper;
+  private final TextFieldWithAutoCompletion myDoctypeTextField;
+  private final List<MyListener> myListeners = new ArrayList<MyListener>();
+
+  public HtmlLanguageLevelForm(Project project) {
+    final String[] urls = ExternalResourceManager.getInstance().getResourceUrls(null, true);
+    myDoctypeTextField = TextFieldWithAutoCompletion.create(project, Arrays.asList(urls), null, true, null);
+    myOtherDoctypeWrapper.add(myDoctypeTextField);
+    ActionListener listener = new ActionListener() {
+      @Override
+      public void actionPerformed(ActionEvent e) {
+        myDoctypeTextField.setEnabled(myOtherRadioButton.isSelected());
+        fireDoctypeChanged();
+      }
+    };
+    myHtml4RadioButton.addActionListener(listener);
+    myHtml5RadioButton.addActionListener(listener);
+    myOtherRadioButton.addActionListener(listener);
+    myDoctypeTextField.addDocumentListener(new DocumentAdapter() {
+      @Override
+      public void documentChanged(DocumentEvent e) {
+        fireDoctypeChanged();
+      }
+    });
+  }
+
+  public JPanel getContentPanel() {
+    return myContentPanel;
+  }
+
+  @NotNull
+  public String getDoctype() {
+    if (myHtml4RadioButton.isSelected()) {
+      return XmlUtil.XHTML_URI;
+    }
+    if (myHtml5RadioButton.isSelected()) {
+      return Html5SchemaProvider.HTML5_SCHEMA_LOCATION;
+    }
+    return myDoctypeTextField.getText();
+  }
+
+  public void resetFromDoctype(final String doctype) {
+    if (doctype == null || doctype.isEmpty() || doctype.equals(XmlUtil.XHTML4_SCHEMA_LOCATION)) {
+      myHtml4RadioButton.setSelected(true);
+      myDoctypeTextField.setEnabled(false);
+    }
+    else if (doctype.equals(Html5SchemaProvider.HTML5_SCHEMA_LOCATION)) {
+      myHtml5RadioButton.setSelected(true);
+      myDoctypeTextField.setEnabled(false);
+    }
+    else {
+      myOtherRadioButton.setSelected(true);
+      myDoctypeTextField.setEnabled(true);
+      UIUtil.invokeLaterIfNeeded(new Runnable() {
+        @Override
+        public void run() {
+          try {
+            myDoctypeTextField.setText(doctype);
+          }
+          catch (Exception e) {
+            throw new RuntimeException(e);
+          }
+        }
+      });
+    }
+  }
+
+  public void addListener(@NotNull MyListener listener) {
+    myListeners.add(listener);
+  }
+
+  public void removeListener(@NotNull MyListener listener) {
+    myListeners.remove(listener);
+  }
+
+  private void fireDoctypeChanged() {
+    for (MyListener listener : myListeners) {
+      listener.doctypeChanged();
+    }
+  }
+
+  public interface MyListener {
+    void doctypeChanged();
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/ImplicitNamespaceDescriptorProvider.java b/xml/impl/src/com/intellij/javaee/ImplicitNamespaceDescriptorProvider.java
new file mode 100644
index 0000000..d3f0a34
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/ImplicitNamespaceDescriptorProvider.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.module.Module;
+import com.intellij.psi.PsiFile;
+import com.intellij.xml.XmlNSDescriptor;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public interface ImplicitNamespaceDescriptorProvider {
+  @NonNls ExtensionPointName<ImplicitNamespaceDescriptorProvider> EP_NAME = ExtensionPointName.create("com.intellij.xml.implicitNamespaceDescriptorProvider");
+
+  @Nullable
+  XmlNSDescriptor getNamespaceDescriptor(@Nullable Module module, @NotNull final String ns, @Nullable PsiFile file);
+}
diff --git a/xml/impl/src/com/intellij/javaee/InternalResourceProvider.java b/xml/impl/src/com/intellij/javaee/InternalResourceProvider.java
new file mode 100644
index 0000000..d9755ad
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/InternalResourceProvider.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlUtil;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class InternalResourceProvider implements StandardResourceProvider{
+
+  public void registerResources(ResourceRegistrar registrar) {
+    ResourceRegistrarImpl impl = (ResourceRegistrarImpl)registrar;
+    
+    impl.addInternalResource(XmlUtil.XSLT_URI,"xslt-1_0.xsd");
+    impl.addInternalResource(XmlUtil.XSLT_URI,"2.0", "xslt-2_0.xsd");
+    impl.addInternalResource(XmlUtil.XINCLUDE_URI,"xinclude.xsd");
+    impl.addInternalResource(XmlUtil.XML_SCHEMA_URI, "XMLSchema.xsd");
+    impl.addInternalResource(XmlUtil.XML_SCHEMA_URI + ".xsd", "XMLSchema.xsd");
+    impl.addInternalResource("http://www.w3.org/2001/XMLSchema.dtd", "XMLSchema.dtd");
+    impl.addInternalResource(XmlUtil.XML_SCHEMA_INSTANCE_URI, "XMLSchema-instance.xsd");
+    impl.addInternalResource("http://www.w3.org/2001/xml.xsd","xml.xsd");
+    impl.addInternalResource(XmlUtil.XML_NAMESPACE_URI,"xml.xsd");
+    impl.addInternalResource(XmlUtil.XHTML_URI,"xhtml1-transitional.xsd");
+    impl.addInternalResource("http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd","xhtml1-strict.xsd");
+
+    impl.addInternalResource("http://www.w3.org/TR/html4/strict.dtd","xhtml1-strict.dtd");
+    impl.addInternalResource(XmlUtil.HTML4_LOOSE_URI,"xhtml1-transitional.dtd");
+    impl.addInternalResource("http://www.w3.org/TR/html4/frameset.dtd","xhtml1-frameset.dtd");
+    impl.addInternalResource("http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd","xhtml1-strict.dtd");
+    impl.addInternalResource("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd","xhtml1-transitional.dtd");
+    impl.addInternalResource("http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd","xhtml1-frameset.dtd");
+    impl.addInternalResource("http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd","xhtml11/xhtml11.dtd");
+
+    impl.addInternalResource("urn:oasis:names:tc:entity:xmlns:xml:catalog", "catalog.xsd");
+
+    // Plugins DTDs // stathik
+    impl.addInternalResource("http://plugins.intellij.net/plugin.dtd", "plugin.dtd");
+    impl.addInternalResource("http://plugins.intellij.net/plugin-repository.dtd", "plugin-repository.dtd");
+
+    // mobile
+    impl.addInternalResource("http://www.wapforum.org/DTD/xhtml-mobile10.dtd", "xhtml-mobile/xhtml-mobile10.dtd");
+    impl.addInternalResource("http://www.wapforum.org/DTD/xhtml-mobile10-flat.dtd", "xhtml-mobile/xhtml-mobile10-flat.dtd");
+    impl.addInternalResource("http://www.wapforum.org/DTD/xhtml-mobile12.dtd", "xhtml-mobile/xhtml-mobile12.dtd");
+
+    impl.addInternalResource("http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd", "xhtml-mobile/xhtml-mobile12.dtd");
+
+    // svg and mathML
+    impl.addIgnoredResource(HtmlUtil.MATH_ML_NAMESPACE);
+    impl.addIgnoredResource(HtmlUtil.SVG_NAMESPACE);
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/MapExternalResourceDialog.form b/xml/impl/src/com/intellij/javaee/MapExternalResourceDialog.form
new file mode 100644
index 0000000..49c27b2
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/MapExternalResourceDialog.form
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.javaee.MapExternalResourceDialog">
+  <grid id="27dc6" binding="myMainPanel" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="20" y="20" width="500" height="400"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <component id="95c44" class="com.intellij.ui.components.JBLabel">
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <labelFor value="3a92c"/>
+          <text value="&amp;URI:"/>
+        </properties>
+      </component>
+      <component id="3a92c" class="javax.swing.JTextField" binding="myUri">
+        <constraints>
+          <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="150" height="-1"/>
+          </grid>
+        </constraints>
+        <properties/>
+      </component>
+      <grid id="2057d" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <border type="none"/>
+        <children>
+          <tabbedpane id="c9457" class="com.intellij.ui.components.JBTabbedPane" binding="myTabs">
+            <constraints>
+              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties/>
+            <border type="none"/>
+            <children>
+              <grid id="39983" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+                <margin top="0" left="0" bottom="0" right="0"/>
+                <constraints>
+                  <tabbedpane title="Schemas"/>
+                </constraints>
+                <properties/>
+                <border type="none"/>
+                <children>
+                  <scrollpane id="ec831" class="com.intellij.ui.components.JBScrollPane">
+                    <constraints>
+                      <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties/>
+                    <border type="none"/>
+                    <children>
+                      <component id="a85b4" class="com.intellij.ui.treeStructure.Tree" binding="mySchemasTree">
+                        <constraints/>
+                        <properties/>
+                      </component>
+                    </children>
+                  </scrollpane>
+                </children>
+              </grid>
+              <grid id="d3553" binding="myExplorerPanel" custom-create="true" layout-manager="BorderLayout" hgap="0" vgap="0">
+                <constraints>
+                  <tabbedpane title="Explorer"/>
+                </constraints>
+                <properties/>
+                <border type="none"/>
+                <children/>
+              </grid>
+            </children>
+          </tabbedpane>
+        </children>
+      </grid>
+    </children>
+  </grid>
+</form>
diff --git a/xml/impl/src/com/intellij/javaee/MapExternalResourceDialog.java b/xml/impl/src/com/intellij/javaee/MapExternalResourceDialog.java
new file mode 100644
index 0000000..eae3953
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/MapExternalResourceDialog.java
@@ -0,0 +1,246 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.ide.util.PropertiesComponent;
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.editor.colors.EditorColorsManager;
+import com.intellij.openapi.editor.colors.EditorFontType;
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import com.intellij.openapi.fileChooser.FileSystemTree;
+import com.intellij.openapi.fileChooser.ex.FileSystemTreeImpl;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtilCore;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.ui.ColoredTreeCellRenderer;
+import com.intellij.ui.DocumentAdapter;
+import com.intellij.ui.ScrollPaneFactory;
+import com.intellij.ui.components.JBPanel;
+import com.intellij.ui.components.JBTabbedPane;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.ui.tree.TreeUtil;
+import com.intellij.xml.config.ConfigFileSearcher;
+import com.intellij.xml.config.ConfigFilesTreeBuilder;
+import com.intellij.xml.index.IndexedRelevantResource;
+import com.intellij.xml.index.XmlNamespaceIndex;
+import com.intellij.xml.index.XsdNamespaceBuilder;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreePath;
+import java.awt.*;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 7/17/12
+ */
+public class MapExternalResourceDialog extends DialogWrapper {
+
+  private static final String MAP_EXTERNAL_RESOURCE_SELECTED_TAB = "map.external.resource.selected.tab";
+  private JTextField myUri;
+  private JPanel myMainPanel;
+  private JTree mySchemasTree;
+  private JPanel myExplorerPanel;
+  private JBTabbedPane myTabs;
+  private final FileSystemTreeImpl myExplorer;
+  private String myLocation;
+
+  public MapExternalResourceDialog(String uri, @NotNull Project project, @Nullable PsiFile file, @Nullable String location) {
+    super(project);
+    setTitle("Map External Resource");
+    myUri.setText(uri);
+
+    DefaultMutableTreeNode root = new DefaultMutableTreeNode();
+    mySchemasTree.setModel(new DefaultTreeModel(root));
+    ConfigFileSearcher searcher = new ConfigFileSearcher(file == null ? null : ModuleUtilCore.findModuleForPsiElement(file), project) {
+      @Override
+      public Set<PsiFile> search(@Nullable Module module, @NotNull Project project) {
+        List<IndexedRelevantResource<String, XsdNamespaceBuilder>> resources = XmlNamespaceIndex.getAllResources(module, project, null);
+
+        HashSet<PsiFile> files = new HashSet<PsiFile>();
+        PsiManager psiManager = PsiManager.getInstance(project);
+        for (IndexedRelevantResource<String, XsdNamespaceBuilder> resource : resources) {
+          VirtualFile file = resource.getFile();
+          PsiFile psiFile = psiManager.findFile(file);
+          ContainerUtil.addIfNotNull(files, psiFile);
+        }
+        return files;
+      }
+    };
+    searcher.search();
+    new ConfigFilesTreeBuilder(mySchemasTree).buildTree(searcher, root);
+    TreeUtil.expandAll(mySchemasTree);
+    mySchemasTree.setRootVisible(false);
+    mySchemasTree.setShowsRootHandles(true);
+
+    ColoredTreeCellRenderer renderer = new ColoredTreeCellRenderer() {
+      @Override
+      public void customizeCellRenderer(JTree tree,
+                                        Object value,
+                                        boolean selected,
+                                        boolean expanded,
+                                        boolean leaf,
+                                        int row,
+                                        boolean hasFocus) {
+        ConfigFilesTreeBuilder.renderNode(value, expanded, this);
+      }
+    };
+    renderer.setFont(EditorColorsManager.getInstance().getGlobalScheme().getFont(EditorFontType.PLAIN));
+
+    mySchemasTree.setCellRenderer(renderer);
+    MouseAdapter mouseAdapter = new MouseAdapter() {
+      @Override
+      public void mouseClicked(MouseEvent e) {
+        if (e.getClickCount() > 1 && isOKActionEnabled()) {
+          doOKAction();
+        }
+      }
+    };
+    mySchemasTree.addMouseListener(mouseAdapter);
+
+    myUri.getDocument().addDocumentListener(new DocumentAdapter() {
+      @Override
+      protected void textChanged(DocumentEvent e) {
+        validateInput();
+      }
+    });
+    mySchemasTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
+      @Override
+      public void valueChanged(TreeSelectionEvent e) {
+        validateInput();
+      }
+    });
+
+    myExplorer = new FileSystemTreeImpl(project, new FileChooserDescriptor(true, false, false, false, true, false));
+
+    myExplorer.addListener(new FileSystemTree.Listener() {
+      @Override
+      public void selectionChanged(List<VirtualFile> selection) {
+        validateInput();
+      }
+    }, myExplorer);
+    myExplorer.getTree().addMouseListener(mouseAdapter);
+
+    myExplorerPanel.add(ScrollPaneFactory.createScrollPane(myExplorer.getTree()), BorderLayout.CENTER);
+
+    AnAction actionGroup = ActionManager.getInstance().getAction("FileChooserToolbar");
+    ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, (ActionGroup)actionGroup, true);
+    toolbar.setTargetComponent(myExplorerPanel);
+    myExplorerPanel.add(toolbar.getComponent(), BorderLayout.NORTH);
+
+    PsiFile schema = null;
+    if (file != null) {
+      schema = XmlUtil.findNamespaceByLocation(file, uri);
+    }
+    else if (location != null) {
+      VirtualFile virtualFile = VfsUtil.findRelativeFile(location, null);
+      if (virtualFile != null) {
+        schema = PsiManager.getInstance(project).findFile(virtualFile);
+      }
+    }
+
+    if (schema != null) {
+      DefaultMutableTreeNode node = TreeUtil.findNodeWithObject(root, schema);
+      if (node != null) {
+        TreeUtil.selectNode(mySchemasTree, node);
+      }
+      myExplorer.select(schema.getVirtualFile(), null);
+    }
+
+    int index = PropertiesComponent.getInstance().getOrInitInt(MAP_EXTERNAL_RESOURCE_SELECTED_TAB, 0);
+    myTabs.setSelectedIndex(index);
+    myTabs.getModel().addChangeListener(new ChangeListener() {
+      @Override
+      public void stateChanged(ChangeEvent e) {
+        PropertiesComponent.getInstance().setValue(MAP_EXTERNAL_RESOURCE_SELECTED_TAB, Integer.toString(myTabs.getSelectedIndex()));
+      }
+    });
+    init();
+  }
+
+  @Override
+  protected void processDoNotAskOnOk(int exitCode) {
+    super.processDoNotAskOnOk(exitCode);
+    // store it since explorer will be disposed
+    myLocation = getResourceLocation();
+  }
+
+  private void validateInput() {
+    setOKActionEnabled(!StringUtil.isEmpty(myUri.getText()) && getResourceLocation() != null);
+  }
+
+  @Override
+  protected JComponent createCenterPanel() {
+    return myMainPanel;
+  }
+
+  @Override
+  public JComponent getPreferredFocusedComponent() {
+    return StringUtil.isEmpty(myUri.getText()) ? myUri : mySchemasTree;
+  }
+
+  public String getUri() {
+    return myUri.getText();
+  }
+
+  @Nullable
+  public String getResourceLocation() {
+    if (myLocation != null) return myLocation;
+
+    if (myTabs.getSelectedIndex() == 0) {
+      TreePath path = mySchemasTree.getSelectionPath();
+      if (path == null) return null;
+      Object object = ((DefaultMutableTreeNode)path.getLastPathComponent()).getUserObject();
+      if (!(object instanceof PsiFile)) return null;
+      return FileUtil.toSystemIndependentName(((PsiFile)object).getVirtualFile().getPath());
+    }
+    else {
+      VirtualFile file = myExplorer.getSelectedFile();
+      return file == null ? null : FileUtil.toSystemIndependentName(file.getPath());
+    }
+  }
+
+  private void createUIComponents() {
+    myExplorerPanel = new JBPanel(new BorderLayout()) {
+      @Override
+      public void calcData(DataKey key, DataSink sink) {
+        if (key == PlatformDataKeys.VIRTUAL_FILE_ARRAY) {
+          sink.put(PlatformDataKeys.VIRTUAL_FILE_ARRAY, myExplorer.getSelectedFiles());
+        }
+        else if (key == FileSystemTree.DATA_KEY) {
+          sink.put(FileSystemTree.DATA_KEY, myExplorer);
+        }
+      }
+    };
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/NameLocationPair.java b/xml/impl/src/com/intellij/javaee/NameLocationPair.java
new file mode 100644
index 0000000..724d2a5
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/NameLocationPair.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+/**
+* @author Dmitry Avdeev
+*         Date: 7/18/12
+*/
+public class NameLocationPair implements Comparable {
+  String myName;
+  String myLocation;
+  boolean myShared;
+
+  public NameLocationPair(String name, String location, boolean shared) {
+    myName = name;
+    myLocation = location;
+    myShared = shared;
+  }
+
+  public int compareTo(Object o) {
+    return myName.compareTo(((NameLocationPair)o).myName);
+  }
+
+  public boolean equals(Object obj) {
+    if (! (obj instanceof NameLocationPair)) return false;
+    return compareTo(obj) == 0;
+  }
+
+  public int hashCode() {
+    return myName.hashCode();
+  }
+
+  public String getName() {
+    return myName;
+  }
+
+  public String getLocation(){
+    return myLocation;
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/ProjectResources.java b/xml/impl/src/com/intellij/javaee/ProjectResources.java
new file mode 100644
index 0000000..7bf3a03
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/ProjectResources.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.application.options.PathMacrosImpl;
+import com.intellij.openapi.components.PersistentStateComponent;
+import com.intellij.openapi.components.State;
+import com.intellij.openapi.components.Storage;
+import com.intellij.openapi.components.StoragePathMacros;
+import com.intellij.openapi.util.JDOMExternalizableAdapter;
+import org.jdom.Element;
+
+import java.util.Collections;
+import java.util.Map;
+
+/**
+* @author Dmitry Avdeev
+*/
+@State(name = "ProjectResources", storages = {@Storage( file = StoragePathMacros.PROJECT_FILE)})
+public class ProjectResources extends ExternalResourceManagerImpl implements PersistentStateComponent<Element> {
+
+  private final JDOMExternalizableAdapter myAdapter;
+
+  public ProjectResources(PathMacrosImpl pathMacros) {
+    super(pathMacros);
+    myAdapter = new JDOMExternalizableAdapter(this, "ProjectResources");
+  }
+
+  @Override
+  protected Map<String, Map<String, Resource>> computeStdResources() {
+    return Collections.emptyMap();   
+  }
+
+  public Element getState() {
+    return myAdapter.getState();
+  }
+
+  public void loadState(Element state) {
+    myAdapter.loadState(state);
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/PsiExternalResourceNotifier.java b/xml/impl/src/com/intellij/javaee/PsiExternalResourceNotifier.java
new file mode 100644
index 0000000..30fa2e2
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/PsiExternalResourceNotifier.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
+import com.intellij.openapi.components.AbstractProjectComponent;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.Disposable;
+import com.intellij.psi.impl.PsiManagerEx;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author yole
+ */
+public class PsiExternalResourceNotifier extends AbstractProjectComponent {
+  private final PsiManagerEx myPsiManager;
+  private final ExternalResourceManagerEx myExternalResourceManager;
+  private final DaemonCodeAnalyzer myDaemonCodeAnalyzer;
+
+  public PsiExternalResourceNotifier(PsiManagerEx psiManager, ExternalResourceManager externalResourceManager,
+                                     final DaemonCodeAnalyzer daemonCodeAnalyzer, Project project) {
+    super(project);
+    myPsiManager = psiManager;
+    myExternalResourceManager = (ExternalResourceManagerEx)externalResourceManager;
+    myDaemonCodeAnalyzer = daemonCodeAnalyzer;
+    final ExternalResourceListener myExternalResourceListener = new MyExternalResourceListener();
+    myExternalResourceManager.addExternalResourceListener(myExternalResourceListener);
+    Disposer.register(project, new Disposable() {
+      public void dispose() {
+        myExternalResourceManager.removeExternalResourceListener(myExternalResourceListener);
+      }
+    });
+  }
+
+  @NotNull
+  public String getComponentName() {
+    return "PsiExternalResourceNotifier";
+  }
+
+  private class MyExternalResourceListener implements ExternalResourceListener {
+    public void externalResourceChanged() {
+      myPsiManager.beforeChange(true);
+      myDaemonCodeAnalyzer.restart();
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/ResourceRegistrarImpl.java b/xml/impl/src/com/intellij/javaee/ResourceRegistrarImpl.java
new file mode 100644
index 0000000..a13d933
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/ResourceRegistrarImpl.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.javaee;
+
+import com.intellij.util.containers.HashMap;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class ResourceRegistrarImpl implements ResourceRegistrar {
+
+  private final Map<String, Map<String, ExternalResourceManagerImpl.Resource>> myResources = new HashMap<String, Map<String, ExternalResourceManagerImpl.Resource>>();
+  private final List<String> myIgnored = new ArrayList<String>();
+
+  public void addStdResource(@NonNls String resource, @NonNls String fileName) {
+    addStdResource(resource, null, fileName, getClass());
+  }
+
+  public void addStdResource(@NonNls String resource, @NonNls String fileName, Class klass) {
+    addStdResource(resource, null, fileName, klass);
+  }
+
+  public void addStdResource(@NonNls String resource, @NonNls String version, @NonNls String fileName, @Nullable Class klass, @Nullable ClassLoader classLoader) {
+    final Map<String, ExternalResourceManagerImpl.Resource> map = ExternalResourceManagerImpl.getMap(myResources, version, true);
+    assert map != null;
+    ExternalResourceManagerImpl.Resource res = new ExternalResourceManagerImpl.Resource();
+    res.file = fileName;
+    res.classLoader = classLoader;
+    res.clazz = klass;
+    map.put(resource, res);
+  }
+
+  public void addStdResource(@NonNls String resource, @Nullable @NonNls String version, @NonNls String fileName, Class klass) {
+    addStdResource(resource, version, fileName, klass, null);
+  }
+
+  public void addIgnoredResource(@NonNls String url) {
+    myIgnored.add(url);
+  }
+
+  public void addInternalResource(@NonNls String resource, @NonNls String fileName) {
+    addInternalResource(resource, null, fileName, getClass());
+  }
+
+  public void addInternalResource(@NonNls String resource, @NonNls String fileName, Class clazz) {
+    addInternalResource(resource, null, fileName, clazz);
+  }
+
+  public void addInternalResource(@NonNls String resource, @NonNls String version, @NonNls String fileName) {
+    addInternalResource(resource, version, fileName, getClass());
+  }
+
+  public void addInternalResource(@NonNls String resource, @Nullable @NonNls String version, @NonNls String fileName, @Nullable Class clazz) {
+    addStdResource(resource, version, ExternalResourceManagerImpl.STANDARD_SCHEMAS + fileName, clazz);
+  }
+
+  public Map<String, Map<String, ExternalResourceManagerImpl.Resource>> getResources() {
+    return myResources;
+  }
+
+  public List<String> getIgnored() {
+    return myIgnored;
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/XMLCatalogConfigurable.form b/xml/impl/src/com/intellij/javaee/XMLCatalogConfigurable.form
new file mode 100644
index 0000000..660dca5
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/XMLCatalogConfigurable.form
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.javaee.XMLCatalogConfigurable">
+  <grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="20" y="20" width="500" height="46"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <component id="5b144" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="Catalog property file:"/>
+        </properties>
+      </component>
+      <component id="b541d" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myPropertyFile">
+        <constraints>
+          <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+      </component>
+      <vspacer id="fd213">
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+        </constraints>
+      </vspacer>
+    </children>
+  </grid>
+</form>
diff --git a/xml/impl/src/com/intellij/javaee/XMLCatalogConfigurable.java b/xml/impl/src/com/intellij/javaee/XMLCatalogConfigurable.java
new file mode 100644
index 0000000..614636b
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/XMLCatalogConfigurable.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import com.intellij.openapi.options.BaseConfigurable;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.util.text.StringUtil;
+import org.jetbrains.annotations.Nls;
+
+import javax.swing.*;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 7/20/12
+ */
+public class XMLCatalogConfigurable extends BaseConfigurable {
+
+  private TextFieldWithBrowseButton myPropertyFile;
+  private JPanel myPanel;
+
+  public XMLCatalogConfigurable() {
+    myPropertyFile.addBrowseFolderListener("XML Catalog Properties File", null, null,
+                                           new FileChooserDescriptor(true, false, false, false, false, false));
+  }
+
+  @Nls
+  @Override
+  public String getDisplayName() {
+    return "XML Catalog";
+  }
+
+  @Override
+  public String getHelpTopic() {
+    return "XML.Catalog.Dialog";
+  }
+
+  @Override
+  public JComponent createComponent() {
+    return myPanel;
+  }
+
+  @Override
+  public JComponent getPreferredFocusedComponent() {
+    return myPropertyFile.getTextField();
+  }
+
+  @Override
+  public void apply() throws ConfigurationException {
+    ExternalResourceManagerEx.getInstanceEx().setCatalogPropertiesFile(myPropertyFile.getText());
+  }
+
+  @Override
+  public void reset() {
+    myPropertyFile.setText(ExternalResourceManagerEx.getInstanceEx().getCatalogPropertiesFile());
+  }
+
+  @Override
+  public boolean isModified() {
+    return !StringUtil.notNullize(ExternalResourceManagerEx.getInstanceEx().getCatalogPropertiesFile()).equals(myPropertyFile.getText());
+  }
+
+  @Override
+  public void disposeUIResources() {
+
+  }
+}
diff --git a/xml/impl/src/com/intellij/javaee/XMLCatalogManager.java b/xml/impl/src/com/intellij/javaee/XMLCatalogManager.java
new file mode 100644
index 0000000..c9eacea
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/XMLCatalogManager.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.io.FileUtil;
+import org.apache.xml.resolver.Catalog;
+import org.apache.xml.resolver.CatalogManager;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.TestOnly;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.StringReader;
+import java.lang.reflect.Field;
+import java.util.PropertyResourceBundle;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 7/20/12
+ */
+public class XMLCatalogManager {
+
+  private final static Logger LOG = Logger.getInstance(XMLCatalogManager.class);
+
+  private static Field ourResources;
+  private static Field ourPropertyFileUri;
+
+  static {
+    try {
+      ourResources = CatalogManager.class.getDeclaredField("resources");
+      ourResources.setAccessible(true);
+      ourPropertyFileUri = CatalogManager.class.getDeclaredField("propertyFileURI");
+      ourPropertyFileUri.setAccessible(true);
+    }
+    catch (NoSuchFieldException e) {
+      LOG.error(e);
+    }
+  }
+
+  private final CatalogManager myManager = new CatalogManager();
+
+  public XMLCatalogManager(@NotNull String propertiesFilePath) {
+
+    File file = new File(propertiesFilePath);
+    try {
+      String s = FileUtil.loadFile(file);
+      PropertyResourceBundle bundle = new PropertyResourceBundle(new StringReader(s));
+      ourResources.set(myManager, bundle);
+      ourPropertyFileUri.set(myManager, file.toURI().toURL());
+    }
+    catch (IllegalAccessException e) {
+      LOG.error(e);
+    }
+    catch (IOException e) {
+      LOG.warn(e);
+    }
+  }
+
+  @Nullable
+  public String resolve(String uri) {
+    try {
+      Catalog catalog = myManager.getCatalog();
+      if (catalog == null) return null;
+      String resolved = catalog.resolveSystem(uri);
+      return resolved == null ? catalog.resolvePublic(uri, null) : resolved;
+    }
+    catch (IOException e) {
+      LOG.warn(e);
+      return null;
+    }
+  }
+
+  @TestOnly
+  public CatalogManager getManager() {
+    return myManager;
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/HtmlInlineScriptTokenTypesProvider.java b/xml/impl/src/com/intellij/lang/HtmlInlineScriptTokenTypesProvider.java
new file mode 100644
index 0000000..b72c2e7
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/HtmlInlineScriptTokenTypesProvider.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang;
+
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.psi.tree.IElementType;
+
+public interface HtmlInlineScriptTokenTypesProvider {
+  IElementType getElementType();
+
+  FileType getFileType();
+}
diff --git a/xml/impl/src/com/intellij/lang/HtmlScriptContentProvider.java b/xml/impl/src/com/intellij/lang/HtmlScriptContentProvider.java
new file mode 100644
index 0000000..92bf644
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/HtmlScriptContentProvider.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang;
+
+import com.intellij.lexer.Lexer;
+import com.intellij.psi.tree.IElementType;
+import org.jetbrains.annotations.Nullable;
+
+public interface HtmlScriptContentProvider {
+  /**
+   * @return instance of the <code>com.intellij.psi.tree.IElementType</code> to use in html script tag
+   */
+  IElementType getScriptElementType();
+
+  /**
+   * @return highlighting lexer to use in html script tag
+   */
+  @Nullable
+  Lexer getHighlightingLexer();
+}
diff --git a/xml/impl/src/com/intellij/lang/LanguageHtmlInlineScriptTokenTypesProvider.java b/xml/impl/src/com/intellij/lang/LanguageHtmlInlineScriptTokenTypesProvider.java
new file mode 100644
index 0000000..8b8c557
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/LanguageHtmlInlineScriptTokenTypesProvider.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang;
+
+import org.jetbrains.annotations.Nullable;
+
+public class LanguageHtmlInlineScriptTokenTypesProvider extends LanguageExtension<HtmlInlineScriptTokenTypesProvider> {
+  public final static LanguageHtmlInlineScriptTokenTypesProvider INSTANCE = new LanguageHtmlInlineScriptTokenTypesProvider();
+
+  public LanguageHtmlInlineScriptTokenTypesProvider() {
+    super("com.intellij.html.inlineScriptTokenTypesProvider");
+  }
+
+  @Nullable
+  public static HtmlInlineScriptTokenTypesProvider getInlineScriptProvider(@Nullable Language language) {
+    return language == null ? null : INSTANCE.forLanguage(language);
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/LanguageHtmlScriptContentProvider.java b/xml/impl/src/com/intellij/lang/LanguageHtmlScriptContentProvider.java
new file mode 100644
index 0000000..77676490e
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/LanguageHtmlScriptContentProvider.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang;
+
+import org.jetbrains.annotations.NotNull;
+
+public class LanguageHtmlScriptContentProvider extends LanguageExtension<HtmlScriptContentProvider> {
+  public final static LanguageHtmlScriptContentProvider INSTANCE = new LanguageHtmlScriptContentProvider();
+
+  public LanguageHtmlScriptContentProvider() {
+    super("com.intellij.html.scriptContentProvider");
+  }
+
+  public static HtmlScriptContentProvider getScriptContentProvider(@NotNull Language language) {
+    return INSTANCE.forLanguage(language);
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/dtd/DTDLanguage.java b/xml/impl/src/com/intellij/lang/dtd/DTDLanguage.java
new file mode 100644
index 0000000..29ce449
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/dtd/DTDLanguage.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.dtd;
+
+import com.intellij.ide.highlighter.XmlFileHighlighter;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.fileTypes.SingleLazyInstanceSyntaxHighlighterFactory;
+import com.intellij.openapi.fileTypes.SyntaxHighlighter;
+import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author max
+ */
+public class DTDLanguage extends XMLLanguage {
+
+  public static final DTDLanguage INSTANCE = new DTDLanguage();
+
+  protected DTDLanguage() {
+    super(XMLLanguage.INSTANCE, "DTD", "text/dtd", "text/x-dtd");
+    SyntaxHighlighterFactory.LANGUAGE_FACTORY.addExplicitExtension(this, new SingleLazyInstanceSyntaxHighlighterFactory() {
+      @NotNull
+      protected SyntaxHighlighter createHighlighter() {
+        return new XmlFileHighlighter(true);
+      }
+    });
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/dtd/DTDParserDefinition.java b/xml/impl/src/com/intellij/lang/dtd/DTDParserDefinition.java
new file mode 100644
index 0000000..541aa16
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/dtd/DTDParserDefinition.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.dtd;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.LanguageUtil;
+import com.intellij.lang.PsiBuilder;
+import com.intellij.lang.PsiParser;
+import com.intellij.lang.xml.XMLParserDefinition;
+import com.intellij.lexer.DtdLexer;
+import com.intellij.lexer.Lexer;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.source.parsing.xml.DtdParsing;
+import com.intellij.psi.impl.source.xml.XmlFileImpl;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.IFileElementType;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlEntityDecl;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author max
+ */
+public class DTDParserDefinition extends XMLParserDefinition {
+  public SpaceRequirements spaceExistanceTypeBetweenTokens(ASTNode left, ASTNode right) {
+    return LanguageUtil.canStickTokensTogetherByLexer(left, right, new DtdLexer(false));
+  }
+
+  public PsiFile createFile(FileViewProvider viewProvider) {
+    return new XmlFileImpl(viewProvider, XmlElementType.DTD_FILE);
+  }
+
+  @NotNull
+  @Override
+  public PsiParser createParser(Project project) {
+    return new PsiParser() {
+      @NotNull
+      @Override
+      public ASTNode parse(IElementType root, PsiBuilder builder) {
+        return new DtdParsing(root, XmlEntityDecl.EntityContextType.GENERIC_XML, builder).parse();
+      }
+    };
+  }
+
+  @Override
+  public IFileElementType getFileNodeType() {
+    return XmlElementType.DTD_FILE;
+  }
+
+  @NotNull
+  @Override
+  public Lexer createLexer(Project project) {
+    return new DtdLexer(false);
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/dtd/DtdStructureViewBuilderFactory.java b/xml/impl/src/com/intellij/lang/dtd/DtdStructureViewBuilderFactory.java
new file mode 100644
index 0000000..f88cafe
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/dtd/DtdStructureViewBuilderFactory.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.lang.dtd;
+
+import com.intellij.ide.structureView.StructureViewBuilder;
+import com.intellij.ide.structureView.StructureViewModel;
+import com.intellij.ide.structureView.TreeBasedStructureViewBuilder;
+import com.intellij.ide.structureView.impl.xml.XmlStructureViewTreeModel;
+import com.intellij.lang.PsiStructureViewFactory;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NotNull;
+
+public class DtdStructureViewBuilderFactory implements PsiStructureViewFactory {
+  @NotNull
+  public StructureViewBuilder getStructureViewBuilder(final PsiFile psiFile) {
+    return new TreeBasedStructureViewBuilder() {
+      @NotNull
+      public StructureViewModel createStructureViewModel() {
+        return new XmlStructureViewTreeModel((XmlFile)psiFile);
+      }
+    };
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/lang/html/HTMLLanguage.java b/xml/impl/src/com/intellij/lang/html/HTMLLanguage.java
new file mode 100644
index 0000000..4c4cbca
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/html/HTMLLanguage.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.html;
+
+import com.intellij.ide.highlighter.HtmlFileHighlighter;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.fileTypes.SingleLazyInstanceSyntaxHighlighterFactory;
+import com.intellij.openapi.fileTypes.SyntaxHighlighter;
+import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
+import com.intellij.psi.impl.source.xml.XmlPsiPolicy;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author max
+ */
+public class HTMLLanguage extends XMLLanguage {
+
+  public static final HTMLLanguage INSTANCE = new HTMLLanguage();
+
+  private HTMLLanguage() {
+    super(XMLLanguage.INSTANCE, "HTML", "text/html", "text/htmlh");
+    SyntaxHighlighterFactory.LANGUAGE_FACTORY.addExplicitExtension(this, new SingleLazyInstanceSyntaxHighlighterFactory() {
+      @NotNull
+      protected SyntaxHighlighter createHighlighter() {
+        return new HtmlFileHighlighter();
+      }
+    });
+
+  }
+
+  public XmlPsiPolicy getPsiPolicy() {
+    return ENCODE_EACH_SYMBOL_POLICY;
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/html/HTMLParser.java b/xml/impl/src/com/intellij/lang/html/HTMLParser.java
new file mode 100644
index 0000000..e4f89c6
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/html/HTMLParser.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.lang.html;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.PsiBuilder;
+import com.intellij.lang.PsiParser;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.TokenSet;
+import org.jetbrains.annotations.NotNull;
+
+public class HTMLParser implements PsiParser {
+
+  @NotNull
+  public ASTNode parse(final IElementType root, final PsiBuilder builder) {
+    builder.enforceCommentTokens(TokenSet.EMPTY);
+    final PsiBuilder.Marker file = builder.mark();
+    new HtmlParsing(builder).parseDocument();
+    file.done(root);
+    return builder.getTreeBuilt();
+  }
+
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/lang/html/HTMLParserDefinition.java b/xml/impl/src/com/intellij/lang/html/HTMLParserDefinition.java
new file mode 100644
index 0000000..13b0dcc
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/html/HTMLParserDefinition.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.html;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.ParserDefinition;
+import com.intellij.lang.PsiParser;
+import com.intellij.lang.xml.XMLParserDefinition;
+import com.intellij.lexer.HtmlLexer;
+import com.intellij.lexer.Lexer;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.source.html.HtmlFileImpl;
+import com.intellij.psi.tree.IFileElementType;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.util.PsiUtilCore;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTokenType;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author max
+ */
+public class HTMLParserDefinition implements ParserDefinition {
+  @NotNull
+  public Lexer createLexer(Project project) {
+    return new HtmlLexer();
+  }
+
+  public IFileElementType getFileNodeType() {
+    return XmlElementType.HTML_FILE;
+  }
+
+  @NotNull
+  public TokenSet getWhitespaceTokens() {
+    return XmlTokenType.WHITESPACES;
+  }
+
+  @NotNull
+  public TokenSet getCommentTokens() {
+    return XmlTokenType.COMMENTS;
+  }
+
+  @NotNull
+  public TokenSet getStringLiteralElements() {
+    return TokenSet.EMPTY;
+  }
+
+  @NotNull
+  public PsiParser createParser(final Project project) {
+    return new HTMLParser();
+  }
+
+  @NotNull
+  public PsiElement createElement(ASTNode node) {
+    return PsiUtilCore.NULL_PSI_ELEMENT;
+  }
+
+  public PsiFile createFile(FileViewProvider viewProvider) {
+    return new HtmlFileImpl(viewProvider);
+  }
+
+  public SpaceRequirements spaceExistanceTypeBetweenTokens(ASTNode left, ASTNode right) {
+    final Lexer lexer = createLexer(left.getPsi().getProject());
+    return XMLParserDefinition.canStickTokensTogetherByLexerInXml(left, right, lexer, 0);
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/html/HtmlFormattingModelBuilder.java b/xml/impl/src/com/intellij/lang/html/HtmlFormattingModelBuilder.java
new file mode 100644
index 0000000..1b004ec
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/html/HtmlFormattingModelBuilder.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.lang.html;
+
+import com.intellij.formatting.FormattingModel;
+import com.intellij.formatting.FormattingModelBuilder;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.formatter.FormattingDocumentModelImpl;
+import com.intellij.psi.formatter.xml.HtmlPolicy;
+import com.intellij.psi.formatter.xml.XmlBlock;
+import com.intellij.psi.impl.source.SourceTreeToPsiMap;
+import com.intellij.lang.xml.XmlFormattingModel;
+import org.jetbrains.annotations.NotNull;
+
+public class HtmlFormattingModelBuilder implements FormattingModelBuilder {
+  @NotNull
+    public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
+    final PsiFile psiFile = element.getContainingFile();
+    final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(psiFile);
+    return new XmlFormattingModel(psiFile,
+                                                           new XmlBlock(SourceTreeToPsiMap.psiElementToTree(psiFile),
+                                                                        null, null, new HtmlPolicy(settings, documentModel), null, null, false),
+                                                           documentModel);
+  }
+
+  public TextRange getRangeAffectingIndent(PsiFile file, int offset, ASTNode elementAtOffset) {
+    return null;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/lang/html/HtmlParsing.java b/xml/impl/src/com/intellij/lang/html/HtmlParsing.java
new file mode 100644
index 0000000..e500762
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/html/HtmlParsing.java
@@ -0,0 +1,618 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.lang.html;
+
+import com.intellij.codeInsight.completion.CompletionUtil;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.lang.PsiBuilder;
+import com.intellij.psi.impl.source.codeStyle.IndentHelperImpl;
+import com.intellij.psi.tree.CustomParsingType;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.ILazyParseableElementType;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.containers.Stack;
+import com.intellij.xml.util.HtmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class HtmlParsing {
+  @NonNls private static final String TR_TAG = "tr";
+  @NonNls private static final String TD_TAG = "td";
+  @NonNls private static final String DD_TAG = "dd";
+  @NonNls private static final String DT_TAG = "dt";
+  @NonNls private static final String TABLE_TAG = "table";
+
+  private final PsiBuilder myBuilder;
+  private final Stack<String> myTagNamesStack = new Stack<String>();
+  private final Stack<PsiBuilder.Marker> myTagMarkersStack = new Stack<PsiBuilder.Marker>();
+  @NonNls private static final String COMPLETION_NAME = CompletionUtil.DUMMY_IDENTIFIER_TRIMMED.toLowerCase();
+
+  public HtmlParsing(final PsiBuilder builder) {
+    myBuilder = builder;
+  }
+
+  public void parseDocument() {
+    final PsiBuilder.Marker document = mark();
+
+    while (token() == XmlTokenType.XML_COMMENT_START) {
+      parseComment();
+    }
+
+    parseProlog();
+
+    PsiBuilder.Marker error = null;
+    while (!eof()) {
+      final IElementType tt = token();
+      if (tt == XmlTokenType.XML_START_TAG_START) {
+        error = flushError(error);
+        parseTag("");
+        myTagMarkersStack.clear();
+        myTagNamesStack.clear();
+      }
+      else if (tt == XmlTokenType.XML_COMMENT_START) {
+        error = flushError(error);
+        parseComment();
+      }
+      else if (tt == XmlTokenType.XML_PI_START) {
+        error = flushError(error);
+        parseProcessingInstruction();
+      }
+      else if (tt == XmlTokenType.XML_REAL_WHITE_SPACE || tt == XmlTokenType.XML_CHAR_ENTITY_REF || tt == XmlTokenType.XML_DATA_CHARACTERS) {
+        error = flushError(error);
+        advance();
+      } else if (tt == XmlTokenType.XML_END_TAG_START) {
+        final PsiBuilder.Marker tagEndError = myBuilder.mark();
+
+        advance();
+        if (token() == XmlTokenType.XML_NAME) {
+          advance();
+          if (token() == XmlTokenType.XML_TAG_END) {
+            advance();
+          }
+        }
+
+        tagEndError.error(XmlErrorMessages.message("xml.parsing.closing.tag.matches.nothing"));
+      }
+      else {
+        if (error == null) error = mark();
+        advance();
+      }
+    }
+
+    if (error != null) {
+      error.error(XmlErrorMessages.message("top.level.element.is.not.completed"));
+      error = null;
+    }
+
+    document.done(XmlElementType.HTML_DOCUMENT);
+  }
+
+  @Nullable
+  private static PsiBuilder.Marker flushError(PsiBuilder.Marker error) {
+    if (error != null) {
+      error.error(XmlErrorMessages.message("xml.parsing.unexpected.tokens"));
+      error = null;
+    }
+    return error;
+  }
+
+  private void parseDoctype() {
+    assert token() == XmlTokenType.XML_DOCTYPE_START : "Doctype start expected";
+    final PsiBuilder.Marker doctype = mark();
+    advance();
+
+    while (token() != XmlTokenType.XML_DOCTYPE_END && !eof()) advance();
+    if (eof()) {
+      error(XmlErrorMessages.message("xml.parsing.unexpected.end.of.file"));
+    }
+    else {
+      advance();
+    }
+
+    doctype.done(XmlElementType.XML_DOCTYPE);
+  }
+
+  private static boolean ddordt(String name) {
+    return DT_TAG.equals(name) || DD_TAG.equals(name);
+  }
+
+  private boolean parseTag(String parentName) {
+    assert token() == XmlTokenType.XML_START_TAG_START : "Tag start expected";
+    final PsiBuilder.Marker tag = mark();
+    myTagMarkersStack.push(tag);
+
+    // Start tag header
+    advance();
+    final String originalTagName;
+    if (token() != XmlTokenType.XML_NAME) {
+      error(XmlErrorMessages.message("xml.parsing.tag.name.expected"));
+      originalTagName = "";
+    }
+    else {
+      originalTagName = myBuilder.getTokenText();
+      advance();
+    }
+
+    String tagName = originalTagName.toLowerCase();
+    if ((ddordt(tagName) && ddordt(parentName)) ||
+        (tagName.equals(parentName) && HtmlUtil.isOptionalEndForHtmlTagL(tagName)) ||
+        myTagMarkersStack.size() > MAGIC_FRAME_COUNT // no chance for evil guys wanting us to have stack overflow
+       ) {
+      tag.rollbackTo();
+      myTagMarkersStack.pop();
+      return false;
+    }
+
+    myTagNamesStack.push(tagName);
+
+    boolean freeMakerTag = tagName.length() > 0 && '#' == tagName.charAt(0);
+
+    do {
+      final IElementType tt = token();
+      if (freeMakerTag) {
+        if (tt == XmlTokenType.XML_EMPTY_ELEMENT_END ||
+            tt == XmlTokenType.XML_TAG_END ||
+            tt == XmlTokenType.XML_END_TAG_START ||
+            tt == XmlTokenType.XML_START_TAG_START) break;
+        advance();
+      }
+      else {
+        if (tt == XmlTokenType.XML_NAME) {
+          parseAttribute();
+        }
+        else if (tt == XmlTokenType.XML_CHAR_ENTITY_REF || tt == XmlTokenType.XML_ENTITY_REF_TOKEN) {
+          parseReference();
+        }
+        else {
+          break;
+        }
+      }
+    }
+    while (!eof());
+
+    if (token() == XmlTokenType.XML_EMPTY_ELEMENT_END) {
+      advance();
+      tag.done(XmlElementType.HTML_TAG);
+      return true;
+    }
+
+    if (token() == XmlTokenType.XML_TAG_END) {
+      advance();
+    }
+    else {
+      error(XmlErrorMessages.message("tag.start.is.not.closed"));
+      tag.done(XmlElementType.HTML_TAG);
+      return true;
+    }
+
+    if (HtmlUtil.isSingleHtmlTagL(tagName)) {
+      final PsiBuilder.Marker footer = mark();
+      if (token() == XmlTokenType.XML_END_TAG_START) {
+        advance();
+        if (token() == XmlTokenType.XML_NAME) {
+          if (tagName.equalsIgnoreCase(myBuilder.getTokenText())) {
+            advance();
+            footer.drop();
+            if (token() == XmlTokenType.XML_TAG_END) {
+              advance();
+            }
+            tag.done(XmlElementType.HTML_TAG);
+            return true;
+          }
+        }
+      }
+
+      footer.rollbackTo();
+      tag.done(XmlElementType.HTML_TAG);
+      return true;
+    }
+
+    // Done header, start content
+
+    boolean isInlineTagContainer = HtmlUtil.isInlineTagContainerL(tagName);
+    boolean isOptionalTagEnd = HtmlUtil.isOptionalEndForHtmlTagL(tagName);
+
+    PsiBuilder.Marker firstBlockChild = null;
+
+    PsiBuilder.Marker xmlText = null;
+    while (!eof()) {
+      final IElementType tt = token();
+      if (tt == XmlTokenType.XML_START_TAG_START) {
+        xmlText = terminateText(xmlText);
+        if (!parseTag(tagName)) {
+          tag.done(XmlElementType.HTML_TAG);
+          return true;
+        }
+
+        PsiBuilder.Marker childMarker = myTagMarkersStack.pop();
+        String childName = myTagNamesStack.pop();
+
+        if (isOptionalTagEnd) {
+          boolean foundMatch = childTerminatesParentInStack(childName, true);
+          if (foundMatch) {
+            myTagMarkersStack.pop();
+            myTagNamesStack.pop();
+
+            myTagMarkersStack.push(childMarker);
+            myTagNamesStack.push(childName);
+
+            tag.doneBefore(XmlElementType.HTML_TAG, childMarker);
+            return true;
+          }
+        }
+
+
+        if (isInlineTagContainer && HtmlUtil.isHtmlBlockTagL(childName) && isOptionalTagEnd && !HtmlUtil.isPossiblyInlineTag(childName)) {
+          tag.doneBefore(XmlElementType.HTML_TAG, childMarker);
+          return true;
+        }
+        else if (isOptionalTagEnd && firstBlockChild == null && HtmlUtil.isHtmlBlockTagL(childName) && !HtmlUtil.isHtmlBlockTagL(tagName) && canTerminate(childName, tagName)) {
+          firstBlockChild = childMarker;
+        }
+      }
+      else if (tt == XmlTokenType.XML_PI_START) {
+        xmlText = terminateText(xmlText);
+        parseProcessingInstruction();
+      }
+      else if (tt == XmlTokenType.XML_ENTITY_REF_TOKEN) {
+        xmlText = terminateText(xmlText);
+        parseReference();
+      }
+      else if (tt == XmlTokenType.XML_CHAR_ENTITY_REF) {
+        xmlText = startText(xmlText);
+        parseReference();
+      }
+      else if (tt == XmlTokenType.XML_CDATA_START) {
+        xmlText = startText(xmlText);
+        parseCData();
+      }
+      else if (tt == XmlTokenType.XML_COMMENT_START) {
+        xmlText = startText(xmlText);
+        parseComment();
+      }
+      else if (tt == XmlTokenType.XML_BAD_CHARACTER) {
+        xmlText = startText(xmlText);
+        final PsiBuilder.Marker error = mark();
+        advance();
+        error.error(XmlErrorMessages.message("unescaped.ampersand.or.nonterminated.character.entity.reference"));
+      }
+      else if (tt instanceof CustomParsingType || tt instanceof ILazyParseableElementType) {
+        xmlText = terminateText(xmlText);
+        advance();
+      }
+      else if (token() == XmlTokenType.XML_END_TAG_START) {
+        xmlText = terminateText(xmlText);
+        final PsiBuilder.Marker footer = mark();
+        advance();
+
+        if (token() == XmlTokenType.XML_NAME) {
+          String endName = myBuilder.getTokenText().toLowerCase();
+          if (!tagName.equals(endName) && !endName.endsWith(COMPLETION_NAME)) {
+            final boolean hasChancesToMatch = HtmlUtil.isOptionalEndForHtmlTagL(endName) ? childTerminatesParentInStack(endName, false) : myTagNamesStack.contains(endName);
+            if (hasChancesToMatch) {
+              footer.rollbackTo();
+              if (isOptionalTagEnd) {
+                if (firstBlockChild != null) {
+                  tag.doneBefore(XmlElementType.HTML_TAG, firstBlockChild);
+                }
+                else {
+                  tag.done(XmlElementType.HTML_TAG);
+                }
+              }
+              else {
+                error(XmlErrorMessages.message("named.element.is.not.closed", originalTagName));
+                tag.done(XmlElementType.HTML_TAG);
+              }
+              return true;
+            }
+            else {
+              advance();
+              if (token() == XmlTokenType.XML_TAG_END) advance();
+              footer.error(XmlErrorMessages.message("xml.parsing.closing.tag.matches.nothing"));
+              continue;
+            }
+          }
+
+          advance();
+
+          while (token() != XmlTokenType.XML_TAG_END && token() != XmlTokenType.XML_START_TAG_START && token() != XmlTokenType.XML_END_TAG_START && !eof()) {
+            error(XmlErrorMessages.message("xml.parsing.unexpected.token"));
+            advance();
+          }
+        }
+        else {
+          error(XmlErrorMessages.message("xml.parsing.closing.tag.name.missing"));
+        }
+        footer.drop();
+
+        if (token() == XmlTokenType.XML_TAG_END) {
+          advance();
+        }
+        else {
+          error(XmlErrorMessages.message("xml.parsing.closing.tag.is.not.done"));
+        }
+
+        tag.done(XmlElementType.HTML_TAG);
+        return true;
+      }
+      else {
+        xmlText = startText(xmlText);
+        advance();
+      }
+    }
+
+    xmlText = terminateText(xmlText);
+
+    if (isOptionalTagEnd || "body".equalsIgnoreCase(tagName) || "html".equalsIgnoreCase(tagName)) {
+      if (firstBlockChild != null) {
+        tag.doneBefore(XmlElementType.HTML_TAG, firstBlockChild);
+      }
+      else {
+        tag.done(XmlElementType.HTML_TAG);
+      }
+    }
+    else {
+      error(XmlErrorMessages.message("named.element.is.not.closed", originalTagName));
+      tag.done(XmlElementType.HTML_TAG);
+    }
+
+    return true;
+  }
+
+  private static boolean canTerminate(final String childTagName,final String tagName) {
+    // TODO: make hash
+    return !(tagName.equalsIgnoreCase(TR_TAG) && childTagName.equalsIgnoreCase(TD_TAG)) ||
+           (tagName.equalsIgnoreCase(TABLE_TAG) && childTagName.equalsIgnoreCase(TR_TAG));
+  }
+
+  private boolean childTerminatesParentInStack(final String childName, final boolean terminateOnNonOptionalTag) {
+    boolean isTD = TD_TAG.equals(childName);
+    boolean isTR = TR_TAG.equals(childName);
+
+    for (int i = myTagNamesStack.size() - 1; i >= 0; i--) {
+      String parentName = myTagNamesStack.get(i);
+      if (terminateOnNonOptionalTag && !HtmlUtil.isOptionalEndForHtmlTagL(parentName)) return false;
+      if (isTD && (TR_TAG.equals(parentName) || TABLE_TAG.equals(parentName)) ||
+          isTR && TABLE_TAG.equals(parentName)) {
+        return false;
+      }
+
+      if (childName.equals(parentName)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+
+  @NotNull
+  private PsiBuilder.Marker startText(@Nullable PsiBuilder.Marker xmlText) {
+    if (xmlText == null) {
+      xmlText = mark();
+      assert xmlText != null;
+    }
+    return xmlText;
+  }
+
+  protected final PsiBuilder.Marker mark() {
+    return myBuilder.mark();
+  }
+
+  @Nullable
+  private static PsiBuilder.Marker terminateText(@Nullable PsiBuilder.Marker xmlText) {
+    if (xmlText != null) {
+      xmlText.done(XmlElementType.XML_TEXT);
+      xmlText = null;
+    }
+    return xmlText;
+  }
+
+  private void parseCData() {
+    assert token() == XmlTokenType.XML_CDATA_START;
+    final PsiBuilder.Marker cdata = mark();
+    while (token() != XmlTokenType.XML_CDATA_END && !eof()) {
+      advance();
+    }
+
+    if (!eof()) {
+      advance();
+    }
+
+    cdata.done(XmlElementType.XML_CDATA);
+  }
+
+  protected void parseComment() {
+    final PsiBuilder.Marker comment = mark();
+    advance();
+    while (true) {
+      final IElementType tt = token();
+      if (tt == XmlTokenType.XML_COMMENT_CHARACTERS || tt == XmlTokenType.XML_CHAR_ENTITY_REF || tt == XmlTokenType.XML_CONDITIONAL_COMMENT_START
+        || tt == XmlTokenType.XML_CONDITIONAL_COMMENT_START_END || tt == XmlTokenType.XML_CONDITIONAL_COMMENT_END_START
+        || tt == XmlTokenType.XML_CONDITIONAL_COMMENT_END) {
+        advance();
+        continue;
+      }
+      else if (tt == XmlTokenType.XML_BAD_CHARACTER) {
+        final PsiBuilder.Marker error = mark();
+        advance();
+        error.error(XmlErrorMessages.message("xml.parsing.bad.character"));
+        continue;
+      }
+      if (tt == XmlTokenType.XML_COMMENT_END) {
+        advance();
+      }
+      break;
+    }
+    comment.done(XmlElementType.XML_COMMENT);
+  }
+
+  private void parseReference() {
+    if (token() == XmlTokenType.XML_CHAR_ENTITY_REF) {
+      advance();
+    }
+    else if (token() == XmlTokenType.XML_ENTITY_REF_TOKEN) {
+      final PsiBuilder.Marker ref = mark();
+      advance();
+      ref.done(XmlElementType.XML_ENTITY_REF);
+    }
+    else {
+      assert false : "Unexpected token";
+    }
+  }
+
+  private void parseAttribute() {
+    assert token() == XmlTokenType.XML_NAME;
+    final PsiBuilder.Marker att = mark();
+    advance();
+    if (token() == XmlTokenType.XML_EQ) {
+      advance();
+      parseAttributeValue();
+      att.done(XmlElementType.XML_ATTRIBUTE);
+    }
+    else {
+      att.done(XmlElementType.XML_ATTRIBUTE);
+    }
+  }
+
+  private void parseAttributeValue() {
+    final PsiBuilder.Marker attValue = mark();
+    if (token() == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER) {
+      while (true) {
+        final IElementType tt = token();
+        if (tt == null || tt == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER || tt == XmlTokenType.XML_END_TAG_START || tt == XmlTokenType
+          .XML_EMPTY_ELEMENT_END ||
+            tt == XmlTokenType.XML_START_TAG_START) {
+          break;
+        }
+
+        if (tt == XmlTokenType.XML_BAD_CHARACTER) {
+          final PsiBuilder.Marker error = mark();
+          advance();
+          error.error(XmlErrorMessages.message("unescaped.ampersand.or.nonterminated.character.entity.reference"));
+        }
+        else if (tt == XmlTokenType.XML_ENTITY_REF_TOKEN) {
+          parseReference();
+        }
+        else {
+          advance();
+        }
+      }
+
+      if (token() == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER) {
+        advance();
+      }
+      else {
+        error(XmlErrorMessages.message("xml.parsing.unclosed.attribute.value"));
+      }
+    }
+    else {
+      if (token() != XmlTokenType.XML_TAG_END && token() != XmlTokenType.XML_EMPTY_ELEMENT_END) {
+        advance(); // Single token att value
+      }
+    }
+
+    attValue.done(XmlElementType.XML_ATTRIBUTE_VALUE);
+  }
+
+  private void parseProlog() {
+    while (true) {
+      final IElementType tt = token();
+      if (tt == XmlTokenType.XML_COMMENT_START) {
+        parseComment();
+      }
+      else if (tt == XmlTokenType.XML_REAL_WHITE_SPACE) {
+        advance();
+      }
+      else {
+        break;
+      }
+    }
+
+    final PsiBuilder.Marker prolog = mark();
+    while (true) {
+      final IElementType tt = token();
+      if (tt == XmlTokenType.XML_PI_START) {
+        parseProcessingInstruction();
+      }
+      else if (tt == XmlTokenType.XML_DOCTYPE_START) {
+        parseDoctype();
+      }
+      else if (tt == XmlTokenType.XML_COMMENT_START) {
+        parseComment();
+      }
+      else if (tt == XmlTokenType.XML_REAL_WHITE_SPACE) {
+        advance();
+      }
+      else {
+        break;
+      }
+    }
+    prolog.done(XmlElementType.XML_PROLOG);
+  }
+
+  private void parseProcessingInstruction() {
+    assert token() == XmlTokenType.XML_PI_START;
+    final PsiBuilder.Marker pi = mark();
+    advance();
+    if (token() == XmlTokenType.XML_NAME || token() == XmlTokenType.XML_PI_TARGET) {
+      advance();
+    }
+
+    while (token() == XmlTokenType.XML_NAME) {
+      advance();
+      if (token() == XmlTokenType.XML_EQ) {
+        advance();
+      }
+      else {
+        error(XmlErrorMessages.message("expected.attribute.eq.sign"));
+      }
+      parseAttributeValue();
+    }
+
+    if (token() == XmlTokenType.XML_PI_END) {
+      advance();
+    }
+    else {
+      error(XmlErrorMessages.message("xml.parsing.unterminated.processing.instruction"));
+    }
+
+    pi.done(XmlElementType.XML_PROCESSING_INSTRUCTION);
+  }
+
+  protected final IElementType token() {
+    return myBuilder.getTokenType();
+  }
+
+  protected final boolean eof() {
+    return myBuilder.eof();
+  }
+
+  protected final void advance() {
+    myBuilder.advanceLexer();
+  }
+
+  private void error(final String message) {
+    myBuilder.error(message);
+  }
+
+  private static final int MAGIC_FRAME_COUNT = IndentHelperImpl.TOO_BIG_WALK_THRESHOLD + (int)(Math.pow(Math.E, Math.PI) * Math.sin(Math.random()));
+}
diff --git a/xml/impl/src/com/intellij/lang/html/HtmlStructureViewBuilderProvider.java b/xml/impl/src/com/intellij/lang/html/HtmlStructureViewBuilderProvider.java
new file mode 100644
index 0000000..19a063d
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/html/HtmlStructureViewBuilderProvider.java
@@ -0,0 +1,56 @@
+package com.intellij.lang.html;
+
+import com.intellij.ide.highlighter.HtmlFileType;
+import com.intellij.ide.structureView.StructureViewBuilder;
+import com.intellij.ide.structureView.StructureViewModel;
+import com.intellij.ide.structureView.StructureViewTreeElement;
+import com.intellij.ide.structureView.TreeBasedStructureViewBuilder;
+import com.intellij.ide.structureView.impl.xml.XmlStructureViewTreeModel;
+import com.intellij.ide.structureView.xml.XmlStructureViewBuilderProvider;
+import com.intellij.ide.util.treeView.smartTree.Sorter;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class HtmlStructureViewBuilderProvider implements XmlStructureViewBuilderProvider {
+  @Nullable
+  public StructureViewBuilder createStructureViewBuilder(@NotNull final XmlFile file) {
+    if (file.getViewProvider().getVirtualFile().getFileType() != HtmlFileType.INSTANCE) return null;
+
+    return new TreeBasedStructureViewBuilder() {
+      public boolean isRootNodeShown() {
+        return false;
+      }
+
+      @NotNull
+      public StructureViewModel createStructureViewModel() {
+        return new XmlStructureViewTreeModel(file) {
+          @NotNull
+          public Sorter[] getSorters() {
+            return Sorter.EMPTY_ARRAY;
+          }
+
+          @NotNull
+          public StructureViewTreeElement getRoot() {
+            final XmlDocument document = ((XmlFile)getPsiFile()).getDocument();
+            final XmlTag rootTag = document == null ? null : document.getRootTag();
+
+            if (rootTag != null && "html".equalsIgnoreCase(rootTag.getLocalName())) {
+              final XmlTag[] subTags = rootTag.getSubTags();
+              if (subTags.length == 1 &&
+                  ("head".equalsIgnoreCase(subTags[0].getLocalName()) || "body".equalsIgnoreCase(subTags[0].getLocalName()))) {
+                return new HtmlStructureViewElementProvider.HtmlTagTreeElement(subTags[0]);
+              }
+
+              return new HtmlStructureViewElementProvider.HtmlTagTreeElement(rootTag);
+            }
+
+            return super.getRoot();
+          }
+        };
+      }
+    };
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/html/HtmlStructureViewElementProvider.java b/xml/impl/src/com/intellij/lang/html/HtmlStructureViewElementProvider.java
new file mode 100644
index 0000000..4be0765
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/html/HtmlStructureViewElementProvider.java
@@ -0,0 +1,102 @@
+package com.intellij.lang.html;
+
+import com.intellij.ide.IdeBundle;
+import com.intellij.ide.highlighter.HtmlFileType;
+import com.intellij.ide.structureView.StructureViewTreeElement;
+import com.intellij.ide.structureView.impl.xml.XmlTagTreeElement;
+import com.intellij.ide.structureView.xml.XmlStructureViewElementProvider;
+import com.intellij.navigation.LocationPresentation;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.List;
+
+public class HtmlStructureViewElementProvider implements XmlStructureViewElementProvider {
+
+  private static int MAX_TEXT_LENGTH = 50;
+
+  @Nullable
+  public StructureViewTreeElement createCustomXmlTagTreeElement(@NotNull final XmlTag tag) {
+    if (tag.getContainingFile().getViewProvider().getVirtualFile().getFileType() != HtmlFileType.INSTANCE) return null;
+
+    return new HtmlTagTreeElement(tag);
+  }
+
+  static class HtmlTagTreeElement extends XmlTagTreeElement implements LocationPresentation {
+    public HtmlTagTreeElement(final XmlTag tag) {
+      super(tag);
+    }
+
+    public String getPresentableText() {
+      final XmlTag tag = getElement();
+      if (tag == null) return IdeBundle.message("node.structureview.invalid");
+
+      final String id = toCanonicalForm(tag.getAttributeValue("id"));
+
+      final String classValue = tag.getAttributeValue("class");
+      final List<String> classValues = classValue != null ? StringUtil.split(classValue, " ") : Collections.<String>emptyList();
+
+      final StringBuilder text = new StringBuilder(tag.getLocalName());
+
+      if (id != null) {
+        text.append("#").append(id);
+      }
+
+      if (!classValues.isEmpty()) {
+        text.append('.').append(StringUtil.join(classValues, "."));
+      }
+
+      return text.toString();
+    }
+
+    public String getLocationString() {
+      final XmlTag tag = getElement();
+      if (tag == null) return null;
+
+      final String text = normalizeSpaces(tag.getValue().getTrimmedText());
+      return text.isEmpty() ? null : shortenTextIfLong(text);
+    }
+
+    private static String normalizeSpaces(final String text) {
+      final StringBuilder buf = new StringBuilder();
+
+      for (char ch : text.toCharArray()) {
+        if (ch <= ' ' || Character.isSpaceChar(ch)) {
+          if (buf.length() == 0 || buf.charAt(buf.length() - 1) != ' ') {
+            buf.append(' ');
+          }
+        }
+        else {
+          buf.append(ch);
+        }
+      }
+
+      return buf.toString();
+    }
+
+    private static String shortenTextIfLong(final String text) {
+      if (text.length() <= MAX_TEXT_LENGTH) return text;
+
+      int index;
+      for (index = MAX_TEXT_LENGTH; index > MAX_TEXT_LENGTH - 20; index--) {
+        if (!Character.isLetter(text.charAt(index))) {
+          break;
+        }
+      }
+
+      final int endIndex = Character.isLetter(index) ? MAX_TEXT_LENGTH : index;
+      return text.substring(0, endIndex) + "...";
+    }
+
+    public String getLocationPrefix() {
+      return "  ";
+    }
+
+    public String getLocationSuffix() {
+      return "";
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xhtml/XHTMLLanguage.java b/xml/impl/src/com/intellij/lang/xhtml/XHTMLLanguage.java
new file mode 100644
index 0000000..52bb56d
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xhtml/XHTMLLanguage.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xhtml;
+
+import com.intellij.ide.highlighter.XmlFileHighlighter;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.fileTypes.SingleLazyInstanceSyntaxHighlighterFactory;
+import com.intellij.openapi.fileTypes.SyntaxHighlighter;
+import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
+import com.intellij.psi.impl.source.xml.XmlPsiPolicy;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author max
+ */
+public class XHTMLLanguage extends XMLLanguage {
+
+  public static final XHTMLLanguage INSTANCE = new XHTMLLanguage();
+
+  private XHTMLLanguage() {
+    super(XMLLanguage.INSTANCE, "XHTML", "text/xhtml", "application/xhtml+xml");
+    SyntaxHighlighterFactory.LANGUAGE_FACTORY.addExplicitExtension(this, new SingleLazyInstanceSyntaxHighlighterFactory() {
+      @NotNull
+      protected SyntaxHighlighter createHighlighter() {
+        return new XmlFileHighlighter(false, true);
+      }
+    });
+  }
+
+  public XmlPsiPolicy getPsiPolicy() {
+    return ENCODE_EACH_SYMBOL_POLICY;
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xhtml/XHTMLParserDefinition.java b/xml/impl/src/com/intellij/lang/xhtml/XHTMLParserDefinition.java
new file mode 100644
index 0000000..93b34c0
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xhtml/XHTMLParserDefinition.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xhtml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.xml.XMLParserDefinition;
+import com.intellij.lexer.Lexer;
+import com.intellij.lexer.XHtmlLexer;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.source.xml.XmlFileImpl;
+import com.intellij.psi.xml.XmlElementType;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author max
+ */
+public class XHTMLParserDefinition extends XMLParserDefinition {
+
+  @NotNull
+  public Lexer createLexer(Project project) {
+    return new XHtmlLexer();
+  }
+
+  public SpaceRequirements spaceExistanceTypeBetweenTokens(ASTNode left, ASTNode right) {
+    final Lexer lexer = createLexer(left.getPsi().getProject());
+    return canStickTokensTogetherByLexerInXml(left, right, lexer, 0);
+  }
+
+  public PsiFile createFile(FileViewProvider viewProvider) {
+    return new XmlFileImpl(viewProvider, XmlElementType.XHTML_FILE);
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/lang/xhtml/XhtmlFormattingModelBuilder.java b/xml/impl/src/com/intellij/lang/xhtml/XhtmlFormattingModelBuilder.java
new file mode 100644
index 0000000..769f7cc
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xhtml/XhtmlFormattingModelBuilder.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.lang.xhtml;
+
+import com.intellij.formatting.FormattingModel;
+import com.intellij.formatting.FormattingModelBuilder;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.formatter.FormattingDocumentModelImpl;
+import com.intellij.psi.formatter.xml.HtmlPolicy;
+import com.intellij.psi.formatter.xml.XmlBlock;
+import com.intellij.psi.impl.source.SourceTreeToPsiMap;
+import com.intellij.lang.xml.XmlFormattingModel;
+import org.jetbrains.annotations.NotNull;
+
+public class XhtmlFormattingModelBuilder implements FormattingModelBuilder {
+  @NotNull
+    public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
+    final PsiFile psiFile = element.getContainingFile();
+    final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(psiFile);
+    return new XmlFormattingModel(psiFile,
+                                                            new XmlBlock(SourceTreeToPsiMap.psiElementToTree(psiFile),
+                                                                         null, null,
+                                                                         new HtmlPolicy(settings, documentModel), null, null, false),
+                                                            documentModel);
+  }
+
+  public TextRange getRangeAffectingIndent(PsiFile file, int offset, ASTNode elementAtOffset) {
+    return null;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/lang/xml/XMLExternalAnnotator.java b/xml/impl/src/com/intellij/lang/xml/XMLExternalAnnotator.java
new file mode 100644
index 0000000..75a8da5
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XMLExternalAnnotator.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.codeInsight.daemon.Validator;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.lang.annotation.AnnotationHolder;
+import com.intellij.lang.annotation.ExternalAnnotator;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.util.XmlTagUtil;
+
+/**
+ * @author ven
+ */
+public class XMLExternalAnnotator extends ExternalAnnotator {
+
+  public void annotate(PsiFile file, AnnotationHolder holder) {
+    if (!(file instanceof XmlFile)) return;
+    final XmlDocument document = ((XmlFile)file).getDocument();
+    if (document == null) return;
+    XmlTag rootTag = document.getRootTag();
+    XmlNSDescriptor nsDescriptor = rootTag == null ? null : rootTag.getNSDescriptor(rootTag.getNamespace(), false);
+
+    if (nsDescriptor instanceof Validator) {
+        //noinspection unchecked
+        ((Validator<XmlDocument>)nsDescriptor).validate(document, new MyHost(holder));
+    }
+  }
+
+  private static final Validator.ValidationHost.ErrorType[] types = Validator.ValidationHost.ErrorType.values();
+
+  private static void appendFixes(final Annotation annotation, final IntentionAction... actions) {
+    if (actions != null) {
+      for(IntentionAction action:actions) annotation.registerFix(action);
+    }
+  }
+
+  private static class MyHost implements Validator.ValidationHost {
+
+    private final AnnotationHolder myHolder;
+
+    public MyHost(AnnotationHolder holder) {
+
+      myHolder = holder;
+    }
+
+    public void addMessage(PsiElement context, String message, int type) {
+      addMessage(context, message, types[type]);
+    }
+
+    public void addMessage(final PsiElement context, final String message, final ErrorType type, final IntentionAction... fixes) {
+      if (message != null && message.length() > 0) {
+        if (context instanceof XmlTag) {
+          addMessagesForTag((XmlTag)context, message, type, fixes);
+        }
+        else {
+          if (type == Validator.ValidationHost.ErrorType.ERROR) {
+            appendFixes(myHolder.createErrorAnnotation(context, message), fixes);
+          } else {
+            appendFixes(myHolder.createWarningAnnotation(context, message), fixes);
+          }
+        }
+      }
+    }
+
+    private void addMessagesForTag(XmlTag tag, String message, ErrorType type, IntentionAction... actions) {
+      XmlToken childByRole = XmlTagUtil.getStartTagNameElement(tag);
+
+      addMessagesForTreeChild(childByRole, type, message, actions);
+
+      childByRole = XmlTagUtil.getEndTagNameElement(tag);
+      addMessagesForTreeChild(childByRole, type, message, actions);
+    }
+
+    private void addMessagesForTreeChild(final XmlToken childByRole, final ErrorType type, final String message, IntentionAction... actions) {
+      if (childByRole != null) {
+        Annotation annotation;
+        if (type == ErrorType.ERROR) {
+          annotation = myHolder.createErrorAnnotation(childByRole, message);
+        }
+        else {
+          annotation = myHolder.createWarningAnnotation(childByRole, message);
+        }
+
+        appendFixes(annotation, actions);
+      }
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XMLLanguage.java b/xml/impl/src/com/intellij/lang/xml/XMLLanguage.java
new file mode 100644
index 0000000..872cc75
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XMLLanguage.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.ide.highlighter.XmlFileHighlighter;
+import com.intellij.lang.CompositeLanguage;
+import com.intellij.lang.Language;
+import com.intellij.openapi.fileTypes.SingleLazyInstanceSyntaxHighlighterFactory;
+import com.intellij.openapi.fileTypes.SyntaxHighlighter;
+import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
+import com.intellij.psi.impl.source.xml.XmlPsiPolicy;
+import com.intellij.psi.impl.source.xml.behavior.CDATAOnAnyEncodedPolicy;
+import com.intellij.psi.impl.source.xml.behavior.EncodeEachSymbolPolicy;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author max
+ */
+public class XMLLanguage extends CompositeLanguage {
+
+  public final static XMLLanguage INSTANCE = new XMLLanguage();
+
+  protected static final CDATAOnAnyEncodedPolicy CDATA_ON_ANY_ENCODED_POLICY = new CDATAOnAnyEncodedPolicy();
+  protected static final EncodeEachSymbolPolicy ENCODE_EACH_SYMBOL_POLICY = new EncodeEachSymbolPolicy();
+
+  private XMLLanguage() {
+    super("XML", "text/xml");
+
+    SyntaxHighlighterFactory.LANGUAGE_FACTORY.addExplicitExtension(this, new SingleLazyInstanceSyntaxHighlighterFactory() {
+      @NotNull
+      protected SyntaxHighlighter createHighlighter() {
+        return new XmlFileHighlighter();
+      }
+    });
+  }
+
+  @Deprecated
+  protected XMLLanguage(@NonNls String name, @NonNls String... mime) {
+    super(name, mime);
+  }
+
+  protected XMLLanguage(Language baseLanguage, @NonNls String name, @NonNls String... mime) {
+    super(baseLanguage, name, mime);
+  }
+
+
+  public XmlPsiPolicy getPsiPolicy() {
+    return CDATA_ON_ANY_ENCODED_POLICY;
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XMLParserDefinition.java b/xml/impl/src/com/intellij/lang/xml/XMLParserDefinition.java
new file mode 100644
index 0000000..a25df77
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XMLParserDefinition.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.ParserDefinition;
+import com.intellij.lang.PsiParser;
+import com.intellij.lexer.Lexer;
+import com.intellij.lexer.XmlLexer;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.source.parsing.xml.XmlParser;
+import com.intellij.psi.impl.source.xml.XmlFileImpl;
+import com.intellij.psi.tree.IFileElementType;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.util.PsiUtilCore;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTokenType;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author max
+ */
+public class XMLParserDefinition implements ParserDefinition {
+  @NotNull
+  public Lexer createLexer(Project project) {
+    return new XmlLexer();
+  }
+
+  public IFileElementType getFileNodeType() {
+    return XmlElementType.XML_FILE;
+  }
+
+  @NotNull
+  public TokenSet getWhitespaceTokens() {
+    return XmlTokenType.WHITESPACES;
+  }
+
+  @NotNull
+  public TokenSet getCommentTokens() {
+    return XmlTokenType.COMMENTS;
+  }
+
+  @NotNull
+  public TokenSet getStringLiteralElements() {
+    return TokenSet.EMPTY;
+  }
+
+  @NotNull
+  public PsiParser createParser(final Project project) {
+    return new XmlParser();
+  }
+
+  @NotNull
+  public PsiElement createElement(ASTNode node) {
+    return PsiUtilCore.NULL_PSI_ELEMENT;
+  }
+
+  public PsiFile createFile(FileViewProvider viewProvider) {
+    return new XmlFileImpl(viewProvider, XmlElementType.XML_FILE);
+  }
+
+  public SpaceRequirements spaceExistanceTypeBetweenTokens(ASTNode left, ASTNode right) {
+    final Lexer lexer = createLexer(left.getPsi().getProject());
+    return canStickTokensTogetherByLexerInXml(left, right, lexer, 0);
+  }
+
+  public static SpaceRequirements canStickTokensTogetherByLexerInXml(final ASTNode left,
+                                                                                      final ASTNode right,
+                                                                                      final Lexer lexer,
+                                                                                      int state) {
+    if (left.getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN ||
+        right.getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN) {
+      return SpaceRequirements.MUST_NOT;
+    }
+    if (left.getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER && right.getElementType() == XmlTokenType.XML_NAME) {
+      return SpaceRequirements.MUST;
+    }
+    if (left.getElementType() == XmlTokenType.XML_NAME && right.getElementType() == XmlTokenType.XML_NAME) {
+      return SpaceRequirements.MUST;
+    }
+    return SpaceRequirements.MAY;
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlASTFactory.java b/xml/impl/src/com/intellij/lang/xml/XmlASTFactory.java
new file mode 100644
index 0000000..4b49994
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlASTFactory.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.lang.ASTFactory;
+import com.intellij.lang.impl.PsiBuilderImpl;
+import com.intellij.psi.impl.source.html.HtmlDocumentImpl;
+import com.intellij.psi.impl.source.html.HtmlTagImpl;
+import com.intellij.psi.impl.source.tree.*;
+import com.intellij.psi.impl.source.xml.*;
+import com.intellij.psi.templateLanguages.TemplateDataElementType;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.ILazyParseableElementType;
+import com.intellij.psi.tree.xml.IXmlLeafElementType;
+import static com.intellij.psi.xml.XmlElementType.*;
+import static com.intellij.psi.xml.XmlElementType.XML_ELEMENT_CONTENT_GROUP;
+
+public class XmlASTFactory extends ASTFactory {
+  public CompositeElement createComposite(final IElementType type) {
+    if (type == XML_TAG) {
+      return new XmlTagImpl();
+    }
+    else if (type == XML_CONDITIONAL_SECTION) {
+      return new XmlConditionalSectionImpl();
+    }
+    else if (type == HTML_TAG) {
+      return new HtmlTagImpl();
+    }
+    else if (type == XML_TEXT) {
+      return new XmlTextImpl();
+    }
+    else if (type == XML_PROCESSING_INSTRUCTION) {
+      return new XmlProcessingInstructionImpl();
+    }
+    else if (type == XML_DOCUMENT) {
+      return new XmlDocumentImpl();
+    }
+    else if (type == HTML_DOCUMENT) {
+      return new HtmlDocumentImpl();
+    }
+    else if (type == XML_PROLOG) {
+      return new XmlPrologImpl();
+    }
+    else if (type == XML_DECL) {
+      return new XmlDeclImpl();
+    }
+    else if (type == XML_ATTRIBUTE) {
+      return new XmlAttributeImpl();
+    }
+    else if (type == XML_ATTRIBUTE_VALUE) {
+      return new XmlAttributeValueImpl();
+    }
+    else if (type == XML_COMMENT) {
+      return new XmlCommentImpl();
+    }
+    else if (type == XML_DOCTYPE) {
+      return new XmlDoctypeImpl();
+    }
+    else if (type == XML_MARKUP_DECL) {
+      return new XmlMarkupDeclImpl();
+    }
+    else if (type == XML_ELEMENT_DECL) {
+      return new XmlElementDeclImpl();
+    }
+    else if (type == XML_ENTITY_DECL) {
+      return new XmlEntityDeclImpl();
+    }
+    else if (type == XML_ATTLIST_DECL) {
+      return new XmlAttlistDeclImpl();
+    }
+    else if (type == XML_ATTRIBUTE_DECL) {
+      return new XmlAttributeDeclImpl();
+    }
+    else if (type == XML_NOTATION_DECL) {
+      return new XmlNotationDeclImpl();
+    }
+    else if (type == XML_ELEMENT_CONTENT_SPEC) {
+      return new XmlElementContentSpecImpl();
+    }
+    else if (type == XML_ELEMENT_CONTENT_GROUP) {
+      return new XmlElementContentGroupImpl();
+    }
+    else if (type == XML_ENTITY_REF) {
+      return new XmlEntityRefImpl();
+    }
+    else if (type == XML_ENUMERATED_TYPE) {
+      return new XmlEnumeratedTypeImpl();
+    }
+    else if (type == XML_CDATA) {
+      return new CompositePsiElement(XML_CDATA) {};
+    }
+    else if (type instanceof TemplateDataElementType) {
+      return new XmlFileElement(type, null);
+    }
+
+    return null;
+  }
+
+  @Override
+  public LazyParseableElement createLazy(ILazyParseableElementType type, CharSequence text) {
+    if (type == XML_FILE) {
+      return new XmlFileElement(type, text);
+    }
+    else if (type == DTD_FILE) {
+      return new XmlFileElement(type, text);
+    }
+    else if (type == XHTML_FILE) {
+      return new XmlFileElement(type, text);
+    }
+    else if (type == HTML_FILE) {
+      return new HtmlFileElement(text);
+    }
+    else if (type instanceof TemplateDataElementType) {
+      return new XmlFileElement(type, text);
+    }
+    return null;
+  }
+
+  public LeafElement createLeaf(final IElementType type, CharSequence text) {
+    if (type instanceof IXmlLeafElementType) {
+      if (type == XML_REAL_WHITE_SPACE) {
+        return new PsiWhiteSpaceImpl(text);
+      }
+      return new XmlTokenImpl(type, text);
+    }
+
+    return null;
+  }
+
+  static {
+    PsiBuilderImpl.registerWhitespaceToken(XML_REAL_WHITE_SPACE);    
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlAttributeValueRenameValidator.java b/xml/impl/src/com/intellij/lang/xml/XmlAttributeValueRenameValidator.java
new file mode 100644
index 0000000..b0618e7
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlAttributeValueRenameValidator.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.patterns.ElementPattern;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.refactoring.rename.RenameInputValidator;
+import com.intellij.util.ProcessingContext;
+
+import static com.intellij.patterns.PlatformPatterns.psiElement;
+
+public class XmlAttributeValueRenameValidator implements RenameInputValidator {
+  @Override
+  public ElementPattern<? extends PsiElement> getPattern() {
+    return psiElement(XmlAttributeValue.class);
+  }
+
+  public boolean isInputValid(final String newName, final PsiElement element, final ProcessingContext context) {
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlCommenter.java b/xml/impl/src/com/intellij/lang/xml/XmlCommenter.java
new file mode 100644
index 0000000..4701036
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlCommenter.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.lang.Commenter;
+
+/**
+ * @author max
+ */
+public class XmlCommenter implements Commenter {
+
+  public String getLineCommentPrefix() {
+    return null;
+  }
+
+  public String getBlockCommentPrefix() {
+    return "<!--";
+  }
+
+  public String getBlockCommentSuffix() {
+    return "-->";
+  }
+
+  public String getCommentedBlockCommentPrefix() {
+    return "&lt;!&ndash;";
+  }
+
+  public String getCommentedBlockCommentSuffix() {
+    return "&ndash;&gt;";
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlElementRenameValidator.java b/xml/impl/src/com/intellij/lang/xml/XmlElementRenameValidator.java
new file mode 100644
index 0000000..3324366
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlElementRenameValidator.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.patterns.ElementPattern;
+import com.intellij.patterns.PlatformPatterns;
+import com.intellij.patterns.XmlPatterns;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttributeDecl;
+import com.intellij.psi.xml.XmlElementDecl;
+import com.intellij.refactoring.rename.RenameInputValidator;
+import com.intellij.util.ProcessingContext;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+
+import static com.intellij.patterns.PlatformPatterns.psiElement;
+import static com.intellij.patterns.StandardPatterns.or;
+
+public class XmlElementRenameValidator implements RenameInputValidator {
+  @Override
+  public ElementPattern<? extends PsiElement> getPattern() {
+    return or(
+      XmlPatterns.xmlTag().withMetaData(
+        or(PlatformPatterns.instanceOf(XmlElementDescriptor.class),
+           PlatformPatterns.instanceOf(XmlAttributeDescriptor.class))
+      ),
+      psiElement(XmlElementDecl.class),
+      psiElement(XmlAttributeDecl.class),
+      XmlPatterns.xmlTag().withDescriptor(
+        or(PlatformPatterns.instanceOf(XmlElementDescriptor.class),
+           PlatformPatterns.instanceOf(XmlAttributeDescriptor.class))
+      )
+    );
+  }
+
+  public boolean isInputValid(final String newName, final PsiElement element, final ProcessingContext context) {
+    return newName.trim().matches("([\\d\\w\\_\\.\\-]+:)?[\\d\\w\\_\\.\\-]+");
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlEnclosingTagUnwrapper.java b/xml/impl/src/com/intellij/lang/xml/XmlEnclosingTagUnwrapper.java
new file mode 100644
index 0000000..825f168
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlEnclosingTagUnwrapper.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.codeInsight.unwrap.Unwrapper;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlBundle;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.lang.ASTNode;
+
+import java.util.Set;
+import java.util.List;
+import java.util.Collections;
+
+public class XmlEnclosingTagUnwrapper implements Unwrapper {
+  public boolean isApplicableTo(PsiElement e) {
+    return true;
+  }
+
+  public void collectElementsToIgnore(PsiElement element, Set<PsiElement> result) {
+  }
+
+  public String getDescription(PsiElement e) {
+    return XmlBundle.message("unwrap.enclosing.tag.name.action.name", ((XmlTag)e).getName());
+  }
+
+  public PsiElement collectAffectedElements(PsiElement e, List<PsiElement> toExtract) {
+    return e;
+  }
+
+  public List<PsiElement> unwrap(Editor editor, PsiElement element) throws IncorrectOperationException {
+    final TextRange range = element.getTextRange();
+    final ASTNode startTagNameEnd = XmlChildRole.START_TAG_END_FINDER.findChild(element.getNode());
+    final ASTNode endTagNameStart = XmlChildRole.CLOSING_TAG_START_FINDER.findChild(element.getNode());
+
+    if (endTagNameStart != null) {
+      editor.getDocument().replaceString(endTagNameStart.getTextRange().getStartOffset(), range.getEndOffset(), "");
+      editor.getDocument().replaceString(range.getStartOffset(), startTagNameEnd.getTextRange().getEndOffset(), "");
+    }
+    else {
+      editor.getDocument().replaceString(range.getStartOffset(), range.getEndOffset(), "");
+    }
+    return Collections.emptyList();
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlFindUsagesProvider.java b/xml/impl/src/com/intellij/lang/xml/XmlFindUsagesProvider.java
new file mode 100644
index 0000000..c9154bd
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlFindUsagesProvider.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.find.impl.HelpID;
+import com.intellij.lang.LangBundle;
+import com.intellij.lang.cacheBuilder.WordsScanner;
+import com.intellij.lang.findUsages.FindUsagesProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.xml.*;
+import com.intellij.usageView.UsageViewBundle;
+import com.intellij.usageView.UsageViewUtil;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author ven
+ */
+public class XmlFindUsagesProvider implements FindUsagesProvider {
+
+  public boolean canFindUsagesFor(@NotNull PsiElement element) {
+    return element instanceof XmlElementDecl ||
+           element instanceof XmlAttributeDecl ||
+           element instanceof XmlEntityDecl ||
+           element instanceof XmlTag ||
+           element instanceof XmlAttributeValue ||
+           element instanceof PsiFile ||
+           element instanceof XmlComment;
+  }
+
+  @NotNull
+  public String getType(@NotNull PsiElement element) {
+    if (element instanceof XmlTag) {
+      final PsiMetaData metaData = ((XmlTag)element).getMetaData();
+      if (metaData != null && metaData.getDeclaration() instanceof XmlTag) {
+        return ((XmlTag)metaData.getDeclaration()).getName();
+      }
+      return LangBundle.message("xml.terms.xml.tag");
+    }
+    if (element instanceof XmlElementDecl) {
+      return LangBundle.message("xml.terms.tag");
+    }
+    else if (element instanceof XmlAttributeDecl) {
+      return LangBundle.message("xml.terms.attribute");
+    }
+    else if (element instanceof XmlAttributeValue) {
+      return LangBundle.message("xml.terms.attribute.value");
+    }
+    else if (element instanceof XmlEntityDecl) {
+      return LangBundle.message("xml.terms.entity");
+    }
+    else if (element instanceof XmlAttribute) {
+      return LangBundle.message("xml.terms.attribute");
+    } else if (element instanceof XmlComment) {
+      return LangBundle.message("xml.terms.variable");
+    }
+    throw new IllegalArgumentException("Cannot get type for " + element);
+  }
+
+  public String getHelpId(@NotNull PsiElement element) {
+    return HelpID.FIND_OTHER_USAGES;
+  }
+
+  @NotNull
+  public String getDescriptiveName(@NotNull PsiElement element) {
+    if (element instanceof XmlTag) {
+      return ((XmlTag)element).getName();
+    }
+
+    if (element instanceof XmlAttributeValue) {
+      return ((XmlAttributeValue)element).getValue();
+    }
+
+    if (element instanceof PsiNamedElement) {
+      return ((PsiNamedElement)element).getName();
+    } else {
+      return element.getText();
+    }
+  }
+
+  @NotNull
+  public String getNodeText(@NotNull PsiElement element, boolean useFullName) {
+    if (element instanceof XmlTag) {
+      final XmlTag xmlTag = (XmlTag)element;
+      final PsiMetaData metaData = xmlTag.getMetaData();
+      final String name = metaData != null ? UsageViewUtil.getMetaDataName(metaData) : xmlTag.getName();
+      return UsageViewBundle.message("usage.target.xml.tag.of.file", metaData == null ? "<" + name + ">" : name, xmlTag.getContainingFile().getName());
+    }
+    else if (element instanceof XmlAttributeValue) {
+      return ((XmlAttributeValue)element).getValue();
+    }
+    if (element instanceof PsiNamedElement) {
+      return ((PsiNamedElement)element).getName();
+    } else {
+      return element.getText();
+    }
+  }
+
+  public WordsScanner getWordsScanner() {
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlFoldingBuilder.java b/xml/impl/src/com/intellij/lang/xml/XmlFoldingBuilder.java
new file mode 100644
index 0000000..1fc9b15
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlFoldingBuilder.java
@@ -0,0 +1,243 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.application.options.editor.XmlFoldingSettings;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.Language;
+import com.intellij.lang.folding.FoldingBuilder;
+import com.intellij.lang.folding.FoldingDescriptor;
+import com.intellij.lang.folding.LanguageFolding;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.project.DumbAware;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.impl.source.html.HtmlFileImpl;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.xml.*;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.util.XmlTagUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class XmlFoldingBuilder implements FoldingBuilder, DumbAware {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.lang.xml.XmlFoldingBuilder");
+  private static final TokenSet XML_ATTRIBUTE_SET = TokenSet.create(XmlElementType.XML_ATTRIBUTE);
+  private static final int MIN_TEXT_RANGE_LENGTH = 3;
+  private static final String STYLE_ATTRIBUTE = "style";
+
+  @NotNull
+  public FoldingDescriptor[] buildFoldRegions(@NotNull ASTNode node, @NotNull Document document) {
+    final PsiElement psiElement = node.getPsi();
+    XmlDocument xmlDocument = null;
+    
+    if (psiElement instanceof XmlFile) { 
+      XmlFile file = (XmlFile)psiElement;
+      xmlDocument = file.getDocument();
+    }
+    else if (psiElement instanceof XmlDocument) {
+      xmlDocument = (XmlDocument)psiElement;
+    }
+    
+    XmlElement rootTag = xmlDocument == null ? null : xmlDocument.getRootTag();
+    if (rootTag == null) {
+      rootTag = xmlDocument;
+    }
+    List<FoldingDescriptor> foldings = null;
+
+    if (rootTag != null) {
+      foldings = new ArrayList<FoldingDescriptor>();
+
+      doAddForChildren(xmlDocument, foldings, document);
+    }
+
+    return foldings != null ? foldings.toArray(new FoldingDescriptor[foldings.size()]):FoldingDescriptor.EMPTY;
+  }
+
+  protected void addElementsToFold(List<FoldingDescriptor> foldings, XmlElement tag, Document document) {
+    addToFold(foldings, tag, document);
+    doAddForChildren(tag, foldings, document);
+  }
+
+  protected void doAddForChildren(final XmlElement tag, final List<FoldingDescriptor> foldings, final Document document) {
+    final PsiElement[] children = tag.getChildren();
+
+    for (PsiElement child : children) {
+      ProgressManager.checkCanceled();
+
+      if (child instanceof XmlTag || child instanceof XmlConditionalSection) {
+        addElementsToFold(foldings, (XmlElement)child, document);
+      }
+      else if (child instanceof XmlComment) {
+        addToFold(foldings, child, document);
+      }
+      else if (child instanceof XmlText || child instanceof XmlProlog) {
+        final PsiElement[] grandChildren = child.getChildren();
+
+        for (PsiElement grandChild : grandChildren) {
+          ProgressManager.checkCanceled();
+
+          if (grandChild instanceof XmlComment) {
+            addToFold(foldings, grandChild, document);
+          }
+        }
+      }
+      else if(child instanceof XmlAttribute && isAttributeShouldBeFolded((XmlAttribute)child)) {
+        addToFold(foldings, child, document);
+      }
+      else {
+        final Language language = child.getLanguage();
+        if (!(language instanceof XMLLanguage) && language != Language.ANY) {
+          final FoldingBuilder foldingBuilder = LanguageFolding.INSTANCE.forLanguage(language);
+
+          if (foldingBuilder != null) {
+            final FoldingDescriptor[] foldingDescriptors = foldingBuilder.buildFoldRegions(child.getNode(), document);
+
+            ContainerUtil.addAll(foldings, foldingDescriptors);
+          }
+        }
+      }
+    }
+  }
+
+  @Nullable
+  public TextRange getRangeToFold(PsiElement element) {
+    if (element instanceof XmlTag) {
+      final ASTNode tagNode = element.getNode();
+      XmlToken tagNameElement = XmlTagUtil.getStartTagNameElement((XmlTag)element);
+      if (tagNameElement == null) return null;
+
+      int nameEnd = tagNameElement.getTextRange().getEndOffset();
+      int end = tagNode.getLastChildNode().getTextRange().getEndOffset() - 1;  // last child node can be another tag in unbalanced tree
+      ASTNode[] attributes = tagNode.getChildren(XML_ATTRIBUTE_SET);
+
+      if (attributes.length > 0) {
+        ASTNode lastAttribute = attributes[attributes.length - 1];
+        ASTNode lastAttributeBeforeCR = null;
+
+        for (ASTNode child = tagNode.getFirstChildNode(); child != lastAttribute.getTreeNext(); child = child.getTreeNext()) {
+          if (child.getElementType() == XmlElementType.XML_ATTRIBUTE) {
+            lastAttributeBeforeCR = child;
+          } else if (child.getPsi() instanceof PsiWhiteSpace) {
+            if (child.textContains('\n')) break;
+          }
+        }
+
+        if (lastAttributeBeforeCR != null) {
+          int attributeEnd = lastAttributeBeforeCR.getTextRange().getEndOffset();
+          return new TextRange(attributeEnd, end);
+        }
+      }
+
+      return new TextRange(nameEnd, end);
+    } else if (element instanceof XmlComment) {
+      final XmlComment xmlComment = (XmlComment)element;
+      final TextRange textRange = element.getTextRange();
+      int commentStartOffset = getCommentStartOffset(xmlComment);
+      int commentEndOffset = getCommentStartEnd(xmlComment);
+
+      if (textRange.getEndOffset() - textRange.getStartOffset() > commentStartOffset + commentEndOffset) {
+        return new TextRange(textRange.getStartOffset() + commentStartOffset, textRange.getEndOffset() - commentEndOffset);
+      }
+      else {
+        return null;
+      }
+    }
+    else if (element instanceof XmlConditionalSection) {
+      final XmlConditionalSection conditionalSection = (XmlConditionalSection)element;
+      final TextRange textRange = element.getTextRange();
+      final PsiElement bodyStart = conditionalSection.getBodyStart();
+      int startOffset = bodyStart != null ? bodyStart.getStartOffsetInParent() : MIN_TEXT_RANGE_LENGTH;
+      int endOffset = MIN_TEXT_RANGE_LENGTH;
+
+      if (textRange.getEndOffset() - textRange.getStartOffset() > startOffset + endOffset) {
+        return new TextRange(textRange.getStartOffset() + startOffset, textRange.getEndOffset() - endOffset);
+      }
+      else {
+        return null;
+      }
+    }
+    else if (element instanceof XmlAttribute) {
+      final XmlAttributeValue valueElement = ((XmlAttribute)element).getValueElement();
+      return valueElement != null ? valueElement.getValueTextRange() : null;
+    }
+    else {
+      return null;
+    }
+  }
+
+  protected int getCommentStartOffset(final XmlComment element) {
+    return 4;
+  }
+
+  protected int getCommentStartEnd(final XmlComment element) {
+    return MIN_TEXT_RANGE_LENGTH;
+  }
+
+  protected boolean addToFold(List<FoldingDescriptor> foldings, PsiElement elementToFold, Document document) {
+    LOG.assertTrue(elementToFold.isValid());
+    TextRange range = getRangeToFold(elementToFold);
+    if (range == null) return false;
+
+    if(range.getStartOffset() >= 0 &&
+       range.getEndOffset() <= elementToFold.getContainingFile().getTextRange().getEndOffset() &&
+       range.getEndOffset() <= document.getTextLength() // psi and document maybe not in sync after error
+      ) {
+
+      int startLine = document.getLineNumber(range.getStartOffset());
+      int endLine = document.getLineNumber(range.getEndOffset() - 1);
+      if (startLine < endLine || elementToFold instanceof XmlAttribute) {
+        if (range.getStartOffset() + MIN_TEXT_RANGE_LENGTH < range.getEndOffset()) {
+          foldings.add(new FoldingDescriptor(elementToFold.getNode(), range));
+          return true;
+        }
+      }
+    }
+
+    return false;
+  }
+
+  public String getPlaceholderText(@NotNull ASTNode node) {
+    final PsiElement psi = node.getPsi();
+    if (psi instanceof XmlTag ||
+        psi instanceof XmlComment ||
+        psi instanceof XmlAttribute ||
+        psi instanceof XmlConditionalSection
+       ) return "...";
+    return null;
+  }
+
+  public boolean isCollapsedByDefault(@NotNull ASTNode node) {
+    final PsiElement psi = node.getPsi();
+    final XmlFoldingSettings foldingSettings = XmlFoldingSettings.getInstance();
+    return (psi instanceof XmlTag && foldingSettings.isCollapseXmlTags())
+           || (psi instanceof XmlAttribute && foldingSettings.isCollapseHtmlStyleAttribute());
+  }
+
+  private static boolean isAttributeShouldBeFolded(XmlAttribute child) {
+    return child.getContainingFile() instanceof HtmlFileImpl &&
+      STYLE_ATTRIBUTE.equalsIgnoreCase(((XmlAttribute)child).getName());
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlFormattingModel.java b/xml/impl/src/com/intellij/lang/xml/XmlFormattingModel.java
new file mode 100644
index 0000000..522a645
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlFormattingModel.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.formatting.Block;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.TokenType;
+import com.intellij.psi.formatter.FormatterUtil;
+import com.intellij.psi.formatter.FormattingDocumentModelImpl;
+import com.intellij.psi.formatter.PsiBasedFormattingModel;
+import com.intellij.psi.impl.source.tree.TreeUtil;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlElementType;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+public class XmlFormattingModel extends PsiBasedFormattingModel {
+  private static final Logger LOG =
+      Logger.getInstance("#com.intellij.psi.impl.source.codeStyle.PsiBasedFormatterModelWithShiftIndentInside");
+
+  private final Project myProject;
+
+  public XmlFormattingModel(final PsiFile file,
+                                                     final Block rootBlock,
+                                                     final FormattingDocumentModelImpl documentModel) {
+    super(file, rootBlock, documentModel);
+    myProject = file.getProject();
+  }
+
+  public TextRange shiftIndentInsideRange(TextRange textRange, int shift) {
+    return shiftIndentInsideWithPsi(textRange, shift);
+  }
+
+  public void commitChanges() {
+  }
+
+
+  private TextRange shiftIndentInsideWithPsi(final TextRange textRange, final int shift) {
+    final int offset = textRange.getStartOffset();
+
+    ASTNode leafElement = findElementAt(offset);
+    while (leafElement != null && !leafElement.getTextRange().equals(textRange)) {
+      leafElement = leafElement.getTreeParent();
+    }
+
+    return textRange;
+  }
+
+  protected String replaceWithPsiInLeaf(final TextRange textRange, String whiteSpace, ASTNode leafElement) {
+     if (!myCanModifyAllWhiteSpaces) {
+       if (leafElement.getElementType() == TokenType.WHITE_SPACE) return null;
+       LOG.assertTrue(leafElement.getPsi().isValid());
+       ASTNode prevNode = TreeUtil.prevLeaf(leafElement);
+
+       if (prevNode != null) {
+         IElementType type = prevNode.getElementType();
+         if(type == TokenType.WHITE_SPACE) {
+           final String text = prevNode.getText();
+
+           final @NonNls String cdataStartMarker = "<![CDATA[";
+           final int cdataPos = text.indexOf(cdataStartMarker);
+           if (cdataPos != -1 && whiteSpace.indexOf(cdataStartMarker) == -1) {
+             whiteSpace = mergeWsWithCdataMarker(whiteSpace, text, cdataPos);
+             if (whiteSpace == null) return null;
+           }
+
+           prevNode = TreeUtil.prevLeaf(prevNode);
+           type = prevNode != null ? prevNode.getElementType():null;
+         }
+
+         final @NonNls String cdataEndMarker = "]]>";
+         if(type == XmlElementType.XML_CDATA_END && whiteSpace.indexOf(cdataEndMarker) == -1) {
+           final ASTNode at = findElementAt(prevNode.getStartOffset());
+
+           if (at != null && at.getPsi() instanceof PsiWhiteSpace) {
+             final String s = at.getText();
+             final int cdataEndPos = s.indexOf(cdataEndMarker);
+             whiteSpace = mergeWsWithCdataMarker(whiteSpace, s, cdataEndPos);
+             leafElement = at;
+           } else {
+             whiteSpace = null;
+           }
+           if (whiteSpace == null) return null;
+         }
+       }
+     }
+     FormatterUtil.replaceWhiteSpace(whiteSpace, leafElement, TokenType.WHITE_SPACE, textRange);
+     return whiteSpace;
+   }
+
+   @Nullable
+   private static String mergeWsWithCdataMarker(String whiteSpace, final String s, final int cdataPos) {
+     final int firstCrInGeneratedWs = whiteSpace.indexOf('\n');
+     final int secondCrInGeneratedWs = firstCrInGeneratedWs != -1 ? whiteSpace.indexOf('\n', firstCrInGeneratedWs + 1):-1;
+     final int firstCrInPreviousWs = s.indexOf('\n');
+     final int secondCrInPreviousWs = firstCrInPreviousWs != -1 ? s.indexOf('\n', firstCrInPreviousWs + 1):-1;
+
+     boolean knowHowToModifyCData = false;
+
+     if (secondCrInPreviousWs != -1 && secondCrInGeneratedWs != -1 && cdataPos > firstCrInPreviousWs && cdataPos < secondCrInPreviousWs ) {
+       whiteSpace = whiteSpace.substring(0, secondCrInGeneratedWs) + s.substring(firstCrInPreviousWs + 1, secondCrInPreviousWs) + whiteSpace.substring(secondCrInGeneratedWs);
+       knowHowToModifyCData = true;
+     }
+     if (!knowHowToModifyCData) whiteSpace = null;
+     return whiteSpace;
+   }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlFormattingModelBuilder.java b/xml/impl/src/com/intellij/lang/xml/XmlFormattingModelBuilder.java
new file mode 100644
index 0000000..d87bdf4
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlFormattingModelBuilder.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.formatting.FormattingModel;
+import com.intellij.formatting.FormattingModelBuilder;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.formatter.FormattingDocumentModelImpl;
+import com.intellij.psi.formatter.xml.XmlBlock;
+import com.intellij.psi.formatter.xml.XmlPolicy;
+import com.intellij.psi.impl.source.SourceTreeToPsiMap;
+import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.impl.source.tree.TreeUtil;
+import org.jetbrains.annotations.NotNull;
+
+public class XmlFormattingModelBuilder implements FormattingModelBuilder {
+  
+  @NotNull
+  public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
+    final ASTNode root = TreeUtil.getFileElement((TreeElement)SourceTreeToPsiMap.psiElementToTree(element));
+    final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(element.getContainingFile());
+    return new XmlFormattingModel(element.getContainingFile(),
+                                                           new XmlBlock(root, null, null, new XmlPolicy(settings, documentModel), null, null, false),
+                                                           documentModel);
+  }
+
+  public TextRange getRangeAffectingIndent(PsiFile file, int offset, ASTNode elementAtOffset) {
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlLiteralEscaper.java b/xml/impl/src/com/intellij/lang/xml/XmlLiteralEscaper.java
new file mode 100644
index 0000000..74df4c2
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlLiteralEscaper.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.LiteralEscaper;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlToken;
+
+/**
+ * @author Gregory.Shrago
+ */
+public class XmlLiteralEscaper implements LiteralEscaper {
+  public String getEscapedText(PsiElement context, String originalText) {
+    if (context instanceof XmlToken) {
+      context = context.getParent();
+    }
+
+    ASTNode contextNode = context != null ? context.getNode():null;
+    if (contextNode != null && contextNode.getElementType() == XmlElementType.XML_CDATA) {
+      return originalText;
+    }
+    return escapeText(originalText);
+  }
+
+  public String escapeText(String originalText) {
+    return StringUtil.escapeXml(originalText);
+  }
+
+  public String unescapeText(String originalText) {
+    return StringUtil.unescapeXml(originalText);
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlStructureViewBuilderFactory.java b/xml/impl/src/com/intellij/lang/xml/XmlStructureViewBuilderFactory.java
new file mode 100644
index 0000000..2282b17
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlStructureViewBuilderFactory.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.ide.structureView.StructureViewBuilder;
+import com.intellij.ide.structureView.StructureViewModel;
+import com.intellij.ide.structureView.TreeBasedStructureViewBuilder;
+import com.intellij.ide.structureView.impl.xml.XmlStructureViewTreeModel;
+import com.intellij.ide.structureView.xml.XmlStructureViewBuilderProvider;
+import com.intellij.lang.Language;
+import com.intellij.lang.LanguageStructureViewBuilder;
+import com.intellij.lang.PsiStructureViewFactory;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class XmlStructureViewBuilderFactory implements PsiStructureViewFactory {
+  @Nullable
+  public StructureViewBuilder getStructureViewBuilder(final PsiFile psiFile) {
+    if (!(psiFile instanceof XmlFile)) {
+      return null;
+    }
+    StructureViewBuilder builder = getStructureViewBuilderForExtensions(psiFile);
+    if (builder != null) {
+      return builder;
+    }
+
+    for (XmlStructureViewBuilderProvider xmlStructureViewBuilderProvider : getStructureViewBuilderProviders()) {
+      final StructureViewBuilder structureViewBuilder = xmlStructureViewBuilderProvider.createStructureViewBuilder((XmlFile)psiFile);
+      if (structureViewBuilder != null) {
+        return structureViewBuilder;
+      }
+    }
+
+    return new TreeBasedStructureViewBuilder() {
+      @NotNull
+      public StructureViewModel createStructureViewModel() {
+        return new XmlStructureViewTreeModel((XmlFile)psiFile);
+      }
+    };
+  }
+
+  private static XmlStructureViewBuilderProvider[] getStructureViewBuilderProviders() {
+    return (XmlStructureViewBuilderProvider[])Extensions.getExtensions(XmlStructureViewBuilderProvider.EXTENSION_POINT_NAME);
+  }
+
+  @Nullable
+  private static StructureViewBuilder getStructureViewBuilderForExtensions(final PsiFile psiFile) {
+    for (Language language : XMLLanguage.INSTANCE.getLanguageExtensionsForFile(psiFile)) {
+      PsiStructureViewFactory factory = LanguageStructureViewBuilder.INSTANCE.forLanguage(language);
+      if (factory == null) continue;
+      final StructureViewBuilder builder = factory.getStructureViewBuilder(psiFile);
+      if (builder != null) {
+        return builder;
+      }
+    }
+    return null;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlSurroundDescriptor.java b/xml/impl/src/com/intellij/lang/xml/XmlSurroundDescriptor.java
new file mode 100644
index 0000000..f0683d3
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlSurroundDescriptor.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.codeInsight.template.HtmlContextType;
+import com.intellij.codeInsight.template.XmlContextType;
+import com.intellij.codeInsight.template.impl.TemplateContext;
+import com.intellij.codeInsight.template.impl.TemplateImpl;
+import com.intellij.lang.surroundWith.SurroundDescriptor;
+import com.intellij.lang.surroundWith.Surrounder;
+import com.intellij.openapi.util.Pair;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiUtilBase;
+import com.intellij.psi.xml.XmlTagChild;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author ven
+ */
+public class XmlSurroundDescriptor implements SurroundDescriptor {
+  @NotNull public PsiElement[] getElementsToSurround(PsiFile file, int startOffset, int endOffset) {
+    final Pair<XmlTagChild, XmlTagChild> childrenInRange = XmlUtil.findTagChildrenInRange(file, startOffset, endOffset);
+    if (childrenInRange == null) {
+      final PsiElement elementAt = file.findElementAt(startOffset);
+      if (elementAt instanceof XmlToken &&
+          ((XmlToken)elementAt).getTokenType() == XmlTokenType.XML_DATA_CHARACTERS) {
+        return new PsiElement[] {elementAt};
+      }
+      return PsiElement.EMPTY_ARRAY;
+    }
+    List<PsiElement> result = new ArrayList<PsiElement>();
+    PsiElement first = childrenInRange.getFirst();
+    PsiElement last = childrenInRange.getSecond();
+    while(true) {
+      result.add(first);
+      if (first == last) break;
+      first = first.getNextSibling();
+    }
+
+    return PsiUtilBase.toPsiElementArray(result);
+  }
+
+  @NotNull public Surrounder[] getSurrounders() {
+    return new Surrounder[0]; //everything is in live templates now
+  }
+
+  @Override
+  public boolean isExclusive() {
+    return false;
+  }
+
+  protected boolean isEnabled(final TemplateImpl template) {
+    final TemplateContext context = template.getTemplateContext();
+    return context.isEnabled(new XmlContextType()) || context.isEnabled(new HtmlContextType());
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlUnwrapDescriptor.java b/xml/impl/src/com/intellij/lang/xml/XmlUnwrapDescriptor.java
new file mode 100644
index 0000000..deb5187
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlUnwrapDescriptor.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.codeInsight.unwrap.LanguageUnwrappers;
+import com.intellij.codeInsight.unwrap.UnwrapDescriptor;
+import com.intellij.codeInsight.unwrap.Unwrapper;
+import com.intellij.lang.Language;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Pair;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlTag;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+public class XmlUnwrapDescriptor implements UnwrapDescriptor {
+  public List<Pair<PsiElement, Unwrapper>> collectUnwrappers(Project project, Editor editor, PsiFile file) {
+    int offset = editor.getCaretModel().getOffset();
+
+    PsiElement e1 = file.findElementAt(offset);
+    if (e1 != null) {
+      Language language = e1.getParent().getLanguage();
+      if (language != file.getLanguage()) {
+        UnwrapDescriptor unwrapDescriptor = LanguageUnwrappers.INSTANCE.forLanguage(language);
+        if (unwrapDescriptor != null && !(unwrapDescriptor instanceof XmlUnwrapDescriptor)) {
+          return unwrapDescriptor.collectUnwrappers(project, editor, file);
+        }
+      }
+    }
+
+    List<Pair<PsiElement, Unwrapper>> result = new ArrayList<Pair<PsiElement, Unwrapper>>();
+
+    FileViewProvider viewProvider = file.getViewProvider();
+
+    for (Language language : viewProvider.getLanguages()) {
+      UnwrapDescriptor unwrapDescriptor = LanguageUnwrappers.INSTANCE.forLanguage(language);
+      if (unwrapDescriptor instanceof XmlUnwrapDescriptor) {
+        PsiElement e = viewProvider.findElementAt(offset, language);
+
+        PsiElement tag = PsiTreeUtil.getParentOfType(e, XmlTag.class);
+        while (tag != null) {
+          if (XmlChildRole.START_TAG_NAME_FINDER.findChild(tag.getNode()) != null) { // Exclude implicit tags suck as 'jsp:root'
+            result.add(new Pair<PsiElement, Unwrapper>(tag, new XmlEnclosingTagUnwrapper()));
+          }
+          tag = PsiTreeUtil.getParentOfType(tag, XmlTag.class);
+        }
+      }
+    }
+
+    Collections.sort(result, new Comparator<Pair<PsiElement, Unwrapper>>() {
+      @Override
+      public int compare(Pair<PsiElement, Unwrapper> o1, Pair<PsiElement, Unwrapper> o2) {
+        return o2.first.getTextOffset() - o1.first.getTextOffset();
+      }
+    });
+
+    return result;
+  }
+
+  public boolean showOptionsDialog() {
+    return true;
+  }
+
+  public boolean shouldTryToRestoreCaretPosition() {
+    return false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlWhiteSpaceFormattingStrategy.java b/xml/impl/src/com/intellij/lang/xml/XmlWhiteSpaceFormattingStrategy.java
new file mode 100644
index 0000000..10cab62
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlWhiteSpaceFormattingStrategy.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.lang.ASTFactory;
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.formatter.WhiteSpaceFormattingStrategyAdapter;
+import com.intellij.psi.impl.source.codeStyle.CodeEditUtil;
+import com.intellij.psi.impl.source.tree.Factory;
+import com.intellij.psi.impl.source.tree.LeafElement;
+import com.intellij.psi.impl.source.tree.SharedImplUtil;
+import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlText;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.CharTable;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Denis Zhdanov
+ * @since 12/6/11 4:51 PM
+ */
+public class XmlWhiteSpaceFormattingStrategy extends WhiteSpaceFormattingStrategyAdapter {
+
+  private static void addWhitespaceToTagBody(final ASTNode treePrev, final LeafElement whiteSpaceElement) {
+    final CharTable charTable = SharedImplUtil.findCharTableByTree(treePrev);
+    final ASTNode treeParent = treePrev.getTreeParent();
+
+    final boolean before;
+    final XmlText xmlText;
+    if(treePrev.getElementType() == XmlElementType.XML_TEXT) {
+      xmlText = (XmlText)treePrev.getPsi();
+      before = true;
+    }
+    else if(treePrev.getTreePrev().getElementType() == XmlElementType.XML_TEXT){
+      xmlText = (XmlText)treePrev.getTreePrev().getPsi();
+      before = false;
+    }
+    else{
+      xmlText = (XmlText)Factory.createCompositeElement(XmlElementType.XML_TEXT, charTable, treeParent.getPsi().getManager());
+      CodeEditUtil.setNodeGenerated(xmlText.getNode(), true);
+      treeParent.addChild(xmlText.getNode(), treePrev);
+      before = true;
+    }
+    final ASTNode node = xmlText.getNode();
+    assert node != null;
+    final TreeElement anchorInText = (TreeElement) (before ? node.getFirstChildNode() : node.getLastChildNode());
+    if (anchorInText == null) node.addChild(whiteSpaceElement);
+    else if (anchorInText.getElementType() != XmlTokenType.XML_WHITE_SPACE) node.addChild(whiteSpaceElement, before ? anchorInText : null);
+    else {
+      final String text = before ? whiteSpaceElement.getText() + anchorInText.getText() : anchorInText.getText() +
+                                                                                          whiteSpaceElement.getText();
+      node.replaceChild(anchorInText, ASTFactory.whitespace(text));
+    }
+  }
+
+  protected boolean isInsideTagBody(@NotNull ASTNode place) {
+    final ASTNode treeParent = place.getTreeParent();
+    if(treeParent.getElementType() != XmlElementType.XML_TAG
+       && treeParent.getElementType() != XmlElementType.HTML_TAG) return false;
+    while(place != null){
+      if(place.getElementType() == XmlTokenType.XML_TAG_END) return true;
+      place = place.getTreePrev();
+    }
+    return false;
+  }
+
+  public boolean addWhitespace(@NotNull final ASTNode treePrev, @NotNull final LeafElement whiteSpaceElement) {
+    if (isInsideTagBody(treePrev)) {
+      addWhitespaceToTagBody(treePrev, whiteSpaceElement);
+      return true;
+    }
+
+    return false;
+  }
+
+  public boolean containsWhitespacesOnly(@NotNull final ASTNode node) {
+    return (node.getElementType() == XmlTokenType.XML_DATA_CHARACTERS) &&
+           node.getText().trim().length() == 0;
+  }
+}
diff --git a/xml/impl/src/com/intellij/lang/xml/XmlWordCompletionFilter.java b/xml/impl/src/com/intellij/lang/xml/XmlWordCompletionFilter.java
new file mode 100644
index 0000000..3fbd001
--- /dev/null
+++ b/xml/impl/src/com/intellij/lang/xml/XmlWordCompletionFilter.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.lang.xml;
+
+import com.intellij.codeInsight.completion.CompletionProcess;
+import com.intellij.codeInsight.completion.CompletionService;
+import com.intellij.lang.DefaultWordCompletionFilter;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTokenType;
+
+public class XmlWordCompletionFilter extends DefaultWordCompletionFilter {
+  private final static TokenSet ENABLED_TOKENS = TokenSet.create(XmlElementType.XML_CDATA,
+                                                                 XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN,
+                                                                 XmlTokenType.XML_DATA_CHARACTERS);
+  public boolean isWordCompletionEnabledIn(final IElementType element) {
+    return super.isWordCompletionEnabledIn(element) || ENABLED_TOKENS.contains(element);
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/lexer/BaseHtmlLexer.java b/xml/impl/src/com/intellij/lexer/BaseHtmlLexer.java
new file mode 100644
index 0000000..a357699
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/BaseHtmlLexer.java
@@ -0,0 +1,387 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lexer;
+
+import com.intellij.codeInsight.completion.CompletionUtil;
+import com.intellij.lang.HtmlScriptContentProvider;
+import com.intellij.lang.Language;
+import com.intellij.lang.LanguageHtmlScriptContentProvider;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.impl.source.tree.TreeUtil;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.text.CharArrayUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collection;
+import java.util.HashMap;
+
+/**
+ * @author Maxim.Mossienko
+ */
+abstract class BaseHtmlLexer extends DelegateLexer {
+  protected static final int BASE_STATE_MASK = 0x3F;
+  private static final int SEEN_STYLE = 0x40;
+  private static final int SEEN_TAG = 0x80;
+  private static final int SEEN_SCRIPT = 0x100;
+  private static final int SEEN_ATTRIBUTE = 0x200;
+  private static final int SEEN_CONTENT_TYPE = 0x400;
+  protected static final int BASE_STATE_SHIFT = 11;
+  @Nullable
+  protected static Language ourDefaultLanguage = Language.findLanguageByID("JavaScript");
+
+  private boolean seenTag;
+  private boolean seenAttribute;
+  private boolean seenStyle;
+  private boolean seenScript;
+
+  @Nullable
+  protected String scriptType = null;
+
+  private final boolean caseInsensitive;
+  private boolean seenContentType;
+  private CharSequence cachedBufferSequence;
+  private Lexer lexerOfCacheBufferSequence;
+
+  static final TokenSet TOKENS_TO_MERGE = TokenSet.create(XmlTokenType.XML_COMMENT_CHARACTERS, XmlTokenType.XML_WHITE_SPACE, XmlTokenType.XML_REAL_WHITE_SPACE,
+                                                          XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN, XmlTokenType.XML_DATA_CHARACTERS,
+                                                          XmlTokenType.XML_TAG_CHARACTERS);
+
+  public interface TokenHandler {
+    void handleElement(Lexer lexer);
+  }
+
+  public class XmlNameHandler implements TokenHandler {
+    @NonNls private static final String TOKEN_SCRIPT = "script";
+    @NonNls private static final String TOKEN_STYLE = "style";
+    @NonNls private static final String TOKEN_ON = "on";
+
+    public void handleElement(Lexer lexer) {
+      final CharSequence buffer;
+      if (lexerOfCacheBufferSequence == lexer) {
+        buffer = cachedBufferSequence;
+      } else {
+        cachedBufferSequence = lexer.getBufferSequence();
+        buffer = cachedBufferSequence;
+        lexerOfCacheBufferSequence = lexer;
+      }
+      final char firstCh = buffer.charAt(lexer.getTokenStart());
+
+      if (seenScript && !seenTag) {
+        seenContentType = false;
+
+        if (((firstCh == 'l' || firstCh == 't') || (caseInsensitive && (firstCh == 'L' || firstCh == 'T')))) {
+          @NonNls String name = TreeUtil.getTokenText(lexer);
+          if (caseInsensitive) name = name.toLowerCase();
+
+          if ("language".equals(name) || "type".equals(name)) {
+            seenContentType = true;
+          }
+        }
+
+        return;
+      }
+
+      if (firstCh !='o' && firstCh !='s' &&
+          (!caseInsensitive || (firstCh !='S' && firstCh !='O') )
+          ) {
+        return; // optimization
+      }
+
+      String name = TreeUtil.getTokenText(lexer);
+      if (caseInsensitive) name = name.toLowerCase();
+
+      final boolean style = name.equals(TOKEN_STYLE);
+      final int state = getState() & BASE_STATE_MASK;
+      final boolean script = name.equals(TOKEN_SCRIPT) ||
+                       ((name.startsWith(TOKEN_ON) && name.indexOf(':') == -1 && !isHtmlTagState(state)));
+
+      if (style || script) {
+        // encountered tag name in end of tag
+        if (seenTag) {
+          if (isHtmlTagState(state)) {
+            seenTag = false;
+          }
+          return;
+        }
+
+        seenStyle = style;
+        seenScript = script;
+
+        if (!isHtmlTagState(state)) {
+          seenAttribute=true;
+        }
+      }
+    }
+  }
+
+  class XmlAttributeValueEndHandler implements TokenHandler {
+    public void handleElement(Lexer lexer) {
+      if (seenAttribute) {
+        seenStyle = false;
+        seenScript = false;
+        seenAttribute = false;
+      }
+      seenContentType = false;
+    }
+  }
+
+  class XmlAttributeValueHandler implements TokenHandler {
+    public void handleElement(Lexer lexer) {
+      if (seenContentType) {
+        if(!seenScript || seenAttribute) {
+          return; // something invalid
+        }
+
+        @NonNls String mimeType = TreeUtil.getTokenText(lexer);
+        if (caseInsensitive) mimeType = mimeType.toLowerCase();
+        if (supportMimeType(mimeType)) {
+          scriptType = mimeType;
+        }
+        else {
+          seenScript = false;
+          seenTag = true;    // will be switched of on tag name in end
+        }
+      }
+    }
+  }
+
+  private boolean supportMimeType(String mimeType) {
+    return findScriptContentProvider(mimeType) != null;
+  }
+
+  @Nullable
+  protected IElementType getCurrentScriptElementType() {
+    HtmlScriptContentProvider scriptContentProvider = findScriptContentProvider(scriptType);
+    return scriptContentProvider == null ? null : scriptContentProvider.getScriptElementType();
+  }
+
+  @Nullable
+  protected static HtmlScriptContentProvider findScriptContentProvider(@Nullable String mimeType) {
+    if (StringUtil.isEmpty(mimeType)) {
+      return ourDefaultLanguage != null ? LanguageHtmlScriptContentProvider.getScriptContentProvider(ourDefaultLanguage) : null;
+    }
+    Collection<Language> instancesByMimeType = Language.findInstancesByMimeType(mimeType != null ? mimeType.trim() : null);
+    for (Language language : instancesByMimeType) {
+      HtmlScriptContentProvider scriptContentProvider = LanguageHtmlScriptContentProvider.getScriptContentProvider(language);
+      if (scriptContentProvider != null) {
+        return scriptContentProvider;
+      }
+    }
+    return null;
+  }
+
+  class XmlTagClosedHandler implements TokenHandler {
+    public void handleElement(Lexer lexer) {
+      if (seenAttribute) {
+        seenScript=false;
+        seenStyle=false;
+
+        seenAttribute=false;
+      } else {
+        if (seenStyle || seenScript) {
+          seenTag=true;
+        }
+      }
+    }
+  }
+
+  class XmlTagEndHandler implements TokenHandler {
+    public void handleElement(Lexer lexer) {
+      seenStyle=false;
+      seenScript=false;
+      seenAttribute=false;
+      seenContentType=false;
+      scriptType = null;
+    }
+  }
+
+  private final HashMap<IElementType,TokenHandler> tokenHandlers = new HashMap<IElementType, TokenHandler>();
+
+  protected BaseHtmlLexer(Lexer _baseLexer, boolean _caseInsensitive)  {
+    super(_baseLexer);
+    caseInsensitive = _caseInsensitive;
+
+    XmlNameHandler value = new XmlNameHandler();
+    tokenHandlers.put(XmlTokenType.XML_NAME,value);
+    tokenHandlers.put(XmlTokenType.XML_TAG_NAME,value);
+    tokenHandlers.put(XmlTokenType.XML_TAG_END,new XmlTagClosedHandler());
+    tokenHandlers.put(XmlTokenType.XML_END_TAG_START,new XmlTagEndHandler());
+    tokenHandlers.put(XmlTokenType.XML_EMPTY_ELEMENT_END,new XmlTagEndHandler());
+    tokenHandlers.put(XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER,new XmlAttributeValueEndHandler());
+    tokenHandlers.put(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN,new XmlAttributeValueHandler());
+  }
+
+  protected void registerHandler(IElementType elementType, TokenHandler value) {
+    final TokenHandler tokenHandler = tokenHandlers.get(elementType);
+
+    if (tokenHandler != null) {
+      final TokenHandler newHandler = value;
+      value = new TokenHandler() {
+        public void handleElement(final Lexer lexer) {
+          tokenHandler.handleElement(lexer);
+          newHandler.handleElement(lexer);
+        }
+      };
+    }
+
+    tokenHandlers.put(elementType,value);
+  }
+
+  public void start(final CharSequence buffer, final int startOffset, final int endOffset, final int initialState) {
+    initState(initialState);
+    super.start(buffer, startOffset, endOffset, initialState & BASE_STATE_MASK);
+  }
+
+  private void initState(final int initialState) {
+    seenScript = (initialState & SEEN_SCRIPT)!=0;
+    seenStyle = (initialState & SEEN_STYLE)!=0;
+    seenTag = (initialState & SEEN_TAG)!=0;
+    seenAttribute = (initialState & SEEN_ATTRIBUTE)!=0;
+    seenContentType = (initialState & SEEN_CONTENT_TYPE) != 0;
+    lexerOfCacheBufferSequence = null;
+    cachedBufferSequence = null;
+  }
+
+  protected int skipToTheEndOfTheEmbeddment() {
+    Lexer base = getDelegate();
+    int tokenEnd = base.getTokenEnd();
+    int lastState = 0;
+    int lastStart = 0;
+
+    final CharSequence buf = base.getBufferSequence();
+    final char[] bufArray = CharArrayUtil.fromSequenceWithoutCopying(buf);
+
+    if (seenTag) {
+      FoundEnd:
+      while(true) {
+        FoundEndOfTag:
+        while(base.getTokenType() != XmlTokenType.XML_END_TAG_START) {
+          if (base.getTokenType() == XmlTokenType.XML_COMMENT_CHARACTERS) {
+            // we should terminate on first occurence of </
+            final int end = base.getTokenEnd();
+
+            for(int i = base.getTokenStart(); i < end; ++i) {
+              if ((bufArray != null ? bufArray[i ]:buf.charAt(i)) == '<' &&
+                  i + 1 < end &&
+                  (bufArray != null ? bufArray[i+1]:buf.charAt(i+1)) == '/') {
+                tokenEnd = i;
+                lastStart = i - 1;
+                lastState = 0;
+
+                break FoundEndOfTag;
+              }
+            }
+          }
+
+          lastState = base.getState();
+          tokenEnd = base.getTokenEnd();
+          lastStart = base.getTokenStart();
+          if (tokenEnd == getBufferEnd()) break FoundEnd;
+          base.advance();
+        }
+
+        // check if next is script
+        if (base.getTokenType() != XmlTokenType.XML_END_TAG_START) { // we are inside comment
+          base.start(buf,lastStart+1,getBufferEnd(),lastState);
+          base.getTokenType();
+          base.advance();
+        } else {
+          base.advance();
+        }
+
+        while(XmlTokenType.WHITESPACES.contains(base.getTokenType())) {
+          base.advance();
+        }
+
+        if (base.getTokenType() == XmlTokenType.XML_NAME) {
+          String name = TreeUtil.getTokenText(base);
+          if (caseInsensitive) name = name.toLowerCase();
+
+          if((hasSeenScript() && XmlNameHandler.TOKEN_SCRIPT.equals(name)) ||
+             (hasSeenStyle() && XmlNameHandler.TOKEN_STYLE.equals(name)) ||
+             CompletionUtil.DUMMY_IDENTIFIER_TRIMMED.equalsIgnoreCase(name)) {
+            break; // really found end
+          }
+        }
+      }
+
+      base.start(buf,lastStart,getBufferEnd(),lastState);
+      base.getTokenType();
+    } else if (seenAttribute) {
+      while(true) {
+        if (!isValidAttributeValueTokenType(base.getTokenType())) break;
+
+        tokenEnd = base.getTokenEnd();
+        lastState = base.getState();
+        lastStart = base.getTokenStart();
+
+        if (tokenEnd == getBufferEnd()) break;
+        base.advance();
+      }
+
+      base.start(buf,lastStart,getBufferEnd(),lastState);
+      base.getTokenType();
+    }
+    return tokenEnd;
+  }
+
+  protected boolean isValidAttributeValueTokenType(final IElementType tokenType) {
+    return tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN ||
+           tokenType == XmlTokenType.XML_ENTITY_REF_TOKEN ||
+            tokenType == XmlTokenType.XML_CHAR_ENTITY_REF;
+  }
+
+  public void advance() {
+    super.advance();
+    IElementType type = getDelegate().getTokenType();
+    TokenHandler tokenHandler = tokenHandlers.get(type);
+    if (tokenHandler!=null) tokenHandler.handleElement(this);
+  }
+
+
+  public int getState() {
+    int state = super.getState();
+
+    state |= ((seenScript)?SEEN_SCRIPT:0);
+    state |= ((seenTag)?SEEN_TAG:0);
+    state |= ((seenStyle)?SEEN_STYLE:0);
+    state |= ((seenAttribute)?SEEN_ATTRIBUTE:0);
+    state |= ((seenContentType)?SEEN_CONTENT_TYPE:0);
+
+    return state;
+  }
+
+  protected final boolean hasSeenStyle() {
+    return seenStyle;
+  }
+
+  protected final boolean hasSeenAttribute() {
+    return seenAttribute;
+  }
+
+  protected final boolean hasSeenTag() {
+    return seenTag;
+  }
+
+  protected boolean hasSeenScript() {
+    return seenScript;
+  }
+
+  protected abstract boolean isHtmlTagState(int state);
+}
diff --git a/xml/impl/src/com/intellij/lexer/DtdLexer.java b/xml/impl/src/com/intellij/lexer/DtdLexer.java
new file mode 100644
index 0000000..e7f14f0
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/DtdLexer.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lexer;
+
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.xml.XmlTokenType;
+
+/**
+ * @author ik
+ */
+public class DtdLexer extends MergingLexerAdapter {
+  private final static TokenSet TOKENS_TO_MERGE =
+    TokenSet.create(XmlTokenType.XML_DATA_CHARACTERS, XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN, XmlTokenType.XML_PI_TARGET);
+
+  public DtdLexer(boolean highlightingMode) {
+    super(new FlexAdapter(new _DtdLexer(highlightingMode)), TOKENS_TO_MERGE);
+  }
+}
diff --git a/xml/impl/src/com/intellij/lexer/HtmlEmbeddedTokenTypesProvider.java b/xml/impl/src/com/intellij/lexer/HtmlEmbeddedTokenTypesProvider.java
new file mode 100644
index 0000000..60a8d03
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/HtmlEmbeddedTokenTypesProvider.java
@@ -0,0 +1,17 @@
+package com.intellij.lexer;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.psi.tree.IElementType;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public interface HtmlEmbeddedTokenTypesProvider {
+
+  ExtensionPointName<HtmlEmbeddedTokenTypesProvider> EXTENSION_POINT_NAME = ExtensionPointName.create("com.intellij.html.embeddedTokenTypesProvider");
+
+  /** style or script */
+  String getName();
+  IElementType getElementType();
+  IElementType getInlineElementType();
+}
diff --git a/xml/impl/src/com/intellij/lexer/HtmlHighlightingLexer.java b/xml/impl/src/com/intellij/lexer/HtmlHighlightingLexer.java
new file mode 100644
index 0000000..17d95dd
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/HtmlHighlightingLexer.java
@@ -0,0 +1,232 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lexer;
+
+import com.intellij.lang.HtmlInlineScriptTokenTypesProvider;
+import com.intellij.lang.HtmlScriptContentProvider;
+import com.intellij.lang.Language;
+import com.intellij.lang.LanguageHtmlInlineScriptTokenTypesProvider;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.FileTypeManager;
+import com.intellij.openapi.fileTypes.SyntaxHighlighter;
+import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlTokenType;
+import org.jetbrains.annotations.Nullable;
+
+public class HtmlHighlightingLexer extends BaseHtmlLexer {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.lexer.HtmlHighlightingLexer");
+
+  private static final int EMBEDDED_LEXER_ON = 0x1 << BASE_STATE_SHIFT;
+  private static final int EMBEDDED_LEXER_STATE_SHIFT = BASE_STATE_SHIFT + 1;
+
+  private Lexer embeddedLexer;
+  private Lexer styleLexer;
+  private Lexer scriptLexer;
+  protected Lexer elLexer;
+  private boolean hasNoEmbeddments;
+  private final static FileType ourStyleFileType = FileTypeManager.getInstance().getStdFileType("CSS");
+  private static FileType ourInlineScriptFileType = null;
+
+  static {
+    // At the moment only JS.
+    HtmlInlineScriptTokenTypesProvider provider =
+      LanguageHtmlInlineScriptTokenTypesProvider.getInlineScriptProvider(Language.findLanguageByID("JavaScript"));
+    ourInlineScriptFileType = provider != null ? provider.getFileType() : null;
+  }
+
+  public class XmlEmbeddmentHandler implements TokenHandler {
+    public void handleElement(Lexer lexer) {
+      if (!hasSeenStyle() && !hasSeenScript() || hasNoEmbeddments) return;
+      final IElementType tokenType = lexer.getTokenType();
+
+      if ((tokenType==XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN && hasSeenAttribute()) ||
+          (tokenType==XmlTokenType.XML_DATA_CHARACTERS && hasSeenTag()) ||
+          tokenType==XmlTokenType.XML_COMMENT_CHARACTERS && hasSeenTag()
+          ) {
+        setEmbeddedLexer();
+
+        if (embeddedLexer!=null) {
+          embeddedLexer.start(
+            getBufferSequence(),
+            HtmlHighlightingLexer.super.getTokenStart(),
+            skipToTheEndOfTheEmbeddment(),
+            embeddedLexer instanceof EmbedmentLexer ? ((EmbedmentLexer)embeddedLexer).getEmbeddedInitialState(tokenType) : 0
+          );
+
+          if (embeddedLexer.getTokenType() == null) {
+            // no content for embeddment
+            embeddedLexer = null;
+          }
+        }
+      }
+    }
+  }
+
+  public class ElEmbeddmentHandler implements TokenHandler {
+    public void handleElement(Lexer lexer) {
+      setEmbeddedLexer();
+      if (embeddedLexer != null) {
+        embeddedLexer.start(getBufferSequence(), HtmlHighlightingLexer.super.getTokenStart(), HtmlHighlightingLexer.super.getTokenEnd());
+      }
+    }
+  }
+
+  public HtmlHighlightingLexer() {
+    this(new MergingLexerAdapter(new FlexAdapter(new _HtmlLexer()),TOKENS_TO_MERGE),true);
+  }
+
+  protected HtmlHighlightingLexer(Lexer lexer, boolean caseInsensitive) {
+    super(lexer,caseInsensitive);
+
+    XmlEmbeddmentHandler value = new XmlEmbeddmentHandler();
+    registerHandler(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN,value);
+    registerHandler(XmlTokenType.XML_DATA_CHARACTERS,value);
+    registerHandler(XmlTokenType.XML_COMMENT_CHARACTERS,value);
+  }
+
+  public void start(CharSequence buffer, int startOffset, int endOffset, int initialState) {
+    super.start(buffer, startOffset, endOffset, initialState);
+
+    if ((initialState & EMBEDDED_LEXER_ON)!=0) {
+      int state = initialState >> EMBEDDED_LEXER_STATE_SHIFT;
+      setEmbeddedLexer();
+      LOG.assertTrue(embeddedLexer!=null);
+      embeddedLexer.start(buffer,startOffset,skipToTheEndOfTheEmbeddment(),state);
+    } else {
+      embeddedLexer = null;
+    }
+  }
+
+  private void setEmbeddedLexer() {
+    Lexer newLexer = null;
+    if (hasSeenStyle()) {
+      if (styleLexer==null) {
+        styleLexer = (ourStyleFileType!=null)? SyntaxHighlighterFactory.getSyntaxHighlighter(ourStyleFileType, null, null).getHighlightingLexer():null;
+      }
+
+      newLexer = styleLexer;
+    } else if (hasSeenScript()) {
+      if (scriptLexer == null) {
+        if (hasSeenTag()) {
+          HtmlScriptContentProvider provider = findScriptContentProvider(scriptType);
+          scriptLexer = provider != null ? provider.getHighlightingLexer() : null;
+        }
+        else if (hasSeenAttribute()) {
+          SyntaxHighlighter syntaxHighlighter =
+            (ourInlineScriptFileType != null) ? SyntaxHighlighterFactory.getSyntaxHighlighter(ourInlineScriptFileType, null, null) : null;
+          scriptLexer = syntaxHighlighter != null ? syntaxHighlighter.getHighlightingLexer() : null;
+        }
+      }
+      newLexer = scriptLexer;
+    }
+    else {
+      newLexer = createELLexer(newLexer);
+    }
+
+    if (newLexer!=null) {
+      embeddedLexer = newLexer;
+    }
+  }
+
+  @Nullable
+  protected Lexer createELLexer(Lexer newLexer) {
+    return newLexer;
+  }
+
+  public void advance() {
+    if (embeddedLexer!=null) {
+      embeddedLexer.advance();
+      if (embeddedLexer.getTokenType()==null) {
+        embeddedLexer=null;
+      }
+    }
+
+    if (embeddedLexer==null) {
+      super.advance();
+    }
+  }
+
+  public IElementType getTokenType() {
+    if (embeddedLexer!=null) {
+      return embeddedLexer.getTokenType();
+    } else {
+      IElementType tokenType = super.getTokenType();
+
+      // TODO: fix no DOCTYPE highlighting
+      if (tokenType == null) return tokenType;
+
+      if (tokenType==XmlTokenType.XML_NAME) {
+        // we need to convert single xml_name for tag name and attribute name into to separate
+        // lex types for the highlighting!
+        final int state = getState() & BASE_STATE_MASK;
+
+        if (isHtmlTagState(state)) {
+          tokenType = XmlTokenType.XML_TAG_NAME;
+        }
+      }
+      else if (tokenType == XmlTokenType.XML_WHITE_SPACE || tokenType == XmlTokenType.XML_REAL_WHITE_SPACE) {
+        if (hasSeenTag() && (hasSeenStyle() || hasSeenScript())) {
+          tokenType = XmlTokenType.XML_WHITE_SPACE;
+        } else {
+          tokenType = (getState()!=0)?XmlTokenType.TAG_WHITE_SPACE:XmlTokenType.XML_REAL_WHITE_SPACE;
+        }
+      } else if (tokenType == XmlTokenType.XML_CHAR_ENTITY_REF ||
+               tokenType == XmlTokenType.XML_ENTITY_REF_TOKEN
+              ) {
+        // we need to convert char entity ref & entity ref in comments as comment chars
+        final int state = getState() & BASE_STATE_MASK;
+        if (state == _HtmlLexer.COMMENT) return XmlTokenType.XML_COMMENT_CHARACTERS;
+      }
+      return tokenType;
+    }
+  }
+
+  public int getTokenStart() {
+    if (embeddedLexer!=null) {
+      return embeddedLexer.getTokenStart();
+    } else {
+      return super.getTokenStart();
+    }
+  }
+
+  public int getTokenEnd() {
+    if (embeddedLexer!=null) {
+      return embeddedLexer.getTokenEnd();
+    } else {
+      return super.getTokenEnd();
+    }
+  }
+
+  public int getState() {
+    int state = super.getState();
+
+    state |= ((embeddedLexer!=null)?EMBEDDED_LEXER_ON:0);
+    if (embeddedLexer!=null) state |= (embeddedLexer.getState() << EMBEDDED_LEXER_STATE_SHIFT);
+
+    return state;
+  }
+
+  protected boolean isHtmlTagState(int state) {
+    return state == _HtmlLexer.START_TAG_NAME || state == _HtmlLexer.END_TAG_NAME ||
+           state  == _HtmlLexer.START_TAG_NAME2 || state == _HtmlLexer.END_TAG_NAME2;
+  }
+
+  public void setHasNoEmbeddments(boolean hasNoEmbeddments) {
+    this.hasNoEmbeddments = hasNoEmbeddments;
+  }
+}
diff --git a/xml/impl/src/com/intellij/lexer/HtmlLexer.java b/xml/impl/src/com/intellij/lexer/HtmlLexer.java
new file mode 100644
index 0000000..90b0e9a
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/HtmlLexer.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lexer;
+
+import com.intellij.lang.HtmlInlineScriptTokenTypesProvider;
+import com.intellij.lang.Language;
+import com.intellij.lang.LanguageHtmlInlineScriptTokenTypesProvider;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.psi.TokenType;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlTokenType;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class HtmlLexer extends BaseHtmlLexer {
+  private static IElementType ourStyleElementType;
+  private static IElementType ourInlineStyleElementType;
+  private static IElementType ourInlineScriptElementType;
+
+  static {
+    HtmlEmbeddedTokenTypesProvider[] extensions = Extensions.getExtensions(HtmlEmbeddedTokenTypesProvider.EXTENSION_POINT_NAME);
+    for (HtmlEmbeddedTokenTypesProvider extension : extensions) {
+      if ("style".equals(extension.getName())) {
+        ourStyleElementType = extension.getElementType();
+        ourInlineStyleElementType = extension.getInlineElementType();
+      }
+    }
+    // At the moment only JS.
+    HtmlInlineScriptTokenTypesProvider provider =
+      LanguageHtmlInlineScriptTokenTypesProvider.getInlineScriptProvider(ourDefaultLanguage);
+    ourInlineScriptElementType = provider != null ? provider.getElementType() : null;
+  }
+
+  private IElementType myTokenType;
+  private int myTokenStart;
+  private int myTokenEnd;
+
+  @Override
+  public void start(CharSequence buffer, int startOffset, int endOffset, int initialState) {
+    myTokenType = null;
+    super.start(buffer, startOffset, endOffset, initialState);
+  }
+
+  public void advance() {
+    myTokenType = null;
+    super.advance();
+  }
+
+  public IElementType getTokenType() {
+    if (myTokenType!=null) return myTokenType;
+    IElementType tokenType = super.getTokenType();
+
+    myTokenStart = super.getTokenStart();
+    myTokenEnd = super.getTokenEnd();
+
+    if (hasSeenStyle()) {
+      if (hasSeenTag() && ourStyleElementType!=null && isStartOfEmbeddmentTagContent(tokenType)) {
+        myTokenEnd = skipToTheEndOfTheEmbeddment();
+        tokenType = ourStyleElementType;
+      } else if (ourInlineStyleElementType!=null && isStartOfEmbeddmentAttributeValue(tokenType) && hasSeenAttribute()) {
+        tokenType = ourInlineStyleElementType;
+      }
+    } else if (hasSeenScript()) {
+      IElementType currentScriptElementType = getCurrentScriptElementType();
+      if (hasSeenTag() && currentScriptElementType != null && isStartOfEmbeddmentTagContent(tokenType)) {
+        myTokenEnd = skipToTheEndOfTheEmbeddment();
+        tokenType = currentScriptElementType;
+      } else if (hasSeenAttribute() && isStartOfEmbeddmentAttributeValue(tokenType) && ourInlineScriptElementType!=null) {
+        myTokenEnd = skipToTheEndOfTheEmbeddment();
+        tokenType = ourInlineScriptElementType;
+      }
+    }
+
+    return myTokenType = tokenType;
+  }
+
+  private static boolean isStartOfEmbeddmentAttributeValue(final IElementType tokenType) {
+    return tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;
+  }
+
+  private static boolean isStartOfEmbeddmentTagContent(final IElementType tokenType) {
+    return (tokenType == XmlTokenType.XML_DATA_CHARACTERS ||
+            tokenType == XmlTokenType.XML_CDATA_START ||
+            tokenType == XmlTokenType.XML_COMMENT_START ||
+            tokenType == XmlTokenType.XML_REAL_WHITE_SPACE || tokenType == TokenType.WHITE_SPACE
+    );
+  }
+
+  public HtmlLexer() {
+    this(new MergingLexerAdapter(new FlexAdapter(new _HtmlLexer()), TOKENS_TO_MERGE),true);
+  }
+
+  protected HtmlLexer(Lexer _baseLexer, boolean _caseInsensitive) {
+    super(_baseLexer,_caseInsensitive);
+  }
+
+  protected boolean isHtmlTagState(int state) {
+    return state == _HtmlLexer.START_TAG_NAME || state == _HtmlLexer.END_TAG_NAME;
+  }
+
+  public int getTokenStart() {
+    if (myTokenType!=null) {
+      return myTokenStart;
+    }
+    return super.getTokenStart();
+  }
+
+  public int getTokenEnd() {
+    if (myTokenType!=null) {
+      return myTokenEnd;
+    }
+    return super.getTokenEnd();
+  }
+}
diff --git a/xml/impl/src/com/intellij/lexer/XHtmlHighlightingLexer.java b/xml/impl/src/com/intellij/lexer/XHtmlHighlightingLexer.java
new file mode 100644
index 0000000..5f89e20
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/XHtmlHighlightingLexer.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lexer;
+
+public class XHtmlHighlightingLexer extends HtmlHighlightingLexer {
+  public XHtmlHighlightingLexer() {
+    this(new XmlLexer(true));
+  }
+
+  public XHtmlHighlightingLexer(Lexer baseLexer) {
+    super(baseLexer,false);
+  }
+
+  protected boolean isHtmlTagState(int state) {
+    return state == __XmlLexer.TAG || state == __XmlLexer.END_TAG;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/lexer/XHtmlLexer.java b/xml/impl/src/com/intellij/lexer/XHtmlLexer.java
new file mode 100644
index 0000000..784198c
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/XHtmlLexer.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lexer;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class XHtmlLexer extends HtmlLexer {
+  public XHtmlLexer(Lexer baseLexer) {
+    super(baseLexer, false);
+  }
+
+  public XHtmlLexer() {
+    this(new XmlLexer(true));
+  }
+
+  protected boolean isHtmlTagState(int state) {
+    return state == __XmlLexer.TAG || state == __XmlLexer.END_TAG;
+  }
+}
diff --git a/xml/impl/src/com/intellij/lexer/XmlHighlightingLexer.java b/xml/impl/src/com/intellij/lexer/XmlHighlightingLexer.java
new file mode 100644
index 0000000..e485774
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/XmlHighlightingLexer.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lexer;
+
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlTokenType;
+
+/**
+ * @author mike
+ */
+public class XmlHighlightingLexer extends DelegateLexer {
+  public XmlHighlightingLexer() {
+    super(new XmlLexer());
+  }
+
+  public IElementType getTokenType() {
+    IElementType tokenType = getDelegate().getTokenType();
+
+    if (tokenType == null) return tokenType;
+
+    int state = getState() & 0xF;
+
+    tokenType = fixWrongTokenTypes(tokenType, state);
+    if (tokenType != XmlTokenType.XML_COMMENT_CHARACTERS &&
+      tokenType != XmlTokenType.XML_COMMENT_END &&
+      tokenType != XmlTokenType.XML_COMMENT_START &&
+      tokenType != XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER) {
+
+      // TODO: do not know when this happens!
+      switch (state) {
+        case __XmlLexer.DOCTYPE:
+          tokenType = XmlTokenType.XML_DECL_START;
+          break;
+      }
+    }
+
+    return tokenType;
+  }
+
+  static IElementType fixWrongTokenTypes(IElementType tokenType, final int state) {
+    if (tokenType == XmlTokenType.XML_NAME) {
+      if (state == __XmlLexer.TAG || state == __XmlLexer.END_TAG) {
+        // translate XML names for tags into XmlTagName
+        tokenType = XmlTokenType.XML_TAG_NAME;
+      }
+    } else if (tokenType == XmlTokenType.XML_WHITE_SPACE) {
+      switch (state) {
+        case __XmlLexer.ATTR_LIST:
+        case __XmlLexer.ATTR:
+          tokenType = XmlTokenType.TAG_WHITE_SPACE; break;
+        default:
+          tokenType = XmlTokenType.XML_REAL_WHITE_SPACE; break;
+      }
+    } else if (tokenType == XmlTokenType.XML_CHAR_ENTITY_REF ||
+               tokenType == XmlTokenType.XML_ENTITY_REF_TOKEN
+              ) {
+      if (state == __XmlLexer.COMMENT) return XmlTokenType.XML_COMMENT_CHARACTERS;
+    }
+    return tokenType;
+  }
+}
diff --git a/xml/impl/src/com/intellij/lexer/XmlLexer.java b/xml/impl/src/com/intellij/lexer/XmlLexer.java
new file mode 100644
index 0000000..c215e77
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/XmlLexer.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lexer;
+
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.xml.XmlTokenType;
+
+import java.io.Reader;
+
+public class XmlLexer extends MergingLexerAdapter {
+  private final static TokenSet TOKENS_TO_MERGE = TokenSet.create(XmlTokenType.XML_DATA_CHARACTERS,
+                                                                  XmlTokenType.XML_TAG_CHARACTERS,
+                                                                  XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN,
+                                                                  XmlTokenType.XML_PI_TARGET,
+                                                                  XmlTokenType.XML_COMMENT_CHARACTERS);
+
+  public XmlLexer() {
+    this(false);
+  }
+
+  public XmlLexer(final boolean conditionalCommentsSupport) {
+    this(new _XmlLexer(new __XmlLexer((Reader)null), conditionalCommentsSupport));
+  }
+
+  public XmlLexer(Lexer baseLexer) {
+    super(baseLexer, TOKENS_TO_MERGE);
+  }
+}
diff --git a/xml/impl/src/com/intellij/lexer/_DtdLexer.flex b/xml/impl/src/com/intellij/lexer/_DtdLexer.flex
new file mode 100644
index 0000000..0869996
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/_DtdLexer.flex
@@ -0,0 +1,167 @@
+ /* It's an automatically generated code. Do not modify it. */
+package com.intellij.lexer;
+
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.*;
+import com.intellij.psi.xml.*;
+
+%%
+
+%{
+   private boolean isHighlightModeOn = false;
+
+   public _DtdLexer(boolean highlightModeOn) {
+     this((java.io.Reader)null);
+     isHighlightModeOn = highlightModeOn;
+   }
+%}
+
+%unicode
+%class _DtdLexer
+%public
+%implements FlexLexer
+%function advance
+%type IElementType
+%eof{  return;
+%eof}
+
+%state DECL
+%state DECL_ATTR
+%state DECL_ATTR_VALUE_DQ
+%state DECL_ATTR_VALUE_SQ
+%state TAG_NAME
+%state TAG_ATTRIBUTES
+%state COMMENT
+%state ATTRIBUTE_VALUE_START
+%state ATTRIBUTE_VALUE_DQ
+%state ATTRIBUTE_VALUE_SQ
+%state PROCESSING_INSTRUCTION
+%state DOCTYPE_MARKUP_STARTED
+
+%state DOCTYPE
+%state DOCTYPE_EXTERNAL_ID
+%state DOCTYPE_MARKUP
+%state DOCTYPE_MARKUP_DQ
+%state DOCTYPE_MARKUP_SQ
+%state CDATA
+%state CONDITIONAL
+%state DOCTYPE_COMMENT
+
+ALPHA=[:letter:]
+DIGIT=[0-9]
+WS=[\ \n\r\t\f]
+S={WS}+
+
+TAG_NAME=({ALPHA}|"_"|":")({ALPHA}|{DIGIT}|"_"|":"|"."|"-")*
+NAME=({ALPHA}|"_"|":")({ALPHA}|{DIGIT}|"_"|":"|"."|"-")*
+NMTOKEN=({ALPHA}|{DIGIT}|"_"|":"|"."|"-")+
+
+%%
+"<![CDATA[" {yybegin(CDATA); return XmlTokenType.XML_CDATA_START; }
+<CDATA> "]]>"  {yybegin(YYINITIAL); return XmlTokenType.XML_CDATA_END; }
+<CDATA> [^] {return XmlTokenType.XML_DATA_CHARACTERS; }
+<CDATA> "<!--" { return XmlTokenType.XML_DATA_CHARACTERS; }
+
+"<![" {yybegin(CONDITIONAL); return XmlTokenType.XML_CONDITIONAL_SECTION_START; }
+
+<CONDITIONAL> "INCLUDE" { return XmlTokenType.XML_CONDITIONAL_INCLUDE; }
+<CONDITIONAL> "IGNORE" { return XmlTokenType.XML_CONDITIONAL_IGNORE; }
+"]]>" { yybegin(YYINITIAL); return XmlTokenType.XML_CONDITIONAL_SECTION_END; }
+
+"&"{NAME}";" { return XmlTokenType.XML_ENTITY_REF_TOKEN; }
+"%"{NAME}";" { return XmlTokenType.XML_ENTITY_REF_TOKEN; }
+
+"&#"{DIGIT}+";" { return XmlTokenType.XML_CHAR_ENTITY_REF; }
+"&#x"({DIGIT}|[a-fA-F])+";" { return XmlTokenType.XML_CHAR_ENTITY_REF; }
+
+<YYINITIAL> "<?xml " { yybegin(DECL); return XmlTokenType.XML_DECL_START; }
+
+<DECL> {NAME} { yybegin(DECL_ATTR); return XmlTokenType.XML_NAME; }
+<DECL_ATTR> "=" { return XmlTokenType.XML_EQ;}
+<DECL_ATTR> "'" { yybegin(DECL_ATTR_VALUE_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;}
+<DECL_ATTR> "\"" { yybegin(DECL_ATTR_VALUE_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;}
+<DECL_ATTR_VALUE_DQ> [^\"]* { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;}
+<DECL_ATTR_VALUE_SQ> [^']* { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;}
+<DECL_ATTR_VALUE_DQ> "\"" { yybegin(DECL); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER;}
+<DECL_ATTR_VALUE_SQ> "'" { yybegin(DECL); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER;}
+<DECL> "?>" { yybegin(YYINITIAL); return XmlTokenType.XML_DECL_END;}
+<DECL> ">" { yybegin(YYINITIAL); return XmlTokenType.XML_BAD_CHARACTER;}
+
+<YYINITIAL> "<!DOCTYPE" { yybegin(DOCTYPE); return XmlTokenType.XML_DOCTYPE_START; }
+<DOCTYPE> "SYSTEM" { yybegin(DOCTYPE_EXTERNAL_ID); return XmlTokenType.XML_DOCTYPE_SYSTEM; }
+<DOCTYPE> "PUBLIC" { yybegin(DOCTYPE_EXTERNAL_ID); return XmlTokenType.XML_DOCTYPE_PUBLIC; }
+<DOCTYPE> {NAME} { return XmlTokenType.XML_NAME; }
+<DOCTYPE_EXTERNAL_ID> "\""[^\"]*"\"" { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;}
+<DOCTYPE_EXTERNAL_ID> "'"[^']*"'" { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;}
+<DOCTYPE, DOCTYPE_EXTERNAL_ID,CONDITIONAL> "[" { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_MARKUP_START;}
+<DOCTYPE_MARKUP, YYINITIAL> "<!ELEMENT" { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_ELEMENT_DECL_START;}
+<DOCTYPE_MARKUP, YYINITIAL> "<!NOTATION" { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_NOTATION_DECL_START;}
+<DOCTYPE_MARKUP, YYINITIAL> "<!ATTLIST" { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_ATTLIST_DECL_START;}
+<DOCTYPE_MARKUP, YYINITIAL> "<!ENTITY" { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_ENTITY_DECL_START;}
+<DOCTYPE_MARKUP> "SYSTEM" { return XmlTokenType.XML_DOCTYPE_SYSTEM; }
+<DOCTYPE_MARKUP> "PUBLIC" { return XmlTokenType.XML_DOCTYPE_PUBLIC; }
+<DOCTYPE_MARKUP> "#PCDATA" { return XmlTokenType.XML_PCDATA;}
+<DOCTYPE_MARKUP> "EMPTY" { return XmlTokenType.XML_CONTENT_EMPTY;}
+<DOCTYPE_MARKUP> "ANY" { return XmlTokenType.XML_CONTENT_ANY;}
+<DOCTYPE_MARKUP> "(" { return XmlTokenType.XML_LEFT_PAREN;}
+<DOCTYPE_MARKUP> ")" { return XmlTokenType.XML_RIGHT_PAREN;}
+<DOCTYPE_MARKUP> "?" { return XmlTokenType.XML_QUESTION;}
+<DOCTYPE_MARKUP> "+" { return XmlTokenType.XML_PLUS;}
+<DOCTYPE_MARKUP> "*" { return XmlTokenType.XML_STAR;}
+<DOCTYPE_MARKUP> "%" { return XmlTokenType.XML_PERCENT;}
+<DOCTYPE_MARKUP> "--" ([^\-]|(\-[^\-]))* "--" { yybegin(DOCTYPE_MARKUP_STARTED); yypushback(yylength()); }
+<DOCTYPE_MARKUP_STARTED> "--" { yybegin(DOCTYPE_COMMENT); return XmlTokenType.XML_COMMENT_START;}
+<DOCTYPE_COMMENT> ([^\-]|(\-[^\-]))* { return XmlTokenType.XML_COMMENT_CHARACTERS; }
+<DOCTYPE_COMMENT> "--" { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_COMMENT_END;}
+<DOCTYPE_MARKUP> \| { return XmlTokenType.XML_BAR;}
+<DOCTYPE_MARKUP> "," { return XmlTokenType.XML_COMMA;}
+<DOCTYPE_MARKUP> "&" { return XmlTokenType.XML_AMP;}
+<DOCTYPE_MARKUP> ";" { return XmlTokenType.XML_SEMI;}
+<DOCTYPE_MARKUP> "#IMPLIED" { return XmlTokenType.XML_ATT_IMPLIED;}
+<DOCTYPE_MARKUP> "#REQUIRED" { return XmlTokenType.XML_ATT_REQUIRED;}
+<DOCTYPE_MARKUP> "#FIXED" { return XmlTokenType.XML_ATT_FIXED;}
+<DOCTYPE_MARKUP> {NMTOKEN} { return XmlTokenType.XML_NAME;}
+<DOCTYPE_MARKUP> ">" { return XmlTokenType.XML_TAG_END;}
+<DOCTYPE_MARKUP> "]" { yybegin(DOCTYPE); return XmlTokenType.XML_MARKUP_END;}
+<DOCTYPE_MARKUP> "\"" { yybegin(DOCTYPE_MARKUP_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; }
+<DOCTYPE_MARKUP> "'" { yybegin(DOCTYPE_MARKUP_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; }
+<DOCTYPE_MARKUP_DQ> "\"" { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER; }
+<DOCTYPE_MARKUP_SQ> "'" { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER; }
+<DOCTYPE_MARKUP_DQ> [^\"]+ { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN; }
+<DOCTYPE_MARKUP_SQ> [^']+ { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN; }
+<DOCTYPE,DOCTYPE_EXTERNAL_ID> ">" { yybegin(YYINITIAL); return XmlTokenType.XML_DOCTYPE_END; }
+
+<YYINITIAL> "<?" { yybegin(PROCESSING_INSTRUCTION); return XmlTokenType.XML_PI_START; }
+<PROCESSING_INSTRUCTION> "?>" { yybegin(YYINITIAL); return XmlTokenType.XML_PI_END; }
+<PROCESSING_INSTRUCTION> [^] { return XmlTokenType.XML_PI_TARGET; }
+
+<YYINITIAL,TAG_NAME,TAG_ATTRIBUTES,ATTRIBUTE_VALUE_START,ATTRIBUTE_VALUE_DQ,ATTRIBUTE_VALUE_SQ>"<" { yybegin(TAG_NAME); return XmlTokenType.XML_START_TAG_START; }
+<YYINITIAL,TAG_NAME,TAG_ATTRIBUTES,ATTRIBUTE_VALUE_START,ATTRIBUTE_VALUE_DQ,ATTRIBUTE_VALUE_SQ>"</" { yybegin(TAG_NAME); return XmlTokenType.XML_END_TAG_START; }
+
+
+<TAG_NAME> {TAG_NAME} { yybegin(TAG_ATTRIBUTES); return isHighlightModeOn ? XmlTokenType.XML_TAG_NAME:XmlTokenType.XML_NAME; }
+
+<TAG_ATTRIBUTES> ">" { yybegin(YYINITIAL); return XmlTokenType.XML_TAG_END; }
+<TAG_ATTRIBUTES> "/>" { yybegin(YYINITIAL); return XmlTokenType.XML_EMPTY_ELEMENT_END; }
+<TAG_ATTRIBUTES> {NAME} { return XmlTokenType.XML_NAME; }
+<TAG_ATTRIBUTES> "=" { yybegin(ATTRIBUTE_VALUE_START); return XmlTokenType.XML_EQ; }
+
+<ATTRIBUTE_VALUE_START> ">" { yybegin(YYINITIAL); return XmlTokenType.XML_TAG_END; }
+<ATTRIBUTE_VALUE_START> "/>" { yybegin(YYINITIAL); return XmlTokenType.XML_EMPTY_ELEMENT_END; }
+<ATTRIBUTE_VALUE_START> "\"" { yybegin(ATTRIBUTE_VALUE_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; }
+<ATTRIBUTE_VALUE_START> "'" { yybegin(ATTRIBUTE_VALUE_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; }
+<ATTRIBUTE_VALUE_DQ> "\"" { yybegin(TAG_ATTRIBUTES); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER; }
+<ATTRIBUTE_VALUE_SQ> "'" { yybegin(TAG_ATTRIBUTES); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER; }
+<ATTRIBUTE_VALUE_DQ> [^\"] { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN; }
+<ATTRIBUTE_VALUE_SQ> [^'] { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN; }
+
+"<!--" { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_START; }
+<COMMENT> "-->" { yybegin(YYINITIAL); return XmlTokenType.XML_COMMENT_END; }
+<COMMENT> ([^\-]|(-[^\-]))* { return XmlTokenType.XML_COMMENT_CHARACTERS; }
+
+<YYINITIAL,DECL,DECL_ATTR,TAG_NAME,TAG_ATTRIBUTES,COMMENT,ATTRIBUTE_VALUE_START,
+ DOCTYPE,DOCTYPE_EXTERNAL_ID,DOCTYPE_MARKUP,CONDITIONAL>{S} { return XmlTokenType.XML_WHITE_SPACE; }
+
+<YYINITIAL> [^<&] { return XmlTokenType.XML_DATA_CHARACTERS; }
+
+[^] { return XmlTokenType.XML_BAD_CHARACTER; }
diff --git a/xml/impl/src/com/intellij/lexer/_DtdLexer.java b/xml/impl/src/com/intellij/lexer/_DtdLexer.java
new file mode 100644
index 0000000..a9308ed
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/_DtdLexer.java
@@ -0,0 +1,1143 @@
+/* The following code was generated by JFlex 1.4.3 on 7/31/12 2:32 PM */
+
+ /* It's an automatically generated code. Do not modify it. */
+package com.intellij.lexer;
+
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.*;
+import com.intellij.psi.xml.*;
+
+
+/**
+ * This class is a scanner generated by 
+ * <a href="http://www.jflex.de/">JFlex</a> 1.4.3
+ * on 7/31/12 2:32 PM from the specification file
+ * <tt>C:/Idea.Sources/Trunk/tools/lexer/../../community/xml/impl/src/com/intellij/lexer/_DtdLexer.flex</tt>
+ */
+public class _DtdLexer implements FlexLexer {
+  /** initial size of the lookahead buffer */
+  private static final int ZZ_BUFFERSIZE = 16384;
+
+  /** lexical states */
+  public static final int PROCESSING_INSTRUCTION = 22;
+  public static final int DECL_ATTR_VALUE_DQ = 6;
+  public static final int DECL_ATTR = 4;
+  public static final int ATTRIBUTE_VALUE_START = 16;
+  public static final int DECL_ATTR_VALUE_SQ = 8;
+  public static final int ATTRIBUTE_VALUE_DQ = 18;
+  public static final int CONDITIONAL = 38;
+  public static final int DECL = 2;
+  public static final int DOCTYPE_MARKUP_STARTED = 24;
+  public static final int ATTRIBUTE_VALUE_SQ = 20;
+  public static final int DOCTYPE_EXTERNAL_ID = 28;
+  public static final int CDATA = 36;
+  public static final int COMMENT = 14;
+  public static final int TAG_NAME = 10;
+  public static final int DOCTYPE_MARKUP = 30;
+  public static final int DOCTYPE_COMMENT = 40;
+  public static final int DOCTYPE_MARKUP_DQ = 32;
+  public static final int YYINITIAL = 0;
+  public static final int TAG_ATTRIBUTES = 12;
+  public static final int DOCTYPE_MARKUP_SQ = 34;
+  public static final int DOCTYPE = 26;
+
+  /**
+   * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
+   * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l
+   *                  at the beginning of a line
+   * l is of the form l = 2*k, k a non negative integer
+   */
+  private static final int ZZ_LEXSTATE[] = { 
+     0,  0,  1,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,  7,  7, 
+     8,  8,  9,  9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 
+    16, 16, 17, 17, 18, 18, 19, 19, 20, 20
+  };
+
+  /** 
+   * Translates characters to character classes
+   */
+  private static final String ZZ_CMAP_PACKED = 
+    "\11\0\2\3\1\0\2\3\22\0\1\40\1\7\1\43\1\32\1\0"+
+    "\1\31\1\27\1\42\1\51\1\52\1\54\1\53\1\56\1\5\1\4"+
+    "\1\62\12\2\1\1\1\30\1\6\1\41\1\16\1\35\1\0\1\13"+
+    "\1\50\1\11\1\12\1\23\1\60\1\24\1\1\1\17\2\1\1\21"+
+    "\1\47\1\20\1\25\1\45\1\57\1\26\1\46\1\14\1\22\2\1"+
+    "\1\61\1\44\1\1\1\10\1\0\1\15\1\0\1\1\1\0\6\34"+
+    "\5\1\1\37\1\36\12\1\1\33\2\1\1\0\1\55\55\0\1\1"+
+    "\12\0\1\1\4\0\1\1\5\0\27\1\1\0\37\1\1\0\u01ca\1"+
+    "\4\0\14\1\16\0\5\1\7\0\1\1\1\0\1\1\201\0\5\1"+
+    "\1\0\2\1\2\0\4\1\10\0\1\1\1\0\3\1\1\0\1\1"+
+    "\1\0\24\1\1\0\123\1\1\0\213\1\10\0\236\1\11\0\46\1"+
+    "\2\0\1\1\7\0\47\1\110\0\33\1\5\0\3\1\55\0\53\1"+
+    "\43\0\2\1\1\0\143\1\1\0\1\1\17\0\2\1\7\0\2\1"+
+    "\12\0\3\1\2\0\1\1\20\0\1\1\1\0\36\1\35\0\131\1"+
+    "\13\0\1\1\30\0\41\1\11\0\2\1\4\0\1\1\5\0\26\1"+
+    "\4\0\1\1\11\0\1\1\3\0\1\1\27\0\31\1\253\0\66\1"+
+    "\3\0\1\1\22\0\1\1\7\0\12\1\17\0\7\1\1\0\7\1"+
+    "\5\0\10\1\2\0\2\1\2\0\26\1\1\0\7\1\1\0\1\1"+
+    "\3\0\4\1\3\0\1\1\20\0\1\1\15\0\2\1\1\0\3\1"+
+    "\16\0\2\1\23\0\6\1\4\0\2\1\2\0\26\1\1\0\7\1"+
+    "\1\0\2\1\1\0\2\1\1\0\2\1\37\0\4\1\1\0\1\1"+
+    "\23\0\3\1\20\0\11\1\1\0\3\1\1\0\26\1\1\0\7\1"+
+    "\1\0\2\1\1\0\5\1\3\0\1\1\22\0\1\1\17\0\2\1"+
+    "\43\0\10\1\2\0\2\1\2\0\26\1\1\0\7\1\1\0\2\1"+
+    "\1\0\5\1\3\0\1\1\36\0\2\1\1\0\3\1\17\0\1\1"+
+    "\21\0\1\1\1\0\6\1\3\0\3\1\1\0\4\1\3\0\2\1"+
+    "\1\0\1\1\1\0\2\1\3\0\2\1\3\0\3\1\3\0\14\1"+
+    "\26\0\1\1\64\0\10\1\1\0\3\1\1\0\27\1\1\0\12\1"+
+    "\1\0\5\1\3\0\1\1\32\0\2\1\6\0\2\1\43\0\10\1"+
+    "\1\0\3\1\1\0\27\1\1\0\12\1\1\0\5\1\3\0\1\1"+
+    "\40\0\1\1\1\0\2\1\17\0\2\1\22\0\10\1\1\0\3\1"+
+    "\1\0\51\1\2\0\1\1\20\0\1\1\21\0\2\1\30\0\6\1"+
+    "\5\0\22\1\3\0\30\1\1\0\11\1\1\0\1\1\2\0\7\1"+
+    "\72\0\60\1\1\0\2\1\14\0\7\1\72\0\2\1\1\0\1\1"+
+    "\2\0\2\1\1\0\1\1\2\0\1\1\6\0\4\1\1\0\7\1"+
+    "\1\0\3\1\1\0\1\1\1\0\1\1\2\0\2\1\1\0\4\1"+
+    "\1\0\2\1\11\0\1\1\2\0\5\1\1\0\1\1\25\0\2\1"+
+    "\42\0\1\1\77\0\10\1\1\0\44\1\33\0\5\1\163\0\53\1"+
+    "\24\0\1\1\20\0\6\1\4\0\4\1\3\0\1\1\3\0\2\1"+
+    "\7\0\3\1\4\0\15\1\14\0\1\1\21\0\46\1\12\0\53\1"+
+    "\1\0\1\1\3\0\u0149\1\1\0\4\1\2\0\7\1\1\0\1\1"+
+    "\1\0\4\1\2\0\51\1\1\0\4\1\2\0\41\1\1\0\4\1"+
+    "\2\0\7\1\1\0\1\1\1\0\4\1\2\0\17\1\1\0\71\1"+
+    "\1\0\4\1\2\0\103\1\45\0\20\1\20\0\125\1\14\0\u026c\1"+
+    "\2\0\21\1\1\0\32\1\5\0\113\1\25\0\15\1\1\0\4\1"+
+    "\16\0\22\1\16\0\22\1\16\0\15\1\1\0\3\1\17\0\64\1"+
+    "\43\0\1\1\4\0\1\1\103\0\130\1\10\0\51\1\1\0\1\1"+
+    "\5\0\106\1\12\0\35\1\63\0\36\1\2\0\5\1\13\0\54\1"+
+    "\25\0\7\1\70\0\27\1\11\0\65\1\122\0\1\1\135\0\57\1"+
+    "\21\0\7\1\67\0\36\1\15\0\2\1\20\0\46\1\32\0\44\1"+
+    "\51\0\3\1\12\0\44\1\153\0\4\1\1\0\4\1\16\0\300\1"+
+    "\100\0\u0116\1\2\0\6\1\2\0\46\1\2\0\6\1\2\0\10\1"+
+    "\1\0\1\1\1\0\1\1\1\0\1\1\1\0\37\1\2\0\65\1"+
+    "\1\0\7\1\1\0\1\1\3\0\3\1\1\0\7\1\3\0\4\1"+
+    "\2\0\6\1\4\0\15\1\5\0\3\1\1\0\7\1\164\0\1\1"+
+    "\15\0\1\1\20\0\15\1\145\0\1\1\4\0\1\1\2\0\12\1"+
+    "\1\0\1\1\3\0\5\1\6\0\1\1\1\0\1\1\1\0\1\1"+
+    "\1\0\4\1\1\0\13\1\2\0\4\1\5\0\5\1\4\0\1\1"+
+    "\64\0\2\1\u0a7b\0\57\1\1\0\57\1\1\0\205\1\6\0\4\1"+
+    "\21\0\46\1\12\0\66\1\11\0\1\1\20\0\27\1\11\0\7\1"+
+    "\1\0\7\1\1\0\7\1\1\0\7\1\1\0\7\1\1\0\7\1"+
+    "\1\0\7\1\1\0\7\1\120\0\1\1\u01d5\0\2\1\52\0\5\1"+
+    "\5\0\2\1\4\0\126\1\6\0\3\1\1\0\132\1\1\0\4\1"+
+    "\5\0\51\1\3\0\136\1\21\0\33\1\65\0\20\1\u0200\0\u19b6\1"+
+    "\112\0\u51cc\1\64\0\u048d\1\103\0\56\1\2\0\u010d\1\3\0\20\1"+
+    "\12\0\2\1\24\0\57\1\20\0\31\1\10\0\106\1\61\0\11\1"+
+    "\2\0\147\1\2\0\4\1\1\0\2\1\16\0\12\1\120\0\10\1"+
+    "\1\0\3\1\1\0\4\1\1\0\27\1\35\0\64\1\16\0\62\1"+
+    "\76\0\6\1\3\0\1\1\16\0\34\1\12\0\27\1\31\0\35\1"+
+    "\7\0\57\1\34\0\1\1\60\0\51\1\27\0\3\1\1\0\10\1"+
+    "\24\0\27\1\3\0\1\1\5\0\60\1\1\0\1\1\3\0\2\1"+
+    "\2\0\5\1\2\0\1\1\1\0\1\1\30\0\3\1\43\0\6\1"+
+    "\2\0\6\1\2\0\6\1\11\0\7\1\1\0\7\1\221\0\43\1"+
+    "\35\0\u2ba4\1\14\0\27\1\4\0\61\1\u2104\0\u012e\1\2\0\76\1"+
+    "\2\0\152\1\46\0\7\1\14\0\5\1\5\0\1\1\1\0\12\1"+
+    "\1\0\15\1\1\0\5\1\1\0\1\1\1\0\2\1\1\0\2\1"+
+    "\1\0\154\1\41\0\u016b\1\22\0\100\1\2\0\66\1\50\0\14\1"+
+    "\164\0\5\1\1\0\207\1\44\0\32\1\6\0\32\1\13\0\131\1"+
+    "\3\0\6\1\2\0\6\1\2\0\6\1\2\0\3\1\43\0";
+
+  /** 
+   * Translates characters to character classes
+   */
+  private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
+
+  /** 
+   * Translates DFA states to action switch labels.
+   */
+  private static final int [] ZZ_ACTION = zzUnpackAction();
+
+  private static final String ZZ_ACTION_PACKED_0 =
+    "\3\0\2\1\2\0\1\2\14\0\1\2\1\3\1\4"+
+    "\1\5\1\3\1\6\1\3\1\6\1\7\2\6\1\10"+
+    "\2\6\1\11\1\12\1\13\5\1\1\14\5\1\1\15"+
+    "\1\5\1\16\1\17\1\20\1\6\1\2\1\6\4\2"+
+    "\1\21\1\22\4\1\1\23\6\24\1\6\1\25\1\26"+
+    "\2\16\2\6\1\16\1\6\1\16\1\27\1\30\1\16"+
+    "\1\31\1\32\1\33\1\6\1\34\1\35\1\36\2\16"+
+    "\1\37\1\40\1\41\1\42\1\43\1\44\1\45\3\3"+
+    "\2\6\1\0\1\46\1\47\4\0\1\50\10\1\1\51"+
+    "\2\0\4\2\1\52\1\53\2\16\2\0\1\16\1\0"+
+    "\2\16\4\0\2\16\4\0\1\54\1\0\1\55\5\0"+
+    "\1\56\1\57\2\0\1\55\1\56\1\57\2\1\1\55"+
+    "\1\56\1\57\2\1\1\60\1\0\1\55\1\56\1\0"+
+    "\1\57\2\2\2\16\1\0\1\16\1\61\1\16\4\0"+
+    "\2\16\1\0\1\62\2\0\1\63\7\0\1\64\1\0"+
+    "\1\1\1\64\2\1\1\64\1\1\1\2\1\64\1\2"+
+    "\2\16\1\0\1\65\1\16\4\0\2\16\11\0\2\1"+
+    "\1\2\2\16\1\65\1\66\4\0\2\16\10\0\1\67"+
+    "\2\1\1\2\1\70\1\71\3\0\1\72\1\73\1\74"+
+    "\1\0\1\75\6\0\2\1\1\2\2\0\1\76\1\77"+
+    "\4\0\1\100\1\0\2\1\1\2\1\101\1\0\1\102"+
+    "\1\103\1\104\1\0\1\105\3\102\1\106\1\107";
+
+  private static int [] zzUnpackAction() {
+    int [] result = new int[304];
+    int offset = 0;
+    offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackAction(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+
+  /** 
+   * Translates a state to a row index in the transition table
+   */
+  private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
+
+  private static final String ZZ_ROWMAP_PACKED_0 =
+    "\0\0\0\63\0\146\0\231\0\314\0\377\0\u0132\0\u0165"+
+    "\0\u0198\0\u01cb\0\u01fe\0\u0231\0\u0264\0\u0297\0\u02ca\0\u02fd"+
+    "\0\u0330\0\u0363\0\u0396\0\u03c9\0\u03fc\0\u042f\0\u0462\0\u0495"+
+    "\0\u04c8\0\u04fb\0\u052e\0\u042f\0\u0561\0\u0594\0\u04c8\0\u042f"+
+    "\0\u052e\0\u05c7\0\u042f\0\u042f\0\u042f\0\u05fa\0\u062d\0\u0660"+
+    "\0\u0693\0\u06c6\0\u042f\0\u06f9\0\u072c\0\u075f\0\u0792\0\u07c5"+
+    "\0\u07f8\0\u082b\0\u085e\0\u042f\0\u042f\0\u0891\0\u08c4\0\u08f7"+
+    "\0\u092a\0\u095d\0\u0990\0\u09c3\0\u042f\0\u042f\0\u042f\0\u04c8"+
+    "\0\u04fb\0\u052e\0\u042f\0\u042f\0\u0594\0\u04c8\0\u04fb\0\u052e"+
+    "\0\u09f6\0\u0a29\0\u042f\0\u042f\0\u0a5c\0\u0a8f\0\u0ac2\0\u0af5"+
+    "\0\u0b28\0\u0b5b\0\u0b8e\0\u04c8\0\u042f\0\u0bc1\0\u04fb\0\u042f"+
+    "\0\u052e\0\u0bf4\0\u042f\0\u042f\0\u042f\0\u0c27\0\u0c5a\0\u042f"+
+    "\0\u042f\0\u042f\0\u042f\0\u042f\0\u042f\0\u042f\0\u0c8d\0\u0cc0"+
+    "\0\u04fb\0\u0cf3\0\u0d26\0\u0d59\0\u0d8c\0\u042f\0\u0dbf\0\u0df2"+
+    "\0\u0e25\0\u0e58\0\u042f\0\u0e8b\0\u0ebe\0\u0ef1\0\u0f24\0\u0f57"+
+    "\0\u0f8a\0\u0fbd\0\u0ff0\0\u042f\0\u1023\0\u1056\0\u1089\0\u10bc"+
+    "\0\u10ef\0\u1122\0\u042f\0\u042f\0\u1155\0\u1188\0\u0ac2\0\u0af5"+
+    "\0\u11bb\0\u11ee\0\u1221\0\u1254\0\u1287\0\u12ba\0\u12ed\0\u1320"+
+    "\0\u1353\0\u1386\0\u13b9\0\u13ec\0\u141f\0\u1452\0\u042f\0\u1485"+
+    "\0\u14b8\0\u14eb\0\u151e\0\u1551\0\u1584\0\u15b7\0\u042f\0\u042f"+
+    "\0\u15ea\0\u161d\0\u1650\0\u05fa\0\u05fa\0\u1683\0\u16b6\0\u16e9"+
+    "\0\u06f9\0\u06f9\0\u171c\0\u174f\0\u042f\0\u1782\0\u17b5\0\u08c4"+
+    "\0\u17e8\0\u08c4\0\u181b\0\u184e\0\u1881\0\u18b4\0\u18e7\0\u191a"+
+    "\0\u085e\0\u194d\0\u1980\0\u19b3\0\u19e6\0\u1a19\0\u1a4c\0\u1a7f"+
+    "\0\u1ab2\0\u042f\0\u1ae5\0\u1b18\0\u042f\0\u1b4b\0\u1b7e\0\u1bb1"+
+    "\0\u1be4\0\u1c17\0\u1c4a\0\u1c7d\0\u042f\0\u1cb0\0\u1ce3\0\u05fa"+
+    "\0\u1d16\0\u1d49\0\u06f9\0\u1d7c\0\u1daf\0\u08c4\0\u1de2\0\u1e15"+
+    "\0\u1e48\0\u1e7b\0\u085e\0\u1eae\0\u1ee1\0\u1f14\0\u1f47\0\u1f7a"+
+    "\0\u1fad\0\u1fe0\0\u2013\0\u2046\0\u2079\0\u20ac\0\u20df\0\u2112"+
+    "\0\u2145\0\u2178\0\u21ab\0\u21de\0\u2211\0\u2244\0\u2277\0\u22aa"+
+    "\0\u042f\0\u085e\0\u22dd\0\u2310\0\u2343\0\u2376\0\u23a9\0\u23dc"+
+    "\0\u240f\0\u2442\0\u2475\0\u24a8\0\u24db\0\u250e\0\u2541\0\u2574"+
+    "\0\u042f\0\u25a7\0\u25da\0\u260d\0\u085e\0\u085e\0\u2640\0\u2673"+
+    "\0\u26a6\0\u042f\0\u085e\0\u085e\0\u26d9\0\u042f\0\u270c\0\u273f"+
+    "\0\u2772\0\u27a5\0\u27d8\0\u280b\0\u283e\0\u2871\0\u28a4\0\u28d7"+
+    "\0\u290a\0\u042f\0\u042f\0\u293d\0\u2970\0\u29a3\0\u29d6\0\u042f"+
+    "\0\u2a09\0\u2a3c\0\u2a6f\0\u2aa2\0\u042f\0\u2ad5\0\u042f\0\u042f"+
+    "\0\u042f\0\u2b08\0\u042f\0\u05fa\0\u06f9\0\u08c4\0\u042f\0\u042f";
+
+  private static int [] zzUnpackRowMap() {
+    int [] result = new int[304];
+    int offset = 0;
+    offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackRowMap(String packed, int offset, int [] result) {
+    int i = 0;  /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int high = packed.charAt(i++) << 16;
+      result[j++] = high | packed.charAt(i++);
+    }
+    return j;
+  }
+
+  /** 
+   * The transition table of the DFA
+   */
+  private static final int [] ZZ_TRANS = zzUnpackTrans();
+
+  private static final String ZZ_TRANS_PACKED_0 =
+    "\3\26\1\27\2\26\1\30\6\26\1\31\11\26\1\32"+
+    "\1\26\1\33\6\26\1\27\22\26\1\34\1\35\1\34"+
+    "\1\27\2\34\1\36\2\34\4\35\1\37\1\40\10\35"+
+    "\1\32\1\34\1\41\1\34\2\35\1\42\2\35\1\27"+
+    "\3\34\5\35\6\34\3\35\4\34\1\27\2\34\1\36"+
+    "\6\34\1\37\11\34\1\32\1\34\1\41\6\34\1\27"+
+    "\1\43\1\44\1\45\17\34\6\46\1\47\6\46\1\50"+
+    "\11\46\1\51\1\46\1\52\11\46\1\53\17\46\6\54"+
+    "\1\55\6\54\1\56\11\54\1\57\1\54\1\60\10\54"+
+    "\1\53\20\54\1\34\1\61\1\34\1\27\2\34\1\62"+
+    "\2\34\4\61\1\37\1\34\10\61\1\32\1\34\1\41"+
+    "\1\34\2\61\1\34\2\61\1\27\3\34\5\61\6\34"+
+    "\3\61\2\34\1\63\1\34\1\27\2\34\1\62\2\34"+
+    "\4\63\1\37\1\64\10\63\1\32\1\34\1\41\1\34"+
+    "\2\63\1\34\2\63\1\27\1\65\2\34\5\63\6\34"+
+    "\3\63\1\66\5\67\1\70\1\71\6\67\1\72\11\67"+
+    "\1\73\1\67\1\74\31\67\3\34\1\27\2\34\1\62"+
+    "\6\34\1\37\1\64\10\34\1\32\1\34\1\41\6\34"+
+    "\1\27\1\34\1\75\1\76\16\34\1\66\6\77\1\62"+
+    "\6\77\1\100\11\77\1\101\1\77\1\102\11\77\1\103"+
+    "\25\77\1\62\6\77\1\100\11\77\1\101\1\77\1\102"+
+    "\10\77\1\103\20\77\6\104\1\105\6\104\1\106\11\104"+
+    "\1\107\1\104\1\110\3\104\1\111\25\104\5\34\1\112"+
+    "\1\36\6\34\1\37\11\34\1\32\1\34\1\41\32\34"+
+    "\1\63\1\34\1\27\2\34\1\36\1\34\1\113\4\63"+
+    "\1\37\1\114\10\63\1\32\1\34\1\41\1\34\2\63"+
+    "\1\34\2\63\1\27\3\34\1\63\1\115\1\116\2\63"+
+    "\6\34\3\63\4\34\1\27\2\34\1\36\1\34\1\113"+
+    "\4\34\1\37\1\114\10\34\1\32\1\34\1\41\6\34"+
+    "\1\27\1\34\1\117\1\120\20\34\2\63\1\27\1\63"+
+    "\1\121\1\122\2\34\2\63\1\123\1\63\1\124\1\125"+
+    "\4\63\1\126\3\63\1\127\1\130\1\131\1\132\2\63"+
+    "\1\133\2\63\1\27\1\34\1\134\1\135\1\63\1\136"+
+    "\1\137\2\63\1\140\1\141\1\142\1\143\1\144\1\145"+
+    "\3\63\1\34\6\46\1\47\6\46\1\50\11\46\1\51"+
+    "\1\46\1\52\11\46\1\146\17\46\6\54\1\55\6\54"+
+    "\1\56\11\54\1\57\1\54\1\60\10\54\1\146\20\54"+
+    "\6\26\1\147\6\26\1\150\11\26\1\151\1\26\1\33"+
+    "\31\26\3\34\1\27\2\34\1\36\1\34\1\113\4\34"+
+    "\1\37\1\34\1\152\7\34\1\32\1\34\1\41\6\34"+
+    "\1\27\22\34\5\67\1\153\1\71\6\67\1\72\11\67"+
+    "\1\73\1\67\1\74\31\67\66\0\1\27\34\0\1\27"+
+    "\31\0\1\154\25\0\1\155\24\0\1\156\15\0\1\157"+
+    "\46\0\1\160\7\0\4\160\2\0\10\160\3\0\1\161"+
+    "\2\160\1\0\2\160\4\0\5\160\6\0\3\160\2\0"+
+    "\1\160\7\0\4\160\2\0\10\160\4\0\2\160\1\0"+
+    "\2\160\4\0\5\160\6\0\3\160\2\0\2\35\1\0"+
+    "\2\35\3\0\4\35\2\0\10\35\4\0\2\35\1\0"+
+    "\2\35\4\0\5\35\6\0\3\35\10\0\1\162\71\0"+
+    "\1\163\44\0\43\46\1\0\26\46\1\164\33\46\1\0"+
+    "\34\46\1\165\25\46\1\0\20\46\1\166\7\46\4\166"+
+    "\2\46\10\166\3\46\1\167\2\166\1\46\2\166\3\46"+
+    "\1\0\5\166\6\46\3\166\2\46\1\166\7\46\4\166"+
+    "\2\46\10\166\4\46\2\166\1\46\2\166\3\46\1\0"+
+    "\5\166\6\46\3\166\1\46\42\54\1\0\27\54\1\170"+
+    "\32\54\1\0\35\54\1\171\24\54\1\0\21\54\1\172"+
+    "\7\54\4\172\2\54\10\172\3\54\1\173\2\172\1\54"+
+    "\2\172\2\54\1\0\1\54\5\172\6\54\3\172\2\54"+
+    "\1\172\7\54\4\172\2\54\10\172\4\54\2\172\1\54"+
+    "\2\172\2\54\1\0\1\54\5\172\6\54\3\172\1\54"+
+    "\1\0\2\61\1\0\2\61\3\0\4\61\2\0\10\61"+
+    "\4\0\2\61\1\0\2\61\4\0\5\61\6\0\3\61"+
+    "\10\0\1\162\52\0\1\156\1\0\2\63\1\0\2\63"+
+    "\3\0\4\63\2\0\10\63\4\0\2\63\1\0\2\63"+
+    "\4\0\5\63\6\0\3\63\17\0\1\174\44\0\5\67"+
+    "\1\175\62\67\1\176\62\67\1\175\1\67\1\177\60\67"+
+    "\1\175\7\67\1\200\46\67\1\201\3\67\1\175\3\67"+
+    "\4\201\2\67\10\201\3\67\1\202\2\201\1\67\2\201"+
+    "\4\67\5\201\6\67\3\201\2\67\1\201\3\67\1\175"+
+    "\3\67\4\201\2\67\10\201\4\67\2\201\1\67\2\201"+
+    "\4\67\5\201\6\67\3\201\1\67\16\0\1\203\51\0"+
+    "\1\204\56\0\2\63\1\0\2\63\3\0\4\63\2\0"+
+    "\3\63\1\205\4\63\4\0\2\63\1\0\2\63\4\0"+
+    "\5\63\6\0\3\63\2\0\2\63\1\0\2\63\3\0"+
+    "\4\63\2\0\10\63\4\0\2\63\1\0\2\63\4\0"+
+    "\1\206\4\63\6\0\3\63\1\0\42\207\1\77\20\207"+
+    "\43\210\1\77\17\210\1\0\2\63\1\0\1\63\1\211"+
+    "\3\0\4\63\2\0\10\63\4\0\2\63\1\0\2\63"+
+    "\4\0\5\63\6\0\3\63\10\0\1\212\54\0\2\63"+
+    "\1\0\2\63\3\0\4\63\2\0\1\63\1\213\6\63"+
+    "\4\0\2\63\1\0\2\63\4\0\5\63\6\0\3\63"+
+    "\2\0\2\63\1\0\2\63\3\0\4\63\2\0\10\63"+
+    "\4\0\2\63\1\0\2\63\4\0\3\63\1\214\1\63"+
+    "\6\0\3\63\20\0\1\215\6\0\1\216\16\0\1\217"+
+    "\12\0\1\220\3\0\2\63\1\0\2\63\3\0\4\63"+
+    "\2\0\3\63\1\221\4\63\4\0\2\63\1\0\2\63"+
+    "\4\0\5\63\6\0\3\63\2\0\2\63\1\0\2\63"+
+    "\3\0\4\63\2\0\10\63\4\0\2\63\1\0\2\63"+
+    "\4\0\1\222\4\63\6\0\3\63\10\0\1\223\70\0"+
+    "\1\224\65\0\1\225\3\0\1\226\36\0\5\67\1\227"+
+    "\55\67\5\0\1\230\2\0\1\231\1\0\1\232\1\233"+
+    "\4\0\1\234\2\0\1\235\72\0\1\236\45\0\1\237"+
+    "\45\0\2\160\1\0\2\160\3\0\4\160\2\0\10\160"+
+    "\1\0\1\240\2\0\2\160\1\0\2\160\4\0\5\160"+
+    "\6\0\3\160\3\0\1\241\30\0\1\242\34\0\1\230"+
+    "\2\0\1\231\52\0\10\46\1\243\32\46\1\0\35\46"+
+    "\1\244\24\46\1\0\20\46\2\166\1\46\2\166\3\46"+
+    "\4\166\2\46\10\166\1\46\1\245\2\46\2\166\1\46"+
+    "\2\166\3\46\1\0\5\166\6\46\3\166\3\46\1\246"+
+    "\30\46\1\247\7\46\1\0\17\46\10\54\1\250\31\54"+
+    "\1\0\36\54\1\251\23\54\1\0\21\54\2\172\1\54"+
+    "\2\172\3\54\4\172\2\54\10\172\1\54\1\252\2\54"+
+    "\2\172\1\54\2\172\2\54\1\0\1\54\5\172\6\54"+
+    "\3\172\3\54\1\253\30\54\1\254\6\54\1\0\20\54"+
+    "\5\67\1\0\55\67\16\0\1\255\44\0\5\67\1\256"+
+    "\2\67\1\257\57\67\1\175\10\67\1\260\45\67\2\201"+
+    "\1\67\1\201\1\261\3\67\4\201\2\67\10\201\1\67"+
+    "\1\262\2\67\2\201\1\67\2\201\4\67\5\201\6\67"+
+    "\3\201\3\67\1\263\2\67\1\175\25\67\1\264\27\67"+
+    "\1\0\2\63\1\0\2\63\3\0\4\63\2\0\10\63"+
+    "\4\0\2\63\1\0\2\63\4\0\4\63\1\265\6\0"+
+    "\3\63\2\0\2\63\1\0\2\63\3\0\4\63\2\0"+
+    "\10\63\4\0\2\63\1\0\2\63\4\0\2\63\1\266"+
+    "\2\63\6\0\3\63\1\0\1\267\2\211\1\267\1\211"+
+    "\1\270\3\267\4\211\2\267\10\211\4\267\2\211\1\267"+
+    "\2\211\4\267\5\211\6\267\3\211\1\267\5\0\1\230"+
+    "\2\0\1\231\2\0\1\233\4\0\1\234\2\0\1\235"+
+    "\40\0\2\63\1\0\2\63\3\0\4\63\2\0\10\63"+
+    "\4\0\2\63\1\0\2\63\4\0\1\271\4\63\6\0"+
+    "\3\63\2\0\2\63\1\0\2\63\3\0\4\63\2\0"+
+    "\10\63\4\0\2\63\1\0\2\63\4\0\1\63\1\272"+
+    "\3\63\6\0\3\63\50\0\1\273\36\0\1\274\50\0"+
+    "\1\275\70\0\1\276\44\0\2\63\1\0\2\63\3\0"+
+    "\4\63\2\0\10\63\4\0\2\63\1\0\2\63\4\0"+
+    "\4\63\1\277\6\0\3\63\2\0\2\63\1\0\2\63"+
+    "\3\0\4\63\2\0\10\63\4\0\2\63\1\0\2\63"+
+    "\4\0\2\63\1\300\2\63\6\0\3\63\6\0\1\301"+
+    "\2\0\1\231\70\0\1\302\55\0\1\303\71\0\1\304"+
+    "\47\0\1\305\66\0\1\306\76\0\1\307\51\0\1\310"+
+    "\73\0\1\311\55\0\1\312\1\313\77\0\1\314\26\0"+
+    "\1\241\25\0\1\315\34\0\1\316\6\0\3\316\7\0"+
+    "\1\316\10\0\1\316\13\0\1\316\7\0\1\316\2\0"+
+    "\11\46\1\317\31\46\1\0\21\46\1\246\25\46\1\320"+
+    "\12\46\1\0\21\46\1\321\6\46\3\321\7\46\1\321"+
+    "\10\46\1\321\6\46\1\0\4\46\1\321\7\46\1\321"+
+    "\2\46\11\54\1\322\30\54\1\0\22\54\1\253\25\54"+
+    "\1\323\11\54\1\0\22\54\1\324\6\54\3\324\7\54"+
+    "\1\324\10\54\1\324\5\54\1\0\5\54\1\324\7\54"+
+    "\1\324\2\54\5\67\1\305\62\67\1\175\3\67\1\325"+
+    "\52\67\2\201\1\67\1\201\1\160\3\67\4\201\2\67"+
+    "\10\201\1\67\1\262\2\67\2\201\1\67\2\201\4\67"+
+    "\5\201\6\67\3\201\3\67\1\263\2\67\1\175\22\67"+
+    "\1\326\34\67\1\327\2\67\1\175\3\67\3\327\7\67"+
+    "\1\327\10\67\1\327\13\67\1\327\7\67\1\327\2\67"+
+    "\1\0\2\63\1\0\2\63\3\0\4\63\2\0\2\63"+
+    "\1\330\5\63\4\0\2\63\1\0\2\63\4\0\5\63"+
+    "\6\0\3\63\2\0\2\63\1\0\2\63\3\0\3\63"+
+    "\1\331\2\0\10\63\4\0\2\63\1\0\2\63\4\0"+
+    "\5\63\6\0\3\63\1\0\5\267\1\332\56\267\2\211"+
+    "\1\267\1\211\1\333\3\267\4\211\2\267\10\211\4\267"+
+    "\2\211\1\267\2\211\4\267\5\211\6\267\3\211\1\267"+
+    "\1\0\2\63\1\0\2\63\3\0\3\63\1\334\2\0"+
+    "\10\63\4\0\2\63\1\0\2\63\4\0\5\63\6\0"+
+    "\3\63\46\0\1\335\74\0\1\336\15\0\1\337\131\0"+
+    "\1\340\2\0\2\63\1\0\2\63\3\0\4\63\2\0"+
+    "\2\63\1\341\5\63\4\0\2\63\1\0\2\63\4\0"+
+    "\5\63\6\0\3\63\2\0\2\63\1\0\2\63\3\0"+
+    "\3\63\1\342\2\0\10\63\4\0\2\63\1\0\2\63"+
+    "\4\0\5\63\6\0\3\63\6\0\1\26\76\0\1\343"+
+    "\66\0\1\344\47\0\1\345\61\0\1\346\65\0\1\347"+
+    "\62\0\1\350\62\0\1\351\71\0\1\352\76\0\1\353"+
+    "\25\0\1\316\6\0\3\316\7\0\1\316\4\0\1\315"+
+    "\3\0\1\316\13\0\1\316\7\0\1\316\2\0\12\46"+
+    "\1\354\30\46\1\0\21\46\1\321\6\46\3\321\7\46"+
+    "\1\321\4\46\1\320\3\46\1\321\6\46\1\0\4\46"+
+    "\1\321\7\46\1\321\2\46\12\54\1\355\27\54\1\0"+
+    "\22\54\1\324\6\54\3\324\7\54\1\324\4\54\1\323"+
+    "\3\54\1\324\5\54\1\0\5\54\1\324\7\54\1\324"+
+    "\2\54\5\67\1\175\4\67\1\356\52\67\1\327\2\67"+
+    "\1\175\3\67\3\327\7\67\1\327\4\67\1\326\3\67"+
+    "\1\327\13\67\1\327\7\67\1\327\2\67\1\0\2\63"+
+    "\1\0\2\63\3\0\4\63\2\0\1\357\7\63\4\0"+
+    "\2\63\1\0\2\63\4\0\5\63\6\0\3\63\2\0"+
+    "\2\63\1\0\2\63\3\0\4\63\2\0\4\63\1\360"+
+    "\3\63\4\0\2\63\1\0\2\63\4\0\5\63\6\0"+
+    "\3\63\1\0\5\267\1\361\55\267\1\0\2\63\1\0"+
+    "\2\63\3\0\4\63\2\0\10\63\4\0\2\63\1\0"+
+    "\2\63\4\0\1\362\4\63\6\0\3\63\22\0\1\363"+
+    "\63\0\1\364\53\0\1\365\72\0\1\366\40\0\2\63"+
+    "\1\0\2\63\3\0\4\63\2\0\1\367\7\63\4\0"+
+    "\2\63\1\0\2\63\4\0\5\63\6\0\3\63\2\0"+
+    "\2\63\1\0\2\63\3\0\4\63\2\0\4\63\1\370"+
+    "\3\63\4\0\2\63\1\0\2\63\4\0\5\63\6\0"+
+    "\3\63\23\0\1\371\66\0\1\372\47\0\1\373\63\0"+
+    "\1\374\67\0\1\375\54\0\1\376\66\0\1\377\112\0"+
+    "\1\u0100\53\0\1\u0101\22\0\13\46\1\u0102\27\46\1\0"+
+    "\17\46\13\54\1\u0103\26\54\1\0\20\54\5\67\1\175"+
+    "\5\67\1\u0104\47\67\1\0\2\63\1\0\2\63\3\0"+
+    "\1\u0105\3\63\2\0\10\63\4\0\2\63\1\0\2\63"+
+    "\4\0\5\63\6\0\3\63\2\0\2\63\1\0\2\63"+
+    "\3\0\4\63\2\0\10\63\4\0\2\63\1\0\2\63"+
+    "\4\0\3\63\1\u0106\1\63\6\0\3\63\20\0\1\u0107"+
+    "\62\0\1\u0108\57\0\1\u0109\60\0\1\u010a\51\0\2\63"+
+    "\1\0\2\63\3\0\1\u010b\3\63\2\0\10\63\4\0"+
+    "\2\63\1\0\2\63\4\0\5\63\6\0\3\63\2\0"+
+    "\2\63\1\0\2\63\3\0\4\63\2\0\10\63\4\0"+
+    "\2\63\1\0\2\63\4\0\3\63\1\u010c\1\63\6\0"+
+    "\3\63\13\0\1\u010d\73\0\1\u010e\53\0\1\u010f\112\0"+
+    "\1\u0110\35\0\1\u0111\57\0\1\u0112\62\0\1\u0113\71\0"+
+    "\1\u0114\37\0\14\46\1\u0115\26\46\1\0\17\46\14\54"+
+    "\1\u0116\25\54\1\0\20\54\5\67\1\175\6\67\1\u0117"+
+    "\46\67\23\0\1\u0118\65\0\1\u0119\47\0\1\u011a\72\0"+
+    "\1\u011b\52\0\1\u011c\114\0\1\u011d\63\0\1\u011e\33\0"+
+    "\1\u011f\107\0\1\u0120\36\0\1\u0121\42\0\13\46\1\u0122"+
+    "\27\46\1\0\17\46\13\54\1\u0123\26\54\1\0\20\54"+
+    "\5\67\1\175\5\67\1\u0124\47\67\12\0\1\u0125\73\0"+
+    "\1\u0126\47\0\1\u0127\75\0\1\u0128\53\0\1\u0129\73\0"+
+    "\1\u012a\51\0\1\u012b\46\0\10\46\1\u012c\32\46\1\0"+
+    "\17\46\10\54\1\u012d\31\54\1\0\20\54\5\67\1\175"+
+    "\2\67\1\u012e\52\67\12\0\1\u012f\70\0\1\u0130\42\0";
+
+  private static int [] zzUnpackTrans() {
+    int [] result = new int[11067];
+    int offset = 0;
+    offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackTrans(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      value--;
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+
+  /* error codes */
+  private static final int ZZ_UNKNOWN_ERROR = 0;
+  private static final int ZZ_NO_MATCH = 1;
+  private static final int ZZ_PUSHBACK_2BIG = 2;
+  private static final char[] EMPTY_BUFFER = new char[0];
+  private static final int YYEOF = -1;
+  private static java.io.Reader zzReader = null; // Fake
+
+  /* error messages for the codes above */
+  private static final String ZZ_ERROR_MSG[] = {
+    "Unkown internal scanner error",
+    "Error: could not match input",
+    "Error: pushback value was too large"
+  };
+
+  /**
+   * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
+   */
+  private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
+
+  private static final String ZZ_ATTRIBUTE_PACKED_0 =
+    "\3\0\2\1\2\0\1\1\14\0\1\1\1\11\5\1"+
+    "\1\11\3\1\1\11\2\1\3\11\5\1\1\11\10\1"+
+    "\2\11\7\1\3\11\3\1\2\11\6\1\2\11\10\1"+
+    "\1\11\2\1\1\11\2\1\3\11\2\1\7\11\5\1"+
+    "\1\0\1\1\1\11\4\0\1\11\10\1\1\11\2\0"+
+    "\4\1\2\11\2\1\2\0\1\1\1\0\2\1\4\0"+
+    "\2\1\4\0\1\11\1\0\1\1\5\0\2\11\2\0"+
+    "\12\1\1\11\1\0\2\1\1\0\5\1\1\0\3\1"+
+    "\4\0\2\1\1\0\1\11\2\0\1\11\7\0\1\11"+
+    "\1\0\13\1\1\0\2\1\4\0\2\1\11\0\5\1"+
+    "\1\11\1\1\4\0\2\1\10\0\1\11\5\1\3\0"+
+    "\1\11\2\1\1\0\1\11\6\0\3\1\2\0\2\11"+
+    "\4\0\1\11\1\0\3\1\1\11\1\0\3\11\1\0"+
+    "\1\11\3\1\2\11";
+
+  private static int [] zzUnpackAttribute() {
+    int [] result = new int[304];
+    int offset = 0;
+    offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackAttribute(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+  /** the current state of the DFA */
+  private int zzState;
+
+  /** the current lexical state */
+  private int zzLexicalState = YYINITIAL;
+
+  /** this buffer contains the current text to be matched and is
+      the source of the yytext() string */
+  private CharSequence zzBuffer = "";
+
+  /** this buffer may contains the current text array to be matched when it is cheap to acquire it */
+  private char[] zzBufferArray;
+
+  /** the textposition at the last accepting state */
+  private int zzMarkedPos;
+
+  /** the textposition at the last state to be included in yytext */
+  private int zzPushbackPos;
+
+  /** the current text position in the buffer */
+  private int zzCurrentPos;
+
+  /** startRead marks the beginning of the yytext() string in the buffer */
+  private int zzStartRead;
+
+  /** endRead marks the last character in the buffer, that has been read
+      from input */
+  private int zzEndRead;
+
+  /**
+   * zzAtBOL == true <=> the scanner is currently at the beginning of a line
+   */
+  private boolean zzAtBOL = true;
+
+  /** zzAtEOF == true <=> the scanner is at the EOF */
+  private boolean zzAtEOF;
+
+  /** denotes if the user-EOF-code has already been executed */
+  private boolean zzEOFDone;
+
+  /* user code: */
+   private boolean isHighlightModeOn = false;
+
+   public _DtdLexer(boolean highlightModeOn) {
+     this((java.io.Reader)null);
+     isHighlightModeOn = highlightModeOn;
+   }
+
+
+  public _DtdLexer(java.io.Reader in) {
+    this.zzReader = in;
+  }
+
+  /**
+   * Creates a new scanner.
+   * There is also java.io.Reader version of this constructor.
+   *
+   * @param   in  the java.io.Inputstream to read input from.
+   */
+  public _DtdLexer(java.io.InputStream in) {
+    this(new java.io.InputStreamReader(in));
+  }
+
+  /** 
+   * Unpacks the compressed character translation table.
+   *
+   * @param packed   the packed character translation table
+   * @return         the unpacked character translation table
+   */
+  private static char [] zzUnpackCMap(String packed) {
+    char [] map = new char[0x10000];
+    int i = 0;  /* index in packed string  */
+    int j = 0;  /* index in unpacked array */
+    while (i < 1578) {
+      int  count = packed.charAt(i++);
+      char value = packed.charAt(i++);
+      do map[j++] = value; while (--count > 0);
+    }
+    return map;
+  }
+
+  public final int getTokenStart(){
+    return zzStartRead;
+  }
+
+  public final int getTokenEnd(){
+    return getTokenStart() + yylength();
+  }
+
+  public void reset(CharSequence buffer, int start, int end,int initialState){
+    zzBuffer = buffer;
+    zzBufferArray = com.intellij.util.text.CharArrayUtil.fromSequenceWithoutCopying(buffer);
+    zzCurrentPos = zzMarkedPos = zzStartRead = start;
+    zzPushbackPos = 0;
+    zzAtEOF  = false;
+    zzAtBOL = true;
+    zzEndRead = end;
+    yybegin(initialState);
+  }
+
+  /**
+   * Refills the input buffer.
+   *
+   * @return      <code>false</code>, iff there was new input.
+   *
+   * @exception   java.io.IOException  if any I/O-Error occurs
+   */
+  private boolean zzRefill() throws java.io.IOException {
+    return true;
+  }
+
+
+  /**
+   * Returns the current lexical state.
+   */
+  public final int yystate() {
+    return zzLexicalState;
+  }
+
+
+  /**
+   * Enters a new lexical state
+   *
+   * @param newState the new lexical state
+   */
+  public final void yybegin(int newState) {
+    zzLexicalState = newState;
+  }
+
+
+  /**
+   * Returns the text matched by the current regular expression.
+   */
+  public final CharSequence yytext() {
+    return zzBuffer.subSequence(zzStartRead, zzMarkedPos);
+  }
+
+
+  /**
+   * Returns the character at position <tt>pos</tt> from the
+   * matched text.
+   *
+   * It is equivalent to yytext().charAt(pos), but faster
+   *
+   * @param pos the position of the character to fetch.
+   *            A value from 0 to yylength()-1.
+   *
+   * @return the character at position pos
+   */
+  public final char yycharat(int pos) {
+    return zzBufferArray != null ? zzBufferArray[zzStartRead+pos]:zzBuffer.charAt(zzStartRead+pos);
+  }
+
+
+  /**
+   * Returns the length of the matched text region.
+   */
+  public final int yylength() {
+    return zzMarkedPos-zzStartRead;
+  }
+
+
+  /**
+   * Reports an error that occured while scanning.
+   *
+   * In a wellformed scanner (no or only correct usage of
+   * yypushback(int) and a match-all fallback rule) this method
+   * will only be called with things that "Can't Possibly Happen".
+   * If this method is called, something is seriously wrong
+   * (e.g. a JFlex bug producing a faulty scanner etc.).
+   *
+   * Usual syntax/scanner level error handling should be done
+   * in error fallback rules.
+   *
+   * @param   errorCode  the code of the errormessage to display
+   */
+  private void zzScanError(int errorCode) {
+    String message;
+    try {
+      message = ZZ_ERROR_MSG[errorCode];
+    }
+    catch (ArrayIndexOutOfBoundsException e) {
+      message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
+    }
+
+    throw new Error(message);
+  }
+
+
+  /**
+   * Pushes the specified amount of characters back into the input stream.
+   *
+   * They will be read again by then next call of the scanning method
+   *
+   * @param number  the number of characters to be read again.
+   *                This number must not be greater than yylength()!
+   */
+  public void yypushback(int number)  {
+    if ( number > yylength() )
+      zzScanError(ZZ_PUSHBACK_2BIG);
+
+    zzMarkedPos -= number;
+  }
+
+
+  /**
+   * Contains user EOF-code, which will be executed exactly once,
+   * when the end of file is reached
+   */
+  private void zzDoEOF() {
+    if (!zzEOFDone) {
+      zzEOFDone = true;
+    
+    }
+  }
+
+
+  /**
+   * Resumes scanning until the next regular expression is matched,
+   * the end of input is encountered or an I/O-Error occurs.
+   *
+   * @return      the next token
+   * @exception   java.io.IOException  if any I/O-Error occurs
+   */
+  public IElementType advance() throws java.io.IOException {
+    int zzInput;
+    int zzAction;
+
+    // cached fields:
+    int zzCurrentPosL;
+    int zzMarkedPosL;
+    int zzEndReadL = zzEndRead;
+    CharSequence zzBufferL = zzBuffer;
+    char[] zzBufferArrayL = zzBufferArray;
+    char [] zzCMapL = ZZ_CMAP;
+
+    int [] zzTransL = ZZ_TRANS;
+    int [] zzRowMapL = ZZ_ROWMAP;
+    int [] zzAttrL = ZZ_ATTRIBUTE;
+
+    while (true) {
+      zzMarkedPosL = zzMarkedPos;
+
+      zzAction = -1;
+
+      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
+
+      zzState = ZZ_LEXSTATE[zzLexicalState];
+
+
+      zzForAction: {
+        while (true) {
+
+          if (zzCurrentPosL < zzEndReadL)
+            zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++);
+          else if (zzAtEOF) {
+            zzInput = YYEOF;
+            break zzForAction;
+          }
+          else {
+            // store back cached positions
+            zzCurrentPos  = zzCurrentPosL;
+            zzMarkedPos   = zzMarkedPosL;
+            boolean eof = zzRefill();
+            // get translated positions and possibly new buffer
+            zzCurrentPosL  = zzCurrentPos;
+            zzMarkedPosL   = zzMarkedPos;
+            zzBufferL      = zzBuffer;
+            zzEndReadL     = zzEndRead;
+            if (eof) {
+              zzInput = YYEOF;
+              break zzForAction;
+            }
+            else {
+              zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++);
+            }
+          }
+          int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
+          if (zzNext == -1) break zzForAction;
+          zzState = zzNext;
+
+          int zzAttributes = zzAttrL[zzState];
+          if ( (zzAttributes & 1) == 1 ) {
+            zzAction = zzState;
+            zzMarkedPosL = zzCurrentPosL;
+            if ( (zzAttributes & 8) == 8 ) break zzForAction;
+          }
+
+        }
+      }
+
+      // store back cached position
+      zzMarkedPos = zzMarkedPosL;
+
+      switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
+        case 53: 
+          { yybegin(DOCTYPE_MARKUP_STARTED); yypushback(yylength());
+          }
+        case 72: break;
+        case 21: 
+          { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_MARKUP_START;
+          }
+        case 73: break;
+        case 1: 
+          { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;
+          }
+        case 74: break;
+        case 60: 
+          { return XmlTokenType.XML_DOCTYPE_SYSTEM;
+          }
+        case 75: break;
+        case 36: 
+          { return XmlTokenType.XML_COMMA;
+          }
+        case 76: break;
+        case 9: 
+          { return XmlTokenType.XML_EQ;
+          }
+        case 77: break;
+        case 66: 
+          { yybegin(CDATA); return XmlTokenType.XML_CDATA_START;
+          }
+        case 78: break;
+        case 16: 
+          { yybegin(ATTRIBUTE_VALUE_START); return XmlTokenType.XML_EQ;
+          }
+        case 79: break;
+        case 61: 
+          { return XmlTokenType.XML_CONDITIONAL_IGNORE;
+          }
+        case 80: break;
+        case 26: 
+          { return XmlTokenType.XML_SEMI;
+          }
+        case 81: break;
+        case 55: 
+          { yybegin(DECL); return XmlTokenType.XML_DECL_START;
+          }
+        case 82: break;
+        case 11: 
+          { yybegin(DECL_ATTR_VALUE_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;
+          }
+        case 83: break;
+        case 69: 
+          { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_ELEMENT_DECL_START;
+          }
+        case 84: break;
+        case 14: 
+          { return XmlTokenType.XML_NAME;
+          }
+        case 85: break;
+        case 19: 
+          { yybegin(TAG_ATTRIBUTES); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER;
+          }
+        case 86: break;
+        case 10: 
+          { yybegin(DECL_ATTR_VALUE_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;
+          }
+        case 87: break;
+        case 59: 
+          { return XmlTokenType.XML_DOCTYPE_PUBLIC;
+          }
+        case 88: break;
+        case 51: 
+          { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_START;
+          }
+        case 89: break;
+        case 7: 
+          { yybegin(DECL_ATTR); return XmlTokenType.XML_NAME;
+          }
+        case 90: break;
+        case 37: 
+          { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER;
+          }
+        case 91: break;
+        case 65: 
+          { return XmlTokenType.XML_ATT_IMPLIED;
+          }
+        case 92: break;
+        case 68: 
+          { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_ATTLIST_DECL_START;
+          }
+        case 93: break;
+        case 3: 
+          { return XmlTokenType.XML_DATA_CHARACTERS;
+          }
+        case 94: break;
+        case 6: 
+          { return XmlTokenType.XML_BAD_CHARACTER;
+          }
+        case 95: break;
+        case 15: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_TAG_END;
+          }
+        case 96: break;
+        case 13: 
+          { yybegin(TAG_ATTRIBUTES); return isHighlightModeOn ? XmlTokenType.XML_TAG_NAME:XmlTokenType.XML_NAME;
+          }
+        case 97: break;
+        case 48: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_COMMENT_END;
+          }
+        case 98: break;
+        case 31: 
+          { return XmlTokenType.XML_LEFT_PAREN;
+          }
+        case 99: break;
+        case 62: 
+          { return XmlTokenType.XML_PCDATA;
+          }
+        case 100: break;
+        case 39: 
+          { yybegin(TAG_NAME); return XmlTokenType.XML_END_TAG_START;
+          }
+        case 101: break;
+        case 58: 
+          { return XmlTokenType.XML_ATT_FIXED;
+          }
+        case 102: break;
+        case 44: 
+          { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_COMMENT_END;
+          }
+        case 103: break;
+        case 23: 
+          { yybegin(DOCTYPE); return XmlTokenType.XML_MARKUP_END;
+          }
+        case 104: break;
+        case 43: 
+          { yybegin(DOCTYPE_COMMENT); return XmlTokenType.XML_COMMENT_START;
+          }
+        case 105: break;
+        case 20: 
+          { return XmlTokenType.XML_PI_TARGET;
+          }
+        case 106: break;
+        case 63: 
+          { return XmlTokenType.XML_CONDITIONAL_INCLUDE;
+          }
+        case 107: break;
+        case 41: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_EMPTY_ELEMENT_END;
+          }
+        case 108: break;
+        case 32: 
+          { return XmlTokenType.XML_RIGHT_PAREN;
+          }
+        case 109: break;
+        case 8: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_BAD_CHARACTER;
+          }
+        case 110: break;
+        case 38: 
+          { yybegin(PROCESSING_INSTRUCTION); return XmlTokenType.XML_PI_START;
+          }
+        case 111: break;
+        case 64: 
+          { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_ENTITY_DECL_START;
+          }
+        case 112: break;
+        case 29: 
+          { yybegin(DOCTYPE_MARKUP_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;
+          }
+        case 113: break;
+        case 54: 
+          { return XmlTokenType.XML_CONTENT_EMPTY;
+          }
+        case 114: break;
+        case 33: 
+          { return XmlTokenType.XML_PLUS;
+          }
+        case 115: break;
+        case 30: 
+          { yybegin(DOCTYPE_MARKUP_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;
+          }
+        case 116: break;
+        case 49: 
+          { return XmlTokenType.XML_CONTENT_ANY;
+          }
+        case 117: break;
+        case 22: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_DOCTYPE_END;
+          }
+        case 118: break;
+        case 52: 
+          { return XmlTokenType.XML_CHAR_ENTITY_REF;
+          }
+        case 119: break;
+        case 70: 
+          { return XmlTokenType.XML_ATT_REQUIRED;
+          }
+        case 120: break;
+        case 28: 
+          { return XmlTokenType.XML_QUESTION;
+          }
+        case 121: break;
+        case 57: 
+          { yybegin(DOCTYPE_EXTERNAL_ID); return XmlTokenType.XML_DOCTYPE_SYSTEM;
+          }
+        case 122: break;
+        case 34: 
+          { return XmlTokenType.XML_STAR;
+          }
+        case 123: break;
+        case 40: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_DECL_END;
+          }
+        case 124: break;
+        case 4: 
+          { return XmlTokenType.XML_WHITE_SPACE;
+          }
+        case 125: break;
+        case 47: 
+          { return XmlTokenType.XML_ENTITY_REF_TOKEN;
+          }
+        case 126: break;
+        case 27: 
+          { return XmlTokenType.XML_PERCENT;
+          }
+        case 127: break;
+        case 5: 
+          { yybegin(TAG_NAME); return XmlTokenType.XML_START_TAG_START;
+          }
+        case 128: break;
+        case 46: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_CONDITIONAL_SECTION_END;
+          }
+        case 129: break;
+        case 50: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_CDATA_END;
+          }
+        case 130: break;
+        case 56: 
+          { yybegin(DOCTYPE_EXTERNAL_ID); return XmlTokenType.XML_DOCTYPE_PUBLIC;
+          }
+        case 131: break;
+        case 12: 
+          { yybegin(DECL); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER;
+          }
+        case 132: break;
+        case 25: 
+          { return XmlTokenType.XML_AMP;
+          }
+        case 133: break;
+        case 42: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_PI_END;
+          }
+        case 134: break;
+        case 18: 
+          { yybegin(ATTRIBUTE_VALUE_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;
+          }
+        case 135: break;
+        case 67: 
+          { yybegin(DOCTYPE); return XmlTokenType.XML_DOCTYPE_START;
+          }
+        case 136: break;
+        case 17: 
+          { yybegin(ATTRIBUTE_VALUE_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;
+          }
+        case 137: break;
+        case 71: 
+          { yybegin(DOCTYPE_MARKUP); return XmlTokenType.XML_NOTATION_DECL_START;
+          }
+        case 138: break;
+        case 24: 
+          { return XmlTokenType.XML_TAG_END;
+          }
+        case 139: break;
+        case 35: 
+          { return XmlTokenType.XML_BAR;
+          }
+        case 140: break;
+        case 2: 
+          { return XmlTokenType.XML_COMMENT_CHARACTERS;
+          }
+        case 141: break;
+        case 45: 
+          { yybegin(CONDITIONAL); return XmlTokenType.XML_CONDITIONAL_SECTION_START;
+          }
+        case 142: break;
+        default:
+          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
+            zzAtEOF = true;
+            zzDoEOF();
+            return null;
+          }
+          else {
+            zzScanError(ZZ_NO_MATCH);
+          }
+      }
+    }
+  }
+
+
+}
diff --git a/xml/impl/src/com/intellij/lexer/_HtmlLexer.flex b/xml/impl/src/com/intellij/lexer/_HtmlLexer.flex
new file mode 100644
index 0000000..8def2be
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/_HtmlLexer.flex
@@ -0,0 +1,157 @@
+/* It's an automatically generated code. Do not modify it. */
+package com.intellij.lexer;
+
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.*;
+import com.intellij.psi.xml.*;
+
+%%
+
+%unicode
+
+%{
+  private IElementType elTokenType = XmlTokenType.XML_DATA_CHARACTERS;
+  private IElementType elTokenType2 = XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;
+
+  public void setElTypes(IElementType _elTokenType,IElementType _elTokenType2) {
+    elTokenType = _elTokenType;
+    elTokenType2 = _elTokenType2;
+  }
+
+  public _HtmlLexer() {
+    this((java.io.Reader)null);
+  }
+%}
+
+%class _HtmlLexer
+%public
+%implements FlexLexer,ELHostLexer
+%function advance
+%type IElementType
+%eof{ return;
+%eof}
+
+%state DOC_TYPE
+%state COMMENT
+%state START_TAG_NAME
+%state END_TAG_NAME
+%state TAG_ATTRIBUTES
+%state ATTRIBUTE_VALUE_START
+%state ATTRIBUTE_VALUE_DQ
+%state ATTRIBUTE_VALUE_SQ
+%state PROCESSING_INSTRUCTION
+%state START_TAG_NAME2
+%state END_TAG_NAME2
+%state TAG_CHARACTERS
+%state C_COMMENT_START
+%state C_COMMENT_END
+/* IMPORTANT! number of states should not exceed 16. See JspHighlightingLexer. */
+
+ALPHA=[:letter:]
+DIGIT=[0-9]
+WHITE_SPACE_CHARS=[ \n\r\t\f]+
+
+TAG_NAME=({ALPHA}|"_"|":")({ALPHA}|{DIGIT}|"_"|":"|"."|"-")*
+TAG_NAME_FWT=("#")({ALPHA}|{DIGIT}|"_"|":"|"."|"-")*
+ATTRIBUTE_NAME=({ALPHA}|"_"|":")({ALPHA}|{DIGIT}|"_"|":"|"."|"-")*
+
+DTD_REF= "\"" [^\"]* "\"" | "'" [^']* "'"
+DOCTYPE= "<!" (D|d)(O|o)(C|c)(T|t)(Y|y)(P|p)(E|e)
+HTML= (H|h)(T|t)(M|m)(L|l)
+PUBLIC= (P|p)(U|u)(B|b)(L|l)(I|i)(C|c)
+EL_EMBEDDMENT="${" [^\}]* "}"
+
+END_COMMENT="--"[ \n\r\t\f]*">"
+
+CONDITIONAL_COMMENT_CONDITION=({ALPHA})({ALPHA}|{WHITE_SPACE_CHARS}|{DIGIT}|"."|"("|")"|"|"|"!"|"&")*
+%%
+
+<YYINITIAL> "<?" { yybegin(PROCESSING_INSTRUCTION); return XmlTokenType.XML_PI_START; }
+<PROCESSING_INSTRUCTION> "?"? ">" { yybegin(YYINITIAL); return XmlTokenType.XML_PI_END; }
+<PROCESSING_INSTRUCTION> ([^\?\>] | (\?[^\>]))* { return XmlTokenType.XML_PI_TARGET; }
+
+<YYINITIAL> {DOCTYPE} { yybegin(DOC_TYPE); return XmlTokenType.XML_DOCTYPE_START; }
+<DOC_TYPE> {HTML} { return XmlTokenType.XML_NAME; }
+<DOC_TYPE> {PUBLIC} { return XmlTokenType.XML_DOCTYPE_PUBLIC; }
+<DOC_TYPE> {DTD_REF} { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;}
+<DOC_TYPE> ">" { yybegin(YYINITIAL); return XmlTokenType.XML_DOCTYPE_END; }
+<YYINITIAL> {WHITE_SPACE_CHARS} { return XmlTokenType.XML_REAL_WHITE_SPACE; }
+<DOC_TYPE,TAG_ATTRIBUTES,ATTRIBUTE_VALUE_START,PROCESSING_INSTRUCTION, START_TAG_NAME, END_TAG_NAME, END_TAG_NAME2, TAG_CHARACTERS> {WHITE_SPACE_CHARS} { return XmlTokenType.XML_WHITE_SPACE; }
+<YYINITIAL> "<" {TAG_NAME} { yybegin(START_TAG_NAME); yypushback(yylength()); }
+<YYINITIAL> "<" {TAG_NAME_FWT} { yybegin(START_TAG_NAME2); yypushback(yylength()); }
+<START_TAG_NAME, START_TAG_NAME2, TAG_CHARACTERS> "<" { return XmlTokenType.XML_START_TAG_START; }
+
+<YYINITIAL> "</" {TAG_NAME} { yybegin(END_TAG_NAME); yypushback(yylength()); }
+<YYINITIAL> "</" {TAG_NAME_FWT} { yybegin(END_TAG_NAME2); yypushback(yylength()); }
+<YYINITIAL, END_TAG_NAME, END_TAG_NAME2> "</" { return XmlTokenType.XML_END_TAG_START; }
+
+<YYINITIAL> "<!--" { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_START; }
+<COMMENT> "[" { yybegin(C_COMMENT_START); return XmlTokenType.XML_CONDITIONAL_COMMENT_START; }
+<COMMENT> "<![" { yybegin(C_COMMENT_END); return XmlTokenType.XML_CONDITIONAL_COMMENT_END_START; }
+<COMMENT> {END_COMMENT} { yybegin(YYINITIAL); return XmlTokenType.XML_COMMENT_END; }
+<COMMENT> [^] { return XmlTokenType.XML_COMMENT_CHARACTERS; }
+
+<C_COMMENT_START,C_COMMENT_END> {CONDITIONAL_COMMENT_CONDITION} { return XmlTokenType.XML_COMMENT_CHARACTERS; }
+<C_COMMENT_START> [^] { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_CHARACTERS; }
+<C_COMMENT_START> "]>" { yybegin(COMMENT); return XmlTokenType.XML_CONDITIONAL_COMMENT_START_END; }
+<C_COMMENT_START,C_COMMENT_END> {END_COMMENT} { yybegin(YYINITIAL); return XmlTokenType.XML_COMMENT_END; }
+<C_COMMENT_END> "]" { yybegin(COMMENT); return XmlTokenType.XML_CONDITIONAL_COMMENT_END; }
+<C_COMMENT_END> [^] { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_CHARACTERS; }
+
+<YYINITIAL> \\\$ {
+  return XmlTokenType.XML_DATA_CHARACTERS;
+}
+
+<YYINITIAL> {EL_EMBEDDMENT} {
+  return elTokenType;
+}
+
+<START_TAG_NAME, END_TAG_NAME> {TAG_NAME} { yybegin(TAG_ATTRIBUTES); return XmlTokenType.XML_NAME; }
+<END_TAG_NAME2> {TAG_NAME_FWT} { return XmlTokenType.XML_NAME; }
+<START_TAG_NAME2> {TAG_NAME_FWT} { yybegin(TAG_CHARACTERS); return XmlTokenType.XML_NAME; }
+
+<TAG_ATTRIBUTES, END_TAG_NAME2, TAG_CHARACTERS> ">" { yybegin(YYINITIAL); return XmlTokenType.XML_TAG_END; }
+<TAG_ATTRIBUTES, TAG_CHARACTERS> "/>" { yybegin(YYINITIAL); return XmlTokenType.XML_EMPTY_ELEMENT_END; }
+<TAG_ATTRIBUTES> {ATTRIBUTE_NAME} { return XmlTokenType.XML_NAME; }
+<TAG_ATTRIBUTES> "=" { yybegin(ATTRIBUTE_VALUE_START); return XmlTokenType.XML_EQ; }
+<TAG_ATTRIBUTES,START_TAG_NAME, END_TAG_NAME, END_TAG_NAME2> [^] { yybegin(YYINITIAL); yypushback(1); break; }
+
+<TAG_CHARACTERS> [^] { return XmlTokenType.XML_TAG_CHARACTERS; }
+
+<ATTRIBUTE_VALUE_START> ">" { yybegin(YYINITIAL); return XmlTokenType.XML_TAG_END; }
+<ATTRIBUTE_VALUE_START> "/>" { yybegin(YYINITIAL); return XmlTokenType.XML_EMPTY_ELEMENT_END; }
+ <ATTRIBUTE_VALUE_START> {EL_EMBEDDMENT} {
+  return elTokenType2;
+}
+
+<ATTRIBUTE_VALUE_START> ([^ \n\r\t\f'\"\>]|(\/[^\>]))* { yybegin(TAG_ATTRIBUTES); return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN; }
+<ATTRIBUTE_VALUE_START> "\"" { yybegin(ATTRIBUTE_VALUE_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; }
+<ATTRIBUTE_VALUE_START> "'" { yybegin(ATTRIBUTE_VALUE_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER; }
+
+<ATTRIBUTE_VALUE_DQ> {
+  "\"" { yybegin(TAG_ATTRIBUTES); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER; }
+  \\\$ { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN; }
+  "${" [^\}\"]* "}" { return elTokenType2; }
+  [^] { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;}
+}
+
+<ATTRIBUTE_VALUE_SQ> {
+  "'" { yybegin(TAG_ATTRIBUTES); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER; }
+  \\\$ { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN; }
+  "${" [^\}\']* "}" { return elTokenType2; }
+  [^] { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;}
+}
+
+"&lt;" |
+"&gt;" |
+"&apos;" |
+"&quot;" |
+"&nbsp;" |
+"&amp;" |
+"&#"{DIGIT}+";" |
+"&#x"({DIGIT}|[a-fA-F])+";" { return XmlTokenType.XML_CHAR_ENTITY_REF; }
+"&"{TAG_NAME}";" { return XmlTokenType.XML_ENTITY_REF_TOKEN; }
+
+<YYINITIAL> ([^<&\$# \n\r\t\f]|(\\\$)|(\\#))* { return XmlTokenType.XML_DATA_CHARACTERS; }
+<YYINITIAL> [^] { return XmlTokenType.XML_DATA_CHARACTERS; }
+[^] { return XmlTokenType.XML_BAD_CHARACTER; }
diff --git a/xml/impl/src/com/intellij/lexer/_HtmlLexer.java b/xml/impl/src/com/intellij/lexer/_HtmlLexer.java
new file mode 100644
index 0000000..e35b5b9
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/_HtmlLexer.java
@@ -0,0 +1,834 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/* The following code was generated by JFlex 1.4.1 on 01.06.09 13:59 */
+
+/* It's an automatically generated code. Do not modify it. */
+package com.intellij.lexer;
+
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlTokenType;
+
+
+/**
+ * This class is a scanner generated by 
+ * <a href="http://www.jflex.de/">JFlex</a> 1.4.1
+ * on 01.06.09 13:59 from the specification file
+ * <tt>C:/Trunk/tools/lexer/_HtmlLexer.flex</tt>
+ */
+public class _HtmlLexer implements FlexLexer {
+  /** initial size of the lookahead buffer */
+  private static final int ZZ_BUFFERSIZE = 16384;
+
+  /** lexical states */
+  public static final int PROCESSING_INSTRUCTION = 9;
+  public static final int C_COMMENT_END = 14;
+  public static final int END_TAG_NAME = 4;
+  public static final int START_TAG_NAME = 3;
+  public static final int ATTRIBUTE_VALUE_SQ = 8;
+  public static final int DOC_TYPE = 1;
+  public static final int ATTRIBUTE_VALUE_DQ = 7;
+  public static final int YYINITIAL = 0;
+  public static final int TAG_CHARACTERS = 12;
+  public static final int START_TAG_NAME2 = 10;
+  public static final int TAG_ATTRIBUTES = 5;
+  public static final int COMMENT = 2;
+  public static final int ATTRIBUTE_VALUE_START = 6;
+  public static final int C_COMMENT_START = 13;
+  public static final int END_TAG_NAME2 = 11;
+
+  /** 
+   * Translates characters to character classes
+   */
+  private static final String ZZ_CMAP_PACKED = 
+    "\11\0\2\3\1\0\2\3\22\0\1\3\1\13\1\10\1\7\1\40"+
+    "\1\0\1\45\1\11\1\44\1\44\3\0\1\6\1\5\1\47\12\2"+
+    "\1\4\1\54\1\12\1\53\1\43\1\46\1\0\1\63\1\35\1\17"+
+    "\1\14\1\25\1\63\1\1\1\26\1\37\2\1\1\31\1\27\1\1"+
+    "\1\15\1\23\3\1\1\20\1\33\3\1\1\22\1\1\1\50\1\52"+
+    "\1\51\1\0\1\4\1\0\1\56\1\36\1\17\1\14\1\25\1\63"+
+    "\1\55\1\26\1\37\2\1\1\32\1\30\1\61\1\16\1\24\1\60"+
+    "\1\1\1\57\1\21\1\34\2\1\1\62\1\22\1\1\1\41\1\44"+
+    "\1\42\54\0\1\1\12\0\1\1\4\0\1\1\5\0\27\1\1\0"+
+    "\37\1\1\0\u013f\1\31\0\162\1\4\0\14\1\16\0\5\1\11\0"+
+    "\1\1\213\0\1\1\13\0\1\1\1\0\3\1\1\0\1\1\1\0"+
+    "\24\1\1\0\54\1\1\0\46\1\1\0\5\1\4\0\202\1\10\0"+
+    "\105\1\1\0\46\1\2\0\2\1\6\0\20\1\41\0\46\1\2\0"+
+    "\1\1\7\0\47\1\110\0\33\1\5\0\3\1\56\0\32\1\5\0"+
+    "\13\1\43\0\2\1\1\0\143\1\1\0\1\1\17\0\2\1\7\0"+
+    "\2\1\12\0\3\1\2\0\1\1\20\0\1\1\1\0\36\1\35\0"+
+    "\3\1\60\0\46\1\13\0\1\1\u0152\0\66\1\3\0\1\1\22\0"+
+    "\1\1\7\0\12\1\43\0\10\1\2\0\2\1\2\0\26\1\1\0"+
+    "\7\1\1\0\1\1\3\0\4\1\3\0\1\1\36\0\2\1\1\0"+
+    "\3\1\16\0\2\1\23\0\6\1\4\0\2\1\2\0\26\1\1\0"+
+    "\7\1\1\0\2\1\1\0\2\1\1\0\2\1\37\0\4\1\1\0"+
+    "\1\1\23\0\3\1\20\0\11\1\1\0\3\1\1\0\26\1\1\0"+
+    "\7\1\1\0\2\1\1\0\5\1\3\0\1\1\22\0\1\1\17\0"+
+    "\2\1\43\0\10\1\2\0\2\1\2\0\26\1\1\0\7\1\1\0"+
+    "\2\1\1\0\5\1\3\0\1\1\36\0\2\1\1\0\3\1\17\0"+
+    "\1\1\21\0\1\1\1\0\6\1\3\0\3\1\1\0\4\1\3\0"+
+    "\2\1\1\0\1\1\1\0\2\1\3\0\2\1\3\0\3\1\3\0"+
+    "\10\1\1\0\3\1\113\0\10\1\1\0\3\1\1\0\27\1\1\0"+
+    "\12\1\1\0\5\1\46\0\2\1\43\0\10\1\1\0\3\1\1\0"+
+    "\27\1\1\0\12\1\1\0\5\1\3\0\1\1\40\0\1\1\1\0"+
+    "\2\1\43\0\10\1\1\0\3\1\1\0\27\1\1\0\20\1\46\0"+
+    "\2\1\43\0\22\1\3\0\30\1\1\0\11\1\1\0\1\1\2\0"+
+    "\7\1\72\0\60\1\1\0\2\1\14\0\7\1\72\0\2\1\1\0"+
+    "\1\1\2\0\2\1\1\0\1\1\2\0\1\1\6\0\4\1\1\0"+
+    "\7\1\1\0\3\1\1\0\1\1\1\0\1\1\2\0\2\1\1\0"+
+    "\4\1\1\0\2\1\11\0\1\1\2\0\5\1\1\0\1\1\25\0"+
+    "\2\1\42\0\1\1\77\0\10\1\1\0\42\1\35\0\4\1\164\0"+
+    "\42\1\1\0\5\1\1\0\2\1\45\0\6\1\112\0\46\1\12\0"+
+    "\51\1\7\0\132\1\5\0\104\1\5\0\122\1\6\0\7\1\1\0"+
+    "\77\1\1\0\1\1\1\0\4\1\2\0\7\1\1\0\1\1\1\0"+
+    "\4\1\2\0\47\1\1\0\1\1\1\0\4\1\2\0\37\1\1\0"+
+    "\1\1\1\0\4\1\2\0\7\1\1\0\1\1\1\0\4\1\2\0"+
+    "\7\1\1\0\7\1\1\0\27\1\1\0\37\1\1\0\1\1\1\0"+
+    "\4\1\2\0\7\1\1\0\47\1\1\0\23\1\105\0\125\1\14\0"+
+    "\u026c\1\2\0\10\1\12\0\32\1\5\0\113\1\25\0\15\1\1\0"+
+    "\4\1\16\0\22\1\16\0\22\1\16\0\15\1\1\0\3\1\17\0"+
+    "\64\1\43\0\1\1\4\0\1\1\103\0\130\1\10\0\51\1\127\0"+
+    "\35\1\63\0\36\1\2\0\5\1\u038b\0\154\1\224\0\234\1\4\0"+
+    "\132\1\6\0\26\1\2\0\6\1\2\0\46\1\2\0\6\1\2\0"+
+    "\10\1\1\0\1\1\1\0\1\1\1\0\1\1\1\0\37\1\2\0"+
+    "\65\1\1\0\7\1\1\0\1\1\3\0\3\1\1\0\7\1\3\0"+
+    "\4\1\2\0\6\1\4\0\15\1\5\0\3\1\1\0\7\1\164\0"+
+    "\1\1\15\0\1\1\202\0\1\1\4\0\1\1\2\0\12\1\1\0"+
+    "\1\1\3\0\5\1\6\0\1\1\1\0\1\1\1\0\1\1\1\0"+
+    "\4\1\1\0\3\1\1\0\7\1\3\0\3\1\5\0\5\1\u0ebb\0"+
+    "\2\1\52\0\5\1\5\0\2\1\4\0\126\1\6\0\3\1\1\0"+
+    "\132\1\1\0\4\1\5\0\50\1\4\0\136\1\21\0\30\1\70\0"+
+    "\20\1\u0200\0\u19b6\1\112\0\u51a6\1\132\0\u048d\1\u0773\0\u2ba4\1\u215c\0"+
+    "\u012e\1\2\0\73\1\225\0\7\1\14\0\5\1\5\0\1\1\1\0"+
+    "\12\1\1\0\15\1\1\0\5\1\1\0\1\1\1\0\2\1\1\0"+
+    "\2\1\1\0\154\1\41\0\u016b\1\22\0\100\1\2\0\66\1\50\0"+
+    "\14\1\164\0\5\1\1\0\207\1\44\0\32\1\6\0\32\1\13\0"+
+    "\131\1\3\0\6\1\2\0\6\1\2\0\6\1\2\0\3\1\43\0";
+
+  /** 
+   * Translates characters to character classes
+   */
+  private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
+
+  /** 
+   * Translates DFA states to action switch labels.
+   */
+  private static final int [] ZZ_ACTION = zzUnpackAction();
+
+  private static final String ZZ_ACTION_PACKED_0 =
+    "\1\1\5\0\1\2\2\0\1\3\5\0\1\1\1\4"+
+    "\5\1\1\5\1\6\4\5\1\7\1\5\4\10\1\11"+
+    "\1\12\1\13\1\14\2\12\1\15\1\16\1\12\1\17"+
+    "\1\2\1\20\1\21\2\2\1\22\1\23\4\22\1\3"+
+    "\1\24\1\5\1\25\3\26\1\27\1\10\3\27\1\30"+
+    "\1\31\1\32\1\0\1\33\1\34\15\0\1\34\1\35"+
+    "\2\2\3\0\1\36\2\0\1\37\1\40\1\41\1\42"+
+    "\11\0\1\43\1\44\1\0\1\45\1\2\1\45\1\46"+
+    "\1\0\1\47\3\0\1\15\3\0\1\50\2\0\1\51";
+
+  private static int [] zzUnpackAction() {
+    int [] result = new int[129];
+    int offset = 0;
+    offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackAction(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+
+  /** 
+   * Translates a state to a row index in the transition table
+   */
+  private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
+
+  private static final String ZZ_ROWMAP_PACKED_0 =
+    "\0\0\0\64\0\150\0\234\0\320\0\u0104\0\u0138\0\u016c"+
+    "\0\u01a0\0\u01d4\0\u0208\0\u023c\0\u0270\0\u02a4\0\u02d8\0\u030c"+
+    "\0\u0340\0\u0374\0\u03a8\0\u03dc\0\u0410\0\u0444\0\u0374\0\u0478"+
+    "\0\u04ac\0\u04e0\0\u0514\0\u0548\0\u0374\0\u0410\0\u0374\0\u057c"+
+    "\0\u05b0\0\u0410\0\u0374\0\u0374\0\u05e4\0\u0374\0\u0410\0\u0618"+
+    "\0\u064c\0\u0374\0\u0680\0\u0374\0\u06b4\0\u0374\0\u0374\0\u06e8"+
+    "\0\u071c\0\u0374\0\u0374\0\u0750\0\u0410\0\u0784\0\u07b8\0\u07ec"+
+    "\0\u0374\0\u0820\0\u0854\0\u0374\0\u0410\0\u0680\0\u0374\0\u0888"+
+    "\0\u057c\0\u0410\0\u08bc\0\u0374\0\u08f0\0\u0924\0\u0958\0\u0374"+
+    "\0\u098c\0\u09c0\0\u09f4\0\u0a28\0\u0a5c\0\u0a90\0\u0ac4\0\u0af8"+
+    "\0\u04ac\0\u04e0\0\u0b2c\0\u0b60\0\u0b94\0\u0bc8\0\u0374\0\u0374"+
+    "\0\u0bfc\0\u0c30\0\u0c64\0\u0c98\0\u0ccc\0\u0374\0\u0d00\0\u0d34"+
+    "\0\u0d68\0\u0d9c\0\u0374\0\u0374\0\u0dd0\0\u0e04\0\u0e38\0\u0e6c"+
+    "\0\u0ea0\0\u0ed4\0\u0f08\0\u0f3c\0\u0f70\0\u0374\0\u0374\0\u0fa4"+
+    "\0\u06b4\0\u0fd8\0\u0374\0\u0374\0\u100c\0\u0374\0\u1040\0\u1074"+
+    "\0\u10a8\0\u0374\0\u10dc\0\u1110\0\u1144\0\u0374\0\u1178\0\u11ac"+
+    "\0\u0374";
+
+  private static int [] zzUnpackRowMap() {
+    int [] result = new int[129];
+    int offset = 0;
+    offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackRowMap(String packed, int offset, int [] result) {
+    int i = 0;  /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int high = packed.charAt(i++) << 16;
+      result[j++] = high | packed.charAt(i++);
+    }
+    return j;
+  }
+
+  /** 
+   * The transition table of the DFA
+   */
+  private static final int [] ZZ_TRANS = zzUnpackTrans();
+
+  private static final String ZZ_TRANS_PACKED_0 =
+    "\3\20\1\21\3\20\1\22\2\20\1\23\25\20\1\24"+
+    "\4\20\1\25\4\20\1\26\11\20\3\27\1\30\4\27"+
+    "\1\31\1\32\11\27\2\33\1\27\1\34\14\27\1\35"+
+    "\1\27\1\36\16\27\6\37\1\40\3\37\1\41\32\37"+
+    "\1\42\2\37\1\43\13\37\1\44\1\45\1\44\1\30"+
+    "\1\45\5\44\1\46\1\44\24\45\5\44\1\47\7\44"+
+    "\7\45\1\44\1\45\1\44\1\30\1\45\5\44\1\50"+
+    "\1\44\24\45\5\44\1\47\7\44\7\45\1\44\1\51"+
+    "\1\44\1\30\1\51\7\44\24\51\3\44\1\52\1\44"+
+    "\1\47\1\44\1\53\3\44\1\54\1\44\7\51\3\55"+
+    "\1\30\4\55\1\56\1\57\26\55\1\60\2\55\1\52"+
+    "\3\55\1\61\14\55\10\62\1\63\27\62\1\64\4\62"+
+    "\1\65\4\62\1\66\22\62\1\63\26\62\1\67\4\62"+
+    "\1\65\4\62\1\66\11\62\43\70\1\71\2\70\1\72"+
+    "\15\70\7\27\1\73\2\27\1\46\32\27\1\36\16\27"+
+    "\3\44\1\30\3\44\1\51\2\44\1\50\30\44\1\52"+
+    "\1\44\1\47\16\44\3\74\1\30\6\74\1\46\30\74"+
+    "\1\52\1\74\1\75\1\74\1\76\14\74\1\77\1\100"+
+    "\4\77\1\101\5\77\24\100\5\77\1\102\3\77\1\103"+
+    "\3\77\7\100\1\77\1\100\4\77\1\101\5\77\24\100"+
+    "\5\77\1\102\3\77\1\104\3\77\7\100\3\20\1\0"+
+    "\3\20\1\0\2\20\1\0\25\20\1\0\4\20\1\0"+
+    "\4\20\1\26\11\20\3\0\1\21\145\0\1\105\2\0"+
+    "\1\105\2\0\1\106\3\0\1\107\24\105\6\0\1\110"+
+    "\1\111\5\0\7\105\41\0\1\112\23\0\1\113\2\0"+
+    "\1\113\2\0\1\114\4\0\16\113\1\115\5\113\15\0"+
+    "\1\115\1\116\1\113\1\117\1\120\2\113\3\20\1\0"+
+    "\6\20\1\0\32\20\1\0\4\20\1\26\11\20\3\0"+
+    "\1\30\60\0\10\121\1\62\53\121\11\122\1\62\52\122"+
+    "\33\0\2\123\47\0\2\124\50\0\1\125\70\0\1\126"+
+    "\51\0\2\45\1\0\3\45\5\0\24\45\15\0\7\45"+
+    "\47\0\1\127\15\0\2\51\1\0\3\51\5\0\24\51"+
+    "\15\0\7\51\43\0\1\130\20\0\3\55\1\0\4\55"+
+    "\2\0\31\55\1\0\3\55\1\131\17\55\1\0\4\55"+
+    "\2\0\27\55\1\132\1\55\1\0\3\55\1\131\57\55"+
+    "\1\130\3\55\1\131\14\55\41\0\1\133\62\0\1\62"+
+    "\64\0\1\134\22\0\43\70\1\0\2\70\1\135\60\70"+
+    "\1\71\20\70\1\0\2\73\1\0\3\73\5\0\24\73"+
+    "\15\0\7\73\1\0\3\100\1\0\1\100\5\0\25\100"+
+    "\4\0\2\100\7\0\7\100\43\0\1\136\21\0\2\105"+
+    "\1\0\3\105\5\0\24\105\15\0\7\105\1\0\2\106"+
+    "\1\0\3\106\5\0\24\106\15\0\7\106\6\0\1\137"+
+    "\5\0\1\140\50\0\1\141\2\0\1\141\2\0\1\142"+
+    "\4\0\24\141\15\0\7\141\42\112\1\143\21\112\1\0"+
+    "\2\113\1\0\3\113\5\0\24\113\14\0\1\144\7\113"+
+    "\2\0\1\145\57\0\1\146\2\0\2\113\1\0\3\113"+
+    "\5\0\5\113\1\147\16\113\14\0\1\144\7\113\1\0"+
+    "\2\113\1\0\3\113\5\0\10\113\1\150\3\113\1\151"+
+    "\7\113\14\0\1\144\7\113\1\0\2\113\1\0\3\113"+
+    "\5\0\20\113\1\152\3\113\14\0\1\144\7\113\1\0"+
+    "\2\113\1\0\3\113\5\0\22\113\1\153\1\113\14\0"+
+    "\1\144\7\113\35\0\2\154\54\0\2\155\36\0\1\125"+
+    "\37\0\1\156\70\0\1\157\13\0\43\55\1\0\3\55"+
+    "\1\131\14\55\3\132\1\160\4\132\2\160\30\132\1\161"+
+    "\1\160\3\132\1\162\14\132\10\133\1\0\31\133\1\163"+
+    "\21\133\11\134\1\0\30\134\1\163\21\134\43\70\1\0"+
+    "\20\70\6\0\1\164\72\0\2\165\46\0\2\141\1\0"+
+    "\3\141\5\0\24\141\15\0\7\141\1\0\2\142\1\0"+
+    "\3\142\5\0\24\142\15\0\7\142\2\0\1\145\51\0"+
+    "\1\166\11\0\1\167\11\0\1\167\2\0\1\167\5\0"+
+    "\1\167\7\0\2\167\17\0\1\167\4\0\1\167\1\0"+
+    "\2\113\1\0\3\113\5\0\24\113\14\0\1\166\7\113"+
+    "\1\0\2\113\1\0\3\113\5\0\2\113\1\170\21\113"+
+    "\14\0\1\144\7\113\1\0\2\113\1\0\3\113\5\0"+
+    "\10\113\1\147\13\113\14\0\1\144\7\113\1\0\2\113"+
+    "\1\0\3\113\5\0\2\113\1\115\21\113\14\0\1\144"+
+    "\7\113\1\0\2\113\1\0\3\113\5\0\24\113\14\0"+
+    "\1\144\2\113\1\151\4\113\31\0\2\171\62\0\2\172"+
+    "\31\0\42\160\1\163\21\160\42\132\1\161\1\160\3\132"+
+    "\1\162\14\132\17\0\1\173\46\0\1\167\11\0\1\167"+
+    "\2\0\1\167\5\0\1\167\7\0\2\167\15\0\1\166"+
+    "\1\0\1\167\4\0\1\167\1\0\2\113\1\0\3\113"+
+    "\5\0\24\113\14\0\1\144\2\113\1\147\4\113\37\0"+
+    "\1\174\44\0\2\175\61\0\1\176\66\0\1\177\64\0"+
+    "\2\200\64\0\1\201\36\0";
+
+  private static int [] zzUnpackTrans() {
+    int [] result = new int[4576];
+    int offset = 0;
+    offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackTrans(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      value--;
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+
+  /* error codes */
+  private static final int ZZ_UNKNOWN_ERROR = 0;
+  private static final int ZZ_NO_MATCH = 1;
+  private static final int ZZ_PUSHBACK_2BIG = 2;
+  private static final char[] EMPTY_BUFFER = new char[0];
+  private static final int YYEOF = -1;
+  private static java.io.Reader zzReader = null; // Fake
+
+  /* error messages for the codes above */
+  private static final String ZZ_ERROR_MSG[] = {
+    "Unkown internal scanner error",
+    "Error: could not match input",
+    "Error: pushback value was too large"
+  };
+
+  /**
+   * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
+   */
+  private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
+
+  private static final String ZZ_ATTRIBUTE_PACKED_0 =
+    "\1\1\5\0\1\1\2\0\1\1\5\0\2\1\1\11"+
+    "\4\1\1\11\5\1\1\11\1\1\1\11\3\1\2\11"+
+    "\1\1\1\11\3\1\1\11\1\1\1\11\1\1\2\11"+
+    "\2\1\2\11\5\1\1\11\2\1\1\11\2\1\1\11"+
+    "\4\1\1\11\2\1\1\0\1\11\1\1\15\0\2\11"+
+    "\2\1\3\0\1\11\2\0\2\1\2\11\11\0\2\11"+
+    "\1\0\2\1\2\11\1\0\1\11\3\0\1\11\3\0"+
+    "\1\11\2\0\1\11";
+
+  private static int [] zzUnpackAttribute() {
+    int [] result = new int[129];
+    int offset = 0;
+    offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackAttribute(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+  /** the current state of the DFA */
+  private int zzState;
+
+  /** the current lexical state */
+  private int zzLexicalState = YYINITIAL;
+
+  /** this buffer contains the current text to be matched and is
+      the source of the yytext() string */
+  private CharSequence zzBuffer = "";
+
+  /** this buffer may contains the current text array to be matched when it is cheap to acquire it */
+  private char[] zzBufferArray;
+
+  /** the textposition at the last accepting state */
+  private int zzMarkedPos;
+
+  /** the textposition at the last state to be included in yytext */
+  private int zzPushbackPos;
+
+  /** the current text position in the buffer */
+  private int zzCurrentPos;
+
+  /** startRead marks the beginning of the yytext() string in the buffer */
+  private int zzStartRead;
+
+  /** endRead marks the last character in the buffer, that has been read
+      from input */
+  private int zzEndRead;
+
+  /**
+   * zzAtBOL == true <=> the scanner is currently at the beginning of a line
+   */
+  private boolean zzAtBOL = true;
+
+  /** zzAtEOF == true <=> the scanner is at the EOF */
+  private boolean zzAtEOF;
+
+  /** denotes if the user-EOF-code has already been executed */
+  private boolean zzEOFDone;
+
+  /* user code: */
+  private IElementType elTokenType = XmlTokenType.XML_DATA_CHARACTERS;
+  private IElementType elTokenType2 = XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;
+
+  public void setElTypes(IElementType _elTokenType,IElementType _elTokenType2) {
+    elTokenType = _elTokenType;
+    elTokenType2 = _elTokenType2;
+  }
+
+  public _HtmlLexer() {
+    this((java.io.Reader)null);
+  }
+
+
+  public _HtmlLexer(java.io.Reader in) {
+    this.zzReader = in;
+  }
+
+  /**
+   * Creates a new scanner.
+   * There is also java.io.Reader version of this constructor.
+   *
+   * @param   in  the java.io.Inputstream to read input from.
+   */
+  public _HtmlLexer(java.io.InputStream in) {
+    this(new java.io.InputStreamReader(in));
+  }
+
+  /** 
+   * Unpacks the compressed character translation table.
+   *
+   * @param packed   the packed character translation table
+   * @return         the unpacked character translation table
+   */
+  private static char [] zzUnpackCMap(String packed) {
+    char [] map = new char[0x10000];
+    int i = 0;  /* index in packed string  */
+    int j = 0;  /* index in unpacked array */
+    while (i < 1260) {
+      int  count = packed.charAt(i++);
+      char value = packed.charAt(i++);
+      do map[j++] = value; while (--count > 0);
+    }
+    return map;
+  }
+
+  public final int getTokenStart(){
+    return zzStartRead;
+  }
+
+  public final int getTokenEnd(){
+    return getTokenStart() + yylength();
+  }
+
+  public void reset(CharSequence buffer, int start, int end,int initialState){
+    zzBuffer = buffer;
+    zzBufferArray = com.intellij.util.text.CharArrayUtil.fromSequenceWithoutCopying(buffer);
+    zzCurrentPos = zzMarkedPos = zzStartRead = start;
+    zzPushbackPos = 0;
+    zzAtEOF  = false;
+    zzAtBOL = true;
+    zzEndRead = end;
+    yybegin(initialState);
+  }
+
+  /**
+   * Refills the input buffer.
+   *
+   * @return      <code>false</code>, iff there was new input.
+   *
+   * @exception   java.io.IOException  if any I/O-Error occurs
+   */
+  private boolean zzRefill() throws java.io.IOException {
+    return true;
+  }
+
+
+  /**
+   * Returns the current lexical state.
+   */
+  public final int yystate() {
+    return zzLexicalState;
+  }
+
+
+  /**
+   * Enters a new lexical state
+   *
+   * @param newState the new lexical state
+   */
+  public final void yybegin(int newState) {
+    zzLexicalState = newState;
+  }
+
+
+  /**
+   * Returns the text matched by the current regular expression.
+   */
+  public final CharSequence yytext() {
+    return zzBuffer.subSequence(zzStartRead, zzMarkedPos);
+  }
+
+
+  /**
+   * Returns the character at position <tt>pos</tt> from the
+   * matched text.
+   *
+   * It is equivalent to yytext().charAt(pos), but faster
+   *
+   * @param pos the position of the character to fetch.
+   *            A value from 0 to yylength()-1.
+   *
+   * @return the character at position pos
+   */
+  public final char yycharat(int pos) {
+    return zzBufferArray != null ? zzBufferArray[zzStartRead+pos]:zzBuffer.charAt(zzStartRead+pos);
+  }
+
+
+  /**
+   * Returns the length of the matched text region.
+   */
+  public final int yylength() {
+    return zzMarkedPos-zzStartRead;
+  }
+
+
+  /**
+   * Reports an error that occured while scanning.
+   *
+   * In a wellformed scanner (no or only correct usage of
+   * yypushback(int) and a match-all fallback rule) this method
+   * will only be called with things that "Can't Possibly Happen".
+   * If this method is called, something is seriously wrong
+   * (e.g. a JFlex bug producing a faulty scanner etc.).
+   *
+   * Usual syntax/scanner level error handling should be done
+   * in error fallback rules.
+   *
+   * @param   errorCode  the code of the errormessage to display
+   */
+  private void zzScanError(int errorCode) {
+    String message;
+    try {
+      message = ZZ_ERROR_MSG[errorCode];
+    }
+    catch (ArrayIndexOutOfBoundsException e) {
+      message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
+    }
+
+    throw new Error(message);
+  }
+
+
+  /**
+   * Pushes the specified amount of characters back into the input stream.
+   *
+   * They will be read again by then next call of the scanning method
+   *
+   * @param number  the number of characters to be read again.
+   *                This number must not be greater than yylength()!
+   */
+  public void yypushback(int number)  {
+    if ( number > yylength() )
+      zzScanError(ZZ_PUSHBACK_2BIG);
+
+    zzMarkedPos -= number;
+  }
+
+
+  /**
+   * Contains user EOF-code, which will be executed exactly once,
+   * when the end of file is reached
+   */
+  private void zzDoEOF() {
+    if (!zzEOFDone) {
+      zzEOFDone = true;
+    
+    }
+  }
+
+
+  /**
+   * Resumes scanning until the next regular expression is matched,
+   * the end of input is encountered or an I/O-Error occurs.
+   *
+   * @return      the next token
+   * @exception   java.io.IOException  if any I/O-Error occurs
+   */
+  public IElementType advance() throws java.io.IOException {
+    int zzInput;
+    int zzAction;
+
+    // cached fields:
+    int zzCurrentPosL;
+    int zzMarkedPosL;
+    int zzEndReadL = zzEndRead;
+    CharSequence zzBufferL = zzBuffer;
+    char[] zzBufferArrayL = zzBufferArray;
+    char [] zzCMapL = ZZ_CMAP;
+
+    int [] zzTransL = ZZ_TRANS;
+    int [] zzRowMapL = ZZ_ROWMAP;
+    int [] zzAttrL = ZZ_ATTRIBUTE;
+
+    while (true) {
+      zzMarkedPosL = zzMarkedPos;
+
+      zzAction = -1;
+
+      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
+
+      zzState = zzLexicalState;
+
+
+      zzForAction: {
+        while (true) {
+
+          if (zzCurrentPosL < zzEndReadL)
+            zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++);
+          else if (zzAtEOF) {
+            zzInput = YYEOF;
+            break zzForAction;
+          }
+          else {
+            // store back cached positions
+            zzCurrentPos  = zzCurrentPosL;
+            zzMarkedPos   = zzMarkedPosL;
+            boolean eof = zzRefill();
+            // get translated positions and possibly new buffer
+            zzCurrentPosL  = zzCurrentPos;
+            zzMarkedPosL   = zzMarkedPos;
+            zzBufferL      = zzBuffer;
+            zzEndReadL     = zzEndRead;
+            if (eof) {
+              zzInput = YYEOF;
+              break zzForAction;
+            }
+            else {
+              zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++);
+            }
+          }
+          int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
+          if (zzNext == -1) break zzForAction;
+          zzState = zzNext;
+
+          int zzAttributes = zzAttrL[zzState];
+          if ( (zzAttributes & 1) == 1 ) {
+            zzAction = zzState;
+            zzMarkedPosL = zzCurrentPosL;
+            if ( (zzAttributes & 8) == 8 ) break zzForAction;
+          }
+
+        }
+      }
+
+      // store back cached position
+      zzMarkedPos = zzMarkedPosL;
+
+      switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
+        case 18: 
+          { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;
+          }
+        case 42: break;
+        case 25: 
+          { yybegin(START_TAG_NAME); yypushback(yylength());
+          }
+        case 43: break;
+        case 22: 
+          { return XmlTokenType.XML_TAG_CHARACTERS;
+          }
+        case 44: break;
+        case 15: 
+          { yybegin(ATTRIBUTE_VALUE_START); return XmlTokenType.XML_EQ;
+          }
+        case 45: break;
+        case 33: 
+          { return elTokenType;
+          }
+        case 46: break;
+        case 13: 
+          { return XmlTokenType.XML_NAME;
+          }
+        case 47: break;
+        case 19: 
+          { yybegin(TAG_ATTRIBUTES); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER;
+          }
+        case 48: break;
+        case 10: 
+          { yybegin(YYINITIAL); yypushback(1); break;
+          }
+        case 49: break;
+        case 40: 
+          { return XmlTokenType.XML_DOCTYPE_PUBLIC;
+          }
+        case 50: break;
+        case 38: 
+          { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_START;
+          }
+        case 51: break;
+        case 4: 
+          { return XmlTokenType.XML_REAL_WHITE_SPACE;
+          }
+        case 52: break;
+        case 31: 
+          { yybegin(END_TAG_NAME); yypushback(yylength());
+          }
+        case 53: break;
+        case 1: 
+          { return XmlTokenType.XML_DATA_CHARACTERS;
+          }
+        case 54: break;
+        case 24: 
+          { yybegin(COMMENT); return XmlTokenType.XML_CONDITIONAL_COMMENT_END;
+          }
+        case 55: break;
+        case 32: 
+          { yybegin(END_TAG_NAME2); yypushback(yylength());
+          }
+        case 56: break;
+        case 5: 
+          { return XmlTokenType.XML_BAD_CHARACTER;
+          }
+        case 57: break;
+        case 14: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_TAG_END;
+          }
+        case 58: break;
+        case 30: 
+          { yybegin(COMMENT); return XmlTokenType.XML_CONDITIONAL_COMMENT_START_END;
+          }
+        case 59: break;
+        case 28: 
+          { return XmlTokenType.XML_END_TAG_START;
+          }
+        case 60: break;
+        case 35: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_COMMENT_END;
+          }
+        case 61: break;
+        case 41: 
+          { yybegin(DOC_TYPE); return XmlTokenType.XML_DOCTYPE_START;
+          }
+        case 62: break;
+        case 3: 
+          { return XmlTokenType.XML_PI_TARGET;
+          }
+        case 63: break;
+        case 29: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_EMPTY_ELEMENT_END;
+          }
+        case 64: break;
+        case 36: 
+          { yybegin(C_COMMENT_END); return XmlTokenType.XML_CONDITIONAL_COMMENT_END_START;
+          }
+        case 65: break;
+        case 27: 
+          { yybegin(PROCESSING_INSTRUCTION); return XmlTokenType.XML_PI_START;
+          }
+        case 66: break;
+        case 9: 
+          { yybegin(C_COMMENT_START); return XmlTokenType.XML_CONDITIONAL_COMMENT_START;
+          }
+        case 67: break;
+        case 21: 
+          { yybegin(TAG_CHARACTERS); return XmlTokenType.XML_NAME;
+          }
+        case 68: break;
+        case 7: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_DOCTYPE_END;
+          }
+        case 69: break;
+        case 39: 
+          { return XmlTokenType.XML_CHAR_ENTITY_REF;
+          }
+        case 70: break;
+        case 12: 
+          { return XmlTokenType.XML_START_TAG_START;
+          }
+        case 71: break;
+        case 6: 
+          { return XmlTokenType.XML_WHITE_SPACE;
+          }
+        case 72: break;
+        case 34: 
+          { return XmlTokenType.XML_ENTITY_REF_TOKEN;
+          }
+        case 73: break;
+        case 23: 
+          { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_CHARACTERS;
+          }
+        case 74: break;
+        case 37: 
+          { return elTokenType2;
+          }
+        case 75: break;
+        case 20: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_PI_END;
+          }
+        case 76: break;
+        case 16: 
+          { yybegin(ATTRIBUTE_VALUE_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;
+          }
+        case 77: break;
+        case 17: 
+          { yybegin(ATTRIBUTE_VALUE_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;
+          }
+        case 78: break;
+        case 11: 
+          { yybegin(TAG_ATTRIBUTES); return XmlTokenType.XML_NAME;
+          }
+        case 79: break;
+        case 26: 
+          { yybegin(START_TAG_NAME2); yypushback(yylength());
+          }
+        case 80: break;
+        case 2: 
+          { yybegin(TAG_ATTRIBUTES); return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;
+          }
+        case 81: break;
+        case 8: 
+          { return XmlTokenType.XML_COMMENT_CHARACTERS;
+          }
+        case 82: break;
+        default:
+          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
+            zzAtEOF = true;
+            zzDoEOF();
+            return null;
+          }
+          else {
+            zzScanError(ZZ_NO_MATCH);
+          }
+      }
+    }
+  }
+
+
+}
diff --git a/xml/impl/src/com/intellij/lexer/_XmlLexer.flex b/xml/impl/src/com/intellij/lexer/_XmlLexer.flex
new file mode 100644
index 0000000..7715b96
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/_XmlLexer.flex
@@ -0,0 +1,178 @@
+ /* It's an automatically generated code. Do not modify it. */
+package com.intellij.lexer;
+
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.*;
+import com.intellij.psi.xml.*;
+
+%%
+
+%{
+  private IElementType elTokenType = XmlTokenType.XML_DATA_CHARACTERS;
+  private IElementType elTokenType2 = XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;
+  private IElementType javaEmbeddedTokenType = XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;
+  private boolean myConditionalCommentsSupport;
+
+  public void setConditionalCommentsSupport(final boolean b) {
+    myConditionalCommentsSupport = b;
+  }
+
+  public void setElTypes(IElementType _elTokenType,IElementType _elTokenType2) {
+    elTokenType = _elTokenType;
+    elTokenType2 = _elTokenType2;
+  }
+
+  public void setJavaEmbeddedType(IElementType _tokenType) {
+    javaEmbeddedTokenType = _tokenType;
+  }
+
+  private int myPrevState = YYINITIAL;
+
+  public int yyprevstate() {
+    return myPrevState;
+  }
+
+  private int popState(){
+    final int prev = myPrevState;
+    myPrevState = YYINITIAL;
+    return prev;
+  }
+
+  protected void pushState(int state){
+    myPrevState = state;
+  }
+%}
+
+%unicode
+%class __XmlLexer
+%public
+%implements FlexLexer
+%function advance
+%type IElementType
+%eof{  return;
+%eof}
+
+%state TAG
+%state PROCESSING_INSTRUCTION
+%state PI_ANY
+%state END_TAG
+%xstate COMMENT
+%state ATTR_LIST
+%state ATTR
+%state ATTR_VALUE_START
+%state ATTR_VALUE_DQ
+%state ATTR_VALUE_SQ
+%state DTD_MARKUP
+%state DOCTYPE
+%xstate CDATA
+%state C_COMMENT_START
+%state C_COMMENT_END
+
+ALPHA=[:letter:]
+DIGIT=[0-9]
+WS=[\ \n\r\t\f]
+S={WS}+
+
+EL_EMBEDMENT_START="${" | "#{"
+NAME=({ALPHA}|"_")({ALPHA}|{DIGIT}|"_"|"."|"-")*(":"({ALPHA}|"_")?({ALPHA}|{DIGIT}|"_"|"."|"-")*)?
+
+END_COMMENT="-->"
+CONDITIONAL_COMMENT_CONDITION=({ALPHA})({ALPHA}|{S}|{DIGIT}|"."|"("|")"|"|"|"!"|"&")*
+
+%%
+"<![CDATA[" {yybegin(CDATA); return XmlTokenType.XML_CDATA_START; }
+<CDATA>{
+ "]]>"  {yybegin(YYINITIAL); return XmlTokenType.XML_CDATA_END; }
+ [^] {return XmlTokenType.XML_DATA_CHARACTERS; }
+}
+
+"<!--" { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_START; }
+<COMMENT> "[" { if (myConditionalCommentsSupport) {
+    yybegin(C_COMMENT_START);
+    return XmlTokenType.XML_CONDITIONAL_COMMENT_START;
+  } else return XmlTokenType.XML_COMMENT_CHARACTERS; }
+<COMMENT> "<![" { if (myConditionalCommentsSupport) {
+    yybegin(C_COMMENT_END);
+    return XmlTokenType.XML_CONDITIONAL_COMMENT_END_START;
+  } else return XmlTokenType.XML_COMMENT_CHARACTERS; }
+<COMMENT> {END_COMMENT} { yybegin(YYINITIAL); return XmlTokenType.XML_COMMENT_END; }
+<COMMENT> [^\-]|(-[^\-]) { return XmlTokenType.XML_COMMENT_CHARACTERS; }
+<COMMENT> [^] { return XmlTokenType.XML_BAD_CHARACTER; }
+
+<C_COMMENT_START,C_COMMENT_END> {CONDITIONAL_COMMENT_CONDITION} { return XmlTokenType.XML_COMMENT_CHARACTERS; }
+<C_COMMENT_START> [^] { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_CHARACTERS; }
+<C_COMMENT_START> "]>" { yybegin(COMMENT); return XmlTokenType.XML_CONDITIONAL_COMMENT_START_END; }
+<C_COMMENT_START,C_COMMENT_END> {END_COMMENT} { yybegin(YYINITIAL); return XmlTokenType.XML_COMMENT_END; }
+<C_COMMENT_END> "]" { yybegin(COMMENT); return XmlTokenType.XML_CONDITIONAL_COMMENT_END; }
+<C_COMMENT_END> [^] { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_CHARACTERS; }
+
+"&lt;" |
+"&gt;" |
+"&apos;" |
+"&quot;" |
+"&nbsp;" |
+"&amp;" |
+"&#"{DIGIT}+";" |
+"&#x"({DIGIT}|[a-fA-F])+";" { return XmlTokenType.XML_CHAR_ENTITY_REF; }
+"&"{NAME}";" { return XmlTokenType.XML_ENTITY_REF_TOKEN; }
+
+<YYINITIAL> "<!DOCTYPE" { yybegin(DOCTYPE); return XmlTokenType.XML_DOCTYPE_START; }
+<DOCTYPE> "SYSTEM" { return XmlTokenType.XML_DOCTYPE_SYSTEM;  }
+<DOCTYPE> "PUBLIC" { return XmlTokenType.XML_DOCTYPE_PUBLIC;  }
+<DOCTYPE> {NAME} { return XmlTokenType.XML_NAME;  }
+<DOCTYPE> "\""[^\"]*"\"" { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;}
+<DOCTYPE> "'"[^']*"'" { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;}
+<DOCTYPE> "["(([^\]\"]*)|(\"[^\"]*\"))*"]" { return XmlElementType.XML_MARKUP_DECL;}
+<DOCTYPE> ">" { yybegin(YYINITIAL); return XmlTokenType.XML_DOCTYPE_END; }
+
+<YYINITIAL> "<?" { yybegin(PROCESSING_INSTRUCTION); return XmlTokenType.XML_PI_START; }
+<PROCESSING_INSTRUCTION> "xml" { yybegin(ATTR_LIST); pushState(PROCESSING_INSTRUCTION); return XmlTokenType.XML_NAME; }
+<PROCESSING_INSTRUCTION> {NAME} { yybegin(PI_ANY); return XmlTokenType.XML_NAME; }
+<PI_ANY, PROCESSING_INSTRUCTION> "?>" { yybegin(YYINITIAL); return XmlTokenType.XML_PI_END; }
+<PI_ANY> {S} { return XmlTokenType.XML_WHITE_SPACE; }
+<PI_ANY> [^] { return XmlTokenType.XML_TAG_CHARACTERS; }
+
+<YYINITIAL> {EL_EMBEDMENT_START} [^<\}]* "}" {
+  return elTokenType;
+}
+
+<YYINITIAL> "<" { yybegin(TAG); return XmlTokenType.XML_START_TAG_START; }
+<TAG> {NAME} { yybegin(ATTR_LIST); pushState(TAG); return XmlTokenType.XML_NAME; }
+<TAG> "/>" { yybegin(YYINITIAL); return XmlTokenType.XML_EMPTY_ELEMENT_END; }
+<TAG> ">" { yybegin(YYINITIAL); return XmlTokenType.XML_TAG_END; }
+
+<YYINITIAL> "</" { yybegin(END_TAG); return XmlTokenType.XML_END_TAG_START; }
+<END_TAG> {NAME} { return XmlTokenType.XML_NAME; }
+<END_TAG> ">" { yybegin(YYINITIAL); return XmlTokenType.XML_TAG_END; }
+
+<ATTR_LIST> {NAME} {yybegin(ATTR); return XmlTokenType.XML_NAME;}
+<ATTR> "=" { return XmlTokenType.XML_EQ;}
+<ATTR> "'" { yybegin(ATTR_VALUE_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;}
+<ATTR> "\"" { yybegin(ATTR_VALUE_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;}
+<ATTR> [^\ \n\r\t\f] {yybegin(ATTR_LIST); yypushback(yylength()); }
+
+<ATTR_VALUE_DQ>{
+  "\"" { yybegin(ATTR_LIST); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER;}
+  "&" { return XmlTokenType.XML_BAD_CHARACTER; }
+  {EL_EMBEDMENT_START} [^\}\"]* "}" { return elTokenType2; }
+  "%=" [^%\"]* "%" { return javaEmbeddedTokenType; }
+  [^] { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;}
+}
+
+<ATTR_VALUE_SQ>{
+  "&" { return XmlTokenType.XML_BAD_CHARACTER; }
+  "'" { yybegin(ATTR_LIST); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER;}
+  {EL_EMBEDMENT_START} [^\}\']* "}" { return elTokenType2; }
+  "%=" [^%\']* "%" { return javaEmbeddedTokenType; }
+  [^] { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;}
+}
+
+<YYINITIAL> {S} { return XmlTokenType.XML_REAL_WHITE_SPACE; }
+<ATTR_LIST,ATTR,TAG,END_TAG,DOCTYPE> {S} { return XmlTokenType.XML_WHITE_SPACE; }
+<YYINITIAL> ([^<&\$# \n\r\t\f]|(\\\$)|(\\#))* { return XmlTokenType.XML_DATA_CHARACTERS; }
+<YYINITIAL> [^<&\ \n\r\t\f]|(\\\$)|(\\#) { return XmlTokenType.XML_DATA_CHARACTERS; }
+
+[^] { if(yystate() == YYINITIAL){
+        return XmlTokenType.XML_BAD_CHARACTER;
+      }
+      else yybegin(popState()); yypushback(yylength());}
diff --git a/xml/impl/src/com/intellij/lexer/_XmlLexer.java b/xml/impl/src/com/intellij/lexer/_XmlLexer.java
new file mode 100644
index 0000000..d78deb8
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/_XmlLexer.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/* The following code was generated by JFlex 1.4 on 3/14/05 5:43 PM */
+
+/* It's an automatically generated code. Do not modify it. */
+package com.intellij.lexer;
+
+public class _XmlLexer extends FlexAdapter {
+  private int myState = __XmlLexer.YYINITIAL;
+
+  public _XmlLexer(final __XmlLexer flexLexer) {
+    this(flexLexer, false);
+  }
+
+  public _XmlLexer(final __XmlLexer flexLexer, final boolean conditionalCommentsSupport) {
+    super(flexLexer);
+    flexLexer.setConditionalCommentsSupport(conditionalCommentsSupport);
+  }
+
+  private void packState() {
+    final __XmlLexer flex = (__XmlLexer)getFlex();
+    myState = ((flex.yyprevstate() & 15) << 4) | (flex.yystate() & 15);
+  }
+
+  private void handleState(final int initialState) {
+    final __XmlLexer flex = (__XmlLexer)getFlex();
+    flex.yybegin(initialState & 15);
+    flex.pushState((initialState >> 4) & 15);
+    packState();
+  }
+
+  public void start(final CharSequence buffer, final int startOffset, final int endOffset, final int initialState) {
+    super.start(buffer, startOffset, endOffset, initialState);
+    handleState(initialState);
+  }
+
+  public int getState() {
+    return myState;
+  }
+
+  public void advance() {
+    super.advance();
+    packState();
+  }
+}
diff --git a/xml/impl/src/com/intellij/lexer/__XmlLexer.java b/xml/impl/src/com/intellij/lexer/__XmlLexer.java
new file mode 100644
index 0000000..6fb8b5c
--- /dev/null
+++ b/xml/impl/src/com/intellij/lexer/__XmlLexer.java
@@ -0,0 +1,886 @@
+/* The following code was generated by JFlex 1.4.1 on 27.10.09 1:12 */
+
+ /* It's an automatically generated code. Do not modify it. */
+package com.intellij.lexer;
+
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTokenType;
+
+
+/**
+ * This class is a scanner generated by 
+ * <a href="http://www.jflex.de/">JFlex</a> 1.4.1
+ * on 27.10.09 1:12 from the specification file
+ * <tt>C:/IDEA/tools/lexer/_XmlLexer.flex</tt>
+ */
+public class __XmlLexer implements FlexLexer {
+  /** initial size of the lookahead buffer */
+  private static final int ZZ_BUFFERSIZE = 16384;
+
+  /** lexical states */
+  public static final int PROCESSING_INSTRUCTION = 2;
+  public static final int ATTR_LIST = 6;
+  public static final int END_TAG = 4;
+  public static final int ATTR_VALUE_DQ = 9;
+  public static final int C_COMMENT_END = 14;
+  public static final int DTD_MARKUP = 8;
+  public static final int CDATA = 12;
+  public static final int ATTR = 7;
+  public static final int TAG = 1;
+  public static final int PI_ANY = 3;
+  public static final int ATTR_VALUE_START = 8;
+  public static final int YYINITIAL = 0;
+  public static final int COMMENT = 5;
+  public static final int DOCTYPE = 11;
+  public static final int C_COMMENT_START = 13;
+  public static final int ATTR_VALUE_SQ = 10;
+
+  /** 
+   * Translates characters to character classes
+   */
+  private static final String ZZ_CMAP_PACKED = 
+    "\11\0\2\3\1\0\2\3\22\0\1\3\1\15\1\57\1\6\1\4"+
+    "\1\65\1\16\1\60\1\14\1\14\3\0\1\11\1\10\1\63\12\2"+
+    "\1\12\1\30\1\17\1\64\1\13\1\61\1\0\1\23\1\54\1\21"+
+    "\1\22\1\50\1\44\2\1\1\56\2\1\1\55\1\52\1\1\1\45"+
+    "\1\47\2\1\1\51\1\24\1\53\3\1\1\46\1\1\1\20\1\66"+
+    "\1\25\1\0\1\7\1\0\1\32\1\41\4\44\1\31\4\1\1\26"+
+    "\1\42\1\40\1\34\1\33\1\36\1\1\1\35\1\27\1\37\2\1"+
+    "\1\43\2\1\1\5\1\14\1\62\54\0\1\1\12\0\1\1\4\0"+
+    "\1\1\5\0\27\1\1\0\37\1\1\0\u013f\1\31\0\162\1\4\0"+
+    "\14\1\16\0\5\1\11\0\1\1\213\0\1\1\13\0\1\1\1\0"+
+    "\3\1\1\0\1\1\1\0\24\1\1\0\54\1\1\0\46\1\1\0"+
+    "\5\1\4\0\202\1\10\0\105\1\1\0\46\1\2\0\2\1\6\0"+
+    "\20\1\41\0\46\1\2\0\1\1\7\0\47\1\110\0\33\1\5\0"+
+    "\3\1\56\0\32\1\5\0\13\1\43\0\2\1\1\0\143\1\1\0"+
+    "\1\1\17\0\2\1\7\0\2\1\12\0\3\1\2\0\1\1\20\0"+
+    "\1\1\1\0\36\1\35\0\3\1\60\0\46\1\13\0\1\1\u0152\0"+
+    "\66\1\3\0\1\1\22\0\1\1\7\0\12\1\43\0\10\1\2\0"+
+    "\2\1\2\0\26\1\1\0\7\1\1\0\1\1\3\0\4\1\3\0"+
+    "\1\1\36\0\2\1\1\0\3\1\16\0\2\1\23\0\6\1\4\0"+
+    "\2\1\2\0\26\1\1\0\7\1\1\0\2\1\1\0\2\1\1\0"+
+    "\2\1\37\0\4\1\1\0\1\1\23\0\3\1\20\0\11\1\1\0"+
+    "\3\1\1\0\26\1\1\0\7\1\1\0\2\1\1\0\5\1\3\0"+
+    "\1\1\22\0\1\1\17\0\2\1\43\0\10\1\2\0\2\1\2\0"+
+    "\26\1\1\0\7\1\1\0\2\1\1\0\5\1\3\0\1\1\36\0"+
+    "\2\1\1\0\3\1\17\0\1\1\21\0\1\1\1\0\6\1\3\0"+
+    "\3\1\1\0\4\1\3\0\2\1\1\0\1\1\1\0\2\1\3\0"+
+    "\2\1\3\0\3\1\3\0\10\1\1\0\3\1\113\0\10\1\1\0"+
+    "\3\1\1\0\27\1\1\0\12\1\1\0\5\1\46\0\2\1\43\0"+
+    "\10\1\1\0\3\1\1\0\27\1\1\0\12\1\1\0\5\1\3\0"+
+    "\1\1\40\0\1\1\1\0\2\1\43\0\10\1\1\0\3\1\1\0"+
+    "\27\1\1\0\20\1\46\0\2\1\43\0\22\1\3\0\30\1\1\0"+
+    "\11\1\1\0\1\1\2\0\7\1\72\0\60\1\1\0\2\1\14\0"+
+    "\7\1\72\0\2\1\1\0\1\1\2\0\2\1\1\0\1\1\2\0"+
+    "\1\1\6\0\4\1\1\0\7\1\1\0\3\1\1\0\1\1\1\0"+
+    "\1\1\2\0\2\1\1\0\4\1\1\0\2\1\11\0\1\1\2\0"+
+    "\5\1\1\0\1\1\25\0\2\1\42\0\1\1\77\0\10\1\1\0"+
+    "\42\1\35\0\4\1\164\0\42\1\1\0\5\1\1\0\2\1\45\0"+
+    "\6\1\112\0\46\1\12\0\51\1\7\0\132\1\5\0\104\1\5\0"+
+    "\122\1\6\0\7\1\1\0\77\1\1\0\1\1\1\0\4\1\2\0"+
+    "\7\1\1\0\1\1\1\0\4\1\2\0\47\1\1\0\1\1\1\0"+
+    "\4\1\2\0\37\1\1\0\1\1\1\0\4\1\2\0\7\1\1\0"+
+    "\1\1\1\0\4\1\2\0\7\1\1\0\7\1\1\0\27\1\1\0"+
+    "\37\1\1\0\1\1\1\0\4\1\2\0\7\1\1\0\47\1\1\0"+
+    "\23\1\105\0\125\1\14\0\u026c\1\2\0\10\1\12\0\32\1\5\0"+
+    "\113\1\25\0\15\1\1\0\4\1\16\0\22\1\16\0\22\1\16\0"+
+    "\15\1\1\0\3\1\17\0\64\1\43\0\1\1\4\0\1\1\103\0"+
+    "\130\1\10\0\51\1\127\0\35\1\63\0\36\1\2\0\5\1\u038b\0"+
+    "\154\1\224\0\234\1\4\0\132\1\6\0\26\1\2\0\6\1\2\0"+
+    "\46\1\2\0\6\1\2\0\10\1\1\0\1\1\1\0\1\1\1\0"+
+    "\1\1\1\0\37\1\2\0\65\1\1\0\7\1\1\0\1\1\3\0"+
+    "\3\1\1\0\7\1\3\0\4\1\2\0\6\1\4\0\15\1\5\0"+
+    "\3\1\1\0\7\1\164\0\1\1\15\0\1\1\202\0\1\1\4\0"+
+    "\1\1\2\0\12\1\1\0\1\1\3\0\5\1\6\0\1\1\1\0"+
+    "\1\1\1\0\1\1\1\0\4\1\1\0\3\1\1\0\7\1\3\0"+
+    "\3\1\5\0\5\1\u0ebb\0\2\1\52\0\5\1\5\0\2\1\4\0"+
+    "\126\1\6\0\3\1\1\0\132\1\1\0\4\1\5\0\50\1\4\0"+
+    "\136\1\21\0\30\1\70\0\20\1\u0200\0\u19b6\1\112\0\u51a6\1\132\0"+
+    "\u048d\1\u0773\0\u2ba4\1\u215c\0\u012e\1\2\0\73\1\225\0\7\1\14\0"+
+    "\5\1\5\0\1\1\1\0\12\1\1\0\15\1\1\0\5\1\1\0"+
+    "\1\1\1\0\2\1\1\0\2\1\1\0\154\1\41\0\u016b\1\22\0"+
+    "\100\1\2\0\66\1\50\0\14\1\164\0\5\1\1\0\207\1\44\0"+
+    "\32\1\6\0\32\1\13\0\131\1\3\0\6\1\2\0\6\1\2\0"+
+    "\6\1\2\0\3\1\43\0";
+
+  /** 
+   * Translates characters to character classes
+   */
+  private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
+
+  /** 
+   * Translates DFA states to action switch labels.
+   */
+  private static final int [] ZZ_ACTION = zzUnpackAction();
+
+  private static final String ZZ_ACTION_PACKED_0 =
+    "\1\1\16\0\1\1\1\2\1\1\1\3\1\4\1\1"+
+    "\1\3\1\5\1\6\1\7\2\3\2\10\1\3\4\11"+
+    "\1\12\1\13\1\14\1\13\1\15\1\16\3\17\1\20"+
+    "\1\21\1\22\2\23\1\14\1\23\1\24\3\23\1\25"+
+    "\1\3\2\12\2\3\2\1\1\26\1\13\4\26\1\27"+
+    "\10\0\1\30\1\31\1\5\1\0\1\32\2\10\1\33"+
+    "\1\12\2\0\1\16\5\0\1\34\1\0\2\12\3\0"+
+    "\1\35\1\36\1\0\1\37\12\0\1\40\1\41\1\42"+
+    "\1\43\1\44\2\12\1\45\1\46\2\0\1\47\2\0"+
+    "\2\12\2\0\2\12\2\0\1\50\1\51\4\0\1\52"+
+    "\1\53";
+
+  private static int [] zzUnpackAction() {
+    int [] result = new int[145];
+    int offset = 0;
+    offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackAction(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+
+  /** 
+   * Translates a state to a row index in the transition table
+   */
+  private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
+
+  private static final String ZZ_ROWMAP_PACKED_0 =
+    "\0\0\0\67\0\156\0\245\0\334\0\u0113\0\u014a\0\u0181"+
+    "\0\u01b8\0\u01ef\0\u0226\0\u025d\0\u0294\0\u02cb\0\u0302\0\u0339"+
+    "\0\u0370\0\u03a7\0\u03de\0\u0415\0\u044c\0\u0483\0\u04ba\0\u04f1"+
+    "\0\u0483\0\u0528\0\u055f\0\u0596\0\u05cd\0\u0604\0\u0483\0\u03de"+
+    "\0\u0528\0\u0604\0\u063b\0\u0483\0\u0672\0\u06a9\0\u0483\0\u06e0"+
+    "\0\u0483\0\u03de\0\u0528\0\u0483\0\u0483\0\u0483\0\u0483\0\u0717"+
+    "\0\u03de\0\u0528\0\u0483\0\u074e\0\u0785\0\u07bc\0\u0483\0\u07f3"+
+    "\0\u082a\0\u0861\0\u0898\0\u08cf\0\u0483\0\u0906\0\u0483\0\u093d"+
+    "\0\u0974\0\u03de\0\u0528\0\u09ab\0\u0483\0\u09e2\0\u0a19\0\u0a50"+
+    "\0\u0a87\0\u0abe\0\u0af5\0\u0b2c\0\u0b63\0\u0483\0\u0483\0\u0b9a"+
+    "\0\u0bd1\0\u0483\0\u0c08\0\u0c3f\0\u0483\0\u0c76\0\u0cad\0\u0ce4"+
+    "\0\u0d1b\0\u0d52\0\u0d89\0\u0dc0\0\u0df7\0\u07f3\0\u0483\0\u0e2e"+
+    "\0\u0e65\0\u0e9c\0\u0898\0\u08cf\0\u0ed3\0\u0483\0\u0483\0\u0f0a"+
+    "\0\u0483\0\u0f41\0\u0f78\0\u0faf\0\u0fe6\0\u101d\0\u1054\0\u108b"+
+    "\0\u10c2\0\u10f9\0\u1130\0\u0596\0\u0483\0\u0483\0\u0483\0\u0483"+
+    "\0\u1167\0\u119e\0\u0483\0\u0483\0\u11d5\0\u120c\0\u0483\0\u1243"+
+    "\0\u127a\0\u12b1\0\u12e8\0\u131f\0\u1356\0\u138d\0\u13c4\0\u13fb"+
+    "\0\u1432\0\u063b\0\u063b\0\u1469\0\u14a0\0\u14d7\0\u150e\0\u0483"+
+    "\0\u0483";
+
+  private static int [] zzUnpackRowMap() {
+    int [] result = new int[145];
+    int offset = 0;
+    offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackRowMap(String packed, int offset, int [] result) {
+    int i = 0;  /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int high = packed.charAt(i++) << 16;
+      result[j++] = high | packed.charAt(i++);
+    }
+    return j;
+  }
+
+  /** 
+   * The transition table of the DFA
+   */
+  private static final int [] ZZ_TRANS = zzUnpackTrans();
+
+  private static final String ZZ_TRANS_PACKED_0 =
+    "\3\20\1\21\1\22\1\20\1\22\7\20\1\23\1\24"+
+    "\46\20\1\25\1\26\1\27\1\26\1\30\3\26\1\27"+
+    "\3\26\1\31\2\26\1\23\1\32\1\26\4\27\1\26"+
+    "\2\27\1\26\26\27\4\26\1\33\4\26\1\34\5\26"+
+    "\1\34\6\26\1\23\1\32\1\26\4\34\1\26\2\34"+
+    "\1\26\12\34\1\35\13\34\2\26\1\36\5\26\3\37"+
+    "\1\30\12\37\1\40\1\41\41\37\1\42\5\37\1\26"+
+    "\1\43\1\26\1\30\3\26\1\43\3\26\1\31\2\26"+
+    "\1\23\1\32\1\26\4\43\1\26\2\43\1\26\26\43"+
+    "\10\26\11\44\1\45\5\44\1\46\1\47\46\44\1\26"+
+    "\1\50\1\26\1\30\3\26\1\50\6\26\1\23\1\32"+
+    "\1\26\4\50\1\26\2\50\1\26\26\50\10\26\3\51"+
+    "\1\30\12\51\1\52\1\53\37\51\1\54\1\55\3\51"+
+    "\1\56\2\51\16\26\1\23\1\32\47\26\4\57\1\60"+
+    "\1\57\1\60\7\57\1\61\1\62\37\57\1\63\5\57"+
+    "\1\64\5\57\1\65\1\57\1\65\7\57\1\61\1\62"+
+    "\40\57\1\63\4\57\1\66\1\57\1\26\1\43\1\26"+
+    "\1\30\3\26\1\43\3\26\1\67\2\26\1\23\1\32"+
+    "\1\70\4\43\1\26\2\43\1\26\16\43\1\71\1\43"+
+    "\1\72\5\43\1\73\1\74\6\26\25\75\1\76\41\75"+
+    "\1\77\1\100\7\77\1\101\4\77\1\102\1\103\1\77"+
+    "\4\100\1\104\2\100\1\77\26\100\11\77\1\100\7\77"+
+    "\1\101\4\77\1\102\1\103\1\77\4\100\1\105\2\100"+
+    "\1\77\26\100\10\77\3\20\2\0\1\20\1\0\7\20"+
+    "\2\0\46\20\1\25\3\0\1\21\70\0\1\106\62\0"+
+    "\1\107\4\0\1\110\1\107\11\0\4\107\1\0\1\111"+
+    "\1\107\1\0\1\111\1\112\3\107\1\113\1\107\1\114"+
+    "\16\107\25\0\1\115\43\0\1\116\1\0\1\117\3\0"+
+    "\3\20\1\0\12\20\2\0\46\20\1\25\70\0\2\27"+
+    "\4\0\3\27\1\120\6\0\4\27\1\0\2\27\1\0"+
+    "\26\27\13\0\1\30\100\0\1\121\64\0\1\122\54\0"+
+    "\2\34\4\0\3\34\1\123\6\0\4\34\1\0\2\34"+
+    "\1\0\26\34\11\0\2\34\4\0\3\34\1\123\6\0"+
+    "\4\34\1\0\2\34\1\0\11\34\1\124\14\34\23\0"+
+    "\1\125\54\0\2\43\4\0\3\43\1\126\6\0\4\43"+
+    "\1\0\2\43\1\0\26\43\10\0\11\44\1\127\55\44"+
+    "\15\0\1\130\52\0\2\50\4\0\3\50\1\131\6\0"+
+    "\4\50\1\0\2\50\1\0\26\50\15\0\1\132\145\0"+
+    "\1\133\7\0\1\134\145\0\1\135\2\0\25\136\1\137"+
+    "\31\136\1\140\7\136\1\0\2\43\4\0\3\43\1\126"+
+    "\6\0\4\43\1\0\2\43\1\0\22\43\1\141\3\43"+
+    "\11\0\2\43\4\0\3\43\1\126\6\0\4\43\1\0"+
+    "\2\43\1\0\15\43\1\142\10\43\10\0\57\143\1\57"+
+    "\7\143\60\144\1\57\6\144\25\0\1\145\42\0\3\100"+
+    "\4\0\1\100\3\0\3\100\2\0\4\100\1\0\2\100"+
+    "\1\0\26\100\21\0\1\127\70\0\1\146\53\0\17\106"+
+    "\1\0\42\106\1\147\4\106\1\0\2\107\4\0\3\107"+
+    "\1\150\6\0\4\107\1\0\2\107\1\151\26\107\12\0"+
+    "\1\152\40\0\1\153\24\0\2\107\4\0\3\107\1\150"+
+    "\6\0\4\107\1\0\1\107\1\154\1\151\26\107\11\0"+
+    "\2\107\4\0\3\107\1\150\6\0\4\107\1\0\2\107"+
+    "\1\151\2\107\1\155\6\107\1\156\14\107\11\0\2\107"+
+    "\4\0\3\107\1\150\6\0\4\107\1\0\2\107\1\151"+
+    "\6\107\1\157\17\107\11\0\2\107\4\0\3\107\1\150"+
+    "\6\0\4\107\1\0\2\107\1\151\10\107\1\160\15\107"+
+    "\21\0\1\161\6\0\1\162\1\0\1\163\45\0\2\120"+
+    "\4\0\3\120\7\0\4\120\1\0\2\120\1\0\26\120"+
+    "\21\0\1\161\6\0\1\162\47\0\2\123\4\0\3\123"+
+    "\7\0\4\123\1\0\2\123\1\0\26\123\11\0\2\34"+
+    "\4\0\3\34\1\123\6\0\4\34\1\0\1\164\1\34"+
+    "\1\0\26\34\11\0\2\126\4\0\3\126\7\0\4\126"+
+    "\1\0\2\126\1\0\26\126\23\0\1\165\73\0\1\166"+
+    "\47\0\2\131\4\0\3\131\7\0\4\131\1\0\2\131"+
+    "\1\0\26\131\10\0\57\132\1\0\2\132\1\167\4\132"+
+    "\57\133\1\0\5\133\1\170\1\133\60\134\1\0\1\134"+
+    "\1\167\4\134\60\135\1\0\4\135\1\170\1\135\57\140"+
+    "\1\136\7\140\1\0\2\43\4\0\3\43\1\126\6\0"+
+    "\4\43\1\0\2\43\1\0\23\43\1\171\2\43\11\0"+
+    "\2\43\4\0\3\43\1\126\6\0\4\43\1\0\2\43"+
+    "\1\0\20\43\1\172\5\43\23\0\1\173\54\0\2\150"+
+    "\4\0\3\150\7\0\4\150\1\0\2\150\1\151\26\150"+
+    "\12\0\1\152\25\0\1\174\40\0\1\175\16\0\3\175"+
+    "\6\0\1\175\6\0\1\175\2\0\1\175\3\0\1\175"+
+    "\3\0\1\175\13\0\2\107\4\0\3\107\1\150\6\0"+
+    "\4\107\1\0\2\107\1\174\26\107\11\0\2\107\4\0"+
+    "\3\107\1\150\6\0\4\107\1\0\2\107\1\151\3\107"+
+    "\1\176\22\107\11\0\2\107\4\0\3\107\1\150\6\0"+
+    "\4\107\1\0\2\107\1\151\2\107\1\154\23\107\11\0"+
+    "\2\107\4\0\3\107\1\150\6\0\4\107\1\0\2\107"+
+    "\1\151\3\107\1\111\22\107\11\0\2\107\4\0\3\107"+
+    "\1\150\6\0\4\107\1\0\2\107\1\151\4\107\1\156"+
+    "\21\107\21\0\1\177\76\0\1\200\112\0\1\201\22\0"+
+    "\2\43\4\0\3\43\1\126\6\0\4\43\1\0\2\43"+
+    "\1\0\24\43\1\202\1\43\11\0\2\43\4\0\3\43"+
+    "\1\126\6\0\3\43\1\203\1\0\2\43\1\0\26\43"+
+    "\12\0\1\175\16\0\3\175\4\0\1\174\1\0\1\175"+
+    "\6\0\1\175\2\0\1\175\3\0\1\175\3\0\1\175"+
+    "\13\0\2\107\4\0\3\107\1\150\6\0\4\107\1\0"+
+    "\2\107\1\151\4\107\1\154\21\107\32\0\1\204\65\0"+
+    "\1\205\46\0\2\43\4\0\3\43\1\126\6\0\4\43"+
+    "\1\0\2\43\1\0\25\43\1\206\11\0\2\43\4\0"+
+    "\3\43\1\126\6\0\4\43\1\0\2\43\1\0\17\43"+
+    "\1\207\6\43\33\0\1\210\67\0\1\211\43\0\2\43"+
+    "\4\0\3\43\1\126\6\0\1\212\3\43\1\0\2\43"+
+    "\1\0\26\43\11\0\2\43\4\0\3\43\1\126\6\0"+
+    "\4\43\1\0\2\43\1\0\21\43\1\213\4\43\34\0"+
+    "\1\214\110\0\1\215\43\0\1\216\112\0\1\217\37\0"+
+    "\1\220\116\0\1\221\16\0";
+
+  private static int [] zzUnpackTrans() {
+    int [] result = new int[5445];
+    int offset = 0;
+    offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackTrans(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      value--;
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+
+  /* error codes */
+  private static final int ZZ_UNKNOWN_ERROR = 0;
+  private static final int ZZ_NO_MATCH = 1;
+  private static final int ZZ_PUSHBACK_2BIG = 2;
+  private static final char[] EMPTY_BUFFER = new char[0];
+  private static final int YYEOF = -1;
+  private static java.io.Reader zzReader = null; // Fake
+
+  /* error messages for the codes above */
+  private static final String ZZ_ERROR_MSG[] = {
+    "Unkown internal scanner error",
+    "Error: could not match input",
+    "Error: pushback value was too large"
+  };
+
+  /**
+   * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
+   */
+  private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
+
+  private static final String ZZ_ATTRIBUTE_PACKED_0 =
+    "\1\1\16\0\6\1\1\11\2\1\1\11\5\1\1\11"+
+    "\4\1\1\11\2\1\1\11\1\1\1\11\2\1\4\11"+
+    "\3\1\1\11\3\1\1\11\5\1\1\11\1\1\1\11"+
+    "\5\1\1\11\10\0\2\11\1\1\1\0\1\11\2\1"+
+    "\1\11\1\1\2\0\1\1\5\0\1\11\1\0\2\1"+
+    "\3\0\2\11\1\0\1\11\12\0\1\1\4\11\2\1"+
+    "\2\11\2\0\1\11\2\0\2\1\2\0\2\1\2\0"+
+    "\2\1\4\0\2\11";
+
+  private static int [] zzUnpackAttribute() {
+    int [] result = new int[145];
+    int offset = 0;
+    offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackAttribute(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+  /** the current state of the DFA */
+  private int zzState;
+
+  /** the current lexical state */
+  private int zzLexicalState = YYINITIAL;
+
+  /** this buffer contains the current text to be matched and is
+      the source of the yytext() string */
+  private CharSequence zzBuffer = "";
+
+  /** this buffer may contains the current text array to be matched when it is cheap to acquire it */
+  private char[] zzBufferArray;
+
+  /** the textposition at the last accepting state */
+  private int zzMarkedPos;
+
+  /** the textposition at the last state to be included in yytext */
+  private int zzPushbackPos;
+
+  /** the current text position in the buffer */
+  private int zzCurrentPos;
+
+  /** startRead marks the beginning of the yytext() string in the buffer */
+  private int zzStartRead;
+
+  /** endRead marks the last character in the buffer, that has been read
+      from input */
+  private int zzEndRead;
+
+  /**
+   * zzAtBOL == true <=> the scanner is currently at the beginning of a line
+   */
+  private boolean zzAtBOL = true;
+
+  /** zzAtEOF == true <=> the scanner is at the EOF */
+  private boolean zzAtEOF;
+
+  /** denotes if the user-EOF-code has already been executed */
+  private boolean zzEOFDone;
+
+  /* user code: */
+  private IElementType elTokenType = XmlTokenType.XML_DATA_CHARACTERS;
+  private IElementType elTokenType2 = XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;
+  private IElementType javaEmbeddedTokenType = XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;
+  private boolean myConditionalCommentsSupport;
+
+  public void setConditionalCommentsSupport(final boolean b) {
+    myConditionalCommentsSupport = b;
+  }
+
+  public void setElTypes(IElementType _elTokenType,IElementType _elTokenType2) {
+    elTokenType = _elTokenType;
+    elTokenType2 = _elTokenType2;
+  }
+
+  public void setJavaEmbeddedType(IElementType _tokenType) {
+    javaEmbeddedTokenType = _tokenType;
+  }
+
+  private int myPrevState = YYINITIAL;
+
+  public int yyprevstate() {
+    return myPrevState;
+  }
+
+  private int popState(){
+    final int prev = myPrevState;
+    myPrevState = YYINITIAL;
+    return prev;
+  }
+
+  protected void pushState(int state){
+    myPrevState = state;
+  }
+
+
+  public __XmlLexer(java.io.Reader in) {
+    this.zzReader = in;
+  }
+
+  /**
+   * Creates a new scanner.
+   * There is also java.io.Reader version of this constructor.
+   *
+   * @param   in  the java.io.Inputstream to read input from.
+   */
+  public __XmlLexer(java.io.InputStream in) {
+    this(new java.io.InputStreamReader(in));
+  }
+
+  /** 
+   * Unpacks the compressed character translation table.
+   *
+   * @param packed   the packed character translation table
+   * @return         the unpacked character translation table
+   */
+  private static char [] zzUnpackCMap(String packed) {
+    char [] map = new char[0x10000];
+    int i = 0;  /* index in packed string  */
+    int j = 0;  /* index in unpacked array */
+    while (i < 1248) {
+      int  count = packed.charAt(i++);
+      char value = packed.charAt(i++);
+      do map[j++] = value; while (--count > 0);
+    }
+    return map;
+  }
+
+  public final int getTokenStart(){
+    return zzStartRead;
+  }
+
+  public final int getTokenEnd(){
+    return getTokenStart() + yylength();
+  }
+
+  public void reset(CharSequence buffer, int start, int end,int initialState){
+    zzBuffer = buffer;
+    zzBufferArray = com.intellij.util.text.CharArrayUtil.fromSequenceWithoutCopying(buffer);
+    zzCurrentPos = zzMarkedPos = zzStartRead = start;
+    zzPushbackPos = 0;
+    zzAtEOF  = false;
+    zzAtBOL = true;
+    zzEndRead = end;
+    yybegin(initialState);
+  }
+
+  /**
+   * Refills the input buffer.
+   *
+   * @return      <code>false</code>, iff there was new input.
+   *
+   * @exception   java.io.IOException  if any I/O-Error occurs
+   */
+  private boolean zzRefill() throws java.io.IOException {
+    return true;
+  }
+
+
+  /**
+   * Returns the current lexical state.
+   */
+  public final int yystate() {
+    return zzLexicalState;
+  }
+
+
+  /**
+   * Enters a new lexical state
+   *
+   * @param newState the new lexical state
+   */
+  public final void yybegin(int newState) {
+    zzLexicalState = newState;
+  }
+
+
+  /**
+   * Returns the text matched by the current regular expression.
+   */
+  public final CharSequence yytext() {
+    return zzBuffer.subSequence(zzStartRead, zzMarkedPos);
+  }
+
+
+  /**
+   * Returns the character at position <tt>pos</tt> from the
+   * matched text.
+   *
+   * It is equivalent to yytext().charAt(pos), but faster
+   *
+   * @param pos the position of the character to fetch.
+   *            A value from 0 to yylength()-1.
+   *
+   * @return the character at position pos
+   */
+  public final char yycharat(int pos) {
+    return zzBufferArray != null ? zzBufferArray[zzStartRead+pos]:zzBuffer.charAt(zzStartRead+pos);
+  }
+
+
+  /**
+   * Returns the length of the matched text region.
+   */
+  public final int yylength() {
+    return zzMarkedPos-zzStartRead;
+  }
+
+
+  /**
+   * Reports an error that occured while scanning.
+   *
+   * In a wellformed scanner (no or only correct usage of
+   * yypushback(int) and a match-all fallback rule) this method
+   * will only be called with things that "Can't Possibly Happen".
+   * If this method is called, something is seriously wrong
+   * (e.g. a JFlex bug producing a faulty scanner etc.).
+   *
+   * Usual syntax/scanner level error handling should be done
+   * in error fallback rules.
+   *
+   * @param   errorCode  the code of the errormessage to display
+   */
+  private void zzScanError(int errorCode) {
+    String message;
+    try {
+      message = ZZ_ERROR_MSG[errorCode];
+    }
+    catch (ArrayIndexOutOfBoundsException e) {
+      message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
+    }
+
+    throw new Error(message);
+  }
+
+
+  /**
+   * Pushes the specified amount of characters back into the input stream.
+   *
+   * They will be read again by then next call of the scanning method
+   *
+   * @param number  the number of characters to be read again.
+   *                This number must not be greater than yylength()!
+   */
+  public void yypushback(int number)  {
+    if ( number > yylength() )
+      zzScanError(ZZ_PUSHBACK_2BIG);
+
+    zzMarkedPos -= number;
+  }
+
+
+  /**
+   * Contains user EOF-code, which will be executed exactly once,
+   * when the end of file is reached
+   */
+  private void zzDoEOF() {
+    if (!zzEOFDone) {
+      zzEOFDone = true;
+    
+    }
+  }
+
+
+  /**
+   * Resumes scanning until the next regular expression is matched,
+   * the end of input is encountered or an I/O-Error occurs.
+   *
+   * @return      the next token
+   * @exception   java.io.IOException  if any I/O-Error occurs
+   */
+  public IElementType advance() throws java.io.IOException {
+    int zzInput;
+    int zzAction;
+
+    // cached fields:
+    int zzCurrentPosL;
+    int zzMarkedPosL;
+    int zzEndReadL = zzEndRead;
+    CharSequence zzBufferL = zzBuffer;
+    char[] zzBufferArrayL = zzBufferArray;
+    char [] zzCMapL = ZZ_CMAP;
+
+    int [] zzTransL = ZZ_TRANS;
+    int [] zzRowMapL = ZZ_ROWMAP;
+    int [] zzAttrL = ZZ_ATTRIBUTE;
+
+    while (true) {
+      zzMarkedPosL = zzMarkedPos;
+
+      zzAction = -1;
+
+      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
+
+      zzState = zzLexicalState;
+
+
+      zzForAction: {
+        while (true) {
+
+          if (zzCurrentPosL < zzEndReadL)
+            zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++);
+          else if (zzAtEOF) {
+            zzInput = YYEOF;
+            break zzForAction;
+          }
+          else {
+            // store back cached positions
+            zzCurrentPos  = zzCurrentPosL;
+            zzMarkedPos   = zzMarkedPosL;
+            boolean eof = zzRefill();
+            // get translated positions and possibly new buffer
+            zzCurrentPosL  = zzCurrentPos;
+            zzMarkedPosL   = zzMarkedPos;
+            zzBufferL      = zzBuffer;
+            zzEndReadL     = zzEndRead;
+            if (eof) {
+              zzInput = YYEOF;
+              break zzForAction;
+            }
+            else {
+              zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++);
+            }
+          }
+          int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
+          if (zzNext == -1) break zzForAction;
+          zzState = zzNext;
+
+          int zzAttributes = zzAttrL[zzState];
+          if ( (zzAttributes & 1) == 1 ) {
+            zzAction = zzState;
+            zzMarkedPosL = zzCurrentPosL;
+            if ( (zzAttributes & 8) == 8 ) break zzForAction;
+          }
+
+        }
+      }
+
+      // store back cached position
+      zzMarkedPos = zzMarkedPosL;
+
+      switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
+        case 20: 
+          { yybegin(ATTR_LIST); return XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER;
+          }
+        case 44: break;
+        case 19: 
+          { return XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN;
+          }
+        case 45: break;
+        case 41: 
+          { return XmlTokenType.XML_DOCTYPE_SYSTEM;
+          }
+        case 46: break;
+        case 18: 
+          { return XmlTokenType.XML_EQ;
+          }
+        case 47: break;
+        case 9: 
+          { return XmlTokenType.XML_TAG_CHARACTERS;
+          }
+        case 48: break;
+        case 42: 
+          { yybegin(CDATA); return XmlTokenType.XML_CDATA_START;
+          }
+        case 49: break;
+        case 5: 
+          { yybegin(ATTR_LIST); pushState(TAG); return XmlTokenType.XML_NAME;
+          }
+        case 50: break;
+        case 25: 
+          { yybegin(END_TAG); return XmlTokenType.XML_END_TAG_START;
+          }
+        case 51: break;
+        case 30: 
+          { return elTokenType;
+          }
+        case 52: break;
+        case 10: 
+          { return XmlTokenType.XML_NAME;
+          }
+        case 53: break;
+        case 40: 
+          { return XmlTokenType.XML_DOCTYPE_PUBLIC;
+          }
+        case 54: break;
+        case 39: 
+          { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_START;
+          }
+        case 55: break;
+        case 13: 
+          { if (myConditionalCommentsSupport) {
+    yybegin(C_COMMENT_START);
+    return XmlTokenType.XML_CONDITIONAL_COMMENT_START;
+  } else return XmlTokenType.XML_COMMENT_CHARACTERS;
+          }
+        case 56: break;
+        case 36: 
+          { return javaEmbeddedTokenType;
+          }
+        case 57: break;
+        case 28: 
+          { return XmlElementType.XML_MARKUP_DECL;
+          }
+        case 58: break;
+        case 32: 
+          { yybegin(ATTR_LIST); pushState(PROCESSING_INSTRUCTION); return XmlTokenType.XML_NAME;
+          }
+        case 59: break;
+        case 2: 
+          { return XmlTokenType.XML_REAL_WHITE_SPACE;
+          }
+        case 60: break;
+        case 1: 
+          { return XmlTokenType.XML_DATA_CHARACTERS;
+          }
+        case 61: break;
+        case 23: 
+          { yybegin(COMMENT); return XmlTokenType.XML_CONDITIONAL_COMMENT_END;
+          }
+        case 62: break;
+        case 12: 
+          { return XmlTokenType.XML_BAD_CHARACTER;
+          }
+        case 63: break;
+        case 7: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_TAG_END;
+          }
+        case 64: break;
+        case 29: 
+          { yybegin(COMMENT); return XmlTokenType.XML_CONDITIONAL_COMMENT_START_END;
+          }
+        case 65: break;
+        case 3: 
+          { if(yystate() == YYINITIAL){
+        return XmlTokenType.XML_BAD_CHARACTER;
+      }
+      else yybegin(popState()); yypushback(yylength());
+          }
+        case 66: break;
+        case 33: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_COMMENT_END;
+          }
+        case 67: break;
+        case 4: 
+          { yybegin(TAG); return XmlTokenType.XML_START_TAG_START;
+          }
+        case 68: break;
+        case 34: 
+          { if (myConditionalCommentsSupport) {
+    yybegin(C_COMMENT_END);
+    return XmlTokenType.XML_CONDITIONAL_COMMENT_END_START;
+  } else return XmlTokenType.XML_COMMENT_CHARACTERS;
+          }
+        case 69: break;
+        case 26: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_EMPTY_ELEMENT_END;
+          }
+        case 70: break;
+        case 24: 
+          { yybegin(PROCESSING_INSTRUCTION); return XmlTokenType.XML_PI_START;
+          }
+        case 71: break;
+        case 8: 
+          { yybegin(PI_ANY); return XmlTokenType.XML_NAME;
+          }
+        case 72: break;
+        case 14: 
+          { yybegin(ATTR); return XmlTokenType.XML_NAME;
+          }
+        case 73: break;
+        case 15: 
+          { yybegin(ATTR_LIST); yypushback(yylength());
+          }
+        case 74: break;
+        case 21: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_DOCTYPE_END;
+          }
+        case 75: break;
+        case 38: 
+          { return XmlTokenType.XML_CHAR_ENTITY_REF;
+          }
+        case 76: break;
+        case 6: 
+          { return XmlTokenType.XML_WHITE_SPACE;
+          }
+        case 77: break;
+        case 31: 
+          { return XmlTokenType.XML_ENTITY_REF_TOKEN;
+          }
+        case 78: break;
+        case 16: 
+          { yybegin(ATTR_VALUE_DQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;
+          }
+        case 79: break;
+        case 17: 
+          { yybegin(ATTR_VALUE_SQ); return XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER;
+          }
+        case 80: break;
+        case 22: 
+          { yybegin(COMMENT); return XmlTokenType.XML_COMMENT_CHARACTERS;
+          }
+        case 81: break;
+        case 37: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_CDATA_END;
+          }
+        case 82: break;
+        case 35: 
+          { return elTokenType2;
+          }
+        case 83: break;
+        case 27: 
+          { yybegin(YYINITIAL); return XmlTokenType.XML_PI_END;
+          }
+        case 84: break;
+        case 43: 
+          { yybegin(DOCTYPE); return XmlTokenType.XML_DOCTYPE_START;
+          }
+        case 85: break;
+        case 11: 
+          { return XmlTokenType.XML_COMMENT_CHARACTERS;
+          }
+        case 86: break;
+        default:
+          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
+            zzAtEOF = true;
+            zzDoEOF();
+            return null;
+          }
+          else {
+            zzScanError(ZZ_NO_MATCH);
+          }
+      }
+    }
+  }
+
+
+}
diff --git a/xml/impl/src/com/intellij/navigation/HtmlGotoRelatedProvider.java b/xml/impl/src/com/intellij/navigation/HtmlGotoRelatedProvider.java
new file mode 100644
index 0000000..7cb7521
--- /dev/null
+++ b/xml/impl/src/com/intellij/navigation/HtmlGotoRelatedProvider.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.navigation;
+
+import com.intellij.lang.Language;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.xhtml.XHTMLLanguage;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.containers.HashSet;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: Eugene.Kudelevsky
+ * Date: 3/29/11
+ * Time: 4:21 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class HtmlGotoRelatedProvider extends GotoRelatedProvider {
+  @NotNull
+  @Override
+  public List<? extends GotoRelatedItem> getItems(@NotNull PsiElement context) {
+    final PsiFile file = context.getContainingFile();
+    if (file == null || !isAvailable(file)) {
+      return Collections.emptyList();
+    }
+
+    return getRelatedFiles(file);
+  }
+
+  private static boolean isAvailable(@NotNull PsiFile psiFile) {
+    for (PsiFile file : psiFile.getViewProvider().getAllFiles()) {
+      Language language = file.getLanguage();
+      if (language.isKindOf(HTMLLanguage.INSTANCE) || language.isKindOf(XHTMLLanguage.INSTANCE)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  private static List<? extends GotoRelatedItem> getRelatedFiles(@NotNull PsiFile file) {
+    List<GotoRelatedItem> items = new ArrayList<GotoRelatedItem>();
+
+    for (PsiFile psiFile : file.getViewProvider().getAllFiles()) {
+      if (psiFile instanceof XmlFile) {
+        final XmlFile xmlFile = (XmlFile)psiFile;
+
+        for (RelatedToHtmlFilesContributor contributor : RelatedToHtmlFilesContributor.EP_NAME.getExtensions()) {
+          HashSet<PsiFile> resultSet = new HashSet<PsiFile>();
+          contributor.fillRelatedFiles(xmlFile, resultSet);
+          for (PsiFile f: resultSet) {
+            items.add(new GotoRelatedItem(f, contributor.getGroupName()));
+          }
+        }
+      }
+    }
+    return items;
+  }
+}
diff --git a/xml/impl/src/com/intellij/navigation/LinkedToHtmlFilesContributor.java b/xml/impl/src/com/intellij/navigation/LinkedToHtmlFilesContributor.java
new file mode 100644
index 0000000..86f83e9
--- /dev/null
+++ b/xml/impl/src/com/intellij/navigation/LinkedToHtmlFilesContributor.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.navigation;
+
+import com.intellij.psi.*;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.Processor;
+import com.intellij.xml.util.HtmlUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Set;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class LinkedToHtmlFilesContributor extends RelatedToHtmlFilesContributor {
+  @Override
+  public void fillRelatedFiles(@NotNull final XmlFile xmlFile, @NotNull final Set<PsiFile> resultSet) {
+    HtmlUtil.processLinks(xmlFile, new Processor<XmlTag>() {
+      @Override
+      public boolean process(XmlTag tag) {
+        final XmlAttribute attribute = tag.getAttribute("href");
+        if (attribute == null) {
+          return true;
+        }
+
+        final XmlAttributeValue link = attribute.getValueElement();
+        if (link == null) {
+          return true;
+        }
+
+        for (PsiReference reference : link.getReferences()) {
+          if (reference instanceof PsiPolyVariantReference) {
+            final ResolveResult[] results = ((PsiPolyVariantReference)reference).multiResolve(false);
+
+            for (ResolveResult result : results) {
+              final PsiElement resolvedElement = result.getElement();
+              if (resolvedElement instanceof PsiFile) {
+                resultSet.add((PsiFile)resolvedElement);
+              }
+            }
+          }
+          else {
+            final PsiElement resolvedElement = reference.resolve();
+            if (resolvedElement instanceof PsiFile) {
+              resultSet.add((PsiFile)resolvedElement);
+            }
+          }
+        }
+        return true;
+      }
+    });
+  }
+
+  @Override
+  public String getGroupName() {
+    return "Linked files";
+  }
+}
diff --git a/xml/impl/src/com/intellij/navigation/RelatedToHtmlFilesContributor.java b/xml/impl/src/com/intellij/navigation/RelatedToHtmlFilesContributor.java
new file mode 100644
index 0000000..5aef333
--- /dev/null
+++ b/xml/impl/src/com/intellij/navigation/RelatedToHtmlFilesContributor.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.navigation;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Set;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public abstract class RelatedToHtmlFilesContributor {
+  public static final ExtensionPointName<RelatedToHtmlFilesContributor> EP_NAME =
+    ExtensionPointName.create("com.intellij.xml.relatedToHtmlFilesContributor");
+
+  public abstract void fillRelatedFiles(@NotNull XmlFile xmlFile, @NotNull Set<PsiFile> resultSet);
+  public abstract String getGroupName();
+}
diff --git a/xml/impl/src/com/intellij/openapi/options/colors/pages/HTMLColorsPage.java b/xml/impl/src/com/intellij/openapi/options/colors/pages/HTMLColorsPage.java
new file mode 100644
index 0000000..417fcf3
--- /dev/null
+++ b/xml/impl/src/com/intellij/openapi/options/colors/pages/HTMLColorsPage.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.openapi.options.colors.pages;
+
+import com.intellij.codeInsight.daemon.impl.tagTreeHighlighting.XmlTagTreeHighlightingColors;
+import com.intellij.ide.highlighter.HtmlFileHighlighter;
+import com.intellij.openapi.application.ApplicationNamesInfo;
+import com.intellij.openapi.editor.XmlHighlighterColors;
+import com.intellij.openapi.editor.colors.ColorKey;
+import com.intellij.openapi.editor.colors.TextAttributesKey;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.fileTypes.SyntaxHighlighter;
+import com.intellij.openapi.options.OptionsBundle;
+import com.intellij.openapi.options.colors.AttributesDescriptor;
+import com.intellij.openapi.options.colors.ColorDescriptor;
+import com.intellij.openapi.options.colors.ColorSettingsPage;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.util.Map;
+
+public class HTMLColorsPage implements ColorSettingsPage {
+  private static final AttributesDescriptor[] ATTRS = new AttributesDescriptor[] {
+    new AttributesDescriptor(OptionsBundle.message("options.html.attribute.descriptor.code"), XmlHighlighterColors.HTML_CODE),
+    new AttributesDescriptor(OptionsBundle.message("options.html.attribute.descriptor.comment"), XmlHighlighterColors.HTML_COMMENT),
+    new AttributesDescriptor(OptionsBundle.message("options.html.attribute.descriptor.tag"), XmlHighlighterColors.HTML_TAG),
+    new AttributesDescriptor(OptionsBundle.message("options.html.attribute.descriptor.tag.name"), XmlHighlighterColors.HTML_TAG_NAME),
+    new AttributesDescriptor(OptionsBundle.message("options.html.attribute.descriptor.attribute.name"), XmlHighlighterColors.HTML_ATTRIBUTE_NAME),
+    new AttributesDescriptor(OptionsBundle.message("options.html.attribute.descriptor.attribute.value"), XmlHighlighterColors.HTML_ATTRIBUTE_VALUE),
+    new AttributesDescriptor(OptionsBundle.message("options.html.attribute.descriptor.entity.reference"), XmlHighlighterColors.HTML_ENTITY_REFERENCE),
+  };
+  private static final String FULL_PRODUCT_NAME = ApplicationNamesInfo.getInstance().getFullProductName();
+
+  @NotNull
+  public String getDisplayName() {
+    return OptionsBundle.message("options.html.display.name");
+  }
+
+  public Icon getIcon() {
+    return StdFileTypes.HTML.getIcon();
+  }
+
+  @NotNull
+  public AttributesDescriptor[] getAttributeDescriptors() {
+    return ATTRS;
+  }
+
+  @NotNull
+  public ColorDescriptor[] getColorDescriptors() {
+    // todo: make preview for it
+
+    final ColorKey[] colorKeys = XmlTagTreeHighlightingColors.getColorKeys();
+    final ColorDescriptor[] colorDescriptors = new ColorDescriptor[colorKeys.length];
+
+    for (int i = 0; i < colorDescriptors.length; i++) {
+      colorDescriptors[i] = new ColorDescriptor(OptionsBundle.message("options.html.attribute.descriptor.tag.tree", i + 1),
+                                                colorKeys[i], ColorDescriptor.Kind.BACKGROUND);
+    }
+
+    return colorDescriptors;
+  }
+
+  @NotNull
+  public SyntaxHighlighter getHighlighter() {
+    return new HtmlFileHighlighter();
+  }
+
+  @NotNull
+  public String getDemoText() {
+    return "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n" +
+           "<!--\n" +
+           "*        Sample comment\n" +
+           "-->\n" +
+           "<HTML>\n" +
+           "<head>\n" +
+           "<title>" + FULL_PRODUCT_NAME + "</title>\n" +
+           "</head>\n" +
+           "<body>\n" +
+           "<h1>" + FULL_PRODUCT_NAME + "</h1>\n" +
+           "<p><br><b><IMG border=0 height=12 src=\"images/hg.gif\" width=18 >\n" +
+           "What is " + FULL_PRODUCT_NAME.replaceAll(" ", "&nbsp;") + "? &#x00B7; &Alpha; </b><br><br>\n" +
+           "</body>\n" +
+           "</html>";
+  }
+
+  public Map<String, TextAttributesKey> getAdditionalHighlightingTagToDescriptorMap() {
+    return null;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/openapi/options/colors/pages/XMLColorsPage.java b/xml/impl/src/com/intellij/openapi/options/colors/pages/XMLColorsPage.java
new file mode 100644
index 0000000..e968f73
--- /dev/null
+++ b/xml/impl/src/com/intellij/openapi/options/colors/pages/XMLColorsPage.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.openapi.options.colors.pages;
+
+import com.intellij.ide.highlighter.XmlFileHighlighter;
+import com.intellij.openapi.editor.XmlHighlighterColors;
+import com.intellij.openapi.editor.colors.TextAttributesKey;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.fileTypes.SyntaxHighlighter;
+import com.intellij.openapi.options.OptionsBundle;
+import com.intellij.openapi.options.colors.AttributesDescriptor;
+import com.intellij.openapi.options.colors.ColorDescriptor;
+import com.intellij.openapi.options.colors.ColorSettingsPage;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.util.Map;
+
+public class XMLColorsPage implements ColorSettingsPage {
+  private static final AttributesDescriptor[] ATTRS = new AttributesDescriptor[] {
+    new AttributesDescriptor(OptionsBundle.message("options.xml.attribute.descriptor.prologue"), XmlHighlighterColors.XML_PROLOGUE),
+    new AttributesDescriptor(OptionsBundle.message("options.xml.attribute.descriptor.comment"), XmlHighlighterColors.XML_COMMENT),
+    new AttributesDescriptor(OptionsBundle.message("options.xml.attribute.descriptor.tag"), XmlHighlighterColors.XML_TAG),
+    new AttributesDescriptor(OptionsBundle.message("options.xml.attribute.descriptor.tag.name"), XmlHighlighterColors.XML_TAG_NAME),
+    new AttributesDescriptor(OptionsBundle.message("options.xml.attribute.descriptor.attribute.name"), XmlHighlighterColors.XML_ATTRIBUTE_NAME),
+    new AttributesDescriptor(OptionsBundle.message("options.xml.attribute.descriptor.attribute.value"), XmlHighlighterColors.XML_ATTRIBUTE_VALUE),
+    new AttributesDescriptor(OptionsBundle.message("options.xml.attribute.descriptor.tag.data"), XmlHighlighterColors.XML_TAG_DATA),
+    new AttributesDescriptor(OptionsBundle.message("options.xml.attribute.descriptor.descriptor.entity,reference"), XmlHighlighterColors.XML_ENTITY_REFERENCE),
+  };
+
+  @NotNull
+  public String getDisplayName() {
+    return OptionsBundle.message("options.xml.display.name");
+  }
+
+  public Icon getIcon() {
+    return StdFileTypes.XML.getIcon();
+  }
+
+  @NotNull
+  public AttributesDescriptor[] getAttributeDescriptors() {
+    return ATTRS;
+  }
+
+  @NotNull
+  public ColorDescriptor[] getColorDescriptors() {
+    return ColorDescriptor.EMPTY_ARRAY;                       
+  }
+
+  @NotNull
+  public SyntaxHighlighter getHighlighter() {
+    return new XmlFileHighlighter();
+  }
+
+  @NotNull
+  public String getDemoText() {
+    return "<?xml version='1.0' encoding='ISO-8859-1'  ?>\n" +
+           "<!DOCTYPE index>\n" +
+           "<!-- Some xml example -->\n" +
+           "<index version=\"1.0\">\n" +
+           "   <name>Main Index</name>\n" +
+           "   <indexitem text=\"rename\" target=\"refactoring.rename\"/>\n" +
+           "   <indexitem text=\"move\" target=\"refactoring.move\"/>\n" +
+           "   <indexitem text=\"migrate\" target=\"refactoring.migrate\"/>\n" +
+           "   <indexitem text=\"usage search\" target=\"find.findUsages\"/>\n&amp; &#x00B7;" +
+           "   <indexitem text=\"project\" target=\"project.management\"/>\n" +
+           "</index>";
+  }
+
+  public Map<String, TextAttributesKey> getAdditionalHighlightingTagToDescriptorMap() {
+    return null;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/pom/xml/impl/XmlAspectChangeSetImpl.java b/xml/impl/src/com/intellij/pom/xml/impl/XmlAspectChangeSetImpl.java
new file mode 100644
index 0000000..eb9da7b
--- /dev/null
+++ b/xml/impl/src/com/intellij/pom/xml/impl/XmlAspectChangeSetImpl.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.impl;
+
+import com.intellij.pom.PomModel;
+import com.intellij.pom.PomModelAspect;
+import com.intellij.pom.event.PomChangeSet;
+import com.intellij.pom.xml.XmlAspect;
+import com.intellij.pom.xml.XmlChangeSet;
+import com.intellij.pom.xml.events.XmlChange;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+public class XmlAspectChangeSetImpl implements XmlChangeSet {
+  private final PomModel myModel;
+  private final List<XmlChange> myChanges = new ArrayList<XmlChange>();
+  private final List<XmlFile> myChangedFiles = new ArrayList<XmlFile>();
+
+  public XmlAspectChangeSetImpl(PomModel model) {
+    myModel = model;
+  }
+
+  public XmlAspectChangeSetImpl(final PomModel model, @Nullable final XmlFile xmlFile) {
+    this(model);
+    if (xmlFile != null) {
+      addChangedFile(xmlFile);
+    }
+  }
+
+  public List<XmlChange> getChanges(){
+    return Collections.unmodifiableList(myChanges);
+  }
+
+  @NotNull
+  public PomModelAspect getAspect() {
+    return myModel.getModelAspect(XmlAspect.class);
+  }
+
+  public void merge(@NotNull PomChangeSet blocked) {
+    final List<XmlChange> changes = ((XmlAspectChangeSetImpl)blocked).myChanges;
+    for (XmlChange xmlChange : changes) {
+      add(xmlChange);
+    }
+  }
+
+  public void add(XmlChange xmlChange) {
+    myChanges.add(xmlChange);
+  }
+
+  public void clear() {
+    myChanges.clear();
+  }
+
+  @NotNull
+  public Iterable<XmlFile> getChangedFiles() {
+    return myChangedFiles;
+  }
+
+  public String toString(){
+    final StringBuffer buffer = new StringBuffer();
+    final Iterator<XmlChange> iterator = myChanges.iterator();
+    while (iterator.hasNext()) {
+      XmlChange xmlChange = iterator.next();
+      buffer.append("(");
+      buffer.append(xmlChange.toString());
+      buffer.append(")");
+      if(iterator.hasNext()) buffer.append(", ");
+    }
+    return buffer.toString();
+  }
+
+  public void addChangedFile(@NotNull final XmlFile xmlFile) {
+    myChangedFiles.add(xmlFile);
+  }
+}
diff --git a/xml/impl/src/com/intellij/pom/xml/impl/XmlAspectImpl.java b/xml/impl/src/com/intellij/pom/xml/impl/XmlAspectImpl.java
new file mode 100644
index 0000000..db75802
--- /dev/null
+++ b/xml/impl/src/com/intellij/pom/xml/impl/XmlAspectImpl.java
@@ -0,0 +1,213 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.impl;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.pom.PomModel;
+import com.intellij.pom.PomModelAspect;
+import com.intellij.pom.event.PomModelEvent;
+import com.intellij.pom.tree.TreeAspect;
+import com.intellij.pom.tree.events.ChangeInfo;
+import com.intellij.pom.tree.events.ReplaceChangeInfo;
+import com.intellij.pom.tree.events.TreeChange;
+import com.intellij.pom.tree.events.TreeChangeEvent;
+import com.intellij.pom.tree.events.impl.ChangeInfoImpl;
+import com.intellij.pom.tree.events.impl.TreeChangeImpl;
+import com.intellij.pom.xml.XmlAspect;
+import com.intellij.pom.xml.impl.events.*;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.TokenType;
+import com.intellij.psi.XmlElementVisitor;
+import com.intellij.psi.impl.source.tree.FileElement;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.*;
+import com.intellij.util.CharTable;
+
+import java.util.Collections;
+
+public class XmlAspectImpl implements XmlAspect {
+  private final PomModel myModel;
+  private final TreeAspect myTreeAspect;
+
+  public XmlAspectImpl(PomModel model, TreeAspect aspect) {
+    myModel = model;
+    myTreeAspect = aspect;
+    myModel.registerAspect(XmlAspect.class, this, Collections.singleton((PomModelAspect)myTreeAspect));
+  }
+
+  public void update(PomModelEvent event) {
+    if (!event.getChangedAspects().contains(myTreeAspect)) return;
+    final TreeChangeEvent changeSet = (TreeChangeEvent)event.getChangeSet(myTreeAspect);
+    if (changeSet == null) return;
+    final ASTNode rootElement = changeSet.getRootElement();
+    final PsiFile file = (PsiFile)rootElement.getPsi();
+    if (!(file instanceof XmlFile)) return;
+    final XmlAspectChangeSetImpl xmlChangeSet = event.registerChangeSetIfAbsent(this, new XmlAspectChangeSetImpl(myModel));
+    xmlChangeSet.addChangedFile((XmlFile)file);
+
+    final ASTNode[] changedElements = changeSet.getChangedElements();
+    final CharTable table = ((FileElement)changeSet.getRootElement()).getCharTable();
+    for (ASTNode changedElement : changedElements) {
+      TreeChange changesByElement = changeSet.getChangesByElement(changedElement);
+      PsiElement psiElement = null;
+      while (changedElement != null && (psiElement = changedElement.getPsi()) == null) {
+        final ASTNode parent = changedElement.getTreeParent();
+        final ChangeInfoImpl changeInfo = ChangeInfoImpl.create(ChangeInfo.CONTENTS_CHANGED, changedElement);
+        changeInfo.compactChange(changesByElement);
+        changesByElement = new TreeChangeImpl(parent);
+        changesByElement.addChange(changedElement, changeInfo);
+        changedElement = parent;
+      }
+      if (changedElement == null) continue;
+      final TreeChange finalChangedElement = changesByElement;
+      psiElement.accept(new XmlElementVisitor() {
+        TreeChange myChange = finalChangedElement;
+
+        @Override
+        public void visitElement(PsiElement element) {
+          final ASTNode child = element.getNode();
+          final ASTNode treeParent = child.getTreeParent();
+          if (treeParent == null) return;
+          final PsiElement parent = treeParent.getPsi();
+          final ChangeInfoImpl changeInfo = ChangeInfoImpl.create(ChangeInfo.CONTENTS_CHANGED, child);
+
+          changeInfo.compactChange(myChange);
+          myChange = new TreeChangeImpl(treeParent);
+
+          myChange.addChange(child, changeInfo);
+          parent.accept(this);
+        }
+
+        @Override
+        public void visitXmlAttribute(XmlAttribute attribute) {
+          final ASTNode[] affectedChildren = myChange.getAffectedChildren();
+          String oldName = null;
+          String oldValue = null;
+          for (final ASTNode treeElement : affectedChildren) {
+            final ChangeInfo changeByChild = myChange.getChangeByChild(treeElement);
+            final int changeType = changeByChild.getChangeType();
+            if (treeElement.getElementType() == XmlTokenType.XML_NAME) {
+              if (changeType == ChangeInfo.REMOVED) {
+                oldName = treeElement.getText();
+              }
+              else if (changeType == ChangeInfo.REPLACE) {
+                oldName = ((ReplaceChangeInfo)changeByChild).getReplaced().getText();
+              }
+            }
+            if (treeElement.getElementType() == XmlElementType.XML_ATTRIBUTE_VALUE) {
+              if (changeType == ChangeInfo.REMOVED) {
+                oldValue = treeElement.getText();
+              }
+              else if (changeType == ChangeInfo.REPLACE) {
+                oldValue = ((ReplaceChangeInfo)changeByChild).getReplaced().getText();
+              }
+            }
+          }
+          if (oldName != null && !oldName.equals(attribute.getName())) {
+            xmlChangeSet.add(new XmlAttributeSetImpl(attribute.getParent(), oldName, null));
+            xmlChangeSet.add(new XmlAttributeSetImpl(attribute.getParent(), attribute.getName(), attribute.getValue()));
+          }
+          else if (oldValue != null) {
+            xmlChangeSet.add(new XmlAttributeSetImpl(attribute.getParent(), attribute.getName(), attribute.getValue()));
+          }
+          else {
+            xmlChangeSet.add(new XmlElementChangedImpl(attribute));
+          }
+        }
+
+        @Override
+        public void visitXmlTag(XmlTag tag) {
+          ASTNode[] affectedChildren = shortenChange(myChange.getAffectedChildren(), changeSet);
+
+          for (final ASTNode treeElement : affectedChildren) {
+            /*final IElementType type = treeElement.getElementType();
+            if (type == ElementType.WHITE_SPACE) continue;
+            if (type == ElementType.XML_NAME) {
+              if (myChange.getChangeByChild(treeElement).getChangeType() == ChangeInfo.REPLACE) {
+                continue;
+              }
+            }*/
+
+            if (!(treeElement.getPsi() instanceof XmlTagChild)) {
+              visitElement(tag);
+              return;
+            }
+          }
+
+          for (final ASTNode treeElement : affectedChildren) {
+            final ChangeInfo changeByChild = myChange.getChangeByChild(treeElement);
+            final int changeType = changeByChild.getChangeType();
+            final IElementType type = treeElement.getElementType();
+            if (type == TokenType.WHITE_SPACE) continue;
+            /*
+            if (type == ElementType.XML_NAME) {
+              final XmlToken xmlToken = (XmlToken)((ReplaceChangeInfo)changeByChild).getReplaced();
+              xmlChangeSet.add(new XmlTagNameChangedImpl(tag, xmlToken.getText()));
+              continue;
+            }
+            */
+
+            final PsiElement element = treeElement.getPsi();
+
+            switch (changeType) {
+              case ChangeInfo.ADD:
+                xmlChangeSet.add(new XmlTagChildAddImpl(tag, (XmlTagChild)element));
+                break;
+              case ChangeInfo.REMOVED:
+                treeElement.putUserData(CharTable.CHAR_TABLE_KEY, table);
+                xmlChangeSet.add(new XmlTagChildRemovedImpl(tag, (XmlTagChild)element));
+                break;
+              case ChangeInfo.CONTENTS_CHANGED:
+                xmlChangeSet.add(new XmlTagChildChangedImpl(tag, (XmlTagChild)element));
+                break;
+              case ChangeInfo.REPLACE:
+                final PsiElement psi = ((ReplaceChangeInfo)changeByChild).getReplaced().getPsi();
+                if (psi instanceof XmlTagChild) {
+                  final XmlTagChild replaced = (XmlTagChild)psi;
+                  replaced.putUserData(CharTable.CHAR_TABLE_KEY, table);
+                  xmlChangeSet.add(new XmlTagChildRemovedImpl(tag, replaced));
+                  xmlChangeSet.add(new XmlTagChildAddImpl(tag, (XmlTagChild)element));
+                }
+                break;
+            }
+          }
+        }
+
+        @Override
+        public void visitXmlDocument(XmlDocument document) {
+          xmlChangeSet.clear();
+          xmlChangeSet.add(new XmlDocumentChangedImpl(document));
+        }
+
+        @Override
+        public void visitFile(PsiFile file) {
+          final XmlDocument document = ((XmlFile)file).getDocument();
+
+          if (document != null) {
+            xmlChangeSet.clear();
+            xmlChangeSet.add(new XmlDocumentChangedImpl(document));
+          }
+        }
+      });
+    }
+  }
+
+  private ASTNode[] shortenChange(ASTNode[] affectedChildren, TreeChangeEvent event) {
+    // TODO
+    return affectedChildren;
+  }
+}
diff --git a/xml/impl/src/com/intellij/pom/xml/impl/events/XmlAttributeSetImpl.java b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlAttributeSetImpl.java
new file mode 100644
index 0000000..df7ac29
--- /dev/null
+++ b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlAttributeSetImpl.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.impl.events;
+
+import com.intellij.pom.PomModel;
+import com.intellij.pom.event.PomModelEvent;
+import com.intellij.pom.xml.XmlAspect;
+import com.intellij.pom.xml.XmlChangeVisitor;
+import com.intellij.pom.xml.events.XmlAttributeSet;
+import com.intellij.pom.xml.impl.XmlAspectChangeSetImpl;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+
+public class XmlAttributeSetImpl implements XmlAttributeSet {
+  private final String myName;
+  private final String myValue;
+  private final XmlTag myTag;
+
+  public XmlAttributeSetImpl(XmlTag xmlTag, String name, String value) {
+    myName = name;
+    myValue = value;
+    myTag = xmlTag;
+  }
+
+  public String getName() {
+    return myName;
+  }
+
+  public String getValue() {
+    return myValue;
+  }
+
+  public XmlTag getTag() {
+    return myTag;
+  }
+
+  public static PomModelEvent createXmlAttributeSet(PomModel model, XmlTag xmlTag, String name, String value) {
+    final PomModelEvent event = new PomModelEvent(model);
+    final XmlAspectChangeSetImpl xmlAspectChangeSet = new XmlAspectChangeSetImpl(model, PsiTreeUtil.getParentOfType(xmlTag, XmlFile.class));
+    xmlAspectChangeSet.add(new XmlAttributeSetImpl(xmlTag, name, value));
+    event.registerChangeSet(model.getModelAspect(XmlAspect.class), xmlAspectChangeSet);
+    return event;
+  }
+
+  @SuppressWarnings({"HardCodedStringLiteral"})
+  public String toString() {
+    return "Attribute \"" + getName() + "\" for tag \"" + getTag().getName() + "\" set to \"" + getValue() + "\"";
+  }
+
+  public void accept(XmlChangeVisitor visitor) {
+    visitor.visitXmlAttributeSet(this);
+  }
+}
diff --git a/xml/impl/src/com/intellij/pom/xml/impl/events/XmlDocumentChangedImpl.java b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlDocumentChangedImpl.java
new file mode 100644
index 0000000..508831b
--- /dev/null
+++ b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlDocumentChangedImpl.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.impl.events;
+
+import com.intellij.pom.PomModel;
+import com.intellij.pom.event.PomModelEvent;
+import com.intellij.pom.xml.XmlAspect;
+import com.intellij.pom.xml.XmlChangeVisitor;
+import com.intellij.pom.xml.events.XmlDocumentChanged;
+import com.intellij.pom.xml.impl.XmlAspectChangeSetImpl;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NotNull;
+
+public class XmlDocumentChangedImpl implements XmlDocumentChanged {
+  private final XmlDocument myDocument;
+
+  public XmlDocumentChangedImpl(@NotNull XmlDocument document) {
+    myDocument = document;
+  }
+
+  public XmlDocument getDocument() {
+    return myDocument;
+  }
+
+  public static PomModelEvent createXmlDocumentChanged(PomModel source, XmlDocument document) {
+    final PomModelEvent event = new PomModelEvent(source);
+    final XmlAspectChangeSetImpl xmlAspectChangeSet = new XmlAspectChangeSetImpl(source, (XmlFile)document.getParent());
+    xmlAspectChangeSet.add(new XmlDocumentChangedImpl(document));
+    event.registerChangeSet(source.getModelAspect(XmlAspect.class), xmlAspectChangeSet);
+    return event;
+  }
+
+  @SuppressWarnings({"HardCodedStringLiteral"})
+  public String toString() {
+    return "Xml document changed";
+  }
+
+  public void accept(XmlChangeVisitor visitor) {
+    visitor.visitDocumentChanged(this);
+  }
+}
diff --git a/xml/impl/src/com/intellij/pom/xml/impl/events/XmlElementChangedImpl.java b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlElementChangedImpl.java
new file mode 100644
index 0000000..50b1632
--- /dev/null
+++ b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlElementChangedImpl.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.impl.events;
+
+import com.intellij.pom.xml.XmlChangeVisitor;
+import com.intellij.pom.xml.events.XmlElementChanged;
+import com.intellij.psi.xml.XmlElement;
+
+public class XmlElementChangedImpl implements XmlElementChanged {
+  private final XmlElement myElement;
+
+  public XmlElementChangedImpl(XmlElement treeElement) {
+    myElement = treeElement;
+  }
+
+  public XmlElement getElement() {
+    return myElement;
+  }
+
+  public void accept(XmlChangeVisitor visitor) {
+    visitor.visitXmlElementChanged(this);
+  }
+
+  public String toString() {
+    return "Xml element changed: " + myElement;
+  }
+}
diff --git a/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTagChildAddImpl.java b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTagChildAddImpl.java
new file mode 100644
index 0000000..3ee06ba
--- /dev/null
+++ b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTagChildAddImpl.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.impl.events;
+
+import com.intellij.pom.xml.XmlChangeVisitor;
+import com.intellij.pom.xml.events.XmlTagChildAdd;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagChild;
+
+public class XmlTagChildAddImpl implements XmlTagChildAdd {
+  private final XmlTag myTag;
+  private final XmlTagChild myChild;
+  public XmlTagChildAddImpl(XmlTag context, XmlTagChild treeElement) {
+    myTag = context;
+    myChild = treeElement;
+  }
+
+  public XmlTag getTag() {
+    return myTag;
+  }
+
+  public XmlTagChild getChild() {
+    return myChild;
+  }
+
+  @SuppressWarnings({"HardCodedStringLiteral"})
+  public String toString() {
+    return "child added to " + getTag().getName() + " child: " + myChild.toString();
+  }
+
+  public void accept(XmlChangeVisitor visitor) {
+    visitor.visitXmlTagChildAdd(this);
+  }
+}
diff --git a/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTagChildChangedImpl.java b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTagChildChangedImpl.java
new file mode 100644
index 0000000..2568cb9
--- /dev/null
+++ b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTagChildChangedImpl.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.impl.events;
+
+import com.intellij.pom.PomModel;
+import com.intellij.pom.event.PomModelEvent;
+import com.intellij.pom.xml.XmlAspect;
+import com.intellij.pom.xml.XmlChangeVisitor;
+import com.intellij.pom.xml.events.XmlChange;
+import com.intellij.pom.xml.events.XmlTagChildChanged;
+import com.intellij.pom.xml.impl.XmlAspectChangeSetImpl;
+import com.intellij.pom.xml.XmlChangeVisitor;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagChild;
+
+public class XmlTagChildChangedImpl implements XmlTagChildChanged {
+  private final XmlTag myTag;
+  private final XmlTagChild myChild;
+  public XmlTagChildChangedImpl(XmlTag context, XmlTagChild treeElement) {
+    myTag = context;
+    myChild = treeElement;
+  }
+
+  public XmlTag getTag() {
+    return myTag;
+  }
+
+  public XmlTagChild getChild() {
+    return myChild;
+  }
+
+  public static PomModelEvent createXmlTagChildChanged(PomModel source, XmlTag context, XmlTagChild treeElement) {
+    final PomModelEvent event = new PomModelEvent(source);
+    final XmlAspectChangeSetImpl xmlAspectChangeSet = new XmlAspectChangeSetImpl(source, PsiTreeUtil.getParentOfType(context, XmlFile.class));
+    xmlAspectChangeSet.add(new XmlTagChildChangedImpl(context, treeElement));
+    event.registerChangeSet(source.getModelAspect(XmlAspect.class), xmlAspectChangeSet);
+    return event;
+  }
+  @SuppressWarnings({"HardCodedStringLiteral"})
+  public String toString() {
+    return "child changed in " + getTag().getName() + " child: " + myChild.toString();
+  }
+
+  public void accept(XmlChangeVisitor visitor) {
+    visitor.visitXmlTagChildChanged(this);
+  }
+}
diff --git a/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTagChildRemovedImpl.java b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTagChildRemovedImpl.java
new file mode 100644
index 0000000..dd92cac
--- /dev/null
+++ b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTagChildRemovedImpl.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.impl.events;
+
+import com.intellij.pom.xml.XmlChangeVisitor;
+import com.intellij.pom.xml.events.XmlTagChildRemoved;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagChild;
+
+public class XmlTagChildRemovedImpl implements XmlTagChildRemoved {
+  private final XmlTag myTag;
+  private final XmlTagChild myChild;
+  public XmlTagChildRemovedImpl(XmlTag context, XmlTagChild treeElement) {
+    myTag = context;
+    myChild = treeElement;
+  }
+
+  public XmlTag getTag() {
+    return myTag;
+  }
+
+  public XmlTagChild getChild() {
+    return myChild;
+  }
+
+  @SuppressWarnings({"HardCodedStringLiteral"})
+  public String toString() {
+    return "child removed from " + getTag().getName() + " child: " + myChild.toString();
+  }
+
+  public void accept(XmlChangeVisitor visitor) {
+    visitor.visitXmlTagChildRemoved(this);
+  }
+}
diff --git a/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTagNameChangedImpl.java b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTagNameChangedImpl.java
new file mode 100644
index 0000000..3457fe1
--- /dev/null
+++ b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTagNameChangedImpl.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.impl.events;
+
+import com.intellij.pom.PomModel;
+import com.intellij.pom.event.PomModelEvent;
+import com.intellij.pom.xml.XmlAspect;
+import com.intellij.pom.xml.impl.XmlAspectChangeSetImpl;
+import com.intellij.pom.xml.XmlChangeVisitor;
+import com.intellij.pom.xml.events.XmlTagNameChanged;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+
+public class XmlTagNameChangedImpl implements XmlTagNameChanged {
+  private final String myOldName;
+  private final XmlTag myTag;
+
+  public XmlTagNameChangedImpl(XmlTag tag, String oldName) {
+    myOldName = oldName;
+    myTag = tag;
+  }
+
+  public String getOldName() {
+    return myOldName;
+  }
+
+  public XmlTag getTag() {
+    return myTag;
+  }
+
+  public static PomModelEvent createXmlTagNameChanged(PomModel model, XmlTag tag, String oldName) {
+    final PomModelEvent event = new PomModelEvent(model);
+    final XmlAspectChangeSetImpl xmlAspectChangeSet = new XmlAspectChangeSetImpl(model, PsiTreeUtil.getParentOfType(tag, XmlFile.class));
+    xmlAspectChangeSet.add(new XmlTagNameChangedImpl(tag, oldName));
+    event.registerChangeSet(model.getModelAspect(XmlAspect.class), xmlAspectChangeSet);
+    return event;
+  }
+
+  @SuppressWarnings({"HardCodedStringLiteral"})
+  public String toString() {
+    return "tag name changed to " + getTag().getName() + " was: " + getOldName();
+  }
+
+  public void accept(XmlChangeVisitor visitor) {
+    visitor.visitXmlTagNameChanged(this);
+  }
+}
diff --git a/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTextChangedImpl.java b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTextChangedImpl.java
new file mode 100644
index 0000000..b191996
--- /dev/null
+++ b/xml/impl/src/com/intellij/pom/xml/impl/events/XmlTextChangedImpl.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.impl.events;
+
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.pom.PomModel;
+import com.intellij.pom.event.PomModelEvent;
+import com.intellij.pom.xml.XmlAspect;
+import com.intellij.pom.xml.events.XmlChange;
+import com.intellij.pom.xml.events.XmlTextChanged;
+import com.intellij.pom.xml.impl.XmlAspectChangeSetImpl;
+import com.intellij.pom.xml.XmlChangeVisitor;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlText;
+
+public class XmlTextChangedImpl implements XmlTextChanged {
+  private final String myOldText;
+  private final XmlText myText;
+  public XmlTextChangedImpl(XmlText xmlText, String oldText) {
+    myOldText = oldText;
+    myText = xmlText;
+  }
+
+  public String getOldText() {
+    return myOldText;
+  }
+
+  public XmlText getText() {
+    return myText;
+  }
+
+  public static PomModelEvent createXmlTextChanged(PomModel source, XmlText xmlText, String oldText) {
+    final PomModelEvent event = new PomModelEvent(source);
+    final XmlAspectChangeSetImpl xmlAspectChangeSet = new XmlAspectChangeSetImpl(source, PsiTreeUtil.getParentOfType(xmlText, XmlFile.class));
+    xmlAspectChangeSet.add(new XmlTextChangedImpl(xmlText, oldText));
+    event.registerChangeSet(source.getModelAspect(XmlAspect.class), xmlAspectChangeSet);
+    return event;
+  }
+
+  @SuppressWarnings({"HardCodedStringLiteral"})
+  public String toString() {
+    return "text changed to '" + StringUtil.escapeStringCharacters(myText.getValue()) + "' was: '"
+           + StringUtil.escapeStringCharacters(myOldText) + "'";
+  }
+
+  public void accept(XmlChangeVisitor visitor) {
+    visitor.visitXmlTextChanged(this);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/XmlElementFactoryImpl.java b/xml/impl/src/com/intellij/psi/XmlElementFactoryImpl.java
new file mode 100644
index 0000000..77c1b5e
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/XmlElementFactoryImpl.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi;
+
+import com.intellij.ide.highlighter.XHtmlFileType;
+import com.intellij.ide.highlighter.XmlFileType;
+import com.intellij.lang.ASTFactory;
+import com.intellij.lang.Language;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.util.XmlTagUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlElementFactoryImpl extends XmlElementFactory {
+
+  private final Project myProject;
+
+  public XmlElementFactoryImpl(Project project) {
+    myProject = project;
+  }
+
+  @NotNull
+  public XmlTag createTagFromText(@NotNull @NonNls String text, @NotNull Language language) throws IncorrectOperationException {
+    assert language instanceof XMLLanguage:"Tag can be created only for xml language";
+    FileType type = language.getAssociatedFileType();
+    if (type == null) type = StdFileTypes.XML;
+    final XmlDocument document = createXmlDocument(text, "dummy."+ type.getDefaultExtension(), type);
+    final XmlTag tag = document.getRootTag();
+    if (tag == null) throw new IncorrectOperationException("Incorrect tag text");
+    return tag;
+  }
+
+  @NotNull
+  public XmlTag createTagFromText(@NotNull String text) throws IncorrectOperationException {
+    return createTagFromText(text, StdFileTypes.XML.getLanguage());
+  }
+
+  @NotNull
+  public XmlAttribute createXmlAttribute(@NotNull String name, @NotNull String value) throws IncorrectOperationException {
+    final char quoteChar;
+    if (!value.contains("\"")) {
+      quoteChar = '"';
+    } else if (!value.contains("'")) {
+      quoteChar = '\'';
+    } else {
+      quoteChar = '"';
+      value = StringUtil.replace(value, "\"", "&quot;");
+    }
+    final XmlDocument document = createXmlDocument("<tag " + name + "=" + quoteChar + value + quoteChar + "/>", "dummy.xml",
+                                                   XmlFileType.INSTANCE);
+    XmlTag tag = document.getRootTag();
+    assert tag != null;
+    return tag.getAttributes()[0];
+  }
+
+  @NotNull
+  public XmlText createDisplayText(@NotNull String s) throws IncorrectOperationException {
+    final XmlTag tagFromText = createTagFromText("<a>" + XmlTagUtil.getCDATAQuote(s) + "</a>");
+    final XmlText[] textElements = tagFromText.getValue().getTextElements();
+    if (textElements.length == 0) return (XmlText)ASTFactory.composite(XmlElementType.XML_TEXT);
+    return textElements[0];
+  }
+
+  @NotNull
+  public XmlTag createXHTMLTagFromText(@NotNull String text) throws IncorrectOperationException {
+    final XmlDocument document = createXmlDocument(text, "dummy.xhtml", XHtmlFileType.INSTANCE);
+    final XmlTag tag = document.getRootTag();
+    assert tag != null;
+    return tag;
+  }
+
+  private XmlDocument createXmlDocument(@NonNls final String text, @NonNls final String fileName, FileType fileType) {
+    final XmlDocument document = ((XmlFile)PsiFileFactory.getInstance(myProject).createFileFromText(fileName, fileType, text)).getDocument();
+    assert document != null;
+    return document;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/filters/TagNameFilter.java b/xml/impl/src/com/intellij/psi/filters/TagNameFilter.java
new file mode 100644
index 0000000..e1846cd
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/filters/TagNameFilter.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.filters;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import org.jetbrains.annotations.NonNls;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 30.01.2003
+ * Time: 13:57:35
+ * To change this template use Options | File Templates.
+ */
+public class TagNameFilter extends PlainTextFilter {
+
+  public TagNameFilter(){
+    myValue = ArrayUtil.EMPTY_STRING_ARRAY;
+  }
+
+  public TagNameFilter(@NonNls String value, boolean insensitiveFlag) {
+    super(value, insensitiveFlag);
+  }
+
+  public TagNameFilter(@NonNls String value){
+    super(value);
+  }
+
+  public TagNameFilter(@NonNls String... values){
+    super(values);
+  }
+
+  public TagNameFilter(@NonNls String value1, @NonNls String value2){
+    super(value1, value2);
+  }
+
+  @Override
+  protected String getTextByElement(final Object element) {
+    if (element instanceof XmlTag) {
+      return ((XmlTag)element).getLocalName();
+    }
+    else {
+      return super.getTextByElement(element);
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/psi/filters/TextContainFilter.java b/xml/impl/src/com/intellij/psi/filters/TextContainFilter.java
new file mode 100644
index 0000000..0a7ce9e
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/filters/TextContainFilter.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.filters;
+
+import com.intellij.psi.PsiElement;
+
+/**
+ * @author spleaner
+ */
+public class TextContainFilter extends XmlTextFilter {
+  public TextContainFilter(String[] values){
+    super(values);
+  }
+
+  public TextContainFilter(String value1, String value2){
+    super(value1, value2);
+  }
+
+  public TextContainFilter(String value){
+    super(value);
+  }
+
+  public TextContainFilter(){}
+
+  public boolean isAcceptable(Object element, PsiElement context){
+    if(element != null) {
+      for (final String value : myValue) {
+        if (value == null) {
+          return true;
+        }
+        String elementValue = getTextByElement(element);
+        if (elementValue == null) return false;
+        if (elementValue.contains(value)) return true;
+      }
+    }
+
+    return false;
+  }
+
+
+}
diff --git a/xml/impl/src/com/intellij/psi/filters/TextStartFilter.java b/xml/impl/src/com/intellij/psi/filters/TextStartFilter.java
new file mode 100644
index 0000000..f11d806
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/filters/TextStartFilter.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.filters;
+
+import com.intellij.psi.PsiElement;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 27.08.2003
+ * Time: 18:18:38
+ * To change this template use Options | File Templates.
+ */
+public class TextStartFilter extends XmlTextFilter{
+  public TextStartFilter(String[] values){
+    super(values);
+  }
+
+  public TextStartFilter(String value1, String value2){
+    super(value1, value2);
+  }
+
+  public TextStartFilter(String value){
+    super(value);
+  }
+
+  public TextStartFilter(){}
+
+  public boolean isAcceptable(Object element, PsiElement context){
+    if(element != null) {
+      for (final String value : myValue) {
+        if (value == null) {
+          return true;
+        }
+        String elementValue = getTextByElement(element);
+        if (elementValue == null) return false;
+        if (elementValue.startsWith(value)) return true;
+      }
+    }
+
+    return false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/filters/XmlTagFilter.java b/xml/impl/src/com/intellij/psi/filters/XmlTagFilter.java
new file mode 100644
index 0000000..2b2e773
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/filters/XmlTagFilter.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.psi.filters;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlTag;
+
+public class XmlTagFilter implements ElementFilter {
+  public static final XmlTagFilter INSTANCE = new XmlTagFilter();
+
+  private XmlTagFilter() {}
+
+  public boolean isAcceptable(Object element, PsiElement context) {
+    return element instanceof XmlTag;
+  }
+
+  public boolean isClassAcceptable(Class hintClass) {
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/filters/XmlTextFilter.java b/xml/impl/src/com/intellij/psi/filters/XmlTextFilter.java
new file mode 100644
index 0000000..9f63343
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/filters/XmlTextFilter.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.filters;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import org.jetbrains.annotations.NonNls;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 30.01.2003
+ * Time: 13:57:35
+ * To change this template use Options | File Templates.
+ */
+public class XmlTextFilter implements ElementFilter, InitializableFilter{
+  protected String[] myValue;
+  private boolean myCaseInsensitiveFlag = false;
+
+  public XmlTextFilter(){
+    myValue = ArrayUtil.EMPTY_STRING_ARRAY;
+  }
+  public XmlTextFilter(@NonNls String value, boolean incensetiveFlag){
+    myCaseInsensitiveFlag = incensetiveFlag;
+    myValue = new String[1];
+    myValue[0] = value;
+  }
+
+  public XmlTextFilter(@NonNls String value){
+    myValue = new String[1];
+    myValue[0] = value;
+  }
+
+  public XmlTextFilter(@NonNls String... values){
+    myValue = values;
+  }
+
+  public XmlTextFilter(@NonNls String value1, @NonNls String value2){
+    myValue = new String[2];
+    myValue[0] = value1;
+    myValue[1] = value2;
+  }
+
+  public boolean isClassAcceptable(Class hintClass){
+    return true;
+  }
+
+  public boolean isAcceptable(Object element, PsiElement context){
+    if(element != null) {
+      for (final String value : myValue) {
+        if (value == null) {
+          return true;
+        }
+        final String elementText = getTextByElement(element);
+        if (myCaseInsensitiveFlag) {
+          if (value.equalsIgnoreCase(elementText)) return true;
+        }
+        else {
+          if (value.equals(elementText)) return true;
+        }
+      }
+    }
+
+    return false;
+  }
+
+  public String toString(){
+    String ret = "(";
+    for(int i = 0; i < myValue.length; i++){
+      ret += myValue[i];
+      if(i < myValue.length - 1){
+        ret += " | ";
+      }
+    }
+    ret += ")";
+    return ret;
+  }
+
+  public void init(Object[] fromGetter){
+    try{
+      myValue = new String[fromGetter.length];
+      System.arraycopy(fromGetter, 0, myValue, 0, fromGetter.length);
+    }
+    catch(ClassCastException cce){
+      myValue = ArrayUtil.EMPTY_STRING_ARRAY;
+    }
+  }
+
+  protected String getTextByElement(Object element){
+    String elementValue = null;
+    if(element instanceof PsiNamedElement){
+      if (element instanceof XmlTag) {
+        elementValue = ((XmlTag)element).getLocalName();
+      } else {
+        elementValue = ((PsiNamedElement)element).getName();
+      }
+    }
+    else if (element instanceof PsiElement) {
+      elementValue = ((PsiElement) element).getText();
+    }
+    return elementValue;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/filters/getters/HtmlAttributeValueGetter.java b/xml/impl/src/com/intellij/psi/filters/getters/HtmlAttributeValueGetter.java
new file mode 100644
index 0000000..6bc2334
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/filters/getters/HtmlAttributeValueGetter.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.filters.getters;
+
+import com.intellij.openapi.vfs.CharsetToolkit;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.nio.charset.Charset;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 24.11.2003
+ * Time: 14:17:59
+ * To change this template use Options | File Templates.
+ */
+public class HtmlAttributeValueGetter extends XmlAttributeValueGetter {
+  private final boolean myCaseSensitive;
+
+  public HtmlAttributeValueGetter(boolean _caseSensitive) {
+    myCaseSensitive = _caseSensitive;
+  }
+
+  @Nullable
+  @NonNls
+  protected String[] addSpecificCompletions(final XmlAttribute attribute) {
+    @NonNls String name = attribute.getName();
+    final XmlTag tag = attribute.getParent();
+    if (tag == null) return null;
+
+    @NonNls String tagName = tag.getName();
+    if (!myCaseSensitive) {
+      name = name.toLowerCase();
+      tagName = tagName.toLowerCase();
+    }
+
+    final String namespace = tag.getNamespace();
+    if (XmlUtil.XHTML_URI.equals(namespace) || XmlUtil.HTML_URI.equals(namespace)) {
+
+      if ("target".equals(name)) {
+        return new String[]{"_blank", "_top", "_self", "_parent"};
+      }
+      else if ("enctype".equals(name)) {
+        return new String[]{"multipart/form-data", "application/x-www-form-urlencoded"};
+      }
+      else if ("rel".equals(name) || "rev".equals(name)) {
+        return new String[]{"alternate", "stylesheet", "start", "next", "prev", "contents", "index", "glossary", "copyright", "chapter",
+            "section", "subsection", "appendix", "help", "bookmark", "script"};
+      }
+      else if ("media".equals(name)) {
+        return new String[]{"screen", "tty", "tv", "projection", "handheld", "print", "all", "aural", "braille"};
+      }
+      else if ("language".equals(name)) {
+        return new String[]{"JavaScript", "VBScript", "JScript", "JavaScript1.2", "JavaScript1.3", "JavaScript1.4", "JavaScript1.5"};
+      }
+      else if ("type".equals(name) && "link".equals(tagName)) {
+        return new String[]{"text/css", "text/html", "text/plain", "text/xml"};
+      }
+      else if ("http-equiv".equals(name) && "meta".equals(tagName)) {
+        return new String[]{"Accept", "Accept-Charset", "Accept-Encoding", "Accept-Language", "Accept-Ranges", "Age", "Allow",
+            "Authorization", "Cache-Control", "Connection", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location",
+            "Content-MD5", "Content-Range", "Content-Type", "Date", "ETag", "Expect", "Expires", "From", "Host", "If-Match",
+            "If-Modified-Since", "If-None-Match", "If-Range", "If-Unmodified-Since", "Last-Modified", "Location", "Max-Forwards", "Pragma",
+            "Proxy-Authenticate", "Proxy-Authorization", "Range", "Referer", "Refresh", "Retry-After", "Server", "TE", "Trailer", "Transfer-Encoding",
+            "Upgrade", "User-Agent", "Vary", "Via", "Warning", "WWW-Authenticate"};
+      }
+      else if("content".equals(name) && "meta".equals(tagName) && getAttribute(tag, "name") == null) {
+        return HtmlUtil.CONTENT_TYPES;
+      }
+      else if("accept-charset".equals(name) || "charset".equals(name)) {
+        Charset[] charSets = CharsetToolkit.getAvailableCharsets();
+        String[] names = new String[charSets.length];
+        for (int i = 0; i < names.length; i++) {
+          names[i] = charSets[i].toString();
+        }
+        return names;
+      }
+    }
+
+    return null;
+  }
+
+  @Nullable
+  private XmlAttribute getAttribute(@NotNull XmlTag tag, @NotNull String attributeName) {
+    if (myCaseSensitive) {
+      return tag.getAttribute(attributeName);
+    }
+
+    for (XmlAttribute xmlAttribute : tag.getAttributes()) {
+      if (attributeName.equalsIgnoreCase(xmlAttribute.getName())) {
+        return xmlAttribute;
+      }
+    }
+
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/filters/getters/XmlAttributeValueGetter.java b/xml/impl/src/com/intellij/psi/filters/getters/XmlAttributeValueGetter.java
new file mode 100644
index 0000000..ddf656d
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/filters/getters/XmlAttributeValueGetter.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.filters.getters;
+
+import com.intellij.codeInsight.completion.CompletionContext;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.filters.ContextGetter;
+import com.intellij.psi.impl.source.xml.XmlTokenImpl;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.impl.BasicXmlAttributeDescriptor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 24.11.2003
+ * Time: 14:17:59
+ * To change this template use Options | File Templates.
+ */
+public class XmlAttributeValueGetter implements ContextGetter {
+  public XmlAttributeValueGetter() {}
+
+  public Object[] get(PsiElement context, CompletionContext completionContext) {
+    return getApplicableAttributeVariants(context);
+  }
+
+  private Object[] getApplicableAttributeVariants(PsiElement _context) {
+    if (_context instanceof XmlTokenImpl && ((XmlTokenImpl)_context).getTokenType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN) {
+      XmlAttribute attr = PsiTreeUtil.getParentOfType(_context, XmlAttribute.class);
+      if (attr != null) {
+        final XmlAttributeDescriptor descriptor = attr.getDescriptor();
+
+        if (descriptor != null) {
+          if (descriptor.isFixed()) {
+            final String defaultValue = descriptor.getDefaultValue();
+            return defaultValue == null ? ArrayUtil.EMPTY_OBJECT_ARRAY : new Object[]{defaultValue};
+          }
+
+          String[] values = descriptor instanceof BasicXmlAttributeDescriptor ?
+                            ((BasicXmlAttributeDescriptor)descriptor).getEnumeratedValues(attr)
+                                                                              : descriptor.getEnumeratedValues();
+
+          final String[] strings = addSpecificCompletions(attr);
+
+          if (values == null || values.length == 0) {
+            values = strings;
+          }
+          else if (strings != null) {
+            values = ArrayUtil.mergeArrays(values, strings);
+          }
+
+          return values == null ? ArrayUtil.EMPTY_OBJECT_ARRAY : values;
+        }
+      }
+    }
+
+    return ArrayUtil.EMPTY_OBJECT_ARRAY;
+  }
+
+  @Nullable
+  protected String[] addSpecificCompletions(final XmlAttribute context) {
+    return null;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/psi/filters/position/RootTagFilter.java b/xml/impl/src/com/intellij/psi/filters/position/RootTagFilter.java
new file mode 100644
index 0000000..ea39b3f
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/filters/position/RootTagFilter.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.filters.position;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.filters.ElementFilter;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlTag;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 03.02.2003
+ * Time: 18:29:13
+ * To change this template use Options | File Templates.
+ */
+public class RootTagFilter extends PositionElementFilter{
+  public RootTagFilter(ElementFilter filter){
+    setFilter(filter);
+  }
+
+  public RootTagFilter(){}
+  public boolean isAcceptable(Object element, PsiElement scope){
+    if (!(element instanceof XmlDocument)) return false;
+    final XmlTag rootTag = ((XmlDocument)element).getRootTag();
+    if(rootTag == null) return false;
+
+    return getFilter().isAcceptable(rootTag, (PsiElement)element);
+  }
+
+  public String toString(){
+    return "roottag(" + getFilter().toString() + ")";
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/filters/position/TargetNamespaceFilter.java b/xml/impl/src/com/intellij/psi/filters/position/TargetNamespaceFilter.java
new file mode 100644
index 0000000..f64fe8b
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/filters/position/TargetNamespaceFilter.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.filters.position;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.filters.XmlTextFilter;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ReflectionCache;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 07.05.2003
+ * Time: 4:13:57
+ * To change this template use Options | File Templates.
+ */
+public class TargetNamespaceFilter extends XmlTextFilter {
+  public TargetNamespaceFilter(String str){
+    super(str);
+  }
+
+  public TargetNamespaceFilter(String[] strs){
+    super(strs);
+  }
+
+  public boolean isClassAcceptable(Class hintClass){
+    return ReflectionCache.isAssignable(XmlTag.class, hintClass) || ReflectionCache.isAssignable(XmlDocument.class, hintClass);
+  }
+
+  public boolean isAcceptable(Object element, PsiElement context){
+    if(element instanceof XmlTag){
+      final String attributeValue = ((XmlTag)element).getAttributeValue("targetNamespace");
+      if(attributeValue != null){
+        for (String aMyValue : myValue) {
+          if (aMyValue.equals(attributeValue)) return true;
+        }
+      }
+    }
+    else if(element instanceof XmlDocument){
+      return isAcceptable(((XmlDocument) element).getRootTag(), context);
+    }
+    return false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/filters/position/XmlTokenTypeFilter.java b/xml/impl/src/com/intellij/psi/filters/position/XmlTokenTypeFilter.java
new file mode 100644
index 0000000..c323476
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/filters/position/XmlTokenTypeFilter.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.filters.position;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.filters.ElementFilter;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.util.ReflectionCache;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 10.03.2003
+ * Time: 12:10:08
+ * To change this template use Options | File Templates.
+ */
+public class XmlTokenTypeFilter implements ElementFilter{
+  private IElementType myType = null;
+
+  public XmlTokenTypeFilter(){}
+
+  public XmlTokenTypeFilter(IElementType type){
+    myType = type;
+  }
+
+  public boolean isClassAcceptable(Class hintClass){
+    return ReflectionCache.isAssignable(XmlToken.class, hintClass);
+  }
+
+  public boolean isAcceptable(Object element, PsiElement context){
+    if(element instanceof PsiElement) {
+      final ASTNode node = ((PsiElement)element).getNode();
+      return node != null && node.getElementType() == myType;
+    }
+    else if(element instanceof ASTNode){
+      return ((ASTNode)element).getElementType() == myType;
+    }
+    return false;
+  }
+
+  public String toString(){
+    return "token-type(" + myType + ")";
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/psi/formatter/MarkupLineWrapPositionStrategy.java b/xml/impl/src/com/intellij/psi/formatter/MarkupLineWrapPositionStrategy.java
new file mode 100644
index 0000000..4db5fbe
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/formatter/MarkupLineWrapPositionStrategy.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.formatter;
+
+import com.intellij.openapi.editor.LineWrapPositionStrategy;
+import com.intellij.openapi.editor.PsiAwareDefaultLineWrapPositionStrategy;
+import com.intellij.psi.TokenType;
+import com.intellij.psi.xml.XmlElementType;
+
+/**
+ * {@link LineWrapPositionStrategy} for markup languages like XML, HTML etc.
+ * 
+ * @author Denis Zhdanov
+ * @since 5/11/11 7:42 PM
+ */
+public class MarkupLineWrapPositionStrategy extends PsiAwareDefaultLineWrapPositionStrategy {
+
+  public MarkupLineWrapPositionStrategy() {
+    super(true, XmlElementType.XML_TEXT, TokenType.WHITE_SPACE);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/AbstractSyntheticBlock.java b/xml/impl/src/com/intellij/psi/formatter/xml/AbstractSyntheticBlock.java
new file mode 100644
index 0000000..0eb42a2
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/formatter/xml/AbstractSyntheticBlock.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.formatter.xml;
+
+import com.intellij.formatting.*;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.formatter.common.AbstractBlock;
+import com.intellij.psi.impl.source.SourceTreeToPsiMap;
+import com.intellij.psi.templateLanguages.OuterLanguageElement;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTag;
+
+import java.util.List;
+
+
+public abstract class AbstractSyntheticBlock implements Block {
+  protected final Indent myIndent;
+  protected final XmlFormattingPolicy myXmlFormattingPolicy;
+  protected final ASTNode myEndTreeNode;
+  protected final ASTNode myStartTreeNode;
+  private final XmlTag myTag;
+
+  public AbstractSyntheticBlock(List<Block> subBlocks, Block parent, XmlFormattingPolicy policy, Indent indent) {
+    myEndTreeNode = getLastNode(subBlocks);
+    myStartTreeNode = getFirstNode(subBlocks);
+    myIndent = indent;
+    myXmlFormattingPolicy = policy;
+    if (parent instanceof AbstractXmlBlock) {
+      myTag = ((AbstractXmlBlock)parent).getTag();
+    }
+    else if (parent instanceof AbstractSyntheticBlock) {
+      myTag = ((AbstractSyntheticBlock)parent).getTag();
+    } else {
+      throw new IllegalStateException("Parent should be AbstractXmlBlock or AbstractSyntheticBlock, but it is " + parent.getClass());
+    }
+
+  }
+
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.formatter.xml.AbstractSyntheticBlock");
+
+  private ASTNode getFirstNode(final List<Block> subBlocks) {
+    LOG.assertTrue(!subBlocks.isEmpty());
+    final Block firstBlock = subBlocks.get(0);
+    if (firstBlock instanceof AbstractBlock) {
+      return ((AbstractBlock)firstBlock).getNode();
+    }
+    else {
+      return getFirstNode(firstBlock.getSubBlocks());
+    }
+  }
+
+  private ASTNode getLastNode(final List<Block> subBlocks) {
+    LOG.assertTrue(!subBlocks.isEmpty());
+    final Block lastBlock = subBlocks.get(subBlocks.size() - 1);
+    if (lastBlock instanceof AbstractBlock) {
+      return ((AbstractBlock)lastBlock).getNode();
+    }
+    else {
+      return getLastNode(lastBlock.getSubBlocks());
+    }
+  }
+
+  private boolean isEndOfTag() {
+    return myEndTreeNode.getElementType() == XmlElementType.XML_TAG_END;
+  }
+
+  public Wrap getWrap() {
+    return null;
+  }
+
+  public Indent getIndent() {
+    return myIndent;
+  }
+
+  public Alignment getAlignment() {
+    return null;
+  }
+
+  protected static boolean isXmlTagName(final IElementType type1, final IElementType type2) {
+    if (type1 == XmlElementType.XML_NAME && type2 == XmlElementType.XML_TAG_END) return true;
+    if (type1 == XmlElementType.XML_NAME && type2 == XmlElementType.XML_EMPTY_ELEMENT_END) return true;
+    if (type1 == XmlElementType.XML_ATTRIBUTE && type2 == XmlElementType.XML_EMPTY_ELEMENT_END) return true;
+    return type1 == XmlElementType.XML_ATTRIBUTE && type2 == XmlElementType.XML_TAG_END;
+  }
+
+  public boolean endsWithText() {
+    return myEndTreeNode.getElementType() == XmlElementType.XML_TEXT ||
+           myEndTreeNode.getElementType() == XmlElementType.XML_DATA_CHARACTERS;
+  }
+
+  public boolean isTagDescription() {
+    final ASTNode startTreeNode = myStartTreeNode;
+    return isTagDescription(startTreeNode);
+  }
+
+  private static boolean isTagDescription(final ASTNode startTreeNode) {
+    return startTreeNode.getElementType() == XmlElementType.XML_START_TAG_START ||
+           startTreeNode.getElementType() == XmlElementType.XML_END_TAG_START;
+  }
+
+  public boolean startsWithText() {
+    return myStartTreeNode.getElementType() == XmlElementType.XML_TEXT ||
+           myStartTreeNode.getElementType() == XmlElementType.XML_DATA_CHARACTERS;
+  }
+
+  public boolean endsWithTextElement() {
+    if (endsWithText()) return true;
+    if (isEndOfTag() && myXmlFormattingPolicy.isTextElement(getTag())) return true;
+    return isTextTag(myEndTreeNode);
+  }
+
+  protected XmlTag getTag() {
+    return myTag;
+  }
+
+  public boolean startsWithTextElement() {
+    if (startsWithText()) return true;
+    if (isStartOfTag() && myXmlFormattingPolicy.isTextElement(getTag())) return true;
+    return isTextTag(myStartTreeNode);
+  }
+
+  private boolean isTextTag(final ASTNode treeNode) {
+    return isXmlTag(treeNode) && myXmlFormattingPolicy.isTextElement((XmlTag)SourceTreeToPsiMap.treeElementToPsi(treeNode));
+  }
+
+  private boolean isXmlTag(final ASTNode treeNode) {
+    return (treeNode.getPsi() instanceof XmlTag);
+  }
+
+  private boolean isStartOfTag() {
+    return isTagDescription(myStartTreeNode);
+  }
+
+  protected static TextRange calculateTextRange(final List<Block> subBlocks) {
+    return new TextRange(subBlocks.get(0).getTextRange().getStartOffset(),
+                         subBlocks.get(subBlocks.size() - 1).getTextRange().getEndOffset());
+  }
+
+  public boolean isIncomplete() {
+    return getSubBlocks().get(getSubBlocks().size() - 1).isIncomplete();
+  }
+
+  public boolean startsWithTag() {
+    return isXmlTag(myStartTreeNode);
+  }
+
+  public XmlTag getStartTag() {
+    return (XmlTag)myStartTreeNode.getPsi();
+  }
+
+
+  public boolean endsWithTag() {
+    return isXmlTag(myEndTreeNode);
+  }
+
+  public boolean isJspTextBlock() {
+    return false;
+  }
+
+  public boolean isJspxTextBlock() {
+    return false;
+  }
+
+  /**
+   * Checks if the block contains a single node which belongs to the outer (template) language.
+   *
+   * @return True if it does, False otherwise.
+   */
+  public boolean isOuterLanguageBlock() {
+    return (myStartTreeNode == myEndTreeNode) && (myStartTreeNode instanceof OuterLanguageElement);
+  }
+
+  public boolean isLeaf() {
+    return false;
+  }
+
+  public boolean startsWithCDATA() {
+    return isCDATA(myStartTreeNode.getFirstChildNode());
+  }
+
+  private boolean isCDATA(final ASTNode node) {
+    return node != null && node.getElementType() == XmlElementType.XML_CDATA;
+  }
+
+  public boolean containsCDATA() {
+    return myStartTreeNode.getElementType() == XmlElementType.XML_CDATA_START &&
+           myEndTreeNode.getElementType() == XmlElementType.XML_CDATA_END;
+  }
+
+  public boolean endsWithCDATA() {
+    return isCDATA(myStartTreeNode.getLastChildNode());
+  }
+
+  public boolean insertLineFeedAfter() {
+    final List<Block> subBlocks = getSubBlocks();
+    final Block lastBlock = subBlocks.get(subBlocks.size() - 1);
+    if (lastBlock instanceof XmlTagBlock) {
+      return insertLineFeedAfter(((XmlTagBlock)lastBlock).getTag());
+    }
+    if (endsWithText()) {
+      return insertLineFeedAfter(myTag);
+    }
+    return false;
+  }
+
+  protected boolean insertLineFeedAfter(final XmlTag tag) {
+    return myXmlFormattingPolicy.getWrappingTypeForTagBegin(tag) == WrapType.ALWAYS;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/AbstractXmlBlock.java b/xml/impl/src/com/intellij/psi/formatter/xml/AbstractXmlBlock.java
new file mode 100644
index 0000000..4609f73
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/formatter/xml/AbstractXmlBlock.java
@@ -0,0 +1,477 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.formatter.xml;
+
+import com.intellij.formatting.*;
+import com.intellij.lang.*;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.*;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.formatter.WhiteSpaceFormattingStrategy;
+import com.intellij.psi.formatter.WhiteSpaceFormattingStrategyFactory;
+import com.intellij.psi.formatter.common.AbstractBlock;
+import com.intellij.psi.impl.source.SourceTreeToPsiMap;
+import com.intellij.psi.impl.source.tree.LeafElement;
+import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.impl.source.tree.TreeUtil;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.templateLanguages.TemplateLanguageFileViewProvider;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.xml.*;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public abstract class AbstractXmlBlock extends AbstractBlock {
+  protected XmlFormattingPolicy myXmlFormattingPolicy;
+  protected XmlInjectedLanguageBlockBuilder myInjectedBlockBuilder;
+  private boolean myPreserveSpace;
+
+  protected AbstractXmlBlock(final ASTNode node,
+                            final Wrap wrap,
+                            final Alignment alignment,
+                            final XmlFormattingPolicy policy) {
+    this(node, wrap, alignment, policy, false);
+  }
+
+
+  protected AbstractXmlBlock(final ASTNode node,
+                          final Wrap wrap,
+                          final Alignment alignment,
+                          final XmlFormattingPolicy policy,
+                          final boolean preserveSpace) {
+    super(node, wrap, alignment);
+    myXmlFormattingPolicy = policy;
+    if (node == null) {
+      LOG.assertTrue(false);
+    }
+    if (node.getTreeParent() == null) {
+      myXmlFormattingPolicy.setRootBlock(node, this);
+    }
+    myInjectedBlockBuilder = new XmlInjectedLanguageBlockBuilder(myXmlFormattingPolicy);
+    myPreserveSpace = shouldPreserveSpace(node, preserveSpace);
+  }
+
+
+  /**
+   * Handles xml:space='preserve|default' attribute.
+   * See <a href="http://www.w3.org/TR/2004/REC-xml-20040204/#sec-white-space">Extensible Markup Language (XML) 1.0 (Third Edition),
+   * White Space Handling</a>
+   *
+   * @return True if the space must be preserved (xml:space='preserve'), false if the attribute
+   *         contains 'default'. If the attribute is not defined, return the current value.
+   */ 
+  private static boolean shouldPreserveSpace(ASTNode node, boolean defaultValue) {
+    if (node.getPsi() instanceof XmlTag) {
+      XmlTag tag = (XmlTag)node.getPsi();
+      if (tag != null) {
+        XmlAttribute spaceAttr = tag.getAttribute("xml:space");
+        if (spaceAttr != null) {
+          String value = spaceAttr.getValue();
+          if ("preserve".equals(value)) {
+            return true;
+          }
+          if ("default".equals(value))  {
+            return false;
+          }
+        }
+      }
+    }
+    return defaultValue;
+  }
+  
+  public boolean isPreserveSpace() {
+    return myPreserveSpace;
+  }
+
+
+  public static WrapType getWrapType(final int type) {
+    if (type == CodeStyleSettings.DO_NOT_WRAP) return WrapType.NONE;
+    if (type == CodeStyleSettings.WRAP_ALWAYS) return WrapType.ALWAYS;
+    if (type == CodeStyleSettings.WRAP_AS_NEEDED) return WrapType.NORMAL;
+    return WrapType.CHOP_DOWN_IF_LONG;
+  }
+
+  protected Alignment chooseAlignment(final ASTNode child, final Alignment attrAlignment, final Alignment textAlignment) {
+    if (myNode.getElementType() == XmlElementType.XML_TEXT) return getAlignment();
+    final IElementType elementType = child.getElementType();
+    if (elementType == XmlElementType.XML_ATTRIBUTE && myXmlFormattingPolicy.getShouldAlignAttributes()) return attrAlignment;
+    if (elementType == XmlElementType.XML_TEXT && myXmlFormattingPolicy.getShouldAlignText()) return textAlignment;
+    return null;
+  }
+
+  private Wrap getTagEndWrapping(final XmlTag parent) {
+    return Wrap.createWrap(myXmlFormattingPolicy.getWrappingTypeForTagEnd(parent), true);
+  }
+
+  protected Wrap chooseWrap(final ASTNode child, final Wrap tagBeginWrap, final Wrap attrWrap, final Wrap textWrap) {
+    if (myNode.getElementType() == XmlElementType.XML_TEXT) return textWrap;
+    final IElementType elementType = child.getElementType();
+    if (elementType == XmlElementType.XML_ATTRIBUTE) return attrWrap;
+    if (elementType == XmlElementType.XML_START_TAG_START) return tagBeginWrap;
+    if (elementType == XmlElementType.XML_END_TAG_START) {
+      final PsiElement parent = SourceTreeToPsiMap.treeElementToPsi(child.getTreeParent());
+      if (parent instanceof XmlTag) {
+        final XmlTag tag = (XmlTag)parent;
+        if (canWrapTagEnd(tag)) {
+          return getTagEndWrapping(tag);
+        }
+      }
+      return null;
+    }
+    if (elementType == XmlElementType.XML_TEXT || elementType == XmlElementType.XML_DATA_CHARACTERS) return textWrap;
+    return null;
+  }
+
+  protected boolean canWrapTagEnd(final XmlTag tag) {
+    return tag.getSubTags().length > 0;
+  }
+
+  protected XmlTag getTag() {
+    return getTag(myNode);
+  }
+
+  protected static XmlTag getTag(final ASTNode node) {
+    final PsiElement element = SourceTreeToPsiMap.treeElementToPsi(node);
+    if (element instanceof XmlTag) {
+      return (XmlTag)element;
+    }
+    else {
+      return null;
+    }
+  }
+
+  protected Wrap createTagBeginWrapping(final XmlTag tag) {
+    return Wrap.createWrap(myXmlFormattingPolicy.getWrappingTypeForTagBegin(tag), true);
+  }
+
+  protected
+  @Nullable
+  ASTNode processChild(List<Block> result,
+                       final ASTNode child,
+                       final Wrap wrap,
+                       final Alignment alignment,
+                       final Indent indent) {
+    final Language myLanguage = myNode.getPsi().getLanguage();
+    final PsiElement childPsi = child.getPsi();
+    final Language childLanguage = childPsi.getLanguage();
+    if (useMyFormatter(myLanguage, childLanguage, childPsi)) {
+
+      XmlTag tag = getAnotherTreeTag(child);
+      if (tag != null
+          && containsTag(tag)
+          && doesNotIntersectSubTagsWith(tag)) {
+        ASTNode currentChild = createAnotherTreeNode(result, child, tag, indent, wrap, alignment);
+
+        if (currentChild == null) {
+          return null;
+        }
+
+        while (currentChild != null && currentChild.getTreeParent() != myNode && currentChild.getTreeParent() != child.getTreeParent()) {
+          currentChild = processAllChildrenFrom(result, currentChild, wrap, alignment, indent);
+          if (currentChild != null && (currentChild.getTreeParent() == myNode || currentChild.getTreeParent() == child.getTreeParent())) {
+            return currentChild;
+          }
+          if (currentChild != null) {
+            currentChild = currentChild.getTreeParent();
+
+          }
+        }
+
+        return currentChild;
+      }
+
+      processSimpleChild(child, indent, result, wrap, alignment);
+      return child;
+    }
+    else {
+      myInjectedBlockBuilder.addInjectedLanguageBlockWrapper(result, child, indent, 0, null);
+      return child;
+    }
+  }
+
+  protected boolean doesNotIntersectSubTagsWith(final PsiElement tag) {
+    final TextRange tagRange = tag.getTextRange();
+    final XmlTag[] subTags = getSubTags();
+    for (XmlTag subTag : subTags) {
+      final TextRange subTagRange = subTag.getTextRange();
+      if (subTagRange.getEndOffset() < tagRange.getStartOffset()) continue;
+      if (subTagRange.getStartOffset() > tagRange.getEndOffset()) return true;
+
+      if (tagRange.getStartOffset() > subTagRange.getStartOffset() && tagRange.getEndOffset() < subTagRange.getEndOffset()) return false;
+      if (tagRange.getEndOffset() > subTagRange.getStartOffset() && tagRange.getEndOffset() < subTagRange.getEndOffset()) return false;
+
+    }
+    return true;
+  }
+
+  private XmlTag[] getSubTags() {
+
+    if (myNode instanceof XmlTag) {
+      return ((XmlTag)myNode.getPsi()).getSubTags();
+    }
+    else if (myNode.getPsi() instanceof XmlElement) {
+      return collectSubTags((XmlElement)myNode.getPsi());
+    }
+    else {
+      return new XmlTag[0];
+    }
+
+  }
+
+  private static XmlTag[] collectSubTags(final XmlElement node) {
+    final List<XmlTag> result = new ArrayList<XmlTag>();
+    node.processElements(new PsiElementProcessor() {
+      public boolean execute(@NotNull final PsiElement element) {
+        if (element instanceof XmlTag) {
+          result.add((XmlTag)element);
+        }
+        return true;
+      }
+    }, node);
+    return result.toArray(new XmlTag[result.size()]);
+  }
+
+  protected boolean containsTag(final PsiElement tag) {
+    final ASTNode closingTagStart = XmlChildRole.CLOSING_TAG_START_FINDER.findChild(myNode);
+    final ASTNode startTagStart = XmlChildRole.START_TAG_END_FINDER.findChild(myNode);
+
+    if (closingTagStart == null && startTagStart == null) {
+      return tag.getTextRange().getEndOffset() <= myNode.getTextRange().getEndOffset();
+    }
+    else if (closingTagStart == null) {
+      return false;
+    }
+    else {
+      return tag.getTextRange().getEndOffset() <= closingTagStart.getTextRange().getEndOffset();
+    }
+  }
+
+  private ASTNode processAllChildrenFrom(final List<Block> result,
+                                         final @NotNull ASTNode child,
+                                         final Wrap wrap,
+                                         final Alignment alignment,
+                                         final Indent indent) {
+    ASTNode resultNode = child;
+    ASTNode currentChild = child.getTreeNext();
+    while (currentChild != null && currentChild.getElementType() != XmlElementType.XML_END_TAG_START) {
+      if (!containsWhiteSpacesOnly(currentChild)) {
+        currentChild = processChild(result, currentChild, wrap, alignment, indent);
+        resultNode = currentChild;
+      }
+      if (currentChild != null) {
+        currentChild = currentChild.getTreeNext();
+      }
+    }
+    return resultNode;
+  }
+
+  protected void processSimpleChild(final ASTNode child,
+                                  final Indent indent,
+                                  final List<Block> result,
+                                  final Wrap wrap,
+                                  final Alignment alignment) {
+    if (isXmlTag(child)) {
+      result.add(createTagBlock(child, indent != null ? indent : Indent.getNoneIndent(), wrap, alignment));
+    } else if (child.getElementType() == XmlElementType.XML_DOCTYPE) {
+      result.add(
+        new XmlBlock(child, wrap, alignment, myXmlFormattingPolicy, indent, null, isPreserveSpace()) {
+          protected Wrap getDefaultWrap(final ASTNode node) {
+            final IElementType type = node.getElementType();
+            return type == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN ? Wrap.createWrap(getWrapType(myXmlFormattingPolicy.getAttributesWrap()), false) : null;
+          }
+        }
+      );
+    }
+    else {
+      result.add(createSimpleChild(child, indent, wrap, alignment));
+    }
+  }
+
+
+  protected XmlBlock createSimpleChild(final ASTNode child, final Indent indent, final Wrap wrap, final Alignment alignment) {
+    return new XmlBlock(child, wrap, alignment, myXmlFormattingPolicy, indent, null, isPreserveSpace());
+  }
+
+  protected XmlTagBlock createTagBlock(final ASTNode child, final Indent indent, final Wrap wrap, final Alignment alignment) {
+    return new XmlTagBlock(child, wrap, alignment, myXmlFormattingPolicy, indent != null ? indent : Indent.getNoneIndent(), isPreserveSpace());
+  }
+
+  @Nullable
+  protected XmlTag findXmlTagAt(final ASTNode child, final int startOffset) {
+    return null; 
+  }
+
+  @Nullable
+  protected ASTNode createAnotherTreeNode(final List<Block> result,
+                                            final ASTNode child,
+                                            PsiElement tag,
+                                            final Indent indent,
+                                            final Wrap wrap, final Alignment alignment) {
+    return null;
+  }
+
+  @Nullable
+  protected Block createAnotherTreeTagBlock(final PsiElement tag, final Indent childIndent) {
+    return null;
+  }
+
+  protected XmlFormattingPolicy createPolicyFor() {
+    return myXmlFormattingPolicy;
+  }
+
+  private CodeStyleSettings getSettings() {
+    return myXmlFormattingPolicy.getSettings();
+  }
+
+  @Nullable
+  protected XmlTag getAnotherTreeTag(final ASTNode child) {
+    return null;
+
+  }
+  protected boolean isXmlTag(final ASTNode child) {
+    return isXmlTag(child.getPsi());
+  }
+
+  protected boolean isXmlTag(final PsiElement psi) {
+    return psi instanceof XmlTag;
+  }
+
+  protected boolean useMyFormatter(final Language myLanguage, final Language childLanguage, final PsiElement childPsi) {
+    if (myLanguage == childLanguage ||
+        childLanguage == StdFileTypes.HTML.getLanguage() ||
+        childLanguage == StdFileTypes.XHTML.getLanguage() ||
+        childLanguage == StdFileTypes.XML.getLanguage()) {
+      return true;
+    }
+    final FormattingModelBuilder childFormatter = LanguageFormatting.INSTANCE.forLanguage(childLanguage);
+    return childFormatter == null ||
+           childFormatter instanceof DelegatingFormattingModelBuilder &&
+           ((DelegatingFormattingModelBuilder)childFormatter).dontFormatMyModel();
+  }
+
+  protected boolean isJspxJavaContainingNode(final ASTNode child) {
+    return false;
+  }
+
+  public abstract boolean insertLineBreakBeforeTag();
+
+  public abstract boolean removeLineBreakBeforeTag();
+
+  protected Spacing createDefaultSpace(boolean forceKeepLineBreaks, final boolean inText) {
+    boolean shouldKeepLineBreaks = getShouldKeepLineBreaks(inText, forceKeepLineBreaks);
+    return Spacing.createSpacing(0, Integer.MAX_VALUE, 0, shouldKeepLineBreaks, myXmlFormattingPolicy.getKeepBlankLines());
+  }
+
+  private boolean getShouldKeepLineBreaks(final boolean inText, final boolean forceKeepLineBreaks) {
+    if (forceKeepLineBreaks) {
+      return true;
+    }
+    if (inText && myXmlFormattingPolicy.getShouldKeepLineBreaksInText()) {
+      return true;
+    }
+    if (!inText && myXmlFormattingPolicy.getShouldKeepLineBreaks()) {
+      return true;
+    }
+    return false;
+  }
+
+  public abstract boolean isTextElement();
+
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.formatter.xml.AbstractXmlBlock");
+
+  protected void createJspTextNode(final List<Block> localResult, final ASTNode child, final Indent indent) {
+  }
+
+  @Nullable
+  protected static ASTNode findChildAfter(@NotNull final ASTNode child, final int endOffset) {
+    TreeElement fileNode = TreeUtil.getFileElement((TreeElement)child);
+    final LeafElement leaf = fileNode.findLeafElementAt(endOffset);
+    if (leaf != null && leaf.getStartOffset() == endOffset && endOffset > 0) {
+      return fileNode.findLeafElementAt(endOffset - 1);
+    }
+    return leaf;
+  }
+
+  public boolean isLeaf() {
+    return (isComment(myNode)) ||
+           myNode.getElementType() == TokenType.WHITE_SPACE ||
+           myNode.getElementType() == XmlElementType.XML_DATA_CHARACTERS ||
+           myNode.getElementType() == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN;
+  }
+
+  private static  boolean isComment(final ASTNode node) {
+    final PsiElement psiElement = SourceTreeToPsiMap.treeElementToPsi(node);
+    if (psiElement instanceof PsiComment) return true;
+    final ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(psiElement.getLanguage());
+    if (parserDefinition == null) return false;
+    final TokenSet commentTokens = parserDefinition.getCommentTokens();
+    return commentTokens.contains(node.getElementType());
+  }
+
+  public void setXmlFormattingPolicy(final XmlFormattingPolicy xmlFormattingPolicy) {
+    myXmlFormattingPolicy = xmlFormattingPolicy;
+  }
+
+  protected boolean buildInjectedPsiBlocks(List<Block> result, final ASTNode child, Wrap wrap, Alignment alignment, Indent indent) {
+    if (myInjectedBlockBuilder.addInjectedBlocks(result, child, wrap, alignment, indent)) {
+      return true;
+    }
+
+    PsiFile containingFile = child.getPsi().getContainingFile();
+    FileViewProvider fileViewProvider = containingFile.getViewProvider();
+
+    if (fileViewProvider instanceof TemplateLanguageFileViewProvider) {
+      Language templateLanguage = ((TemplateLanguageFileViewProvider)fileViewProvider).getTemplateDataLanguage();
+      PsiElement at = fileViewProvider.findElementAt(child.getStartOffset(), templateLanguage);
+
+      if (at instanceof XmlToken) {
+        at = at.getParent();
+      }
+
+      // TODO: several comments
+      if (at instanceof PsiComment &&
+          at.getTextRange().equals(child.getTextRange()) &&
+          at.getNode() != child) {
+        return buildInjectedPsiBlocks(result, at.getNode(), wrap, alignment, indent);
+      }
+    }
+
+    return false;
+  }
+
+  public boolean isCDATAStart() {
+    return myNode.getElementType() == XmlElementType.XML_CDATA_START;
+  }
+
+  public boolean isCDATAEnd() {
+    return myNode.getElementType() == XmlElementType.XML_CDATA_END;
+  }
+
+  public static boolean containsWhiteSpacesOnly(ASTNode node) {
+    WhiteSpaceFormattingStrategy strategy =  WhiteSpaceFormattingStrategyFactory.getStrategy(node.getPsi().getLanguage());
+    String nodeText = node.getText();
+    int length = nodeText.length();
+    return strategy.check(nodeText, 0, length) >= length;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/AnotherLanguageBlockWrapper.java b/xml/impl/src/com/intellij/psi/formatter/xml/AnotherLanguageBlockWrapper.java
new file mode 100644
index 0000000..d33a2aa
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/formatter/xml/AnotherLanguageBlockWrapper.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.formatter.xml;
+
+import com.intellij.formatting.Block;
+import com.intellij.formatting.ChildAttributes;
+import com.intellij.formatting.Indent;
+import com.intellij.formatting.Spacing;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.formatter.common.InjectedLanguageBlockWrapper;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+public class AnotherLanguageBlockWrapper extends AbstractXmlBlock{
+  private final InjectedLanguageBlockWrapper myInjectedBlock;
+  private final Indent myIndent;
+
+  public AnotherLanguageBlockWrapper(final ASTNode node,
+                                     final XmlFormattingPolicy policy,
+                                     final Block original, final Indent indent,
+                                     final int offset,
+                                     @Nullable TextRange range) {
+    super(node, original.getWrap(), original.getAlignment(), policy, false);
+    myInjectedBlock = new InjectedLanguageBlockWrapper(original, offset, range, null);
+    myIndent = indent;
+  }
+
+  public Indent getIndent() {
+    return myIndent;
+  }
+
+  public boolean insertLineBreakBeforeTag() {
+    return false;
+  }
+
+  public boolean removeLineBreakBeforeTag() {
+    return false;
+  }
+
+  public boolean isTextElement() {
+    return true;
+  }
+
+  protected List<Block> buildChildren() {
+    return myInjectedBlock.getSubBlocks();
+  }
+
+  @NotNull
+  public TextRange getTextRange() {
+    return myInjectedBlock.getTextRange();
+  }
+
+  @Nullable
+  public Spacing getSpacing(Block child1, @NotNull Block child2) {
+    return myInjectedBlock.getSpacing(child1,  child2);
+  }
+
+  @NotNull
+  public ChildAttributes getChildAttributes(final int newChildIndex) {
+    return myInjectedBlock.getChildAttributes(newChildIndex);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/HtmlPolicy.java b/xml/impl/src/com/intellij/psi/formatter/xml/HtmlPolicy.java
new file mode 100644
index 0000000..48c1502
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/formatter/xml/HtmlPolicy.java
@@ -0,0 +1,247 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.formatter.xml;
+
+import com.intellij.formatting.FormattingDocumentModel;
+import com.intellij.formatting.WrapType;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.TokenType;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.impl.source.SourceTreeToPsiMap;
+import com.intellij.psi.impl.source.tree.LeafElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTag;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class HtmlPolicy extends XmlFormattingPolicy {
+  
+  protected final CodeStyleSettings mySettings;
+
+  public HtmlPolicy(final CodeStyleSettings settings, final FormattingDocumentModel documentModel) {
+    super(documentModel);
+    mySettings = settings;
+
+  }
+
+  public boolean indentChildrenOf(final XmlTag parentTag) {
+    if (parentTag == null) {
+      return true;
+    }
+    final PsiElement firstChild = findFirstNonEmptyChild(parentTag);
+
+    if (firstChild == null) {
+      return false;
+    }
+
+    if (firstChild.getNode().getElementType() != XmlElementType.XML_START_TAG_START) {
+      return false;
+    }
+
+    if (mySettings.HTML_DO_NOT_ALIGN_CHILDREN_OF_MIN_LINES > 0 && getLines(parentTag) > mySettings.HTML_DO_NOT_ALIGN_CHILDREN_OF_MIN_LINES)
+    {
+      return false;
+    }
+    else {
+      return !checkName(parentTag, mySettings.HTML_DO_NOT_INDENT_CHILDREN_OF);
+    }
+  }
+
+  private PsiElement findFirstNonEmptyChild(final XmlTag parentTag) {
+    PsiElement result = parentTag.getFirstChild();
+    while (result != null && result.getTextLength() == 0) {
+      result = result.getNextSibling();
+    }
+    return result;
+  }
+
+  private int getLines(final XmlTag parentTag) {
+    final TextRange textRange = parentTag.getTextRange();
+    return myDocumentModel.getLineNumber(textRange.getEndOffset()) - myDocumentModel.getLineNumber(textRange.getStartOffset());
+  }
+
+  public boolean insertLineBreakBeforeTag(final XmlTag xmlTag) {
+    PsiElement prev = xmlTag.getPrevSibling();
+    if (prev == null) return false;
+    ASTNode prevNode = SourceTreeToPsiMap.psiElementToTree(prev);
+    while (prevNode != null && containsWhiteSpacesOnly(prevNode)) {
+      prevNode = prevNode.getTreePrev();
+    }
+    if (prevNode == null) return false;
+    if (!(SourceTreeToPsiMap.treeElementToPsi(prevNode)instanceof XmlTag)) return false;
+    return checkName(xmlTag, mySettings.HTML_ELEMENTS_TO_INSERT_NEW_LINE_BEFORE);
+  }
+
+  @Override
+  public boolean insertLineBreakBeforeFirstAttribute(XmlAttribute attribute) {
+    return false;
+  }
+
+  @Override
+  public boolean insertLineBreakAfterTagBegin(XmlTag tag) {
+    return false;
+  }
+
+  private boolean containsWhiteSpacesOnly(final ASTNode node) {
+    if (node == null) return false;
+    if (node.getElementType() == TokenType.WHITE_SPACE) return true;
+    if (node instanceof LeafElement) return false;
+    ASTNode child = node.getFirstChildNode();
+    while (child != null) {
+      if (!containsWhiteSpacesOnly(child)) return false;
+      child = child.getTreeNext();
+    }
+    return true;
+  }
+
+  public boolean removeLineBreakBeforeTag(final XmlTag xmlTag) {
+    return checkName(xmlTag, mySettings.HTML_ELEMENTS_TO_REMOVE_NEW_LINE_BEFORE);
+  }
+
+  protected boolean checkName(XmlTag tag, String option) {
+    if (option == null) return false;
+    for (String name : getTagNames(option)) {
+      if (name.trim().equalsIgnoreCase(tag.getName())) return true;
+    }
+    return false;
+  }
+
+  private final Map<String, String[]> myCachedSplits = new HashMap<String, String[]>();
+
+  private String[] getTagNames(final String option) {
+    String[] splits = myCachedSplits.get(option);
+    if (splits == null) {
+      splits = option.split(",");
+      myCachedSplits.put(option, splits);
+    }
+    return splits;
+  }
+
+  public boolean keepWhiteSpacesInsideTag(final XmlTag tag) {
+    return checkName(tag, mySettings.HTML_KEEP_WHITESPACES_INSIDE) || "jsp:attribute".equals(tag.getName());
+  }
+
+  public WrapType getWrappingTypeForTagEnd(final XmlTag xmlTag) {
+    return shouldBeWrapped(xmlTag) ? WrapType.ALWAYS : WrapType.NORMAL;
+  }
+
+  public WrapType getWrappingTypeForTagBegin(final XmlTag tag) {
+    if (shouldBeWrapped(tag)) {
+      return WrapType.ALWAYS;
+    }
+
+    if (!isInlineTag(tag)) {
+
+      if (checkName(tag, mySettings.HTML_DONT_ADD_BREAKS_IF_INLINE_CONTENT)) {
+        if (hasInlineContentOnly(tag)) return WrapType.NORMAL;
+      }
+
+      return WrapType.ALWAYS;
+    }
+
+    return WrapType.NORMAL;
+  }
+
+  private boolean hasInlineContentOnly(final XmlTag tag) {
+    final XmlTag[] tags = tag.getSubTags();
+    for (int i = 0; i < tags.length; i++) {
+      XmlTag xmlTag = tags[i];
+      if (!isInlineTag(xmlTag)) return false;
+      if (!hasInlineContentOnly(xmlTag)) return false;
+    }
+
+    return true;
+  }
+
+  protected boolean isInlineTag(final XmlTag tag) {
+    return checkName(tag, mySettings.HTML_INLINE_ELEMENTS);
+  }
+
+  protected boolean shouldBeWrapped(final XmlTag tag) {
+    return false;
+  }
+
+  public boolean isTextElement(XmlTag tag) {
+    return isInlineTag(tag);
+  }                               
+
+  public int getTextWrap(final XmlTag tag) {
+    return mySettings.HTML_TEXT_WRAP;
+  }
+
+  public int getAttributesWrap() {
+    return mySettings.HTML_ATTRIBUTE_WRAP;
+  }
+
+  public boolean getShouldAlignAttributes() {
+    return mySettings.HTML_ALIGN_ATTRIBUTES;
+  }
+
+  public boolean getShouldAlignText() {
+    return mySettings.HTML_ALIGN_TEXT;
+  }
+
+  public boolean getShouldKeepWhiteSpaces() {
+    return mySettings.HTML_KEEP_WHITESPACES;
+  }
+
+  public boolean getShouldAddSpaceAroundEqualityInAttribute() {
+    return mySettings.HTML_SPACE_AROUND_EQUALITY_IN_ATTRINUTE;
+  }
+
+  public boolean getShouldAddSpaceAroundTagName() {
+    return mySettings.HTML_SPACE_AFTER_TAG_NAME;
+  }
+
+  public int getKeepBlankLines() {
+    return mySettings.HTML_KEEP_BLANK_LINES;
+  }
+
+  public boolean getShouldKeepLineBreaks() {
+    return mySettings.HTML_KEEP_LINE_BREAKS;
+  }
+
+  public boolean getShouldKeepLineBreaksInText() {
+    return mySettings.HTML_KEEP_LINE_BREAKS_IN_TEXT;
+  }
+
+  @Override
+  public boolean getKeepWhiteSpacesInsideCDATA() {
+    return true;
+  }
+
+  @Override
+  public int getWhiteSpaceAroundCDATAOption() {
+    return XmlCodeStyleSettings.WS_AROUND_CDATA_PRESERVE;
+  }
+
+  public CodeStyleSettings getSettings() {
+    return mySettings;
+  }
+
+  public boolean addSpaceIntoEmptyTag() {
+    return mySettings.HTML_SPACE_INSIDE_EMPTY_TAG;
+  }
+
+  public boolean shouldSaveSpacesBetweenTagAndText() {
+    return true;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/ReadOnlyBlock.java b/xml/impl/src/com/intellij/psi/formatter/xml/ReadOnlyBlock.java
new file mode 100644
index 0000000..7898f77
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/formatter/xml/ReadOnlyBlock.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.formatter.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.formatting.Block;
+import com.intellij.formatting.Spacing;
+import com.intellij.psi.formatter.common.AbstractBlock;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ReadOnlyBlock extends AbstractBlock {
+  private static final ArrayList<Block> EMPTY = new ArrayList<Block>();
+
+  public ReadOnlyBlock(ASTNode node) {
+    super(node, null, null);
+  }
+
+  public Spacing getSpacing(Block child1, @NotNull Block child2) {
+    return null;
+  }
+
+  public boolean isLeaf() {
+    return true;
+  }
+
+  protected List<Block> buildChildren() {
+    return EMPTY;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/SyntheticBlock.java b/xml/impl/src/com/intellij/psi/formatter/xml/SyntheticBlock.java
new file mode 100644
index 0000000..33e06e3
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/formatter/xml/SyntheticBlock.java
@@ -0,0 +1,238 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.formatter.xml;
+
+import com.intellij.formatting.*;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.formatter.common.AbstractBlock;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTokenType;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+public class SyntheticBlock extends AbstractSyntheticBlock implements Block, ReadOnlyBlockContainer {
+  private final List<Block> mySubBlocks;
+  private final Indent myChildIndent;
+
+  public SyntheticBlock(final List<Block> subBlocks, final Block parent, final Indent indent, XmlFormattingPolicy policy, final Indent childIndent) {
+    super(subBlocks, parent, policy, indent);
+    mySubBlocks = subBlocks;
+    myChildIndent = childIndent;
+  }
+
+  @NotNull
+  public TextRange getTextRange() {
+    return calculateTextRange(mySubBlocks);
+  }
+
+  @NotNull
+  public List<Block> getSubBlocks() {
+    return mySubBlocks;
+  }
+
+  public Spacing getSpacing(Block child1, @NotNull Block child2) {
+    if (child1 instanceof ReadOnlyBlock || child2 instanceof ReadOnlyBlock) {
+      return Spacing.getReadOnlySpacing();
+    }
+    if (!(child1 instanceof AbstractXmlBlock) || !(child2 instanceof AbstractXmlBlock)) {
+      return null;
+    }
+    final ASTNode node1 = ((AbstractBlock)child1).getNode();
+    final ASTNode node2 = ((AbstractBlock)child2).getNode();
+
+    final IElementType type1 = node1.getElementType();
+    final IElementType type2 = node2.getElementType();
+
+    boolean firstIsText = isTextFragment(node1);
+    boolean secondIsText = isTextFragment(node2);
+
+    if (((AbstractXmlBlock)child1).isPreserveSpace() && ((AbstractXmlBlock)child2).isPreserveSpace()) {
+      return Spacing.getReadOnlySpacing();
+    }
+
+    if (type1 == XmlElementType.XML_CDATA_START || type2 == XmlElementType.XML_CDATA_END) {
+      if (myXmlFormattingPolicy.getKeepWhiteSpacesInsideCDATA()) {
+        return Spacing.getReadOnlySpacing();
+      }
+      if (type1 == XmlElementType.XML_CDATA_START && type2 == XmlElementType.XML_CDATA_END) {
+        return Spacing.createSpacing(0, 0, 0, myXmlFormattingPolicy.getShouldKeepLineBreaks(), myXmlFormattingPolicy.getKeepBlankLines()); 
+      }
+      if (type1 == XmlElementType.XML_CDATA_START && child2 instanceof AnotherLanguageBlockWrapper ||
+          type2 == XmlElementType.XML_CDATA_END && child1 instanceof AnotherLanguageBlockWrapper) {
+        return Spacing.createSpacing(0, 0, 1, myXmlFormattingPolicy.getShouldKeepLineBreaks(), 0);
+      }
+    }
+
+    boolean firstIsTag = node1.getPsi() instanceof XmlTag && !firstIsText;
+    boolean secondIsTag = node2.getPsi() instanceof XmlTag && !secondIsText;
+
+    boolean firstIsEntityRef = isEntityRef(node1);
+    boolean secondIsEntityRef = isEntityRef(node2);
+
+    if (isSpaceInText(firstIsTag, secondIsTag, firstIsText, secondIsText) && keepWhiteSpaces()) {
+        return Spacing.getReadOnlySpacing();
+    }
+
+    if (firstIsEntityRef || secondIsEntityRef) {
+      return Spacing.createSafeSpacing(myXmlFormattingPolicy.getShouldKeepLineBreaks(), myXmlFormattingPolicy.getKeepBlankLines());
+    }
+
+    if (type2 == XmlElementType.XML_EMPTY_ELEMENT_END && myXmlFormattingPolicy.addSpaceIntoEmptyTag()) {
+      return Spacing.createSpacing(1, 1, 0,
+                                   myXmlFormattingPolicy.getShouldKeepLineBreaks(),
+                                   myXmlFormattingPolicy.getKeepBlankLines());
+    }
+
+    if (secondIsTag && myXmlFormattingPolicy.keepWhiteSpacesInsideTag((XmlTag)node2.getPsi()) && node2.textContains('\n')) {
+      return Spacing.getReadOnlySpacing();
+    }
+
+    if (isXmlTagName(type1, type2)){
+      final int spaces = shouldAddSpaceAroundTagName(node1, node2) ? 1 : 0;
+      return Spacing.createSpacing(spaces, spaces, 0, myXmlFormattingPolicy.getShouldKeepLineBreaks(), myXmlFormattingPolicy.getKeepBlankLines());
+    }
+
+    if (type2 == XmlElementType.XML_ATTRIBUTE) {
+      int minLineFeeds = 0;
+
+      if (type1 == XmlTokenType.XML_NAME) {
+        final PsiElement psi2 = node2.getPsi();
+        minLineFeeds = psi2 instanceof XmlAttribute &&
+                       myXmlFormattingPolicy.insertLineBreakBeforeFirstAttribute((XmlAttribute)psi2)
+                       ? 1 : 0;
+      }
+      return Spacing.createSpacing(1, 1, minLineFeeds, myXmlFormattingPolicy.getShouldKeepLineBreaks(), myXmlFormattingPolicy.getKeepBlankLines());
+    }
+
+    if (((AbstractXmlBlock)child1).isTextElement() && ((AbstractXmlBlock)child2).isTextElement()) {
+      return Spacing.createSafeSpacing(myXmlFormattingPolicy.getShouldKeepLineBreaksInText(), myXmlFormattingPolicy.getKeepBlankLines());
+    }
+
+    if (firstIsTag && insertLineFeedAfter((XmlTag)node1.getPsi())) {
+      return Spacing.createSpacing(0, 0, 1, true, myXmlFormattingPolicy.getKeepBlankLines());
+    }
+
+    if ((firstIsText || firstIsTag) && secondIsTag) {
+      //<tag/>text <tag/></tag>
+      if (((AbstractXmlBlock)child2).insertLineBreakBeforeTag()) {
+        return Spacing.createSpacing(0, Integer.MAX_VALUE, 2, myXmlFormattingPolicy.getShouldKeepLineBreaks(),
+                                     myXmlFormattingPolicy.getKeepBlankLines());
+      } else if (((AbstractXmlBlock)child2).removeLineBreakBeforeTag()) {
+        return Spacing.createSpacing(0, Integer.MAX_VALUE, 0, myXmlFormattingPolicy.getShouldKeepLineBreaks(),
+                                     myXmlFormattingPolicy.getKeepBlankLines());
+      }
+    }
+
+    final boolean saveSpacesBetweenTagAndText =
+      myXmlFormattingPolicy.shouldSaveSpacesBetweenTagAndText() && child1.getTextRange().getEndOffset() < child2.getTextRange().getStartOffset();
+
+    if (firstIsTag && secondIsText) {     //<tag/>-text
+
+      if (((AbstractXmlBlock)child1).isTextElement() || saveSpacesBetweenTagAndText) {
+        return Spacing.createSafeSpacing(true, myXmlFormattingPolicy.getKeepBlankLines());
+      } else {
+        return Spacing.createSpacing(0, 0, 0, true, myXmlFormattingPolicy.getKeepBlankLines());
+      }
+    }
+
+    if ( firstIsText && secondIsTag) {     //text-<tag/>
+      if (((AbstractXmlBlock)child2).isTextElement() || saveSpacesBetweenTagAndText) {
+        return Spacing.createSafeSpacing(true, myXmlFormattingPolicy.getKeepBlankLines());
+      } else {
+        return Spacing.createSpacing(0, 0, 0, true, myXmlFormattingPolicy.getKeepBlankLines());
+      }
+    }
+
+    if (firstIsTag && secondIsTag) {//<tag/><tag/>
+      return Spacing.createSpacing(0, Integer.MAX_VALUE, 0, true,
+                                   myXmlFormattingPolicy.getKeepBlankLines());
+    }
+
+    return Spacing.createSpacing(0, Integer.MAX_VALUE, 0, myXmlFormattingPolicy.getShouldKeepLineBreaksInText(), myXmlFormattingPolicy.getKeepBlankLines());
+  }
+
+  private boolean isEntityRef(final ASTNode node) {
+    return node.getElementType() == XmlElementType.XML_ENTITY_REF;
+  }
+
+  private boolean shouldAddSpaceAroundTagName(final ASTNode node1, final ASTNode node2) {
+    if (node1.getElementType() == XmlElementType.XML_START_TAG_START && node1.textContains('%')) return true;
+    if (node2.getElementType() == XmlElementType.XML_EMPTY_ELEMENT_END && node2.textContains('%')) return true;
+    return myXmlFormattingPolicy.getShouldAddSpaceAroundTagName();
+  }
+
+  private boolean isSpaceInText(final boolean firstIsTag,
+                                final boolean secondIsTag,
+                                final boolean firstIsText,
+                                final boolean secondIsText) {
+    return
+      (firstIsText && secondIsText)
+      || (firstIsTag && secondIsTag)
+      || (firstIsTag && secondIsText)
+      || (firstIsText && secondIsTag);
+  }
+
+  private boolean keepWhiteSpaces() {
+    return (myXmlFormattingPolicy.keepWhiteSpacesInsideTag( getTag()) || myXmlFormattingPolicy.getShouldKeepWhiteSpaces());
+  }
+
+  protected boolean isTextFragment(final ASTNode node) {
+    final ASTNode parent = node.getTreeParent();
+    return parent != null && parent.getElementType() == XmlElementType.XML_TEXT
+           || node.getElementType() == XmlElementType.XML_DATA_CHARACTERS
+           
+      ;
+  }
+
+  @NotNull
+  public ChildAttributes getChildAttributes(final int newChildIndex) {
+    if (isOuterLanguageBlock()) return ChildAttributes.DELEGATE_TO_NEXT_CHILD;
+    final List<Block> subBlocks = getSubBlocks();
+    final int prevBlockIndex = newChildIndex - 1;
+    if (prevBlockIndex >= 0 && prevBlockIndex < subBlocks.size()) {
+      final Block prevBlock = subBlocks.get(newChildIndex - 1);
+      if (isAttributeBlock(prevBlock)) {
+        return new ChildAttributes(myChildIndent, prevBlock.getAlignment());
+      }
+    }
+    return new ChildAttributes(myChildIndent, null);
+  }
+
+  private boolean isAttributeBlock(final Block block) {
+    if (block instanceof XmlBlock) {
+      return ((XmlBlock)block).getNode().getElementType() == XmlElementType.XML_ATTRIBUTE;
+    }
+    return false;
+  }
+
+  public boolean isIncomplete() {
+    return getSubBlocks().get(getSubBlocks().size() - 1).isIncomplete();
+  }
+
+  public boolean endsWithAttribute() {
+    return isAttributeBlock(getSubBlocks().get(getSubBlocks().size() - 1));
+  }
+
+  public Indent getChildIndent() {
+    return myChildIndent;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/XmlBlock.java b/xml/impl/src/com/intellij/psi/formatter/xml/XmlBlock.java
new file mode 100644
index 0000000..f4a6dc5
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/formatter/xml/XmlBlock.java
@@ -0,0 +1,317 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.formatter.xml;
+
+import com.intellij.formatting.*;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.TokenType;
+import com.intellij.psi.formatter.common.AbstractBlock;
+import com.intellij.psi.impl.source.SourceTreeToPsiMap;
+import com.intellij.psi.templateLanguages.OuterLanguageElement;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.SmartList;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class XmlBlock extends AbstractXmlBlock {
+  private final Indent myIndent;
+  private final TextRange myTextRange;
+
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.formatter.xml.XmlBlock");
+
+  public XmlBlock(final ASTNode node,
+                    final Wrap wrap,
+                    final Alignment alignment,
+                    final XmlFormattingPolicy policy,
+                    final Indent indent,
+                    final TextRange textRange) {
+    this(node, wrap, alignment, policy, indent, textRange, false);
+  }
+
+  public XmlBlock(final ASTNode node,
+                  final Wrap wrap,
+                  final Alignment alignment,
+                  final XmlFormattingPolicy policy,
+                  final Indent indent,
+                  final TextRange textRange,
+                  final boolean preserveSpace) {
+    super(node, wrap, alignment, policy, preserveSpace);
+    myIndent = indent;
+    myTextRange = textRange;
+  }
+
+  @NotNull
+  public TextRange getTextRange() {
+    if (myTextRange != null && !(isCDATAStart() || isCDATAEnd())) {
+      return myTextRange;
+    }
+    else {
+      return super.getTextRange();
+    }
+  }
+
+  protected List<Block> buildChildren() {
+
+    //
+    // Fix for EA-19269:
+    // Split XML attribute value to the value itself and delimiters (needed for the case when it contains
+    // template language tags inside).
+    //
+    if (myNode.getElementType() == XmlElementType.XML_ATTRIBUTE_VALUE) {
+      return splitAttribute(myNode, myXmlFormattingPolicy);
+    }
+
+    if (myNode.getElementType() == XmlElementType.XML_COMMENT) {
+      List<Block> result = new SmartList<Block>();
+      if (buildInjectedPsiBlocks(result, myNode, myWrap, null, Indent.getNoneIndent())) {
+        return result;
+      }
+      return splitComment();
+    }
+
+    if (myNode.getElementType() == XmlElementType.XML_TEXT) {
+      if (myXmlFormattingPolicy.getShouldKeepWhiteSpaces()) {
+        return EMPTY;
+      }
+
+      final ASTNode treeParent = myNode.getTreeParent();
+      final XmlTag tag = getTag(treeParent);
+      if (tag != null) {
+        if (myXmlFormattingPolicy.keepWhiteSpacesInsideTag(tag)) {
+          return EMPTY;
+        }
+      }
+    }
+
+    if (myNode.getFirstChildNode() != null) {
+      final ArrayList<Block> result = new ArrayList<Block>(5);
+      ASTNode child = myNode.getFirstChildNode();
+      while (child != null) {
+        if (!containsWhiteSpacesOnly(child) && child.getTextLength() > 0) {
+          child = processChild(result, child, getDefaultWrap(child), null, getChildDefaultIndent());
+        }
+        if (child != null) {
+          LOG.assertTrue(child.getTreeParent() == myNode);
+          child = child.getTreeNext();
+        }
+      }
+      return result;
+    }
+    else {
+      return EMPTY;
+    }
+  }
+
+
+  private List<Block> splitAttribute(ASTNode node, XmlFormattingPolicy formattingPolicy) {
+    final ArrayList<Block> result = new ArrayList<Block>(3);
+    ASTNode child = node.getFirstChildNode();
+    while (child != null) {
+      if (child.getElementType() == XmlElementType.XML_ATTRIBUTE_VALUE_START_DELIMITER ||
+          child.getElementType() == XmlElementType.XML_ATTRIBUTE_VALUE_END_DELIMITER) {
+        result.add(new XmlBlock(child, null, null, formattingPolicy, null, null, isPreserveSpace()));
+      }
+      else if (!child.getPsi().getLanguage().isKindOf(XMLLanguage.INSTANCE) && containsOuterLanguageElement(child)) {
+        // Fix for EA-20311:
+        // In case of another embedded language create a splittable XML block which can be
+        // merged with other language's code blocks.
+        createLeafBlocks(child, result);
+      }
+      else if (child.getElementType() != TokenType.ERROR_ELEMENT || child.getFirstChildNode() != null) {
+        result.add(new ReadOnlyBlock(child));
+      }
+      child = child.getTreeNext();
+    }
+    return result;
+  }
+
+  private void createLeafBlocks(ASTNode node, List<Block> result) {
+    if (node instanceof OuterLanguageElement) {
+      processChild(result, node, null, null, null);
+      return;
+    }
+
+    ASTNode child = node.getFirstChildNode();
+    if (child == null && !(node instanceof PsiWhiteSpace) && node.getElementType() != TokenType.ERROR_ELEMENT) {
+      result.add(new ReadOnlyBlock(node));
+      return;
+    }
+    while (child != null) {
+      createLeafBlocks(child, result);
+      child = child.getTreeNext();
+    }
+  }
+
+
+  private static boolean containsOuterLanguageElement(ASTNode node) {
+    if (node instanceof OuterLanguageElement) {
+      return true;
+    }
+    ASTNode child = node.getFirstChildNode();
+    while (child != null) {
+      if (child instanceof OuterLanguageElement) {
+        return true;
+      }
+      if (containsOuterLanguageElement(child)) return true;
+      child = child.getTreeNext();
+    }
+    return false;
+  }
+
+
+  private List<Block> splitComment() {
+    if (myNode.getElementType() != XmlElementType.XML_COMMENT) return EMPTY;
+    final ArrayList<Block> result = new ArrayList<Block>(3);
+    ASTNode child = myNode.getFirstChildNode();
+    boolean hasOuterLangElements = false;
+    while (child != null) {
+      if (child instanceof OuterLanguageElement) {
+        hasOuterLangElements = true;
+      }
+      result.add(new XmlBlock(child, null, null, myXmlFormattingPolicy, getChildIndent(), null, isPreserveSpace()));
+      child = child.getTreeNext();
+    }
+    if (hasOuterLangElements) {
+      return result;
+    }
+    else {
+      return EMPTY;
+    }
+  }
+
+  protected @Nullable Wrap getDefaultWrap(ASTNode node) {
+    return null;
+  }
+
+  @Nullable
+  protected Indent getChildDefaultIndent() {
+    if (myNode.getElementType() == XmlElementType.HTML_DOCUMENT) {
+      return Indent.getNoneIndent();
+    }
+    if (myNode.getElementType() == TokenType.DUMMY_HOLDER) {
+      return Indent.getNoneIndent();
+    }
+    if (myNode.getElementType() == XmlElementType.XML_PROLOG) {
+      return Indent.getNoneIndent();
+    }
+    else {
+      return null;
+    }
+  }
+
+  public Spacing getSpacing(Block child1, @NotNull Block child2) {
+    if (!(child1 instanceof AbstractBlock) || !(child2 instanceof AbstractBlock)) {
+      return null;
+    }
+
+    final IElementType elementType = myNode.getElementType();
+    final ASTNode node1 = ((AbstractBlock)child1).getNode();
+    final IElementType type1 = node1.getElementType();
+    final ASTNode node2 = ((AbstractBlock)child2).getNode();
+    final IElementType type2 = node2.getElementType();
+
+    if ((isXmlTag(node2) || type2 == XmlElementType.XML_END_TAG_START || type2 == XmlElementType.XML_TEXT) && myXmlFormattingPolicy
+      .getShouldKeepWhiteSpaces()) {
+      return Spacing.getReadOnlySpacing();
+    }
+
+    if (elementType == XmlElementType.XML_TEXT) {
+      return getSpacesInsideText(type1, type2);
+
+    }
+    else if (elementType == XmlElementType.XML_ATTRIBUTE) {
+      return getSpacesInsideAttribute(type1, type2);
+    }
+
+    if (type1 == XmlElementType.XML_PROLOG) {
+      return createDefaultSpace(true, false);
+    }
+
+    if (elementType == XmlElementType.XML_DOCTYPE) {
+      return createDefaultSpace(true, false);
+    }
+
+    return createDefaultSpace(false, false);
+  }
+
+  private Spacing getSpacesInsideAttribute(final IElementType type1, final IElementType type2) {
+    if (type1 == XmlElementType.XML_EQ || type2 == XmlElementType.XML_EQ) {
+      int spaces = myXmlFormattingPolicy.getShouldAddSpaceAroundEqualityInAttribute() ? 1 : 0;
+      return Spacing
+        .createSpacing(spaces, spaces, 0, myXmlFormattingPolicy.getShouldKeepLineBreaks(), myXmlFormattingPolicy.getKeepBlankLines());
+    }
+    else {
+      return createDefaultSpace(false, false);
+    }
+  }
+
+  private Spacing getSpacesInsideText(final IElementType type1, final IElementType type2) {
+    if (type1 == XmlElementType.XML_DATA_CHARACTERS && type2 == XmlElementType.XML_DATA_CHARACTERS) {
+      return Spacing
+        .createSpacing(1, 1, 0, myXmlFormattingPolicy.getShouldKeepLineBreaksInText(), myXmlFormattingPolicy.getKeepBlankLines());
+    }
+    else {
+      return createDefaultSpace(false, true);
+    }
+  }
+
+  public Indent getIndent() {
+    if (myNode.getElementType() == XmlElementType.XML_PROLOG || myNode.getElementType() == XmlElementType.XML_DOCTYPE ||
+        SourceTreeToPsiMap.treeElementToPsi(myNode) instanceof XmlDocument) {
+      return Indent.getNoneIndent();
+    }
+    return myIndent;
+  }
+
+  public boolean insertLineBreakBeforeTag() {
+    return false;
+  }
+
+  public boolean removeLineBreakBeforeTag() {
+    return false;
+  }
+
+  public boolean isTextElement() {
+    return myNode.getElementType() == XmlElementType.XML_TEXT || myNode.getElementType() == XmlElementType.XML_DATA_CHARACTERS ||
+           myNode.getElementType() == XmlElementType.XML_CHAR_ENTITY_REF;
+  }
+
+  @Override
+  @NotNull
+  public ChildAttributes getChildAttributes(final int newChildIndex) {
+    if (myNode.getPsi() instanceof PsiFile) {
+      return new ChildAttributes(Indent.getNoneIndent(), null);
+    }
+    else {
+      return super.getChildAttributes(newChildIndex);
+    }
+  }
+
+  public XmlFormattingPolicy getPolicy() {
+    return myXmlFormattingPolicy;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/XmlCodeStyleSettings.java b/xml/impl/src/com/intellij/psi/formatter/xml/XmlCodeStyleSettings.java
new file mode 100644
index 0000000..50f7c6c
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/formatter/xml/XmlCodeStyleSettings.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.formatter.xml;
+
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
+import com.intellij.psi.codeStyle.CustomCodeStyleSettings;
+
+/**
+ * Moved from CodeStyleSettings
+ * @author Rustam Vishnyakov
+ */
+public class XmlCodeStyleSettings extends CustomCodeStyleSettings {
+
+  public final static int WS_AROUND_CDATA_PRESERVE = 0;
+  public final static int WS_AROUND_CDATA_NONE = 1;
+  public final static int WS_AROUND_CDATA_NEW_LINES = 2;
+
+  public boolean XML_KEEP_WHITESPACES = false;
+  public int XML_ATTRIBUTE_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED;
+  public int XML_TEXT_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED;
+
+  public boolean XML_KEEP_LINE_BREAKS = true;
+  public boolean XML_KEEP_LINE_BREAKS_IN_TEXT = true;
+  public int XML_KEEP_BLANK_LINES = 2;
+
+  public boolean XML_ALIGN_ATTRIBUTES = true;
+  public boolean XML_ALIGN_TEXT = false;
+
+  public boolean XML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE = false;
+  public boolean XML_SPACE_AFTER_TAG_NAME = false;
+  public boolean XML_SPACE_INSIDE_EMPTY_TAG = false;
+
+  public boolean XML_KEEP_WHITE_SPACES_INSIDE_CDATA = false;
+  public int XML_WHITE_SPACE_AROUND_CDATA = WS_AROUND_CDATA_PRESERVE;
+
+  public boolean XML_LEGACY_SETTINGS_IMPORTED = false;
+
+  public XmlCodeStyleSettings(CodeStyleSettings container) {
+    super("XML", container);
+  }
+
+  @Override
+  public void importLegacySettings() {
+    if (!XML_LEGACY_SETTINGS_IMPORTED) {
+      CodeStyleSettings container = getContainer();
+      CodeStyleSettings defaults = new CodeStyleSettings();
+      XML_KEEP_WHITESPACES = container.XML_KEEP_WHITESPACES;
+      XML_ATTRIBUTE_WRAP = container.XML_ATTRIBUTE_WRAP;
+      XML_TEXT_WRAP = container.XML_TEXT_WRAP;
+      XML_KEEP_LINE_BREAKS = container.XML_KEEP_LINE_BREAKS;
+      XML_KEEP_LINE_BREAKS_IN_TEXT = container.XML_KEEP_LINE_BREAKS_IN_TEXT;
+      XML_KEEP_BLANK_LINES = container.XML_KEEP_BLANK_LINES;
+      XML_ALIGN_ATTRIBUTES = container.XML_ALIGN_ATTRIBUTES;
+      XML_ALIGN_TEXT = container.XML_ALIGN_TEXT;
+      XML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE = container.XML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE;
+      XML_SPACE_AFTER_TAG_NAME = container.XML_SPACE_AFTER_TAG_NAME;
+      XML_SPACE_INSIDE_EMPTY_TAG = container.XML_SPACE_INSIDE_EMPTY_TAG;
+      XML_KEEP_WHITE_SPACES_INSIDE_CDATA = container.XML_KEEP_WHITE_SPACES_INSIDE_CDATA;
+      XML_WHITE_SPACE_AROUND_CDATA = container.XML_WHITE_SPACE_AROUND_CDATA;
+
+      container.XML_KEEP_WHITESPACES = defaults.XML_KEEP_WHITESPACES ;
+      container.XML_ATTRIBUTE_WRAP = defaults.XML_ATTRIBUTE_WRAP;
+      container.XML_TEXT_WRAP = defaults.XML_TEXT_WRAP;
+      container.XML_KEEP_LINE_BREAKS = defaults.XML_KEEP_LINE_BREAKS;
+      container.XML_KEEP_LINE_BREAKS_IN_TEXT = defaults.XML_KEEP_LINE_BREAKS_IN_TEXT;
+      container.XML_KEEP_BLANK_LINES = defaults.XML_KEEP_BLANK_LINES;
+      container.XML_ALIGN_ATTRIBUTES = defaults.XML_ALIGN_ATTRIBUTES;
+      container.XML_ALIGN_TEXT = defaults.XML_ALIGN_TEXT;
+      container.XML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE = defaults.XML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE;
+      container.XML_SPACE_AFTER_TAG_NAME = defaults.XML_SPACE_AFTER_TAG_NAME;
+      container.XML_SPACE_INSIDE_EMPTY_TAG = defaults.XML_SPACE_INSIDE_EMPTY_TAG;
+      container.XML_KEEP_WHITE_SPACES_INSIDE_CDATA = defaults.XML_KEEP_WHITE_SPACES_INSIDE_CDATA;
+      container.XML_WHITE_SPACE_AROUND_CDATA = defaults.XML_WHITE_SPACE_AROUND_CDATA;
+
+      XML_LEGACY_SETTINGS_IMPORTED = true;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/XmlFormattingPolicy.java b/xml/impl/src/com/intellij/psi/formatter/xml/XmlFormattingPolicy.java
new file mode 100644
index 0000000..ae6fb0b
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/formatter/xml/XmlFormattingPolicy.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.formatter.xml;
+
+import com.intellij.formatting.Block;
+import com.intellij.formatting.FormattingDocumentModel;
+import com.intellij.formatting.FormattingModelBuilder;
+import com.intellij.formatting.WrapType;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.Language;
+import com.intellij.lang.LanguageFormatting;
+import com.intellij.openapi.util.Pair;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.containers.HashMap;
+
+import java.util.Map;
+
+public abstract class XmlFormattingPolicy {
+
+  private Map<Pair<PsiElement, Language>, Block> myRootToBlockMap = new HashMap<Pair<PsiElement, Language>, Block>();
+  private boolean myProcessJsp = true;
+  protected final FormattingDocumentModel myDocumentModel;
+  private boolean myProcessJavaTree = true;
+
+  protected XmlFormattingPolicy(final FormattingDocumentModel documentModel) {
+    myDocumentModel = documentModel;
+  }
+
+  public void copyFrom(final XmlFormattingPolicy xmlFormattingPolicy) {
+    myProcessJsp = xmlFormattingPolicy.myProcessJsp;
+    myRootToBlockMap.putAll(xmlFormattingPolicy.myRootToBlockMap);
+    myProcessJavaTree = xmlFormattingPolicy.processJavaTree(); 
+  }
+
+  public Block getOrCreateBlockFor(Pair<PsiElement, Language> root){
+    if (!myRootToBlockMap.containsKey(root)) {
+      myRootToBlockMap.put(root, createBlockFor(root));
+    }
+    return myRootToBlockMap.get(root);
+  }
+
+  private Block createBlockFor(final Pair<PsiElement,Language> root) {
+    final FormattingModelBuilder builder = LanguageFormatting.INSTANCE.forContext(root.getSecond(), root.getFirst());
+    if (builder != null) {
+      final Block result = builder.createModel(root.getFirst(), getSettings()).getRootBlock();
+      if (result instanceof XmlBlock) {
+        final XmlFormattingPolicy policy = getPolicy((XmlBlock)result);
+        policy.setRootModels(myRootToBlockMap);
+        policy.doNotProcessJsp();
+      }
+      return result;
+    } else {
+      return null;
+    }
+  }
+
+  protected XmlFormattingPolicy getPolicy(final XmlBlock result) {
+    return result.getPolicy();
+  }
+
+  private void doNotProcessJsp() {
+    myProcessJsp = false;
+  }
+
+  private void setRootModels(final Map<Pair<PsiElement, Language>, Block> rootToBlockMap) {
+    myRootToBlockMap = rootToBlockMap;
+  }
+
+  public abstract WrapType getWrappingTypeForTagEnd(XmlTag xmlTag);
+
+  public abstract WrapType getWrappingTypeForTagBegin(final XmlTag tag);
+
+  public abstract boolean insertLineBreakBeforeTag(XmlTag xmlTag);
+
+  public abstract boolean insertLineBreakBeforeFirstAttribute(XmlAttribute attribute);
+
+  public abstract boolean insertLineBreakAfterTagBegin(XmlTag tag);
+
+  public abstract boolean removeLineBreakBeforeTag(XmlTag xmlTag);
+
+  public abstract boolean keepWhiteSpacesInsideTag(XmlTag tag);
+
+  public abstract boolean indentChildrenOf(XmlTag parentTag);
+
+  public abstract boolean isTextElement(XmlTag tag);
+
+  public abstract int getTextWrap(final XmlTag tag);
+
+  public abstract int getAttributesWrap();
+
+  public abstract boolean getShouldAlignAttributes();
+
+  public abstract boolean getShouldAlignText();
+
+  public abstract boolean getShouldKeepWhiteSpaces();
+
+  public abstract boolean getShouldAddSpaceAroundEqualityInAttribute();
+
+  public abstract boolean getShouldAddSpaceAroundTagName();
+
+  public abstract int getKeepBlankLines();
+
+  public abstract boolean getShouldKeepLineBreaks();
+
+  public abstract boolean getShouldKeepLineBreaksInText();
+
+  public abstract boolean getKeepWhiteSpacesInsideCDATA();
+
+  public abstract int getWhiteSpaceAroundCDATAOption();
+
+  public abstract CodeStyleSettings getSettings();
+
+  public boolean processJsp() {
+    return myProcessJsp;
+  }
+
+  public abstract boolean addSpaceIntoEmptyTag();
+
+  public void setRootBlock(final ASTNode node, final Block rootBlock) {
+    myRootToBlockMap.put(new Pair<PsiElement, Language>(node.getPsi(), node.getPsi().getLanguage()), rootBlock);
+  }
+
+  public FormattingDocumentModel getDocumentModel() {
+    return myDocumentModel;
+  }
+
+  public abstract boolean shouldSaveSpacesBetweenTagAndText();
+
+  public boolean processJavaTree() {
+    return myProcessJavaTree;
+  }
+
+
+  public void dontProcessJavaTree() {
+    myProcessJavaTree = false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/XmlInjectedLanguageBlockBuilder.java b/xml/impl/src/com/intellij/psi/formatter/xml/XmlInjectedLanguageBlockBuilder.java
new file mode 100644
index 0000000..28aa043
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/formatter/xml/XmlInjectedLanguageBlockBuilder.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.formatter.xml;
+
+import com.intellij.formatting.Alignment;
+import com.intellij.formatting.Block;
+import com.intellij.formatting.Indent;
+import com.intellij.formatting.Wrap;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.Language;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.formatter.common.InjectedLanguageBlockBuilder;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlElementType;
+import org.jetbrains.annotations.Nullable;
+
+/**
+* @author nik
+*/
+public class XmlInjectedLanguageBlockBuilder extends InjectedLanguageBlockBuilder {
+  private final XmlFormattingPolicy myXmlFormattingPolicy;
+
+  public XmlInjectedLanguageBlockBuilder(final XmlFormattingPolicy formattingPolicy) {
+    myXmlFormattingPolicy = formattingPolicy;
+  }
+
+  @Override
+  public Block createInjectedBlock(ASTNode node,
+                                   Block originalBlock,
+                                   Indent indent,
+                                   int offset,
+                                   TextRange range,
+                                   @Nullable Language language)
+  {
+    return new AnotherLanguageBlockWrapper(node, myXmlFormattingPolicy, originalBlock, indent, offset, range);
+  }
+
+  @Override
+  public Block createBlockBeforeInjection(ASTNode node, Wrap wrap, Alignment alignment, Indent indent, TextRange range) {
+    return new XmlBlock(node, wrap, alignment, myXmlFormattingPolicy, indent, range);
+  }
+
+  @Override
+  public Block createBlockAfterInjection(ASTNode node, Wrap wrap, Alignment alignment, Indent indent, TextRange range) {
+    return new XmlBlock(node, wrap, alignment, myXmlFormattingPolicy, indent, range);
+  }
+
+  @Override
+  public CodeStyleSettings getSettings() {
+    return myXmlFormattingPolicy.getSettings();
+  }
+
+  @Override
+  public boolean canProcessFragment(String text, final ASTNode injectionHost) {
+    IElementType type = injectionHost.getElementType();
+    if (type == XmlElementType.XML_TEXT) {
+      text = text.trim();
+      text = text.replace("<![CDATA[", "");
+      text = text.replace("]]>", "");
+    }
+    else if (type == XmlElementType.XML_COMMENT) {   // <!--[if IE]>, <![endif]--> of conditional comments injection
+      return true;
+    }
+
+    return text.length() == 0;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/XmlPolicy.java b/xml/impl/src/com/intellij/psi/formatter/xml/XmlPolicy.java
new file mode 100644
index 0000000..40bb6ab
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/formatter/xml/XmlPolicy.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.formatter.xml;
+
+import com.intellij.formatting.FormattingDocumentModel;
+import com.intellij.formatting.WrapType;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.PsiErrorElement;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlText;
+
+public class XmlPolicy extends XmlFormattingPolicy{
+  private final CodeStyleSettings mySettings;
+  private final XmlCodeStyleSettings myXmlSettings;
+
+  public XmlPolicy(final CodeStyleSettings settings, final FormattingDocumentModel documentModel) {
+    super(documentModel);
+    mySettings = settings;
+    myXmlSettings = settings.getCustomSettings(XmlCodeStyleSettings.class);
+  }
+
+  public boolean indentChildrenOf(final XmlTag parentTag) {
+    return !(parentTag.getFirstChild() instanceof PsiErrorElement);
+  }
+
+  public boolean insertLineBreakBeforeTag(final XmlTag xmlTag) {
+    return false;
+  }
+
+  @Override
+  public boolean insertLineBreakBeforeFirstAttribute(XmlAttribute attribute) {
+    return false;
+  }
+
+  @Override
+  public boolean insertLineBreakAfterTagBegin(XmlTag tag) {
+    return false;
+  }
+
+  public boolean removeLineBreakBeforeTag(final XmlTag xmlTag) {
+    return false;
+  }
+
+  public WrapType getWrappingTypeForTagEnd(final XmlTag xmlTag) {
+    return xmlTag.getSubTags().length > 0 ? WrapType.ALWAYS
+           : WrapType.NORMAL;
+  }
+
+  public WrapType getWrappingTypeForTagBegin(final XmlTag tag) {
+    final PsiElement element = tag.getNextSibling();
+    if (element instanceof XmlText && !(element.getFirstChild() instanceof PsiWhiteSpace) && tag.getSubTags().length == 0) return WrapType.NORMAL;
+    return WrapType.ALWAYS;
+  }
+
+  public boolean isTextElement(XmlTag tag) {
+    return false;
+  }
+
+  public boolean keepWhiteSpacesInsideTag(final XmlTag tag) {
+    return false;
+  }
+
+  public int getTextWrap(final XmlTag tag) {
+    return myXmlSettings.XML_TEXT_WRAP;
+  }
+
+  public int getAttributesWrap() {
+    return myXmlSettings.XML_ATTRIBUTE_WRAP;
+  }
+
+  public boolean getShouldAlignAttributes() {
+    return myXmlSettings.XML_ALIGN_ATTRIBUTES;
+  }
+  public boolean getShouldAlignText() {
+    return myXmlSettings.XML_ALIGN_TEXT;
+  }
+
+  public boolean getShouldKeepWhiteSpaces() {
+    return myXmlSettings.XML_KEEP_WHITESPACES;
+  }
+
+  public boolean getShouldAddSpaceAroundEqualityInAttribute() {
+    return myXmlSettings.XML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE;
+  }
+
+  public boolean getShouldAddSpaceAroundTagName() {
+    return myXmlSettings.XML_SPACE_AFTER_TAG_NAME;
+  }
+
+  public int getKeepBlankLines() {
+    return myXmlSettings.XML_KEEP_BLANK_LINES;
+  }
+
+  public boolean getShouldKeepLineBreaks() {
+    return myXmlSettings.XML_KEEP_LINE_BREAKS;
+  }
+
+  public boolean getShouldKeepLineBreaksInText() {
+    return myXmlSettings.XML_KEEP_LINE_BREAKS_IN_TEXT;
+  }
+
+  @Override
+  public boolean getKeepWhiteSpacesInsideCDATA() {
+    return myXmlSettings.XML_KEEP_WHITE_SPACES_INSIDE_CDATA;
+  }
+
+  @Override
+  public int getWhiteSpaceAroundCDATAOption() {
+    return myXmlSettings.XML_WHITE_SPACE_AROUND_CDATA;
+  }
+
+  public CodeStyleSettings getSettings() {
+    return mySettings;
+  }
+
+  public boolean addSpaceIntoEmptyTag() {
+    return myXmlSettings.XML_SPACE_INSIDE_EMPTY_TAG;
+  }
+
+  public boolean shouldSaveSpacesBetweenTagAndText() {
+    return false;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/XmlTagBlock.java b/xml/impl/src/com/intellij/psi/formatter/xml/XmlTagBlock.java
new file mode 100644
index 0000000..79b32c9
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/formatter/xml/XmlTagBlock.java
@@ -0,0 +1,330 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.formatter.xml;
+
+import com.intellij.formatting.*;
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class XmlTagBlock extends AbstractXmlBlock{
+  private final Indent myIndent;
+
+  public XmlTagBlock(final ASTNode node,
+                       final Wrap wrap,
+                       final Alignment alignment,
+                       final XmlFormattingPolicy policy,
+                       final Indent indent) {
+      super(node, wrap, alignment, policy, false);
+      myIndent = indent;
+  }
+
+  public XmlTagBlock(final ASTNode node,
+                     final Wrap wrap,
+                     final Alignment alignment,
+                     final XmlFormattingPolicy policy,
+                     final Indent indent,
+                     final boolean preserveSpace) {
+    super(node, wrap, alignment, policy, preserveSpace);
+    myIndent = indent;
+  }
+
+  protected List<Block> buildChildren() {
+    ASTNode child = myNode.getFirstChildNode();
+    final Wrap attrWrap = Wrap.createWrap(getWrapType(myXmlFormattingPolicy.getAttributesWrap()), false);
+    final Wrap textWrap = Wrap.createWrap(getWrapType(myXmlFormattingPolicy.getTextWrap(getTag())), true);
+    final Wrap tagBeginWrap = createTagBeginWrapping(getTag());
+    final Alignment attrAlignment = Alignment.createAlignment();
+    final Alignment textAlignment = Alignment.createAlignment();
+    final ArrayList<Block> result = new ArrayList<Block>(3);
+    ArrayList<Block> localResult = new ArrayList<Block>(1);
+
+    boolean insideTag = true;
+
+    while (child != null) {
+      if (!containsWhiteSpacesOnly(child) && child.getTextLength() > 0){
+
+        Wrap wrap = chooseWrap(child, tagBeginWrap, attrWrap, textWrap);
+        Alignment alignment = chooseAlignment(child, attrAlignment, textAlignment);
+
+        if (child.getElementType() == XmlElementType.XML_TAG_END) {
+          child = processChild(localResult,child, wrap, alignment, null);
+          result.add(createTagDescriptionNode(localResult));
+          localResult = new ArrayList<Block>(1);
+          insideTag = true;
+        }
+        else if (child.getElementType() == XmlElementType.XML_START_TAG_START) {
+          insideTag = false;
+          if (!localResult.isEmpty()) {
+            result.add(createTagContentNode(localResult));
+          }
+          localResult = new ArrayList<Block>(1);
+          child = processChild(localResult,child, wrap, alignment, null);
+        }
+        else if (child.getElementType() == XmlElementType.XML_END_TAG_START) {
+          insideTag = false;
+          if (!localResult.isEmpty()) {
+            result.add(createTagContentNode(localResult));
+            localResult = new ArrayList<Block>(1);
+          }
+          child = processChild(localResult,child, wrap, alignment, null);
+        } else if (child.getElementType() == XmlElementType.XML_EMPTY_ELEMENT_END) {
+          child = processChild(localResult,child, wrap, alignment, null);
+          result.add(createTagDescriptionNode(localResult));
+          localResult = new ArrayList<Block>(1);
+        }
+        else if (isJspxJavaContainingNode(child)) {
+          createJspTextNode(localResult, child, getChildIndent());
+        }
+        /*
+        else if (child.getElementType() == ElementType.XML_TEXT) {
+          child  = createXmlTextBlocks(localResult, child, wrap, alignment);
+        }
+        */
+        else {
+          final Indent indent;
+
+          if (isJspResult(localResult)) {
+            //indent = FormatterEx.getInstance().getNoneIndent();
+            indent = getChildrenIndent();
+          } else if (!insideTag) {
+            indent = null;
+          }
+          else {
+            indent = getChildrenIndent();
+          }
+
+          child = processChild(localResult,child, wrap, alignment, indent);
+        }
+      }
+      if (child != null) {
+        child = child.getTreeNext();
+      }
+    }
+
+    if (!localResult.isEmpty()) {
+      result.add(createTagContentNode(localResult));
+    }
+
+    return result;
+
+  }
+
+  protected boolean isJspResult(final ArrayList<Block> localResult) {
+    return false;
+  }
+
+  protected
+  @Nullable
+  ASTNode processChild(List<Block> result, final ASTNode child, final Wrap wrap, final Alignment alignment, final Indent indent) {
+    IElementType type = child.getElementType();
+    if (type == XmlElementType.XML_TEXT) {
+      final PsiElement parent = child.getPsi().getParent();
+
+      if (parent instanceof XmlTag && ((XmlTag)parent).getSubTags().length == 0) {
+        if (buildInjectedPsiBlocks(result, child, wrap, alignment, indent)) return child;
+      }
+      return createXmlTextBlocks(result, child, wrap, alignment);
+    } else if (type == XmlElementType.XML_COMMENT) {
+      if (buildInjectedPsiBlocks(result, child, wrap, alignment, indent)) return child;
+      return super.processChild(result, child, wrap, alignment, indent);
+    }
+    else {
+      return super.processChild(result, child, wrap, alignment, indent);
+    }
+  }
+
+  protected Indent getChildrenIndent() {
+    return myXmlFormattingPolicy.indentChildrenOf(getTag())
+           ? Indent.getNormalIndent()
+           : Indent.getNoneIndent();
+  }
+
+  public Indent getIndent() {
+    return myIndent;
+  }
+
+  private ASTNode createXmlTextBlocks(final List<Block> list, final ASTNode textNode, final Wrap wrap, final Alignment alignment) {
+    ASTNode child = textNode.getFirstChildNode();
+    return createXmlTextBlocks(list, textNode, child, wrap, alignment);
+  }
+
+  private ASTNode createXmlTextBlocks(final List<Block> list, final ASTNode textNode, ASTNode child,
+                                      final Wrap wrap,
+                                      final Alignment alignment
+  ) {
+    while (child != null) {
+      if (!XmlBlock.containsWhiteSpacesOnly(child) && child.getTextLength() > 0){
+        final Indent indent = getChildrenIndent();
+        child = processChild(list,child,  wrap, alignment, indent);
+        if (child == null) return child;
+        if (child.getTreeParent() != textNode) {
+          if (child.getTreeParent() != myNode) {
+            return createXmlTextBlocks(list, child.getTreeParent(), child.getTreeNext(), wrap, alignment);
+          } else {
+            return child;
+          }
+        }
+      }
+      child = child.getTreeNext();
+    }
+    return textNode;
+  }
+
+  private Block createTagContentNode(final ArrayList<Block> localResult) {
+    return createSyntheticBlock(localResult, getChildrenIndent());
+  }
+
+  protected Block createSyntheticBlock(final ArrayList<Block> localResult, final Indent childrenIndent) {
+    return new SyntheticBlock(localResult, this, Indent.getNoneIndent(), myXmlFormattingPolicy, childrenIndent);
+  }
+
+  private Block createTagDescriptionNode(final ArrayList<Block> localResult) {
+    return createSyntheticBlock(localResult, null);
+  }
+
+  public Spacing getSpacing(Block child1, @NotNull Block child2) {
+    if (isPreserveSpace()) return Spacing.getReadOnlySpacing();
+    if(child1 instanceof AbstractSyntheticBlock && child2 instanceof AbstractSyntheticBlock) {
+      return getSpacing((AbstractSyntheticBlock)child1, (AbstractSyntheticBlock)child2);
+    }
+    return null;
+  }
+
+  protected Spacing getSpacing(final AbstractSyntheticBlock syntheticBlock1, final AbstractSyntheticBlock syntheticBlock2) {
+    if (syntheticBlock2.startsWithCDATA() || syntheticBlock1.endsWithCDATA()) {
+      return Spacing.getReadOnlySpacing();
+    }
+
+    if (syntheticBlock1.containsCDATA() && syntheticBlock2.isTagDescription()
+        || syntheticBlock1.isTagDescription() && syntheticBlock2.containsCDATA()) {
+      int lineFeeds = 0;
+      switch(myXmlFormattingPolicy.getWhiteSpaceAroundCDATAOption()) {
+        case XmlCodeStyleSettings.WS_AROUND_CDATA_NONE:
+          break;
+        case XmlCodeStyleSettings.WS_AROUND_CDATA_NEW_LINES:
+          lineFeeds = 1;
+          break;
+        case XmlCodeStyleSettings.WS_AROUND_CDATA_PRESERVE:
+          return Spacing.getReadOnlySpacing();
+        default:
+          assert false : "Unexpected whitespace around CDATA code style option.";
+      }
+      return Spacing.createSpacing(0, 0, lineFeeds, myXmlFormattingPolicy.getShouldKeepLineBreaks(),
+                                   myXmlFormattingPolicy.getKeepBlankLines());
+    }
+
+    if (syntheticBlock2.isJspTextBlock() || syntheticBlock1.isJspTextBlock()) {
+      return Spacing.createSafeSpacing(myXmlFormattingPolicy.getShouldKeepLineBreaks(), myXmlFormattingPolicy.getKeepBlankLines());
+    }
+
+    if (syntheticBlock2.isJspxTextBlock() || syntheticBlock1.isJspxTextBlock()) {
+      return Spacing.createSpacing(0, 0, 1, myXmlFormattingPolicy.getShouldKeepLineBreaks(), myXmlFormattingPolicy.getKeepBlankLines());
+    }
+
+    if (myXmlFormattingPolicy.keepWhiteSpacesInsideTag(getTag())) return Spacing.getReadOnlySpacing();
+
+    if (myXmlFormattingPolicy.getShouldKeepWhiteSpaces()) {
+      return Spacing.getReadOnlySpacing();
+    }
+
+    if (syntheticBlock2.startsWithTag() ) {
+      final XmlTag startTag = syntheticBlock2.getStartTag();
+      if (myXmlFormattingPolicy.keepWhiteSpacesInsideTag(startTag) && startTag.textContains('\n')) {
+        return getChildrenIndent() != Indent.getNoneIndent() ? Spacing.getReadOnlySpacing():Spacing.createSpacing(0,0,0,true,myXmlFormattingPolicy.getKeepBlankLines());
+      }
+    }
+
+    boolean saveSpacesBetweenTagAndText = myXmlFormattingPolicy.shouldSaveSpacesBetweenTagAndText() &&
+      syntheticBlock1.getTextRange().getEndOffset() < syntheticBlock2.getTextRange().getStartOffset();
+
+    if (syntheticBlock1.endsWithTextElement() && syntheticBlock2.startsWithTextElement()) {
+      return Spacing.createSafeSpacing(myXmlFormattingPolicy.getShouldKeepLineBreaksInText(), myXmlFormattingPolicy.getKeepBlankLines());
+    }
+
+    if (syntheticBlock1.endsWithText()) { //text</tag
+      if (syntheticBlock1.insertLineFeedAfter()) {
+        return Spacing.createDependentLFSpacing(0, 0, getTag().getTextRange(), myXmlFormattingPolicy.getShouldKeepLineBreaks(), myXmlFormattingPolicy.getKeepBlankLines());
+      }
+      if (saveSpacesBetweenTagAndText) {
+        return Spacing.createSafeSpacing(myXmlFormattingPolicy.getShouldKeepLineBreaks(), myXmlFormattingPolicy.getKeepBlankLines());
+      }
+      return Spacing.createSpacing(0, 0, 0, myXmlFormattingPolicy.getShouldKeepLineBreaks(), myXmlFormattingPolicy.getKeepBlankLines());
+
+    } else if (syntheticBlock1.isTagDescription() && syntheticBlock2.isTagDescription()) { //></
+      return Spacing.createSpacing(0, 0, 0, myXmlFormattingPolicy.getShouldKeepLineBreaks(), myXmlFormattingPolicy.getKeepBlankLines());
+    } else if (syntheticBlock2.startsWithText()) { //>text
+      if (saveSpacesBetweenTagAndText) {
+        return Spacing.createSafeSpacing(true, myXmlFormattingPolicy.getKeepBlankLines());
+      }
+      return Spacing.createSpacing(0, 0, 0, true, myXmlFormattingPolicy.getKeepBlankLines());
+    } else if (syntheticBlock1.isTagDescription() && syntheticBlock2.startsWithTag()) {
+      return Spacing.createSpacing(0, 0, myXmlFormattingPolicy.insertLineBreakAfterTagBegin(getTag()) ?  2 : 0,
+                                   true, myXmlFormattingPolicy.getKeepBlankLines());
+    } else if (syntheticBlock1.insertLineFeedAfter()) {
+      return Spacing.createSpacing(0,0,1,true,myXmlFormattingPolicy.getKeepBlankLines());
+    } else if (syntheticBlock1.endsWithTag() && syntheticBlock2.isTagDescription()) {
+      return Spacing.createSpacing(0, 0, myXmlFormattingPolicy.insertLineBreakAfterTagBegin(getTag()) ? 2 : 0,
+                                   true, myXmlFormattingPolicy.getKeepBlankLines());
+    } else {
+      return createDefaultSpace(true, true);
+    }
+  }
+
+  public boolean insertLineBreakBeforeTag() {
+    return myXmlFormattingPolicy.insertLineBreakBeforeTag(getTag());
+  }
+
+  public boolean removeLineBreakBeforeTag() {
+    return myXmlFormattingPolicy.removeLineBreakBeforeTag(getTag());
+  }
+
+  public boolean isTextElement() {
+    return myXmlFormattingPolicy.isTextElement(getTag());
+  }
+
+  @Override
+  @NotNull
+  public ChildAttributes getChildAttributes(final int newChildIndex) {
+    if (isAfterAttribute(newChildIndex)) {
+      List<Block> subBlocks = getSubBlocks();
+      Block subBlock = subBlocks.get(newChildIndex - 1);
+      int prevSubBlockChildrenCount = subBlock.getSubBlocks().size();
+      return subBlock.getChildAttributes(prevSubBlockChildrenCount);
+    }
+    else {
+      if (myXmlFormattingPolicy.indentChildrenOf(getTag())) {
+        return new ChildAttributes(Indent.getNormalIndent(), null);
+      } else {
+        return new ChildAttributes(Indent.getNoneIndent(), null);
+      }
+    }
+  }
+
+  private boolean isAfterAttribute(final int newChildIndex) {
+    List<Block> subBlocks = getSubBlocks();
+    int index = newChildIndex - 1;
+    Block prevBlock = index < subBlocks.size() ? subBlocks.get(index):null;
+    return prevBlock instanceof SyntheticBlock && ((SyntheticBlock)prevBlock).endsWithAttribute();
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/HtmlIdIndexer.java b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/HtmlIdIndexer.java
new file mode 100644
index 0000000..907743a
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/HtmlIdIndexer.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.cache.impl.idCache;
+
+import com.intellij.lexer.HtmlHighlightingLexer;
+import com.intellij.lexer.Lexer;
+import com.intellij.psi.impl.cache.impl.OccurrenceConsumer;
+import com.intellij.psi.impl.cache.impl.id.LexerBasedIdIndexer;
+
+public class HtmlIdIndexer extends LexerBasedIdIndexer {
+  public Lexer createLexer(final OccurrenceConsumer consumer) {
+    return createIndexingLexer(consumer);
+  }
+
+  static XHtmlFilterLexer createIndexingLexer(OccurrenceConsumer consumer) {
+    return new XHtmlFilterLexer(new HtmlHighlightingLexer(), consumer);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/HtmlTodoIndexer.java b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/HtmlTodoIndexer.java
new file mode 100644
index 0000000..b6ca609
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/HtmlTodoIndexer.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.cache.impl.idCache;
+
+import com.intellij.lexer.Lexer;
+import com.intellij.psi.impl.cache.impl.OccurrenceConsumer;
+import com.intellij.psi.impl.cache.impl.todo.LexerBasedTodoIndexer;
+
+public class HtmlTodoIndexer extends LexerBasedTodoIndexer {
+  @Override
+  public Lexer createLexer(OccurrenceConsumer consumer) {
+    return HtmlIdIndexer.createIndexingLexer(consumer);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XHtmlFilterLexer.java b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XHtmlFilterLexer.java
new file mode 100644
index 0000000..f0d3a01
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XHtmlFilterLexer.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.cache.impl.idCache;
+
+import com.intellij.lang.Language;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.lexer.Lexer;
+import com.intellij.psi.impl.cache.impl.BaseFilterLexer;
+import com.intellij.psi.impl.cache.CacheUtil;
+import com.intellij.psi.impl.cache.impl.OccurrenceConsumer;
+import com.intellij.psi.search.UsageSearchContext;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlElementType;
+
+public class XHtmlFilterLexer extends BaseFilterLexer {
+
+  public XHtmlFilterLexer(Lexer originalLexer, OccurrenceConsumer table) {
+    super(originalLexer, table);
+  }
+
+  public void advance() {
+    final IElementType tokenType = myDelegate.getTokenType();
+
+    if (tokenType == XmlElementType.XML_COMMENT_CHARACTERS) {
+      scanWordsInToken(UsageSearchContext.IN_COMMENTS, false, false);
+      advanceTodoItemCountsInToken();
+    } else if (tokenType == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN ||
+        tokenType == XmlElementType.XML_NAME ||
+        tokenType == XmlElementType.XML_TAG_NAME
+       ) {
+      scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, tokenType == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN,
+                       false);
+    } else if (tokenType.getLanguage() != XMLLanguage.INSTANCE &&
+      tokenType.getLanguage() != Language.ANY         
+    ) {
+      boolean inComments = CacheUtil.isInComments(tokenType);
+      scanWordsInToken((inComments)?UsageSearchContext.IN_COMMENTS:UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, true,
+                       false);
+      
+      if (inComments) advanceTodoItemCountsInToken();
+    }
+    else if (!XmlFilterLexer.ourNoWordsTokenSet.contains(tokenType)) {
+      scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT, false, false);
+    }
+
+    myDelegate.advance();
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XHtmlIdIndexer.java b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XHtmlIdIndexer.java
new file mode 100644
index 0000000..4ae3e83
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XHtmlIdIndexer.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.cache.impl.idCache;
+
+import com.intellij.lexer.Lexer;
+import com.intellij.lexer.XHtmlHighlightingLexer;
+import com.intellij.psi.impl.cache.impl.OccurrenceConsumer;
+import com.intellij.psi.impl.cache.impl.id.LexerBasedIdIndexer;
+
+public class XHtmlIdIndexer extends LexerBasedIdIndexer {
+  public Lexer createLexer(final OccurrenceConsumer consumer) {
+    return createIndexingLexer(consumer);
+  }
+
+  static XHtmlFilterLexer createIndexingLexer(OccurrenceConsumer consumer) {
+    return new XHtmlFilterLexer(new XHtmlHighlightingLexer(), consumer);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XHtmlTodoIndexer.java b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XHtmlTodoIndexer.java
new file mode 100644
index 0000000..bd3458f
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XHtmlTodoIndexer.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.cache.impl.idCache;
+
+import com.intellij.lexer.Lexer;
+import com.intellij.psi.impl.cache.impl.OccurrenceConsumer;
+import com.intellij.psi.impl.cache.impl.todo.LexerBasedTodoIndexer;
+
+public class XHtmlTodoIndexer extends LexerBasedTodoIndexer {
+  @Override
+  public Lexer createLexer(OccurrenceConsumer consumer) {
+    return XHtmlIdIndexer.createIndexingLexer(consumer);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XmlFilterLexer.java b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XmlFilterLexer.java
new file mode 100644
index 0000000..e8e75da
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XmlFilterLexer.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.cache.impl.idCache;
+
+import com.intellij.lexer.Lexer;
+import com.intellij.psi.TokenType;
+import com.intellij.psi.impl.cache.impl.BaseFilterLexer;
+import com.intellij.psi.impl.cache.impl.OccurrenceConsumer;
+import com.intellij.psi.search.UsageSearchContext;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTokenType;
+
+public class XmlFilterLexer extends BaseFilterLexer {
+  static final TokenSet ourNoWordsTokenSet = TokenSet.create(
+    XmlTokenType.TAG_WHITE_SPACE,
+    TokenType.WHITE_SPACE,
+    XmlTokenType.XML_REAL_WHITE_SPACE,
+    XmlTokenType.XML_EQ,
+    XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER,
+    XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER,
+    XmlTokenType.XML_START_TAG_START,
+    XmlTokenType.XML_EMPTY_ELEMENT_END,
+    XmlTokenType.XML_END_TAG_START,
+    XmlTokenType.XML_TAG_END,
+    XmlTokenType.XML_DOCTYPE_END,
+    XmlTokenType.XML_COMMENT_START,
+    XmlTokenType.XML_COMMENT_END,
+    XmlTokenType.XML_PI_START,
+    XmlTokenType.XML_PI_END,
+    XmlTokenType.XML_CDATA_END
+  );
+
+  public XmlFilterLexer(Lexer originalLexer, OccurrenceConsumer table) {
+    super(originalLexer, table);
+  }
+
+  public void advance() {
+    final IElementType tokenType = myDelegate.getTokenType();
+
+    if (tokenType == XmlElementType.XML_COMMENT_CHARACTERS) {
+      scanWordsInToken(UsageSearchContext.IN_COMMENTS, false, false);
+      advanceTodoItemCountsInToken();
+    }
+
+    if (tokenType == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN) {
+      scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, true, false);
+    }
+    else if (tokenType == XmlElementType.XML_NAME || tokenType == XmlElementType.XML_DATA_CHARACTERS) {
+      scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, false, false);
+    }
+    else if (tokenType == XmlElementType.XML_ENTITY_REF_TOKEN || tokenType == XmlElementType.XML_CHAR_ENTITY_REF) {
+      scanWordsInToken(UsageSearchContext.IN_CODE, false, false);
+    }
+    else if (tokenType == XmlElementType.XML_TEXT) {
+      scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, false, false);
+    }
+    else if (!ourNoWordsTokenSet.contains(tokenType)) {
+      scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT, false, false);
+    }
+
+    myDelegate.advance();
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XmlIdIndexer.java b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XmlIdIndexer.java
new file mode 100644
index 0000000..ba04785
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XmlIdIndexer.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.cache.impl.idCache;
+
+import com.intellij.lexer.Lexer;
+import com.intellij.lexer.XmlLexer;
+import com.intellij.psi.impl.cache.impl.OccurrenceConsumer;
+import com.intellij.psi.impl.cache.impl.id.LexerBasedIdIndexer;
+
+public class XmlIdIndexer extends LexerBasedIdIndexer {
+  public Lexer createLexer(final OccurrenceConsumer consumer) {
+    return createIndexingLexer(consumer);
+  }
+
+  static XmlFilterLexer createIndexingLexer(OccurrenceConsumer consumer) {
+    return new XmlFilterLexer(new XmlLexer(), consumer);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XmlTodoIndexer.java b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XmlTodoIndexer.java
new file mode 100644
index 0000000..4847f3d
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/cache/impl/idCache/XmlTodoIndexer.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.cache.impl.idCache;
+
+import com.intellij.lexer.Lexer;
+import com.intellij.psi.impl.cache.impl.OccurrenceConsumer;
+import com.intellij.psi.impl.cache.impl.todo.LexerBasedTodoIndexer;
+
+public class XmlTodoIndexer extends LexerBasedTodoIndexer {
+  @Override
+  public Lexer createLexer(OccurrenceConsumer consumer) {
+    return XmlIdIndexer.createIndexingLexer(consumer);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/html/HtmlConditionalCommentInjector.java b/xml/impl/src/com/intellij/psi/impl/source/html/HtmlConditionalCommentInjector.java
new file mode 100644
index 0000000..bcd6f5a
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/html/HtmlConditionalCommentInjector.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.html;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.Language;
+import com.intellij.lang.injection.MultiHostInjector;
+import com.intellij.lang.injection.MultiHostRegistrar;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiComment;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiLanguageInjectionHost;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.xml.XmlComment;
+import com.intellij.psi.xml.XmlTokenType;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author spleaner
+ */
+public class HtmlConditionalCommentInjector implements MultiHostInjector {
+
+  /**
+   * Allows to check if given element is a
+   * <a href="http://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx">conditional comment</a>.
+   * 
+   * @param host  target element to check
+   * @return      <code>true</code> if given element is conditional comment; <code>false</code> otherwise
+   */
+  public static boolean isConditionalComment(@NotNull PsiElement host) {
+    return parseConditionalCommentBoundaries(host) != null;
+  }
+
+  /**
+   * Tries to parse given element as <a href="http://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx">conditional comment</a>.
+   * 
+   * @param host  target element to parse
+   * @return      <code>null</code> if given element is not a conditional comment;
+   *              pair like <code>(conditional comment start element; conditional comment end element)</code> otherwise
+   */
+  @Nullable
+  private static Pair<ASTNode, ASTNode> parseConditionalCommentBoundaries(@NotNull PsiElement host) {
+    if (!(host instanceof XmlComment)) {
+      return null;
+    }
+    final ASTNode comment = host.getNode();
+    if (comment == null) {
+      return null;
+    }
+    final ASTNode conditionalStart = comment.findChildByType(TokenSet.create(XmlTokenType.XML_CONDITIONAL_COMMENT_START_END));
+    if (conditionalStart == null) {
+      return null;
+    }
+    final ASTNode conditionalEnd = comment.findChildByType(TokenSet.create(XmlTokenType.XML_CONDITIONAL_COMMENT_END_START));
+    if (conditionalEnd == null) {
+      return null;
+    }
+    final ASTNode endOfEnd = comment.findChildByType(TokenSet.create(XmlTokenType.XML_CONDITIONAL_COMMENT_END));
+    return endOfEnd == null ? null : new Pair<ASTNode, ASTNode>(conditionalStart, conditionalEnd);
+  }
+  
+  public void getLanguagesToInject(@NotNull final MultiHostRegistrar registrar, @NotNull final PsiElement host) {
+    Pair<ASTNode, ASTNode> pair = parseConditionalCommentBoundaries(host);
+    if (pair == null) {
+      return;
+    }
+    final TextRange textRange = host.getTextRange();
+    final int startOffset = textRange.getStartOffset();
+    Language language = host.getParent().getLanguage();
+    ASTNode conditionalStart = pair.first;
+    ASTNode conditionalEnd = pair.second;
+    TextRange range = new TextRange(conditionalStart.getTextRange().getEndOffset() - startOffset, conditionalEnd.getStartOffset() - startOffset);
+    if (range.getStartOffset() < range.getEndOffset()) {
+      registrar.startInjecting(language).addPlace(null, null, (PsiLanguageInjectionHost)host, range).doneInjecting();
+    }
+  }
+
+  @NotNull
+  public List<? extends Class<? extends PsiElement>> elementsToInjectIn() {
+    return Arrays.asList(PsiComment.class);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/html/HtmlDocumentImpl.java b/xml/impl/src/com/intellij/psi/impl/source/html/HtmlDocumentImpl.java
new file mode 100644
index 0000000..7aa9ce9
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/html/HtmlDocumentImpl.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.html;
+
+import com.intellij.psi.impl.source.xml.XmlDocumentImpl;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTag;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class HtmlDocumentImpl extends XmlDocumentImpl {
+  public HtmlDocumentImpl() {
+    super(XmlElementType.HTML_DOCUMENT);
+  }
+
+  public XmlTag getRootTag() {
+    return (XmlTag)findElementByTokenType(XmlElementType.HTML_TAG);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/html/HtmlFileImpl.java b/xml/impl/src/com/intellij/psi/impl/source/html/HtmlFileImpl.java
new file mode 100644
index 0000000..4154cfe
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/html/HtmlFileImpl.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.html;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.impl.source.tree.CompositeElement;
+import com.intellij.psi.impl.source.xml.XmlFileImpl;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlElementType;
+
+/**
+ * @author maxim
+ */
+public class HtmlFileImpl extends XmlFileImpl {
+  public HtmlFileImpl(FileViewProvider provider) {
+    super(provider, XmlElementType.HTML_FILE);
+  }
+
+  public String toString() {
+    return "HtmlFile:" + getName();
+  }
+
+  public XmlDocument getDocument() {
+    CompositeElement treeElement = calcTreeElement();
+
+    ASTNode node = treeElement.findChildByType(XmlElementType.HTML_DOCUMENT);
+    return node != null ? (XmlDocument)node.getPsi() : null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/html/HtmlTagImpl.java b/xml/impl/src/com/intellij/psi/impl/source/html/HtmlTagImpl.java
new file mode 100644
index 0000000..1d32413
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/html/HtmlTagImpl.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.html;
+
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.impl.source.xml.XmlTagImpl;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class HtmlTagImpl extends XmlTagImpl implements HtmlTag {
+  public HtmlTagImpl() {
+    super(XmlElementType.HTML_TAG);
+  }
+
+  @NotNull
+  public XmlTag[] findSubTags(String name, String namespace) {
+    final XmlTag[] subTags = getSubTags();
+    List<XmlTag> result = null;
+
+    for (final XmlTag subTag : subTags) {
+      if (namespace == null) {
+        String tagName = subTag.getName();
+        tagName = tagName.toLowerCase();
+
+        if (name == null || name.equals(tagName)) {
+          if (result == null) {
+            result = new ArrayList<XmlTag>(3);
+          }
+
+          result.add(subTag);
+        }
+      }
+      else if (namespace.equals(subTag.getNamespace()) &&
+               (name == null || name.equals(subTag.getLocalName()))
+        ) {
+        if (result == null) {
+          result = new ArrayList<XmlTag>(3);
+        }
+
+        result.add(subTag);
+      }
+    }
+
+    return result == null ? EMPTY : result.toArray(new XmlTag[result.size()]);
+  }
+
+  protected boolean isCaseSensitive() {
+    return false;
+  }
+
+  public String getAttributeValue(String qname) {
+    qname = qname.toLowerCase();
+    return super.getAttributeValue(qname);
+  }
+
+  protected void cacheOneAttributeValue(String name, String value, final Map<String, String> attributesValueMap) {
+    name = name.toLowerCase();
+    super.cacheOneAttributeValue(name, value, attributesValueMap);
+  }
+
+  public String getAttributeValue(String name, String namespace) {
+    name = name.toLowerCase();
+    return super.getAttributeValue(name, namespace);
+  }
+
+  @NotNull
+  public String getNamespace() {
+    final String xmlNamespace = super.getNamespace();
+
+    if (getNamespacePrefix().length() > 0) {
+      return xmlNamespace;
+    }
+
+    if (xmlNamespace.length() == 0 || xmlNamespace.equals(XmlUtil.XHTML_URI)) {
+      return XmlUtil.HTML_URI;
+    }
+
+    // ex.: mathML and SVG namespaces can be used inside html file
+    return xmlNamespace;
+  }
+
+  protected String getRealNs(final String value) {
+    if (XmlUtil.XHTML_URI.equals(value)) return XmlUtil.HTML_URI;
+    return value;
+  }
+
+  public String toString() {
+    return "HtmlTag:" + getName();
+  }
+
+  public String getPrefixByNamespace(String namespace) {
+    if (XmlUtil.HTML_URI.equals(namespace)) namespace = XmlUtil.XHTML_URI;
+    return super.getPrefixByNamespace(namespace);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/html/ScriptSupportUtil.java b/xml/impl/src/com/intellij/psi/impl/source/html/ScriptSupportUtil.java
new file mode 100644
index 0000000..55d68f8
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/html/ScriptSupportUtil.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.html;
+
+import com.intellij.openapi.util.Key;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.ResolveState;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceUtil;
+import com.intellij.psi.scope.PsiScopeProcessor;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.xml.*;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class ScriptSupportUtil {
+  private static final Key<CachedValue<XmlTag[]>> CachedScriptTagsKey = Key.create("script tags");
+  private static final ThreadLocal<String> ProcessingDeclarationsFlag = new ThreadLocal<String>();
+  private static final @NonNls String SCRIPT_TAG = "script";
+
+  private ScriptSupportUtil() {
+  }
+
+  public static void clearCaches(XmlFile element) {
+    element.putUserData(CachedScriptTagsKey,null);
+  }
+
+  public static boolean processDeclarations(final XmlFile element,
+                                            PsiScopeProcessor processor,
+                                            ResolveState state,
+                                            PsiElement lastParent,
+                                            PsiElement place) {
+    CachedValue<XmlTag[]> myCachedScriptTags = element.getUserData(CachedScriptTagsKey);
+    if (myCachedScriptTags == null) {
+      myCachedScriptTags = CachedValuesManager.getManager(element.getProject())
+          .createCachedValue(new CachedValueProvider<XmlTag[]>() {
+            @Override
+            public Result<XmlTag[]> compute() {
+              final List<XmlTag> scriptTags = new ArrayList<XmlTag>();
+              final XmlDocument document = HtmlUtil.getRealXmlDocument(element.getDocument());
+
+              if (document != null) {
+                PsiElementProcessor psiElementProcessor = new PsiElementProcessor() {
+                  public boolean execute(@NotNull final PsiElement element) {
+                    if (element instanceof XmlTag) {
+                      final XmlTag tag = (XmlTag)element;
+
+                      if (SCRIPT_TAG.equalsIgnoreCase(tag.getName())) {
+                        final XmlElementDescriptor descriptor = tag.getDescriptor();
+                        if (descriptor != null && SCRIPT_TAG.equals(descriptor.getName())) {
+                          scriptTags.add(tag);
+                        }
+                      }
+                    }
+                    return true;
+                  }
+                };
+                XmlUtil.processXmlElements(document, psiElementProcessor, true);
+              }
+
+              return new Result<XmlTag[]>(scriptTags.toArray(new XmlTag[scriptTags.size()]), element);
+            }
+          }, false);
+      element.putUserData(CachedScriptTagsKey, myCachedScriptTags);
+    }
+
+    if (ProcessingDeclarationsFlag.get() != null) return true;
+
+    try {
+      ProcessingDeclarationsFlag.set("");
+
+      for (XmlTag tag : myCachedScriptTags.getValue()) {
+        final XmlTagChild[] children = tag.getValue().getChildren();
+        for (XmlTagChild child : children) {
+          if (!child.processDeclarations(processor, state, null, place)) return false;
+        }
+
+        if (tag.getAttributeValue("src") != null) {
+          final XmlAttribute attribute = tag.getAttribute("src", null);
+
+          if (attribute != null) {
+            final PsiFile psiFile = FileReferenceUtil.findFile(attribute.getValueElement());
+
+            if (psiFile != null && psiFile.isValid()) {
+              if (!psiFile.processDeclarations(processor, state, null, place)) {
+                return false;
+              }
+            }
+          }
+        }
+      }
+    }
+    finally {
+      ProcessingDeclarationsFlag.set(null);
+    }
+
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/html/dtd/HtmlAttributeDescriptorImpl.java b/xml/impl/src/com/intellij/psi/impl/source/html/dtd/HtmlAttributeDescriptorImpl.java
new file mode 100644
index 0000000..75f8ae5
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/html/dtd/HtmlAttributeDescriptorImpl.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.html.dtd;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlAttributeDescriptor;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class HtmlAttributeDescriptorImpl implements XmlAttributeDescriptor {
+  private final XmlAttributeDescriptor delegate;
+  private final boolean myCaseSensitive;
+
+  public HtmlAttributeDescriptorImpl(XmlAttributeDescriptor _delegate, boolean caseSensitive) {
+    delegate = _delegate;
+    myCaseSensitive = caseSensitive;
+  }
+
+  public boolean isRequired() {
+    return delegate.isRequired();
+  }
+
+  public boolean isFixed() {
+    return delegate.isFixed();
+  }
+
+  public boolean hasIdType() {
+    return delegate.hasIdType();
+  }
+
+  public boolean hasIdRefType() {
+    return delegate.hasIdRefType();
+  }
+
+  public String getDefaultValue() {
+    return delegate.getDefaultValue();
+  }
+
+  //todo: refactor to hierarchy of value descriptor?
+  public boolean isEnumerated() {
+    return delegate.isEnumerated();
+  }
+
+  public String[] getEnumeratedValues() {
+    return delegate.getEnumeratedValues();
+  }
+
+  public String validateValue(XmlElement context, String value) {
+    if (!myCaseSensitive) value = value.toLowerCase();
+    return delegate.validateValue(context, value);
+  }
+
+  public PsiElement getDeclaration() {
+    return delegate.getDeclaration();
+  }
+
+  public String getName(PsiElement context) {
+    return delegate.getName(context);
+  }
+
+  public String getName() {
+    return delegate.getName();
+  }
+
+  public void init(PsiElement element) {
+    delegate.init(element);
+  }
+
+  public Object[] getDependences() {
+    return ArrayUtil.EMPTY_OBJECT_ARRAY;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/html/dtd/HtmlElementDescriptorImpl.java b/xml/impl/src/com/intellij/psi/impl/source/html/dtd/HtmlElementDescriptorImpl.java
new file mode 100644
index 0000000..12b2468
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/html/dtd/HtmlElementDescriptorImpl.java
@@ -0,0 +1,170 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.html.dtd;
+
+import com.intellij.html.impl.RelaxedHtmlFromSchemaElementDescriptor;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.impl.dtd.BaseXmlElementDescriptorImpl;
+import com.intellij.xml.impl.schema.XmlNSDescriptorImpl;
+import com.intellij.xml.util.XmlUtil;
+
+import java.util.HashMap;
+
+/**
+ * @by Maxim.Mossienko
+ */
+public class HtmlElementDescriptorImpl extends BaseXmlElementDescriptorImpl {
+  private final XmlElementDescriptor myDelegate;
+  private final boolean myRelaxed;
+  private final boolean myCaseSensitive;
+
+  public HtmlElementDescriptorImpl(XmlElementDescriptor _delegate, boolean relaxed, boolean caseSensitive) {
+    myDelegate = _delegate;
+    myRelaxed = relaxed;
+    myCaseSensitive = caseSensitive;
+  }
+
+  public String getQualifiedName() {
+    return myDelegate.getQualifiedName();
+  }
+
+  public String getDefaultName() {
+    return myDelegate.getDefaultName();
+  }
+
+  // Read-only calculation
+  protected final XmlElementDescriptor[] doCollectXmlDescriptors(final XmlTag context) {
+    XmlElementDescriptor[] elementsDescriptors = myDelegate.getElementsDescriptors(context);
+    XmlElementDescriptor[] temp = new XmlElementDescriptor[elementsDescriptors.length];
+
+    for (int i = 0; i < elementsDescriptors.length; i++) {
+      temp[i] = new HtmlElementDescriptorImpl( elementsDescriptors[i], myRelaxed, myCaseSensitive );
+    }
+    return temp;
+  }
+
+  public XmlElementDescriptor getElementDescriptor(XmlTag element, XmlTag contextTag) {
+    String name = element.getName();
+    if (!myCaseSensitive) name = name.toLowerCase();
+
+    XmlElementDescriptor xmlElementDescriptor = getElementDescriptor(name, element);
+    if (xmlElementDescriptor == null && myRelaxed) {
+      xmlElementDescriptor = RelaxedHtmlFromSchemaElementDescriptor.getRelaxedDescriptor(this, element);
+    }
+
+    return xmlElementDescriptor;
+  }
+
+  // Read-only calculation
+  protected HashMap<String, XmlElementDescriptor> collectElementDescriptorsMap(final XmlTag element) {
+    final HashMap<String, XmlElementDescriptor> hashMap = new HashMap<String, XmlElementDescriptor>();
+    final XmlElementDescriptor[] elementDescriptors = myDelegate.getElementsDescriptors(element);
+
+    for (XmlElementDescriptor elementDescriptor : elementDescriptors) {
+      hashMap.put(elementDescriptor.getName(), new HtmlElementDescriptorImpl(elementDescriptor, myRelaxed, myCaseSensitive));
+    }
+    return hashMap;
+  }
+
+  // Read-only calculation
+  protected XmlAttributeDescriptor[] collectAttributeDescriptors(final XmlTag context) {
+    final XmlAttributeDescriptor[] attributesDescriptors = myDelegate.getAttributesDescriptors(context);
+    XmlAttributeDescriptor[] temp = new XmlAttributeDescriptor[attributesDescriptors.length];
+
+    for (int i = 0; i < attributesDescriptors.length; i++) {
+      temp[i] = new HtmlAttributeDescriptorImpl(attributesDescriptors[i], myCaseSensitive);
+    }
+    return temp;
+  }
+
+  public XmlAttributeDescriptor getAttributeDescriptor(String attributeName, final XmlTag context) {
+    if (!myCaseSensitive) attributeName = attributeName.toLowerCase();
+    XmlAttributeDescriptor descriptor = super.getAttributeDescriptor(attributeName, context);
+    if (descriptor == null) descriptor = RelaxedHtmlFromSchemaElementDescriptor.getAttributeDescriptorFromFacelets(attributeName, context);
+    
+    if (descriptor == null) {
+      String prefix = XmlUtil.findPrefixByQualifiedName(attributeName);
+      
+      if ("xml".equals(prefix)) { // todo this is not technically correct dtd document references namespaces but we should handle it at least for xml stuff
+        XmlNSDescriptor nsdescriptor = context.getNSDescriptor(XmlUtil.XML_NAMESPACE_URI, true);
+        if (nsdescriptor instanceof XmlNSDescriptorImpl) {
+          descriptor = ((XmlNSDescriptorImpl)nsdescriptor).getAttribute(
+            XmlUtil.findLocalNameByQualifiedName(attributeName), XmlUtil.XML_NAMESPACE_URI, context);
+        }
+      }
+    }
+    return descriptor;
+  }
+
+  // Read-only calculation
+  protected HashMap<String, XmlAttributeDescriptor> collectAttributeDescriptorsMap(final XmlTag context) {
+    final HashMap<String, XmlAttributeDescriptor> hashMap = new HashMap<String, XmlAttributeDescriptor>();
+    XmlAttributeDescriptor[] elementAttributeDescriptors = myDelegate.getAttributesDescriptors(context);
+
+    for (final XmlAttributeDescriptor attributeDescriptor : elementAttributeDescriptors) {
+      hashMap.put(
+        attributeDescriptor.getName(),
+        new HtmlAttributeDescriptorImpl(attributeDescriptor, myCaseSensitive)
+      );
+    }
+    return hashMap;
+  }
+
+  public XmlNSDescriptor getNSDescriptor() {
+    return myDelegate.getNSDescriptor();
+  }
+
+  public int getContentType() {
+    return myDelegate.getContentType();
+  }
+
+  public PsiElement getDeclaration() {
+    return myDelegate.getDeclaration();
+  }
+
+  public String getName(PsiElement context) {
+    return myDelegate.getName(context);
+  }
+
+  public String getName() {
+    return myDelegate.getName();
+  }
+
+  public void init(PsiElement element) {
+    myDelegate.init(element);
+  }
+
+  public Object[] getDependences() {
+    return myDelegate.getDependences();
+  }
+
+  public XmlAttributeDescriptor[] getAttributesDescriptors(final XmlTag context) {
+    return RelaxedHtmlFromSchemaElementDescriptor.addAttrDescriptorsForFacelets(context, super.getAttributesDescriptors(context));
+  }
+
+  public boolean allowElementsFromNamespace(final String namespace, final XmlTag context) {
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    return myDelegate.toString();
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/html/dtd/HtmlNSDescriptorImpl.java b/xml/impl/src/com/intellij/psi/impl/source/html/dtd/HtmlNSDescriptorImpl.java
new file mode 100644
index 0000000..840e335
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/html/dtd/HtmlNSDescriptorImpl.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.html.dtd;
+
+import com.intellij.html.RelaxedHtmlNSDescriptor;
+import com.intellij.openapi.project.DumbAware;
+import com.intellij.openapi.util.SimpleFieldCache;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.impl.schema.TypeDescriptor;
+import com.intellij.xml.impl.schema.XmlNSTypeDescriptorProvider;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class HtmlNSDescriptorImpl implements XmlNSDescriptor, DumbAware, XmlNSTypeDescriptorProvider {
+  private XmlNSDescriptor myDelegate;
+  private boolean myRelaxed;
+  private boolean myCaseSensitive;
+
+  private static final SimpleFieldCache<Map<String, XmlElementDescriptor>, HtmlNSDescriptorImpl> myCachedDeclsCache = new SimpleFieldCache<Map<String, XmlElementDescriptor>, HtmlNSDescriptorImpl>() {
+    protected Map<String, XmlElementDescriptor> compute(final HtmlNSDescriptorImpl htmlNSDescriptor) {
+      return htmlNSDescriptor.doBuildCachedMap();
+    }
+
+    protected Map<String, XmlElementDescriptor> getValue(final HtmlNSDescriptorImpl htmlNSDescriptor) {
+      return htmlNSDescriptor.myCachedDecls;
+    }
+
+    protected void putValue(final Map<String, XmlElementDescriptor> map, final HtmlNSDescriptorImpl htmlNSDescriptor) {
+      htmlNSDescriptor.myCachedDecls = map;
+    }
+  };
+
+  private volatile Map<String, XmlElementDescriptor> myCachedDecls;
+
+  public HtmlNSDescriptorImpl(XmlNSDescriptor _delegate) {
+    this(_delegate, _delegate instanceof RelaxedHtmlNSDescriptor, false);
+  }
+
+  public HtmlNSDescriptorImpl(XmlNSDescriptor _delegate, boolean relaxed, boolean caseSensitive) {
+    myDelegate = _delegate;
+    myRelaxed = relaxed;
+    myCaseSensitive = caseSensitive;
+  }
+
+  private Map<String,XmlElementDescriptor> buildDeclarationMap() {
+    return myCachedDeclsCache.get(this);
+  }
+
+  // Read-only calculation
+  private HashMap<String, XmlElementDescriptor> doBuildCachedMap() {
+    HashMap<String, XmlElementDescriptor> decls = new HashMap<String, XmlElementDescriptor>();
+    XmlElementDescriptor[] elements = myDelegate == null ? XmlElementDescriptor.EMPTY_ARRAY : myDelegate.getRootElementsDescriptors(null);
+
+    for (XmlElementDescriptor element : elements) {
+      decls.put(
+        element.getName(),
+        new HtmlElementDescriptorImpl(element, myRelaxed, myCaseSensitive)
+      );
+    }
+    return decls;
+  }
+
+  public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
+    String name = tag.getLocalName();
+    if (!myCaseSensitive) name = name.toLowerCase();
+
+    XmlElementDescriptor xmlElementDescriptor = buildDeclarationMap().get(name);
+    if (xmlElementDescriptor == null && myRelaxed) {
+      xmlElementDescriptor = myDelegate.getElementDescriptor(tag);
+    }
+    return xmlElementDescriptor;
+  }
+
+  @NotNull
+  public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable final XmlDocument document) {
+    return myDelegate == null ? XmlElementDescriptor.EMPTY_ARRAY : myDelegate.getRootElementsDescriptors(document);
+  }
+
+  @Nullable
+  public XmlFile getDescriptorFile() {
+    return myDelegate == null ? null : myDelegate.getDescriptorFile();
+  }
+
+  public boolean isHierarhyEnabled() {
+    return false;
+  }
+
+  public PsiElement getDeclaration() {
+    return myDelegate == null ? null : myDelegate.getDeclaration();
+  }
+
+  public String getName(PsiElement context) {
+    return myDelegate == null ? "" : myDelegate.getName(context);
+  }
+
+  public String getName() {
+    return myDelegate == null ? "" : myDelegate.getName();
+  }
+
+  public void init(PsiElement element) {
+    myDelegate.init(element);
+  }
+
+  public Object[] getDependences() {
+    return myDelegate == null ? null : myDelegate.getDependences();
+  }
+
+  @Override
+  public TypeDescriptor getTypeDescriptor(String name, XmlTag context) {
+    return myDelegate instanceof XmlNSTypeDescriptorProvider ?
+           ((XmlNSTypeDescriptorProvider)myDelegate).getTypeDescriptor(name, context) : null;
+  }
+
+  @Override
+  public TypeDescriptor getTypeDescriptor(XmlTag descriptorTag) {
+    return myDelegate instanceof XmlNSTypeDescriptorProvider ?
+           ((XmlNSTypeDescriptorProvider)myDelegate).getTypeDescriptor(descriptorTag) : null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/DtdParsing.java b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/DtdParsing.java
new file mode 100644
index 0000000..06a1bea
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/DtdParsing.java
@@ -0,0 +1,871 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.parsing.xml;
+
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.LanguageParserDefinitions;
+import com.intellij.lang.PsiBuilder;
+import com.intellij.lang.PsiBuilderFactory;
+import com.intellij.lang.dtd.DTDLanguage;
+import com.intellij.lexer.DtdLexer;
+import com.intellij.lexer._DtdLexer;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.source.DummyHolder;
+import com.intellij.psi.impl.source.DummyHolderFactory;
+import com.intellij.psi.impl.source.resolve.FileContextUtil;
+import com.intellij.psi.impl.source.tree.FileElement;
+import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlEntityDecl;
+import com.intellij.xml.XmlBundle;
+
+/**
+ * @author Mike
+ */
+public class DtdParsing extends XmlParsing implements XmlElementType {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.parsing.xml.XmlParser");
+
+  private final IElementType myRootType;
+  public static final XmlEntityDecl.EntityContextType TYPE_FOR_MARKUP_DECL = XmlEntityDecl.EntityContextType.ELEMENT_CONTENT_SPEC;
+  private final XmlEntityDecl.EntityContextType myContextType;
+
+  public DtdParsing(IElementType root, XmlEntityDecl.EntityContextType contextType, PsiBuilder builder) {
+    super(builder);
+    myRootType = root;
+    myContextType = contextType;
+    myBuilder.enforceCommentTokens(TokenSet.EMPTY);
+  }
+
+  public DtdParsing(CharSequence chars,
+                    final IElementType type,
+                    final XmlEntityDecl.EntityContextType contextType,
+                    PsiFile contextFile
+  ) {
+    this(
+      type,
+      contextType,
+      PsiBuilderFactory.getInstance().createBuilder(
+        LanguageParserDefinitions.INSTANCE.forLanguage(DTDLanguage.INSTANCE),
+        new DtdLexer(false) {
+          final int myInitialState = getLexerInitialState(type, contextType);
+          @Override
+          public void start(CharSequence buffer, int startOffset, int endOffset, int initialState) {
+            super.start(buffer, startOffset, endOffset, myInitialState);
+          }
+        }, chars
+      )
+    );
+    if (contextFile != null) myBuilder.putUserDataUnprotected(FileContextUtil.CONTAINING_FILE_KEY, contextFile);
+  }
+
+  public ASTNode parse() {
+    final PsiBuilder.Marker root = myBuilder.mark();
+
+    if (myRootType == XML_MARKUP_DECL) {
+      parseTopLevelMarkupDecl();
+      root.done(myRootType);
+      return myBuilder.getTreeBuilt();
+    }
+
+    PsiBuilder.Marker document = null;
+    if (myRootType == DTD_FILE) {
+      document = myBuilder.mark();
+      parseProlog();
+    } 
+
+    switch (myContextType) {
+      case GENERIC_XML:
+        parseGenericXml();
+        break;
+      case ELEMENT_CONTENT_SPEC:
+        parseElementContentSpec();
+        break;
+      case ATTLIST_SPEC:
+        parseAttlistContent();
+        break;
+      case ATTR_VALUE:
+        parseAttrValue();
+      case ATTRIBUTE_SPEC:
+        parseAttributeContentSpec();
+        break;
+      case ENTITY_DECL_CONTENT:
+        parseEntityDeclContent();
+        break;
+      case ENUMERATED_TYPE:
+        parseEnumeratedTypeContent();
+        break;
+    }
+
+    while(!myBuilder.eof()) myBuilder.advanceLexer();
+    if (document != null) document.done(XML_DOCUMENT);
+    root.done(myRootType);
+    ASTNode astNode = myBuilder.getTreeBuilt();
+
+    if (myRootType != DTD_FILE) {
+      PsiFile file = myBuilder.getUserDataUnprotected(FileContextUtil.CONTAINING_FILE_KEY);
+      if (file != null) {
+        final DummyHolder result = DummyHolderFactory.createHolder(file.getManager(), DTDLanguage.INSTANCE, file);
+        final FileElement holder = result.getTreeElement();
+        holder.rawAddChildren((TreeElement)astNode);
+      }
+    }
+
+    return astNode;
+  }
+
+  private static int getLexerInitialState(IElementType rootNodeType, XmlEntityDecl.EntityContextType context) {
+    short state = 0;
+
+    switch (context) {
+      case ELEMENT_CONTENT_SPEC:
+      case ATTRIBUTE_SPEC:
+      case ATTLIST_SPEC:
+      case ENUMERATED_TYPE:
+      case ENTITY_DECL_CONTENT:
+      {
+        state = _DtdLexer.DOCTYPE_MARKUP;
+        break;
+      }
+
+      case ATTR_VALUE:
+      case GENERIC_XML: {
+        break;
+      }
+
+
+      default: LOG.error("context: " + context);
+    }
+
+    if (rootNodeType == XML_MARKUP_DECL && context == TYPE_FOR_MARKUP_DECL) {
+      state = _DtdLexer.DOCTYPE;
+    }
+    return state;
+  }
+
+  private void parseGenericXml() {
+    IElementType tokenType;
+
+    while ((tokenType = myBuilder.getTokenType()) != null) {
+      if (tokenType == XML_ATTLIST_DECL_START) {
+        parseAttlistDecl();
+      }
+      else if (tokenType == XML_ELEMENT_DECL_START) {
+        parseElementDecl();
+      }
+      else if (tokenType == XML_ENTITY_DECL_START) {
+        parseEntityDecl();
+      }
+      else if (tokenType == XML_NOTATION_DECL_START) {
+        parseNotationDecl();
+      }
+      else if (tokenType == XML_ENTITY_REF_TOKEN) {
+        parseEntityRef();
+      }
+      else if (parseProcessingInstruction()) {
+      }
+      else if (tokenType == XML_START_TAG_START) {
+        parseTag(false);
+      } else if (isCommentToken(tokenType)) {
+        parseComment();
+      }
+      else if (parseConditionalSection()) {
+      }
+      else if (tokenType != null) {
+        addToken();
+      }
+    }
+  }
+
+  private void parseNotationDecl() {
+    if (myBuilder.getTokenType() != XML_NOTATION_DECL_START) {
+      return;
+    }
+
+    PsiBuilder.Marker decl = myBuilder.mark();
+    addToken();
+
+    if (!parseName()) {
+      decl.done(XML_NOTATION_DECL);
+      return;
+    }
+
+    parseEntityDeclContent();
+
+    if (myBuilder.getTokenType() != null) {
+      addToken();
+    }
+
+    decl.done(XML_NOTATION_DECL);
+  }
+
+  private void parseEntityDecl() {
+    if (myBuilder.getTokenType() != XML_ENTITY_DECL_START) {
+      return;
+    }
+
+    PsiBuilder.Marker decl = myBuilder.mark();
+    addToken();
+
+    if (myBuilder.getTokenType() == XML_PERCENT) {
+      addToken();
+    }
+
+    if (parseCompositeName()) {
+      decl.done(XML_ENTITY_DECL);
+      return;
+    }
+
+    parseEntityDeclContent();
+
+    if (myBuilder.getTokenType() != null) {
+      addToken();
+    }
+
+    decl.done(XML_ENTITY_DECL);
+  }
+
+  private boolean parseCompositeName() {
+    if (!parseName()) {
+      if (myBuilder.getTokenType() == XML_LEFT_PAREN) {
+        parseGroup();
+      } else {
+        myBuilder.error(XmlBundle.message("dtd.parser.message.name.expected"));
+        return true;
+      }
+    }
+    return false;
+  }
+
+  private void parseEntityDeclContent() {
+    IElementType tokenType = myBuilder.getTokenType();
+    if (tokenType != XML_ATTRIBUTE_VALUE_START_DELIMITER &&
+        tokenType != XML_DOCTYPE_PUBLIC &&
+        tokenType != XML_DOCTYPE_SYSTEM) {
+      myBuilder.error(XmlBundle.message("dtd.parser.message.literal.public.system.expected"));
+      return;
+    }
+
+    while (tokenType != XML_TAG_END && tokenType != null) {
+      if (tokenType == XML_ATTRIBUTE_VALUE_START_DELIMITER) {
+        parseAttributeValue();
+      }
+      else {
+        addToken();
+      }
+
+      tokenType = myBuilder.getTokenType();
+    }
+  }
+
+  private boolean parseConditionalSection() {
+    if (myBuilder.getTokenType() != XML_CONDITIONAL_SECTION_START) {
+      return false;
+    }
+    
+    PsiBuilder.Marker conditionalSection = myBuilder.mark();
+
+    addToken();
+    IElementType tokenType = myBuilder.getTokenType();
+    if (tokenType != XML_CONDITIONAL_IGNORE &&
+        tokenType != XML_CONDITIONAL_INCLUDE &&
+        tokenType != XML_ENTITY_REF_TOKEN) {
+      conditionalSection.done(XML_CONDITIONAL_SECTION);
+      return true;
+    }
+
+    if (tokenType == XML_ENTITY_REF_TOKEN) {
+      parseEntityRef();
+    } else {
+      addToken();
+    }
+
+    if (myBuilder.getTokenType() != XML_MARKUP_START) {
+      conditionalSection.done(XML_CONDITIONAL_SECTION);
+      return true;
+    }
+
+    parseMarkupContent();
+
+    if (myBuilder.getTokenType() != XML_CONDITIONAL_SECTION_END) {
+      conditionalSection.done(XML_CONDITIONAL_SECTION);
+      return true;
+    }
+    addToken();
+    conditionalSection.done(XML_CONDITIONAL_SECTION);
+    return true;
+  }
+
+  private boolean parseProcessingInstruction() {
+    if (myBuilder.getTokenType() != XML_PI_START) {
+      return false;
+    }
+    PsiBuilder.Marker tag = myBuilder.mark();
+
+    addToken();
+    if (myBuilder.getTokenType() != XML_PI_TARGET) {
+      tag.done(XML_PROCESSING_INSTRUCTION);
+      return true;
+    }
+    addToken();
+    if (myBuilder.getTokenType() != XML_PI_END) {
+      tag.done(XML_PROCESSING_INSTRUCTION);
+      return true;
+    }
+    addToken();
+    tag.done(XML_PROCESSING_INSTRUCTION);
+    return true;
+  }
+
+  private void parseEntityRef() {
+    PsiBuilder.Marker ref = myBuilder.mark();
+
+    if (myBuilder.getTokenType() == XML_ENTITY_REF_TOKEN) {
+      addToken();
+    }
+
+    ref.done(XML_ENTITY_REF);
+  }
+
+  private void parseProlog() {
+    PsiBuilder.Marker prolog = myBuilder.mark();
+
+    while (parseProcessingInstruction()) {}
+
+    if (myBuilder.getTokenType() == XML_DECL_START) {
+      parseDecl();
+    }
+
+    while (parseProcessingInstruction()) {}
+
+    if (myBuilder.getTokenType() == XML_DOCTYPE_START) {
+      parseDocType();
+    }
+
+    while (parseProcessingInstruction()) {}
+
+    prolog.done(XML_PROLOG);
+  }
+
+  private void parseDocType() {
+    if (myBuilder.getTokenType() != XML_DOCTYPE_START) {
+      return;
+    }
+
+    PsiBuilder.Marker docType = myBuilder.mark();
+    addToken();
+
+    if (myBuilder.getTokenType() != XML_NAME) {
+      docType.done(XML_DOCTYPE);
+      return;
+    }
+
+    addToken();
+
+    if (myBuilder.getTokenType() == XML_DOCTYPE_SYSTEM) {
+      addToken();
+
+      if (myBuilder.getTokenType() == XML_ATTRIBUTE_VALUE_TOKEN) {
+        addToken();
+      }
+    }
+    else if (myBuilder.getTokenType() == XML_DOCTYPE_PUBLIC) {
+      addToken();
+
+      if (myBuilder.getTokenType() == XML_ATTRIBUTE_VALUE_TOKEN) {
+        addToken();
+      }
+
+      if (myBuilder.getTokenType() == XML_ATTRIBUTE_VALUE_TOKEN) {
+        addToken();
+      }
+    }
+
+    if (myBuilder.getTokenType() == XML_MARKUP_START) {
+      parseMarkupDecl();
+    }
+
+    if (myBuilder.getTokenType() != XML_DOCTYPE_END) {
+      docType.done(XML_DOCTYPE);
+      return;
+    }
+
+    addToken();
+
+    docType.done(XML_DOCTYPE);
+  }
+
+  private void parseMarkupDecl() {
+    PsiBuilder.Marker decl = myBuilder.mark();
+    parseMarkupContent();
+
+    decl.done(XML_MARKUP_DECL);
+  }
+
+  private void parseMarkupContent() {
+    IElementType tokenType = myBuilder.getTokenType();
+    if (tokenType == XML_MARKUP_START) {
+      addToken();
+    }
+
+    while (true) {
+      tokenType = myBuilder.getTokenType();
+      
+      if (tokenType == XML_ELEMENT_DECL_START) {
+        parseElementDecl();
+      }
+      else if (tokenType == XML_ATTLIST_DECL_START) {
+        parseAttlistDecl();
+      }
+      else if (tokenType == XML_ENTITY_DECL_START) {
+        parseEntityDecl();
+      }
+      else if (tokenType == XML_NOTATION_DECL_START) {
+        parseNotationDecl();
+      } else if (tokenType == XML_ENTITY_REF_TOKEN) {
+        parseEntityRef();
+      } else if (tokenType == XML_COMMENT_START) {
+        parseComment();
+      }
+      else if (parseConditionalSection()) {
+      }
+      else {
+        break;
+      }
+    }
+
+    if (tokenType == XML_MARKUP_END) {
+      addToken();
+    }
+  }
+
+  private void parseElementDecl() {
+    if (myBuilder.getTokenType() != XML_ELEMENT_DECL_START) {
+      return;
+    }
+
+    PsiBuilder.Marker decl = myBuilder.mark();
+
+    addToken();
+
+    if (parseCompositeName()) {
+      decl.done(XML_ELEMENT_DECL);
+      return;
+    }
+
+    doParseContentSpec(false);
+
+    skipTillEndOfBlock();
+
+    decl.done(XML_ELEMENT_DECL);
+  }
+
+  private void skipTillEndOfBlock() {
+    while (!myBuilder.eof() &&
+           myBuilder.getTokenType() != XML_TAG_END &&
+           !isAnotherDeclStart(myBuilder.getTokenType())
+      ) {
+      if (myBuilder.getTokenType() == XML_COMMENT_START) parseComment();
+      else addToken();
+    }
+
+    if(myBuilder.getTokenType() == XML_TAG_END) addToken();
+  }
+
+  private boolean isAnotherDeclStart(IElementType type) {
+    return type == XML_ATTLIST_DECL_START || type == XML_ELEMENT_DECL_START;
+  }
+
+  private boolean parseName() {
+    if (myBuilder.getTokenType() == XML_NAME) {
+      addToken();
+
+      return true;
+    }
+
+    if (myBuilder.getTokenType() == XML_ENTITY_REF_TOKEN) {
+      parseEntityRef();
+      return true;
+    }
+
+    return false;
+  }
+
+  private void parseElementContentSpec() {
+    doParseContentSpec(true);
+  }
+
+  private void doParseContentSpec(boolean topLevel) {
+    if (!topLevel && myBuilder.rawLookup(0) != XML_WHITE_SPACE) {
+      myBuilder.error(XmlBundle.message("dtd.parser.message.whitespace.expected"));
+    } else if (!topLevel) {
+      final IElementType tokenType = myBuilder.getTokenType();
+      String tokenText;
+
+      if (tokenType != XML_LEFT_PAREN &&
+          tokenType != XML_ENTITY_REF_TOKEN &&
+          tokenType != XML_CONTENT_ANY &&
+          tokenType != XML_CONTENT_EMPTY &&
+          (tokenType != XML_NAME || ( !("-".equals(tokenText = myBuilder.getTokenText())) && !"O".equals(tokenText))) // sgml compatibility
+        ) {
+        PsiBuilder.Marker spec = myBuilder.mark();
+        spec.done(XML_ELEMENT_CONTENT_SPEC);
+        myBuilder.error(XmlBundle.message("dtd.parser.message.left.paren.or.entityref.or.empty.or.any.expected"));
+        return;
+      }
+    }
+
+    PsiBuilder.Marker spec = myBuilder.mark();
+    
+    parseElementContentSpecInner(topLevel);
+
+    spec.done(XML_ELEMENT_CONTENT_SPEC);
+  }
+
+  private boolean parseElementContentSpecInner(boolean topLevel) {
+    IElementType tokenType = myBuilder.getTokenType();
+    boolean endedWithDelimiter = false;
+
+    while (
+      tokenType != null &&
+      tokenType != XML_TAG_END &&
+      tokenType != XML_START_TAG_START &&
+      tokenType != XML_ELEMENT_DECL_START &&
+      tokenType != XML_RIGHT_PAREN &&
+      tokenType != XML_COMMENT_START
+    ) {
+      if (tokenType == XML_BAR && topLevel) {
+        addToken();
+        tokenType = myBuilder.getTokenType();
+        continue;
+      } else
+      if (tokenType == XML_LEFT_PAREN) {
+        if (!parseGroup()) return false;
+        endedWithDelimiter = false;
+      } else
+      if (tokenType == XML_ENTITY_REF_TOKEN) {
+        parseEntityRef();
+        endedWithDelimiter = false;
+      } else if (tokenType == XML_NAME ||
+                 tokenType == XML_CONTENT_EMPTY ||
+                 tokenType == XML_CONTENT_ANY ||
+                 tokenType == XML_PCDATA
+                 ) {
+        addToken();
+        endedWithDelimiter = false;
+      }
+      else {
+        myBuilder.error(XmlBundle.message("dtd.parser.message.name.or.entity.ref.expected"));
+        return false;
+      }
+
+      tokenType = myBuilder.getTokenType();
+
+      if (tokenType == XML_STAR ||
+          tokenType == XML_PLUS ||
+          tokenType == XML_QUESTION
+         ) {
+        addToken();
+        tokenType = myBuilder.getTokenType();
+
+        if (tokenType == XML_PLUS) {
+          addToken();
+          tokenType = myBuilder.getTokenType();
+        }
+      }
+      if (tokenType == XML_BAR || tokenType == XML_COMMA) {
+        addToken();
+        tokenType = myBuilder.getTokenType();
+        endedWithDelimiter = true;
+      }
+    }
+
+    if (endedWithDelimiter && tokenType == XML_RIGHT_PAREN) {
+      myBuilder.error(XmlBundle.message("dtd.parser.message.name.or.entity.ref.expected"));
+    }
+    return true;
+  }
+
+  private boolean parseGroup() {
+    PsiBuilder.Marker group = myBuilder.mark();
+    addToken();
+    boolean b = parseElementContentSpecInner(false);
+    if (b && myBuilder.getTokenType() == XML_RIGHT_PAREN) {
+      addToken();
+      group.done(XML_ELEMENT_CONTENT_GROUP);
+      return true;
+    } else if (b) {
+      myBuilder.error(XmlBundle.message("dtd.parser.message.rbrace.expected"));
+      group.done(XML_ELEMENT_CONTENT_GROUP);
+      return false;
+    }
+    group.done(XML_ELEMENT_CONTENT_GROUP);
+    return b;
+  }
+
+  private void parseAttlistDecl() {
+    if (myBuilder.getTokenType() != XML_ATTLIST_DECL_START) {
+      return;
+    }
+
+    PsiBuilder.Marker decl = myBuilder.mark();
+    addToken();
+
+    if (!parseName()) {
+      final IElementType tokenType = myBuilder.getTokenType();
+      if (tokenType == XML_LEFT_PAREN) {
+        parseGroup();
+      } else {
+        myBuilder.error(XmlBundle.message("dtd.parser.message.name.expected"));
+        decl.done(XML_ATTLIST_DECL);
+        return;
+      }
+    }
+
+    parseAttlistContent();
+
+    skipTillEndOfBlock();
+
+    decl.done(XML_ATTLIST_DECL);
+  }
+
+  private void parseAttlistContent() {
+    while (true) {
+      if (myBuilder.getTokenType() == XML_ENTITY_REF_TOKEN) {
+        parseEntityRef();
+      }
+      else if (myBuilder.getTokenType() == XML_COMMENT_START) {
+        parseComment();
+      } else if (parseAttributeDecl()) {
+      }
+      else {
+        break;
+      }
+    }
+  }
+
+  private boolean parseAttributeDecl() {
+    if (myBuilder.getTokenType() != XML_NAME) {
+      return false;
+    }
+
+    PsiBuilder.Marker decl = myBuilder.mark();
+
+    addToken();
+
+    final boolean b = parseAttributeContentSpec();
+    //if (myBuilder.getTokenType() == XML_COMMENT_START) parseComment();
+    decl.done(XML_ATTRIBUTE_DECL);
+    return b;
+  }
+
+  private boolean parseAttributeContentSpec() {
+    if (parseName()) {
+    }
+    else if (myBuilder.getTokenType() == XML_LEFT_PAREN) {
+      parseEnumeratedType();
+    }
+    else {
+      return true;
+    }
+
+    if (myBuilder.getTokenType() == XML_ATT_IMPLIED) {
+      addToken();
+    }
+    else if (myBuilder.getTokenType() == XML_ATT_REQUIRED) {
+      addToken();
+    }
+    else if (myBuilder.getTokenType() == XML_ATT_FIXED) {
+      addToken();
+
+      if (myBuilder.getTokenType() == XML_ATTRIBUTE_VALUE_START_DELIMITER) {
+        parseAttributeValue();
+      }
+    }
+    else if (myBuilder.getTokenType() == XML_ATTRIBUTE_VALUE_START_DELIMITER) {
+      parseAttributeValue();
+    }
+
+    return true;
+  }
+
+  private void parseEnumeratedType() {
+    PsiBuilder.Marker enumeratedType = myBuilder.mark();
+    addToken();
+
+    parseEnumeratedTypeContent();
+
+    if (myBuilder.getTokenType() == XML_RIGHT_PAREN) {
+      addToken();
+    }
+
+    enumeratedType.done(XML_ENUMERATED_TYPE);
+  }
+
+  private void parseEnumeratedTypeContent() {
+    while (true) {
+      if (myBuilder.getTokenType() == XML_ENTITY_REF_TOKEN) {
+        parseEntityRef();
+        continue;
+      }
+
+      if (myBuilder.getTokenType() != XML_NAME && myBuilder.getTokenType() != XML_BAR) break;
+      addToken();
+    }
+  }
+
+  private void parseDecl() {
+    if (myBuilder.getTokenType() != XML_DECL_START) {
+      return;
+    }
+
+    PsiBuilder.Marker decl = myBuilder.mark();
+    addToken();
+
+    parseAttributeList();
+
+    if (myBuilder.getTokenType() == XML_DECL_END) {
+      addToken();
+    }
+    else {
+      myBuilder.error(XmlErrorMessages.message("expected.prologue.tag.termination.expected"));
+    }
+
+    decl.done(XML_DECL);
+  }
+
+  private void parseAttributeList() {
+    int lastPosition = -1;
+    while (true) {
+      if (myBuilder.getTokenType() == XML_ENTITY_REF_TOKEN) {
+        parseEntityRef();
+        continue;
+      }
+
+      if (myBuilder.getTokenType() != XML_NAME) {
+        return;
+      }
+
+      if (lastPosition != -1) {
+        if (lastPosition == myBuilder.getCurrentOffset()) {
+          myBuilder.error(XmlErrorMessages.message("expected.whitespace"));
+          lastPosition = -1;
+        }
+      }
+
+      addToken();
+
+      if (myBuilder.getTokenType() != XML_EQ) {
+        myBuilder.error(XmlErrorMessages.message("expected.attribute.eq.sign"));
+        continue;
+      }
+
+      addToken();
+
+      if (myBuilder.getTokenType() != XML_ATTRIBUTE_VALUE_START_DELIMITER) {
+        return;
+      }
+
+      addToken();
+
+      if (myBuilder.getTokenType() == XML_ATTRIBUTE_VALUE_TOKEN) {
+        addToken();
+        
+        if (myBuilder.getTokenType() == XML_ATTRIBUTE_VALUE_END_DELIMITER) {
+          lastPosition = myBuilder.getCurrentOffset();
+          addToken();
+        }
+        else {
+          lastPosition = -1;
+        }
+      }
+      else if (myBuilder.getTokenType() == XML_ATTRIBUTE_VALUE_END_DELIMITER) {
+        lastPosition = myBuilder.getCurrentOffset();
+        addToken();
+      }
+      else {
+        lastPosition = -1;
+      }
+    }
+  }
+
+  private int parseAttributeValue() {
+    if (myBuilder.getTokenType() != XML_ATTRIBUTE_VALUE_START_DELIMITER) {
+      return -1;
+    }
+
+    PsiBuilder.Marker value = myBuilder.mark();
+
+    addToken();
+
+    while (true) {
+      if (myBuilder.getTokenType() == XML_ATTRIBUTE_VALUE_TOKEN) {
+        addToken();
+      }
+      else if (myBuilder.getTokenType() == XML_CHAR_ENTITY_REF) {
+        addToken();
+      }
+      else if (myBuilder.getTokenType() == XML_ENTITY_REF_TOKEN) {
+        parseEntityRef();
+      }
+      else {
+        break;
+      }
+    }
+
+    if (myBuilder.getTokenType() != XML_ATTRIBUTE_VALUE_END_DELIMITER) {
+      value.done(XML_ATTRIBUTE_VALUE);
+      return -1;
+    }
+
+    int tokenEnd = myBuilder.getCurrentOffset();
+    addToken();
+    value.done(XML_ATTRIBUTE_VALUE);
+    return tokenEnd;
+  }
+
+  private void addToken() {
+    myBuilder.advanceLexer();
+  }
+
+  private void parseTopLevelMarkupDecl() {
+    parseMarkupContent();
+    while (myBuilder.getTokenType() != null) {
+      if (myBuilder.getTokenType() == XML_ENTITY_REF_TOKEN) {
+        parseEntityRef();
+      }
+      else if (myBuilder.getTokenType() == XML_ENTITY_DECL_START) {
+        parseEntityDecl();
+      }
+      else {
+        myBuilder.advanceLexer();
+      }
+    }
+  }
+
+  private void parseAttrValue() {
+    while(myBuilder.getTokenType() != null) {
+      if (myBuilder.getTokenType() == XML_ENTITY_REF_TOKEN) {
+        parseEntityRef();
+      } else {
+        addToken();
+      }
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/HtmlBuilderDriver.java b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/HtmlBuilderDriver.java
new file mode 100644
index 0000000..571b1e4
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/HtmlBuilderDriver.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.psi.impl.source.parsing.xml;
+
+import com.intellij.lang.LanguageParserDefinitions;
+import com.intellij.lang.ParserDefinition;
+import com.intellij.lang.PsiBuilder;
+import com.intellij.lang.PsiBuilderFactory;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.html.HtmlParsing;
+
+public class HtmlBuilderDriver extends XmlBuilderDriver {
+  public HtmlBuilderDriver(final CharSequence text) {
+    super(text);
+  }
+
+  protected PsiBuilder createBuilderAndParse() {
+    final ParserDefinition htmlParserDef = LanguageParserDefinitions.INSTANCE.forLanguage(HTMLLanguage.INSTANCE);
+    assert htmlParserDef != null;
+
+    PsiBuilder b = PsiBuilderFactory.getInstance().createBuilder(htmlParserDef, htmlParserDef.createLexer(null), getText());
+    new HtmlParsing(b).parseDocument();
+    return b;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlBuilder.java b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlBuilder.java
new file mode 100644
index 0000000..0594a70
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlBuilder.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.psi.impl.source.parsing.xml;
+
+import org.jetbrains.annotations.Nullable;
+
+public interface XmlBuilder {
+  void doctype(@Nullable final CharSequence publicId, @Nullable final CharSequence systemId, final int startOffset, final int endOffset);
+
+  enum ProcessingOrder {
+    TAGS,
+    TAGS_AND_TEXTS,
+    TAGS_AND_ATTRIBUTES,
+    TAGS_AND_ATTRIBUTES_AND_TEXTS
+  }
+
+  ProcessingOrder startTag(CharSequence localName, String namespace, int startoffset, int endoffset, final int headerEndOffset);
+  void endTag(CharSequence localName, String namespace, int startoffset, int endoffset);
+
+  void attribute(CharSequence name, CharSequence value, int startoffset, int endoffset);
+
+  void textElement(CharSequence display, CharSequence physical, int startoffset, int endoffset);
+
+  void entityRef(CharSequence ref, int startOffset, int endOffset);
+
+  void error(String message, int startOffset, int endOffset);
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlBuilderDriver.java b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlBuilderDriver.java
new file mode 100644
index 0000000..0518f9d
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlBuilderDriver.java
@@ -0,0 +1,317 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.psi.impl.source.parsing.xml;
+
+import com.intellij.lang.*;
+import com.intellij.lang.impl.PsiBuilderImpl;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.Ref;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.TokenType;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.containers.Stack;
+import com.intellij.util.diff.FlyweightCapableTreeStructure;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+public class XmlBuilderDriver {
+  private final Stack<String> myNamespacesStack = new Stack<String>();
+  private final Stack<String> myPrefixesStack = new Stack<String>();
+  private final CharSequence myText;
+  @NonNls private static final String XMLNS = "xmlns";
+  @NonNls private static final String XMLNS_COLON = "xmlns:";
+
+  public XmlBuilderDriver(final CharSequence text) {
+    myText = text;
+  }
+
+  protected CharSequence getText() {
+    return myText;
+  }
+
+  public void addImplicitBinding(@NonNls @NotNull String prefix, @NonNls @NotNull String namespace) {
+    myNamespacesStack.push(namespace);
+    myPrefixesStack.push(prefix);
+  }
+
+  public void build(XmlBuilder builder) {
+    PsiBuilder b = createBuilderAndParse();
+
+    FlyweightCapableTreeStructure<LighterASTNode> structure = b.getLightTree();
+
+    LighterASTNode root = structure.getRoot();
+    root = structure.prepareForGetChildren(root);
+
+    final Ref<LighterASTNode[]> childrenRef = Ref.create(null);
+    final int count = structure.getChildren(root, childrenRef);
+    LighterASTNode[] children = childrenRef.get();
+
+    for (int i = 0; i < count; i++) {
+      LighterASTNode child = children[i];
+      final IElementType tt = child.getTokenType();
+      if (tt == XmlElementType.XML_TAG || tt == XmlElementType.HTML_TAG) {
+        processTagNode(b, structure, child, builder);
+      }
+      else if (tt == XmlElementType.XML_PROLOG) {
+        processPrologNode(b, builder, structure, child);
+      }
+    }
+
+    structure.disposeChildren(children, count);
+  }
+
+  private void processPrologNode(PsiBuilder psiBuilder,
+                                 XmlBuilder builder,
+                                 FlyweightCapableTreeStructure<LighterASTNode> structure,
+                                 LighterASTNode prolog) {
+    final Ref<LighterASTNode[]> prologChildren = new Ref<LighterASTNode[]>(null);
+    final int prologChildrenCount = structure.getChildren(structure.prepareForGetChildren(prolog), prologChildren);
+    for (int i = 0; i < prologChildrenCount; i++) {
+      LighterASTNode node = prologChildren.get()[i];
+      IElementType type = node.getTokenType();
+      if (type == XmlElementType.XML_DOCTYPE) {
+        processDoctypeNode(builder, structure, node);
+        break;
+      }
+      if (type == TokenType.ERROR_ELEMENT) {
+        processErrorNode(psiBuilder, node, builder);
+      }
+    }
+  }
+
+  private void processDoctypeNode(final XmlBuilder builder, final FlyweightCapableTreeStructure<LighterASTNode> structure,
+                                  final LighterASTNode doctype) {
+    final Ref<LighterASTNode[]> tokens = new Ref<LighterASTNode[]>(null);
+    final int tokenCount = structure.getChildren(structure.prepareForGetChildren(doctype), tokens);
+    if (tokenCount > 0) {
+      CharSequence publicId = null;
+      boolean afterPublic = false;
+      CharSequence systemId = null;
+      boolean afterSystem = false;
+      for (int i = 0; i < tokenCount; i++) {
+        LighterASTNode token = tokens.get()[i];
+        if (token.getTokenType() == XmlElementType.XML_DOCTYPE_PUBLIC) {
+          afterPublic = true;
+        }
+        else if (token.getTokenType() == XmlElementType.XML_DOCTYPE_SYSTEM) {
+          afterSystem = true;
+        }
+        else if (token.getTokenType() != TokenType.WHITE_SPACE && token.getTokenType() != XmlElementType.XML_COMMENT) {
+          if (token.getTokenType() == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN) {
+            if (afterPublic) publicId = getTokenText(token);
+            else if (afterSystem) systemId = getTokenText(token);
+          }
+          afterPublic = afterSystem = false;
+        }
+      }
+      builder.doctype(publicId, systemId, doctype.getStartOffset(), doctype.getEndOffset());
+    }
+  }
+
+  private CharSequence getTokenText(final LighterASTNode token) {
+    return myText.subSequence(token.getStartOffset(), token.getEndOffset());
+  }
+
+  protected PsiBuilder createBuilderAndParse() {
+    final ParserDefinition xmlParserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(XMLLanguage.INSTANCE);
+    assert xmlParserDefinition != null;
+
+    PsiBuilder b = PsiBuilderFactory.getInstance().createBuilder(xmlParserDefinition, xmlParserDefinition.createLexer(null), myText);
+    new XmlParsing(b).parseDocument();
+    return b;
+  }
+
+  private void processErrorNode(PsiBuilder psiBuilder, LighterASTNode node, XmlBuilder builder) {
+    assert node.getTokenType() == TokenType.ERROR_ELEMENT;
+    String message = PsiBuilderImpl.getErrorMessage(node);
+    assert message != null;
+    builder.error(message, node.getStartOffset(), node.getEndOffset());
+  }
+
+  private void processTagNode(PsiBuilder psiBuilder,
+                              FlyweightCapableTreeStructure<LighterASTNode> structure,
+                              LighterASTNode node,
+                              XmlBuilder builder) {
+    final IElementType nodeTT = node.getTokenType();
+    assert nodeTT == XmlElementType.XML_TAG || nodeTT == XmlElementType.HTML_TAG;
+
+    node = structure.prepareForGetChildren(node);
+
+    final Ref<LighterASTNode[]> childrenRef = Ref.create(null);
+    final int count = structure.getChildren(node, childrenRef);
+    LighterASTNode[] children = childrenRef.get();
+
+    int stackFrameSize = myNamespacesStack.size();
+    CharSequence tagName = "";
+    int headerEndOffset = node.getEndOffset();
+    for (int i = 0; i < count; i++) {
+      LighterASTNode child = children[i];
+      final IElementType tt = child.getTokenType();
+      if (tt == XmlElementType.XML_ATTRIBUTE) checkForXmlns(child, structure);
+      if (tt == XmlTokenType.XML_TAG_END || tt == XmlTokenType.XML_EMPTY_ELEMENT_END) {
+        headerEndOffset = child.getEndOffset();
+        break;
+      }
+      if (tt == XmlTokenType.XML_NAME || tt == XmlTokenType.XML_TAG_NAME) {
+        tagName = getTokenText(child);
+      }
+    }
+
+    CharSequence localName = XmlUtil.getLocalName(tagName);
+    String namespace = getNamespace(tagName);
+
+    XmlBuilder.ProcessingOrder order = builder.startTag(localName, namespace, node.getStartOffset(), node.getEndOffset(), headerEndOffset);
+    boolean processAttrs = order == XmlBuilder.ProcessingOrder.TAGS_AND_ATTRIBUTES ||
+                           order == XmlBuilder.ProcessingOrder.TAGS_AND_ATTRIBUTES_AND_TEXTS;
+
+    boolean processTexts = order == XmlBuilder.ProcessingOrder.TAGS_AND_TEXTS ||
+                           order == XmlBuilder.ProcessingOrder.TAGS_AND_ATTRIBUTES_AND_TEXTS;
+
+    for (int i = 0; i < count; i++) {
+      LighterASTNode child = children[i];
+      IElementType tt = child.getTokenType();
+      if (tt == TokenType.ERROR_ELEMENT) processErrorNode(psiBuilder, child, builder);
+      if (tt == XmlElementType.XML_TAG || tt == XmlElementType.HTML_TAG) processTagNode(psiBuilder, structure, child, builder);
+      if (processAttrs && tt == XmlElementType.XML_ATTRIBUTE) processAttributeNode(child, structure, builder);
+      if (processTexts && tt == XmlElementType.XML_TEXT) processTextNode(structure, child, builder);
+      if (tt == XmlElementType.XML_ENTITY_REF) builder.entityRef(getTokenText(child), child.getStartOffset(), child.getEndOffset());
+    }
+
+    builder.endTag(localName, namespace, node.getStartOffset(), node.getEndOffset());
+
+    int framesToDrop = myNamespacesStack.size() - stackFrameSize;
+    for (int i = 0; i < framesToDrop; i++) {
+      myNamespacesStack.pop();
+      myPrefixesStack.pop();
+    }
+
+    structure.disposeChildren(children, count);
+  }
+
+  private void processTextNode(FlyweightCapableTreeStructure<LighterASTNode> structure, LighterASTNode node, XmlBuilder builder) {
+    node = structure.prepareForGetChildren(node);
+
+    final Ref<LighterASTNode[]> childrenRef = Ref.create(null);
+    final int count = structure.getChildren(node, childrenRef);
+    LighterASTNode[] children = childrenRef.get();
+
+    for (int i = 0; i < count; i++) {
+      LighterASTNode child = children[i];
+      IElementType tt = child.getTokenType();
+      final int start = child.getStartOffset();
+      final int end = child.getEndOffset();
+      final CharSequence physical = getTokenText(child);
+
+      if (XmlTokenType.COMMENTS.contains(tt)) continue;
+
+      if (tt == XmlTokenType.XML_CDATA_START || tt == XmlTokenType.XML_CDATA_END) {
+        builder.textElement("", physical, start, end);
+      }
+      else if (tt == XmlElementType.XML_CDATA) {
+        processTextNode(structure, child, builder);
+      }
+      else if (tt == XmlTokenType.XML_CHAR_ENTITY_REF) {
+        builder.textElement(new String(new char[] {XmlUtil.getCharFromEntityRef(physical.toString())}), physical, start, end);
+      }
+      else {
+        builder.textElement(physical, physical, start, end);
+      }
+    }
+
+    structure.disposeChildren(children, count);
+  }
+
+  private void processAttributeNode(final LighterASTNode attrNode, FlyweightCapableTreeStructure<LighterASTNode> structure, XmlBuilder builder) {
+    builder.attribute(getAttributeName(attrNode, structure), getAttributeValue(attrNode, structure), attrNode.getStartOffset(), attrNode.getEndOffset());
+  }
+
+  private String getNamespace(final CharSequence tagName) {
+    final String namespacePrefix;
+    int pos = StringUtil.indexOf(tagName, ':');
+    if (pos == -1) {
+      namespacePrefix = "";
+    }
+    else {
+      namespacePrefix = tagName.subSequence(0, pos).toString();
+    }
+
+    for (int i = myPrefixesStack.size() - 1; i >= 0; i--) {
+      if (namespacePrefix.equals(myPrefixesStack.get(i))) return myNamespacesStack.get(i);
+    }
+
+    return "";
+  }
+
+  private void checkForXmlns(LighterASTNode attrNode, FlyweightCapableTreeStructure<LighterASTNode> structure) {
+    final CharSequence name = getAttributeName(attrNode, structure);
+    if (Comparing.equal(name, XMLNS)) {
+      myPrefixesStack.push("");
+      myNamespacesStack.push(getAttributeValue(attrNode, structure).toString());
+    }
+    else if (StringUtil.startsWith(name, XMLNS_COLON)) {
+      myPrefixesStack.push(name.subSequence(XMLNS_COLON.length(), name.length()).toString());
+      myNamespacesStack.push(getAttributeValue(attrNode, structure).toString());
+    }
+  }
+
+
+  private CharSequence getAttributeName(LighterASTNode attrNode, FlyweightCapableTreeStructure<LighterASTNode> structure) {
+    return findTextByTokenType(attrNode, structure, XmlTokenType.XML_NAME);
+  }
+
+  private CharSequence getAttributeValue(LighterASTNode attrNode, FlyweightCapableTreeStructure<LighterASTNode> structure) {
+    final CharSequence fullValue = findTextByTokenType(attrNode, structure, XmlElementType.XML_ATTRIBUTE_VALUE);
+    int start = 0;
+    if (fullValue.length() > 0 && fullValue.charAt(0) == '\"') start++;
+
+    int end = fullValue.length();
+    if (fullValue.length() > start && fullValue.charAt(fullValue.length() - 1) == '\"') end--;
+
+    return fullValue.subSequence(start, end);
+  }
+
+  private CharSequence findTextByTokenType(LighterASTNode attrNode,
+                                           FlyweightCapableTreeStructure<LighterASTNode> structure,
+                                           IElementType tt) {
+    attrNode = structure.prepareForGetChildren(attrNode);
+
+    final Ref<LighterASTNode[]> childrenRef = Ref.create(null);
+    final int count = structure.getChildren(attrNode, childrenRef);
+    LighterASTNode[] children = childrenRef.get();
+
+    CharSequence name = "";
+    for (int i = 0; i < count; i++) {
+      LighterASTNode child = children[i];
+      if (child.getTokenType() == tt) {
+        name = getTokenText(child);
+        break;
+      }
+    }
+
+    structure.disposeChildren(children, count);
+
+    return name;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlParser.java b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlParser.java
new file mode 100644
index 0000000..02f336a3
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlParser.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.psi.impl.source.parsing.xml;
+
+import com.intellij.lang.*;
+import com.intellij.lang.impl.PsiBuilderImpl;
+import com.intellij.openapi.util.Ref;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.ThreeState;
+import com.intellij.util.TripleFunction;
+import com.intellij.util.diff.FlyweightCapableTreeStructure;
+import org.jetbrains.annotations.NotNull;
+
+public class XmlParser implements PsiParser {
+  // tries to match an old and new XmlTag by name
+  private static final TripleFunction<ASTNode,LighterASTNode,FlyweightCapableTreeStructure<LighterASTNode>,ThreeState>
+    REPARSE_XML_TAG_BY_NAME = new TripleFunction<ASTNode, LighterASTNode, FlyweightCapableTreeStructure<LighterASTNode>, ThreeState>() {
+      @Override
+      public ThreeState fun(ASTNode oldNode,
+                            LighterASTNode newNode,
+                            FlyweightCapableTreeStructure<LighterASTNode> structure) {
+        if (oldNode instanceof XmlTag && newNode.getTokenType() == XmlElementType.XML_TAG) {
+          String oldName = ((XmlTag)oldNode).getName();
+          Ref<LighterASTNode[]> childrenRef = Ref.create(null);
+          int count = structure.getChildren(newNode, childrenRef);
+          if (count < 3) return ThreeState.UNSURE;
+          LighterASTNode[] children = childrenRef.get();
+          if (children[0].getTokenType() != XmlTokenType.XML_START_TAG_START) return ThreeState.UNSURE;
+          if (children[1].getTokenType() != XmlTokenType.XML_NAME) return ThreeState.UNSURE;
+          if (children[2].getTokenType() != XmlTokenType.XML_TAG_END) return ThreeState.UNSURE;
+          LighterASTTokenNode name = (LighterASTTokenNode)children[1];
+          CharSequence newName = name.getText();
+          if (!oldName.equals(newName)) return ThreeState.NO;
+        }
+
+        return ThreeState.UNSURE;
+      }
+    };
+
+  @NotNull
+  public ASTNode parse(final IElementType root, final PsiBuilder builder) {
+    builder.enforceCommentTokens(TokenSet.EMPTY);
+    builder.putUserDataUnprotected(PsiBuilderImpl.CUSTOM_COMPARATOR, REPARSE_XML_TAG_BY_NAME);
+    final PsiBuilder.Marker file = builder.mark();
+    new XmlParsing(builder).parseDocument();
+    file.done(root);
+    return builder.getTreeBuilt();
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlParsing.java b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlParsing.java
new file mode 100644
index 0000000..a98e5db
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/parsing/xml/XmlParsing.java
@@ -0,0 +1,487 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.parsing.xml;
+
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.lang.PsiBuilder;
+import com.intellij.psi.tree.CustomParsingType;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.ILazyParseableElementType;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.containers.Stack;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import static com.intellij.psi.xml.XmlElementType.*;
+
+/*
+ * @author max
+ */
+public class XmlParsing {
+  private static final int BALANCING_DEPTH_THRESHOLD = 1000;
+
+  protected final PsiBuilder myBuilder;
+  private final Stack<String> myTagNamesStack = new Stack<String>();
+
+  public XmlParsing(final PsiBuilder builder) {
+    myBuilder = builder;
+  }
+
+  public void parseDocument() {
+    final PsiBuilder.Marker document = mark();
+
+    while (isCommentToken(token())) {
+      parseComment();
+    }
+
+    parseProlog();
+
+    int rootTagCount = 0;
+    PsiBuilder.Marker error = null;
+    while (!eof()) {
+      final IElementType tt = token();
+      if (tt == XML_START_TAG_START) {
+        error = flushError(error);
+        rootTagCount++;
+        parseTag(rootTagCount > 1);
+      }
+      else if (isCommentToken(tt)) {
+        error = flushError(error);
+        parseComment();
+      }
+      else if (tt == XML_PI_START) {
+        error = flushError(error);
+        parseProcessingInstruction();
+      }
+      else if (tt == XML_REAL_WHITE_SPACE) {
+        error = flushError(error);
+        advance();
+      }
+      else {
+        if (error == null) error = mark();
+        advance();
+      }
+    }
+
+    if (error != null) {
+      error.error(XmlErrorMessages.message("top.level.element.is.not.completed"));
+    }
+
+    if (rootTagCount == 0) {
+      final PsiBuilder.Marker rootTag = mark();
+      error = mark();
+      error.error(XmlErrorMessages.message("xml.parsing.absent.root.tag"));
+      rootTag.done(XmlElementType.XML_TAG);
+    }
+
+    document.done(XmlElementType.XML_DOCUMENT);
+  }
+
+  @Nullable
+  private static PsiBuilder.Marker flushError(PsiBuilder.Marker error) {
+    if (error != null) {
+      error.error(XmlErrorMessages.message("xml.parsing.unexpected.tokens"));
+      error = null;
+    }
+    return error;
+  }
+
+  private void parseDoctype() {
+    assert token() == XML_DOCTYPE_START : "Doctype start expected";
+    final PsiBuilder.Marker doctype = mark();
+    advance();
+
+    while (token() != XML_DOCTYPE_END && !eof()) advance();
+    if (eof()) {
+      error(XmlErrorMessages.message("xml.parsing.unexpected.end.of.file"));
+    }
+    else {
+      advance();
+    }
+
+    doctype.done(XML_DOCTYPE);
+  }
+
+  protected void parseTag(boolean multipleRootTagError) {
+    assert token() == XML_START_TAG_START : "Tag start expected";
+    final PsiBuilder.Marker tag = mark();
+
+    final String tagName = parseTagHeader(multipleRootTagError, tag);
+    if (tagName == null) return;
+
+    final PsiBuilder.Marker content = mark();
+    parseTagContent();
+
+    if (token() == XML_END_TAG_START) {
+      final PsiBuilder.Marker footer = mark();
+      advance();
+
+      if (token() == XML_NAME) {
+        String endName = myBuilder.getTokenText();
+        if (!tagName.equals(endName) && myTagNamesStack.contains(endName)) {
+          footer.rollbackTo();
+          myTagNamesStack.pop();
+          tag.doneBefore(XmlElementType.XML_TAG, content, XmlErrorMessages.message("named.element.is.not.closed", tagName));
+          content.drop();
+          return;
+        }
+
+        advance();
+      }
+      footer.drop();
+
+      while (token() != XmlTokenType.XML_TAG_END && token() != XmlTokenType.XML_START_TAG_START && token() != XmlTokenType.XML_END_TAG_START && !eof()) {
+        error(XmlErrorMessages.message("xml.parsing.unexpected.token"));
+        advance();
+      }
+
+      if (token() == XML_TAG_END) {
+        advance();
+      }
+      else {
+        error(XmlErrorMessages.message("xml.parsing.closing.tag.is.not.done"));
+      }
+    }
+    else {
+      error(XmlErrorMessages.message("xml.parsing.unexpected.end.of.file"));
+    }
+
+    content.drop();
+    myTagNamesStack.pop();
+    tag.done(XmlElementType.XML_TAG);
+  }
+
+  @Nullable
+  private String parseTagHeader(final boolean multipleRootTagError, final PsiBuilder.Marker tag) {
+    if (multipleRootTagError) {
+      final PsiBuilder.Marker error = mark();
+      advance();
+      error.error(XmlErrorMessages.message("xml.parsing.multiple.root.tags"));
+    }
+    else {
+      advance();
+    }
+
+    final String tagName;
+    if (token() != XML_NAME) {
+      error(XmlErrorMessages.message("xml.parsing.tag.name.expected"));
+      tagName = "";
+    }
+    else {
+      tagName = myBuilder.getTokenText();
+      assert tagName != null;
+      advance();
+    }
+    myTagNamesStack.push(tagName);
+
+    do {
+      final IElementType tt = token();
+      if (tt == XML_NAME) {
+        parseAttribute();
+      }
+      else if (tt == XML_CHAR_ENTITY_REF || tt == XML_ENTITY_REF_TOKEN) {
+        parseReference();
+      }
+      else {
+        break;
+      }
+    }
+    while (true);
+
+    if (token() == XML_EMPTY_ELEMENT_END) {
+      advance();
+      myTagNamesStack.pop();
+      tag.done(XmlElementType.XML_TAG);
+      return null;
+    }
+
+    if (token() == XML_TAG_END) {
+      advance();
+    }
+    else {
+      error(XmlErrorMessages.message("tag.start.is.not.closed"));
+      myTagNamesStack.pop();
+      tag.done(XmlElementType.XML_TAG);
+      return null;
+    }
+
+    if (myTagNamesStack.size() > BALANCING_DEPTH_THRESHOLD) {
+      error(XmlErrorMessages.message("way.too.unbalanced"));
+      tag.done(XmlElementType.XML_TAG);
+      return null;
+    }
+
+    return tagName;
+  }
+
+  public void parseTagContent() {
+    PsiBuilder.Marker xmlText = null;
+    while (token() != XML_END_TAG_START && !eof()) {
+      final IElementType tt = token();
+      if (tt == XML_START_TAG_START) {
+        xmlText = terminateText(xmlText);
+        parseTag(false);
+      }
+      else if (tt == XML_PI_START) {
+        xmlText = terminateText(xmlText);
+        parseProcessingInstruction();
+      }
+      else if (tt == XML_ENTITY_REF_TOKEN) {
+        xmlText = terminateText(xmlText);
+        parseReference();
+      }
+      else if (tt == XML_CHAR_ENTITY_REF) {
+        xmlText = startText(xmlText);
+        parseReference();
+      }
+      else if (tt == XML_CDATA_START) {
+        xmlText = startText(xmlText);
+        parseCData();
+      }
+      else if (isCommentToken(tt)) {
+        xmlText = terminateText(xmlText);
+        parseComment();
+      }
+      else if (tt == XML_BAD_CHARACTER) {
+        xmlText = startText(xmlText);
+        final PsiBuilder.Marker error = mark();
+        advance();
+        error.error(XmlErrorMessages.message("unescaped.ampersand.or.nonterminated.character.entity.reference"));
+      }
+      else if (tt instanceof CustomParsingType || tt instanceof ILazyParseableElementType) {
+        xmlText = terminateText(xmlText);
+        advance();
+      }
+      else {
+        xmlText = startText(xmlText);
+        advance();
+      }
+    }
+
+    terminateText(xmlText);
+  }
+
+  protected boolean isCommentToken(final IElementType tt) {
+    return tt == XML_COMMENT_START;
+  }
+
+  @NotNull
+  private PsiBuilder.Marker startText(@Nullable PsiBuilder.Marker xmlText) {
+    if (xmlText == null) {
+      xmlText = mark();
+      assert xmlText != null;
+    }
+    return xmlText;
+  }
+
+  protected final PsiBuilder.Marker mark() {
+    return myBuilder.mark();
+  }
+
+  @Nullable
+  private static PsiBuilder.Marker terminateText(@Nullable PsiBuilder.Marker xmlText) {
+    if (xmlText != null) {
+      xmlText.done(XML_TEXT);
+      xmlText = null;
+    }
+    return xmlText;
+  }
+
+  private void parseCData() {
+    assert token() == XML_CDATA_START;
+    final PsiBuilder.Marker cdata = mark();
+    while (token() != XML_CDATA_END && !eof()) {
+      advance();
+    }
+
+    if (!eof()) {
+      advance();
+    }
+
+    cdata.done(XML_CDATA);
+  }
+
+  protected void parseComment() {
+    final PsiBuilder.Marker comment = mark();
+    advance();
+    while (true) {
+      final IElementType tt = token();
+      if (tt == XML_COMMENT_CHARACTERS|| tt == XML_CONDITIONAL_COMMENT_START
+        || tt == XML_CONDITIONAL_COMMENT_START_END || tt == XML_CONDITIONAL_COMMENT_END_START
+        || tt == XML_CONDITIONAL_COMMENT_END) {
+        advance();
+        continue;
+      }
+      else if (tt == XML_BAD_CHARACTER) {
+        final PsiBuilder.Marker error = mark();
+        advance();
+        error.error(XmlErrorMessages.message("xml.parsing.bad.character"));
+        continue;
+      }
+      if (tt == XML_COMMENT_END) {
+        advance();
+      }
+      break;
+    }
+    comment.done(XML_COMMENT);
+  }
+
+  private void parseReference() {
+    if (token() == XML_CHAR_ENTITY_REF) {
+      advance();
+    }
+    else if (token() == XML_ENTITY_REF_TOKEN) {
+      final PsiBuilder.Marker ref = mark();
+      advance();
+      ref.done(XML_ENTITY_REF);
+    }
+    else {
+      assert false : "Unexpected token";
+    }
+  }
+
+  private void parseAttribute() {
+    assert token() == XML_NAME;
+    final PsiBuilder.Marker att = mark();
+    advance();
+    if (token() == XML_EQ) {
+      advance();
+      parseAttributeValue();
+      att.done(XML_ATTRIBUTE);
+    }
+    else {
+      error(XmlErrorMessages.message("expected.attribute.eq.sign"));
+      att.done(XML_ATTRIBUTE);
+    }
+  }
+
+  private void parseAttributeValue() {
+    final PsiBuilder.Marker attValue = mark();
+    if (token() == XML_ATTRIBUTE_VALUE_START_DELIMITER) {
+      while (true) {
+        final IElementType tt = token();
+        if (tt == null || tt == XML_ATTRIBUTE_VALUE_END_DELIMITER || tt == XML_END_TAG_START || tt == XML_EMPTY_ELEMENT_END ||
+            tt == XML_START_TAG_START) {
+          break;
+        }
+
+        if (tt == XML_BAD_CHARACTER) {
+          final PsiBuilder.Marker error = mark();
+          advance();
+          error.error(XmlErrorMessages.message("unescaped.ampersand.or.nonterminated.character.entity.reference"));
+        }
+        else if (tt == XML_ENTITY_REF_TOKEN) {
+          parseReference();
+        }
+        else {
+          advance();
+        }
+      }
+
+      if (token() == XML_ATTRIBUTE_VALUE_END_DELIMITER) {
+        advance();
+      }
+      else {
+        error(XmlErrorMessages.message("xml.parsing.unclosed.attribute.value"));
+      }
+    }
+    else {
+      error(XmlErrorMessages.message("xml.parsing.attribute.value.expected"));
+    }
+
+    attValue.done(XML_ATTRIBUTE_VALUE);
+  }
+
+  private void parseProlog() {
+    final PsiBuilder.Marker prolog = mark();
+    while (true) {
+      final IElementType tt = token();
+      if (tt == XML_PI_START) {
+        parseProcessingInstruction();
+      }
+      else if (tt == XML_DOCTYPE_START) {
+        parseDoctype();
+      }
+      else if (isCommentToken(tt)) {
+        parseComment();
+      }
+      else if (tt == XML_REAL_WHITE_SPACE) {
+        advance();
+      }
+      else {
+        break;
+      }
+    }
+    prolog.done(XML_PROLOG);
+  }
+
+  private void parseProcessingInstruction() {
+    assert token() == XML_PI_START;
+    final PsiBuilder.Marker pi = mark();
+    advance();
+    if (token() != XML_NAME) {
+      error(XmlErrorMessages.message("xml.parsing.processing.instruction.name.expected"));
+    }
+    else {
+      advance();
+    }
+
+    final IElementType tokenType = token();
+    if (tokenType == XML_TAG_CHARACTERS) {
+      while (token() == XML_TAG_CHARACTERS) {
+        advance();
+      }
+    } else {
+      while (token() == XML_NAME) {
+        advance();
+        if (token() == XML_EQ) {
+          advance();
+        }
+        else {
+          error(XmlErrorMessages.message("expected.attribute.eq.sign"));
+        }
+        parseAttributeValue();
+      }
+    }
+
+    if (token() == XML_PI_END) {
+      advance();
+    }
+    else {
+      error(XmlErrorMessages.message("xml.parsing.unterminated.processing.instruction"));
+    }
+
+    pi.done(XML_PROCESSING_INSTRUCTION);
+  }
+
+  @Nullable
+  protected final IElementType token() {
+    return myBuilder.getTokenType();
+  }
+
+  protected final boolean eof() {
+    return myBuilder.eof();
+  }
+
+  protected final void advance() {
+    myBuilder.advanceLexer();
+  }
+
+  private void error(final String message) {
+    myBuilder.error(message);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlAttributeManipulator.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlAttributeManipulator.java
new file mode 100644
index 0000000..0039c32
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlAttributeManipulator.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.psi.impl.source.resolve.reference.impl.manipulators;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.AbstractElementManipulator;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.util.IncorrectOperationException;
+
+/**
+ * @author Gregory.Shrago
+ */
+public class XmlAttributeManipulator extends AbstractElementManipulator<XmlAttribute> {
+
+  private final static Logger LOG = Logger.getInstance(XmlAttributeManipulator.class);
+
+  public XmlAttribute handleContentChange(XmlAttribute attribute, TextRange range, String newContent) throws IncorrectOperationException {
+    String attr = attribute.getText();
+    ASTNode astNode = XmlChildRole.ATTRIBUTE_NAME_FINDER.findChild(attribute.getNode());
+    assert astNode != null;
+    PsiElement namePsi = astNode.getPsi();
+    int startOffsetInParent = namePsi.getStartOffsetInParent();
+    TextRange nameRange = new TextRange(startOffsetInParent, startOffsetInParent + namePsi.getTextLength());
+
+    if (nameRange.contains(range)) {
+      String content = attr.substring(0, range.getStartOffset()) + newContent + attr.substring(range.getEndOffset(), nameRange.getEndOffset());
+
+      attribute.setName(content);
+    } else {
+      final XmlAttributeValue value = attribute.getValueElement();
+
+      if (value == null) {
+        assert range.getStartOffset() == 0 && range.getEndOffset() == 0;
+        attribute.setValue(newContent);
+        return attribute;
+      }
+      final StringBuilder replacement = new StringBuilder(value.getText());
+      int offset = value.getTextRange().getStartOffset() - attribute.getTextRange().getStartOffset();
+
+      replacement.replace(
+        range.getStartOffset() - offset,
+        range.getEndOffset() - offset,
+        newContent
+      );
+      attribute.setValue(replacement.toString());
+    }
+    return attribute;
+  }
+
+  public TextRange getRangeInElement(final XmlAttribute attribute) {
+    final XmlAttributeValue value = attribute.getValueElement();
+    if (value == null) return TextRange.from(0, 0);
+    TextRange range = attribute.getValueTextRange();
+    if (range == null) {
+      LOG.error("Null range in " + attribute + " '" + attribute.getText() + "'");
+    }
+    return range.shiftRight(value.getStartOffsetInParent());
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlAttributeValueManipulator.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlAttributeValueManipulator.java
new file mode 100644
index 0000000..f646e4e
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlAttributeValueManipulator.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.resolve.reference.impl.manipulators;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.AbstractElementManipulator;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.impl.CheckUtil;
+import com.intellij.psi.impl.source.tree.CompositeElement;
+import com.intellij.psi.impl.source.tree.Factory;
+import com.intellij.psi.impl.source.tree.LeafElement;
+import com.intellij.psi.impl.source.tree.SharedImplUtil;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.CharTable;
+import com.intellij.util.IncorrectOperationException;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 06.01.2004
+ * Time: 20:00:23
+ * To change this template use Options | File Templates.
+ */
+public class XmlAttributeValueManipulator extends AbstractElementManipulator<XmlAttributeValue> {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.resolve.reference.impl.manipulators.XmlAttributeValueManipulator");
+
+  public XmlAttributeValue handleContentChange(XmlAttributeValue element, TextRange range, String newContent) throws IncorrectOperationException{
+
+    CheckUtil.checkWritable(element);
+    final CompositeElement attrNode = (CompositeElement)element.getNode();
+    final ASTNode valueNode = attrNode.findLeafElementAt(range.getStartOffset());
+    LOG.assertTrue(valueNode != null, "Leaf not found in " + attrNode + " at offset " + range.getStartOffset());
+    final PsiElement elementToReplace = valueNode.getPsi();
+
+    String text;
+    try {
+      text = elementToReplace.getText();
+      final int offsetInParent = elementToReplace.getStartOffsetInParent();
+      String textBeforeRange = text.substring(0, range.getStartOffset() - offsetInParent);
+      String textAfterRange = text.substring(range.getEndOffset()- offsetInParent, text.length());
+      text = textBeforeRange + newContent + textAfterRange;
+    } catch(StringIndexOutOfBoundsException e) {
+      LOG.error("Range: " + range + " in text: '" + element.getText() + "'", e);
+      throw e;
+    }
+    final CharTable charTableByTree = SharedImplUtil.findCharTableByTree(attrNode);
+    final LeafElement newValueElement = Factory.createSingleLeafElement(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN, text, charTableByTree, element.getManager());
+
+    attrNode.replaceChildInternal(valueNode, newValueElement);
+    return element;
+  }
+
+  public TextRange getRangeInElement(final XmlAttributeValue xmlAttributeValue) {
+    final PsiElement child = xmlAttributeValue.getFirstChild();
+    if (child == null) {
+      return TextRange.EMPTY_RANGE;
+    }
+    final ASTNode node = child.getNode();
+    assert node != null;
+    final int textLength = xmlAttributeValue.getTextLength();
+    if (node.getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER) {
+      return new TextRange(1, textLength <= 1 ? 1 : textLength - 1);
+    } else {
+      return new TextRange(0, textLength);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlTagManipulator.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlTagManipulator.java
new file mode 100644
index 0000000..1803c58
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlTagManipulator.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.resolve.reference.impl.manipulators;
+
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.AbstractElementManipulator;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagValue;
+import com.intellij.psi.xml.XmlText;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class XmlTagManipulator extends AbstractElementManipulator<XmlTag> {
+
+  public XmlTag handleContentChange(XmlTag tag, TextRange range, String newContent) throws IncorrectOperationException {
+    
+    final StringBuilder replacement = new StringBuilder( tag.getValue().getText() );
+    final int valueOffset = tag.getValue().getTextRange().getStartOffset() - tag.getTextOffset();
+
+    replacement.replace(
+      range.getStartOffset() - valueOffset,
+      range.getEndOffset() - valueOffset,
+      newContent
+    );
+    tag.getValue().setText(replacement.toString());
+    return tag;
+  }
+
+  public TextRange getRangeInElement(final XmlTag tag) {
+    if (tag.getSubTags().length > 0) {
+      // Text range in tag with subtags is not supported, return empty range, consider making this function nullable.
+      return TextRange.EMPTY_RANGE;
+    }
+
+    final XmlTagValue value = tag.getValue();
+    final XmlText[] texts = value.getTextElements();
+    switch (texts.length) {
+      case 0:
+        return value.getTextRange().shiftRight(-tag.getTextOffset());
+      case 1:
+        return getValueRange(texts[0]);
+      default:
+        return TextRange.EMPTY_RANGE;
+    }
+  }
+
+  private static TextRange getValueRange(final XmlText xmlText) {
+    final int offset = xmlText.getStartOffsetInParent();
+    final String value = xmlText.getValue();
+    final String trimmed = value.trim();
+    final int i = value.indexOf(trimmed);
+    final int start = xmlText.displayToPhysical(i) + offset;    
+    return trimmed.length() == 0 ? new TextRange(start, start) : new TextRange(start, xmlText.displayToPhysical(i + trimmed.length() - 1) + offset + 1);
+  }
+
+  public static TextRange[] getValueRanges(final @NotNull XmlTag tag) {
+    final XmlTagValue value = tag.getValue();
+    final XmlText[] texts = value.getTextElements();
+    if (texts.length == 0) {
+      return new TextRange[] { value.getTextRange().shiftRight(-tag.getTextOffset()) };
+    } else {
+      final TextRange[] ranges = new TextRange[texts.length];
+      for (int i = 0; i < texts.length; i++) {
+        ranges[i] = getValueRange(texts[i]);
+      }
+      return ranges;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlTextManipulator.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlTextManipulator.java
new file mode 100644
index 0000000..f7baccc
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlTextManipulator.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.psi.impl.source.resolve.reference.impl.manipulators;
+
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.AbstractElementManipulator;
+import com.intellij.psi.xml.XmlText;
+import com.intellij.util.IncorrectOperationException;
+
+/**
+ * @author Gregory.Shrago
+ */
+public class XmlTextManipulator extends AbstractElementManipulator<XmlText> {
+
+  public XmlText handleContentChange(XmlText text, TextRange range, String newContent) throws IncorrectOperationException {
+    final String newValue;
+    final String value = text.getValue();
+    if (range.equals(getRangeInElement(text))) {
+      newValue = newContent;
+    }
+    else {
+      final StringBuilder replacement = new StringBuilder(value);
+      replacement.replace(
+        range.getStartOffset(),
+        range.getEndOffset(),
+        newContent
+      );
+      newValue = replacement.toString();
+    }
+    if (Comparing.equal(value, newValue)) return text;
+    if (newValue.length() > 0) {
+      text.setValue(newValue);
+    }
+    else {
+      text.deleteChildRange(text.getFirstChild(), text.getLastChild());
+    }
+    return text;
+  }
+
+  public TextRange getRangeInElement(final XmlText text) {
+    return getValueRange(text);
+  }
+
+  private static TextRange getValueRange(final XmlText xmlText) {
+    final String value = xmlText.getValue();
+    final int i = value.indexOf(value);
+    final int start = xmlText.displayToPhysical(i);
+    return value.length() == 0 ? new TextRange(start, start) : new TextRange(start, xmlText.displayToPhysical(i + value.length() - 1) + 1);
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlTokenManipulator.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlTokenManipulator.java
new file mode 100644
index 0000000..e21796ab
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/manipulators/XmlTokenManipulator.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.resolve.reference.impl.manipulators;
+
+import com.intellij.lang.ASTFactory;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.AbstractElementManipulator;
+import com.intellij.psi.impl.source.DummyHolderFactory;
+import com.intellij.psi.impl.source.tree.FileElement;
+import com.intellij.psi.impl.source.tree.LeafElement;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.util.IncorrectOperationException;
+
+/**
+ * @author ven
+ */
+public class XmlTokenManipulator extends AbstractElementManipulator<XmlToken> {
+  public XmlToken handleContentChange(XmlToken xmlToken, TextRange range, String newContent) throws IncorrectOperationException {
+    String oldText = xmlToken.getText();
+    String newText = oldText.substring(0, range.getStartOffset()) + newContent + oldText.substring(range.getEndOffset());
+    IElementType tokenType = xmlToken.getTokenType();
+
+    FileElement holder = DummyHolderFactory.createHolder(xmlToken.getManager(), null).getTreeElement();
+    LeafElement leaf = ASTFactory.leaf(tokenType, holder.getCharTable().intern(newText));
+    holder.rawAddChildren(leaf);
+    return (XmlToken)xmlToken.replace(leaf.getPsi());
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/AttributeValueSelfReference.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/AttributeValueSelfReference.java
new file mode 100644
index 0000000..9ecba6f
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/AttributeValueSelfReference.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.resolve.reference.impl.providers;
+
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.util.ArrayUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+*/
+public class AttributeValueSelfReference extends BasicAttributeValueReference {
+  public AttributeValueSelfReference(final PsiElement element) {
+    super(element);
+  }
+
+  public AttributeValueSelfReference(final PsiElement element, int offset) {
+    super(element, offset);
+  }
+
+  public AttributeValueSelfReference(final PsiElement element, TextRange range) {
+    super(element, range);
+  }
+
+  @Nullable
+  public PsiElement resolve() {
+    return myElement;
+  }
+
+  @NotNull
+  public Object[] getVariants() {
+    return ArrayUtil.EMPTY_OBJECT_ARRAY;
+  }
+
+  public boolean isSoft() {
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/BasicAttributeValueReference.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/BasicAttributeValueReference.java
new file mode 100644
index 0000000..b3c0fbc
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/BasicAttributeValueReference.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.resolve.reference.impl.providers;
+
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.ElementManipulators;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+*/
+public abstract class BasicAttributeValueReference implements PsiReference {
+  protected PsiElement myElement;
+  protected TextRange myRange;
+
+  public BasicAttributeValueReference(final PsiElement element) {
+    this ( element, ElementManipulators.getValueTextRange(element));
+  }
+
+  public BasicAttributeValueReference(final PsiElement element, int offset) {
+    this ( element, new TextRange(offset, element.getTextLength() - offset));
+  }
+
+  public BasicAttributeValueReference(final PsiElement element, TextRange range) {
+    myElement = element;
+    myRange = range;
+  }
+
+  public PsiElement getElement() {
+    return myElement;
+  }
+
+  public TextRange getRangeInElement() {
+    return myRange;
+  }
+
+  @NotNull
+  public String getCanonicalText() {
+    final String s = myElement.getText();
+    if (myRange.getStartOffset() < s.length() && myRange.getEndOffset() <= s.length()) {
+      return myRange.substring(s);
+    }
+    return "";
+  }
+
+  public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
+    return ElementManipulators.getManipulator(myElement).handleContentChange(
+      myElement,
+      getRangeInElement(),
+      newElementName
+    );
+  }
+
+  public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+    return null;
+  }
+
+  public boolean isReferenceTo(PsiElement element) {
+    return myElement.getManager().areElementsEquivalent(element, resolve());
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/DtdReferencesProvider.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/DtdReferencesProvider.java
new file mode 100644
index 0000000..4a3fcba
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/DtdReferencesProvider.java
@@ -0,0 +1,346 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.resolve.reference.impl.providers;
+
+import com.intellij.codeInsight.completion.CompletionUtil;
+import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.LocalQuickFixProvider;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.xhtml.XHTMLLanguage;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.*;
+import com.intellij.psi.filters.ElementFilter;
+import com.intellij.psi.impl.source.xml.XmlEntityRefImpl;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.templateLanguages.TemplateLanguageFileViewProvider;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.ProcessingContext;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.impl.dtd.XmlNSDescriptorImpl;
+import com.intellij.xml.util.CheckDtdReferencesInspection;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class DtdReferencesProvider extends PsiReferenceProvider {
+  static class ElementReference implements PsiReference, LocalQuickFixProvider, EmptyResolveMessageProvider {
+    private final XmlElement myElement;
+    private XmlElement myNameElement;
+    private final TextRange myRange;
+    @NonNls private static final String ELEMENT_DECLARATION_NAME = "ELEMENT";
+
+    public ElementReference(final XmlElement element, final XmlElement nameElement) {
+      myElement = element;
+      myNameElement = nameElement;
+
+      final int textOffset = element.getTextRange().getStartOffset();
+      final int nameTextOffset = nameElement.getTextOffset();
+
+      myRange = new TextRange(
+        nameTextOffset - textOffset,
+        nameTextOffset + nameElement.getTextLength() - textOffset
+      );
+
+    }
+
+    public PsiElement getElement() {
+      return myElement;
+    }
+
+    public TextRange getRangeInElement() {
+      return myRange;
+    }
+
+    @Nullable
+    public PsiElement resolve() {
+      XmlElementDescriptor descriptor = resolveElementReference(getCanonicalText(), myElement);
+      return descriptor == null ? null : descriptor.getDeclaration();
+    }
+
+
+    @NotNull
+    public String getCanonicalText() {
+      final XmlElement nameElement = myNameElement;
+      return nameElement != null ? nameElement.getText() : "";
+    }
+
+    public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
+      myNameElement = ElementManipulators.getManipulator(myNameElement).handleContentChange(
+        myNameElement,
+        new TextRange(0,myNameElement.getTextLength()),
+        newElementName
+      );
+
+      return null;
+    }
+
+    public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+      return null;
+    }
+
+    public boolean isReferenceTo(PsiElement element) {
+      return myElement.getManager().areElementsEquivalent(element, resolve());
+    }
+
+    @NotNull
+    public Object[] getVariants() {
+      final XmlNSDescriptor rootTagNSDescriptor = getNsDescriptor(myElement);
+      return rootTagNSDescriptor != null ?
+             rootTagNSDescriptor.getRootElementsDescriptors(((XmlFile)getRealFile()).getDocument()):
+             ArrayUtil.EMPTY_OBJECT_ARRAY;
+    }
+
+    private PsiFile getRealFile() {
+      PsiFile psiFile = myElement.getContainingFile();
+      if (psiFile != null) psiFile = psiFile.getOriginalFile();
+      return psiFile;
+    }
+
+    public boolean isSoft() {
+      return true;
+    }
+
+    public LocalQuickFix[] getQuickFixes() {
+      if (!canHaveAdequateFix(getElement())) return LocalQuickFix.EMPTY_ARRAY;
+
+      return new LocalQuickFix[] {
+        new CheckDtdReferencesInspection.AddDtdDeclarationFix(
+          "xml.dtd.create.dtd.element.intention.name",
+          ELEMENT_DECLARATION_NAME,
+          this
+        )
+      };
+    }
+
+    public String getUnresolvedMessagePattern() {
+      return XmlBundle.message("xml.dtd.unresolved.element.reference", getCanonicalText());
+    }
+  }
+
+
+  @Nullable
+  private static XmlNSDescriptor getNsDescriptor(XmlElement element) {
+    final XmlElement parentThatProvidesMetaData = PsiTreeUtil.getParentOfType(
+      CompletionUtil.getOriginalElement(element),
+      XmlDocument.class,
+      XmlMarkupDecl.class
+    );
+
+    if (parentThatProvidesMetaData instanceof XmlDocument) {
+      final XmlDocument document = (XmlDocument)parentThatProvidesMetaData;
+      XmlNSDescriptor rootTagNSDescriptor = document.getRootTagNSDescriptor();
+      if (rootTagNSDescriptor == null) rootTagNSDescriptor = (XmlNSDescriptor)document.getMetaData();
+      return rootTagNSDescriptor;
+    } else if (parentThatProvidesMetaData instanceof XmlMarkupDecl) {
+      final XmlMarkupDecl markupDecl = (XmlMarkupDecl)parentThatProvidesMetaData;
+      final PsiMetaData psiMetaData = markupDecl.getMetaData();
+
+      if (psiMetaData instanceof XmlNSDescriptor) {
+        return (XmlNSDescriptor)psiMetaData;
+      }
+    }
+
+    return null;
+  }
+
+  @Nullable
+  public static XmlElementDescriptor resolveElementReference(String name, XmlElement context) {
+    XmlNSDescriptor rootTagNSDescriptor = getNsDescriptor(context);
+
+    if (rootTagNSDescriptor instanceof XmlNSDescriptorImpl) {
+      return ((XmlNSDescriptorImpl)rootTagNSDescriptor).getElementDescriptor(name);
+    }
+    return null;
+  }
+
+  static class EntityReference implements PsiReference,LocalQuickFixProvider, EmptyResolveMessageProvider {
+    private final PsiElement myElement;
+    private final TextRange myRange;
+    @NonNls private static final String ENTITY_DECLARATION_NAME = "ENTITY";
+
+    EntityReference(PsiElement element) {
+      myElement = element;
+      if (element instanceof XmlEntityRef) {
+        final PsiElement child = element.getLastChild();
+        final int startOffsetInParent = child.getStartOffsetInParent();
+        myRange = new TextRange(startOffsetInParent + 1, startOffsetInParent + child.getTextLength() - 1);
+      } else {
+        myRange = new TextRange(1,myElement.getTextLength()-1);
+      }
+    }
+
+    public PsiElement getElement() {
+      return myElement;
+    }
+
+    public TextRange getRangeInElement() {
+      return myRange;
+    }
+
+    @Nullable
+    public PsiElement resolve() {
+      XmlEntityDecl xmlEntityDecl = XmlEntityRefImpl.resolveEntity(
+        (XmlElement)myElement,
+        (myElement instanceof  XmlEntityRef ? myElement.getLastChild():myElement).getText(),
+        myElement.getContainingFile()
+      );
+
+      if (xmlEntityDecl != null && !xmlEntityDecl.isPhysical()) {
+        PsiNamedElement element = XmlUtil.findRealNamedElement(xmlEntityDecl);
+        if (element != null) xmlEntityDecl = (XmlEntityDecl)element;
+      }
+      return xmlEntityDecl;
+    }
+
+    @NotNull
+    public String getCanonicalText() {
+      return myRange.substring(myElement.getText());
+    }
+
+    public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
+      final PsiElement elementAt = myElement.findElementAt(myRange.getStartOffset());
+      return ElementManipulators.getManipulator(elementAt).handleContentChange(elementAt, getRangeInElement(), newElementName);
+    }
+
+    public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+      return null;
+    }
+
+    public boolean isReferenceTo(PsiElement element) {
+      return myElement.getManager().areElementsEquivalent(resolve(), element);
+    }
+
+    @NotNull
+    public Object[] getVariants() {
+      return ArrayUtil.EMPTY_OBJECT_ARRAY;
+    }
+
+    public boolean isSoft() {
+      return false;
+    }
+
+    public LocalQuickFix[] getQuickFixes() {
+      if (!canHaveAdequateFix(getElement())) return LocalQuickFix.EMPTY_ARRAY;
+
+      return new LocalQuickFix[] {
+        new CheckDtdReferencesInspection.AddDtdDeclarationFix(
+          "xml.dtd.create.entity.intention.name",
+          myElement.getText().charAt(myRange.getStartOffset() - 1) == '%' ?
+          ENTITY_DECLARATION_NAME + " %":
+          ENTITY_DECLARATION_NAME,
+          this
+        )
+      };
+    }
+
+    public String getUnresolvedMessagePattern() {
+      return XmlBundle.message("xml.dtd.unresolved.entity.reference", getCanonicalText());
+    }
+  }
+
+  private static boolean canHaveAdequateFix(PsiElement element) {
+    final PsiFile containingFile = element.getContainingFile();
+
+    if (containingFile.getLanguage() == HTMLLanguage.INSTANCE ||
+        containingFile.getLanguage() == XHTMLLanguage.INSTANCE ||
+        containingFile.getViewProvider() instanceof TemplateLanguageFileViewProvider
+      ) {
+      return false;
+    }
+    return true;
+  }
+
+  @NotNull
+  public PsiReference[] getReferencesByElement(@NotNull final PsiElement element, @NotNull final ProcessingContext context) {
+    XmlElement nameElement = null;
+
+    if (element instanceof XmlDoctype) {
+      nameElement = ((XmlDoctype)element).getNameElement();
+    } else if (element instanceof XmlElementDecl) {
+      nameElement = ((XmlElementDecl)element).getNameElement();
+    } else if (element instanceof XmlAttlistDecl) {
+      nameElement = ((XmlAttlistDecl)element).getNameElement();
+    }
+    else if (element instanceof XmlElementContentSpec) {
+      final List<PsiReference> psiRefs = new ArrayList<PsiReference>();
+      element.accept(new PsiRecursiveElementVisitor() {
+        @Override
+        public void visitElement(PsiElement child) {
+          if (child instanceof XmlToken && ((XmlToken)child).getTokenType() == XmlTokenType.XML_NAME) {
+            psiRefs.add(new ElementReference((XmlElement)element, (XmlElement)child));
+          }
+          super.visitElement(child);
+        }
+      });
+      return psiRefs.toArray(new PsiReference[psiRefs.size()]);
+    }
+
+    if (nameElement != null) {
+      return new PsiReference[] { new ElementReference((XmlElement)element, nameElement) };
+    }
+
+    if (element instanceof XmlEntityRef ||
+        (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_CHAR_ENTITY_REF)) {
+      return new PsiReference[] { new EntityReference(element) };
+    }
+
+    return PsiReference.EMPTY_ARRAY;
+  }
+
+  public ElementFilter getSystemReferenceFilter() {
+    return new ElementFilter() {
+      public boolean isAcceptable(Object element, PsiElement context) {
+        final PsiElement parent = context.getParent();
+        
+        if((parent instanceof XmlEntityDecl &&
+           !((XmlEntityDecl)parent).isInternalReference()
+           )
+          ) {
+          PsiElement prevSibling = context.getPrevSibling();
+          if (prevSibling instanceof PsiWhiteSpace) {
+            prevSibling = prevSibling.getPrevSibling();
+          }
+
+          if (prevSibling instanceof XmlToken &&
+              ((XmlToken)prevSibling).getTokenType() == XmlTokenType.XML_DOCTYPE_SYSTEM ||
+              prevSibling instanceof XmlAttributeValue
+            ) {
+            return true;
+          }
+        }
+
+        return false;
+      }
+
+      public boolean isClassAcceptable(Class hintClass) {
+        return true;
+      }
+    };
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FileBasedUserDataCache.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FileBasedUserDataCache.java
new file mode 100644
index 0000000..75c5c3f
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FileBasedUserDataCache.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.resolve.reference.impl.providers;
+
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.openapi.util.UserDataCache;
+import com.intellij.openapi.util.Key;
+import com.intellij.psi.util.CachedValuesManager;
+
+/**
+ * @author Maxim.Mossienko
+*         Date: 30.12.2008
+*         Time: 21:03:42
+*/
+public abstract class FileBasedUserDataCache<T> extends UserDataCache<CachedValue<T>, PsiFile, Object> {
+  protected CachedValue<T> compute(final PsiFile xmlFile, final Object o) {
+    return CachedValuesManager.getManager(xmlFile.getProject()).createCachedValue(new CachedValueProvider<T>() {
+      public Result<T> compute() {
+
+        return new Result<T>(doCompute(xmlFile), getDependencies(xmlFile));
+      }
+    }, false);
+  }
+
+  protected Object[] getDependencies(PsiFile xmlFile) {
+    return new Object[] {xmlFile};
+  }
+
+  protected abstract T doCompute(PsiFile file);
+  protected abstract Key<CachedValue<T>> getKey();
+
+  public T compute(PsiFile file) {
+    final FileViewProvider fileViewProvider = file.getViewProvider();
+    final PsiFile baseFile = fileViewProvider.getPsi(fileViewProvider.getBaseLanguage());
+    baseFile.getFirstChild(); // expand chameleon out of lock
+    return get(getKey(), baseFile, null).getValue();
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/IdRefReference.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/IdRefReference.java
new file mode 100644
index 0000000..9feb17a
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/IdRefReference.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.resolve.reference.impl.providers;
+
+import com.intellij.openapi.util.Key;
+import com.intellij.psi.PsiComment;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.XmlRecursiveElementVisitor;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlComment;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.util.XmlDeclareIdInCommentAction;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author peter
+ */
+public class IdRefReference extends BasicAttributeValueReference {
+  private final boolean myIdAttrsOnly;
+
+  public IdRefReference(final PsiElement element, int offset, boolean idAttrsOnly) {
+    super(element, offset);
+    myIdAttrsOnly = idAttrsOnly;
+  }
+
+  public IdRefReference(final PsiElement element) {
+    super(element);
+    myIdAttrsOnly = false;
+  }
+
+  @Nullable
+  protected PsiElement getIdValueElement(PsiElement element) {
+    if (element instanceof XmlTag) {
+      final XmlTag tag = (XmlTag)element;
+      XmlAttribute attribute = tag.getAttribute(IdReferenceProvider.ID_ATTR_NAME, null);
+      if (!myIdAttrsOnly) {
+        if (attribute == null) {
+          attribute = tag.getAttribute(IdReferenceProvider.NAME_ATTR_NAME, null);
+        }
+        if (attribute == null) {
+          attribute = tag.getAttribute(IdReferenceProvider.STYLE_ID_ATTR_NAME, null);
+        }
+      }
+      return attribute != null ? attribute.getValueElement() : null;
+    }
+    else {
+      return element;
+    }
+  }
+
+  @Nullable
+  protected String getIdValue(final PsiElement element) {
+    if (element instanceof XmlTag) {
+      final XmlTag tag = (XmlTag)element;
+      String s = tag.getAttributeValue(IdReferenceProvider.ID_ATTR_NAME);
+      if (!myIdAttrsOnly) {
+        if (s == null) s = tag.getAttributeValue(IdReferenceProvider.NAME_ATTR_NAME);
+        if (s == null) s = tag.getAttributeValue(IdReferenceProvider.STYLE_ID_ATTR_NAME);
+      }
+      return s;
+    } else if (element instanceof PsiComment) {
+      return getImplicitIdValue((PsiComment) element);
+    }
+
+    return null;
+  }
+
+  protected static boolean isAcceptableTagType(final XmlTag subTag) {
+    return subTag.getAttributeValue(IdReferenceProvider.ID_ATTR_NAME) != null ||
+           subTag.getAttributeValue(IdReferenceProvider.FOR_ATTR_NAME) != null ||
+           (subTag.getAttributeValue(IdReferenceProvider.NAME_ATTR_NAME) != null &&
+            subTag.getName().indexOf(".directive") == -1);
+  }
+
+  private static final FileBasedUserDataCache<List<PsiElement>> ourCachedIdsCache = new FileBasedUserDataCache<List<PsiElement>>() {
+    private final Key<CachedValue<List<PsiElement>>> ourCachedIdsValueKey = Key.create("my.ids.cached.value");
+
+    protected List<PsiElement> doCompute(PsiFile file) {
+      final List<PsiElement> result = new ArrayList<PsiElement>();
+
+      file.accept(new XmlRecursiveElementVisitor(true) {
+        @Override
+        public void visitXmlTag(XmlTag tag) {
+          if (isAcceptableTagType(tag)) result.add(tag);
+          super.visitXmlTag(tag);
+        }
+
+        @Override
+        public void visitComment(final PsiComment comment) {
+          if (isDeclarationComment(comment)) result.add(comment);
+
+          super.visitComment(comment);
+        }
+
+        @Override
+        public void visitXmlComment(final XmlComment comment) {
+          if (isDeclarationComment(comment)) result.add(comment);
+
+          super.visitComment(comment);
+        }
+      });
+      return result;
+    }
+
+    protected Key<CachedValue<List<PsiElement>>> getKey() {
+      return ourCachedIdsValueKey;
+    }
+  };
+
+  private static boolean isDeclarationComment(@NotNull final PsiComment comment) {
+    return comment.getText().contains("@declare id=");
+  }
+
+  @Nullable
+  private static String getImplicitIdValue(@NotNull final PsiComment comment) {
+    return XmlDeclareIdInCommentAction.getImplicitlyDeclaredId(comment);
+  }
+
+  private void process(PsiElementProcessor<PsiElement> processor) {
+    final PsiFile psiFile = getElement().getContainingFile();
+    process(processor, psiFile);
+  }
+
+  public static void process(final PsiElementProcessor<PsiElement> processor, PsiFile file) {
+    for (PsiElement e : ourCachedIdsCache.compute(file)) {
+      if (!processor.execute(e)) return;
+    }
+  }
+
+  @Nullable
+  public PsiElement resolve() {
+    final PsiElement[] result = new PsiElement[1];
+    process(new PsiElementProcessor<PsiElement>() {
+      String canonicalText = getCanonicalText();
+
+      public boolean execute(@NotNull final PsiElement element) {
+        final String idValue = getIdValue(element);
+        if (idValue != null && idValue.equals(canonicalText)) {
+          result[0] = getIdValueElement(element);
+          return false;
+        }
+        return true;
+      }
+    });
+
+    return result[0];
+  }
+
+  @NotNull
+  public Object[] getVariants() {
+    final List<String> result = new LinkedList<String>();
+
+    process(new PsiElementProcessor<PsiElement>() {
+      public boolean execute(@NotNull final PsiElement element) {
+        String value = getIdValue(element);
+        if (value != null) {
+          result.add(value);
+        }
+        return true;
+      }
+    });
+
+    return ArrayUtil.toObjectArray(result);
+  }
+
+  public boolean isSoft() {
+    return false;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/IdReferenceProvider.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/IdReferenceProvider.java
new file mode 100644
index 0000000..7446b7c
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/IdReferenceProvider.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.resolve.reference.impl.providers;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiReferenceProvider;
+import com.intellij.psi.filters.ElementFilter;
+import com.intellij.psi.impl.source.resolve.reference.PsiReferenceProviderBase;
+import com.intellij.psi.templateLanguages.OuterLanguageElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ProcessingContext;
+import com.intellij.xml.XmlExtension;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.util.XmlUtil;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class IdReferenceProvider extends PsiReferenceProvider {
+  @NonNls public static final String FOR_ATTR_NAME = "for";
+  @NonNls public static final String ID_ATTR_NAME = "id";
+  @NonNls public static final String STYLE_ID_ATTR_NAME = "styleId";
+  @NonNls public static final String NAME_ATTR_NAME = "name";
+
+  private static final THashSet<String> ourNamespacesWithoutNameReference = new THashSet<String>();
+  static {
+    ourNamespacesWithoutNameReference.add( XmlUtil.JSP_URI );
+    ourNamespacesWithoutNameReference.add( XmlUtil.STRUTS_BEAN_URI );
+    ourNamespacesWithoutNameReference.add( XmlUtil.STRUTS_BEAN_URI2 );
+    ourNamespacesWithoutNameReference.add( XmlUtil.STRUTS_LOGIC_URI );
+    for(String s: XmlUtil.JSTL_CORE_URIS) ourNamespacesWithoutNameReference.add( s );
+    ourNamespacesWithoutNameReference.add( "http://struts.apache.org/tags-tiles" );
+    for(String s: XmlUtil.SCHEMA_URIS) ourNamespacesWithoutNameReference.add( s );
+  }
+
+  public String[] getIdForAttributeNames() {
+    return new String[]{FOR_ATTR_NAME, ID_ATTR_NAME, NAME_ATTR_NAME,STYLE_ID_ATTR_NAME};
+  }
+
+  public ElementFilter getIdForFilter() {
+    return new ElementFilter() {
+      public boolean isAcceptable(Object element, PsiElement context) {
+        final PsiElement grandParent = ((PsiElement)element).getParent().getParent();
+        if (grandParent instanceof XmlTag) {
+          final XmlTag tag = (XmlTag)grandParent;
+
+          if (tag.getNamespacePrefix().length() > 0) {
+            return true;
+          }
+        }
+        return false;
+      }
+
+      public boolean isClassAcceptable(Class hintClass) {
+        return true;
+      }
+    };
+  }
+
+  @NotNull
+  public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull final ProcessingContext context) {
+    if (element instanceof XmlAttributeValue) {
+      final XmlExtension extension = XmlExtension.getExtensionByElement(element);
+      if (extension != null && extension.hasDynamicComponents(element)) {
+        return PsiReference.EMPTY_ARRAY;
+      }
+
+      final PsiElement parentElement = element.getParent();
+      if (!(parentElement instanceof XmlAttribute)) return PsiReference.EMPTY_ARRAY;
+      final String name = ((XmlAttribute)parentElement).getName();
+      final String ns = ((XmlAttribute)parentElement).getParent().getNamespace();
+      final boolean jsfNs = XmlUtil.JSF_CORE_URI.equals(ns) || XmlUtil.JSF_HTML_URI.equals(ns);
+
+      if (FOR_ATTR_NAME.equals(name)) {
+        return new PsiReference[]{
+          jsfNs && element.getText().indexOf(':') == -1 ?
+          new IdRefReference(element):
+          new IdRefReference(element) {
+            public boolean isSoft() {
+              final XmlAttributeDescriptor descriptor = ((XmlAttribute)parentElement).getDescriptor();
+              return descriptor != null ? !descriptor.hasIdRefType() : false;
+            }
+          }
+        };
+      }
+      else {
+        final boolean allowReferences = !(ourNamespacesWithoutNameReference.contains(ns));
+        
+        if ((ID_ATTR_NAME.equals(name) && allowReferences) ||
+             STYLE_ID_ATTR_NAME.equals(name) ||
+             (NAME_ATTR_NAME.equals(name) && allowReferences)
+            ) {
+          final AttributeValueSelfReference attributeValueSelfReference;
+
+          if (jsfNs) {
+            attributeValueSelfReference = new AttributeValueSelfReference(element);
+          } else {
+            if (hasOuterLanguageElement(element)) return PsiReference.EMPTY_ARRAY;
+
+            attributeValueSelfReference =  new GlobalAttributeValueSelfReference(element, true);
+          }
+          return new PsiReference[]{attributeValueSelfReference};
+        }
+      }
+    }
+    return PsiReference.EMPTY_ARRAY;
+  }
+
+  private static boolean hasOuterLanguageElement(@NotNull PsiElement element) {
+    for (PsiElement child = element.getFirstChild(); child != null; child = child.getNextSibling()) {
+      if (child instanceof OuterLanguageElement) {
+        return true;
+      }
+    }
+
+    return false;
+  }
+
+  public static class GlobalAttributeValueSelfReference extends AttributeValueSelfReference {
+    private final boolean mySoft;
+
+    public GlobalAttributeValueSelfReference(PsiElement element, boolean soft) {
+      super(element);
+      mySoft = soft;
+    }
+
+    public boolean isSoft() {
+      return mySoft;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/SchemaReferencesProvider.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/SchemaReferencesProvider.java
new file mode 100644
index 0000000..b4c39f1
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/SchemaReferencesProvider.java
@@ -0,0 +1,715 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.resolve.reference.impl.providers;
+
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
+import com.intellij.codeInsight.daemon.QuickFixProvider;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInsight.template.Template;
+import com.intellij.codeInsight.template.TemplateManager;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.fileEditor.FileEditorManager;
+import com.intellij.openapi.fileEditor.OpenFileDescriptor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.source.resolve.ResolveCache;
+import com.intellij.psi.impl.source.xml.SchemaPrefixReference;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.util.PsiUtilCore;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.ProcessingContext;
+import com.intellij.util.Processor;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.impl.schema.ComplexTypeDescriptor;
+import com.intellij.xml.impl.schema.TypeDescriptor;
+import com.intellij.xml.impl.schema.XmlNSDescriptorImpl;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.PropertyKey;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.regex.Pattern;
+
+/**
+ * @by Maxim.Mossienko
+ * @author Konstantin Bulenkov
+ */
+public class SchemaReferencesProvider extends PsiReferenceProvider {
+  @NonNls private static final String VALUE_ATTR_NAME = "value";
+  @NonNls private static final String PATTERN_TAG_NAME = "pattern";
+  @NonNls private static final String NAME_ATTR_NAME = "name";
+
+  @NonNls private static final String MEMBER_TYPES_ATTR_NAME = "memberTypes";
+  @NonNls private static final String ITEM_TYPE_ATTR_NAME = "itemType";
+  @NonNls private static final String BASE_ATTR_NAME = "base";
+  @NonNls private static final String GROUP_TAG_NAME = "group";
+
+  @NonNls private static final String ATTRIBUTE_GROUP_TAG_NAME = "attributeGroup";
+  @NonNls private static final String ATTRIBUTE_TAG_NAME = "attribute";
+  @NonNls private static final String ELEMENT_TAG_NAME = "element";
+  @NonNls private static final String SIMPLE_TYPE_TAG_NAME = "simpleType";
+
+  @NonNls private static final String COMPLEX_TYPE_TAG_NAME = "complexType";
+  @NonNls private static final String REF_ATTR_NAME = "ref";
+  @NonNls private static final String TARGET_NAMESPACE = "targetNamespace";
+  @NonNls private static final String TYPE_ATTR_NAME = "type";
+  @NonNls private static final String SUBSTITUTION_GROUP_ATTR_NAME = "substitutionGroup";
+
+  public String[] getCandidateAttributeNamesForSchemaReferences() {
+    return new String[] {REF_ATTR_NAME,TYPE_ATTR_NAME, BASE_ATTR_NAME,NAME_ATTR_NAME, SUBSTITUTION_GROUP_ATTR_NAME,MEMBER_TYPES_ATTR_NAME,
+      VALUE_ATTR_NAME, ITEM_TYPE_ATTR_NAME};
+  }
+
+  static class RegExpReference extends BasicAttributeValueReference implements EmptyResolveMessageProvider {
+    private String message;
+
+    public RegExpReference(final PsiElement element) {
+      super(element);
+    }
+
+    private static final Pattern pattern = Pattern.compile("^(?:\\\\i|\\\\l)");
+    private static final Pattern pattern2 = Pattern.compile("([^\\\\])(?:\\\\i|\\\\l)");
+
+    @Nullable
+    public PsiElement resolve() {
+      try {
+        String text = getCanonicalText();
+
+        // \i and \l are special classes that does not present in java reg exps, so replace their occurences with more usable \w
+        text = pattern2.matcher(pattern.matcher(text).replaceFirst("\\\\w")).replaceAll("$1\\\\w");
+
+        Pattern.compile(text);
+        message = null;
+        return myElement;
+      }
+      catch (Exception e) {
+        message = PsiBundle.message("invalid.regular.expression.message", getCanonicalText());
+        return null;
+      }
+    }
+
+    @NotNull
+    public Object[] getVariants() {
+      return ArrayUtil.EMPTY_OBJECT_ARRAY;
+    }
+
+    public boolean isSoft() {
+      return false;
+    }
+
+    public String getUnresolvedMessagePattern() {
+      return message;
+    }
+  }
+
+  public static class NameReference implements PsiReference {
+    private final PsiElement myElement;
+
+    public NameReference(PsiElement element) {
+      myElement = element;
+    }
+
+    public PsiElement getElement() {
+      return myElement;
+    }
+
+    public TextRange getRangeInElement() {
+      return new TextRange(1,myElement.getTextLength()-1);
+    }
+
+    @Nullable
+    public PsiElement resolve() {
+      return myElement.getParent().getParent();
+    }
+
+    @NotNull
+    public String getCanonicalText() {
+      String text = myElement.getText();
+      return text.substring(1,text.length()- 1);
+    }
+
+    public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
+      return ElementManipulators.getManipulator(myElement).handleContentChange(
+        myElement,
+        getRangeInElement(),
+        newElementName.substring(newElementName.indexOf(':') + 1)
+      );
+    }
+
+    public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+      return null;
+    }
+
+    public boolean isReferenceTo(PsiElement element) {
+      return myElement.getManager().areElementsEquivalent(resolve(), element);
+    }
+
+    @NotNull
+    public Object[] getVariants() {
+      return ArrayUtil.EMPTY_OBJECT_ARRAY;
+    }
+
+    public boolean isSoft() {
+      return true;
+    }
+  }
+
+  public static class TypeOrElementOrAttributeReference implements PsiReference, QuickFixProvider<TypeOrElementOrAttributeReference> {
+    private final PsiElement myElement;
+    private TextRange myRange;
+    private String nsPrefix;
+
+    public void registerQuickfix(HighlightInfo info, TypeOrElementOrAttributeReference reference) {
+      if (myType == ReferenceType.TypeReference) {
+        QuickFixAction.registerQuickFixAction(
+          info, new CreateXmlElementIntentionAction("xml.schema.create.complex.type.intention.name",COMPLEX_TYPE_TAG_NAME,reference)
+        );
+        QuickFixAction.registerQuickFixAction(
+          info, new CreateXmlElementIntentionAction("xml.schema.create.simple.type.intention.name",SIMPLE_TYPE_TAG_NAME,reference)
+        );
+      } else if (myType != null) {
+        @PropertyKey(resourceBundle = XmlBundle.PATH_TO_BUNDLE) String key = null;
+        @NonNls String declarationTagName = null;
+
+        if (myType == ReferenceType.ElementReference) {
+          declarationTagName = ELEMENT_TAG_NAME;
+          key = "xml.schema.create.element.intention.name";
+        } else if (myType == ReferenceType.AttributeReference) {
+          declarationTagName = ATTRIBUTE_TAG_NAME;
+          key = "xml.schema.create.attribute.intention.name";
+        } else if (myType == ReferenceType.AttributeGroupReference) {
+          declarationTagName = ATTRIBUTE_GROUP_TAG_NAME;
+          key = "xml.schema.create.attribute.group.intention.name";
+        } else if (myType == ReferenceType.GroupReference) {
+          declarationTagName = GROUP_TAG_NAME;
+          key = "xml.schema.create.group.intention.name";
+        }
+
+        assert key != null && declarationTagName != null;
+        QuickFixAction.registerQuickFixAction(
+          info, new CreateXmlElementIntentionAction(key, declarationTagName, reference)
+        );
+      }
+    }
+
+    public void setNamespacePrefix(String prefix) {
+      this.nsPrefix = prefix;
+    }
+
+    protected enum ReferenceType {
+      ElementReference, AttributeReference, GroupReference, AttributeGroupReference, TypeReference
+    }
+
+    private final @Nullable ReferenceType myType;
+
+    protected TypeOrElementOrAttributeReference(PsiElement element, TextRange range,  @Nullable ReferenceType type) {
+      myElement = element;
+      myRange   = range;
+
+      assert myRange.getLength() >= 0;
+
+      myType = type;
+    }
+
+    TypeOrElementOrAttributeReference(PsiElement element, TextRange range) {
+      this(element, range, determineReferenceType(element));
+    }
+
+    @Nullable
+    private static ReferenceType determineReferenceType(PsiElement element) {
+      final XmlAttribute attribute = PsiTreeUtil.getParentOfType(element, XmlAttribute.class);
+      if (attribute == null) {
+        return null;
+      }
+      final XmlTag tag = attribute.getParent();
+      final String localName = tag.getLocalName();
+      final String attributeLocalName = attribute.getLocalName();
+
+      if (REF_ATTR_NAME.equals(attributeLocalName) || SUBSTITUTION_GROUP_ATTR_NAME.equals(attributeLocalName)) {
+        if (localName.equals(GROUP_TAG_NAME)) {
+          return ReferenceType.GroupReference;
+        } else if (localName.equals(ATTRIBUTE_GROUP_TAG_NAME)) {
+          return ReferenceType.AttributeGroupReference;
+        } else if (ELEMENT_TAG_NAME.equals(localName)) {
+          return ReferenceType.ElementReference;
+        } else if (ATTRIBUTE_TAG_NAME.equals(localName)) {
+          return ReferenceType.AttributeReference;
+        }
+      } else if (TYPE_ATTR_NAME.equals(attributeLocalName) ||
+                 BASE_ATTR_NAME.equals(attributeLocalName) ||
+                 MEMBER_TYPES_ATTR_NAME.equals(attributeLocalName) ||
+                 ITEM_TYPE_ATTR_NAME.equals(attributeLocalName)
+                ) {
+        return ReferenceType.TypeReference;
+      }
+      return null;
+    }
+
+    public PsiElement getElement() {
+      return myElement;
+    }
+
+    public TextRange getRangeInElement() {
+      return myRange;
+    }
+
+    @Nullable
+    public PsiElement resolve() {
+      final PsiElement psiElement = ResolveCache.getInstance(getElement().getProject()).resolveWithCaching(this, MyResolver.INSTANCE, false, false);
+
+      return psiElement != PsiUtilCore.NULL_PSI_ELEMENT ? psiElement:null;
+    }
+
+    private PsiElement resolveInner() {
+      final XmlTag tag = PsiTreeUtil.getContextOfType(myElement, XmlTag.class, false);
+      if (tag == null) return PsiUtilCore.NULL_PSI_ELEMENT;
+
+      String canonicalText = getCanonicalText();
+      XmlNSDescriptorImpl nsDescriptor = getDescriptor(tag,canonicalText);
+
+      if (myType != null && nsDescriptor != null && nsDescriptor.getTag() != null) {
+
+        switch(myType) {
+          case GroupReference: return nsDescriptor.findGroup(canonicalText);
+          case AttributeGroupReference: return nsDescriptor.findAttributeGroup(canonicalText);
+          case ElementReference: {
+            XmlElementDescriptor descriptor = nsDescriptor.getElementDescriptor(
+              XmlUtil.findLocalNameByQualifiedName(canonicalText), getNamespace(tag, canonicalText),
+              new HashSet<XmlNSDescriptorImpl>(),
+              true
+            );
+
+            return descriptor != null ? descriptor.getDeclaration(): PsiUtilCore.NULL_PSI_ELEMENT;
+          }
+          case AttributeReference: {
+            //final String prefixByQualifiedName = XmlUtil.findPrefixByQualifiedName(canonicalText);
+            final String localNameByQualifiedName = XmlUtil.findLocalNameByQualifiedName(canonicalText);
+            XmlAttributeDescriptor descriptor = nsDescriptor.getAttribute(
+              localNameByQualifiedName,
+              getNamespace(tag, canonicalText),
+              tag
+            );
+
+            if (descriptor != null) return descriptor.getDeclaration();
+
+            return PsiUtilCore.NULL_PSI_ELEMENT;
+          }
+          case TypeReference: {
+            TypeDescriptor typeDescriptor = nsDescriptor.getTypeDescriptor(canonicalText,tag);
+            if (typeDescriptor instanceof ComplexTypeDescriptor) {
+              return ((ComplexTypeDescriptor)typeDescriptor).getDeclaration();
+            } else if (typeDescriptor instanceof TypeDescriptor) {
+              return myElement;
+            }
+          }
+        }
+      }
+
+      return PsiUtilCore.NULL_PSI_ELEMENT;
+    }
+
+    private XmlNSDescriptorImpl getDescriptor(final XmlTag tag, String text) {
+      if (myType != ReferenceType.ElementReference &&
+          myType != ReferenceType.AttributeReference) {
+        final PsiElement parentElement = myElement.getContext();
+        final PsiElement grandParentElement = parentElement != null ? parentElement.getParent() : null;
+        boolean doRedefineCheck = false;
+
+        if (parentElement instanceof XmlAttribute &&
+            grandParentElement instanceof XmlTag
+           ) {
+          final String attrName = ((XmlAttribute)parentElement).getName();
+          final String tagLocalName = ((XmlTag)grandParentElement).getLocalName();
+
+          doRedefineCheck = (REF_ATTR_NAME.equals(attrName) &&
+            ( GROUP_TAG_NAME.equals(tagLocalName) ||
+              ATTRIBUTE_GROUP_TAG_NAME.equals(tagLocalName)
+            )
+           ) ||
+           ( BASE_ATTR_NAME.equals(attrName) ||
+             MEMBER_TYPES_ATTR_NAME.equals(attrName)
+           );
+        }
+
+        if (doRedefineCheck) {
+          XmlNSDescriptorImpl redefinedDescriptor = findRedefinedDescriptor(tag, text);
+          if (redefinedDescriptor != null) return redefinedDescriptor;
+        }
+      }
+
+      final String namespace = getNamespace(tag, text);
+      XmlNSDescriptor nsDescriptor = tag.getNSDescriptor(namespace,true);
+
+      final XmlDocument document = ((XmlFile)tag.getContainingFile()).getDocument();
+
+      if (nsDescriptor == null) { // import
+        nsDescriptor = (XmlNSDescriptor)document.getMetaData();
+      }
+
+      if (nsDescriptor == null) {
+        final XmlNSDescriptor[] descrs = new XmlNSDescriptor[1];
+
+        URLReference.processWsdlSchemas(
+          document.getRootTag(),
+          new Processor<XmlTag>() {
+            public boolean process(final XmlTag xmlTag) {
+              if (namespace.equals(xmlTag.getAttributeValue(TARGET_NAMESPACE))) {
+                descrs[0] = (XmlNSDescriptor)xmlTag.getMetaData();
+                return false;
+              }
+              return true;
+            }
+          }
+        );
+
+        if (descrs[0] instanceof XmlNSDescriptorImpl) return (XmlNSDescriptorImpl)descrs[0];
+      }
+
+      return nsDescriptor instanceof XmlNSDescriptorImpl ? (XmlNSDescriptorImpl)nsDescriptor:null;
+    }
+
+    private static String getNamespace(final XmlTag tag, final String text) {
+      final String namespacePrefix = XmlUtil.findPrefixByQualifiedName(text);
+      final String namespaceByPrefix = tag.getNamespaceByPrefix(namespacePrefix);
+      if (namespaceByPrefix.length() > 0) return namespaceByPrefix;
+      final XmlTag rootTag = ((XmlFile)tag.getContainingFile()).getDocument().getRootTag();
+
+      if (rootTag != null &&
+          "schema".equals(rootTag.getLocalName()) &&
+          XmlUtil.ourSchemaUrisList.indexOf(rootTag.getNamespace()) != -1 ) {
+        final String targetNS = rootTag.getAttributeValue(TARGET_NAMESPACE);
+        
+        if (targetNS != null) {
+          final String targetNsPrefix = rootTag.getPrefixByNamespace(targetNS);
+
+          if (namespacePrefix.equals(targetNsPrefix) ||
+              (namespaceByPrefix.length() == 0 && targetNsPrefix == null)) {
+            return targetNS;
+          }
+        }
+      }
+      return namespaceByPrefix;
+    }
+
+    @NotNull
+    public String getCanonicalText() {
+      final String text = myElement.getText();
+      String name = myRange.getEndOffset() <= text.length() ? myRange.substring(text) : "";
+      if (name.length() > 0 && nsPrefix != null && nsPrefix.length() > 0) {
+        name = nsPrefix + ":" + name;
+      }
+      return name;
+    }
+
+    public PsiElement handleElementRename(String _newElementName) throws IncorrectOperationException {
+      final String canonicalText = getCanonicalText();
+      //final String newElementName = canonicalText.substring(0,canonicalText.indexOf(':') + 1) + _newElementName;
+      final String newElementName = _newElementName;
+
+      final PsiElement element = ElementManipulators.getManipulator(myElement)
+        .handleContentChange(myElement, getRangeInElement(), newElementName);
+      myRange = new TextRange(myRange.getStartOffset(),myRange.getEndOffset() - (canonicalText.length() - newElementName.length()));
+      return element;
+    }
+
+    public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+      throw new IncorrectOperationException();
+    }
+
+    public boolean isReferenceTo(PsiElement element) {
+      return myElement.getManager().areElementsEquivalent(resolve(), element);
+    }
+
+    class CompletionProcessor implements PsiElementProcessor<XmlTag> {
+      List<String> myElements = new ArrayList<String>(1);
+      String namespace;
+      XmlTag tag;
+
+      public boolean execute(@NotNull final XmlTag element) {
+        String name = element.getAttributeValue(NAME_ATTR_NAME);
+        final String prefixByNamespace = tag.getPrefixByNamespace(namespace);
+        if (prefixByNamespace != null && prefixByNamespace.length() > 0 && nsPrefix == null) {
+          name = prefixByNamespace + ":" + name;
+        }
+        myElements.add( name );
+        return true;
+      }
+    }
+
+    @NotNull
+    public Object[] getVariants() {
+      final XmlTag tag = PsiTreeUtil.getContextOfType(myElement, XmlTag.class, true);
+      if (tag == null || myType == null) return ArrayUtil.EMPTY_OBJECT_ARRAY;
+
+      String[] tagNames = null;
+
+      switch (myType) {
+        case GroupReference:
+          tagNames = new String[] {GROUP_TAG_NAME};
+          break;
+        case AttributeGroupReference:
+          tagNames = new String[] {ATTRIBUTE_GROUP_TAG_NAME};
+          break;
+        case AttributeReference:
+          tagNames = new String[] {ATTRIBUTE_TAG_NAME};
+          break;
+        case ElementReference:
+          tagNames = new String[] {ELEMENT_TAG_NAME};
+          break;
+        case TypeReference:
+          tagNames = new String[] {SIMPLE_TYPE_TAG_NAME,COMPLEX_TYPE_TAG_NAME};
+          break;
+      }
+
+      CompletionProcessor processor = new CompletionProcessor();
+      processor.tag = tag;
+
+      final XmlElement context = PsiTreeUtil.getContextOfType(myElement, XmlElement.class, false);
+      if (context == null) {
+        return ArrayUtil.EMPTY_OBJECT_ARRAY;
+      }
+      final XmlDocument document = ((XmlFile)context.getContainingFile()).getDocument();
+      if (document == null) {
+        return ArrayUtil.EMPTY_OBJECT_ARRAY;
+      }
+      final XmlTag rootTag = document.getRootTag();
+      String ourNamespace = rootTag != null ? rootTag.getAttributeValue(TARGET_NAMESPACE) : "";
+      if (ourNamespace == null) ourNamespace = "";
+
+      for(String namespace:tag.knownNamespaces()) {
+        if (ourNamespace.equals(namespace)) continue;
+        final XmlNSDescriptor nsDescriptor = tag.getNSDescriptor(namespace, true);
+
+        if (nsDescriptor instanceof XmlNSDescriptorImpl) {
+          processNamespace(namespace, processor, nsDescriptor, tagNames);
+        }
+      }
+
+
+      XmlNSDescriptor nsDescriptor = (XmlNSDescriptor)document.getMetaData();
+      if (nsDescriptor != null) {
+        processNamespace(
+          ourNamespace,
+          processor,
+          nsDescriptor,
+          tagNames
+        );
+      }
+
+      return ArrayUtil.toStringArray(processor.myElements);
+    }
+
+    private static void processNamespace(final String namespace,
+                                  final CompletionProcessor processor,
+                                  final XmlNSDescriptor nsDescriptor,
+                                  final String[] tagNames) {
+      processor.namespace = namespace;
+
+      final XmlNSDescriptorImpl xmlNSDescriptor = ((XmlNSDescriptorImpl)nsDescriptor);
+      XmlNSDescriptorImpl.processTagsInNamespace(
+        xmlNSDescriptor.getTag(),
+        tagNames,
+        processor
+      );
+    }
+
+    public boolean isSoft() {
+      return false;
+    }
+
+    private static class MyResolver implements ResolveCache.Resolver {
+      static MyResolver INSTANCE = new MyResolver(); 
+      public PsiElement resolve(@NotNull PsiReference ref, boolean incompleteCode) {
+        return ((TypeOrElementOrAttributeReference)ref).resolveInner();
+      }
+    }
+  }
+
+  private static class CreateXmlElementIntentionAction implements IntentionAction {
+    private final String myMessageKey;
+    protected final TypeOrElementOrAttributeReference myRef;
+    private boolean myIsAvailableEvaluated;
+    private XmlFile myTargetFile;
+    private final String myDeclarationTagName;
+
+    CreateXmlElementIntentionAction(
+      @PropertyKey(resourceBundle = XmlBundle.PATH_TO_BUNDLE) String messageKey,
+      @NonNls @NotNull String declarationTagName,
+      TypeOrElementOrAttributeReference ref) {
+
+      myMessageKey = messageKey;
+      myRef = ref;
+      myDeclarationTagName = declarationTagName;
+    }
+
+    @NotNull
+    public String getText() {
+      return XmlBundle.message(myMessageKey,XmlUtil.findLocalNameByQualifiedName(myRef.getCanonicalText()));
+    }
+
+    @NotNull
+    public String getFamilyName() {
+      return XmlBundle.message("xml.create.xml.declaration.intention.type");
+    }
+
+    public boolean isAvailable(@NotNull final Project project, final Editor editor, final PsiFile file) {
+      if (!myIsAvailableEvaluated) {
+        final XmlTag tag = PsiTreeUtil.getParentOfType(myRef.getElement(), XmlTag.class);
+        if (tag != null) {
+          final XmlNSDescriptorImpl descriptor = myRef.getDescriptor(tag, myRef.getCanonicalText());
+
+          if (descriptor != null &&
+              descriptor.getDescriptorFile() != null &&
+              descriptor.getDescriptorFile().isWritable()
+             ) {
+            myTargetFile = descriptor.getDescriptorFile();
+          }
+        }
+        myIsAvailableEvaluated = true;
+      }
+      return myTargetFile != null;
+    }
+
+    public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
+      if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
+
+      final XmlTag rootTag = myTargetFile.getDocument().getRootTag();
+
+      OpenFileDescriptor descriptor = new OpenFileDescriptor(
+        project,
+        myTargetFile.getVirtualFile(),
+        rootTag.getValue().getTextRange().getEndOffset()
+      );
+      Editor targetEditor = FileEditorManager.getInstance(project).openTextEditor(descriptor, true);
+      TemplateManager manager = TemplateManager.getInstance(project);
+      final Template template = manager.createTemplate("", "");
+
+      addTextTo(template, rootTag);
+
+      manager.startTemplate(targetEditor, template);
+    }
+
+    protected void addTextTo(Template template, XmlTag rootTag) {
+      String schemaPrefix = rootTag.getPrefixByNamespace(XmlUtil.XML_SCHEMA_URI);
+      if (schemaPrefix.length() > 0) schemaPrefix += ":";
+
+      template.addTextSegment(
+        "<" + schemaPrefix + myDeclarationTagName + " name=\"" + XmlUtil.findLocalNameByQualifiedName(myRef.getCanonicalText()) + "\">"
+      );
+      template.addEndVariable();
+      template.addTextSegment(
+        "</" + schemaPrefix + myDeclarationTagName + ">\n"
+      );
+      template.setToReformat(true);
+    }
+
+    public boolean startInWriteAction() {
+      return true;
+    }
+  }
+
+  @NotNull
+  public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull final ProcessingContext context) {
+    final PsiElement parent = element.getParent();
+    if (!(parent instanceof XmlAttribute)) return PsiReference.EMPTY_ARRAY;
+    final String attrName = ((XmlAttribute)parent).getName();
+
+    if (VALUE_ATTR_NAME.equals(attrName)) {
+      if (PATTERN_TAG_NAME.equals(((XmlAttribute)parent).getParent().getLocalName())) {
+        return new PsiReference[] { new RegExpReference(element) };
+      } else {
+        return PsiReference.EMPTY_ARRAY;
+      }
+    } else if (NAME_ATTR_NAME.equals(attrName)) {
+      return new PsiReference[] { new NameReference(element) };
+    } else if (MEMBER_TYPES_ATTR_NAME.equals(attrName)) {
+      final List<PsiReference> result = new ArrayList<PsiReference>(1);
+      final String text = element.getText();
+      int lastIndex = 1;
+      final int testLength = text.length();
+
+      for(int i = 1; i < testLength; ++i) {
+        if (Character.isWhitespace(text.charAt(i))) {
+          if (lastIndex != i) result.add( new TypeOrElementOrAttributeReference(element, new TextRange(lastIndex, i) ) );
+          lastIndex = i + 1;
+        }
+      }
+
+      if (lastIndex != testLength - 1) result.add( new TypeOrElementOrAttributeReference(element, new TextRange(lastIndex, testLength - 1) ) );
+      return result.toArray(new PsiReference[result.size()]);
+    } else {
+      final PsiReference prefix = createSchemaPrefixReference(element);
+      final PsiReference ref = createTypeOrElementOrAttributeReference(element, prefix == null ? null : prefix.getCanonicalText());
+      return prefix == null ? new PsiReference[] {ref} : new PsiReference[] {ref, prefix};
+    }
+  }
+
+  public static PsiReference createTypeOrElementOrAttributeReference(final PsiElement element) {
+    return createTypeOrElementOrAttributeReference(element, null);
+  }
+
+  public static PsiReference createTypeOrElementOrAttributeReference(final PsiElement element, String ns) {
+    final int length = element.getTextLength();
+    int offset = (element instanceof XmlAttributeValue) ?
+      XmlUtil.findPrefixByQualifiedName(((XmlAttributeValue)element).getValue()).length() : 0;
+    if (offset > 0) offset++;
+    final TypeOrElementOrAttributeReference ref = new TypeOrElementOrAttributeReference(element, length >= 2 ? new TextRange(1 + offset, length - 1) : TextRange.EMPTY_RANGE);
+    ref.setNamespacePrefix(ns);
+    return ref;
+  }
+
+  @Nullable
+  private static PsiReference createSchemaPrefixReference(final PsiElement element) {
+    if (element instanceof XmlAttributeValue) {
+      final XmlAttributeValue attributeValue = (XmlAttributeValue)element;
+      final String prefix = XmlUtil.findPrefixByQualifiedName(attributeValue.getValue());
+      if (prefix.length() > 0) {
+        return new SchemaPrefixReference(attributeValue, TextRange.from(1, prefix.length()), prefix, null);
+      }
+    }
+    return null;
+  }
+
+  public static @Nullable XmlNSDescriptorImpl findRedefinedDescriptor(XmlTag tag, String text) {
+    final String localName = XmlUtil.findLocalNameByQualifiedName(text);
+    for(XmlTag parentTag = tag.getParentTag(); parentTag != null; parentTag = parentTag.getParentTag()) {
+
+      if (localName.equals(parentTag.getAttributeValue("name"))) {
+        final XmlTag grandParent = parentTag.getParentTag();
+
+        if (grandParent != null && "redefine".equals(grandParent.getLocalName())) {
+          return XmlNSDescriptorImpl.getRedefinedElementDescriptor(grandParent);
+        }
+      }
+    }
+
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/URIReferenceProvider.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/URIReferenceProvider.java
new file mode 100644
index 0000000..5c8eb58
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/URIReferenceProvider.java
@@ -0,0 +1,174 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.resolve.reference.impl.providers;
+
+import com.intellij.codeInsight.daemon.QuickFixProvider;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.quickfix.FetchExtResourceAction;
+import com.intellij.codeInsight.daemon.impl.quickfix.IgnoreExtResourceAction;
+import com.intellij.codeInsight.daemon.impl.quickfix.ManuallySetupExtResourceAction;
+import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiReferenceProvider;
+import com.intellij.psi.filters.ElementFilter;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.ProcessingContext;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+/**
+ * @by Maxim.Mossienko
+ */
+public class URIReferenceProvider extends PsiReferenceProvider {
+
+  public static final ElementFilter ELEMENT_FILTER = new ElementFilter() {
+    public boolean isAcceptable(Object element, PsiElement context) {
+      final PsiElement parent = context.getParent();
+      if (parent instanceof XmlAttribute) {
+        final XmlAttribute attribute = ((XmlAttribute)parent);
+        return attribute.isNamespaceDeclaration();
+      }
+      return false;
+    }
+
+    public boolean isClassAcceptable(Class hintClass) {
+      return true;
+    }
+  };
+  @NonNls private static final String HTTP = "http://";
+  @NonNls private static final String URN = "urn:";
+  @NonNls private static final String FILE = "file:";
+  @NonNls private static final String CLASSPATH = "classpath:/";
+  @NonNls
+  private static final String NAMESPACE_ATTR_NAME = "namespace";
+
+  public static class DependentNSReference extends BasicAttributeValueReference implements QuickFixProvider {
+    private final URLReference myReference;
+
+    public DependentNSReference(final PsiElement element, TextRange range, URLReference ref) {
+      super(element, range);
+      myReference = ref;
+    }
+
+    @Nullable
+    public PsiFile resolveResource() {
+      final String canonicalText = getCanonicalText();
+      return ExternalResourceManager.getInstance().getResourceLocation(canonicalText, myElement.getContainingFile(), null);
+    }
+
+    @Nullable
+    public PsiElement resolve() {
+      final PsiFile file = resolveResource();
+      if (file != null) return file;
+      return myReference.resolve();
+    }
+
+    @NotNull
+    public Object[] getVariants() {
+      return ArrayUtil.EMPTY_OBJECT_ARRAY;
+    }
+
+    public boolean isSoft() {
+      return false;
+    }
+
+    public void registerQuickfix(HighlightInfo info, PsiReference reference) {
+      QuickFixAction.registerQuickFixAction(info, new FetchExtResourceAction());
+      QuickFixAction.registerQuickFixAction(info, new ManuallySetupExtResourceAction());
+      QuickFixAction.registerQuickFixAction(info, new IgnoreExtResourceAction());
+    }
+  }
+
+  @NotNull
+  public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull final ProcessingContext context) {
+    final String text = element.getText();
+    String s = StringUtil.stripQuotesAroundValue(text);
+    final PsiElement parent = element.getParent();
+
+    if (parent instanceof XmlAttribute && "xsi:schemaLocation".equals(((XmlAttribute)parent).getName())) {
+      final List<PsiReference> refs = new ArrayList<PsiReference>(2);
+      final StringTokenizer tokenizer = new StringTokenizer(s);
+
+      while(tokenizer.hasMoreElements()) {
+        final String namespace = tokenizer.nextToken();
+        int offset = text.indexOf(namespace);
+        final URLReference urlReference = new URLReference(element, new TextRange(offset, offset + namespace.length()), true);
+        refs.add(urlReference);
+        if (!tokenizer.hasMoreElements()) break;
+        String url = tokenizer.nextToken();
+
+        offset = text.indexOf(url);
+        if (isUrlText(url, element.getProject())) refs.add(new DependentNSReference(element, new TextRange(offset,offset + url.length()), urlReference));
+        else {
+          ContainerUtil.addAll(refs, new FileReferenceSet(url, element, offset, this, false).getAllReferences());
+        }
+      }
+
+      return refs.toArray(new PsiReference[refs.size()]);
+    }
+
+
+    if (isUrlText(s, element.getProject()) ||
+        (parent instanceof XmlAttribute &&
+          ( ((XmlAttribute)parent).isNamespaceDeclaration() ||
+            NAMESPACE_ATTR_NAME.equals(((XmlAttribute)parent).getName())
+          )
+         )
+      ) {
+      if (!s.startsWith(XmlUtil.TAG_DIR_NS_PREFIX)) {
+        boolean namespaceSoftRef = parent instanceof XmlAttribute &&
+          NAMESPACE_ATTR_NAME.equals(((XmlAttribute)parent).getName()) &&
+          ((XmlAttribute)parent).getParent().getAttributeValue("schemaLocation") != null;
+        if (!namespaceSoftRef && parent instanceof XmlAttribute && ((XmlAttribute)parent).isNamespaceDeclaration()) {
+          namespaceSoftRef = parent.getContainingFile().getContext() != null;
+        }
+        return new URLReference[] { new URLReference(element, null, namespaceSoftRef)};
+      }
+    }
+
+    s = s.substring(getPrefixLength(s));
+    return new FileReferenceSet(s,element,text.indexOf(s), this,true).getAllReferences();
+  }
+
+  public static int getPrefixLength(@NotNull final String s) {
+    if (s.startsWith(XmlUtil.TAG_DIR_NS_PREFIX)) return XmlUtil.TAG_DIR_NS_PREFIX.length();
+    if (s.startsWith(FILE)) return FILE.length();
+    if (s.startsWith(CLASSPATH)) return CLASSPATH.length();
+    return 0;
+  }
+
+  static boolean isUrlText(final String s, Project project) {
+    final boolean surelyUrl = s.startsWith(HTTP) || s.startsWith(URN);
+    if (surelyUrl) return surelyUrl;
+    int protocolIndex = s.indexOf(":/");
+    if (protocolIndex > 1 && !s.regionMatches(0,"classpath",0,protocolIndex)) return true;
+    return ExternalResourceManager.getInstance().getResourceLocation(s, project) != s;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/URLReference.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/URLReference.java
new file mode 100644
index 0000000..f582111
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/URLReference.java
@@ -0,0 +1,248 @@
+package com.intellij.psi.impl.source.resolve.reference.impl.providers;
+
+import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
+import com.intellij.codeInsight.daemon.QuickFixProvider;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.quickfix.*;
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.javaee.ExternalResourceManagerEx;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.Processor;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.XmlSchemaProvider;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author Dmitry Avdeev
+*/
+public class URLReference implements PsiReference, QuickFixProvider, EmptyResolveMessageProvider {
+  @NonNls private static final String TARGET_NAMESPACE_ATTR_NAME = "targetNamespace";
+
+  private final PsiElement myElement;
+  private final TextRange myRange;
+  private final boolean mySoft;
+  private boolean myIncorrectResourceMapped;
+
+  public URLReference(PsiElement element) {
+    this(element, null, false);
+  }
+
+  public URLReference(PsiElement element, @Nullable TextRange range, boolean soft) {
+    myElement = element;
+    myRange = range;
+    mySoft = soft;
+  }
+
+  public PsiElement getElement() {
+    return myElement;
+  }
+
+  public TextRange getRangeInElement() {
+    return myRange != null ? myRange : ElementManipulators.getValueTextRange(myElement);
+  }
+
+  @Nullable
+  public PsiElement resolve() {
+    myIncorrectResourceMapped = false;
+    final String canonicalText = getCanonicalText();
+
+    if (canonicalText.length() == 0) {
+      final XmlAttribute attr = PsiTreeUtil.getParentOfType(getElement(), XmlAttribute.class);
+
+      if (attr != null &&
+            attr.isNamespaceDeclaration() &&
+            attr.getNamespacePrefix().length() == 0 ||
+          ExternalResourceManagerEx.getInstanceEx().isIgnoredResource(canonicalText)
+         ) {
+        // Namespaces in XML 1.0 2nd edition, Section 6.2, last paragraph
+        // The attribute value in a default namespace declaration MAY be empty. This has the same effect, within the scope of the declaration,
+        // of there being no default namespace
+        return myElement;
+      }
+      return null;
+    }
+
+    if (ExternalResourceManagerEx.getInstanceEx().isIgnoredResource(canonicalText)) return myElement;
+    final XmlTag tag = PsiTreeUtil.getParentOfType(myElement, XmlTag.class);
+    if (tag != null && canonicalText.equals(tag.getAttributeValue(TARGET_NAMESPACE_ATTR_NAME))) return tag;
+
+    final PsiFile containingFile = myElement.getContainingFile();
+
+    if (tag != null &&
+        tag.getAttributeValue("schemaLocation", XmlUtil.XML_SCHEMA_INSTANCE_URI) == null
+       ) {
+      final PsiFile file = ExternalResourceManager.getInstance().getResourceLocation(canonicalText, containingFile, tag.getAttributeValue("version"));
+      if (file != null) return file;
+    }
+
+    if (containingFile instanceof XmlFile) {
+      final XmlDocument document = ((XmlFile)containingFile).getDocument();
+      assert document != null;
+      final XmlTag rootTag = document.getRootTag();
+
+     if (rootTag == null) {
+        return ExternalResourceManager.getInstance().getResourceLocation(canonicalText, containingFile, null);
+      }
+      final XmlNSDescriptor nsDescriptor = rootTag.getNSDescriptor(canonicalText, true);
+      if (nsDescriptor != null) return nsDescriptor.getDescriptorFile();
+
+      final String url = ExternalResourceManager.getInstance().getResourceLocation(canonicalText, myElement.getProject());
+      if (!url.equals(canonicalText)) {
+        myIncorrectResourceMapped = true;
+        return null;
+      }
+
+      if (tag == rootTag && (tag.getNamespace().equals(XmlUtil.XML_SCHEMA_URI) || tag.getNamespace().equals(XmlUtil.WSDL_SCHEMA_URI))) {
+        for(XmlTag t:tag.getSubTags()) {
+          final String name = t.getLocalName();
+          if ("import".equals(name)) {
+            if (canonicalText.equals(t.getAttributeValue("namespace"))) return t;
+          } else if (!"include".equals(name) && !"redefine".equals(name) && !"annotation".equals(name)) break;
+        }
+      }
+
+      final PsiElement[] result = new PsiElement[1];
+      processWsdlSchemas(rootTag,new Processor<XmlTag>() {
+        public boolean process(final XmlTag t) {
+          if (canonicalText.equals(t.getAttributeValue(TARGET_NAMESPACE_ATTR_NAME))) {
+            result[0] = t;
+            return false;
+          }
+          for (XmlTag anImport : t.findSubTags("import", t.getNamespace())) {
+            if (canonicalText.equals(anImport.getAttributeValue("namespace"))) {
+              final XmlAttribute location = anImport.getAttribute("schemaLocation");
+              if (location != null) {
+                result[0] = FileReferenceUtil.findFile(location.getValueElement());
+              }
+            }
+          }
+          return true;
+        }
+      });
+
+      return result[0];
+    }
+    return null;
+  }
+
+  @NotNull
+  public String getCanonicalText() {
+    final String text = myElement.getText();
+    if (text.length() > 1) {
+      return myRange == null ? text.substring(1, text.length() - 1) : myRange.substring(text);
+    }
+
+    return "";
+  }
+
+  public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
+    final TextRange textRangeInElement = getRangeInElement();
+    final PsiElement elementToChange = myElement.findElementAt(textRangeInElement.getStartOffset());
+    assert elementToChange != null;
+    final ElementManipulator<PsiElement> manipulator = ElementManipulators.getManipulator(elementToChange);
+    assert manipulator != null;
+    final int offsetFromStart = myElement.getTextRange().getStartOffset() + textRangeInElement.getStartOffset() - elementToChange.getTextOffset();
+
+    manipulator.handleContentChange(elementToChange, new TextRange(offsetFromStart, offsetFromStart + textRangeInElement.getLength()),newElementName);
+    return myElement;
+  }
+
+  public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+    assert element instanceof PsiFile;
+
+    if (!URIReferenceProvider.isUrlText(getCanonicalText(), element.getProject())) {
+      // TODO: this should work!
+      final VirtualFile virtualFile = ((PsiFile)element).getVirtualFile();
+      assert virtualFile != null;
+      handleElementRename(VfsUtil.fixIDEAUrl(virtualFile.getPresentableUrl()));
+    }
+    return myElement;
+  }
+
+  public boolean isReferenceTo(PsiElement element) {
+    return myElement.getManager().areElementsEquivalent(resolve(),element);
+  }
+
+  @NotNull
+  public Object[] getVariants() {
+    final XmlFile file = (XmlFile)myElement.getContainingFile();
+    Set<String> list = new HashSet<String>();
+    for (XmlSchemaProvider provider : Extensions.getExtensions(XmlSchemaProvider.EP_NAME)) {
+      if (provider.isAvailable(file)) {
+        list.addAll(provider.getAvailableNamespaces(file, null));
+      }
+    }
+    if (!list.isEmpty()) {
+      return ArrayUtil.toObjectArray(list);
+    }
+    String[] resourceUrls = ExternalResourceManager.getInstance().getResourceUrls(null, true);
+    final XmlDocument document = file.getDocument();
+    assert document != null;
+    XmlTag rootTag = document.getRootTag();
+    final ArrayList<String> additionalNs = new ArrayList<String>();
+    if (rootTag != null) processWsdlSchemas(rootTag, new Processor<XmlTag>() {
+      public boolean process(final XmlTag xmlTag) {
+        final String s = xmlTag.getAttributeValue(TARGET_NAMESPACE_ATTR_NAME);
+        if (s != null) { additionalNs.add(s); }
+        return true;
+      }
+    });
+    resourceUrls = ArrayUtil.mergeArrays(resourceUrls, ArrayUtil.toStringArray(additionalNs));
+    return resourceUrls;
+  }
+
+  public boolean isSoft() {
+    return mySoft;
+  }
+
+  public void registerQuickfix(HighlightInfo info, PsiReference reference) {
+    QuickFixAction.registerQuickFixAction(info, new FetchExtResourceAction());
+    QuickFixAction.registerQuickFixAction(info, new ManuallySetupExtResourceAction());
+    QuickFixAction.registerQuickFixAction(info, new IgnoreExtResourceAction());
+
+    final PsiElement parentElement = reference.getElement().getParent();
+    if (parentElement instanceof XmlAttribute && ((XmlAttribute)parentElement).isNamespaceDeclaration()) {
+      QuickFixAction.registerQuickFixAction(info, new AddXsiSchemaLocationForExtResourceAction());
+    }
+  }
+
+  public String getUnresolvedMessagePattern() {
+    return XmlErrorMessages.message(myIncorrectResourceMapped ? "registered.resource.is.not.recognized":"uri.is.not.registered");
+  }
+
+  public static void processWsdlSchemas(final XmlTag rootTag, Processor<XmlTag> processor) {
+    if ("definitions".equals(rootTag.getLocalName())) {
+      final String nsPrefix = rootTag.getNamespacePrefix();
+      final String types = nsPrefix.length() == 0 ? "types" : nsPrefix  + ":types";
+      final XmlTag subTag = rootTag.findFirstSubTag(types);
+
+      if (subTag != null) {
+        for (int i = 0; i < XmlUtil.SCHEMA_URIS.length; i++) {
+          final XmlTag[] tags = subTag.findSubTags("schema", XmlUtil.SCHEMA_URIS[i]);
+          for (XmlTag t : tags) {
+            if (!processor.process(t)) return;
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/XmlValueReference.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/XmlValueReference.java
new file mode 100644
index 0000000..9bccd25
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/XmlValueReference.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.resolve.reference.impl.providers;
+
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.ElementManipulators;
+import com.intellij.psi.ElementManipulator;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+*/
+public abstract class XmlValueReference implements PsiReference {
+  protected XmlTag myTag;
+  protected TextRange myRange;
+
+  protected XmlValueReference(XmlTag tag) {
+    myTag = tag;
+    myRange = ElementManipulators.getValueTextRange(tag);
+  }
+
+  public PsiElement getElement() {
+    return myTag;
+  }
+
+  public TextRange getRangeInElement() {
+    return myRange;
+  }
+
+  @NotNull
+  public String getCanonicalText() {
+    return myRange.substring(myTag.getText());
+  }
+
+  protected void replaceContent(final String str) throws IncorrectOperationException {
+    final ElementManipulator<XmlTag> manipulator = ElementManipulators.getManipulator(myTag);
+    manipulator.handleContentChange(myTag, myRange, str);
+    myRange = manipulator.getRangeInElement(myTag);
+  }
+
+  public boolean isReferenceTo(PsiElement element) {
+    return myTag.getManager().areElementsEquivalent(element, resolve());
+  }
+
+  public boolean isSoft() {
+    return false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/tree/HtmlFileElement.java b/xml/impl/src/com/intellij/psi/impl/source/tree/HtmlFileElement.java
new file mode 100644
index 0000000..e1d0624
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/tree/HtmlFileElement.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.tree;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.tree.ChildRoleBase;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlElementType;
+
+public class HtmlFileElement extends FileElement implements XmlElementType  {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.tree.HtmlFileElement");
+
+  public HtmlFileElement(CharSequence text) {
+    super(HTML_FILE, text);
+  }
+
+  public int getChildRole(ASTNode child) {
+    LOG.assertTrue(child.getTreeParent() == this);
+    if (child.getElementType() == HTML_DOCUMENT) {
+      return XmlChildRole.HTML_DOCUMENT;
+    }
+    else {
+      return ChildRoleBase.NONE;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/tree/XmlFileElement.java b/xml/impl/src/com/intellij/psi/impl/source/tree/XmlFileElement.java
new file mode 100644
index 0000000..db3128d
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/tree/XmlFileElement.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.tree;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.tree.ChildRoleBase;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlElementType;
+
+public class XmlFileElement extends FileElement implements XmlElementType {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.tree.XmlFileElement");
+
+  public XmlFileElement(CharSequence text) {
+    super(XML_FILE, text);
+  }
+
+  public XmlFileElement(IElementType type, CharSequence text) {
+    super(type, text);
+  }
+
+  public int getChildRole(ASTNode child) {
+    LOG.assertTrue(child.getTreeParent() == this);
+    if (child.getElementType() == XML_DOCUMENT ||
+        child.getElementType() == HTML_DOCUMENT) {
+      return XmlChildRole.XML_DOCUMENT;
+    }
+    else {
+      return ChildRoleBase.NONE;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/tree/injected/XmlAttributeLiteralEscaper.java b/xml/impl/src/com/intellij/psi/impl/source/tree/injected/XmlAttributeLiteralEscaper.java
new file mode 100644
index 0000000..2160661
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/tree/injected/XmlAttributeLiteralEscaper.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.tree.injected;
+
+import com.intellij.psi.impl.source.xml.XmlAttributeValueImpl;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.LiteralTextEscaper;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.ProperTextRange;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author cdr
+*/
+public class XmlAttributeLiteralEscaper extends LiteralTextEscaper<XmlAttributeValueImpl> {
+  private final XmlAttribute myXmlAttribute;
+
+  public XmlAttributeLiteralEscaper(XmlAttributeValueImpl host) {
+    super(host);
+    myXmlAttribute = (XmlAttribute)host.getParent();
+  }
+
+  public boolean decode(@NotNull final TextRange rangeInsideHost, @NotNull StringBuilder outChars) {
+    ProperTextRange.assertProperRange(rangeInsideHost);
+    TextRange valueTextRange = myXmlAttribute.getValueTextRange();
+    int startInDecoded = myXmlAttribute.physicalToDisplay(rangeInsideHost.getStartOffset() - valueTextRange.getStartOffset());
+    int endInDecoded = myXmlAttribute.physicalToDisplay(rangeInsideHost.getEndOffset() - valueTextRange.getStartOffset());
+    String displayValue = myXmlAttribute.getDisplayValue();
+    //todo investigate IIOB http://www.jetbrains.net/jira/browse/IDEADEV-16796
+    startInDecoded = startInDecoded < 0 ? 0 : startInDecoded > displayValue.length() ? displayValue.length() : startInDecoded;
+    endInDecoded = endInDecoded < 0 ? 0 : endInDecoded > displayValue.length() ? displayValue.length() : endInDecoded;
+    if (startInDecoded > endInDecoded) endInDecoded = startInDecoded;
+    outChars.append(displayValue, startInDecoded, endInDecoded);
+    return true;
+  }
+
+  public int getOffsetInHost(final int offsetInDecoded, @NotNull final TextRange rangeInsideHost) {
+    TextRange valueTextRange = myXmlAttribute.getValueTextRange();
+    int displayStart = myXmlAttribute.physicalToDisplay(rangeInsideHost.getStartOffset());
+
+    int dp = myXmlAttribute.displayToPhysical(offsetInDecoded + displayStart - valueTextRange.getStartOffset());
+    if (dp == -1) return -1;
+    return dp + valueTextRange.getStartOffset();
+  }
+
+  public boolean isOneLine() {
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/tree/injected/XmlCommentLiteralEscaper.java b/xml/impl/src/com/intellij/psi/impl/source/tree/injected/XmlCommentLiteralEscaper.java
new file mode 100644
index 0000000..8426623
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/tree/injected/XmlCommentLiteralEscaper.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.tree.injected;
+
+import com.intellij.psi.LiteralTextEscaper;
+import com.intellij.psi.impl.source.xml.XmlCommentImpl;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.ProperTextRange;
+import com.intellij.lang.Commenter;
+import com.intellij.lang.LanguageCommenters;
+import com.intellij.lang.CodeDocumentationAwareCommenter;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+public class XmlCommentLiteralEscaper extends LiteralTextEscaper<XmlCommentImpl> {
+  public XmlCommentLiteralEscaper(@NotNull XmlCommentImpl host) {
+    super(host);
+  }
+
+  public boolean decode(@NotNull final TextRange rangeInsideHost, @NotNull final StringBuilder outChars) {
+    ProperTextRange.assertProperRange(rangeInsideHost);
+    outChars.append(myHost.getText(), rangeInsideHost.getStartOffset(), rangeInsideHost.getEndOffset());
+    return true;
+  }
+
+  public int getOffsetInHost(final int offsetInDecoded, @NotNull final TextRange rangeInsideHost) {
+    int offset = offsetInDecoded + rangeInsideHost.getStartOffset();
+    if (offset < rangeInsideHost.getStartOffset()) offset = rangeInsideHost.getStartOffset();
+    if (offset > rangeInsideHost.getEndOffset()) offset = rangeInsideHost.getEndOffset();
+    return offset;
+  }
+
+  public boolean isOneLine() {
+    final Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(myHost.getLanguage());
+    if (commenter instanceof CodeDocumentationAwareCommenter) {
+      return myHost.getTokenType() == ((CodeDocumentationAwareCommenter) commenter).getLineCommentTokenType();
+    }
+    return false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/tree/injected/XmlTextLiteralEscaper.java b/xml/impl/src/com/intellij/psi/impl/source/tree/injected/XmlTextLiteralEscaper.java
new file mode 100644
index 0000000..ca61547
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/tree/injected/XmlTextLiteralEscaper.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.tree.injected;
+
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.ProperTextRange;
+import com.intellij.psi.impl.source.xml.XmlTextImpl;
+import com.intellij.psi.LiteralTextEscaper;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author cdr
+*/
+public class XmlTextLiteralEscaper extends LiteralTextEscaper<XmlTextImpl> {
+  public XmlTextLiteralEscaper(final XmlTextImpl xmlText) {
+    super(xmlText);
+  }
+
+  public boolean decode(@NotNull final TextRange rangeInsideHost, @NotNull StringBuilder outChars) {
+    ProperTextRange.assertProperRange(rangeInsideHost);
+    int startInDecoded = myHost.physicalToDisplay(rangeInsideHost.getStartOffset());
+    int endInDecoded = myHost.physicalToDisplay(rangeInsideHost.getEndOffset());
+    outChars.append(myHost.getValue(), startInDecoded, endInDecoded);
+    return true;
+  }
+
+  public int getOffsetInHost(final int offsetInDecoded, @NotNull final TextRange rangeInsideHost) {
+    final int rangeInsideHostStartOffset = rangeInsideHost.getStartOffset();
+    int displayStart = myHost.physicalToDisplay(rangeInsideHostStartOffset);
+
+    int i = myHost.displayToPhysical(offsetInDecoded + displayStart);
+    if (i < rangeInsideHostStartOffset) i = rangeInsideHostStartOffset;
+    final int rangeInsideHostEndOffset = rangeInsideHost.getEndOffset();
+    if (i > rangeInsideHostEndOffset) i = rangeInsideHostEndOffset;
+    return i;
+  }
+
+  @NotNull
+  public TextRange getRelevantTextRange() {
+    return myHost.getCDATAInterior();
+  }
+
+  public boolean isOneLine() {
+    return false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/PossiblePrefixReference.java b/xml/impl/src/com/intellij/psi/impl/source/xml/PossiblePrefixReference.java
new file mode 100644
index 0000000..07e568a
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/PossiblePrefixReference.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.psi.PsiReference;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public interface PossiblePrefixReference extends PsiReference {
+
+  boolean isPrefixReference();
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/SchemaPrefix.java b/xml/impl/src/com/intellij/psi/impl/source/xml/SchemaPrefix.java
new file mode 100644
index 0000000..5fbc795
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/SchemaPrefix.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.ElementManipulators;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.impl.RenameableFakePsiElement;
+import com.intellij.psi.search.SearchScope;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.util.PlatformIcons;
+import com.intellij.xml.XmlExtension;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class SchemaPrefix extends RenameableFakePsiElement {
+  private final TextRange myRange;
+  private final String myName;
+
+  public SchemaPrefix(final XmlAttribute parent, TextRange range, String name) {
+    super(parent);
+    myRange = range;
+    myName = name;
+  }
+
+  public static SchemaPrefix createJspPrefix(XmlAttributeValue element, String prefix) {
+    TextRange range = ElementManipulators.getValueTextRange(element).shiftRight(element.getStartOffsetInParent());
+    return new SchemaPrefix((XmlAttribute)element.getParent(), range, prefix) {
+      @Override
+      protected String getNamespace() {
+        return ((XmlAttribute)getParent()).getParent().getAttributeValue("uri");
+      }
+    };
+  }
+
+  public String getTypeName() {
+    return "XML Namespace Prefix";
+  }
+
+  public Icon getIcon() {
+    return PlatformIcons.VARIABLE_ICON;
+  }
+
+  @Override
+  public int getTextOffset() {
+    return getParent().getTextRange().getStartOffset() + myRange.getStartOffset();
+  }
+
+  @Override
+  public int getTextLength() {
+    return myName.length();
+  }
+
+  @Override
+  public String getName() {
+    return myName;
+  }
+
+  public XmlAttribute getDeclaration() {
+    return (XmlAttribute)getParent();
+  }
+
+  @Override
+  public TextRange getTextRange() {
+    return TextRange.from(getTextOffset(), getTextLength());
+  }
+
+  @NotNull
+  @Override
+  public SearchScope getUseScope() {
+    return XmlExtension.getExtension(getContainingFile()).getNsPrefixScope(getDeclaration());
+  }
+
+  @Override
+  public boolean isEquivalentTo(PsiElement another) {
+    return another instanceof SchemaPrefix && ((SchemaPrefix)another).getDeclaration() == getDeclaration();
+  }
+
+  public String getQuickNavigateInfo() {
+    String ns = getNamespace();
+    StringBuilder builder = new StringBuilder().append(getTypeName()).append(" \"").append(getName()).append("\"");
+    if (ns != null) {
+      builder.append(" (").append(ns).append(")");
+    }
+    return builder.toString();
+  }
+
+  @Nullable
+  protected String getNamespace() {
+    XmlAttribute parent = (XmlAttribute)getParent();
+    return parent.getValue();
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/SchemaPrefixReference.java b/xml/impl/src/com/intellij/psi/impl/source/xml/SchemaPrefixReference.java
new file mode 100644
index 0000000..ba4c8b9
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/SchemaPrefixReference.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReferenceBase;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlExtension;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class SchemaPrefixReference extends PsiReferenceBase<XmlElement> implements PossiblePrefixReference {
+
+  private final SchemaPrefix myPrefix;
+
+  private final String myName;
+  @Nullable
+  private final TagNameReference myTagNameReference;
+
+  /**
+   *
+   * @param element XmlAttribute || XmlAttributeValue
+   * @param range
+   * @param name
+   * @param tagNameReference
+   */
+  public SchemaPrefixReference(XmlElement element, TextRange range, String name, @Nullable TagNameReference tagNameReference) {
+    super(element, range);
+    myName = name;
+    myTagNameReference = tagNameReference;
+    if (myElement instanceof XmlAttribute && (((XmlAttribute)myElement).isNamespaceDeclaration())) {
+      myPrefix = new SchemaPrefix((XmlAttribute)myElement, getRangeInElement(), myName);
+    }
+    else if (myElement instanceof XmlAttributeValue &&
+             ((XmlAttribute)myElement.getParent()).getLocalName().equals("prefix")) {
+      myPrefix = SchemaPrefix.createJspPrefix((XmlAttributeValue)myElement, myName);
+    }
+    else {
+      myPrefix = null;
+    }
+  }
+
+  public String getNamespacePrefix() {
+    return myName;
+  }
+
+  public SchemaPrefix resolve() {
+    return myPrefix == null ? resolvePrefix(myElement, myName) : myPrefix;
+  }
+
+  @NotNull
+  public Object[] getVariants() {
+    if (myTagNameReference != null) {
+      return new LookupElement[]{ myTagNameReference.createClosingTagLookupElement(myTagNameReference.getTagElement(), true)};
+    }
+    return ArrayUtil.EMPTY_OBJECT_ARRAY;
+  }
+
+  @Override
+  public boolean isReferenceTo(PsiElement element) {
+    if (!(element instanceof SchemaPrefix) || !myName.equals(((SchemaPrefix)element).getName())) return false;
+    return super.isReferenceTo(element);
+  }
+
+  @Override
+  public PsiElement handleElementRename(String name) throws IncorrectOperationException {
+    if (myElement instanceof XmlAttribute) {
+      final XmlAttribute attr = (XmlAttribute)myElement;
+      return ("xmlns".equals(attr.getNamespacePrefix()))
+             ? attr.setName(attr.getNamespacePrefix() + ":" + name)
+             : attr.setName(name + ":" + attr.getLocalName());
+    }
+    else if (myElement instanceof XmlTag) {
+      final XmlTag tag = (XmlTag)myElement;
+      return tag.setName(name + ":" + tag.getLocalName());
+    }
+    return super.handleElementRename(name);
+  }
+
+  @Nullable
+  public static SchemaPrefix resolvePrefix(PsiElement element, String name) {
+    XmlExtension extension = XmlExtension.getExtension(element.getContainingFile());
+    return extension.getPrefixDeclaration(PsiTreeUtil.getParentOfType(element, XmlTag.class, false), name);
+  }
+
+  @Override
+  public boolean isSoft() {
+    return true;
+  }
+
+  @Override
+  public boolean isPrefixReference() {
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/TagNameReference.java b/xml/impl/src/com/intellij/psi/impl/source/xml/TagNameReference.java
new file mode 100644
index 0000000..c89fb9b
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/TagNameReference.java
@@ -0,0 +1,402 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.codeInsight.TailType;
+import com.intellij.codeInsight.completion.XmlTagInsertHandler;
+import com.intellij.codeInsight.lookup.AutoCompletionPolicy;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupElementBuilder;
+import com.intellij.codeInsight.lookup.TailTypeDecorator;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.meta.PsiMetaOwner;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.NullableFunction;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementDescriptorAwareAboutChildren;
+import com.intellij.xml.XmlExtension;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import com.intellij.xml.impl.schema.XmlElementDescriptorImpl;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+public class TagNameReference implements PsiReference {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.TagNameReference");
+
+  protected final boolean myStartTagFlag;
+  private final ASTNode myNameElement;
+
+  public TagNameReference(ASTNode nameElement, boolean startTagFlag) {
+    myStartTagFlag = startTagFlag;
+    myNameElement = nameElement;
+  }
+
+  public PsiElement getElement() {
+    PsiElement element = myNameElement.getPsi();
+    final PsiElement parent = element.getParent();
+    return parent instanceof XmlTag ? parent : element;
+  }
+
+  @Nullable
+  protected XmlTag getTagElement() {
+    final PsiElement element = getElement();
+    if(element == myNameElement.getPsi()) return null;
+    return (XmlTag)element;
+  }
+
+  public TextRange getRangeInElement() {
+    final ASTNode nameElement = getNameElement();
+    if (nameElement == null){
+      return TextRange.EMPTY_RANGE;
+    }
+
+    int colon = nameElement.getText().indexOf(':') + 1;
+    if (myStartTagFlag) {
+      final int parentOffset = ((TreeElement)nameElement).getStartOffsetInParent();
+      return new TextRange(parentOffset + colon, parentOffset + nameElement.getTextLength());
+    }
+    else {
+      final PsiElement element = getElement();
+      if (element == myNameElement) return new TextRange(colon, myNameElement.getTextLength());
+
+      final int elementLength = element.getTextLength();
+      int diffFromEnd = 0;
+
+      for(ASTNode node = element.getNode().getLastChildNode(); node != nameElement && node != null; node = node.getTreePrev()) {
+        diffFromEnd += node.getTextLength();
+      }
+
+      final int nameEnd = elementLength - diffFromEnd;
+      return new TextRange(nameEnd - nameElement.getTextLength() + colon, nameEnd);
+    }
+  }
+
+  private ASTNode getNameElement() {
+    return myNameElement;
+  }
+
+  public PsiElement resolve() {
+    final XmlTag tag = getTagElement();
+    final XmlElementDescriptor descriptor = tag != null ? tag.getDescriptor():null;
+
+    LOG.debug("Descriptor for tag " +
+              (tag != null ? tag.getName() : "NULL") +
+              " is " +
+              (descriptor != null ? (descriptor.toString() + ": " + descriptor.getClass().getCanonicalName()) : "NULL"));
+
+    if (descriptor != null){
+      return descriptor instanceof AnyXmlElementDescriptor ? tag : descriptor.getDeclaration();
+    }
+    return null;
+  }
+
+  @NotNull
+  public String getCanonicalText() {
+    return getNameElement().getText();
+  }
+
+  @Nullable
+  public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
+    final XmlTag element = getTagElement();
+    if (element == null || !myStartTagFlag) return element;
+
+    if (newElementName.indexOf(':') == -1) {
+      final String namespacePrefix = element.getNamespacePrefix();
+      final int index = newElementName.lastIndexOf('.');
+
+      if (index != -1) {
+        final PsiElement psiElement = resolve();
+        
+        if (psiElement instanceof PsiFile || (psiElement != null && psiElement.isEquivalentTo(psiElement.getContainingFile()))) {
+          newElementName = newElementName.substring(0, index);
+        }
+      }
+      newElementName = prependNamespacePrefix(newElementName, namespacePrefix);
+    }
+    element.setName(newElementName);
+    return element;
+  }
+
+  private static String prependNamespacePrefix(String newElementName, String namespacePrefix) {
+    newElementName = (namespacePrefix.length() > 0 ? namespacePrefix + ":":namespacePrefix) + newElementName;
+    return newElementName;
+  }
+
+  public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+    PsiMetaData metaData = null;
+
+    if (element instanceof PsiMetaOwner){
+      final PsiMetaOwner owner = (PsiMetaOwner)element;
+      metaData = owner.getMetaData();
+
+      if (metaData instanceof XmlElementDescriptor){
+        return getTagElement().setName(metaData.getName(getElement())); // TODO: need to evaluate new ns prefix
+      }
+    } else if (element instanceof PsiFile) {
+      final XmlTag tagElement = getTagElement();
+      if (tagElement == null || !myStartTagFlag) return tagElement;
+      String newElementName = ((PsiFile)element).getName();
+      final int index = newElementName.lastIndexOf('.');
+
+      // TODO: need to evaluate new ns prefix
+      newElementName = prependNamespacePrefix(newElementName.substring(0, index), tagElement.getNamespacePrefix());
+
+      return getTagElement().setName(newElementName);
+    }
+
+    throw new IncorrectOperationException("Cant bind to not a xml element definition!"+element+","+metaData);
+  }
+
+  public boolean isReferenceTo(PsiElement element) {
+    return getElement().getManager().areElementsEquivalent(element, resolve());
+  }
+
+  @NotNull
+  public LookupElement[] getVariants(){
+    final PsiElement element = getElement();
+    if(!myStartTagFlag){
+      if (element instanceof XmlTag) {
+        return new LookupElement[]{createClosingTagLookupElement((XmlTag)element, false)};
+      }
+      return LookupElement.EMPTY_ARRAY;
+    }
+    return getTagNameVariants((XmlTag)element, ((XmlTag)element).getNamespacePrefix());
+  }
+
+  public LookupElement createClosingTagLookupElement(XmlTag tag, boolean includePrefix) {
+    LookupElementBuilder builder = LookupElementBuilder.create(includePrefix || !myNameElement.getText().contains(":") ? tag.getName() : tag.getLocalName());
+    return TailTypeDecorator.withTail(AutoCompletionPolicy.GIVE_CHANCE_TO_OVERWRITE.applyPolicy(builder),
+                                      TailType.createSimpleTailType('>'));
+  }
+
+  public static LookupElement[] getTagNameVariants(final @NotNull XmlTag tag, final String prefix) {
+    final List<String> namespaces;
+    if (prefix.isEmpty()) {
+      namespaces = new ArrayList<String>(Arrays.asList(tag.knownNamespaces()));
+      namespaces.add(XmlUtil.EMPTY_URI); // empty namespace
+    }
+    else {
+      namespaces = new ArrayList<String>(Collections.singletonList(tag.getNamespace()));
+    }
+    List<String> nsInfo = new ArrayList<String>();
+    final String[] variants = getTagNameVariants(tag, namespaces, nsInfo);
+    List<LookupElement> elements = new ArrayList<LookupElement>(variants.length);
+    for (int i = 0, variantsLength = variants.length; i < variantsLength; i++) {
+      String qname = variants[i];
+      if (!prefix.isEmpty() && qname.startsWith(prefix + ":")) {
+        qname = qname.substring(prefix.length() + 1);
+      }
+      LookupElementBuilder lookupElement = LookupElementBuilder.create(qname);
+      final int separator = qname.indexOf(':');
+      if (separator > 0) {
+        lookupElement = lookupElement.withLookupString(qname.substring(separator + 1));
+      }
+      String ns = nsInfo.get(i);
+      if (StringUtil.isNotEmpty(ns)) {
+        lookupElement = lookupElement.withTypeText(ns, true);
+      }
+      elements.add(lookupElement.withInsertHandler(XmlTagInsertHandler.INSTANCE));
+    }
+    return elements.toArray(new LookupElement[elements.size()]);
+  }
+
+  public static String[] getTagNameVariants(final XmlTag element,
+                                            final Collection<String> namespaces,
+                                            @Nullable List<String> nsInfo) {
+
+    XmlElementDescriptor elementDescriptor = null;
+    String elementNamespace = null;
+
+    final Map<String, XmlElementDescriptor> descriptorsMap = new HashMap<String, XmlElementDescriptor>();
+    PsiElement context = element.getParent();
+    PsiElement curElement = element.getParent();
+
+    {
+      while(curElement instanceof XmlTag){
+        final XmlTag declarationTag = (XmlTag)curElement;
+        final String namespace = declarationTag.getNamespace();
+
+        if(!descriptorsMap.containsKey(namespace)) {
+          final XmlElementDescriptor descriptor = declarationTag.getDescriptor();
+
+          if(descriptor != null) {
+            descriptorsMap.put(namespace, descriptor);
+            if(elementDescriptor == null) {
+              elementDescriptor = descriptor;
+              elementNamespace = namespace;
+            }
+          }
+        }
+        curElement = curElement.getContext();
+      }
+    }
+
+    final Set<XmlNSDescriptor> visited = new HashSet<XmlNSDescriptor>();
+    final XmlExtension extension = XmlExtension.getExtension(element.getContainingFile());
+    final ArrayList<XmlElementDescriptor> variants = new ArrayList<XmlElementDescriptor>();
+    for (final String namespace: namespaces) {
+      final int initialSize = variants.size();
+      processVariantsInNamespace(namespace, element, variants, elementDescriptor, elementNamespace, descriptorsMap, visited,
+                                 context instanceof XmlTag ? (XmlTag)context : element, extension);
+      if (nsInfo != null) {
+        for (int i = initialSize; i < variants.size(); i++) {
+          nsInfo.add(namespace);
+        }
+      }
+    }
+
+    final boolean hasPrefix = StringUtil.isNotEmpty(element.getNamespacePrefix());
+    final List<String> list = ContainerUtil.mapNotNull(variants, new NullableFunction<XmlElementDescriptor, String>() {
+      public String fun(XmlElementDescriptor descriptor) {
+        if (descriptor instanceof AnyXmlElementDescriptor) {
+          return null;
+        }
+        else if (hasPrefix && descriptor instanceof XmlElementDescriptorImpl && 
+                 !namespaces.contains(((XmlElementDescriptorImpl)descriptor).getNamespace())) {
+          return null;
+        }
+
+        return descriptor.getName(element);
+      }
+    });
+    return ArrayUtil.toStringArray(list);
+  }
+
+  private static void processVariantsInNamespace(final String namespace,
+                                                 final XmlTag element,
+                                                 final List<XmlElementDescriptor> variants,
+                                                 final XmlElementDescriptor elementDescriptor,
+                                                 final String elementNamespace,
+                                                 final Map<String, XmlElementDescriptor> descriptorsMap,
+                                                 final Set<XmlNSDescriptor> visited,
+                                                 XmlTag parent,
+                                                 final XmlExtension extension) {
+    if(descriptorsMap.containsKey(namespace)){
+        final XmlElementDescriptor descriptor = descriptorsMap.get(namespace);
+
+      if(isAcceptableNs(element, elementDescriptor, elementNamespace, namespace)){
+        for(XmlElementDescriptor containedDescriptor: descriptor.getElementsDescriptors(parent)) {
+          if (containedDescriptor != null) variants.add(containedDescriptor);
+        }
+      }
+
+      if (element instanceof HtmlTag) {
+        HtmlUtil.addHtmlSpecificCompletions(descriptor, element, variants);
+      }
+      visited.add(descriptor.getNSDescriptor());
+    }
+    else{
+      // Don't use default namespace in case there are other namespaces in scope
+      // If there are tags from default namespace they will be handeled via
+      // their element descriptors (prev if section)
+      if (namespace == null) return;
+      if(namespace.length() == 0 && !visited.isEmpty()) return;
+
+      XmlNSDescriptor nsDescriptor = getDescriptor(element, namespace, true, extension);
+      if (nsDescriptor == null) {
+        if(!descriptorsMap.isEmpty()) return;
+        nsDescriptor = getDescriptor(element, namespace, false, extension);
+      }
+
+      if(nsDescriptor != null && !visited.contains(nsDescriptor) &&
+         isAcceptableNs(element, elementDescriptor, elementNamespace, namespace)
+        ){
+        visited.add(nsDescriptor);
+        final XmlElementDescriptor[] rootElementsDescriptors =
+          nsDescriptor.getRootElementsDescriptors(PsiTreeUtil.getParentOfType(element, XmlDocument.class));
+
+        final XmlTag parentTag = extension.getParentTagForNamespace(element, nsDescriptor);
+        final XmlElementDescriptor parentDescriptor;
+        if (parentTag == element.getParentTag()) {
+          parentDescriptor = elementDescriptor;
+        }
+        else {
+          assert parentTag != null;
+          parentDescriptor = parentTag.getDescriptor();
+        }
+
+        for(XmlElementDescriptor candidateDescriptor: rootElementsDescriptors) {
+          if (candidateDescriptor != null &&
+              couldContainDescriptor(parentTag, parentDescriptor, candidateDescriptor, namespace, false)) {
+            variants.add(candidateDescriptor);
+          }
+        }
+      }
+    }
+  }
+
+  private static XmlNSDescriptor getDescriptor(final XmlTag element, final String namespace, final boolean strict,
+                                               final XmlExtension extension) {
+    return extension.getNSDescriptor(element, namespace, strict);
+  }
+
+  public static boolean couldContain(XmlTag parent, XmlTag child) {
+    return couldContainDescriptor(parent, parent.getDescriptor(), child.getDescriptor(), child.getNamespace(), true);
+  }
+
+  private static boolean couldContainDescriptor(final XmlTag parentTag,
+                                                final XmlElementDescriptor parentDescriptor,
+                                                final XmlElementDescriptor childDescriptor,
+                                                String childNamespace, boolean strict) {
+
+    if (XmlUtil.nsFromTemplateFramework(childNamespace)) return true;
+    if (parentTag == null) return true;
+    if (parentDescriptor == null) return false;
+    final XmlTag childTag = parentTag.createChildTag(childDescriptor.getName(), childNamespace, null, false);
+    childTag.putUserData(XmlElement.INCLUDING_ELEMENT, parentTag);
+    XmlElementDescriptor descriptor = parentDescriptor.getElementDescriptor(childTag, parentTag);
+    return descriptor != null && (!strict || !(descriptor instanceof AnyXmlElementDescriptor));
+  }
+
+  private static boolean isAcceptableNs(final XmlTag element, final XmlElementDescriptor elementDescriptor,
+                                        final String elementNamespace,
+                                        final String namespace) {
+    return !(elementDescriptor instanceof XmlElementDescriptorAwareAboutChildren) ||
+        elementNamespace == null ||
+        elementNamespace.equals(namespace) ||
+         ((XmlElementDescriptorAwareAboutChildren)elementDescriptor).allowElementsFromNamespace(namespace, element.getParentTag());
+  }
+
+  public boolean isSoft() {
+    return false;
+  }
+
+  @Nullable
+  static TagNameReference createTagNameReference(XmlElement element, @NotNull ASTNode nameElement, boolean startTagFlag) {
+    final XmlExtension extension = XmlExtension.getExtensionByElement(element);
+    return extension == null ? null : extension.createTagNameReference(nameElement, startTagFlag);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttlistDeclImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttlistDeclImpl.java
new file mode 100644
index 0000000..828e801
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttlistDeclImpl.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.filters.ClassFilter;
+import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
+import com.intellij.psi.scope.processor.FilterElementProcessor;
+import com.intellij.psi.tree.ChildRoleBase;
+import com.intellij.psi.xml.*;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Mike
+ */
+public class XmlAttlistDeclImpl extends XmlElementImpl implements XmlAttlistDecl {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlAttlistDeclImpl");
+
+  public XmlAttlistDeclImpl() {
+    super(XmlElementType.XML_ATTLIST_DECL);
+  }
+
+  public int getChildRole(ASTNode child) {
+    LOG.assertTrue(child.getTreeParent() == this);
+    if (child.getElementType() == XmlElementType.XML_NAME) {
+      return XmlChildRole.XML_NAME;
+    }
+    else {
+      return ChildRoleBase.NONE;
+    }
+  }
+
+  public XmlElement getNameElement() {
+    return (XmlElement)findChildByRoleAsPsiElement(XmlChildRole.XML_NAME);
+  }
+
+  public XmlAttributeDecl[] getAttributeDecls() {
+    final List<XmlAttributeDecl> result = new ArrayList<XmlAttributeDecl>();
+    processElements(new FilterElementProcessor(new ClassFilter(XmlAttributeDecl.class), result) {
+      public boolean execute(@NotNull final PsiElement element) {
+        if (element instanceof XmlAttributeDecl) {
+          if (element.getNextSibling() == null && element.getChildren().length == 1) {
+            return true;
+          }
+          return super.execute(element);
+        }
+        return true;
+      }
+    }, this);
+    return result.toArray(new XmlAttributeDecl[result.size()]);
+  }
+
+  @NotNull
+  public PsiReference[] getReferences() {
+    return ReferenceProvidersRegistry.getReferencesFromProviders(this,XmlAttlistDecl.class);
+  }
+
+  public String getName() {
+    XmlElement xmlElement = getNameElement();
+    if (xmlElement != null) return xmlElement.getText();
+
+    return getNameFromEntityRef(this, XmlElementType.XML_ATTLIST_DECL_START);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttributeDeclImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttributeDeclImpl.java
new file mode 100644
index 0000000..be7bf30
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttributeDeclImpl.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.ide.util.EditSourceUtil;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.fileEditor.OpenFileDescriptor;
+import com.intellij.pom.Navigatable;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.impl.meta.MetaRegistry;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.tree.ChildRoleBase;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Mike
+ */
+public class XmlAttributeDeclImpl extends XmlElementImpl implements XmlAttributeDecl, XmlElementType {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlAttributeDeclImpl");
+  @NonNls private static final String ID_ATT = "ID";
+  @NonNls private static final String IDREF_ATT = "IDREF";
+
+  public XmlAttributeDeclImpl() {
+    super(XML_ATTRIBUTE_DECL);
+  }
+
+  public int getChildRole(ASTNode child) {
+    LOG.assertTrue(child.getTreeParent() == this);
+    IElementType i = child.getElementType();
+    if (i == XML_NAME) {
+      return XmlChildRole.XML_NAME;
+    }
+    else if (i == XML_ATT_REQUIRED) {
+      return XmlChildRole.XML_ATT_REQUIRED;
+    }
+    else if (i == XML_ATT_FIXED) {
+      return XmlChildRole.XML_ATT_FIXED;
+    }
+    else if (i == XML_ATT_IMPLIED) {
+      return XmlChildRole.XML_ATT_IMPLIED;
+    }
+    else if (i == XML_ATTRIBUTE_VALUE) {
+      return XmlChildRole.XML_DEFAULT_VALUE;
+    }
+    else if (i == XML_ENUMERATED_TYPE) {
+      return XmlChildRole.XML_ENUMERATED_TYPE;
+    }
+    else {
+      return ChildRoleBase.NONE;
+    }
+  }
+
+  public XmlElement getNameElement() {
+    return findElementByTokenType(XML_NAME);
+  }
+
+  public boolean isAttributeRequired() {
+    return findElementByTokenType(XML_ATT_REQUIRED) != null;
+  }
+
+  public boolean isAttributeFixed() {
+    return findElementByTokenType(XML_ATT_FIXED) != null;
+  }
+
+  public boolean isAttributeImplied() {
+    return findElementByTokenType(XML_ATT_IMPLIED) != null;
+  }
+
+  public XmlAttributeValue getDefaultValue() {
+    return (XmlAttributeValue)findElementByTokenType(XML_ATTRIBUTE_VALUE);
+  }
+
+  public String getDefaultValueText() {
+    XmlAttributeValue value = getDefaultValue();
+    if (value == null) return null;
+    String text = value.getText();
+    if (text.indexOf('%') == -1 && text.indexOf('&') == -1) return text;
+
+    final StringBuilder builder = new StringBuilder();
+    value.processElements(new PsiElementProcessor() {
+      public boolean execute(@NotNull PsiElement element) {
+        builder.append(element.getText());
+        return true;
+      }
+    }, null);
+    return builder.toString();
+  }
+
+  public boolean isEnumerated() {
+    return findElementByTokenType(XML_ENUMERATED_TYPE) != null;
+  }
+
+  public XmlElement[] getEnumeratedValues() {
+    XmlEnumeratedType enumeratedType = (XmlEnumeratedType)findElementByTokenType(XML_ENUMERATED_TYPE);
+    if (enumeratedType != null) {
+      return enumeratedType.getEnumeratedValues();
+    }
+    else {
+      return XmlElement.EMPTY_ARRAY;
+    }
+  }
+
+  public boolean isIdAttribute() {
+    final PsiElement elementType = findElementType();
+
+    return elementType != null && elementType.getText().equals(ID_ATT);
+  }
+
+  private PsiElement findElementType() {
+    final PsiElement elementName = findElementByTokenType(XML_NAME);
+    final PsiElement nextSibling = (elementName != null) ? elementName.getNextSibling() : null;
+    final PsiElement elementType = (nextSibling instanceof PsiWhiteSpace) ? nextSibling.getNextSibling() : nextSibling;
+
+    return elementType;
+  }
+
+  public boolean isIdRefAttribute() {
+    final PsiElement elementType = findElementType();
+
+    return elementType != null && elementType.getText().equals(IDREF_ATT);
+  }
+
+  public PsiMetaData getMetaData() {
+    return MetaRegistry.getMeta(this);
+  }
+
+  public PsiElement setName(@NotNull String name) throws IncorrectOperationException {
+    XmlElementChangeUtil.doNameReplacement(this, getNameElement(), name);
+    return null;
+  }
+
+  public String getName() {
+    XmlElement name = getNameElement();
+    return (name != null) ? name.getText() : null;
+  }
+
+  public boolean canNavigate() {
+    if (isPhysical()) return super.canNavigate();
+    final PsiNamedElement psiNamedElement = XmlUtil.findRealNamedElement(this);
+    return psiNamedElement != null && psiNamedElement != this && ((Navigatable)psiNamedElement).canNavigate();
+  }
+
+  public void navigate(final boolean requestFocus) {
+    if (isPhysical()) {
+      super.navigate(requestFocus);
+      return;
+    }
+    final PsiNamedElement psiNamedElement = XmlUtil.findRealNamedElement(this);
+    Navigatable navigatable = EditSourceUtil.getDescriptor(psiNamedElement);
+
+    if (psiNamedElement instanceof XmlEntityDecl) {
+      final OpenFileDescriptor fileDescriptor = (OpenFileDescriptor)navigatable;
+      navigatable = new OpenFileDescriptor(
+        fileDescriptor.getProject(),
+        fileDescriptor.getFile(),
+        psiNamedElement.getTextRange().getStartOffset() + psiNamedElement.getText().indexOf(getName())
+      );
+    }
+    navigatable.navigate(requestFocus);
+  }
+
+  @NotNull
+  public PsiElement getNavigationElement() {
+    return this;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttributeImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttributeImpl.java
new file mode 100644
index 0000000..d3caa29
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttributeImpl.java
@@ -0,0 +1,517 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.codeInsight.completion.*;
+import com.intellij.codeInsight.daemon.QuickFixProvider;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupElementBuilder;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.NullableLazyValue;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.pom.PomManager;
+import com.intellij.pom.PomModel;
+import com.intellij.pom.event.PomModelEvent;
+import com.intellij.pom.impl.PomTransactionBase;
+import com.intellij.pom.xml.XmlAspect;
+import com.intellij.pom.xml.impl.XmlAspectChangeSetImpl;
+import com.intellij.pom.xml.impl.events.XmlAttributeSetImpl;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.source.codeStyle.CodeEditUtil;
+import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
+import com.intellij.psi.meta.PsiMetaOwner;
+import com.intellij.psi.meta.PsiPresentableMetaData;
+import com.intellij.psi.tree.ChildRoleBase;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlExtension;
+import com.intellij.xml.impl.XmlAttributeDescriptorEx;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlUtil;
+import gnu.trove.TIntArrayList;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import static com.intellij.codeInsight.completion.CompletionInitializationContext.DUMMY_IDENTIFIER_TRIMMED;
+
+/**
+ * @author Mike
+ */
+public class XmlAttributeImpl extends XmlElementImpl implements XmlAttribute {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlAttributeImpl");
+
+  private final int myHC = ourHC++;
+
+  @Override
+  public final int hashCode() {
+    return myHC;
+  }
+
+  public XmlAttributeImpl() {
+    super(XmlElementType.XML_ATTRIBUTE);
+  }
+
+  public int getChildRole(ASTNode child) {
+    LOG.assertTrue(child.getTreeParent() == this);
+    IElementType i = child.getElementType();
+    if (i == XmlTokenType.XML_NAME) {
+      return XmlChildRole.XML_NAME;
+    }
+    else if (i == XmlElementType.XML_ATTRIBUTE_VALUE) {
+      return XmlChildRole.XML_ATTRIBUTE_VALUE;
+    }
+    else {
+      return ChildRoleBase.NONE;
+    }
+  }
+
+  public XmlAttributeValue getValueElement() {
+    return (XmlAttributeValue)XmlChildRole.ATTRIBUTE_VALUE_FINDER.findChild(this);
+  }
+
+  public void setValue(String valueText) throws IncorrectOperationException {
+    final ASTNode value = XmlChildRole.ATTRIBUTE_VALUE_FINDER.findChild(this);
+    final PomModel model = PomManager.getModel(getProject());
+    final XmlAttribute attribute = XmlElementFactory.getInstance(getProject()).createXmlAttribute("a", valueText);
+    final ASTNode newValue = XmlChildRole.ATTRIBUTE_VALUE_FINDER.findChild((ASTNode)attribute);
+    final XmlAspect aspect = model.getModelAspect(XmlAspect.class);
+    model.runTransaction(new PomTransactionBase(this, aspect) {
+      public PomModelEvent runInner() {
+        final XmlAttributeImpl att = XmlAttributeImpl.this;
+        if (value != null) {
+          if (newValue != null) {
+            att.replaceChild(value, newValue.copyElement());
+          }
+          else {
+            att.removeChild(value);
+          }
+        }
+        else {
+          if (newValue != null) {
+            att.addChild(newValue.copyElement());
+          }
+        }
+        return XmlAttributeSetImpl.createXmlAttributeSet(model, getParent(), getName(), newValue != null ? newValue.getText() : null);
+      }
+    });
+  }
+
+  public XmlElement getNameElement() {
+    return (XmlElement)XmlChildRole.ATTRIBUTE_NAME_FINDER.findChild(this);
+  }
+
+  @NotNull
+  public String getNamespace() {
+    final String name = getName();
+    final String prefixByQualifiedName = XmlUtil.findPrefixByQualifiedName(name);
+    // The namespace name for an unprefixed attribute name always has no value. Namespace recommendation section 6.2, third paragraph
+    if (prefixByQualifiedName.length() == 0) return XmlUtil.EMPTY_URI;
+    return getParent().getNamespaceByPrefix(prefixByQualifiedName);
+  }
+
+  @NonNls
+  @NotNull
+  public String getNamespacePrefix() {
+    return XmlUtil.findPrefixByQualifiedName(getName());
+  }
+
+  public XmlTag getParent() {
+    final PsiElement parentTag = super.getParent();
+    return parentTag instanceof XmlTag ? (XmlTag)parentTag : null; // Invalid elements might belong to DummyHolder instead.
+  }
+
+  @NotNull
+  public String getLocalName() {
+    return XmlUtil.findLocalNameByQualifiedName(getName());
+  }
+
+  public void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlAttribute(this);
+    }
+    else {
+      visitor.visitElement(this);
+    }
+  }
+
+  public String getValue() {
+    final XmlAttributeValue valueElement = getValueElement();
+    return valueElement != null ? valueElement.getValue() : null;
+  }
+
+  private volatile String myDisplayText = null;
+  private volatile int[] myGapDisplayStarts = null;
+  private volatile int[] myGapPhysicalStarts = null;
+  private volatile TextRange myValueTextRange; // text inside quotes, if there are any
+
+  protected void appendChildToDisplayValue(StringBuilder buffer, ASTNode child) {
+    buffer.append(child.getChars());
+  }
+
+  public String getDisplayValue() {
+    String displayText = myDisplayText;
+    if (displayText != null) return displayText;
+    XmlAttributeValue value = getValueElement();
+    if (value == null) return null;
+    PsiElement firstChild = value.getFirstChild();
+    if (firstChild == null) return null;
+    ASTNode child = firstChild.getNode();
+    TextRange valueTextRange = new TextRange(0, value.getTextLength());
+    if (child != null && child.getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER) {
+      valueTextRange = new TextRange(child.getTextLength(), valueTextRange.getEndOffset());
+      child = child.getTreeNext();
+    }
+    final TIntArrayList gapsStarts = new TIntArrayList();
+    final TIntArrayList gapsShifts = new TIntArrayList();
+    StringBuilder buffer = new StringBuilder(getTextLength());
+    while (child != null) {
+      final int start = buffer.length();
+      IElementType elementType = child.getElementType();
+      if (elementType == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER) {
+        valueTextRange =
+          new TextRange(valueTextRange.getStartOffset(), child.getTextRange().getStartOffset() - value.getTextRange().getStartOffset());
+        break;
+      }
+      if (elementType == XmlTokenType.XML_CHAR_ENTITY_REF) {
+        buffer.append(XmlUtil.getCharFromEntityRef(child.getText()));
+      }
+      else if (elementType == XmlElementType.XML_ENTITY_REF) {
+        buffer.append(XmlUtil.getEntityValue((XmlEntityRef)child));
+      }
+      else {
+        appendChildToDisplayValue(buffer, child);
+      }
+
+      int end = buffer.length();
+      int originalLength = child.getTextLength();
+      if (end - start != originalLength) {
+        gapsStarts.add(start);
+        gapsShifts.add(originalLength - (end - start));
+      }
+      child = child.getTreeNext();
+    }
+    int[] gapDisplayStarts = ArrayUtil.newIntArray(gapsShifts.size());
+    int[] gapPhysicalStarts = ArrayUtil.newIntArray(gapsShifts.size());
+    int currentGapsSum = 0;
+    for (int i = 0; i < gapDisplayStarts.length; i++) {
+      currentGapsSum += gapsShifts.get(i);
+      gapDisplayStarts[i] = gapsStarts.get(i);
+      gapPhysicalStarts[i] = gapDisplayStarts[i] + currentGapsSum;
+    }
+    myGapDisplayStarts = gapDisplayStarts;
+    myGapPhysicalStarts = gapPhysicalStarts;
+    myValueTextRange = valueTextRange;
+    return myDisplayText = buffer.toString();
+  }
+
+  public int physicalToDisplay(int physicalIndex) {
+    getDisplayValue();
+    if (physicalIndex < 0 || physicalIndex > myValueTextRange.getLength()) return -1;
+    if (myGapPhysicalStarts.length == 0) return physicalIndex;
+
+    final int bsResult = Arrays.binarySearch(myGapPhysicalStarts, physicalIndex);
+
+    final int gapIndex;
+    if (bsResult > 0) {
+      gapIndex = bsResult;
+    }
+    else if (bsResult < -1) {
+      gapIndex = -bsResult - 2;
+    }
+    else {
+      gapIndex = -1;
+    }
+
+    if (gapIndex < 0) return physicalIndex;
+    final int shift = myGapPhysicalStarts[gapIndex] - myGapDisplayStarts[gapIndex];
+    return Math.max(myGapDisplayStarts[gapIndex], physicalIndex - shift);
+  }
+
+  public int displayToPhysical(int displayIndex) {
+    String displayValue = getDisplayValue();
+    if (displayValue == null || displayIndex < 0 || displayIndex > displayValue.length()) return -1;
+    if (myGapDisplayStarts.length == 0) return displayIndex;
+
+    final int bsResult = Arrays.binarySearch(myGapDisplayStarts, displayIndex);
+    final int gapIndex;
+
+    if (bsResult > 0) {
+      gapIndex = bsResult - 1;
+    }
+    else if (bsResult < -1) {
+      gapIndex = -bsResult - 2;
+    }
+    else {
+      gapIndex = -1;
+    }
+
+    if (gapIndex < 0) return displayIndex;
+    final int shift = myGapPhysicalStarts[gapIndex] - myGapDisplayStarts[gapIndex];
+    return displayIndex + shift;
+  }
+
+  public TextRange getValueTextRange() {
+    getDisplayValue();
+    return myValueTextRange;
+  }
+
+  public void clearCaches() {
+    super.clearCaches();
+    myDisplayText = null;
+    myGapDisplayStarts = null;
+    myGapPhysicalStarts = null;
+    myValueTextRange = null;
+  }
+
+  @NotNull
+  public String getName() {
+    XmlElement element = getNameElement();
+    return element != null ? element.getText() : "";
+  }
+
+  public boolean isNamespaceDeclaration() {
+    @NonNls final String name = getName();
+    return name.startsWith("xmlns:") || name.equals("xmlns");
+  }
+
+  public PsiElement setName(@NotNull final String nameText) throws IncorrectOperationException {
+    final ASTNode name = XmlChildRole.ATTRIBUTE_NAME_FINDER.findChild(this);
+    final String oldName = name.getText();
+    final PomModel model = PomManager.getModel(getProject());
+    final XmlAttribute attribute = XmlElementFactory.getInstance(getProject()).createXmlAttribute(nameText, "");
+    final ASTNode newName = XmlChildRole.ATTRIBUTE_NAME_FINDER.findChild((ASTNode)attribute);
+    final XmlAspect aspect = model.getModelAspect(XmlAspect.class);
+    model.runTransaction(new PomTransactionBase(getParent(), aspect) {
+      public PomModelEvent runInner() {
+        final PomModelEvent event = new PomModelEvent(model);
+        final XmlAspectChangeSetImpl xmlAspectChangeSet = new XmlAspectChangeSetImpl(model, (XmlFile)getContainingFile());
+        xmlAspectChangeSet.add(new XmlAttributeSetImpl(getParent(), oldName, null));
+        xmlAspectChangeSet.add(new XmlAttributeSetImpl(getParent(), nameText, getValue()));
+        event.registerChangeSet(model.getModelAspect(XmlAspect.class), xmlAspectChangeSet);
+        CodeEditUtil.replaceChild(XmlAttributeImpl.this, name, newName);
+        return event;
+      }
+    });
+    return this;
+  }
+
+  public PsiReference getReference() {
+    final PsiReference[] refs = getReferences();
+    if (refs.length > 0) return refs[0];
+    return null;
+  }
+
+  @NotNull
+  public PsiReference[] getReferences() {
+    final PsiElement parentElement = getParent();
+    if (!(parentElement instanceof XmlTag)) return PsiReference.EMPTY_ARRAY;
+    final PsiReference[] referencesFromProviders = ReferenceProvidersRegistry.getReferencesFromProviders(this, XmlAttribute.class);
+    if (referencesFromProviders == null) return new PsiReference[]{new MyPsiReference()};
+    PsiReference[] refs;
+    if (isNamespaceDeclaration()) {
+      refs = new PsiReference[referencesFromProviders.length + 1];
+      final String localName = getLocalName();
+      final String prefix = XmlUtil.findPrefixByQualifiedName(getName());
+      final TextRange range =
+        prefix.length() == 0 ? TextRange.from(getName().length(), 0) : TextRange.from(prefix.length() + 1, localName.length());
+      refs[0] = new SchemaPrefixReference(this, range, localName, null);
+    }
+    else {
+      final String prefix = getNamespacePrefix();
+      if (prefix.length() > 0 && getLocalName().length() > 0) {
+        refs = new PsiReference[referencesFromProviders.length + 2];
+        refs[0] = new SchemaPrefixReference(this, TextRange.from(0, prefix.length()), prefix, null);
+        refs[1] = new MyPsiReference();
+      }
+      else {
+        refs = new PsiReference[referencesFromProviders.length + 1];
+        refs[0] = new MyPsiReference();
+      }
+    }
+    System.arraycopy(referencesFromProviders, 0, refs, refs.length - referencesFromProviders.length, referencesFromProviders.length);
+    return refs;
+  }
+
+  @Nullable
+  public XmlAttributeDescriptor getDescriptor() {
+    final PsiElement parentElement = getParent();
+    if (parentElement instanceof XmlDecl) return null;
+    final XmlTag tag = (XmlTag)parentElement;
+    final XmlElementDescriptor descr = tag.getDescriptor();
+    if (descr == null) return null;
+    final XmlAttributeDescriptor attributeDescr = descr.getAttributeDescriptor(this);
+    return attributeDescr == null ? descr.getAttributeDescriptor(getName(), tag) : attributeDescr;
+  }
+
+  private class MyPsiReference implements PsiReference, QuickFixProvider {
+
+    private final NullableLazyValue<XmlAttributeDescriptor> myDescriptor = new NullableLazyValue<XmlAttributeDescriptor>() {
+      protected XmlAttributeDescriptor compute() {
+        XmlTag parent = getParent();
+        final XmlElementDescriptor descr = parent.getDescriptor();
+        if (descr != null) {
+          return descr.getAttributeDescriptor(XmlAttributeImpl.this);
+        }
+        return null;
+      }
+    };
+
+    public PsiElement getElement() {
+      return XmlAttributeImpl.this;
+    }
+
+    public TextRange getRangeInElement() {
+      final int parentOffset = getNameElement().getStartOffsetInParent();
+      int nsLen = getNamespacePrefix().length();
+      nsLen += nsLen > 0 && getRealLocalName().length() > 0 ? 1 : -nsLen;
+      return new TextRange(parentOffset + nsLen, parentOffset + getNameElement().getTextLength());
+    }
+
+    public PsiElement resolve() {
+      final XmlAttributeDescriptor descriptor = getDescriptor();
+      return descriptor != null ? descriptor.getDeclaration() : null;
+    }
+
+    @NotNull
+    public String getCanonicalText() {
+      return getName();
+    }
+
+    public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
+      String newName = newElementName;
+      if (getDescriptor() instanceof XmlAttributeDescriptorEx) {
+        final XmlAttributeDescriptorEx xmlAttributeDescriptorEx = (XmlAttributeDescriptorEx)getDescriptor();
+        final String s = xmlAttributeDescriptorEx.handleTargetRename(newElementName);
+        if (s != null) {
+          final String prefix = getNamespacePrefix();
+          newName = StringUtil.isEmpty(prefix) ? s : prefix + ":" + s;
+        }
+      }
+      return setName(newName);
+    }
+
+    // TODO[ik]: namespace support
+
+    public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+      if (element instanceof PsiMetaOwner) {
+        final PsiMetaOwner owner = (PsiMetaOwner)element;
+        if (owner.getMetaData() instanceof XmlElementDescriptor) {
+          setName(owner.getMetaData().getName());
+        }
+      }
+      throw new IncorrectOperationException("Cant bind to not a xml element definition!");
+    }
+
+    public boolean isReferenceTo(PsiElement element) {
+      return getManager().areElementsEquivalent(element, resolve());
+    }
+
+    @NotNull
+    public Object[] getVariants() {
+      final List<LookupElement> variants = new ArrayList<LookupElement>();
+
+      final XmlTag declarationTag = getParent();
+      LOG.assertTrue(declarationTag.isValid());
+      final XmlElementDescriptor parentDescriptor = declarationTag.getDescriptor();
+      if (parentDescriptor != null) {
+        final XmlAttribute[] attributes = declarationTag.getAttributes();
+        XmlAttributeDescriptor[] descriptors = parentDescriptor.getAttributesDescriptors(declarationTag);
+
+        descriptors = HtmlUtil.appendHtmlSpecificAttributeCompletions(declarationTag, descriptors, XmlAttributeImpl.this);
+
+        addVariants(variants, attributes, descriptors);
+      }
+      return variants.toArray();
+    }
+
+    private void addVariants(final Collection<LookupElement> variants,
+                             final XmlAttribute[] attributes,
+                             final XmlAttributeDescriptor[] descriptors) {
+      final XmlTag tag = getParent();
+      final XmlExtension extension = XmlExtension.getExtension(tag.getContainingFile());
+      final String prefix = getName().contains(":") && getRealLocalName().length() > 0 ? getNamespacePrefix() + ":" : null;
+
+      CompletionData completionData = CompletionUtil.getCompletionDataByElement(XmlAttributeImpl.this, getContainingFile().getOriginalFile());
+      boolean caseSensitive = !(completionData instanceof HtmlCompletionData) || ((HtmlCompletionData)completionData).isCaseSensitive();
+
+      for (XmlAttributeDescriptor descriptor : descriptors) {
+        if (isValidVariant(descriptor, attributes, extension)) {
+          String name = descriptor.getName(tag);
+          if (prefix == null || name.startsWith(prefix)) {
+            if (prefix != null && name.length() > prefix.length()) {
+              name = descriptor.getName(tag).substring(prefix.length());
+            }
+            LookupElementBuilder element = LookupElementBuilder.create(name);
+            if (descriptor instanceof PsiPresentableMetaData) {
+              element = element.withIcon(((PsiPresentableMetaData)descriptor).getIcon());
+            }
+            final int separator = name.indexOf(':');
+            if (separator > 0) {
+              element = element.withLookupString(name.substring(separator + 1));
+            }
+            variants.add(element.withCaseSensitivity(caseSensitive).withInsertHandler(XmlAttributeInsertHandler.INSTANCE));
+          }
+        }
+      }
+    }
+
+    private boolean isValidVariant(@NotNull XmlAttributeDescriptor descriptor, final XmlAttribute[] attributes, final XmlExtension extension) {
+      if (extension.isIndirectSyntax(descriptor)) return false;
+      String descriptorName = descriptor.getName();
+      if (descriptorName == null) {
+        LOG.error("Null descriptor name for " + descriptor + " " + descriptor.getClass() + " ");
+        return false;
+      }
+      for (final XmlAttribute attribute : attributes) {
+        if (attribute != XmlAttributeImpl.this && attribute.getName().equals(descriptorName)) return false;
+      }
+      return !descriptorName.contains(DUMMY_IDENTIFIER_TRIMMED);
+    }
+
+    public boolean isSoft() {
+      return getDescriptor() == null;
+    }
+
+    public void registerQuickfix(final HighlightInfo info, final PsiReference reference) {
+      if (getDescriptor() instanceof QuickFixProvider) {
+        ((QuickFixProvider)getDescriptor()).registerQuickfix(info, reference);
+      }
+    }
+
+    @Nullable
+    private XmlAttributeDescriptor getDescriptor() {
+      return myDescriptor.getValue();
+    }
+  }
+
+  private String getRealLocalName() {
+    final String name = getLocalName();
+    return name.endsWith(DUMMY_IDENTIFIER_TRIMMED) ? name.substring(0, name.length() - DUMMY_IDENTIFIER_TRIMMED.length()) : name;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttributeValueImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttributeValueImpl.java
new file mode 100644
index 0000000..eb27880
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttributeValueImpl.java
@@ -0,0 +1,185 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.navigation.ItemPresentation;
+import com.intellij.navigation.ItemPresentationWithSeparator;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.CheckUtil;
+import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
+import com.intellij.psi.impl.source.tree.injected.XmlAttributeLiteralEscaper;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.meta.PsiMetaOwner;
+import com.intellij.psi.presentation.java.SymbolPresentationUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+/**
+ * @author Mike
+ */
+public class XmlAttributeValueImpl extends XmlElementImpl implements XmlAttributeValue, PsiLanguageInjectionHost, PsiMetaOwner, PsiMetaData {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlAttributeValueImpl");
+  private volatile PsiReference[] myCachedReferences;
+  private volatile long myModCount;
+
+  public XmlAttributeValueImpl() {
+    super(XmlElementType.XML_ATTRIBUTE_VALUE);
+  }
+
+  public void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlAttributeValue(this);
+    }
+    else {
+      visitor.visitElement(this);
+    }
+  }
+
+  public String getValue() {
+    // it is more correct way to strip quotes since injected xml may have quotes encoded
+    String text = getText();
+    ASTNode startQuote = findChildByType(XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER);
+    if (startQuote != null) {
+      text = StringUtil.trimStart(text, startQuote.getText());
+    }
+    ASTNode endQuote = findChildByType(XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER);
+    if (endQuote != null) {
+      text = StringUtil.trimEnd(text, endQuote.getText());
+    }
+    return text;
+  }
+
+  public TextRange getValueTextRange() {
+    final TextRange range = getTextRange();
+    final String value = getValue();
+    if (value.length() == 0) {
+      return range; 
+    }
+    final int start = range.getStartOffset() + getText().indexOf(value);
+    final int end = start + value.length();
+    return new TextRange(start, end);
+  }
+
+  public void clearCaches() {
+    super.clearCaches();
+    myCachedReferences = null;
+  }
+
+  @NotNull
+  public PsiReference[] getReferences() {
+    PsiReference[] cachedReferences = myCachedReferences;
+    final long curModCount = getManager().getModificationTracker().getModificationCount();
+    if (cachedReferences != null && myModCount == curModCount) {
+      return cachedReferences;
+    }
+    cachedReferences = ReferenceProvidersRegistry.getReferencesFromProviders(this, XmlAttributeValue.class);
+    myCachedReferences = cachedReferences;
+    myModCount = curModCount;
+    return cachedReferences;
+  }
+
+  public PsiReference getReference() {
+    final PsiReference[] refs = getReferences();
+    if (refs.length > 0) return refs[0];
+    return null;
+  }
+
+
+  public int getTextOffset() {
+    return getTextRange().getStartOffset() + 1;
+  }
+
+  @Override
+  public boolean isValidHost() {
+    return getParent() instanceof XmlAttributeImpl;
+  }
+
+  public PsiLanguageInjectionHost updateText(@NotNull String text) {
+    try {
+      final String quoteChar = getTextLength() > 0 ? getText().substring(0, 1) : "";
+      String contents = StringUtil.containsAnyChar(quoteChar, "'\"") ?
+              StringUtil.trimEnd(StringUtil.trimStart(text, quoteChar), quoteChar) : text;
+      XmlAttribute newAttribute = XmlElementFactory.getInstance(getProject()).createXmlAttribute("q", contents);
+      XmlAttributeValue newValue = newAttribute.getValueElement();
+
+      CheckUtil.checkWritable(this);
+      replaceAllChildrenToChildrenOf(newValue.getNode());
+    }
+    catch (IncorrectOperationException e) {
+      LOG.error(e);
+    }
+    return this;
+  }
+
+  @NotNull
+  public LiteralTextEscaper<XmlAttributeValueImpl> createLiteralTextEscaper() {
+    return new XmlAttributeLiteralEscaper(this);
+  }
+
+  public PsiMetaData getMetaData() {
+    return this;
+  }
+
+  public PsiElement getDeclaration() {
+    return this;
+  }
+
+  public String getName(final PsiElement context) {
+    return getValue();
+  }
+
+  public String getName() {
+    return getValue();
+  }
+
+  public void init(final PsiElement element) {
+  }
+
+  public Object[] getDependences() {
+    return ArrayUtil.EMPTY_OBJECT_ARRAY;
+  }
+
+  @Override
+  public ItemPresentation getPresentation() {
+    return new ItemPresentationWithSeparator() {
+      @Override
+      public String getPresentableText() {
+        return getText();
+      }
+
+      @Override
+      public String getLocationString() {
+        return SymbolPresentationUtil.getFilePathPresentation(getContainingFile());
+      }
+
+      @Override
+      public Icon getIcon(boolean open) {
+        return null;
+      }
+    };
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlCommentImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlCommentImpl.java
new file mode 100644
index 0000000..9b3faa5
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlCommentImpl.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.psi.*;
+import com.intellij.psi.impl.meta.MetaRegistry;
+import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
+import com.intellij.psi.impl.source.tree.injected.XmlCommentLiteralEscaper;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.meta.PsiMetaOwner;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Mike
+ */
+public class XmlCommentImpl extends XmlElementImpl implements XmlComment, XmlElementType, PsiMetaOwner, PsiLanguageInjectionHost {
+  public XmlCommentImpl() {
+    super(XML_COMMENT);
+  }
+
+  public IElementType getTokenType() {
+    return XML_COMMENT;
+  }
+
+  public void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlComment(this);
+    }
+    else {
+      visitor.visitComment(this);
+    }
+  }
+
+  @Override
+  public boolean isValidHost() {
+    return true;
+  }
+
+  public XmlTag getParentTag() {
+    if(getParent() instanceof XmlTag) return (XmlTag)getParent();
+    return null;
+  }
+
+  public XmlTagChild getNextSiblingInTag() {
+    if(getParent() instanceof XmlTag) return (XmlTagChild)getNextSibling();
+    return null;
+  }
+
+  public XmlTagChild getPrevSiblingInTag() {
+    if(getParent() instanceof XmlTag) return (XmlTagChild)getPrevSibling();
+    return null;
+  }
+
+  @NotNull
+  public PsiReference[] getReferences() {
+    return ReferenceProvidersRegistry.getReferencesFromProviders(this, XmlComment.class);
+  }
+
+  @Nullable
+  public PsiMetaData getMetaData() {
+    return MetaRegistry.getMetaBase(this);
+  }
+
+  public PsiLanguageInjectionHost updateText(@NotNull final String text) {
+    final PsiFile psiFile = getContainingFile();
+
+    final XmlDocument document =
+      ((XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("dummy", psiFile.getFileType(), text)).getDocument();
+    assert document != null;
+
+    final XmlComment comment = PsiTreeUtil.getChildOfType(document, XmlComment.class);
+    
+    assert comment != null;
+    replaceAllChildrenToChildrenOf(comment.getNode());
+
+    return this;
+  }
+
+  @NotNull
+  public LiteralTextEscaper<? extends PsiLanguageInjectionHost> createLiteralTextEscaper() {
+    return new XmlCommentLiteralEscaper(this);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlConditionalSectionImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlConditionalSectionImpl.java
new file mode 100644
index 0000000..426e221
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlConditionalSectionImpl.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.TokenType;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.*;
+
+/**
+ * @author maxim.mossienko
+ */
+public class XmlConditionalSectionImpl extends XmlElementImpl implements XmlConditionalSection {
+  public XmlConditionalSectionImpl() {
+    super(XmlElementType.XML_CONDITIONAL_SECTION);
+  }
+
+  public boolean isIncluded(PsiFile targetFile) {
+    ASTNode child = findChildByType(XmlTokenType.XML_CONDITIONAL_SECTION_START);
+
+    if (child != null) {
+      child = child.getTreeNext();
+
+      if (child != null && child.getElementType() == TokenType.WHITE_SPACE) {
+        child = child.getTreeNext();
+      }
+
+      if (child != null) {
+        IElementType elementType = child.getElementType();
+        if (elementType == XmlTokenType.XML_CONDITIONAL_INCLUDE) return true;
+        if (elementType == XmlTokenType.XML_CONDITIONAL_IGNORE) return false;
+
+        if (elementType == XmlElementType.XML_ENTITY_REF) {
+          XmlEntityRef xmlEntityRef = (XmlEntityRef)child.getPsi();
+
+          final String text = xmlEntityRef.getText();
+          String name = text.substring(1,text.length() - 1);
+
+          PsiElement psiElement = targetFile != null ? XmlEntityRefImpl.getCachedEntity( targetFile, name): null;
+
+          if (psiElement instanceof XmlEntityDecl) {
+            final XmlEntityDecl decl = (XmlEntityDecl)psiElement;
+            
+            if(decl.isInternalReference()) {
+              for (ASTNode e = decl.getNode().getFirstChildNode(); e != null; e = e.getTreeNext()) {
+                if (e.getElementType() == XmlElementType.XML_ATTRIBUTE_VALUE) {
+                  final boolean b = StringUtil.stripQuotesAroundValue(e.getText()).equals("INCLUDE");
+                  return b;
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+    return false;
+  }
+
+  public PsiElement getBodyStart() {
+    ASTNode child = findChildByType(XmlTokenType.XML_MARKUP_START);
+    if (child != null) child = child.getTreeNext();
+    if (child != null) return child.getPsi();
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlContentDFA.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlContentDFA.java
new file mode 100644
index 0000000..cf49e5a
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlContentDFA.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlElementDescriptor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public abstract class XmlContentDFA {
+
+  public abstract List<XmlElementDescriptor> getPossibleElements();
+
+  public abstract void transition(XmlTag xmlTag);
+
+  @Nullable
+  public static XmlContentDFA getContentDFA(@NotNull XmlTag parentTag) {
+    XmlContentDFA contentDFA = XsContentDFA.createContentDFA(parentTag);
+    if (contentDFA != null) return contentDFA;
+    return XmlContentDFAImpl.createContentDFA(parentTag);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlContentDFAImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlContentDFAImpl.java
new file mode 100644
index 0000000..3c4b859
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlContentDFAImpl.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementsGroup;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+class XmlContentDFAImpl extends XmlContentDFA {
+
+  enum Result {
+    NONE,
+    CONSUME,
+    PROCEED_TO_NEXT
+  }
+
+  private final XmlElementsGroup myGroup;
+  private int myOccurs;
+  private XmlContentDFAImpl myLastChild;
+
+  @Nullable
+  public static XmlContentDFA createContentDFA(XmlTag parentTag) {
+    XmlElementDescriptor descriptor = parentTag.getDescriptor();
+    if (descriptor == null) {
+      return null;
+    }
+    XmlElementsGroup topGroup = descriptor.getTopGroup();
+    if (topGroup == null) {
+      return null;
+    }
+    return new XmlContentDFAImpl(topGroup);
+  }
+
+  private XmlContentDFAImpl(@NotNull XmlElementsGroup group) {
+    myGroup = group;
+  }
+
+  @Override
+  public List<XmlElementDescriptor> getPossibleElements() {
+    ArrayList<XmlElementDescriptor> list = new ArrayList<XmlElementDescriptor>();
+    getPossibleElements(list);
+    return list;
+  }
+
+  private void getPossibleElements(List<XmlElementDescriptor> elements) {
+    switch (myGroup.getGroupType()) {
+      case SEQUENCE:
+        getLastChild();
+        while (myLastChild != null) {
+          myLastChild.getPossibleElements(elements);
+          if (myLastChild.myGroup.getMinOccurs() == 0) {
+            myLastChild = getNextSubGroup();
+          }
+          else return;
+        }
+        break;
+      case CHOICE:
+      case ALL:
+      case GROUP:
+        for (XmlElementsGroup group : myGroup.getSubGroups()) {
+          new XmlContentDFAImpl(group).getPossibleElements(elements);
+        }
+        break;
+      case LEAF:
+        ContainerUtil.addIfNotNull(elements, myGroup.getLeafDescriptor());
+        break;
+    }
+  }
+
+  @Override
+  public void transition(XmlTag xmlTag) {
+    XmlElementDescriptor descriptor = xmlTag.getDescriptor();
+    if (descriptor != null) {
+      doTransition(descriptor);
+    }
+  }
+
+  private Result doTransition(@NotNull XmlElementDescriptor element) {
+    if (myGroup.getGroupType() == XmlElementsGroup.Type.LEAF) {
+      if (element.equals(myGroup.getLeafDescriptor())) {
+        return consume();
+      }
+      else return Result.NONE;
+    }
+    return processSubGroups(element);
+  }
+
+  private Result consume() {
+    return ++myOccurs >= myGroup.getMaxOccurs() ? Result.PROCEED_TO_NEXT : Result.CONSUME;
+  }
+
+  private Result processSubGroups(XmlElementDescriptor element) {
+    getLastChild();
+    while (myLastChild != null) {
+      Result result = myLastChild.doTransition(element);
+      switch (result) {
+        case CONSUME:
+          return Result.CONSUME;
+        case NONE:
+          myLastChild = getNextSubGroup();
+          break;
+        case PROCEED_TO_NEXT:
+          myLastChild = getNextSubGroup();
+          return myLastChild == null ? Result.PROCEED_TO_NEXT : Result.CONSUME;
+      }
+    }
+    return Result.NONE;
+  }
+
+  private void getLastChild() {
+    if (myLastChild == null) {
+      List<XmlElementsGroup> subGroups = myGroup.getSubGroups();
+      if (!subGroups.isEmpty()) {
+        myLastChild = new XmlContentDFAImpl(subGroups.get(0));
+      }
+    }
+  }
+
+  @Nullable
+  private XmlContentDFAImpl getNextSubGroup() {
+    List<XmlElementsGroup> subGroups = myGroup.getSubGroups();
+    int i = subGroups.indexOf(myLastChild.myGroup) + 1;
+    return i == subGroups.size() ? null : new XmlContentDFAImpl(subGroups.get(i));
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlContentParticleImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlContentParticleImpl.java
new file mode 100644
index 0000000..e8e85d9
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlContentParticleImpl.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.DtdReferencesProvider;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlContentParticle;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.xml.XmlElementDescriptor;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlContentParticleImpl implements XmlContentParticle, XmlTokenType {
+
+  private final XmlToken myToken;
+
+  public XmlContentParticleImpl(XmlToken token) {
+    myToken = token;
+  }
+
+  @Override
+  public Type getType() {
+    return Type.ELEMENT;
+  }
+
+  @Override
+  public Quantifier getQuantifier() {
+    return getQuantifierImpl(myToken);
+  }
+
+  public static Quantifier getQuantifierImpl(PsiElement element) {
+    PsiElement nextSibling = element.getNextSibling();
+    while (nextSibling instanceof PsiWhiteSpace) {
+      nextSibling = nextSibling.getNextSibling();
+    }
+
+    if (nextSibling instanceof XmlToken) {
+      IElementType tokenType = ((XmlToken)nextSibling).getTokenType();
+      if (tokenType == XML_PLUS) {
+        return Quantifier.ONE_OR_MORE;
+      }
+      else if (tokenType == XML_STAR) {
+        return Quantifier.ZERO_OR_MORE;
+      }
+      else if (tokenType == XML_QUESTION) {
+        return Quantifier.OPTIONAL;
+      }
+    }
+    return Quantifier.REQUIRED;
+  }
+
+  @Override
+  public XmlContentParticle[] getSubParticles() {
+    return new XmlContentParticle[0];
+  }
+
+  @Override
+  public XmlElementDescriptor getElementDescriptor() {
+    return DtdReferencesProvider.resolveElementReference(myToken.getText(), myToken);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDeclImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDeclImpl.java
new file mode 100644
index 0000000..da165b6
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDeclImpl.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.psi.PsiElementVisitor;
+import com.intellij.psi.XmlElementVisitor;
+import com.intellij.psi.xml.XmlDecl;
+import com.intellij.psi.xml.XmlElementType;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Mike
+ */
+public class XmlDeclImpl extends XmlElementImpl implements XmlDecl{
+  public XmlDeclImpl() {
+    super(XmlElementType.XML_DECL);
+  }
+
+  public void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlDecl(this);
+    }
+    else {
+      visitor.visitElement(this);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDoctypeImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDoctypeImpl.java
new file mode 100644
index 0000000..14d0771
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDoctypeImpl.java
@@ -0,0 +1,247 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.injection.InjectedLanguageManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.URLReference;
+import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.tree.ChildRoleBase;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Mike
+ */
+public class XmlDoctypeImpl extends XmlElementImpl implements XmlDoctype {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlDoctypeImpl");
+
+  public XmlDoctypeImpl() {
+    super(XmlElementType.XML_DOCTYPE);
+  }
+
+  public void clearCaches() {
+    final XmlDocument doc = getContainingDocument();
+    if (doc != null) {
+      final XmlTag rootTag = doc.getRootTag();
+      if (rootTag instanceof TreeElement) {
+        ((TreeElement)rootTag).clearCaches();
+      }
+    }
+    super.clearCaches();
+  }
+
+  private XmlDocument getContainingDocument() {
+    for (PsiElement elem = getParent(); elem != null; elem = elem.getParent()) {
+      if (elem instanceof XmlDocument) {
+        return (XmlDocument)elem;
+      }
+      if (elem instanceof PsiFile) {
+        break; // optimization
+      }
+    }
+    return null;
+  }
+  
+  public int getChildRole(ASTNode child) {
+    LOG.assertTrue(child.getTreeParent() == this);
+    IElementType i = child.getElementType();
+    if (i == XmlTokenType.XML_DOCTYPE_PUBLIC) {
+      return XmlChildRole.XML_DOCTYPE_PUBLIC;
+    }
+    else if (i == XmlTokenType.XML_DOCTYPE_SYSTEM) {
+      return XmlChildRole.XML_DOCTYPE_SYSTEM;
+    }
+    else if (i == XmlTokenType.XML_NAME) {
+      return XmlChildRole.XML_NAME;
+    }
+    else {
+      return ChildRoleBase.NONE;
+    }
+  }
+
+  @Nullable
+  public String getDtdUri() {
+    final PsiElement dtdUrlElement = getDtdUrlElement();
+    if (dtdUrlElement == null || dtdUrlElement.getTextLength() == 0) return null;
+    return extractValue(dtdUrlElement);
+  }
+
+  private static String extractValue(PsiElement element) {
+    String text = element.getText();
+    
+    if (!text.startsWith("\"") && !text.startsWith("\'")) {
+      if (hasInjectedEscapingQuotes(element, text)) return stripInjectedEscapingQuotes(text);
+    }
+    return StringUtil.stripQuotesAroundValue(text);
+  }
+
+  // TODO: share common code
+  private static String stripInjectedEscapingQuotes(String text) {
+    return text.substring(2, text.length() - 2);
+  }
+
+  private static boolean hasInjectedEscapingQuotes(PsiElement element, String text) {
+    if (text.startsWith("\\") && text.length() >= 4) {
+      char escapedChar = text.charAt(1);
+      PsiElement context =
+        InjectedLanguageManager.getInstance(element.getContainingFile().getProject()).getInjectionHost(element.getContainingFile());
+      
+      if (context != null && 
+          context.textContains(escapedChar) && 
+          context.getText().startsWith(String.valueOf(escapedChar)) &&
+          text.endsWith("\\"+escapedChar)
+        ) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  @Nullable
+  public PsiElement getDtdUrlElement() {
+    PsiElement docTypePublic = findChildByRoleAsPsiElement(XmlChildRole.XML_DOCTYPE_PUBLIC);
+
+    if (docTypePublic != null){
+      PsiElement element = docTypePublic.getNextSibling();
+
+      while(element instanceof PsiWhiteSpace || element instanceof XmlComment){
+        element = element.getNextSibling();
+      }
+
+      //element = element.getNextSibling(); // pass qoutes
+      if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN){
+        element = element.getNextSibling();
+
+        while(element instanceof PsiWhiteSpace || element instanceof XmlComment){
+          element = element.getNextSibling();
+        }
+
+        if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN){
+          return (XmlElement)element;
+        }
+      }
+    }
+
+    PsiElement docTypeSystem = findChildByRoleAsPsiElement(XmlChildRole.XML_DOCTYPE_SYSTEM);
+
+    if (docTypeSystem != null){
+      PsiElement element = docTypeSystem.getNextSibling();
+
+      //element = element.getNextSibling(); // pass qoutes
+      while(element instanceof PsiWhiteSpace || element instanceof XmlComment){
+        element = element.getNextSibling();
+      }
+
+      if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN){
+        return (XmlElement)element;
+      }
+    }
+
+    return null;
+  }
+
+  public XmlElement getNameElement() {
+    return (XmlElement)findChildByRoleAsPsiElement(XmlChildRole.XML_NAME);
+  }
+
+  @Nullable
+  public String getPublicId() {
+    return getSomeId(XmlChildRole.XML_DOCTYPE_PUBLIC);
+  }
+
+  public String getSystemId() {
+    return getSomeId(XmlChildRole.XML_DOCTYPE_SYSTEM);
+  }
+
+  private String getSomeId(final int role) {
+    PsiElement docTypeSystem = findChildByRoleAsPsiElement(role);
+
+    if (docTypeSystem != null) {
+      PsiElement element = docTypeSystem.getNextSibling();
+
+      while (element instanceof PsiWhiteSpace || element instanceof XmlComment) {
+        element = element.getNextSibling();
+      }
+
+      //element = element.getNextSibling(); // pass qoutes
+      if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN) {
+        if (element.getTextLength() != 0) {
+          return extractValue(element);
+        }
+      }
+    }
+    return null;
+  }
+
+  public void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlDoctype(this);
+    }
+    else {
+      visitor.visitElement(this);
+    }
+  }
+
+  public XmlMarkupDecl getMarkupDecl() {
+    for(PsiElement child = getFirstChild(); child != null; child = child.getNextSibling()){
+      if (child instanceof XmlMarkupDecl){
+        return (XmlMarkupDecl)child;
+      }
+    }
+
+    return null;
+  }
+
+  @NotNull
+  public PsiReference[] getReferences() {
+    final PsiElement dtdUrlElement = getDtdUrlElement();
+
+    PsiReference uriRef = null;
+    if (dtdUrlElement != null) {
+      uriRef = createUrlReference(dtdUrlElement);
+    }
+
+    final PsiReference[] refs = ReferenceProvidersRegistry.getReferencesFromProviders(this);
+
+    return uriRef == null ? refs : ArrayUtil.mergeArrays(new PsiReference[] {uriRef}, refs);
+  }
+
+  protected PsiReference createUrlReference(final PsiElement dtdUrlElement) {
+    return new URLReference(XmlDoctypeImpl.this) {
+      @NotNull
+      public Object[] getVariants() {
+        return findChildByRoleAsPsiElement(XmlChildRole.XML_DOCTYPE_PUBLIC) != null ?
+               super.getVariants(): EMPTY_ARRAY;
+      }
+      @NotNull
+      public String getCanonicalText() {
+        return extractValue(dtdUrlElement);
+      }
+      public TextRange getRangeInElement() {
+        return TextRange.from(dtdUrlElement.getTextRange().getStartOffset() - getTextRange().getStartOffset() + 1, Math.max(dtdUrlElement.getTextRange().getLength() - 2, 0));
+      }
+    };
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDocumentImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDocumentImpl.java
new file mode 100644
index 0000000..c432aab
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDocumentImpl.java
@@ -0,0 +1,464 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.javaee.ExternalResourceManagerEx;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.dtd.DTDLanguage;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.progress.ProcessCanceledException;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.pom.PomManager;
+import com.intellij.pom.PomModel;
+import com.intellij.pom.event.PomModelEvent;
+import com.intellij.pom.impl.PomTransactionBase;
+import com.intellij.pom.xml.XmlAspect;
+import com.intellij.pom.xml.impl.events.XmlDocumentChangedImpl;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.PsiCachedValueImpl;
+import com.intellij.psi.impl.meta.MetaRegistry;
+import com.intellij.psi.impl.source.html.dtd.HtmlNSDescriptorImpl;
+import com.intellij.psi.impl.source.tree.CompositePsiElement;
+import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.meta.PsiMetaOwner;
+import com.intellij.psi.tree.ChildRoleBase;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ConcurrentHashMap;
+import com.intellij.xml.Html5SchemaProvider;
+import com.intellij.xml.XmlExtension;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.index.XmlNamespaceIndex;
+import com.intellij.xml.util.XmlNSDescriptorSequence;
+import com.intellij.xml.util.XmlUtil;
+import gnu.trove.TObjectIntHashMap;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Mike
+ */
+public class XmlDocumentImpl extends XmlElementImpl implements XmlDocument {
+
+  private static final Key<Boolean> AUTO_GENERATED = Key.create("auto-generated xml schema");
+
+  public static boolean isAutoGeneratedSchema(XmlFile file) {
+    return file.getUserData(AUTO_GENERATED) != null;
+  }
+
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlDocumentImpl");
+  private volatile XmlProlog myProlog;
+  private volatile XmlTag myRootTag;
+  private volatile long myExtResourcesModCount = -1;
+
+  public XmlDocumentImpl() {
+    this(XmlElementType.XML_DOCUMENT);
+  }
+
+  protected XmlDocumentImpl(IElementType type) {
+    super(type);
+  }
+
+  public void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlDocument(this);
+    }
+    else {
+      visitor.visitElement(this);
+    }
+  }
+
+  public int getChildRole(ASTNode child) {
+    LOG.assertTrue(child.getTreeParent() == this);
+    IElementType i = child.getElementType();
+    if (i == XmlElementType.XML_PROLOG) {
+      return XmlChildRole.XML_PROLOG;
+    }
+    else if (i == XmlElementType.XML_TAG) {
+      return XmlChildRole.XML_TAG;
+    }
+    else {
+      return ChildRoleBase.NONE;
+    }
+  }
+
+  public XmlProlog getProlog() {
+    XmlProlog prolog = myProlog;
+
+    if (prolog == null) {
+      synchronized (PsiLock.LOCK) {
+        prolog = myProlog;
+        if (prolog == null) {
+          prolog = (XmlProlog)findElementByTokenType(XmlElementType.XML_PROLOG);
+          myProlog = prolog;
+        }
+      }
+    }
+
+    return myProlog;
+  }
+
+  public XmlTag getRootTag() {
+    XmlTag rootTag = myRootTag;
+
+    if (rootTag == null) {
+      synchronized (PsiLock.LOCK) {
+        rootTag = myRootTag;
+        if (rootTag == null) {
+          rootTag = (XmlTag)findElementByTokenType(XmlElementType.XML_TAG);
+          myRootTag = rootTag;
+        }
+      }
+    }
+
+    return myRootTag;
+  }
+
+  @SuppressWarnings("ConstantConditions")
+  public XmlNSDescriptor getRootTagNSDescriptor() {
+    XmlTag rootTag = getRootTag();
+    return rootTag != null ? rootTag.getNSDescriptor(rootTag.getNamespace(), false) : null;
+  }
+
+  private ConcurrentHashMap<String, CachedValue<XmlNSDescriptor>> myDefaultDescriptorsCacheStrict = new ConcurrentHashMap<String, CachedValue<XmlNSDescriptor>>();
+  private ConcurrentHashMap<String, CachedValue<XmlNSDescriptor>> myDefaultDescriptorsCacheNotStrict = new ConcurrentHashMap<String, CachedValue<XmlNSDescriptor>>();
+
+  public void clearCaches() {
+    myDefaultDescriptorsCacheStrict.clear();
+    myDefaultDescriptorsCacheNotStrict.clear();
+    myProlog = null;
+    myRootTag = null;
+    super.clearCaches();
+  }
+
+  public XmlNSDescriptor getDefaultNSDescriptor(final String namespace, final boolean strict) {
+    long curExtResourcesModCount = ExternalResourceManagerEx.getInstanceEx().getModificationCount(getProject());
+    if (myExtResourcesModCount != curExtResourcesModCount) {
+      myDefaultDescriptorsCacheNotStrict.clear();
+      myDefaultDescriptorsCacheStrict.clear();
+      myExtResourcesModCount = curExtResourcesModCount;
+    }
+
+    final ConcurrentHashMap<String, CachedValue<XmlNSDescriptor>> defaultDescriptorsCache;
+    if (strict) {
+      defaultDescriptorsCache = myDefaultDescriptorsCacheStrict;
+    }
+    else {
+      defaultDescriptorsCache = myDefaultDescriptorsCacheNotStrict;
+    }
+
+    CachedValue<XmlNSDescriptor> cachedValue = defaultDescriptorsCache.get(namespace);
+    if (cachedValue == null) {
+      defaultDescriptorsCache.put(namespace, cachedValue = new PsiCachedValueImpl<XmlNSDescriptor>(getManager(), new CachedValueProvider<XmlNSDescriptor>() {
+        public Result<XmlNSDescriptor> compute() {
+          final XmlNSDescriptor defaultNSDescriptorInner = getDefaultNSDescriptorInner(namespace, strict);
+
+          if (isGeneratedFromDtd(defaultNSDescriptorInner)) {
+            return new Result<XmlNSDescriptor>(defaultNSDescriptorInner, XmlDocumentImpl.this, ExternalResourceManager.getInstance());
+          }
+
+          return new Result<XmlNSDescriptor>(defaultNSDescriptorInner, defaultNSDescriptorInner != null
+                                                                       ? defaultNSDescriptorInner.getDependences()
+                                                                       : ExternalResourceManager.getInstance());
+        }
+      }));
+    }
+    return cachedValue.getValue();
+  }
+
+  private boolean isGeneratedFromDtd(XmlNSDescriptor defaultNSDescriptorInner) {
+    if (defaultNSDescriptorInner == null) {
+      return false;
+    }
+    XmlFile descriptorFile = defaultNSDescriptorInner.getDescriptorFile();
+    if (descriptorFile == null) {
+        return false;
+    }
+    @NonNls String otherName = XmlUtil.getContainingFile(this).getName() + ".dtd";
+    return descriptorFile.getName().equals(otherName);
+  }
+
+  private XmlNSDescriptor getDefaultNSDescriptorInner(final String namespace, final boolean strict) {
+    final XmlFile containingFile = XmlUtil.getContainingFile(this);
+    if (containingFile == null) return null;
+    final XmlProlog prolog = getProlog();
+    final XmlDoctype doctype = prolog != null ? prolog.getDoctype() : null;
+    boolean dtdUriFromDocTypeIsNamespace = false;
+
+    if (XmlUtil.HTML_URI.equals(namespace)) {
+      XmlNSDescriptor nsDescriptor = doctype != null ? getNsDescriptorFormDocType(doctype, containingFile, true) : null;
+      if (doctype != null) {
+        LOG.debug(
+          "Descriptor from doctype " + doctype + " is " + (nsDescriptor != null ? nsDescriptor.getClass().getCanonicalName() : "NULL"));
+      }
+
+      if (nsDescriptor == null) {
+        String htmlns = ExternalResourceManagerEx.getInstanceEx().getDefaultHtmlDoctype(getProject());
+        if (htmlns == null || htmlns.length() == 0) {
+          htmlns = Html5SchemaProvider.HTML5_SCHEMA_LOCATION;
+        }
+        nsDescriptor = getDefaultNSDescriptor(htmlns, false);
+      }
+      return new HtmlNSDescriptorImpl(nsDescriptor);
+    }
+    else if (XmlUtil.XHTML_URI.equals(namespace)) {
+      String xhtmlNamespace = XmlUtil.getDefaultXhtmlNamespace(getProject());
+      if (xhtmlNamespace == null || xhtmlNamespace.length() == 0) {
+        xhtmlNamespace = Html5SchemaProvider.XHTML5_SCHEMA_LOCATION;
+      }
+      return getDefaultNSDescriptor(xhtmlNamespace, false);
+    }
+    else if (namespace != null && namespace != XmlUtil.EMPTY_URI) {
+      if (doctype == null || !namespace.equals(XmlUtil.getDtdUri(doctype))) {
+        boolean documentIsSchemaThatDefinesNs = namespace.equals(XmlUtil.getTargetSchemaNsFromTag(getRootTag()));
+
+        final XmlFile xmlFile = documentIsSchemaThatDefinesNs
+                                ? containingFile
+                                : XmlUtil.findNamespace(containingFile, namespace);
+        if (xmlFile != null) {
+          final XmlDocument document = xmlFile.getDocument();
+          if (document != null) {
+            return (XmlNSDescriptor)document.getMetaData();
+          }
+        }
+      } else {
+        dtdUriFromDocTypeIsNamespace = true;
+      }
+    }
+
+    if (strict && !dtdUriFromDocTypeIsNamespace) return null;
+
+    if (doctype != null) {
+      XmlNSDescriptor descr = getNsDescriptorFormDocType(doctype, containingFile, false);
+
+      if (descr != null) {
+        return XmlExtension.getExtension(containingFile).getDescriptorFromDoctype(containingFile, descr);
+      }
+    }
+
+    if (strict) return null;
+    if (namespace == XmlUtil.EMPTY_URI) {
+      final XmlFile xmlFile = XmlUtil.findNamespace(containingFile, namespace);
+      if (xmlFile != null) {
+        return (XmlNSDescriptor)xmlFile.getDocument().getMetaData();
+      }
+    }
+    try {
+      final PsiFile fileFromText = PsiFileFactory.getInstance(getProject())
+        .createFileFromText(containingFile.getName() + ".dtd", DTDLanguage.INSTANCE, XmlUtil.generateDocumentDTD(this, false), false, false);
+      if (fileFromText instanceof XmlFile) {
+        fileFromText.putUserData(AUTO_GENERATED, Boolean.TRUE);
+        return (XmlNSDescriptor)((XmlFile)fileFromText).getDocument().getMetaData();
+      }
+    }
+    catch (ProcessCanceledException ex) {
+      throw ex;
+    }
+    catch (RuntimeException ignored) {
+    } // e.g. dtd isn't mapped to xml type
+
+    return null;
+  }
+  
+  @NotNull
+  private static String getFilePathForLogging(@Nullable PsiFile file) {
+    if (file == null) {
+      return "NULL";
+    }
+    final VirtualFile vFile = file.getVirtualFile();
+    return vFile != null ? vFile.getPath() : "NULL_VFILE";
+  }
+
+  @Nullable
+  private XmlNSDescriptor getNsDescriptorFormDocType(final XmlDoctype doctype, final XmlFile containingFile, final boolean forHtml) {
+    XmlNSDescriptor descriptor = getNSDescriptorFromMetaData(doctype.getMarkupDecl(), true);
+
+    final String filePath = getFilePathForLogging(containingFile);
+
+    final String dtdUri = XmlUtil.getDtdUri(doctype);
+    LOG.debug("DTD url for doctype " + doctype.getText() + " in file " + filePath + " is " + dtdUri);
+    
+    if (dtdUri != null && dtdUri.length() > 0){
+      XmlFile xmlFile = XmlUtil.findNamespace(containingFile, dtdUri);
+      if (xmlFile == null) {
+        // try to auto-detect it
+        xmlFile = XmlNamespaceIndex.guessDtd(dtdUri, containingFile);
+      }
+      final String schemaFilePath = getFilePathForLogging(xmlFile);
+      
+      LOG.debug("Schema file for " + filePath + " is " + schemaFilePath);
+      
+      XmlNSDescriptor descriptorFromDtd = getNSDescriptorFromMetaData(xmlFile == null ? null : xmlFile.getDocument(), forHtml);
+
+      LOG.debug("Descriptor from meta data for schema file " +
+                schemaFilePath +
+                " is " +
+                (descriptorFromDtd != null ? descriptorFromDtd.getClass().getCanonicalName() : "NULL"));
+
+      if (descriptor != null && descriptorFromDtd != null){
+        descriptor = new XmlNSDescriptorSequence(new XmlNSDescriptor[]{descriptor, descriptorFromDtd});
+      }
+      else if (descriptorFromDtd != null) {
+        descriptor = descriptorFromDtd;
+      }
+    }
+    return descriptor;
+  }
+
+  @Nullable
+  private XmlNSDescriptor getNSDescriptorFromMetaData(@Nullable PsiMetaOwner metaOwner, boolean nonEmpty) {
+    if (metaOwner == null) return null;
+    XmlNSDescriptor descriptor = (XmlNSDescriptor)metaOwner.getMetaData();
+    if (descriptor == null) return null;
+    if (nonEmpty && descriptor.getRootElementsDescriptors(this).length == 0) {
+      return null;
+    }
+    return descriptor;
+  }
+
+  public CompositePsiElement clone() {
+    HashMap<String, CachedValue<XmlNSDescriptor>> cacheStrict = new HashMap<String, CachedValue<XmlNSDescriptor>>(
+      myDefaultDescriptorsCacheStrict
+    );
+    HashMap<String, CachedValue<XmlNSDescriptor>> cacheNotStrict = new HashMap<String, CachedValue<XmlNSDescriptor>>(
+      myDefaultDescriptorsCacheNotStrict
+    );
+    final XmlDocumentImpl copy = (XmlDocumentImpl) super.clone();
+    updateSelfDependentDtdDescriptors(copy, cacheStrict, cacheNotStrict);
+    return copy;
+  }
+
+  public PsiElement copy() {
+    HashMap<String, CachedValue<XmlNSDescriptor>> cacheStrict = new HashMap<String, CachedValue<XmlNSDescriptor>>(
+      myDefaultDescriptorsCacheStrict
+    );
+    HashMap<String, CachedValue<XmlNSDescriptor>> cacheNotStrict = new HashMap<String, CachedValue<XmlNSDescriptor>>(
+      myDefaultDescriptorsCacheNotStrict
+    );
+    final XmlDocumentImpl copy = (XmlDocumentImpl)super.copy();
+    updateSelfDependentDtdDescriptors(copy, cacheStrict, cacheNotStrict);
+    return copy;
+  }
+
+  private void updateSelfDependentDtdDescriptors(XmlDocumentImpl copy, HashMap<String,
+    CachedValue<XmlNSDescriptor>> cacheStrict, HashMap<String, CachedValue<XmlNSDescriptor>> cacheNotStrict) {
+    copy.myDefaultDescriptorsCacheNotStrict = new ConcurrentHashMap<String, CachedValue<XmlNSDescriptor>>();
+    copy.myDefaultDescriptorsCacheStrict = new ConcurrentHashMap<String, CachedValue<XmlNSDescriptor>>();
+
+    for(Map.Entry<String, CachedValue<XmlNSDescriptor>> e:cacheStrict.entrySet()) {
+      if (e.getValue().hasUpToDateValue()) {
+        final XmlNSDescriptor nsDescriptor = e.getValue().getValue();
+        if (!isGeneratedFromDtd(nsDescriptor)) copy.myDefaultDescriptorsCacheStrict.put(e.getKey(), e.getValue());
+      }
+    }
+
+    for(Map.Entry<String, CachedValue<XmlNSDescriptor>> e:cacheNotStrict.entrySet()) {
+      if (e.getValue().hasUpToDateValue()) {
+        final XmlNSDescriptor nsDescriptor = e.getValue().getValue();
+        if (!isGeneratedFromDtd(nsDescriptor)) copy.myDefaultDescriptorsCacheNotStrict.put(e.getKey(), e.getValue());
+      }
+    }
+  }
+
+  public PsiMetaData getMetaData() {
+    return MetaRegistry.getMeta(this);
+  }
+
+  @SuppressWarnings({"HardCodedStringLiteral"})
+  public void dumpStatistics(){
+    System.out.println("Statistics:");
+    final TObjectIntHashMap<Object> map = new TObjectIntHashMap<Object>();
+
+    final PsiElementVisitor psiRecursiveElementVisitor = new XmlRecursiveElementVisitor(){
+      @NonNls private static final String TOKENS_KEY = "Tokens";
+      @NonNls private static final String ELEMENTS_KEY = "Elements";
+
+      @Override public void visitXmlToken(XmlToken token) {
+        inc(TOKENS_KEY);
+      }
+
+      @Override public void visitElement(PsiElement element) {
+        inc(ELEMENTS_KEY);
+        super.visitElement(element);
+      }
+
+      private void inc(final String key) {
+        map.put(key, map.get(key) + 1);
+      }
+    };
+
+    accept(psiRecursiveElementVisitor);
+
+    final Object[] keys = map.keys();
+    for (final Object key : keys) {
+      System.out.println(key + ": " + map.get(key));
+    }
+  }
+
+  public TreeElement addInternal(final TreeElement first, final ASTNode last, final ASTNode anchor, final Boolean before) {
+    final PomModel model = PomManager.getModel(getProject());
+    final XmlAspect aspect = model.getModelAspect(XmlAspect.class);
+    final TreeElement[] holder = new TreeElement[1];
+    try{
+      model.runTransaction(new PomTransactionBase(this, aspect) {
+        public PomModelEvent runInner() {
+          holder[0] = XmlDocumentImpl.super.addInternal(first, last, anchor, before);
+          return XmlDocumentChangedImpl.createXmlDocumentChanged(model, XmlDocumentImpl.this);
+        }
+      });
+    }
+    catch(IncorrectOperationException ignored){}
+    return holder[0];
+  }
+
+  public void deleteChildInternal(@NotNull final ASTNode child) {
+    final PomModel model = PomManager.getModel(getProject());
+    final XmlAspect aspect = model.getModelAspect(XmlAspect.class);
+    try{
+      model.runTransaction(new PomTransactionBase(this, aspect) {
+        public PomModelEvent runInner() {
+          XmlDocumentImpl.super.deleteChildInternal(child);
+          return XmlDocumentChangedImpl.createXmlDocumentChanged(model, XmlDocumentImpl.this);
+        }
+      });
+    }
+    catch(IncorrectOperationException ignored){}
+  }
+
+  public void replaceChildInternal(@NotNull final ASTNode child, @NotNull final TreeElement newElement) {
+    final PomModel model = PomManager.getModel(getProject());
+    final XmlAspect aspect = model.getModelAspect(XmlAspect.class);
+    try{
+      model.runTransaction(new PomTransactionBase(this, aspect) {
+        public PomModelEvent runInner() {
+          XmlDocumentImpl.super.replaceChildInternal(child, newElement);
+          return XmlDocumentChangedImpl.createXmlDocumentChanged(model, XmlDocumentImpl.this);
+        }
+      });
+    }
+    catch(IncorrectOperationException ignored){}
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementChangeUtil.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementChangeUtil.java
new file mode 100644
index 0000000..6a48ffe
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementChangeUtil.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: Maxim.Mossienko
+ * Date: Oct 18, 2006
+ * Time: 3:50:51 PM
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.impl.source.SourceTreeToPsiMap;
+import com.intellij.psi.impl.source.tree.Factory;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.IncorrectOperationException;
+
+public class XmlElementChangeUtil {
+  private XmlElementChangeUtil() {}
+
+  static void doNameReplacement(final PsiNamedElement xmlElementDecl, XmlElement nameElement, final String name) throws
+                                                                                                                 IncorrectOperationException {
+    if (xmlElementDecl.isWritable() && isInProjectContent(xmlElementDecl.getProject(), xmlElementDecl.getContainingFile().getVirtualFile())) {
+
+      if (nameElement!=null) {
+        nameElement.replace(
+          SourceTreeToPsiMap.treeElementToPsi(Factory.createSingleLeafElement(XmlTokenType.XML_NAME, name, null, xmlElementDecl.getManager()))
+        );
+      }
+    }
+  }
+
+  static boolean isInProjectContent(Project project, VirtualFile vfile) {
+    return vfile== null || ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(vfile)!=null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementContentGroupImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementContentGroupImpl.java
new file mode 100644
index 0000000..06be625
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementContentGroupImpl.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.NotNullLazyValue;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.xml.XmlContentParticle;
+import com.intellij.psi.xml.XmlElementContentGroup;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlElementDescriptor;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlElementContentGroupImpl  extends XmlElementImpl implements XmlElementContentGroup,
+                                                                           XmlElementType {
+
+  private NotNullLazyValue<XmlContentParticle[]> myParticles = new NotNullLazyValue<XmlContentParticle[]>() {
+    @NotNull
+    @Override
+    protected XmlContentParticle[] compute() {
+      return ContainerUtil.map(getChildren(TokenSet.create(XML_ELEMENT_CONTENT_GROUP, XML_NAME)), new Function<ASTNode, XmlContentParticle>() {
+        @Override
+        public XmlContentParticle fun(ASTNode astNode) {
+          PsiElement element = astNode.getPsi();
+          assert element != null;
+          return element instanceof XmlToken ? new XmlContentParticleImpl((XmlToken)element) : (XmlContentParticle)element;
+        }
+      }, new XmlContentParticle[0]);
+    }
+  };
+
+  public XmlElementContentGroupImpl() {
+    super(XML_ELEMENT_CONTENT_GROUP);
+  }
+
+  @Override
+  public Type getType() {
+    return findElementByTokenType(XML_BAR) == null ? Type.SEQUENCE : Type.CHOICE;
+  }
+
+  @Override
+  public Quantifier getQuantifier() {
+    return XmlContentParticleImpl.getQuantifierImpl(this);
+  }
+
+  @Override
+  public XmlContentParticle[] getSubParticles() {
+    return myParticles.getValue();
+  }
+
+  @Override
+  public XmlElementDescriptor getElementDescriptor() {
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementContentSpecImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementContentSpecImpl.java
new file mode 100644
index 0000000..c060c43
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementContentSpecImpl.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.PsiElementVisitor;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.XmlElementVisitor;
+import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
+import com.intellij.psi.tree.ChildRoleBase;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlElementContentGroup;
+import com.intellij.psi.xml.XmlElementContentSpec;
+import com.intellij.psi.xml.XmlElementType;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Mike
+ */
+public class XmlElementContentSpecImpl extends XmlElementImpl implements XmlElementContentSpec, XmlElementType {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlElementContentSpecImpl");
+
+  public XmlElementContentSpecImpl() {
+    super(XML_ELEMENT_CONTENT_SPEC);
+  }
+
+  public int getChildRole(ASTNode child) {
+    LOG.assertTrue(child.getTreeParent() == this);
+    IElementType i = child.getElementType();
+    if (i == XML_CONTENT_ANY) {
+      return XmlChildRole.XML_CONTENT_ANY;
+    }
+    else if (i == XML_CONTENT_EMPTY) {
+      return XmlChildRole.XML_CONTENT_EMPTY;
+    }
+    else if (i == XML_PCDATA) {
+      return XmlChildRole.XML_PCDATA;
+    }
+    else {
+      return ChildRoleBase.NONE;
+    }
+  }
+
+  public boolean isEmpty() {
+    return findElementByTokenType(XML_CONTENT_EMPTY) != null;
+  }
+
+  public boolean isAny() {
+    return findElementByTokenType(XML_CONTENT_ANY) != null;
+  }
+
+  public boolean isMixed() {
+    XmlElementContentGroup topGroup = getTopGroup();
+    return topGroup != null && ((XmlElementImpl)topGroup).findElementByTokenType(XML_PCDATA) != null;
+  }
+
+  public boolean hasChildren() {
+    return !(isEmpty() || isAny() || isMixed());
+  }
+
+  @Override
+  public XmlElementContentGroup getTopGroup() {
+    return (XmlElementContentGroup)findElementByTokenType(XML_ELEMENT_CONTENT_GROUP);
+  }
+
+  @NotNull
+  public PsiReference[] getReferences() {
+    return ReferenceProvidersRegistry.getReferencesFromProviders(this,XmlElementContentSpec.class);
+  }
+
+  public void accept(@NotNull final PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlElement(this);
+    }
+    else {
+      visitor.visitElement(this);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementDeclImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementDeclImpl.java
new file mode 100644
index 0000000..2685a8b
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementDeclImpl.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.pom.Navigatable;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.impl.meta.MetaRegistry;
+import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.ChildRoleBase;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Mike
+ */
+public class XmlElementDeclImpl extends XmlElementImpl implements XmlElementDecl, XmlElementType {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlElementDeclImpl");
+
+  public XmlElementDeclImpl() {
+    super(XML_ELEMENT_DECL);
+  }
+
+  public int getChildRole(ASTNode child) {
+    LOG.assertTrue(child.getTreeParent() == this);
+    IElementType i = child.getElementType();
+    if (i == XML_NAME) {
+      return XmlChildRole.XML_NAME;
+    }
+    else if (i == XML_ELEMENT_CONTENT_SPEC) {
+      return XmlChildRole.XML_ELEMENT_CONTENT_SPEC;
+    }
+    else {
+      return ChildRoleBase.NONE;
+    }
+  }
+
+  public int getTextOffset() {
+    final XmlElement name = getNameElement();
+    return name != null ? name.getTextOffset() : super.getTextOffset();
+  }
+
+  public XmlElement getNameElement() {
+    return (XmlElement)findChildByRoleAsPsiElement(XmlChildRole.XML_NAME);
+  }
+
+  public XmlElementContentSpec getContentSpecElement() {
+    return (XmlElementContentSpec)findChildByRoleAsPsiElement(XmlChildRole.XML_ELEMENT_CONTENT_SPEC);
+  }
+
+  public PsiMetaData getMetaData() {
+    return MetaRegistry.getMeta(this);
+  }
+
+  public PsiElement setName(@NotNull String name) throws IncorrectOperationException {
+    XmlElementChangeUtil.doNameReplacement(this, getNameElement(), name);
+
+    return null;
+  }
+
+  @NotNull
+  public PsiReference[] getReferences() {
+    return ReferenceProvidersRegistry.getReferencesFromProviders(this,XmlElementDecl.class);
+  }
+  
+  public PsiElement getOriginalElement() {
+    if (isPhysical()) return super.getOriginalElement();
+
+    final PsiNamedElement element = XmlUtil.findRealNamedElement(this);
+
+    if (element != null) {
+      return element;
+    }
+
+    return this;
+  }
+
+  public boolean canNavigate() {
+    if (!isPhysical()) {
+      return getOriginalElement() != this;
+    }
+
+    return super.canNavigate();
+  }
+
+  public void navigate(boolean requestFocus) {
+    if (!isPhysical()) {
+      PsiElement element = getOriginalElement();
+
+      if (element != this) {
+        ((Navigatable)element).navigate(requestFocus);
+        return;
+      }
+    }
+
+    super.navigate(requestFocus);
+  }
+
+  public String getName() {
+    XmlElement xmlElement = getNameElement();
+    if (xmlElement != null) return xmlElement.getText();
+
+    return getNameFromEntityRef(this, XmlElementType.XML_ELEMENT_DECL_START);
+  }
+
+  @Override
+  public boolean isEquivalentTo(final PsiElement another) {
+    if (!(another instanceof XmlElementDecl)) return false;
+    PsiElement element1 = this;
+    PsiElement element2 = another;
+    if (!element1.isPhysical()) element1 = element1.getOriginalElement();
+    if (!element2.isPhysical()) element2 = element2.getOriginalElement();
+
+    return element1 == element2;
+  }
+
+  public PsiElement getNameIdentifier() {
+    return null;
+  }
+
+  @NotNull
+  public PsiElement getNavigationElement() {
+    return this;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementDescriptorProvider.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementDescriptorProvider.java
new file mode 100644
index 0000000..6940bcf
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementDescriptorProvider.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlElementDescriptor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author yole
+ */
+public interface XmlElementDescriptorProvider {
+  ExtensionPointName<XmlElementDescriptorProvider> EP_NAME = ExtensionPointName.create("com.intellij.xml.elementDescriptorProvider");
+
+  @Nullable
+  XmlElementDescriptor getDescriptor(XmlTag tag);
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementImpl.java
new file mode 100644
index 0000000..86b15fb
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlElementImpl.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: mike
+ * Date: Aug 26, 2002
+ * Time: 6:25:08 PM
+ * To change template for new class use 
+ * Code Style | Class Templates options (Tools | IDE Options).
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.Language;
+import com.intellij.psi.PsiAnchor;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.TokenType;
+import com.intellij.psi.impl.source.tree.CompositeElement;
+import com.intellij.psi.impl.source.tree.CompositePsiElement;
+import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.search.SearchScope;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public abstract class XmlElementImpl extends CompositePsiElement implements XmlElement {
+  public XmlElementImpl(IElementType type) {
+    super(type);
+  }
+
+  public boolean processElements(PsiElementProcessor processor, PsiElement place){
+    return XmlUtil.processXmlElements(this, processor, false);
+  }
+
+  public boolean processChildren(PsiElementProcessor processor){
+    return XmlUtil.processXmlElementChildren(this, processor, false);
+  }
+
+  public XmlElement findElementByTokenType(final IElementType type){
+    final XmlElement[] result = new XmlElement[1];
+    result[0] = null;
+
+    processElements(new PsiElementProcessor(){
+      public boolean execute(@NotNull PsiElement element){
+        if(element instanceof TreeElement && ((ASTNode)element).getElementType() == type){
+          result[0] = (XmlElement)element;
+          return false;
+        }
+        return true;
+      }
+    }, this);
+
+    return result[0];
+  }
+
+  public PsiElement getContext() {
+    final XmlElement data = getUserData(INCLUDING_ELEMENT);
+    if(data != null) return data;
+    return getAstParent();
+  }
+
+  private PsiElement getAstParent() {
+    return super.getParent();
+  }
+
+  @Nullable
+  private PsiElement findIncludedRoot() {
+    PsiElement cur = this;
+    while (cur != null && !(cur instanceof PsiFile)) {
+      final PsiElement parent = cur instanceof XmlElementImpl ? ((XmlElementImpl)cur).getAstParent() : cur.getParent();
+      if (parent instanceof PsiFile && cur.getUserData(INCLUDING_ELEMENT) != null) {
+        return cur;
+      }
+
+      cur = parent;
+    }
+    return null;
+  }
+
+  @NotNull
+  public PsiElement getNavigationElement() {
+    if (!isPhysical()) {
+      final PsiElement root = findIncludedRoot();
+      if (root != null) {
+        final PsiAnchor anchor = root.getUserData(XmlUtil.ORIGINAL_ELEMENT);
+        if (anchor != null) {
+          final PsiElement original = anchor.retrieve();
+          if (original != null) {
+            final int endOffset = getTextRange().getEndOffset() + original.getTextRange().getStartOffset();
+
+            PsiElement candidate = original.findElementAt(getTextRange().getStartOffset() - root.getTextRange().getStartOffset());
+            while (candidate != null && candidate.getStartOffsetInParent() == 0 && candidate.getTextRange().getEndOffset() < endOffset) {
+              candidate = candidate.getParent();
+            }
+
+            if (candidate != null && candidate.getTextRange().getEndOffset() == endOffset) {
+              return candidate.getNavigationElement();
+            }
+          }
+        }
+      }
+
+      final XmlElement including = getUserData(INCLUDING_ELEMENT);
+      if (including != null) {
+        return including;
+      }
+      PsiElement astParent = getAstParent();
+      PsiElement parentNavigation = astParent.getNavigationElement();
+      if (parentNavigation.getTextOffset() == getTextOffset()) return parentNavigation;
+      return this;
+    }
+    return super.getNavigationElement();
+  }
+
+  public PsiElement getParent(){
+    return getContext();
+  }
+
+  @NotNull
+  public Language getLanguage() {
+    return getContainingFile().getLanguage();
+  }
+
+  @Nullable
+  protected static String getNameFromEntityRef(final CompositeElement compositeElement, final IElementType xmlEntityDeclStart) {
+    final ASTNode node = compositeElement.findChildByType(xmlEntityDeclStart);
+    if (node == null) return null;
+    ASTNode name = node.getTreeNext();
+
+    if (name != null && name.getElementType() == TokenType.WHITE_SPACE) {
+      name = name.getTreeNext();
+    }
+
+    if (name != null && name.getElementType() == XmlElementType.XML_ENTITY_REF) {
+      final StringBuilder builder = new StringBuilder();
+
+      ((XmlElement)name.getPsi()).processElements(new PsiElementProcessor() {
+        public boolean execute(@NotNull final PsiElement element) {
+          builder.append(element.getText());
+          return true;
+        }
+      }, name.getPsi());
+      if (builder.length() > 0) return builder.toString();
+    }
+    return null;
+  }
+
+  @NotNull
+  public SearchScope getUseScope() {
+    return GlobalSearchScope.allScope(getProject());
+  }
+
+  @Override
+  public boolean isEquivalentTo(final PsiElement another) {
+
+    if (super.isEquivalentTo(another)) return true;
+    PsiElement element1 = this;
+    PsiElement element2 = another;
+
+    // TODO: seem to be only necessary for tag dirs equivalens checking.
+    if (element1 instanceof XmlTag && element2 instanceof XmlTag) {
+      if (!element1.isPhysical() && !element2.isPhysical()) return element1.getText().equals(element2.getText());
+    }
+
+    return false;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlEntityDeclImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlEntityDeclImpl.java
new file mode 100644
index 0000000..59afb95
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlEntityDeclImpl.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.pom.Navigatable;
+import com.intellij.psi.ElementManipulators;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.impl.source.SourceTreeToPsiMap;
+import com.intellij.psi.impl.source.parsing.xml.DtdParsing;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.URIReferenceProvider;
+import com.intellij.psi.tree.xml.IXmlLeafElementType;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author mike
+ */
+public class XmlEntityDeclImpl extends XmlElementImpl implements XmlEntityDecl, XmlElementType {
+  public XmlEntityDeclImpl() {
+    super(XML_ENTITY_DECL);
+  }
+
+  public PsiElement getNameElement() {
+    for (ASTNode e = getFirstChildNode(); e != null; e = e.getTreeNext()) {
+      if (e instanceof XmlTokenImpl) {
+        XmlTokenImpl xmlToken = (XmlTokenImpl)e;
+
+        if (xmlToken.getTokenType() == XmlTokenType.XML_NAME) return xmlToken;
+      }
+    }
+
+    return null;
+  }
+
+  public XmlAttributeValue getValueElement() {
+    if (isInternalReference()) {
+      for (ASTNode e = getFirstChildNode(); e != null; e = e.getTreeNext()) {
+        if (e.getElementType() == XmlElementType.XML_ATTRIBUTE_VALUE) {
+          return (XmlAttributeValue)SourceTreeToPsiMap.treeElementToPsi(e);
+        }
+      }
+    }
+    else {
+      for (ASTNode e = getLastChildNode(); e != null; e = e.getTreePrev()) {
+        if (e.getElementType() == XmlElementType.XML_ATTRIBUTE_VALUE) {
+          return (XmlAttributeValue)SourceTreeToPsiMap.treeElementToPsi(e);
+        }
+      }
+    }
+
+    return null;
+  }
+
+  public String getName() {
+    PsiElement nameElement = getNameElement();
+    return nameElement != null ? nameElement.getText() : "";
+  }
+
+  public PsiElement setName(@NotNull String name) throws IncorrectOperationException {
+    final PsiElement nameElement = getNameElement();
+
+    if (nameElement != null) {
+      return ElementManipulators.getManipulator(nameElement).handleContentChange(
+        nameElement,
+        new TextRange(0,nameElement.getTextLength()),
+        name
+      );
+    }
+    return null;
+  }
+
+  public PsiElement parse(PsiFile baseFile, EntityContextType contextType, final XmlEntityRef originalElement) {
+    PsiElement dep = XmlElement.DEPENDING_ELEMENT.get(getParent());
+    PsiElement dependsOnElement = getValueElement(dep instanceof PsiFile ? (PsiFile)dep : baseFile);
+    String value = null;
+    if (dependsOnElement instanceof XmlAttributeValue) {
+      XmlAttributeValue attributeValue = (XmlAttributeValue)dependsOnElement;
+      value = attributeValue.getValue();
+    }
+    else if (dependsOnElement instanceof PsiFile) {
+      PsiFile file = (PsiFile)dependsOnElement;
+      value = file.getText();
+    }
+
+    if (value == null) return null;
+
+    DtdParsing dtdParsing = new DtdParsing(value, XML_ELEMENT_DECL, contextType, baseFile);
+    PsiElement generated = dtdParsing.parse().getPsi().getFirstChild();
+    if (contextType == EntityContextType.ELEMENT_CONTENT_SPEC && generated instanceof XmlElementContentSpec) {
+      generated = generated.getFirstChild();
+    }
+    setDependsOnElement(generated, dependsOnElement);
+    return setOriginalElement(generated, originalElement);
+  }
+
+  private PsiElement setDependsOnElement(PsiElement generated, PsiElement dependsOnElement) {
+    PsiElement e = generated;
+    while (e != null) {
+      e.putUserData(XmlElement.DEPENDING_ELEMENT, dependsOnElement);
+      e = e.getNextSibling();
+    }
+    return generated;
+  }
+
+  private PsiElement setOriginalElement(PsiElement element, PsiElement valueElement) {
+    PsiElement e = element;
+    while (e != null) {
+      e.putUserData(XmlElement.INCLUDING_ELEMENT, (XmlElement)valueElement);
+      e = e.getNextSibling();
+    }
+    return element;
+  }
+
+  @Nullable
+  private PsiElement getValueElement(PsiFile baseFile) {
+    final XmlAttributeValue attributeValue = getValueElement();
+    if (isInternalReference()) return attributeValue;
+
+    if (attributeValue != null) {
+      final String value = attributeValue.getValue();
+      if (value != null) {
+        XmlFile xmlFile = XmlUtil.findNamespaceByLocation(baseFile, value);
+        if (xmlFile != null) {
+          return xmlFile;
+        }
+
+        final int i = URIReferenceProvider.getPrefixLength(value);
+        if (i > 0) {
+          return XmlUtil.findNamespaceByLocation(baseFile, value.substring(i));
+        }
+      }
+    }
+
+    return null;
+  }
+
+  public boolean isInternalReference() {
+    for (ASTNode e = getFirstChildNode(); e != null; e = e.getTreeNext()) {
+      if (e.getElementType() instanceof IXmlLeafElementType) {
+        XmlToken token = (XmlToken)SourceTreeToPsiMap.treeElementToPsi(e);
+        if (token.getTokenType() == XmlTokenType.XML_DOCTYPE_PUBLIC ||
+            token.getTokenType() == XmlTokenType.XML_DOCTYPE_SYSTEM) {
+          return false;
+        }
+      }
+    }
+
+    return true;
+  }
+
+  @NotNull
+  public PsiElement getNavigationElement() {
+    return getNameElement();
+  }
+
+  public int getTextOffset() {
+    final PsiElement name = getNameElement();
+    return name != null ? name.getTextOffset() : super.getTextOffset();
+  }
+
+  public boolean canNavigate() {
+    if (isPhysical()) return super.canNavigate();
+    final PsiNamedElement psiNamedElement = XmlUtil.findRealNamedElement(this);
+    return psiNamedElement != null;
+  }
+
+  public void navigate(final boolean requestFocus) {
+    if (!isPhysical()) {
+      ((Navigatable)XmlUtil.findRealNamedElement(this)).navigate(requestFocus);
+      return;
+    }
+    super.navigate(requestFocus);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlEntityRefImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlEntityRefImpl.java
new file mode 100644
index 0000000..45b6526
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlEntityRefImpl.java
@@ -0,0 +1,270 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.util.Key;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author mike
+ */
+public class XmlEntityRefImpl extends XmlElementImpl implements XmlEntityRef {
+  private static final Key<Map<String,CachedValue<XmlEntityDecl>>> XML_ENTITY_DECL_MAP = Key.create("XML_ENTITY_DECL_MAP");
+  @NonNls private static final String GT_ENTITY = "&gt;";
+  @NonNls private static final String QUOT_ENTITY = "&quot;";
+
+  public XmlEntityRefImpl() {
+    super(XmlElementType.XML_ENTITY_REF);
+  }
+
+  private static final Key<String> EVALUATION_IN_PROCESS = Key.create("EvalKey");
+
+  public XmlEntityDecl resolve(PsiFile targetFile) {
+    String text = getText();
+    if (text.equals(GT_ENTITY) || text.equals(QUOT_ENTITY)) return null;
+    return resolveEntity(this, text, targetFile);
+  }
+
+  public static XmlEntityDecl getCachedEntity(PsiFile file, String name) {
+    CachedValue<XmlEntityDecl> cachedValue;
+    synchronized(PsiLock.LOCK) {
+      final Map<String, CachedValue<XmlEntityDecl>> cachingMap = getCachingMap(file);
+      cachedValue = cachingMap.get(name);
+    }
+    return cachedValue != null ? cachedValue.getValue():null;
+  }
+
+  public static void cacheParticularEntity(PsiFile file, XmlEntityDecl decl) {
+    synchronized(PsiLock.LOCK) {
+      final Map<String, CachedValue<XmlEntityDecl>> cachingMap = getCachingMap(file);
+      final String name = decl.getName();
+      if (cachingMap.containsKey(name)) return;
+      final SmartPsiElementPointer declPointer = SmartPointerManager.getInstance(file.getProject()).createSmartPsiElementPointer(decl);
+
+      cachingMap.put(
+        name, CachedValuesManager.getManager(file.getProject()).createCachedValue(new CachedValueProvider<XmlEntityDecl>() {
+          public Result<XmlEntityDecl> compute() {
+            PsiElement declElement = declPointer.getElement();
+            if (declElement instanceof XmlEntityDecl && declElement.isValid() && name.equals(((XmlEntityDecl)declElement).getName()))
+              return new Result<XmlEntityDecl>((XmlEntityDecl)declElement, declElement);
+            cachingMap.put(name,null);
+            return new Result<XmlEntityDecl>(null,null);
+          }
+        },
+        false
+      ));
+    }
+  }
+
+  public static XmlEntityDecl resolveEntity(final XmlElement element, final String text, PsiFile targetFile) {
+    if (targetFile instanceof XmlFile) {
+      XmlDocument document = ((XmlFile)targetFile).getDocument();
+      if (document != null && document.getUserData(DISABLE_ENTITY_EXPAND) != null) return null;
+    }
+    
+    final String entityName = text.substring(1, text.length() - 1);
+
+    final PsiElement targetElement = targetFile != null ? targetFile : element;
+    CachedValue<XmlEntityDecl> value;
+    synchronized(PsiLock.LOCK) {
+      Map<String, CachedValue<XmlEntityDecl>> map = getCachingMap(targetElement);
+
+      value = map.get(entityName);
+      final PsiFile containingFile = element.getContainingFile();
+
+      if (value == null) {
+        final PsiManager manager = element.getManager();
+        if(manager == null){
+          return resolveEntity(targetElement, entityName, containingFile).getValue();
+        }
+        value = CachedValuesManager.getManager(manager.getProject()).createCachedValue(new CachedValueProvider<XmlEntityDecl>() {
+          public Result<XmlEntityDecl> compute() {
+            return resolveEntity(targetElement, entityName, containingFile);
+          }
+        });
+
+
+        map.put(entityName, value);
+      }
+    }
+    return value.getValue();
+  }
+
+  private static Map<String, CachedValue<XmlEntityDecl>> getCachingMap(final PsiElement targetElement) {
+    Map<String, CachedValue<XmlEntityDecl>> map = targetElement.getUserData(XML_ENTITY_DECL_MAP);
+    if (map == null){
+      map = new HashMap<String,CachedValue<XmlEntityDecl>>();
+      targetElement.putUserData(XML_ENTITY_DECL_MAP, map);
+    }
+    return map;
+  }
+
+  private static final Key<Boolean> DISABLE_ENTITY_EXPAND = Key.create("disable.entity.expand");
+
+  private static CachedValueProvider.Result<XmlEntityDecl> resolveEntity(final PsiElement targetElement, final String entityName, PsiFile contextFile) {
+    if (targetElement.getUserData(EVALUATION_IN_PROCESS) != null) {
+      return new CachedValueProvider.Result<XmlEntityDecl>(null,targetElement);
+    }
+    try {
+      targetElement.putUserData(EVALUATION_IN_PROCESS, "");
+      final List<PsiElement> deps = new ArrayList<PsiElement>();
+      final XmlEntityDecl[] result = new XmlEntityDecl[]{null};
+
+      PsiElementProcessor processor = new PsiElementProcessor() {
+        public boolean execute(@NotNull PsiElement element) {
+          if (element instanceof XmlDoctype) {
+            XmlDoctype xmlDoctype = (XmlDoctype)element;
+            final String dtdUri = XmlUtil.getDtdUri(xmlDoctype);
+            if (dtdUri != null) {
+              XmlFile file = XmlUtil.getContainingFile(element);
+              if (file == null) return true;
+              final XmlFile xmlFile = XmlUtil.findNamespace(file, dtdUri);
+              if (xmlFile != null) {
+                if (xmlFile != targetElement) {
+                  deps.add(xmlFile);
+                  if(!XmlUtil.processXmlElements(xmlFile, this,true)) return false;
+                }
+              }
+            }
+            final XmlMarkupDecl markupDecl = xmlDoctype.getMarkupDecl();
+            if (markupDecl != null) {
+              if (!XmlUtil.processXmlElements(markupDecl, this, true)) return false;
+            }
+          }
+          else if (element instanceof XmlEntityDecl) {
+            XmlEntityDecl entityDecl = (XmlEntityDecl)element;
+            final String declName = entityDecl.getName();
+            if (declName.equals(entityName)) {
+              result[0] = entityDecl;
+              return false;
+            }
+          }
+
+          return true;
+        }
+      };
+      FileViewProvider provider = targetElement.getContainingFile().getViewProvider();
+      deps.add(provider.getPsi(provider.getBaseLanguage()));
+
+      boolean notfound = PsiTreeUtil.processElements(targetElement, processor);
+      if (notfound) {
+        if (contextFile != targetElement && contextFile != null && contextFile.isValid()) {
+          notfound = PsiTreeUtil.processElements(contextFile, processor);
+        }
+      }
+
+      if (notfound &&       // no dtd ref at all
+          targetElement instanceof XmlFile &&
+          deps.size() == 1 &&
+          ((XmlFile)targetElement).getFileType() != StdFileTypes.DTD
+         ) {
+        XmlDocument document = ((XmlFile)targetElement).getDocument();
+        final XmlTag rootTag = document.getRootTag();
+
+        if (rootTag != null && document.getUserData(DISABLE_ENTITY_EXPAND) == null) {
+          final XmlElementDescriptor descriptor = rootTag.getDescriptor();
+
+            if (descriptor != null && !(descriptor instanceof AnyXmlElementDescriptor)) {
+              PsiElement element = descriptor.getDeclaration();
+              final PsiFile containingFile = element != null ? element.getContainingFile():null;
+              final XmlFile descriptorFile = containingFile instanceof XmlFile ? (XmlFile)containingFile:null;
+
+              if (descriptorFile != null &&
+                  !descriptorFile.getName().equals(((XmlFile)targetElement).getName()+".dtd")) {
+                deps.add(descriptorFile);
+                XmlUtil.processXmlElements(
+                  descriptorFile,
+                  processor,
+                  true
+                );
+              }
+            }
+        }
+      }
+
+      return new CachedValueProvider.Result<XmlEntityDecl>(result[0], ArrayUtil.toObjectArray(deps));
+    }
+    finally {
+      targetElement.putUserData(EVALUATION_IN_PROCESS, null);
+    }
+  }
+
+  public XmlTag getParentTag() {
+    final XmlElement parent = (XmlElement)getParent();
+    if(parent instanceof XmlTag) return (XmlTag)parent;
+    return null;
+  }
+
+  public XmlTagChild getNextSiblingInTag() {
+    PsiElement nextSibling = getNextSibling();
+    if(nextSibling instanceof XmlTagChild) return (XmlTagChild)nextSibling;
+    return null;
+  }
+
+  public XmlTagChild getPrevSiblingInTag() {
+    final PsiElement prevSibling = getPrevSibling();
+    if(prevSibling instanceof XmlTagChild) return (XmlTagChild)prevSibling;
+    return null;
+  }
+
+  @NotNull
+  public PsiReference[] getReferences() {
+    return ReferenceProvidersRegistry.getReferencesFromProviders(this,XmlEntityRef.class);
+  }
+
+  public void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlElement(this);
+    }
+    else {
+      visitor.visitElement(this);
+    }
+  }
+
+  public static void copyEntityCaches(final PsiFile file, final PsiFile context) {
+    synchronized (PsiLock.LOCK) {
+      final Map<String, CachedValue<XmlEntityDecl>> cachingMap = getCachingMap(file);
+      for(Map.Entry<String,CachedValue<XmlEntityDecl>> entry:getCachingMap(context).entrySet()) {
+        cachingMap.put(entry.getKey(), entry.getValue());
+      }
+    }
+
+  }
+
+  public static void setNoEntityExpandOutOfDocument(XmlDocument doc, boolean b) {
+    if (b) doc.putUserData(DISABLE_ENTITY_EXPAND, Boolean.TRUE);
+    else doc.putUserData(DISABLE_ENTITY_EXPAND, null);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlEnumeratedTypeImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlEnumeratedTypeImpl.java
new file mode 100644
index 0000000..2390f7f
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlEnumeratedTypeImpl.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.psi.filters.position.XmlTokenTypeFilter;
+import com.intellij.psi.scope.processor.FilterElementProcessor;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlEnumeratedType;
+import com.intellij.psi.xml.XmlTokenType;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author mike
+ */
+public class XmlEnumeratedTypeImpl extends XmlElementImpl implements XmlEnumeratedType, XmlElementType {
+  public XmlEnumeratedTypeImpl() {
+    super(XML_ENUMERATED_TYPE);
+  }
+
+  public XmlElement[] getEnumeratedValues() {
+    final List<XmlElement> result = new ArrayList<XmlElement>();
+    processElements(new FilterElementProcessor(new XmlTokenTypeFilter(XmlTokenType.XML_NAME), result), this);
+    return result.toArray(new XmlElement[result.size()]);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlFileImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlFileImpl.java
new file mode 100644
index 0000000..6c9fd3c
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlFileImpl.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.xhtml.XHTMLLanguage;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.FileTypeManager;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.source.PsiFileImpl;
+import com.intellij.psi.impl.source.html.ScriptSupportUtil;
+import com.intellij.psi.scope.PsiScopeProcessor;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.search.ProjectScope;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Mike
+ */
+public class XmlFileImpl extends PsiFileImpl implements XmlFile {
+
+  public XmlFileImpl(FileViewProvider viewProvider, IElementType elementType) {
+    super(elementType, elementType, viewProvider);
+  }
+
+  public XmlDocument getDocument() {
+    PsiElement child = getFirstChild();
+    while (child != null) {
+      if (child instanceof XmlDocument) return (XmlDocument)child;
+      child = child.getNextSibling();
+    }
+
+    return null;
+  }
+
+  @Override
+  public XmlTag getRootTag() {
+    XmlDocument document = getDocument();
+    return document == null ? null : document.getRootTag();
+  }
+
+  public boolean processElements(PsiElementProcessor processor, PsiElement place){
+    final XmlDocument document = getDocument();
+    return document == null || document.processElements(processor, place);
+  }
+
+  public void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlFile(this);
+    }
+    else {
+      visitor.visitFile(this);
+    }
+  }
+
+  public String toString() {
+    return "XmlFile:" + getName();
+  }
+
+  private FileType myType = null;
+  @NotNull
+  public FileType getFileType() {
+    if (myType == null) {
+      myType = getLanguage().getAssociatedFileType();
+      if (myType == null) {
+        VirtualFile virtualFile = getOriginalFile().getVirtualFile();
+        myType = virtualFile == null ? FileTypeManager.getInstance().getFileTypeByFileName(getName()) : virtualFile.getFileType();
+      }
+    }
+    return myType;
+  }
+
+  @Override
+  public void clearCaches() {
+    super.clearCaches();
+
+    if (isWebFileType()) {
+      ScriptSupportUtil.clearCaches(this);
+    }
+  }
+
+  private boolean isWebFileType() {
+    return getLanguage() == XHTMLLanguage.INSTANCE || getLanguage() == HTMLLanguage.INSTANCE;
+  }
+
+  public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
+    return super.processDeclarations(processor, state, lastParent, place) &&
+           (!isWebFileType() || ScriptSupportUtil.processDeclarations(this, processor, state, lastParent, place));
+
+  }
+
+  public GlobalSearchScope getFileResolveScope() {
+    return ProjectScope.getAllScope(getProject());
+  }
+
+  @Override
+  public boolean ignoreReferencedElementAccessibility() {
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlMarkupDeclImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlMarkupDeclImpl.java
new file mode 100644
index 0000000..a022992
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlMarkupDeclImpl.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.psi.impl.meta.MetaRegistry;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlMarkupDecl;
+
+/**
+ * @author Mike
+ */
+public class XmlMarkupDeclImpl extends XmlElementImpl implements XmlMarkupDecl {
+  public XmlMarkupDeclImpl() {
+    super(XmlElementType.XML_MARKUP_DECL);
+  }
+
+  public PsiMetaData getMetaData(){
+    return MetaRegistry.getMeta(this);
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlNotationDeclImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlNotationDeclImpl.java
new file mode 100644
index 0000000..e7e07a2
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlNotationDeclImpl.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.xml.*;
+import com.intellij.psi.tree.ChildRoleBase;
+
+/**
+ * @author Mike
+ */
+public class XmlNotationDeclImpl extends XmlElementImpl implements XmlNotationDecl, XmlElementType {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlElementDeclImpl");
+
+  public XmlNotationDeclImpl() {
+    super(XML_NOTATION_DECL);
+  }
+
+  public int getChildRole(ASTNode child) {
+    LOG.assertTrue(child.getTreeParent() == this);
+    if (child.getElementType() == XML_ELEMENT_CONTENT_SPEC) {
+      return XmlChildRole.XML_ELEMENT_CONTENT_SPEC;
+    }
+    else {
+      return ChildRoleBase.NONE;
+    }
+  }
+
+  public XmlElement getNameElement() {
+    return (XmlElement)findChildByRoleAsPsiElement(XmlChildRole.XML_NAME);
+  }
+
+  public XmlElementContentSpec getContentSpecElement() {
+    return (XmlElementContentSpec)findChildByRoleAsPsiElement(XmlChildRole.XML_ELEMENT_CONTENT_SPEC);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlProcessingInstructionImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlProcessingInstructionImpl.java
new file mode 100644
index 0000000..b8c640d
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlProcessingInstructionImpl.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: mike
+ * Date: Jul 31, 2002
+ * Time: 9:03:01 PM
+ * To change template for new class use 
+ * Code Style | Class Templates options (Tools | IDE Options).
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiElementVisitor;
+import com.intellij.psi.XmlElementVisitor;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlProcessingInstruction;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagChild;
+import org.jetbrains.annotations.NotNull;
+
+public class XmlProcessingInstructionImpl extends XmlElementImpl implements XmlProcessingInstruction {
+  public XmlProcessingInstructionImpl() {
+    super(XmlElementType.XML_PROCESSING_INSTRUCTION);
+  }
+
+  public void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlProcessingInstruction(this);
+    }
+    else {
+      visitor.visitElement(this);
+    }
+  }
+
+  public XmlTag getParentTag() {
+    final PsiElement parent = getParent();
+    if(parent instanceof XmlTag) return (XmlTag)parent;
+    return null;
+  }
+
+  public XmlTagChild getNextSiblingInTag() {
+    PsiElement nextSibling = getNextSibling();
+    if(nextSibling instanceof XmlTagChild) return (XmlTagChild)nextSibling;
+    return null;
+  }
+
+  public XmlTagChild getPrevSiblingInTag() {
+    final PsiElement prevSibling = getPrevSibling();
+    if(prevSibling instanceof XmlTagChild) return (XmlTagChild)prevSibling;
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlPrologImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlPrologImpl.java
new file mode 100644
index 0000000..88b5349
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlPrologImpl.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.PsiElementVisitor;
+import com.intellij.psi.XmlElementVisitor;
+import com.intellij.psi.tree.ChildRoleBase;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlDoctype;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlProlog;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Mike
+ */
+public class XmlPrologImpl extends XmlElementImpl implements XmlProlog, XmlElementType {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlPrologImpl");
+
+  public XmlPrologImpl() {
+    super(XML_PROLOG);
+  }
+
+  public void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlProlog(this);
+    }
+    else {
+      visitor.visitElement(this);
+    }
+  }
+
+  public int getChildRole(ASTNode child) {
+    LOG.assertTrue(child.getTreeParent() == this);
+    if (child.getElementType() == XML_DOCTYPE) {
+      return XmlChildRole.XML_DOCTYPE;
+    }
+    else {
+      return ChildRoleBase.NONE;
+    }
+  }
+
+  public XmlDoctype getDoctype() {
+    return (XmlDoctype)findChildByRoleAsPsiElement(XmlChildRole.XML_DOCTYPE);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlPsiPolicy.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlPsiPolicy.java
new file mode 100644
index 0000000..dfe1fd5
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlPsiPolicy.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiElement;
+
+public interface XmlPsiPolicy {
+  ASTNode encodeXmlTextContents(String displayText, PsiElement text);
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlTagImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlTagImpl.java
new file mode 100644
index 0000000..e977301
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlTagImpl.java
@@ -0,0 +1,1287 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.javaee.ExternalResourceManagerEx;
+import com.intellij.javaee.ImplicitNamespaceDescriptorProvider;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtilCore;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.project.DumbService;
+import com.intellij.openapi.util.*;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.pom.PomManager;
+import com.intellij.pom.PomModel;
+import com.intellij.pom.event.PomModelEvent;
+import com.intellij.pom.impl.PomTransactionBase;
+import com.intellij.pom.xml.XmlAspect;
+import com.intellij.pom.xml.impl.events.XmlAttributeSetImpl;
+import com.intellij.pom.xml.impl.events.XmlTagNameChangedImpl;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.meta.MetaRegistry;
+import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
+import com.intellij.psi.impl.source.tree.*;
+import com.intellij.psi.impl.source.tree.Factory;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.meta.PsiMetaOwner;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.tree.ChildRoleBase;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.util.*;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.CharTable;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.PlatformIcons;
+import com.intellij.util.containers.BidirectionalMap;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlExtension;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.impl.dtd.XmlNSDescriptorImpl;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import com.intellij.xml.index.XmlNamespaceIndex;
+import com.intellij.xml.util.XmlTagUtil;
+import com.intellij.xml.util.XmlUtil;
+import gnu.trove.THashMap;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.util.*;
+
+/**
+ * @author Mike
+ */
+
+public class XmlTagImpl extends XmlElementImpl implements XmlTag {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlTagImpl");
+
+  private volatile String myName = null;
+  private volatile String myLocalName;
+  private volatile XmlAttribute[] myAttributes = null;
+  private volatile Map<String, String> myAttributeValueMap = null;
+  private volatile XmlTagValue myValue = null;
+  private volatile Map<String, CachedValue<XmlNSDescriptor>> myNSDescriptorsMap = null;
+  private volatile String myCachedNamespace;
+  private volatile long myModCount;
+
+  private volatile XmlElementDescriptor myCachedDescriptor;
+  private volatile long myDescriptorModCount = -1;
+  private volatile long myExtResourcesModCount = -1;
+
+  private volatile boolean myHaveNamespaceDeclarations = false;
+  private volatile BidirectionalMap<String, String> myNamespaceMap = null;
+  @NonNls private static final String XML_NS_PREFIX = "xml";
+
+  private final int myHC = ourHC++;
+  private static final RecursionGuard ourGuard = RecursionManager.createGuard("xmlTag");
+
+  private static final Key<ParameterizedCachedValue<XmlTag[], XmlTagImpl>> SUBTAGS_KEY = Key.create("subtags");
+  private static final ParameterizedCachedValueProvider<XmlTag[],XmlTagImpl> CACHED_VALUE_PROVIDER =
+    new ParameterizedCachedValueProvider<XmlTag[], XmlTagImpl>() {
+      @Override
+      public CachedValueProvider.Result<XmlTag[]> compute(XmlTagImpl tag) {
+        final List<XmlTag> result = new ArrayList<XmlTag>();
+
+        tag.fillSubTags(result);
+
+        final int s = result.size();
+        XmlTag[] tags = s > 0 ? ContainerUtil.toArray(result, new XmlTag[s]) : EMPTY;
+        return CachedValueProvider.Result
+          .create(tags, PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT, tag.getContainingFile());
+      }
+    };
+
+  @Override
+  public final int hashCode() {
+    return myHC;
+  }
+
+  public XmlTagImpl() {
+    this(XmlElementType.XML_TAG);
+  }
+
+  protected XmlTagImpl(IElementType type) {
+    super(type);
+  }
+
+  public void clearCaches() {
+    myName = null;
+    myLocalName = null;
+    myNamespaceMap = null;
+    myCachedNamespace = null;
+    myCachedDescriptor = null;
+    myDescriptorModCount = -1;
+    myAttributes = null;
+    myAttributeValueMap = null;
+    myHaveNamespaceDeclarations = false;
+    myValue = null;
+    myNSDescriptorsMap = null;
+    super.clearCaches();
+  }
+
+  @NotNull
+  public PsiReference[] getReferences() {
+    ProgressManager.checkCanceled();
+    final ASTNode startTagName = XmlChildRole.START_TAG_NAME_FINDER.findChild(this);
+    if (startTagName == null) return PsiReference.EMPTY_ARRAY;
+    final ASTNode endTagName = XmlChildRole.CLOSING_TAG_NAME_FINDER.findChild(this);
+    List<PsiReference> refs = new ArrayList<PsiReference>();
+    String prefix = getNamespacePrefix();
+
+    TagNameReference startTagRef = TagNameReference.createTagNameReference(this, startTagName, true);
+    if (startTagRef != null) {
+      refs.add(startTagRef);
+    }
+    if (prefix.length() > 0) {
+      refs.add(createPrefixReference(startTagName, prefix, startTagRef));
+    }
+    if (endTagName != null) {
+      TagNameReference endTagRef = TagNameReference.createTagNameReference(this, endTagName, false);
+      if (endTagRef != null) {
+        refs.add(endTagRef);
+      }
+      prefix = XmlUtil.findPrefixByQualifiedName(endTagName.getText());
+      if (StringUtil.isNotEmpty(prefix)) {
+        refs.add(createPrefixReference(endTagName, prefix, endTagRef));
+      }
+    }
+
+
+    // ArrayList.addAll() makes a clone of the collection
+    //noinspection ManualArrayToCollectionCopy
+    for (PsiReference ref : ReferenceProvidersRegistry.getReferencesFromProviders(this, XmlTag.class)) {
+      refs.add(ref);
+    }
+
+    return ContainerUtil.toArray(refs, new PsiReference[refs.size()]);
+  }
+
+  private SchemaPrefixReference createPrefixReference(ASTNode startTagName, String prefix, TagNameReference tagRef) {
+    return new SchemaPrefixReference(this, TextRange.from(startTagName.getStartOffset() - getStartOffset(), prefix.length()), prefix, tagRef);
+  }
+
+  public XmlNSDescriptor getNSDescriptor(final String namespace, boolean strict) {
+    final XmlTag parentTag = getParentTag();
+
+    if (parentTag == null && namespace.equals(XmlUtil.XHTML_URI)) {
+      final XmlNSDescriptor descriptor = getDtdDescriptor(XmlUtil.getContainingFile(this));
+      if (descriptor != null) {
+        return descriptor;
+      }
+    }
+
+    Map<String, CachedValue<XmlNSDescriptor>> map = initNSDescriptorsMap();
+    final CachedValue<XmlNSDescriptor> descriptor = map.get(namespace);
+    if (descriptor != null) {
+      final XmlNSDescriptor value = descriptor.getValue();
+      if (value != null) {
+        return value;
+      }
+    }
+
+    if (parentTag == null) {
+      final XmlDocument parentOfType = PsiTreeUtil.getParentOfType(this, XmlDocument.class);
+      if (parentOfType == null) {
+        return null;
+      }
+      return parentOfType.getDefaultNSDescriptor(namespace, strict);
+    }
+
+    return parentTag.getNSDescriptor(namespace, strict);
+  }
+
+  @Nullable
+  private static XmlNSDescriptor getDtdDescriptor(@NotNull XmlFile containingFile) {
+    final XmlDocument document = containingFile.getDocument();
+    if (document == null) {
+      return null;
+    }
+    final String url = XmlUtil.getDtdUri(document);
+    if (url == null) {
+      return null;
+    }
+    return document.getDefaultNSDescriptor(url, true);
+  }
+
+  public boolean isEmpty() {
+    return XmlChildRole.CLOSING_TAG_START_FINDER.findChild(this) == null;
+  }
+
+  public void collapseIfEmpty() {
+    final XmlTag[] tags = getSubTags();
+    if (tags.length > 0) {
+      return;
+    }
+    final ASTNode closingName = XmlChildRole.CLOSING_TAG_NAME_FINDER.findChild(this);
+    final ASTNode startTagEnd = XmlChildRole.START_TAG_END_FINDER.findChild(this);
+    if (closingName == null || startTagEnd == null) {
+      return;
+    }
+
+    final PomModel pomModel = PomManager.getModel(getProject());
+    final PomTransactionBase transaction = new PomTransactionBase(this, pomModel.getModelAspect(XmlAspect.class)) {
+
+      @Nullable
+      public PomModelEvent runInner() {
+        final ASTNode closingBracket = closingName.getTreeNext();
+        removeRange(startTagEnd, closingBracket);
+        final LeafElement emptyTagEnd = Factory.createSingleLeafElement(XmlTokenType.XML_EMPTY_ELEMENT_END, "/>", 0, 2, null, getManager());
+        replaceChild(closingBracket, emptyTagEnd);
+        return null;
+      }
+    };
+    try {
+      pomModel.runTransaction(transaction);
+    }
+    catch (IncorrectOperationException e) {
+      LOG.error(e);
+    }
+  }
+
+  @Nullable
+  @NonNls
+  public String getSubTagText(@NonNls String qname) {
+    final XmlTag tag = findFirstSubTag(qname);
+    if (tag == null) return null;
+    return tag.getValue().getText();
+  }
+
+  protected final Map<String, CachedValue<XmlNSDescriptor>> initNSDescriptorsMap() {
+    Map<String, CachedValue<XmlNSDescriptor>> map = myNSDescriptorsMap;
+    if (map == null) {
+      RecursionGuard.StackStamp stamp = ourGuard.markStack();
+      map = computeNsDescriptorMap();
+      if (stamp.mayCacheNow()) {
+        myNSDescriptorsMap = map;
+      }
+    }
+    return map;
+  }
+
+  @NotNull
+  private Map<String, CachedValue<XmlNSDescriptor>> computeNsDescriptorMap() {
+    Map<String, CachedValue<XmlNSDescriptor>> map = null;
+    // XSD aware attributes processing
+
+    final String noNamespaceDeclaration = getAttributeValue("noNamespaceSchemaLocation", XmlUtil.XML_SCHEMA_INSTANCE_URI);
+    final String schemaLocationDeclaration = getAttributeValue("schemaLocation", XmlUtil.XML_SCHEMA_INSTANCE_URI);
+
+    if (noNamespaceDeclaration != null) {
+      map = initializeSchema(XmlUtil.EMPTY_URI, null, noNamespaceDeclaration, map);
+    }
+    if (schemaLocationDeclaration != null) {
+      final StringTokenizer tokenizer = new StringTokenizer(schemaLocationDeclaration);
+      while (tokenizer.hasMoreTokens()) {
+        final String uri = tokenizer.nextToken();
+        if (tokenizer.hasMoreTokens()) {
+          map = initializeSchema(uri, null, tokenizer.nextToken(), map);
+        }
+      }
+    }
+    // namespace attributes processing (XSD declaration via ExternalResourceManager)
+
+    if (hasNamespaceDeclarations()) {
+      for (final XmlAttribute attribute : getAttributes()) {
+        if (attribute.isNamespaceDeclaration()) {
+          String ns = attribute.getValue();
+          if (ns == null) ns = XmlUtil.EMPTY_URI;
+          ns = getRealNs(ns);
+
+          if (map == null || !map.containsKey(ns)) {
+            map = initializeSchema(ns, getNSVersion(ns, this), getNsLocation(ns), map);
+          }
+        }
+      }
+    }
+    return map == null ? Collections.<String, CachedValue<XmlNSDescriptor>>emptyMap() : map;
+  }
+
+  @Nullable
+  private static String getNSVersion(String ns, final XmlTagImpl xmlTag) {
+    String versionValue = xmlTag.getAttributeValue("version");
+    if (versionValue != null && xmlTag.getNamespace().equals(ns)) {
+      return versionValue;
+    }
+    return null;
+  }
+
+  private Map<String, CachedValue<XmlNSDescriptor>> initializeSchema(final String namespace,
+                                                                     @Nullable final String version,
+                                                                     final String fileLocation,
+                                                                     Map<String, CachedValue<XmlNSDescriptor>> map) {
+    if (map == null) map = new THashMap<String, CachedValue<XmlNSDescriptor>>();
+
+    // We put cached value in any case to cause its value update on e.g. mapping change
+    map.put(namespace, CachedValuesManager.getManager(getManager().getProject()).createCachedValue(new CachedValueProvider<XmlNSDescriptor>() {
+      public Result<XmlNSDescriptor> compute() {
+        XmlNSDescriptor descriptor = getImplicitNamespaceDescriptor(fileLocation);
+        if (descriptor != null) {
+          return new Result<XmlNSDescriptor>(descriptor, ArrayUtil.append(descriptor.getDependences(), XmlTagImpl.this));
+        }
+
+        XmlFile currentFile = retrieveFile(fileLocation, version, namespace);
+        if (currentFile == null) {
+          final XmlDocument document = XmlUtil.getContainingFile(XmlTagImpl.this).getDocument();
+          if (document != null) {
+            final String uri = XmlUtil.getDtdUri(document);
+            if (uri != null) {
+              final XmlFile containingFile = XmlUtil.getContainingFile(document);
+              final XmlFile xmlFile = XmlUtil.findNamespace(containingFile, uri);
+              descriptor = xmlFile == null ? null : (XmlNSDescriptor)xmlFile.getDocument().getMetaData();
+            }
+
+            // We want to get fixed xmlns attr from dtd and check its default with requested namespace
+            if (descriptor instanceof XmlNSDescriptorImpl) {
+              final XmlElementDescriptor elementDescriptor = descriptor.getElementDescriptor(XmlTagImpl.this);
+              if (elementDescriptor != null) {
+                final XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("xmlns", XmlTagImpl.this);
+                if (attributeDescriptor != null && attributeDescriptor.isFixed()) {
+                  final String defaultValue = attributeDescriptor.getDefaultValue();
+                  if (defaultValue != null && defaultValue.equals(namespace)) {
+                    return new Result<XmlNSDescriptor>(descriptor, descriptor.getDependences(), XmlTagImpl.this,
+                                                       ExternalResourceManager.getInstance());
+                  }
+                }
+              }
+            }
+          }
+        }
+        PsiMetaOwner currentOwner = retrieveOwner(currentFile, namespace);
+        if (currentOwner != null) {
+          descriptor = (XmlNSDescriptor)currentOwner.getMetaData();
+          if (descriptor != null) {
+            return new Result<XmlNSDescriptor>(descriptor, descriptor.getDependences(), XmlTagImpl.this,
+                                               ExternalResourceManager.getInstance());
+          }
+        }
+        return new Result<XmlNSDescriptor>(null, XmlTagImpl.this, currentFile, ExternalResourceManager.getInstance());
+      }
+    }, false));
+
+    return map;
+  }
+
+  @Nullable
+  private XmlNSDescriptor getImplicitNamespaceDescriptor(String ns) {
+    PsiFile file = getContainingFile();
+    if (file == null) return null;
+    Module module = ModuleUtilCore.findModuleForPsiElement(file);
+    if (module != null) {
+      for (ImplicitNamespaceDescriptorProvider provider : Extensions.getExtensions(ImplicitNamespaceDescriptorProvider.EP_NAME)) {
+        XmlNSDescriptor nsDescriptor = provider.getNamespaceDescriptor(module, ns, file);
+        if (nsDescriptor != null) return nsDescriptor;
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  private XmlFile retrieveFile(final String fileLocation, final String version, String namespace) {
+    final String targetNs = XmlUtil.getTargetSchemaNsFromTag(this);
+    if (fileLocation.equals(targetNs)) {
+      return null;
+    }
+
+    final XmlFile file = XmlUtil.getContainingFile(this);
+    final PsiFile psiFile = ExternalResourceManager.getInstance().getResourceLocation(fileLocation, file, version);
+    if (psiFile instanceof XmlFile) {
+      return (XmlFile)psiFile;
+    }
+
+    return XmlNamespaceIndex.guessSchema(namespace, myLocalName, version, file);
+  }
+
+  @Nullable
+  private PsiMetaOwner retrieveOwner(final XmlFile file, final String namespace) {
+    if (file == null) {
+      return namespace.equals(XmlUtil.getTargetSchemaNsFromTag(this)) ? this : null;
+    }
+    return file.getDocument();
+  }
+
+  public PsiReference getReference() {
+    return ArrayUtil.getFirstElement(getReferences());
+  }
+
+  public XmlElementDescriptor getDescriptor() {
+    final long curModCount = getManager().getModificationTracker().getModificationCount();
+    long curExtResourcesModCount = ExternalResourceManagerEx.getInstanceEx().getModificationCount(getProject());
+    if (myDescriptorModCount != curModCount || myExtResourcesModCount != curExtResourcesModCount) {
+      if (myExtResourcesModCount != curExtResourcesModCount) {
+        myNSDescriptorsMap = null;
+      }
+      RecursionGuard.StackStamp stamp = ourGuard.markStack();
+      XmlElementDescriptor descriptor = computeElementDescriptor();
+      if (!stamp.mayCacheNow()) {
+        return descriptor;
+      }
+
+      myCachedDescriptor = descriptor;
+      myDescriptorModCount = curModCount;
+      myExtResourcesModCount = curExtResourcesModCount;
+    }
+    return myCachedDescriptor;
+  }
+
+  @Nullable
+  protected XmlElementDescriptor computeElementDescriptor() {
+    for (XmlElementDescriptorProvider provider : Extensions.getExtensions(XmlElementDescriptorProvider.EP_NAME)) {
+      XmlElementDescriptor elementDescriptor = provider.getDescriptor(this);
+      if (elementDescriptor != null) {
+        return elementDescriptor;
+      }
+    }
+
+    final String namespace = getNamespace();
+    if (XmlUtil.EMPTY_URI.equals(namespace)) { //nonqualified items
+      final XmlTag parent = getParentTag();
+      if (parent != null) {
+        final XmlElementDescriptor descriptor = parent.getDescriptor();
+        if (descriptor != null) {
+          XmlElementDescriptor fromParent = descriptor.getElementDescriptor(this, parent);
+          if (fromParent != null && !(fromParent instanceof AnyXmlElementDescriptor)) {
+            return fromParent;
+          }
+        }
+      }
+    }
+
+    XmlElementDescriptor elementDescriptor = null;
+    final XmlNSDescriptor nsDescriptor = getNSDescriptor(namespace, false);
+
+    if (LOG.isDebugEnabled()) {
+      LOG.debug(
+        "Descriptor for namespace " + namespace + " is " + (nsDescriptor != null ? nsDescriptor.getClass().getCanonicalName() : "NULL"));
+    }
+
+    if (nsDescriptor != null) {
+      if (!DumbService.getInstance(getProject()).isDumb() || DumbService.isDumbAware(nsDescriptor)) {
+        elementDescriptor = nsDescriptor.getElementDescriptor(this);
+      }
+    }
+    if (elementDescriptor == null) {
+      return XmlUtil.findXmlDescriptorByType(this);
+    }
+
+    return elementDescriptor;
+  }
+
+  public int getChildRole(ASTNode child) {
+    LOG.assertTrue(child.getTreeParent() == this);
+    IElementType i = child.getElementType();
+    if (i == XmlTokenType.XML_NAME || i == XmlTokenType.XML_TAG_NAME) {
+      return XmlChildRole.XML_TAG_NAME;
+    }
+    else if (i == XmlElementType.XML_ATTRIBUTE) {
+      return XmlChildRole.XML_ATTRIBUTE;
+    }
+    else {
+      return ChildRoleBase.NONE;
+    }
+  }
+
+  @NotNull
+  public String getName() {
+    String name = myName;
+    if (name == null) {
+      final ASTNode nameElement = XmlChildRole.START_TAG_NAME_FINDER.findChild(this);
+      if (nameElement != null) {
+        name = nameElement.getText();
+      }
+      else {
+        name = "";
+      }
+      myName = name;
+    }
+    return name;
+  }
+
+  public PsiElement setName(@NotNull final String name) throws IncorrectOperationException {
+    final PomModel model = PomManager.getModel(getProject());
+    final XmlAspect aspect = model.getModelAspect(XmlAspect.class);
+    model.runTransaction(new PomTransactionBase(this, aspect) {
+      public PomModelEvent runInner() throws IncorrectOperationException {
+        final String oldName = getName();
+        final XmlTagImpl dummyTag =
+          (XmlTagImpl)XmlElementFactory.getInstance(getProject()).createTagFromText(XmlTagUtil.composeTagText(name, "aa"));
+        final XmlTagImpl tag = XmlTagImpl.this;
+        final CharTable charTableByTree = SharedImplUtil.findCharTableByTree(tag);
+        ASTNode child = XmlChildRole.START_TAG_NAME_FINDER.findChild(tag);
+        LOG.assertTrue(child != null, "It seems '" + name + "' is not a valid tag name");
+        TreeElement tagElement = (TreeElement)XmlChildRole.START_TAG_NAME_FINDER.findChild(dummyTag);
+        LOG.assertTrue(tagElement != null, "What's wrong with it? '" + name + "'");
+        tag.replaceChild(child, ChangeUtil.copyElement(tagElement, charTableByTree));
+        final ASTNode childByRole = XmlChildRole.CLOSING_TAG_NAME_FINDER.findChild(tag);
+        if (childByRole != null) {
+          final TreeElement treeElement = (TreeElement)XmlChildRole.CLOSING_TAG_NAME_FINDER.findChild(dummyTag);
+          if (treeElement != null) {
+            tag.replaceChild(childByRole, ChangeUtil.copyElement(treeElement, charTableByTree));
+          }
+        }
+
+        return XmlTagNameChangedImpl.createXmlTagNameChanged(model, tag, oldName);
+      }
+    });
+    return this;
+  }
+
+  @NotNull
+  public XmlAttribute[] getAttributes() {
+    XmlAttribute[] attributes = myAttributes;
+    if (attributes == null) {
+      Map<String, String> attributesValueMap = new THashMap<String, String>();
+      attributes = calculateAttributes(attributesValueMap);
+      myAttributeValueMap = attributesValueMap;
+      myAttributes = attributes;
+    }
+    return attributes;
+  }
+
+  @NotNull
+  private XmlAttribute[] calculateAttributes(final Map<String, String> attributesValueMap) {
+    final List<XmlAttribute> result = new ArrayList<XmlAttribute>(10);
+    processChildren(new PsiElementProcessor() {
+      public boolean execute(@NotNull PsiElement element) {
+        if (element instanceof XmlAttribute) {
+          XmlAttribute attribute = (XmlAttribute)element;
+          result.add(attribute);
+          cacheOneAttributeValue(attribute.getName(), attribute.getValue(), attributesValueMap);
+          myHaveNamespaceDeclarations = myHaveNamespaceDeclarations || attribute.isNamespaceDeclaration();
+        }
+        else if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_TAG_END) {
+          return false;
+        }
+        return true;
+      }
+    });
+    if (result.isEmpty()) {
+      return XmlAttribute.EMPTY_ARRAY;
+    }
+    else {
+      return ContainerUtil.toArray(result, new XmlAttribute[result.size()]);
+    }
+  }
+
+  protected void cacheOneAttributeValue(String name, String value, final Map<String, String> attributesValueMap) {
+    attributesValueMap.put(name, value);
+  }
+
+  public String getAttributeValue(String qname) { //todo ?
+    Map<String, String> map = myAttributeValueMap;
+    while (map == null) {
+      getAttributes();
+      map = myAttributeValueMap;
+
+      if (map == null) {
+        myAttributes = null;
+      }
+    }
+    return map.get(qname);
+  }
+
+  public String getAttributeValue(String _name, String namespace) {
+    if (namespace == null) {
+      return getAttributeValue(_name);
+    }
+
+    XmlTagImpl current = this;
+    PsiElement parent = getParent();
+
+    while (current != null) {
+      BidirectionalMap<String, String> map = current.initNamespaceMaps(parent);
+      if (map != null) {
+        List<String> keysByValue = map.getKeysByValue(namespace);
+        if (keysByValue != null && !keysByValue.isEmpty()) {
+
+          for (String prefix : keysByValue) {
+            if (prefix != null && prefix.length() > 0) {
+              final String value = getAttributeValue(prefix + ":" + _name);
+              if (value != null) return value;
+            }
+          }
+        }
+      }
+
+      current = parent instanceof XmlTag ? (XmlTagImpl)parent : null;
+      parent = parent.getParent();
+    }
+
+    if (namespace.length() == 0 || getNamespace().equals(namespace)) {
+      return getAttributeValue(_name);
+    }
+    return null;
+  }
+
+  @NotNull
+  public XmlTag[] getSubTags() {
+    return CachedValuesManager.getManager(getProject()).getParameterizedCachedValue(this, SUBTAGS_KEY, CACHED_VALUE_PROVIDER, false, this);
+  }
+
+  protected void fillSubTags(final List<XmlTag> result) {
+    processElements(new PsiElementProcessor() {
+      public boolean execute(@NotNull PsiElement element) {
+        if (element instanceof XmlTag) {
+          assert element.isValid();
+          result.add((XmlTag)element);
+        }
+        return true;
+      }
+    }, this);
+  }
+
+  @NotNull
+  public XmlTag[] findSubTags(String name) {
+    return findSubTags(name, null);
+  }
+
+  @NotNull
+  public XmlTag[] findSubTags(final String name, @Nullable final String namespace) {
+    final XmlTag[] subTags = getSubTags();
+    final List<XmlTag> result = new ArrayList<XmlTag>();
+    for (final XmlTag subTag : subTags) {
+      if (namespace == null) {
+        if (name.equals(subTag.getName())) result.add(subTag);
+      }
+      else if (name.equals(subTag.getLocalName()) && namespace.equals(subTag.getNamespace())) {
+        result.add(subTag);
+      }
+    }
+    return ContainerUtil.toArray(result, new XmlTag[result.size()]);
+  }
+
+  public XmlTag findFirstSubTag(String name) {
+    final XmlTag[] subTags = findSubTags(name);
+    if (subTags.length > 0) return subTags[0];
+    return null;
+  }
+
+  public XmlAttribute getAttribute(String name, String namespace) {
+    if (name != null && name.indexOf(':') != -1 ||
+        namespace == null ||
+        XmlUtil.EMPTY_URI.equals(namespace) ||
+        XmlUtil.ANY_URI.equals(namespace)) {
+      return getAttribute(name);
+    }
+
+    final String prefix = getPrefixByNamespace(namespace);
+    if (prefix == null || prefix.length() == 0) return null;
+    return getAttribute(prefix + ":" + name);
+  }
+
+  @Nullable
+  public XmlAttribute getAttribute(String qname) {
+    if (qname == null) return null;
+    final XmlAttribute[] attributes = getAttributes();
+
+    final boolean caseSensitive = isCaseSensitive();
+
+    for (final XmlAttribute attribute : attributes) {
+      final LeafElement attrNameElement = (LeafElement)XmlChildRole.ATTRIBUTE_NAME_FINDER.findChild(attribute.getNode());
+      if (attrNameElement != null &&
+          (caseSensitive && Comparing.equal(attrNameElement.getChars(), qname) ||
+           !caseSensitive && Comparing.equal(attrNameElement.getChars(), qname, false))) {
+        return attribute;
+      }
+    }
+    return null;
+  }
+
+  protected boolean isCaseSensitive() {
+    return true;
+  }
+
+  @NotNull
+  public String getNamespace() {
+    String cachedNamespace = myCachedNamespace;
+    final long curModCount = getManager().getModificationTracker().getModificationCount();
+    if (cachedNamespace != null && myModCount == curModCount) {
+      return cachedNamespace;
+    }
+    RecursionGuard.StackStamp stamp = ourGuard.markStack();
+    cachedNamespace = getNamespaceByPrefix(getNamespacePrefix());
+    if (!stamp.mayCacheNow()) {
+      return cachedNamespace;
+    }
+
+    myCachedNamespace = cachedNamespace;
+    myModCount = curModCount;
+    return cachedNamespace;
+  }
+
+  @NotNull
+  public String getNamespacePrefix() {
+    return XmlUtil.findPrefixByQualifiedName(getName());
+  }
+
+  @NotNull
+  public String getNamespaceByPrefix(String prefix) {
+    final PsiElement parent = getParent();
+    if (!parent.isValid()) {
+      LOG.error(this.isValid());
+    }
+    BidirectionalMap<String, String> map = initNamespaceMaps(parent);
+    if (map != null) {
+      final String ns = map.get(prefix);
+      if (ns != null) return ns;
+    }
+    if (parent instanceof XmlTag) return ((XmlTag)parent).getNamespaceByPrefix(prefix);
+    //The prefix 'xml' is by definition bound to the namespace name http://www.w3.org/XML/1998/namespace. It MAY, but need not, be declared
+    if (XML_NS_PREFIX.equals(prefix)) return XmlUtil.XML_NAMESPACE_URI;
+
+    if (prefix.length() > 0 &&
+        !hasNamespaceDeclarations() &&
+        getNamespacePrefix().equals(prefix)) {
+      // When there is no namespace declarations then qualified names should be just used in dtds
+      // this implies that we may have "" namespace prefix ! (see last paragraph in Namespaces in Xml, Section 5)
+
+      String result = ourGuard.doPreventingRecursion("getNsByPrefix", true, new Computable<String>() {
+        @Override
+        public String compute() {
+          final String nsFromEmptyPrefix = getNamespaceByPrefix("");
+          final XmlNSDescriptor nsDescriptor = getNSDescriptor(nsFromEmptyPrefix, false);
+          final XmlElementDescriptor descriptor = nsDescriptor != null ? nsDescriptor.getElementDescriptor(XmlTagImpl.this) : null;
+          final String nameFromRealDescriptor =
+            descriptor != null && descriptor.getDeclaration() != null && descriptor.getDeclaration().isPhysical()
+            ? descriptor.getName()
+            : "";
+          if (nameFromRealDescriptor.equals(getName())) return nsFromEmptyPrefix;
+          return XmlUtil.EMPTY_URI;
+        }
+      });
+      if (result != null) {
+        return result;
+      }
+    }
+    return XmlUtil.EMPTY_URI;
+  }
+
+  public String getPrefixByNamespace(String namespace) {
+    final PsiElement parent = getParent();
+    BidirectionalMap<String, String> map = initNamespaceMaps(parent);
+    if (map != null) {
+      List<String> keysByValue = map.getKeysByValue(namespace);
+      final String ns = keysByValue == null || keysByValue.isEmpty() ? null : keysByValue.get(0);
+      if (ns != null) return ns;
+    }
+    if (parent instanceof XmlTag) return ((XmlTag)parent).getPrefixByNamespace(namespace);
+    //The prefix 'xml' is by definition bound to the namespace name http://www.w3.org/XML/1998/namespace. It MAY, but need not, be declared
+    if (XmlUtil.XML_NAMESPACE_URI.equals(namespace)) return XML_NS_PREFIX;
+    return null;
+  }
+
+  public String[] knownNamespaces() {
+    final PsiElement parentElement = getParent();
+    BidirectionalMap<String, String> map = initNamespaceMaps(parentElement);
+    Set<String> known = Collections.emptySet();
+    if (map != null) {
+      known = new HashSet<String>(map.values());
+    }
+    if (parentElement instanceof XmlTag) {
+      if (known.isEmpty()) return ((XmlTag)parentElement).knownNamespaces();
+      ContainerUtil.addAll(known, ((XmlTag)parentElement).knownNamespaces());
+    }
+    else {
+      XmlExtension xmlExtension = XmlExtension.getExtensionByElement(this);
+      if (xmlExtension != null) {
+        final XmlFile xmlFile = xmlExtension.getContainingFile(this);
+        if (xmlFile != null) {
+          final XmlTag rootTag = xmlFile.getRootTag();
+          if (rootTag != null && rootTag != this) {
+            if (known.isEmpty()) return rootTag.knownNamespaces();
+            ContainerUtil.addAll(known, rootTag.knownNamespaces());
+          }
+        }
+      }
+    }
+    return ArrayUtil.toStringArray(known);
+  }
+
+  @Nullable
+  private BidirectionalMap<String, String> initNamespaceMaps(PsiElement parent) {
+    BidirectionalMap<String, String> map = myNamespaceMap;
+
+    if (map == null) {
+      RecursionGuard.StackStamp stamp = ourGuard.markStack();
+      map = computeNamespaceMap(parent);
+      if (stamp.mayCacheNow()) {
+        myNamespaceMap = map;
+      }
+    }
+
+    return map;
+  }
+
+  @Nullable
+  private BidirectionalMap<String, String> computeNamespaceMap(PsiElement parent) {
+    BidirectionalMap<String, String> map = null;
+    if (hasNamespaceDeclarations()) {
+      map = new BidirectionalMap<String, String>();
+      final XmlAttribute[] attributes = getAttributes();
+
+      for (final XmlAttribute attribute : attributes) {
+        if (attribute.isNamespaceDeclaration()) {
+          final String name = attribute.getName();
+          int splitIndex = name.indexOf(':');
+          final String value = getRealNs(attribute.getValue());
+
+          if (value != null) {
+            if (splitIndex < 0) {
+              map.put("", value);
+            }
+            else {
+              map.put(XmlUtil.findLocalNameByQualifiedName(name), value);
+            }
+          }
+        }
+      }
+    }
+
+    if (parent instanceof XmlDocument) {
+      final XmlExtension extension = XmlExtension.getExtensionByElement(parent);
+      if (extension != null) {
+        final String[][] defaultNamespace = extension.getNamespacesFromDocument((XmlDocument)parent, map != null);
+        if (defaultNamespace != null) {
+          if (map == null) {
+            map = new BidirectionalMap<String, String>();
+          }
+          for (final String[] prefix2ns : defaultNamespace) {
+            map.put(prefix2ns[0], getRealNs(prefix2ns[1]));
+          }
+        }
+      }
+    }
+    return map;
+  }
+
+  private String getNsLocation(String ns) {
+    if (XmlUtil.XHTML_URI.equals(ns)) {
+      return XmlUtil.getDefaultXhtmlNamespace(getProject());
+    }
+    return ns;
+  }
+
+  protected String getRealNs(final String value) {
+    return value;
+  }
+
+  @NotNull
+  public String getLocalName() {
+    String localName = myLocalName;
+    if (localName == null) {
+      final String name = getName();
+      myLocalName = localName = name.substring(name.indexOf(':') + 1);
+    }
+    return localName;
+  }
+
+  public boolean hasNamespaceDeclarations() {
+    getAttributes();
+    return myHaveNamespaceDeclarations;
+  }
+
+  @NotNull
+  public Map<String, String> getLocalNamespaceDeclarations() {
+    Map<String, String> namespaces = new THashMap<String, String>();
+    for (final XmlAttribute attribute : getAttributes()) {
+      if (!attribute.isNamespaceDeclaration() || attribute.getValue() == null) continue;
+      // xmlns -> "", xmlns:a -> a
+      final String localName = attribute.getLocalName();
+      namespaces.put(localName.equals(attribute.getName()) ? "" : localName, attribute.getValue());
+    }
+    return namespaces;
+  }
+
+  public XmlAttribute setAttribute(String qname, String value) throws IncorrectOperationException {
+    final XmlAttribute attribute = getAttribute(qname);
+
+    if (attribute != null) {
+      if (value == null) {
+        deleteChildInternal(attribute.getNode());
+        return null;
+      }
+      attribute.setValue(value);
+      return attribute;
+    }
+    else if (value == null) {
+      return null;
+    }
+    else {
+      PsiElement xmlAttribute = add(XmlElementFactory.getInstance(getProject()).createXmlAttribute(qname, value));
+      while (!(xmlAttribute instanceof XmlAttribute)) xmlAttribute = xmlAttribute.getNextSibling();
+      return (XmlAttribute)xmlAttribute;
+    }
+  }
+
+  public XmlAttribute setAttribute(String name, String namespace, String value) throws IncorrectOperationException {
+    if (!Comparing.equal(namespace, "")) {
+      final String prefix = getPrefixByNamespace(namespace);
+      if (prefix != null && prefix.length() > 0) name = prefix + ":" + name;
+    }
+    return setAttribute(name, value);
+  }
+
+  public XmlTag createChildTag(String localName, String namespace, String bodyText, boolean enforceNamespacesDeep) {
+    return XmlUtil.createChildTag(this, localName, namespace, bodyText, enforceNamespacesDeep);
+  }
+
+  @Override
+  public XmlTag addSubTag(XmlTag subTag, boolean first) {
+    XmlTagChild[] children = getSubTags();
+    if (children.length == 0) {
+      children = getValue().getChildren();
+    }
+    if (children.length == 0) {
+      return (XmlTag)add(subTag);
+    }
+    else if (first) {
+      return (XmlTag)addBefore(subTag, children[0]);
+    }
+    else {
+      return (XmlTag)addAfter(subTag, ArrayUtil.getLastElement(children));
+    }
+  }
+
+  @NotNull
+  public XmlTagValue getValue() {
+    XmlTagValue tagValue = myValue;
+    if (tagValue == null) {
+      myValue = tagValue = XmlTagValueImpl.createXmlTagValue(this);
+    }
+    return tagValue;
+  }
+
+  public void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlTag(this);
+    }
+    else {
+      visitor.visitElement(this);
+    }
+  }
+
+  public String toString() {
+    return "XmlTag:" + getName();
+  }
+
+  public PsiMetaData getMetaData() {
+    return MetaRegistry.getMeta(this);
+  }
+
+  public TreeElement addInternal(TreeElement first, ASTNode last, ASTNode anchor, Boolean beforeB) {
+    TreeElement firstAppended = null;
+    boolean before = beforeB == null || beforeB.booleanValue();
+    try {
+      TreeElement next;
+      do {
+        next = first.getTreeNext();
+
+        if (firstAppended == null) {
+          firstAppended = addInternal(first, anchor, before);
+          anchor = firstAppended;
+        }
+        else {
+          anchor = addInternal(first, anchor, false);
+        }
+      }
+      while (first != last && (first = next) != null);
+    }
+    catch (IncorrectOperationException ignored) {
+    }
+    finally {
+      clearCaches();
+    }
+    return firstAppended;
+  }
+
+  private TreeElement addInternal(TreeElement child, ASTNode anchor, boolean before) throws IncorrectOperationException {
+    final PomModel model = PomManager.getModel(getProject());
+    if (anchor != null && child.getElementType() == XmlElementType.XML_TEXT) {
+      XmlText psi = null;
+      if (anchor.getPsi() instanceof XmlText) {
+        psi = (XmlText)anchor.getPsi();
+      }
+      else {
+        final ASTNode other = before ? anchor.getTreePrev() : anchor.getTreeNext();
+        if (other != null && other.getPsi() instanceof XmlText) {
+          before = !before;
+          psi = (XmlText)other.getPsi();
+        }
+      }
+
+      if (psi != null) {
+        if (before) {
+          psi.insertText(((XmlText)child.getPsi()).getValue(), 0);
+        }
+        else {
+          psi.insertText(((XmlText)child.getPsi()).getValue(), psi.getValue().length());
+        }
+        return (TreeElement)psi.getNode();
+      }
+    }
+    LOG.assertTrue(child.getPsi() instanceof XmlAttribute || child.getPsi() instanceof XmlTagChild);
+    final InsertTransaction transaction;
+    if (child.getElementType() == XmlElementType.XML_ATTRIBUTE) {
+      transaction = new InsertAttributeTransaction(child, anchor, before, model);
+    }
+    else if (anchor == null) {
+      transaction = getBodyInsertTransaction(child);
+    }
+    else {
+      transaction = new GenericInsertTransaction(child, anchor, before);
+    }
+    model.runTransaction(transaction);
+    return transaction.getFirstInserted();
+  }
+
+  protected InsertTransaction getBodyInsertTransaction(final TreeElement child) {
+    return new BodyInsertTransaction(child);
+  }
+
+  public void deleteChildInternal(@NotNull final ASTNode child) {
+    final PomModel model = PomManager.getModel(getProject());
+    final XmlAspect aspect = model.getModelAspect(XmlAspect.class);
+
+    if (child.getElementType() == XmlElementType.XML_ATTRIBUTE) {
+      try {
+        model.runTransaction(new PomTransactionBase(this, aspect) {
+          public PomModelEvent runInner() {
+            final String name = ((XmlAttribute)child).getName();
+            XmlTagImpl.super.deleteChildInternal(child);
+            return XmlAttributeSetImpl.createXmlAttributeSet(model, XmlTagImpl.this, name, null);
+          }
+        });
+      }
+      catch (IncorrectOperationException e) {
+        LOG.error(e);
+      }
+    }
+    else {
+      final ASTNode treePrev = child.getTreePrev();
+      final ASTNode treeNext = child.getTreeNext();
+      XmlTagImpl.super.deleteChildInternal(child);
+      if (treePrev != null &&
+          treeNext != null &&
+          treePrev.getElementType() == XmlElementType.XML_TEXT &&
+          treeNext.getElementType() == XmlElementType.XML_TEXT) {
+        final XmlText prevText = (XmlText)treePrev.getPsi();
+        final XmlText nextText = (XmlText)treeNext.getPsi();
+        try {
+          prevText.setValue(prevText.getValue() + nextText.getValue());
+          nextText.delete();
+        }
+        catch (IncorrectOperationException e) {
+          LOG.error(e);
+        }
+      }
+    }
+  }
+
+  private ASTNode expandTag() throws IncorrectOperationException {
+    ASTNode endTagStart = XmlChildRole.CLOSING_TAG_START_FINDER.findChild(this);
+    if (endTagStart == null) {
+      final XmlTagImpl tagFromText =
+        (XmlTagImpl)XmlElementFactory.getInstance(getProject()).createTagFromText("<" + getName() + "></" + getName() + ">");
+      final ASTNode startTagStart = XmlChildRole.START_TAG_END_FINDER.findChild(tagFromText);
+      endTagStart = XmlChildRole.CLOSING_TAG_START_FINDER.findChild(tagFromText);
+      final LeafElement emptyTagEnd = (LeafElement)XmlChildRole.EMPTY_TAG_END_FINDER.findChild(this);
+      if (emptyTagEnd != null) removeChild(emptyTagEnd);
+      addChildren(startTagStart, null, null);
+    }
+    return endTagStart;
+  }
+
+  public XmlTag getParentTag() {
+    final PsiElement parent = getParent();
+    if (parent instanceof XmlTag) return (XmlTag)parent;
+    return null;
+  }
+
+  public XmlTagChild getNextSiblingInTag() {
+    final PsiElement nextSibling = getNextSibling();
+    if (nextSibling instanceof XmlTagChild) return (XmlTagChild)nextSibling;
+    return null;
+  }
+
+  public XmlTagChild getPrevSiblingInTag() {
+    final PsiElement prevSibling = getPrevSibling();
+    if (prevSibling instanceof XmlTagChild) return (XmlTagChild)prevSibling;
+    return null;
+  }
+
+  public Icon getElementIcon(int flags) {
+    return PlatformIcons.XML_TAG_ICON;
+  }
+
+  protected class BodyInsertTransaction extends InsertTransaction {
+    private final TreeElement myChild;
+    private ASTNode myNewElement;
+
+    public BodyInsertTransaction(TreeElement child) {
+      super(XmlTagImpl.this);
+      myChild = child;
+    }
+
+    public PomModelEvent runInner() throws IncorrectOperationException {
+      final ASTNode anchor = expandTag();
+      if (myChild.getElementType() == XmlElementType.XML_TAG) {
+        // compute where to insert tag according to DTD or XSD
+        final XmlElementDescriptor parentDescriptor = getDescriptor();
+        final XmlTag[] subTags = getSubTags();
+        final PsiElement declaration = parentDescriptor != null ? parentDescriptor.getDeclaration() : null;
+        // filtering out generated dtds
+        if (declaration != null &&
+            declaration.getContainingFile() != null &&
+            declaration.getContainingFile().isPhysical() &&
+            subTags.length > 0) {
+          final XmlElementDescriptor[] childElementDescriptors = parentDescriptor.getElementsDescriptors(XmlTagImpl.this);
+          int subTagNum = -1;
+          for (final XmlElementDescriptor childElementDescriptor : childElementDescriptors) {
+            final String childElementName = childElementDescriptor.getName();
+            while (subTagNum < subTags.length - 1 && subTags[subTagNum + 1].getName().equals(childElementName)) {
+              subTagNum++;
+            }
+            if (childElementName.equals(XmlChildRole.START_TAG_NAME_FINDER.findChild(myChild).getText())) {
+              // insert child just after anchor
+              // insert into the position specified by index
+              if (subTagNum >= 0) {
+                final ASTNode subTag = (ASTNode)subTags[subTagNum];
+                if (subTag.getTreeParent() != XmlTagImpl.this) {
+                  // in entity
+                  final XmlEntityRef entityRef = PsiTreeUtil.getParentOfType(subTags[subTagNum], XmlEntityRef.class);
+                  throw new IncorrectOperationException(
+                    "Can't insert subtag to the entity. Entity reference text: " + (entityRef == null ? "" : entityRef.getText()));
+                }
+                myNewElement = XmlTagImpl.super.addInternal(myChild, myChild, subTag, Boolean.FALSE);
+              }
+              else {
+                final ASTNode child = XmlChildRole.START_TAG_END_FINDER.findChild(XmlTagImpl.this);
+                myNewElement = XmlTagImpl.super.addInternal(myChild, myChild, child, Boolean.FALSE);
+              }
+              return null;
+            }
+          }
+        }
+        else {
+          final ASTNode child = XmlChildRole.CLOSING_TAG_START_FINDER.findChild(XmlTagImpl.this);
+          myNewElement = XmlTagImpl.super.addInternal(myChild, myChild, child, Boolean.TRUE);
+          return null;
+        }
+      }
+      myNewElement = XmlTagImpl.super.addInternal(myChild, myChild, anchor, Boolean.TRUE);
+      return null;
+    }
+
+    public TreeElement getFirstInserted() {
+      return (TreeElement)myNewElement;
+    }
+  }
+
+  protected class InsertAttributeTransaction extends InsertTransaction {
+    private final TreeElement myChild;
+    private final ASTNode myAnchor;
+    private final boolean myBefore;
+    private final PomModel myModel;
+    private TreeElement myFirstInserted = null;
+
+    public InsertAttributeTransaction(final TreeElement child, final ASTNode anchor, final boolean before, final PomModel model) {
+      super(XmlTagImpl.this);
+      myChild = child;
+      myAnchor = anchor;
+      myBefore = before;
+      myModel = model;
+    }
+
+    public PomModelEvent runInner() {
+      final String value = ((XmlAttribute)myChild).getValue();
+      final String name = ((XmlAttribute)myChild).getName();
+      if (myAnchor == null) {
+        ASTNode startTagEnd = XmlChildRole.START_TAG_END_FINDER.findChild(XmlTagImpl.this);
+        if (startTagEnd == null) startTagEnd = XmlChildRole.EMPTY_TAG_END_FINDER.findChild(XmlTagImpl.this);
+
+        if (startTagEnd == null) {
+          ASTNode anchor = getLastChildNode();
+
+          while (anchor instanceof PsiWhiteSpace) {
+            anchor = anchor.getTreePrev();
+          }
+
+          if (anchor instanceof PsiErrorElement) {
+            final LeafElement token = Factory
+              .createSingleLeafElement(XmlTokenType.XML_EMPTY_ELEMENT_END, "/>", 0, 2, SharedImplUtil.findCharTableByTree(anchor),
+                                       getManager());
+            replaceChild(anchor, token);
+            startTagEnd = token;
+          }
+        }
+
+        if (startTagEnd == null) {
+          ASTNode anchor = XmlChildRole.START_TAG_NAME_FINDER.findChild(XmlTagImpl.this);
+          myFirstInserted = XmlTagImpl.super.addInternal(myChild, myChild, anchor, Boolean.FALSE);
+        }
+        else {
+          myFirstInserted = XmlTagImpl.super.addInternal(myChild, myChild, startTagEnd, Boolean.TRUE);
+        }
+      }
+      else {
+        myFirstInserted = XmlTagImpl.super.addInternal(myChild, myChild, myAnchor, Boolean.valueOf(myBefore));
+      }
+      return XmlAttributeSetImpl.createXmlAttributeSet(myModel, XmlTagImpl.this, name, value);
+    }
+
+    public TreeElement getFirstInserted() {
+      return myFirstInserted;
+    }
+  }
+
+  protected class GenericInsertTransaction extends InsertTransaction {
+    private final TreeElement myChild;
+    private final ASTNode myAnchor;
+    private final boolean myBefore;
+    private TreeElement myRetHolder;
+
+    public GenericInsertTransaction(final TreeElement child, final ASTNode anchor, final boolean before) {
+      super(XmlTagImpl.this);
+      myChild = child;
+      myAnchor = anchor;
+      myBefore = before;
+    }
+
+    public PomModelEvent runInner() {
+      myRetHolder = XmlTagImpl.super.addInternal(myChild, myChild, myAnchor, Boolean.valueOf(myBefore));
+      return null;
+    }
+
+    public TreeElement getFirstInserted() {
+      return myRetHolder;
+    }
+  }
+
+  protected abstract class InsertTransaction extends PomTransactionBase {
+    public InsertTransaction(final PsiElement scope) {
+      super(scope, PomManager.getModel(getProject()).getModelAspect(XmlAspect.class));
+    }
+
+    public abstract TreeElement getFirstInserted();
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlTagValueImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlTagValueImpl.java
new file mode 100644
index 0000000..887cce5
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlTagValueImpl.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class XmlTagValueImpl implements XmlTagValue{
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlTagValueImpl");
+
+  private final XmlTag myTag;
+  private final XmlTagChild[] myElements;
+  private volatile XmlText[] myTextElements = null;
+  private volatile String myText = null;
+  private volatile String myTrimmedText = null;
+
+  public XmlTagValueImpl(@NotNull XmlTagChild[] bodyElements, @NotNull XmlTag tag) {
+    myTag = tag;
+    myElements = bodyElements;
+  }
+
+  @NotNull
+  public XmlTagChild[] getChildren() {
+    return myElements;
+  }
+
+  @NotNull
+  public XmlText[] getTextElements() {
+    XmlText[] textElements = myTextElements;
+    if(textElements != null) return textElements;
+    final List<XmlText> textElementsList = new ArrayList<XmlText>();
+    for (final XmlTagChild element : myElements) {
+      if (element instanceof XmlText) textElementsList.add((XmlText)element);
+    }
+    return myTextElements = textElementsList.isEmpty() ? XmlText.EMPTY_ARRAY : ContainerUtil.toArray(textElementsList, new XmlText[textElementsList.size()]);
+  }
+
+  @NotNull
+  public String getText() {
+    String text = myText;
+    if(text != null) return text;
+    final StringBuilder consolidatedText = new StringBuilder();
+    for (final XmlTagChild element : myElements) {
+      consolidatedText.append(element.getText());
+    }
+    return myText = consolidatedText.toString();
+  }
+
+  @NotNull
+  public TextRange getTextRange() {
+    if(myElements.length == 0){
+      final ASTNode child = XmlChildRole.START_TAG_END_FINDER.findChild( (ASTNode)myTag);
+      if(child != null)
+        return new TextRange(child.getStartOffset() + 1, child.getStartOffset() + 1);
+      return new TextRange(myTag.getTextRange().getEndOffset(), myTag.getTextRange().getEndOffset());
+    }
+    return new TextRange(myElements[0].getTextRange().getStartOffset(), myElements[myElements.length - 1].getTextRange().getEndOffset());
+  }
+
+  @NotNull
+  public String getTrimmedText() {
+    String trimmedText = myTrimmedText;
+    if(trimmedText != null) return trimmedText;
+
+    final StringBuilder consolidatedText = new StringBuilder();
+    final XmlText[] textElements = getTextElements();
+    for (final XmlText textElement : textElements) {
+      consolidatedText.append(textElement.getValue());
+    }
+    return myTrimmedText = consolidatedText.toString().trim();
+  }
+
+  public void setText(String value) {
+    try {
+      XmlText text = null;
+      if (value != null) {
+        final XmlText[] texts = getTextElements();
+        if (texts.length == 0) {
+          text = (XmlText)myTag.add(XmlElementFactory.getInstance(myTag.getProject()).createDisplayText("x"));
+        } else {
+          text = texts[0];
+        }
+        if (StringUtil.isEmpty(value)) {
+          text.delete();
+        }
+        else {
+          text.setValue(value);
+        }
+      }
+
+      if(myElements.length > 0){
+        for (final XmlTagChild child : myElements) {
+          if (child != text) {
+            child.delete();
+          }
+        }
+      }
+    }
+    catch (IncorrectOperationException e) {
+      LOG.error(e);
+    }
+  }
+
+  @Override
+  public boolean hasCDATA() {
+    for (XmlText xmlText : myTextElements) {
+      PsiElement[] children = xmlText.getChildren();
+      for (PsiElement child : children) {
+        if (child.getNode().getElementType() == XmlElementType.XML_CDATA) {
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+
+  public static XmlTagValue createXmlTagValue(XmlTag tag) {
+    final List<XmlTagChild> bodyElements = new ArrayList<XmlTagChild>();
+
+    tag.processElements(new PsiElementProcessor() {
+      boolean insideBody = false;
+      public boolean execute(@NotNull PsiElement element) {
+        final ASTNode treeElement = element.getNode();
+        if (insideBody) {
+          if (treeElement != null && treeElement.getElementType() == XmlTokenType.XML_END_TAG_START) return false;
+          if (!(element instanceof XmlTagChild)) return true;
+          bodyElements.add((XmlTagChild)element);
+        }
+        else if (treeElement != null && treeElement.getElementType() == XmlTokenType.XML_TAG_END) insideBody = true;
+        return true;
+      }
+    }, tag);
+
+    XmlTagChild[] tagChildren = ContainerUtil.toArray(bodyElements, new XmlTagChild[bodyElements.size()]);
+    return new XmlTagValueImpl(tagChildren, tag);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlTextImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlTextImpl.java
new file mode 100644
index 0000000..b33ae84
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlTextImpl.java
@@ -0,0 +1,528 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.lang.ASTFactory;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.injection.InjectedLanguageManager;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.pom.PomManager;
+import com.intellij.pom.PomModel;
+import com.intellij.pom.event.PomModelEvent;
+import com.intellij.pom.impl.PomTransactionBase;
+import com.intellij.pom.xml.XmlAspect;
+import com.intellij.pom.xml.events.XmlChange;
+import com.intellij.pom.xml.impl.XmlAspectChangeSetImpl;
+import com.intellij.pom.xml.impl.events.XmlTagChildAddImpl;
+import com.intellij.pom.xml.impl.events.XmlTextChangedImpl;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.source.DummyHolderFactory;
+import com.intellij.psi.impl.source.PsiFileImpl;
+import com.intellij.psi.impl.source.codeStyle.CodeEditUtil;
+import com.intellij.psi.impl.source.tree.FileElement;
+import com.intellij.psi.impl.source.tree.LeafElement;
+import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
+import com.intellij.psi.impl.source.tree.injected.XmlTextLiteralEscaper;
+import com.intellij.psi.impl.source.xml.behavior.DefaultXmlPsiPolicy;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.util.XmlUtil;
+import gnu.trove.TIntArrayList;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class XmlTextImpl extends XmlElementImpl implements XmlText, PsiLanguageInjectionHost {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlTextImpl");
+  private volatile String myDisplayText = null;
+  private volatile int[] myGapDisplayStarts = null;
+  private volatile int[] myGapPhysicalStarts = null;
+
+  public XmlTextImpl() {
+    super(XmlElementType.XML_TEXT);
+  }
+
+  public String toString() {
+    return "XmlText";
+  }
+
+  @Override
+  public boolean isValidHost() {
+    return true;
+  }
+
+  @Nullable
+  public XmlText split(int displayIndex) {
+    try {
+      return _splitText(displayIndex);
+    }
+    catch (IncorrectOperationException e) {
+      throw new IllegalArgumentException(e);
+    }
+  }
+
+  public String getValue() {
+    String displayText = myDisplayText;
+    if (displayText != null) return displayText;
+    StringBuilder buffer = new StringBuilder();
+    ASTNode child = getFirstChildNode();
+    final TIntArrayList gapsStarts = new TIntArrayList();
+    final TIntArrayList gapsShifts = new TIntArrayList();
+    while (child != null) {
+      final int start = buffer.length();
+      IElementType elementType = child.getElementType();
+      if (elementType == XmlElementType.XML_CDATA) {
+        final ASTNode cdata = child;
+        child = cdata.getFirstChildNode();
+      }
+      else if (elementType == XmlTokenType.XML_CHAR_ENTITY_REF) {
+        String text = child.getText();
+        LOG.assertTrue(text != null, child);
+        buffer.append(XmlUtil.getCharFromEntityRef(text));
+      }
+      else if (elementType == XmlTokenType.XML_WHITE_SPACE || elementType == XmlTokenType.XML_DATA_CHARACTERS || elementType == XmlTokenType
+        .XML_ATTRIBUTE_VALUE_TOKEN) {
+        buffer.append(child.getText());
+      }
+      else if (elementType == TokenType.ERROR_ELEMENT || elementType == TokenType.NEW_LINE_INDENT) {
+        buffer.append(child.getText());
+      }
+
+      int end = buffer.length();
+      int originalLength = child.getTextLength();
+      if (end - start != originalLength) {
+        gapsStarts.add(end);
+        gapsShifts.add(originalLength - (end - start));
+      }
+      final ASTNode next = child.getTreeNext();
+      if (next == null && child.getTreeParent().getElementType() == XmlElementType.XML_CDATA) {
+        child = child.getTreeParent().getTreeNext();
+      }
+      else {
+        child = next;
+      }
+    }
+    int[] gapDisplayStarts = ArrayUtil.newIntArray(gapsShifts.size());
+    int[] gapPhysicalStarts = ArrayUtil.newIntArray(gapsShifts.size());
+    int currentGapsSum = 0;
+    for (int i = 0; i < gapDisplayStarts.length; i++) {
+      currentGapsSum += gapsShifts.get(i);
+      gapDisplayStarts[i] = gapsStarts.get(i);
+      gapPhysicalStarts[i] = gapDisplayStarts[i] + currentGapsSum;
+    }
+    myGapDisplayStarts = gapDisplayStarts;
+    myGapPhysicalStarts = gapPhysicalStarts;
+    String text = buffer.toString();
+    myDisplayText = text;
+    return text;
+  }
+
+  public int physicalToDisplay(int physicalIndex) {
+    getValue();
+    if (myGapPhysicalStarts.length == 0) return physicalIndex;
+
+    final int bsResult = Arrays.binarySearch(myGapPhysicalStarts, physicalIndex);
+
+    if (bsResult >= 0) return myGapDisplayStarts[bsResult];
+
+    int insertionIndex = -bsResult - 1;
+
+    //if (insertionIndex == myGapDisplayStarts.length) return getValue().length();
+
+    int prevPhysGapStart = insertionIndex > 0 ? myGapPhysicalStarts[insertionIndex - 1] : 0;
+    int prevDisplayGapStart = insertionIndex > 0 ? myGapDisplayStarts[insertionIndex - 1] : 0;
+
+    if (insertionIndex < myGapDisplayStarts.length) {
+      int prevDisplayGapLength =
+        insertionIndex > 0 ? myGapDisplayStarts[insertionIndex] - myGapDisplayStarts[insertionIndex - 1] : myGapDisplayStarts[0];
+      if (physicalIndex - prevPhysGapStart > prevDisplayGapLength) return myGapDisplayStarts[insertionIndex];
+    }
+
+    return physicalIndex - prevPhysGapStart + prevDisplayGapStart;
+  }
+
+  public int displayToPhysical(int displayIndex) {
+    getValue();
+    if (myGapDisplayStarts.length == 0) return displayIndex;
+
+    final int bsResult = Arrays.binarySearch(myGapDisplayStarts, displayIndex);
+    if (bsResult >= 0) return myGapPhysicalStarts[bsResult];
+
+    int insertionIndex = -bsResult - 1;
+    int prevPhysGapStart = insertionIndex > 0 ? myGapPhysicalStarts[insertionIndex - 1] : 0;
+    int prevDisplayGapStart = insertionIndex > 0 ? myGapDisplayStarts[insertionIndex - 1] : 0;
+    return displayIndex - prevDisplayGapStart + prevPhysGapStart;
+  }
+
+  public void setValue(String s) throws IncorrectOperationException {
+    doSetValue(s, getPolicy());
+  }
+
+  private void doSetValue(final String s, XmlPsiPolicy policy) throws IncorrectOperationException {
+    final ASTNode firstEncodedElement = policy.encodeXmlTextContents(s, this);
+
+    if (firstEncodedElement == null) {
+      delete();
+      return;
+    }
+
+    final PomModel model = PomManager.getModel(getProject());
+    final XmlAspect aspect = model.getModelAspect(XmlAspect.class);
+    model.runTransaction(new PomTransactionBase(this, aspect) {
+      public PomModelEvent runInner() {
+        final String oldText = getText();
+        replaceAllChildrenToChildrenOf(firstEncodedElement.getTreeParent());
+        clearCaches();
+        return XmlTextChangedImpl.createXmlTextChanged(model, XmlTextImpl.this, oldText);
+      }
+    });
+  }
+
+  public XmlElement insertAtOffset(final XmlElement element, final int displayOffset) throws IncorrectOperationException {
+    if (element instanceof XmlText) {
+      insertText(((XmlText)element).getValue(), displayOffset);
+    }
+    else {
+      final PomModel model = PomManager.getModel(getProject());
+      final XmlAspect aspect = model.getModelAspect(XmlAspect.class);
+      model.runTransaction(new PomTransactionBase(getParent(), aspect) {
+        public PomModelEvent runInner() throws IncorrectOperationException {
+          final XmlTag tag = getParentTag();
+          assert tag != null;
+
+          final XmlText rightPart = _splitText(displayOffset);
+          PsiElement result;
+          if (rightPart != null) {
+            result = tag.addBefore(element, rightPart);
+          }
+          else {
+            result = tag.addAfter(element, XmlTextImpl.this);
+          }
+          return createEvent(new XmlTagChildAddImpl(tag, (XmlTagChild)result));
+        }
+      });
+    }
+
+    return this;
+  }
+
+  private XmlPsiPolicy getPolicy() {
+    return ((XMLLanguage)getLanguage()).getPsiPolicy();
+  }
+
+  public void insertText(String text, int displayOffset) throws IncorrectOperationException {
+    if (text == null || text.length() == 0) return;
+
+    final int physicalOffset = displayToPhysical(displayOffset);
+    final PsiElement psiElement = findElementAt(physicalOffset);
+    //if (!(psiElement instanceof XmlTokenImpl)) throw new IncorrectOperationException("Can't insert at offset: " + displayOffset);
+    final IElementType elementType = psiElement != null ? psiElement.getNode().getElementType() : null;
+
+    if (elementType == XmlTokenType.XML_DATA_CHARACTERS) {
+      int insertOffset = physicalOffset - psiElement.getStartOffsetInParent();
+
+      final String oldElementText = psiElement.getText();
+      final String newElementText = oldElementText.substring(0, insertOffset) + text + oldElementText.substring(insertOffset);
+
+      final PomModel model = PomManager.getModel(getProject());
+      final XmlAspect aspect = model.getModelAspect(XmlAspect.class);
+      model.runTransaction(new PomTransactionBase(this, aspect) {
+        public PomModelEvent runInner() {
+          final String oldText = getText();
+
+          final ASTNode e =
+            getPolicy().encodeXmlTextContents(newElementText, XmlTextImpl.this);
+
+          final ASTNode node = psiElement.getNode();
+          final ASTNode treeNext = node.getTreeNext();
+
+          addChildren(e, null, treeNext);
+
+          deleteChildInternal(node);
+
+
+          clearCaches();
+          return XmlTextChangedImpl.createXmlTextChanged(model, XmlTextImpl.this, oldText);
+        }
+      });
+    }
+    else {
+      setValue(new StringBuffer(getValue()).insert(displayOffset, text).toString());
+    }
+  }
+
+  public void removeText(int displayStart, int displayEnd) throws IncorrectOperationException {
+    final String value = getValue();
+
+    final int physicalStart = displayToPhysical(displayStart);
+    final PsiElement psiElement = findElementAt(physicalStart);
+    if (psiElement != null) {
+      final IElementType elementType = psiElement.getNode().getElementType();
+      final int elementDisplayEnd = physicalToDisplay(psiElement.getStartOffsetInParent() + psiElement.getTextLength());
+      final int elementDisplayStart = physicalToDisplay(psiElement.getStartOffsetInParent());
+      if (elementType == XmlTokenType.XML_DATA_CHARACTERS || elementType == TokenType.WHITE_SPACE) {
+        if (elementDisplayEnd >= displayEnd && elementDisplayStart <= displayStart) {
+          int physicalEnd = physicalStart;
+          while (physicalEnd < getTextRange().getLength()) {
+            if (physicalToDisplay(physicalEnd) == displayEnd) break;
+            physicalEnd++;
+          }
+
+          int removeStart = physicalStart - psiElement.getStartOffsetInParent();
+          int removeEnd = physicalEnd - psiElement.getStartOffsetInParent();
+
+          final String oldElementText = psiElement.getText();
+          final String newElementText = oldElementText.substring(0, removeStart) + oldElementText.substring(removeEnd);
+
+          final PomModel model = PomManager.getModel(getProject());
+          final XmlAspect aspect = model.getModelAspect(XmlAspect.class);
+          model.runTransaction(new PomTransactionBase(this, aspect) {
+            public PomModelEvent runInner() throws IncorrectOperationException {
+              final String oldText = getText();
+
+              if (newElementText.length() > 0) {
+                final ASTNode e =
+                  getPolicy().encodeXmlTextContents(newElementText, XmlTextImpl.this);
+                replaceChild(psiElement.getNode(), e);
+              }
+              else {
+                psiElement.delete();
+              }
+
+              clearCaches();
+              return XmlTextChangedImpl.createXmlTextChanged(model, XmlTextImpl.this, oldText);
+            }
+          });
+
+          return;
+        }
+      }
+    }
+
+    if (displayStart == 0 && displayEnd == value.length()) {
+      delete();
+    }
+    else {
+      setValue(new StringBuffer(getValue()).replace(displayStart, displayEnd, "").toString());
+    }
+  }
+
+  public XmlTag getParentTag() {
+    final PsiElement parent = getParent();
+    if (parent instanceof XmlTag) return (XmlTag)parent;
+    return null;
+  }
+
+  public XmlTagChild getNextSiblingInTag() {
+    PsiElement nextSibling = getNextSibling();
+    if (nextSibling instanceof XmlTagChild) return (XmlTagChild)nextSibling;
+    return null;
+  }
+
+  public XmlTagChild getPrevSiblingInTag() {
+    PsiElement prevSibling = getPrevSibling();
+    if (prevSibling instanceof XmlTagChild) return (XmlTagChild)prevSibling;
+    return null;
+  }
+
+  public TreeElement addInternal(TreeElement first, ASTNode last, ASTNode anchor, Boolean before) {
+    throw new RuntimeException("Clients must not use operations with direct children of XmlText!");
+  }
+
+  public void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlText(this);
+    }
+    else {
+      visitor.visitElement(this);
+    }
+  }
+
+  public void clearCaches() {
+    super.clearCaches();
+    myDisplayText = null;
+    myGapDisplayStarts = null;
+    myGapPhysicalStarts = null;
+  }
+
+  @Nullable
+  public List<Pair<PsiElement, TextRange>> getInjectedPsi() {
+    return InjectedLanguageManager.getInstance(getProject()).getInjectedPsiFiles(this);
+  }
+
+  public TextRange getCDATAInterior() {
+    PsiElement[] elements = getChildren();
+    int start = 0;
+    int first = 0;
+    if (elements.length > 0 && elements[0] instanceof PsiWhiteSpace) {
+      first ++;
+    }
+    if (elements.length > first && elements[first].getNode().getElementType() == XmlElementType.XML_CDATA) {
+      ASTNode startNode = elements[first].getNode().findChildByType(XmlTokenType.XML_CDATA_START);
+      if (startNode != null) {
+        start = startNode.getTextRange().getEndOffset() - getTextRange().getStartOffset();
+      }
+    }
+    int end = getTextLength();
+    int last = elements.length - 1;
+    if (last > 0 && elements[last] instanceof PsiWhiteSpace) {
+      last --;
+    }
+    if (last >= 0 && elements[last].getNode().getElementType() == XmlElementType.XML_CDATA) {
+      ASTNode startNode = elements[last].getNode().findChildByType(XmlTokenType.XML_CDATA_END);
+      if (startNode != null) {
+        end = startNode.getTextRange().getStartOffset() - getTextRange().getStartOffset();
+      }
+    }
+
+    return new TextRange(start, end);
+  }
+
+  public PsiLanguageInjectionHost updateText(@NotNull final String text) {
+    try {
+      doSetValue(text, new DefaultXmlPsiPolicy());
+    }
+    catch (IncorrectOperationException e) {
+      LOG.error(e);
+    }
+    return this;
+  }
+
+  @Nullable
+  private XmlText _splitText(final int displayOffset) throws IncorrectOperationException{
+    final XmlTag xmlTag = (XmlTag)getParent();
+    if(displayOffset == 0) return this;
+    final int length = getValue().length();
+    if(displayOffset >= length) {
+      return null;
+    }
+
+    final PomModel model = PomManager.getModel(xmlTag.getProject());
+    final XmlAspect aspect = model.getModelAspect(XmlAspect.class);
+
+    class MyTransaction extends PomTransactionBase {
+      private XmlTextImpl myRight;
+
+      MyTransaction() {
+        super(xmlTag, aspect);
+      }
+
+      @Nullable
+      public PomModelEvent runInner() throws IncorrectOperationException {
+        final String oldText = getValue();
+        final int physicalOffset = displayToPhysical(displayOffset);
+        PsiElement childElement = findElementAt(physicalOffset);
+
+        if (childElement != null && childElement.getNode().getElementType() == XmlTokenType.XML_DATA_CHARACTERS) {
+          FileElement holder = DummyHolderFactory.createHolder(getManager(), null).getTreeElement();
+
+          int splitOffset = physicalOffset - childElement.getStartOffsetInParent();
+          myRight = (XmlTextImpl)ASTFactory.composite(XmlElementType.XML_TEXT);
+          CodeEditUtil.setNodeGenerated(myRight, true);
+          holder.rawAddChildren(myRight);
+
+          PsiElement e = childElement;
+          while (e != null) {
+            CodeEditUtil.setNodeGenerated(e.getNode(), true);
+            e = e.getNextSibling();
+          }
+
+          String leftText = childElement.getText().substring(0, splitOffset);
+          String rightText = childElement.getText().substring(splitOffset);
+
+
+          LeafElement rightElement =
+            ASTFactory.leaf(XmlTokenType.XML_DATA_CHARACTERS, holder.getCharTable().intern(rightText));
+          CodeEditUtil.setNodeGenerated(rightElement, true);
+
+          LeafElement leftElement = ASTFactory.leaf(XmlTokenType.XML_DATA_CHARACTERS, holder.getCharTable().intern(leftText));
+          CodeEditUtil.setNodeGenerated(leftElement, true);
+
+          rawInsertAfterMe(myRight);
+
+          myRight.rawAddChildren(rightElement);
+          if (childElement.getNextSibling() != null) {
+            myRight.rawAddChildren((TreeElement)childElement.getNextSibling());
+          }
+          ((TreeElement)childElement).rawRemove();
+          XmlTextImpl.this.rawAddChildren(leftElement);
+        }
+        else {
+          final PsiFile containingFile = xmlTag.getContainingFile();
+          final FileElement holder = DummyHolderFactory
+            .createHolder(containingFile.getManager(), null, ((PsiFileImpl)containingFile).getTreeElement().getCharTable()).getTreeElement();
+          final XmlTextImpl rightText = (XmlTextImpl)ASTFactory.composite(XmlElementType.XML_TEXT);
+          CodeEditUtil.setNodeGenerated(rightText, true);
+
+          holder.rawAddChildren(rightText);
+
+          ((ASTNode)xmlTag).addChild(rightText, getTreeNext());
+
+          final String value = getValue();
+
+          setValue(value.substring(0, displayOffset));
+          rightText.setValue(value.substring(displayOffset));
+
+          CodeEditUtil.setNodeGenerated(rightText, true);
+
+          myRight = rightText;
+        }
+
+        clearCaches();
+        myRight.clearCaches();
+        return createEvent(new XmlTextChangedImpl(XmlTextImpl.this, oldText), new XmlTagChildAddImpl(xmlTag, myRight));
+      }
+
+      public XmlText getResult() {
+        return myRight;
+      }
+    }
+    final MyTransaction transaction = new MyTransaction();
+    model.runTransaction(transaction);
+
+    return transaction.getResult();
+  }
+
+  private PomModelEvent createEvent(final XmlChange...events) {
+    final PomModelEvent event = new PomModelEvent(PomManager.getModel(getProject()));
+
+    final XmlAspectChangeSetImpl xmlAspectChangeSet = new XmlAspectChangeSetImpl(PomManager.getModel(getProject()), (XmlFile)getContainingFile());
+
+    for (XmlChange xmlChange : events) {
+      xmlAspectChangeSet.add(xmlChange);
+    }
+
+    event.registerChangeSet(PomManager.getModel(getProject()).getModelAspect(XmlAspect.class), xmlAspectChangeSet);
+
+    return event;
+  }
+
+  @NotNull
+  public LiteralTextEscaper<XmlTextImpl> createLiteralTextEscaper() {
+    return new XmlTextLiteralEscaper(this);
+  }
+  public void processInjectedPsi(@NotNull InjectedPsiVisitor visitor) {
+    InjectedLanguageUtil.enumerate(this, visitor);
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlTokenImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlTokenImpl.java
new file mode 100644
index 0000000..822e615
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlTokenImpl.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.ide.util.EditSourceUtil;
+import com.intellij.pom.Navigatable;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
+import com.intellij.psi.impl.source.tree.LeafPsiElement;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.xml.IDTDElementType;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author ik
+ */
+public class XmlTokenImpl extends LeafPsiElement implements XmlToken, Navigatable {
+  public XmlTokenImpl(IElementType type, CharSequence text) {
+    super(type, text);
+  }
+
+  public boolean processElements(PsiElementProcessor processor, PsiElement place) {
+    return false;
+  }
+
+  public void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof XmlElementVisitor) {
+      ((XmlElementVisitor)visitor).visitXmlToken(this);
+    }
+    else {
+      visitor.visitElement(this);
+    }
+  }
+
+  public String toString() {
+    if(getTokenType() instanceof IDTDElementType){
+      return "DTDToken:" + getTokenType().toString();
+    }
+    return "XmlToken:" + getTokenType().toString();
+  }
+
+// Implementation specific
+
+  public IElementType getTokenType() {
+    return getElementType();
+  }
+
+  @NotNull
+  public PsiReference[] getReferences() {
+    final IElementType elementType = getElementType();
+
+    if (elementType == XmlTokenType.XML_DATA_CHARACTERS ||
+        elementType == XmlTokenType.XML_CHAR_ENTITY_REF
+      ) {
+      return ReferenceProvidersRegistry.getReferencesFromProviders(this, XmlToken.class);
+    } else if (elementType == XmlTokenType.XML_NAME && getParent() instanceof PsiErrorElement) {
+      final PsiElement element = getPrevSibling();
+      
+      if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_END_TAG_START) {
+        return new PsiReference[] {TagNameReference.createTagNameReference(this, getNode(), false)};
+      }
+    }
+
+    return super.getReferences();
+  }
+
+  public void navigate(boolean requestFocus) {
+    EditSourceUtil.getDescriptor(this).navigate(requestFocus);
+  }
+
+  public boolean canNavigate() {
+    return getTokenType() == XmlTokenType.XML_NAME && EditSourceUtil.canNavigate(this);
+  }
+
+  public boolean canNavigateToSource() {
+    return canNavigate();
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XsContentDFA.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XsContentDFA.java
new file mode 100644
index 0000000..3aff250
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XsContentDFA.java
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.util.Computable;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.NullableComputable;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.actions.ValidateXmlActionHandler;
+import org.apache.xerces.impl.Constants;
+import org.apache.xerces.impl.xs.SubstitutionGroupHandler;
+import org.apache.xerces.impl.xs.XSComplexTypeDecl;
+import org.apache.xerces.impl.xs.XSElementDecl;
+import org.apache.xerces.impl.xs.XSGrammarBucket;
+import org.apache.xerces.impl.xs.models.CMBuilder;
+import org.apache.xerces.impl.xs.models.CMNodeFactory;
+import org.apache.xerces.impl.xs.models.XSCMValidator;
+import org.apache.xerces.xni.QName;
+import org.apache.xerces.xni.grammars.Grammar;
+import org.apache.xerces.xni.grammars.XMLGrammarDescription;
+import org.apache.xerces.xni.grammars.XMLGrammarPool;
+import org.apache.xerces.xni.grammars.XSGrammar;
+import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSModel;
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+class XsContentDFA extends XmlContentDFA {
+
+  private final XSCMValidator myContentModel;
+  private final SubstitutionGroupHandler myHandler;
+  private final int[] myState;
+  private final XmlElementDescriptor[] myElementDescriptors;
+
+  @Nullable
+  public static XmlContentDFA createContentDFA(@NotNull XmlTag parentTag) {
+    final PsiFile file = parentTag.getContainingFile().getOriginalFile();
+    if (!(file instanceof XmlFile)) return null;
+    XSModel xsModel = ApplicationManager.getApplication().runReadAction(new NullableComputable<XSModel>() {
+      @Override
+      public XSModel compute() {
+        return getXSModel((XmlFile)file);
+      }
+    });
+    if (xsModel == null) {
+      return null;
+    }
+
+    XSElementDeclaration decl = getElementDeclaration(parentTag, xsModel);
+    if (decl == null) {
+      return null;
+    }
+    return new XsContentDFA(decl, parentTag);
+  }
+
+  public XsContentDFA(@NotNull XSElementDeclaration decl, final XmlTag parentTag) {
+    XSComplexTypeDecl definition = (XSComplexTypeDecl)decl.getTypeDefinition();
+    myContentModel = definition.getContentModel(new CMBuilder(new CMNodeFactory()));
+    myHandler = new SubstitutionGroupHandler(new XSGrammarBucket());
+    myState = myContentModel.startContentModel();
+    myElementDescriptors = ApplicationManager.getApplication().runReadAction(new Computable<XmlElementDescriptor[]>() {
+
+      @Override
+      public XmlElementDescriptor[] compute() {
+        XmlElementDescriptor parentTagDescriptor = parentTag.getDescriptor();
+        assert parentTagDescriptor != null;
+        return parentTagDescriptor.getElementsDescriptors(parentTag);
+      }
+    });
+  }
+
+  @Override
+  public List<XmlElementDescriptor> getPossibleElements() {
+    final List vector = myContentModel.whatCanGoHere(myState);
+    ArrayList<XmlElementDescriptor> list = new ArrayList<XmlElementDescriptor>();
+    for (Object o : vector) {
+      if (o instanceof XSElementDecl) {
+        final XSElementDecl elementDecl = (XSElementDecl)o;
+        XmlElementDescriptor descriptor = ContainerUtil.find(myElementDescriptors, new Condition<XmlElementDescriptor>() {
+          @Override
+          public boolean value(XmlElementDescriptor elementDescriptor) {
+            return elementDecl.getName().equals(elementDescriptor.getName());
+          }
+        });
+        ContainerUtil.addIfNotNull(descriptor, list);
+      }
+    }
+    return list;
+  }
+
+  @Override
+  public void transition(XmlTag xmlTag) {
+    myContentModel.oneTransition(createQName(xmlTag), myState, myHandler);
+  }
+
+  private static QName createQName(XmlTag tag) {
+    //todo don't use intern to not pollute PermGen
+    String namespace = tag.getNamespace();
+    return new QName(tag.getNamespacePrefix().intern(),
+                     tag.getLocalName().intern(),
+                     tag.getName().intern(),
+                     namespace.length() == 0 ? null : namespace.intern());
+  }
+
+  @Nullable
+  private static XSElementDeclaration getElementDeclaration(XmlTag tag, XSModel xsModel) {
+
+    List<XmlTag> ancestors = new ArrayList<XmlTag>();
+    for (XmlTag t = tag; t != null; t = t.getParentTag()) {
+      ancestors.add(t);
+    }
+    Collections.reverse(ancestors);
+    XSElementDeclaration declaration = null;
+    SubstitutionGroupHandler fSubGroupHandler = new SubstitutionGroupHandler(new XSGrammarBucket());
+    CMBuilder cmBuilder = new CMBuilder(new CMNodeFactory());
+    for (XmlTag ancestor : ancestors) {
+      if (declaration == null) {
+        declaration = xsModel.getElementDeclaration(ancestor.getLocalName(), ancestor.getNamespace());
+        if (declaration == null) return null;
+        else continue;
+      }
+      XSTypeDefinition typeDefinition = declaration.getTypeDefinition();
+      if (!(typeDefinition instanceof XSComplexTypeDecl)) {
+        return null;
+      }
+
+      XSCMValidator model = ((XSComplexTypeDecl)typeDefinition).getContentModel(cmBuilder);
+      int[] ints = model.startContentModel();
+      for (XmlTag subTag : ancestor.getParentTag().getSubTags()) {
+        QName qName = createQName(subTag);
+        Object o = model.oneTransition(qName, ints, fSubGroupHandler);
+        if (subTag == ancestor) {
+          if (o instanceof XSElementDecl) {
+            declaration = (XSElementDecl)o;
+            break;
+          }
+          else return null;
+        }
+      }
+    }
+    return declaration;
+  }
+
+  @Nullable
+  private static XSModel getXSModel(XmlFile file) {
+
+    ValidateXmlActionHandler handler = new ValidateXmlActionHandler(false) {
+      @Override
+      protected SAXParser createParser() throws SAXException, ParserConfigurationException {
+        SAXParser parser = super.createParser();
+        parser.getXMLReader().setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE, true);
+        return parser;
+      }
+    };
+    handler.setErrorReporter(handler.new TestErrorReporter());
+    handler.doValidate(file);
+    XMLGrammarPool grammarPool = ValidateXmlActionHandler.getGrammarPool(file);
+    if (grammarPool == null) {
+      return null;
+    }
+    Grammar[] grammars = grammarPool.retrieveInitialGrammarSet(XMLGrammarDescription.XML_SCHEMA);
+
+    return grammars.length == 0 ? null : ((XSGrammar)grammars[0]).toXSModel(ContainerUtil.map(grammars, new Function<Grammar, XSGrammar>() {
+      @Override
+      public XSGrammar fun(Grammar grammar) {
+        return (XSGrammar)grammar;
+      }
+    }, new XSGrammar[0]));
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/behavior/CDATAOnAnyEncodedPolicy.java b/xml/impl/src/com/intellij/psi/impl/source/xml/behavior/CDATAOnAnyEncodedPolicy.java
new file mode 100644
index 0000000..c22c6d9
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/behavior/CDATAOnAnyEncodedPolicy.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml.behavior;
+
+import com.intellij.lang.ASTFactory;
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.impl.GeneratedMarkerVisitor;
+import com.intellij.psi.impl.source.DummyHolderFactory;
+import com.intellij.psi.impl.source.tree.CompositeElement;
+import com.intellij.psi.impl.source.tree.FileElement;
+import com.intellij.psi.impl.source.tree.SharedImplUtil;
+import com.intellij.psi.xml.XmlElementType;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.CharTable;
+import com.intellij.xml.util.XmlUtil;
+
+public class CDATAOnAnyEncodedPolicy extends DefaultXmlPsiPolicy{
+  public ASTNode encodeXmlTextContents(String displayText, PsiElement text) {
+    final ASTNode firstChild = text.getNode().getFirstChildNode();
+    boolean textAlreadyHasCDATA = firstChild != null && firstChild.getElementType() == XmlElementType.XML_CDATA;
+    if ((textAlreadyHasCDATA || XmlUtil.toCode(displayText)) && displayText.length() > 0) {
+      final FileElement dummyParent = createCDATAElement(text.getManager(), SharedImplUtil.findCharTableByTree(text.getNode()), displayText);
+      return dummyParent.getFirstChildNode();
+    }
+    else {
+      return super.encodeXmlTextContents(displayText, text);
+    }
+  }
+
+  @SuppressWarnings({"HardCodedStringLiteral"})
+  public static FileElement createCDATAElement(final PsiManager manager, final CharTable charTableByTree, final String displayText) {
+    final FileElement dummyParent = DummyHolderFactory.createHolder(manager, null, charTableByTree).getTreeElement();
+    final CompositeElement cdata = ASTFactory.composite(XmlElementType.XML_CDATA);
+    dummyParent.rawAddChildren(cdata);
+    cdata.rawAddChildren(ASTFactory.leaf(XmlTokenType.XML_CDATA_START, "<![CDATA["));
+    cdata.rawAddChildren(ASTFactory.leaf(XmlTokenType.XML_DATA_CHARACTERS, dummyParent.getCharTable().intern(displayText)));
+    cdata.rawAddChildren(ASTFactory.leaf(XmlTokenType.XML_CDATA_END, "]]>"));
+    dummyParent.acceptTree(new GeneratedMarkerVisitor());
+    return dummyParent;
+  }
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/behavior/DefaultXmlPsiPolicy.java b/xml/impl/src/com/intellij/psi/impl/source/xml/behavior/DefaultXmlPsiPolicy.java
new file mode 100644
index 0000000..a5bfb19
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/behavior/DefaultXmlPsiPolicy.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml.behavior;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiFileFactory;
+import com.intellij.psi.impl.source.DummyHolderFactory;
+import com.intellij.psi.impl.source.tree.FileElement;
+import com.intellij.psi.impl.source.tree.SharedImplUtil;
+import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.impl.source.tree.TreeUtil;
+import com.intellij.psi.impl.source.xml.XmlPsiPolicy;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagChild;
+import com.intellij.util.CharTable;
+
+public class DefaultXmlPsiPolicy implements XmlPsiPolicy{
+  private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.behavior.DefaultXmlPsiPolicy");
+
+  public ASTNode encodeXmlTextContents(String displayText, PsiElement text) {
+    final PsiFile containingFile = text.getContainingFile();
+    CharTable charTable = SharedImplUtil.findCharTableByTree(text.getNode());
+    final FileElement dummyParent = DummyHolderFactory.createHolder(text.getManager(), null, charTable).getTreeElement();
+    final XmlTag rootTag =
+      ((XmlFile)PsiFileFactory.getInstance(containingFile.getProject())
+        .createFileFromText("a.xml", "<a>" + displayText + "</a>")).getRootTag();
+
+    assert rootTag != null;
+    final XmlTagChild[] tagChildren = rootTag.getValue().getChildren();
+
+    final XmlTagChild child = tagChildren.length > 0 ? tagChildren[0]:null;
+    LOG.assertTrue(child != null, "Child is null for tag: " + rootTag.getText());
+
+    final TreeElement element = (TreeElement)child.getNode();
+    ((TreeElement)tagChildren[tagChildren.length - 1].getNode().getTreeNext()).rawRemoveUpToLast();
+    dummyParent.rawAddChildren(element);
+    TreeUtil.clearCaches(dummyParent);
+    return element.getFirstChildNode();
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/behavior/EncodeEachSymbolPolicy.java b/xml/impl/src/com/intellij/psi/impl/source/xml/behavior/EncodeEachSymbolPolicy.java
new file mode 100644
index 0000000..ebb0117
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/behavior/EncodeEachSymbolPolicy.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.impl.source.xml.behavior;
+
+import com.intellij.lang.ASTFactory;
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.impl.GeneratedMarkerVisitor;
+import com.intellij.psi.impl.source.DummyHolderFactory;
+import com.intellij.psi.impl.source.tree.FileElement;
+import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.impl.source.tree.SharedImplUtil;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.psi.PsiElement;
+import com.intellij.util.CharTable;
+
+public class EncodeEachSymbolPolicy extends DefaultXmlPsiPolicy{
+  public ASTNode encodeXmlTextContents(String displayText, PsiElement text) {
+    if(!toCode(displayText)) return super.encodeXmlTextContents(displayText, text);
+    final FileElement dummyParent = DummyHolderFactory.createHolder(text.getManager(), null, SharedImplUtil.findCharTableByTree(text.getNode())).getTreeElement();
+    int sectionStartOffset = 0;
+    int offset = 0;
+    while (offset < displayText.length()) {
+      if (toCode(displayText.charAt(offset))) {
+        final String plainSection = displayText.substring(sectionStartOffset, offset);
+        if (plainSection.length() > 0) {
+          dummyParent.rawAddChildren((TreeElement)super.encodeXmlTextContents(plainSection, text));
+        }
+        dummyParent.rawAddChildren(createCharEntity(displayText.charAt(offset), dummyParent.getCharTable()));
+        sectionStartOffset = offset + 1;
+      }
+      offset++;
+    }
+    final String plainSection = displayText.substring(sectionStartOffset, offset);
+    if (plainSection.length() > 0) {
+      dummyParent.rawAddChildren((TreeElement)super.encodeXmlTextContents(plainSection, text));
+    }
+
+    dummyParent.acceptTree(new GeneratedMarkerVisitor());
+    return dummyParent.getFirstChildNode();
+  }
+
+  @SuppressWarnings({"HardCodedStringLiteral"})
+  private static TreeElement createCharEntity(char ch, CharTable charTable) {
+    switch (ch) {
+      case '<':
+        return ASTFactory.leaf(XmlTokenType.XML_CHAR_ENTITY_REF, "&lt;");
+      case '\'':
+        return ASTFactory.leaf(XmlTokenType.XML_CHAR_ENTITY_REF, "&apos;");
+      case '"':
+        return ASTFactory.leaf(XmlTokenType.XML_CHAR_ENTITY_REF, "&quot;");
+      case '>':
+        return ASTFactory.leaf(XmlTokenType.XML_CHAR_ENTITY_REF, "&gt;");
+      case '&':
+        return ASTFactory.leaf(XmlTokenType.XML_CHAR_ENTITY_REF, "&amp;");
+      case '\u00a0':
+        return ASTFactory.leaf(XmlTokenType.XML_CHAR_ENTITY_REF, "&nbsp;");
+
+      default:
+        final String charEncoding = "&#" + (int)ch + ";";
+        return ASTFactory.leaf(XmlTokenType.XML_CHAR_ENTITY_REF, charTable.intern(charEncoding));
+    }
+  }
+
+  private static boolean toCode(String str) {
+    for (int i = 0; i < str.length(); i++) {
+      final char ch = str.charAt(i);
+      if ( toCode(ch)) return true;
+    }
+    return false;
+  }
+
+  private static boolean toCode(final char ch) {
+    return "<&>\u00a0'\"".indexOf(ch) >= 0;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/psi/xml/XmlChildRole.java b/xml/impl/src/com/intellij/psi/xml/XmlChildRole.java
new file mode 100644
index 0000000..0e39ab2
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/xml/XmlChildRole.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.tree.DefaultRoleFinder;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.RoleFinder;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.util.XmlTagUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public interface XmlChildRole {
+
+  interface StartTagEndTokenProvider {
+    IElementType[] getTypes();
+  }
+
+  ExtensionPointName<StartTagEndTokenProvider> EP_NAME = new ExtensionPointName<StartTagEndTokenProvider>("com.intellij.xml.startTagEndToken");
+
+  RoleFinder START_TAG_NAME_FINDER = new RoleFinder() {
+    public ASTNode findChild(@NotNull ASTNode parent) {
+      final PsiElement element = XmlTagUtil.getStartTagNameElement((XmlTag)parent.getPsi());
+      return element == null ? null : element.getNode();
+    }
+  };
+
+  RoleFinder CLOSING_TAG_NAME_FINDER = new RoleFinder() {
+    @Nullable
+    public ASTNode findChild(@NotNull ASTNode parent) {
+      final PsiElement element = XmlTagUtil.getEndTagNameElement((XmlTag)parent.getPsi());
+      return element == null ? null : element.getNode();
+    }
+  };
+
+  RoleFinder DOCUMENT_FINDER = new RoleFinder() {
+    public ASTNode findChild(@NotNull ASTNode parent) {
+      ASTNode oldDocument = parent.findChildByType(XmlElementType.XML_DOCUMENT);
+      if(oldDocument == null) oldDocument = parent.findChildByType(XmlElementType.HTML_DOCUMENT);
+      return oldDocument;
+    }
+  };
+
+  RoleFinder ATTRIBUTE_VALUE_FINDER = new DefaultRoleFinder(XmlElementType.XML_ATTRIBUTE_VALUE);
+  RoleFinder CLOSING_TAG_START_FINDER = new DefaultRoleFinder(XmlTokenType.XML_END_TAG_START);
+  RoleFinder EMPTY_TAG_END_FINDER = new DefaultRoleFinder(XmlTokenType.XML_EMPTY_ELEMENT_END);
+  RoleFinder ATTRIBUTE_NAME_FINDER = new DefaultRoleFinder(XmlTokenType.XML_NAME);
+  RoleFinder ATTRIBUTE_VALUE_VALUE_FINDER = new DefaultRoleFinder(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN);
+  RoleFinder START_TAG_END_FINDER = new DefaultRoleFinder(XmlTokenType.XML_TAG_END) {
+    {
+      final StartTagEndTokenProvider[] tokenProviders = Extensions.getExtensions(EP_NAME);
+      for (StartTagEndTokenProvider tokenProvider : tokenProviders) {
+        myElementTypes = ArrayUtil.mergeArrays(myElementTypes, tokenProvider.getTypes());
+      }
+    }
+  };
+  RoleFinder START_TAG_START_FINDER = new DefaultRoleFinder(XmlTokenType.XML_START_TAG_START);
+  RoleFinder PROLOG_FINDER = new DefaultRoleFinder(XmlElementType.XML_PROLOG);
+
+
+  int XML_DOCUMENT = 223;
+  int XML_TAG_NAME = 224;
+  int XML_PROLOG = 225;
+  int XML_DOCTYPE = 226;
+  int XML_DOCTYPE_PUBLIC = 227;
+  int XML_DOCTYPE_SYSTEM = 228;
+  int XML_NAME = 229;
+  int XML_ELEMENT_CONTENT_SPEC = 230;
+  int XML_CONTENT_ANY = 231;
+  int XML_CONTENT_EMPTY = 232;
+  int XML_PCDATA = 233;
+  int XML_ATT_REQUIRED = 234;
+  int XML_ATT_IMPLIED = 235;
+  int XML_ATT_FIXED = 236;
+  int XML_DEFAULT_VALUE = 237;
+  int XML_ENUMERATED_TYPE = 238;
+  int XML_ATTRIBUTE = 240;
+  int XML_TAG = 241;
+  int XML_ATTRIBUTE_VALUE = 243;
+  int HTML_DOCUMENT = 252;
+}
diff --git a/xml/impl/src/com/intellij/psi/xml/XmlElementType.java b/xml/impl/src/com/intellij/psi/xml/XmlElementType.java
new file mode 100644
index 0000000..4b33722
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/xml/XmlElementType.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.dtd.DTDLanguage;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.xhtml.XHTMLLanguage;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.psi.impl.source.parsing.xml.DtdParsing;
+import com.intellij.psi.tree.CustomParsingType;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.IFileElementType;
+import com.intellij.psi.tree.xml.IXmlElementType;
+import com.intellij.util.CharTable;
+
+
+public interface XmlElementType extends XmlTokenType {
+  IElementType XML_DOCUMENT = new IXmlElementType("XML_DOCUMENT");
+  IElementType XML_PROLOG = new IXmlElementType("XML_PROLOG");
+  IElementType XML_DECL = new IXmlElementType("XML_DECL");
+  IElementType XML_DOCTYPE = new IXmlElementType("XML_DOCTYPE");
+  IElementType XML_ATTRIBUTE = new IXmlElementType("XML_ATTRIBUTE");
+  IElementType XML_COMMENT = new IXmlElementType("XML_COMMENT");
+  IElementType XML_TAG = new IXmlElementType("XML_TAG");
+  IElementType XML_ELEMENT_DECL = new IXmlElementType("XML_ELEMENT_DECL");
+  IElementType XML_CONDITIONAL_SECTION = new IXmlElementType("XML_CONDITIONAL_SECTION");
+
+  IElementType XML_ATTLIST_DECL = new IXmlElementType("XML_ATTLIST_DECL");
+  IElementType XML_NOTATION_DECL = new IXmlElementType("XML_NOTATION_DECL");
+  IElementType XML_ENTITY_DECL = new IXmlElementType("XML_ENTITY_DECL");
+  IElementType XML_ELEMENT_CONTENT_SPEC = new IXmlElementType("XML_ELEMENT_CONTENT_SPEC");
+  IElementType XML_ELEMENT_CONTENT_GROUP = new IXmlElementType("XML_ELEMENT_CONTENT_GROUP");
+  IElementType XML_ATTRIBUTE_DECL = new IXmlElementType("XML_ATTRIBUTE_DECL");
+  IElementType XML_ATTRIBUTE_VALUE = new IXmlElementType("XML_ATTRIBUTE_VALUE");
+  IElementType XML_ENTITY_REF = new IXmlElementType("XML_ENTITY_REF");
+  IElementType XML_ENUMERATED_TYPE = new IXmlElementType("XML_ENUMERATED_TYPE");
+  IElementType XML_PROCESSING_INSTRUCTION = new IXmlElementType("XML_PROCESSING_INSTRUCTION");
+  IElementType XML_CDATA = new IXmlElementType("XML_CDATA");
+
+  //todo: move to html
+  IElementType HTML_DOCUMENT = new IXmlElementType("HTML_DOCUMENT");
+  IElementType HTML_TAG = new IXmlElementType("HTML_TAG");
+  IFileElementType HTML_FILE = new IFileElementType(HTMLLanguage.INSTANCE);
+
+  IElementType XML_TEXT = new XmlTextElementType();
+
+  IFileElementType XML_FILE = new IFileElementType(XMLLanguage.INSTANCE);
+  IElementType XHTML_FILE = new IFileElementType(XHTMLLanguage.INSTANCE);
+
+
+  IFileElementType DTD_FILE = new IFileElementType("DTD_FILE", DTDLanguage.INSTANCE);
+
+  IElementType XML_MARKUP_DECL = new CustomParsingType("XML_MARKUP_DECL", XMLLanguage.INSTANCE){
+    public ASTNode parse(CharSequence text, CharTable table) {
+      return new DtdParsing(text, XML_MARKUP_DECL, DtdParsing.TYPE_FOR_MARKUP_DECL, null).parse();
+    }
+  };
+}
diff --git a/xml/impl/src/com/intellij/psi/xml/XmlTextElementType.java b/xml/impl/src/com/intellij/psi/xml/XmlTextElementType.java
new file mode 100644
index 0000000..911981f
--- /dev/null
+++ b/xml/impl/src/com/intellij/psi/xml/XmlTextElementType.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.tree.IStrongWhitespaceHolderElementType;
+import com.intellij.psi.tree.xml.IXmlElementType;
+
+class XmlTextElementType extends IXmlElementType implements IStrongWhitespaceHolderElementType {
+  public XmlTextElementType() {
+    super("XML_TEXT");
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/refactoring/XmlImportOptimizer.java b/xml/impl/src/com/intellij/refactoring/XmlImportOptimizer.java
new file mode 100644
index 0000000..3803b16
--- /dev/null
+++ b/xml/impl/src/com/intellij/refactoring/XmlImportOptimizer.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.refactoring;
+
+import com.intellij.codeInsight.daemon.impl.analysis.XmlUnusedNamespaceInspection;
+import com.intellij.codeInspection.InspectionManager;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.codeInspection.QuickFix;
+import com.intellij.lang.ImportOptimizer;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Condition;
+import com.intellij.psi.*;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 11/7/11
+ */
+public class XmlImportOptimizer implements ImportOptimizer {
+
+  private final XmlUnusedNamespaceInspection myInspection = new XmlUnusedNamespaceInspection();
+  private final Condition<ProblemDescriptor> myCondition = new Condition<ProblemDescriptor>() {
+    @Override
+    public boolean value(ProblemDescriptor descriptor) {
+      PsiElement element = descriptor.getPsiElement();
+      PsiElement parent = element.getParent();
+      return parent != null && !myInspection.isSuppressedFor(parent);
+    }
+  };
+
+  @Override
+  public boolean supports(PsiFile file) {
+    return file instanceof XmlFile;
+  }
+
+  @NotNull
+  @Override
+  public Runnable processFile(final PsiFile file) {
+    return new Runnable() {
+      @Override
+      public void run() {
+        XmlFile xmlFile = (XmlFile)file;
+        Project project = xmlFile.getProject();
+        ProblemsHolder holder = new ProblemsHolder(InspectionManager.getInstance(project), xmlFile, false);
+        final XmlElementVisitor visitor = (XmlElementVisitor)myInspection.buildVisitor(holder, false);
+        new PsiRecursiveElementVisitor() {
+          @Override
+          public void visitElement(PsiElement element) {
+            if (element instanceof XmlAttribute) {
+              visitor.visitXmlAttribute((XmlAttribute)element);
+            }
+            else {
+              super.visitElement(element);
+            }
+          }
+        }.visitFile(xmlFile);
+        ProblemDescriptor[] results = holder.getResultsArray();
+        ArrayUtil.reverseArray(results);
+        List<ProblemDescriptor> list = ContainerUtil.filter(results, myCondition);
+
+        Map<XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix, ProblemDescriptor> fixes = new LinkedHashMap<XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix, ProblemDescriptor>();
+        for (ProblemDescriptor result : list) {
+          for (QuickFix fix : result.getFixes()) {
+            if (fix instanceof XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix) {
+              fixes.put((XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix)fix, result);
+            }
+          }
+        }
+
+        SmartPsiElementPointer<XmlTag> pointer = null;
+        for (Map.Entry<XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix, ProblemDescriptor> fix : fixes.entrySet()) {
+          pointer = fix.getKey().doFix(project, fix.getValue(), false);
+        }
+        if (pointer != null) {
+          XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix.reformatStartTag(project, pointer);
+        }
+      }
+    };
+  }
+}
diff --git a/xml/impl/src/com/intellij/refactoring/rename/RenameXmlAttributeProcessor.java b/xml/impl/src/com/intellij/refactoring/rename/RenameXmlAttributeProcessor.java
new file mode 100644
index 0000000..1f7885b
--- /dev/null
+++ b/xml/impl/src/com/intellij/refactoring/rename/RenameXmlAttributeProcessor.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.refactoring.rename;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFileFactory;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.search.LocalSearchScope;
+import com.intellij.psi.search.searches.ReferencesSearch;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.refactoring.listeners.RefactoringElementListener;
+import com.intellij.usageView.UsageInfo;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.Queue;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class RenameXmlAttributeProcessor extends RenamePsiElementProcessor {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.refactoring.rename.RenameXmlAttributeProcessor");
+
+  public boolean canProcessElement(@NotNull final PsiElement element) {
+    return element instanceof XmlAttribute || element instanceof XmlAttributeValue;
+  }
+
+  public void renameElement(final PsiElement element,
+                            final String newName,
+                            final UsageInfo[] usages,
+                            @Nullable RefactoringElementListener listener) throws IncorrectOperationException {
+    if (element instanceof XmlAttribute) {
+      doRenameXmlAttribute((XmlAttribute)element, newName, listener);
+    }
+    else if (element instanceof XmlAttributeValue) {
+      doRenameXmlAttributeValue((XmlAttributeValue)element, newName, usages, listener);
+    }
+  }
+
+  private static void doRenameXmlAttribute(XmlAttribute attribute,
+                                           String newName,
+                                           @Nullable RefactoringElementListener listener) {
+    try {
+      final PsiElement element = attribute.setName(newName);
+      if (listener != null) {
+        listener.elementRenamed(element);
+      }
+    }
+    catch (IncorrectOperationException e) {
+      LOG.error(e);
+    }
+  }
+
+  private static void doRenameXmlAttributeValue(@NotNull XmlAttributeValue value,
+                                                String newName,
+                                                UsageInfo[] infos,
+                                                @Nullable RefactoringElementListener listener)
+    throws IncorrectOperationException {
+    LOG.assertTrue(value.isValid());
+
+    renameAll(value, infos, newName, value.getValue());
+
+    PsiManager psiManager = value.getManager();
+    LOG.assertTrue(psiManager != null);
+    XmlFile file = (XmlFile)PsiFileFactory.getInstance(psiManager.getProject()).createFileFromText("dummy.xml", "<a attr=\"" + newName + "\"/>");
+    final PsiElement element = value.replace(file.getDocument().getRootTag().getAttributes()[0].getValueElement());
+    if (listener != null) {
+      listener.elementRenamed(element);
+    }
+  }
+
+  private static void renameAll(PsiElement originalElement, UsageInfo[] infos, String newName,
+                                String originalName) throws IncorrectOperationException {
+    if (newName.equals(originalName)) return;
+    Queue<PsiReference> queue = new Queue<PsiReference>(infos.length);
+    for (UsageInfo info : infos) {
+      if (info.getElement() == null) continue;
+      PsiReference ref = info.getReference();
+      if (ref == null) continue;
+      queue.addLast(ref);
+    }
+
+    while(!queue.isEmpty()) {
+      final PsiReference reference = queue.pullFirst();
+      final PsiElement oldElement = reference.getElement();
+      if (!oldElement.isValid() || oldElement == originalElement) continue;
+      final PsiElement newElement = reference.handleElementRename(newName);
+      if (!oldElement.isValid()) {
+        for (PsiReference psiReference : ReferencesSearch.search(originalElement, new LocalSearchScope(newElement), false)) {
+          queue.addLast(psiReference);
+        }
+      }
+    }
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/refactoring/util/XmlNonCodeSearchElementDescriptionProvider.java b/xml/impl/src/com/intellij/refactoring/util/XmlNonCodeSearchElementDescriptionProvider.java
new file mode 100644
index 0000000..dac3df8
--- /dev/null
+++ b/xml/impl/src/com/intellij/refactoring/util/XmlNonCodeSearchElementDescriptionProvider.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.refactoring.util;
+
+import com.intellij.psi.ElementDescriptionLocation;
+import com.intellij.psi.ElementDescriptionProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author yole
+ */
+public class XmlNonCodeSearchElementDescriptionProvider implements ElementDescriptionProvider {
+  public String getElementDescription(@NotNull final PsiElement element, @NotNull final ElementDescriptionLocation location) {
+    if (!(location instanceof NonCodeSearchDescriptionLocation)) return null;
+    final NonCodeSearchDescriptionLocation ncdLocation = (NonCodeSearchDescriptionLocation)location;
+    if (ncdLocation.isNonJava()) return null;
+    if (element instanceof XmlTag) {
+      return ((XmlTag)element).getValue().getTrimmedText();
+    }
+    else if (element instanceof XmlAttribute) {
+      return ((XmlAttribute)element).getValue();
+    }
+    else if (element instanceof XmlAttributeValue) {
+      return ((XmlAttributeValue)element).getValue();
+    }
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/usageView/XmlUsageViewDescriptionProvider.java b/xml/impl/src/com/intellij/usageView/XmlUsageViewDescriptionProvider.java
new file mode 100644
index 0000000..b499d785
--- /dev/null
+++ b/xml/impl/src/com/intellij/usageView/XmlUsageViewDescriptionProvider.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.usageView;
+
+import com.intellij.psi.ElementDescriptionLocation;
+import com.intellij.psi.ElementDescriptionProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author yole
+ */
+public class XmlUsageViewDescriptionProvider implements ElementDescriptionProvider {
+  public String getElementDescription(@NotNull final PsiElement element, @NotNull final ElementDescriptionLocation location) {
+    if (location instanceof UsageViewShortNameLocation) {
+      if (element instanceof XmlAttributeValue) {
+        return ((XmlAttributeValue)element).getValue();
+      }
+    }
+
+    if (location instanceof UsageViewLongNameLocation) {
+      if (element instanceof XmlTag) {
+        return ((XmlTag)element).getName();
+      }
+      else if (element instanceof XmlAttributeValue) {
+        return ((XmlAttributeValue)element).getValue();
+      }
+    }
+
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/vcsUtil/XmlVcsSelectionProvider.java b/xml/impl/src/com/intellij/vcsUtil/XmlVcsSelectionProvider.java
new file mode 100644
index 0000000..50b9279
--- /dev/null
+++ b/xml/impl/src/com/intellij/vcsUtil/XmlVcsSelectionProvider.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.vcsUtil;
+
+import com.intellij.codeInsight.TargetElementUtilBase;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.fileEditor.FileDocumentManager;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.vcs.VcsBundle;
+import com.intellij.openapi.vcs.actions.VcsContext;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlText;
+
+/**
+ * @author yole
+ */
+public class XmlVcsSelectionProvider implements VcsSelectionProvider {
+  public VcsSelection getSelection(VcsContext context) {
+    final Editor editor = context.getEditor();
+      if (editor == null) return null;
+      PsiElement psiElement = TargetElementUtilBase.findTargetElement(editor, TargetElementUtilBase.ELEMENT_NAME_ACCEPTED);
+      if (psiElement == null || !psiElement.isValid()) {
+        return null;
+      }
+
+      final String actionName;
+
+      if (psiElement instanceof XmlTag) {
+        actionName = VcsBundle.message("action.name.show.history.for.tag");
+      }
+      else if (psiElement instanceof XmlText) {
+        actionName = VcsBundle.message("action.name.show.history.for.text");
+      }
+      else {
+        return null;
+      }
+
+      TextRange textRange = psiElement.getTextRange();
+      if (textRange == null) {
+        return null;
+      }
+
+      VirtualFile virtualFile = psiElement.getContainingFile().getVirtualFile();
+      if (virtualFile == null) {
+        return null;
+      }
+      if (!virtualFile.isValid()) {
+        return null;
+      }
+
+      Document document = FileDocumentManager.getInstance().getDocument(virtualFile);
+      return new VcsSelection(document, textRange, actionName);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/DefaultXmlExtension.java b/xml/impl/src/com/intellij/xml/DefaultXmlExtension.java
new file mode 100644
index 0000000..d692afa
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/DefaultXmlExtension.java
@@ -0,0 +1,287 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.ScrollType;
+import com.intellij.openapi.module.ModuleUtilCore;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.impl.source.xml.SchemaPrefix;
+import com.intellij.psi.impl.source.xml.TagNameReference;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.index.XmlNamespaceIndex;
+import com.intellij.xml.index.XmlTagNamesIndex;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class DefaultXmlExtension extends XmlExtension {
+  
+  public boolean isAvailable(final PsiFile file) {
+    return true;
+  }
+
+  @NotNull
+  public List<Pair<String,String>> getAvailableTagNames(@NotNull final XmlFile file, @NotNull final XmlTag context) {
+
+    final Set<String> namespaces = new HashSet<String>(Arrays.asList(context.knownNamespaces()));
+    final List<XmlSchemaProvider> providers = XmlSchemaProvider.getAvailableProviders(file);
+    for (XmlSchemaProvider provider : providers) {
+      namespaces.addAll(provider.getAvailableNamespaces(file, null));
+    }
+    final ArrayList<String> nsInfo = new ArrayList<String>();
+    final String[] names = TagNameReference.getTagNameVariants(context, namespaces, nsInfo);
+    final List<Pair<String, String>> set = new ArrayList<Pair<String,String>>(names.length);
+    final Iterator<String> iterator = nsInfo.iterator();
+    for (String name : names) {
+      final int pos = name.indexOf(':');
+      final String s = pos >= 0 ? name.substring(pos + 1) : name;
+      set.add(Pair.create(s, iterator.next()));
+    }
+    return set;
+  }
+
+  @NotNull
+  public Set<String> getNamespacesByTagName(@NotNull final String tagName, @NotNull final XmlFile context) {
+    final List<XmlSchemaProvider> providers = XmlSchemaProvider.getAvailableProviders(context);
+
+    HashSet<String> set = new HashSet<String>();
+    for (XmlSchemaProvider provider : providers) {
+      set.addAll(provider.getAvailableNamespaces(context, tagName));
+    }
+    return set;
+  }
+
+  public static Set<String> filterNamespaces(final Set<String> namespaces, final String tagName, final XmlFile context) {
+    if (tagName == null) {
+      return namespaces;
+    }
+    final HashSet<String> set = new HashSet<String>();
+    for (String namespace : namespaces) {
+      final XmlFile xmlFile = XmlUtil.findNamespace(context, namespace);
+      if (xmlFile != null) {
+        final XmlDocument document = xmlFile.getDocument();
+        assert document != null;
+        final XmlNSDescriptor nsDescriptor = (XmlNSDescriptor)document.getMetaData();
+        assert nsDescriptor != null;
+        final XmlElementDescriptor[] elementDescriptors = nsDescriptor.getRootElementsDescriptors(document);
+        for (XmlElementDescriptor elementDescriptor : elementDescriptors) {
+          if (hasTag(elementDescriptor, tagName, new HashSet<XmlElementDescriptor>())) {
+            set.add(namespace);
+            break;
+          }
+        }
+      }
+    }
+    return set;
+  }
+
+  private static boolean hasTag(XmlElementDescriptor elementDescriptor, String tagName, Set<XmlElementDescriptor> visited) {
+    final String name = elementDescriptor.getDefaultName();
+    if (name.equals(tagName)) {
+      return true;
+    }
+    for (XmlElementDescriptor descriptor : elementDescriptor.getElementsDescriptors(null)) {
+      if (!visited.contains(elementDescriptor)) {
+        visited.add(elementDescriptor);
+        if (hasTag(descriptor, tagName, visited)) {
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+
+  @NotNull
+  public Set<String> guessUnboundNamespaces(@NotNull final PsiElement element, @NotNull XmlFile file) {
+    if (!(element instanceof XmlTag)) {
+      return Collections.emptySet();
+    }
+    final XmlTag tag = (XmlTag)element;
+    final String name = tag.getLocalName();
+    final Set<String> byTagName = getNamespacesByTagName(name, file);
+    if (!byTagName.isEmpty()) {
+      Set<String> filtered = new HashSet<String>(byTagName);
+      filtered.removeAll(Arrays.asList(tag.knownNamespaces()));
+      return filtered;
+    }
+    final Set<String> set = guessNamespace(file, name);
+    set.removeAll(Arrays.asList(tag.knownNamespaces()));
+
+    final XmlTag parentTag = tag.getParentTag();
+    ns: for (Iterator<String> i = set.iterator(); i.hasNext();) {
+      final String s = i.next();
+      final Collection<XmlFile> namespaces = XmlUtil.findNSFilesByURI(s, element.getProject(), ModuleUtilCore.findModuleForPsiElement(file));
+      for (XmlFile namespace : namespaces) {
+        final XmlDocument document = namespace.getDocument();
+        assert document != null;
+        final XmlNSDescriptor nsDescriptor = (XmlNSDescriptor)document.getMetaData();
+        assert nsDescriptor != null;
+        if (parentTag != null) {
+          continue ns;
+        }
+        final XmlElementDescriptor[] descriptors = nsDescriptor.getRootElementsDescriptors(document);
+        for (XmlElementDescriptor descriptor : descriptors) {
+          if (descriptor == null) {
+            LOG.error(nsDescriptor + " returned null element for getRootElementsDescriptors() array");
+          }
+          if (descriptor.getName().equals(name)) {
+            continue ns;
+          }
+        }
+      }
+      i.remove();
+    }
+    return set;
+  }
+
+  public void insertNamespaceDeclaration(@NotNull final XmlFile file,
+                                         @Nullable final Editor editor,
+                                         @NotNull final Set<String> possibleNamespaces,
+                                         @Nullable String nsPrefix,
+                                         @Nullable final Runner<String, IncorrectOperationException> runAfter) throws IncorrectOperationException {
+
+    final String namespace = possibleNamespaces.iterator().next();
+
+    final Project project = file.getProject();
+    final XmlDocument document = file.getDocument();
+    assert document != null;
+    final XmlTag rootTag = document.getRootTag();
+    assert rootTag != null;
+    final XmlAttribute[] attributes = rootTag.getAttributes();
+    XmlAttribute anchor = null;
+    for (XmlAttribute attribute : attributes) {
+      final XmlAttributeDescriptor descriptor = attribute.getDescriptor();
+      if (attribute.isNamespaceDeclaration() || (descriptor != null && descriptor.isRequired())) {
+        anchor = attribute;
+      } else {
+        break;
+      }
+    }
+    
+    final List<XmlSchemaProvider> providers = XmlSchemaProvider.getAvailableProviders(file);
+    String prefix = nsPrefix;
+    if (prefix == null) {
+      for (XmlSchemaProvider provider : providers) {
+        prefix = provider.getDefaultPrefix(namespace, file);
+        if (prefix != null) {
+          break;
+        }
+      }
+    }
+    if (prefix == null) {
+      prefix = "";
+    }
+    final XmlElementFactory elementFactory = XmlElementFactory.getInstance(project);
+
+    @NonNls final String qname = "xmlns" + (prefix.length() > 0 ? ":"+ prefix :"");
+    final XmlAttribute attribute = elementFactory.createXmlAttribute(qname, namespace);
+    if (anchor == null) {
+      rootTag.add(attribute);
+    } else {
+      rootTag.addAfter(attribute, anchor);
+    }
+
+    String location = null;
+    if (namespace.length() > 0) {
+      for (XmlSchemaProvider provider : providers) {
+        Set<String> locations = provider.getLocations(namespace, file);
+        if (locations != null && !locations.isEmpty()) {
+          location = locations.iterator().next();
+        }
+      }
+    }
+
+    if (location != null) {
+      XmlAttribute xmlAttribute = rootTag.getAttribute("xsi:schemaLocation");
+      final String pair = namespace + " " + location;
+      if (xmlAttribute == null) {
+        xmlAttribute = elementFactory.createXmlAttribute("xsi:schemaLocation", pair);
+        rootTag.add(xmlAttribute);
+      } else {
+        final String value = xmlAttribute.getValue();
+        if (!value.contains(namespace)) {
+          if (StringUtil.isEmptyOrSpaces(value)) {
+            xmlAttribute.setValue(pair);
+          } else {
+            xmlAttribute.setValue(value.trim() + " " + pair);
+          }
+        }
+      }
+    }
+    XmlUtil.reformatTagStart(rootTag);
+    
+    if (editor != null && namespace.length() == 0) {
+      final XmlAttribute xmlAttribute = rootTag.getAttribute(qname);
+      if (xmlAttribute != null) {
+        final XmlAttributeValue value = xmlAttribute.getValueElement();
+        assert value != null;
+        final int startOffset = value.getTextOffset();
+        editor.getCaretModel().moveToOffset(startOffset);
+        editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
+      }
+    }
+    if (runAfter != null) {
+      runAfter.run(prefix);
+    }
+  }
+
+  public SchemaPrefix getPrefixDeclaration(final XmlTag context, String namespacePrefix) {
+    @NonNls String nsDeclarationAttrName = null;
+    for(XmlTag t = context; t != null; t = t.getParentTag()) {
+      if (t.hasNamespaceDeclarations()) {
+        if (nsDeclarationAttrName == null) nsDeclarationAttrName = namespacePrefix.length() > 0 ? "xmlns:"+namespacePrefix:"xmlns";
+        XmlAttribute attribute = t.getAttribute(nsDeclarationAttrName);
+        if (attribute != null) {
+          final String attrPrefix = attribute.getNamespacePrefix();
+          final TextRange textRange = TextRange.from(attrPrefix.length() + 1, namespacePrefix.length());
+          return new SchemaPrefix(attribute, textRange, namespacePrefix);
+        }
+      }
+    }
+    return null;
+  }
+
+  private static Set<String> guessNamespace(final PsiFile file, String tagName) {
+    final Project project = file.getProject();
+    final Collection<VirtualFile> files = XmlTagNamesIndex.getFilesByTagName(tagName, project);
+    final Set<String> possibleUris = new LinkedHashSet<String>(files.size());
+    for (VirtualFile virtualFile : files) {
+      final String namespace = XmlNamespaceIndex.getNamespace(virtualFile, project, file);
+      if (namespace != null) {
+        possibleUris.add(namespace);
+      }
+    }
+    return possibleUris;
+  }
+
+  private final static Logger LOG = Logger.getInstance(DefaultXmlExtension.class);
+}
diff --git a/xml/impl/src/com/intellij/xml/Html5SchemaProvider.java b/xml/impl/src/com/intellij/xml/Html5SchemaProvider.java
new file mode 100644
index 0000000..218498b
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/Html5SchemaProvider.java
@@ -0,0 +1,70 @@
+package com.intellij.xml;
+
+import com.intellij.javaee.ExternalResourceManagerImpl;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VfsUtilCore;
+import com.intellij.util.io.URLUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.net.URL;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public abstract class Html5SchemaProvider {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.Html5SchemaProvider");
+
+  private static final ExtensionPointName<Html5SchemaProvider> EP_NAME = ExtensionPointName.create("com.intellij.xml.html5SchemaProvider");
+
+  public static final String HTML5_SCHEMA_LOCATION;
+  public static final String XHTML5_SCHEMA_LOCATION;
+
+  @NotNull
+  public abstract URL getHtmlSchemaLocation();
+
+  @NotNull
+  public abstract URL getXhtmlSchemaLocation();
+
+  static {
+    final Html5SchemaProvider[] providers = EP_NAME.getExtensions();
+    final URL htmlSchemaLocationURL;
+    final URL xhtmlSchemaLocationURL;
+
+    LOG.assertTrue(providers.length > 0, "RelaxNG based schema for HTML5 is not supported. Old XSD schema will be used");
+
+    if (providers.length > 1) {
+      LOG.error("More than one HTML5 schema providers found: " + getClassesListString(providers));
+    }
+
+    if (providers.length > 0) {
+      htmlSchemaLocationURL = providers[0].getHtmlSchemaLocation();
+      xhtmlSchemaLocationURL = providers[0].getXhtmlSchemaLocation();
+    }
+    else {
+      htmlSchemaLocationURL = Html5SchemaProvider.class.getResource(ExternalResourceManagerImpl.STANDARD_SCHEMAS + "html5/xhtml5.xsd");
+      xhtmlSchemaLocationURL = htmlSchemaLocationURL;
+    }
+
+    HTML5_SCHEMA_LOCATION = VfsUtilCore.urlToPath(VfsUtil.fixURLforIDEA(
+      URLUtil.unescapePercentSequences(htmlSchemaLocationURL.toExternalForm())));
+    LOG.info("HTML5_SCHEMA_LOCATION = " + HTML5_SCHEMA_LOCATION);
+
+    XHTML5_SCHEMA_LOCATION = VfsUtilCore.urlToPath(VfsUtil.fixURLforIDEA(
+      URLUtil.unescapePercentSequences(xhtmlSchemaLocationURL.toExternalForm())));
+    LOG.info("XHTML5_SCHEMA_LOCATION = " + XHTML5_SCHEMA_LOCATION);
+  }
+
+  private static <T> String getClassesListString(T[] a) {
+    final StringBuilder builder = new StringBuilder();
+    for (int i = 0, n = a.length; i < n; i++) {
+      T element = a[i];
+      builder.append(element != null ? element.getClass().getName() : "NULL");
+      if (i < n - 1) {
+        builder.append(", ");
+      }
+    }
+    return builder.toString();
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/XmlAttributeDescriptorsProvider.java b/xml/impl/src/com/intellij/xml/XmlAttributeDescriptorsProvider.java
new file mode 100644
index 0000000..f235c0e
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/XmlAttributeDescriptorsProvider.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public interface XmlAttributeDescriptorsProvider {
+
+  ExtensionPointName<XmlAttributeDescriptorsProvider> EP_NAME = new ExtensionPointName<XmlAttributeDescriptorsProvider>("com.intellij.xml.attributeDescriptorsProvider");
+
+  XmlAttributeDescriptor[] getAttributeDescriptors(final XmlTag context);
+
+  @Nullable
+  XmlAttributeDescriptor getAttributeDescriptor(final String attributeName, final XmlTag context);
+
+}
diff --git a/xml/impl/src/com/intellij/xml/XmlChangeLocalityDetector.java b/xml/impl/src/com/intellij/xml/XmlChangeLocalityDetector.java
new file mode 100644
index 0000000..fb65aa5
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/XmlChangeLocalityDetector.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.codeInsight.daemon.ChangeLocalityDetector;
+import com.intellij.codeInspection.DefaultXmlSuppressionProvider;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.psi.PsiComment;
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.NotNull;
+
+public class XmlChangeLocalityDetector implements ChangeLocalityDetector {
+  @Override
+  public PsiElement getChangeHighlightingDirtyScopeFor(@NotNull PsiElement changedElement) {
+    // rehighlight everything when inspection suppress comment changed
+    if (changedElement.getLanguage() instanceof XMLLanguage
+        && changedElement instanceof PsiComment
+        && changedElement.getText().contains(DefaultXmlSuppressionProvider.SUPPRESS_MARK)) {
+      return changedElement.getContainingFile();
+    }
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/XmlExtension.java b/xml/impl/src/com/intellij/xml/XmlExtension.java
new file mode 100644
index 0000000..1adcb3b
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/XmlExtension.java
@@ -0,0 +1,214 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
+import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.source.xml.SchemaPrefix;
+import com.intellij.psi.impl.source.xml.TagNameReference;
+import com.intellij.psi.search.LocalSearchScope;
+import com.intellij.psi.search.SearchScope;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public abstract class XmlExtension {
+  private static final ExtensionPointName<XmlExtension> EP_NAME = new ExtensionPointName<XmlExtension>("com.intellij.xml.xmlExtension");
+
+  public static final XmlExtension DEFAULT_EXTENSION = new DefaultXmlExtension();
+
+  public static XmlExtension getExtension(PsiFile file) {
+    for (XmlExtension extension : Extensions.getExtensions(EP_NAME)) {
+      if (extension.isAvailable(file)) {
+        return extension;
+      }
+    }
+    return DEFAULT_EXTENSION;
+  }
+
+  @SuppressWarnings("ConstantConditions")
+  public static XmlExtension getExtensionByElement(PsiElement element) {
+    final PsiFile psiFile = element.getContainingFile();
+    if (psiFile != null) {
+      return getExtension(psiFile);
+    }
+    return null;
+  }
+
+  public abstract boolean isAvailable(PsiFile file);
+
+  @NotNull
+  public abstract List<Pair<String,String>> getAvailableTagNames(@NotNull final XmlFile file, @NotNull final XmlTag context);
+
+  @NotNull
+  public abstract Set<String> getNamespacesByTagName(@NotNull final String tagName, @NotNull final XmlFile context);
+  @NotNull
+  public abstract Set<String> guessUnboundNamespaces(@NotNull PsiElement element, final XmlFile file);
+
+  @Nullable
+  public TagNameReference createTagNameReference(final ASTNode nameElement, final boolean startTagFlag) {
+    return new TagNameReference(nameElement, startTagFlag);
+  }
+
+  @Nullable
+  public String[][] getNamespacesFromDocument(final XmlDocument parent, boolean declarationsExist) {
+    return declarationsExist ? null : XmlUtil.getDefaultNamespaces(parent);
+  }
+
+  public interface Runner<P, T extends Throwable> {
+    void run(P param) throws T;
+  }
+
+  public abstract void insertNamespaceDeclaration(@NotNull final XmlFile file,
+                                                    @Nullable final Editor editor,
+                                                    @NonNls @NotNull final Set<String> possibleNamespaces,
+                                                    @NonNls @Nullable final String nsPrefix,
+                                                    @Nullable Runner<String, IncorrectOperationException> runAfter) throws IncorrectOperationException;
+
+  @Nullable
+  public String getNamespacePrefix(PsiElement element) {
+    final PsiElement tag = element instanceof XmlTag ? element : element.getParent();
+    if (tag instanceof XmlTag) {
+      return ((XmlTag)tag).getNamespacePrefix();
+    } else {
+      return null;
+    }
+  }
+
+  public boolean qualifyWithPrefix(final String namespacePrefix, final PsiElement element, final Document document) throws
+                                                                                                                 IncorrectOperationException {
+    final PsiElement tag = element instanceof XmlTag ? element : element.getParent();
+    if (tag instanceof XmlTag) {
+      final String prefix = ((XmlTag)tag).getNamespacePrefix();
+      if (!prefix.equals(namespacePrefix)) {
+        final String name = namespacePrefix + ":" + ((XmlTag)tag).getLocalName();
+        ((XmlTag)tag).setName(name);
+      }
+      return true;
+    }
+    return false;
+  }
+
+  public String getNamespaceAlias(@NotNull final XmlFile file) {
+    return XmlBundle.message("namespace.alias");
+  }
+
+  public void createAddAttributeFix(@NotNull final XmlAttribute attribute, final HighlightInfo highlightInfo) {
+    final XmlTag tag = attribute.getParent();
+    String namespace = attribute.getNamespace();
+
+    if(StringUtil.isEmptyOrSpaces(namespace)) namespace = tag.getNamespace();
+
+    final XmlNSDescriptor nsDescriptor = tag.getNSDescriptor(namespace, true);
+    if (nsDescriptor instanceof XmlUndefinedElementFixProvider) {
+      final IntentionAction[] actions = ((XmlUndefinedElementFixProvider)nsDescriptor).createFixes(attribute);
+      for (IntentionAction action : actions) {
+        QuickFixAction.registerQuickFixAction(highlightInfo, action);
+      }
+    }
+  }
+
+  public boolean canBeDuplicated(XmlAttribute attribute) {
+    return false;
+  }
+
+  public boolean isRequiredAttributeImplicitlyPresent(XmlTag tag, String attrName) {
+    return false;
+  }
+
+  public HighlightInfoType getHighlightInfoType(XmlFile file) {
+    return HighlightInfoType.ERROR;
+  }
+
+  @Nullable
+  public abstract SchemaPrefix getPrefixDeclaration(final XmlTag context, String namespacePrefix);
+
+  public SearchScope getNsPrefixScope(XmlAttribute declaration) {
+    return new LocalSearchScope(declaration.getParent());
+  }
+
+  public boolean shouldBeHighlightedAsTag(XmlTag tag) {
+    return true;
+  }
+
+  @Nullable
+  public XmlElementDescriptor getElementDescriptor(XmlTag tag, XmlTag contextTag, final XmlElementDescriptor parentDescriptor) {
+    return parentDescriptor.getElementDescriptor(tag, contextTag);
+  }
+
+  @Nullable
+  public XmlNSDescriptor getNSDescriptor(final XmlTag element, final String namespace, final boolean strict) {
+    return element.getNSDescriptor(namespace, strict);  
+  }
+
+  @Nullable
+  public XmlTag getParentTagForNamespace(XmlTag tag, XmlNSDescriptor namespace) {
+    return tag.getParentTag();
+  }
+
+  @Nullable
+  public XmlFile getContainingFile(PsiElement element) {
+    if (element == null) {
+      return null;
+    }
+    final PsiFile psiFile = element.getContainingFile();
+    return psiFile instanceof XmlFile ? (XmlFile)psiFile : null;
+  }
+
+  public XmlNSDescriptor getDescriptorFromDoctype(final XmlFile containingFile, XmlNSDescriptor descr) {
+    return descr;
+  }
+
+  public boolean hasDynamicComponents(final PsiElement element) {
+    return false;
+  }
+
+  public boolean isIndirectSyntax(final XmlAttributeDescriptor descriptor) {
+    return false;
+  }
+
+  public boolean isCustomTagAllowed(final XmlTag tag) {
+    return false;
+  }
+
+  public boolean needWhitespaceBeforeAttribute() {
+    return true;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/xml/XmlFileTypeFactory.java b/xml/impl/src/com/intellij/xml/XmlFileTypeFactory.java
new file mode 100644
index 0000000..fa5d933
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/XmlFileTypeFactory.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.codeInsight.editorActions.TypedHandler;
+import com.intellij.ide.highlighter.DTDFileType;
+import com.intellij.ide.highlighter.HtmlFileType;
+import com.intellij.ide.highlighter.XHtmlFileType;
+import com.intellij.ide.highlighter.XmlFileType;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.fileTypes.FileTypeConsumer;
+import com.intellij.openapi.fileTypes.FileTypeFactory;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author yole
+ */
+public class XmlFileTypeFactory extends FileTypeFactory {
+  public void createFileTypes(@NotNull final FileTypeConsumer consumer) {
+    consumer.consume(HtmlFileType.INSTANCE, "html;htm;sht;shtm;shtml");
+    consumer.consume(XHtmlFileType.INSTANCE, "xhtml");
+    consumer.consume(DTDFileType.INSTANCE, "dtd;ent;mod;elt");
+
+    consumer.consume(XmlFileType.INSTANCE, "xml;xsd;tld;xsl;jnlp;wsdl;jhm;ant;xul;xslt;rng;fxml");
+    TypedHandler.registerBaseLanguageQuoteHandler(XMLLanguage.class, TypedHandler.getQuoteHandlerForType(XmlFileType.INSTANCE));
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/XmlUndefinedElementFixProvider.java b/xml/impl/src/com/intellij/xml/XmlUndefinedElementFixProvider.java
new file mode 100644
index 0000000..097602d
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/XmlUndefinedElementFixProvider.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.psi.xml.XmlElement;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public interface XmlUndefinedElementFixProvider {
+
+  @NotNull IntentionAction[] createFixes(final @NotNull XmlElement element);
+}
diff --git a/xml/impl/src/com/intellij/xml/actions/GenerateXmlTagAction.java b/xml/impl/src/com/intellij/xml/actions/GenerateXmlTagAction.java
new file mode 100644
index 0000000..5a2b4ea
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/GenerateXmlTagAction.java
@@ -0,0 +1,352 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.actions;
+
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.actions.SimpleCodeInsightAction;
+import com.intellij.codeInsight.hint.HintManager;
+import com.intellij.codeInsight.lookup.impl.LookupCellRenderer;
+import com.intellij.codeInsight.template.TemplateBuilder;
+import com.intellij.codeInsight.template.TemplateBuilderFactory;
+import com.intellij.codeInsight.template.impl.MacroCallNode;
+import com.intellij.codeInsight.template.macro.CompleteMacro;
+import com.intellij.codeInsight.template.macro.CompleteSmartMacro;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.colors.EditorColorsManager;
+import com.intellij.openapi.editor.colors.EditorColorsScheme;
+import com.intellij.openapi.editor.colors.EditorFontType;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.popup.JBPopupFactory;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.impl.source.tree.Factory;
+import com.intellij.psi.impl.source.tree.LeafElement;
+import com.intellij.psi.impl.source.xml.XmlContentDFA;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.refactoring.util.CommonRefactoringUtil;
+import com.intellij.ui.components.JBList;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementsGroup;
+import com.intellij.xml.impl.schema.XmlElementDescriptorImpl;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.*;
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class GenerateXmlTagAction extends SimpleCodeInsightAction {
+
+  public static final ThreadLocal<String> TEST_THREAD_LOCAL = new ThreadLocal<String>();
+  private final static Logger LOG = Logger.getInstance(GenerateXmlTagAction.class);
+
+  @Override
+  public void invoke(@NotNull final Project project, @NotNull final Editor editor, @NotNull final PsiFile file) {
+    if (!CodeInsightUtilBase.prepareEditorForWrite(editor)) return;
+    try {
+      final XmlTag contextTag = getContextTag(editor, file);
+      if (contextTag == null) {
+        throw new CommonRefactoringUtil.RefactoringErrorHintException("Caret should be positioned inside a tag");
+      }
+      XmlElementDescriptor currentTagDescriptor = contextTag.getDescriptor();
+      final XmlElementDescriptor[] descriptors = currentTagDescriptor.getElementsDescriptors(contextTag);
+      Arrays.sort(descriptors, new Comparator<XmlElementDescriptor>() {
+        @Override
+        public int compare(XmlElementDescriptor o1, XmlElementDescriptor o2) {
+          return o1.getName().compareTo(o2.getName());
+        }
+      });
+      final JBList list = new JBList(descriptors);
+      list.setCellRenderer(new MyListCellRenderer());
+      Runnable runnable = new Runnable() {
+        @Override
+        public void run() {
+          final XmlElementDescriptor selected = (XmlElementDescriptor)list.getSelectedValue();
+          new WriteCommandAction.Simple(project, "Generate XML Tag", file) {
+            @Override
+            protected void run() {
+              if (selected == null) return;
+              XmlTag newTag = createTag(contextTag, selected);
+
+              PsiElement anchor = getAnchor(contextTag, editor, selected);
+              if (anchor == null) { // insert it in the cursor position
+                int offset = editor.getCaretModel().getOffset();
+                Document document = editor.getDocument();
+                document.insertString(offset, newTag.getText());
+                PsiDocumentManager.getInstance(getProject()).commitDocument(document);
+                newTag = PsiTreeUtil.getParentOfType(file.findElementAt(offset + 1), XmlTag.class, false);
+              }
+              else {
+                newTag = (XmlTag)contextTag.addAfter(newTag, anchor);
+              }
+              generateTag(newTag);
+            }
+          }.execute();
+        }
+      };
+      if (ApplicationManager.getApplication().isUnitTestMode()) {
+        XmlElementDescriptor descriptor = ContainerUtil.find(descriptors, new Condition<XmlElementDescriptor>() {
+          @Override
+          public boolean value(XmlElementDescriptor xmlElementDescriptor) {
+            return xmlElementDescriptor.getName().equals(TEST_THREAD_LOCAL.get());
+          }
+        });
+        list.setSelectedValue(descriptor, false);
+        runnable.run();
+      }
+      else {
+        JBPopupFactory.getInstance().createListPopupBuilder(list)
+          .setTitle("Choose Tag Name")
+          .setItemChoosenCallback(runnable)
+          .setFilteringEnabled(new Function<Object, String>() {
+            @Override
+            public String fun(Object o) {
+              return ((XmlElementDescriptor)o).getName();
+            }
+          })
+          .createPopup()
+          .showInBestPositionFor(editor);
+      }
+    }
+    catch (CommonRefactoringUtil.RefactoringErrorHintException e) {
+      HintManager.getInstance().showErrorHint(editor, e.getMessage());
+    }
+  }
+
+  @Nullable
+  private static XmlTag getAnchor(@NotNull XmlTag contextTag, Editor editor, XmlElementDescriptor selected) {
+    XmlContentDFA contentDFA = XmlContentDFA.getContentDFA(contextTag);
+    int offset = editor.getCaretModel().getOffset();
+    if (contentDFA == null) {
+      return null;
+    }
+    XmlTag anchor = null;
+    boolean previousPositionIsPossible = true;
+    for (XmlTag subTag : contextTag.getSubTags()) {
+      if (contentDFA.getPossibleElements().contains(selected)) {
+        if (subTag.getTextOffset() > offset) {
+          break;
+        }
+        anchor = subTag;
+        previousPositionIsPossible = true;
+      }
+      else {
+        previousPositionIsPossible = false;
+      }
+      contentDFA.transition(subTag);
+    }
+    return previousPositionIsPossible ? null : anchor;
+  }
+
+  public static void generateTag(XmlTag newTag) {
+    generateRaw(newTag);
+    final XmlTag restored = CodeInsightUtilBase.forcePsiPostprocessAndRestoreElement(newTag);
+    if (restored == null) {
+      LOG.error("Could not restore tag: " + newTag.getText());
+    }
+    TemplateBuilder builder = TemplateBuilderFactory.getInstance().createTemplateBuilder(restored);
+    replaceElements(restored, builder);
+    builder.run();
+  }
+
+  private static void generateRaw(final XmlTag newTag) {
+    XmlElementDescriptor selected = newTag.getDescriptor();
+    if (selected == null) return;
+    switch (selected.getContentType()) {
+      case XmlElementDescriptor.CONTENT_TYPE_EMPTY:
+        newTag.collapseIfEmpty();
+        ASTNode node = newTag.getNode();
+        assert node != null;
+        ASTNode elementEnd = node.findChildByType(XmlTokenType.XML_EMPTY_ELEMENT_END);
+        if (elementEnd == null) {
+          LeafElement emptyTagEnd = Factory.createSingleLeafElement(XmlTokenType.XML_EMPTY_ELEMENT_END, "/>", 0, 2, null, newTag.getManager());
+          node.addChild(emptyTagEnd);
+        }
+        break;
+      case XmlElementDescriptor.CONTENT_TYPE_MIXED:
+        newTag.getValue().setText("");
+    }
+    for (XmlAttributeDescriptor descriptor : selected.getAttributesDescriptors(newTag)) {
+      if (descriptor.isRequired()) {
+        newTag.setAttribute(descriptor.getName(), "");
+      }
+    }
+    List<XmlElementDescriptor> tags = getRequiredSubTags(selected);
+    for (XmlElementDescriptor descriptor : tags) {
+      if (descriptor == null) {
+        XmlTag tag = XmlElementFactory.getInstance(newTag.getProject()).createTagFromText("<", newTag.getLanguage());
+        newTag.addSubTag(tag, false);
+      }
+      else {
+        XmlTag subTag = newTag.addSubTag(createTag(newTag, descriptor), false);
+        generateRaw(subTag);
+      }
+    }
+  }
+
+  public static List<XmlElementDescriptor> getRequiredSubTags(XmlElementDescriptor selected) {
+    XmlElementsGroup topGroup = selected.getTopGroup();
+    if (topGroup == null) return Collections.emptyList();
+    return computeRequiredSubTags(topGroup);
+  }
+
+  private static void replaceElements(XmlTag tag, TemplateBuilder builder) {
+    for (XmlAttribute attribute : tag.getAttributes()) {
+      XmlAttributeValue value = attribute.getValueElement();
+      if (value != null) {
+        builder.replaceElement(value, TextRange.from(1, 0), new MacroCallNode(new CompleteMacro()));
+      }
+    }
+    if ("<".equals(tag.getText())) {
+      builder.replaceElement(tag, TextRange.from(1, 0), new MacroCallNode(new CompleteSmartMacro()));
+    }
+    else if (tag.getSubTags().length == 0) {
+      int i = tag.getText().indexOf("></");
+      if (i > 0) {
+        builder.replaceElement(tag, TextRange.from(i + 1, 0), new MacroCallNode(new CompleteMacro()));
+      }
+    }
+    for (XmlTag subTag : tag.getSubTags()) {
+      replaceElements(subTag, builder);
+    }
+  }
+
+  private static XmlTag createTag(@NotNull XmlTag contextTag, @NotNull XmlElementDescriptor descriptor) {
+    String namespace = getNamespace(descriptor);
+    XmlTag tag = contextTag.createChildTag(descriptor.getName(), namespace, null, false);
+    PsiElement lastChild = tag.getLastChild();
+    assert lastChild != null;
+    lastChild.delete(); // remove XML_EMPTY_ELEMENT_END
+    return tag;
+  }
+
+  private static String getNamespace(XmlElementDescriptor descriptor) {
+    return descriptor instanceof XmlElementDescriptorImpl ? ((XmlElementDescriptorImpl)descriptor).getNamespace() : "";
+  }
+
+  @Nullable
+  private static XmlTag getContextTag(Editor editor, PsiFile file) {
+    PsiElement element = file.findElementAt(editor.getCaretModel().getOffset());
+    XmlTag tag = null;
+    if (element != null) {
+      tag = PsiTreeUtil.getParentOfType(element, XmlTag.class);
+    }
+    if (tag == null) {
+      tag = ((XmlFile)file).getRootTag();
+    }
+    return tag;
+  }
+
+  private static List<XmlElementDescriptor> computeRequiredSubTags(XmlElementsGroup group) {
+
+    if (group.getMinOccurs() < 1) return Collections.emptyList();
+    switch (group.getGroupType()) {
+      case LEAF:
+        XmlElementDescriptor descriptor = group.getLeafDescriptor();
+        return descriptor == null ? Collections.<XmlElementDescriptor>emptyList() : Collections.singletonList(descriptor);
+      case CHOICE:
+        LinkedHashSet<XmlElementDescriptor> set = null;
+        for (XmlElementsGroup subGroup : group.getSubGroups()) {
+          List<XmlElementDescriptor> descriptors = computeRequiredSubTags(subGroup);
+          if (set == null) {
+            set = new LinkedHashSet<XmlElementDescriptor>(descriptors);
+          }
+          else {
+            set.retainAll(descriptors);
+          }
+        }
+        if (set == null || set.isEmpty()) {
+          return Collections.singletonList(null); // placeholder for smart completion
+        }
+        return new ArrayList<XmlElementDescriptor>(set);
+
+      default:
+        ArrayList<XmlElementDescriptor> list = new ArrayList<XmlElementDescriptor>();
+        for (XmlElementsGroup subGroup : group.getSubGroups()) {
+          list.addAll(computeRequiredSubTags(subGroup));
+        }
+        return list;
+    }
+  }
+
+  @Override
+  protected boolean isValidForFile(Project project, Editor editor, PsiFile file) {
+    if (!(file instanceof XmlFile)) return false;
+    XmlTag contextTag = getContextTag(editor, file);
+    return contextTag != null && contextTag.getDescriptor() != null;
+  }
+
+  @Override
+  public boolean startInWriteAction() {
+    return false;
+  }
+
+  private static class MyListCellRenderer implements ListCellRenderer {
+    private final JPanel myPanel;
+    private final JLabel myNameLabel;
+    private final JLabel myNSLabel;
+
+    public MyListCellRenderer() {
+      myPanel = new JPanel(new BorderLayout());
+      myPanel.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
+      myNameLabel = new JLabel();
+
+      myPanel.add(myNameLabel, BorderLayout.WEST);
+      myPanel.add(new JLabel("     "));
+      myNSLabel = new JLabel();
+      myPanel.add(myNSLabel, BorderLayout.EAST);
+
+      EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
+      Font font = scheme.getFont(EditorFontType.PLAIN);
+      myNameLabel.setFont(font);
+      myNSLabel.setFont(font);
+    }
+
+    @Override
+    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+
+      XmlElementDescriptor descriptor = (XmlElementDescriptor)value;
+      Color backgroundColor = isSelected ? list.getSelectionBackground() : list.getBackground();
+
+      myNameLabel.setText(descriptor.getName());
+      myNameLabel.setForeground(isSelected ? list.getSelectionForeground() : list.getForeground());
+      myPanel.setBackground(backgroundColor);
+
+      myNSLabel.setText(getNamespace(descriptor));
+      myNSLabel.setForeground(LookupCellRenderer.getGrayedForeground(isSelected));
+      myNSLabel.setBackground(backgroundColor);
+
+      return myPanel;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/actions/ValidateXmlAction.java b/xml/impl/src/com/intellij/xml/actions/ValidateXmlAction.java
new file mode 100644
index 0000000..da0454b
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/ValidateXmlAction.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.actions;
+
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.util.Key;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author mike
+ */
+public class ValidateXmlAction extends AnAction {
+  private static final Key<String> runningValidationKey = Key.create("xml.running.validation.indicator");
+
+  public ValidateXmlAction() {
+  }
+
+  private ValidateXmlActionHandler getHandler(final @NotNull PsiFile file) {
+    ValidateXmlActionHandler handler = new ValidateXmlActionHandler(true);
+    handler.setErrorReporter(
+      handler.new StdErrorReporter(
+        file.getProject(),
+        new Runnable() {
+          public void run() {
+            doRunAction(file);
+          }
+        }
+      )
+    );
+    return handler;
+  }
+
+  public void actionPerformed(AnActionEvent e) {
+    final PsiFile psiFile = LangDataKeys.PSI_FILE.getData(e.getDataContext());
+    if (psiFile != null) {
+      doRunAction(psiFile);
+    }
+  }
+
+  private void doRunAction(final @NotNull PsiFile psiFile) {
+
+    CommandProcessor.getInstance().executeCommand(psiFile.getProject(), new Runnable(){
+        public void run(){
+          final Runnable action = new Runnable() {
+            public void run() {
+              try {
+                psiFile.putUserData(runningValidationKey, "");
+                PsiDocumentManager.getInstance(psiFile.getProject()).commitAllDocuments();
+
+                getHandler(psiFile).doValidate((XmlFile)psiFile);
+              }
+              finally {
+                psiFile.putUserData(runningValidationKey, null);
+              }
+            }
+          };
+          ApplicationManager.getApplication().runWriteAction(action);
+        }
+      },
+      getCommandName(),
+      null
+    );
+  }
+
+  private String getCommandName(){
+    String text = getTemplatePresentation().getText();
+    return text != null ? text : "";
+  }
+
+  public void update(AnActionEvent event) {
+    super.update(event);
+
+    Presentation presentation = event.getPresentation();
+    PsiElement psiElement = LangDataKeys.PSI_FILE.getData(event.getDataContext());
+
+    boolean flag = psiElement instanceof XmlFile;
+    presentation.setVisible(flag);
+    boolean value = psiElement instanceof XmlFile;
+
+    if (value) {
+      final PsiFile containingFile = psiElement.getContainingFile();
+
+      if (containingFile!=null &&
+          (containingFile.getFileType() == StdFileTypes.XML ||
+           containingFile.getFileType() == StdFileTypes.XHTML
+          )) {
+        value = containingFile.getUserData(runningValidationKey) == null;
+      } else {
+        value = false;
+      }
+    }
+
+    presentation.setEnabled(value);
+    if (ActionPlaces.isPopupPlace(event.getPlace())) {
+      presentation.setVisible(value);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/actions/ValidateXmlActionHandler.java b/xml/impl/src/com/intellij/xml/actions/ValidateXmlActionHandler.java
new file mode 100644
index 0000000..aa7a8ae
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/ValidateXmlActionHandler.java
@@ -0,0 +1,620 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.actions;
+
+import com.intellij.ide.errorTreeView.NewErrorTreeViewPanel;
+import com.intellij.javaee.UriUtil;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.progress.ProcessCanceledException;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.wm.ToolWindowId;
+import com.intellij.openapi.wm.ToolWindowManager;
+import com.intellij.openapi.wm.WindowManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.xml.*;
+import com.intellij.ui.content.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.ui.ErrorTreeView;
+import com.intellij.util.ui.MessageCategory;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.util.XmlResourceResolver;
+import org.apache.xerces.impl.Constants;
+import org.apache.xerces.jaxp.JAXPConstants;
+import org.apache.xerces.jaxp.SAXParserFactoryImpl;
+import org.apache.xerces.util.XMLGrammarPoolImpl;
+import org.apache.xerces.xni.grammars.XMLGrammarPool;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import javax.swing.*;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import java.io.FileNotFoundException;
+import java.io.StringReader;
+import java.net.*;
+import java.util.*;
+import java.util.concurrent.Future;
+
+/**
+ * @author Mike
+ */
+public class ValidateXmlActionHandler {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.actions.ValidateXmlAction");
+  private static final Key<NewErrorTreeViewPanel> KEY = Key.create("ValidateXmlAction.KEY");
+  @NonNls private static final String SCHEMA_FULL_CHECKING_FEATURE_ID = "http://apache.org/xml/features/validation/schema-full-checking";
+  private static final String GRAMMAR_FEATURE_ID = Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
+
+  private static final Key<XMLGrammarPool> GRAMMAR_POOL_KEY = Key.create("GrammarPoolKey");
+  private static final Key<Long> GRAMMAR_POOL_TIME_STAMP_KEY = Key.create("GrammarPoolTimeStampKey");
+  private static final Key<VirtualFile[]> DEPENDENT_FILES_KEY = Key.create("GrammarPoolFilesKey");
+  private static final Key<String[]> KNOWN_NAMESPACES_KEY = Key.create("KnownNamespacesKey");
+
+  private Project myProject;
+  private XmlFile myFile;
+  private ErrorReporter myErrorReporter;
+  private SAXParser myParser;
+  private XmlResourceResolver myXmlResourceResolver;
+  private final boolean myForceChecking;
+  @NonNls
+  private static final String ENTITY_RESOLVER_PROPERTY_NAME = "http://apache.org/xml/properties/internal/entity-resolver";
+
+  public ValidateXmlActionHandler(boolean _forceChecking) {
+    myForceChecking = _forceChecking;
+  }
+
+  public void setErrorReporter(ErrorReporter errorReporter) {
+    myErrorReporter = errorReporter;
+  }
+
+  public VirtualFile getFile(String publicId, String systemId) {
+    if (publicId == null) {
+      if (systemId != null) {
+        final String path = myXmlResourceResolver.getPathByPublicId(systemId);
+        if (path != null) return UriUtil.findRelativeFile(path,null);
+        final PsiFile file = myXmlResourceResolver.resolve(null, systemId);
+        if (file != null) return file.getVirtualFile();
+      }
+      return myFile.getVirtualFile();
+    }
+    final String path = myXmlResourceResolver.getPathByPublicId(publicId);
+    if (path != null) return UriUtil.findRelativeFile(path,null);
+    return null;
+  }
+
+  public abstract class ErrorReporter {
+    protected final Set<String> ourErrorsSet = new HashSet<String>();
+    public abstract void processError(SAXParseException ex,boolean warning);
+
+    public boolean filterValidationException(Exception ex) {
+      if (ex instanceof ProcessCanceledException) throw (ProcessCanceledException)ex;
+      if (ex instanceof XmlResourceResolver.IgnoredResourceException) throw (XmlResourceResolver.IgnoredResourceException)ex;
+
+      if (ex instanceof FileNotFoundException ||
+            ex instanceof MalformedURLException ||
+            ex instanceof NoRouteToHostException ||
+            ex instanceof SocketTimeoutException ||
+            ex instanceof UnknownHostException ||
+            ex instanceof ConnectException
+            ) {
+        // do not log problems caused by malformed and/or ignored external resources
+        return true;
+      }
+
+      if (ex instanceof NullPointerException) {
+        return true; // workaround for NPE at org.apache.xerces.impl.dtd.XMLDTDProcessor.checkDeclaredElements
+      }
+
+      return false;
+    }
+
+    public void startProcessing() {
+      doParse();
+    }
+
+    public boolean isStopOnUndeclaredResource() {
+      return false;
+    }
+
+    public boolean isUniqueProblem(final SAXParseException e) {
+      String error = buildMessageString(e);
+      if (ourErrorsSet.contains(error)) return false;
+      ourErrorsSet.add(error);
+      return true;
+    }
+  }
+
+  private String buildMessageString(SAXParseException ex) {
+    String msg = "(" + ex.getLineNumber() + ":" + ex.getColumnNumber() + ") " + ex.getMessage();
+    final VirtualFile file = getFile(ex.getPublicId(), ex.getSystemId());
+
+    if ( file != null && !file.equals(myFile.getVirtualFile())) {
+      msg = file.getName() + ":" + msg;
+    }
+    return msg;
+  }
+
+  public class TestErrorReporter extends ErrorReporter {
+    private final ArrayList<String> errors = new ArrayList<String>(3);
+
+    public boolean isStopOnUndeclaredResource() {
+      return true;
+    }
+
+    public boolean filterValidationException(final Exception ex) {
+      if (ex instanceof XmlResourceResolver.IgnoredResourceException) throw (XmlResourceResolver.IgnoredResourceException)ex;
+      return errors.add(ex.getMessage());
+    }
+
+    public void processError(SAXParseException ex, boolean warning) {
+      errors.add(buildMessageString(ex));
+    }
+
+    public List<String> getErrors() {
+      return errors;
+    }
+  }
+
+  class StdErrorReporter extends ErrorReporter {
+    private final NewErrorTreeViewPanel myErrorsView;
+    private final String CONTENT_NAME = XmlBundle.message("xml.validate.tab.content.title");
+    private boolean myErrorsDetected = false;
+
+    StdErrorReporter(Project project, Runnable rerunAction) {
+      myErrorsView = new NewErrorTreeViewPanel(project, null, true, true, rerunAction);
+    }
+
+    public void startProcessing() {
+      final Runnable task = new Runnable() {
+        public void run() {
+          try {
+            ApplicationManager.getApplication().runReadAction(new Runnable() {
+              public void run() {
+                StdErrorReporter.super.startProcessing();
+              }
+            });
+
+            SwingUtilities.invokeLater(
+              new Runnable() {
+                  public void run() {
+                    if (!myErrorsDetected) {
+                      SwingUtilities.invokeLater(
+                          new Runnable() {
+                            public void run() {
+                              removeCompileContents(null);
+                              WindowManager.getInstance().getStatusBar(myProject).setInfo(
+                                XmlBundle.message("xml.validate.no.errors.detected.status.message"));
+                            }
+                          }
+                      );
+                    }
+                  }
+                }
+            );
+          }
+          finally {
+            boolean b = Thread.interrupted(); // reset interrupted
+          }
+        }
+      };
+
+      final MyProcessController processController = new MyProcessController();
+      myErrorsView.setProcessController(processController);
+      openMessageView();
+      processController.setFuture( ApplicationManager.getApplication().executeOnPooledThread(task) );
+
+      ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.MESSAGES_WINDOW).activate(null);
+    }
+
+    private void openMessageView() {
+      CommandProcessor commandProcessor = CommandProcessor.getInstance();
+      commandProcessor.executeCommand(
+          myProject, new Runnable() {
+            public void run() {
+              MessageView messageView = MessageView.SERVICE.getInstance(myProject);
+              final Content content = ContentFactory.SERVICE.getInstance().createContent(myErrorsView.getComponent(), CONTENT_NAME, true);
+              content.putUserData(KEY, myErrorsView);
+              messageView.getContentManager().addContent(content);
+              messageView.getContentManager().setSelectedContent(content);
+              messageView.getContentManager().addContentManagerListener(new CloseListener(content, messageView.getContentManager()));
+              removeCompileContents(content);
+              messageView.getContentManager().addContentManagerListener(new MyContentDisposer(content, messageView));
+            }
+          },
+          XmlBundle.message("validate.xml.open.message.view.command.name"),
+          null
+      );
+    }
+    private void removeCompileContents(Content notToRemove) {
+      MessageView messageView = MessageView.SERVICE.getInstance(myProject);
+
+      for (Content content : messageView.getContentManager().getContents()) {
+        if (content.isPinned()) continue;
+        if (CONTENT_NAME.equals(content.getDisplayName()) && content != notToRemove) {
+          ErrorTreeView listErrorView = (ErrorTreeView)content.getComponent();
+          if (listErrorView != null) {
+            if (messageView.getContentManager().removeContent(content, true)) {
+              content.release();
+            }
+          }
+        }
+      }
+    }
+
+    public void processError(final SAXParseException ex, final boolean warning) {
+      if (LOG.isDebugEnabled()) {
+        String error = buildMessageString(ex);
+        LOG.debug("enter: processError(error='" + error + "')");
+      }
+
+      myErrorsDetected = true;
+
+      if (!ApplicationManager.getApplication().isUnitTestMode()) {
+        SwingUtilities.invokeLater(
+            new Runnable() {
+              public void run() {
+                final VirtualFile file = getFile(ex.getPublicId(), ex.getSystemId());
+                myErrorsView.addMessage(
+                    warning ? MessageCategory.WARNING : MessageCategory.ERROR,
+                    new String[]{ex.getLocalizedMessage()},
+                    file,
+                    ex.getLineNumber() - 1,
+                    ex.getColumnNumber() - 1,
+                    null
+                );
+              }
+            }
+        );
+      }
+    }
+
+    private class CloseListener extends ContentManagerAdapter {
+      private Content myContent;
+      private final ContentManager myContentManager;
+
+      public CloseListener(Content content, ContentManager contentManager) {
+        myContent = content;
+        myContentManager = contentManager;
+      }
+
+      public void contentRemoved(ContentManagerEvent event) {
+        if (event.getContent() == myContent) {
+          myErrorsView.stopProcess();
+
+          myContentManager.removeContentManagerListener(this);
+          myContent.release();
+          myContent = null;
+        }
+      }
+
+      public void contentRemoveQuery(ContentManagerEvent event) {
+        if (event.getContent() == myContent) {
+          if (!myErrorsView.isProcessStopped()) {
+            int result = Messages.showYesNoDialog(
+              XmlBundle.message("xml.validate.validation.is.running.terminate.confirmation.text"),
+              XmlBundle.message("xml.validate.validation.is.running.terminate.confirmation.title"),
+                Messages.getQuestionIcon()
+            );
+            if (result != 0) {
+              event.consume();
+            }
+          }
+        }
+      }
+    }
+
+    private class MyProcessController implements NewErrorTreeViewPanel.ProcessController {
+      private Future<?> myFuture;
+
+      public void setFuture(Future<?> future) {
+        myFuture = future;
+      }
+
+      public void stopProcess() {
+        if (myFuture != null) {
+          myFuture.cancel(true);
+        }
+      }
+
+      public boolean isProcessStopped() {
+        return myFuture != null && myFuture.isDone();
+      }
+    }
+  }
+
+  public void doValidate(XmlFile file) {
+    myProject = file.getProject();
+    myFile = file;
+
+    myXmlResourceResolver = new XmlResourceResolver(myFile, myProject, myErrorReporter);
+    myXmlResourceResolver.setStopOnUnDeclaredResource( myErrorReporter.isStopOnUndeclaredResource() );
+
+    try {
+      try {
+        myParser = createParser();
+      }
+      catch (Exception e) {
+        filterAppException(e);
+      }
+
+      if (myParser == null) return;
+
+      myErrorReporter.startProcessing();
+    }
+    catch (XmlResourceResolver.IgnoredResourceException ignore) {
+    }
+    catch (Exception exception) {
+      filterAppException(exception);
+    }
+  }
+
+  private void filterAppException(Exception exception) {
+    if (!myErrorReporter.filterValidationException(exception)) {
+      LOG.error(exception);
+    }
+  }
+
+  private void doParse() {
+    try {
+      myParser.parse(new InputSource(new StringReader(myFile.getText())), new DefaultHandler() {
+        public void warning(SAXParseException e) {
+          if (myErrorReporter.isUniqueProblem(e)) myErrorReporter.processError(e, true);
+        }
+
+        public void error(SAXParseException e) {
+          if (myErrorReporter.isUniqueProblem(e)) myErrorReporter.processError(e, false);
+        }
+
+        public void fatalError(SAXParseException e) {
+          if (myErrorReporter.isUniqueProblem(e)) myErrorReporter.processError(e, false);
+        }
+
+        public InputSource resolveEntity(String publicId, String systemId) {
+          final PsiFile psiFile = myXmlResourceResolver.resolve(null, systemId);
+          if (psiFile == null) return null;
+          return new InputSource(new StringReader(psiFile.getText()));
+        }
+
+        public void startDocument() throws SAXException {
+          super.startDocument();
+          myParser.setProperty(
+            ENTITY_RESOLVER_PROPERTY_NAME,
+            myXmlResourceResolver
+          );
+        }
+      });
+
+      final String[] resourcePaths = myXmlResourceResolver.getResourcePaths();
+      if (resourcePaths.length > 0) { // if caches are used
+        final VirtualFile[] files = new VirtualFile[resourcePaths.length];
+        for (int i = 0; i < resourcePaths.length; ++i) {
+          files[i] = UriUtil.findRelativeFile(resourcePaths[i], null);
+        }
+
+        myFile.putUserData(DEPENDENT_FILES_KEY, files);
+        myFile.putUserData(GRAMMAR_POOL_TIME_STAMP_KEY, new Long(calculateTimeStamp(files, myProject)));
+      }
+       myFile.putUserData(KNOWN_NAMESPACES_KEY, getNamespaces(myFile));
+    }
+    catch (SAXException e) {
+      LOG.debug(e);
+    }
+    catch (Exception exception) {
+      filterAppException(exception);
+    }
+    catch (StackOverflowError error) {
+      // http://issues.apache.org/jira/browse/XERCESJ-589
+    }
+  }
+
+  protected SAXParser createParser() throws SAXException, ParserConfigurationException {
+      if (!needsDtdChecking() && !needsSchemaChecking() && !myForceChecking) {
+        return null;
+      }
+
+      SAXParserFactory factory = new SAXParserFactoryImpl();
+      boolean schemaChecking = false;
+
+      if (hasDtdDeclaration()) {
+        factory.setValidating(true);
+      }
+
+      if (needsSchemaChecking()) {
+        factory.setValidating(true);
+        factory.setNamespaceAware(true);
+        //jdk 1.5 API
+        try {
+          factory.setXIncludeAware(true);
+        } catch(NoSuchMethodError ignore) {}
+        schemaChecking = true;
+      }
+
+      SAXParser parser = factory.newSAXParser();
+
+      parser.setProperty(ENTITY_RESOLVER_PROPERTY_NAME, myXmlResourceResolver);
+
+      if (schemaChecking) { // when dtd checking schema refs could not be validated @see http://marc.theaimsgroup.com/?l=xerces-j-user&m=112504202423704&w=2
+        XMLGrammarPool grammarPool = getGrammarPool(myFile, myForceChecking);
+
+        parser.getXMLReader().setProperty(GRAMMAR_FEATURE_ID, grammarPool);
+      }
+
+      try {
+        if (schemaChecking) {
+          parser.setProperty(JAXPConstants.JAXP_SCHEMA_LANGUAGE,JAXPConstants.W3C_XML_SCHEMA);
+          parser.getXMLReader().setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID, true);
+          
+          if (Boolean.TRUE.equals(Boolean.getBoolean(XmlResourceResolver.HONOUR_ALL_SCHEMA_LOCATIONS_PROPERTY_KEY))) {
+            parser.getXMLReader().setFeature("http://apache.org/xml/features/honour-all-schemaLocations", true);
+          }
+
+          parser.getXMLReader().setFeature("http://apache.org/xml/features/validation/warn-on-undeclared-elemdef",Boolean.TRUE);
+          parser.getXMLReader().setFeature("http://apache.org/xml/features/validation/warn-on-duplicate-attdef",Boolean.TRUE);
+        }
+
+        parser.getXMLReader().setFeature("http://apache.org/xml/features/warn-on-duplicate-entitydef",Boolean.TRUE);
+        parser.getXMLReader().setFeature("http://apache.org/xml/features/validation/unparsed-entity-checking",Boolean.FALSE);
+      } catch(SAXNotRecognizedException ex) {
+        // it is possible to continue work with configured parser
+        LOG.info("Xml parser installation seems screwed", ex);
+      }
+
+      return parser;
+  }
+
+  public static XMLGrammarPool getGrammarPool(XmlFile file, boolean forceChecking) {
+    final XMLGrammarPool previousGrammarPool = getGrammarPool(file);
+    XMLGrammarPool grammarPool = null;
+
+    // check if the pool is valid
+    if (!forceChecking && !isValidationDependentFilesOutOfDate(file)) {
+      grammarPool = previousGrammarPool;
+    }
+
+    if (grammarPool == null) {
+      grammarPool = new XMLGrammarPoolImpl();
+      file.putUserData(GRAMMAR_POOL_KEY,grammarPool);
+    }
+    return grammarPool;
+  }
+
+  @Nullable
+  public static XMLGrammarPool getGrammarPool(XmlFile file) {
+    return file.getUserData(GRAMMAR_POOL_KEY);
+  }
+
+  public static boolean isValidationDependentFilesOutOfDate(XmlFile myFile) {
+    final VirtualFile[] files = myFile.getUserData(DEPENDENT_FILES_KEY);
+    final Long grammarPoolTimeStamp = myFile.getUserData(GRAMMAR_POOL_TIME_STAMP_KEY);
+    String[] ns = myFile.getUserData(KNOWN_NAMESPACES_KEY);
+
+    if (!Arrays.equals(ns, getNamespaces(myFile))) {
+      return true;
+    }
+
+    if (grammarPoolTimeStamp != null && files != null) {
+      long dependentFilesTimestamp = calculateTimeStamp(files,myFile.getProject());
+
+      if (dependentFilesTimestamp == grammarPoolTimeStamp.longValue()) {
+        return false;
+      }
+    }
+
+    return true;
+  }
+
+  private static String[] getNamespaces(XmlFile file) {
+    XmlTag rootTag = file.getRootTag();
+    if (rootTag == null) return ArrayUtil.EMPTY_STRING_ARRAY;
+    return ContainerUtil.mapNotNull(rootTag.getAttributes(), new Function<XmlAttribute, String>() {
+      @Override
+      public String fun(XmlAttribute attribute) {
+        return attribute.getValue();
+      }
+    }, ArrayUtil.EMPTY_STRING_ARRAY);
+  }
+
+  private static long calculateTimeStamp(final VirtualFile[] files, Project myProject) {
+    long timestamp = 0;
+
+    for(VirtualFile file:files) {
+      if (file == null || !file.isValid()) break;
+      final PsiFile psifile = PsiManager.getInstance(myProject).findFile(file);
+
+      if (psifile != null && psifile.isValid()) {
+        timestamp += psifile.getViewProvider().getModificationStamp();
+      } else {
+        break;
+      }
+    }
+    return timestamp;
+  }
+
+  private boolean hasDtdDeclaration() {
+    XmlDocument document = myFile.getDocument();
+    if (document == null) return false;
+    XmlProlog prolog = document.getProlog();
+    if (prolog == null) return false;
+    XmlDoctype doctype = prolog.getDoctype();
+    if (doctype == null) return false;
+
+    return true;
+  }
+
+  private boolean needsDtdChecking() {
+    XmlDocument document = myFile.getDocument();
+    if (document == null) return false;
+
+    return (document.getProlog()!=null && document.getProlog().getDoctype()!=null);
+  }
+
+  private boolean needsSchemaChecking() {
+    XmlDocument document = myFile.getDocument();
+    if (document == null) return false;
+    XmlTag rootTag = document.getRootTag();
+    if (rootTag == null) return false;
+
+    XmlAttribute[] attributes = rootTag.getAttributes();
+    for (XmlAttribute attribute : attributes) {
+      if (attribute.isNamespaceDeclaration()) return true;
+    }
+
+    return false;
+  }
+  private static class MyContentDisposer implements ContentManagerListener {
+    private final Content myContent;
+    private final MessageView myMessageView;
+
+    public MyContentDisposer(final Content content, final MessageView messageView) {
+      myContent = content;
+      myMessageView = messageView;
+    }
+
+    public void contentRemoved(ContentManagerEvent event) {
+      final Content eventContent = event.getContent();
+      if (!eventContent.equals(myContent)) {
+        return;
+      }
+      myMessageView.getContentManager().removeContentManagerListener(this);
+      NewErrorTreeViewPanel errorTreeView = eventContent.getUserData(KEY);
+      if (errorTreeView != null) {
+        errorTreeView.dispose();
+      }
+      eventContent.putUserData(KEY, null);
+    }
+
+    public void contentAdded(ContentManagerEvent event) {
+    }
+    public void contentRemoveQuery(ContentManagerEvent event) {
+    }
+    public void selectionChanged(ContentManagerEvent event) {
+    }
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/xml/actions/XmlActionsGroup.java b/xml/impl/src/com/intellij/xml/actions/XmlActionsGroup.java
new file mode 100644
index 0000000..a5a59465
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/XmlActionsGroup.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.actions;
+
+import com.intellij.openapi.actionSystem.DefaultActionGroup;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class XmlActionsGroup extends DefaultActionGroup {
+  public XmlActionsGroup() {
+    super();
+    getTemplatePresentation().setText("XML Actions");
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/xml/actions/XmlSplitTagAction.java b/xml/impl/src/com/intellij/xml/actions/XmlSplitTagAction.java
new file mode 100644
index 0000000..77ec93a
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/XmlSplitTagAction.java
@@ -0,0 +1,176 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.actions;
+
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.lang.xhtml.XHTMLLanguage;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiFileFactory;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+public class XmlSplitTagAction implements IntentionAction {
+
+  @Override
+  @NotNull
+  public String getText() {
+    return XmlBundle.message("xml.split.tag.intention.action");
+  }
+
+  @Override
+  @NotNull
+  public String getFamilyName() {
+    return XmlBundle.message("xml.split.tag.intention.action");
+  }
+
+  @Override
+  public boolean isAvailable(@NotNull final Project project, final Editor editor, final PsiFile file) {
+    if (file instanceof XmlFile) {
+      if (editor != null) {
+        final int offset = editor.getCaretModel().getOffset();
+        final PsiElement psiElement = file.findElementAt(offset);
+        if (psiElement != null) {
+          final PsiElement parent = psiElement.getParent();
+          if (parent != null && parent instanceof XmlText && parent.getText().trim().length() > 0) {
+            final PsiElement grandParent = parent.getParent();
+            if (grandParent != null && !isInsideUnsplittableElement(grandParent)) {
+              return true;
+            }
+          }
+        }
+      }
+    }
+
+    return false;
+  }
+
+  private static boolean isInsideUnsplittableElement(final PsiElement grandParent) {
+    if (!(grandParent instanceof HtmlTag) && grandParent.getContainingFile().getLanguage() != XHTMLLanguage.INSTANCE) {
+      return false;
+    }
+
+    final String name = ((XmlTag)grandParent).getName();
+    return "html".equals(name) || "body".equals(name) || "title".equals(name);
+  }
+
+  @Override
+  public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
+    if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
+
+    if (editor != null) {
+      final int offset = editor.getCaretModel().getOffset();
+      final PsiElement psiElement = file.findElementAt(offset);
+      if (psiElement != null) {
+        final PsiElement xmlText = psiElement.getParent();
+        final TextRange textRange = xmlText.getTextRange();
+        final int offsetInElement = offset - textRange.getStartOffset();
+
+        final PsiElement containingTag = xmlText.getParent();
+        if (containingTag instanceof XmlTag) {
+          final XmlTag xmlTag = (XmlTag)containingTag;
+
+          final String s = xmlText.getText();
+          String first = s.substring(0, offsetInElement);
+          String second = s.substring(offsetInElement);
+
+          if (xmlText instanceof XmlTagChild) {
+            XmlTagChild prev = ((XmlTagChild)xmlText).getPrevSiblingInTag();
+            while(prev != null) {
+              first = prev.getText() + first;
+              prev = prev.getPrevSiblingInTag();
+            }
+
+            XmlTagChild next = ((XmlTagChild)xmlText).getNextSiblingInTag();
+            while(next != null) {
+              second += next.getText();
+              next = next.getNextSiblingInTag();
+            }
+          }
+
+          final String filetext = buildNewText(xmlTag, first, second);
+
+          final XmlFile xmlFile = (XmlFile)PsiFileFactory.getInstance(project).createFileFromText("dummy.xml", XMLLanguage.INSTANCE,
+                                                                                               filetext);
+          final PsiElement parent2 = containingTag.getParent();
+          final XmlTag tag = xmlFile.getDocument().getRootTag();
+          XmlTag last = null;
+          final PsiElement[] children = tag.getChildren();
+          for (int i = children.length - 1; i >= 0; i--) {
+            PsiElement element = children[i];
+            if (element instanceof XmlTag) {
+              final XmlTag tag1 = (XmlTag)parent2.addAfter(element, containingTag);
+
+              if (last == null) {
+                last = tag1;
+              }
+            }
+          }
+
+          containingTag.delete();
+          editor.getCaretModel().moveToOffset(last.getValue().getTextRange().getStartOffset());
+        }
+      }
+    }
+  }
+
+  private static String buildNewText(final XmlTag xmlTag, final String first, final String second) {
+    final StringBuilder attrs = new StringBuilder();
+    final StringBuilder attrsWoId = new StringBuilder();
+    for (XmlAttribute attribute : xmlTag.getAttributes()) {
+      if (!"id".equals(attribute.getName())) {
+        attrs.append(attribute.getName()).append("=\"").append(attribute.getValue()).append("\" ");
+        attrsWoId.append(attribute.getName()).append("=\"").append(attribute.getValue()).append("\" ");
+      } else {
+        attrs.append(attribute.getName()).append("=\"").append(attribute.getValue()).append("\" ");
+      }
+
+    }
+
+    final StringBuilder sb = new StringBuilder();
+    final String name = xmlTag.getName();
+    sb.append("<root><").append(name);
+    if (attrs.length() > 0) {
+      sb.append(' ').append(attrs);
+    }
+    sb.append('>');
+    sb.append(first);
+    sb.append("</").append(name).append("><").append(name);
+    if (attrsWoId.length() > 0) {
+      sb.append(' ').append(attrsWoId);
+    }
+    sb.append('>');
+    sb.append(second).append("</").append(name).append("></root>");
+
+    return sb.toString();
+  }
+
+  @Override
+  public boolean startInWriteAction() {
+    return true;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/actions/xmlbeans/FileUtils.java b/xml/impl/src/com/intellij/xml/actions/xmlbeans/FileUtils.java
new file mode 100644
index 0000000..832364cb
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/xmlbeans/FileUtils.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.actions.xmlbeans;
+
+
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.NonNls;
+
+import java.io.*;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class FileUtils {
+  @NonNls
+  public static final String CLASS_RESOURCE_STRING = "*?.class";
+  @NonNls
+  private static final String SOAP_ADDRESS = "soap:address";
+
+  private FileUtils() {
+  }
+
+  public static File saveStreamContentAsFile(String fullFileName, InputStream stream) throws IOException {
+    fullFileName = findFreeFileName(fullFileName);
+    OutputStream ostream = new FileOutputStream(fullFileName);
+    byte[] buf = new byte[8192];
+
+    while(true) {
+      int read = stream.read(buf,0,buf.length);
+      if (read == -1) break;
+      ostream.write(buf,0,read);
+    }
+    ostream.flush();
+    ostream.close();
+    return new File(fullFileName);
+  }
+
+  private static String findFreeFileName(String filename) {
+    File f = new File(filename);
+    if (! f.exists()) return filename;
+    int dot = filename.lastIndexOf('.'); // we believe file has some ext. For instance,  ".wsdl"
+    String name = filename.substring(0, dot);
+    String ext = filename.substring(dot);
+    int num = 0;
+    do {
+      f = new File(name + ++num + ext);
+    } while (f.exists());
+    return name + num + ext;
+  }
+
+
+  public static void saveText(VirtualFile virtualFile, String text) throws IOException {
+    VfsUtil.saveText(virtualFile, text);
+  }
+
+  public static boolean copyFile(File in, File out) {
+    try {
+      FileInputStream fis = new FileInputStream(in);
+      FileOutputStream fos = new FileOutputStream(out);
+      byte[] buf = new byte[1024];
+      int i;
+      while ((i = fis.read(buf)) != -1) {
+        fos.write(buf, 0, i);
+      }
+      fis.close();
+      fos.close();
+      return true;
+    } catch (Exception e) {
+      return false;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaAction.java b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaAction.java
new file mode 100644
index 0000000..22c7bbb
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaAction.java
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.actions.xmlbeans;
+
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.openapi.actionSystem.ActionPlaces;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.PlatformDataKeys;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.fileEditor.FileDocumentManager;
+import com.intellij.openapi.fileEditor.FileEditorManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.util.Computable;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlBundle;
+import gnu.trove.THashMap;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class GenerateInstanceDocumentFromSchemaAction extends AnAction {
+  @Override
+  public void update(AnActionEvent e) {
+    final VirtualFile file = PlatformDataKeys.VIRTUAL_FILE.getData(e.getDataContext());
+    final boolean enabled = isAcceptableFile(file);
+    e.getPresentation().setEnabled(enabled);
+    if (ActionPlaces.isPopupPlace(e.getPlace())) {
+      e.getPresentation().setVisible(enabled);
+    }
+  }
+
+  public void actionPerformed(AnActionEvent e) {
+    final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
+    final VirtualFile file = PlatformDataKeys.VIRTUAL_FILE.getData(e.getDataContext());
+
+    final GenerateInstanceDocumentFromSchemaDialog dialog = new GenerateInstanceDocumentFromSchemaDialog(project, file);
+    dialog.setOkAction(new Runnable() {
+      public void run() {
+        doAction(project, dialog);
+      }
+    });
+
+    dialog.show();
+  }
+
+  private void doAction(final Project project, final GenerateInstanceDocumentFromSchemaDialog dialog) {
+    FileDocumentManager.getInstance().saveAllDocuments();
+
+    @NonNls List<String> parameters = new LinkedList<String>();
+
+    final String url = dialog.getUrl().getText();
+    final VirtualFile relativeFile = VfsUtil.findRelativeFile(ExternalResourceManager.getInstance().getResourceLocation(url), null);
+    final PsiFile file = PsiManager.getInstance(project).findFile(relativeFile);
+    if (! (file instanceof XmlFile)) {
+      Messages.showErrorDialog(project, "This is not XmlFile" + file == null ? "" : " (" + file.getFileType().getName() + ")", XmlBundle.message("error"));
+      return;
+    }
+
+    VirtualFile relativeFileDir;
+    if (relativeFile == null) {
+      Messages.showErrorDialog(project, XmlBundle.message("file.doesnt.exist", url), XmlBundle.message("error"));
+      return;
+    } else {
+      relativeFileDir = relativeFile.getParent();
+    }
+    if (relativeFileDir == null) {
+      Messages.showErrorDialog(project, XmlBundle.message("file.doesnt.exist", url), XmlBundle.message("error"));
+      return;
+    }
+
+    if (!dialog.enableRestrictionCheck()) {
+      parameters.add("-nopvr");
+    }
+
+    if (!dialog.enableUniquenessCheck()) {
+      parameters.add("-noupa");
+    }
+
+
+    String pathToUse;
+
+    try {
+      final File tempDir = FileUtil.createTempFile("xsd2inst", "");
+      tempDir.delete();
+      tempDir.mkdir();
+
+      pathToUse = tempDir.getPath() + File.separatorChar + Xsd2InstanceUtils.processAndSaveAllSchemas(
+        (XmlFile) file,
+        new THashMap<String, String>(),
+        new Xsd2InstanceUtils.SchemaReferenceProcessor() {
+          public void processSchema(String schemaFileName, byte[] schemaContent) {
+            try {
+              final String fullFileName = tempDir.getPath() + File.separatorChar + schemaFileName;
+              FileUtils.saveStreamContentAsFile(
+                fullFileName,
+                new ByteArrayInputStream(schemaContent)
+              );
+            } catch (IOException e) {
+              throw new RuntimeException(e);
+            }
+          }
+        }
+      );
+    } catch (IOException e) {
+      return;
+    }
+
+    parameters.add(pathToUse);
+
+    parameters.add("-name");
+    parameters.add(dialog.getElementName());
+
+    String xml;
+    try {
+      xml = Xsd2InstanceUtils.generate(ArrayUtil.toStringArray(parameters));
+    } catch (IllegalArgumentException e) {
+      Messages.showErrorDialog(project, StringUtil.getMessage(e), XmlBundle.message("error"));
+      return;
+    }
+
+
+
+    final VirtualFile baseDirForCreatedInstanceDocument1 = relativeFileDir;
+    String xmlFileName = baseDirForCreatedInstanceDocument1.getPath() + File.separatorChar + dialog.getOutputFileName();
+
+    FileOutputStream fileOutputStream;
+    try {
+      fileOutputStream = new FileOutputStream(xmlFileName);
+      try {
+        // the generated XML doesn't have any XML declaration -> utf-8
+        fileOutputStream.write(xml.getBytes("utf-8"));
+      }
+      finally {
+        fileOutputStream.close();
+      }
+
+      final File xmlFile = new File(xmlFileName);
+      VirtualFile virtualFile = ApplicationManager.getApplication().runWriteAction(new Computable<VirtualFile>() {
+        @Nullable
+        public VirtualFile compute() {
+          return LocalFileSystem.getInstance().refreshAndFindFileByIoFile(xmlFile);
+        }
+      });
+      FileEditorManager.getInstance(project).openFile(virtualFile, true);
+    }
+    catch (IOException e) {
+      Messages.showErrorDialog(project, "Could not save generated XML document: " + StringUtil.getMessage(e), XmlBundle.message("error"));
+    }
+  }
+
+  static boolean isAcceptableFileForGenerateSchemaFromInstanceDocument(VirtualFile virtualFile) {
+    return virtualFile != null && "xsd".equalsIgnoreCase(virtualFile.getExtension());
+  }
+
+  public static boolean isAcceptableFile(VirtualFile file) {
+    return isAcceptableFileForGenerateSchemaFromInstanceDocument(file);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.form b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.form
new file mode 100644
index 0000000..d7bb3fd
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.form
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.xml.actions.xmlbeans.GenerateInstanceDocumentFromSchemaDialog">
+  <grid id="fece0" binding="panel" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="1" left="1" bottom="1" right="1"/>
+    <constraints>
+      <xy x="282" y="178" width="526" height="157"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <component id="fc23b" class="javax.swing.JLabel" binding="generateFromUrlText">
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text resource-bundle="messages/XmlBundle" key="schema2instance.dialog.schema.path"/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.schema2instance.url.tooltip"/>
+        </properties>
+      </component>
+      <component id="bef0c" class="javax.swing.JLabel" binding="statusText">
+        <constraints>
+          <grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text resource-bundle="messages/XmlBundle" key="any.dialog.status"/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="webservice.status.tooltip"/>
+        </properties>
+      </component>
+      <component id="6432a" class="javax.swing.JLabel" binding="status">
+        <constraints>
+          <grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value=""/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="webservice.status.tooltip"/>
+        </properties>
+      </component>
+      <component id="b2571" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="generateFromUrl">
+        <constraints>
+          <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="150" height="-1"/>
+          </grid>
+        </constraints>
+        <properties>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.instance2schema.url.tooltip"/>
+        </properties>
+      </component>
+      <component id="73cde" class="javax.swing.JLabel" binding="rootElementChooserText">
+        <constraints>
+          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text resource-bundle="messages/XmlBundle" key="schema2instance.dialog.element.name"/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.rootelement.tooltip"/>
+        </properties>
+      </component>
+      <component id="d3b6f" class="javax.swing.JComboBox" binding="rootElementChooser">
+        <constraints>
+          <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <editable value="true"/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.rootelement.tooltip"/>
+        </properties>
+      </component>
+      <component id="a0090" class="javax.swing.JCheckBox" binding="enableRestrictionCheck">
+        <constraints>
+          <grid row="3" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <margin top="0" left="0" bottom="0" right="0"/>
+          <selected value="true"/>
+          <text resource-bundle="messages/XmlBundle" key="schema2instance.dialog.enable.restriction.check"/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.particle.valid.tooltip"/>
+        </properties>
+      </component>
+      <component id="3df45" class="javax.swing.JCheckBox" binding="enableUniqueCheck">
+        <constraints>
+          <grid row="4" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <horizontalAlignment value="2"/>
+          <horizontalTextPosition value="4"/>
+          <margin top="0" left="0" bottom="0" right="0"/>
+          <selected value="true"/>
+          <text resource-bundle="messages/XmlBundle" key="schema2instance.dialog.enable.unique.check"/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.unique.particle.tooltip"/>
+        </properties>
+      </component>
+      <component id="9cfb7" class="javax.swing.JLabel" binding="outputFileNameText">
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <labelFor value="aa173"/>
+          <text resource-bundle="messages/XmlBundle" key="schema2instance.dialog.instance.document.name"/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.instance.document.name.tooltip"/>
+        </properties>
+      </component>
+      <component id="aa173" class="javax.swing.JTextField" binding="outputFileName">
+        <constraints>
+          <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="150" height="-1"/>
+          </grid>
+        </constraints>
+        <properties>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.instance.document.name.tooltip"/>
+        </properties>
+      </component>
+    </children>
+  </grid>
+</form>
diff --git a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.java b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.java
new file mode 100644
index 0000000..33d7561
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.java
@@ -0,0 +1,299 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.actions.xmlbeans;
+
+
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.templateLanguages.TemplateLanguageFileViewProvider;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.ui.JBColor;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.XmlElementDescriptor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class GenerateInstanceDocumentFromSchemaDialog extends DialogWrapper {
+  private JPanel panel;
+  private TextFieldWithBrowseButton generateFromUrl;
+  private JLabel status;
+  private JLabel statusText;
+  private JLabel generateFromUrlText;
+  private JComboBox rootElementChooser;
+  private JLabel rootElementChooserText;
+  private JCheckBox enableRestrictionCheck;
+  private JCheckBox enableUniqueCheck;
+  private JTextField outputFileName;
+  private JLabel outputFileNameText;
+  private String previousUri;
+  private Runnable myOkAction;
+  private final Project myProject;
+
+  public GenerateInstanceDocumentFromSchemaDialog(Project project, VirtualFile file) {
+    super(project, true);
+    myProject = project;
+
+    UIUtils
+      .configureBrowseButton(project, generateFromUrl, new String[]{"xsd"}, XmlBundle.message("select.xsd.schema.dialog.title"), false);
+
+    doInitFor(rootElementChooserText, rootElementChooser);
+    doInitFor(generateFromUrlText, generateFromUrl.getTextField());
+    doInitFor(outputFileNameText, outputFileName);
+    generateFromUrl.setText(file.getPresentableUrl());
+    updateFile();
+
+    setTitle(XmlBundle.message("generate.instance.document.from.schema.dialog.title"));
+
+    init();
+
+    outputFileName.setText(file.getName() + ".xml");
+  }
+
+  public void doInitFor(JLabel textComponent, JComponent component) {
+    textComponent.setLabelFor(component);
+
+    if (component instanceof JTextField) {
+      ((JTextField)component).getDocument().addDocumentListener(new DocumentListener() {
+        public void insertUpdate(DocumentEvent e) {
+          validateData();
+        }
+
+        public void removeUpdate(DocumentEvent e) {
+          validateData();
+        }
+
+        public void changedUpdate(DocumentEvent e) {
+          validateData();
+        }
+      });
+    }
+    else if (component instanceof JComboBox) {
+      JComboBox jComboBox = ((JComboBox)component);
+
+      jComboBox.addActionListener(new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+          validateData();
+        }
+      });
+
+      ((JTextField)jComboBox.getEditor().getEditorComponent()).getDocument().addDocumentListener(new DocumentListener() {
+        public void insertUpdate(DocumentEvent e) {
+          validateData();
+        }
+
+        public void removeUpdate(DocumentEvent e) {
+          validateData();
+        }
+
+        public void changedUpdate(DocumentEvent e) {
+          validateData();
+        }
+      });
+
+      if (jComboBox.isEditable()) {
+        jComboBox.getEditor().getEditorComponent().addKeyListener(new KeyAdapter() {
+          public void keyTyped(KeyEvent e) {
+            validateData();
+          }
+        });
+      }
+    }
+  }
+
+  private void validateData() {
+    String msg = doValidateWithData();
+    setOKActionEnabled(msg == null);
+    status.setText(msg == null ? "" : msg);
+    status.setForeground(JBColor.RED);
+  }
+
+  public static void configureComboBox(JComboBox combo, List<String> lastValues) {  // without -editor.selectAll- no focus
+    combo.setModel(new DefaultComboBoxModel(ArrayUtil.toStringArray(lastValues)));
+  }
+
+  private void updateFile() {
+    String uri = generateFromUrl.getText();
+    boolean hasPrevious = (previousUri != null && previousUri.equals(uri));
+    final PsiFile psifile = findFile(uri);
+    List<String> myRootValues;
+
+    if (psifile == null) {
+      configureComboBox(rootElementChooser, Collections.<String>emptyList());
+      return;
+    }
+
+    final XmlTag rootTag = getRootTag(psifile);
+
+    if (rootTag == null) {
+      configureComboBox(rootElementChooser, Collections.<String>emptyList());
+      rootElementChooser.setSelectedIndex(-1);
+      previousUri = uri;
+      return;
+    }
+
+    myRootValues = Xsd2InstanceUtils.addVariantsFromRootTag(rootTag);
+
+    Object selectedItem = rootElementChooser.getSelectedItem();
+    configureComboBox(rootElementChooser, myRootValues);
+
+    if (hasPrevious) {
+      rootElementChooser.setSelectedItem(selectedItem);
+    }
+    else {
+      rootElementChooser.setSelectedIndex(myRootValues.size() > 0 ? 0 : -1);
+    }
+    previousUri = uri;
+  }
+
+  @Nullable
+  private static XmlTag getRootTag(PsiFile psifile) {
+    XmlFile xmlFile = null;
+    if (psifile instanceof XmlFile) {
+      xmlFile = (XmlFile)psifile;
+    }
+    else if (psifile.getViewProvider() instanceof TemplateLanguageFileViewProvider) {
+      TemplateLanguageFileViewProvider viewProvider = (TemplateLanguageFileViewProvider)psifile.getViewProvider();
+      if (viewProvider.getPsi(viewProvider.getTemplateDataLanguage()) instanceof XmlFile) {
+        xmlFile = (XmlFile)viewProvider.getPsi(viewProvider.getTemplateDataLanguage());
+      }
+    }
+
+    if (xmlFile != null) {
+      return xmlFile.getDocument().getRootTag();
+    }
+    else {
+      return null;
+    }
+  }
+
+  @Nullable
+  private PsiFile findFile(String uri) {
+    final VirtualFile file =
+      uri != null ? VfsUtil.findRelativeFile(ExternalResourceManager.getInstance().getResourceLocation(uri), null) : null;
+    return file != null ? PsiManager.getInstance(myProject).findFile(file) : null;
+  }
+
+  public String getOutputFileName() {
+    return outputFileName.getText();
+  }
+
+  public Boolean areCurrentParametersStillValid() {
+    updateFile();
+    return rootElementChooser.getSelectedItem() != null;
+  }
+
+  @Nullable
+  protected String doValidateWithData() {
+    String rootElementName = getElementName();
+    if (rootElementName == null || rootElementName.length() == 0) {
+      return XmlBundle.message("schema2.instance.no.valid.root.element.name.validation.error");
+    }
+
+    final PsiFile psiFile = findFile(getUrl().getText());
+    if (psiFile instanceof XmlFile) {
+      final XmlTag tag = getRootTag(psiFile);
+      if (tag != null) {
+        final XmlElementDescriptor descriptor = Xsd2InstanceUtils.getDescriptor(tag, rootElementName);
+
+        if (descriptor == null) {
+          return XmlBundle.message("schema2.instance.no.valid.root.element.name.validation.error");
+        }
+      }
+    }
+
+    final String fileName = getOutputFileName();
+    if (fileName == null || fileName.length() == 0) {
+      return XmlBundle.message("schema2.instance.output.file.name.is.empty.validation.problem");
+    }
+    return null;
+
+  }
+
+  protected static boolean isAcceptableFile(VirtualFile virtualFile) {
+    return GenerateInstanceDocumentFromSchemaAction.isAcceptableFileForGenerateSchemaFromInstanceDocument(virtualFile);
+  }
+
+
+  protected TextFieldWithBrowseButton getUrl() {
+    return generateFromUrl;
+  }
+
+  protected JLabel getUrlText() {
+    return generateFromUrlText;
+  }
+
+  protected JLabel getStatusTextField() {
+    return statusText;
+  }
+
+  protected JLabel getStatusField() {
+    return status;
+  }
+
+  protected JComponent createCenterPanel() {
+    return panel;
+  }
+
+  boolean enableUniquenessCheck() {
+    return enableUniqueCheck.isSelected();
+  }
+
+  boolean enableRestrictionCheck() {
+    return enableRestrictionCheck.isSelected();
+  }
+
+  String getElementName() {
+    return (String)rootElementChooser.getSelectedItem();
+  }
+
+  public void setOkAction(Runnable runnable) {
+    myOkAction = runnable;
+  }
+
+  @Override
+  protected void doOKAction() {
+    super.doOKAction();
+    if (myOkAction != null) {
+      myOkAction.run();
+    }
+  }
+
+  @NotNull
+  protected String getHelpId() {
+    return "webservices.GenerateInstanceDocumentFromSchema";
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentAction.java b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentAction.java
new file mode 100644
index 0000000..62bdcb7
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentAction.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.actions.xmlbeans;
+
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.ActionPlaces;
+import com.intellij.openapi.actionSystem.PlatformDataKeys;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.fileEditor.FileDocumentManager;
+import com.intellij.openapi.fileEditor.FileEditorManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlBundle;
+import org.apache.xmlbeans.impl.inst2xsd.Inst2Xsd;
+import org.jetbrains.annotations.NonNls;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class GenerateSchemaFromInstanceDocumentAction extends AnAction {
+  private static final Map<String, String> DESIGN_TYPES = new HashMap<String, String>();
+  private static final Map<String, String> CONTENT_TYPES = new HashMap<String, String>();
+  static {
+    DESIGN_TYPES.put(GenerateSchemaFromInstanceDocumentDialog.LOCAL_ELEMENTS_GLOBAL_COMPLEX_TYPES, "vb");
+    DESIGN_TYPES.put(GenerateSchemaFromInstanceDocumentDialog.LOCAL_ELEMENTS_TYPES, "ss");
+    DESIGN_TYPES.put(GenerateSchemaFromInstanceDocumentDialog.GLOBAL_ELEMENTS_LOCAL_TYPES, "rd");
+    CONTENT_TYPES.put(GenerateSchemaFromInstanceDocumentDialog.SMART_TYPE, "smart");
+    CONTENT_TYPES.put(GenerateSchemaFromInstanceDocumentDialog.STRING_TYPE, "string");
+  }
+
+  //private static final
+  
+  @Override
+  public void update(AnActionEvent e) {
+    final VirtualFile file = PlatformDataKeys.VIRTUAL_FILE.getData(e.getDataContext());
+    final boolean enabled = isAcceptableFile(file);
+    e.getPresentation().setEnabled(enabled);
+    if (ActionPlaces.isPopupPlace(e.getPlace())) {
+      e.getPresentation().setVisible(enabled);
+    }
+  }
+
+  public void actionPerformed(AnActionEvent e) {
+    final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
+    final VirtualFile file = PlatformDataKeys.VIRTUAL_FILE.getData(e.getDataContext());
+
+    final GenerateSchemaFromInstanceDocumentDialog dialog = new GenerateSchemaFromInstanceDocumentDialog(project, file);
+    dialog.setOkAction(new Runnable() {
+      public void run() {
+        doAction(project, dialog);
+      }
+    });    
+
+    dialog.show();
+  }
+
+  private static void doAction(final Project project, final GenerateSchemaFromInstanceDocumentDialog dialog) {
+    FileDocumentManager.getInstance().saveAllDocuments();
+
+    final String url = dialog.getUrl().getText();
+    final VirtualFile relativeFile = VfsUtil.findRelativeFile(ExternalResourceManager.getInstance().getResourceLocation(url), null);
+    VirtualFile relativeFileDir;
+    if (relativeFile == null) {
+      Messages.showErrorDialog(project, XmlBundle.message("file.doesnt.exist", url), XmlBundle.message("error"));
+      return;
+    } else {
+      relativeFileDir = relativeFile.getParent();
+    }
+    if (relativeFileDir == null) {
+      Messages.showErrorDialog(project, XmlBundle.message("file.doesnt.exist", url), XmlBundle.message("error"));
+      return;
+    }
+
+    @NonNls List<String> parameters = new LinkedList<String>();
+    parameters.add("-design");
+    parameters.add(DESIGN_TYPES.get(dialog.getDesignType()));
+
+    parameters.add("-simple-content-types");
+    parameters.add(CONTENT_TYPES.get(dialog.getSimpleContentType()));
+
+    parameters.add("-enumerations");
+    String enumLimit = dialog.getEnumerationsLimit();
+    parameters.add("0".equals(enumLimit) ? "never" : enumLimit);
+
+    parameters.add("-outDir");
+    final String dirPath = relativeFileDir.getPath();
+    parameters.add(dirPath);
+
+    final File expectedSchemaFile = new File(dirPath + File.separator + relativeFile.getName() + "0.xsd");
+    if (expectedSchemaFile.exists()) {
+      if (!expectedSchemaFile.delete()) {
+        Messages.showErrorDialog(project, XmlBundle.message("cant.delete.file", expectedSchemaFile.getPath()), XmlBundle.message("error"));
+        return;
+      }
+    }
+
+    parameters.add("-outPrefix");
+    parameters.add(relativeFile.getName());
+
+    parameters.add(url);
+    File xsd = new File(dirPath + File.separator + dialog.getTargetSchemaName());
+    final VirtualFile xsdFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(xsd);
+    if (xsdFile != null) {
+        ApplicationManager.getApplication().runWriteAction(new Runnable() {
+          public void run() {
+            try {
+              xsdFile.delete(null);
+            } catch (IOException e) {//
+            }
+          }
+        });
+    }
+
+    Inst2Xsd.main(ArrayUtil.toStringArray(parameters));
+    if (expectedSchemaFile.exists()) {
+      final boolean renamed = expectedSchemaFile.renameTo(xsd);
+      if (! renamed) {
+        Messages.showErrorDialog(project, XmlBundle.message("cant.rename.file", expectedSchemaFile.getPath(), xsd.getPath()), XmlBundle.message("error"));
+      }
+    }
+
+    VirtualFile xsdVFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(xsd);
+    if (xsdVFile != null) {
+      FileEditorManager.getInstance(project).openFile(xsdVFile, true);
+    } else {
+      Messages.showErrorDialog(project, XmlBundle.message("xml2xsd.generator.error.message"), XmlBundle.message("xml2xsd.generator.error"));
+    }
+
+  }
+
+  public static boolean isAcceptableFile(VirtualFile file) {
+    return file != null && "xml".equalsIgnoreCase(file.getExtension());
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentDialog.form b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentDialog.form
new file mode 100644
index 0000000..fecd029
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentDialog.form
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.xml.actions.xmlbeans.GenerateSchemaFromInstanceDocumentDialog">
+  <grid id="fece0" binding="panel" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="1" left="1" bottom="1" right="1"/>
+    <constraints>
+      <xy x="282" y="178" width="645" height="153"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <component id="fc23b" class="javax.swing.JLabel" binding="generateFromUrlText">
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text resource-bundle="messages/XmlBundle" key="instance2schema.dialog.instance.document.path"/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.instance2schema.url.tooltip"/>
+        </properties>
+      </component>
+      <component id="bef0c" class="javax.swing.JLabel" binding="statusText">
+        <constraints>
+          <grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text resource-bundle="messages/XmlBundle" key="any.dialog.status"/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="webservice.status.tooltip"/>
+        </properties>
+      </component>
+      <component id="6432a" class="javax.swing.JLabel" binding="status">
+        <constraints>
+          <grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <foreground color="-65536"/>
+          <text value=""/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="webservice.status.tooltip"/>
+        </properties>
+      </component>
+      <component id="b2571" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="generateFromUrl">
+        <constraints>
+          <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="150" height="-1"/>
+          </grid>
+        </constraints>
+        <properties>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.instance2schema.url.tooltip"/>
+        </properties>
+      </component>
+      <component id="6ad20" class="javax.swing.JLabel" binding="designTypeText">
+        <constraints>
+          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text resource-bundle="messages/XmlBundle" key="instance2schema.dialog.design.type"/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.designtype.tooltip"/>
+        </properties>
+      </component>
+      <component id="5c4f" class="javax.swing.JLabel" binding="detectSimpleContentTypesText">
+        <constraints>
+          <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text resource-bundle="messages/XmlBundle" key="instance2schema.dialog.detect.simple.content.type"/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.simplecontenttype.tooltip"/>
+        </properties>
+      </component>
+      <component id="cbbd3" class="javax.swing.JLabel" binding="detectEnumerationsLimitText">
+        <constraints>
+          <grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <labelFor value="18828"/>
+          <text resource-bundle="messages/XmlBundle" key="instance2schema.dialog.detect.enumerations.limit"/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.enumerations.tooltip"/>
+        </properties>
+      </component>
+      <component id="18828" class="javax.swing.JTextField" binding="detectEnumerationsLimit">
+        <constraints>
+          <grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="150" height="-1"/>
+          </grid>
+        </constraints>
+        <properties>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.enumerations.tooltip"/>
+        </properties>
+      </component>
+      <component id="78b1e" class="com.intellij.openapi.ui.ComboBox" binding="detectSimpleContentTypes">
+        <constraints>
+          <grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.simplecontenttype.tooltip"/>
+        </properties>
+      </component>
+      <component id="f3bf0" class="com.intellij.openapi.ui.ComboBox" binding="designType">
+        <constraints>
+          <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.designtype.tooltip"/>
+        </properties>
+      </component>
+      <component id="a7b02" class="javax.swing.JLabel" binding="resultSchemaFileNameText">
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <labelFor value="6bb2c"/>
+          <text value="Result schema file name:"/>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.instance2schema.result.schema.name"/>
+        </properties>
+      </component>
+      <component id="6bb2c" class="javax.swing.JTextField" binding="resultSchemaFileName">
+        <constraints>
+          <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="150" height="-1"/>
+          </grid>
+        </constraints>
+        <properties>
+          <toolTipText resource-bundle="messages/XmlBundle" key="xmlbeans.enumerations.tooltip"/>
+        </properties>
+      </component>
+    </children>
+  </grid>
+</form>
diff --git a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentDialog.java b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentDialog.java
new file mode 100644
index 0000000..e57a753
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentDialog.java
@@ -0,0 +1,224 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.actions.xmlbeans;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.ComboBox;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.ui.JBColor;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.io.File;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class GenerateSchemaFromInstanceDocumentDialog extends DialogWrapper {
+  private JPanel panel;
+  private TextFieldWithBrowseButton generateFromUrl;
+  private JLabel status;
+  private JLabel statusText;
+  private JLabel generateFromUrlText;
+  private JLabel designTypeText;
+  private JTextField detectEnumerationsLimit;
+  private ComboBox detectSimpleContentTypes;
+  private ComboBox designType;
+  private JLabel detectEnumerationsLimitText;
+  private JLabel detectSimpleContentTypesText;
+  private JLabel resultSchemaFileNameText;
+  private JTextField resultSchemaFileName;
+
+  static final String LOCAL_ELEMENTS_GLOBAL_COMPLEX_TYPES = XmlBundle.message("local.elements.global.complex.types.option.name");
+  static final String LOCAL_ELEMENTS_TYPES = XmlBundle.message("local.elements.types.option.name");
+  static final String GLOBAL_ELEMENTS_LOCAL_TYPES = XmlBundle.message("global.elements.local.types.option.name");
+
+  private static final List<String> designTypes = Arrays.asList(
+    LOCAL_ELEMENTS_GLOBAL_COMPLEX_TYPES,
+    LOCAL_ELEMENTS_TYPES,
+    GLOBAL_ELEMENTS_LOCAL_TYPES
+  );
+
+  static final String STRING_TYPE = "string";
+  static final String SMART_TYPE = "smart";
+  private static final List<String> simpleContentTypes = Arrays.asList(STRING_TYPE, SMART_TYPE);
+  private Runnable myOkAction;
+
+  public GenerateSchemaFromInstanceDocumentDialog(Project project, VirtualFile file) {
+    super(project, true);
+
+    setTitle(XmlBundle.message("generate.schema.from.instance.document.dialog.title"));
+
+    doInitFor(designTypeText, designType);
+    configureComboBox(designType,designTypes);
+
+    doInitFor(detectSimpleContentTypesText, detectSimpleContentTypes);
+    configureComboBox(detectSimpleContentTypes, simpleContentTypes);
+
+
+    doInitFor(detectEnumerationsLimitText, detectEnumerationsLimit);
+    detectEnumerationsLimit.setText("10");
+
+
+    UIUtils.configureBrowseButton(project, generateFromUrl, new String[] {"xml"}, XmlBundle.message("select.xml.document.dialog.title"), false);
+    doInitFor(generateFromUrlText, generateFromUrl.getTextField());
+
+    doInitFor(resultSchemaFileNameText, resultSchemaFileName);
+
+    init();
+    
+    generateFromUrl.setText(file.getPresentableUrl());
+    resultSchemaFileName.setText(file.getNameWithoutExtension() + ".xsd");
+  }
+
+  private void validateData() {
+    String msg = doValidateWithData();
+    setOKActionEnabled(msg == null);
+    status.setText(msg == null ? "" : msg);
+    status.setForeground(JBColor.RED);
+  }
+
+  public static void configureComboBox(JComboBox combo, List<String> lastValues) {
+    combo.setModel(new DefaultComboBoxModel(ArrayUtil.toStringArray(lastValues)));
+    if (combo.getItemCount() != 0) {
+      combo.setSelectedIndex(0);
+      combo.getEditor().selectAll();
+    }
+  }
+
+  public void setFileUrl(String url) {
+    generateFromUrl.setText(url);
+  }
+
+  @Override
+  protected void doOKAction() {
+    super.doOKAction();
+    if (myOkAction != null) {
+      myOkAction.run();
+    }
+  }
+
+  public void setOkAction(Runnable okAction) {
+    myOkAction = okAction;
+  }
+
+  public void doInitFor(JLabel textComponent, JComponent component) {
+    textComponent.setLabelFor(component);
+
+    if (component instanceof JTextField) {
+      ((JTextField)component).getDocument().addDocumentListener(new DocumentListener() {
+        public void insertUpdate(DocumentEvent e) {
+          validateData();
+        }
+
+        public void removeUpdate(DocumentEvent e) {
+          validateData();
+        }
+
+        public void changedUpdate(DocumentEvent e) {
+          validateData();
+        }
+      });
+    } else if (component instanceof JComboBox) {
+      JComboBox jComboBox = ((JComboBox) component);
+
+      jComboBox.addActionListener(new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+          validateData();
+        }
+      });
+
+      if (jComboBox.isEditable()) {
+        jComboBox.getEditor().getEditorComponent().addKeyListener(new KeyAdapter() {
+          public void keyTyped(KeyEvent e) {
+            validateData();
+          }
+        });
+      }
+    }
+  }
+
+  protected TextFieldWithBrowseButton getUrl() {
+    return generateFromUrl;
+  }
+
+  protected JLabel getUrlText() {
+    return generateFromUrlText;
+  }
+
+  protected JLabel getStatusTextField() {
+    return statusText;
+  }
+
+  protected JLabel getStatusField() {
+    return status;
+  }
+
+  protected JComponent createCenterPanel() {
+    return panel;
+  }
+
+  String getDesignType() {
+    return (String) designType.getSelectedItem();
+  }
+
+  String getSimpleContentType() {
+    return (String) detectSimpleContentTypes.getSelectedItem();
+  }
+
+  String getEnumerationsLimit() {
+    return detectEnumerationsLimit.getText();
+  }
+
+  public String getTargetSchemaName() {
+    return resultSchemaFileName.getText();
+  }
+
+  protected String doValidateWithData() {
+    if (! new File(generateFromUrl.getText()).exists()) {
+      return XmlBundle.message("instance.document.file.is.not.exist");
+    }
+
+    try {
+      int i = Integer.parseInt(getEnumerationsLimit());
+      if (i < 0) return XmlBundle.message("negative.number.validation.problem");
+    } catch(NumberFormatException ex) {
+      return XmlBundle.message("invalid.number.validation.problem");
+    }
+
+    if (getTargetSchemaName() == null || getTargetSchemaName().length() == 0) {
+      return XmlBundle.message("result.schema.file.name.is.empty.validation.problem");
+    }
+    return null;
+  }
+
+  @NotNull
+  protected String getHelpId() {
+    return "webservices.GenerateSchemaFromInstanceDocument";
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/actions/xmlbeans/UIUtils.java b/xml/impl/src/com/intellij/xml/actions/xmlbeans/UIUtils.java
new file mode 100644
index 0000000..cdde9af
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/xmlbeans/UIUtils.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.actions.xmlbeans;
+
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.openapi.fileChooser.FileChooser;
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.xml.XmlBundle;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class UIUtils {
+  private UIUtils() {}
+
+  public static void configureBrowseButton(final Project myProject,
+                                       final TextFieldWithBrowseButton wsdlUrl,
+                                       final String[] _extensions,
+                                       final String selectFileDialogTitle,
+                                       final boolean multipleFileSelection) {
+    wsdlUrl.getButton().setToolTipText(XmlBundle.message("browse.button.tooltip"));
+    wsdlUrl.getButton().addActionListener(
+      new ActionListener() {
+        public void actionPerformed(ActionEvent actionEvent) {
+          final FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, multipleFileSelection) {
+            private final List<String> extensions = Arrays.asList(_extensions);
+
+            public boolean isFileSelectable(VirtualFile virtualFile) {
+              return extensions.contains(virtualFile.getExtension());
+            }
+
+            @Override
+            public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
+              return super.isFileVisible(file, showHiddenFiles) && (file.isDirectory() || isFileSelectable(file));
+            }
+          };
+
+          fileChooserDescriptor.setTitle(selectFileDialogTitle);
+
+          VirtualFile initialFile = myProject.getBaseDir();
+          String selectedItem = wsdlUrl.getTextField().getText();
+          if (selectedItem != null && selectedItem.startsWith(LocalFileSystem.PROTOCOL_PREFIX)) {
+            VirtualFile fileByPath = VfsUtil.findRelativeFile(ExternalResourceManager.getInstance().getResourceLocation(VfsUtil.fixURLforIDEA(selectedItem)), null);
+            if (fileByPath != null) initialFile = fileByPath;
+          }
+
+          final VirtualFile[] virtualFiles = FileChooser.chooseFiles(fileChooserDescriptor, myProject, initialFile);
+          if (virtualFiles.length == 1) {
+            String url = fixIDEAUrl(virtualFiles[0].getUrl());
+            wsdlUrl.setText(url);
+          }
+        }
+      }
+    );
+  }
+
+  public static String fixIDEAUrl(String url) {
+    return SystemInfo.isWindows ? VfsUtil.fixIDEAUrl(url) : url;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/actions/xmlbeans/Xsd2InstanceUtils.java b/xml/impl/src/com/intellij/xml/actions/xmlbeans/Xsd2InstanceUtils.java
new file mode 100644
index 0000000..c6c358e
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/actions/xmlbeans/Xsd2InstanceUtils.java
@@ -0,0 +1,245 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.actions.xmlbeans;
+
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.XmlRecursiveElementVisitor;
+import com.intellij.psi.impl.source.tree.LeafPsiElement;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.impl.schema.XmlNSDescriptorImpl;
+import com.intellij.xml.util.XmlUtil;
+import org.apache.xmlbeans.*;
+import org.apache.xmlbeans.impl.tool.CommandLine;
+import org.apache.xmlbeans.impl.xsd2inst.SampleXmlUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.util.*;
+
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class Xsd2InstanceUtils {
+    public static String generate(String[] args) {
+        Set flags = new HashSet();
+        Set opts = new HashSet();
+        flags.add("h");
+        flags.add("help");
+        flags.add("usage");
+        flags.add("license");
+        flags.add("version");
+        flags.add("dl");
+        flags.add("noupa");
+        flags.add("nopvr");
+        flags.add("partial");
+        opts.add("name");
+
+        CommandLine cl = new CommandLine(args, flags, opts);
+
+        String[] badOpts = cl.getBadOpts();
+        if (badOpts.length > 0) {
+                throw new IllegalArgumentException("Unrecognized option: " + badOpts[0]);
+
+        }
+
+        boolean dl = (cl.getOpt("dl") != null);
+        boolean nopvr = (cl.getOpt("nopvr") != null);
+        boolean noupa = (cl.getOpt("noupa") != null);
+
+        File[] schemaFiles = cl.filesEndingWith(".xsd");
+        String rootName = cl.getOpt("name");
+
+        if (rootName == null) {
+            throw new IllegalArgumentException("Required option \"-name\" must be present");
+        }
+
+        // Process Schema files
+        List sdocs = new ArrayList();
+        for (int i = 0; i < schemaFiles.length; i++)
+        {
+            try
+            {
+                sdocs.add(XmlObject.Factory.parse(schemaFiles[i],
+                        (new XmlOptions()).setLoadLineNumbers().setLoadMessageDigest()));
+            }
+            catch (Exception e)
+            {
+                throw new IllegalArgumentException("Can not load schema file: " + schemaFiles[i] + ": " + e.getLocalizedMessage());
+            }
+        }
+
+        XmlObject[] schemas = (XmlObject[]) sdocs.toArray(new XmlObject[sdocs.size()]);
+
+        SchemaTypeSystem sts = null;
+        if (schemas.length > 0)
+        {
+            Collection errors = new ArrayList();
+            XmlOptions compileOptions = new XmlOptions();
+            if (dl)
+                compileOptions.setCompileDownloadUrls();
+            if (nopvr)
+                compileOptions.setCompileNoPvrRule();
+            if (noupa)
+                compileOptions.setCompileNoUpaRule();
+
+          try {
+            sts = XmlBeans.compileXsd(schemas, XmlBeans.getBuiltinTypeSystem(), compileOptions);
+          } catch (XmlException e) {
+              String out = "Schema compilation errors: ";
+              for (Object error : errors) out += "\n" + error;
+              throw new IllegalArgumentException(out);
+          }
+        }
+
+        if (sts == null)
+        {
+            throw new IllegalArgumentException("No Schemas to process.");
+        }
+        SchemaType[] globalElems = sts.documentTypes();
+        SchemaType elem = null;
+        for (int i = 0; i < globalElems.length; i++)
+        {
+            if (rootName.equals(globalElems[i].getDocumentElementName().getLocalPart()))
+            {
+                elem = globalElems[i];
+                break;
+            }
+        }
+
+        if (elem == null) {
+            throw new IllegalArgumentException("Could not find a global element with name \"" + rootName + "\"");
+        }
+
+        // Now generate it
+        return SampleXmlUtil.createSampleForType(elem);
+    }
+
+  public static XmlElementDescriptor getDescriptor(XmlTag tag, String elementName) {
+    final PsiMetaData metaData = tag.getMetaData();
+
+    if (metaData instanceof XmlNSDescriptorImpl) {
+      final XmlNSDescriptorImpl nsDescriptor = (XmlNSDescriptorImpl) metaData;
+      return nsDescriptor.getElementDescriptor(elementName, nsDescriptor.getDefaultNamespace());
+    }
+
+    return null;
+  }
+
+  public static List<String> addVariantsFromRootTag(XmlTag rootTag) {
+    PsiMetaData metaData = rootTag.getMetaData();
+    if (metaData instanceof XmlNSDescriptorImpl) {
+      XmlNSDescriptorImpl nsDescriptor = (XmlNSDescriptorImpl) metaData;
+
+      List<String> elementDescriptors = new ArrayList<String>();
+      XmlElementDescriptor[] rootElementsDescriptors = nsDescriptor.getRootElementsDescriptors(PsiTreeUtil.getParentOfType(rootTag, XmlDocument.class));
+      for(XmlElementDescriptor e:rootElementsDescriptors) {
+        elementDescriptors.add(e.getName());
+      }
+
+      return elementDescriptors;
+    }
+    return Collections.emptyList();
+  }
+
+  public static String processAndSaveAllSchemas(@NotNull XmlFile file, @NotNull final Map<String, String> scannedToFileName,
+                                          final @NotNull SchemaReferenceProcessor schemaReferenceProcessor) {
+    final String fileName = file.getName();
+
+    String previous = scannedToFileName.get(fileName);
+
+    if (previous != null) return previous;
+
+    scannedToFileName.put(fileName, fileName);
+
+    final StringBuilder result = new StringBuilder();
+
+    file.acceptChildren(new XmlRecursiveElementVisitor() {
+      @Override public void visitElement(PsiElement psiElement) {
+        super.visitElement(psiElement);
+        if (psiElement instanceof LeafPsiElement) {
+          final String text = psiElement.getText();
+          result.append(text);
+        }
+      }
+
+      @Override public void visitXmlAttribute(XmlAttribute xmlAttribute) {
+        boolean replaced = false;
+
+        if (xmlAttribute.isNamespaceDeclaration()) {
+          replaced = true;
+          final String value = xmlAttribute.getValue();
+          result.append(xmlAttribute.getText()).append(" ");
+
+          if (!scannedToFileName.containsKey(value)) {
+            final XmlNSDescriptor nsDescriptor = xmlAttribute.getParent().getNSDescriptor(value, true);
+
+            if (nsDescriptor != null) {
+              processAndSaveAllSchemas(nsDescriptor.getDescriptorFile(), scannedToFileName, schemaReferenceProcessor);
+            }
+          }
+        } else if ("schemaLocation".equals(xmlAttribute.getName())) {
+          final PsiReference[] references = xmlAttribute.getValueElement().getReferences();
+
+          if (references.length > 0) {
+            PsiElement psiElement = references[0].resolve();
+
+            if (psiElement instanceof XmlFile) {
+              final String s = processAndSaveAllSchemas(((XmlFile) psiElement), scannedToFileName, schemaReferenceProcessor);
+              if (s != null) {
+                result.append(xmlAttribute.getName()).append("='").append(s).append('\'');
+                replaced = true;
+              }
+            }
+          }
+        }
+        if (!replaced) result.append(xmlAttribute.getText());
+      }
+    });
+
+    final VirtualFile virtualFile = file.getVirtualFile();
+    final String content = result.toString();
+
+    byte[] bytes;
+    if (virtualFile != null) {
+      bytes = content.getBytes(virtualFile.getCharset());
+    } else {
+      try {
+        final String charsetName = XmlUtil.extractXmlEncodingFromProlog(content.getBytes());
+        bytes = charsetName != null ? content.getBytes(charsetName) : content.getBytes();
+      } catch (UnsupportedEncodingException e) {
+        bytes = content.getBytes();
+      }
+    }
+
+    schemaReferenceProcessor.processSchema(fileName, bytes);
+    return fileName;
+  }
+
+  public interface SchemaReferenceProcessor {
+    void processSchema(String schemaFileName, byte[] schemaContent);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsLoaderComponent.java b/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsLoaderComponent.java
new file mode 100644
index 0000000..be1aece
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsLoaderComponent.java
@@ -0,0 +1,74 @@
+
+package com.intellij.xml.breadcrumbs;
+
+import com.intellij.application.options.editor.WebEditorOptions;
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.components.AbstractProjectComponent;
+import com.intellij.openapi.fileEditor.*;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.impl.http.HttpVirtualFile;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.PsiManager;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+/**
+ * @author spleaner
+ */
+public class BreadcrumbsLoaderComponent extends AbstractProjectComponent {  
+
+  public BreadcrumbsLoaderComponent(@NotNull final Project project) {
+    super(project);
+  }
+
+  @NonNls
+  @NotNull
+  public String getComponentName() {
+    return "HtmlBreadcrumbsComponent";
+  }
+
+  public void initComponent() {
+    myProject.getMessageBus().connect().subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, new MyFileEditorManagerListener());
+  }
+
+  private static boolean isEnabled() {
+    final WebEditorOptions webEditorOptions = WebEditorOptions.getInstance();
+    return webEditorOptions.isBreadcrumbsEnabled() || webEditorOptions.isBreadcrumbsEnabledInXml();
+  }
+
+  private static class MyFileEditorManagerListener extends FileEditorManagerAdapter {
+    public void fileOpened(final FileEditorManager source, final VirtualFile file) {
+      if (isEnabled() && isSuitable(source.getProject(), file)) {
+        final FileEditor[] fileEditors = source.getEditors(file);
+        for (final FileEditor fileEditor : fileEditors) {
+          if (fileEditor instanceof TextEditor) {
+            final BreadcrumbsXmlWrapper wrapper = new BreadcrumbsXmlWrapper(((TextEditor)fileEditor).getEditor());
+            final JComponent c = wrapper.getComponent();
+            source.addTopComponent(fileEditor, c);
+
+            Disposer.register(fileEditor, wrapper);
+            Disposer.register(fileEditor, new Disposable() {
+              public void dispose() {
+                source.removeTopComponent(fileEditor, c);
+              }
+            });
+          }
+        }
+      }
+    }
+
+    private static boolean isSuitable(final Project project, final VirtualFile file) {
+      if (file instanceof HttpVirtualFile) {
+        return false;
+      }
+
+      final FileViewProvider provider = PsiManager.getInstance(project).findViewProvider(file);
+
+      return provider != null && BreadcrumbsXmlWrapper.findInfoProvider(provider) != null;
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsPsiItem.java b/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsPsiItem.java
new file mode 100644
index 0000000..f0c6c75
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsPsiItem.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.breadcrumbs;
+
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+public class BreadcrumbsPsiItem extends BreadcrumbsItem {
+  private final PsiElement myElement;
+  private final BreadcrumbsInfoProvider myProvider;
+  private CrumbPresentation myPresentation;
+
+  public BreadcrumbsPsiItem(@NotNull final PsiElement element, @NotNull final BreadcrumbsInfoProvider provider) {
+    myElement = element;
+    myProvider = provider;
+  }
+
+  public void setPresentation(CrumbPresentation presentation) {
+    myPresentation = presentation;
+  }
+
+  public String getDisplayText() {
+    return isValid() ? myProvider.getElementInfo(myElement) : "INVALID";
+  }
+
+  public String getTooltip() {
+    final String s = isValid() ? myProvider.getElementTooltip(myElement) : "";
+    return s == null ? "" : s;
+  }
+
+  @Override
+  public CrumbPresentation getPresentation() {
+    return myPresentation;
+  }
+
+  public boolean isValid() {
+    return myElement != null && myElement.isValid();
+  }
+
+  public PsiElement getPsiElement() {
+    return myElement;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsXmlWrapper.java b/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsXmlWrapper.java
new file mode 100644
index 0000000..56b9b06
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsXmlWrapper.java
@@ -0,0 +1,407 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.breadcrumbs;
+
+import com.intellij.application.options.editor.WebEditorOptions;
+import com.intellij.lang.Language;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.LogicalPosition;
+import com.intellij.openapi.editor.ScrollType;
+import com.intellij.openapi.editor.colors.EditorFontType;
+import com.intellij.openapi.editor.event.CaretEvent;
+import com.intellij.openapi.editor.event.CaretListener;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.fileEditor.FileDocumentManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.vcs.FileStatusListener;
+import com.intellij.openapi.vcs.FileStatusManager;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.ui.update.MergingUpdateQueue;
+import com.intellij.util.ui.update.UiNotifyConnector;
+import com.intellij.util.ui.update.Update;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.LinkedList;
+import java.util.PriorityQueue;
+
+/**
+ * @author spleaner
+ */
+public class BreadcrumbsXmlWrapper implements BreadcrumbsItemListener<BreadcrumbsPsiItem>, Disposable {
+  private final BreadcrumbsComponent<BreadcrumbsPsiItem> myComponent;
+  private final Project myProject;
+  private Editor myEditor;
+  private final VirtualFile myFile;
+  private boolean myUserCaretChange;
+  private final MergingUpdateQueue myQueue;
+  private final BreadcrumbsInfoProvider myInfoProvider;
+  private final JPanel myWrapperPanel;
+
+  public static final Key<BreadcrumbsXmlWrapper> BREADCRUMBS_COMPONENT_KEY = new Key<BreadcrumbsXmlWrapper>("BREADCRUMBS_KEY");
+
+  public BreadcrumbsXmlWrapper(@NotNull final Editor editor) {
+    myEditor = editor;
+    myEditor.putUserData(BREADCRUMBS_COMPONENT_KEY, this);
+
+    final Project project = editor.getProject();
+    assert project != null;
+    myProject = project;
+
+    Document document = myEditor.getDocument();
+    myFile = FileDocumentManager.getInstance().getFile(document);
+
+
+    final FileStatusManager manager = FileStatusManager.getInstance(project);
+    manager.addFileStatusListener(new FileStatusListener() {
+      public void fileStatusesChanged() {
+        if (myComponent != null && myEditor != null) {
+          final Font editorFont = myEditor.getColorsScheme().getFont(EditorFontType.PLAIN);
+          myComponent.setFont(editorFont.deriveFont(Font.PLAIN, editorFont.getSize2D()));
+          updateCrumbs(myEditor.getCaretModel().getLogicalPosition());
+        }
+      }
+
+      public void fileStatusChanged(@NotNull final VirtualFile virtualFile) {
+      }
+    }, this);
+
+
+    myInfoProvider = findInfoProvider(findViewProvider(myFile, myProject));
+
+    final CaretListener caretListener = new CaretListener() {
+      public void caretPositionChanged(final CaretEvent e) {
+        if (myUserCaretChange) {
+          queueUpdate(editor);
+        }
+
+        myUserCaretChange = true;
+      }
+    };
+
+    editor.getCaretModel().addCaretListener(caretListener);
+    Disposer.register(this, new Disposable() {
+      public void dispose() {
+        editor.getCaretModel().removeCaretListener(caretListener);
+      }
+    });
+
+    PsiManager.getInstance(project).addPsiTreeChangeListener(new PsiTreeChangeAdapter() {
+      @Override
+      public void propertyChanged(@NotNull PsiTreeChangeEvent event) {
+        PsiFile psiFile = event.getFile();
+        VirtualFile file = psiFile == null ? null : psiFile.getVirtualFile();
+        if (!Comparing.equal(file, myFile)) return;
+        queueUpdate(editor);
+      }
+
+      @Override
+      public void childrenChanged(@NotNull PsiTreeChangeEvent event) {
+        propertyChanged(event);
+      }
+
+      @Override
+      public void childMoved(@NotNull PsiTreeChangeEvent event) {
+        propertyChanged(event);
+      }
+
+      @Override
+      public void childReplaced(@NotNull PsiTreeChangeEvent event) {
+        propertyChanged(event);
+      }
+
+      @Override
+      public void childRemoved(@NotNull PsiTreeChangeEvent event) {
+        propertyChanged(event);
+      }
+
+      @Override
+      public void childAdded(@NotNull PsiTreeChangeEvent event) {
+        propertyChanged(event);
+      }
+    },this);
+
+    myComponent = new BreadcrumbsComponent<BreadcrumbsPsiItem>();
+    myComponent.addBreadcrumbsItemListener(this);
+
+    final Font editorFont = editor.getColorsScheme().getFont(EditorFontType.PLAIN);
+    myComponent.setFont(editorFont.deriveFont(Font.PLAIN, editorFont.getSize2D()));
+
+    final ComponentAdapter resizeListener = new ComponentAdapter() {
+      public void componentResized(final ComponentEvent e) {
+        queueUpdate(editor);
+      }
+    };
+
+    myComponent.addComponentListener(resizeListener);
+    Disposer.register(this, new Disposable() {
+      public void dispose() {
+        myComponent.removeComponentListener(resizeListener);
+      }
+    });
+
+    myQueue = new MergingUpdateQueue("Breadcrumbs.Queue", 200, true, myComponent);
+    myQueue.queue(new MyUpdate(this, editor));
+
+    Disposer.register(this, new UiNotifyConnector(myComponent, myQueue));
+    Disposer.register(this, myQueue);
+
+    myWrapperPanel = new JPanel();
+    myWrapperPanel.setLayout(new BorderLayout());
+    myWrapperPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 1, 2));
+    myWrapperPanel.setOpaque(false);
+
+    myWrapperPanel.add(myComponent, BorderLayout.CENTER);
+  }
+
+  public void queueUpdate(Editor editor) {
+    myQueue.cancelAllUpdates();
+    myQueue.queue(new MyUpdate(this, editor));
+  }
+
+  private void moveEditorCaretTo(@NotNull final PsiElement element) {
+    if (element.isValid()) {
+      setUserCaretChange(false);
+      myEditor.getCaretModel().moveToOffset(element.getTextOffset());
+      myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);
+    }
+  }
+
+  @Nullable
+  private static BreadcrumbsInfoProvider findProviderForElement(@NotNull final PsiElement element,
+                                                                final BreadcrumbsInfoProvider defaultProvider) {
+    final BreadcrumbsInfoProvider provider = getInfoProvider(element.getLanguage());
+    return provider == null ? defaultProvider : provider;
+  }
+
+  private static PsiElement[] toPsiElementArray(Collection<BreadcrumbsPsiItem> items) {
+    final PsiElement[] elements = new PsiElement[items.size()];
+    int index = 0;
+    for (BreadcrumbsPsiItem item : items) {
+      elements[index++] = item.getPsiElement();
+    }
+    return elements;
+  }
+
+  @Nullable
+  private static CrumbPresentation[] getCrumbPresentations(final PsiElement[] elements) {
+    for (BreadcrumbsPresentationProvider provider : BreadcrumbsPresentationProvider.EP_NAME.getExtensions()) {
+      final CrumbPresentation[] presentations = provider.getCrumbPresentations(elements);
+      if (presentations != null) {
+        return presentations;
+      }
+    }
+    return null;
+  }
+
+  private void setUserCaretChange(final boolean userCaretChange) {
+    myUserCaretChange = userCaretChange;
+  }
+
+  @Nullable
+  private static LinkedList<BreadcrumbsPsiItem> getPresentableLineElements(@NotNull final LogicalPosition position,
+                                                                           final VirtualFile file,
+                                                                           final Editor editor,
+                                                                           final Project project,
+                                                                           final BreadcrumbsInfoProvider defaultInfoProvider) {
+    final LinkedList<BreadcrumbsPsiItem> result =
+      getLineElements(editor.logicalPositionToOffset(position), file, project, defaultInfoProvider);
+
+    if (result == null) return null;
+
+    final PsiElement[] elements = toPsiElementArray(result);
+    final CrumbPresentation[] presentations = getCrumbPresentations(elements);
+    if (presentations != null) {
+      int i = 0;
+      for (BreadcrumbsPsiItem item : result) {
+        item.setPresentation(presentations[i++]);
+      }
+    }
+
+    return result;
+  }
+
+  @Nullable
+  public static PsiElement[] getLinePsiElements(int offset, VirtualFile file, Project project, BreadcrumbsInfoProvider infoProvider) {
+    final LinkedList<BreadcrumbsPsiItem> lineElements = getLineElements(offset, file, project, infoProvider);
+    return lineElements != null ? toPsiElementArray(lineElements) : null;
+  }
+
+  @Nullable
+  private static LinkedList<BreadcrumbsPsiItem> getLineElements(final int offset,
+                                                                VirtualFile file,
+                                                                Project project,
+                                                                BreadcrumbsInfoProvider defaultInfoProvider) {
+    PsiElement element = findFirstBreadcrumbedElement(offset, file, project, defaultInfoProvider);
+    if (element == null) return null;
+
+    final LinkedList<BreadcrumbsPsiItem> result = new LinkedList<BreadcrumbsPsiItem>();
+    while (element != null) {
+      BreadcrumbsInfoProvider provider = findProviderForElement(element, defaultInfoProvider);
+
+      if (provider != null && provider.acceptElement(element)) {
+        result.addFirst(new BreadcrumbsPsiItem(element, provider));
+      }
+
+      element = (provider != null) ? provider.getParent(element) : element.getParent();
+    }
+    return result;
+  }
+
+  @Nullable
+  private static PsiElement findFirstBreadcrumbedElement(final int offset,
+                                                         final VirtualFile file,
+                                                         final Project project,
+                                                         final BreadcrumbsInfoProvider defaultInfoProvider) {
+    if (file == null || !file.isValid()) return null;
+
+    PriorityQueue<PsiElement> leafs = new PriorityQueue<PsiElement>(3, new Comparator<PsiElement>() {
+      public int compare(final PsiElement o1, final PsiElement o2) {
+        return o2.getTextRange().getStartOffset() - o1.getTextRange().getStartOffset();
+      }
+    });
+    FileViewProvider viewProvider = findViewProvider(file, project);
+    if (viewProvider == null) return null;
+
+    for (final Language language : viewProvider.getLanguages()) {
+      ContainerUtil.addIfNotNull(viewProvider.findElementAt(offset, language), leafs);
+    }
+    while (!leafs.isEmpty()) {
+      final PsiElement element = leafs.remove();
+      if (!element.isValid()) continue;
+
+      BreadcrumbsInfoProvider provider = findProviderForElement(element, defaultInfoProvider);
+      if (provider != null && provider.acceptElement(element)) {
+        return element;
+      }
+      if (!(element instanceof PsiFile)) {
+        ContainerUtil.addIfNotNull(element.getParent(), leafs);
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  private static FileViewProvider findViewProvider(final VirtualFile file, final Project project) {
+    if (file == null) return null;
+    return PsiManager.getInstance(project).findViewProvider(file);
+  }
+
+  private void updateCrumbs(final LogicalPosition position) {
+    if (myFile != null && myEditor != null) {
+      if (PsiDocumentManager.getInstance(myProject).isUncommited(myEditor.getDocument())) {
+        return;
+      }
+
+      myComponent.setItems(getPresentableLineElements(position, myFile, myEditor, myProject, myInfoProvider));
+    }
+  }
+
+  @Nullable
+  public static BreadcrumbsInfoProvider findInfoProvider(@Nullable FileViewProvider viewProvider) {
+    BreadcrumbsInfoProvider provider = null;
+    if (viewProvider != null) {
+      final WebEditorOptions webEditorOptions = WebEditorOptions.getInstance();
+      final Language baseLang = viewProvider.getBaseLanguage();
+      provider = getInfoProvider(baseLang);
+      if (!webEditorOptions.isBreadcrumbsEnabledInXml() && baseLang == XMLLanguage.INSTANCE) return null;
+      if (!webEditorOptions.isBreadcrumbsEnabled() && baseLang != XMLLanguage.INSTANCE) return null;
+      if (provider == null) {
+        for (final Language language : viewProvider.getLanguages()) {
+          provider = getInfoProvider(language);
+          if (provider != null) {
+            break;
+          }
+        }
+      }
+    }
+    return provider;
+  }
+
+  public JComponent getComponent() {
+    return myWrapperPanel;
+  }
+
+  public void itemSelected(@NotNull final BreadcrumbsPsiItem item, final int modifiers) {
+    final PsiElement psiElement = item.getPsiElement();
+    moveEditorCaretTo(psiElement);
+
+    if ((modifiers & Event.SHIFT_MASK) == Event.SHIFT_MASK || (modifiers & Event.META_MASK) == Event.META_MASK) {
+      final TextRange range = psiElement.getTextRange();
+      myEditor.getSelectionModel().setSelection(range.getStartOffset(), range.getEndOffset());
+    }
+  }
+
+  @Nullable
+  public static BreadcrumbsXmlWrapper getBreadcrumbsComponent(@NotNull Editor editor) {
+    return editor.getUserData(BREADCRUMBS_COMPONENT_KEY);
+  }
+
+  public void dispose() {
+    myEditor.putUserData(BREADCRUMBS_COMPONENT_KEY, null);
+    myEditor = null;
+  }
+
+  @Nullable
+  private static BreadcrumbsInfoProvider getInfoProvider(@NotNull final Language language) {
+    for (final BreadcrumbsInfoProvider provider : Extensions.getExtensions(BreadcrumbsInfoProvider.EP_NAME)) {
+      for (final Language language1 : provider.getLanguages()) {
+        if (language.isKindOf(language1)) {
+          return provider;
+        }
+      }
+    }
+
+    return null;
+  }
+
+  private class MyUpdate extends Update {
+    private final BreadcrumbsXmlWrapper myBreadcrumbsComponent;
+    private final Editor myEditor;
+
+    public MyUpdate(@NonNls final BreadcrumbsXmlWrapper c, @NotNull final Editor editor) {
+      super(c);
+
+      myBreadcrumbsComponent = c;
+      myEditor = editor;
+    }
+
+    public void run() {
+      myBreadcrumbsComponent.updateCrumbs(myEditor.getCaretModel().getLogicalPosition());
+    }
+
+    public boolean canEat(final Update update) {
+      return true;
+    }
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/xml/breadcrumbs/XmlLanguageBreadcrumbsInfoProvider.java b/xml/impl/src/com/intellij/xml/breadcrumbs/XmlLanguageBreadcrumbsInfoProvider.java
new file mode 100644
index 0000000..9f736ee
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/breadcrumbs/XmlLanguageBreadcrumbsInfoProvider.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: spleaner
+ * Date: Jun 19, 2007
+ * Time: 4:44:25 PM
+ */
+package com.intellij.xml.breadcrumbs;
+
+import com.intellij.lang.Language;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.xhtml.XHTMLLanguage;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.StringTokenizer;
+
+public class XmlLanguageBreadcrumbsInfoProvider extends BreadcrumbsInfoProvider {
+  @NonNls private static final String CLASS_ATTRIBUTE_NAME = "class";
+  @NonNls private static final String ID_ATTRIBUTE_NAME = "id";
+
+  public boolean acceptElement(@NotNull final PsiElement e) {
+    return e instanceof XmlTag && e.isValid();
+  }
+
+  public Language[] getLanguages() {
+    return new Language[]{XMLLanguage.INSTANCE, XHTMLLanguage.INSTANCE, HTMLLanguage.INSTANCE};
+  }
+
+  @NotNull
+  public String getElementInfo(@NotNull final PsiElement e) {
+    final XmlTag tag = (XmlTag)e;
+    final StringBuffer sb = new StringBuffer();
+
+    sb.append(tag.getName());
+
+    final boolean addHtmlInfo = e.getContainingFile().getLanguage() != XMLLanguage.INSTANCE;
+
+    if (addHtmlInfo) {
+      final String id_value = tag.getAttributeValue(ID_ATTRIBUTE_NAME);
+      if (null != id_value) {
+        sb.append("#").append(id_value);
+      }
+
+      final String class_value = tag.getAttributeValue(CLASS_ATTRIBUTE_NAME);
+      if (null != class_value) {
+        final StringTokenizer tokenizer = new StringTokenizer(class_value, " ");
+        while (tokenizer.hasMoreTokens()) {
+          sb.append(".").append(tokenizer.nextToken());
+        }
+      }
+    }
+
+    return sb.toString();
+  }
+
+  @Nullable
+  public String getElementTooltip(@NotNull final PsiElement e) {
+    final XmlTag tag = (XmlTag)e;
+    final StringBuffer result = new StringBuffer("&lt;");
+    result.append(tag.getName());
+    final XmlAttribute[] attributes = tag.getAttributes();
+    for (final XmlAttribute each : attributes) {
+      result.append(" ").append(each.getText());
+    }
+
+    if (tag.isEmpty()) {
+      result.append("/&gt;");
+    }
+    else {
+      result.append("&gt;...&lt;/").append(tag.getName()).append("&gt;");
+    }
+
+    return result.toString();
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/xml/config/ConfigFileSearcher.java b/xml/impl/src/com/intellij/xml/config/ConfigFileSearcher.java
new file mode 100644
index 0000000..20317e8
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/config/ConfigFileSearcher.java
@@ -0,0 +1,65 @@
+package com.intellij.xml.config;
+
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtilCore;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.JarFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.util.containers.MultiMap;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Set;
+
+public abstract class ConfigFileSearcher {
+
+  private final MultiMap<Module, PsiFile> myFiles = new MultiMap<Module, PsiFile>();
+  private final MultiMap<VirtualFile, PsiFile> myJars = new MultiMap<VirtualFile, PsiFile>();
+  private final MultiMap<VirtualFile, PsiFile> myVirtualFiles = new MultiMap<VirtualFile, PsiFile>();
+  private final @Nullable Module myModule;
+  @NotNull private final Project myProject;
+
+  public ConfigFileSearcher(@Nullable Module module, @NotNull Project project) {
+    myModule = module;
+    myProject = project;
+  }
+
+  public void search() {
+    myFiles.clear();
+    myJars.clear();
+
+    PsiManager psiManager = PsiManager.getInstance(myProject);
+    for (PsiFile file : search(myModule, myProject)) {
+      VirtualFile jar = JarFileSystem.getInstance().getVirtualFileForJar(file.getVirtualFile());
+      if (jar != null) {
+        myJars.putValue(jar, file);
+      }
+      else {
+        Module module = ModuleUtilCore.findModuleForPsiElement(file);
+        if (module != null) {
+          myFiles.putValue(module, file);
+        }
+        else {
+          VirtualFile virtualFile = file.getVirtualFile();
+          myVirtualFiles.putValue(virtualFile.getParent(), psiManager.findFile(virtualFile));
+        }
+      }
+    }
+  }
+
+  public abstract Set<PsiFile> search(@Nullable Module module, @NotNull Project project);
+
+  public MultiMap<Module, PsiFile> getFilesByModules() {
+    return myFiles;
+  }
+
+  public MultiMap<VirtualFile, PsiFile> getJars() {
+    return myJars;
+  }
+
+  public MultiMap<VirtualFile, PsiFile> getVirtualFiles() {
+    return myVirtualFiles;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/config/ConfigFilesTreeBuilder.java b/xml/impl/src/com/intellij/xml/config/ConfigFilesTreeBuilder.java
new file mode 100644
index 0000000..f71505f
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/config/ConfigFilesTreeBuilder.java
@@ -0,0 +1,185 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.config;
+
+import com.intellij.ide.presentation.VirtualFilePresentation;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleType;
+import com.intellij.openapi.vfs.JarFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.ui.ColoredTreeCellRenderer;
+import com.intellij.ui.SimpleTextAttributes;
+import com.intellij.ui.TreeSpeedSearch;
+import com.intellij.util.containers.Convertor;
+import com.intellij.util.containers.MultiMap;
+
+import javax.swing.*;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreePath;
+import java.util.*;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 7/17/12
+ */
+public class ConfigFilesTreeBuilder {
+
+  private final JTree myTree;
+
+  public ConfigFilesTreeBuilder(JTree tree) {
+    myTree = tree;
+    installSearch(tree);
+  }
+
+  public Set<PsiFile> buildTree(ConfigFileSearcher searcher, DefaultMutableTreeNode root) {
+
+    final MultiMap<Module,PsiFile> files = searcher.getFilesByModules();
+    final MultiMap<VirtualFile, PsiFile> jars = searcher.getJars();
+    final Set<PsiFile> psiFiles = buildModuleNodes(files, jars, root);
+    final MultiMap<VirtualFile, PsiFile> virtualFiles = searcher.getVirtualFiles();
+
+    for (Map.Entry<VirtualFile, Collection<PsiFile>> entry : virtualFiles.entrySet()) {
+      DefaultMutableTreeNode node = createFileNode(entry.getKey());
+      List<PsiFile> list = new ArrayList<PsiFile>(entry.getValue());
+      Collections.sort(list, new Comparator<PsiFile>() {
+        @Override
+        public int compare(PsiFile o1, PsiFile o2) {
+          return o1.getName().compareToIgnoreCase(o2.getName());
+        }
+      });
+      for (PsiFile file : list) {
+        node.add(createFileNode(file));
+      }
+      root.add(node);
+    }
+    return psiFiles;
+  }
+
+
+  public void addFile(VirtualFile file) {
+    final DefaultMutableTreeNode root = (DefaultMutableTreeNode)myTree.getModel().getRoot();
+    final DefaultMutableTreeNode treeNode = createFileNode(file);
+    root.add(treeNode);
+    DefaultTreeModel model = (DefaultTreeModel)myTree.getModel();
+    model.nodeStructureChanged(root);
+  }
+
+  public Set<PsiFile> buildModuleNodes(final MultiMap<Module,PsiFile> files,
+                               final MultiMap<VirtualFile, PsiFile> jars,
+                               DefaultMutableTreeNode root) {
+
+    final HashSet<PsiFile> psiFiles = new HashSet<PsiFile>();
+    final List<Module> modules = new ArrayList<Module>(files.keySet());
+    Collections.sort(modules, new Comparator<Module>() {
+      public int compare(final Module o1, final Module o2) {
+        return o1.getName().compareTo(o2.getName());
+      }
+    });
+    for (Module module: modules) {
+      DefaultMutableTreeNode moduleNode = createFileNode(module);
+      root.add(moduleNode);
+      if (files.containsKey(module)) {
+        List<PsiFile> moduleFiles = new ArrayList<PsiFile>(files.get(module));
+        Collections.sort(moduleFiles, FILE_COMPARATOR);
+        for (PsiFile file: moduleFiles) {
+          final DefaultMutableTreeNode fileNode = createFileNode(file);
+          moduleNode.add(fileNode);
+          psiFiles.add(file);
+        }
+      }
+    }
+    for (VirtualFile file: jars.keySet()) {
+      final List<PsiFile> list = new ArrayList<PsiFile>(jars.get(file));
+      final PsiFile jar = list.get(0).getManager().findFile(file);
+      if (jar != null) {
+        final DefaultMutableTreeNode jarNode = createFileNode(jar);
+        root.add(jarNode);
+        Collections.sort(list, FILE_COMPARATOR);
+        for (PsiFile psiFile: list) {
+          jarNode.add(createFileNode(psiFile));
+          psiFiles.add(psiFile);
+        }
+      }
+    }
+    return psiFiles;
+  }
+
+  protected DefaultMutableTreeNode createFileNode(Object file) {
+    return new DefaultMutableTreeNode(file);
+  }
+
+  private static final Comparator<PsiFile> FILE_COMPARATOR = new Comparator<PsiFile>() {
+    public int compare(final PsiFile o1, final PsiFile o2) {
+      return o1.getName().compareTo(o2.getName());
+    }
+  };
+
+  public static void renderNode(Object value, boolean expanded, ColoredTreeCellRenderer renderer) {
+    if (!(value instanceof DefaultMutableTreeNode)) return;
+    final Object object = ((DefaultMutableTreeNode)value).getUserObject();
+    if (object instanceof Module) {
+      final Module module = (Module)object;
+      final Icon icon = ModuleType.get(module).getIcon();
+      renderer.setIcon(icon);
+      final String moduleName = module.getName();
+      renderer.append(moduleName, SimpleTextAttributes.REGULAR_ATTRIBUTES);
+    } else if (object instanceof PsiFile) {
+      final PsiFile psiFile = (PsiFile)object;
+      final Icon icon = psiFile.getIcon(0);
+      renderer.setIcon(icon);
+      final String fileName = psiFile.getName();
+      renderer.append(fileName, SimpleTextAttributes.REGULAR_ATTRIBUTES);
+      final VirtualFile virtualFile = psiFile.getVirtualFile();
+      if (virtualFile != null) {
+        String path = virtualFile.getPath();
+        final int i = path.indexOf(JarFileSystem.JAR_SEPARATOR);
+        if (i >= 0) {
+          path = path.substring(i + JarFileSystem.JAR_SEPARATOR.length());
+        }
+        renderer.append(" (" + path + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
+      }
+    } else if (object instanceof VirtualFile) {
+      VirtualFile file = (VirtualFile)object;
+      renderer.setIcon(VirtualFilePresentation.getIcon(file));
+      renderer.append(file.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
+      String path = file.getPath();
+      final int i = path.indexOf(JarFileSystem.JAR_SEPARATOR);
+      if (i >= 0) {
+        path = path.substring(i + JarFileSystem.JAR_SEPARATOR.length());
+      }
+      renderer.append(" (" + path + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
+    }
+  }
+
+  public static void installSearch(JTree tree) {
+    new TreeSpeedSearch(tree, new Convertor<TreePath, String>() {
+      public String convert(final TreePath treePath) {
+        final Object object = ((DefaultMutableTreeNode)treePath.getLastPathComponent()).getUserObject();
+        if (object instanceof Module) {
+          return ((Module)object).getName();
+        } else if (object instanceof PsiFile) {
+          return ((PsiFile)object).getName();
+        } else if (object instanceof VirtualFile) {
+          return ((VirtualFile)object).getName();
+        } else {
+          return "";
+        }
+      }
+    });
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/BasicXmlAttributeDescriptor.java b/xml/impl/src/com/intellij/xml/impl/BasicXmlAttributeDescriptor.java
new file mode 100644
index 0000000..020baa8
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/BasicXmlAttributeDescriptor.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: mike
+ * Date: Aug 27, 2002
+ * Time: 9:55:06 PM
+ * To change template for new class use
+ * Code Style | Class Templates options (Tools | IDE Options).
+ */
+package com.intellij.xml.impl;
+
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.Nullable;
+
+public abstract class BasicXmlAttributeDescriptor implements XmlAttributeDescriptor {
+  public String validateValue(XmlElement context, String value) {
+    if (isFixed()) {
+      String defaultValue = getDefaultValue();
+
+      if (defaultValue != null && !defaultValue.equals(value)) {
+        return XmlErrorMessages.message("attribute.should.have.fixed.value", getName(), defaultValue);
+      }
+    }
+
+    if (isEnumerated(context) && XmlUtil.isSimpleXmlAttributeValue(value, (XmlAttributeValue)context)) {
+      String[] values = getEnumeratedValues(context);
+      boolean valueWasFound = false;
+
+      for (String enumValue : values) {
+        if (enumValue.equals(value)) {
+          valueWasFound = true;
+          break;
+        }
+      }
+
+      if (!valueWasFound) {
+        return XmlErrorMessages.message("wrong.attribute.value");
+      }
+    }
+
+    return null;
+  }
+
+  public String getName(PsiElement context){
+    return getName();
+  }
+
+  @Nullable
+  public String[] getEnumeratedValues(@Nullable XmlElement context) {
+    return getEnumeratedValues();
+  }
+
+  public boolean isEnumerated(@Nullable XmlElement context) {
+    return isEnumerated();
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/ExternalDocumentValidator.java b/xml/impl/src/com/intellij/xml/impl/ExternalDocumentValidator.java
new file mode 100644
index 0000000..e8371ca
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/ExternalDocumentValidator.java
@@ -0,0 +1,370 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl;
+
+import com.intellij.codeInsight.daemon.HighlightDisplayKey;
+import com.intellij.codeInsight.daemon.Validator;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInspection.InspectionProfile;
+import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
+import com.intellij.ide.highlighter.XHtmlFileType;
+import com.intellij.ide.highlighter.XmlFileType;
+import com.intellij.lang.Language;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.progress.ProcessCanceledException;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.source.SourceTreeToPsiMap;
+import com.intellij.psi.templateLanguages.TemplateLanguageFileViewProvider;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.reference.SoftReference;
+import com.intellij.xml.actions.ValidateXmlActionHandler;
+import com.intellij.xml.util.CheckXmlFileWithXercesValidatorInspection;
+import com.intellij.xml.util.XmlResourceResolver;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.xml.sax.SAXParseException;
+
+import java.lang.ref.WeakReference;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author maxim
+ */
+public class ExternalDocumentValidator {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.impl.ExternalDocumentValidator");
+  private static final Key<SoftReference<ExternalDocumentValidator>> validatorInstanceKey = Key.create("validatorInstance");
+  private ValidateXmlActionHandler myHandler;
+  private Validator.ValidationHost myHost;
+
+  private long myModificationStamp;
+  private PsiFile myFile;
+  @NonNls
+  private static final String CANNOT_FIND_DECLARATION_ERROR_PREFIX = "Cannot find the declaration of element";
+  @NonNls
+  private static final String ELEMENT_ERROR_PREFIX = "Element";
+  @NonNls
+  private static final String ROOT_ELEMENT_ERROR_PREFIX = "Document root element";
+  @NonNls
+  private static final String CONTENT_OF_ELEMENT_TYPE_ERROR_PREFIX = "The content of element type";
+  @NonNls
+  private static final String VALUE_ERROR_PREFIX = "Value ";
+  @NonNls
+  private static final String ATTRIBUTE_ERROR_PREFIX = "Attribute ";
+  @NonNls
+  private static final String STRING_ERROR_PREFIX = "The string";
+  @NonNls
+  private static final String ATTRIBUTE_MESSAGE_PREFIX = "cvc-attribute.";
+
+  private static class ValidationInfo {
+    PsiElement element;
+    String message;
+    int type;
+  }
+
+  private WeakReference<List<ValidationInfo>> myInfos; // last jaxp validation result
+
+  private void runJaxpValidation(final XmlElement element, Validator.ValidationHost host) {
+    final PsiFile file = element.getContainingFile();
+
+    if (myFile == file &&
+        file != null &&
+        myModificationStamp == file.getModificationStamp() &&
+        !ValidateXmlActionHandler.isValidationDependentFilesOutOfDate((XmlFile)file) &&
+        myInfos!=null &&
+        myInfos.get()!=null // we have validated before
+        ) {
+      addAllInfos(host,myInfos.get());
+      return;
+    }
+
+    if (myHandler==null)  myHandler = new ValidateXmlActionHandler(false);
+    final Project project = element.getProject();
+
+    final Document document = PsiDocumentManager.getInstance(project).getDocument(file);
+    if (document==null) return;
+    final List<ValidationInfo> results = new LinkedList<ValidationInfo>();
+
+    myHost = new Validator.ValidationHost() {
+      public void addMessage(PsiElement context, String message, int type) {
+        final ValidationInfo o = new ValidationInfo();
+
+        results.add(o);
+        o.element = context;
+        o.message = message;
+        o.type = type;
+      }
+
+      public void addMessage(final PsiElement context, final String message, final ErrorType type, final IntentionAction... fixes) {
+        addMessage(context, message, type.ordinal());
+      }
+    };
+
+    myHandler.setErrorReporter(myHandler.new ErrorReporter() {
+      public boolean isStopOnUndeclaredResource() {
+        return true;
+      }
+
+      public void processError(final SAXParseException e, final boolean warning) {
+        try {
+          ApplicationManager.getApplication().runReadAction(new Runnable() {
+            public void run() {
+              if (e.getPublicId() != null) {
+                return;
+              }
+
+              final VirtualFile errorFile = myHandler.getFile(e.getPublicId(), e.getSystemId());
+              if (!Comparing.equal(errorFile, file.getVirtualFile()) && errorFile != null) {
+                return; // error in attached schema
+              }
+
+              if (document.getLineCount() < e.getLineNumber() || e.getLineNumber() <= 0) {
+                return;
+              }
+
+              int offset = Math.max(0, document.getLineStartOffset(e.getLineNumber() - 1) + e.getColumnNumber() - 2);
+              if (offset >= document.getTextLength()) return;
+              PsiElement currentElement = PsiDocumentManager.getInstance(project).getPsiFile(document).findElementAt(offset);
+              PsiElement originalElement = currentElement;
+              final String elementText = currentElement.getText();
+
+              if (elementText.equals("</")) {
+                currentElement = currentElement.getNextSibling();
+              }
+              else if (elementText.equals(">") || elementText.equals("=")) {
+                currentElement = currentElement.getPrevSibling();
+              }
+
+              // Cannot find the declaration of element
+              String localizedMessage = e.getLocalizedMessage();
+
+              // Ideally would be to switch one messageIds
+              int endIndex = localizedMessage.indexOf(':');
+              if (endIndex < localizedMessage.length() - 1 && localizedMessage.charAt(endIndex + 1) == '/') {
+                endIndex = -1;  // ignore : in http://
+              }
+              String messageId = endIndex != -1 ? localizedMessage.substring(0, endIndex ):"";
+              localizedMessage = localizedMessage.substring(endIndex + 1).trim();
+
+              if (localizedMessage.startsWith(CANNOT_FIND_DECLARATION_ERROR_PREFIX) ||
+                  localizedMessage.startsWith(ELEMENT_ERROR_PREFIX) ||
+                  localizedMessage.startsWith(ROOT_ELEMENT_ERROR_PREFIX) ||
+                  localizedMessage.startsWith(CONTENT_OF_ELEMENT_TYPE_ERROR_PREFIX)
+                  ) {
+                addProblemToTagName(currentElement, originalElement, localizedMessage, warning);
+                //return;
+              } else if (localizedMessage.startsWith(VALUE_ERROR_PREFIX)) {
+                addProblemToTagName(currentElement, originalElement, localizedMessage, warning);
+              } else if (messageId.startsWith(ATTRIBUTE_MESSAGE_PREFIX)) {
+                @NonNls String prefix = "of attribute ";
+                final int i = localizedMessage.indexOf(prefix);
+                
+                if (i != -1) {
+                  int messagePrefixLength = prefix.length() + i;
+                  final int nextQuoteIndex = localizedMessage.indexOf(localizedMessage.charAt(messagePrefixLength), messagePrefixLength + 1);
+                  String attrName = nextQuoteIndex == -1 ? null : localizedMessage.substring(messagePrefixLength + 1, nextQuoteIndex);
+
+                  XmlTag parent = PsiTreeUtil.getParentOfType(originalElement,XmlTag.class);
+                  currentElement = parent.getAttribute(attrName,null);
+
+                  if (currentElement != null) {
+                    currentElement = ((XmlAttribute)currentElement).getValueElement();
+                  }
+                }
+
+                if (currentElement!=null) {
+                  assertValidElement(currentElement, originalElement,localizedMessage);
+                  myHost.addMessage(currentElement,localizedMessage,warning ? Validator.ValidationHost.WARNING:Validator.ValidationHost.ERROR);
+                } else {
+                  addProblemToTagName(originalElement, originalElement, localizedMessage, warning);
+                }
+              }
+              else if (localizedMessage.startsWith(ATTRIBUTE_ERROR_PREFIX)) {
+                final int messagePrefixLength = ATTRIBUTE_ERROR_PREFIX.length();
+
+                if ( localizedMessage.charAt(messagePrefixLength) == '"' ||
+                     localizedMessage.charAt(messagePrefixLength) == '\''
+                   ) {
+                  // extract the attribute name from message and get it from tag!
+                  final int nextQuoteIndex = localizedMessage.indexOf(localizedMessage.charAt(messagePrefixLength), messagePrefixLength + 1);
+                  String attrName = nextQuoteIndex == -1 ? null : localizedMessage.substring(messagePrefixLength + 1, nextQuoteIndex);
+
+                  XmlTag parent = PsiTreeUtil.getParentOfType(originalElement,XmlTag.class);
+                  currentElement = parent.getAttribute(attrName,null);
+
+                  if (currentElement!=null) {
+                    currentElement = SourceTreeToPsiMap.treeElementToPsi(
+                      XmlChildRole.ATTRIBUTE_NAME_FINDER.findChild(
+                        SourceTreeToPsiMap.psiElementToTree(currentElement)
+                      )
+                    );
+                  }
+                } else {
+                  currentElement = PsiTreeUtil.getParentOfType(currentElement, XmlTag.class, false);
+                }
+
+                if (currentElement!=null) {
+                  assertValidElement(currentElement, originalElement,localizedMessage);
+                  myHost.addMessage(currentElement,localizedMessage,warning ? Validator.ValidationHost.WARNING:Validator.ValidationHost.ERROR);
+                } else {
+                  addProblemToTagName(originalElement, originalElement, localizedMessage, warning);
+                }
+              } else if (localizedMessage.startsWith(STRING_ERROR_PREFIX)) {
+                if (currentElement != null) {
+                  myHost.addMessage(currentElement,localizedMessage,Validator.ValidationHost.WARNING);
+                }
+              }
+              else {
+                currentElement = getNodeForMessage(currentElement != null ? currentElement:originalElement);
+                assertValidElement(currentElement, originalElement,localizedMessage);
+                if (currentElement!=null) {
+                  myHost.addMessage(currentElement,localizedMessage,warning ? Validator.ValidationHost.WARNING:Validator.ValidationHost.ERROR);
+                }
+              }
+            }
+          });
+        }
+        catch (Exception ex) {
+          if (ex instanceof ProcessCanceledException) throw (ProcessCanceledException)ex;
+          if (ex instanceof XmlResourceResolver.IgnoredResourceException) throw (XmlResourceResolver.IgnoredResourceException)ex;
+          LOG.error(ex);
+        }
+      }
+
+    });
+
+    myHandler.doValidate((XmlFile)element.getContainingFile());
+
+    myFile = file;
+    myModificationStamp = myFile.getModificationStamp();
+    myInfos = new WeakReference<List<ValidationInfo>>(results);
+
+    addAllInfos(host,results);
+  }
+
+  private static PsiElement getNodeForMessage(final PsiElement currentElement) {
+    PsiElement parentOfType = PsiTreeUtil.getNonStrictParentOfType(
+      currentElement,
+      XmlTag.class,
+      XmlProcessingInstruction.class,
+      XmlElementDecl.class,
+      XmlMarkupDecl.class,
+      XmlEntityRef.class,
+      XmlDoctype.class
+    );
+
+    if (parentOfType == null) {
+      if (currentElement instanceof XmlToken) {
+        parentOfType = currentElement.getParent();
+      }
+      else {
+        parentOfType = currentElement;
+      }
+    }
+    return parentOfType;
+  }
+
+  private static void addAllInfos(Validator.ValidationHost host,List<ValidationInfo> highlightInfos) {
+    for (ValidationInfo info : highlightInfos) {
+      host.addMessage(info.element, info.message, info.type);
+    }
+  }
+
+  private PsiElement addProblemToTagName(PsiElement currentElement,
+                                     final PsiElement originalElement,
+                                     final String localizedMessage,
+                                     final boolean warning) {
+    currentElement = PsiTreeUtil.getParentOfType(currentElement,XmlTag.class,false);
+    if (currentElement==null) {
+      currentElement = PsiTreeUtil.getParentOfType(originalElement,XmlElementDecl.class,false);
+    }
+    if (currentElement == null) {
+      currentElement = originalElement;
+    }
+    assertValidElement(currentElement, originalElement,localizedMessage);
+
+    if (currentElement!=null) {
+      myHost.addMessage(currentElement,localizedMessage,warning ? Validator.ValidationHost.WARNING:Validator.ValidationHost.ERROR);
+    }
+
+    return currentElement;
+  }
+
+  private static void assertValidElement(PsiElement currentElement, PsiElement originalElement, String message) {
+    if (currentElement==null) {
+      XmlTag tag = PsiTreeUtil.getParentOfType(originalElement, XmlTag.class);
+      LOG.error("The validator message:" + message + " is bound to null node,\n" + "initial element:" + originalElement.getText() + ",\n" +
+                "parent:" + originalElement.getParent() + ",\n" + "tag:" + (tag != null ? tag.getText() : "null") + ",\n" +
+                "offset in tag: " + (originalElement.getTextOffset() - (tag == null ? 0 : tag.getTextOffset())));
+    }
+  }
+
+  public static synchronized void doValidation(final XmlDocument document, final Validator.ValidationHost host) {
+    final PsiFile containingFile = document.getContainingFile();
+    if (containingFile == null) {
+      return;
+    }
+
+    if (containingFile.getViewProvider() instanceof TemplateLanguageFileViewProvider) {
+      return;
+    }
+    
+    final FileType fileType = containingFile.getViewProvider().getVirtualFile().getFileType();
+    if (fileType != XmlFileType.INSTANCE && fileType != XHtmlFileType.INSTANCE) {
+      return;
+    }
+
+    for(Language lang: containingFile.getViewProvider().getLanguages()) {
+      if ("ANT".equals(lang.getID())) return;
+    }
+
+    final XmlTag rootTag = document.getRootTag();
+    if (rootTag == null) return;
+
+    String namespace = rootTag.getNamespace();
+    if (XmlUtil.ANT_URI.equals(namespace)) return;
+
+    final Project project = document.getProject();
+
+    final InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getInspectionProfile();
+    final LocalInspectionToolWrapper toolWrapper =
+      (LocalInspectionToolWrapper)profile.getInspectionTool(CheckXmlFileWithXercesValidatorInspection.SHORT_NAME, containingFile);
+
+    if (toolWrapper == null) return;
+    if (!profile.isToolEnabled(HighlightDisplayKey.find(CheckXmlFileWithXercesValidatorInspection.SHORT_NAME), containingFile)) return;
+
+    SoftReference<ExternalDocumentValidator> validatorReference = project.getUserData(validatorInstanceKey);
+    ExternalDocumentValidator validator = validatorReference != null? validatorReference.get() : null;
+
+    if(validator == null) {
+      validator = new ExternalDocumentValidator();
+      project.putUserData(validatorInstanceKey,new SoftReference<ExternalDocumentValidator>(validator));
+    }
+
+    validator.runJaxpValidation(document,host);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/XmlAttributeDescriptorEx.java b/xml/impl/src/com/intellij/xml/impl/XmlAttributeDescriptorEx.java
new file mode 100644
index 0000000..5af26e6
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/XmlAttributeDescriptorEx.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl;
+
+import com.intellij.xml.XmlAttributeDescriptor;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public interface XmlAttributeDescriptorEx extends XmlAttributeDescriptor {
+
+  /**
+   * @param newTargetName
+   * @return new attribute local name
+   */
+  @Nullable
+  @NonNls
+  String handleTargetRename(@NotNull @NonNls final String newTargetName);
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/XmlBraceMatcher.java b/xml/impl/src/com/intellij/xml/impl/XmlBraceMatcher.java
new file mode 100644
index 0000000..866be5f
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/XmlBraceMatcher.java
@@ -0,0 +1,292 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl;
+
+import com.intellij.codeInsight.highlighting.BraceMatchingUtil;
+import com.intellij.codeInsight.highlighting.XmlAwareBraceMatcher;
+import com.intellij.lang.BracePair;
+import com.intellij.lang.LanguageBraceMatching;
+import com.intellij.lang.PairedBraceMatcher;
+import com.intellij.lang.Language;
+import com.intellij.openapi.editor.highlighter.HighlighterIterator;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.TokenType;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.xml.IXmlLeafElementType;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.containers.BidirectionalMap;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.ide.highlighter.XmlLikeFileType;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @author Maxim.Mossienko
+ *         Date: Apr 15, 2008
+ *         Time: 4:27:25 PM
+ */
+public class XmlBraceMatcher implements XmlAwareBraceMatcher {
+  private static final int XML_TAG_TOKEN_GROUP = 1;
+  private static final int XML_VALUE_DELIMITER_GROUP = 2;
+
+  private static final BidirectionalMap<IElementType, IElementType> PAIRING_TOKENS = new BidirectionalMap<IElementType, IElementType>();
+
+  static {
+    PAIRING_TOKENS.put(XmlTokenType.XML_TAG_END, XmlTokenType.XML_START_TAG_START);
+    PAIRING_TOKENS.put(XmlTokenType.XML_CDATA_START, XmlTokenType.XML_CDATA_END);
+    PAIRING_TOKENS.put(XmlTokenType.XML_EMPTY_ELEMENT_END, XmlTokenType.XML_START_TAG_START);
+    PAIRING_TOKENS.put(XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER, XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER);
+  }
+
+  public int getBraceTokenGroupId(IElementType tokenType) {
+    final Language l = tokenType.getLanguage();
+    PairedBraceMatcher matcher = LanguageBraceMatching.INSTANCE.forLanguage(l);
+    
+    if (matcher != null) {
+      BracePair[] pairs = matcher.getPairs();
+      for (BracePair pair : pairs) {
+        if (pair.getLeftBraceType() == tokenType || pair.getRightBraceType() == tokenType ) {
+          return l.hashCode();
+        }
+      }
+    }
+    if (tokenType instanceof IXmlLeafElementType) {
+      return tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER || tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER
+             ? XML_VALUE_DELIMITER_GROUP
+             : XML_TAG_TOKEN_GROUP;
+    }
+    else{
+      return BraceMatchingUtil.UNDEFINED_TOKEN_GROUP;
+    }
+  }
+
+  public boolean isLBraceToken(HighlighterIterator iterator, CharSequence fileText, FileType fileType) {
+    final IElementType tokenType = iterator.getTokenType();
+    PairedBraceMatcher matcher = LanguageBraceMatching.INSTANCE.forLanguage(tokenType.getLanguage());
+    if (matcher != null) {
+      BracePair[] pairs = matcher.getPairs();
+      for (BracePair pair : pairs) {
+        if (pair.getLeftBraceType() == tokenType) return true;
+      }
+    }
+    return tokenType == XmlTokenType.XML_START_TAG_START ||
+           tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER ||
+           tokenType == XmlTokenType.XML_CDATA_START;
+  }
+
+  public boolean isRBraceToken(HighlighterIterator iterator, CharSequence fileText, FileType fileType) {
+    final IElementType tokenType = iterator.getTokenType();
+    PairedBraceMatcher matcher = LanguageBraceMatching.INSTANCE.forLanguage(tokenType.getLanguage());
+    if (matcher != null) {
+      BracePair[] pairs = matcher.getPairs();
+      for (BracePair pair : pairs) {
+        if (pair.getRightBraceType() == tokenType) return true;
+      }
+    }
+
+    if (tokenType == XmlTokenType.XML_EMPTY_ELEMENT_END ||
+        tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER ||
+        tokenType == XmlTokenType.XML_CDATA_END)
+    {
+      return true;
+    }
+    else if (tokenType == XmlTokenType.XML_TAG_END) {
+      final boolean result = findEndTagStart(iterator);
+
+      if (isFileTypeWithSingleHtmlTags(fileType)) {
+        final String tagName = getTagName(fileText, iterator);
+
+        if (tagName != null && HtmlUtil.isSingleHtmlTag(tagName)) {
+          return !result;
+        }
+      }
+
+      return result;
+    }
+    else {
+      return false;
+    }
+  }
+
+  protected boolean isFileTypeWithSingleHtmlTags(final FileType fileType) {
+    return fileType == StdFileTypes.HTML;
+  }
+
+  public boolean isPairBraces(IElementType tokenType1, IElementType tokenType2) {
+    PairedBraceMatcher matcher = LanguageBraceMatching.INSTANCE.forLanguage(tokenType1.getLanguage());
+    if (matcher != null) {
+      BracePair[] pairs = matcher.getPairs();
+      for (BracePair pair : pairs) {
+        if (pair.getLeftBraceType() == tokenType1 ) return pair.getRightBraceType() == tokenType2;
+        if (pair.getRightBraceType() == tokenType1 ) return pair.getLeftBraceType() == tokenType2;
+      }
+    }
+    if (tokenType2.equals(PAIRING_TOKENS.get(tokenType1))) return true;
+    List<IElementType> keys = PAIRING_TOKENS.getKeysByValue(tokenType1);
+    return keys != null && keys.contains(tokenType2);
+  }
+
+  public boolean isStructuralBrace(HighlighterIterator iterator,CharSequence text, FileType fileType) {
+    IElementType tokenType = iterator.getTokenType();
+
+    PairedBraceMatcher matcher = LanguageBraceMatching.INSTANCE.forLanguage(tokenType.getLanguage());
+    if (matcher != null) {
+      BracePair[] pairs = matcher.getPairs();
+      for (BracePair pair : pairs) {
+        if ((pair.getLeftBraceType() == tokenType || pair.getRightBraceType() == tokenType) &&
+            pair.isStructural()) return true;
+      }
+    }
+    if (fileType instanceof XmlLikeFileType) {
+      return isXmlStructuralBrace(iterator, text, fileType, tokenType);
+    }
+    return false;
+  }
+
+  protected boolean isXmlStructuralBrace(HighlighterIterator iterator, CharSequence text, FileType fileType, IElementType tokenType) {
+    return tokenType == XmlTokenType.XML_START_TAG_START ||
+           tokenType == XmlTokenType.XML_TAG_END ||
+           tokenType == XmlTokenType.XML_EMPTY_ELEMENT_END ||
+           tokenType == XmlTokenType.XML_TAG_END && isFileTypeWithSingleHtmlTags(fileType) && isEndOfSingleHtmlTag(text, iterator);
+  }
+
+  public boolean isPairedBracesAllowedBeforeType(@NotNull final IElementType lbraceType, @Nullable final IElementType contextType) {
+    return true;
+  }
+
+  public boolean isStrictTagMatching(final FileType fileType, final int braceGroupId) {
+    switch(braceGroupId){
+      case XML_TAG_TOKEN_GROUP:
+        // Other xml languages may have nonbalanced tag names
+        return isStrictTagMatchingForFileType(fileType);
+
+      default:
+        return false;
+    }
+  }
+
+  protected boolean isStrictTagMatchingForFileType(final FileType fileType) {
+    return fileType == StdFileTypes.XML ||
+           fileType == StdFileTypes.XHTML;
+  }
+
+  public boolean areTagsCaseSensitive(final FileType fileType, final int braceGroupId) {
+    switch(braceGroupId){
+      case XML_TAG_TOKEN_GROUP:
+        return fileType == StdFileTypes.XML;
+      default:
+        return false;
+    }
+  }
+
+  private static boolean findEndTagStart(HighlighterIterator iterator) {
+    IElementType tokenType = iterator.getTokenType();
+    int balance = 0;
+    int count = 0;
+    while(balance >= 0){
+      iterator.retreat();
+      count++;
+      if (iterator.atEnd()) break;
+      tokenType = iterator.getTokenType();
+      if (tokenType == XmlTokenType.XML_TAG_END || tokenType == XmlTokenType.XML_EMPTY_ELEMENT_END){
+        balance++;
+      }
+      else if (tokenType == XmlTokenType.XML_END_TAG_START || tokenType == XmlTokenType.XML_START_TAG_START){
+        balance--;
+      }
+    }
+    while(count-- > 0) iterator.advance();
+    return tokenType == XmlTokenType.XML_END_TAG_START;
+  }
+
+  private boolean isEndOfSingleHtmlTag(CharSequence text,HighlighterIterator iterator) {
+    String tagName = getTagName(text,iterator);
+    return tagName != null && HtmlUtil.isSingleHtmlTag(tagName);
+  }
+
+  public String getTagName(CharSequence fileText, HighlighterIterator iterator) {
+    final IElementType tokenType = iterator.getTokenType();
+    String name = null;
+    if (tokenType == XmlTokenType.XML_START_TAG_START) {
+      iterator.advance();
+      IElementType tokenType1 = iterator.atEnd() ? null : iterator.getTokenType();
+
+      boolean wasWhiteSpace = false;
+      if (isWhitespace(tokenType1)) {
+        wasWhiteSpace = true;
+        iterator.advance();
+        tokenType1 = iterator.atEnd() ? null : iterator.getTokenType();
+      }
+
+      if (tokenType1 == XmlTokenType.XML_TAG_NAME ||
+          tokenType1 == XmlTokenType.XML_NAME
+         ) {
+        name = fileText.subSequence(iterator.getStart(), iterator.getEnd()).toString();
+      }
+
+      if (wasWhiteSpace) iterator.retreat();
+      iterator.retreat();
+    }
+    else if (tokenType == XmlTokenType.XML_TAG_END || tokenType == XmlTokenType.XML_EMPTY_ELEMENT_END) {
+      int balance = 0;
+      int count = 0;
+      IElementType tokenType1 = iterator.getTokenType();
+      while (balance >=0) {
+        iterator.retreat();
+        count++;
+        if (iterator.atEnd()) break;
+        tokenType1 = iterator.getTokenType();
+
+        if (tokenType1 == XmlTokenType.XML_TAG_END || tokenType1 == XmlTokenType.XML_EMPTY_ELEMENT_END) {
+          balance++;
+        }
+        else if (tokenType1 == XmlTokenType.XML_TAG_NAME) {
+          balance--;
+        }
+      }
+      if (tokenType1 == XmlTokenType.XML_TAG_NAME) {
+        name = fileText.subSequence(iterator.getStart(), iterator.getEnd()).toString();
+      }
+      while (count-- > 0) iterator.advance();
+    }
+
+    return name;
+  }
+
+  protected boolean isWhitespace(final IElementType tokenType1) {
+    return tokenType1 == TokenType.WHITE_SPACE;
+  }
+
+  public IElementType getOppositeBraceTokenType(@NotNull final IElementType type) {
+    PairedBraceMatcher matcher = LanguageBraceMatching.INSTANCE.forLanguage(type.getLanguage());
+    if (matcher != null) {
+      BracePair[] pairs = matcher.getPairs();
+      for (BracePair pair : pairs) {
+        if (pair.getLeftBraceType() == type ) return pair.getRightBraceType();
+        if (pair.getRightBraceType() == type ) return pair.getLeftBraceType();
+      }
+    }
+    return null;
+  }
+
+  public int getCodeConstructStart(final PsiFile file, int openingBraceOffset) {
+    return openingBraceOffset;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/dtd/BaseXmlElementDescriptorImpl.java b/xml/impl/src/com/intellij/xml/impl/dtd/BaseXmlElementDescriptorImpl.java
new file mode 100644
index 0000000..6d01ce8
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/dtd/BaseXmlElementDescriptorImpl.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.dtd;
+
+import com.intellij.openapi.util.FieldCache;
+import com.intellij.openapi.util.SimpleFieldCache;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementsGroup;
+
+import java.util.HashMap;
+
+/**
+ * @by maxim
+ */
+public abstract class BaseXmlElementDescriptorImpl implements XmlElementDescriptor {
+  private volatile XmlElementDescriptor[] myElementDescriptors = null;
+  private volatile XmlAttributeDescriptor[] myAttributeDescriptors;
+  private volatile HashMap<String,XmlElementDescriptor> myElementDescriptorsMap;
+  private volatile HashMap<String,XmlAttributeDescriptor> attributeDescriptorsMap;
+
+  protected BaseXmlElementDescriptorImpl() {}
+
+  @Override
+  public XmlElementsGroup getTopGroup() {
+    return null;
+  }
+
+  @Override
+  public String getDefaultValue() {
+    return null;
+  }
+
+  // Read-only action
+  protected abstract XmlElementDescriptor[] doCollectXmlDescriptors(final XmlTag context);
+
+  static final FieldCache<XmlElementDescriptor[],BaseXmlElementDescriptorImpl,Object, XmlTag> myElementDescriptorsCache =
+    new FieldCache<XmlElementDescriptor[], BaseXmlElementDescriptorImpl, Object, XmlTag>() {
+    protected final XmlElementDescriptor[] compute(final BaseXmlElementDescriptorImpl xmlElementDescriptor, XmlTag tag) {
+      return xmlElementDescriptor.doCollectXmlDescriptors(tag);
+    }
+
+    protected final XmlElementDescriptor[] getValue(final BaseXmlElementDescriptorImpl xmlElementDescriptor, Object o) {
+      return xmlElementDescriptor.myElementDescriptors;
+    }
+
+    protected final void putValue(final XmlElementDescriptor[] xmlElementDescriptors, final BaseXmlElementDescriptorImpl xmlElementDescriptor,Object o) {
+      xmlElementDescriptor.myElementDescriptors = xmlElementDescriptors;
+    }
+  };
+
+  public XmlElementDescriptor[] getElementsDescriptors(XmlTag context) {
+    return myElementDescriptorsCache.get(null, this, context);
+  }
+
+  private static final SimpleFieldCache<XmlAttributeDescriptor[],BaseXmlElementDescriptorImpl> myAttributeDescriptorsCache =
+    new SimpleFieldCache<XmlAttributeDescriptor[], BaseXmlElementDescriptorImpl>() {
+    protected final XmlAttributeDescriptor[] compute(final BaseXmlElementDescriptorImpl xmlElementDescriptor) {
+      return xmlElementDescriptor.collectAttributeDescriptors(null);
+    }
+
+    protected final XmlAttributeDescriptor[] getValue(final BaseXmlElementDescriptorImpl xmlElementDescriptor) {
+      return xmlElementDescriptor.myAttributeDescriptors;
+    }
+
+    protected final void putValue(final XmlAttributeDescriptor[] xmlAttributeDescriptors, final BaseXmlElementDescriptorImpl xmlElementDescriptor) {
+      xmlElementDescriptor.myAttributeDescriptors = xmlAttributeDescriptors;
+    }
+  };
+
+  public XmlAttributeDescriptor[] getAttributesDescriptors(final XmlTag context) {
+    return myAttributeDescriptorsCache.get(this);
+  }
+
+  // Read-only calculation
+  protected abstract XmlAttributeDescriptor[] collectAttributeDescriptors(final XmlTag context);
+
+  private static final SimpleFieldCache<HashMap<String,XmlAttributeDescriptor>, BaseXmlElementDescriptorImpl> attributeDescriptorsMapCache =
+    new SimpleFieldCache<HashMap<String, XmlAttributeDescriptor>, BaseXmlElementDescriptorImpl>() {
+      protected final HashMap<String, XmlAttributeDescriptor> compute(final BaseXmlElementDescriptorImpl baseXmlElementDescriptor) {
+        return baseXmlElementDescriptor.collectAttributeDescriptorsMap(null);
+      }
+
+      protected final HashMap<String, XmlAttributeDescriptor> getValue(final BaseXmlElementDescriptorImpl baseXmlElementDescriptor) {
+        return baseXmlElementDescriptor.attributeDescriptorsMap;
+      }
+
+      protected final void putValue(final HashMap<String, XmlAttributeDescriptor> hashMap, final BaseXmlElementDescriptorImpl baseXmlElementDescriptor) {
+        baseXmlElementDescriptor.attributeDescriptorsMap = hashMap;
+      }
+    };
+
+  public XmlAttributeDescriptor getAttributeDescriptor(String attributeName, final XmlTag context) {
+    return attributeDescriptorsMapCache.get(this).get(attributeName);
+  }
+
+  // Read-only calculation
+  protected abstract HashMap<String, XmlAttributeDescriptor> collectAttributeDescriptorsMap(final XmlTag context);
+
+  private static final FieldCache<HashMap<String,XmlElementDescriptor>,BaseXmlElementDescriptorImpl,Object,XmlTag> myElementDescriptorsMapCache =
+    new FieldCache<HashMap<String, XmlElementDescriptor>, BaseXmlElementDescriptorImpl, Object, XmlTag>() {
+    protected final HashMap<String, XmlElementDescriptor> compute(final BaseXmlElementDescriptorImpl baseXmlElementDescriptor, final XmlTag p) {
+      return baseXmlElementDescriptor.collectElementDescriptorsMap(p);
+    }
+
+    protected final HashMap<String, XmlElementDescriptor> getValue(final BaseXmlElementDescriptorImpl baseXmlElementDescriptor, final Object p) {
+      return baseXmlElementDescriptor.myElementDescriptorsMap;
+    }
+
+    protected final void putValue(final HashMap<String, XmlElementDescriptor> hashMap,
+                            final BaseXmlElementDescriptorImpl baseXmlElementDescriptor, final Object p) {
+      baseXmlElementDescriptor.myElementDescriptorsMap = hashMap;
+    }
+  };
+
+  public XmlElementDescriptor getElementDescriptor(XmlTag element, XmlTag contextTag){
+    return myElementDescriptorsMapCache.get(null, this, element).get(element.getName());
+  }
+
+  public final XmlElementDescriptor getElementDescriptor(String name, XmlTag context){
+    return myElementDescriptorsMapCache.get(null, this, context).get(name);
+  }
+
+  // Read-only calculation
+  protected abstract HashMap<String, XmlElementDescriptor> collectElementDescriptorsMap(final XmlTag element);
+
+  public final XmlAttributeDescriptor getAttributeDescriptor(XmlAttribute attr){
+    return getAttributeDescriptor(attr.getName(), attr.getParent());
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/dtd/XmlAttributeDescriptorImpl.java b/xml/impl/src/com/intellij/xml/impl/dtd/XmlAttributeDescriptorImpl.java
new file mode 100644
index 0000000..1471fc4
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/dtd/XmlAttributeDescriptorImpl.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.dtd;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.meta.PsiWritableMetaData;
+import com.intellij.psi.xml.XmlAttributeDecl;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.impl.BasicXmlAttributeDescriptor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Mike
+ */
+public class XmlAttributeDescriptorImpl extends BasicXmlAttributeDescriptor implements PsiWritableMetaData {
+  private XmlAttributeDecl myDecl;
+  private boolean myRequired;
+  private boolean myEnumerated;
+  private boolean myFixed;
+  private String myName;
+
+  public XmlAttributeDescriptorImpl() {
+
+  }
+  public XmlAttributeDescriptorImpl(XmlAttributeDecl decl) {
+    init(decl);
+  }
+
+  public boolean isRequired() {
+    return myRequired;
+  }
+
+  public PsiElement getDeclaration(){
+    return myDecl;
+  }
+
+  public String getName() {
+    if (myName!=null) {
+      return myName;
+    }
+    myName = myDecl.getNameElement().getText();
+    return myName;
+  }
+
+  public void init(PsiElement element){
+    myDecl = (XmlAttributeDecl) element;
+    myRequired = myDecl.isAttributeRequired();
+    myFixed = myDecl.isAttributeFixed();
+    myEnumerated = myDecl.isEnumerated();
+  }
+
+  public Object[] getDependences(){
+    return new Object[]{myDecl};
+  }
+
+  public boolean isFixed() {
+    return myFixed;
+  }
+
+  public boolean hasIdType() {
+    return myDecl.isIdAttribute();
+  }
+
+  public boolean hasIdRefType() {
+    return myDecl.isIdRefAttribute();
+  }
+
+  public String getDefaultValue() {
+    String text = myDecl.getDefaultValueText();
+    if (text != null) {
+      return text.substring(1, text.length() - 1);
+    }
+
+    return null;
+  }
+
+  public boolean isEnumerated() {
+    return myEnumerated;
+  }
+
+  public String[] getEnumeratedValues() {
+
+    XmlElement[] values = myDecl.getEnumeratedValues();
+    List<String> result = new ArrayList<String>();
+    for (XmlElement value : values) {
+      result.add(value.getText());
+    }
+
+    return ArrayUtil.toStringArray(result);
+  }
+
+  public String getQualifiedName() {
+    return getName();
+  }
+
+  public void setName(String name) throws IncorrectOperationException {
+    myName = name;
+    ((PsiNamedElement)getDeclaration()).setName(name);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/dtd/XmlElementDescriptorImpl.java b/xml/impl/src/com/intellij/xml/impl/dtd/XmlElementDescriptorImpl.java
new file mode 100644
index 0000000..d5b2851
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/dtd/XmlElementDescriptorImpl.java
@@ -0,0 +1,279 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.dtd;
+
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.UserDataCache;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.filters.ClassFilter;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.meta.PsiWritableMetaData;
+import com.intellij.psi.scope.processor.FilterElementProcessor;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementsGroup;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.util.XmlNSDescriptorSequence;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+
+/**
+ * @author Mike
+ */
+public class XmlElementDescriptorImpl extends BaseXmlElementDescriptorImpl implements PsiWritableMetaData {
+  protected XmlElementDecl myElementDecl;
+  private String myName;
+
+  private static final Class[] ourParentClassesToScanAttributes = new Class[] { XmlMarkupDecl.class, XmlDocument.class };
+  private static final Key<CachedValue<XmlAttlistDecl[]>> ourCachedAttlistKeys = Key.create("cached_decls");
+
+  public XmlElementDescriptorImpl(XmlElementDecl elementDecl) {
+    init(elementDecl);
+  }
+
+  public XmlElementDescriptorImpl() {}
+
+  private static final UserDataCache<CachedValue<XmlAttlistDecl[]>,XmlElement, Object> myAttlistDeclCache = new UserDataCache<CachedValue<XmlAttlistDecl[]>,XmlElement, Object>() {
+    protected final CachedValue<XmlAttlistDecl[]> compute(final XmlElement owner, Object o) {
+      return CachedValuesManager.getManager(owner.getProject()).createCachedValue(new CachedValueProvider<XmlAttlistDecl[]>() {
+        public Result<XmlAttlistDecl[]> compute() {
+          return new Result<XmlAttlistDecl[]>(doCollectAttlistDecls(owner),owner);
+        }
+      });
+    }
+  };
+
+  public PsiElement getDeclaration(){
+    return myElementDecl;
+  }
+
+  public String getName(PsiElement context){
+    return getName();
+  }
+
+  public String getName() {
+    if (myName!=null) return myName;
+    return myName = myElementDecl.getName();
+  }
+
+  public void init(PsiElement element){
+    myElementDecl = (XmlElementDecl) element;
+  }
+
+  public Object[] getDependences(){
+    return new Object[]{myElementDecl, ExternalResourceManager.getInstance()};
+  }
+
+  public XmlNSDescriptor getNSDescriptor() {
+    return getNsDescriptorFrom(myElementDecl);
+  }
+
+  @Nullable
+  private static XmlNSDescriptor getNsDescriptorFrom(final PsiElement elementDecl) {
+    final XmlFile file = XmlUtil.getContainingFile(elementDecl);
+    if(file == null) return null;
+    final XmlDocument document = file.getDocument();
+    XmlNSDescriptor descriptor = (XmlNSDescriptor) document.getMetaData();
+    if(descriptor == null) descriptor = document.getDefaultNSDescriptor(XmlUtil.EMPTY_URI, false);
+    return descriptor;
+  }
+
+  // Read-only action
+  protected final XmlElementDescriptor[] doCollectXmlDescriptors(final XmlTag context) {
+    final LinkedHashSet<XmlElementDescriptor> result = new LinkedHashSet<XmlElementDescriptor>();
+    final XmlElementContentSpec contentSpecElement = myElementDecl.getContentSpecElement();
+    final XmlNSDescriptor nsDescriptor = getNSDescriptor();
+    final XmlNSDescriptor NSDescriptor = nsDescriptor != null? nsDescriptor:getNsDescriptorFrom(context);
+    
+    XmlUtil.processXmlElements(contentSpecElement, new PsiElementProcessor(){
+      public boolean execute(@NotNull PsiElement child){
+        if (child instanceof XmlToken) {
+          final XmlToken token = (XmlToken)child;
+
+          if (token.getTokenType() == XmlTokenType.XML_NAME) {
+            final String text = child.getText();
+            XmlElementDescriptor element = getElementDescriptor(text, NSDescriptor);
+
+            if (element != null) {
+              result.add(element);
+            }
+          }
+          else if (token.getTokenType() == XmlTokenType.XML_CONTENT_ANY) {
+            if (NSDescriptor instanceof XmlNSDescriptorImpl) {
+              ContainerUtil.addAll(result, ((XmlNSDescriptorImpl)NSDescriptor).getElements());
+            } else if (NSDescriptor instanceof XmlNSDescriptorSequence) {
+
+              for (XmlNSDescriptor xmlNSDescriptor : ((XmlNSDescriptorSequence)NSDescriptor).getSequence()) {
+                if (xmlNSDescriptor instanceof XmlNSDescriptorImpl) {
+                  ContainerUtil.addAll(result, ((XmlNSDescriptorImpl)xmlNSDescriptor).getElements());
+                }
+              }
+            }
+          }
+        }
+        return true;
+      }
+    }, true, false, XmlUtil.getContainingFile(getDeclaration()));
+
+    return result.toArray(new XmlElementDescriptor[result.size()]);
+  }
+
+  private static XmlElementDescriptor getElementDescriptor(final String text, final XmlNSDescriptor NSDescriptor) {
+    XmlElementDescriptor element = null;
+    if (NSDescriptor instanceof XmlNSDescriptorImpl) {
+      element = ((XmlNSDescriptorImpl)NSDescriptor).getElementDescriptor(text);
+    }
+    else if (NSDescriptor instanceof XmlNSDescriptorSequence) {
+      final List<XmlNSDescriptor> sequence = ((XmlNSDescriptorSequence)NSDescriptor).getSequence();
+      for (XmlNSDescriptor xmlNSDescriptor : sequence) {
+        if (xmlNSDescriptor instanceof XmlNSDescriptorImpl) {
+          element = ((XmlNSDescriptorImpl)xmlNSDescriptor).getElementDescriptor(text);
+          if(element != null) break;
+        }
+      }
+    }
+    else {
+      element = null;
+    }
+    return element;
+  }
+
+  // Read-only calculation
+  protected final XmlAttributeDescriptor[] collectAttributeDescriptors(final XmlTag context) {
+    final XmlAttributeDescriptor[] attrDescrs;
+    final List<XmlAttributeDescriptor> result = new ArrayList<XmlAttributeDescriptor>();
+
+    for (XmlAttlistDecl attlistDecl : findAttlistDecls(getName())) {
+      for (XmlAttributeDecl attributeDecl : attlistDecl.getAttributeDecls()) {
+        final PsiMetaData psiMetaData = attributeDecl.getMetaData();
+        assert psiMetaData instanceof XmlAttributeDescriptor;
+        result.add((XmlAttributeDescriptor)psiMetaData);
+      }
+    }
+
+    attrDescrs = result.toArray(new XmlAttributeDescriptor[result.size()]);
+    return attrDescrs;
+  }
+
+  // Read-only calculation
+  protected HashMap<String, XmlAttributeDescriptor> collectAttributeDescriptorsMap(final XmlTag context) {
+    final HashMap<String, XmlAttributeDescriptor> localADM;
+    final XmlAttributeDescriptor[] xmlAttributeDescriptors = getAttributesDescriptors(context);
+    localADM = new HashMap<String, XmlAttributeDescriptor>(xmlAttributeDescriptors.length);
+
+    for (final XmlAttributeDescriptor xmlAttributeDescriptor : xmlAttributeDescriptors) {
+      localADM.put(xmlAttributeDescriptor.getName(), xmlAttributeDescriptor);
+    }
+    return localADM;
+  }
+
+  private XmlAttlistDecl[] findAttlistDecls(String elementName) {
+    final List<XmlAttlistDecl> result = new ArrayList<XmlAttlistDecl>();
+
+    final XmlAttlistDecl[] decls = getAttlistDecls();
+
+    for (final XmlAttlistDecl decl : decls) {
+      final String name = decl.getName();
+      if (name != null && name.equals(elementName)) {
+        result.add(decl);
+      }
+    }
+
+    return result.toArray(new XmlAttlistDecl[result.size()]);
+  }
+
+  private XmlAttlistDecl[] getAttlistDecls() {
+    return getCachedAttDecls((XmlElement)getDeclaration());
+  }
+
+  public static @NotNull XmlAttlistDecl[] getCachedAttDecls(@Nullable XmlElement owner) {
+    if (owner == null) return XmlAttlistDecl.EMPTY_ARRAY;
+    owner = (XmlElement)PsiTreeUtil.getParentOfType(owner, ourParentClassesToScanAttributes);
+    if (owner == null) return XmlAttlistDecl.EMPTY_ARRAY;
+    return myAttlistDeclCache.get(ourCachedAttlistKeys, owner, null).getValue();
+  }
+
+  private static final XmlAttlistDecl[] doCollectAttlistDecls(XmlElement xmlElement) {
+    final List<XmlAttlistDecl> result = new ArrayList<XmlAttlistDecl>();
+
+    XmlUtil.processXmlElements(xmlElement, new FilterElementProcessor(new ClassFilter(XmlAttlistDecl.class), result), false, false, XmlUtil.getContainingFile(xmlElement));
+
+    return result.toArray(new XmlAttlistDecl[result.size()]);
+  }
+
+  @Override
+  public XmlElementsGroup getTopGroup() {
+    XmlElementContentGroup topGroup = myElementDecl.getContentSpecElement().getTopGroup();
+    return topGroup == null ? null : new XmlElementsGroupImpl(topGroup, null);
+  }
+
+  public int getContentType() {
+    if (myElementDecl.getContentSpecElement().isAny()) {
+      return CONTENT_TYPE_ANY;
+    }
+    if (myElementDecl.getContentSpecElement().hasChildren()) {
+      return CONTENT_TYPE_CHILDREN;
+    }
+    if (myElementDecl.getContentSpecElement().isEmpty()) {
+      return CONTENT_TYPE_EMPTY;
+    }
+    if (myElementDecl.getContentSpecElement().isMixed()) {
+      return CONTENT_TYPE_MIXED;
+    }
+
+    return CONTENT_TYPE_ANY;
+  }
+
+  // Read-only calculation
+  protected HashMap<String, XmlElementDescriptor> collectElementDescriptorsMap(final XmlTag element) {
+    final HashMap<String, XmlElementDescriptor> elementDescriptorsMap;
+    final XmlElementDescriptor[] descriptors = getElementsDescriptors(element);
+    elementDescriptorsMap = new HashMap<String, XmlElementDescriptor>(descriptors.length);
+
+    for (final XmlElementDescriptor descriptor : descriptors) {
+      elementDescriptorsMap.put(descriptor.getName(), descriptor);
+    }
+    return elementDescriptorsMap;
+  }
+
+  public String getQualifiedName() {
+    return getName();
+  }
+
+  public String getDefaultName() {
+    return getName();
+  }
+
+  public void setName(final String name) throws IncorrectOperationException {
+    // IDEADEV-11439
+    myName = null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/dtd/XmlElementsGroupImpl.java b/xml/impl/src/com/intellij/xml/impl/dtd/XmlElementsGroupImpl.java
new file mode 100644
index 0000000..9f734164
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/dtd/XmlElementsGroupImpl.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.dtd;
+
+import com.intellij.openapi.util.NotNullLazyValue;
+import com.intellij.psi.xml.XmlContentParticle;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementsGroup;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlElementsGroupImpl implements XmlElementsGroup {
+
+  private final XmlContentParticle myParticle;
+  private final XmlElementsGroup myParent;
+  private final NotNullLazyValue<List<XmlElementsGroup>> mySubGroups = new NotNullLazyValue<List<XmlElementsGroup>>() {
+    @NotNull
+    @Override
+    protected List<XmlElementsGroup> compute() {
+      return ContainerUtil.map(myParticle.getSubParticles(), new Function<XmlContentParticle, XmlElementsGroup>() {
+        @Override
+        public XmlElementsGroup fun(XmlContentParticle xmlContentParticle) {
+          return new  XmlElementsGroupImpl(xmlContentParticle, XmlElementsGroupImpl.this);
+        }
+      });
+    }
+  };
+
+  public XmlElementsGroupImpl(@NotNull XmlContentParticle particle, XmlElementsGroup parent) {
+    myParticle = particle;
+    myParent = parent;
+  }
+
+  @Override
+  public int getMinOccurs() {
+    switch (myParticle.getQuantifier()) {
+      case ONE_OR_MORE:
+      case REQUIRED:
+        return 1;
+      case ZERO_OR_MORE:
+      case OPTIONAL:
+        return 0;
+    }
+    throw new AssertionError(myParticle.getQuantifier());
+  }
+
+  @Override
+  public int getMaxOccurs() {
+    switch (myParticle.getQuantifier()) {
+      case ONE_OR_MORE:
+      case ZERO_OR_MORE:
+        return Integer.MAX_VALUE;
+      case OPTIONAL:
+      case REQUIRED:
+        return 1;
+    }
+    throw new AssertionError(myParticle.getQuantifier());
+  }
+
+  @Override
+  public Type getGroupType() {
+    switch (myParticle.getType()) {
+      case SEQUENCE:
+        return Type.SEQUENCE;
+      case CHOICE:
+        return Type.CHOICE;
+      case ELEMENT:
+        return Type.LEAF;
+    }
+    throw new AssertionError(myParticle.getType());
+  }
+
+  @Override
+  public XmlElementsGroup getParentGroup() {
+    return myParent;
+  }
+
+  @Override
+  public List<XmlElementsGroup> getSubGroups() {
+    return mySubGroups.getValue();
+  }
+
+  @Override
+  public XmlElementDescriptor getLeafDescriptor() {
+    return myParticle.getElementDescriptor();
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/dtd/XmlNSDescriptorImpl.java b/xml/impl/src/com/intellij/xml/impl/dtd/XmlNSDescriptorImpl.java
new file mode 100644
index 0000000..b95ac5d
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/dtd/XmlNSDescriptorImpl.java
@@ -0,0 +1,200 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.dtd;
+
+import com.intellij.codeInsight.daemon.Validator;
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.lang.dtd.DTDLanguage;
+import com.intellij.openapi.project.DumbAware;
+import com.intellij.openapi.util.SimpleFieldCache;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.filters.ClassFilter;
+import com.intellij.psi.scope.processor.FilterElementProcessor;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.xml.*;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptorEx;
+import com.intellij.xml.impl.ExternalDocumentValidator;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+/**
+ * @author Mike
+ */
+public class XmlNSDescriptorImpl implements XmlNSDescriptorEx,Validator<XmlDocument>, DumbAware {
+  private XmlElement myElement;
+  private XmlFile myDescriptorFile;
+
+  private static final SimpleFieldCache<CachedValue<Map<String, XmlElementDescriptor>>, XmlNSDescriptorImpl> myCachedDeclsCache = new
+    SimpleFieldCache<CachedValue<Map<String, XmlElementDescriptor>>, XmlNSDescriptorImpl>() {
+    protected final CachedValue<Map<String, XmlElementDescriptor>> compute(final XmlNSDescriptorImpl xmlNSDescriptor) {
+      return xmlNSDescriptor.doBuildDeclarationMap();
+    }
+
+    protected final CachedValue<Map<String, XmlElementDescriptor>> getValue(final XmlNSDescriptorImpl xmlNSDescriptor) {
+      return xmlNSDescriptor.myCachedDecls;
+    }
+
+    protected final void putValue(final CachedValue<Map<String, XmlElementDescriptor>> cachedValue, final XmlNSDescriptorImpl xmlNSDescriptor) {
+      xmlNSDescriptor.myCachedDecls = cachedValue;
+    }
+  };
+
+  private volatile CachedValue<Map<String, XmlElementDescriptor>> myCachedDecls;
+  private static final XmlUtil.DuplicationInfoProvider<XmlElementDecl> XML_ELEMENT_DECL_PROVIDER = new XmlUtil.DuplicationInfoProvider<XmlElementDecl>() {
+    public String getName(@NotNull final XmlElementDecl psiElement) {
+      return psiElement.getName();
+    }
+
+    @NotNull
+    public String getNameKey(@NotNull final XmlElementDecl psiElement, @NotNull final String name) {
+      return name;
+    }
+
+    @NotNull
+    public PsiElement getNodeForMessage(@NotNull final XmlElementDecl psiElement) {
+      return psiElement.getNameElement();
+    }
+  };
+
+  public XmlNSDescriptorImpl() {}
+
+  public XmlFile getDescriptorFile() {
+    return myDescriptorFile;
+  }
+
+  public boolean isHierarhyEnabled() {
+    return false;
+  }
+
+  public XmlElementDescriptor[] getElements() {
+    final Collection<XmlElementDescriptor> delcarations = buildDeclarationMap().values();
+    return delcarations.toArray(new XmlElementDescriptor[delcarations.size()]);
+  }
+
+  private Map<String,XmlElementDescriptor> buildDeclarationMap() {
+    return myCachedDeclsCache.get(this).getValue();
+  }
+
+  // Read-only calculation
+  private CachedValue<Map<String, XmlElementDescriptor>> doBuildDeclarationMap() {
+    return CachedValuesManager.getManager(myElement.getProject()).createCachedValue(new CachedValueProvider<Map<String, XmlElementDescriptor>>() {
+      public Result<Map<String, XmlElementDescriptor>> compute() {
+        final List<XmlElementDecl> result = new ArrayList<XmlElementDecl>();
+        myElement.processElements(new FilterElementProcessor(new ClassFilter(XmlElementDecl.class), result), getDeclaration());
+        final Map<String, XmlElementDescriptor> ret = new LinkedHashMap<String, XmlElementDescriptor>((int)(result.size() * 1.5));
+
+        for (final XmlElementDecl xmlElementDecl : result) {
+          final String name = xmlElementDecl.getName();
+          if (name != null) {
+            if (!ret.containsKey(name)) {
+              ret.put(name, new XmlElementDescriptorImpl(xmlElementDecl));
+            }
+          }
+        }
+        return new Result<Map<String, XmlElementDescriptor>>(ret, myDescriptorFile);
+       }
+     }, false);
+  }
+
+  public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
+    String name = tag.getName();
+    return getElementDescriptor(name);
+  }
+
+  @NotNull
+  public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable final XmlDocument document) {
+    // Suggest more appropriate variant if DOCTYPE <element_name> exists
+    final XmlProlog prolog = document != null ? document.getProlog():null;
+
+    if (prolog != null) {
+      final XmlDoctype doctype = prolog.getDoctype();
+
+      if (doctype != null) {
+        final XmlElement element = doctype.getNameElement();
+
+        if (element != null) {
+          final XmlElementDescriptor descriptor = getElementDescriptor(element.getText());
+
+          if (descriptor != null) return new XmlElementDescriptor[] {descriptor};
+        }
+      }
+    }
+
+    return getElements();
+  }
+
+  public final XmlElementDescriptor getElementDescriptor(String name){
+    return buildDeclarationMap().get(name);
+  }
+
+  public PsiElement getDeclaration() {
+    return myElement;
+  }
+
+  public String getName(PsiElement context){
+    return getName();
+  }
+
+  public String getName(){
+    return myDescriptorFile.getName();
+  }
+
+  public void init(PsiElement element){
+    myElement = (XmlElement)element;
+    myDescriptorFile = (XmlFile)element.getContainingFile();
+
+    if (myElement instanceof XmlFile) {
+      myElement = ((XmlFile)myElement).getDocument();
+    }
+  }
+
+  public Object[] getDependences(){
+    return new Object[]{myElement, ExternalResourceManager.getInstance()};
+  }
+
+  public void validate(@NotNull XmlDocument document, @NotNull ValidationHost host) {
+    if (document.getLanguage() == DTDLanguage.INSTANCE) {
+      final List<XmlElementDecl> decls = new ArrayList<XmlElementDecl>(3);
+
+      XmlUtil.processXmlElements(document, new PsiElementProcessor() {
+        public boolean execute(@NotNull final PsiElement element) {
+          if (element instanceof XmlElementDecl) decls.add((XmlElementDecl)element);
+          return true;
+        }
+      }, false);
+      XmlUtil.doDuplicationCheckForElements(
+        decls.toArray(new XmlElementDecl[decls.size()]),
+        new HashMap<String, XmlElementDecl>(decls.size()),
+        XML_ELEMENT_DECL_PROVIDER,
+        host
+      );
+      return;
+    }
+    ExternalDocumentValidator.doValidation(document,host);
+  }
+
+  @Override
+  public XmlElementDescriptor getElementDescriptor(String localName, String namespace) {
+    return getElementDescriptor(localName);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/AnyXmlAttributeDescriptor.java b/xml/impl/src/com/intellij/xml/impl/schema/AnyXmlAttributeDescriptor.java
new file mode 100644
index 0000000..986ea48
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/AnyXmlAttributeDescriptor.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: mike
+ * Date: Sep 30, 2002
+ * Time: 9:46:52 PM
+ * To change template for new class use 
+ * Code Style | Class Templates options (Tools | IDE Options).
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlAttributeDescriptor;
+
+public class AnyXmlAttributeDescriptor implements XmlAttributeDescriptor {
+  private final String myAttributeName;
+  private final ComplexTypeDescriptor.CanContainAttributeType myCanContainAttributeType;
+
+  public AnyXmlAttributeDescriptor(String attributeName) {
+    this(attributeName, ComplexTypeDescriptor.CanContainAttributeType.CanContainButDoNotSkip);
+  }
+
+  public AnyXmlAttributeDescriptor(String attributeName, ComplexTypeDescriptor.CanContainAttributeType canContainAttributeType) {
+    myAttributeName = attributeName;
+    myCanContainAttributeType = canContainAttributeType;
+  }
+
+  public PsiElement getDeclaration(){
+    return null;
+  }
+
+  public String getName(PsiElement context){
+    return myAttributeName;
+  }
+
+  public String getName() {
+    return myAttributeName;
+  }
+
+  public void init(PsiElement element){
+  }
+
+  public Object[] getDependences(){
+    return ArrayUtil.EMPTY_OBJECT_ARRAY;
+  }
+
+  public String getQualifiedName() {
+    return myAttributeName;
+  }
+
+  public String getDefaultName() {
+    return myAttributeName;
+  }
+
+  public boolean isRequired() {
+    return false;
+  }
+
+  public boolean isFixed() {
+    return false;
+  }
+
+  public boolean hasIdType() {
+    return false;
+  }
+
+  public boolean hasIdRefType() {
+    return false;
+  }
+
+  public String getDefaultValue() {
+    return null;
+  }
+
+  //todo: refactor to hierarchy of value descriptor?
+  public boolean isEnumerated() {
+    return false;
+  }
+
+  public String[] getEnumeratedValues() {
+    return ArrayUtil.EMPTY_STRING_ARRAY;
+  }
+
+  public String validateValue(XmlElement context, String value) {
+    return null;
+  }
+
+  public ComplexTypeDescriptor.CanContainAttributeType getCanContainAttributeType() {
+    return myCanContainAttributeType;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/AnyXmlElementDescriptor.java b/xml/impl/src/com/intellij/xml/impl/schema/AnyXmlElementDescriptor.java
new file mode 100644
index 0000000..7343adf
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/AnyXmlElementDescriptor.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: mike
+ * Date: Sep 30, 2002
+ * Time: 8:55:08 PM
+ * To change template for new class use 
+ * Code Style | Class Templates options (Tools | IDE Options).
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementsGroup;
+import com.intellij.xml.XmlNSDescriptor;
+
+public  class AnyXmlElementDescriptor implements XmlElementDescriptor {
+  private final XmlElementDescriptor myParentDescriptor;
+  private final XmlNSDescriptor myXmlNSDescriptor;
+
+  public AnyXmlElementDescriptor(XmlElementDescriptor parentDescriptor, XmlNSDescriptor xmlNSDescriptor) {
+    myParentDescriptor = parentDescriptor == null ? NullElementDescriptor.getInstance() : parentDescriptor;
+    myXmlNSDescriptor = xmlNSDescriptor;
+  }
+
+  public XmlNSDescriptor getNSDescriptor() {
+    return myXmlNSDescriptor;
+  }
+
+  @Override
+  public XmlElementsGroup getTopGroup() {
+    return null;
+  }
+
+  public PsiElement getDeclaration(){
+    return null;
+  }
+
+  public String getName(PsiElement context){
+    return getName();
+  }
+
+  public String getName() {
+    return myParentDescriptor.getName();
+  }
+
+  public void init(PsiElement element){
+  }
+
+  public Object[] getDependences(){
+    return ArrayUtil.EMPTY_OBJECT_ARRAY;
+  }
+
+  public String getQualifiedName() {
+    return myParentDescriptor.getQualifiedName();
+  }
+
+  public String getDefaultName() {
+    return myParentDescriptor.getDefaultName();
+  }
+
+  public XmlElementDescriptor[] getElementsDescriptors(XmlTag context) {
+    return myParentDescriptor.getElementsDescriptors(context);
+  }
+
+  public XmlElementDescriptor getElementDescriptor(XmlTag tag, XmlTag contextTag){
+    return new AnyXmlElementDescriptor(this, myXmlNSDescriptor);
+  }
+
+  public XmlAttributeDescriptor[] getAttributesDescriptors(final XmlTag context) {
+    return new XmlAttributeDescriptor[0];
+  }
+
+  public XmlAttributeDescriptor getAttributeDescriptor(final String attributeName, final XmlTag context) {
+    return new AnyXmlAttributeDescriptor(attributeName);
+  }
+
+  public XmlAttributeDescriptor getAttributeDescriptor(XmlAttribute attr){
+    return myParentDescriptor.getAttributeDescriptor(attr);
+  }
+
+  public int getContentType() {
+    return CONTENT_TYPE_UNKNOWN;
+  }
+
+  @Override
+  public String getDefaultValue() {
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/ComplexTypeDescriptor.java b/xml/impl/src/com/intellij/xml/impl/schema/ComplexTypeDescriptor.java
new file mode 100644
index 0000000..6068f42
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/ComplexTypeDescriptor.java
@@ -0,0 +1,474 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.FieldCache;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.SchemaReferencesProvider;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ConcurrentFactoryMap;
+import com.intellij.util.containers.FactoryMap;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementsGroup;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.util.XmlUtil;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+/**
+ * @author Mike
+ */
+public class ComplexTypeDescriptor extends TypeDescriptor {
+  protected final XmlNSDescriptorImpl myDocumentDescriptor;
+  private final XmlTag myTag;
+
+  private static final FieldCache<XmlElementDescriptor[],ComplexTypeDescriptor,Object, XmlElement> myElementDescriptorsCache =
+    new FieldCache<XmlElementDescriptor[],ComplexTypeDescriptor,Object, XmlElement>() {
+
+    protected XmlElementDescriptor[] compute(final ComplexTypeDescriptor complexTypeDescriptor, final XmlElement p) {
+      return complexTypeDescriptor.doCollectElements(p);
+    }
+
+    protected XmlElementDescriptor[] getValue(final ComplexTypeDescriptor complexTypeDescriptor, final Object p) {
+      return complexTypeDescriptor.myElementDescriptors;
+    }
+
+    protected void putValue(final XmlElementDescriptor[] xmlElementDescriptors,
+                            final ComplexTypeDescriptor complexTypeDescriptor, final Object p) {
+      complexTypeDescriptor.myElementDescriptors = xmlElementDescriptors;
+    }
+  };
+
+  private static final FieldCache<XmlAttributeDescriptor[], ComplexTypeDescriptor, Object, XmlElement> myAttributeDescriptorsCache =
+    new FieldCache<XmlAttributeDescriptor[], ComplexTypeDescriptor, Object, XmlElement>() {
+    protected final XmlAttributeDescriptor[] compute(final ComplexTypeDescriptor complexTypeDescriptor, XmlElement p) {
+      return complexTypeDescriptor.doCollectAttributes(p);
+    }
+
+    protected final XmlAttributeDescriptor[] getValue(final ComplexTypeDescriptor complexTypeDescriptor, Object o) {
+      return complexTypeDescriptor.myAttributeDescriptors;
+    }
+
+    protected final void putValue(final XmlAttributeDescriptor[] xmlAttributeDescriptors,
+                            final ComplexTypeDescriptor complexTypeDescriptor, final Object p) {
+      complexTypeDescriptor.myAttributeDescriptors = xmlAttributeDescriptors;
+    }
+  };
+
+  private final FactoryMap<String, CachedValue<CanContainAttributeType>> myAnyAttributeCache = new ConcurrentFactoryMap<String, CachedValue<CanContainAttributeType>>() {
+    @Override
+    protected CachedValue<CanContainAttributeType> create(final String key) {
+      return CachedValuesManager.getManager(myTag.getProject()).createCachedValue(new CachedValueProvider<CanContainAttributeType>() {
+        @Override
+        public Result<CanContainAttributeType> compute() {
+          THashSet<PsiFile> dependencies = new THashSet<PsiFile>();
+          CanContainAttributeType type = _canContainAttribute(key, myTag, null, new THashSet<String>(), dependencies);
+          if (dependencies.isEmpty()) {
+            dependencies.add(myTag.getContainingFile());
+          }
+          return Result.create(type, ArrayUtil.toObjectArray(dependencies));
+        }
+      }, false);
+    }
+  };
+
+  private volatile XmlElementDescriptor[] myElementDescriptors = null;
+  private volatile XmlAttributeDescriptor[] myAttributeDescriptors = null;
+  @NonNls
+  private static final String PROHIBITED_ATTR_VALUE = "prohibited";
+  @NonNls
+  private static final String OTHER_NAMESPACE_ATTR_VALUE = "##other";
+
+  @NonNls private static final String TRUE_ATTR_VALUE = "true";
+  @NonNls private static final String REF_ATTR_NAME = "ref";
+  @NonNls private static final String NAME_ATTR_NAME = "name";
+  @NonNls private static final String ELEMENT_TAG_NAME = "element";
+  @NonNls private static final String ATTRIBUTE_TAG_NAME = "attribute";
+  private boolean myHasAnyInContentModel;
+  @NonNls private static final String RESTRICTION_TAG_NAME = "restriction";
+  @NonNls private static final String EXTENSION_TAG_NAME = "extension";
+  @NonNls private static final String BASE_ATTR_NAME = "base";
+
+  public ComplexTypeDescriptor(XmlNSDescriptorImpl documentDescriptor, XmlTag tag) {
+    myDocumentDescriptor = documentDescriptor;
+    myTag = tag;
+  }
+
+  public XmlTag getDeclaration(){
+    return myTag;
+  }
+
+  @Nullable
+  public XmlElementsGroup getTopGroup() {
+    return XmlElementsGroupProcessor.computeGroups(myDocumentDescriptor, myTag);
+  }
+
+  public XmlElementDescriptor[] getElements(XmlElement context) {
+    return myElementDescriptorsCache.get(null, this, context);
+  }
+
+  // Read-only calculation
+  private XmlElementDescriptor[] doCollectElements(@Nullable XmlElement context) {
+    final Map<String,XmlElementDescriptor> map = new LinkedHashMap<String,XmlElementDescriptor>(5);
+    createProcessor(map).startProcessing(myTag);
+    addSubstitutionGroups(map, myDocumentDescriptor, new HashSet<XmlNSDescriptorImpl>());
+    filterAbstractElements(map);
+    return map.values().toArray(
+      new XmlElementDescriptor[map.values().size()]
+    );
+  }
+
+  protected XmlSchemaTagsProcessor createProcessor(final Map<String, XmlElementDescriptor> map) {
+    return new XmlSchemaTagsProcessor(myDocumentDescriptor) {
+      @Override
+      protected void tagStarted(XmlTag tag, String tagName, XmlTag context, XmlTag ref) {
+        addElementDescriptor(tag, tagName, map);
+      }
+    };
+  }
+
+  protected void addElementDescriptor(XmlTag tag, String tagName, Map<String, XmlElementDescriptor> map) {
+    if ("element".equals(tagName) && tag.getAttribute("name") != null) {
+      addElementDescriptor(map, myDocumentDescriptor.createElementDescriptor(tag));
+    }
+  }
+
+  private static void addSubstitutionGroups(Map<String, XmlElementDescriptor> result,
+                                            XmlNSDescriptorImpl nsDescriptor,
+                                            Set<XmlNSDescriptorImpl> visited) {
+    mainLoop: while (true) {
+      for (final XmlElementDescriptor xmlElementDescriptor : result.values()) {
+        XmlElementDescriptorImpl descriptor = (XmlElementDescriptorImpl)xmlElementDescriptor;
+
+        final XmlElementDescriptor[] substitutes = nsDescriptor.getSubstitutes(descriptor.getName(), descriptor.getNamespace());
+        boolean toContinue = false;
+
+        for (XmlElementDescriptor substitute : substitutes) {
+          if (result.get(substitute.getName()) == null) {
+            toContinue = true;
+            result.put(substitute.getName(), substitute);
+          }
+        }
+
+        if (toContinue) continue mainLoop;
+      }
+
+      break;
+    }
+
+    visited.add(nsDescriptor);
+    for (XmlTag tag : nsDescriptor.getTag().getSubTags()) {
+      if (XmlNSDescriptorImpl.equalsToSchemaName(tag, "include")) {
+        PsiElement element = XmlSchemaTagsProcessor.resolveReference(tag.getAttribute("schemaLocation"));
+        if (element instanceof XmlFile) {
+          XmlDocument document = ((XmlFile)element).getDocument();
+          if (document != null) {
+            PsiMetaData metaData = document.getMetaData();
+            if (metaData instanceof XmlNSDescriptorImpl && !visited.contains(metaData)) {
+              addSubstitutionGroups(result, (XmlNSDescriptorImpl)metaData, visited);
+            }
+          }
+        }
+      }
+    }
+
+  }
+
+  private static void filterAbstractElements(Map<String,XmlElementDescriptor> result) {
+    for (Iterator<XmlElementDescriptor> iterator = result.values().iterator(); iterator.hasNext();) {
+      XmlElementDescriptorImpl descriptor = (XmlElementDescriptorImpl)iterator.next();
+      if (descriptor.isAbstract()) iterator.remove();
+    }
+  }
+
+  public XmlAttributeDescriptor[] getAttributes(@Nullable XmlElement context) {
+    return myAttributeDescriptorsCache.get(null, this, context);
+  }
+
+  // Read-only calculation
+  private XmlAttributeDescriptor[] doCollectAttributes(@Nullable final XmlElement context) {
+    final List<XmlAttributeDescriptor> result = new ArrayList<XmlAttributeDescriptor>();
+
+    XmlSchemaTagsProcessor processor = new XmlSchemaTagsProcessor(myDocumentDescriptor, "element") {
+      @Override
+      protected void tagStarted(XmlTag tag, String tagName, XmlTag context, XmlTag ref) {
+        if (ATTRIBUTE_TAG_NAME.equals(tagName)) {
+
+          String name = tag.getAttributeValue(NAME_ATTR_NAME);
+          if (name == null) return;
+
+          String use = null;
+          if (ATTRIBUTE_TAG_NAME.equals(context.getLocalName())) { // from ref
+            use = context.getAttributeValue("use");
+          }
+          if (use == null) use = tag.getAttributeValue("use");
+
+          if (PROHIBITED_ATTR_VALUE.equals(use)) {
+            removeAttributeDescriptor(result, name);
+          }
+          else {
+            XmlAttributeDescriptorImpl descriptor = myDocumentDescriptor.createAttributeDescriptor(tag);
+            descriptor.myUse = use;
+            addAttributeDescriptor(result, descriptor);
+          }
+        }
+      }
+    };
+    processor.startProcessing(myTag);
+    return result.toArray(new XmlAttributeDescriptor[result.size()]);
+  }
+
+  public XmlNSDescriptorImpl getNsDescriptors() {
+    return myDocumentDescriptor;
+  }
+
+  protected static void addElementDescriptor(Map<String,XmlElementDescriptor> result, XmlElementDescriptor element) {
+    result.remove(element.getName());
+    result.put(element.getName(),element);
+  }
+
+  private static void removeAttributeDescriptor(List<XmlAttributeDescriptor> result, String name) {
+    for (Iterator<XmlAttributeDescriptor> iterator = result.iterator(); iterator.hasNext();) {
+      XmlAttributeDescriptor attributeDescriptor = iterator.next();
+
+      if (attributeDescriptor.getName().equals(name)) {
+        iterator.remove();
+      }
+    }
+  }
+
+  private static void addAttributeDescriptor(List<XmlAttributeDescriptor> result, XmlAttributeDescriptor descriptor) {
+    removeAttributeDescriptor(result, descriptor.getName());
+
+    result.add(descriptor);
+  }
+
+  public boolean canContainTag(String localName, String namespace, XmlElement context) {
+    return _canContainTag(localName, namespace, myTag, context, new HashSet<XmlTag>(5),
+                          new CurrentContextInfo(myDocumentDescriptor, myDocumentDescriptor.getDefaultNamespace()));
+  }
+
+  static class CurrentContextInfo {
+    final XmlNSDescriptorImpl documentDescriptor;
+    final String expectedDefaultNs;
+
+    public CurrentContextInfo(XmlNSDescriptorImpl _nsDescriptor, String _ns) {
+      documentDescriptor = _nsDescriptor;
+      expectedDefaultNs = _ns;
+    }
+  }
+
+  static CurrentContextInfo getContextInfo(CurrentContextInfo info, String ref) {
+    XmlTag rootTag = info.documentDescriptor.getTag();
+    XmlNSDescriptorImpl nsDescriptor = XmlNSDescriptorImpl.getNSDescriptorToSearchIn(rootTag, ref, info.documentDescriptor);
+    String ns;
+    
+    if (nsDescriptor == info.documentDescriptor) {
+      ns = rootTag.getNamespaceByPrefix(XmlUtil.findPrefixByQualifiedName(ref));
+    } else {
+      ns = nsDescriptor.getDefaultNamespace();
+    }
+
+    if (Comparing.equal(info.expectedDefaultNs, ns) && info.documentDescriptor == nsDescriptor) return info;
+    return new CurrentContextInfo(nsDescriptor, ns);
+  }
+
+  private boolean _canContainTag(String localName, String namespace, XmlTag tag, XmlElement context, Set<XmlTag> visited,
+                                 CurrentContextInfo info) {
+    if (visited.contains(tag)) return false;
+    visited.add(tag);
+
+    if (XmlNSDescriptorImpl.equalsToSchemaName(tag, "any")) {
+      myHasAnyInContentModel = true;
+      if (OTHER_NAMESPACE_ATTR_VALUE.equals(tag.getAttributeValue("namespace"))) {
+        return namespace == null || !namespace.equals(info.expectedDefaultNs);
+      }
+      return true;
+    }
+    else if (XmlNSDescriptorImpl.equalsToSchemaName(tag, "group")) {
+      String ref = tag.getAttributeValue(REF_ATTR_NAME);
+
+      if (ref != null) {
+        XmlTag groupTag = info.documentDescriptor.findGroup(ref);
+        if (groupTag != null) {
+          if (_canContainTag(localName, namespace, groupTag, context, visited, getContextInfo(info, ref)))  return true;
+        }
+      }
+    }
+    else if (XmlNSDescriptorImpl.equalsToSchemaName(tag, RESTRICTION_TAG_NAME) ||
+             XmlNSDescriptorImpl.equalsToSchemaName(tag, EXTENSION_TAG_NAME)) {
+      String base = tag.getAttributeValue(BASE_ATTR_NAME);
+
+      if (base != null) {
+        TypeDescriptor descriptor = info.documentDescriptor.findTypeDescriptor(base);
+
+        if (descriptor instanceof ComplexTypeDescriptor) {
+          ComplexTypeDescriptor complexTypeDescriptor = (ComplexTypeDescriptor)descriptor;
+          if (complexTypeDescriptor._canContainTag(localName, namespace, complexTypeDescriptor.myTag, context, visited,
+                                                   getContextInfo(info, base))) {
+            myHasAnyInContentModel |= complexTypeDescriptor.myHasAnyInContentModel;
+            return true;
+          }
+        }
+      }
+    } else if (XmlNSDescriptorImpl.equalsToSchemaName(tag, ELEMENT_TAG_NAME)) {
+      final XmlAttribute ref = tag.getAttribute(REF_ATTR_NAME);
+      XmlTag descriptorTag = tag;
+
+      if (ref != null) {
+        final PsiElement psiElement = SchemaReferencesProvider.createTypeOrElementOrAttributeReference(ref.getValueElement()).resolve();
+        if (psiElement instanceof XmlTag) descriptorTag = (XmlTag)psiElement;
+      }
+
+      if (TRUE_ATTR_VALUE.equals(descriptorTag.getAttributeValue("abstract"))) {
+
+        XmlNSDescriptor _nsDescriptor = tag.getNSDescriptor(namespace, true);
+        if (_nsDescriptor == null && context instanceof XmlTag) {
+          _nsDescriptor = ((XmlTag)context).getNSDescriptor(namespace, true);
+        }
+        final XmlNSDescriptorImpl nsDescriptor = _nsDescriptor instanceof XmlNSDescriptorImpl ? (XmlNSDescriptorImpl)_nsDescriptor:null;
+        final XmlElementDescriptor descriptor = nsDescriptor != null ? nsDescriptor.getElementDescriptor(localName, namespace):null;
+        final String name = descriptorTag.getAttributeValue(NAME_ATTR_NAME);
+
+        if (descriptor != null && name != null) {
+          final String substitutionValue = ((XmlTag)descriptor.getDeclaration()).getAttributeValue("substitutionGroup");
+
+          if (substitutionValue != null && name.equals(XmlUtil.findLocalNameByQualifiedName(substitutionValue))) {
+            return true; // could be more parent-child relation complex!!!
+          }
+        }
+    }
+    }
+
+    for (XmlTag subTag : tag.getSubTags()) {
+      if (_canContainTag(localName, namespace, subTag, context, visited, info)) return true;
+    }
+
+    return false;
+  }
+
+  public CanContainAttributeType canContainAttribute(String namespace, @Nullable String qName) {
+    if (qName == null) {
+      return myAnyAttributeCache.get(namespace).getValue();
+    }
+    return _canContainAttribute(namespace, myTag, qName, new THashSet<String>(), null);
+  }
+  
+  enum CanContainAttributeType {
+    CanContainButSkip, CanContainButDoNotSkip, CanNotContain
+  }
+
+  private CanContainAttributeType _canContainAttribute(String namespace,
+                                                       XmlTag tag,
+                                                       @Nullable String qName,
+                                                       Set<String> visited,
+                                                       @Nullable Set<PsiFile> dependencies) {
+    if (XmlNSDescriptorImpl.equalsToSchemaName(tag, "anyAttribute")) {
+      if (dependencies != null) {
+        dependencies.add(tag.getContainingFile());
+      }
+      String ns = tag.getAttributeValue("namespace");
+      CanContainAttributeType canContainAttributeType = CanContainAttributeType.CanContainButDoNotSkip;
+      if ("skip".equals(tag.getAttributeValue("processContents"))) canContainAttributeType= CanContainAttributeType.CanContainButSkip;
+      
+      if (OTHER_NAMESPACE_ATTR_VALUE.equals(ns)) {
+        return !namespace.equals(myDocumentDescriptor.getDefaultNamespace()) ? canContainAttributeType : CanContainAttributeType.CanNotContain;
+      }
+      return canContainAttributeType;
+    }
+    else if (XmlNSDescriptorImpl.equalsToSchemaName(tag, "attributeGroup")) {
+      String ref = tag.getAttributeValue(REF_ATTR_NAME);
+
+      if (ref != null && !visited.contains(ref)) {
+        visited.add(ref);
+        XmlTag groupTag = myDocumentDescriptor.findAttributeGroup(ref);
+
+        if (groupTag != null) {
+          if (dependencies != null) {
+            dependencies.add(groupTag.getContainingFile());
+          }
+          final CanContainAttributeType containAttributeType = _canContainAttribute(namespace, groupTag, qName, visited, dependencies);
+          if (containAttributeType != CanContainAttributeType.CanNotContain) return containAttributeType;
+        }
+      }
+    }
+    else if (XmlNSDescriptorImpl.equalsToSchemaName(tag, "attribute")) {
+      if (qName != null && qName.equals(tag.getAttributeValue(REF_ATTR_NAME))) {
+        return CanContainAttributeType.CanContainButDoNotSkip;
+      }
+    }
+    else if (XmlNSDescriptorImpl.equalsToSchemaName(tag, RESTRICTION_TAG_NAME) ||
+             XmlNSDescriptorImpl.equalsToSchemaName(tag, EXTENSION_TAG_NAME)) {
+      String base = tag.getAttributeValue(BASE_ATTR_NAME);
+
+      if (base != null && !visited.contains(base)) {
+        visited.add(base);
+        TypeDescriptor descriptor = myDocumentDescriptor.findTypeDescriptor(base);
+
+        if (descriptor instanceof ComplexTypeDescriptor) {
+          ComplexTypeDescriptor complexTypeDescriptor = (ComplexTypeDescriptor)descriptor;
+          if (dependencies != null) {
+            dependencies.add(((ComplexTypeDescriptor)descriptor).getDeclaration().getContainingFile());
+          }
+
+          final CanContainAttributeType containAttributeType =
+            complexTypeDescriptor._canContainAttribute(namespace, complexTypeDescriptor.getDeclaration(), qName, visited, dependencies);
+          if (containAttributeType != CanContainAttributeType.CanNotContain) return containAttributeType;
+        }
+      }
+    }
+
+    final XmlTag[] subTags = tag.getSubTags();
+    for (XmlTag subTag : subTags) {
+      final CanContainAttributeType containAttributeType = _canContainAttribute(namespace, subTag, qName, visited, dependencies);
+      if (containAttributeType != CanContainAttributeType.CanNotContain) return containAttributeType;
+    }
+
+    return CanContainAttributeType.CanNotContain;
+  }
+
+  public boolean hasAnyInContentModel() {
+    return myHasAnyInContentModel;
+  }
+
+  public int getContentType() {
+
+    if ("simpleType".equals(myTag.getLocalName()) || "true".equals(myTag.getAttributeValue("mixed"))) {
+      return XmlElementDescriptor.CONTENT_TYPE_MIXED;
+    }
+
+    if (getElements(null).length > 0) return XmlElementDescriptor.CONTENT_TYPE_CHILDREN;
+
+    for (XmlTag tag : myTag.getSubTags()) {
+      if ("simpleContent".equals(tag.getLocalName())) {
+        return XmlElementDescriptor.CONTENT_TYPE_MIXED;
+      }
+    }
+    return XmlElementDescriptor.CONTENT_TYPE_EMPTY;
+
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/GotoXmlSchemaTypeRendererProvider.java b/xml/impl/src/com/intellij/xml/impl/schema/GotoXmlSchemaTypeRendererProvider.java
new file mode 100644
index 0000000..1017b9a
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/GotoXmlSchemaTypeRendererProvider.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.codeInsight.navigation.GotoTargetHandler;
+import com.intellij.codeInsight.navigation.GotoTargetRendererProvider;
+import com.intellij.ide.util.PsiElementListCellRenderer;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.source.xml.XmlTagImpl;
+import com.intellij.psi.xml.XmlAttribute;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: Irina.Chernushina
+ * Date: 7/5/12
+ * Time: 8:27 PM
+ */
+public class GotoXmlSchemaTypeRendererProvider implements GotoTargetRendererProvider {
+  @Override
+  public PsiElementListCellRenderer getRenderer(PsiElement element, GotoTargetHandler.GotoData gotoData) {
+    if (element instanceof XmlTagImpl) {
+      if (SchemaDefinitionsSearch.isTypeElement((XmlTagImpl)element)) {
+        return new MyRenderer("");
+      }  else if (SchemaDefinitionsSearch.isElementWithSomeEmbeddedType((XmlTagImpl)element)) {
+        return new MyRenderer("xsd:element: ");
+      }
+    }
+    return null;
+  }
+
+  private static class MyRenderer extends PsiElementListCellRenderer<XmlTagImpl> {
+    private final String myPrefix;
+
+    private MyRenderer(String prefix) {
+      myPrefix = prefix;
+    }
+
+    @Override
+    public String getElementText(XmlTagImpl element) {
+      final XmlAttribute attr = SchemaDefinitionsSearch.getNameAttr(element);
+      return myPrefix + (attr == null || attr.getValue() == null ? element.getName() : attr.getValue());
+    }
+
+    @Override
+    protected String getContainerText(XmlTagImpl element, String name) {
+      final PsiFile file = element.getContainingFile();
+      return "(" + file.getName() + ")";
+    }
+
+    @Override
+    protected int getIconFlags() {
+      return 0;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/NamedObjectDescriptor.java b/xml/impl/src/com/intellij/xml/impl/schema/NamedObjectDescriptor.java
new file mode 100644
index 0000000..04779f1
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/NamedObjectDescriptor.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.meta.PsiWritableMetaData;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class NamedObjectDescriptor implements PsiWritableMetaData, PsiMetaData {
+  private XmlTag myDcl;
+
+  public NamedObjectDescriptor() {}
+
+  public void setName(String name) throws IncorrectOperationException {
+    setName(myDcl, name);
+  }
+
+  static void setName(final XmlTag dcl, final String name) throws IncorrectOperationException {
+    if (dcl.isWritable()) {
+      final VirtualFile virtualFile = dcl.getContainingFile().getVirtualFile();
+
+      if (virtualFile!=null &&
+          ProjectRootManager.getInstance(dcl.getProject()).getFileIndex().getModuleForFile(virtualFile)!=null
+          ) {
+        dcl.setAttribute("name",name.substring(name.indexOf(':')+1));
+      }
+    }
+  }
+
+  public PsiElement getDeclaration() {
+    return myDcl;
+  }
+
+  public String getName(PsiElement context) {
+    return getName();
+  }
+
+  public String getName() {
+    return myDcl.getAttributeValue("name");
+  }
+
+  public void init(PsiElement element) {
+    myDcl = (XmlTag)element;
+  }
+
+  public Object[] getDependences() {
+    return new Object[] { myDcl };
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/NullElementDescriptor.java b/xml/impl/src/com/intellij/xml/impl/schema/NullElementDescriptor.java
new file mode 100644
index 0000000..3704042
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/NullElementDescriptor.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/**
+ * @author cdr
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementsGroup;
+import com.intellij.xml.XmlNSDescriptor;
+
+public class NullElementDescriptor implements XmlElementDescriptor {
+  private static final NullElementDescriptor INSTANCE = new NullElementDescriptor();
+
+  public static NullElementDescriptor getInstance() {
+    return INSTANCE;
+  }
+
+  private NullElementDescriptor() {
+  }
+
+  public String getQualifiedName() {
+    return null;
+  }
+
+  public String getDefaultName() {
+    return null;
+  }
+
+  //todo: refactor to support full DTD spec
+  public XmlElementDescriptor[] getElementsDescriptors(XmlTag context) {
+    return new XmlElementDescriptor[0];
+  }
+
+  public XmlElementDescriptor getElementDescriptor(XmlTag childTag, XmlTag contextTag) {
+    return null;
+  }
+
+  public XmlAttributeDescriptor[] getAttributesDescriptors(final XmlTag context) {
+    return new XmlAttributeDescriptor[0];
+  }
+
+  public XmlAttributeDescriptor getAttributeDescriptor(String attributeName, final XmlTag context) {
+    return null;
+  }
+
+  public XmlAttributeDescriptor getAttributeDescriptor(XmlAttribute attribute) {
+    return null;
+  }
+
+  public XmlNSDescriptor getNSDescriptor() {
+    return null;
+  }
+
+  @Override
+  public XmlElementsGroup getTopGroup() {
+    return null;
+  }
+
+  public int getContentType() {
+    return 0;
+  }
+
+  @Override
+  public String getDefaultValue() {
+    return null;
+  }
+
+  public PsiElement getDeclaration() {
+    return null;
+  }
+
+  public String getName(PsiElement context) {
+    return null;
+  }
+
+  public String getName() {
+    return null;
+  }
+
+  public void init(PsiElement element) {
+  }
+
+  public Object[] getDependences() {
+    return ArrayUtil.EMPTY_OBJECT_ARRAY;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/RedefinedElementDescriptor.java b/xml/impl/src/com/intellij/xml/impl/schema/RedefinedElementDescriptor.java
new file mode 100644
index 0000000..75a96f6
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/RedefinedElementDescriptor.java
@@ -0,0 +1,54 @@
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlElementDescriptor;
+
+import java.util.Map;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class RedefinedElementDescriptor extends XmlElementDescriptorImpl {
+
+  private final XmlNSDescriptorImpl myRedefinedNSDescriptor;
+
+  public RedefinedElementDescriptor(XmlElementDescriptorImpl original, XmlNSDescriptorImpl xmlNSDescriptor) {
+    super(original.myDescriptorTag);
+    myRedefinedNSDescriptor = xmlNSDescriptor;
+  }
+
+  @Override
+  public TypeDescriptor getType(XmlElement context) {
+    TypeDescriptor typeDescriptor = super.getType(context);
+    return typeDescriptor instanceof ComplexTypeDescriptor ? new RedefinedTypeDescriptor((ComplexTypeDescriptor)typeDescriptor) : typeDescriptor;
+  }
+
+  private class RedefinedTypeDescriptor extends ComplexTypeDescriptor {
+    public RedefinedTypeDescriptor(ComplexTypeDescriptor original) {
+      super(original.getNsDescriptors(), original.getDeclaration());
+    }
+
+    @Override
+    protected XmlSchemaTagsProcessor createProcessor(final Map<String, XmlElementDescriptor> map) {
+      return new XmlSchemaTagsProcessor(myDocumentDescriptor) {
+        @Override
+        protected void tagStarted(XmlTag tag, String tagName, XmlTag context, XmlTag ref) {
+          addElementDescriptor(tag, tagName, map);
+          if ("extension".equals(tagName)) {
+            String base = tag.getAttributeValue("base");
+            if (base != null) {
+              TypeDescriptor descriptor = myRedefinedNSDescriptor.findTypeDescriptor(base);
+              if (descriptor instanceof ComplexTypeDescriptor) {
+                XmlElementDescriptor[] elements = ((ComplexTypeDescriptor)descriptor).getElements(null);
+                for (XmlElementDescriptor element : elements) {
+                  addElementDescriptor(map, element);
+                }
+              }
+            }
+          }
+        }
+      };
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/SchemaDefinitionsSearch.java b/xml/impl/src/com/intellij/xml/impl/schema/SchemaDefinitionsSearch.java
new file mode 100644
index 0000000..fe3a323
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/SchemaDefinitionsSearch.java
@@ -0,0 +1,241 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtil;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.Computable;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.impl.source.xml.XmlTagImpl;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.PairConvertor;
+import com.intellij.util.Processor;
+import com.intellij.util.QueryExecutor;
+import com.intellij.util.containers.hash.HashMap;
+import com.intellij.util.containers.hash.HashSet;
+import com.intellij.xml.index.SchemaTypeInfo;
+import com.intellij.xml.index.SchemaTypeInheritanceIndex;
+import com.intellij.xml.index.XmlNamespaceIndex;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.*;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: Irina.Chernushina
+ * Date: 7/5/12
+ * Time: 5:34 PM
+ */
+public class SchemaDefinitionsSearch implements QueryExecutor<PsiElement, PsiElement> {
+  @Override
+  public boolean execute(@NotNull final PsiElement queryParameters, @NotNull final Processor<PsiElement> consumer) {
+    if (queryParameters instanceof XmlTagImpl) {
+      final XmlTagImpl xml = (XmlTagImpl) queryParameters;
+      if (isTypeElement(xml)) {
+        final Collection<SchemaTypeInfo> infos = ApplicationManager.getApplication().runReadAction(new Computable<Collection<SchemaTypeInfo>>() {
+
+          @Override
+          public Collection<SchemaTypeInfo> compute() {
+            return gatherInheritors(xml);
+          }
+        });
+
+        if (infos != null && ! infos.isEmpty()) {
+          XmlFile file = XmlUtil.getContainingFile(xml);
+          final Project project = file.getProject();
+          final Module module = ModuleUtil.findModuleForPsiElement(queryParameters);
+          //if (module == null) return false;
+
+          final VirtualFile vf = file.getVirtualFile();
+          String thisNs = XmlNamespaceIndex.getNamespace(vf, project, file);
+          thisNs = thisNs == null ? getDefaultNs(file) : thisNs;
+          // so thisNs can be null
+          if (thisNs == null) return false;
+          final ArrayList<SchemaTypeInfo> infosLst = new ArrayList<SchemaTypeInfo>(infos);
+          Collections.sort(infosLst);
+          final Map<String, Set<XmlFile>> nsMap = new HashMap<String, Set<XmlFile>>();
+          for (final SchemaTypeInfo info : infosLst) {
+            Set<XmlFile> targetFiles = nsMap.get(info.getNamespaceUri());
+            if (targetFiles == null) {
+              targetFiles = new HashSet<XmlFile>();
+              if (Comparing.equal(info.getNamespaceUri(), thisNs)) {
+                targetFiles.add(file);
+              }
+              final Collection<XmlFile> files = ApplicationManager.getApplication().runReadAction(new Computable<Collection<XmlFile>>() {
+                @Override
+                public Collection<XmlFile> compute() {
+                  return XmlUtil.findNSFilesByURI(info.getNamespaceUri(), project, module);
+                }
+              });
+              if (files != null) {
+                targetFiles.addAll(files);
+              }
+              nsMap.put(info.getNamespaceUri(), targetFiles);
+            }
+            if (! targetFiles.isEmpty()) {
+              for (final XmlFile targetFile : targetFiles) {
+                ApplicationManager.getApplication().runReadAction(new Runnable() {
+                  @Override
+                  public void run() {
+                    final String prefixByURI = XmlUtil.findNamespacePrefixByURI(targetFile, info.getNamespaceUri());
+                    if (prefixByURI == null) return;
+                    final PsiElementProcessor processor = new PsiElementProcessor() {
+                      @Override
+                      public boolean execute(@NotNull PsiElement element) {
+                        if (element instanceof XmlTagImpl) {
+                          if (isCertainTypeElement((XmlTagImpl)element, info.getTagName(), prefixByURI) ||
+                              isElementWithEmbeddedType((XmlTagImpl)element, info.getTagName(), prefixByURI)) {
+                            consumer.process(element);
+                            return false;
+                          }
+                        }
+                        return true;
+                      }
+                    };
+                    XmlUtil.processXmlElements(targetFile, processor, true);
+                  }
+                });
+              }
+            }
+          }
+        }
+      }
+    }
+    return true;
+  }
+
+  public static boolean isElementWithSomeEmbeddedType(XmlTagImpl xml) {
+    final String localName = xml.getLocalName();
+    if (! (XmlUtil.XML_SCHEMA_URI.equals(xml.getNamespace()) && "element".equals(localName))) {
+      return false;
+    }
+    final XmlTag[] tags = xml.getSubTags();
+    for (XmlTag tag : tags) {
+      if (isTypeElement((XmlTagImpl)tag)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  public static boolean isElementWithEmbeddedType(XmlTagImpl xml, final String typeName, final String typeNsPrefix) {
+    final String localName = xml.getLocalName();
+    if (! (XmlUtil.XML_SCHEMA_URI.equals(xml.getNamespace()) && "element".equals(localName))) {
+      return false;
+    }
+    final XmlAttribute nameAttr = getNameAttr(xml);
+    if (nameAttr == null || nameAttr.getValue() == null) return false;
+    final String localTypeName = XmlUtil.findLocalNameByQualifiedName(nameAttr.getValue());
+    final String prefix = XmlUtil.findPrefixByQualifiedName(nameAttr.getValue());
+    if (! typeName.equals(localTypeName) || ! typeNsPrefix.equals(prefix)) {
+      return false;
+    }
+    final XmlTag[] tags = xml.getSubTags();
+    for (XmlTag tag : tags) {
+      if (isTypeElement((XmlTagImpl)tag)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  private boolean isCertainTypeElement(XmlTagImpl xml, final String typeName, final String nsPrefix) {
+    if (! isTypeElement(xml)) return false;
+    final XmlAttribute name = getNameAttr(xml);
+    if (name == null) return false;
+    final String value = name.getValue();
+    if (value == null) return false;
+    final String localName = XmlUtil.findLocalNameByQualifiedName(value);
+    return typeName.equals(localName) && nsPrefix.equals(XmlUtil.findPrefixByQualifiedName(value));
+  }
+
+  public static boolean isTypeElement(XmlTagImpl xml) {
+    final String localName = xml.getLocalName();
+    return XmlUtil.XML_SCHEMA_URI.equals(xml.getNamespace()) && ("complexType".equals(localName) || "simpleType".equals(localName));
+  }
+
+  private Collection<SchemaTypeInfo> gatherInheritors(XmlTagImpl xml) {
+    XmlAttribute name = getNameAttr(xml);
+    if (name == null || StringUtil.isEmptyOrSpaces(name.getValue())) return null;
+    String localName = name.getValue();
+    final boolean hasPrefix = localName.contains(":");
+    localName = hasPrefix ? localName.substring(localName.indexOf(':') + 1) : localName;
+    final String nsPrefix = hasPrefix ? name.getValue().substring(0, name.getValue().indexOf(':')) : null;
+
+    final XmlFile file = XmlUtil.getContainingFile(xml);
+    if (file == null) return null;
+    final Project project = file.getProject();
+    if (project == null) return null;
+
+    final Set<SchemaTypeInfo> result = new HashSet<SchemaTypeInfo>();
+    final ArrayDeque<SchemaTypeInfo> queue = new ArrayDeque<SchemaTypeInfo>();
+
+    String nsUri;
+    if (! hasPrefix) {
+      nsUri = getDefaultNs(file);
+    } else {
+      nsUri = XmlUtil.findNamespaceByPrefix(nsPrefix, file.getRootTag());
+    }
+    if (nsUri == null) return null;
+
+    queue.add(new SchemaTypeInfo(localName, true, nsUri));
+
+    final PairConvertor<String,String,List<Set<SchemaTypeInfo>>> worker =
+      SchemaTypeInheritanceIndex.getWorker(project, file.getContainingFile().getVirtualFile());
+    while (! queue.isEmpty()) {
+      final SchemaTypeInfo info = queue.removeFirst();
+      final List<Set<SchemaTypeInfo>> childrenOfType = worker.convert(info.getNamespaceUri(), info.getTagName());
+      for (Set<SchemaTypeInfo> infos : childrenOfType) {
+        for (SchemaTypeInfo typeInfo : infos) {
+          if (typeInfo.isIsTypeName()) {
+            queue.add(typeInfo);
+          }
+          result.add(typeInfo);
+        }
+      }
+    }
+    return result;
+  }
+
+  public static XmlAttribute getNameAttr(XmlTagImpl xml) {
+    XmlAttribute name = xml.getAttribute("name", XmlUtil.XML_SCHEMA_URI);
+    name = name == null ? xml.getAttribute("name") : name;
+    return name;
+  }
+
+  private String getDefaultNs(final XmlFile file) {
+    return ApplicationManager.getApplication().runReadAction(new Computable<String>() {
+      @Override
+      public String compute() {
+        String nsUri;
+        final XmlTag tag = file.getDocument().getRootTag();
+        XmlAttribute xmlns = tag.getAttribute("xmlns", XmlUtil.XML_SCHEMA_URI);
+        xmlns = xmlns == null ? tag.getAttribute("xmlns") : xmlns;
+        nsUri = xmlns == null ? null : xmlns.getValue();
+        return nsUri;
+      }
+    });
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/SchemaNSDescriptor.java b/xml/impl/src/com/intellij/xml/impl/schema/SchemaNSDescriptor.java
new file mode 100644
index 0000000..c6a29de
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/SchemaNSDescriptor.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.codeInsight.daemon.Validator;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.HashMap;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class SchemaNSDescriptor extends XmlNSDescriptorImpl {
+  @NonNls private static final String MIN_OCCURS_ATTR_NAME = "minOccurs";
+  @NonNls private static final String MAX_OCCURS_ATTR_VALUE = "maxOccurs";
+  @NonNls private static final String MAX_OCCURS_ATTR_NAME = MAX_OCCURS_ATTR_VALUE;
+  @NonNls private static final String ID_ATTR_NAME = "id";
+  @NonNls private static final String REF_ATTR_NAME = "ref";
+  @NonNls private static final String DEFAULT_ATTR_NAME = "default";
+  @NonNls private static final String FIXED_ATTR_NAME = "fixed";
+
+  @NonNls private static final String NAME_ATTR_NAME = "name";
+
+  private static final Validator<XmlTag> ELEMENT_VALIDATOR = new Validator<XmlTag>() {
+    public void validate(@NotNull final XmlTag tag, @NotNull ValidationHost host) {
+      if (!isFromSchemaNs(tag)) return;
+      final boolean hasRefAttribute = tag.getAttributeValue(REF_ATTR_NAME) != null;
+
+      if (hasRefAttribute) {
+        for(XmlAttribute attr:tag.getAttributes()) {
+          final String name = attr.getName();
+
+          if (name.indexOf(':') == -1 &&
+              !MIN_OCCURS_ATTR_NAME.equals(name) &&
+              !MAX_OCCURS_ATTR_NAME.equals(name) &&
+              !ID_ATTR_NAME.equals(name) &&
+              !REF_ATTR_NAME.equals(name)) {
+            host.addMessage(
+              attr,
+              XmlBundle.message("xml.schema.validation.attr.not.allowed.with.ref", name),
+              ValidationHost.ERROR
+            );
+          }
+        }
+      }
+
+      final String minOccursValue = tag.getAttributeValue("minOccurs");
+      final String maxOccursValue = tag.getAttributeValue(MAX_OCCURS_ATTR_VALUE);
+
+      if (minOccursValue != null && maxOccursValue != null) {
+        try {
+          final int minOccurs = Integer.parseInt(minOccursValue);
+          final int maxOccurs = Integer.parseInt(maxOccursValue);
+          if (maxOccurs < minOccurs) {
+            host.addMessage(
+              tag.getAttribute(MAX_OCCURS_ATTR_VALUE, null).getValueElement(),
+              XmlBundle.message("xml.schema.validation.max.occurs.should.be.not.less.than.min.occurs"),
+              Validator.ValidationHost.ERROR
+            );
+          }
+        }
+        catch (NumberFormatException e) {
+          // this schema will be reported by xerces validation
+        }
+      }
+
+      if (!hasRefAttribute && tag.getAttributeValue(NAME_ATTR_NAME) == null) {
+        host.addMessage(
+          tag,
+          XmlBundle.message("xml.schema.validation.name.or.ref.should.present"),
+          Validator.ValidationHost.ERROR
+        );
+      }
+    }
+  };
+
+  private static final Validator<XmlTag> ATTRIBUTE_VALIDATOR = new Validator<XmlTag>() {
+    public void validate(@NotNull final XmlTag tag, @NotNull ValidationHost host) {
+      if (!isFromSchemaNs(tag)) return;
+
+      if (tag.getAttributeValue(REF_ATTR_NAME) == null && tag.getAttributeValue(NAME_ATTR_NAME) == null) {
+        host.addMessage(
+          tag,
+          XmlBundle.message("xml.schema.validation.name.or.ref.should.present"),
+          Validator.ValidationHost.ERROR
+        );
+      }
+
+      if (tag.getAttributeValue(DEFAULT_ATTR_NAME) != null && tag.getAttributeValue(FIXED_ATTR_NAME) != null) {
+        host.addMessage(
+          tag.getAttribute(DEFAULT_ATTR_NAME, null),
+          XmlBundle.message("xml.schema.validation.default.or.fixed.should.be.specified.but.not.both"),
+          Validator.ValidationHost.ERROR
+        );
+
+        host.addMessage(
+          tag.getAttribute(FIXED_ATTR_NAME, null),
+          XmlBundle.message("xml.schema.validation.default.or.fixed.should.be.specified.but.not.both"),
+          Validator.ValidationHost.ERROR
+        );
+      }
+    }
+  };
+
+  private static final XmlUtil.DuplicationInfoProvider<XmlTag> SCHEMA_ATTR_DUP_INFO_PROVIDER = new XmlUtil.DuplicationInfoProvider<XmlTag>() {
+    public String getName(@NotNull final XmlTag t) {
+      return t.getAttributeValue(NAME_ATTR_NAME);
+    }
+
+    @NotNull
+    public String getNameKey(@NotNull final XmlTag t, @NotNull String name) {
+      return name;
+    }
+
+    @NotNull
+    public PsiElement getNodeForMessage(@NotNull final XmlTag t) {
+      return t.getAttribute(NAME_ATTR_NAME, null).getValueElement();
+    }
+  };
+
+  private static final Validator<XmlTag> ELEMENT_AND_ATTR_VALIDATOR = new Validator<XmlTag>() {
+    public void validate(@NotNull final XmlTag tag, @NotNull ValidationHost host) {
+      if (!isFromSchemaNs(tag)) return;
+      final String nsPrefix = tag.getNamespacePrefix();
+      final XmlTag[] attrDeclTags = tag.findSubTags((nsPrefix.length() > 0 ? nsPrefix + ":" : "") + "attribute");
+
+      XmlUtil.doDuplicationCheckForElements(
+        attrDeclTags,
+        new HashMap<String, XmlTag>(attrDeclTags.length),
+        SCHEMA_ATTR_DUP_INFO_PROVIDER,
+        host
+      );
+
+      final XmlTag[] elementDeclTags = tag.findSubTags((nsPrefix.length() > 0 ? nsPrefix + ":" : "") + "element");
+
+      XmlUtil.doDuplicationCheckForElements(
+        elementDeclTags,
+        new HashMap<String, XmlTag>(elementDeclTags.length),
+        SCHEMA_ATTR_DUP_INFO_PROVIDER,
+        host
+      );
+    }
+  };
+
+  private static boolean isFromSchemaNs(final XmlTag tag) {
+    return XmlUtil.XML_SCHEMA_URI.equals(tag.getNamespace());
+  }
+
+  protected XmlElementDescriptor createElementDescriptor(final XmlTag tag) {
+    final XmlElementDescriptor descriptor = super.createElementDescriptor(tag);
+    String localName = tag.getAttributeValue(NAME_ATTR_NAME);
+    if (ELEMENT_TAG_NAME.equals(localName)) {
+      ((XmlElementDescriptorImpl)descriptor).setValidator(ELEMENT_VALIDATOR);
+    } else if (COMPLEX_TYPE_TAG_NAME.equals(localName) || SCHEMA_TAG_NAME.equals(localName) || SEQUENCE_TAG_NAME.equals(localName)) {
+      ((XmlElementDescriptorImpl)descriptor).setValidator(ELEMENT_AND_ATTR_VALIDATOR);
+    } else if (ATTRIBUTE_TAG_NAME.equals(localName)) {
+      ((XmlElementDescriptorImpl)descriptor).setValidator(ATTRIBUTE_VALIDATOR);
+    }
+    return descriptor;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/SimpleTypeDescriptor.java b/xml/impl/src/com/intellij/xml/impl/schema/SimpleTypeDescriptor.java
new file mode 100644
index 0000000..b6dc92d
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/SimpleTypeDescriptor.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.xml.XmlTag;
+
+/**
+ * @author Mike
+ */
+class SimpleTypeDescriptor extends TypeDescriptor {
+  public SimpleTypeDescriptor(XmlTag tag) {
+    super();
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/StdTypeDescriptor.java b/xml/impl/src/com/intellij/xml/impl/schema/StdTypeDescriptor.java
new file mode 100644
index 0000000..0893e23
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/StdTypeDescriptor.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.xml.XmlTag;
+
+/**
+ * @author Mike
+ */
+class StdTypeDescriptor extends TypeDescriptor {
+  public StdTypeDescriptor(String name) {
+    super();
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/TypeDescriptor.java b/xml/impl/src/com/intellij/xml/impl/schema/TypeDescriptor.java
new file mode 100644
index 0000000..0cfd6f7
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/TypeDescriptor.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+/**
+ * @author Mike
+ */
+public abstract class TypeDescriptor {
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/XmlAttributeDescriptorImpl.java b/xml/impl/src/com/intellij/xml/impl/schema/XmlAttributeDescriptorImpl.java
new file mode 100644
index 0000000..24591d3
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/XmlAttributeDescriptorImpl.java
@@ -0,0 +1,251 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.meta.PsiWritableMetaData;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.impl.BasicXmlAttributeDescriptor;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashSet;
+
+/**
+ * @author Mike
+ */
+public class XmlAttributeDescriptorImpl extends BasicXmlAttributeDescriptor implements PsiWritableMetaData {
+  private XmlTag myTag;
+  String myUse;
+  @NonNls
+  public static final String REQUIRED_ATTR_VALUE = "required";
+  @NonNls
+  public static final String QUALIFIED_ATTR_VALUE = "qualified";
+
+  public XmlAttributeDescriptorImpl(XmlTag tag) {
+    myTag = tag;
+    myUse = myTag.getAttributeValue("use");
+  }
+
+  public XmlAttributeDescriptorImpl() {}
+
+  public PsiElement getDeclaration(){
+    return myTag;
+  }
+
+  public String getName() {
+    return myTag.getAttributeValue("name");
+  }
+
+  public void init(PsiElement element){
+    myTag = (XmlTag) element;
+    myUse = myTag.getAttributeValue("use");
+  }
+
+  public Object[] getDependences(){
+    return ArrayUtil.EMPTY_OBJECT_ARRAY;
+  }
+
+  public boolean isRequired() {
+    return REQUIRED_ATTR_VALUE.equals(myUse);
+  }
+
+  public boolean isFixed() {
+    return myTag.getAttributeValue("fixed") != null;
+  }
+
+  private boolean hasSimpleSchemaType(@NonNls String type) {
+    final String attributeValue = getType();
+
+    if (attributeValue != null) {
+      if (attributeValue.endsWith(type)) {
+        final String namespacePrefix = myTag.getNamespacePrefix();
+
+        if (namespacePrefix.length() > 0) {
+          return attributeValue.equals(namespacePrefix+":"+type);
+        } else {
+          return attributeValue.equals(type);
+        }
+      }
+    }
+
+    return false;
+  }
+
+  @Nullable
+  public String getType() {
+    return myTag.getAttributeValue("type");
+  }
+
+  public boolean hasIdType() {
+    return hasSimpleSchemaType("ID");
+  }
+
+  public boolean hasIdRefType() {
+    return hasSimpleSchemaType("IDREF");
+  }
+
+  public String getDefaultValue() {
+    if (isFixed()) {
+      return myTag.getAttributeValue("fixed");
+    }
+
+    return myTag.getAttributeValue("default");
+  }
+
+  public boolean isEnumerated(@Nullable XmlElement context) {
+    final XmlElementDescriptorImpl elementDescriptor = (XmlElementDescriptorImpl)XmlUtil.findXmlDescriptorByType(
+      myTag,
+      context != null ?PsiTreeUtil.getContextOfType(context, XmlTag.class, true):null
+    );
+
+    if (elementDescriptor != null &&
+        elementDescriptor.getType() instanceof ComplexTypeDescriptor) {
+      final EnumerationData data = getEnumeratedValuesImpl(((ComplexTypeDescriptor)elementDescriptor.getType()).getDeclaration());
+      return data != null && data.exaustive;
+    }
+
+    return false;
+  }
+
+  public boolean isEnumerated() {
+    return isEnumerated(null);
+  }
+
+  public String[] getEnumeratedValues() {
+    return getEnumeratedValues(null);
+  }
+
+  public String[] getEnumeratedValues(XmlElement context) {
+    final XmlElementDescriptorImpl elementDescriptor = (XmlElementDescriptorImpl)XmlUtil.findXmlDescriptorByType(
+      myTag,
+      context != null ?PsiTreeUtil.getContextOfType(context, XmlTag.class, true):null
+    );
+
+    if (elementDescriptor!=null && elementDescriptor.getType() instanceof ComplexTypeDescriptor) {
+      final EnumerationData data = getEnumeratedValuesImpl(((ComplexTypeDescriptor)elementDescriptor.getType()).getDeclaration());
+      final String s = getDefaultValue();
+
+      if (s != null && s.length() > 0 && data == null) {
+        return new String[] {s};
+      }
+      return data != null? data.enumeratedValues:ArrayUtil.EMPTY_STRING_ARRAY;
+    }
+
+    final String namespacePrefix = myTag.getNamespacePrefix();
+    XmlTag type = myTag.findFirstSubTag(
+      ((namespacePrefix.length() > 0)?namespacePrefix+":":"")+"simpleType"
+    );
+
+    if (type != null) {
+      final EnumerationData data = getEnumeratedValuesImpl(type);
+      return data != null? data.enumeratedValues:ArrayUtil.EMPTY_STRING_ARRAY;
+    }
+
+    return ArrayUtil.EMPTY_STRING_ARRAY;
+  }
+
+  static class EnumerationData {
+    final String[] enumeratedValues;
+    final boolean exaustive;
+
+    EnumerationData(@NotNull String[] _values, boolean _exaustive) {
+      enumeratedValues = _values;
+      exaustive = _exaustive;
+    }
+  }
+
+  private static EnumerationData getEnumeratedValuesImpl(final XmlTag declaration) {
+    if ("boolean".equals(declaration.getAttributeValue("name"))) {
+      return new EnumerationData(new String[] {"true", "false"}, true);
+    }
+
+    final HashSet<String> variants = new HashSet<String>();
+    final boolean exaustive = XmlUtil.collectEnumerationValues(declaration, variants);
+
+    if (variants.size() > 0) {
+      return new EnumerationData(ArrayUtil.toStringArray(variants), exaustive);
+    }
+    return null;
+  }
+
+  public String getName(PsiElement context) {
+
+    if (context == null) {
+      return getName();
+    }
+    final String form = myTag.getAttributeValue("form");
+    boolean isQualifiedAttr = QUALIFIED_ATTR_VALUE.equals(form);
+
+    final XmlTag rootTag = (((XmlFile) myTag.getContainingFile())).getRootTag();
+    assert rootTag != null;
+    String targetNs = rootTag.getAttributeValue("targetNamespace");
+    XmlTag contextTag = (XmlTag)context;
+    String name = getName();
+
+    boolean attributeShouldBeQualified = false;
+
+    String contextNs = contextTag.getNamespace();
+    if (targetNs != null && !contextNs.equals(targetNs)) {
+      final XmlElementDescriptor xmlElementDescriptor = contextTag.getDescriptor();
+
+      if (xmlElementDescriptor instanceof XmlElementDescriptorImpl) {
+        final XmlElementDescriptorImpl elementDescriptor = (XmlElementDescriptorImpl)xmlElementDescriptor;
+        final TypeDescriptor type = elementDescriptor.getType();
+
+        if (type instanceof ComplexTypeDescriptor) {
+          final ComplexTypeDescriptor typeDescriptor = (ComplexTypeDescriptor)type;
+          attributeShouldBeQualified = typeDescriptor.canContainAttribute(targetNs, null) != ComplexTypeDescriptor.CanContainAttributeType.CanNotContain;
+        }
+
+        if (!attributeShouldBeQualified && contextNs.length() == 0 && targetNs.length() > 0) {
+          attributeShouldBeQualified = !targetNs.equals(elementDescriptor.getNamespace());
+        }
+      }
+    }
+
+    if (targetNs != null &&
+        ( isQualifiedAttr ||
+          QUALIFIED_ATTR_VALUE.equals(rootTag.getAttributeValue("attributeFormDefault")) ||
+          attributeShouldBeQualified
+        )
+      ) {
+      final String prefixByNamespace = contextTag.getPrefixByNamespace(targetNs);
+      if (prefixByNamespace!= null && prefixByNamespace.length() > 0) {
+        name = prefixByNamespace + ":" + name;
+      }
+    }
+
+    return name;
+  }
+
+  public void setName(String name) throws IncorrectOperationException {
+    NamedObjectDescriptor.setName(myTag, name);
+  }
+
+  @Override
+  public String toString() {
+    return getName();
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorByType.java b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorByType.java
new file mode 100644
index 0000000..1289008
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorByType.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+
+/**
+ * @author ik
+ */
+public class XmlElementDescriptorByType extends XmlElementDescriptorImpl {
+  private ComplexTypeDescriptor myType;
+  @NonNls
+  public static final String QUALIFIED_ATTR_VALUE = "qualified";
+
+  public XmlElementDescriptorByType(XmlTag instanceTag, ComplexTypeDescriptor descriptor) {
+    myDescriptorTag = instanceTag;
+    myType = descriptor;
+  }
+
+  public XmlElementDescriptorByType() {}
+
+  public PsiElement getDeclaration(){
+    return myDescriptorTag;
+  }
+
+  public String getName(PsiElement context){
+    return myDescriptorTag.getName();
+  }
+
+  public XmlNSDescriptor getNSDescriptor() {
+    XmlNSDescriptor nsDescriptor = NSDescriptor;
+    if (nsDescriptor ==null) {
+      final XmlFile file = XmlUtil.getContainingFile(getType(null).getDeclaration());
+      if(file == null) return null;
+      final XmlDocument document = file.getDocument();
+      if(document == null) return null;
+      NSDescriptor = nsDescriptor = (XmlNSDescriptor)document.getMetaData();
+    }
+
+    return nsDescriptor;
+  }
+
+  public ComplexTypeDescriptor getType(XmlElement context) {
+    return myType;
+  }
+
+  public String getDefaultName() {
+    XmlTag rootTag = ((XmlFile)getType(null).getDeclaration().getContainingFile()).getDocument().getRootTag();
+
+    if (QUALIFIED_ATTR_VALUE.equals(rootTag.getAttributeValue("elementFormDefault"))) {
+      return getQualifiedName();
+    }
+
+    return getName();
+  }
+  
+  protected boolean askParentDescriptorViaXsi() {
+    return false;
+  }
+
+  public boolean equals(final Object o) {
+    if (this == o) return true;
+    if (!(o instanceof XmlElementDescriptorByType)) return false;
+
+    final XmlElementDescriptorByType that = (XmlElementDescriptorByType)o;
+
+    if (myType != null ? !myType.equals(that.myType) : that.myType != null) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    return (myType != null ? myType.hashCode() : 0);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java
new file mode 100644
index 0000000..6434705
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java
@@ -0,0 +1,532 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.codeInsight.daemon.Validator;
+import com.intellij.openapi.util.Key;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.meta.PsiWritableMetaData;
+import com.intellij.psi.util.*;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.*;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Mike
+ */
+public class XmlElementDescriptorImpl implements XmlElementDescriptor, PsiWritableMetaData, Validator<XmlTag>,
+                                                 XmlElementDescriptorAwareAboutChildren {
+  protected XmlTag myDescriptorTag;
+  protected volatile XmlNSDescriptor NSDescriptor;
+  private volatile @Nullable Validator<XmlTag> myValidator;
+
+  @NonNls
+  public static final String QUALIFIED_ATTR_VALUE = "qualified";
+  @NonNls
+  public static final String NONQUALIFIED_ATTR_VALUE = "unqualified";
+  @NonNls
+  private static final String ELEMENT_FORM_DEFAULT = "elementFormDefault";
+  private static final Key<ParameterizedCachedValue<XmlAttributeDescriptor[], XmlTag>> ATTRS_KEY = Key.create("attributes");
+  private ParameterizedCachedValueProvider<XmlAttributeDescriptor[],XmlTag> myCachedValueProvider;
+
+  public XmlElementDescriptorImpl(@Nullable XmlTag descriptorTag) {
+    myDescriptorTag = descriptorTag;
+  }
+
+  public XmlElementDescriptorImpl() {}
+
+  public PsiElement getDeclaration(){
+    return myDescriptorTag;
+  }
+
+  public String getName(PsiElement context){
+    String value = myDescriptorTag.getAttributeValue("name");
+
+    if(context instanceof XmlElement){
+      final String namespace = getNamespaceByContext(context);
+      final XmlTag tag = PsiTreeUtil.getParentOfType(context, XmlTag.class, false);
+
+      if(tag != null){
+        final String namespacePrefix = tag.getPrefixByNamespace(namespace);
+
+        if (namespacePrefix != null && namespacePrefix.length() > 0) {
+          final XmlTag rootTag = ((XmlFile)myDescriptorTag.getContainingFile()).getRootTag();
+          String elementFormDefault;
+
+          if (rootTag != null && 
+              ( NONQUALIFIED_ATTR_VALUE.equals(elementFormDefault = rootTag.getAttributeValue(ELEMENT_FORM_DEFAULT)) || elementFormDefault == null /*unqualified is default*/) &&
+              tag.getNamespaceByPrefix("").isEmpty()
+            && myDescriptorTag.getParentTag() != rootTag
+             ) {
+            value = XmlUtil.findLocalNameByQualifiedName(value);
+          } else {
+            value = namespacePrefix + ":" + XmlUtil.findLocalNameByQualifiedName(value);
+          }
+        }
+      }
+    }
+    return value;
+  }
+
+  /** getter for _local_ name */
+  public String getName() {
+    return XmlUtil.findLocalNameByQualifiedName(getName(null));
+  }
+
+  public String getNamespaceByContext(PsiElement context){
+    //while(context != null){
+    //  if(context instanceof XmlTag){
+    //    final XmlTag contextTag = ((XmlTag)context);
+    //    final XmlNSDescriptorImpl schemaDescriptor = XmlUtil.findXmlNSDescriptorByType(contextTag);
+    //    if (schemaDescriptor != null) {
+    //      return schemaDescriptor.getDefaultNamespace();
+    //    }
+    //  }
+    //  context = context.getContext();
+    //}
+    return getNamespace();
+  }
+
+  public String getNamespace(){
+    String name = getName();
+    if (name == null) return XmlUtil.EMPTY_URI;
+    final String namespacePrefix = XmlUtil.findPrefixByQualifiedName(name);
+    final XmlNSDescriptorImpl xmlNSDescriptor = (XmlNSDescriptorImpl)getNSDescriptor();
+    if(xmlNSDescriptor == null || myDescriptorTag == null) return XmlUtil.EMPTY_URI;
+    return "".equals(namespacePrefix) ?
+           xmlNSDescriptor.getDefaultNamespace() :
+           myDescriptorTag.getNamespaceByPrefix(namespacePrefix);
+  }
+
+  public void init(PsiElement element){
+    if (myDescriptorTag!=element && myDescriptorTag!=null) {
+      NSDescriptor = null;
+    }
+    myDescriptorTag = (XmlTag) element;
+  }
+
+  public Object[] getDependences(){
+    return new Object[]{myDescriptorTag};
+  }
+
+  private XmlNSDescriptor getNSDescriptor(XmlElement context) {
+    XmlNSDescriptor nsDescriptor = getNSDescriptor();
+    if (context instanceof XmlTag && nsDescriptor instanceof XmlNSDescriptorImpl) {
+      final String defaultNamespace = ((XmlNSDescriptorImpl)nsDescriptor).getDefaultNamespace();
+      if (XmlUtil.XML_SCHEMA_URI.equals(defaultNamespace)) return nsDescriptor; // do not check for overriden for efficiency
+
+      final XmlTag tag = (XmlTag)context;
+      final String tagNs = tag.getNamespace();
+      if (tagNs.equals(defaultNamespace)) {
+        XmlNSDescriptor previousDescriptor = nsDescriptor;
+        nsDescriptor = tag.getNSDescriptor(tagNs, true);
+        if (nsDescriptor == null) nsDescriptor = previousDescriptor;
+      }
+    }
+    
+    return nsDescriptor;
+  }
+
+  public XmlNSDescriptor getNSDescriptor() {
+    XmlNSDescriptor nsDescriptor = NSDescriptor;
+    if (nsDescriptor == null || !NSDescriptor.getDeclaration().isValid()) {
+      final XmlFile file = XmlUtil.getContainingFile(getDeclaration());
+      if(file == null) return null;
+      final XmlDocument document = file.getDocument();
+      if(document == null) return null;
+      NSDescriptor = nsDescriptor = (XmlNSDescriptor)document.getMetaData();
+    }
+
+    return nsDescriptor;
+  }
+
+  @Override
+  public XmlElementsGroup getTopGroup() {
+    TypeDescriptor type = getType();
+    return type instanceof ComplexTypeDescriptor ? ((ComplexTypeDescriptor)type).getTopGroup() : null;
+  }
+
+  @Nullable
+  public TypeDescriptor getType() {
+    return getType(null);
+  }
+
+  @Nullable
+  public TypeDescriptor getType(XmlElement context) {
+    final XmlNSDescriptor nsDescriptor = getNSDescriptor(context);
+    if (!(nsDescriptor instanceof XmlNSTypeDescriptorProvider)) return null;
+
+    TypeDescriptor type = ((XmlNSTypeDescriptorProvider) nsDescriptor).getTypeDescriptor(myDescriptorTag);
+    if (type == null) {
+      String substAttr = myDescriptorTag.getAttributeValue("substitutionGroup");
+      if (substAttr != null) {
+        final String namespacePrefix = XmlUtil.findPrefixByQualifiedName(substAttr);
+        final String namespace = "".equals(namespacePrefix) ?
+                                 ((XmlNSDescriptorImpl)getNSDescriptor()).getDefaultNamespace() :
+                                 myDescriptorTag.getNamespaceByPrefix(namespacePrefix);
+        final String local = XmlUtil.findLocalNameByQualifiedName(substAttr);
+        final XmlElementDescriptorImpl originalElement = (XmlElementDescriptorImpl)((XmlNSDescriptorImpl)getNSDescriptor()).getElementDescriptor(local, namespace);
+        if (originalElement != null) {
+          type = originalElement.getType(context);
+        }
+      }
+    }
+    return type;
+  }
+
+  public XmlElementDescriptor[] getElementsDescriptors(XmlTag context) {
+    if (context != null) {
+      final XmlElementDescriptor parentDescriptorByType = XmlUtil.findXmlDescriptorByType(context);
+      if (parentDescriptorByType != null && !parentDescriptorByType.equals(this)) {
+        return parentDescriptorByType.getElementsDescriptors(context);
+      }
+    }
+
+    XmlElementDescriptor[] elementsDescriptors = getElementsDescriptorsImpl(context);
+
+    final TypeDescriptor type = getType(context);
+
+    if (type instanceof ComplexTypeDescriptor) {
+      final ComplexTypeDescriptor descriptor = (ComplexTypeDescriptor)type;
+      String contextNs;
+      PsiFile containingFile = context != null ? context.getContainingFile():null;
+
+      if (context != null && !containingFile.isPhysical()) {
+        containingFile = containingFile.getOriginalFile();
+        //context = context.getParentTag();
+      }
+
+      if (context != null &&
+          ( descriptor.canContainTag(context.getLocalName(), contextNs = context.getNamespace(), context ) &&
+            (!contextNs.equals(getNamespace()) || descriptor.hasAnyInContentModel())
+          ) ) {
+        final XmlNSDescriptor nsDescriptor = getNSDescriptor();
+
+        if (nsDescriptor != null) {
+          elementsDescriptors = ArrayUtil.mergeArrays(
+            elementsDescriptors,
+            nsDescriptor.getRootElementsDescriptors(((XmlFile)containingFile).getDocument())
+          );
+        }
+      }
+    }
+
+    return elementsDescriptors;
+  }
+
+  private XmlElementDescriptor[] getElementsDescriptorsImpl(XmlElement context) {
+    TypeDescriptor type = getType(context);
+
+    if (type instanceof ComplexTypeDescriptor) {
+      ComplexTypeDescriptor typeDescriptor = (ComplexTypeDescriptor)type;
+
+      return typeDescriptor.getElements(context);
+    }
+
+    return EMPTY_ARRAY;
+  }
+
+  public XmlAttributeDescriptor[] getAttributesDescriptors(final XmlTag context) {
+
+    TypeDescriptor type = getType(context);
+
+    if (type instanceof ComplexTypeDescriptor) {
+      ComplexTypeDescriptor typeDescriptor = (ComplexTypeDescriptor)type;
+      XmlAttributeDescriptor[] attributeDescriptors = typeDescriptor.getAttributes(context);
+
+      if (context != null) {
+        final String contextNs = context.getNamespace();
+
+        boolean seenXmlNs = false;
+        for(String ns:context.knownNamespaces()) {
+          if (!contextNs.equals(ns) && ns.length() > 0) {
+            seenXmlNs |= XmlUtil.XML_NAMESPACE_URI.equals(ns);
+            attributeDescriptors = updateAttributeDescriptorsFromAny(context, typeDescriptor, attributeDescriptors, ns);
+          }
+        }
+
+        if (!seenXmlNs) {
+          attributeDescriptors = updateAttributeDescriptorsFromAny(context, typeDescriptor, attributeDescriptors, XmlUtil.XML_NAMESPACE_URI);
+        }
+      }
+      return attributeDescriptors;
+    }
+
+    return XmlAttributeDescriptor.EMPTY;
+  }
+
+  /** <xsd:anyAttribute> directive processed here */
+  private static XmlAttributeDescriptor[] updateAttributeDescriptorsFromAny(final XmlTag context,
+                                                                            final ComplexTypeDescriptor typeDescriptor,
+                                                                            XmlAttributeDescriptor[] attributeDescriptors,
+                                                                            final String ns) {
+    if (typeDescriptor.canContainAttribute(ns, null) != ComplexTypeDescriptor.CanContainAttributeType.CanNotContain) {
+      // anyAttribute found
+      final XmlNSDescriptor descriptor = context.getNSDescriptor(ns, true);
+
+      if (descriptor instanceof XmlNSDescriptorImpl) {
+        XmlAttributeDescriptor[] rootDescriptors = ((XmlNSDescriptorImpl)descriptor).getRootAttributeDescriptors(context);
+        attributeDescriptors = ArrayUtil.mergeArrays(attributeDescriptors, rootDescriptors);
+      }
+    }
+    return attributeDescriptors;
+  }
+
+  public XmlAttributeDescriptor getAttributeDescriptor(String attributeName, final XmlTag context){
+    return getAttributeDescriptorImpl(attributeName,context);
+  }
+
+  @Nullable
+  private XmlAttributeDescriptor getAttributeDescriptorImpl(final String attributeName, XmlTag context) {
+    final String localName = XmlUtil.findLocalNameByQualifiedName(attributeName);
+    final String namespacePrefix = XmlUtil.findPrefixByQualifiedName(attributeName);
+    final XmlNSDescriptorImpl xmlNSDescriptor = (XmlNSDescriptorImpl)getNSDescriptor();
+    final String namespace = namespacePrefix != null && namespacePrefix.isEmpty() ?
+                             ((xmlNSDescriptor != null)?xmlNSDescriptor.getDefaultNamespace():"") :
+                             context.getNamespaceByPrefix(namespacePrefix);
+
+    XmlAttributeDescriptor attribute = getAttribute(localName, namespace, context, attributeName);
+    
+    if (attribute instanceof AnyXmlAttributeDescriptor && namespace.length() > 0) {
+      final XmlNSDescriptor candidateNSDescriptor = context.getNSDescriptor(namespace, true);
+
+      if (candidateNSDescriptor instanceof XmlNSDescriptorImpl) {
+        final XmlNSDescriptorImpl nsDescriptor = (XmlNSDescriptorImpl)candidateNSDescriptor;
+
+        final XmlAttributeDescriptor xmlAttributeDescriptor = nsDescriptor.getAttribute(localName, namespace, context);
+        if (xmlAttributeDescriptor != null) return xmlAttributeDescriptor;
+        else {
+          final ComplexTypeDescriptor.CanContainAttributeType containAttributeType =
+            ((AnyXmlAttributeDescriptor)attribute).getCanContainAttributeType();
+          if (containAttributeType == ComplexTypeDescriptor.CanContainAttributeType.CanContainButDoNotSkip) {
+            attribute = null;
+          }
+        }
+      }
+    }
+    return attribute;
+  }
+
+  public XmlAttributeDescriptor getAttributeDescriptor(XmlAttribute attribute){
+    return getAttributeDescriptorImpl(attribute.getName(),attribute.getParent());
+  }
+
+  @Nullable
+  private XmlAttributeDescriptor getAttribute(String attributeName, String namespace, XmlTag context, String qName) {
+    XmlAttributeDescriptor[] descriptors = getAttributesDescriptors(context);
+
+    for (XmlAttributeDescriptor descriptor : descriptors) {
+      if (descriptor.getName().equals(attributeName) &&
+          descriptor.getName(context).equals(qName)
+         ) {
+        return descriptor;
+      }
+    }
+
+    TypeDescriptor type = getType(context);
+    if (type instanceof ComplexTypeDescriptor) {
+      ComplexTypeDescriptor descriptor = (ComplexTypeDescriptor)type;
+      final ComplexTypeDescriptor.CanContainAttributeType containAttributeType = descriptor.canContainAttribute(namespace, qName);
+
+      if (containAttributeType != ComplexTypeDescriptor.CanContainAttributeType.CanNotContain) {
+        return new AnyXmlAttributeDescriptor(attributeName, containAttributeType);
+      }
+    }
+
+    return null;
+  }
+
+  public int getContentType() {
+    TypeDescriptor type = getType();
+
+    if (type instanceof ComplexTypeDescriptor) {
+      return ((ComplexTypeDescriptor)type).getContentType();
+    }
+
+    return CONTENT_TYPE_MIXED;
+  }
+
+  @Override
+  public String getDefaultValue() {
+    return myDescriptorTag.getAttributeValue("default");
+  }
+
+  @Nullable
+  public XmlElementDescriptor getElementDescriptor(final String name) {
+      final String localName = XmlUtil.findLocalNameByQualifiedName(name);
+      final String namespacePrefix = XmlUtil.findPrefixByQualifiedName(name);
+      final String namespace = "".equals(namespacePrefix) ?
+                               ((XmlNSDescriptorImpl)getNSDescriptor()).getDefaultNamespace() :
+                               myDescriptorTag.getNamespaceByPrefix(namespacePrefix);
+    return getElementDescriptor(localName, namespace, null, name);
+  }
+
+  @Nullable
+  protected XmlElementDescriptor getElementDescriptor(final String localName, final String namespace, XmlElement context, String fullName) {
+    XmlElementDescriptor[] elements = getElementsDescriptorsImpl(context);
+
+    for (XmlElementDescriptor element1 : elements) {
+      final XmlElementDescriptorImpl element = (XmlElementDescriptorImpl)element1;
+      final String namespaceByContext = element.getNamespaceByContext(context);
+
+      if (element.getName().equals(localName)) {
+        if (namespace == null ||
+            namespace.equals(namespaceByContext) ||
+            namespaceByContext.equals(XmlUtil.EMPTY_URI) ||
+            element.getName(context).equals(fullName) || (namespace.length() == 0) &&
+                                                         element.getDefaultName().equals(fullName)
+           ) {
+          return element;
+        }
+        else {
+          final XmlNSDescriptor descriptor = context instanceof XmlTag? ((XmlTag)context).getNSDescriptor(namespace, true) : null;
+
+          // schema's targetNamespace could be different from file systemId used as NS
+          if (descriptor instanceof XmlNSDescriptorImpl &&
+              ((XmlNSDescriptorImpl)descriptor).getDefaultNamespace().equals(namespaceByContext)
+             ) {
+            return element;
+          }
+        }
+      }
+    }
+
+    TypeDescriptor type = getType(context);
+    if (type instanceof ComplexTypeDescriptor) {
+      ComplexTypeDescriptor descriptor = (ComplexTypeDescriptor)type;
+      if (descriptor.canContainTag(localName, namespace, context)) {
+        return new AnyXmlElementDescriptor(this, getNSDescriptor());
+      }
+    }
+
+    return null;
+  }
+
+  public XmlElementDescriptor getElementDescriptor(XmlTag element, XmlTag contextTag){
+    final XmlElement context = (XmlElement)element.getParent();
+
+    XmlElementDescriptor elementDescriptor = getElementDescriptor(
+      element.getLocalName(),
+      element.getNamespace(), context,
+      element.getName()
+    );
+
+    if(elementDescriptor == null || element.getAttributeValue("xsi:type") != null){
+      final XmlElementDescriptor xmlDescriptorByType = XmlUtil.findXmlDescriptorByType(element);
+
+      if (xmlDescriptorByType != null) elementDescriptor = xmlDescriptorByType;
+      else if (context instanceof XmlTag && ((XmlTag)context).getAttributeValue("xsi:type") != null && askParentDescriptorViaXsi()) {
+        final XmlElementDescriptor parentXmlDescriptorByType = XmlUtil.findXmlDescriptorByType(((XmlTag)context));
+        if (parentXmlDescriptorByType != null) {
+          elementDescriptor = parentXmlDescriptorByType.getElementDescriptor(element, contextTag);
+        }
+      }
+    }
+    return elementDescriptor;
+  }
+
+  protected boolean askParentDescriptorViaXsi() {
+    return true;
+  }
+
+  public String getQualifiedName() {
+    if (!"".equals(getNS())) {
+      return getNS() + ":" + getName();
+    }
+
+    return getName();
+  }
+
+  @Nullable
+  private String getNS(){
+    return XmlUtil.findNamespacePrefixByURI((XmlFile) myDescriptorTag.getContainingFile(), getNamespace());
+  }
+
+  public String getDefaultName() {
+    final PsiFile psiFile = myDescriptorTag.getContainingFile();
+    XmlTag rootTag = psiFile instanceof XmlFile ?((XmlFile)psiFile).getRootTag():null;
+
+    if (rootTag != null && QUALIFIED_ATTR_VALUE.equals(rootTag.getAttributeValue(ELEMENT_FORM_DEFAULT))) {
+      return getQualifiedName();
+    }
+
+    return getName();
+  }
+
+  public boolean isAbstract() {
+    return isAbstractDeclaration(myDescriptorTag);
+  }
+
+  public static Boolean isAbstractDeclaration(final XmlTag descriptorTag) {
+    return Boolean.valueOf(descriptorTag.getAttributeValue("abstract"));
+  }
+
+  public void setName(String name) throws IncorrectOperationException {
+    NamedObjectDescriptor.setName(myDescriptorTag, name);
+  }
+
+  public void setValidator(final Validator<XmlTag> validator) {
+    myValidator = validator;
+  }
+
+  public void validate(@NotNull XmlTag context, @NotNull ValidationHost host) {
+    Validator<XmlTag> validator = myValidator;
+    if (validator != null) {
+      validator.validate(context, host);
+    }
+  }
+
+  public boolean allowElementsFromNamespace(final String namespace, final XmlTag context) {
+    final TypeDescriptor type = getType(context);
+    
+    if (type instanceof ComplexTypeDescriptor) {
+      final ComplexTypeDescriptor typeDescriptor = (ComplexTypeDescriptor)type;
+      return typeDescriptor.canContainTag("a", namespace, context) ||
+             typeDescriptor.getNsDescriptors().hasSubstitutions() ||
+             XmlUtil.nsFromTemplateFramework(namespace)
+        ;
+    }
+    return false;
+  }
+
+  @Override
+  public String toString() {
+    return getName() + " (" + getNamespace() + ")";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    XmlElementDescriptorImpl that = (XmlElementDescriptorImpl)o;
+
+    if (myDescriptorTag != null ? !myDescriptorTag.equals(that.myDescriptorTag) : that.myDescriptorTag != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return myDescriptorTag != null ? myDescriptorTag.hashCode() : 0;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/XmlElementsGroupBase.java b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementsGroupBase.java
new file mode 100644
index 0000000..0280f97
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementsGroupBase.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlElementsGroup;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public abstract class XmlElementsGroupBase implements XmlElementsGroup {
+
+  protected final XmlTag myTag;
+  private final XmlElementsGroup myParent;
+  private final XmlTag myRef;
+
+  public XmlElementsGroupBase(XmlTag tag, XmlElementsGroup parent, XmlTag ref) {
+    myTag = tag;
+    myParent = parent;
+    myRef = ref;
+  }
+
+  @Override
+  public int getMinOccurs() {
+    return getMinOccursImpl(myRef) * getMinOccursImpl(myTag);
+  }
+
+  private static int getMinOccursImpl(XmlTag tag) {
+    if (tag == null) return 1;
+    String value = tag.getAttributeValue("minOccurs");
+    try {
+      return value == null ? 1 : Integer.parseInt(value);
+    }
+    catch (NumberFormatException e) {
+      return 1;
+    }
+  }
+
+  @Override
+  public int getMaxOccurs() {
+    return getMaxOccursImpl(myRef) * getMaxOccursImpl(myTag);
+  }
+
+  private static int getMaxOccursImpl(XmlTag tag) {
+    if (tag == null) return 1;
+    String value = tag.getAttributeValue("maxOccurs");
+    if (value == null) return 1;
+    if ("unbounded".equals(value)) return Integer.MAX_VALUE;
+    try {
+      return Integer.parseInt(value);
+    }
+    catch (NumberFormatException e) {
+      return 1;
+    }
+  }
+
+  @Override
+  public XmlElementsGroup getParentGroup() {
+    return myParent;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/XmlElementsGroupImpl.java b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementsGroupImpl.java
new file mode 100644
index 0000000..a4ea363
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementsGroupImpl.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementsGroup;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlElementsGroupImpl extends XmlElementsGroupBase {
+
+  private final static Map<String, Type> TYPES = new HashMap<String, Type>();
+  static {
+    TYPES.put("sequence", Type.SEQUENCE);
+    TYPES.put("choice", Type.CHOICE);
+    TYPES.put("all", Type.ALL);
+    TYPES.put("group", Type.GROUP);
+  }
+
+  private final List<XmlElementsGroup> mySubGroups = new ArrayList<XmlElementsGroup>();
+
+  public XmlElementsGroupImpl(XmlTag tag, XmlElementsGroup parent, XmlTag ref) {
+    super(tag, parent, ref);
+  }
+
+  @Override
+  public Type getGroupType() {
+    return getTagType(myTag);
+  }
+
+  public static Type getTagType(XmlTag tag) {
+    return TYPES.get(tag.getLocalName());
+  }
+
+  @Override
+  public List<XmlElementsGroup> getSubGroups() {
+    return mySubGroups;
+  }
+
+  @Override
+  public XmlElementDescriptor getLeafDescriptor() {
+    throw new RuntimeException("not a leaf group");
+  }
+
+  public void addSubGroup(XmlElementsGroup group) {
+    mySubGroups.add(group);
+  }
+
+  @Override
+  public String toString() {
+    return getGroupType().toString();
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/XmlElementsGroupLeaf.java b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementsGroupLeaf.java
new file mode 100644
index 0000000..691f74d
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementsGroupLeaf.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementsGroup;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlElementsGroupLeaf extends XmlElementsGroupBase {
+
+  private final XmlElementDescriptor myDescriptor;
+
+  public XmlElementsGroupLeaf(XmlTag tag, XmlElementDescriptor descriptor, XmlElementsGroup parent, XmlTag ref) {
+    super(tag, parent, ref);
+    myDescriptor = descriptor;
+  }
+
+  @Override
+  public Type getGroupType() {
+    return Type.LEAF;
+  }
+
+  @Override
+  public List<XmlElementsGroup> getSubGroups() {
+    return Collections.emptyList();
+  }
+
+  @Override
+  public XmlElementDescriptor getLeafDescriptor() {
+    return myDescriptor;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/XmlElementsGroupProcessor.java b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementsGroupProcessor.java
new file mode 100644
index 0000000..e89ca81
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementsGroupProcessor.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlElementsGroup;
+
+import java.util.Stack;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlElementsGroupProcessor extends XmlSchemaTagsProcessor {
+
+  final Stack<XmlElementsGroup> myGroups = new Stack<XmlElementsGroup>();
+
+  public static XmlElementsGroup computeGroups(XmlNSDescriptorImpl descriptor, XmlTag tag) {
+    XmlElementsGroupProcessor processor = new XmlElementsGroupProcessor(descriptor);
+    processor.startProcessing(tag);
+    return processor.getRootGroup();
+  }
+
+  private XmlElementsGroup getRootGroup() {
+    return myGroups.get(0);
+  }
+
+  private XmlElementsGroupProcessor(XmlNSDescriptorImpl nsDescriptor) {
+    super(nsDescriptor, "attribute");
+    myGroups.push(new XmlElementsGroupImpl(null, null, null) {
+      @Override
+      public Type getGroupType() {
+        return Type.GROUP;
+      }
+
+      @Override
+      public String toString() {
+        return "root";
+      }
+    });
+  }
+
+  @Override
+  protected void tagStarted(XmlTag tag, String tagName, XmlTag context, XmlTag ref) {
+    XmlElementsGroup.Type type = XmlElementsGroupImpl.getTagType(tag);
+    if (type != null) {
+      XmlElementsGroupImpl group = new XmlElementsGroupImpl(tag, myGroups.peek(), ref);
+      addSubGroup(group);
+      myGroups.push(group);
+    }
+    else if ("element".equals(tagName)) {
+      XmlElementsGroup group = new XmlElementsGroupLeaf(tag, myNsDescriptor.createElementDescriptor(tag), myGroups.peek(), ref);
+      if (!myGroups.empty()) {
+        addSubGroup(group);
+      }
+      else {
+        myGroups.push(group);
+      }
+    }
+  }
+
+  @Override
+  protected void tagFinished(XmlTag tag) {
+    if (!myGroups.empty() && XmlElementsGroupImpl.getTagType(tag) != null) {
+      myGroups.pop();
+    }
+  }
+
+  private void addSubGroup(XmlElementsGroup group) {
+    if (!myGroups.empty()) {
+      XmlElementsGroup last = myGroups.peek();
+      if (last instanceof XmlElementsGroupImpl) {
+        ((XmlElementsGroupImpl)last).addSubGroup(group);
+      }
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/XmlNSDescriptorImpl.java b/xml/impl/src/com/intellij/xml/impl/schema/XmlNSDescriptorImpl.java
new file mode 100644
index 0000000..8c1582f
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/XmlNSDescriptorImpl.java
@@ -0,0 +1,1026 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.codeInsight.daemon.Validator;
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.DumbAware;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.XmlNSDescriptorEx;
+import com.intellij.xml.impl.ExternalDocumentValidator;
+import com.intellij.xml.util.XmlUtil;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+/**
+ * @author Mike
+ */
+@SuppressWarnings({"HardCodedStringLiteral"})
+public class XmlNSDescriptorImpl implements XmlNSDescriptorEx,Validator<XmlDocument>, DumbAware, XmlNSTypeDescriptorProvider {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.impl.schema.XmlNSDescriptorImpl");
+  @NonNls private static final Set<String> STD_TYPES = new HashSet<String>();
+  private static final Set<String> UNDECLARED_STD_TYPES = new HashSet<String>();
+  private XmlFile myFile;
+  private XmlTag myTag;
+  private String myTargetNamespace;
+  @NonNls
+  public static final String XSD_PREFIX = "xsd";
+  
+  @NonNls static final String ELEMENT_TAG_NAME = "element";
+  @NonNls static final String ATTRIBUTE_TAG_NAME = "attribute";
+  @NonNls static final String COMPLEX_TYPE_TAG_NAME = "complexType";
+  @NonNls static final String SEQUENCE_TAG_NAME = "sequence";
+  @NonNls static final String SCHEMA_TAG_NAME = "schema";
+  @NonNls private static final String INCLUDE_TAG_NAME = "include";
+  @NonNls private static final String IMPORT_TAG_NAME = "import";
+  @NonNls private static final String REDEFINE_TAG_NAME = "redefine";
+
+  public XmlNSDescriptorImpl(XmlFile file) {
+    init(file.getDocument());
+  }
+                                          
+  public XmlNSDescriptorImpl() {
+  }
+
+  private Object[] dependencies;
+
+  private static final ThreadLocal<Set<PsiFile>> myRedefinedDescriptorsInProcessing = new ThreadLocal<Set<PsiFile>>();
+
+  private static void collectDependencies(@Nullable XmlTag myTag, @NotNull XmlFile myFile, @NotNull Set<PsiFile> visited) {
+    if (visited.contains(myFile)) return;
+    visited.add( myFile );
+
+    if (myTag == null) return;
+    XmlTag[] tags = myTag.getSubTags();
+
+    for (final XmlTag tag : tags) {
+      if (equalsToSchemaName(tag, INCLUDE_TAG_NAME) ||
+          equalsToSchemaName(tag, IMPORT_TAG_NAME)
+        ) {
+        final XmlAttribute schemaLocation = tag.getAttribute("schemaLocation");
+        if (schemaLocation != null) {
+          final XmlFile xmlFile = XmlUtil.findNamespace(myFile, schemaLocation.getValue());
+          addDependency(xmlFile, visited);
+        }
+      } else if (equalsToSchemaName(tag, REDEFINE_TAG_NAME)) {
+        myRedefinedDescriptorsInProcessing.set(visited);
+        try {
+          final XmlFile file = getRedefinedElementDescriptorFile(tag);
+          addDependency(file, visited);
+        } finally {
+          myRedefinedDescriptorsInProcessing.set(null);
+        }
+      }
+    }
+
+    final String schemaLocationDeclaration = myTag.getAttributeValue("schemaLocation", XmlUtil.XML_SCHEMA_INSTANCE_URI);
+    if(schemaLocationDeclaration != null) {
+      final StringTokenizer tokenizer = new StringTokenizer(schemaLocationDeclaration);
+
+      while(tokenizer.hasMoreTokens()){
+        final String uri = tokenizer.nextToken();
+
+        if(tokenizer.hasMoreTokens()){
+          PsiFile resourceLocation = ExternalResourceManager.getInstance().getResourceLocation(tokenizer.nextToken(), myFile, null);
+          if (resourceLocation == null && uri != null) resourceLocation = ExternalResourceManager.getInstance().getResourceLocation(uri, myFile, null);
+
+          if (resourceLocation instanceof XmlFile) addDependency((XmlFile)resourceLocation, visited);
+        }
+      }
+    }
+  }
+
+  private static void addDependency(final XmlFile file, final Set<PsiFile> visited) {
+    if (file != null) {
+      final XmlDocument document = file.getDocument();
+      collectDependencies(document != null ? document.getRootTag():null, file, visited);
+    }
+  }
+
+  public XmlFile getDescriptorFile() {
+    return myFile;
+  }
+
+  public boolean isHierarhyEnabled() {
+    return true;
+  }
+
+  public String getDefaultNamespace(){
+    return myTargetNamespace != null ? myTargetNamespace : "";
+  }
+
+  static class QNameKey extends Pair<String, String>{
+     QNameKey(String name, String namespace) {
+      super(name, namespace);
+    }
+  }
+  private final Map<QNameKey, CachedValue<XmlElementDescriptor>> myDescriptorsMap = Collections.synchronizedMap(new HashMap<QNameKey, CachedValue<XmlElementDescriptor>>());
+  private final Map<Pair<QNameKey, XmlTag>, CachedValue<TypeDescriptor>> myTypesMap = Collections.synchronizedMap(new HashMap<Pair<QNameKey,XmlTag>, CachedValue<TypeDescriptor>>());
+
+  @Nullable
+  public XmlElementDescriptor getElementDescriptor(String localName, String namespace) {
+    return getElementDescriptor(localName, namespace, new HashSet<XmlNSDescriptorImpl>(),false);
+  }
+
+  @Nullable
+  public XmlElementDescriptor getElementDescriptor(String localName, String namespace, Set<XmlNSDescriptorImpl> visited, boolean reference) {
+    if(visited.contains(this)) return null;
+
+    final QNameKey pair = new QNameKey(namespace, localName);
+    final CachedValue<XmlElementDescriptor> descriptor = myDescriptorsMap.get(pair);
+    if(descriptor != null) {
+      final XmlElementDescriptor value = descriptor.getValue();
+      if (value == null || value.getDeclaration().isValid()) return value;
+    }
+
+    final XmlTag rootTag = myTag;
+    if (rootTag == null) return null;
+    XmlTag[] tags = rootTag.getSubTags();
+    visited.add( this );
+
+    LOG.assertTrue(rootTag.isValid());
+    for (final XmlTag tag : tags) {
+      if (equalsToSchemaName(tag, ELEMENT_TAG_NAME)) {
+        String name = tag.getAttributeValue("name");
+
+        if (name != null) {
+          if (checkElementNameEquivalence(localName, namespace, name, tag)) {
+            final CachedValue<XmlElementDescriptor> cachedValue = CachedValuesManager.getManager(tag.getProject()).createCachedValue(new CachedValueProvider<XmlElementDescriptor>() {
+                public Result<XmlElementDescriptor> compute() {
+                  final String name = tag.getAttributeValue("name");
+
+                  if (name != null && !name.equals(pair.second)) {
+                    myDescriptorsMap.remove(pair);
+                    return new Result<XmlElementDescriptor>(null);
+                  }
+                  final XmlElementDescriptor xmlElementDescriptor = createElementDescriptor(tag);
+                  return new Result<XmlElementDescriptor>(xmlElementDescriptor, xmlElementDescriptor.getDependences());
+                }
+              }, false);
+            myDescriptorsMap.put(pair, cachedValue);
+            return cachedValue.getValue();
+          }
+        }
+      }
+      else if (equalsToSchemaName(tag, INCLUDE_TAG_NAME) ||
+               (reference &&
+                equalsToSchemaName(tag, IMPORT_TAG_NAME) &&
+                ( namespace.equals(tag.getAttributeValue("namespace")) ||
+                  namespace.length() == 0 && tag.getAttributeValue("namespace") == null
+                )
+               )
+        ) {
+        final XmlAttribute schemaLocation = tag.getAttribute("schemaLocation");
+        if (schemaLocation != null) {
+          final XmlFile xmlFile = XmlUtil.findNamespace(rootTag.getContainingFile(), schemaLocation.getValue());
+          if (xmlFile != null) {
+            final XmlDocument includedDocument = xmlFile.getDocument();
+            if (includedDocument != null) {
+              final PsiMetaData data = includedDocument.getMetaData();
+              if (data instanceof XmlNSDescriptorImpl) {
+                final XmlElementDescriptor elementDescriptor =
+                  ((XmlNSDescriptorImpl)data).getElementDescriptor(localName, namespace, visited, reference);
+                if (elementDescriptor != null) {
+                  //final CachedValue<XmlElementDescriptor> value = includedDocument.getManager().getCachedValuesManager()
+                  //  .createCachedValue(new CachedValueProvider<XmlElementDescriptor>() {
+                  //    public Result<XmlElementDescriptor> compute() {
+                  //      return new Result<XmlElementDescriptor>(elementDescriptor, elementDescriptor.getDependences());
+                  //    }
+                  //  }, false);
+                  //return value.getValue();
+                  return elementDescriptor;
+                }
+              }
+            }
+          }
+        }
+      } else if (equalsToSchemaName(tag, REDEFINE_TAG_NAME)) {
+        final XmlNSDescriptorImpl nsDescriptor = getRedefinedElementDescriptor(tag);
+        if (nsDescriptor != null) {
+          final XmlElementDescriptor xmlElementDescriptor = nsDescriptor.getElementDescriptor(localName, namespace, visited, reference);
+          if (xmlElementDescriptor instanceof XmlElementDescriptorImpl) {
+            return new RedefinedElementDescriptor((XmlElementDescriptorImpl)xmlElementDescriptor, this);
+          }
+        }
+      }
+    }
+
+    return null;
+  }
+
+  protected XmlElementDescriptor createElementDescriptor(final XmlTag tag) {
+    return new XmlElementDescriptorImpl(tag);
+  }
+
+  private boolean checkElementNameEquivalence(String localName, String namespace, String fqn, XmlTag context){
+    final String localAttrName = XmlUtil.findLocalNameByQualifiedName(fqn);
+    if (!localAttrName.equals(localName)) return false;
+    final String attrNamespace = context.getNamespaceByPrefix(XmlUtil.findPrefixByQualifiedName(fqn));
+    if (attrNamespace.equals(namespace)) return true;
+
+    if(myTargetNamespace == null){
+      if(XmlUtil.EMPTY_URI.equals(attrNamespace))
+        return true;
+    }
+    else {
+      final boolean b = myTargetNamespace.equals(namespace);
+      if (b) return b;
+      return context.getNSDescriptor(namespace, true) == this; // schema's targetNamespace could be different from file systemId
+    }
+    return false;
+  }
+
+  @Nullable
+  public XmlAttributeDescriptor getAttribute(String localName, String namespace, final XmlTag context) {
+    return getAttributeImpl(localName, namespace, null);
+  }
+
+  @Nullable
+  private XmlAttributeDescriptor getAttributeImpl(String localName, String namespace, @Nullable Set<XmlTag> visited) {
+    if (myTag == null) return null;
+
+    XmlNSDescriptorImpl nsDescriptor = (XmlNSDescriptorImpl)myTag.getNSDescriptor(namespace, true);
+
+    if (nsDescriptor != this && nsDescriptor != null) {
+      return nsDescriptor.getAttributeImpl(
+        localName,
+        namespace,
+        visited
+      );
+    }
+
+    if (visited == null) visited = new HashSet<XmlTag>(1);
+    else if(visited.contains(myTag)) return null;
+    visited.add(myTag);
+    XmlTag[] tags = myTag.getSubTags();
+
+    for (XmlTag tag : tags) {
+      if (equalsToSchemaName(tag, ATTRIBUTE_TAG_NAME)) {
+        String name = tag.getAttributeValue("name");
+
+        if (name != null) {
+          if (checkElementNameEquivalence(localName, namespace, name, tag)) {
+            return createAttributeDescriptor(tag);
+          }
+        }
+      } else if (equalsToSchemaName(tag, INCLUDE_TAG_NAME) ||
+                 (equalsToSchemaName(tag, IMPORT_TAG_NAME) &&
+                  namespace.equals(tag.getAttributeValue("namespace"))
+                 )
+        ) {
+        final XmlAttribute schemaLocation = tag.getAttribute("schemaLocation");
+
+        if (schemaLocation != null) {
+          final XmlFile xmlFile = XmlUtil.findNamespace(myTag.getContainingFile(), schemaLocation.getValue());
+
+          if (xmlFile != null) {
+
+            final XmlDocument includedDocument = xmlFile.getDocument();
+            if (includedDocument != null) {
+              final PsiMetaData data = includedDocument.getMetaData();
+
+              if(data instanceof XmlNSDescriptorImpl){
+                final XmlAttributeDescriptor attributeDescriptor = ((XmlNSDescriptorImpl)data).getAttributeImpl(localName, namespace,visited);
+
+                if(attributeDescriptor != null){
+                  final CachedValue<XmlAttributeDescriptor> value = CachedValuesManager.getManager(includedDocument.getProject()).createCachedValue(
+                    new CachedValueProvider<XmlAttributeDescriptor>(){
+                      public Result<XmlAttributeDescriptor> compute() {
+                        return new Result<XmlAttributeDescriptor>(attributeDescriptor, attributeDescriptor.getDependences());
+                      }
+                    },
+                    false
+                  );
+                  return value.getValue();
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+
+    return null;
+  }
+
+  protected XmlAttributeDescriptorImpl createAttributeDescriptor(final XmlTag tag) {
+    return new XmlAttributeDescriptorImpl(tag);
+  }
+
+  public TypeDescriptor getTypeDescriptor(XmlTag descriptorTag) {
+    String type = descriptorTag.getAttributeValue("type");
+
+    if (type != null) {
+      return getTypeDescriptor(type, descriptorTag);
+    }
+
+    return findTypeDescriptorImpl(descriptorTag, null, null, null);
+  }
+
+  public TypeDescriptor getTypeDescriptor(final String name, XmlTag context) {
+    if(checkSchemaNamespace(name, context)){
+      final String localNameByQualifiedName = XmlUtil.findLocalNameByQualifiedName(name);
+      
+      if (STD_TYPES.contains(localNameByQualifiedName) &&
+          ( name.length() == localNameByQualifiedName.length() ||
+            UNDECLARED_STD_TYPES.contains(localNameByQualifiedName)
+          )
+         )
+        return new StdTypeDescriptor(localNameByQualifiedName);
+    }
+
+    return findTypeDescriptor(name, context);
+  }
+
+  @Nullable
+  public XmlElementDescriptor getDescriptorByType(String qName, XmlTag instanceTag){
+    if(myTag == null) return null;
+    final TypeDescriptor typeDescriptor = findTypeDescriptor(qName, instanceTag);
+    if(!(typeDescriptor instanceof ComplexTypeDescriptor)) return null;
+    return new XmlElementDescriptorByType(instanceTag, (ComplexTypeDescriptor)typeDescriptor);
+  }
+
+  private static boolean checkSchemaNamespace(String name, XmlTag context){
+    final String namespace = context.getNamespaceByPrefix(XmlUtil.findPrefixByQualifiedName(name));
+    if(namespace.length() > 0){
+      return checkSchemaNamespace(namespace);
+    }
+    return XSD_PREFIX.equals(XmlUtil.findPrefixByQualifiedName(name));
+  }
+
+  public static boolean checkSchemaNamespace(String namespace) {
+    return XmlUtil.XML_SCHEMA_URI.equals(namespace) ||
+           XmlUtil.XML_SCHEMA_URI2.equals(namespace) ||
+           XmlUtil.XML_SCHEMA_URI3.equals(namespace);
+  }
+
+  public static boolean checkSchemaNamespace(XmlTag context) {
+    LOG.assertTrue(context.isValid());
+    final String namespace = context.getNamespace();
+    if (namespace.length() > 0) {
+      return checkSchemaNamespace(namespace);
+    }
+    return StringUtil.startsWithConcatenationOf(context.getName(), XSD_PREFIX, ":");
+  }
+
+  static @NotNull XmlNSDescriptorImpl getNSDescriptorToSearchIn(XmlTag rootTag, final String name, XmlNSDescriptorImpl defaultNSDescriptor) {
+    if (name == null) return defaultNSDescriptor;
+    final String namespacePrefix = XmlUtil.findPrefixByQualifiedName(name);
+
+    if (namespacePrefix != null && namespacePrefix.length() > 0) {
+      final String namespace = rootTag.getNamespaceByPrefix(namespacePrefix);
+      final XmlNSDescriptor nsDescriptor = rootTag.getNSDescriptor(namespace, true);
+
+      if (nsDescriptor instanceof XmlNSDescriptorImpl) {
+        return (XmlNSDescriptorImpl)nsDescriptor;
+      }
+    }
+
+    return defaultNSDescriptor;
+  }
+
+  @Nullable
+  protected TypeDescriptor findTypeDescriptor(final String qname) {
+    return findTypeDescriptor(qname, myTag);
+  }
+
+  @Nullable
+  protected TypeDescriptor findTypeDescriptor(final String qname, XmlTag context) {
+    String namespace = context.getNamespaceByPrefix(XmlUtil.findPrefixByQualifiedName(qname));
+    return findTypeDescriptor(XmlUtil.findLocalNameByQualifiedName(qname), namespace);
+  }
+
+  @Nullable
+  private TypeDescriptor findTypeDescriptor(String localName, String namespace) {
+    return findTypeDescriptorImpl(myTag, localName, namespace, null);
+  }
+
+  @Nullable
+  protected TypeDescriptor findTypeDescriptorImpl(XmlTag rootTag, final String name, String namespace, Set<XmlTag> visited) {
+    XmlNSDescriptorImpl responsibleDescriptor = this;
+    if (namespace != null && namespace.length() != 0 && !namespace.equals(getDefaultNamespace())) {
+      final XmlNSDescriptor nsDescriptor = rootTag.getNSDescriptor(namespace, true);
+
+      if (nsDescriptor instanceof XmlNSDescriptorImpl) {
+        responsibleDescriptor = (XmlNSDescriptorImpl)nsDescriptor;
+      }
+    }
+
+    if (responsibleDescriptor != this) {
+      return responsibleDescriptor.findTypeDescriptor(XmlUtil.findLocalNameByQualifiedName(name));
+    }
+
+    if (rootTag == null) return null;
+    if (visited != null) {
+      if (visited.contains(rootTag)) return null;
+      visited.add(rootTag);
+    }
+
+    final Pair<QNameKey, XmlTag> pair = new Pair<QNameKey, XmlTag>(new QNameKey(name, namespace), rootTag);
+
+    final CachedValue<TypeDescriptor> descriptor = myTypesMap.get(pair);
+    if(descriptor != null) {
+      TypeDescriptor value = descriptor.getValue();
+      if (value == null ||
+          ( value instanceof ComplexTypeDescriptor &&
+            ((ComplexTypeDescriptor)value).getDeclaration().isValid()
+          )
+         )
+      return value;
+    }
+
+    XmlTag[] tags = rootTag.getSubTags();
+
+    if (visited == null) {
+      visited = new HashSet<XmlTag>(1);
+      visited.add(rootTag);
+    }
+
+    return doFindIn(tags, name, namespace, pair, rootTag, visited);
+  }
+
+  private TypeDescriptor doFindIn(final XmlTag[] tags, final String name, final String namespace, final Pair<QNameKey, XmlTag> pair, final XmlTag rootTag, final Set<XmlTag> visited) {
+    for (final XmlTag tag : tags) {
+      if (equalsToSchemaName(tag, "complexType")) {
+        if (name == null) {
+          CachedValue<TypeDescriptor> value = createAndPutTypesCachedValue(tag, pair);
+          return value.getValue();
+        }
+
+        String nameAttribute = tag.getAttributeValue("name");
+
+        if (isSameName(name, namespace, nameAttribute)) {
+          CachedValue<TypeDescriptor> cachedValue = createAndPutTypesCachedValue(tag, pair);
+          return cachedValue.getValue();
+        }
+      }
+      else if (equalsToSchemaName(tag, "simpleType")) {
+
+        if (name == null) {
+          CachedValue<TypeDescriptor> value = createAndPutTypesCachedValueSimpleType(tag, pair);
+          return value.getValue();
+        }
+
+        String nameAttribute = tag.getAttributeValue("name");
+
+        if (isSameName(name, namespace, nameAttribute)) {
+          CachedValue<TypeDescriptor> cachedValue = createAndPutTypesCachedValue(tag, pair);
+          return cachedValue.getValue();
+        }
+      }
+      else if (equalsToSchemaName(tag, INCLUDE_TAG_NAME) ||
+               ( equalsToSchemaName(tag, IMPORT_TAG_NAME) &&
+                 (namespace == null || !namespace.equals(getDefaultNamespace()))
+               )
+              ) {
+        final String schemaLocation = tag.getAttributeValue("schemaLocation");
+        if (schemaLocation != null) {
+          final XmlFile xmlFile = XmlUtil.findNamespace(rootTag.getContainingFile(), schemaLocation);
+
+          if (xmlFile != null) {
+            final XmlDocument document = xmlFile.getDocument();
+
+            if (document != null) {
+
+              final CachedValue<TypeDescriptor> value = CachedValuesManager.getManager(tag.getProject()).createCachedValue(new CachedValueProvider<TypeDescriptor>() {
+                  public Result<TypeDescriptor> compute() {
+                    final String currentName = tag.getAttributeValue("name");
+
+                    if (( currentName != null &&
+                          !currentName.equals(XmlUtil.findLocalNameByQualifiedName(name)) ) ||
+                         !xmlFile.isValid() ||
+                         xmlFile.getDocument() == null
+                       ) {
+                      myTypesMap.remove(pair);
+                      return new Result<TypeDescriptor>(null);
+                    }
+
+                    final XmlDocument document = xmlFile.getDocument();
+                    final XmlNSDescriptorImpl nsDescriptor = findNSDescriptor(tag, document);
+
+                    if (nsDescriptor == null) {
+                      myTypesMap.remove(pair);
+                      return new Result<TypeDescriptor>(null);
+                    }
+
+                    final XmlTag rTag = document.getRootTag();
+
+                    final TypeDescriptor complexTypeDescriptor = nsDescriptor.findTypeDescriptorImpl(rTag, name, namespace, visited);
+                    return new Result<TypeDescriptor>(complexTypeDescriptor, rTag);
+                  }
+                }, false
+              );
+
+              if (value.getValue() != null) {
+                myTypesMap.put(pair, value);
+                return value.getValue();
+              }
+            }
+          }
+        }
+      } else if (equalsToSchemaName(tag, REDEFINE_TAG_NAME)) {
+        final XmlTag[] subTags = tag.getSubTags();
+        TypeDescriptor descriptor = doFindIn(subTags, name, namespace, pair, rootTag, visited);
+        if (descriptor != null) return descriptor;
+
+        final XmlNSDescriptorImpl nsDescriptor = getRedefinedElementDescriptor(tag);
+        if (nsDescriptor != null) {
+          final XmlTag redefinedRootTag = ((XmlDocument)nsDescriptor.getDeclaration()).getRootTag();
+          descriptor = doFindIn(redefinedRootTag.getSubTags(), name, namespace, pair, redefinedRootTag, visited);
+          if (descriptor != null) return descriptor;
+        }
+      }
+    }
+    return null;
+  }
+
+  private boolean isSameName(@NotNull String name, String namespace, String nameAttribute) {
+    return nameAttribute != null &&
+           (nameAttribute.equals(name) || (name.indexOf(":") >= 0 && nameAttribute.equals(name.substring(name.indexOf(":") + 1)))) &&
+           (namespace == null || namespace.length() == 0 || namespace.equals(getDefaultNamespace()))
+      ;
+  }
+
+  private XmlNSDescriptorImpl findNSDescriptor(final XmlTag tag, final XmlDocument document) {
+    final XmlNSDescriptorImpl nsDescriptor;
+    if(IMPORT_TAG_NAME.equals(tag.getLocalName())) {
+      final XmlNSDescriptor importedDescriptor = (XmlNSDescriptor)document.getMetaData();
+      nsDescriptor = (importedDescriptor instanceof XmlNSDescriptorImpl) ?
+                     (XmlNSDescriptorImpl)importedDescriptor:
+                     this;
+    }
+    else {
+      nsDescriptor = this;
+    }
+    return nsDescriptor;
+  }
+
+  private CachedValue<TypeDescriptor> createAndPutTypesCachedValueSimpleType(final XmlTag tag, final Pair<QNameKey, XmlTag> pair) {
+    final CachedValue<TypeDescriptor> value = CachedValuesManager.getManager(tag.getProject()).createCachedValue(new CachedValueProvider<TypeDescriptor>() {
+      public CachedValueProvider.Result<TypeDescriptor> compute() {
+        final SimpleTypeDescriptor simpleTypeDescriptor = new SimpleTypeDescriptor(tag);
+        return new Result<TypeDescriptor>(simpleTypeDescriptor, tag);
+      }
+    }, false);
+    myTypesMap.put(pair, value);
+    return value;
+  }
+
+  private CachedValue<TypeDescriptor> createAndPutTypesCachedValue(final XmlTag tag, final Pair<QNameKey, XmlTag> pair) {
+    final CachedValue<TypeDescriptor> value = CachedValuesManager.getManager(tag.getProject()).createCachedValue(new CachedValueProvider<TypeDescriptor>() {
+      public CachedValueProvider.Result<TypeDescriptor> compute() {
+        final String name = tag.getAttributeValue("name");
+        
+        if (name != null &&
+            pair.first != null &&
+            pair.first.first != null &&
+            !name.equals(XmlUtil.findLocalNameByQualifiedName(pair.first.first))
+           ) {
+          myTypesMap.remove(pair);
+          return new Result<TypeDescriptor>(null);
+        }
+        final ComplexTypeDescriptor complexTypeDescriptor = new ComplexTypeDescriptor(XmlNSDescriptorImpl.this, tag); 
+        return new Result<TypeDescriptor>(complexTypeDescriptor, tag);
+      }
+    }, false);
+    myTypesMap.put(pair, value);
+    return value;
+  }
+
+  public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
+    PsiElement parent = tag.getParent();
+    final String namespace = tag.getNamespace();
+    while(parent instanceof XmlTag && !namespace.equals(((XmlTag)parent).getNamespace()))
+      parent = parent.getContext();
+    if (parent instanceof XmlTag) {
+      final XmlTag parentTag = (XmlTag)parent;
+      final XmlElementDescriptor parentDescriptor = parentTag.getDescriptor();
+
+      if(parentDescriptor != null){
+        XmlElementDescriptor elementDescriptorFromParent = parentDescriptor.getElementDescriptor(tag, parentTag);
+
+        if (elementDescriptorFromParent == null) {
+          elementDescriptorFromParent = getDescriptorFromParent(tag, elementDescriptorFromParent);
+        }
+        if (elementDescriptorFromParent instanceof AnyXmlElementDescriptor) {
+          final XmlElementDescriptor elementDescriptor = getElementDescriptor(tag.getLocalName(), namespace);
+          if (elementDescriptor != null) return elementDescriptor;
+        }
+        return elementDescriptorFromParent;
+      }
+      else{
+        return null;
+      }
+    }
+    else {
+      XmlElementDescriptor elementDescriptor = getElementDescriptor(tag.getLocalName(), tag.getNamespace());
+      
+      if (elementDescriptor == null) {
+        elementDescriptor = getDescriptorFromParent(tag, elementDescriptor);
+      }
+
+      return elementDescriptor;
+    }
+  }
+
+  @Nullable
+  private static XmlElementDescriptor getDescriptorFromParent(final XmlTag tag, XmlElementDescriptor elementDescriptor) {
+    final PsiElement parent = tag.getParent();
+    if (parent instanceof XmlTag) {
+      final XmlElementDescriptor descriptor = ((XmlTag)parent).getDescriptor();
+      if (descriptor != null) elementDescriptor = descriptor.getElementDescriptor(tag, (XmlTag)parent);
+    }
+    return elementDescriptor;
+  }
+
+  @NotNull
+  public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable final XmlDocument doc) {
+    class CollectElementsProcessor implements PsiElementProcessor<XmlTag> {
+      final List<XmlElementDescriptor> result = new ArrayList<XmlElementDescriptor>();
+      
+      public boolean execute(@NotNull final XmlTag element) {
+        result.add(getElementDescriptor(element.getAttributeValue("name"),getDefaultNamespace()));
+        return true;
+      }
+    }
+    
+    CollectElementsProcessor processor = new CollectElementsProcessor() {
+      public boolean execute(@NotNull final XmlTag element) {
+        if (!XmlElementDescriptorImpl.isAbstractDeclaration(element)) return super.execute(element);
+        return true;
+      }
+    };
+    processTagsInNamespace(myTag, new String[] {ELEMENT_TAG_NAME}, processor);
+
+    return processor.result.toArray(new XmlElementDescriptor[processor.result.size()]);
+  }
+
+  public XmlAttributeDescriptor[] getRootAttributeDescriptors(final XmlTag context) {
+    class CollectAttributesProcessor implements PsiElementProcessor<XmlTag> {
+      final List<XmlAttributeDescriptor> result = new ArrayList<XmlAttributeDescriptor>();
+
+      public boolean execute(@NotNull final XmlTag element) {
+        result.add(createAttributeDescriptor(element));
+        return true;
+      }
+    }
+
+    CollectAttributesProcessor processor = new CollectAttributesProcessor();
+    processTagsInNamespace(myTag, new String[] {ATTRIBUTE_TAG_NAME}, processor);
+
+    return processor.result.toArray(new XmlAttributeDescriptor[processor.result.size()]);
+  }
+
+  public static boolean processTagsInNamespace(@NotNull final XmlTag rootTag, String[] tagNames, PsiElementProcessor<XmlTag> processor) {
+    return processTagsInNamespaceInner(rootTag, tagNames, processor, null);
+  }
+
+  private static boolean processTagsInNamespaceInner(@NotNull final XmlTag rootTag, final String[] tagNames,
+                                                     final PsiElementProcessor<XmlTag> processor, Set<XmlTag> visitedTags) {
+    if (visitedTags == null) visitedTags = new HashSet<XmlTag>(3);
+    else if (visitedTags.contains(rootTag)) return true;
+
+    visitedTags.add(rootTag);
+    XmlTag[] tags = rootTag.getSubTags();
+
+    NextTag:
+    for (XmlTag tag : tags) {
+      for(String tagName:tagNames) {
+        if (equalsToSchemaName(tag, tagName)) {
+          final String name = tag.getAttributeValue("name");
+
+          if (name != null) {
+            if (!processor.execute(tag)) {
+              return false;
+            }
+          }
+
+          continue NextTag;
+        }
+      }
+
+      if (equalsToSchemaName(tag, INCLUDE_TAG_NAME)) {
+        final String schemaLocation = tag.getAttributeValue("schemaLocation");
+
+        if (schemaLocation != null) {
+          final XmlFile xmlFile = XmlUtil.findNamespace(rootTag.getContainingFile(), schemaLocation);
+
+          if (xmlFile != null) {
+            final XmlDocument includedDocument = xmlFile.getDocument();
+
+            if (includedDocument != null) {
+              if (!processTagsInNamespaceInner(includedDocument.getRootTag(), tagNames, processor, visitedTags)) return false;
+            }
+          }
+        }
+      }
+    }
+
+    return true;
+  }
+
+  protected static boolean equalsToSchemaName(XmlTag tag, @NonNls String schemaName) {
+    return schemaName.equals(tag.getLocalName()) && checkSchemaNamespace(tag);
+  }
+
+  private static @Nullable XmlTag findSpecialTag(@NonNls String name, @NonNls String specialName, XmlTag rootTag, XmlNSDescriptorImpl descriptor,
+                                       HashSet<XmlTag> visited) {
+    XmlNSDescriptorImpl nsDescriptor = getNSDescriptorToSearchIn(rootTag, name, descriptor);
+
+    if (nsDescriptor != descriptor) {
+      final XmlDocument document = nsDescriptor.getDescriptorFile() != null ? nsDescriptor.getDescriptorFile().getDocument():null;
+      if (document == null) return null;
+
+      return findSpecialTag(
+        XmlUtil.findLocalNameByQualifiedName(name),
+        specialName,
+        document.getRootTag(),
+        nsDescriptor,
+        visited
+      );
+    }
+
+    if (visited == null) visited = new HashSet<XmlTag>(1);
+    else if (visited.contains(rootTag)) return null;
+    visited.add(rootTag);
+
+    XmlTag[] tags = rootTag.getSubTags();
+
+    return findSpecialTagIn(tags, specialName, name, rootTag, descriptor, visited);
+  }
+
+  private static XmlTag findSpecialTagIn(final XmlTag[] tags,
+                                         final String specialName,
+                                         final String name,
+                                         final XmlTag rootTag,
+                                         final XmlNSDescriptorImpl descriptor, final HashSet<XmlTag> visited) {
+    for (XmlTag tag : tags) {
+      if (equalsToSchemaName(tag, specialName)) {
+        String attribute = tag.getAttributeValue("name");
+
+        if (name.equals(attribute)
+            || name.indexOf(":") >= 0 && name.substring(name.indexOf(":") + 1).equals(attribute)) {
+          return tag;
+        }
+      } else if (equalsToSchemaName(tag, INCLUDE_TAG_NAME) ||
+                 ( equalsToSchemaName(tag, IMPORT_TAG_NAME) &&
+                   rootTag.getNamespaceByPrefix(
+                     XmlUtil.findPrefixByQualifiedName(name)
+                   ).equals(tag.getAttributeValue("namespace"))
+                 )
+         ) {
+        final String schemaLocation = tag.getAttributeValue("schemaLocation");
+
+        if (schemaLocation != null) {
+          final XmlFile xmlFile = XmlUtil.findNamespace(rootTag.getContainingFile(), schemaLocation);
+
+          if (xmlFile != null) {
+            final XmlDocument document = xmlFile.getDocument();
+            if (document != null) {
+              final XmlTag rTag = findSpecialTag(name, specialName, document.getRootTag(), descriptor, visited);
+
+              if (rTag != null) return rTag;
+            }
+          }
+        }
+      } else if (equalsToSchemaName(tag, REDEFINE_TAG_NAME)) {
+        XmlTag rTag = findSpecialTagIn(tag.getSubTags(), specialName, name, rootTag, descriptor, visited);
+        if (rTag != null) return rTag;
+
+        final XmlNSDescriptorImpl nsDescriptor = getRedefinedElementDescriptor(tag);
+        if (nsDescriptor != null) {
+          final XmlTag redefinedRootTag = ((XmlDocument)nsDescriptor.getDeclaration()).getRootTag();
+
+          rTag = findSpecialTagIn(redefinedRootTag.getSubTags(), specialName, name, redefinedRootTag, nsDescriptor, visited);
+          if (rTag != null) return rTag;
+        }
+      }
+    }
+
+    return null;
+  }
+
+  @Nullable
+  public XmlTag findGroup(String name) {
+    return findSpecialTag(name,"group",myTag, this, null);
+  }
+
+  @Nullable
+  public XmlTag findAttributeGroup(String name) {
+    return findSpecialTag(name,"attributeGroup",myTag,this, null);
+  }
+
+  private Map<String,List<XmlTag>> mySubstitutions;
+
+  public XmlElementDescriptor[] getSubstitutes(String localName, String namespace) {
+    List<XmlElementDescriptor> result = new ArrayList<XmlElementDescriptor>();
+
+    initSubstitutes();
+
+    List<XmlTag> substitutions = mySubstitutions.get(localName);
+    if (substitutions==null) return XmlElementDescriptor.EMPTY_ARRAY;
+    for (XmlTag tag : substitutions) {
+      final String substAttr = tag.getAttributeValue("substitutionGroup");
+      if (substAttr != null && checkElementNameEquivalence(localName, namespace, substAttr, tag)) {
+        result.add(createElementDescriptor(tag));
+      }
+    }
+
+    return result.toArray(new XmlElementDescriptor[result.size()]);
+  }
+
+  private void initSubstitutes() {
+    if (mySubstitutions ==null) {
+      mySubstitutions = new HashMap<String, List<XmlTag>>();
+
+      XmlTag[] tags = myTag.getSubTags();
+
+      for (XmlTag tag : tags) {
+        if (equalsToSchemaName(tag, ELEMENT_TAG_NAME)) {
+          final String substAttr = tag.getAttributeValue("substitutionGroup");
+          if (substAttr != null) {
+            String substLocalName = XmlUtil.findLocalNameByQualifiedName(substAttr);
+            List<XmlTag> list = mySubstitutions.get(substLocalName);
+            if (list == null) {
+              list = new LinkedList<XmlTag>();
+              mySubstitutions.put(substLocalName, list);
+            }
+            list.add(tag);
+          }
+        }
+      }
+    }
+  }
+
+  public PsiElement getDeclaration(){
+    return myFile.getDocument();
+  }
+
+  public String getName(PsiElement context){
+    return getName();
+  }
+
+  public String getName(){
+    return "";
+  }
+
+  public void init(PsiElement element){
+    myFile = (XmlFile) element.getContainingFile();
+    
+    if (element instanceof XmlTag) {
+      myTag = (XmlTag)element;
+    } else {
+      final XmlDocument document = myFile.getDocument();
+
+      if (document != null) {
+        myTag = document.getRootTag();
+      }
+    }
+
+    if (myTag != null) {
+      myTargetNamespace = myTag.getAttributeValue("targetNamespace");
+    }
+
+    final THashSet<PsiFile> dependenciesSet = new THashSet<PsiFile>();
+    final Set<PsiFile> redefineProcessingSet = myRedefinedDescriptorsInProcessing.get();
+    if (redefineProcessingSet != null) {
+      dependenciesSet.addAll(redefineProcessingSet);
+    }
+    collectDependencies(myTag, myFile, dependenciesSet);
+    dependencies = ArrayUtil.toObjectArray(dependenciesSet);
+  }
+
+  public Object[] getDependences() {
+    if (dependencies == null) dependencies = new Object[] {myFile}; // init was not called
+    return dependencies;
+  }
+
+  static {
+    STD_TYPES.add("string");
+    STD_TYPES.add("normalizedString");
+    STD_TYPES.add("token");
+    STD_TYPES.add("byte");
+    STD_TYPES.add("unsignedByte");
+    STD_TYPES.add("base64Binary");
+    STD_TYPES.add("hexBinary");
+    STD_TYPES.add("integer");
+    STD_TYPES.add("positiveInteger");
+    STD_TYPES.add("negativeInteger");
+    STD_TYPES.add("nonNegativeInteger");
+    STD_TYPES.add("nonPositiveInteger");
+    STD_TYPES.add("int");
+    STD_TYPES.add("unsignedInt");
+    STD_TYPES.add("long");
+    STD_TYPES.add("unsignedLong");
+    STD_TYPES.add("short");
+    STD_TYPES.add("unsignedShort");
+    STD_TYPES.add("decimal");
+    STD_TYPES.add("float");
+    STD_TYPES.add("double");
+    STD_TYPES.add("boolean");
+    STD_TYPES.add("time");
+    STD_TYPES.add("dateTime");
+    STD_TYPES.add("duration");
+    STD_TYPES.add("date");
+    STD_TYPES.add("gMonth");
+    STD_TYPES.add("gYear");
+    STD_TYPES.add("gYearMonth");
+    STD_TYPES.add("gDay");
+    STD_TYPES.add("gMonthDay");
+    STD_TYPES.add("Name");
+    STD_TYPES.add("QName");
+    STD_TYPES.add("NCName");
+    STD_TYPES.add("anyURI");
+    STD_TYPES.add("language");
+    STD_TYPES.add("ID");
+    STD_TYPES.add("IDREF");
+    STD_TYPES.add("IDREFS");
+    STD_TYPES.add("ENTITY");
+    STD_TYPES.add("ENTITIES");
+    STD_TYPES.add("NOTATION");
+    STD_TYPES.add("NMTOKEN");
+    STD_TYPES.add("NMTOKENS");
+    STD_TYPES.add("anySimpleType");
+    
+    UNDECLARED_STD_TYPES.add("anySimpleType");
+  }
+
+  public void validate(@NotNull XmlDocument context, @NotNull Validator.ValidationHost host) {
+    ExternalDocumentValidator.doValidation(context,host);
+  }
+
+  public XmlTag getTag() {
+    return myTag;
+  }
+
+  public static XmlNSDescriptorImpl getRedefinedElementDescriptor(final XmlTag parentTag) {
+    XmlFile file = getRedefinedElementDescriptorFile(parentTag);
+    if (file != null) {
+      final XmlDocument document = file.getDocument();
+      final PsiMetaData metaData = document != null ? document.getMetaData():null;
+      if (metaData instanceof XmlNSDescriptorImpl) return (XmlNSDescriptorImpl)metaData;
+    }
+    return null;
+  }
+
+  public static XmlFile getRedefinedElementDescriptorFile(final XmlTag parentTag) {
+    final String schemaL = parentTag.getAttributeValue(XmlUtil.SCHEMA_LOCATION_ATT);
+
+    if (schemaL != null) {
+      final PsiReference[] references = parentTag.getAttribute(XmlUtil.SCHEMA_LOCATION_ATT, null).getValueElement().getReferences();
+
+      if (references.length > 0) {
+        final PsiElement psiElement = references[references.length - 1].resolve();
+
+        if (psiElement instanceof XmlFile) {
+          return ((XmlFile)psiElement);
+        }
+      }
+    }
+    return null;
+  }
+
+  public boolean hasSubstitutions() {
+    initSubstitutes();
+    return mySubstitutions != null && mySubstitutions.size() > 0;
+  }
+
+  public boolean isValid() {
+    return myFile != null && getDeclaration().isValid();
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/XmlNSTypeDescriptorProvider.java b/xml/impl/src/com/intellij/xml/impl/schema/XmlNSTypeDescriptorProvider.java
new file mode 100644
index 0000000..1d82db04
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/XmlNSTypeDescriptorProvider.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author nik
+ */
+public interface XmlNSTypeDescriptorProvider {
+  @Nullable
+  TypeDescriptor getTypeDescriptor(String name, XmlTag context);
+
+  @Nullable
+  TypeDescriptor getTypeDescriptor(XmlTag descriptorTag);
+}
diff --git a/xml/impl/src/com/intellij/xml/impl/schema/XmlSchemaTagsProcessor.java b/xml/impl/src/com/intellij/xml/impl/schema/XmlSchemaTagsProcessor.java
new file mode 100644
index 0000000..3a703c1
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/impl/schema/XmlSchemaTagsProcessor.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.impl.schema;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public abstract class XmlSchemaTagsProcessor {
+
+  private final Set<XmlTag> myVisited = new HashSet<XmlTag>();
+  protected final XmlNSDescriptorImpl myNsDescriptor;
+  private final String[] myTagsToIgnore;
+
+  public XmlSchemaTagsProcessor(XmlNSDescriptorImpl nsDescriptor, String... tagsToIgnore) {
+    myNsDescriptor = nsDescriptor;
+    myTagsToIgnore = ArrayUtil.append(tagsToIgnore, "annotation");
+  }
+
+  public final void startProcessing(XmlTag tag) {
+    processTag(tag, null);
+  }
+
+  public void processTag(XmlTag tag, @Nullable XmlTag context) {
+
+    if (myVisited.contains(tag)) return;
+    myVisited.add(tag);
+
+    if (!XmlNSDescriptorImpl.checkSchemaNamespace(tag)) {
+      processTagWithSubTags(tag, context, null);
+      return;
+    }
+
+    String tagName = tag.getLocalName();
+    if (checkTagName(tagName, "element", "attribute")) {
+      XmlAttribute ref = tag.getAttribute("ref");
+      if (ref != null) {
+        XmlTag resolved = resolveTagReference(ref);
+        if (resolved != null) {
+          tagStarted(resolved, resolved.getLocalName(), tag, tag);
+        }
+      }
+      else {
+        tagStarted(tag, tag.getLocalName(), context, null);
+      }
+    }
+    else if (checkTagName(tagName, "group")) {
+      String value = tag.getAttributeValue("ref");
+      if (value != null) {
+        XmlTag group = myNsDescriptor.findGroup(value);
+        if (group == null) group = resolveTagReference(tag.getAttribute("ref"));
+        processTagWithSubTags(group, tag, tag);
+      }
+    }
+    else if (checkTagName(tagName, "attributeGroup")) {
+      String ref = tag.getAttributeValue("ref");
+      if (ref == null) return;
+      XmlTag group;
+      XmlTag parentTag = tag.getParentTag();
+      if (XmlNSDescriptorImpl.equalsToSchemaName(parentTag, "attributeGroup") &&
+        ref.equals(parentTag.getAttributeValue("name"))) {
+        group = resolveTagReference(tag.getAttribute("ref"));
+        if (group == null) group = myNsDescriptor.findAttributeGroup(ref);
+      }
+      else {
+        group =  myNsDescriptor.findAttributeGroup(ref);
+        if (group == null) group = resolveTagReference(tag.getAttribute("ref"));
+      }
+      processTagWithSubTags(group, tag, null);
+    }
+    else if (checkTagName(tagName, "restriction", "extension")) {
+      processTagWithSubTags(resolveTagReference(tag.getAttribute("base")), tag, null);
+      processTagWithSubTags(tag, context, null);
+    }
+    else if (!checkTagName(tagName, myTagsToIgnore)) {
+      processTagWithSubTags(tag, context, null);
+    }
+  }
+
+  private void processTagWithSubTags(@Nullable XmlTag tag, XmlTag ctx, @Nullable XmlTag ref) {
+    if (tag == null) return;
+    tagStarted(tag, tag.getLocalName(), ctx, ref);
+    XmlTag[] subTags = tag.getSubTags();
+    for (XmlTag subTag : subTags) {
+      processTag(subTag, tag);
+    }
+    tagFinished(tag);
+  }
+
+  protected abstract void tagStarted(XmlTag tag, String tagName, XmlTag context, @Nullable XmlTag ref);
+
+  protected void tagFinished(XmlTag tag) {}
+
+  @Nullable
+  private static XmlTag resolveTagReference(XmlAttribute ref) {
+    PsiElement element = resolveReference(ref);
+    return element instanceof XmlTag ? (XmlTag)element : null;
+  }
+
+  @Nullable
+  static PsiElement resolveReference(XmlAttribute ref) {
+    if (ref != null) {
+      XmlAttributeValue value = ref.getValueElement();
+      if (value != null) {
+        return value.getReferences()[0].resolve();
+      }
+    }
+    return null;
+  }
+
+  protected static boolean checkTagName(String tagName, String... names) {
+    return ArrayUtil.contains(tagName, names);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/index/IndexedRelevantResource.java b/xml/impl/src/com/intellij/xml/index/IndexedRelevantResource.java
new file mode 100644
index 0000000..5b62a6a
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/index/IndexedRelevantResource.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.index;
+
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.ProjectFileIndex;
+import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.util.NullableFunction;
+import com.intellij.util.indexing.AdditionalIndexedRootsScope;
+import com.intellij.util.indexing.FileBasedIndex;
+import com.intellij.util.indexing.ID;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class IndexedRelevantResource<K, V extends Comparable> implements Comparable<IndexedRelevantResource<K, V>> {
+
+  public static <K, V extends Comparable> List<IndexedRelevantResource<K, V>> getResources(ID<K, V> indexId,
+                                                                                           final K key,
+                                                                                           @Nullable final Module module,
+                                                                                           @NotNull Project project,
+                                                                                           @Nullable final GlobalSearchScope additionalScope) {
+
+    if (project.isDefault()) return Collections.emptyList();
+    final ArrayList<IndexedRelevantResource<K, V>> resources = new ArrayList<IndexedRelevantResource<K, V>>();
+    final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
+    FileBasedIndex.getInstance().processValues(indexId, key, null, new FileBasedIndex.ValueProcessor<V>() {
+      public boolean process(VirtualFile file, V value) {
+        ResourceRelevance relevance = ResourceRelevance.getRelevance(file, module, fileIndex, additionalScope);
+        if (relevance != ResourceRelevance.NONE) {
+          resources.add(new IndexedRelevantResource<K, V>(file, key, value, relevance));
+        }
+        return true;
+      }
+    }, new AdditionalIndexedRootsScope(GlobalSearchScope.allScope(project)));
+    return resources;
+  }
+
+  public static <K, V extends Comparable> List<IndexedRelevantResource<K, V>> getAllResources(ID<K, V> indexId,
+                                                                                              @Nullable final Module module,
+                                                                                              @NotNull Project project,
+                                                                                              @Nullable NullableFunction<List<IndexedRelevantResource<K, V>>, IndexedRelevantResource<K, V>> chooser) {
+    ArrayList<IndexedRelevantResource<K, V>> all = new ArrayList<IndexedRelevantResource<K, V>>();
+    Collection<K> allKeys = FileBasedIndex.getInstance().getAllKeys(indexId, project);
+    for (K key : allKeys) {
+      List<IndexedRelevantResource<K, V>> resources = getResources(indexId, key, module, project, null);
+      if (!resources.isEmpty()) {
+        if (chooser == null) {
+          all.add(resources.get(0));
+        }
+        else {
+          IndexedRelevantResource<K, V> resource = chooser.fun(resources);
+          if (resource != null) {
+            all.add(resource);
+          }
+        }
+      }
+    }
+    return all;
+  }
+
+  private final VirtualFile myFile;
+  private final K myKey;
+  private final V myValue;
+  private final ResourceRelevance myRelevance;
+
+  public IndexedRelevantResource(VirtualFile file, K key, V value, ResourceRelevance relevance) {
+    myFile = file;
+    myKey = key;
+    myValue = value;
+    myRelevance = relevance;
+  }
+
+  public VirtualFile getFile() {
+    return myFile;
+  }
+
+  public V getValue() {
+    return myValue;
+  }
+
+  public ResourceRelevance getRelevance() {
+    return myRelevance;
+  }
+
+  public int compareTo(IndexedRelevantResource<K, V> o) {
+    int i = myRelevance.compareTo(o.getRelevance());
+    return i == 0 ? myValue.compareTo(o.getValue()) : i;
+  }
+
+  public K getKey() {
+    return myKey;
+  }
+
+  @Override
+  public String toString() {
+    return "IndexedRelevantResource{" +
+           "myRelevance=" +
+           myRelevance +
+           ", myKey=" +
+           myKey +
+           ", myValue=" +
+           myValue +
+           ", myFile=" +
+           myFile +
+           '}';
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/index/ResourceRelevance.java b/xml/impl/src/com/intellij/xml/index/ResourceRelevance.java
new file mode 100644
index 0000000..834478d
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/index/ResourceRelevance.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.index;
+
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.javaee.ExternalResourceManagerImpl;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.roots.ProjectFileIndex;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.search.GlobalSearchScope;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public enum ResourceRelevance {
+
+  NONE,
+  STANDARD,
+  LIBRARY,
+  SOURCE,
+  MAPPED;
+
+  public static ResourceRelevance getRelevance(VirtualFile resource,
+                                               @Nullable Module module,
+                                               ProjectFileIndex fileIndex,
+                                               @Nullable GlobalSearchScope additionalScope) {
+    boolean inTest = fileIndex.isInTestSourceContent(resource);
+    if (module != null) {
+      GlobalSearchScope scope = module.getModuleRuntimeScope(inTest);
+      Module resourceModule = fileIndex.getModuleForFile(resource);
+      if (resourceModule != null &&
+          (resourceModule == module || scope.isSearchInModuleContent(resourceModule)) ||
+        scope.contains(resource) || (additionalScope != null && additionalScope.contains(resource))) {
+        return inTest || fileIndex.isInSource(resource) ? SOURCE : LIBRARY;
+      }
+    }
+    else if (inTest ||  fileIndex.isInSource(resource)) {
+      return SOURCE;
+    }
+    else if (fileIndex.isInLibraryClasses(resource)) {
+      return LIBRARY;
+    }
+    ExternalResourceManagerImpl resourceManager = (ExternalResourceManagerImpl)ExternalResourceManager.getInstance();
+    if (resourceManager.isUserResource(resource)) {
+      return MAPPED;
+    }
+    if (ExternalResourceManagerImpl.isStandardResource(resource)) {
+      return STANDARD;
+    }
+    return NONE;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/index/SchemaTypeInfo.java b/xml/impl/src/com/intellij/xml/index/SchemaTypeInfo.java
new file mode 100644
index 0000000..9d857a0
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/index/SchemaTypeInfo.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.index;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: Irina.Chernushina
+ * Date: 7/4/12
+ * Time: 7:14 PM
+ */
+public class SchemaTypeInfo implements Comparable<SchemaTypeInfo> {
+  private final String myTagName;
+  private final String myNamespaceUri;
+//  private final String myFileUrl;
+  private final boolean myIsTypeName; // false -> enclosing element name
+
+  public SchemaTypeInfo(String tagName, final boolean isTypeName, String namespace) {
+    myNamespaceUri = namespace;
+    myTagName = tagName;
+    myIsTypeName = isTypeName;
+  }
+
+  public String getTagName() {
+    return myTagName;
+  }
+
+  public String getNamespaceUri() {
+    return myNamespaceUri;
+  }
+
+  public boolean isIsTypeName() {
+    return myIsTypeName;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    SchemaTypeInfo info = (SchemaTypeInfo)o;
+
+    if (myIsTypeName != info.myIsTypeName) return false;
+    if (myNamespaceUri != null ? !myNamespaceUri.equals(info.myNamespaceUri) : info.myNamespaceUri != null) return false;
+    if (!myTagName.equals(info.myTagName)) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = myTagName.hashCode();
+    result = 31 * result + (myNamespaceUri != null ? myNamespaceUri.hashCode() : 0);
+    result = 31 * result + (myIsTypeName ? 1 : 0);
+    return result;
+  }
+
+  @Override
+  public int compareTo(SchemaTypeInfo o) {
+    return myTagName.compareTo(o.getTagName());
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/index/SchemaTypeInheritanceIndex.java b/xml/impl/src/com/intellij/xml/index/SchemaTypeInheritanceIndex.java
new file mode 100644
index 0000000..5155221
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/index/SchemaTypeInheritanceIndex.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.index;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.util.PairConvertor;
+import com.intellij.util.containers.EncoderDecoder;
+import com.intellij.util.containers.MultiMap;
+import com.intellij.util.containers.hash.HashMap;
+import com.intellij.util.indexing.DataIndexer;
+import com.intellij.util.indexing.FileBasedIndex;
+import com.intellij.util.indexing.FileContent;
+import com.intellij.util.indexing.ID;
+import com.intellij.util.io.DataExternalizer;
+import com.intellij.util.text.CharArrayUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: Irina.Chernushina
+ * Date: 7/4/12
+ * Time: 6:29 PM
+ *
+ * map: tag name->file url
+ */
+public class SchemaTypeInheritanceIndex extends XmlIndex<Set<SchemaTypeInfo>> {
+  private static final ID<String, Set<SchemaTypeInfo>> NAME = ID.create("SchemaTypeInheritance");
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.index.SchemaTypeInheritanceIndex");
+
+  private static List<Set<SchemaTypeInfo>> getDirectChildrenOfType(final Project project,
+                                                                  final String ns,
+                                                                  final String name) {
+    GlobalSearchScope filter = createFilter(project);
+    final List<Set<SchemaTypeInfo>>
+      list = FileBasedIndex.getInstance().getValues(NAME, NsPlusTag.INSTANCE.encode(Pair.create(ns, name)), filter);
+    return list;
+  }
+
+  public static PairConvertor<String, String, List<Set<SchemaTypeInfo>>> getWorker(final Project project, final VirtualFile currentFile) {
+    return new MyWorker(currentFile, project);
+  }
+
+  private static class MyWorker implements PairConvertor<String, String, List<Set<SchemaTypeInfo>>> {
+    private final Project myProject;
+    private final VirtualFile myCurrentFile;
+    private final GlobalSearchScope myFilter;
+    private final boolean myShouldParseCurrent;
+    private MultiMap<SchemaTypeInfo,SchemaTypeInfo> myMap;
+
+    private MyWorker(VirtualFile currentFile, Project project) {
+      myCurrentFile = currentFile;
+      myProject = project;
+
+      myFilter = createFilter(project);
+      myShouldParseCurrent = (myCurrentFile != null && ! myFilter.contains(myCurrentFile));
+    }
+
+    @Override
+    public List<Set<SchemaTypeInfo>> convert(String ns, String name) {
+      List<Set<SchemaTypeInfo>> type = getDirectChildrenOfType(myProject, ns, name);
+      if (myShouldParseCurrent) {
+        if (myMap == null) {
+          try {
+            myMap = XsdComplexTypeInfoBuilder.parse(CharArrayUtil.readerFromCharSequence(VfsUtil.loadText(myCurrentFile)));
+            type.add(new HashSet<SchemaTypeInfo>(myMap.get(new SchemaTypeInfo(name, true, ns))));
+          }
+          catch (IOException e) {
+            LOG.info(e);
+          }
+        }
+      }
+      return type;
+    }
+  }
+
+  @Override
+  public boolean dependsOnFileContent() {
+    return true;
+  }
+
+  @Override
+  public int getVersion() {
+    return 0;
+  }
+
+  @NotNull
+  @Override
+  public ID<String, Set<SchemaTypeInfo>> getName() {
+    return NAME;
+  }
+
+  @NotNull
+  @Override
+  public DataIndexer<String, Set<SchemaTypeInfo>, FileContent> getIndexer() {
+    return new DataIndexer<String, Set<SchemaTypeInfo>, FileContent>() {
+      @NotNull
+      @Override
+      public Map<String, Set<SchemaTypeInfo>> map(FileContent inputData) {
+        final Map<String, Set<SchemaTypeInfo>> map = new HashMap<String, Set<SchemaTypeInfo>>();
+        final MultiMap<SchemaTypeInfo,SchemaTypeInfo> multiMap =
+          XsdComplexTypeInfoBuilder.parse(CharArrayUtil.readerFromCharSequence(inputData.getContentAsText()));
+        for (SchemaTypeInfo key : multiMap.keySet()) {
+          map.put(NsPlusTag.INSTANCE.encode(Pair.create(key.getNamespaceUri(), key.getTagName())), new HashSet<SchemaTypeInfo>(multiMap.get(key)));
+        }
+        return map;
+      }
+    };
+  }
+
+  @Override
+  public DataExternalizer<Set<SchemaTypeInfo>> getValueExternalizer() {
+    return new DataExternalizer<Set<SchemaTypeInfo>>() {
+      @Override
+      public void save(DataOutput out, Set<SchemaTypeInfo> value) throws IOException {
+        out.writeInt(value.size());
+        for (SchemaTypeInfo key : value) {
+          out.writeUTF(key.getNamespaceUri());
+          out.writeUTF(key.getTagName());
+          out.writeBoolean(key.isIsTypeName());
+        }
+      }
+
+      @Override
+      public Set<SchemaTypeInfo> read(DataInput in) throws IOException {
+        final Set<SchemaTypeInfo> set = new HashSet<SchemaTypeInfo>();
+        final int size = in.readInt();
+        for (int i = 0; i < size; i++) {
+          final String nsUri = in.readUTF();
+          final String tagName = in.readUTF();
+          final boolean isType = in.readBoolean();
+          set.add(new SchemaTypeInfo(tagName, isType, nsUri));
+        }
+        return set;
+      }
+    };
+  }
+
+  private static class NsPlusTag implements EncoderDecoder<Pair<String, String>, String> {
+    private final static NsPlusTag INSTANCE = new NsPlusTag();
+    private final static char ourSeparator = ':';
+
+    @Override
+    public String encode(Pair<String, String> pair) {
+      return pair.getFirst() + ourSeparator + pair.getSecond();
+    }
+
+    @Override
+    public Pair<String, String> decode(String s) {
+      final int i = s.indexOf(ourSeparator);
+      return i <= 0 ? Pair.create("", s) : Pair.create(s.substring(0, i), s.substring(i + 1));
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/index/XmlIndex.java b/xml/impl/src/com/intellij/xml/index/XmlIndex.java
new file mode 100644
index 0000000..dcfbb77
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/index/XmlIndex.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.index;
+
+import com.intellij.ide.highlighter.DTDFileType;
+import com.intellij.ide.highlighter.XmlFileType;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.OrderEntry;
+import com.intellij.openapi.roots.ProjectFileIndex;
+import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.VirtualFileFilter;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.util.indexing.FileBasedIndex;
+import com.intellij.util.indexing.FileBasedIndexExtension;
+import com.intellij.util.io.EnumeratorStringDescriptor;
+import com.intellij.util.io.KeyDescriptor;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public abstract class XmlIndex<V> extends FileBasedIndexExtension<String, V> {
+
+  protected static final EnumeratorStringDescriptor KEY_DESCRIPTOR = new EnumeratorStringDescriptor();
+
+  private static final FileBasedIndex.InputFilter INPUT_FILTER = new FileBasedIndex.InputFilter() {
+    public boolean acceptInput(final VirtualFile file) {
+      FileType fileType = file.getFileType();
+      final String extension = file.getExtension();
+      return XmlFileType.INSTANCE.equals(fileType) && "xsd".equals(extension) ||
+             DTDFileType.INSTANCE.equals(fileType) && "dtd".equals(extension);
+    }
+  };
+
+  protected static GlobalSearchScope createFilter(final Project project) {
+    final GlobalSearchScope projectScope = GlobalSearchScope.allScope(project);
+    return new GlobalSearchScope(project) {
+      public int compare(VirtualFile file1, VirtualFile file2) {
+        return projectScope.compare(file1, file2);
+      }
+
+      public boolean isSearchInModuleContent(@NotNull Module aModule) {
+        return true;
+      }
+
+      @Override
+      public boolean contains(VirtualFile file) {
+        final VirtualFile parent = file.getParent();
+        return parent != null && (parent.getName().equals("standardSchemas") || projectScope.contains(file));
+      }
+
+      @Override
+      public boolean isSearchInLibraries() {
+        return true;
+      }
+    };
+  }
+
+
+  protected static VirtualFileFilter createFilter(@NotNull final Module module) {
+
+    final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(module.getProject()).getFileIndex();
+    return new VirtualFileFilter() {
+      public boolean accept(final VirtualFile file) {
+        Module moduleForFile = fileIndex.getModuleForFile(file);
+        if (moduleForFile != null) { // in module content
+          return module.equals(moduleForFile);
+        }
+        if (fileIndex.isInLibraryClasses(file)) {
+          List<OrderEntry> orderEntries = fileIndex.getOrderEntriesForFile(file);
+          if (orderEntries.isEmpty()) {
+            return false;
+          }
+          for (OrderEntry orderEntry : orderEntries) {
+            Module ownerModule = orderEntry.getOwnerModule();
+            if (ownerModule.equals(module)) {
+              return true;
+            }
+          }
+        }
+        final VirtualFile parent = file.getParent();
+        assert parent != null;
+        return parent.getName().equals("standardSchemas");
+      }
+    };
+  }
+
+  public KeyDescriptor<String> getKeyDescriptor() {
+    return KEY_DESCRIPTOR;
+  }
+
+  public FileBasedIndex.InputFilter getInputFilter() {
+    return INPUT_FILTER;
+  }
+
+  public boolean dependsOnFileContent() {
+    return true;
+  }
+
+  public int getVersion() {
+    return 0;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/index/XmlNamespaceIndex.java b/xml/impl/src/com/intellij/xml/index/XmlNamespaceIndex.java
new file mode 100644
index 0000000..6e07c94
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/index/XmlNamespaceIndex.java
@@ -0,0 +1,199 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.index;
+
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtilCore;
+import com.intellij.openapi.project.DumbService;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.NullableFunction;
+import com.intellij.util.indexing.DataIndexer;
+import com.intellij.util.indexing.FileBasedIndex;
+import com.intellij.util.indexing.FileContent;
+import com.intellij.util.indexing.ID;
+import com.intellij.util.io.DataExternalizer;
+import com.intellij.util.text.CharArrayUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlNamespaceIndex extends XmlIndex<XsdNamespaceBuilder> {
+
+  @Nullable
+  public static String getNamespace(@NotNull VirtualFile file, final Project project, PsiFile context) {
+    if (DumbService.isDumb(project) || (context != null && XmlUtil.isStubBuilding(context))) {
+      try {
+        return XsdNamespaceBuilder.computeNamespace(file.getInputStream());
+      }
+      catch (IOException e) {
+        return null;
+      }
+    }
+    final List<XsdNamespaceBuilder> list = FileBasedIndex.getInstance().getValues(NAME, file.getUrl(), createFilter(project));
+    return list.size() == 0 ? null : list.get(0).getNamespace();
+  }
+
+  public static List<IndexedRelevantResource<String, XsdNamespaceBuilder>> getResourcesByNamespace(String namespace,
+                                                                                                   @NotNull Project project,
+                                                                                                   @Nullable Module module) {
+    List<IndexedRelevantResource<String, XsdNamespaceBuilder>> resources =
+      IndexedRelevantResource.getResources(NAME, namespace, module, project, null);
+    Collections.sort(resources);
+    return resources;
+  }
+
+  public static List<IndexedRelevantResource<String, XsdNamespaceBuilder>> getAllResources(@Nullable final Module module,
+                                                                                           @NotNull Project project,
+                                                                                           @Nullable NullableFunction<List<IndexedRelevantResource<String, XsdNamespaceBuilder>>, IndexedRelevantResource<String, XsdNamespaceBuilder>> chooser) {
+    return IndexedRelevantResource.getAllResources(NAME, module, project, chooser);
+  }
+  
+  private static final ID<String,XsdNamespaceBuilder> NAME = ID.create("XmlNamespaces");
+
+  @Override
+  @NotNull
+  public ID<String, XsdNamespaceBuilder> getName() {
+    return NAME;
+  }
+
+  @Override
+  @NotNull
+  public DataIndexer<String, XsdNamespaceBuilder, FileContent> getIndexer() {
+    return new DataIndexer<String, XsdNamespaceBuilder, FileContent>() {
+      @Override
+      @NotNull
+      public Map<String, XsdNamespaceBuilder> map(final FileContent inputData) {
+        final XsdNamespaceBuilder builder;
+        if ("dtd".equals(inputData.getFile().getExtension())) {
+          builder = new XsdNamespaceBuilder(inputData.getFileName(), "", Collections.<String>emptyList());
+        }
+        else {
+          builder = XsdNamespaceBuilder.computeNamespace(CharArrayUtil.readerFromCharSequence(inputData.getContentAsText()));
+        }
+        final HashMap<String, XsdNamespaceBuilder> map = new HashMap<String, XsdNamespaceBuilder>(2);
+        String namespace = builder.getNamespace();
+        if (namespace != null) {
+          map.put(namespace, builder);
+        }
+        // so that we could get ns by file url (see getNamespace method above)
+        map.put(inputData.getFile().getUrl(), builder);
+        return map;
+      }
+    };
+  }
+
+  @Override
+  public DataExternalizer<XsdNamespaceBuilder> getValueExternalizer() {
+    return new DataExternalizer<XsdNamespaceBuilder>() {
+      @Override
+      public void save(DataOutput out, XsdNamespaceBuilder value) throws IOException {
+        out.writeUTF(value.getNamespace() == null ? "" : value.getNamespace());
+        out.writeUTF(value.getVersion() == null ? "" : value.getVersion());
+        out.writeInt(value.getTags().size());
+        for (String s : value.getTags()) {
+          out.writeUTF(s);
+        }
+      }
+
+      @Override
+      public XsdNamespaceBuilder read(DataInput in) throws IOException {
+
+        int count;
+        XsdNamespaceBuilder builder = new XsdNamespaceBuilder(in.readUTF(), in.readUTF(), new ArrayList<String>(count = in.readInt()));
+        for (int i = 0; i < count; i++) {
+          builder.getTags().add(in.readUTF());
+        }
+        return builder;
+      }
+    };
+  }
+
+  @Override
+  public int getVersion() {
+    return 2;
+  }
+
+  @Nullable
+  public static IndexedRelevantResource<String, XsdNamespaceBuilder> guessSchema(String namespace,
+                                                                                 @Nullable final String tagName,
+                                                                                 @Nullable final String version,
+                                                                                 @Nullable Module module) {
+
+    if (module == null) return null;
+
+    Project project = module.getProject();
+    final List<IndexedRelevantResource<String, XsdNamespaceBuilder>>
+      resources = getResourcesByNamespace(namespace, project, module);
+
+    if (resources.isEmpty()) return null;
+
+    return Collections
+      .max(resources, new Comparator<IndexedRelevantResource<String, XsdNamespaceBuilder>>() {
+        @Override
+        public int compare(IndexedRelevantResource<String, XsdNamespaceBuilder> o1,
+                           IndexedRelevantResource<String, XsdNamespaceBuilder> o2) {
+
+          int i = o1.getValue().getRating(tagName, version) - o2.getValue().getRating(tagName, version);
+          return i == 0 ? o1.compareTo(o2) : i;
+        }
+      });
+  }
+
+  @Nullable
+  public static XmlFile guessSchema(String namespace,
+                                    @Nullable final String tagName,
+                                    @Nullable final String version,
+                                    @NotNull PsiFile file) {
+
+    if (DumbService.isDumb(file.getProject()) || XmlUtil.isStubBuilding(file)) return null;
+
+    IndexedRelevantResource<String,XsdNamespaceBuilder> resource =
+      guessSchema(namespace, tagName, version, ModuleUtilCore.findModuleForPsiElement(file));
+    if (resource == null) return null;
+    return findSchemaFile(resource.getFile(), file);
+  }
+
+  @Nullable
+  private static XmlFile findSchemaFile(VirtualFile resourceFile, PsiFile baseFile) {
+    PsiFile psiFile = baseFile.getManager().findFile(resourceFile);
+    return psiFile instanceof XmlFile ? (XmlFile)psiFile : null;
+  }
+
+  @Nullable
+  public static XmlFile guessDtd(String dtdUri, @NotNull PsiFile baseFile) {
+
+    if (!dtdUri.endsWith(".dtd") ||
+        DumbService.isDumb(baseFile.getProject()) ||
+        XmlUtil.isStubBuilding(baseFile)) return null;
+
+    String dtdFileName = new File(dtdUri).getName();
+    List<IndexedRelevantResource<String, XsdNamespaceBuilder>>
+      list = getResourcesByNamespace(dtdFileName, baseFile.getProject(), ModuleUtilCore.findModuleForPsiElement(baseFile));
+    return list.isEmpty() ? null : findSchemaFile(list.get(0).getFile(), baseFile);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/index/XmlTagNamesIndex.java b/xml/impl/src/com/intellij/xml/index/XmlTagNamesIndex.java
new file mode 100644
index 0000000..97fb7c0
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/index/XmlTagNamesIndex.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.index;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.containers.HashMap;
+import com.intellij.util.indexing.*;
+import com.intellij.util.io.DataExternalizer;
+import com.intellij.util.text.CharArrayUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlTagNamesIndex extends XmlIndex<Void> {
+
+  public static Collection<VirtualFile> getFilesByTagName(String tagName, final Project project) {
+    return FileBasedIndex.getInstance().getContainingFiles(NAME, tagName, createFilter(project));
+  }
+
+  public static Collection<String> getAllTagNames(Project project) {
+    return FileBasedIndex.getInstance().getAllKeys(NAME, project);
+  }
+
+  static final ID<String,Void> NAME = ID.create("XmlTagNames");
+
+  @Override
+  @NotNull
+  public ID<String, Void> getName() {
+    return NAME;
+  }
+
+  @Override
+  @NotNull
+  public DataIndexer<String, Void, FileContent> getIndexer() {
+    return new DataIndexer<String, Void, FileContent>() {
+      @Override
+      @NotNull
+      public Map<String, Void> map(final FileContent inputData) {
+        final Collection<String> tags = XsdTagNameBuilder.computeTagNames(CharArrayUtil.readerFromCharSequence(inputData.getContentAsText()));
+        if (tags != null && !tags.isEmpty()) {
+          final HashMap<String, Void> map = new HashMap<String, Void>(tags.size());
+          for (String tag : tags) {
+            map.put(tag, null);
+          }
+          return map;
+        }
+        else {
+          return Collections.emptyMap();
+        }
+      }
+    };
+  }
+
+  @Override
+  public DataExternalizer<Void> getValueExternalizer() {
+    return ScalarIndexExtension.VOID_DATA_EXTERNALIZER;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/xml/index/XsdComplexTypeInfoBuilder.java b/xml/impl/src/com/intellij/xml/index/XsdComplexTypeInfoBuilder.java
new file mode 100644
index 0000000..75b8dd3
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/index/XsdComplexTypeInfoBuilder.java
@@ -0,0 +1,225 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.index;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.containers.MultiMap;
+import com.intellij.util.containers.hash.HashMap;
+import com.intellij.util.xml.NanoXmlUtil;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.Map;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: Irina.Chernushina
+ * Date: 7/4/12
+ * Time: 6:37 PM
+ */
+public class XsdComplexTypeInfoBuilder extends NanoXmlUtil.IXMLBuilderAdapter {
+  private final static String SIGN = "";
+  public static final String HTTP_WWW_W3_ORG_2001_XMLSCHEMA = "http://www.w3.org/2001/XMLSchema";
+  // base type -> inherited types
+  private final MultiMap<SchemaTypeInfo, SchemaTypeInfo> myMap;
+  private NameSpaceHelper myNameSpaceHelper;
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.index.XsdComplexTypeInfoBuilder");
+
+  public void setNameSpaceHelper(NameSpaceHelper nameSpaceHelper) {
+    myNameSpaceHelper = nameSpaceHelper;
+  }
+
+  public static MultiMap<SchemaTypeInfo, SchemaTypeInfo> parse(final InputStream is) {
+    return parse(new InputStreamReader(is));
+  }
+
+  public static MultiMap<SchemaTypeInfo, SchemaTypeInfo> parse(final Reader reader) {
+    try {
+      final XsdComplexTypeInfoBuilder builder = new XsdComplexTypeInfoBuilder();
+      final NameSpaceHelper helper = new NameSpaceHelper();
+      builder.setNameSpaceHelper(helper);
+      NanoXmlUtil.parse(reader, builder, helper);
+      final MultiMap<SchemaTypeInfo,SchemaTypeInfo> map = builder.getMap();
+      return map;
+    } finally {
+      try {
+        if (reader != null) {
+          reader.close();
+        }
+      }
+      catch (IOException e) {
+        // can never happen
+      }
+    }
+  }
+
+  private XsdComplexTypeInfoBuilder() {
+    myMap = new MultiMap<SchemaTypeInfo, SchemaTypeInfo>();
+  }
+
+  public MultiMap<SchemaTypeInfo, SchemaTypeInfo> getMap() {
+    return myMap;
+  }
+
+  // todo work with substitution groups also!
+
+  private String myCurrentElementName;
+  private String myCurrentElementNsName;
+  private String myCurrentComplexTypeName;
+  private String myCurrentComplexTypeNsName;
+  private String myCurrentSimpleTypeName;
+  private String myCurrentSimpleTypeNsName;
+
+  private boolean myInsideSchema;
+  private boolean myInsideRestriction;
+  private boolean myInsideExtension;
+  private boolean myInsideContent;
+
+  @Override
+  public void startElement(String name, String nsPrefix, String nsURI, String systemID, int lineNr) throws Exception {
+    if (! HTTP_WWW_W3_ORG_2001_XMLSCHEMA.equals(nsURI)) return;
+    myInsideSchema = false;
+    if ("schema".equals(name)) {
+      myInsideSchema = true;
+    } else if ("complexType".equals(name)) {
+      myCurrentComplexTypeName = SIGN;
+      myCurrentComplexTypeNsName = nsURI;
+    } else if ("simpleType".equals(name)) {
+      myCurrentSimpleTypeName = SIGN;
+      myCurrentSimpleTypeNsName = nsURI;
+    } else if ("element".equals(name)) {
+      myCurrentElementNsName = nsURI;
+      myCurrentElementName = SIGN;
+    } else if ("restriction".equals(name)) {
+      myInsideRestriction = true;
+    } else if ("extension".equals(name)) {
+      myInsideExtension = true;
+    } else if ("simpleContent".equals(name) || "complexContent".equals(name)) {
+      myInsideContent = true;
+    }
+  }
+
+  @Override
+  public void endElement(String name, String nsPrefix, String nsURI) throws Exception {
+    if (! HTTP_WWW_W3_ORG_2001_XMLSCHEMA.equals(nsURI)) return;
+    if ("schema".equals(name)) {
+      myInsideSchema = false;
+    } else if ("complexType".equals(name)) {
+      myCurrentComplexTypeName = null;
+      myCurrentComplexTypeNsName = null;
+    } else if ("simpleType".equals(name)) {
+      myCurrentSimpleTypeName = null;
+      myCurrentSimpleTypeNsName = null;
+    } else if ("element".equals(name)) {
+      myCurrentElementNsName = null;
+      myCurrentElementName = null;
+    } else if ("restriction".equals(name)) {
+      myInsideRestriction = false;
+    } else if ("extension".equals(name)) {
+      myInsideExtension = false;
+    } else if ("simpleContent".equals(name) || "complexContent".equals(name)) {
+      myInsideContent = false;
+    }
+  }
+
+  @Override
+  public void addAttribute(String key, String nsPrefix, String nsURI, String value, String type) throws Exception {
+    if (! StringUtil.isEmptyOrSpaces(nsURI) && ! HTTP_WWW_W3_ORG_2001_XMLSCHEMA.equals(nsURI)) return;
+    if ("base".equals(key)) {
+      if (myCurrentComplexTypeName != null && myInsideContent && (myInsideExtension || myInsideRestriction)) {
+        putTypeDataToMap(nsURI, value, myCurrentComplexTypeName, myCurrentComplexTypeNsName);
+      } else if (myCurrentSimpleTypeName != null && myInsideRestriction) {
+        putTypeDataToMap(nsURI, value, myCurrentSimpleTypeName, myCurrentSimpleTypeNsName);
+      }
+    } else if (myInsideSchema) {
+    } else if ("name".equals(key) || "ref".equals(key)) {
+      if (SIGN.equals(myCurrentElementName) && ! myInsideContent && ! myInsideExtension && ! myInsideRestriction && ! myInsideSchema &&
+        myCurrentComplexTypeName == null && myCurrentSimpleTypeName == null) {
+        myCurrentElementName = value;
+      } else if (SIGN.equals(myCurrentComplexTypeName) && ! myInsideContent && ! myInsideExtension && ! myInsideRestriction && ! myInsideSchema &&
+              myCurrentSimpleTypeName == null) {
+        myCurrentComplexTypeName = value;
+      } else if (SIGN.equals(myCurrentSimpleTypeName) && ! myInsideContent && ! myInsideExtension && ! myInsideRestriction && ! myInsideSchema &&
+                 myCurrentComplexTypeName == null) {
+        myCurrentSimpleTypeName = value;
+      }
+    }
+  }
+
+  private void putTypeDataToMap(String nsURI, String value, final String typeName, final String typeNamespace) {
+    /*final int separatorIdx = value.indexOf(':');
+    final String ns = separatorIdx <= 0 ? "" : new String(value.substring(0, separatorIdx));
+    final String element = separatorIdx <= 0 ? value : new String(value.substring(separatorIdx + 1));
+    String nsUri = myNameSpaceHelper.getNamespaces().get(ns);
+    nsUri = (nsUri == null ? ns : nsURI);*/
+
+    final boolean isAnonymous = SIGN.equals(typeName);
+    if (isAnonymous && myCurrentElementName != null) {
+      myMap.putValue(createSchemaTypeInfo(value, true), createSchemaTypeInfo(myCurrentElementName, false));
+    } else {
+      myMap.putValue(createSchemaTypeInfo(value, true), createSchemaTypeInfo(typeName, true));
+      //myMap.putValue(new SchemaTypeInfo(element, true, nsURI), new SchemaTypeInfo(typeName, true, typeNamespace));
+    }
+  }
+
+  private SchemaTypeInfo createSchemaTypeInfo(final String value, final boolean isType) {
+    final int separatorIdx = value.indexOf(':');
+    final String ns = separatorIdx <= 0 ? "" : new String(value.substring(0, separatorIdx));
+    final String element = separatorIdx <= 0 ? value : new String(value.substring(separatorIdx + 1));
+    String nsUri = myNameSpaceHelper.getNamespaces().get(ns);
+    nsUri = nsUri == null ? ns : nsUri;
+    return new SchemaTypeInfo(element, isType, nsUri);
+  }
+
+  private static class NameSpaceHelper extends NanoXmlUtil.EmptyValidator {
+    public static final String XMLNS = "xmlns";
+    public static final String XMLNS_ = "xmlns:";
+    private boolean myInSchema;
+    private final Map<String, String> myNamespaces;
+
+    private NameSpaceHelper() {
+      myNamespaces = new HashMap<String, String>();
+    }
+
+    @Override
+    public void attributeAdded(String key, String value, String systemId, int lineNr) {
+      super.attributeAdded(key, value, systemId, lineNr);
+      if (myInSchema) {
+        if (key.startsWith(XMLNS)) {
+          if (key.length() == XMLNS.length()) {
+            myNamespaces.put("", value);
+          } else if (key.startsWith(XMLNS_)) {
+            final String prefix = new String(key.substring(XMLNS_.length()));
+            myNamespaces.put(prefix, value);
+          }
+        }
+      }
+    }
+
+    @Override
+    public void elementStarted(String name, String systemId, int lineNr) {
+      super.elementStarted(name, systemId, lineNr);
+      myInSchema = "schema".equals(name) || name.endsWith(":schema");
+    }
+
+    public Map<String, String> getNamespaces() {
+      return myNamespaces;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/index/XsdTagNameBuilder.java b/xml/impl/src/com/intellij/xml/index/XsdTagNameBuilder.java
new file mode 100644
index 0000000..1754fbd
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/index/XsdTagNameBuilder.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.index;
+
+import com.intellij.util.xml.NanoXmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XsdTagNameBuilder extends NanoXmlUtil.IXMLBuilderAdapter {
+
+  @Nullable
+  public static Collection<String> computeTagNames(final InputStream is) {
+    return computeTagNames(new InputStreamReader(is));
+  }
+
+  @Nullable
+  public static Collection<String> computeTagNames(final Reader reader) {
+    try {
+      final XsdTagNameBuilder builder = new XsdTagNameBuilder();
+      NanoXmlUtil.parse(reader, builder);
+      return builder.myTagNames;
+    }
+    finally {
+      try {
+        if (reader != null) {
+          reader.close();
+        }
+      }
+      catch (IOException e) {
+        // can never happen
+      }
+    }
+  }
+
+  private final Collection<String> myTagNames = new ArrayList<String>();
+  private boolean myElementStarted;
+
+  public void startElement(@NonNls final String name, @NonNls final String nsPrefix, @NonNls final String nsURI, final String systemID, final int lineNr)
+      throws Exception {
+
+    myElementStarted = nsPrefix != null && nsURI.equals("http://www.w3.org/2001/XMLSchema") && name.equals("element");
+  }
+
+  public void addAttribute(@NonNls final String key, final String nsPrefix, final String nsURI, final String value, final String type)
+      throws Exception {
+    if (myElementStarted && key.equals("name")) {
+      myTagNames.add(value);
+      myElementStarted = false;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/refactoring/SchemaPrefixRenameHandler.java b/xml/impl/src/com/intellij/xml/refactoring/SchemaPrefixRenameHandler.java
new file mode 100644
index 0000000..4e478dd
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/refactoring/SchemaPrefixRenameHandler.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.refactoring;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.impl.source.xml.PossiblePrefixReference;
+import com.intellij.psi.impl.source.xml.SchemaPrefix;
+import com.intellij.refactoring.rename.inplace.VariableInplaceRenameHandler;
+import com.intellij.refactoring.rename.inplace.VariableInplaceRenamer;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collection;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class SchemaPrefixRenameHandler extends VariableInplaceRenameHandler {
+  
+  @Override
+  protected boolean isAvailable(PsiElement element, Editor editor, PsiFile file) {
+    PossiblePrefixReference ref = getReference(file, editor);
+    return ref != null && ref.resolve() instanceof SchemaPrefix;
+  }
+
+  @Nullable
+  private static PossiblePrefixReference getReference(PsiFile file, Editor editor) {
+    if (file != null && editor != null) {
+      int offset = editor.getCaretModel().getOffset();
+      PsiReference reference = file.findReferenceAt(offset);
+      if (reference instanceof PossiblePrefixReference) {
+        return (PossiblePrefixReference)reference;
+      }
+    }
+    return null;
+
+  }
+
+  @Override
+  protected VariableInplaceRenamer createRenamer(@NotNull PsiElement elementToRename, Editor editor) {
+    PossiblePrefixReference reference = getReference(elementToRename.getContainingFile(), editor);
+    if (reference != null) {
+      PsiElement prefix = reference.resolve();
+      if (prefix instanceof SchemaPrefix) {
+        return new VariableInplaceRenamer((PsiNamedElement)prefix, editor) {
+          @Override
+          protected void addReferenceAtCaret(Collection<PsiReference> refs) {}
+
+        };
+      }
+    }
+    if (ApplicationManager.getApplication().isUnitTestMode()) {
+      System.out.println("Reference: " + reference);
+      if (reference != null) {
+        System.out.println("Resolved: " + reference.resolve());
+      }
+    }
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/refactoring/XmlInlineHandler.java b/xml/impl/src/com/intellij/xml/refactoring/XmlInlineHandler.java
new file mode 100644
index 0000000..bd3b6b0
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/refactoring/XmlInlineHandler.java
@@ -0,0 +1,24 @@
+package com.intellij.xml.refactoring;
+
+import com.intellij.lang.refactoring.InlineHandler;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.psi.PsiElement;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class XmlInlineHandler implements InlineHandler {
+  @Override
+  public Settings prepareInlineElement(PsiElement element, Editor editor, boolean invokedOnReference) {
+    return null;
+  }
+
+  @Override
+  public void removeDefinition(PsiElement element, Settings settings) {
+  }
+
+  @Override
+  public Inliner createInliner(PsiElement element, Settings settings) {
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/refactoring/XmlTagInplaceRenamer.java b/xml/impl/src/com/intellij/xml/refactoring/XmlTagInplaceRenamer.java
new file mode 100644
index 0000000..9585643
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/refactoring/XmlTagInplaceRenamer.java
@@ -0,0 +1,196 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: spleaner
+ * Date: Aug 8, 2007
+ * Time: 2:20:33 PM
+ */
+package com.intellij.xml.refactoring;
+
+import com.intellij.codeInsight.daemon.impl.quickfix.EmptyExpression;
+import com.intellij.codeInsight.highlighting.HighlightManager;
+import com.intellij.codeInsight.template.*;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.colors.EditorColors;
+import com.intellij.openapi.editor.colors.EditorColorsManager;
+import com.intellij.openapi.editor.markup.RangeHighlighter;
+import com.intellij.openapi.editor.markup.TextAttributes;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.refactoring.RefactoringBundle;
+import com.intellij.refactoring.util.CommonRefactoringUtil;
+import com.intellij.util.PairProcessor;
+import com.intellij.util.containers.Stack;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class XmlTagInplaceRenamer {
+  @NonNls private static final String PRIMARY_VARIABLE_NAME = "PrimaryVariable";
+  @NonNls private static final String OTHER_VARIABLE_NAME = "OtherVariable";
+
+  private final Editor myEditor;
+
+  private final static Stack<XmlTagInplaceRenamer> ourRenamersStack = new Stack<XmlTagInplaceRenamer>();
+  private ArrayList<RangeHighlighter> myHighlighters;
+
+  private XmlTagInplaceRenamer(@NotNull final Editor editor) {
+    myEditor = editor;
+  }
+
+  public static void rename(final Editor editor, @NotNull final XmlTag tag) {
+    if (!ourRenamersStack.isEmpty()) {
+      ourRenamersStack.peek().finish();
+    }
+
+    final XmlTagInplaceRenamer renamer = new XmlTagInplaceRenamer(editor);
+    ourRenamersStack.push(renamer);
+    renamer.rename(tag);
+  }
+
+  private void rename(@NotNull final XmlTag tag) {
+    final Pair<ASTNode, ASTNode> pair = getNamePair(tag);
+    if (pair == null) return;
+
+    final Project project = myEditor.getProject();
+    if (project != null) {
+
+      final List<TextRange> highlightRanges = new ArrayList<TextRange>();
+      highlightRanges.add(pair.first.getTextRange());
+      if (pair.second != null) {
+        highlightRanges.add(pair.second.getTextRange());
+      }
+
+      if (!CommonRefactoringUtil.checkReadOnlyStatus(project, tag)) {
+        return;
+      }
+
+      myHighlighters = new ArrayList<RangeHighlighter>();
+
+      CommandProcessor.getInstance().executeCommand(project, new Runnable() {
+        public void run() {
+          ApplicationManager.getApplication().runWriteAction(new Runnable() {
+            public void run() {
+              final int offset = myEditor.getCaretModel().getOffset();
+              myEditor.getCaretModel().moveToOffset(tag.getTextOffset());
+
+              final Template t = buildTemplate(tag, pair);
+              TemplateManager.getInstance(project).startTemplate(myEditor, t, new TemplateEditingAdapter() {
+                public void templateFinished(final Template template, boolean brokenOff) {
+                  finish();
+                }
+
+                public void templateCancelled(final Template template) {
+                  finish();
+                }
+              }, new PairProcessor<String, String>() {
+                public boolean process(final String variableName, final String value) {
+                  return value.length() == 0 || value.charAt(value.length() - 1) != ' ';
+                }
+              });
+
+              // restore old offset
+              myEditor.getCaretModel().moveToOffset(offset);
+
+              addHighlights(highlightRanges, myEditor, myHighlighters);
+            }
+          });
+        }
+      }, RefactoringBundle.message("rename.title"), null);
+    }
+  }
+
+  private void finish() {
+    ourRenamersStack.pop();
+
+    if (myHighlighters != null) {
+      final HighlightManager highlightManager = HighlightManager.getInstance(myEditor.getProject());
+      for (final RangeHighlighter highlighter : myHighlighters) {
+        highlightManager.removeSegmentHighlighter(myEditor, highlighter);
+      }
+    }
+  }
+
+  private Pair<ASTNode, ASTNode> getNamePair(@NotNull final XmlTag tag) {
+    final int offset = myEditor.getCaretModel().getOffset();
+
+    final ASTNode node = tag.getNode();
+    assert node != null;
+
+    final ASTNode startTagName = XmlChildRole.START_TAG_NAME_FINDER.findChild(node);
+    if (startTagName == null) return null;
+
+    final ASTNode endTagName = XmlChildRole.CLOSING_TAG_NAME_FINDER.findChild(node);
+
+    final ASTNode selected = (endTagName == null ||
+                              startTagName.getTextRange().contains(offset) ||
+                              startTagName.getTextRange().contains(offset - 1))
+                             ? startTagName
+                             : endTagName;
+    final ASTNode other = (selected == startTagName) ? endTagName : startTagName;
+
+    return new Pair<ASTNode, ASTNode>(selected, other);
+  }
+
+  private static Template buildTemplate(@NotNull final XmlTag tag, @NotNull final Pair<ASTNode, ASTNode> pair) {
+    final TemplateBuilderImpl builder = new TemplateBuilderImpl(tag);
+
+    final ASTNode selected = pair.first;
+    final ASTNode other = pair.second;
+
+    builder.replaceElement(selected.getPsi(), PRIMARY_VARIABLE_NAME, new EmptyExpression() {
+      public Result calculateQuickResult(final ExpressionContext context) {
+        return new TextResult(selected.getText());
+      }
+
+      public Result calculateResult(final ExpressionContext context) {
+        return new TextResult(selected.getText());
+      }
+    }, true);
+
+    if (other != null) {
+      builder.replaceElement(other.getPsi(), OTHER_VARIABLE_NAME, PRIMARY_VARIABLE_NAME, false);
+    }
+
+    return builder.buildInlineTemplate();
+  }
+
+  private static void addHighlights(List<TextRange> ranges, Editor editor, ArrayList<RangeHighlighter> highlighters) {
+    EditorColorsManager colorsManager = EditorColorsManager.getInstance();
+    final TextAttributes attributes = colorsManager.getGlobalScheme().getAttributes(EditorColors.WRITE_SEARCH_RESULT_ATTRIBUTES);
+
+    final HighlightManager highlightManager = HighlightManager.getInstance(editor.getProject());
+    for (final TextRange range : ranges) {
+      highlightManager.addOccurrenceHighlight(editor, range.getStartOffset(), range.getEndOffset(), attributes, 0, highlighters, null);
+    }
+
+    for (RangeHighlighter highlighter : highlighters) {
+      highlighter.setGreedyToLeft(true);
+      highlighter.setGreedyToRight(true);
+    }
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/xml/refactoring/XmlTagRenameDialog.java b/xml/impl/src/com/intellij/xml/refactoring/XmlTagRenameDialog.java
new file mode 100644
index 0000000..342a2e5
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/refactoring/XmlTagRenameDialog.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: spleaner
+ * Date: Aug 9, 2007
+ * Time: 4:45:40 PM
+ */
+package com.intellij.xml.refactoring;
+
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupManager;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.fileTypes.FileTypes;
+import com.intellij.openapi.help.HelpManager;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.impl.source.xml.TagNameReference;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.refactoring.RefactoringBundle;
+import com.intellij.refactoring.ui.NameSuggestionsField;
+import com.intellij.refactoring.ui.RefactoringDialog;
+import com.intellij.ui.IdeBorderFactory;
+import com.intellij.usageView.UsageViewUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+
+public class XmlTagRenameDialog extends RefactoringDialog {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.refactoring.XmlTagRenameDialog");
+  private static final String REFACTORING_NAME = RefactoringBundle.message("rename.title");
+
+  private final PsiElement myElement;
+  private final Editor myEditor;
+  private JLabel myTitleLabel;
+  private NameSuggestionsField myNameSuggestionsField;
+  private String myHelpID;
+  private final XmlTag myTag;
+  private NameSuggestionsField.DataChanged myNameChangedListener;
+
+  public XmlTagRenameDialog(@NotNull final Editor editor, @NotNull final PsiElement element, @NotNull final XmlTag tag) {
+    super(element.getProject(), true);
+
+    myEditor = editor;
+    myElement = element;
+    myTag = tag;
+
+    setTitle(REFACTORING_NAME);
+    createNewNameComponent();
+
+    init();
+
+    myTitleLabel.setText(XmlBundle.message("rename.current.tag", getFullName(tag)));
+
+    validateButtons();
+  }
+
+  protected void dispose() {
+    myNameSuggestionsField.removeDataChangedListener(myNameChangedListener);
+    super.dispose();
+  }
+
+  protected boolean hasHelpAction() {
+    return false;
+  }
+
+  private static String getFullName(@NotNull final XmlTag tag) {
+    final String name = UsageViewUtil.getDescriptiveName(tag);
+    return (UsageViewUtil.getType(tag) + " " + name).trim();
+  }
+
+  public static void renameXmlTag(final Editor editor, @NotNull final PsiElement element, @NotNull final XmlTag tag) {
+    final XmlTagRenameDialog dialog = new XmlTagRenameDialog(editor, element, tag);
+    dialog.show();
+  }
+
+  private void createNewNameComponent() {
+    myNameSuggestionsField = new NameSuggestionsField(new String[] { myTag.getName() }, myProject, FileTypes.PLAIN_TEXT, myEditor);
+    myNameChangedListener = new NameSuggestionsField.DataChanged() {
+      public void dataChanged() {
+        validateButtons();
+      }
+    };
+    myNameSuggestionsField.addDataChangedListener(myNameChangedListener);
+
+    myNameSuggestionsField.getComponent().registerKeyboardAction(new ActionListener() {
+      public void actionPerformed(ActionEvent e) {
+        completeVariable(myNameSuggestionsField.getEditor());
+      }
+    }, KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.CTRL_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW);
+  }
+
+  private void completeVariable(final Editor editor) {
+    String prefix = myNameSuggestionsField.getEnteredName();
+
+    final PsiReference reference = myTag.getReference();
+    if (reference instanceof TagNameReference) {
+      LookupElement[] lookupItems = ((TagNameReference)reference).getVariants();
+      editor.getCaretModel().moveToOffset(prefix.length());
+      editor.getSelectionModel().removeSelection();
+      LookupManager.getInstance(getProject()).showLookup(editor, lookupItems, prefix);
+    }
+  }
+
+  protected void doAction() {
+    LOG.assertTrue(myElement.isValid());
+
+    CommandProcessor.getInstance().executeCommand(myProject, new Runnable() {
+      public void run() {
+        ApplicationManager.getApplication().runWriteAction(new Runnable() {
+          public void run() {
+            try {
+              myTag.setName(getNewName());
+            }
+            catch (IncorrectOperationException e) {
+              LOG.error(e);
+            }
+          }
+        });
+      }
+    }, RefactoringBundle.message("rename.title"), null);
+
+    close(DialogWrapper.OK_EXIT_CODE);
+  }
+
+  @Nullable
+  protected JComponent createCenterPanel() {
+    return null;
+  }
+
+  public JComponent getPreferredFocusedComponent() {
+    return myNameSuggestionsField.getFocusableComponent();
+  }
+
+  protected JComponent createNorthPanel() {
+    final JPanel panel = new JPanel();
+    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
+    panel.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
+
+    myTitleLabel = new JLabel();
+    panel.add(myTitleLabel);
+    panel.add(Box.createVerticalStrut(8));
+    panel.add(myNameSuggestionsField.getComponent());
+
+    return panel;
+  }
+
+  protected void doHelpAction() {
+    HelpManager.getInstance().invokeHelp(myHelpID);
+  }
+
+  public String getNewName() {
+    return myNameSuggestionsField.getEnteredName().trim();
+  }
+
+  protected void validateButtons() {
+    super.validateButtons();
+
+    getPreviewAction().setEnabled(false);
+  }
+
+  protected boolean areButtonsValid() {
+    final String newName = getNewName();
+    return !StringUtil.containsAnyChar(newName, "\t ;*'\"\\/,()^&<>={}"); // RenameUtil.isValidName(myProject, myTag, newName); // IDEADEV-34531
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/refactoring/XmlTagRenameHandler.java b/xml/impl/src/com/intellij/xml/refactoring/XmlTagRenameHandler.java
new file mode 100644
index 0000000..e2531e7
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/refactoring/XmlTagRenameHandler.java
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: spleaner
+ * Date: Aug 7, 2007
+ * Time: 2:44:37 PM
+ */
+package com.intellij.xml.refactoring;
+
+import com.intellij.featureStatistics.FeatureUsageTracker;
+import com.intellij.ide.TitledHandler;
+import com.intellij.lang.Language;
+import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.actionSystem.LangDataKeys;
+import com.intellij.openapi.actionSystem.PlatformDataKeys;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.util.PsiUtilBase;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.refactoring.actions.BaseRefactoringAction;
+import com.intellij.refactoring.rename.PsiElementRenameHandler;
+import com.intellij.refactoring.rename.RenameHandler;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class XmlTagRenameHandler implements RenameHandler, TitledHandler {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.refactoring.XmlTagRenameHandler");
+
+
+  public boolean isAvailableOnDataContext(final DataContext dataContext) {
+    final PsiElement element = getElement(dataContext);
+    if (element == null || PsiElementRenameHandler.isVetoed(element)) return false;
+    PsiElement parent = element.getParent();
+    if (!(parent instanceof XmlTag)) {
+      return false;
+    }
+    XmlTag tag = (XmlTag)parent;
+    String prefix = tag.getNamespacePrefix();
+    if (StringUtil.isNotEmpty(prefix)) {
+      Editor editor = getEditor(dataContext);
+      assert editor != null;
+      int offset = editor.getCaretModel().getOffset();
+      if (offset <= element.getTextRange().getStartOffset() + prefix.length()) {
+        return false;
+      }
+    }
+    //noinspection ConstantConditions
+    return isDeclarationOutOfProjectOrAbsent(element.getProject(), dataContext);
+  }
+
+  public boolean isRenaming(final DataContext dataContext) {
+    return isAvailableOnDataContext(dataContext);
+  }
+
+  @Override
+  public String getActionTitle() {
+    return "Rename XML tag";
+  }
+
+  private static boolean isInplaceRenameAvailable(final Editor editor) {
+    return editor.getSettings().isVariableInplaceRenameEnabled();
+  }
+
+  private static boolean isDeclarationOutOfProjectOrAbsent(@NotNull final Project project, final DataContext context) {
+    final PsiElement[] elements = BaseRefactoringAction.getPsiElementArray(context);
+    return elements.length == 0 || elements.length == 1 && shouldBeRenamedInplace(project, elements);
+  }
+
+  private static boolean shouldBeRenamedInplace(Project project, PsiElement[] elements) {
+    boolean inProject = PsiManager.getInstance(project).isInProject(elements[0]);
+    if (inProject && elements[0] instanceof XmlTag) {
+      XmlElementDescriptor descriptor = ((XmlTag)elements[0]).getDescriptor();
+      return descriptor instanceof AnyXmlElementDescriptor;
+    }
+    return !inProject;
+  }
+
+  @Nullable
+  private static Editor getEditor(@Nullable DataContext context) {
+    return PlatformDataKeys.EDITOR.getData(context);
+  }
+
+  @Nullable
+  private static PsiElement getElement(@Nullable final DataContext context) {
+    if (context != null) {
+      final Editor editor = getEditor(context);
+      if (editor != null) {
+        final int offset = editor.getCaretModel().getOffset();
+        final PsiFile file = LangDataKeys.PSI_FILE.getData(context);
+        if (file instanceof XmlFile) {
+          return file.getViewProvider().findElementAt(offset);
+        }
+        if (file != null) {
+          final Language language = PsiUtilBase.getLanguageAtOffset(file, offset);
+          if (language != file.getLanguage()) {
+            final PsiFile psiAtOffset = file.getViewProvider().getPsi(language);
+            if (psiAtOffset instanceof XmlFile) {
+              return psiAtOffset.findElementAt(offset);
+            }
+          }
+        }
+      }
+    }
+
+    return null;
+  }
+
+  private void invoke(@Nullable final Editor editor, @NotNull final PsiElement element, @Nullable final DataContext context) {
+    if (!isRenaming(context)) {
+      return;
+    }
+
+    FeatureUsageTracker.getInstance().triggerFeatureUsed("refactoring.rename");
+
+    if (isInplaceRenameAvailable(editor)) {
+      XmlTagInplaceRenamer.rename(editor, (XmlTag)element.getParent());
+    }
+    else {
+      XmlTagRenameDialog.renameXmlTag(editor, element, (XmlTag)element.getParent());
+    }
+  }
+
+  public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file, @Nullable final DataContext dataContext) {
+    if (!isRenaming(dataContext)) {
+      return;
+    }
+
+    final PsiElement element = getElement(dataContext);
+    assert element != null;
+
+    invoke(editor, element, dataContext);
+  }
+
+  public void invoke(@NotNull final Project project, @NotNull final PsiElement[] elements, @Nullable final DataContext dataContext) {
+    PsiElement element = elements.length == 1 ? elements[0] : null;
+    if (element == null) {
+      element = getElement(dataContext);
+    }
+
+    LOG.assertTrue(element != null);
+    invoke(getEditor(dataContext), element, dataContext);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/AnchorPathReferenceProvider.java b/xml/impl/src/com/intellij/xml/util/AnchorPathReferenceProvider.java
new file mode 100644
index 0000000..74030d7
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/AnchorPathReferenceProvider.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.openapi.paths.PathReference;
+import com.intellij.openapi.paths.PathReferenceProvider;
+import com.intellij.openapi.paths.DynamicContextProvider;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.ElementManipulators;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class AnchorPathReferenceProvider implements PathReferenceProvider {
+
+  public boolean createReferences(@NotNull final PsiElement psiElement, final @NotNull List<PsiReference> references, final boolean soft) {
+
+    final TextRange range = ElementManipulators.getValueTextRange(psiElement);
+    final String elementText = psiElement.getText();
+    final int anchorOffset = elementText.indexOf('#');
+    if (anchorOffset == -1) {
+      return false;
+    }
+    final boolean dynamic = isDynamic(psiElement, anchorOffset + 1, elementText);
+    if (dynamic) {
+      return false;
+    }
+
+    FileReference fileReference = null;
+    if (range.getStartOffset() != anchorOffset) {
+      fileReference = findFileReference(references);
+      if (fileReference == null || fileReference.resolve() == null) {
+        return false;
+      }
+    }
+    final int pos = elementText.indexOf('?', anchorOffset);
+    final String anchor;
+    try {
+      int endIndex = pos != -1 ? pos : range.getEndOffset();
+      if (endIndex <= anchorOffset) {
+        endIndex = anchorOffset + 1;
+      }
+      anchor = elementText.substring(anchorOffset + 1, endIndex);
+    }
+    catch (StringIndexOutOfBoundsException e) {      
+      throw new RuntimeException(elementText, e);
+    }
+    final AnchorReference anchorReference = new AnchorReference(anchor, fileReference, psiElement, anchorOffset + 1, soft);
+    references.add(anchorReference);
+    return false;
+  }
+
+  private static boolean isDynamic(final PsiElement psiElement, final int offset, final String elementText) {
+    for (DynamicContextProvider provider: Extensions.getExtensions(DynamicContextProvider.EP_NAME)) {
+      final int dynamicOffset = provider.getOffset(psiElement, offset, elementText);
+      if (dynamicOffset != offset) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  @Nullable
+  private static FileReference findFileReference(final List<PsiReference> references) {
+    FileReference fileReference = null;
+    for (PsiReference reference : references) {
+      if (reference instanceof FileReference) {
+        fileReference = ((FileReference)reference).getFileReferenceSet().getLastReference();
+        break;
+      }
+    }
+    return fileReference;
+  }
+
+  public PathReference getPathReference(@NotNull final String path, @NotNull final PsiElement element) {
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/AnchorReference.java b/xml/impl/src/com/intellij/xml/util/AnchorReference.java
new file mode 100644
index 0000000..65e0c1a
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/AnchorReference.java
@@ -0,0 +1,255 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupElementBuilder;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.ElementManipulators;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.HashMap;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.XmlExtension;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class AnchorReference implements PsiReference, EmptyResolveMessageProvider {
+  private final String myAnchor;
+  private final FileReference myFileReference;
+  private final PsiElement myElement;
+  private final int myOffset;
+  private final boolean mySoft;
+  @NonNls
+  private static final String ANCHOR_ELEMENT_NAME = "a";
+  private static final String MAP_ELEMENT_NAME = "map";
+  private static final Key<CachedValue<Map<String,XmlTag>>> ourCachedIdsKey = Key.create("cached.ids");
+
+  AnchorReference(final String anchor, @Nullable final FileReference psiReference, final PsiElement element, final int offset,
+                  final boolean soft) {
+
+    myAnchor = anchor;
+    myFileReference = psiReference;
+    myElement = element;
+    myOffset = offset;
+    mySoft = soft;
+  }
+
+  public PsiElement getElement() {
+    return myElement;
+  }
+
+  public TextRange getRangeInElement() {
+    return new TextRange(myOffset,myOffset+myAnchor.length());
+  }
+
+  public PsiElement resolve() {
+    if (myAnchor.length() == 0) {
+      return myElement;
+    }
+    Map<String,XmlTag> map = getIdMap();
+    final XmlTag tag = map != null ? map.get(myAnchor):null;
+    if (tag != null) {
+      XmlAttribute attribute = tag.getAttribute("id");
+      if (attribute==null) attribute = tag.getAttribute("name");
+
+      if (attribute == null && MAP_ELEMENT_NAME.equalsIgnoreCase(tag.getName())) {
+        attribute = tag.getAttribute("usemap");
+      }
+
+      assert attribute != null;
+      return attribute.getValueElement();
+    }
+
+    return null;
+  }
+
+  private static boolean processXmlElements(XmlTag element, PsiElementProcessor<XmlTag> processor) {
+    if (!_processXmlElements(element,processor)) return false;
+
+    for(PsiElement next = element.getNextSibling(); next != null; next = next.getNextSibling()) {
+      if (next instanceof XmlTag) {
+        if (!_processXmlElements((XmlTag)next,processor)) return false;
+      }
+    }
+
+    return true;
+  }
+
+  static boolean _processXmlElements(XmlTag element, PsiElementProcessor<XmlTag> processor) {
+    if (!processor.execute(element)) return false;
+    final XmlTag[] subTags = element.getSubTags();
+
+    for (XmlTag subTag : subTags) {
+      if (!_processXmlElements(subTag, processor)) return false;
+    }
+
+    return true;
+  }
+
+  @Nullable
+  private Map<String,XmlTag> getIdMap() {
+    final XmlFile file = getFile();
+
+    if (file != null) {
+      CachedValue<Map<String, XmlTag>> value = file.getUserData(ourCachedIdsKey);
+      if (value == null) {
+        value = CachedValuesManager.getManager(file.getProject()).createCachedValue(new MapCachedValueProvider(file), false);
+        file.putUserData(ourCachedIdsKey, value);
+      }
+
+      return value.getValue();
+    }
+    return null;
+  }
+
+  @Nullable
+  private static String getAnchorValue(final XmlTag xmlTag) {
+    final String attributeValue = xmlTag.getAttributeValue("id");
+
+    if (attributeValue!=null) {
+      return attributeValue;
+    }
+
+    if (ANCHOR_ELEMENT_NAME.equalsIgnoreCase(xmlTag.getName())) {
+      final String attributeValue2 = xmlTag.getAttributeValue("name");
+      if (attributeValue2!=null) {
+        return attributeValue2;
+      }
+    }
+
+    if (MAP_ELEMENT_NAME.equalsIgnoreCase(xmlTag.getName())) {
+      final String map_anchor = xmlTag.getAttributeValue("name");
+      if (map_anchor != null) {
+        return map_anchor;
+      }
+    }
+
+    return null;
+  }
+
+  @NotNull
+  public String getCanonicalText() {
+    return myAnchor;
+  }
+
+  public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
+    return ElementManipulators.getManipulator(myElement).handleContentChange(
+      myElement,
+      getRangeInElement(),
+      newElementName
+    );
+  }
+
+  @Nullable
+  public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+    return null;
+  }
+
+  public boolean isReferenceTo(PsiElement element) {
+    if (!(element instanceof XmlAttributeValue)) return false;
+    return myElement.getManager().areElementsEquivalent(element,resolve());
+  }
+
+  @NotNull
+  public Object[] getVariants() {
+    final Map<String, XmlTag> idMap = getIdMap();
+    if (idMap == null) return ArrayUtil.EMPTY_OBJECT_ARRAY;
+
+    String[] variants = idMap.keySet().toArray(new String[idMap.size()]);
+    LookupElement[] elements = new LookupElement[variants.length];
+    for (int i = 0, variantsLength = variants.length; i < variantsLength; i++) {
+      elements[i] = LookupElementBuilder.create(variants[i]).withCaseSensitivity(true);
+    }
+    return elements;
+  }
+
+  @Nullable
+  private XmlFile getFile() {
+    if (myFileReference != null) {
+      final PsiElement psiElement = myFileReference.resolve();
+      return psiElement instanceof XmlFile ? (XmlFile)psiElement:null;
+    }
+
+    final PsiFile containingFile = myElement.getContainingFile();
+    if (containingFile instanceof XmlFile) {
+      return (XmlFile)containingFile;
+    }
+    else {
+      final XmlExtension extension = XmlExtension.getExtensionByElement(myElement);
+      return extension == null ? null : extension.getContainingFile(myElement);
+    }
+  }
+
+  public boolean isSoft() {
+    return mySoft;
+  }
+
+  public String getUnresolvedMessagePattern() {
+    final XmlFile xmlFile = getFile();
+    return xmlFile == null ? 
+           XmlBundle.message("cannot.resolve.anchor", myAnchor) :
+           XmlBundle.message("cannot.resolve.anchor.in.file", myAnchor, xmlFile.getName());
+  }
+
+  // separate static class to avoid memory leak via this$0
+  private static class MapCachedValueProvider implements CachedValueProvider<Map<String, XmlTag>> {
+    private final XmlFile myFile;
+
+    public MapCachedValueProvider(XmlFile file) {
+      myFile = file;
+    }
+
+    public Result<Map<String, XmlTag>> compute() {
+      final Map<String,XmlTag> resultMap = new HashMap<String, XmlTag>();
+      XmlDocument document = HtmlUtil.getRealXmlDocument(myFile.getDocument());
+      final XmlTag rootTag = document != null ? document.getRootTag():null;
+
+      if (rootTag != null) {
+        processXmlElements(rootTag,
+          new PsiElementProcessor<XmlTag>() {
+            public boolean execute(@NotNull final XmlTag element) {
+              final String anchorValue = getAnchorValue(element);
+
+              if (anchorValue!=null) {
+                resultMap.put(anchorValue, element);
+              }
+              return true;
+            }
+          }
+        );
+      }
+      return new Result<Map<String, XmlTag>>(resultMap, myFile);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/CheckDtdReferencesInspection.java b/xml/impl/src/com/intellij/xml/util/CheckDtdReferencesInspection.java
new file mode 100644
index 0000000..5ce4df8
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/CheckDtdReferencesInspection.java
@@ -0,0 +1,223 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.xml.util;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor;
+import com.intellij.codeInsight.template.Template;
+import com.intellij.codeInsight.template.TemplateManager;
+import com.intellij.codeInspection.*;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.fileEditor.FileEditorManager;
+import com.intellij.openapi.fileEditor.OpenFileDescriptor;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.*;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.containers.HashMap;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.PropertyKey;
+
+import java.util.Map;
+
+/**
+ * @author Maxim Mossienko
+ */
+public class CheckDtdReferencesInspection extends XmlSuppressableInspectionTool {
+  public boolean isEnabledByDefault() {
+    return true;
+  }
+
+  @NotNull
+  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) {
+    return new XmlElementVisitor() {
+
+      private Map<PsiFile, Boolean> myDoctypeMap = new HashMap<PsiFile, Boolean>();
+
+      @Override
+      public void visitXmlElement(final XmlElement element) {
+        if (isHtml5Doctype(element)) {
+          return;
+        }
+
+        if (element instanceof XmlElementContentSpec ||
+            element instanceof XmlEntityRef
+          ) {
+          doCheckRefs(element, holder);
+        }
+      }
+
+      private boolean isHtml5Doctype(XmlElement element) {
+        if (HtmlUtil.isHtml5Context(element)) {
+          return true;
+        }
+
+        PsiFile file = element.getContainingFile();
+        if (file instanceof XmlFile) {
+          if (!myDoctypeMap.containsKey(file)) {
+            myDoctypeMap.put(file, computeHtml5Doctype((XmlFile)file));
+          }
+          return myDoctypeMap.get(file);
+        }
+        return false;
+      }
+
+      private Boolean computeHtml5Doctype(XmlFile file) {
+        XmlDoctype doctype = null;
+        //Search for doctypes from providers
+        for (HtmlDoctypeProvider provider : HtmlDoctypeProvider.EP_NAME.getExtensions()) {
+          doctype = provider.getDoctype(file);
+          if (doctype != null) {
+            break;
+          }
+        }
+
+        if (doctype != null && HtmlUtil.isHtml5Doctype(doctype)) {
+          return true;
+        }
+
+        return false;
+      }
+    };
+  }
+
+  private static void doCheckRefs(final XmlElement element, final ProblemsHolder holder) {
+    for (PsiReference ref : element.getReferences()) {
+      ProgressManager.checkCanceled();
+      if (XmlHighlightVisitor.hasBadResolve(ref, true)) {
+        if (ref.getElement() instanceof XmlElementContentSpec) {
+          final String image = ref.getCanonicalText();
+          if (image.equals("-") || image.equals("O")) continue;
+        }
+        holder.registerProblem(ref);
+      }
+    }
+  }
+
+  @NotNull
+  public HighlightDisplayLevel getDefaultLevel() {
+    return HighlightDisplayLevel.ERROR;
+  }
+
+  @NotNull
+  public String getGroupDisplayName() {
+    return XmlInspectionGroupNames.XML_INSPECTIONS;
+  }
+
+  @NotNull
+  public String getDisplayName() {
+    return XmlBundle.message("xml.inspections.check.dtd.references");
+  }
+
+  @NotNull
+  @NonNls
+  public String getShortName() {
+    return "CheckDtdRefs";
+  }
+
+  public static class AddDtdDeclarationFix implements LocalQuickFix {
+    private final String myMessageKey;
+    private final String myElementDeclarationName;
+    private final String myReference;
+
+    public AddDtdDeclarationFix(
+      @PropertyKey(resourceBundle = XmlBundle.PATH_TO_BUNDLE) String messageKey,
+      @NotNull String elementDeclarationName,
+      @NotNull PsiReference reference) {
+      myMessageKey = messageKey;
+      myElementDeclarationName = elementDeclarationName;
+      myReference = reference.getCanonicalText();
+    }
+
+    @NotNull
+    public String getName() {
+      return XmlBundle.message(myMessageKey, myReference);
+    }
+
+    @NotNull
+    public String getFamilyName() {
+      return getName();
+    }
+
+    public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
+      final PsiElement element = descriptor.getPsiElement();
+      final PsiFile containingFile = element.getContainingFile();
+      if (!CodeInsightUtilBase.prepareFileForWrite(containingFile)) return;
+
+      @NonNls String prefixToInsert = "";
+      @NonNls String suffixToInsert = "";
+
+      final int UNDEFINED_OFFSET = -1;
+      int anchorOffset = UNDEFINED_OFFSET;
+      PsiElement anchor =
+        PsiTreeUtil.getParentOfType(element, XmlElementDecl.class, XmlAttlistDecl.class, XmlEntityDecl.class, XmlConditionalSection.class);
+      if (anchor != null) anchorOffset = anchor.getTextRange().getStartOffset();
+
+      if (anchorOffset == UNDEFINED_OFFSET && containingFile.getLanguage() == XMLLanguage.INSTANCE) {
+        XmlFile file = (XmlFile)containingFile;
+        final XmlProlog prolog = file.getDocument().getProlog();
+        assert prolog != null;
+
+        final XmlDoctype doctype = prolog.getDoctype();
+        final XmlMarkupDecl markupDecl;
+
+        if (doctype != null) {
+          markupDecl = doctype.getMarkupDecl();
+        }
+        else {
+          markupDecl = null;
+        }
+
+        if (doctype == null) {
+          final XmlTag rootTag = file.getDocument().getRootTag();
+          prefixToInsert = "<!DOCTYPE " + ((rootTag != null) ? rootTag.getName() : "null");
+          suffixToInsert = ">\n";
+        }
+        if (markupDecl == null) {
+          prefixToInsert += " [\n";
+          suffixToInsert = "]" + suffixToInsert;
+
+          if (doctype != null) {
+            anchorOffset = doctype.getTextRange().getEndOffset() - 1; // just before last '>'
+          }
+          else {
+            anchorOffset = prolog.getTextRange().getEndOffset();
+          }
+        }
+      }
+
+      if (anchorOffset == UNDEFINED_OFFSET) anchorOffset = element.getTextRange().getStartOffset();
+
+      OpenFileDescriptor openDescriptor = new OpenFileDescriptor(project, containingFile.getVirtualFile(), anchorOffset);
+      final Editor editor = FileEditorManager.getInstance(project).openTextEditor(openDescriptor, true);
+      final TemplateManager templateManager = TemplateManager.getInstance(project);
+      final Template t = templateManager.createTemplate("", "");
+
+      if (prefixToInsert.length() > 0) t.addTextSegment(prefixToInsert);
+      t.addTextSegment("<!" + myElementDeclarationName + " " + myReference + " ");
+      t.addEndVariable();
+      t.addTextSegment(">\n");
+      if (suffixToInsert.length() > 0) t.addTextSegment(suffixToInsert);
+      templateManager.startTemplate(editor, t);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/CheckEmptyTagInspection.java b/xml/impl/src/com/intellij/xml/util/CheckEmptyTagInspection.java
new file mode 100644
index 0000000..ed169c7
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/CheckEmptyTagInspection.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.xml.util;
+
+import com.intellij.codeInspection.*;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.Language;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.ReadonlyStatusHandler;
+import com.intellij.psi.PsiElementVisitor;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.XmlElementVisitor;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlBundle;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Arrays;
+import java.util.Set;
+
+/**
+ * @author Maxim Mossienko
+ */
+public class CheckEmptyTagInspection extends XmlSuppressableInspectionTool {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.util.CheckEmptyTagInspection");
+  @NonNls private static final String SCRIPT_TAG_NAME = "script";
+  private static final Set<String> ourTagsWithEmptyEndsNotAllowed = new THashSet<String>(Arrays.asList(SCRIPT_TAG_NAME, "div", "iframe"));
+
+  public boolean isEnabledByDefault() {
+    return true;
+  }
+
+  @NotNull
+  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) {
+    return new XmlElementVisitor() {
+      @Override public void visitXmlTag(final XmlTag tag) {
+        if (!isTagWithEmptyEndNotAllowed(tag)) {
+          return;
+        }
+        final ASTNode child = XmlChildRole.EMPTY_TAG_END_FINDER.findChild(tag.getNode());
+
+        if (child == null) {
+          return;
+        }
+
+        final LocalQuickFix fix = new MyLocalQuickFix();
+
+        holder.registerProblem(tag,
+                               XmlBundle.message("html.inspections.check.empty.script.message"),
+                               tag.getContainingFile().getContext() != null ?
+                               ProblemHighlightType.INFORMATION:
+                               ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
+                               fix);
+      }
+    };
+  }
+
+  static boolean isTagWithEmptyEndNotAllowed(final XmlTag tag) {
+    String tagName = tag.getName();
+    if (tag instanceof HtmlTag) tagName = tagName.toLowerCase();
+
+    Language language = tag.getLanguage();
+    return ourTagsWithEmptyEndsNotAllowed.contains(tagName) && language != XMLLanguage.INSTANCE ||
+           language == HTMLLanguage.INSTANCE && !HtmlUtil.isSingleHtmlTagL(tagName) && tagName.indexOf(':') == -1;
+  }
+
+  @NotNull
+  public String getGroupDisplayName() {
+    return XmlInspectionGroupNames.HTML_INSPECTIONS;
+  }
+
+  @NotNull
+  public String getDisplayName() {
+    return XmlBundle.message("html.inspections.check.empty.tag");
+  }
+
+  @NotNull
+  @NonNls
+  public String getShortName() {
+    return "CheckEmptyScriptTag";
+  }
+
+  private static class MyLocalQuickFix implements LocalQuickFix {
+    @NotNull
+    public String getName() {
+      return XmlBundle.message("html.inspections.check.empty.script.tag.fix.message");
+    }
+
+    public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
+      final XmlTag tag = (XmlTag)descriptor.getPsiElement();
+      if (tag == null) return;
+      final PsiFile psiFile = tag.getContainingFile();
+
+      if (psiFile == null) return;
+      ReadonlyStatusHandler.getInstance(project).ensureFilesWritable(psiFile.getVirtualFile());
+
+      try {
+        XmlUtil.expandTag(tag);
+      }
+      catch (IncorrectOperationException e) {
+        LOG.error(e);
+      }
+    }
+
+    //to appear in "Apply Fix" statement when multiple Quick Fixes exist
+    @NotNull
+    public String getFamilyName() {
+      return getName();
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/CheckTagEmptyBodyInspection.java b/xml/impl/src/com/intellij/xml/util/CheckTagEmptyBodyInspection.java
new file mode 100644
index 0000000..59646d4
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/CheckTagEmptyBodyInspection.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.xml.util;
+
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInspection.*;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.fileEditor.FileDocumentManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiElementVisitor;
+import com.intellij.psi.XmlElementVisitor;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Maxim Mossienko
+ */
+public class CheckTagEmptyBodyInspection extends XmlSuppressableInspectionTool {
+  public boolean isEnabledByDefault() {
+    return true;
+  }
+
+  @NotNull
+  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) {
+    return new XmlElementVisitor() {
+      @Override public void visitXmlTag(final XmlTag tag) {
+        if (!CheckEmptyTagInspection.isTagWithEmptyEndNotAllowed(tag)) {
+          final ASTNode child = XmlChildRole.START_TAG_END_FINDER.findChild(tag.getNode());
+
+          if (child != null) {
+            final ASTNode node = child.getTreeNext();
+
+            if (node != null &&
+                node.getElementType() == XmlTokenType.XML_END_TAG_START) {
+              final LocalQuickFix localQuickFix = new ReplaceEmptyTagBodyByEmptyEndFix();
+              holder.registerProblem(
+                tag,
+                XmlBundle.message("xml.inspections.tag.empty.body"),
+                isCollapsableTag(tag) ? localQuickFix : null
+              );
+            }
+          }
+        }
+      }
+    };
+  }
+
+  @SuppressWarnings({"HardCodedStringLiteral"})
+  private static boolean isCollapsableTag(final XmlTag tag) {
+    final String name = tag.getName().toLowerCase();
+    return tag.getLanguage() == XMLLanguage.INSTANCE ||
+           "link".equals(name) || "br".equals(name) || "meta".equals(name) || "img".equals(name) || "input".equals(name) || "hr".equals(name);
+  }
+
+  @NotNull
+  public String getGroupDisplayName() {
+    return XmlInspectionGroupNames.XML_INSPECTIONS;
+  }
+
+  @NotNull
+  public String getDisplayName() {
+    return XmlBundle.message("xml.inspections.check.tag.empty.body");
+  }
+
+  @NotNull
+  @NonNls
+  public String getShortName() {
+    return "CheckTagEmptyBody";
+  }
+
+  private static class ReplaceEmptyTagBodyByEmptyEndFix implements LocalQuickFix {
+    @NotNull
+    public String getName() {
+      return XmlBundle.message("xml.inspections.replace.tag.empty.body.with.empty.end");
+    }
+
+    @NotNull
+    public String getFamilyName() {
+      return getName();
+    }
+
+    public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
+      final PsiElement tag = descriptor.getPsiElement();
+      if (!CodeInsightUtilBase.prepareFileForWrite(tag.getContainingFile())) {
+        return;
+      }
+
+      PsiDocumentManager.getInstance(project).commitAllDocuments();
+
+      final ASTNode child = XmlChildRole.START_TAG_END_FINDER.findChild(tag.getNode());
+      if (child == null) return;
+      final int offset = child.getTextRange().getStartOffset();
+      VirtualFile file = tag.getContainingFile().getVirtualFile();
+      final Document document = FileDocumentManager.getInstance().getDocument(file);
+
+      new WriteCommandAction(project) {
+        protected void run(final Result result) throws Throwable {
+          document.replaceString(offset, tag.getTextRange().getEndOffset(),"/>");
+        }
+      }.execute();
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/xml/util/CheckValidXmlInScriptBodyInspection.java b/xml/impl/src/com/intellij/xml/util/CheckValidXmlInScriptBodyInspection.java
new file mode 100644
index 0000000..5487ef1
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/CheckValidXmlInScriptBodyInspection.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: Maxim.Mossienko
+ * Date: Jun 29, 2006
+ * Time: 6:09:35 PM
+ */
+package com.intellij.xml.util;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInsight.CodeInsightUtilBase;
+import com.intellij.codeInspection.*;
+import com.intellij.lexer.Lexer;
+import com.intellij.lexer.XmlLexer;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.fileEditor.FileEditorManager;
+import com.intellij.openapi.fileEditor.OpenFileDescriptor;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiElementVisitor;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.XmlElementVisitor;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.impl.source.tree.TreeUtil;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagValue;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Maxim Mossienko
+ */
+public class CheckValidXmlInScriptBodyInspection extends XmlSuppressableInspectionTool {
+  @NonNls
+  private static final String SCRIPT_TAG_NAME = "script";
+  private Lexer myXmlLexer;
+  @NonNls
+  private static final String AMP_ENTITY_REFERENCE = "&amp;";
+  @NonNls
+  private static final String LT_ENTITY_REFERENCE = "&lt;";
+
+  public boolean isEnabledByDefault() {
+    return true;
+  }
+
+  @NotNull
+  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) {
+    return new XmlElementVisitor() {
+      @Override public void visitXmlTag(final XmlTag tag) {
+        if (SCRIPT_TAG_NAME.equals(tag.getName()) ||
+            (tag instanceof HtmlTag && SCRIPT_TAG_NAME.equalsIgnoreCase(tag.getName()))
+           ) {
+          final PsiFile psiFile = tag.getContainingFile();
+          final FileType fileType = psiFile.getFileType();
+
+          if (fileType == StdFileTypes.XHTML || fileType == StdFileTypes.JSPX) {
+            synchronized(CheckValidXmlInScriptBodyInspection.class) {
+              if (myXmlLexer == null) myXmlLexer = new XmlLexer();
+              final XmlTagValue tagValue = tag.getValue();
+              final String tagBodyText = tagValue.getText();
+
+              if (tagBodyText.length() > 0) {
+                myXmlLexer.start(tagBodyText);
+
+                while(myXmlLexer.getTokenType() != null) {
+                  IElementType tokenType = myXmlLexer.getTokenType();
+
+                  if (tokenType == XmlTokenType.XML_CDATA_START) {
+                    while(tokenType != null && tokenType != XmlTokenType.XML_CDATA_END) {
+                      myXmlLexer.advance();
+                      tokenType = myXmlLexer.getTokenType();
+                    }
+                    if (tokenType == null) break;
+                  }
+                  if (( tokenType == XmlTokenType.XML_BAD_CHARACTER &&
+                        "&".equals(TreeUtil.getTokenText(myXmlLexer))
+                      ) ||
+                      tokenType == XmlTokenType.XML_START_TAG_START
+                    ) {
+                    final int valueStart = tagValue.getTextRange().getStartOffset();
+                    final int offset = valueStart + myXmlLexer.getTokenStart();
+                    final PsiElement psiElement = psiFile.findElementAt(offset);
+                    final TextRange elementRange = psiElement.getTextRange();
+
+                    final int offsetInElement = offset - elementRange.getStartOffset();
+                    holder.registerProblem(
+                      psiElement,
+                      XmlBundle.message("unescaped.xml.character"),
+                      ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
+                      new InsertQuotedCharacterQuickFix(
+                        psiFile,
+                        psiElement,
+                        offsetInElement
+                      )
+                    );
+
+                    int endOfElementInScriptTag = elementRange.getEndOffset() - valueStart;
+                    while(myXmlLexer.getTokenEnd() < endOfElementInScriptTag) {
+                      myXmlLexer.advance();
+                      if (myXmlLexer.getTokenType() == null) break;
+                    }
+                  }
+                  myXmlLexer.advance();
+                }
+              }
+            }
+          }
+        }
+      }
+    };
+  }
+
+  @NotNull
+  public String getGroupDisplayName() {
+    return XmlInspectionGroupNames.HTML_INSPECTIONS;
+  }
+
+  @NotNull
+  public String getDisplayName() {
+    return XmlBundle.message("html.inspections.check.valid.script.tag");
+  }
+
+  @NotNull
+  @NonNls
+  public String getShortName() {
+    return "CheckValidXmlInScriptTagBody";
+  }
+
+  private static class InsertQuotedCharacterQuickFix implements LocalQuickFix {
+    private final PsiFile psiFile;
+    private final PsiElement psiElement;
+    private final int startInElement;
+
+    public InsertQuotedCharacterQuickFix(PsiFile psiFile, PsiElement psiElement, int startInElement) {
+      this.psiFile = psiFile;
+      this.psiElement = psiElement;
+      this.startInElement = startInElement;
+    }
+
+    @NotNull
+    public String getName() {
+      final String character = getXmlCharacter();
+
+      return XmlBundle.message(
+        "unescaped.xml.character.fix.message",
+        character.equals("&") ?
+          XmlBundle.message("unescaped.xml.character.fix.message.parameter"):
+          character
+      );
+    }
+
+    @NotNull
+    public String getFamilyName() {
+      return getName();
+    }
+
+    public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor problemDescriptor) {
+      if ( !CodeInsightUtilBase.prepareFileForWrite(psiFile)) return;
+      final TextRange range = psiElement.getTextRange();
+      OpenFileDescriptor descriptor = new OpenFileDescriptor(
+        project,
+        psiFile.getVirtualFile(),
+        range.getStartOffset() + startInElement
+      );
+
+      final Editor editor = FileEditorManager.getInstance(project).openTextEditor(descriptor, true);
+      if (editor == null) return;
+
+      final String xmlCharacter = getXmlCharacter();
+      String replacement = xmlCharacter.equals("&") ? AMP_ENTITY_REFERENCE : LT_ENTITY_REFERENCE;
+      replacement = psiElement.getText().replace(xmlCharacter,replacement);
+
+      editor.getDocument().replaceString(
+        range.getStartOffset(),
+        range.getEndOffset(),
+        replacement
+      );
+    }
+
+    private String getXmlCharacter() {
+      return psiElement.getText().substring(startInElement, startInElement + 1);
+    }
+  }
+
+  @NotNull
+  public HighlightDisplayLevel getDefaultLevel() {
+    return HighlightDisplayLevel.ERROR;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/CheckXmlFileWithXercesValidatorInspection.java b/xml/impl/src/com/intellij/xml/util/CheckXmlFileWithXercesValidatorInspection.java
new file mode 100644
index 0000000..8a664c5
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/CheckXmlFileWithXercesValidatorInspection.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.xml.util;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInspection.XmlSuppressableInspectionTool;
+import com.intellij.codeInspection.XmlInspectionGroupNames;
+import com.intellij.codeInspection.ex.UnfairLocalInspectionTool;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Maxim Mossienko
+ * @see com.intellij.xml.impl.ExternalDocumentValidator
+ */
+public class CheckXmlFileWithXercesValidatorInspection extends XmlSuppressableInspectionTool implements UnfairLocalInspectionTool {
+  public static final @NonNls String SHORT_NAME = "CheckXmlFileWithXercesValidator";
+
+  public boolean isEnabledByDefault() {
+    return true;
+  }
+
+  @NotNull
+  public HighlightDisplayLevel getDefaultLevel() {
+    return HighlightDisplayLevel.ERROR;
+  }
+
+  @NotNull
+  public String getGroupDisplayName() {
+    return XmlInspectionGroupNames.XML_INSPECTIONS;
+  }
+
+  @NotNull
+  public String getDisplayName() {
+    return XmlBundle.message("xml.inspections.check.file.with.xerces");
+  }
+
+  @NotNull
+  @NonNls
+  public String getShortName() {
+    return SHORT_NAME;
+  }
+}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/xml/util/ColorIconCache.java b/xml/impl/src/com/intellij/xml/util/ColorIconCache.java
new file mode 100644
index 0000000..15b3171
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/ColorIconCache.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.util.containers.HashMap;
+import com.intellij.util.containers.SoftFactoryMap;
+import com.intellij.util.containers.WeakFactoryMap;
+import com.intellij.util.ui.EmptyIcon;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Map;
+
+/**
+ * @author spleaner
+ */
+public class ColorIconCache {
+  private static final ColorIconCache INSTANCE = new ColorIconCache();
+  private static final SoftFactoryMap<Color, Map<Integer, Icon>> ourCache = new SoftFactoryMap<Color, Map<Integer, Icon>>() {
+    @Override
+    protected Map<Integer, Icon> create(Color key) {
+      return new HashMap<Integer, Icon>();
+    }
+  };
+
+  private ColorIconCache() {
+  }
+
+  public static ColorIconCache getIconCache() {
+    return INSTANCE;
+  }
+
+  @SuppressWarnings({"MethodMayBeStatic"})
+  public Icon getIcon(@NotNull final Color color, final int size) {
+    Icon icon = ourCache.get(color).get(size);
+    if (icon == null) {
+      icon = new ColorIcon(size, color);
+      ourCache.get(color).put(size, icon);
+    }
+
+    return icon;
+  }
+
+  public static class ColorIcon extends EmptyIcon {
+    private Color myColor;
+    private Color[] myColours;
+
+    public ColorIcon(final int size, final Color color) {
+      super(size);
+      myColor = color;
+    }
+
+    public ColorIcon(final int size, final Color[] colours) {
+      super(size);
+      myColours = colours;
+    }
+
+    @Override
+    public void paintIcon(final Component component, final Graphics g, final int i, final int j) {
+      final int iconWidth = getIconWidth();
+      final int iconHeight = getIconHeight();
+      if (myColor != null) {
+        g.setColor(myColor);
+        g.fillRect(i, j, iconWidth, iconHeight);
+      }
+      else if (myColours != null) {
+        final Color top = myColours[0];
+        g.setColor(top);
+        g.fillRect(i, j, iconWidth, 2);
+
+        final Color right = myColours[1];
+        g.setColor(right);
+        g.fillRect(i + iconWidth / 2, j + 2, iconWidth / 2, iconHeight / 2);
+
+        final Color bottom = myColours[2];
+        g.setColor(bottom);
+        g.fillRect(i, j + iconHeight - 2, iconWidth, 2);
+
+        final Color left = myColours[3];
+        g.setColor(left);
+        g.fillRect(i, j + 2, iconWidth / 2, iconHeight / 2);
+      }
+
+      final Composite old = ((Graphics2D)g).getComposite();
+      ((Graphics2D)g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f));
+      g.setColor(Color.BLACK);
+      g.drawRect(i, j, iconWidth-1, iconHeight-1);
+      ((Graphics2D)g).setComposite(old);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/ColorSampleLookupValue.java b/xml/impl/src/com/intellij/xml/util/ColorSampleLookupValue.java
new file mode 100644
index 0000000..6f0cfe5
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/ColorSampleLookupValue.java
@@ -0,0 +1,500 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.codeInsight.lookup.DeferredUserLookupValue;
+import com.intellij.codeInsight.lookup.LookupItem;
+import com.intellij.codeInsight.lookup.LookupValueWithPriority;
+import com.intellij.codeInsight.lookup.LookupValueWithUIHint;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Iconable;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.ui.ColorUtil;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.*;
+import java.util.List;
+
+/**
+ * @author maxim
+ */
+public class ColorSampleLookupValue implements LookupValueWithUIHint, DeferredUserLookupValue, Iconable, LookupValueWithPriority {
+  private static volatile ColorSampleLookupValue[] ourColors;
+  private static Map<String, String> ourColorNameToHexCodeMap;
+  private static Map<String, String> ourHexCodeToColorNameMap;
+
+  @NonNls private static final String BR = "<br>";
+
+  @NonNls private static final String systemColorsString = "ActiveBorder\n" +
+                                                           "    Active window border.\n" +
+                                                           "ActiveCaption\n" +
+                                                           "    Active window caption.\n" +
+                                                           "AppWorkspace\n" +
+                                                           "    Background color of multiple document interface.\n" +
+                                                           "Background\n" +
+                                                           "    Desktop background.\n" +
+                                                           "ButtonFace\n" +
+                                                           "    Face color for three-dimensional display elements.\n" +
+                                                           "ButtonHighlight\n" +
+                                                           "    Highlight color for three-dimensional display elements (for edges facing away from the light source).\n" +
+                                                           "ButtonShadow\n" +
+                                                           "    Shadow color for three-dimensional display elements.\n" +
+                                                           "ButtonText\n" +
+                                                           "    Text on push buttons.\n" +
+                                                           "CaptionText\n" +
+                                                           "    Text in caption, size box, and scrollbar arrow box.\n" +
+                                                           "GrayText\n" +
+                                                           "    Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.\n" +
+                                                           "Highlight\n" +
+                                                           "    Item(s) selected in a control.\n" +
+                                                           "HighlightText\n" +
+                                                           "    Text of item(s) selected in a control.\n" +
+                                                           "InactiveBorder\n" +
+                                                           "    Inactive window border.\n" +
+                                                           "InactiveCaption\n" +
+                                                           "    Inactive window caption.\n" +
+                                                           "InactiveCaptionText\n" +
+                                                           "    Color of text in an inactive caption.\n" +
+                                                           "InfoBackground\n" +
+                                                           "    Background color for tooltip controls.\n" +
+                                                           "InfoText\n" +
+                                                           "    Text color for tooltip controls.\n" +
+                                                           "Menu\n" +
+                                                           "    Menu background.\n" +
+                                                           "MenuText\n" +
+                                                           "    Text in menus.\n" +
+                                                           "Scrollbar\n" +
+                                                           "    Scroll bar gray area.\n" +
+                                                           "ThreeDDarkShadow\n" +
+                                                           "    Dark shadow for three-dimensional display elements.\n" +
+                                                           "ThreeDFace\n" +
+                                                           "    Face color for three-dimensional display elements.\n" +
+                                                           "ThreeDHighlight\n" +
+                                                           "    Highlight color for three-dimensional display elements.\n" +
+                                                           "ThreeDLightShadow\n" +
+                                                           "    Light color for three-dimensional display elements (for edges facing the light source).\n" +
+                                                           "ThreeDShadow\n" +
+                                                           "    Dark shadow for three-dimensional display elements.\n" +
+                                                           "Window\n" +
+                                                           "    Window background.\n" +
+                                                           "WindowFrame\n" +
+                                                           "    Window frame.\n" +
+                                                           "WindowText\n" +
+                                                           "    Text in windows. ";
+  @NonNls private static final String standardColorsString = "maroon #800000 red #ff0000 orange #ffA500 yellow #ffff00 olive #808000\n" +
+                                                             "purple #800080 fuchsia #ff00ff white #ffffff lime #00ff00 green #008000\n" +
+                                                             "navy #000080 blue #0000ff aqua #00ffff teal #008080\n" +
+                                                             "black #000000 silver #c0c0c0 gray #808080";
+  @NonNls private static final String colorsString = "aliceblue \t#f0f8ff \t240,248,255\n" +
+                                                     "  \t  \tantiquewhite \t#faebd7 \t250,235,215\n" +
+                                                     "  \t  \taqua \t#00ffff \t0,255,255\n" +
+                                                     "  \t  \taquamarine \t#7fffd4 \t127,255,212\n" +
+                                                     "  \t  \tazure \t#f0ffff \t240,255,255\n" +
+                                                     "  \t  \tbeige \t#f5f5dc \t245,245,220\n" +
+                                                     "  \t  \tbisque \t#ffe4c4 \t255,228,196\n" +
+                                                     "  \t  \tblack \t#000000 \t0,0,0\n" +
+                                                     "  \t  \tblanchedalmond \t#ffebcd \t255,235,205\n" +
+                                                     "  \t  \tblue \t#0000ff \t0,0,255\n" +
+                                                     "  \t  \tblueviolet \t#8a2be2 \t138,43,226\n" +
+                                                     "  \t  \tbrown \t#a52a2a \t165,42,42\n" +
+                                                     "  \t  \tburlywood \t#deb887 \t222,184,135\n" +
+                                                     "  \t  \tcadetblue \t#5f9ea0 \t95,158,160\n" +
+                                                     "  \t  \tchartreuse \t#7fff00 \t127,255,0\n" +
+                                                     "  \t  \tchocolate \t#d2691e \t210,105,30\n" +
+                                                     "  \t  \tcoral \t#ff7f50 \t255,127,80\n" +
+                                                     "  \t  \tcornflowerblue \t#6495ed \t100,149,237\n" +
+                                                     "  \t  \tcornsilk \t#fff8dc \t255,248,220\n" +
+                                                     "  \t  \tcrimson \t#dc143c \t220,20,60\n" +
+                                                     "  \t  \tcyan \t#00ffff \t0,255,255\n" +
+                                                     "  \t  \tdarkblue \t#00008b \t0,0,139\n" +
+                                                     "  \t  \tdarkcyan \t#008b8b \t0,139,139\n" +
+                                                     "  \t  \tdarkgoldenrod \t#b8860b \t184,134,11\n" +
+                                                     "  \t  \tdarkgray \t#a9a9a9 \t169,169,169\n" +
+                                                     "  \t  \tdarkgrey \t#a9a9a9 \t169,169,169\n" +
+                                                     "  \t  \tdarkgreen \t#006400 \t0,100,0\n" +
+                                                     "  \t  \tdarkkhaki \t#bdb76b \t189,183,107\n" +
+                                                     "  \t  \tdarkmagenta \t#8b008b \t139,0,139\n" +
+                                                     "  \t  \tdarkolivegreen \t#556b2f \t85,107,47\n" +
+                                                     "  \t  \tdarkorange \t#ff8c00 \t255,140,0\n" +
+                                                     "  \t  \tdarkorchid \t#9932cc \t153,50,204\n" +
+                                                     "  \t  \tdarkred \t#8b0000 \t139,0,0\n" +
+                                                     "  \t  \tdarksalmon \t#e9967a \t233,150,122\n" +
+                                                     "  \t  \tdarkseagreen \t#8fbc8f \t143,188,143\n" +
+                                                     "  \t  \tdarkslateblue \t#483d8b \t72,61,139\n" +
+                                                     "  \t  \tdarkslategray \t#2f4f4f \t47,79,79\n" +
+                                                     "  \t  \tdarkslategrey \t#2f4f4f \t47,79,79\n" +
+                                                     "  \t  \tdarkturquoise \t#00ced1 \t0,206,209\n" +
+                                                     "  \t  \tdarkviolet \t#9400d3 \t148,0,211\n" +
+                                                     "  \t  \tdeeppink \t#ff1493 \t255,20,147\n" +
+                                                     "  \t  \tdeepskyblue \t#00bfff \t0,191,255\n" +
+                                                     "  \t  \tdimgray \t#696969 \t105,105,105\n" +
+                                                     "  \t  \tdimgrey \t#696969 \t105,105,105\n" +
+                                                     "  \t  \tdodgerblue \t#1e90ff \t30,144,255\n" +
+                                                     "  \t  \tfirebrick \t#b22222 \t178,34,34\n" +
+                                                     "  \t  \tfloralwhite \t#fffaf0 \t255,250,240\n" +
+                                                     "  \t  \tforestgreen \t#228b22 \t34,139,34\n" +
+                                                     "  \t  \tfuchsia \t#ff00ff \t255,0,255\n" +
+                                                     "  \t  \tgainsboro \t#dcdcdc \t220,220,220\n" +
+                                                     "  \t  \tghostwhite \t#f8f8ff \t248,248,255\n" +
+                                                     "  \t  \tgold \t#ffd700 \t255,215,0\n" +
+                                                     "  \t  \tgoldenrod \t#daa520 \t218,165,32\n" +
+                                                     "  \t  \tgray \t#808080 \t128,128,128\n" +
+                                                     "  \t  \tgrey \t#808080 \t128,128,128\n" +
+                                                     "  \t  \tgreen \t#008000 \t0,128,0\n" +
+                                                     "  \t  \tgreenyellow \t#adff2f \t173,255,47\n" +
+                                                     "  \t  \thoneydew \t#f0fff0 \t240,255,240\n" +
+                                                     "  \t  \thotpink \t#ff69b4 \t255,105,180\n" +
+                                                     "  \t  \tindianred \t#cd5c5c \t205,92,92\n" +
+                                                     "  \t  \tindigo \t#4b0082 \t75,0,130\n" +
+                                                     "  \t  \tivory \t#fffff0 \t255,255,240\n" +
+                                                     "  \t  \tkhaki \t#f0e68c \t240,230,140\n" +
+                                                     "  \t  \tlavender \t#e6e6fa \t230,230,250\n" +
+                                                     "  \t  \tlavenderblush \t#fff0f5 \t255,240,245\n" +
+                                                     "  \t  \tlawngreen \t#7cfc00 \t124,252,0\n" +
+                                                     "  \t  \tlemonchiffon \t#fffacd \t255,250,205\n" +
+                                                     "  \t  \tlightblue \t#add8e6 \t173,216,230\n" +
+                                                     "  \t  \tlightcoral \t#f08080 \t240,128,128\n" +
+                                                     "  \t  \tlightcyan \t#e0ffff \t224,255,255\n" +
+                                                     "  \t  \tlightgoldenrodyellow \t#fafad2 \t250,250,210\n" +
+                                                     "  \t  \tlightgray \t#d3d3d3 \t211,211,211\n" +
+                                                     "  \t  \tlightgrey \t#d3d3d3 \t211,211,211\n" +
+                                                     "  \t  \tlightgreen \t#90ee90 \t144,238,144\n" +
+                                                     "  \t  \tlightpink \t#ffb6c1 \t255,182,193\n" +
+                                                     "  \t  \tlightsalmon \t#ffa07a \t255,160,122\n" +
+                                                     "  \t  \tlightseagreen \t#20b2aa \t32,178,170\n" +
+                                                     "  \t  \tlightskyblue \t#87cefa \t135,206,250\n" +
+                                                     "  \t  \tlightslategray \t#778899 \t119,136,153\n" +
+                                                     "  \t  \tlightslategrey \t#778899 \t119,136,153\n" +
+                                                     "  \t  \tlightsteelblue \t#b0c4de \t176,196,222\n" +
+                                                     "  \t  \tlightyellow \t#ffffe0 \t255,255,224\n" +
+                                                     "  \t  \tlime \t#00ff00 \t0,255,0\n" +
+                                                     "  \t  \tlimegreen \t#32cd32 \t50,205,50\n" +
+                                                     "  \t  \tlinen \t#faf0e6 \t250,240,230\n" +
+                                                     "  \t  \tmagenta \t#ff00ff \t255,0,255\n" +
+                                                     "  \t  \tmaroon \t#800000 \t128,0,0\n" +
+                                                     "  \t  \tmediumaquamarine \t#66cdaa \t102,205,170\n" +
+                                                     "  \t  \tmediumblue \t#0000cd \t0,0,205\n" +
+                                                     "  \t  \tmediumorchid \t#ba55d3 \t186,85,211\n" +
+                                                     "  \t  \tmediumpurple \t#9370db \t147,112,219\n" +
+                                                     "  \t  \tmediumseagreen \t#3cb371 \t60,179,113\n" +
+                                                     "  \t  \tmediumslateblue \t#7b68ee \t123,104,238\n" +
+                                                     "  \t  \tmediumspringgreen \t#00fa9a \t0,250,154\n" +
+                                                     "  \t  \tmediumturquoise \t#48d1cc \t72,209,204\n" +
+                                                     "  \t  \tmediumvioletred \t#c71585 \t199,21,133\n" +
+                                                     "  \t  \tmidnightblue \t#191970 \t25,25,112\n" +
+                                                     "  \t  \tmintcream \t#f5fffa \t245,255,250\n" +
+                                                     "  \t  \tmistyrose \t#ffe4e1 \t255,228,225\n" +
+                                                     "  \t  \tmoccasin \t#ffe4b5 \t255,228,181\n" +
+                                                     "  \t  \tnavajowhite \t#ffdead \t255,222,173\n" +
+                                                     "  \t  \tnavy \t#000080 \t0,0,128\n" +
+                                                     "  \t  \toldlace \t#fdf5e6 \t253,245,230\n" +
+                                                     "  \t  \tolive \t#808000 \t128,128,0\n" +
+                                                     "  \t  \tolivedrab \t#6b8e23 \t107,142,35\n" +
+                                                     "  \t  \torange \t#ffa500 \t255,165,0\n" +
+                                                     "  \t  \torangered \t#ff4500 \t255,69,0\n" +
+                                                     "  \t  \torchid \t#da70d6 \t218,112,214\n" +
+                                                     "  \t  \tpalegoldenrod \t#eee8aa \t238,232,170\n" +
+                                                     "  \t  \tpalegreen \t#98fb98 \t152,251,152\n" +
+                                                     "  \t  \tpaleturquoise \t#afeeee \t175,238,238\n" +
+                                                     "  \t  \tpalevioletred \t#db7093 \t219,112,147\n" +
+                                                     "  \t  \tpapayawhip \t#ffefd5 \t255,239,213\n" +
+                                                     "  \t  \tpeachpuff \t#ffdab9 \t255,218,185\n" +
+                                                     "  \t  \tperu \t#cd853f \t205,133,63\n" +
+                                                     "  \t  \tpink \t#ffc0cb \t255,192,203\n" +
+                                                     "  \t  \tplum \t#dda0dd \t221,160,221\n" +
+                                                     "  \t  \tpowderblue \t#b0e0e6 \t176,224,230\n" +
+                                                     "  \t  \tpurple \t#800080 \t128,0,128\n" +
+                                                     "  \t  \tred \t#ff0000 \t255,0,0\n" +
+                                                     "  \t  \trosybrown \t#bc8f8f \t188,143,143\n" +
+                                                     "  \t  \troyalblue \t#4169e1 \t65,105,225\n" +
+                                                     "  \t  \tsaddlebrown \t#8b4513 \t139,69,19\n" +
+                                                     "  \t  \tsalmon \t#fa8072 \t250,128,114\n" +
+                                                     "  \t  \tsandybrown \t#f4a460 \t244,164,96\n" +
+                                                     "  \t  \tseagreen \t#2e8b57 \t46,139,87\n" +
+                                                     "  \t  \tseashell \t#fff5ee \t255,245,238\n" +
+                                                     "  \t  \tsienna \t#a0522d \t160,82,45\n" +
+                                                     "  \t  \tsilver \t#c0c0c0 \t192,192,192\n" +
+                                                     "  \t  \tskyblue \t#87ceeb \t135,206,235\n" +
+                                                     "  \t  \tslateblue \t#6a5acd \t106,90,205\n" +
+                                                     "  \t  \tslategray \t#708090 \t112,128,144\n" +
+                                                     "  \t  \tslategrey \t#708090 \t112,128,144\n" +
+                                                     "  \t  \tsnow \t#fffafa \t255,250,250\n" +
+                                                     "  \t  \tspringgreen \t#00ff7f \t0,255,127\n" +
+                                                     "  \t  \tsteelblue \t#4682b4 \t70,130,180\n" +
+                                                     "  \t  \ttan \t#d2b48c \t210,180,140\n" +
+                                                     "  \t  \tteal \t#008080 \t0,128,128\n" +
+                                                     "  \t  \tthistle \t#d8bfd8 \t216,191,216\n" +
+                                                     "  \t  \ttomato \t#ff6347 \t255,99,71\n" +
+                                                     "  \t  \tturquoise \t#40e0d0 \t64,224,208\n" +
+                                                     "  \t  \tviolet \t#ee82ee \t238,130,238\n" +
+                                                     "  \t  \twheat \t#f5deb3 \t245,222,179\n" +
+                                                     "  \t  \twhite \t#ffffff \t255,255,255\n" +
+                                                     "  \t  \twhitesmoke \t#f5f5f5 \t245,245,245\n" +
+                                                     "  \t  \tyellow \t#ffff00 \t255,255,0\n" +
+                                                     "  \t  \tyellowgreen \t#9acd32 \t154,205,50";
+  private final boolean myIsStandard;
+  private final String myName;
+  private final String myValue;
+  private Color myColor;
+  private static final ArrayList<String> ourSystemColors;
+  private static final List<String> ourStandardColors;
+
+  static {
+    ourSystemColors = new ArrayList<String>();
+    StringTokenizer tokenizer = new StringTokenizer(systemColorsString, "\n");
+
+    while (tokenizer.hasMoreTokens()) {
+      String name = tokenizer.nextToken();
+      ourSystemColors.add(name.toLowerCase());
+      tokenizer.nextToken();
+    }
+
+    ourStandardColors = new ArrayList<String>();
+    tokenizer = new StringTokenizer(standardColorsString, ", \n");
+    
+    while (tokenizer.hasMoreTokens()) {
+      String name = tokenizer.nextToken();
+      ourStandardColors.add(name);
+      tokenizer.nextToken();
+    }
+  }
+
+  public ColorSampleLookupValue(String name, String value, boolean isStandard) {
+    myName = name;
+    myValue = value;
+    myIsStandard = isStandard;
+  }
+
+  public String getPresentation() {
+    return myName != null ? myName : myValue;
+  }
+
+  public String getValue() {
+    return myValue;
+  }
+
+  public boolean isIsStandard() {
+    return myIsStandard;
+  }
+
+  public Icon getIcon(int flags) {
+    if (myColor == null) {
+      if (myValue.startsWith("#")) {
+        try {
+          myColor = Color.decode("0x" + myValue.substring(1));
+        }
+        catch (NumberFormatException e) {
+          return null;
+        }
+      }
+    }
+
+    if (myColor != null) {
+      return ColorIconCache.getIconCache().getIcon(myColor, 32);
+    }
+
+    return null;
+  }
+
+  public boolean handleUserSelection(LookupItem item, Project project) {
+    if (!myIsStandard) {
+      item.setLookupString(myValue);
+    }
+    return true;
+  }
+
+  public static boolean isSystemColorName(@NotNull @NonNls final String s) {
+    return ourSystemColors.contains(s);
+  }
+
+  public static boolean isStandardColor(@NotNull @NonNls final String s) {
+    return ourStandardColors.contains(s);
+  }
+
+  public static ColorSampleLookupValue[] getColors() {
+    if (ourColors == null) {
+      synchronized (ColorSampleLookupValue.class) {
+        if (ourColors == null) {
+          ourColorNameToHexCodeMap = new HashMap<String, String>(25);
+          ourHexCodeToColorNameMap = new HashMap<String, String>(25);
+          List<ColorSampleLookupValue> colorsList = new LinkedList<ColorSampleLookupValue>();
+          StringTokenizer tokenizer = new StringTokenizer(systemColorsString, "\n");
+
+          while (tokenizer.hasMoreTokens()) {
+            String name = tokenizer.nextToken();
+            colorsList.add(new ColorSampleLookupValue(name, name, false));
+            tokenizer.nextToken();
+          }
+
+          tokenizer = new StringTokenizer(standardColorsString, ", \n");
+          HashMap<String, String> standardColors = new HashMap<String, String>();
+
+          while (tokenizer.hasMoreTokens()) {
+            String name = tokenizer.nextToken();
+            String value = tokenizer.nextToken();
+            standardColors.put(name, name);
+            ourColorNameToHexCodeMap.put(name, value);
+            ourHexCodeToColorNameMap.put(value, name);
+
+            colorsList.add(new ColorSampleLookupValue(name, value, true));
+          }
+
+          tokenizer = new StringTokenizer(colorsString, " \t\n");
+
+          while (tokenizer.hasMoreTokens()) {
+            String name = tokenizer.nextToken();
+            String hexValue = tokenizer.nextToken();
+
+            tokenizer.nextToken(); // skip rgb
+
+            if (!standardColors.containsKey(name)) {
+              colorsList.add(new ColorSampleLookupValue(name, hexValue, false));
+              ourColorNameToHexCodeMap.put(name, hexValue);
+              ourHexCodeToColorNameMap.put(hexValue, name);
+            }
+          }
+
+          colorsList.toArray(ourColors = new ColorSampleLookupValue[colorsList.size()]);
+        }
+      }
+    }
+    return ourColors;
+  }
+
+  @Nullable
+  public String getTypeHint() {
+    return myValue != null && myValue.charAt(0) == '#' ? myValue : null;
+  }
+
+  @Nullable
+  public Color getColorHint() {
+    return null;
+  }
+
+  public boolean isBold() {
+    return false;
+  }
+
+  public String getName() {
+    return myName;
+  }
+
+  public int getPriority() {
+    return myName == null || Character.isLowerCase(myName.charAt(0)) ? HIGHER : NORMAL;
+  }
+
+  public static synchronized String getHexCodeForColorName(String colorName) {
+    getColors(); // to guarantee initialization
+    return ourColorNameToHexCodeMap.get(colorName);
+  }
+
+  public static synchronized String getColorNameForHexCode(String colorName) {
+    getColors(); // to guarantee initialization
+    return ourHexCodeToColorNameMap.get(colorName);
+  }
+
+  public static void addColorPreviewAndCodeToLookup(final PsiElement currentElement, final StringBuilder buf) {
+    final Color colorFromElement = UserColorLookup.getColorFromElement(currentElement);
+
+    if (colorFromElement != null) {
+      addColorPreviewAndCodeToLookup(colorFromElement, buf);
+    }
+  }
+
+  private static String toHex(@NotNull final Color color) {
+    final StringBuilder sb = new StringBuilder();
+    for (int i = 0; i < 3; i++) {
+      String s = Integer.toHexString(i == 0 ? color.getRed() : i == 1 ? color.getGreen() : color.getBlue());
+      if (s.length() < 2) {
+        sb.append('0');
+      }
+
+      sb.append(s);
+    }
+
+    return sb.toString();
+  }
+
+  public static void addColorPreviewAndCodeToLookup(final Color color, final StringBuilder buf) {
+    if (color == null) return;
+    final String code = '#' + toHex(color);
+    final String colorName = getColorNameForHexCode(code);
+    if (colorName != null) {
+      buf.append(XmlBundle.message("color.name", colorName)).append(BR);
+    }
+
+    String colorBox = "<div style=\"border: 1px solid #000000; width: 50px; height: 20px; background-color:" + code + "\"></div>";
+    buf.append(XmlBundle.message("color.preview", colorBox)).append(BR);
+  }
+
+  public static Color getColor(String text) {
+    if (StringUtil.isEmptyOrSpaces(text)) {
+      return null;
+    }
+    String hexValue = text.charAt(0) == '#' ? text : getHexCodeForColorName(text.toLowerCase());
+    if (hexValue != null) {
+      return ColorUtil.fromHex(hexValue, null);
+    }
+    return null;
+  }
+
+  @Override
+  public String toString() {
+    return myName == null ? myValue : myValue + " " + myName;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (!(o instanceof ColorSampleLookupValue)) {
+      return false;
+    }
+
+    ColorSampleLookupValue value = (ColorSampleLookupValue)o;
+
+    if (myIsStandard != value.myIsStandard) {
+      return false;
+    }
+    if (myColor != null ? !myColor.equals(value.myColor) : value.myColor != null) {
+      return false;
+    }
+    if (myName != null ? !myName.equals(value.myName) : value.myName != null) {
+      return false;
+    }
+    if (myValue != null ? !myValue.equals(value.myValue) : value.myValue != null) {
+      return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = (myIsStandard ? 1 : 0);
+    result = 31 * result + (myName != null ? myName.hashCode() : 0);
+    result = 31 * result + (myValue != null ? myValue.hashCode() : 0);
+    result = 31 * result + (myColor != null ? myColor.hashCode() : 0);
+    return result;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/HtmlDoctypeProvider.java b/xml/impl/src/com/intellij/xml/util/HtmlDoctypeProvider.java
new file mode 100644
index 0000000..003bcf6
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/HtmlDoctypeProvider.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.psi.impl.source.html.HtmlFileImpl;
+import com.intellij.psi.xml.XmlDoctype;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlElementDescriptor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author traff
+ */
+public interface HtmlDoctypeProvider {
+  ExtensionPointName<HtmlDoctypeProvider> EP_NAME = ExtensionPointName.create("com.intellij.xml.util.htmlDoctypeProvider");
+
+
+  @Nullable
+  XmlDoctype getDoctype(XmlFile file);
+}
diff --git a/xml/impl/src/com/intellij/xml/util/HtmlUtil.java b/xml/impl/src/com/intellij/xml/util/HtmlUtil.java
new file mode 100644
index 0000000..653ad70
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/HtmlUtil.java
@@ -0,0 +1,646 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.codeInspection.InspectionProfile;
+import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
+import com.intellij.codeInspection.htmlInspections.HtmlUnknownAttributeInspection;
+import com.intellij.codeInspection.htmlInspections.HtmlUnknownTagInspection;
+import com.intellij.codeInspection.htmlInspections.XmlEntitiesInspection;
+import com.intellij.ide.highlighter.HtmlFileType;
+import com.intellij.javaee.ExternalResourceManagerEx;
+import com.intellij.lang.Language;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.xhtml.XHTMLLanguage;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.FileTypeManager;
+import com.intellij.openapi.util.Ref;
+import com.intellij.openapi.vfs.CharsetToolkit;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
+import com.intellij.psi.*;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.impl.source.html.HtmlDocumentImpl;
+import com.intellij.psi.impl.source.parsing.xml.HtmlBuilderDriver;
+import com.intellij.psi.impl.source.parsing.xml.XmlBuilder;
+import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
+import com.intellij.psi.impl.source.xml.XmlAttributeImpl;
+import com.intellij.psi.templateLanguages.TemplateLanguageFileViewProvider;
+import com.intellij.psi.templateLanguages.TemplateLanguageUtil;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.Processor;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.Html5SchemaProvider;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.impl.schema.XmlAttributeDescriptorImpl;
+import com.intellij.xml.impl.schema.XmlElementDescriptorImpl;
+import com.intellij.xml.util.documentation.HtmlDescriptorsTable;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.nio.charset.Charset;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class HtmlUtil {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.util.HtmlUtil");
+
+  @NonNls private static final String JSFC = "jsfc";
+  @NonNls private static final String CHARSET_PREFIX = "charset=";
+  @NonNls private static final String HTML5_DATA_ATTR_PREFIX = "data-";
+
+  public static final String[] CONTENT_TYPES =
+    {"application/activemessage", "application/andrew-inset", "application/applefile", "application/atomicmail", "application/dca-rft",
+      "application/dec-dx", "application/mac-binhex40"
+      , "application/mac-compactpro", "application/macwriteii", "application/msword", "application/news-message-id",
+      "application/news-transmission", "application/octet-stream"
+      , "application/oda", "application/pdf", "application/postscript", "application/powerpoint", "application/remote-printing",
+      "application/rtf"
+      , "application/slate", "application/wita", "application/wordperfect5.1", "application/x-bcpio", "application/x-cdlink",
+      "application/x-compress"
+      , "application/x-cpio", "application/x-csh", "application/x-director", "application/x-dvi", "application/x-gtar", "application/x-gzip"
+      , "application/x-hdf", "application/x-httpd-cgi", "application/x-koan", "application/x-latex", "application/x-mif",
+      "application/x-netcdf"
+      , "application/x-sh", "application/x-shar", "application/x-stuffit", "application/x-sv4cpio", "application/x-sv4crc",
+      "application/x-tar"
+      , "application/x-tcl", "application/x-tex", "application/x-texinfo", "application/x-troff", "application/x-troff-man",
+      "application/x-troff-me"
+      , "application/x-troff-ms", "application/x-ustar", "application/x-wais-source", "application/zip", "audio/basic", "audio/mpeg"
+      , "audio/x-aiff", "audio/x-pn-realaudio", "audio/x-pn-realaudio-plugin", "audio/x-realaudio", "audio/x-wav", "chemical/x-pdb"
+      , "image/gif", "image/ief", "image/jpeg", "image/png", "image/tiff", "image/x-cmu-raster"
+      , "image/x-portable-anymap", "image/x-portable-bitmap", "image/x-portable-graymap", "image/x-portable-pixmap", "image/x-rgb",
+      "image/x-xbitmap"
+      , "image/x-xpixmap", "image/x-xwindowdump", "message/external-body", "message/news", "message/partial", "message/rfc822"
+      , "multipart/alternative", "multipart/appledouble", "multipart/digest", "multipart/mixed", "multipart/parallel", "text/html"
+      , "text/plain", "text/richtext", "text/tab-separated-values", "text/x-setext", "text/x-sgml", "video/mpeg"
+      , "video/quicktime", "video/x-msvideo", "video/x-sgi-movie", "x-conference/x-cooltalk", "x-world/x-vrml"};
+  @NonNls public static final String LINK = "link";
+
+  @NonNls public static final String MATH_ML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
+  @NonNls public static final String SVG_NAMESPACE = "http://www.w3.org/2000/svg";
+
+  private HtmlUtil() {
+  }
+
+  @NonNls private static final String[] EMPTY_TAGS = {
+    "base", "hr", "meta", "link", "frame", "br", "basefont", "param", "img", "area", "input", "isindex", "col", /*html 5*/ "source", "wbr"
+  };
+  private static final Set<String> EMPTY_TAGS_MAP = new THashSet<String>();
+  @NonNls private static final String[] OPTIONAL_END_TAGS = {
+    //"html",
+    "head",
+    //"body",
+    "p", "li", "dd", "dt", "thead", "tfoot", "tbody", "colgroup", "tr", "th", "td", "option", "embed", "noembed"
+  };
+  private static final Set<String> OPTIONAL_END_TAGS_MAP = new THashSet<String>();
+
+  @NonNls private static final String[] BLOCK_TAGS = {"p", "h1", "h2", "h3", "h4", "h5", "h6", "ul", "ol", "dir", "menu", "pre",
+    "dl", "div", "center", "noscript", "noframes", "blockquote", "form", "isindex", "hr", "table", "fieldset", "address",
+    // nonexplicitly specified
+    "map",
+    // flow elements
+    "body", "object", "applet", "ins", "del", "dd", "li", "button", "th", "td", "iframe", "comment", "nobr"
+  };
+
+  // flow elements are block or inline, so they shuld not close <p> for example
+  @NonNls private static final String[] POSSIBLY_INLINE_TAGS = {"object", "applet", "ins", "del", "button", "nobr"};
+
+  private static final Set<String> BLOCK_TAGS_MAP = new THashSet<String>();
+
+  @NonNls private static final String[] INLINE_ELEMENTS_CONTAINER = {"p", "h1", "h2", "h3", "h4", "h5", "h6", "pre", "dt"};
+  private static final Set<String> INLINE_ELEMENTS_CONTAINER_MAP = new THashSet<String>();
+
+  @NonNls private static final String[] EMPTY_ATTRS =
+    {"nowrap", "compact", "disabled", "readonly", "selected", "multiple", "nohref", "ismap", "declare", "noshade", "checked"};
+  private static final Set<String> EMPTY_ATTRS_MAP = new THashSet<String>();
+
+  private static final Set<String> POSSIBLY_INLINE_TAGS_MAP = new THashSet<String>();
+
+  @NonNls private static final String[] HTML5_TAGS = {
+    "article", "aside", "audio", "canvas", "command", "datalist", "details", "embed", "figcaption", "figure", "footer", "header", "hgroup",
+    "keygen", "mark", "meter", "nav", "output", "progress", "rp", "rt", "ruby", "section", "source", "summary", "time", "video", "wbr"
+  };
+  private static final Set<String> HTML5_TAGS_SET = new THashSet<String>();
+
+  static {
+    ContainerUtil.addAll(EMPTY_TAGS_MAP, EMPTY_TAGS);
+    ContainerUtil.addAll(EMPTY_ATTRS_MAP, EMPTY_ATTRS);
+    ContainerUtil.addAll(OPTIONAL_END_TAGS_MAP, OPTIONAL_END_TAGS);
+    ContainerUtil.addAll(BLOCK_TAGS_MAP, BLOCK_TAGS);
+    ContainerUtil.addAll(INLINE_ELEMENTS_CONTAINER_MAP, INLINE_ELEMENTS_CONTAINER);
+    ContainerUtil.addAll(POSSIBLY_INLINE_TAGS_MAP, POSSIBLY_INLINE_TAGS);
+    ContainerUtil.addAll(HTML5_TAGS_SET, HTML5_TAGS);
+  }
+
+  public static boolean isSingleHtmlTag(String tagName) {
+    return EMPTY_TAGS_MAP.contains(tagName.toLowerCase());
+  }
+
+  public static boolean isSingleHtmlTagL(String tagName) {
+    return EMPTY_TAGS_MAP.contains(tagName);
+  }
+
+  public static boolean isOptionalEndForHtmlTag(String tagName) {
+    return OPTIONAL_END_TAGS_MAP.contains(tagName.toLowerCase());
+  }
+
+  public static boolean isOptionalEndForHtmlTagL(String tagName) {
+    return OPTIONAL_END_TAGS_MAP.contains(tagName);
+  }
+
+  public static boolean isSingleHtmlAttribute(String attrName) {
+    return EMPTY_ATTRS_MAP.contains(attrName.toLowerCase());
+  }
+
+  public static boolean isHtmlBlockTag(String tagName) {
+    return BLOCK_TAGS_MAP.contains(tagName.toLowerCase());
+  }
+
+  public static boolean isPossiblyInlineTag(String tagName) {
+    return POSSIBLY_INLINE_TAGS_MAP.contains(tagName);
+  }
+
+  public static boolean isHtmlBlockTagL(String tagName) {
+    return BLOCK_TAGS_MAP.contains(tagName);
+  }
+
+  public static boolean isInlineTagContainer(String tagName) {
+    return INLINE_ELEMENTS_CONTAINER_MAP.contains(tagName.toLowerCase());
+  }
+
+  public static boolean isInlineTagContainerL(String tagName) {
+    return INLINE_ELEMENTS_CONTAINER_MAP.contains(tagName);
+  }
+
+  public static void addHtmlSpecificCompletions(final XmlElementDescriptor descriptor,
+                                                final XmlTag element,
+                                                final List<XmlElementDescriptor> variants) {
+    // add html block completions for tags with optional ends!
+    String name = descriptor.getName(element);
+
+    if (name != null && isOptionalEndForHtmlTag(name)) {
+      PsiElement parent = element.getParent();
+
+      if (parent != null) {
+        // we need grand parent since completion already uses parent's descriptor
+        parent = parent.getParent();
+      }
+
+      if (parent instanceof HtmlTag) {
+        final XmlElementDescriptor parentDescriptor = ((HtmlTag)parent).getDescriptor();
+
+        if (parentDescriptor != descriptor && parentDescriptor != null) {
+          for (final XmlElementDescriptor elementsDescriptor : parentDescriptor.getElementsDescriptors((XmlTag)parent)) {
+            if (isHtmlBlockTag(elementsDescriptor.getName())) {
+              variants.add(elementsDescriptor);
+            }
+          }
+        }
+      }
+    }
+  }
+
+  @Nullable
+  public static XmlDocument getRealXmlDocument(@Nullable XmlDocument doc) {
+    if (doc == null) return null;
+    final PsiFile containingFile = doc.getContainingFile();
+
+    final PsiFile templateFile = TemplateLanguageUtil.getTemplateFile(containingFile);
+    if (templateFile instanceof XmlFile) {
+      return ((XmlFile)templateFile).getDocument();
+    }
+    return doc;
+  }
+
+  public static String[] getHtmlTagNames() {
+    return HtmlDescriptorsTable.getHtmlTagNames();
+  }
+
+  public static XmlAttributeDescriptor[] getCustomAttributeDescriptors(XmlElement context) {
+    String entitiesString = getEntitiesString(context, XmlEntitiesInspection.UNKNOWN_ATTRIBUTE);
+    if (entitiesString == null) return XmlAttributeDescriptor.EMPTY;
+
+    StringTokenizer tokenizer = new StringTokenizer(entitiesString, ",");
+    XmlAttributeDescriptor[] descriptors = new XmlAttributeDescriptor[tokenizer.countTokens()];
+    int index = 0;
+
+    while (tokenizer.hasMoreElements()) {
+      final String customName = tokenizer.nextToken();
+      if (customName.length() == 0) continue;
+
+      descriptors[index++] = new XmlAttributeDescriptorImpl() {
+        public String getName(PsiElement context) {
+          return customName;
+        }
+
+        public String getName() {
+          return customName;
+        }
+      };
+    }
+
+    return descriptors;
+  }
+
+  public static XmlElementDescriptor[] getCustomTagDescriptors(XmlElement context) {
+    String entitiesString = getEntitiesString(context, XmlEntitiesInspection.UNKNOWN_TAG);
+    if (entitiesString == null) return XmlElementDescriptor.EMPTY_ARRAY;
+
+    StringTokenizer tokenizer = new StringTokenizer(entitiesString, ",");
+    XmlElementDescriptor[] descriptors = new XmlElementDescriptor[tokenizer.countTokens()];
+    int index = 0;
+
+    while (tokenizer.hasMoreElements()) {
+      final String tagName = tokenizer.nextToken();
+      if (tagName.length() == 0) continue;
+
+      descriptors[index++] = new XmlElementDescriptorImpl(context instanceof XmlTag ? (XmlTag)context : null) {
+        public String getName(PsiElement context) {
+          return tagName;
+        }
+
+        public String getDefaultName() {
+          return tagName;
+        }
+
+        public boolean allowElementsFromNamespace(final String namespace, final XmlTag context) {
+          return true;
+        }
+      };
+    }
+
+    return descriptors;
+  }
+
+  @Nullable
+  public static String getEntitiesString(XmlElement context, int type) {
+    if (context == null) return null;
+    PsiFile containingFile = context.getContainingFile().getOriginalFile();
+
+    final InspectionProfile profile = InspectionProjectProfileManager.getInstance(context.getProject()).getInspectionProfile();
+
+    switch (type) {
+      case XmlEntitiesInspection.UNKNOWN_TAG:
+        LocalInspectionToolWrapper wrapper = (LocalInspectionToolWrapper)profile.getInspectionTool(HtmlUnknownTagInspection.TAG_SHORT_NAME,
+                                                                                                   containingFile);
+        HtmlUnknownTagInspection unknownTagInspection = wrapper != null ? (HtmlUnknownTagInspection)wrapper.getTool() : null;
+        if (unknownTagInspection != null) {
+          return unknownTagInspection.getAdditionalEntries();
+        }
+        break;
+      case XmlEntitiesInspection.UNKNOWN_ATTRIBUTE:
+        LocalInspectionToolWrapper wrapper1 =
+          (LocalInspectionToolWrapper)profile.getInspectionTool(HtmlUnknownAttributeInspection.ATTRIBUTE_SHORT_NAME,
+                                                                containingFile);
+        HtmlUnknownAttributeInspection unknownAttributeInspection =
+          wrapper1 != null ? (HtmlUnknownAttributeInspection)wrapper1.getTool() : null;
+        if (unknownAttributeInspection != null) {
+          return unknownAttributeInspection.getAdditionalEntries();
+        }
+        break;
+    }
+
+    return null;
+  }
+
+  public static XmlAttributeDescriptor[] appendHtmlSpecificAttributeCompletions(final XmlTag declarationTag,
+                                                                                XmlAttributeDescriptor[] descriptors,
+                                                                                final XmlAttributeImpl context) {
+    if (declarationTag instanceof HtmlTag) {
+      descriptors = ArrayUtil.mergeArrays(
+        descriptors,
+        getCustomAttributeDescriptors(context)
+      );
+      return descriptors;
+    }
+
+    if (declarationTag.getPrefixByNamespace(XmlUtil.JSF_HTML_URI) != null &&
+        declarationTag.getNSDescriptor(XmlUtil.XHTML_URI, true) != null &&
+        !XmlUtil.JSP_URI.equals(declarationTag.getNamespace())) {
+
+      descriptors = ArrayUtil.append(
+        descriptors,
+        new XmlAttributeDescriptorImpl() {
+          public String getName(PsiElement context) {
+            return JSFC;
+          }
+
+          public String getName() {
+            return JSFC;
+          }
+        }
+      );
+    }
+    return descriptors;
+  }
+
+  public static boolean isHtml5Document(XmlDocument doc) {
+    if (doc == null) {
+      return false;
+    }
+    XmlProlog prolog = doc.getProlog();
+    XmlDoctype doctype = prolog != null ? prolog.getDoctype() : null;
+    if (!isHtmlTagContainingFile(doc)) {
+      return false;
+    }
+
+    final PsiFile htmlFile = doc.getContainingFile();
+
+    final String htmlFileFullName;
+    if (htmlFile != null) {
+      final VirtualFile vFile = htmlFile.getVirtualFile();
+      if (vFile != null) {
+        htmlFileFullName = vFile.getPath();
+      }
+      else {
+        htmlFileFullName = htmlFile.getName();
+      }
+    }
+    else {
+      htmlFileFullName = "unknown";
+    }
+
+    if (doctype == null) {
+      LOG.debug("DOCTYPE for " + htmlFileFullName + " is null");
+      return Html5SchemaProvider.HTML5_SCHEMA_LOCATION
+        .equals(ExternalResourceManagerEx.getInstanceEx().getDefaultHtmlDoctype(doc.getProject()));
+    }
+
+    final boolean html5Doctype = isHtml5Doctype(doctype);
+    final String doctypeDescription = "text: " + doctype.getText() +
+                                      ", dtdUri: " + doctype.getDtdUri() +
+                                      ", publicId: " + doctype.getPublicId() +
+                                      ", markupDecl: " + doctype.getMarkupDecl();
+    LOG.debug("DOCTYPE for " + htmlFileFullName + "; " + doctypeDescription + "; HTML5: " + html5Doctype);
+    return html5Doctype;
+  }
+
+  public static boolean isHtml5Doctype(XmlDoctype doctype) {
+    return doctype.getDtdUri() == null && doctype.getPublicId() == null && doctype.getMarkupDecl() == null;
+  }
+
+  public static boolean isHtml5Context(XmlElement context) {
+    XmlDocument doc = PsiTreeUtil.getParentOfType(context, XmlDocument.class);
+    return isHtml5Document(doc);
+  }
+
+  public static boolean hasNonHtml5Doctype(XmlElement context) {
+    XmlDocument doc = PsiTreeUtil.getParentOfType(context, XmlDocument.class);
+    if (doc == null) {
+      return false;
+    }
+    XmlProlog prolog = doc.getProlog();
+    XmlDoctype doctype = prolog != null ? prolog.getDoctype() : null;
+    return doctype != null && !isHtml5Doctype(doctype);
+  }
+
+  public static boolean isHtml5Tag(String tagName) {
+    return HTML5_TAGS_SET.contains(tagName);
+  }
+
+  public static boolean isCustomHtml5Attribute(String attributeName) {
+    return attributeName.startsWith(HTML5_DATA_ATTR_PREFIX);
+  }
+
+  public static void processLinks(@NotNull final XmlFile xhtmlFile,
+                                  @NotNull Processor<XmlTag> tagProcessor) {
+    final XmlDocument doc = getRealXmlDocument(xhtmlFile.getDocument());
+    if (doc == null) return;
+
+    final XmlTag rootTag = doc.getRootTag();
+    if (rootTag == null) return;
+
+    if (LINK.equalsIgnoreCase(rootTag.getName())) {
+      tagProcessor.process(rootTag);
+    }
+    else {
+      findLinkStylesheets(rootTag, tagProcessor);
+    }
+  }
+
+  public static void findLinkStylesheets(@NotNull final XmlTag tag,
+                                         @NotNull Processor<XmlTag> tagProcessor) {
+    processInjectedContent(tag, tagProcessor);
+
+    for (XmlTag subTag : tag.getSubTags()) {
+      findLinkStylesheets(subTag, tagProcessor);
+    }
+
+    if (LINK.equalsIgnoreCase(tag.getName())) {
+      tagProcessor.process(tag);
+    }
+  }
+
+  public static void processInjectedContent(final XmlTag element,
+                                            @NotNull final Processor<XmlTag> tagProcessor) {
+    final PsiLanguageInjectionHost.InjectedPsiVisitor injectedPsiVisitor = new PsiLanguageInjectionHost.InjectedPsiVisitor() {
+      public void visit(@NotNull PsiFile injectedPsi, @NotNull List<PsiLanguageInjectionHost.Shred> places) {
+        if (injectedPsi instanceof XmlFile) {
+          final XmlDocument injectedDocument = ((XmlFile)injectedPsi).getDocument();
+          if (injectedDocument != null) {
+            final XmlTag rootTag = injectedDocument.getRootTag();
+            if (rootTag != null) {
+              for (PsiElement element = rootTag; element != null; element = element.getNextSibling()) {
+                if (element instanceof XmlTag) {
+                  final XmlTag tag = (XmlTag)element;
+                  String tagName = tag.getLocalName();
+                  if (element instanceof HtmlTag || tag.getNamespacePrefix().length() > 0) tagName = tagName.toLowerCase();
+                  if (LINK.equalsIgnoreCase(tagName)) {
+                    tagProcessor.process((XmlTag)element);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    };
+
+    final XmlText[] texts = PsiTreeUtil.getChildrenOfType(element, XmlText.class);
+    if (texts != null && texts.length > 0) {
+      for (final XmlText text : texts) {
+        for (PsiElement _element : text.getChildren()) {
+          if (_element instanceof PsiLanguageInjectionHost) {
+            InjectedLanguageUtil.enumerate(_element, injectedPsiVisitor);
+          }
+        }
+      }
+    }
+
+    final XmlComment[] comments = PsiTreeUtil.getChildrenOfType(element, XmlComment.class);
+    if (comments != null && comments.length > 0) {
+      for (final XmlComment comment : comments) {
+        if (comment instanceof PsiLanguageInjectionHost) {
+          InjectedLanguageUtil.enumerate(comment, injectedPsiVisitor);
+        }
+      }
+    }
+  }
+
+  private static class TerminateException extends RuntimeException {
+    private static final TerminateException INSTANCE = new TerminateException();
+  }
+
+  public static Charset detectCharsetFromMetaHttpEquiv(@NotNull String content) {
+    final Ref<String> charsetNameRef = new Ref<String>();
+    try {
+      new HtmlBuilderDriver(content).build(new XmlBuilder() {
+        @NonNls final Set<String> inTag = new THashSet<String>();
+        boolean metHttpEquiv = false;
+
+        public void doctype(@Nullable final CharSequence publicId,
+                            @Nullable final CharSequence systemId,
+                            final int startOffset,
+                            final int endOffset) {
+        }
+
+        public ProcessingOrder startTag(final CharSequence localName, final String namespace, final int startoffset, final int endoffset,
+                                        final int headerEndOffset) {
+          @NonNls String name = localName.toString().toLowerCase();
+          inTag.add(name);
+          if (!inTag.contains("head") && !"html".equals(name)) terminate();
+          return ProcessingOrder.TAGS_AND_ATTRIBUTES;
+        }
+
+        private void terminate() {
+          throw TerminateException.INSTANCE;
+        }
+
+        public void endTag(final CharSequence localName, final String namespace, final int startoffset, final int endoffset) {
+          @NonNls final String name = localName.toString().toLowerCase();
+          if ("meta".equals(name) && metHttpEquiv && contentAttributeValue != null) {
+            int start = contentAttributeValue.indexOf(CHARSET_PREFIX);
+            if (start == -1) return;
+            start += CHARSET_PREFIX.length();
+            int end = contentAttributeValue.indexOf(';', start);
+            if (end == -1) end = contentAttributeValue.length();
+            String charsetName = contentAttributeValue.substring(start, end);
+            charsetNameRef.set(charsetName);
+            terminate();
+          }
+          if ("head".equals(name)) {
+            terminate();
+          }
+          inTag.remove(name);
+          metHttpEquiv = false;
+          contentAttributeValue = null;
+        }
+
+        private String contentAttributeValue;
+
+        public void attribute(final CharSequence localName, final CharSequence v, final int startoffset, final int endoffset) {
+          @NonNls final String name = localName.toString().toLowerCase();
+          if (inTag.contains("meta")) {
+            @NonNls String value = v.toString().toLowerCase();
+            if (name.equals("http-equiv")) {
+              metHttpEquiv |= value.equals("content-type");
+            }
+            if (name.equals("content")) {
+              contentAttributeValue = value;
+            }
+          }
+        }
+
+        public void textElement(final CharSequence display, final CharSequence physical, final int startoffset, final int endoffset) {
+        }
+
+        public void entityRef(final CharSequence ref, final int startOffset, final int endOffset) {
+        }
+
+        public void error(String message, int startOffset, int endOffset) {
+        }
+      });
+    }
+    catch (TerminateException e) {
+      //ignore
+    }
+    catch (Exception e) {
+      // some weird things can happen, like unbalanaced tree
+    }
+
+    String name = charsetNameRef.get();
+    return CharsetToolkit.forName(name);
+  }
+
+  public static boolean isTagWithoutAttributes(@NonNls String tagName) {
+    return tagName != null && "br".equalsIgnoreCase(tagName);
+  }
+
+  public static boolean hasHtml(PsiFile file) {
+    return isHtmlFile(file) || file.getViewProvider() instanceof TemplateLanguageFileViewProvider;
+  }
+
+  public static boolean isHtmlFile(PsiElement element) {
+    Language language = element.getLanguage();
+    return language == HTMLLanguage.INSTANCE || language == XHTMLLanguage.INSTANCE;
+  }
+
+  public static boolean isHtmlTagContainingFile(PsiElement element) {
+    if (element == null) {
+      return false;
+    }
+    final PsiFile containingFile = element.getContainingFile();
+    if (containingFile != null) {
+      final XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class, false);
+      if (tag instanceof HtmlTag) {
+        return true;
+      }
+      final XmlDocument document = PsiTreeUtil.getParentOfType(element, XmlDocument.class, false);
+      if (document instanceof HtmlDocumentImpl) {
+        return true;
+      }
+      final FileViewProvider provider = containingFile.getViewProvider();
+      Language language;
+      if (provider instanceof TemplateLanguageFileViewProvider) {
+        language = ((TemplateLanguageFileViewProvider)provider).getTemplateDataLanguage();
+      }
+      else {
+        language = provider.getBaseLanguage();
+      }
+
+      return language == XHTMLLanguage.INSTANCE;
+    }
+    return false;
+  }
+
+  public static boolean isHtmlTagContainingFile(final Editor editor, final PsiFile file) {
+    if (editor == null || file == null || !(file instanceof XmlFile)) {
+      return false;
+    }
+    final int offset = editor.getCaretModel().getOffset();
+    final PsiElement element = file.findElementAt(offset);
+    return isHtmlTagContainingFile(element);
+  }
+
+  public static boolean isPureHtmlFile(@NotNull PsiFile file) {
+    FileType fileTypeByName = FileTypeManager.getInstance().getFileTypeByFileName(file.getName());
+    return file.getLanguage() == HTMLLanguage.INSTANCE &&
+        fileTypeByName == HtmlFileType.INSTANCE &&
+        !(file.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider);
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/xml/util/IncludedXmlAttribute.java b/xml/impl/src/com/intellij/xml/util/IncludedXmlAttribute.java
new file mode 100644
index 0000000..988b7d0
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/IncludedXmlAttribute.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlAttributeDescriptor;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public class IncludedXmlAttribute extends IncludedXmlElement<XmlAttribute> implements XmlAttribute {
+
+  public IncludedXmlAttribute(@NotNull XmlAttribute original, @Nullable XmlTag parent) {
+    super(original, parent);
+  }
+
+  @Override
+  @NonNls
+  @NotNull
+  public String getName() {
+    return getOriginal().getName();
+  }
+
+  @Override
+  public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException {
+    throw new UnsupportedOperationException("Can't modify included elements");
+  }
+
+  @NonNls
+  @NotNull
+  public String getLocalName() {
+    return getOriginal().getLocalName();
+  }
+
+  @NonNls
+  @NotNull
+  public String getNamespace() {
+    return getOriginal().getNamespace();
+  }
+
+  @NonNls
+  @NotNull
+  public String getNamespacePrefix() {
+    return getOriginal().getNamespacePrefix();
+  }
+
+  public XmlTag getParent() {
+    return (XmlTag)super.getParent();
+  }
+
+  public String getValue() {
+    return getOriginal().getValue();
+  }
+
+  public String getDisplayValue() {
+    return getOriginal().getDisplayValue();
+  }
+
+  public int physicalToDisplay(int offset) {
+    return getOriginal().physicalToDisplay(offset);
+  }
+
+  public int displayToPhysical(int offset) {
+    return getOriginal().displayToPhysical(offset);
+  }
+
+  public TextRange getValueTextRange() {
+    return getOriginal().getValueTextRange();
+  }
+
+  public boolean isNamespaceDeclaration() {
+    return getOriginal().isNamespaceDeclaration();
+  }
+
+  @Nullable
+  public XmlAttributeDescriptor getDescriptor() {
+    return getOriginal().getDescriptor();
+  }
+
+  @Nullable
+  public XmlAttributeValue getValueElement() {
+    return getOriginal().getValueElement();
+  }
+
+  public void setValue(String value) throws IncorrectOperationException {
+    throw new UnsupportedOperationException("Can't modify included elements");
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/IncludedXmlElement.java b/xml/impl/src/com/intellij/xml/util/IncludedXmlElement.java
new file mode 100644
index 0000000..ed92f43
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/IncludedXmlElement.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.psi.PsiAnchor;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiInvalidElementAccessException;
+import com.intellij.psi.impl.light.LightElement;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlText;
+import com.intellij.reference.SoftReference;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public abstract class IncludedXmlElement<T extends XmlElement> extends LightElement implements XmlElement {
+  private final PsiAnchor myOriginal;
+  private SoftReference<T> myRef;
+  private final PsiElement myParent;
+
+  public IncludedXmlElement(@NotNull T original, @Nullable PsiElement parent) {
+    super(original.getManager(), original.getLanguage());
+    //noinspection unchecked
+    T realOriginal = original instanceof IncludedXmlElement ? ((IncludedXmlElement<T>)original).getOriginal() : original;
+    myOriginal = PsiAnchor.create(realOriginal);
+    myRef = new SoftReference<T>(realOriginal);
+    myParent = parent;
+  }
+
+  @Override
+  public boolean isValid() {
+    T t = myRef.get();
+    if (t != null) {
+      return t.isValid();
+    }
+
+    return myOriginal.retrieve() != null;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    IncludedXmlElement element = (IncludedXmlElement)o;
+
+    if (!myParent.equals(element.myParent)) return false;
+    if (!myOriginal.equals(element.myOriginal)) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = myOriginal.hashCode();
+    result = 31 * result + myParent.hashCode();
+    return result;
+  }
+
+  public T getOriginal() {
+    T element = myRef.get();
+    if (element != null) {
+      return element;
+    }
+
+    element = (T)myOriginal.retrieve();
+    if (element == null) {
+      throw new PsiInvalidElementAccessException(this);
+    }
+    myRef = new SoftReference<T>(element);
+    return element;
+  }
+
+  @NotNull
+  @Override
+  public T getNavigationElement() {
+    return getOriginal();
+  }
+
+  @Override
+  public PsiFile getContainingFile() {
+    return myParent.getContainingFile();
+  }
+
+  @Override
+  public PsiElement getParent() {
+    return myParent;
+  }
+
+  @Override
+  public String toString() {
+    return getClass().getSimpleName();
+  }
+
+  @Override
+  public boolean processElements(final PsiElementProcessor processor, PsiElement place) {
+    final IncludedXmlElement<T> self = this;
+    return getOriginal().processElements(new PsiElementProcessor() {
+      @SuppressWarnings("unchecked")
+      @Override
+      public boolean execute(@NotNull PsiElement element) {
+        if (element instanceof XmlTag) {
+          XmlTag theirParent = ((XmlTag)element).getParentTag();
+          PsiElement parent = getOriginal().equals(theirParent) ? (XmlTag)self : theirParent;
+          return processor.execute(new IncludedXmlTag((XmlTag)element, parent));
+        }
+        if (element instanceof XmlAttribute) {
+          XmlTag theirParent = ((XmlAttribute)element).getParent();
+          XmlTag parent = getOriginal().equals(theirParent) ? (XmlTag)self : theirParent;
+          return processor.execute(new IncludedXmlAttribute((XmlAttribute)element, parent));
+        }
+        if (element instanceof XmlText) {
+          XmlTag theirParent = ((XmlText)element).getParentTag();
+          XmlTag parent = getOriginal().equals(theirParent) ? (XmlTag)self : theirParent;
+          return processor.execute(new IncludedXmlText((XmlText)element, parent));
+        }
+        return processor.execute(element);
+      }
+    }, place);
+  }
+
+
+}
diff --git a/xml/impl/src/com/intellij/xml/util/IncludedXmlTag.java b/xml/impl/src/com/intellij/xml/util/IncludedXmlTag.java
new file mode 100644
index 0000000..22481b1
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/IncludedXmlTag.java
@@ -0,0 +1,257 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.impl.source.xml.XmlTagValueImpl;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagChild;
+import com.intellij.psi.xml.XmlTagValue;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+/**
+ * @author peter
+ */
+public class IncludedXmlTag extends IncludedXmlElement<XmlTag> implements XmlTag {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.util.IncludedXmlTag");
+  public IncludedXmlTag(@NotNull XmlTag original, @Nullable PsiElement parent) {
+    super(original, parent);
+  }
+
+  @Override
+  @Nullable
+  public XmlTag getParentTag() {
+    return getParent() instanceof XmlTag ? (XmlTag)getParent() : null;
+  }
+
+  @Override
+  @NotNull
+  @NonNls
+  public String getName() {
+    return getOriginal().getName();
+  }
+
+  @Override
+  public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException {
+    throw new UnsupportedOperationException("Can't modify included tags");
+  }
+
+  @Override
+  @NotNull
+  @NonNls
+  public String getNamespace() {
+    XmlTag original = getOriginal();
+    LOG.assertTrue(original.isValid());
+    return original.getNamespace();
+  }
+
+  @Override
+  @NotNull
+  @NonNls
+  public String getLocalName() {
+    return getOriginal().getLocalName();
+  }
+
+  @Override
+  @Nullable
+  public XmlElementDescriptor getDescriptor() {
+    return getOriginal().getDescriptor();
+  }
+
+  @Override
+  @NotNull
+  public XmlAttribute[] getAttributes() {
+    XmlAttribute[] original = getOriginal().getAttributes();
+    XmlAttribute[] attributes = new XmlAttribute[original.length];
+    for (int i = 0; i < original.length; i++) {
+      XmlAttribute attribute = original[i];
+      attributes[i] = new IncludedXmlAttribute(attribute, this);
+    }
+    return attributes;
+  }
+
+  @Override
+  @Nullable
+  public XmlAttribute getAttribute(@NonNls String name, @NonNls String namespace) {
+    XmlAttribute attribute = getOriginal().getAttribute(name, namespace);
+    return attribute == null ? null : new IncludedXmlAttribute(attribute, this);
+  }
+
+  @Override
+  @Nullable
+  public XmlAttribute getAttribute(@NonNls String qname) {
+    XmlAttribute attribute = getOriginal().getAttribute(qname);
+    return attribute == null ? null : new IncludedXmlAttribute(attribute, this);
+  }
+
+  @Override
+  @Nullable
+  public String getAttributeValue(@NonNls String name, @NonNls String namespace) {
+    return getOriginal().getAttributeValue(name, namespace);
+  }
+
+  @Override
+  @Nullable
+  public String getAttributeValue(@NonNls String qname) {
+    return getOriginal().getAttributeValue(qname);
+  }
+
+  @Override
+  public XmlAttribute setAttribute(@NonNls String name, @NonNls String namespace, @NonNls String value) throws IncorrectOperationException {
+    throw new UnsupportedOperationException("Can't modify included tags");
+  }
+
+  @Override
+  public XmlAttribute setAttribute(@NonNls String qname, @NonNls String value) throws IncorrectOperationException {
+    throw new UnsupportedOperationException("Can't modify included tags");
+  }
+
+  @Override
+  public XmlTag createChildTag(@NonNls String localName,
+                               @NonNls String namespace,
+                               @Nullable @NonNls String bodyText,
+                               boolean enforceNamespacesDeep) {
+    return getOriginal().createChildTag(localName, namespace, bodyText, enforceNamespacesDeep);
+  }
+
+  @Override
+  public XmlTag addSubTag(XmlTag subTag, boolean first) {
+    throw new UnsupportedOperationException("Can't modify included tags");
+  }
+
+  @Override
+  @NotNull
+  public XmlTag[] getSubTags() {
+    return wrapTags(getOriginal().getSubTags());
+  }
+
+  private XmlTag[] wrapTags(XmlTag[] original) {
+    XmlTag[] result = new XmlTag[original.length];
+    for (int i = 0; i < original.length; i++) {
+      result[i] = new IncludedXmlTag(original[i], this);
+    }
+    return result;
+  }
+
+  @Override
+  @NotNull
+  public XmlTag[] findSubTags(@NonNls String qname) {
+    return wrapTags(getOriginal().findSubTags(qname));
+  }
+
+  @Override
+  @NotNull
+  public XmlTag[] findSubTags(@NonNls String localName, @NonNls String namespace) {
+    return wrapTags(getOriginal().findSubTags(localName, namespace));
+  }
+
+  @Override
+  @Nullable
+  public XmlTag findFirstSubTag(@NonNls String qname) {
+    XmlTag tag = getOriginal().findFirstSubTag(qname);
+    return tag == null ? null : new IncludedXmlTag(tag, this);
+  }
+
+  @Override
+  @NotNull
+  @NonNls
+  public String getNamespacePrefix() {
+    return getOriginal().getNamespacePrefix();
+  }
+
+  @Override
+  @NotNull
+  @NonNls
+  public String getNamespaceByPrefix(@NonNls String prefix) {
+    return getOriginal().getNamespaceByPrefix(prefix);
+  }
+
+  @Override
+  @Nullable
+  public String getPrefixByNamespace(@NonNls String namespace) {
+    return getOriginal().getPrefixByNamespace(namespace);
+  }
+
+  @Override
+  public String[] knownNamespaces() {
+    return getOriginal().knownNamespaces();
+  }
+
+  @Override
+  public boolean hasNamespaceDeclarations() {
+    return getOriginal().hasNamespaceDeclarations();
+  }
+
+  @Override
+  @NotNull
+  public Map<String, String> getLocalNamespaceDeclarations() {
+    return getOriginal().getLocalNamespaceDeclarations();
+  }
+
+  @Override
+  @NotNull
+  public XmlTagValue getValue() {
+    return XmlTagValueImpl.createXmlTagValue(this);
+  }
+
+  @Override
+  @Nullable
+  public XmlNSDescriptor getNSDescriptor(@NonNls String namespace, boolean strict) {
+    return getOriginal().getNSDescriptor(namespace, strict);
+  }
+
+  @Override
+  public boolean isEmpty() {
+    return getOriginal().isEmpty();
+  }
+
+  @Override
+  public void collapseIfEmpty() {
+    throw new UnsupportedOperationException("Can't modify included tags");
+  }
+
+  @Override
+  @Nullable
+  @NonNls
+  public String getSubTagText(@NonNls String qname) {
+    return getOriginal().getSubTagText(qname);
+  }
+
+  @Override
+  public PsiMetaData getMetaData() {
+    return null;
+  }
+
+  @Override
+  public XmlTagChild getNextSiblingInTag() {
+    return null;
+  }
+
+  @Override
+  public XmlTagChild getPrevSiblingInTag() {
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/IncludedXmlText.java b/xml/impl/src/com/intellij/xml/util/IncludedXmlText.java
new file mode 100644
index 0000000..b98a360
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/IncludedXmlText.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagChild;
+import com.intellij.psi.xml.XmlText;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public class IncludedXmlText extends IncludedXmlElement<XmlText> implements XmlText {
+  public IncludedXmlText(@NotNull XmlText original, @Nullable XmlTag parent) {
+    super(original, parent);
+  }
+
+  @Override
+  public XmlTag getParentTag() {
+    return (XmlTag)getParent();
+  }
+
+  @Override
+  public XmlTagChild getNextSiblingInTag() {
+    return null;
+  }
+
+  @Override
+  public XmlTagChild getPrevSiblingInTag() {
+    return null;
+  }
+
+  @Override
+  public String getText() {
+    return getOriginal().getText();
+  }
+
+  public String getValue() {
+    return getOriginal().getValue();
+  }
+
+  public void setValue(String s) throws IncorrectOperationException {
+    throw new UnsupportedOperationException("Can't modify included elements");
+  }
+
+  public XmlElement insertAtOffset(XmlElement element, int displayOffset) throws IncorrectOperationException {
+    throw new UnsupportedOperationException("Can't modify included elements");
+  }
+
+  public void insertText(String text, int displayOffset) throws IncorrectOperationException {
+    throw new UnsupportedOperationException("Can't modify included elements");
+  }
+
+  public void removeText(int displayStart, int displayEnd) throws IncorrectOperationException {
+    throw new UnsupportedOperationException("Can't modify included elements");
+  }
+
+  public int physicalToDisplay(int offset) {
+    return getOriginal().physicalToDisplay(offset);
+  }
+
+  public int displayToPhysical(int offset) {
+    return getOriginal().displayToPhysical(offset);
+  }
+
+  @Nullable
+  public XmlText split(int displayIndex) {
+    throw new UnsupportedOperationException("Can't modify included elements");
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/InclusionProvider.java b/xml/impl/src/com/intellij/xml/util/InclusionProvider.java
new file mode 100644
index 0000000..9f637d5
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/InclusionProvider.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.openapi.util.NullableComputable;
+import com.intellij.openapi.util.RecursionManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.util.PsiModificationTracker;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xmlb.JDOMXIncluder;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.regex.Matcher;
+
+/**
+* @author peter
+*/
+class InclusionProvider implements CachedValueProvider<PsiElement[]> {
+  private final XmlTag myXincludeTag;
+
+  public InclusionProvider(XmlTag xincludeTag) {
+    myXincludeTag = xincludeTag;
+  }
+
+  @NotNull
+  public static PsiElement[] getIncludedTags(XmlTag xincludeTag) {
+    return CachedValuesManager.getManager(xincludeTag.getProject()).getCachedValue(xincludeTag, new InclusionProvider(xincludeTag));
+  }
+
+  public Result<PsiElement[]> compute() {
+    PsiElement[] result = RecursionManager.doPreventingRecursion(myXincludeTag, true, new NullableComputable<PsiElement[]>() {
+      @Override
+      public PsiElement[] compute() {
+        return computeInclusion(myXincludeTag);
+      }
+    });
+    return Result.create(result == null ? PsiElement.EMPTY_ARRAY : result, PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT);
+  }
+
+  private static XmlTag[] extractXpointer(@NotNull XmlTag rootTag, @Nullable final String xpointer) {
+    if (xpointer != null) {
+      Matcher matcher = JDOMXIncluder.XPOINTER_PATTERN.matcher(xpointer);
+      if (matcher.matches()) {
+        String pointer = matcher.group(1);
+        matcher = JDOMXIncluder.CHILDREN_PATTERN.matcher(pointer);
+        if (matcher.matches() && matcher.group(1).equals(rootTag.getName())) {
+          return rootTag.getSubTags();
+        }
+      }
+    }
+
+    return new XmlTag[]{rootTag};
+  }
+
+  @Nullable
+  private static PsiElement[] computeInclusion(final XmlTag xincludeTag) {
+    final XmlFile included = XmlIncludeHandler.resolveXIncludeFile(xincludeTag);
+    final XmlDocument document = included != null ? included.getDocument() : null;
+    final XmlTag rootTag = document != null ? document.getRootTag() : null;
+    if (rootTag != null) {
+      final String xpointer = xincludeTag.getAttributeValue("xpointer", XmlUtil.XINCLUDE_URI);
+      final XmlTag[] includeTag = extractXpointer(rootTag, xpointer);
+      PsiElement[] result = new PsiElement[includeTag.length];
+      for (int i = 0; i < includeTag.length; i++) {
+        result[i] = new IncludedXmlTag(includeTag[i], xincludeTag.getParentTag());
+      }
+      return result;
+    }
+
+    return null;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/xml/util/TagSetRuleProvider.java b/xml/impl/src/com/intellij/xml/util/TagSetRuleProvider.java
new file mode 100644
index 0000000..e4e20b9
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/TagSetRuleProvider.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Sergey Evdokimov
+ */
+public abstract class TagSetRuleProvider extends XmlTagRuleProviderBase {
+
+  private final Map<String, TagsRuleMap> map = Collections.synchronizedMap(new HashMap<String, TagsRuleMap>());
+
+  @Nullable
+  protected abstract String getNamespace(@NotNull XmlTag tag);
+
+  protected abstract void initMap(TagsRuleMap map, @NotNull String version);
+
+  @Override
+  public Rule[] getTagRule(@NotNull XmlTag tag) {
+    String namespace = getNamespace(tag);
+    if (namespace == null) return Rule.EMPTY_ARRAY;
+
+    return getTagRule(tag, namespace);
+  }
+
+  public Rule[] getTagRule(@NotNull XmlTag tag, String namespace) {
+    TagsRuleMap ruleMap = map.get(namespace);
+    if (ruleMap == null) {
+      ruleMap = new TagsRuleMap();
+      initMap(ruleMap, namespace);
+      map.put(namespace, ruleMap);
+    }
+
+    String tagName = tag.getLocalName();
+    Rule[] rules = ruleMap.get(tagName);
+    if (rules == null) return Rule.EMPTY_ARRAY;
+
+    return rules;
+  }
+
+  protected static class TagsRuleMap extends HashMap<String, Rule[]> {
+    public void add(String tagName, Rule ... rules) {
+      assert rules.length > 0;
+      Rule[] oldValue = put(tagName, rules);
+      assert oldValue == null;
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/UserColorLookup.java b/xml/impl/src/com/intellij/xml/util/UserColorLookup.java
new file mode 100644
index 0000000..b43aed5
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/UserColorLookup.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.codeInsight.completion.InsertHandler;
+import com.intellij.codeInsight.completion.InsertionContext;
+import com.intellij.codeInsight.completion.PrioritizedLookupElement;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupElementBuilder;
+import com.intellij.codeInsight.lookup.LookupElementDecorator;
+import com.intellij.codeInsight.lookup.LookupValueWithPriority;
+import com.intellij.openapi.actionSystem.LangDataKeys;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.wm.WindowManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.ui.ColorChooser;
+import com.intellij.ui.ColorPickerListener;
+import com.intellij.ui.ColorPickerListenerFactory;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.Nullable;
+
+import java.awt.*;
+
+/**
+ * @author maxim
+ */
+public class UserColorLookup extends LookupElementDecorator<LookupElement> {
+  private static final String COLOR_STRING = XmlBundle.message("choose.color.in.color.lookup");
+
+  public UserColorLookup() {
+    super(PrioritizedLookupElement.withPriority(LookupElementBuilder.create(COLOR_STRING).withInsertHandler(
+      new InsertHandler<LookupElement>() {
+        @Override
+        public void handleInsert(InsertionContext context, LookupElement item) {
+          handleUserSelection(context);
+        }
+      }), LookupValueWithPriority.HIGH));
+  }
+
+  private static void handleUserSelection(InsertionContext context) {
+    Color myColorAtCaret = null;
+
+    Editor selectedTextEditor = context.getEditor();
+    PsiElement element = context.getFile().findElementAt(selectedTextEditor.getCaretModel().getOffset());
+
+    if (element instanceof XmlToken) {
+      myColorAtCaret = getColorFromElement(element);
+    }
+
+    context.getDocument().deleteString(context.getStartOffset(), context.getTailOffset());
+
+    ColorPickerListener[] listeners = ColorPickerListenerFactory.createListenersFor(element);
+    Color color = ColorChooser.chooseColor(WindowManager.getInstance().suggestParentWindow(context.getProject()),
+                                           XmlBundle.message("choose.color.dialog.title"), myColorAtCaret, true, listeners);
+
+    if (color != null) {
+      String s = Integer.toHexString(color.getRGB() & 0xFFFFFF);
+      if (s.length() != 6) {
+        StringBuilder buf = new StringBuilder(s);
+        for (int i = 6 - buf.length(); i > 0; --i) {
+          buf.insert(0, '0');
+        }
+        s = buf.toString();
+      }
+      s = "#" + s;
+      context.getDocument().insertString(context.getStartOffset(), s);
+      context.getEditor().getCaretModel().moveToOffset(context.getTailOffset());
+    }
+  }
+
+  @Nullable
+  public static Color getColorFromElement(final PsiElement element) {
+    if (!(element instanceof XmlToken)) return null;
+
+    return ColorSampleLookupValue.getColor(element.getText());
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XIncludeProvider.java b/xml/impl/src/com/intellij/xml/util/XIncludeProvider.java
new file mode 100644
index 0000000..5edaeca
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XIncludeProvider.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.ide.highlighter.XmlFileType;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.project.ProjectCoreUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.impl.include.FileIncludeInfo;
+import com.intellij.psi.impl.include.FileIncludeProvider;
+import com.intellij.util.indexing.FileContent;
+import com.intellij.util.text.CharArrayUtil;
+import com.intellij.util.xml.NanoXmlUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XIncludeProvider extends FileIncludeProvider {
+  @NotNull
+  @Override
+  public String getId() {
+    return "XInclude";
+  }
+
+  @Override
+  public boolean acceptFile(VirtualFile file) {
+    final FileType fileType = file.getFileType();
+    return fileType == XmlFileType.INSTANCE && !ProjectCoreUtil.isProjectOrWorkspaceFile(file, fileType);
+  }
+
+  @NotNull
+  @Override
+  public FileIncludeInfo[] getIncludeInfos(FileContent content) {
+    CharSequence contentAsText = content.getContentAsText();
+    if (CharArrayUtil.indexOf(contentAsText, XmlUtil.XINCLUDE_URI, 0) == -1) return FileIncludeInfo.EMPTY;
+    final ArrayList<FileIncludeInfo> infos = new ArrayList<FileIncludeInfo>();
+    NanoXmlUtil.parse(CharArrayUtil.readerFromCharSequence(contentAsText), new NanoXmlUtil.IXMLBuilderAdapter() {
+
+      boolean isXInclude;
+      @Override
+      public void startElement(String name, String nsPrefix, String nsURI, String systemID, int lineNr) throws Exception {
+        isXInclude = XmlUtil.XINCLUDE_URI.equals(nsURI) && "include".equals(name);
+      }
+
+      @Override
+      public void addAttribute(String key, String nsPrefix, String nsURI, String value, String type) throws Exception {
+        if (isXInclude && "href".equals(key)) {
+          infos.add(new FileIncludeInfo(value));
+        }
+      }
+
+      @Override
+      public void endElement(String name, String nsPrefix, String nsURI) throws Exception {
+        isXInclude = false;
+      }
+    });
+    return infos.toArray(new FileIncludeInfo[infos.size()]);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XmlApplicationComponent.java b/xml/impl/src/com/intellij/xml/util/XmlApplicationComponent.java
new file mode 100644
index 0000000..764db5a
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XmlApplicationComponent.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.html.impl.RelaxedHtmlFromSchemaNSDescriptor;
+import com.intellij.psi.filters.*;
+import com.intellij.psi.filters.position.NamespaceFilter;
+import com.intellij.psi.filters.position.TargetNamespaceFilter;
+import com.intellij.psi.meta.MetaDataContributor;
+import com.intellij.psi.meta.MetaDataRegistrar;
+import com.intellij.psi.xml.*;
+import com.intellij.xml.impl.dtd.XmlNSDescriptorImpl;
+import com.intellij.xml.impl.schema.NamedObjectDescriptor;
+import com.intellij.xml.impl.schema.SchemaNSDescriptor;
+import com.intellij.xml.impl.schema.XmlAttributeDescriptorImpl;
+import com.intellij.xml.impl.schema.XmlElementDescriptorImpl;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class XmlApplicationComponent implements MetaDataContributor {
+  public void contributeMetaData(final MetaDataRegistrar registrar) {
+    {
+      registrar.registerMetaData(
+          new AndFilter(
+              new NamespaceFilter(XmlUtil.SCHEMA_URIS),
+              new ClassFilter(XmlDocument.class)
+          ),
+          SchemaNSDescriptor.class
+      );
+
+      registrar.registerMetaData(
+          new AndFilter(XmlTagFilter.INSTANCE, new NamespaceFilter(XmlUtil.SCHEMA_URIS), new XmlTextFilter("schema")),
+          SchemaNSDescriptor.class
+      );
+    }
+    {
+      registrar.registerMetaData(
+          new OrFilter(
+              new AndFilter(
+                  new ContentFilter(
+                    new OrFilter(
+                      new ClassFilter(XmlElementDecl.class),
+                      new ClassFilter(XmlEntityDecl.class),
+                      new ClassFilter(XmlConditionalSection.class),
+                      new ClassFilter(XmlEntityRef.class)
+                    )
+                  ),
+                  new ClassFilter(XmlDocument.class)
+              ),
+              new ClassFilter(XmlMarkupDecl.class)
+          ),
+          XmlNSDescriptorImpl.class
+      );
+    }
+
+    {
+      registrar.registerMetaData(new AndFilter(XmlTagFilter.INSTANCE, new NamespaceFilter(XmlUtil.SCHEMA_URIS), new XmlTextFilter("element")),
+                         XmlElementDescriptorImpl.class);
+    }
+
+    {
+      registrar.registerMetaData(
+          new AndFilter(XmlTagFilter.INSTANCE, new NamespaceFilter(XmlUtil.SCHEMA_URIS), new XmlTextFilter("attribute")),
+          XmlAttributeDescriptorImpl.class
+      );
+    }
+
+    {
+      registrar.registerMetaData(
+          new ClassFilter(XmlElementDecl.class),
+          com.intellij.xml.impl.dtd.XmlElementDescriptorImpl.class
+      );
+    }
+
+    {
+      registrar.registerMetaData(
+          new ClassFilter(XmlAttributeDecl.class),
+          com.intellij.xml.impl.dtd.XmlAttributeDescriptorImpl.class
+      );
+    }
+
+    {
+      registrar.registerMetaData(
+          new AndFilter(
+              new ClassFilter(XmlDocument.class),
+              new TargetNamespaceFilter(XmlUtil.XHTML_URI),
+              new NamespaceFilter(XmlUtil.SCHEMA_URIS)),
+          RelaxedHtmlFromSchemaNSDescriptor.class
+      );
+    }
+
+    {
+      registrar.registerMetaData(new AndFilter(XmlTagFilter.INSTANCE, new NamespaceFilter(XmlUtil.SCHEMA_URIS), new XmlTextFilter("complexType",
+                                                                                                                                  "simpleType", "group",
+                                                                                                                                  "attributeGroup")),
+                         NamedObjectDescriptor.class);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XmlDeclareIdInCommentAction.java b/xml/impl/src/com/intellij/xml/util/XmlDeclareIdInCommentAction.java
new file mode 100644
index 0000000..4f7bec5
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XmlDeclareIdInCommentAction.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.lang.Commenter;
+import com.intellij.lang.Language;
+import com.intellij.lang.LanguageCommenters;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.*;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author spleaner
+ */
+public class XmlDeclareIdInCommentAction implements LocalQuickFix {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.util.XmlDeclareIdInCommentAction");
+
+  private final String myId;
+
+  public XmlDeclareIdInCommentAction(@NotNull final String id) {
+    myId = id;
+  }
+
+  @NotNull
+  public String getName() {
+    return XmlErrorMessages.message("declare.id.in.comment.quickfix");
+  }
+
+  @NotNull
+  public String getFamilyName() {
+    return getName();
+  }
+
+  @Nullable
+  public static String getImplicitlyDeclaredId(@NotNull final PsiComment comment) {
+    final String text = getUncommentedText(comment);
+    if (text == null) return null;
+
+    if (text.startsWith("@declare id=\"")) {
+      final String result = text.substring("@declare id=\"".length() - 1);
+      return StringUtil.unquoteString(result);
+    }
+
+    return null;
+  }
+
+  @Nullable
+  private static String getUncommentedText(@NotNull final PsiComment comment) {
+    final PsiFile psiFile = comment.getContainingFile();
+    final Language language = psiFile.getViewProvider().getBaseLanguage();
+    final Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(language);
+    if (commenter != null) {
+      String text = comment.getText();
+
+      final String prefix = commenter.getBlockCommentPrefix();
+      if (prefix != null && text.startsWith(prefix)) {
+        text = text.substring(prefix.length());
+        final String suffix = commenter.getBlockCommentSuffix();
+        if (suffix != null && text.length() > suffix.length()) {
+          return text.substring(0, text.length() - suffix.length()).trim();
+        }
+      }
+    }
+
+    return null;
+  }
+
+  public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
+    final PsiElement psiElement = descriptor.getPsiElement();
+    final PsiFile psiFile = psiElement.getContainingFile();
+
+    new WriteCommandAction(project, psiFile) {
+      protected void run(final Result result) throws Throwable {
+        final XmlTag tag = PsiTreeUtil.getParentOfType(psiElement, XmlTag.class);
+        if (tag == null) return;
+
+        final Language language = psiFile.getViewProvider().getBaseLanguage();
+        final Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(language);
+        if (commenter == null) return;
+
+        final PsiFile tempFile = PsiFileFactory.getInstance(project).createFileFromText("dummy", language.getAssociatedFileType(),
+            commenter.getBlockCommentPrefix() +
+                "@declare id=\"" +
+                myId +
+                "\"" +
+                commenter.getBlockCommentSuffix() +
+                "\n");
+
+        final XmlTag parent = tag.getParentTag();
+        if (parent != null && parent.isValid()) {
+          final XmlTag[] tags = parent.getSubTags();
+          if (tags.length > 0) {
+            final PsiFile psi = tempFile.getViewProvider().getPsi(language);
+            if (psi != null) {
+              final PsiElement element = psi.findElementAt(1);
+              if (element instanceof PsiComment) {
+                parent.getNode().addChild(element.getNode(), tags[0].getNode());
+              }
+            }
+          }
+        }
+      }
+    }.execute();
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XmlDuplicatedIdInspection.java b/xml/impl/src/com/intellij/xml/util/XmlDuplicatedIdInspection.java
new file mode 100644
index 0000000..e0a1854
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XmlDuplicatedIdInspection.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInsight.daemon.XmlErrorMessages;
+import com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor;
+import com.intellij.codeInspection.LocalInspectionTool;
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.psi.*;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlBundle;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlDuplicatedIdInspection extends LocalInspectionTool {
+
+  @NotNull
+  @Override
+  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
+    return new XmlElementVisitor() {
+      @Override
+      public void visitXmlAttributeValue(final XmlAttributeValue value) {
+        if (value.getTextRange().isEmpty()) {
+          return;
+        }
+        final PsiFile file = value.getContainingFile();
+        if (!(file instanceof XmlFile)) {
+          return;
+        }
+        final XmlRefCountHolder refHolder = XmlRefCountHolder.getRefCountHolder(value);
+        if (refHolder == null) return;
+
+        final PsiElement parent = value.getParent();
+        if (!(parent instanceof XmlAttribute)) return;
+
+        final XmlTag tag = (XmlTag)parent.getParent();
+        if (tag == null) return;
+
+        if (refHolder.isValidatable(tag.getParent()) && refHolder.isDuplicateIdAttributeValue(value)) {
+          holder.registerProblem(value, XmlErrorMessages.message("duplicate.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL);
+        }
+
+        String idRef = XmlHighlightVisitor.getUnquotedValue(value, tag);
+
+        if (tag instanceof HtmlTag) {
+          idRef = idRef.toLowerCase();
+        }
+
+        if (XmlUtil.isSimpleXmlAttributeValue(idRef, value) && refHolder.isIdReferenceValue(value)) {
+          boolean hasIdDeclaration = refHolder.hasIdDeclaration(idRef);
+          if (!hasIdDeclaration && tag instanceof HtmlTag) {
+            hasIdDeclaration = refHolder.hasIdDeclaration(value.getValue());
+          }
+
+          if (!hasIdDeclaration) {
+            for(XmlIdContributor contributor: Extensions.getExtensions(XmlIdContributor.EP_NAME)) {
+              if (contributor.suppressExistingIdValidation((XmlFile)file)) {
+                return;
+              }
+            }
+
+            final FileViewProvider viewProvider = tag.getContainingFile().getViewProvider();
+            if (viewProvider instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
+              holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL,
+                                     new XmlDeclareIdInCommentAction(idRef));
+
+            }
+            else {
+              holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL);
+            }
+          }
+        }
+      }
+    };
+  }
+
+  public boolean runForWholeFile() {
+    return false;
+  }
+
+  @NotNull
+  public HighlightDisplayLevel getDefaultLevel() {
+    return HighlightDisplayLevel.ERROR;
+  }
+
+  public boolean isEnabledByDefault() {
+    return true;
+  }
+
+  @NotNull
+  public String getGroupDisplayName() {
+    return XmlBundle.message("xml.inspections.group.name");
+  }
+
+  @NotNull
+  public String getDisplayName() {
+    return XmlBundle.message("xml.inspections.duplicate.id");
+  }
+
+  @NotNull
+  @NonNls
+  public String getShortName() {
+    return "XmlDuplicatedId";
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XmlIconProvider.java b/xml/impl/src/com/intellij/xml/util/XmlIconProvider.java
new file mode 100644
index 0000000..e12801d
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XmlIconProvider.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.ide.IconProvider;
+import com.intellij.openapi.project.DumbAware;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.impl.ElementBase;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+
+/**
+ * @author peter
+ */
+public class XmlIconProvider extends IconProvider implements DumbAware {
+  @NonNls private static final String XSD_FILE_EXTENSION = "xsd";
+  @NonNls private static final String WSDL_FILE_EXTENSION = "wsdl";
+
+  @Nullable
+  public Icon getIcon(@NotNull final PsiElement element, final int _flags) {
+    if (element instanceof XmlFile) {
+      final VirtualFile vf = ((XmlFile)element).getVirtualFile();
+      if (vf != null) {
+        final String extension = vf.getExtension();
+        
+        if (XSD_FILE_EXTENSION.equals(extension)) {
+          return ElementBase.createLayeredIcon(element, AllIcons.FileTypes.XsdFile, ElementBase.transformFlags(element, _flags));
+        }
+        if (WSDL_FILE_EXTENSION.equals(extension)) {
+          return ElementBase.createLayeredIcon(element, AllIcons.FileTypes.WsdlFile, ElementBase.transformFlags(element, _flags));
+        }
+      }
+    }
+    return null;
+  }
+
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XmlIdContributor.java b/xml/impl/src/com/intellij/xml/util/XmlIdContributor.java
new file mode 100644
index 0000000..d4ff3dc
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XmlIdContributor.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.psi.xml.XmlFile;
+
+/**
+ * @author yole
+ */
+public interface XmlIdContributor {
+  ExtensionPointName<XmlIdContributor> EP_NAME = ExtensionPointName.create("com.intellij.xml.idContributor");
+
+  boolean suppressExistingIdValidation(XmlFile file);
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XmlIncludeHandler.java b/xml/impl/src/com/intellij/xml/util/XmlIncludeHandler.java
new file mode 100644
index 0000000..6827379
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XmlIncludeHandler.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceSet;
+import com.intellij.psi.xml.*;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author mike
+ */
+public class XmlIncludeHandler {
+  @NonNls private static final String INCLUDE_TAG_NAME = "include";
+  public static boolean isXInclude(PsiElement element) {
+    if (element instanceof XmlTag) {
+      XmlTag xmlTag = (XmlTag)element;
+
+      if (xmlTag.getParent() instanceof XmlDocument) return false;
+
+      if (xmlTag.getLocalName().equals(INCLUDE_TAG_NAME) && xmlTag.getAttributeValue("href") != null) {
+        if (xmlTag.getNamespace().equals(XmlUtil.XINCLUDE_URI)) {
+          return true;
+        }
+      }
+    }
+
+    return false;
+  }
+
+  @Nullable
+  public static XmlFile resolveXIncludeFile(XmlTag xincludeTag) {
+    final XmlAttribute hrefAttribute = xincludeTag.getAttribute("href", null);
+    if (hrefAttribute == null) return null;
+
+    final XmlAttributeValue xmlAttributeValue = hrefAttribute.getValueElement();
+    if (xmlAttributeValue == null) return null;
+
+    final FileReferenceSet referenceSet = FileReferenceSet.createSet(xmlAttributeValue, false, true, false);
+
+    final PsiReference reference = referenceSet.getLastReference();
+    if (reference == null) return null;
+
+    final PsiElement target = reference.resolve();
+
+    if (!(target instanceof XmlFile)) return null;
+    return (XmlFile)target;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XmlNSDescriptorSequence.java b/xml/impl/src/com/intellij/xml/util/XmlNSDescriptorSequence.java
new file mode 100644
index 0000000..06ab056
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XmlNSDescriptorSequence.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 08.09.2003
+ * Time: 17:27:43
+ * To change this template use Options | File Templates.
+ */
+public class XmlNSDescriptorSequence implements XmlNSDescriptor{
+  final List<XmlNSDescriptor> sequence = new ArrayList<XmlNSDescriptor>();
+
+  public XmlNSDescriptorSequence(){
+  }
+
+  public XmlNSDescriptorSequence(XmlNSDescriptor[] descriptors){
+    for(int i = 0; i < descriptors.length; i++){
+      final XmlNSDescriptor descriptor = descriptors[i];
+      add(descriptor);
+    }
+  }
+
+  public void add(XmlNSDescriptor descriptor){
+    sequence.add(descriptor);
+  }
+
+  public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag){
+    final Iterator iterator = sequence.iterator();
+    while(iterator.hasNext()){
+      final XmlNSDescriptor descriptor = (XmlNSDescriptor) iterator.next();
+      final XmlElementDescriptor elementDescriptor = descriptor.getElementDescriptor(tag);
+      if(elementDescriptor != null) return elementDescriptor;
+    }
+    return null;
+  }
+
+  @NotNull
+  public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable final XmlDocument document) {
+    final List<XmlElementDescriptor> descriptors = new ArrayList<XmlElementDescriptor>();
+    final Iterator iterator = sequence.iterator();
+    while(iterator.hasNext()) {
+      final XmlNSDescriptor descriptor = (XmlNSDescriptor)iterator.next();
+      ContainerUtil.addAll(descriptors, descriptor.getRootElementsDescriptors(document));
+    }
+
+    return descriptors.toArray(new XmlElementDescriptor[descriptors.size()]);
+  }
+
+  public XmlFile getDescriptorFile(){
+    final Iterator iterator = sequence.iterator();
+    while(iterator.hasNext()){
+      final XmlNSDescriptor descriptor = (XmlNSDescriptor) iterator.next();
+      final XmlFile file = descriptor.getDescriptorFile();
+      if(file != null) return file;
+    }
+    return null;
+  }
+
+  public List<XmlNSDescriptor> getSequence(){
+    return sequence;
+  }
+
+  public boolean isHierarhyEnabled() {
+    final Iterator iterator = sequence.iterator();
+    while(iterator.hasNext()){
+      final XmlNSDescriptor descriptor = (XmlNSDescriptor) iterator.next();
+      if(descriptor.isHierarhyEnabled()) return true;
+    }
+    return false;
+  }
+
+  public PsiElement getDeclaration(){
+    final Iterator iterator = sequence.iterator();
+    while(iterator.hasNext()){
+      final XmlNSDescriptor descriptor = (XmlNSDescriptor) iterator.next();
+      final PsiElement declaration = descriptor.getDeclaration();
+      if(declaration != null) return declaration;
+    }
+    return null;
+  }
+
+  public String getName(PsiElement context){
+    final Iterator iterator = sequence.iterator();
+    while(iterator.hasNext()){
+      final XmlNSDescriptor descriptor = (XmlNSDescriptor) iterator.next();
+      final String name = descriptor.getName(context);
+      if(name != null) return name;
+    }
+    return null;
+  }
+
+  public String getName(){
+    final Iterator iterator = sequence.iterator();
+    while(iterator.hasNext()){
+      final XmlNSDescriptor descriptor = (XmlNSDescriptor) iterator.next();
+      final String name = descriptor.getName();
+      if(name != null) return name;
+    }
+    return null;
+  }
+
+  public void init(PsiElement element){
+    final Iterator iterator = sequence.iterator();
+    while(iterator.hasNext()){
+      final XmlNSDescriptor descriptor = (XmlNSDescriptor) iterator.next();
+      descriptor.init(element);
+    }
+  }
+
+  public Object[] getDependences(){
+    final List<Object> ret = new ArrayList<Object>();
+    final Iterator iterator = sequence.iterator();
+    while(iterator.hasNext()) {
+      final XmlNSDescriptor descriptor = (XmlNSDescriptor)iterator.next();
+      ContainerUtil.addAll(ret, descriptor.getDependences());
+    }
+    return ret.toArray();
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XmlPrefixReferenceProvider.java b/xml/impl/src/com/intellij/xml/util/XmlPrefixReferenceProvider.java
new file mode 100644
index 0000000..f1b8294
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XmlPrefixReferenceProvider.java
@@ -0,0 +1,50 @@
+package com.intellij.xml.util;
+
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiReferenceProvider;
+import com.intellij.psi.impl.source.xml.SchemaPrefixReference;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ProcessingContext;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.impl.schema.XmlAttributeDescriptorImpl;
+import com.intellij.xml.impl.schema.XmlNSDescriptorImpl;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlPrefixReferenceProvider extends PsiReferenceProvider {
+
+  @NotNull
+  @Override
+  public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
+    XmlAttributeValue attributeValue = (XmlAttributeValue)element;
+    PsiElement parent = attributeValue.getParent();
+    if (parent instanceof XmlAttribute && !XmlNSDescriptorImpl.checkSchemaNamespace(((XmlAttribute)parent).getParent())) {
+      XmlAttributeDescriptor descriptor = ((XmlAttribute)parent).getDescriptor();
+      if (descriptor instanceof XmlAttributeDescriptorImpl) {
+        String type = ((XmlAttributeDescriptorImpl)descriptor).getType();
+        if (type != null && type.endsWith(":QName")) {
+          String prefix = XmlUtil.findPrefixByQualifiedName(type);
+          String ns = ((XmlTag)descriptor.getDeclaration()).getNamespaceByPrefix(prefix);
+          if (XmlNSDescriptorImpl.checkSchemaNamespace(ns)) {
+            String value = attributeValue.getValue();
+            if (value != null) {
+              int i = value.indexOf(':');
+              if (i > 0) {
+                return new PsiReference[] {
+                  new SchemaPrefixReference(attributeValue, TextRange.from(1, i), value.substring(0, i), null)
+                };
+              }
+            }
+          }
+        }
+      }
+    }
+    return PsiReference.EMPTY_ARRAY;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XmlRefCountHolder.java b/xml/impl/src/com/intellij/xml/util/XmlRefCountHolder.java
new file mode 100644
index 0000000..0a43ad1
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XmlRefCountHolder.java
@@ -0,0 +1,283 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor;
+import com.intellij.lang.Language;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.UserDataCache;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.IdReferenceProvider;
+import com.intellij.psi.impl.source.xml.PossiblePrefixReference;
+import com.intellij.psi.impl.source.xml.SchemaPrefix;
+import com.intellij.psi.impl.source.xml.SchemaPrefixReference;
+import com.intellij.psi.templateLanguages.OuterLanguageElement;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.NullableFunction;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+/**
+ * @author spleaner
+ */
+public class XmlRefCountHolder {
+  private static final Key<CachedValue<XmlRefCountHolder>> xmlRefCountHolderKey = Key.create("xml ref count holder");
+
+  private final static UserDataCache<CachedValue<XmlRefCountHolder>, XmlFile, Object> CACHE =
+    new UserDataCache<CachedValue<XmlRefCountHolder>, XmlFile, Object>() {
+      protected CachedValue<XmlRefCountHolder> compute(final XmlFile file, final Object p) {
+        return CachedValuesManager.getManager(file.getProject()).createCachedValue(new CachedValueProvider<XmlRefCountHolder>() {
+          public Result<XmlRefCountHolder> compute() {
+            final XmlRefCountHolder holder = new XmlRefCountHolder();
+            final Language language = file.getViewProvider().getBaseLanguage();
+            final PsiFile psiFile = file.getViewProvider().getPsi(language);
+            assert psiFile != null;
+            psiFile.accept(new IdGatheringRecursiveVisitor(holder));
+            return new Result<XmlRefCountHolder>(holder, file);
+          }
+        }, false);
+      }
+    };
+
+  private final Map<String, List<Pair<XmlAttributeValue, Boolean>>> myId2AttributeListMap = new HashMap<String, List<Pair<XmlAttributeValue, Boolean>>>();
+  private final Set<XmlAttributeValue> myPossiblyDuplicateIds = new HashSet<XmlAttributeValue>();
+  private final List<XmlAttributeValue> myIdReferences = new ArrayList<XmlAttributeValue>();
+  private final Set<String> myAdditionallyDeclaredIds = new HashSet<String>();
+  private final Set<PsiElement> myDoNotValidateParentsList = new HashSet<PsiElement>();
+  private final Set<String> myUsedPrefixes = new HashSet<String>();
+  private final Set<String> myUsedNamespaces = new HashSet<String>();
+
+  @Nullable
+  public static XmlRefCountHolder getRefCountHolder(final XmlElement element) {
+    PsiFile file = element.getContainingFile();
+    return file instanceof XmlFile ? CACHE.get(xmlRefCountHolderKey, (XmlFile)file, null).getValue() : null;
+  }
+
+  private XmlRefCountHolder() {
+  }
+
+
+  public boolean isDuplicateIdAttributeValue(@NotNull final XmlAttributeValue value) {
+    return myPossiblyDuplicateIds.contains(value);
+  }
+
+  public boolean isValidatable(@Nullable final PsiElement element) {
+    return !myDoNotValidateParentsList.contains(element);
+  }
+
+  public boolean hasIdDeclaration(@NotNull final String idRef) {
+    return myId2AttributeListMap.get(idRef) != null || myAdditionallyDeclaredIds.contains(idRef);
+  }
+
+  public boolean isIdReferenceValue(@NotNull final XmlAttributeValue value) {
+    return myIdReferences.contains(value);
+  }
+
+  private void registerId(@NotNull final String id, @NotNull final XmlAttributeValue attributeValue, final boolean soft) {
+    List<Pair<XmlAttributeValue, Boolean>> list = myId2AttributeListMap.get(id);
+    if (list == null) {
+      list = new ArrayList<Pair<XmlAttributeValue, Boolean>>();
+      myId2AttributeListMap.put(id, list);
+    }
+    else if (!soft) {
+      // mark as duplicate
+      List<XmlAttributeValue> notSoft = ContainerUtil.mapNotNull(list, new NullableFunction<Pair<XmlAttributeValue, Boolean>, XmlAttributeValue>() {
+        @Override
+        public XmlAttributeValue fun(Pair<XmlAttributeValue, Boolean> pair) {
+          return pair.second ? null : pair.first;
+        }
+      });
+      if (!notSoft.isEmpty()) {
+        myPossiblyDuplicateIds.addAll(notSoft);
+        myPossiblyDuplicateIds.add(attributeValue);
+      }
+    }
+
+    list.add(new Pair<XmlAttributeValue, Boolean>(attributeValue, soft));
+  }
+
+  private void registerAdditionalId(@NotNull final String id) {
+    myAdditionallyDeclaredIds.add(id);
+  }
+
+  private void registerIdReference(@NotNull final XmlAttributeValue value) {
+    myIdReferences.add(value);
+  }
+
+  private void registerOuterLanguageElement(@NotNull final PsiElement element) {
+    PsiElement parent = element.getParent();
+
+    if (parent instanceof XmlText) {
+      parent = parent.getParent();
+    }
+
+    myDoNotValidateParentsList.add(parent);
+  }
+
+  public boolean isInUse(String prefix) {
+    return myUsedPrefixes.contains(prefix);
+  }
+
+  public boolean isUsedNamespace(String ns) {
+    return myUsedNamespaces.contains(ns);
+  }
+
+  private static class IdGatheringRecursiveVisitor extends XmlRecursiveElementVisitor {
+    private final XmlRefCountHolder myHolder;
+
+    private IdGatheringRecursiveVisitor(@NotNull XmlRefCountHolder holder) {
+      super(true);
+      myHolder = holder;
+    }
+
+    @Override
+    public void visitElement(final PsiElement element) {
+      if (element instanceof OuterLanguageElement) {
+        visitOuterLanguageElement(element);
+      }
+
+      super.visitElement(element);
+    }
+
+    private void visitOuterLanguageElement(@NotNull final PsiElement element) {
+      myHolder.registerOuterLanguageElement(element);
+      PsiReference[] references = element.getReferences();
+      for (PsiReference reference : references) {
+        if (reference instanceof PossiblePrefixReference && ((PossiblePrefixReference)reference).isPrefixReference()) {
+          PsiElement resolve = reference.resolve();
+          if (resolve instanceof SchemaPrefix) {
+            myHolder.addUsedPrefix(((SchemaPrefix)resolve).getName());
+          }
+        }
+      }
+    }
+
+    @Override
+    public void visitComment(final PsiComment comment) {
+      doVisitAnyComment(comment);
+      super.visitComment(comment);
+    }
+
+    @Override
+    public void visitXmlComment(final XmlComment comment) {
+      doVisitAnyComment(comment);
+      super.visitXmlComment(comment);
+    }
+
+    private void doVisitAnyComment(final PsiComment comment) {
+      final String id = XmlDeclareIdInCommentAction.getImplicitlyDeclaredId(comment);
+      if (id != null) {
+        myHolder.registerAdditionalId(id);
+      }
+    }
+
+    @Override
+    public void visitXmlTag(XmlTag tag) {
+      myHolder.addUsedPrefix(tag.getNamespacePrefix());
+      myHolder.addUsedNamespace(tag.getNamespace());
+      String text = tag.getValue().getTrimmedText();
+      detectPrefix(text);
+      super.visitXmlTag(tag);
+    }
+
+    @Override
+    public void visitXmlAttribute(XmlAttribute attribute) {
+      if (!attribute.isNamespaceDeclaration()) {
+        myHolder.addUsedPrefix(attribute.getNamespacePrefix());
+      }
+      myHolder.addUsedNamespace(attribute.getNamespace());
+      super.visitXmlAttribute(attribute);
+    }
+
+    @Override
+    public void visitXmlAttributeValue(final XmlAttributeValue value) {
+      final PsiElement element = value.getParent();
+      if (!(element instanceof XmlAttribute)) return;
+
+      final XmlAttribute attribute = (XmlAttribute)element;
+
+      final XmlTag tag = attribute.getParent();
+      if (tag == null) return;
+
+      final XmlElementDescriptor descriptor = tag.getDescriptor();
+      if (descriptor == null) return;
+
+      final XmlAttributeDescriptor attributeDescriptor = descriptor.getAttributeDescriptor(attribute);
+      if (attributeDescriptor == null) return;
+
+      if (attributeDescriptor.hasIdType()) {
+        updateMap(attribute, value, false);
+      }
+      else {
+        final PsiReference[] references = value.getReferences();
+        for (PsiReference r : references) {
+          if (r instanceof IdReferenceProvider.GlobalAttributeValueSelfReference /*&& !r.isSoft()*/) {
+            updateMap(attribute, value, r.isSoft());
+          }
+          else if (r instanceof SchemaPrefixReference) {
+            SchemaPrefix prefix = ((SchemaPrefixReference)r).resolve();
+            if (prefix != null) {
+              myHolder.addUsedPrefix(prefix.getName());
+            }
+          }
+        }
+      }
+
+      if (attributeDescriptor.hasIdRefType() && PsiTreeUtil.getChildOfType(value, OuterLanguageElement.class) == null) {
+        myHolder.registerIdReference(value);
+      }
+
+      String s = value.getValue();
+      detectPrefix(s);
+      super.visitXmlAttributeValue(value);
+    }
+
+    private void detectPrefix(String s) {
+      if (s != null) {
+        int pos = s.indexOf(':');
+        if (pos > 0) {
+          myHolder.addUsedPrefix(s.substring(0, pos));
+        }
+      }
+    }
+
+    private void updateMap(@NotNull final XmlAttribute attribute, @NotNull final XmlAttributeValue value, final boolean soft) {
+      final String id = XmlHighlightVisitor.getUnquotedValue(value, attribute.getParent());
+      if (XmlUtil.isSimpleXmlAttributeValue(id, value) &&
+          PsiTreeUtil.getChildOfType(value, OuterLanguageElement.class) == null) {
+        myHolder.registerId(id, value, soft);
+      }
+    }
+  }
+
+  private void addUsedPrefix(String prefix) {
+    myUsedPrefixes.add(prefix);
+  }
+
+  private void addUsedNamespace(String ns) {
+    myUsedNamespaces.add(ns);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XmlReferenceContributor.java b/xml/impl/src/com/intellij/xml/util/XmlReferenceContributor.java
new file mode 100644
index 0000000..872d174
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XmlReferenceContributor.java
@@ -0,0 +1,86 @@
+package com.intellij.xml.util;
+
+import com.intellij.codeInsight.daemon.impl.analysis.encoding.XmlEncodingReferenceProvider;
+import com.intellij.patterns.PlatformPatterns;
+import com.intellij.patterns.XmlPatterns;
+import com.intellij.psi.PsiReferenceContributor;
+import com.intellij.psi.PsiReferenceRegistrar;
+import com.intellij.psi.filters.*;
+import com.intellij.psi.filters.position.NamespaceFilter;
+import com.intellij.psi.filters.position.ParentElementFilter;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.DtdReferencesProvider;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.IdReferenceProvider;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.SchemaReferencesProvider;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.URIReferenceProvider;
+import com.intellij.psi.xml.*;
+
+import static com.intellij.patterns.StandardPatterns.string;
+import static com.intellij.patterns.XmlPatterns.*;
+
+/**
+ * @author peter
+ */
+public class XmlReferenceContributor extends PsiReferenceContributor {
+  public void registerReferenceProviders(final PsiReferenceRegistrar registrar) {
+
+    final IdReferenceProvider idReferenceProvider = new IdReferenceProvider();
+
+    XmlUtil.registerXmlAttributeValueReferenceProvider(registrar, idReferenceProvider.getIdForAttributeNames(),
+                                                       idReferenceProvider.getIdForFilter(), true, idReferenceProvider,
+                                                       PsiReferenceRegistrar.DEFAULT_PRIORITY);
+
+    final DtdReferencesProvider dtdReferencesProvider = new DtdReferencesProvider();
+    //registerReferenceProvider(null, XmlEntityDecl.class,dtdReferencesProvider);
+    registrar.registerReferenceProvider(PlatformPatterns.psiElement(XmlEntityRef.class), dtdReferencesProvider);
+    registrar.registerReferenceProvider(PlatformPatterns.psiElement(XmlDoctype.class), dtdReferencesProvider);
+    registrar.registerReferenceProvider(PlatformPatterns.psiElement(XmlElementDecl.class), dtdReferencesProvider);
+    registrar.registerReferenceProvider(PlatformPatterns.psiElement(XmlAttlistDecl.class), dtdReferencesProvider);
+    registrar.registerReferenceProvider(PlatformPatterns.psiElement(XmlElementContentSpec.class), dtdReferencesProvider);
+    registrar.registerReferenceProvider(PlatformPatterns.psiElement(XmlToken.class), dtdReferencesProvider);
+
+    URIReferenceProvider uriProvider = new URIReferenceProvider();
+    XmlUtil.registerXmlAttributeValueReferenceProvider(registrar, null, dtdReferencesProvider.getSystemReferenceFilter(), uriProvider);
+
+
+    XmlUtil.registerXmlAttributeValueReferenceProvider(registrar, new String[] { "href" }, new ScopeFilter(
+      new ParentElementFilter(
+        new AndFilter(
+          new AndFilter(XmlTagFilter.INSTANCE, new XmlTextFilter("include")),
+          new NamespaceFilter(XmlUtil.XINCLUDE_URI)
+        ),
+        2
+      )
+    ), true, uriProvider);
+
+    final SchemaReferencesProvider schemaReferencesProvider = new SchemaReferencesProvider();
+
+    XmlUtil.registerXmlAttributeValueReferenceProvider(registrar,
+      schemaReferencesProvider.getCandidateAttributeNamesForSchemaReferences(),
+      new ScopeFilter(
+        new ParentElementFilter(
+          new NamespaceFilter(XmlUtil.SCHEMA_URIS), 2
+        )
+      ),
+      schemaReferencesProvider
+    );
+
+    registrar.registerReferenceProvider(xmlAttributeValue(xmlAttribute().withNamespace(XmlUtil.XML_SCHEMA_INSTANCE_URI)).
+      withLocalName("type"), schemaReferencesProvider);
+
+    registrar.registerReferenceProvider(xmlAttributeValue(xmlAttribute().withNamespace(XmlUtil.XML_SCHEMA_INSTANCE_URI)).
+      withLocalName("noNamespaceSchemaLocation", "schemaLocation"), uriProvider);
+
+    registrar.registerReferenceProvider(
+      xmlAttributeValue().withLocalName("schemaLocation","namespace").
+        withSuperParent(2,
+                        xmlTag().withNamespace(XmlUtil.SCHEMA_URIS).withLocalName(string().oneOf("import", "include","redefine"))),
+      uriProvider);
+
+    XmlUtil.registerXmlAttributeValueReferenceProvider(registrar, null, URIReferenceProvider.ELEMENT_FILTER, true, uriProvider);
+
+    XmlUtil.registerXmlAttributeValueReferenceProvider(registrar, new String[] {"encoding"}, new ScopeFilter(new ParentElementFilter(new ClassFilter(XmlProcessingInstruction.class))), true,
+                                                       new XmlEncodingReferenceProvider());
+
+    registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue(), new XmlPrefixReferenceProvider());
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XmlResourceResolver.java b/xml/impl/src/com/intellij/xml/util/XmlResourceResolver.java
new file mode 100644
index 0000000..018aee2
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XmlResourceResolver.java
@@ -0,0 +1,273 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.javaee.ExternalResourceManagerEx;
+import com.intellij.javaee.UriUtil;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.VirtualFileManager;
+import com.intellij.openapi.vfs.ex.http.HttpFileSystem;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.URIReferenceProvider;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.actions.ValidateXmlActionHandler;
+import com.intellij.xml.index.XmlNamespaceIndex;
+import org.apache.xerces.xni.XMLResourceIdentifier;
+import org.apache.xerces.xni.XNIException;
+import org.apache.xerces.xni.parser.XMLEntityResolver;
+import org.apache.xerces.xni.parser.XMLInputSource;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+import org.xml.sax.SAXParseException;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.StringReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public class XmlResourceResolver implements XMLEntityResolver {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.util.XmlResourceResolver");
+  private final XmlFile myFile;
+  private final Project myProject;
+  private final Map<String,String> myExternalResourcesMap = new HashMap<String, String>(1);
+  private boolean myStopOnUnDeclaredResource;
+  @NonNls
+  public static final String HONOUR_ALL_SCHEMA_LOCATIONS_PROPERTY_KEY = "idea.xml.honour.all.schema.locations";
+  private final ValidateXmlActionHandler.ErrorReporter myErrorReporter;
+
+  public XmlResourceResolver(XmlFile _xmlFile, Project _project, final ValidateXmlActionHandler.ErrorReporter errorReporter) {
+    myFile = _xmlFile;
+    myProject = _project;
+    myErrorReporter = errorReporter;
+  }
+
+  public String getPathByPublicId(String baseId) {
+    return myExternalResourcesMap.get(baseId);
+  }
+
+  public String[] getResourcePaths() {
+    return myExternalResourcesMap.values().toArray(new String[myExternalResourcesMap.size()]);
+  }
+
+  @Nullable
+  public PsiFile resolve(@Nullable final String baseSystemId, final String _systemId) {
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("enter: resolveEntity(baseSystemId='" + baseSystemId + "' systemId='" + _systemId + "," + super.toString() + "')");
+    }
+
+    if (_systemId == null) return null;
+    if (myStopOnUnDeclaredResource &&
+        ExternalResourceManagerEx.getInstanceEx().isIgnoredResource(_systemId)) {
+      throw new IgnoredResourceException();
+    }
+
+    final int length = URIReferenceProvider.getPrefixLength(_systemId);
+    final String systemId = _systemId.substring(length);
+
+    final PsiFile[] result = new PsiFile[] { null };
+    final Runnable action = new Runnable() {
+      public void run() {
+        PsiFile baseFile = null;
+        VirtualFile vFile = null;
+
+        if (baseSystemId != null) {
+          baseFile = resolve(null,baseSystemId);
+
+          if (baseFile == null) {
+              // Find relative to myFile
+            File workingFile = new File("");
+            String workingDir = workingFile.getAbsoluteFile().getAbsolutePath().replace(File.separatorChar, '/');
+            String id = StringUtil.replace(baseSystemId, workingDir, myFile.getVirtualFile().getParent().getPath());
+            vFile = UriUtil.findRelative(id, myFile);
+
+            if (vFile == null) {
+              vFile = UriUtil.findRelative(baseSystemId, myFile);
+
+              if (vFile == null) {
+                try {
+                  vFile = VfsUtil.findFileByURL(new URL(baseSystemId));
+                } catch(MalformedURLException ignore) {}
+              }
+            }
+          }
+
+          if (vFile != null && !vFile.isDirectory() && !(vFile.getFileSystem() instanceof HttpFileSystem)) {
+            baseFile = PsiManager.getInstance(myProject).findFile(vFile);
+          }
+        }
+        if (baseFile == null) {
+          baseFile = myFile;
+        }
+
+        String version = null;
+        String tagName = null;
+        if (baseFile == myFile) {
+          XmlTag rootTag = myFile.getRootTag();
+          if (rootTag != null) {
+            tagName = rootTag.getLocalName();
+            version = rootTag.getAttributeValue("version");
+          }
+        }
+        
+        PsiFile psiFile = ExternalResourceManager.getInstance().getResourceLocation(systemId, baseFile, version);
+        if (psiFile == null) {
+          psiFile = XmlUtil.findXmlFile(baseFile, systemId);
+        }
+        // autodetection
+        if (psiFile == null) {
+          psiFile = XmlNamespaceIndex.guessSchema(systemId, tagName, version, myFile);
+          if (psiFile == null) {
+            psiFile = XmlNamespaceIndex.guessDtd(systemId, myFile);
+          }
+        }
+
+        if (psiFile == null && baseSystemId != null) {
+          String fullUrl = baseSystemId.substring( 0, baseSystemId.lastIndexOf('/') + 1 ) + systemId;
+          psiFile = XmlUtil.findXmlFile(baseFile,fullUrl);
+        }
+
+        if (LOG.isDebugEnabled()) {
+          LOG.debug("before relative file checking:"+psiFile+","+systemId+","+ baseSystemId+")");
+        }
+        if (psiFile == null && baseSystemId == null) { // entity file
+          File workingFile = new File("");
+          String workingDir = workingFile.getAbsoluteFile().getAbsolutePath().replace(File.separatorChar, '/') + "/";
+
+          String relativePath = StringUtil.replace(
+            systemId,
+            workingDir,
+            ""
+          );
+
+          if (relativePath.equals(systemId)) {
+            // on Windows systemId consisting of idea install path could become encoded DOS short name (e.g. idea%7f1.504)
+            // I am not aware how to get such name from 'workingDir' so let just pickup filename from there
+            relativePath = systemId.substring(systemId.lastIndexOf('/') + 1);
+          }
+
+          if (LOG.isDebugEnabled()) {
+            LOG.debug("next to relative file checking:"+relativePath+","+myExternalResourcesMap.size()+")");
+          }
+
+          for(String path:getResourcePaths()) {
+            if (LOG.isDebugEnabled()) {
+              LOG.debug("Finding file by url:" + path);
+            }
+            VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(path);
+            if (file == null) continue;
+            if (LOG.isDebugEnabled()) {
+              LOG.debug("Finding "+relativePath+" relative to:"+file.getPath());
+            }
+            final VirtualFile relativeFile = UriUtil.findRelativeFile(relativePath, file);
+            if (LOG.isDebugEnabled()) {
+              LOG.debug("Found "+(relativeFile != null ? relativeFile.getPath():"null"));
+            }
+
+            if (relativeFile != null) {
+              psiFile = PsiManager.getInstance(myProject).findFile(relativeFile);
+              if (psiFile != null) break;
+            }
+          }
+        }
+
+        if (LOG.isDebugEnabled()) {
+          LOG.debug("resolveEntity: psiFile='" + (psiFile != null ? psiFile.getVirtualFile() : null) + "'");
+        }
+        result[0] = psiFile;
+      }
+    };
+    ApplicationManager.getApplication().runReadAction(action);
+
+    final PsiFile psiFile = result[0];
+    if (psiFile != null) {
+      final VirtualFile file = psiFile.getVirtualFile();
+      if (file != null) {
+        final String url = file.getUrl();
+        if (LOG.isDebugEnabled()) {
+          LOG.debug("Adding external resource ref:"+systemId+","+url+","+super.toString());
+        }
+        myExternalResourcesMap.put(systemId,url);
+      }
+    }
+    return psiFile;
+  }
+
+  @Nullable
+  public XMLInputSource resolveEntity(XMLResourceIdentifier xmlResourceIdentifier) throws XNIException, IOException {
+    String publicId  = xmlResourceIdentifier.getLiteralSystemId() != null ?
+                  xmlResourceIdentifier.getLiteralSystemId():
+                  xmlResourceIdentifier.getNamespace();
+
+    PsiFile psiFile = resolve(xmlResourceIdentifier.getBaseSystemId(), publicId);
+    if (psiFile == null && xmlResourceIdentifier.getBaseSystemId() != null) {
+        psiFile = ExternalResourceManager.getInstance().getResourceLocation(xmlResourceIdentifier.getBaseSystemId(), myFile, null);
+    }
+    if (psiFile==null && xmlResourceIdentifier.getLiteralSystemId()!=null && xmlResourceIdentifier.getNamespace()!=null) {
+      psiFile = resolve(
+        xmlResourceIdentifier.getBaseSystemId(),
+        publicId = xmlResourceIdentifier.getNamespace()
+      );
+    }
+
+    if (psiFile == null) {
+      if (publicId != null && publicId.indexOf(":/") != -1) {
+        myErrorReporter.processError(
+          new SAXParseException(XmlBundle.message("xml.validate.external.resource.is.not.registered", publicId), publicId, null, 0,0), false);
+        final XMLInputSource source = new XMLInputSource(xmlResourceIdentifier);
+        source.setPublicId(publicId);
+        source.setCharacterStream(new StringReader(""));
+        return source;
+      }
+      return null;
+    }
+
+    XMLInputSource source = new XMLInputSource(xmlResourceIdentifier);
+    if (xmlResourceIdentifier.getLiteralSystemId() == null) {
+      VirtualFile virtualFile = psiFile.getVirtualFile();
+      if (virtualFile != null) {
+        final String url = VfsUtil.fixIDEAUrl(virtualFile.getUrl());
+        source.setBaseSystemId(url);
+        source.setSystemId(url);
+      }
+    }
+    source.setPublicId(publicId);
+    source.setCharacterStream(new StringReader(psiFile.getText()));
+
+    return source;
+  }
+
+  public void setStopOnUnDeclaredResource(final boolean stopOnUnDeclaredResource) {
+    myStopOnUnDeclaredResource = stopOnUnDeclaredResource;
+  }
+
+  public static class IgnoredResourceException extends RuntimeException {
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XmlTagRuleProviderBase.java b/xml/impl/src/com/intellij/xml/util/XmlTagRuleProviderBase.java
new file mode 100644
index 0000000..c5953c4
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XmlTagRuleProviderBase.java
@@ -0,0 +1,239 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.codeInsight.daemon.impl.analysis.InsertRequiredAttributeFix;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.codeInspection.htmlInspections.RemoveAttributeIntentionAction;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.tree.RoleFinder;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlChildRole;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlTagRuleProvider;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public abstract class XmlTagRuleProviderBase extends XmlTagRuleProvider {
+
+  public static RequireAttributeOneOf requireAttr(String ... attributeNames) {
+    return new RequireAttributeOneOf(attributeNames);
+  }
+
+  public static ShouldHaveParams shouldHaveParams() {
+    return new ShouldHaveParams();
+  }
+
+  public static Rule unusedIfPresent(String attrPresent, String ... attrUnused) {
+    Effect[] effects = new Effect[attrUnused.length];
+    for (int i = 0; i < effects.length; i++) {
+      effects[i] = unused(attrUnused[i], "The attribute '" + attrUnused[i] + "' is unused because the attribute '" + attrPresent + "' is present");
+    }
+
+    return new ConditionRule(ifAttrPresent(attrPresent), effects);
+  }
+
+  public static Rule unusedAllIfPresent(String attrPresent, String ... attrUnused) {
+    return new ConditionRule(ifAttrPresent(attrPresent),
+                             new InvalidAllExpectSome("The attribute is unused because the attribute " + attrPresent + " is present",
+                                                      ProblemHighlightType.LIKE_UNUSED_SYMBOL,
+                                                      ArrayUtil.append(attrUnused, attrPresent)));
+  }
+
+  public static Effect invalid(String attrName, String text) {
+    return new InvalidAttrEffect(attrName, text, ProblemHighlightType.GENERIC_ERROR_OR_WARNING);
+  }
+
+  public static Effect unused(String attrName) {
+    return new InvalidAttrEffect(attrName, "Attribute '" + attrName + "' is unused", ProblemHighlightType.LIKE_UNUSED_SYMBOL);
+  }
+
+  public static Effect unused(String attrName, String text) {
+    return new InvalidAttrEffect(attrName, text, ProblemHighlightType.LIKE_UNUSED_SYMBOL);
+  }
+
+  public static Effect unusedAll(String text, String... attrNames) {
+    return new InvalidAllExpectSome(text, ProblemHighlightType.LIKE_UNUSED_SYMBOL, attrNames);
+  }
+
+  public static Rule rule(Condition<XmlTag> condition, Effect ... effect) {
+    return new ConditionRule(condition, effect);
+  }
+
+  @Nullable
+  public static PsiElement getXmlElement(RoleFinder roleFinder, XmlElement tag) {
+    ASTNode tagNode = tag.getNode();
+    if (tagNode == null) return null;
+
+    ASTNode nameElement = roleFinder.findChild(tagNode);
+    if (nameElement == null) return null;
+
+    return nameElement.getPsi();
+  }
+
+  @Nullable
+  public static PsiElement getTagNameElement(XmlTag tag) {
+    return getXmlElement(XmlChildRole.START_TAG_NAME_FINDER, tag);
+  }
+
+  @Nullable
+  public static PsiElement getAttributeNameElement(XmlAttribute attribute) {
+    return getXmlElement(XmlChildRole.ATTRIBUTE_NAME_FINDER, attribute);
+  }
+
+  public static boolean isClosedTag(XmlTag tag) {
+    return getXmlElement(XmlChildRole.EMPTY_TAG_END_FINDER, tag) != null || getXmlElement(XmlChildRole.CLOSING_TAG_START_FINDER, tag) != null;
+  }
+
+  public static Condition<XmlTag> ifAttrPresent(final String attrName) {
+    return new Condition<XmlTag>() {
+      @Override
+      public boolean value(XmlTag tag) {
+        return tag.getAttribute(attrName) != null;
+      }
+    };
+  }
+
+  // ---=== Classes ===---
+
+  public static abstract class Effect {
+    public abstract void annotate(@NotNull XmlTag tag, ProblemsHolder holder);
+  }
+
+  public static class InvalidAttrEffect extends Effect {
+    private final String myAttrName;
+    private final String myText;
+    private final ProblemHighlightType myType;
+
+    public InvalidAttrEffect(String attrName, String text, ProblemHighlightType type) {
+      myAttrName = attrName;
+      myText = text;
+      myType = type;
+    }
+
+    @Override
+    public void annotate(@NotNull XmlTag tag, ProblemsHolder holder) {
+      XmlAttribute attribute = tag.getAttribute(myAttrName);
+      if (attribute != null) {
+        PsiElement attributeNameElement = getAttributeNameElement(attribute);
+        if (attributeNameElement != null) {
+          holder.registerProblem(attributeNameElement, myText, myType, new RemoveAttributeIntentionAction(myAttrName));
+        }
+      }
+    }
+  }
+
+  public static class InvalidAllExpectSome extends Effect {
+    private final String[] myAttrNames;
+    private final String myText;
+    private final ProblemHighlightType myType;
+
+    public InvalidAllExpectSome(String text, ProblemHighlightType type, String... attrNames) {
+      myAttrNames = attrNames;
+      myText = text;
+      myType = type;
+    }
+
+    @Override
+    public void annotate(@NotNull XmlTag tag, ProblemsHolder holder) {
+      for (XmlAttribute xmlAttribute : tag.getAttributes()) {
+        String attrName = xmlAttribute.getName();
+        if (!ArrayUtil.contains(attrName, myAttrNames)) {
+          PsiElement attributeNameElement = getAttributeNameElement(xmlAttribute);
+          if (attributeNameElement != null) {
+            holder.registerProblem(attributeNameElement, myText, myType, new RemoveAttributeIntentionAction(attrName));
+          }
+        }
+      }
+    }
+  }
+
+  public static class ConditionRule extends Rule {
+    private final Condition<XmlTag> myCondition;
+    private final Effect[] myEffect;
+
+    public ConditionRule(Condition<XmlTag> condition, Effect ... effect) {
+      this.myCondition = condition;
+      this.myEffect = effect;
+    }
+
+    @Override
+    public void annotate(@NotNull XmlTag tag, ProblemsHolder holder) {
+      if (myCondition.value(tag)) {
+        for (Effect effect : myEffect) {
+          effect.annotate(tag, holder);
+        }
+      }
+    }
+  }
+
+  public static class ShouldHaveParams extends Rule {
+    @Override
+    public boolean needAtLeastOneAttribute(@NotNull XmlTag tag) {
+      return true;
+    }
+  }
+
+  public static class RequireAttributeOneOf extends ShouldHaveParams {
+    private final String[] myAttributeNames;
+    private final ProblemHighlightType myProblemHighlightType;
+
+    public RequireAttributeOneOf(String ... attributeNames) {
+      myAttributeNames = attributeNames;
+      myProblemHighlightType = ProblemHighlightType.GENERIC_ERROR_OR_WARNING;
+    }
+
+    public RequireAttributeOneOf(@NotNull ProblemHighlightType problemHighlightType, String... attributeNames) {
+      assert attributeNames.length > 0;
+      myAttributeNames = attributeNames;
+      myProblemHighlightType = problemHighlightType;
+    }
+
+    public String[] getAttributeNames() {
+      return myAttributeNames;
+    }
+
+    @Override
+    public void annotate(@NotNull XmlTag tag, ProblemsHolder holder) {
+      for (String attributeName : myAttributeNames) {
+        if (tag.getAttribute(attributeName) != null) {
+          return;
+        }
+      }
+
+      if (!isClosedTag(tag)) return;
+
+      PsiElement tagNameElement = getTagNameElement(tag);
+      if (tagNameElement == null) return;
+
+      LocalQuickFix[] fixes = new LocalQuickFix[myAttributeNames.length];
+      for (int i = 0; i < myAttributeNames.length; i++) {
+        fixes[i] = new InsertRequiredAttributeFix(tag, myAttributeNames[i], null);
+      }
+
+      holder.registerProblem(tagNameElement, "Tag should have one of following attributes: " + StringUtil.join(myAttributeNames, ", "),
+                             myProblemHighlightType,
+                             fixes);
+    }
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/XmlUtil.java b/xml/impl/src/com/intellij/xml/util/XmlUtil.java
new file mode 100644
index 0000000..fec8120
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/XmlUtil.java
@@ -0,0 +1,1595 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.codeInsight.completion.CompletionUtil;
+import com.intellij.codeInsight.daemon.Validator;
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.javaee.ExternalResourceManagerEx;
+import com.intellij.javaee.ExternalResourceManagerImpl;
+import com.intellij.javaee.UriUtil;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.Language;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.xhtml.XHTMLLanguage;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.*;
+import com.intellij.patterns.StandardPatterns;
+import com.intellij.patterns.StringPattern;
+import com.intellij.patterns.XmlPatterns;
+import com.intellij.psi.*;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.codeStyle.CodeStyleManager;
+import com.intellij.psi.filters.ElementFilter;
+import com.intellij.psi.filters.XmlTagFilter;
+import com.intellij.psi.filters.position.FilterPattern;
+import com.intellij.psi.impl.source.html.HtmlDocumentImpl;
+import com.intellij.psi.impl.source.tree.CompositeElement;
+import com.intellij.psi.impl.source.tree.LeafElement;
+import com.intellij.psi.impl.source.xml.XmlEntityRefImpl;
+import com.intellij.psi.scope.processor.FilterElementProcessor;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.*;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.text.XmlCharsetDetector;
+import com.intellij.xml.*;
+import com.intellij.xml.impl.schema.ComplexTypeDescriptor;
+import com.intellij.xml.impl.schema.TypeDescriptor;
+import com.intellij.xml.impl.schema.XmlElementDescriptorImpl;
+import com.intellij.xml.impl.schema.XmlNSDescriptorImpl;
+import com.intellij.xml.index.IndexedRelevantResource;
+import com.intellij.xml.index.XmlNamespaceIndex;
+import com.intellij.xml.index.XsdNamespaceBuilder;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.File;
+import java.net.URL;
+import java.util.*;
+
+/**
+ * @author Mike
+ */
+public class XmlUtil {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.util.XmlUtil");
+
+  @NonNls public static final String TAGLIB_1_2_URI = "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd";
+
+  @NonNls public static final String XML_SCHEMA_URI = "http://www.w3.org/2001/XMLSchema";
+  @NonNls public static final String XML_SCHEMA_URI2 = "http://www.w3.org/1999/XMLSchema";
+  @NonNls public static final String XML_SCHEMA_URI3 = "http://www.w3.org/2000/10/XMLSchema";
+  public static final String[] SCHEMA_URIS = {XML_SCHEMA_URI, XML_SCHEMA_URI2, XML_SCHEMA_URI3};
+  @NonNls public static final String XML_SCHEMA_INSTANCE_URI = "http://www.w3.org/2001/XMLSchema-instance";
+
+  @NonNls public static final String XSLT_URI = "http://www.w3.org/1999/XSL/Transform";
+  @NonNls public static final String XINCLUDE_URI = "http://www.w3.org/2001/XInclude";
+
+  @NonNls public static final String ANT_URI = "http://ant.apache.org/schema.xsd";
+  @NonNls public static final String XHTML_URI = "http://www.w3.org/1999/xhtml";
+  @NonNls public static final String HTML_URI = "http://www.w3.org/1999/html";
+  @NonNls public static final String EMPTY_URI = "";
+  @NonNls public static final Key<String> TEST_PATH = Key.create("TEST PATH");
+  @NonNls public static final String JSP_URI = "http://java.sun.com/JSP/Page";
+  @NonNls public static final String ANY_URI = "http://www.intellij.net/ns/any";
+
+  @NonNls public static final String JSTL_CORE_URI = "http://java.sun.com/jsp/jstl/core";
+  @NonNls public static final String JSTL_CORE_URI2 = "http://java.sun.com/jstl/core";
+  @NonNls public static final String JSTL_CORE_URI3 = "http://java.sun.com/jstl/core_rt";
+  @NonNls public static final String[] JSTL_CORE_URIS = {JSTL_CORE_URI, JSTL_CORE_URI2, JSTL_CORE_URI3};
+
+  @NonNls public static final String JSF_HTML_URI = "http://java.sun.com/jsf/html";
+  @NonNls public static final String JSF_CORE_URI = "http://java.sun.com/jsf/core";
+
+  @NonNls public static final String JSTL_FORMAT_URI = "http://java.sun.com/jsp/jstl/fmt";
+  @NonNls public static final String JSTL_FORMAT_URI2 = "http://java.sun.com/jstl/fmt";
+  @NonNls private static final String JSTL_FORMAT_URI3 = "http://java.sun.com/jstl/fmt_rt";
+  @NonNls public static final String[] JSTL_FORMAT_URIS = {JSTL_FORMAT_URI, JSTL_FORMAT_URI2, JSTL_FORMAT_URI3};
+
+  @NonNls public static final String SPRING_URI = "http://www.springframework.org/tags";
+  @NonNls public static final String SPRING_FORMS_URI = "http://www.springframework.org/tags/form";
+  @NonNls public static final String STRUTS_BEAN_URI = "http://struts.apache.org/tags-bean";
+  @NonNls public static final String STRUTS_BEAN_URI2 = "http://jakarta.apache.org/struts/tags-bean";
+  @NonNls public static final String APACHE_I18N_URI = "http://jakarta.apache.org/taglibs/i18n-1.0";
+  @NonNls public static final String STRUTS_LOGIC_URI = "http://struts.apache.org/tags-logic";
+  @NonNls public static final String STRUTS_HTML_URI = "http://struts.apache.org/tags-html";
+  @NonNls public static final String STRUTS_HTML_URI2 = "http://jakarta.apache.org/struts/tags-html";
+
+  @NonNls public static final String APACHE_TRINIDAD_URI = "http://myfaces.apache.org/trinidad";
+  @NonNls public static final String APACHE_TRINIDAD_HTML_URI = "http://myfaces.apache.org/trinidad/html";
+
+  @NonNls public static final String XSD_SIMPLE_CONTENT_TAG = "simpleContent";
+  @NonNls public static final String NO_NAMESPACE_SCHEMA_LOCATION_ATT = "noNamespaceSchemaLocation";
+  @NonNls public static final String SCHEMA_LOCATION_ATT = "schemaLocation";
+  @NonNls public static final String[] WEB_XML_URIS =
+    {"http://java.sun.com/xml/ns/j2ee", "http://java.sun.com/xml/ns/javaee", "http://java.sun.com/dtd/web-app_2_3.dtd",
+      "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"};
+  @NonNls public static final String FACELETS_URI = "http://java.sun.com/jsf/facelets";
+  @NonNls public static final String JSTL_FUNCTIONS_URI = "http://java.sun.com/jsp/jstl/functions";
+  @NonNls public static final String JSTL_FUNCTIONS_URI2 = "http://java.sun.com/jstl/functions";
+  @NonNls public static final String JSTL_FN_FACELET_URI = "com.sun.facelets.tag.jstl.fn.JstlFnLibrary";
+  @NonNls public static final String JSTL_CORE_FACELET_URI = "com.sun.facelets.tag.jstl.core.JstlCoreLibrary";
+  @NonNls public static final String TARGET_NAMESPACE_ATTR_NAME = "targetNamespace";
+  @NonNls public static final String XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace";
+  public static final List<String> ourSchemaUrisList = Arrays.asList(SCHEMA_URIS);
+  public static final Key<Boolean> ANT_FILE_SIGN = new Key<Boolean>("FORCED ANT FILE");
+  @NonNls public static final String TAG_DIR_NS_PREFIX = "urn:jsptagdir:";
+  @NonNls public static final String VALUE_ATTR_NAME = "value";
+  @NonNls public static final String ENUMERATION_TAG_NAME = "enumeration";
+  @NonNls public static final String HTML4_LOOSE_URI = "http://www.w3.org/TR/html4/loose.dtd";
+  @NonNls public static final String WSDL_SCHEMA_URI = "http://schemas.xmlsoap.org/wsdl/";
+  public static final Key<PsiAnchor> ORIGINAL_ELEMENT = Key.create("ORIGINAL_ELEMENT");
+
+  public static final String XHTML4_SCHEMA_LOCATION;
+  public final static Key<Boolean> BUILDING_DOM_STUBS = Key.create("building dom stubs...");
+
+  private XmlUtil() {
+  }
+
+  static {
+    final URL xhtml4SchemaLocationUrl = XmlUtil.class.getResource(ExternalResourceManagerImpl.STANDARD_SCHEMAS + "xhtml1-transitional.xsd");
+    XHTML4_SCHEMA_LOCATION = VfsUtilCore.urlToPath(VfsUtil.fixURLforIDEA(FileUtil.unquote(xhtml4SchemaLocationUrl.toExternalForm())));
+  }
+
+  @Nullable
+  public static String getSchemaLocation(XmlTag tag, String namespace) {
+    final String uri = ExternalResourceManagerEx.getInstanceEx().getResourceLocation(namespace, tag.getProject());
+    if (uri != null && !uri.equals(namespace)) return uri;
+
+    while (true) {
+      if (namespace.isEmpty()) {
+        final String attributeValue = tag.getAttributeValue("noNamespaceSchemaLocation", XML_SCHEMA_INSTANCE_URI);
+        if (attributeValue != null) return attributeValue;
+      }
+      else {
+        String schemaLocation = tag.getAttributeValue("schemaLocation", XML_SCHEMA_INSTANCE_URI);
+        if (schemaLocation != null) {
+          int start = schemaLocation.indexOf(namespace);
+          if (start >= 0) {
+            start += namespace.length();
+            final StringTokenizer tokenizer = new StringTokenizer(schemaLocation.substring(start + 1));
+            if (tokenizer.hasMoreTokens()) {
+              return tokenizer.nextToken();
+            }
+            else {
+              return null;
+            }
+          }
+        }
+      }
+      if (tag.getParent() instanceof XmlTag) {
+        tag = (XmlTag)tag.getParent();
+      }
+      else {
+        break;
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public static String findNamespacePrefixByURI(XmlFile file, @NonNls String uri) {
+    final XmlTag tag = file.getRootTag();
+    if (tag == null) return null;
+
+    for (XmlAttribute attribute : tag.getAttributes()) {
+      if (attribute.getName().startsWith("xmlns:") && attribute.getValue().equals(uri)) {
+        return attribute.getName().substring("xmlns:".length());
+      }
+      if ("xmlns".equals(attribute.getName()) && attribute.getValue().equals(uri)) return "";
+    }
+
+    return null;
+  }
+
+  public static String[] findNamespacesByURI(XmlFile file, String uri) {
+    if (file == null) return ArrayUtil.EMPTY_STRING_ARRAY;
+    final XmlDocument document = file.getDocument();
+    if (document == null) return ArrayUtil.EMPTY_STRING_ARRAY;
+    final XmlTag tag = document.getRootTag();
+    if (tag == null) return ArrayUtil.EMPTY_STRING_ARRAY;
+    XmlAttribute[] attributes = tag.getAttributes();
+
+
+    List<String> result = new ArrayList<String>();
+
+    for (XmlAttribute attribute : attributes) {
+      if (attribute.getName().startsWith("xmlns:") && attribute.getValue().equals(uri)) {
+        result.add(attribute.getName().substring("xmlns:".length()));
+      }
+      if ("xmlns".equals(attribute.getName()) && attribute.getValue().equals(uri)) result.add("");
+    }
+
+    return ArrayUtil.toStringArray(result);
+  }
+
+  @Nullable
+  public static String getXsiNamespace(XmlFile file) {
+    return findNamespacePrefixByURI(file, XML_SCHEMA_INSTANCE_URI);
+  }
+
+  @Nullable
+  public static XmlFile findNamespace(@NotNull PsiFile base, @NotNull String nsLocation) {
+    final String location = ExternalResourceManager.getInstance().getResourceLocation(nsLocation, base.getProject());
+    if (!location.equals(nsLocation)) { // is mapped
+      return findXmlFile(base, location);
+    }
+    final XmlFile xmlFile = XmlSchemaProvider.findSchema(location, base);
+    return xmlFile == null ? findXmlFile(base, location) : xmlFile;
+  }
+
+  @Nullable
+  public static XmlFile findNamespaceByLocation(@NotNull PsiFile base, @NotNull String nsLocation) {
+    final String location = ExternalResourceManager.getInstance().getResourceLocation(nsLocation, base.getProject());
+    return findXmlFile(base, location);
+  }
+
+  public static Collection<XmlFile> findNSFilesByURI(String namespace, final Project project, Module module) {
+    final List<IndexedRelevantResource<String,XsdNamespaceBuilder>>
+      resources = XmlNamespaceIndex.getResourcesByNamespace(namespace, project, module);
+    final PsiManager psiManager = PsiManager.getInstance(project);
+    return ContainerUtil.mapNotNull(resources, new NullableFunction<IndexedRelevantResource<String, XsdNamespaceBuilder>, XmlFile>() {
+      public XmlFile fun(IndexedRelevantResource<String, XsdNamespaceBuilder> resource) {
+        PsiFile file = psiManager.findFile(resource.getFile());
+        return file instanceof XmlFile ? (XmlFile)file : null;
+      }
+    });
+  }
+
+  @Nullable
+  public static XmlFile findXmlFile(PsiFile base, @NotNull String uri) {
+    PsiFile result = null;
+
+    if (ApplicationManager.getApplication().isUnitTestMode()) {
+      String data = base.getOriginalFile().getUserData(TEST_PATH);
+
+      if (data != null) {
+        String filePath = data + "/" + uri;
+        final VirtualFile path = LocalFileSystem.getInstance().findFileByPath(filePath.replace(File.separatorChar, '/'));
+        if (path != null) {
+          result = base.getManager().findFile(path);
+        }
+      }
+    }
+    if (result == null) {
+      result = findRelativeFile(uri, base);
+    }
+
+    if (result instanceof XmlFile) {
+      return (XmlFile)result;
+    }
+
+    return null;
+  }
+
+  @Nullable
+  public static XmlToken getTokenOfType(PsiElement element, IElementType type) {
+    if (element == null) {
+      return null;
+    }
+
+    PsiElement[] children = element.getChildren();
+
+    for (PsiElement child : children) {
+      if (child instanceof XmlToken) {
+        XmlToken token = (XmlToken)child;
+
+        if (token.getTokenType() == type) {
+          return token;
+        }
+      }
+    }
+
+    return null;
+  }
+
+  public static boolean processXmlElements(XmlElement element, PsiElementProcessor processor, boolean deepFlag) {
+    return processXmlElements(element, processor, deepFlag, false);
+  }
+
+  public static boolean processXmlElements(XmlElement element, PsiElementProcessor processor, boolean deepFlag, boolean wideFlag) {
+    if (element == null) return true;
+    PsiFile baseFile = element.isValid() ? element.getContainingFile() : null;
+    return processXmlElements(element, processor, deepFlag, wideFlag, baseFile);
+  }
+
+  public static boolean processXmlElements(final XmlElement element,
+                                           final PsiElementProcessor processor,
+                                           final boolean deepFlag,
+                                           final boolean wideFlag,
+                                           final PsiFile baseFile) {
+    return processXmlElements(element, processor, deepFlag, wideFlag, baseFile, true);
+  }
+
+  public static boolean processXmlElements(final XmlElement element,
+                                           final PsiElementProcessor processor,
+                                           final boolean deepFlag,
+                                           final boolean wideFlag,
+                                           final PsiFile baseFile,
+                                           boolean processIncludes) {
+    return new XmlElementProcessor(processor, baseFile).processXmlElements(element, deepFlag, wideFlag, processIncludes);
+  }
+
+  public static boolean processXmlElementChildren(final XmlElement element, final PsiElementProcessor processor, final boolean deepFlag) {
+    final XmlElementProcessor p = new XmlElementProcessor(processor, element.getContainingFile());
+
+    final boolean wideFlag = false;
+    for (PsiElement child = element.getFirstChild(); child != null; child = child.getNextSibling()) {
+      if (!p.processElement(child, deepFlag, wideFlag, true) && !wideFlag) return false;
+    }
+
+    return true;
+  }
+
+  public static boolean tagFromTemplateFramework(@NotNull final XmlTag tag) {
+    final String ns = tag.getNamespace();
+    return nsFromTemplateFramework(ns);
+  }
+
+  public static boolean nsFromTemplateFramework(final String ns) {
+    return XSLT_URI.equals(ns) || XINCLUDE_URI.equals(ns);
+  }
+
+
+  public static char getCharFromEntityRef(@NonNls String text) {
+    //LOG.assertTrue(text.startsWith("&#") && text.endsWith(";"));
+    if (text.charAt(1) != '#') {
+      try {
+        text = text.substring(1, text.length() - 1);
+      }
+      catch (StringIndexOutOfBoundsException e) {
+        LOG.error("Cannot parse ref: '" + text + "'", e);
+      }
+      return XmlTagUtil.getCharacterByEntityName(text);
+    }
+    text = text.substring(2, text.length() - 1);
+    try {
+      int code;
+      if (StringUtil.startsWithChar(text, 'x')) {
+        text = text.substring(1);
+        code = Integer.parseInt(text, 16);
+      }
+      else {
+        code = Integer.parseInt(text);
+      }
+      return (char)code;
+    }
+    catch (NumberFormatException e) {
+      return 0;
+    }
+  }
+
+  public static boolean attributeFromTemplateFramework(@NonNls final String name, final XmlTag tag) {
+    return "jsfc".equals(name) && tag.getNSDescriptor(JSF_HTML_URI, true) != null;
+  }
+
+  @Nullable
+  public static String getTargetSchemaNsFromTag(@Nullable final XmlTag xmlTag) {
+    if (xmlTag == null) return null;
+    String targetNamespace = xmlTag.getAttributeValue(TARGET_NAMESPACE_ATTR_NAME, XML_SCHEMA_URI);
+    if (targetNamespace == null) targetNamespace = xmlTag.getAttributeValue(TARGET_NAMESPACE_ATTR_NAME, XML_SCHEMA_URI2);
+    if (targetNamespace == null) targetNamespace = xmlTag.getAttributeValue(TARGET_NAMESPACE_ATTR_NAME, XML_SCHEMA_URI3);
+    return targetNamespace;
+  }
+
+  @Nullable
+  public static XmlTag getSchemaSimpleContent(@NotNull XmlTag tag) {
+    XmlElementDescriptor descriptor = tag.getDescriptor();
+
+    if (descriptor instanceof XmlElementDescriptorImpl) {
+      final TypeDescriptor type = ((XmlElementDescriptorImpl)descriptor).getType(tag);
+
+      if (type instanceof ComplexTypeDescriptor) {
+        final XmlTag[] simpleContent = new XmlTag[1];
+
+        processXmlElements(((ComplexTypeDescriptor)type).getDeclaration(), new PsiElementProcessor() {
+          public boolean execute(@NotNull final PsiElement element) {
+            if (element instanceof XmlTag) {
+              final XmlTag tag = (XmlTag)element;
+              @NonNls final String s = ((XmlTag)element).getLocalName();
+
+              if ((s.equals(XSD_SIMPLE_CONTENT_TAG) ||
+                   s.equals("restriction") && "string".equals(findLocalNameByQualifiedName(tag.getAttributeValue("base")))) &&
+                  tag.getNamespace().equals(XML_SCHEMA_URI)) {
+                simpleContent[0] = tag;
+                return false;
+              }
+            }
+
+            return true;
+          }
+        }, true);
+
+        return simpleContent[0];
+      }
+    }
+    return null;
+  }
+
+  public static <T extends PsiElement> void doDuplicationCheckForElements(final T[] elements,
+                                                                          final Map<String, T> presentNames,
+                                                                          DuplicationInfoProvider<T> provider,
+                                                                          final Validator.ValidationHost host) {
+    for (T t : elements) {
+      final String name = provider.getName(t);
+      if (name == null) continue;
+
+      final String nameKey = provider.getNameKey(t, name);
+
+      if (presentNames.containsKey(nameKey)) {
+        final T psiElement = presentNames.get(nameKey);
+        final String message = XmlBundle.message("duplicate.declaration", nameKey);
+
+        if (psiElement != null) {
+          presentNames.put(nameKey, null);
+
+          host.addMessage(provider.getNodeForMessage(psiElement), message, Validator.ValidationHost.ERROR);
+        }
+
+        host.addMessage(provider.getNodeForMessage(t), message, Validator.ValidationHost.ERROR);
+      }
+      else {
+        presentNames.put(nameKey, t);
+      }
+    }
+  }
+
+  public static String getEntityValue(final XmlEntityRef entityRef) {
+    final XmlEntityDecl decl = entityRef.resolve(entityRef.getContainingFile());
+    if (decl != null) {
+      final XmlAttributeValue valueElement = decl.getValueElement();
+      if (valueElement != null) {
+        final String value = valueElement.getValue();
+        if (value != null) {
+          return value;
+        }
+      }
+    }
+    return entityRef.getText();
+  }
+
+  public static boolean isAntFile(final PsiFile file) {
+    if (file instanceof XmlFile) {
+      final XmlFile xmlFile = (XmlFile)file;
+      final XmlDocument document = xmlFile.getDocument();
+      if (document != null) {
+        final XmlTag tag = document.getRootTag();
+        if (tag != null && "project".equals(tag.getName()) && tag.getContext() instanceof XmlDocument) {
+          if (tag.getAttributeValue("default") != null) {
+            return true;
+          }
+          VirtualFile vFile = xmlFile.getOriginalFile().getVirtualFile();
+          if (vFile != null && vFile.getUserData(ANT_FILE_SIGN) != null) {
+            return true;
+          }
+        }
+      }
+    }
+    return false;
+  }
+
+  @Nullable
+  public static PsiFile findRelativeFile(String uri, PsiElement base) {
+    if (base instanceof PsiFile) {
+      PsiFile baseFile = (PsiFile)base;
+      VirtualFile file = UriUtil.findRelative(uri, baseFile.getOriginalFile());
+      if (file == null) return null;
+      return base.getManager().findFile(file);
+    }
+    else if (base instanceof PsiDirectory) {
+      PsiDirectory baseDir = (PsiDirectory)base;
+      VirtualFile file = UriUtil.findRelative(uri, baseDir);
+      if (file == null) return null;
+      return base.getManager().findFile(file);
+    }
+
+    return null;
+  }
+
+  @Nullable
+  public static String getCommentText(XmlComment comment) {
+    final PsiElement firstChild = comment.getFirstChild();
+    if (firstChild != null) {
+      final PsiElement nextSibling = firstChild.getNextSibling();
+      if (nextSibling instanceof XmlToken) {
+        final XmlToken token = (XmlToken)nextSibling;
+        if (token.getTokenType() == XmlTokenType.XML_COMMENT_CHARACTERS) {
+          return token.getText();
+        }
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public static PsiElement findNamespaceDeclaration(XmlElement xmlElement, String nsName) {
+    while (! (xmlElement instanceof XmlTag) && xmlElement != null) {
+      final PsiElement parent = xmlElement.getParent();
+      if (!(parent instanceof XmlElement)) return null;
+      xmlElement = (XmlElement)parent;
+    }
+    if (xmlElement != null) {
+      XmlTag tag = (XmlTag)xmlElement;
+      while (tag != null) {
+        for (XmlAttribute attribute : tag.getAttributes()) {
+          if (attribute.isNamespaceDeclaration() && attribute.getLocalName().equals(nsName)) {
+            return attribute;
+          }
+        }
+        tag = tag.getParentTag();
+      }
+    }
+    return null;
+  }
+
+  public static void reformatTagStart(XmlTag tag) {
+    ASTNode child = XmlChildRole.START_TAG_END_FINDER.findChild(tag.getNode());
+    if (child == null) {
+      CodeStyleManager.getInstance(tag.getProject()).reformat(tag);
+    }
+    else {
+      CodeStyleManager.getInstance(tag.getProject()).reformatRange(tag, tag.getTextRange().getStartOffset(), child.getTextRange().getEndOffset());
+    }
+  }
+
+  @Nullable
+  public static XmlElementDescriptor getDescriptorFromContext(@NotNull XmlTag tag) {
+    PsiElement parent = tag.getParent();
+    if (parent instanceof XmlTag) {
+      XmlTag parentTag = (XmlTag)parent;
+      final XmlElementDescriptor parentDescriptor = parentTag.getDescriptor();
+
+      if (parentDescriptor != null) {
+        return XmlExtension.getExtension(tag.getContainingFile()).getElementDescriptor(tag, parentTag, parentDescriptor);
+      }
+    }
+    return null;
+  }
+
+  public static void expandTag(@NotNull XmlTag tag) {
+    XmlTag newTag = XmlElementFactory.getInstance(tag.getProject()).createTagFromText('<' + tag.getName() + "></" + tag.getName() + '>');
+
+    ASTNode node = tag.getNode();
+    if (!(node instanceof CompositeElement)) return;
+    CompositeElement compositeElement = (CompositeElement)node;
+
+    final LeafElement emptyTagEnd = (LeafElement)XmlChildRole.EMPTY_TAG_END_FINDER.findChild(compositeElement);
+    if (emptyTagEnd == null) return;
+
+    compositeElement.removeChild(emptyTagEnd);
+    PsiElement[] children = newTag.getChildren();
+
+    compositeElement.addChildren(children[2].getNode(), null, null);
+  }
+
+  public static String getDefaultXhtmlNamespace(Project project) {
+    final String doctype = ExternalResourceManagerEx.getInstanceEx().getDefaultHtmlDoctype(project);
+    return Html5SchemaProvider.HTML5_SCHEMA_LOCATION.equals(doctype)
+           ? Html5SchemaProvider.XHTML5_SCHEMA_LOCATION
+           : doctype;
+  }
+
+  public static CharSequence getLocalName(final CharSequence tagName) {
+    int pos = StringUtil.indexOf(tagName, ':');
+    if (pos == -1) {
+      return tagName;
+    }
+    return tagName.subSequence(pos + 1, tagName.length());
+  }
+
+  public static boolean isStubBuilding(PsiFile file) {
+    return Boolean.TRUE.equals(file.getUserData(BUILDING_DOM_STUBS));
+  }
+
+  private static class XmlElementProcessor {
+    private final PsiElementProcessor processor;
+    private final PsiFile targetFile;
+
+    XmlElementProcessor(PsiElementProcessor _processor, PsiFile _targetFile) {
+      processor = _processor;
+      targetFile = _targetFile;
+    }
+
+    private boolean processXmlElements(PsiElement element, boolean deepFlag, boolean wideFlag, boolean processIncludes) {
+      if (deepFlag) if (!processor.execute(element)) return false;
+
+      PsiElement startFrom = element.getFirstChild();
+
+      if (element instanceof XmlEntityRef) {
+        XmlEntityRef ref = (XmlEntityRef)element;
+
+        PsiElement newElement = parseEntityRef(targetFile, ref);
+
+        while (newElement != null) {
+          if (!processElement(newElement, deepFlag, wideFlag, processIncludes)) return false;
+          newElement = newElement.getNextSibling();
+        }
+
+        return true;
+      }
+      else if (element instanceof XmlConditionalSection) {
+        XmlConditionalSection xmlConditionalSection = (XmlConditionalSection)element;
+        if (!xmlConditionalSection.isIncluded(targetFile)) return true;
+        startFrom = xmlConditionalSection.getBodyStart();
+      }
+      else if (processIncludes && XmlIncludeHandler.isXInclude(element)) {
+        for (PsiElement psiElement : InclusionProvider.getIncludedTags((XmlTag)element)) {
+          if (!processElement(psiElement, deepFlag, wideFlag, true)) return false;
+        }
+      }
+
+      for (PsiElement child = startFrom; child != null; child = child.getNextSibling()) {
+        if (!processElement(child, deepFlag, wideFlag, processIncludes) && !wideFlag) return false;
+      }
+
+      return true;
+    }
+
+    private boolean processElement(PsiElement child, boolean deepFlag, boolean wideFlag, boolean processIncludes) {
+      if (deepFlag) {
+        if (!processXmlElements(child, true, wideFlag, processIncludes)) {
+          return false;
+        }
+      }
+      else {
+        if (child instanceof XmlEntityRef) {
+          if (!processXmlElements(child, false, wideFlag, processIncludes)) return false;
+        }
+        else if (child instanceof XmlConditionalSection) {
+          if (!processXmlElements(child, false, wideFlag, processIncludes)) return false;
+        }
+        else if (processIncludes && XmlIncludeHandler.isXInclude(child)) {
+          if (!processXmlElements(child, false, wideFlag, processIncludes)) return false;
+        }
+        else if (!processor.execute(child)) return false;
+      }
+      if (targetFile != null && child instanceof XmlEntityDecl) {
+        XmlEntityDecl xmlEntityDecl = (XmlEntityDecl)child;
+        XmlEntityRefImpl.cacheParticularEntity(targetFile, xmlEntityDecl);
+      }
+      return true;
+    }
+  }
+
+  private static PsiElement parseEntityRef(PsiFile targetFile, XmlEntityRef ref) {
+    XmlEntityDecl.EntityContextType type = getContextType(ref);
+
+    {
+      final XmlEntityDecl entityDecl = ref.resolve(targetFile);
+      if (entityDecl != null) return parseEntityDecl(entityDecl, targetFile, type, ref);
+    }
+
+    PsiElement e = ref;
+    while (e != null) {
+      if (e.getUserData(XmlElement.INCLUDING_ELEMENT) != null) {
+        e = e.getUserData(XmlElement.INCLUDING_ELEMENT);
+        final PsiFile f = e.getContainingFile();
+        if (f != null) {
+          final XmlEntityDecl entityDecl = ref.resolve(targetFile);
+          if (entityDecl != null) return parseEntityDecl(entityDecl, targetFile, type, ref);
+        }
+
+        continue;
+      }
+      if (e instanceof PsiFile) {
+        PsiFile refFile = (PsiFile)e;
+        final XmlEntityDecl entityDecl = ref.resolve(refFile);
+        if (entityDecl != null) return parseEntityDecl(entityDecl, targetFile, type, ref);
+        break;
+      }
+
+      e = e.getParent();
+    }
+
+    final PsiElement element = ref.getUserData(XmlElement.DEPENDING_ELEMENT);
+    if (element instanceof XmlFile) {
+      final XmlEntityDecl entityDecl = ref.resolve((PsiFile)element);
+      if (entityDecl != null) return parseEntityDecl(entityDecl, targetFile, type, ref);
+    }
+
+    return null;
+  }
+
+  private static XmlEntityDecl.EntityContextType getContextType(XmlEntityRef ref) {
+    XmlEntityDecl.EntityContextType type = XmlEntityDecl.EntityContextType.GENERIC_XML;
+    PsiElement temp = ref;
+    while (temp != null) {
+      if (temp instanceof XmlAttributeDecl) {
+        type = XmlEntityDecl.EntityContextType.ATTRIBUTE_SPEC;
+      }
+      else if (temp instanceof XmlElementDecl) {
+        type = XmlEntityDecl.EntityContextType.ELEMENT_CONTENT_SPEC;
+      }
+      else if (temp instanceof XmlAttlistDecl) {
+        type = XmlEntityDecl.EntityContextType.ATTLIST_SPEC;
+      }
+      else if (temp instanceof XmlEntityDecl) {
+        type = XmlEntityDecl.EntityContextType.ENTITY_DECL_CONTENT;
+      }
+      else if (temp instanceof XmlEnumeratedType) {
+        type = XmlEntityDecl.EntityContextType.ENUMERATED_TYPE;
+      }
+      else if (temp instanceof XmlAttributeValue) {
+        type = XmlEntityDecl.EntityContextType.ATTR_VALUE;
+      }
+      else {
+        temp = temp.getContext();
+        continue;
+      }
+      break;
+    }
+    return type;
+  }
+
+  private static final Key<CachedValue<PsiElement>> PARSED_DECL_KEY = Key.create("PARSED_DECL_KEY");
+
+  private static PsiElement parseEntityDecl(final XmlEntityDecl entityDecl,
+                                            final PsiFile targetFile,
+                                            final XmlEntityDecl.EntityContextType type,
+                                            final XmlEntityRef entityRef) {
+    synchronized (PsiLock.LOCK) { // we depend on targetFile and entityRef
+      CachedValue<PsiElement> value = entityRef.getUserData(PARSED_DECL_KEY);
+      //    return entityDecl.parse(targetFile, type);
+
+      if (value == null) {
+        value = CachedValuesManager.getManager(entityDecl.getProject()).createCachedValue(new CachedValueProvider<PsiElement>() {
+          public Result<PsiElement> compute() {
+            final PsiElement res = entityDecl.parse(targetFile, type, entityRef);
+            if (res == null) return new Result<PsiElement>(res, targetFile);
+            if (!entityDecl.isInternalReference()) XmlEntityRefImpl.copyEntityCaches(res.getContainingFile(), targetFile);
+            return new Result<PsiElement>(res, res.getUserData(XmlElement.DEPENDING_ELEMENT), entityDecl, targetFile, entityRef);
+          }
+        }, false);
+        entityRef.putUserData(PARSED_DECL_KEY, value);
+      }
+
+      return value.getValue();
+    }
+  }
+
+  /**
+   * add child to the parent according to DTD/Schema element ordering
+   *
+   * @return newly added child
+   */
+  public static XmlTag addChildTag(XmlTag parent, XmlTag child) throws IncorrectOperationException {
+    return addChildTag(parent, child, -1);
+  }
+
+  public static XmlTag addChildTag(XmlTag parent, XmlTag child, int index) throws IncorrectOperationException {
+
+    // bug in PSI: cannot add child to <tag/>
+    if (parent.getSubTags().length == 0 && parent.getText().endsWith("/>")) {
+      final XmlElementFactory factory = XmlElementFactory.getInstance(parent.getProject());
+      final String name = parent.getName();
+      final String text = parent.getText();
+      final XmlTag tag = factory.createTagFromText(text.substring(0, text.length() - 2) + "></" + name + ">");
+      parent = (XmlTag)parent.replace(tag);
+    }
+
+    final XmlElementDescriptor parentDescriptor = parent.getDescriptor();
+    final XmlTag[] subTags = parent.getSubTags();
+    if (parentDescriptor == null || subTags.length == 0) return (XmlTag)parent.add(child);
+    int subTagNum = -1;
+
+    for (XmlElementDescriptor childElementDescriptor : parentDescriptor.getElementsDescriptors(parent)) {
+      final String childElementName = childElementDescriptor.getName();
+      int prevSubTagNum = subTagNum;
+      while (subTagNum < subTags.length - 1 && subTags[subTagNum + 1].getName().equals(childElementName)) {
+        subTagNum++;
+      }
+      if (childElementName.equals(child.getLocalName())) {
+        // insert child just after anchor
+        // insert into the position specified by index
+        subTagNum = index == -1 || index > subTagNum - prevSubTagNum ? subTagNum : prevSubTagNum + index;
+        return (XmlTag)(subTagNum == -1 ? parent.addBefore(child, subTags[0]) : parent.addAfter(child, subTags[subTagNum]));
+      }
+    }
+    return (XmlTag)parent.add(child);
+  }
+
+  /**
+   * @see XmlTag#getAttributeValue(String)
+   */
+  @Nullable
+  @Deprecated
+  public static String getAttributeValue(XmlTag tag, String name) {
+    for (XmlAttribute attribute : tag.getAttributes()) {
+      if (name.equals(attribute.getName())) return attribute.getValue();
+    }
+    return null;
+  }
+
+  // Read the function name and parameter names to find out what this function does... :-)
+  @Nullable
+  public static XmlTag find(String subTag, String withValue, String forTag, XmlTag insideRoot) {
+    final XmlTag[] forTags = insideRoot.findSubTags(forTag);
+
+    for (XmlTag tag : forTags) {
+      final XmlTag[] allTags = tag.findSubTags(subTag);
+
+      for (XmlTag curTag : allTags) {
+        if (curTag.getName().equals(subTag) && curTag.getValue().getTrimmedText().equalsIgnoreCase(withValue)) {
+          return tag;
+        }
+      }
+    }
+
+    return null;
+  }
+
+  @Nullable
+  @NonNls
+  public static String[][] getDefaultNamespaces(final XmlDocument document) {
+    final XmlFile file = getContainingFile(document);
+
+    final XmlTag tag = document.getRootTag();
+    if (tag == null) return null;
+
+    if (file != null) {
+      @NotNull final XmlFileNSInfoProvider[] nsProviders = Extensions.getExtensions(XmlFileNSInfoProvider.EP_NAME);
+
+      NextProvider:
+      for (XmlFileNSInfoProvider nsProvider : nsProviders) {
+        final String[][] pairs = nsProvider.getDefaultNamespaces(file);
+        if (pairs != null && pairs.length > 0) {
+
+          for (final String[] nsMapping : pairs) {
+            if (nsMapping == null || nsMapping.length != 2 || nsMapping[0] == null || nsMapping[1] == null) {
+              LOG.debug("NSInfoProvider " + nsProvider + " gave wrong info about " + file.getVirtualFile());
+              continue NextProvider;
+            }
+          }
+          return pairs;
+        }
+      }
+    }
+
+    String namespace = getDtdUri(document);
+
+    if (namespace != null) {
+      boolean overrideNamespaceFromDocType = false;
+
+      if (file != null) {
+        final FileType fileType = file.getFileType();
+        overrideNamespaceFromDocType =
+          fileType == StdFileTypes.HTML || fileType == StdFileTypes.XHTML || fileType == StdFileTypes.JSPX || fileType == StdFileTypes.JSP;
+      }
+
+      if (!overrideNamespaceFromDocType) return new String[][]{new String[]{"", namespace}};
+    }
+
+    if ("taglib".equals(tag.getName())) {
+      return new String[][]{new String[]{"", TAGLIB_1_2_URI}};
+    }
+
+    if (file != null) {
+
+      final Language language = file.getLanguage();
+      if (language == HTMLLanguage.INSTANCE || language == XHTMLLanguage.INSTANCE) {
+        return new String[][]{new String[]{"", XHTML_URI}};
+        }
+      }
+
+    return null;
+  }
+  
+  @Nullable
+  public static String getDtdUri(XmlDocument document) {
+    XmlProlog prolog = document.getProlog();
+    if (prolog != null) {
+      return getDtdUri( prolog.getDoctype() );
+    }
+    return null;
+  }
+
+  @Nullable
+  public static String getDtdUri(XmlDoctype doctype) {
+    if (doctype != null) {
+      String docType = doctype.getDtdUri();
+      if (docType == null) {
+        final String publicId = doctype.getPublicId();
+        if (PsiTreeUtil.getParentOfType(doctype, XmlDocument.class) instanceof HtmlDocumentImpl &&
+            publicId != null &&
+            publicId.indexOf("-//W3C//DTD HTML") != -1) {
+          return HTML4_LOOSE_URI;
+        }
+        else if (HtmlUtil.isHtml5Doctype(doctype)) {
+          docType = doctype.getLanguage() instanceof HTMLLanguage
+                    ? Html5SchemaProvider.HTML5_SCHEMA_LOCATION
+                    : Html5SchemaProvider.XHTML5_SCHEMA_LOCATION;
+        }
+      }
+      return docType;
+    }
+    return null;
+  }
+
+  private static void computeTag(XmlTag tag,
+                                 final Map<String, List<String>> tagsMap,
+                                 final Map<String, List<MyAttributeInfo>> attributesMap,
+                                 final boolean processIncludes) {
+    if (tag == null) {
+      return;
+    }
+    final String tagName = tag.getName();
+
+    List<MyAttributeInfo> list = attributesMap.get(tagName);
+    if (list == null) {
+      list = new ArrayList<MyAttributeInfo>();
+      final XmlAttribute[] attributes = tag.getAttributes();
+      for (final XmlAttribute attribute : attributes) {
+        list.add(new MyAttributeInfo(attribute.getName()));
+      }
+    }
+    else {
+      final XmlAttribute[] attributes = tag.getAttributes();
+      ContainerUtil.sort(list);
+      Arrays.sort(attributes, new Comparator<XmlAttribute>() {
+        public int compare(XmlAttribute attr1, XmlAttribute attr2) {
+          return attr1.getName().compareTo(attr2.getName());
+        }
+      });
+
+      final Iterator<MyAttributeInfo> iter = list.iterator();
+      list = new ArrayList<MyAttributeInfo>();
+      int index = 0;
+      while (iter.hasNext()) {
+        final MyAttributeInfo info = iter.next();
+        boolean requiredFlag = false;
+        while (attributes.length > index) {
+          if (info.compareTo(attributes[index]) != 0) {
+            if (info.compareTo(attributes[index]) < 0) {
+              break;
+            }
+            if (attributes[index].getValue() != null) list.add(new MyAttributeInfo(attributes[index].getName(), false));
+            index++;
+          }
+          else {
+            requiredFlag = true;
+            index++;
+            break;
+          }
+        }
+        info.myRequired &= requiredFlag;
+        list.add(info);
+      }
+      while (attributes.length > index) {
+        if (attributes[index].getValue() != null) {
+          list.add(new MyAttributeInfo(attributes[index++].getName(), false));
+        }
+        else {
+          index++;
+        }
+      }
+    }
+    attributesMap.put(tagName, list);
+    final List<String> tags = tagsMap.get(tagName) != null ? tagsMap.get(tagName) : new ArrayList<String>();
+    tagsMap.put(tagName, tags);
+    PsiFile file = tag.isValid() ? tag.getContainingFile() : null;
+    processXmlElements(tag, new FilterElementProcessor(XmlTagFilter.INSTANCE) {
+      public void add(PsiElement element) {
+        XmlTag tag = (XmlTag)element;
+        if (!tags.contains(tag.getName())) {
+          tags.add(tag.getName());
+        }
+        computeTag(tag, tagsMap, attributesMap, processIncludes);
+      }
+    }, false, false, file, processIncludes);
+    /*tag.processElements(new FilterElementProcessor(XmlTagFilter.INSTANCE) {
+      public void add(PsiElement element) {
+        XmlTag tag = (XmlTag)element;
+        if (!tags.contains(tag.getName())) {
+          tags.add(tag.getName());
+        }
+        computeTag(tag, tagsMap, attributesMap);
+      }
+    }, tag);*/
+  }
+
+  @Nullable
+  public static XmlElementDescriptor findXmlDescriptorByType(final XmlTag xmlTag) {
+    return findXmlDescriptorByType(xmlTag, null);
+  }
+
+  @Nullable
+  public static XmlElementDescriptor findXmlDescriptorByType(final XmlTag xmlTag, @Nullable XmlTag context) {
+    String type = xmlTag.getAttributeValue("type", XML_SCHEMA_INSTANCE_URI);
+
+    if (type == null) {
+      String ns = xmlTag.getNamespace();
+      if (ourSchemaUrisList.indexOf(ns) >= 0) {
+        type = xmlTag.getAttributeValue("type", null);
+      }
+    }
+
+    XmlElementDescriptor elementDescriptor = null;
+    if (type != null) {
+      final String namespaceByPrefix = findNamespaceByPrefix(findPrefixByQualifiedName(type), xmlTag);
+      XmlNSDescriptor typeDecr = xmlTag.getNSDescriptor(namespaceByPrefix, true);
+
+      if (typeDecr == null && namespaceByPrefix.length() == 0) {
+        if (context != null) typeDecr = context.getNSDescriptor("", true);
+
+        if (typeDecr == null) {
+          final PsiFile containingFile = xmlTag.getContainingFile();
+          if (containingFile instanceof XmlFile) {
+            final XmlDocument document = ((XmlFile)containingFile).getDocument();
+            if (document != null) typeDecr = (XmlNSDescriptor)document.getMetaData();
+          }
+        }
+      }
+
+      if (typeDecr instanceof XmlNSDescriptorImpl) {
+        final XmlNSDescriptorImpl schemaDescriptor = (XmlNSDescriptorImpl)typeDecr;
+        elementDescriptor = schemaDescriptor.getDescriptorByType(type, xmlTag);
+      }
+    }
+
+    return elementDescriptor;
+  }
+
+  public static boolean collectEnumerationValues(final XmlTag element, final HashSet<String> variants) {
+    return processEnumerationValues(element, new Processor<XmlTag>() {
+      public boolean process(XmlTag xmlTag) {
+        variants.add(xmlTag.getAttributeValue(VALUE_ATTR_NAME));
+        return true;
+      }
+    });
+  }
+
+  public static boolean processEnumerationValues(final XmlTag element, final Processor<XmlTag> tagProcessor) {
+    boolean exaustiveEnum = true;
+
+    for (final XmlTag tag : element.getSubTags()) {
+      @NonNls final String localName = tag.getLocalName();
+
+      if (localName.equals(ENUMERATION_TAG_NAME)) {
+        final String attributeValue = tag.getAttributeValue(VALUE_ATTR_NAME);
+        if (attributeValue != null) tagProcessor.process(tag);
+      }
+      else if (localName.equals("union")) {
+        exaustiveEnum = false;
+        processEnumerationValues(tag, tagProcessor);
+      }
+      else if (!localName.equals("annotation")) {
+        // don't go into annotation
+        exaustiveEnum &= processEnumerationValues(tag, tagProcessor);
+      }
+    }
+    return exaustiveEnum;
+  }
+
+  /**
+   *
+   * @param xmlTag
+   * @param localName
+   * @param namespace
+   * @param bodyText pass null to create collapsed tag, empty string means creating expanded one
+   * @param enforceNamespacesDeep
+   * @return
+   */
+  public static XmlTag createChildTag(final XmlTag xmlTag,
+                                      String localName,
+                                      String namespace,
+                                      @Nullable String bodyText,
+                                      boolean enforceNamespacesDeep) {
+    String qname;
+    final String prefix = xmlTag.getPrefixByNamespace(namespace);
+    if (prefix != null && prefix.length() > 0) {
+      qname = prefix + ":" + localName;
+    }
+    else {
+      qname = localName;
+    }
+    try {
+      @NonNls StringBuilder tagStartBuilder = StringBuilderSpinAllocator.alloc();
+      String tagStart;
+      try {
+        tagStartBuilder.append(qname);
+        if (!StringUtil.isEmpty(namespace) && xmlTag.getPrefixByNamespace(namespace) == null &&
+            !(StringUtil.isEmpty(xmlTag.getNamespacePrefix()) && namespace.equals(xmlTag.getNamespace()))) {
+          tagStartBuilder.append(" xmlns=\"");
+          tagStartBuilder.append(namespace);
+          tagStartBuilder.append("\"");
+        }
+        tagStart = tagStartBuilder.toString();
+      }
+      finally {
+        StringBuilderSpinAllocator.dispose(tagStartBuilder);
+      }
+      Language language = xmlTag.getLanguage();
+      if (!(language instanceof HTMLLanguage)) language = StdFileTypes.XML.getLanguage();
+      XmlTag retTag;
+      if (bodyText != null) {
+        retTag = XmlElementFactory.getInstance(xmlTag.getProject())
+          .createTagFromText("<" + tagStart + ">" + bodyText + "</" + qname + ">", language);
+        if (enforceNamespacesDeep) {
+          retTag.acceptChildren(new XmlRecursiveElementVisitor() {
+            @Override
+            public void visitXmlTag(XmlTag tag) {
+              final String namespacePrefix = tag.getNamespacePrefix();
+              if (namespacePrefix.length() == 0) {
+                String qname;
+                if (prefix != null && prefix.length() > 0) {
+                  qname = prefix + ":" + tag.getLocalName();
+                }
+                else {
+                  qname = tag.getLocalName();
+                }
+                try {
+                  tag.setName(qname);
+                }
+                catch (IncorrectOperationException e) {
+                  LOG.error(e);
+                }
+              }
+              super.visitXmlTag(tag);
+            }
+          });
+        }
+      }
+      else {
+        retTag = XmlElementFactory.getInstance(xmlTag.getProject()).createTagFromText("<" + tagStart + "/>", language);
+      }
+      return retTag;
+    }
+    catch (IncorrectOperationException e) {
+      LOG.error(e);
+    }
+    return null;
+  }
+
+  @Nullable
+  public static Pair<XmlTagChild, XmlTagChild> findTagChildrenInRange(final PsiFile file, int startOffset, int endOffset) {
+    PsiElement elementAtStart = file.findElementAt(startOffset);
+    PsiElement elementAtEnd = file.findElementAt(endOffset - 1);
+    if (elementAtStart instanceof PsiWhiteSpace) {
+      startOffset = elementAtStart.getTextRange().getEndOffset();
+      elementAtStart = file.findElementAt(startOffset);
+    }
+    if (elementAtEnd instanceof PsiWhiteSpace) {
+      endOffset = elementAtEnd.getTextRange().getStartOffset();
+      elementAtEnd = file.findElementAt(endOffset - 1);
+    }
+    if (elementAtStart == null || elementAtEnd == null) return null;
+
+    XmlTagChild first = PsiTreeUtil.getParentOfType(elementAtStart, XmlTagChild.class);
+    if (first == null) return null;
+
+    if (first.getTextRange().getStartOffset() != startOffset) {
+      //Probably 'first' starts with whitespace
+      PsiElement elementAt = file.findElementAt(first.getTextRange().getStartOffset());
+      if (!(elementAt instanceof PsiWhiteSpace) || elementAt.getTextRange().getEndOffset() != startOffset) return null;
+    }
+
+    XmlTagChild last = first;
+    while (last != null && last.getTextRange().getEndOffset() < endOffset) {
+      last = PsiTreeUtil.getNextSiblingOfType(last, XmlTagChild.class);
+    }
+
+    if (last == null) return null;
+    if (last.getTextRange().getEndOffset() != elementAtEnd.getTextRange().getEndOffset()) {
+      //Probably 'last' ends with whitespace
+      PsiElement elementAt = file.findElementAt(last.getTextRange().getEndOffset() - 1);
+      if (!(elementAt instanceof PsiWhiteSpace) || elementAt.getTextRange().getStartOffset() != endOffset) {
+        return null;
+      }
+    }
+
+    return new Pair<XmlTagChild, XmlTagChild>(first, last);
+  }
+
+  public static boolean isSimpleXmlAttributeValue(final String unquotedValue, final XmlAttributeValue context) {
+    for (int i = 0; i < unquotedValue.length(); ++i) {
+      final char ch = unquotedValue.charAt(i);
+      if (!Character.isJavaIdentifierPart(ch) && ch != ':' && ch != '-') {
+        final XmlFile file = PsiTreeUtil.getParentOfType(context, XmlFile.class);
+        return file != null && !tagFromTemplateFramework(file.getRootTag());
+      }
+    }
+    return true;
+  }
+
+  public static boolean toCode(String str) {
+    for (int i = 0; i < str.length(); i++) {
+      if (toCode(str.charAt(i))) return true;
+    }
+    return false;
+  }
+
+  public static boolean toCode(char ch) {
+    return "<&>\u00a0".indexOf(ch) >= 0;
+  }
+
+  @Nullable
+  public static PsiNamedElement findRealNamedElement(@NotNull final PsiNamedElement _element) {
+    PsiElement currentElement = _element;
+    final XmlEntityRef lastEntityRef = PsiTreeUtil.getParentOfType(currentElement, XmlEntityRef.class);
+
+    while (!(currentElement instanceof XmlFile)) {
+      PsiElement dependingElement = currentElement.getUserData(XmlElement.DEPENDING_ELEMENT);
+      if (dependingElement == null) dependingElement = currentElement.getContext();
+      currentElement = dependingElement;
+      if (dependingElement == null) break;
+    }
+
+    if (currentElement != null) {
+      final String name = _element.getName();
+      if (_element instanceof XmlEntityDecl) {
+        final XmlEntityDecl cachedEntity = XmlEntityRefImpl.getCachedEntity((PsiFile)currentElement, name);
+        if (cachedEntity != null) return cachedEntity;
+      }
+
+      final PsiNamedElement[] result = new PsiNamedElement[1];
+
+      processXmlElements((XmlFile)currentElement, new PsiElementProcessor() {
+        public boolean execute(@NotNull final PsiElement element) {
+          if (element instanceof PsiNamedElement) {
+            final String elementName = ((PsiNamedElement)element).getName();
+
+            if (elementName.equals(name) && _element.getClass().isInstance(element)
+                || lastEntityRef != null && element instanceof XmlEntityDecl &&
+                   elementName.equals(lastEntityRef.getText().substring(1, lastEntityRef.getTextLength() - 1))) {
+              result[0] = (PsiNamedElement)element;
+              return false;
+            }
+          }
+
+          return true;
+        }
+      }, true);
+
+      return result[0];
+    }
+
+    return null;
+  }
+
+  private static class MyAttributeInfo implements Comparable {
+    boolean myRequired = true;
+    String myName = null;
+
+    MyAttributeInfo(String name) {
+      myName = name;
+    }
+
+    MyAttributeInfo(String name, boolean flag) {
+      myName = name;
+      myRequired = flag;
+    }
+
+    public int compareTo(Object o) {
+      if (o instanceof MyAttributeInfo) {
+        return myName.compareTo(((MyAttributeInfo)o).myName);
+      }
+      else if (o instanceof XmlAttribute) {
+        return myName.compareTo(((XmlAttribute)o).getName());
+      }
+      return -1;
+    }
+  }
+
+  public static String generateDocumentDTD(XmlDocument doc, boolean full) {
+    final Map<String, List<String>> tags = new LinkedHashMap<String, List<String>>();
+    final Map<String, List<MyAttributeInfo>> attributes = new LinkedHashMap<String, List<MyAttributeInfo>>();
+
+    try {
+      XmlEntityRefImpl.setNoEntityExpandOutOfDocument(doc, true);
+      final XmlTag rootTag = doc.getRootTag();
+      computeTag(rootTag, tags, attributes, full);
+
+      // For supporting not well-formed XML
+      for (PsiElement element = rootTag != null ? rootTag.getNextSibling() : null; element != null; element = element.getNextSibling()) {
+        if (element instanceof XmlTag) {
+          computeTag((XmlTag)element, tags, attributes, full);
+        }
+      }
+    }
+    finally {
+      XmlEntityRefImpl.setNoEntityExpandOutOfDocument(doc, false);
+    }
+
+    final StringBuilder buffer = new StringBuilder();
+    for (final String tagName : tags.keySet()) {
+      buffer.append(generateElementDTD(tagName, tags.get(tagName), attributes.get(tagName)));
+    }
+    return buffer.toString();
+  }
+
+  public static String generateElementDTD(String name, List<String> tags, List<MyAttributeInfo> attributes) {
+    if (name == null || "".equals(name)) return "";
+    if (name.contains(CompletionUtil.DUMMY_IDENTIFIER_TRIMMED)) return "";
+
+    @NonNls final StringBuilder buffer = StringBuilderSpinAllocator.alloc();
+    try {
+      buffer.append("<!ELEMENT ").append(name).append(" ");
+      if (tags.isEmpty()) {
+        buffer.append("(#PCDATA)>\n");
+      }
+      else {
+        buffer.append("(");
+        final Iterator<String> iter = tags.iterator();
+        while (iter.hasNext()) {
+          final String tagName = iter.next();
+          buffer.append(tagName);
+          if (iter.hasNext()) {
+            buffer.append("|");
+          }
+          else {
+            buffer.append(")*");
+          }
+        }
+        buffer.append(">\n");
+      }
+      if (!attributes.isEmpty()) {
+        buffer.append("<!ATTLIST ").append(name);
+        for (final MyAttributeInfo info : attributes) {
+          buffer.append("\n    ").append(generateAttributeDTD(info));
+        }
+        buffer.append(">\n");
+      }
+      return buffer.toString();
+    }
+    finally {
+      StringBuilderSpinAllocator.dispose(buffer);
+    }
+  }
+
+  private static String generateAttributeDTD(MyAttributeInfo info) {
+    if (info.myName.contains(CompletionUtil.DUMMY_IDENTIFIER_TRIMMED)) return "";
+    @NonNls final StringBuilder buffer = StringBuilderSpinAllocator.alloc();
+    try {
+      buffer.append(info.myName).append(" ");
+      //if ("id".equals(info.myName)) {
+      //  buffer.append("ID");
+      //}
+      //else if ("ref".equals(info.myName)) {
+      //  buffer.append("IDREF");
+      //} else {
+      buffer.append("CDATA");
+      //}
+      if (info.myRequired) {
+        buffer.append(" #REQUIRED");
+      }
+      else {
+        buffer.append(" #IMPLIED");
+      }
+      return buffer.toString();
+    }
+    finally {
+      StringBuilderSpinAllocator.dispose(buffer);
+    }
+  }
+
+  @Nullable
+  public static String trimLeadingSpacesInMultilineTagValue(@NonNls String tagValue) {
+    return tagValue == null ? null : tagValue.replaceAll("\n\\s*", "\n");
+  }
+
+  public static String findNamespaceByPrefix(final String prefix, XmlTag contextTag) {
+    return contextTag.getNamespaceByPrefix(prefix);
+  }
+
+  public static String findPrefixByQualifiedName(@NotNull String name) {
+    final int prefixEnd = name.indexOf(':');
+    if (prefixEnd > 0) {
+      return name.substring(0, prefixEnd);
+    }
+    return "";
+  }
+
+  @Nullable
+  public static String findLocalNameByQualifiedName(String name) {
+    return name == null ? null : name.substring(name.indexOf(':') + 1);
+  }
+
+
+  public static XmlFile getContainingFile(PsiElement element) {
+    while (!(element instanceof XmlFile) && element != null) {
+      final PsiElement context = element.getContext();
+      if (context == null) {
+        //todo Dmitry Avdeev: either XmlExtension should work on any PsiFile (not just XmlFile), or you need to handle elements from JspJavaFile in some other way
+        final XmlExtension extension = XmlExtension.getExtensionByElement(element);
+        if (extension != null) {
+          element = extension.getContainingFile(element);
+        }
+      }
+      else {
+        if (element == context) {
+          LOG.error("Context==element: " + element.getClass());
+          return null;
+        }
+        element = context;
+      }
+    }
+    return (XmlFile)element;
+  }
+
+  @Nullable
+  public static String getSubTagValue(XmlTag tag, final String subTagName) {
+    final XmlTag subTag = tag.findFirstSubTag(subTagName);
+    if (subTag != null) {
+      return subTag.getValue().getTrimmedText();
+    }
+    return null;
+  }
+
+  public static int getStartOffsetInFile(XmlTag xmlTag) {
+    int off = 0;
+    while (true) {
+      off += xmlTag.getStartOffsetInParent();
+      final PsiElement parent = xmlTag.getParent();
+      if (!(parent instanceof XmlTag)) break;
+      xmlTag = (XmlTag)parent;
+    }
+    return off;
+  }
+
+  public static XmlElement setNewValue(XmlElement tag, String value) throws IncorrectOperationException {
+    if (tag instanceof XmlTag) {
+      ((XmlTag)tag).getValue().setText(value);
+      return tag;
+    }
+    else if (tag instanceof XmlAttribute) {
+      XmlAttribute attr = (XmlAttribute)tag;
+      attr.setValue(value);
+      return attr;
+    }
+    else {
+      throw new IncorrectOperationException();
+    }
+  }
+
+  public static String decode(@NonNls String text) {
+    if (text.length() == 0) return text;
+    if (text.charAt(0) != '&' || text.length() < 3) {
+      if (text.indexOf('<') < 0 && text.indexOf('>') < 0) return text;
+      return text.replaceAll("<!\\[CDATA\\[", "").replaceAll("\\]\\]>", "");
+    }
+
+    if (text.equals("&lt;")) {
+      return "<";
+    }
+    if (text.equals("&gt;")) {
+      return ">";
+    }
+    if (text.equals("&nbsp;")) {
+      return "\u00a0";
+    }
+    if (text.equals("&amp;")) {
+      return "&";
+    }
+    if (text.equals("&apos;")) {
+      return "'";
+    }
+    if (text.equals("&quot;")) {
+      return "\"";
+    }
+    if (text.startsWith("&quot;") && text.endsWith("&quot;")) {
+      return "\"" + text.substring(6, text.length() - 6) + "\"";
+    }
+    if (text.startsWith("&#")) {
+      text = text.substring(3, text.length() - 1);
+      try {
+        return String.valueOf((char)Integer.parseInt(text));
+      }
+      catch (NumberFormatException e) {
+        // ignore
+      }
+    }
+
+    return text;
+  }
+
+  public static String unescape(String text) {
+    return StringUtil.unescapeXml(text);
+  }
+
+  public static String escape(String text) {
+    return StringUtil.escapeXml(text);
+  }
+
+  @Nullable
+  public static String extractXmlEncodingFromProlog(final byte[] content) {
+    return XmlCharsetDetector.extractXmlEncodingFromProlog(content);
+  }
+
+  @Nullable
+  public static String extractXmlEncodingFromProlog(String text) {
+    return XmlCharsetDetector.extractXmlEncodingFromProlog(text);
+  }
+
+  public static void registerXmlAttributeValueReferenceProvider(PsiReferenceRegistrar registrar,
+                                                                @Nullable @NonNls String[] attributeNames,
+                                                                @Nullable ElementFilter elementFilter,
+                                                                @NotNull PsiReferenceProvider provider) {
+    registerXmlAttributeValueReferenceProvider(registrar, attributeNames, elementFilter, true, provider);
+  }
+
+  public static void registerXmlAttributeValueReferenceProvider(PsiReferenceRegistrar registrar,
+                                                                @Nullable @NonNls String[] attributeNames,
+                                                                @Nullable ElementFilter elementFilter,
+                                                                boolean caseSensitive,
+                                                                @NotNull PsiReferenceProvider provider) {
+    registerXmlAttributeValueReferenceProvider(registrar, attributeNames, elementFilter, caseSensitive, provider,
+                                               PsiReferenceRegistrar.DEFAULT_PRIORITY);
+  }
+
+  public static void registerXmlAttributeValueReferenceProvider(PsiReferenceRegistrar registrar,
+                                                                @Nullable @NonNls String[] attributeNames,
+                                                                @Nullable ElementFilter elementFilter,
+                                                                boolean caseSensitive,
+                                                                @NotNull PsiReferenceProvider provider,
+                                                                double priority) {
+    if (attributeNames == null) {
+      registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().and(new FilterPattern(elementFilter)), provider, priority);
+      return;
+    }
+
+    final StringPattern namePattern = caseSensitive
+                                      ? StandardPatterns.string().oneOf(attributeNames)
+                                      : StandardPatterns.string().oneOfIgnoreCase(attributeNames);
+    registrar
+      .registerReferenceProvider(XmlPatterns.xmlAttributeValue().withLocalName(namePattern).and(new FilterPattern(elementFilter)), provider,
+                                 priority);
+  }
+
+  public static void registerXmlTagReferenceProvider(PsiReferenceRegistrar registrar,
+                                                     @NonNls String[] names,
+                                                     @Nullable ElementFilter elementFilter,
+                                                     boolean caseSensitive,
+                                                     @NotNull PsiReferenceProvider provider) {
+    if (names == null) {
+      registrar.registerReferenceProvider(XmlPatterns.xmlTag().and(new FilterPattern(elementFilter)), provider,
+                                          PsiReferenceRegistrar.DEFAULT_PRIORITY);
+      return;
+    }
+
+
+    final StringPattern namePattern =
+      caseSensitive ? StandardPatterns.string().oneOf(names) : StandardPatterns.string().oneOfIgnoreCase(names);
+    registrar.registerReferenceProvider(XmlPatterns.xmlTag().withLocalName(namePattern).and(new FilterPattern(elementFilter)), provider,
+                                        PsiReferenceRegistrar.DEFAULT_PRIORITY);
+  }
+
+  public interface DuplicationInfoProvider<T extends PsiElement> {
+    @Nullable
+    String getName(@NotNull T t);
+
+    @NotNull
+    String getNameKey(@NotNull T t, @NotNull String name);
+
+    @NotNull
+    PsiElement getNodeForMessage(@NotNull T t);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/CompositeAttributeTagDescriptor.java b/xml/impl/src/com/intellij/xml/util/documentation/CompositeAttributeTagDescriptor.java
new file mode 100644
index 0000000..53fdca8
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/CompositeAttributeTagDescriptor.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util.documentation;
+
+import com.intellij.psi.xml.XmlTag;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author maxim
+ */
+class CompositeAttributeTagDescriptor extends HtmlAttributeDescriptor {
+  List<HtmlAttributeDescriptor> attributes = new LinkedList<HtmlAttributeDescriptor>();
+
+  HtmlAttributeDescriptor findHtmlAttributeInContext(XmlTag tag) {
+    if (tag == null) return null;
+    String contextName = tag.getName();
+
+    for (final HtmlAttributeDescriptor attributeDescriptor : attributes) {
+      if (attributeDescriptor.isValidParentTagName(contextName)) {
+        return attributeDescriptor;
+      }
+    }
+
+    return null;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/EntityDescriptor.java b/xml/impl/src/com/intellij/xml/util/documentation/EntityDescriptor.java
new file mode 100644
index 0000000..21c0b46
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/EntityDescriptor.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util.documentation;
+
+/**
+ * @author maxim
+ */
+class EntityDescriptor {
+  private String description;
+  private String helpRef;
+  private String name;
+  private char dtd;
+
+  static final char LOOSE_DTD = 'L';
+  static final char FRAME_DTD = 'D';
+
+  char getDtd() {
+    return dtd;
+  }
+
+  void setDtd(char dtd) {
+    this.dtd = dtd;
+  }
+
+  String getDescription() {
+    return description;
+  }
+
+  void setDescription(String description) {
+    this.description = description;
+  }
+
+  String getHelpRef() {
+    return helpRef;
+  }
+
+  void setHelpRef(String helpRef) {
+    this.helpRef = helpRef;
+  }
+
+  String getName() {
+    return name;
+  }
+
+  void setName(String name) {
+    this.name = name;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/HtmlAttributeDescriptor.java b/xml/impl/src/com/intellij/xml/util/documentation/HtmlAttributeDescriptor.java
new file mode 100644
index 0000000..1cc3e6f
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/HtmlAttributeDescriptor.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util.documentation;
+
+import java.util.Arrays;
+
+/**
+ * @author maxim
+ */
+class HtmlAttributeDescriptor extends EntityDescriptor {
+  private String myType;
+  private boolean myHasDefaultValue;
+  private String[] mySetOfParentTags;
+  private boolean myParentSetIsExclusionSet;
+
+  boolean isValidParentTagName(String str) {
+    boolean containsInSet = Arrays.binarySearch(mySetOfParentTags, str) >= 0;
+    return containsInSet == !myParentSetIsExclusionSet;
+  }
+
+  String getType() {
+    return myType;
+  }
+
+  void setType(String type) {
+    this.myType = type;
+  }
+
+  boolean isHasDefaultValue() {
+    return myHasDefaultValue;
+  }
+
+  void setHasDefaultValue(boolean hasDefaultValue) {
+    this.myHasDefaultValue = hasDefaultValue;
+  }
+
+  String[] getSetOfParentTags() {
+    return mySetOfParentTags;
+  }
+
+  boolean isParentSetIsExclusionSet() {
+    return myParentSetIsExclusionSet;
+  }
+
+  void setParentSetIsExclusionSet(boolean _parentSetIsExclusionSet) {
+    myParentSetIsExclusionSet = _parentSetIsExclusionSet;
+  }
+
+  void setSetOfParentTags(String[] _setOfParentTags) {
+    mySetOfParentTags = _setOfParentTags;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/HtmlDescriptorsTable.java b/xml/impl/src/com/intellij/xml/util/documentation/HtmlDescriptorsTable.java
new file mode 100644
index 0000000..35e5675
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/HtmlDescriptorsTable.java
@@ -0,0 +1,199 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util.documentation;
+
+import com.intellij.openapi.util.JDOMUtil;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.HashSet;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.jetbrains.annotations.NonNls;
+
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * @author maxim
+ */
+public class HtmlDescriptorsTable {
+  private static final HashMap<String,HtmlTagDescriptor> ourTagTable = new HashMap<String, HtmlTagDescriptor>();
+  private static final HashMap<String,HtmlAttributeDescriptor> ourAttributeTable = new HashMap<String, HtmlAttributeDescriptor>();
+  private static String[] ourHtmlTagNames;
+
+  @NonNls
+  public static final String HTMLTABLE_RESOURCE_NAME = "htmltable.xml";
+
+  @NonNls
+  public static final String HTML5TABLE_RESOURCE_NAME = "html5table.xml";
+
+  @NonNls
+  private static final String MATHML_RESOURCE_NAME = "mathmltable.xml";
+
+  @NonNls
+  private static final String SVG_RESOURCE_NAME = "svgtable.xml";
+
+  @NonNls
+  public static final String TAG_ELEMENT_NAME = "tag";
+
+  @NonNls
+  public static final String BASE_HELP_REF_ATTR = "baseHelpRef";
+
+  @NonNls
+  public static final String NAME_ATTR = "name";
+
+  @NonNls
+  public static final String HELPREF_ATTR = "helpref";
+
+  @NonNls
+  public static final String DESCRIPTION_ATTR = "description";
+
+  @NonNls public static final String STARTTAG_ATTR = "startTag";
+
+  @NonNls public static final String ENDTAG_ATTR = "endTag";
+
+  @NonNls public static final String EMPTY_ATTR = "empty";
+
+  @NonNls public static final String DTD_ATTR = "dtd";
+
+  @NonNls public static final String ATTRIBUTE_ELEMENT_NAME = "attribute";
+
+  @NonNls public static final String TYPE_ATTR = "type";
+
+  @NonNls public static final String DEFAULT_ATTR = "default";
+
+  @NonNls public static final String RELATED_TAGS_ATTR = "relatedTags";
+
+  private HtmlDescriptorsTable() {
+  }
+
+  static {
+    try {
+      Set<String> htmlTagNames = new HashSet<String>();
+
+      loadHtmlElements(HTMLTABLE_RESOURCE_NAME, htmlTagNames);
+
+      loadHtmlElements(HTML5TABLE_RESOURCE_NAME, htmlTagNames);
+
+      loadHtmlElements(MATHML_RESOURCE_NAME, htmlTagNames);
+
+      loadHtmlElements(SVG_RESOURCE_NAME, htmlTagNames);
+
+      ourHtmlTagNames = ArrayUtil.toStringArray(htmlTagNames);
+
+    } catch (Exception ex) {
+      ex.printStackTrace();
+      ourHtmlTagNames = ArrayUtil.EMPTY_STRING_ARRAY;
+    }
+  }
+
+  private static void loadHtmlElements(final String resourceName, Collection<String> htmlTagNames) throws JDOMException, IOException {
+    final Document document = JDOMUtil.loadDocument(HtmlDescriptorsTable.class.getResourceAsStream(resourceName));
+    final List elements = document.getRootElement().getChildren(TAG_ELEMENT_NAME);
+    final String baseHtmlExtDocUrl = document.getRootElement().getAttribute(BASE_HELP_REF_ATTR).getValue();
+
+    for (Object object : elements) {
+      final Element element = (Element)object;
+      String htmlTagName = element.getAttributeValue(NAME_ATTR);
+      htmlTagNames.add(htmlTagName);
+
+      HtmlTagDescriptor value = new HtmlTagDescriptor();
+      ourTagTable.put(htmlTagName, value);
+      value.setHelpRef(baseHtmlExtDocUrl + element.getAttributeValue(HELPREF_ATTR));
+      value.setDescription(element.getAttributeValue(DESCRIPTION_ATTR));
+      value.setName(htmlTagName);
+
+      value.setHasStartTag(element.getAttribute(STARTTAG_ATTR).getBooleanValue());
+      value.setHasEndTag(element.getAttribute(ENDTAG_ATTR).getBooleanValue());
+      value.setEmpty(element.getAttribute(EMPTY_ATTR).getBooleanValue());
+
+      String attributeValue = element.getAttributeValue(DTD_ATTR);
+      if (attributeValue.length() > 0) {
+        value.setDtd(attributeValue.charAt(0));
+      }
+    }
+
+    final List attributes = document.getRootElement().getChildren(ATTRIBUTE_ELEMENT_NAME);
+    for (Object attribute : attributes) {
+      final Element element = (Element)attribute;
+      String attrName = element.getAttributeValue(NAME_ATTR);
+
+      HtmlAttributeDescriptor value = new HtmlAttributeDescriptor();
+      HtmlAttributeDescriptor previousDescriptor = ourAttributeTable.get(attrName);
+
+      if (previousDescriptor == null) {
+        ourAttributeTable.put(attrName, value);
+      }
+      else {
+        CompositeAttributeTagDescriptor parentDescriptor;
+
+        if (!(previousDescriptor instanceof CompositeAttributeTagDescriptor)) {
+          parentDescriptor = new CompositeAttributeTagDescriptor();
+          ourAttributeTable.put(attrName, parentDescriptor);
+          parentDescriptor.attributes.add(previousDescriptor);
+        }
+        else {
+          parentDescriptor = (CompositeAttributeTagDescriptor)previousDescriptor;
+        }
+
+        parentDescriptor.attributes.add(value);
+      }
+
+      value.setHelpRef(element.getAttributeValue(HELPREF_ATTR));
+      value.setDescription(element.getAttributeValue(DESCRIPTION_ATTR));
+      value.setName(attrName);
+
+      String attributeValue = element.getAttributeValue(DTD_ATTR);
+      if (attributeValue.length() > 0) {
+        value.setDtd(attributeValue.charAt(0));
+      }
+
+      value.setType(element.getAttributeValue(TYPE_ATTR));
+      value.setHasDefaultValue(element.getAttribute(DEFAULT_ATTR).getBooleanValue());
+
+      StringTokenizer tokenizer = new StringTokenizer(element.getAttributeValue(RELATED_TAGS_ATTR), ",");
+      int tokenCount = tokenizer.countTokens();
+
+      for (int i = 0; i < tokenCount; ++i) {
+        final String s = tokenizer.nextToken();
+
+        if (s.equals("!")) {
+          value.setParentSetIsExclusionSet(true);
+        }
+        else {
+          if (value.getSetOfParentTags() == null) {
+            value.setSetOfParentTags(new String[tokenCount - (value.isParentSetIsExclusionSet() ? 1 : 0)]);
+          }
+          value.getSetOfParentTags()[i - (value.isParentSetIsExclusionSet() ? 1 : 0)] = s;
+        }
+      }
+
+      Arrays.sort(value.getSetOfParentTags());
+    }
+  }
+
+  static HtmlTagDescriptor getTagDescriptor(String tagName) {
+    return ourTagTable.get(tagName);
+  }
+
+  static HtmlAttributeDescriptor getAttributeDescriptor(String attributeName) {
+    return ourAttributeTable.get(attributeName);
+  }
+
+  public static String[] getHtmlTagNames() {
+    return ourHtmlTagNames;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/HtmlDocumentationProvider.java b/xml/impl/src/com/intellij/xml/util/documentation/HtmlDocumentationProvider.java
new file mode 100644
index 0000000..34e9b5b
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/HtmlDocumentationProvider.java
@@ -0,0 +1,316 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util.documentation;
+
+import com.intellij.lang.documentation.DocumentationProvider;
+import com.intellij.lang.documentation.DocumentationUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.impl.source.xml.SchemaPrefix;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.util.ColorSampleLookupValue;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author maxim
+ */
+public class HtmlDocumentationProvider implements DocumentationProvider {
+  private static DocumentationProvider ourStyleProvider;
+  private static DocumentationProvider ourScriptProvider;
+
+  @NonNls public static final String ELEMENT_ELEMENT_NAME = "element";
+  @NonNls public static final String NBSP = ":&nbsp;";
+  @NonNls public static final String BR = "<br>";
+
+  public static void registerStyleDocumentationProvider(DocumentationProvider documentationProvider) {
+    ourStyleProvider = documentationProvider;
+  }
+
+  @Nullable
+  public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
+    if (element instanceof SchemaPrefix) {
+      return ((SchemaPrefix)element).getQuickNavigateInfo();
+    }
+    return null;
+  }
+
+  public List<String> getUrlFor(PsiElement element, PsiElement originalElement) {
+    String result = getUrlForHtml(element, PsiTreeUtil.getParentOfType(originalElement,XmlTag.class,false));
+
+    if (result == null && ourStyleProvider !=null) {
+      return ourStyleProvider.getUrlFor(element, originalElement);
+    }
+
+    return result != null ? Collections.singletonList(result) : null;
+  }
+
+  public static String getUrlForHtml(PsiElement element, XmlTag context) {
+    final EntityDescriptor descriptor = findDocumentationDescriptor(element, context);
+
+    if (descriptor!=null) {
+      return descriptor.getHelpRef();
+    } else {
+      return null;
+    }
+  }
+
+  private static EntityDescriptor findDocumentationDescriptor(PsiElement element, XmlTag context) {
+    boolean isTag = true;
+    PsiElement nameElement = null;
+    String key = null;
+
+    if (element instanceof XmlElementDecl) {
+      nameElement = ((XmlElementDecl)element).getNameElement();
+    } else if (element instanceof XmlAttributeDecl) {
+      nameElement = ((XmlAttributeDecl)element).getNameElement();
+      isTag = false;
+    } else if (element instanceof XmlTag) {
+      final XmlTag xmlTag = ((XmlTag)element);
+      final PsiMetaData metaData = xmlTag.getMetaData();
+      key = (metaData!=null)?metaData.getName():null;
+      isTag = xmlTag.getLocalName().equals(ELEMENT_ELEMENT_NAME);
+    } else if (element.getParent() instanceof XmlAttributeValue) {
+      isTag = false;
+      key = ((XmlAttribute)element.getParent().getParent()).getName();
+    } else if (element instanceof XmlAttributeValue) {
+      isTag = false;
+      final XmlAttribute xmlAttribute = (XmlAttribute)element.getParent();
+      key = xmlAttribute.getName();
+    } else if (element instanceof XmlAttribute) {
+      final XmlAttribute xmlAttribute = (XmlAttribute)element;
+      isTag = false;
+      key = xmlAttribute.getName();
+    } else {
+      nameElement = element;
+      isTag = !(element.getParent() instanceof XmlAttribute);
+    }
+
+    if (nameElement!=null) {
+      key = nameElement.getText();
+    }
+
+    key = (key != null)?key.toLowerCase():"";
+
+    if (isTag) {
+      return HtmlDescriptorsTable.getTagDescriptor(key);
+    } else {
+      return getDescriptor(key, context);
+    }
+  }
+
+  private static HtmlAttributeDescriptor getDescriptor(String name, XmlTag context) {
+
+    HtmlAttributeDescriptor attributeDescriptor = HtmlDescriptorsTable.getAttributeDescriptor(name);
+    if (attributeDescriptor instanceof CompositeAttributeTagDescriptor) {
+      return ((CompositeAttributeTagDescriptor)attributeDescriptor).findHtmlAttributeInContext(context);
+    }
+
+    return attributeDescriptor;
+  }
+
+  public String generateDoc(PsiElement element, PsiElement originalElement) {
+    final XmlTag tag = PsiTreeUtil.getParentOfType(originalElement, XmlTag.class, false);
+    String result = generateDocForHtml(element, false, tag, originalElement);
+
+    if (result == null && ourStyleProvider !=null) {
+      result = ourStyleProvider.generateDoc(element, originalElement);
+    }
+    
+    if (result == null && ourScriptProvider !=null) {
+      result = ourScriptProvider.generateDoc(element, originalElement);
+    }
+    
+    if (result == null && element instanceof XmlAttributeValue) {
+      result = generateDocForHtml(element.getParent(), false, tag, originalElement);
+    }
+
+    return result;
+  }
+
+  public String generateDocForHtml(PsiElement element) {
+    return generateDocForHtml(element,true, null, null);
+  }
+
+  protected String generateDocForHtml(PsiElement element, boolean ommitHtmlSpecifics, XmlTag context, PsiElement originalElement) {
+    final EntityDescriptor descriptor = findDocumentationDescriptor(element,context);
+
+    if (descriptor!=null) {
+      return generateJavaDoc(descriptor, ommitHtmlSpecifics, originalElement);
+    }
+    if (element instanceof XmlEntityDecl) {
+      final XmlEntityDecl entityDecl = (XmlEntityDecl)element;
+
+      return new XmlDocumentationProvider().findDocRightAfterElement(element, entityDecl.getName());
+    }
+    return null;
+  }
+
+  private static String generateJavaDoc(EntityDescriptor descriptor, boolean ommitHtmlSpecifics, PsiElement element) {
+    StringBuilder buf = new StringBuilder();
+    final boolean istag = descriptor instanceof HtmlTagDescriptor;
+    
+    if (istag) {
+      DocumentationUtil.formatEntityName(XmlBundle.message("xml.javadoc.tag.name.message"),descriptor.getName(),buf);
+    } else {
+      DocumentationUtil.formatEntityName(XmlBundle.message("xml.javadoc.attribute.name.message"),descriptor.getName(),buf);
+    }
+
+    buf.append(XmlBundle.message("xml.javadoc.description.message")).append(NBSP).append(descriptor.getDescription()).append(BR);
+
+    if (istag) {
+      final HtmlTagDescriptor tagDescriptor = (HtmlTagDescriptor)descriptor;
+
+      if (!ommitHtmlSpecifics) {
+        boolean hasStartTag = tagDescriptor.isHasStartTag();
+        if (!hasStartTag) {
+          buf.append(XmlBundle.message("xml.javadoc.start.tag.could.be.omitted.message")).append(BR);
+        }
+        if (!tagDescriptor.isEmpty() && !tagDescriptor.isHasEndTag()) {
+          buf.append(XmlBundle.message("xml.javadoc.end.tag.could.be.omitted.message")).append(BR);
+        }
+      }
+
+      if (tagDescriptor.isEmpty()) {
+        buf.append(XmlBundle.message("xml.javadoc.is.empty.message")).append(BR);
+      }
+    } else {
+      final HtmlAttributeDescriptor attributeDescriptor = (HtmlAttributeDescriptor)descriptor;
+
+      buf.append(XmlBundle.message("xml.javadoc.attr.type.message", attributeDescriptor.getType())).append(BR);
+      if (!attributeDescriptor.isHasDefaultValue())
+        buf.append(XmlBundle.message("xml.javadoc.attr.default.required.message")).append(BR);
+    }
+
+    char dtdId = descriptor.getDtd();
+    boolean deprecated = dtdId == HtmlTagDescriptor.LOOSE_DTD;
+    if (deprecated) {
+      buf.append(XmlBundle.message("xml.javadoc.deprecated.message", deprecated)).append(BR);
+    }
+
+    if (dtdId == HtmlTagDescriptor.LOOSE_DTD) {
+      buf.append(XmlBundle.message("xml.javadoc.defined.in.loose.dtd.message"));
+    }
+    else if (dtdId == HtmlTagDescriptor.FRAME_DTD) {
+      buf.append(XmlBundle.message("xml.javadoc.defined.in.frameset.dtd.message"));
+    }
+    else {
+      buf.append(XmlBundle.message("xml.javadoc.defined.in.any.dtd.message"));
+    }
+
+    if (!istag) {
+      ColorSampleLookupValue.addColorPreviewAndCodeToLookup(element,buf);
+    }
+
+    if (element != null) {
+      buf.append(XmlDocumentationProvider.generateHtmlAdditionalDocTemplate(element));
+    }
+
+    return buf.toString();
+  }
+
+  public PsiElement getDocumentationElementForLookupItem(PsiManager psiManager, Object object, PsiElement element) {
+    PsiElement result = createNavigationElementHTML(psiManager, object.toString(),element);
+
+    if (result== null && ourStyleProvider !=null) {
+      result = ourStyleProvider.getDocumentationElementForLookupItem(psiManager, object, element);
+    }
+    if (result== null && ourScriptProvider !=null) {
+      result = ourScriptProvider.getDocumentationElementForLookupItem(psiManager, object, element);
+    }
+    if (result == null && object instanceof String && element != null) {
+      result = XmlDocumentationProvider.findDeclWithName((String)object, element);
+    }
+    return result;
+  }
+
+  public PsiElement getDocumentationElementForLink(PsiManager psiManager, String link, PsiElement context) {
+    PsiElement result = createNavigationElementHTML(psiManager, link, context);
+
+    if (result== null && ourStyleProvider !=null) {
+      result = ourStyleProvider.getDocumentationElementForLink(psiManager, link,context);
+    }
+    if (result== null && ourScriptProvider !=null) {
+      result = ourScriptProvider.getDocumentationElementForLink(psiManager, link,context);
+    }
+    return result;
+  }
+
+  public PsiElement createNavigationElementHTML(PsiManager psiManager, String text, PsiElement context) {
+    String key = text.toLowerCase();
+    final HtmlTagDescriptor descriptor = HtmlDescriptorsTable.getTagDescriptor(key);
+
+    if (descriptor != null && !isAttributeContext(context) ) {
+      try {
+        final XmlTag tagFromText = XmlElementFactory.getInstance(psiManager.getProject()).createTagFromText("<"+ key + " xmlns=\"" + XmlUtil.XHTML_URI + "\"/>");
+        final XmlElementDescriptor tagDescriptor = tagFromText.getDescriptor();
+        return tagDescriptor != null ? tagDescriptor.getDeclaration() : null;
+      }
+      catch(IncorrectOperationException ignore) {
+      }
+    }
+    else {
+      XmlTag tagContext = findTagContext(context);
+      HtmlAttributeDescriptor myAttributeDescriptor = getDescriptor(key,tagContext);
+
+      if (myAttributeDescriptor != null && tagContext != null) {
+        XmlElementDescriptor tagDescriptor = tagContext.getDescriptor();
+        XmlAttributeDescriptor attributeDescriptor = tagDescriptor != null ? tagDescriptor.getAttributeDescriptor(text, tagContext): null;
+
+        return (attributeDescriptor != null)?attributeDescriptor.getDeclaration():null;
+      }
+    }
+    return null;
+  }
+
+  protected boolean isAttributeContext(PsiElement context) {
+    if(context instanceof XmlAttribute) return true;
+
+    if (context instanceof PsiWhiteSpace) {
+      PsiElement prevSibling = context.getPrevSibling();
+      if (prevSibling instanceof XmlAttribute)
+        return true;
+    }
+
+    return false;
+  }
+
+  protected XmlTag findTagContext(PsiElement context) {
+    if (context instanceof PsiWhiteSpace) {
+      PsiElement prevSibling = context.getPrevSibling();
+      if (prevSibling instanceof XmlTag)
+        return (XmlTag)prevSibling;
+    }
+
+    return PsiTreeUtil.getParentOfType(context,XmlTag.class,false);
+  }
+
+  public static void registerScriptDocumentationProvider(final DocumentationProvider provider) {
+    ourScriptProvider = provider;
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/HtmlTagDescriptor.java b/xml/impl/src/com/intellij/xml/util/documentation/HtmlTagDescriptor.java
new file mode 100644
index 0000000..ae0d8b4
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/HtmlTagDescriptor.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util.documentation;
+
+/**
+ * @author maxim
+ */
+class HtmlTagDescriptor extends EntityDescriptor {
+  boolean isHasStartTag() {
+    return hasStartTag;
+  }
+
+  void setHasStartTag(boolean hasStartTag) {
+    this.hasStartTag = hasStartTag;
+  }
+
+  boolean isHasEndTag() {
+    return hasEndTag;
+  }
+
+  void setHasEndTag(boolean hasEndTag) {
+    this.hasEndTag = hasEndTag;
+  }
+
+  boolean isEmpty() {
+    return empty;
+  }
+
+  void setEmpty(boolean empty) {
+    this.empty = empty;
+  }
+
+  private boolean hasStartTag;
+  private boolean hasEndTag;
+  private boolean empty;
+}
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/XHtmlDocumentationProvider.java b/xml/impl/src/com/intellij/xml/util/documentation/XHtmlDocumentationProvider.java
new file mode 100644
index 0000000..f03f8d7
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/XHtmlDocumentationProvider.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util.documentation;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlText;
+
+/**
+ * @author maxim
+ */
+public class XHtmlDocumentationProvider extends HtmlDocumentationProvider {
+
+  protected String generateDocForHtml(PsiElement element, boolean ommitHtmlSpecifics, XmlTag context, PsiElement originalElement) {
+    return super.generateDocForHtml(element, true, context, originalElement);
+  }
+
+  protected XmlTag findTagContext(PsiElement context) {
+    XmlTag tagBeforeWhiteSpace = findTagBeforeWhiteSpace(context);
+    if (tagBeforeWhiteSpace != null) return tagBeforeWhiteSpace;
+    return super.findTagContext(context);
+  }
+
+  private static XmlTag findTagBeforeWhiteSpace(PsiElement context) {
+    if (context instanceof PsiWhiteSpace) {
+      PsiElement parent = context.getParent();
+      if (parent instanceof XmlText) {
+        PsiElement prevSibling = parent.getPrevSibling();
+        if (prevSibling instanceof XmlTag) return (XmlTag)prevSibling;
+      }
+      else if (parent instanceof XmlTag) {
+        return (XmlTag)parent;
+      }
+    }
+
+    return null;
+  }
+
+  protected boolean isAttributeContext(PsiElement context) {
+    if (findTagBeforeWhiteSpace(context) != null) return false;
+
+    return super.isAttributeContext(context);
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/XmlDocumentationProvider.java b/xml/impl/src/com/intellij/xml/util/documentation/XmlDocumentationProvider.java
new file mode 100644
index 0000000..8af0acc
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/XmlDocumentationProvider.java
@@ -0,0 +1,528 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util.documentation;
+
+import com.intellij.codeInsight.completion.XmlCompletionData;
+import com.intellij.lang.Language;
+import com.intellij.lang.documentation.DocumentationProvider;
+import com.intellij.lang.documentation.DocumentationUtil;
+import com.intellij.lang.xhtml.XHTMLLanguage;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.Ref;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.*;
+import com.intellij.psi.html.HtmlTag;
+import com.intellij.psi.impl.source.xml.SchemaPrefix;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.templateLanguages.TemplateLanguageFileViewProvider;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.Processor;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.impl.schema.*;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author maxim
+ */
+public class XmlDocumentationProvider implements DocumentationProvider {
+  private static final Key<XmlElementDescriptor> DESCRIPTOR_KEY = Key.create("Original element");
+
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.util.documentation.XmlDocumentationProvider");
+
+  @NonNls private static final String NAME_ATTR_NAME = "name";
+  @NonNls private static final String BASE_SITEPOINT_URL = "http://reference.sitepoint.com/html/";
+
+
+  @Nullable
+  public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
+    if (element instanceof SchemaPrefix) {
+      return ((SchemaPrefix)element).getQuickNavigateInfo();
+    }
+    return null;
+  }
+
+  public List<String> getUrlFor(PsiElement element, PsiElement originalElement) {
+    if (element instanceof XmlTag) {
+      XmlTag tag = (XmlTag)element;
+
+      MyPsiElementProcessor processor = new MyPsiElementProcessor();
+      XmlUtil.processXmlElements(tag,processor, true);
+
+      if (processor.url == null) {
+        XmlTag declaration = getComplexOrSimpleTypeDefinition(element, originalElement);
+
+        if (declaration != null) {
+          XmlUtil.processXmlElements(declaration,processor, true);
+        }
+      }
+
+      return processor.url != null ? Collections.singletonList(processor.url) : null;
+    }
+    return null;
+  }
+
+  public String generateDoc(PsiElement element, final PsiElement originalElement) {
+    if (element instanceof XmlElementDecl) {
+      PsiElement curElement = findPreviousComment(element);
+
+      if (curElement!=null) {
+        return formatDocFromComment(curElement, ((XmlElementDecl)element).getNameElement().getText());
+      }
+    } else if (element instanceof XmlTag) {
+      XmlTag tag = (XmlTag)element;
+      MyPsiElementProcessor processor = new MyPsiElementProcessor();
+      String name = tag.getAttributeValue(NAME_ATTR_NAME);
+      String typeName = null;
+
+      if (originalElement != null && originalElement.getParent() instanceof XmlAttributeValue) {
+        XmlAttributeValue value = (XmlAttributeValue)originalElement.getParent();
+        String toSearch = value.getValue();
+        XmlTag enumerationTag;
+        
+        if (XmlUtil.ENUMERATION_TAG_NAME.equals(tag.getLocalName())) {
+          enumerationTag = tag;
+          name = enumerationTag.getAttributeValue(XmlUtil.VALUE_ATTR_NAME);
+        } else {
+          enumerationTag = findEnumerationValue(toSearch, tag);
+          name = toSearch;
+        }
+
+        if (enumerationTag != null) {
+          XmlUtil.processXmlElements(enumerationTag,processor, true);
+
+          if (processor.result != null) {
+            typeName = XmlBundle.message("xml.javadoc.enumeration.value.message");
+          }
+        }
+      }
+
+      if (processor.result == null) XmlUtil.processXmlElements(tag,processor, true);
+
+      if (processor.result == null) {
+        XmlTag declaration = getComplexOrSimpleTypeDefinition(element, originalElement);
+
+        if (declaration != null) {
+          XmlUtil.processXmlElements(declaration,processor, true);
+          name = declaration.getAttributeValue(NAME_ATTR_NAME);
+          typeName = XmlBundle.message("xml.javadoc.complex.type.message");
+        }
+      }
+      if (processor.result == null) {
+        final PsiElement comment = findPreviousComment(element);
+        if (comment != null) {
+          return formatDocFromComment(comment, ((XmlTag)element).getName());
+        }
+      }
+
+      String doc = generateDoc(processor.result, name, typeName, processor.version);
+      if (doc != null && originalElement != null) {
+        doc += generateHtmlAdditionalDocTemplate(originalElement);
+      }
+      return doc;
+
+    } else if (element instanceof XmlAttributeDecl) {
+      // Check for comment before attlist, it should not be right after previous declaration
+      final PsiElement parent = element.getParent();
+      final PsiElement previousComment = findPreviousComment(parent);
+      final String referenceName = ((XmlAttributeDecl)element).getNameElement().getText();
+
+      if (previousComment instanceof PsiComment) {
+        final PsiElement prevSibling = previousComment.getPrevSibling();
+
+        if (prevSibling == null ||
+            ( prevSibling instanceof PsiWhiteSpace &&
+              prevSibling.getText().indexOf('\n') >= 0
+            )
+           ) {
+          return formatDocFromComment(previousComment, referenceName);
+        }
+      }
+
+      return findDocRightAfterElement(parent, referenceName);
+    } else if (element instanceof XmlEntityDecl) {
+      final XmlEntityDecl entityDecl = (XmlEntityDecl)element;
+
+      return findDocRightAfterElement(element, entityDecl.getName());
+    }
+
+    return null;
+  }
+
+  private static XmlTag findEnumerationValue(final String text, XmlTag tag) {
+    final Ref<XmlTag> enumerationTag = new Ref<XmlTag>();
+
+    Processor<XmlTag> processor = new Processor<XmlTag>() {
+      public boolean process(XmlTag xmlTag) {
+        if (text.equals(xmlTag.getAttributeValue(XmlUtil.VALUE_ATTR_NAME))) {
+          enumerationTag.set(xmlTag);
+        }
+        return true;
+      }
+    };
+    XmlUtil.processEnumerationValues(tag, processor);
+
+    if (enumerationTag.get() == null) {
+      final XmlElementDescriptorImpl elementDescriptor = (XmlElementDescriptorImpl)XmlUtil.findXmlDescriptorByType(
+        tag,
+        null
+      );
+
+      TypeDescriptor type = elementDescriptor != null ? elementDescriptor.getType():null;
+      if (type instanceof ComplexTypeDescriptor) {
+        XmlUtil.processEnumerationValues(((ComplexTypeDescriptor)type).getDeclaration(), processor);
+      }
+    }
+    return enumerationTag.get();
+  }
+
+  static String generateHtmlAdditionalDocTemplate(@NotNull PsiElement element) {
+    StringBuilder buf = new StringBuilder();
+    final PsiFile containingFile = element.getContainingFile();
+    if (containingFile != null) {
+      final XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class, false);
+      boolean append;
+      if (tag instanceof HtmlTag) {
+        append = true;
+      }
+      else {
+        final FileViewProvider provider = containingFile.getViewProvider();
+        Language language;
+        if (provider instanceof TemplateLanguageFileViewProvider) {
+          language = ((TemplateLanguageFileViewProvider)provider).getTemplateDataLanguage();
+        }
+        else {
+          language = provider.getBaseLanguage();
+        }
+
+        append = language == XHTMLLanguage.INSTANCE;
+      }
+
+      if (tag != null) {
+        EntityDescriptor descriptor = HtmlDescriptorsTable.getTagDescriptor(tag.getName());
+        if (descriptor != null && append) {
+          buf.append("<br>");
+          buf.append(XmlBundle.message("html.quickdoc.additional.template",
+                                       descriptor.getHelpRef(),
+                                       BASE_SITEPOINT_URL + tag.getName()));
+        }
+      }
+    }
+
+    return buf.toString();
+  }
+
+  public String findDocRightAfterElement(final PsiElement parent, final String referenceName) {
+    // Check for comment right after the xml attlist decl
+    PsiElement uncleElement = parent.getNextSibling();
+    if (uncleElement instanceof PsiWhiteSpace && uncleElement.getText().indexOf('\n') == -1) uncleElement = uncleElement.getNextSibling();
+    if (uncleElement instanceof PsiComment) {
+      return formatDocFromComment(uncleElement, referenceName);
+    }
+    return null;
+  }
+
+  @Nullable
+  public static PsiElement findPreviousComment(final PsiElement element) {
+    PsiElement curElement = element;
+
+    while(curElement!=null && !(curElement instanceof XmlComment)) {
+      curElement = curElement.getPrevSibling();
+      if (curElement instanceof XmlText && StringUtil.isEmptyOrSpaces(curElement.getText())) {
+        continue;
+      }
+      if (!(curElement instanceof PsiWhiteSpace) &&
+          !(curElement instanceof XmlProlog) &&
+          !(curElement instanceof XmlComment)
+         ) {
+        curElement = null; // finding comment fails, we found another similar declaration
+        break;
+      }
+    }
+    return curElement;
+  }
+
+  private String formatDocFromComment(final PsiElement curElement, final String name) {
+    String text = curElement.getText();
+    text = text.substring("<!--".length(),text.length()-"-->".length()).trim();
+    text = escapeDocumentationTextText(text);
+    return generateDoc(text, name,null, null);
+  }
+
+  private XmlTag getComplexOrSimpleTypeDefinition(PsiElement element, PsiElement originalElement) {
+    XmlElementDescriptor descriptor = element.getUserData(DESCRIPTOR_KEY);
+
+    XmlTag contextTag = null;
+
+    XmlAttribute contextAttribute;
+
+    if (descriptor == null &&
+        originalElement != null &&
+        (contextAttribute = PsiTreeUtil.getParentOfType(originalElement, XmlAttribute.class)) != null) {
+      final XmlAttributeDescriptor attributeDescriptor = contextAttribute.getDescriptor();
+
+      if (attributeDescriptor instanceof XmlAttributeDescriptorImpl) {
+        final XmlElementDescriptorImpl elementDescriptor = (XmlElementDescriptorImpl)XmlUtil.findXmlDescriptorByType(
+          (XmlTag)attributeDescriptor.getDeclaration(),
+          contextAttribute.getParent()
+        );
+
+        TypeDescriptor type = elementDescriptor != null ? elementDescriptor.getType(contextAttribute) : null;
+
+        if (type instanceof ComplexTypeDescriptor) {
+          return ((ComplexTypeDescriptor)type).getDeclaration();
+        }
+      }
+    }
+
+    if (descriptor == null &&
+        originalElement != null &&
+        (contextTag = PsiTreeUtil.getParentOfType(originalElement, XmlTag.class)) != null) {
+      descriptor = contextTag.getDescriptor();
+    }
+
+    if (descriptor instanceof XmlElementDescriptorImpl) {
+      TypeDescriptor type = ((XmlElementDescriptorImpl)descriptor).getType(contextTag);
+
+      if (type instanceof ComplexTypeDescriptor) {
+        return ((ComplexTypeDescriptor)type).getDeclaration();
+      }
+    }
+
+    return null;
+  }
+
+  protected String generateDoc(String str, String name, String typeName, String version) {
+    if (str == null) return null;
+    StringBuilder buf = new StringBuilder(str.length() + 20);
+
+    DocumentationUtil.formatEntityName(typeName == null ? XmlBundle.message("xml.javadoc.tag.name.message"):typeName,name,buf);
+
+    final String indent = "  ";
+    final StringBuilder builder = buf.append(XmlBundle.message("xml.javadoc.description.message")).append(indent).
+        append(HtmlDocumentationProvider.NBSP).append(str);
+    if (version != null) {
+      builder.append(HtmlDocumentationProvider.BR).append(XmlBundle.message("xml.javadoc.version.message")).append(indent)
+          .append(HtmlDocumentationProvider.NBSP).append(version);
+    }
+    return builder.toString();
+  }
+
+  public PsiElement getDocumentationElementForLookupItem(final PsiManager psiManager, Object object, PsiElement element) {
+    final PsiElement originalElement = element;
+    boolean isAttrCompletion = element instanceof XmlAttribute;
+
+    if (!isAttrCompletion && element instanceof XmlToken) {
+      final IElementType tokenType = ((XmlToken)element).getTokenType();
+
+      if (tokenType == XmlTokenType.XML_EMPTY_ELEMENT_END || tokenType == XmlTokenType.XML_TAG_END) {
+        isAttrCompletion = true;
+      } else if (element.getParent() instanceof XmlAttribute) {
+        isAttrCompletion = true;
+      }
+    }
+
+    element = PsiTreeUtil.getParentOfType(element, XmlTag.class, false);
+
+    if (element instanceof XmlTag) {
+      XmlTag xmlTag = (XmlTag)element;
+      XmlElementDescriptor elementDescriptor;
+
+      if (isAttrCompletion && object instanceof String) {
+        elementDescriptor = xmlTag.getDescriptor();
+
+        if (elementDescriptor != null) {
+          final XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor((String)object, xmlTag);
+          if (attributeDescriptor != null) {
+            final PsiElement declaration = attributeDescriptor.getDeclaration();
+            if (declaration != null) return declaration;
+          }
+        }
+      }
+
+      if (object == null) return null;
+      try {
+        @NonNls StringBuffer tagText = new StringBuffer(object.toString());
+        String namespacePrefix = XmlUtil.findPrefixByQualifiedName(object.toString());
+        String namespace = xmlTag.getNamespaceByPrefix(namespacePrefix);
+
+        if (namespace!=null && namespace.length() > 0) {
+          tagText.append(" xmlns");
+          if (namespacePrefix.length() > 0) tagText.append(":").append(namespacePrefix);
+          tagText.append("=\"").append(namespace).append("\"");
+        }
+
+        XmlTag tagFromText = XmlElementFactory.getInstance(xmlTag.getProject()).createTagFromText("<" + tagText +"/>");
+        XmlElementDescriptor parentDescriptor = xmlTag.getDescriptor();
+        elementDescriptor = (parentDescriptor!=null)?parentDescriptor.getElementDescriptor(tagFromText, xmlTag):null;
+
+        if (elementDescriptor==null) {
+          PsiElement parent = xmlTag.getParent();
+          if (parent instanceof XmlTag) {
+            parentDescriptor = ((XmlTag)parent).getDescriptor();
+            elementDescriptor = (parentDescriptor!=null)?parentDescriptor.getElementDescriptor(tagFromText, (XmlTag)parent):null;
+          }
+        }
+
+        if (elementDescriptor instanceof AnyXmlElementDescriptor) {
+          final XmlNSDescriptor nsDescriptor = xmlTag.getNSDescriptor(xmlTag.getNamespaceByPrefix(namespacePrefix), true);
+          elementDescriptor = (nsDescriptor != null)?nsDescriptor.getElementDescriptor(tagFromText):null;
+        }
+
+        // The very special case of xml file
+        final PsiFile containingFile = xmlTag.getContainingFile();
+        final XmlFile xmlFile = XmlUtil.getContainingFile(xmlTag);
+        if (xmlFile != containingFile) {
+          final XmlTag rootTag = xmlFile.getDocument().getRootTag();
+          if (rootTag != null) {
+            final XmlNSDescriptor nsDescriptor = rootTag.getNSDescriptor(rootTag.getNamespaceByPrefix(namespacePrefix), true);
+            elementDescriptor = (nsDescriptor != null) ? nsDescriptor.getElementDescriptor(tagFromText) : null;
+          }
+        }
+
+        if (elementDescriptor != null) {
+          PsiElement declaration = elementDescriptor.getDeclaration();
+          if (declaration!=null) declaration.putUserData(DESCRIPTOR_KEY,elementDescriptor);
+          return declaration;
+        }
+      }
+      catch (IncorrectOperationException e) {
+        LOG.error(e);
+      }
+    }
+
+    if (object instanceof String && originalElement != null) {
+      PsiElement result = findDeclWithName((String)object, originalElement);
+
+      PsiElement originalElementParent;
+      if (result == null && element instanceof XmlTag && (originalElementParent = originalElement.getParent()) instanceof XmlAttributeValue) {
+        PsiElement originalElementGrandParent = originalElementParent.getParent();
+        XmlAttributeDescriptor descriptor = originalElementGrandParent instanceof XmlAttribute ?
+                                            ((XmlAttribute)originalElementGrandParent).getDescriptor():null;
+
+        if (descriptor != null && descriptor.getDeclaration() instanceof XmlTag) {
+          result = findEnumerationValue((String)object, (XmlTag)descriptor.getDeclaration());
+        }
+      }
+      return result;
+    }
+    if (object instanceof XmlElementDescriptor) {
+      return ((XmlElementDescriptor)object).getDeclaration();
+    }
+    return null;
+  }
+
+  public static PsiElement findDeclWithName(final String name, final @NotNull PsiElement element) {
+    final XmlFile containingXmlFile = XmlUtil.getContainingFile(element);
+    final XmlTag nearestTag = PsiTreeUtil.getParentOfType(element, XmlTag.class, false);
+    final XmlFile xmlFile = nearestTag != null? XmlCompletionData.findDescriptorFile(nearestTag, containingXmlFile):containingXmlFile;
+
+    if (xmlFile != null) {
+      final PsiElement[] result = new PsiElement[1];
+
+      XmlUtil.processXmlElements(
+        xmlFile,
+        new PsiElementProcessor() {
+          public boolean execute(@NotNull final PsiElement element) {
+            if (element instanceof XmlEntityDecl) {
+              final XmlEntityDecl entityDecl = (XmlEntityDecl)element;
+              if (entityDecl.isInternalReference() && name.equals(entityDecl.getName())) {
+                result[0] = entityDecl;
+                return false;
+              }
+            } else if (element instanceof XmlElementDecl) {
+              final XmlElementDecl entityDecl = (XmlElementDecl)element;
+              if (name.equals(entityDecl.getName())) {
+                result[0] = entityDecl;
+                return false;
+              }
+            }
+            return true;
+          }
+        },
+        true
+      );
+
+      return result[0];
+    }
+    return null;
+  }
+
+  public PsiElement getDocumentationElementForLink(final PsiManager psiManager, String link, PsiElement context) {
+    return null;
+  }
+
+  private static class MyPsiElementProcessor implements PsiElementProcessor {
+    String result;
+    String version;
+    String url;
+    @NonNls public static final String DOCUMENTATION_ELEMENT_LOCAL_NAME = "documentation";
+    private @NonNls static final String CDATA_PREFIX = "<![CDATA[";
+    private @NonNls static final String CDATA_SUFFIX = "]]>";
+
+    public boolean execute(@NotNull PsiElement element) {
+      if (element instanceof XmlTag &&
+          ((XmlTag)element).getLocalName().equals(DOCUMENTATION_ELEMENT_LOCAL_NAME)
+      ) {
+        final XmlTag tag = ((XmlTag)element);
+        result = tag.getValue().getText().trim();
+        boolean withCData = false;
+
+        if (result.startsWith(CDATA_PREFIX)) {
+          result = result.substring(CDATA_PREFIX.length());
+          withCData = true;
+        }
+
+        if (result.endsWith(CDATA_SUFFIX)) {
+          result = result.substring(0, result.length() - CDATA_SUFFIX.length());
+        }
+        result = result.trim();
+
+        if (withCData) {
+          result = escapeDocumentationTextText(result);
+        }
+
+        final @NonNls String s = tag.getAttributeValue("source");
+        if (s != null) {
+          if (s.startsWith("http:")) url = s;
+          else if ("version".equals(s)) {
+            version = result;
+            result = null;
+            return true;
+          }
+        }
+        return false;
+      }
+      return true;
+    }
+  }
+
+  private static String escapeDocumentationTextText(final String result) {
+    return StringUtil.escapeXml(result).replaceAll("&apos;","'").replaceAll("\n","<br>\n");
+  }
+}
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/attributes.html b/xml/impl/src/com/intellij/xml/util/documentation/attributes.html
new file mode 100644
index 0000000..5a56faa
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/attributes.html
@@ -0,0 +1,2683 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+<!-- $Id: attributes.html,v 1.1 2004/12/24 21:53:29 Maxim.Mossienko Exp $ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Index of the HTML 4 Attributes</title>
+<link rel="previous" href="elements.html">
+<link rel="next" href="list.html">
+<link rel="contents" href="../cover.html#toc">
+<link rel="stylesheet" type="text/css" href= 
+"http://www.w3.org/StyleSheets/TR/W3C-REC">
+<link rel="STYLESHEET" href="../style/default.css" type="text/css">
+</head>
+<body>
+<div class="navbar" align="center">&nbsp;<a href="elements.html">previous</a>
+&nbsp; <a href="list.html">next</a> &nbsp; <a href="../cover.html#minitoc">
+contents</a> &nbsp; <a href="elements.html">elements</a> &nbsp; <a href= 
+"list.html">index</a> 
+
+<hr></div>
+
+<h1 align="center">Index of Attributes<a name="h-3">&nbsp;</a></h1>
+
+<p><em>Legend: <b>D</b>eprecated, <b>L</b>oose DTD, <b>F</b>rameset
+DTD</em></p>
+
+<table summary="Attribute index. Columns are: name, related elements, type of 
+value, default value, deprecated, which DTD, and comment" border="1" align= 
+"center">
+<tr align="center">
+<th>Name</th>
+<th>Related Elements</th>
+<th>Type</th>
+<th>Default</th>
+<th>Depr.</th>
+<th>DTD</th>
+<th>Comment</th>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-abbr">abbr</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Text">%Text;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">abbreviation for header cell</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-accept-charset">
+accept-charset</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-FORM" class="noxref">FORM</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Charsets">
+%Charsets;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">list of supported charsets</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-accept">accept</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-FORM" class="noxref">FORM</a>, <a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#ContentTypes">
+%ContentTypes;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">list of MIME types for file upload</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-accesskey">
+accesskey</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a>, <a href= 
+"../struct/objects.html#edef-AREA" class="noxref">AREA</a>, <a href= 
+"../interact/forms.html#edef-BUTTON" class="noxref">BUTTON</a>, <a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a>, <a href= 
+"../interact/forms.html#edef-LABEL" class="noxref">LABEL</a>, <a href= 
+"../interact/forms.html#edef-LEGEND" class="noxref">LEGEND</a>, <a href= 
+"../interact/forms.html#edef-TEXTAREA" class="noxref">TEXTAREA</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Character">
+%Character;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">accessibility key character</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-action">action</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-FORM" class="noxref">FORM</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">server-side form handler</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-align-CAPTION">
+align</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-CAPTION" class="noxref">CAPTION</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#CAlign">
+%CAlign;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">relative to table</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-align-IMG">align</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a>, <a href= 
+"../struct/objects.html#edef-IMG" class="noxref">IMG</a>, <a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a>, <a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#IAlign">
+%IAlign;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">vertical or horizontal alignment</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-align-LEGEND">
+align</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-LEGEND" class="noxref">LEGEND</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#LAlign">
+%LAlign;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">relative to fieldset</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-align-TABLE">
+align</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TABLE" class="noxref">TABLE</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#TAlign">
+%TAlign;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">table position relative to window</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-align-HR">
+align</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/graphics.html#edef-HR" class="noxref">HR</a></td>
+<td align="center" title="Type">(left | center | right)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">&nbsp;</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-align">align</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-DIV" class="noxref">DIV</a>, <a href= 
+"../struct/global.html#edef-H1" class="noxref">H1</a>, <a href= 
+"../struct/global.html#edef-H2" class="noxref">H2</a>, <a href= 
+"../struct/global.html#edef-H3" class="noxref">H3</a>, <a href= 
+"../struct/global.html#edef-H4" class="noxref">H4</a>, <a href= 
+"../struct/global.html#edef-H5" class="noxref">H5</a>, <a href= 
+"../struct/global.html#edef-H6" class="noxref">H6</a>, <a href= 
+"../struct/text.html#edef-P" class="noxref">P</a></td>
+<td align="center" title="Type">(left | center | right | justify)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">align, text alignment</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-align-TD">align</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-COL" class="noxref">COL</a>, <a href= 
+"../struct/tables.html#edef-COLGROUP" class="noxref">COLGROUP</a>, <a href= 
+"../struct/tables.html#edef-TBODY" class="noxref">TBODY</a>, <a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TFOOT" class="noxref">TFOOT</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a>, <a href= 
+"../struct/tables.html#edef-THEAD" class="noxref">THEAD</a>, <a href= 
+"../struct/tables.html#edef-TR" class="noxref">TR</a></td>
+<td align="center" title="Type">(left | center | right | justify | char)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">&nbsp;</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-alink">alink</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-BODY" class="noxref">BODY</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Color">
+%Color;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">color of selected links</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-alt">alt</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Text">
+%Text;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">short description</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-alt">alt</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-AREA" class="noxref">AREA</a>, <a href= 
+"../struct/objects.html#edef-IMG" class="noxref">IMG</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Text">%Text;</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">short description</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-alt">alt</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">short description</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-archive-APPLET">
+archive</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">comma-separated archive list</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-archive-OBJECT">
+archive</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">space-separated list of URIs</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-axis">axis</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">comma-separated list of related headers</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-background">
+background</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-BODY" class="noxref">BODY</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#URI">
+%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">texture tile for document background</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-bgcolor">
+bgcolor</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TABLE" class="noxref">TABLE</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Color">
+%Color;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">background color for cells</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-bgcolor">
+bgcolor</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TR" class="noxref">TR</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Color">
+%Color;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">background color for row</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-bgcolor">
+bgcolor</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Color">
+%Color;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">cell background color</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-bgcolor">
+bgcolor</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-BODY" class="noxref">BODY</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Color">
+%Color;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">document background color</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-border-TABLE">
+border</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TABLE" class="noxref">TABLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Pixels">
+%Pixels;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">controls frame width around table</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-border-IMG">
+border</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-IMG" class="noxref">IMG</a>, <a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Pixels">
+%Pixels;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">link border width</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-cellpadding">
+cellpadding</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TABLE" class="noxref">TABLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Length">
+%Length;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">spacing within cells</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-cellspacing">
+cellspacing</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TABLE" class="noxref">TABLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Length">
+%Length;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">spacing between cells</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-char">char</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-COL" class="noxref">COL</a>, <a href= 
+"../struct/tables.html#edef-COLGROUP" class="noxref">COLGROUP</a>, <a href= 
+"../struct/tables.html#edef-TBODY" class="noxref">TBODY</a>, <a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TFOOT" class="noxref">TFOOT</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a>, <a href= 
+"../struct/tables.html#edef-THEAD" class="noxref">THEAD</a>, <a href= 
+"../struct/tables.html#edef-TR" class="noxref">TR</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Character">
+%Character;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">alignment char, e.g. char=':'</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-charoff">charoff</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-COL" class="noxref">COL</a>, <a href= 
+"../struct/tables.html#edef-COLGROUP" class="noxref">COLGROUP</a>, <a href= 
+"../struct/tables.html#edef-TBODY" class="noxref">TBODY</a>, <a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TFOOT" class="noxref">TFOOT</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a>, <a href= 
+"../struct/tables.html#edef-THEAD" class="noxref">THEAD</a>, <a href= 
+"../struct/tables.html#edef-TR" class="noxref">TR</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Length">
+%Length;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">offset for alignment char</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/links.html#adef-charset">charset</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a>, <a href= 
+"../struct/links.html#edef-LINK" class="noxref">LINK</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Charset">
+%Charset;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">char encoding of linked resource</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-checked">checked</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a></td>
+<td align="center" title="Type">(checked)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">for radio buttons and check boxes</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#adef-cite-Q">cite</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/text.html#edef-BLOCKQUOTE" class="noxref">BLOCKQUOTE</a>, <a href= 
+"../struct/text.html#edef-Q" class="noxref">Q</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">URI for source document or msg</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#adef-cite-INS">cite</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/text.html#edef-del" class="noxref">DEL</a>, <a href= 
+"../struct/text.html#edef-ins" class="noxref">INS</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">info on reason for change</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-class">class</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href="../struct/links.html#edef-BASE"
+class="noxref">BASE</a>, <a href="../present/graphics.html#edef-BASEFONT"
+class="noxref">BASEFONT</a>, <a href="../struct/global.html#edef-HEAD" class= 
+"noxref">HEAD</a>, <a href="../struct/global.html#edef-HTML" class="noxref">
+HTML</a>, <a href="../struct/global.html#edef-META" class="noxref">META</a>, <a
+href="../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">space-separated list of classes</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-classid">classid</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">identifies an implementation</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-clear">clear</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/text.html#edef-BR" class="noxref">BR</a></td>
+<td align="center" title="Type">(left | all | right | none)</td>
+<td align="center" title="Default">none</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">control of text flow</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-code">code</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">applet class file</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-codebase-OBJECT">
+codebase</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">base URI for classid, data, archive</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-codebase-APPLET">
+codebase</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#URI">
+%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">optional base URI for applet</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-codetype">
+codetype</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#ContentType">
+%ContentType;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">content type for code</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-color-FONT">
+color</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../present/graphics.html#edef-FONT" class="noxref">FONT</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Color">
+%Color;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">text color</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#adef-cols-FRAMESET">
+cols</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#MultiLengths">
+%MultiLengths;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Comment">list of lengths, default: 100% (1 col)</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-cols-TEXTAREA">
+cols</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-TEXTAREA" class="noxref">TEXTAREA</a></td>
+<td align="center" title="Type"><a href="../types.html#type-number">
+NUMBER</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">&nbsp;</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-colspan">colspan</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a></td>
+<td align="center" title="Type"><a href="../types.html#type-number">
+NUMBER</a></td>
+<td align="center" title="Default">1</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">number of cols spanned by cell</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#adef-compact">compact</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/lists.html#edef-DIR" class="noxref">DIR</a>, <a href= 
+"../struct/lists.html#edef-DL" class="noxref">DL</a>, <a href= 
+"../struct/lists.html#edef-MENU" class="noxref">MENU</a>, <a href= 
+"../struct/lists.html#edef-OL" class="noxref">OL</a>, <a href= 
+"../struct/lists.html#edef-UL" class="noxref">UL</a></td>
+<td align="center" title="Type">(compact)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">reduced interitem spacing</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-content">content</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-META" class="noxref">META</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">associated information</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-coords">coords</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-AREA" class="noxref">AREA</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Coords">
+%Coords;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">comma-separated list of lengths</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-coords">coords</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Coords">
+%Coords;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">for use with client-side image maps</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-data">data</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">reference to object's data</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#adef-datetime">datetime</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/text.html#edef-del" class="noxref">DEL</a>, <a href= 
+"../struct/text.html#edef-ins" class="noxref">INS</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Datetime">
+%Datetime;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">date and time of change</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-declare">declare</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type">(declare)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">declare but don't instantiate flag</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-defer">defer</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a></td>
+<td align="center" title="Type">(defer)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">UA may defer execution of script</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/dirlang.html#adef-dir">dir</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href=
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a>, <a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../struct/dirlang.html#edef-BDO" class="noxref">BDO</a>, <a href= 
+"../struct/text.html#edef-BR" class="noxref">BR</a>, <a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a>, <a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a></td>
+<td align="center" title="Type">(ltr | rtl)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">direction for weak/neutral text</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/dirlang.html#adef-dir-BDO">dir</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/dirlang.html#edef-BDO" class="noxref">BDO</a></td>
+<td align="center" title="Type">(ltr | rtl)</td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">directionality</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-disabled">
+disabled</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-BUTTON" class="noxref">BUTTON</a>, <a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a>, <a href= 
+"../interact/forms.html#edef-OPTGROUP" class="noxref">OPTGROUP</a>, <a href= 
+"../interact/forms.html#edef-OPTION" class="noxref">OPTION</a>, <a href= 
+"../interact/forms.html#edef-SELECT" class="noxref">SELECT</a>, <a href= 
+"../interact/forms.html#edef-TEXTAREA" class="noxref">TEXTAREA</a></td>
+<td align="center" title="Type">(disabled)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">unavailable in this context</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-enctype">enctype</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-FORM" class="noxref">FORM</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#ContentType">
+%ContentType;</a></td>
+<td align="center" title="Default">"application/x-www- form-urlencoded"</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">&nbsp;</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-face-FONT">
+face</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../present/graphics.html#edef-FONT" class="noxref">FONT</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">comma-separated list of font names</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-for">for</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-LABEL" class="noxref">LABEL</a></td>
+<td align="center" title="Type"><a href="../types.html#type-idref">
+IDREF</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">matches field ID value</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-frame">frame</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TABLE" class="noxref">TABLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#TFrame">
+%TFrame;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">which parts of frame to render</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#adef-frameborder">
+frameborder</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a></td>
+<td align="center" title="Type">(1 | 0)</td>
+<td align="center" title="Default">1</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Comment">request frame borders?</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-headers">headers</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a></td>
+<td align="center" title="Type"><a href="../types.html#type-idrefs">
+IDREFS</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">list of id's for header cells</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#adef-height-IFRAME">
+height</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Length">
+%Length;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">frame height</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-height-TH">height</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Length">
+%Length;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">height for cell</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-height-IMG">
+height</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-IMG" class="noxref">IMG</a>, <a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Length">
+%Length;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">override height</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-height-APPLET">
+height</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Length">
+%Length;</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">initial height</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/links.html#adef-href">href</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a>, <a href= 
+"../struct/objects.html#edef-AREA" class="noxref">AREA</a>, <a href= 
+"../struct/links.html#edef-LINK" class="noxref">LINK</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">URI for linked resource</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/links.html#adef-href-BASE">href</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">URI that acts as base URI</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/links.html#adef-hreflang">hreflang</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a>, <a href= 
+"../struct/links.html#edef-LINK" class="noxref">LINK</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#LanguageCode">
+%LanguageCode;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">language code</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-hspace">hspace</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/objects.html#edef-IMG" class="noxref">IMG</a>, <a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Pixels">
+%Pixels;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">horizontal gutter</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-http-equiv">
+http-equiv</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-META" class="noxref">META</a></td>
+<td align="center" title="Type"><a href="../types.html#type-name">NAME</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">HTTP response header name</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-id">id</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href="../struct/links.html#edef-BASE"
+class="noxref">BASE</a>, <a href="../struct/global.html#edef-HEAD" class=
+"noxref">HEAD</a>, <a href="../struct/global.html#edef-HTML" class="noxref">
+HTML</a>, <a href="../struct/global.html#edef-META" class="noxref">META</a>, <a
+href="../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../types.html#type-id">ID</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">document-wide unique id</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-ismap">ismap</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-IMG" class="noxref">IMG</a>, <a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a></td>
+<td align="center" title="Type">(ismap)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">use server-side image map</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-label-OPTION">
+label</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-OPTION" class="noxref">OPTION</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Text">%Text;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">for use in hierarchical menus</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-label-OPTGROUP">
+label</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-OPTGROUP" class="noxref">OPTGROUP</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Text">%Text;</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">for use in hierarchical menus</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/dirlang.html#adef-lang">lang</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href=
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a>, <a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../struct/text.html#edef-BR" class="noxref">BR</a>, <a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a>, <a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#LanguageCode">
+%LanguageCode;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">language code</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-language">
+language</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">predefined script language name</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-link">link</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-BODY" class="noxref">BODY</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Color">
+%Color;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">color of links</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-longdesc-IMG">
+longdesc</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-IMG" class="noxref">IMG</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">link to long description (complements
+alt)</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#adef-longdesc-FRAME">
+longdesc</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Comment">link to long description (complements
+title)</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#adef-marginheight">
+marginheight</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Pixels">
+%Pixels;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Comment">margin height in pixels</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#adef-marginwidth">
+marginwidth</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Pixels">
+%Pixels;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Comment">margin widths in pixels</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-maxlength">
+maxlength</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a></td>
+<td align="center" title="Type"><a href="../types.html#type-number">
+NUMBER</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">max chars for text fields</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/styles.html#adef-media">media</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#MediaDesc">
+%MediaDesc;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">designed for use with these media</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/styles.html#adef-media">media</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/links.html#edef-LINK" class="noxref">LINK</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#MediaDesc">
+%MediaDesc;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">for rendering on these media</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-method">method</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-FORM" class="noxref">FORM</a></td>
+<td align="center" title="Type">(GET | POST)</td>
+<td align="center" title="Default">GET</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">HTTP method used to submit the form</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-multiple">
+multiple</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-SELECT" class="noxref">SELECT</a></td>
+<td align="center" title="Type">(multiple)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">default is single selection</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-name-BUTTON">
+name</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-BUTTON" class="noxref">BUTTON</a>, <a href= 
+"../interact/forms.html#edef-TEXTAREA" class="noxref">TEXTAREA</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">&nbsp;</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-name-APPLET">
+name</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">allows applets to find each other</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-name-SELECT">
+name</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-SELECT" class="noxref">SELECT</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">field name</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-name-FORM">name</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-FORM" class="noxref">FORM</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">name of form for scripting</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#adef-name-FRAME">name</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Comment">name of frame for targetting</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-name-IMG">name</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-IMG" class="noxref">IMG</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">name of image for scripting</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/links.html#adef-name-A">name</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">named link end</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-name-INPUT">name</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a>, <a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">submit as part of form</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-name-MAP">name</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-MAP" class="noxref">MAP</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">for reference by usemap</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-name-PARAM">name</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">property name</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-name-META">name</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-META" class="noxref">META</a></td>
+<td align="center" title="Type"><a href="../types.html#type-name">NAME</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">metainformation name</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-nohref">nohref</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-AREA" class="noxref">AREA</a></td>
+<td align="center" title="Type">(nohref)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">this region has no action</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#adef-noresize">
+noresize</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a></td>
+<td align="center" title="Type">(noresize)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Comment">allow users to resize frames?</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-noshade">
+noshade</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/graphics.html#edef-HR" class="noxref">HR</a></td>
+<td align="center" title="Type">(noshade)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">&nbsp;</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-nowrap">nowrap</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a></td>
+<td align="center" title="Type">(nowrap)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">suppress word wrap</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-object">object</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">serialized applet file</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onblur">onblur</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a>, <a href= 
+"../struct/objects.html#edef-AREA" class="noxref">AREA</a>, <a href= 
+"../interact/forms.html#edef-BUTTON" class="noxref">BUTTON</a>, <a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a>, <a href= 
+"../interact/forms.html#edef-LABEL" class="noxref">LABEL</a>, <a href= 
+"../interact/forms.html#edef-SELECT" class="noxref">SELECT</a>, <a href= 
+"../interact/forms.html#edef-TEXTAREA" class="noxref">TEXTAREA</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">the element lost the focus</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onchange">
+onchange</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a>, <a href= 
+"../interact/forms.html#edef-SELECT" class="noxref">SELECT</a>, <a href= 
+"../interact/forms.html#edef-TEXTAREA" class="noxref">TEXTAREA</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">the element value was changed</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onclick">
+onclick</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href=
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a>, <a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../struct/dirlang.html#edef-BDO" class="noxref">BDO</a>, <a href= 
+"../struct/text.html#edef-BR" class="noxref">BR</a>, <a href= 
+"../present/graphics.html#edef-FONT" class="noxref">FONT</a>, <a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a>, <a href= 
+"../struct/global.html#edef-HEAD" class="noxref">HEAD</a>, <a href= 
+"../struct/global.html#edef-HTML" class="noxref">HTML</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a>, <a href= 
+"../interact/forms.html#edef-ISINDEX" class="noxref">ISINDEX</a>, <a href= 
+"../struct/global.html#edef-META" class="noxref">META</a>, <a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">a pointer button was clicked</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-ondblclick">
+ondblclick</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href=
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a>, <a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../struct/dirlang.html#edef-BDO" class="noxref">BDO</a>, <a href= 
+"../struct/text.html#edef-BR" class="noxref">BR</a>, <a href= 
+"../present/graphics.html#edef-FONT" class="noxref">FONT</a>, <a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a>, <a href= 
+"../struct/global.html#edef-HEAD" class="noxref">HEAD</a>, <a href= 
+"../struct/global.html#edef-HTML" class="noxref">HTML</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a>, <a href= 
+"../interact/forms.html#edef-ISINDEX" class="noxref">ISINDEX</a>, <a href= 
+"../struct/global.html#edef-META" class="noxref">META</a>, <a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">a pointer button was double clicked</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onfocus">
+onfocus</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a>, <a href= 
+"../struct/objects.html#edef-AREA" class="noxref">AREA</a>, <a href= 
+"../interact/forms.html#edef-BUTTON" class="noxref">BUTTON</a>, <a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a>, <a href= 
+"../interact/forms.html#edef-LABEL" class="noxref">LABEL</a>, <a href= 
+"../interact/forms.html#edef-SELECT" class="noxref">SELECT</a>, <a href= 
+"../interact/forms.html#edef-TEXTAREA" class="noxref">TEXTAREA</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">the element got the focus</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onkeydown">
+onkeydown</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href=
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a>, <a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../struct/dirlang.html#edef-BDO" class="noxref">BDO</a>, <a href= 
+"../struct/text.html#edef-BR" class="noxref">BR</a>, <a href= 
+"../present/graphics.html#edef-FONT" class="noxref">FONT</a>, <a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a>, <a href= 
+"../struct/global.html#edef-HEAD" class="noxref">HEAD</a>, <a href= 
+"../struct/global.html#edef-HTML" class="noxref">HTML</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a>, <a href= 
+"../interact/forms.html#edef-ISINDEX" class="noxref">ISINDEX</a>, <a href= 
+"../struct/global.html#edef-META" class="noxref">META</a>, <a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">a key was pressed down</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onkeypress">
+onkeypress</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href=
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a>, <a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../struct/dirlang.html#edef-BDO" class="noxref">BDO</a>, <a href= 
+"../struct/text.html#edef-BR" class="noxref">BR</a>, <a href= 
+"../present/graphics.html#edef-FONT" class="noxref">FONT</a>, <a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a>, <a href= 
+"../struct/global.html#edef-HEAD" class="noxref">HEAD</a>, <a href= 
+"../struct/global.html#edef-HTML" class="noxref">HTML</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a>, <a href= 
+"../interact/forms.html#edef-ISINDEX" class="noxref">ISINDEX</a>, <a href= 
+"../struct/global.html#edef-META" class="noxref">META</a>, <a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">a key was pressed and released</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onkeyup">
+onkeyup</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href=
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a>, <a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../struct/dirlang.html#edef-BDO" class="noxref">BDO</a>, <a href= 
+"../struct/text.html#edef-BR" class="noxref">BR</a>, <a href= 
+"../present/graphics.html#edef-FONT" class="noxref">FONT</a>, <a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a>, <a href= 
+"../struct/global.html#edef-HEAD" class="noxref">HEAD</a>, <a href= 
+"../struct/global.html#edef-HTML" class="noxref">HTML</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a>, <a href= 
+"../interact/forms.html#edef-ISINDEX" class="noxref">ISINDEX</a>, <a href= 
+"../struct/global.html#edef-META" class="noxref">META</a>, <a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">a key was released</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onload">onload</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Comment">all the frames have been loaded</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onload">onload</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-BODY" class="noxref">BODY</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">the document has been loaded</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onmousedown">
+onmousedown</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href=
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a>, <a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../struct/dirlang.html#edef-BDO" class="noxref">BDO</a>, <a href= 
+"../struct/text.html#edef-BR" class="noxref">BR</a>, <a href= 
+"../present/graphics.html#edef-FONT" class="noxref">FONT</a>, <a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a>, <a href= 
+"../struct/global.html#edef-HEAD" class="noxref">HEAD</a>, <a href= 
+"../struct/global.html#edef-HTML" class="noxref">HTML</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a>, <a href= 
+"../interact/forms.html#edef-ISINDEX" class="noxref">ISINDEX</a>, <a href= 
+"../struct/global.html#edef-META" class="noxref">META</a>, <a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">a pointer button was pressed down</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onmousemove">
+onmousemove</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href=
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a>, <a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../struct/dirlang.html#edef-BDO" class="noxref">BDO</a>, <a href= 
+"../struct/text.html#edef-BR" class="noxref">BR</a>, <a href= 
+"../present/graphics.html#edef-FONT" class="noxref">FONT</a>, <a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a>, <a href= 
+"../struct/global.html#edef-HEAD" class="noxref">HEAD</a>, <a href= 
+"../struct/global.html#edef-HTML" class="noxref">HTML</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a>, <a href= 
+"../interact/forms.html#edef-ISINDEX" class="noxref">ISINDEX</a>, <a href= 
+"../struct/global.html#edef-META" class="noxref">META</a>, <a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">a pointer was moved within</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onmouseout">
+onmouseout</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href=
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a>, <a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../struct/dirlang.html#edef-BDO" class="noxref">BDO</a>, <a href= 
+"../struct/text.html#edef-BR" class="noxref">BR</a>, <a href= 
+"../present/graphics.html#edef-FONT" class="noxref">FONT</a>, <a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a>, <a href= 
+"../struct/global.html#edef-HEAD" class="noxref">HEAD</a>, <a href= 
+"../struct/global.html#edef-HTML" class="noxref">HTML</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a>, <a href= 
+"../interact/forms.html#edef-ISINDEX" class="noxref">ISINDEX</a>, <a href= 
+"../struct/global.html#edef-META" class="noxref">META</a>, <a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">a pointer was moved away</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onmouseover">
+onmouseover</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href=
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a>, <a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../struct/dirlang.html#edef-BDO" class="noxref">BDO</a>, <a href= 
+"../struct/text.html#edef-BR" class="noxref">BR</a>, <a href= 
+"../present/graphics.html#edef-FONT" class="noxref">FONT</a>, <a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a>, <a href= 
+"../struct/global.html#edef-HEAD" class="noxref">HEAD</a>, <a href= 
+"../struct/global.html#edef-HTML" class="noxref">HTML</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a>, <a href= 
+"../interact/forms.html#edef-ISINDEX" class="noxref">ISINDEX</a>, <a href= 
+"../struct/global.html#edef-META" class="noxref">META</a>, <a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">a pointer was moved onto</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onmouseup">
+onmouseup</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href=
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a>, <a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a>, <a href= 
+"../struct/dirlang.html#edef-BDO" class="noxref">BDO</a>, <a href= 
+"../struct/text.html#edef-BR" class="noxref">BR</a>, <a href= 
+"../present/graphics.html#edef-FONT" class="noxref">FONT</a>, <a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a>, <a href= 
+"../struct/global.html#edef-HEAD" class="noxref">HEAD</a>, <a href= 
+"../struct/global.html#edef-HTML" class="noxref">HTML</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a>, <a href= 
+"../interact/forms.html#edef-ISINDEX" class="noxref">ISINDEX</a>, <a href= 
+"../struct/global.html#edef-META" class="noxref">META</a>, <a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">a pointer button was released</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onreset">
+onreset</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-FORM" class="noxref">FORM</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">the form was reset</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onselect">
+onselect</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a>, <a href= 
+"../interact/forms.html#edef-TEXTAREA" class="noxref">TEXTAREA</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">some text was selected</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onsubmit">
+onsubmit</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-FORM" class="noxref">FORM</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">the form was submitted</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onunload">
+onunload</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Comment">all the frames have been removed</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-onunload">
+onunload</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-BODY" class="noxref">BODY</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Script">
+%Script;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">the document has been removed</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-profile">profile</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-HEAD" class="noxref">HEAD</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">named dictionary of meta info</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-prompt">prompt</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-ISINDEX" class="noxref">ISINDEX</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Text">
+%Text;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">prompt message</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-readonly">
+readonly</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-TEXTAREA" class="noxref">TEXTAREA</a></td>
+<td align="center" title="Type">(readonly)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">&nbsp;</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-readonly">
+readonly</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a></td>
+<td align="center" title="Type">(readonly)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">for text and passwd</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/links.html#adef-rel">rel</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a>, <a href= 
+"../struct/links.html#edef-LINK" class="noxref">LINK</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#LinkTypes">
+%LinkTypes;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">forward link types</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/links.html#adef-rev">rev</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a>, <a href= 
+"../struct/links.html#edef-LINK" class="noxref">LINK</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#LinkTypes">
+%LinkTypes;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">reverse link types</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#adef-rows-FRAMESET">
+rows</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-FRAMESET" class="noxref">FRAMESET</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#MultiLengths">
+%MultiLengths;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Comment">list of lengths, default: 100% (1 row)</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-rows-TEXTAREA">
+rows</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-TEXTAREA" class="noxref">TEXTAREA</a></td>
+<td align="center" title="Type"><a href="../types.html#type-number">
+NUMBER</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">&nbsp;</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-rowspan">rowspan</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a></td>
+<td align="center" title="Type"><a href="../types.html#type-number">
+NUMBER</a></td>
+<td align="center" title="Default">1</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">number of rows spanned by cell</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-rules">rules</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TABLE" class="noxref">TABLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#TRules">
+%TRules;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">rulings between rows and cols</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-scheme">scheme</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-META" class="noxref">META</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">select form of content</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-scope">scope</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Scope">
+%Scope;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">scope covered by header cells</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#adef-scrolling">
+scrolling</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a></td>
+<td align="center" title="Type">(yes | no | auto)</td>
+<td align="center" title="Default">auto</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Comment">scrollbar or none</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-selected">
+selected</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-OPTION" class="noxref">OPTION</a></td>
+<td align="center" title="Type">(selected)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">&nbsp;</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-shape">shape</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-AREA" class="noxref">AREA</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Shape">
+%Shape;</a></td>
+<td align="center" title="Default">rect</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">controls interpretation of coords</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-shape">shape</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Shape">
+%Shape;</a></td>
+<td align="center" title="Default">rect</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">for use with client-side image maps</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-size-HR">size</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/graphics.html#edef-HR" class="noxref">HR</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Pixels">
+%Pixels;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">&nbsp;</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-size-FONT">
+size</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/graphics.html#edef-FONT" class="noxref">FONT</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">[+|-]nn e.g. size="+1", size="4"</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-size-INPUT">size</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">specific to each type of field</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-size-BASEFONT">
+size</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/graphics.html#edef-BASEFONT" class="noxref">BASEFONT</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">base font size for FONT elements</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-size-SELECT">
+size</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-SELECT" class="noxref">SELECT</a></td>
+<td align="center" title="Type"><a href="../types.html#type-number">
+NUMBER</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">rows visible</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-span-COL">span</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-COL" class="noxref">COL</a></td>
+<td align="center" title="Type"><a href="../types.html#type-number">
+NUMBER</a></td>
+<td align="center" title="Default">1</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">COL attributes affect N columns</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-span-COLGROUP">
+span</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-COLGROUP" class="noxref">COLGROUP</a></td>
+<td align="center" title="Type"><a href="../types.html#type-number">
+NUMBER</a></td>
+<td align="center" title="Default">1</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">default number of columns in group</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-src-SCRIPT">
+src</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">URI for an external script</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-src">src</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">for fields with images</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#adef-src-FRAME">src</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-FRAME" class="noxref">FRAME</a>, <a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Comment">source of frame content</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-src-IMG">src</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-IMG" class="noxref">IMG</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">URI of image to embed</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-standby">standby</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Text">%Text;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">message to show while loading</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#adef-start">start</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/lists.html#edef-OL" class="noxref">OL</a></td>
+<td align="center" title="Type"><a href="../types.html#type-number">
+NUMBER</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">starting sequence number</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/styles.html#adef-style">style</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href="../struct/links.html#edef-BASE"
+class="noxref">BASE</a>, <a href="../present/graphics.html#edef-BASEFONT"
+class="noxref">BASEFONT</a>, <a href="../struct/global.html#edef-HEAD" class= 
+"noxref">HEAD</a>, <a href="../struct/global.html#edef-HTML" class="noxref">
+HTML</a>, <a href="../struct/global.html#edef-META" class="noxref">META</a>, <a
+href="../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#StyleSheet">
+%StyleSheet;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">associated style info</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-summary">summary</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TABLE" class="noxref">TABLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Text">%Text;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">purpose/structure for speech output</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-tabindex">
+tabindex</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a>, <a href= 
+"../struct/objects.html#edef-AREA" class="noxref">AREA</a>, <a href= 
+"../interact/forms.html#edef-BUTTON" class="noxref">BUTTON</a>, <a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a>, <a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a>, <a href= 
+"../interact/forms.html#edef-SELECT" class="noxref">SELECT</a>, <a href= 
+"../interact/forms.html#edef-TEXTAREA" class="noxref">TEXTAREA</a></td>
+<td align="center" title="Type"><a href="../types.html#type-number">
+NUMBER</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">position in tabbing order</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#adef-target">target</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a>, <a href= 
+"../struct/objects.html#edef-AREA" class="noxref">AREA</a>, <a href= 
+"../struct/links.html#edef-BASE" class="noxref">BASE</a>, <a href= 
+"../interact/forms.html#edef-FORM" class="noxref">FORM</a>, <a href= 
+"../struct/links.html#edef-LINK" class="noxref">LINK</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#FrameTarget">
+%FrameTarget;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">render in this frame</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-text">text</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-BODY" class="noxref">BODY</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Color">
+%Color;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">document text color</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-title">title</a></td>
+<td align="center" title="Related Elements"><a href="../index/elements.html"
+class="noxref">All elements</a> but <a href="../struct/links.html#edef-BASE"
+class="noxref">BASE</a>, <a href="../present/graphics.html#edef-BASEFONT"
+class="noxref">BASEFONT</a>, <a href="../struct/global.html#edef-HEAD" class= 
+"noxref">HEAD</a>, <a href="../struct/global.html#edef-HTML" class="noxref">
+HTML</a>, <a href="../struct/global.html#edef-META" class="noxref">META</a>, <a
+href="../struct/objects.html#edef-PARAM" class="noxref">PARAM</a>, <a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a>, <a href= 
+"../struct/global.html#edef-TITLE" class="noxref">TITLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Text">%Text;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">advisory title</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/links.html#adef-type-A">type</a></td>
+<td align="center" title="Related Elements"><a href=
+"../struct/links.html#edef-A" class="noxref">A</a>, <a href= 
+"../struct/links.html#edef-LINK" class="noxref">LINK</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#ContentType">
+%ContentType;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">advisory content type</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-type-OBJECT">
+type</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#ContentType">
+%ContentType;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">content type for data</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-type-PARAM">type</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#ContentType">
+%ContentType;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">content type for value when
+valuetype=ref</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#adef-type-SCRIPT">
+type</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/scripts.html#edef-SCRIPT" class="noxref">SCRIPT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#ContentType">
+%ContentType;</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">content type of script language</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/styles.html#adef-type-STYLE">type</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/styles.html#edef-STYLE" class="noxref">STYLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#ContentType">
+%ContentType;</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">content type of style language</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-type-INPUT">type</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#InputType">
+%InputType;</a></td>
+<td align="center" title="Default">TEXT</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">what kind of widget is needed</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#adef-type-LI">type</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/lists.html#edef-LI" class="noxref">LI</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#LIStyle">
+%LIStyle;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">list item style</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#adef-type-OL">type</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/lists.html#edef-OL" class="noxref">OL</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#OLStyle">
+%OLStyle;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">numbering style</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#adef-type-UL">type</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/lists.html#edef-UL" class="noxref">UL</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#ULStyle">
+%ULStyle;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">bullet style</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-type-BUTTON">
+type</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-BUTTON" class="noxref">BUTTON</a></td>
+<td align="center" title="Type">(button | submit | reset)</td>
+<td align="center" title="Default">submit</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">for use as form button</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-usemap">usemap</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-IMG" class="noxref">IMG</a>, <a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a>, <a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#URI">%URI;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">use client-side image map</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-valign">valign</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-COL" class="noxref">COL</a>, <a href= 
+"../struct/tables.html#edef-COLGROUP" class="noxref">COLGROUP</a>, <a href= 
+"../struct/tables.html#edef-TBODY" class="noxref">TBODY</a>, <a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TFOOT" class="noxref">TFOOT</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a>, <a href= 
+"../struct/tables.html#edef-THEAD" class="noxref">THEAD</a>, <a href= 
+"../struct/tables.html#edef-TR" class="noxref">TR</a></td>
+<td align="center" title="Type">(top | middle | bottom | baseline)</td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">vertical alignment in cells</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-value-INPUT">
+value</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-INPUT" class="noxref">INPUT</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">Specify for radio buttons and
+checkboxes</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-value-OPTION">
+value</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-OPTION" class="noxref">OPTION</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">defaults to element content</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-value-PARAM">
+value</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">property value</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#adef-value-BUTTON">
+value</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../interact/forms.html#edef-BUTTON" class="noxref">BUTTON</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">sent to server when submitted</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#adef-value-LI">value</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/lists.html#edef-LI" class="noxref">LI</a></td>
+<td align="center" title="Type"><a href="../types.html#type-number">
+NUMBER</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">reset sequence number</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-valuetype">
+valuetype</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-PARAM" class="noxref">PARAM</a></td>
+<td align="center" title="Type">(DATA | REF | OBJECT)</td>
+<td align="center" title="Default">DATA</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">How to interpret value</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-version">version</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-HTML" class="noxref">HTML</a></td>
+<td align="center" title="Type"><a href="../types.html#type-cdata">
+CDATA</a></td>
+<td align="center" title="Default"><a href=
+"../sgml/loosedtd.html#HTML.Version">%HTML.Version;</a></td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">Constant</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#adef-vlink">vlink</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/global.html#edef-BODY" class="noxref">BODY</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Color">
+%Color;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">color of visited links</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-vspace">vspace</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a>, <a href= 
+"../struct/objects.html#edef-IMG" class="noxref">IMG</a>, <a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Pixels">
+%Pixels;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">vertical gutter</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#adef-width-HR">
+width</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/graphics.html#edef-HR" class="noxref">HR</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Length">
+%Length;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">&nbsp;</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#adef-width-IFRAME">
+width</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../present/frames.html#edef-IFRAME" class="noxref">IFRAME</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Length">
+%Length;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">frame width</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-width-IMG">width</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-IMG" class="noxref">IMG</a>, <a href= 
+"../struct/objects.html#edef-OBJECT" class="noxref">OBJECT</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Length">
+%Length;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">override width</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-width-TABLE">
+width</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TABLE" class="noxref">TABLE</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#Length">
+%Length;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">table width</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-width-TH">width</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-TD" class="noxref">TD</a>, <a href= 
+"../struct/tables.html#edef-TH" class="noxref">TH</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Length">
+%Length;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">width for cell</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#adef-width-APPLET">
+width</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/objects.html#edef-APPLET" class="noxref">APPLET</a></td>
+<td align="center" title="Type"><a href="../sgml/loosedtd.html#Length">
+%Length;</a></td>
+<td align="center" title="Default">#REQUIRED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">initial width</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-width-COL">width</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-COL" class="noxref">COL</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#MultiLength">
+%MultiLength;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">column width specification</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#adef-width-COLGROUP">
+width</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/tables.html#edef-COLGROUP" class="noxref">COLGROUP</a></td>
+<td align="center" title="Type"><a href="../sgml/dtd.html#MultiLength">
+%MultiLength;</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Comment">default width for enclosed COLs</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#adef-width-PRE">width</a></td>
+<td align="center" title="Related Elements"><a href= 
+"../struct/text.html#edef-PRE" class="noxref">PRE</a></td>
+<td align="center" title="Type"><a href="../types.html#type-number">
+NUMBER</a></td>
+<td align="center" title="Default">#IMPLIED</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Comment">&nbsp;</td>
+</tr>
+</table>
+
+<div class="navbar" align="center">
+<hr><a href="elements.html">previous</a> &nbsp; <a href="list.html">next</a>
+&nbsp; <a href="../cover.html#minitoc">contents</a> &nbsp; <a href= 
+"elements.html">elements</a> &nbsp; <a href="list.html">index</a></div>
+</body>
+</html>
+
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/elements.html b/xml/impl/src/com/intellij/xml/util/documentation/elements.html
new file mode 100644
index 0000000..527bf9b
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/elements.html
@@ -0,0 +1,970 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+<!-- $Id: elements.html,v 1.1 2004/12/24 21:53:29 Maxim.Mossienko Exp $ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Index of the HTML 4 Elements</title>
+<link rel="previous" href="../references.html">
+<link rel="next" href="attributes.html">
+<link rel="contents" href="../cover.html#toc">
+<link rel="stylesheet" type="text/css" href= 
+"http://www.w3.org/StyleSheets/TR/W3C-REC">
+<link rel="STYLESHEET" href="../style/default.css" type="text/css">
+</head>
+<body>
+<div class="navbar" align="center">&nbsp;<a href="../references.html">
+previous</a> &nbsp; <a href="attributes.html">next</a> &nbsp; <a href= 
+"../cover.html#minitoc">contents</a> &nbsp; <a href="attributes.html">
+attributes</a> &nbsp; <a href="list.html">index</a> 
+
+<hr></div>
+
+<h1 align="center">Index of Elements<a name="h-2">&nbsp;</a></h1>
+
+<p><em>Legend: <b>O</b>ptional, <b>F</b>orbidden, <b>E</b>mpty, <b>
+D</b>eprecated, <b>L</b>oose DTD, <b>F</b>rameset DTD</em></p>
+
+<table summary="Element index. Columns are: Name, start tag required, end tag 
+required, empty, deprecated, which DTD, and description" border="1" align= 
+"center">
+<tr align="center">
+<th>Name</th>
+<th>Start Tag</th>
+<th>End Tag</th>
+<th>Empty</th>
+<th>Depr.</th>
+<th>DTD</th>
+<th>Description</th>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/links.html#edef-A">A</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">anchor</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-ABBR">ABBR</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">abbreviated form (e.g., WWW, HTTP,etc.)</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-ACRONYM">ACRONYM</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">&nbsp;</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-ADDRESS">ADDRESS</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">information on author</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#edef-APPLET">APPLET</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Description">Java applet</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#edef-AREA">AREA</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">F</td>
+<td align="center" title="Empty">E</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">client-side image map area</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#edef-B">B</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">bold text style</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/links.html#edef-BASE">BASE</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">F</td>
+<td align="center" title="Empty">E</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">document base URI</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#edef-BASEFONT">
+BASEFONT</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">F</td>
+<td align="center" title="Empty">E</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Description">base font size</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/dirlang.html#edef-BDO">BDO</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">I18N BiDi over-ride</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#edef-BIG">BIG</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">large text style</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-BLOCKQUOTE">
+BLOCKQUOTE</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">long quotation</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-BODY">BODY</a></td>
+<td align="center" title="Start Tag">O</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">document body</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-BR">BR</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">F</td>
+<td align="center" title="Empty">E</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">forced line break</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#edef-BUTTON">BUTTON</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">push button</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#edef-CAPTION">CAPTION</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">table caption</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#edef-CENTER">CENTER</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Description">shorthand for DIV align=center</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-CITE">CITE</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">citation</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-CODE">CODE</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">computer code fragment</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#edef-COL">COL</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">F</td>
+<td align="center" title="Empty">E</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">table column</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#edef-COLGROUP">
+COLGROUP</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">table column group</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#edef-DD">DD</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">definition description</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-del">DEL</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">deleted text</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-DFN">DFN</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">instance definition</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#edef-DIR">DIR</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Description">directory list</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-DIV">DIV</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">generic language/style container</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#edef-DL">DL</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">definition list</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#edef-DT">DT</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">definition term</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-EM">EM</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">emphasis</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#edef-FIELDSET">
+FIELDSET</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">form control group</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#edef-FONT">FONT</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Description">local change to font</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#edef-FORM">FORM</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">interactive form</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#edef-FRAME">FRAME</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">F</td>
+<td align="center" title="Empty">E</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Description">subwindow</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#edef-FRAMESET">
+FRAMESET</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Description">window subdivision</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-H1">H1</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">heading</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-H2">H2</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">heading</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-H3">H3</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">heading</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-H4">H4</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">heading</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-H5">H5</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">heading</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-H6">H6</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">heading</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-HEAD">HEAD</a></td>
+<td align="center" title="Start Tag">O</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">document head</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#edef-HR">HR</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">F</td>
+<td align="center" title="Empty">E</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">horizontal rule</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-HTML">HTML</a></td>
+<td align="center" title="Start Tag">O</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">document root element</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#edef-I">I</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">italic text style</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#edef-IFRAME">IFRAME</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Description">inline subwindow</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#edef-IMG">IMG</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">F</td>
+<td align="center" title="Empty">E</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">Embedded image</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#edef-INPUT">INPUT</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">F</td>
+<td align="center" title="Empty">E</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">form control</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-ins">INS</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">inserted text</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#edef-ISINDEX">ISINDEX</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">F</td>
+<td align="center" title="Empty">E</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Description">single line prompt</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-KBD">KBD</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">text to be entered by the user</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#edef-LABEL">LABEL</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">form field label text</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#edef-LEGEND">LEGEND</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">fieldset legend</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#edef-LI">LI</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">list item</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/links.html#edef-LINK">LINK</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">F</td>
+<td align="center" title="Empty">E</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">a media-independent link</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#edef-MAP">MAP</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">client-side image map</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#edef-MENU">MENU</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Description">menu list</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-META">META</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">F</td>
+<td align="center" title="Empty">E</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">generic metainformation</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/frames.html#edef-NOFRAMES">
+NOFRAMES</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">F</td>
+<td align="center" title="Description">alternate content container for non
+frame-based rendering</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#edef-NOSCRIPT">
+NOSCRIPT</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">alternate content container for non
+script-based rendering</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#edef-OBJECT">OBJECT</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">generic embedded object</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#edef-OL">OL</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">ordered list</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#edef-OPTGROUP">
+OPTGROUP</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">option group</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#edef-OPTION">OPTION</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">selectable choice</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-P">P</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">paragraph</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/objects.html#edef-PARAM">PARAM</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">F</td>
+<td align="center" title="Empty">E</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">named property value</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-PRE">PRE</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">preformatted text</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-Q">Q</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">short inline quotation</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#edef-S">S</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Description">strike-through text style</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-SAMP">SAMP</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">sample program output, scripts,
+etc.</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/scripts.html#edef-SCRIPT">SCRIPT</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">script statements</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#edef-SELECT">SELECT</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">option selector</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#edef-SMALL">SMALL</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">small text style</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-SPAN">SPAN</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">generic language/style container</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#edef-STRIKE">STRIKE</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Description">strike-through text</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-STRONG">STRONG</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">strong emphasis</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/styles.html#edef-STYLE">STYLE</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">style info</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-SUB">SUB</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">subscript</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-SUP">SUP</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">superscript</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#edef-TABLE">TABLE</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">&nbsp;</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#edef-TBODY">TBODY</a></td>
+<td align="center" title="Start Tag">O</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">table body</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#edef-TD">TD</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">table data cell</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../interact/forms.html#edef-TEXTAREA">
+TEXTAREA</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">multi-line text field</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#edef-TFOOT">TFOOT</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">table footer</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#edef-TH">TH</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">table header cell</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#edef-THEAD">THEAD</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">table header</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/global.html#edef-TITLE">TITLE</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">document title</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/tables.html#edef-TR">TR</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">O</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">table row</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#edef-TT">TT</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">teletype or monospaced text style</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../present/graphics.html#edef-U">U</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">D</td>
+<td align="center" title="DTD">L</td>
+<td align="center" title="Description">underlined text style</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/lists.html#edef-UL">UL</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">unordered list</td>
+</tr>
+
+<tr>
+<td title="Name"><a href="../struct/text.html#edef-VAR">VAR</a></td>
+<td align="center" title="Start Tag">&nbsp;</td>
+<td align="center" title="End Tag">&nbsp;</td>
+<td align="center" title="Empty">&nbsp;</td>
+<td align="center" title="Depr.">&nbsp;</td>
+<td align="center" title="DTD">&nbsp;</td>
+<td align="center" title="Description">instance of a variable or program
+argument</td>
+</tr>
+</table>
+
+<div class="navbar" align="center">
+<hr><a href="../references.html">previous</a> &nbsp; <a href="attributes.html">
+next</a> &nbsp; <a href="../cover.html#minitoc">contents</a> &nbsp; <a href= 
+"attributes.html">attributes</a> &nbsp; <a href="list.html">index</a></div>
+</body>
+</html>
+
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/html5table.xml b/xml/impl/src/com/intellij/xml/util/documentation/html5table.xml
new file mode 100644
index 0000000..94c2e45
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/html5table.xml
@@ -0,0 +1,522 @@
+<html-property-table baseHelpRef="http://dev.w3.org/html5/spec/">
+<tag name        = "section"
+     helpref     = "sections.html#the-section-element"
+     description = "generic document or application section"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "article"
+     helpref     = "sections.html#the-article-element"
+     description = "self-contained composition in a document, page, application, or site and that is intended to be independently distributable or reusable, e.g. in syndication"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "aside"
+     helpref     = "sections.html#the-aside-element"
+     description = "a section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "hgroup"
+     helpref     = "sections.html#the-hgroup-element"
+     description = "heading of a section"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "header"
+     helpref     = "sections.html#the-header-element"
+     description = "group of introductory or navigational aids"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "footer"
+     helpref     = "sections.html#the-footer-element"
+     description = "a footer for its nearest ancestor sectioning content or sectioning root element"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "nav"
+     helpref     = "sections.html#the-nav-element"
+     description = "section of a page that links to other pages or to parts within the page"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "figure"
+     helpref     = "grouping-content.html#the-figure-element"
+     description = "some flow content, optionally with a caption, that is self-contained and is typically referenced as a single unit from the main flow of the document"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "figcaption"
+     helpref     = "grouping-content.html#the-figcaption-element"
+     description = "a caption or legend for the rest of the contents of the figcaption element's parent figure element, if any"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "video"
+     helpref     = "video.html#video"
+     description = "used for playing videos or movies"
+     startTag    = "true"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "audio"
+     helpref     = "video.html#audio"
+     description = "a sound or audio stream"
+     startTag    = "true"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "embed"
+     helpref     = "the-iframe-element.html#the-embed-element"
+     description = "integration point for an external application or interactive content"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "mark"
+     helpref     = "text-level-semantics.html#the-mark-element"
+     description = "a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "progress"
+     helpref     = "the-button-element.html#the-progress-element"
+     description = "the completion progress of a task"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "meter"
+     helpref     = "the-button-element.html#the-meter-element"
+     description = "a scalar measurement within a known range, or a fractional value"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "time"
+     helpref     = "rendering.html#the-time-element-0"
+     description = "either a time on a 24 hour clock, or a precise date in the proleptic Gregorian calendar, optionally with a time and a time-zone offset"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "ruby"
+     helpref     = "text-level-semantics.html#the-ruby-element"
+     description = "allows one or more spans of phrasing content to be marked with ruby annotation"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "rt"
+     helpref     = "text-level-semantics.html#the-rt-element"
+     description = "marks the ruby text component of a ruby annotation"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "rp"
+     helpref     = "text-level-semantics.html#the-rp-element"
+     description = "can be used to provide parentheses around a ruby text component of a ruby annotation, to be shown by user agents that don't support ruby annotations"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "canvas"
+     helpref     = "the-canvas-element.html#the-canvas-element"
+     description = "provides scripts with a resolution-dependent bitmap canvas, which can be used for rendering graphs, game graphics, or other visual images on the fly"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "command"
+     helpref     = "interactive-elements.html#the-command"
+     description = "provides scripts with a resolution-dependent bitmap canvas, which can be used for rendering graphs, game graphics, or other visual images on the fly"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "datalist"
+     helpref     = "the-button-element.html#the-datalist-element"
+     description = "a set of option elements that represent predefined options for other controls"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "keygen"
+     helpref     = "the-button-element.html#the-keygen-element"
+     description = "a key pair generator control"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "output"
+     helpref     = "the-button-element.html#the-output-element"
+     description = "the result of a calculation"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<attribute name        = "media"
+           helpref     = "links.html#attr-hyperlink-media"
+           description = "suppress word wrap"
+           relatedTags = "a,area"
+           dtd         = ""
+           type        = "common.data.mediaquery"
+           default     = "false"
+/>
+<attribute name        = "ping"
+           helpref     = ""
+           description = "a space-separated list of URLs which have to be pinged when the hyperlink is followed"
+           relatedTags = "a,area"
+           dtd         = ""
+           type        = "common.data.uris"
+           default     = "true"
+/>
+<attribute name        = "hreflang"
+           helpref     = "links.html#attr-hyperlink-hreflang"
+           description = "gives the language of the linked resource"
+           relatedTags = "area"
+           dtd         = ""
+           type        = "common.data.langcode"
+           default     = "false"
+/>
+<attribute name        = "rel"
+           helpref     = "links.html#attr-hyperlink-rel"
+           description = ""
+           relatedTags = "area"
+           dtd         = ""
+           type        = "common.data.tokens"
+           default     = "false"
+/>
+<attribute name        = "charset"
+           helpref     = "semantics.html#attr-meta-charset"
+           description = "the character encoding used by the document"
+           relatedTags = "meta"
+           dtd         = ""
+           type        = "common.data.charset"
+           default     = "false"
+/>
+<attribute name        = "autofocus"
+           helpref     = "association-of-controls-and-forms.html#attr-fe-autofocus"
+           description = "allows the user to indicate that a control is to be focused as soon as the page is loaded, allowing the user to just start typing without having to manually focus the main control"
+           relatedTags = "input,select,textarea,button"
+           dtd         = ""
+           type        = "(autofocus)"
+           default     = "true"
+/>
+<attribute name        = "placeholder"
+           helpref     = "common-input-element-attributes.html#attr-input-placeholder"
+           description = "short hint (a word or short phrase) intended to aid the user with data entry"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "string"
+           default     = "true"
+/>
+<attribute name        = "placeholder"
+           helpref     = "the-button-element.html#attr-textarea-placeholder"
+           description = "a hint (a word or short phrase) intended to aid the user with data entry"
+           relatedTags = "textarea"
+           dtd         = ""
+           type        = "string"
+           default     = "false"
+/>
+<attribute name        = "form"
+           helpref     = "association-of-controls-and-forms.html#attr-fae-form"
+           description = ""
+           relatedTags = "input,output,select,textarea,button,fieldset"
+           dtd         = ""
+           type        = "common.data.idref"
+           default     = "true"
+/>
+<attribute name        = "required"
+           helpref     = "common-input-element-attributes.html#attr-input-required"
+           description = "when specified, the element is required"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "(required)"
+           default     = "true"
+/>
+<attribute name        = "required"
+           helpref     = "the-button-element.html#attr-textarea-required"
+           description = "when specified, the user will be required to enter a value before submitting the form"
+           relatedTags = "textarea"
+           dtd         = ""
+           type        = "(required)"
+           default     = "false"
+/>
+<attribute name        = "disabled"
+           helpref     = ""
+           description = "disabling all its contents when specified"
+           relatedTags = "fieldset"
+           dtd         = ""
+           type        = "(disabled)"
+           default     = "false"
+/>
+<attribute name        = "autocomplete"
+           helpref     = "common-input-element-attributes.html#attr-input-autocomplete"
+           description = "autocompletion state"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "(on | off)"
+           default     = "true"
+/>
+<attribute name        = "min"
+           helpref     = "common-input-element-attributes.html#attr-input-min"
+           description = "indicate the allowed range of values for the element"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "common.data.datetime"
+           default     = "true"
+/>
+<attribute name        = "max"
+           helpref     = "common-input-element-attributes.html#attr-input-max"
+           description = "indicate the allowed range of values for the element"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "common.data.datetime"
+           default     = "true"
+/>
+<attribute name        = "multiple"
+           helpref     = "common-input-element-attributes.html#attr-input-multiple"
+           description = "whether the user is to be allowed to specify more than one value"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "(multiple)"
+           default     = "false"
+/>
+<attribute name        = "pattern"
+           helpref     = "common-input-element-attributes.html#attr-input-pattern"
+           description = "regular expression against which the control's value is to be checked"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "form.data.pattern"
+           default     = "true"
+/>
+<attribute name        = "step"
+           helpref     = "common-input-element-attributes.html#attr-input-step"
+           description = "the granularity that is expected (and required) of the value, by limiting the allowed values"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "string"
+           default     = "true"
+/>
+<attribute name        = "list"
+           helpref     = "common-input-element-attributes.html#attr-input-list"
+           description = "element that lists predefined options suggested to the user"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "common.data.idref"
+           default     = "true"
+/>
+<attribute name        = "novalidate"
+           helpref     = "association-of-controls-and-forms.html#attr-fs-novalidate"
+           description = "if the form is not to be validated during submission"
+           relatedTags = "form"
+           dtd         = ""
+           type        = "(novalidate)"
+           default     = "true"
+/>
+<attribute name        = "formnovalidate"
+           helpref     = "association-of-controls-and-forms.html#attr-fs-formnovalidate"
+           description = "if the form is not to be validated during submission"
+           relatedTags = "input,button"
+           dtd         = ""
+           type        = "(formnovalidate)"
+           default     = "true"
+/>
+<attribute name        = "formaction"
+           helpref     = "association-of-controls-and-forms.html#attr-fs-formaction"
+           description = "server-side form handler"
+           relatedTags = "input,button"
+           dtd         = ""
+           type        = "common.data.uri"
+           default     = "true"
+/>
+<attribute name        = "formenctype"
+           helpref     = "association-of-controls-and-forms.html#attr-fs-formenctype"
+           description = ""
+           relatedTags = "input,button"
+           dtd         = ""
+           type        = "shared-form.attrs.formenctype.data"
+           default     = "true"
+/>
+<attribute name        = "formmethod"
+           helpref     = "association-of-controls-and-forms.html#attr-fs-formmethod"
+           description = "HTTP method used to submit the form"
+           relatedTags = "input,button"
+           dtd         = ""
+           type        = "(GET | POST)"
+           default     = "true"
+/>
+<attribute name        = "formtarget"
+           helpref     = "association-of-controls-and-forms.html#attr-fs-formtarget"
+           description = "render in this frame"
+           relatedTags = "input,button"
+           dtd         = ""
+           type        = "common.data.browsing-context-or-keyword"
+           default     = "true"
+/>
+<attribute name        = "type"
+           helpref     = "interactive-elements.html#attr-menu-type"
+           description = "kind of menu being declared"
+           relatedTags = "menu"
+           dtd         = ""
+           type        = "(toolbar | context)"
+           default     = "false"
+/>
+<attribute name        = "label"
+           helpref     = "interactive-elements.html#attr-menu-label"
+           description = "label of the menu"
+           relatedTags = "menu"
+           dtd         = ""
+           type        = "string"
+           default     = "false"
+/>
+<attribute name        = "scoped"
+           helpref     = "interactive-elements.html#attr-menu-label"
+           description = "enables scoped style sheets"
+           relatedTags = "style"
+           dtd         = ""
+           type        = "(scoped)"
+           default     = "true"
+/>
+<attribute name        = "async"
+           helpref     = "scripting-1.html#attr-script-async"
+           description = "influences script loading and execution"
+           relatedTags = "script"
+           dtd         = ""
+           type        = "(async)"
+           default     = "true"
+/>
+<attribute name        = "manifest"
+           helpref     = "semantics.html#attr-html-manifest"
+           description = "address of the document's application cache manifest"
+           relatedTags = "html"
+           dtd         = ""
+           type        = "common.data.uri"
+           default     = "true"
+/>
+<attribute name        = "sizes"
+           helpref     = "links.html#attr-link-sizes"
+           description = "the size of the referenced icon"
+           relatedTags = "link"
+           dtd         = ""
+           type        = "string"
+           default     = "true"
+/>
+<attribute name        = "reversed"
+           helpref     = "grouping-content.html#attr-ol-reversed"
+           description = "if the list order is descending when present"
+           relatedTags = "ol"
+           dtd         = ""
+           type        = "(reversed)"
+           default     = "true"
+/>
+<attribute name        = "sandbox"
+           helpref     = "the-iframe-element.html#attr-iframe-sandbox"
+           description = "enables a set of extra restrictions on any content hosted by the iframe"
+           relatedTags = "iframe"
+           dtd         = ""
+           type        = "SandboxType"
+           default     = "true"
+/>
+<attribute name        = "seamless"
+           helpref     = "the-iframe-element.html#attr-iframe-seamless"
+           description = ""
+           relatedTags = "iframe"
+           dtd         = ""
+           type        = "(seamless)"
+           default     = "true"
+/>
+<attribute name        = "srcdoc"
+           helpref     = "the-iframe-element.html#attr-iframe-srcdoc"
+           description = "content of the page that the nested browsing context is to contain"
+           relatedTags = "iframe"
+           dtd         = ""
+           type        = "string"
+           default     = "true"
+/>
+<tag name        = "bdi"
+     helpref     = "text-level-semantics.html#the-bdi-element"
+     description = "represents a span of text that is to be isolated from its surroundings for the purposes of bidirectional text formatting"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "details"
+     helpref     = "interactive-elements.html#the-details-element"
+     description = "represents a disclosure widget from which the user can obtain additional information or controls"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "source"
+     helpref     = "video.html#the-source-element"
+     description = "allows authors to specify multiple alternative media resources for media elements. It does not represent anything on its own"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "summary"
+     helpref     = "interactive-elements.html#the-summary-element"
+     description = "represents a summary, caption, or legend for the rest of the contents of the summary element's parent details element, if any"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "track"
+     helpref     = "video.html#the-track-element"
+     description = "allows authors to specify explicit external timed text tracks for media elements. It does not represent anything on its own"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "wbr"
+     helpref     = "text-level-semantics.html#the-wbr-element"
+     description = "represents a line break opportunity"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+</html-property-table>
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/htmlTagTableGen.pl b/xml/impl/src/com/intellij/xml/util/documentation/htmlTagTableGen.pl
new file mode 100644
index 0000000..65918b3
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/htmlTagTableGen.pl
@@ -0,0 +1,233 @@
+
+open(I,"elements.html");
+
+$tagname = "";
+$helpref = "";
+$description = "";
+$startTag="";
+
+$endTag="";
+$empty ="";
+$dtd="";
+
+open(O,">htmltable.xml");
+$basehref="http://www.w3.org/TR/HTML4/";
+print O  "<html-property-table version=\"4_01\" generator-version=\"1\" baseHelpRef=\"$basehref\">\n";
+$expectedName = 0;
+
+while(<I>) {
+  if ($_ =~ /<td title="Name">(.*)<\/td>/i ||
+    ( $expectedName == 1 &&
+      $_ =~ /(.*)<\/a><\/td>/i  #accept-charset</a></td>
+    )
+   ) {
+    $value = $1;
+
+    if (length ($tagname) > 0) {
+      printTagInfo($tagname, $helpref, $description, $startTag, $endTag, $empty,
+        $dtd
+      );
+    }
+
+    $tagname = $value;
+    $tagname =~ s/<a href="([^"]*)">(.*?)<\/a>/$2/i;
+    if ($expectedName == 0) {
+      $helpref = substr($1,3,length($1)-3);
+    }
+
+    $tagname = lc($tagname);
+    $expectedName = 0;
+  } else {
+    if ($_ =~ /<td title="Name">(.*)>/i) { #<td title="Name"><a href="../interact/forms.html#adef-accept-charset">
+        if (length ($tagname) > 0) {
+          printTagInfo($tagname, $helpref, $description, $startTag, $endTag, $empty,
+            $dtd
+          );
+        }
+
+        $tagname="";
+        $expectedName=1;
+        $helpref = $1;
+
+        $helpref =~ s/<a href="([^"]*)"/$1/i; #<a href="../interact/forms.html#adef-accept-charset"
+        $helpref = substr($helpref,3,length($helpref)-3);
+      }
+      elsif ($_ =~ /<td align="center" title="Description">(.*)<\/td>/i) {
+      $description = $1;
+    } elsif ($_ =~ /<td align="center" title="Start Tag">(.*)<\/td>/i) {
+      $startTag = $1;
+      if ($startTag eq "O") { $startTag = "false"; }
+    } elsif ($_ =~ /<td align="center" title="End Tag">(.*)<\/td>/i) {
+      $endTag = $1;
+      if ($endTag eq "O") { $endTag = "false"; }
+      elsif ($endTag eq "F") { $endTag = "true"; }
+    } elsif ($_ =~ /<td align="center" title="Empty">(.*)<\/td>/i) {
+      $empty = $1;
+      if ($empty eq "E") { $empty = "true"; }
+    } elsif ($_ =~ /<td align="center" title="DTD">(.*)<\/td>/i) {
+      $dtd = $1;
+    }
+  }
+}
+
+if (length ($tagname) > 0) {
+  printTagInfo($tagname, $helpref, $description, $startTag, $endTag, $empty,
+    $dtd
+  );
+}
+
+close(I);
+open(I,"attributes.html");
+
+$attributeName = "";
+$processingRelated = 0;
+$expectedName = 0;
+
+while(<I>) {
+  if (!$processingRelated) {
+    if ($_ =~ /<td title="Name">(.*)<\/td>/i || #<td title="Name"><a href="../struct/tables.html#adef-abbr">abbr</a></td>
+        ( $expectedName == 1 &&
+          $_ =~ /(.*)<\/a><\/td>/i  #accept-charset</a></td>
+        )
+       ) {
+      $value = $1;
+
+      if (length ($attributeName) > 0) {
+        printAttributeInfo($attributeName, $helpref, $description, $relatedTags, $dtd, $type, $default);
+      }
+
+      $attributeName = $value;
+      $attributeName =~ s/<a href="([^"]*)">(.*)<\/a>/$2/i;
+      if ($expectedName == 0) {
+        $helpref = substr($1,3,length($1)-3);
+      }
+
+      $attributeName = lc($attributeName);
+      $expectedName = 0;
+    } else {
+      if ($_ =~ /<td title="Name">(.*)>/i) { #<td title="Name"><a href="../interact/forms.html#adef-accept-charset">
+        if (length ($attributeName) > 0) {
+          printAttributeInfo($attributeName, $helpref, $description, $relatedTags, $dtd, $type, $default);
+        }
+
+        $attributeName="";
+        $expectedName=1;
+        $helpref = $1;
+        
+        $helpref =~ s/<a href="([^"]*)"/$1/i; #<a href="../interact/forms.html#adef-accept-charset"
+        $helpref = substr($helpref,3,length($helpref)-3);
+      } 
+      elsif ($_ =~ /<td align="center" title="Comment">(.*)<\/td>/i) {
+        $description = $1;
+        $description =~ s/"/&quot;/g;
+      } elsif ($_ =~ /<td align="center" title="Related Elements">/i) {	
+        $relatedTags = "";
+        $processingRelated=1;
+      } elsif ($_ =~ /<td align="center" title="DTD">(.*)<\/td>/i) {
+        $dtd = $1;
+      } elsif ($_ =~ /<td align="center" title="Type">(.*)<\/td>/i) {
+        $type = $1;
+        #<a href="../sgml/dtd.html#URI">%URI;</a> -> %URI;
+        $type =~ s/<a href="([^"]*)">(.*)<\/a>/$2/i;
+        $type =~ s/%(.*);/$1/i;
+      } elsif ($_ =~ /<td align="center" title="Default">(.*)<\/td>/i) {
+        $default = $1;
+        if ($default eq "#REQUIRED") { $default="false"; }
+        else { $default="true"; }
+      } elsif ($_ =~ /<td align="center" title="Type"><a href="[^"]*">/i) {
+        $expectedType = 1;
+      } elsif ( $expectedType == 1 &&
+        $_ =~ /(.*)<\/a><\/td>/i
+      ) {
+        $expectedType = 0;
+        $type = $1;
+        $type =~ s/%(.*);/$1/i;
+      }
+    }
+  } else {
+    $newRelTags = extractRelatedTag($_);
+    if(defined($newRelTags)) {
+      if(length($relatedTags) != 0) {
+        $relatedTags = "$relatedTags,"; 
+      }
+      $relatedTags = "$relatedTags$newRelTags";
+    }
+ 
+    if(/.*<\/td>$/i) {
+      $processingRelated=0;
+    }
+  }
+}
+
+if (length ($attributeName) > 0) {
+  printAttributeInfo($attributeName, $helpref, $description, $relatedTags, $dtd, $type, $default);
+}
+
+sub extractRelatedTag {
+  my $a = $_[0];
+  my $result;
+  my $other;
+
+  if($a =~ /^.*?([ \w]+)<\/a>(.*)/i) {
+    $result = lc($1);
+    $result = "!" if $result eq "all elements";
+
+    $other = extractRelatedTag($2);
+
+    return $result if (!defined($other));
+    return "$result,$other";
+  }
+
+  return undef;
+}
+sub printTagInfo {
+  my ($name,$helpref,$description,$startTag,$endTag,$empty,$dtd) = @_;
+
+  $description = &fixNbspEqualToDefault($description,"");
+  $startTag = &fixNbspEqualToDefault($startTag,"true");
+  $endTag = &fixNbspEqualToDefault($endTag,"true");
+  $empty = &fixNbspEqualToDefault($empty,"false");
+  $dtd = &fixNbspEqualToDefault($dtd,"");
+
+  print O <<END
+<tag name        = "$name"
+     helpref     = "$helpref"
+     description = "$description"
+     startTag    = "$startTag"
+     endTag      = "$endTag"
+     empty       = "$empty"
+     dtd         = "$dtd"
+/>
+END
+}
+
+sub printAttributeInfo {
+  my ($name,$helpref,$description,$relatedTags,$dtd,$type, $default) = @_;
+
+  $description = &fixNbspEqualToDefault($description,"");
+  $dtd = &fixNbspEqualToDefault($dtd,"");
+
+  print O <<END2
+<attribute name        = "$name"
+           helpref     = "$helpref"
+           description = "$description"
+           relatedTags = "$relatedTags"
+           dtd         = "$dtd"
+           type        = "$type"
+           default     = "$default"
+/>
+END2
+}
+
+sub fixNbspEqualToDefault {
+  if ( $_[0] =~ /&nbsp;/ ) {
+    return $_[1];
+  } else {
+    return $_[0];
+  }
+}
+
+print O  "</html-property-table>";
+
+close(I);
+close(O);
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/htmltable.xml b/xml/impl/src/com/intellij/xml/util/documentation/htmltable.xml
new file mode 100644
index 0000000..6a76727
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/htmltable.xml
@@ -0,0 +1,2234 @@
+<html-property-table version="4_01" generator-version="1" baseHelpRef="http://www.w3.org/TR/HTML4/">
+<tag name        = "a"
+     helpref     = "struct/links.html#edef-A"
+     description = "anchor"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "abbr"
+     helpref     = "struct/text.html#edef-ABBR"
+     description = "abbreviated form (e.g., WWW, HTTP,etc.)"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "acronym"
+     helpref     = "struct/text.html#edef-ACRONYM"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "address"
+     helpref     = "struct/global.html#edef-ADDRESS"
+     description = "information on author"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "applet"
+     helpref     = "struct/objects.html#edef-APPLET"
+     description = "Java applet"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = "L"
+/>
+<tag name        = "area"
+     helpref     = "struct/objects.html#edef-AREA"
+     description = "client-side image map area"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "b"
+     helpref     = "present/graphics.html#edef-B"
+     description = "bold text style"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "base"
+     helpref     = "struct/links.html#edef-BASE"
+     description = "document base URI"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "basefont"
+     helpref     = "present/graphics.html#edef-BASEFONT"
+     description = "base font size"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = "L"
+/>
+<tag name        = "bdo"
+     helpref     = "struct/dirlang.html#edef-BDO"
+     description = "I18N BiDi over-ride"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "big"
+     helpref     = "present/graphics.html#edef-BIG"
+     description = "large text style"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "blockquote"
+     helpref     = "struct/text.html#edef-BLOCKQUOTE"
+     description = "long quotation"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "body"
+     helpref     = "struct/global.html#edef-BODY"
+     description = "document body"
+     startTag    = "false"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "br"
+     helpref     = "struct/text.html#edef-BR"
+     description = "forced line break"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "button"
+     helpref     = "interact/forms.html#edef-BUTTON"
+     description = "push button"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "caption"
+     helpref     = "struct/tables.html#edef-CAPTION"
+     description = "table caption"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "center"
+     helpref     = "present/graphics.html#edef-CENTER"
+     description = "shorthand for DIV align=center"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = "L"
+/>
+<tag name        = "cite"
+     helpref     = "struct/text.html#edef-CITE"
+     description = "citation"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "code"
+     helpref     = "struct/text.html#edef-CODE"
+     description = "computer code fragment"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "col"
+     helpref     = "struct/tables.html#edef-COL"
+     description = "table column"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "colgroup"
+     helpref     = "struct/tables.html#edef-COLGROUP"
+     description = "table column group"
+     startTag    = "true"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "dd"
+     helpref     = "struct/lists.html#edef-DD"
+     description = "definition description"
+     startTag    = "true"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "del"
+     helpref     = "struct/text.html#edef-del"
+     description = "deleted text"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "dfn"
+     helpref     = "struct/text.html#edef-DFN"
+     description = "instance definition"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "dir"
+     helpref     = "struct/lists.html#edef-DIR"
+     description = "directory list"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = "L"
+/>
+<tag name        = "div"
+     helpref     = "struct/global.html#edef-DIV"
+     description = "generic language/style container"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "dl"
+     helpref     = "struct/lists.html#edef-DL"
+     description = "definition list"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "dt"
+     helpref     = "struct/lists.html#edef-DT"
+     description = "definition term"
+     startTag    = "true"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "em"
+     helpref     = "struct/text.html#edef-EM"
+     description = "emphasis"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "fieldset"
+     helpref     = "interact/forms.html#edef-FIELDSET"
+     description = "form control group"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "font"
+     helpref     = "present/graphics.html#edef-FONT"
+     description = "local change to font"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = "L"
+/>
+<tag name        = "form"
+     helpref     = "interact/forms.html#edef-FORM"
+     description = "interactive form"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "frame"
+     helpref     = "present/frames.html#edef-FRAME"
+     description = "subwindow"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = "F"
+/>
+<tag name        = "frameset"
+     helpref     = "present/frames.html#edef-FRAMESET"
+     description = "window subdivision"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = "F"
+/>
+<tag name        = "h1"
+     helpref     = "struct/global.html#edef-H1"
+     description = "heading"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "h2"
+     helpref     = "struct/global.html#edef-H2"
+     description = "heading"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "h3"
+     helpref     = "struct/global.html#edef-H3"
+     description = "heading"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "h4"
+     helpref     = "struct/global.html#edef-H4"
+     description = "heading"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "h5"
+     helpref     = "struct/global.html#edef-H5"
+     description = "heading"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "h6"
+     helpref     = "struct/global.html#edef-H6"
+     description = "heading"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "head"
+     helpref     = "struct/global.html#edef-HEAD"
+     description = "document head"
+     startTag    = "false"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "hr"
+     helpref     = "present/graphics.html#edef-HR"
+     description = "horizontal rule"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "html"
+     helpref     = "struct/global.html#edef-HTML"
+     description = "document root element"
+     startTag    = "false"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "i"
+     helpref     = "present/graphics.html#edef-I"
+     description = "italic text style"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "iframe"
+     helpref     = "present/frames.html#edef-IFRAME"
+     description = "inline subwindow"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = "L"
+/>
+<tag name        = "img"
+     helpref     = "struct/objects.html#edef-IMG"
+     description = "Embedded image"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "input"
+     helpref     = "interact/forms.html#edef-INPUT"
+     description = "form control"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "ins"
+     helpref     = "struct/text.html#edef-ins"
+     description = "inserted text"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "isindex"
+     helpref     = "interact/forms.html#edef-ISINDEX"
+     description = "single line prompt"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = "L"
+/>
+<tag name        = "kbd"
+     helpref     = "struct/text.html#edef-KBD"
+     description = "text to be entered by the user"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "label"
+     helpref     = "interact/forms.html#edef-LABEL"
+     description = "form field label text"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "legend"
+     helpref     = "interact/forms.html#edef-LEGEND"
+     description = "fieldset legend"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "li"
+     helpref     = "struct/lists.html#edef-LI"
+     description = "list item"
+     startTag    = "true"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "link"
+     helpref     = "struct/links.html#edef-LINK"
+     description = "a media-independent link"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "map"
+     helpref     = "struct/objects.html#edef-MAP"
+     description = "client-side image map"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "menu"
+     helpref     = "struct/lists.html#edef-MENU"
+     description = "menu list"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = "L"
+/>
+<tag name        = "meta"
+     helpref     = "struct/global.html#edef-META"
+     description = "generic metainformation"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "noframes"
+     helpref     = "present/frames.html#edef-NOFRAMES"
+     description = "generic metainformation"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = "F"
+/>
+<tag name        = "noscript"
+     helpref     = "interact/scripts.html#edef-NOSCRIPT"
+     description = "generic metainformation"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "object"
+     helpref     = "struct/objects.html#edef-OBJECT"
+     description = "generic embedded object"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "ol"
+     helpref     = "struct/lists.html#edef-OL"
+     description = "ordered list"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "optgroup"
+     helpref     = "interact/forms.html#edef-OPTGROUP"
+     description = "option group"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "option"
+     helpref     = "interact/forms.html#edef-OPTION"
+     description = "selectable choice"
+     startTag    = "true"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "p"
+     helpref     = "struct/text.html#edef-P"
+     description = "paragraph"
+     startTag    = "true"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "param"
+     helpref     = "struct/objects.html#edef-PARAM"
+     description = "named property value"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "pre"
+     helpref     = "struct/text.html#edef-PRE"
+     description = "preformatted text"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "q"
+     helpref     = "struct/text.html#edef-Q"
+     description = "short inline quotation"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "s"
+     helpref     = "present/graphics.html#edef-S"
+     description = "strike-through text style"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = "L"
+/>
+<tag name        = "samp"
+     helpref     = "struct/text.html#edef-SAMP"
+     description = "strike-through text style"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "script"
+     helpref     = "interact/scripts.html#edef-SCRIPT"
+     description = "script statements"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "select"
+     helpref     = "interact/forms.html#edef-SELECT"
+     description = "option selector"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "small"
+     helpref     = "present/graphics.html#edef-SMALL"
+     description = "small text style"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "span"
+     helpref     = "struct/global.html#edef-SPAN"
+     description = "generic language/style container"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "strike"
+     helpref     = "present/graphics.html#edef-STRIKE"
+     description = "strike-through text"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = "L"
+/>
+<tag name        = "strong"
+     helpref     = "struct/text.html#edef-STRONG"
+     description = "strong emphasis"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "style"
+     helpref     = "present/styles.html#edef-STYLE"
+     description = "style info"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "sub"
+     helpref     = "struct/text.html#edef-SUB"
+     description = "subscript"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "sup"
+     helpref     = "struct/text.html#edef-SUP"
+     description = "superscript"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "table"
+     helpref     = "struct/tables.html#edef-TABLE"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "tbody"
+     helpref     = "struct/tables.html#edef-TBODY"
+     description = "table body"
+     startTag    = "false"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "td"
+     helpref     = "struct/tables.html#edef-TD"
+     description = "table data cell"
+     startTag    = "true"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "textarea"
+     helpref     = "interact/forms.html#edef-TEXTAREA"
+     description = "multi-line text field"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "tfoot"
+     helpref     = "struct/tables.html#edef-TFOOT"
+     description = "table footer"
+     startTag    = "true"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "th"
+     helpref     = "struct/tables.html#edef-TH"
+     description = "table header cell"
+     startTag    = "true"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "thead"
+     helpref     = "struct/tables.html#edef-THEAD"
+     description = "table header"
+     startTag    = "true"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "title"
+     helpref     = "struct/global.html#edef-TITLE"
+     description = "document title"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "tr"
+     helpref     = "struct/tables.html#edef-TR"
+     description = "table row"
+     startTag    = "true"
+     endTag      = "false"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "tt"
+     helpref     = "present/graphics.html#edef-TT"
+     description = "teletype or monospaced text style"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "u"
+     helpref     = "present/graphics.html#edef-U"
+     description = "underlined text style"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = "L"
+/>
+<tag name        = "ul"
+     helpref     = "struct/lists.html#edef-UL"
+     description = "unordered list"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "var"
+     helpref     = "struct/text.html#edef-VAR"
+     description = "unordered list"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<attribute name        = "abbr"
+           helpref     = "struct/tables.html#adef-abbr"
+           description = "abbreviation for header cell"
+           relatedTags = "td,th"
+           dtd         = ""
+           type        = "Text"
+           default     = "true"
+/>
+<attribute name        = "accept-charset"
+           helpref     = "interact/forms.html#adef-accept-charset"
+           description = "list of supported charsets"
+           relatedTags = "form"
+           dtd         = ""
+           type        = "Charsets"
+           default     = "true"
+/>
+<attribute name        = "accept"
+           helpref     = "interact/forms.html#adef-accept"
+           description = "list of MIME types for file upload"
+           relatedTags = "form,input"
+           dtd         = ""
+           type        = "ContentTypes"
+           default     = "true"
+/>
+<attribute name        = "accesskey"
+           helpref     = "interact/forms.html#adef-accesskey"
+           description = "accessibility key character"
+           relatedTags = "a,area,button,input,label,legend,textarea"
+           dtd         = ""
+           type        = "Character"
+           default     = "true"
+/>
+<attribute name        = "action"
+           helpref     = "interact/forms.html#adef-action"
+           description = "server-side form handler"
+           relatedTags = "form"
+           dtd         = ""
+           type        = "URI"
+           default     = "false"
+/>
+<attribute name        = "align"
+           helpref     = "struct/tables.html#adef-align-CAPTION"
+           description = "relative to table"
+           relatedTags = "caption"
+           dtd         = "L"
+           type        = "CAlign"
+           default     = "true"
+/>
+<attribute name        = "align"
+           helpref     = "struct/objects.html#adef-align-IMG"
+           description = "vertical or horizontal alignment"
+           relatedTags = "applet,iframe,img,input,object"
+           dtd         = "L"
+           type        = "IAlign"
+           default     = "true"
+/>
+<attribute name        = "align"
+           helpref     = "interact/forms.html#adef-align-LEGEND"
+           description = "relative to fieldset"
+           relatedTags = "legend"
+           dtd         = "L"
+           type        = "LAlign"
+           default     = "true"
+/>
+<attribute name        = "align"
+           helpref     = "struct/tables.html#adef-align-TABLE"
+           description = "table position relative to window"
+           relatedTags = "table"
+           dtd         = "L"
+           type        = "TAlign"
+           default     = "true"
+/>
+<attribute name        = "align"
+           helpref     = "present/graphics.html#adef-align-HR"
+           description = ""
+           relatedTags = "hr"
+           dtd         = "L"
+           type        = "(left | center | right)"
+           default     = "true"
+/>
+<attribute name        = "align"
+           helpref     = "present/graphics.html#adef-align"
+           description = "align, text alignment"
+           relatedTags = "div,h1,h2,h3,h4,h5,h6,p"
+           dtd         = "L"
+           type        = "(left | center | right | justify)"
+           default     = "true"
+/>
+<attribute name        = "align"
+           helpref     = "struct/tables.html#adef-align-TD"
+           description = ""
+           relatedTags = "col,colgroup,tbody,td,tfoot,th,thead,tr"
+           dtd         = ""
+           type        = "(left | center | right | justify | char)"
+           default     = "true"
+/>
+<attribute name        = "alink"
+           helpref     = "struct/global.html#adef-alink"
+           description = "color of selected links"
+           relatedTags = "body"
+           dtd         = "L"
+           type        = "Color"
+           default     = "true"
+/>
+<attribute name        = "alt"
+           helpref     = "struct/objects.html#adef-alt"
+           description = "short description"
+           relatedTags = "applet"
+           dtd         = "L"
+           type        = "Text"
+           default     = "true"
+/>
+<attribute name        = "alt"
+           helpref     = "struct/objects.html#adef-alt"
+           description = "short description"
+           relatedTags = "area,img"
+           dtd         = ""
+           type        = "Text"
+           default     = "false"
+/>
+<attribute name        = "alt"
+           helpref     = "struct/objects.html#adef-alt"
+           description = "short description"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "archive"
+           helpref     = "struct/objects.html#adef-archive-APPLET"
+           description = "comma-separated archive list"
+           relatedTags = "applet"
+           dtd         = "L"
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "archive"
+           helpref     = "struct/objects.html#adef-archive-OBJECT"
+           description = "space-separated list of URIs"
+           relatedTags = "object"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "axis"
+           helpref     = "struct/tables.html#adef-axis"
+           description = "comma-separated list of related headers"
+           relatedTags = "td,th"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "background"
+           helpref     = "struct/global.html#adef-background"
+           description = "texture tile for document background"
+           relatedTags = "body"
+           dtd         = "L"
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "bgcolor"
+           helpref     = "present/graphics.html#adef-bgcolor"
+           description = "background color for cells"
+           relatedTags = "table"
+           dtd         = "L"
+           type        = "Color"
+           default     = "true"
+/>
+<attribute name        = "bgcolor"
+           helpref     = "present/graphics.html#adef-bgcolor"
+           description = "background color for row"
+           relatedTags = "tr"
+           dtd         = "L"
+           type        = "Color"
+           default     = "true"
+/>
+<attribute name        = "bgcolor"
+           helpref     = "present/graphics.html#adef-bgcolor"
+           description = "cell background color"
+           relatedTags = "td,th"
+           dtd         = "L"
+           type        = "Color"
+           default     = "true"
+/>
+<attribute name        = "bgcolor"
+           helpref     = "present/graphics.html#adef-bgcolor"
+           description = "document background color"
+           relatedTags = "body"
+           dtd         = "L"
+           type        = "Color"
+           default     = "true"
+/>
+<attribute name        = "border"
+           helpref     = "struct/tables.html#adef-border-TABLE"
+           description = "controls frame width around table"
+           relatedTags = "table"
+           dtd         = ""
+           type        = "Pixels"
+           default     = "true"
+/>
+<attribute name        = "border"
+           helpref     = "struct/objects.html#adef-border-IMG"
+           description = "link border width"
+           relatedTags = "img,object"
+           dtd         = "L"
+           type        = "Pixels"
+           default     = "true"
+/>
+<attribute name        = "cellpadding"
+           helpref     = "struct/tables.html#adef-cellpadding"
+           description = "spacing within cells"
+           relatedTags = "table"
+           dtd         = ""
+           type        = "Length"
+           default     = "true"
+/>
+<attribute name        = "cellspacing"
+           helpref     = "struct/tables.html#adef-cellspacing"
+           description = "spacing between cells"
+           relatedTags = "table"
+           dtd         = ""
+           type        = "Length"
+           default     = "true"
+/>
+<attribute name        = "char"
+           helpref     = "struct/tables.html#adef-char"
+           description = "alignment char, e.g. char=':'"
+           relatedTags = "col,colgroup,tbody,td,tfoot,th,thead,tr"
+           dtd         = ""
+           type        = "Character"
+           default     = "true"
+/>
+<attribute name        = "charoff"
+           helpref     = "struct/tables.html#adef-charoff"
+           description = "offset for alignment char"
+           relatedTags = "col,colgroup,tbody,td,tfoot,th,thead,tr"
+           dtd         = ""
+           type        = "Length"
+           default     = "true"
+/>
+<attribute name        = "charset"
+           helpref     = "struct/links.html#adef-charset"
+           description = "char encoding of linked resource"
+           relatedTags = "a,link,script"
+           dtd         = ""
+           type        = "Charset"
+           default     = "true"
+/>
+<attribute name        = "checked"
+           helpref     = "interact/forms.html#adef-checked"
+           description = "for radio buttons and check boxes"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "(checked)"
+           default     = "true"
+/>
+<attribute name        = "cite"
+           helpref     = "struct/text.html#adef-cite-Q"
+           description = "URI for source document or msg"
+           relatedTags = "blockquote,q"
+           dtd         = ""
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "cite"
+           helpref     = "struct/text.html#adef-cite-INS"
+           description = "info on reason for change"
+           relatedTags = "del,ins"
+           dtd         = ""
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "class"
+           helpref     = "struct/global.html#adef-class"
+           description = "space-separated list of classes"
+           relatedTags = "!,base,basefont,head,html,meta,param,script,style,title"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "classid"
+           helpref     = "struct/objects.html#adef-classid"
+           description = "identifies an implementation"
+           relatedTags = "object"
+           dtd         = ""
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "clear"
+           helpref     = "present/graphics.html#adef-clear"
+           description = "control of text flow"
+           relatedTags = "br"
+           dtd         = "L"
+           type        = "(left | all | right | none)"
+           default     = "true"
+/>
+<attribute name        = "code"
+           helpref     = "struct/objects.html#adef-code"
+           description = "applet class file"
+           relatedTags = "applet"
+           dtd         = "L"
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "codebase"
+           helpref     = "struct/objects.html#adef-codebase-OBJECT"
+           description = "base URI for classid, data, archive"
+           relatedTags = "object"
+           dtd         = ""
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "codebase"
+           helpref     = "struct/objects.html#adef-codebase-APPLET"
+           description = "optional base URI for applet"
+           relatedTags = "applet"
+           dtd         = "L"
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "codetype"
+           helpref     = "struct/objects.html#adef-codetype"
+           description = "content type for code"
+           relatedTags = "object"
+           dtd         = ""
+           type        = "ContentType"
+           default     = "true"
+/>
+<attribute name        = "color"
+           helpref     = "present/graphics.html#adef-color-FONT"
+           description = "text color"
+           relatedTags = "basefont,font"
+           dtd         = "L"
+           type        = "Color"
+           default     = "true"
+/>
+<attribute name        = "cols"
+           helpref     = "present/frames.html#adef-cols-FRAMESET"
+           description = "list of lengths, default: 100% (1 col)"
+           relatedTags = "frameset"
+           dtd         = "F"
+           type        = "MultiLengths"
+           default     = "true"
+/>
+<attribute name        = "cols"
+           helpref     = "interact/forms.html#adef-cols-TEXTAREA"
+           description = ""
+           relatedTags = "textarea"
+           dtd         = ""
+           type        = "NUMBER"
+           default     = "false"
+/>
+<attribute name        = "colspan"
+           helpref     = "struct/tables.html#adef-colspan"
+           description = "number of cols spanned by cell"
+           relatedTags = "td,th"
+           dtd         = ""
+           type        = "NUMBER"
+           default     = "true"
+/>
+<attribute name        = "compact"
+           helpref     = "struct/lists.html#adef-compact"
+           description = "reduced interitem spacing"
+           relatedTags = "dir,dl,menu,ol,ul"
+           dtd         = "L"
+           type        = "(compact)"
+           default     = "true"
+/>
+<attribute name        = "content"
+           helpref     = "struct/global.html#adef-content"
+           description = "associated information"
+           relatedTags = "meta"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "false"
+/>
+<attribute name        = "coords"
+           helpref     = "struct/objects.html#adef-coords"
+           description = "comma-separated list of lengths"
+           relatedTags = "area"
+           dtd         = ""
+           type        = "Coords"
+           default     = "true"
+/>
+<attribute name        = "coords"
+           helpref     = "struct/objects.html#adef-coords"
+           description = "for use with client-side image maps"
+           relatedTags = "a"
+           dtd         = ""
+           type        = "Coords"
+           default     = "true"
+/>
+<attribute name        = "data"
+           helpref     = "struct/objects.html#adef-data"
+           description = "reference to object's data"
+           relatedTags = "object"
+           dtd         = ""
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "datetime"
+           helpref     = "struct/text.html#adef-datetime"
+           description = "date and time of change"
+           relatedTags = "del,ins"
+           dtd         = ""
+           type        = "Datetime"
+           default     = "true"
+/>
+<attribute name        = "declare"
+           helpref     = "struct/objects.html#adef-declare"
+           description = "declare but don't instantiate flag"
+           relatedTags = "object"
+           dtd         = ""
+           type        = "(declare)"
+           default     = "true"
+/>
+<attribute name        = "defer"
+           helpref     = "interact/scripts.html#adef-defer"
+           description = "UA may defer execution of script"
+           relatedTags = "script"
+           dtd         = ""
+           type        = "(defer)"
+           default     = "true"
+/>
+<attribute name        = "dir"
+           helpref     = "struct/dirlang.html#adef-dir"
+           description = "direction for weak/neutral text"
+           relatedTags = "!,applet,base,basefont,bdo,br,frame,frameset,iframe,param,script"
+           dtd         = ""
+           type        = "(ltr | rtl)"
+           default     = "true"
+/>
+<attribute name        = "dir"
+           helpref     = "struct/dirlang.html#adef-dir-BDO"
+           description = "directionality"
+           relatedTags = "bdo"
+           dtd         = ""
+           type        = "(ltr | rtl)"
+           default     = "false"
+/>
+<attribute name        = "disabled"
+           helpref     = "interact/forms.html#adef-disabled"
+           description = "unavailable in this context"
+           relatedTags = "button,input,optgroup,option,select,textarea"
+           dtd         = ""
+           type        = "(disabled)"
+           default     = "true"
+/>
+<attribute name        = "enctype"
+           helpref     = "interact/forms.html#adef-enctype"
+           description = ""
+           relatedTags = "form"
+           dtd         = ""
+           type        = "ContentType"
+           default     = "true"
+/>
+<attribute name        = "face"
+           helpref     = "present/graphics.html#adef-face-FONT"
+           description = "comma-separated list of font names"
+           relatedTags = "basefont,font"
+           dtd         = "L"
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "for"
+           helpref     = "interact/forms.html#adef-for"
+           description = "matches field ID value"
+           relatedTags = "label"
+           dtd         = ""
+           type        = "IDREF"
+           default     = "true"
+/>
+<attribute name        = "frame"
+           helpref     = "struct/tables.html#adef-frame"
+           description = "which parts of frame to render"
+           relatedTags = "table"
+           dtd         = ""
+           type        = "TFrame"
+           default     = "true"
+/>
+<attribute name        = "frameborder"
+           helpref     = "present/frames.html#adef-frameborder"
+           description = "request frame borders?"
+           relatedTags = "frame,iframe"
+           dtd         = "F"
+           type        = "(1 | 0)"
+           default     = "true"
+/>
+<attribute name        = "headers"
+           helpref     = "struct/tables.html#adef-headers"
+           description = "list of id's for header cells"
+           relatedTags = "td,th"
+           dtd         = ""
+           type        = "IDREFS"
+           default     = "true"
+/>
+<attribute name        = "height"
+           helpref     = "present/frames.html#adef-height-IFRAME"
+           description = "frame height"
+           relatedTags = "iframe"
+           dtd         = "L"
+           type        = "Length"
+           default     = "true"
+/>
+<attribute name        = "height"
+           helpref     = "struct/tables.html#adef-height-TH"
+           description = "height for cell"
+           relatedTags = "td,th"
+           dtd         = "L"
+           type        = "Length"
+           default     = "true"
+/>
+<attribute name        = "height"
+           helpref     = "struct/objects.html#adef-height-IMG"
+           description = "override height"
+           relatedTags = "img,object"
+           dtd         = ""
+           type        = "Length"
+           default     = "true"
+/>
+<attribute name        = "height"
+           helpref     = "struct/objects.html#adef-height-APPLET"
+           description = "initial height"
+           relatedTags = "applet"
+           dtd         = "L"
+           type        = "Length"
+           default     = "false"
+/>
+<attribute name        = "href"
+           helpref     = "struct/links.html#adef-href"
+           description = "URI for linked resource"
+           relatedTags = "a,area,link"
+           dtd         = ""
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "href"
+           helpref     = "struct/links.html#adef-href-BASE"
+           description = "URI that acts as base URI"
+           relatedTags = "base"
+           dtd         = ""
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "hreflang"
+           helpref     = "struct/links.html#adef-hreflang"
+           description = "language code"
+           relatedTags = "a,link"
+           dtd         = ""
+           type        = "LanguageCode"
+           default     = "true"
+/>
+<attribute name        = "hspace"
+           helpref     = "struct/objects.html#adef-hspace"
+           description = "horizontal gutter"
+           relatedTags = "applet,img,object"
+           dtd         = "L"
+           type        = "Pixels"
+           default     = "true"
+/>
+<attribute name        = "http-equiv"
+           helpref     = "struct/global.html#adef-http-equiv"
+           description = "HTTP response header name"
+           relatedTags = "meta"
+           dtd         = ""
+           type        = "NAME"
+           default     = "true"
+/>
+<attribute name        = "id"
+           helpref     = "struct/global.html#adef-id"
+           description = "document-wide unique id"
+           relatedTags = "!,base,head,html,meta,script,style,title"
+           dtd         = ""
+           type        = "ID"
+           default     = "true"
+/>
+<attribute name        = "ismap"
+           helpref     = "struct/objects.html#adef-ismap"
+           description = "use server-side image map"
+           relatedTags = "img,input"
+           dtd         = ""
+           type        = "(ismap)"
+           default     = "true"
+/>
+<attribute name        = "label"
+           helpref     = "interact/forms.html#adef-label-OPTION"
+           description = "for use in hierarchical menus"
+           relatedTags = "option"
+           dtd         = ""
+           type        = "Text"
+           default     = "true"
+/>
+<attribute name        = "label"
+           helpref     = "interact/forms.html#adef-label-OPTGROUP"
+           description = "for use in hierarchical menus"
+           relatedTags = "optgroup"
+           dtd         = ""
+           type        = "Text"
+           default     = "false"
+/>
+<attribute name        = "lang"
+           helpref     = "struct/dirlang.html#adef-lang"
+           description = "language code"
+           relatedTags = "!,applet,base,basefont,br,frame,frameset,iframe,param,script"
+           dtd         = ""
+           type        = "LanguageCode"
+           default     = "true"
+/>
+<attribute name        = "language"
+           helpref     = "interact/scripts.html#adef-language"
+           description = "predefined script language name"
+           relatedTags = "script"
+           dtd         = "L"
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "link"
+           helpref     = "struct/global.html#adef-link"
+           description = "color of links"
+           relatedTags = "body"
+           dtd         = "L"
+           type        = "Color"
+           default     = "true"
+/>
+<attribute name        = "longdesc"
+           helpref     = "struct/objects.html#adef-longdesc-IMG"
+           description = "color of links"
+           relatedTags = "img"
+           dtd         = ""
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "longdesc"
+           helpref     = "present/frames.html#adef-longdesc-FRAME"
+           description = "color of links"
+           relatedTags = "frame,iframe"
+           dtd         = "F"
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "marginheight"
+           helpref     = "present/frames.html#adef-marginheight"
+           description = "margin height in pixels"
+           relatedTags = "frame,iframe"
+           dtd         = "F"
+           type        = "Pixels"
+           default     = "true"
+/>
+<attribute name        = "marginwidth"
+           helpref     = "present/frames.html#adef-marginwidth"
+           description = "margin widths in pixels"
+           relatedTags = "frame,iframe"
+           dtd         = "F"
+           type        = "Pixels"
+           default     = "true"
+/>
+<attribute name        = "maxlength"
+           helpref     = "interact/forms.html#adef-maxlength"
+           description = "max chars for text fields"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "NUMBER"
+           default     = "true"
+/>
+<attribute name        = "media"
+           helpref     = "present/styles.html#adef-media"
+           description = "designed for use with these media"
+           relatedTags = "style"
+           dtd         = ""
+           type        = "MediaDesc"
+           default     = "true"
+/>
+<attribute name        = "media"
+           helpref     = "present/styles.html#adef-media"
+           description = "for rendering on these media"
+           relatedTags = "link"
+           dtd         = ""
+           type        = "MediaDesc"
+           default     = "true"
+/>
+<attribute name        = "method"
+           helpref     = "interact/forms.html#adef-method"
+           description = "HTTP method used to submit the form"
+           relatedTags = "form"
+           dtd         = ""
+           type        = "(GET | POST)"
+           default     = "true"
+/>
+<attribute name        = "multiple"
+           helpref     = "interact/forms.html#adef-multiple"
+           description = "default is single selection"
+           relatedTags = "select"
+           dtd         = ""
+           type        = "(multiple)"
+           default     = "true"
+/>
+<attribute name        = "name"
+           helpref     = "interact/forms.html#adef-name-BUTTON"
+           description = ""
+           relatedTags = "button,textarea"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "name"
+           helpref     = "struct/objects.html#adef-name-APPLET"
+           description = "allows applets to find each other"
+           relatedTags = "applet"
+           dtd         = "L"
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "name"
+           helpref     = "interact/forms.html#adef-name-SELECT"
+           description = "field name"
+           relatedTags = "select"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "name"
+           helpref     = "interact/forms.html#adef-name-FORM"
+           description = "name of form for scripting"
+           relatedTags = "form"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "name"
+           helpref     = "present/frames.html#adef-name-FRAME"
+           description = "name of frame for targetting"
+           relatedTags = "frame,iframe"
+           dtd         = "F"
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "name"
+           helpref     = "struct/objects.html#adef-name-IMG"
+           description = "name of image for scripting"
+           relatedTags = "img"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "name"
+           helpref     = "struct/links.html#adef-name-A"
+           description = "named link end"
+           relatedTags = "a"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "name"
+           helpref     = "interact/forms.html#adef-name-INPUT"
+           description = "submit as part of form"
+           relatedTags = "input,object"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "name"
+           helpref     = "struct/objects.html#adef-name-MAP"
+           description = "for reference by usemap"
+           relatedTags = "map"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "false"
+/>
+<attribute name        = "name"
+           helpref     = "struct/objects.html#adef-name-PARAM"
+           description = "property name"
+           relatedTags = "param"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "false"
+/>
+<attribute name        = "name"
+           helpref     = "struct/global.html#adef-name-META"
+           description = "metainformation name"
+           relatedTags = "meta"
+           dtd         = ""
+           type        = "NAME"
+           default     = "true"
+/>
+<attribute name        = "nohref"
+           helpref     = "struct/objects.html#adef-nohref"
+           description = "this region has no action"
+           relatedTags = "area"
+           dtd         = ""
+           type        = "(nohref)"
+           default     = "true"
+/>
+<attribute name        = "noresize"
+           helpref     = "present/frames.html#adef-noresize"
+           description = "allow users to resize frames?"
+           relatedTags = "frame"
+           dtd         = "F"
+           type        = "(noresize)"
+           default     = "true"
+/>
+<attribute name        = "noshade"
+           helpref     = "present/graphics.html#adef-noshade"
+           description = ""
+           relatedTags = "hr"
+           dtd         = "L"
+           type        = "(noshade)"
+           default     = "true"
+/>
+<attribute name        = "nowrap"
+           helpref     = "struct/tables.html#adef-nowrap"
+           description = "suppress word wrap"
+           relatedTags = "td,th"
+           dtd         = "L"
+           type        = "(nowrap)"
+           default     = "true"
+/>
+<attribute name        = "object"
+           helpref     = "struct/objects.html#adef-object"
+           description = "serialized applet file"
+           relatedTags = "applet"
+           dtd         = "L"
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "onblur"
+           helpref     = "interact/scripts.html#adef-onblur"
+           description = "the element lost the focus"
+           relatedTags = "a,area,button,input,label,select,textarea"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onchange"
+           helpref     = "interact/scripts.html#adef-onchange"
+           description = "the element value was changed"
+           relatedTags = "input,select,textarea"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onclick"
+           helpref     = "interact/scripts.html#adef-onclick"
+           description = "a pointer button was clicked"
+           relatedTags = "!,applet,base,basefont,bdo,br,font,frame,frameset,head,html,iframe,isindex,meta,param,script,style,title"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "ondblclick"
+           helpref     = "interact/scripts.html#adef-ondblclick"
+           description = "a pointer button was double clicked"
+           relatedTags = "!,applet,base,basefont,bdo,br,font,frame,frameset,head,html,iframe,isindex,meta,param,script,style,title"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onfocus"
+           helpref     = "interact/scripts.html#adef-onfocus"
+           description = "the element got the focus"
+           relatedTags = "a,area,button,input,label,select,textarea"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onkeydown"
+           helpref     = "interact/scripts.html#adef-onkeydown"
+           description = "a key was pressed down"
+           relatedTags = "!,applet,base,basefont,bdo,br,font,frame,frameset,head,html,iframe,isindex,meta,param,script,style,title"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onkeypress"
+           helpref     = "interact/scripts.html#adef-onkeypress"
+           description = "a key was pressed and released"
+           relatedTags = "!,applet,base,basefont,bdo,br,font,frame,frameset,head,html,iframe,isindex,meta,param,script,style,title"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onkeyup"
+           helpref     = "interact/scripts.html#adef-onkeyup"
+           description = "a key was released"
+           relatedTags = "!,applet,base,basefont,bdo,br,font,frame,frameset,head,html,iframe,isindex,meta,param,script,style,title"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onload"
+           helpref     = "interact/scripts.html#adef-onload"
+           description = "all the frames have been loaded"
+           relatedTags = "frameset"
+           dtd         = "F"
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onload"
+           helpref     = "interact/scripts.html#adef-onload"
+           description = "the document has been loaded"
+           relatedTags = "body"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onmousedown"
+           helpref     = "interact/scripts.html#adef-onmousedown"
+           description = "a pointer button was pressed down"
+           relatedTags = "!,applet,base,basefont,bdo,br,font,frame,frameset,head,html,iframe,isindex,meta,param,script,style,title"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onmousemove"
+           helpref     = "interact/scripts.html#adef-onmousemove"
+           description = "a pointer was moved within"
+           relatedTags = "!,applet,base,basefont,bdo,br,font,frame,frameset,head,html,iframe,isindex,meta,param,script,style,title"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onmouseout"
+           helpref     = "interact/scripts.html#adef-onmouseout"
+           description = "a pointer was moved away"
+           relatedTags = "!,applet,base,basefont,bdo,br,font,frame,frameset,head,html,iframe,isindex,meta,param,script,style,title"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onmouseover"
+           helpref     = "interact/scripts.html#adef-onmouseover"
+           description = "a pointer was moved onto"
+           relatedTags = "!,applet,base,basefont,bdo,br,font,frame,frameset,head,html,iframe,isindex,meta,param,script,style,title"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onmouseup"
+           helpref     = "interact/scripts.html#adef-onmouseup"
+           description = "a pointer button was released"
+           relatedTags = "!,applet,base,basefont,bdo,br,font,frame,frameset,head,html,iframe,isindex,meta,param,script,style,title"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onreset"
+           helpref     = "interact/scripts.html#adef-onreset"
+           description = "the form was reset"
+           relatedTags = "form"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onselect"
+           helpref     = "interact/scripts.html#adef-onselect"
+           description = "some text was selected"
+           relatedTags = "input,textarea"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onsubmit"
+           helpref     = "interact/scripts.html#adef-onsubmit"
+           description = "the form was submitted"
+           relatedTags = "form"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onunload"
+           helpref     = "interact/scripts.html#adef-onunload"
+           description = "all the frames have been removed"
+           relatedTags = "frameset"
+           dtd         = "F"
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "onunload"
+           helpref     = "interact/scripts.html#adef-onunload"
+           description = "the document has been removed"
+           relatedTags = "body"
+           dtd         = ""
+           type        = "Script"
+           default     = "true"
+/>
+<attribute name        = "profile"
+           helpref     = "struct/global.html#adef-profile"
+           description = "named dictionary of meta info"
+           relatedTags = "head"
+           dtd         = ""
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "prompt"
+           helpref     = "interact/forms.html#adef-prompt"
+           description = "prompt message"
+           relatedTags = "isindex"
+           dtd         = "L"
+           type        = "Text"
+           default     = "true"
+/>
+<attribute name        = "readonly"
+           helpref     = "interact/forms.html#adef-readonly"
+           description = ""
+           relatedTags = "textarea"
+           dtd         = ""
+           type        = "(readonly)"
+           default     = "true"
+/>
+<attribute name        = "readonly"
+           helpref     = "interact/forms.html#adef-readonly"
+           description = "for text and passwd"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "(readonly)"
+           default     = "true"
+/>
+<attribute name        = "rel"
+           helpref     = "struct/links.html#adef-rel"
+           description = "forward link types"
+           relatedTags = "a,link"
+           dtd         = ""
+           type        = "LinkTypes"
+           default     = "true"
+/>
+<attribute name        = "rev"
+           helpref     = "struct/links.html#adef-rev"
+           description = "reverse link types"
+           relatedTags = "a,link"
+           dtd         = ""
+           type        = "LinkTypes"
+           default     = "true"
+/>
+<attribute name        = "rows"
+           helpref     = "present/frames.html#adef-rows-FRAMESET"
+           description = "list of lengths, default: 100% (1 row)"
+           relatedTags = "frameset"
+           dtd         = "F"
+           type        = "MultiLengths"
+           default     = "true"
+/>
+<attribute name        = "rows"
+           helpref     = "interact/forms.html#adef-rows-TEXTAREA"
+           description = ""
+           relatedTags = "textarea"
+           dtd         = ""
+           type        = "NUMBER"
+           default     = "false"
+/>
+<attribute name        = "rowspan"
+           helpref     = "struct/tables.html#adef-rowspan"
+           description = "number of rows spanned by cell"
+           relatedTags = "td,th"
+           dtd         = ""
+           type        = "NUMBER"
+           default     = "true"
+/>
+<attribute name        = "rules"
+           helpref     = "struct/tables.html#adef-rules"
+           description = "rulings between rows and cols"
+           relatedTags = "table"
+           dtd         = ""
+           type        = "TRules"
+           default     = "true"
+/>
+<attribute name        = "scheme"
+           helpref     = "struct/global.html#adef-scheme"
+           description = "select form of content"
+           relatedTags = "meta"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "scope"
+           helpref     = "struct/tables.html#adef-scope"
+           description = "scope covered by header cells"
+           relatedTags = "td,th"
+           dtd         = ""
+           type        = "Scope"
+           default     = "true"
+/>
+<attribute name        = "scrolling"
+           helpref     = "present/frames.html#adef-scrolling"
+           description = "scrollbar or none"
+           relatedTags = "frame,iframe"
+           dtd         = "F"
+           type        = "(yes | no | auto)"
+           default     = "true"
+/>
+<attribute name        = "selected"
+           helpref     = "interact/forms.html#adef-selected"
+           description = ""
+           relatedTags = "option"
+           dtd         = ""
+           type        = "(selected)"
+           default     = "true"
+/>
+<attribute name        = "shape"
+           helpref     = "struct/objects.html#adef-shape"
+           description = "controls interpretation of coords"
+           relatedTags = "area"
+           dtd         = ""
+           type        = "Shape"
+           default     = "true"
+/>
+<attribute name        = "shape"
+           helpref     = "struct/objects.html#adef-shape"
+           description = "for use with client-side image maps"
+           relatedTags = "a"
+           dtd         = ""
+           type        = "Shape"
+           default     = "true"
+/>
+<attribute name        = "size"
+           helpref     = "present/graphics.html#adef-size-HR"
+           description = ""
+           relatedTags = "hr"
+           dtd         = "L"
+           type        = "Pixels"
+           default     = "true"
+/>
+<attribute name        = "size"
+           helpref     = "present/graphics.html#adef-size-FONT"
+           description = "[+|-]nn e.g. size=&quot;+1&quot;, size=&quot;4&quot;"
+           relatedTags = "font"
+           dtd         = "L"
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "size"
+           helpref     = "interact/forms.html#adef-size-INPUT"
+           description = "specific to each type of field"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "size"
+           helpref     = "present/graphics.html#adef-size-BASEFONT"
+           description = "base font size for FONT elements"
+           relatedTags = "basefont"
+           dtd         = "L"
+           type        = "CDATA"
+           default     = "false"
+/>
+<attribute name        = "size"
+           helpref     = "interact/forms.html#adef-size-SELECT"
+           description = "rows visible"
+           relatedTags = "select"
+           dtd         = ""
+           type        = "NUMBER"
+           default     = "true"
+/>
+<attribute name        = "span"
+           helpref     = "struct/tables.html#adef-span-COL"
+           description = "COL attributes affect N columns"
+           relatedTags = "col"
+           dtd         = ""
+           type        = "NUMBER"
+           default     = "true"
+/>
+<attribute name        = "span"
+           helpref     = "struct/tables.html#adef-span-COLGROUP"
+           description = "default number of columns in group"
+           relatedTags = "colgroup"
+           dtd         = ""
+           type        = "NUMBER"
+           default     = "true"
+/>
+<attribute name        = "src"
+           helpref     = "interact/scripts.html#adef-src-SCRIPT"
+           description = "URI for an external script"
+           relatedTags = "script"
+           dtd         = ""
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "src"
+           helpref     = "interact/forms.html#adef-src"
+           description = "for fields with images"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "src"
+           helpref     = "present/frames.html#adef-src-FRAME"
+           description = "source of frame content"
+           relatedTags = "frame,iframe"
+           dtd         = "F"
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "src"
+           helpref     = "struct/objects.html#adef-src-IMG"
+           description = "URI of image to embed"
+           relatedTags = "img"
+           dtd         = ""
+           type        = "URI"
+           default     = "false"
+/>
+<attribute name        = "standby"
+           helpref     = "struct/objects.html#adef-standby"
+           description = "message to show while loading"
+           relatedTags = "object"
+           dtd         = ""
+           type        = "Text"
+           default     = "true"
+/>
+<attribute name        = "start"
+           helpref     = "struct/lists.html#adef-start"
+           description = "starting sequence number"
+           relatedTags = "ol"
+           dtd         = "L"
+           type        = "NUMBER"
+           default     = "true"
+/>
+<attribute name        = "style"
+           helpref     = "present/styles.html#adef-style"
+           description = "associated style info"
+           relatedTags = "!,base,basefont,head,html,meta,param,script,style,title"
+           dtd         = ""
+           type        = "StyleSheet"
+           default     = "true"
+/>
+<attribute name        = "summary"
+           helpref     = "struct/tables.html#adef-summary"
+           description = "purpose/structure for speech output"
+           relatedTags = "table"
+           dtd         = ""
+           type        = "Text"
+           default     = "true"
+/>
+<attribute name        = "tabindex"
+           helpref     = "interact/forms.html#adef-tabindex"
+           description = "position in tabbing order"
+           relatedTags = "a,area,button,input,object,select,textarea"
+           dtd         = ""
+           type        = "NUMBER"
+           default     = "true"
+/>
+<attribute name        = "target"
+           helpref     = "present/frames.html#adef-target"
+           description = "render in this frame"
+           relatedTags = "a,area,base,form,link"
+           dtd         = "L"
+           type        = "FrameTarget"
+           default     = "true"
+/>
+<attribute name        = "text"
+           helpref     = "struct/global.html#adef-text"
+           description = "document text color"
+           relatedTags = "body"
+           dtd         = "L"
+           type        = "Color"
+           default     = "true"
+/>
+<attribute name        = "title"
+           helpref     = "struct/global.html#adef-title"
+           description = "advisory title"
+           relatedTags = "!,base,basefont,head,html,meta,param,script,title"
+           dtd         = ""
+           type        = "Text"
+           default     = "true"
+/>
+<attribute name        = "type"
+           helpref     = "struct/links.html#adef-type-A"
+           description = "advisory content type"
+           relatedTags = "a,link"
+           dtd         = ""
+           type        = "ContentType"
+           default     = "true"
+/>
+<attribute name        = "type"
+           helpref     = "struct/objects.html#adef-type-OBJECT"
+           description = "content type for data"
+           relatedTags = "object"
+           dtd         = ""
+           type        = "ContentType"
+           default     = "true"
+/>
+<attribute name        = "type"
+           helpref     = "struct/objects.html#adef-type-PARAM"
+           description = "content type for data"
+           relatedTags = "param"
+           dtd         = ""
+           type        = "ContentType"
+           default     = "true"
+/>
+<attribute name        = "type"
+           helpref     = "interact/scripts.html#adef-type-SCRIPT"
+           description = "content type of script language"
+           relatedTags = "script"
+           dtd         = ""
+           type        = "ContentType"
+           default     = "false"
+/>
+<attribute name        = "type"
+           helpref     = "present/styles.html#adef-type-STYLE"
+           description = "content type of style language"
+           relatedTags = "style"
+           dtd         = ""
+           type        = "ContentType"
+           default     = "false"
+/>
+<attribute name        = "type"
+           helpref     = "interact/forms.html#adef-type-INPUT"
+           description = "what kind of widget is needed"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "InputType"
+           default     = "true"
+/>
+<attribute name        = "type"
+           helpref     = "struct/lists.html#adef-type-LI"
+           description = "list item style"
+           relatedTags = "li"
+           dtd         = "L"
+           type        = "LIStyle"
+           default     = "true"
+/>
+<attribute name        = "type"
+           helpref     = "struct/lists.html#adef-type-OL"
+           description = "numbering style"
+           relatedTags = "ol"
+           dtd         = "L"
+           type        = "OLStyle"
+           default     = "true"
+/>
+<attribute name        = "type"
+           helpref     = "struct/lists.html#adef-type-UL"
+           description = "bullet style"
+           relatedTags = "ul"
+           dtd         = "L"
+           type        = "ULStyle"
+           default     = "true"
+/>
+<attribute name        = "type"
+           helpref     = "interact/forms.html#adef-type-BUTTON"
+           description = "for use as form button"
+           relatedTags = "button"
+           dtd         = ""
+           type        = "(button | submit | reset)"
+           default     = "true"
+/>
+<attribute name        = "usemap"
+           helpref     = "struct/objects.html#adef-usemap"
+           description = "use client-side image map"
+           relatedTags = "img,input,object"
+           dtd         = ""
+           type        = "URI"
+           default     = "true"
+/>
+<attribute name        = "valign"
+           helpref     = "struct/tables.html#adef-valign"
+           description = "vertical alignment in cells"
+           relatedTags = "col,colgroup,tbody,td,tfoot,th,thead,tr"
+           dtd         = ""
+           type        = "(top | middle | bottom | baseline)"
+           default     = "true"
+/>
+<attribute name        = "value"
+           helpref     = "interact/forms.html#adef-value-INPUT"
+           description = "vertical alignment in cells"
+           relatedTags = "input"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "value"
+           helpref     = "interact/forms.html#adef-value-OPTION"
+           description = "defaults to element content"
+           relatedTags = "option"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "value"
+           helpref     = "struct/objects.html#adef-value-PARAM"
+           description = "property value"
+           relatedTags = "param"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "value"
+           helpref     = "interact/forms.html#adef-value-BUTTON"
+           description = "sent to server when submitted"
+           relatedTags = "button"
+           dtd         = ""
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "value"
+           helpref     = "struct/lists.html#adef-value-LI"
+           description = "reset sequence number"
+           relatedTags = "li"
+           dtd         = "L"
+           type        = "NUMBER"
+           default     = "true"
+/>
+<attribute name        = "valuetype"
+           helpref     = "struct/objects.html#adef-valuetype"
+           description = "How to interpret value"
+           relatedTags = "param"
+           dtd         = ""
+           type        = "(DATA | REF | OBJECT)"
+           default     = "true"
+/>
+<attribute name        = "version"
+           helpref     = "struct/global.html#adef-version"
+           description = "Constant"
+           relatedTags = "html"
+           dtd         = "L"
+           type        = "CDATA"
+           default     = "true"
+/>
+<attribute name        = "vlink"
+           helpref     = "struct/global.html#adef-vlink"
+           description = "color of visited links"
+           relatedTags = "body"
+           dtd         = "L"
+           type        = "Color"
+           default     = "true"
+/>
+<attribute name        = "vspace"
+           helpref     = "struct/objects.html#adef-vspace"
+           description = "vertical gutter"
+           relatedTags = "applet,img,object"
+           dtd         = "L"
+           type        = "Pixels"
+           default     = "true"
+/>
+<attribute name        = "width"
+           helpref     = "present/graphics.html#adef-width-HR"
+           description = ""
+           relatedTags = "hr"
+           dtd         = "L"
+           type        = "Length"
+           default     = "true"
+/>
+<attribute name        = "width"
+           helpref     = "present/frames.html#adef-width-IFRAME"
+           description = "frame width"
+           relatedTags = "iframe"
+           dtd         = "L"
+           type        = "Length"
+           default     = "true"
+/>
+<attribute name        = "width"
+           helpref     = "struct/objects.html#adef-width-IMG"
+           description = "override width"
+           relatedTags = "img,object"
+           dtd         = ""
+           type        = "Length"
+           default     = "true"
+/>
+<attribute name        = "width"
+           helpref     = "struct/tables.html#adef-width-TABLE"
+           description = "table width"
+           relatedTags = "table"
+           dtd         = ""
+           type        = "Length"
+           default     = "true"
+/>
+<attribute name        = "width"
+           helpref     = "struct/tables.html#adef-width-TH"
+           description = "width for cell"
+           relatedTags = "td,th"
+           dtd         = "L"
+           type        = "Length"
+           default     = "true"
+/>
+<attribute name        = "width"
+           helpref     = "struct/objects.html#adef-width-APPLET"
+           description = "initial width"
+           relatedTags = "applet"
+           dtd         = "L"
+           type        = "Length"
+           default     = "false"
+/>
+<attribute name        = "width"
+           helpref     = "struct/tables.html#adef-width-COL"
+           description = "column width specification"
+           relatedTags = "col"
+           dtd         = ""
+           type        = "MultiLength"
+           default     = "true"
+/>
+<attribute name        = "width"
+           helpref     = "struct/tables.html#adef-width-COLGROUP"
+           description = "default width for enclosed COLs"
+           relatedTags = "colgroup"
+           dtd         = ""
+           type        = "MultiLength"
+           default     = "true"
+/>
+<attribute name        = "width"
+           helpref     = "struct/text.html#adef-width-PRE"
+           description = ""
+           relatedTags = "pre"
+           dtd         = "L"
+           type        = "NUMBER"
+           default     = "true"
+/>
+</html-property-table>
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/mathmltable.xml b/xml/impl/src/com/intellij/xml/util/documentation/mathmltable.xml
new file mode 100644
index 0000000..6e659cc
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/mathmltable.xml
@@ -0,0 +1,210 @@
+<html-property-table baseHelpRef="http://www.w3.org/TR/mathml-for-css/">
+<tag name        = "mi"
+     helpref     = "#mi"
+     description = "represents a mathematical identifier; its rendering consists of the text content displayed in a typeface corresponding to the mathvariant attribute"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mn"
+     helpref     = "#mn"
+     description = "represents a numeric literal or other data that should be rendered as a numeric literal"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mo"
+     helpref     = "#mo"
+     description = "represents an operator or anything that should be rendered as an operator"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mtext"
+     helpref     = "#mtext"
+     description = "intended to denote commentary text"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mspace"
+     helpref     = "#mspace"
+     description = "represents a blank space of any desired size, as set by its attributes"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "true"
+     dtd         = ""
+/>
+<tag name        = "ms"
+     helpref     = "#ms"
+     description = "used to represent string literals in expressions meant to be interpreted by computer algebra systems or other systems containing programming languages"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mfrac"
+     helpref     = "#mfrac"
+     description = "used for fractions"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "msqrt"
+     helpref     = "#msqrt"
+     description = "used for square roots"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mroot"
+     helpref     = "#mroot"
+     description = "used to draw radicals with indices"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "merror"
+     helpref     = "#merror"
+     description = "displays its contents as an error message"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mphantom"
+     helpref     = "#mphantom"
+     description = "renders its content as invisible, but with the same size and other dimensions, including baseline position, that its contents would have if they were rendered normally"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mfenced"
+     helpref     = "#mfenced"
+     description = "provides a convenient way of expressing common constructs involving fences (i.e., braces, brackets, and parentheses)"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "menclose"
+     helpref     = "#menclose"
+     description = "renders its content inside the enclosing notation specified by its notation attribute, menclose accepts any number of arguments"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "msup"
+     helpref     = "#msup"
+     description = "used to attach a superscript to a base"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "msubsup"
+     helpref     = "#msubsup"
+     description = "used to attach both a subscript and a superscript to a base expression"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "munder"
+     helpref     = "#munder"
+     description = "used to attach an underscript below a base"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mover"
+     helpref     = "#mover"
+     description = "used to attach an overscript over a base"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "munderover"
+     helpref     = "#munderover"
+     description = "used to attach both an underscript and an overscript to a base"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mmultiscripts"
+     helpref     = "#mmultiscripts"
+     description = "allows adding pairs of prescripts to one base expression"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mtable"
+     helpref     = "#mtable"
+     description = "a matrix or table is specified using the mtable element"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mtr"
+     helpref     = "#mtr"
+     description = "represents one row in a table or matrix"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mtd"
+     helpref     = "#mtd"
+     description = "represents one entry, or cell, in a table or matrix"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mrow"
+     helpref     = "#mrow"
+     description = "used to add operator before last operand in elementary math notations such as 2D addition, subtraction and multiplication"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mlongdiv"
+     helpref     = "#mlongdiv"
+     description = "elementary math notations for long division can be produced using mlongdiv layout schemata"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "maction"
+     helpref     = "#maction"
+     description = "to provide a mechanism for binding actions to expressions, MathML provides the maction element"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "semantics"
+     helpref     = "#semantics"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+</html-property-table>
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/xml/util/documentation/svgtable.xml b/xml/impl/src/com/intellij/xml/util/documentation/svgtable.xml
new file mode 100644
index 0000000..414169b
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/documentation/svgtable.xml
@@ -0,0 +1,531 @@
+<html-property-table baseHelpRef="http://www.w3.org/TR/SVG/">
+<tag name        = "altGlyph"
+     helpref     = "text.html#AltGlyphElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "altGlyphDef"
+     helpref     = "text.html#AltGlyphDefElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "altGlyphItem"
+     helpref     = "text.html#AltGlyphItemElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "animate"
+     helpref     = "animate.html#AnimateElement"
+     description = "heading"
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "animateColor"
+     helpref     = "text.html#AnimateColorElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "animateMotion"
+     helpref     = "text.html#AnimateMotionElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "animateTransform"
+     helpref     = "text.html#AnimateTransformElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "circle"
+     helpref     = "shapes.html#CircleElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "clipPath"
+     helpref     = "masking.html#ClipPathElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "color-profile"
+     helpref     = "color.html#ColorProfileElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "cursor"
+     helpref     = "interact.html#CursorElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "defs"
+     helpref     = "struct.html#DefsElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "desc"
+     helpref     = "struct.html#DescElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "ellipse"
+     helpref     = "shapes.html#EllipseElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feBlend"
+     helpref     = "filters.html#feBlendElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feColorMatrix"
+     helpref     = "filters.html#feColorMatrixElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feComponentTransfer"
+     helpref     = "filters.html#feComponentTransferElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feComposite"
+     helpref     = "filters.html#feCompositeElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feConvolveMatrix"
+     helpref     = "filters.html#feConvolveMatrixElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feDiffuseLightingElement"
+     helpref     = "filters.html#feDiffuseLightingElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feDisplacementMapElement"
+     helpref     = "filters.html#feDisplacementMapElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feDistantLight"
+     helpref     = "filters.html#feDistantLightElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feFlood"
+     helpref     = "filters.html#feFloodElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feFuncA"
+     helpref     = "filters.html#feFuncAElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feFuncB"
+     helpref     = "filters.html#feFuncBElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feFuncG"
+     helpref     = "filters.html#feFuncGElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feFuncR"
+     helpref     = "filters.html#feFuncRElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feGaussianBlur"
+     helpref     = "filters.html#feGaussianBlurElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feImage"
+     helpref     = "filters.html#feImageElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feMerge"
+     helpref     = "filters.html#feMergeElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feMergeNode"
+     helpref     = "filters.html#feMergeNodeElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feMorphology"
+     helpref     = "filters.html#feMorphologyElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feOffset"
+     helpref     = "filters.html#feOffsetElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "fePointLight"
+     helpref     = "filters.html#fePointLightElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feSpecularLighting"
+     helpref     = "filters.html#feSpecularLightingElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feSpotLight"
+     helpref     = "filters.html#feSpotLightElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feTile"
+     helpref     = "filters.html#feTileElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "feTurbulence"
+     helpref     = "filters.html#feTurbulenceElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "filter"
+     helpref     = "filters.html#FilterElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "g"
+     helpref     = "struct.html#GElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+/>
+<tag name        = "glyph"
+     helpref     = "fonts.html#GlyphElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "glyphRef"
+     helpref     = "text.html#GlyphRefElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "hkern"
+     helpref     = "fonts.html#HKernElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "image"
+     helpref     = "struct.html#ImageElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "line"
+     helpref     = "shapes.html#LineElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "linearGradient"
+     helpref     = "pservers.html#LinearGradientElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "marker"
+     helpref     = "painting.html#MarkerElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mask"
+     helpref     = "masking.html#MaskElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "metadata"
+     helpref     = "metadata.html#MetadataElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "missing-glyph"
+     helpref     = "fonts.html#MissingGlyphElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "mpath"
+     helpref     = "animate.html#MPathElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "foreignObject"
+     helpref     = "extend.html#ForeignObjectElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "path"
+     helpref     = "paths.html#PathElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "pattern"
+     helpref     = "pservers.html#PatternElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "polygon"
+     helpref     = "shapes.html#PolygonElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "polyline"
+     helpref     = "shapes.html#PolylineElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "radialGradient"
+     helpref     = "pservers.html#RadialGradientElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "rect"
+     helpref     = "shapes.html#RectElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "set"
+     helpref     = "animate.html#SetElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "stop"
+     helpref     = "pservers.html#StopElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "svg"
+     helpref     = "struct.html#SVGElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "switch"
+     helpref     = "struct.html#SwitchElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "symbol"
+     helpref     = "struct.html#SymbolElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "switch"
+     helpref     = "struct.html#SwitchElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "tspan"
+     helpref     = "text.html#TSpanElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+<tag name        = "vkern"
+     helpref     = "fonts.html#VKernElement"
+     description = ""
+     startTag    = "true"
+     endTag      = "true"
+     empty       = "false"
+     dtd         = ""
+/>
+</html-property-table>
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/xml/util/htmlreferencetable.xml b/xml/impl/src/com/intellij/xml/util/htmlreferencetable.xml
new file mode 100644
index 0000000..52089a7
--- /dev/null
+++ b/xml/impl/src/com/intellij/xml/util/htmlreferencetable.xml
@@ -0,0 +1,7 @@
+<dd>
+  <tag name="a">
+    <atttribute name="href">
+      <reference type="WebFileReference"/>
+    </atttribute>
+  </tag>
+</dd>
\ No newline at end of file
diff --git a/xml/impl/xml.iml b/xml/impl/xml.iml
new file mode 100644
index 0000000..0395394
--- /dev/null
+++ b/xml/impl/xml.iml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/resources" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="module" module-name="xml-openapi" exported="" />
+    <orderEntry type="library" name="Xerces" level="project" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="platform-impl" />
+    <orderEntry type="module" module-name="lang-impl" />
+    <orderEntry type="module" module-name="icons" />
+    <orderEntry type="library" name="XmlBeans" level="project" />
+    <orderEntry type="module" module-name="platform-resources" />
+    <orderEntry type="module" module-name="vcs-api" />
+  </component>
+  <component name="copyright">
+    <Base>
+      <setting name="state" value="1" />
+    </Base>
+  </component>
+</module>
+
diff --git a/xml/openapi/src/com/intellij/codeInspection/DefaultXmlSuppressionProvider.java b/xml/openapi/src/com/intellij/codeInspection/DefaultXmlSuppressionProvider.java
new file mode 100644
index 0000000..52d1b95
--- /dev/null
+++ b/xml/openapi/src/com/intellij/codeInspection/DefaultXmlSuppressionProvider.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection;
+
+import com.intellij.openapi.command.undo.UndoUtil;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiComment;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.codeStyle.CodeStyleManager;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import com.intellij.refactoring.util.CommonRefactoringUtil;
+import com.intellij.util.ArrayUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class DefaultXmlSuppressionProvider extends XmlSuppressionProvider {
+
+  public static final String SUPPRESS_MARK = "suppress";
+
+  @Override
+  public boolean isProviderAvailable(@NotNull PsiFile file) {
+    return true;
+  }
+
+  @Override
+  public boolean isSuppressedFor(@NotNull PsiElement element, @NotNull String inspectionId) {
+    final XmlTag tag = element instanceof XmlFile ? ((XmlFile)element).getRootTag() : PsiTreeUtil.getContextOfType(element, XmlTag.class, false);
+    return tag != null && findSuppression(tag, inspectionId, element) != null;
+  }
+
+  @Override
+  public void suppressForFile(@NotNull PsiElement element, @NotNull String inspectionId) {
+    final PsiFile file = element.getContainingFile();
+    final XmlDocument document = ((XmlFile)file).getDocument();
+    final PsiElement anchor = document != null ? document.getRootTag() : file.findElementAt(0);
+    assert anchor != null;
+    suppress(file, findFileSuppression(anchor, null, element), inspectionId, anchor.getTextRange().getStartOffset());
+  }
+
+  @Override
+  public void suppressForTag(@NotNull PsiElement element, @NotNull String inspectionId) {
+    final XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class);
+    assert tag != null;
+    suppress(element.getContainingFile(), findSuppressionLeaf(tag, null, 0), inspectionId, tag.getTextRange().getStartOffset());
+  }
+
+  @Nullable
+  protected PsiElement findSuppression(final PsiElement anchor, final String id, PsiElement originalElement) {
+    final PsiElement element = findSuppressionLeaf(anchor, id, 0);
+    if (element != null) return element;
+
+    return findFileSuppression(anchor, id, originalElement);
+  }
+
+  @Nullable
+  protected PsiElement findFileSuppression(PsiElement anchor, String id, PsiElement originalElement) {
+    final PsiFile file = anchor.getContainingFile();
+    if (file instanceof XmlFile) {
+      final XmlDocument document = ((XmlFile)file).getDocument();
+      final XmlTag rootTag = document != null ? document.getRootTag() : null;
+      PsiElement leaf = rootTag != null ? rootTag.getPrevSibling() : file.findElementAt(0);
+      return findSuppressionLeaf(leaf, id, 0);
+    }
+    return null;
+  }
+
+  @Nullable
+  protected PsiElement findSuppressionLeaf(PsiElement leaf, @Nullable final String id, int offset) {
+    while (leaf != null && leaf.getTextOffset() >= offset) {
+      if (leaf instanceof PsiComment || leaf instanceof XmlProlog || leaf instanceof XmlText) {
+        @NonNls String text = leaf.getText();
+        if (isSuppressedFor(text, id)) return leaf;
+      }
+      leaf = leaf.getPrevSibling();
+      if (leaf instanceof XmlTag) {
+        return null;
+      }
+    }
+    return null;
+  }
+
+  private boolean isSuppressedFor(@NonNls final String text, @Nullable final String id) {
+    if (!text.contains(getPrefix())) {
+      return false;
+    }
+    if (id == null) {
+      return true;
+    }
+    @NonNls final String[] parts = text.split("[ ,]");
+    return ArrayUtil.find(parts, id) != -1 || ArrayUtil.find(parts, XmlSuppressableInspectionTool.ALL) != -1;
+  }
+
+  protected void suppress(PsiFile file, final PsiElement suppressionElement, String inspectionId, final int offset) {
+    final Project project = file.getProject();
+    if (!CommonRefactoringUtil.checkReadOnlyStatus(file)) {
+      return;
+    }
+    final Document doc = PsiDocumentManager.getInstance(project).getDocument(file);
+    assert doc != null;
+
+    if (suppressionElement != null) {
+      final TextRange textRange = suppressionElement.getTextRange();
+      String text = suppressionElement.getText();
+      final String suppressionText = getSuppressionText(inspectionId, text);
+      doc.replaceString(textRange.getStartOffset(), textRange.getEndOffset(), suppressionText);
+    } else {
+      final String suppressionText = getSuppressionText(inspectionId, null);
+      doc.insertString(offset, suppressionText);
+      CodeStyleManager.getInstance(project).adjustLineIndent(doc, offset + suppressionText.length());
+      UndoUtil.markPsiFileForUndo(file);
+    }
+  }
+
+  protected String getSuppressionText(String inspectionId, @Nullable String originalText) {
+    if (originalText == null) {
+      return getPrefix() + inspectionId + getSuffix();
+    } else if (inspectionId.equals(XmlSuppressableInspectionTool.ALL)) {
+      final int pos = originalText.indexOf(getPrefix());
+      return originalText.substring(0, pos) + getPrefix() + inspectionId + getSuffix();
+    }
+    return originalText.replace(getSuffix(), ", " + inspectionId + getSuffix());
+  }
+
+  @NonNls
+  protected String getPrefix() {
+    return "<!--" +
+           SUPPRESS_MARK +
+           " ";
+  }
+
+  @NonNls
+  protected String getSuffix() {
+    return " -->\n";
+  }
+}
diff --git a/xml/openapi/src/com/intellij/codeInspection/XmlInspectionGroupNames.java b/xml/openapi/src/com/intellij/codeInspection/XmlInspectionGroupNames.java
new file mode 100644
index 0000000..6824f7f
--- /dev/null
+++ b/xml/openapi/src/com/intellij/codeInspection/XmlInspectionGroupNames.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInspection;
+
+import com.intellij.xml.XmlBundle;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public interface XmlInspectionGroupNames {
+  String HTML_INSPECTIONS = XmlBundle.message("html.inspections.group.name");
+  String XML_INSPECTIONS = XmlBundle.message("xml.inspections.group.name");
+}
diff --git a/xml/openapi/src/com/intellij/codeInspection/XmlSuppressableInspectionTool.java b/xml/openapi/src/com/intellij/codeInspection/XmlSuppressableInspectionTool.java
new file mode 100644
index 0000000..59fbf53
--- /dev/null
+++ b/xml/openapi/src/com/intellij/codeInspection/XmlSuppressableInspectionTool.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection;
+
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+public abstract class XmlSuppressableInspectionTool extends LocalInspectionTool implements CustomSuppressableInspectionTool {
+  @NonNls static final String ALL = "ALL";
+
+  @Override
+  public SuppressIntentionAction[] getSuppressActions(final PsiElement element) {
+    return new SuppressIntentionAction[]{new SuppressTag(), new SuppressForFile(getID()), new SuppressAllForFile()};
+  }
+
+  @Override
+  public boolean isSuppressedFor(@NotNull final PsiElement element) {
+    return XmlSuppressionProvider.isSuppressed(element, getID());
+  }
+
+  public class SuppressTag extends SuppressTagStatic {
+
+    public SuppressTag() {
+      super(getID());
+    }
+  }
+
+  public static class SuppressTagStatic extends SuppressIntentionAction {
+    private final String id;
+
+    public SuppressTagStatic(@NotNull String id) {
+      this.id = id;
+    }
+
+    @Override
+    @NotNull
+    public String getText() {
+      return InspectionsBundle.message("xml.suppressable.for.tag.title");
+    }
+
+    @Override
+    @NotNull
+    public String getFamilyName() {
+      return getText();
+    }
+
+    @Override
+    public boolean isAvailable(@NotNull final Project project, final Editor editor, @NotNull final PsiElement element) {
+      return PsiTreeUtil.getParentOfType(element, XmlTag.class) != null;
+    }
+
+    @Override
+    public void invoke(@NotNull final Project project, final Editor editor, @NotNull final PsiElement element) throws IncorrectOperationException {
+      XmlSuppressionProvider.getProvider(element.getContainingFile()).suppressForTag(element, id);
+    }
+  }
+
+  public static class SuppressForFile extends SuppressIntentionAction {
+    private final String myInspectionId;
+
+    public SuppressForFile(@NotNull String inspectionId) {
+      myInspectionId = inspectionId;
+    }
+
+    @Override
+    @NotNull
+    public String getText() {
+      return InspectionsBundle.message("xml.suppressable.for.file.title");
+    }
+
+    @Override
+    @NotNull
+    public String getFamilyName() {
+      return getText();
+    }
+
+    @Override
+    public void invoke(@NotNull final Project project, final Editor editor, @NotNull final PsiElement element) throws IncorrectOperationException {
+      XmlSuppressionProvider.getProvider(element.getContainingFile()).suppressForFile(element, myInspectionId);
+    }
+
+    @Override
+    public boolean isAvailable(@NotNull final Project project, final Editor editor, @NotNull final PsiElement element) {
+      return  element.isValid() && element.getContainingFile() instanceof XmlFile;
+    }
+  }
+
+  public static class SuppressAllForFile extends SuppressForFile {
+
+    public SuppressAllForFile() {
+      super(ALL);
+    }
+
+    @Override
+    @NotNull
+    public String getText() {
+      return InspectionsBundle.message("xml.suppressable.all.for.file.title");
+    }
+  }
+}
diff --git a/xml/openapi/src/com/intellij/codeInspection/XmlSuppressionProvider.java b/xml/openapi/src/com/intellij/codeInspection/XmlSuppressionProvider.java
new file mode 100644
index 0000000..9975ceb
--- /dev/null
+++ b/xml/openapi/src/com/intellij/codeInspection/XmlSuppressionProvider.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.codeInspection;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public abstract class XmlSuppressionProvider {
+
+  public static ExtensionPointName<XmlSuppressionProvider> EP_NAME = new ExtensionPointName<XmlSuppressionProvider>("com.intellij.xml.xmlSuppressionProvider");
+
+  public static boolean isSuppressed(@NotNull PsiElement element, @NotNull String inspectionId) {
+    for (XmlSuppressionProvider provider : Extensions.getExtensions(EP_NAME)) {
+      if (provider.isSuppressedFor(element, inspectionId)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  public static XmlSuppressionProvider getProvider(@NotNull PsiFile file) {
+    for (XmlSuppressionProvider provider : Extensions.getExtensions(EP_NAME)) {
+      if (provider.isProviderAvailable(file)) {
+        return provider;
+      }
+    }
+    throw new RuntimeException("No providers found for " + file);
+  }
+
+  public abstract boolean isProviderAvailable(@NotNull PsiFile file);
+
+  public abstract boolean isSuppressedFor(@NotNull PsiElement element, @NotNull String inspectionId);
+
+  public abstract void suppressForFile(@NotNull PsiElement element, @NotNull String inspectionId);
+
+  public abstract void suppressForTag(@NotNull PsiElement element, @NotNull String inspectionId);
+
+}
diff --git a/xml/openapi/src/com/intellij/html/RelaxedHtmlNSDescriptor.java b/xml/openapi/src/com/intellij/html/RelaxedHtmlNSDescriptor.java
new file mode 100644
index 0000000..275cbe9
--- /dev/null
+++ b/xml/openapi/src/com/intellij/html/RelaxedHtmlNSDescriptor.java
@@ -0,0 +1,9 @@
+package com.intellij.html;
+
+import com.intellij.xml.XmlNSDescriptor;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public interface RelaxedHtmlNSDescriptor extends XmlNSDescriptor {
+}
diff --git a/xml/openapi/src/com/intellij/ide/browsers/RemoteFileUpdater.java b/xml/openapi/src/com/intellij/ide/browsers/RemoteFileUpdater.java
new file mode 100644
index 0000000..5c59ae4
--- /dev/null
+++ b/xml/openapi/src/com/intellij/ide/browsers/RemoteFileUpdater.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author nik
+ */
+public abstract class RemoteFileUpdater {
+  public static final ExtensionPointName<RemoteFileUpdater> EP_NAME = ExtensionPointName.create("com.intellij.remoteFileUpdater");
+
+  public abstract boolean updateFile(@NotNull VirtualFile file, Project project, @NotNull Runnable onUpdateFinished);
+}
diff --git a/xml/openapi/src/com/intellij/ide/browsers/WebBrowserService.java b/xml/openapi/src/com/intellij/ide/browsers/WebBrowserService.java
new file mode 100644
index 0000000..040d637
--- /dev/null
+++ b/xml/openapi/src/com/intellij/ide/browsers/WebBrowserService.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers;
+
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author nik
+ */
+public abstract class WebBrowserService {
+  public static WebBrowserService getInstance() {
+    return ServiceManager.getService(WebBrowserService.class);
+  }
+
+  public abstract boolean canOpenInBrowser(@NotNull PsiElement psiElement);
+
+  @Nullable
+  public abstract String getUrlToOpen(@NotNull PsiElement psiElement);
+
+  @Nullable
+  public abstract String getUrlToOpen(@NotNull PsiElement psiElement, boolean preferLocalUrl) throws WebBrowserUrlProvider.BrowserException;
+
+}
diff --git a/xml/openapi/src/com/intellij/ide/browsers/WebBrowserUrlProvider.java b/xml/openapi/src/com/intellij/ide/browsers/WebBrowserUrlProvider.java
new file mode 100644
index 0000000..fba5b3f
--- /dev/null
+++ b/xml/openapi/src/com/intellij/ide/browsers/WebBrowserUrlProvider.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author spleaner
+ */
+public abstract class WebBrowserUrlProvider {
+  public static ExtensionPointName<WebBrowserUrlProvider> EP_NAME = ExtensionPointName.create("com.intellij.webBrowserUrlProvider");
+
+  /**
+   * Browser exceptions are printed in Error Dialog when user presses any browser button.
+   */
+  public static class BrowserException extends Exception {
+    public BrowserException(final String message) {
+      super(message);
+    }
+  }
+
+  /**
+   * Invariant: element has not null containing psi file with not null virtual file
+   * @deprecated
+   */
+  @NotNull
+  public String getUrl(@NotNull PsiElement element) throws BrowserException {
+    throw new AbstractMethodError();
+  }
+
+  @NotNull
+  public String getUrl(@NotNull PsiElement element, @NotNull PsiFile psiFile, @NotNull VirtualFile virtualFile) throws BrowserException {
+    return getUrl(element);
+  }
+
+  /**
+   * Invariant: element has not null containing psi file with not null virtual file
+   */
+  public abstract boolean canHandleElement(@NotNull final PsiElement element);
+
+  @Nullable
+  public String getOpenInBrowserActionText(@NotNull PsiFile file) {
+    return null;
+  }
+
+  @Nullable
+  public String getOpenInBrowserActionDescription(@NotNull PsiFile file) {
+    return null;
+  }
+}
diff --git a/xml/openapi/src/com/intellij/ide/browsers/WebBrowserUrlProviders.java b/xml/openapi/src/com/intellij/ide/browsers/WebBrowserUrlProviders.java
new file mode 100644
index 0000000..b545197
--- /dev/null
+++ b/xml/openapi/src/com/intellij/ide/browsers/WebBrowserUrlProviders.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.browsers;
+
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author spleaner
+ *
+ * @deprecated use {@link WebBrowserService} instead
+ */
+public class WebBrowserUrlProviders  {
+  private WebBrowserUrlProviders() {
+  }
+
+  @Nullable
+  public static WebBrowserUrlProvider getProvider(@Nullable PsiElement element) {
+    if (element == null) {
+      return null;
+    }
+
+    final WebBrowserUrlProvider[] urlProviders = WebBrowserUrlProvider.EP_NAME.getExtensions();
+    for (WebBrowserUrlProvider urlProvider : urlProviders) {
+      if (urlProvider.canHandleElement(element)) {
+        return urlProvider;
+      }
+    }
+
+    return null;
+  }
+
+}
diff --git a/xml/openapi/src/com/intellij/ide/structureView/xml/XmlStructureViewBuilderProvider.java b/xml/openapi/src/com/intellij/ide/structureView/xml/XmlStructureViewBuilderProvider.java
new file mode 100644
index 0000000..8099e2d
--- /dev/null
+++ b/xml/openapi/src/com/intellij/ide/structureView/xml/XmlStructureViewBuilderProvider.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.structureView.xml;
+
+import com.intellij.ide.structureView.StructureViewBuilder;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public interface XmlStructureViewBuilderProvider {
+  @NonNls String EXTENSION_POINT_NAME = "com.intellij.xmlStructureViewBuilderProvider";
+
+  @Nullable
+  StructureViewBuilder createStructureViewBuilder(@NotNull XmlFile file);
+}
diff --git a/xml/openapi/src/com/intellij/ide/structureView/xml/XmlStructureViewElementProvider.java b/xml/openapi/src/com/intellij/ide/structureView/xml/XmlStructureViewElementProvider.java
new file mode 100644
index 0000000..74b0aae
--- /dev/null
+++ b/xml/openapi/src/com/intellij/ide/structureView/xml/XmlStructureViewElementProvider.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.ide.structureView.xml;
+
+import com.intellij.ide.structureView.StructureViewTreeElement;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public interface XmlStructureViewElementProvider {
+  @NonNls String EXTENSION_POINT_NAME = "com.intellij.xmlStructureViewElementProvider";
+
+  @Nullable
+  StructureViewTreeElement createCustomXmlTagTreeElement(@NotNull XmlTag tag);
+}
diff --git a/xml/openapi/src/com/intellij/javaee/ExternalResourceManager.java b/xml/openapi/src/com/intellij/javaee/ExternalResourceManager.java
new file mode 100644
index 0000000..73f31e3
--- /dev/null
+++ b/xml/openapi/src/com/intellij/javaee/ExternalResourceManager.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.ModificationTracker;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * author: lesya
+ */
+public abstract class ExternalResourceManager implements ModificationTracker {
+
+  public static ExternalResourceManager getInstance() {
+    return ServiceManager.getService(ExternalResourceManager.class);
+  }
+
+  public abstract void addResource(@NonNls String url, @NonNls String location);
+  public abstract void addResource(@NonNls String url, @NonNls String version, @NonNls String location);
+
+  public abstract void removeResource(String url);
+  public abstract void removeResource(String url, String version);
+
+  /** @see #getResourceLocation(String, com.intellij.openapi.project.Project) */
+  @Deprecated
+  public abstract String getResourceLocation(@NonNls String url);
+  public abstract String getResourceLocation(@NonNls String url, String version);
+
+  public abstract String getResourceLocation(@NonNls String url, @NotNull Project project);
+
+  @Nullable
+  public abstract PsiFile getResourceLocation(@NotNull @NonNls String url, @NotNull PsiFile baseFile, String version);
+
+  public abstract String[] getResourceUrls(@Nullable FileType fileType, final boolean includeStandard);
+  public abstract String[] getResourceUrls(@Nullable FileType fileType, @NonNls String version, final boolean includeStandard);
+}
diff --git a/xml/openapi/src/com/intellij/javaee/ResourceRegistrar.java b/xml/openapi/src/com/intellij/javaee/ResourceRegistrar.java
new file mode 100644
index 0000000..35c0be4
--- /dev/null
+++ b/xml/openapi/src/com/intellij/javaee/ResourceRegistrar.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.javaee;
+
+import org.jetbrains.annotations.NonNls;
+
+/**
+ * @author Dmitry Avdeev
+ * @see com.intellij.javaee.StandardResourceProvider
+ */
+public interface ResourceRegistrar {
+
+  void addStdResource(@NonNls String resource, @NonNls String fileName);
+  void addStdResource(@NonNls String resource, @NonNls String fileName, Class klass);
+  void addStdResource(@NonNls String resource, @NonNls String version, @NonNls String fileName, Class klass);
+  void addIgnoredResource(@NonNls String url);
+
+}
diff --git a/xml/openapi/src/com/intellij/javaee/StandardResourceEP.java b/xml/openapi/src/com/intellij/javaee/StandardResourceEP.java
new file mode 100644
index 0000000..bf91c4e
--- /dev/null
+++ b/xml/openapi/src/com/intellij/javaee/StandardResourceEP.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.javaee;
+
+import com.intellij.openapi.extensions.AbstractExtensionPointBean;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.util.xmlb.annotations.Attribute;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class StandardResourceEP extends AbstractExtensionPointBean {
+
+  public static final ExtensionPointName<StandardResourceEP> EP_NAME = ExtensionPointName.create("com.intellij.standardResource");
+
+  /**
+   * URL or URI to be mapped to given resource, e.g. http://www.w3.org/2001/XMLSchema
+   */
+  @Attribute("url")
+  public String url;
+
+  /**
+   * Path to resource, e.g. foo/bar.xsd (without leading slash)
+   */
+  @Attribute("path")
+  public String resourcePath;
+
+  @Attribute("version")
+  public String version;
+}
diff --git a/xml/openapi/src/com/intellij/javaee/StandardResourceProvider.java b/xml/openapi/src/com/intellij/javaee/StandardResourceProvider.java
new file mode 100644
index 0000000..8b33132
--- /dev/null
+++ b/xml/openapi/src/com/intellij/javaee/StandardResourceProvider.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.javaee;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+
+/**
+ * @author Dmitry Avdeev
+ * @see StandardResourceEP
+ */
+public interface StandardResourceProvider {
+
+  ExtensionPointName<StandardResourceProvider> EP_NAME = ExtensionPointName.create("com.intellij.standardResourceProvider");
+  
+  void registerResources(ResourceRegistrar registrar);
+}
diff --git a/xml/openapi/src/com/intellij/javaee/UriUtil.java b/xml/openapi/src/com/intellij/javaee/UriUtil.java
new file mode 100644
index 0000000..6ae54dc
--- /dev/null
+++ b/xml/openapi/src/com/intellij/javaee/UriUtil.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.javaee;
+
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFileSystemItem;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class UriUtil {
+  private UriUtil() {}
+
+  /** @see #findRelative(String, com.intellij.psi.PsiFileSystemItem) */
+  @Deprecated
+  @Nullable
+  public static VirtualFile findRelativeFile(String uri, VirtualFile base) {
+    return VfsUtil.findRelativeFile(ExternalResourceManager.getInstance().getResourceLocation(uri), base);
+  }
+
+  @Nullable
+  public static VirtualFile findRelative(String uri, @NotNull PsiFileSystemItem base) {
+    String location = ExternalResourceManager.getInstance().getResourceLocation(uri, base.getProject());
+    return VfsUtil.findRelativeFile(location, base.getVirtualFile());
+  }
+}
\ No newline at end of file
diff --git a/xml/openapi/src/com/intellij/lang/documentation/DocumentationUtil.java b/xml/openapi/src/com/intellij/lang/documentation/DocumentationUtil.java
new file mode 100644
index 0000000..7ba8608
--- /dev/null
+++ b/xml/openapi/src/com/intellij/lang/documentation/DocumentationUtil.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lang.documentation;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class DocumentationUtil {
+  @SuppressWarnings({"HardCodedStringLiteral"})
+  public static void formatEntityName(String type, String name, StringBuilder destination) {
+    destination.append(type).append(":&nbsp;<b>").append(name).append("</b><br>");
+  }
+}
diff --git a/xml/openapi/src/com/intellij/lexer/EmbedmentLexer.java b/xml/openapi/src/com/intellij/lexer/EmbedmentLexer.java
new file mode 100644
index 0000000..edc9529
--- /dev/null
+++ b/xml/openapi/src/com/intellij/lexer/EmbedmentLexer.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.lexer;
+
+import com.intellij.psi.tree.IElementType;
+
+/**
+ * @author Maxim.Mossienko
+ */
+public interface EmbedmentLexer {
+  int getEmbeddedInitialState(final IElementType tokenType);
+}
diff --git a/xml/openapi/src/com/intellij/openapi/editor/XmlHighlighterColors.java b/xml/openapi/src/com/intellij/openapi/editor/XmlHighlighterColors.java
new file mode 100644
index 0000000..17d1e1c
--- /dev/null
+++ b/xml/openapi/src/com/intellij/openapi/editor/XmlHighlighterColors.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.openapi.editor;
+
+import com.intellij.openapi.editor.colors.TextAttributesKey;
+
+/**
+ * @author yole
+ */
+public class XmlHighlighterColors {
+  private XmlHighlighterColors() {
+  }
+
+  public static final TextAttributesKey
+    XML_PROLOGUE = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("XML_PROLOGUE");
+  public static final TextAttributesKey
+    XML_COMMENT = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("XML_COMMENT");
+  public static final TextAttributesKey XML_TAG = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("XML_TAG");
+  public static final TextAttributesKey
+    XML_TAG_NAME = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("XML_TAG_NAME");
+  public static final TextAttributesKey
+    XML_ATTRIBUTE_NAME = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("XML_ATTRIBUTE_NAME");
+  public static final TextAttributesKey
+    XML_ATTRIBUTE_VALUE = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("XML_ATTRIBUTE_VALUE");
+  public static final TextAttributesKey
+    XML_TAG_DATA = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("XML_TAG_DATA");
+  public static final TextAttributesKey
+    XML_ENTITY_REFERENCE = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("XML_ENTITY_REFERENCE");
+
+  public static final TextAttributesKey
+    HTML_COMMENT = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("HTML_COMMENT");
+  public static final TextAttributesKey HTML_TAG = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("HTML_TAG");
+  public static final TextAttributesKey
+    HTML_TAG_NAME = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("HTML_TAG_NAME");
+  public static final TextAttributesKey
+    HTML_ATTRIBUTE_NAME = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("HTML_ATTRIBUTE_NAME");
+  public static final TextAttributesKey
+    HTML_ATTRIBUTE_VALUE = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("HTML_ATTRIBUTE_VALUE");
+  public static final TextAttributesKey
+    HTML_ENTITY_REFERENCE = com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey("HTML_ENTITY_REFERENCE");
+
+  public static final TextAttributesKey HTML_CODE =
+    TextAttributesKey.createTextAttributesKey("HTML_CODE", HighlighterColors.TEXT.getDefaultAttributes());
+}
diff --git a/xml/openapi/src/com/intellij/patterns/XmlAttributeValuePattern.java b/xml/openapi/src/com/intellij/patterns/XmlAttributeValuePattern.java
new file mode 100644
index 0000000..459b9d3
--- /dev/null
+++ b/xml/openapi/src/com/intellij/patterns/XmlAttributeValuePattern.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.patterns;
+
+import com.intellij.psi.xml.*;
+import com.intellij.psi.PsiElement;
+import com.intellij.util.ProcessingContext;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NonNls;
+
+/**
+ * @author peter
+ */
+public class XmlAttributeValuePattern extends XmlElementPattern<XmlAttributeValue,XmlAttributeValuePattern>{
+  private static final InitialPatternCondition<XmlAttributeValue> CONDITION = new InitialPatternCondition<XmlAttributeValue>(XmlAttributeValue.class) {
+    public boolean accepts(@Nullable final Object o, final ProcessingContext context) {
+      return o instanceof XmlAttributeValue;
+    }
+  };
+
+  public XmlAttributeValuePattern() {
+    this(CONDITION);
+  }
+
+  public XmlAttributeValuePattern(InitialPatternCondition<XmlAttributeValue> condition) {
+    super(condition);
+  }
+
+  public XmlAttributeValuePattern withLocalName(@NonNls String... names) {
+    return withLocalName(StandardPatterns.string().oneOf(names));
+  }
+
+  public XmlAttributeValuePattern withLocalNameIgnoreCase(@NonNls String... names) {
+    return withLocalName(StandardPatterns.string().oneOfIgnoreCase(names));
+  }
+
+  public XmlAttributeValuePattern withLocalName(ElementPattern<String> namePattern) {
+    return with(new PsiNamePatternCondition<XmlAttributeValue>("withLocalName", namePattern) {
+      public String getPropertyValue(@NotNull final Object o) {
+        if (o instanceof XmlAttributeValue) {
+          final XmlAttributeValue value = (XmlAttributeValue)o;
+          final PsiElement parent = value.getParent();
+          if (parent instanceof XmlAttribute) {
+            return ((XmlAttribute)parent).getLocalName();
+          }
+          if (parent instanceof XmlProcessingInstruction) {
+            PsiElement prev = value.getPrevSibling();
+            if (!(prev instanceof XmlToken) || ((XmlToken)prev).getTokenType() != XmlTokenType.XML_EQ) return null;
+            prev = prev.getPrevSibling();
+            if (!(prev instanceof XmlToken) || ((XmlToken)prev).getTokenType() != XmlTokenType.XML_NAME) return null;
+            return prev.getText();
+          }
+        }
+        return null;
+      }
+    });
+  }
+
+  public XmlAttributeValuePattern withValue(final StringPattern valuePattern) {
+    return with(new PatternCondition<XmlAttributeValue>("withValue") {
+      @Override
+      public boolean accepts(@NotNull XmlAttributeValue xmlAttributeValue, ProcessingContext context) {
+        return valuePattern.accepts(xmlAttributeValue.getValue(), context);
+      }
+    });
+  }
+
+}
diff --git a/xml/openapi/src/com/intellij/patterns/XmlElementPattern.java b/xml/openapi/src/com/intellij/patterns/XmlElementPattern.java
new file mode 100644
index 0000000..611bb40
--- /dev/null
+++ b/xml/openapi/src/com/intellij/patterns/XmlElementPattern.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.patterns;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlEntityRef;
+import com.intellij.psi.xml.XmlText;
+import com.intellij.util.ProcessingContext;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public class XmlElementPattern<T extends XmlElement,Self extends XmlElementPattern<T,Self>> extends PsiElementPattern<T,Self> {
+  protected XmlElementPattern(final Class<T> aClass) {
+    super(aClass);
+  }
+
+  public XmlElementPattern(@NotNull final InitialPatternCondition<T> condition) {
+    super(condition);
+  }
+
+  public static class Capture extends XmlElementPattern<XmlElement, Capture> {
+    protected Capture() {
+      super(new InitialPatternCondition<XmlElement>(XmlElement.class) {
+        public boolean accepts(@Nullable final Object o, final ProcessingContext context) {
+          return o instanceof XmlElement;
+        }
+      });
+    }
+  }
+
+  public static class XmlTextPattern extends XmlElementPattern<XmlText, XmlTextPattern> {
+    public XmlTextPattern() {
+      super(new InitialPatternCondition<XmlText>(XmlText.class) {
+        public boolean accepts(@Nullable final Object o, final ProcessingContext context) {
+          return o instanceof XmlText;
+        }
+      });
+    }
+  }
+
+  public static class XmlEntityRefPattern extends XmlElementPattern<XmlEntityRef, XmlEntityRefPattern> {
+    public XmlEntityRefPattern() {
+      super(new InitialPatternCondition<XmlEntityRef>(XmlEntityRef.class) {
+        public boolean accepts(@Nullable final Object o, final ProcessingContext context) {
+          return o instanceof XmlEntityRef;
+        }
+      });
+    }
+  }
+
+}
diff --git a/xml/openapi/src/com/intellij/patterns/XmlFilePattern.java b/xml/openapi/src/com/intellij/patterns/XmlFilePattern.java
new file mode 100644
index 0000000..200fa32
--- /dev/null
+++ b/xml/openapi/src/com/intellij/patterns/XmlFilePattern.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.patterns;
+
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ProcessingContext;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+public class XmlFilePattern<Self extends XmlFilePattern<Self>> extends PsiFilePattern<XmlFile, Self>{
+
+  public XmlFilePattern() {
+    super(XmlFile.class);
+  }
+
+  protected XmlFilePattern(@NotNull final InitialPatternCondition<XmlFile> condition) {
+    super(condition);
+  }
+
+  public Self withRootTag(final ElementPattern<XmlTag> rootTag) {
+    return with(new PatternCondition<XmlFile>("withRootTag") {
+      public boolean accepts(@NotNull final XmlFile xmlFile, final ProcessingContext context) {
+        XmlDocument document = xmlFile.getDocument();
+        return document != null && rootTag.getCondition().accepts(document.getRootTag(), context);
+      }
+    });
+  }
+
+  public static class Capture extends XmlFilePattern<Capture> {
+  }
+}
diff --git a/xml/openapi/src/com/intellij/patterns/XmlNamedElementPattern.java b/xml/openapi/src/com/intellij/patterns/XmlNamedElementPattern.java
new file mode 100644
index 0000000..c0d366b
--- /dev/null
+++ b/xml/openapi/src/com/intellij/patterns/XmlNamedElementPattern.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.patterns;
+
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.PairProcessor;
+import com.intellij.util.ProcessingContext;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author peter
+ */
+public abstract class XmlNamedElementPattern<T extends XmlElement & PsiNamedElement,Self extends XmlNamedElementPattern<T,Self>> extends XmlElementPattern<T,Self>{
+
+  public XmlNamedElementPattern(@NotNull final InitialPatternCondition<T> condition) {
+    super(condition);
+  }
+
+  protected abstract String getLocalName(T t);
+  protected abstract String getNamespace(T t);
+
+  public Self withLocalName(@NonNls String localName) {
+    return withLocalName(StandardPatterns.string().equalTo(localName));
+  }
+
+  public Self withLocalName(final ElementPattern<String> localName) {
+    return with(new PsiNamePatternCondition<T>("withLocalName", localName) {
+      public String getPropertyValue(@NotNull final Object o) {
+        return o instanceof XmlElement ? getLocalName((T)o) : null;
+      }
+    });
+  }
+
+  public Self withNamespace(@NonNls final String... namespaces) {
+    return withNamespace(PlatformPatterns.string().oneOf(namespaces));
+  }
+
+  public Self withNamespace(final ElementPattern<String> namespace) {
+    return with(new PatternConditionPlus<T, String>("withNamespace", namespace) {
+      @Override
+      public boolean processValues(T t,
+                                   ProcessingContext context,
+                                   PairProcessor<String, ProcessingContext> processor) {
+        return processor.process(getNamespace(t), context);
+      }
+    });
+  }
+
+  public static class XmlAttributePattern extends XmlNamedElementPattern<XmlAttribute, XmlAttributePattern> {
+    protected XmlAttributePattern() {
+      super(new InitialPatternCondition<XmlAttribute>(XmlAttribute.class) {
+        public boolean accepts(@Nullable final Object o, final ProcessingContext context) {
+          return o instanceof XmlAttribute;
+        }
+      });
+    }
+
+    protected String getLocalName(XmlAttribute xmlAttribute) {
+      return xmlAttribute.getLocalName();
+    }
+
+    protected String getNamespace(XmlAttribute xmlAttribute) {
+      return xmlAttribute.getNamespace();
+    }
+    
+    public XmlAttributePattern withValue(final StringPattern pattern) {
+      return with(new PatternConditionPlus<XmlAttribute, String>("withValue", pattern) {
+        @Override
+        public boolean processValues(XmlAttribute t,
+                                     ProcessingContext context,
+                                     PairProcessor<String, ProcessingContext> processor) {
+          return processor.process(t.getValue(), context);
+        }
+      });
+    }
+
+  }
+
+}
diff --git a/xml/openapi/src/com/intellij/patterns/XmlPatterns.java b/xml/openapi/src/com/intellij/patterns/XmlPatterns.java
new file mode 100644
index 0000000..5f449f2
--- /dev/null
+++ b/xml/openapi/src/com/intellij/patterns/XmlPatterns.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.patterns;
+
+import com.intellij.psi.xml.XmlAttribute;
+import org.jetbrains.annotations.NonNls;
+
+/**
+ * @author peter
+ */
+public class XmlPatterns extends PlatformPatterns {
+  public static XmlFilePattern.Capture xmlFile() {
+    return new XmlFilePattern.Capture();
+  }
+
+  public static XmlAttributeValuePattern xmlAttributeValue(ElementPattern<? extends XmlAttribute> attributePattern) {
+    return xmlAttributeValue().withParent(attributePattern);
+  }
+
+  public static XmlAttributeValuePattern xmlAttributeValue() {
+    return new XmlAttributeValuePattern();
+  }
+
+  public static XmlNamedElementPattern.XmlAttributePattern xmlAttribute(@NonNls String localName) {
+    return xmlAttribute().withLocalName(localName);
+  }
+
+  public static XmlNamedElementPattern.XmlAttributePattern xmlAttribute() {
+    return new XmlNamedElementPattern.XmlAttributePattern();
+  }
+
+  public static XmlTagPattern.Capture xmlTag() {
+    return new XmlTagPattern.Capture();
+  }
+
+  public static XmlElementPattern.XmlTextPattern xmlText() {
+    return new XmlElementPattern.XmlTextPattern();
+  }
+
+  public static XmlElementPattern.XmlEntityRefPattern xmlEntityRef() {
+    return new XmlElementPattern.XmlEntityRefPattern();
+  }
+}
diff --git a/xml/openapi/src/com/intellij/patterns/XmlTagPattern.java b/xml/openapi/src/com/intellij/patterns/XmlTagPattern.java
new file mode 100644
index 0000000..5be06fa
--- /dev/null
+++ b/xml/openapi/src/com/intellij/patterns/XmlTagPattern.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.patterns;
+
+import com.intellij.openapi.util.Comparing;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.util.ProcessingContext;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+/**
+ * @author spleaner
+*/
+public class XmlTagPattern<Self extends XmlTagPattern<Self>> extends XmlNamedElementPattern<XmlTag, Self> {
+  protected XmlTagPattern() {
+    super(new InitialPatternCondition<XmlTag>(XmlTag.class) {
+      public boolean accepts(@Nullable final Object o, final ProcessingContext context) {
+        return o instanceof XmlTag;
+      }
+    });
+  }
+
+  protected XmlTagPattern(@NotNull final InitialPatternCondition<XmlTag> condition) {
+    super(condition);
+  }
+
+  protected String getLocalName(XmlTag tag) {
+    return tag.getLocalName();
+  }
+
+  protected String getNamespace(XmlTag tag) {
+    return tag.getNamespace();
+  }
+
+  public Self withAttributeValue(@NotNull @NonNls final String attributeName, @NotNull final String attributeValue) {
+    return with(new PatternCondition<XmlTag>("withAttributeValue") {
+      public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) {
+        return Comparing.equal(xmlTag.getAttributeValue(attributeName), attributeValue);
+      }
+    });
+  }
+
+  public Self withAnyAttribute(@NotNull @NonNls final String... attributeNames) {
+    return with(new PatternCondition<XmlTag>("withAnyAttribute") {
+      public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) {
+        for (String attributeName : attributeNames) {
+          if (xmlTag.getAttribute(attributeName) != null) {
+            return true;
+          }
+        }
+        return false;
+      }
+    });
+  }
+
+  public Self withDescriptor(@NotNull final ElementPattern<? extends PsiMetaData> metaDataPattern) {
+    return with(new PatternCondition<XmlTag>("withDescriptor") {
+      public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) {
+        return metaDataPattern.accepts(xmlTag.getDescriptor());
+      }
+    });
+  }
+
+  public Self isFirstSubtag(@NotNull final ElementPattern pattern) {
+    return with(new PatternCondition<XmlTag>("isFirstSubtag") {
+      public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) {
+        final XmlTag parent = xmlTag.getParentTag();
+        return parent != null &&
+               pattern.getCondition().accepts(parent, context) && parent.getSubTags()[0] == xmlTag;
+      }
+    });
+  }
+
+  public Self withFirstSubTag(@NotNull final ElementPattern<? extends XmlTag> pattern) {
+    return withSubTags(StandardPatterns.<XmlTag>collection().first(pattern));
+  }
+
+  public Self withSubTags(@NotNull final ElementPattern<? extends Collection<XmlTag>> pattern) {
+    return with(new PatternCondition<XmlTag>("withSubTags") {
+      public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) {
+        return pattern.getCondition().accepts(Arrays.asList(xmlTag.getSubTags()), context);
+      }
+    });
+  }
+
+  public Self withoutAttributeValue(@NotNull @NonNls final String attributeName, @NotNull final String attributeValue) {
+    return and(StandardPatterns.not(withAttributeValue(attributeName, attributeValue)));
+  }
+
+  public static class Capture extends XmlTagPattern<Capture> {
+  }
+}
diff --git a/xml/openapi/src/com/intellij/pom/package.html b/xml/openapi/src/com/intellij/pom/package.html
new file mode 100644
index 0000000..6d18672
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/package.html
@@ -0,0 +1,21 @@
+<!--
+  ~ Copyright 2000-2007 JetBrains s.r.o.
+  ~
+  ~ 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.
+  -->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html><body bgcolor="white">
+The POM API is unfinished, undocumented, does not allow to perform any tasks for which no other
+APIs exist, and thus should not be used.
+</body></html>
diff --git a/xml/openapi/src/com/intellij/pom/xml/XmlAspect.java b/xml/openapi/src/com/intellij/pom/xml/XmlAspect.java
new file mode 100644
index 0000000..8f75a8e
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/xml/XmlAspect.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml;
+
+import com.intellij.pom.PomModelAspect;
+
+public interface XmlAspect extends PomModelAspect {
+}
diff --git a/xml/openapi/src/com/intellij/pom/xml/XmlChangeSet.java b/xml/openapi/src/com/intellij/pom/xml/XmlChangeSet.java
new file mode 100644
index 0000000..4ea4835
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/xml/XmlChangeSet.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml;
+
+import com.intellij.pom.PomModelAspect;
+import com.intellij.pom.event.PomChangeSet;
+import com.intellij.pom.xml.events.XmlChange;
+import com.intellij.psi.xml.XmlFile;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+public interface XmlChangeSet extends PomChangeSet {
+  List<XmlChange> getChanges();
+
+  @NotNull
+  PomModelAspect getAspect();
+
+  void add(XmlChange xmlChange);
+
+  void clear();
+
+  @NotNull
+  Iterable<XmlFile> getChangedFiles();
+
+  void addChangedFile(@NotNull XmlFile xmlFile);
+}
diff --git a/xml/openapi/src/com/intellij/pom/xml/XmlChangeVisitor.java b/xml/openapi/src/com/intellij/pom/xml/XmlChangeVisitor.java
new file mode 100644
index 0000000..387c390
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/xml/XmlChangeVisitor.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.pom.xml;
+
+import com.intellij.pom.xml.events.*;
+
+/**
+ * @author peter
+ */
+@Deprecated
+public interface XmlChangeVisitor {
+  void visitXmlAttributeSet(final XmlAttributeSet xmlAttributeSet);
+
+  void visitDocumentChanged(final XmlDocumentChanged xmlDocumentChanged);
+
+  void visitXmlElementChanged(final XmlElementChanged xmlElementChanged);
+
+  void visitXmlTagChildAdd(final XmlTagChildAdd xmlTagChildAdd);
+
+  void visitXmlTagChildChanged(final XmlTagChildChanged xmlTagChildChanged);
+
+  void visitXmlTagChildRemoved(final XmlTagChildRemoved xmlTagChildRemoved);
+
+  void visitXmlTagNameChanged(final XmlTagNameChanged xmlTagNameChanged);
+
+  void visitXmlTextChanged(final XmlTextChanged xmlTextChanged);
+}
diff --git a/xml/openapi/src/com/intellij/pom/xml/XmlChangeVisitorBase.java b/xml/openapi/src/com/intellij/pom/xml/XmlChangeVisitorBase.java
new file mode 100644
index 0000000..9295e68
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/xml/XmlChangeVisitorBase.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml;
+
+import com.intellij.pom.xml.events.*;
+
+public class XmlChangeVisitorBase implements XmlChangeVisitor{
+  public void visitXmlAttributeSet(final XmlAttributeSet xmlAttributeSet) {
+
+  }
+
+  public void visitDocumentChanged(final XmlDocumentChanged xmlDocumentChanged) {
+
+  }
+
+  public void visitXmlElementChanged(final XmlElementChanged xmlElementChanged) {
+
+  }
+
+  public void visitXmlTagChildAdd(final XmlTagChildAdd xmlTagChildAdd) {
+
+  }
+
+  public void visitXmlTagChildChanged(final XmlTagChildChanged xmlTagChildChanged) {
+
+  }
+
+  public void visitXmlTagChildRemoved(final XmlTagChildRemoved xmlTagChildRemoved) {
+
+  }
+
+  public void visitXmlTagNameChanged(final XmlTagNameChanged xmlTagNameChanged) {
+
+  }
+
+  public void visitXmlTextChanged(final XmlTextChanged xmlTextChanged) {
+
+  }
+}
diff --git a/xml/openapi/src/com/intellij/pom/xml/events/XmlAttributeSet.java b/xml/openapi/src/com/intellij/pom/xml/events/XmlAttributeSet.java
new file mode 100644
index 0000000..657b62a
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/xml/events/XmlAttributeSet.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.events;
+
+import com.intellij.psi.xml.XmlTag;
+
+public interface XmlAttributeSet extends XmlChange {
+  String getName();
+
+  String getValue();
+
+  XmlTag getTag();
+}
diff --git a/xml/openapi/src/com/intellij/pom/xml/events/XmlChange.java b/xml/openapi/src/com/intellij/pom/xml/events/XmlChange.java
new file mode 100644
index 0000000..c4cfe82
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/xml/events/XmlChange.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.events;
+
+import com.intellij.pom.xml.XmlChangeVisitor;
+
+
+public interface XmlChange {
+  @Deprecated
+  void accept(XmlChangeVisitor visitor);
+}
diff --git a/xml/openapi/src/com/intellij/pom/xml/events/XmlDocumentChanged.java b/xml/openapi/src/com/intellij/pom/xml/events/XmlDocumentChanged.java
new file mode 100644
index 0000000..4892823
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/xml/events/XmlDocumentChanged.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.events;
+
+import com.intellij.psi.xml.XmlDocument;
+
+public interface XmlDocumentChanged extends XmlChange {
+  XmlDocument getDocument();
+}
diff --git a/xml/openapi/src/com/intellij/pom/xml/events/XmlElementChanged.java b/xml/openapi/src/com/intellij/pom/xml/events/XmlElementChanged.java
new file mode 100644
index 0000000..938f1f7
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/xml/events/XmlElementChanged.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.events;
+
+import com.intellij.psi.xml.XmlElement;
+
+public interface XmlElementChanged extends XmlChange {
+  XmlElement getElement();
+
+}
diff --git a/xml/openapi/src/com/intellij/pom/xml/events/XmlTagChildAdd.java b/xml/openapi/src/com/intellij/pom/xml/events/XmlTagChildAdd.java
new file mode 100644
index 0000000..2e29619
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/xml/events/XmlTagChildAdd.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.events;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagChild;
+
+public interface XmlTagChildAdd extends XmlChange {
+  XmlTag getTag();
+
+  XmlTagChild getChild();
+}
diff --git a/xml/openapi/src/com/intellij/pom/xml/events/XmlTagChildChanged.java b/xml/openapi/src/com/intellij/pom/xml/events/XmlTagChildChanged.java
new file mode 100644
index 0000000..b2219ed
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/xml/events/XmlTagChildChanged.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.events;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagChild;
+
+public interface XmlTagChildChanged extends XmlChange {
+  XmlTag getTag();
+
+  XmlTagChild getChild();
+}
diff --git a/xml/openapi/src/com/intellij/pom/xml/events/XmlTagChildRemoved.java b/xml/openapi/src/com/intellij/pom/xml/events/XmlTagChildRemoved.java
new file mode 100644
index 0000000..a65e1b3
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/xml/events/XmlTagChildRemoved.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.events;
+
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagChild;
+
+public interface XmlTagChildRemoved extends XmlChange {
+  XmlTag getTag();
+
+  XmlTagChild getChild();
+}
diff --git a/xml/openapi/src/com/intellij/pom/xml/events/XmlTagNameChanged.java b/xml/openapi/src/com/intellij/pom/xml/events/XmlTagNameChanged.java
new file mode 100644
index 0000000..dd3a5b2
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/xml/events/XmlTagNameChanged.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.events;
+
+import com.intellij.psi.xml.XmlTag;
+
+public interface XmlTagNameChanged extends XmlChange {
+  String getOldName();
+
+  XmlTag getTag();
+}
diff --git a/xml/openapi/src/com/intellij/pom/xml/events/XmlTextChanged.java b/xml/openapi/src/com/intellij/pom/xml/events/XmlTextChanged.java
new file mode 100644
index 0000000..0b26198
--- /dev/null
+++ b/xml/openapi/src/com/intellij/pom/xml/events/XmlTextChanged.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.pom.xml.events;
+
+import com.intellij.psi.xml.XmlText;
+
+public interface XmlTextChanged extends XmlChange {
+  String getOldText();
+
+  XmlText getText();
+}
diff --git a/xml/openapi/src/com/intellij/psi/XmlElementFactory.java b/xml/openapi/src/com/intellij/psi/XmlElementFactory.java
new file mode 100644
index 0000000..d94b87d
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/XmlElementFactory.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi;
+
+import com.intellij.lang.Language;
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlText;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public abstract class XmlElementFactory {
+
+  public static XmlElementFactory getInstance(Project project) {
+    return ServiceManager.getService(project, XmlElementFactory.class);
+  }
+  /**
+   * Creates an XML text element from the specified string, escaping the special
+   * characters in the string as necessary.
+   *
+   * @param s the text of the element to create.
+   * @return the created element.
+   * @throws com.intellij.util.IncorrectOperationException if the creation failed for some reason.
+   */
+  @NotNull
+  public abstract XmlText createDisplayText(@NotNull @NonNls String s) throws IncorrectOperationException;
+
+  /**
+   * Creates an XHTML tag with the specified text.
+   *
+   * @param s the text of an XHTML tag (which can contain attributes and subtags).
+   * @return the created tag instance.
+   * @throws IncorrectOperationException if the text does not specify a valid XML fragment.
+   */
+  @NotNull
+  public abstract XmlTag createXHTMLTagFromText(@NotNull @NonNls String s) throws IncorrectOperationException;
+
+  /**
+   * Creates an XML tag with the specified text.
+   *
+   * @param text the text of an XML tag (which can contain attributes and subtags).
+   * @return the created tag instance.
+   * @throws com.intellij.util.IncorrectOperationException if the text does not specify a valid XML fragment.
+   * @see #createTagFromText(String text, Language language)
+   */
+  @NotNull
+  public abstract XmlTag createTagFromText(@NotNull @NonNls String text) throws IncorrectOperationException;
+
+  /**
+   * Creates XML like tag with the specified text and language.
+   *
+   * @param text the text of an XML tag (which can contain attributes and subtags).
+   * @param language the language for tag to be created.
+   * @return the created tag instance.
+   * @throws com.intellij.util.IncorrectOperationException if the text does not specify a valid XML fragment.
+   * @see #createTagFromText(String)
+   */
+  @NotNull
+  public abstract XmlTag createTagFromText(@NotNull @NonNls String text, @NotNull Language language) throws IncorrectOperationException;
+
+  /**
+   * Creates an XML attribute with the specified name and value.
+   *
+   * @param name  the name of the attribute to create.
+   * @param value the value of the attribute to create.
+   * @return the created attribute instance.
+   * @throws IncorrectOperationException if either <code>name</code> or <code>value</code> are not valid.
+   */
+  @NotNull
+  public abstract XmlAttribute createXmlAttribute(@NotNull @NonNls String name, @NotNull String value) throws IncorrectOperationException;
+}
diff --git a/xml/openapi/src/com/intellij/psi/XmlElementVisitor.java b/xml/openapi/src/com/intellij/psi/XmlElementVisitor.java
new file mode 100644
index 0000000..53a9f06
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/XmlElementVisitor.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi;
+
+import com.intellij.psi.xml.*;
+
+public abstract class XmlElementVisitor extends PsiElementVisitor {
+  public void visitXmlElement(XmlElement element) {
+    visitElement(element);
+  }
+
+  public void visitXmlFile(XmlFile file) {
+    visitFile(file);
+  }
+
+  public void visitXmlAttribute(XmlAttribute attribute) {
+    visitXmlElement(attribute);
+  }
+
+  public void visitXmlComment(XmlComment comment) {
+    visitXmlElement(comment);
+  }
+
+  public void visitXmlDecl(XmlDecl decl) {
+    visitXmlElement(decl);
+  }                                    
+
+  public void visitXmlDocument(XmlDocument document) {
+    visitXmlElement(document);
+  }
+
+  public void visitXmlProlog(XmlProlog prolog) {
+    visitXmlElement(prolog);
+  }
+
+  public void visitXmlText(XmlText text) {
+    visitXmlElement(text);
+  }
+
+  public void visitXmlTag(XmlTag tag) {
+    visitXmlElement(tag);
+  }
+
+  public void visitXmlToken(XmlToken token) {
+    visitXmlElement(token);
+  }
+
+  public void visitXmlAttributeValue(XmlAttributeValue value) {
+    visitXmlElement(value);
+  }
+
+  public void visitXmlDoctype(XmlDoctype xmlDoctype) {
+    visitXmlElement(xmlDoctype);
+  }
+
+  public void visitXmlProcessingInstruction(XmlProcessingInstruction processingInstruction) {
+    visitXmlElement(processingInstruction);
+  }
+}
diff --git a/xml/openapi/src/com/intellij/psi/XmlRecursiveElementVisitor.java b/xml/openapi/src/com/intellij/psi/XmlRecursiveElementVisitor.java
new file mode 100644
index 0000000..6c99c53
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/XmlRecursiveElementVisitor.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * @author max
+ */
+package com.intellij.psi;
+
+import java.util.List;
+
+public class XmlRecursiveElementVisitor extends XmlElementVisitor {
+  private final boolean myVisitAllFileRoots;
+
+  public XmlRecursiveElementVisitor() {
+    myVisitAllFileRoots = false;
+  }
+
+  public XmlRecursiveElementVisitor(final boolean visitAllFileRoots) {
+    myVisitAllFileRoots = visitAllFileRoots;
+  }
+
+  public void visitElement(final PsiElement element) {
+    element.acceptChildren(this);
+  }
+
+  @Override
+  public void visitFile(final PsiFile file) {
+    if (myVisitAllFileRoots) {
+      final FileViewProvider viewProvider = file.getViewProvider();
+      final List<PsiFile> allFiles = viewProvider.getAllFiles();
+      if (allFiles.size() > 1) {
+        if (file == viewProvider.getPsi(viewProvider.getBaseLanguage())) {
+          for (PsiFile lFile : allFiles) {
+            lFile.acceptChildren(this);
+          }
+          return;
+        }
+      }
+    }
+
+    super.visitFile(file);
+  }
+}
\ No newline at end of file
diff --git a/xml/openapi/src/com/intellij/psi/filters/position/NamespaceFilter.java b/xml/openapi/src/com/intellij/psi/filters/position/NamespaceFilter.java
new file mode 100644
index 0000000..4b49c03
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/filters/position/NamespaceFilter.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.filters.position;
+
+import com.intellij.psi.filters.ElementFilter;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.*;
+import com.intellij.util.ReflectionCache;
+import org.jetbrains.annotations.NonNls;
+
+public class NamespaceFilter implements ElementFilter {
+  private final String[] myNamespaces;
+
+  public NamespaceFilter(@NonNls String... namespaces){
+    myNamespaces = namespaces;
+  }
+
+  public boolean isClassAcceptable(Class hintClass){
+    return ReflectionCache.isAssignable(XmlTag.class, hintClass) || ReflectionCache.isAssignable(XmlDocument.class, hintClass);
+  }
+
+  public boolean isAcceptable(Object element, PsiElement context){
+    if(element instanceof XmlTag){
+      final XmlTag psiElement = (XmlTag)element;
+      if (!psiElement.isValid()) return false;
+      final String ns = psiElement.getNamespace();
+
+      if (isNamespaceAcceptable(ns)) return true;
+
+      final PsiFile psiFile = psiElement.getContainingFile();
+      if (psiFile instanceof XmlFile) {
+        // We use file references for as dtd namespace
+        // But we should also check PUBLIC ID for namespace
+        final XmlProlog prolog = ((XmlFile)psiFile).getDocument().getProlog();
+
+        if (prolog != null) {
+          final XmlDoctype doctype = prolog.getDoctype();
+          if (doctype != null) {
+            final String publicId = doctype.getPublicId();
+
+            if (publicId != null) {
+              if (isNamespaceAcceptable(publicId)) return true;
+            }
+          }
+        }
+      }
+    }
+    else if(element instanceof XmlDocument){
+      return isAcceptable(((XmlDocument) element).getRootTag(), context);
+    }
+    return false;
+  }
+
+  protected boolean isNamespaceAcceptable(String ns) {
+    for (String aMyValue : myNamespaces) {
+      if (aMyValue.equals(ns)) return true;
+    }
+    return false;
+  }
+}
diff --git a/xml/openapi/src/com/intellij/psi/html/HtmlTag.java b/xml/openapi/src/com/intellij/psi/html/HtmlTag.java
new file mode 100644
index 0000000..2507a17
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/html/HtmlTag.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.html;
+
+import com.intellij.psi.xml.XmlTag;
+
+/**
+ * @author maxim
+ */
+public interface HtmlTag extends XmlTag {
+}
diff --git a/xml/openapi/src/com/intellij/psi/html/package.html b/xml/openapi/src/com/intellij/psi/html/package.html
new file mode 100644
index 0000000..b7198c1
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/html/package.html
@@ -0,0 +1,20 @@
+<!--
+  ~ Copyright 2000-2007 JetBrains s.r.o.
+  ~
+  ~ 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.
+  -->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html><body bgcolor="white">
+Provides the PSI structure for HTML files.
+</body></html>
diff --git a/xml/openapi/src/com/intellij/psi/tree/xml/IDTDElementType.java b/xml/openapi/src/com/intellij/psi/tree/xml/IDTDElementType.java
new file mode 100644
index 0000000..05f186d
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/tree/xml/IDTDElementType.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.tree.xml;
+
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.psi.tree.IElementType;
+import org.jetbrains.annotations.NonNls;
+
+/**
+ * @author ik
+ */
+public class IDTDElementType extends IElementType {
+  public IDTDElementType(@NonNls String debugName) {
+    super(debugName, StdFileTypes.DTD.getLanguage());
+  }
+}
diff --git a/xml/openapi/src/com/intellij/psi/tree/xml/IXmlElementType.java b/xml/openapi/src/com/intellij/psi/tree/xml/IXmlElementType.java
new file mode 100644
index 0000000..63510ac
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/tree/xml/IXmlElementType.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.tree.xml;
+
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.psi.tree.IElementType;
+import org.jetbrains.annotations.NonNls;
+
+/**
+ * @author max
+ */
+public class IXmlElementType extends IElementType {
+  public IXmlElementType(@NonNls String debugName) {
+    super(debugName, StdFileTypes.XML.getLanguage());
+  }
+}
diff --git a/xml/openapi/src/com/intellij/psi/tree/xml/IXmlLeafElementType.java b/xml/openapi/src/com/intellij/psi/tree/xml/IXmlLeafElementType.java
new file mode 100644
index 0000000..b6e5c63
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/tree/xml/IXmlLeafElementType.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.tree.xml;
+
+import org.jetbrains.annotations.NonNls;
+
+public class IXmlLeafElementType extends IXmlElementType {
+  public IXmlLeafElementType(@NonNls String debugName) {
+    super(debugName);
+  }
+}
\ No newline at end of file
diff --git a/xml/openapi/src/com/intellij/psi/tree/xml/package.html b/xml/openapi/src/com/intellij/psi/tree/xml/package.html
new file mode 100644
index 0000000..c706261
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/tree/xml/package.html
@@ -0,0 +1,20 @@
+<!--
+  ~ Copyright 2000-2007 JetBrains s.r.o.
+  ~
+  ~ 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.
+  -->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html><body bgcolor="white">
+Provides interfaces for XML elements found in AST trees.
+</body></html>
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlAttlistDecl.java b/xml/openapi/src/com/intellij/psi/xml/XmlAttlistDecl.java
new file mode 100644
index 0000000..489af37
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlAttlistDecl.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Mike
+ */
+public interface XmlAttlistDecl extends XmlElement {
+  XmlAttlistDecl[] EMPTY_ARRAY = new XmlAttlistDecl[0];
+
+  XmlElement getNameElement();
+  @Nullable String getName();
+  XmlAttributeDecl[] getAttributeDecls();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlAttribute.java b/xml/openapi/src/com/intellij/psi/xml/XmlAttribute.java
new file mode 100644
index 0000000..0ba6a7e
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlAttribute.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.openapi.util.TextRange;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Mike
+ */
+public interface XmlAttribute extends XmlElement, PsiNamedElement {
+  XmlAttribute[] EMPTY_ARRAY = new XmlAttribute[0];
+
+  @NonNls @NotNull String getName();
+
+  @NonNls @NotNull String getLocalName();
+
+  @NonNls @NotNull String getNamespace();
+
+  @NonNls @NotNull String getNamespacePrefix();
+
+  XmlTag getParent();
+
+  /**
+   * @return text inside XML attribute with quotes stripped off
+   */
+  String getValue();
+
+  /**
+   * @return text inside XML attribute with quotes stripped off and XML char entities replaced with corresponding characters
+   */
+  String getDisplayValue();
+
+  /**
+   * @param offset in string returned by {@link #getText()} (with quotes stripped)
+   * @return offset in the string returned from {@link #getDisplayValue()} or -1 if the offset is out of valid range
+   */
+  int physicalToDisplay(int offset);
+  /**
+   * @param offset in the string returned from {@link #getDisplayValue()}
+   * @return offset in string returned by {@link #getText()} (with quotes stripped) or -1 if the offset is out of valid range
+   */
+  int displayToPhysical(int offset);
+
+  /**
+   * @return TextRange of the XML attribute value.
+   * If quotes are present, it returns <code>new TextRange(1, getTextLength()-1)</code>, otherwise it is <code>new TextRange(0, getTextLength())</code>
+   */
+  TextRange getValueTextRange();
+
+  /**
+   * @return true if the attribute is a namespace declaration (its name equals to <code>xmlns</code> or starts with <code>xmlns:</code>)
+   */
+  boolean isNamespaceDeclaration();
+
+  @Nullable XmlAttributeDescriptor getDescriptor();
+
+  // Tree functions
+
+  // TODO: remove this. For tree functions XmlChildRole.XXX_FINDER should be used.
+  // In this case function is also used to get references from attribute value
+  @Nullable
+  XmlAttributeValue getValueElement();
+
+  void setValue(String value) throws IncorrectOperationException;
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlAttributeDecl.java b/xml/openapi/src/com/intellij/psi/xml/XmlAttributeDecl.java
new file mode 100644
index 0000000..4854c66
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlAttributeDecl.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.meta.PsiMetaOwner;
+
+/**
+ * @author Mike
+ */
+public interface XmlAttributeDecl extends XmlElement, PsiMetaOwner, PsiNamedElement {
+  XmlElement getNameElement();
+  XmlAttributeValue getDefaultValue();
+  String getDefaultValueText();
+
+  boolean isAttributeRequired();
+  boolean isAttributeFixed();
+  boolean isAttributeImplied();
+
+  boolean isEnumerated();
+  XmlElement[] getEnumeratedValues();
+
+  boolean isIdAttribute();
+  boolean isIdRefAttribute();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlAttributeValue.java b/xml/openapi/src/com/intellij/psi/xml/XmlAttributeValue.java
new file mode 100644
index 0000000..ea87923
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlAttributeValue.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.openapi.util.TextRange;
+
+/**
+ * @author Mike
+ */
+public interface XmlAttributeValue extends XmlElement {
+  /**
+   * @return text inside XML attribute with quotes stripped off
+   */
+  String getValue();
+  
+  /**
+   * @return the range occupied by text inside XML attribute with quotes stripped off
+   */
+  TextRange getValueTextRange();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlComment.java b/xml/openapi/src/com/intellij/psi/xml/XmlComment.java
new file mode 100644
index 0000000..212ba2c
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlComment.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.PsiComment;
+
+/**
+ * @author Mike
+ */
+public interface XmlComment extends XmlElement, PsiComment, XmlTagChild {
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlConditionalSection.java b/xml/openapi/src/com/intellij/psi/xml/XmlConditionalSection.java
new file mode 100644
index 0000000..bbbfc4f
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlConditionalSection.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.psi.xml;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+
+/**
+ * @author maxim.mossienko
+ */
+public interface XmlConditionalSection extends XmlElement {
+  boolean isIncluded(PsiFile target);
+
+  PsiElement getBodyStart();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlContentParticle.java b/xml/openapi/src/com/intellij/psi/xml/XmlContentParticle.java
new file mode 100644
index 0000000..de82e69
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlContentParticle.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.xml.XmlElementDescriptor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public interface XmlContentParticle {
+
+  enum Type {
+    SEQUENCE,
+    CHOICE,
+    ELEMENT
+  }
+
+  Type getType();
+
+  enum Quantifier {
+    ONE_OR_MORE,  // +
+    ZERO_OR_MORE, // *
+    OPTIONAL,     // ?
+    REQUIRED      // default
+  }
+
+  Quantifier getQuantifier();
+
+  XmlContentParticle[] getSubParticles();
+
+  @Nullable
+  XmlElementDescriptor getElementDescriptor();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlDecl.java b/xml/openapi/src/com/intellij/psi/xml/XmlDecl.java
new file mode 100644
index 0000000..3240833
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlDecl.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+/**
+ * @author Mike
+ */
+public interface XmlDecl extends XmlElement {
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlDoctype.java b/xml/openapi/src/com/intellij/psi/xml/XmlDoctype.java
new file mode 100644
index 0000000..461329c
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlDoctype.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.PsiElement;
+
+/**
+ * @author Mike
+ */
+public interface XmlDoctype extends XmlElement {
+  XmlElement getNameElement();
+  String getDtdUri();
+  PsiElement getDtdUrlElement();
+  XmlMarkupDecl getMarkupDecl();
+  String getPublicId();
+  String getSystemId();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlDocument.java b/xml/openapi/src/com/intellij/psi/xml/XmlDocument.java
new file mode 100644
index 0000000..d4441a5
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlDocument.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.meta.PsiMetaOwner;
+import com.intellij.xml.XmlNSDescriptor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Mike
+ */
+public interface XmlDocument extends XmlElement, PsiMetaOwner {
+  @Nullable XmlProlog getProlog();
+  @Nullable XmlTag getRootTag();
+
+  XmlNSDescriptor getRootTagNSDescriptor();
+  XmlNSDescriptor getDefaultNSDescriptor(final String namespace, final boolean strict);
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlElement.java b/xml/openapi/src/com/intellij/psi/xml/XmlElement.java
new file mode 100644
index 0000000..555bd67
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlElement.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.openapi.util.Key;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.search.PsiElementProcessor;
+
+/**
+ * @author Mike
+ */
+public interface XmlElement extends PsiElement {
+  Key<XmlElement> INCLUDING_ELEMENT = Key.create("INCLUDING_ELEMENT");
+  Key<PsiElement> DEPENDING_ELEMENT = Key.create("DEPENDING_ELEMENT");
+
+  XmlElement[] EMPTY_ARRAY = new XmlElement[0];
+
+  boolean processElements(PsiElementProcessor processor, PsiElement place);
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlElementContentGroup.java b/xml/openapi/src/com/intellij/psi/xml/XmlElementContentGroup.java
new file mode 100644
index 0000000..c2c22c4
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlElementContentGroup.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public interface XmlElementContentGroup extends XmlContentParticle, XmlElement {
+
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlElementContentSpec.java b/xml/openapi/src/com/intellij/psi/xml/XmlElementContentSpec.java
new file mode 100644
index 0000000..8721c88
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlElementContentSpec.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Mike
+ */
+public interface XmlElementContentSpec extends XmlElement {
+
+  boolean isEmpty();
+  boolean isAny();
+  boolean isMixed();
+  boolean hasChildren();
+
+  @Nullable
+  XmlElementContentGroup getTopGroup();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlElementDecl.java b/xml/openapi/src/com/intellij/psi/xml/XmlElementDecl.java
new file mode 100644
index 0000000..d18b990
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlElementDecl.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.PsiNameIdentifierOwner;
+import com.intellij.psi.meta.PsiMetaOwner;
+import org.jetbrains.annotations.Nullable;
+
+
+/**
+ * @author Mike
+ */
+public interface XmlElementDecl extends XmlElement, PsiMetaOwner, PsiNameIdentifierOwner {
+  XmlElement getNameElement();
+  @Nullable String getName();
+  XmlElementContentSpec getContentSpecElement();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlEntityDecl.java b/xml/openapi/src/com/intellij/psi/xml/XmlEntityDecl.java
new file mode 100644
index 0000000..268b41c
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlEntityDecl.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiNamedElement;
+
+/**
+ * @author mike
+ */
+public interface XmlEntityDecl extends XmlElement, PsiNamedElement {
+  enum EntityContextType {
+    ELEMENT_CONTENT_SPEC, ATTRIBUTE_SPEC, ATTLIST_SPEC, ENTITY_DECL_CONTENT, GENERIC_XML,
+    ENUMERATED_TYPE, ATTR_VALUE
+  }
+
+  String getName();
+  PsiElement getNameElement();
+  XmlAttributeValue getValueElement();
+  PsiElement parse(PsiFile baseFile, EntityContextType context, XmlEntityRef originalElement);
+  boolean isInternalReference();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlEntityRef.java b/xml/openapi/src/com/intellij/psi/xml/XmlEntityRef.java
new file mode 100644
index 0000000..5388b3e
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlEntityRef.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.PsiFile;
+
+/**
+ * @author mike
+ */
+public interface XmlEntityRef extends XmlElement, XmlTagChild {
+  XmlEntityDecl resolve(PsiFile targetFile);
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlEnumeratedType.java b/xml/openapi/src/com/intellij/psi/xml/XmlEnumeratedType.java
new file mode 100644
index 0000000..38b1dcb
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlEnumeratedType.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+
+
+/**
+ * @author mike
+ */
+public interface XmlEnumeratedType extends XmlElement {
+  XmlElement[] getEnumeratedValues();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlFile.java b/xml/openapi/src/com/intellij/psi/xml/XmlFile.java
new file mode 100644
index 0000000..df2326f
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlFile.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.FileResolveScopeProvider;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Mike
+ */
+public interface XmlFile extends PsiFile, XmlElement, FileResolveScopeProvider {
+  XmlFile[] EMPTY_ARRAY = new XmlFile[0];
+
+  @Nullable
+  XmlDocument getDocument();
+
+  @Nullable
+  XmlTag getRootTag();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlFileNSInfoProvider.java b/xml/openapi/src/com/intellij/psi/xml/XmlFileNSInfoProvider.java
new file mode 100644
index 0000000..1076de2
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlFileNSInfoProvider.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.psi.xml;
+
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import com.intellij.openapi.extensions.ExtensionPointName;
+
+/**
+ * Implementations of this interface add default mappings
+ * for namespace prefixes to namespaces for any xml file.
+ */
+public interface XmlFileNSInfoProvider {
+
+  ExtensionPointName<XmlFileNSInfoProvider> EP_NAME = new ExtensionPointName<XmlFileNSInfoProvider>("com.intellij.xml.fileNSInfoProvider");
+  /**
+   * Provides information (if any) for default mappings of namespace prefix to namespace identifiers.
+   * @param file for which ns mapping information is requested.
+   * @return array of namespace prefix to namespace mappings for given file in the format [nsPrefix, namespaceId] or
+   * null if the interface implementation does not know about such mapping.
+   * Empty nsPrefix is "", nsPrefix, namespaceId should not be null, invalid mapping table is skipped.
+   */
+  @Nullable
+  @NonNls
+  String[][] getDefaultNamespaces(@NotNull XmlFile file);
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlMarkupDecl.java b/xml/openapi/src/com/intellij/psi/xml/XmlMarkupDecl.java
new file mode 100644
index 0000000..8592866
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlMarkupDecl.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.meta.PsiMetaOwner;
+
+/**
+ * @author Mike
+ */
+public interface XmlMarkupDecl extends XmlElement, PsiMetaOwner {
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlNotationDecl.java b/xml/openapi/src/com/intellij/psi/xml/XmlNotationDecl.java
new file mode 100644
index 0000000..6ca788c
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlNotationDecl.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 13.11.2003
+ * Time: 17:48:06
+ * To change this template use Options | File Templates.
+ */
+public interface XmlNotationDecl extends XmlElement{
+  XmlElement getNameElement();
+  XmlElementContentSpec getContentSpecElement();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlProcessingInstruction.java b/xml/openapi/src/com/intellij/psi/xml/XmlProcessingInstruction.java
new file mode 100644
index 0000000..5233fac
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlProcessingInstruction.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+public interface XmlProcessingInstruction extends XmlElement, XmlTagChild {
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlProlog.java b/xml/openapi/src/com/intellij/psi/xml/XmlProlog.java
new file mode 100644
index 0000000..e05d380
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlProlog.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+/**
+ * @author Mike
+ */
+public interface XmlProlog extends XmlElement {
+  XmlDoctype getDoctype();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlTag.java b/xml/openapi/src/com/intellij/psi/xml/XmlTag.java
new file mode 100644
index 0000000..8ca8bb0
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlTag.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.meta.PsiMetaOwner;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+/**
+ * @author Mike
+ */
+public interface XmlTag extends XmlElement, PsiNamedElement, PsiMetaOwner, XmlTagChild {
+  XmlTag[] EMPTY = new XmlTag[0];
+
+  @NotNull @NonNls String getName();
+  @NotNull @NonNls String getNamespace();
+  @NotNull @NonNls String getLocalName();
+
+  @Nullable XmlElementDescriptor getDescriptor();
+
+  @NotNull XmlAttribute[] getAttributes();
+
+  @Nullable XmlAttribute getAttribute(@NonNls String name, @NonNls String namespace);
+
+  /**
+   * Returns a tag attribute by qualified name.
+   *
+   * @param qname qualified attribute name, like "ns:name" or "name".
+   * @return null if the attribute not exist.
+   * @see #getAttribute(String, String)
+   */
+  @Nullable XmlAttribute getAttribute(@NonNls String qname);
+
+  @Nullable String getAttributeValue(@NonNls String name, @NonNls String namespace);
+
+  /**
+   * Returns a tag attribute value by qualified name.
+   *
+   * @param qname qualified attribute name, like "ns:name" or "name".
+   * @return null if the attribute not exist.
+   * @see #getAttributeValue(String, String)  
+   */
+  @Nullable String getAttributeValue(@NonNls String qname);
+
+  XmlAttribute setAttribute(@NonNls String name, @NonNls String namespace, @NonNls String value) throws IncorrectOperationException;
+  XmlAttribute setAttribute(@NonNls String qname, @NonNls String value) throws IncorrectOperationException;
+
+  /**
+   * Creates a new child tag
+   * @param localName new tag's name
+   * @param namespace new tag's namespace
+   * @param bodyText pass null to create collapsed tag, empty string means creating expanded one
+   * @param enforceNamespacesDeep if you pass some xml tags to <code>bodyText</code> parameter, this flag sets namespace prefixes for them
+   * @return created tag. Use {@link #addSubTag(XmlTag, boolean)}} to add it to parent
+   */
+  XmlTag createChildTag(@NonNls String localName, @NonNls String namespace, @Nullable @NonNls String bodyText, boolean enforceNamespacesDeep);
+  XmlTag addSubTag(XmlTag subTag, boolean first);
+
+  @NotNull XmlTag[] getSubTags();
+  @NotNull XmlTag[] findSubTags(@NonNls String qname);
+
+  /**
+   * @param localName non-qualified tag name.
+   * @param namespace if null, name treated as qualified name to find.
+   */
+  @NotNull XmlTag[] findSubTags(@NonNls String localName, @Nullable String namespace);
+
+  @Nullable XmlTag findFirstSubTag(@NonNls String qname);
+
+  @NotNull @NonNls String getNamespacePrefix();
+  @NotNull @NonNls String getNamespaceByPrefix(@NonNls String prefix);
+  @Nullable String getPrefixByNamespace(@NonNls String namespace);
+  String[] knownNamespaces();
+
+  boolean hasNamespaceDeclarations();
+
+  /**
+   * @return map keys: prefixes values: namespaces
+   */
+  @NotNull Map<String, String> getLocalNamespaceDeclarations();
+
+  @NotNull XmlTagValue getValue();
+
+  @Nullable XmlNSDescriptor getNSDescriptor(@NonNls String namespace, boolean strict);
+
+  boolean isEmpty();
+
+  void collapseIfEmpty();
+
+  @Nullable @NonNls
+  String getSubTagText(@NonNls String qname);
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlTagChild.java b/xml/openapi/src/com/intellij/psi/xml/XmlTagChild.java
new file mode 100644
index 0000000..5e0129a
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlTagChild.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public interface XmlTagChild extends XmlElement{
+  XmlTagChild[] EMPTY_ARRAY = new XmlTagChild[0];
+  XmlTag getParentTag();
+
+  @Nullable
+  XmlTagChild getNextSiblingInTag();
+  @Nullable
+  XmlTagChild getPrevSiblingInTag();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlTagValue.java b/xml/openapi/src/com/intellij/psi/xml/XmlTagValue.java
new file mode 100644
index 0000000..aedef5b
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlTagValue.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.openapi.util.TextRange;
+import org.jetbrains.annotations.NotNull;
+
+public interface XmlTagValue {
+
+  @NotNull
+  XmlTagChild[] getChildren();
+
+  @NotNull
+  XmlText[] getTextElements();
+
+  @NotNull
+  String getText();
+  
+  @NotNull
+  TextRange getTextRange();
+
+  @NotNull
+  String getTrimmedText();
+
+  void setText(String value);
+
+  boolean hasCDATA();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlText.java b/xml/openapi/src/com/intellij/psi/xml/XmlText.java
new file mode 100644
index 0000000..4c9a84d
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlText.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.Nullable;
+
+public interface XmlText extends XmlTagChild {
+  String getText();
+  /**
+   * Substituted text
+   */
+  String getValue();
+  void setValue(String s) throws IncorrectOperationException;
+
+  XmlElement insertAtOffset(XmlElement element, int displayOffset) throws IncorrectOperationException;
+
+  void insertText(String text, int displayOffset) throws IncorrectOperationException;
+  void removeText(int displayStart, int displayEnd) throws IncorrectOperationException;
+
+  int physicalToDisplay(int offset);
+  int displayToPhysical(int offset);
+
+  @Nullable
+  XmlText split(int displayIndex);
+  XmlText[] EMPTY_ARRAY = new XmlText[0];
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlToken.java b/xml/openapi/src/com/intellij/psi/xml/XmlToken.java
new file mode 100644
index 0000000..202f9d2
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlToken.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.tree.IElementType;
+
+
+/**
+ * @author Mike
+ */
+public interface XmlToken extends XmlElement{
+  IElementType getTokenType();
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/XmlTokenType.java b/xml/openapi/src/com/intellij/psi/xml/XmlTokenType.java
new file mode 100644
index 0000000..151afe2
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/XmlTokenType.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.psi.xml;
+
+import com.intellij.psi.TokenType;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.tree.xml.IXmlLeafElementType;
+
+/**
+ * Specifies XML token types.
+ */
+public interface XmlTokenType {
+  IElementType XML_START_TAG_START = new IXmlLeafElementType("XML_START_TAG_START");
+  IElementType XML_END_TAG_START = new IXmlLeafElementType("XML_END_TAG_START");
+  IElementType XML_TAG_END = new IXmlLeafElementType("XML_TAG_END");
+  IElementType XML_EMPTY_ELEMENT_END = new IXmlLeafElementType("XML_EMPTY_ELEMENT_END");
+  IElementType XML_TAG_NAME = new IXmlLeafElementType("XML_TAG_NAME");
+  IElementType XML_NAME = new IXmlLeafElementType("XML_NAME");
+  IElementType XML_ATTRIBUTE_VALUE_TOKEN = new IXmlLeafElementType("XML_ATTRIBUTE_VALUE_TOKEN");
+  IElementType XML_ATTRIBUTE_VALUE_START_DELIMITER = new IXmlLeafElementType("XML_ATTRIBUTE_VALUE_START_DELIMITER");
+  IElementType XML_ATTRIBUTE_VALUE_END_DELIMITER = new IXmlLeafElementType("XML_ATTRIBUTE_VALUE_END_DELIMITER");
+  IElementType XML_EQ = new IXmlLeafElementType("XML_EQ");
+  IElementType XML_DATA_CHARACTERS = new IXmlLeafElementType("XML_DATA_CHARACTERS");
+  IElementType XML_TAG_CHARACTERS = new IXmlLeafElementType("XML_TAG_CHARACTERS");
+  IElementType XML_WHITE_SPACE = TokenType.WHITE_SPACE;
+  IElementType XML_REAL_WHITE_SPACE = new IXmlLeafElementType("XML_WHITE_SPACE");
+  IElementType XML_COMMENT_START = new IXmlLeafElementType("XML_COMMENT_START");
+  IElementType XML_COMMENT_END = new IXmlLeafElementType("XML_COMMENT_END");
+  IElementType XML_COMMENT_CHARACTERS = new IXmlLeafElementType("XML_COMMENT_CHARACTERS");
+
+  IElementType XML_DECL_START = new IXmlLeafElementType("XML_DECL_START");
+  IElementType XML_DECL_END = new IXmlLeafElementType("XML_DECL_END");
+
+  IElementType XML_DOCTYPE_START = new IXmlLeafElementType("XML_DOCTYPE_START");
+  IElementType XML_DOCTYPE_END = new IXmlLeafElementType("XML_DOCTYPE_END");
+  IElementType XML_DOCTYPE_SYSTEM = new IXmlLeafElementType("XML_DOCTYPE_SYSTEM");
+  IElementType XML_DOCTYPE_PUBLIC = new IXmlLeafElementType("XML_DOCTYPE_PUBLIC");
+
+  IElementType XML_MARKUP_START = new IXmlLeafElementType("XML_MARKUP_START");
+  IElementType XML_MARKUP_END = new IXmlLeafElementType("XML_MARKUP_END");
+
+  IElementType XML_CDATA_START = new IXmlLeafElementType("XML_CDATA_START");
+  IElementType XML_CONDITIONAL_SECTION_START = new IXmlLeafElementType("XML_CONDITIONAL_SECTION_START");
+  IElementType XML_CONDITIONAL_INCLUDE = new IXmlLeafElementType("XML_CONDITIONAL_INCLUDE");
+  IElementType XML_CONDITIONAL_IGNORE = new IXmlLeafElementType("XML_CONDITIONAL_IGNORE");
+  IElementType XML_CDATA_END = new IXmlLeafElementType("XML_CDATA_END");
+  IElementType XML_CONDITIONAL_SECTION_END = new IXmlLeafElementType("XML_CONDITIONAL_SECTION_END");
+
+  IElementType XML_ELEMENT_DECL_START = new IXmlLeafElementType("XML_ELEMENT_DECL_START");
+  IElementType XML_NOTATION_DECL_START = new IXmlLeafElementType("XML_NOTATION_DECL_START");
+  IElementType XML_ATTLIST_DECL_START = new IXmlLeafElementType("XML_ATTLIST_DECL_START");
+  IElementType XML_ENTITY_DECL_START = new IXmlLeafElementType("XML_ENTITY_DECL_START");
+
+  IElementType XML_PCDATA = new IXmlLeafElementType("XML_PCDATA");
+  IElementType XML_LEFT_PAREN = new IXmlLeafElementType("XML_LEFT_PAREN");
+  IElementType XML_RIGHT_PAREN = new IXmlLeafElementType("XML_RIGHT_PAREN");
+  IElementType XML_CONTENT_EMPTY = new IXmlLeafElementType("XML_CONTENT_EMPTY");
+  IElementType XML_CONTENT_ANY = new IXmlLeafElementType("XML_CONTENT_ANY");
+  IElementType XML_QUESTION = new IXmlLeafElementType("XML_QUESTION");
+  IElementType XML_STAR = new IXmlLeafElementType("XML_STAR");
+  IElementType XML_PLUS = new IXmlLeafElementType("XML_PLUS");
+  IElementType XML_BAR = new IXmlLeafElementType("XML_BAR");
+  IElementType XML_COMMA = new IXmlLeafElementType("XML_COMMA");
+  IElementType XML_AMP = new IXmlLeafElementType("XML_AMP");
+  IElementType XML_SEMI = new IXmlLeafElementType("XML_SEMI");
+  IElementType XML_PERCENT = new IXmlLeafElementType("XML_PERCENT");
+
+  IElementType XML_ATT_IMPLIED = new IXmlLeafElementType("XML_ATT_IMPLIED");
+  IElementType XML_ATT_REQUIRED = new IXmlLeafElementType("XML_ATT_REQUIRED");
+  IElementType XML_ATT_FIXED = new IXmlLeafElementType("XML_ATT_FIXED");
+
+  IElementType XML_ENTITY_REF_TOKEN = new IXmlLeafElementType("XML_ENTITY_REF_TOKEN");
+
+  IElementType TAG_WHITE_SPACE = new IXmlLeafElementType("TAG_WHITE_SPACE");
+
+  IElementType XML_PI_START = new IXmlLeafElementType("XML_PI_START");
+  IElementType XML_PI_END = new IXmlLeafElementType("XML_PI_END");
+  IElementType XML_PI_TARGET = new IXmlLeafElementType("XML_PI_TARGET");
+
+  IElementType XML_CHAR_ENTITY_REF = new IXmlLeafElementType("XML_CHAR_ENTITY_REF");
+
+  IElementType XML_BAD_CHARACTER = new IXmlLeafElementType("XML_BAD_CHARACTER");
+
+  IElementType XML_CONDITIONAL_COMMENT_START = new IXmlLeafElementType("CONDITIONAL_COMMENT_START");
+  IElementType XML_CONDITIONAL_COMMENT_START_END = new IXmlLeafElementType("CONDITIONAL_COMMENT_START_END");
+  IElementType XML_CONDITIONAL_COMMENT_END_START = new IXmlLeafElementType("CONDITIONAL_COMMENT_END_START");
+  IElementType XML_CONDITIONAL_COMMENT_END = new IXmlLeafElementType("CONDITIONAL_COMMENT_END");
+
+  TokenSet COMMENTS = TokenSet.create(XML_COMMENT_START, XML_COMMENT_CHARACTERS, XML_COMMENT_END);
+  TokenSet WHITESPACES = TokenSet.create(XML_WHITE_SPACE);
+}
diff --git a/xml/openapi/src/com/intellij/psi/xml/package.html b/xml/openapi/src/com/intellij/psi/xml/package.html
new file mode 100644
index 0000000..4fa33e3
--- /dev/null
+++ b/xml/openapi/src/com/intellij/psi/xml/package.html
@@ -0,0 +1,20 @@
+<!--
+  ~ Copyright 2000-2007 JetBrains s.r.o.
+  ~
+  ~ 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.
+  -->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html><body bgcolor="white">
+Provides the PSI structure for XML files.
+</body></html>
diff --git a/xml/openapi/src/com/intellij/xml/XmlAttributeDescriptor.java b/xml/openapi/src/com/intellij/xml/XmlAttributeDescriptor.java
new file mode 100644
index 0000000..e279ed7
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/XmlAttributeDescriptor.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.xml;
+
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.ArrayFactory;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Mike
+ */
+public interface XmlAttributeDescriptor extends PsiMetaData {
+  XmlAttributeDescriptor[] EMPTY = new XmlAttributeDescriptor[0];
+  ArrayFactory<XmlAttributeDescriptor> ARRAY_FACTORY = new ArrayFactory<XmlAttributeDescriptor>() {
+    @Override
+    public XmlAttributeDescriptor[] create(int count) {
+      return new XmlAttributeDescriptor[count];
+    }
+  };
+
+  boolean isRequired();
+  boolean isFixed();
+  boolean hasIdType();
+  boolean hasIdRefType();
+
+  @Nullable
+  String getDefaultValue();
+
+  //todo: refactor to hierarchy of value descriptor?
+  boolean isEnumerated();
+  @Nullable
+  String[] getEnumeratedValues();
+
+  @Nullable
+  String validateValue(XmlElement context, String value);
+}
diff --git a/xml/openapi/src/com/intellij/xml/XmlBundle.java b/xml/openapi/src/com/intellij/xml/XmlBundle.java
new file mode 100644
index 0000000..22ec37b
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/XmlBundle.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.CommonBundle;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.PropertyKey;
+
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
+import java.util.ResourceBundle;
+
+/**
+ * @author lesya
+ */
+public class XmlBundle {
+  private static Reference<ResourceBundle> ourBundle;
+
+  @NonNls public static final String PATH_TO_BUNDLE = "messages.XmlBundle";
+
+  private XmlBundle() {
+  }
+
+  public static String message(@NonNls @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, Object... params) {
+    return CommonBundle.message(getBundle(), key, params);
+  }
+
+  private static ResourceBundle getBundle() {
+    ResourceBundle bundle = null;
+    if (ourBundle != null) bundle = ourBundle.get();
+    if (bundle == null) {
+      bundle = ResourceBundle.getBundle(PATH_TO_BUNDLE);
+      ourBundle = new SoftReference<ResourceBundle>(bundle);
+    }
+    return bundle;
+  }
+}
diff --git a/xml/openapi/src/com/intellij/xml/XmlElementDescriptor.java b/xml/openapi/src/com/intellij/xml/XmlElementDescriptor.java
new file mode 100644
index 0000000..6627ca0
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/XmlElementDescriptor.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Describes an XML tag.
+ *
+ * @author Mike
+ */
+public interface XmlElementDescriptor extends PsiMetaData {
+  XmlElementDescriptor[] EMPTY_ARRAY = new XmlElementDescriptor[0];
+
+  @NonNls
+  String getQualifiedName();
+
+  /**
+   * Should return either simple or qualified name depending on the schema/DTD properties.
+   * This name should be used in XML documents.
+   * @return either simple or qualified name.
+   */
+  @NonNls
+  String getDefaultName();
+
+  /**
+   * Returns an array of child tag descriptors.
+   * @param context the parent tag.
+   * @return an array of child tag descriptors, or empty array if no child tag allowed.
+   */
+  XmlElementDescriptor[] getElementsDescriptors(XmlTag context);
+
+  @Nullable
+  XmlElementDescriptor getElementDescriptor(XmlTag childTag, XmlTag contextTag);
+
+  XmlAttributeDescriptor[] getAttributesDescriptors(final @Nullable XmlTag context);
+  @Nullable
+  XmlAttributeDescriptor getAttributeDescriptor(@NonNls String attributeName, final @Nullable XmlTag context);
+  @Nullable
+  XmlAttributeDescriptor getAttributeDescriptor(XmlAttribute attribute);
+
+  XmlNSDescriptor getNSDescriptor();
+
+  @Nullable
+  XmlElementsGroup getTopGroup();
+
+  int getContentType();
+
+  int CONTENT_TYPE_UNKNOWN = -1;
+  int CONTENT_TYPE_EMPTY = 0;
+  int CONTENT_TYPE_ANY = 1;
+  int CONTENT_TYPE_CHILDREN = 2;
+  int CONTENT_TYPE_MIXED = 3;
+
+  @Nullable
+  String getDefaultValue();
+}
diff --git a/xml/openapi/src/com/intellij/xml/XmlElementDescriptorAwareAboutChildren.java b/xml/openapi/src/com/intellij/xml/XmlElementDescriptorAwareAboutChildren.java
new file mode 100644
index 0000000..412a4b7
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/XmlElementDescriptorAwareAboutChildren.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.psi.xml.XmlTag;
+
+public interface XmlElementDescriptorAwareAboutChildren {
+  boolean allowElementsFromNamespace(final String namespace, final XmlTag context);
+}
\ No newline at end of file
diff --git a/xml/openapi/src/com/intellij/xml/XmlElementDescriptorWithCDataContent.java b/xml/openapi/src/com/intellij/xml/XmlElementDescriptorWithCDataContent.java
new file mode 100644
index 0000000..e25fad9
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/XmlElementDescriptorWithCDataContent.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+
+public interface XmlElementDescriptorWithCDataContent {
+  boolean requiresCdataBracesInContext(@NotNull XmlTag context);
+}
\ No newline at end of file
diff --git a/xml/openapi/src/com/intellij/xml/XmlElementsGroup.java b/xml/openapi/src/com/intellij/xml/XmlElementsGroup.java
new file mode 100644
index 0000000..ed3af8b
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/XmlElementsGroup.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public interface XmlElementsGroup {
+
+  enum Type {
+    SEQUENCE,
+    CHOICE,
+    ALL,
+    GROUP,
+
+    LEAF
+  }
+
+  /**
+   * @return minimal occurrence constraint value (e.g. 0 or 1)
+   */
+  int getMinOccurs();
+
+  /**
+   * @return maximal occurrence constraint value (e.g. 1 or {@link Integer#MAX_VALUE})
+   */
+  int getMaxOccurs();
+
+  Type getGroupType();
+
+  @Nullable
+  XmlElementsGroup getParentGroup();
+
+  List<XmlElementsGroup> getSubGroups();
+
+  @Nullable
+  XmlElementDescriptor getLeafDescriptor();
+}
diff --git a/xml/openapi/src/com/intellij/xml/XmlNSDescriptor.java b/xml/openapi/src/com/intellij/xml/XmlNSDescriptor.java
new file mode 100644
index 0000000..4322871
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/XmlNSDescriptor.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Mike
+ */
+public interface XmlNSDescriptor extends PsiMetaData {
+  @Nullable
+  XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag);
+
+  @NotNull
+  XmlElementDescriptor[] getRootElementsDescriptors(@Nullable final XmlDocument document);
+
+  @Nullable
+  XmlFile getDescriptorFile();
+
+  boolean isHierarhyEnabled();
+}
diff --git a/xml/openapi/src/com/intellij/xml/XmlNSDescriptorEx.java b/xml/openapi/src/com/intellij/xml/XmlNSDescriptorEx.java
new file mode 100644
index 0000000..bfd463f
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/XmlNSDescriptorEx.java
@@ -0,0 +1,8 @@
+package com.intellij.xml;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public interface XmlNSDescriptorEx extends  XmlNSDescriptor {
+  XmlElementDescriptor getElementDescriptor(String localName, String namespace);
+}
diff --git a/xml/openapi/src/com/intellij/xml/XmlSchemaProvider.java b/xml/openapi/src/com/intellij/xml/XmlSchemaProvider.java
new file mode 100644
index 0000000..8302e63
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/XmlSchemaProvider.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+package com.intellij.xml;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtil;
+import com.intellij.openapi.project.DumbService;
+import com.intellij.openapi.util.Condition;
+import com.intellij.psi.PsiDirectory;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public abstract class XmlSchemaProvider {
+  public static final ExtensionPointName<XmlSchemaProvider> EP_NAME = new ExtensionPointName<XmlSchemaProvider>("com.intellij.xml.schemaProvider");
+
+  @Nullable
+  public static XmlFile findSchema(@NotNull @NonNls String namespace, @Nullable Module module, @NotNull PsiFile file) {
+    if (file.getProject().isDefault()) return null;
+    final boolean dumb = DumbService.getInstance(file.getProject()).isDumb();
+    for (XmlSchemaProvider provider: Extensions.getExtensions(EP_NAME)) {
+      if (dumb && !DumbService.isDumbAware(provider)) {
+        continue;
+      }
+
+      if (file instanceof XmlFile && !provider.isAvailable((XmlFile)file)) {
+        continue;
+      }
+      final XmlFile schema = provider.getSchema(namespace, module, file);
+      if (schema != null) {
+        return schema;
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public static XmlFile findSchema(@NotNull @NonNls String namespace, @NotNull PsiFile baseFile) {
+    final PsiDirectory directory = baseFile.getParent();
+    final Module module = ModuleUtil.findModuleForPsiElement(directory == null ? baseFile : directory);
+    return findSchema(namespace, module, baseFile);
+  }
+
+  /**
+   * @see #getAvailableProviders(com.intellij.psi.xml.XmlFile)
+   */
+  @Deprecated
+  @Nullable
+  public static XmlSchemaProvider getAvailableProvider(@NotNull final XmlFile file) {
+    for (XmlSchemaProvider provider: Extensions.getExtensions(EP_NAME)) {
+      if (provider.isAvailable(file)) {
+        return provider;
+      }
+    }
+    return null;    
+  }
+
+  public static List<XmlSchemaProvider> getAvailableProviders(@NotNull final XmlFile file) {
+    return ContainerUtil.findAll(Extensions.getExtensions(EP_NAME), new Condition<XmlSchemaProvider>() {
+      public boolean value(XmlSchemaProvider xmlSchemaProvider) {
+        return xmlSchemaProvider.isAvailable(file);
+      }
+    });
+  }
+
+  @Nullable
+  public abstract XmlFile getSchema(@NotNull @NonNls String url, @Nullable Module module, @NotNull final PsiFile baseFile);
+
+
+  public boolean isAvailable(@NotNull final XmlFile file) {
+    return false;
+  }
+
+  /**
+   * Provides specific namespaces for given xml file.
+   * @param file an xml or jsp file.
+   * @param tagName optional
+   * @return available namespace uris, or <code>null</code> if the provider did not recognize the file.
+   */
+  @NotNull
+  public Set<String> getAvailableNamespaces(@NotNull final XmlFile file, @Nullable final String tagName) {
+    return Collections.emptySet();
+  }
+
+  @Nullable
+  public String getDefaultPrefix(@NotNull @NonNls String namespace, @NotNull final XmlFile context) {
+    return null;
+  }
+
+  @Nullable
+  public Set<String> getLocations(@NotNull @NonNls String namespace, @NotNull final XmlFile context) {
+    return null;
+  }
+}
diff --git a/xml/openapi/src/com/intellij/xml/XmlTagRuleProvider.java b/xml/openapi/src/com/intellij/xml/XmlTagRuleProvider.java
new file mode 100644
index 0000000..69d3bbe
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/XmlTagRuleProvider.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NotNull;
+
+public abstract class XmlTagRuleProvider {
+
+  public static final ExtensionPointName<XmlTagRuleProvider> EP_NAME = ExtensionPointName.create("com.intellij.xml.xmlTagRuleProvider");
+
+  public abstract Rule[] getTagRule(@NotNull XmlTag tag);
+
+  public static class Rule {
+
+    public static final Rule[] EMPTY_ARRAY = new Rule[0];
+
+    public void annotate(@NotNull XmlTag tag, ProblemsHolder holder) {
+
+    }
+
+    public boolean needAtLeastOneAttribute(@NotNull XmlTag tag) {
+      return false;
+    }
+  }
+
+}
diff --git a/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsComponent.java b/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsComponent.java
new file mode 100644
index 0000000..9072862
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsComponent.java
@@ -0,0 +1,750 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.breadcrumbs;
+
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.SystemInfo;
+import com.intellij.ui.ColorUtil;
+import com.intellij.ui.Gray;
+import com.intellij.ui.JBColor;
+import com.intellij.util.ui.UIUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseMotionListener;
+import java.util.*;
+import java.util.List;
+
+/**
+ * @author spleaner
+ */
+public class BreadcrumbsComponent<T extends BreadcrumbsItem> extends JComponent implements Disposable {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.xml.breadcrumbs.BreadcrumbsComponent");
+  private static final Painter DEFAULT_PAINTER = new DefaultPainter(new ButtonSettings());
+
+  private List<BreadcrumbsItemListener<T>> myListeners = new ArrayList<BreadcrumbsItemListener<T>>();
+  private Crumb myHovered;
+  private PagedImage myBuffer;
+  private List<Crumb> myCrumbs = new ArrayList<Crumb>();
+  private final CrumbLineMouseListener myMouseListener;
+  private List<T> myItems;
+
+  public BreadcrumbsComponent() {
+    myMouseListener = new CrumbLineMouseListener(this);
+    addMouseListener(myMouseListener);
+    addMouseMotionListener(myMouseListener);
+
+    setToolTipText(new String());
+  }
+
+  public void setItems(@Nullable final List<T> itemsList) {
+    if (myItems != itemsList) {
+      myItems = itemsList;
+      myCrumbs = null;
+    }
+
+    repaint();
+  }
+
+  public void addBreadcrumbsItemListener(@NotNull final BreadcrumbsItemListener<T> listener) {
+    myListeners.add(listener);
+  }
+
+  public void removeBreadcrumbsItemListener(@NotNull final BreadcrumbsItemListener<T> listener) {
+    myListeners.remove(listener);
+  }
+
+  public String getToolTipText(final MouseEvent event) {
+    final Crumb c = getCrumb(event.getPoint());
+    if (c != null) {
+      final String text = c.getTooltipText();
+      return text == null ? super.getToolTipText(event) : text;
+    }
+
+    return super.getToolTipText(event);
+  }
+
+  @Nullable
+  public Crumb getCrumb(@NotNull final Point p) {
+    if (myCrumbs != null) {
+      final Rectangle r = getBounds();
+      p.translate(r.x, r.y);
+      
+      if (!r.contains(p)) {
+        return null;
+      }
+
+      if (myBuffer == null) {
+        return null;
+      }
+
+      final int offset = myBuffer.getPageOffset();
+
+      for (final Crumb each : myCrumbs) {
+        if (((p.x + offset) >= each.getOffset()) && ((p.x + offset) < (each.getOffset() + each.getWidth()))) {
+          return each;
+        }
+      }
+    }
+
+    return null;
+  }
+
+  public void setHoveredCrumb(@Nullable final Crumb crumb) {
+    if (crumb != null) {
+      crumb.setHovered(true);
+    }
+
+    if (myHovered != null) {
+      myHovered.setHovered(false);
+    }
+
+    myHovered = crumb;
+    repaint();
+  }
+
+  public void nextPage() {
+    if (myBuffer != null) {
+      final int page = myBuffer.getPage();
+      if (page + 1 < myBuffer.getPageCount()) {
+        myBuffer.setPage(page + 1);
+      }
+    }
+
+    repaint();
+  }
+
+  public void previousPage() {
+    if (myBuffer != null) {
+      final int page = myBuffer.getPage();
+      if (page - 1 >= 0) {
+        myBuffer.setPage(page - 1);
+      }
+    }
+
+    repaint();
+  }
+
+  public void paint(final Graphics g) {
+    final Graphics2D g2 = ((Graphics2D)g);
+    final Dimension d = getSize();
+    final FontMetrics fm = g2.getFontMetrics();
+
+    if (myItems != null) {
+      final boolean veryDirty = (myCrumbs == null) || (myBuffer != null && !myBuffer.isValid(d.width));
+
+      final List<Crumb> crumbList = veryDirty ? createCrumbList(fm, myItems, d.width) : myCrumbs;
+      if (crumbList != null) {
+        if (veryDirty) {
+          //final BufferedImage bufferedImage = createBuffer(crumbList, d.height);
+          myBuffer = new PagedImage(getTotalWidth(crumbList), d.width);
+          myBuffer.setPage(myBuffer.getPageCount() - 1); // point to the last page
+        }
+
+        assert myBuffer != null;
+
+        super.paint(g2);
+
+        //if (myDirty) {
+        //  myBuffer.repaint(crumbList, getPainter());
+        //myDirty = false;
+        //}
+
+        myBuffer.paintPage(g2, crumbList, DEFAULT_PAINTER, d.height);
+        myCrumbs = crumbList;
+      }
+    }
+    else {
+      super.paint(g2);
+    }
+  }
+
+  private void setSelectedCrumb(@NotNull final Crumb<T> c, final int modifiers) {
+    final T selectedElement = c.getItem();
+
+    final Set<BreadcrumbsItem> items = new HashSet<BreadcrumbsItem>();
+    boolean light = false;
+    for (final Crumb each : myCrumbs) {
+      final BreadcrumbsItem item = each.getItem();
+      if (item != null && items.contains(item)) {
+        light = false;
+      }
+
+      each.setLight(light);
+
+      if (item != null && !light) {
+        items.add(item);
+      }
+
+      if (selectedElement == item) {
+        each.setSelected(true);
+        light = true;
+      }
+      else {
+        each.setSelected(false);
+      }
+    }
+
+    fireItemSelected(selectedElement, modifiers);
+
+    repaint();
+  }
+
+  @SuppressWarnings({"ForLoopReplaceableByForEach"})
+  private void fireItemSelected(@Nullable final T item, final int modifiers) {
+    if (item != null) {
+      final BreadcrumbsItemListener[] listeners = myListeners.toArray(new BreadcrumbsItemListener[myListeners.size()]);
+      for (int i = 0; i < listeners.length; i++) {
+        listeners[i].itemSelected(item, modifiers);
+      }
+    }
+  }
+
+  @Nullable
+  private List<Crumb> createCrumbList(@NotNull final FontMetrics fm, @NotNull final List<T> elements, final int width) {
+    if (elements.size() == 0) {
+      return null;
+    }
+
+    final LinkedList<Crumb> result = new LinkedList<Crumb>();
+    int screenWidth = 0;
+    Crumb rightmostCrumb = null;
+
+    // fill up crumb list first going from end to start
+    for (int i = elements.size() - 1; i >= 0; i--) {
+      final NavigationCrumb forward = new NavigationCrumb(this, fm, true, DEFAULT_PAINTER);
+      final NavigationCrumb backward = new NavigationCrumb(this, fm, false, DEFAULT_PAINTER);
+
+      final BreadcrumbsItem element = elements.get(i);
+      final String s = element.getDisplayText();
+      final Dimension d = DEFAULT_PAINTER.getSize(s, fm, width - forward.getWidth() - backward.getWidth());
+      final Crumb crumb = new Crumb(this, s, d.width, element);
+      if (screenWidth + d.width > width) {
+        Crumb first = null;
+        if (screenWidth + backward.getWidth() > width && !result.isEmpty()) {
+          first = result.removeFirst();
+          screenWidth -= first.getWidth();
+        }
+
+        // put backward crumb
+        result.addFirst(backward);
+        screenWidth += backward.getWidth();
+
+        // put dummy crumb to fill up empty space (add it to the end!!!)
+        int dummyWidth = width - screenWidth;
+        if (dummyWidth > 0) {
+          final DummyCrumb dummy = new DummyCrumb(dummyWidth);
+          if (rightmostCrumb != null) {
+            result.add(result.indexOf(rightmostCrumb) + 1, dummy);
+          }
+          else {
+            result.addLast(dummy);
+          }
+        }
+
+        // now add forward crumb
+        screenWidth = forward.getWidth();
+        result.addFirst(forward);
+
+        if (first != null) {
+          result.addFirst(first);
+          screenWidth += first.getWidth();
+        }
+
+        rightmostCrumb = (first != null) ? first : crumb;
+      }
+
+      result.addFirst(crumb);
+
+      screenWidth += d.width;
+    }
+
+    if (rightmostCrumb != null && screenWidth < width) {
+      // fill up empty space with elements from the full screen
+      int index = result.indexOf(rightmostCrumb);
+      for (int i = index + 1; i < result.size(); i++) {
+        final Crumb crumb = result.get(i);
+        if (crumb instanceof NavigationCrumb || crumb instanceof DummyCrumb) {
+          continue;
+        }
+
+        if (screenWidth + crumb.getWidth() < width) {
+          result.add(++index, new Crumb(this, crumb.getString(), crumb.getWidth(), crumb.getItem()));
+          screenWidth += crumb.getWidth();
+          i++;
+        }
+        else {
+          break;
+        }
+      }
+
+      // add first dummy crumb
+      if (screenWidth < width) {
+        result.add(index + 1, new DummyCrumb(width - screenWidth));
+      }
+    }
+
+    //assert screenWidth < width;
+
+    // now fix up offsets going forward
+    int offset = 0;
+    for (final Crumb each : result) {
+      each.setOffset(offset);
+      offset += each.getWidth();
+    }
+
+    // set selected crumb
+    if (result.size() > 0) {
+      for (int i = result.size() - 1; i >= 0; i--) {
+        final Crumb c = result.get(i);
+        if (!(c instanceof DummyCrumb)) {
+          c.setSelected(true);
+          break;
+        }
+      }
+    }
+
+    return result;
+  }
+
+  private static int getTotalWidth(@NotNull final List<Crumb> crumbList) {
+    int totalWidth = 0;
+    for (final Crumb each : crumbList) {
+      totalWidth += each.getWidth();
+    }
+
+    return totalWidth;
+  }
+
+  public Dimension getMinimumSize() {
+    return getPreferredSize();
+  }
+
+  public Dimension getPreferredSize() {
+    final Graphics2D g2 = (Graphics2D)getGraphics();
+    return new Dimension(Integer.MAX_VALUE, g2 != null ? DEFAULT_PAINTER.getSize("DUMMY", g2.getFontMetrics(), Integer.MAX_VALUE).height + 1 : 1);
+  }
+
+  public Dimension getMaximumSize() {
+    return getPreferredSize();
+  }
+
+  public void dispose() {
+    removeMouseListener(myMouseListener);
+    removeMouseMotionListener(myMouseListener);
+
+    myListeners = null;
+  }
+
+  private static class PagedImage {
+    private final int myPageWidth;
+    private int myPage;
+    private final int myTotalWidth;
+
+    public PagedImage(int totalWidth, int pageWidth) {
+      myPageWidth = pageWidth;
+      myTotalWidth = totalWidth;
+    }
+
+    public int getPageCount() {
+      if (myTotalWidth < myPageWidth) {
+        return 1;
+      }
+
+      return myTotalWidth / myPageWidth;
+    }
+
+    public void setPage(final int page) {
+      assert page >= 0;
+      assert page < getPageCount();
+
+      myPage = page;
+    }
+
+    public int getPage() {
+      return myPage;
+    }
+
+    private void repaint(@NotNull final Graphics2D g2,
+                         @NotNull final List<Crumb> crumbList,
+                         @NotNull final Painter painter,
+                         final int height) {
+      //final int height = myImage.getHeight();
+      final int pageOffset = getPageOffset();
+
+      for (final Crumb each : crumbList) {
+        if (each.getOffset() >= pageOffset && each.getOffset() < pageOffset + myPageWidth) {
+          each.paint(g2, painter, height, pageOffset);
+        }
+      }
+    }
+
+    public int getPageOffset() {
+      return myPage * myPageWidth;
+    }
+
+    public void paintPage(@NotNull final Graphics2D g2, @NotNull final List<Crumb> list, @NotNull final Painter p, final int height) {
+      repaint(g2, list, p, height);
+    }
+
+    public boolean isValid(final int width) {
+      return width == myPageWidth;
+    }
+  }
+
+  private static class CrumbLineMouseListener extends MouseAdapter implements MouseMotionListener {
+    private final BreadcrumbsComponent myBreadcrumbs;
+    private Crumb myHoveredCrumb;
+
+    public CrumbLineMouseListener(@NotNull final BreadcrumbsComponent line) {
+      myBreadcrumbs = line;
+    }
+
+    public void mouseDragged(final MouseEvent e) {
+      // nothing
+    }
+
+    public void mouseMoved(final MouseEvent e) {
+      final Crumb crumb = myBreadcrumbs.getCrumb(e.getPoint());
+      if (crumb != myHoveredCrumb) {
+        myBreadcrumbs.setHoveredCrumb(crumb);
+        myHoveredCrumb = crumb;
+      }
+    }
+
+    public void mouseExited(final MouseEvent e) {
+      mouseMoved(e);
+    }
+
+    public void mouseEntered(final MouseEvent e) {
+      mouseMoved(e);
+    }
+
+    public void mouseClicked(final MouseEvent e) {
+      final Crumb crumb = myBreadcrumbs.getCrumb(e.getPoint());
+      if (crumb != null) {
+        crumb.performAction(e.getModifiers());
+      }
+    }
+  }
+
+  private static class Crumb<T extends BreadcrumbsItem> {
+    private String myString;
+    private int myOffset = -1;
+    private int myWidth;
+    private T myItem;
+    private BreadcrumbsComponent myLine;
+    private boolean mySelected;
+    private boolean myHovered;
+    private boolean myLight;
+
+    public Crumb(final BreadcrumbsComponent line, final String string, final int width, final T item) {
+      this(string, width);
+
+      myLine = line;
+      myItem = item;
+    }
+
+    public Crumb(final String string, final int width) {
+      myString = string;
+      myWidth = width;
+    }
+
+    public String getString() {
+      return myString;
+    }
+
+    public int getOffset() {
+      LOG.assertTrue(myOffset != -1, "Negative offet for crumb: " + myString);
+      return myOffset;
+    }
+
+    public int getWidth() {
+      return myWidth;
+    }
+
+    public void setOffset(final int offset) {
+      myOffset = offset;
+    }
+
+    public String toString() {
+      return getString();
+    }
+
+    public void setSelected(final boolean selected) {
+      mySelected = selected;
+    }
+
+    public void setLight(final boolean light) {
+      myLight = light;
+    }
+
+    public boolean isHovered() {
+      return myHovered;
+    }
+
+    public boolean isSelected() {
+      return mySelected;
+    }
+
+    public boolean isLight() {
+      return myLight;
+    }
+
+    public void paint(@NotNull final Graphics2D g2, @NotNull final Painter painter, final int height, final int pageOffset) {
+      painter.paint(this, g2, height, pageOffset);
+    }
+
+    @Nullable
+    public String getTooltipText() {
+      final BreadcrumbsItem element = getItem();
+      if (element != null) {
+        return element.getTooltip();
+      }
+
+      return null;
+    }
+
+    public T getItem() {
+      return myItem;
+    }
+
+    public void performAction(final int modifiers) {
+      myLine.setSelectedCrumb(this, modifiers);
+    }
+
+    public void setHovered(final boolean b) {
+      myHovered = b;
+    }
+  }
+
+  private static class NavigationCrumb extends Crumb {
+    @NonNls private static final String FORWARD = ">>";
+    @NonNls private static final String BACKWARD = "<<";
+    private final boolean myForward;
+    private final BreadcrumbsComponent myLine;
+
+    public NavigationCrumb(@NotNull final BreadcrumbsComponent line,
+                           @NotNull final FontMetrics fm,
+                           final boolean forward,
+                           @NotNull final Painter p) {
+      super(forward ? FORWARD : BACKWARD, p.getSize(forward ? FORWARD : BACKWARD, fm, Integer.MAX_VALUE).width);
+      myForward = forward;
+      myLine = line;
+    }
+
+    public void performAction(final int modifiers) {
+      if (myForward) {
+        myLine.nextPage();
+      }
+      else {
+        myLine.previousPage();
+      }
+    }
+  }
+
+  private static class DummyCrumb extends Crumb {
+    public DummyCrumb(final int width) {
+      super(null, width);
+    }
+
+    public void paint(@NotNull final Graphics2D g2, @NotNull final Painter painter, final int height, final int pageOffset) {
+      // does nothing
+    }
+
+    public void performAction(final int modifiers) {
+      // does nothing
+    }
+
+    @SuppressWarnings({"HardCodedStringLiteral"})
+    public String toString() {
+      return "DUMMY";
+    }
+  }
+
+  abstract static class PainterSettings {
+    private static final Color DEFAULT_FOREGROUND_COLOR = new JBColor(Gray._50, UIUtil.getListForeground());
+
+    @Nullable
+    Color getBackgroundColor(@NotNull final Crumb c) {
+      return null;
+    }
+
+    @Nullable
+    Color getForegroundColor(@NotNull final Crumb c) {
+      return DEFAULT_FOREGROUND_COLOR;
+    }
+
+    @Nullable
+    Color getBorderColor(@NotNull final Crumb c) {
+      return null;
+    }
+
+    @Nullable
+    Font getFont(@NotNull final Graphics g2, @NotNull final Crumb c) {
+      return null;
+    }
+  }
+
+  static class ButtonSettings extends PainterSettings {
+    protected static final Color DEFAULT_BG_COLOR = new JBColor(Gray._245, new Color(101, 104, 106));
+    private static final Color LIGHT_BG_COLOR = new JBColor(Gray._253, Gray._130);
+    private static final Color CURRENT_BG_COLOR = new JBColor(new Color(250, 250, 220), new Color(97, 97, 75));
+    protected static final Color HOVERED_BG_COLOR = new JBColor(Gray._220, ColorUtil.shift(DEFAULT_BG_COLOR, 1.2));
+
+    private static final Color LIGHT_TEXT_COLOR = new JBColor(Gray._170, UIUtil.getListForeground());
+
+    protected static final Color DEFAULT_BORDER_COLOR = new JBColor(Gray._90, Gray._50);
+    private static final Color LIGHT_BORDER_COLOR = new JBColor(Gray._170, Gray._70);
+
+    static Color getBackgroundColor(boolean selected, boolean hovered, boolean light, boolean navigationCrumb) {
+      if (hovered) {
+        return HOVERED_BG_COLOR;
+      }
+
+      if (selected) {
+        return CURRENT_BG_COLOR;
+      }
+
+      if (light && !navigationCrumb) {
+        return LIGHT_BG_COLOR;
+      }
+
+      return DEFAULT_BG_COLOR;
+    }
+
+    @Nullable
+    Color getBackgroundColor(@NotNull final Crumb c) {
+      final BreadcrumbsItem item = c.getItem();
+      if (item != null) {
+        final CrumbPresentation presentation = item.getPresentation();
+        if (presentation != null) {
+          return presentation.getBackgroundColor(c.isSelected(), c.isHovered(), c.isLight());
+        }
+      }
+      return getBackgroundColor(c.isSelected(), c.isHovered(), c.isLight(), c instanceof NavigationCrumb);
+    }
+
+    @Nullable
+    Color getForegroundColor(@NotNull final Crumb c) {
+      if (c.isLight() && !c.isHovered() && !(c instanceof NavigationCrumb)) {
+        return LIGHT_TEXT_COLOR;
+      }
+
+      return super.getForegroundColor(c);
+    }
+
+    @Nullable
+    Color getBorderColor(@NotNull final Crumb c) {
+      return (c.isLight() && !c.isHovered() && !(c instanceof NavigationCrumb)) ? LIGHT_BORDER_COLOR : DEFAULT_BORDER_COLOR;
+    }
+  }
+
+  abstract static class Painter {
+    public static final int ROUND_VALUE = SystemInfo.isMac ? 3 : 2;
+
+    private final PainterSettings mySettings;
+
+    public Painter(@NotNull final PainterSettings s) {
+      mySettings = s;
+    }
+
+    protected PainterSettings getSettings() {
+      return mySettings;
+    }
+
+    abstract void paint(@NotNull final Crumb c, @NotNull final Graphics2D g2, final int height, final int pageOffset);
+
+    @NotNull
+    Dimension getSize(@NotNull @NonNls final String s, @NotNull final FontMetrics fm, final int maxWidth) {
+      final int w = fm.stringWidth(s);
+      return new Dimension(w > maxWidth ? maxWidth : w, fm.getHeight());
+    }
+
+  }
+
+  private static class DefaultPainter extends Painter {
+    public DefaultPainter(@NotNull final PainterSettings s) {
+      super(s);
+    }
+
+    public void paint(@NotNull final Crumb c, @NotNull final Graphics2D g2, final int height, final int pageOffset) {
+      final PainterSettings s = getSettings();
+      final Font oldFont = g2.getFont();
+      final int offset = c.getOffset() - pageOffset;
+
+      final Color bg = s.getBackgroundColor(c);
+      final int width = c.getWidth();
+      if (bg != null) {
+        g2.setColor(bg);
+        g2.fillRoundRect(offset + 2, 0, width - 4, height - 3, ROUND_VALUE, ROUND_VALUE);
+      }
+
+      final Color borderColor = s.getBorderColor(c);
+      if (borderColor != null) {
+        g2.setColor(borderColor);
+        g2.drawRoundRect(offset + 1, 0, width - 2, height - 3, ROUND_VALUE, ROUND_VALUE);
+      }
+
+      final Color textColor = s.getForegroundColor(c);
+      if (textColor != null) {
+        g2.setColor(textColor);
+      }
+
+      final Font font = s.getFont(g2, c);
+      if (font != null) {
+        g2.setFont(font);
+      }
+
+      final FontMetrics fm = g2.getFontMetrics();
+
+      String string = c.getString();
+      if (fm.stringWidth(string) > width) {
+        final int dotsWidth = fm.stringWidth("...");
+        final StringBuffer sb = new StringBuffer();
+        int length = 0;
+        for (int i = 0; i < string.length(); i++) {
+          final int charWidth = fm.charWidth(string.charAt(i));
+          if (length + charWidth + dotsWidth > width) {
+            break;
+          }
+
+          length += charWidth;
+          sb.append(string.charAt(i));
+        }
+
+        string = sb.append("...").toString();
+      }
+
+      UIUtil.applyRenderingHints(g2);
+      g2.drawString(string, offset + ROUND_VALUE, height - fm.getDescent() - 2);
+
+      g2.setFont(oldFont);
+    }
+
+    @NotNull
+    Dimension getSize(@NotNull @NonNls final String s, @NotNull final FontMetrics fm, final int maxWidth) {
+      final int width = fm.stringWidth(s) + (ROUND_VALUE * 2);
+      return new Dimension(width > maxWidth ? maxWidth : width, fm.getHeight() + 4);
+    }
+  }
+}
diff --git a/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsInfoProvider.java b/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsInfoProvider.java
new file mode 100644
index 0000000..9ddf8875
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsInfoProvider.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: spleaner
+ * Date: Jun 19, 2007
+ * Time: 3:33:15 PM
+ */
+package com.intellij.xml.breadcrumbs;
+
+import com.intellij.lang.Language;
+import com.intellij.psi.PsiElement;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public abstract class BreadcrumbsInfoProvider {
+  public static final ExtensionPointName<BreadcrumbsInfoProvider> EP_NAME = ExtensionPointName.create("com.intellij.breadcrumbsInfoProvider");
+
+  public abstract Language[] getLanguages();
+
+  public abstract boolean acceptElement(@NotNull final PsiElement e);
+
+  @Nullable
+  public PsiElement getParent(@NotNull final PsiElement e) {
+    return e.getParent();
+  }
+
+  @NotNull
+  public abstract String getElementInfo(@NotNull final PsiElement e);
+
+  @Nullable
+  public abstract String getElementTooltip(@NotNull final PsiElement e);
+}
\ No newline at end of file
diff --git a/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsItem.java b/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsItem.java
new file mode 100644
index 0000000..3f546a2
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsItem.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.breadcrumbs;
+
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author spleaner
+ */
+public abstract class BreadcrumbsItem {
+
+  public abstract String getDisplayText();
+
+  public String getTooltip() {
+    return "";
+  }
+
+  @Nullable
+  public CrumbPresentation getPresentation() {
+    return null;
+  }
+}
diff --git a/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsItemListener.java b/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsItemListener.java
new file mode 100644
index 0000000..0b74d34
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsItemListener.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.breadcrumbs;
+
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+public interface BreadcrumbsItemListener<T extends BreadcrumbsItem> {
+
+  void itemSelected(@NotNull final T item, final int modifiers);
+
+}
diff --git a/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsPresentationProvider.java b/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsPresentationProvider.java
new file mode 100644
index 0000000..5382ce4
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsPresentationProvider.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.breadcrumbs;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public abstract class BreadcrumbsPresentationProvider {
+  public static final ExtensionPointName<BreadcrumbsPresentationProvider> EP_NAME =
+    ExtensionPointName.create("com.intellij.breadcrumbsPresentationProvider");
+
+  @Nullable
+  public abstract CrumbPresentation[] getCrumbPresentations(@NotNull PsiElement[] element);
+}
diff --git a/xml/openapi/src/com/intellij/xml/breadcrumbs/CrumbPresentation.java b/xml/openapi/src/com/intellij/xml/breadcrumbs/CrumbPresentation.java
new file mode 100644
index 0000000..fbb6e7c
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/breadcrumbs/CrumbPresentation.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.breadcrumbs;
+
+import java.awt.*;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public abstract class CrumbPresentation {
+  public abstract Color getBackgroundColor(boolean selected, boolean hovered, boolean light);
+}
diff --git a/xml/openapi/src/com/intellij/xml/breadcrumbs/DefaultCrumbsPresentation.java b/xml/openapi/src/com/intellij/xml/breadcrumbs/DefaultCrumbsPresentation.java
new file mode 100644
index 0000000..da415ae
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/breadcrumbs/DefaultCrumbsPresentation.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.breadcrumbs;
+
+import java.awt.*;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class DefaultCrumbsPresentation extends CrumbPresentation {
+  @Override
+  public Color getBackgroundColor(boolean selected, boolean hovered, boolean light) {
+    return BreadcrumbsComponent.ButtonSettings.getBackgroundColor(selected, hovered, light, false);
+  }
+}
diff --git a/xml/openapi/src/com/intellij/xml/package.html b/xml/openapi/src/com/intellij/xml/package.html
new file mode 100644
index 0000000..3e22757
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/package.html
@@ -0,0 +1,20 @@
+<!--
+  ~ Copyright 2000-2007 JetBrains s.r.o.
+  ~
+  ~ 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.
+  -->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html><body bgcolor="white">
+Provides interfaces for metadata used on XML elements.
+</body></html>
diff --git a/xml/openapi/src/com/intellij/xml/util/XmlTagTextUtil.java b/xml/openapi/src/com/intellij/xml/util/XmlTagTextUtil.java
new file mode 100644
index 0000000..2124701
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/util/XmlTagTextUtil.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+public class XmlTagTextUtil extends XmlTagUtil {
+
+}
\ No newline at end of file
diff --git a/xml/openapi/src/com/intellij/xml/util/XmlTagUtil.java b/xml/openapi/src/com/intellij/xml/util/XmlTagUtil.java
new file mode 100644
index 0000000..62bb50e
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/util/XmlTagUtil.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2000-2009 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.util;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlTagValue;
+import com.intellij.psi.xml.XmlToken;
+import com.intellij.psi.xml.XmlTokenType;
+import com.intellij.util.ArrayUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author peter
+ */
+@SuppressWarnings({"HardCodedStringLiteral"})
+public class XmlTagUtil extends XmlTagUtilBase {
+  private static final Map<String, Character> ourCharacterEntities;
+
+  static {
+    ourCharacterEntities = new HashMap<String, Character>();
+    ourCharacterEntities.put("lt", new Character('<'));
+    ourCharacterEntities.put("gt", new Character('>'));
+    ourCharacterEntities.put("apos", new Character('\''));
+    ourCharacterEntities.put("quot", new Character('\"'));
+    ourCharacterEntities.put("nbsp", new Character('\u00a0'));
+    ourCharacterEntities.put("amp", new Character('&'));
+  }
+
+  /**
+   * if text contains XML-sensitive characters (<,>), quote text with ![CDATA[ ... ]]
+   *
+   * @param text
+   * @return quoted text
+   */
+  public static String getCDATAQuote(String text) {
+    if (text == null) return null;
+    String offensiveChars = "<>&\n";
+    final int textLength = text.length();
+    if (textLength > 0 && (Character.isWhitespace(text.charAt(0)) || Character.isWhitespace(text.charAt(textLength - 1)))) {
+      return "<![CDATA[" + text + "]]>";
+    }
+    for (int i = 0; i < offensiveChars.length(); i++) {
+      char c = offensiveChars.charAt(i);
+      if (text.indexOf(c) != -1) {
+        return "<![CDATA[" + text + "]]>";
+      }
+    }
+    return text;
+  }
+
+  public static String getInlineQuote(String text) {
+    if (text == null) return null;
+    String offensiveChars = "<>&";
+    for (int i = 0; i < offensiveChars.length(); i++) {
+      char c = offensiveChars.charAt(i);
+      if (text.indexOf(c) != -1) {
+        return "<![CDATA[" + text + "]]>";
+      }
+    }
+    return text;
+  }
+
+
+  public static String composeTagText(@NonNls String tagName, @NonNls String tagValue) {
+    String result = "<" + tagName;
+    if (tagValue == null || "".equals(tagValue)) {
+      result += "/>";
+    }
+    else {
+      result += ">" + getCDATAQuote(tagValue) + "</" + tagName + ">";
+    }
+    return result;
+  }
+
+  public static String[] getCharacterEntityNames() {
+    Set<String> strings = ourCharacterEntities.keySet();
+    return ArrayUtil.toStringArray(strings);
+  }
+
+  public static Character getCharacterByEntityName(String entityName) {
+    return ourCharacterEntities.get(entityName);
+  }
+
+  @Nullable
+  public static XmlToken getStartTagNameElement(@NotNull XmlTag tag) {
+    final ASTNode node = tag.getNode();
+    if (node == null) return null;
+
+    ASTNode current = node.getFirstChildNode();
+    IElementType elementType;
+    while (current != null
+           && (elementType = current.getElementType()) != XmlTokenType.XML_NAME
+           && elementType != XmlTokenType.XML_TAG_NAME) {
+      current = current.getTreeNext();
+    }
+    return current == null ? null : (XmlToken)current.getPsi();
+  }
+
+  @Nullable
+  public static XmlToken getEndTagNameElement(@NotNull XmlTag tag) {
+    final ASTNode node = tag.getNode();
+    if (node == null) return null;
+
+    ASTNode current = node.getLastChildNode();
+    ASTNode prev = current;
+
+    while (current != null) {
+      final IElementType elementType = prev.getElementType();
+      if ((elementType == XmlTokenType.XML_NAME || elementType == XmlTokenType.XML_TAG_NAME) &&
+          current.getElementType() == XmlTokenType.XML_END_TAG_START) {
+        return (XmlToken)prev.getPsi();
+      }
+
+      prev = current;
+      current = current.getTreePrev();
+
+    }
+    return null;
+  }
+
+  @NotNull
+  public static TextRange getTrimmedValueRange(final @NotNull XmlTag tag) {
+    XmlTagValue tagValue = tag.getValue();
+    final String text = tagValue.getText();
+    final String trimmed = text.trim();
+    final int index = text.indexOf(trimmed);
+    final int startOffset = tagValue.getTextRange().getStartOffset() - tag.getTextRange().getStartOffset() + index;
+    return new TextRange(startOffset, startOffset + trimmed.length());
+  }
+
+  @Nullable
+  public static TextRange getStartTagRange(@NotNull XmlTag tag) {
+    XmlToken tagName = getStartTagNameElement(tag);
+    return getTag(tagName, XmlTokenType.XML_START_TAG_START);
+  }
+
+
+  @Nullable
+  public static TextRange getEndTagRange(@NotNull XmlTag tag) {
+    XmlToken tagName = getEndTagNameElement(tag);
+
+    return getTag(tagName, XmlTokenType.XML_END_TAG_START);
+  }
+
+  private static TextRange getTag(XmlToken tagName, IElementType tagStart) {
+    if (tagName != null) {
+      PsiElement s = tagName.getPrevSibling();
+
+      while (s != null && s.getNode().getElementType() != tagStart) {
+        s = s.getPrevSibling();
+      }
+
+      PsiElement f = tagName.getNextSibling();
+
+      while (f != null &&
+             !(f.getNode().getElementType() == XmlTokenType.XML_TAG_END ||
+               f.getNode().getElementType() == XmlTokenType.XML_EMPTY_ELEMENT_END)) {
+        f = f.getNextSibling();
+      }
+      if (s != null && f != null) {
+        return new TextRange(s.getTextRange().getStartOffset(), f.getTextRange().getEndOffset());
+      }
+    }
+    return null;
+  }
+}
diff --git a/xml/openapi/src/com/intellij/xml/util/package.html b/xml/openapi/src/com/intellij/xml/util/package.html
new file mode 100644
index 0000000..61262d8
--- /dev/null
+++ b/xml/openapi/src/com/intellij/xml/util/package.html
@@ -0,0 +1,20 @@
+<!--
+  ~ Copyright 2000-2007 JetBrains s.r.o.
+  ~
+  ~ 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.
+  -->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html><body bgcolor="white">
+Provides utility functions for working with XML.
+</body></html>
diff --git a/xml/openapi/xml-openapi.iml b/xml/openapi/xml-openapi.iml
new file mode 100644
index 0000000..8e89609
--- /dev/null
+++ b/xml/openapi/xml-openapi.iml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="lang-api" />
+  </component>
+  <component name="copyright">
+    <Base>
+      <setting name="state" value="1" />
+    </Base>
+  </component>
+</module>
+
diff --git a/xml/relaxng/lib/isorelax.jar b/xml/relaxng/lib/isorelax.jar
new file mode 100644
index 0000000..a2ebb76
--- /dev/null
+++ b/xml/relaxng/lib/isorelax.jar
Binary files differ
diff --git a/xml/relaxng/lib/jing.jar b/xml/relaxng/lib/jing.jar
new file mode 100644
index 0000000..6acbfb0
--- /dev/null
+++ b/xml/relaxng/lib/jing.jar
Binary files differ
diff --git a/xml/relaxng/lib/rngom-20051226-patched.jar b/xml/relaxng/lib/rngom-20051226-patched.jar
new file mode 100644
index 0000000..68cad02
--- /dev/null
+++ b/xml/relaxng/lib/rngom-20051226-patched.jar
Binary files differ
diff --git a/xml/relaxng/lib/rngom-src.zip b/xml/relaxng/lib/rngom-src.zip
new file mode 100644
index 0000000..4b660e9
--- /dev/null
+++ b/xml/relaxng/lib/rngom-src.zip
Binary files differ
diff --git a/xml/relaxng/lib/trang-copying.txt b/xml/relaxng/lib/trang-copying.txt
new file mode 100644
index 0000000..cdaf2c7
--- /dev/null
+++ b/xml/relaxng/lib/trang-copying.txt
@@ -0,0 +1,31 @@
+Copyright (c) 2002, 2003 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.
diff --git a/xml/relaxng/lib/trang-core.jar b/xml/relaxng/lib/trang-core.jar
new file mode 100644
index 0000000..dee7278
--- /dev/null
+++ b/xml/relaxng/lib/trang-core.jar
Binary files differ
diff --git a/xml/relaxng/relaxng.iml b/xml/relaxng/relaxng.iml
new file mode 100644
index 0000000..d7d35d4
--- /dev/null
+++ b/xml/relaxng/relaxng.iml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="lang-api" />
+    <orderEntry type="module" module-name="xml" />
+    <orderEntry type="module" module-name="dom-openapi" />
+    <orderEntry type="module" module-name="lang-impl" />
+    <orderEntry type="module" module-name="testFramework" scope="TEST" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/lib/rngom-20051226-patched.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/lib/rngom-src.zip!/src" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/lib/isorelax.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/lib/trang-core.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/lib/jing.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+  </component>
+</module>
+
diff --git a/xml/relaxng/src/META-INF/LICENSE b/xml/relaxng/src/META-INF/LICENSE
new file mode 100644
index 0000000..102b6bc
--- /dev/null
+++ b/xml/relaxng/src/META-INF/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2007 Sascha Weinreuter
+
+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.
diff --git a/xml/relaxng/src/META-INF/jing-copying.html b/xml/relaxng/src/META-INF/jing-copying.html
new file mode 100644
index 0000000..cb8c92e
--- /dev/null
+++ b/xml/relaxng/src/META-INF/jing-copying.html
@@ -0,0 +1,73 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Jing Copying Conditions</title>
+</head>
+
+<body>
+<h1>Jing Copying Conditions</h1>
+
+<p>Copyright (c) 2001-2003 Thai Open Source Software Center Ltd<br />
+All rights reserved.</p>
+
+<p>Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:</p>
+
+<ul>
+    <li>Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.</li>
+
+    <li>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.</li>
+
+    <li>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.</li>
+</ul>
+
+<p>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.</p>
+
+<h2>Third-party JARs</h2>
+
+<p>This distribution includes some additional JAR files, which have
+their own copying conditions:</p>
+
+<dl>
+  
+<dt><code>isorelax.jar</code></dt>
+<dd>Comes from <a href="http://sourceforge.net/projects/iso-relax/">ISO RELAX</a>
+2003/01/08 distribution and is covered by the following license:
+
+<p>Copyright (c) 2001-2002, SourceForge ISO-RELAX Project (ASAMI Tomoharu, Daisuke
+Okajima, Kohsuke Kawaguchi, and MURATA Makoto)</p>
+ 
+<p>Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
+ 
+<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
+ 
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR
+A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
+</dd>
+
+</dl>
+
+</body>
+
+</html>
diff --git a/xml/relaxng/src/META-INF/relaxng-plugin.xml b/xml/relaxng/src/META-INF/relaxng-plugin.xml
new file mode 100644
index 0000000..1936e18
--- /dev/null
+++ b/xml/relaxng/src/META-INF/relaxng-plugin.xml
@@ -0,0 +1,75 @@
+<idea-plugin>
+  <extensions defaultExtensionNs="com.intellij">
+    <errorHandler implementation="com.intellij.diagnostic.ITNReporter" />
+    <gotoSymbolContributor implementation="org.intellij.plugins.relaxNG.GotoSymbolContributor" />
+    <xml.schemaProvider implementation="org.intellij.plugins.relaxNG.config.NoNamespaceSchemaProvider" />
+    <hectorComponentProvider implementation="org.intellij.plugins.relaxNG.config.NoNamespaceConfigImpl$HectorProvider" />
+
+    <fileTypeFactory implementation="org.intellij.plugins.relaxNG.compact.RncFileType$Factory" />
+    <completionData fileType="RNG Compact" className="org.intellij.plugins.relaxNG.compact.RncCompletionData" />
+    <standardResourceProvider implementation="org.intellij.plugins.relaxNG.ApplicationLoader$ResourceProvider" />
+
+    <annotator language="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.compact.ReferenceAnnotator" />
+    <annotator language="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.model.annotation.ModelAnnotator" />
+    <externalAnnotator language="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.validation.RngSchemaValidator" />
+
+    <lang.parserDefinition language="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.compact.RncParserDefinition" />
+    <lang.braceMatcher language="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.compact.RngCompactLanguage$MyPairedBraceMatcher" />
+    <lang.commenter language="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.compact.RngCompactLanguage$MyCommenter" />
+    <lang.foldingBuilder language="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.compact.folding.RncFoldingBuilder" />
+    <lang.formatter language="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.compact.formatting.RncFormattingModelBuilder" />
+    <lang.namesValidator language="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.compact.RngCompactLanguage$MyNamesValidator" />
+    <lang.syntaxHighlighterFactory key="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.compact.RngCompactLanguage$MySyntaxHighlighterFactory" />
+
+    <lang.elementManipulator forClass="org.intellij.plugins.relaxNG.compact.psi.RncFileReference" implementationClass="org.intellij.plugins.relaxNG.RncFileReferenceManipulator" />
+
+    <lang.documentationProvider language="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.compact.RngCompactLanguage$MyDocumentationProvider" />
+
+    <fileBasedIndex implementation="org.intellij.plugins.relaxNG.model.resolve.RelaxSymbolIndex" />
+    <include.provider implementation="org.intellij.plugins.relaxNG.model.resolve.RelaxIncludeProvider"/>
+
+    <externalAnnotator language="XML" implementationClass="org.intellij.plugins.relaxNG.validation.RngSchemaValidator" />
+    <lang.documentationProvider language="XML" implementationClass="org.intellij.plugins.relaxNG.RngDocumentationProvider" />
+    <psi.referenceContributor implementation="org.intellij.plugins.relaxNG.RelaxNGReferenceContributor"/>
+
+    <dom.fileDescription implementation="org.intellij.plugins.relaxNG.RngDomFileDescription$RngChoiceDescription"/>
+    <dom.fileDescription implementation="org.intellij.plugins.relaxNG.RngDomFileDescription$RngElementDescription"/>
+    <dom.fileDescription implementation="org.intellij.plugins.relaxNG.RngDomFileDescription$RngGrammarDescription"/>
+    <dom.fileDescription implementation="org.intellij.plugins.relaxNG.RngDomFileDescription$RngGroupDescription"/>
+    <dom.fileDescription implementation="org.intellij.plugins.relaxNG.RngDomFileDescription$RngInterleaveDescription"/>
+
+    <dom.implementation interfaceClass="org.intellij.plugins.relaxNG.xml.dom.RngDefine" implementationClass="org.intellij.plugins.relaxNG.xml.dom.impl.RngDefineImpl"/>
+    <dom.implementation interfaceClass="org.intellij.plugins.relaxNG.xml.dom.RngGrammar" implementationClass="org.intellij.plugins.relaxNG.xml.dom.impl.RngGrammarImpl"/>
+    <dom.implementation interfaceClass="org.intellij.plugins.relaxNG.xml.dom.RngInclude" implementationClass="org.intellij.plugins.relaxNG.xml.dom.impl.RngIncludeImpl"/>
+    <dom.implementation interfaceClass="org.intellij.plugins.relaxNG.xml.dom.RngRef" implementationClass="org.intellij.plugins.relaxNG.xml.dom.impl.RngRefImpl"/>
+    <xml.html5SchemaProvider implementation="org.intellij.plugins.relaxNG.xml.RngHtml5SchemaProvider"/>
+    <metaDataContributor implementation="org.intellij.html.RngHtml5MetaDataContributor"/>
+
+    <localInspection shortName="UnresolvedReference" displayName="Unresolved References" groupName="RELAX NG" enabledByDefault="true"
+                     level="ERROR" implementationClass="org.intellij.plugins.relaxNG.inspections.RngDomInspection"/>
+    <localInspection shortName="UnusedDefine" displayName="Unused Define" groupName="RELAX NG" enabledByDefault="false" level="WARNING"
+                     implementationClass="org.intellij.plugins.relaxNG.inspections.UnusedDefineInspection"/>
+
+  </extensions>
+
+  <project-components>
+    <component>
+      <interface-class>org.intellij.plugins.relaxNG.config.NoNamespaceConfig</interface-class>
+      <implementation-class>org.intellij.plugins.relaxNG.config.NoNamespaceConfigImpl</implementation-class>
+    </component>
+  </project-components>
+
+  <application-components>
+    <component>
+      <implementation-class>org.intellij.plugins.relaxNG.ApplicationLoader</implementation-class>
+    </component>
+  </application-components>
+
+  <actions>
+    <action id="ConvertSchemaAction" class="org.intellij.plugins.relaxNG.convert.ConvertSchemaAction"
+            text="Convert Schema..."
+            description="Converts the selected Schema document (RNG, RNC, XSD, DTD) into another format">
+      <add-to-group group-id="ToolsXmlGroup" anchor="after" relative-to-action="GenerateDTD" />
+    </action>
+  </actions>
+</idea-plugin>
\ No newline at end of file
diff --git a/xml/relaxng/src/inspectionDescriptions/UnresolvedReference.html b/xml/relaxng/src/inspectionDescriptions/UnresolvedReference.html
new file mode 100644
index 0000000..216227e
--- /dev/null
+++ b/xml/relaxng/src/inspectionDescriptions/UnresolvedReference.html
@@ -0,0 +1,25 @@
+<html>
+<head>
+  <style type="text/css">
+    body, table {
+      font-family: Verdana, sans-serif;
+      font-size: 100%;
+      padding-left: 2mm;
+    }
+
+    #footer {
+      font-size: 95%;
+      padding-top: 10px;
+    }
+  </style>
+</head>
+
+<body>
+<p>
+  This inspections checks for any unresolved references to named patterns ("define") in a RELAX-NG file in XML Syntax.
+  For unresolved references, a QuickFix is offered to create a corresponding define-element.
+</p>
+
+<p id="footer">Powered by RELAX-NG Support</p>
+</body>
+</html>
diff --git a/xml/relaxng/src/inspectionDescriptions/UnusedDefine.html b/xml/relaxng/src/inspectionDescriptions/UnusedDefine.html
new file mode 100644
index 0000000..1a59a90
--- /dev/null
+++ b/xml/relaxng/src/inspectionDescriptions/UnusedDefine.html
@@ -0,0 +1,26 @@
+<html>
+<head>
+  <style type="text/css">
+    body, table {
+      font-family: Verdana, sans-serif;
+      font-size: 100%;
+      padding-left: 2mm;
+    }
+
+    #footer {
+      font-size: 95%;
+      padding-top: 10px;
+    }
+  </style>
+</head>
+
+<body>
+<p>
+  This inspections checks for any unused named patterns ("define") in a RELAX-NG file (XML or Compact Syntax) and
+  highlights them as unused symbols. This is done with respect to includes from other files, i.e. a define is not
+  marked as unused if is is used through an include in another file.
+</p>
+
+<p id="footer">Powered by RELAX-NG Support</p>
+</body>
+</html>
diff --git a/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngElementDescriptor.java b/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngElementDescriptor.java
new file mode 100644
index 0000000..48fa59d
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngElementDescriptor.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package org.intellij.html;
+
+import com.intellij.html.impl.RelaxedHtmlFromSchemaElementDescriptor;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.*;
+import com.intellij.xml.util.HtmlUtil;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class RelaxedHtmlFromRngElementDescriptor implements XmlElementDescriptor, XmlElementDescriptorAwareAboutChildren {
+  private final XmlElementDescriptor myDelegate;
+
+  public RelaxedHtmlFromRngElementDescriptor(XmlElementDescriptor delegate) {
+    myDelegate = delegate;
+  }
+
+  public XmlElementDescriptor getElementDescriptor(XmlTag childTag, XmlTag contextTag) {
+    XmlElementDescriptor elementDescriptor = myDelegate.getElementDescriptor(childTag, contextTag);
+
+    if (elementDescriptor == null) {
+      return RelaxedHtmlFromSchemaElementDescriptor.getRelaxedDescriptor(this, childTag);
+    }
+
+    return elementDescriptor;
+  }
+
+  @Override
+  public String getQualifiedName() {
+    return myDelegate.getQualifiedName();
+  }
+
+  @Override
+  public String getDefaultName() {
+    return myDelegate.getDefaultName();
+  }
+
+  public XmlElementDescriptor[] getElementsDescriptors(final XmlTag context) {
+    return ArrayUtil.mergeArrays(
+      myDelegate.getElementsDescriptors(context),
+      HtmlUtil.getCustomTagDescriptors(context)
+    );
+  }
+
+  public XmlAttributeDescriptor[] getAttributesDescriptors(final XmlTag context) {
+    return RelaxedHtmlFromSchemaElementDescriptor.addAttrDescriptorsForFacelets(context, myDelegate.getAttributesDescriptors(context));
+  }
+
+  @Override
+  public XmlAttributeDescriptor getAttributeDescriptor(XmlAttribute attribute) {
+    return getAttributeDescriptor(attribute.getName(), attribute.getParent());
+  }
+
+  @Override
+  public XmlNSDescriptor getNSDescriptor() {
+    return myDelegate.getNSDescriptor();
+  }
+
+  @Override
+  public XmlElementsGroup getTopGroup() {
+    return myDelegate.getTopGroup();
+  }
+
+  @Override
+  public int getContentType() {
+    return myDelegate.getContentType();
+  }
+
+  @Override
+  public String getDefaultValue() {
+    return null;
+  }
+
+  public XmlAttributeDescriptor getAttributeDescriptor(String attributeName, final XmlTag context) {
+    final XmlAttributeDescriptor descriptor = myDelegate.getAttributeDescriptor(attributeName.toLowerCase(), context);
+    if (descriptor != null) return descriptor;
+
+    return RelaxedHtmlFromSchemaElementDescriptor.getAttributeDescriptorFromFacelets(attributeName, context);
+  }
+
+  @Override
+  public PsiElement getDeclaration() {
+    return myDelegate.getDeclaration();
+  }
+
+  @Override
+  public String getName(PsiElement context) {
+    return myDelegate.getName(context);
+  }
+
+  @Override
+  public String getName() {
+    return myDelegate.getName();
+  }
+
+  @Override
+  public void init(PsiElement element) {
+    myDelegate.init(element);
+  }
+
+  @Override
+  public Object[] getDependences() {
+    return myDelegate.getDependences();
+  }
+
+  @Override
+  public boolean allowElementsFromNamespace(String namespace, XmlTag context) {
+    return true;
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngNSDescriptor.java b/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngNSDescriptor.java
new file mode 100644
index 0000000..8724b3e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngNSDescriptor.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2011 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package org.intellij.html;
+
+import com.intellij.html.RelaxedHtmlNSDescriptor;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import com.intellij.xml.util.HtmlUtil;
+import com.intellij.xml.util.XmlUtil;
+import org.intellij.plugins.relaxNG.model.descriptors.RngNsDescriptor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class RelaxedHtmlFromRngNSDescriptor extends RngNsDescriptor implements RelaxedHtmlNSDescriptor {
+  private static final Logger LOG = Logger.getInstance("#org.intellij.html.RelaxedHtmlFromRngNSDescriptor");
+
+  public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
+    XmlElementDescriptor elementDescriptor = super.getElementDescriptor(tag);
+
+    LOG.debug("Descriptor from rng for tag " +
+              tag.getName() +
+              " is " +
+              (elementDescriptor != null ? elementDescriptor.getClass().getCanonicalName() : "NULL"));
+
+    String namespace;
+    if (elementDescriptor == null &&
+        !((namespace = tag.getNamespace()).equals(XmlUtil.XHTML_URI))) {
+      return new AnyXmlElementDescriptor(
+        null,
+        XmlUtil.HTML_URI.equals(namespace) ? this : tag.getNSDescriptor(tag.getNamespace(), true)
+      );
+    }
+
+    return elementDescriptor;
+  }
+
+  @Override
+  protected XmlElementDescriptor initDescriptor(@NotNull XmlElementDescriptor descriptor) {
+    return new RelaxedHtmlFromRngElementDescriptor(descriptor);
+  }
+
+  @NotNull
+  public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable final XmlDocument doc) {
+    return ArrayUtil.mergeArrays(super.getRootElementsDescriptors(doc), HtmlUtil.getCustomTagDescriptors(doc));
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/html/RngHtml5MetaDataContributor.java b/xml/relaxng/src/org/intellij/html/RngHtml5MetaDataContributor.java
new file mode 100644
index 0000000..9d7c0a3
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/html/RngHtml5MetaDataContributor.java
@@ -0,0 +1,64 @@
+package org.intellij.html;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.filters.AndFilter;
+import com.intellij.psi.filters.ClassFilter;
+import com.intellij.psi.filters.XmlTextFilter;
+import com.intellij.psi.meta.MetaDataContributor;
+import com.intellij.psi.meta.MetaDataRegistrar;
+import com.intellij.util.ReflectionCache;
+import com.intellij.xml.util.XmlUtil;
+import org.intellij.plugins.relaxNG.compact.psi.RncDecl;
+import org.intellij.plugins.relaxNG.compact.psi.RncFile;
+import org.intellij.plugins.relaxNG.compact.psi.RncNsDecl;
+import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class RngHtml5MetaDataContributor implements MetaDataContributor {
+  @Override
+  public void contributeMetaData(MetaDataRegistrar registrar) {
+    registrar.registerMetaData(
+      new AndFilter(
+        new ClassFilter(RncDocument.class),
+        new MyRncNamespaceFilter(XmlUtil.HTML_URI, XmlUtil.XHTML_URI)),
+      RelaxedHtmlFromRngNSDescriptor.class
+    );
+  }
+
+  private static class MyRncNamespaceFilter extends XmlTextFilter {
+    MyRncNamespaceFilter(String... namespaces) {
+      super(namespaces);
+    }
+
+    public boolean isClassAcceptable(Class hintClass) {
+      return ReflectionCache.isAssignable(RncDocument.class, hintClass);
+    }
+
+    public boolean isAcceptable(Object element, PsiElement context) {
+      if (!(element instanceof RncDocument)) {
+        return false;
+      }
+
+      final PsiFile file = ((RncDocument)element).getContainingFile();
+      String namespace = null;
+      if (file instanceof RncFile) {
+        for (RncDecl decl : ((RncFile)file).getDeclarations()) {
+          if (decl instanceof RncNsDecl) {
+            namespace = decl.getDeclaredNamespace();
+            break;
+          }
+        }
+      }
+
+      if (namespace != null) {
+        for (String aMyValue : myValue) {
+          if (aMyValue.equals(namespace)) return true;
+        }
+      }
+      return false;
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/ApplicationLoader.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/ApplicationLoader.java
new file mode 100644
index 0000000..8b812f3
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/ApplicationLoader.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.javaee.ResourceRegistrar;
+import com.intellij.javaee.StandardResourceProvider;
+import com.intellij.openapi.actionSystem.ActionManager;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.components.ApplicationComponent;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.filters.AndFilter;
+import com.intellij.psi.filters.ClassFilter;
+import com.intellij.psi.filters.ElementFilter;
+import com.intellij.psi.filters.position.NamespaceFilter;
+import com.intellij.psi.meta.MetaDataRegistrar;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomManager;
+import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument;
+import org.intellij.plugins.relaxNG.inspections.RngDomInspection;
+import org.intellij.plugins.relaxNG.inspections.UnusedDefineInspection;
+import org.intellij.plugins.relaxNG.model.descriptors.RngNsDescriptor;
+import org.intellij.plugins.relaxNG.validation.ValidateAction;
+import org.intellij.plugins.relaxNG.xml.dom.RngDefine;
+import org.intellij.plugins.relaxNG.xml.dom.impl.RngDefineMetaData;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 18.07.2007
+ */
+public class ApplicationLoader implements ApplicationComponent {
+  private static final String RNG_EXT = "rng";
+  private static final String VALIDATE_XML = "ValidateXml";
+  public static final String RNG_NAMESPACE = "http://relaxng.org/ns/structure/1.0";
+
+  @NonNls
+  @NotNull
+  public String getComponentName() {
+    return "Relax-NG";
+  }
+
+  public void initComponent() {
+    registerMetaData();
+
+    installValidateXmlAction();
+  }
+
+  private static void installValidateXmlAction() {
+    final ActionManager mgr = ActionManager.getInstance();
+    final AnAction validateAction = mgr.getAction(VALIDATE_XML);
+    mgr.unregisterAction(VALIDATE_XML);
+    mgr.registerAction(VALIDATE_XML, new ValidateAction(validateAction));
+  }
+
+  private static void registerMetaData() {
+    final MetaDataRegistrar registrar = MetaDataRegistrar.getInstance();
+    registrar.registerMetaData(
+            new AndFilter(
+                    new NamespaceFilter(RNG_NAMESPACE),
+                    new ClassFilter(XmlDocument.class)
+            ),
+            RngNsDescriptor.class);
+
+    registrar.registerMetaData(
+            new ClassFilter(RncDocument.class),
+            RngNsDescriptor.class);
+
+    registrar.registerMetaData(new ElementFilter() {
+      public boolean isAcceptable(Object element, PsiElement context) {
+        if (element instanceof XmlTag) {
+          final XmlTag tag = (XmlTag)element;
+          final DomElement domElement = DomManager.getDomManager(tag.getProject()).getDomElement(tag);
+          return domElement instanceof RngDefine;
+        }
+        return false;
+      }
+
+      public boolean isClassAcceptable(Class hintClass) {
+        return XmlTag.class.isAssignableFrom(hintClass);
+      }
+    }, RngDefineMetaData.class);
+  }
+
+  public void disposeComponent() {
+  }
+
+  public static Class[] getInspectionClasses() {
+    return new Class[]{
+            RngDomInspection.class,
+            UnusedDefineInspection.class
+    };
+  }
+
+  public static class ResourceProvider implements StandardResourceProvider {
+    public void registerResources(ResourceRegistrar registrar) {
+      registrar.addStdResource(RNG_NAMESPACE, "/resources/relaxng.rng", getClass());
+      registrar.addIgnoredResource("http://relaxng.org/ns/compatibility/annotations/1.0");
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/GotoSymbolContributor.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/GotoSymbolContributor.java
new file mode 100644
index 0000000..48e001b
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/GotoSymbolContributor.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.navigation.ChooseByNameContributor;
+import com.intellij.navigation.NavigationItem;
+import com.intellij.openapi.project.Project;
+import com.intellij.util.ArrayUtil;
+import org.intellij.plugins.relaxNG.model.resolve.RelaxSymbolIndex;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Collection;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 24.10.2007
+*/
+public class GotoSymbolContributor implements ChooseByNameContributor {
+
+  @NotNull
+  public NavigationItem[] getItemsByName(String name, String pattern, Project project, boolean includeNonProjectItems) {
+    return RelaxSymbolIndex.getSymbolsByName(name, project, includeNonProjectItems);
+  }
+
+  @NotNull
+  public String[] getNames(Project project, boolean includeNonProjectItems) {
+    final Collection<String> names = RelaxSymbolIndex.getSymbolNames(project);
+    return ArrayUtil.toStringArray(names);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/RelaxNGReferenceContributor.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/RelaxNGReferenceContributor.java
new file mode 100644
index 0000000..08b281c
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/RelaxNGReferenceContributor.java
@@ -0,0 +1,39 @@
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.patterns.StringPattern;
+import com.intellij.patterns.XmlNamedElementPattern;
+import com.intellij.psi.PsiReferenceContributor;
+import com.intellij.psi.PsiReferenceRegistrar;
+import com.intellij.psi.filters.position.PatternFilter;
+import com.intellij.xml.util.XmlUtil;
+import org.intellij.plugins.relaxNG.references.PrefixReferenceProvider;
+
+import static com.intellij.patterns.StandardPatterns.string;
+import static com.intellij.patterns.XmlPatterns.xmlAttribute;
+import static com.intellij.patterns.XmlPatterns.xmlAttributeValue;
+import static com.intellij.patterns.XmlPatterns.xmlTag;
+
+/**
+ * @author peter
+ */
+public class RelaxNGReferenceContributor extends PsiReferenceContributor {
+  private static final XmlNamedElementPattern RNG_TAG_PATTERN = xmlTag().withNamespace(string().equalTo(ApplicationLoader.RNG_NAMESPACE));
+
+  private static final XmlNamedElementPattern.XmlAttributePattern NAME_ATTR_PATTERN = xmlAttribute("name");
+  private static final StringPattern ELEMENT_OR_ATTRIBUTE_PATTERN = string().oneOf("element", "attribute");
+
+  private static final XmlNamedElementPattern.XmlAttributePattern NAME_PATTERN = NAME_ATTR_PATTERN.withParent(
+    RNG_TAG_PATTERN.withLocalName(ELEMENT_OR_ATTRIBUTE_PATTERN));
+
+  @Override
+  public void registerReferenceProviders(PsiReferenceRegistrar registrar) {
+    XmlUtil.registerXmlAttributeValueReferenceProvider(registrar, new String[]{
+      "name"
+    }, new PatternFilter(xmlAttributeValue().withParent(NAME_PATTERN)), true, new PrefixReferenceProvider());
+
+//    final XmlAttributeValuePattern id = xmlAttributeValue().withParent(xmlAttribute()).with(IdRefProvider.HAS_ID_REF_TYPE);
+//    final XmlAttributeValuePattern idref = xmlAttributeValue().withParent(xmlAttribute()).with(IdRefProvider.HAS_ID_TYPE);
+//    registry.registerXmlAttributeValueReferenceProvider(null, new PatternFilter(or(id, idref)), false, new IdRefProvider());
+
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/RncFileReferenceManipulator.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/RncFileReferenceManipulator.java
new file mode 100644
index 0000000..bc17a9d
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/RncFileReferenceManipulator.java
@@ -0,0 +1,35 @@
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.AbstractElementManipulator;
+import com.intellij.psi.PsiManager;
+import com.intellij.util.IncorrectOperationException;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.intellij.plugins.relaxNG.compact.psi.RncFileReference;
+import org.intellij.plugins.relaxNG.compact.psi.util.RenameUtil;
+
+/**
+* @author peter
+*/
+public class RncFileReferenceManipulator extends AbstractElementManipulator<RncFileReference> {
+  public RncFileReference handleContentChange(RncFileReference element, TextRange range, String newContent) throws
+                                                                                                            IncorrectOperationException {
+    final ASTNode node = element.getNode();
+    assert node != null;
+
+    final ASTNode literal = node.findChildByType(RncTokenTypes.LITERAL);
+    if (literal != null) {
+      assert range.equals(element.getReferenceRange());
+      final PsiManager manager = element.getManager();
+      final ASTNode newChild = RenameUtil.createLiteralNode(manager, newContent);
+      literal.getTreeParent().replaceChild(literal, newChild);
+    }
+    return element;
+  }
+
+  @Override
+  public TextRange getRangeInElement(RncFileReference element) {
+    return element.getReferenceRange();
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/RngDocumentationProvider.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/RngDocumentationProvider.java
new file mode 100644
index 0000000..ac1bd0c
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/RngDocumentationProvider.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.lang.documentation.DocumentationProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import org.intellij.plugins.relaxNG.model.descriptors.CompositeDescriptor;
+import org.intellij.plugins.relaxNG.model.descriptors.RngElementDescriptor;
+import org.intellij.plugins.relaxNG.model.descriptors.RngXmlAttributeDescriptor;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+import org.kohsuke.rngom.digested.DElementPattern;
+
+import java.util.Collection;
+import java.util.List;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 19.11.2007
+*/
+public class RngDocumentationProvider implements DocumentationProvider {
+  @NonNls
+  private static final String COMPATIBILITY_ANNOTATIONS_1_0 = "http://relaxng.org/ns/compatibility/annotations/1.0";
+
+  @Nullable
+  public String generateDoc(PsiElement element, PsiElement originalElement) {
+    final XmlElement c = PsiTreeUtil.getParentOfType(originalElement, XmlTag.class, XmlAttribute.class);
+    if (c instanceof XmlTag) {
+      final XmlTag xmlElement = (XmlTag)c;
+      final XmlElementDescriptor descriptor = xmlElement.getDescriptor();
+      if (descriptor instanceof CompositeDescriptor) {
+        final StringBuilder sb = new StringBuilder();
+        final CompositeDescriptor d = (CompositeDescriptor)descriptor;
+        final DElementPattern[] patterns = d.getElementPatterns();
+        for (DElementPattern pattern : patterns) {
+          final PsiElement psiElement = d.getDeclaration(pattern.getLocation());
+          if (psiElement instanceof XmlTag) {
+            if (sb.length() > 0) {
+              sb.append("<hr>");
+            }
+            sb.append(getDocumentationFromTag((XmlTag)psiElement, xmlElement.getLocalName(), "Element"));
+          }
+        }
+        return makeDocumentation(sb);
+      } else if (descriptor instanceof RngElementDescriptor) {
+        final RngElementDescriptor d = (RngElementDescriptor)descriptor;
+        final PsiElement declaration = d.getDeclaration();
+        if (declaration instanceof XmlTag) {
+          return makeDocumentation(getDocumentationFromTag((XmlTag)declaration, xmlElement.getLocalName(), "Element"));
+        }
+      }
+    } else if (c instanceof XmlAttribute) {
+      final XmlAttribute attribute = (XmlAttribute)c;
+      final XmlAttributeDescriptor descriptor = attribute.getDescriptor();
+      if (descriptor instanceof RngXmlAttributeDescriptor) {
+        final RngXmlAttributeDescriptor d = (RngXmlAttributeDescriptor)descriptor;
+        final StringBuilder sb = new StringBuilder();
+        final Collection<PsiElement> declaration = d.getDeclarations();
+        for (PsiElement psiElement : declaration) {
+          if (psiElement instanceof XmlTag) {
+            if (sb.length() > 0) {
+              sb.append("<hr>");
+            }
+            sb.append(getDocumentationFromTag((XmlTag)element, d.getName(), "Attribute"));
+          }
+        }
+      }
+    } else if (element instanceof XmlTag) {
+      return makeDocumentation(getDocumentationFromTag((XmlTag)element, ((XmlTag)element).getLocalName(), "Element"));
+    }
+    return null;
+  }
+
+  private static String makeDocumentation(StringBuilder sb) {
+    if (sb == null) return null;
+    if (!sb.toString().startsWith("<html>")) {
+      sb.insert(0, "<html>");
+      sb.append("</html>");
+    }
+    return sb.toString().replaceAll("\n", "<br>");
+  }
+
+  private static StringBuilder getDocumentationFromTag(XmlTag tag, String localName, String kind) {
+    if (tag.getNamespace().equals(ApplicationLoader.RNG_NAMESPACE)) {
+      final StringBuilder sb = new StringBuilder();
+      sb.append(kind).append(": <b>").append(localName).append("</b><br>");
+      final XmlTag[] docTags = tag.findSubTags("documentation", COMPATIBILITY_ANNOTATIONS_1_0);
+      for (XmlTag docTag : docTags) {
+        sb.append(docTag.getValue().getTrimmedText());
+        sb.append("\n");
+      }
+      final XmlTag nextTag = PsiTreeUtil.getNextSiblingOfType(tag, XmlTag.class);
+      if (nextTag != null) {
+        if ("documentation".equals(nextTag.getLocalName()) && COMPATIBILITY_ANNOTATIONS_1_0.equals(nextTag.getNamespace())) {
+          sb.append(nextTag.getValue().getTrimmedText());
+        }
+      }
+      return sb;
+    }
+    return null;
+  }
+
+  @Nullable
+  public PsiElement getDocumentationElementForLink(PsiManager psiManager, String link, PsiElement context) {
+    return null;
+  }
+
+  @Nullable
+  public PsiElement getDocumentationElementForLookupItem(PsiManager psiManager, Object object, PsiElement element) {
+    return null;
+  }
+
+  @Nullable
+  public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
+    return null;
+  }
+
+  public List<String> getUrlFor(PsiElement element, PsiElement originalElement) {
+    return null;
+  }
+
+  public int hashCode() {
+    return 0;   // CompositeDocumentationProvider uses a HashSet that doesn't preserve order. We want to be the first one.
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/RngDomFileDescription.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/RngDomFileDescription.java
new file mode 100644
index 0000000..7e1e2a2
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/RngDomFileDescription.java
@@ -0,0 +1,54 @@
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.util.xml.DomFileDescription;
+import com.intellij.util.xml.highlighting.DomElementsAnnotator;
+import org.intellij.plugins.relaxNG.model.annotation.ModelAnnotator;
+import org.intellij.plugins.relaxNG.xml.dom.*;
+
+/**
+* @author peter
+*/
+public class RngDomFileDescription<T> extends DomFileDescription<T> {
+  public RngDomFileDescription(Class<T> elementClass, String rootTagName) {
+    super(elementClass, rootTagName);
+    registerNamespacePolicy("RELAX-NG", ApplicationLoader.RNG_NAMESPACE);
+  }
+
+  public boolean isAutomaticHighlightingEnabled() {
+    return true;
+  }
+
+  public DomElementsAnnotator createAnnotator() {
+    return new ModelAnnotator();
+  }
+
+  public static class RngGrammarDescription extends RngDomFileDescription<RngGrammar> {
+    public RngGrammarDescription() {
+      super(RngGrammar.class, "grammar");
+    }
+  }
+
+  public static class RngElementDescription extends RngDomFileDescription<RngElement> {
+    public RngElementDescription() {
+      super(RngElement.class, "element");
+    }
+  }
+
+  public static class RngChoiceDescription extends RngDomFileDescription<RngChoice> {
+    public RngChoiceDescription() {
+      super(RngChoice.class, "choice");
+    }
+  }
+
+  public static class RngGroupDescription extends RngDomFileDescription<RngGroup> {
+    public RngGroupDescription() {
+      super(RngGroup.class, "group");
+    }
+  }
+
+  public static class RngInterleaveDescription extends RngDomFileDescription<RngInterleave> {
+    public RngInterleaveDescription() {
+      super(RngInterleave.class, "interleave");
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/ReferenceAnnotator.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/ReferenceAnnotator.java
new file mode 100644
index 0000000..09c0613
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/ReferenceAnnotator.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact;
+
+import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
+import com.intellij.codeInsight.daemon.QuickFixProvider;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.lang.annotation.AnnotationHolder;
+import com.intellij.lang.annotation.Annotator;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiPolyVariantReference;
+import com.intellij.psi.PsiReference;
+import org.intellij.plugins.relaxNG.compact.psi.*;
+import org.jetbrains.annotations.NotNull;
+
+import java.text.MessageFormat;
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 10.08.2007
+*/
+public class ReferenceAnnotator extends RncElementVisitor implements Annotator {
+  private AnnotationHolder myHolder;
+
+  public synchronized void annotate(@NotNull PsiElement psiElement, @NotNull AnnotationHolder holder) {
+    myHolder = holder;
+    try {
+      psiElement.accept(this);
+    } finally {
+      myHolder = null;
+    }
+  }
+
+  @Override
+  public void visitInclude(RncInclude include) {
+    checkReferences(include.getReferences());
+  }
+
+  @Override
+  public void visitExternalRef(RncExternalRef ref) {
+    checkReferences(ref.getReferences());
+  }
+
+  @Override
+  public void visitRef(RncRef pattern) {
+    checkReferences(pattern.getReferences());
+  }
+
+  @Override
+  public void visitParentRef(RncParentRef pattern) {
+    checkReferences(pattern.getReferences());
+  }
+
+  @Override
+  public void visitName(RncName name) {
+    checkReferences(name.getReferences());
+  }
+
+  private void checkReferences(PsiReference[] references) {
+    for (PsiReference reference : references) {
+      if (!reference.isSoft()) {
+        if (reference.resolve() == null) {
+          if (reference instanceof PsiPolyVariantReference) {
+            final PsiPolyVariantReference pvr = (PsiPolyVariantReference)reference;
+            if (pvr.multiResolve(false).length == 0) {
+              addError(reference);
+            }
+          } else {
+            addError(reference);
+          }
+        }
+      }
+    }
+  }
+
+  private void addError(PsiReference reference) {
+    final TextRange rangeInElement = reference.getRangeInElement();
+    final TextRange range = TextRange.from(reference.getElement().getTextRange().getStartOffset()
+            + rangeInElement.getStartOffset(), rangeInElement.getLength());
+
+    final Annotation annotation;
+    if (reference instanceof EmptyResolveMessageProvider) {
+      final String s = ((EmptyResolveMessageProvider)reference).getUnresolvedMessagePattern();
+      annotation = myHolder.createErrorAnnotation(range, s != null ?
+              MessageFormat.format(s, reference.getCanonicalText())
+              : "Cannot resolve symbol");
+    } else {
+      annotation = myHolder.createErrorAnnotation(range, "Cannot resolve symbol");
+    }
+    annotation.setHighlightType(ProblemHighlightType.LIKE_UNKNOWN_SYMBOL);
+
+    if (reference instanceof QuickFixProvider) {
+      final HighlightInfo info = new HighlightInfo(HighlightInfoType.WRONG_REF, annotation.getStartOffset(), annotation.getEndOffset(), "", null);
+      ((QuickFixProvider)reference).registerQuickfix(info, reference);
+
+      final List<Pair<HighlightInfo.IntentionActionDescriptor,TextRange>> ranges = info.quickFixActionRanges;
+      if (ranges != null) {
+        for (Pair<HighlightInfo.IntentionActionDescriptor, TextRange> pair : ranges) {
+          annotation.registerFix(pair.first.getAction(), pair.second);
+        }
+      }
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncCompletionData.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncCompletionData.java
new file mode 100644
index 0000000..c837393
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncCompletionData.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact;
+
+import com.intellij.codeInsight.TailType;
+import com.intellij.codeInsight.completion.CompletionContext;
+import com.intellij.codeInsight.completion.CompletionData;
+import com.intellij.codeInsight.completion.CompletionVariant;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupElementBuilder;
+import com.intellij.codeInsight.lookup.TailTypeDecorator;
+import com.intellij.patterns.ElementPattern;
+import com.intellij.patterns.PsiElementPattern;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.filters.AndFilter;
+import com.intellij.psi.filters.ContextGetter;
+import com.intellij.psi.filters.ElementFilter;
+import com.intellij.psi.filters.position.PatternFilter;
+import com.intellij.psi.impl.source.tree.LeafPsiElement;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import org.intellij.plugins.relaxNG.compact.psi.RncDecl;
+import org.intellij.plugins.relaxNG.compact.psi.RncDefine;
+import org.intellij.plugins.relaxNG.compact.psi.RncElement;
+import org.intellij.plugins.relaxNG.compact.psi.RncGrammar;
+import org.intellij.plugins.relaxNG.compact.psi.util.EscapeUtil;
+
+import static com.intellij.patterns.PlatformPatterns.psiElement;
+import static com.intellij.patterns.StandardPatterns.*;
+
+public class RncCompletionData extends CompletionData {
+
+  public RncCompletionData() {
+    declareFinalScope(RncElement.class);
+
+    final CompletionVariant variant = new CompletionVariant(new AndFilter(
+            new ElementFilter() {
+              public boolean isAcceptable(Object element, PsiElement context) {
+                return true;
+              }
+
+              public boolean isClassAcceptable(Class hintClass) {
+                return PsiElement.class.isAssignableFrom(hintClass);
+              }
+            },
+            new PatternFilter(or(
+                    psiElement().afterLeaf(psiElement(RncTokenTypes.KEYWORD_DEFAULT)),
+                    not(
+                            or(
+                                    psiElement().inside(psiElement(RncTokenTypes.LITERAL)),
+                                    psiElement().afterLeaf(psiElement().withElementType(RncTokenTypes.KEYWORDS))
+                            )
+                    )
+            ))
+    ));
+
+    variant.includeScopeClass(LeafPsiElement.class, true);
+
+    variant.addCompletion(new KeywordGetter());
+
+    registerVariant(variant);
+  }
+
+  private static class KeywordGetter implements ContextGetter {
+    private static final ElementPattern TOP_LEVEL =
+            not(psiElement().inside(psiElement(RncGrammar.class)
+                    .inside(true, psiElement(RncGrammar.class))));
+
+    private static final PsiElementPattern DECL_PATTERN =
+            psiElement().inside(psiElement(RncDecl.class));
+
+    private static final PsiElementPattern DEFAULT_PATTERN =
+            DECL_PATTERN.afterLeaf(psiElement().withText("default"));
+
+    private static final ElementPattern DEFINE_PATTERN =
+            and(psiElement().withParent(RncDefine.class), psiElement().afterLeafSkipping(psiElement(PsiWhiteSpace.class), psiElement().withText("=")));
+
+    private static final String[] DECL_KEYWORDS = new String[]{ "default", "namespace", "datatypes" };
+    private static final String[] GRAMMAR_CONTENT_KEYWORDS = new String[]{ "include", "div", "start" };
+    private static final String[] PATTERN_KEYWORDS = new String[]{ "attribute", "element", "grammar",
+            "notAllowed", "text", "empty", "external", "parent", "list", "mixed" };
+
+    public Object[] get(PsiElement context, CompletionContext completionContext) {
+      return ContainerUtil.map2Array(doGetKeywords(context), LookupElement.class, new Function<String, LookupElement>() {
+        public LookupElement fun(String s) {
+          return TailTypeDecorator.withTail(LookupElementBuilder.create(s).bold(), TailType.SPACE);
+        }
+      });
+    }
+
+    private String[] doGetKeywords(PsiElement context) {
+      final PsiElement next = PsiTreeUtil.skipSiblingsForward(context, PsiWhiteSpace.class);
+      if (next != null && EscapeUtil.unescapeText(next).equals("=")) {
+          return new String[]{ "start" };
+        }
+
+      if (DEFAULT_PATTERN.accepts(context)) {
+        return new String[]{ "namespace" };
+      } else if (DECL_PATTERN.accepts(context)) {
+        return ArrayUtil.EMPTY_STRING_ARRAY;
+      } else if (context.getParent() instanceof RncDefine && context.getParent().getFirstChild() == context) {
+        if (DEFINE_PATTERN.accepts(context)) {
+          return ArrayUtil.EMPTY_STRING_ARRAY;
+        }
+        if (TOP_LEVEL.accepts(context)) {
+          if (!afterPattern(context)) {
+            return ArrayUtil.mergeArrays(DECL_KEYWORDS, ArrayUtil.mergeArrays(GRAMMAR_CONTENT_KEYWORDS, PATTERN_KEYWORDS));
+          }
+        }
+        return GRAMMAR_CONTENT_KEYWORDS;
+      }
+      return PATTERN_KEYWORDS;
+    }
+
+    private boolean afterPattern(PsiElement context) {
+      // TODO: recognize all patterns
+      return PsiTreeUtil.getPrevSiblingOfType(context.getParent(), RncDefine.class) != null;
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncElementType.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncElementType.java
new file mode 100644
index 0000000..a40fa6e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncElementType.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.util.NotNullFunction;
+import org.intellij.plugins.relaxNG.compact.psi.RncElement;
+import org.jetbrains.annotations.NotNull;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
+
+public class RncElementType extends IElementType {
+  public RncElementType(String name) {
+    super(name, RngCompactLanguage.INSTANCE);
+  }
+}
+
+class RncElementTypeEx<C extends RncElement> extends RncElementType implements NotNullFunction<ASTNode, C> {
+  private final Constructor<? extends C> myConstructor;
+
+  RncElementTypeEx(String name, Class<? extends C> clazz) {
+    super(name);
+    assert !clazz.isInterface() && !Modifier.isAbstract(clazz.getModifiers());
+    try {
+      myConstructor = clazz.getConstructor(ASTNode.class);
+    } catch (NoSuchMethodException e) {
+      throw new Error(e);
+    }
+  }
+
+  @NotNull
+  public final C fun(ASTNode node) {
+    try {
+      return myConstructor.newInstance(node);
+    } catch (Exception e) {
+      throw new Error(e);
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncElementTypes.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncElementTypes.java
new file mode 100644
index 0000000..7454d69
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncElementTypes.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact;
+
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.IFileElementType;
+import org.intellij.plugins.relaxNG.compact.psi.*;
+import org.intellij.plugins.relaxNG.compact.psi.impl.*;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 01.08.2007
+*/
+public class RncElementTypes {
+
+  public static final IElementType DOCUMENT = new RncElementTypeEx<RncDocument>("DOCUMENT", RncDocument.class);
+
+  public static final IElementType NS_DECL = new RncElementTypeEx<RncNsDecl>("NS_DECL", RncNsDeclImpl.class);
+  public static final IElementType DATATYPES_DECL = new RncElementTypeEx<RncDecl>("DATATYPES_DECL", RncDeclImpl.class);
+
+  public static final IElementType START = new RncElementType("START");
+  public static final IElementType DIV = new RncElementTypeEx<RncDiv>("DIV", RncDivImpl.class);
+  public static final IElementType INCLUDE = new RncElementTypeEx<RncInclude>("INCLUDE", RncIncludeImpl.class);
+
+  public static final IElementType NAME_CLASS = new RncElementType("NAME_CLASS");
+  public static final IElementType NAME_CLASS_CHOICE = new RncElementType("NAME_CLASS_CHOICE");
+  public static final IElementType EXCEPT_NAME_CLASS = new RncElementType("EXCEPT_NAME_CLASS");
+
+  public static final IElementType DEFINE = new RncElementTypeEx<RncDefine>("DEFINE", RncDefineImpl.class);
+  public static final IElementType PATTERN = new RncElementType("PATTERN");
+  public static final IElementType GROUP_PATTERN = new RncElementType("GROUP_PATTERN");
+  public static final IElementType GRAMMAR_PATTERN = new RncElementTypeEx<RncGrammar>("GRAMMAR_PATTERN", RncGrammarImpl.class);
+  public static final IElementType EMPTY_PATTERN = new RncElementType("EMPTY_PATTERN");
+  public static final IElementType TEXT_PATTERN = new RncElementType("TEXT_PATTERN");
+  public static final IElementType NOT_ALLOWED_PATTERN = new RncElementType("NOT_ALLOWED_PATTERN");
+  public static final IElementType EXTERNAL_REF = new RncElementTypeEx<RncExternalRef>("EXTERNAL_REF", RncExternalRefImpl.class);
+  public static final IElementType PARENT_REF = new RncElementTypeEx<RncParentRef>("PARENT_REF", RncParentRefImpl.class);
+  public static final IElementType REF_PATTERN = new RncElementTypeEx<RncRef>("REF_PATTERN", RncRefImpl.class);
+  public static final IElementType LIST_PATTERN = new RncElementType("LIST_PATTERN");
+  public static final IElementType MIXED_PATTERN = new RncElementType("MIXED_PATTERN");
+
+  public static final IElementType DATATYPE_PATTERN = new RncElementType("DATATYPE_PATTERN");
+  public static final IElementType PARAM = new RncElementType("PARAM");
+
+  public static final IElementType SEQUENCE = new RncElementType("SEQUENCE");
+  public static final IElementType INTERLEAVE = new RncElementType("INTERLEAVE");
+  public static final IElementType CHOICE = new RncElementType("CHOICE");
+  public static final IElementType OPTIONAL = new RncElementType("OPTIONAL");
+  public static final IElementType ZERO_OR_MORE = new RncElementType("ZERO_OR_MORE");
+  public static final IElementType ONE_OR_MORE = new RncElementType("ONE_OR_MORE");
+
+  public static final IElementType NAME = new RncElementTypeEx<RncName>("NAME", RncNameImpl.class);
+
+  public static final IElementType ANNOTATION = new RncElementTypeEx<RncAnnotation>("ANNOTATION", RncAnnotationImpl.class);
+  public static final IElementType ANNOTATION_ELEMENT = new RncElementTypeEx<RncAnnotation>("ANNOTATION_ELEMENT", RncAnnotationImpl.class);
+  public static final IElementType FORWARD_ANNOTATION = new RncElementTypeEx<RncAnnotation>("FORWARD_ANNOTATION", RncAnnotationImpl.class);
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncFileType.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncFileType.java
new file mode 100644
index 0000000..1b5906e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncFileType.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.FileTypeConsumer;
+import com.intellij.openapi.fileTypes.FileTypeFactory;
+import com.intellij.openapi.fileTypes.LanguageFileType;
+import com.intellij.util.PairConsumer;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 01.08.2007
+*/
+public class RncFileType extends LanguageFileType  {
+  public static final String RNC_EXT = "rnc";
+
+  private static FileType INSTANCE;
+
+  private RncFileType() {
+    super(RngCompactLanguage.INSTANCE);
+  }
+
+  @NotNull
+  @NonNls
+  public String getName() {
+    return "RNG Compact";
+  }
+
+  @NotNull
+  public String getDescription() {
+    return "RELAX NG Compact Syntax";
+  }
+
+  @NotNull
+  @NonNls
+  public String getDefaultExtension() {
+    return "rnc";
+  }
+
+  @Nullable
+  public Icon getIcon() {
+    return AllIcons.FileTypes.Text;
+  }
+
+  public static synchronized FileType getInstance() {
+    if (INSTANCE == null) {
+      INSTANCE = new RncFileType();
+    }
+    return INSTANCE;
+  }
+
+  public static class Factory extends FileTypeFactory {
+    public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
+      fileTypeConsumer.consume(getInstance(), RNC_EXT);
+    }
+
+    public void createFileTypes(@NotNull PairConsumer<FileType, String> consumer) {
+      consumer.consume(getInstance(), RNC_EXT);
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncHighlighter.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncHighlighter.java
new file mode 100644
index 0000000..2b53752
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncHighlighter.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact;
+
+import com.intellij.lexer.Lexer;
+import com.intellij.openapi.editor.HighlighterColors;
+import com.intellij.openapi.editor.SyntaxHighlighterColors;
+import com.intellij.openapi.editor.colors.CodeInsightColors;
+import com.intellij.openapi.editor.colors.TextAttributesKey;
+import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
+import com.intellij.psi.tree.IElementType;
+import org.intellij.plugins.relaxNG.compact.lexer.CompactSyntaxLexerAdapter;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 04.08.2007
+ */
+public class RncHighlighter extends SyntaxHighlighterBase {
+  @NotNull
+  public Lexer getHighlightingLexer() {
+    return new CompactSyntaxLexerAdapter();
+  }
+
+  private static final Map<IElementType, TextAttributesKey> ourMap1;
+
+  static {
+    ourMap1 = new HashMap<IElementType, TextAttributesKey>();
+
+    fillMap(ourMap1, RncTokenTypes.KEYWORDS, SyntaxHighlighterColors.KEYWORD);
+    fillMap(ourMap1, RncTokenTypes.OPERATORS, SyntaxHighlighterColors.OPERATION_SIGN);
+
+    fillMap(ourMap1, RncTokenTypes.STRINGS, SyntaxHighlighterColors.STRING);
+
+    ourMap1.put(RncTokenTypes.LBRACE, SyntaxHighlighterColors.BRACES);
+    ourMap1.put(RncTokenTypes.RBRACE, SyntaxHighlighterColors.BRACES);
+
+    ourMap1.put(RncTokenTypes.LBRACKET, SyntaxHighlighterColors.BRACKETS);
+    ourMap1.put(RncTokenTypes.RBRACKET, SyntaxHighlighterColors.BRACKETS);
+
+    ourMap1.put(RncTokenTypes.LPAREN, SyntaxHighlighterColors.PARENTHS);
+    ourMap1.put(RncTokenTypes.RPAREN, SyntaxHighlighterColors.PARENTHS);
+
+    ourMap1.put(RncTokenTypes.COMMA, SyntaxHighlighterColors.COMMA);
+
+    fillMap(ourMap1, RncTokenTypes.DOC_TOKENS, SyntaxHighlighterColors.DOC_COMMENT);
+    fillMap(ourMap1, RncTokenTypes.COMMENTS, SyntaxHighlighterColors.LINE_COMMENT);
+
+    fillMap(ourMap1, RncTokenTypes.IDENTIFIERS, CodeInsightColors.LOCAL_VARIABLE_ATTRIBUTES);
+
+    ourMap1.put(RncTokenTypes.ILLEGAL_CHAR, HighlighterColors.BAD_CHARACTER);
+  }
+
+  @NotNull
+  public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {
+    return pack(ourMap1.get(tokenType));
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncParserDefinition.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncParserDefinition.java
new file mode 100644
index 0000000..431b40e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncParserDefinition.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.ParserDefinition;
+import com.intellij.lang.PsiParser;
+import com.intellij.lexer.Lexer;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.TokenType;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.IFileElementType;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.util.NotNullFunction;
+import org.intellij.plugins.relaxNG.compact.lexer.CompactSyntaxLexerAdapter;
+import org.intellij.plugins.relaxNG.compact.parser.RncParser;
+import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
+import org.intellij.plugins.relaxNG.compact.psi.impl.RncElementImpl;
+import org.intellij.plugins.relaxNG.compact.psi.impl.RncFileImpl;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 10.08.2007
+ */
+public class RncParserDefinition implements ParserDefinition {
+  public static final IFileElementType FILE_ELEMENT_TYPE = new IFileElementType(RngCompactLanguage.INSTANCE);
+  private static final TokenSet myCommentTypes = TokenSet.orSet(RncTokenTypes.COMMENTS, RncTokenTypes.DOC_TOKENS);
+
+  @NotNull
+  public Lexer createLexer(Project project) {
+    return new CompactSyntaxLexerAdapter();
+  }
+
+  public PsiParser createParser(Project project) {
+    return new RncParser();
+  }
+
+  public IFileElementType getFileNodeType() {
+    return FILE_ELEMENT_TYPE;
+  }
+
+  @NotNull
+  public TokenSet getWhitespaceTokens() {
+    return TokenSet.create(TokenType.WHITE_SPACE);
+  }
+
+  @NotNull
+  public TokenSet getCommentTokens() {
+    return myCommentTypes;
+  }
+
+  @NotNull
+  public TokenSet getStringLiteralElements() {
+    return TokenSet.create(RncTokenTypes.LITERAL);
+  }
+
+  @NotNull
+  @SuppressWarnings({ "unchecked" })
+  public PsiElement createElement(ASTNode node) {
+    final IElementType type = node.getElementType();
+
+    if (type instanceof NotNullFunction) {
+      return ((NotNullFunction<ASTNode, PsiElement>)type).fun(node);
+    }
+
+    return new MyRncElement(node);
+  }
+
+  public PsiFile createFile(FileViewProvider viewProvider) {
+    return new RncFileImpl(viewProvider);
+  }
+
+  public SpaceRequirements spaceExistanceTypeBetweenTokens(ASTNode left, ASTNode right) {
+    return SpaceRequirements.MAY;
+  }
+
+  private static class MyRncElement extends RncElementImpl {
+    public MyRncElement(ASTNode node) {
+      super(node);
+    }
+
+    public void accept(@NotNull RncElementVisitor visitor) {
+      visitor.visitElement(this);
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncTokenTypes.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncTokenTypes.java
new file mode 100644
index 0000000..2706ad1
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RncTokenTypes.java
@@ -0,0 +1,205 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact;
+
+import com.intellij.openapi.util.Ref;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.TokenSet;
+import gnu.trove.TIntObjectHashMap;
+import gnu.trove.TObjectProcedure;
+import org.jetbrains.annotations.NotNull;
+import org.kohsuke.rngom.parse.compact.CompactSyntaxConstants;
+
+import java.lang.reflect.Field;
+import java.util.Locale;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 04.08.2007
+ */
+public class RncTokenTypes {
+  private static final TIntObjectHashMap<IElementType> ourTokenTypes = new TIntObjectHashMap<IElementType>();
+
+  static {
+    assert RngCompactLanguage.INSTANCE != null;
+    try {
+      final Field[] fields = CompactSyntaxConstants.class.getFields();
+      for (Field field : fields) {
+        final String name = field.getName();
+        if (name.equals("DEFAULT")) break;
+
+        if (int.class.isAssignableFrom(field.getType())) {
+          Integer i = (Integer)field.get(null);
+          ourTokenTypes.put(i, new RncElementType(name));
+        }
+      }
+
+      final String[] tokens = CompactSyntaxConstants.tokenImage;
+      for (int i = 0; i < tokens.length; i++) {
+        String token = tokens[i];
+        if (token.matches("\"\\w*\"")) {
+          token = "KEYWORD_" + token.substring(1, token.length() - 1).toUpperCase(Locale.US);
+        } else if (token.matches("\".*\"")) {
+          token = token.substring(1, token.length() - 1);
+        }
+        if (ourTokenTypes.get(i) == null) {
+          ourTokenTypes.put(i, new RncElementType(token));
+        }
+      }
+    } catch (IllegalAccessException e) {
+      throw new Error(e);
+    }
+  }
+
+  @NotNull
+  public static IElementType get(int i) {
+    assert !ourTokenTypes.isEmpty();
+    final IElementType type = ourTokenTypes.get(i);
+    assert type != null : "Unknown token kind: " + i;
+    return type;
+  }
+
+  @NotNull
+  private static IElementType get(final String name) {
+    assert !ourTokenTypes.isEmpty();
+    final Ref<IElementType> ref = new Ref<IElementType>();
+    ourTokenTypes.forEachValue(new TObjectProcedure<IElementType>() {
+      public boolean execute(IElementType iElementType) {
+        if (iElementType.toString().equals(name)) {
+          ref.set(iElementType);
+          return false;
+        }
+        return true;
+      }
+    });
+    return ref.get();
+  }
+
+  private static final IElementType WS = get(CompactSyntaxConstants.WS);
+  public static final TokenSet WHITESPACE = TokenSet.create(WS);
+
+  public static final IElementType ILLEGAL_CHAR = get(CompactSyntaxConstants.ILLEGAL_CHAR);
+  
+  public static final IElementType LBRACE = get("{");
+  public static final IElementType RBRACE = get("}");
+  public static final IElementType LBRACKET = get("[");
+  public static final IElementType RBRACKET = get("]");
+  public static final IElementType LPAREN = get("(");
+  public static final IElementType RPAREN = get(")");
+
+  public static final IElementType GTGT = get(CompactSyntaxConstants.FANNOTATE);
+
+  public static final TokenSet BRACES = TokenSet.create(LBRACE, RBRACE);
+
+  public static final IElementType EQ = get("=");
+  public static final IElementType PLUS = get("+");
+  public static final IElementType MINUS = get("-");
+  public static final IElementType STAR = get("*");
+  public static final IElementType AND = get("&");
+  public static final IElementType PIPE = get("|");
+  public static final IElementType QUEST = get("?");
+
+  public static final IElementType PREFIXED_NAME = get(CompactSyntaxConstants.PREFIXED_NAME);
+  public static final IElementType PREFIXED_STAR = get(CompactSyntaxConstants.PREFIX_STAR);
+
+  public static final IElementType CHOICE_EQ = get("|=");
+  public static final IElementType INTERLEAVE_EQ = get("&=");
+
+  public static final IElementType COMMA = get(",");
+
+  public static final TokenSet BINARY_OPS = TokenSet.create(
+          COMMA, PIPE, AND
+  );
+
+  public static final TokenSet QUANTIFIER_OPS = TokenSet.create(
+          PLUS, STAR, QUEST
+  );
+
+  public static final IElementType DOC = get(CompactSyntaxConstants.DOCUMENTATION);
+  public static final TokenSet DOC_TOKENS = TokenSet.create(
+          DOC,
+          get(CompactSyntaxConstants.DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT),
+          get(CompactSyntaxConstants.DOCUMENTATION_CONTINUE)
+  );
+
+  public static final IElementType COMMENT = get(CompactSyntaxConstants.SINGLE_LINE_COMMENT);
+  public static final TokenSet COMMENTS = TokenSet.create(
+          COMMENT,
+          get(CompactSyntaxConstants.SINGLE_LINE_COMMENT_CONTINUE)
+  );
+
+  public static final IElementType ESCAPED_IDENTIFIER = get(CompactSyntaxConstants.ESCAPED_IDENTIFIER);
+  public static final TokenSet IDENTIFIERS = TokenSet.create(
+          get(CompactSyntaxConstants.IDENTIFIER),
+          ESCAPED_IDENTIFIER
+  );
+
+  public static final TokenSet OPERATORS = TokenSet.orSet(TokenSet.create(
+          CHOICE_EQ, INTERLEAVE_EQ), BINARY_OPS, QUANTIFIER_OPS);
+
+  public static final IElementType LITERAL = get(CompactSyntaxConstants.LITERAL);
+  public static final TokenSet STRINGS = TokenSet.create(LITERAL);
+
+  static final TokenSet READABLE_TEXT = TokenSet.orSet(
+          DOC_TOKENS, COMMENTS,
+          TokenSet.create(LITERAL));
+
+  public static final IElementType KEYWORD_ElEMENT = get("KEYWORD_ELEMENT");
+  public static final IElementType KEYWORD_ATTRIBUTE = get("KEYWORD_ATTRIBUTE");
+  public static final IElementType KEYWORD_NAMESPACE = get("KEYWORD_NAMESPACE");
+  public static final IElementType KEYWORD_LIST = get("KEYWORD_LIST");
+  public static final IElementType KEYWORD_MIXED = get("KEYWORD_MIXED");
+  public static final IElementType KEYWORD_EMPTY = get("KEYWORD_EMPTY");
+  public static final IElementType KEYWORD_GRAMMAR = get("KEYWORD_GRAMMAR");
+  public static final IElementType KEYWORD_TEXT = get("KEYWORD_TEXT");
+  public static final IElementType KEYWORD_PARENT = get("KEYWORD_PARENT");
+  public static final IElementType KEYWORD_EXTERNAL = get("KEYWORD_LIST");
+  public static final IElementType KEYWORD_NOT_ALLOWED = get("KEYWORD_NOTALLOWED");
+  public static final IElementType KEYWORD_START = get("KEYWORD_START");
+  public static final IElementType KEYWORD_INCLUDE = get("KEYWORD_INCLUDE");
+  public static final IElementType KEYWORD_DEFAULT = get("KEYWORD_DEFAULT");
+  public static final IElementType KEYWORD_INHERIT = get("KEYWORD_INHERIT");
+  public static final IElementType KEYWORD_STRING = get("KEYWORD_STRING");
+  public static final IElementType KEYWORD_TOKEN = get("KEYWORD_TOKEN");
+  public static final IElementType KEYWORD_DATATYPES = get("KEYWORD_DATATYPES");
+  public static final IElementType KEYWORD_DIV = get("KEYWORD_DIV");
+
+  public static final TokenSet KEYWORDS = TokenSet.create(
+          KEYWORD_ATTRIBUTE,
+          KEYWORD_DATATYPES,
+          KEYWORD_DEFAULT,
+          KEYWORD_DIV,
+          KEYWORD_ElEMENT,
+          KEYWORD_EMPTY,
+          KEYWORD_EXTERNAL,
+          KEYWORD_GRAMMAR,
+          KEYWORD_INCLUDE,
+          KEYWORD_INHERIT,
+          KEYWORD_LIST,
+          KEYWORD_MIXED,
+          KEYWORD_NAMESPACE,
+          KEYWORD_NOT_ALLOWED,
+          KEYWORD_PARENT,
+          KEYWORD_START,
+          KEYWORD_STRING,
+          KEYWORD_TEXT,
+          KEYWORD_TOKEN
+  );
+
+  public static final TokenSet IDENTIFIER_OR_KEYWORD = TokenSet.orSet(KEYWORDS, IDENTIFIERS);
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RngCompactLanguage.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RngCompactLanguage.java
new file mode 100644
index 0000000..09a756d
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/RngCompactLanguage.java
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact;
+
+import com.intellij.lang.BracePair;
+import com.intellij.lang.Commenter;
+import com.intellij.lang.Language;
+import com.intellij.lang.PairedBraceMatcher;
+import com.intellij.lang.documentation.DocumentationProvider;
+import com.intellij.lang.refactoring.NamesValidator;
+import com.intellij.openapi.fileTypes.SingleLazyInstanceSyntaxHighlighterFactory;
+import com.intellij.openapi.fileTypes.SyntaxHighlighter;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.*;
+import com.intellij.psi.tree.IElementType;
+import org.intellij.plugins.relaxNG.compact.psi.RncDefine;
+import org.intellij.plugins.relaxNG.compact.psi.RncElement;
+import org.intellij.plugins.relaxNG.compact.psi.util.EscapeUtil;
+import org.intellij.plugins.relaxNG.compact.psi.util.RenameUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 01.08.2007
+*/
+public class RngCompactLanguage extends Language {
+  public static final String ID = "RELAX-NG";
+
+  public static final RngCompactLanguage INSTANCE = new RngCompactLanguage();
+
+  private RngCompactLanguage() {
+    super(ID);
+  }
+
+  public static class MyCommenter implements Commenter {
+    @Nullable
+    public String getLineCommentPrefix() {
+      return "#";
+    }
+
+    @Nullable
+    public String getBlockCommentPrefix() {
+      return null;
+    }
+
+    @Nullable
+    public String getBlockCommentSuffix() {
+      return null;
+    }
+
+    public String getCommentedBlockCommentPrefix() {
+      return null;
+    }
+
+    public String getCommentedBlockCommentSuffix() {
+      return null;
+    }
+  }
+
+  public static class MyPairedBraceMatcher implements PairedBraceMatcher {
+    private BracePair[] myBracePairs;
+
+    public BracePair[] getPairs() {
+      if (myBracePairs == null) {
+        myBracePairs = new BracePair[]{
+                new BracePair(RncTokenTypes.LBRACE, RncTokenTypes.RBRACE, true),
+                new BracePair(RncTokenTypes.LPAREN, RncTokenTypes.RPAREN, false),
+                new BracePair(RncTokenTypes.LBRACKET, RncTokenTypes.RBRACKET, false),
+        };
+      }
+      return myBracePairs;
+    }
+
+    public boolean isPairedBracesAllowedBeforeType(@NotNull IElementType lbraceType, @Nullable IElementType contextType) {
+      return false;
+    }
+
+    public int getCodeConstructStart(PsiFile file, int openingBraceOffset) {
+      // TODO
+      return openingBraceOffset;
+    }
+  }
+
+  public static class MyNamesValidator implements NamesValidator {
+    public boolean isKeyword(String name, Project project) {
+      return RenameUtil.isKeyword(name);
+    }
+
+    public boolean isIdentifier(String name, Project project) {
+      return RenameUtil.isIdentifier(name);
+    }
+  }
+
+  public static class MyDocumentationProvider implements DocumentationProvider {
+    @Nullable
+    public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
+      return null;
+    }
+
+    public List<String> getUrlFor(PsiElement element, PsiElement originalElement) {
+      return null;
+    }
+
+    @Nullable
+    public String generateDoc(PsiElement element, PsiElement originalElement) {
+      if (element instanceof RncElement) {
+        PsiElement comment = element.getPrevSibling();
+        while (comment instanceof PsiWhiteSpace) {
+          comment = comment.getPrevSibling();
+        }
+        if (comment instanceof PsiComment) {
+          final StringBuilder sb = new StringBuilder();
+          do {
+            sb.insert(0, EscapeUtil.unescapeText(comment).replaceAll("\n?##?", "") + "<br>");
+            comment = comment.getPrevSibling();
+          } while (comment instanceof PsiComment);
+
+          if (element instanceof RncDefine) {
+            sb.insert(0, "Define: <b>" + ((RncDefine)element).getName() + "</b><br>");
+          }
+
+          return sb.toString();
+        }
+      }
+      return null;
+    }
+
+    @Nullable
+    public PsiElement getDocumentationElementForLookupItem(PsiManager psiManager, Object object, PsiElement element) {
+      return null;
+    }
+
+    @Nullable
+    public PsiElement getDocumentationElementForLink(PsiManager psiManager, String link, PsiElement context) {
+      return null;
+    }
+  }
+
+  public static class MySyntaxHighlighterFactory extends SingleLazyInstanceSyntaxHighlighterFactory {
+    @NotNull
+    protected SyntaxHighlighter createHighlighter() {
+      return new RncHighlighter();
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/folding/RncFoldingBuilder.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/folding/RncFoldingBuilder.java
new file mode 100644
index 0000000..94ddafe
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/folding/RncFoldingBuilder.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.folding;
+
+import com.intellij.codeInsight.folding.CodeFoldingSettings;
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.folding.FoldingBuilder;
+import com.intellij.lang.folding.FoldingDescriptor;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiWhiteSpace;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.TokenSet;
+import org.intellij.plugins.relaxNG.compact.RncElementTypes;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.intellij.plugins.relaxNG.compact.psi.RncAnnotation;
+import org.intellij.plugins.relaxNG.compact.psi.RncName;
+import org.intellij.plugins.relaxNG.compact.psi.util.EscapeUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 10.08.2007
+ */
+public class RncFoldingBuilder implements FoldingBuilder {
+  @NotNull
+  public FoldingDescriptor[] buildFoldRegions(@NotNull ASTNode node, @NotNull Document document) {
+
+    final ArrayList<FoldingDescriptor> regions = new ArrayList<FoldingDescriptor>();
+    process(node, document, regions);
+
+    return regions.size() > 0
+            ? regions.toArray(new FoldingDescriptor[regions.size()])
+            : FoldingDescriptor.EMPTY;
+  }
+
+  public String getPlaceholderText(@NotNull ASTNode node) {
+    final IElementType type = node.getElementType();
+    if (type == RncTokenTypes.LBRACE) {
+      return "{ ... }";
+    } else if (isCommentLike(type)) {
+      return "# ...";
+    } else if (isAnnotation(type)) {
+      final RncName element = ((RncAnnotation)node.getPsi()).getNameElement();
+      if (element != null) {
+        final ASTNode n = element.getNode();
+        assert n != null;
+        return EscapeUtil.unescapeText(n) + " [ ... ]";
+      }
+      return "[ ... ]";
+    } else {
+      return "...";
+    }
+  }
+
+  private static boolean isAnnotation(IElementType type) {
+    return RncElementTypes.ANNOTATION == type || RncElementTypes.ANNOTATION_ELEMENT == type || RncElementTypes.FORWARD_ANNOTATION == type;
+  }
+
+  private static boolean isCommentLike(IElementType type) {
+    return RncTokenTypes.COMMENTS.contains(type) || RncTokenTypes.DOC_TOKENS.contains(type);
+  }
+
+  public boolean isCollapsedByDefault(@NotNull ASTNode node) {
+    return isCommentLike(node.getElementType()) && CodeFoldingSettings.getInstance().COLLAPSE_DOC_COMMENTS;
+  }
+
+  private static void process(@Nullable ASTNode node, Document document, ArrayList<FoldingDescriptor> regions) {
+    if (node == null) {
+      return;
+    }
+
+    final ASTNode[] braces = node.getChildren(RncTokenTypes.BRACES);
+    if (braces.length == 2) {
+      final ASTNode lbrace = braces[0];
+      final ASTNode rbrace = braces[1];
+      if (shouldFold(lbrace, rbrace, document)) {
+        final TextRange range = new TextRange(lbrace.getStartOffset(), rbrace.getTextRange().getEndOffset());
+        regions.add(new FoldingDescriptor(lbrace, range));
+      }
+    } else if (isAnnotation(node.getElementType())) {
+      if (isOnDifferentLine(node.getFirstChildNode(), node.getLastChildNode(), document)) {
+        regions.add(new FoldingDescriptor(node, node.getTextRange()));
+      }
+    }
+
+    node = node.getFirstChildNode();
+    while (node != null) {
+      node = checkNodeAndSiblings(node, RncTokenTypes.DOC_TOKENS, regions, document);
+
+      node = checkNodeAndSiblings(node, RncTokenTypes.COMMENTS, regions, document);
+
+      process(node, document, regions);
+
+      if (node != null) {
+        node = node.getTreeNext();
+      }
+    }
+  }
+
+  @Nullable
+  private static ASTNode checkNodeAndSiblings(@Nullable ASTNode node, TokenSet tokens, ArrayList<FoldingDescriptor> regions, Document document) {
+    if (node != null && tokens.contains(node.getElementType())) {
+      final ASTNode start = node;
+      ASTNode end = start;
+
+      node = node.getTreeNext();
+      if (node != null) {
+        do {
+          end = node;
+          node = node.getTreeNext();
+        } while (node != null && tokens.contains(node.getElementType()));
+      }
+      if (end != start) {
+        while (end.getPsi() instanceof PsiWhiteSpace) {
+          end = end.getTreePrev();
+        }
+        if (isOnDifferentLine(start, end, document)) {
+          regions.add(new FoldingDescriptor(start, new TextRange(start.getStartOffset(), end.getTextRange().getEndOffset())));
+        }
+      }
+    }
+    return node;
+  }
+
+  private static boolean shouldFold(ASTNode first, ASTNode second, Document document) {
+    if (first.getElementType() != RncTokenTypes.LBRACE) {
+      return false;
+    } else if (second.getElementType() != RncTokenTypes.RBRACE) {
+      return false;
+    } else {
+      return isOnDifferentLine(first, second, document);
+    }
+  }
+
+  private static boolean isOnDifferentLine(ASTNode first, ASTNode second, Document document) {
+    return document.getLineNumber(first.getStartOffset()) != document.getLineNumber(second.getStartOffset());
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/formatting/RncBlock.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/formatting/RncBlock.java
new file mode 100644
index 0000000..5b466ed
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/formatting/RncBlock.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.formatting;
+
+import com.intellij.formatting.*;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import org.intellij.plugins.relaxNG.compact.RncElementTypes;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.intellij.plugins.relaxNG.compact.psi.RncDecl;
+import org.intellij.plugins.relaxNG.compact.psi.RncDefine;
+import org.intellij.plugins.relaxNG.compact.psi.RncFile;
+import org.intellij.plugins.relaxNG.compact.psi.RncGrammar;
+import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+class RncBlock implements Block {
+  private final ASTNode myNode;
+
+  public RncBlock(ASTNode element) {
+    myNode = element;
+  }
+
+  @NotNull
+  public TextRange getTextRange() {
+    return myNode.getTextRange();
+  }
+
+  @NotNull
+  public List<Block> getSubBlocks() {
+    final List<Block> list = new ArrayList<Block>();
+    ASTNode node = myNode.getFirstChildNode();
+    while (node != null) {
+      if (!RncTokenTypes.WHITESPACE.contains(node.getElementType()) && node.getTextLength() > 0) {
+        list.add(new RncBlock(node));
+      }
+      node = node.getTreeNext();
+    }
+    return list;
+  }
+
+  @Nullable
+  public Wrap getWrap() {
+    // TODO
+    return null;
+  }
+
+  @Nullable
+  public Indent getIndent() {
+    if (isTopLevel()) {
+      return Indent.getAbsoluteNoneIndent();
+    } else if (myNode.getTreeParent().getPsi() instanceof RncGrammar && !RncTokenTypes.BRACES.contains(myNode.getElementType())) {
+      // TODO: fix block psi
+      return Indent.getNormalIndent();
+    }
+    return null;
+  }
+
+  private boolean isTopLevel() {
+    final PsiElement parent = myNode.getTreeParent().getPsi();
+    return parent instanceof RncDocument ||
+            parent instanceof RncFile ||
+            parent instanceof RncGrammar && parent.getParent() instanceof RncDocument;
+  }
+
+  @Nullable
+  public Alignment getAlignment() {
+    // TODO
+    return null;
+  }
+
+  @Nullable
+  public Spacing getSpacing(Block child1, @NotNull Block child2) {
+    if (child1 == null) {
+      return null;
+    }
+    final ASTNode lnode = ((RncBlock)child1).myNode;
+    final PsiElement lpsi = lnode.getPsi();
+    final PsiElement rpsi = ((RncBlock)child2).myNode.getPsi();
+
+    if (lpsi instanceof RncDecl && rpsi instanceof RncDecl) {
+      return makeNewline();
+    }
+    if ((lpsi instanceof RncDecl || lpsi instanceof RncDefine ||
+         lnode.getElementType() == RncElementTypes.START) &&
+        (rpsi instanceof RncDefine || rpsi instanceof RncGrammar))
+    {
+      return makeNewline();
+    }
+    return null;
+  }
+
+  private static Spacing makeNewline() {
+    return Spacing.createSpacing(0, Integer.MAX_VALUE, 1, true, 100);
+  }
+
+  @NotNull
+  public ChildAttributes getChildAttributes(int newChildIndex) {
+    return new ChildAttributes(null, null);
+  }
+
+  public boolean isIncomplete() {
+    // TODO
+    return false;
+  }
+
+  public boolean isLeaf() {
+    // TODO
+    return false;
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/formatting/RncFormattingModelBuilder.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/formatting/RncFormattingModelBuilder.java
new file mode 100644
index 0000000..1861127
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/formatting/RncFormattingModelBuilder.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.formatting;
+
+import com.intellij.formatting.FormattingModel;
+import com.intellij.formatting.FormattingModelBuilder;
+import com.intellij.formatting.FormattingModelProvider;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import org.jetbrains.annotations.NotNull;
+
+public class RncFormattingModelBuilder implements FormattingModelBuilder {
+  @NotNull
+  public FormattingModel createModel(PsiElement element, CodeStyleSettings settings) {
+    return FormattingModelProvider.createFormattingModelForPsiFile(element.getContainingFile(), new RncBlock(element.getNode()), settings);
+  }
+
+  public TextRange getRangeAffectingIndent(PsiFile file, int offset, ASTNode elementAtOffset) {
+    // TODO
+    return null;
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/lexer/CompactSyntaxLexerAdapter.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/lexer/CompactSyntaxLexerAdapter.java
new file mode 100644
index 0000000..4bfc344
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/lexer/CompactSyntaxLexerAdapter.java
@@ -0,0 +1,268 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.lexer;
+
+import com.intellij.lexer.LexerBase;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.psi.TokenType;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.util.text.CharArrayCharSequence;
+import com.intellij.util.text.CharArrayUtil;
+import gnu.trove.TIntIntHashMap;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.jetbrains.annotations.Nullable;
+import org.kohsuke.rngom.parse.compact.*;
+
+import java.io.CharArrayReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.lang.reflect.Field;
+import java.util.Arrays;
+import java.util.LinkedList;
+
+/**
+ * An adapter to use the lexer ("TokenManager") generated from a javacc grammar.
+ *
+ * Not sure if it was easier to write this than hacking my own lexer...
+ */
+public class CompactSyntaxLexerAdapter extends LexerBase {
+  private static final Logger LOG = Logger.getInstance(CompactSyntaxLexerAdapter.class.getName());
+
+  private static final Field myStateField;
+
+  static {
+    try {
+      myStateField = CompactSyntaxTokenManager.class.getDeclaredField("curLexState");
+      myStateField.setAccessible(true);
+    } catch (NoSuchFieldException e) {
+      throw new Error(e);
+    }
+  }
+
+  private static final Token START = new Token();
+
+  private CompactSyntaxTokenManager myLexer;
+  private final LinkedList<Token> myTokenQueue = new LinkedList<Token>();
+  private Token myCurrentToken;
+  private int myCurrentOffset;
+  private int myCurrentEnd;
+
+  private IElementType myCurrentTokenType;
+  private CharSequence myBuffer;
+  private int myEndOffset;
+  private TIntIntHashMap myLengthMap;
+
+  public void advance() {
+    try {
+      myCurrentToken = nextToken();
+      myCurrentOffset = myCurrentEnd;
+      
+      if (myCurrentToken != null) {
+
+        myCurrentEnd = myCurrentOffset + myCurrentToken.image.length();
+        for (int i = myCurrentOffset; i < myCurrentEnd; i++) {
+          myCurrentEnd += myLengthMap.get(i);
+        }
+
+        if (myCurrentToken.kind == CompactSyntaxConstants.EOF) {
+          assert myCurrentOffset == myEndOffset : "actual: " + myCurrentOffset + ", expected: " + myEndOffset;
+          myCurrentToken = null;
+        }
+      }
+
+//      if (myCurrentToken != null) {
+//        System.out.println("token = <" + RncTokenTypes.get(myCurrentToken.kind).toString() + "> [" + myCurrentToken.image + "]");
+//      }
+    } catch (TokenMgrError e) {
+      LOG.error(e);
+      myCurrentToken = null;
+    }
+
+    if (myCurrentToken == null) {
+      myCurrentTokenType = null;
+    } else {
+      myCurrentTokenType = RncTokenTypes.get(myCurrentToken.kind);
+
+      // collapse whitespace tokens into TokenType.WHITE_SPACE [IDEA-12106]
+      if (RncTokenTypes.WHITESPACE.contains(myCurrentTokenType)) {
+        myCurrentTokenType = TokenType.WHITE_SPACE;
+      }
+    }
+  }
+
+  private Token nextToken() {
+    if (myTokenQueue.size() > 0) {
+      return myTokenQueue.removeFirst();
+    }
+
+    final Token t = myLexer.getNextToken();
+    if (t.specialToken != null) {
+      myTokenQueue.addFirst(t);
+      for (Token s = t.specialToken; s != null; s = s.specialToken) {
+        myTokenQueue.addFirst(s);
+      }
+      return myTokenQueue.removeFirst();
+    } else {
+      return t;
+    }
+  }
+
+  @Deprecated
+  public char[] getBuffer() {
+    return CharArrayUtil.fromSequence(myBuffer);
+  }
+
+  @Override
+  public CharSequence getBufferSequence() {
+    return myBuffer;
+  }
+
+  public int getBufferEnd() {
+    return myEndOffset;
+  }
+
+  public int getState() {
+    try {
+      return (Integer)myStateField.get(myLexer);
+    } catch (Exception e) {
+      return -1;
+    }
+  }
+
+  public int getTokenEnd() {
+    return myCurrentEnd;
+  }
+
+  public int getTokenStart() {
+    return myCurrentToken == null ? 0 : myCurrentOffset;
+  }
+
+  @Nullable
+  public IElementType getTokenType() {
+    if (myCurrentToken == null) {
+      return null;
+    } else {
+      return myCurrentTokenType;
+    }
+  }
+
+  @Deprecated
+  public void start(char[] buffer, int startOffset, int endOffset, int initialState) {
+    myBuffer = new CharArrayCharSequence(buffer, startOffset, endOffset);
+
+    final CharArrayReader reader = new CharArrayReader(buffer, startOffset, endOffset - startOffset);
+    init(startOffset, endOffset, reader, initialState);
+  }
+
+  @SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
+  public void start(CharSequence buffer, int startOffset, int endOffset, int initialState) {
+    myBuffer = buffer;
+
+    final Reader reader = new CharSequenceReader(buffer, startOffset, endOffset);
+    init(startOffset, endOffset, reader, initialState);
+  }
+
+  @SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
+  private void init(int startOffset, int endOffset, Reader reader, int initialState) {
+    myEndOffset = endOffset;
+    myLengthMap = new TIntIntHashMap();
+
+    myLexer = createTokenManager(initialState, new EscapePreprocessor(reader, startOffset, myLengthMap));
+
+    myCurrentToken = START;
+    myCurrentOffset = startOffset;
+    myCurrentEnd = startOffset;
+    myTokenQueue.clear();
+    advance();
+  }
+
+  private static CompactSyntaxTokenManager createTokenManager(int initialState, EscapePreprocessor preprocessor) {
+    try {
+      return new CompactSyntaxTokenManager(new SimpleCharStream(preprocessor, 1, 1), initialState);
+    } catch (NoSuchMethodError e) {
+      final Class<CompactSyntaxTokenManager> managerClass = CompactSyntaxTokenManager.class;
+      LOG.error("Unsupported version of RNGOM in classpath", e,
+                "Actual parameter types: " + Arrays.toString(managerClass.getConstructors()[0].getParameterTypes()),
+                "Location of " + managerClass.getName() + ": " + managerClass.getProtectionDomain().getCodeSource().getLocation(),
+                "Location of " + CharStream.class.getName() + ": " + CharStream.class.getProtectionDomain().getCodeSource().getLocation());
+      throw e;
+    }
+  }
+
+  public static void main(String[] args) throws IOException {
+    final CompactSyntaxLexerAdapter lexer = new CompactSyntaxLexerAdapter();
+    lexer.start(new CharArrayCharSequence(FileUtil.adaptiveLoadText(new FileReader(args[0]))));
+    while (lexer.getTokenType() != null) {
+      System.out.println("token = " + lexer.getTokenType());
+      final int start = lexer.getTokenStart();
+      System.out.println("start = " + start);
+      final int end = lexer.getTokenEnd();
+      System.out.println("end = " + end);
+      final CharSequence t = lexer.getBufferSequence().subSequence(start, end);
+      System.out.println("t = " + t);
+      lexer.advance();
+    }
+  }
+
+  // adapted from com.intellij.util.text.CharSequenceReader with start- and endOffset support
+  static class CharSequenceReader extends Reader {
+    private final CharSequence myText;
+    private final int myEndOffset;
+    private int myCurPos;
+
+    public CharSequenceReader(final CharSequence text, int startOffset, int endOffset) {
+      myText = text;
+      myEndOffset = endOffset;
+      myCurPos = startOffset;
+    }
+
+    public void close() {
+    }
+
+    public int read(char[] cbuf, int off, int len) {
+      if ((off < 0) || (off > cbuf.length) || (len < 0) || ((off + len) > cbuf.length) || ((off + len) < 0)) {
+        throw new IndexOutOfBoundsException();
+      } else if (len == 0) {
+        return 0;
+      }
+
+      if (myText instanceof CharArrayCharSequence) { // Optimization
+        final int readChars = ((CharArrayCharSequence)myText).readCharsTo(myCurPos, cbuf, off, len);
+        if (readChars < 0) return -1;
+        myCurPos += readChars;
+        return readChars;
+      }
+
+      int charsToCopy = Math.min(len, myEndOffset - myCurPos);
+      if (charsToCopy <= 0) return -1;
+
+      for (int n = 0; n < charsToCopy; n++) {
+        cbuf[n + off] = myText.charAt(n + myCurPos);
+      }
+
+      myCurPos += charsToCopy;
+      return charsToCopy;
+    }
+
+    public int read() {
+      if (myCurPos >= myEndOffset) return -1;
+      return myText.charAt(myCurPos++);
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/lexer/EscapePreprocessor.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/lexer/EscapePreprocessor.java
new file mode 100644
index 0000000..d759d32
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/lexer/EscapePreprocessor.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.lexer;
+
+import gnu.trove.TIntArrayList;
+import gnu.trove.TIntIntHashMap;
+import org.kohsuke.rngom.util.Utf16;
+
+import java.io.FilterReader;
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+ * A reader that deals with escape sequences in RNC files (\x{xx}) and keeps track of their positions to build correct
+ * token ranges in the lexer.
+ * <p/>
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 05.08.2007
+ */
+class EscapePreprocessor extends FilterReader {
+  private final TIntArrayList myQueuedChars;
+  private final TIntIntHashMap myLengthMap;
+
+  private int myOffset;
+
+  public EscapePreprocessor(Reader reader, int startOffset, TIntIntHashMap map) {
+    super(reader);
+    myOffset = startOffset;
+    myQueuedChars = new TIntArrayList();
+    myLengthMap = map;
+  }
+
+  @Override
+  public int read(char cbuf[], int off, int len) throws IOException {
+    final int i = read();
+    if (i == -1) {
+      return -1;
+    }
+    cbuf[off] = (char)i; // not really efficient, but acceptable since we're usually not having to deal with megabytes of RNC files...
+    return 1;
+  }
+
+  @Override
+  public int read() throws IOException {
+    if (myQueuedChars.size() > 0) {
+      return consume();
+    }
+    final int i = super.read();
+    if (i == -1) {
+      return -1;
+    }
+    myOffset++;
+
+    switch (i) {
+      case '\r':
+        assert false : "Unexpected newline character";  // IDEA document's are supposed to newlines normalized to \n
+        if (peek() == '\n') {
+          consume();
+          myLengthMap.put(myOffset - 1, 2);
+        }
+      case '\n':
+        return '\u0000';
+
+      case '\\':
+        int n = 0;
+        int x;
+        while ((x = peek()) == 'x') {
+          n++;
+        }
+        if (n > 0 && x == '{') {
+          n++;
+        } else {
+          return i;
+        }
+        int value = 0;
+        while (isHexChar((char)(x = peek()))) {
+          n++;
+          value <<= 4;
+          value |= Character.digit(x, 16);
+        }
+        if (x == '}') {
+          n++;
+        }
+        consume(n);
+
+        myLengthMap.put(myOffset - 1, n);
+        myOffset += n;
+
+        if (value <= 0xFFFF) {
+          return value;
+        }
+
+        myQueuedChars.add(Utf16.surrogate2(value));
+        return Utf16.surrogate1(value);
+    }
+
+    return i;
+  }
+
+  private static boolean isHexChar(char i) {
+    if (Character.isDigit(i)) return true;
+    final char c = Character.toLowerCase(i);
+    return c >= 'a' && c <= 'f';
+  }
+
+  private int consume() {
+    if (myQueuedChars.size() > 0) {
+      myOffset++;
+      return myQueuedChars.remove(0);
+    }
+    return -1;
+  }
+
+  private void consume(int n) {
+    myQueuedChars.remove(0, n);
+  }
+
+  private int peek() throws IOException {
+    final int i = super.read();
+    if (i == -1) {
+      return -1;
+    }
+    myQueuedChars.add(i);
+    return i;
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/lexer/SimpleCharStream.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/lexer/SimpleCharStream.java
new file mode 100644
index 0000000..85a9dad
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/lexer/SimpleCharStream.java
@@ -0,0 +1,420 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 3.0 */
+package org.intellij.plugins.relaxNG.compact.lexer;
+
+import org.kohsuke.rngom.parse.compact.CharStream;
+import org.kohsuke.rngom.parse.compact.EOFException;
+
+/**
+ * An implementation of interface CharStream, where the stream is assumed to
+ * contain only ASCII characters (without unicode processing).
+ */
+
+@SuppressWarnings({ "ALL" })
+public class SimpleCharStream implements CharStream
+{
+  int bufsize;
+  int available;
+  int tokenBegin;
+  public int bufpos = -1;
+  protected int bufline[];
+  protected int bufcolumn[];
+
+  protected int column = 0;
+  protected int line = 1;
+
+  protected boolean prevCharIsCR = false;
+  protected boolean prevCharIsLF = false;
+
+  protected java.io.Reader inputStream;
+
+  protected char[] buffer;
+  protected int maxNextCharInd = 0;
+  protected int inBuf = 0;
+
+  protected void ExpandBuff(boolean wrapAround)
+  {
+     char[] newbuffer = new char[bufsize + 2048];
+     int newbufline[] = new int[bufsize + 2048];
+     int newbufcolumn[] = new int[bufsize + 2048];
+
+     try
+     {
+        if (wrapAround)
+        {
+           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+           System.arraycopy(buffer, 0, newbuffer,
+                                             bufsize - tokenBegin, bufpos);
+           buffer = newbuffer;
+
+           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+           System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
+           bufline = newbufline;
+
+           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+           System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
+           bufcolumn = newbufcolumn;
+
+           maxNextCharInd = (bufpos += (bufsize - tokenBegin));
+        }
+        else
+        {
+           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+           buffer = newbuffer;
+
+           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+           bufline = newbufline;
+
+           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+           bufcolumn = newbufcolumn;
+
+           maxNextCharInd = (bufpos -= tokenBegin);
+        }
+     }
+     catch (Throwable t)
+     {
+        throw new Error(t.getMessage());
+     }
+
+
+     bufsize += 2048;
+     available = bufsize;
+     tokenBegin = 0;
+  }
+
+  protected void FillBuff() throws EOFException
+  {
+     if (maxNextCharInd == available)
+     {
+        if (available == bufsize)
+        {
+           if (tokenBegin > 2048)
+           {
+              bufpos = maxNextCharInd = 0;
+              available = tokenBegin;
+           }
+           else if (tokenBegin < 0)
+              bufpos = maxNextCharInd = 0;
+           else
+              ExpandBuff(false);
+        }
+        else if (available > tokenBegin)
+           available = bufsize;
+        else if ((tokenBegin - available) < 2048)
+           ExpandBuff(true);
+        else
+           available = tokenBegin;
+     }
+
+     int i;
+     try {
+        if ((i = inputStream.read(buffer, maxNextCharInd,
+                                    available - maxNextCharInd)) == -1)
+        {
+           inputStream.close();
+           throw new java.io.IOException();
+        }
+        else
+           maxNextCharInd += i;
+        return;
+     }
+     catch(java.io.IOException e) {
+        --bufpos;
+        backup(0);
+        if (tokenBegin == -1)
+           tokenBegin = bufpos;
+        throw new EOFException();
+     }
+  }
+
+  public char BeginToken() throws EOFException
+  {
+     tokenBegin = -1;
+     char c = readChar();
+     tokenBegin = bufpos;
+
+     return c;
+  }
+
+  protected void UpdateLineColumn(char c)
+  {
+     column++;
+
+     if (prevCharIsLF)
+     {
+        prevCharIsLF = false;
+        line += (column = 1);
+     }
+     else if (prevCharIsCR)
+     {
+        prevCharIsCR = false;
+        if (c == '\n')
+        {
+           prevCharIsLF = true;
+        }
+        else
+           line += (column = 1);
+     }
+
+     switch (c)
+     {
+        case '\r' :
+           prevCharIsCR = true;
+           break;
+        case '\n' :
+           prevCharIsLF = true;
+           break;
+        case '\t' :
+           column--;
+           column += (8 - (column & 07));
+           break;
+        default :
+           break;
+     }
+
+     bufline[bufpos] = line;
+     bufcolumn[bufpos] = column;
+  }
+
+  public char readChar() throws EOFException
+  {
+     if (inBuf > 0)
+     {
+        --inBuf;
+
+        if (++bufpos == bufsize)
+           bufpos = 0;
+
+        return buffer[bufpos];
+     }
+
+     if (++bufpos >= maxNextCharInd)
+        FillBuff();
+
+     char c = buffer[bufpos];
+
+     UpdateLineColumn(c);
+     return (c);
+  }
+
+  /**
+   * @deprecated 
+   * @see #getEndColumn
+   */
+
+  public int getColumn() {
+     return bufcolumn[bufpos];
+  }
+
+  /**
+   * @deprecated 
+   * @see #getEndLine
+   */
+
+  public int getLine() {
+     return bufline[bufpos];
+  }
+
+  public int getEndColumn() {
+     return bufcolumn[bufpos];
+  }
+
+  public int getEndLine() {
+     return bufline[bufpos];
+  }
+
+  public int getBeginColumn() {
+     return bufcolumn[tokenBegin];
+  }
+
+  public int getBeginLine() {
+     return bufline[tokenBegin];
+  }
+
+  public void backup(int amount) {
+
+    inBuf += amount;
+    if ((bufpos -= amount) < 0)
+       bufpos += bufsize;
+  }
+
+  public SimpleCharStream(java.io.Reader dstream, int startline,
+  int startcolumn, int buffersize)
+  {
+    inputStream = dstream;
+    line = startline;
+    column = startcolumn - 1;
+
+    available = bufsize = buffersize;
+    buffer = new char[buffersize];
+    bufline = new int[buffersize];
+    bufcolumn = new int[buffersize];
+  }
+
+  public SimpleCharStream(java.io.Reader dstream, int startline,
+                                                           int startcolumn)
+  {
+     this(dstream, startline, startcolumn, 4096);
+  }
+
+  public SimpleCharStream(java.io.Reader dstream)
+  {
+     this(dstream, 1, 1, 4096);
+  }
+  public void ReInit(java.io.Reader dstream, int startline,
+  int startcolumn, int buffersize)
+  {
+    inputStream = dstream;
+    line = startline;
+    column = startcolumn - 1;
+
+    if (buffer == null || buffersize != buffer.length)
+    {
+      available = bufsize = buffersize;
+      buffer = new char[buffersize];
+      bufline = new int[buffersize];
+      bufcolumn = new int[buffersize];
+    }
+    prevCharIsLF = prevCharIsCR = false;
+    tokenBegin = inBuf = maxNextCharInd = 0;
+    bufpos = -1;
+  }
+
+  public void ReInit(java.io.Reader dstream, int startline,
+                                                           int startcolumn)
+  {
+     ReInit(dstream, startline, startcolumn, 4096);
+  }
+
+  public void ReInit(java.io.Reader dstream)
+  {
+     ReInit(dstream, 1, 1, 4096);
+  }
+  public SimpleCharStream(java.io.InputStream dstream, int startline,
+  int startcolumn, int buffersize)
+  {
+     this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
+  }
+
+  public SimpleCharStream(java.io.InputStream dstream, int startline,
+                                                           int startcolumn)
+  {
+     this(dstream, startline, startcolumn, 4096);
+  }
+
+  public SimpleCharStream(java.io.InputStream dstream)
+  {
+     this(dstream, 1, 1, 4096);
+  }
+
+  public void ReInit(java.io.InputStream dstream, int startline,
+                          int startcolumn, int buffersize)
+  {
+     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
+  }
+
+  public void ReInit(java.io.InputStream dstream)
+  {
+     ReInit(dstream, 1, 1, 4096);
+  }
+  public void ReInit(java.io.InputStream dstream, int startline,
+                                                           int startcolumn)
+  {
+     ReInit(dstream, startline, startcolumn, 4096);
+  }
+  public String GetImage()
+  {
+     if (bufpos >= tokenBegin)
+        return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
+     else
+        return new String(buffer, tokenBegin, bufsize - tokenBegin) +
+                              new String(buffer, 0, bufpos + 1);
+  }
+
+  public char[] GetSuffix(int len)
+  {
+     char[] ret = new char[len];
+
+     if ((bufpos + 1) >= len)
+        System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
+     else
+     {
+        System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
+                                                          len - bufpos - 1);
+        System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
+     }
+
+     return ret;
+  }
+
+  public void Done()
+  {
+     buffer = null;
+     bufline = null;
+     bufcolumn = null;
+  }
+
+  /**
+   * Method to adjust line and column numbers for the start of a token.
+   */
+  public void adjustBeginLineColumn(int newLine, int newCol)
+  {
+     int start = tokenBegin;
+     int len;
+
+     if (bufpos >= tokenBegin)
+     {
+        len = bufpos - tokenBegin + inBuf + 1;
+     }
+     else
+     {
+        len = bufsize - tokenBegin + bufpos + 1 + inBuf;
+     }
+
+     int i = 0, j = 0, k = 0;
+     int nextColDiff = 0, columnDiff = 0;
+
+     while (i < len &&
+            bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
+     {
+        bufline[j] = newLine;
+        nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
+        bufcolumn[j] = newCol + columnDiff;
+        columnDiff = nextColDiff;
+        i++;
+     } 
+
+     if (i < len)
+     {
+        bufline[j] = newLine++;
+        bufcolumn[j] = newCol + columnDiff;
+
+        while (i++ < len)
+        {
+           if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+              bufline[j] = newLine++;
+           else
+              bufline[j] = newLine;
+        }
+     }
+
+     line = bufline[j];
+     column = bufcolumn[j];
+  }
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/AbstractParsing.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/AbstractParsing.java
new file mode 100644
index 0000000..0d53c21
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/AbstractParsing.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.parser;
+
+import com.intellij.lang.PsiBuilder;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.TokenSet;
+import org.intellij.plugins.relaxNG.compact.RncElementTypes;
+
+import static org.intellij.plugins.relaxNG.compact.RncTokenTypes.*;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 09.08.2007
+ */
+public abstract class AbstractParsing {
+  protected static final TokenSet LA_INCLUDE_CONTENT = TokenSet.orSet(TokenSet.create(
+          KEYWORD_DIV, KEYWORD_START), IDENTIFIERS);
+
+  protected static final TokenSet LA_GRAMMAR_CONTENT = TokenSet.orSet(TokenSet.create(
+          KEYWORD_INCLUDE), LA_INCLUDE_CONTENT);
+
+  protected static final TokenSet ATTR_OR_ELEMENT = TokenSet.create(
+          KEYWORD_ATTRIBUTE, KEYWORD_ElEMENT);
+
+  protected static final TokenSet CONTENT = TokenSet.create(
+          KEYWORD_LIST, KEYWORD_MIXED);
+
+  protected static final TokenSet LA_DATATYPE = TokenSet.create(
+          KEYWORD_STRING, KEYWORD_TOKEN);
+
+  protected static final TokenSet LA_DECL = TokenSet.create(
+          KEYWORD_DATATYPES, KEYWORD_NAMESPACE, KEYWORD_DEFAULT);
+
+  protected static final TokenSet NS_URI_LITERAL = TokenSet.create(KEYWORD_INHERIT, LITERAL);
+  protected static final TokenSet ASSIGN_METHOD = TokenSet.create(EQ, CHOICE_EQ, INTERLEAVE_EQ);
+  protected final PsiBuilder myBuilder;
+
+  public AbstractParsing(PsiBuilder builder) {
+    myBuilder = builder;
+  }
+
+  protected final PsiBuilder.Marker begin() {
+    final PsiBuilder.Marker marker = myBuilder.mark();
+    advance();
+    return marker;
+  }
+
+  protected final boolean matches(TokenSet set) {
+    if (set.contains(currentToken())) {
+      advance();
+      return true;
+    }
+    return false;
+  }
+
+  protected final boolean matches(IElementType t) {
+    if (t == currentToken()) {
+      advance();
+      return true;
+    }
+    return false;
+  }
+
+  protected final void match(IElementType token, String msg) {
+    if (!matches(token)) {
+      error(msg);
+      advance();
+    }
+  }
+
+  protected final void match(TokenSet set, String msg) {
+    if (!matches(set)) {
+      error(msg);
+      advance();
+    }
+  }
+
+  protected final void error(String s) {
+    myBuilder.error(s);
+  }
+
+  protected final void advance() {
+    myBuilder.advanceLexer();
+  }
+
+  protected final IElementType currentToken() {
+    final IElementType token = myBuilder.getTokenType();
+    if (isName(token)) {
+      final PsiBuilder.Marker marker = myBuilder.mark();
+      makeName();
+      if (myBuilder.getTokenType() == LBRACKET) {
+        skipAnnotation(marker, RncElementTypes.ANNOTATION_ELEMENT);
+        return currentToken();
+      } else {
+        marker.rollbackTo();
+      }
+    } else if (token == LBRACKET) {
+      final PsiBuilder.Marker marker = myBuilder.mark();
+      skipAnnotation(marker, RncElementTypes.ANNOTATION);
+      return currentToken();
+    } else if (token == GTGT) {
+      final PsiBuilder.Marker marker = myBuilder.mark();
+      advance();
+      if (isName(myBuilder.getTokenType())) {
+        makeName();
+        if (myBuilder.getTokenType() == LBRACKET) {
+          skipAnnotation(marker, RncElementTypes.FORWARD_ANNOTATION);
+          return currentToken();
+        }
+      }
+      marker.done(RncElementTypes.FORWARD_ANNOTATION);
+      return currentToken();
+    }
+    return token;
+  }
+
+  protected static boolean isName(IElementType token) {
+    return IDENTIFIER_OR_KEYWORD.contains(token) || token == PREFIXED_NAME;
+  }
+
+  private void skipAnnotation(PsiBuilder.Marker marker, IElementType annotationType) {
+    final boolean b = myBuilder.getTokenType() == LBRACKET;
+    advance();
+    assert b;
+
+    while (!myBuilder.eof() && currentToken() != RBRACKET) {
+      advance();
+    }
+    if (myBuilder.getTokenType() == RBRACKET) {
+      advance();
+    }
+    marker.done(annotationType);
+  }
+
+  protected final void makeName() {
+    final PsiBuilder.Marker name = myBuilder.mark();
+    advance();
+    name.done(RncElementTypes.NAME);
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/DeclarationParsing.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/DeclarationParsing.java
new file mode 100644
index 0000000..cd14b3f
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/DeclarationParsing.java
@@ -0,0 +1,178 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.parser;
+
+import com.intellij.lang.PsiBuilder;
+import com.intellij.psi.tree.IElementType;
+import org.intellij.plugins.relaxNG.compact.RncElementTypes;
+
+import static org.intellij.plugins.relaxNG.compact.RncTokenTypes.*;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 09.08.2007
+ */
+public abstract class DeclarationParsing extends AbstractParsing {
+
+  public DeclarationParsing(PsiBuilder builder) {
+    super(builder);
+  }
+
+  protected void parseTopLevel() {
+    while (!myBuilder.eof() && LA_DECL.contains(currentToken())) {
+      parseDecl(myBuilder);
+    }
+
+    if (LA_GRAMMAR_CONTENT.contains(currentToken())) {
+      final PsiBuilder.Marker marker = myBuilder.mark();
+      parseGrammarContents();
+      marker.done(RncElementTypes.GRAMMAR_PATTERN);
+    } else if (currentToken() == KEYWORD_GRAMMAR) {
+      parsePattern();
+    } else {
+      final PsiBuilder.Marker marker = myBuilder.mark();
+      while (!myBuilder.eof()) {
+        if (!parsePattern()) {
+          break;
+        }
+      }
+      marker.done(RncElementTypes.GRAMMAR_PATTERN);
+    }
+  }
+
+  protected abstract boolean parsePattern();
+
+  protected void parseGrammarContents() {
+    while (LA_GRAMMAR_CONTENT.contains(currentToken())) {
+      parseGrammarContent(true);
+    }
+  }
+
+  private void parseIncludeContents() {
+    while (LA_INCLUDE_CONTENT.contains(currentToken())) {
+      parseGrammarContent(false);
+    }
+  }
+
+  private void parseGrammarContent(boolean allowInclude) {
+    final IElementType t = currentToken();
+    if (t == KEYWORD_START) {
+      parseStart();
+    } else if (t == KEYWORD_DIV) {
+      parseDiv();
+    } else if (allowInclude && t == KEYWORD_INCLUDE) {
+      parseInclude();
+    } else if (IDENTIFIERS.contains(t)) {
+      parseDefine();
+    } else {
+      error("Unexpected token");
+      advance();
+    }
+  }
+
+  private void parseDefine() {
+    final PsiBuilder.Marker marker = begin();
+    match(ASSIGN_METHOD, "'=', '|=' or '&=' expected");
+    if (!parsePattern()) {
+      error("Pattern expected");
+    }
+    marker.done(RncElementTypes.DEFINE);
+  }
+
+  private void parseInclude() {
+    final PsiBuilder.Marker marker = begin();
+
+    parseAnyUriLiteral();
+
+    parseInherit();
+
+    if (matches(LBRACE)) {
+      parseIncludeContents();
+      match(RBRACE, "'}' expected");
+    }
+    marker.done(RncElementTypes.INCLUDE);
+  }
+
+  protected final void parseAnyUriLiteral() {
+    match(LITERAL, "URI literal expected");
+  }
+
+  protected final void parseInherit() {
+    if (matches(KEYWORD_INHERIT)) {
+      match(EQ, "'=' expected");
+      match(IDENTIFIER_OR_KEYWORD, "Identifier expected");
+    }
+  }
+
+  private void parseDiv() {
+    final PsiBuilder.Marker marker = begin();
+    parseBracedGrammarContents();
+    marker.done(RncElementTypes.DIV);
+  }
+
+  private void parseStart() {
+    final PsiBuilder.Marker marker = begin();
+    match(ASSIGN_METHOD, "'=', '|=' or '&=' expected");
+    if (!parsePattern()) {
+      error("Pattern expected");
+    }
+    marker.done(RncElementTypes.START);
+  }
+
+  protected void parseBracedGrammarContents() {
+    match(LBRACE, "'{' expected");
+    parseGrammarContents();
+    match(RBRACE, "'}' expected");
+  }
+
+  protected void parseDecl(PsiBuilder builder) {
+    final IElementType t = builder.getTokenType();
+    if (t == KEYWORD_NAMESPACE) {
+      parseNamespaceDecl(false);
+    } else if (t == KEYWORD_DEFAULT) {
+      parseNamespaceDecl(true);
+    } else if (t == KEYWORD_DATATYPES) {
+      parseDataTypesDecl();
+    }
+  }
+
+  private void parseDataTypesDecl() {
+    final PsiBuilder.Marker marker = begin();
+    match(IDENTIFIER_OR_KEYWORD, "Identifier expected");
+    match(EQ, "'=' expected");
+    parseNsUriLiteral();
+    marker.done(RncElementTypes.DATATYPES_DECL);
+  }
+
+  private void parseNamespaceDecl(boolean isDefault) {
+    final PsiBuilder.Marker marker = begin();
+    if (isDefault) {
+      match(KEYWORD_NAMESPACE, "'namespace' expected");
+      matches(IDENTIFIER_OR_KEYWORD);
+    } else {
+      match(IDENTIFIER_OR_KEYWORD, "Identifier expected");
+    }
+    match(EQ, "'=' expected");
+    parseNsUriLiteral();
+    marker.done(RncElementTypes.NS_DECL);
+  }
+
+  private void parseNsUriLiteral() {
+    match(NS_URI_LITERAL, "Namespace URI or 'inherit' expected");
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/NameClassParsing.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/NameClassParsing.java
new file mode 100644
index 0000000..4484fe2
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/NameClassParsing.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.parser;
+
+import com.intellij.lang.PsiBuilder;
+import com.intellij.psi.tree.IElementType;
+import org.intellij.plugins.relaxNG.compact.RncElementTypes;
+
+import static org.intellij.plugins.relaxNG.compact.RncTokenTypes.*;
+
+public class NameClassParsing extends AbstractParsing {
+
+  public NameClassParsing(PsiBuilder builder) {
+    super(builder);
+  }
+
+  public boolean parseNameClass() {
+    PsiBuilder.Marker marker = myBuilder.mark();
+
+    if (!parseNameClassPart()) {
+      marker.drop();
+      return false;
+    }
+
+    if (currentToken() == PIPE) {
+      do {
+        advance();
+        if (!parseNameClassPart()) {
+          error("NameClass expected");
+        }
+      } while (currentToken() == PIPE);
+      marker.done(RncElementTypes.NAME_CLASS_CHOICE);
+    } else {
+      marker.drop();
+    }
+    return true;
+  }
+
+  private boolean parseNameClassPart() {
+    final IElementType t = currentToken();
+    PsiBuilder.Marker marker = myBuilder.mark();
+    if (IDENTIFIER_OR_KEYWORD.contains(t)) {
+      advance();
+    } else if (PREFIXED_NAME == t) { // CName
+      makeName();
+    } else if (STAR == t) { // anyName
+      advance();
+      parseExceptNameClass();
+    } else if (PREFIXED_STAR == t) { // nsName
+      makeName();
+      parseExceptNameClass();
+    } else if (LPAREN == t) {
+      advance();
+      if (parseNameClass()) {
+        match(RPAREN, "')' expected");
+      }
+    } else {
+      marker.drop();
+      return false;
+    }
+    marker.done(RncElementTypes.NAME_CLASS);
+    return true;
+  }
+
+  private void parseExceptNameClass() {
+    if (MINUS == currentToken()) {
+      final PsiBuilder.Marker marker = begin();
+      if (!parseNameClass()) {
+        error("NameClass expected");
+      }
+      marker.done(RncElementTypes.EXCEPT_NAME_CLASS);
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/PatternParsing.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/PatternParsing.java
new file mode 100644
index 0000000..7fff0c3
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/PatternParsing.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.parser;
+
+import com.intellij.lang.PsiBuilder;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.util.containers.ContainerUtil;
+import org.intellij.plugins.relaxNG.compact.RncElementTypes;
+
+import java.util.Map;
+
+import static org.intellij.plugins.relaxNG.compact.RncTokenTypes.*;
+
+/**
+ * Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 09.08.2007
+*/
+public class PatternParsing extends DeclarationParsing {
+
+  @SuppressWarnings({"unchecked"})
+  protected static final Map<IElementType, IElementType> TOKEN_MAP =
+    ContainerUtil.newIdentityTroveMap();
+
+  static {
+    TOKEN_MAP.put(COMMA, RncElementTypes.SEQUENCE);
+    TOKEN_MAP.put(PIPE, RncElementTypes.CHOICE);
+    TOKEN_MAP.put(AND, RncElementTypes.INTERLEAVE);
+    TOKEN_MAP.put(STAR, RncElementTypes.ZERO_OR_MORE);
+    TOKEN_MAP.put(PLUS, RncElementTypes.ONE_OR_MORE);
+    TOKEN_MAP.put(QUEST, RncElementTypes.OPTIONAL);
+  }
+
+  private final NameClassParsing myNameClassParsing;
+
+  public PatternParsing(PsiBuilder builder) {
+    super(builder);
+    myNameClassParsing = new NameClassParsing(builder);
+  }
+
+  public void parse() {
+    parseTopLevel();
+  }
+
+  protected boolean parsePattern() {
+    PsiBuilder.Marker marker = myBuilder.mark();
+    if (!parseQuantifiedPattern()) {
+      marker.drop();
+      return false;
+    }
+
+    while (BINARY_OPS.contains(currentToken())) {
+      IElementType t;
+      if (BINARY_OPS.contains(t = currentToken())) {
+        do {
+          advance();
+          if (!parseQuantifiedPattern()) {
+            error("Pattern expected");
+          }
+        } while (currentToken() == t);
+        marker.done(TOKEN_MAP.get(t));
+        marker = marker.precede();
+      }
+    }
+    marker.drop();
+    return true;
+  }
+
+  private boolean parseQuantifiedPattern() {
+    final PsiBuilder.Marker marker = myBuilder.mark();
+    if (!parseSinglePattern()) {
+      marker.drop();
+      return false;
+    }
+
+    final IElementType t = currentToken();
+    if (matches(QUANTIFIER_OPS)) {
+      marker.done(TOKEN_MAP.get(t));
+    } else {
+      marker.drop();
+    }
+    return true;
+  }
+
+  private boolean parseSinglePattern() {
+    final PsiBuilder.Marker marker = myBuilder.mark();
+    if (matches(ATTR_OR_ELEMENT)) {
+      if (!myNameClassParsing.parseNameClass()) {
+        error("Name class expected");
+        marker.drop();
+        return false;
+      }
+      parseBracedPattern();
+      marker.done(RncElementTypes.PATTERN);
+    } else if (matches(KEYWORD_LIST)) {
+      parseBracedPattern();
+      marker.done(RncElementTypes.LIST_PATTERN);
+    } else if (matches(KEYWORD_MIXED)) {
+      parseBracedPattern();
+      marker.done(RncElementTypes.MIXED_PATTERN);
+    } else if (matches(KEYWORD_EXTERNAL)) {
+      parseAnyUriLiteral();
+      parseInherit();
+      marker.done(RncElementTypes.EXTERNAL_REF);
+    } else if (matches(KEYWORD_NOT_ALLOWED)) {
+      marker.done(RncElementTypes.NOT_ALLOWED_PATTERN);
+    } else if (matches(KEYWORD_TEXT)) {
+      marker.done(RncElementTypes.TEXT_PATTERN);
+    } else if (matches(KEYWORD_EMPTY)) {
+      marker.done(RncElementTypes.EMPTY_PATTERN);
+    } else if (matches(KEYWORD_PARENT)) {
+      match(IDENTIFIERS, "Identifier expected");
+      marker.done(RncElementTypes.PARENT_REF);
+    } else if (matches(KEYWORD_GRAMMAR)) {
+      parseBracedGrammarContents();
+      marker.done(RncElementTypes.GRAMMAR_PATTERN);
+    } else if (matches(LPAREN)) {
+      if (!parsePattern()) {
+        error("Pattern expected");
+      }
+      match(RPAREN, "')' expected");
+      marker.done(RncElementTypes.GROUP_PATTERN);
+    } else if (matches(IDENTIFIERS)) {
+      marker.done(RncElementTypes.REF_PATTERN);
+    } else if (matches(LA_DATATYPE)) {
+      parseDatatype();
+      marker.done(RncElementTypes.DATATYPE_PATTERN);
+    } else if (currentToken() == PREFIXED_NAME) {
+      makeName();
+      parseDatatype();
+      marker.done(RncElementTypes.DATATYPE_PATTERN);
+    } else if (matches(LITERAL)) {
+      marker.done(RncElementTypes.DATATYPE_PATTERN);
+    } else {
+      marker.drop();
+      return false;
+    }
+    return true;
+  }
+
+  private void parseDatatype() {
+    if (currentToken() == LITERAL) {
+      advance();
+    } else if (matches(LBRACE)) {
+      parseParams();
+      if (matches(MINUS)) {
+        if (!parsePattern()) {
+          error("Pattern expected");
+        }
+      }
+      match(RBRACE, "'}' expected");
+    }
+  }
+
+  private void parseBracedPattern() {
+    match(LBRACE, "'{' expected");
+    if (!parsePattern()) {
+      error("Pattern expected");
+    }
+    match(RBRACE, "'}' expected");
+  }
+
+  private void parseParams() {
+    final IElementType t = currentToken();
+    if (t != RBRACE) {
+      do {
+        final PsiBuilder.Marker marker = myBuilder.mark();
+        match(IDENTIFIER_OR_KEYWORD, "Identifier expected");
+        match(EQ, "'=' expected");
+        match(LITERAL, "Literal expected");
+        marker.done(RncElementTypes.PARAM);
+      } while (IDENTIFIER_OR_KEYWORD.contains(currentToken()));
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/RncParser.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/RncParser.java
new file mode 100644
index 0000000..799b9eb
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/parser/RncParser.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.parser;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.PsiBuilder;
+import com.intellij.lang.PsiParser;
+import com.intellij.psi.tree.IElementType;
+import org.intellij.plugins.relaxNG.compact.RncElementTypes;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 07.08.2007
+*/
+public class RncParser implements PsiParser {
+
+  @NotNull
+  public ASTNode parse(IElementType root, PsiBuilder builder) {
+    final PsiBuilder.Marker fileMarker = builder.mark();
+    final PsiBuilder.Marker docMarker = builder.mark();
+
+    new PatternParsing(builder).parse();
+
+    while (!builder.eof()) {
+      builder.error("Unexpected token");
+      builder.advanceLexer();
+    }
+
+    docMarker.done(RncElementTypes.DOCUMENT);
+    fileMarker.done(root);
+    return builder.getTreeBuilt();
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncAnnotation.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncAnnotation.java
new file mode 100644
index 0000000..77759d9
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncAnnotation.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+import com.intellij.psi.PsiComment;
+import org.jetbrains.annotations.Nullable;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 24.08.2007
+*/
+public interface RncAnnotation extends RncElement, PsiComment {
+  @Nullable
+  RncName getNameElement();
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncDecl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncDecl.java
new file mode 100644
index 0000000..c1a7e65
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncDecl.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+import com.intellij.psi.PsiNamedElement;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 16.08.2007
+ */
+public interface RncDecl extends RncElement, PsiNamedElement {
+  String getPrefix();
+
+  String getDeclaredNamespace();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncDefine.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncDefine.java
new file mode 100644
index 0000000..b1c3120
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncDefine.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+import com.intellij.psi.PsiNamedElement;
+import org.intellij.plugins.relaxNG.model.Define;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 13.08.2007
+ */
+public interface RncDefine extends RncPattern, PsiNamedElement, Define<RncPattern, RncElement> {
+  @Nullable
+  RncPattern getPattern();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncDiv.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncDiv.java
new file mode 100644
index 0000000..b541023
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncDiv.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+import org.intellij.plugins.relaxNG.model.Div;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 24.08.2007
+*/
+public interface RncDiv extends RncElement, Div<RncElement> {
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncElement.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncElement.java
new file mode 100644
index 0000000..92017fc
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncElement.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+import com.intellij.psi.PsiElement;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 10.08.2007
+ */
+public interface RncElement extends PsiElement {
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncElementVisitor.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncElementVisitor.java
new file mode 100644
index 0000000..75fa058
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncElementVisitor.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiElementVisitor;
+
+public class RncElementVisitor extends PsiElementVisitor {
+
+  @Override
+  public final void visitElement(PsiElement element) {
+    if (element instanceof RncElement) {
+      visitElement((RncElement)element);
+    } else {
+      superVisitElement(element);
+    }
+  }
+
+  protected void superVisitElement(PsiElement element) {
+    super.visitElement(element);
+  }
+
+  public void visitElement(RncElement element) {
+    super.visitElement(element);
+  }
+
+  public void visitInclude(RncInclude include) {
+    visitElement(include);
+  }
+
+  public void visitDiv(RncDiv div) {
+    visitElement(div);
+  }
+
+  public void visitRef(RncRef pattern) {
+    visitElement(pattern);
+  }
+
+  public void visitParentRef(RncParentRef pattern) {
+    visitElement(pattern);
+  }
+
+  public void visitDefine(RncDefine pattern) {
+    visitElement(pattern);
+  }
+
+  public void visitGrammar(RncGrammar pattern) {
+    visitElement(pattern);
+  }
+
+  public void visitName(RncName name) {
+    visitElement(name);
+  }
+
+  public void visitAnnotation(RncAnnotation annotation) {
+    visitElement(annotation);
+  }
+
+  public void visitExternalRef(RncExternalRef ref) {
+    visitElement(ref);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncExternalRef.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncExternalRef.java
new file mode 100644
index 0000000..14b538f
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncExternalRef.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 11.08.2007
+ */
+public interface RncExternalRef extends RncFileReference {
+
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncFile.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncFile.java
new file mode 100644
index 0000000..5a32210
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncFile.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 11.08.2007
+ */
+public interface RncFile extends PsiFile {
+  RncDecl[] getDeclarations();
+
+  @Nullable
+  RncGrammar getGrammar();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncFileReference.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncFileReference.java
new file mode 100644
index 0000000..d6d0ff9
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncFileReference.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+import com.intellij.openapi.util.TextRange;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 29.08.2007
+ */
+public interface RncFileReference extends RncElement {
+  @Nullable
+  RncFile getReferencedFile();
+
+  @Nullable
+  String getFileReference();
+
+  TextRange getReferenceRange();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncGrammar.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncGrammar.java
new file mode 100644
index 0000000..55f5650
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncGrammar.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+import org.intellij.plugins.relaxNG.model.Grammar;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 13.08.2007
+ */
+public interface RncGrammar extends RncElement, Grammar<RncPattern, RncElement> {
+  @Nullable
+  RncPattern getStart();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncInclude.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncInclude.java
new file mode 100644
index 0000000..f4736a1
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncInclude.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+import org.intellij.plugins.relaxNG.model.Include;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 11.08.2007
+ */
+public interface RncInclude extends RncFileReference, Include<RncElement, RncDefine> {
+  @NotNull
+  RncDefine[] getOverrides();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncName.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncName.java
new file mode 100644
index 0000000..4b60e1a
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncName.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 14.08.2007
+ */
+public interface RncName extends RncElement {
+  @Nullable
+  String getPrefix();
+
+  @NotNull
+  String getLocalPart();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncNsDecl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncNsDecl.java
new file mode 100644
index 0000000..81a842b
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncNsDecl.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 14.08.2007
+ */
+public interface RncNsDecl extends RncDecl {
+  boolean isDefault();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncParentRef.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncParentRef.java
new file mode 100644
index 0000000..5da7525
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncParentRef.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 13.08.2007
+ */
+public interface RncParentRef extends RncRef {
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncPattern.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncPattern.java
new file mode 100644
index 0000000..c661a4f
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncPattern.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+import org.intellij.plugins.relaxNG.model.Pattern;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 05.09.2007
+ */
+public interface RncPattern extends RncElement, Pattern<RncElement> {
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncRef.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncRef.java
new file mode 100644
index 0000000..6cb9d83
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/RncRef.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi;
+
+import org.intellij.plugins.relaxNG.model.Ref;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 11.08.2007
+ */
+public interface RncRef extends RncPattern, Ref<RncDefine, RncElement> {
+  @Nullable
+  RncDefine getPattern();
+
+  @Nullable
+  String getReferencedName();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/FollowFileHint.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/FollowFileHint.java
new file mode 100644
index 0000000..25719ac
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/FollowFileHint.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.openapi.util.Key;
+import org.intellij.plugins.relaxNG.compact.psi.RncFile;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 13.08.2007
+ */
+public interface FollowFileHint {
+  Key<FollowFileHint> KEY = Key.create("FollowFileHint");
+
+  public boolean doFollow(RncFile file);
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/PatternReference.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/PatternReference.java
new file mode 100644
index 0000000..c140344
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/PatternReference.java
@@ -0,0 +1,228 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
+import com.intellij.codeInsight.daemon.QuickFixProvider;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.ScrollType;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.*;
+import com.intellij.psi.codeStyle.CodeStyleManager;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.Function;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.intellij.plugins.relaxNG.compact.psi.*;
+import org.intellij.plugins.relaxNG.compact.psi.util.EscapeUtil;
+import org.intellij.plugins.relaxNG.compact.psi.util.RenameUtil;
+import org.intellij.plugins.relaxNG.model.Define;
+import org.intellij.plugins.relaxNG.model.resolve.DefinitionResolver;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 13.08.2007
+ */
+class PatternReference extends PsiReferenceBase.Poly<RncRef> implements Function<Define, ResolveResult>,
+        QuickFixProvider<PatternReference>, EmptyResolveMessageProvider {
+
+  public PatternReference(RncRef ref) {
+    super(ref);
+  }
+
+  public TextRange getRangeInElement() {
+    final ASTNode node = findNameNode();
+    if (node == null) return TextRange.from(0, 0);
+    final int offset = myElement.getTextOffset();
+    return TextRange.from(offset - myElement.getTextRange().getStartOffset(), node.getTextLength());
+  }
+
+  private ASTNode findNameNode() {
+    final ASTNode node = myElement.getNode();
+    assert node != null;
+    return node.findChildByType(RncTokenTypes.IDENTIFIERS);
+  }
+
+  @Nullable
+  public PsiElement resolve() {
+    final ResolveResult[] results = multiResolve(false);
+    return results.length == 1 ? results[0].getElement() : null;
+  }
+
+  @NotNull
+  public ResolveResult[] multiResolve(boolean incompleteCode) {
+    final RncGrammar scope = getScope();
+    if (scope == null) {
+      return ResolveResult.EMPTY_ARRAY;
+    }
+
+    final Set<Define> set = DefinitionResolver.resolve(scope, getCanonicalText());
+    if (set == null || set.size() == 0) return ResolveResult.EMPTY_ARRAY;
+
+    return ContainerUtil.map2Array(set, ResolveResult.class, this);
+  }
+
+  public ResolveResult fun(Define rncDefine) {
+    final PsiElement element = rncDefine.getPsiElement();
+    return element != null ? new PsiElementResolveResult(element) : new ResolveResult() {
+      @Nullable
+      public PsiElement getElement() {
+        return null;
+      }
+      public boolean isValidResult() {
+        return false;
+      }
+    };
+  }
+
+  @Nullable
+  protected RncGrammar getScope() {
+    return PsiTreeUtil.getParentOfType(myElement, RncGrammar.class, true, PsiFile.class);
+  }
+
+  @NotNull
+  public String getCanonicalText() {
+    final ASTNode node = findNameNode();
+    return node != null ? EscapeUtil.unescapeText(node) : "";
+  }
+
+  public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
+    final ASTNode newNode = RenameUtil.createIdentifierNode(getElement().getManager(), newElementName);
+
+    final ASTNode nameNode = findNameNode();
+    nameNode.getTreeParent().replaceChild(nameNode, newNode);
+    return getElement();
+  }
+
+  public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+    throw new UnsupportedOperationException();
+  }
+
+  @NotNull
+  public Object[] getVariants() {
+    final RncGrammar scope = getScope();
+    if (scope == null) {
+      return ResolveResult.EMPTY_ARRAY;
+    }
+
+    final Map<String, Set<Define>> map = DefinitionResolver.getAllVariants(scope);
+    if (map == null || map.size() == 0) return ArrayUtil.EMPTY_OBJECT_ARRAY;
+
+    return ContainerUtil.mapNotNull(map.values(), new Function<Set<Define>, Object>() {
+      public Object fun(Set<Define> defines) {
+        return defines.size() == 0 ? null : defines.iterator().next().getPsiElement();
+      }
+    }).toArray();
+  }
+
+  public boolean isSoft() {
+    return false;
+  }
+
+  public String getUnresolvedMessagePattern() {
+    return "Unresolved pattern reference ''{0}''";
+  }
+
+  public void registerQuickfix(HighlightInfo info, final PatternReference reference) {
+    if (reference.getScope() == null) {
+      return;
+    }
+    QuickFixAction.registerQuickFixAction(info, new CreatePatternFix(reference));
+  }
+
+  static class CreatePatternFix implements IntentionAction {
+    private final PatternReference myReference;
+
+    public CreatePatternFix(PatternReference reference) {
+      myReference = reference;
+    }
+
+    @NotNull
+    public String getText() {
+      return "Create Pattern '" + myReference.getCanonicalText() + "'";
+    }
+
+    @NotNull
+    public String getFamilyName() {
+      return "Create Pattern";
+    }
+
+    public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
+      return myReference.getElement().isValid() && myReference.getScope() != null;
+    }
+
+    public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
+      final RncFile rncfile = (RncFile)PsiFileFactory.getInstance(myReference.getElement().getProject()).createFileFromText("dummy.rnc", RncFileType.getInstance(), "dummy = xxx");
+
+      final RncGrammar grammar = rncfile.getGrammar();
+      assert grammar != null;
+
+      final RncDefine def = (RncDefine)grammar.getFirstChild();
+
+      final RncGrammar scope = myReference.getScope();
+      assert scope != null;
+
+      assert def != null;
+      final RncDefine e = (RncDefine)scope.add(def);
+
+      // ensures proper escaping (start -> \start)
+      def.setName(myReference.getCanonicalText());
+
+      final SmartPsiElementPointer<RncDefine> p = SmartPointerManager.getInstance(project).createSmartPsiElementPointer(e);
+
+      final ASTNode blockNode = e.getParent().getNode();
+      assert blockNode != null;
+
+      final ASTNode newNode = e.getNode();
+      assert newNode != null;
+
+      CodeStyleManager.getInstance(e.getManager().getProject()).reformatNewlyAddedElement(blockNode, newNode);
+
+      PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(editor.getDocument());
+
+      final RncDefine d = p.getElement();
+      assert d != null;
+
+      final RncElement definition = d.getPattern();
+      assert definition != null;
+
+      final int offset = definition.getTextRange().getStartOffset();
+
+      editor.getCaretModel().moveToOffset(offset);
+      editor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);
+      editor.getDocument().deleteString(offset, definition.getTextRange().getEndOffset());
+    }
+
+    public boolean startInWriteAction() {
+      return true;
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncAnnotationImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncAnnotationImpl.java
new file mode 100644
index 0000000..986763c
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncAnnotationImpl.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.tree.IElementType;
+import org.intellij.plugins.relaxNG.compact.psi.RncAnnotation;
+import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
+import org.intellij.plugins.relaxNG.compact.psi.RncName;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 24.08.2007
+*/
+public class RncAnnotationImpl extends RncElementImpl implements RncAnnotation {
+  public RncAnnotationImpl(ASTNode node) {
+    super(node);
+  }
+
+  public void accept(@NotNull RncElementVisitor visitor) {
+    visitor.visitAnnotation(this);
+  }
+
+  public IElementType getTokenType() {
+    return getNode().getElementType();
+  }
+
+  @Nullable
+  public RncName getNameElement() {
+    return findChildByClass(RncName.class);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncDeclImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncDeclImpl.java
new file mode 100644
index 0000000..e7f3868
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncDeclImpl.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiElement;
+import com.intellij.util.IncorrectOperationException;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.intellij.plugins.relaxNG.compact.psi.RncDecl;
+import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
+import org.intellij.plugins.relaxNG.compact.psi.util.EscapeUtil;
+import org.intellij.plugins.relaxNG.compact.psi.util.RenameUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 16.08.2007
+ */
+public class RncDeclImpl extends RncElementImpl implements RncDecl {
+  public RncDeclImpl(ASTNode node) {
+    super(node);
+  }
+
+  public String getPrefix() {
+    final ASTNode ns = findIdentifierNode();
+    return ns != null ? EscapeUtil.unescapeText(ns) : null;
+  }
+
+  public String getDeclaredNamespace() {
+    final ASTNode ns = getNode().findChildByType(RncTokenTypes.LITERAL);
+    return ns != null ? EscapeUtil.parseLiteralValue(ns) : null;
+  }
+
+  @Override
+  public int getTextOffset() {
+    final ASTNode ns = findIdentifierNode();
+    if (ns != null) {
+      return ns.getStartOffset();
+    }
+    return super.getTextOffset();
+  }
+
+  private ASTNode findIdentifierNode() {
+    // namespace text = "..." is valid - "text" is parsed as a keyword though
+    final ASTNode node = getNode().findChildByType(RncTokenTypes.IDENTIFIERS);
+    if (node == null) {
+      final ASTNode[] nodes = getNode().getChildren(RncTokenTypes.KEYWORDS);
+      if (nodes.length > 1) {
+        return nodes[1];
+      }
+    }
+    return node;
+  }
+
+  @Override
+  public String getName() {
+    final String s = getPrefix();
+    return s != null ? s : "";
+  }
+
+  public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException {
+    final ASTNode node = findIdentifierNode();
+    if (node == null) return this;
+    node.getTreeParent().replaceChild(node, RenameUtil.createIdentifierNode(getManager(), name));
+    return this;
+  }
+
+  public void accept(@NotNull RncElementVisitor visitor) {
+    visitor.visitElement(this);
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncDefineImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncDefineImpl.java
new file mode 100644
index 0000000..eca9001
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncDefineImpl.java
@@ -0,0 +1,170 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiReferenceBase;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.meta.PsiMetaOwner;
+import com.intellij.psi.meta.PsiPresentableMetaData;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.intellij.plugins.relaxNG.compact.psi.*;
+import org.intellij.plugins.relaxNG.compact.psi.util.EscapeUtil;
+import org.intellij.plugins.relaxNG.compact.psi.util.RenameUtil;
+import org.intellij.plugins.relaxNG.model.Define;
+import org.intellij.plugins.relaxNG.model.resolve.DefinitionResolver;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 13.08.2007
+ */
+public class RncDefineImpl extends RncElementImpl implements RncDefine, PsiMetaOwner {
+  public RncDefineImpl(ASTNode node) {
+    super(node);
+  }
+
+  public void accept(@NotNull RncElementVisitor visitor) {
+    visitor.visitDefine(this);
+  }
+
+  public void accept(Visitor visitor) {
+    visitor.visitDefine(this);
+  }
+
+  @Override
+  public String getName() {
+    final ASTNode node = getNameNode();
+    return EscapeUtil.unescapeText(node);
+  }
+
+  public PsiElement getNameElement() {
+    return getNameNode().getPsi();
+  }
+
+  @NotNull
+  public ASTNode getNameNode() {
+    final ASTNode node = getNode().findChildByType(RncTokenTypes.IDENTIFIERS);
+    assert node != null;
+    return node;
+  }
+
+  public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException {
+    final ASTNode node = getNameNode();
+    node.getTreeParent().replaceChild(node, RenameUtil.createIdentifierNode(getManager(), name));
+    return this;
+  }
+
+  @Nullable
+  public RncPattern getPattern() {
+    return findChildByClass(RncPattern.class);
+  }
+
+  public PsiReference getReference() {
+    if (getParent() instanceof RncInclude) {
+      final TextRange range = TextRange.from(0, getNameNode().getTextLength());
+      return new PsiReferenceBase<RncDefine>(this, range, true) {
+        public PsiElement resolve() {
+          return RncDefineImpl.this;
+        }
+
+        @NotNull
+        public Object[] getVariants() {
+          final RncInclude parent = (RncInclude)getParent();
+          final RncFile referencedFile = parent.getReferencedFile();
+          if (referencedFile == null) {
+            return EMPTY_ARRAY;
+          }
+          final RncGrammar grammar = referencedFile.getGrammar();
+          if (grammar == null) {
+            return EMPTY_ARRAY;
+          }
+
+          final Map<String, Set<Define>> map = DefinitionResolver.getAllVariants(grammar);
+          if (map != null) {
+            return map.keySet().toArray();
+          }
+          return EMPTY_ARRAY;
+        }
+      };
+    }
+    return super.getReference();
+  }
+
+  @Nullable
+  public Icon getIcon(int flags) {
+    return AllIcons.Nodes.Property;
+  }
+
+  public boolean isMetaEnough() {
+    return true;
+  }
+
+  @Nullable
+  public PsiMetaData getMetaData() {
+    return new MyMetaData();
+  }
+
+  private class MyMetaData implements PsiMetaData, PsiPresentableMetaData {
+    /*public boolean processDeclarations(PsiElement context, PsiScopeProcessor processor, PsiSubstitutor substitutor, PsiElement lastElement, PsiElement place) {
+      return false;
+    }*/
+
+    @Nullable
+    public Icon getIcon() {
+      return RncDefineImpl.this.getIcon(0);
+    }
+
+    public String getTypeName() {
+      return "Pattern Definition";
+    }
+
+    public PsiElement getDeclaration() {
+      return RncDefineImpl.this;
+    }
+
+    @NonNls
+    public String getName(PsiElement context) {
+      return RncDefineImpl.this.getName();
+    }
+
+    @NonNls
+    public String getName() {
+      return RncDefineImpl.this.getName();
+    }
+
+    public void init(PsiElement element) {
+    }
+
+    public Object[] getDependences() {
+      return ArrayUtil.EMPTY_OBJECT_ARRAY;
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncDivImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncDivImpl.java
new file mode 100644
index 0000000..2568918
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncDivImpl.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.lang.ASTNode;
+import org.intellij.plugins.relaxNG.compact.psi.RncDiv;
+import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
+import org.jetbrains.annotations.NotNull;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 24.08.2007
+*/
+public class RncDivImpl extends RncElementImpl implements RncDiv {
+  public RncDivImpl(ASTNode node) {
+    super(node);
+  }
+
+  public void accept(@NotNull RncElementVisitor visitor) {
+    visitor.visitDiv(this);
+  }
+
+  @Override
+  public void accept(Visitor visitor) {
+    visitor.visitDiv(this);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncDocument.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncDocument.java
new file mode 100644
index 0000000..ea54963
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncDocument.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.impl.meta.MetaRegistry;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlProlog;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.xml.XmlNSDescriptor;
+import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
+import org.intellij.plugins.relaxNG.compact.psi.RncGrammar;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class RncDocument extends RncElementImpl implements XmlDocument {
+  public RncDocument(ASTNode node) {
+    super(node);
+  }
+
+  public XmlNSDescriptor getDefaultNSDescriptor(String namespace, boolean strict) {
+    return null;
+  }
+
+  public XmlProlog getProlog() {
+    return null;
+  }
+
+  @Nullable
+  public XmlTag getRootTag() {
+    return null;
+  }
+
+  public XmlNSDescriptor getRootTagNSDescriptor() {
+    return null;
+  }
+
+  public boolean processElements(PsiElementProcessor processor, PsiElement place) {
+    return false;
+  }
+
+  @Nullable
+  public PsiMetaData getMetaData() {
+    return MetaRegistry.getMeta(this);
+  }
+
+  public boolean isMetaEnough() {
+    return true;
+  }
+
+  public RncGrammar getGrammar() {
+    return findChildByClass(RncGrammar.class);
+  }
+
+  @Override
+  @NotNull
+  protected <T> T[] findChildrenByClass(Class<T> aClass) {
+    return super.findChildrenByClass(aClass);
+  }
+
+  public void accept(@NotNull RncElementVisitor visitor) {
+    visitor.visitElement(this);
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncElementImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncElementImpl.java
new file mode 100644
index 0000000..7c1819c
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncElementImpl.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.extapi.psi.ASTWrapperPsiElement;
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiElementVisitor;
+import com.intellij.psi.ResolveState;
+import com.intellij.psi.scope.PsiScopeProcessor;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.util.IncorrectOperationException;
+import org.intellij.plugins.relaxNG.compact.RncElementTypes;
+import org.intellij.plugins.relaxNG.compact.psi.RncElement;
+import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
+import org.intellij.plugins.relaxNG.model.CommonElement;
+import org.jetbrains.annotations.NotNull;
+
+public abstract class RncElementImpl extends ASTWrapperPsiElement implements RncElement, CommonElement<RncElement> {
+  private static final TokenSet GRAMMAR_CONTENT = TokenSet.create(
+          RncElementTypes.START,
+          RncElementTypes.DEFINE, RncElementTypes.DIV,
+          RncElementTypes.GRAMMAR_PATTERN, RncElementTypes.PATTERN,
+          RncElementTypes.INCLUDE
+  );
+
+  public RncElementImpl(ASTNode node) {
+    super(node);
+  }
+
+  public String toString() {
+    return getNode().getElementType().toString();
+  }
+
+  @Override
+  public void delete() throws IncorrectOperationException {
+    getNode().getTreeParent().removeChild(getNode());
+  }
+
+  @Override
+  public PsiElement add(@NotNull PsiElement psiElement) throws IncorrectOperationException {
+    final ASTNode astNode = psiElement.getNode();
+    assert astNode != null;
+
+    getNode().addChild(astNode);
+    final PsiElement r = getNode().getLastChildNode().getPsi();
+
+    assert r.getClass() == psiElement.getClass();
+    return r;
+  }
+
+  @Override
+  public PsiElement addBefore(@NotNull PsiElement psiElement, PsiElement anchor) throws IncorrectOperationException {
+    final ASTNode child = psiElement.getNode();
+    assert child != null;
+
+    final ASTNode anchorNode = anchor.getNode();
+    assert anchorNode != null;
+
+    getNode().addChild(child, anchorNode);
+    final PsiElement r = anchorNode.getTreePrev().getPsi();
+
+    assert r.getClass() == psiElement.getClass();
+    return r;
+  }
+
+  @Override
+  public PsiElement addAfter(@NotNull PsiElement element, PsiElement anchor) throws IncorrectOperationException {
+    final ASTNode astNode = anchor.getNode();
+    assert astNode != null;
+
+    final ASTNode node = astNode.getTreeNext();
+    if (node == null) {
+      return add(element);
+    } else {
+      return addBefore(element, node.getPsi());
+    }
+  }
+
+  public final void accept(@NotNull PsiElementVisitor visitor) {
+    if (visitor instanceof RncElementVisitor) {
+      accept((RncElementVisitor)visitor);
+    } else {
+      visitor.visitElement(this);
+    }
+  }
+
+  @Override
+  public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState substitutor, PsiElement lastParent, @NotNull PsiElement place) {
+    final ASTNode astNode = getNode();
+
+    final ASTNode[] children = astNode.getChildren(GRAMMAR_CONTENT);
+    processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
+    for (ASTNode element : children) {
+      if (!processor.execute(element.getPsi(), substitutor)) {
+        return false;
+      }
+    }
+    processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, null);
+    return true;
+  }
+
+  public abstract void accept(@NotNull RncElementVisitor visitor);
+
+  public void accept(Visitor visitor) {
+    visitor.visitElement(this);
+  }
+
+  public void acceptChildren(Visitor visitor) {
+    final PsiElement[] elements = getChildren();
+    //noinspection ForLoopReplaceableByForEach
+    for (int i = 0; i < elements.length; i++) {
+      PsiElement element = elements[i];
+      if (element instanceof CommonElement) {
+        ((CommonElement)element).accept(visitor);
+      }
+    }
+  }
+
+  public RncElement getPsiElement() {
+    return this;
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncExternalRefImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncExternalRefImpl.java
new file mode 100644
index 0000000..51ec6ad
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncExternalRefImpl.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.lang.ASTNode;
+import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
+import org.intellij.plugins.relaxNG.compact.psi.RncExternalRef;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 10.08.2007
+ */
+public class RncExternalRefImpl extends RncFileReferenceImpl implements RncExternalRef {
+  public RncExternalRefImpl(ASTNode node) {
+    super(node);
+  }
+
+  public void accept(@NotNull RncElementVisitor visitor) {
+    visitor.visitExternalRef(this);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncFileImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncFileImpl.java
new file mode 100644
index 0000000..497c74f
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncFileImpl.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.extapi.psi.PsiFileBase;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.ResolveState;
+import com.intellij.psi.scope.PsiScopeProcessor;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.search.ProjectScope;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import org.intellij.plugins.relaxNG.compact.RncElementTypes;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+import org.intellij.plugins.relaxNG.compact.RngCompactLanguage;
+import org.intellij.plugins.relaxNG.compact.psi.RncDecl;
+import org.intellij.plugins.relaxNG.compact.psi.RncFile;
+import org.intellij.plugins.relaxNG.compact.psi.RncGrammar;
+import org.jetbrains.annotations.NotNull;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 01.08.2007
+*/
+public class RncFileImpl extends PsiFileBase implements RncFile, XmlFile {
+  private static final TokenSet DECLS = TokenSet.create(RncElementTypes.NS_DECL, RncElementTypes.DATATYPES_DECL);
+
+  public RncFileImpl(FileViewProvider viewProvider) {
+    super(viewProvider, RngCompactLanguage.INSTANCE);
+  }
+
+  @NotNull
+  public FileType getFileType() {
+    return RncFileType.getInstance();
+  }
+
+  @NotNull
+  public XmlDocument getDocument() {
+    // this needs to be a seperate child element because of com.intellij.util.xml.impl.ExternalChangeProcessor.visitDocumentChanged()
+    final XmlDocument document = findChildByClass(XmlDocument.class);
+    assert document != null;
+    return document;
+  }
+
+  @Override
+  public XmlTag getRootTag() {
+    return getDocument().getRootTag();
+  }
+
+  @Override
+  public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState substitutor, PsiElement lastParent, @NotNull PsiElement place) {
+    //processor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, this);
+    try {
+      final ASTNode docNode = getDocument().getNode();
+      assert docNode != null;
+      final ASTNode[] nodes = docNode.getChildren(DECLS);
+      for (ASTNode node : nodes) {
+        if (!processor.execute(node.getPsi(), substitutor)) {
+          return false;
+        }
+      }
+
+      final RncGrammar grammar = getGrammar();
+      if (grammar != null) {
+        return grammar.processDeclarations(processor, substitutor, lastParent, place);
+      } else {
+        return true;
+      }
+    } finally {
+      //processor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, null);
+    }
+  }
+
+  @Override
+  public PsiElement add(@NotNull PsiElement element) throws IncorrectOperationException {
+    return getDocument().add(element);
+  }
+
+  @Override
+  public PsiElement addAfter(@NotNull PsiElement element, PsiElement anchor) throws IncorrectOperationException {
+    return getDocument().addAfter(element, anchor);
+  }
+
+  @Override
+  public PsiElement addBefore(@NotNull PsiElement element, PsiElement anchor) throws IncorrectOperationException {
+    return getDocument().addBefore(element, anchor);
+  }
+
+  public boolean processElements(PsiElementProcessor processor, PsiElement place) {
+    return false;
+  }
+
+  public GlobalSearchScope getFileResolveScope() {
+    return ProjectScope.getAllScope(getProject());
+  }
+
+  @Override
+  public boolean ignoreReferencedElementAccessibility() {
+    return false;
+  }
+
+  @Override
+  public String toString() {
+    return getClass().getSimpleName() + ":" + getName();
+  }
+
+  public RncDecl[] getDeclarations() {
+    return ((RncDocument)getDocument()).findChildrenByClass(RncDecl.class);
+  }
+
+  public RncGrammar getGrammar() {
+    final XmlDocument document = getDocument();
+    return ((RncDocument)document).getGrammar();
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncFileReferenceImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncFileReferenceImpl.java
new file mode 100644
index 0000000..f5c3419
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncFileReferenceImpl.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.ResolveState;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceSet;
+import com.intellij.psi.scope.PsiScopeProcessor;
+import com.intellij.xml.util.XmlUtil;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.intellij.plugins.relaxNG.compact.psi.RncFile;
+import org.intellij.plugins.relaxNG.compact.psi.RncFileReference;
+import org.intellij.plugins.relaxNG.compact.psi.util.EscapeUtil;
+import org.intellij.plugins.relaxNG.references.FileReferenceUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 29.08.2007
+ */
+abstract class RncFileReferenceImpl extends RncElementImpl implements RncFileReference {
+  public RncFileReferenceImpl(ASTNode node) {
+    super(node);
+  }
+
+  @NotNull
+  @Override
+  @SuppressWarnings({ "SSBasedInspection" })
+  public PsiReference[] getReferences() {
+    final ASTNode literal = getNode().findChildByType(RncTokenTypes.LITERAL);
+    if (literal == null) return PsiReference.EMPTY_ARRAY;
+
+    final String s = literal.getText();
+    final FileReferenceSet set =
+            new FileReferenceSet(s.substring(1, s.length() - 1), this,
+                    getReferenceRange().getStartOffset(),
+                    null, true, false);
+
+    return FileReferenceUtil.restrict(set, FileReferenceUtil.byType(RncFileType.getInstance()));
+  }
+
+  public RncFile getReferencedFile() {
+    final String href = getFileReference();
+    if (href != null) {
+      final PsiFile file = XmlUtil.findRelativeFile(href, getContainingFile());
+      if (file instanceof RncFile) {
+        return (RncFile)file;
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public String getFileReference() {
+    final ASTNode element = getNode().findChildByType(RncTokenTypes.LITERAL);
+    if (element == null) return null;
+    final String s = EscapeUtil.unescapeText(element);
+    return s.substring(1, s.length() - 1);
+  }
+
+  public TextRange getReferenceRange() {
+    final ASTNode literal = getNode().findChildByType(RncTokenTypes.LITERAL);
+    if (literal == null) return TextRange.from(0, 0);
+    final int startInElement = literal.getStartOffset() - getTextOffset() + 1;
+    return TextRange.from(startInElement, literal.getTextLength() - 2);
+  }
+
+  @Override
+  public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState substitutor, PsiElement lastParent, @NotNull PsiElement place) {
+    final FollowFileHint hint = processor.getHint(FollowFileHint.KEY);
+    final RncFile file = getReferencedFile();
+    if (file != null && hint != null && hint.doFollow(file)) {
+      file.processDeclarations(processor, substitutor, lastParent, place);
+    }
+    return true;
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncGrammarImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncGrammarImpl.java
new file mode 100644
index 0000000..ab0987f
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncGrammarImpl.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiElement;
+import com.intellij.util.IncorrectOperationException;
+import org.intellij.plugins.relaxNG.compact.RncElementTypes;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
+import org.intellij.plugins.relaxNG.compact.psi.RncGrammar;
+import org.intellij.plugins.relaxNG.compact.psi.RncPattern;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 13.08.2007
+ */
+public class RncGrammarImpl extends RncElementImpl implements RncGrammar {
+  public RncGrammarImpl(ASTNode node) {
+    super(node);
+  }
+
+  public void accept(@NotNull RncElementVisitor visitor) {
+    visitor.visitGrammar(this);
+  }
+
+  public void accept(Visitor visitor) {
+    visitor.visitGrammar(this);
+  }
+
+  public RncPattern getStart() {
+    final ASTNode node = getNode().findChildByType(RncElementTypes.START);
+    return node != null ? (RncPattern)node.getPsi() : null;
+  }
+
+  @Override
+  public PsiElement add(@NotNull PsiElement psiElement) throws IncorrectOperationException {
+    final PsiElement rbrace = findChildByType(RncTokenTypes.RBRACE);
+    // TODO: fix block psi
+    if (rbrace != null) {
+      return addBefore(psiElement, rbrace);
+    }
+    return super.add(psiElement);
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncIncludeImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncIncludeImpl.java
new file mode 100644
index 0000000..7c967bbc
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncIncludeImpl.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.ResolveState;
+import com.intellij.psi.scope.PsiScopeProcessor;
+import org.intellij.plugins.relaxNG.compact.psi.RncDefine;
+import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
+import org.intellij.plugins.relaxNG.compact.psi.RncInclude;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 10.08.2007
+ */
+public class RncIncludeImpl extends RncFileReferenceImpl implements RncInclude {
+  public RncIncludeImpl(ASTNode node) {
+    super(node);
+  }
+
+  @Override
+  public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState substitutor, PsiElement lastParent, @NotNull PsiElement place) {
+    final PsiElement[] children = getChildren();
+    for (PsiElement child : children) {
+      if (!processor.execute(child, substitutor)) {
+        return false;
+      }
+    }
+    return super.processDeclarations(processor, substitutor, lastParent, place);
+  }
+
+  public void accept(@NotNull RncElementVisitor visitor) {
+    visitor.visitInclude(this);
+  }
+
+  @Override
+  public void accept(Visitor visitor) {
+    visitor.visitInclude(this);
+  }
+
+  public PsiFile getInclude() {
+    return getReferencedFile();
+  }
+
+  @NotNull
+  public RncDefine[] getOverrides() {
+    // TODO: DIVs?
+    return findChildrenByClass(RncDefine.class);
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncNameImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncNameImpl.java
new file mode 100644
index 0000000..1c4b2f6
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncNameImpl.java
@@ -0,0 +1,278 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
+import com.intellij.codeInsight.daemon.QuickFixProvider;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInsight.lookup.LookupItem;
+import com.intellij.codeInsight.template.*;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.*;
+import com.intellij.psi.codeStyle.CodeStyleManager;
+import com.intellij.psi.scope.BaseScopeProcessor;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import org.intellij.plugins.relaxNG.compact.RncElementTypes;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.intellij.plugins.relaxNG.compact.psi.*;
+import org.intellij.plugins.relaxNG.compact.psi.util.EscapeUtil;
+import org.intellij.plugins.relaxNG.compact.psi.util.RenameUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 14.08.2007
+ */
+public class RncNameImpl extends RncElementImpl implements RncName, PsiReference,
+        EmptyResolveMessageProvider, QuickFixProvider<RncNameImpl> {
+  private enum Kind {
+    NAMESPACE, DATATYPES
+  }
+  private final Kind myKind;
+
+  public RncNameImpl(ASTNode node) {
+    super(node);
+
+    final IElementType parent = node.getTreeParent().getElementType();
+    if (parent == RncElementTypes.DATATYPE_PATTERN) {
+      myKind = Kind.DATATYPES;
+    } else {
+      myKind = Kind.NAMESPACE;
+    }
+  }
+
+  @Nullable
+  public String getPrefix() {
+    final String[] parts = EscapeUtil.unescapeText(getNode()).split(":", 2);
+    return parts.length == 2 ? parts[0] : null;
+  }
+
+  @NotNull
+  public String getLocalPart() {
+    final String[] parts = EscapeUtil.unescapeText(getNode()).split(":", 2);
+    return parts.length == 1 ? parts[0] : parts[1];
+  }
+
+  @Override
+  public void accept(@NotNull RncElementVisitor visitor) {
+    visitor.visitName(this);
+  }
+
+  @Override
+  public PsiReference getReference() {
+    return getPrefix() == null ? null : this;
+  }
+
+  public PsiElement getElement() {
+    return this;
+  }
+
+  public TextRange getRangeInElement() {
+    return TextRange.from(0, getText().indexOf(':'));
+  }
+
+  @Nullable
+  public PsiElement resolve() {
+    final MyResolver resolver = new MyResolver(getPrefix(), myKind);
+    getContainingFile().processDeclarations(resolver, ResolveState.initial(), this, this);
+    return resolver.getResult();
+  }
+
+  @NotNull
+  public String getCanonicalText() {
+    return getRangeInElement().substring(getText());
+  }
+
+  public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
+    final ASTNode node = getNode();
+    final ASTNode child = RenameUtil.createPrefixedNode(getManager(), newElementName, getLocalPart());
+    node.getTreeParent().replaceChild(node, child);
+    return child.getPsi();
+  }
+
+  public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
+    throw new UnsupportedOperationException();
+  }
+
+  public boolean isReferenceTo(PsiElement element) {
+    return element instanceof RncElement && Comparing.equal(resolve(), element);
+  }
+
+  @NotNull
+  public Object[] getVariants() {
+    return ArrayUtil.EMPTY_OBJECT_ARRAY;
+  }
+
+  public boolean isSoft() {
+    final String prefix = getPrefix();
+    return "xsd".equals(prefix) || "xml".equals(prefix);
+  }
+
+  public String getUnresolvedMessagePattern() {
+    return "Unresolved namespace prefix ''{0}''";
+  }
+
+  public void registerQuickfix(HighlightInfo info, final RncNameImpl reference) {
+    if (reference.getPrefix() == null) return; // huh?
+
+    QuickFixAction.registerQuickFixAction(info, new CreateDeclFix(reference));
+  }
+
+  private static class MyResolver extends BaseScopeProcessor {
+    private final String myPrefix;
+    private final Kind myKind;
+    private PsiElement myResult;
+
+    public MyResolver(String prefix, Kind kind) {
+      myPrefix = prefix;
+      myKind = kind;
+    }
+
+    public boolean execute(@NotNull PsiElement element, ResolveState substitutor) {
+      final ASTNode node = element.getNode();
+      if (node == null) return true;
+
+      if (!(element instanceof RncDecl)) {
+        return false;
+      }
+
+      final IElementType type = node.getElementType();
+      if (myKind == Kind.NAMESPACE && type == RncElementTypes.NS_DECL) {
+        if (checkDecl(element)) return false;
+      } else if (myKind == Kind.DATATYPES && type == RncElementTypes.DATATYPES_DECL) {
+        if (checkDecl(element)) return false;
+      }
+
+      return true;
+    }
+
+    private boolean checkDecl(PsiElement element) {
+      if (myPrefix.equals(((RncDecl)element).getPrefix())) {
+        myResult = element;
+        return true;
+      }
+      return false;
+    }
+
+    public PsiElement getResult() {
+      return myResult;
+    }
+  }
+
+  public static class CreateDeclFix implements IntentionAction {
+    private final RncNameImpl myReference;
+
+    public CreateDeclFix(RncNameImpl reference) {
+      myReference = reference;
+    }
+
+    @NotNull
+      public String getText() {
+      return getFamilyName() + " '" + myReference.getPrefix() + "'";
+    }
+
+    @NotNull
+      public String getFamilyName() {
+      return "Create " + myReference.myKind.name().toLowerCase() + " declaration";
+    }
+
+    public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
+      return myReference.isValid();
+    }
+
+    public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
+      final String prefix = myReference.getPrefix();
+      final RncFile psiFile = (RncFile)PsiFileFactory.getInstance(myReference.getProject()).createFileFromText("dummy.rnc", myReference.myKind.name().toLowerCase() + " " + prefix + " = \"###\"");
+      final RncFile rncFile = (RncFile)myReference.getContainingFile();
+      final RncDecl[] declarations = rncFile.getDeclarations();
+      final RncDecl decl = psiFile.getDeclarations()[0];
+      final RncDecl e;
+      if (declarations.length > 0) {
+        e = (RncDecl)rncFile.addAfter(decl, declarations[declarations.length - 1]);
+      } else {
+        final RncGrammar rncGrammar = rncFile.getGrammar();
+        if (rncGrammar != null) {
+          e = (RncDecl)rncFile.addBefore(decl, rncGrammar);
+        } else {
+          e = (RncDecl)rncFile.add(decl);
+        }
+      }
+
+      final ASTNode blockNode = e.getParent().getNode();
+      assert blockNode != null;
+
+      final ASTNode newNode = e.getNode();
+      assert newNode != null;
+
+      CodeStyleManager.getInstance(e.getManager().getProject()).reformatNewlyAddedElement(blockNode, newNode);
+
+      final SmartPsiElementPointer<RncDecl> p = SmartPointerManager.getInstance(project).createLazyPointer(e);
+      PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(editor.getDocument());
+
+      final RncDecl d = p.getElement();
+      assert d != null;
+
+      final PsiElement literal = d.getLastChild();
+      assert literal != null;
+
+      final ASTNode literalNode = literal.getNode();
+      assert literalNode != null;
+
+      assert literalNode.getElementType() == RncTokenTypes.LITERAL;
+
+      final int offset = literal.getTextRange().getStartOffset();
+      editor.getDocument().deleteString(literal.getTextRange().getStartOffset(), literal.getTextRange().getEndOffset());
+
+      final TemplateManager manager = TemplateManager.getInstance(project);
+      final Template t = manager.createTemplate("", "");
+      t.addTextSegment("\"");
+      final Expression expression = new Expression() {
+        public Result calculateResult(ExpressionContext context) {
+          return new TextResult("");
+        }
+
+        public Result calculateQuickResult(ExpressionContext context) {
+          return calculateResult(context);
+        }
+
+        public LookupItem[] calculateLookupItems(ExpressionContext context) {
+          return LookupItem.EMPTY_ARRAY;
+        }
+      };
+      t.addVariable("uri", expression, expression, true);
+      t.addTextSegment("\"");
+      t.addEndVariable();
+
+      editor.getCaretModel().moveToOffset(offset);
+      manager.startTemplate(editor, t);
+    }
+
+    public boolean startInWriteAction() {
+      return true;
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncNsDeclImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncNsDeclImpl.java
new file mode 100644
index 0000000..4de51d4
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncNsDeclImpl.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.lang.ASTNode;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.intellij.plugins.relaxNG.compact.psi.RncNsDecl;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 14.08.2007
+ */
+public class RncNsDeclImpl extends RncDeclImpl implements RncNsDecl {
+  public RncNsDeclImpl(ASTNode node) {
+    super(node);
+  }
+
+  public boolean isDefault() {
+    return getNode().findChildByType(RncTokenTypes.KEYWORD_DEFAULT) != null;
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncParentRefImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncParentRefImpl.java
new file mode 100644
index 0000000..bd31543
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncParentRefImpl.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.util.PsiTreeUtil;
+import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
+import org.intellij.plugins.relaxNG.compact.psi.RncGrammar;
+import org.intellij.plugins.relaxNG.compact.psi.RncParentRef;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 11.08.2007
+ */
+public class RncParentRefImpl extends RncRefImpl implements RncParentRef {
+  public RncParentRefImpl(ASTNode node) {
+    super(node);
+  }
+
+  @Override // super asserts nameNode != null
+  public String getReferencedName() {
+    final ASTNode node = findNameNode();
+    return node == null ? null : super.getReferencedName();
+  }
+
+  @Override
+  public void accept(@NotNull RncElementVisitor visitor) {
+    visitor.visitParentRef(this);
+  }
+
+  @Override
+  public int getTextOffset() {
+    final ASTNode astNode = findNameNode();
+    return astNode != null ? astNode.getStartOffset() : getTextRange().getStartOffset();
+  }
+
+  @Override
+  @Nullable
+  public PsiReference getReference() {
+    return new PatternReference(this) {
+      @Override
+      protected RncGrammar getScope() {
+        final PsiElement scope = PsiTreeUtil.getParentOfType(getElement(), RncGrammar.class, true, PsiFile.class);
+        if (scope == null) {
+          return null;
+        }
+        return PsiTreeUtil.getParentOfType(scope, RncGrammar.class, true, PsiFile.class);
+      }
+    };
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncRefImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncRefImpl.java
new file mode 100644
index 0000000..c190240
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncRefImpl.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.impl;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiReference;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.intellij.plugins.relaxNG.compact.psi.RncDefine;
+import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
+import org.intellij.plugins.relaxNG.compact.psi.RncRef;
+import org.intellij.plugins.relaxNG.compact.psi.util.EscapeUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 11.08.2007
+ */
+public class RncRefImpl extends RncElementImpl implements RncRef {
+  public RncRefImpl(ASTNode node) {
+    super(node);
+  }
+
+  @Nullable
+  public RncDefine getPattern() {
+    final PsiReference ref = getReference();
+    // TODO: honor combine & return virtual element if multiResolve().length > 0
+    return ref instanceof PatternReference ? (RncDefine)ref.resolve() : null;
+  }
+
+  public String getReferencedName() {
+    final ASTNode node = findNameNode();
+    assert node != null;
+    return EscapeUtil.unescapeText(node);
+  }
+
+  protected ASTNode findNameNode() {
+    return getNode().findChildByType(RncTokenTypes.IDENTIFIERS);
+  }
+
+  @Override
+  public void accept(@NotNull RncElementVisitor visitor) {
+    visitor.visitRef(this);
+  }
+
+  public void accept(Visitor visitor) {
+    visitor.visitRef(this);
+  }
+
+  @Override
+  public PsiReference getReference() {
+    return new PatternReference(this);
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/util/EscapeUtil.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/util/EscapeUtil.java
new file mode 100644
index 0000000..69a031b
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/util/EscapeUtil.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.util;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiElement;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 13.08.2007
+ */
+public class EscapeUtil {
+  @SuppressWarnings({ "SSBasedInspection" })
+  public static String unescapeText(@NotNull PsiElement element) {
+    final ASTNode node = element.getNode();
+    if (node != null) {
+      return unescapeText(node);
+    } else {
+      return element.getText();
+    }
+  }
+
+  @SuppressWarnings({ "SSBasedInspection" })
+  public static String unescapeText(@NotNull ASTNode node) {
+    final String text = node.getText();
+
+    // TODO: unescape \x{xx} sequences
+
+    if (node.getElementType() == RncTokenTypes.ESCAPED_IDENTIFIER) {
+      assert text.charAt(0) == '\\';
+      return text.length() > 1 ? text.substring(1) : "";
+    } else {
+      return text;
+    }
+  }
+
+  public static String parseLiteralValue(ASTNode ns) {
+    return unquote(unescapeText(ns));
+  }
+
+  private static String unquote(String s) {
+    if (s.length() >= 6 && s.charAt(0) == s.charAt(1)) {
+      s = s.replace('\u0000', '\n');
+      return s.substring(3, s.length() - 3);
+    } else {
+      return s.substring(1, s.length() - 1);
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/util/PsiFunction.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/util/PsiFunction.java
new file mode 100644
index 0000000..ce3a96a
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/util/PsiFunction.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.util;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiElement;
+import com.intellij.util.NotNullFunction;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 13.08.2007
+*/
+public final class PsiFunction implements NotNullFunction<ASTNode, PsiElement> {
+  public static final PsiFunction INSTANCE = new PsiFunction();
+
+  @NotNull
+  public PsiElement fun(ASTNode astNode) {
+    return astNode.getPsi();
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/util/RenameUtil.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/util/RenameUtil.java
new file mode 100644
index 0000000..5261d48
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/util/RenameUtil.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.compact.psi.util;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiFileFactory;
+import com.intellij.psi.PsiManager;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.HashSet;
+import com.sun.org.apache.xerces.internal.util.XML11Char;
+import org.intellij.plugins.relaxNG.compact.RncElementTypes;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
+import org.intellij.plugins.relaxNG.compact.psi.RncFile;
+import org.intellij.plugins.relaxNG.compact.psi.RncGrammar;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 14.08.2007
+ */
+public class RenameUtil {
+
+  private static Set<String> ourRncKeywords = new HashSet<String>();
+
+  static {
+    Collections.addAll(ourRncKeywords, "attribute", "default", "datatypes", "div", "element", "empty", "external",
+                       "grammar", "include", "inherit", "list", "mixed", "namespace", "notAllowed", "parent", "start",
+                       "string", "text", "token");
+  }
+
+  private RenameUtil() {
+  }
+
+  @NotNull
+  public static ASTNode createIdentifierNode(PsiManager manager, String name) throws IncorrectOperationException {
+    if (isKeyword(name)) {
+      name = "\\" + name;
+    } else if (!isIdentifier(name)) {
+      throw new IncorrectOperationException("Illegal identifier: " + name);
+    }
+
+    final PsiFileFactory f = PsiFileFactory.getInstance(manager.getProject());
+    final RncFile file = (RncFile)f.createFileFromText("dummy.rnc", RncFileType.getInstance(), name + " = bar");
+    final ASTNode astNode = findFirstGrammarNode(file);
+    final ASTNode newNode = astNode.findChildByType(RncTokenTypes.IDENTIFIERS);
+    assert newNode != null;
+    return newNode;
+  }
+
+  public static boolean isIdentifier(String name) {
+    //return isTokenOfType(manager, name, RncTokenTypes.IDENTIFIER_OR_KEYWORD);
+    if (name == null) {
+      return false;
+    }
+    if (XML11Char.isXML11ValidNCName(name)) {
+      return true;
+    }
+    return name.length() >= 2 && name.startsWith("\\") && XML11Char.isXML11ValidNCName(name.substring(1));
+  }
+
+  public static boolean isKeyword(String name) {
+    //return isTokenOfType(manager, name, RncTokenTypes.KEYWORDS);
+    return ourRncKeywords.contains(name);
+  }
+
+  /*private static boolean isTokenOfType(PsiManager manager, String name, TokenSet set) {
+    final ParserDefinition definition = LanguageParserDefinitions.INSTANCE.forLanguage(RngCompactLanguage.INSTANCE);
+    assert definition != null;
+    final Lexer lexer = definition.createLexer(manager.getProject());
+
+    lexer.start(name, 0, name.length(), 0);
+    final IElementType t = lexer.getTokenType();
+    lexer.advance();
+    return lexer.getTokenType() == null && set.contains(t);
+  }*/
+
+  public static ASTNode createPrefixedNode(PsiManager manager, String prefix, String localPart) {
+    final PsiFileFactory f = PsiFileFactory.getInstance(manager.getProject());
+    final RncFile file = (RncFile)f.createFileFromText("dummy.rnc", RncFileType.getInstance(), "element " + prefix + ":" + localPart + " { text }");
+
+    final ASTNode node = findFirstGrammarNode(file);
+    final ASTNode nameClassNode = node.findChildByType(RncElementTypes.NAME_CLASS);
+    assert nameClassNode != null;
+
+    final ASTNode astNode = nameClassNode.findChildByType(RncElementTypes.NAME);
+    assert astNode != null;
+    return astNode;
+  }
+
+  @NotNull
+  private static ASTNode findFirstGrammarNode(RncFile file) {
+    final RncGrammar grammar = file.getGrammar();
+    assert grammar != null;
+    final ASTNode grammarNode = grammar.getNode();
+    assert grammarNode != null;
+    final ASTNode astNode = grammarNode.getFirstChildNode();
+    assert astNode != null;
+    return astNode;
+  }
+
+  public static ASTNode createLiteralNode(PsiManager manager, String content) {
+    final PsiFileFactory f = PsiFileFactory.getInstance(manager.getProject());
+    final RncFile file = (RncFile)f.createFileFromText("dummy.rnc", RncFileType.getInstance(), "include \"" + content + "\"");
+
+    final ASTNode include = findFirstGrammarNode(file);
+    final ASTNode literal = include.findChildByType(RncTokenTypes.LITERAL);
+    assert literal != null;
+    return literal;
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceConfig.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceConfig.java
new file mode 100644
index 0000000..243ea9e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceConfig.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.config;
+
+import com.intellij.openapi.components.ProjectComponent;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 26.11.2007
+ */
+public abstract class NoNamespaceConfig implements ProjectComponent {
+  @Nullable
+  public abstract String getMapping(@NotNull PsiFile file);
+  public abstract VirtualFile getMappedFile(@NotNull PsiFile file);
+
+  public abstract void setMapping(@NotNull PsiFile file, @Nullable String location);
+
+  public static NoNamespaceConfig getInstance(@NotNull Project project) {
+    return project.getComponent(NoNamespaceConfig.class);
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceConfigImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceConfigImpl.java
new file mode 100644
index 0000000..d36c4b7
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceConfigImpl.java
@@ -0,0 +1,175 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.config;
+
+import com.intellij.openapi.components.PersistentStateComponent;
+import com.intellij.openapi.components.State;
+import com.intellij.openapi.components.Storage;
+import com.intellij.openapi.components.StoragePathMacros;
+import com.intellij.openapi.editor.HectorComponentPanel;
+import com.intellij.openapi.editor.HectorComponentPanelsProvider;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.pointers.VirtualFilePointer;
+import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.xmlb.annotations.MapAnnotation;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 25.11.2007
+ */
+@State(
+        name = "NoNamespaceConfig.Mappings",
+        storages = { @Storage(
+                file = StoragePathMacros.WORKSPACE_FILE) })
+class NoNamespaceConfigImpl extends NoNamespaceConfig implements PersistentStateComponent<NoNamespaceConfigImpl.Mappings> {
+
+  private final Map<VirtualFilePointer, VirtualFilePointer> myMappings = new HashMap<VirtualFilePointer, VirtualFilePointer>();
+  private final Project myProject;
+
+  NoNamespaceConfigImpl(Project project) {
+    myProject = project;
+  }
+
+  private VirtualFilePointer getMappedPointer(@NotNull PsiFile file) {
+    final VirtualFile virtualFile = file.getVirtualFile();
+    if (virtualFile == null) return null;
+
+    final String url = virtualFile.getUrl();
+    for (VirtualFilePointer pointer : myMappings.keySet()) {
+      if (url.equals(pointer.getUrl())) {
+        return myMappings.get(pointer);
+      }
+    }
+    return null;
+  }
+
+  @Nullable
+  public String getMapping(@NotNull PsiFile file) {
+    final VirtualFilePointer pointer = getMappedPointer(file);
+    return pointer != null ? pointer.getUrl() : null;
+  }
+
+  public VirtualFile getMappedFile(@NotNull PsiFile file) {
+    final VirtualFilePointer url = getMappedPointer(file);
+    return url != null ? url.getFile() : null;
+  }
+
+  public void setMapping(@NotNull PsiFile file, String location) {
+    final VirtualFile virtualFile = file.getVirtualFile();
+    assert virtualFile != null;
+
+    final String url = virtualFile.getUrl();
+    final VirtualFilePointerManager manager = VirtualFilePointerManager.getInstance();
+    for (VirtualFilePointer pointer : myMappings.keySet()) {
+      if (url.equals(pointer.getUrl())) {
+        if (location == null) {
+          myMappings.remove(pointer);
+          return;
+        } else if (!location.equals(myMappings.get(pointer).getUrl())) {
+          myMappings.remove(pointer);
+          myMappings.put(pointer, manager.create(location, myProject, null));
+          return;
+        }
+      }
+    }
+
+    if (location != null) {
+      myMappings.put(manager.create(url, myProject, null), manager.create(location, myProject, null));
+    }
+  }
+
+  public void initComponent() {
+  }
+
+  public void disposeComponent() {
+  }
+
+  @NotNull
+  public String getComponentName() {
+    return "RELAX-NG.NoNamespaceConfig";
+  }
+
+  public void projectOpened() {
+  }
+
+  public void projectClosed() {
+    reset();
+  }
+
+  public Mappings getState() {
+    final HashMap<String, String> map = new HashMap<String, String>();
+    for (Map.Entry<VirtualFilePointer, VirtualFilePointer> entry : myMappings.entrySet()) {
+      map.put(entry.getKey().getUrl(), entry.getValue().getUrl());
+    }
+    return new Mappings(map);
+  }
+
+  public void loadState(Mappings state) {
+    reset();
+
+    final VirtualFilePointerManager manager = VirtualFilePointerManager.getInstance();
+    final Map<String, String> map = state.myMappings;
+    for (String file : map.keySet()) {
+      myMappings.put(manager.create(file, myProject, null), manager.create(map.get(file), myProject, null));
+    }
+  }
+
+  private void reset() {
+    myMappings.clear();
+  }
+
+  @SuppressWarnings({ "CanBeFinal", "UnusedDeclaration" })
+  public static class Mappings {
+    @MapAnnotation(surroundWithTag = false, entryTagName = "mapping", keyAttributeName = "file", valueAttributeName = "schema")
+    public Map<String, String> myMappings;
+
+    public Mappings() {
+      myMappings = new HashMap<String, String>();
+    }
+
+    Mappings(Map<String, String> map) {
+      myMappings = map;
+    }
+  }
+
+  public static class HectorProvider implements HectorComponentPanelsProvider {
+    @Nullable
+    public HectorComponentPanel createConfigurable(@NotNull PsiFile file) {
+      if (file instanceof XmlFile) {
+        try {
+          final XmlTag rootTag = ((XmlFile)file).getDocument().getRootTag();
+          if (rootTag.getNamespace().length() == 0) {
+            return new NoNamespaceConfigPanel(NoNamespaceConfig.getInstance(file.getProject()), file);
+          }
+        } catch (NullPointerException e) {
+          return null;
+        }
+      }
+      return null;
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceConfigPanel.form b/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceConfigPanel.form
new file mode 100644
index 0000000..eb8ba9c
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceConfigPanel.form
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.intellij.plugins.relaxNG.config.NoNamespaceConfigPanel">
+  <grid id="27dc6" binding="myRoot" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="20" y="20" width="687" height="96"/>
+    </constraints>
+    <properties/>
+    <clientProperties>
+      <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithoutIndent"/>
+    </clientProperties>
+    <border type="none" title="RELAX-NG Schema Association"/>
+    <children>
+      <component id="9c3ce" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="mySchemaFile">
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="1" indent="0" use-parent-layout="false">
+            <minimum-size width="160" height="-1"/>
+          </grid>
+        </constraints>
+        <properties/>
+      </component>
+      <vspacer id="e4455">
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+        </constraints>
+      </vspacer>
+    </children>
+  </grid>
+  <inspectionSuppressions>
+    <suppress inspection="NoLabelFor" id="9c3ce"/>
+  </inspectionSuppressions>
+</form>
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceConfigPanel.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceConfigPanel.java
new file mode 100644
index 0000000..690dac4
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceConfigPanel.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.config;
+
+import com.intellij.openapi.actionSystem.LangDataKeys;
+import com.intellij.openapi.editor.HectorComponentPanel;
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.ui.ComponentWithBrowseButton;
+import com.intellij.openapi.ui.TextComponentAccessor;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.io.File;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 25.11.2007
+ */
+class NoNamespaceConfigPanel extends HectorComponentPanel {
+  private final NoNamespaceConfig myConfig;
+  private final PsiFile myFile;
+  private final String myMapping;
+
+  private TextFieldWithBrowseButton mySchemaFile;
+  private JPanel myRoot;
+  private boolean myDialogOpen;
+
+  NoNamespaceConfigPanel(NoNamespaceConfig noNamespaceConfig, PsiFile file) {
+    myConfig = noNamespaceConfig;
+    myFile = file;
+    myMapping = myConfig.getMapping(file);
+
+    final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, false, false, false, false) {
+      public boolean isFileSelectable(VirtualFile file) {
+        final boolean b = super.isFileSelectable(file);
+        if (b) {
+          final FileType type = file.getFileType();
+          if (type != StdFileTypes.XML) {
+            return type == RncFileType.getInstance();
+          }
+        }
+        return b;
+      }
+    };
+
+    final Project project = file.getProject();
+    final VirtualFile virtualFile = file.getVirtualFile();
+    if (virtualFile != null) {
+      final Module module = ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(virtualFile);
+      descriptor.putUserData(LangDataKeys.MODULE_CONTEXT, module);
+    }
+
+    // that's kind of a hack that ensures the Hector Panel stays open when selecting a file. otherwise it will close
+    // as soon as a file selected.
+    final ComponentWithBrowseButton.BrowseFolderActionListener<JTextField> actionListener =
+            new ComponentWithBrowseButton.BrowseFolderActionListener<JTextField>("Select Schema", "Select a RELAX-NG file to associate with the document",
+                    mySchemaFile, project, descriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT) {
+              public void actionPerformed(ActionEvent e) {
+                myDialogOpen = true;
+                try {
+                  super.actionPerformed(e);
+                } finally {
+                  myDialogOpen = false;
+                }
+              }
+            };
+
+    mySchemaFile.addActionListener(actionListener);
+  }
+
+  public boolean canClose() {
+    return super.canClose() && !myDialogOpen;
+  }
+
+  public JComponent createComponent() {
+    return myRoot;
+  }
+
+  public boolean isModified() {
+    final String s = mySchemaFile.getText();
+    final String m = myMapping != null ? myMapping : "";
+    return !s.equals(m);
+  }
+
+  public void apply() throws ConfigurationException {
+    final String s = getMapping();
+    if (s != null) {
+      myConfig.setMapping(myFile, s);
+    } else {
+      myConfig.setMapping(myFile, null);
+    }
+  }
+
+  private String getMapping() {
+    final String s = mySchemaFile.getText().trim();
+    return s.length() > 0 ? VfsUtil.pathToUrl(s.replace(File.separatorChar, '/')) : null;
+  }
+
+  public void reset() {
+    mySchemaFile.setText(myMapping != null ? VfsUtil.urlToPath(myMapping).replace('/', File.separatorChar) : "");
+  }
+
+  public void disposeUIResources() {
+    // doesn't help - updating the validation needs a hard modification
+//    DaemonCodeAnalyzer.getInstance(myFile.getProject()).restart();
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceSchemaProvider.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceSchemaProvider.java
new file mode 100644
index 0000000..db4054a
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/config/NoNamespaceSchemaProvider.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.config;
+
+import com.intellij.ide.highlighter.XmlFileType;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.xml.XmlSchemaProvider;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 22.11.2007
+*/
+public class NoNamespaceSchemaProvider extends XmlSchemaProvider {
+  @Nullable
+  public XmlFile getSchema(@NotNull @NonNls String url, @Nullable Module module, @NotNull PsiFile baseFile) {
+    if ("".equals(url)) {
+      final Project project = baseFile.getProject();
+      final VirtualFile file = NoNamespaceConfig.getInstance(project).getMappedFile(baseFile);
+      if (file == null) return null;
+      final PsiFile f = PsiManager.getInstance(project).findFile(file);
+      if (f instanceof XmlFile) {
+        return (XmlFile)f;
+      }
+    }
+    return null;
+  }
+
+  @Override
+  public boolean isAvailable(@NotNull XmlFile file) {
+    if (file.getFileType() != XmlFileType.INSTANCE) {
+      return false;
+    }
+    NoNamespaceConfig config = NoNamespaceConfig.getInstance(file.getProject());
+    return config != null && config.getMappedFile(file) != null;
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedDtdOptions.form b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedDtdOptions.form
new file mode 100644
index 0000000..20cba30
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedDtdOptions.form
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.intellij.plugins.relaxNG.convert.AdvancedDtdOptions">
+  <grid id="27dc6" binding="myRoot" layout-manager="GridLayoutManager" row-count="9" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="20" y="20" width="529" height="392"/>
+    </constraints>
+    <properties/>
+    <clientProperties>
+      <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+    </clientProperties>
+    <border type="none" title="DTD Input"/>
+    <children>
+      <component id="60570" class="javax.swing.JCheckBox" binding="myInlineAttlistCheckBox" default-binding="true">
+        <constraints>
+          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="&amp;inline-attlist"/>
+          <toolTipText value="Specifies not to generate definitions for attribute list declarations and instead move attributes declared in attribute list declarations into the definitions generated for element declarations. This is the default behavior when the output module is xsd. Otherwise, the default behaviour is as described in the -i no-inline-attlist parameter.  "/>
+        </properties>
+      </component>
+      <component id="ee970" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <labelFor value="4bcfc"/>
+          <text value="&amp;colon-replacement:"/>
+          <toolTipText value="Replaces colons in element names by chars when constructing the names of definitions used to represent the element declarations and attribute list declarations in the DTD. Trang generates a definition for each element declaration and attlist declaration in the DTD. The name of the definition is based on the name of the element. In RELAX NG, the names of definitions cannot contain colons. However, in the DTD, the element name may contain a colon. By default, Trang will first try to use the element names without prefixes. If this causes a conflict, it will instead replace the colon by a legal name character (it try first to use a period).  "/>
+        </properties>
+      </component>
+      <component id="4bcfc" class="javax.swing.JTextField" binding="myColonReplacement">
+        <constraints>
+          <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="150" height="-1"/>
+          </grid>
+        </constraints>
+        <properties/>
+      </component>
+      <component id="c69bb" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <labelFor value="12ad0"/>
+          <text value="&amp;element-define:"/>
+          <toolTipText value="Specifies how to construct the name of the definition representing an element declaration from the name of the element. The name-pattern must contain exactly one percent character. This percent character is replaced by the name of element (after colon replacement) and the result is used as the name of the definition"/>
+        </properties>
+      </component>
+      <component id="12ad0" class="javax.swing.JTextField" binding="myElementDefine">
+        <constraints>
+          <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="150" height="-1"/>
+          </grid>
+        </constraints>
+        <properties/>
+      </component>
+      <component id="b63cc" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="1" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <labelFor value="5576"/>
+          <text value="&amp;attlist-define:"/>
+          <toolTipText value="This specifies how to construct the name of the definition representing an attribute list declaration from the name of the element. The name-pattern must contain exactly one percent character. This percent character is replaced by the name of element (after colon replacement) and the result is used as the name of the definition.  "/>
+        </properties>
+      </component>
+      <component id="5576" class="javax.swing.JTextField" binding="myAttlistDefine">
+        <constraints>
+          <grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="150" height="-1"/>
+          </grid>
+        </constraints>
+        <properties/>
+      </component>
+      <component id="32a4e" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <labelFor value="bbb31"/>
+          <text value="a&amp;ny-name:"/>
+          <toolTipText value="Specifies the name of the definition generated for the content of elements declared in the DTD as having a content model of ANY."/>
+        </properties>
+      </component>
+      <component id="bbb31" class="javax.swing.JTextField" binding="myAnyName">
+        <constraints>
+          <grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="150" height="-1"/>
+          </grid>
+        </constraints>
+        <properties/>
+      </component>
+      <component id="62d5d" class="javax.swing.JCheckBox" binding="myStrictAnyCheckBox" default-binding="true">
+        <constraints>
+          <grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="&amp;strict-any"/>
+          <toolTipText value="Preserves the exact semantics of ANY content models by using an explicit choice of references to all declared elements. By default, Trang uses a wildcard that allows any element.  "/>
+        </properties>
+      </component>
+      <component id="b1561" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <labelFor value="79c45"/>
+          <text value="ann&amp;otation-prefix:"/>
+          <toolTipText value="Default values are represented using an annotation attribute prefix:defaultValue where prefix is bound to http://relaxng.org/ns/compatibility/annotations/1.0 as defined by the RELAX NG DTD Compatibility Committee Specification. By default, Trang will use a for prefix unless that conflicts with a prefix used in the DTD.  "/>
+        </properties>
+      </component>
+      <component id="79c45" class="javax.swing.JTextField" binding="myAnnotationPrefix">
+        <constraints>
+          <grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+            <preferred-size width="150" height="-1"/>
+          </grid>
+        </constraints>
+        <properties/>
+      </component>
+      <component id="d14ca" class="javax.swing.JCheckBox" binding="myGenerateStartCheckBox" default-binding="true">
+        <constraints>
+          <grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="&amp;generate-start"/>
+          <toolTipText value="Specifies whether Trang should generate a start element. DTDs do not indicate what elements are allowed as document elements. Trang assumes that all elements that are defined but never referenced are allowed as document elements.  "/>
+        </properties>
+      </component>
+      <grid id="c0da2" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="8" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <clientProperties>
+          <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+        </clientProperties>
+        <border type="none" title="Namespace Settings"/>
+        <children>
+          <component id="3e6e" class="javax.swing.JLabel">
+            <constraints>
+              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <labelFor value="577de"/>
+              <text value="&amp;Default:"/>
+            </properties>
+          </component>
+          <vspacer id="827e3">
+            <constraints>
+              <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+            </constraints>
+          </vspacer>
+          <component id="577de" class="javax.swing.JTextField" binding="myDefaultNS">
+            <constraints>
+              <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+                <preferred-size width="150" height="-1"/>
+              </grid>
+            </constraints>
+            <properties/>
+          </component>
+          <scrollpane id="66236">
+            <constraints>
+              <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties/>
+            <border type="none"/>
+            <children>
+              <component id="18116" class="javax.swing.JTable" binding="myNamespaceMap">
+                <constraints/>
+                <properties>
+                  <preferredScrollableViewportSize width="250" height="70"/>
+                </properties>
+                <clientProperties>
+                  <terminateEditOnFocusLost class="java.lang.Boolean" value="true"/>
+                </clientProperties>
+              </component>
+            </children>
+          </scrollpane>
+          <grid id="f0444" binding="myToolbar" layout-manager="BorderLayout" hgap="0" vgap="0">
+            <constraints>
+              <grid row="1" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="2" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties/>
+            <border type="none"/>
+            <children/>
+          </grid>
+        </children>
+      </grid>
+    </children>
+  </grid>
+  <inspectionSuppressions>
+    <suppress inspection="NoLabelFor" id="66236"/>
+  </inspectionSuppressions>
+</form>
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedDtdOptions.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedDtdOptions.java
new file mode 100644
index 0000000..9e72a15
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedDtdOptions.java
@@ -0,0 +1,258 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.convert;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.PsiRecursiveElementVisitor;
+import com.intellij.psi.xml.XmlAttributeDecl;
+import com.intellij.psi.xml.XmlElementDecl;
+import org.jetbrains.annotations.NonNls;
+
+import javax.swing.*;
+import javax.swing.table.AbstractTableModel;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.*;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 18.11.2007
+ */
+public class AdvancedDtdOptions implements AdvancedOptions {
+  @NonNls
+  private static final String COLON_REPLACEMENT = "colon-replacement";
+  @NonNls
+  private static final String ELEMENT_DEFINE = "element-define";
+  @NonNls
+  private static final String ATTLIST_DEFINE = "attlist-define";
+  @NonNls
+  private static final String INLINE_ATTLIST = "inline-attlist";
+  @NonNls
+  private static final String ANY_NAME = "any-name";
+  @NonNls
+  private static final String STRICT_ANY = "strict-any";
+  @NonNls
+  private static final String ANNOTATION_PREFIX = "annotation-prefix";
+  @NonNls
+  private static final String GENERATE_START = "generate-start";
+  @NonNls
+  private static final String XMLNS = "xmlns";
+
+  private JComponent myRoot;
+
+  private JCheckBox myInlineAttlistCheckBox;
+  private JTextField myColonReplacement;
+  private JTextField myElementDefine;
+  private JTextField myAttlistDefine;
+  private JTextField myAnyName;
+  private JCheckBox myStrictAnyCheckBox;
+  private JTextField myAnnotationPrefix;
+  private JCheckBox myGenerateStartCheckBox;
+  private JTextField myDefaultNS;
+  private JTable myNamespaceMap;
+
+  private JPanel myToolbar;
+
+  public AdvancedDtdOptions() {
+    myInlineAttlistCheckBox.addItemListener(new ItemListener() {
+      public void itemStateChanged(ItemEvent e) {
+        if (e.getStateChange() == ItemEvent.SELECTED) {
+          myAttlistDefine.setEnabled(false);
+        } else {
+          myAttlistDefine.setEnabled(true);
+        }
+      }
+    });
+    myNamespaceMap.setModel(new NamespaceMapModel());
+    myNamespaceMap.getColumnModel().getColumn(0).setMaxWidth((int)(new JLabel("Prefix").getPreferredSize().width * 1.2));
+
+    final DefaultActionGroup group = new DefaultActionGroup();
+    group.add(new AnAction(null, "Remove Entry", AllIcons.General.Remove) {
+      public void update(AnActionEvent e) {
+        if (myNamespaceMap.getModel().getRowCount() == 0 || myNamespaceMap.getSelectedRow() == -1) {
+          e.getPresentation().setEnabled(false);
+        } else {
+          e.getPresentation().setEnabled(true);
+        }
+      }
+
+      public void actionPerformed(AnActionEvent e) {
+        ((NamespaceMapModel)myNamespaceMap.getModel()).removeRow(myNamespaceMap.getSelectedRow());
+      }
+    });
+
+    final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, false);
+    myToolbar.add(toolbar.getComponent());
+  }
+
+  public JComponent getRoot() {
+    return myRoot;
+  }
+
+  public Map<String, ?> getOptions() {
+    final HashMap<String, Object> map = new LinkedHashMap<String, Object>();
+
+    map.put(INLINE_ATTLIST, myInlineAttlistCheckBox.isSelected());
+
+    setText(map, COLON_REPLACEMENT, myColonReplacement);
+    setText(map, ELEMENT_DEFINE, myElementDefine);
+    setText(map, ATTLIST_DEFINE, myAttlistDefine);
+    setText(map, ANY_NAME, myAnyName);
+
+    if (myStrictAnyCheckBox.isSelected()) {
+      map.put(STRICT_ANY, Boolean.TRUE);
+    }
+
+    setText(map, ANNOTATION_PREFIX, myAnnotationPrefix);
+
+    map.put(GENERATE_START, myGenerateStartCheckBox.isSelected());
+
+    if (myDefaultNS.getText().trim().length() > 0) {
+      map.put(XMLNS, myDefaultNS.getText() );
+    }
+
+    final List<String[]> data = ((NamespaceMapModel)myNamespaceMap.getModel()).getData();
+    for (String[] parts : data) {
+      map.put(XMLNS + ":" + parts[0], parts[1]);
+    }
+
+    return map;
+  }
+
+  private static void setText(HashMap<String, Object> map, String option, JTextField field) {
+    final String colonReplacement = field.getText();
+    if (colonReplacement != null && colonReplacement.trim().length() > 0) {
+      map.put(option, colonReplacement);
+    }
+  }
+
+  public void setOptions(Map<String, ?> inputOptions) {
+    if (inputOptions.containsKey(COLON_REPLACEMENT)) {
+      myColonReplacement.setText((String)inputOptions.get(COLON_REPLACEMENT));
+    }
+    myInlineAttlistCheckBox.setSelected(inputOptions.get(INLINE_ATTLIST) == Boolean.TRUE);
+
+    if (inputOptions.containsKey(ELEMENT_DEFINE)) {
+      myElementDefine.setText((String)inputOptions.get(ELEMENT_DEFINE));
+    }
+    if (inputOptions.containsKey(ATTLIST_DEFINE)) {
+      myAttlistDefine.setText((String)inputOptions.get(ATTLIST_DEFINE));
+    }
+    if (inputOptions.containsKey(ANY_NAME)) {
+      myAnyName.setText((String)inputOptions.get(ANY_NAME));
+    }
+    myStrictAnyCheckBox.setSelected(inputOptions.get(STRICT_ANY) == Boolean.TRUE);
+    if (inputOptions.containsKey(ANNOTATION_PREFIX)) {
+      myAnnotationPrefix.setText((String)inputOptions.get(ANNOTATION_PREFIX));
+    }
+    myGenerateStartCheckBox.setSelected(inputOptions.get(GENERATE_START) == Boolean.TRUE);
+    if (inputOptions.containsKey(XMLNS)) {
+      myDefaultNS.setText((String)inputOptions.get(XMLNS));
+    }
+
+    final NamespaceMapModel model = (NamespaceMapModel)myNamespaceMap.getModel();
+    final Set<String> set = inputOptions.keySet();
+    final String prefix = XMLNS + ":";
+    for (String s : set) {
+      if (s.startsWith(prefix)) {
+        model.addMapping(s.substring(prefix.length()), (String)inputOptions.get(s));
+      }
+    }
+  }
+
+  public static Map<String, ?> prepareNamespaceMap(Project project, VirtualFile firstFile) {
+    final PsiFile file = PsiManager.getInstance(project).findFile(firstFile);
+    if (file == null) {
+      return Collections.emptyMap();
+    }
+
+    final HashMap<String, Object> map = new LinkedHashMap<String, Object>();
+    file.accept(new PsiRecursiveElementVisitor() {
+      public void visitElement(PsiElement element) {
+        if (element instanceof XmlElementDecl) {
+          final String s = ((XmlElementDecl)element).getName();
+          if (s != null) {
+            final String[] parts = s.split(":");
+            if (parts.length > 1) {
+              map.put(XMLNS + ":" + parts[0], null);
+            }
+          }
+        } else if (element instanceof XmlAttributeDecl) {
+          final String s = ((XmlAttributeDecl)element).getName();
+          if (s != null) {
+            final String[] parts = s.split(":");
+            if (parts.length > 1) {
+              map.put(XMLNS + ":" + parts[0], null);
+            }
+          }
+        }
+        super.visitElement(element);
+      }
+    });
+
+    return map;
+  }
+
+  private static class NamespaceMapModel extends AbstractTableModel {
+    private final List<String[]> myList = new ArrayList<String[]>();
+
+    public String getColumnName(int column) {
+      return column == 0 ? "Prefix" : "URI";
+    }
+
+    public int getRowCount() {
+      return myList.size();
+    }
+
+    public int getColumnCount() {
+      return 2;
+    }
+
+    public boolean isCellEditable(int rowIndex, int columnIndex) {
+      return columnIndex == 1;
+    }
+
+    public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
+      myList.get(rowIndex)[columnIndex] = (String)aValue;
+    }
+
+    public Object getValueAt(int rowIndex, int columnIndex) {
+      return myList.get(rowIndex)[columnIndex];
+    }
+
+    public void addMapping(String prefix, String uri) {
+      myList.add(new String[]{ prefix, uri });
+      fireTableRowsInserted(myList.size() - 1, myList.size() - 1);
+    }
+
+    public void removeRow(int row) {
+      myList.remove(row);
+      fireTableRowsDeleted(row - 1, row - 1);
+    }
+
+    public List<String[]> getData() {
+      return myList;
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedOptions.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedOptions.java
new file mode 100644
index 0000000..d098478
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedOptions.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.convert;
+
+import javax.swing.*;
+import java.util.Map;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 19.11.2007
+*/
+public interface AdvancedOptions {
+  JComponent getRoot();
+
+  Map<String, ?> getOptions();
+
+  void setOptions(Map<String, ?> options);
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedOptionsDialog.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedOptionsDialog.java
new file mode 100644
index 0000000..9f6da66
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedOptionsDialog.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.convert;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.ui.components.JBTabbedPane;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.util.Map;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 16.11.2007
+*/
+public class AdvancedOptionsDialog extends DialogWrapper {
+  private AdvancedOptions myInputOptions;
+  private AdvancedOptions myOutputOptions;
+
+  private Map<String,?> myInputOptions_;
+  private Map<String,?> myOutputOptions_;
+
+  protected AdvancedOptionsDialog(Project project, SchemaType inputType, SchemaType outputType) {
+    super(project, false);
+    setTitle("Advanced Conversion Options");
+
+    if (inputType == SchemaType.DTD) {
+      myInputOptions = new AdvancedDtdOptions();
+    }
+    if (outputType == SchemaType.XSD) {
+      myOutputOptions = new AdvancedXsdOptions();
+    }
+
+    init();
+  }
+
+  @Nullable
+  protected JComponent createCenterPanel() {
+    JComponent root;
+    if (myInputOptions != null && myOutputOptions != null) {
+      root = new JBTabbedPane();
+      ((JTabbedPane)root).addTab("Input", myInputOptions.getRoot());
+      ((JTabbedPane)root).addTab("Output", myOutputOptions.getRoot());
+    } else if (myInputOptions != null) {
+      root = myInputOptions.getRoot();
+    } else {
+      root = myOutputOptions.getRoot();
+    }
+    return root;
+  }
+
+  public Map<String, ?> getInputOptions() {
+    if (myInputOptions != null) {
+      return myInputOptions.getOptions();
+    } else {
+      return myInputOptions_;
+    }
+  }
+
+  public Map<String, ?> getOutputOptions() {
+    if (myOutputOptions != null) {
+      return myOutputOptions.getOptions();
+    } else {
+      return myOutputOptions_;
+    }
+  }
+
+  public void setOptions(Map<String, ?> inputOptions, Map<String, ?> outputOptions) {
+    if (myInputOptions != null) {
+      myInputOptions.setOptions(inputOptions);
+    } else {
+      myInputOptions_ = inputOptions;
+    }
+    if (myOutputOptions != null) {
+      myOutputOptions.setOptions(outputOptions);
+    } else {
+      myOutputOptions_ = outputOptions;
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedXsdOptions.form b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedXsdOptions.form
new file mode 100644
index 0000000..25e6db5
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedXsdOptions.form
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.intellij.plugins.relaxNG.convert.AdvancedXsdOptions">
+  <grid id="27dc6" binding="myRoot" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="20" y="20" width="335" height="139"/>
+    </constraints>
+    <properties/>
+    <clientProperties>
+      <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+    </clientProperties>
+    <border type="none" title="W3C XML Schema Output"/>
+    <children>
+      <vspacer id="bb5e1">
+        <constraints>
+          <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+        </constraints>
+      </vspacer>
+      <component id="d49de" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <labelFor value="480bc"/>
+          <text value="&amp;any-process-contents"/>
+          <toolTipText value="Specifies the value for the processContents attribute of any elements. &#10;The default is skip (corresponding to RELAX NG semantics) unless the &#10;input format is dtd, in which case the default is strict (corresponding to &#10;DTD semantics). "/>
+        </properties>
+      </component>
+      <component id="272a3" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <labelFor value="6d96a"/>
+          <text value="a&amp;ny-attribute-process-contents"/>
+          <toolTipText value="Specifies the value for the processContents attribute of any Attribute &#10;elements. The default is skip (corresponding to RELAX NG semantics).  "/>
+        </properties>
+      </component>
+      <component id="480bc" class="com.intellij.openapi.ui.ComboBox" binding="myAnyProcessContents">
+        <constraints>
+          <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <model>
+            <item value="strict"/>
+            <item value="lax"/>
+            <item value="skip"/>
+          </model>
+        </properties>
+      </component>
+      <component id="6d96a" class="com.intellij.openapi.ui.ComboBox" binding="myAnyAttributeProcessContents">
+        <constraints>
+          <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <model>
+            <item value="strict"/>
+            <item value="lax"/>
+            <item value="skip"/>
+          </model>
+        </properties>
+      </component>
+      <component id="1cd5c" class="javax.swing.JCheckBox" binding="myDisableAbstractElements" default-binding="true">
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="&amp;disable-abstract-elements"/>
+          <toolTipText value="Disables the use of abstract elements and subsitution groups &#10;in the generated XML Schema. This can also be controlled using &#10;an annotation attribute."/>
+        </properties>
+      </component>
+    </children>
+  </grid>
+</form>
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedXsdOptions.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedXsdOptions.java
new file mode 100644
index 0000000..d29c7b2
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/AdvancedXsdOptions.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.convert;
+
+import com.intellij.openapi.ui.ComboBox;
+import org.jetbrains.annotations.NonNls;
+
+import javax.swing.*;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 18.11.2007
+ */
+public class AdvancedXsdOptions implements AdvancedOptions {
+  @NonNls
+  private static final String DISABLE_ABSTRACT_ELEMENTS = "disable-abstract-elements";
+  @NonNls
+  private static final String ANY_PROCESS_CONTENTS = "any-process-contents";
+  @NonNls
+  private static final String ANY_ATTRIBUTE_PROCESS_CONTENTS = "any-attribute-process-contents";
+
+  private JComponent myRoot;
+
+  private JCheckBox myDisableAbstractElements;
+  private ComboBox myAnyProcessContents;
+  private ComboBox myAnyAttributeProcessContents;
+
+  public JComponent getRoot() {
+    return myRoot;
+  }
+
+  public Map<String, ?> getOptions() {
+    final Map<String, Object> strings = new HashMap<String, Object>();
+    if (myDisableAbstractElements.isSelected()) {
+      strings.put(DISABLE_ABSTRACT_ELEMENTS, Boolean.TRUE);
+    }
+    strings.put(ANY_PROCESS_CONTENTS, myAnyProcessContents.getSelectedItem());
+    strings.put(ANY_ATTRIBUTE_PROCESS_CONTENTS, myAnyAttributeProcessContents.getSelectedItem());
+    return strings;
+  }
+
+  public void setOptions(Map<String, ?> inputOptions) {
+    myDisableAbstractElements.setSelected(inputOptions.get(DISABLE_ABSTRACT_ELEMENTS) == Boolean.TRUE);
+    final Object o = inputOptions.get(ANY_PROCESS_CONTENTS);
+    if (o != null) {
+      myAnyProcessContents.setSelectedItem(o);
+    }
+    final Object o2 = inputOptions.get(ANY_ATTRIBUTE_PROCESS_CONTENTS);
+    if (o2 != null) {
+      myAnyAttributeProcessContents.setSelectedItem(o2);
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaAction.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaAction.java
new file mode 100644
index 0000000..7c9eb3e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaAction.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.convert;
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.PlatformDataKeys;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import org.intellij.plugins.relaxNG.ApplicationLoader;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+import org.intellij.plugins.relaxNG.validation.ValidateAction;
+
+import java.io.File;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 16.11.2007
+*/
+public class ConvertSchemaAction extends AnAction {
+
+  public void update(AnActionEvent e) {
+    final VirtualFile[] files = e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY);
+    final Project project = e.getData(PlatformDataKeys.PROJECT);
+    if (files != null && project != null) {
+      final SchemaType type = getInputType(project, files);
+      e.getPresentation().setEnabled(type != null);
+      if (type == SchemaType.XML) {
+        e.getPresentation().setText("Generate Schema from XML file" + (files.length > 1 ? "s" : "") + "...");
+      } else {
+        e.getPresentation().setText("Convert Schema...");
+      }
+    } else {
+      e.getPresentation().setEnabled(false);
+    }
+  }
+
+  private static SchemaType getInputType(Project project, VirtualFile... files) {
+    if (files.length == 0) return null;
+
+    final VirtualFile file = files[0];
+    final FileType type = file.getFileType();
+    if (type == StdFileTypes.XML) {
+      final PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
+      if (psiFile instanceof XmlFile) {
+        final XmlDocument document = ((XmlFile)psiFile).getDocument();
+        if (document != null && document.getRootTag() != null) {
+          final XmlTag rootTag = document.getRootTag();
+          assert rootTag != null;
+          final String uri = rootTag.getNamespace();
+          if (ApplicationLoader.RNG_NAMESPACE.equals(uri) && files.length == 1) {
+            return SchemaType.RNG;
+          }
+        }
+      }
+      if (files.length > 1) {
+        for (VirtualFile virtualFile : files) {
+          if (virtualFile.getFileType() != StdFileTypes.XML || getInputType(project, virtualFile) != null) {
+            return null;
+          }
+        }
+      }
+      return SchemaType.XML;
+    } else if (type == StdFileTypes.DTD && files.length == 1) {
+      return SchemaType.DTD;
+    } else if (type == RncFileType.getInstance() && files.length == 1) {
+      return SchemaType.RNC;
+    }
+    return null;
+  }
+
+  public void actionPerformed(AnActionEvent e) {
+    final VirtualFile file = e.getData(PlatformDataKeys.VIRTUAL_FILE);
+    final Project project = e.getData(PlatformDataKeys.PROJECT);
+    if (file != null && project != null) {
+      final VirtualFile[] files = e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY);
+      assert files != null;
+
+      final SchemaType type = getInputType(project, files);
+      final ConvertSchemaDialog dialog = new ConvertSchemaDialog(project, type, file);
+      dialog.show();
+      if (!dialog.isOK()) {
+        return;
+      }
+
+      ValidateAction.saveFiles(files);
+
+      final ConvertSchemaSettings settings = dialog.getSettings();
+      final IdeaErrorHandler errorHandler = new IdeaErrorHandler(project);
+      new IdeaDriver(settings, project).convert(type, errorHandler, files);
+
+      final VirtualFile output = LocalFileSystem.getInstance().findFileByIoFile(new File(settings.getOutputDestination()));
+      if (output != null) {
+        output.refresh(false, true);
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaDialog.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaDialog.java
new file mode 100644
index 0000000..d0f3fc4
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaDialog.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.convert;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 16.11.2007
+*/
+public class ConvertSchemaDialog extends DialogWrapper implements PropertyChangeListener {
+  private final ConvertSchemaSettingsImpl mySettings;
+  private final AbstractAction myAdvancedAction;
+
+  protected ConvertSchemaDialog(Project project, SchemaType input, VirtualFile firstFile) {
+    super(project, false);
+    setTitle("Convert Schema File");
+
+    mySettings = new ConvertSchemaSettingsImpl(project, input, firstFile);
+    mySettings.addPropertyChangeListener(ConvertSchemaSettingsImpl.OUTPUT_TYPE, this);
+    mySettings.addPropertyChangeListener(ConvertSchemaSettingsImpl.OUTPUT_PATH, this);
+
+    myAdvancedAction = new AbstractAction("Advanced...") {
+      public void actionPerformed(ActionEvent e) {
+        mySettings.showAdvancedSettings();
+      }
+    };
+    myAdvancedAction.setEnabled(mySettings.hasAdvancedSettings());
+
+    init();
+
+    getOKAction().setEnabled(mySettings.getOutputDestination().trim().length() > 0);
+  }
+
+  @Override
+  protected Action[] createLeftSideActions() {
+    return new Action[]{
+            myAdvancedAction
+    };
+  }
+
+  @Override
+  public JComponent getPreferredFocusedComponent() {
+    return mySettings.getPreferredFocusedComponent();
+  }
+
+  @Nullable
+  protected JComponent createCenterPanel() {
+    return mySettings.getRoot();
+  }
+
+  public ConvertSchemaSettings getSettings() {
+    return mySettings;
+  }
+
+  public void propertyChange(PropertyChangeEvent evt) {
+    if (ConvertSchemaSettingsImpl.OUTPUT_TYPE.equals(evt.getPropertyName())) {
+      myAdvancedAction.setEnabled(mySettings.hasAdvancedSettings());
+    } else if (ConvertSchemaSettingsImpl.OUTPUT_PATH.equals(evt.getPropertyName())) {
+      getOKAction().setEnabled(((String)evt.getNewValue()).trim().length() > 0);
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaSettings.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaSettings.java
new file mode 100644
index 0000000..e838698
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaSettings.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.convert;
+
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 17.11.2007
+ */
+public interface ConvertSchemaSettings {
+  @NotNull
+  SchemaType getOutputType();
+
+  String getOutputEncoding();
+
+  int getIndent();
+
+  int getLineLength();
+
+  String getOutputDestination();
+
+  void addAdvancedSettings(List<String> inputParams, List<String> outputParams);
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaSettingsImpl.form b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaSettingsImpl.form
new file mode 100644
index 0000000..5676f41
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaSettingsImpl.form
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.intellij.plugins.relaxNG.convert.ConvertSchemaSettingsImpl">
+  <grid id="27dc6" binding="myRoot" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+    <margin top="0" left="0" bottom="0" right="0"/>
+    <constraints>
+      <xy x="20" y="20" width="496" height="234"/>
+    </constraints>
+    <properties/>
+    <border type="none"/>
+    <children>
+      <vspacer id="954f0">
+        <constraints>
+          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+        </constraints>
+      </vspacer>
+      <grid id="ba28d" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="2" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <clientProperties>
+          <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+        </clientProperties>
+        <border type="none" title="Output Type"/>
+        <children>
+          <component id="ae717" class="javax.swing.JRadioButton" binding="myOutputRnc">
+            <constraints>
+              <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="RELAX NG - &amp;Compact Syntax"/>
+            </properties>
+          </component>
+          <component id="42e64" class="javax.swing.JRadioButton" binding="myOutputXsd">
+            <constraints>
+              <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="W3C XML &amp;Schema"/>
+            </properties>
+          </component>
+          <component id="68cdd" class="javax.swing.JRadioButton" binding="myOutputDtd">
+            <constraints>
+              <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="&amp;DTD"/>
+            </properties>
+          </component>
+          <component id="a174f" class="javax.swing.JRadioButton" binding="myOutputRng">
+            <constraints>
+              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text value="&amp;RELAX NG - XML Syntax"/>
+            </properties>
+          </component>
+        </children>
+      </grid>
+      <grid id="a8d13" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <clientProperties>
+          <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+        </clientProperties>
+        <border type="none" title="Output Options"/>
+        <children>
+          <component id="a450" class="javax.swing.JLabel">
+            <constraints>
+              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <labelFor value="2ab32"/>
+              <text value="&amp;Encoding:"/>
+            </properties>
+          </component>
+          <vspacer id="deedc">
+            <constraints>
+              <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+            </constraints>
+          </vspacer>
+          <component id="2ab32" class="com.intellij.openapi.ui.ComboBox" binding="myEncoding">
+            <constraints>
+              <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties/>
+          </component>
+          <component id="b3b11" class="javax.swing.JTextField" binding="myIndent">
+            <constraints>
+              <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+                <preferred-size width="150" height="-1"/>
+              </grid>
+            </constraints>
+            <properties/>
+          </component>
+          <component id="ce882" class="javax.swing.JLabel">
+            <constraints>
+              <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <labelFor value="b3b11"/>
+              <text value="&amp;Indent:"/>
+            </properties>
+          </component>
+          <component id="42a61" class="javax.swing.JLabel">
+            <constraints>
+              <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <labelFor value="9a106"/>
+              <text value="&amp;Line Length:"/>
+            </properties>
+          </component>
+          <component id="9a106" class="javax.swing.JTextField" binding="myLineLength">
+            <constraints>
+              <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+                <preferred-size width="150" height="-1"/>
+              </grid>
+            </constraints>
+            <properties/>
+          </component>
+        </children>
+      </grid>
+      <grid id="816e7" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <clientProperties>
+          <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+        </clientProperties>
+        <border type="none" title="Output Destination"/>
+        <children>
+          <component id="5b279" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myOutputDestination">
+            <constraints>
+              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties/>
+          </component>
+        </children>
+      </grid>
+    </children>
+  </grid>
+  <buttonGroups>
+    <group name="outputType">
+      <member id="ae717"/>
+      <member id="ae717"/>
+      <member id="42e64"/>
+      <member id="68cdd"/>
+      <member id="a174f"/>
+    </group>
+  </buttonGroups>
+  <inspectionSuppressions>
+    <suppress inspection="NoLabelFor" id="5b279"/>
+  </inspectionSuppressions>
+</form>
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaSettingsImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaSettingsImpl.java
new file mode 100644
index 0000000..893c1ad
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaSettingsImpl.java
@@ -0,0 +1,258 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.convert;
+
+import com.intellij.openapi.actionSystem.LangDataKeys;
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.ui.ComboBox;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.vfs.CharsetToolkit;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.encoding.EncodingManager;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
+import com.intellij.ui.DocumentAdapter;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import javax.swing.event.DocumentEvent;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.File;
+import java.nio.charset.Charset;
+import java.util.*;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 16.11.2007
+*/
+public class ConvertSchemaSettingsImpl implements ConvertSchemaSettings {
+  static final String OUTPUT_TYPE = "output-type";
+  static final String OUTPUT_PATH = "output-path";
+
+  private final PropertyChangeSupport myPropertyChangeSupport = new PropertyChangeSupport(this);
+  private final Project myProject;
+  private final SchemaType myInputType;
+
+  private Map<String, ?> myInputOptions = Collections.emptyMap();
+  private Map<String, ?> myOutputOptions = Collections.emptyMap();
+
+  private JPanel myRoot;
+
+  private JRadioButton myOutputRng;
+  private JRadioButton myOutputRnc;
+  private JRadioButton myOutputXsd;
+  private JRadioButton myOutputDtd;
+
+  private ComboBox myEncoding;
+
+  private JTextField myIndent;
+  private JTextField myLineLength;
+
+  private TextFieldWithBrowseButton myOutputDestination;
+
+  public ConvertSchemaSettingsImpl(Project project, @NotNull SchemaType inputType, VirtualFile firstFile) {
+    myProject = project;
+    myInputType = inputType;
+    
+    final FileType type;
+    switch (inputType) {
+      case RNG:
+        myOutputRng.setVisible(false);
+        myOutputXsd.setSelected(true);
+        type = StdFileTypes.XML;
+        break;
+      case RNC:
+        myOutputRnc.setVisible(false);
+        myOutputRng.setSelected(true);
+        type = RncFileType.getInstance();
+        break;
+      case XSD:
+        myOutputXsd.setVisible(false);
+        myOutputRng.setSelected(true);
+        type = StdFileTypes.XML;
+        break;
+      case DTD:
+        myOutputDtd.setVisible(false);
+        myOutputRng.setSelected(true);
+        type = StdFileTypes.DTD;
+        break;
+      case XML:
+        myOutputRng.setSelected(true);
+        type = StdFileTypes.XML;
+        break;
+      default:
+        assert false;
+        type = null;
+    }
+
+    final Charset[] charsets = CharsetToolkit.getAvailableCharsets();
+    final List<String> suggestions = new ArrayList<String>(charsets.length);
+    for (Charset charset : charsets) {
+      if (charset.canEncode()) {
+        String name = charset.name();
+        suggestions.add(name);
+      }
+    }
+
+    myEncoding.setModel(new DefaultComboBoxModel(suggestions.toArray()));
+    final Charset charset = EncodingManager.getInstance().getDefaultCharset();
+    if (charset == null) {
+      myEncoding.setSelectedItem(System.getProperty("file.encoding", "UTF-8"));
+    } else {
+      myEncoding.setSelectedItem(charset.name());
+    }
+
+    final CodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(project);
+    final int indent = styleSettings.getIndentSize(type);
+    myIndent.setText(String.valueOf(indent));
+
+    myLineLength.setText(String.valueOf(styleSettings.RIGHT_MARGIN));
+    final SchemaType outputType = getOutputType();
+    myLineLength.setEnabled(outputType == SchemaType.DTD || outputType == SchemaType.RNC);
+
+    final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor();
+    final Module module = ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(firstFile);
+    descriptor.putUserData(LangDataKeys.MODULE_CONTEXT, module);
+
+    myOutputDestination.addBrowseFolderListener("Schema Conversion Destination",
+            "Please select the destination the generated file(s) should be placed at", project, descriptor);
+
+    final JTextField tf = myOutputDestination.getTextField();
+    tf.getDocument().addDocumentListener(new DocumentAdapter() {
+      protected void textChanged(DocumentEvent e) {
+        myPropertyChangeSupport.firePropertyChange(OUTPUT_PATH, null, getOutputDestination());
+      }
+    });
+    tf.setText(firstFile.getParent().getPath().replace('/', File.separatorChar));
+
+    final ItemListener listener = new ItemListener() {
+      public void itemStateChanged(ItemEvent e) {
+        if (e.getStateChange() == ItemEvent.SELECTED) {
+          final SchemaType type = getOutputType();
+          myPropertyChangeSupport.firePropertyChange(OUTPUT_TYPE, null, type);
+          myLineLength.setEnabled(type == SchemaType.DTD || type == SchemaType.RNC);
+        }
+      }
+    };
+    myOutputRng.addItemListener(listener);
+    myOutputRnc.addItemListener(listener);
+    myOutputXsd.addItemListener(listener);
+    myOutputDtd.addItemListener(listener);
+
+    if (inputType == SchemaType.DTD) {
+      myInputOptions = AdvancedDtdOptions.prepareNamespaceMap(project, firstFile);
+    }
+  }
+
+  @NotNull
+  public SchemaType getOutputType() {
+    if (myOutputRng.isSelected()) {
+      return SchemaType.RNG;
+    } else if (myOutputRnc.isSelected()) {
+      return SchemaType.RNC;
+    } else if (myOutputXsd.isSelected()) {
+      return SchemaType.XSD;
+    } else {
+      assert myOutputDtd.isSelected();
+      return SchemaType.DTD;
+    }
+  }
+
+  public String getOutputEncoding() {
+    return (String)myEncoding.getSelectedItem();
+  }
+
+  public int getIndent() {
+    return parseInt(myIndent.getText().trim());
+  }
+
+  private static int parseInt(String s) {
+    try {
+      return s.length() > 0 ? Integer.parseInt(s) : -1;
+    } catch (NumberFormatException e) {
+      return -1;
+    }
+  }
+
+  public int getLineLength() {
+    return parseInt(myLineLength.getText());
+  }
+  
+  public String getOutputDestination() {
+    return myOutputDestination.getText();
+  }
+
+  public void addAdvancedSettings(List<String> inputParams, List<String> outputParams) {
+    setParams(myInputOptions, inputParams);
+
+    if (getOutputType() == SchemaType.XSD) {
+      setParams(myOutputOptions, outputParams);
+    }
+  }
+
+  private static void setParams(Map<String, ?> map, List<String> inputParams) {
+    final Set<String> set = map.keySet();
+    for (String s : set) {
+      final Object value = map.get(s);
+      if (value == Boolean.TRUE) {
+        inputParams.add(s);
+      } else if (value == Boolean.FALSE) {
+        inputParams.add("no-" + s);
+      } else if (value != null) {
+        inputParams.add(s + "=" + value);
+      }
+    }
+  }
+
+  public JComponent getRoot() {
+    return myRoot;
+  }
+
+  public JComponent getPreferredFocusedComponent() {
+    return myOutputDestination;
+  }
+
+  public void addPropertyChangeListener(String name, PropertyChangeListener listener) {
+    myPropertyChangeSupport.addPropertyChangeListener(name, listener);
+  }
+
+  public void showAdvancedSettings() {
+    final AdvancedOptionsDialog dialog = new AdvancedOptionsDialog(myProject, myInputType, getOutputType());
+    dialog.setOptions(myInputOptions, myOutputOptions);
+
+    dialog.show();
+    if (dialog.isOK()) {
+      myInputOptions = dialog.getInputOptions();
+      myOutputOptions = dialog.getOutputOptions();
+    }
+  }
+
+  public boolean hasAdvancedSettings() {
+    return getOutputType() == SchemaType.XSD || myInputType == SchemaType.DTD;
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/IdeaDriver.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/IdeaDriver.java
new file mode 100644
index 0000000..5d760e6
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/IdeaDriver.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.convert;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.ArrayUtil;
+import com.thaiopensource.relaxng.edit.SchemaCollection;
+import com.thaiopensource.relaxng.input.InputFailedException;
+import com.thaiopensource.relaxng.input.InputFormat;
+import com.thaiopensource.relaxng.input.MultiInputFormat;
+import com.thaiopensource.relaxng.input.dtd.DtdInputFormat;
+import com.thaiopensource.relaxng.input.parse.compact.CompactParseInputFormat;
+import com.thaiopensource.relaxng.input.parse.sax.SAXParseInputFormat;
+import com.thaiopensource.relaxng.input.xml.XmlInputFormat;
+import com.thaiopensource.relaxng.output.LocalOutputDirectory;
+import com.thaiopensource.relaxng.output.OutputDirectory;
+import com.thaiopensource.relaxng.output.OutputFailedException;
+import com.thaiopensource.relaxng.output.OutputFormat;
+import com.thaiopensource.relaxng.output.dtd.DtdOutputFormat;
+import com.thaiopensource.relaxng.output.rnc.RncOutputFormat;
+import com.thaiopensource.relaxng.output.rng.RngOutputFormat;
+import com.thaiopensource.relaxng.output.xsd.XsdOutputFormat;
+import com.thaiopensource.relaxng.translate.util.InvalidParamsException;
+import com.thaiopensource.util.UriOrFile;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+
+public class IdeaDriver {
+
+  private static final int DEFAULT_LINE_LENGTH = 72;
+  private static final int DEFAULT_INDENT = 2;
+
+  private final ConvertSchemaSettings settings;
+  private final Project myProject;
+
+  public IdeaDriver(ConvertSchemaSettings settings, Project project) {
+    this.settings = settings;
+    myProject = project;
+  }
+
+  @SuppressWarnings({ "ThrowableInstanceNeverThrown" })
+  public void convert(SchemaType inputType, IdeaErrorHandler errorHandler, VirtualFile... inputFiles) {
+    if (inputFiles.length == 0) {
+      throw new IllegalArgumentException();
+    }
+
+    try {
+      final InputFormat inFormat = getInputFormat(inputType);
+      if (inputFiles.length > 1) {
+        if (!(inFormat instanceof MultiInputFormat)) {
+          throw new IllegalArgumentException();
+        }
+      }
+
+      final VirtualFile inputFile = inputFiles[0];
+      final SchemaType type = settings.getOutputType();
+      final String outputType = type.toString().toLowerCase();
+
+      final ArrayList<String> inputParams = new ArrayList<String>();
+
+      if (inputType != SchemaType.DTD) {
+        final Charset charset = inputFile.getCharset();
+        if (charset != null) {
+          inputParams.add("encoding=" + charset.name());
+        }
+      }
+
+      final ArrayList<String> outputParams = new ArrayList<String>();
+      settings.addAdvancedSettings(inputParams, outputParams);
+
+//      System.out.println("INPUT: " + inputParams);
+//      System.out.println("OUTPUT: " + outputParams);
+
+      final SchemaCollection sc;
+      final String input = inputFile.getPath();
+      final String uri = UriOrFile.toUri(input);
+      try {
+        if (inFormat instanceof MultiInputFormat) {
+          final MultiInputFormat format = (MultiInputFormat)inFormat;
+          final String[] uris = new String[inputFiles.length];
+          for (int i = 0; i < inputFiles.length; i++) {
+            uris[i] = UriOrFile.toUri(inputFiles[i].getPath());
+          }
+          sc = format.load(uris, ArrayUtil.toStringArray(inputParams), outputType, errorHandler);
+        } else {
+          sc = inFormat.load(uri, ArrayUtil.toStringArray(inputParams), outputType, errorHandler);
+        }
+      } catch (IOException e) {
+        errorHandler.fatalError(new SAXParseException(e.getMessage(), null, uri, -1, -1, e));
+        return;
+      }
+
+      final File destination = new File(settings.getOutputDestination());
+      final File outputFile;
+      if (destination.isDirectory()) {
+        final String name = new File(input).getName();
+        final int ext = name.lastIndexOf('.');
+        outputFile = new File(destination, (ext > 0 ? name.substring(0, ext) : name) + "." + outputType);
+      } else {
+        outputFile = destination;
+      }
+
+      try {
+        final int indent = settings.getIndent();
+        final int length = settings.getLineLength();
+        final OutputDirectory od = new LocalOutputDirectory(sc.getMainUri(),
+                outputFile,
+                "." + outputType,
+                settings.getOutputEncoding(),
+                length > 0 ? length : DEFAULT_LINE_LENGTH, 
+                indent > 0 ? indent : DEFAULT_INDENT)
+        {
+          public Stream open(String sourceUri, String encoding) throws IOException {
+            final String s = super.reference(null, sourceUri);
+            final File file = new File(outputFile.getParentFile(), s);
+            if (file.exists()) {
+              final String msg = "The file '" + file.getAbsolutePath() + "' already exists. Overwrite it?";
+              final int choice = Messages.showYesNoDialog(myProject, msg, "Output File Exists", Messages.getWarningIcon());
+              if (choice == 0) {
+                return super.open(sourceUri, encoding);
+              } else if (choice == 1) {
+                throw new CanceledException();
+              }
+            }
+            return super.open(sourceUri, encoding);
+          }
+        };
+
+        final OutputFormat of = getOutputFormat(settings.getOutputType());
+
+        of.output(sc, od, ArrayUtil.toStringArray(outputParams), inputType.toString().toLowerCase(), errorHandler);
+      } catch (IOException e) {
+        errorHandler.fatalError(new SAXParseException(e.getMessage(), null, UriOrFile.fileToUri(outputFile), -1, -1, e));
+      }
+    } catch (CanceledException e) {
+      // user abort
+    } catch (SAXParseException e) {
+      errorHandler.error(e);
+    } catch (MalformedURLException e) {
+      Logger.getInstance(getClass().getName()).error(e);
+    } catch (InputFailedException e) {
+      // handled by ErrorHandler
+    } catch (InvalidParamsException e) {
+      // handled by ErrorHandler
+    } catch (OutputFailedException e) {
+      // handled by ErrorHandler
+    } catch (SAXException e) {
+      // cannot happen or is already handled
+    }
+  }
+
+
+  private OutputFormat getOutputFormat(SchemaType outputType) {
+    switch (outputType) {
+      case DTD:
+        return new DtdOutputFormat();
+      case RNC:
+        return new RncOutputFormat();
+      case RNG:
+        return new RngOutputFormat();
+      case XSD:
+        return new XsdOutputFormat();
+      default:
+        assert false : "Unsupported output type: " + outputType;
+        return null;
+    }
+  }
+
+  private InputFormat getInputFormat(SchemaType type) {
+    switch (type) {
+      case DTD:
+        return new DtdInputFormat();
+      case RNC:
+        return new CompactParseInputFormat();
+      case RNG:
+        return new SAXParseInputFormat();
+      case XML:
+        return new XmlInputFormat();
+      default:
+        assert false : "Unsupported input type: " + type;
+        return null;
+    }
+  }
+
+  private static class CanceledException extends RuntimeException {
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/IdeaErrorHandler.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/IdeaErrorHandler.java
new file mode 100644
index 0000000..d5fd696
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/IdeaErrorHandler.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.convert;
+
+import com.intellij.ide.errorTreeView.NewErrorTreeViewPanel;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Key;
+import com.thaiopensource.xml.sax.ErrorHandlerImpl;
+import org.intellij.plugins.relaxNG.validation.MessageViewHelper;
+import org.xml.sax.SAXParseException;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 16.11.2007
+*/
+public class IdeaErrorHandler extends ErrorHandlerImpl {
+  private static final String CONTENT_NAME = "Convert Schema";
+  private static final Key<NewErrorTreeViewPanel> KEY = Key.create("CONVERSION_ERRORS");
+
+  private final MessageViewHelper myMessageViewHelper;
+
+  public IdeaErrorHandler(Project project) {
+    myMessageViewHelper = new MessageViewHelper(project, CONTENT_NAME, KEY);
+  }
+
+  @Override
+  public void warning(SAXParseException e) throws SAXParseException {
+    myMessageViewHelper.processError(e, true);
+  }
+
+  @Override
+  public void error(SAXParseException e) {
+    myMessageViewHelper.processError(e, false);
+  }
+
+  @Override
+  public void fatalError(SAXParseException e) throws SAXParseException {
+    myMessageViewHelper.processError(e, false);
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/SchemaType.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/SchemaType.java
new file mode 100644
index 0000000..87cb8409
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/convert/SchemaType.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.convert;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 17.11.2007
+ */
+public enum SchemaType {
+  RNG, RNC, DTD,
+  XSD, // output only
+  XML // input only
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/BaseInspection.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/BaseInspection.java
new file mode 100644
index 0000000..e429e56
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/BaseInspection.java
@@ -0,0 +1,218 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.inspections;
+
+import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.codeInspection.SuppressIntentionAction;
+import com.intellij.codeInspection.XmlSuppressableInspectionTool;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.vfs.ReadonlyStatusHandler;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.intellij.psi.codeStyle.CodeStyleManager;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.Function;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
+import org.intellij.plugins.relaxNG.compact.psi.*;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 25.11.2007
+ */
+public abstract class BaseInspection extends XmlSuppressableInspectionTool {
+  @Nls
+  @NotNull
+  public final String getGroupDisplayName() {
+    return getRngGroupDisplayName();
+  }
+
+  public static String getRngGroupDisplayName() {
+    return "RELAX NG";
+  }
+
+  @SuppressWarnings({ "SSBasedInspection" })
+  @Override
+  public boolean isSuppressedFor(@NotNull PsiElement element) {
+    if (element.getContainingFile() instanceof RncFile) {
+      final RncDefine define = PsiTreeUtil.getParentOfType(element, RncDefine.class, false);
+      if (define != null) {
+        if (isSuppressedAt(define)) return true;
+      }
+
+      final RncGrammar grammar = PsiTreeUtil.getParentOfType(define, RncGrammar.class);
+      if (grammar != null) {
+        if (isSuppressedAt(grammar)) return true;
+      }
+
+      return false;
+    } else {
+      return super.isSuppressedFor(element);
+    }
+  }
+
+  @SuppressWarnings({ "SSBasedInspection" })
+  private boolean isSuppressedAt(RncElement location) {
+    PsiElement prev = location.getPrevSibling();
+    while (prev instanceof PsiWhiteSpace || prev instanceof PsiComment) {
+      if (prev instanceof PsiComment) {
+        @NonNls String text = prev.getText();
+        if (text.matches("\n*#\\s*suppress\\s.+") && (text.contains(getID()) || "ALL".equals(text))) return true;
+      }
+      prev = prev.getPrevSibling();
+    }
+    return false;
+  }
+
+  @Override
+  @Nullable
+  public SuppressIntentionAction[] getSuppressActions(PsiElement element) {
+    if (element.getContainingFile() instanceof RncFile) {
+      return ArrayUtil.mergeArrays(new SuppressIntentionAction[]{
+              new SuppressAction("Define") {
+                protected PsiElement getTarget(PsiElement element) {
+                  return PsiTreeUtil.getParentOfType(element, RncDefine.class, false);
+                }
+              },
+              new SuppressAction("Grammar") {
+                protected PsiElement getTarget(PsiElement element) {
+                  final RncDefine define = PsiTreeUtil.getParentOfType(element, RncDefine.class, false);
+                  return define != null ? PsiTreeUtil.getParentOfType(define, RncGrammar.class, false) : null;
+                }
+
+                @SuppressWarnings({ "SSBasedInspection" })
+                public boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiElement element) {
+                  return super.isAvailable(project, editor, element) && getTarget(element).getText().startsWith("grammar ");
+                }
+              }
+      }, getXmlOnlySuppressions(element));
+    } else {
+      return super.getSuppressActions(element);
+    }
+  }
+
+  private SuppressIntentionAction[] getXmlOnlySuppressions(PsiElement element) {
+    return ContainerUtil.map(super.getSuppressActions(element), new Function<SuppressIntentionAction, SuppressIntentionAction>() {
+      public SuppressIntentionAction fun(final SuppressIntentionAction action) {
+        return new SuppressIntentionAction() {
+          public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
+            action.invoke(project, editor, element);
+          }
+
+          public boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiElement element) {
+            return element.getContainingFile().getFileType() == StdFileTypes.XML && action.isAvailable(project, editor, element);
+          }
+
+          @NotNull
+          public String getText() {
+            return action.getText();
+          }
+
+          public boolean startInWriteAction() {
+            return action.startInWriteAction();
+          }
+
+          @NotNull
+          public String getFamilyName() {
+            return action.getFamilyName();
+          }
+        };
+      }
+    }, new SuppressIntentionAction[0]);
+  }
+
+  private void suppress(PsiFile file, @NotNull PsiElement location) {
+    suppress(file, location, "#suppress " + getID(), new Function<String, String>() {
+      public String fun(final String text) {
+        return text + ", " + getID();
+      }
+    });
+  }
+
+  @SuppressWarnings({ "SSBasedInspection" })
+  private static void suppress(PsiFile file, @NotNull PsiElement location, String suppressComment, Function<String, String> replace) {
+    final Project project = file.getProject();
+    final VirtualFile vfile = file.getVirtualFile();
+    if (vfile == null || ReadonlyStatusHandler.getInstance(project).ensureFilesWritable(vfile).hasReadonlyFiles()) {
+      return;
+    }
+    
+    final Document doc = PsiDocumentManager.getInstance(project).getDocument(file);
+    assert doc != null;
+
+    PsiElement leaf = location.getPrevSibling();
+
+    while (leaf instanceof PsiWhiteSpace) leaf = leaf.getPrevSibling();
+
+    while (leaf instanceof PsiComment || leaf instanceof PsiWhiteSpace) {
+      @NonNls String text = leaf.getText();
+      if (text.matches("\n*#\\s*suppress\\s.+")) {
+        final TextRange textRange = leaf.getTextRange();
+        doc.replaceString(textRange.getStartOffset(), textRange.getEndOffset(), replace.fun(text));
+        return;
+      }
+      leaf = leaf.getPrevSibling();
+    }
+
+    final int offset = location.getTextRange().getStartOffset();
+    doc.insertString(offset, suppressComment + "\n");
+    CodeStyleManager.getInstance(project).adjustLineIndent(doc, offset + suppressComment.length());
+//    UndoManager.getInstance(file.getProject()).markDocumentForUndo(file);
+  }
+
+  @Override
+  @NotNull
+  public abstract RncElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly);
+
+  private abstract class SuppressAction extends SuppressIntentionAction {
+    private final String myLocation;
+
+    public SuppressAction(String location) {
+      myLocation = location;
+    }
+
+    @NotNull
+    public String getText() {
+      return "Suppress for " + myLocation;
+    }
+
+    @NotNull
+    public String getFamilyName() {
+      return getDisplayName();
+    }
+
+    public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
+      suppress(element.getContainingFile(), getTarget(element));
+    }
+
+    public boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiElement element) {
+      return getTarget(element) != null;
+    }
+
+    protected abstract PsiElement getTarget(PsiElement element);
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/RngDomInspection.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/RngDomInspection.java
new file mode 100644
index 0000000..e85067d
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/RngDomInspection.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.inspections;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.util.xml.highlighting.BasicDomElementsInspection;
+import org.intellij.plugins.relaxNG.xml.dom.RngDomElement;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 03.10.2007
+ */
+public class RngDomInspection extends BasicDomElementsInspection<RngDomElement> {
+  public RngDomInspection() {
+    super(RngDomElement.class);
+  }
+
+  @NotNull
+  @Override
+  public HighlightDisplayLevel getDefaultLevel() {
+    return HighlightDisplayLevel.ERROR;
+  }
+
+  @Override
+  public boolean isEnabledByDefault() {
+    return true;
+  }
+
+  @Nls
+  @NotNull
+  public String getGroupDisplayName() {
+    return BaseInspection.getRngGroupDisplayName();
+  }
+
+  @Nls
+  @NotNull
+  public String getDisplayName() {
+    return "Unresolved References";
+  }
+
+  @NonNls
+  @NotNull
+  public String getShortName() {
+    return "UnresolvedReference";
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/UnusedDefineInspection.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/UnusedDefineInspection.java
new file mode 100644
index 0000000..b6d4eea
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/UnusedDefineInspection.java
@@ -0,0 +1,229 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.inspections;
+
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.XmlElementVisitor;
+import com.intellij.psi.search.LocalSearchScope;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.search.searches.ReferencesSearch;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.Query;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomManager;
+import org.intellij.plugins.relaxNG.ApplicationLoader;
+import org.intellij.plugins.relaxNG.compact.psi.RncDefine;
+import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
+import org.intellij.plugins.relaxNG.compact.psi.RncGrammar;
+import org.intellij.plugins.relaxNG.compact.psi.impl.RncDefineImpl;
+import org.intellij.plugins.relaxNG.model.resolve.RelaxIncludeIndex;
+import org.intellij.plugins.relaxNG.xml.dom.RngGrammar;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 26.07.2007
+ */
+public class UnusedDefineInspection extends BaseInspection {
+  public boolean isEnabledByDefault() {
+    return false;
+  }
+
+  @Nls
+  @NotNull
+  public String getDisplayName() {
+    return "Unused Define";
+  }
+
+  @NonNls
+  @NotNull
+  public String getShortName() {
+    return "UnusedDefine";
+  }
+
+  @NotNull
+  public RncElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly) {
+    return new MyElementVisitor(holder);
+  }
+
+  private static final class MyElementVisitor extends RncElementVisitor {
+    private final ProblemsHolder myHolder;
+
+    private final XmlElementVisitor myXmlVisitor = new XmlElementVisitor() {
+      @Override
+      public void visitXmlTag(XmlTag tag) {
+        MyElementVisitor.this.visitXmlTag(tag);
+      }
+    };
+
+    public MyElementVisitor(ProblemsHolder holder) {
+      myHolder = holder;
+    }
+
+    protected void superVisitElement(PsiElement element) {
+      element.accept(myXmlVisitor);
+    }
+
+    @Override
+    public void visitDefine(RncDefine pattern) {
+      final RncGrammar grammar = PsiTreeUtil.getParentOfType(pattern, RncGrammar.class);
+      final PsiFile file = pattern.getContainingFile();
+      if (grammar != null) {
+        if (processRncUsages(pattern, new LocalSearchScope(grammar))) return;
+      } else {
+        if (processRncUsages(pattern, new LocalSearchScope(file))) return;
+      }
+
+      final PsiElementProcessor.CollectElements<XmlFile> collector = new PsiElementProcessor.CollectElements<XmlFile>();
+      RelaxIncludeIndex.processBackwardDependencies((XmlFile)file, collector);
+
+      if (processRncUsages(pattern, new LocalSearchScope(collector.toArray()))) return;
+
+      final ASTNode astNode = ((RncDefineImpl)pattern).getNameNode();
+      myHolder.registerProblem(astNode.getPsi(), "Unreferenced define", ProblemHighlightType.LIKE_UNUSED_SYMBOL, new MyFix<RncDefine>(pattern));
+    }
+
+    private static boolean processRncUsages(PsiElement tag, LocalSearchScope scope) {
+      final Query<PsiReference> query = ReferencesSearch.search(tag, scope);
+      for (PsiReference reference : query) {
+        final PsiElement e = reference.getElement();
+        final RncDefine t = PsiTreeUtil.getParentOfType(e, RncDefine.class, false);
+        if (t == null || !PsiTreeUtil.isAncestor(tag, t, true)) {
+          return true;
+        }
+      }
+      return false;
+    }
+
+    public void visitXmlTag(XmlTag tag) {
+      final PsiFile file = tag.getContainingFile();
+      if (file.getFileType() != StdFileTypes.XML) {
+        return;
+      }
+      if (!tag.getLocalName().equals("define")) {
+        return;
+      }
+      if (!tag.getNamespace().equals(ApplicationLoader.RNG_NAMESPACE)) {
+        return;
+      }
+      if (tag.getAttribute("combine") != null) {
+        return; // ?
+      }
+
+      final XmlAttribute attr = tag.getAttribute("name");
+      if (attr == null) return;
+
+      final XmlAttributeValue value = attr.getValueElement();
+      if (value == null) return;
+
+      final String s = value.getValue();
+      if (s == null || s.length() == 0) {
+        return;
+      }
+      final PsiElement parent = value.getParent();
+      if (!(parent instanceof XmlAttribute)) {
+        return;
+      }
+      if (!"name".equals(((XmlAttribute)parent).getName())) {
+        return;
+      }
+      final PsiElement grandParent = parent.getParent();
+      if (!(grandParent instanceof XmlTag)) {
+        return;
+      }
+
+      final DomElement element = DomManager.getDomManager(tag.getProject()).getDomElement(tag);
+      if (element == null) {
+        return;
+      }
+
+      final RngGrammar rngGrammar = element.getParentOfType(RngGrammar.class, true);
+      if (rngGrammar != null) {
+        if (processUsages(tag, value, new LocalSearchScope(rngGrammar.getXmlTag()))) return;
+      } else {
+        if (processUsages(tag, value, new LocalSearchScope(file))) return;
+      }
+
+      final PsiElementProcessor.CollectElements<XmlFile> collector = new PsiElementProcessor.CollectElements<XmlFile>();
+      RelaxIncludeIndex.processBackwardDependencies((XmlFile)file, collector);
+
+      if (processUsages(tag, value, new LocalSearchScope(collector.toArray()))) return;
+
+      myHolder.registerProblem(value, "Unreferenced define", ProblemHighlightType.LIKE_UNUSED_SYMBOL, new MyFix<XmlTag>(tag));
+    }
+
+    private static boolean processUsages(PsiElement tag, XmlAttributeValue value, LocalSearchScope scope) {
+      final Query<PsiReference> query = ReferencesSearch.search(tag, scope, true);
+      for (PsiReference reference : query) {
+        final PsiElement e = reference.getElement();
+        if (e != value) {
+          final XmlTag t = PsiTreeUtil.getParentOfType(e, XmlTag.class);
+          if (t != null && !PsiTreeUtil.isAncestor(tag, t, true)) {
+            return true;
+          }
+        }
+      }
+      return false;
+    }
+
+    private static class MyFix<T extends PsiElement> implements LocalQuickFix {
+      private final T myTag;
+
+      public MyFix(T tag) {
+        myTag = tag;
+      }
+
+      @NotNull
+      public String getName() {
+        return "Remove Define";
+      }
+
+      @NotNull
+      public String getFamilyName() {
+        return getName();
+      }
+
+      public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
+        try {
+          if (myTag.isValid()) {
+            myTag.delete();
+          }
+        } catch (IncorrectOperationException e) {
+          Logger.getInstance(UnusedDefineInspection.class.getName()).error(e);
+        }
+      }
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/CommonElement.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/CommonElement.java
new file mode 100644
index 0000000..77f3b6e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/CommonElement.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model;
+
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 17.09.2007
+ */
+public interface CommonElement<E extends PsiElement> {
+  void accept(Visitor visitor);
+
+  void acceptChildren(Visitor visitor);
+
+  @Nullable
+  E getPsiElement();
+
+  static abstract class Visitor {
+    public void visitElement(CommonElement pattern) {
+    }
+
+    public void visitPattern(Pattern pattern) {
+      visitElement(pattern);
+    }
+
+    public void visitGrammar(Grammar pattern) {
+      visitElement(pattern);
+    }
+
+    public void visitDefine(Define define) {
+      visitElement(define);
+    }
+
+    public void visitRef(Ref ref) {
+      visitElement(ref);
+    }
+
+    public void visitDiv(Div div) {
+      visitElement(div);
+    }
+
+    public void visitInclude(Include inc) {
+      visitElement(inc);
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Define.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Define.java
new file mode 100644
index 0000000..b0de261
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Define.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model;
+
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 05.09.2007
+ */
+public interface Define<P extends Pattern, E extends PsiElement> extends Pattern<E> {
+  String getName();
+
+  PsiElement getNameElement();
+
+  @Nullable
+  P getPattern();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Div.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Div.java
new file mode 100644
index 0000000..e35343e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Div.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model;
+
+import com.intellij.psi.PsiElement;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 17.09.2007
+ */
+public interface Div<E extends PsiElement> extends CommonElement<E> {
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Grammar.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Grammar.java
new file mode 100644
index 0000000..27a2697
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Grammar.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model;
+
+import com.intellij.psi.PsiElement;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 24.08.2007
+*/
+public interface Grammar<P extends Pattern, E extends PsiElement> extends Pattern<E> {
+  P getStart();
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Include.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Include.java
new file mode 100644
index 0000000..3437f8a
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Include.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 17.09.2007
+ */
+public interface Include<E extends PsiElement, D extends Define> extends CommonElement<E> {
+  @Nullable
+  PsiFile getInclude();
+
+  @NotNull
+  D[] getOverrides();
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Pattern.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Pattern.java
new file mode 100644
index 0000000..e0f8498
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Pattern.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model;
+
+import com.intellij.psi.PsiElement;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 24.08.2007
+*/
+public interface Pattern<E extends PsiElement> extends CommonElement<E> {
+
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Ref.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Ref.java
new file mode 100644
index 0000000..5fcf674
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/Ref.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model;
+
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 05.09.2007
+ */
+public interface Ref<D extends Define, E extends PsiElement> extends Pattern<E> {
+  @Nullable
+  D getPattern();
+
+  @Nullable
+  String getReferencedName();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/CommonAnnotationHolder.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/CommonAnnotationHolder.java
new file mode 100644
index 0000000..b16c391
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/CommonAnnotationHolder.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.annotation;
+
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.lang.annotation.AnnotationHolder;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.psi.PsiElement;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.highlighting.DomElementAnnotationHolder;
+
+abstract class CommonAnnotationHolder<C> {
+  public static <T extends DomElement> CommonAnnotationHolder<T> create(DomElementAnnotationHolder holder) {
+    return new DomHolderAdapter<T>(holder);
+  }
+
+  public static <T extends PsiElement> CommonAnnotationHolder<T> create(AnnotationHolder holder) {
+    return new HolderAdapter<T>(holder);
+  }
+
+  public abstract Annotation createAnnotation(C element, HighlightSeverity severity, String message);
+
+  private static class DomHolderAdapter<T extends DomElement> extends CommonAnnotationHolder<T> {
+    private final DomElementAnnotationHolder myHolder;
+
+    DomHolderAdapter(DomElementAnnotationHolder holder) {
+      myHolder = holder;
+    }
+
+    public Annotation createAnnotation(DomElement element, HighlightSeverity severity, String message) {
+      final Annotation annotation = myHolder.createAnnotation(element, severity, message);
+      annotation.setTooltip(message);  // no tooltip by default??
+      return annotation;
+    }
+  }
+
+  private static class HolderAdapter<T extends PsiElement> extends CommonAnnotationHolder<T> {
+    private final AnnotationHolder myHolder;
+
+    HolderAdapter(AnnotationHolder holder) {
+      myHolder = holder;
+    }
+
+    public Annotation createAnnotation(T element, HighlightSeverity severity, String message) {
+      if (severity == HighlightSeverity.ERROR) {
+        return myHolder.createErrorAnnotation(element, message);
+      } else if (severity == HighlightSeverity.WARNING) {
+        return myHolder.createWarningAnnotation(element, message);
+      } else if (severity == HighlightSeverity.WEAK_WARNING || severity == HighlightSeverity.INFO) {
+        return myHolder.createWeakWarningAnnotation(element, message);
+      } else {
+        return myHolder.createInfoAnnotation(element, message);
+      }
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/ModelAnnotator.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/ModelAnnotator.java
new file mode 100644
index 0000000..51c9fcd
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/ModelAnnotator.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.annotation;
+
+import com.intellij.lang.annotation.Annotation;
+import com.intellij.lang.annotation.AnnotationHolder;
+import com.intellij.lang.annotation.Annotator;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.editor.markup.GutterIconRenderer;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.SmartList;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.highlighting.DomElementAnnotationHolder;
+import com.intellij.util.xml.highlighting.DomElementsAnnotator;
+import org.intellij.plugins.relaxNG.model.CommonElement;
+import org.intellij.plugins.relaxNG.model.Define;
+import org.intellij.plugins.relaxNG.model.Grammar;
+import org.intellij.plugins.relaxNG.model.Include;
+import org.intellij.plugins.relaxNG.model.resolve.DefinitionResolver;
+import org.intellij.plugins.relaxNG.model.resolve.GrammarFactory;
+import org.intellij.plugins.relaxNG.model.resolve.RelaxIncludeIndex;
+import org.intellij.plugins.relaxNG.xml.dom.RngDomElement;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 04.12.2007
+*/
+public final class ModelAnnotator implements Annotator, DomElementsAnnotator {
+
+  public void annotate(@NotNull PsiElement psiElement, @NotNull AnnotationHolder holder) {
+    if (psiElement instanceof CommonElement) {
+      ((CommonElement)psiElement).accept(new MyAnnotator<PsiElement>(CommonAnnotationHolder.create(holder)));
+    }
+  }
+
+  public void annotate(DomElement element, DomElementAnnotationHolder holder) {
+    if (element instanceof RngDomElement) {
+      ((RngDomElement)element).accept(new MyAnnotator<DomElement>(CommonAnnotationHolder.create(holder)));
+    }
+  }
+
+  private final class MyAnnotator<T> extends CommonElement.Visitor {
+    private final CommonAnnotationHolder<T> myHolder;
+
+    public MyAnnotator(CommonAnnotationHolder<T> holder) {
+      myHolder = holder;
+    }
+
+    public void visitDefine(final Define define) {
+      final PsiElement element = define.getPsiElement();
+      if (element != null) {
+        final XmlFile xmlFile = (XmlFile)element.getContainingFile();
+
+        final List<Define> result = new SmartList<Define>();
+        final OverriddenDefineSearcher searcher = new OverriddenDefineSearcher(define, xmlFile, result);
+
+        final PsiElementProcessor.FindElement<XmlFile> processor = new PsiElementProcessor.FindElement<XmlFile>() {
+          public boolean execute(@NotNull XmlFile file) {
+            final Grammar grammar = GrammarFactory.getGrammar(file);
+            if (grammar == null) return true;
+
+            grammar.acceptChildren(searcher);
+
+            return result.size() == 0 || super.execute(file);
+          }
+        };
+        
+        RelaxIncludeIndex.processBackwardDependencies(xmlFile, processor);
+
+        if (processor.isFound()) {
+          createGutterAnnotation(define, new OverriddenDefineRenderer(define));
+        }
+      }
+    }
+
+    @SuppressWarnings({ "unchecked" })
+    private void createGutterAnnotation(CommonElement t, GutterIconRenderer renderer) {
+      final Annotation a = myHolder.createAnnotation((T)t, HighlightSeverity.INFORMATION, null);
+      a.setGutterIconRenderer(renderer);
+    }
+
+    public void visitInclude(Include inc) {
+      final Define[] overrides = inc.getOverrides();
+      for (Define define : overrides) {
+        final PsiFile file = inc.getInclude();
+        if (!(file instanceof XmlFile)) continue; //
+
+        final Grammar grammar = GrammarFactory.getGrammar((XmlFile)file);
+        if (grammar == null) continue;
+
+        final Map<String, Set<Define>> map = DefinitionResolver.getAllVariants(grammar);
+        if (map == null) continue;
+
+        final Set<Define> set = map.get(define.getName());
+        if (set == null || set.size() == 0) {
+          //noinspection unchecked
+          myHolder.createAnnotation((T)define, HighlightSeverity.ERROR, "Definition doesn't override anything from " + file.getName());
+          continue;
+        }
+
+        final String message = "Overrides '" + define.getName() + "' in " + file.getName();
+        createGutterAnnotation(define, new OverridingDefineRenderer(message, set));
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/OverriddenDefineRenderer.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/OverriddenDefineRenderer.java
new file mode 100644
index 0000000..3812731
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/OverriddenDefineRenderer.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.annotation;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.editor.markup.GutterIconRenderer;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.SmartList;
+import org.intellij.plugins.relaxNG.model.Define;
+import org.intellij.plugins.relaxNG.model.Grammar;
+import org.intellij.plugins.relaxNG.model.resolve.GrammarFactory;
+import org.intellij.plugins.relaxNG.model.resolve.RelaxIncludeIndex;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.util.Collection;
+import java.util.List;
+
+class OverriddenDefineRenderer extends GutterIconRenderer {
+
+  private final Define myDefine;
+
+  public OverriddenDefineRenderer(@NotNull Define define) {
+    myDefine = define;
+  }
+
+  @NotNull
+  public Icon getIcon() {
+    return AllIcons.Gutter.OverridenMethod;
+  }
+
+  @Nullable
+  public AnAction getClickAction() {
+    return new AnAction() {
+      public void actionPerformed(AnActionEvent e) {
+        final PsiElement element = myDefine.getPsiElement();
+        if (element == null || !element.isValid()) return;
+
+        final PsiElementProcessor.CollectElements<XmlFile> collector = new PsiElementProcessor.CollectElements<XmlFile>();
+        final XmlFile localFile = (XmlFile)element.getContainingFile();
+        RelaxIncludeIndex.processBackwardDependencies(localFile, collector);
+        final Collection<XmlFile> files = collector.getCollection();
+
+        final List<Define> result = new SmartList<Define>();
+        final OverriddenDefineSearcher searcher = new OverriddenDefineSearcher(myDefine, localFile, result);
+        for (XmlFile file : files) {
+          final Grammar grammar = GrammarFactory.getGrammar(file);
+          if (grammar == null) continue;
+          grammar.acceptChildren(searcher);
+        }
+
+        if (result.size() > 0) {
+          OverridingDefineRenderer.doClickAction(e, result, "Go to overriding define(s)");
+        }
+      }
+    };
+  }
+
+  public boolean isNavigateAction() {
+    return true;
+  }
+
+  @Nullable
+  public String getTooltipText() {
+    return "Is overridden";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    OverriddenDefineRenderer that = (OverriddenDefineRenderer)o;
+
+    if (!myDefine.equals(that.myDefine)) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return myDefine.hashCode();
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/OverriddenDefineSearcher.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/OverriddenDefineSearcher.java
new file mode 100644
index 0000000..a69cbc0
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/OverriddenDefineSearcher.java
@@ -0,0 +1,53 @@
+package org.intellij.plugins.relaxNG.model.annotation;
+
+import com.intellij.psi.xml.XmlFile;
+import gnu.trove.TIntArrayList;
+import org.intellij.plugins.relaxNG.model.*;
+
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 04.12.2007
+* Time: 18:41:39
+* To change this template use File | Settings | File Templates.
+*/
+class OverriddenDefineSearcher extends CommonElement.Visitor {
+  private final Define myDefine;
+  private final TIntArrayList myIncludes = new TIntArrayList();
+  private final XmlFile myLocalFile;
+  private final List<Define> myResult;
+
+  public OverriddenDefineSearcher(Define define, XmlFile localFile, List<Define> result) {
+    myLocalFile = localFile;
+    myResult = result;
+    myDefine = define;
+  }
+
+  public void visitInclude(Include inc) {
+    myIncludes.add(inc.getInclude() == myLocalFile ? 1 : 0);
+    try {
+      inc.acceptChildren(this);
+    } finally {
+      myIncludes.remove(myIncludes.size() - 1);
+    }
+  }
+
+  public void visitDiv(Div ref) {
+    ref.acceptChildren(this);
+  }
+
+  public void visitDefine(Define d) {
+    if (myIncludes.size() > 0 && myIncludes.get(myIncludes.size() - 1) == 1) {
+      if (d.getName().equals(myDefine.getName())) {
+        myResult.add(d);
+      }
+    }
+    d.acceptChildren(this);
+  }
+
+  public void visitGrammar(Grammar pattern) {
+    pattern.acceptChildren(this);
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/OverridingDefineRenderer.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/OverridingDefineRenderer.java
new file mode 100644
index 0000000..3e8c525
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/annotation/OverridingDefineRenderer.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.annotation;
+
+import com.intellij.codeInsight.navigation.NavigationUtil;
+import com.intellij.icons.AllIcons;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.editor.markup.GutterIconRenderer;
+import com.intellij.pom.Navigatable;
+import com.intellij.psi.PsiElement;
+import com.intellij.ui.awt.RelativePoint;
+import com.intellij.util.Function;
+import com.intellij.util.OpenSourceUtil;
+import com.intellij.util.containers.ContainerUtil;
+import org.intellij.plugins.relaxNG.model.Define;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.event.MouseEvent;
+import java.util.Collection;
+import java.util.Set;
+
+class OverridingDefineRenderer extends GutterIconRenderer {
+
+  private final Set<Define> mySet;
+  private final String myMessage;
+
+  public OverridingDefineRenderer(String message, Set<Define> set) {
+    mySet = set;
+    myMessage = message;
+  }
+
+  @NotNull
+  public Icon getIcon() {
+    return AllIcons.Gutter.OverridingMethod;
+  }
+
+  public boolean isNavigateAction() {
+    return true;
+  }
+
+  @Nullable
+  public AnAction getClickAction() {
+    return new MyClickAction();
+  }
+
+  @Nullable
+  public String getTooltipText() {
+    return myMessage;
+  }
+
+  private class MyClickAction extends AnAction {
+    public void actionPerformed(AnActionEvent e) {
+      doClickAction(e, mySet, "Go to overridden define");
+    }
+  }
+
+  static void doClickAction(AnActionEvent e, Collection<Define> set, String title) {
+    if (set.size() == 1) {
+      final Navigatable n = (Navigatable)set.iterator().next().getPsiElement();
+      OpenSourceUtil.navigate(true, n);
+    } else {
+      final Define[] array = set.toArray(new Define[set.size()]);
+      NavigationUtil.getPsiElementPopup(ContainerUtil.map(array, new Function<Define, PsiElement>() {
+        public PsiElement fun(Define define) {
+          return define.getPsiElement();
+        }
+      }, PsiElement.EMPTY_ARRAY), title).show(new RelativePoint((MouseEvent)e.getInputEvent()));
+    }
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    OverridingDefineRenderer that = (OverridingDefineRenderer)o;
+
+    if (myMessage != null ? !myMessage.equals(that.myMessage) : that.myMessage != null) return false;
+    if (mySet != null ? !mySet.equals(that.mySet) : that.mySet != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = mySet != null ? mySet.hashCode() : 0;
+    result = 31 * result + (myMessage != null ? myMessage.hashCode() : 0);
+    return result;
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/AttributeFinder.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/AttributeFinder.java
new file mode 100644
index 0000000..88dbf60
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/AttributeFinder.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.descriptors;
+
+import com.intellij.openapi.util.Pair;
+import gnu.trove.THashMap;
+import org.kohsuke.rngom.digested.*;
+
+import javax.xml.namespace.QName;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 30.07.2007
+*/
+class AttributeFinder extends RecursionSaveWalker {
+  private int depth;
+  private int optional;
+  private final QName myQname;
+  private final Map<DAttributePattern, Pair<? extends Map<String, String>, Boolean>> myAttributes =
+          new THashMap<DAttributePattern, Pair<? extends Map<String, String>, Boolean>>();
+  private DAttributePattern myLastAttr;
+
+  private AttributeFinder() {
+    myQname = null;
+    optional++; // everything will be optional
+  }
+
+  private AttributeFinder(QName qname) {
+    myQname = qname;
+  }
+
+  public Void onElement(DElementPattern p) {
+    depth++;
+    try {
+      myLastAttr = null;
+      if (depth < 2) {
+        return super.onElement(p);
+      }
+      return null;
+    } finally {
+      depth--;
+    }
+  }
+
+  public Void onAttribute(DAttributePattern p) {
+    assert depth > 0;
+
+    if (depth == 1 && (myQname == null || p.getName().contains(myQname))) {
+      myLastAttr = p;
+      myAttributes.put(p, Pair.create(new LinkedHashMap<String, String>(), optional > 0));
+      return super.onAttribute(p);
+    }
+    return null;
+  }
+
+  public Void onValue(DValuePattern p) {
+    if (myLastAttr != null) {
+      myAttributes.get(myLastAttr).first.put(p.getValue(), p.getType());
+    }
+    return super.onValue(p);
+  }
+
+  public Void onOptional(DOptionalPattern p) {
+    optional++;
+    try {
+      return super.onOptional(p);
+    } finally {
+      optional--;
+    }
+  }
+
+  public Void onZeroOrMore(DZeroOrMorePattern p) {
+    optional++;
+    try {
+      return super.onZeroOrMore(p);
+    } finally {
+      optional--;
+    }
+  }
+
+  public Void onChoice(DChoicePattern p) {
+    optional++;
+    try {
+      return super.onChoice(p);
+    } finally {
+      optional--;
+    }
+  }
+
+  public Void onData(DDataPattern p) {
+    if (depth == 1 && myLastAttr != null) {
+      myAttributes.get(myLastAttr).first.put(null, p.getType());
+    }
+    return null;
+  }
+
+  public static Map<DAttributePattern, Pair<? extends Map<String, String>, Boolean>> find(QName qname, DPattern... patterns) {
+    final AttributeFinder finder = new AttributeFinder(qname);
+    finder.doAccept(patterns);
+    return finder.myAttributes;
+  }
+
+  public static Map<DAttributePattern, Pair<? extends Map<String, String>, Boolean>> find(DPattern... patterns) {
+    final AttributeFinder finder = new AttributeFinder();
+    finder.doAccept(patterns);
+    return finder.myAttributes;
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/ChildElementFinder.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/ChildElementFinder.java
new file mode 100644
index 0000000..c472e35
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/ChildElementFinder.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.descriptors;
+
+import org.kohsuke.rngom.digested.DAttributePattern;
+import org.kohsuke.rngom.digested.DElementPattern;
+import org.kohsuke.rngom.digested.DPattern;
+import org.kohsuke.rngom.digested.DRefPattern;
+
+import java.util.ArrayList;
+import java.util.List;
+
+class ChildElementFinder extends RecursionSaveWalker {
+  private final List<DElementPattern> myRoots = new ArrayList<DElementPattern>();
+
+  private final int myTargetDepth;
+  private int myDepth;
+
+  private ChildElementFinder(int targetDepth) {
+    myTargetDepth = targetDepth;
+  }
+
+  public Void onRef(DRefPattern p) {
+    if (myDepth < myTargetDepth || myTargetDepth == -1) {
+      return super.onRef(p);
+    }
+    return null;
+  }
+
+  public Void onElement(DElementPattern p) {
+    myDepth++;
+    try {
+      if (myDepth == myTargetDepth || myTargetDepth == -1) {
+        myRoots.add(p);
+        return myTargetDepth != -1 ? null : super.onElement(p);
+      } else {
+        return super.onElement(p);
+      }
+    } finally {
+      myDepth--;
+    }
+  }
+
+  @Override
+  public Void onAttribute(DAttributePattern p) {
+    return null;
+  }
+
+  static List<DElementPattern> find(int targetDepth, DPattern p) {
+    final ChildElementFinder finder = new ChildElementFinder(targetDepth);
+    finder.doAccept(p);
+    return finder.myRoots;
+  }
+
+  static List<DElementPattern> find(DPattern p) {
+    return find(1, p);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/CompositeDescriptor.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/CompositeDescriptor.java
new file mode 100644
index 0000000..153374e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/CompositeDescriptor.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.descriptors;
+
+import com.intellij.openapi.util.Condition;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import org.jetbrains.annotations.Nullable;
+import org.kohsuke.rngom.digested.DElementPattern;
+import org.kohsuke.rngom.digested.DPattern;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class CompositeDescriptor extends RngElementDescriptor {
+  private final DElementPattern[] myPatterns;
+
+  CompositeDescriptor(RngNsDescriptor nsDescriptor, DElementPattern pattern, List<DElementPattern> patterns) {
+    super(nsDescriptor, pattern);
+    myPatterns = patterns.toArray(new DElementPattern[patterns.size()]);
+  }
+
+  protected XmlElementDescriptor findElementDescriptor(XmlTag childTag) {
+    final List<DElementPattern> patterns = new ArrayList<DElementPattern>();
+    for (DElementPattern pattern : myPatterns) {
+      patterns.addAll(ChildElementFinder.find(2, pattern));
+    }
+    // TODO: filter out impossible variants:
+    /*
+      while this needs both variants of <choice>-children
+      <element><choice><caret>
+
+      this does not, because <choice> inside <choice> is unambiguous:
+      <element><choice><data type="string" /><choice><caret>
+     */
+    final XmlElementDescriptor d = myNsDescriptor.findDescriptor(childTag, patterns);
+    if (d != null) {
+      return d;
+    }
+    return NULL;
+  }
+
+  public XmlElementDescriptor[] getElementsDescriptors(XmlTag context) {
+    final List<XmlElementDescriptor> descriptors = new ArrayList<XmlElementDescriptor>(Arrays.asList(super.getElementsDescriptors(context)));
+    for (DElementPattern pattern : myPatterns) {
+      final List<DElementPattern> list = ChildElementFinder.find(2, pattern);
+      descriptors.addAll(Arrays.asList(myNsDescriptor.convertElementDescriptors(list)));
+    }
+    return descriptors.toArray(new XmlElementDescriptor[descriptors.size()]);
+  }
+
+  protected XmlAttributeDescriptor getAttributeDescriptor(String namespace, String localName) {
+    final QName qname = new QName(namespace, localName);
+
+    return computeAttributeDescriptor(AttributeFinder.find(qname, myPatterns));
+  }
+
+  protected XmlAttributeDescriptor[] collectAttributeDescriptors(@Nullable XmlTag context) {
+    final QName qName = null;
+    final DPattern[] patterns;
+    if (qName == null) {
+      patterns = myPatterns;
+    } else {
+      final List<DElementPattern> p = ContainerUtil.findAll(myPatterns, new Condition<DElementPattern>() {
+        public boolean value(DElementPattern pattern) {
+          return pattern.getName().contains(qName);
+        }
+      });
+      patterns = p.toArray(new DPattern[p.size()]);
+    }
+
+    return computeAttributeDescriptors(AttributeFinder.find(patterns));
+  }
+
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+    if (!super.equals(o)) return false;
+
+    final CompositeDescriptor that = (CompositeDescriptor)o;
+
+    if (!Arrays.equals(myPatterns, that.myPatterns)) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 31 * result + Arrays.hashCode(myPatterns);
+    return result;
+  }
+
+  public DElementPattern[] getElementPatterns() {
+    return myPatterns;
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/NamedPatternFilter.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/NamedPatternFilter.java
new file mode 100644
index 0000000..30ee914
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/NamedPatternFilter.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.descriptors;
+
+import com.intellij.openapi.util.Condition;
+import org.kohsuke.rngom.digested.DXmlTokenPattern;
+
+final class NamedPatternFilter implements Condition<DXmlTokenPattern> {
+  public static final NamedPatternFilter INSTANCE = new NamedPatternFilter();
+
+  public boolean value(DXmlTokenPattern pattern) {
+    return pattern.getName().listNames().size() > 0;
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RecursionSaveWalker.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RecursionSaveWalker.java
new file mode 100644
index 0000000..2f6b7cc
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RecursionSaveWalker.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.descriptors;
+
+import com.intellij.util.SpinAllocator;
+import com.intellij.util.containers.ContainerUtil;
+import gnu.trove.THashSet;
+import gnu.trove.TObjectHashingStrategy;
+import org.kohsuke.rngom.digested.*;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 19.07.2007
+*/
+public class RecursionSaveWalker extends DPatternWalker {
+  private THashSet<DPattern> myVisited;
+
+  protected RecursionSaveWalker() {
+  }
+
+  @Override
+  public Void onGrammar(DGrammarPattern p) {
+    if (myVisited.add(p)) {
+      try {
+        return super.onGrammar(p);
+      } catch (NullPointerException e) {
+        return null; // missing start pattern
+      }
+    }
+    return null;
+  }
+
+  public Void onRef(DRefPattern p) {
+    if (myVisited.add(p)) {
+      try {
+        return super.onRef(p);
+      } catch (NullPointerException e) {
+        return null; // unresolved ref
+      }
+    }
+    return null;
+  }
+
+  protected Void onUnary(DUnaryPattern p) {
+    if (myVisited.add(p)) {
+      try {
+        return super.onUnary(p);
+      } catch (NullPointerException e) {
+        return null; // empty element
+      }
+    }
+    return null;
+  }
+
+  protected void doAccept(DPattern... p) {
+    myVisited = ourAllocator.alloc();
+    try {
+      //noinspection ForLoopReplaceableByForEach
+      for (int i = 0; i < p.length; i++) {
+        p[i].accept(this);
+      }
+    } finally {
+      ourAllocator.dispose(myVisited);
+    }
+  }
+
+  private static final SpinAllocator<THashSet<DPattern>> ourAllocator = new SpinAllocator<THashSet<DPattern>>(
+          new SpinAllocator.ICreator<THashSet<DPattern>>() {
+            @SuppressWarnings({ "unchecked" })
+            public THashSet<DPattern> createInstance() {
+              return ContainerUtil.<DPattern>newIdentityTroveSet(256);
+            }
+          },
+          new SpinAllocator.IDisposer<THashSet<DPattern>>() {
+            public void disposeInstance(THashSet<DPattern> instance) {
+              instance.clear();
+            }
+          });
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngElementDescriptor.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngElementDescriptor.java
new file mode 100644
index 0000000..054460f
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngElementDescriptor.java
@@ -0,0 +1,376 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.descriptors;
+
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.intellij.psi.util.*;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.HashMap;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlElementsGroup;
+import com.intellij.xml.XmlNSDescriptor;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+import org.intellij.plugins.relaxNG.validation.RngSchemaValidator;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+import org.kohsuke.rngom.digested.*;
+import org.kohsuke.rngom.nc.NameClass;
+import org.kohsuke.rngom.nc.NameClassVisitor;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
+import java.util.*;
+
+public class RngElementDescriptor implements XmlElementDescriptor {
+  private static final Key<ParameterizedCachedValue<XmlElementDescriptor, RngElementDescriptor>> DESCR_KEY = Key.create("DESCR");
+  private static final Key<ParameterizedCachedValue<XmlAttributeDescriptor[], RngElementDescriptor>> ATTRS_KEY = Key.create("ATTRS");
+
+  protected static final XmlElementDescriptor NULL = null;
+
+  private final DElementPattern myElementPattern;
+  protected final RngNsDescriptor myNsDescriptor;
+
+  private volatile SmartPsiElementPointer<? extends PsiElement> myDeclaration;
+
+  RngElementDescriptor(RngNsDescriptor nsDescriptor, DElementPattern pattern) {
+    myNsDescriptor = nsDescriptor;
+    myElementPattern = pattern;
+  }
+
+  public String getQualifiedName() {
+    final QName qName = getQName();
+    return qName != null ? format(qName, "") : "#unknown";
+  }
+
+  public String getDefaultName() {
+    return getName();
+  }
+
+  public XmlElementDescriptor[] getElementsDescriptors(XmlTag context) {
+    if (context == null) {
+      return EMPTY_ARRAY;
+    }
+
+    // TODO: Not sure why this is needed. IDEA sometimes asks us for descriptors with a context that doesn't match our
+    // element pattern. At least at namespace boundaries...
+    final DElementPattern pattern;
+    final XmlElementDescriptor descriptor = myNsDescriptor.getElementDescriptor(context);
+    if (descriptor instanceof RngElementDescriptor) {
+      final DElementPattern p = ((RngElementDescriptor)descriptor).myElementPattern;
+      pattern = p != null ? p : myElementPattern;
+    } else {
+      pattern = myElementPattern;
+    }
+
+    final List<DElementPattern> patterns = ChildElementFinder.find(2, pattern);
+    return myNsDescriptor.convertElementDescriptors(patterns);
+  }
+
+  protected XmlElementDescriptor findElementDescriptor(XmlTag childTag) {
+    final List<DElementPattern> patterns = ChildElementFinder.find(2, myElementPattern);
+    final XmlElementDescriptor d = myNsDescriptor.findDescriptor(childTag, patterns);
+    return d == null ? NULL : d;
+  }
+
+  public final XmlElementDescriptor getElementDescriptor(final XmlTag childTag) {
+    return getElementDescriptor(childTag, null);
+  }
+
+  public final XmlElementDescriptor getElementDescriptor(final XmlTag childTag, XmlTag contextTag) {
+    final XmlElementDescriptor value = getCachedValue(childTag, this, DESCR_KEY, new ParameterizedCachedValueProvider<XmlElementDescriptor, RngElementDescriptor>() {
+      public CachedValueProvider.Result<XmlElementDescriptor> compute(RngElementDescriptor p) {
+        final XmlElementDescriptor descriptor = p.findElementDescriptor(childTag);
+        return CachedValueProvider.Result.create(descriptor, p.getDependences(), childTag);
+      }
+    });
+    return value == NULL ? null : value;
+  }
+
+  public final XmlAttributeDescriptor[] getAttributesDescriptors(@Nullable final XmlTag context) {
+    if (context != null) {
+      return getCachedValue(context, this, ATTRS_KEY, new ParameterizedCachedValueProvider<XmlAttributeDescriptor[], RngElementDescriptor>() {
+        public CachedValueProvider.Result<XmlAttributeDescriptor[]> compute(RngElementDescriptor p) {
+          final XmlAttributeDescriptor[] value = p.collectAttributeDescriptors(context);
+          return CachedValueProvider.Result.create(value, p.getDependences(), context);
+        }
+      });
+    } else {
+      return collectAttributeDescriptors(null);
+    }
+  }
+
+  private static <D extends PsiElement, T, P> T getCachedValue(D context, P p, Key<ParameterizedCachedValue<T, P>> key, ParameterizedCachedValueProvider<T, P> provider) {
+    final CachedValuesManager mgr = CachedValuesManager.getManager(context.getProject());
+    return mgr.getParameterizedCachedValue(context, key, provider, false, p);
+  }
+
+  protected XmlAttributeDescriptor[] collectAttributeDescriptors(@Nullable XmlTag context) {
+    return computeAttributeDescriptors(AttributeFinder.find((QName)null, myElementPattern));
+  }
+
+  protected XmlAttributeDescriptor[] computeAttributeDescriptors(final Map<DAttributePattern, Pair<? extends Map<String, String>, Boolean>> map) {
+    final Map<QName, RngXmlAttributeDescriptor> name2descriptor = new HashMap<QName, RngXmlAttributeDescriptor>();
+
+    for (DAttributePattern pattern : map.keySet()) {
+      final Pair<? extends Map<String, String>, Boolean> value = map.get(pattern);
+      for (QName name : pattern.getName().listNames()) {
+        RngXmlAttributeDescriptor descriptor = name2descriptor.get(name);
+        final RngXmlAttributeDescriptor newDescriptor = new RngXmlAttributeDescriptor(this, pattern, value.first, value.second);
+        if (descriptor == null) {
+          descriptor = newDescriptor;
+        }
+        else {
+          descriptor = descriptor.mergeWith(newDescriptor);
+        }
+        name2descriptor.put(name, descriptor);
+      }
+    }
+
+    final Collection<RngXmlAttributeDescriptor> result = name2descriptor.values();
+    return result.toArray(new RngXmlAttributeDescriptor[result.size()]);
+  }
+
+  public final XmlAttributeDescriptor getAttributeDescriptor(String attributeName, @Nullable XmlTag context) {
+    return getAttributeDescriptor("", attributeName);
+  }
+
+  public final XmlAttributeDescriptor getAttributeDescriptor(XmlAttribute attribute) {
+    return getAttributeDescriptor(attribute.getNamespace(), attribute.getLocalName());
+  }
+
+  protected XmlAttributeDescriptor getAttributeDescriptor(String namespace, String localName) {
+    final QName qname = new QName(namespace, localName);
+
+    return computeAttributeDescriptor(AttributeFinder.find(qname, myElementPattern));
+  }
+
+  protected XmlAttributeDescriptor computeAttributeDescriptor(final Map<DAttributePattern, Pair<? extends Map<String, String>, Boolean>> attributes) {
+    if (attributes.size() > 0) {
+      RngXmlAttributeDescriptor d = null;
+      final Set<DAttributePattern> patterns = attributes.keySet();
+      for (DAttributePattern pattern : patterns) {
+        final Pair<? extends Map<String, String>, Boolean> pair = attributes.get(pattern);
+        final RngXmlAttributeDescriptor a =
+                new RngXmlAttributeDescriptor(this, pattern, pair.first, pair.second);
+        if (d == null) {
+          d = a;
+        } else {
+          d = d.mergeWith(a);
+        }
+      }
+      return d;
+    } else {
+      return null;
+    }
+  }
+
+  public XmlNSDescriptor getNSDescriptor() {
+    return myNsDescriptor;
+  }
+
+  @Override
+  public XmlElementsGroup getTopGroup() {
+    return null;
+  }
+
+  // is this actually used anywhere?
+  public int getContentType() {
+    final DPattern child = myElementPattern.getChild();
+    if (child instanceof DEmptyPattern) {
+      return CONTENT_TYPE_EMPTY;
+    } else if (child instanceof DTextPattern) {
+      return CONTENT_TYPE_MIXED;
+    } else if (child instanceof DElementPattern) {
+      return ((DElementPattern)child).getName().accept(MyNameClassVisitor.INSTANCE);
+    } else {
+      return CONTENT_TYPE_CHILDREN;
+    }
+  }
+
+  @Override
+  public String getDefaultValue() {
+    return null;
+  }
+
+  public PsiElement getDeclaration() {
+    if (myDeclaration != null) {
+      final PsiElement element = myDeclaration.getElement();
+      if (element != null && element.isValid()) {
+        return element;
+      }
+    }
+
+    final PsiElement decl = myNsDescriptor.getDeclaration();
+    if (decl == null/* || !decl.isValid()*/) {
+      myDeclaration = null;
+      System.out.println("decl is null");
+      return null;
+    }
+
+    final PsiElement element = getDeclarationImpl(decl, myElementPattern.getLocation());
+    if (element != null && element != decl) {
+      myDeclaration = SmartPointerManager.getInstance(decl.getProject()).createSmartPsiElementPointer(element);
+    }
+    return element;
+  }
+
+  public PsiElement getDeclaration(Locator location) {
+    final PsiElement element = myNsDescriptor.getDeclaration();
+    if (element == null) {
+      return null;
+    }
+    return getDeclarationImpl(element, location);
+  }
+
+  private PsiElement getDeclarationImpl(PsiElement decl, Locator location) {
+    final VirtualFile virtualFile = RngSchemaValidator.findVirtualFile(location.getSystemId());
+    if (virtualFile == null) {
+      return decl;
+    }
+
+    final Project project = decl.getProject();
+    final PsiFile file = PsiManager.getInstance(project).findFile(virtualFile);
+    if (file == null) {
+      return decl;
+    }
+
+    final int column = location.getColumnNumber();
+    final int line = location.getLineNumber();
+
+    final Document document = PsiDocumentManager.getInstance(project).getDocument(file);
+    assert document != null;
+
+    final int startOffset = document.getLineStartOffset(line - 1);
+
+    final PsiElement at;
+    if (column > 0) {
+      if (decl.getContainingFile().getFileType() == RncFileType.getInstance()) {
+        return file.findElementAt(startOffset + column);
+      }
+      at = file.findElementAt(startOffset + column - 2);
+    } else {
+      at = PsiTreeUtil.nextLeaf(file.findElementAt(startOffset));
+    }
+
+    return PsiTreeUtil.getParentOfType(at, XmlTag.class);
+  }
+
+  @NonNls
+  public String getName(PsiElement context) {
+    final QName qName = getQName();
+    if (qName == null) {
+      return "#unknown";
+    }
+    final XmlTag xmlTag = PsiTreeUtil.getParentOfType(context, XmlTag.class, false);
+    final String prefix = xmlTag != null ? xmlTag.getPrefixByNamespace(qName.getNamespaceURI()) : null;
+    return format(qName, prefix != null ? prefix : qName.getPrefix());
+  }
+
+  @NonNls
+  public String getName() {
+    final QName qName = getQName();
+    if (qName == null) {
+      return "#unknown";
+    }
+    return qName.getLocalPart();
+  }
+
+  private static String format(QName qName, String p) {
+    final String localPart = qName.getLocalPart();
+    return p.length() > 0 ? p + ":" + localPart : localPart;
+  }
+
+  @Nullable
+  private QName getQName() {
+    final Iterator<QName> iterator = myElementPattern.getName().listNames().iterator();
+    if (!iterator.hasNext()) {
+      return null;
+    }
+    return iterator.next();
+  }
+
+  public void init(PsiElement element) {
+
+  }
+
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    final RngElementDescriptor that = (RngElementDescriptor)o;
+
+    if (!myElementPattern.equals(that.myElementPattern)) return false;
+
+    return true;
+  }
+
+  public int hashCode() {
+    return myElementPattern.hashCode();
+  }
+
+  public Object[] getDependences() {
+    if (myDeclaration != null) {
+      return ArrayUtil.append(myNsDescriptor.getDependences(), myDeclaration.getElement());
+    } else {
+      return myNsDescriptor.getDependences();
+    }
+  }
+
+  private static class MyNameClassVisitor implements NameClassVisitor<Integer> {
+    public static final MyNameClassVisitor INSTANCE = new MyNameClassVisitor();
+
+    public Integer visitAnyName() {
+      return CONTENT_TYPE_ANY;
+    }
+
+    public Integer visitAnyNameExcept(NameClass nc) {
+      return CONTENT_TYPE_ANY;
+    }
+
+    public Integer visitChoice(NameClass nc1, NameClass nc2) {
+      return CONTENT_TYPE_CHILDREN;
+    }
+
+    public Integer visitName(QName name) {
+      return CONTENT_TYPE_CHILDREN;
+    }
+
+    public Integer visitNsName(String ns) {
+      return CONTENT_TYPE_CHILDREN;
+    }
+
+    public Integer visitNsNameExcept(String ns, NameClass nc) {
+      return CONTENT_TYPE_CHILDREN;
+    }
+
+    public Integer visitNull() {
+      return CONTENT_TYPE_EMPTY;
+    }
+  }
+
+  public DElementPattern getElementPattern() {
+    return myElementPattern;
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngNsDescriptor.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngNsDescriptor.java
new file mode 100644
index 0000000..e6689ce
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngNsDescriptor.java
@@ -0,0 +1,310 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.descriptors;
+
+import com.intellij.codeInsight.daemon.Validator;
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.openapi.project.DumbService;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.ModificationTracker;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.VirtualFileManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.*;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.HashMap;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptorEx;
+import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
+import org.intellij.plugins.relaxNG.ApplicationLoader;
+import org.intellij.plugins.relaxNG.model.resolve.RelaxIncludeIndex;
+import org.intellij.plugins.relaxNG.validation.RngParser;
+import org.intellij.plugins.relaxNG.validation.XmlInstanceValidator;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.kohsuke.rngom.digested.DElementPattern;
+import org.kohsuke.rngom.digested.DPattern;
+import org.kohsuke.rngom.nc.NameClass;
+
+import javax.xml.namespace.QName;
+import java.util.*;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 18.07.2007
+ */
+public class RngNsDescriptor implements XmlNSDescriptorEx, Validator {
+  private final Map<QName, CachedValue<XmlElementDescriptor>> myDescriptorsMap =
+    Collections.synchronizedMap(new HashMap<QName, CachedValue<XmlElementDescriptor>>());
+
+  private static final Key<ParameterizedCachedValue<XmlElementDescriptor, RngNsDescriptor>> ROOT_KEY = Key.create("ROOT_DESCRIPTOR");
+
+  private XmlFile myFile;
+  private PsiElement myElement;
+  private String myUrl;
+
+  private DPattern myPattern;
+  private PsiManager myManager;
+
+  @Nullable
+  public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
+    if (myPattern == null) {
+      return null;
+    }
+
+    XmlTag _tag = tag;
+    final LinkedList<XmlTag> chain = new LinkedList<XmlTag>();
+    while (_tag != null) {
+      chain.addFirst(_tag);
+      _tag = _tag.getParentTag();
+    }
+
+    XmlElementDescriptor desc;
+    do {
+      desc = findRootDescriptor(chain.removeFirst());
+    } while (desc == null && chain.size() > 0);
+
+    if (desc != null) {
+      for (XmlTag xmlTag : chain) {
+        desc = desc.getElementDescriptor(xmlTag, xmlTag.getParentTag());
+        if (desc == null) {
+          break;
+        }
+      }
+    }
+
+    if (desc == null || desc instanceof AnyXmlElementDescriptor) {
+      return findRootDescriptor(tag);
+    }
+
+    return desc;
+  }
+
+  private XmlElementDescriptor findRootDescriptor(final XmlTag tag) {
+    return CachedValuesManager.getManager(tag.getProject())
+        .getParameterizedCachedValue(tag, ROOT_KEY, new ParameterizedCachedValueProvider<XmlElementDescriptor, RngNsDescriptor>() {
+          public CachedValueProvider.Result<XmlElementDescriptor> compute(RngNsDescriptor o) {
+            final XmlElementDescriptor descr = o.findRootDescriptorInner(tag);
+            if (descr != null) {
+              return CachedValueProvider.Result.create(descr, tag, descr.getDependences(), o.getDependences());
+            }
+            else {
+              return CachedValueProvider.Result.create(null, tag, o.getDependences());
+            }
+          }
+        }, false, this);
+  }
+
+  private XmlElementDescriptor findRootDescriptorInner(XmlTag tag) {
+    final List<DElementPattern> allNamedPatterns =
+      ContainerUtil.findAll(ChildElementFinder.find(-1, myPattern), NamedPatternFilter.INSTANCE);
+    XmlElementDescriptor descriptor = findDescriptor(tag, allNamedPatterns);
+    return descriptor != null ? descriptor : findDescriptor(tag, ChildElementFinder.find(myPattern));
+  }
+
+  private XmlElementDescriptor findRootDescriptorInner(QName qName) {
+    return findDescriptor(qName, ContainerUtil.findAll(
+      ChildElementFinder.find(-1, myPattern), NamedPatternFilter.INSTANCE));
+  }
+
+  public XmlElementDescriptor findDescriptor(XmlTag tag, List<DElementPattern> list) {
+    final QName qName = new QName(tag.getNamespace(), tag.getLocalName());
+
+    return findDescriptor(qName, list);
+  }
+
+  private XmlElementDescriptor findDescriptor(final QName qName, List<DElementPattern> list) {
+    int max = -1;
+    DElementPattern maxPattern = null;
+    for (DElementPattern pattern : list) {
+      final NameClass nameClass = pattern.getName();
+      if (nameClass.contains(qName)) {
+        final int spec = nameClass.containsSpecificity(qName);
+        if (spec > max) {
+          maxPattern = pattern;
+          max = spec;
+        }
+      }
+    }
+    final List<DElementPattern> patterns = ContainerUtil.findAll(list, new Condition<DElementPattern>() {
+      public boolean value(DElementPattern pattern) {
+        final NameClass nameClass = pattern.getName();
+        return nameClass.contains(qName);
+      }
+    });
+
+    if (maxPattern != null) {
+      if (patterns.size() > 1) {
+        return initDescriptor(new CompositeDescriptor(this, maxPattern, patterns));
+      } else {
+        return initDescriptor(new RngElementDescriptor(this, maxPattern));
+      }
+    } else {
+      return null;
+    }
+  }
+
+  @NotNull
+  public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable XmlDocument document) {
+    if (myPattern == null) {
+      return XmlElementDescriptor.EMPTY_ARRAY;
+    }
+
+    final List<DElementPattern> list = ChildElementFinder.find(-1, myPattern);
+    return convertElementDescriptors(list);
+  }
+
+  XmlElementDescriptor[] convertElementDescriptors(List<DElementPattern> patterns) {
+    patterns = ContainerUtil.findAll(patterns, NamedPatternFilter.INSTANCE);
+
+    final Map<QName, List<DElementPattern>> name2patterns = new HashMap<QName, List<DElementPattern>>();
+    for (DElementPattern pattern : patterns) {
+      for (QName qName : pattern.getName().listNames()) {
+        List<DElementPattern> dPatterns = name2patterns.get(qName);
+        if (dPatterns == null) {
+          dPatterns = new ArrayList<DElementPattern>();
+          name2patterns.put(qName, dPatterns);
+        }
+        dPatterns.add(pattern);
+      }
+    }
+
+    final List<XmlElementDescriptor> result = new ArrayList<XmlElementDescriptor>();
+
+    for (QName qName : name2patterns.keySet()) {
+      final List<DElementPattern> patternList = name2patterns.get(qName);
+      final XmlElementDescriptor descriptor = findDescriptor(qName, patternList);
+      if (descriptor != null) {
+        result.add(descriptor);
+      }
+    }
+
+    return result.toArray(new XmlElementDescriptor[result.size()]);
+  }
+
+  protected XmlElementDescriptor initDescriptor(@NotNull XmlElementDescriptor descriptor) {
+    return descriptor;
+  }
+
+  @NotNull
+  public XmlFile getDescriptorFile() {
+    return myFile;
+  }
+
+  public boolean isHierarhyEnabled() {
+    return false;
+  }
+
+  public synchronized PsiElement getDeclaration() {
+    if (!myElement.isValid() || !myFile.isValid()) {
+      if (myUrl != null) {
+        final VirtualFile fileByUrl = VirtualFileManager.getInstance().findFileByUrl(myUrl);
+        if (fileByUrl != null) {
+          final PsiFile file = myManager.findFile(fileByUrl);
+          if (file instanceof XmlFile) {
+            init(((XmlFile)file).getDocument());
+          }
+        }
+      }
+    }
+    return myFile.isValid() ? myFile.getDocument() : null;
+  }
+
+  @NonNls
+  public String getName(PsiElement context) {
+    return getName();
+  }
+
+  @NonNls
+  public String getName() {
+    return getDescriptorFile().getName();
+  }
+
+  public Object[] getDependences() {
+    if (myPattern != null) {
+      if (DumbService.isDumb(myElement.getProject())) {
+        return new Object[] { ModificationTracker.EVER_CHANGED, ExternalResourceManager.getInstance()};
+      }
+      final Object[] a = { myElement, ExternalResourceManager.getInstance() };
+      final PsiElementProcessor.CollectElements<XmlFile> processor = new PsiElementProcessor.CollectElements<XmlFile>();
+      RelaxIncludeIndex.processForwardDependencies(myFile, processor);
+      if (processor.getCollection().size() > 0) {
+        return ArrayUtil.mergeArrays(a, processor.toArray());
+      } else {
+        return a;
+      }
+    }
+    return new Object[]{ ModificationTracker.EVER_CHANGED };
+  }
+
+  public synchronized void init(PsiElement element) {
+    myElement = element;
+    myFile = element instanceof XmlFile ? (XmlFile)element : (XmlFile)element.getContainingFile();
+    myManager = myFile.getManager();
+
+    final VirtualFile file = myFile.getVirtualFile();
+    if (file != null) {
+      myUrl = file.getUrl();
+    }
+
+    myPattern = RngParser.getCachedPattern(getDescriptorFile(), RngParser.DEFAULT_HANDLER);
+  }
+
+  public void validate(@NotNull PsiElement context, @NotNull final ValidationHost host) {
+    final XmlDocument doc = PsiTreeUtil.getContextOfType(context, XmlDocument.class, false);
+    if (doc == null) {
+      return;
+    }
+    final XmlTag rootTag = doc.getRootTag();
+    if (rootTag == null) {
+      return;
+    }
+    // RNG XML itself is validated by parsing it with Jing, so we don't want to schema-validate it
+    if (!ApplicationLoader.RNG_NAMESPACE.equals(rootTag.getNamespace())) {
+      XmlInstanceValidator.doValidation(doc, host, getDescriptorFile());
+    }
+  }
+
+  //@Override
+  public XmlElementDescriptor getElementDescriptor(String localName, String namespace) {
+    final QName qName = new QName(namespace, localName);
+    CachedValue<XmlElementDescriptor> cachedValue = myDescriptorsMap.get(qName);
+    if (cachedValue == null) {
+      cachedValue =
+        CachedValuesManager.getManager(myElement.getProject()).createCachedValue(new CachedValueProvider<XmlElementDescriptor>() {
+          public Result<XmlElementDescriptor> compute() {
+            final XmlElementDescriptor descriptor = findRootDescriptorInner(qName);
+            return descriptor != null
+                   ? new Result<XmlElementDescriptor>(descriptor, descriptor.getDependences())
+                   : new Result<XmlElementDescriptor>(null, getDependences());
+          }
+        }, false);
+      myDescriptorsMap.put(qName, cachedValue);
+    }
+    return cachedValue.getValue();
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngXmlAttributeDescriptor.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngXmlAttributeDescriptor.java
new file mode 100644
index 0000000..36760ce
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngXmlAttributeDescriptor.java
@@ -0,0 +1,204 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.descriptors;
+
+import com.intellij.openapi.util.Comparing;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.impl.BasicXmlAttributeDescriptor;
+import gnu.trove.THashSet;
+import gnu.trove.TObjectHashingStrategy;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+import org.kohsuke.rngom.digested.DAttributePattern;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
+import java.util.*;
+
+public class RngXmlAttributeDescriptor extends BasicXmlAttributeDescriptor {
+  @NonNls
+  private static final QName UNKNOWN = new QName("", "#unknown");
+
+  private static final TObjectHashingStrategy<Locator> HASHING_STRATEGY = new TObjectHashingStrategy<Locator>() {
+    public int computeHashCode(Locator o) {
+      final String s = o.getSystemId();
+      return o.getLineNumber() * 31 + o.getColumnNumber() * 23 + (s != null ? s.hashCode() * 11 : 0);
+    }
+    public boolean equals(Locator o, Locator o1) {
+      if ((o.getLineNumber() == o1.getLineNumber() && o.getColumnNumber() == o1.getColumnNumber())) {
+        if (Comparing.equal(o.getSystemId(), o1.getSystemId())) {
+          return true;
+        }
+      }
+      return false;
+    }
+  };
+
+  private final Map<String, String> myValues;
+  private final boolean myOptional;
+  private final RngElementDescriptor myElementDescriptor;
+  private final THashSet<Locator> myDeclarations = new THashSet<Locator>(HASHING_STRATEGY);
+  private final QName myName;
+
+  RngXmlAttributeDescriptor(RngElementDescriptor elementDescriptor, DAttributePattern pattern, Map<String, String> values, boolean optional) {
+    this(elementDescriptor, getName(pattern), values, optional, pattern.getLocation());
+  }
+
+  private static QName getName(DAttributePattern pattern) {
+    final Iterator<QName> iterator = pattern.getName().listNames().iterator();
+    return iterator.hasNext() ? iterator.next() : UNKNOWN;
+  }
+
+  private RngXmlAttributeDescriptor(RngElementDescriptor elementDescriptor, QName name, Map<String, String> values, boolean optional, Locator... locations) {
+    myElementDescriptor = elementDescriptor;
+    myValues = values;
+    myOptional = optional;
+    myName = name;
+    myDeclarations.addAll(Arrays.asList(locations));
+  }
+
+  public RngXmlAttributeDescriptor mergeWith(RngXmlAttributeDescriptor d) {
+    final QName name = d.myName.equals(UNKNOWN) ? myName : d.myName;
+
+    final HashMap<String, String> values = new HashMap<String, String>(myValues);
+    values.putAll(d.myValues);
+
+    final THashSet<Locator> locations = new THashSet<Locator>(myDeclarations, HASHING_STRATEGY);
+    locations.addAll(d.myDeclarations);
+
+    return new RngXmlAttributeDescriptor(myElementDescriptor, name, values, myOptional || d.myOptional, locations.toArray(new Locator[locations.size()]));
+  }
+
+  public boolean isRequired() {
+    return !myOptional;
+  }
+
+  public boolean isFixed() {
+    return isEnumerated() && myValues.size() == 1;
+  }
+
+  public boolean hasIdType() {
+    return myValues.values().contains("ID");
+  }
+
+  public boolean hasIdRefType() {
+    return myValues.values().contains("IDREF");
+  }
+
+  @Nullable
+  public String getDefaultValue() {
+    return isEnumerated() ? myValues.keySet().iterator().next() : null;
+  }
+
+  public boolean isEnumerated() {
+    return myValues.size() > 0 && myValues.get(null) == null;
+  }
+
+  public String[] getEnumeratedValues() {
+    if (myValues.size() > 0) {
+      final Map<String, String> copy;
+      if (myValues.get(null) != null) {
+        copy = new HashMap<String, String>(myValues);
+        copy.remove(null);
+      } else {
+        copy = myValues;
+      }
+      return copy.keySet().toArray(new String[copy.size()]);
+    } else {
+      return ArrayUtil.EMPTY_STRING_ARRAY;
+    }
+  }
+
+  public PsiElement getDeclaration() {
+    final Iterator<Locator> it = myDeclarations.iterator();
+    if (!it.hasNext()) return null;
+
+    return myElementDescriptor.getDeclaration(it.next());
+  }
+
+  public Collection<PsiElement> getDeclarations() {
+    return ContainerUtil.map2List(myDeclarations, new Function<Locator, PsiElement>() {
+      public PsiElement fun(Locator locator) {
+        return myElementDescriptor.getDeclaration(locator);
+      }
+    });
+  }
+  
+  @Override
+  public String getName(PsiElement context) {
+    final XmlTag tag = PsiTreeUtil.getParentOfType(context, XmlTag.class, false, PsiFile.class);
+    if (tag != null) {
+      final String uri = myName.getNamespaceURI();
+      final String prefix = tag.getPrefixByNamespace(uri);
+      if (prefix != null) {
+        if (prefix.length() == 0) {
+          return myName.getLocalPart();
+        } else {
+          return prefix + ":" + myName.getLocalPart();
+        }
+      }
+    }
+    if (myName.getNamespaceURI().length() > 0) {
+      final String prefix2 = myName.getPrefix();
+      if (prefix2 != null && prefix2.length() > 0) {
+        return prefix2 + ":" + myName.getLocalPart();
+      }
+    }
+    return myName.getLocalPart();
+  }
+
+  @NonNls
+  public String getName() {
+    return myName.getLocalPart();
+  }
+
+  public void init(PsiElement element) {
+
+  }
+
+  public Object[] getDependences() {
+    return myElementDescriptor.getDependences();
+  }
+
+  @Override
+  public String validateValue(XmlElement context, String value) {
+    if (isTokenDatatype(value)) {
+      value = normalizeSpace(value);
+    }
+    return super.validateValue(context, value);
+  }
+
+  private boolean isTokenDatatype(String value) {
+    if (myValues.containsKey(value)) {
+      return "token".equals(myValues.get(value));
+    }
+
+    value = normalizeSpace(value);
+    return myValues.containsKey(value) && "token".equals(myValues.get(value));
+  }
+
+  private static String normalizeSpace(String value) {
+    return value.replaceAll("\\s+", " ").trim();
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/DefinitionResolver.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/DefinitionResolver.java
new file mode 100644
index 0000000..afbbcc0
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/DefinitionResolver.java
@@ -0,0 +1,231 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.resolve;
+
+import com.intellij.openapi.util.Factory;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.ModificationTracker;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.HashSet;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.DomManager;
+import gnu.trove.THashSet;
+import org.intellij.plugins.relaxNG.compact.psi.RncFile;
+import org.intellij.plugins.relaxNG.model.*;
+import org.intellij.plugins.relaxNG.xml.dom.RngGrammar;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 24.08.2007
+*/
+public class DefinitionResolver extends CommonElement.Visitor implements
+        CachedValueProvider<Map<String, Set<Define>>>, Factory<Set<Define>> {
+
+  private static final Key<CachedValue<Map<String, Set<Define>>>> KEY = Key.create("CACHED_DEFINES");
+
+  private static final ThreadLocal<Set<PsiFile>> myVisitedFiles = new ThreadLocal<Set<PsiFile>>();
+  private static final ThreadLocal<Map<String, Set<Define>>> myDefines = new ThreadLocal<Map<String, Set<Define>>>() {
+    @Override
+    protected Map<String, Set<Define>> initialValue() {
+      return ContainerUtil.newHashMap();
+    }
+  };
+
+  private final Grammar myScope;
+
+  private DefinitionResolver(Grammar scope) {
+    myScope = scope;
+  }
+
+  @Override
+  public void visitInclude(Include include) {
+    include.acceptChildren(this);
+
+    final PsiFile value = include.getInclude();
+    if (myVisitedFiles.get() == null) {
+      myVisitedFiles.set(ContainerUtil.<PsiFile>newIdentityTroveSet());
+    }
+    if (value != null && myVisitedFiles.get().add(value)) {
+      doVisitRncOrRngFile(value, this);
+    }
+  }
+
+  private static void doVisitRncOrRngFile(PsiFile file, CommonElement.Visitor visitor) {
+    if (file instanceof RncFile) {
+      final Grammar grammar = ((RncFile)file).getGrammar();
+      if (grammar != null) {
+        grammar.acceptChildren(visitor);
+      }
+    } else if (file instanceof XmlFile) {
+      final DomManager mgr = DomManager.getDomManager(file.getProject());
+      final DomFileElement<RngGrammar> element = mgr.getFileElement((XmlFile)file, RngGrammar.class);
+      if (element != null) {
+        element.getRootElement().acceptChildren(visitor);
+      }
+    }
+  }
+
+  @Override
+  public void visitDiv(Div div) {
+    div.acceptChildren(this);
+  }
+
+  @Override
+  public void visitDefine(Define def) {
+    ContainerUtil.getOrCreate(myDefines.get(), def.getName(), this).add(def);
+  }
+
+  public void visitPattern(Pattern pattern) {
+  }
+
+  public void visitGrammar(Grammar pattern) {
+  }
+
+  public void visitRef(Ref ref) {
+  }
+
+
+  public Set<Define> create() {
+    return new THashSet<Define>();
+  }
+
+  public Result<Map<String, Set<Define>>> compute() {
+    try {
+      myScope.acceptChildren(this);
+
+      final PsiElement psiElement = myScope.getPsiElement();
+      if (psiElement == null || !psiElement.isValid()) {
+        return Result.create(null, ModificationTracker.EVER_CHANGED);
+      }
+
+      final PsiFile file = psiElement.getContainingFile();
+      if (myVisitedFiles.get() != null) {
+        myVisitedFiles.get().add(file);
+        return Result.create(myDefines.get(), myVisitedFiles.get().toArray());
+      } else {
+        return Result.create(myDefines.get(), file);
+      }
+    } finally {
+      myVisitedFiles.remove();
+      myDefines.remove();
+    }
+  }
+
+  @Nullable
+  public static Set<Define> resolve(Grammar scope, final String value) {
+    final Map<String, Set<Define>> map = getAllVariants(scope);
+    if (map == null) {
+      return null;
+    }
+
+    final Set<Define> set = map.get(value);
+
+    // actually we should always do this, but I'm a bit afraid of the performance impact
+    if (set == null || set.size() == 0) {
+      final PsiElement element = scope.getPsiElement();
+      if (element != null) {
+        final PsiFile file = element.getContainingFile();
+        if (file instanceof XmlFile) {
+          final BackwardDefinitionResolver resolver = new BackwardDefinitionResolver(value);
+          RelaxIncludeIndex.processBackwardDependencies((XmlFile)file, resolver);
+          return resolver.getResult();
+        }
+      }
+    }
+
+    return set;
+  }
+
+  @Nullable
+  public static Map<String, Set<Define>> getAllVariants(Grammar scope) {
+    final PsiElement psiElement = scope.getPsiElement();
+    if (psiElement == null || !psiElement.isValid()) return null;
+
+    final CachedValuesManager manager = CachedValuesManager.getManager(psiElement.getProject());
+    CachedValue<Map<String, Set<Define>>> data = psiElement.getUserData(KEY);
+    if (data == null || !((DefinitionResolver)data.getValueProvider()).isValid()) {
+      final DefinitionResolver resolver = new DefinitionResolver(scope);
+      data = manager.createCachedValue(resolver, false);
+      psiElement.putUserData(KEY, data);
+    }
+    return data.getValue();
+  }
+
+  private boolean isValid() {
+    final PsiElement element = myScope.getPsiElement();
+    return element != null && element.isValid();
+  }
+
+  private static class BackwardDefinitionResolver implements PsiElementProcessor<XmlFile> {
+    private final String myValue;
+    private Define myResult;
+    private final Set<PsiFile> myVisitedPsiFiles = new HashSet<PsiFile>();
+
+    public BackwardDefinitionResolver(String value) {
+      myValue = value;
+    }
+
+    public boolean execute(@NotNull XmlFile element) {
+      final Grammar g = GrammarFactory.getGrammar(element);
+      if (g != null) {
+        g.acceptChildren(new CommonElement.Visitor() {
+          @Override
+          public void visitElement(CommonElement pattern) {
+            if (myResult == null) {
+              super.visitElement(pattern);
+            }
+          }
+
+          @Override
+          public void visitDefine(Define define) {
+            if (myValue.equals(define.getName())) {
+              myResult = define;
+            }
+          }
+
+          @Override
+          public void visitInclude(Include include) {
+            final PsiFile file = include.getInclude();
+            if (file != null && myVisitedPsiFiles.add(file)) {
+              doVisitRncOrRngFile(file, this);
+            }
+          }
+        });
+      }
+      return myResult == null;
+    }
+
+    @Nullable
+    public Set<Define> getResult() {
+      return myResult != null ? Collections.singleton(myResult) : null;
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/GrammarFactory.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/GrammarFactory.java
new file mode 100644
index 0000000..cbdd4a2
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/GrammarFactory.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.model.resolve;
+
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.DomFileElement;
+import com.intellij.util.xml.DomManager;
+import org.intellij.plugins.relaxNG.compact.psi.RncFile;
+import org.intellij.plugins.relaxNG.model.Grammar;
+import org.intellij.plugins.relaxNG.xml.dom.RngGrammar;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 24.11.2007
+ */
+public class GrammarFactory {
+  @Nullable
+  public static Grammar getGrammar(@NotNull XmlFile element) {
+    if (element instanceof RncFile) {
+      return ((RncFile)element).getGrammar();
+    }
+    final DomFileElement<RngGrammar> fileElement = DomManager.getDomManager(element.getProject()).getFileElement(element, RngGrammar.class);
+    return fileElement != null ? fileElement.getRootElement() : null;
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/RelaxIncludeIndex.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/RelaxIncludeIndex.java
new file mode 100644
index 0000000..0d8c9c5
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/RelaxIncludeIndex.java
@@ -0,0 +1,75 @@
+package org.intellij.plugins.relaxNG.model.resolve;
+
+import com.intellij.ide.highlighter.XmlFileType;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.impl.include.FileIncludeManager;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.NullableFunction;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.DomManager;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+import org.intellij.plugins.relaxNG.xml.dom.RngGrammar;
+import org.jetbrains.annotations.NotNull;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 09.06.2010
+*/
+public class RelaxIncludeIndex {
+  public static boolean processForwardDependencies(XmlFile file, final PsiElementProcessor<XmlFile> processor) {
+    final Project project = file.getProject();
+    final VirtualFile[] files = FileIncludeManager.getManager(project).getIncludedFiles(file.getVirtualFile(), true);
+
+    return processRelatedFiles(file, files, processor);
+  }
+
+  public static boolean processBackwardDependencies(@NotNull XmlFile file, PsiElementProcessor<XmlFile> processor) {
+    return processBackwardDependencies((PsiFile)file, processor);
+  }
+
+
+  private static boolean processBackwardDependencies(@NotNull PsiFile file, PsiElementProcessor<XmlFile> processor) {
+    final Project project = file.getProject();
+    final VirtualFile[] files = FileIncludeManager.getManager(project).getIncludingFiles(file.getVirtualFile(), true);
+
+    return processRelatedFiles(file, files, processor);
+  }
+
+  private static boolean processRelatedFiles(PsiFile file, VirtualFile[] files, PsiElementProcessor<XmlFile> processor) {
+    Project project = file.getProject();
+    final PsiManager psiManager = PsiManager.getInstance(project);
+    final PsiFile[] psiFiles = ContainerUtil.map2Array(files, PsiFile.class, new NullableFunction<VirtualFile, PsiFile>() {
+      public PsiFile fun(VirtualFile file) {
+        return psiManager.findFile(file);
+      }
+    });
+
+    for (final PsiFile psiFile : psiFiles) {
+      final FileType type = file.getFileType();
+      if (type == XmlFileType.INSTANCE && isRngFile(psiFile)) {
+        if (!processor.execute((XmlFile)psiFile)) {
+          return false;
+        }
+      } else if (type == RncFileType.getInstance()) {
+        if (!processor.execute((XmlFile)psiFile)) {
+          return false;
+        }
+      }
+    }
+    return true;
+  }
+
+  static boolean isRngFile(PsiFile psiFile) {
+    try {
+      return DomManager.getDomManager(psiFile.getProject()).getFileElement((XmlFile)psiFile, RngGrammar.class) != null;
+    } catch (ClassCastException e) {
+      return false; // fileType == XML && !instanceof XmlFile
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/RelaxIncludeProvider.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/RelaxIncludeProvider.java
new file mode 100644
index 0000000..657cb60
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/RelaxIncludeProvider.java
@@ -0,0 +1,104 @@
+package org.intellij.plugins.relaxNG.model.resolve;
+
+import com.intellij.ide.highlighter.XmlFileType;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.impl.include.FileIncludeInfo;
+import com.intellij.psi.impl.include.FileIncludeProvider;
+import com.intellij.util.indexing.FileContent;
+import com.intellij.util.text.CharArrayUtil;
+import com.intellij.util.xml.NanoXmlUtil;
+import org.intellij.plugins.relaxNG.ApplicationLoader;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+import org.intellij.plugins.relaxNG.compact.psi.RncElement;
+import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
+import org.intellij.plugins.relaxNG.compact.psi.RncInclude;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 09.06.2010
+*/
+public class RelaxIncludeProvider extends FileIncludeProvider {
+  @NotNull
+  @Override
+  public String getId() {
+    return "relax-ng";
+  }
+
+  @Override
+  public boolean acceptFile(VirtualFile file) {
+    final FileType type = file.getFileType();
+    return type == XmlFileType.INSTANCE || type == RncFileType.getInstance();
+  }
+
+  @NotNull
+  @Override
+  public FileIncludeInfo[] getIncludeInfos(FileContent content) {
+    final ArrayList<FileIncludeInfo> infos;
+
+    if (content.getFileType() == XmlFileType.INSTANCE) {
+      CharSequence inputDataContentAsText = content.getContentAsText();
+      if (CharArrayUtil.indexOf(inputDataContentAsText, ApplicationLoader.RNG_NAMESPACE, 0) == -1) return FileIncludeInfo.EMPTY;
+      infos = new ArrayList<FileIncludeInfo>();
+      NanoXmlUtil.parse(CharArrayUtil.readerFromCharSequence(content.getContentAsText()), new RngBuilderAdapter(infos));
+    } else if (content.getFileType() == RncFileType.getInstance()) {
+      infos = new ArrayList<FileIncludeInfo>();
+      content.getPsiFile().acceptChildren(new RncElementVisitor() {
+        @Override
+        public void visitElement(RncElement element) {
+          element.acceptChildren(this);
+        }
+
+        @Override
+        public void visitInclude(RncInclude include) {
+          final String path = include.getFileReference();
+          if (path != null) {
+            infos.add(new FileIncludeInfo(path));
+          }
+        }
+      });
+    } else {
+      return FileIncludeInfo.EMPTY;
+    }
+    return infos.toArray(new FileIncludeInfo[infos.size()]);
+  }
+
+  private static class RngBuilderAdapter extends NanoXmlUtil.IXMLBuilderAdapter {
+    boolean isRNG;
+    boolean isInclude;
+    private final ArrayList<FileIncludeInfo> myInfos;
+
+    public RngBuilderAdapter(ArrayList<FileIncludeInfo> infos) {
+      myInfos = infos;
+    }
+
+    @Override
+    public void startElement(String name, String nsPrefix, String nsURI, String systemID, int lineNr) throws Exception {
+      boolean isRngTag = ApplicationLoader.RNG_NAMESPACE.equals(nsURI);
+      if (!isRNG) { // analyzing start tag
+        if (!isRngTag) {
+          throw new NanoXmlUtil.ParserStoppedException();
+        } else {
+          isRNG = true;
+        }
+      }
+      isInclude = isRngTag && "include".equals(name);
+    }
+
+    @Override
+    public void addAttribute(String key, String nsPrefix, String nsURI, String value, String type) throws Exception {
+      if (isInclude && "href".equals(key)) {
+        myInfos.add(new FileIncludeInfo(value));
+      }
+    }
+
+    @Override
+    public void endElement(String name, String nsPrefix, String nsURI) throws Exception {
+      isInclude = false;
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/RelaxSymbolIndex.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/RelaxSymbolIndex.java
new file mode 100644
index 0000000..e92869d
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/resolve/RelaxSymbolIndex.java
@@ -0,0 +1,310 @@
+package org.intellij.plugins.relaxNG.model.resolve;
+
+import com.intellij.ide.highlighter.XmlFileType;
+import com.intellij.navigation.ColoredItemPresentation;
+import com.intellij.navigation.ItemPresentation;
+import com.intellij.navigation.NavigationItem;
+import com.intellij.navigation.PsiElementNavigationItem;
+import com.intellij.openapi.editor.colors.TextAttributesKey;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.JarFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.meta.PsiMetaData;
+import com.intellij.psi.meta.PsiMetaOwner;
+import com.intellij.psi.meta.PsiPresentableMetaData;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.indexing.*;
+import com.intellij.util.io.EnumeratorStringDescriptor;
+import com.intellij.util.io.KeyDescriptor;
+import com.intellij.util.text.CharArrayUtil;
+import com.intellij.util.xml.NanoXmlUtil;
+import org.intellij.plugins.relaxNG.ApplicationLoader;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+import org.intellij.plugins.relaxNG.model.CommonElement;
+import org.intellij.plugins.relaxNG.model.Define;
+import org.intellij.plugins.relaxNG.model.Grammar;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.util.*;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 09.06.2010
+*/
+public class RelaxSymbolIndex extends ScalarIndexExtension<String> {
+  @NonNls
+  public static final ID<String, Void> NAME = ID.create("RelaxSymbolIndex");
+
+  public static Collection<String> getSymbolNames(Project project) {
+    return FileBasedIndex.getInstance().getAllKeys(NAME, project);
+  }
+
+  public static NavigationItem[] getSymbolsByName(final String name, Project project, boolean includeNonProjectItems) {
+    final GlobalSearchScope scope = includeNonProjectItems ? GlobalSearchScope.allScope(project) : GlobalSearchScope.projectScope(project);
+    final SymbolCollector processor = new SymbolCollector(name, project, scope);
+    FileBasedIndex.getInstance().processValues(NAME, name, null, processor, scope);
+    return processor.getResult();
+  }
+
+  @NotNull
+  @Override
+  public ID<String, Void> getName() {
+    return NAME;
+  }
+
+  @NotNull
+  @Override
+  public DataIndexer<String, Void, FileContent> getIndexer() {
+    return new DataIndexer<String, Void, FileContent>() {
+      @Override
+      @NotNull
+      public Map<String, Void> map(FileContent inputData) {
+        final HashMap<String, Void> map = new HashMap<String, Void>();
+        if (inputData.getFileType() == XmlFileType.INSTANCE) {
+          CharSequence inputDataContentAsText = inputData.getContentAsText();
+          if (CharArrayUtil.indexOf(inputDataContentAsText, ApplicationLoader.RNG_NAMESPACE, 0) == -1) return Collections.EMPTY_MAP;
+          NanoXmlUtil.parse(CharArrayUtil.readerFromCharSequence(inputData.getContentAsText()), new NanoXmlUtil.IXMLBuilderAdapter() {
+            NanoXmlUtil.IXMLBuilderAdapter attributeHandler;
+            int depth;
+
+            @Override
+            public void addAttribute(String key, String nsPrefix, String nsURI, String value, String type) throws Exception {
+              if (attributeHandler != null) {
+                attributeHandler.addAttribute(key, nsPrefix, nsURI, value, type);
+              }
+            }
+
+            @Override
+            public void startElement(String name, String nsPrefix, String nsURI, String systemID, int lineNr) throws Exception {
+              attributeHandler = null;
+              if (depth == 1 && ApplicationLoader.RNG_NAMESPACE.equals(nsURI)) {
+                if ("define".equals(name)) {
+                  attributeHandler = new NanoXmlUtil.IXMLBuilderAdapter() {
+                    @Override
+                    public void addAttribute(String key, String nsPrefix, String nsURI, String value, String type) throws Exception {
+                      if ("name".equals(key) && (nsURI == null || nsURI.length() == 0) && value != null) {
+                        map.put(value, null);
+                      }
+                    }
+                  };
+                }
+              }
+              depth++;
+            }
+
+            @Override
+            public void endElement(String name, String nsPrefix, String nsURI) throws Exception {
+              attributeHandler = null;
+              depth--;
+            }
+          });
+        } else if (inputData.getFileType() == RncFileType.getInstance()) {
+          final PsiFile file = inputData.getPsiFile();
+          if (file instanceof XmlFile) {
+            final Grammar grammar = GrammarFactory.getGrammar((XmlFile)file);
+            if (grammar != null) {
+              grammar.acceptChildren(new CommonElement.Visitor() {
+                @Override
+                public void visitDefine(Define define) {
+                  final String name = define.getName();
+                  if (name != null) {
+                    map.put(name, null);
+                  }
+                }
+              });
+            }
+          }
+        }
+        return map;
+      }
+    };
+  }
+
+  @Override
+  public KeyDescriptor<String> getKeyDescriptor() {
+    return new EnumeratorStringDescriptor();
+  }
+
+  @Override
+  public FileBasedIndex.InputFilter getInputFilter() {
+    return new FileBasedIndex.InputFilter() {
+      @Override
+      public boolean acceptInput(VirtualFile file) {
+        if (file.getFileSystem() instanceof JarFileSystem) {
+          return false; // there is lots and lots of custom XML inside zip files
+        }
+        return file.getFileType() == StdFileTypes.XML || file.getFileType() == RncFileType.getInstance();
+      }
+    };
+  }
+
+  @Override
+  public boolean dependsOnFileContent() {
+    return true;
+  }
+
+  @Override
+  public int getVersion() {
+    return 0;
+  }
+
+  private static class SymbolCollector implements FileBasedIndex.ValueProcessor<Void> {
+    private final GlobalSearchScope myScope;
+    private final PsiManager myMgr;
+    private final String myName;
+
+    private final Collection<NavigationItem> myResult = new ArrayList<NavigationItem>();
+
+    public SymbolCollector(String name, Project project, GlobalSearchScope scope) {
+      myMgr = PsiManager.getInstance(project);
+      myScope = scope;
+      myName = name;
+    }
+
+    @Override
+    public boolean process(VirtualFile file, Void kind) {
+      if (myScope.contains(file)) {
+        final PsiFile psiFile = myMgr.findFile(file);
+        if (psiFile instanceof XmlFile) {
+          final Grammar grammar = GrammarFactory.getGrammar((XmlFile)psiFile);
+          if (grammar != null) {
+            grammar.acceptChildren(new CommonElement.Visitor() {
+              @Override
+              public void visitDefine(Define define) {
+                if (myName.equals(define.getName())) {
+                  final PsiElement psi = define.getPsiElement();
+                  if (psi != null) {
+                    MyNavigationItem.add((NavigationItem)define.getPsiElement(), myResult);
+                  }
+                }
+              }
+            });
+          }
+        }
+      }
+      return true;
+    }
+
+    public NavigationItem[] getResult() {
+      return myResult.toArray(new NavigationItem[myResult.size()]);
+    }
+  }
+
+  private static class MyNavigationItem implements PsiElementNavigationItem, ItemPresentation {
+    private final NavigationItem myItem;
+    private final ItemPresentation myPresentation;
+
+    private MyNavigationItem(NavigationItem item, @NotNull final ItemPresentation presentation) {
+      myItem = item;
+      myPresentation = presentation;
+    }
+
+    @Override
+    public String getPresentableText() {
+      return myPresentation.getPresentableText();
+    }
+
+    @Override
+    @Nullable
+    public String getLocationString() {
+      return getLocationString((PsiElement)myItem);
+    }
+
+    private static String getLocationString(PsiElement element) {
+      return "(in " + element.getContainingFile().getName() + ")";
+    }
+
+    @Override
+    @Nullable
+    public Icon getIcon(boolean open) {
+      return myPresentation.getIcon(open);
+    }
+
+    @Nullable
+    public TextAttributesKey getTextAttributesKey() {
+      return myPresentation instanceof ColoredItemPresentation ? ((ColoredItemPresentation) myPresentation).getTextAttributesKey() : null;
+    }
+
+    @Override
+    public String getName() {
+      return myItem.getName();
+    }
+
+    @Override
+    public ItemPresentation getPresentation() {
+      return myPresentation != null ? this : null;
+    }
+
+    @Override
+    public PsiElement getTargetElement() {
+      return (PsiElement) myItem;
+    }
+
+    @Override
+    public void navigate(boolean requestFocus) {
+      myItem.navigate(requestFocus);
+    }
+
+    @Override
+    public boolean canNavigate() {
+      return myItem.canNavigate();
+    }
+
+    @Override
+    public boolean canNavigateToSource() {
+      return myItem.canNavigateToSource();
+    }
+
+    public static void add(final NavigationItem item, Collection<NavigationItem> symbolNavItems) {
+      final ItemPresentation presentation;
+      if (item instanceof PsiMetaOwner) {
+        final PsiMetaData data = ((PsiMetaOwner)item).getMetaData();
+        if (data instanceof PsiPresentableMetaData) {
+          final PsiPresentableMetaData metaData = (PsiPresentableMetaData)data;
+          presentation = new ColoredItemPresentation() {
+            @Override
+            public String getPresentableText() {
+              return metaData.getName();
+            }
+
+            @Override
+            @Nullable
+            public String getLocationString() {
+              return MyNavigationItem.getLocationString((PsiElement)item);
+            }
+
+            @Override
+            @Nullable
+            public Icon getIcon(boolean open) {
+              return metaData.getIcon();
+            }
+
+            @Nullable
+            @Override
+            public TextAttributesKey getTextAttributesKey() {
+              final ItemPresentation p = item.getPresentation();
+              return p instanceof ColoredItemPresentation ? ((ColoredItemPresentation) p).getTextAttributesKey() : null;
+            }
+          };
+        } else {
+          presentation = item.getPresentation();
+        }
+      } else {
+        presentation = item.getPresentation();
+      }
+
+      if (presentation != null) {
+        symbolNavItems.add(new MyNavigationItem(item, presentation));
+      }
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/references/AddValueCondition.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/AddValueCondition.java
new file mode 100644
index 0000000..739b0e5
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/AddValueCondition.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.references;
+
+import com.intellij.openapi.util.Key;
+import com.intellij.patterns.PatternCondition;
+import com.intellij.util.ProcessingContext;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Set;
+
+class AddValueCondition<T> extends PatternCondition<T> {
+  private final Key<? extends Set<T>> myKey;
+
+  public AddValueCondition(Key<? extends Set<T>> key) {
+    super("AddValue");
+    myKey = key;
+  }
+
+  public static <T> AddValueCondition<T> create(Key<? extends Set<T>> key) {
+    return new AddValueCondition<T>(key);
+  }
+
+  public boolean accepts(@NotNull T value, ProcessingContext context) {
+    context.get(myKey).add(value);
+    return true;
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/references/AttributeValueCondition.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/AttributeValueCondition.java
new file mode 100644
index 0000000..b1ce0d3
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/AttributeValueCondition.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.references;
+
+import com.intellij.patterns.PatternCondition;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.util.ProcessingContext;
+import org.jetbrains.annotations.NotNull;
+
+class AttributeValueCondition extends PatternCondition<XmlAttributeValue> {
+  private final String myRef;
+
+  public AttributeValueCondition(String ref) {
+    super("AttributeValue");
+    myRef = ref;
+  }
+
+  public boolean accepts(@NotNull XmlAttributeValue value, ProcessingContext context) {
+    return myRef.equals(value.getValue());
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/references/AttributeValueFunction.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/AttributeValueFunction.java
new file mode 100644
index 0000000..fd5468e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/AttributeValueFunction.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.references;
+
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+
+import java.util.Set;
+
+class AttributeValueFunction implements Function<XmlAttributeValue, String> {
+  public String fun(XmlAttributeValue value) {
+    return value.getValue();
+  }
+
+  public static String[] toStrings(Set<XmlAttributeValue> values) {
+    return ContainerUtil.map2Array(values, String.class, new AttributeValueFunction());
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/references/FileReferenceUtil.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/FileReferenceUtil.java
new file mode 100644
index 0000000..13ca07e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/FileReferenceUtil.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.references;
+
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.util.Condition;
+import com.intellij.patterns.PsiFilePattern;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceSet;
+import com.intellij.util.NotNullFunction;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import static com.intellij.patterns.XmlPatterns.*;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 29.08.2007
+ */
+public class FileReferenceUtil {
+
+  public static PsiReference[] restrict(FileReferenceSet set, final Condition<PsiFile> cond) {
+    return restrict(set, cond, null);
+  }
+
+  public static PsiReference[] restrict(FileReferenceSet set, final Condition<PsiFile> cond, final Boolean soft) {
+    final FileReference[] references = set.getAllReferences();
+
+    return ContainerUtil.map2Array(references, PsiReference.class, new NotNullFunction<FileReference, PsiReference>() {
+      @NotNull
+      public PsiReference fun(FileReference fileReference) {
+        return new MyFileReference(fileReference, cond, soft);
+      }
+    });
+  }
+
+  public static Condition<PsiFile> byType(FileType instance) {
+    return new TypeCondition(instance);
+  }
+
+  public static Condition<PsiFile> byNamespace(String ns) {
+    return new PatternCondition(xmlFile().withRootTag(xmlTag().withNamespace(string().equalTo(ns))));
+  }
+
+  private static class TypeCondition implements Condition<PsiFile> {
+    private final FileType myType;
+
+    public TypeCondition(FileType type) {
+      myType = type;
+    }
+
+    public boolean value(PsiFile file) {
+      return file.getFileType() == myType;
+    }
+  }
+
+  private static class PatternCondition implements Condition<PsiFile> {
+    private final PsiFilePattern myPattern;
+
+    public PatternCondition(PsiFilePattern pattern) {
+      myPattern = pattern;
+    }
+
+    public boolean value(PsiFile o) {
+      return myPattern.accepts(o);
+    }
+  }
+
+  private static class MyFileReference extends FileReference {
+    private final Condition<PsiFile> myCond;
+    private final Boolean mySoft;
+
+    public MyFileReference(FileReference fileReference, Condition<PsiFile> cond, @Nullable Boolean soft) {
+      super(fileReference.getFileReferenceSet(), fileReference.getRangeInElement(), fileReference.getIndex(), fileReference.getCanonicalText());
+      myCond = cond;
+      mySoft = soft;
+    }
+
+    @Override
+    public boolean isSoft() {
+      return mySoft == null ? super.isSoft() : mySoft;
+    }
+
+    @Override
+    public PsiFileSystemItem resolve() {
+      final PsiFileSystemItem result = super.resolve();
+      if (result instanceof PsiFile) {
+        if (!myCond.value((PsiFile)result)) {
+          return null;
+        }
+      }
+      return result;
+    }
+
+    @Override
+    protected ResolveResult[] innerResolve() {
+      final ResolveResult[] results = super.innerResolve();
+      return ContainerUtil.findAll(results, new Condition<ResolveResult>() {
+        public boolean value(ResolveResult resolveResult) {
+          final PsiElement e = resolveResult.getElement();
+          return match(e, myCond);
+        }
+      }).toArray(ResolveResult.EMPTY_ARRAY);
+    }
+
+    @NotNull
+    @Override
+    public Object[] getVariants() {
+      final Object[] variants = super.getVariants();
+      return ContainerUtil.findAll(variants, new Condition<Object>() {
+        public boolean value(Object o) {
+          /*if (o instanceof CandidateInfo) {
+            o = ((CandidateInfo)o).getElement();
+          }*/
+          return match(o, myCond);
+        }
+      }).toArray();
+    }
+
+    private static boolean match(Object o, Condition<PsiFile> cond) {
+      return !(o instanceof PsiFileSystemItem) ||
+              ((PsiFileSystemItem)o).isDirectory() ||
+              (o instanceof PsiFile && cond.value((PsiFile)o));
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/references/IdRefProvider.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/IdRefProvider.java
new file mode 100644
index 0000000..af803b4
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/IdRefProvider.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.references;
+
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.patterns.PatternCondition;
+import com.intellij.patterns.XmlAttributeValuePattern;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiReferenceBase;
+import com.intellij.psi.impl.source.resolve.reference.PsiReferenceProviderBase;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.AttributeValueSelfReference;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ProcessingContext;
+import com.intellij.xml.XmlAttributeDescriptor;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import static com.intellij.patterns.XmlPatterns.xmlAttribute;
+import static com.intellij.patterns.XmlPatterns.xmlAttributeValue;
+
+public class IdRefProvider extends PsiReferenceProviderBase {
+  public static final HasIdRefTypeCondition HAS_ID_REF_TYPE = new HasIdRefTypeCondition();
+  public static final HasIdTypeCondition HAS_ID_TYPE = new HasIdTypeCondition();
+
+  @NotNull
+  public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
+    final XmlAttributeValue value = (XmlAttributeValue)element;
+
+    if (hasIdRefType(value)) {
+      return new PsiReference[]{
+              new IdReference(value)
+      };
+    } else if (hasIdType(value)) {
+      return new PsiReference[]{
+              new AttributeValueSelfReference(element)
+      };
+    }
+    return PsiReference.EMPTY_ARRAY;
+  }
+
+  private static class IdReference extends PsiReferenceBase<XmlAttributeValue> {
+
+    private static final Key<XmlAttributeValue> TARGET = Key.create("target");
+    private static final Key<Set<XmlAttributeValue>> VARIANTS = Key.create("variants");
+    private static final XmlAttributeValuePattern PATTERN = xmlAttributeValue().withParent(xmlAttribute()).with(HAS_ID_TYPE);
+
+    private final AttributeValueCondition myCondition;
+
+    public IdReference(XmlAttributeValue element) {
+      super(element, TextRange.from(1, element.getTextLength() - 2), true);
+      myCondition = new AttributeValueCondition(element.getValue());
+    }
+
+    public PsiElement resolve() {
+      final ProcessingContext context = new ProcessingContext();
+      final ResolvingVisitor visitor = new ResolvingVisitor(PATTERN.with(myCondition).save(TARGET), context) {
+        public void visitXmlTag(XmlTag tag) {
+          super.visitXmlTag(tag);
+          if (shouldContinue()) {
+            visitSubTags(tag);
+          }
+        }
+        protected boolean shouldContinue() {
+          return context.get(TARGET) == null;
+        }
+      };
+
+      process(visitor);
+
+      return context.get(TARGET);
+    }
+
+    private void process(ResolvingVisitor visitor) {
+      final XmlDocument document = PsiTreeUtil.getParentOfType(getElement(), XmlDocument.class);
+      if (document != null) {
+        visitor.execute(document);
+      }
+    }
+
+    @NotNull
+    public Object[] getVariants() {
+      final ProcessingContext context = new ProcessingContext();
+      context.put(VARIANTS, new HashSet<XmlAttributeValue>());
+
+      final ResolvingVisitor visitor = new ResolvingVisitor(PATTERN.with(AddValueCondition.create(VARIANTS)), context) {
+        public void visitXmlTag(XmlTag tag) {
+          super.visitXmlTag(tag);
+          visitSubTags(tag);
+        }
+      };
+
+      process(visitor);
+
+      return AttributeValueFunction.toStrings(context.get(VARIANTS));
+    }
+  }
+
+  private static boolean hasIdType(XmlAttributeValue xmlAttributeValue) {
+    final XmlAttributeDescriptor descriptor = ((XmlAttribute)xmlAttributeValue.getParent()).getDescriptor();
+    return descriptor != null && descriptor.hasIdType();
+  }
+
+  private static boolean hasIdRefType(XmlAttributeValue xmlAttributeValue) {
+    final XmlAttributeDescriptor descriptor = ((XmlAttribute)xmlAttributeValue.getParent()).getDescriptor();
+    return descriptor != null && descriptor.hasIdRefType();
+  }
+
+  static class HasIdTypeCondition extends PatternCondition<XmlAttributeValue> {
+    public HasIdTypeCondition() {
+      super("IdType");
+    }
+
+    public boolean accepts(@NotNull XmlAttributeValue xmlAttributeValue, ProcessingContext context) {
+      return hasIdType(xmlAttributeValue);
+    }
+  }
+
+  static class HasIdRefTypeCondition extends PatternCondition<XmlAttributeValue> {
+    public HasIdRefTypeCondition() {
+      super("IdRef");
+    }
+
+    public boolean accepts(@NotNull XmlAttributeValue xmlAttributeValue,  ProcessingContext context) {
+      return hasIdRefType(xmlAttributeValue);
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/references/PrefixReferenceProvider.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/PrefixReferenceProvider.java
new file mode 100644
index 0000000..27015b9
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/PrefixReferenceProvider.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.references;
+
+import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
+import com.intellij.codeInsight.daemon.QuickFixProvider;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.analysis.CreateNSDeclarationIntentionFix;
+import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiReferenceProvider;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.BasicAttributeValueReference;
+import com.intellij.psi.impl.source.xml.SchemaPrefix;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.ProcessingContext;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 24.07.2007
+*/
+public class PrefixReferenceProvider extends PsiReferenceProvider {
+  private static final Logger LOG = Logger.getInstance("#org.intellij.plugins.relaxNG.references.PrefixReferenceProvider");
+
+  @NotNull
+  public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
+    final XmlAttributeValue value = (XmlAttributeValue)element;
+
+    final String s = value.getValue();
+    final int i = s.indexOf(':');
+    if (i <= 0 || s.startsWith("xml:")) {
+      return PsiReference.EMPTY_ARRAY;
+    }
+
+    return new PsiReference[]{
+            new PrefixReference(value, i)
+    };
+  }
+
+  private static class PrefixReference extends BasicAttributeValueReference implements EmptyResolveMessageProvider, QuickFixProvider<PrefixReference> {
+    public PrefixReference(XmlAttributeValue value, int length) {
+      super(value, TextRange.from(1, length));
+    }
+
+    @Nullable
+    public PsiElement resolve() {
+      final String prefix = getCanonicalText();
+      XmlTag tag = PsiTreeUtil.getParentOfType(getElement(), XmlTag.class);
+      while (tag != null) {
+        if (tag.getLocalNamespaceDeclarations().containsKey(prefix)) {
+          final XmlAttribute attribute = tag.getAttribute("xmlns:" + prefix, "");
+          final TextRange textRange = TextRange.from("xmlns:".length(), prefix.length());
+          return new SchemaPrefix(attribute, textRange, prefix);
+        }
+        tag = tag.getParentTag();
+      }
+      return null;
+    }
+
+    @Override
+    public boolean isReferenceTo(PsiElement element) {
+      if (element instanceof SchemaPrefix && element.getContainingFile() == myElement.getContainingFile()) {
+        final PsiElement e = resolve();
+        if (e instanceof SchemaPrefix) {
+          final String s = ((SchemaPrefix)e).getName();
+          return s != null && s.equals(((SchemaPrefix)element).getName());
+        }
+      }
+      return super.isReferenceTo(element);
+    }
+
+    public void registerQuickfix(HighlightInfo info, PrefixReference reference) {
+      try {
+        final PsiElement element = reference.getElement();
+        final XmlElementFactory factory = XmlElementFactory.getInstance(element.getProject());
+        final String value = ((XmlAttributeValue)element).getValue();
+        final String[] name = value.split(":");
+        final XmlTag tag = factory.createTagFromText("<" + (name.length > 1 ? name[1] : value) + " />", XMLLanguage.INSTANCE);
+
+        CreateNSDeclarationIntentionFix fix = CreateNSDeclarationIntentionFix.createFix(tag, reference.getCanonicalText());
+        QuickFixAction.registerQuickFixAction(info, fix);
+      } catch (Throwable e) {
+        LOG.error(e);
+      }
+    }
+
+    @NotNull
+    public Object[] getVariants() {
+      return ArrayUtil.EMPTY_OBJECT_ARRAY;
+    }
+
+    public boolean isSoft() {
+      return false;
+    }
+
+    public String getUnresolvedMessagePattern() {
+      return "Undefined namespace prefix ''{0}''";
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/references/ResolvingVisitor.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/ResolvingVisitor.java
new file mode 100644
index 0000000..116ea24
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/ResolvingVisitor.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.references;
+
+import com.intellij.openapi.util.Key;
+import com.intellij.patterns.XmlAttributeValuePattern;
+import com.intellij.patterns.XmlNamedElementPattern;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.XmlElementVisitor;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ProcessingContext;
+import com.intellij.xml.util.XmlUtil;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Set;
+
+class ResolvingVisitor extends XmlElementVisitor implements PsiElementProcessor {
+  static final Key<Set<XmlFile>> VISITED_KEY = Key.create("visited");
+
+  private final XmlAttributeValuePattern myPattern;
+  private final ProcessingContext myProcessingContext;
+  private XmlNamedElementPattern myIncludePattern;
+
+  public ResolvingVisitor(XmlAttributeValuePattern pattern, ProcessingContext context) {
+    myPattern = pattern;
+    myProcessingContext = context;
+
+    myProcessingContext.put(VISITED_KEY, new THashSet<XmlFile>());
+  }
+
+  public void visitXmlDocument(@Nullable XmlDocument document) {
+    if (document != null) {
+      final XmlTag rootTag = document.getRootTag();
+      if (rootTag != null) {
+        visitXmlTag(rootTag);
+      }
+    }
+  }
+
+  public void setIncludePattern(XmlNamedElementPattern includePattern) {
+    myIncludePattern = includePattern;
+  }
+
+  public void visitXmlAttribute(XmlAttribute attribute) {
+    if (myIncludePattern != null && myIncludePattern.accepts(attribute, myProcessingContext)) {
+      final String value = attribute.getValue();
+      if (value == null) return;
+
+      final XmlFile xmlFile = XmlUtil.findXmlFile(attribute.getContainingFile(), value);
+      if (xmlFile != null) {
+        processInclude(xmlFile, attribute);
+      }
+    } else {
+      processAttribute(attribute);
+    }
+  }
+
+  private void processAttribute(XmlAttribute attribute) {
+    myPattern.accepts(attribute.getValueElement(), myProcessingContext);
+  }
+
+  @SuppressWarnings({ "ForLoopReplaceableByForEach" })
+  public void visitXmlTag(XmlTag tag) {
+    visitAttributes(tag);
+  }
+
+  protected void visitAttributes(XmlTag tag) {
+    final XmlAttribute[] xmlAttributes = tag.getAttributes();
+    for (XmlAttribute attribute : xmlAttributes) {
+      attribute.accept(this);
+    }
+  }
+
+  protected void visitSubTags(XmlTag tag) {
+    final XmlTag[] tags = tag.getSubTags();
+    for (XmlTag subTag : tags) {
+      if (shouldContinue()) {
+        subTag.accept(this);
+      }
+    }
+  }
+
+  private void processInclude(XmlFile xmlFile, XmlAttribute attribute) {
+    final Set<XmlFile> set = myProcessingContext.get(VISITED_KEY);
+    if (set.contains(xmlFile)) {
+      return;
+    }
+    set.add(xmlFile);
+
+    final XmlDocument document = xmlFile.getDocument();
+    if (document == null) return;
+    final XmlTag rootTag = document.getRootTag();
+    if (rootTag == null) return;
+
+    rootTag.processElements(this, attribute);
+  }
+
+  public boolean execute(@NotNull PsiElement element) {
+    element.accept(this);
+    return shouldContinue();
+  }
+
+  protected boolean shouldContinue() {
+    return true;
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/MessageViewHelper.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/MessageViewHelper.java
new file mode 100644
index 0000000..a2baae2
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/MessageViewHelper.java
@@ -0,0 +1,257 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.validation;
+
+import com.intellij.ide.errorTreeView.NewErrorTreeViewPanel;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.wm.ToolWindowId;
+import com.intellij.openapi.wm.ToolWindowManager;
+import com.intellij.ui.content.*;
+import com.intellij.util.ui.ErrorTreeView;
+import com.intellij.util.ui.MessageCategory;
+import gnu.trove.THashSet;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Set;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 19.11.2007
+ */
+public class MessageViewHelper {
+  private static final Logger LOG = Logger.getInstance("#org.intellij.plugins.relaxNG.validation.MessageViewHelper");
+
+  private final Project myProject;
+
+  private final Set<String> myErrors = new THashSet<String>();
+
+  private final String myContentName;
+  private final Key<NewErrorTreeViewPanel> myKey;
+
+  private NewErrorTreeViewPanel myErrorsView;
+  private NewErrorTreeViewPanel.ProcessController myProcessController = MyProcessController.INSTANCE;
+
+  public MessageViewHelper(Project project, String contentName, Key<NewErrorTreeViewPanel> key) {
+    myProject = project;
+    myContentName = contentName;
+    myKey = key;
+  }
+
+  public synchronized void setProcessController(NewErrorTreeViewPanel.ProcessController processController) {
+    if (myErrorsView == null) {
+      myProcessController = processController;
+    } else {
+      myErrorsView.setProcessController(processController);
+    }
+  }
+
+  public synchronized void openMessageView(Runnable rerun) {
+    assert myErrorsView == null;
+    myErrorsView = new NewErrorTreeViewPanel(myProject, null, true, true, rerun);
+    openMessageViewImpl();
+  }
+
+  public synchronized void processError(final SAXParseException ex, final boolean warning) {
+    if (myErrors.size() == 0 && myErrorsView == null) {
+      myErrorsView = new NewErrorTreeViewPanel(myProject, null, true, true, null);
+      myErrorsView.setProcessController(myProcessController);
+      openMessageViewImpl();
+    }
+    final String error = ex.getLineNumber() + "|" + ex.getColumnNumber() + "|" + ex.getSystemId() + "|" + ex.getLocalizedMessage();
+    if (!myErrors.add(error)) {
+      return;
+    }
+
+    VirtualFile file = null;
+    final String systemId = ex.getSystemId();
+    if (systemId != null) {
+      try {
+        file = VfsUtil.findFileByURL(new URL(systemId));
+      } catch (MalformedURLException e) {
+        LOG.warn("systemId = " + systemId);
+        LOG.error(e);
+      }
+    }
+
+    final VirtualFile file1 = file;
+    ApplicationManager.getApplication().invokeLater(
+      new Runnable() {
+        public void run() {
+          myErrorsView.addMessage(
+            warning ? MessageCategory.WARNING : MessageCategory.ERROR,
+            new String[]{ex.getLocalizedMessage()},
+            file1,
+            ex.getLineNumber() - 1,
+            ex.getColumnNumber() - 1, null);
+        }
+      }
+    );
+  }
+
+  public void close() {
+    removeOldContents(null);
+  }
+
+  private void removeOldContents(Content notToRemove) {
+    MessageView messageView = MessageView.SERVICE.getInstance(myProject);
+
+    for (Content content : messageView.getContentManager().getContents()) {
+      if (content.isPinned()) continue;
+      if (myContentName.equals(content.getDisplayName()) && content != notToRemove) {
+        ErrorTreeView listErrorView = (ErrorTreeView)content.getComponent();
+        if (listErrorView != null) {
+          if (messageView.getContentManager().removeContent(content, true)) {
+            content.release();
+          }
+        }
+      }
+    }
+  }
+
+  private void openMessageViewImpl() {
+    CommandProcessor commandProcessor = CommandProcessor.getInstance();
+    commandProcessor.executeCommand(myProject, new Runnable() {
+      public void run() {
+        MessageView messageView = MessageView.SERVICE.getInstance(myProject);
+        Content content = ContentFactory.SERVICE.getInstance().createContent(myErrorsView.getComponent(), myContentName, true);
+        content.putUserData(myKey, myErrorsView);
+        messageView.getContentManager().addContent(content);
+        messageView.getContentManager().setSelectedContent(content);
+        messageView.getContentManager().addContentManagerListener(new CloseListener(content, myContentName, myErrorsView));
+        removeOldContents(content);
+        messageView.getContentManager().addContentManagerListener(new MyContentDisposer(content, messageView, myKey));
+      }
+    }, "Open Message View", null);
+
+    ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.MESSAGES_WINDOW).activate(null);
+  }
+
+  private static class MyProcessController implements NewErrorTreeViewPanel.ProcessController {
+    public static final MyProcessController INSTANCE = new MyProcessController();
+
+    public void stopProcess() {
+    }
+
+    public boolean isProcessStopped() {
+      return true;
+    }
+  }
+
+  private static class CloseListener extends ContentManagerAdapter {
+    private final String myContentName;
+
+    private NewErrorTreeViewPanel myErrorsView;
+    private Content myContent;
+
+    public CloseListener(Content content, String contentName, NewErrorTreeViewPanel errorsView) {
+      myContent = content;
+      myContentName = contentName;
+      myErrorsView = errorsView;
+    }
+
+    public void contentRemoved(ContentManagerEvent event) {
+      if (event.getContent() == myContent) {
+        if (myErrorsView.canControlProcess()) {
+          myErrorsView.stopProcess();
+        }
+        myErrorsView = null;
+
+        myContent.getManager().removeContentManagerListener(this);
+        myContent.release();
+        myContent = null;
+      }
+    }
+
+    public void contentRemoveQuery(ContentManagerEvent event) {
+      if (event.getContent() == myContent) {
+        if (myErrorsView != null && myErrorsView.canControlProcess() && !myErrorsView.isProcessStopped()) {
+          int result = Messages.showYesNoDialog(
+            myContentName + " Running",
+            myContentName + " is still running. Close anyway?",
+              Messages.getQuestionIcon()
+          );
+          if (result != 0) {
+            event.consume();
+          }
+        }
+      }
+    }
+  }
+
+  private static class MyContentDisposer extends ContentManagerAdapter {
+    private final Content myContent;
+    private final MessageView myMessageView;
+    private final Key<NewErrorTreeViewPanel> myKey;
+
+    MyContentDisposer(final Content content, final MessageView messageView, Key<NewErrorTreeViewPanel> key) {
+      myContent = content;
+      myMessageView = messageView;
+      myKey = key;
+    }
+
+    public void contentRemoved(ContentManagerEvent event) {
+      final Content eventContent = event.getContent();
+      if (!eventContent.equals(myContent)) {
+        return;
+      }
+      myMessageView.getContentManager().removeContentManagerListener(this);
+      NewErrorTreeViewPanel errorTreeView = eventContent.getUserData(myKey);
+      if (errorTreeView != null) {
+        errorTreeView.dispose();
+      }
+      eventContent.putUserData(myKey, null);
+    }
+  }
+
+  public class ErrorHandler extends DefaultHandler {
+    private boolean myHadErrorOrWarning;
+
+    @Override
+    public void warning(SAXParseException e) throws SAXException {
+      myHadErrorOrWarning = true;
+      processError(e, true);
+    }
+
+    @Override
+    public void error(SAXParseException e) throws SAXException {
+      myHadErrorOrWarning = true;
+      processError(e, false);
+    }
+
+    @Override
+    public void fatalError(SAXParseException e) throws SAXException {
+      myHadErrorOrWarning = true;
+      processError(e, false);
+    }
+
+    public boolean hadErrorOrWarning() {
+      return myHadErrorOrWarning;
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/Psi2SaxAdapter.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/Psi2SaxAdapter.java
new file mode 100644
index 0000000..c95a455
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/Psi2SaxAdapter.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.validation;
+
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.XmlElementVisitor;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.xml.*;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NotNull;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.Attributes2Impl;
+import org.xml.sax.ext.Locator2Impl;
+
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 30.07.2007
+*/
+class Psi2SaxAdapter extends XmlElementVisitor implements PsiElementProcessor<PsiElement> {
+  private final ContentHandler myHandler;
+
+  public Psi2SaxAdapter(ContentHandler handler) {
+    myHandler = handler;
+  }
+
+  public void visitXmlElement(XmlElement element) {
+    if (element instanceof XmlEntityRef) {
+      XmlUtil.processXmlElements(element, this, false, true);
+    }
+    super.visitXmlElement(element);
+  }
+
+  public void visitXmlToken(XmlToken token) {
+    if (token.getTokenType() == XmlTokenType.XML_DATA_CHARACTERS) {
+      handleText(token, token.getText());
+    }
+  }
+
+  private void handleText(XmlElement element, String text) {
+    try {
+      setLocation(element);
+      myHandler.characters(text.toCharArray(), 0, text.length());
+    } catch (SAXException e) {
+      throw new ParseError(e);
+    }
+  }
+
+  public boolean execute(@NotNull PsiElement element) {
+    element.accept(this);
+    return true;
+  }
+
+  public void visitXmlDocument(XmlDocument document) {
+    try {
+      myHandler.startDocument();
+      final XmlTag rootTag = document.getRootTag();
+      if (rootTag != null) {
+        rootTag.accept(this);
+      }
+      myHandler.endDocument();
+    } catch (SAXException e) {
+      throw new ParseError(e);
+    }
+  }
+
+  public void visitXmlTag(XmlTag tag) {
+    try {
+      setLocation(tag);
+
+      final Map<String,String> map = tag.getLocalNamespaceDeclarations();
+      final String[] prefixes = map.keySet().toArray(new String[map.size()]);
+      for (String prefix : prefixes) {
+        myHandler.startPrefixMapping(prefix, map.get(prefix));
+      }
+
+      final Attributes2Impl atts = new Attributes2Impl();
+      final XmlAttribute[] xmlAttributes = tag.getAttributes();
+      for (XmlAttribute attribute : xmlAttributes) {
+        final String s = attribute.getName();
+        if (!"xmlns".equals(s) && !s.startsWith("xmlns:")) {
+          final String uri = attribute.getNamespace();
+          atts.addAttribute(s.contains(":") ? uri : "", attribute.getLocalName(), s, "PCDATA", attribute.getValue());
+        }
+      }
+
+      final String namespace = tag.getNamespace();
+      final String localName = tag.getLocalName();
+      final String name = tag.getName();
+      myHandler.startElement(namespace, localName, name, atts);
+
+      PsiElement child = tag.getFirstChild();
+      while (child != null) {
+        child.accept(this);
+        child = child.getNextSibling();
+      }
+
+      myHandler.endElement(namespace, localName, name);
+
+      for (int i = prefixes.length - 1; i >= 0; i--) {
+        String prefix = prefixes[i];
+        myHandler.endPrefixMapping(prefix);
+      }
+    } catch (SAXException e) {
+      throw new ParseError(e);
+    }
+  }
+
+  public void visitXmlText(XmlText text) {
+    handleText(text, text.getValue());
+  }
+
+  private void setLocation(PsiElement text) {
+    final PsiFile psiFile = text.getContainingFile();
+    final Document document = PsiDocumentManager.getInstance(text.getProject()).getDocument(psiFile);
+    if (document == null) {
+      return;
+    }
+    final VirtualFile virtualFile = psiFile.getVirtualFile();
+    if (virtualFile == null) {
+      return;
+    }
+
+    final Locator2Impl locator = new Locator2Impl();
+    locator.setSystemId(RngParser.reallyFixIDEAUrl(virtualFile.getUrl()));
+
+    final int offset = text.getTextRange().getEndOffset();
+    final int lineNumber = document.getLineNumber(offset);
+
+    locator.setLineNumber(lineNumber + 1);
+    locator.setColumnNumber(1 + offset - document.getLineStartOffset(lineNumber));
+
+    myHandler.setDocumentLocator(locator);
+  }
+
+  public static class ParseError extends RuntimeException {
+    public ParseError(SAXException e) {
+      super(e);
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/RngParser.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/RngParser.java
new file mode 100644
index 0000000..10c3722
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/RngParser.java
@@ -0,0 +1,212 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.validation;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.CachedValue;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.xml.util.XmlUtil;
+import com.thaiopensource.relaxng.impl.SchemaReaderImpl;
+import com.thaiopensource.util.PropertyMap;
+import com.thaiopensource.util.PropertyMapBuilder;
+import com.thaiopensource.validate.Schema;
+import com.thaiopensource.xml.sax.Sax2XMLReaderCreator;
+import com.thaiopensource.xml.sax.XMLReaderCreator;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+import org.intellij.plugins.relaxNG.model.resolve.RelaxIncludeIndex;
+import org.kohsuke.rngom.ast.builder.BuildException;
+import org.kohsuke.rngom.ast.builder.IncludedGrammar;
+import org.kohsuke.rngom.ast.builder.SchemaBuilder;
+import org.kohsuke.rngom.ast.om.ParsedPattern;
+import org.kohsuke.rngom.binary.SchemaBuilderImpl;
+import org.kohsuke.rngom.digested.DPattern;
+import org.kohsuke.rngom.digested.DSchemaBuilderImpl;
+import org.kohsuke.rngom.parse.IllegalSchemaException;
+import org.kohsuke.rngom.parse.Parseable;
+import org.kohsuke.rngom.parse.compact.CompactParseable;
+import org.kohsuke.rngom.parse.xml.SAXParseable;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import java.io.StringReader;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 19.07.2007
+*/
+public class RngParser {
+  private static final Logger LOG = Logger.getInstance("#org.intellij.plugins.relaxNG.validation.RngParser");
+
+  static final Key<CachedValue<Schema>> SCHEMA_KEY = Key.create("SCHEMA");
+  static final Key<CachedValue<DPattern>> PATTERN_KEY = Key.create("PATTERN");
+
+  public static final DefaultHandler DEFAULT_HANDLER = new DefaultHandler() {
+    public void error(SAXParseException e) throws SAXException {
+      LOG.info("e.getMessage() = " + e.getMessage() + " [" + e.getSystemId() + "]");
+      LOG.info(e);
+    }
+  };
+
+  static final PropertyMap EMPTY_PROPS = new PropertyMapBuilder().toPropertyMap();
+
+  public static DPattern getCachedPattern(final PsiFile descriptorFile, final ErrorHandler eh) {
+    final CachedValuesManager mgr = CachedValuesManager.getManager(descriptorFile.getProject());
+
+    return mgr.getCachedValue(descriptorFile, PATTERN_KEY, new CachedValueProvider<DPattern>() {
+      public Result<DPattern> compute() {
+        return Result.create(parsePattern(descriptorFile, eh, false), descriptorFile);
+      }
+    }, false);
+  }
+
+  public static DPattern parsePattern(final PsiFile file, final ErrorHandler eh, boolean checking) {
+    try {
+      final Parseable p = createParsable(file, eh);
+      if (checking) {
+        p.parse(new SchemaBuilderImpl(eh));
+      } else {
+        return p.parse(new DSchemaBuilderImpl());
+      }
+    } catch (BuildException e) {
+      LOG.info(e);
+    } catch (IllegalSchemaException e) {
+      LOG.info("invalid schema: " + file.getVirtualFile().getPresentableUrl());
+    }
+    return null;
+  }
+
+  private static Parseable createParsable(final PsiFile file, final ErrorHandler eh) {
+    final InputSource source = makeInputSource(file);
+
+    if (file.getFileType() == RncFileType.getInstance()) {
+      return new CompactParseable(source, eh) {
+        public ParsedPattern parseInclude(String uri, SchemaBuilder schemaBuilder, IncludedGrammar g, String inheritedNs)
+                throws BuildException, IllegalSchemaException
+        {
+          return super.parseInclude(resolveURI(file, uri), schemaBuilder, g, inheritedNs);
+        }
+      };
+    } else {
+      return new SAXParseable(source, eh) {
+        public ParsedPattern parseInclude(String uri, SchemaBuilder schemaBuilder, IncludedGrammar g, String inheritedNs)
+                throws BuildException, IllegalSchemaException
+        {
+          return super.parseInclude(resolveURI(file, uri), schemaBuilder, g, inheritedNs);
+        }
+      };
+    }
+  }
+
+  public static String resolveURI(PsiFile descriptorFile, String s) {
+    final PsiFile file = XmlUtil.findXmlFile(descriptorFile, s);
+
+    if (file != null) {
+      final VirtualFile virtualFile = file.getVirtualFile();
+      if (virtualFile != null) {
+        final PsiDocumentManager dm = PsiDocumentManager.getInstance(file.getProject());
+        final Document d = dm.getCachedDocument(file);
+        if (d != null) {
+          // TODO: fix. write action + saving -> deadlock
+//          dm.commitDocument(d);
+//          FileDocumentManager.getInstance().saveDocument(d);
+        }
+        s = reallyFixIDEAUrl(virtualFile.getUrl());
+      }
+    }
+    return s;
+  }
+
+  public static String reallyFixIDEAUrl(String url) {
+    String s = VfsUtil.fixIDEAUrl(url);
+    if (!SystemInfo.isWindows) {
+      // Linux:
+      //    "file://tmp/foo.bar"  (produced by com.intellij.openapi.vfs.VfsUtil.fixIDEAUrl) doesn't work: "java.net.UnknownHostException: tmp"
+      //    "file:/tmp/foo.bar"   (produced by File.toURL()) works fine
+      s = s.replaceFirst("file:/+", "file:/");
+    }
+    return s;
+  }
+
+  public static Schema getCachedSchema(final XmlFile descriptorFile) {
+    CachedValue<Schema> value = descriptorFile.getUserData(SCHEMA_KEY);
+    if (value == null) {
+      final CachedValueProvider<Schema> provider = new CachedValueProvider<Schema>() {
+        public Result<Schema> compute() {
+          final InputSource inputSource = makeInputSource(descriptorFile);
+
+          try {
+            final Schema schema = new MySchemaReader(descriptorFile).createSchema(inputSource, EMPTY_PROPS);
+            final PsiElementProcessor.CollectElements<XmlFile> processor = new PsiElementProcessor.CollectElements<XmlFile>();
+            RelaxIncludeIndex.processForwardDependencies(descriptorFile, processor);
+            if (processor.getCollection().size() > 0) {
+              return Result.create(schema, processor.toArray(), descriptorFile);
+            } else {
+              return Result.createSingleDependency(schema, descriptorFile);
+            }
+          } catch (Exception e) {
+            LOG.info(e);
+            return Result.createSingleDependency(null, descriptorFile);
+          }
+        }
+      };
+
+      final CachedValuesManager mgr = CachedValuesManager.getManager(descriptorFile.getProject());
+      value = mgr.createCachedValue(provider,  false);
+      descriptorFile.putUserData(SCHEMA_KEY, value);
+    }
+    return value.getValue();
+  }
+
+  private static InputSource makeInputSource(PsiFile descriptorFile) {
+    final InputSource inputSource = new InputSource(new StringReader(descriptorFile.getText()));
+    final VirtualFile file = descriptorFile.getVirtualFile();
+    if (file != null) {
+      inputSource.setSystemId(reallyFixIDEAUrl(file.getUrl()));
+    }
+    return inputSource;
+  }
+
+  static class MySchemaReader extends SchemaReaderImpl {
+    private final PsiFile myDescriptorFile;
+
+    public MySchemaReader(PsiFile descriptorFile) {
+      myDescriptorFile = descriptorFile;
+    }
+
+    protected com.thaiopensource.relaxng.parse.Parseable createParseable(XMLReaderCreator xmlReaderCreator, InputSource inputSource, ErrorHandler errorHandler) {
+      if (myDescriptorFile.getFileType() == RncFileType.getInstance()) {
+        return new com.thaiopensource.relaxng.parse.compact.CompactParseable(inputSource, errorHandler);
+      } else {
+        return new com.thaiopensource.relaxng.parse.sax.SAXParseable(new Sax2XMLReaderCreator(), inputSource, errorHandler);
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/RngSchemaValidator.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/RngSchemaValidator.java
new file mode 100644
index 0000000..f102f2a
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/RngSchemaValidator.java
@@ -0,0 +1,250 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.validation;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.annotation.AnnotationHolder;
+import com.intellij.lang.annotation.ExternalAnnotator;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.VirtualFileManager;
+import com.intellij.psi.*;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.*;
+import org.intellij.plugins.relaxNG.ApplicationLoader;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+import org.intellij.plugins.relaxNG.compact.psi.RncFile;
+import org.intellij.plugins.relaxNG.model.resolve.RelaxIncludeIndex;
+import org.jetbrains.annotations.NonNls;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import java.net.URL;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 18.07.2007
+ */
+public class RngSchemaValidator extends ExternalAnnotator {
+  private static final Logger LOG = Logger.getInstance(RngSchemaValidator.class.getName());
+
+  public void annotate(final PsiFile file, final AnnotationHolder holder) {
+    final FileType type = file.getFileType();
+    if (type != StdFileTypes.XML && type != RncFileType.getInstance()) {
+      return;
+    }
+    final XmlFile xmlfile = (XmlFile)file;
+    final XmlDocument document = xmlfile.getDocument();
+    if (document == null) {
+      return;
+    }
+    if (type == StdFileTypes.XML) {
+      final XmlTag rootTag = document.getRootTag();
+      if (rootTag == null) {
+        return;
+      }
+      if (!ApplicationLoader.RNG_NAMESPACE.equals(rootTag.getNamespace())) {
+        return;
+      }
+    } else {
+      if (!ApplicationManager.getApplication().isUnitTestMode() && MyErrorFinder.hasError(xmlfile)) {
+        return;
+      }
+    }
+    final Document doc = PsiDocumentManager.getInstance(file.getProject()).getDocument(file);
+
+    ErrorHandler eh = new DefaultHandler() {
+      public void warning(SAXParseException e) throws SAXException {
+        handleError(e, file, doc, new WarningMessageConsumer(holder));
+      }
+
+      public void error(SAXParseException e) throws SAXException {
+        handleError(e, file, doc, new ErrorMessageConsumer(holder));
+      }
+    };
+
+    RngParser.parsePattern(file, eh, true);
+  }
+
+  public static void handleError(SAXParseException ex, PsiFile file, Document document, ValidationMessageConsumer consumer) {
+    final String systemId = ex.getSystemId();
+
+    if (systemId != null) {
+      final VirtualFile virtualFile = findVirtualFile(systemId);
+      if (!Comparing.equal(virtualFile, file.getVirtualFile())) {
+        return;
+      }
+    }
+
+    final PsiElement at;
+    final int line = ex.getLineNumber();
+    if (line > 0) {
+      final int column = ex.getColumnNumber();
+      final int startOffset = document.getLineStartOffset(line - 1);
+
+      if (column > 0) {
+        if (file.getFileType() == RncFileType.getInstance()) {
+          final PsiElement e = file.findElementAt(startOffset + column);
+          if (e == null) {
+            at = e;
+          } else {
+            at = file.findElementAt(startOffset + column - 1);
+          }
+        } else {
+          at = file.findElementAt(startOffset + column - 2);
+        }
+      } else {
+        final PsiElement e = file.findElementAt(startOffset);
+        at = e != null ? PsiTreeUtil.nextLeaf(e) : null;
+      }
+    } else {
+      final XmlDocument d = ((XmlFile)file).getDocument();
+      assert d != null;
+      final XmlTag rootTag = d.getRootTag();
+      assert rootTag != null;
+      at = rootTag.getFirstChild();
+    }
+
+    final PsiElement host;
+    if (file instanceof RncFile) {
+      host = at;
+    } else {
+      host = PsiTreeUtil.getParentOfType(at, XmlAttribute.class, XmlTag.class);
+    }
+    if (at != null && host != null) {
+      consumer.onMessage(host, ex.getMessage());
+    } else {
+      consumer.onMessage(file, ex.getMessage());
+    }
+  }
+
+  public static VirtualFile findVirtualFile(String systemId) {
+    try {
+      return VfsUtil.findFileByURL(new URL(systemId));
+    } catch (Exception e) {
+      LOG.warn("Failed to build file from uri <" + systemId + ">", e);
+      return VirtualFileManager.getInstance().findFileByUrl(VfsUtil.fixURLforIDEA(systemId));
+    }
+  }
+
+  public interface ValidationMessageConsumer {
+    void onMessage(PsiElement context, String message);
+  }
+
+  private static abstract class MessageConsumerImpl implements ValidationMessageConsumer {
+    protected final AnnotationHolder myHolder;
+
+    public MessageConsumerImpl(AnnotationHolder holder) {
+      myHolder = holder;
+    }
+
+    public void onMessage(PsiElement host, String message) {
+      final ASTNode node = host.getNode();
+      assert node != null;
+
+      if (host instanceof XmlAttribute) {
+        final ASTNode nameNode = XmlChildRole.ATTRIBUTE_NAME_FINDER.findChild(node);
+        createAnnotation(nameNode, message);
+      } else if (host instanceof XmlTag) {
+        final ASTNode start = XmlChildRole.START_TAG_NAME_FINDER.findChild(node);
+        if (start != null) {
+          createAnnotation(start, message);
+        }
+
+        final ASTNode end = XmlChildRole.CLOSING_TAG_NAME_FINDER.findChild(node);
+        if (end != null) {
+          createAnnotation(end, message);
+        }
+      } else {
+        createAnnotation(node, message);
+      }
+    }
+
+    protected abstract void createAnnotation(ASTNode node, String message);
+  }
+
+  private static class ErrorMessageConsumer extends MessageConsumerImpl {
+    @NonNls
+    private static final String MISSING_START_ELEMENT = "missing \"start\" element";
+    private static final String UNDEFINED_PATTERN = "reference to undefined pattern ";
+
+    public ErrorMessageConsumer(AnnotationHolder holder) {
+      super(holder);
+    }
+
+    protected void createAnnotation(ASTNode node, String message) {
+      if (MISSING_START_ELEMENT.equals(message)) {
+        final PsiFile psiFile = node.getPsi().getContainingFile();
+        if (psiFile instanceof XmlFile) {
+          final PsiElementProcessor.FindElement<XmlFile> processor = new PsiElementProcessor.FindElement<XmlFile>();
+          RelaxIncludeIndex.processBackwardDependencies((XmlFile)psiFile, processor);
+          if (processor.isFound()) {
+            // files that are included from other files do not need a <start> element.
+            myHolder.createWeakWarningAnnotation(node, message);
+            return;
+          }
+        }
+      } else if (message != null && message.startsWith(UNDEFINED_PATTERN)) {
+        // we've got our own validation for that
+        return;
+      }
+      myHolder.createErrorAnnotation(node, message);
+    }
+  }
+
+  private static class WarningMessageConsumer extends MessageConsumerImpl {
+
+    public WarningMessageConsumer(AnnotationHolder holder) {
+      super(holder);
+    }
+
+    protected void createAnnotation(ASTNode node, String message) {
+      myHolder.createWarningAnnotation(node, message);
+    }
+  }
+
+  private static class MyErrorFinder extends PsiRecursiveElementVisitor {
+    private static final MyErrorFinder INSTANCE = new MyErrorFinder();
+
+    private static final class HasError extends RuntimeException {
+    }
+    private static final HasError FOUND = new HasError();
+
+    public void visitErrorElement(PsiErrorElement element) {
+      throw FOUND;
+    }
+
+    public static boolean hasError(PsiElement element) {
+      try {
+        element.accept(INSTANCE);
+        return false;
+      } catch (HasError e) {
+        return true;
+      }
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/ValidateAction.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/ValidateAction.java
new file mode 100644
index 0000000..ae84e2e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/ValidateAction.java
@@ -0,0 +1,261 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.validation;
+
+import com.intellij.ide.errorTreeView.NewErrorTreeViewPanel;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.LangDataKeys;
+import com.intellij.openapi.actionSystem.PlatformDataKeys;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.fileEditor.FileDocumentManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.wm.WindowManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.xml.XmlElementDescriptor;
+import com.thaiopensource.util.PropertyMapBuilder;
+import com.thaiopensource.util.UriOrFile;
+import com.thaiopensource.validate.SchemaReader;
+import com.thaiopensource.validate.ValidateProperty;
+import com.thaiopensource.validate.ValidationDriver;
+import com.thaiopensource.validate.auto.AutoSchemaReader;
+import com.thaiopensource.validate.rng.CompactSchemaReader;
+import com.thaiopensource.validate.rng.RngProperty;
+import org.intellij.plugins.relaxNG.compact.RncFileType;
+import org.intellij.plugins.relaxNG.model.descriptors.RngElementDescriptor;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+import javax.swing.*;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.concurrent.Future;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 19.11.2007
+ */
+@SuppressWarnings({ "ComponentNotRegistered" })
+public class ValidateAction extends AnAction {
+  private static final String CONTENT_NAME = "Validate RELAX NG";
+  private static final Key<NewErrorTreeViewPanel> KEY = Key.create("VALIDATING");
+  private static final Key<Boolean> IN_PROGRESS_KEY = Key.create("VALIDATION IN PROGRESS");
+
+  private final AnAction myOrigAction;
+
+  public ValidateAction(AnAction origAction) {
+    myOrigAction = origAction;
+    copyFrom(origAction);
+    setEnabledInModalContext(origAction.isEnabledInModalContext());
+  }
+
+  public void actionPerformed(AnActionEvent e) {
+    if (!actionPerformedImpl(e)) {
+      myOrigAction.actionPerformed(e);
+    }
+  }
+
+  public final void update(AnActionEvent e) {
+    super.update(e);
+    myOrigAction.update(e);
+
+    final VirtualFile file = e.getData(PlatformDataKeys.VIRTUAL_FILE);
+    if (file != null) {
+      if (file.getUserData(IN_PROGRESS_KEY) == Boolean.TRUE) {
+        e.getPresentation().setEnabled(false);
+      }
+    }
+  }
+
+  private boolean actionPerformedImpl(AnActionEvent e) {
+    final PsiFile file = e.getData(LangDataKeys.PSI_FILE);
+    if (file == null) {
+      return false;
+    }
+    final Project project = e.getData(PlatformDataKeys.PROJECT);
+    if (project == null) {
+      return false;
+    }
+
+    final RngElementDescriptor descriptor = getRootDescriptor(file);
+    if (descriptor == null) return false;
+
+    final PsiElement element = descriptor.getDeclaration();
+    final XmlFile xmlFile = PsiTreeUtil.getParentOfType(element, XmlFile.class);
+    if (xmlFile == null) return false;
+
+    final VirtualFile instanceFile = file.getVirtualFile();
+    final VirtualFile schemaFile = xmlFile.getVirtualFile();
+    if (instanceFile == null || schemaFile == null) {
+      return true;
+    }
+
+    doRun(project, instanceFile, schemaFile);
+
+    return true;
+  }
+
+  private static void doRun(final Project project, final VirtualFile instanceFile, final VirtualFile schemaFile) {
+    saveFiles(instanceFile, schemaFile);
+
+    final MessageViewHelper helper = new MessageViewHelper(project, CONTENT_NAME, KEY);
+
+    helper.openMessageView(new Runnable() {
+      public void run() {
+        doRun(project, instanceFile, schemaFile);
+      }
+    });
+
+    final Future<?> future = ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
+      public void run() {
+        ApplicationManager.getApplication().runReadAction(new Runnable() {
+          public void run() {
+            final MessageViewHelper.ErrorHandler eh = helper.new ErrorHandler();
+
+            instanceFile.putUserData(IN_PROGRESS_KEY, Boolean.TRUE);
+            try {
+              doValidation(instanceFile, schemaFile, eh);
+            } finally {
+              instanceFile.putUserData(IN_PROGRESS_KEY, null);
+            }
+
+            SwingUtilities.invokeLater(
+              new Runnable() {
+                  public void run() {
+                    if (!eh.hadErrorOrWarning()) {
+                      SwingUtilities.invokeLater(
+                          new Runnable() {
+                            public void run() {
+                              helper.close();
+                              WindowManager.getInstance().getStatusBar(project).setInfo("No errors detected");
+                            }
+                          }
+                      );
+                    }
+                  }
+                }
+            );
+          }
+        });
+      }
+    });
+
+    helper.setProcessController(new NewErrorTreeViewPanel.ProcessController() {
+      public void stopProcess() {
+        future.cancel(true);
+      }
+
+      public boolean isProcessStopped() {
+        return future.isDone();
+      }
+    });
+  }
+
+  @SuppressWarnings({ "ThrowableInstanceNeverThrown" })
+  private static void doValidation(VirtualFile instanceFile, VirtualFile schemaFile, org.xml.sax.ErrorHandler eh) {
+    final SchemaReader sr = schemaFile.getFileType() == RncFileType.getInstance() ?
+            CompactSchemaReader.getInstance() :
+            new AutoSchemaReader();
+
+    final PropertyMapBuilder properties = new PropertyMapBuilder();
+    ValidateProperty.ERROR_HANDLER.put(properties, eh);
+
+    // TODO: should some options dialog displayed before validating?
+    RngProperty.CHECK_ID_IDREF.add(properties);
+
+    try {
+      final String schemaPath = RngParser.reallyFixIDEAUrl(schemaFile.getUrl());
+      try {
+        final ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), sr);
+        final InputSource in = ValidationDriver.uriOrFileInputSource(schemaPath);
+        in.setEncoding(schemaFile.getCharset().name());
+
+        if (driver.loadSchema(in)) {
+          final String path = RngParser.reallyFixIDEAUrl(instanceFile.getUrl());
+          try {
+            driver.validate(ValidationDriver.uriOrFileInputSource(path));
+          } catch (IOException e1) {
+            eh.fatalError(new SAXParseException(e1.getMessage(), null, UriOrFile.fileToUri(path), -1, -1, e1));
+          }
+        }
+      } catch (SAXParseException e1) {
+        eh.fatalError(e1);
+      } catch (IOException e1) {
+        eh.fatalError(new SAXParseException(e1.getMessage(), null, UriOrFile.fileToUri(schemaPath), -1, -1, e1));
+      }
+    } catch (SAXException e1) {
+      // huh?
+      Logger.getInstance(ValidateAction.class.getName()).error(e1);
+    } catch (MalformedURLException e1) {
+      Logger.getInstance(ValidateAction.class.getName()).error(e1);
+    }
+  }
+
+  private static RngElementDescriptor getRootDescriptor(PsiFile file) {
+    try {
+      if (file instanceof XmlFile) {
+        final XmlElementDescriptor descriptor = ((XmlFile)file).getDocument().getRootTag().getDescriptor();
+        if (descriptor instanceof RngElementDescriptor) {
+          return (RngElementDescriptor)descriptor;
+        }
+      }
+    } catch (NullPointerException e1) {
+      // OK
+    }
+    return null;
+  }
+
+  public boolean displayTextInToolbar() {
+    return myOrigAction.displayTextInToolbar();
+  }
+
+  public void setDefaultIcon(boolean b) {
+    myOrigAction.setDefaultIcon(b);
+  }
+
+  public boolean isDefaultIcon() {
+    return myOrigAction.isDefaultIcon();
+  }
+
+  public void setInjectedContext(boolean worksInInjected) {
+    myOrigAction.setInjectedContext(worksInInjected);
+  }
+
+  public boolean isInInjectedContext() {
+    return myOrigAction.isInInjectedContext();
+  }
+
+  public static void saveFiles(VirtualFile... files) {
+    // ensure the validation/conversion runs on the current content
+    final FileDocumentManager mgr = FileDocumentManager.getInstance();
+    for (VirtualFile f : files) {
+      final Document document = mgr.getDocument(f);
+      if (document != null) {
+        mgr.saveDocument(document);
+      }
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/XmlInstanceValidator.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/XmlInstanceValidator.java
new file mode 100644
index 0000000..04e308e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/XmlInstanceValidator.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.validation;
+
+import com.intellij.codeInsight.daemon.Validator;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.progress.ProcessCanceledException;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlDocument;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.thaiopensource.util.PropertyMapBuilder;
+import com.thaiopensource.validate.Schema;
+import com.thaiopensource.validate.ValidateProperty;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 30.07.2007
+ */
+public class XmlInstanceValidator {
+  private static final Logger LOG = Logger.getInstance("org.intellij.plugins.relaxNG.validation.XmlInstanceValidator");
+
+  private XmlInstanceValidator() {
+  }
+
+  public static void doValidation(@NotNull final XmlDocument doc, final Validator.ValidationHost host, final XmlFile descriptorFile) {
+    try {
+      final Schema schema = RngParser.getCachedSchema(descriptorFile);
+      if (schema == null) {
+        // did not manage to get a compiled schema. no validation...
+        return;
+      }
+
+      final ErrorHandler eh = MyErrorHandler.create(doc, host);
+      if (eh == null) {
+        return;
+      }
+
+      final PropertyMapBuilder builder = new PropertyMapBuilder();
+      builder.put(ValidateProperty.ERROR_HANDLER, eh);
+
+      final ContentHandler handler = schema.createValidator(builder.toPropertyMap()).getContentHandler();
+      doc.accept(new Psi2SaxAdapter(handler));
+
+    } catch (ProcessCanceledException e) {
+      throw e;
+    } catch (RuntimeException e) {
+      LOG.error(e);
+    } catch (Exception e) {
+      LOG.info(e);
+    }
+  }
+
+  private static class MyErrorHandler implements ErrorHandler {
+    private final Validator.ValidationHost myHost;
+    private final Document myDocument;
+    private final PsiFile myFile;
+
+    private MyErrorHandler(XmlDocument doc, Validator.ValidationHost host) {
+      myHost = host;
+      myFile = doc.getContainingFile();
+      myDocument = PsiDocumentManager.getInstance(myFile.getProject()).getDocument(myFile);
+    }
+
+    public void warning(SAXParseException exception) throws SAXException {
+      RngSchemaValidator.handleError(exception, myFile, myDocument, new RngSchemaValidator.ValidationMessageConsumer() {
+        public void onMessage(PsiElement context, String message) {
+          myHost.addMessage(context, message, Validator.ValidationHost.WARNING);
+        }
+      });
+    }
+
+    public void error(SAXParseException exception) throws SAXException {
+      RngSchemaValidator.handleError(exception, myFile, myDocument, new RngSchemaValidator.ValidationMessageConsumer() {
+        public void onMessage(PsiElement context, String message) {
+          myHost.addMessage(context, message, Validator.ValidationHost.ERROR);
+        }
+      });
+    }
+
+    public void fatalError(SAXParseException exception) throws SAXException {
+      RngSchemaValidator.handleError(exception, myFile, myDocument, new RngSchemaValidator.ValidationMessageConsumer() {
+        public void onMessage(PsiElement context, String message) {
+          myHost.addMessage(context, message, Validator.ValidationHost.ERROR);
+        }
+      });
+    }
+
+    @Nullable
+    public static ErrorHandler create(XmlDocument doc, Validator.ValidationHost host) {
+      final XmlTag rootTag = doc.getRootTag();
+      if (rootTag == null) {
+        return null;
+      }
+      return new MyErrorHandler(doc, host);
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/RngHtml5SchemaProvider.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/RngHtml5SchemaProvider.java
new file mode 100644
index 0000000..e86e532
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/RngHtml5SchemaProvider.java
@@ -0,0 +1,23 @@
+package org.intellij.plugins.relaxNG.xml;
+
+import com.intellij.xml.Html5SchemaProvider;
+import org.jetbrains.annotations.NotNull;
+
+import java.net.URL;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class RngHtml5SchemaProvider extends Html5SchemaProvider {
+  @NotNull
+  @Override
+  public URL getHtmlSchemaLocation() {
+    return RngHtml5SchemaProvider.class.getResource("/resources/html5-schema/html5.rnc");
+  }
+
+  @NotNull
+  @Override
+  public URL getXhtmlSchemaLocation() {
+    return RngHtml5SchemaProvider.class.getResource("/resources/html5-schema/xhtml5.rnc");
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/Combine.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/Combine.java
new file mode 100644
index 0000000..f544c06
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/Combine.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:combineAttrType enumeration.
+ */
+public enum Combine implements com.intellij.util.xml.NamedEnum {
+  CHOICE("choice"),
+  INTERLEAVE("interleave");
+
+  private final String value;
+
+  private Combine(String value) {
+    this.value = value;
+  }
+
+  public String getValue() {
+    return value;
+  }
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngAttribute.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngAttribute.java
new file mode 100644
index 0000000..7a69079
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngAttribute.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.util.xml.GenericAttributeValue;
+import org.intellij.plugins.relaxNG.xml.dom.names.OpenNameClasses;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:attributeElemType interface.
+ */
+public interface RngAttribute extends OpenNameClasses, RngOpenPatterns {
+
+  /**
+   * Returns the value of the name child.
+   *
+   * @return the value of the name child.
+   */
+  @NotNull
+  @com.intellij.util.xml.Attribute("name")
+  GenericAttributeValue<String> getNameAttr();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngChoice.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngChoice.java
new file mode 100644
index 0000000..a8b38a4
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngChoice.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.util.xml.Namespace;
+import org.intellij.plugins.relaxNG.xml.dom.names.OpenNameClasses;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:choiceElemType interface.
+ */
+@Namespace( "RELAX-NG" )
+public interface RngChoice extends OpenNameClasses, RngOpenPatterns {
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngData.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngData.java
new file mode 100644
index 0000000..a69de2c
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngData.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.Required;
+import org.intellij.plugins.relaxNG.model.Pattern;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:dataElemType interface.
+ */
+public interface RngData extends RngDomElement, Pattern<XmlElement> {
+
+  /**
+   * Returns the value of the type child.
+   *
+   * @return the value of the type child.
+   */
+  @NotNull
+  @Required
+  GenericAttributeValue<String> getType();
+
+  /**
+   * Returns the list of param children.
+   *
+   * @return the list of param children.
+   */
+  @NotNull
+  List<RngParam> getParams();
+
+  /**
+   * Adds new child to the list of param children.
+   *
+   * @return created child
+   */
+  RngParam addParam();
+
+
+  /**
+   * Returns the list of except children.
+   *
+   * @return the list of except children.
+   */
+  @NotNull
+  RngExcept getExcept();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngDefine.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngDefine.java
new file mode 100644
index 0000000..2f223a0
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngDefine.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.*;
+import org.intellij.plugins.relaxNG.model.Define;
+import org.intellij.plugins.relaxNG.model.Pattern;
+import org.intellij.plugins.relaxNG.xml.dom.impl.RngReferenceConverter;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:defineElemType interface.
+ */
+@Namespace( "RELAX-NG" )
+public interface RngDefine extends RngOpenPatterns, Define<Pattern, XmlElement> {
+
+  /**
+   * Returns the value of the name child.
+   *
+   * @return the value of the name child.
+   */
+  @NotNull
+  @Required
+  @Referencing(value = RngReferenceConverter.class, soft = true)
+  @Attribute("name")
+  GenericAttributeValue<String> getNameAttr();
+
+
+  /**
+   * Returns the value of the combine child.
+   *
+   * @return the value of the combine child.
+   */
+  @NotNull
+  GenericAttributeValue<Combine> getCombine();
+
+  void setName(String name);
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngDiv.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngDiv.java
new file mode 100644
index 0000000..625bfd39
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngDiv.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import org.intellij.plugins.relaxNG.model.Div;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:divElemType interface.
+ */
+public interface RngDiv extends RngDomElement, RngGrammarContent, Div<XmlElement> {
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngDomElement.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngDomElement.java
new file mode 100644
index 0000000..c44a948
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngDomElement.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.*;
+import org.intellij.plugins.relaxNG.model.CommonElement;
+import org.intellij.plugins.relaxNG.xml.dom.impl.RngDomElementBase;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 16.08.2007
+ */
+@NameStrategy(com.intellij.util.xml.JavaNameStrategy.class)
+@Implementation(RngDomElementBase.class)
+public interface RngDomElement extends DomElement, CommonElement<XmlElement> {
+  /**
+   * Returns the value of the ns child.
+   *
+   * @return the value of the ns child.
+   */
+  @NotNull
+  @Attribute("ns")
+  GenericAttributeValue<String> getNamespace();
+
+  /**
+   * Returns the value of the datatypeLibrary child.
+   *
+   * @return the value of the datatypeLibrary child.
+   */
+  @NotNull
+  GenericAttributeValue<String> getDatatypeLibrary();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngDomVisitor.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngDomVisitor.java
new file mode 100644
index 0000000..2ee37fc
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngDomVisitor.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomElementVisitor;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 18.08.2007
+ */
+public class RngDomVisitor implements DomElementVisitor {
+  public void visitDomElement(DomElement element) {
+  }
+
+  public void visit(RngGrammar grammar) {
+    visitDomElement(grammar);
+  }
+
+  public void visit(RngInclude include) {
+    visitDomElement(include);
+  }
+
+  public void visit(RngDiv div) {
+    visitDomElement(div);
+  }
+
+  public void visit(RngDefine def) {
+    visitDomElement(def);
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngElement.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngElement.java
new file mode 100644
index 0000000..c7a97c1
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngElement.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.Namespace;
+import org.intellij.plugins.relaxNG.xml.dom.names.OpenNameClasses;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:elementElemType interface.
+ */
+@Namespace( "RELAX-NG" )
+public interface RngElement extends OpenNameClasses, RngOpenPatterns {
+
+  /**
+   * Returns the value of the name child.
+   *
+   * @return the value of the name child.
+   */
+  @NotNull
+  @com.intellij.util.xml.Attribute("name")
+  GenericAttributeValue<String> getNameAttr();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngEmpty.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngEmpty.java
new file mode 100644
index 0000000..dc25415
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngEmpty.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import org.intellij.plugins.relaxNG.model.Pattern;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:emptyElemType interface.
+ */
+public interface RngEmpty extends RngDomElement, Pattern<XmlElement> {
+  
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngExcept.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngExcept.java
new file mode 100644
index 0000000..ff76e5a
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngExcept.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:exceptElemType interface.
+ */
+public interface RngExcept extends RngOpenPatterns {
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngExternalRef.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngExternalRef.java
new file mode 100644
index 0000000..cd99df7
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngExternalRef.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.Convert;
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.Required;
+import org.intellij.plugins.relaxNG.model.Pattern;
+import org.intellij.plugins.relaxNG.xml.dom.impl.RngHrefConverter;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:externalRefElemType interface.
+ */
+public interface RngExternalRef extends RngDomElement, Pattern<XmlElement> {
+
+  /**
+   * Returns the value of the href child.
+   *
+   * @return the value of the href child.
+   */
+  @NotNull
+  @Required
+  @Convert(RngHrefConverter.class)
+  @com.intellij.util.xml.Attribute("href")
+  GenericAttributeValue<XmlFile> getReferencedFile();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngGrammar.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngGrammar.java
new file mode 100644
index 0000000..04e83be
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngGrammar.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.Namespace;
+import org.intellij.plugins.relaxNG.model.Grammar;
+import org.intellij.plugins.relaxNG.model.Pattern;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:grammarElemType interface.
+ */
+@Namespace( "RELAX-NG" )
+public interface RngGrammar extends RngGrammarContent, Grammar<Pattern, XmlElement> {
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngGrammarContent.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngGrammarContent.java
new file mode 100644
index 0000000..37fdf84
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngGrammarContent.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.util.xml.SubTag;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:grammar-content interface.
+ */
+public interface RngGrammarContent extends RngDomElement {
+
+  /**
+   * Returns the list of start children.
+   *
+   * @return the list of start children.
+   */
+  @NotNull
+  @SubTag("start")        
+  RngStart getStartElement();
+
+  /**
+   * Returns the list of define children.
+   *
+   * @return the list of define children.
+   */
+  @NotNull
+  List<RngDefine> getDefines();
+
+  /**
+   * Adds new child to the list of define children.
+   *
+   * @return created child
+   */
+  RngDefine addDefine();
+
+
+  /**
+   * Returns the list of div children.
+   *
+   * @return the list of div children.
+   */
+  @NotNull
+  List<RngDiv> getDivs();
+
+  /**
+   * Adds new child to the list of div children.
+   *
+   * @return created child
+   */
+  RngDiv addDiv();
+
+
+  /**
+   * Returns the list of include children.
+   *
+   * @return the list of include children.
+   */
+  @NotNull
+  List<RngInclude> getIncludes();
+
+  /**
+   * Adds new child to the list of include children.
+   *
+   * @return created child
+   */
+  RngInclude addInclude();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngGroup.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngGroup.java
new file mode 100644
index 0000000..3854792
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngGroup.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.util.xml.Namespace;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:groupElemType interface.
+ */
+@Namespace( "RELAX-NG" )
+public interface RngGroup extends RngOpenPatterns {
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngInclude.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngInclude.java
new file mode 100644
index 0000000..a12594f
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngInclude.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.Convert;
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.Required;
+import org.intellij.plugins.relaxNG.model.Include;
+import org.intellij.plugins.relaxNG.xml.dom.impl.RngHrefConverter;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:includeElemType interface.
+ */
+public interface RngInclude extends RngIncludeContent, Include<XmlElement, RngDefine> {
+
+  /**
+   * Returns the value of the href child.
+   *
+   * @return the value of the href child.
+   */
+  @NotNull
+  @Required
+  @Convert(RngHrefConverter.class)
+  @com.intellij.util.xml.Attribute("href")
+  GenericAttributeValue<XmlFile> getIncludedFile();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngIncludeContent.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngIncludeContent.java
new file mode 100644
index 0000000..ce26eda
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngIncludeContent.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.util.xml.SubTag;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:include-content interface.
+ */
+public interface RngIncludeContent extends RngDomElement {
+
+  /**
+   * Returns the list of start children.
+   *
+   * @return the list of start children.
+   */
+  @NotNull
+  @SubTag("start")
+  RngStart getStartElement();
+
+  /**
+   * Returns the list of define children.
+   *
+   * @return the list of define children.
+   */
+  @NotNull
+  List<RngDefine> getDefines();
+
+  /**
+   * Adds new child to the list of define children.
+   *
+   * @return created child
+   */
+  RngDefine addDefine();
+
+
+  /**
+   * Returns the list of div children.
+   *
+   * @return the list of div children.
+   */
+  @NotNull
+  List<RngDiv> getDivs();
+
+  /**
+   * Adds new child to the list of div children.
+   *
+   * @return created child
+   */
+  RngDiv addDiv();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngInterleave.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngInterleave.java
new file mode 100644
index 0000000..3d68ac9
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngInterleave.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.util.xml.Namespace;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:interleaveElemType interface.
+ */
+@Namespace( "RELAX-NG" )
+public interface RngInterleave extends RngOpenPatterns {
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngList.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngList.java
new file mode 100644
index 0000000..0896d87
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngList.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:listElemType interface.
+ */
+public interface RngList extends RngOpenPatterns {
+  
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngMixed.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngMixed.java
new file mode 100644
index 0000000..7c230a4
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngMixed.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:mixedElemType interface.
+ */
+public interface RngMixed extends RngOpenPatterns {
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngNotAllowed.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngNotAllowed.java
new file mode 100644
index 0000000..32c74c8
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngNotAllowed.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import org.intellij.plugins.relaxNG.model.Pattern;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:notAllowedElemType interface.
+ */
+public interface RngNotAllowed extends RngDomElement, Pattern<XmlElement> {
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngOneOrMore.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngOneOrMore.java
new file mode 100644
index 0000000..a5ef14c
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngOneOrMore.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:oneOrMoreElemType interface.
+ */
+public interface RngOneOrMore extends RngOpenPatterns {
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngOpenPattern.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngOpenPattern.java
new file mode 100644
index 0000000..769be4b
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngOpenPattern.java
@@ -0,0 +1,204 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.SubTag;
+import org.intellij.plugins.relaxNG.model.Pattern;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:open-pattern interface.
+ */
+@SuppressWarnings("UnusedDeclaration")
+public interface RngOpenPattern extends DomElement, Pattern<XmlElement> {
+
+  /**
+   * Returns the value of the element child.
+   *
+   * @return the value of the element child.
+   */
+  @NotNull
+  RngElement getElement();
+
+
+  /**
+   * Returns the value of the attribute child.
+   *
+   * @return the value of the attribute child.
+   */
+  @NotNull
+  RngAttribute getAttribute();
+
+
+  /**
+   * Returns the value of the group child.
+   *
+   * @return the value of the group child.
+   */
+  @NotNull
+  RngGroup getGroup();
+
+
+  /**
+   * Returns the value of the interleave child.
+   *
+   * @return the value of the interleave child.
+   */
+  @NotNull
+  @SubTag(value = "interleave")
+  RngInterleave getInterleave();
+
+
+  /**
+   * Returns the value of the choice child.
+   *
+   * @return the value of the choice child.
+   */
+  @NotNull
+  RngChoice getChoice();
+
+
+  /**
+   * Returns the value of the optional child.
+   *
+   * @return the value of the optional child.
+   */
+  @NotNull
+  RngOptional getOptional();
+
+
+  /**
+   * Returns the value of the zeroOrMore child.
+   *
+   * @return the value of the zeroOrMore child.
+   */
+  @NotNull
+  RngZeroOrMore getZeroOrMore();
+
+
+  /**
+   * Returns the value of the oneOrMore child.
+   *
+   * @return the value of the oneOrMore child.
+   */
+  @NotNull
+  RngOneOrMore getOneOrMore();
+
+
+  /**
+   * Returns the value of the list child.
+   *
+   * @return the value of the list child.
+   */
+  @NotNull
+  RngList getList();
+
+
+  /**
+   * Returns the value of the mixed child.
+   *
+   * @return the value of the mixed child.
+   */
+  @NotNull
+  RngMixed getMixed();
+
+
+  /**
+   * Returns the value of the ref child.
+   *
+   * @return the value of the ref child.
+   */
+  @NotNull
+  RngRef getRef();
+
+
+  /**
+   * Returns the value of the parentRef child.
+   *
+   * @return the value of the parentRef child.
+   */
+  @NotNull
+  RngParentRef getParentRef();
+
+
+  /**
+   * Returns the value of the empty child.
+   *
+   * @return the value of the empty child.
+   */
+  @NotNull
+  RngEmpty getEmpty();
+
+
+  /**
+   * Returns the value of the text child.
+   *
+   * @return the value of the text child.
+   */
+  @NotNull
+  RngText getText();
+
+
+  /**
+   * Returns the value of the value child.
+   *
+   * @return the value of the value child.
+   */
+  @NotNull
+  RngValue getValue();
+
+
+  /**
+   * Returns the value of the data child.
+   *
+   * @return the value of the data child.
+   */
+  @NotNull
+  RngData getData();
+
+
+  /**
+   * Returns the value of the notAllowed child.
+   *
+   * @return the value of the notAllowed child.
+   */
+  @NotNull
+  RngNotAllowed getNotAllowed();
+
+
+  /**
+   * Returns the value of the externalRef child.
+   *
+   * @return the value of the externalRef child.
+   */
+  @NotNull
+  RngExternalRef getExternalRef();
+
+
+  /**
+   * Returns the value of the grammar child.
+   *
+   * @return the value of the grammar child.
+   */
+  @NotNull
+  RngGrammar getGrammar();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngOpenPatterns.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngOpenPatterns.java
new file mode 100644
index 0000000..ffd3b2e
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngOpenPatterns.java
@@ -0,0 +1,318 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.SubTagList;
+import org.intellij.plugins.relaxNG.model.Pattern;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 16.08.2007
+ */
+@SuppressWarnings("UnusedDeclaration")
+public interface RngOpenPatterns extends RngDomElement, Pattern<XmlElement> {
+  /**
+   * Returns the list of element children.
+   *
+   * @return the list of element children.
+   */
+  @NotNull
+  List<RngElement> getElements();
+
+  /**
+   * Adds new child to the list of element children.
+   *
+   * @return created child
+   */
+  RngElement addElement();
+
+  /**
+   * Returns the list of attribute children.
+   *
+   * @return the list of attribute children.
+   */
+  @NotNull
+  List<RngAttribute> getAttributes();
+
+  /**
+   * Adds new child to the list of attribute children.
+   *
+   * @return created child
+   */
+  RngAttribute addAttribute();
+
+  /**
+   * Returns the list of group children.
+   *
+   * @return the list of group children.
+   */
+  @NotNull
+  List<RngGroup> getGroups();
+
+  /**
+   * Adds new child to the list of group children.
+   *
+   * @return created child
+   */
+  RngGroup addGroup();
+
+  /**
+   * Returns the list of interleave children.
+   *
+   * @return the list of interleave children.
+   */
+  @NotNull
+  @SubTagList(value = "interleave")
+  List<RngInterleave> getInterleaves();
+
+  /**
+   * Adds new child to the list of interleave children.
+   *
+   * @return created child
+   */
+  RngInterleave addInterleave();
+
+  /**
+   * Returns the list of choice children.
+   *
+   * @return the list of choice children.
+   */
+  @NotNull
+  List<RngChoice> getChoices();
+
+  /**
+   * Adds new child to the list of choice children.
+   *
+   * @return created child
+   */
+  RngChoice addChoice();
+
+  /**
+   * Returns the list of optional children.
+   *
+   * @return the list of optional children.
+   */
+  @NotNull
+  List<RngOptional> getOptionals();
+
+  /**
+   * Adds new child to the list of optional children.
+   *
+   * @return created child
+   */
+  RngOptional addOptional();
+
+  /**
+   * Returns the list of zeroOrMore children.
+   *
+   * @return the list of zeroOrMore children.
+   */
+  @NotNull
+  List<RngZeroOrMore> getZeroOrMores();
+
+  /**
+   * Adds new child to the list of zeroOrMore children.
+   *
+   * @return created child
+   */
+  RngZeroOrMore addZeroOrMore();
+
+  /**
+   * Returns the list of oneOrMore children.
+   *
+   * @return the list of oneOrMore children.
+   */
+  @NotNull
+  List<RngOneOrMore> getOneOrMores();
+
+  /**
+   * Adds new child to the list of oneOrMore children.
+   *
+   * @return created child
+   */
+  RngOneOrMore addOneOrMore();
+
+  /**
+   * Returns the list of list children.
+   *
+   * @return the list of list children.
+   */
+  @NotNull
+  List<List> getLists();
+
+  /**
+   * Adds new child to the list of list children.
+   *
+   * @return created child
+   */
+  List addList();
+
+  /**
+   * Returns the list of mixed children.
+   *
+   * @return the list of mixed children.
+   */
+  @NotNull
+  List<RngMixed> getMixeds();
+
+  /**
+   * Adds new child to the list of mixed children.
+   *
+   * @return created child
+   */
+  RngMixed addMixed();
+
+  /**
+   * Returns the list of ref children.
+   *
+   * @return the list of ref children.
+   */
+  @NotNull
+  List<RngRef> getRefs();
+
+  /**
+   * Adds new child to the list of ref children.
+   *
+   * @return created child
+   */
+  RngRef addRef();
+
+  /**
+   * Returns the list of parentRef children.
+   *
+   * @return the list of parentRef children.
+   */
+  @NotNull
+  List<RngParentRef> getParentRefs();
+
+  /**
+   * Adds new child to the list of parentRef children.
+   *
+   * @return created child
+   */
+  RngParentRef addParentRef();
+
+  /**
+   * Returns the list of empty children.
+   *
+   * @return the list of empty children.
+   */
+  @NotNull
+  List<RngEmpty> getEmpties();
+
+  /**
+   * Adds new child to the list of empty children.
+   *
+   * @return created child
+   */
+  RngEmpty addEmpty();
+
+  /**
+   * Returns the list of text children.
+   *
+   * @return the list of text children.
+   */
+  @NotNull
+  List<RngText> getTexts();
+
+  /**
+   * Adds new child to the list of text children.
+   *
+   * @return created child
+   */
+  RngText addText();
+
+  /**
+   * Returns the list of value children.
+   *
+   * @return the list of value children.
+   */
+  @NotNull
+  List<RngValue> getValues();
+
+  /**
+   * Adds new child to the list of value children.
+   *
+   * @return created child
+   */
+  RngValue addValue();
+
+  /**
+   * Returns the list of data children.
+   *
+   * @return the list of data children.
+   */
+  @NotNull
+  List<RngData> getDatas();
+
+  /**
+   * Adds new child to the list of data children.
+   *
+   * @return created child
+   */
+  RngData addData();
+
+  /**
+   * Returns the list of notAllowed children.
+   *
+   * @return the list of notAllowed children.
+   */
+  @NotNull
+  List<RngNotAllowed> getNotAlloweds();
+
+  /**
+   * Adds new child to the list of notAllowed children.
+   *
+   * @return created child
+   */
+  RngNotAllowed addNotAllowed();
+
+  /**
+   * Returns the list of externalRef children.
+   *
+   * @return the list of externalRef children.
+   */
+  @NotNull
+  List<RngExternalRef> getExternalRefs();
+
+  /**
+   * Adds new child to the list of externalRef children.
+   *
+   * @return created child
+   */
+  RngExternalRef addExternalRef();
+
+  /**
+   * Returns the list of grammar children.
+   *
+   * @return the list of grammar children.
+   */
+  @NotNull
+  List<RngGrammar> getGrammars();
+
+  /**
+   * Adds new child to the list of grammar children.
+   *
+   * @return created child
+   */
+  RngGrammar addGrammar();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngOptional.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngOptional.java
new file mode 100644
index 0000000..a4f9e50
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngOptional.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:optionalElemType interface.
+ */
+public interface RngOptional extends RngOpenPatterns {
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngParam.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngParam.java
new file mode 100644
index 0000000..a31c1ad
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngParam.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.Required;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:paramElemType interface.
+ */
+public interface RngParam extends RngDomElement {
+
+  /**
+   * Returns the value of the simple content.
+   *
+   * @return the value of the simple content.
+   */
+  @NotNull
+  @Required
+  String getValue();
+
+  /**
+   * Sets the value of the simple content.
+   *
+   * @param value the new value to set
+   */
+  void setValue(@NotNull String value);
+
+
+  /**
+   * Returns the value of the name child.
+   *
+   * @return the value of the name child.
+   */
+  @NotNull
+  @Required
+  GenericAttributeValue<String> getName();
+
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngParentRef.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngParentRef.java
new file mode 100644
index 0000000..770006c
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngParentRef.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.Referencing;
+import com.intellij.util.xml.Required;
+import org.intellij.plugins.relaxNG.model.Pattern;
+import org.intellij.plugins.relaxNG.xml.dom.impl.RngReferenceConverter;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:parentRefElemType interface.
+ */
+
+public interface RngParentRef extends RngDomElement, Pattern<XmlElement> {
+
+  /**
+   * Returns the value of the name child.
+   *
+   * @return the value of the name child.
+   */
+  @NotNull
+  @Required
+  @Referencing(RngReferenceConverter.class)
+  GenericAttributeValue<String> getName();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngRef.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngRef.java
new file mode 100644
index 0000000..706b923
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngRef.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.Referencing;
+import com.intellij.util.xml.Required;
+import org.intellij.plugins.relaxNG.model.Define;
+import org.intellij.plugins.relaxNG.model.Ref;
+import org.intellij.plugins.relaxNG.xml.dom.impl.RngReferenceConverter;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:refElemType interface.
+ */
+public interface RngRef extends RngDomElement, Ref<Define, XmlElement> {
+
+  @NotNull
+  @Required
+  @Referencing(RngReferenceConverter.class)
+  GenericAttributeValue<String> getName();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngStart.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngStart.java
new file mode 100644
index 0000000..e16aaa9
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngStart.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.util.xml.GenericAttributeValue;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:startElemType interface.
+ */
+public interface RngStart extends RngDomElement, RngOpenPattern {
+
+  /**
+   * Returns the value of the combine child.
+   *
+   * @return the value of the combine child.
+   */
+  @NotNull
+  GenericAttributeValue<Combine> getCombine();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngText.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngText.java
new file mode 100644
index 0000000..e83067b
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngText.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import org.intellij.plugins.relaxNG.model.Pattern;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:textElemType interface.
+ */
+public interface RngText extends RngDomElement, Pattern<XmlElement> {
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngValue.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngValue.java
new file mode 100644
index 0000000..fb73321
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngValue.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.Required;
+import org.intellij.plugins.relaxNG.model.Pattern;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:valueElemType interface.
+ */
+public interface RngValue extends RngDomElement, Pattern<XmlElement> {
+
+  /**
+   * Returns the value of the simple content.
+   *
+   * @return the value of the simple content.
+   */
+  @NotNull
+  @Required
+  String getValue();
+
+  /**
+   * Sets the value of the simple content.
+   *
+   * @param value the new value to set
+   */
+  void setValue(@NotNull String value);
+
+
+  /**
+   * Returns the value of the type child.
+   *
+   * @return the value of the type child.
+   */
+  @NotNull
+  GenericAttributeValue<String> getType();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngZeroOrMore.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngZeroOrMore.java
new file mode 100644
index 0000000..90c0391
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/RngZeroOrMore.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:zeroOrMoreElemType interface.
+ */
+public interface RngZeroOrMore extends RngOpenPatterns {
+
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/CreatePatternFix.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/CreatePatternFix.java
new file mode 100644
index 0000000..661e341
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/CreatePatternFix.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.xml.dom.impl;
+
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlText;
+import com.intellij.util.IncorrectOperationException;
+import org.intellij.plugins.relaxNG.ApplicationLoader;
+import org.intellij.plugins.relaxNG.xml.dom.RngGrammar;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 17.07.2007
+ */
+// XXX: the tests rely on this still being an intention action
+class CreatePatternFix implements IntentionAction, LocalQuickFix {
+  private final PsiReference myReference;
+
+  public CreatePatternFix(PsiReference reference) {
+    myReference = reference;
+  }
+
+  @NotNull
+  public String getText() {
+    return "Create Pattern '" + myReference.getCanonicalText() + "'";
+  }
+
+  @NotNull
+  public String getFamilyName() {
+    return "Create Pattern";
+  }
+
+  @NotNull
+  public String getName() {
+    return getText();
+  }
+
+  public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
+    if (!isAvailable()) {
+      return;
+    }
+    try {
+      doFix();
+    } catch (IncorrectOperationException e) {
+      Logger.getInstance(getClass().getName()).error(e);
+    }
+  }
+
+  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
+    return isAvailable();
+  }
+
+  private boolean isAvailable() {
+    if (!(myReference instanceof DefinitionReference) || !myReference.getElement().isValid()) {
+      return false;
+    } else {
+      final RngGrammar grammar = ((DefinitionReference)myReference).getScope();
+      if (grammar == null) {
+        return false;
+      } else if (grammar.getXmlTag() == null) {
+        return false;
+      }
+      return true;
+    }
+  }
+
+  public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
+    doFix();
+  }
+
+  private void doFix() throws IncorrectOperationException {
+    final XmlTag tag = PsiTreeUtil.getParentOfType(myReference.getElement(), XmlTag.class);
+    assert tag != null;
+    final XmlTag defineTag = tag.createChildTag("define", ApplicationLoader.RNG_NAMESPACE, "\n \n", false);
+    defineTag.setAttribute("name", myReference.getCanonicalText());
+
+    final RngGrammar grammar = ((DefinitionReference)myReference).getScope();
+    if (grammar == null) return;
+    final XmlTag root = grammar.getXmlTag();
+    if (root == null) return;
+
+    final XmlTag[] tags = root.getSubTags();
+    for (XmlTag xmlTag : tags) {
+      if (PsiTreeUtil.isAncestor(xmlTag, tag, false)) {
+        final XmlElementFactory ef = XmlElementFactory.getInstance(tag.getProject());
+        final XmlText text = ef.createDisplayText(" ");
+        final PsiElement e = root.addAfter(text, xmlTag);
+
+        root.addAfter(defineTag, e);
+        return;
+      }
+    }
+    root.add(defineTag);
+  }
+
+  public boolean startInWriteAction() {
+    return true;
+  }
+
+  public static XmlTag getAncestorTag(XmlTag tag, String name, String namespace) {
+    if (tag == null) {
+      return null;
+    }
+    if (tag.getLocalName().equals(name) && tag.getNamespace().equals(namespace)) {
+      return tag;
+    }
+    return getAncestorTag(tag.getParentTag(), name, namespace);
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/DefinitionReference.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/DefinitionReference.java
new file mode 100644
index 0000000..2de2b47
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/DefinitionReference.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.xml.dom.impl;
+
+import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
+import com.intellij.codeInsight.daemon.QuickFixProvider;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
+import com.intellij.codeInsight.lookup.LookupValueFactory;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.LocalQuickFixProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiElementResolveResult;
+import com.intellij.psi.PsiReferenceBase;
+import com.intellij.psi.ResolveResult;
+import com.intellij.psi.meta.PsiMetaOwner;
+import com.intellij.psi.meta.PsiPresentableMetaData;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.xml.GenericAttributeValue;
+import org.intellij.plugins.relaxNG.model.Define;
+import org.intellij.plugins.relaxNG.model.resolve.DefinitionResolver;
+import org.intellij.plugins.relaxNG.xml.dom.RngGrammar;
+import org.intellij.plugins.relaxNG.xml.dom.RngParentRef;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 18.08.2007
+ */
+public class DefinitionReference extends PsiReferenceBase.Poly<XmlAttributeValue>
+        implements QuickFixProvider<DefinitionReference>, LocalQuickFixProvider,
+        EmptyResolveMessageProvider, Function<Define, ResolveResult> {
+
+  private final boolean myIsParentRef;
+  private final GenericAttributeValue<String> myValue;
+
+  public DefinitionReference(GenericAttributeValue<String> value) {
+    super(value.getXmlAttributeValue());
+    myValue = value;
+    myIsParentRef = value.getParent() instanceof RngParentRef;
+  }
+
+  @Override
+  public boolean isSoft() {
+    return true;
+  }
+
+  @NotNull
+  public ResolveResult[] multiResolve(boolean incompleteCode) {
+    final RngGrammar scope = getScope();
+    if (scope == null) {
+      return ResolveResult.EMPTY_ARRAY;
+    }
+
+    final Set<Define> set = DefinitionResolver.resolve(scope, myValue.getValue());
+    if (set == null || set.size() == 0) return ResolveResult.EMPTY_ARRAY;
+
+    return ContainerUtil.map2Array(set, ResolveResult.class, this);
+  }
+
+  @Nullable
+  public RngGrammar getScope() {
+    RngGrammar scope = myValue.getParentOfType(RngGrammar.class, true);
+    if (scope == null) {
+      return null;
+    }
+    if (myIsParentRef) {
+      scope = scope.getParentOfType(RngGrammar.class, true);
+    }
+    return scope;
+  }
+
+  public ResolveResult fun(Define define) {
+    final XmlElement xmlElement = (XmlElement)define.getPsiElement();
+    assert xmlElement != null;
+    return new PsiElementResolveResult(xmlElement);
+  }
+
+  @NotNull
+  public Object[] getVariants() {
+    final RngGrammar scope = getScope();
+    if (scope == null) {
+      return ResolveResult.EMPTY_ARRAY;
+    }
+
+    final Map<String, Set<Define>> map = DefinitionResolver.getAllVariants(scope);
+    if (map == null || map.size() == 0) return ArrayUtil.EMPTY_OBJECT_ARRAY;
+
+    return ContainerUtil.mapNotNull(map.values(), new Function<Set<Define>, Object>() {
+      public Object fun(Set<Define> defines) {
+        final Define define = defines.iterator().next();
+        if (defines.size() == 0) {
+          return null;
+        } else {
+          final PsiElement element = define.getPsiElement();
+          if (element != null) {
+            final PsiPresentableMetaData data = (PsiPresentableMetaData)((PsiMetaOwner)element).getMetaData();
+            if (data != null) {
+              return LookupValueFactory.createLookupValue(data.getName(), data.getIcon());
+            } else {
+              return define.getName();
+            }
+          } else {
+            return define.getName();
+          }
+        }
+      }
+    }).toArray();
+  }
+
+  public LocalQuickFix[] getQuickFixes() {
+    final XmlTag tag = PsiTreeUtil.getParentOfType(getElement(), XmlTag.class);
+    assert tag != null;
+    final RngGrammar scope = myValue.getParentOfType(RngGrammar.class, true);
+    if (scope != null) {
+      return new LocalQuickFix[]{ new CreatePatternFix(this) };
+    }
+    return LocalQuickFix.EMPTY_ARRAY;
+  }
+
+  public void registerQuickfix(HighlightInfo info, final DefinitionReference reference) {
+    assert reference == this;
+    final XmlTag tag = PsiTreeUtil.getParentOfType(getElement(), XmlTag.class);
+    assert tag != null;
+    final RngGrammar scope = myValue.getParentOfType(RngGrammar.class, true);
+    if (scope != null) {
+      QuickFixAction.registerQuickFixAction(info, new CreatePatternFix(this));
+    }
+  }
+
+  public String getUnresolvedMessagePattern() {
+    return "Unresolved pattern reference ''{0}''";
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngDefineImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngDefineImpl.java
new file mode 100644
index 0000000..bb51bab
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngDefineImpl.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.xml.dom.impl;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.util.xml.GenericAttributeValue;
+import org.intellij.plugins.relaxNG.model.Pattern;
+import org.intellij.plugins.relaxNG.xml.dom.RngDefine;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 19.08.2007
+ */
+public abstract class RngDefineImpl extends RngDomElementBase implements RngDefine {
+  public void setName(String name) {
+    final GenericAttributeValue<String> value = getNameAttr();
+    if (value.getStringValue() != null) {
+      value.setStringValue(name);
+    }
+  }
+
+  public String getName() {
+    return getNameAttr().getValue();
+  }
+
+  public PsiElement getNameElement() {
+    return getNameAttr().getXmlAttributeValue();
+  }
+
+  public Pattern getPattern() {
+    return getPatternFrom(this);
+  }
+
+  public void accept(Visitor visitor) {
+    visitor.visitDefine(this);
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngDefineMetaData.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngDefineMetaData.java
new file mode 100644
index 0000000..92d0c3d
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngDefineMetaData.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.xml.dom.impl;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.xml.DomMetaData;
+import com.intellij.util.xml.GenericAttributeValue;
+import com.intellij.util.xml.GenericDomValue;
+import org.intellij.plugins.relaxNG.xml.dom.RngDefine;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 19.08.2007
+ */
+public class RngDefineMetaData extends DomMetaData<RngDefine> {
+
+  @Nullable
+  protected GenericDomValue getNameElement(final RngDefine element) {
+    final GenericAttributeValue<String> id = element.getNameAttr();
+    if (id.getXmlElement() != null) {
+      return id;
+    }
+    return null;
+  }
+
+  public void setName(final String name) throws IncorrectOperationException {
+    getElement().setName(name);
+  }
+
+  public Icon getIcon() {
+    return AllIcons.Nodes.Property;
+  }
+
+  public String getTypeName() {
+    return "Pattern Definition";
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngDomElementBase.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngDomElementBase.java
new file mode 100644
index 0000000..731c15d
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngDomElementBase.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.xml.dom.impl;
+
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.util.xml.DomElement;
+import com.intellij.util.xml.DomElementVisitor;
+import com.intellij.util.xml.DomUtil;
+import org.intellij.plugins.relaxNG.model.CommonElement;
+import org.intellij.plugins.relaxNG.model.Div;
+import org.intellij.plugins.relaxNG.model.Pattern;
+import org.intellij.plugins.relaxNG.xml.dom.RngDomElement;
+
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 31.08.2007
+ */
+public abstract class RngDomElementBase implements RngDomElement, Pattern<XmlElement> {
+  public XmlElement getPsiElement() {
+    return getXmlElement();
+  }
+
+  public void accept(Visitor visitor) {
+    if (this instanceof Div) {
+      visitor.visitDiv((Div)this); // TODO fix me
+    } else {
+      visitor.visitElement(this);
+    }
+  }
+
+  public void acceptChildren(final Visitor visitor) {
+    acceptChildren(new DomElementVisitor() {
+      public void visitDomElement(DomElement element) {
+        if (element instanceof CommonElement) {
+          ((CommonElement)element).accept(visitor);
+        }
+      }
+    });
+  }
+
+  protected static Pattern getPatternFrom(RngDomElement t) {
+    if (t == null) return null;
+    final List<Pattern> list = DomUtil.getChildrenOfType(t, Pattern.class);
+    return list.size() > 0 ? list.get(0) : null;
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngGrammarImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngGrammarImpl.java
new file mode 100644
index 0000000..b7c45ed
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngGrammarImpl.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.xml.dom.impl;
+
+import org.intellij.plugins.relaxNG.model.Pattern;
+import org.intellij.plugins.relaxNG.xml.dom.RngGrammar;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 19.08.2007
+ */
+public abstract class RngGrammarImpl extends RngDomElementBase implements RngGrammar {
+  @Override
+  public void accept(Visitor visitor) {
+    visitor.visitGrammar(this);
+  }
+
+  public Pattern getStart() {
+    return getPatternFrom(getStartElement());
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngHrefConverter.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngHrefConverter.java
new file mode 100644
index 0000000..d641300
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngHrefConverter.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.xml.dom.impl;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceSet;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.xml.*;
+import org.intellij.plugins.relaxNG.ApplicationLoader;
+import org.intellij.plugins.relaxNG.references.FileReferenceUtil;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 18.08.2007
+ */
+public class RngHrefConverter extends Converter<XmlFile> implements CustomReferenceConverter<XmlFile> {
+  public XmlFile fromString(@Nullable @NonNls String s, ConvertContext context) {
+    if (s != null) {
+      final GenericAttributeValue<XmlFile> element = (GenericAttributeValue<XmlFile>)context.getInvocationElement();
+      final PsiReference[] references = createReferences(element, element.getXmlAttributeValue(), context);
+      if (references.length > 0) {
+        PsiElement result = references[references.length - 1].resolve();
+        if (result instanceof XmlFile) {
+          return (XmlFile)result;
+        }
+      }
+    }
+    return null;
+  }
+
+  public String toString(@Nullable XmlFile psiFile, ConvertContext context) {
+    return psiFile == null ? null : psiFile.getName();
+  }
+
+  @NotNull
+  public PsiReference[] createReferences(GenericDomValue<XmlFile> genericDomValue, PsiElement element, ConvertContext context) {
+    final String s = genericDomValue.getStringValue();
+    if (s == null || element == null) {
+      return PsiReference.EMPTY_ARRAY;
+    }
+    final FileReferenceSet set = FileReferenceSet.createSet(element, false, false, false);
+    if (set != null) {
+      return FileReferenceUtil.restrict(set, FileReferenceUtil.byNamespace(ApplicationLoader.RNG_NAMESPACE), true);
+    } else {
+      return PsiReference.EMPTY_ARRAY;
+    }
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngIncludeImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngIncludeImpl.java
new file mode 100644
index 0000000..1dddea3
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngIncludeImpl.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.xml.dom.impl;
+
+import com.intellij.psi.PsiFile;
+import com.intellij.util.xml.DomUtil;
+import org.intellij.plugins.relaxNG.xml.dom.RngDefine;
+import org.intellij.plugins.relaxNG.xml.dom.RngInclude;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 19.08.2007
+ */
+public abstract class RngIncludeImpl extends RngDomElementBase implements RngInclude {
+  @Override
+  public void accept(Visitor visitor) {
+    visitor.visitInclude(this);
+  }
+
+  public PsiFile getInclude() {
+    return getIncludedFile().getValue();
+  }
+
+  @NotNull
+  public RngDefine[] getOverrides() {
+    // TODO: include stuff inside DIVs - fix when this is actually used
+    final List<RngDefine> defines = DomUtil.getChildrenOfType(this, RngDefine.class);
+    return defines.toArray(new RngDefine[defines.size()]);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngRefImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngRefImpl.java
new file mode 100644
index 0000000..b5afb61
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngRefImpl.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.xml.dom.impl;
+
+import com.intellij.psi.xml.XmlAttributeValue;
+import org.intellij.plugins.relaxNG.model.Define;
+import org.intellij.plugins.relaxNG.model.resolve.DefinitionResolver;
+import org.intellij.plugins.relaxNG.xml.dom.RngGrammar;
+import org.intellij.plugins.relaxNG.xml.dom.RngRef;
+
+import java.util.Set;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 05.09.2007
+ */
+public abstract class RngRefImpl extends RngDomElementBase implements RngRef {
+  @Override
+  public void accept(Visitor visitor) {
+    visitor.visitRef(this);
+  }
+
+  public Define getPattern() {
+    final XmlAttributeValue value = getName().getXmlAttributeValue();
+    if (value == null) return null;
+
+    final String name = getReferencedName();
+    if (name == null) {
+      return null;
+    }
+
+    final RngGrammar scope = getScope();
+    if (scope == null) {
+      return null;
+    }
+
+    final Set<Define> defines = DefinitionResolver.resolve(scope, name);
+
+    // TODO: honor combine & return virtual element if defines.size() > 1
+    return defines != null && defines.size() > 0 ? defines.iterator().next() : null;
+  }
+
+  protected RngGrammar getScope() {
+    return getParentOfType(RngGrammar.class, true);
+  }
+
+  public String getReferencedName() {
+    return getName().getValue();
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngReferenceConverter.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngReferenceConverter.java
new file mode 100644
index 0000000..163e212
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/impl/RngReferenceConverter.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG.xml.dom.impl;
+
+import com.intellij.openapi.util.Ref;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.PsiReferenceBase;
+import com.intellij.psi.xml.XmlAttributeValue;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.xml.*;
+import org.intellij.plugins.relaxNG.model.Define;
+import org.intellij.plugins.relaxNG.model.resolve.DefinitionResolver;
+import org.intellij.plugins.relaxNG.xml.dom.RngDefine;
+import org.intellij.plugins.relaxNG.xml.dom.RngDomVisitor;
+import org.intellij.plugins.relaxNG.xml.dom.RngGrammar;
+import org.intellij.plugins.relaxNG.xml.dom.RngInclude;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 18.08.2007
+ */
+public class RngReferenceConverter implements CustomReferenceConverter {
+  @NotNull
+  public PsiReference[] createReferences(GenericDomValue genericDomValue, PsiElement element, ConvertContext context) {
+    final GenericAttributeValue<String> e = (GenericAttributeValue<String>)genericDomValue;
+
+    if (genericDomValue.getParent() instanceof RngDefine) {
+      final XmlAttributeValue value = e.getXmlAttributeValue();
+      if (value == null) {
+        return PsiReference.EMPTY_ARRAY;
+      }
+
+      return new PsiReference[]{
+              new PsiReferenceBase<XmlAttributeValue>(value, TextRange.from(1, value.getTextLength() - 2), true) {
+                public PsiElement resolve() {
+//                  final XmlTag tag = PsiTreeUtil.getParentOfType(value, XmlTag.class);
+//                  final XmlTag include = getAncestorTag(tag, "include", ProjectLoader.RNG_NAMESPACE);
+//                  final XmlTag grammar = getAncestorTag(tag, "grammar", ProjectLoader.RNG_NAMESPACE);
+//
+//                  if (include != null && (grammar == null || PsiTreeUtil.isAncestor(grammar, include, true))) {
+//                    final ResolveResult[] e = new DefinitionReference(getElement(), false).multiResolve(false);
+//                  }
+                  return myElement.getParent().getParent();
+                }
+
+                @NotNull
+                public Object[] getVariants() {
+                  final RngInclude include = e.getParentOfType(RngInclude.class, true);
+                  final RngGrammar scope = e.getParentOfType(RngGrammar.class, true);
+                  if (scope != null && include != null && DomUtil.isAncestor(scope, include, true)) {
+                    final XmlFile file = include.getIncludedFile().getValue();
+                    if (file != null) {
+                      final DomFileElement<DomElement> fileElement = scope.getManager().getFileElement(file, DomElement.class);
+                      if (fileElement == null) {
+                        return EMPTY_ARRAY;
+                      }
+                      
+                      final Ref<Object[]> ref = new Ref<Object[]>(ArrayUtil.EMPTY_STRING_ARRAY);
+                      fileElement.acceptChildren(new RngDomVisitor(){
+                        @Override
+                        public void visit(RngGrammar grammar) {
+                          final Map<String, Set<Define>> map = DefinitionResolver.getAllVariants(grammar);
+                          if (map != null) {
+                            ref.set(map.keySet().toArray());
+                          }
+                        }
+                      });
+                      return ref.get();
+                    }
+                  }
+                  return ArrayUtil.EMPTY_STRING_ARRAY; // TODO: look for unresolved refs;
+                }
+              }
+      };
+    }
+
+    return new PsiReference[]{
+            new DefinitionReference(e)
+    };
+  }
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/names/AnyName.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/names/AnyName.java
new file mode 100644
index 0000000..aaa6815
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/names/AnyName.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom.names;
+
+import org.intellij.plugins.relaxNG.xml.dom.RngDomElement;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:anyNameElemType interface.
+ */
+public interface AnyName extends RngDomElement {
+
+
+  /**
+   * Returns the list of except children.
+   *
+   * @return the list of except children.
+   */
+  @NotNull
+  OpenNameClasses getExcept();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/names/Name.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/names/Name.java
new file mode 100644
index 0000000..7832818
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/names/Name.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom.names;
+
+import com.intellij.util.xml.Required;
+import org.intellij.plugins.relaxNG.xml.dom.RngDomElement;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:nameElemType interface.
+ */
+public interface Name extends RngDomElement {
+
+  /**
+   * Returns the value of the simple content.
+   *
+   * @return the value of the simple content.
+   */
+  @NotNull
+  @Required
+  String getValue();
+
+  /**
+   * Sets the value of the simple content.
+   *
+   * @param value the new value to set
+   */
+  void setValue(@NotNull String value);
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/names/NsName.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/names/NsName.java
new file mode 100644
index 0000000..15683c0
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/names/NsName.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom.names;
+
+import org.intellij.plugins.relaxNG.xml.dom.RngDomElement;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:nsNameElemType interface.
+ */
+public interface NsName extends RngDomElement {
+
+  /**
+   * Returns the list of except children.
+   *
+   * @return the list of except children.
+   */
+  OpenNameClasses getExcept();
+}
diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/names/OpenNameClasses.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/names/OpenNameClasses.java
new file mode 100644
index 0000000..33ed259
--- /dev/null
+++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/xml/dom/names/OpenNameClasses.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+// Generated on Fri Aug 10 16:21:20 CEST 2007
+// DTD/Schema  :    http://relaxng.org/ns/structure/1.0
+
+package org.intellij.plugins.relaxNG.xml.dom.names;
+
+import org.intellij.plugins.relaxNG.xml.dom.RngChoice;
+import org.intellij.plugins.relaxNG.xml.dom.RngDomElement;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * http://relaxng.org/ns/structure/1.0:open-name-classes interface.
+ */
+public interface OpenNameClasses extends RngDomElement {
+
+  /**
+   * Returns the value of the name child.
+   *
+   * @return the value of the name child.
+   */
+  @NotNull
+  Name getName();
+
+  /**
+   * Returns the value of the anyName child.
+   *
+   * @return the value of the anyName child.
+   */
+  @NotNull
+  AnyName getAnyName();
+
+
+  /**
+   * Returns the value of the nsName child.
+   *
+   * @return the value of the nsName child.
+   */
+  @NotNull
+  NsName getNsName();
+
+
+//  /**
+//   * Returns the value of the choice child.
+//   *
+//   * @return the value of the choice child.
+//   */
+//  @NotNull
+//  RngChoice getChoice();
+
+  /**
+   * Returns the list of choice children.
+   *
+   * @return the list of choice children.
+   */
+  @NotNull
+  List<RngChoice> getChoices();
+
+  /**
+   * Adds new child to the list of choice children.
+   *
+   * @return created child
+   */
+  RngChoice addChoice();
+}
diff --git a/xml/relaxng/src/resources/html5-schema/LICENSE b/xml/relaxng/src/resources/html5-schema/LICENSE
new file mode 100644
index 0000000..fd1093c
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/LICENSE
@@ -0,0 +1,23 @@
+The RELAX NG Schema for (X)HTML 5 is licensed under the MIT open source license.
+The following legal notice applies to all files in this directory:
+
+Copyright (c) 2005-2007 Elika J. Etemad (fantasai) and Henri Sivonen (hsivonen)
+Copyright (c) 2007-2008 Mozilla Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/xml/relaxng/src/resources/html5-schema/applications.rnc b/xml/relaxng/src/resources/html5-schema/applications.rnc
new file mode 100644
index 0000000..bf27090
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/applications.rnc
@@ -0,0 +1,281 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Web Application Features              #
+# #####################################################################
+
+## Additions to Common Attributes
+
+	common.attrs.interact &=
+		(	common.attrs.contextmenu?
+		&	common.attrs.contenteditable?
+		&	common.attrs.draggable?
+		&	common.attrs.dropzone?
+		&	common.attrs.hidden?
+		&	common.attrs.spellcheck?
+		)
+		
+	common.attrs.other &= common.attrs.interact
+
+## Context Menu: contextmenu
+
+	common.attrs.contextmenu =
+		attribute contextmenu {
+			common.data.idref
+		}
+
+## Editable Content: contenteditable
+
+	common.attrs.contenteditable =
+		attribute contenteditable {
+			w:string "true" | w:string "false" | w:string ""
+		}
+
+## Draggable Element: draggable
+
+	common.attrs.draggable =
+		attribute draggable {
+			w:string "true" | w:string "false"
+		}
+
+## Dropzone: dropzone
+
+	common.attrs.dropzone =
+		attribute dropzone {
+			list {
+				(	xsd:string { pattern = "[sS]:.+" }
+				|	xsd:string { pattern = "[fF]:.+" }
+				)*
+				,
+				(	w:string "copy"
+				|	w:string "move"
+				|	w:string "link"
+				)?
+				,
+				(	xsd:string { pattern = "[sS]:.+" }
+				|	xsd:string { pattern = "[fF]:.+" }
+				)*
+			}
+		}
+
+## Hidden Element: hidden
+
+	common.attrs.hidden =
+		attribute hidden {
+			w:string "hidden" | w:string ""
+		}
+
+## Spellchecking and grammar checking: spellcheck
+
+	common.attrs.spellcheck =
+		attribute spellcheck{
+			w:string "true" | w:string "false" | w:string ""
+		}
+
+## Application Cache: manifest
+
+	html.attrs.manifest =
+		attribute manifest {
+			common.data.uri.non-empty
+		}
+		
+	html.attrs &= html.attrs.manifest?
+
+## Progess Indicator: <progress>
+
+	progress.elem =
+		element progress { progress.inner & progress.attrs }
+	progress.attrs =
+		(	common.attrs
+		&	progress.attrs.value?
+		&	progress.attrs.max?
+		)
+		progress.attrs.value =
+			attribute value {
+				common.data.float.non-negative
+			}
+		progress.attrs.max =
+			attribute max {
+				common.data.float.positive
+			}
+	progress.inner =
+		( common.inner.phrasing ) #Cannot enforce textContent format here
+
+	common.elem.phrasing |= progress.elem
+
+## Command with an associated action: <command type='command'>
+
+	command.command.elem =
+		element command { command.inner & command.command.attrs }
+	command.command.attrs =
+		(	common.attrs
+		&	command.command.attrs.type?
+		&	common-command.attrs
+		)
+		command.command.attrs.type =
+			attribute type {
+				w:string "command"
+			}
+	command.elem = command.command.elem
+
+## Selection of one item from a list of items: <command type='radio'>
+
+	command.radio.elem =
+		element command { command.inner & command.radio.attrs }
+	command.radio.attrs =
+		(	common.attrs
+			&	(	command.radio.attrs.type
+				&	command.radio.attrs.radiogroup #REVISIT taking liberties here
+				&	command.radio.attrs.checked?
+				)
+			&	common-command.attrs
+		)
+		command.radio.attrs.type =
+			attribute type {
+				w:string "radio"
+			}
+		command.radio.attrs.radiogroup =
+			attribute radiogroup {
+				string #REVISIT need special format here?
+			}
+		command.radio.attrs.checked =
+			attribute checked {
+				w:string "checked" | w:string ""
+			}
+	command.elem |= command.radio.elem
+
+## State or option that can be toggled: <command type='checkbox'>
+
+	command.checkbox.elem =
+		element command { command.inner & command.checkbox.attrs }
+	command.checkbox.attrs =
+		(	common.attrs
+			&	(	command.checkbox.attrs.type
+				&	command.checkbox.attrs.checked?
+				)
+			&	common-command.attrs
+			)
+		command.checkbox.attrs.type =
+			attribute type {
+				w:string "checkbox"
+			}
+		command.checkbox.attrs.checked =
+			attribute checked {
+				w:string "checked" | w:string ""
+			}
+	command.elem |= command.checkbox.elem
+
+	common-command.attrs =
+		(	command.attrs.label?
+		&	command.attrs.icon?
+		&	command.attrs.disabled?
+		)
+		command.attrs.label =
+			attribute label {
+				string
+			}
+		command.attrs.icon =
+			attribute icon {
+				common.data.uri.non-empty
+			}
+		command.attrs.disabled =
+			attribute disabled {
+				w:string "disabled" | w:string ""
+			}
+	command.inner =
+		( empty )
+	
+	common.elem.metadata |=
+		( command.elem & nonHTMLizable )
+	common.elem.phrasing |= command.elem
+
+## Menu: <menu>
+
+	menu.elem =
+		element menu { menu.inner & menu.attrs }
+	menu.attrs =
+		(	common.attrs
+		&	menu.attrs.type?
+		&	menu.attrs.label?
+		)
+		menu.attrs.type =
+			attribute type {
+				w:string "toolbar" | w:string "context"
+			}
+		menu.attrs.label =
+			attribute label {
+				string
+			}
+	menu.inner =
+		(	mli.elem*
+		|	common.inner.flow
+		)
+	
+	common.elem.flow |= menu.elem
+	# REVISIT allow nested menus
+
+## Menu Item: <li>
+
+	mli.elem =
+		element li { mli.inner & mli.attrs }
+	mli.attrs =
+		( common.attrs )
+	mli.inner =
+		( common.inner.flow )
+	
+## Canvas for Dynamic Graphics: <canvas>
+
+	canvas.elem.flow =
+		element canvas { canvas.inner.flow & canvas.attrs }
+	canvas.elem.phrasing =
+		element canvas { canvas.inner.phrasing & canvas.attrs }
+	canvas.attrs =
+		(	common.attrs
+		&	canvas.attrs.height?
+		&	canvas.attrs.width?
+		&	common.attrs.aria?
+		)
+		canvas.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		canvas.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+	canvas.inner.flow =
+		( common.inner.flow )
+	canvas.inner.phrasing =
+		( common.inner.phrasing )
+	
+	common.elem.flow |= canvas.elem.flow
+	common.elem.phrasing |= canvas.elem.phrasing
+
+## Additional On-Demand Information: <details>
+
+	details.elem =
+		element details { details.inner & details.attrs }
+	details.attrs =
+		(	common.attrs
+		&	details.attrs.open?
+		&	common.attrs.aria.implicit.region?
+		)
+		details.attrs.open =
+			attribute open {
+				w:string "open" | w:string ""
+			}
+	details.inner =
+		(	summary.elem?
+		,	common.inner.flow 
+		)
+	
+	common.elem.flow |= details.elem
+
+## Caption/summary for details element: <summary>
+
+	summary.elem =
+		element summary { summary.inner & summary.attrs }
+	summary.attrs =
+		( common.attrs )
+	summary.inner =
+		( common.inner.phrasing )
diff --git a/xml/relaxng/src/resources/html5-schema/aria.rnc b/xml/relaxng/src/resources/html5-schema/aria.rnc
new file mode 100644
index 0000000..9721d36e
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/aria.rnc
@@ -0,0 +1,1017 @@
+# #####################################################################
+##	RELAX NG Schema for HTML 5: Accessible Rich Internet Applications #
+# #####################################################################
+
+# #####################################################################
+## ARIA
+
+## Global states and properties
+
+aria.global = 
+	(	aria.prop.atomic?
+	&	aria.state.busy?
+	&	aria.prop.controls?
+	&	aria.prop.describedby?
+	&	aria.state.disabled?
+	&	aria.state.dropeffect?
+	&	aria.prop.flowto?
+	&	aria.state.grabbed?
+	&	aria.prop.haspopup?
+	&	aria.state.hidden?
+	&	aria.state.invalid?
+	&	aria.prop.label?
+	&	aria.prop.labelledby?
+	&	aria.prop.live?
+	&	aria.prop.owns?
+	&	aria.prop.relevant?
+	&	aria.prop.required?
+	)
+
+common.attrs.other &= aria.global?
+
+## States and Properties for Native Roles
+
+# common.attrs.aria.implicit.button |=
+#	(	aria.prop.controls?
+#	)
+
+# common.attrs.aria.implicit.input |=
+#	(	aria.prop.controls?
+#	&	aria.state.invalid?
+#	&	aria.prop.required?
+#	)
+
+common.attrs.aria.implicit.region |=
+	(	aria.state.expanded?
+#	&	aria.prop.level?
+	)
+
+common.attrs.aria.implicit.group |=
+	(	aria.state.expanded?
+	&	aria.prop.activedescendant?
+	)
+
+common.attrs.aria.implicit.th |=
+	(	aria.prop.sort?
+	&	aria.prop.level?
+	&	aria.state.expanded?
+	&	aria.prop.readonly?
+	&	aria.state.selected?
+	)
+
+# common.attrs.aria.implicit.structure |=
+#	(	aria.prop.atomic?
+#	&	aria.state.busy?
+#	&	aria.prop.channel?
+#	&	aria.prop.live?
+#	&	aria.prop.relevant?
+#	)
+
+# common.attrs.aria.implicit.link |=
+#		(	aria.prop.controls?
+#	&	aria.state.disabled?
+#	)
+
+common.attrs.aria.implicit.listitem |=
+		(	aria.prop.posinset?
+	&	aria.prop.setsize?
+#	&	aria.prop.atomic?
+	)
+
+# common.attrs.aria.implicit.img |=
+#		(	aria.prop.atomic?
+#	&	aria.state.busy?
+#	&	aria.prop.channel?
+#	&	aria.prop.controls?
+#	&	aria.prop.live?
+#	&	aria.prop.relevant?
+#	)
+
+#common.attrs.aria.implicit.select |=
+#		(	aria.state.invalid?
+#	&	aria.prop.required?
+#	&	aria.prop.atomic?
+#	&	aria.state.busy?
+#	&	aria.prop.channel?
+#	&	aria.prop.controls?
+#	&	aria.prop.live?
+#	&	aria.prop.relevant?
+#	)
+
+# #####################################################################
+## States
+
+## busy
+	aria.state.busy =
+		attribute aria-busy 
+			{	string "true"
+			|	string "false" #default
+			}
+
+## checked
+	aria.state.checked =
+		attribute aria-checked 
+			{	string "true"
+			|	string "false"
+			|	string "mixed"
+			|	string "undefined" #default
+			}
+
+## disabled
+	aria.state.disabled =
+		attribute aria-disabled 
+			{	string "true"
+			|	string "false" #default
+			}
+
+## dropeffect
+	aria.state.dropeffect =
+		attribute aria-dropeffect
+			{	token "none" #default
+			| token "popup"
+			| token "execute"
+			|	list 
+				{	( string "copy" )
+				,	( string "execute" )?
+				}
+			|	list 
+				{	( string "move" )
+				,	( string "execute" )?
+				}
+			|	list 
+				{	( string "reference" )
+				,	( string "execute" )?
+				}
+			|	list 
+				{	( string "execute" )
+				,	( string "copy" )
+				}
+			|	list 
+				{	( string "execute" )
+				,	( string "move" )
+				}
+			|	list 
+				{	( string "execute" )
+				,	( string "reference" )
+				}
+			}
+
+## expanded
+	aria.state.expanded =
+		attribute aria-expanded 
+			{	string "true"
+			|	string "false"
+			|	string "undefined" #default
+			}
+
+## grabbed
+	aria.state.grabbed =
+		attribute aria-grabbed 
+			{	string "true"
+			|	string "false"
+			|	string "undefined" #default
+			}
+
+## hidden
+	aria.state.hidden =
+		attribute aria-hidden 
+			{	string "true"
+			|	string "false" #default
+			}
+
+## invalid
+	aria.state.invalid =
+		attribute aria-invalid 
+			{	string "true"
+			|	string "false" #default
+			|	string "grammar"
+			|	string "spelling"
+			}
+
+## pressed
+	aria.state.pressed =
+		attribute aria-pressed 
+			{	string "true"
+			|	string "false"
+			|	string "mixed"
+			|	string "undefined" #default
+			}
+
+## selected
+	aria.state.selected =
+		attribute aria-selected 
+			{	string "true"
+			|	string "false"
+			|	string "undefined" #default
+			}
+
+
+
+# #####################################################################
+## Properties
+
+## activedescendant
+	aria.prop.activedescendant =
+		attribute aria-activedescendant {
+			common.data.idref #REVISIT add Schematron check
+		}
+
+## atomic
+	aria.prop.atomic =
+		attribute aria-atomic
+			{	string "true"
+			|	string "false" #default
+			}	
+
+## autocomplete
+	aria.prop.autocomplete =
+		attribute aria-autocomplete
+			{	string "inline"
+			|	string "list"
+			|	string "both"
+			|	string "none" #default
+			}
+
+## controls
+	aria.prop.controls =
+		attribute aria-controls {
+			common.data.idrefs #REVISIT add Schematron check
+		}
+
+## describedby
+	aria.prop.describedby =
+		attribute aria-describedby {
+			common.data.idrefs #REVISIT add Schematron check
+		}
+
+## flowto
+	aria.prop.flowto =
+		attribute aria-flowto {
+			common.data.idrefs #REVISIT add Schematron check
+		}
+
+## haspopup
+	aria.prop.haspopup =
+		attribute aria-haspopup
+			{	string "true" #REVISIT check owns or descendant
+			|	string "false" #default
+			}	
+
+## label
+	aria.prop.label =
+		attribute aria-label {
+			string
+		}
+
+## labelledby
+	aria.prop.labelledby =
+		attribute aria-labelledby {
+			common.data.idrefs #REVISIT add Schematron check
+		}
+
+## level
+	aria.prop.level =
+		attribute aria-level {
+			common.data.integer.positive
+		}
+
+## live
+	aria.prop.live =
+		attribute aria-live
+			{	string "off" #default
+			|	string "polite"
+			|	string "assertive"
+			}	
+
+## multiline
+	aria.prop.multiline =
+		attribute aria-multiline
+			{	string "true"
+			|	string "false" #default
+			}	
+
+## multiselectable
+	aria.prop.multiselectable =
+		attribute aria-multiselectable
+			{	string "true"
+			|	string "false" #default
+			}	
+
+## owns
+	aria.prop.owns =
+		attribute aria-owns {
+			common.data.idrefs #REVISIT add Schematron check
+		}
+
+## posinset
+	aria.prop.posinset =
+		attribute aria-posinset {
+			common.data.integer.positive
+		}
+
+## readonly
+	aria.prop.readonly =
+		attribute aria-readonly
+			{	string "true"
+			|	string "false" #default
+			}	
+
+## relevant
+	aria.prop.relevant =
+		attribute aria-relevant
+			{	token "all"
+			|	list 
+				{	( string "additions" )
+				,	( string "removals" )?
+				,	( string "text" )?
+				}
+			|	list 
+				{	( string "additions" )
+				,	( string "text" )?
+				,	( string "removals" )?
+				}
+			|	list 
+				{	( string "removals" )
+				,	( string "additions" )?
+				,	( string "text" )?
+				}
+			|	list 
+				{	( string "removals" )
+				,	( string "text" )?
+				,	( string "additions" )?
+				}
+			|	list 
+				{	( string "text" )
+				,	( string "additions" )?
+				,	( string "removals" )?
+				}
+			|	list 
+				{	( string "text" )
+				,	( string "removals" )?
+				,	( string "additions" )?
+				}
+			}	
+
+## required
+	aria.prop.required =
+		attribute aria-required
+			{	string "true"
+			|	string "false" #default
+			}	
+
+## setsize
+	aria.prop.setsize =
+		attribute aria-setsize {
+			common.data.integer.non-negative
+		}
+
+## sort
+	aria.prop.sort =
+		attribute aria-sort
+			{	string "ascending"
+			|	string "descending"
+			|	string "none" #default
+			|	string "other"
+			}	
+
+## valuemax
+	aria.prop.valuemax =
+		attribute aria-valuemax {
+			common.data.float #REVISIT
+		}
+
+## valuemin
+	aria.prop.valuemin =
+		attribute aria-valuemin {
+			common.data.float #REVISIT
+		}
+
+## valuenow
+	aria.prop.valuenow =
+		attribute aria-valuenow {
+			common.data.float #REVISIT
+		}
+
+## valuetext
+	aria.prop.valuetext =
+		attribute aria-valuetext {
+			string
+		}
+
+# #####################################################################
+## Roles
+
+## alert
+	aria.alert =
+		(	aria.role.alert
+		&	aria.state.expanded? 
+		)
+		aria.role.alert = 
+			attribute role { string "alert" }
+	
+	common.attrs.aria |= aria.alert
+
+## alertdialog
+	aria.alertdialog =
+		(	aria.role.alertdialog
+		&	aria.state.expanded?
+		)
+		aria.role.alertdialog = 
+			attribute role { string "alertdialog" }
+	
+	common.attrs.aria |= aria.alertdialog
+
+## application
+	aria.application =
+		(	aria.role.application
+		&	aria.state.expanded?
+		)
+		aria.role.application = 
+			attribute role { string "application" }
+
+	common.attrs.aria |= aria.application
+	common.attrs.aria.landmark.application |= aria.application
+
+## article
+	aria.article =
+		(	aria.role.article
+		&	aria.state.expanded?
+		)
+		aria.role.article = 
+			attribute role { string "article" }
+
+	common.attrs.aria |= aria.article
+	common.attrs.aria.landmark.article |= aria.article
+
+## banner
+	aria.banner =
+		(	aria.role.banner
+		&	aria.state.expanded?
+		)
+		aria.role.banner = 
+			attribute role { string "banner" }
+	
+	common.attrs.aria |= aria.banner
+	common.attrs.aria.landmark.banner |= aria.banner
+	
+## button
+	aria.button =
+		(	aria.role.button
+		&	aria.state.pressed? # not inherited
+		)
+		aria.role.button = 
+			attribute role { string "button" }
+	
+	common.attrs.aria |= aria.button
+
+## checkbox
+	aria.checkbox =
+		(	aria.role.checkbox
+		&	aria.state.checked #required!
+		)
+		aria.role.checkbox = 
+			attribute role { string "checkbox" }
+	
+	common.attrs.aria |= aria.checkbox
+
+# XXX columnheader
+
+## combobox
+	aria.combobox =
+		(	aria.role.combobox
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded #required!
+		)
+		aria.role.combobox = 
+			attribute role { string "combobox" }
+	
+	common.attrs.aria |= aria.combobox
+
+## complementary
+	aria.complementary =
+		(	aria.role.complementary
+		&	aria.state.expanded?
+		)
+		aria.role.complementary = 
+			attribute role { string "complementary" }
+
+	common.attrs.aria |= aria.complementary
+	common.attrs.aria.landmark.complementary |= aria.complementary
+
+## contentinfo
+	aria.contentinfo =
+		(	aria.role.contentinfo
+		&	aria.state.expanded?
+		)
+		aria.role.contentinfo = 
+			attribute role { string "contentinfo" }
+
+	common.attrs.aria |= aria.contentinfo
+	common.attrs.aria.landmark.contentinfo |= aria.contentinfo
+
+## definition
+	aria.definition =
+		(	aria.role.definition
+		&	aria.state.expanded?
+		)
+		aria.role.definition = 
+			attribute role { string "definition" }
+
+	common.attrs.aria |= aria.definition
+
+## dialog
+	aria.dialog =
+		(	aria.role.dialog
+		&	aria.state.expanded?
+		)
+		aria.role.dialog = 
+			attribute role { string "dialog" }
+
+	common.attrs.aria |= aria.dialog
+
+## directory
+	aria.directory =
+		(	aria.role.directory
+		&	aria.state.expanded?
+		)
+		aria.role.directory = 
+			attribute role { string "directory" }
+
+	common.attrs.aria |= aria.directory
+
+## document
+	aria.document =
+		(	aria.role.document
+		&	aria.state.expanded?
+		)
+		aria.role.document = 
+			attribute role { string "document" }
+
+	common.attrs.aria |= aria.document
+	common.attrs.aria.landmark.document |= aria.document
+
+## grid
+	aria.grid =
+		(	aria.role.grid
+		&	aria.prop.level? # not inherited
+		&	aria.prop.multiselectable? # not inherited
+		&	aria.prop.readonly? # not inherited
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.grid = 
+			attribute role { string "grid" }
+	
+	common.attrs.aria |= aria.grid
+	
+## gridcell
+	aria.gridcell =
+		(	aria.role.gridcell
+		&	aria.prop.level? # net inherited
+		&	aria.prop.readonly? # not inherited
+		&	aria.state.selected? # not inherited
+		&	aria.state.expanded?
+		)
+		aria.role.gridcell = 
+			attribute role { string "gridcell" }
+	
+	common.attrs.aria |= aria.gridcell
+
+## group
+	aria.group =
+		(	aria.role.group
+		&	aria.prop.activedescendant? # not inherited
+		&	aria.state.expanded? # not inherited
+		)
+		aria.role.group = 
+			attribute role { string "group" }
+	
+	common.attrs.aria |= aria.group
+
+## XXX heading
+
+## img
+	aria.img =
+		(	aria.role.img
+		&	aria.state.expanded?
+		)
+		aria.role.img = 
+			attribute role { string "img" }
+	
+	common.attrs.aria |= aria.img
+
+## link
+	aria.link =
+		(	aria.role.link
+		)
+		aria.role.link = 
+			attribute role { string "link" }
+	
+	common.attrs.aria |= aria.link
+
+## list
+	aria.list =
+		(	aria.role.list
+		&	aria.state.expanded?
+		)
+		aria.role.list = 
+			attribute role { string "list" }
+	
+	common.attrs.aria |= aria.list
+
+## listbox
+	aria.listbox =
+		(	aria.role.listbox
+		&	aria.prop.multiselectable? # not inherited
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.listbox = 
+			attribute role { string "listbox" }
+	
+	common.attrs.aria |= aria.listbox
+
+## listitem
+	aria.listitem =
+		(	aria.role.listitem
+		&	aria.prop.posinset? # not inherited
+		&	aria.prop.setsize? # not inherited
+		&	aria.prop.level? # not inherited
+		&	aria.state.expanded?
+		)
+		aria.role.listitem = 
+			attribute role { string "listitem" }
+	
+	common.attrs.aria |= aria.listitem
+
+## log
+	aria.log =
+		(	aria.role.log
+		&	aria.state.expanded?
+		)
+		aria.role.log = 
+			attribute role { string "log" }
+	
+	common.attrs.aria |= aria.log
+
+## main
+	aria.main =
+		(	aria.role.main
+		&	aria.state.expanded?
+		)
+		aria.role.main = 
+			attribute role { string "main" }
+	
+	common.attrs.aria |= aria.main
+	common.attrs.aria.landmark.main |= aria.main
+
+## marquee
+	aria.marquee =
+		(	aria.role.marquee
+		&	aria.state.expanded?
+		)
+		aria.role.marquee = 
+			attribute role { string "marquee" }
+	
+	common.attrs.aria |= aria.marquee
+
+## math
+	aria.math =
+		(	aria.role.math
+		&	aria.state.expanded?
+		)
+		aria.role.math = 
+			attribute role { string "math" }
+	
+	common.attrs.aria |= aria.math
+
+## menu
+	aria.menu =
+		(	aria.role.menu
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.menu = 
+			attribute role { string "menu" }
+	
+	common.attrs.aria |= aria.menu
+
+## menubar
+	aria.menubar =
+		(	aria.role.menubar
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.menubar = 
+			attribute role { string "menubar" }
+	
+	common.attrs.aria |= aria.menubar
+
+## menuitem
+	aria.menuitem =
+		(	aria.role.menuitem )
+		aria.role.menuitem = 
+			attribute role { string "menuitem" }
+	
+	common.attrs.aria |= aria.menuitem
+
+## menuitemcheckbox
+	aria.menuitemcheckbox =
+		(	aria.role.menuitemcheckbox
+		&	aria.state.checked #required
+		)
+		aria.role.menuitemcheckbox = 
+			attribute role { string "menuitemcheckbox" }
+	
+	common.attrs.aria |= aria.menuitemcheckbox
+
+## menuitemradio
+	aria.menuitemradio =
+		(	aria.role.menuitemradio
+		&	aria.state.checked #required
+		&	aria.state.selected?
+		)
+		aria.role.menuitemradio = 
+			attribute role { string "menuitemradio" }
+	
+	common.attrs.aria |= aria.menuitemradio
+
+## navigation
+	aria.navigation =
+		(	aria.role.navigation
+		&	aria.state.expanded?
+		)
+		aria.role.navigation = 
+			attribute role { string "navigation" }
+	
+	common.attrs.aria |= aria.navigation
+	common.attrs.aria.landmark.navigation |= aria.navigation
+
+## note
+	aria.note =
+		(	aria.role.note
+		&	aria.state.expanded?
+		)
+		aria.role.note = 
+			attribute role { string "note" }
+	
+	common.attrs.aria |= aria.note
+	common.attrs.aria.landmark.note |= aria.note
+
+## option
+	aria.option =
+		(	aria.role.option
+		&	aria.state.checked? # not inherited
+		&	aria.state.selected? # not inherited
+		)
+		aria.role.option = 
+			attribute role { string "option" }
+	
+	common.attrs.aria |= aria.option
+
+
+## presentation
+	aria.presentation =
+		(	aria.role.presentation
+		&	aria.state.expanded?
+		)
+		aria.role.presentation = 
+			attribute role { string "presentation" }
+	
+	common.attrs.aria |= aria.presentation
+
+## progressbar
+	aria.progressbar =
+		(	aria.role.progressbar
+		&	aria.prop.valuemax? # not inherited
+		&	aria.prop.valuemin? # not inherited
+		&	aria.prop.valuenow? # not inherited
+		&	aria.prop.valuetext? # not inherited
+		)
+		aria.role.progressbar = 
+			attribute role { string "progressbar" }
+	
+	common.attrs.aria |= aria.progressbar
+
+## radio
+	aria.radio =
+		(	aria.role.radio
+		&	aria.state.checked #required!
+		&	aria.state.selected?
+		)
+		aria.role.radio = 
+			attribute role { string "radio" }
+	
+	common.attrs.aria |= aria.radio
+
+## radiogroup
+	aria.radiogroup =
+		(	aria.role.radiogroup
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.radiogroup = 
+			attribute role { string "radiogroup" }
+	
+	common.attrs.aria |= aria.radiogroup
+
+## region
+	aria.region =
+		(	aria.role.region
+		&	aria.state.expanded?
+		)
+		aria.role.region = 
+			attribute role { string "region" }
+	
+	common.attrs.aria |= aria.region
+
+## row
+	aria.row =
+		(	aria.role.row
+		&	aria.prop.level? # not inherited
+		&	aria.state.selected? # not inherited
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.row = 
+			attribute role { string "row" }
+	
+	common.attrs.aria |= aria.row
+
+# XXX rowheader
+
+## search
+	aria.search =
+		(	aria.role.search
+		&	aria.state.expanded?
+		)
+		aria.role.search = 
+			attribute role { string "search" }
+	
+	common.attrs.aria |= aria.search
+	common.attrs.aria.landmark.search |= aria.search
+
+## separator
+	aria.separator =
+		(	aria.role.separator
+		&	aria.state.expanded?
+		)
+		aria.role.separator = 
+			attribute role { string "separator" }
+	
+	common.attrs.aria |= aria.separator
+
+## slider
+	aria.slider =
+		(	aria.role.slider
+		&	aria.prop.valuemax
+		&	aria.prop.valuemin
+		&	aria.prop.valuenow
+		&	aria.prop.valuetext
+		)
+		aria.role.slider = 
+			attribute role { string "slider" }
+	
+	common.attrs.aria |= aria.slider
+
+## spinbutton
+	aria.spinbutton =
+		(	aria.role.spinbutton
+		&	aria.prop.activedescendant?
+		&	aria.prop.valuemax
+		&	aria.prop.valuemin
+		&	aria.prop.valuenow
+		&	aria.prop.valuetext
+		)
+		aria.role.spinbutton = 
+			attribute role { string "spinbutton" }
+	
+	common.attrs.aria |= aria.spinbutton
+
+## status
+	aria.status =
+		(	aria.role.status
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.status = 
+			attribute role { string "status" }
+	
+	common.attrs.aria |= aria.status
+
+## tab
+	aria.tab =
+		(	aria.role.tab
+		&	aria.state.selected?
+		&	aria.state.expanded?
+		)
+		aria.role.tab = 
+			attribute role { string "tab" }
+	
+	common.attrs.aria |= aria.tab
+
+## tablist
+	aria.tablist =
+		(	aria.role.tablist
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.tablist = 
+			attribute role { string "tablist" }
+
+## tabpanel
+	aria.tabpanel =
+		(	aria.role.tabpanel
+		&	aria.state.expanded?
+		)
+		aria.role.tabpanel = 
+			attribute role { string "tabpanel" }
+	
+	common.attrs.aria |= aria.tabpanel
+
+## textbox
+	aria.textbox =
+		(	aria.role.textbox
+		&	aria.prop.autocomplete? # not inherited
+		&	aria.prop.multiline? # not inherited
+		&	aria.prop.readonly? # not inherited
+		)
+		aria.role.textbox = 
+			attribute role { string "textbox" }
+	
+	common.attrs.aria |= aria.textbox
+
+## timer
+	aria.timer =
+		(	aria.role.timer
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.timer = 
+			attribute role { string "timer" }
+	
+	common.attrs.aria |= aria.timer
+
+## toolbar
+	aria.toolbar =
+		(	aria.role.toolbar
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.toolbar = 
+			attribute role { string "toolbar" }
+	
+	common.attrs.aria |= aria.toolbar
+
+## tooltip
+	aria.tooltip =
+		(	aria.role.tooltip
+		&	aria.state.expanded?
+		)
+		aria.role.tooltip = 
+			attribute role { string "tooltip" }
+	
+	common.attrs.aria |= aria.tooltip
+
+## tree
+	aria.tree =
+		(	aria.role.tree
+		&	aria.prop.multiselectable? # not inherited
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.tree = 
+			attribute role { string "tree" }
+	
+	common.attrs.aria |= aria.tree
+
+## treegrid
+	aria.treegrid =
+		(	aria.role.treegrid
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		&	aria.prop.level?
+		&	aria.prop.multiselectable?
+		&	aria.prop.readonly?
+		)
+		aria.role.treegrid = 
+			attribute role { string "treegrid" }
+	
+	common.attrs.aria |= aria.treegrid
+
+## treeitem
+	aria.treeitem =
+		(	aria.role.treeitem
+		&	aria.state.checked?
+		&	aria.state.expanded?
+		&	aria.prop.level?
+		&	aria.prop.posinset?
+		&	aria.state.selected?
+		&	aria.prop.setsize?
+		)
+		aria.role.treeitem = 
+			attribute role { string "treeitem" }
+	
+	common.attrs.aria |= aria.treeitem
+
+
diff --git a/xml/relaxng/src/resources/html5-schema/block.rnc b/xml/relaxng/src/resources/html5-schema/block.rnc
new file mode 100644
index 0000000..3f4332b
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/block.rnc
@@ -0,0 +1,201 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Basic Prose Markup                    #
+# #####################################################################
+
+# #####################################################################
+## Paragraph-Level
+
+## Paragraph: <p>
+
+	p.elem =
+		element p { p.inner & p.attrs }
+	p.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	p.inner =
+		( common.inner.phrasing ) # REVISIT lists in span?
+
+	common.elem.flow |= p.elem
+
+## Hint Transition: <hr>
+
+	hr.elem =
+		element hr { hr.inner & hr.attrs }
+	hr.attrs =
+		( common.attrs )
+	hr.inner =
+		( empty )
+
+	common.elem.flow |= hr.elem
+
+# #####################################################################
+## Preformatting Blocks
+
+## Preformatted Text: <pre>
+
+	pre.elem =
+		element pre { pre.inner & pre.attrs }
+	pre.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	pre.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= pre.elem
+
+# #####################################################################
+## Simple Lists
+
+## Unordered List: <ul>
+
+	ul.elem =
+		element ul { ul.inner & ul.attrs }
+	ul.attrs =
+		(	common.attrs
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.region
+			)?
+		)
+	ul.inner =
+		( li.elem* )
+
+	common.elem.flow |= ul.elem
+
+## Unordered List Item: <li>
+
+	li.elem =
+		element li { li.inner & li.attrs }
+	li.attrs =
+		(	common.attrs 
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.listitem
+			)?
+		)
+	li.inner =
+		( common.inner.flow )
+
+## Ordered List: <ol>
+
+	ol.elem =
+		element ol { ol.inner & ol.attrs }
+	ol.attrs =
+		(	common.attrs
+		&	ol.attrs.start?
+		&	ol.attrs.reversed?
+		&	ol.attrs.type?
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.region
+			)?
+		)
+		ol.attrs.start =
+			attribute start {
+				common.data.integer
+			}
+		ol.attrs.reversed =
+			attribute reversed {
+				w:string "reversed" | w:string ""
+			}
+		ol.attrs.type =
+			attribute type {
+				w:string "1" | w:string "a" | w:string "A" | w:string "i" | w:string "I"
+			}
+	ol.inner =
+		( oli.elem* )
+
+	common.elem.flow |= ol.elem
+
+## Ordered List Item: <li>
+
+	oli.elem =
+		element li { oli.inner & oli.attrs }
+	oli.attrs =
+		(	common.attrs
+		&	oli.attrs.value?
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.listitem
+			)?
+		)
+		oli.attrs.value =
+			attribute value {
+				common.data.integer
+			}
+	oli.inner =
+		( common.inner.flow )
+
+# #####################################################################
+## Definition Lists
+
+## Definition List: <dl>
+
+	dl.elem =
+		element dl { dl.inner & dl.attrs }
+	dl.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	dl.inner =
+		(	(	dt.elem+
+			,	dd.elem+
+			)*
+		)
+
+	common.elem.flow |= dl.elem
+
+## Definition Term: <dt>
+
+	dt.elem =
+		element dt { dt.inner & dt.attrs }
+	dt.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	dt.inner =
+		( common.inner.phrasing )
+
+## Definition Description: <dd>
+
+	dd.elem =
+		element dd { dd.inner & dd.attrs }
+	dd.elem.phrasing =
+		element dd { dd.inner.phrasing & dd.attrs }
+	dd.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	dd.inner =
+		( common.inner.flow )
+	dd.inner.phrasing =
+		( common.inner.phrasing )
+
+# #####################################################################
+## Miscellaneous Elements
+
+## Generic Container: <div>
+
+	div.elem =
+		element div { div.inner & div.attrs }
+	div.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	div.inner =
+		(	style.elem.scoped*
+		,	common.inner.flow 
+		)
+
+	common.elem.flow |= div.elem
+
+## Title or Explanatory Caption: <legend>
+
+	legend.elem =
+		element legend { legend.inner & legend.attrs }
+	legend.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.region?
+		)	
+	legend.inner =
+		( common.inner.phrasing )
diff --git a/xml/relaxng/src/resources/html5-schema/common.rnc b/xml/relaxng/src/resources/html5-schema/common.rnc
new file mode 100644
index 0000000..c4f1eb9
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/common.rnc
@@ -0,0 +1,420 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Common Definitions                    #
+# #####################################################################
+
+
+# #####################################################################
+##  Language Parameters - redefine in inclusion block as necessary    #
+# #####################################################################
+
+## HTML vs. XHTML restrictions
+
+	XMLonly = empty
+	HTMLonly = notAllowed
+
+## HTML 4 Compatibility - set to notAllowed to disallow markup introduced in HTML 5
+#                         (This only affects mixed-version modules; wholly HTML5
+#                          modules should simply be left out of the inclusion list.)
+
+	v5only = empty
+
+## HTML Compatibility Switches - set to notAllowed to disallow
+
+	## XML features that can't be roundtripped HTML <-> XHTML
+	#  (xml:base on elements other than <html>)
+	nonRoundtrippable = empty
+
+	## XML features that can't be serialized as HTML
+	nonHTMLizable = empty
+
+# #####################################################################
+##  Wildcards                                                         #
+# #####################################################################
+
+## Any attribute from any namespace
+
+	common.attr.anything =
+		attribute * { text }*
+
+## Any element from any namespace
+
+	common.elem.anything =
+		element * { common.inner.anything & common.attr.anything }
+
+## Any content from any namespace
+
+	common.inner.anything =
+		(	text
+		&	common.elem.anything*
+		)
+
+# #####################################################################
+##  Common Element Classes                                            #
+# #####################################################################
+
+## Metadata Elements
+
+	common.elem.metadata =
+		( notAllowed )
+
+## Phrase Elements
+
+	common.elem.phrasing =
+		( notAllowed )
+
+## Prose Elements
+
+	common.elem.flow =
+		( common.elem.phrasing )
+
+
+# #####################################################################
+##  Common Content Models                                             #
+# #####################################################################
+
+## Metadata Content
+
+	common.inner.metadata =
+		( common.elem.metadata* )
+
+## Phrase Content
+
+	common.inner.phrasing =
+		( text & common.elem.phrasing* )
+
+## Prose Content
+
+	common.inner.flow =
+		( text & common.elem.flow* ) # REVISIT <style scoped>
+
+# #####################################################################
+##  Common Attributes                                                 #
+# #####################################################################
+
+# When updating, check <bdo> definition too
+
+common.attrs =
+	(	common.attrs.basic
+	&	common.attrs.i18n
+	&	common.attrs.present
+	&	common.attrs.other
+	)
+
+common.attrs.basic =
+	(	(	common.attrs.id
+		|	common.attrs.xml-id
+		)? # REVISIT assuming only either one is allowed
+	&	common.attrs.class?
+	&	common.attrs.title?
+	&	common.attrs.base?
+	&	common.attrs.space?
+	&	common.attrs.role?
+	)
+	common.attrs.id =
+		attribute id {
+			common.data.id
+		}
+	common.attrs.xml-id =
+		attribute xml:id {
+			xsd:NCName
+		} & XMLonly
+	common.attrs.class =
+		attribute class {
+			common.data.tokens
+		}
+	common.attrs.title =
+		attribute title {
+			text
+		}
+	common.attrs.role = 
+		attribute role {
+			text
+		}
+	common.attrs.base =
+		common.attrs.xmlbase
+		& nonRoundtrippable
+	common.attrs.xmlbase =
+		attribute xml:base {
+			common.data.uri
+		} & XMLonly
+	common.attrs.space =
+		common.attrs.xmlspace
+	common.attrs.xmlspace =
+		attribute xml:space {
+			string "preserve" | string "default"
+		} & XMLonly
+
+common.attrs.i18n =
+	(	common.attrs.dir?
+	&	common.attrs.language?
+	)
+	common.attrs.dir =
+		attribute dir {
+			w:string "ltr" | w:string "rtl" | w:string "auto"
+		}
+	# This lang definition is a hack for enviroments where
+	# the HTML5 parser maps lang to xml:lang.
+	# Sameness check left to Schematron
+	common.attrs.language =
+		(	common.attrs.xmllang?
+		&	common.attrs.lang?
+		)
+	common.attrs.lang =
+		attribute lang {
+			common.data.langcode
+		} & XMLonly
+	common.attrs.xmllang =
+		attribute xml:lang {
+			common.data.langcode
+		}
+#	common.attrs.language =
+#		(	common.attrs.lang
+#		|	common.attrs.xmllang
+#		)
+#	common.attrs.lang =
+#		attribute lang {
+#			common.data.langcode
+#		} & HTMLonly
+#	common.attrs.xmllang =
+#		attribute xml:lang {
+#			common.data.langcode
+#		} & XMLonly
+
+common.attrs.present =
+	(	common.attrs.style?
+	&	common.attrs.tabindex?
+	&	common.attrs.accesskey?
+	)
+	common.attrs.style =
+		attribute style {
+			string
+		}
+	common.attrs.tabindex =
+		attribute tabindex {
+			common.data.integer
+		}
+		# REVISIT move style to a module and bundle tabindex with ARIA
+	common.attrs.accesskey =
+		attribute accesskey {
+			common.data.keylabellist
+		}
+
+common.attrs.other =
+	empty
+
+# #####################################################################
+##  Common Datatypes                                                  #
+# #####################################################################
+
+## Names and Tokens
+
+	common.data.tokens =
+		list { token* }
+
+	common.data.browsing-context =
+		w:browsing-context
+
+	common.data.browsing-context-or-keyword =
+		w:browsing-context-or-keyword
+#		xsd:string {
+#			pattern = "()|([^_].*)|(_[bB][lL][aA][nN][kK])|(_[sS][eE][lL][fF])|(_[pP][aA][rR][eE][nN][tT])|(_[tT][oO][pP])"
+#		}
+
+
+## IDs and IDREFs
+
+	common.data.id =
+		w:ID
+#		xsd:string {
+#			pattern = "\S+"
+#		}
+
+	common.data.idref =
+		w:IDREF
+
+	common.data.idrefs =
+		w:IDREFS
+
+	common.data.name =
+		w:ID #FIXME
+
+	common.data.hash-name =
+		w:hash-name
+#		xsd:string {
+#			pattern = "#.+"
+#		}
+
+## Numerical
+
+	common.data.integer =
+		w:integer
+#		xsd:string {
+#			pattern = "-?[0-9]+"
+#		}
+
+	common.data.integer.positive =
+		w:integer-positive
+#		xsd:string {
+#			pattern = "0*[1-9][0-9]*"
+#		}
+
+	common.data.integer.non-negative =
+		w:integer-non-negative
+#		xsd:string {
+#			pattern = "[0-9]+"
+#		}
+
+#	common.data.percent =
+#		xsd:string {
+#			pattern = "(100)|([1-9]?[0-9](\.[0-9]+)?)%"
+#		}
+
+	common.data.float =
+		w:float
+#		xsd:string {
+#			pattern = "-?[0-9]+(\.[0-9]+)?([eE]-?[0-9]+)?"
+#		}
+
+	common.data.float.positive =
+		w:float-positive
+#		xsd:string {
+#			pattern = "(0*[1-9][0-9]*(\.[0-9]+)?)|([0-9]+(\.0*[1-9][0-9]*)?)([eE]-?[0-9]+)?"
+#		}
+
+	common.data.float.non-negative =
+		w:float-non-negative
+#		xsd:string {
+#			pattern = "[0-9]+(\.[0-9]+)?([eE]-?[0-9]+)?"
+#		}
+
+## Temporal
+
+	common.data.datetime =
+		w:datetime-tz
+
+	common.data.date-or-time =
+		w:date-or-time
+
+	common.data.date =
+		w:date
+
+## IRIs
+
+	common.data.uri =
+		# allow either a non-empty IRI ref or zero or more HTML
+		# space characters (which are: space, tab, LF, FF, CR)
+		(	w:iri-ref
+		|	xsd:string {
+				pattern = "[ \x{0A}-\x{0D}]*"
+				# NOTE The range above incorrectly allows U+000B
+				# in addition to the HTML space characters; but
+				# that's not a problem in practice because HTML
+				# and XML parsers will both catch any U+000B
+				# and report an error for it before that pattern
+				# ever gets evaluated.
+		 	}
+		)
+
+	common.data.uri.non-empty =
+		w:iri-ref
+
+	common.data.uris =
+		list { w:iri-ref* }
+
+	common.data.uri.absolute =
+		w:iri
+
+## <link type='icon'> sizes
+
+	common.data.sizes =
+#		list { w:sizes }
+		list {
+			xsd:string {
+				pattern = "[1-9][0-9]*x[1-9][0-9]*"
+			}+
+		}
+
+## MIME types
+
+	common.data.mimetype =
+		w:mime-type
+
+## Encodings
+
+	common.data.charset =
+		w:charset
+
+	common.data.meta-charset =
+		w:meta-charset
+
+## Refresh
+
+	common.data.refresh =
+		w:refresh
+
+## Default style
+
+	common.data.default-style =
+        string
+#		w:default-style
+
+## Media Queries
+
+	common.data.mediaquery =
+		w:media-query
+
+## Language Codes
+
+	common.data.langcode =
+		w:string "" | w:language
+
+## List of Key Labels
+	common.data.keylabellist =
+		w:keylabellist
+
+## Microdata Properties
+  common.data.microdata-properties =
+    list { w:microdata-property+ }
+
+## Zero
+  common.data.zero =
+    w:zero
+
+## ECMAScript FunctionBody
+  common.data.functionbody =
+    w:functionbody
+
+# #####################################################################
+##  WF2 Module Hook                                                   #
+# #####################################################################
+
+common-form.attrs.form = ( notAllowed )
+
+# #####################################################################
+##  ARIA Module Hooks                                                 #
+# #####################################################################
+
+common.attrs.aria = ( notAllowed )
+common.attrs.aria.implicit.button = ( notAllowed )
+common.attrs.aria.implicit.input = ( notAllowed )
+common.attrs.aria.implicit.region = ( notAllowed )
+common.attrs.aria.implicit.group = ( notAllowed )
+common.attrs.aria.implicit.th = ( notAllowed )
+common.attrs.aria.implicit.structure = ( notAllowed )
+common.attrs.aria.implicit.link = ( notAllowed )
+common.attrs.aria.implicit.listitem = ( notAllowed )
+common.attrs.aria.implicit.img = ( notAllowed )
+common.attrs.aria.implicit.select = ( notAllowed )
+common.attrs.aria.landmark.application = ( notAllowed )
+common.attrs.aria.landmark.banner = ( notAllowed )
+common.attrs.aria.landmark.complementary = ( notAllowed )
+common.attrs.aria.landmark.contentinfo = ( notAllowed )
+common.attrs.aria.landmark.main = ( notAllowed )
+common.attrs.aria.landmark.navigation = ( notAllowed )
+common.attrs.aria.landmark.search = ( notAllowed )
+# per ARIA spec: article, document, and note are not actually landmarks
+common.attrs.aria.landmark.article = ( notAllowed )
+common.attrs.aria.landmark.document = ( notAllowed )
+common.attrs.aria.landmark.note = ( notAllowed )
\ No newline at end of file
diff --git a/xml/relaxng/src/resources/html5-schema/core-scripting.rnc b/xml/relaxng/src/resources/html5-schema/core-scripting.rnc
new file mode 100644
index 0000000..ef21687
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/core-scripting.rnc
@@ -0,0 +1,332 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Core Scripting                        #
+# #####################################################################
+
+# #####################################################################
+## Scripting Elements
+
+## Inline Scripts: <script>
+
+	script.elem.embedded =
+		element script { script.inner.embedded & script.attrs.embedded }
+	script.attrs.embedded =
+		(	common.attrs
+		&	script.attrs.type?
+		&	script.attrs.language? # restricted in Schematron
+		)
+	script.elem.imported =
+		element script { script.inner.imported & script.attrs.imported }
+	script.attrs.imported =
+		(	common.attrs
+		&	script.attrs.src?
+		&	script.attrs.defer?
+		&	script.attrs.async?
+		&	script.attrs.type?
+		&	script.attrs.charset?
+		&	script.attrs.language? # restricted in Schematron
+		)
+		script.attrs.src =
+			attribute src {
+				common.data.uri.non-empty
+			}
+		script.attrs.defer =
+			attribute defer {
+				w:string "defer" | w:string ""
+			}
+		script.attrs.async =
+			attribute async {
+				w:string "async" | w:string ""
+			} & v5only
+		script.attrs.type =
+			attribute type {
+				common.data.mimetype # XXX without charset parameter!
+			}
+		script.attrs.charset =
+			attribute charset {
+				common.data.charset
+			}
+		script.attrs.language =
+			attribute language {
+				string
+			}
+	script.inner.embedded =
+		( common.inner.anything )
+	script.inner.imported =
+		( common.inner.anything )
+		
+	script.elem = 
+		(	script.elem.embedded
+		|	script.elem.imported
+		)
+		
+	common.elem.metadata |= script.elem
+	common.elem.phrasing |= script.elem
+
+## Fallback Unscripted Content: <noscript>
+
+	noscript.elem.head =
+		element noscript { noscript.inner.head & noscript.attrs }
+		& HTMLonly
+		noscript.inner.head = 
+			(	link.elem
+			|	meta.http-equiv.default-style.elem
+			|	meta.http-equiv.refresh.elem
+			|	style.elem
+			)*
+	noscript.elem.phrasing =
+		element noscript { noscript.inner.phrasing & noscript.attrs }
+		& HTMLonly
+	noscript.inner.phrasing =
+		( common.inner.phrasing )
+	noscript.elem.flow =
+		element noscript { noscript.inner.flow & noscript.attrs }
+		& HTMLonly
+	noscript.inner.flow =
+		( common.inner.flow )
+	noscript.attrs =
+		( common.attrs )
+
+	common.elem.metadata |= noscript.elem.head
+	common.elem.phrasing |= noscript.elem.phrasing
+	common.elem.flow |= noscript.elem.flow
+
+# #####################################################################
+## Event Handler Attribute Definitions
+
+	common.attrs.scripting &=
+		(	scripting.attr.onabort?
+		&	scripting.attr.onblur?
+		&	scripting.attr.oncanplay?
+		&	scripting.attr.oncanplaythrough?
+		&	scripting.attr.onchange?
+		&	scripting.attr.onclick?
+		&	scripting.attr.oncontextmenu?
+		&	scripting.attr.ondblclick?
+		&	scripting.attr.ondrag?
+		&	scripting.attr.ondragend?
+		&	scripting.attr.ondragenter?
+		&	scripting.attr.ondragleave?
+		&	scripting.attr.ondragover?
+		&	scripting.attr.ondragstart?
+		&	scripting.attr.ondrop?
+		&	scripting.attr.ondurationchange?
+		&	scripting.attr.onemptied?
+		&	scripting.attr.onended?
+		&	scripting.attr.onerror?
+		&	scripting.attr.onfocus?
+		&	scripting.attr.oninput?
+		&	scripting.attr.oninvalid?
+		&	scripting.attr.onkeydown?
+		&	scripting.attr.onkeypress?
+		&	scripting.attr.onkeyup?
+		&	scripting.attr.onload?
+		&	scripting.attr.onloadeddata?
+		&	scripting.attr.onloadedmetadata?
+		&	scripting.attr.onloadstart?
+		&	scripting.attr.onmousedown?
+		&	scripting.attr.onmousemove?
+		&	scripting.attr.onmouseout?
+		&	scripting.attr.onmouseover?
+		&	scripting.attr.onmouseup?
+		&	scripting.attr.onmousewheel?
+		&	scripting.attr.onpause?
+		&	scripting.attr.onplay?
+		&	scripting.attr.onplaying?
+		&	scripting.attr.onprogress?
+		&	scripting.attr.onratechange?
+		&	scripting.attr.onreadystatechange?
+		&	scripting.attr.onreset?
+		&	scripting.attr.onscroll?
+		&	scripting.attr.onseeked?
+		&	scripting.attr.onseeking?
+		&	scripting.attr.onselect?
+		&	scripting.attr.onshow?
+		&	scripting.attr.onstalled?
+		&	scripting.attr.onsubmit?
+		&	scripting.attr.onsuspend?
+		&	scripting.attr.ontimeupdate?
+		&	scripting.attr.onvolumechange?
+		&	scripting.attr.onwaiting?
+		)
+		
+	common.attrs.other &= common.attrs.scripting
+
+	scripting.attr.onabort =
+		attribute onabort { common.data.functionbody }
+	scripting.attr.onblur =
+		attribute onblur { common.data.functionbody }
+	scripting.attr.oncanplay =
+		attribute oncanplay { common.data.functionbody }
+	scripting.attr.oncanplaythrough =
+		attribute oncanplaythrough { common.data.functionbody }
+	scripting.attr.onchange =
+		attribute onchange { common.data.functionbody }
+	scripting.attr.onclick =
+		attribute onclick { common.data.functionbody }
+	scripting.attr.oncontextmenu =
+		attribute oncontextmenu { common.data.functionbody }
+	scripting.attr.ondblclick =
+		attribute ondblclick { common.data.functionbody }
+	scripting.attr.ondrag =
+		attribute ondrag { common.data.functionbody }
+	scripting.attr.ondragend =
+		attribute ondragend { common.data.functionbody }
+	scripting.attr.ondragenter =
+		attribute ondragenter { common.data.functionbody }
+	scripting.attr.ondragleave =
+		attribute ondragleave { common.data.functionbody }
+	scripting.attr.ondragover =
+		attribute ondragover { common.data.functionbody }
+	scripting.attr.ondragstart =
+		attribute ondragstart { common.data.functionbody }
+	scripting.attr.ondrop =
+		attribute ondrop { common.data.functionbody }
+	scripting.attr.ondurationchange =
+		attribute ondurationchange { common.data.functionbody }
+	scripting.attr.onemptied =
+		attribute onemptied { common.data.functionbody }
+	scripting.attr.onended =
+		attribute onended { common.data.functionbody }
+	scripting.attr.onerror =
+		attribute onerror { common.data.functionbody }
+	scripting.attr.onfocus =
+		attribute onfocus { common.data.functionbody }
+	scripting.attr.onformchange =
+		attribute onformchange { common.data.functionbody }
+	scripting.attr.onforminput =
+		attribute onforminput { common.data.functionbody }
+	scripting.attr.oninput =
+		attribute oninput { common.data.functionbody }
+	scripting.attr.oninvalid =
+		attribute oninvalid { common.data.functionbody }
+	scripting.attr.onkeydown =
+		attribute onkeydown { common.data.functionbody }
+	scripting.attr.onkeypress =
+		attribute onkeypress { common.data.functionbody }
+	scripting.attr.onkeyup =
+		attribute onkeyup { common.data.functionbody }
+	scripting.attr.onload =
+		attribute onload { common.data.functionbody }
+	scripting.attr.onloadeddata =
+		attribute onloadeddata { common.data.functionbody }
+	scripting.attr.onloadedmetadata =
+		attribute onloadedmetadata { common.data.functionbody }
+	scripting.attr.onloadstart =
+		attribute onloadstart { common.data.functionbody }
+	scripting.attr.onmousedown =
+		attribute onmousedown { common.data.functionbody }
+	scripting.attr.onmousemove =
+		attribute onmousemove { common.data.functionbody }
+	scripting.attr.onmouseout =
+		attribute onmouseout { common.data.functionbody }
+	scripting.attr.onmouseover =
+		attribute onmouseover { common.data.functionbody }
+	scripting.attr.onmouseup =
+		attribute onmouseup { common.data.functionbody }
+	scripting.attr.onmousewheel =
+		attribute onmousewheel { common.data.functionbody }
+	scripting.attr.onpause =
+		attribute onpause { common.data.functionbody }
+	scripting.attr.onplay =
+		attribute onplay { common.data.functionbody }
+	scripting.attr.onplaying =
+		attribute onplaying { common.data.functionbody }
+	scripting.attr.onprogress =
+		attribute onprogress { common.data.functionbody }
+	scripting.attr.onratechange =
+		attribute onratechange { common.data.functionbody }
+	scripting.attr.onreadystatechange =
+		attribute onreadystatechange { common.data.functionbody }
+	scripting.attr.onreset =
+		attribute onreset { common.data.functionbody }
+	scripting.attr.onscroll =
+		attribute onscroll { common.data.functionbody }
+	scripting.attr.onseeked =
+		attribute onseeked { common.data.functionbody }
+	scripting.attr.onseeking =
+		attribute onseeking { common.data.functionbody }
+	scripting.attr.onselect =
+		attribute onselect { common.data.functionbody }
+	scripting.attr.onshow =
+		attribute onshow { common.data.functionbody }
+	scripting.attr.onstalled =
+		attribute onstalled { common.data.functionbody }
+	scripting.attr.onsubmit =
+		attribute onsubmit { common.data.functionbody }
+	scripting.attr.onsuspend =
+		attribute onsuspend { common.data.functionbody }
+	scripting.attr.ontimeupdate =
+		attribute ontimeupdate { common.data.functionbody }
+	scripting.attr.onvolumechange =
+		attribute onvolumechange { common.data.functionbody }
+	scripting.attr.onwaiting =
+		attribute onwaiting { common.data.functionbody }
+
+#	scripting.attr.common =
+#		(	scripting.attr.mouse
+#		&	scripting.attr.keyboard
+#		&	scripting.attr.focus
+#		)
+#	
+#	scripting.attr.mouse =
+#		(	scripting.attr.mouse.click?
+#		&	scripting.attr.mouse.dblclick?
+#		&	scripting.attr.mouse.down?
+#		&	scripting.attr.mouse.up?
+#		&	scripting.attr.mouse.over?
+#		&	scripting.attr.mouse.move?
+#		&	scripting.attr.mouse.out?
+#		)
+#		scripting.attr.mouse.click =
+#			attribute onclick { string }
+#		scripting.attr.mouse.dblclick =
+#			attribute ondblclick { string }
+#		scripting.attr.mouse.down =
+#			attribute onmousedown { string }
+#		scripting.attr.mouse.up =
+#			attribute onmouseup { string }
+#		scripting.attr.mouse.over =
+#			attribute onmouseover { string }
+#		scripting.attr.mouse.move =
+#			attribute onmousemove { string }
+#		scripting.attr.mouse.out =
+#			attribute onmouseout { string }
+#	
+#	scripting.attr.keyboard =
+#		(	scripting.attr.keyboard.press?
+#		&	scripting.attr.keyboard.down?
+#		&	scripting.attr.keyboard.up?
+#		)
+#		scripting.attr.keyboard.press =
+#			attribute onkeypress { string }
+#		scripting.attr.keyboard.down =
+#			attribute onkeydown { string }
+#		scripting.attr.keyboard.up =
+#			attribute onkeyup { string }
+#	
+#	
+#	scripting.attr.focus =
+#		(	scripting.attr.focus.gain?
+#		&	scripting.attr.focus.lose?
+#		)
+#		scripting.attr.focus.gain =
+#			attribute onfocus { string }
+#		scripting.attr.focus.lose =
+#			attribute onblur { string }
+#	
+#	scripting.attr.loading =
+#		(	scripting.attr.loading.load?
+#		&	scripting.attr.loading.unload?
+#		)
+#		scripting.attr.loading.load =
+#			attribute onload { string }
+#		scripting.attr.loading.unload =
+#			attribute onunload { string }
+
+
+# #####################################################################
+# Event Handler Attribute Assignments
+
+#	body.attrs   &= scripting.attr.loading
diff --git a/xml/relaxng/src/resources/html5-schema/data.rnc b/xml/relaxng/src/resources/html5-schema/data.rnc
new file mode 100644
index 0000000..851b6cf
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/data.rnc
@@ -0,0 +1,84 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Static Data Markup                    #
+# #####################################################################
+
+## Time: <time>
+
+	time.elem =
+		element time { time.inner & time.attrs }
+	time.attrs =
+		(	common.attrs
+		&	(	time.attrs.datetime?
+				|
+				(
+					(	time.attrs.datetime.dateonly?
+					|	time.attrs.datetime.tz?
+					)
+				&	time.attrs.pubdate
+				)
+			)
+		)
+		time.attrs.datetime =
+			attribute datetime {
+				common.data.date-or-time #REVISIT check format
+			}
+		time.attrs.datetime.dateonly =
+			attribute datetime {
+				common.data.date
+			}
+		time.attrs.datetime.tz =
+			attribute datetime {
+				common.data.datetime
+			}
+		time.attrs.pubdate =
+			attribute pubdate {
+				w:string "pubdate" | w:string ""
+			}
+	time.inner =
+		( common.inner.phrasing ) #Cannot enforce textContent format here
+
+	common.elem.phrasing |= time.elem
+
+## Scalar Gauge: <meter>
+
+	meter.elem =
+		element meter { meter.inner & meter.attrs }
+	meter.attrs =
+		(	common.attrs
+		&	meter.attrs.value
+		&	meter.attrs.min?
+		&	meter.attrs.low?
+		&	meter.attrs.high?
+		&	meter.attrs.max?
+		&	meter.attrs.optimum?
+		)
+		meter.attrs.value =
+			attribute value {
+				common.data.float
+			}
+		meter.attrs.min =
+			attribute min {
+				common.data.float
+			}
+		meter.attrs.low =
+			attribute low {
+				common.data.float
+			}
+		meter.attrs.high =
+			attribute high {
+				common.data.float
+			}
+		meter.attrs.max =
+			attribute max {
+				common.data.float
+			}
+		meter.attrs.optimum =
+			attribute optimum {
+				common.data.float
+			}
+	meter.inner =
+		( common.inner.phrasing ) #Cannot enforce textContent format here
+
+	common.elem.phrasing |= meter.elem
diff --git a/xml/relaxng/src/resources/html5-schema/embed.rnc b/xml/relaxng/src/resources/html5-schema/embed.rnc
new file mode 100644
index 0000000..27c9856
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/embed.rnc
@@ -0,0 +1,570 @@
+datatypes w = "http://whattf.org/datatype-draft"
+namespace local = ""
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Embedded Content                      #
+# #####################################################################
+
+#######################################################################
+## Replaced Content
+
+## Images: <img>
+
+	img.elem =
+		element img { img.inner & img.attrs }
+	img.attrs =
+		(	common.attrs
+		&	img.attrs.src
+		&	img.attrs.alt?
+		&	img.attrs.height?
+		&	img.attrs.width?
+		&	img.attrs.usemap?
+		&	img.attrs.ismap?
+		& img.attrs.border? # obsolete
+		&	common.attrs.aria?
+		)
+		img.attrs.src =
+			attribute src {
+				common.data.uri.non-empty
+			}
+		img.attrs.alt =
+			attribute alt {
+				text
+			}
+		img.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		img.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+		img.attrs.usemap =
+			attribute usemap {
+				common.data.hash-name
+			}
+		img.attrs.ismap =
+			attribute ismap {
+				w:string "ismap" | w:string ""
+			}
+		img.attrs.border =
+			attribute border {
+				common.data.zero
+			}
+	img.inner =
+		empty
+
+	common.elem.phrasing |= img.elem
+
+## Plug-ins: <embed>
+
+	embed.elem =
+		element embed { embed.inner & embed.attrs }
+	embed.attrs =
+		(	common.attrs
+		&	embed.attrs.src?
+		&	embed.attrs.type?
+		&	embed.attrs.height?
+		&	embed.attrs.width?
+		&	embed.attrs.other*
+		)
+		embed.attrs.src =
+			attribute src {
+				common.data.uri.non-empty
+			}
+		embed.attrs.type =
+			attribute type {
+				common.data.mimetype
+			}
+		embed.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		embed.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+		embed.attrs.other = # REVISIT common.attrs
+			attribute local:* - ( src 
+			                    | type 
+			                    | height 
+			                    | width 
+			                    | id 
+			                    | class
+			                    | title 
+			                    | dir 
+			                    | lang 
+			                    | style 
+			                    | tabindex 
+			                    | contextmenu 
+			                    | contenteditable 
+			                    | draggable 
+			                    | dropzone
+			                    | hidden
+			                    | onabort
+			                    | onblur
+			                    | oncanplay
+			                    | oncanplaythrough
+			                    | onchange
+			                    | onclick
+			                    | oncontextmenu
+			                    | ondblclick
+			                    | ondrag
+			                    | ondragend
+			                    | ondragenter
+			                    | ondragleave
+			                    | ondragover
+			                    | ondragstart
+			                    | ondrop
+			                    | ondurationchange
+			                    | onemptied
+			                    | onended
+			                    | onerror
+			                    | onfocus
+			                    | oninput
+			                    | oninvalid
+			                    | onkeydown
+			                    | onkeypress
+			                    | onkeyup
+			                    | onload
+			                    | onloadeddata
+			                    | onloadedmetadata
+			                    | onloadstart
+			                    | onmousedown
+			                    | onmousemove
+			                    | onmouseout
+			                    | onmouseover
+			                    | onmouseup
+			                    | onmousewheel
+			                    | onpause
+			                    | onplay
+			                    | onplaying
+			                    | onprogress
+			                    | onratechange
+			                    | onreadystatechange
+			                    | onreset
+			                    | onscroll
+			                    | onseeked
+			                    | onseeking
+			                    | onselect
+			                    | onshow
+			                    | onstalled
+			                    | onsubmit
+			                    | onsuspend
+			                    | ontimeupdate
+			                    | onvolumechange
+			                    | onwaiting
+			                    | onafterprint
+			                    | onbeforeprint
+			                    | onbeforeunload
+			                    | onhashchange
+			                    | onmessage
+			                    | onoffline
+			                    | ononline
+			                    | onpopstate
+			                    | onredo
+			                    | onresize
+			                    | onstorage
+			                    | onundo
+			                    | onunload
+			                    | role
+			                    | aria-atomic
+			                    | aria-busy
+			                    | aria-controls
+			                    | aria-describedby
+			                    | aria-disabled
+			                    | aria-dropeffect
+			                    | aria-flowto
+			                    | aria-grabbed
+			                    | aria-haspopup
+			                    | aria-hidden
+			                    | aria-invalid
+			                    | aria-label
+			                    | aria-labelledby
+			                    | aria-live
+			                    | aria-owns
+			                    | aria-relevant
+			                    | aria-required	
+			                    | spellcheck
+			                    | accesskey
+			                    | itemref
+			                    | itemprop
+			                    | itemscope
+			                    | itemtype
+			                    | itemid
+			                    | name
+			                    | align
+			                    ) 
+			{
+				string
+			}
+	embed.inner =
+		empty
+
+	common.elem.phrasing |= embed.elem
+
+## Generic Objects: <object>
+
+	object.elem.flow =
+		element object { object.inner.flow & object.attrs }
+	object.elem.phrasing =
+		element object { object.inner.phrasing & object.attrs }
+	object.attrs =
+		(	common.attrs
+		&	(	(	object.attrs.data
+				&	object.attrs.type?
+				)
+			|	object.attrs.type
+			)
+#		&	object.attrs.classid?
+#		&	object.attrs.codebase?
+#		&	object.attrs.codetype?
+		&	object.attrs.height?
+		&	object.attrs.width?
+		&	object.attrs.usemap?
+		&	object.attrs.name?
+		&	common-form.attrs.form?
+		&	common.attrs.aria?
+		)
+		object.attrs.data =
+			attribute data {
+				common.data.uri.non-empty
+			}
+		object.attrs.type =
+			attribute type {
+				common.data.mimetype
+			}
+		object.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		object.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+		object.attrs.usemap =
+			attribute usemap {
+				common.data.hash-name
+			}
+		object.attrs.name =
+			attribute name {
+				common.data.browsing-context
+			}
+	object.inner.flow =
+		(	param.elem*
+		,	common.inner.flow
+		)
+	object.inner.phrasing =
+		(	param.elem*
+		,	common.inner.phrasing
+		)
+
+	common.elem.flow |= object.elem.flow
+	common.elem.phrasing |= object.elem.phrasing
+
+## Initialization Parameters: <param>
+
+	param.elem =
+		element param { param.inner & param.attrs }
+	param.attrs =
+		(	common.attrs
+		&	param.attrs.name
+		&	param.attrs.value
+		)
+		param.attrs.name =
+			attribute name {
+				string
+			}
+		param.attrs.value =
+			attribute value {
+				string
+			}
+	param.inner =
+		( empty )
+
+## Inline Frame: <iframe>
+
+	iframe.elem =
+		element iframe { iframe.inner & iframe.attrs }
+	iframe.attrs =
+		(	common.attrs
+		&	iframe.attrs.src?
+		&	iframe.attrs.srcdoc?
+		&	iframe.attrs.name?
+		&	iframe.attrs.width?
+		&	iframe.attrs.height?
+		&	iframe.attrs.sandbox?
+		&	iframe.attrs.seamless?
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.region
+			)?
+		)
+		iframe.attrs.src =
+			attribute src {
+				common.data.uri.non-empty
+			}
+		iframe.attrs.srcdoc =
+			attribute srcdoc {
+				string #FIXME
+			}
+		iframe.attrs.name =
+			attribute name {
+				common.data.browsing-context
+			}
+		iframe.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		iframe.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+		iframe.attrs.seamless =
+			attribute seamless {
+				w:string "seamless" | w:string ""
+			} & v5only
+		iframe.attrs.sandbox =
+			attribute sandbox
+				{	list 
+					{	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-scripts" )?
+					}
+				|	list 
+					{	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-forms" )?
+					}
+				|	list 
+					{	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-scripts" )?
+					}
+				|	list 
+					{	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-same-origin" )?
+					}
+				|	list 
+					{	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-forms" )?
+					}
+				|	list 
+					{	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-same-origin" )?
+					}
+				|	list 
+					{	( w:string "allow-same-origin" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-scripts" )?
+					}
+				|	list 
+					{	( w:string "allow-same-origin" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-forms" )?
+					}
+				|	list 
+					{	( w:string "allow-forms" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-scripts" )?
+					}
+				|	list 
+					{	( w:string "allow-forms" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-same-origin" )?
+					}
+				|	list 
+					{	( w:string "allow-scripts" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-forms" )?
+					}
+				|	list 
+					{	( w:string "allow-scripts" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-same-origin" )?
+					}
+				|	list 
+					{	( w:string "allow-same-origin" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-scripts" )?
+					}
+				|	list 
+					{	( w:string "allow-same-origin" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-forms" )?
+					}
+				|	list 
+					{	( w:string "allow-forms" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-scripts" )?
+					}
+				|	list 
+					{	( w:string "allow-forms" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-same-origin" )?
+					}
+				|	list 
+					{	( w:string "allow-scripts" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-forms" )?
+					}
+				|	list 
+					{	( w:string "allow-scripts" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-same-origin" )?
+					}
+				|	list 
+					{	( w:string "allow-same-origin" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-top-navigation" )?
+					}
+				|	list 
+					{	( w:string "allow-same-origin" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-top-navigation" )?
+					}
+				|	list 
+					{	( w:string "allow-forms" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-top-navigation" )?
+					}
+				|	list 
+					{	( w:string "allow-forms" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-top-navigation" )?
+					}
+				|	list 
+					{	( w:string "allow-scripts" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-top-navigation" )?
+					}
+				|	list 
+					{	( w:string "allow-scripts" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-top-navigation" )?
+					}
+				} & v5only
+	iframe.inner =
+		( text )
+
+	common.elem.phrasing |= iframe.elem
+
+#######################################################################
+## Image Maps
+
+## Map Definition: <map>
+
+	map.elem.flow =
+		element map { map.inner.flow & map.attrs }
+	map.elem.phrasing  =
+		element map { map.inner.phrasing & map.attrs }
+	map.attrs =
+		(	common.attrs
+		&	map.attrs.name
+		) # REVISIT make id required in Schematron
+		map.attrs.name =
+			attribute name {
+				common.data.name
+			}
+	map.inner.flow =
+		( common.inner.flow )
+	map.inner.phrasing =
+		( common.inner.phrasing )
+
+	common.elem.flow |= map.elem.flow
+	common.elem.phrasing |= map.elem.phrasing
+
+## Map Area Definition: <area>
+
+	area.elem =
+		element area { area.inner & area.attrs }
+	area.attrs =
+		(	common.attrs
+		&	(	area.attrs.alt
+			&	shared-hyperlink.attrs.href
+			)?
+		&	shared-hyperlink.attrs.target?
+		&	shared-hyperlink.attrs.ping?
+		&	shared-hyperlink.attrs.rel?
+		&	shared-hyperlink.attrs.media?
+		&	shared-hyperlink.attrs.hreflang?
+		&	shared-hyperlink.attrs.type?
+		&	area.attrs.shape?
+		)
+		area.attrs.alt =
+			attribute alt {
+				text
+			}
+		area.attrs.shape =
+			(	( area.attrs.shape.rect?  & area.attrs.coords.rect   )
+			|	( area.attrs.shape.circle & area.attrs.coords.circle )
+			|	( area.attrs.shape.poly   & area.attrs.coords.poly   )
+			|	( area.attrs.shape.default )
+			)
+		area.attrs.shape.rect =
+			attribute shape {
+				w:string "rect"
+			}
+		area.attrs.coords.rect =
+			attribute coords {
+				w:rectangle
+#				xsd:token {
+#					pattern = "-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+"
+#				}
+			}
+		area.attrs.shape.circle =
+			attribute shape {
+				w:string "circle"
+			}
+		area.attrs.coords.circle =
+			attribute coords {
+				w:circle
+#				xsd:token {
+#					pattern = "-?[0-9]+,-?[0-9]+,[0-9]+"
+#				}
+			}
+		area.attrs.shape.poly =
+			attribute shape {
+				w:string "poly"
+			}
+		area.attrs.coords.poly =
+			attribute coords {
+				w:polyline
+#				xsd:token {
+#					pattern = "-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+(,-?[0-9]+,-?[0-9]+)*"
+#				}
+			}
+		area.attrs.shape.default =
+			attribute shape {
+				w:string "default"
+			}
+	area.inner =
+		( empty )
+
+	common.elem.phrasing |= area.elem
diff --git a/xml/relaxng/src/resources/html5-schema/form-datatypes.rnc b/xml/relaxng/src/resources/html5-schema/form-datatypes.rnc
new file mode 100644
index 0000000..db719f9
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/form-datatypes.rnc
@@ -0,0 +1,63 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Datatypes related to forms            #
+# #####################################################################
+
+## MIME types
+		
+	form.data.mimetypelist = 
+		w:mime-type-list
+		
+	form.data.charsetlist =
+		string # FIXME should be a "a space- and/or comma-delimited 
+		       # list of charset values"
+
+## ECMAScript Regular Expression
+		
+	form.data.pattern = 
+		w:pattern
+		
+## Temporal
+		
+	form.data.datetime-local =
+		w:datetime-local
+	
+	form.data.date =
+		w:date
+	
+	form.data.month =
+		w:month
+	
+	form.data.week =
+		w:week
+	
+	form.data.time =
+		w:time
+
+## Email
+
+	form.data.emailaddress =
+		w:email-address
+
+	form.data.emailaddresslist =
+		w:email-address-list
+
+## Color
+
+	form.data.color =
+		w:simple-color
+#		xsd:string {
+#			pattern = "#[a-fA-F0-9]{6}"
+#		}
+
+## Text without line breaks
+
+	form.data.stringwithoutlinebreaks =
+		w:string-without-line-breaks
+
+## Non-empty string
+
+	form.data.nonemptystring =
+		w:non-empty-string
+
diff --git a/xml/relaxng/src/resources/html5-schema/html5.rnc b/xml/relaxng/src/resources/html5-schema/html5.rnc
new file mode 100644
index 0000000..a653b02
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/html5.rnc
@@ -0,0 +1,56 @@
+default namespace = "http://www.w3.org/1999/html"
+# #####################################################################
+##  RELAX NG Schema for HTML 5                                       #
+# #####################################################################
+
+  # To validate an HTML 5 document, you must first validate against  #
+  # this schema and then ALSO validate against assertions.sch        #
+
+  ## HTML flavor RELAX NG schemas can only be used after the         #
+  ## document has been transformed to well-formed XML.               #
+  ##   - Insert closing slashes in all empty element tags            #
+  ##   - Insert all optional start and end tags                      #
+  ##   - Add xmlns "http://www.w3.org/1999/xhtml"                    #
+  ##   - Properly escape <script> and <style> CDATA                  #
+  ##   - Parse and transform all HTML-only entities to numeric       #
+  ##     character references                                        #
+  ## Obviously, syntax-checking involving these features cannot be   #
+  ## done by the RELAX NG schema and must be checked, along with the #
+  ## <!DOCTYPE> requirement, by some other application.              #
+
+# #####################################################################
+## Schema Framework & Parameters
+
+include "common.rnc" {
+	# XHTML flavor #
+		XMLonly = notAllowed
+		HTMLonly = empty
+	# HTML 4 compat #
+		v5only = empty
+	# HTML-serializability #
+		nonHTMLizable = notAllowed
+	# HTML-roundtrippability #
+		nonRoundtrippable = notAllowed
+}
+
+# #####################################################################
+## Language Definitions
+
+start = html.elem
+
+include "meta.rnc"
+include "phrase.rnc"
+include "block.rnc"
+include "sectional.rnc"
+include "structural.rnc"
+include "revision.rnc"
+include "embed.rnc"
+include "ruby.rnc"
+include "media.rnc"
+include "core-scripting.rnc"
+include "tables.rnc"
+include "form-datatypes.rnc"
+include "web-forms.rnc"
+include "web-forms2.rnc"
+include "applications.rnc"
+include "data.rnc"
diff --git a/xml/relaxng/src/resources/html5-schema/html5exclusions.rnc b/xml/relaxng/src/resources/html5-schema/html5exclusions.rnc
new file mode 100644
index 0000000..1fa0915
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/html5exclusions.rnc
@@ -0,0 +1,63 @@
+default namespace = "http://www.w3.org/1999/xhtml"
+# #####################################################################
+##  RELAX NG Schema for (X)HTML 5: Exclusions                         #
+# #####################################################################
+
+  ## This file is unmaintained. Please use assertions.sch instead.
+  
+# #####################################################################
+## Schema Framework & Parameters
+
+	start = normal.elem.all-inclusive
+
+# #####################################################################
+##  Normal Element Patterns
+
+## Any attribute from any namespace
+
+	normal.attr.anything =
+		attribute * { text }*
+
+## Any element from any namespace except exceptional elements,
+## but allowing those elements as descendants
+
+	normal.elem.all =
+		element * - (dfn) {
+			normal.elem.all-inclusive
+		}
+
+## Any element from any namespace including exceptional elements
+
+	normal.elem.all-inclusive =
+		wildcard.elem.exclude-all | dfn.elem.exclude-self
+
+
+# #####################################################################
+##  Exclusion Element Patterns
+
+  # exclude all exceptional elements from the name classes;
+  # list them explicitly in content models instead
+
+normal.elem.exclude-dfn =
+	element * - (dfn) {
+		normal.elem.exclude-dfn
+	}
+
+dfn.elem.exclude-self =
+	element dfn {
+		(	normal.attr.anything
+		&	normal.elem.exclude-dfn
+		)
+	}
+
+# FIXME this part was cut off -- hsivonen
+wildcard.elem.exclude-all = 
+	notAllowed
+
+#FIXME no nested forms in HTML-serializable docs
+
+#FIXME no nested labels
+
+#FIXME no blockquote inside header or footer
+
+#FIXME exactly one hn in header
diff --git a/xml/relaxng/src/resources/html5-schema/media.rnc b/xml/relaxng/src/resources/html5-schema/media.rnc
new file mode 100644
index 0000000..edc5744
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/media.rnc
@@ -0,0 +1,205 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Advanced Embedded Content             #
+# #####################################################################
+
+## Attributes Common to Media Elements
+
+	# src not included
+	media.attrs = 
+		(	media.attrs.autoplay?
+		&	media.attrs.preload?
+		&	media.attrs.controls?
+		&	media.attrs.loop?
+		&	media.attrs.mediagroup?
+		&	media.attrs.muted?
+		)
+		media.attrs.autoplay   =
+			attribute autoplay   {
+				w:string "autoplay" | w:string ""
+			}
+		media.attrs.preload   =
+			attribute preload   {
+				w:string "none" | w:string "metadata" | w:string "auto" | w:string ""
+			}
+		media.attrs.controls  =
+			attribute controls  {
+				w:string "controls" | w:string ""
+			}
+		media.attrs.loop =
+			attribute loop {
+				w:string "loop" | w:string ""
+			}
+		media.attrs.mediagroup =
+			attribute mediagroup {
+				string
+			}
+		media.attrs.muted =
+			attribute muted {
+				w:string "muted" | w:string ""
+			}
+		
+## Source: <source>
+
+	source.elem =
+		element source { source.inner & source.attrs }
+	source.attrs =
+		(	common.attrs
+		&	source.attrs.src
+		&	source.attrs.type?
+		&	source.attrs.media?
+		)
+		source.attrs.src =
+			attribute src {
+				common.data.uri.non-empty
+			}
+		source.attrs.type =
+			attribute type {
+				common.data.mimetype
+			}
+		source.attrs.media =
+			attribute media {
+				common.data.mediaquery
+			}
+	source.inner =
+		( empty )
+
+## Media src attribute
+
+	media.attrs.src =
+		attribute src {
+			common.data.uri.non-empty
+		}
+
+## Video: <video>
+
+	video.elem.flow =
+		element video { video.inner.flow & video.attrs }
+	video.elem.phrasing =
+		element video { video.inner.phrasing & video.attrs }
+	video.attrs =
+		(	common.attrs
+		&	media.attrs
+		&	video.attrs.poster?
+		&	video.attrs.height?
+		&	video.attrs.width?
+		)
+		video.attrs.poster =
+			attribute poster {
+				common.data.uri.non-empty
+			}
+		video.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		video.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+	video.inner.flow =
+		(	video.source
+		,	track.elem*
+		,	common.inner.flow
+		)
+	video.inner.phrasing =
+		(	video.source
+		,	track.elem*
+		,	common.inner.phrasing
+		)
+	video.source =
+		(	media.attrs.src
+		|	source.elem*
+		)
+
+	common.elem.flow |= video.elem.flow
+	common.elem.phrasing |= video.elem.phrasing
+
+## Audio: <audio>
+
+	audio.elem.flow =
+		element audio { audio.inner.flow & audio.attrs }
+	audio.elem.phrasing =
+		element audio { audio.inner.phrasing & audio.attrs }
+	audio.attrs =
+		(	common.attrs
+		&	media.attrs
+		)
+	audio.inner.flow =
+		(	audio.source
+		,	track.elem*
+		,	common.inner.flow
+		)
+	audio.inner.phrasing =
+		(	audio.source
+		,	track.elem*
+		,	common.inner.phrasing
+		)
+	audio.source =
+		(	media.attrs.src
+		|	source.elem+
+		)
+
+	common.elem.flow |= audio.elem.flow
+	common.elem.phrasing |= audio.elem.phrasing
+
+## supplementary media track: <track>
+#
+	track.elem =
+		element track { track.inner & track.attrs }
+
+	track.attrs =
+		(	common.attrs
+		&	track.attrs.kind?
+		&	track.attrs.src
+		&	track.attrs.srclang?
+		&	track.attrs.label?
+		&	track.attrs.default?
+		)
+		track.attrs.kind =
+			attribute kind {
+				w:string "subtitles" | w:string "captions" | w:string "descriptions" | w:string "chapters" | w:string "metadata"
+			}
+		track.attrs.src =
+			attribute src {
+				common.data.uri.non-empty
+			}
+		track.attrs.srclang =
+			attribute srclang {
+				common.data.langcode
+			}
+		track.attrs.label =
+			attribute label {
+				string # must be non-empty value; check is in assertions code
+			}
+		track.attrs.default =
+			attribute default {
+				w:string "default" | w:string ""
+			}
+
+	track.inner =
+		( empty )
+
+## Captioned Content: <figure>
+
+	figure.elem =
+		element figure { figure.inner & figure.attrs }
+	figure.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.img?
+		)
+	figure.inner =
+		(	( figcaption.elem, common.inner.flow )
+		|	( common.inner.flow, figcaption.elem? )
+		)
+
+	common.elem.flow |= figure.elem
+
+## Figure caption: <figcaption>
+
+	figcaption.elem =
+		element figcaption { figcaption.inner & figcaption.attrs }
+	figcaption.attrs =
+		( common.attrs )
+	figcaption.inner =
+		( common.inner.flow )
diff --git a/xml/relaxng/src/resources/html5-schema/meta.rnc b/xml/relaxng/src/resources/html5-schema/meta.rnc
new file mode 100644
index 0000000..cd0097a
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/meta.rnc
@@ -0,0 +1,323 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Global Structure & Metadata          #
+# #####################################################################
+
+## Root Element: <html>
+
+	html.elem =
+		element html { html.inner & html.attrs }
+	html.attrs =
+		( common.attrs )
+	html.inner =
+		(	head.elem
+		,	body.elem
+		)
+
+## Metadata Container: <head>
+
+	head.elem =
+		element head { head.inner & head.attrs }
+	head.attrs =
+		(	common.attrs
+#		&	head.attrs.profile?
+		)
+#		head.attrs.profile =
+#			attribute profile {
+#				common.data.uris #REVISIT should these be absolute (zero or more)
+#			}
+	head.inner =
+		(	title.elem
+		&	base.elem? # REVISIT need a non-schema checker or Schematron
+		&	common.inner.metadata # Limit encoding decl position in Schematron
+		)
+#	head.inner =
+#		(	meta.elem.encoding?
+#		,	(	title.elem
+#			&	base.elem? # REVISIT need a non-schema checker or Schematron
+#			&	common.inner.metadata
+#			)
+#		)
+		
+## Content Container: <body>
+
+	body.elem =
+		element body { body.inner & body.attrs }
+	body.attrs =
+		(	common.attrs
+		&	(	common.attrs.aria.landmark.application
+			|	common.attrs.aria.landmark.document
+			|	common.attrs.aria.implicit.structure
+			)?
+		&	body.attrs.onafterprint?
+		&	body.attrs.onbeforeprint?
+		&	body.attrs.onbeforeunload?
+		&	body.attrs.onhashchange?
+		&	body.attrs.onmessage?
+		&	body.attrs.onoffline?
+		&	body.attrs.ononline?
+		&	body.attrs.onpopstate?
+		&	body.attrs.onredo?
+		&	body.attrs.onresize?
+		&	body.attrs.onstorage?
+		&	body.attrs.onundo?
+		&	body.attrs.onunload?
+		)
+	body.inner =
+		( common.inner.flow )
+
+	body.attrs.onafterprint =
+		attribute onafterprint { common.data.functionbody }
+	body.attrs.onbeforeprint =
+		attribute onbeforeprint { common.data.functionbody }
+	body.attrs.onbeforeunload =
+		attribute onbeforeunload { common.data.functionbody }
+	body.attrs.onhashchange =
+		attribute onhashchange { common.data.functionbody }
+	body.attrs.onmessage =
+		attribute onmessage { common.data.functionbody }
+	body.attrs.onoffline =
+		attribute onoffline { common.data.functionbody }
+	body.attrs.ononline =
+		attribute ononline { common.data.functionbody }
+	body.attrs.onpopstate =
+		attribute onpopstate { common.data.functionbody }
+	body.attrs.onredo =
+		attribute onredo { common.data.functionbody }
+	body.attrs.onresize =
+		attribute onresize { common.data.functionbody }
+	body.attrs.onstorage =
+		attribute onstorage { common.data.functionbody }
+	body.attrs.onundo =
+		attribute onundo { common.data.functionbody }
+	body.attrs.onunload =
+		attribute onunload { common.data.functionbody }
+
+## Document Title: <title>
+
+	title.elem =
+		element title { title.inner & title.attrs }
+	title.attrs =
+		( common.attrs )
+	title.inner =
+		( text )
+
+## Base URI: <base>
+
+	base.elem =
+		element base { base.inner & base.attrs }
+	base.attrs =
+		(	common.attrs
+		&	(	(	base.attrs.href
+				&	base.attrs.target?
+				)
+			|	base.attrs.target
+			)
+		)
+	base.attrs.href =
+		attribute href {
+			common.data.uri
+		}
+	base.attrs.target =
+		attribute target {
+			common.data.browsing-context-or-keyword
+		}
+	base.inner =
+		( empty )
+
+## Global Relationships: <link>
+
+	link.elem =
+		element link { link.inner & link.attrs }
+	link.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	common.attrs.microdata.itemref?
+		&	common.attrs.microdata.itemscope?
+		&	common.attrs.microdata.itemtype?
+		&	common.attrs.microdata.itemid?
+		&	link.attrs.href
+		&	(	link.attrs.rel
+			|	common.attrs.microdata.itemprop
+			)
+		&	shared-hyperlink.attrs.hreflang?
+		&	shared-hyperlink.attrs.media?
+		&	shared-hyperlink.attrs.type?
+		&	link.attrs.sizes?
+		#	link.attrs.title included in common.attrs
+		)
+		link.attrs.href =
+			attribute href {
+				common.data.uri.non-empty
+			}
+		link.attrs.rel =
+			attribute rel {
+				w:link-rel
+			}
+		link.attrs.sizes =
+			attribute sizes {
+				w:string "any" | common.data.sizes
+			}
+	link.inner =
+		( empty )
+		
+	common.elem.metadata |= link.elem
+
+## Global Style: <style>
+
+	style.elem =
+		element style { style.inner & style.attrs }
+	style.attrs =
+		(	common.attrs
+		&	style.attrs.type?
+		&	style.attrs.media?
+		#	style.attrs.title included in common.attrs
+		)
+		style.attrs.type =
+			attribute type {
+				common.data.mimetype
+			}
+		style.attrs.media =
+			attribute media {
+				common.data.mediaquery
+			}
+	style.inner =
+		( common.inner.anything )
+		
+	common.elem.metadata |= style.elem
+
+## Scoped Style: <style scoped>
+
+	style.elem.scoped =
+		element style { style.inner & style.scoped.attrs }
+	style.scoped.attrs =
+		(	common.attrs
+		&	style.attrs.type?
+		&	style.attrs.media?
+		&	style.attrs.scoped
+		#	style.attrs.title included in common.attrs
+		)
+		style.attrs.scoped =
+			attribute scoped {
+				w:string "scoped" | w:string ""
+			}
+
+## Name-Value Metadata: <meta name>
+
+	meta.name.elem =
+		element meta { meta.inner & meta.name.attrs }
+	meta.name.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	meta.name.attrs.name
+		&	meta.name.attrs.content
+		)
+		meta.name.attrs.name =
+			attribute name {
+				w:meta-name
+			}
+		meta.name.attrs.content =
+			attribute content {
+				string
+			}
+	meta.inner =
+		( empty )
+		
+	common.elem.metadata |= meta.name.elem
+
+## "refresh" pragma directive: <meta http-equiv='refresh'>
+
+	meta.http-equiv.refresh.elem =
+		element meta { meta.inner & meta.http-equiv.refresh.attrs }
+	meta.http-equiv.refresh.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	meta.http-equiv.attrs.http-equiv.refresh
+		&	meta.http-equiv.attrs.content.refresh
+		)
+		meta.http-equiv.attrs.http-equiv.refresh =
+			attribute http-equiv {
+				w:string "refresh"
+			}
+		meta.http-equiv.attrs.content.refresh =
+			attribute content { 
+				common.data.refresh
+			}
+	common.elem.metadata |= meta.http-equiv.refresh.elem # not quite right per spec
+                                                       # if the definition is 
+                                                       # reused in another language
+
+## "default-style" pragma directive: <meta http-equiv='default-style'>
+
+	meta.http-equiv.default-style.elem =
+		element meta { meta.inner & meta.http-equiv.default-style.attrs }
+	meta.http-equiv.default-style.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	meta.http-equiv.attrs.http-equiv.default-style
+		&	meta.http-equiv.attrs.content.default-style
+		)
+		meta.http-equiv.attrs.http-equiv.default-style =
+			attribute http-equiv {
+				w:string "default-style"
+			}
+		meta.http-equiv.attrs.content.default-style =
+			attribute content {
+				common.data.default-style
+			}
+		
+	common.elem.metadata |= meta.http-equiv.default-style.elem # not quite right per spec
+                                                               # if the definition is 
+                                                               # reused in another language
+
+## Inline Character Encoding Statement for HTML: <meta charset>
+
+	meta.charset.elem =
+		element meta { meta.inner & meta.charset.attrs }
+	meta.charset.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	meta.charset.attrs.charset
+		)
+		meta.charset.attrs.charset =
+			attribute charset {
+				(common.data.charset & HTMLonly)
+				| (xsd:string {
+					pattern = "[uU][tT][fF]-8"
+				} & XMLonly )
+			} 
+
+## Inline Character Encoding Statement for HTML: <meta http-equiv='content-type'>
+
+	meta.http-equiv.content-type.elem =
+		element meta { meta.inner & meta.http-equiv.content-type.attrs }
+		& HTMLonly
+	meta.http-equiv.content-type.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	meta.http-equiv.attrs.http-equiv.content-type
+		&	meta.http-equiv.attrs.content.content-type
+		)
+		meta.http-equiv.attrs.http-equiv.content-type =
+			attribute http-equiv {
+				w:string "content-type"
+			}
+		meta.http-equiv.attrs.content.content-type =
+			attribute content {
+				common.data.meta-charset
+			}
+
+	common.elem.metadata |= ( meta.charset.elem | meta.http-equiv.content-type.elem )
diff --git a/xml/relaxng/src/resources/html5-schema/microdata.rnc b/xml/relaxng/src/resources/html5-schema/microdata.rnc
new file mode 100644
index 0000000..51d25ae
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/microdata.rnc
@@ -0,0 +1,81 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Microdata                             #
+# #####################################################################
+
+common.attrs.microdata =
+	(	common.attrs.microdata.itemref?
+	&	common.attrs.microdata.itemprop?
+	&	common.attrs.microdata.itemscope?
+	&	common.attrs.microdata.itemtype?
+	&	common.attrs.microdata.itemid?
+	)
+	common.attrs.microdata.itemref =
+		attribute itemref {
+			common.data.idrefs
+		}
+	common.attrs.microdata.itemprop =
+		attribute itemprop {
+			common.data.microdata-properties
+		}
+	common.attrs.microdata.itemscope =
+		attribute itemscope {
+			w:string "itemscope" | w:string ""
+		}
+	common.attrs.microdata.itemtype =
+		attribute itemtype {
+			common.data.uri.absolute
+		}
+	common.attrs.microdata.itemid =
+		attribute itemid {
+			common.data.uri
+		}
+
+common.attrs &= common.attrs.microdata
+
+## URL-valued Property Metadata: <link itemprop>
+
+	link.elem.phrasing =
+		element link { link.inner & link.phrasing.attrs }
+	link.phrasing.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	common.attrs.microdata.itemprop
+		&	common.attrs.microdata.itemref?
+		&	common.attrs.microdata.itemscope?
+		&	common.attrs.microdata.itemtype?
+		&	common.attrs.microdata.itemid?
+		&	shared-hyperlink.attrs.href
+		&	shared-hyperlink.attrs.hreflang?
+		&	shared-hyperlink.attrs.media?
+		&	shared-hyperlink.attrs.type?
+		&	link.attrs.sizes?
+		#	link.attrs.title included in common.attrs
+		)
+	common.elem.phrasing |= link.elem.phrasing
+
+## Property Metadata: <meta itemprop>
+
+	meta.itemprop.elem =
+		element meta { meta.inner & meta.itemprop.attrs }
+	meta.itemprop.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	common.attrs.microdata.itemprop
+		&	common.attrs.microdata.itemref?
+		&	common.attrs.microdata.itemscope?
+		&	common.attrs.microdata.itemtype?
+		&	common.attrs.microdata.itemid?
+		&	meta.itemprop.attrs.content
+		)
+		meta.itemprop.attrs.content =
+			attribute content {
+				string
+			}
+	common.elem.metadata |= meta.itemprop.elem
+	common.elem.phrasing |= meta.itemprop.elem
diff --git a/xml/relaxng/src/resources/html5-schema/phrase.rnc b/xml/relaxng/src/resources/html5-schema/phrase.rnc
new file mode 100644
index 0000000..91ee130
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/phrase.rnc
@@ -0,0 +1,361 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Phrase Markup                         #
+# #####################################################################
+
+## Contextual Hyperlink: <a>
+
+	a.elem.phrasing =
+		element a { a.inner.phrasing & a.attrs }
+	a.elem.flow =
+		element a { a.inner.flow & a.attrs }
+	a.attrs =
+		(	common.attrs
+		& a.attrs.name?
+		&	shared-hyperlink.attrs.href?
+		&	shared-hyperlink.attrs.target?
+		&	shared-hyperlink.attrs.rel?
+		&	shared-hyperlink.attrs.hreflang?
+		&	shared-hyperlink.attrs.media?
+		&	shared-hyperlink.attrs.type?
+		&	shared-hyperlink.attrs.ping?
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.link
+			)?
+		)
+		a.attrs.name =
+		  attribute name {
+		    common.data.id # XXX not what the spec says
+		  }
+	a.inner.phrasing =
+		( common.inner.phrasing )
+	a.inner.flow =
+		( common.inner.flow )
+
+	common.elem.phrasing |= a.elem.phrasing
+	common.elem.flow |= a.elem.flow
+
+## Shared hyperlink attributes
+
+  shared-hyperlink.attrs.href =
+    attribute href {
+      common.data.uri
+    }
+  shared-hyperlink.attrs.target =
+    attribute target {
+      common.data.browsing-context-or-keyword
+    }
+  shared-hyperlink.attrs.rel =
+    attribute rel {
+      w:a-rel
+    }
+  shared-hyperlink.attrs.hreflang =
+    attribute hreflang {
+      common.data.langcode
+    }
+  shared-hyperlink.attrs.media =
+    attribute media {
+      common.data.mediaquery
+    }
+  shared-hyperlink.attrs.type =
+    attribute type {
+      common.data.mimetype
+    }
+  shared-hyperlink.attrs.ping =
+    attribute ping {
+      common.data.uris
+    } & v5only
+
+## Emphatic Stress: <em>
+
+	em.elem =
+		element em { em.inner & em.attrs }
+	em.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	em.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= em.elem
+
+## Strong Importance: <strong>
+
+	strong.elem =
+		element strong { strong.inner & strong.attrs }
+	strong.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	strong.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= strong.elem
+
+## Small Print and Side Comments: <small>
+
+	small.elem =
+		element small { small.inner & small.attrs }
+	small.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	small.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= small.elem
+
+## Marked (Highlighted) Text: <mark>
+
+	mark.elem =
+		element mark { mark.inner & mark.attrs }
+		& v5only
+	mark.attrs =
+		( common.attrs )
+	mark.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= mark.elem
+
+## Abbreviation: <abbr>
+
+	abbr.elem =
+		element abbr { abbr.inner & abbr.attrs }
+	abbr.attrs =
+		(	common.attrs
+		#	abbr.attrs.title included in common.attrs
+		&	common.attrs.aria?
+		)
+	abbr.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= abbr.elem
+
+## Defining Instance: <dfn>
+
+	dfn.elem =
+		element dfn { dfn.inner & dfn.attrs }
+	dfn.attrs =
+		(	common.attrs
+		#	dfn.attrs.title included in common.attrs
+		&	common.attrs.aria?
+		)
+	dfn.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= dfn.elem
+
+## Italic: <i>
+
+	i.elem =
+		element i { i.inner & i.attrs }
+	i.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	i.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= i.elem
+
+## Bold: <b>
+
+	b.elem =
+		element b { b.inner & b.attrs }
+	b.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	b.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= b.elem
+
+## Struck Text: <s>
+
+	s.elem =
+		element s { s.inner & s.attrs }
+	s.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	s.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= s.elem
+
+## Underline: <u>
+
+	u.elem =
+		element u { u.inner & u.attrs }
+	u.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	u.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= u.elem
+
+## Code Fragment: <code>
+
+	code.elem =
+		element code { code.inner & code.attrs }
+	code.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	code.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= code.elem
+
+## Variable or Placeholder: <var>
+
+	var.elem =
+		element var { var.inner & var.attrs }
+	var.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	var.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= var.elem
+
+## (Sample) Output: <samp>
+
+	samp.elem =
+		element samp { samp.inner & samp.attrs }
+	samp.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	samp.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= samp.elem
+
+## User Input: <kbd>
+
+	kbd.elem =
+		element kbd { kbd.inner & kbd.attrs }
+	kbd.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	kbd.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= kbd.elem
+
+## Superscript: <sup>
+
+	sup.elem =
+		element sup { sup.inner & sup.attrs }
+	sup.attrs =
+		( common.attrs )
+	sup.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= sup.elem
+
+## Subscript: <sub>
+
+	sub.elem =
+		element sub { sub.inner & sub.attrs }
+	sub.attrs =
+		( common.attrs )
+	sub.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= sub.elem
+
+## Quotation: <q>
+
+	q.elem =
+		element q { q.inner & q.attrs }
+	q.attrs =
+		(	common.attrs
+		&	q.attrs.cite?
+		&	common.attrs.aria?
+		)
+		q.attrs.cite =
+			attribute cite {
+				common.data.uri
+			}
+	q.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= q.elem
+
+## Title of Work: <cite>
+
+	cite.elem =
+		element cite { cite.inner & cite.attrs }
+	cite.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	cite.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= cite.elem
+
+## Generic Span: <span>
+
+	span.elem =
+		element span { span.inner & span.attrs }
+	span.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	span.inner =
+		( common.inner.phrasing ) # REVISIT allow ol and ul?
+
+	common.elem.phrasing |= span.elem
+
+## Bidirectional Override: <bdo>
+
+	bdo.elem =
+		element bdo { bdo.inner & bdo.attrs }
+	bdo.attrs =
+		( common.attrs ) # dir required in Schematron
+	bdo.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= bdo.elem
+
+## Bidirectional Isolate: <bdi>
+
+	bdi.elem =
+		element bdi { bdi.inner & bdi.attrs }
+	bdi.attrs =
+		( common.attrs )
+	bdi.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= bdi.elem
+
+## Line Break: <br>
+
+	br.elem =
+		element br { br.inner & br.attrs }
+	br.attrs =
+		( common.attrs )
+	br.inner =
+		( empty )
+
+	common.elem.phrasing |= br.elem
+
+## Line-break opportunity: <wbr>
+
+	wbr.elem =
+		element wbr { wbr.inner & wbr.attrs }
+	wbr.attrs =
+		( common.attrs )
+	wbr.inner =
+		( empty )
+
+	common.elem.phrasing |= wbr.elem
diff --git a/xml/relaxng/src/resources/html5-schema/revision.rnc b/xml/relaxng/src/resources/html5-schema/revision.rnc
new file mode 100644
index 0000000..b46fe2c
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/revision.rnc
@@ -0,0 +1,52 @@
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Revision Annotations                  #
+# #####################################################################
+
+## Common Attributes
+
+	edit.attrs.cite =
+		attribute cite {
+			common.data.uri
+		}
+	edit.attrs.datetime =
+		attribute datetime {
+			common.data.datetime | common.data.date
+		}
+
+## Inserts: <ins>
+
+	ins.elem.flow =
+		element ins { ins.inner.flow & ins.attrs }
+	ins.elem.phrasing =
+		element ins { ins.inner.phrasing & ins.attrs }
+	ins.attrs =
+		(	common.attrs
+		&	edit.attrs.cite?
+		&	edit.attrs.datetime?
+		)
+	ins.inner.flow =
+		( common.inner.flow )
+	ins.inner.phrasing =
+		( common.inner.phrasing )
+
+	common.elem.flow |= ins.elem.flow
+	common.elem.phrasing |= ins.elem.phrasing
+
+## Deletions: <del>
+
+	del.elem.flow =
+		element del { del.inner.flow & del.attrs }
+	del.elem.phrasing =
+		element del { del.inner.phrasing & del.attrs }
+	del.attrs =
+		(	common.attrs
+		&	edit.attrs.cite?
+		&	edit.attrs.datetime?
+		)
+	del.inner.flow =
+		( common.inner.flow )
+	del.inner.phrasing =
+		( common.inner.phrasing )
+
+	common.elem.flow |= del.elem.flow
+	common.elem.phrasing |= del.elem.phrasing
diff --git a/xml/relaxng/src/resources/html5-schema/ruby.rnc b/xml/relaxng/src/resources/html5-schema/ruby.rnc
new file mode 100644
index 0000000..cd95ff8
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/ruby.rnc
@@ -0,0 +1,51 @@
+datatypes w = "http://whattf.org/datatype-draft"
+namespace local = ""
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Ruby                                  #
+# #####################################################################
+
+#######################################################################
+
+## Ruby Annotation: <ruby>
+
+	ruby.elem =
+		element ruby { ruby.inner & ruby.attrs }
+	ruby.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	ruby.inner =
+		(  (  common.inner.phrasing
+		   ,  (  rt.elem
+		      |  (  rp.elem
+		         ,  rt.elem
+		         ,  rp.elem
+		         )
+		      )
+		   )+
+		)
+
+	common.elem.phrasing |= ruby.elem
+
+## Ruby Text: <rt>
+
+	rt.elem =
+		element rt { rt.inner & rt.attrs }
+	rt.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	rt.inner =
+		( common.inner.phrasing )
+	
+## Ruby Parenthesis: <rp>
+
+	rp.elem =
+		element rp { rp.inner & rp.attrs }
+	rp.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	rp.inner =
+		( common.inner.phrasing )
diff --git a/xml/relaxng/src/resources/html5-schema/sectional.rnc b/xml/relaxng/src/resources/html5-schema/sectional.rnc
new file mode 100644
index 0000000..f7931bc
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/sectional.rnc
@@ -0,0 +1,140 @@
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Sectioning Markup                     #
+# #####################################################################
+
+# #####################################################################
+## Headings
+
+## Heading (Rank 1): <h1>
+
+	h1.elem =
+		element h1 { h1.inner & h1.attrs }
+	h1.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	h1.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= h1.elem
+
+## Heading (Rank 2): <h2>
+
+	h2.elem =
+		element h2 { h2.inner & h2.attrs }
+	h2.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	h2.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= h2.elem
+
+## Heading (Rank 3): <h3>
+
+	h3.elem =
+		element h3 { h3.inner & h3.attrs }
+	h3.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	h3.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= h3.elem
+
+## Heading (Rank 4): <h4>
+
+	h4.elem =
+		element h4 { h4.inner & h4.attrs }
+	h4.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	h4.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= h4.elem
+
+## Heading (Rank 5): <h5>
+
+	h5.elem =
+		element h5 { h5.inner & h5.attrs }
+	h5.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	h5.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= h5.elem
+
+## Heading (Rank 6): <h6>
+
+	h6.elem =
+		element h6 { h6.inner & h6.attrs }
+	h6.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	h6.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= h6.elem
+
+## Heading Group: <hgroup>
+
+	hgroup.elem =
+		element hgroup { hgroup.inner & hgroup.attrs }
+	hgroup.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	hgroup.inner =
+		(	h1.elem
+		|	h2.elem
+		|	h3.elem
+		|	h4.elem
+		|	h5.elem
+		|	h6.elem
+		)+
+
+	common.elem.flow |= hgroup.elem
+
+# #####################################################################
+## Section Meta
+
+## Contact Info: <address>
+
+	address.elem =
+		element address { address.inner & address.attrs }
+	address.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.region?
+		)
+	address.inner = 
+		( common.inner.flow )
+
+	common.elem.flow |= address.elem
+
+# #####################################################################
+## Quotations	
+
+## Block Quotes: <blockquote>
+
+	blockquote.elem =
+		element blockquote { blockquote.inner & blockquote.attrs }
+	blockquote.attrs =
+		(	common.attrs
+		&	blockquote.attrs.cite?
+		&	common.attrs.aria?
+		)
+		blockquote.attrs.cite =
+			attribute cite {
+				common.data.uri
+			}
+	blockquote.inner =
+		( common.inner.flow )
+
+	common.elem.flow |= blockquote.elem
diff --git a/xml/relaxng/src/resources/html5-schema/structural.rnc b/xml/relaxng/src/resources/html5-schema/structural.rnc
new file mode 100644
index 0000000..f79fcad
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/structural.rnc
@@ -0,0 +1,105 @@
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Block Markup Added in HTML5           #
+# #####################################################################
+
+## Section: <section>
+
+	section.elem =
+		element section { section.inner & section.attrs }
+	section.attrs =
+		(	common.attrs
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.region
+			)?
+		)
+	section.inner =
+		(	style.elem.scoped*
+		,	common.inner.flow 
+		)
+
+	common.elem.flow |= section.elem
+
+## Navigational Links: <nav>
+
+	nav.elem =
+		element nav { nav.inner & nav.attrs }
+	nav.attrs =
+		(	common.attrs
+		&	( common.attrs.aria.implicit.region
+		  | common.attrs.aria.landmark.navigation
+		  )?
+		)
+	nav.inner =
+		( common.inner.flow )
+
+	common.elem.flow |= nav.elem
+
+## Article: <article>
+
+	article.elem =
+		element article { article.inner & article.attrs }
+	article.attrs =
+		(	common.attrs
+		&	( common.attrs.aria.implicit.region
+		  | common.attrs.aria.landmark.article
+		  | common.attrs.aria.landmark.main
+		  | common.attrs.aria.landmark.document
+		  | common.attrs.aria.landmark.application
+		  )?
+		)
+	article.inner =
+		(	style.elem*
+		,	common.inner.flow 
+		)
+		
+	common.elem.flow |= article.elem
+
+## Tangential Aside: <aside>
+
+	aside.elem =
+		element aside { aside.inner & aside.attrs }
+	aside.attrs =
+		(	common.attrs
+		&	( common.attrs.aria.implicit.region
+		  | common.attrs.aria.landmark.complementary
+		  | common.attrs.aria.landmark.search
+		  | common.attrs.aria.landmark.note
+		  )?
+		)
+	aside.inner =
+		(	style.elem*
+		,	common.inner.flow 
+		)
+
+	common.elem.flow |= aside.elem
+
+## Header: <header>
+
+	header.elem =
+		element header { header.inner & header.attrs }
+	header.attrs =
+		(	common.attrs
+		&	( common.attrs.aria.implicit.region
+		  | common.attrs.aria.landmark.banner
+		  )?
+		)
+	header.inner =
+		( common.inner.flow )
+
+	common.elem.flow |= header.elem
+
+## Footer: <footer>
+
+	footer.elem =
+		element footer { footer.inner & footer.attrs }
+	footer.attrs =
+		(	common.attrs
+		&	( common.attrs.aria.implicit.region
+		  | common.attrs.aria.landmark.contentinfo
+		  )?
+		)
+	footer.inner =
+		( common.inner.flow )
+
+	common.elem.flow |= footer.elem
+
diff --git a/xml/relaxng/src/resources/html5-schema/tables.rnc b/xml/relaxng/src/resources/html5-schema/tables.rnc
new file mode 100644
index 0000000..e29b1cb
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/tables.rnc
@@ -0,0 +1,224 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Tables                                #
+# #####################################################################
+
+# #####################################################################
+## Table Envelope
+
+## Table Datatypes
+
+#	tables.data.multilen =
+#		(	common.data.integer.positive
+#		|	common.data.percent
+#		|	xsd:token { pattern = "[0-9]+\*" } #REVISIT should this one be string? 
+#		)
+
+## Table Alignment Attributes
+
+	tables.attrs.alignment =
+		(	tables.attrs.align?
+		&	tables.attrs.char?
+		&	tables.attrs.valign?
+		)
+		tables.attrs.align =
+			attribute align {
+				(	w:string "left" 
+				|	w:string "center"
+				|	w:string "right"
+				|	w:string "justify"
+				|	w:string "char"
+				)
+			}
+		tables.attrs.char =
+			attribute char {
+				xsd:string { pattern = "." }
+			}
+		tables.attrs.valign =
+			attribute valign {
+				(	w:string "top"
+				|	w:string "middle"
+				|	w:string "bottom"
+				|	w:string "baseline"
+				)
+			}
+
+## Data Table: <table>
+
+	table.elem =
+		element table { table.inner & table.attrs }
+	table.attrs =
+		(	common.attrs
+		&	table.attrs.border?
+		&	common.attrs.aria?
+		)
+		table.attrs.border  =
+			attribute border {
+				string
+			}
+	table.inner =
+		(	caption.elem?
+		,	colgroup.elem*
+		,	thead.elem?
+		,	(	(	tfoot.elem
+				,	( tbody.elem* | tr.elem+ )
+				)
+			|	(	( tbody.elem* | tr.elem+ )
+				,	tfoot.elem?
+				)
+			)
+		) 
+
+	common.elem.flow |= table.elem
+
+## Table Caption: <caption>
+
+	caption.elem =
+		element caption { caption.inner & caption.attrs }
+	caption.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.region?
+		)
+	caption.inner =
+		( common.inner.flow )
+
+# #####################################################################
+## Table Super Structure
+
+## Table Column Group: <colgroup>
+
+	colgroup.elem =
+		element colgroup { colgroup.inner & colgroup.attrs }
+	colgroup.attrs =
+		( common.attrs )
+		colgroup.attrs.span =
+			attribute span {
+				common.data.integer.positive
+			}
+	colgroup.inner =
+		(	col.elem*
+		|	colgroup.attrs.span?
+		)
+
+## Table Column: <col>
+
+	col.elem =
+		element col { col.inner & col.attrs }
+	col.attrs =
+		(	common.attrs
+		&	col.attrs.span?
+		)
+		col.attrs.span =
+			attribute span {
+				common.data.integer.positive
+			}
+	col.inner =
+		( empty )
+
+## Table Header Row Group
+
+	thead.elem =
+		element thead { thead.inner & thead.attrs }
+	thead.attrs =
+		( common.attrs )
+	thead.inner =
+		( tr.elem* )
+
+## Table Footer Row Group
+
+	tfoot.elem =
+		element tfoot { tfoot.inner & tfoot.attrs }
+	tfoot.attrs =
+		( common.attrs )
+	tfoot.inner =
+		( tr.elem* )
+
+## Table Row Group
+
+	tbody.elem =
+		element tbody { tbody.inner & tbody.attrs }
+	tbody.attrs =
+		( common.attrs )
+	tbody.inner =
+		( tr.elem* )
+
+# #####################################################################
+## Cell Structure
+
+## Table Row
+
+	tr.elem =
+		element tr { tr.inner & tr.attrs }
+	tr.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	tr.inner =
+		( ( td.elem | th.elem )* )
+
+## Common Table Cell Attributes
+
+	tables.attrs.cell-structure =
+		(	tables.attrs.colspan?
+		&	tables.attrs.rowspan?
+		)
+		tables.attrs.colspan =
+			attribute colspan {
+				common.data.integer.positive
+			}
+		tables.attrs.rowspan =
+			attribute rowspan {
+				common.data.integer.non-negative
+			}
+
+	tables.attrs.access-headers =
+		( tables.attrs.headers? )
+		tables.attrs.headers =
+			attribute headers {
+				common.data.idrefs
+			}
+
+	tables.attrs.define-headers =
+		( tables.attrs.scope? )
+		tables.attrs.scope =
+			attribute scope {
+				(	w:string "row"
+				|	w:string "col"
+				|	w:string "rowgroup"
+				|	w:string "colgroup"
+				)
+			}
+		tables.attrs.abbr =
+			attribute abbr {
+				text
+			}
+
+## Table Data Cell: <td>
+
+	td.elem =
+		element td { td.inner & td.attrs }
+	td.attrs =
+		(	common.attrs
+		&	tables.attrs.cell-structure
+		&	tables.attrs.headers?
+#		&	tables.attrs.alignment
+		&	common.attrs.aria?
+		)
+	td.inner =
+		( common.inner.flow )
+
+## Table Header Cells: <th>
+
+	th.elem =
+		element th { th.inner & th.attrs }
+	th.attrs =
+		(	common.attrs
+		&	tables.attrs.cell-structure
+		&	tables.attrs.scope?
+		&	tables.attrs.headers?
+#		&	tables.attrs.alignment
+		&	common.attrs.aria.implicit.th?
+		)
+	th.inner =
+		( common.inner.phrasing )
diff --git a/xml/relaxng/src/resources/html5-schema/test.rnc b/xml/relaxng/src/resources/html5-schema/test.rnc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/test.rnc
diff --git a/xml/relaxng/src/resources/html5-schema/web-forms-scripting.rnc b/xml/relaxng/src/resources/html5-schema/web-forms-scripting.rnc
new file mode 100644
index 0000000..63fe1c4
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/web-forms-scripting.rnc
@@ -0,0 +1,27 @@
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Web Forms 1.0 Scripting               #
+# #####################################################################
+
+	scripting.attr.form.select =
+		attribute onselect { string }
+	scripting.attr.form.change =
+		attribute onchange { string }
+
+#	input.text.attrs &=
+#		(	scripting.attr.form.select?
+#		)
+
+#	shared-form.attrs &=
+#		(	scripting.attr.form.change?
+#		)
+
+#	form.attrs &=
+#		(	scripting.attr.form.reset?
+#		&	scripting.attr.form.submit?
+#		)
+		scripting.attr.form.submit =
+			attribute onsubmit { string }
+		scripting.attr.form.reset =
+			attribute onreset { string } 
+		
+		
diff --git a/xml/relaxng/src/resources/html5-schema/web-forms.rnc b/xml/relaxng/src/resources/html5-schema/web-forms.rnc
new file mode 100644
index 0000000..d5d8f6e
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/web-forms.rnc
@@ -0,0 +1,536 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Web Forms 1.0 markup                  #
+# #####################################################################
+
+## Shared attributes for form controls
+
+	common-form.attrs =
+		(	common-form.attrs.name?
+		&	common-form.attrs.disabled?
+		)
+		
+	common-form.attrs.name = 
+		attribute name {
+			string #REVISIT should this be restricted somehow? No & and = perhaps?
+		}
+
+	common-form.attrs.disabled = 
+		attribute disabled {
+			w:string "disabled" | w:string ""
+		}
+
+	shared-form.attrs.readonly = 
+		attribute readonly {
+			w:string "readonly" | w:string ""
+		}
+
+	shared-form.attrs.maxlength = 
+		attribute maxlength {
+			common.data.integer.non-negative
+		}
+
+	shared-form.attrs.size = 
+		attribute size {
+			common.data.integer.positive
+		}
+	
+	# REVISIT tabindex goes in common.attrs
+
+## Shared attributes for <input>
+	
+	input.attrs.checked = 
+		attribute checked {
+			w:string "checked" | w:string ""
+		}
+
+## Text Field: <input type='text'>
+
+	input.text.elem = 
+		element input { input.text.attrs }
+	input.text.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.text.attrs.type?
+		&	shared-form.attrs.maxlength? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.size?
+		&	input.text.attrs.value? 
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.input
+			)?
+		)		
+		input.text.attrs.type = 
+			attribute type {
+				w:string "text"
+			}
+		input.text.attrs.value =
+			attribute value {
+				form.data.stringwithoutlinebreaks
+			}
+		
+	input.elem = input.text.elem
+
+## Password Field: <input type='password'>
+
+	input.password.elem = 
+		element input { input.password.attrs }
+	input.password.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.password.attrs.type
+		&	shared-form.attrs.maxlength? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.size?
+		&	input.password.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)
+		input.password.attrs.type = 
+			attribute type {
+				w:string "password"
+			}
+		input.password.attrs.value =
+			attribute value {
+				form.data.stringwithoutlinebreaks
+			}
+		
+	input.elem |= input.password.elem
+		
+## Checkbox: <input type='checkbox'>
+
+	input.checkbox.elem = 
+		element input { input.checkbox.attrs }
+	input.checkbox.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.checkbox.attrs.type
+		&	input.attrs.checked? 
+		&	input.checkbox.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)
+		input.checkbox.attrs.type = 
+			attribute type {
+				w:string "checkbox"
+			}
+		input.checkbox.attrs.value =
+			attribute value {
+				string #REVISIT require non-empty value?
+			}
+		
+	input.elem |= input.checkbox.elem
+	
+## Radiobutton: <input type='radio'>
+
+	input.radio.elem = 
+		element input { input.radio.attrs }
+	input.radio.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.radio.attrs.type
+		&	input.attrs.checked? 
+		&	input.radio.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)
+		input.radio.attrs.type = 
+			attribute type {
+				w:string "radio"
+			}
+		input.radio.attrs.value =
+			attribute value {
+				string #REVISIT require non-empty value?
+			}
+		
+	input.elem |= input.radio.elem
+	
+## Scripting Hook Button: <input type='button'>
+
+	input.button.elem = 
+		element input { input.button.attrs }
+	input.button.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.button.attrs.type
+		&	input.button.attrs.value? 
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.button
+			)?
+		)
+		input.button.attrs.type = 
+			attribute type {
+				w:string "button"
+			}
+		input.button.attrs.value =
+			attribute value {
+				string #REVISIT require non-empty value?
+			}
+		
+	input.elem |= input.button.elem
+	#REVISIT should this be enabled by a scripting module only?
+	
+## Submit Button: <input type='submit'>
+
+	input.submit.elem = 
+		element input { input.submit.attrs }
+	input.submit.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.submit.attrs.type
+		&	input.submit.attrs.value? 
+		&	common.attrs.aria.implicit.button?
+		)
+		input.submit.attrs.type = 
+			attribute type {
+				w:string "submit"
+			}
+		input.submit.attrs.value =
+			attribute value {
+				string #REVISIT require non-empty value?
+			}
+		
+	input.elem |= input.submit.elem
+		
+## Reset Button: <input type='reset'>
+
+	input.reset.elem = 
+		element input { input.reset.attrs }
+	input.reset.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.reset.attrs.type
+		&	input.reset.attrs.value? 
+		&	common.attrs.aria.implicit.button?
+		)
+		input.reset.attrs.type = 
+			attribute type {
+				w:string "reset"
+			}
+		input.reset.attrs.value =
+			attribute value {
+				string #REVISIT require non-empty value?
+			}
+		
+	input.elem |= input.reset.elem
+	# REVISIT does reset make sense outside a form?
+		
+## File Upload: <input type='file'>
+
+	input.file.elem = 
+		element input { input.file.attrs }
+	input.file.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.file.attrs.type
+		&	input.file.attrs.accept?
+		&	common.attrs.aria.implicit.input?
+		)
+		input.file.attrs.type = 
+			attribute type {
+				w:string "file"
+			}
+		input.file.attrs.accept = 
+			attribute accept {
+				form.data.mimetypelist
+			}
+
+	input.elem |= input.file.elem
+	
+## Hidden String: <input type='hidden'>
+
+	input.hidden.elem = 
+		element input { input.hidden.attrs }
+	input.hidden.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.hidden.attrs.type
+		&	input.hidden.attrs.value? 
+		)
+		input.hidden.attrs.type = 
+			attribute type {
+				w:string "hidden"
+			}
+		input.hidden.attrs.value =
+			attribute value {
+				string
+			}
+		
+	input.elem |= input.hidden.elem
+		
+## Image Submit Button: <input type='image'>
+
+	input.image.elem = 
+		element input { input.image.attrs }
+	input.image.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.image.attrs.type
+		&	input.image.attrs.alt 
+		&	input.image.attrs.src? 
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.button
+			)?
+		)	
+		input.image.attrs.type = 
+			attribute type {
+				w:string "image"
+			}
+		input.image.attrs.alt = 
+			attribute alt {
+				form.data.nonemptystring
+			}
+		input.image.attrs.src = 
+			attribute src {
+				common.data.uri.non-empty
+			}
+	
+	input.elem |= input.image.elem
+	
+	common.elem.phrasing |= input.elem
+
+## Text Area: <textarea>
+
+	textarea.elem =
+		element textarea { textarea.inner & textarea.attrs }
+	textarea.attrs =
+		(	common.attrs
+		&	common-form.attrs
+		&	shared-form.attrs.readonly?
+		&	textarea.attrs.rows-and-cols-wf1
+		&	common.attrs.aria.implicit.input?
+		#FIXME onfocus, onblur, onselect,onchange
+		)
+		# This is ugly. 
+		textarea.attrs.rows-and-cols-wf1 = 
+			textarea.attrs.rows-and-cols-wf1.inner	
+		textarea.attrs.rows-and-cols-wf1.inner =
+			(	textarea.attrs.cols
+			&	textarea.attrs.rows
+			)
+		textarea.attrs.cols = 
+			attribute cols {
+				common.data.integer.positive
+			}
+		textarea.attrs.rows = 
+			attribute rows {
+				common.data.integer.positive
+			}
+	textarea.inner =
+		( text )
+
+	common.elem.phrasing |= textarea.elem
+
+# Due to limitations with interleave, handling single/multiple selection
+# enforcement in RELAX NG seems to be possible but really awkward.
+# Tried it. Leaving it to Schematron.
+
+## Select menu option: <option selected>
+
+	option.elem =
+		element option { option.inner & option.attrs }
+	option.attrs =
+		(	common.attrs
+		&	common-form.attrs.disabled?
+		&	option.attrs.selected?
+		&	option.attrs.label?
+		&	option.attrs.value?
+		&	common.attrs.aria.implicit.input?
+		)
+		option.attrs.selected =
+			attribute selected {
+				w:string "selected" | w:string ""
+			}
+		option.attrs.label =
+			attribute label {
+				string
+			}		
+		option.attrs.value =
+			attribute value {
+				string
+			}		
+	option.inner =
+		( text )
+
+## Option Group: <optgroup>
+
+	optgroup.elem =
+		element optgroup { optgroup.inner & optgroup.attrs }
+	optgroup.attrs = 
+		(	common.attrs
+		&	optgroup.attrs.label
+		&	common-form.attrs.disabled?
+		)
+		optgroup.attrs.label =
+			attribute label {
+				string
+			}
+	optgroup.inner =
+		( option.elem* )
+
+## Selection Menu: <select>
+
+	select.elem =
+		element select { select.inner & select.attrs }	
+	select.attrs =
+		(	common.attrs
+		&	common-form.attrs
+		&	select.attrs.size?
+		&	select.attrs.multiple?
+		# FIXME onfocus, onblur, onchange
+		)
+		select.attrs.size =
+			attribute size {
+				common.data.integer.positive
+			}
+		select.attrs.multiple =
+			attribute multiple {
+				w:string "multiple" | w:string ""
+			}
+	select.inner =
+		(	optgroup.elem*
+		&	option.elem*
+		)
+
+	common.elem.phrasing |= select.elem
+	
+## Shared Definitions for Complex Button
+	
+	button.attrs.value =
+		attribute value {
+			string
+		}
+	button.inner = 
+		( common.inner.phrasing )
+	
+## Complex Submit Button: <button type='submit'>
+
+	button.submit.elem =
+		element button { button.inner & button.submit.attrs }	
+	button.submit.attrs =
+		(	common.attrs
+		&	common-form.attrs
+		&	button.submit.attrs.type?
+		&	button.attrs.value?
+		&	common.attrs.aria.implicit.button?
+		)
+		button.submit.attrs.type =
+			attribute type {
+				w:string "submit"
+			}
+
+	button.elem = button.submit.elem
+	
+## Complex Reset Button: <button type='reset'>
+
+	button.reset.elem =
+		element button { button.inner & button.reset.attrs }	
+	button.reset.attrs =
+		(	common.attrs
+		&	common-form.attrs
+		&	button.reset.attrs.type
+		&	button.attrs.value? #REVISIT I guess this still affects the DOM
+		&	common.attrs.aria.implicit.button?
+		)
+		button.reset.attrs.type =
+			attribute type {
+				w:string "reset"
+			}
+
+	button.elem |= button.reset.elem
+	
+## Complex Push Button: <button type='button'>
+
+	button.button.elem =
+		element button { button.inner & button.button.attrs }	
+	button.button.attrs =
+		(	common.attrs
+		&	common-form.attrs
+		&	button.button.attrs.type
+		&	button.attrs.value? #REVISIT I guess this still affects the DOM
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.button
+			)?
+		)
+		button.button.attrs.type =
+			attribute type {
+				w:string "button"
+			}
+
+	button.elem |= button.button.elem
+
+	common.elem.phrasing |= button.elem
+
+## Form: <form>
+
+	form.elem =
+		element form { form.inner & form.attrs }
+	form.attrs =
+		(	common.attrs
+		&	form.attrs.action? #REVISIT Should this be required anyway?
+		&	form.attrs.method?
+		&	form.attrs.enctype?
+		&	common-form.attrs.name?
+		&	form.attrs.accept-charset?
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.region
+			)?
+		)
+		form.attrs.action =
+			attribute action {
+				common.data.uri.non-empty
+			}
+		form.attrs.method =
+			attribute method {
+				form.attrs.method.data
+			}
+			form.attrs.method.data = 
+				( w:string "get" | w:string "post" )
+		form.attrs.enctype =
+			attribute enctype {
+				form.attrs.enctype.data
+			}
+			form.attrs.enctype.data = 
+				(	w:string "application/x-www-form-urlencoded" 
+				|	w:string "multipart/form-data"
+				)
+		form.attrs.accept-charset =
+			attribute accept-charset {
+				form.data.charsetlist
+			}	
+	form.inner =
+		( common.inner.flow )
+
+	common.elem.flow |= form.elem
+
+## Fieldset: <fieldset>
+
+	fieldset.elem =
+		element fieldset { fieldset.inner & fieldset.attrs }
+	fieldset.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.group?
+		)	
+	fieldset.inner =
+		(	legend.elem? #REVISIT should this be required?
+		,	common.inner.flow
+		)
+
+	common.elem.flow |= fieldset.elem
+	
+## Label: <label>
+
+	label.elem =
+		element label { label.inner & label.attrs }
+	label.attrs =
+		(	common.attrs
+		&	label.attrs.for?
+		&	common.attrs.aria.implicit.region?
+		)
+		label.attrs.for =
+			attribute for {
+				common.data.idref
+			}
+	label.inner =
+		( common.inner.phrasing ) #REVISIT making obvious guess
+
+	common.elem.phrasing |= label.elem
+
diff --git a/xml/relaxng/src/resources/html5-schema/web-forms2-scripting.rnc b/xml/relaxng/src/resources/html5-schema/web-forms2-scripting.rnc
new file mode 100644
index 0000000..e0f6a38
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/web-forms2-scripting.rnc
@@ -0,0 +1,9 @@
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Web Forms 2.0 Scripting               #
+# #####################################################################
+
+#	output.attrs &=
+#		(	scripting.attr.form.formchange?
+#		&	scripting.attr.form.forminput?
+#		&	scripting.attr.form.change?
+#		)
diff --git a/xml/relaxng/src/resources/html5-schema/web-forms2.rnc b/xml/relaxng/src/resources/html5-schema/web-forms2.rnc
new file mode 100644
index 0000000..98d9f4c
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/web-forms2.rnc
@@ -0,0 +1,800 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Web Forms 2.0 markup                  #
+# #####################################################################
+
+## Shared attributes for form controls
+
+	common-form.attrs &=
+		( common-form.attrs.form? )
+
+	common-form.attrs.form |= 
+		attribute form {
+			common.data.idref
+		}
+
+	shared-form.attrs.formaction =
+		attribute formaction {
+			common.data.uri.non-empty
+		}
+
+	shared-form.attrs.formenctype =
+		attribute formenctype {
+			shared-form.attrs.formenctype.data
+		}
+		shared-form.attrs.formenctype.data = 
+			(	w:string "application/x-www-form-urlencoded" 
+			|	w:string "multipart/form-data"
+			|	w:string "text/plain"
+			)
+
+	shared-form.attrs.formmethod =
+		attribute formmethod {
+			shared-form.attrs.formmethod.data
+		}
+		shared-form.attrs.formmethod.data = 
+			( w:string "get"
+			| w:string "post"
+			)
+
+	shared-form.attrs.formtarget = 
+		attribute formtarget {
+			common.data.browsing-context-or-keyword
+		}
+
+	shared-form.attrs.formnovalidate = 
+		attribute formnovalidate {
+			w:string "formnovalidate" | w:string ""
+		}
+
+	shared-form.attrs.autofocus = 
+		attribute autofocus {
+			w:string "autofocus" | w:string ""
+		}
+	
+	shared-form.attrs.pattern = 
+		attribute pattern {
+			form.data.pattern
+		}
+
+	shared-form.attrs.template = 
+		attribute template {
+			common.data.idref
+		}
+
+	shared-form.attrs.required = 
+		attribute required {
+			w:string "required" | w:string ""
+		}
+
+	shared-form.attrs.placeholder = 
+		attribute placeholder {
+			form.data.stringwithoutlinebreaks
+		}
+
+	shared-form.attrs.dirname = 
+		attribute dirname {
+			form.data.nonemptystring
+		}
+
+## Shared attributes for <input>
+		
+	input.attrs.autocomplete = 
+		attribute autocomplete {
+			w:string "on" | w:string "off"
+		}
+	
+	input.attrs.list = 
+		attribute list {
+			common.data.idref
+		}
+	
+	input.attrs.step.float = 
+		attribute step {
+			w:string "any" | common.data.float.positive
+		}
+	
+	input.attrs.step.integer = 
+		attribute step {
+			w:string "any" | common.data.integer.positive 
+		}
+	
+	input.attrs.multiple = 
+		attribute multiple {
+			w:string "multiple" | w:string ""
+		}
+		
+## Text Field: <input type='text'>, Extensions
+
+	input.text.attrs &=
+		(	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	shared-form.attrs.pattern? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.placeholder?
+		&	shared-form.attrs.dirname?
+		)
+
+## Password Field: <input type='password'>, Extensions
+
+	input.password.attrs &=
+		(	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.pattern? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.placeholder?
+		)
+
+## Checkbox <input type='checkbox'>, Extensions
+
+	input.checkbox.attrs &=
+		(	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.required? 
+		)
+
+## Radiobutton: <input type='radio'>, Extensions
+
+	input.radio.attrs &=
+		(	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.required? 
+		)
+
+## Scripting Hook Button: <input type='button'>, Extensions
+
+	input.button.attrs &=
+		( shared-form.attrs.autofocus? )
+
+## Submit Button: <input type='submit'>, Extensions
+
+	input.submit.attrs &=
+		(	shared-form.attrs.formaction? 
+		&	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.formenctype? 
+		&	shared-form.attrs.formmethod? 
+		&	shared-form.attrs.formtarget? 
+		&	shared-form.attrs.formnovalidate? 
+		)
+
+## Reset Button: <input type='reset'>, Extensions
+
+	input.reset.attrs &=
+		( shared-form.attrs.autofocus? )
+
+## File Upload: <input type='file'>, Extensions
+
+	input.file.attrs &=
+		(	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.required? 
+		&	input.attrs.multiple? 
+		)
+
+## Image Submit Button: <input type='image'>, Extensions
+
+	input.image.attrs &=
+		(	shared-form.attrs.formaction? 
+		&	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.formenctype? 
+		&	shared-form.attrs.formmethod? 
+		&	shared-form.attrs.formtarget? 
+		&	shared-form.attrs.formnovalidate? 
+		&	input.image.attrs.height?
+		&	input.image.attrs.width?
+		)	
+		input.image.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		input.image.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+
+## Global Date and Time: <input type='datetime'>
+
+	input.datetime.elem = 
+		element input { input.datetime.attrs }	
+	input.datetime.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.datetime.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.datetime.attrs.min? 
+		&	input.datetime.attrs.max? 
+		&	input.attrs.step.float? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.datetime.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.datetime.attrs.type = 
+			attribute type {
+				w:string "datetime"
+			}
+		input.datetime.attrs.min =
+			attribute min {
+				common.data.datetime
+			}
+		input.datetime.attrs.max =
+			attribute max {
+				common.data.datetime
+			}	
+		input.datetime.attrs.value =
+			attribute value {
+				common.data.datetime
+			}
+		
+	input.elem |= input.datetime.elem
+
+## Date and Time with No Time Zone Information: <input type='datetime-local'>
+
+	input.datetime-local.elem = 
+		element input { input.datetime-local.attrs }
+	input.datetime-local.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.datetime-local.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.datetime-local.attrs.min? 
+		&	input.datetime-local.attrs.max? 
+		&	input.attrs.step.float? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.datetime-local.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.datetime-local.attrs.type = 
+			attribute type {
+				w:string "datetime-local"
+			}
+		input.datetime-local.attrs.min =
+			attribute min {
+				form.data.datetime-local
+			}
+		input.datetime-local.attrs.max =
+			attribute max {
+				form.data.datetime-local			
+			}	
+		input.datetime-local.attrs.value =
+			attribute value {
+				form.data.datetime-local
+			}
+		
+	input.elem |= input.datetime-local.elem
+
+## Date: <input type='date'>
+
+	input.date.elem = 
+		element input { input.date.attrs }
+	input.date.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.date.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.date.attrs.min? 
+		&	input.date.attrs.max? 
+		&	input.attrs.step.integer? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.date.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.date.attrs.type = 
+			attribute type {
+				w:string "date"
+			}
+		input.date.attrs.min =
+			attribute min {
+				form.data.date
+			}
+		input.date.attrs.max =
+			attribute max {
+				form.data.date			
+			}	
+		input.date.attrs.value =
+			attribute value {
+				form.data.date
+			}
+		
+	input.elem |= input.date.elem
+
+## Year and Month: <input type='month'>
+
+	input.month.elem = 
+		element input { input.month.attrs }
+	input.month.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.month.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.month.attrs.min? 
+		&	input.month.attrs.max? 
+		&	input.attrs.step.integer? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.month.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.month.attrs.type = 
+			attribute type {
+				w:string "month"
+			}
+		input.month.attrs.min =
+			attribute min {
+				form.data.month
+			}
+		input.month.attrs.max =
+			attribute max {
+				form.data.month			
+			}	
+		input.month.attrs.value =
+			attribute value {
+				form.data.month
+			}
+		
+	input.elem |= input.month.elem
+
+## Time without Time Zone Information: <input type='time'>
+
+	input.time.elem = 
+		element input { input.time.attrs }
+	input.time.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.time.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.time.attrs.min? 
+		&	input.time.attrs.max? 
+		&	input.attrs.step.float? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.time.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.time.attrs.type = 
+			attribute type {
+				w:string "time"
+			}
+		input.time.attrs.min =
+			attribute min {
+				form.data.time
+			}
+		input.time.attrs.max =
+			attribute max {
+				form.data.time			
+			}	
+		input.time.attrs.value =
+			attribute value {
+				form.data.time
+			}
+		
+	input.elem |= input.time.elem
+
+## Year and Week: <input type='week'>
+
+	input.week.elem = 
+		element input { input.week.attrs }
+	input.week.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.week.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.week.attrs.min? 
+		&	input.week.attrs.max? 
+		&	input.attrs.step.integer? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.week.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.week.attrs.type = 
+			attribute type {
+				w:string "week"
+			}
+		input.week.attrs.min =
+			attribute min {
+				form.data.week
+			}
+		input.week.attrs.max =
+			attribute max {
+				form.data.week			
+			}	
+		input.week.attrs.value =
+			attribute value {
+				form.data.week
+			}
+		
+	input.elem |= input.week.elem
+
+## Number: <input type='number'>
+
+	input.number.elem = 
+		element input { input.number.attrs }
+	input.number.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.number.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.number.attrs.min? 
+		&	input.number.attrs.max? 
+		&	input.attrs.step.float? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.number.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.number.attrs.type = 
+			attribute type {
+				w:string "number"
+			}
+		input.number.attrs.min =
+			attribute min {
+				common.data.float
+			}
+		input.number.attrs.max =
+			attribute max {
+				common.data.float			
+			}	
+		input.number.attrs.value =
+			attribute value {
+				common.data.float
+			}
+		
+	input.elem |= input.number.elem
+
+## Imprecise Number: <input type='range'>
+
+	input.range.elem = 
+		element input { input.range.attrs }
+	input.range.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.range.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.range.attrs.min? 
+		&	input.range.attrs.max? 
+		&	input.attrs.step.float? 
+		&	input.range.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.range.attrs.type = 
+			attribute type {
+				w:string "range"
+			}
+		input.range.attrs.min =
+			attribute min {
+				common.data.float
+			}
+		input.range.attrs.max =
+			attribute max {
+				common.data.float			
+			}	
+		input.range.attrs.value =
+			attribute value {
+				common.data.float
+			}
+		
+	input.elem |= input.range.elem
+
+## Email Address: <input type='email'>
+
+	input.email.elem = 
+		element input { input.email.attrs }	
+	input.email.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.email.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	shared-form.attrs.maxlength? 
+		&	shared-form.attrs.pattern? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.size?
+		&	shared-form.attrs.placeholder?
+		&	(	(	input.attrs.multiple
+				&	input.email.attrs.value.multiple?
+				)
+			|	input.email.attrs.value.single?
+			)?
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.email.attrs.type = 
+			attribute type {
+				w:string "email"
+			}
+		input.email.attrs.value.single =
+			attribute value {
+				form.data.emailaddress
+			}
+		input.email.attrs.value.multiple =
+			attribute value {
+				form.data.emailaddresslist
+			}
+		
+	input.elem |= input.email.elem
+
+## IRI: <input type='url'>
+
+	input.url.elem = 
+		element input { input.url.attrs }	
+	input.url.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.url.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	shared-form.attrs.maxlength? 
+		&	shared-form.attrs.pattern? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.size?
+		&	shared-form.attrs.placeholder?
+		&	input.url.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.url.attrs.type = 
+			attribute type {
+				w:string "url"
+			}
+		input.url.attrs.value =
+			attribute value {
+				w:string "" | common.data.uri.absolute
+			}
+		
+	input.elem |= input.url.elem
+
+## Search: <input type='search'>
+
+	input.search.elem = 
+		element input { input.search.attrs }	
+	input.search.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.search.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	shared-form.attrs.maxlength? 
+		&	shared-form.attrs.pattern? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.size?
+		&	shared-form.attrs.placeholder?
+		&	shared-form.attrs.dirname?
+		&	input.search.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.search.attrs.type = 
+			attribute type {
+				w:string "search"
+			}
+		input.search.attrs.value =
+			attribute value {
+				form.data.stringwithoutlinebreaks
+			}
+		
+	input.elem |= input.search.elem
+
+## Telephone Number: <input type='tel'>
+
+	input.tel.elem = 
+		element input { input.tel.attrs }	
+	input.tel.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.tel.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	shared-form.attrs.maxlength? 
+		&	shared-form.attrs.pattern? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.size?
+		&	shared-form.attrs.placeholder?
+		&	input.tel.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.tel.attrs.type = 
+			attribute type {
+				w:string "tel"
+			}
+		input.tel.attrs.value =
+			attribute value {
+				form.data.stringwithoutlinebreaks
+			}
+		
+	input.elem |= input.tel.elem
+
+## Color: <input type='color'>
+
+	input.color.elem = 
+		element input { input.color.attrs }	
+	input.color.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.color.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.color.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.color.attrs.type = 
+			attribute type {
+				w:string "color"
+			}
+		input.color.attrs.value =
+			attribute value {
+				form.data.color
+			}
+		
+	input.elem |= input.color.elem
+
+## Form Output: <output>
+
+	output.elem =
+		element output { output.inner & output.attrs }
+	output.attrs =
+		(	common.attrs
+		&	common-form.attrs.name?
+		&	common-form.attrs.form?
+		&	output.attrs.for?
+		&	common.attrs.aria.implicit.region?
+		)
+		output.attrs.for = 
+			attribute for {
+				common.data.idrefs #REVISIT spec says space--not whitespace
+			}
+	output.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= output.elem
+
+## Text Area: <textarea>, extensions
+
+	textarea.attrs.rows-and-cols-wf1.inner &=
+		notAllowed
+	textarea.attrs.rows-and-cols-wf1 |= 
+		empty
+	textarea.attrs &=
+		(	shared-form.attrs.maxlength?
+		&	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.placeholder?
+		&	shared-form.attrs.dirname?
+		&	textarea.attrs.rows?
+		&	(	(	textarea.attrs.wrap.hard 
+				&	textarea.attrs.cols
+				)
+			|	(	textarea.attrs.wrap.soft?
+				&	textarea.attrs.cols?
+				)
+			)
+		)
+		textarea.attrs.wrap.hard =
+			attribute wrap {
+				w:string "hard"
+			}
+		textarea.attrs.wrap.soft =
+			attribute wrap {
+				w:string "soft"
+			}
+
+## List of Prefill Data: <datalist>
+
+	#REVISIT should the options in datalist be non-selectable?
+
+	datalist.elem =
+		element datalist { datalist.inner & datalist.attrs }
+	datalist.inner =
+		( option.elem* & common.inner.phrasing )
+	datalist.attrs =
+		( common.attrs )
+
+	common.elem.phrasing |= datalist.elem
+
+## Complex Submit Button: <button type='submit'>, extensions
+
+	button.submit.attrs &=
+		(	shared-form.attrs.formaction? 
+		&	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.formenctype? 
+		&	shared-form.attrs.formmethod? 
+		&	shared-form.attrs.formtarget? 
+		&	shared-form.attrs.formnovalidate? 
+		)
+	
+## Complex Reset Button: <button type='reset'>, extensions
+
+	button.reset.attrs &=
+		( shared-form.attrs.autofocus? )
+	
+## Complex Push Button: <button type='button'>, extensions
+
+	button.button.attrs &=
+		( shared-form.attrs.autofocus? )
+
+## Form: <form>, extensions
+	form.attrs &= 
+		(	form.attrs.novalidate?
+		&	form.attrs.target?
+		&	form.attrs.autocomplete?
+		)
+		form.attrs.novalidate = 
+			attribute novalidate {
+				w:string "novalidate" | w:string ""
+			}
+		form.attrs.target = 
+			attribute target {
+				common.data.browsing-context-or-keyword
+			}
+		form.attrs.autocomplete = 
+			attribute autocomplete {
+				w:string "on" | w:string "off"
+			}
+		# REVISIT should this be case-insensitive in conforming XHTML documents?
+		form.attrs.enctype.data |= 
+			( w:string "text/plain" )
+
+## Fieldset: <fieldset>, extensions
+
+	fieldset.attrs &=
+		( common-form.attrs )
+
+## Label: <label>, extensions
+
+	label.attrs &=
+		( common-form.attrs.form? )
+
+## Key-pair generator/input control: <keygen>
+
+	keygen.elem =
+		element keygen { keygen.inner & keygen.attrs }
+	keygen.attrs =
+		(	common.attrs
+		&	keygen.attrs.challenge?
+		&	keygen.attrs.keytype?
+		&	shared-form.attrs.autofocus? 
+		&	common-form.attrs?
+		#REVISIT which ARIA attributes needed here
+		)
+		keygen.attrs.challenge =
+			attribute challenge {
+				string
+			}
+		keygen.attrs.keytype = 
+			attribute keytype {
+				w:string "rsa"
+			}
+	keygen.inner =
+		( empty )
+
+	common.elem.phrasing |= keygen.elem
+
+## Selection Menu: <select>, Extensions
+
+	select.attrs &=
+		(	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.required? 
+		)
diff --git a/xml/relaxng/src/resources/html5-schema/xhtml5.rnc b/xml/relaxng/src/resources/html5-schema/xhtml5.rnc
new file mode 100644
index 0000000..1c6c524
--- /dev/null
+++ b/xml/relaxng/src/resources/html5-schema/xhtml5.rnc
@@ -0,0 +1,40 @@
+default namespace = "http://www.w3.org/1999/xhtml"
+# #####################################################################
+##  RELAX NG Schema for XHTML 5                                       #
+# #####################################################################
+
+  # To validate an XHTML 5 document, you must first validate against #
+  # this schema and then ALSO validate against assertions.sch        #
+
+# #####################################################################
+## Schema Framework & Parameters
+
+include "common.rnc" {
+	# XHTML flavor #
+		XMLonly = empty
+		HTMLonly = notAllowed
+	# HTML 4 compat #
+		v5only = empty
+}
+
+# #####################################################################
+## Language Definitions
+
+start = html.elem
+
+include "meta.rnc"
+include "phrase.rnc"
+include "block.rnc"
+include "sectional.rnc"
+include "structural.rnc"
+include "revision.rnc"
+include "embed.rnc"
+include "ruby.rnc"
+include "media.rnc"
+include "core-scripting.rnc"
+include "tables.rnc"
+include "form-datatypes.rnc"
+include "web-forms.rnc"
+include "web-forms2.rnc"
+include "applications.rnc"
+include "data.rnc"
diff --git a/xml/relaxng/src/resources/relaxng.rng b/xml/relaxng/src/resources/relaxng.rng
new file mode 100644
index 0000000..3842917c
--- /dev/null
+++ b/xml/relaxng/src/resources/relaxng.rng
@@ -0,0 +1,521 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- RELAX NG for RELAX NG -->
+<!-- 
+  Initial version information
+  URL:
+    http://relaxng.org/relaxng.rng
+  Description:
+    http://relaxng.org/#schemas
+    RELAX NG 1.0, from the RELAX NG Specification, with errata applied.
+-->
+<!--
+  Contributor:
+    Syncro Soft - oXygen XML Editor
+  Date:
+    July 12, 2005
+  Description:
+    Annotated with descriptions form Relax NG book by Eric van der Vlist 
+    http://books.xmlschemata.org/relaxng/
+ -->
+<!--
+ Original source: http://www.oxygenxml.com/resources/schema/relaxng/relaxng.rng
+-->
+<grammar datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
+         ns="http://relaxng.org/ns/structure/1.0"
+         xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+         xmlns="http://relaxng.org/ns/structure/1.0">
+  <start>
+    <ref name="pattern"/>
+  </start>
+
+  <define name="pattern">
+    <choice>
+      <element name="element">
+        <a:documentation>The element pattern matches elements. 
+          The name of the element may be defined either through a name attribute or through a name class.</a:documentation>
+        <choice>
+          <attribute name="name">
+            <a:documentation>When name is specified, the element pattern matches only elements with this name. 
+              name is a shortcut to define a single name as a name class for the element pattern.
+              name and the definition of a name class can't be specified together (they are exclusive options).</a:documentation>
+            <data type="QName"/>
+          </attribute>
+          <ref name="open-name-class"/>
+        </choice>
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="attribute">
+        <a:documentation>The attribute pattern matches attributes.
+          The name of the attribute may be defined by using either a name attribute or a name class.
+          After simplification, attribute patterns can contain only patterns relevant for text nodes.
+          Attributes can't be duplicated, either directly or by overlapping name classes.
+          Attributes that have an infinite name class (anyName or nsName) must be enclosed in a oneOrMore or zeroOrMore pattern.
+        </a:documentation>
+        <ref name="common-atts"/>
+        <choice>
+	  <attribute name="name">
+	    <a:documentation>When name is specified, the attribute pattern matches attributes with this name only. 
+	      This can be a shortcut to define a single name as a name class for the attribute pattern).
+	      name and the definition of a name class can't both be specified (they are exclusive options).</a:documentation>
+	    <data type="QName"/>
+	  </attribute>
+          <ref name="open-name-class"/>
+        </choice>
+        <interleave>
+          <ref name="other"/>
+          <optional>
+            <ref name="pattern"/>
+          </optional>
+        </interleave>
+      </element>
+      <element name="group">
+        <a:documentation>The group pattern defines an ordered group of subpatterns. 
+          Note that when attribute patterns are included in such a group, their order isn't enforced. 
+          group patterns are implicit with element and define patterns.</a:documentation>
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="interleave">
+        <a:documentation>The interleave pattern "interleaves" subpatterns; it allows their leaves to be mixed in any order.
+          The interleave pattern can't be used within a list.
+          The interleave behavior is applied to attribute patterns even when they are embedded in (ordered) group patterns 
+          (the reason for this is that XML 1.0 specifies the relative order of attributes isn't significant).
+          Elements within a interleave pattern can't have overlapping name classes.
+          There can be at most one text pattern in each set of patterns combined by interleave.          
+        </a:documentation>
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="choice">
+        <a:documentation>The choice pattern defines a choice between different patterns; 
+          it matches a node if, and only if, at least one of its subpatterns matches this node.</a:documentation>
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="optional">
+        <a:documentation>The optional pattern specifies that its subpatterns considered as an 
+          ordered group is optional, i.e., be matched zero or one times.</a:documentation>
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="zeroOrMore">
+        <a:documentation>The zeroOrMore pattern specifies that its subpatterns are considered 
+          an ordered group that must be matched zero or more times.
+          The zeroOrMore pattern can't contain attribute definitions.</a:documentation>
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="oneOrMore">
+        <a:documentation>The oneOrMore pattern specifies that its subpatterns considered as an 
+          ordered group must be matched one or more times. The oneOrMore pattern can't contain attribute definitions.</a:documentation>
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="list">
+        <a:documentation>The list pattern splits a text node into tokens separated by whitespace. 
+          The splitting allows the validation of these tokens separately. 
+          This practice is most useful for validating lists of values.
+          interleave can't be used within list.
+          The content of a list is only about data: it's forbidden to define element, attribute, or text there.
+          It's forbidden to embed list into list.
+        </a:documentation>
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="mixed">
+        <a:documentation>The mixed pattern is a shortcut for interleave with an embedded text pattern. 
+          It describes unordered content models in which a text node may be included before and after 
+          each element. Note that RELAX NG doesn't allow the addition of constraints on these text nodes.
+          The mixed pattern can't be used within a list.
+          Elements within a mixed pattern can't have overlapping name classes.
+          There must no other text pattern in each set of patterns combined by mixed.
+        </a:documentation>
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="ref">
+        <a:documentation>The ref pattern defines a reference to a named pattern defined in the current grammar.</a:documentation>
+        <attribute name="name">
+          <a:documentation>This attribute specifies the name of the named pattern that is referenced.</a:documentation>
+          <data type="NCName"/>
+        </attribute>
+        <ref name="common-atts"/>
+        <ref name="other"/>
+      </element>
+      <element name="parentRef">
+        <a:documentation>The parentRef pattern is a reference to a named pattern belonging 
+          to the parent grammar - in other words, the grammar in which the current grammar is included. 
+          The scope of a named pattern is usually limited to the grammar in which they are defined. 
+          The parentRef pattern provides a way to extend this scope and refer to a named pattern 
+          defined in the parent grammar.</a:documentation>
+        <attribute name="name">
+          <a:documentation>This attribute specifies the name of the named pattern that is referenced.</a:documentation>
+          <data type="NCName"/>
+        </attribute>
+        <ref name="common-atts"/>
+        <ref name="other"/>
+      </element>
+      <element name="empty">
+        <a:documentation>Empty content. 
+          empty patterns define nodes that are empty, for example, elements that have no child elements, text, or attributes. 
+          Note that it is mandatory to use this pattern explicitly in such cases; the simpler-looking form 
+          &lt;element name=&quot;foo&quot;/&gt; is forbidden. There is no such thing as an empty attribute. 
+          An attribute such as foo=&quot;&quot; is considered to have a value that is the empty string rather 
+          than considered empty - i.e., having no value. Therefore, empty applies only to elements.
+        </a:documentation>
+        <ref name="common-atts"/>
+        <ref name="other"/>
+      </element>
+      <element name="text">
+        <a:documentation>The text pattern matches zero or more text nodes.
+          A match of more than one text node has no effect when it is used in ordered content models 
+          (the data model used by RELAX NG for XML documents is similar to the data model of XPath 1.0, 
+          and two text nodes can't be adjacent) but makes a difference when a text pattern is used in interleave. 
+          Adding a single text pattern in an interleave pattern has the effect of allowing any number of text nodes, 
+          which can interleave before and after each element (note that the mixed pattern is provided as a 
+          shortcut to define these content models).
+          No more than one text pattern can be included in an interleave pattern.</a:documentation>
+        <ref name="common-atts"/>
+        <ref name="other"/>
+      </element>
+      <element name="value">
+        <a:documentation>The value pattern matches a text node against a value using the semantic 
+          of a specified datatype to perform the comparison. 
+          The value pattern is meant for data-oriented applications and can't be used in mixed-content models.
+          It is used to define enumerations.</a:documentation>
+        <optional>
+          <attribute name="type">
+            <a:documentation>This attribute specifies which datatype to use to perform the comparison. 
+              Note that this isn't an inherited attribute. When it isn't specified, the comparison is done using 
+              the default datatype, the token datatype of RELAX NG's built-in type library. Because of this, a string 
+              comparison is done on the values after space normalization.</a:documentation>
+            <data type="NCName"/>
+          </attribute>
+        </optional>
+        <ref name="common-atts"/>
+        <text/>
+      </element>
+      <element name="data">
+        <a:documentation>The data pattern matches a string that represents a value of a named datatype.
+          If the children of an element or an attribute match a data pattern, then complete content of the element 
+          or attribute must match that data pattern. It is not permitted to have a pattern which allows part of the 
+          content to match a data pattern, and another part to match another pattern.
+          The restrictions are applied through the type attribute, which defines the datatype and the param and except child patterns.
+          The data pattern is meant for data-oriented applications and can't be used in mixed content models.        
+        </a:documentation>
+        <attribute name="type">
+          <a:documentation>The type attribute specifies the name of the datatype in the library identified by the datatypeLibrary attribute.</a:documentation>
+          <data type="NCName"/>
+        </attribute>
+        <ref name="common-atts"/>
+        <interleave>
+          <ref name="other"/>
+          <group>
+	    <zeroOrMore>
+	      <element name="param">
+	        <a:documentation>The param element specifies parameters passed to the datatype library 
+	          to determine whether a value is valid per a datatype. When the datatype library is the 
+	          W3C XML Schema datatype, these parameters are the facets of the datatype and define 
+	          additional restrictions to be applied. The name of the parameter is defined by the name attribute, 
+	          and its value is the content of the param element.</a:documentation>
+		<attribute name="name">
+		  <a:documentation>This attribute specifies the name of the parameter.</a:documentation>
+		  <data type="NCName"/>
+		</attribute>
+                <ref name="common-atts"/>
+		<text/>
+	      </element>
+	    </zeroOrMore>
+            <optional>
+              <element name="except">
+                <a:documentation>The except pattern is used to remove a set of values from a data pattern.
+                  The except pattern can be used only in the context of data and can contain only data, value, and choice elements.
+                </a:documentation>
+		<ref name="common-atts"/>
+		<ref name="open-patterns"/>
+              </element>
+            </optional>
+          </group>
+        </interleave>
+      </element>
+      <element name="notAllowed">
+        <a:documentation>The notAllowed pattern always fails. It can provide abstract definitions 
+          that must be overridden before they can be used in a schema.</a:documentation>
+        <ref name="common-atts"/>
+        <ref name="other"/>
+      </element>
+      <element name="externalRef">
+        <a:documentation>The externalRef pattern is a reference to an external schema. 
+          It has the same effect as replacing the externalRef pattern with the external schema, 
+          which is treated as a pattern.</a:documentation>
+        <attribute name="href">
+          <a:documentation>This attribute defines the location of the external schema.</a:documentation>
+          <data type="anyURI"/>
+        </attribute>
+        <ref name="common-atts"/>
+        <ref name="other"/>
+      </element>
+      <element name="grammar">
+        <a:documentation>Defines a grammar pattern. 
+          The grammar pattern encapsulates the definitions of start and named patterns.           
+          A grammar pattern is matched by matching the pattern contained in the start element.
+          The most common use of grammar is to validate XML documents. 
+          In these cases, the start pattern specifies which elements can be used as the document root element. 
+          The grammar pattern may also be used to write modular schemas. 
+          In this case, the start pattern specifies which nodes must be matched by the grammar wherever it appears in the schema.
+          In every case, the named patterns defined in a grammar are considered local to this grammar.
+        </a:documentation>
+        <ref name="common-atts"/>
+        <ref name="grammar-content"/>
+      </element>
+    </choice>
+  </define>
+
+  <define name="grammar-content">
+    <interleave>
+      <ref name="other"/>
+      <zeroOrMore>
+        <choice>
+          <ref name="start-element"/>
+          <ref name="define-element"/>
+          <element name="div">
+            <a:documentation>The div element is provided to define logical divisions in RELAX NG schemas. 
+              It has no effect on validation. Its purpose is to define a group of definitions that may be annotated 
+              as a whole. The div elements may be embedded in other div elements.
+              In the context of a grammar, the content of a div element is the 
+              same as the content of a grammar.</a:documentation>
+            <ref name="common-atts"/>
+            <ref name="grammar-content"/>
+          </element>
+          <element name="include">
+            <a:documentation>The include pattern includes a grammar and merges its definitions with the definitions 
+              of the current grammar. The definitions of the included grammar may be redefined and overridden by the 
+              definitions embedded in the include pattern. Note that a schema must contain an explicit grammar 
+              definition in order to be included.</a:documentation>
+            <attribute name="href">
+              <a:documentation>This attribute defines the location of the schema and specifies the grammar to be included.</a:documentation>
+              <data type="anyURI"/>
+            </attribute>
+            <ref name="common-atts"/>
+            <ref name="include-content"/>
+          </element>
+        </choice>
+      </zeroOrMore>
+    </interleave>
+  </define>
+
+  <define name="include-content">
+    <interleave>
+      <ref name="other"/>
+      <zeroOrMore>
+        <choice>
+          <ref name="start-element"/>
+          <ref name="define-element"/>
+          <element name="div">
+            <a:documentation>In the context of an include, the content of a div element is 
+              the same as the content of an include.</a:documentation>
+            <ref name="common-atts"/>
+            <ref name="include-content"/>
+          </element>
+        </choice>
+      </zeroOrMore>
+    </interleave>
+  </define>
+
+  <define name="start-element">
+    <element name="start">
+      <a:documentation>The start pattern defines the "start" of a grammar. 
+        When this grammar is used to validate a complete document, the start pattern specifies which elements 
+        can be used as the document (root) element. When this grammar is embedded in another grammar, the 
+        start pattern specifies which pattern should be applied at the location where the grammar is embedded. 
+        Like named pattern definitions, start patterns may be combined by choice or interleave and redefined when 
+        they are included in include patterns.</a:documentation>
+      <ref name="combine-att"/>
+      <ref name="common-atts"/>
+      <ref name="open-pattern"/>
+    </element>
+  </define>
+
+  <define name="define-element">
+    <element name="define">
+      <a:documentation>
+        When define is embedded in a grammar, it defines a named pattern or combines a new definition with an existing one. 
+        Named patterns are global to a grammar and can be referenced by ref in the scope of their grammar and by parentRef 
+        in the scope of the grammars directly embedded in their grammar.        
+        When define is embedded in include, the new definition is a redefinition. 
+        It replaces the definitions from the included grammar, unless a combine attribute 
+        is specified, in which case, the definitions are combined.
+      </a:documentation>
+      <attribute name="name">
+        <a:documentation>This attribute specifies the name of the named pattern.</a:documentation>
+        <data type="NCName"/>
+      </attribute>
+      <ref name="combine-att"/>
+      <ref name="common-atts"/>
+      <ref name="open-patterns"/>
+    </element>
+  </define>
+
+  <define name="combine-att">
+    <optional>
+      <attribute name="combine">
+        <a:documentation>This attribute specifies how multiple definitions of a pattern (named pattern or start pattern) 
+          should be combined. The possible values are choice and interleave.
+           When the combine attribute is specified and set to choice, multiple definitions of a pattern are 
+          combined in a choice pattern. When the combine attribute is specified and set to interleave, multiple 
+          definitions of a pattern are combined in an interleave pattern.          
+          Note that it's forbidden to specify more than one define with the same name and no combine attribute or 
+          multiple defines with different values of the combine attribute.
+        </a:documentation>
+        <choice>
+          <value>choice</value>
+          <a:documentation>Specifies that multiple definitions of a named pattern are 
+            combined in a choice pattern</a:documentation>
+          <value>interleave</value>
+          <a:documentation>Specifies that multiple definitions of a named pattern are 
+            combined in an interleave pattern</a:documentation>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  
+  <define name="open-patterns">
+    <interleave>
+      <ref name="other"/>
+      <oneOrMore>
+        <ref name="pattern"/>
+      </oneOrMore>
+    </interleave>
+  </define>
+
+  <define name="open-pattern">
+    <interleave>
+      <ref name="other"/>
+      <ref name="pattern"/>
+    </interleave>
+  </define>
+
+  <define name="name-class">
+    <choice>
+      <element name="name">
+        <a:documentation>The name name class defines a class with a single name.</a:documentation>
+        <ref name="common-atts"/>
+        <data type="QName"/>
+      </element>
+      <element name="anyName">
+        <a:documentation>Name class accepting any name. 
+          The anyName name class matches any name from any namespace. 
+          This wide spectrum may be restricted by embedding except name classes.</a:documentation>
+        <ref name="common-atts"/>
+        <ref name="except-name-class"/>
+      </element>
+      <element name="nsName">
+        <a:documentation>The nsName name class allows any name in a specific namespace.
+          Within the scope of an element, the name classes of attributes can't overlap. 
+          The same restriction applies to name classes of elements when these elements are combined by interleave. 
+          It is impossible to use nsName to produce empty name classes by including nsName in an except name class 
+          included in another nsName.</a:documentation>
+        <ref name="common-atts"/>
+        <ref name="except-name-class"/>
+      </element>
+      <element name="choice">
+        <a:documentation>The choice name class makes a choice between several 
+          name classes: a name matches choice if, and only if, it matches at least one 
+          of the subname classes.</a:documentation>
+        <ref name="common-atts"/>
+        <ref name="open-name-classes"/>
+      </element>
+    </choice>
+  </define>
+
+  <define name="except-name-class">
+    <interleave>
+      <ref name="other"/>
+      <optional>
+        <element name="except">
+          <a:documentation>The except name class can remove a name class from another. Note that this name class has no attributes.</a:documentation>
+          <ref name="open-name-classes"/>
+        </element>
+      </optional>
+    </interleave>
+  </define>
+
+  <define name="open-name-classes">
+    <interleave>
+      <ref name="other"/>
+      <oneOrMore>
+        <ref name="name-class"/>
+      </oneOrMore>
+    </interleave>
+  </define>
+
+  <define name="open-name-class">
+    <interleave>
+      <ref name="other"/>
+      <ref name="name-class"/>
+    </interleave>
+  </define>
+
+  <define name="common-atts">
+    <optional>
+      <attribute name="ns"/>
+      <a:documentation>This attribute defines the default namespace for the elements defined in a portion of a schema. 
+        The value is inherited.</a:documentation>
+    </optional>
+    <optional>
+      <attribute name="datatypeLibrary">
+        <a:documentation>The datatypeLibrary attribute contains a URI identifying the library of 
+          datatypes being used. The value is inherited. The datatype library defined by W3C XML Schema Datatypes would 
+          be identified by the URI http://www.w3.org/2001/XMLSchema-datatypes.</a:documentation>
+        <data type="anyURI"/>
+      </attribute>
+    </optional>
+    <zeroOrMore>
+      <attribute>
+        <anyName>
+          <except>
+            <nsName/>
+            <nsName ns=""/>
+          </except>
+        </anyName>
+      </attribute>
+    </zeroOrMore>
+  </define>
+
+  <define name="other">
+    <zeroOrMore>
+      <element>
+        <anyName>
+          <except>
+            <nsName/>
+          </except>
+        </anyName>
+        <zeroOrMore>
+          <choice>
+            <attribute>
+              <anyName/>
+            </attribute>
+            <text/>
+            <ref name="any"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </zeroOrMore>
+  </define>
+
+  <define name="any">
+    <element>
+      <anyName/>
+      <zeroOrMore>
+        <choice>
+          <attribute>
+            <anyName/>
+          </attribute>
+          <text/>
+          <ref name="any"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+</grammar>
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/AbstractIndexTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/AbstractIndexTest.java
new file mode 100644
index 0000000..ddf45ae
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/AbstractIndexTest.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.testFramework.fixtures.CodeInsightTestFixture;
+import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 04.12.2007
+*/
+public abstract class AbstractIndexTest extends HighlightingTestBase {
+
+  protected final CodeInsightTestFixture createFixture(IdeaTestFixtureFactory factory) {
+    return createContentFixture(factory);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/AbstractParsingTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/AbstractParsingTest.java
new file mode 100644
index 0000000..6492f49
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/AbstractParsingTest.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.testFramework.ParsingTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
+import org.intellij.plugins.relaxNG.compact.RncParserDefinition;
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 24.08.2007
+ */
+public abstract class AbstractParsingTest extends ParsingTestCase {
+  public AbstractParsingTest(String s) {
+    super("psi/" + s, "rnc", new RncParserDefinition());
+  }
+
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath() + "/xml/relaxng/testData/parsing";
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/AttributeCompletionTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/AttributeCompletionTest.java
new file mode 100644
index 0000000..77386a3
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/AttributeCompletionTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import org.intellij.plugins.testUtil.CopyFile;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 07.08.2007
+*/
+@CopyFile("*.rng")
+public class AttributeCompletionTest extends HighlightingTestBase {
+  public String getTestDataPath() {
+    return "completion";
+  }
+
+  public void testAttributeCompletion1() throws Throwable {
+    doTestCompletion("attribute-completion-1.xml", new String[]{ "foo" });
+  }
+
+  public void testAttributeCompletion2() throws Throwable {
+    doTestCompletion("attribute-completion-2.xml", new String[]{ "1.0" });
+  }
+
+  public void testAttributeCompletion3() throws Throwable {
+    doTestCompletion("attribute-completion-3.xml", "1.0", "2.0");
+  }
+
+  public void testAttributeCompletion4() throws Throwable {
+    doTestCompletion("attribute-completion-4.xml", "1.0", "2.0");
+  }
+
+  public void testAttributeCompletion5() throws Throwable {
+    doTestCompletion("attribute-completion-5.xml", "foo", "bar");
+  }
+
+  public void testAttributeCompletion6() throws Throwable {
+    doTestCompletion("attribute-completion-6.xml", "p:foo", "p:bar");
+  }
+
+  public void testAttrCombine() throws Throwable {
+    doTestCompletion("attr-combine.xml", "foo", "bar");
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/ElementCompletionTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/ElementCompletionTest.java
new file mode 100644
index 0000000..fd8ea31
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/ElementCompletionTest.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.application.options.editor.WebEditorOptions;
+import org.intellij.plugins.testUtil.CopyFile;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 07.08.2007
+*/
+@CopyFile("element-completion.rng")
+public class ElementCompletionTest extends HighlightingTestBase {
+  public String getTestDataPath() {
+    return "completion";
+  }
+
+  public void testElementCompletionRoot() throws Throwable {
+    doTestCompletion("element-completion-root.xml", "bar", "baz", "completion-1", "completion-2", "completion-3", "foo", "x");
+  }
+
+  public void testElementCompletion1() throws Throwable {
+    doTestCompletion("element-completion-1.xml", new String[]{ "foo" });
+  }
+
+  public void testElementCompletion2() throws Throwable {
+    doTestCompletion("element-completion-2.xml", "foo", "bar", "baz");
+  }
+
+  public void testElementCompletion3() throws Throwable {
+    final WebEditorOptions options = WebEditorOptions.getInstance();
+    final boolean oldValue = options.isAutomaticallyInsertRequiredAttributes();
+    try {
+      options.setAutomaticallyInsertRequiredAttributes(false);
+      doTestCompletion("element-completion-3", "xml");
+    }
+    finally {
+      options.setAutomaticallyInsertRequiredAttributes(oldValue);
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/ExternalRncParsingTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/ExternalRncParsingTest.java
new file mode 100644
index 0000000..c1928b8
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/ExternalRncParsingTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 07.08.2007
+*/
+public class ExternalRncParsingTest extends HighlightingTestBase {
+  public String getTestDataPath() {
+    return "parsing";
+  }
+
+  public void testParseSimple() throws Throwable {
+    doTestHighlighting("simple.rnc");
+  }
+
+  public void testParseEscaped() throws Throwable {
+    doTestHighlighting("escaped.rnc");
+  }
+
+  public void testParseEscapedBroken1() throws Throwable {
+    doTestHighlighting("escaped-broken-1.rnc");
+  }
+
+  public void testParseEscapedBroken2() throws Throwable {
+    doTestHighlighting("escaped-broken-2.rnc");
+  }
+
+  public void testParseEscapedBroken3() throws Throwable {
+    doTestHighlighting("escaped-broken-3.rnc");
+  }
+
+  public void testParseEscapedBroken4() throws Throwable {
+    doTestHighlighting("escaped-broken-4.rnc");
+  }
+
+  public void testParseEscapedBroken5() throws Throwable {
+    doTestHighlighting("escaped-broken-5.rnc");
+  }
+
+  private void doTestHighlighting(String s) throws Throwable {
+    doExternalToolHighlighting(s);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/HighlightingTestBase.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/HighlightingTestBase.java
new file mode 100644
index 0000000..2ff3bc7
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/HighlightingTestBase.java
@@ -0,0 +1,236 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.codeInsight.daemon.QuickFixProvider;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInspection.InspectionToolProvider;
+import com.intellij.codeInspection.LocalInspectionTool;
+import com.intellij.codeInspection.htmlInspections.RequiredAttributesInspection;
+import com.intellij.javaee.ExternalResourceManagerEx;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.application.WriteAction;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiReference;
+import com.intellij.testFramework.ExpectedHighlightingData;
+import com.intellij.testFramework.PlatformTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
+import com.intellij.testFramework.UsefulTestCase;
+import com.intellij.testFramework.builders.EmptyModuleFixtureBuilder;
+import com.intellij.testFramework.fixtures.CodeInsightTestFixture;
+import com.intellij.testFramework.fixtures.IdeaProjectTestFixture;
+import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory;
+import com.intellij.testFramework.fixtures.TestFixtureBuilder;
+import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl;
+import com.intellij.util.ArrayUtil;
+import org.intellij.plugins.relaxNG.inspections.RngDomInspection;
+import org.intellij.plugins.testUtil.IdeaCodeInsightTestCase;
+import org.intellij.plugins.testUtil.ResourceUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Collection;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 25.07.2007
+ */
+public abstract class HighlightingTestBase extends UsefulTestCase implements IdeaCodeInsightTestCase {
+  protected CodeInsightTestFixture myTestFixture;
+
+  @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
+  protected HighlightingTestBase() {
+    PlatformTestCase.initPlatformLangPrefix();
+  }
+
+  protected void setUp() throws Exception {
+    super.setUp();
+    final IdeaTestFixtureFactory factory = IdeaTestFixtureFactory.getFixtureFactory();
+
+    myTestFixture = createFixture(factory);
+
+    myTestFixture.setTestDataPath(getTestDataBasePath() + getTestDataPath());
+
+    Class<? extends LocalInspectionTool>[] inspectionClasses = new DefaultInspectionProvider().getInspectionClasses();
+    if (getName().contains("Inspection")) {
+      inspectionClasses = ArrayUtil.mergeArrays(inspectionClasses, ApplicationLoader.getInspectionClasses());
+    }
+
+    myTestFixture.setUp();
+
+    myTestFixture.enableInspections(inspectionClasses);
+
+    new WriteAction() {
+      protected void run(Result result) throws Throwable {
+        ResourceUtil.copyFiles(HighlightingTestBase.this);
+        init();
+      }
+    }.execute().throwException();
+  }
+
+  protected static String toAbsolutePath(String relativeTestDataPath) {
+    return FileUtil.toSystemDependentName(getTestDataBasePath() + relativeTestDataPath);
+  }
+
+  public static String getTestDataBasePath() {
+    return PlatformTestUtil.getCommunityPath() + "/xml/relaxng/testData/";
+  }
+
+  protected CodeInsightTestFixture createFixture(IdeaTestFixtureFactory factory) {
+    final TestFixtureBuilder<IdeaProjectTestFixture> builder = factory.createLightFixtureBuilder();
+    final IdeaProjectTestFixture fixture = builder.getFixture();
+
+    final CodeInsightTestFixture testFixture;
+    testFixture = factory.createCodeInsightFixture(fixture);
+
+    return testFixture;
+  }
+
+  protected CodeInsightTestFixture createContentFixture(IdeaTestFixtureFactory factory) {
+    final TestFixtureBuilder<IdeaProjectTestFixture> builder = factory.createFixtureBuilder(getName());
+    final EmptyModuleFixtureBuilder moduleBuilder = builder.addModule(EmptyModuleFixtureBuilder.class);
+    final IdeaProjectTestFixture fixture = builder.getFixture();
+
+    final CodeInsightTestFixture testFixture;
+    testFixture = factory.createCodeInsightFixture(fixture);
+
+    final String root = testFixture.getTempDirPath();
+    moduleBuilder.addContentRoot(root);
+    moduleBuilder.addSourceRoot("/");
+
+    return testFixture;
+  }
+
+  public CodeInsightTestFixture getFixture() {
+    return myTestFixture;
+  }
+
+  public abstract String getTestDataPath();
+
+  protected void init() {
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        ExternalResourceManagerEx.getInstanceEx().addIgnoredResource("urn:test:undefined");
+      }
+    });
+  }
+
+  protected void tearDown() throws Exception {
+    myTestFixture.tearDown();
+    super.tearDown();
+  }
+
+  protected void doHighlightingTest(String s) throws Throwable {
+    doCustomHighlighting(s, true, false);
+//    myTestFixture.testHighlighting(true, false, true, s);
+  }
+
+  protected void doExternalToolHighlighting(String name) throws Throwable {
+    doCustomHighlighting(name, true, true);
+  }
+
+  protected void doCustomHighlighting(String name, final boolean checkWeakWarnings, final Boolean includeExternalToolPass) throws Throwable {
+    myTestFixture.configureByFile(name);
+
+    doCustomHighlighting(checkWeakWarnings, includeExternalToolPass);
+  }
+
+  protected void doCustomHighlighting(boolean checkWeakWarnings, Boolean includeExternalToolPass) {
+    final PsiFile file = myTestFixture.getFile();
+    final Document doc = myTestFixture.getEditor().getDocument();
+    ExpectedHighlightingData data = new ExpectedHighlightingData(doc, true, checkWeakWarnings, false, file);
+    data.init();
+    PsiDocumentManager.getInstance(myTestFixture.getProject()).commitAllDocuments();
+
+    Collection<HighlightInfo> highlights1 = doHighlighting(includeExternalToolPass);
+
+    data.checkResult(highlights1, doc.getText());
+  }
+
+  @NotNull
+  protected Collection<HighlightInfo> doHighlighting(final Boolean externalToolPass) {
+    final Project project = myTestFixture.getProject();
+    PsiDocumentManager.getInstance(project).commitAllDocuments();
+    final Editor editor = myTestFixture.getEditor();
+
+    int[] ignore = externalToolPass == null || externalToolPass ? new int[]{
+      com.intellij.codeHighlighting.Pass.LINE_MARKERS,
+      com.intellij.codeHighlighting.Pass.LOCAL_INSPECTIONS,
+      com.intellij.codeHighlighting.Pass.POPUP_HINTS,
+      com.intellij.codeHighlighting.Pass.POST_UPDATE_ALL,
+      com.intellij.codeHighlighting.Pass.UPDATE_ALL,
+      com.intellij.codeHighlighting.Pass.UPDATE_FOLDING,
+      com.intellij.codeHighlighting.Pass.UPDATE_OVERRIDEN_MARKERS,
+      com.intellij.codeHighlighting.Pass.VISIBLE_LINE_MARKERS,
+    } : new int[]{com.intellij.codeHighlighting.Pass.EXTERNAL_TOOLS};
+    return CodeInsightTestFixtureImpl.instantiateAndRun(myTestFixture.getFile(), editor, ignore, false);
+  }
+
+  protected void doTestCompletion(String name, String ext) throws Throwable {
+    myTestFixture.testCompletion(name + "." + ext, name + "_after." + ext);
+  }
+
+  protected void doTestCompletion(String before, String... variants) throws Throwable {
+    myTestFixture.testCompletionVariants(before, variants);
+  }
+
+  protected void doTestCompletion(String before) throws Throwable {
+    doTestCompletion(before, "xml");
+  }
+
+  protected void doTestRename(String name, String ext, String newName) throws Throwable {
+    myTestFixture.testRename(name + "." + ext, name + "_after." + ext, newName);
+  }
+
+  @SuppressWarnings({ "deprecation", "unchecked" })
+  protected void doTestQuickFix(String file, String ext) throws Throwable {
+    final PsiReference psiReference = myTestFixture.getReferenceAtCaretPositionWithAssertion(file + "." + ext);
+    assertNull("Reference", psiReference.resolve());
+    assertTrue("QuickFixProvider", psiReference instanceof QuickFixProvider);
+
+    final HighlightInfo info = HighlightInfo.createHighlightInfo(HighlightInfoType.ERROR, 0, 0, "");
+    ((QuickFixProvider)psiReference).registerQuickfix(info, psiReference);
+    assertTrue("One action expected", info.quickFixActionRanges.size() == 1);
+
+    final Pair<HighlightInfo.IntentionActionDescriptor, TextRange> rangePair = info.quickFixActionRanges.get(0);
+    final IntentionAction action = rangePair.first.getAction();
+
+    assertTrue("action is enabled", action.isAvailable(myTestFixture.getProject(), myTestFixture.getEditor(), myTestFixture.getFile()));
+    myTestFixture.launchAction(action);
+
+    myTestFixture.checkResultByFile(file + "_after." + ext);
+  }
+
+  private static class DefaultInspectionProvider implements InspectionToolProvider {
+    public Class[] getInspectionClasses() {
+      return new Class[]{
+              RngDomInspection.class,
+              RequiredAttributesInspection.class
+      };
+    }
+  }
+}
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RncAnnotationParsingTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncAnnotationParsingTest.java
new file mode 100644
index 0000000..40a7edc
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncAnnotationParsingTest.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 07.08.2007
+*/
+public class RncAnnotationParsingTest extends AbstractParsingTest {
+  public RncAnnotationParsingTest() {
+    super("annotations");
+  }
+
+  public void testSimple1() throws Throwable {
+   doTest(true);
+  }
+
+  public void testSimple2() throws Throwable {
+   doTest(true);
+  }
+
+  public void testNested() throws Throwable {
+   doTest(true);
+  }
+
+  public void testGrammarLevel() throws Throwable {
+   doTest(true);
+  }
+
+  public void testFollowing() throws Throwable {
+   doTest(true);
+  }
+
+  public void testFollowingIncomplete() throws Throwable {
+   doTest(true);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RncCompletionTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncCompletionTest.java
new file mode 100644
index 0000000..fe552d0
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncCompletionTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.codeInsight.completion.impl.CamelHumpMatcher;
+import org.intellij.plugins.testUtil.CopyFile;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 22.08.2007
+ */
+public class RncCompletionTest extends HighlightingTestBase {
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+    CamelHumpMatcher.forceStartMatching(getTestRootDisposable());
+  }
+
+  public String getTestDataPath() {
+    return "completion/rnc";
+  }
+
+  public void testCompleteKeyword1() throws Throwable {
+    doTestCompletion("complete-keyword-1", "rnc");
+  }
+
+  public void testCompleteKeyword2() throws Throwable {
+    doTestCompletion("complete-keyword-2", "rnc");
+  }
+
+  public void testCompleteRef1() throws Throwable {
+    doTestCompletion("complete-ref-1", "rnc");
+  }
+
+  public void testCompleteRef2() throws Throwable {
+    doTestCompletion("complete-ref-2", "rnc");
+  }
+
+  @CopyFile("included.rnc")
+  public void testCompleteRef3() throws Throwable {
+    doTestCompletion("complete-ref-3", "rnc");
+  }
+
+  public void testCompleteRef4() throws Throwable {
+    doTestCompletion("complete-ref-4", "rnc");
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RncExternalHighlightingTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncExternalHighlightingTest.java
new file mode 100644
index 0000000..da70d9f
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncExternalHighlightingTest.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import org.intellij.plugins.testUtil.CopyFile;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 25.07.2007
+ */
+public class RncExternalHighlightingTest extends HighlightingTestBase {
+
+  public String getTestDataPath() {
+    return "highlighting/rnc";
+  }
+
+  protected void init() {
+//    new ProjectLoader(myTestFixture.getProject()).initComponent();
+//    ExternalResourceManager.getInstance().addResource("http://relaxng.org/ns/structure/1.0", new File("highlighting/relaxng.rng").getAbsolutePath());
+  }
+
+  public void testAddressBook() throws Throwable {
+    doExternalToolHighlighting("addressbook.rnc");
+  }
+
+  public void testMissingContent() throws Throwable {
+    doExternalToolHighlighting("missing-content.rnc");
+  }
+
+  @CopyFile("included.rnc")
+  public void testMissingStart() throws Throwable {
+    doExternalToolHighlighting("missing-start.rnc");
+  }
+
+  public void testUndefinedRef() throws Throwable {
+    doExternalToolHighlighting("undefined-ref-ok.rnc");
+  }
+
+  public void testRngSchema() throws Throwable {
+    doExternalToolHighlighting("rng-schema.rnc");
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RncHighlightingTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncHighlightingTest.java
new file mode 100644
index 0000000..9ee02c8
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncHighlightingTest.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import org.intellij.plugins.testUtil.CopyFile;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 25.07.2007
+ */
+public class RncHighlightingTest extends HighlightingTestBase {
+
+  public String getTestDataPath() {
+    return "highlighting/rnc";
+  }
+
+  public void testRef3() throws Throwable {
+    doHighlightingTest("ref-3.rnc");
+  }
+
+  public void testUndefinedRef() throws Throwable {
+    doHighlightingTest("undefined-ref.rnc");
+  }
+
+  public void testCreateDefintion1() throws Throwable {
+    doTestQuickFix("create-definition-1", "rnc");
+  }
+
+  public void testCreateDefintion2() throws Throwable {
+    doTestQuickFix("create-definition-2", "rnc");
+  }
+
+  public void testNsPrefix() throws Throwable {
+    doHighlightingTest("ns-prefix.rnc");
+  }
+
+  public void testNsPrefixKeyword() throws Throwable {
+    doHighlightingTest("ns-prefix-keyword.rnc");
+  }
+
+  public void testUnresolvedNsPrefix1() throws Throwable {
+    doHighlightingTest("unresolved-ns-prefix-1.rnc");
+  }
+
+  public void testUnresolvedNsPrefix2() throws Throwable {
+    doHighlightingTest("unresolved-ns-prefix-2.rnc");
+  }
+
+  public void testUnresolvedNsPrefix3() throws Throwable {
+    doHighlightingTest("unresolved-ns-prefix-3.rnc");
+  }
+
+  public void testCreateNsPrefix() throws Throwable {
+    doTestQuickFix("create-ns-prefix-1", "rnc");
+  }
+
+  public void testDatatypePrefix() throws Throwable {
+    doHighlightingTest("datatype-prefix.rnc");
+  }
+
+  public void testUnresolvedDatatypePrefix1() throws Throwable {
+    doHighlightingTest("unresolved-datatype-prefix-1.rnc");
+  }
+
+  public void testUnresolvedDatatypePrefix2() throws Throwable {
+    doHighlightingTest("unresolved-datatype-prefix-2.rnc");
+  }
+
+  public void testCreateDatatypesPrefix() throws Throwable {
+    doTestQuickFix("create-datatypes-prefix-1", "rnc");
+  }
+
+  public void testUnresolvedInclude() throws Throwable {
+    doHighlightingTest("unresolved-include.rnc");
+  }
+
+  public void testParentRef() throws Throwable {
+    doHighlightingTest("parent-ref.rnc");
+  }
+
+  public void testBadParentRef1() throws Throwable {
+    doHighlightingTest("bad-parent-ref-1.rnc");
+  }
+
+  public void testAnnotation() throws Throwable {
+    doHighlightingTest("annotation.rnc");
+  }
+
+  @CopyFile("fo/*.rnc")
+  public void testFoMain() throws Throwable {
+    doHighlightingTest("fo/main.rnc");
+  }
+
+  @CopyFile("fo/*.rnc")
+  public void testFoElements() throws Throwable {
+    doHighlightingTest("fo/elements.rnc");
+  }
+
+  public void testFoDatatype() throws Throwable {
+    doHighlightingTest("fo/datatype.rnc");
+  }
+
+  public void testRngSchema() throws Throwable {
+    doHighlightingTest("rng-schema.rnc");
+  }
+
+  public void testDocbook() throws Throwable {
+    doHighlightingTest("docbook.rnc");
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RncIndexHighlightingTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncIndexHighlightingTest.java
new file mode 100644
index 0000000..97b6219
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncIndexHighlightingTest.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import org.intellij.plugins.testUtil.CopyFile;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 25.07.2007
+ */
+@CopyFile("*.rnc")
+public class RncIndexHighlightingTest extends AbstractIndexTest {
+
+  public String getTestDataPath() {
+    return "highlighting/rnc";
+  }
+
+  public void testBackwardIncludeRef() throws Throwable {
+    doHighlightingTest("backward-include-ref.rnc");
+  }
+
+  public void testInspectionUnusedDefine() throws Throwable {
+    doHighlightingTest("unused-define.rnc");
+  }
+
+  public void testInspectionSuppressedUnusedDefine() throws Throwable {
+    doHighlightingTest("suppressed-unused-define.rnc");
+  }
+
+  public void testInspectionUsedDefine() throws Throwable {
+    doHighlightingTest("used-define.rnc");
+  }
+
+  public void testInclude1() throws Throwable {
+    myTestFixture.configureByFiles("include1.rnc", "include1_1.rnc", "include1_2.rnc");
+    doCustomHighlighting(true, false);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RncParsingTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncParsingTest.java
new file mode 100644
index 0000000..ac54ee6
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncParsingTest.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 07.08.2007
+*/
+public class RncParsingTest extends AbstractParsingTest {
+  public RncParsingTest() {
+    super("complex");
+  }
+
+  public void testMain() throws Throwable {
+   doTest(true);
+  }
+
+  public void testElements() throws Throwable {
+   doTest(true);
+  }
+
+  public void testProperties() throws Throwable {
+   doTest(true);
+  }
+
+  public void testDatatype() throws Throwable {
+   doTest(true);
+  }
+
+  public void testRelaxNG() throws Throwable {
+   doTest(true);
+  }
+
+  public void testDocbook() throws Throwable {
+    doTest(true);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RncRenameTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncRenameTest.java
new file mode 100644
index 0000000..cc46f95
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RncRenameTest.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.refactoring.RefactoringFactory;
+import com.intellij.refactoring.RenameRefactoring;
+import com.intellij.testFramework.fixtures.CodeInsightTestFixture;
+import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory;
+
+import java.io.File;
+
+/**
+ * @author sweinreuter
+ * @since 25.07.2007
+ */
+public class RncRenameTest extends HighlightingTestBase {
+
+  protected CodeInsightTestFixture createFixture(IdeaTestFixtureFactory factory) {
+    return createContentFixture(factory);
+  }
+
+  public String getTestDataPath() {
+    return "rename/rnc";
+  }
+
+  public void testRenameDefinition1() throws Throwable {
+    doTestRename("rename-definition-1", "bar");
+  }
+
+  public void testRenameDefinition2() throws Throwable {
+    doTestRename("rename-definition-2", "element");
+  }
+
+  public void testRenameDefinition3() throws Throwable {
+    doTestRename("rename-definition-3", "bar");
+  }
+
+  public void testRenameNsPrefix1() throws Throwable {
+    doTestRename("rename-ns-prefix-1", "bar");
+  }
+
+  public void testRenameDatatypePrefix1() throws Throwable {
+    doTestRename("rename-datatype-prefix-1", "bar");
+  }
+
+  public void testRenameIncludedFile() throws Throwable {
+    myTestFixture.copyFileToProject("rename-in-include-ref.rnc");
+    
+    final Project project = myTestFixture.getProject();
+    final RefactoringFactory factory = RefactoringFactory.getInstance(project);
+
+    String fullPath = myTestFixture.getTempDirPath() + "/" + "rename-in-include-ref.rnc";
+
+    final VirtualFile copy = LocalFileSystem.getInstance().refreshAndFindFileByPath(fullPath.replace(File.separatorChar, '/'));
+    assert copy != null : "file " + fullPath + " not found";
+
+    final PsiFile file = PsiManager.getInstance(project).findFile(copy);
+    assertNotNull(file);
+
+    new WriteCommandAction.Simple(project) {
+      protected void run() throws Throwable {
+        myTestFixture.configureByFile("rename-in-include.rnc");
+        final RenameRefactoring refactoring = factory.createRename(file, "rename-after.rnc");
+        refactoring.setPreviewUsages(false);
+        refactoring.setSearchInComments(false);
+        refactoring.setSearchInNonJavaFiles(true);
+        refactoring.run();
+        myTestFixture.checkResultByFile("rename-in-include_after.rnc");
+      }
+    }.execute().throwException();
+
+    assertEquals("rename-after.rnc", file.getName());
+  }
+
+  private void doTestRename(String name, String newName) throws Throwable {
+    doTestRename(name, "rnc", newName);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RngCompletionTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngCompletionTest.java
new file mode 100644
index 0000000..82a67445
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngCompletionTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.codeInsight.completion.impl.CamelHumpMatcher;
+import org.intellij.plugins.testUtil.CopyFile;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 22.08.2007
+ */
+public class RngCompletionTest extends HighlightingTestBase {
+  public String getTestDataPath() {
+    return "completion/rng";
+  }
+
+  public void testCompleteRef1() throws Throwable {
+    doTestCompletion("complete-ref-1.rng", new String[]{ "start.element" });
+  }
+
+  public void testCompleteRef2() throws Throwable {
+    doTestCompletion("complete-ref-2.rng", new String[]{"start.element" });
+  }
+
+  @CopyFile("included.rng")
+  public void testCompleteRef3() throws Throwable {
+    doTestCompletion("complete-ref-3.rng", new String[]{ "included.start.element" });
+  }
+
+  public void testCompleteRef4() throws Throwable {
+    CamelHumpMatcher.forceStartMatching(getTestRootDisposable());
+    doTestCompletion("complete-ref-4", "rng");
+  }
+}
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RngHighlightingTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngHighlightingTest.java
new file mode 100644
index 0000000..aa44eca
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngHighlightingTest.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiPolyVariantReference;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.ResolveResult;
+import com.intellij.psi.xml.XmlTag;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 25.07.2007
+ */
+public class RngHighlightingTest extends HighlightingTestBase {
+
+  public String getTestDataPath() {
+    return "highlighting/rng";
+  }
+
+  public void testSimpleSchema() throws Throwable {
+    doHighlightingTest("simple.rng");
+  }
+
+  public void testRef1() throws Throwable {
+    doHighlightingTest("ref-1.rng");
+  }
+
+  public void testRef2() throws Throwable {
+    doHighlightingTest("ref-2.rng");
+  }
+
+  public void testRef3() throws Throwable {
+    doHighlightingTest("ref-3.rng");
+  }
+
+  public void testBadRef() throws Throwable {
+    doHighlightingTest("bad-ref.rng");
+  }
+
+  public void testBadRef2() throws Throwable {
+    doHighlightingTest("bad-ref-2.rng");
+  }
+
+  public void testBadRef3() throws Throwable {
+    doHighlightingTest("bad-ref-3.rng");
+  }
+
+  public void testBadRef4() throws Throwable {
+    doHighlightingTest("bad-ref-4.rng");
+  }
+
+  public void testCreateDefinition1() throws Throwable {
+    doTestQuickFix("create-definition-1", "rng");
+  }
+
+  public void testParentRef1() throws Throwable {
+    doHighlightingTest("parent-ref-1.rng");
+  }
+
+  public void testParentRef2() throws Throwable {
+    myTestFixture.copyFileToProject("include.rng");
+    doHighlightingTest("parent-ref-2.rng");
+  }
+
+  public void testBadParentRef1() throws Throwable {
+    doHighlightingTest("bad-parent-ref-1.rng");
+  }
+
+  public void testBadParentRef2() throws Throwable {
+    myTestFixture.copyFileToProject("bad-parent-ref-1.rng");
+    doHighlightingTest("bad-parent-ref-2.rng");
+  }
+
+  public void testCreateDefinition2() throws Throwable {
+    doTestQuickFix("create-definition-2", "rng");
+  }
+
+  public void testMissingStartElement() throws Throwable {
+    doCustomHighlighting("missing-start-element.rng", false, true);
+  }
+
+  public void testMissingStartElementAndInclude() throws Throwable {
+    myTestFixture.copyFileToProject("included-grammar.rng");
+    doCustomHighlighting("missing-start-element-and-include.rng", false, true);
+  }
+
+  public void testBadNsPrefix() throws Throwable {
+    doHighlightingTest("bad-ns-prefix.rng");
+  }
+
+  public void testBadElement() throws Throwable {
+    doExternalToolHighlighting("bad-element.rng");
+  }
+
+  public void testInclude() throws Throwable {
+    myTestFixture.copyFileToProject("include.rng");
+    doHighlightingTest("good-include.rng");
+  }
+
+  public void testIncludedRef1() throws Throwable {
+    myTestFixture.copyFileToProject("include.rng");
+    doHighlightingTest("good-include-ref-1.rng");
+  }
+
+  public void testResolveIncludedRef1() throws Throwable {
+    myTestFixture.copyFileToProject("include.rng");
+
+    final PsiReference ref = myTestFixture.getReferenceAtCaretPositionWithAssertion("resolve-include-ref-1.rng");
+    final PsiElement element = ref.resolve();
+    assertTrue(element instanceof XmlTag);
+    assertNotSame(element.getContainingFile(), ref.getElement().getContainingFile());
+    assertEquals(0, ((XmlTag)element).getSubTags().length);
+  }
+
+  public void testResolveIncludedRef2() throws Throwable {
+    myTestFixture.copyFileToProject("include.rng");
+
+    final PsiReference ref = myTestFixture.getReferenceAtCaretPositionWithAssertion("resolve-include-ref-2.rng");
+    assertTrue("PolyVariantRef", ref instanceof PsiPolyVariantReference);
+
+    final PsiElement element = ref.resolve();
+    assertNull(element);
+
+    final ResolveResult[] results = ((PsiPolyVariantReference)ref).multiResolve(false);
+    assertEquals(2, results.length);
+
+    for (ResolveResult result : results) {
+      PsiElement e = result.getElement();
+      assertTrue(e instanceof XmlTag);
+
+      final int contentLength = ((XmlTag)e).getSubTags().length;
+      if (e.getContainingFile() == ref.getElement().getContainingFile()) {
+        assertEquals(1, contentLength);
+      } else {
+        assertEquals(0, contentLength);
+      }
+    }
+  }
+
+  public void testBadInclude() throws Throwable {
+    doHighlightingTest("bad-include.rng");
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RngHtml5CompletionTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngHtml5CompletionTest.java
new file mode 100644
index 0000000..a91b109
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngHtml5CompletionTest.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.javaee.ExternalResourceManagerImpl;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+@SuppressWarnings({"JUnitTestClassNamingConvention"})
+public class RngHtml5CompletionTest extends HighlightingTestBase {
+
+  @Override
+  public String getTestDataPath() {
+    return "completion";
+  }
+
+  @Override
+  protected void init() {
+    super.init();
+
+    ExternalResourceManagerImpl.addTestResource("http://www.w3.org/1999/xhtml/html5", toAbsolutePath("/highlighting/html5/html5.rnc"),
+                                                myTestRootDisposable);
+  }
+
+  public void testHtml5_1() throws Throwable {
+    myTestFixture.testCompletionTyping("html5_1.xml", "\n", "html5_1_after.xml");
+  }
+
+  public void testHtml5_2() throws Throwable {
+    doTestCompletion("html5_2");
+  }
+
+  public void testHtml5_3() throws Throwable {
+    doTestCompletion("html5_3");
+  }
+
+  public void testHtml5_4() throws Throwable {
+    doTestCompletion("html5_4");
+  }
+
+  public void testHtml5_5() throws Throwable {
+    doTestCompletion("html5_5");
+  }
+
+  public void testHtml5_6() throws Throwable {
+    doTestCompletion("html5_6");
+  }
+
+  public void testHtml5_7() throws Throwable {
+    doTestCompletion("html5_7");
+  }
+
+  public void testHtml5_8() throws Throwable {
+    doTestCompletion("html5_8");
+  }
+
+  public void testHtml5_9() throws Throwable {
+    doTestCompletion("html5_9");
+  }
+
+  public void testHtml5_10() throws Throwable {
+    doTestCompletion("html5_10");
+  }
+
+  public void testHtml5_11() throws Throwable {
+    doTestCompletion("html5_11");
+  }
+
+  public void testHtml5_12() throws Throwable {
+    doTestCompletion("html5_12");
+  }
+
+  public void testHtml5_13() throws Throwable {
+    doTestCompletion("html5_13");
+  }
+
+  public void testHtml5_14() throws Throwable {
+    doTestCompletion("html5_14");
+  }
+
+  public void testHtml5_15() throws Throwable {
+    doTestCompletion("html5_15");
+  }
+
+  public void testHtml5_16() throws Throwable {
+    myTestFixture.testCompletionTyping("html5_16.xml", "\n", "html5_16_after.xml");
+  }
+
+  public void testHtml5_17() throws Throwable {
+    doTestCompletion("html5_17");
+  }
+}
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RngIndexHighlightingTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngIndexHighlightingTest.java
new file mode 100644
index 0000000..0b89884
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngIndexHighlightingTest.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import org.intellij.plugins.testUtil.CopyFile;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 25.07.2007
+ */
+@CopyFile("*.rng")
+public class RngIndexHighlightingTest extends AbstractIndexTest {
+
+  public String getTestDataPath() {
+    return "highlighting/rng";
+  }
+
+  public void testInspectionUnusedDefine1() throws Throwable {
+    doHighlightingTest("unused-define-1.rng");
+  }
+
+  public void testInspectionUnusedDefine2() throws Throwable {
+    doHighlightingTest("unused-define-2.rng");
+  }
+
+  public void testInspectionDefine1() throws Throwable {
+    doHighlightingTest("used-define-1.rng");
+  }
+
+  public void testInspectionDefine2() throws Throwable {
+    doHighlightingTest("used-define-2.rng");
+  }
+
+  public void testInspectionDefine3() throws Throwable {
+    doHighlightingTest("used-define-3-include.rng");
+  }
+
+  public void testIncludedGrammarWithoutStart() throws Throwable {
+    // adding a <weak_warning> tag doesn't work because it seems to prevent the index to recognize the file
+    // because the replacement is done *after* building the index :(
+    doCustomHighlighting("included-grammar.rng", false, false);
+  }
+
+  public void testBackwardIncludeRef() throws Throwable {
+    doHighlightingTest("backward-include-ref.rng");
+  }
+
+  public void testUnrelatedBackwardIncludeRef() throws Throwable {
+    doHighlightingTest("backward-with-include.rng");
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RngRenameTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngRenameTest.java
new file mode 100644
index 0000000..45f7895
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngRenameTest.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.testFramework.fixtures.CodeInsightTestFixture;
+import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 22.08.2007
+ */
+public class RngRenameTest extends HighlightingTestBase {
+  protected CodeInsightTestFixture createFixture(IdeaTestFixtureFactory factory) {
+    return createContentFixture(factory);
+  }
+
+  public String getTestDataPath() {
+    return "rename/rng";
+  }
+
+  public void testRenameRef1() throws Throwable {
+    doTestRename("rename-ref-1", "start");
+  }
+
+  private void doTestRename(String name, String newName) throws Throwable {
+    doTestRename(name, "rng", newName);
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RngXmlHighlightingTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngXmlHighlightingTest.java
new file mode 100644
index 0000000..18a3f27
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngXmlHighlightingTest.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.javaee.ExternalResourceManagerEx;
+import com.intellij.javaee.ExternalResourceManagerImpl;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.fileTypes.FileTypeManager;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import org.intellij.plugins.testUtil.CopyFile;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 25.07.2007
+ */
+public class RngXmlHighlightingTest extends HighlightingTestBase {
+
+  public String getTestDataPath() {
+    return "highlighting";
+  }
+
+  protected void init() {
+    super.init();
+    FileTypeManager.getInstance().registerFileType(StdFileTypes.XML, "fo");
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        final ExternalResourceManagerEx m = ExternalResourceManagerEx.getInstanceEx();
+        ExternalResourceManagerImpl.addTestResource("urn:test:simple.rng", toAbsolutePath("highlighting/simple.rng"), myTestRootDisposable);
+        ExternalResourceManagerImpl.addTestResource("urn:test:addressBook", toAbsolutePath("highlighting/rnc/addressbook.rnc"), myTestRootDisposable);
+        //m.addResource("http://www.w3.org/1999/XSL/Transform", toAbsolutePath("highlighting/relaxng.rng"));
+        ExternalResourceManagerImpl.addTestResource("http://www.w3.org/1999/XSL/Format", toAbsolutePath("highlighting/rnc/fo/main.rnc"), myTestRootDisposable);
+        ExternalResourceManagerImpl.addTestResource("http://docbook.org/ns/docbook", toAbsolutePath("highlighting/docbook.rng"), myTestRootDisposable);
+        ExternalResourceManagerImpl.addTestResource("urn:intelliForm:AttachmentFilter", toAbsolutePath("highlighting/attachment-filter.rng"), myTestRootDisposable);
+        ExternalResourceManagerImpl.addTestResource("http://www.w3.org/1999/xhtml/html5", toAbsolutePath("highlighting/html5/xhtml5.rnc"), myTestRootDisposable);
+
+        m.addIgnoredResource("urn:intelliForm:Spaces");
+        m.addIgnoredResource("http://www.w3.org/1999/xlink");
+        m.addIgnoredResource("http://www.w3.org/2000/svg");
+        m.addIgnoredResource("http://www.ascc.net/xml/schematron");
+        m.addIgnoredResource("http://www.w3.org/2000/svg");
+        m.addIgnoredResource("http://www.w3.org/1998/Math/MathML");
+        m.addIgnoredResource("http://nwalsh.com/xmlns/schema-control/");
+        m.addIgnoredResource("http://xml.apache.org/fop/extensions");
+        m.addIgnoredResource("http://www.antennahouse.com/names/XSL/Extensions");
+        m.addIgnoredResource("http://www.renderx.com/XSL/Extensions");
+        m.addIgnoredResource("http://relaxng.org/ns/compatibility/annotations/1.0");
+      }
+    });
+  }
+
+  public void testSimpleElement() throws Throwable {
+    doHighlightingTest("simple-element_1.xml");
+  }
+
+  public void testOptionalElement() throws Throwable {
+    doHighlightingTest("optional-element_1.xml");
+  }
+
+  public void testSimpleAttribute() throws Throwable {
+    doHighlightingTest("simple-attribute_1.xml");
+  }
+
+  public void testSimpleAttributeMissing() throws Throwable {
+    doHighlightingTest("simple-attribute_2.xml");
+  }
+
+  public void testOptionalAttribute() throws Throwable {
+    doHighlightingTest("optional-attribute_1.xml");
+    doHighlightingTest("optional-attribute_2.xml");
+  }
+
+  public void testFixedAttribute() throws Throwable {
+    doHighlightingTest("fixed-attribute_1.xml");
+  }
+
+  public void testFixedAttributeIllegal() throws Throwable {
+    doHighlightingTest("fixed-attribute_2.xml");
+  }
+
+  public void testValueChoice1() throws Throwable {
+    doHighlightingTest("value-choice-1.xml");
+  }
+
+  public void testValueChoice2() throws Throwable {
+    doHighlightingTest("value-choice-2.xml");
+  }
+
+  public void testTokenDatatype() throws Throwable {
+    doHighlightingTest("token-datatype.xml");
+  }
+
+  public void testAttributeChoice1() throws Throwable {
+    doHighlightingTest("attribute-choice-1.xml");
+  }
+
+  public void testAttributeChoice2() throws Throwable {
+    doHighlightingTest("attribute-choice-2.xml");
+  }
+
+  public void testAttributeChoice3() throws Throwable {
+    doHighlightingTest("attribute-choice-3.xml");
+  }
+
+  public void testNestedFragment() throws Throwable {
+    doHighlightingTest("nested-fragment.xml");
+  }
+
+  public void testNestedFragment2() throws Throwable {
+    myTestFixture.copyFileToProject("jpdl-3.1.xsd");
+    doHighlightingTest("nested-fragment-2.xml");
+  }
+
+  public void testDocbookExample() throws Throwable {
+    doHighlightingTest("mybook.xml");
+  }
+
+  public void testMissingAttributeRnc() throws Throwable {
+    doHighlightingTest("rnc/missing-attribute.xml");
+  }
+
+  public void testValidRnc() throws Throwable {
+    doHighlightingTest("rnc/valid-rnc.xml");
+  }
+
+  @CopyFile({"rnc/include.rnc", "rnc/included.rnc"})
+  public void testValidIncludeRnc() throws Throwable {
+    doHighlightingTest("rnc/valid-rnc-include.xml");
+  }
+
+  public void testBadElementRnc() throws Throwable {
+    doHighlightingTest("rnc/bad-element.xml");
+  }
+
+  public void testRngSchema() throws Throwable {
+    doHighlightingTest("relaxng.rng");
+  }
+
+  public void testNestedComposite() throws Throwable {
+    doHighlightingTest("nested-composite.rng");
+  }
+
+  public void testXsltSchema() throws Throwable {
+    doHighlightingTest("xslt.rng");
+  }
+
+  public void testXslFoRncSchema() throws Throwable {
+    doHighlightingTest("rnc/fo/fo-test.xml");
+  }
+
+  public void testFoFromDocbook() throws Throwable {
+    doHighlightingTest("rnc/fo/mybook.fo");
+  }
+
+  public void testDocBookSchema() throws Throwable {
+    doHighlightingTest("docbook.rng");
+  }
+
+  public void testHtml5() throws Throwable {
+    doHighlightingTest("Html5.xml");
+  }
+
+  public void testHtml5_2() throws Throwable {
+    doHighlightingTest("Html5_2.xml");
+  }
+}
diff --git a/xml/relaxng/test/org/intellij/plugins/relaxNG/RngXmlValidationTest.java b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngXmlValidationTest.java
new file mode 100644
index 0000000..1472e0a
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/relaxNG/RngXmlValidationTest.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2007 Sascha Weinreuter
+ *
+ * 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.
+ */
+
+package org.intellij.plugins.relaxNG;
+
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.openapi.application.ApplicationManager;
+import org.intellij.plugins.testUtil.CopyFile;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: sweinreuter
+ * Date: 25.07.2007
+ */
+public class RngXmlValidationTest extends HighlightingTestBase {
+
+  public void testValidDocument() throws Throwable {
+    doTest("xslt.rng");
+  }
+
+  @CopyFile("broken.rng")
+  public void testPartiallyBrokenRng() throws Throwable {
+    myTestFixture.testHighlighting("broken-rng.xml");
+  }
+
+  @CopyFile("broken.rnc")
+  public void testPartiallyBrokenRnc() throws Throwable {
+    myTestFixture.testHighlighting("broken-rnc.xml");
+  }
+
+  @CopyFile("entity-included.xml")
+  public void testEntityRef1() throws Throwable {
+    doTest("entity-test-1.xml");
+  }
+
+  @CopyFile("entity-included.xml")
+  public void testEntityRef2() throws Throwable {
+    doTest("entity-test-2.xml");
+  }
+
+  public void testEntityRef3() throws Throwable {
+    doTest("entity-test-3.xml");
+  }
+
+  public void testTextContent() throws Throwable {
+    doTest("text-content.xml");
+  }
+
+  public void testCDATA() throws Throwable {
+    doTest("cdata-test.xml");
+  }
+
+  public void testMissingElement() throws Throwable {
+    doTest("missing-element.xml");
+  }
+
+  public void testInvalidElement() throws Throwable {
+    doTest("invalid-element.xml");
+  }
+
+  public void testInvalidElementRnc() throws Throwable {
+    doTest("invalid-element-rnc.xml");
+  }
+
+  public void testMissingElementRnc() throws Throwable {
+    doTest("missing-element-rnc.xml");
+  }
+
+  private void doTest(String name) throws Throwable {
+    doExternalToolHighlighting(name);
+  }
+
+  protected void init() {
+    super.init();
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        final ExternalResourceManager mgr = ExternalResourceManager.getInstance();
+        mgr.addResource("urn:test:simple.rng", toAbsolutePath("validation/simple.rng"));
+        mgr.addResource("urn:test:simple.rnc", toAbsolutePath("validation/simple.rnc"));
+        //mgr.addResource("http://www.w3.org/1999/XSL/Transform", toAbsolutePath("validation/relaxng.rng"));
+      }
+    });
+  }
+
+  public String getTestDataPath() {
+    return "validation";
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/testUtil/CopyFile.java b/xml/relaxng/test/org/intellij/plugins/testUtil/CopyFile.java
new file mode 100644
index 0000000..a1d8389
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/testUtil/CopyFile.java
@@ -0,0 +1,18 @@
+package org.intellij.plugins.testUtil;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 27.03.2008
+*/
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.METHOD})
+public @interface CopyFile {
+  String[] value();
+  String target() default "";
+}
diff --git a/xml/relaxng/test/org/intellij/plugins/testUtil/IdeaCodeInsightTestCase.java b/xml/relaxng/test/org/intellij/plugins/testUtil/IdeaCodeInsightTestCase.java
new file mode 100644
index 0000000..ac42543
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/testUtil/IdeaCodeInsightTestCase.java
@@ -0,0 +1,13 @@
+package org.intellij.plugins.testUtil;
+
+import com.intellij.testFramework.fixtures.CodeInsightTestFixture;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 27.03.2008
+*/
+public interface IdeaCodeInsightTestCase {
+  String getTestDataPath();
+  CodeInsightTestFixture getFixture();
+}
\ No newline at end of file
diff --git a/xml/relaxng/test/org/intellij/plugins/testUtil/ResourceUtil.java b/xml/relaxng/test/org/intellij/plugins/testUtil/ResourceUtil.java
new file mode 100644
index 0000000..60960c9
--- /dev/null
+++ b/xml/relaxng/test/org/intellij/plugins/testUtil/ResourceUtil.java
@@ -0,0 +1,56 @@
+package org.intellij.plugins.testUtil;
+
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import junit.framework.TestCase;
+import org.intellij.plugins.relaxNG.HighlightingTestBase;
+import org.junit.Assert;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.regex.Pattern;
+
+/*
+* Created by IntelliJ IDEA.
+* User: sweinreuter
+* Date: 27.03.2008
+*/
+public class ResourceUtil {
+  public static <TC extends TestCase & IdeaCodeInsightTestCase> void copyFiles(TC test) throws IOException {
+    try {
+      final Method method = test.getClass().getMethod(test.getName());
+      CopyFile annotation = method.getAnnotation(CopyFile.class);
+      if (annotation == null) {
+        if ((annotation = method.getDeclaringClass().getAnnotation(CopyFile.class)) == null) {
+          return;
+        }
+      }
+
+      final String[] patterns = annotation.value();
+      for (String pattern : patterns) {
+        final File root = new File(HighlightingTestBase.getTestDataBasePath() + test.getTestDataPath());
+        final ArrayList<File> files = new ArrayList<File>();
+        FileUtil.collectMatchedFiles(root, Pattern.compile(FileUtil.convertAntToRegexp(pattern)), files);
+
+        final File temp = new File(test.getFixture().getTempDirPath());
+        final String target = annotation.target();
+        if (target.length() > 0) {
+          Assert.assertEquals(files.size(), 1);
+          final File destFile = new File(temp, FileUtil.getRelativePath(root, new File(root, target)));
+          FileUtil.copy(files.get(0), destFile);
+          LocalFileSystem.getInstance().refreshAndFindFileByIoFile(destFile);
+        } else {
+          for (File file : files) {
+            final File destFile = new File(temp, FileUtil.getRelativePath(root, file));
+            FileUtil.copy(file, destFile);
+            LocalFileSystem.getInstance().refreshAndFindFileByIoFile(destFile);
+          }
+        }
+      }
+    } catch (NoSuchMethodException e) {
+      Assert.fail(e.getMessage());
+    }
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/attr-combine-test.rng b/xml/relaxng/testData/completion/attr-combine-test.rng
new file mode 100644
index 0000000..f016995
--- /dev/null
+++ b/xml/relaxng/testData/completion/attr-combine-test.rng
@@ -0,0 +1,27 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="attr-combine-test.rng">
+  <start>
+    <element name="start">
+      <ref name="attributes" />
+    </element>
+  </start>
+
+  <define name="attributes" combine="choice">
+    <attribute name="bar">
+      <value>2.0</value>
+    </attribute>
+  </define>
+
+  <define name="attributes">
+    <attribute name="foo">
+      <value>1.0</value>
+    </attribute>
+  </define>
+<!--
+
+  <define name="attributes">
+    <attribute name="foo">
+      <value>1.0</value>
+    </attribute>
+  </define>
+-->
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/attr-combine.xml b/xml/relaxng/testData/completion/attr-combine.xml
new file mode 100644
index 0000000..1c0fe87
--- /dev/null
+++ b/xml/relaxng/testData/completion/attr-combine.xml
@@ -0,0 +1 @@
+<start xmlns="attr-combine-test.rng" <caret>/>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/attribute-completion-1.xml b/xml/relaxng/testData/completion/attribute-completion-1.xml
new file mode 100644
index 0000000..44874e2
--- /dev/null
+++ b/xml/relaxng/testData/completion/attribute-completion-1.xml
@@ -0,0 +1 @@
+<completion-1 xmlns="attribute-completion.rng" <caret>/>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/attribute-completion-1_after.xml b/xml/relaxng/testData/completion/attribute-completion-1_after.xml
new file mode 100644
index 0000000..5d3fc08
--- /dev/null
+++ b/xml/relaxng/testData/completion/attribute-completion-1_after.xml
@@ -0,0 +1 @@
+<completion-1 xmlns="attribute-completion.rng" foo=""/>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/attribute-completion-2.xml b/xml/relaxng/testData/completion/attribute-completion-2.xml
new file mode 100644
index 0000000..684970d
--- /dev/null
+++ b/xml/relaxng/testData/completion/attribute-completion-2.xml
@@ -0,0 +1 @@
+<completion-2 xmlns="attribute-completion.rng" foo="<caret>"/>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/attribute-completion-2_after.xml b/xml/relaxng/testData/completion/attribute-completion-2_after.xml
new file mode 100644
index 0000000..7d5534a
--- /dev/null
+++ b/xml/relaxng/testData/completion/attribute-completion-2_after.xml
@@ -0,0 +1 @@
+<completion-2 xmlns="attribute-completion.rng" foo="1.0"/>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/attribute-completion-3.xml b/xml/relaxng/testData/completion/attribute-completion-3.xml
new file mode 100644
index 0000000..02d57c6
--- /dev/null
+++ b/xml/relaxng/testData/completion/attribute-completion-3.xml
@@ -0,0 +1 @@
+<completion-3 xmlns="attribute-completion.rng" foo="<caret>"/>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/attribute-completion-4.xml b/xml/relaxng/testData/completion/attribute-completion-4.xml
new file mode 100644
index 0000000..09f659e
--- /dev/null
+++ b/xml/relaxng/testData/completion/attribute-completion-4.xml
@@ -0,0 +1 @@
+<completion-4 xmlns="attribute-completion.rng" foo="<caret>"/>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/attribute-completion-5.xml b/xml/relaxng/testData/completion/attribute-completion-5.xml
new file mode 100644
index 0000000..00b5838
--- /dev/null
+++ b/xml/relaxng/testData/completion/attribute-completion-5.xml
@@ -0,0 +1 @@
+<completion-5 xmlns="attribute-completion.rng" <caret>/>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/attribute-completion-6.xml b/xml/relaxng/testData/completion/attribute-completion-6.xml
new file mode 100644
index 0000000..228a258
--- /dev/null
+++ b/xml/relaxng/testData/completion/attribute-completion-6.xml
@@ -0,0 +1 @@
+<completion-6 xmlns="attribute-completion.rng" xmlns:p="p" p:<caret>/>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/attribute-completion.rng b/xml/relaxng/testData/completion/attribute-completion.rng
new file mode 100644
index 0000000..91af29c
--- /dev/null
+++ b/xml/relaxng/testData/completion/attribute-completion.rng
@@ -0,0 +1,49 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="attribute-completion.rng">
+  <start>
+    <choice>
+      <element name="completion-1">
+        <attribute name="foo" />
+      </element>
+
+      <element name="completion-2">
+        <attribute name="foo">
+          <value>1.0</value>
+        </attribute>
+      </element>
+
+      <element name="completion-3">
+        <attribute name="foo">
+          <choice>
+            <value>1.0</value>
+            <value>2.0</value>
+          </choice>
+        </attribute>
+      </element>
+
+      <element name="completion-4">
+        <choice>
+          <attribute name="foo">
+            <value>1.0</value>
+          </attribute>
+          <attribute name="foo">
+            <value>2.0</value>
+          </attribute>
+        </choice>
+      </element>
+
+      <element name="completion-5">
+        <choice>
+          <attribute name="foo"/>
+          <attribute name="bar"/>
+        </choice>
+      </element>
+
+      <element name="completion-6" xmlns:p="p">
+        <choice>
+          <attribute name="p:foo"/>
+          <attribute name="p:bar"/>
+        </choice>
+      </element>
+    </choice>
+  </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/element-completion-1.xml b/xml/relaxng/testData/completion/element-completion-1.xml
new file mode 100644
index 0000000..1c82282
--- /dev/null
+++ b/xml/relaxng/testData/completion/element-completion-1.xml
@@ -0,0 +1,3 @@
+<completion-1 xmlns="element-completion.rng">
+  <<caret>
+</completion-1>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/element-completion-2.xml b/xml/relaxng/testData/completion/element-completion-2.xml
new file mode 100644
index 0000000..eea1522
--- /dev/null
+++ b/xml/relaxng/testData/completion/element-completion-2.xml
@@ -0,0 +1,3 @@
+<completion-2 xmlns="element-completion.rng">
+  <<caret>
+</completion-2>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/element-completion-3.xml b/xml/relaxng/testData/completion/element-completion-3.xml
new file mode 100644
index 0000000..2fd5475
--- /dev/null
+++ b/xml/relaxng/testData/completion/element-completion-3.xml
@@ -0,0 +1,3 @@
+<completion-3 xmlns="element-completion.rng">
+  <b<caret>
+</completion-3>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/element-completion-3_after.xml b/xml/relaxng/testData/completion/element-completion-3_after.xml
new file mode 100644
index 0000000..fda6ff0
--- /dev/null
+++ b/xml/relaxng/testData/completion/element-completion-3_after.xml
@@ -0,0 +1,3 @@
+<completion-3 xmlns="element-completion.rng">
+  <baz
+</completion-3>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/element-completion-root.xml b/xml/relaxng/testData/completion/element-completion-root.xml
new file mode 100644
index 0000000..aeff445
--- /dev/null
+++ b/xml/relaxng/testData/completion/element-completion-root.xml
@@ -0,0 +1,2 @@
+<<caret> xmlns="element-completion.rng">
+  
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/element-completion.rng b/xml/relaxng/testData/completion/element-completion.rng
new file mode 100644
index 0000000..ec77e74
--- /dev/null
+++ b/xml/relaxng/testData/completion/element-completion.rng
@@ -0,0 +1,33 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="element-completion.rng">
+  <start>
+    <choice>
+      <element name="x"><empty /></element>
+      
+      <element name="completion-1">
+        <choice>
+          <element name="foo"><empty /></element>
+          <element><anyName /><empty /></element>
+        </choice>
+      </element>
+
+      <element name="completion-2">
+        <choice>
+          <element name="foo"><empty /></element>
+          <element name="bar"><empty /></element>
+        </choice>
+        <element name="baz"><empty /></element>
+      </element>
+
+      <element name="completion-3">
+        <element name="baz">
+          <optional>
+            <attribute name="space">
+              <value>preserve</value>
+            </attribute>            
+          </optional>
+          <empty />
+        </element>
+      </element>
+    </choice>
+  </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_1.xml b/xml/relaxng/testData/completion/html5_1.xml
new file mode 100644
index 0000000..7ee0c6e
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_1.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+  <meta conten<caret>>
+</head>
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_10.xml b/xml/relaxng/testData/completion/html5_10.xml
new file mode 100644
index 0000000..e6d1b03
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_10.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<canv<caret>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_10_after.xml b/xml/relaxng/testData/completion/html5_10_after.xml
new file mode 100644
index 0000000..a726437
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_10_after.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<canvas
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_11.xml b/xml/relaxng/testData/completion/html5_11.xml
new file mode 100644
index 0000000..e0f811a
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_11.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+  <script typ<caret>>
+</head>
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_11_after.xml b/xml/relaxng/testData/completion/html5_11_after.xml
new file mode 100644
index 0000000..2b90d0d
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_11_after.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+  <script type="">
+</head>
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_12.xml b/xml/relaxng/testData/completion/html5_12.xml
new file mode 100644
index 0000000..4e121da
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_12.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+  <script asy<caret>>
+</head>
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_12_after.xml b/xml/relaxng/testData/completion/html5_12_after.xml
new file mode 100644
index 0000000..fa4d816
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_12_after.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+  <script async="">
+</head>
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_13.xml b/xml/relaxng/testData/completion/html5_13.xml
new file mode 100644
index 0000000..ad102e4
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_13.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<input checke<caret>>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_13_after.xml b/xml/relaxng/testData/completion/html5_13_after.xml
new file mode 100644
index 0000000..3eb93b5
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_13_after.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<input checked="<caret>">
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_14.xml b/xml/relaxng/testData/completion/html5_14.xml
new file mode 100644
index 0000000..e4bab58
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_14.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<input patte<caret>>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_14_after.xml b/xml/relaxng/testData/completion/html5_14_after.xml
new file mode 100644
index 0000000..7827fa8
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_14_after.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<input pattern="">
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_15.xml b/xml/relaxng/testData/completion/html5_15.xml
new file mode 100644
index 0000000..04168a9
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_15.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<input disa<caret>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_15_after.xml b/xml/relaxng/testData/completion/html5_15_after.xml
new file mode 100644
index 0000000..a3c6fd6
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_15_after.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<input disabled="<caret>"
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_16.xml b/xml/relaxng/testData/completion/html5_16.xml
new file mode 100644
index 0000000..5dce55c
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_16.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<input type="dat<caret>"
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_16_after.xml b/xml/relaxng/testData/completion/html5_16_after.xml
new file mode 100644
index 0000000..7ca7f76
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_16_after.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<input type="date<caret>"
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_17.xml b/xml/relaxng/testData/completion/html5_17.xml
new file mode 100644
index 0000000..153ff21
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_17.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<command radiogr<caret>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_17_after.xml b/xml/relaxng/testData/completion/html5_17_after.xml
new file mode 100644
index 0000000..0f1e214
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_17_after.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<command radiogroup=""
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_1_after.xml b/xml/relaxng/testData/completion/html5_1_after.xml
new file mode 100644
index 0000000..4d5adf5
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_1_after.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+  <meta content="<caret>">
+</head>
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_2.xml b/xml/relaxng/testData/completion/html5_2.xml
new file mode 100644
index 0000000..e6a98bc5
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_2.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+  <meta http-eq<caret>>
+</head>
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_2_after.xml b/xml/relaxng/testData/completion/html5_2_after.xml
new file mode 100644
index 0000000..3a719f2
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_2_after.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+  <meta http-equiv="">
+</head>
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_3.xml b/xml/relaxng/testData/completion/html5_3.xml
new file mode 100644
index 0000000..9f47b73
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_3.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+  <meta charse<caret>>
+</head>
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_3_after.xml b/xml/relaxng/testData/completion/html5_3_after.xml
new file mode 100644
index 0000000..75a927e
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_3_after.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+  <meta charset="">
+</head>
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_4.xml b/xml/relaxng/testData/completion/html5_4.xml
new file mode 100644
index 0000000..df17a53
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_4.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+  <meta styl<caret>>
+</head>
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_4_after.xml b/xml/relaxng/testData/completion/html5_4_after.xml
new file mode 100644
index 0000000..1ade816
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_4_after.xml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+  <meta style="">
+</head>
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_5.xml b/xml/relaxng/testData/completion/html5_5.xml
new file mode 100644
index 0000000..91bae3a
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_5.xml
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+  <a>
+    <addre<caret>
+  </a>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_5_after.xml b/xml/relaxng/testData/completion/html5_5_after.xml
new file mode 100644
index 0000000..c3923e6
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_5_after.xml
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+  <a>
+    <address
+  </a>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_6.xml b/xml/relaxng/testData/completion/html5_6.xml
new file mode 100644
index 0000000..210a126
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_6.xml
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+  <a>
+    <stro<caret>
+  </a>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_6_after.xml b/xml/relaxng/testData/completion/html5_6_after.xml
new file mode 100644
index 0000000..2caea78
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_6_after.xml
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+  <a>
+    <strong
+  </a>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_7.xml b/xml/relaxng/testData/completion/html5_7.xml
new file mode 100644
index 0000000..255e7ad
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_7.xml
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<ins>
+  <stro<caret>
+</ins>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_7_after.xml b/xml/relaxng/testData/completion/html5_7_after.xml
new file mode 100644
index 0000000..50cb29e
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_7_after.xml
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<ins>
+  <strong
+</ins>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_8.xml b/xml/relaxng/testData/completion/html5_8.xml
new file mode 100644
index 0000000..4a66c67
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_8.xml
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<output>
+  <obj<caret>
+</output>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_8_after.xml b/xml/relaxng/testData/completion/html5_8_after.xml
new file mode 100644
index 0000000..36bfa3a
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_8_after.xml
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<output>
+  <object
+</output>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_9.xml b/xml/relaxng/testData/completion/html5_9.xml
new file mode 100644
index 0000000..e86d83d
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_9.xml
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<canvas>
+  <sect<caret>
+</canvas>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/html5_9_after.xml b/xml/relaxng/testData/completion/html5_9_after.xml
new file mode 100644
index 0000000..b6e64f7
--- /dev/null
+++ b/xml/relaxng/testData/completion/html5_9_after.xml
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+  <title></title>
+</head>
+<body>
+<canvas>
+  <section
+</canvas>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/rnc/complete-keyword-1.rnc b/xml/relaxng/testData/completion/rnc/complete-keyword-1.rnc
new file mode 100644
index 0000000..e161a8b
--- /dev/null
+++ b/xml/relaxng/testData/completion/rnc/complete-keyword-1.rnc
@@ -0,0 +1 @@
+s<caret>
diff --git a/xml/relaxng/testData/completion/rnc/complete-keyword-1_after.rnc b/xml/relaxng/testData/completion/rnc/complete-keyword-1_after.rnc
new file mode 100644
index 0000000..88afc7a
--- /dev/null
+++ b/xml/relaxng/testData/completion/rnc/complete-keyword-1_after.rnc
@@ -0,0 +1 @@
+start 
diff --git a/xml/relaxng/testData/completion/rnc/complete-keyword-2.rnc b/xml/relaxng/testData/completion/rnc/complete-keyword-2.rnc
new file mode 100644
index 0000000..ae6cffd
--- /dev/null
+++ b/xml/relaxng/testData/completion/rnc/complete-keyword-2.rnc
@@ -0,0 +1 @@
+start = gr<caret>
diff --git a/xml/relaxng/testData/completion/rnc/complete-keyword-2_after.rnc b/xml/relaxng/testData/completion/rnc/complete-keyword-2_after.rnc
new file mode 100644
index 0000000..811f383
--- /dev/null
+++ b/xml/relaxng/testData/completion/rnc/complete-keyword-2_after.rnc
@@ -0,0 +1 @@
+start = grammar 
diff --git a/xml/relaxng/testData/completion/rnc/complete-ref-1.rnc b/xml/relaxng/testData/completion/rnc/complete-ref-1.rnc
new file mode 100644
index 0000000..6a59f8e
--- /dev/null
+++ b/xml/relaxng/testData/completion/rnc/complete-ref-1.rnc
@@ -0,0 +1,2 @@
+start = s<caret>
+start.element = element foo { empty }
diff --git a/xml/relaxng/testData/completion/rnc/complete-ref-1_after.rnc b/xml/relaxng/testData/completion/rnc/complete-ref-1_after.rnc
new file mode 100644
index 0000000..8856714
--- /dev/null
+++ b/xml/relaxng/testData/completion/rnc/complete-ref-1_after.rnc
@@ -0,0 +1,2 @@
+start = start.element
+start.element = element foo { empty }
diff --git a/xml/relaxng/testData/completion/rnc/complete-ref-2.rnc b/xml/relaxng/testData/completion/rnc/complete-ref-2.rnc
new file mode 100644
index 0000000..f00f907
--- /dev/null
+++ b/xml/relaxng/testData/completion/rnc/complete-ref-2.rnc
@@ -0,0 +1,4 @@
+start = s<caret>
+div {
+  start.element = element foo { empty }
+}
diff --git a/xml/relaxng/testData/completion/rnc/complete-ref-2_after.rnc b/xml/relaxng/testData/completion/rnc/complete-ref-2_after.rnc
new file mode 100644
index 0000000..ac7cc00
--- /dev/null
+++ b/xml/relaxng/testData/completion/rnc/complete-ref-2_after.rnc
@@ -0,0 +1,4 @@
+start = start.element
+div {
+  start.element = element foo { empty }
+}
diff --git a/xml/relaxng/testData/completion/rnc/complete-ref-3.rnc b/xml/relaxng/testData/completion/rnc/complete-ref-3.rnc
new file mode 100644
index 0000000..c1e8c1e
--- /dev/null
+++ b/xml/relaxng/testData/completion/rnc/complete-ref-3.rnc
@@ -0,0 +1,7 @@
+include "included.rnc" {
+  i<caret> = element foo { empty }
+}
+start = istart.element
+div {
+  istart.element = element foo { empty }
+}
diff --git a/xml/relaxng/testData/completion/rnc/complete-ref-3_after.rnc b/xml/relaxng/testData/completion/rnc/complete-ref-3_after.rnc
new file mode 100644
index 0000000..86ebbf2
--- /dev/null
+++ b/xml/relaxng/testData/completion/rnc/complete-ref-3_after.rnc
@@ -0,0 +1,7 @@
+include "included.rnc" {
+  included.start.element = element foo { empty }
+}
+start = istart.element
+div {
+  istart.element = element foo { empty }
+}
diff --git a/xml/relaxng/testData/completion/rnc/complete-ref-4.rnc b/xml/relaxng/testData/completion/rnc/complete-ref-4.rnc
new file mode 100644
index 0000000..f0900c5
--- /dev/null
+++ b/xml/relaxng/testData/completion/rnc/complete-ref-4.rnc
@@ -0,0 +1,7 @@
+include "included.rnc" {
+  included.start.element = s<caret>
+}
+start = start.element
+div {
+  start.element = element foo { empty }
+}
diff --git a/xml/relaxng/testData/completion/rnc/complete-ref-4_after.rnc b/xml/relaxng/testData/completion/rnc/complete-ref-4_after.rnc
new file mode 100644
index 0000000..9e87d86
--- /dev/null
+++ b/xml/relaxng/testData/completion/rnc/complete-ref-4_after.rnc
@@ -0,0 +1,7 @@
+include "included.rnc" {
+  included.start.element = start.element
+}
+start = start.element
+div {
+  start.element = element foo { empty }
+}
diff --git a/xml/relaxng/testData/completion/rnc/included.rnc b/xml/relaxng/testData/completion/rnc/included.rnc
new file mode 100644
index 0000000..72cd1a7
--- /dev/null
+++ b/xml/relaxng/testData/completion/rnc/included.rnc
@@ -0,0 +1,3 @@
+div {
+  included.start.element = element foo { empty }
+}
diff --git a/xml/relaxng/testData/completion/rng/complete-ref-1.rng b/xml/relaxng/testData/completion/rng/complete-ref-1.rng
new file mode 100644
index 0000000..b9a9b4d
--- /dev/null
+++ b/xml/relaxng/testData/completion/rng/complete-ref-1.rng
@@ -0,0 +1,7 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <start>
+    <ref name="<caret>" />
+  </start>
+
+  <define name="start.element" />
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/rng/complete-ref-1_after.rng b/xml/relaxng/testData/completion/rng/complete-ref-1_after.rng
new file mode 100644
index 0000000..59dfbc4
--- /dev/null
+++ b/xml/relaxng/testData/completion/rng/complete-ref-1_after.rng
@@ -0,0 +1,7 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <start>
+    <ref name="start.element" />
+  </start>
+
+  <define name="start.element" />
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/rng/complete-ref-2.rng b/xml/relaxng/testData/completion/rng/complete-ref-2.rng
new file mode 100644
index 0000000..7794f90
--- /dev/null
+++ b/xml/relaxng/testData/completion/rng/complete-ref-2.rng
@@ -0,0 +1,9 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <start>
+    <ref name="<caret>" />
+  </start>
+
+  <div>
+    <define name="start.element" />
+  </div>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/rng/complete-ref-2_after.rng b/xml/relaxng/testData/completion/rng/complete-ref-2_after.rng
new file mode 100644
index 0000000..74b4462
--- /dev/null
+++ b/xml/relaxng/testData/completion/rng/complete-ref-2_after.rng
@@ -0,0 +1,9 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <start>
+    <ref name="start.element" />
+  </start>
+
+  <div>
+    <define name="start.element" />
+  </div>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/rng/complete-ref-3.rng b/xml/relaxng/testData/completion/rng/complete-ref-3.rng
new file mode 100644
index 0000000..4c73fff
--- /dev/null
+++ b/xml/relaxng/testData/completion/rng/complete-ref-3.rng
@@ -0,0 +1,13 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <include href="included.rng">
+    <define name="<caret>" />
+  </include>
+
+  <start>
+    <ref name="start.element" />
+  </start>
+
+  <div>
+    <define name="start.element" />
+  </div>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/rng/complete-ref-3_after.rng b/xml/relaxng/testData/completion/rng/complete-ref-3_after.rng
new file mode 100644
index 0000000..59c8540
--- /dev/null
+++ b/xml/relaxng/testData/completion/rng/complete-ref-3_after.rng
@@ -0,0 +1,13 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <include href="included.rng">
+    <define name="included.start.element" />
+  </include>
+
+  <start>
+    <ref name="start.element" />
+  </start>
+
+  <div>
+    <define name="start.element" />
+  </div>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/rng/complete-ref-4.rng b/xml/relaxng/testData/completion/rng/complete-ref-4.rng
new file mode 100644
index 0000000..ba2d004
--- /dev/null
+++ b/xml/relaxng/testData/completion/rng/complete-ref-4.rng
@@ -0,0 +1,15 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <include href="included.rng">
+    <define name="included.start.element">
+      <ref name="s<caret>" />
+    </define>
+  </include>
+
+  <start>
+    <ref name="start.element" />
+  </start>
+
+  <div>
+    <define name="start.element" />
+  </div>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/rng/complete-ref-4_after.rng b/xml/relaxng/testData/completion/rng/complete-ref-4_after.rng
new file mode 100644
index 0000000..58e1af6
--- /dev/null
+++ b/xml/relaxng/testData/completion/rng/complete-ref-4_after.rng
@@ -0,0 +1,15 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <include href="included.rng">
+    <define name="included.start.element">
+      <ref name="start.element" />
+    </define>
+  </include>
+
+  <start>
+    <ref name="start.element" />
+  </start>
+
+  <div>
+    <define name="start.element" />
+  </div>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/completion/rng/included.rng b/xml/relaxng/testData/completion/rng/included.rng
new file mode 100644
index 0000000..1424b69
--- /dev/null
+++ b/xml/relaxng/testData/completion/rng/included.rng
@@ -0,0 +1,5 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <div>
+    <define name="included.start.element" />
+  </div>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/Html5.xml b/xml/relaxng/testData/highlighting/Html5.xml
new file mode 100644
index 0000000..bb5ffea
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/Html5.xml
@@ -0,0 +1,100 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+
+
+<meta charset="utf-8"/>
+<meta name="viewport" content="width=620"/>
+<title>HTML5 Demo: Video</title>
+<!--<link rel="stylesheet" href="/css/html5demos.css" type="text/css">-->
+<!--<script src="/js/h5utils.js"></script>--></head><body>
+<section id="wrapper">
+    <header>
+      <h1>Video &copy;</h1>
+    </header>
+<article>
+  <video tabindex="0">
+    <source src="assets/dizzy.mp4"/>
+    <source src="assets/dizzy.ogv"/>
+  </video>
+  <p id="controls">
+    <input id="play" value="play" type="button"/>
+    <span id="position">00:00</span> / <span id="duration">loading...</span>
+  </p>
+  <p>Note that (at time of writing) <a href="http://webkit.org/" title="The WebKit Open Source Project">Webkit nightly</a> supports full screen mode, which will add a button above.</p>
+</article>
+<script>
+var video = document.querySelector('video'),
+    togglePlay = document.querySelector('#play'),
+    position = document.querySelector('#position'),
+    ready = false,
+    controls = document.querySelector('#controls'),
+    fullscreen = null;
+
+addEvent(togglePlay, 'click', function () {
+  if (ready) {
+    video.playbackRate = 0.5;
+    if (video.paused) {
+      if (video.ended) video.currentTime = 0;
+      video.play();
+      this.value = "pause";
+    } else {
+      video.pause();
+      this.value = "play";
+    }
+  }
+});
+
+addEvent(video, 'timeupdate', function () {
+  position.innerHTML = asTime(this.currentTime);
+});
+
+addEvent(video, 'ended', function () {
+  togglePlay.value = "play";
+});
+
+addEvent(video, 'canplay', function () {
+  video.muted = true;
+  ready = true;
+  document.querySelector('#duration').innerHTML = asTime(this.duration);
+
+  // note: .webkitSupportsFullscreen is false while the video is loading, so we bind in to the canplay event
+  if (video.webkitSupportsFullscreen) {
+    fullscreen = document.createElement('input');
+    fullscreen.setAttribute('type', 'button');
+    fullscreen.setAttribute('value', 'fullscreen');
+    controls.insertBefore(fullscreen, controls.firstChild);
+    addEvent(fullscreen, 'click', function () {
+      video.webkitEnterFullScreen();
+    });
+  }
+
+});
+
+function asTime(t) {
+  t = Math.round(t);
+  var s = t % 60;
+  var m = Math.round(t / 60);
+  
+  return two(m) + ':' + two(s);
+}
+
+function two(s) {
+  s += "";
+  if (s.length == 2) s = "0" + s;
+  return s;
+}
+</script>
+    <footer><a href="/">HTML5 demos</a>/<a id="built" href="http://twitter.com/rem">@rem built this</a>/</footer> 
+</section>
+<a href="http://github.com/remy/html5demos"><img style="position: absolute; top: 0pt; left: 0pt; border: 0pt none;" src="http://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png" alt="Fork me on GitHub"/></a>
+<script>
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script><script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>
+<script>
+try {
+var pageTracker = _gat._getTracker("UA-1656750-18");
+pageTracker._trackPageview();
+} catch(err) {}</script>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/Html5_2.xml b/xml/relaxng/testData/highlighting/Html5_2.xml
new file mode 100644
index 0000000..b35a6a5
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/Html5_2.xml
@@ -0,0 +1,90 @@
+<html xmlns="http://www.w3.org/1999/xhtml/html5">
+<head>
+
+
+<meta charset="utf-8"/>
+<meta name="viewport" content="width=620"/>
+<title>HTML5 Demo: Canvas</title>
+<!--<link rel="stylesheet" href="/css/html5demos.css" type="text/css">-->
+</head><body>
+<section id="wrapper">
+    <header>
+      <h1>Canvas</h1>
+    </header>
+    <article><canvas width="300" height="100"></canvas></article>
+<script>
+
+buildSpinner({ x : 50, y : 50, size : 20, degrees : 30 });
+
+function buildSpinner(data) {
+  
+  var canvas = document.createElement('canvas');
+  canvas.height = 100;
+  canvas.width = 300;
+  document.getElementsByTagName('article')[0].appendChild(canvas);
+  var ctx = canvas.getContext("2d"),
+    i = 0, degrees = data.degrees, loops = 0, degreesList = [];
+    
+  for (i = 0; i == degrees; i++) {
+    degreesList.push(i);
+  }
+  
+  // reset
+  i = 0;
+  
+  // so I can kill it later
+  window.canvasTimer = setInterval(draw, 1000/degrees);  
+
+  function reset() {
+    ctx.clearRect(0,0,100,100); // clear canvas
+    
+    var left = degreesList.slice(0, 1);
+    var right = degreesList.slice(1, degreesList.length);
+    degreesList = right.concat(left);
+  }
+  
+  function draw() {
+    var c, s, e;
+
+    var d = 0;
+
+    if (i == 0) {
+      reset();
+    }
+
+    ctx.save();
+
+    d = degreesList[i];
+    c = Math.floor(255/degrees*i);
+    ctx.strokeStyle = 'rgb(' + c + ', ' + c + ', ' + c + ')';
+    ctx.lineWidth = data.size;
+    ctx.beginPath();
+    s = Math.floor(360/degrees*(d));
+    e = Math.floor(360/degrees*(d+1)) - 1;
+
+    ctx.arc(data.x, data.y, data.size, (Math.PI/180)*s, (Math.PI/180)*e, false);
+    ctx.stroke();
+
+    ctx.restore();
+
+    i++;
+    if (i >= degrees) {
+      i = 0;
+    }
+  }  
+}
+</script>
+    <footer><a href="/">HTML5 demos</a>/<a id="built" href="http://twitter.com/rem">@rem built this</a></footer> 
+</section>
+<a href="http://github.com/remy/html5demos"><img style="position: absolute; top: 0pt; left: 0pt; border: 0pt none;" src="http://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png" alt="Fork me on GitHub"/></a>
+<script>
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script><script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>
+<script>
+try {
+var pageTracker = _gat._getTracker("UA-1656750-18");
+pageTracker._trackPageview();
+} catch(err) {}</script>
+</body>
+</html>
diff --git a/xml/relaxng/testData/highlighting/attachment-filter.rng b/xml/relaxng/testData/highlighting/attachment-filter.rng
new file mode 100644
index 0000000..2927476
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/attachment-filter.rng
@@ -0,0 +1,149 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+         ns="urn:intelliForm:AttachmentFilter"
+         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
+    >
+  <start>
+    <ref name="filter-definition" />
+  </start>
+
+  <define name="filter-definition">
+    <element>
+      <nsName ns="urn:intelliForm:AttachmentFilter" />
+      <ref name="toplevel-filter" />
+    </element>
+  </define>
+
+  <define name="toplevel-filter">
+    <choice>
+      <element name="all">
+        <empty />
+      </element>
+      
+      <ref name="filter" />
+    </choice>
+  </define>
+
+  <define name="filter">
+    <choice>
+      <ref name="and-filter" />
+      <ref name="or-filter" />
+      <ref name="not-filter" />
+
+      <element name="filter">
+        <choice>
+          <ref name="implementation-filter" />
+          <ref name="beanshell-filter" />
+        </choice>
+      </element>
+
+      <ref name="property-filter" />
+
+      <element name="group-filter">
+        <attribute name="id" />
+      </element>
+
+      <element name="default-filter">
+        <empty />
+      </element>
+
+      <ref name="size-filter" />
+    </choice>
+  </define>
+
+  <define name="size-filter">
+    <element name="size-filter">
+      <choice>
+        <group>
+          <ref name="min.attr" />
+          <ref name="max.attr" />
+        </group>
+        <ref name="min.attr" />
+        <ref name="max.attr" />
+      </choice>
+
+      <optional>
+        <attribute name="unit">
+          <choice>
+            <value>b</value>
+            <value>kb</value>
+            <value>mb</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+
+  <define name="max.attr">
+    <attribute name="max">
+      <data type="decimal" />
+    </attribute>
+  </define>
+  <define name="min.attr">
+    <attribute name="min">
+      <data type="decimal" />
+    </attribute>
+  </define>
+
+  <define name="property-filter">
+    <element name="property-filter">
+      <attribute name="name">
+        <choice>
+          <value>id</value>
+          <value>name</value>
+          <value>content-type</value>
+        </choice>
+      </attribute>
+
+      <choice>
+        <attribute name="value" />
+        <element name="value">
+          <text />
+        </element>
+      </choice>
+    </element>
+  </define>
+
+  <define name="beanshell-filter">
+    <element name="expression">
+      <text />
+    </element>
+  </define>
+
+  <define name="implementation-filter">
+    <group>
+      <attribute name="implementation" />
+      <ref name="any" />
+    </group>
+  </define>
+
+  <define name="not-filter">
+    <element name="not">
+      <ref name="filter" />
+    </element>
+  </define>
+
+  <define name="or-filter">
+    <element name="or">
+      <oneOrMore>
+        <ref name="filter" />
+      </oneOrMore>
+    </element>
+  </define>
+
+  <define name="and-filter">
+    <element name="and">
+      <oneOrMore>
+        <ref name="filter" />
+      </oneOrMore>
+    </element>
+  </define>
+
+  <define name="any">
+    <zeroOrMore>
+      <element>
+        <anyName />
+        <ref name="any" />
+      </element>
+    </zeroOrMore>
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/attribute-choice-1.xml b/xml/relaxng/testData/highlighting/attribute-choice-1.xml
new file mode 100644
index 0000000..862daef4
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/attribute-choice-1.xml
@@ -0,0 +1,3 @@
+<attribute-choice xmlns="urn:test:simple.rng" type="a">
+  <a />
+</attribute-choice>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/attribute-choice-2.xml b/xml/relaxng/testData/highlighting/attribute-choice-2.xml
new file mode 100644
index 0000000..ef01f95
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/attribute-choice-2.xml
@@ -0,0 +1,3 @@
+<attribute-choice xmlns="urn:test:simple.rng" type="b">
+  <b />
+</attribute-choice>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/attribute-choice-3.xml b/xml/relaxng/testData/highlighting/attribute-choice-3.xml
new file mode 100644
index 0000000..c095d96
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/attribute-choice-3.xml
@@ -0,0 +1,2 @@
+<attribute-choice xmlns="urn:test:simple.rng" type=<error>"c"</error>>
+</attribute-choice>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/docbook.rng b/xml/relaxng/testData/highlighting/docbook.rng
new file mode 100644
index 0000000..6a5263e
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/docbook.rng
@@ -0,0 +1,15278 @@
+<?xml version="1.0" encoding="utf-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+         xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg"
+         xmlns:s="http://www.ascc.net/xml/schematron" xmlns:rng="http://relaxng.org/ns/structure/1.0"
+         xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:html="http://www.w3.org/1999/xhtml"
+         xmlns:db="http://docbook.org/ns/docbook"
+         xmlns:ctrl="http://nwalsh.com/xmlns/schema-control/"
+         xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" ns="http://docbook.org/ns/docbook">
+  <s:ns prefix="a" uri="http://relaxng.org/ns/compatibility/annotations/1.0"/>
+  <s:ns prefix="ctrl" uri="http://nwalsh.com/xmlns/schema-control/"/>
+  <s:ns prefix="db" uri="http://docbook.org/ns/docbook"/>
+  <s:ns prefix="dbx" uri="http://sourceforge.net/projects/docbook/defguide/schema/extra-markup"/>
+  <s:ns prefix="html" uri="http://www.w3.org/1999/xhtml"/>
+  <s:ns prefix="mml" uri="http://www.w3.org/1998/Math/MathML"/>
+  <s:ns prefix="rng" uri="http://relaxng.org/ns/structure/1.0"/>
+  <s:ns prefix="s" uri="http://www.ascc.net/xml/schematron"/>
+  <s:ns prefix="svg" uri="http://www.w3.org/2000/svg"/>
+  <s:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
+<!-- DocBook V5.0CR5-->
+<!-- See http://docbook.org/ns/docbook -->
+<!--
+    This file is part of DocBook V5.0CR5
+    
+    Copyright 1992-2005 HaL Computer Systems, Inc.,
+    O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+    Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+    Organization for the Advancement of Structured Information
+    Standards (OASIS).
+    
+    Release: $Id: docbook.rng,v 1.1 2007/07/31 08:21:48 sweinreuter Exp $
+    
+    Permission to use, copy, modify and distribute the DocBook schema
+    and its accompanying documentation for any purpose and without fee
+    is hereby granted in perpetuity, provided that the above copyright
+    notice and this paragraph appear in all copies. The copyright
+    holders make no representation about the suitability of the schema
+    for any purpose. It is provided "as is" without expressed or implied
+    warranty.
+    
+    If you modify the DocBook schema in any way, label your schema as a
+    variant of DocBook. See the reference documentation
+    (http://docbook.org/tdg5/en/html/ch05.html#s-notdocbook)
+    for more information.
+    
+    Please direct all questions, bug reports, or suggestions for changes
+    to the [email protected] mailing list. For more
+    information, see http://www.oasis-open.org/docbook/.
+    
+    ======================================================================
+  -->
+  <start>
+    <choice>
+      <choice>
+        <ref name="db.set"/>
+        <ref name="db.book"/>
+        <ref name="db.divisions"/>
+        <ref name="db.components"/>
+        <ref name="db.navigation.components"/>
+        <ref name="db.section"/>
+        <ref name="db.para"/>
+      </choice>
+      <choice>
+        <ref name="db.sect1"/>
+        <ref name="db.sect2"/>
+        <ref name="db.sect3"/>
+        <ref name="db.sect4"/>
+        <ref name="db.sect5"/>
+      </choice>
+      <choice>
+        <ref name="db.refentry"/>
+        <ref name="db.refsection"/>
+      </choice>
+      <choice>
+        <ref name="db.refsect1"/>
+        <ref name="db.refsect2"/>
+        <ref name="db.refsect3"/>
+      </choice>
+      <ref name="db.setindex"/>
+    </choice>
+  </start>
+  <div>
+    <define name="db._any.attribute">
+      <attribute>
+        <a:documentation>Any attribute including in any attribute in any namespace.</a:documentation>
+        <anyName/>
+      </attribute>
+    </define>
+    <define name="db._any">
+      <element>
+        <a:documentation>Any element from almost any namespace</a:documentation>
+        <anyName>
+          <except>
+            <nsName/>
+            <nsName ns="http://www.w3.org/1999/xhtml"/>
+          </except>
+        </anyName>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._any.attribute"/>
+            <text/>
+            <ref name="db._any"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.arch.attribute">
+    <attribute name="arch">
+      <a:documentation>Designates the computer or chip architecture to which the element applies</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.audience.attribute">
+    <attribute name="audience">
+      <a:documentation>Designates the intended audience to which the element applies, for example, system administrators, programmers, or new users.</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.condition.attribute">
+    <attribute name="condition">
+      <a:documentation>provides a standard place for application-specific effectivity</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.conformance.attribute">
+    <attribute name="conformance">
+      <a:documentation>Indicates standards conformance characteristics of the element</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.os.attribute">
+    <attribute name="os">
+      <a:documentation>Indicates the operating system to which the element is applicable</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.revision.attribute">
+    <attribute name="revision">
+      <a:documentation>Indicates the editorial revision to which the element belongs</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.security.attribute">
+    <attribute name="security">
+      <a:documentation>Indicates something about the security level associated with the element to which it applies</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.userlevel.attribute">
+    <attribute name="userlevel">
+      <a:documentation>Indicates the level of user experience for which the element applies</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.vendor.attribute">
+    <attribute name="vendor">
+      <a:documentation>Indicates the computer vendor to which the element applies.</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.wordsize.attribute">
+    <attribute name="wordsize">
+      <a:documentation>Indicates the word size (width in bits) of the computer architecture to which the element applies</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.effectivity.attributes">
+    <interleave>
+      <optional>
+        <ref name="db.arch.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.audience.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.condition.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.conformance.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.os.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.revision.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.security.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.userlevel.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.vendor.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.wordsize.attribute"/>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db.endterm.attribute">
+    <attribute name="endterm">
+      <a:documentation>Points to the element whose content is to be used as the text of the link</a:documentation>
+      <data type="IDREF"/>
+    </attribute>
+  </define>
+  <define name="db.linkend.attribute">
+    <attribute name="linkend">
+      <a:documentation>Points to an internal link target by identifying the value of its xml:id attribute</a:documentation>
+      <data type="IDREF"/>
+    </attribute>
+  </define>
+  <define name="db.linkends.attribute">
+    <attribute name="linkends">
+      <a:documentation>Points to one or more internal link targets by identifying the value of their xml:id attributes</a:documentation>
+      <data type="IDREFS"/>
+    </attribute>
+  </define>
+  <define name="db.xlink.href.attribute">
+    <attribute name="xlink:href">
+      <a:documentation>Identifies a link target with a URI</a:documentation>
+      <data type="anyURI"/>
+    </attribute>
+  </define>
+  <define name="db.xlink.type.attribute">
+    <attribute name="xlink:type">
+      <a:documentation>Identifies the XLink link type</a:documentation>
+      <value>simple</value>
+      <a:documentation>An XLink simple link</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.xlink.role.attribute">
+    <attribute name="xlink:role">
+      <a:documentation>Identifies the XLink role of the link</a:documentation>
+      <data type="anyURI"/>
+    </attribute>
+  </define>
+  <define name="db.xlink.arcrole.attribute">
+    <attribute name="xlink:arcrole">
+      <a:documentation>Identifies the XLink arcrole of the link</a:documentation>
+      <data type="anyURI"/>
+    </attribute>
+  </define>
+  <define name="db.xlink.title.attribute">
+    <optional>
+      <attribute name="xlink:title">
+        <a:documentation>Identifies the XLink title of the link</a:documentation>
+      </attribute>
+    </optional>
+  </define>
+  <define name="db.xlink.show.enumeration">
+    <choice>
+      <value>new</value>
+      <a:documentation>An application traversing to the ending resource should load it in a new window, frame, pane, or other relevant presentation context.</a:documentation>
+      <value>replace</value>
+      <a:documentation>An application traversing to the ending resource should load the resource in the same window, frame, pane, or other relevant presentation context in which the starting resource was loaded.</a:documentation>
+      <value>embed</value>
+      <a:documentation>An application traversing to the ending resource should load its presentation in place of the presentation of the starting resource.</a:documentation>
+      <value>other</value>
+      <a:documentation>The behavior of an application traversing to the ending resource is unconstrained by XLink. The application should look for other markup present in the link to determine the appropriate behavior.</a:documentation>
+      <value>none</value>
+      <a:documentation>The behavior of an application traversing to the ending resource is unconstrained by this specification. No other markup is present to help the application determine the appropriate behavior.</a:documentation>
+    </choice>
+  </define>
+  <define name="db.xlink.show.attribute">
+    <attribute name="xlink:show">
+      <a:documentation>Identifies the XLink show behavior of the link</a:documentation>
+      <ref name="db.xlink.show.enumeration"/>
+    </attribute>
+  </define>
+  <define name="db.xlink.actuate.enumeration">
+    <choice>
+      <value>onLoad</value>
+      <a:documentation>An application should traverse to the ending resource immediately on loading the starting resource.</a:documentation>
+      <value>onRequest</value>
+      <a:documentation>An application should traverse from the starting resource to the ending resource only on a post-loading event triggered for the purpose of traversal.</a:documentation>
+      <value>other</value>
+      <a:documentation>The behavior of an application traversing to the ending resource is unconstrained by this specification. The application should look for other markup present in the link to determine the appropriate behavior.</a:documentation>
+      <value>none</value>
+      <a:documentation>The behavior of an application traversing to the ending resource is unconstrained by this specification. No other markup is present to help the application determine the appropriate behavior.</a:documentation>
+    </choice>
+  </define>
+  <define name="db.xlink.actuate.attribute">
+    <attribute name="xlink:actuate">
+      <a:documentation>Identifies the XLink actuate behavior of the link</a:documentation>
+      <ref name="db.xlink.actuate.enumeration"/>
+    </attribute>
+  </define>
+  <define name="db.href.attributes">
+    <interleave>
+      <ref name="db.xlink.href.attribute"/>
+      <optional>
+        <ref name="db.xlink.type.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.xlink.role.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.xlink.arcrole.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.xlink.title.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.xlink.show.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.xlink.actuate.attribute"/>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db.xml.id.attribute">
+    <attribute name="xml:id">
+      <a:documentation>Identifies the unique ID value of the element</a:documentation>
+      <data type="ID"/>
+    </attribute>
+  </define>
+  <define name="db.version.attribute">
+    <attribute name="version">
+      <a:documentation>Specifies the DocBook version of the element and its descendants</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.xml.lang.attribute">
+    <attribute name="xml:lang">
+      <a:documentation>Specifies the natural language of the element and its descendants</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.xml.base.attribute">
+    <attribute name="xml:base">
+      <a:documentation>Specifies the base URI of the element and its descendants</a:documentation>
+      <data type="anyURI"/>
+    </attribute>
+  </define>
+  <define name="db.remap.attribute">
+    <attribute name="remap">
+      <a:documentation>Provides the name or similar semantic identifier assigned to the content in some previous markup scheme</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.xreflabel.attribute">
+    <attribute name="xreflabel">
+      <a:documentation>Provides the text that is to be generated for a cross reference to the element</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.xrefstyle.attribute">
+    <attribute name="xrefstyle">
+      <a:documentation>Specifies a keyword or keywords identifying additional style information</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.revisionflag.enumeration">
+    <choice>
+      <value>changed</value>
+      <a:documentation>The element has been changed.</a:documentation>
+      <value>added</value>
+      <a:documentation>The element is new (has been added to the document).</a:documentation>
+      <value>deleted</value>
+      <a:documentation>The element has been deleted.</a:documentation>
+      <value>off</value>
+      <a:documentation>Explicitly turns off revision markup for this element.</a:documentation>
+    </choice>
+  </define>
+  <define name="db.revisionflag.attribute">
+    <attribute name="revisionflag">
+      <a:documentation>Identifies the revision status of the element</a:documentation>
+      <ref name="db.revisionflag.enumeration"/>
+    </attribute>
+  </define>
+  <define name="db.dir.enumeration">
+    <choice>
+      <value>ltr</value>
+      <a:documentation>Left-to-right text</a:documentation>
+      <value>rtl</value>
+      <a:documentation>Right-to-left text</a:documentation>
+      <value>lro</value>
+      <a:documentation>Left-to-right override</a:documentation>
+      <value>rlo</value>
+      <a:documentation>Right-to-left override</a:documentation>
+    </choice>
+  </define>
+  <define name="db.dir.attribute">
+    <attribute name="dir">
+      <a:documentation>Identifies the direction of text in an element</a:documentation>
+      <ref name="db.dir.enumeration"/>
+    </attribute>
+  </define>
+  <define name="db.common.base.attributes">
+    <interleave>
+      <optional>
+        <ref name="db.version.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.xml.lang.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.xml.base.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.remap.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.xreflabel.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.revisionflag.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.dir.attribute"/>
+      </optional>
+      <ref name="db.effectivity.attributes"/>
+    </interleave>
+  </define>
+  <define name="db.common.attributes">
+    <interleave>
+      <optional>
+        <ref name="db.xml.id.attribute"/>
+      </optional>
+      <ref name="db.common.base.attributes"/>
+      <optional>
+        <ref name="db.annotations.attribute"/>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db.common.idreq.attributes">
+    <interleave>
+      <ref name="db.xml.id.attribute"/>
+      <ref name="db.common.base.attributes"/>
+      <optional>
+        <ref name="db.annotations.attribute"/>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db.common.linking.attributes">
+    <optional>
+      <choice>
+        <ref name="db.linkend.attribute"/>
+        <ref name="db.href.attributes"/>
+      </choice>
+    </optional>
+  </define>
+  <define name="db.common.req.linking.attributes">
+    <choice>
+      <ref name="db.linkend.attribute"/>
+      <ref name="db.href.attributes"/>
+    </choice>
+  </define>
+  <define name="db.common.data.attributes">
+    <optional>
+      <attribute name="format">
+        <a:documentation>Specifies the format of the data</a:documentation>
+      </attribute>
+    </optional>
+    <choice>
+      <attribute name="fileref">
+        <a:documentation>Indentifies the location of the data by URI</a:documentation>
+        <data type="anyURI"/>
+      </attribute>
+      <attribute name="entityref">
+        <a:documentation>Identifies the location of the data by external identifier (entity name)</a:documentation>
+        <data type="ENTITY"/>
+      </attribute>
+    </choice>
+  </define>
+  <define name="db.verbatim.continuation.enumeration">
+    <choice>
+      <value>continues</value>
+      <a:documentation>Line numbering continues from the immediately preceding element with the same name.</a:documentation>
+      <value>restarts</value>
+      <a:documentation>Line numbering restarts (begins at 1, usually).</a:documentation>
+    </choice>
+  </define>
+  <define name="db.verbatim.continuation.attribute">
+    <attribute name="continuation">
+      <a:documentation>Determines whether line numbering continues from the previous element or restarts.</a:documentation>
+      <ref name="db.verbatim.continuation.enumeration"/>
+    </attribute>
+  </define>
+  <define name="db.verbatim.linenumbering.enumeration">
+    <choice>
+      <value>numbered</value>
+      <a:documentation>Lines are numbered.</a:documentation>
+      <value>unnumbered</value>
+      <a:documentation>Lines are not numbered.</a:documentation>
+    </choice>
+  </define>
+  <define name="db.verbatim.linenumbering.attribute">
+    <attribute name="linenumbering">
+      <a:documentation>Determines whether lines are numbered.</a:documentation>
+      <ref name="db.verbatim.linenumbering.enumeration"/>
+    </attribute>
+  </define>
+  <define name="db.verbatim.startinglinenumber.attribute">
+    <attribute name="startinglinenumber">
+      <a:documentation>Specifies the initial line number.</a:documentation>
+      <data type="integer"/>
+    </attribute>
+  </define>
+  <define name="db.verbatim.language.attribute">
+    <attribute name="language">
+      <a:documentation>Identifies the language (i.e. programming language) of the verbatim content.</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.verbatim.xml.space.attribute">
+    <attribute name="xml:space">
+      <a:documentation>Can be used to indicate explicitly that whitespace in the verbatim environment is preserved. Whitespace must always be preserved in verbatim environments whether this attribute is specified or not.</a:documentation>
+      <value>preserve</value>
+      <a:documentation>Whitespace must be preserved.</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.verbatim.attributes">
+    <interleave>
+      <optional>
+        <ref name="db.verbatim.continuation.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.verbatim.linenumbering.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.verbatim.startinglinenumber.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.verbatim.language.attribute"/>
+      </optional>
+      <optional>
+        <ref name="db.verbatim.xml.space.attribute"/>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db.label.attribute">
+    <attribute name="label">
+      <a:documentation>Specifies an identifying string for presentation purposes</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.width.characters.attribute">
+    <attribute name="width">
+      <a:documentation>Specifies the width (in characters) of the element</a:documentation>
+      <data type="nonNegativeInteger"/>
+    </attribute>
+  </define>
+  <define name="db.spacing.enumeration">
+    <choice>
+      <value>compact</value>
+      <a:documentation>The spacing should be "compact".</a:documentation>
+      <value>normal</value>
+      <a:documentation>The spacing should be "normal".</a:documentation>
+    </choice>
+  </define>
+  <define name="db.spacing.attribute">
+    <attribute name="spacing">
+      <a:documentation>Specifies (a hint about) the spacing of the content</a:documentation>
+      <ref name="db.spacing.enumeration"/>
+    </attribute>
+  </define>
+  <define name="db.pgwide.enumeration">
+    <choice>
+      <value>0</value>
+      <a:documentation>The element should be rendered in the current text flow (with the flow column width).</a:documentation>
+      <value>1</value>
+      <a:documentation>The element should be rendered across the full text page.</a:documentation>
+    </choice>
+  </define>
+  <define name="db.pgwide.attribute">
+    <attribute name="pgwide">
+      <a:documentation>Indicates if the element is rendered across the column or the page</a:documentation>
+      <ref name="db.pgwide.enumeration"/>
+    </attribute>
+  </define>
+  <define name="db.language.attribute">
+    <attribute name="language">
+      <a:documentation>Identifies the language (i.e. programming language) of the content.</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.performance.enumeration">
+    <choice>
+      <value>optional</value>
+      <a:documentation>The content describes an optional step or steps.</a:documentation>
+      <value>required</value>
+      <a:documentation>The content describes a required step or steps.</a:documentation>
+    </choice>
+  </define>
+  <define name="db.performance.attribute">
+    <attribute name="performance">
+      <a:documentation>Specifies if the content is required or optional.</a:documentation>
+      <ref name="db.performance.enumeration"/>
+    </attribute>
+  </define>
+  <define name="db.floatstyle.attribute">
+    <attribute name="floatstyle">
+      <a:documentation>Specifies style information to be used when rendering the float</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.width.attribute">
+    <attribute name="width">
+      <a:documentation>Specifies the width of the element</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.depth.attribute">
+    <attribute name="depth">
+      <a:documentation>Specifies the depth of the element</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.contentwidth.attribute">
+    <attribute name="contentwidth">
+      <a:documentation>Specifies the width of the content rectangle</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.contentdepth.attribute">
+    <attribute name="contentdepth">
+      <a:documentation>Specifies the depth of the content rectangle</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.scalefit.enumeration">
+    <choice>
+      <value>0</value>
+      <a:documentation>False (do not scale-to-fit; anamorphic scaling may occur)</a:documentation>
+      <value>1</value>
+      <a:documentation>True (scale-to-fit; anamorphic scaling is forbidden)</a:documentation>
+    </choice>
+  </define>
+  <define name="db.scale.attribute">
+    <attribute name="scale">
+      <a:documentation>Specifies the scaling factor</a:documentation>
+      <data type="positiveInteger"/>
+    </attribute>
+  </define>
+  <define name="db.halign.enumeration">
+    <choice>
+      <value>center</value>
+      <a:documentation>Centered horizontally</a:documentation>
+      <value>char</value>
+      <a:documentation>Aligned horizontally on the specified character</a:documentation>
+      <value>justify</value>
+      <a:documentation>Fully justified (left and right margins or edges)</a:documentation>
+      <value>left</value>
+      <a:documentation>Left aligned</a:documentation>
+      <value>right</value>
+      <a:documentation>Right aligned</a:documentation>
+    </choice>
+  </define>
+  <define name="db.valign.enumeration">
+    <choice>
+      <value>bottom</value>
+      <a:documentation>Aligned on the bottom of the region</a:documentation>
+      <value>middle</value>
+      <a:documentation>Centered vertically</a:documentation>
+      <value>top</value>
+      <a:documentation>Aligned on the top of the region</a:documentation>
+    </choice>
+  </define>
+  <define name="db.biblio.class.enumeration">
+    <choice>
+      <value>doi</value>
+      <a:documentation>A document object identifier.</a:documentation>
+      <value>isbn</value>
+      <a:documentation>An international standard book number.</a:documentation>
+      <value>isrn</value>
+      <a:documentation>An international standard technical report number (ISO 10444).</a:documentation>
+      <value>issn</value>
+      <a:documentation>An international standard serial number.</a:documentation>
+      <value>libraryofcongress</value>
+      <a:documentation>A Library of Congress reference number.</a:documentation>
+      <value>pubsnumber</value>
+      <a:documentation>A publication number (an internal number or possibly organizational standard).</a:documentation>
+      <value>uri</value>
+      <a:documentation>A Uniform Resource Identifier</a:documentation>
+    </choice>
+  </define>
+  <define name="db.biblio.class-enum.attribute">
+    <optional>
+      <attribute name="class">
+        <a:documentation>Identifies the kind of bibliographic identifier</a:documentation>
+        <ref name="db.biblio.class.enumeration"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="db.biblio.class-other.attribute">
+    <attribute name="otherclass">
+      <a:documentation>Identifies the nature of the non-standard bibliographic identifier</a:documentation>
+      <data type="NMTOKEN"/>
+    </attribute>
+  </define>
+  <define name="db.biblio.class-other.attributes">
+    <interleave>
+      <attribute name="class">
+        <a:documentation>Identifies the kind of bibliographic identifier</a:documentation>
+        <value>other</value>
+        <a:documentation>Indicates that the identifier is some 'other' kind.</a:documentation>
+      </attribute>
+      <ref name="db.biblio.class-other.attribute"/>
+    </interleave>
+  </define>
+  <define name="db.biblio.class.attribute">
+    <choice>
+      <ref name="db.biblio.class-enum.attribute"/>
+      <ref name="db.biblio.class-other.attributes"/>
+    </choice>
+  </define>
+  <define name="db.ubiq.inlines">
+    <choice>
+      <choice>
+        <ref name="db.inlinemediaobject"/>
+        <ref name="db.remark"/>
+        <ref name="db.superscript"/>
+        <ref name="db.subscript"/>
+        <ref name="db.link.inlines"/>
+        <ref name="db.alt"/>
+      </choice>
+      <ref name="db.annotation"/>
+      <ref name="db.indexterm"/>
+    </choice>
+  </define>
+  <define name="db._text">
+    <zeroOrMore>
+      <choice>
+        <text/>
+        <ref name="db.ubiq.inlines"/>
+        <ref name="db._phrase"/>
+        <ref name="db.replaceable"/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="db._title">
+    <interleave>
+      <optional>
+        <ref name="db.title"/>
+      </optional>
+      <optional>
+        <ref name="db.titleabbrev"/>
+      </optional>
+      <optional>
+        <ref name="db.subtitle"/>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db._title.req">
+    <interleave>
+      <ref name="db.title"/>
+      <optional>
+        <ref name="db.titleabbrev"/>
+      </optional>
+      <optional>
+        <ref name="db.subtitle"/>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db._title.only">
+    <interleave>
+      <optional>
+        <ref name="db.title"/>
+      </optional>
+      <optional>
+        <ref name="db.titleabbrev"/>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db._title.onlyreq">
+    <interleave>
+      <ref name="db.title"/>
+      <optional>
+        <ref name="db.titleabbrev"/>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db._info">
+    <choice>
+      <group>
+        <optional>
+          <ref name="db._title.req"/>
+        </optional>
+        <optional>
+          <ref name="db.titleforbidden.info"/>
+        </optional>
+      </group>
+      <optional>
+        <ref name="db.info"/>
+      </optional>
+    </choice>
+  </define>
+  <define name="db._info.title.req">
+    <choice>
+      <group>
+        <ref name="db._title.req"/>
+        <optional>
+          <ref name="db.titleforbidden.info"/>
+        </optional>
+      </group>
+      <ref name="db.titlereq.info"/>
+    </choice>
+  </define>
+  <define name="db._info.title.only">
+    <choice>
+      <group>
+        <ref name="db._title.only"/>
+        <optional>
+          <ref name="db.titleforbidden.info"/>
+        </optional>
+      </group>
+      <ref name="db.titleonly.info"/>
+    </choice>
+  </define>
+  <define name="db._info.title.onlyreq">
+    <choice>
+      <group>
+        <ref name="db._title.onlyreq"/>
+        <optional>
+          <ref name="db.titleforbidden.info"/>
+        </optional>
+      </group>
+      <ref name="db.titleonlyreq.info"/>
+    </choice>
+  </define>
+  <define name="db._info.title.forbidden">
+    <optional>
+      <ref name="db.titleforbidden.info"/>
+    </optional>
+  </define>
+  <define name="db.all.inlines">
+    <choice>
+      <text/>
+      <ref name="db.ubiq.inlines"/>
+      <ref name="db.general.inlines"/>
+      <ref name="db.domain.inlines"/>
+      <ref name="db.extension.inlines"/>
+    </choice>
+  </define>
+  <define name="db.general.inlines">
+    <choice>
+      <ref name="db.publishing.inlines"/>
+      <ref name="db.product.inlines"/>
+      <ref name="db.bibliography.inlines"/>
+      <ref name="db.graphic.inlines"/>
+      <ref name="db.indexing.inlines"/>
+      <ref name="db.link.inlines"/>
+    </choice>
+  </define>
+  <define name="db.domain.inlines">
+    <choice>
+      <choice>
+        <ref name="db.technical.inlines"/>
+        <ref name="db.error.inlines"/>
+        <ref name="db.os.inlines"/>
+        <ref name="db.programming.inlines"/>
+        <ref name="db.markup.inlines"/>
+        <ref name="db.gui.inlines"/>
+        <ref name="db.keyboard.inlines"/>
+      </choice>
+      <ref name="db.math.inlines"/>
+    </choice>
+  </define>
+  <define name="db.technical.inlines">
+    <choice>
+      <choice>
+        <ref name="db.replaceable"/>
+        <ref name="db.systemitem"/>
+        <ref name="db.option"/>
+        <ref name="db.optional"/>
+        <ref name="db.package"/>
+        <ref name="db.parameter"/>
+        <ref name="db.property"/>
+      </choice>
+      <ref name="db.termdef"/>
+      <ref name="db.nonterminal"/>
+    </choice>
+  </define>
+  <define name="db.error.inlines">
+    <choice>
+      <ref name="db.errorcode"/>
+      <ref name="db.errortext"/>
+      <ref name="db.errorname"/>
+      <ref name="db.errortype"/>
+    </choice>
+  </define>
+  <define name="db.oo.inlines">
+    <choice>
+      <ref name="db.ooclass"/>
+      <ref name="db.ooexception"/>
+      <ref name="db.oointerface"/>
+    </choice>
+  </define>
+  <define name="db.programming.inlines">
+    <choice>
+      <ref name="db.function"/>
+      <ref name="db.parameter"/>
+      <ref name="db.varname"/>
+      <ref name="db.returnvalue"/>
+      <ref name="db.type"/>
+      <ref name="db.classname"/>
+      <ref name="db.exceptionname"/>
+      <ref name="db.interfacename"/>
+      <ref name="db.methodname"/>
+      <ref name="db.modifier"/>
+      <ref name="db.initializer"/>
+      <ref name="db.oo.inlines"/>
+    </choice>
+  </define>
+  <define name="db.product.inlines">
+    <choice>
+      <ref name="db.productnumber"/>
+      <ref name="db.productname"/>
+      <ref name="db.database"/>
+      <ref name="db.application"/>
+      <ref name="db.hardware"/>
+      <ref name="db.trademark"/>
+    </choice>
+  </define>
+  <define name="db.os.inlines">
+    <choice>
+      <ref name="db.prompt"/>
+      <ref name="db.envar"/>
+      <ref name="db.filename"/>
+      <ref name="db.command"/>
+      <ref name="db.computeroutput"/>
+      <ref name="db.userinput"/>
+    </choice>
+  </define>
+  <define name="db.markup.inlines">
+    <choice>
+      <ref name="db.tag"/>
+      <ref name="db.markup"/>
+      <ref name="db.token"/>
+      <ref name="db.symbol"/>
+      <ref name="db.literal"/>
+      <ref name="db.code"/>
+      <ref name="db.constant"/>
+      <ref name="db.email"/>
+      <ref name="db.uri"/>
+    </choice>
+  </define>
+  <define name="db.bibliography.inlines">
+    <choice>
+      <ref name="db.citation"/>
+      <ref name="db.citerefentry"/>
+      <ref name="db.citetitle"/>
+      <ref name="db.citebiblioid"/>
+      <ref name="db.author"/>
+      <ref name="db.person"/>
+      <ref name="db.personname"/>
+      <ref name="db.org"/>
+      <ref name="db.orgname"/>
+      <ref name="db.editor"/>
+      <ref name="db.jobtitle"/>
+    </choice>
+  </define>
+  <define name="db.publishing.inlines">
+    <choice>
+      <choice>
+        <ref name="db.abbrev"/>
+        <ref name="db.acronym"/>
+        <ref name="db.date"/>
+        <ref name="db.emphasis"/>
+        <ref name="db.footnote"/>
+        <ref name="db.footnoteref"/>
+        <ref name="db.foreignphrase"/>
+        <ref name="db.phrase"/>
+        <ref name="db.quote"/>
+        <ref name="db.subscript"/>
+        <ref name="db.superscript"/>
+        <ref name="db.wordasword"/>
+      </choice>
+      <ref name="db.glossary.inlines"/>
+      <ref name="db.coref"/>
+    </choice>
+  </define>
+  <define name="db.graphic.inlines">
+    <ref name="db.inlinemediaobject"/>
+  </define>
+  <define name="db.indexing.inlines">
+    <choice>
+      <notAllowed/>
+      <ref name="db.indexterm"/>
+    </choice>
+  </define>
+  <define name="db.gui.inlines">
+    <choice>
+      <ref name="db.guiicon"/>
+      <ref name="db.guibutton"/>
+      <ref name="db.guimenuitem"/>
+      <ref name="db.guimenu"/>
+      <ref name="db.guisubmenu"/>
+      <ref name="db.guilabel"/>
+      <ref name="db.menuchoice"/>
+      <ref name="db.mousebutton"/>
+    </choice>
+  </define>
+  <define name="db.keyboard.inlines">
+    <choice>
+      <ref name="db.keycombo"/>
+      <ref name="db.keycap"/>
+      <ref name="db.keycode"/>
+      <ref name="db.keysym"/>
+      <ref name="db.shortcut"/>
+      <ref name="db.accel"/>
+    </choice>
+  </define>
+  <define name="db.link.inlines">
+    <choice>
+      <choice>
+        <ref name="db.xref"/>
+        <ref name="db.link"/>
+        <ref name="db.olink"/>
+        <ref name="db.anchor"/>
+      </choice>
+      <ref name="db.biblioref"/>
+    </choice>
+  </define>
+  <define name="db.extension.inlines">
+    <notAllowed/>
+  </define>
+  <define name="db.nopara.blocks">
+    <choice>
+      <choice>
+        <ref name="db.list.blocks"/>
+        <ref name="db.admonition.blocks"/>
+        <ref name="db.formal.blocks"/>
+        <ref name="db.informal.blocks"/>
+        <ref name="db.publishing.blocks"/>
+        <ref name="db.graphic.blocks"/>
+        <ref name="db.technical.blocks"/>
+        <ref name="db.verbatim.blocks"/>
+        <ref name="db.synopsis.blocks"/>
+        <ref name="db.bridgehead"/>
+        <ref name="db.remark"/>
+        <ref name="db.revhistory"/>
+      </choice>
+      <ref name="db.indexterm"/>
+    </choice>
+  </define>
+  <define name="db.para.blocks">
+    <choice>
+      <ref name="db.anchor"/>
+      <ref name="db.para"/>
+      <ref name="db.formalpara"/>
+      <ref name="db.simpara"/>
+    </choice>
+  </define>
+  <define name="db.all.blocks">
+    <choice>
+      <choice>
+        <ref name="db.nopara.blocks"/>
+        <ref name="db.para.blocks"/>
+        <ref name="db.extension.blocks"/>
+      </choice>
+      <ref name="db.annotation"/>
+    </choice>
+  </define>
+  <define name="db.formal.blocks">
+    <choice>
+      <choice>
+        <ref name="db.example"/>
+        <ref name="db.figure"/>
+        <ref name="db.table"/>
+      </choice>
+      <ref name="db.equation"/>
+    </choice>
+  </define>
+  <define name="db.informal.blocks">
+    <choice>
+      <choice>
+        <ref name="db.informalexample"/>
+        <ref name="db.informalfigure"/>
+        <ref name="db.informaltable"/>
+      </choice>
+      <ref name="db.informalequation"/>
+    </choice>
+  </define>
+  <define name="db.publishing.blocks">
+    <choice>
+      <ref name="db.sidebar"/>
+      <ref name="db.blockquote"/>
+      <ref name="db.address"/>
+      <ref name="db.epigraph"/>
+    </choice>
+  </define>
+  <define name="db.graphic.blocks">
+    <choice>
+      <ref name="db.mediaobject"/>
+      <ref name="db.screenshot"/>
+    </choice>
+  </define>
+  <define name="db.technical.blocks">
+    <choice>
+      <ref name="db.procedure"/>
+      <ref name="db.task"/>
+      <choice>
+        <ref name="db.productionset"/>
+        <ref name="db.constraintdef"/>
+      </choice>
+      <ref name="db.msgset"/>
+    </choice>
+  </define>
+  <define name="db.admonition.blocks">
+    <choice>
+      <ref name="db.caution"/>
+      <ref name="db.important"/>
+      <ref name="db.note"/>
+      <ref name="db.tip"/>
+      <ref name="db.warning"/>
+    </choice>
+  </define>
+  <define name="db.list.blocks">
+    <choice>
+      <choice>
+        <ref name="db.itemizedlist"/>
+        <ref name="db.orderedlist"/>
+        <ref name="db.procedure"/>
+        <ref name="db.simplelist"/>
+        <ref name="db.variablelist"/>
+        <ref name="db.segmentedlist"/>
+      </choice>
+      <ref name="db.glosslist"/>
+      <ref name="db.bibliolist"/>
+      <ref name="db.calloutlist"/>
+      <ref name="db.qandaset"/>
+    </choice>
+  </define>
+  <define name="db.verbatim.blocks">
+    <choice>
+      <choice>
+        <ref name="db.programlisting"/>
+        <ref name="db.screen"/>
+        <ref name="db.literallayout"/>
+        <ref name="db.synopsis"/>
+      </choice>
+      <choice>
+        <ref name="db.programlistingco"/>
+        <ref name="db.screenco"/>
+      </choice>
+    </choice>
+  </define>
+  <define name="db.synopsis.blocks">
+    <choice>
+      <ref name="db.cmdsynopsis"/>
+      <ref name="db.funcsynopsis"/>
+      <ref name="db.classsynopsis"/>
+      <ref name="db.methodsynopsis"/>
+      <ref name="db.constructorsynopsis"/>
+      <ref name="db.destructorsynopsis"/>
+      <ref name="db.fieldsynopsis"/>
+    </choice>
+  </define>
+  <define name="db.extension.blocks">
+    <notAllowed/>
+  </define>
+  <define name="db.info.extension">
+    <ref name="db._any"/>
+  </define>
+  <define name="db.info.elements">
+    <choice>
+      <choice>
+        <ref name="db.abstract"/>
+        <ref name="db.address"/>
+        <ref name="db.artpagenums"/>
+        <ref name="db.author"/>
+        <ref name="db.authorgroup"/>
+        <ref name="db.authorinitials"/>
+        <ref name="db.bibliocoverage"/>
+        <ref name="db.biblioid"/>
+        <ref name="db.bibliosource"/>
+        <ref name="db.collab"/>
+        <ref name="db.confgroup"/>
+        <ref name="db.contractsponsor"/>
+        <ref name="db.contractnum"/>
+        <ref name="db.copyright"/>
+        <ref name="db.cover"/>
+        <ref name="db.date"/>
+        <ref name="db.edition"/>
+        <ref name="db.editor"/>
+        <ref name="db.issuenum"/>
+        <ref name="db.keywordset"/>
+        <ref name="db.legalnotice"/>
+        <ref name="db.mediaobject"/>
+        <ref name="db.org"/>
+        <ref name="db.orgname"/>
+        <ref name="db.othercredit"/>
+        <ref name="db.pagenums"/>
+        <ref name="db.printhistory"/>
+        <ref name="db.productname"/>
+        <ref name="db.productnumber"/>
+        <ref name="db.pubdate"/>
+        <ref name="db.publisher"/>
+        <ref name="db.publishername"/>
+        <ref name="db.releaseinfo"/>
+        <ref name="db.revhistory"/>
+        <ref name="db.seriesvolnums"/>
+        <ref name="db.subjectset"/>
+        <ref name="db.volumenum"/>
+        <ref name="db.info.extension"/>
+      </choice>
+      <ref name="db.annotation"/>
+      <ref name="db.extendedlink"/>
+      <choice>
+        <ref name="db.bibliomisc"/>
+        <ref name="db.bibliomset"/>
+        <ref name="db.bibliorelation"/>
+        <ref name="db.biblioset"/>
+      </choice>
+      <ref name="db.itermset"/>
+    </choice>
+  </define>
+  <define name="db.bibliographic.elements">
+    <choice>
+      <ref name="db.info.elements"/>
+      <ref name="db.publishing.inlines"/>
+      <ref name="db.citerefentry"/>
+      <ref name="db.citetitle"/>
+      <ref name="db.citebiblioid"/>
+      <ref name="db.person"/>
+      <ref name="db.personname"/>
+      <ref name="db.subtitle"/>
+      <ref name="db.title"/>
+    </choice>
+  </define>
+  <div>
+    <define name="db.title.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.title.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.title.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.title">
+      <element name="title">
+        <a:documentation>The text of the title of a section of a document or of a formal block-level element</a:documentation>
+        <ref name="db.title.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.titleabbrev.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.titleabbrev.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.titleabbrev.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.titleabbrev">
+      <element name="titleabbrev">
+        <a:documentation>The abbreviation of a title</a:documentation>
+        <ref name="db.titleabbrev.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.subtitle.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.subtitle.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.subtitle.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.subtitle">
+      <element name="subtitle">
+        <a:documentation>The subtitle of a document</a:documentation>
+        <ref name="db.subtitle.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.info.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.info.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.info.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.info">
+      <element name="info">
+        <a:documentation>A wrapper for information about a component or other block</a:documentation>
+        <ref name="db.info.attlist"/>
+        <interleave>
+          <ref name="db._title"/>
+          <zeroOrMore>
+            <ref name="db.info.elements"/>
+          </zeroOrMore>
+        </interleave>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.titlereq.info.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.titlereq.info.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.titlereq.info.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.titlereq.info">
+      <element name="info">
+        <a:documentation>A wrapper for information about a component or other block with a required title</a:documentation>
+        <ref name="db.titlereq.info.attlist"/>
+        <interleave>
+          <ref name="db._title.req"/>
+          <zeroOrMore>
+            <ref name="db.info.elements"/>
+          </zeroOrMore>
+        </interleave>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.titleonly.info.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.titleonly.info.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.titleonly.info.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.titleonly.info">
+      <element name="info">
+        <a:documentation>A wrapper for information about a component or other block with only a title</a:documentation>
+        <ref name="db.titleonly.info.attlist"/>
+        <interleave>
+          <ref name="db._title.only"/>
+          <zeroOrMore>
+            <ref name="db.info.elements"/>
+          </zeroOrMore>
+        </interleave>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.titleonlyreq.info.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.titleonlyreq.info.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.titleonlyreq.info.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.titleonlyreq.info">
+      <element name="info">
+        <a:documentation>A wrapper for information about a component or other block with only a required title</a:documentation>
+        <ref name="db.titleonlyreq.info.attlist"/>
+        <interleave>
+          <ref name="db._title.onlyreq"/>
+          <zeroOrMore>
+            <ref name="db.info.elements"/>
+          </zeroOrMore>
+        </interleave>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.titleforbidden.info.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.titleforbidden.info.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.titleforbidden.info.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.titleforbidden.info">
+      <element name="info">
+        <a:documentation>A wrapper for information about a component or other block without a title</a:documentation>
+        <ref name="db.titleforbidden.info.attlist"/>
+        <zeroOrMore>
+          <ref name="db.info.elements"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.subjectset.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.subjectset.scheme.attribute">
+      <attribute name="scheme">
+        <a:documentation>Identifies the controlled vocabulary used by this set's terms</a:documentation>
+        <data type="NMTOKEN"/>
+      </attribute>
+    </define>
+    <define name="db.subjectset.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.subjectset.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.subjectset.scheme.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.subjectset">
+      <element name="subjectset">
+        <a:documentation>A set of terms describing the subject matter of a document</a:documentation>
+        <ref name="db.subjectset.attlist"/>
+        <oneOrMore>
+          <ref name="db.subject"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.subject.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.subject.weight.attribute">
+      <attribute name="weight">
+        <a:documentation>Specifies a ranking for this subject relative to other subjects in the same set</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.subject.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.subject.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.subject.weight.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.subject">
+      <element name="subject">
+        <a:documentation>One of a group of terms describing the subject matter of a document</a:documentation>
+        <ref name="db.subject.attlist"/>
+        <oneOrMore>
+          <ref name="db.subjectterm"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.subjectterm.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.subjectterm.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.subjectterm.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.subjectterm">
+      <element name="subjectterm">
+        <a:documentation>A term in a group of terms describing the subject matter of a document</a:documentation>
+        <ref name="db.subjectterm.attlist"/>
+        <text/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.keywordset.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.keywordset.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.keywordset.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.keywordset">
+      <element name="keywordset">
+        <a:documentation>A set of keywords describing the content of a document</a:documentation>
+        <ref name="db.keywordset.attlist"/>
+        <oneOrMore>
+          <ref name="db.keyword"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.keyword.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.keyword.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.keyword.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.keyword">
+      <element name="keyword">
+        <a:documentation>One of a set of keywords describing the content of a document</a:documentation>
+        <ref name="db.keyword.attlist"/>
+        <text/>
+      </element>
+    </define>
+  </div>
+  <define name="db.table.choice">
+    <choice>
+      <notAllowed/>
+      <ref name="db.cals.table"/>
+      <ref name="db.html.table"/>
+    </choice>
+  </define>
+  <define name="db.informaltable.choice">
+    <choice>
+      <notAllowed/>
+      <ref name="db.cals.informaltable"/>
+      <ref name="db.html.informaltable"/>
+    </choice>
+  </define>
+  <define name="db.table">
+    <ref name="db.table.choice"/>
+  </define>
+  <define name="db.informaltable">
+    <ref name="db.informaltable.choice"/>
+  </define>
+  <div>
+    <define name="db.procedure.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.procedure.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.procedure.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.procedure.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.procedure">
+      <element name="procedure">
+        <a:documentation>A list of operations to be performed in a well-defined sequence</a:documentation>
+        <ref name="db.procedure.attlist"/>
+        <ref name="db.procedure.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <oneOrMore>
+          <ref name="db.step"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.step.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.step.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.step.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.performance.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.step.info">
+      <ref name="db._info.title.only"/>
+    </define>
+<!--
+
+      This content model is blocks*, step|stepalternatives, blocks* but
+      expressed this way it avoids UPA issues in XSD and DTD versions
+    -->
+    <define name="db.step">
+      <element name="step">
+        <a:documentation>A unit of action in a procedure</a:documentation>
+        <ref name="db.step.attlist"/>
+        <ref name="db.step.info"/>
+        <choice>
+          <group>
+            <oneOrMore>
+              <ref name="db.all.blocks"/>
+            </oneOrMore>
+            <optional>
+              <choice>
+                <ref name="db.substeps"/>
+                <ref name="db.stepalternatives"/>
+              </choice>
+              <zeroOrMore>
+                <ref name="db.all.blocks"/>
+              </zeroOrMore>
+            </optional>
+          </group>
+          <group>
+            <choice>
+              <ref name="db.substeps"/>
+              <ref name="db.stepalternatives"/>
+            </choice>
+            <zeroOrMore>
+              <ref name="db.all.blocks"/>
+            </zeroOrMore>
+          </group>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.stepalternatives.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.stepalternatives.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.stepalternatives.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.performance.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.stepalternatives.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.stepalternatives">
+      <element name="stepalternatives">
+        <a:documentation>Alternative steps in a procedure</a:documentation>
+        <ref name="db.stepalternatives.attlist"/>
+        <ref name="db.stepalternatives.info"/>
+        <oneOrMore>
+          <ref name="db.step"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.substeps.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.substeps.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.substeps.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.performance.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.substeps">
+      <element name="substeps">
+        <a:documentation>A wrapper for steps that occur within steps in a procedure</a:documentation>
+        <ref name="db.substeps.attlist"/>
+        <oneOrMore>
+          <ref name="db.step"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.sidebar.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.sidebar.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.sidebar.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.sidebar.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.sidebar">
+      <element name="sidebar">
+        <a:documentation>A portion of a document that is isolated from the main narrative flow</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:sidebar">
+            <s:assert test="not(.//db:sidebar)">sidebar must not occur in the descendants of sidebar</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.sidebar.attlist"/>
+        <ref name="db.sidebar.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.abstract.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.abstract.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.abstract.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.abstract.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.abstract">
+      <element name="abstract">
+        <a:documentation>A summary</a:documentation>
+        <ref name="db.abstract.attlist"/>
+        <ref name="db.abstract.info"/>
+        <oneOrMore>
+          <ref name="db.para.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.personblurb.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.personblurb.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.personblurb.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.personblurb.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.personblurb">
+      <element name="personblurb">
+        <a:documentation>A short description or note about a person</a:documentation>
+        <ref name="db.personblurb.attlist"/>
+        <ref name="db.personblurb.info"/>
+        <oneOrMore>
+          <ref name="db.para.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.blockquote.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.blockquote.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.blockquote.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.blockquote.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.blockquote">
+      <element name="blockquote">
+        <a:documentation>A quotation set off from the main text</a:documentation>
+        <ref name="db.blockquote.attlist"/>
+        <ref name="db.blockquote.info"/>
+        <optional>
+          <ref name="db.attribution"/>
+        </optional>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.attribution.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.attribution.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.attribution.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.attribution">
+      <element name="attribution">
+        <a:documentation>The source of a block quote or epigraph</a:documentation>
+        <ref name="db.attribution.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.person"/>
+            <ref name="db.personname"/>
+            <ref name="db.citetitle"/>
+            <ref name="db.citation"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.bridgehead.renderas.enumeration">
+      <choice>
+        <value>sect1</value>
+        <a:documentation>Render as a first-level section</a:documentation>
+        <value>sect2</value>
+        <a:documentation>Render as a second-level section</a:documentation>
+        <value>sect3</value>
+        <a:documentation>Render as a third-level section</a:documentation>
+        <value>sect4</value>
+        <a:documentation>Render as a fourth-level section</a:documentation>
+        <value>sect5</value>
+        <a:documentation>Render as a fifth-level section</a:documentation>
+      </choice>
+    </define>
+    <define name="db.bridgehead.renderas-enum.attribute">
+      <optional>
+        <attribute name="renderas">
+          <a:documentation>Indicates how the bridge head should be rendered</a:documentation>
+          <ref name="db.bridgehead.renderas.enumeration"/>
+        </attribute>
+      </optional>
+    </define>
+    <define name="db.bridgehead.renderas-other.attribute">
+      <attribute name="otherrenderas">
+        <a:documentation>Identifies the nature of the non-standard rendering</a:documentation>
+        <data type="NMTOKEN"/>
+      </attribute>
+    </define>
+    <define name="db.bridgehead.renderas-other.attributes">
+      <interleave>
+        <attribute name="renderas">
+          <a:documentation>Indicates how the bridge head should be rendered</a:documentation>
+          <value>other</value>
+          <a:documentation>Identifies a non-standard rendering</a:documentation>
+        </attribute>
+        <ref name="db.bridgehead.renderas-other.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.bridgehead.renderas.attribute">
+      <choice>
+        <ref name="db.bridgehead.renderas-enum.attribute"/>
+        <ref name="db.bridgehead.renderas-other.attributes"/>
+      </choice>
+    </define>
+    <define name="db.bridgehead.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.bridgehead.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.bridgehead.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.bridgehead.renderas.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.bridgehead">
+      <element name="bridgehead">
+        <a:documentation>A free-floating heading</a:documentation>
+        <ref name="db.bridgehead.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.remark.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.remark.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.remark.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.remark">
+      <element name="remark">
+        <a:documentation>A remark (or comment) intended for presentation in a draft manuscript</a:documentation>
+        <ref name="db.remark.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.epigraph.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.epigraph.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.epigraph.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.epigraph.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.epigraph">
+      <element name="epigraph">
+        <a:documentation>A short inscription at the beginning of a document or component</a:documentation>
+        <ref name="db.epigraph.attlist"/>
+        <ref name="db.epigraph.info"/>
+        <optional>
+          <ref name="db.attribution"/>
+        </optional>
+        <oneOrMore>
+          <choice>
+            <ref name="db.para.blocks"/>
+            <ref name="db.literallayout"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.footnote.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.footnote.label.attribute">
+      <attribute name="label">
+        <a:documentation>Identifies the desired footnote mark</a:documentation>
+        <data type="NMTOKEN"/>
+      </attribute>
+    </define>
+    <define name="db.footnote.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.footnote.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.footnote.label.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.footnote">
+      <element name="footnote">
+        <a:documentation>A footnote</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:footnote)">footnote must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:example)">example must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:figure)">figure must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:table)">table must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:equation)">equation must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:caution)">caution must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:important)">important must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:note)">note must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:tip)">tip must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:warning)">warning must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:indexterm)">indexterm must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:sidebar)">sidebar must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:task)">task must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:footnote">
+            <s:assert test="not(.//db:epigraph)">epigraph must not occur in the descendants of footnote</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.footnote.attlist"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.formalpara.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.formalpara.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.formalpara.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.formalpara.info">
+      <ref name="db._info.title.onlyreq"/>
+    </define>
+    <define name="db.formalpara">
+      <element name="formalpara">
+        <a:documentation>A paragraph with a title</a:documentation>
+        <ref name="db.formalpara.attlist"/>
+        <ref name="db.formalpara.info"/>
+        <zeroOrMore>
+          <ref name="db.indexing.inlines"/>
+        </zeroOrMore>
+        <ref name="db.para"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.para.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.para.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.para.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.para.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.para">
+      <element name="para">
+        <a:documentation>A paragraph</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:para">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.para.attlist"/>
+        <ref name="db.para.info"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.all.inlines"/>
+            <ref name="db.nopara.blocks"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.simpara.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.simpara.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.simpara.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.simpara.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.simpara">
+      <element name="simpara">
+        <a:documentation>A paragraph that contains only text and inline markup, no block elements</a:documentation>
+        <ref name="db.simpara.attlist"/>
+        <ref name="db.simpara.info"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.admonition.contentmodel">
+    <ref name="db._info.title.only"/>
+    <oneOrMore>
+      <ref name="db.all.blocks"/>
+    </oneOrMore>
+  </define>
+  <div>
+    <define name="db.caution.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.caution.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.caution.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.caution">
+      <element name="caution">
+        <a:documentation>A note of caution</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caution">
+            <s:assert test="not(.//db:caution)">caution must not occur in the descendants of caution</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caution">
+            <s:assert test="not(.//db:important)">important must not occur in the descendants of caution</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caution">
+            <s:assert test="not(.//db:note)">note must not occur in the descendants of caution</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caution">
+            <s:assert test="not(.//db:tip)">tip must not occur in the descendants of caution</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caution">
+            <s:assert test="not(.//db:warning)">warning must not occur in the descendants of caution</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.caution.attlist"/>
+        <ref name="db.admonition.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.important.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.important.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.important.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.important">
+      <element name="important">
+        <a:documentation>An admonition set off from the text</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:important">
+            <s:assert test="not(.//db:caution)">caution must not occur in the descendants of important</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:important">
+            <s:assert test="not(.//db:important)">important must not occur in the descendants of important</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:important">
+            <s:assert test="not(.//db:note)">note must not occur in the descendants of important</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:important">
+            <s:assert test="not(.//db:tip)">tip must not occur in the descendants of important</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:important">
+            <s:assert test="not(.//db:warning)">warning must not occur in the descendants of important</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.important.attlist"/>
+        <ref name="db.admonition.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.note.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.note.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.note.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.note">
+      <element name="note">
+        <a:documentation>A message set off from the text</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:note">
+            <s:assert test="not(.//db:caution)">caution must not occur in the descendants of note</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:note">
+            <s:assert test="not(.//db:important)">important must not occur in the descendants of note</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:note">
+            <s:assert test="not(.//db:note)">note must not occur in the descendants of note</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:note">
+            <s:assert test="not(.//db:tip)">tip must not occur in the descendants of note</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:note">
+            <s:assert test="not(.//db:warning)">warning must not occur in the descendants of note</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.note.attlist"/>
+        <ref name="db.admonition.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.tip.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.tip.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.tip.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.tip">
+      <element name="tip">
+        <a:documentation>A suggestion to the user, set off from the text</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:tip">
+            <s:assert test="not(.//db:caution)">caution must not occur in the descendants of tip</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:tip">
+            <s:assert test="not(.//db:important)">important must not occur in the descendants of tip</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:tip">
+            <s:assert test="not(.//db:note)">note must not occur in the descendants of tip</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:tip">
+            <s:assert test="not(.//db:tip)">tip must not occur in the descendants of tip</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:tip">
+            <s:assert test="not(.//db:warning)">warning must not occur in the descendants of tip</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.tip.attlist"/>
+        <ref name="db.admonition.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.warning.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.warning.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.warning.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.warning">
+      <element name="warning">
+        <a:documentation>An admonition set off from the text</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:warning">
+            <s:assert test="not(.//db:caution)">caution must not occur in the descendants of warning</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:warning">
+            <s:assert test="not(.//db:important)">important must not occur in the descendants of warning</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:warning">
+            <s:assert test="not(.//db:note)">note must not occur in the descendants of warning</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:warning">
+            <s:assert test="not(.//db:tip)">tip must not occur in the descendants of warning</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:warning">
+            <s:assert test="not(.//db:warning)">warning must not occur in the descendants of warning</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.warning.attlist"/>
+        <ref name="db.admonition.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.itemizedlist.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.itemizedlist.mark.attribute">
+      <attribute name="mark">
+        <a:documentation>Identifies the type of mark to be used on items in this list</a:documentation>
+        <data type="NMTOKEN"/>
+      </attribute>
+    </define>
+    <define name="db.itemizedlist.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.itemizedlist.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.spacing.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.itemizedlist.mark.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.itemizedlist.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.itemizedlist">
+      <element name="itemizedlist">
+        <a:documentation>A list in which each entry is marked with a bullet or other dingbat</a:documentation>
+        <ref name="db.itemizedlist.attlist"/>
+        <ref name="db.itemizedlist.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <oneOrMore>
+          <ref name="db.listitem"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.orderedlist.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.orderedlist.continuation.enumeration">
+      <choice>
+        <value>continues</value>
+        <a:documentation>Specifies that numbering should begin where the preceding list left off</a:documentation>
+        <value>restarts</value>
+        <a:documentation>Specifies that numbering should begin again at 1</a:documentation>
+      </choice>
+    </define>
+    <define name="db.orderedlist.continuation.attribute">
+      <attribute name="continuation">
+        <a:documentation>Indicates how list numbering should begin relative to the immediately preceding list</a:documentation>
+        <ref name="db.orderedlist.continuation.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.orderedlist.startingnumber.attribute">
+      <attribute name="startingnumber">
+        <a:documentation>Specifies the initial line number.</a:documentation>
+        <data type="integer"/>
+      </attribute>
+    </define>
+    <define name="db.orderedlist.inheritnum.enumeration">
+      <choice>
+        <value>ignore</value>
+        <a:documentation>Specifies that numbering should ignore list nesting</a:documentation>
+        <value>inherit</value>
+        <a:documentation>Specifies that numbering should inherit from outer-level lists</a:documentation>
+      </choice>
+    </define>
+    <define name="db.orderedlist.inheritnum.attribute">
+      <attribute name="inheritnum">
+        <a:documentation>Indicates whether or not item numbering should be influenced by list nesting</a:documentation>
+        <ref name="db.orderedlist.inheritnum.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.orderedlist.numeration.enumeration">
+      <choice>
+        <value>arabic</value>
+        <a:documentation>Specifies Arabic numeration (1, 2, 3, …)</a:documentation>
+        <value>upperalpha</value>
+        <a:documentation>Specifies upper-case alphabetic numeration (A, B, C, …)</a:documentation>
+        <value>loweralpha</value>
+        <a:documentation>Specifies lower-case alphabetic numeration (a, b, c, …)</a:documentation>
+        <value>upperroman</value>
+        <a:documentation>Specifies upper-case Roman numeration (I, II, III, …)</a:documentation>
+        <value>lowerroman</value>
+        <a:documentation>Specifies lower-case Roman numeration (i, ii, iii …)</a:documentation>
+      </choice>
+    </define>
+    <define name="db.orderedlist.numeration.attribute">
+      <attribute name="numeration">
+        <a:documentation>Indicates the desired numeration</a:documentation>
+        <ref name="db.orderedlist.numeration.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.orderedlist.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.orderedlist.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.spacing.attribute"/>
+        </optional>
+        <optional>
+          <choice>
+            <ref name="db.orderedlist.continuation.attribute"/>
+            <ref name="db.orderedlist.startingnumber.attribute"/>
+          </choice>
+        </optional>
+        <optional>
+          <ref name="db.orderedlist.inheritnum.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.orderedlist.numeration.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.orderedlist.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.orderedlist">
+      <element name="orderedlist">
+        <a:documentation>A list in which each entry is marked with a sequentially incremented label</a:documentation>
+        <ref name="db.orderedlist.attlist"/>
+        <ref name="db.orderedlist.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <oneOrMore>
+          <ref name="db.listitem"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.listitem.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.listitem.override.attribute">
+      <attribute name="override">
+        <a:documentation>Specifies the keyword for the type of mark that should be used on this
+ item, instead of the mark that would be used by default</a:documentation>
+        <data type="NMTOKEN"/>
+      </attribute>
+    </define>
+    <define name="db.listitem.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.listitem.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.listitem.override.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.listitem">
+      <element name="listitem">
+        <a:documentation>A wrapper for the elements of a list item</a:documentation>
+        <ref name="db.listitem.attlist"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.segmentedlist.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.segmentedlist.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.segmentedlist.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.segmentedlist.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.segmentedlist">
+      <element name="segmentedlist">
+        <a:documentation>A segmented list, a list of sets of elements</a:documentation>
+        <ref name="db.segmentedlist.attlist"/>
+        <ref name="db.segmentedlist.info"/>
+        <oneOrMore>
+          <ref name="db.segtitle"/>
+        </oneOrMore>
+        <oneOrMore>
+          <ref name="db.seglistitem"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.segtitle.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.segtitle.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.segtitle.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.segtitle">
+      <element name="segtitle">
+        <a:documentation>The title of an element of a list item in a segmented list</a:documentation>
+        <ref name="db.segtitle.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.seglistitem.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.seglistitem.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.seglistitem.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.seglistitem">
+      <element name="seglistitem">
+        <a:documentation>A list item in a segmented list</a:documentation>
+        <s:pattern name="Cardinality of segments and titles">
+          <s:rule context="db:seglistitem">
+            <s:assert test="count(db:seg) = count(../db:segtitle)">The number of seg elements must be the same as the number of segtitle elements in the parent segmentedlist</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.seglistitem.attlist"/>
+        <oneOrMore>
+          <ref name="db.seg"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.seg.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.seg.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.seg.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.seg">
+      <element name="seg">
+        <a:documentation>An element of a list item in a segmented list</a:documentation>
+        <ref name="db.seg.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.simplelist.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.simplelist.type.enumeration">
+      <choice>
+        <value>horiz</value>
+        <a:documentation>A tabular presentation in row-major order.</a:documentation>
+        <value>vert</value>
+        <a:documentation>A tabular presentation in column-major order.</a:documentation>
+        <value>inline</value>
+        <a:documentation>An inline presentation, usually a comma-delimited list.</a:documentation>
+      </choice>
+    </define>
+    <define name="db.simplelist.type.attribute">
+      <attribute name="type" a:defaultValue="vert">
+        <a:documentation>Specifies the type of list presentation.</a:documentation>
+        <ref name="db.simplelist.type.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.simplelist.columns.attribute">
+      <attribute name="columns">
+        <a:documentation>Specifies the number of columns for horizontal or vertical presentation</a:documentation>
+        <data type="integer"/>
+      </attribute>
+    </define>
+    <define name="db.simplelist.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.simplelist.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.simplelist.type.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.simplelist.columns.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.simplelist">
+      <element name="simplelist">
+        <a:documentation>An undecorated list of single words or short phrases</a:documentation>
+        <ref name="db.simplelist.attlist"/>
+        <oneOrMore>
+          <ref name="db.member"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.member.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.member.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.member.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.member">
+      <element name="member">
+        <a:documentation>An element of a simple list</a:documentation>
+        <ref name="db.member.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.variablelist.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.variablelist.termlength.attribute">
+      <attribute name="termlength">
+        <a:documentation>Indicates a length beyond which the presentation system may consider a term too long and select an alternate presentation for that term, item, or list</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.variablelist.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.variablelist.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.spacing.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.variablelist.termlength.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.variablelist.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.variablelist">
+      <element name="variablelist">
+        <a:documentation>A list in which each entry is composed of a set of one or more terms and an associated description</a:documentation>
+        <ref name="db.variablelist.attlist"/>
+        <ref name="db.variablelist.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <oneOrMore>
+          <ref name="db.varlistentry"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.varlistentry.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.varlistentry.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.varlistentry.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.varlistentry">
+      <element name="varlistentry">
+        <a:documentation>A wrapper for a set of terms and the associated description in a variable list</a:documentation>
+        <ref name="db.varlistentry.attlist"/>
+        <oneOrMore>
+          <ref name="db.term"/>
+        </oneOrMore>
+        <ref name="db.listitem"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.term.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.term.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.term.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.term">
+      <element name="term">
+        <a:documentation>The word or phrase being defined or described in a variable list</a:documentation>
+        <ref name="db.term.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.example.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.example.label.attribute">
+      <ref name="db.label.attribute"/>
+    </define>
+    <define name="db.example.width.attribute">
+      <ref name="db.width.characters.attribute"/>
+    </define>
+    <define name="db.example.pgwide.attribute">
+      <ref name="db.pgwide.attribute"/>
+    </define>
+    <define name="db.example.floatstyle.attribute">
+      <ref name="db.floatstyle.attribute"/>
+    </define>
+    <define name="db.example.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.example.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.example.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.example.floatstyle.attribute"/>
+        </optional>
+        <optional>
+          <choice>
+            <ref name="db.example.width.attribute"/>
+            <ref name="db.example.pgwide.attribute"/>
+          </choice>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.example.info">
+      <ref name="db._info.title.onlyreq"/>
+    </define>
+    <define name="db.example">
+      <element name="example">
+        <a:documentation>A formal example, with a title</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:example">
+            <s:assert test="not(.//db:example)">example must not occur in the descendants of example</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:example">
+            <s:assert test="not(.//db:figure)">figure must not occur in the descendants of example</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:example">
+            <s:assert test="not(.//db:table)">table must not occur in the descendants of example</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:example">
+            <s:assert test="not(.//db:equation)">equation must not occur in the descendants of example</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:example">
+            <s:assert test="not(.//db:caution)">caution must not occur in the descendants of example</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:example">
+            <s:assert test="not(.//db:important)">important must not occur in the descendants of example</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:example">
+            <s:assert test="not(.//db:note)">note must not occur in the descendants of example</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:example">
+            <s:assert test="not(.//db:tip)">tip must not occur in the descendants of example</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:example">
+            <s:assert test="not(.//db:warning)">warning must not occur in the descendants of example</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.example.attlist"/>
+        <ref name="db.example.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+        <optional>
+          <ref name="db.caption"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.informalexample.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.informalexample.width.attribute">
+      <ref name="db.width.characters.attribute"/>
+    </define>
+    <define name="db.informalexample.floatstyle.attribute">
+      <ref name="db.floatstyle.attribute"/>
+    </define>
+    <define name="db.informalexample.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.informalexample.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.informalexample.floatstyle.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.informalexample.width.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.informalexample.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.informalexample">
+      <element name="informalexample">
+        <a:documentation>A displayed example without a title</a:documentation>
+        <ref name="db.informalexample.attlist"/>
+        <ref name="db.informalexample.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+        <optional>
+          <ref name="db.caption"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <define name="db.verbatim.inlines">
+    <choice>
+      <choice>
+        <ref name="db.all.inlines"/>
+        <ref name="db.lineannotation"/>
+      </choice>
+      <ref name="db.co"/>
+    </choice>
+  </define>
+  <define name="db.verbatim.contentmodel">
+    <ref name="db._info.title.forbidden"/>
+    <choice>
+      <ref name="db.textobject"/>
+      <zeroOrMore>
+        <ref name="db.verbatim.inlines"/>
+      </zeroOrMore>
+    </choice>
+  </define>
+  <div>
+    <define name="db.programlisting.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.programlisting.width.attribute">
+      <ref name="db.width.characters.attribute"/>
+    </define>
+    <define name="db.programlisting.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.programlisting.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.verbatim.attributes"/>
+        <optional>
+          <ref name="db.programlisting.width.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.programlisting">
+      <element name="programlisting">
+        <a:documentation>A literal listing of all or part of a program</a:documentation>
+        <ref name="db.programlisting.attlist"/>
+        <ref name="db.verbatim.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.literallayout.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.literallayout.class.enumeration">
+      <choice>
+        <value>monospaced</value>
+        <a:documentation>The literal layout should be formatted with a monospaced font</a:documentation>
+        <value>normal</value>
+        <a:documentation>The literal layout should be formatted with the current font</a:documentation>
+      </choice>
+    </define>
+    <define name="db.literallayout.class.attribute">
+      <attribute name="class">
+        <a:documentation>Specifies the class of literal layout</a:documentation>
+        <ref name="db.literallayout.class.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.literallayout.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.literallayout.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.verbatim.attributes"/>
+        <optional>
+          <ref name="db.literallayout.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.literallayout">
+      <element name="literallayout">
+        <a:documentation>A block of text in which line breaks and white space are to be reproduced faithfully</a:documentation>
+        <ref name="db.literallayout.attlist"/>
+        <ref name="db.verbatim.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.screen.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.screen.width.attribute">
+      <ref name="db.width.characters.attribute"/>
+    </define>
+    <define name="db.screen.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.screen.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.verbatim.attributes"/>
+        <optional>
+          <ref name="db.screen.width.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.screen">
+      <element name="screen">
+        <a:documentation>Text that a user sees or might see on a computer screen</a:documentation>
+        <ref name="db.screen.attlist"/>
+        <ref name="db.verbatim.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.screenshot.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.screenshot.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.screenshot.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.screenshot.info">
+      <ref name="db._info"/>
+    </define>
+    <define name="db.screenshot">
+      <element name="screenshot">
+        <a:documentation>A representation of what the user sees or might see on a computer screen</a:documentation>
+        <ref name="db.screenshot.attlist"/>
+        <ref name="db.screenshot.info"/>
+        <ref name="db.mediaobject"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.figure.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.figure.label.attribute">
+      <ref name="db.label.attribute"/>
+    </define>
+    <define name="db.figure.pgwide.attribute">
+      <ref name="db.pgwide.attribute"/>
+    </define>
+    <define name="db.figure.floatstyle.attribute">
+      <ref name="db.floatstyle.attribute"/>
+    </define>
+    <define name="db.figure.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.figure.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.figure.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.figure.pgwide.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.figure.floatstyle.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.figure.info">
+      <ref name="db._info.title.onlyreq"/>
+    </define>
+    <define name="db.figure">
+      <element name="figure">
+        <a:documentation>A formal figure, generally an illustration, with a title</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:figure">
+            <s:assert test="not(.//db:example)">example must not occur in the descendants of figure</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:figure">
+            <s:assert test="not(.//db:figure)">figure must not occur in the descendants of figure</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:figure">
+            <s:assert test="not(.//db:table)">table must not occur in the descendants of figure</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:figure">
+            <s:assert test="not(.//db:equation)">equation must not occur in the descendants of figure</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:figure">
+            <s:assert test="not(.//db:caution)">caution must not occur in the descendants of figure</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:figure">
+            <s:assert test="not(.//db:important)">important must not occur in the descendants of figure</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:figure">
+            <s:assert test="not(.//db:note)">note must not occur in the descendants of figure</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:figure">
+            <s:assert test="not(.//db:tip)">tip must not occur in the descendants of figure</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:figure">
+            <s:assert test="not(.//db:warning)">warning must not occur in the descendants of figure</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.figure.attlist"/>
+        <ref name="db.figure.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+        <optional>
+          <ref name="db.caption"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.informalfigure.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.informalfigure.label.attribute">
+      <ref name="db.label.attribute"/>
+    </define>
+    <define name="db.informalfigure.pgwide.attribute">
+      <ref name="db.pgwide.attribute"/>
+    </define>
+    <define name="db.informalfigure.floatstyle.attribute">
+      <ref name="db.floatstyle.attribute"/>
+    </define>
+    <define name="db.informalfigure.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.informalfigure.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.informalfigure.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.informalfigure.pgwide.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.informalfigure.floatstyle.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.informalfigure.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.informalfigure">
+      <element name="informalfigure">
+        <a:documentation>A untitled figure</a:documentation>
+        <ref name="db.informalfigure.attlist"/>
+        <ref name="db.informalfigure.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+        <optional>
+          <ref name="db.caption"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <define name="db.mediaobject.content">
+    <choice>
+      <choice>
+        <ref name="db.videoobject"/>
+        <ref name="db.audioobject"/>
+        <ref name="db.imageobject"/>
+        <ref name="db.textobject"/>
+      </choice>
+      <ref name="db.imageobjectco"/>
+    </choice>
+  </define>
+  <div>
+    <define name="db.mediaobject.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.mediaobject.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.mediaobject.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.mediaobject.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.mediaobject">
+      <element name="mediaobject">
+        <a:documentation>A displayed media object (video, audio, image, etc.)</a:documentation>
+        <ref name="db.mediaobject.attlist"/>
+        <ref name="db.mediaobject.info"/>
+        <optional>
+          <ref name="db.alt"/>
+        </optional>
+        <oneOrMore>
+          <ref name="db.mediaobject.content"/>
+        </oneOrMore>
+        <optional>
+          <ref name="db.caption"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.inlinemediaobject.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.inlinemediaobject.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.inlinemediaobject.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.inlinemediaobject.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.inlinemediaobject">
+      <element name="inlinemediaobject">
+        <a:documentation>An inline media object (video, audio, image, and so on)</a:documentation>
+        <ref name="db.inlinemediaobject.attlist"/>
+        <ref name="db.inlinemediaobject.info"/>
+        <optional>
+          <ref name="db.alt"/>
+        </optional>
+        <oneOrMore>
+          <ref name="db.mediaobject.content"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.videoobject.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.videoobject.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.videoobject.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.videoobject.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.videoobject">
+      <element name="videoobject">
+        <a:documentation>A wrapper for video data and its associated meta-information</a:documentation>
+        <ref name="db.videoobject.attlist"/>
+        <ref name="db.videoobject.info"/>
+        <ref name="db.videodata"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.audioobject.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.audioobject.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.audioobject.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.audioobject.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.audioobject">
+      <element name="audioobject">
+        <a:documentation>A wrapper for audio data and its associated meta-information</a:documentation>
+        <ref name="db.audioobject.attlist"/>
+        <ref name="db.audioobject.info"/>
+        <ref name="db.audiodata"/>
+      </element>
+    </define>
+  </div>
+  <define name="db.imageobject.content">
+    <choice>
+      <ref name="db.imagedata"/>
+      <ref name="db.imagedata.mathml"/>
+      <ref name="db.imagedata.svg"/>
+    </choice>
+  </define>
+  <div>
+    <define name="db.imageobject.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.imageobject.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.imageobject.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.imageobject.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.imageobject">
+      <element name="imageobject">
+        <a:documentation>A wrapper for image data and its associated meta-information</a:documentation>
+        <ref name="db.imageobject.attlist"/>
+        <ref name="db.imageobject.info"/>
+        <ref name="db.imageobject.content"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.textobject.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.textobject.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.textobject.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.textobject.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.textobject">
+      <element name="textobject">
+        <a:documentation>A wrapper for a text description of an object and its associated meta-information</a:documentation>
+        <ref name="db.textobject.attlist"/>
+        <ref name="db.textobject.info"/>
+        <choice>
+          <ref name="db.phrase"/>
+          <ref name="db.textdata"/>
+          <oneOrMore>
+            <ref name="db.all.blocks"/>
+          </oneOrMore>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.videodata.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.videodata.align.enumeration">
+      <ref name="db.halign.enumeration"/>
+    </define>
+    <define name="db.videodata.align.attribute">
+      <attribute name="align">
+        <a:documentation>Specifies the (horizontal) alignment of the video data</a:documentation>
+        <ref name="db.videodata.align.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.videodata.valign.enumeration">
+      <ref name="db.valign.enumeration"/>
+    </define>
+    <define name="db.videodata.valign.attribute">
+      <attribute name="valign">
+        <a:documentation>Specifies the vertical alignment of the video data</a:documentation>
+        <ref name="db.videodata.valign.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.videodata.width.attribute">
+      <ref name="db.width.attribute"/>
+    </define>
+    <define name="db.videodata.depth.attribute">
+      <ref name="db.depth.attribute"/>
+    </define>
+    <define name="db.videodata.contentwidth.attribute">
+      <ref name="db.contentwidth.attribute"/>
+    </define>
+    <define name="db.videodata.contentdepth.attribute">
+      <ref name="db.contentdepth.attribute"/>
+    </define>
+    <define name="db.videodata.scalefit.enumeration">
+      <ref name="db.scalefit.enumeration"/>
+    </define>
+    <define name="db.videodata.scalefit.attribute">
+      <attribute name="scalefit">
+        <a:documentation>Determines if anamorphic scaling is forbidden</a:documentation>
+        <ref name="db.videodata.scalefit.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.videodata.scale.attribute">
+      <ref name="db.scale.attribute"/>
+    </define>
+    <define name="db.videodata.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.videodata.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.data.attributes"/>
+        <optional>
+          <ref name="db.videodata.align.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.videodata.valign.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.videodata.width.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.videodata.contentwidth.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.videodata.scalefit.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.videodata.scale.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.videodata.depth.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.videodata.contentdepth.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.videodata.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.videodata">
+      <element name="videodata">
+        <a:documentation>Pointer to external video data</a:documentation>
+        <ref name="db.videodata.attlist"/>
+        <ref name="db.videodata.info"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.audiodata.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.audiodata.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.audiodata.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.data.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.audiodata.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.audiodata">
+      <element name="audiodata">
+        <a:documentation>Pointer to external audio data</a:documentation>
+        <ref name="db.audiodata.attlist"/>
+        <ref name="db.audiodata.info"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.imagedata.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.imagedata.align.enumeration">
+      <ref name="db.halign.enumeration"/>
+    </define>
+    <define name="db.imagedata.align.attribute">
+      <attribute name="align">
+        <a:documentation>Specifies the (horizontal) alignment of the image data</a:documentation>
+        <ref name="db.imagedata.align.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.imagedata.valign.enumeration">
+      <ref name="db.valign.enumeration"/>
+    </define>
+    <define name="db.imagedata.valign.attribute">
+      <attribute name="valign">
+        <a:documentation>Specifies the vertical alignment of the image data</a:documentation>
+        <ref name="db.imagedata.valign.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.imagedata.width.attribute">
+      <ref name="db.width.attribute"/>
+    </define>
+    <define name="db.imagedata.depth.attribute">
+      <ref name="db.depth.attribute"/>
+    </define>
+    <define name="db.imagedata.contentwidth.attribute">
+      <ref name="db.contentwidth.attribute"/>
+    </define>
+    <define name="db.imagedata.contentdepth.attribute">
+      <ref name="db.contentdepth.attribute"/>
+    </define>
+    <define name="db.imagedata.scalefit.enumeration">
+      <ref name="db.scalefit.enumeration"/>
+    </define>
+    <define name="db.imagedata.scalefit.attribute">
+      <attribute name="scalefit">
+        <a:documentation>Determines if anamorphic scaling is forbidden</a:documentation>
+        <ref name="db.imagedata.scalefit.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.imagedata.scale.attribute">
+      <ref name="db.scale.attribute"/>
+    </define>
+    <define name="db.imagedata.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.imagedata.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.data.attributes"/>
+        <optional>
+          <ref name="db.imagedata.align.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.valign.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.width.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.contentwidth.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.scalefit.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.scale.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.depth.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.contentdepth.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.imagedata.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.imagedata">
+      <element name="imagedata">
+        <a:documentation>Pointer to external image data</a:documentation>
+        <ref name="db.imagedata.attlist"/>
+        <ref name="db.imagedata.info"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.textdata.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.textdata.encoding.attribute">
+      <attribute name="encoding">
+        <a:documentation>Identifies the encoding of the text in the external file</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.textdata.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.textdata.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.data.attributes"/>
+        <optional>
+          <ref name="db.textdata.encoding.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.textdata.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.textdata">
+      <element name="textdata">
+        <a:documentation>Pointer to external text data</a:documentation>
+        <ref name="db.textdata.attlist"/>
+        <ref name="db.textdata.info"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.caption.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.caption.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.caption.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.caption.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.caption">
+      <element name="caption">
+        <a:documentation>A caption</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:example)">example must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:figure)">figure must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:table)">table must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:equation)">equation must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:caution)">caution must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:important)">important must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:note)">note must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:tip)">tip must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:warning)">warning must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:sidebar)">sidebar must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:task)">task must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.caption.attlist"/>
+        <ref name="db.caption.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.synopsis.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.synopsis.label.attribute">
+      <ref name="db.label.attribute"/>
+    </define>
+    <define name="db.synopsis.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.synopsis.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.verbatim.attributes"/>
+        <optional>
+          <ref name="db.synopsis.label.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.synopsis">
+      <element name="synopsis">
+        <a:documentation>A general-purpose element for representing the syntax of commands or functions</a:documentation>
+        <ref name="db.synopsis.attlist"/>
+        <ref name="db.verbatim.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.cmdsynopsis.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.cmdsynopsis.sepchar.attribute">
+      <attribute name="sepchar">
+        <a:documentation>Specifies the character that should separate the command and its top-level arguments</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.cmdsynopsis.cmdlength.attribute">
+      <attribute name="cmdlength">
+        <a:documentation>Indicates the displayed length of the command; this information may be used to intelligently indent command synopses which extend beyond one line</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.cmdsynopsis.label.attribute">
+      <ref name="db.label.attribute"/>
+    </define>
+    <define name="db.cmdsynopsis.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.cmdsynopsis.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.cmdsynopsis.sepchar.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.cmdsynopsis.cmdlength.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.cmdsynopsis.label.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.cmdsynopsis.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.cmdsynopsis">
+      <element name="cmdsynopsis">
+        <a:documentation>A syntax summary for a software command</a:documentation>
+        <ref name="db.cmdsynopsis.attlist"/>
+        <ref name="db.cmdsynopsis.info"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.command"/>
+            <ref name="db.arg"/>
+            <ref name="db.group"/>
+            <ref name="db.sbr"/>
+          </choice>
+        </oneOrMore>
+        <zeroOrMore>
+          <ref name="db.synopfragment"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.rep.enumeration">
+    <choice>
+      <value>norepeat</value>
+      <a:documentation>Can not be repeated.</a:documentation>
+      <value>repeat</value>
+      <a:documentation>Can be repeated.</a:documentation>
+    </choice>
+  </define>
+  <define name="db.rep.attribute">
+    <attribute name="rep" a:defaultValue="norepeat">
+      <a:documentation>Indicates whether or not repetition is possible.</a:documentation>
+      <ref name="db.rep.enumeration"/>
+    </attribute>
+  </define>
+  <define name="db.choice.enumeration">
+    <choice>
+      <value>opt</value>
+      <a:documentation>Formatted to indicate that it is optional.</a:documentation>
+      <value>plain</value>
+      <a:documentation>Formatted without indication.</a:documentation>
+      <value>req</value>
+      <a:documentation>Formatted to indicate that it is required.</a:documentation>
+    </choice>
+  </define>
+  <define name="db.choice.opt.attribute">
+    <attribute name="choice" a:defaultValue="opt">
+      <a:documentation>Indicates optionality.</a:documentation>
+      <ref name="db.choice.enumeration"/>
+    </attribute>
+  </define>
+  <define name="db.choice.req.attribute">
+    <attribute name="choice" a:defaultValue="req">
+      <a:documentation>Indicates optionality.</a:documentation>
+      <ref name="db.choice.enumeration"/>
+    </attribute>
+  </define>
+  <div>
+    <define name="db.arg.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.arg.rep.attribute">
+      <ref name="db.rep.attribute"/>
+    </define>
+    <define name="db.arg.choice.attribute">
+      <ref name="db.choice.opt.attribute"/>
+    </define>
+    <define name="db.arg.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.arg.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.arg.rep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.arg.choice.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.arg">
+      <element name="arg">
+        <a:documentation>An argument in a CmdSynopsis</a:documentation>
+        <ref name="db.arg.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.arg"/>
+            <ref name="db.group"/>
+            <ref name="db.option"/>
+            <ref name="db.synopfragmentref"/>
+            <ref name="db.sbr"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.group.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.group.rep.attribute">
+      <ref name="db.rep.attribute"/>
+    </define>
+    <define name="db.group.choice.attribute">
+      <ref name="db.choice.opt.attribute"/>
+    </define>
+    <define name="db.group.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.group.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.group.rep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.group.choice.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.group">
+      <element name="group">
+        <a:documentation>A group of elements in a CmdSynopsis</a:documentation>
+        <ref name="db.group.attlist"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.arg"/>
+            <ref name="db.group"/>
+            <ref name="db.option"/>
+            <ref name="db.synopfragmentref"/>
+            <ref name="db.replaceable"/>
+            <ref name="db.sbr"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.sbr.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.sbr.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.sbr.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.sbr">
+      <element name="sbr">
+        <a:documentation>An explicit line break in a command synopsis</a:documentation>
+        <ref name="db.sbr.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.synopfragment.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.synopfragment.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.synopfragment.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.synopfragment">
+      <element name="synopfragment">
+        <a:documentation>A portion of a CmdSynopsis broken out from the main body of the synopsis</a:documentation>
+        <ref name="db.synopfragment.attlist"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.arg"/>
+            <ref name="db.group"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.synopfragmentref.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.synopfragmentref.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.synopfragmentref.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.linkend.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.synopfragmentref">
+      <element name="synopfragmentref">
+        <a:documentation>A reference to a fragment of a command synopsis</a:documentation>
+        <s:pattern name="Synopsis fragment type constraint">
+          <s:rule context="db:synopfragmentref">
+            <s:assert test="local-name(//*[@xml:id=current()/@linkend]) = 'synopfragment' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'">@linkend on synopfragmentref must point to a synopfragment.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.synopfragmentref.attlist"/>
+        <text/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.funcsynopsis.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.funcsynopsis.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.funcsynopsis.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.language.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.funcsynopsis.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.funcsynopsis">
+      <element name="funcsynopsis">
+        <a:documentation>The syntax summary for a function definition</a:documentation>
+        <ref name="db.funcsynopsis.attlist"/>
+        <ref name="db.funcsynopsis.info"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.funcsynopsisinfo"/>
+            <ref name="db.funcprototype"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.funcsynopsisinfo.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.funcsynopsisinfo.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.funcsynopsisinfo.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.verbatim.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.funcsynopsisinfo">
+      <element name="funcsynopsisinfo">
+        <a:documentation>Information supplementing the FuncDefs of a FuncSynopsis</a:documentation>
+        <ref name="db.funcsynopsisinfo.attlist"/>
+        <ref name="db.verbatim.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.funcprototype.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.funcprototype.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.funcprototype.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.funcprototype">
+      <element name="funcprototype">
+        <a:documentation>The prototype of a function</a:documentation>
+        <ref name="db.funcprototype.attlist"/>
+        <zeroOrMore>
+          <ref name="db.modifier"/>
+        </zeroOrMore>
+        <ref name="db.funcdef"/>
+        <choice>
+          <ref name="db.void"/>
+          <ref name="db.varargs"/>
+          <group>
+            <oneOrMore>
+              <ref name="db.paramdef"/>
+            </oneOrMore>
+            <optional>
+              <ref name="db.varargs"/>
+            </optional>
+          </group>
+        </choice>
+        <zeroOrMore>
+          <ref name="db.modifier"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.funcdef.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.funcdef.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.funcdef.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.funcdef">
+      <element name="funcdef">
+        <a:documentation>A function (subroutine) name and its return type</a:documentation>
+        <ref name="db.funcdef.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.type"/>
+            <ref name="db.function"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.void.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.void.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.void.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.void">
+      <element name="void">
+        <a:documentation>An empty element in a function synopsis indicating that the function in question takes no arguments</a:documentation>
+        <ref name="db.void.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.varargs.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.varargs.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.varargs.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.varargs">
+      <element name="varargs">
+        <a:documentation>An empty element in a function synopsis indicating a variable number of arguments</a:documentation>
+        <ref name="db.varargs.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.paramdef.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.paramdef.choice.enumeration">
+      <choice>
+        <value>opt</value>
+        <a:documentation>Formatted to indicate that it is optional.</a:documentation>
+        <value>req</value>
+        <a:documentation>Formatted to indicate that it is required.</a:documentation>
+      </choice>
+    </define>
+    <define name="db.paramdef.choice.attribute">
+      <attribute name="choice" a:defaultValue="opt">
+        <a:documentation>Indicates optionality.</a:documentation>
+        <ref name="db.paramdef.choice.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.paramdef.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.paramdef.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.paramdef.choice.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.paramdef">
+      <element name="paramdef">
+        <a:documentation>Information about a function parameter in a programming language</a:documentation>
+        <ref name="db.paramdef.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.initializer"/>
+            <ref name="db.type"/>
+            <ref name="db.parameter"/>
+            <ref name="db.funcparams"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.funcparams.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.funcparams.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.funcparams.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.funcparams">
+      <element name="funcparams">
+        <a:documentation>Parameters for a function referenced through a function pointer in a synopsis</a:documentation>
+        <ref name="db.funcparams.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.classsynopsis.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.classsynopsis.class.enumeration">
+      <choice>
+        <value>class</value>
+        <a:documentation>This is the synopsis of a class</a:documentation>
+        <value>interface</value>
+        <a:documentation>This is the synopsis of an interface</a:documentation>
+      </choice>
+    </define>
+    <define name="db.classsynopsis.class.attribute">
+      <attribute name="class">
+        <a:documentation>Specifies the nature of the synopsis</a:documentation>
+        <ref name="db.classsynopsis.class.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.classsynopsis.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.classsynopsis.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.language.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.classsynopsis.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.classsynopsis">
+      <element name="classsynopsis">
+        <a:documentation>The syntax summary for a class definition</a:documentation>
+        <ref name="db.classsynopsis.attlist"/>
+        <oneOrMore>
+          <ref name="db.oo.inlines"/>
+        </oneOrMore>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.classsynopsisinfo"/>
+            <ref name="db.methodsynopsis"/>
+            <ref name="db.constructorsynopsis"/>
+            <ref name="db.destructorsynopsis"/>
+            <ref name="db.fieldsynopsis"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.classsynopsisinfo.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.classsynopsisinfo.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.classsynopsisinfo.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.verbatim.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.classsynopsisinfo">
+      <element name="classsynopsisinfo">
+        <a:documentation>Information supplementing the contents of a ClassSynopsis</a:documentation>
+        <ref name="db.classsynopsisinfo.attlist"/>
+        <ref name="db.verbatim.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.ooclass.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.ooclass.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.ooclass.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.ooclass">
+      <element name="ooclass">
+        <a:documentation>A class in an object-oriented programming language</a:documentation>
+        <ref name="db.ooclass.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.package"/>
+            <ref name="db.modifier"/>
+          </choice>
+        </zeroOrMore>
+        <ref name="db.classname"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.oointerface.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.oointerface.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.oointerface.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.oointerface">
+      <element name="oointerface">
+        <a:documentation>An interface in an object-oriented programming language</a:documentation>
+        <ref name="db.oointerface.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.package"/>
+            <ref name="db.modifier"/>
+          </choice>
+        </zeroOrMore>
+        <ref name="db.interfacename"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.ooexception.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.ooexception.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.ooexception.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.ooexception">
+      <element name="ooexception">
+        <a:documentation>An exception in an object-oriented programming language</a:documentation>
+        <ref name="db.ooexception.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.package"/>
+            <ref name="db.modifier"/>
+          </choice>
+        </zeroOrMore>
+        <ref name="db.exceptionname"/>
+      </element>
+    </define>
+  </div>
+  <define name="db.modifier.xml.space.attribute">
+    <attribute name="xml:space">
+      <a:documentation>Can be used to indicate that whitespace in the modifier should be preserved (for multi-line annotations, for example).</a:documentation>
+      <value>preserve</value>
+      <a:documentation>Extra whitespace and line breaks must be preserved.</a:documentation>
+<!--
+        Ideally the definition of xml:space used on modifier would be
+        different from the definition used on the verbatim elements. The
+        verbatim elements forbid the use of xml:space="default" which
+        wouldn't be a problem on modifier. But doing that causes the
+        generated XSD schemas to be broken so I'm just reusing the existing
+        definition for now. It won't be backwards incompatible to fix this
+        problem in the future.
+           | ## Extra whitespace and line breaks are not preserved.
+             "default"
+      -->
+    </attribute>
+  </define>
+  <div>
+    <define name="db.modifier.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.modifier.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.modifier.xml.space.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.modifier.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.modifier">
+      <element name="modifier">
+        <a:documentation>Modifiers in a synopsis</a:documentation>
+        <ref name="db.modifier.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.interfacename.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.interfacename.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.interfacename.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.interfacename">
+      <element name="interfacename">
+        <a:documentation>The name of an interface</a:documentation>
+        <ref name="db.interfacename.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.exceptionname.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.exceptionname.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.exceptionname.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.exceptionname">
+      <element name="exceptionname">
+        <a:documentation>The name of an exception</a:documentation>
+        <ref name="db.exceptionname.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.fieldsynopsis.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.fieldsynopsis.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.fieldsynopsis.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.language.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.fieldsynopsis">
+      <element name="fieldsynopsis">
+        <a:documentation>The name of a field in a class definition</a:documentation>
+        <ref name="db.fieldsynopsis.attlist"/>
+        <zeroOrMore>
+          <ref name="db.modifier"/>
+        </zeroOrMore>
+        <optional>
+          <ref name="db.type"/>
+        </optional>
+        <ref name="db.varname"/>
+        <optional>
+          <ref name="db.initializer"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.initializer.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.initializer.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.initializer.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.initializer">
+      <element name="initializer">
+        <a:documentation>The initializer for a FieldSynopsis</a:documentation>
+        <ref name="db.initializer.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.constructorsynopsis.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.constructorsynopsis.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.constructorsynopsis.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.language.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.constructorsynopsis">
+      <element name="constructorsynopsis">
+        <a:documentation>A syntax summary for a constructor</a:documentation>
+        <ref name="db.constructorsynopsis.attlist"/>
+        <zeroOrMore>
+          <ref name="db.modifier"/>
+        </zeroOrMore>
+        <optional>
+          <ref name="db.methodname"/>
+        </optional>
+        <choice>
+          <oneOrMore>
+            <ref name="db.methodparam"/>
+          </oneOrMore>
+          <optional>
+            <ref name="db.void"/>
+          </optional>
+        </choice>
+        <zeroOrMore>
+          <ref name="db.exceptionname"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.destructorsynopsis.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.destructorsynopsis.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.destructorsynopsis.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.language.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.destructorsynopsis">
+      <element name="destructorsynopsis">
+        <a:documentation>A syntax summary for a destructor</a:documentation>
+        <ref name="db.destructorsynopsis.attlist"/>
+        <zeroOrMore>
+          <ref name="db.modifier"/>
+        </zeroOrMore>
+        <optional>
+          <ref name="db.methodname"/>
+        </optional>
+        <choice>
+          <oneOrMore>
+            <ref name="db.methodparam"/>
+          </oneOrMore>
+          <optional>
+            <ref name="db.void"/>
+          </optional>
+        </choice>
+        <zeroOrMore>
+          <ref name="db.exceptionname"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.methodsynopsis.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.methodsynopsis.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.methodsynopsis.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.language.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.methodsynopsis">
+      <element name="methodsynopsis">
+        <a:documentation>A syntax summary for a method</a:documentation>
+        <ref name="db.methodsynopsis.attlist"/>
+        <zeroOrMore>
+          <ref name="db.modifier"/>
+        </zeroOrMore>
+        <optional>
+          <choice>
+            <ref name="db.type"/>
+            <ref name="db.void"/>
+          </choice>
+        </optional>
+        <ref name="db.methodname"/>
+        <choice>
+          <oneOrMore>
+            <ref name="db.methodparam"/>
+          </oneOrMore>
+          <ref name="db.void"/>
+        </choice>
+        <zeroOrMore>
+          <ref name="db.exceptionname"/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name="db.modifier"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.methodname.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.methodname.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.methodname.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.methodname">
+      <element name="methodname">
+        <a:documentation>The name of a method</a:documentation>
+        <ref name="db.methodname.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.methodparam.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.methodparam.rep.attribute">
+      <ref name="db.rep.attribute"/>
+    </define>
+    <define name="db.methodparam.choice.attribute">
+      <ref name="db.choice.req.attribute"/>
+    </define>
+    <define name="db.methodparam.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.methodparam.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.methodparam.rep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.methodparam.choice.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.methodparam">
+      <element name="methodparam">
+        <a:documentation>Parameters to a method</a:documentation>
+        <ref name="db.methodparam.attlist"/>
+        <zeroOrMore>
+          <ref name="db.modifier"/>
+        </zeroOrMore>
+        <optional>
+          <ref name="db.type"/>
+        </optional>
+        <choice>
+          <group>
+            <zeroOrMore>
+              <ref name="db.modifier"/>
+            </zeroOrMore>
+            <ref name="db.parameter"/>
+            <optional>
+              <ref name="db.initializer"/>
+            </optional>
+          </group>
+          <ref name="db.funcparams"/>
+        </choice>
+        <zeroOrMore>
+          <ref name="db.modifier"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.address.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.address.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.address.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.verbatim.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.address">
+      <element name="address">
+        <a:documentation>A real-world address, generally a postal address</a:documentation>
+        <ref name="db.address.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.personname"/>
+            <ref name="db.pob"/>
+            <ref name="db.street"/>
+            <ref name="db.city"/>
+            <ref name="db.state"/>
+            <ref name="db.postcode"/>
+            <ref name="db.country"/>
+            <ref name="db.phone"/>
+            <ref name="db.fax"/>
+            <ref name="db.email"/>
+            <ref name="db.otheraddr"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.street.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.street.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.street.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.street">
+      <element name="street">
+        <a:documentation>A street address in an address</a:documentation>
+        <ref name="db.street.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.pob.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.pob.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.pob.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.pob">
+      <element name="pob">
+        <a:documentation>A post office box in an address</a:documentation>
+        <ref name="db.pob.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.postcode.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.postcode.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.postcode.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.postcode">
+      <element name="postcode">
+        <a:documentation>A postal code in an address</a:documentation>
+        <ref name="db.postcode.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.city.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.city.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.city.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.city">
+      <element name="city">
+        <a:documentation>The name of a city in an address</a:documentation>
+        <ref name="db.city.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.state.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.state.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.state.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.state">
+      <element name="state">
+        <a:documentation>A state or province in an address</a:documentation>
+        <ref name="db.state.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.country.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.country.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.country.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.country">
+      <element name="country">
+        <a:documentation>The name of a country</a:documentation>
+        <ref name="db.country.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.phone.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.phone.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.phone.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.phone">
+      <element name="phone">
+        <a:documentation>A telephone number</a:documentation>
+        <ref name="db.phone.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.fax.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.fax.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.fax.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.fax">
+      <element name="fax">
+        <a:documentation>A fax number</a:documentation>
+        <ref name="db.fax.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.otheraddr.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.otheraddr.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.otheraddr.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.otheraddr">
+      <element name="otheraddr">
+        <a:documentation>Uncategorized information in address</a:documentation>
+        <ref name="db.otheraddr.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.affiliation.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.affiliation.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.affiliation.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.affiliation">
+      <element name="affiliation">
+        <a:documentation>The institutional affiliation of an individual</a:documentation>
+        <ref name="db.affiliation.attlist"/>
+        <optional>
+          <ref name="db.shortaffil"/>
+        </optional>
+        <zeroOrMore>
+          <ref name="db.jobtitle"/>
+        </zeroOrMore>
+        <choice>
+          <optional>
+            <ref name="db.org"/>
+          </optional>
+          <group>
+            <optional>
+              <ref name="db.orgname"/>
+            </optional>
+            <zeroOrMore>
+              <ref name="db.orgdiv"/>
+            </zeroOrMore>
+            <zeroOrMore>
+              <ref name="db.address"/>
+            </zeroOrMore>
+          </group>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.shortaffil.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.shortaffil.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.shortaffil.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.shortaffil">
+      <element name="shortaffil">
+        <a:documentation>A brief description of an affiliation</a:documentation>
+        <ref name="db.shortaffil.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.jobtitle.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.jobtitle.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.jobtitle.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.jobtitle">
+      <element name="jobtitle">
+        <a:documentation>The title of an individual in an organization</a:documentation>
+        <ref name="db.jobtitle.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.orgname.class.enumeration">
+      <choice>
+        <value>consortium</value>
+        <a:documentation>A consortium</a:documentation>
+        <value>corporation</value>
+        <a:documentation>A corporation</a:documentation>
+        <value>informal</value>
+        <a:documentation>An informal organization</a:documentation>
+        <value>nonprofit</value>
+        <a:documentation>A non-profit organization</a:documentation>
+      </choice>
+    </define>
+    <define name="db.orgname.class-enum.attribute">
+      <attribute name="class">
+        <a:documentation>Specifies the nature of the organization</a:documentation>
+        <ref name="db.orgname.class.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.orgname.class-other.attributes">
+      <attribute name="class">
+        <a:documentation>Specifies the nature of the organization</a:documentation>
+        <value>other</value>
+        <a:documentation>Indicates a non-standard organization class</a:documentation>
+      </attribute>
+      <attribute name="otherclass">
+        <a:documentation>Identifies the non-standard nature of the organization</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.orgname.class.attribute">
+      <choice>
+        <ref name="db.orgname.class-enum.attribute"/>
+        <ref name="db.orgname.class-other.attributes"/>
+      </choice>
+    </define>
+    <define name="db.orgname.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.orgname.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.orgname.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.orgname.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.orgname">
+      <element name="orgname">
+        <a:documentation>The name of an organization other than a corporation </a:documentation>
+        <ref name="db.orgname.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.orgdiv.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.orgdiv.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.orgdiv.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.orgdiv">
+      <element name="orgdiv">
+        <a:documentation>A division of an organization</a:documentation>
+        <ref name="db.orgdiv.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.artpagenums.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.artpagenums.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.artpagenums.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.artpagenums">
+      <element name="artpagenums">
+        <a:documentation>The page numbers of an article as published</a:documentation>
+        <ref name="db.artpagenums.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.personname.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.personname.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.personname.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.personname">
+      <element name="personname">
+        <a:documentation>The personal name of an individual</a:documentation>
+        <ref name="db.personname.attlist"/>
+        <choice>
+          <ref name="db._text"/>
+          <oneOrMore>
+            <choice>
+              <ref name="db.honorific"/>
+              <ref name="db.firstname"/>
+              <ref name="db.surname"/>
+              <ref name="db.lineage"/>
+              <ref name="db.othername"/>
+            </choice>
+          </oneOrMore>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <define name="db.person.author.contentmodel">
+    <ref name="db.personname"/>
+    <zeroOrMore>
+      <choice>
+        <ref name="db.personblurb"/>
+        <ref name="db.affiliation"/>
+        <ref name="db.email"/>
+        <ref name="db.address"/>
+        <ref name="db.contrib"/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="db.org.author.contentmodel">
+    <ref name="db.orgname"/>
+    <zeroOrMore>
+      <choice>
+        <ref name="db.orgdiv"/>
+        <ref name="db.affiliation"/>
+        <ref name="db.email"/>
+        <ref name="db.address"/>
+        <ref name="db.contrib"/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="db.credit.contentmodel">
+    <choice>
+      <ref name="db.person.author.contentmodel"/>
+      <ref name="db.org.author.contentmodel"/>
+    </choice>
+  </define>
+  <div>
+    <define name="db.author.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.author.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.author.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.author">
+      <element name="author">
+        <a:documentation>The name of an individual author</a:documentation>
+        <ref name="db.author.attlist"/>
+        <ref name="db.credit.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.authorgroup.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.authorgroup.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.authorgroup.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.authorgroup">
+      <element name="authorgroup">
+        <a:documentation>Wrapper for author information when a document has multiple authors or collabarators</a:documentation>
+        <ref name="db.authorgroup.attlist"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.author"/>
+            <ref name="db.editor"/>
+            <ref name="db.othercredit"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.collab.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.collab.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.collab.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.collab">
+      <element name="collab">
+        <a:documentation>Identifies a collaborator</a:documentation>
+        <ref name="db.collab.attlist"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.person"/>
+            <ref name="db.personname"/>
+            <ref name="db.org"/>
+            <ref name="db.orgname"/>
+          </choice>
+        </oneOrMore>
+        <zeroOrMore>
+          <ref name="db.affiliation"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.authorinitials.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.authorinitials.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.authorinitials.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.authorinitials">
+      <element name="authorinitials">
+        <a:documentation>The initials or other short identifier for an author</a:documentation>
+        <ref name="db.authorinitials.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.person.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.person.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.person.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.person">
+      <element name="person">
+        <a:documentation>A person and associated metadata</a:documentation>
+        <ref name="db.person.attlist"/>
+        <ref name="db.personname"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.address"/>
+            <ref name="db.affiliation"/>
+            <ref name="db.email"/>
+            <ref name="db.personblurb"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.org.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.org.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.org.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.org">
+      <element name="org">
+        <a:documentation>An organization and associated metadata</a:documentation>
+        <ref name="db.org.attlist"/>
+        <ref name="db.orgname"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.address"/>
+            <ref name="db.affiliation"/>
+            <ref name="db.email"/>
+            <ref name="db.orgdiv"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.confgroup.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.confgroup.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.confgroup.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.confgroup">
+      <element name="confgroup">
+        <a:documentation>A wrapper for document meta-information about a conference</a:documentation>
+        <ref name="db.confgroup.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.confdates"/>
+            <ref name="db.conftitle"/>
+            <ref name="db.confnum"/>
+            <ref name="db.confsponsor"/>
+            <ref name="db.address"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.confdates.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.confdates.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.confdates.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.confdates">
+      <element name="confdates">
+        <a:documentation>The dates of a conference for which a document was written</a:documentation>
+        <ref name="db.confdates.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.conftitle.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.conftitle.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.conftitle.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.conftitle">
+      <element name="conftitle">
+        <a:documentation>The title of a conference for which a document was written</a:documentation>
+        <ref name="db.conftitle.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.confnum.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.confnum.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.confnum.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.confnum">
+      <element name="confnum">
+        <a:documentation>An identifier, frequently numerical, associated with a conference for which a document was written</a:documentation>
+        <ref name="db.confnum.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.confsponsor.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.confsponsor.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.confsponsor.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.confsponsor">
+      <element name="confsponsor">
+        <a:documentation>The sponsor of a conference for which a document was written</a:documentation>
+        <ref name="db.confsponsor.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.contractnum.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.contractnum.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.contractnum.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.contractnum">
+      <element name="contractnum">
+        <a:documentation>The contract number of a document</a:documentation>
+        <ref name="db.contractnum.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.contractsponsor.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.contractsponsor.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.contractsponsor.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.contractsponsor">
+      <element name="contractsponsor">
+        <a:documentation>The sponsor of a contract</a:documentation>
+        <ref name="db.contractsponsor.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.copyright.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.copyright.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.copyright.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.copyright">
+      <element name="copyright">
+        <a:documentation>Copyright information about a document</a:documentation>
+        <ref name="db.copyright.attlist"/>
+        <oneOrMore>
+          <ref name="db.year"/>
+        </oneOrMore>
+        <zeroOrMore>
+          <ref name="db.holder"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.year.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.year.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.year.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.year">
+      <element name="year">
+        <a:documentation>The year of publication of a document</a:documentation>
+        <ref name="db.year.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.holder.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.holder.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.holder.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.holder">
+      <element name="holder">
+        <a:documentation>The name of the individual or organization that holds a copyright</a:documentation>
+        <ref name="db.holder.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <define name="db.cover.contentmodel">
+    <oneOrMore>
+      <choice>
+        <ref name="db.para.blocks"/>
+        <ref name="db.extension.blocks"/>
+        <ref name="db.list.blocks"/>
+        <ref name="db.informal.blocks"/>
+        <ref name="db.publishing.blocks"/>
+        <ref name="db.graphic.blocks"/>
+        <ref name="db.technical.blocks"/>
+        <ref name="db.verbatim.blocks"/>
+        <ref name="db.bridgehead"/>
+        <ref name="db.synopsis.blocks"/>
+        <ref name="db.remark"/>
+        <ref name="db.revhistory"/>
+      </choice>
+    </oneOrMore>
+  </define>
+  <div>
+    <define name="db.cover.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.cover.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.cover.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.cover">
+      <element name="cover">
+        <a:documentation>Additional content for the cover of a publication</a:documentation>
+        <ref name="db.cover.attlist"/>
+        <ref name="db.cover.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <define name="db.date.contentmodel">
+    <choice>
+      <data type="date"/>
+      <data type="dateTime"/>
+      <data type="gYearMonth"/>
+      <data type="gYear"/>
+      <text/>
+    </choice>
+  </define>
+  <div>
+    <define name="db.date.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.date.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.date.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.date">
+      <element name="date">
+        <a:documentation>The date of publication or revision of a document</a:documentation>
+        <ref name="db.date.attlist"/>
+        <ref name="db.date.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.edition.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.edition.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.edition.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.edition">
+      <element name="edition">
+        <a:documentation>The name or number of an edition of a document</a:documentation>
+        <ref name="db.edition.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.editor.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.editor.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.editor.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.editor">
+      <element name="editor">
+        <a:documentation>The name of the editor of a document</a:documentation>
+        <ref name="db.editor.attlist"/>
+        <ref name="db.credit.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.biblioid.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.biblioid.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.biblioid.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.biblio.class.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.biblioid">
+      <element name="biblioid">
+        <a:documentation>An identifier for a document</a:documentation>
+        <ref name="db.biblioid.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.citebiblioid.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.citebiblioid.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.citebiblioid.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.biblio.class.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.citebiblioid">
+      <element name="citebiblioid">
+        <a:documentation>A citation of a bibliographic identifier</a:documentation>
+        <ref name="db.citebiblioid.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.bibliosource.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.bibliosource.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.bibliosource.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.biblio.class.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.bibliosource">
+      <element name="bibliosource">
+        <a:documentation>The source of a document</a:documentation>
+        <ref name="db.bibliosource.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.bibliorelation.type.enumeration">
+      <choice>
+        <value>hasformat</value>
+        <a:documentation>The described resource pre-existed the referenced resource, which is essentially the same intellectual content presented in another format</a:documentation>
+        <value>haspart</value>
+        <a:documentation>The described resource includes the referenced resource either physically or logically</a:documentation>
+        <value>hasversion</value>
+        <a:documentation>The described resource has a version, edition, or adaptation, namely, the referenced resource</a:documentation>
+        <value>isformatof</value>
+        <a:documentation>The described resource is the same intellectual content of the referenced resource, but presented in another format</a:documentation>
+        <value>ispartof</value>
+        <a:documentation>The described resource is a physical or logical part of the referenced resource</a:documentation>
+        <value>isreferencedby</value>
+        <a:documentation>The described resource is referenced, cited, or otherwise pointed to by the referenced resource</a:documentation>
+        <value>isreplacedby</value>
+        <a:documentation>The described resource is supplanted, displaced, or superceded by the referenced resource</a:documentation>
+        <value>isrequiredby</value>
+        <a:documentation>The described resource is required by the referenced resource, either physically or logically</a:documentation>
+        <value>isversionof</value>
+        <a:documentation>The described resource is a version, edition, or adaptation of the referenced resource; changes in version imply substantive changes in content rather than differences in format</a:documentation>
+        <value>references</value>
+        <a:documentation>The described resource references, cites, or otherwise points to the referenced resource</a:documentation>
+        <value>replaces</value>
+        <a:documentation>The described resource supplants, displaces, or supersedes the referenced resource</a:documentation>
+        <value>requires</value>
+        <a:documentation>The described resource requires the referenced resource to support its function, delivery, or coherence of content</a:documentation>
+      </choice>
+    </define>
+    <define name="db.bibliorelation.type-enum.attribute">
+      <optional>
+        <attribute name="type">
+          <a:documentation>Identifies the type of relationship</a:documentation>
+          <ref name="db.bibliorelation.type.enumeration"/>
+        </attribute>
+      </optional>
+    </define>
+    <define name="db.bibliorelation.type-other.attributes">
+      <optional>
+        <attribute name="type">
+          <a:documentation>Identifies the type of relationship</a:documentation>
+          <value>othertype</value>
+          <a:documentation>The described resource has a non-standard relationship with the referenced resource</a:documentation>
+        </attribute>
+      </optional>
+      <attribute name="othertype">
+        <a:documentation>A keyword that identififes the type of the non-standard relationship</a:documentation>
+        <data type="NMTOKEN"/>
+      </attribute>
+    </define>
+    <define name="db.bibliorelation.type.attribute">
+      <choice>
+        <ref name="db.bibliorelation.type-enum.attribute"/>
+        <ref name="db.bibliorelation.type-other.attributes"/>
+      </choice>
+    </define>
+    <define name="db.bibliorelation.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.bibliorelation.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.bibliorelation.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.biblio.class.attribute"/>
+        <ref name="db.bibliorelation.type.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.bibliorelation">
+      <element name="bibliorelation">
+        <a:documentation>The relationship of a document to another</a:documentation>
+        <ref name="db.bibliorelation.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.bibliocoverage.spacial.enumeration">
+      <choice>
+        <value>dcmipoint</value>
+        <a:documentation>The DCMI Point identifies a point in space using its geographic coordinates</a:documentation>
+        <value>iso3166</value>
+        <a:documentation>ISO 3166 Codes for the representation of names of countries</a:documentation>
+        <value>dcmibox</value>
+        <a:documentation>The DCMI Box identifies a region of space using its geographic limits</a:documentation>
+        <value>tgn</value>
+        <a:documentation>The Getty Thesaurus of Geographic Names</a:documentation>
+      </choice>
+    </define>
+    <define name="db.bibliocoverage.spatial-enum.attribute">
+      <optional>
+        <attribute name="spatial">
+          <a:documentation>Specifies the type of spatial coverage</a:documentation>
+          <ref name="db.bibliocoverage.spacial.enumeration"/>
+        </attribute>
+      </optional>
+    </define>
+    <define name="db.bibliocoverage.spatial-other.attributes">
+      <optional>
+        <attribute name="spatial">
+          <a:documentation>Specifies the type of spatial coverage</a:documentation>
+          <value>otherspatial</value>
+          <a:documentation>Identifies a non-standard type of coverage</a:documentation>
+        </attribute>
+      </optional>
+      <attribute name="otherspatial">
+        <a:documentation>A keyword that identifies the type of non-standard coverage</a:documentation>
+        <data type="NMTOKEN"/>
+      </attribute>
+    </define>
+    <define name="db.bibliocoverage.spatial.attribute">
+      <choice>
+        <ref name="db.bibliocoverage.spatial-enum.attribute"/>
+        <ref name="db.bibliocoverage.spatial-other.attributes"/>
+      </choice>
+    </define>
+    <define name="db.bibliocoverage.temporal.enumeration">
+      <choice>
+        <value>dcmiperiod</value>
+        <a:documentation>A specification of the limits of a time interval</a:documentation>
+        <value>w3c-dtf</value>
+        <a:documentation>W3C Encoding rules for dates and times—a profile based on ISO 8601</a:documentation>
+      </choice>
+    </define>
+    <define name="db.bibliocoverage.temporal-enum.attribute">
+      <optional>
+        <attribute name="temporal">
+          <a:documentation>Specifies the type of temporal coverage</a:documentation>
+          <ref name="db.bibliocoverage.temporal.enumeration"/>
+        </attribute>
+      </optional>
+    </define>
+    <define name="db.bibliocoverage.temporal-other.attributes">
+      <optional>
+        <attribute name="temporal">
+          <a:documentation>Specifies the type of temporal coverage</a:documentation>
+          <value>othertemporal</value>
+          <a:documentation>Specifies a non-standard type of coverage</a:documentation>
+        </attribute>
+      </optional>
+      <attribute name="othertemporal">
+        <a:documentation>A keyword that identifies the type of non-standard coverage</a:documentation>
+        <data type="NMTOKEN"/>
+      </attribute>
+    </define>
+    <define name="db.bibliocoverage.temporal.attribute">
+      <choice>
+        <ref name="db.bibliocoverage.temporal-enum.attribute"/>
+        <ref name="db.bibliocoverage.temporal-other.attributes"/>
+      </choice>
+    </define>
+    <define name="db.bibliocoverage.coverage.attrib">
+      <interleave>
+        <ref name="db.bibliocoverage.spatial.attribute"/>
+        <ref name="db.bibliocoverage.temporal.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.bibliocoverage.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.bibliocoverage.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.bibliocoverage.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.bibliocoverage.coverage.attrib"/>
+      </interleave>
+    </define>
+    <define name="db.bibliocoverage">
+      <element name="bibliocoverage">
+        <a:documentation>The spatial or temporal coverage of a document</a:documentation>
+        <ref name="db.bibliocoverage.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.legalnotice.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.legalnotice.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.legalnotice.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.legalnotice.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.legalnotice">
+      <element name="legalnotice">
+        <a:documentation>A statement of legal obligations or requirements</a:documentation>
+        <ref name="db.legalnotice.attlist"/>
+        <ref name="db.legalnotice.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.othercredit.class.enumeration">
+      <choice>
+        <value>copyeditor</value>
+        <a:documentation>A copy editor</a:documentation>
+        <value>graphicdesigner</value>
+        <a:documentation>A graphic designer</a:documentation>
+        <value>other</value>
+        <a:documentation>Some other contributor</a:documentation>
+        <value>productioneditor</value>
+        <a:documentation>A production editor</a:documentation>
+        <value>technicaleditor</value>
+        <a:documentation>A technical editor</a:documentation>
+        <value>translator</value>
+        <a:documentation>A translator</a:documentation>
+      </choice>
+    </define>
+    <define name="db.othercredit.class-enum.attribute">
+      <optional>
+        <attribute name="class">
+          <a:documentation>Identifies the nature of the contributor</a:documentation>
+          <ref name="db.othercredit.class.enumeration"/>
+        </attribute>
+      </optional>
+    </define>
+    <define name="db.othercredit.class-other.attribute">
+      <attribute name="otherclass">
+        <a:documentation>Identifies the nature of the non-standard contribution</a:documentation>
+        <data type="NMTOKEN"/>
+      </attribute>
+    </define>
+    <define name="db.othercredit.class-other.attributes">
+      <interleave>
+        <attribute name="class">
+          <a:documentation>Identifies the nature of the contributor</a:documentation>
+          <value>other</value>
+          <a:documentation>Identifies a non-standard contribution</a:documentation>
+        </attribute>
+        <ref name="db.othercredit.class-other.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.othercredit.class.attribute">
+      <choice>
+        <ref name="db.othercredit.class-enum.attribute"/>
+        <ref name="db.othercredit.class-other.attributes"/>
+      </choice>
+    </define>
+    <define name="db.othercredit.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.othercredit.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.othercredit.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.othercredit.class.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.othercredit">
+      <element name="othercredit">
+        <a:documentation>A person or entity, other than an author or editor, credited in a document</a:documentation>
+        <ref name="db.othercredit.attlist"/>
+        <ref name="db.credit.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.pagenums.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.pagenums.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.pagenums.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.pagenums">
+      <element name="pagenums">
+        <a:documentation>The numbers of the pages in a book, for use in a bibliographic entry</a:documentation>
+        <ref name="db.pagenums.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.contrib.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.contrib.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.contrib.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.contrib">
+      <element name="contrib">
+        <a:documentation>A summary of the contributions made to a document by a credited source</a:documentation>
+        <ref name="db.contrib.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.honorific.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.honorific.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.honorific.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.honorific">
+      <element name="honorific">
+        <a:documentation>The title of a person</a:documentation>
+        <ref name="db.honorific.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.firstname.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.firstname.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.firstname.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.firstname">
+      <element name="firstname">
+        <a:documentation>The first name of a person</a:documentation>
+        <ref name="db.firstname.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.surname.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.surname.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.surname.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.surname">
+      <element name="surname">
+        <a:documentation>A family name; in western cultures the last name</a:documentation>
+        <ref name="db.surname.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.lineage.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.lineage.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.lineage.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.lineage">
+      <element name="lineage">
+        <a:documentation>The portion of a person's name indicating a relationship to ancestors</a:documentation>
+        <ref name="db.lineage.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.othername.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.othername.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.othername.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.othername">
+      <element name="othername">
+        <a:documentation>A component of a persons name that is not a first name, surname, or lineage</a:documentation>
+        <ref name="db.othername.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.printhistory.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.printhistory.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.printhistory.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.printhistory">
+      <element name="printhistory">
+        <a:documentation>The printing history of a document</a:documentation>
+        <ref name="db.printhistory.attlist"/>
+        <oneOrMore>
+          <ref name="db.para.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.productname.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.productname.class.enumeration">
+      <choice>
+        <value>copyright</value>
+        <a:documentation>A name with a copyright</a:documentation>
+        <value>registered</value>
+        <a:documentation>A name with a registered copyright</a:documentation>
+        <value>service</value>
+        <a:documentation>A name of a service</a:documentation>
+        <value>trade</value>
+        <a:documentation>A name which is trademarked</a:documentation>
+      </choice>
+    </define>
+    <define name="db.productname.class.attribute">
+      <attribute name="class">
+        <a:documentation>Specifies the class of product name</a:documentation>
+        <ref name="db.productname.class.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.productname.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.productname.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.productname.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.productname">
+      <element name="productname">
+        <a:documentation>The formal name of a product</a:documentation>
+        <ref name="db.productname.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.productnumber.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.productnumber.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.productnumber.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.productnumber">
+      <element name="productnumber">
+        <a:documentation>A number assigned to a product</a:documentation>
+        <ref name="db.productnumber.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.pubdate.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.pubdate.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.pubdate.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.pubdate">
+      <element name="pubdate">
+        <a:documentation>The date of publication of a document</a:documentation>
+        <ref name="db.pubdate.attlist"/>
+        <ref name="db.date.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.publisher.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.publisher.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.publisher.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.publisher">
+      <element name="publisher">
+        <a:documentation>The publisher of a document</a:documentation>
+        <ref name="db.publisher.attlist"/>
+        <ref name="db.publishername"/>
+        <zeroOrMore>
+          <ref name="db.address"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.publishername.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.publishername.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.publishername.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.publishername">
+      <element name="publishername">
+        <a:documentation>The name of the publisher of a document</a:documentation>
+        <ref name="db.publishername.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.releaseinfo.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.releaseinfo.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.releaseinfo.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.releaseinfo">
+      <element name="releaseinfo">
+        <a:documentation>Information about a particular release of a document</a:documentation>
+        <ref name="db.releaseinfo.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.revhistory.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.revhistory.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.revhistory.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.revhistory.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.revhistory">
+      <element name="revhistory">
+        <a:documentation>A history of the revisions to a document</a:documentation>
+        <ref name="db.revhistory.attlist"/>
+        <ref name="db.revhistory.info"/>
+        <oneOrMore>
+          <ref name="db.revision"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.revision.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.revision.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.revision.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.revision">
+      <element name="revision">
+        <a:documentation>An entry describing a single revision in the history of the revisions to a document</a:documentation>
+        <ref name="db.revision.attlist"/>
+        <optional>
+          <ref name="db.revnumber"/>
+        </optional>
+        <ref name="db.date"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.authorinitials"/>
+            <ref name="db.author"/>
+          </choice>
+        </zeroOrMore>
+        <optional>
+          <choice>
+            <ref name="db.revremark"/>
+            <ref name="db.revdescription"/>
+          </choice>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.revnumber.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.revnumber.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.revnumber.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.revnumber">
+      <element name="revnumber">
+        <a:documentation>A document revision number</a:documentation>
+        <ref name="db.revnumber.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.revremark.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.revremark.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.revremark.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.revremark">
+      <element name="revremark">
+        <a:documentation>A description of a revision to a document</a:documentation>
+        <ref name="db.revremark.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.revdescription.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.revdescription.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.revdescription.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.revdescription">
+      <element name="revdescription">
+        <a:documentation>A extended description of a revision to a document</a:documentation>
+        <ref name="db.revdescription.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.seriesvolnums.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.seriesvolnums.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.seriesvolnums.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.seriesvolnums">
+      <element name="seriesvolnums">
+        <a:documentation>Numbers of the volumes in a series of books</a:documentation>
+        <ref name="db.seriesvolnums.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.volumenum.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.volumenum.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.volumenum.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.volumenum">
+      <element name="volumenum">
+        <a:documentation>The volume number of a document in a set (as of books in a set or articles in a journal)</a:documentation>
+        <ref name="db.volumenum.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.issuenum.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.issuenum.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.issuenum.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.issuenum">
+      <element name="issuenum">
+        <a:documentation>The number of an issue of a journal</a:documentation>
+        <ref name="db.issuenum.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.accel.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.accel.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.accel.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.accel">
+      <element name="accel">
+        <a:documentation>A graphical user interface (GUI) keyboard shortcut</a:documentation>
+        <ref name="db.accel.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.application.class.enumeration">
+      <choice>
+        <value>hardware</value>
+        <a:documentation>A hardware application</a:documentation>
+        <value>software</value>
+        <a:documentation>A software application</a:documentation>
+      </choice>
+    </define>
+    <define name="db.application.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the class of application</a:documentation>
+        <ref name="db.application.class.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.application.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.application.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.application.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.application.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.application">
+      <element name="application">
+        <a:documentation>The name of a software program</a:documentation>
+        <ref name="db.application.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.package.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.package.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.package.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.package">
+      <element name="package">
+        <a:documentation>A software or application package</a:documentation>
+        <ref name="db.package.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.classname.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.classname.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.classname.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.classname">
+      <element name="classname">
+        <a:documentation>The name of a class, in the object-oriented programming sense</a:documentation>
+        <ref name="db.classname.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.command.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.command.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.command.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.command">
+      <element name="command">
+        <a:documentation>The name of an executable program or other software command</a:documentation>
+        <ref name="db.command.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <define name="db.computeroutput.inlines">
+    <choice>
+      <choice>
+        <text/>
+        <ref name="db.ubiq.inlines"/>
+        <ref name="db.os.inlines"/>
+        <ref name="db.technical.inlines"/>
+        <ref name="db.markup.inlines"/>
+      </choice>
+      <ref name="db.co"/>
+    </choice>
+  </define>
+  <div>
+    <define name="db.computeroutput.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.computeroutput.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.computeroutput.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.computeroutput">
+      <element name="computeroutput">
+        <a:documentation>Data, generally text, displayed or presented by a computer</a:documentation>
+        <ref name="db.computeroutput.attlist"/>
+        <zeroOrMore>
+          <ref name="db.computeroutput.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.database.class.enumeration">
+      <choice>
+        <value>altkey</value>
+        <a:documentation>An alternate or secondary key</a:documentation>
+        <value>constraint</value>
+        <a:documentation>A constraint</a:documentation>
+        <value>datatype</value>
+        <a:documentation>A data type</a:documentation>
+        <value>field</value>
+        <a:documentation>A field</a:documentation>
+        <value>foreignkey</value>
+        <a:documentation>A foreign key</a:documentation>
+        <value>group</value>
+        <a:documentation>A group</a:documentation>
+        <value>index</value>
+        <a:documentation>An index</a:documentation>
+        <value>key1</value>
+        <a:documentation>The first or primary key</a:documentation>
+        <value>key2</value>
+        <a:documentation>An alternate or secondary key</a:documentation>
+        <value>name</value>
+        <a:documentation>A name</a:documentation>
+        <value>primarykey</value>
+        <a:documentation>The primary key</a:documentation>
+        <value>procedure</value>
+        <a:documentation>A (stored) procedure</a:documentation>
+        <value>record</value>
+        <a:documentation>A record</a:documentation>
+        <value>rule</value>
+        <a:documentation>A rule</a:documentation>
+        <value>secondarykey</value>
+        <a:documentation>The secondary key</a:documentation>
+        <value>table</value>
+        <a:documentation>A table</a:documentation>
+        <value>user</value>
+        <a:documentation>A user</a:documentation>
+        <value>view</value>
+        <a:documentation>A view</a:documentation>
+      </choice>
+    </define>
+    <define name="db.database.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the class of database artifact</a:documentation>
+        <ref name="db.database.class.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.database.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.database.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.database.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.database.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.database">
+      <element name="database">
+        <a:documentation>The name of a database, or part of a database</a:documentation>
+        <ref name="db.database.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.email.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.email.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.email.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.email">
+      <element name="email">
+        <a:documentation>An email address</a:documentation>
+        <ref name="db.email.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.envar.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.envar.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.envar.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.envar">
+      <element name="envar">
+        <a:documentation>A software environment variable</a:documentation>
+        <ref name="db.envar.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.errorcode.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.errorcode.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.errorcode.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.errorcode">
+      <element name="errorcode">
+        <a:documentation>An error code</a:documentation>
+        <ref name="db.errorcode.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.errorname.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.errorname.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.errorname.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.errorname">
+      <element name="errorname">
+        <a:documentation>An error name</a:documentation>
+        <ref name="db.errorname.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.errortext.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.errortext.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.errortext.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.errortext">
+      <element name="errortext">
+        <a:documentation>An error message.</a:documentation>
+        <ref name="db.errortext.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.errortype.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.errortype.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.errortype.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.errortype">
+      <element name="errortype">
+        <a:documentation>The classification of an error message</a:documentation>
+        <ref name="db.errortype.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.filename.class.enumeration">
+      <choice>
+        <value>devicefile</value>
+        <a:documentation>A device</a:documentation>
+        <value>directory</value>
+        <a:documentation>A directory</a:documentation>
+        <value>extension</value>
+        <a:documentation>A filename extension</a:documentation>
+        <value>headerfile</value>
+        <a:documentation>A header file (as for a programming language)</a:documentation>
+        <value>libraryfile</value>
+        <a:documentation>A library file</a:documentation>
+        <value>partition</value>
+        <a:documentation>A partition (as of a hard disk)</a:documentation>
+        <value>symlink</value>
+        <a:documentation>A symbolic link</a:documentation>
+      </choice>
+    </define>
+    <define name="db.filename.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the class of filename</a:documentation>
+        <ref name="db.filename.class.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.filename.path.attribute">
+      <attribute name="path">
+        <a:documentation>Specifies the path of the filename</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.filename.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.filename.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.filename.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.filename.path.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.filename.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.filename">
+      <element name="filename">
+        <a:documentation>The name of a file</a:documentation>
+        <ref name="db.filename.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.function.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.function.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.function.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.function">
+      <element name="function">
+        <a:documentation>The name of a function or subroutine, as in a programming language</a:documentation>
+        <ref name="db.function.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.guibutton.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.guibutton.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.guibutton.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.guibutton">
+      <element name="guibutton">
+        <a:documentation>The text on a button in a GUI</a:documentation>
+        <ref name="db.guibutton.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.accel"/>
+            <ref name="db.superscript"/>
+            <ref name="db.subscript"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.guiicon.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.guiicon.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.guiicon.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.guiicon">
+      <element name="guiicon">
+        <a:documentation>Graphic and/or text appearing as a icon in a GUI</a:documentation>
+        <ref name="db.guiicon.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.accel"/>
+            <ref name="db.superscript"/>
+            <ref name="db.subscript"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.guilabel.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.guilabel.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.guilabel.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.guilabel">
+      <element name="guilabel">
+        <a:documentation>The text of a label in a GUI</a:documentation>
+        <ref name="db.guilabel.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.accel"/>
+            <ref name="db.superscript"/>
+            <ref name="db.subscript"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.guimenu.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.guimenu.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.guimenu.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.guimenu">
+      <element name="guimenu">
+        <a:documentation>The name of a menu in a GUI</a:documentation>
+        <ref name="db.guimenu.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.accel"/>
+            <ref name="db.superscript"/>
+            <ref name="db.subscript"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.guimenuitem.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.guimenuitem.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.guimenuitem.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.guimenuitem">
+      <element name="guimenuitem">
+        <a:documentation>The name of a terminal menu item in a GUI</a:documentation>
+        <ref name="db.guimenuitem.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.accel"/>
+            <ref name="db.superscript"/>
+            <ref name="db.subscript"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.guisubmenu.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.guisubmenu.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.guisubmenu.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.guisubmenu">
+      <element name="guisubmenu">
+        <a:documentation>The name of a submenu in a GUI</a:documentation>
+        <ref name="db.guisubmenu.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.accel"/>
+            <ref name="db.superscript"/>
+            <ref name="db.subscript"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.hardware.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.hardware.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.hardware.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.hardware">
+      <element name="hardware">
+        <a:documentation>A physical part of a computer system</a:documentation>
+        <ref name="db.hardware.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.keycap.function.enumeration">
+      <choice>
+        <value>alt</value>
+        <a:documentation>The "Alt" key</a:documentation>
+        <value>backspace</value>
+        <a:documentation>The "Backspace" key</a:documentation>
+        <value>command</value>
+        <a:documentation>The "Command" key</a:documentation>
+        <value>control</value>
+        <a:documentation>The "Control" key</a:documentation>
+        <value>delete</value>
+        <a:documentation>The "Delete" key</a:documentation>
+        <value>down</value>
+        <a:documentation>The down arrow</a:documentation>
+        <value>end</value>
+        <a:documentation>The "End" key</a:documentation>
+        <value>enter</value>
+        <a:documentation>The "Enter" or "Return" key</a:documentation>
+        <value>escape</value>
+        <a:documentation>The "Escape" key</a:documentation>
+        <value>home</value>
+        <a:documentation>The "Home" key</a:documentation>
+        <value>insert</value>
+        <a:documentation>The "Insert" key</a:documentation>
+        <value>left</value>
+        <a:documentation>The left arrow</a:documentation>
+        <value>meta</value>
+        <a:documentation>The "Meta" key</a:documentation>
+        <value>option</value>
+        <a:documentation>The "Option" key</a:documentation>
+        <value>pagedown</value>
+        <a:documentation>The page down key</a:documentation>
+        <value>pageup</value>
+        <a:documentation>The page up key</a:documentation>
+        <value>right</value>
+        <a:documentation>The right arrow</a:documentation>
+        <value>shift</value>
+        <a:documentation>The "Shift" key</a:documentation>
+        <value>space</value>
+        <a:documentation>The spacebar</a:documentation>
+        <value>tab</value>
+        <a:documentation>The "Tab" key</a:documentation>
+        <value>up</value>
+        <a:documentation>The up arrow</a:documentation>
+      </choice>
+    </define>
+    <define name="db.keycap.function-enum.attribute">
+      <optional>
+        <attribute name="function">
+          <a:documentation>Identifies the function key</a:documentation>
+          <ref name="db.keycap.function.enumeration"/>
+        </attribute>
+      </optional>
+    </define>
+    <define name="db.keycap.function-other.attributes">
+      <optional>
+        <attribute name="function">
+          <a:documentation>Identifies the function key</a:documentation>
+          <value>other</value>
+          <a:documentation>Indicates a non-standard function key</a:documentation>
+        </attribute>
+      </optional>
+      <attribute name="otherfunction">
+        <a:documentation>Specifies a keyword that identifies the non-standard key</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.keycap.function.attrib">
+      <choice>
+        <ref name="db.keycap.function-enum.attribute"/>
+        <ref name="db.keycap.function-other.attributes"/>
+      </choice>
+    </define>
+    <define name="db.keycap.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.keycap.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.keycap.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.keycap.function.attrib"/>
+      </interleave>
+    </define>
+    <define name="db.keycap">
+      <element name="keycap">
+        <a:documentation>The text printed on a key on a keyboard</a:documentation>
+        <ref name="db.keycap.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.keycode.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.keycode.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.keycode.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.keycode">
+      <element name="keycode">
+        <a:documentation>The internal, frequently numeric, identifier for a key on a keyboard</a:documentation>
+        <ref name="db.keycode.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.keycombo.action.enumeration">
+      <choice>
+        <value>click</value>
+        <a:documentation>A (single) mouse click.</a:documentation>
+        <value>double-click</value>
+        <a:documentation>A double mouse click.</a:documentation>
+        <value>press</value>
+        <a:documentation>A mouse or key press.</a:documentation>
+        <value>seq</value>
+        <a:documentation>Sequential clicks or presses.</a:documentation>
+        <value>simul</value>
+        <a:documentation>Simultaneous clicks or presses.</a:documentation>
+      </choice>
+    </define>
+    <define name="db.keycombo.action-enum.attribute">
+      <optional>
+        <attribute name="action">
+          <a:documentation>Identifies the nature of the action taken. If keycombo
+ contains more than one element, simul
+ is the default, otherwise there is no default.</a:documentation>
+          <ref name="db.keycombo.action.enumeration"/>
+        </attribute>
+      </optional>
+    </define>
+    <define name="db.keycombo.action-other.attributes">
+      <optional>
+        <attribute name="action">
+          <a:documentation>Identifies the nature of the action taken</a:documentation>
+          <value>other</value>
+          <a:documentation>Indicates a non-standard action</a:documentation>
+        </attribute>
+      </optional>
+      <attribute name="otheraction">
+        <a:documentation>Identifies the non-standard action in some unspecified way.</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.keycombo.action.attrib">
+      <choice>
+        <ref name="db.keycombo.action-enum.attribute"/>
+        <ref name="db.keycombo.action-other.attributes"/>
+      </choice>
+    </define>
+    <define name="db.keycombo.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.keycombo.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.keycombo.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.keycombo.action.attrib"/>
+      </interleave>
+    </define>
+    <define name="db.keycombo">
+      <element name="keycombo">
+        <a:documentation>A combination of input actions</a:documentation>
+        <ref name="db.keycombo.attlist"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.keycap"/>
+            <ref name="db.keycombo"/>
+            <ref name="db.keysym"/>
+            <ref name="db.mousebutton"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.keysym.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.keysym.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.keysym.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.keysym">
+      <element name="keysym">
+        <a:documentation>The symbolic name of a key on a keyboard</a:documentation>
+        <ref name="db.keysym.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.lineannotation.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.lineannotation.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.lineannotation.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.lineannotation">
+      <element name="lineannotation">
+        <a:documentation>A comment on a line in a verbatim listing</a:documentation>
+        <ref name="db.lineannotation.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.literal.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.literal.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.literal.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.literal">
+      <element name="literal">
+        <a:documentation>Inline text that is some literal value</a:documentation>
+        <ref name="db.literal.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="code.language.attribute">
+      <attribute name="language">
+        <a:documentation>Identifies the (computer) language of the code fragment</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.code.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.code.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.code.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="code.language.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.code">
+      <element name="code">
+        <a:documentation>An inline code fragment</a:documentation>
+        <ref name="db.code.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.programming.inlines"/>
+            <ref name="db._text"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.constant.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the class of constant</a:documentation>
+        <value>limit</value>
+        <a:documentation>The value is a limit of some kind</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.constant.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.constant.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.constant.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.constant.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.constant">
+      <element name="constant">
+        <a:documentation>A programming or system constant</a:documentation>
+        <ref name="db.constant.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.varname.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.varname.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.varname.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.varname">
+      <element name="varname">
+        <a:documentation>The name of a variable</a:documentation>
+        <ref name="db.varname.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.markup.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.markup.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.markup.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.markup">
+      <element name="markup">
+        <a:documentation>A string of formatting markup in text that is to be represented literally</a:documentation>
+        <ref name="db.markup.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.menuchoice.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.menuchoice.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.menuchoice.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.menuchoice">
+      <element name="menuchoice">
+        <a:documentation>A selection or series of selections from a menu</a:documentation>
+        <ref name="db.menuchoice.attlist"/>
+        <optional>
+          <ref name="db.shortcut"/>
+        </optional>
+        <oneOrMore>
+          <choice>
+            <ref name="db.guibutton"/>
+            <ref name="db.guiicon"/>
+            <ref name="db.guilabel"/>
+            <ref name="db.guimenu"/>
+            <ref name="db.guimenuitem"/>
+            <ref name="db.guisubmenu"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.shortcut.action.attrib">
+      <ref name="db.keycombo.action.attrib"/>
+    </define>
+    <define name="db.shortcut.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.shortcut.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.shortcut.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.shortcut.action.attrib"/>
+      </interleave>
+    </define>
+    <define name="db.shortcut">
+      <element name="shortcut">
+        <a:documentation>A key combination for an action that is also accessible through a menu</a:documentation>
+        <ref name="db.shortcut.attlist"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.keycap"/>
+            <ref name="db.keycombo"/>
+            <ref name="db.keysym"/>
+            <ref name="db.mousebutton"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.mousebutton.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.mousebutton.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.mousebutton.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.mousebutton">
+      <element name="mousebutton">
+        <a:documentation>The conventional name of a mouse button</a:documentation>
+        <ref name="db.mousebutton.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.option.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.option.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.option.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.option">
+      <element name="option">
+        <a:documentation>An option for a software command</a:documentation>
+        <ref name="db.option.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.optional.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.optional.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.optional.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.optional">
+      <element name="optional">
+        <a:documentation>Optional information</a:documentation>
+        <ref name="db.optional.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.property.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.property.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.property.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.property">
+      <element name="property">
+        <a:documentation>A unit of data associated with some part of a computer system</a:documentation>
+        <ref name="db.property.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.parameter.class.enumeration">
+      <choice>
+        <value>command</value>
+        <a:documentation>A command</a:documentation>
+        <value>function</value>
+        <a:documentation>A function</a:documentation>
+        <value>option</value>
+        <a:documentation>An option</a:documentation>
+      </choice>
+    </define>
+    <define name="db.parameter.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the class of parameter</a:documentation>
+        <ref name="db.parameter.class.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.parameter.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.parameter.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.parameter.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.parameter.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.parameter">
+      <element name="parameter">
+        <a:documentation>A value or a symbolic reference to a value</a:documentation>
+        <ref name="db.parameter.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <define name="db.prompt.inlines">
+    <choice>
+      <ref name="db._text"/>
+      <ref name="db.co"/>
+    </choice>
+  </define>
+  <div>
+    <define name="db.prompt.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.prompt.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.prompt.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.prompt">
+      <element name="prompt">
+        <a:documentation>A character or string indicating the start of an input field in a  computer display</a:documentation>
+        <ref name="db.prompt.attlist"/>
+        <zeroOrMore>
+          <ref name="db.prompt.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.replaceable.inlines">
+    <choice>
+      <ref name="db._text"/>
+      <ref name="db.co"/>
+    </choice>
+  </define>
+  <div>
+    <define name="db.replaceable.class.enumeration">
+      <choice>
+        <value>command</value>
+        <a:documentation>A command</a:documentation>
+        <value>function</value>
+        <a:documentation>A function</a:documentation>
+        <value>option</value>
+        <a:documentation>An option</a:documentation>
+        <value>parameter</value>
+        <a:documentation>A parameter</a:documentation>
+      </choice>
+    </define>
+    <define name="db.replaceable.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the nature of the replaceable text</a:documentation>
+        <ref name="db.replaceable.class.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.replaceable.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.replaceable.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.replaceable.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.replaceable.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.replaceable">
+      <element name="replaceable">
+        <a:documentation>Content that may or must be replaced by the user</a:documentation>
+        <ref name="db.replaceable.attlist"/>
+        <zeroOrMore>
+          <ref name="db.replaceable.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.returnvalue.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.returnvalue.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.returnvalue.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.returnvalue">
+      <element name="returnvalue">
+        <a:documentation>The value returned by a function</a:documentation>
+        <ref name="db.returnvalue.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.tag.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.tag.class.enumeration">
+      <choice>
+        <value>attribute</value>
+        <a:documentation>An attribute</a:documentation>
+        <value>attvalue</value>
+        <a:documentation>An attribute value</a:documentation>
+        <value>element</value>
+        <a:documentation>An element</a:documentation>
+        <value>emptytag</value>
+        <a:documentation>An empty element tag</a:documentation>
+        <value>endtag</value>
+        <a:documentation>An end tag</a:documentation>
+        <value>genentity</value>
+        <a:documentation>A general entity</a:documentation>
+        <value>localname</value>
+        <a:documentation>The local name part of a qualified name</a:documentation>
+        <value>namespace</value>
+        <a:documentation>A namespace</a:documentation>
+        <value>numcharref</value>
+        <a:documentation>A numeric character reference</a:documentation>
+        <value>paramentity</value>
+        <a:documentation>A parameter entity</a:documentation>
+        <value>pi</value>
+        <a:documentation>A processing instruction</a:documentation>
+        <value>prefix</value>
+        <a:documentation>The prefix part of a qualified name</a:documentation>
+        <value>comment</value>
+        <a:documentation>An SGML comment</a:documentation>
+        <value>starttag</value>
+        <a:documentation>A start tag</a:documentation>
+        <value>xmlpi</value>
+        <a:documentation>An XML processing instruction</a:documentation>
+      </choice>
+    </define>
+    <define name="db.tag.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the nature of the tag content</a:documentation>
+        <ref name="db.tag.class.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.tag.namespace.attribute">
+      <attribute name="namespace">
+        <a:documentation>Identifies the namespace of the tag content</a:documentation>
+        <data type="anyURI"/>
+      </attribute>
+    </define>
+    <define name="db.tag.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.tag.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.tag.class.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.tag.namespace.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.tag">
+      <element name="tag">
+        <a:documentation>A component of XML (or SGML) markup</a:documentation>
+        <ref name="db.tag.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.symbol.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the class of symbol</a:documentation>
+        <value>limit</value>
+        <a:documentation>The value is a limit of some kind</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.symbol.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.symbol.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.symbol.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.symbol.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.symbol">
+      <element name="symbol">
+        <a:documentation>A name that is replaced by a value before processing</a:documentation>
+        <ref name="db.symbol.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <define name="db.systemitem.inlines">
+    <choice>
+      <ref name="db._text"/>
+      <ref name="db.co"/>
+    </choice>
+  </define>
+  <div>
+    <define name="db.systemitem.class.enumeration">
+      <choice>
+        <value>daemon</value>
+        <a:documentation>A daemon or other system process (syslogd)</a:documentation>
+        <value>domainname</value>
+        <a:documentation>A domain name (example.com)</a:documentation>
+        <value>etheraddress</value>
+        <a:documentation>An ethernet address (00:05:4E:49:FD:8E)</a:documentation>
+        <value>event</value>
+        <a:documentation>An event of some sort (SIGHUP)</a:documentation>
+        <value>eventhandler</value>
+        <a:documentation>An event handler of some sort (hangup)</a:documentation>
+        <value>filesystem</value>
+        <a:documentation>A filesystem (ext3)</a:documentation>
+        <value>fqdomainname</value>
+        <a:documentation>A fully qualified domain name (my.example.com)</a:documentation>
+        <value>groupname</value>
+        <a:documentation>A group name (wheel)</a:documentation>
+        <value>ipaddress</value>
+        <a:documentation>An IP address (127.0.0.1)</a:documentation>
+        <value>library</value>
+        <a:documentation>A library (libncurses)</a:documentation>
+        <value>macro</value>
+        <a:documentation>A macro</a:documentation>
+        <value>netmask</value>
+        <a:documentation>A netmask (255.255.255.192)</a:documentation>
+        <value>newsgroup</value>
+        <a:documentation>A newsgroup (comp.text.xml)</a:documentation>
+        <value>osname</value>
+        <a:documentation>An operating system name (Hurd)</a:documentation>
+        <value>process</value>
+        <a:documentation>A process (gnome-cups-icon)</a:documentation>
+        <value>protocol</value>
+        <a:documentation>A protocol (ftp)</a:documentation>
+        <value>resource</value>
+        <a:documentation>A resource</a:documentation>
+        <value>server</value>
+        <a:documentation>A server (mail.example.com)</a:documentation>
+        <value>service</value>
+        <a:documentation>A service (ppp)</a:documentation>
+        <value>systemname</value>
+        <a:documentation>A system name (hephaistos)</a:documentation>
+        <value>username</value>
+        <a:documentation>A user name (ndw)</a:documentation>
+      </choice>
+    </define>
+    <define name="db.systemitem.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the nature of the system item</a:documentation>
+        <ref name="db.systemitem.class.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.systemitem.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.systemitem.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.systemitem.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.systemitem.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.systemitem">
+      <element name="systemitem">
+        <a:documentation>A system-related item or term</a:documentation>
+        <ref name="db.systemitem.attlist"/>
+        <zeroOrMore>
+          <ref name="db.systemitem.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.uri.type.attribute">
+      <optional>
+        <attribute name="type">
+          <a:documentation>Identifies the type of URI specified</a:documentation>
+        </attribute>
+      </optional>
+    </define>
+    <define name="db.uri.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.uri.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.uri.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.uri.type.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.uri">
+      <element name="uri">
+        <a:documentation>A Uniform Resource Identifier</a:documentation>
+        <ref name="db.uri.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.token.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.token.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.token.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.token">
+      <element name="token">
+        <a:documentation>A unit of information</a:documentation>
+        <ref name="db.token.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.type.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.type.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.type.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.type">
+      <element name="type">
+        <a:documentation>The classification of a value</a:documentation>
+        <ref name="db.type.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <define name="db.userinput.inlines">
+    <choice>
+      <choice>
+        <text/>
+        <ref name="db.ubiq.inlines"/>
+        <ref name="db.os.inlines"/>
+        <ref name="db.technical.inlines"/>
+        <ref name="db.markup.inlines"/>
+      </choice>
+      <ref name="db.co"/>
+    </choice>
+  </define>
+  <div>
+    <define name="db.userinput.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.userinput.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.userinput.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.userinput">
+      <element name="userinput">
+        <a:documentation>Data entered by the user</a:documentation>
+        <ref name="db.userinput.attlist"/>
+        <zeroOrMore>
+          <ref name="db.userinput.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.abbrev.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.abbrev.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.abbrev.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.abbrev">
+      <element name="abbrev">
+        <a:documentation>An abbreviation, especially one followed by a period</a:documentation>
+        <ref name="db.abbrev.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.superscript"/>
+            <ref name="db.subscript"/>
+            <ref name="db.trademark"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.acronym.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.acronym.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.acronym.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.acronym">
+      <element name="acronym">
+        <a:documentation>An often pronounceable word made from the initial (or selected) letters of a name or phrase</a:documentation>
+        <ref name="db.acronym.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.superscript"/>
+            <ref name="db.subscript"/>
+            <ref name="db.trademark"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.citation.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.citation.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.citation.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.citation">
+      <element name="citation">
+        <a:documentation>An inline bibliographic reference to another published work</a:documentation>
+        <ref name="db.citation.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.citerefentry.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.citerefentry.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.citerefentry.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.citerefentry">
+      <element name="citerefentry">
+        <a:documentation>A citation to a reference page</a:documentation>
+        <ref name="db.citerefentry.attlist"/>
+        <ref name="db.refentrytitle"/>
+        <optional>
+          <ref name="db.manvolnum"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.refentrytitle.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refentrytitle.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refentrytitle.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.refentrytitle">
+      <element name="refentrytitle">
+        <a:documentation>The title of a reference page</a:documentation>
+        <ref name="db.refentrytitle.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.manvolnum.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.manvolnum.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.manvolnum.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.manvolnum">
+      <element name="manvolnum">
+        <a:documentation>A reference volume number</a:documentation>
+        <ref name="db.manvolnum.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.citetitle.pubwork.enumeration">
+      <choice>
+        <value>article</value>
+        <a:documentation>An article</a:documentation>
+        <value>bbs</value>
+        <a:documentation>A bulletin board system</a:documentation>
+        <value>book</value>
+        <a:documentation>A book</a:documentation>
+        <value>cdrom</value>
+        <a:documentation>A CD-ROM</a:documentation>
+        <value>chapter</value>
+        <a:documentation>A chapter (as of a book)</a:documentation>
+        <value>dvd</value>
+        <a:documentation>A DVD</a:documentation>
+        <value>emailmessage</value>
+        <a:documentation>An email message</a:documentation>
+        <value>gopher</value>
+        <a:documentation>A gopher page</a:documentation>
+        <value>journal</value>
+        <a:documentation>A journal</a:documentation>
+        <value>manuscript</value>
+        <a:documentation>A manuscript</a:documentation>
+        <value>newsposting</value>
+        <a:documentation>A posting to a newsgroup</a:documentation>
+        <value>part</value>
+        <a:documentation>A part (as of a book)</a:documentation>
+        <value>refentry</value>
+        <a:documentation>A reference entry</a:documentation>
+        <value>section</value>
+        <a:documentation>A section (as of a book or article)</a:documentation>
+        <value>series</value>
+        <a:documentation>A series</a:documentation>
+        <value>set</value>
+        <a:documentation>A set (as of books)</a:documentation>
+        <value>webpage</value>
+        <a:documentation>A web page</a:documentation>
+        <value>wiki</value>
+        <a:documentation>A wiki page</a:documentation>
+      </choice>
+    </define>
+    <define name="db.citetitle.pubwork.attribute">
+      <attribute name="pubwork">
+        <a:documentation>Identifies the nature of the publication being cited</a:documentation>
+        <ref name="db.citetitle.pubwork.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.citetitle.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.citetitle.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.citetitle.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.citetitle.pubwork.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.citetitle">
+      <element name="citetitle">
+        <a:documentation>The title of a cited work</a:documentation>
+        <ref name="db.citetitle.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.emphasis.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.emphasis.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.emphasis.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.emphasis">
+      <element name="emphasis">
+        <a:documentation>Emphasized text</a:documentation>
+        <ref name="db.emphasis.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db._emphasis">
+      <element name="emphasis">
+        <a:documentation>A limited span of emphasized text</a:documentation>
+        <ref name="db.emphasis.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db._emphasis"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.foreignphrase.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.foreignphrase.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.foreignphrase.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.foreignphrase">
+      <element name="foreignphrase">
+        <a:documentation>A word or phrase in a language other than the primary language of the document</a:documentation>
+        <ref name="db.foreignphrase.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <text/>
+            <ref name="db.general.inlines"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.phrase.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.phrase.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.phrase.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.phrase">
+      <element name="phrase">
+        <a:documentation>A span of text</a:documentation>
+        <ref name="db.phrase.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db._phrase">
+      <element name="phrase">
+        <a:documentation>A limited span of text</a:documentation>
+        <ref name="db.phrase.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.quote.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.quote.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.quote.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.quote">
+      <element name="quote">
+        <a:documentation>An inline quotation</a:documentation>
+        <ref name="db.quote.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.subscript.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.subscript.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.subscript.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.subscript">
+      <element name="subscript">
+        <a:documentation>A subscript (as in H2
+O, the molecular formula for water)</a:documentation>
+        <ref name="db.subscript.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.superscript.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.superscript.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.superscript.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.superscript">
+      <element name="superscript">
+        <a:documentation>A superscript (as in x^2, the mathematical notation for x multiplied by itself)</a:documentation>
+        <ref name="db.superscript.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.trademark.class.enumeration">
+      <choice>
+        <value>copyright</value>
+        <a:documentation>A copyright</a:documentation>
+        <value>registered</value>
+        <a:documentation>A registered copyright</a:documentation>
+        <value>service</value>
+        <a:documentation>A service</a:documentation>
+        <value>trade</value>
+        <a:documentation>A trademark</a:documentation>
+      </choice>
+    </define>
+    <define name="db.trademark.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the class of trade mark</a:documentation>
+        <ref name="db.trademark.class.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.trademark.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.trademark.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.trademark.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.trademark.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.trademark">
+      <element name="trademark">
+        <a:documentation>A trademark</a:documentation>
+        <ref name="db.trademark.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.wordasword.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.wordasword.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.wordasword.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.wordasword">
+      <element name="wordasword">
+        <a:documentation>A word meant specifically as a word and not representing anything else</a:documentation>
+        <ref name="db.wordasword.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.footnoteref.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.footnoteref.label.attribute">
+      <ref name="db.label.attribute"/>
+    </define>
+    <define name="db.footnoteref.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.footnoteref.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.linkend.attribute"/>
+        <optional>
+          <ref name="db.footnoteref.label.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.footnoteref">
+      <element name="footnoteref">
+        <a:documentation>A cross reference to a footnote (a footnote mark)</a:documentation>
+        <s:pattern name="Footnote reference type constraint">
+          <s:rule context="db:footnoteref">
+            <s:assert test="local-name(//*[@xml:id=current()/@linkend]) = 'footnote' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'">@linkend on footnoteref must point to a footnote.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.footnoteref.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.xref.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.xref.xrefstyle.attribute">
+      <ref name="db.xrefstyle.attribute"/>
+    </define>
+    <define name="db.xref.endterm.attribute">
+      <ref name="db.endterm.attribute"/>
+    </define>
+    <define name="db.xref.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.xref.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.req.linking.attributes"/>
+        <optional>
+          <ref name="db.xref.xrefstyle.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.xref.endterm.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.xref">
+      <element name="xref">
+        <a:documentation>A cross reference to another part of the document</a:documentation>
+        <ref name="db.xref.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.link.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.link.xrefstyle.attribute">
+      <ref name="db.xrefstyle.attribute"/>
+    </define>
+    <define name="db.link.endterm.attribute">
+      <ref name="db.endterm.attribute"/>
+    </define>
+    <define name="db.link.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.link.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.req.linking.attributes"/>
+        <optional>
+          <ref name="db.link.xrefstyle.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.link.endterm.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.link">
+      <element name="link">
+        <a:documentation>A hypertext link</a:documentation>
+        <ref name="db.link.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.olink.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.olink.xrefstyle.attribute">
+      <ref name="db.xrefstyle.attribute"/>
+    </define>
+    <define name="db.olink.localinfo.attribute">
+      <attribute name="localinfo">
+        <a:documentation>Holds additional information that may be used by the applicatoin when resolving the link</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.olink.targetdoc.attribute">
+      <attribute name="targetdoc">
+        <a:documentation>Specifies the URI of the document in which the link target appears</a:documentation>
+        <data type="anyURI"/>
+      </attribute>
+    </define>
+    <define name="db.olink.targetptr.attribute">
+      <attribute name="targetptr">
+        <a:documentation>Specifies the location of the link target in the document</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.olink.type.attribute">
+      <attribute name="type">
+        <a:documentation>Identifies application-specific customization of the link behavior</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.olink.attlist">
+      <interleave>
+        <ref name="db.common.attributes"/>
+        <optional>
+          <ref name="db.olink.targetdoc.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.olink.role.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.olink.xrefstyle.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.olink.localinfo.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.olink.targetptr.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.olink.type.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.olink">
+      <element name="olink">
+        <a:documentation>A link that addresses its target indirectly</a:documentation>
+        <ref name="db.olink.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.anchor.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.anchor.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.anchor.role.attribute"/>
+        </optional>
+        <ref name="db.common.idreq.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.anchor">
+      <element name="anchor">
+        <a:documentation>A spot in the document</a:documentation>
+        <ref name="db.anchor.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.alt.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.alt.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.alt.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.alt">
+      <element name="alt">
+        <a:documentation>A text-only annotation, often used for accessibility</a:documentation>
+        <ref name="db.alt.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <text/>
+            <ref name="db.inlinemediaobject"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.annotations.attribute">
+    <attribute name="annotations">
+      <a:documentation>Identifies one or more annotations that apply to this element</a:documentation>
+    </attribute>
+  </define>
+  <div>
+    <define name="db.annotation.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.annotation.annotates.attribute">
+      <attribute name="annotates">
+        <a:documentation>Identifies one ore more elements to which this annotation applies</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.annotation.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.annotation.role.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.annotation.annotates.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.annotation.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.annotation">
+      <element name="annotation">
+        <a:documentation>An annotation</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:annotation">
+            <s:assert test="not(.//db:annotation)">annotation must not occur in the descendants of annotation</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.annotation.attlist"/>
+        <ref name="db.annotation.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.xlink.from.attribute">
+    <optional>
+      <attribute name="xlink:from">
+        <a:documentation>Specifies the XLink traversal-from</a:documentation>
+        <data type="NMTOKEN"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="db.xlink.label.attribute">
+    <optional>
+      <attribute name="xlink:label">
+        <a:documentation>Specifies the XLink label</a:documentation>
+        <data type="NMTOKEN"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="db.xlink.to.attribute">
+    <optional>
+      <attribute name="xlink:to">
+        <a:documentation>Specifies the XLink traversal-to</a:documentation>
+        <data type="NMTOKEN"/>
+      </attribute>
+    </optional>
+  </define>
+  <div>
+    <define name="db.extendedlink.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.extendedlink.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.extendedlink.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <optional>
+          <attribute name="xlink:type" a:defaultValue="extended">
+            <a:documentation>Identifies the XLink link type </a:documentation>
+            <value>extended</value>
+            <a:documentation>An XLink extended link</a:documentation>
+          </attribute>
+        </optional>
+        <optional>
+          <ref name="db.xlink.role.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.xlink.title.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.extendedlink">
+      <element name="extendedlink">
+        <a:documentation>An XLink extended link</a:documentation>
+        <ref name="db.extendedlink.attlist"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.locator"/>
+            <ref name="db.arc"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.locator.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.locator.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.locator.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <optional>
+          <attribute name="xlink:type" a:defaultValue="locator">
+            <a:documentation>Identifies the XLink link type </a:documentation>
+            <value>locator</value>
+            <a:documentation>An XLink locator link</a:documentation>
+          </attribute>
+        </optional>
+        <ref name="db.xlink.href.attribute"/>
+        <optional>
+          <ref name="db.xlink.role.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.xlink.title.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.xlink.label.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.locator">
+      <element name="locator">
+        <a:documentation>An XLink locator in an extendedlink</a:documentation>
+        <ref name="db.locator.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.arc.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.arc.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.arc.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <optional>
+          <attribute name="xlink:type" a:defaultValue="arc">
+            <a:documentation>Identifies the XLink link type </a:documentation>
+            <value>arc</value>
+            <a:documentation>An XLink arc link</a:documentation>
+          </attribute>
+        </optional>
+        <optional>
+          <ref name="db.xlink.arcrole.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.xlink.title.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.xlink.show.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.xlink.actuate.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.xlink.from.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.xlink.to.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.arc">
+      <element name="arc">
+        <a:documentation>An XLink arc in an extendedlink</a:documentation>
+        <ref name="db.arc.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <define name="db.status.attribute">
+    <attribute name="status">
+      <a:documentation>Identifies the editorial or publication status of the element on which it occurs</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.toplevel.sections">
+    <choice>
+      <choice>
+        <group>
+          <oneOrMore>
+            <ref name="db.section"/>
+          </oneOrMore>
+          <zeroOrMore>
+            <ref name="db.simplesect"/>
+          </zeroOrMore>
+        </group>
+        <oneOrMore>
+          <ref name="db.simplesect"/>
+        </oneOrMore>
+      </choice>
+      <group>
+        <oneOrMore>
+          <ref name="db.sect1"/>
+        </oneOrMore>
+        <zeroOrMore>
+          <ref name="db.simplesect"/>
+        </zeroOrMore>
+      </group>
+      <oneOrMore>
+        <ref name="db.refentry"/>
+      </oneOrMore>
+    </choice>
+  </define>
+  <define name="db.toplevel.blocks.or.sections">
+    <choice>
+      <group>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+        <optional>
+          <ref name="db.toplevel.sections"/>
+        </optional>
+      </group>
+      <ref name="db.toplevel.sections"/>
+    </choice>
+  </define>
+  <define name="db.recursive.sections">
+    <choice>
+      <choice>
+        <group>
+          <oneOrMore>
+            <ref name="db.section"/>
+          </oneOrMore>
+          <zeroOrMore>
+            <ref name="db.simplesect"/>
+          </zeroOrMore>
+        </group>
+        <oneOrMore>
+          <ref name="db.simplesect"/>
+        </oneOrMore>
+      </choice>
+      <oneOrMore>
+        <ref name="db.refentry"/>
+      </oneOrMore>
+    </choice>
+  </define>
+  <define name="db.recursive.blocks.or.sections">
+    <choice>
+      <group>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+        <optional>
+          <ref name="db.recursive.sections"/>
+        </optional>
+      </group>
+      <ref name="db.recursive.sections"/>
+    </choice>
+  </define>
+  <define name="db.divisions">
+    <choice>
+      <ref name="db.part"/>
+      <ref name="db.reference"/>
+    </choice>
+  </define>
+  <define name="db.components">
+    <choice>
+      <ref name="db.dedication"/>
+      <ref name="db.acknowledgements"/>
+      <ref name="db.preface"/>
+      <ref name="db.chapter"/>
+      <ref name="db.appendix"/>
+      <ref name="db.article"/>
+      <ref name="db.colophon"/>
+    </choice>
+  </define>
+  <define name="db.navigation.components">
+    <choice>
+      <notAllowed/>
+      <ref name="db.glossary"/>
+      <ref name="db.bibliography"/>
+      <ref name="db.index"/>
+      <ref name="db.toc"/>
+    </choice>
+  </define>
+  <define name="db.component.contentmodel">
+    <zeroOrMore>
+      <ref name="db.navigation.components"/>
+    </zeroOrMore>
+    <ref name="db.toplevel.blocks.or.sections"/>
+    <zeroOrMore>
+      <ref name="db.navigation.components"/>
+    </zeroOrMore>
+  </define>
+  <define name="db.setindex.components">
+    <choice>
+      <notAllowed/>
+      <ref name="db.setindex"/>
+    </choice>
+  </define>
+  <define name="db.toc.components">
+    <choice>
+      <notAllowed/>
+      <ref name="db.toc"/>
+    </choice>
+  </define>
+  <define name="db.set.components">
+    <choice>
+      <ref name="db.set"/>
+      <ref name="db.book"/>
+    </choice>
+  </define>
+  <div>
+    <define name="db.set.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.set.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.set.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.set.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.set.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.set.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.set">
+      <element name="set">
+        <a:documentation>A collection of books</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:set">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.set.attlist"/>
+        <ref name="db.set.info"/>
+        <optional>
+          <ref name="db.toc.components"/>
+        </optional>
+        <oneOrMore>
+          <ref name="db.set.components"/>
+        </oneOrMore>
+        <optional>
+          <ref name="db.setindex.components"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.book.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.book.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.book.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.book.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.book.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.book.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.book">
+      <element name="book">
+        <a:documentation>A book</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:book">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.book.attlist"/>
+        <ref name="db.book.info"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.navigation.components"/>
+            <ref name="db.components"/>
+            <ref name="db.divisions"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.dedication.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.dedication.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.dedication.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.dedication.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.dedication.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.dedication.info">
+      <ref name="db._info"/>
+    </define>
+    <define name="db.dedication">
+      <element name="dedication">
+        <a:documentation>The dedication of a book or other component</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:dedication">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.dedication.attlist"/>
+        <ref name="db.dedication.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.acknowledgements.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.acknowledgements.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.acknowledgements.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.acknowledgements.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.acknowledgements.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.acknowledgements.info">
+      <ref name="db._info"/>
+    </define>
+    <define name="db.acknowledgements">
+      <element name="acknowledgements">
+        <a:documentation>Acknowledgements of a book or other component</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:acknowledgements">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.acknowledgements.attlist"/>
+        <ref name="db.acknowledgements.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.colophon.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.colophon.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.colophon.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.colophon.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.colophon.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.colophon.info">
+      <ref name="db._info"/>
+    </define>
+    <define name="db.colophon">
+      <element name="colophon">
+        <a:documentation>Text at the back of a book describing facts about its production</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:colophon">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.colophon.attlist"/>
+        <ref name="db.colophon.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.appendix.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.appendix.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.appendix.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.appendix.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.appendix.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.appendix.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.appendix">
+      <element name="appendix">
+        <a:documentation>An appendix in a Book or Article</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:appendix">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.appendix.attlist"/>
+        <ref name="db.appendix.info"/>
+        <ref name="db.component.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.chapter.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.chapter.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.chapter.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.chapter.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.chapter.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.chapter.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.chapter">
+      <element name="chapter">
+        <a:documentation>A chapter, as of a book</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:chapter">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.chapter.attlist"/>
+        <ref name="db.chapter.info"/>
+        <ref name="db.component.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <define name="db.part.components">
+    <choice>
+      <choice>
+        <ref name="db.navigation.components"/>
+        <ref name="db.components"/>
+      </choice>
+      <choice>
+        <ref name="db.refentry"/>
+        <ref name="db.reference"/>
+      </choice>
+    </choice>
+  </define>
+  <div>
+    <define name="db.part.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.part.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.part.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.part.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.part.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.part.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.part">
+      <element name="part">
+        <a:documentation>A division in a book</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:part">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.part.attlist"/>
+        <ref name="db.part.info"/>
+        <optional>
+          <ref name="db.partintro"/>
+        </optional>
+        <oneOrMore>
+          <ref name="db.part.components"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.preface.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.preface.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.preface.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.preface.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.preface.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.preface.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.preface">
+      <element name="preface">
+        <a:documentation>Introductory matter preceding the first chapter of a book</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:preface">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.preface.attlist"/>
+        <ref name="db.preface.info"/>
+        <ref name="db.component.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.partintro.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.partintro.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.partintro.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.partintro.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.partintro.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.partintro.info">
+      <ref name="db._info"/>
+    </define>
+    <define name="db.partintro">
+      <element name="partintro">
+        <a:documentation>An introduction to the contents of a part</a:documentation>
+        <ref name="db.partintro.attlist"/>
+        <ref name="db.partintro.info"/>
+        <ref name="db.toplevel.blocks.or.sections"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.section.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.section.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.section.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.section.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.section.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.section.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.section">
+      <element name="section">
+        <a:documentation>A recursive section</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:section">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.section.attlist"/>
+        <ref name="db.section.info"/>
+        <ref name="db.recursive.blocks.or.sections"/>
+        <zeroOrMore>
+          <ref name="db.navigation.components"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.simplesect.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.simplesect.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.simplesect.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.simplesect.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.simplesect.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.simplesect.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.simplesect">
+      <element name="simplesect">
+        <a:documentation>A section of a document with no subdivisions</a:documentation>
+        <ref name="db.simplesect.attlist"/>
+        <ref name="db.simplesect.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.article.components">
+    <ref name="db.toplevel.sections"/>
+  </define>
+  <div>
+    <define name="db.article.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.article.class.enumeration">
+      <choice>
+        <value>faq</value>
+        <a:documentation>A collection of frequently asked questions.</a:documentation>
+        <value>journalarticle</value>
+        <a:documentation>An article in a journal or other periodical.</a:documentation>
+        <value>productsheet</value>
+        <a:documentation>A description of a product.</a:documentation>
+        <value>specification</value>
+        <a:documentation>A specification.</a:documentation>
+        <value>techreport</value>
+        <a:documentation>A technical report.</a:documentation>
+        <value>whitepaper</value>
+        <a:documentation>A white paper.</a:documentation>
+      </choice>
+    </define>
+    <define name="db.article.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the nature of the article</a:documentation>
+        <ref name="db.article.class.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.article.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.article.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.article.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.article.status.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.article.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.article.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.article">
+      <element name="article">
+        <a:documentation>An article</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:article">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.article.attlist"/>
+        <ref name="db.article.info"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.navigation.components"/>
+            <ref name="db.appendix"/>
+            <ref name="db.acknowledgements"/>
+            <ref name="db.colophon"/>
+          </choice>
+        </zeroOrMore>
+        <choice>
+          <group>
+            <oneOrMore>
+              <ref name="db.all.blocks"/>
+            </oneOrMore>
+            <optional>
+              <ref name="db.article.components"/>
+            </optional>
+          </group>
+          <ref name="db.article.components"/>
+        </choice>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.navigation.components"/>
+            <ref name="db.appendix"/>
+            <ref name="db.acknowledgements"/>
+            <ref name="db.colophon"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.sect1.sections">
+    <choice>
+      <group>
+        <oneOrMore>
+          <ref name="db.sect2"/>
+        </oneOrMore>
+        <zeroOrMore>
+          <ref name="db.simplesect"/>
+        </zeroOrMore>
+      </group>
+      <oneOrMore>
+        <ref name="db.simplesect"/>
+      </oneOrMore>
+    </choice>
+  </define>
+  <div>
+    <define name="db.sect1.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.sect1.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.sect1.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.sect1.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.sect1.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.sect1.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.sect1">
+      <element name="sect1">
+        <a:documentation>A top-level section of document</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:sect1">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.sect1.attlist"/>
+        <ref name="db.sect1.info"/>
+        <choice>
+          <group>
+            <oneOrMore>
+              <ref name="db.all.blocks"/>
+            </oneOrMore>
+            <optional>
+              <ref name="db.sect1.sections"/>
+            </optional>
+          </group>
+          <ref name="db.sect1.sections"/>
+        </choice>
+        <zeroOrMore>
+          <ref name="db.navigation.components"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.sect2.sections">
+    <choice>
+      <group>
+        <oneOrMore>
+          <ref name="db.sect3"/>
+        </oneOrMore>
+        <zeroOrMore>
+          <ref name="db.simplesect"/>
+        </zeroOrMore>
+      </group>
+      <oneOrMore>
+        <ref name="db.simplesect"/>
+      </oneOrMore>
+    </choice>
+  </define>
+  <div>
+    <define name="db.sect2.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.sect2.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.sect2.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.sect2.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.sect2.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.sect2.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.sect2">
+      <element name="sect2">
+        <a:documentation>A subsection within a Sect1</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:sect2">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.sect2.attlist"/>
+        <ref name="db.sect2.info"/>
+        <choice>
+          <group>
+            <oneOrMore>
+              <ref name="db.all.blocks"/>
+            </oneOrMore>
+            <optional>
+              <ref name="db.sect2.sections"/>
+            </optional>
+          </group>
+          <ref name="db.sect2.sections"/>
+        </choice>
+        <zeroOrMore>
+          <ref name="db.navigation.components"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.sect3.sections">
+    <choice>
+      <group>
+        <oneOrMore>
+          <ref name="db.sect4"/>
+        </oneOrMore>
+        <zeroOrMore>
+          <ref name="db.simplesect"/>
+        </zeroOrMore>
+      </group>
+      <oneOrMore>
+        <ref name="db.simplesect"/>
+      </oneOrMore>
+    </choice>
+  </define>
+  <div>
+    <define name="db.sect3.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.sect3.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.sect3.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.sect3.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.sect3.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.sect3.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.sect3">
+      <element name="sect3">
+        <a:documentation>A subsection within a Sect2</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:sect3">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.sect3.attlist"/>
+        <ref name="db.sect3.info"/>
+        <choice>
+          <group>
+            <oneOrMore>
+              <ref name="db.all.blocks"/>
+            </oneOrMore>
+            <optional>
+              <ref name="db.sect3.sections"/>
+            </optional>
+          </group>
+          <ref name="db.sect3.sections"/>
+        </choice>
+        <zeroOrMore>
+          <ref name="db.navigation.components"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.sect4.sections">
+    <choice>
+      <group>
+        <oneOrMore>
+          <ref name="db.sect5"/>
+        </oneOrMore>
+        <zeroOrMore>
+          <ref name="db.simplesect"/>
+        </zeroOrMore>
+      </group>
+      <oneOrMore>
+        <ref name="db.simplesect"/>
+      </oneOrMore>
+    </choice>
+  </define>
+  <div>
+    <define name="db.sect4.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.sect4.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.sect4.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.sect4.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.sect4.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.sect4.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.sect4">
+      <element name="sect4">
+        <a:documentation>A subsection within a Sect3</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:sect4">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.sect4.attlist"/>
+        <ref name="db.sect4.info"/>
+        <choice>
+          <group>
+            <oneOrMore>
+              <ref name="db.all.blocks"/>
+            </oneOrMore>
+            <optional>
+              <ref name="db.sect4.sections"/>
+            </optional>
+          </group>
+          <ref name="db.sect4.sections"/>
+        </choice>
+        <zeroOrMore>
+          <ref name="db.navigation.components"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.sect5.sections">
+    <oneOrMore>
+      <ref name="db.simplesect"/>
+    </oneOrMore>
+  </define>
+  <div>
+    <define name="db.sect5.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.sect5.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.sect5.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.sect5.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.sect5.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.sect5.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.sect5">
+      <element name="sect5">
+        <a:documentation>A subsection within a Sect4</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:sect5">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.sect5.attlist"/>
+        <ref name="db.sect5.info"/>
+        <choice>
+          <group>
+            <oneOrMore>
+              <ref name="db.all.blocks"/>
+            </oneOrMore>
+            <optional>
+              <ref name="db.sect5.sections"/>
+            </optional>
+          </group>
+          <ref name="db.sect5.sections"/>
+        </choice>
+        <zeroOrMore>
+          <ref name="db.navigation.components"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.toplevel.refsection">
+    <choice>
+      <oneOrMore>
+        <ref name="db.refsection"/>
+      </oneOrMore>
+      <oneOrMore>
+        <ref name="db.refsect1"/>
+      </oneOrMore>
+    </choice>
+  </define>
+  <define name="db.secondlevel.refsection">
+    <choice>
+      <oneOrMore>
+        <ref name="db.refsection"/>
+      </oneOrMore>
+      <oneOrMore>
+        <ref name="db.refsect2"/>
+      </oneOrMore>
+    </choice>
+  </define>
+  <define name="db.reference.components">
+    <ref name="db.refentry"/>
+  </define>
+  <div>
+    <define name="db.reference.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.reference.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.reference.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.status.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.reference.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.reference">
+      <element name="reference">
+        <a:documentation>A collection of reference entries</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:reference">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.reference.attlist"/>
+        <ref name="db.reference.info"/>
+        <optional>
+          <ref name="db.partintro"/>
+        </optional>
+        <oneOrMore>
+          <ref name="db.reference.components"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.refentry.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refentry.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refentry.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.status.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.refentry.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.refentry">
+      <element name="refentry">
+        <a:documentation>A reference page (originally a UNIX man-style reference page)</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:refentry">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.refentry.attlist"/>
+        <zeroOrMore>
+          <ref name="db.indexterm"/>
+        </zeroOrMore>
+        <ref name="db.refentry.info"/>
+        <optional>
+          <ref name="db.refmeta"/>
+        </optional>
+        <oneOrMore>
+          <ref name="db.refnamediv"/>
+        </oneOrMore>
+        <optional>
+          <ref name="db.refsynopsisdiv"/>
+        </optional>
+        <ref name="db.toplevel.refsection"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.refmeta.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refmeta.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refmeta.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.refmeta">
+      <element name="refmeta">
+        <a:documentation>Meta-information for a reference entry</a:documentation>
+        <ref name="db.refmeta.attlist"/>
+        <zeroOrMore>
+          <ref name="db.indexterm"/>
+        </zeroOrMore>
+        <ref name="db.refentrytitle"/>
+        <optional>
+          <ref name="db.manvolnum"/>
+        </optional>
+        <zeroOrMore>
+          <ref name="db.refmiscinfo"/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name="db.indexterm"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.refmiscinfo.class.enumeration">
+    <choice>
+      <value>source</value>
+      <a:documentation>The name of the software product or component to which this topic applies</a:documentation>
+      <value>version</value>
+      <a:documentation>The version of the software product or component to which this topic applies</a:documentation>
+      <value>manual</value>
+      <a:documentation>The section title of the reference page (e.g., User Commands)</a:documentation>
+      <value>sectdesc</value>
+      <a:documentation>The section title of the reference page (believed synonymous with "manual" but in wide use)</a:documentation>
+      <value>software</value>
+      <a:documentation>The name of the software product or component to which this topic applies (e.g., SunOS x.y; believed synonymous with "source" but in wide use)</a:documentation>
+    </choice>
+  </define>
+  <define name="db.refmiscinfo.class-enum.attribute">
+    <optional>
+      <attribute name="class">
+        <a:documentation>Identifies the kind of miscellaneous information</a:documentation>
+        <ref name="db.refmiscinfo.class.enumeration"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="db.refmiscinfo.class-other.attribute">
+    <attribute name="otherclass">
+      <a:documentation>Identifies the nature of non-standard miscellaneous information</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.refmiscinfo.class-other.attributes">
+    <interleave>
+      <attribute name="class">
+        <a:documentation>Identifies the kind of miscellaneious information</a:documentation>
+        <value>other</value>
+        <a:documentation>Indicates that the information is some 'other' kind.</a:documentation>
+      </attribute>
+      <ref name="db.refmiscinfo.class-other.attribute"/>
+    </interleave>
+  </define>
+  <define name="db.refmiscinfo.class.attribute">
+    <choice>
+      <ref name="db.refmiscinfo.class-enum.attribute"/>
+      <ref name="db.refmiscinfo.class-other.attributes"/>
+    </choice>
+  </define>
+  <div>
+    <define name="db.refmiscinfo.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refmiscinfo.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refmiscinfo.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.refmiscinfo.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.refmiscinfo">
+      <element name="refmiscinfo">
+        <a:documentation>Meta-information for a reference entry other than the title and volume number</a:documentation>
+        <ref name="db.refmiscinfo.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.refnamediv.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refnamediv.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refnamediv.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.refnamediv">
+      <element name="refnamediv">
+        <a:documentation>The name, purpose, and classification of a reference page</a:documentation>
+        <ref name="db.refnamediv.attlist"/>
+        <optional>
+          <ref name="db.refdescriptor"/>
+        </optional>
+        <oneOrMore>
+          <ref name="db.refname"/>
+        </oneOrMore>
+        <ref name="db.refpurpose"/>
+        <zeroOrMore>
+          <ref name="db.refclass"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.refdescriptor.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refdescriptor.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refdescriptor.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.refdescriptor">
+      <element name="refdescriptor">
+        <a:documentation>A description of the topic of a reference page</a:documentation>
+        <ref name="db.refdescriptor.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.refname.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refname.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refname.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.refname">
+      <element name="refname">
+        <a:documentation>The name of (one of) the subject(s) of a reference page</a:documentation>
+        <ref name="db.refname.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.refpurpose.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refpurpose.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refpurpose.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.refpurpose">
+      <element name="refpurpose">
+        <a:documentation>A short (one sentence) synopsis of the topic of a reference page</a:documentation>
+        <ref name="db.refpurpose.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.refclass.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refclass.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refclass.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.refclass">
+      <element name="refclass">
+        <a:documentation>The scope or other indication of applicability of a reference entry</a:documentation>
+        <ref name="db.refclass.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <text/>
+            <ref name="db.application"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.refsynopsisdiv.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refsynopsisdiv.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refsynopsisdiv.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.refsynopsisdiv.info">
+      <ref name="db._info"/>
+    </define>
+    <define name="db.refsynopsisdiv">
+      <element name="refsynopsisdiv">
+        <a:documentation>A syntactic synopsis of the subject of the reference page</a:documentation>
+        <ref name="db.refsynopsisdiv.attlist"/>
+        <ref name="db.refsynopsisdiv.info"/>
+        <choice>
+          <group>
+            <oneOrMore>
+              <ref name="db.all.blocks"/>
+            </oneOrMore>
+            <optional>
+              <ref name="db.secondlevel.refsection"/>
+            </optional>
+          </group>
+          <ref name="db.secondlevel.refsection"/>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.refsection.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refsection.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refsection.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.status.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.refsection.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.refsection">
+      <element name="refsection">
+        <a:documentation>A recursive section in a refentry</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:refsection">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.refsection.attlist"/>
+        <ref name="db.refsection.info"/>
+        <choice>
+          <group>
+            <oneOrMore>
+              <ref name="db.all.blocks"/>
+            </oneOrMore>
+            <zeroOrMore>
+              <ref name="db.refsection"/>
+            </zeroOrMore>
+          </group>
+          <oneOrMore>
+            <ref name="db.refsection"/>
+          </oneOrMore>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <define name="db.refsect1.sections">
+    <oneOrMore>
+      <ref name="db.refsect2"/>
+    </oneOrMore>
+  </define>
+  <div>
+    <define name="db.refsect1.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.refsect1.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refsect1.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refsect1.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.refsect1.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.refsect1.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.refsect1">
+      <element name="refsect1">
+        <a:documentation>A major subsection of a reference entry</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:refsect1">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.refsect1.attlist"/>
+        <ref name="db.refsect1.info"/>
+        <choice>
+          <group>
+            <oneOrMore>
+              <ref name="db.all.blocks"/>
+            </oneOrMore>
+            <optional>
+              <ref name="db.refsect1.sections"/>
+            </optional>
+          </group>
+          <ref name="db.refsect1.sections"/>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <define name="db.refsect2.sections">
+    <oneOrMore>
+      <ref name="db.refsect3"/>
+    </oneOrMore>
+  </define>
+  <div>
+    <define name="db.refsect2.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.refsect2.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refsect2.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refsect2.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.refsect2.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.refsect2.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.refsect2">
+      <element name="refsect2">
+        <a:documentation>A subsection of a refsect1</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:refsect2">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.refsect2.attlist"/>
+        <ref name="db.refsect2.info"/>
+        <choice>
+          <group>
+            <oneOrMore>
+              <ref name="db.all.blocks"/>
+            </oneOrMore>
+            <optional>
+              <ref name="db.refsect2.sections"/>
+            </optional>
+          </group>
+          <ref name="db.refsect2.sections"/>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.refsect3.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.refsect3.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.refsect3.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.refsect3.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.refsect3.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.refsect3.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.refsect3">
+      <element name="refsect3">
+        <a:documentation>A subsection of a refsect2</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:refsect3">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.refsect3.attlist"/>
+        <ref name="db.refsect3.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.glossary.inlines">
+    <choice>
+      <ref name="db.firstterm"/>
+      <ref name="db.glossterm"/>
+    </choice>
+  </define>
+  <define name="db.baseform.attribute">
+    <optional>
+      <attribute name="baseform">
+        <a:documentation>Specifies the base form of the term, the one that appears in the glossary. This allows adjectival, plural, and other variations of the term to appear in the element. The element content is the default base form.</a:documentation>
+      </attribute>
+    </optional>
+  </define>
+  <div>
+    <define name="db.glosslist.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.glosslist.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.glosslist.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.glosslist.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.glosslist">
+      <element name="glosslist">
+        <a:documentation>A wrapper for a list of glossary entries</a:documentation>
+        <ref name="db.glosslist.attlist"/>
+        <optional>
+          <ref name="db.glosslist.info"/>
+        </optional>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <oneOrMore>
+          <ref name="db.glossentry"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.glossentry.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.glossentry.sortas.attribute">
+      <attribute name="sortas">
+        <a:documentation>Specifies the string by which the element's content is to be sorted; if unspecified, the content is used</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.glossentry.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.glossentry.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.glossentry.sortas.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.glossentry">
+      <element name="glossentry">
+        <a:documentation>An entry in a Glossary or GlossList</a:documentation>
+        <ref name="db.glossentry.attlist"/>
+        <ref name="db.glossterm"/>
+        <optional>
+          <ref name="db.acronym"/>
+        </optional>
+        <optional>
+          <ref name="db.abbrev"/>
+        </optional>
+        <zeroOrMore>
+          <ref name="db.indexterm"/>
+        </zeroOrMore>
+        <choice>
+          <ref name="db.glosssee"/>
+          <oneOrMore>
+            <ref name="db.glossdef"/>
+          </oneOrMore>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.glossdef.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.glossdef.subject.attribute">
+      <attribute name="subject">
+        <a:documentation>Specifies a list of keywords for the definition</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.glossdef.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.glossdef.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.glossdef.subject.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.glossdef">
+      <element name="glossdef">
+        <a:documentation>A definition in a GlossEntry</a:documentation>
+        <ref name="db.glossdef.attlist"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+        <zeroOrMore>
+          <ref name="db.glossseealso"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.glosssee.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.glosssee.otherterm.attribute">
+      <attribute name="otherterm">
+        <a:documentation>Identifies the other term</a:documentation>
+        <data type="IDREF"/>
+      </attribute>
+    </define>
+    <define name="db.glosssee.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.glosssee.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.glosssee.otherterm.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.glosssee">
+      <element name="glosssee">
+        <a:documentation>A cross-reference from one glossentry
+ to another</a:documentation>
+        <s:pattern name="Glosssary 'see' type constraint">
+          <s:rule context="db:glosssee[@otherterm]">
+            <s:assert test="local-name(//*[@xml:id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'">@otherterm on glosssee must point to a glossentry.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.glosssee.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.glossseealso.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.glossseealso.otherterm.attribute">
+      <attribute name="otherterm">
+        <a:documentation>Identifies the other term</a:documentation>
+        <data type="IDREF"/>
+      </attribute>
+    </define>
+    <define name="db.glossseealso.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.glossseealso.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.glossseealso.otherterm.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.glossseealso">
+      <element name="glossseealso">
+        <a:documentation>A cross-reference from one GlossEntry to another</a:documentation>
+        <s:pattern name="Glossary 'seealso' type constraint">
+          <s:rule context="db:glossseealso[@otherterm]">
+            <s:assert test="local-name(//*[@xml:id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'">@otherterm on glossseealso must point to a glossentry.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.glossseealso.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.firstterm.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.firstterm.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.firstterm.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.baseform.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.firstterm">
+      <element name="firstterm">
+        <a:documentation>The first occurrence of a term</a:documentation>
+        <s:pattern name="Glossary 'firstterm' type constraint">
+          <s:rule context="db:firstterm[@linkend]">
+            <s:assert test="local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'">@linkend on firstterm must point to a glossentry.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.firstterm.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.glossterm.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.glossterm.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.glossterm.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.baseform.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.glossterm">
+      <element name="glossterm">
+        <a:documentation>A glossary term</a:documentation>
+        <s:pattern name="Glossary 'glossterm' type constraint">
+          <s:rule context="db:glossterm[@linkend]">
+            <s:assert test="local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'">@linkend on glossterm must point to a glossentry.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.glossterm.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.glossary.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.glossary.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.glossary.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.glossary.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.glossary.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.glossary.info">
+      <ref name="db._info"/>
+    </define>
+    <define name="db.glossary">
+      <element name="glossary">
+        <a:documentation>A glossary</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:glossary">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.glossary.attlist"/>
+        <ref name="db.glossary.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <choice>
+          <zeroOrMore>
+            <ref name="db.glossdiv"/>
+          </zeroOrMore>
+          <zeroOrMore>
+            <ref name="db.glossentry"/>
+          </zeroOrMore>
+        </choice>
+        <optional>
+          <ref name="db.bibliography"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.glossdiv.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.glossdiv.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.glossdiv.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.glossdiv.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.glossdiv.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.glossdiv.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.glossdiv">
+      <element name="glossdiv">
+        <a:documentation>A division in a Glossary</a:documentation>
+        <ref name="db.glossdiv.attlist"/>
+        <ref name="db.glossdiv.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <oneOrMore>
+          <ref name="db.glossentry"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.termdef.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.termdef.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.termdef.role.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.glossentry.sortas.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.baseform.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.termdef">
+      <element name="termdef">
+        <a:documentation>An inline definition of a term</a:documentation>
+        <s:pattern name="Glossary term definition constraint">
+          <s:rule context="db:termdef">
+            <s:assert test="count(db:firstterm) = 1">A termdef must contain exactly one firstterm</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.termdef.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.relation.attribute">
+    <attribute name="relation">
+      <a:documentation>Identifies the relationship between the bibliographic elemnts</a:documentation>
+    </attribute>
+  </define>
+  <div>
+    <define name="db.biblioentry.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.biblioentry.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.biblioentry.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.biblioentry">
+      <element name="biblioentry">
+        <a:documentation>An entry in a Bibliography</a:documentation>
+        <ref name="db.biblioentry.attlist"/>
+        <oneOrMore>
+          <ref name="db.bibliographic.elements"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.bibliomixed.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.bibliomixed.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.bibliomixed.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.bibliomixed">
+      <element name="bibliomixed">
+        <a:documentation>An entry in a Bibliography</a:documentation>
+        <ref name="db.bibliomixed.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <text/>
+            <ref name="db.bibliographic.elements"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.biblioset.relation.attribute">
+      <ref name="db.relation.attribute"/>
+    </define>
+    <define name="db.biblioset.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.biblioset.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.biblioset.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.biblioset.relation.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.biblioset">
+      <element name="biblioset">
+        <a:documentation>A raw container for related bibliographic information</a:documentation>
+        <ref name="db.biblioset.attlist"/>
+        <oneOrMore>
+          <ref name="db.bibliographic.elements"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.bibliomset.relation.attribute">
+      <ref name="db.relation.attribute"/>
+    </define>
+    <define name="db.bibliomset.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.bibliomset.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.bibliomset.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.bibliomset.relation.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.bibliomset">
+      <element name="bibliomset">
+        <a:documentation>A cooked container for related bibliographic information</a:documentation>
+        <ref name="db.bibliomset.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.bibliographic.elements"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.bibliomisc.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.bibliomisc.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.bibliomisc.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.bibliomisc">
+      <element name="bibliomisc">
+        <a:documentation>Untyped bibliographic information</a:documentation>
+        <ref name="db.bibliomisc.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.bibliography.status.attrib">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.bibliography.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.bibliography.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.bibliography.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.bibliography.status.attrib"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.bibliography.info">
+      <ref name="db._info"/>
+    </define>
+    <define name="db.bibliography">
+      <element name="bibliography">
+        <a:documentation>A bibliography</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:bibliography">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.bibliography.attlist"/>
+        <ref name="db.bibliography.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <choice>
+          <oneOrMore>
+            <ref name="db.bibliodiv"/>
+          </oneOrMore>
+          <oneOrMore>
+            <choice>
+              <ref name="db.biblioentry"/>
+              <ref name="db.bibliomixed"/>
+            </choice>
+          </oneOrMore>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.bibliodiv.status.attrib">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.bibliodiv.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.bibliodiv.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.bibliodiv.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.bibliodiv.status.attrib"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.bibliodiv.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.bibliodiv">
+      <element name="bibliodiv">
+        <a:documentation>A section of a Bibliography</a:documentation>
+        <ref name="db.bibliodiv.attlist"/>
+        <ref name="db.bibliodiv.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <oneOrMore>
+          <choice>
+            <ref name="db.biblioentry"/>
+            <ref name="db.bibliomixed"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.bibliolist.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.bibliolist.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.bibliolist.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.bibliolist.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.bibliolist">
+      <element name="bibliolist">
+        <a:documentation>A wrapper for a list of bibliography entries</a:documentation>
+        <ref name="db.bibliolist.attlist"/>
+        <optional>
+          <ref name="db.bibliolist.info"/>
+        </optional>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <oneOrMore>
+          <choice>
+            <ref name="db.biblioentry"/>
+            <ref name="db.bibliomixed"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.biblioref.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.biblioref.xrefstyle.attribute">
+      <ref name="db.xrefstyle.attribute"/>
+    </define>
+    <define name="db.biblioref.endterm.attribute">
+      <ref name="db.endterm.attribute"/>
+    </define>
+    <define name="db.biblioref.units.attribute">
+      <attribute name="units">
+        <a:documentation>The units (for example, pages) used to identify the beginning and ending of a reference.</a:documentation>
+        <data type="token"/>
+      </attribute>
+    </define>
+    <define name="db.biblioref.begin.attribute">
+      <attribute name="begin">
+        <a:documentation>Identifies the beginning of a reference; the location within the work that is being referenced.</a:documentation>
+        <data type="token"/>
+      </attribute>
+    </define>
+    <define name="db.biblioref.end.attribute">
+      <attribute name="end">
+        <a:documentation>Identifies the end of a reference.</a:documentation>
+        <data type="token"/>
+      </attribute>
+    </define>
+    <define name="db.biblioref.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.biblioref.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.req.linking.attributes"/>
+        <optional>
+          <ref name="db.biblioref.xrefstyle.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.biblioref.endterm.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.biblioref.units.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.biblioref.begin.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.biblioref.end.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.biblioref">
+      <element name="biblioref">
+        <a:documentation>A cross-reference to a bibliographic entry</a:documentation>
+        <ref name="db.biblioref.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <define name="db.significance.enumeration">
+    <choice>
+      <value>normal</value>
+      <a:documentation>Normal</a:documentation>
+      <value>preferred</value>
+      <a:documentation>Preferred</a:documentation>
+    </choice>
+  </define>
+  <define name="db.significance.attribute">
+    <attribute name="significance">
+      <a:documentation>Specifies the significance of the term</a:documentation>
+      <ref name="db.significance.enumeration"/>
+    </attribute>
+  </define>
+  <define name="db.zone.attribute">
+    <attribute name="zone">
+      <a:documentation>Specifies the IDs of the elements to which this term applies</a:documentation>
+      <data type="IDREFS"/>
+    </attribute>
+  </define>
+  <define name="db.indexterm.pagenum.attribute">
+    <attribute name="pagenum">
+      <a:documentation>Indicates the page on which this index term occurs in some version of the printed document</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.scope.enumeration">
+    <choice>
+      <value>all</value>
+      <a:documentation>All indexes</a:documentation>
+      <value>global</value>
+      <a:documentation>The global index (as for a combined index of a set of box)</a:documentation>
+      <value>local</value>
+      <a:documentation>The local index (the index for this document only)</a:documentation>
+    </choice>
+  </define>
+  <define name="db.scope.attribute">
+    <attribute name="scope">
+      <a:documentation>Specifies the scope of the index term</a:documentation>
+      <ref name="db.scope.enumeration"/>
+    </attribute>
+  </define>
+  <define name="db.sortas.attribute">
+    <attribute name="sortas">
+      <a:documentation>Specifies the string by which the term is to be sorted; if unspecified, the term content is used</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.index.type.attribute">
+    <attribute name="type">
+      <a:documentation>Specifies the target index for this term</a:documentation>
+    </attribute>
+  </define>
+  <div>
+    <define name="db.itermset.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.itermset.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.itermset.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.itermset">
+      <element name="itermset">
+        <a:documentation>A set of index terms in the meta-information of a document</a:documentation>
+        <ref name="db.itermset.attlist"/>
+        <oneOrMore>
+          <ref name="db.indexterm.singular"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.indexterm.contentmodel">
+    <optional>
+      <ref name="db.primary"/>
+    </optional>
+    <optional>
+      <choice>
+        <group>
+          <ref name="db.secondary"/>
+          <optional>
+            <choice>
+              <group>
+                <ref name="db.tertiary"/>
+                <optional>
+                  <choice>
+                    <ref name="db.see"/>
+                    <oneOrMore>
+                      <ref name="db.seealso"/>
+                    </oneOrMore>
+                  </choice>
+                </optional>
+              </group>
+              <ref name="db.see"/>
+              <oneOrMore>
+                <ref name="db.seealso"/>
+              </oneOrMore>
+            </choice>
+          </optional>
+        </group>
+        <ref name="db.see"/>
+        <oneOrMore>
+          <ref name="db.seealso"/>
+        </oneOrMore>
+      </choice>
+    </optional>
+  </define>
+  <div>
+    <define name="db.indexterm.singular.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.indexterm.singular.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the class of index term</a:documentation>
+        <value>singular</value>
+        <a:documentation>A singular index term</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.indexterm.singular.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.indexterm.singular.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.significance.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.zone.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.indexterm.pagenum.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.scope.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.index.type.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.indexterm.singular.class.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.indexterm.singular">
+      <element name="indexterm">
+        <a:documentation>A wrapper for an indexed term</a:documentation>
+        <ref name="db.indexterm.singular.attlist"/>
+        <ref name="db.indexterm.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.indexterm.startofrange.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.indexterm.startofrange.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the class of index term</a:documentation>
+        <value>startofrange</value>
+        <a:documentation>The start of a range</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.indexterm.startofrange.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.indexterm.startofrange.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.significance.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.zone.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.indexterm.pagenum.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.scope.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.index.type.attribute"/>
+        </optional>
+        <ref name="db.indexterm.startofrange.class.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.indexterm.startofrange">
+      <element name="indexterm">
+        <a:documentation>A wrapper for an indexed term that covers a range</a:documentation>
+        <ref name="db.indexterm.startofrange.attlist"/>
+        <ref name="db.indexterm.contentmodel"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.indexterm.endofrange.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.indexterm.endofrange.class.attribute">
+      <attribute name="class">
+        <a:documentation>Identifies the class of index term</a:documentation>
+        <value>endofrange</value>
+        <a:documentation>The end of a range</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.indexterm.endofrange.startref.attribute">
+      <attribute name="startref">
+        <a:documentation>Points to the start of the range</a:documentation>
+        <data type="IDREF"/>
+      </attribute>
+    </define>
+    <define name="db.indexterm.endofrange.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.indexterm.endofrange.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.indexterm.endofrange.class.attribute"/>
+        <ref name="db.indexterm.endofrange.startref.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.indexterm.endofrange">
+      <element name="indexterm">
+        <a:documentation>Identifies the end of a range associated with an indexed term</a:documentation>
+        <ref name="db.indexterm.endofrange.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.indexterm">
+      <choice>
+        <ref name="db.indexterm.singular"/>
+        <ref name="db.indexterm.startofrange"/>
+        <ref name="db.indexterm.endofrange"/>
+      </choice>
+    </define>
+  </div>
+  <div>
+    <define name="db.primary.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.primary.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.primary.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.sortas.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.primary">
+      <element name="primary">
+        <a:documentation>The primary word or phrase under which an index term should be sorted</a:documentation>
+        <ref name="db.primary.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.secondary.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.secondary.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.secondary.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.sortas.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.secondary">
+      <element name="secondary">
+        <a:documentation>A secondary word or phrase in an index term</a:documentation>
+        <ref name="db.secondary.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.tertiary.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.tertiary.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.tertiary.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.sortas.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.tertiary">
+      <element name="tertiary">
+        <a:documentation>A tertiary word or phrase in an index term</a:documentation>
+        <ref name="db.tertiary.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.see.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.see.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.see.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.see">
+      <element name="see">
+        <a:documentation>Part of an index term directing the reader instead to another entry in the index</a:documentation>
+        <ref name="db.see.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.seealso.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.seealso.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.seealso.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.seealso">
+      <element name="seealso">
+        <a:documentation>Part of an index term directing the reader also to another entry in the index</a:documentation>
+        <ref name="db.seealso.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.index.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.index.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.index.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.index.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.index.status.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.index.type.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.index.info">
+      <ref name="db._info"/>
+    </define>
+<!--
+
+      Yes, db.indexdiv* and db.indexentry*; that way an <index/> is valid.
+      Authors can use an empty index to indicate where a generated index should
+      appear.
+    -->
+    <define name="db.index">
+      <element name="index">
+        <a:documentation>An index to a book or part of a book</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:index">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.index.attlist"/>
+        <ref name="db.index.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <choice>
+          <zeroOrMore>
+            <ref name="db.indexdiv"/>
+          </zeroOrMore>
+          <zeroOrMore>
+            <ref name="db.indexentry"/>
+          </zeroOrMore>
+          <ref name="db.segmentedlist"/>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.setindex.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.setindex.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.setindex.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.setindex.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.setindex.status.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.index.type.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.setindex.info">
+      <ref name="db._info"/>
+    </define>
+    <define name="db.setindex">
+      <element name="setindex">
+        <a:documentation>An index to a set of books</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:setindex">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.setindex.attlist"/>
+        <ref name="db.setindex.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <choice>
+          <zeroOrMore>
+            <ref name="db.indexdiv"/>
+          </zeroOrMore>
+          <zeroOrMore>
+            <ref name="db.indexentry"/>
+          </zeroOrMore>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.indexdiv.status.attribute">
+      <ref name="db.status.attribute"/>
+    </define>
+    <define name="db.indexdiv.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.indexdiv.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.indexdiv.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.indexdiv.status.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.indexdiv.info">
+      <ref name="db._info.title.req"/>
+    </define>
+    <define name="db.indexdiv">
+      <element name="indexdiv">
+        <a:documentation>A division in an index</a:documentation>
+        <ref name="db.indexdiv.attlist"/>
+        <ref name="db.indexdiv.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <choice>
+          <oneOrMore>
+            <ref name="db.indexentry"/>
+          </oneOrMore>
+          <ref name="db.segmentedlist"/>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.indexentry.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.indexentry.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.indexentry.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.indexentry">
+      <element name="indexentry">
+        <a:documentation>An entry in an index</a:documentation>
+        <ref name="db.indexentry.attlist"/>
+        <ref name="db.primaryie"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.seeie"/>
+            <ref name="db.seealsoie"/>
+          </choice>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name="db.secondaryie"/>
+          <zeroOrMore>
+            <choice>
+              <ref name="db.seeie"/>
+              <ref name="db.seealsoie"/>
+              <ref name="db.tertiaryie"/>
+            </choice>
+          </zeroOrMore>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.primaryie.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.primaryie.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.primaryie.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <optional>
+          <ref name="db.linkends.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.primaryie">
+      <element name="primaryie">
+        <a:documentation>A primary term in an index entry, not in the text</a:documentation>
+        <ref name="db.primaryie.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.secondaryie.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.secondaryie.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.secondaryie.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <optional>
+          <ref name="db.linkends.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.secondaryie">
+      <element name="secondaryie">
+        <a:documentation>A secondary term in an index entry, rather than in the text</a:documentation>
+        <ref name="db.secondaryie.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.tertiaryie.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.tertiaryie.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.tertiaryie.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <optional>
+          <ref name="db.linkends.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.tertiaryie">
+      <element name="tertiaryie">
+        <a:documentation>A tertiary term in an index entry, rather than in the text</a:documentation>
+        <ref name="db.tertiaryie.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.seeie.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.seeie.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.seeie.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <optional>
+          <ref name="db.linkend.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.seeie">
+      <element name="seeie">
+        <a:documentation>A See
+entry in an index, rather than in the text</a:documentation>
+        <ref name="db.seeie.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.seealsoie.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.seealsoie.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.seealsoie.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <optional>
+          <ref name="db.linkends.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.seealsoie">
+      <element name="seealsoie">
+        <a:documentation>A See also
+ entry in an index, rather than in the text</a:documentation>
+        <ref name="db.seealsoie.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.toc.pagenum.attribute">
+    <attribute name="pagenum">
+      <a:documentation>Indicates the page on which this element occurs in some version of the printed document</a:documentation>
+    </attribute>
+  </define>
+  <div>
+    <define name="db.toc.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.toc.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.toc.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.toc.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.toc">
+      <element name="toc">
+        <a:documentation>A table of contents</a:documentation>
+        <s:pattern name="Root must have version">
+          <s:rule context="/db:toc">
+            <s:assert test="@version">The root element must have a version attribute.</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.toc.attlist"/>
+        <ref name="db.toc.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.tocdiv"/>
+            <ref name="db.tocentry"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.tocdiv.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.tocdiv.pagenum.attribute">
+      <ref name="db.toc.pagenum.attribute"/>
+    </define>
+    <define name="db.tocdiv.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.tocdiv.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <optional>
+          <ref name="db.tocdiv.pagenum.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.linkend.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.tocdiv.info">
+      <ref name="db._info"/>
+    </define>
+    <define name="db.tocdiv">
+      <element name="tocdiv">
+        <a:documentation>A division in a table of contents</a:documentation>
+        <ref name="db.tocdiv.attlist"/>
+        <ref name="db.tocdiv.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <oneOrMore>
+          <choice>
+            <ref name="db.tocdiv"/>
+            <ref name="db.tocentry"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.tocentry.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.tocentry.pagenum.attribute">
+      <ref name="db.toc.pagenum.attribute"/>
+    </define>
+    <define name="db.tocentry.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.tocentry.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <optional>
+          <ref name="db.tocentry.pagenum.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.linkend.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.tocentry">
+      <element name="tocentry">
+        <a:documentation>A component title in a table of contents</a:documentation>
+        <ref name="db.tocentry.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.task.info">
+    <ref name="db._info.title.req"/>
+  </define>
+  <div>
+    <define name="db.task.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.task.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.task.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.task">
+      <element name="task">
+        <a:documentation>A task to be completed</a:documentation>
+        <ref name="db.task.attlist"/>
+        <ref name="db.task.info"/>
+        <optional>
+          <ref name="db.tasksummary"/>
+        </optional>
+        <optional>
+          <ref name="db.taskprerequisites"/>
+        </optional>
+        <ref name="db.procedure"/>
+        <zeroOrMore>
+          <ref name="db.example"/>
+        </zeroOrMore>
+        <optional>
+          <ref name="db.taskrelated"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.tasksummary.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.tasksummary.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.tasksummary.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.tasksummary.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.tasksummary">
+      <element name="tasksummary">
+        <a:documentation>A summary of a task</a:documentation>
+        <ref name="db.tasksummary.attlist"/>
+        <ref name="db.tasksummary.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.taskprerequisites.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.taskprerequisites.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.taskprerequisites.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.taskprerequisites.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.taskprerequisites">
+      <element name="taskprerequisites">
+        <a:documentation>The prerequisites for a task</a:documentation>
+        <ref name="db.taskprerequisites.attlist"/>
+        <ref name="db.taskprerequisites.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.taskrelated.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.taskrelated.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.taskrelated.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.taskrelated.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.taskrelated">
+      <element name="taskrelated">
+        <a:documentation>Information related to a task</a:documentation>
+        <ref name="db.taskrelated.attlist"/>
+        <ref name="db.taskrelated.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.area.units.enumeration">
+    <choice>
+      <value>calspair</value>
+      <a:documentation>Coordinates expressed as a pair of CALS graphic coordinates.</a:documentation>
+      <value>linecolumn</value>
+      <a:documentation>Coordinates expressed as a line and column.</a:documentation>
+      <value>linecolumnpair</value>
+      <a:documentation>Coordinates expressed as a pair of lines and columns.</a:documentation>
+      <value>linerange</value>
+      <a:documentation>Coordinates expressed as a line range.</a:documentation>
+    </choice>
+  </define>
+  <define name="db.area.units-enum.attribute">
+    <optional>
+      <attribute name="units">
+        <a:documentation>Identifies the units used in the coords attribute The default units vary according to the type of callout specified: calspair
+ for graphics and linecolumn
+ for line-oriented elements.</a:documentation>
+        <ref name="db.area.units.enumeration"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="db.area.units-other.attributes">
+    <optional>
+      <attribute name="units">
+        <a:documentation>Indicates that non-standard units are used for this area
+. In this case otherunits
+ must be specified.</a:documentation>
+        <value>other</value>
+        <a:documentation>Coordinates expressed in some non-standard units.</a:documentation>
+      </attribute>
+    </optional>
+    <attribute name="otherunits">
+      <a:documentation>Identifies the units used in the coords
+ attribute when the units
+ attribute is other
+. This attribute is forbidden otherwise.</a:documentation>
+      <data type="NMTOKEN"/>
+    </attribute>
+  </define>
+  <define name="db.area.units.attribute">
+    <choice>
+      <ref name="db.area.units-enum.attribute"/>
+      <ref name="db.area.units-other.attributes"/>
+    </choice>
+  </define>
+  <div>
+    <define name="db.calloutlist.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.calloutlist.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.calloutlist.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.calloutlist.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.calloutlist">
+      <element name="calloutlist">
+        <a:documentation>A list of callout
+s</a:documentation>
+        <ref name="db.calloutlist.attlist"/>
+        <ref name="db.calloutlist.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <oneOrMore>
+          <ref name="db.callout"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.callout.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.callout.arearefs.attribute">
+      <attribute name="arearefs">
+        <a:documentation>Identifies the areas described by this callout.</a:documentation>
+        <data type="IDREFS"/>
+      </attribute>
+    </define>
+    <define name="db.callout.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.callout.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.callout.arearefs.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.callout">
+      <element name="callout">
+        <a:documentation>A called out
+ description of a marked Area</a:documentation>
+        <ref name="db.callout.attlist"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.programlistingco.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.programlistingco.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.programlistingco.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.programlistingco.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.programlistingco">
+      <element name="programlistingco">
+        <a:documentation>A program listing with associated areas used in callouts</a:documentation>
+        <ref name="db.programlistingco.attlist"/>
+        <ref name="db.programlistingco.info"/>
+        <ref name="db.areaspec"/>
+        <ref name="db.programlisting"/>
+        <zeroOrMore>
+          <ref name="db.calloutlist"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.areaspec.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.areaspec.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.areaspec.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.area.units.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.areaspec">
+      <element name="areaspec">
+        <a:documentation>A collection of regions in a graphic or code example</a:documentation>
+        <ref name="db.areaspec.attlist"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.area"/>
+            <ref name="db.areaset"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.area.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.area.linkends.attribute">
+      <attribute name="linkends">
+        <a:documentation>Point to the callout
+s which refer to this area. (This provides bidirectional linking which may be useful in online presentation.)</a:documentation>
+        <data type="IDREFS"/>
+      </attribute>
+    </define>
+    <define name="db.area.label.attribute">
+      <attribute name="label">
+        <a:documentation>Specifies an identifying number or string that may be used in presentation. The area label might be drawn on top of the figure, for example, at the position indicated by the coords attribute.</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.area.coords.attribute">
+      <attribute name="coords">
+        <a:documentation>Provides the coordinates of the area. The coordinates must be interpreted using the units
+ specified.</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.area.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.area.role.attribute"/>
+        </optional>
+        <ref name="db.common.idreq.attributes"/>
+        <ref name="db.area.units.attribute"/>
+        <optional>
+          <choice>
+            <ref name="db.area.linkends.attribute"/>
+            <ref name="db.href.attributes"/>
+          </choice>
+        </optional>
+        <optional>
+          <ref name="db.area.label.attribute"/>
+        </optional>
+        <ref name="db.area.coords.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.area">
+      <element name="area">
+        <a:documentation>A region defined for a Callout in a graphic or code example</a:documentation>
+        <ref name="db.area.attlist"/>
+        <optional>
+          <ref name="db.alt"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+<!-- The only difference is that xml:id is optional -->
+    <define name="db.area.inareaset.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.area.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.area.units.attribute"/>
+        <optional>
+          <choice>
+            <ref name="db.area.linkends.attribute"/>
+            <ref name="db.href.attributes"/>
+          </choice>
+        </optional>
+        <optional>
+          <ref name="db.area.label.attribute"/>
+        </optional>
+        <ref name="db.area.coords.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.area.inareaset">
+      <element name="area">
+        <a:documentation>A region defined for a Callout in a graphic or code example</a:documentation>
+        <ref name="db.area.inareaset.attlist"/>
+        <optional>
+          <ref name="db.alt"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.areaset.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.areaset.linkends.attribute">
+      <ref name="db.linkends.attribute"/>
+    </define>
+    <define name="db.areaset.label.attribute">
+      <ref name="db.label.attribute"/>
+    </define>
+    <define name="db.areaset.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.areaset.role.attribute"/>
+        </optional>
+        <ref name="db.common.idreq.attributes"/>
+        <ref name="db.area.units.attribute"/>
+        <optional>
+          <choice>
+            <ref name="db.areaset.linkends.attribute"/>
+            <ref name="db.href.attributes"/>
+          </choice>
+        </optional>
+        <optional>
+          <ref name="db.areaset.label.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.areaset">
+      <element name="areaset">
+        <a:documentation>A set of related areas in a graphic or code example</a:documentation>
+        <ref name="db.areaset.attlist"/>
+        <oneOrMore>
+          <ref name="db.area.inareaset"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.screenco.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.screenco.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.screenco.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.screenco.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.screenco">
+      <element name="screenco">
+        <a:documentation>A screen with associated areas used in callouts</a:documentation>
+        <ref name="db.screenco.attlist"/>
+        <ref name="db.screenco.info"/>
+        <ref name="db.areaspec"/>
+        <ref name="db.screen"/>
+        <zeroOrMore>
+          <ref name="db.calloutlist"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.imageobjectco.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.imageobjectco.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.imageobjectco.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.imageobjectco.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.imageobjectco">
+      <element name="imageobjectco">
+        <a:documentation>A wrapper for an image object with callouts</a:documentation>
+        <ref name="db.imageobjectco.attlist"/>
+        <ref name="db.imageobjectco.info"/>
+        <ref name="db.areaspec"/>
+        <oneOrMore>
+          <ref name="db.imageobject"/>
+        </oneOrMore>
+        <zeroOrMore>
+          <ref name="db.calloutlist"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.co.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.co.linkends.attribute">
+      <ref name="db.linkends.attribute"/>
+    </define>
+    <define name="db.co.label.attribute">
+      <ref name="db.label.attribute"/>
+    </define>
+    <define name="db.co.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.co.role.attribute"/>
+        </optional>
+        <ref name="db.common.idreq.attributes"/>
+        <optional>
+          <ref name="db.co.linkends.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.co.label.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.co">
+      <element name="co">
+        <a:documentation>The location of a callout embedded in text</a:documentation>
+        <ref name="db.co.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.coref.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.coref.label.attribute">
+      <ref name="db.label.attribute"/>
+    </define>
+    <define name="db.coref.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.coref.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.linkend.attribute"/>
+        <optional>
+          <ref name="db.coref.label.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.coref">
+      <element name="coref">
+        <a:documentation>A cross reference to a co</a:documentation>
+        <ref name="db.coref.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.productionset.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.productionset.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.productionset.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.productionset.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.productionset">
+      <element name="productionset">
+        <a:documentation>A set of EBNF productions</a:documentation>
+        <ref name="db.productionset.attlist"/>
+        <ref name="db.productionset.info"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.production"/>
+            <ref name="db.productionrecap"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.production.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.production.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.production.role.attribute"/>
+        </optional>
+        <ref name="db.common.idreq.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.production">
+      <element name="production">
+        <a:documentation>A production in a set of EBNF productions</a:documentation>
+        <ref name="db.production.attlist"/>
+        <ref name="db.lhs"/>
+        <ref name="db.rhs"/>
+        <zeroOrMore>
+          <ref name="db.constraint"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.lhs.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.lhs.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.lhs.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.lhs">
+      <element name="lhs">
+        <a:documentation>The left-hand side of an EBNF production</a:documentation>
+        <ref name="db.lhs.attlist"/>
+        <text/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.rhs.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.rhs.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.rhs.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.rhs">
+      <element name="rhs">
+        <a:documentation>The right-hand side of an EBNF production</a:documentation>
+        <ref name="db.rhs.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <text/>
+            <ref name="db.nonterminal"/>
+            <ref name="db.lineannotation"/>
+            <ref name="db.sbr"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.nonterminal.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.nonterminal.def.attribute">
+      <attribute name="def">
+        <a:documentation>Specifies a URI that points to a production
+where the nonterminal
+ is defined</a:documentation>
+        <data type="anyURI"/>
+      </attribute>
+    </define>
+    <define name="db.nonterminal.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.nonterminal.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.nonterminal.def.attribute"/>
+      </interleave>
+    </define>
+    <define name="db.nonterminal">
+      <element name="nonterminal">
+        <a:documentation>A non-terminal in an EBNF production</a:documentation>
+        <ref name="db.nonterminal.attlist"/>
+        <text/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.constraint.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.constraint.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.constraint.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.req.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.constraint">
+      <element name="constraint">
+        <a:documentation>A constraint in an EBNF production</a:documentation>
+        <ref name="db.constraint.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.productionrecap.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.productionrecap.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.productionrecap.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.req.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.productionrecap">
+      <element name="productionrecap">
+        <a:documentation>A cross-reference to an EBNF production</a:documentation>
+        <ref name="db.productionrecap.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.constraintdef.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.constraintdef.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.constraintdef.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.constraintdef.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.constraintdef">
+      <element name="constraintdef">
+        <a:documentation>The definition of a constraint in an EBNF production</a:documentation>
+        <ref name="db.constraintdef.attlist"/>
+        <ref name="db.constraintdef.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <define name="db.char.attribute">
+    <attribute name="char">
+      <a:documentation>Specifies the alignment character when align
+ is set to char
+.</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.charoff.attribute">
+    <attribute name="charoff">
+      <a:documentation>Specifies the percentage of the column's total width that should appear to the left of the first occurance of the character identified in char
+ when align
+ is set to char
+.</a:documentation>
+      <data type="decimal">
+        <param name="minExclusive">0</param>
+        <param name="maxExclusive">100</param>
+      </data>
+    </attribute>
+  </define>
+  <define name="db.frame.attribute">
+    <attribute name="frame">
+      <a:documentation>Specifies how the table is to be framed. Note that there is no way to obtain a border on only the starting edge (left, in left-to-right writing systems) of the table.</a:documentation>
+      <choice>
+        <value>all</value>
+        <a:documentation>Frame all four sides of the table. In some environments with limited control over table border formatting, such as HTML, this may imply additional borders.</a:documentation>
+        <value>bottom</value>
+        <a:documentation>Frame only the bottom of the table.</a:documentation>
+        <value>none</value>
+        <a:documentation>Place no border on the table. In some environments with limited control over table border formatting, such as HTML, this may disable other borders as well.</a:documentation>
+        <value>sides</value>
+        <a:documentation>Frame the left and right sides of the table.</a:documentation>
+        <value>top</value>
+        <a:documentation>Frame the top of the table.</a:documentation>
+        <value>topbot</value>
+        <a:documentation>Frame the top and bottom of the table.</a:documentation>
+      </choice>
+    </attribute>
+  </define>
+  <define name="db.colsep.attribute">
+    <attribute name="colsep">
+      <a:documentation>Specifies the presence or absence of the column separator</a:documentation>
+      <choice>
+        <value>0</value>
+        <a:documentation>No column separator rule.</a:documentation>
+        <value>1</value>
+        <a:documentation>Provide a column separator rule on the right</a:documentation>
+      </choice>
+    </attribute>
+  </define>
+  <define name="db.rowsep.attribute">
+    <attribute name="rowsep">
+      <a:documentation>Specifies the presence or absence of the row separator</a:documentation>
+      <choice>
+        <value>0</value>
+        <a:documentation>No row separator rule.</a:documentation>
+        <value>1</value>
+        <a:documentation>Provide a row separator rule below</a:documentation>
+      </choice>
+    </attribute>
+  </define>
+  <define name="db.orient.attribute">
+    <attribute name="orient">
+      <a:documentation>Specifies the orientation of the table</a:documentation>
+      <choice>
+        <value>land</value>
+        <a:documentation>90 degrees counter-clockwise from the rest of the text flow.</a:documentation>
+        <value>port</value>
+        <a:documentation>The same orientation as the rest of the text flow.</a:documentation>
+      </choice>
+    </attribute>
+  </define>
+  <define name="db.tabstyle.attribute">
+    <attribute name="tabstyle">
+      <a:documentation>Specifies the table style</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.rowheader.attribute">
+    <attribute name="rowheader">
+      <a:documentation>Indicates whether or not the entries in the first column should be considered row headers</a:documentation>
+      <choice>
+        <value>firstcol</value>
+        <a:documentation>Indicates that entries in the first column of the table are functionally row headers (analogous to the way that a thead provides column headers).</a:documentation>
+        <value>norowheader</value>
+        <a:documentation>Indicates that entries in the first column have no special significance with respect to column headers.</a:documentation>
+      </choice>
+    </attribute>
+  </define>
+  <define name="db.align.attribute">
+    <attribute name="align">
+      <a:documentation>Specifies the horizontal alignment of text in an entry.</a:documentation>
+      <choice>
+        <value>center</value>
+        <a:documentation>Centered.</a:documentation>
+        <value>char</value>
+        <a:documentation>Aligned on a particular character.</a:documentation>
+        <value>justify</value>
+        <a:documentation>Left and right justified.</a:documentation>
+        <value>left</value>
+        <a:documentation>Left justified.</a:documentation>
+        <value>right</value>
+        <a:documentation>Right justified.</a:documentation>
+      </choice>
+    </attribute>
+  </define>
+  <define name="db.valign.attribute">
+    <attribute name="valign">
+      <a:documentation>Specifies the vertical alignment of text in an entry.</a:documentation>
+      <choice>
+        <value>bottom</value>
+        <a:documentation>Aligned on the bottom of the entry.</a:documentation>
+        <value>middle</value>
+        <a:documentation>Aligned in the middle.</a:documentation>
+        <value>top</value>
+        <a:documentation>Aligned at the top of the entry.</a:documentation>
+      </choice>
+    </attribute>
+  </define>
+  <define name="db.specify-col-by-colname.attributes">
+    <attribute name="colname">
+      <a:documentation>Specifies a column specification by name.</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.specify-col-by-namest.attributes">
+    <attribute name="namest">
+      <a:documentation>Specifies a starting column by name.</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.specify-span-by-spanspec.attributes">
+    <attribute name="spanname">
+      <a:documentation>Specifies a span by name.</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.specify-span-directly.attributes">
+    <interleave>
+      <attribute name="namest">
+        <a:documentation>Specifies a starting column by name.</a:documentation>
+      </attribute>
+      <attribute name="nameend">
+        <a:documentation>Specifies an ending column by name.</a:documentation>
+      </attribute>
+    </interleave>
+  </define>
+  <define name="db.column-spec.attributes">
+    <choice>
+      <ref name="db.specify-col-by-colname.attributes"/>
+      <ref name="db.specify-col-by-namest.attributes"/>
+      <ref name="db.specify-span-by-spanspec.attributes"/>
+      <ref name="db.specify-span-directly.attributes"/>
+    </choice>
+  </define>
+  <define name="db.colname.attribute">
+    <attribute name="colname">
+      <a:documentation>Provides a name for a column specification.</a:documentation>
+    </attribute>
+  </define>
+  <define name="db.spanname.attribute">
+    <attribute name="spanname">
+      <a:documentation>Provides a name for a span specification.</a:documentation>
+    </attribute>
+  </define>
+  <div>
+    <define name="db.tgroup.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.tgroup.tgroupstyle.attribute">
+      <attribute name="tgroupstyle">
+        <a:documentation>Additional style information for downstream processing; typically the name of a style.</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.tgroup.cols.attribute">
+      <attribute name="cols">
+        <a:documentation>The number of columns in the table. Must be an integer greater than zero.</a:documentation>
+        <data type="positiveInteger"/>
+      </attribute>
+    </define>
+    <define name="db.tgroup.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.tgroup.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.char.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.charoff.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.tgroup.tgroupstyle.attribute"/>
+        </optional>
+        <ref name="db.tgroup.cols.attribute"/>
+        <optional>
+          <ref name="db.colsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.rowsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.align.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.tgroup">
+      <element name="tgroup">
+        <a:documentation>A wrapper for the main content of a table, or part of a table</a:documentation>
+        <ref name="db.tgroup.attlist"/>
+        <zeroOrMore>
+          <ref name="db.colspec"/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name="db.spanspec"/>
+        </zeroOrMore>
+        <optional>
+          <ref name="db.cals.thead"/>
+        </optional>
+        <optional>
+          <ref name="db.cals.tfoot"/>
+        </optional>
+        <ref name="db.cals.tbody"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.colspec.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.colspec.colnum.attribute">
+      <attribute name="colnum">
+        <a:documentation>The number of the column to which this specification applies. Must be greater than any preceding column number. Defaults to one more than the number of the preceding column, if there is one, or one.</a:documentation>
+        <data type="positiveInteger"/>
+      </attribute>
+    </define>
+    <define name="db.colspec.colwidth.attribute">
+      <attribute name="colwidth">
+        <a:documentation>Specifies the width of the column.</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.colspec.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.colspec.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.colspec.colnum.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.char.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.colsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.colspec.colwidth.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.charoff.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.colname.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.rowsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.align.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.colspec">
+      <element name="colspec">
+        <a:documentation>Specifications for a column in a table</a:documentation>
+        <ref name="db.colspec.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.spanspec.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.spanspec.namest.attribute">
+      <attribute name="namest">
+        <a:documentation>Specifies a starting column by name.</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.spanspec.nameend.attribute">
+      <attribute name="nameend">
+        <a:documentation>Specifies an ending column by name.</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.spanspec.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.spanspec.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <ref name="db.spanname.attribute"/>
+        <ref name="db.spanspec.namest.attribute"/>
+        <ref name="db.spanspec.nameend.attribute"/>
+        <optional>
+          <ref name="db.char.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.colsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.charoff.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.rowsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.align.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.spanspec">
+      <element name="spanspec">
+        <a:documentation>Formatting information for a spanned column in a table</a:documentation>
+        <ref name="db.spanspec.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.cals.thead.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.cals.thead.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.cals.thead.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.valign.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.cals.thead">
+      <element name="thead">
+        <a:documentation>A table header consisting of one or more rows</a:documentation>
+        <ref name="db.cals.thead.attlist"/>
+        <zeroOrMore>
+          <ref name="db.colspec"/>
+        </zeroOrMore>
+        <oneOrMore>
+          <ref name="db.row"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.cals.tfoot.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.cals.tfoot.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.cals.tfoot.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.valign.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.cals.tfoot">
+      <element name="tfoot">
+        <a:documentation>A table footer consisting of one or more rows</a:documentation>
+        <ref name="db.cals.tfoot.attlist"/>
+        <zeroOrMore>
+          <ref name="db.colspec"/>
+        </zeroOrMore>
+        <oneOrMore>
+          <ref name="db.row"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.cals.tbody.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.cals.tbody.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.cals.tbody.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.valign.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.cals.tbody">
+      <element name="tbody">
+        <a:documentation>A wrapper for the rows of a table or informal table</a:documentation>
+        <ref name="db.cals.tbody.attlist"/>
+        <oneOrMore>
+          <ref name="db.row"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.row.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.row.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.row.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.rowsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.valign.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.row">
+      <element name="row">
+        <a:documentation>A row in a table</a:documentation>
+        <ref name="db.row.attlist"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.entry"/>
+            <ref name="db.entrytbl"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.entry.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.entry.morerows.attribute">
+      <attribute name="morerows">
+        <a:documentation>Specifies the number of additional rows which this entry occupies. Defaults to zero.</a:documentation>
+        <data type="integer"/>
+      </attribute>
+    </define>
+    <define name="db.entry.rotate.attribute">
+      <attribute name="rotate">
+        <a:documentation>Specifies the rotation of this entry. A value of 1 (true) rotates the cell 90 degrees counter-clockwise. A value of 0 (false) leaves the cell unrotated.</a:documentation>
+        <choice>
+          <value>0</value>
+          <a:documentation>Do not rotate the cell.</a:documentation>
+          <value>1</value>
+          <a:documentation>Rotate the cell 90 degrees counter-clockwise.</a:documentation>
+        </choice>
+      </attribute>
+    </define>
+    <define name="db.entry.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.entry.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.valign.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.char.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.colsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.charoff.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.entry.morerows.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.column-spec.attributes"/>
+        </optional>
+        <optional>
+          <ref name="db.rowsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.entry.rotate.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.align.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.entry">
+      <element name="entry">
+        <a:documentation>A cell in a table</a:documentation>
+        <ref name="db.entry.attlist"/>
+        <choice>
+          <zeroOrMore>
+            <ref name="db.all.inlines"/>
+          </zeroOrMore>
+          <zeroOrMore>
+            <ref name="db.all.blocks"/>
+          </zeroOrMore>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.entrytbl.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.entrytbl.tgroupstyle.attribute">
+      <attribute name="tgroupstyle">
+        <a:documentation>Additional style information for downstream processing; typically the name of a style.</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.entrytbl.cols.attribute">
+      <attribute name="cols">
+        <a:documentation>The number of columns in the entry table. Must be an integer greater than zero.</a:documentation>
+        <data type="positiveInteger"/>
+      </attribute>
+    </define>
+    <define name="db.entrytbl.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.entrytbl.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.char.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.charoff.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.column-spec.attributes"/>
+        </optional>
+        <optional>
+          <ref name="db.entrytbl.tgroupstyle.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.entrytbl.cols.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.colsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.rowsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.align.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.entrytbl">
+      <element name="entrytbl">
+        <a:documentation>A subtable appearing in place of an Entry in a table</a:documentation>
+        <ref name="db.entrytbl.attlist"/>
+        <zeroOrMore>
+          <ref name="db.colspec"/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name="db.spanspec"/>
+        </zeroOrMore>
+        <optional>
+          <ref name="db.cals.entrytbl.thead"/>
+        </optional>
+        <ref name="db.cals.entrytbl.tbody"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.cals.entrytbl.thead.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.cals.entrytbl.thead.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.cals.entrytbl.thead.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.valign.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.cals.entrytbl.thead">
+      <element name="thead">
+        <a:documentation>A table header consisting of one or more rows</a:documentation>
+        <ref name="db.cals.entrytbl.thead.attlist"/>
+        <zeroOrMore>
+          <ref name="db.colspec"/>
+        </zeroOrMore>
+        <oneOrMore>
+          <ref name="db.entrytbl.row"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.cals.entrytbl.tbody.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.cals.entrytbl.tbody.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.cals.entrytbl.tbody.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.valign.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.cals.entrytbl.tbody">
+      <element name="tbody">
+        <a:documentation>A wrapper for the rows of a table or informal table</a:documentation>
+        <ref name="db.cals.entrytbl.tbody.attlist"/>
+        <oneOrMore>
+          <ref name="db.entrytbl.row"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.entrytbl.row.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.entrytbl.row.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.entrytbl.row.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.rowsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.valign.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.entrytbl.row">
+      <element name="row">
+        <a:documentation>A row in a table</a:documentation>
+        <ref name="db.entrytbl.row.attlist"/>
+        <oneOrMore>
+          <ref name="db.entry"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.cals.table.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.cals.table.label.attribute">
+      <ref name="db.label.attribute"/>
+    </define>
+    <define name="db.cals.table.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.cals.table.role.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.cals.table.label.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.tabstyle.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.floatstyle.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.orient.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.colsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.rowsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.frame.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.pgwide.attribute"/>
+        </optional>
+        <optional>
+          <attribute name="shortentry">
+            <a:documentation>Indicates if the short or long title should be used in a List of Tables</a:documentation>
+            <choice>
+              <value>0</value>
+              <a:documentation>Indicates that the full title should be used.</a:documentation>
+              <value>1</value>
+              <a:documentation>Indicates that the short short title (titleabbrev) should be used.</a:documentation>
+            </choice>
+          </attribute>
+        </optional>
+        <optional>
+          <attribute name="tocentry">
+            <a:documentation>Indicates if the table should appear in a List of Tables</a:documentation>
+            <choice>
+              <value>0</value>
+              <a:documentation>Indicates that the table should not occur in the List of Tables.</a:documentation>
+              <value>1</value>
+              <a:documentation>Indicates that the table should appear in the List of Tables.</a:documentation>
+            </choice>
+          </attribute>
+        </optional>
+        <optional>
+          <ref name="db.rowheader.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.cals.table.info">
+      <ref name="db._info.title.onlyreq"/>
+    </define>
+    <define name="db.cals.table">
+      <element name="table">
+        <a:documentation>A formal table in a document</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:example)">example must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:figure)">figure must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:equation)">equation must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:caution)">caution must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:important)">important must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:note)">note must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:tip)">tip must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:warning)">warning must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:informaltable)">informaltable must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.cals.table.attlist"/>
+        <ref name="db.cals.table.info"/>
+        <interleave>
+          <optional>
+            <ref name="db.alt"/>
+          </optional>
+          <zeroOrMore>
+            <ref name="db.indexing.inlines"/>
+          </zeroOrMore>
+          <zeroOrMore>
+            <ref name="db.textobject"/>
+          </zeroOrMore>
+        </interleave>
+        <choice>
+          <oneOrMore>
+            <ref name="db.mediaobject"/>
+          </oneOrMore>
+          <oneOrMore>
+            <ref name="db.tgroup"/>
+          </oneOrMore>
+        </choice>
+        <optional>
+          <ref name="db.caption"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.cals.informaltable.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.cals.informaltable.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.cals.informaltable.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.tabstyle.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.floatstyle.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.orient.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.colsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.rowsep.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.frame.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.pgwide.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.rowheader.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.cals.informaltable.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.cals.informaltable">
+      <element name="informaltable">
+        <a:documentation>A table without a title</a:documentation>
+        <ref name="db.cals.informaltable.attlist"/>
+        <ref name="db.cals.informaltable.info"/>
+        <interleave>
+          <optional>
+            <ref name="db.alt"/>
+          </optional>
+          <zeroOrMore>
+            <ref name="db.indexing.inlines"/>
+          </zeroOrMore>
+          <zeroOrMore>
+            <ref name="db.textobject"/>
+          </zeroOrMore>
+        </interleave>
+        <choice>
+          <oneOrMore>
+            <ref name="db.mediaobject"/>
+          </oneOrMore>
+          <oneOrMore>
+            <ref name="db.tgroup"/>
+          </oneOrMore>
+        </choice>
+        <optional>
+          <ref name="db.caption"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <define name="db.html.coreattrs">
+    <interleave>
+      <optional>
+        <attribute name="class">
+          <a:documentation>This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names. Multiple class names must be separated by white space characters.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="style">
+          <a:documentation>This attribute specifies style information for the current element.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="title">
+          <a:documentation>This attribute offers advisory information about the element for which it is set.</a:documentation>
+        </attribute>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db.html.i18n">
+    <optional>
+      <attribute name="lang">
+        <a:documentation>This attribute specifies the base language of an element's attribute values and text content. The default value of this attribute is unknown.</a:documentation>
+      </attribute>
+    </optional>
+  </define>
+  <define name="db.html.events">
+    <interleave>
+      <optional>
+        <attribute name="onclick">
+          <a:documentation>Occurs when the pointing device button is clicked over an element.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="ondblclick">
+          <a:documentation>Occurs when the pointing device button is double clicked over an element.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="onmousedown">
+          <a:documentation>Occurs when the pointing device button is pressed over an element.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="onmouseup">
+          <a:documentation>Occurs when the pointing device button is released over an element.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="onmouseover">
+          <a:documentation>Occurs when the pointing device is moved onto an element.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="onmousemove">
+          <a:documentation>Occurs when the pointing device is moved while it is over an element.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="onmouseout">
+          <a:documentation>Occurs when the pointing device is moved away from an element.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="onkeypress">
+          <a:documentation>Occurs when a key is pressed and released over an element.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="onkeydown">
+          <a:documentation>Occurs when a key is pressed down over an element.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="onkeyup">
+          <a:documentation>Occurs when a key is released over an element.</a:documentation>
+        </attribute>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db.html.attrs">
+    <interleave>
+      <ref name="db.common.attributes"/>
+      <ref name="db.html.coreattrs"/>
+      <ref name="db.html.i18n"/>
+      <ref name="db.html.events"/>
+    </interleave>
+  </define>
+  <define name="db.html.cellhalign">
+    <interleave>
+      <optional>
+        <attribute name="align">
+          <a:documentation>Specifies the alignment of data and the justification of text in a cell.</a:documentation>
+          <choice>
+            <value>left</value>
+            <a:documentation>Left-flush data/Left-justify text. This is the default value for table data.</a:documentation>
+            <value>center</value>
+            <a:documentation>Center data/Center-justify text. This is the default value for table headers.</a:documentation>
+            <value>right</value>
+            <a:documentation>Right-flush data/Right-justify text.</a:documentation>
+            <value>justify</value>
+            <a:documentation>Double-justify text.</a:documentation>
+            <value>char</value>
+            <a:documentation>Align text around a specific character. If a user agent doesn't support character alignment, behavior in the presence of this value is unspecified.</a:documentation>
+          </choice>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="char">
+          <a:documentation>This attribute specifies a single character within a text fragment to act as an axis for alignment. The default value for this attribute is the decimal point character for the current language as set by the lang attribute (e.g., the period in English and the comma in French). User agents are not required to support this attribute.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="charoff">
+          <a:documentation>When present, this attribute specifies the offset to the first occurrence of the alignment character on each line. If a line doesn't include the alignment character, it should be horizontally shifted to end at the alignment position. When charoff is used to set the offset of an alignment character, the direction of offset is determined by the current text direction (set by the dir attribute). In left-to-right texts (the default), offset is from the left margin. In right-to-left texts, offset is from the right margin. User agents are not required to support this attribute.</a:documentation>
+          <choice>
+            <data type="integer"/>
+            <data type="string">
+              <param name="pattern">[0-9]+%</param>
+            </data>
+          </choice>
+        </attribute>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db.html.cellvalign">
+    <optional>
+      <attribute name="valign">
+        <a:documentation>Specifies the vertical position of data within a cell.</a:documentation>
+        <choice>
+          <value>top</value>
+          <a:documentation>Cell data is flush with the top of the cell.</a:documentation>
+          <value>middle</value>
+          <a:documentation>Cell data is centered vertically within the cell. This is the default value.</a:documentation>
+          <value>bottom</value>
+          <a:documentation>Cell data is flush with the bottom of the cell.</a:documentation>
+          <value>baseline</value>
+          <a:documentation>All cells in the same row as a cell whose valign attribute has this value should have their textual data positioned so that the first text line occurs on a baseline common to all cells in the row. This constraint does not apply to subsequent text lines in these cells.</a:documentation>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="db.html.table.attributes">
+    <interleave>
+      <optional>
+        <attribute name="summary">
+          <a:documentation>Provides a summary of the table's purpose and structure for user agents rendering to non-visual media such as speech and Braille.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="width">
+          <a:documentation>Specifies the desired width of the entire table and is intended for visual user agents. When the value is a percentage value, the value is relative to the user agent's available horizontal space. In the absence of any width specification, table width is determined by the user agent.</a:documentation>
+          <choice>
+            <data type="integer"/>
+            <data type="string">
+              <param name="pattern">[0-9]+%</param>
+            </data>
+          </choice>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="border">
+          <a:documentation>Specifies the width (in pixels only) of the frame around a table.</a:documentation>
+          <data type="nonNegativeInteger"/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="frame">
+          <a:documentation>Specifies which sides of the frame surrounding a table will be visible.</a:documentation>
+          <choice>
+            <value>void</value>
+            <a:documentation>No sides. This is the default value.</a:documentation>
+            <value>above</value>
+            <a:documentation>The top side only.</a:documentation>
+            <value>below</value>
+            <a:documentation>The bottom side only.</a:documentation>
+            <value>hsides</value>
+            <a:documentation>The top and bottom sides only.</a:documentation>
+            <value>lhs</value>
+            <a:documentation>The left-hand side only.</a:documentation>
+            <value>rhs</value>
+            <a:documentation>The right-hand side only.</a:documentation>
+            <value>vsides</value>
+            <a:documentation>The right and left sides only.</a:documentation>
+            <value>box</value>
+            <a:documentation>All four sides.</a:documentation>
+            <value>border</value>
+            <a:documentation>All four sides.</a:documentation>
+          </choice>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="rules">
+          <a:documentation>Specifies which rules will appear between cells within a table. The rendering of rules is user agent dependent.</a:documentation>
+          <choice>
+            <value>none</value>
+            <a:documentation>No rules. This is the default value.</a:documentation>
+            <value>groups</value>
+            <a:documentation>Rules will appear between row groups (see thead, tfoot, and tbody) and column groups (see colgroup and col) only.</a:documentation>
+            <value>rows</value>
+            <a:documentation>Rules will appear between rows only.</a:documentation>
+            <value>cols</value>
+            <a:documentation>Rules will appear between columns only.</a:documentation>
+            <value>all</value>
+            <a:documentation>Rules will appear between all rows and columns.</a:documentation>
+          </choice>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="cellspacing">
+          <a:documentation>Specifies how much space the user agent should leave between the left side of the table and the left-hand side of the leftmost column, the top of the table and the top side of the topmost row, and so on for the right and bottom of the table. The attribute also specifies the amount of space to leave between cells.</a:documentation>
+          <choice>
+            <data type="integer"/>
+            <data type="string">
+              <param name="pattern">[0-9]+%</param>
+            </data>
+          </choice>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="cellpadding">
+          <a:documentation>Specifies the amount of space between the border of the cell and its contents. If the value of this attribute is a pixel length, all four margins should be this distance from the contents. If the value of the attribute is a percentage length, the top and bottom margins should be equally separated from the content based on a percentage of the available vertical space, and the left and right margins should be equally separated from the content based on a percentage of the available horizontal space.</a:documentation>
+          <choice>
+            <data type="integer"/>
+            <data type="string">
+              <param name="pattern">[0-9]+%</param>
+            </data>
+          </choice>
+        </attribute>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db.html.tablecell.attributes">
+    <interleave>
+      <optional>
+        <attribute name="abbr">
+          <a:documentation>Provides an abbreviated form of the cell's content and may be rendered by user agents when appropriate in place of the cell's content. Abbreviated names should be short since user agents may render them repeatedly. For instance, speech synthesizers may render the abbreviated headers relating to a particular cell before rendering that cell's content.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="axis">
+          <a:documentation>This attribute may be used to place a cell into conceptual categories that can be considered to form axes in an n-dimensional space. User agents may give users access to these categories (e.g., the user may query the user agent for all cells that belong to certain categories, the user agent may present a table in the form of a table of contents, etc.). Please consult an HTML reference for more details.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="headers">
+          <a:documentation>Specifies the list of header cells that provide header information for the current data cell. The value of this attribute is a space-separated list of cell names; those cells must be named by setting their id attribute. Authors generally use the headers attribute to help non-visual user agents render header information about data cells (e.g., header information is spoken prior to the cell data), but the attribute may also be used in conjunction with style sheets.</a:documentation>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="scope">
+          <a:documentation>Specifies the set of data cells for which the current header cell provides header information. This attribute may be used in place of the headers attribute, particularly for simple tables.</a:documentation>
+          <choice>
+            <value>row</value>
+            <a:documentation>The current cell provides header information for the rest of the row that contains it</a:documentation>
+            <value>col</value>
+            <a:documentation>The current cell provides header information for the rest of the column that contains it.</a:documentation>
+            <value>rowgroup</value>
+            <a:documentation>The header cell provides header information for the rest of the row group that contains it.</a:documentation>
+            <value>colgroup</value>
+            <a:documentation>The header cell provides header information for the rest of the column group that contains it.</a:documentation>
+          </choice>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="rowspan">
+          <a:documentation>Specifies the number of rows spanned by the current cell. The default value of this attribute is one (1
+). The value zero (0
+) means that the cell spans all rows from the current row to the last row of the table section (thead
+, tbody
+, or tfoot
+) in which the cell is defined.</a:documentation>
+          <data type="nonNegativeInteger"/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="colspan">
+          <a:documentation>Specifies the number of columns spanned by the current cell. The default value of this attribute is one (1
+). The value zero (0
+) means that the cell spans all columns from the current column to the last column of the column group (colgroup
+) in which the cell is defined.</a:documentation>
+          <data type="nonNegativeInteger"/>
+        </attribute>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db.html.table.info">
+    <ref name="db._info.title.forbidden"/>
+  </define>
+  <define name="db.html.table.model">
+    <optional>
+      <ref name="db.html.table.info"/>
+    </optional>
+    <ref name="db.html.caption"/>
+    <choice>
+      <zeroOrMore>
+        <ref name="db.html.col"/>
+      </zeroOrMore>
+      <zeroOrMore>
+        <ref name="db.html.colgroup"/>
+      </zeroOrMore>
+    </choice>
+    <optional>
+      <ref name="db.html.thead"/>
+    </optional>
+    <optional>
+      <ref name="db.html.tfoot"/>
+    </optional>
+    <choice>
+      <oneOrMore>
+        <ref name="db.html.tbody"/>
+      </oneOrMore>
+      <oneOrMore>
+        <ref name="db.html.tr"/>
+      </oneOrMore>
+    </choice>
+  </define>
+  <define name="db.html.informaltable.info">
+    <ref name="db._info.title.forbidden"/>
+  </define>
+  <define name="db.html.informaltable.model">
+    <optional>
+      <ref name="db.html.informaltable.info"/>
+    </optional>
+    <choice>
+      <zeroOrMore>
+        <ref name="db.html.col"/>
+      </zeroOrMore>
+      <zeroOrMore>
+        <ref name="db.html.colgroup"/>
+      </zeroOrMore>
+    </choice>
+    <optional>
+      <ref name="db.html.thead"/>
+    </optional>
+    <optional>
+      <ref name="db.html.tfoot"/>
+    </optional>
+    <choice>
+      <oneOrMore>
+        <ref name="db.html.tbody"/>
+      </oneOrMore>
+      <oneOrMore>
+        <ref name="db.html.tr"/>
+      </oneOrMore>
+    </choice>
+  </define>
+  <div>
+    <define name="db.html.table.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.html.table.label.attribute">
+      <ref name="db.label.attribute"/>
+    </define>
+    <define name="db.html.table.attlist">
+      <interleave>
+        <ref name="db.html.attrs"/>
+        <ref name="db.html.table.attributes"/>
+        <optional>
+          <ref name="db.html.table.role.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.html.table.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.orient.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.pgwide.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.tabstyle.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.floatstyle.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.html.table">
+      <element name="table">
+        <a:documentation>A formal (captioned) HTML table in a document</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:example)">example must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:figure)">figure must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:equation)">equation must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:caution)">caution must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:important)">important must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:note)">note must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:tip)">tip must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:warning)">warning must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:table">
+            <s:assert test="not(.//db:informaltable)">informaltable must not occur in the descendants of table</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.html.table.attlist"/>
+        <ref name="db.html.table.model"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.html.informaltable.attlist">
+      <interleave>
+        <ref name="db.html.attrs"/>
+        <ref name="db.html.table.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.html.informaltable">
+      <element name="informaltable">
+        <a:documentation>An HTML table without a title</a:documentation>
+        <ref name="db.html.informaltable.attlist"/>
+        <ref name="db.html.informaltable.model"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.html.caption.attlist">
+      <ref name="db.html.attrs"/>
+    </define>
+    <define name="db.html.caption">
+      <element name="caption">
+        <a:documentation>An HTML table caption</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:example)">example must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:figure)">figure must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:table)">table must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:equation)">equation must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:caution)">caution must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:important)">important must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:note)">note must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:tip)">tip must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:warning)">warning must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:sidebar)">sidebar must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:caption">
+            <s:assert test="not(.//db:task)">task must not occur in the descendants of caption</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.html.caption.attlist"/>
+        <zeroOrMore>
+          <ref name="db.all.inlines"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.html.col.attlist">
+      <interleave>
+        <ref name="db.html.attrs"/>
+        <optional>
+          <attribute name="span">
+            <a:documentation>This attribute, whose value must be an integer &gt; 0, specifies the number of columns spanned
+ by the col
+ element; the col
+ element shares its attributes with all the columns it spans. The default value for this attribute is 1 (i.e., a single column). If the span attribute is set to N &gt; 1, the current col
+ element shares its attributes with the next N-1 columns.</a:documentation>
+            <data type="nonNegativeInteger"/>
+          </attribute>
+        </optional>
+        <optional>
+          <attribute name="width">
+            <a:documentation>Specifies a default width for each column spanned by the current col
+ element. It has the same meaning as the width
+ attribute for the colgroup
+ element and overrides it.</a:documentation>
+          </attribute>
+        </optional>
+        <ref name="db.html.cellhalign"/>
+        <ref name="db.html.cellvalign"/>
+      </interleave>
+    </define>
+    <define name="db.html.col">
+      <element name="col">
+        <a:documentation>Specifications for a column in an HTML table</a:documentation>
+        <ref name="db.html.col.attlist"/>
+        <empty/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.html.colgroup.attlist">
+      <interleave>
+        <ref name="db.html.attrs"/>
+        <optional>
+          <attribute name="span">
+            <a:documentation>This attribute, which must be an integer &gt; 0, specifies the number of columns in a column group. In the absence of a span attribute, each colgroup
+ defines a column group containing one column. If the span attribute is set to N &gt; 0, the current colgroup
+ element defines a column group containing N columns. User agents must ignore this attribute if the colgroup
+ element contains one or more col
+ elements.</a:documentation>
+            <data type="nonNegativeInteger"/>
+          </attribute>
+        </optional>
+        <optional>
+          <attribute name="width">
+            <a:documentation>This attribute specifies a default width for each column in the current column group. In addition to the standard pixel, percentage, and relative values, this attribute allows the special form 0*
+ (zero asterisk) which means that the width of the each column in the group should be the minimum width necessary to hold the column's contents. This implies that a column's entire contents must be known before its width may be correctly computed. Authors should be aware that specifying 0*
+ will prevent visual user agents from rendering a table incrementally. This attribute is overridden for any column in the column group whose width is specified via a col
+ element.</a:documentation>
+          </attribute>
+        </optional>
+        <ref name="db.html.cellhalign"/>
+        <ref name="db.html.cellvalign"/>
+      </interleave>
+    </define>
+    <define name="db.html.colgroup">
+      <element name="colgroup">
+        <a:documentation>A group of columns in an HTML table</a:documentation>
+        <ref name="db.html.colgroup.attlist"/>
+        <zeroOrMore>
+          <ref name="db.html.col"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.html.thead.attlist">
+      <interleave>
+        <ref name="db.html.attrs"/>
+        <ref name="db.html.cellhalign"/>
+        <ref name="db.html.cellvalign"/>
+      </interleave>
+    </define>
+    <define name="db.html.thead">
+      <element name="thead">
+        <a:documentation>A table header consisting of one or more rows in an HTML table</a:documentation>
+        <ref name="db.html.thead.attlist"/>
+        <oneOrMore>
+          <ref name="db.html.tr"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.html.tfoot.attlist">
+      <interleave>
+        <ref name="db.html.attrs"/>
+        <ref name="db.html.cellhalign"/>
+        <ref name="db.html.cellvalign"/>
+      </interleave>
+    </define>
+    <define name="db.html.tfoot">
+      <element name="tfoot">
+        <a:documentation>A table footer consisting of one or more rows in an HTML table</a:documentation>
+        <ref name="db.html.tfoot.attlist"/>
+        <oneOrMore>
+          <ref name="db.html.tr"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.html.tbody.attlist">
+      <interleave>
+        <ref name="db.html.attrs"/>
+        <ref name="db.html.cellhalign"/>
+        <ref name="db.html.cellvalign"/>
+      </interleave>
+    </define>
+    <define name="db.html.tbody">
+      <element name="tbody">
+        <a:documentation>A wrapper for the rows of an HTML table or informal HTML table</a:documentation>
+        <ref name="db.html.tbody.attlist"/>
+        <oneOrMore>
+          <ref name="db.html.tr"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.html.tr.attlist">
+      <interleave>
+        <ref name="db.html.attrs"/>
+        <ref name="db.html.cellhalign"/>
+        <ref name="db.html.cellvalign"/>
+      </interleave>
+    </define>
+    <define name="db.html.tr">
+      <element name="tr">
+        <a:documentation>A row in an HTML table</a:documentation>
+        <ref name="db.html.tr.attlist"/>
+        <oneOrMore>
+          <choice>
+            <ref name="db.html.th"/>
+            <ref name="db.html.td"/>
+          </choice>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.html.th.attlist">
+      <interleave>
+        <ref name="db.html.attrs"/>
+        <ref name="db.html.tablecell.attributes"/>
+        <ref name="db.html.cellhalign"/>
+        <ref name="db.html.cellvalign"/>
+      </interleave>
+    </define>
+    <define name="db.html.th">
+      <element name="th">
+        <a:documentation>A table header entry in an HTML table</a:documentation>
+        <ref name="db.html.th.attlist"/>
+        <choice>
+          <zeroOrMore>
+            <ref name="db.all.inlines"/>
+          </zeroOrMore>
+          <zeroOrMore>
+            <ref name="db.all.blocks"/>
+          </zeroOrMore>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.html.td.attlist">
+      <interleave>
+        <ref name="db.html.attrs"/>
+        <ref name="db.html.tablecell.attributes"/>
+        <ref name="db.html.cellhalign"/>
+        <ref name="db.html.cellvalign"/>
+      </interleave>
+    </define>
+    <define name="db.html.td">
+      <element name="td">
+        <a:documentation>A table entry in an HTML table</a:documentation>
+        <ref name="db.html.td.attlist"/>
+        <choice>
+          <zeroOrMore>
+            <ref name="db.all.inlines"/>
+          </zeroOrMore>
+          <zeroOrMore>
+            <ref name="db.all.blocks"/>
+          </zeroOrMore>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.msgset.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.msgset.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.msgset.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.msgset.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.msgset">
+      <element name="msgset">
+        <a:documentation>A detailed set of messages, usually error messages</a:documentation>
+        <ref name="db.msgset.attlist"/>
+        <ref name="db.msgset.info"/>
+        <choice>
+          <oneOrMore>
+            <ref name="db.msgentry"/>
+          </oneOrMore>
+          <oneOrMore>
+            <ref name="db.simplemsgentry"/>
+          </oneOrMore>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.msgentry.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.msgentry.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.msgentry.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.msgentry">
+      <element name="msgentry">
+        <a:documentation>A wrapper for an entry in a message set</a:documentation>
+        <ref name="db.msgentry.attlist"/>
+        <oneOrMore>
+          <ref name="db.msg"/>
+        </oneOrMore>
+        <optional>
+          <ref name="db.msginfo"/>
+        </optional>
+        <zeroOrMore>
+          <ref name="db.msgexplan"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.simplemsgentry.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.simplemsgentry.msgaud.attribute">
+      <attribute name="msgaud">
+        <a:documentation>The audience to which the message relevant</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.simplemsgentry.msgorig.attribute">
+      <attribute name="msgorig">
+        <a:documentation>The origin of the message</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.simplemsgentry.msglevel.attribute">
+      <attribute name="msglevel">
+        <a:documentation>The level of importance or severity of a message</a:documentation>
+      </attribute>
+    </define>
+    <define name="db.simplemsgentry.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.simplemsgentry.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.simplemsgentry.msgaud.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.simplemsgentry.msgorig.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.simplemsgentry.msglevel.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.simplemsgentry">
+      <element name="simplemsgentry">
+        <a:documentation>A wrapper for a simpler entry in a message set</a:documentation>
+        <ref name="db.simplemsgentry.attlist"/>
+        <ref name="db.msgtext"/>
+        <oneOrMore>
+          <ref name="db.msgexplan"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.msg.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.msg.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.msg.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.msg.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.msg">
+      <element name="msg">
+        <a:documentation>A message in a message set</a:documentation>
+        <ref name="db.msg.attlist"/>
+        <ref name="db.msg.info"/>
+        <ref name="db.msgmain"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.msgsub"/>
+            <ref name="db.msgrel"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.msgmain.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.msgmain.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.msgmain.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.msgmain.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.msgmain">
+      <element name="msgmain">
+        <a:documentation>The primary component of a message in a message set </a:documentation>
+        <ref name="db.msgmain.attlist"/>
+        <ref name="db.msgmain.info"/>
+        <ref name="db.msgtext"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.msgsub.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.msgsub.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.msgsub.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.msgsub.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.msgsub">
+      <element name="msgsub">
+        <a:documentation>A subcomponent of a message in a message set</a:documentation>
+        <ref name="db.msgsub.attlist"/>
+        <ref name="db.msgsub.info"/>
+        <ref name="db.msgtext"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.msgrel.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.msgrel.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.msgrel.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.msgrel.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.msgrel">
+      <element name="msgrel">
+        <a:documentation>A related component of a message in a message set</a:documentation>
+        <ref name="db.msgrel.attlist"/>
+        <ref name="db.msgrel.info"/>
+        <ref name="db.msgtext"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.msgtext.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.msgtext.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.msgtext.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.msgtext">
+      <element name="msgtext">
+        <a:documentation>The actual text of a message component in a message set</a:documentation>
+        <ref name="db.msgtext.attlist"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.msginfo.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.msginfo.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.msginfo.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.msginfo">
+      <element name="msginfo">
+        <a:documentation>Information about a message in a message set</a:documentation>
+        <ref name="db.msginfo.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db.msglevel"/>
+            <ref name="db.msgorig"/>
+            <ref name="db.msgaud"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.msglevel.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.msglevel.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.msglevel.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.msglevel">
+      <element name="msglevel">
+        <a:documentation>The level of importance or severity of a message in a message set</a:documentation>
+        <ref name="db.msglevel.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.msgorig.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.msgorig.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.msgorig.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.msgorig">
+      <element name="msgorig">
+        <a:documentation>The origin of a message in a message set</a:documentation>
+        <ref name="db.msgorig.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.msgaud.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.msgaud.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.msgaud.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.msgaud">
+      <element name="msgaud">
+        <a:documentation>The audience to which a message in a message set is relevant</a:documentation>
+        <ref name="db.msgaud.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.msgexplan.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.msgexplan.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.msgexplan.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.msgexplan.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.msgexplan">
+      <element name="msgexplan">
+        <a:documentation>Explanatory material relating to a message in a message set</a:documentation>
+        <ref name="db.msgexplan.attlist"/>
+        <ref name="db.msgexplan.info"/>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.qandaset.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.qandaset.defaultlabel.enumeration">
+      <choice>
+        <value>none</value>
+        <a:documentation>No labels</a:documentation>
+        <value>number</value>
+        <a:documentation>Numeric labels</a:documentation>
+        <value>qanda</value>
+        <a:documentation>"Q:" and "A:" labels</a:documentation>
+      </choice>
+    </define>
+    <define name="db.qandaset.defaultlabel.attribute">
+      <attribute name="defaultlabel">
+        <a:documentation>Specifies the default labelling</a:documentation>
+        <ref name="db.qandaset.defaultlabel.enumeration"/>
+      </attribute>
+    </define>
+    <define name="db.qandaset.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.qandaset.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.qandaset.defaultlabel.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.qandaset.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.qandaset">
+      <element name="qandaset">
+        <a:documentation>A question-and-answer set</a:documentation>
+        <ref name="db.qandaset.attlist"/>
+        <ref name="db.qandaset.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <choice>
+          <oneOrMore>
+            <ref name="db.qandadiv"/>
+          </oneOrMore>
+          <oneOrMore>
+            <ref name="db.qandaentry"/>
+          </oneOrMore>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.qandadiv.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.qandadiv.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.qandadiv.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.qandadiv.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.qandadiv">
+      <element name="qandadiv">
+        <a:documentation>A titled division in a QandASet</a:documentation>
+        <ref name="db.qandadiv.attlist"/>
+        <ref name="db.qandadiv.info"/>
+        <zeroOrMore>
+          <ref name="db.all.blocks"/>
+        </zeroOrMore>
+        <choice>
+          <oneOrMore>
+            <ref name="db.qandadiv"/>
+          </oneOrMore>
+          <oneOrMore>
+            <ref name="db.qandaentry"/>
+          </oneOrMore>
+        </choice>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.qandaentry.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.qandaentry.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.qandaentry.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.qandaentry.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.qandaentry">
+      <element name="qandaentry">
+        <a:documentation>A question/answer set within a QandASet</a:documentation>
+        <ref name="db.qandaentry.attlist"/>
+        <ref name="db.qandaentry.info"/>
+        <ref name="db.question"/>
+        <zeroOrMore>
+          <ref name="db.answer"/>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+
+  <div>
+    <define name="db.question.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.question.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.question.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.question">
+      <element name="question">
+        <a:documentation>A question in a QandASet</a:documentation>
+        <ref name="db.question.attlist"/>
+        <optional>
+          <ref name="db.label"/>
+        </optional>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.answer.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.answer.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.answer.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.answer">
+      <element name="answer">
+        <a:documentation>An answer to a question posed in a QandASet</a:documentation>
+        <ref name="db.answer.attlist"/>
+        <optional>
+          <ref name="db.label"/>
+        </optional>
+        <oneOrMore>
+          <ref name="db.all.blocks"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.label.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.label.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.label.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.label">
+      <element name="label">
+        <a:documentation>A label on a Question or Answer</a:documentation>
+        <ref name="db.label.attlist"/>
+        <ref name="db._text"/>
+      </element>
+    </define>
+  </div>
+  <define name="db.math.inlines">
+    <ref name="db.inlineequation"/>
+  </define>
+  <define name="db.equation.content">
+    <choice>
+      <choice>
+        <oneOrMore>
+          <ref name="db.mediaobject"/>
+        </oneOrMore>
+        <oneOrMore>
+          <ref name="db.mathphrase"/>
+        </oneOrMore>
+      </choice>
+      <oneOrMore>
+        <ref name="db._any.mml"/>
+      </oneOrMore>
+    </choice>
+  </define>
+  <define name="db.inlineequation.content">
+    <choice>
+      <oneOrMore>
+        <ref name="db.inlinemediaobject"/>
+      </oneOrMore>
+      <oneOrMore>
+        <ref name="db.mathphrase"/>
+      </oneOrMore>
+    </choice>
+  </define>
+  <div>
+    <define name="db.equation.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.equation.label.attribute">
+      <ref name="db.label.attribute"/>
+    </define>
+    <define name="db.equation.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.equation.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+        <optional>
+          <ref name="db.equation.label.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.pgwide.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.floatstyle.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.equation.info">
+      <ref name="db._info.title.only"/>
+    </define>
+    <define name="db.equation">
+      <element name="equation">
+        <a:documentation>A displayed mathematical equation</a:documentation>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:equation">
+            <s:assert test="not(.//db:example)">example must not occur in the descendants of equation</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:equation">
+            <s:assert test="not(.//db:figure)">figure must not occur in the descendants of equation</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:equation">
+            <s:assert test="not(.//db:table)">table must not occur in the descendants of equation</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:equation">
+            <s:assert test="not(.//db:equation)">equation must not occur in the descendants of equation</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:equation">
+            <s:assert test="not(.//db:caution)">caution must not occur in the descendants of equation</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:equation">
+            <s:assert test="not(.//db:important)">important must not occur in the descendants of equation</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:equation">
+            <s:assert test="not(.//db:note)">note must not occur in the descendants of equation</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:equation">
+            <s:assert test="not(.//db:tip)">tip must not occur in the descendants of equation</s:assert>
+          </s:rule>
+        </s:pattern>
+        <s:pattern name="Element exclusion">
+          <s:rule context="db:equation">
+            <s:assert test="not(.//db:warning)">warning must not occur in the descendants of equation</s:assert>
+          </s:rule>
+        </s:pattern>
+        <ref name="db.equation.attlist"/>
+        <ref name="db.equation.info"/>
+        <optional>
+          <ref name="db.alt"/>
+        </optional>
+        <ref name="db.equation.content"/>
+        <optional>
+          <ref name="db.caption"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.informalequation.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.informalequation.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.informalequation.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.informalequation.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.informalequation">
+      <element name="informalequation">
+        <a:documentation>A displayed mathematical equation without a title</a:documentation>
+        <ref name="db.informalequation.attlist"/>
+        <ref name="db.informalequation.info"/>
+        <optional>
+          <ref name="db.alt"/>
+        </optional>
+        <ref name="db.equation.content"/>
+        <optional>
+          <ref name="db.caption"/>
+        </optional>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.inlineequation.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.inlineequation.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.inlineequation.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.inlineequation">
+      <element name="inlineequation">
+        <a:documentation>A mathematical equation or expression occurring inline</a:documentation>
+        <ref name="db.inlineequation.attlist"/>
+        <optional>
+          <ref name="db.alt"/>
+        </optional>
+        <ref name="db.inlineequation.content"/>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.mathphrase.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.mathphrase.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.mathphrase.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <ref name="db.common.linking.attributes"/>
+      </interleave>
+    </define>
+    <define name="db.mathphrase">
+      <element name="mathphrase">
+        <a:documentation>A mathematical phrase, an expression that can be represented with ordinary text and a small amount of markup</a:documentation>
+        <ref name="db.mathphrase.attlist"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._text"/>
+            <ref name="db.ubiq.inlines"/>
+            <ref name="db._emphasis"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.imagedata.mathml.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.imagedata.mathml.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.imagedata.mathml.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <optional>
+          <attribute name="format">
+            <a:documentation>Specifies that the format of the data is MathML</a:documentation>
+            <value>mathml</value>
+            <a:documentation>Specifies MathML.</a:documentation>
+          </attribute>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.align.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.valign.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.width.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.contentwidth.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.scalefit.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.scale.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.depth.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.contentdepth.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.imagedata.mathml.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.imagedata.mathml">
+      <element name="imagedata">
+        <a:documentation>A MathML expression in a media object</a:documentation>
+        <ref name="db.imagedata.mathml.attlist"/>
+        <ref name="db.imagedata.mathml.info"/>
+        <oneOrMore>
+          <ref name="db._any.mml"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db._any.mml">
+      <element>
+        <a:documentation>Any element from the MathML namespace</a:documentation>
+        <nsName ns="http://www.w3.org/1998/Math/MathML"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._any.attribute"/>
+            <text/>
+            <ref name="db._any"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db.imagedata.svg.role.attribute">
+      <attribute name="role"/>
+    </define>
+    <define name="db.imagedata.svg.attlist">
+      <interleave>
+        <optional>
+          <ref name="db.imagedata.svg.role.attribute"/>
+        </optional>
+        <ref name="db.common.attributes"/>
+        <optional>
+          <attribute name="format">
+            <a:documentation>Specifies that the format of the data is SVG</a:documentation>
+            <value>svg</value>
+            <a:documentation>Specifies SVG.</a:documentation>
+          </attribute>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.align.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.valign.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.width.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.contentwidth.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.scalefit.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.scale.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.depth.attribute"/>
+        </optional>
+        <optional>
+          <ref name="db.imagedata.contentdepth.attribute"/>
+        </optional>
+      </interleave>
+    </define>
+    <define name="db.imagedata.svg.info">
+      <ref name="db._info.title.forbidden"/>
+    </define>
+    <define name="db.imagedata.svg">
+      <element name="imagedata">
+        <a:documentation>An SVG drawing in a media object</a:documentation>
+        <ref name="db.imagedata.svg.attlist"/>
+        <ref name="db.imagedata.svg.info"/>
+        <oneOrMore>
+          <ref name="db._any.svg"/>
+        </oneOrMore>
+      </element>
+    </define>
+  </div>
+  <div>
+    <define name="db._any.svg">
+      <element>
+        <a:documentation>Any element from the SVG namespace</a:documentation>
+        <nsName ns="http://www.w3.org/2000/svg"/>
+        <zeroOrMore>
+          <choice>
+            <ref name="db._any.attribute"/>
+            <text/>
+            <ref name="db._any"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </define>
+  </div>
+</grammar>
diff --git a/xml/relaxng/testData/highlighting/fixed-attribute_1.xml b/xml/relaxng/testData/highlighting/fixed-attribute_1.xml
new file mode 100644
index 0000000..453b570
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/fixed-attribute_1.xml
@@ -0,0 +1,2 @@
+<fixed-attribute xmlns="urn:test:simple.rng" x="1.0">
+</fixed-attribute>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/fixed-attribute_2.xml b/xml/relaxng/testData/highlighting/fixed-attribute_2.xml
new file mode 100644
index 0000000..a7a4b23
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/fixed-attribute_2.xml
@@ -0,0 +1,2 @@
+<fixed-attribute xmlns="urn:test:simple.rng" x=<error>"2.0"</error>>
+</fixed-attribute>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/html5/LICENSE b/xml/relaxng/testData/highlighting/html5/LICENSE
new file mode 100644
index 0000000..fd1093c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/LICENSE
@@ -0,0 +1,23 @@
+The RELAX NG Schema for (X)HTML 5 is licensed under the MIT open source license.
+The following legal notice applies to all files in this directory:
+
+Copyright (c) 2005-2007 Elika J. Etemad (fantasai) and Henri Sivonen (hsivonen)
+Copyright (c) 2007-2008 Mozilla Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/xml/relaxng/testData/highlighting/html5/applications.rnc b/xml/relaxng/testData/highlighting/html5/applications.rnc
new file mode 100644
index 0000000..921a551
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/applications.rnc
@@ -0,0 +1,260 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Web Application Features              #
+# #####################################################################
+
+## Additions to Common Attributes
+
+	common.attrs.interact &=
+		(	common.attrs.contextmenu?
+		&	common.attrs.contenteditable?
+		&	common.attrs.draggable?
+		&	common.attrs.hidden?
+		&	common.attrs.spellcheck?
+		)
+		
+	common.attrs.other &= common.attrs.interact
+
+## Context Menu: contextmenu
+
+	common.attrs.contextmenu =
+		attribute contextmenu {
+			common.data.idref
+		}
+
+## Editable Content: contenteditable
+
+	common.attrs.contenteditable =
+		attribute contenteditable {
+			w:string "true" | w:string "false" | w:string ""
+		}
+
+## Draggable Element: draggable
+
+	common.attrs.draggable =
+		attribute draggable {
+			w:string "true" | w:string "false"
+		}
+
+## Hidden Element: hidden
+
+	common.attrs.hidden =
+		attribute hidden {
+			w:string "hidden" | w:string ""
+		}
+
+## Spellchecking and grammar checking: spellcheck
+
+	common.attrs.spellcheck =
+		attribute spellcheck{
+			w:string "true" | w:string "false" | w:string ""
+		}
+
+## Application Cache: manifest
+
+	html.attrs.manifest =
+		attribute manifest {
+			common.data.uri
+		}
+		
+	html.attrs &= html.attrs.manifest?
+
+## Progess Indicator: <progress>
+
+	progress.elem =
+		element progress { progress.inner & progress.attrs }
+	progress.attrs =
+		(	common.attrs
+		&	progress.attrs.value?
+		&	progress.attrs.max?
+		)
+		progress.attrs.value =
+			attribute value {
+				common.data.float.non-negative
+			}
+		progress.attrs.max =
+			attribute max {
+				common.data.float.positive
+			}
+	progress.inner =
+		( common.inner.phrasing ) #Cannot enforce textContent format here
+
+	common.elem.phrasing |= progress.elem
+
+## Command with an associated action: <command type='command'>
+
+	command.command.elem =
+		element command { command.inner & command.command.attrs }
+	command.command.attrs =
+		(	common.attrs
+		&	command.command.attrs.type?
+		&	common-command.attrs
+		)
+		command.command.attrs.type =
+			attribute type {
+				w:string "command"
+			}
+	command.elem = command.command.elem
+
+## Selection of one item from a list of items: <command type='radio'>
+
+	command.radio.elem =
+		element command { command.inner & command.radio.attrs }
+	command.radio.attrs =
+		(	common.attrs
+			&	(	command.radio.attrs.type
+				&	command.radio.attrs.radiogroup #REVISIT taking liberties here
+				&	command.radio.attrs.checked?
+				)
+			&	common-command.attrs
+		)
+		command.radio.attrs.type =
+			attribute type {
+				w:string "radio"
+			}
+		command.radio.attrs.radiogroup =
+			attribute radiogroup {
+				string #REVISIT need special format here?
+			}
+		command.radio.attrs.checked =
+			attribute checked {
+				w:string "checked" | w:string ""
+			}
+	command.elem |= command.radio.elem
+
+## State or option that can be toggled: <command type='checkbox'>
+
+	command.checkbox.elem =
+		element command { command.inner & command.checkbox.attrs }
+	command.checkbox.attrs =
+		(	common.attrs
+			&	(	command.checkbox.attrs.type
+				&	command.checkbox.attrs.checked?
+				)
+			&	common-command.attrs
+			)
+		command.checkbox.attrs.type =
+			attribute type {
+				w:string "checkbox"
+			}
+		command.checkbox.attrs.checked =
+			attribute checked {
+				w:string "checked" | w:string ""
+			}
+	command.elem |= command.checkbox.elem
+
+	common-command.attrs =
+		(	command.attrs.label?
+		&	command.attrs.icon?
+		&	command.attrs.disabled?
+		)
+		command.attrs.label =
+			attribute label {
+				string
+			}
+		command.attrs.icon =
+			attribute icon {
+				common.data.uri
+			}
+		command.attrs.disabled =
+			attribute disabled {
+				w:string "disabled" | w:string ""
+			}
+	command.inner =
+		( empty )
+	
+	common.elem.metadata |=
+		( command.elem & nonHTMLizable )
+	common.elem.phrasing |= command.elem
+
+## Menu: <menu>
+
+	menu.elem =
+		element menu { menu.inner & menu.attrs }
+	menu.attrs =
+		(	common.attrs
+		&	menu.attrs.type?
+		&	menu.attrs.label?
+		)
+		menu.attrs.type =
+			attribute type {
+				w:string "toolbar" | w:string "context"
+			}
+		menu.attrs.label =
+			attribute label {
+				string
+			}
+	menu.inner =
+		(	mli.elem*
+		|	common.inner.flow
+		)
+	
+	common.elem.flow |= menu.elem
+	# REVISIT allow nested menus
+
+## Menu Item: <li>
+
+	mli.elem =
+		element li { mli.inner & mli.attrs }
+	mli.attrs =
+		( common.attrs )
+	mli.inner =
+		( common.inner.flow )
+	
+## Canvas for Dynamic Graphics: <canvas>
+
+	canvas.elem.flow =
+		element canvas { canvas.inner.flow & canvas.attrs }
+	canvas.elem.phrasing =
+		element canvas { canvas.inner.phrasing & canvas.attrs }
+	canvas.attrs =
+		(	common.attrs
+		&	canvas.attrs.height?
+		&	canvas.attrs.width?
+		&	common.attrs.aria?
+		)
+		canvas.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		canvas.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+	canvas.inner.flow =
+		( common.inner.flow )
+	canvas.inner.phrasing =
+		( common.inner.phrasing )
+	
+	common.elem.flow |= canvas.elem.flow
+	common.elem.phrasing |= canvas.elem.phrasing
+
+## Additional On-Demand Information: <details>
+
+	details.elem =
+		element details { details.inner & details.attrs }
+	details.attrs =
+		(	common.attrs
+		&	details.attrs.open?
+		&	common.attrs.aria.implicit.region?
+		)
+		details.attrs.open =
+			attribute open {
+				w:string "open" | w:string ""
+			}
+	details.inner =
+		(	summary.elem?
+		,	common.inner.flow 
+		)
+	
+	common.elem.flow |= details.elem
+
+## Caption/summary for details element: <summary>
+
+	summary.elem =
+		element summary { summary.inner & summary.attrs }
+	summary.attrs =
+		( common.attrs )
+	summary.inner =
+		( common.inner.phrasing )
diff --git a/xml/relaxng/testData/highlighting/html5/aria.rnc b/xml/relaxng/testData/highlighting/html5/aria.rnc
new file mode 100644
index 0000000..9721d36e
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/aria.rnc
@@ -0,0 +1,1017 @@
+# #####################################################################
+##	RELAX NG Schema for HTML 5: Accessible Rich Internet Applications #
+# #####################################################################
+
+# #####################################################################
+## ARIA
+
+## Global states and properties
+
+aria.global = 
+	(	aria.prop.atomic?
+	&	aria.state.busy?
+	&	aria.prop.controls?
+	&	aria.prop.describedby?
+	&	aria.state.disabled?
+	&	aria.state.dropeffect?
+	&	aria.prop.flowto?
+	&	aria.state.grabbed?
+	&	aria.prop.haspopup?
+	&	aria.state.hidden?
+	&	aria.state.invalid?
+	&	aria.prop.label?
+	&	aria.prop.labelledby?
+	&	aria.prop.live?
+	&	aria.prop.owns?
+	&	aria.prop.relevant?
+	&	aria.prop.required?
+	)
+
+common.attrs.other &= aria.global?
+
+## States and Properties for Native Roles
+
+# common.attrs.aria.implicit.button |=
+#	(	aria.prop.controls?
+#	)
+
+# common.attrs.aria.implicit.input |=
+#	(	aria.prop.controls?
+#	&	aria.state.invalid?
+#	&	aria.prop.required?
+#	)
+
+common.attrs.aria.implicit.region |=
+	(	aria.state.expanded?
+#	&	aria.prop.level?
+	)
+
+common.attrs.aria.implicit.group |=
+	(	aria.state.expanded?
+	&	aria.prop.activedescendant?
+	)
+
+common.attrs.aria.implicit.th |=
+	(	aria.prop.sort?
+	&	aria.prop.level?
+	&	aria.state.expanded?
+	&	aria.prop.readonly?
+	&	aria.state.selected?
+	)
+
+# common.attrs.aria.implicit.structure |=
+#	(	aria.prop.atomic?
+#	&	aria.state.busy?
+#	&	aria.prop.channel?
+#	&	aria.prop.live?
+#	&	aria.prop.relevant?
+#	)
+
+# common.attrs.aria.implicit.link |=
+#		(	aria.prop.controls?
+#	&	aria.state.disabled?
+#	)
+
+common.attrs.aria.implicit.listitem |=
+		(	aria.prop.posinset?
+	&	aria.prop.setsize?
+#	&	aria.prop.atomic?
+	)
+
+# common.attrs.aria.implicit.img |=
+#		(	aria.prop.atomic?
+#	&	aria.state.busy?
+#	&	aria.prop.channel?
+#	&	aria.prop.controls?
+#	&	aria.prop.live?
+#	&	aria.prop.relevant?
+#	)
+
+#common.attrs.aria.implicit.select |=
+#		(	aria.state.invalid?
+#	&	aria.prop.required?
+#	&	aria.prop.atomic?
+#	&	aria.state.busy?
+#	&	aria.prop.channel?
+#	&	aria.prop.controls?
+#	&	aria.prop.live?
+#	&	aria.prop.relevant?
+#	)
+
+# #####################################################################
+## States
+
+## busy
+	aria.state.busy =
+		attribute aria-busy 
+			{	string "true"
+			|	string "false" #default
+			}
+
+## checked
+	aria.state.checked =
+		attribute aria-checked 
+			{	string "true"
+			|	string "false"
+			|	string "mixed"
+			|	string "undefined" #default
+			}
+
+## disabled
+	aria.state.disabled =
+		attribute aria-disabled 
+			{	string "true"
+			|	string "false" #default
+			}
+
+## dropeffect
+	aria.state.dropeffect =
+		attribute aria-dropeffect
+			{	token "none" #default
+			| token "popup"
+			| token "execute"
+			|	list 
+				{	( string "copy" )
+				,	( string "execute" )?
+				}
+			|	list 
+				{	( string "move" )
+				,	( string "execute" )?
+				}
+			|	list 
+				{	( string "reference" )
+				,	( string "execute" )?
+				}
+			|	list 
+				{	( string "execute" )
+				,	( string "copy" )
+				}
+			|	list 
+				{	( string "execute" )
+				,	( string "move" )
+				}
+			|	list 
+				{	( string "execute" )
+				,	( string "reference" )
+				}
+			}
+
+## expanded
+	aria.state.expanded =
+		attribute aria-expanded 
+			{	string "true"
+			|	string "false"
+			|	string "undefined" #default
+			}
+
+## grabbed
+	aria.state.grabbed =
+		attribute aria-grabbed 
+			{	string "true"
+			|	string "false"
+			|	string "undefined" #default
+			}
+
+## hidden
+	aria.state.hidden =
+		attribute aria-hidden 
+			{	string "true"
+			|	string "false" #default
+			}
+
+## invalid
+	aria.state.invalid =
+		attribute aria-invalid 
+			{	string "true"
+			|	string "false" #default
+			|	string "grammar"
+			|	string "spelling"
+			}
+
+## pressed
+	aria.state.pressed =
+		attribute aria-pressed 
+			{	string "true"
+			|	string "false"
+			|	string "mixed"
+			|	string "undefined" #default
+			}
+
+## selected
+	aria.state.selected =
+		attribute aria-selected 
+			{	string "true"
+			|	string "false"
+			|	string "undefined" #default
+			}
+
+
+
+# #####################################################################
+## Properties
+
+## activedescendant
+	aria.prop.activedescendant =
+		attribute aria-activedescendant {
+			common.data.idref #REVISIT add Schematron check
+		}
+
+## atomic
+	aria.prop.atomic =
+		attribute aria-atomic
+			{	string "true"
+			|	string "false" #default
+			}	
+
+## autocomplete
+	aria.prop.autocomplete =
+		attribute aria-autocomplete
+			{	string "inline"
+			|	string "list"
+			|	string "both"
+			|	string "none" #default
+			}
+
+## controls
+	aria.prop.controls =
+		attribute aria-controls {
+			common.data.idrefs #REVISIT add Schematron check
+		}
+
+## describedby
+	aria.prop.describedby =
+		attribute aria-describedby {
+			common.data.idrefs #REVISIT add Schematron check
+		}
+
+## flowto
+	aria.prop.flowto =
+		attribute aria-flowto {
+			common.data.idrefs #REVISIT add Schematron check
+		}
+
+## haspopup
+	aria.prop.haspopup =
+		attribute aria-haspopup
+			{	string "true" #REVISIT check owns or descendant
+			|	string "false" #default
+			}	
+
+## label
+	aria.prop.label =
+		attribute aria-label {
+			string
+		}
+
+## labelledby
+	aria.prop.labelledby =
+		attribute aria-labelledby {
+			common.data.idrefs #REVISIT add Schematron check
+		}
+
+## level
+	aria.prop.level =
+		attribute aria-level {
+			common.data.integer.positive
+		}
+
+## live
+	aria.prop.live =
+		attribute aria-live
+			{	string "off" #default
+			|	string "polite"
+			|	string "assertive"
+			}	
+
+## multiline
+	aria.prop.multiline =
+		attribute aria-multiline
+			{	string "true"
+			|	string "false" #default
+			}	
+
+## multiselectable
+	aria.prop.multiselectable =
+		attribute aria-multiselectable
+			{	string "true"
+			|	string "false" #default
+			}	
+
+## owns
+	aria.prop.owns =
+		attribute aria-owns {
+			common.data.idrefs #REVISIT add Schematron check
+		}
+
+## posinset
+	aria.prop.posinset =
+		attribute aria-posinset {
+			common.data.integer.positive
+		}
+
+## readonly
+	aria.prop.readonly =
+		attribute aria-readonly
+			{	string "true"
+			|	string "false" #default
+			}	
+
+## relevant
+	aria.prop.relevant =
+		attribute aria-relevant
+			{	token "all"
+			|	list 
+				{	( string "additions" )
+				,	( string "removals" )?
+				,	( string "text" )?
+				}
+			|	list 
+				{	( string "additions" )
+				,	( string "text" )?
+				,	( string "removals" )?
+				}
+			|	list 
+				{	( string "removals" )
+				,	( string "additions" )?
+				,	( string "text" )?
+				}
+			|	list 
+				{	( string "removals" )
+				,	( string "text" )?
+				,	( string "additions" )?
+				}
+			|	list 
+				{	( string "text" )
+				,	( string "additions" )?
+				,	( string "removals" )?
+				}
+			|	list 
+				{	( string "text" )
+				,	( string "removals" )?
+				,	( string "additions" )?
+				}
+			}	
+
+## required
+	aria.prop.required =
+		attribute aria-required
+			{	string "true"
+			|	string "false" #default
+			}	
+
+## setsize
+	aria.prop.setsize =
+		attribute aria-setsize {
+			common.data.integer.non-negative
+		}
+
+## sort
+	aria.prop.sort =
+		attribute aria-sort
+			{	string "ascending"
+			|	string "descending"
+			|	string "none" #default
+			|	string "other"
+			}	
+
+## valuemax
+	aria.prop.valuemax =
+		attribute aria-valuemax {
+			common.data.float #REVISIT
+		}
+
+## valuemin
+	aria.prop.valuemin =
+		attribute aria-valuemin {
+			common.data.float #REVISIT
+		}
+
+## valuenow
+	aria.prop.valuenow =
+		attribute aria-valuenow {
+			common.data.float #REVISIT
+		}
+
+## valuetext
+	aria.prop.valuetext =
+		attribute aria-valuetext {
+			string
+		}
+
+# #####################################################################
+## Roles
+
+## alert
+	aria.alert =
+		(	aria.role.alert
+		&	aria.state.expanded? 
+		)
+		aria.role.alert = 
+			attribute role { string "alert" }
+	
+	common.attrs.aria |= aria.alert
+
+## alertdialog
+	aria.alertdialog =
+		(	aria.role.alertdialog
+		&	aria.state.expanded?
+		)
+		aria.role.alertdialog = 
+			attribute role { string "alertdialog" }
+	
+	common.attrs.aria |= aria.alertdialog
+
+## application
+	aria.application =
+		(	aria.role.application
+		&	aria.state.expanded?
+		)
+		aria.role.application = 
+			attribute role { string "application" }
+
+	common.attrs.aria |= aria.application
+	common.attrs.aria.landmark.application |= aria.application
+
+## article
+	aria.article =
+		(	aria.role.article
+		&	aria.state.expanded?
+		)
+		aria.role.article = 
+			attribute role { string "article" }
+
+	common.attrs.aria |= aria.article
+	common.attrs.aria.landmark.article |= aria.article
+
+## banner
+	aria.banner =
+		(	aria.role.banner
+		&	aria.state.expanded?
+		)
+		aria.role.banner = 
+			attribute role { string "banner" }
+	
+	common.attrs.aria |= aria.banner
+	common.attrs.aria.landmark.banner |= aria.banner
+	
+## button
+	aria.button =
+		(	aria.role.button
+		&	aria.state.pressed? # not inherited
+		)
+		aria.role.button = 
+			attribute role { string "button" }
+	
+	common.attrs.aria |= aria.button
+
+## checkbox
+	aria.checkbox =
+		(	aria.role.checkbox
+		&	aria.state.checked #required!
+		)
+		aria.role.checkbox = 
+			attribute role { string "checkbox" }
+	
+	common.attrs.aria |= aria.checkbox
+
+# XXX columnheader
+
+## combobox
+	aria.combobox =
+		(	aria.role.combobox
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded #required!
+		)
+		aria.role.combobox = 
+			attribute role { string "combobox" }
+	
+	common.attrs.aria |= aria.combobox
+
+## complementary
+	aria.complementary =
+		(	aria.role.complementary
+		&	aria.state.expanded?
+		)
+		aria.role.complementary = 
+			attribute role { string "complementary" }
+
+	common.attrs.aria |= aria.complementary
+	common.attrs.aria.landmark.complementary |= aria.complementary
+
+## contentinfo
+	aria.contentinfo =
+		(	aria.role.contentinfo
+		&	aria.state.expanded?
+		)
+		aria.role.contentinfo = 
+			attribute role { string "contentinfo" }
+
+	common.attrs.aria |= aria.contentinfo
+	common.attrs.aria.landmark.contentinfo |= aria.contentinfo
+
+## definition
+	aria.definition =
+		(	aria.role.definition
+		&	aria.state.expanded?
+		)
+		aria.role.definition = 
+			attribute role { string "definition" }
+
+	common.attrs.aria |= aria.definition
+
+## dialog
+	aria.dialog =
+		(	aria.role.dialog
+		&	aria.state.expanded?
+		)
+		aria.role.dialog = 
+			attribute role { string "dialog" }
+
+	common.attrs.aria |= aria.dialog
+
+## directory
+	aria.directory =
+		(	aria.role.directory
+		&	aria.state.expanded?
+		)
+		aria.role.directory = 
+			attribute role { string "directory" }
+
+	common.attrs.aria |= aria.directory
+
+## document
+	aria.document =
+		(	aria.role.document
+		&	aria.state.expanded?
+		)
+		aria.role.document = 
+			attribute role { string "document" }
+
+	common.attrs.aria |= aria.document
+	common.attrs.aria.landmark.document |= aria.document
+
+## grid
+	aria.grid =
+		(	aria.role.grid
+		&	aria.prop.level? # not inherited
+		&	aria.prop.multiselectable? # not inherited
+		&	aria.prop.readonly? # not inherited
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.grid = 
+			attribute role { string "grid" }
+	
+	common.attrs.aria |= aria.grid
+	
+## gridcell
+	aria.gridcell =
+		(	aria.role.gridcell
+		&	aria.prop.level? # net inherited
+		&	aria.prop.readonly? # not inherited
+		&	aria.state.selected? # not inherited
+		&	aria.state.expanded?
+		)
+		aria.role.gridcell = 
+			attribute role { string "gridcell" }
+	
+	common.attrs.aria |= aria.gridcell
+
+## group
+	aria.group =
+		(	aria.role.group
+		&	aria.prop.activedescendant? # not inherited
+		&	aria.state.expanded? # not inherited
+		)
+		aria.role.group = 
+			attribute role { string "group" }
+	
+	common.attrs.aria |= aria.group
+
+## XXX heading
+
+## img
+	aria.img =
+		(	aria.role.img
+		&	aria.state.expanded?
+		)
+		aria.role.img = 
+			attribute role { string "img" }
+	
+	common.attrs.aria |= aria.img
+
+## link
+	aria.link =
+		(	aria.role.link
+		)
+		aria.role.link = 
+			attribute role { string "link" }
+	
+	common.attrs.aria |= aria.link
+
+## list
+	aria.list =
+		(	aria.role.list
+		&	aria.state.expanded?
+		)
+		aria.role.list = 
+			attribute role { string "list" }
+	
+	common.attrs.aria |= aria.list
+
+## listbox
+	aria.listbox =
+		(	aria.role.listbox
+		&	aria.prop.multiselectable? # not inherited
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.listbox = 
+			attribute role { string "listbox" }
+	
+	common.attrs.aria |= aria.listbox
+
+## listitem
+	aria.listitem =
+		(	aria.role.listitem
+		&	aria.prop.posinset? # not inherited
+		&	aria.prop.setsize? # not inherited
+		&	aria.prop.level? # not inherited
+		&	aria.state.expanded?
+		)
+		aria.role.listitem = 
+			attribute role { string "listitem" }
+	
+	common.attrs.aria |= aria.listitem
+
+## log
+	aria.log =
+		(	aria.role.log
+		&	aria.state.expanded?
+		)
+		aria.role.log = 
+			attribute role { string "log" }
+	
+	common.attrs.aria |= aria.log
+
+## main
+	aria.main =
+		(	aria.role.main
+		&	aria.state.expanded?
+		)
+		aria.role.main = 
+			attribute role { string "main" }
+	
+	common.attrs.aria |= aria.main
+	common.attrs.aria.landmark.main |= aria.main
+
+## marquee
+	aria.marquee =
+		(	aria.role.marquee
+		&	aria.state.expanded?
+		)
+		aria.role.marquee = 
+			attribute role { string "marquee" }
+	
+	common.attrs.aria |= aria.marquee
+
+## math
+	aria.math =
+		(	aria.role.math
+		&	aria.state.expanded?
+		)
+		aria.role.math = 
+			attribute role { string "math" }
+	
+	common.attrs.aria |= aria.math
+
+## menu
+	aria.menu =
+		(	aria.role.menu
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.menu = 
+			attribute role { string "menu" }
+	
+	common.attrs.aria |= aria.menu
+
+## menubar
+	aria.menubar =
+		(	aria.role.menubar
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.menubar = 
+			attribute role { string "menubar" }
+	
+	common.attrs.aria |= aria.menubar
+
+## menuitem
+	aria.menuitem =
+		(	aria.role.menuitem )
+		aria.role.menuitem = 
+			attribute role { string "menuitem" }
+	
+	common.attrs.aria |= aria.menuitem
+
+## menuitemcheckbox
+	aria.menuitemcheckbox =
+		(	aria.role.menuitemcheckbox
+		&	aria.state.checked #required
+		)
+		aria.role.menuitemcheckbox = 
+			attribute role { string "menuitemcheckbox" }
+	
+	common.attrs.aria |= aria.menuitemcheckbox
+
+## menuitemradio
+	aria.menuitemradio =
+		(	aria.role.menuitemradio
+		&	aria.state.checked #required
+		&	aria.state.selected?
+		)
+		aria.role.menuitemradio = 
+			attribute role { string "menuitemradio" }
+	
+	common.attrs.aria |= aria.menuitemradio
+
+## navigation
+	aria.navigation =
+		(	aria.role.navigation
+		&	aria.state.expanded?
+		)
+		aria.role.navigation = 
+			attribute role { string "navigation" }
+	
+	common.attrs.aria |= aria.navigation
+	common.attrs.aria.landmark.navigation |= aria.navigation
+
+## note
+	aria.note =
+		(	aria.role.note
+		&	aria.state.expanded?
+		)
+		aria.role.note = 
+			attribute role { string "note" }
+	
+	common.attrs.aria |= aria.note
+	common.attrs.aria.landmark.note |= aria.note
+
+## option
+	aria.option =
+		(	aria.role.option
+		&	aria.state.checked? # not inherited
+		&	aria.state.selected? # not inherited
+		)
+		aria.role.option = 
+			attribute role { string "option" }
+	
+	common.attrs.aria |= aria.option
+
+
+## presentation
+	aria.presentation =
+		(	aria.role.presentation
+		&	aria.state.expanded?
+		)
+		aria.role.presentation = 
+			attribute role { string "presentation" }
+	
+	common.attrs.aria |= aria.presentation
+
+## progressbar
+	aria.progressbar =
+		(	aria.role.progressbar
+		&	aria.prop.valuemax? # not inherited
+		&	aria.prop.valuemin? # not inherited
+		&	aria.prop.valuenow? # not inherited
+		&	aria.prop.valuetext? # not inherited
+		)
+		aria.role.progressbar = 
+			attribute role { string "progressbar" }
+	
+	common.attrs.aria |= aria.progressbar
+
+## radio
+	aria.radio =
+		(	aria.role.radio
+		&	aria.state.checked #required!
+		&	aria.state.selected?
+		)
+		aria.role.radio = 
+			attribute role { string "radio" }
+	
+	common.attrs.aria |= aria.radio
+
+## radiogroup
+	aria.radiogroup =
+		(	aria.role.radiogroup
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.radiogroup = 
+			attribute role { string "radiogroup" }
+	
+	common.attrs.aria |= aria.radiogroup
+
+## region
+	aria.region =
+		(	aria.role.region
+		&	aria.state.expanded?
+		)
+		aria.role.region = 
+			attribute role { string "region" }
+	
+	common.attrs.aria |= aria.region
+
+## row
+	aria.row =
+		(	aria.role.row
+		&	aria.prop.level? # not inherited
+		&	aria.state.selected? # not inherited
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.row = 
+			attribute role { string "row" }
+	
+	common.attrs.aria |= aria.row
+
+# XXX rowheader
+
+## search
+	aria.search =
+		(	aria.role.search
+		&	aria.state.expanded?
+		)
+		aria.role.search = 
+			attribute role { string "search" }
+	
+	common.attrs.aria |= aria.search
+	common.attrs.aria.landmark.search |= aria.search
+
+## separator
+	aria.separator =
+		(	aria.role.separator
+		&	aria.state.expanded?
+		)
+		aria.role.separator = 
+			attribute role { string "separator" }
+	
+	common.attrs.aria |= aria.separator
+
+## slider
+	aria.slider =
+		(	aria.role.slider
+		&	aria.prop.valuemax
+		&	aria.prop.valuemin
+		&	aria.prop.valuenow
+		&	aria.prop.valuetext
+		)
+		aria.role.slider = 
+			attribute role { string "slider" }
+	
+	common.attrs.aria |= aria.slider
+
+## spinbutton
+	aria.spinbutton =
+		(	aria.role.spinbutton
+		&	aria.prop.activedescendant?
+		&	aria.prop.valuemax
+		&	aria.prop.valuemin
+		&	aria.prop.valuenow
+		&	aria.prop.valuetext
+		)
+		aria.role.spinbutton = 
+			attribute role { string "spinbutton" }
+	
+	common.attrs.aria |= aria.spinbutton
+
+## status
+	aria.status =
+		(	aria.role.status
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.status = 
+			attribute role { string "status" }
+	
+	common.attrs.aria |= aria.status
+
+## tab
+	aria.tab =
+		(	aria.role.tab
+		&	aria.state.selected?
+		&	aria.state.expanded?
+		)
+		aria.role.tab = 
+			attribute role { string "tab" }
+	
+	common.attrs.aria |= aria.tab
+
+## tablist
+	aria.tablist =
+		(	aria.role.tablist
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.tablist = 
+			attribute role { string "tablist" }
+
+## tabpanel
+	aria.tabpanel =
+		(	aria.role.tabpanel
+		&	aria.state.expanded?
+		)
+		aria.role.tabpanel = 
+			attribute role { string "tabpanel" }
+	
+	common.attrs.aria |= aria.tabpanel
+
+## textbox
+	aria.textbox =
+		(	aria.role.textbox
+		&	aria.prop.autocomplete? # not inherited
+		&	aria.prop.multiline? # not inherited
+		&	aria.prop.readonly? # not inherited
+		)
+		aria.role.textbox = 
+			attribute role { string "textbox" }
+	
+	common.attrs.aria |= aria.textbox
+
+## timer
+	aria.timer =
+		(	aria.role.timer
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.timer = 
+			attribute role { string "timer" }
+	
+	common.attrs.aria |= aria.timer
+
+## toolbar
+	aria.toolbar =
+		(	aria.role.toolbar
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.toolbar = 
+			attribute role { string "toolbar" }
+	
+	common.attrs.aria |= aria.toolbar
+
+## tooltip
+	aria.tooltip =
+		(	aria.role.tooltip
+		&	aria.state.expanded?
+		)
+		aria.role.tooltip = 
+			attribute role { string "tooltip" }
+	
+	common.attrs.aria |= aria.tooltip
+
+## tree
+	aria.tree =
+		(	aria.role.tree
+		&	aria.prop.multiselectable? # not inherited
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		)
+		aria.role.tree = 
+			attribute role { string "tree" }
+	
+	common.attrs.aria |= aria.tree
+
+## treegrid
+	aria.treegrid =
+		(	aria.role.treegrid
+		&	aria.prop.activedescendant?
+		&	aria.state.expanded?
+		&	aria.prop.level?
+		&	aria.prop.multiselectable?
+		&	aria.prop.readonly?
+		)
+		aria.role.treegrid = 
+			attribute role { string "treegrid" }
+	
+	common.attrs.aria |= aria.treegrid
+
+## treeitem
+	aria.treeitem =
+		(	aria.role.treeitem
+		&	aria.state.checked?
+		&	aria.state.expanded?
+		&	aria.prop.level?
+		&	aria.prop.posinset?
+		&	aria.state.selected?
+		&	aria.prop.setsize?
+		)
+		aria.role.treeitem = 
+			attribute role { string "treeitem" }
+	
+	common.attrs.aria |= aria.treeitem
+
+
diff --git a/xml/relaxng/testData/highlighting/html5/block.rnc b/xml/relaxng/testData/highlighting/html5/block.rnc
new file mode 100644
index 0000000..8bfb86a
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/block.rnc
@@ -0,0 +1,196 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Basic Prose Markup                    #
+# #####################################################################
+
+# #####################################################################
+## Paragraph-Level
+
+## Paragraph: <p>
+
+	p.elem =
+		element p { p.inner & p.attrs }
+	p.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	p.inner =
+		( common.inner.phrasing ) # REVISIT lists in span?
+
+	common.elem.flow |= p.elem
+
+## Hint Transition: <hr>
+
+	hr.elem =
+		element hr { hr.inner & hr.attrs }
+	hr.attrs =
+		( common.attrs )
+	hr.inner =
+		( empty )
+
+	common.elem.flow |= hr.elem
+
+# #####################################################################
+## Preformatting Blocks
+
+## Preformatted Text: <pre>
+
+	pre.elem =
+		element pre { pre.inner & pre.attrs }
+	pre.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	pre.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= pre.elem
+
+# #####################################################################
+## Simple Lists
+
+## Unordered List: <ul>
+
+	ul.elem =
+		element ul { ul.inner & ul.attrs }
+	ul.attrs =
+		(	common.attrs
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.region
+			)?
+		)
+	ul.inner =
+		( li.elem* )
+
+	common.elem.flow |= ul.elem
+
+## Unordered List Item: <li>
+
+	li.elem =
+		element li { li.inner & li.attrs }
+	li.attrs =
+		(	common.attrs 
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.listitem
+			)?
+		)
+	li.inner =
+		( common.inner.flow )
+
+## Ordered List: <ol>
+
+	ol.elem =
+		element ol { ol.inner & ol.attrs }
+	ol.attrs =
+		(	common.attrs
+		&	ol.attrs.start?
+		&	ol.attrs.reversed?
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.region
+			)?
+		)
+		ol.attrs.start =
+			attribute start {
+				common.data.integer
+			}
+		ol.attrs.reversed =
+			attribute reversed {
+				w:string "reversed" | w:string ""
+			}
+	ol.inner =
+		( oli.elem* )
+
+	common.elem.flow |= ol.elem
+
+## Ordered List Item: <li>
+
+	oli.elem =
+		element li { oli.inner & oli.attrs }
+	oli.attrs =
+		(	common.attrs
+		&	oli.attrs.value?
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.listitem
+			)?
+		)
+		oli.attrs.value =
+			attribute value {
+				common.data.integer
+			}
+	oli.inner =
+		( common.inner.flow )
+
+# #####################################################################
+## Definition Lists
+
+## Definition List: <dl>
+
+	dl.elem =
+		element dl { dl.inner & dl.attrs }
+	dl.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	dl.inner =
+		(	(	dt.elem+
+			,	dd.elem+
+			)*
+		)
+
+	common.elem.flow |= dl.elem
+
+## Definition Term: <dt>
+
+	dt.elem =
+		element dt { dt.inner & dt.attrs }
+	dt.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	dt.inner =
+		( common.inner.phrasing )
+
+## Definition Description: <dd>
+
+	dd.elem =
+		element dd { dd.inner & dd.attrs }
+	dd.elem.phrasing =
+		element dd { dd.inner.phrasing & dd.attrs }
+	dd.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	dd.inner =
+		( common.inner.flow )
+	dd.inner.phrasing =
+		( common.inner.phrasing )
+
+# #####################################################################
+## Miscellaneous Elements
+
+## Generic Container: <div>
+
+	div.elem =
+		element div { div.inner & div.attrs }
+	div.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	div.inner =
+		(	style.elem.scoped*
+		,	common.inner.flow 
+		)
+
+	common.elem.flow |= div.elem
+
+## Title or Explanatory Caption: <legend>
+
+	legend.elem =
+		element legend { legend.inner & legend.attrs }
+	legend.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.region?
+		)	
+	legend.inner =
+		( common.inner.phrasing )
diff --git a/xml/relaxng/testData/highlighting/html5/common.rnc b/xml/relaxng/testData/highlighting/html5/common.rnc
new file mode 100644
index 0000000..dada4b6
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/common.rnc
@@ -0,0 +1,393 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Common Definitions                    #
+# #####################################################################
+
+
+# #####################################################################
+##  Language Parameters - redefine in inclusion block as necessary    #
+# #####################################################################
+
+## HTML vs. XHTML restrictions
+
+	XMLonly = empty
+	HTMLonly = notAllowed
+
+## HTML 4 Compatibility - set to notAllowed to disallow markup introduced in HTML 5
+#                         (This only affects mixed-version modules; wholly HTML5
+#                          modules should simply be left out of the inclusion list.)
+
+	v5only = empty
+
+## HTML Compatibility Switches - set to notAllowed to disallow
+
+	## XML features that can't be roundtripped HTML <-> XHTML
+	#  (xml:base on elements other than <html>)
+	nonRoundtrippable = empty
+
+	## XML features that can't be serialized as HTML
+	nonHTMLizable = empty
+
+# #####################################################################
+##  Wildcards                                                         #
+# #####################################################################
+
+## Any attribute from any namespace
+
+	common.attr.anything =
+		attribute * { text }*
+
+## Any element from any namespace
+
+	common.elem.anything =
+		element * { common.inner.anything & common.attr.anything }
+
+## Any content from any namespace
+
+	common.inner.anything =
+		(	text
+		&	common.elem.anything*
+		)
+
+# #####################################################################
+##  Common Element Classes                                            #
+# #####################################################################
+
+## Metadata Elements
+
+	common.elem.metadata =
+		( notAllowed )
+
+## Phrase Elements
+
+	common.elem.phrasing =
+		( notAllowed )
+
+## Prose Elements
+
+	common.elem.flow =
+		( common.elem.phrasing )
+
+
+# #####################################################################
+##  Common Content Models                                             #
+# #####################################################################
+
+## Metadata Content
+
+	common.inner.metadata =
+		( common.elem.metadata* )
+
+## Phrase Content
+
+	common.inner.phrasing =
+		( text & common.elem.phrasing* )
+
+## Prose Content
+
+	common.inner.flow =
+		( text & common.elem.flow* ) # REVISIT <style scoped>
+
+# #####################################################################
+##  Common Attributes                                                 #
+# #####################################################################
+
+# When updating, check <bdo> definition too
+
+common.attrs =
+	(	common.attrs.basic
+	&	common.attrs.i18n
+	&	common.attrs.present
+	&	common.attrs.other
+	)
+
+common.attrs.basic =
+	(	(	common.attrs.id
+		|	common.attrs.xml-id
+		)? # REVISIT assuming only either one is allowed
+	&	common.attrs.class?
+	&	common.attrs.title?
+	&	common.attrs.base?
+	&	common.attrs.space?
+	)
+	common.attrs.id =
+		attribute id {
+			common.data.id
+		}
+	common.attrs.xml-id =
+		attribute xml:id {
+			xsd:NCName
+		} & XMLonly
+	common.attrs.class =
+		attribute class {
+			common.data.tokens
+		}
+	common.attrs.title =
+		attribute title {
+			text
+		}
+	common.attrs.base =
+		common.attrs.xmlbase
+		& nonRoundtrippable
+	common.attrs.xmlbase =
+		attribute xml:base {
+			common.data.uri
+		} & XMLonly
+	common.attrs.space =
+		common.attrs.xmlspace
+	common.attrs.xmlspace =
+		attribute xml:space {
+			string "preserve" # REVISIT this is not allowed per spec
+		} & XMLonly
+
+common.attrs.i18n =
+	(	common.attrs.dir?
+	&	common.attrs.language?
+	)
+	common.attrs.dir =
+		attribute dir {
+			w:string "ltr" | w:string "rtl"
+		}
+	# This lang definition is a hack for enviroments where
+	# the HTML5 parser maps lang to xml:lang.
+	# Sameness check left to Schematron
+	common.attrs.language =
+		(	common.attrs.xmllang?
+		&	common.attrs.lang?
+		)
+	common.attrs.lang =
+		attribute lang {
+			common.data.langcode
+		} & XMLonly
+	common.attrs.xmllang =
+		attribute xml:lang {
+			common.data.langcode
+		}
+#	common.attrs.language =
+#		(	common.attrs.lang
+#		|	common.attrs.xmllang
+#		)
+#	common.attrs.lang =
+#		attribute lang {
+#			common.data.langcode
+#		} & HTMLonly
+#	common.attrs.xmllang =
+#		attribute xml:lang {
+#			common.data.langcode
+#		} & XMLonly
+
+common.attrs.present =
+	(	common.attrs.style?
+	&	common.attrs.tabindex?
+	&	common.attrs.accesskey?
+	)
+	common.attrs.style =
+		attribute style {
+			string
+		}
+	common.attrs.tabindex =
+		attribute tabindex {
+			common.data.integer
+		}
+		# REVISIT move style to a module and bundle tabindex with ARIA
+	common.attrs.accesskey =
+		attribute accesskey {
+			common.data.keylabellist
+		}
+
+common.attrs.other =
+	empty
+
+# #####################################################################
+##  Common Datatypes                                                  #
+# #####################################################################
+
+## Names and Tokens
+
+	common.data.tokens =
+		list { token* }
+
+	common.data.browsing-context =
+		w:browsing-context
+
+	common.data.browsing-context-or-keyword =
+		w:browsing-context-or-keyword
+#		xsd:string {
+#			pattern = "()|([^_].*)|(_[bB][lL][aA][nN][kK])|(_[sS][eE][lL][fF])|(_[pP][aA][rR][eE][nN][tT])|(_[tT][oO][pP])"
+#		}
+
+
+## IDs and IDREFs
+
+	common.data.id =
+		w:ID
+#		xsd:string {
+#			pattern = "\S+"
+#		}
+
+	common.data.idref =
+		w:IDREF
+		
+	common.data.idrefs =
+		w:IDREFS
+
+	common.data.name =
+		w:ID #FIXME
+
+	common.data.hash-name =
+		w:hash-name	
+#		xsd:string {
+#			pattern = "#.+"
+#		}
+
+## Numerical
+
+	common.data.integer =
+		w:integer
+#		xsd:string {
+#			pattern = "-?[0-9]+"
+#		}
+
+	common.data.integer.positive =
+		w:integer-positive
+#		xsd:string {
+#			pattern = "0*[1-9][0-9]*"
+#		}
+
+	common.data.integer.non-negative =
+		w:integer-non-negative
+#		xsd:string {
+#			pattern = "[0-9]+"
+#		}
+		
+#	common.data.percent =
+#		xsd:string {
+#			pattern = "(100)|([1-9]?[0-9](\.[0-9]+)?)%"
+#		}
+		
+	common.data.float =
+		w:float
+#		xsd:string {
+#			pattern = "-?[0-9]+(\.[0-9]+)?([eE]-?[0-9]+)?"
+#		}
+
+	common.data.float.positive =
+		w:float-positive
+#		xsd:string {
+#			pattern = "(0*[1-9][0-9]*(\.[0-9]+)?)|([0-9]+(\.0*[1-9][0-9]*)?)([eE]-?[0-9]+)?"
+#		}
+		
+	common.data.float.non-negative =
+		w:float-non-negative
+#		xsd:string {
+#			pattern = "[0-9]+(\.[0-9]+)?([eE]-?[0-9]+)?"
+#		}
+		
+## Temporal
+
+	common.data.datetime =
+		w:datetime-tz
+
+	common.data.date-or-time =
+		w:date-or-time
+
+## IRIs
+
+	common.data.uri =
+		w:string "" | w:iri-ref
+
+	common.data.uris =
+		list { w:iri-ref* }
+
+	common.data.uri.absolute =
+		w:iri
+
+## <link type='icon'> sizes
+
+	common.data.sizes =
+#		list { w:sizes }
+		list {
+			xsd:string {
+				pattern = "[1-9][0-9]*x[1-9][0-9]*"
+			}+
+		}
+
+## MIME types
+
+	common.data.mimetype =
+		w:mime-type
+
+## Encodings
+
+	common.data.charset =
+		w:charset
+
+	common.data.meta-charset =
+		w:meta-charset
+
+## Refresh
+
+	common.data.refresh =
+		w:refresh
+
+## Default style
+
+	common.data.default-style =
+        string
+#		w:default-style
+
+## Media Queries
+
+	common.data.mediaquery =
+		w:media-query
+
+## Language Codes
+
+	common.data.langcode =
+		w:string "" | w:language
+
+## List of Key Labels
+	common.data.keylabellist =
+		w:keylabellist
+
+## Microdata Identifier
+  common.data.microdata-identifier =
+    w:microdata-identifier
+
+## Zero
+  common.data.zero =
+    w:zero
+
+# #####################################################################
+##  WF2 Module Hook                                                   #
+# #####################################################################
+		
+common-form.attrs.form = ( notAllowed )
+
+# #####################################################################
+##  ARIA Module Hooks                                                 #
+# #####################################################################
+
+common.attrs.aria = ( notAllowed )
+common.attrs.aria.implicit.button = ( notAllowed )
+common.attrs.aria.implicit.input = ( notAllowed )
+common.attrs.aria.implicit.region = ( notAllowed )
+common.attrs.aria.implicit.group = ( notAllowed )
+common.attrs.aria.implicit.th = ( notAllowed )
+common.attrs.aria.implicit.structure = ( notAllowed )
+common.attrs.aria.implicit.link = ( notAllowed )
+common.attrs.aria.implicit.listitem = ( notAllowed )
+common.attrs.aria.implicit.img = ( notAllowed )
+common.attrs.aria.implicit.select = ( notAllowed )
+common.attrs.aria.landmark.application = ( notAllowed )
+common.attrs.aria.landmark.banner = ( notAllowed )
+common.attrs.aria.landmark.complementary = ( notAllowed )
+common.attrs.aria.landmark.contentinfo = ( notAllowed )
+common.attrs.aria.landmark.main = ( notAllowed )
+common.attrs.aria.landmark.navigation = ( notAllowed )
+common.attrs.aria.landmark.search = ( notAllowed )
+# per ARIA spec: article, document, and note are not actually landmarks
+common.attrs.aria.landmark.article = ( notAllowed )
+common.attrs.aria.landmark.document = ( notAllowed )
+common.attrs.aria.landmark.note = ( notAllowed )
diff --git a/xml/relaxng/testData/highlighting/html5/core-scripting.rnc b/xml/relaxng/testData/highlighting/html5/core-scripting.rnc
new file mode 100644
index 0000000..1b1f9c2
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/core-scripting.rnc
@@ -0,0 +1,331 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Core Scripting                        #
+# #####################################################################
+
+# #####################################################################
+## Scripting Elements
+
+## Inline Scripts: <script>
+
+	script.elem.embedded =
+		element script { script.inner.embedded & script.attrs.embedded }
+	script.attrs.embedded =
+		(	common.attrs
+		&	script.attrs.type?
+		&	script.attrs.language? # restricted in Schematron
+		)
+	script.elem.imported =
+		element script { script.inner.imported & script.attrs.imported }
+	script.attrs.imported =
+		(	common.attrs
+		&	script.attrs.src
+		&	script.attrs.defer?
+		&	script.attrs.async?
+		&	script.attrs.type?
+		&	script.attrs.charset?
+		&	script.attrs.language? # restricted in Schematron
+		)
+		script.attrs.src =
+			attribute src {
+				common.data.uri
+			}
+		script.attrs.defer =
+			attribute defer {
+				w:string "defer" | w:string ""
+			}
+		script.attrs.async =
+			attribute async {
+				w:string "async" | w:string ""
+			} & v5only
+		script.attrs.type =
+			attribute type {
+				common.data.mimetype # XXX without charset parameter!
+			}
+		script.attrs.charset =
+			attribute charset {
+				common.data.charset
+			}
+		script.attrs.language =
+			attribute language {
+				string
+			}
+	script.inner.embedded =
+		( common.inner.anything )
+	script.inner.imported =
+		( common.inner.anything )
+		
+	script.elem = 
+		(	script.elem.embedded
+		|	script.elem.imported
+		)
+		
+	common.elem.metadata |= script.elem
+	common.elem.phrasing |= script.elem
+
+## Fallback Unscripted Content: <noscript>
+
+	noscript.elem.head =
+		element noscript { noscript.inner.head & noscript.attrs }
+		& HTMLonly
+		noscript.inner.head = 
+			(	link.elem
+			|	meta.http-equiv.default-style.elem
+			|	meta.http-equiv.refresh.elem
+			|	style.elem
+			)*
+	noscript.elem.phrasing =
+		element noscript { noscript.inner.phrasing & noscript.attrs }
+		& HTMLonly
+	noscript.inner.phrasing =
+		( common.inner.phrasing )
+	noscript.elem.flow =
+		element noscript { noscript.inner.flow & noscript.attrs }
+		& HTMLonly
+	noscript.inner.flow =
+		( common.inner.flow )
+	noscript.attrs =
+		( common.attrs )
+
+	common.elem.metadata |= noscript.elem.head
+	common.elem.phrasing |= noscript.elem.phrasing
+	common.elem.flow |= noscript.elem.flow
+
+# #####################################################################
+## Event Handler Attribute Definitions
+
+	common.attrs.scripting &=
+		(	scripting.attr.onabort?
+		&	scripting.attr.onblur?
+		&	scripting.attr.oncanplay?
+		&	scripting.attr.oncanplaythrough?
+		&	scripting.attr.onchange?
+		&	scripting.attr.onclick?
+		&	scripting.attr.oncontextmenu?
+		&	scripting.attr.ondblclick?
+		&	scripting.attr.ondrag?
+		&	scripting.attr.ondragend?
+		&	scripting.attr.ondragenter?
+		&	scripting.attr.ondragleave?
+		&	scripting.attr.ondragover?
+		&	scripting.attr.ondragstart?
+		&	scripting.attr.ondrop?
+		&	scripting.attr.ondurationchange?
+		&	scripting.attr.onemptied?
+		&	scripting.attr.onended?
+		&	scripting.attr.onerror?
+		&	scripting.attr.onfocus?
+		&	scripting.attr.onformchange?
+		&	scripting.attr.onforminput?
+		&	scripting.attr.oninput?
+		&	scripting.attr.oninvalid?
+		&	scripting.attr.onkeydown?
+		&	scripting.attr.onkeypress?
+		&	scripting.attr.onkeyup?
+		&	scripting.attr.onload?
+		&	scripting.attr.onloadeddata?
+		&	scripting.attr.onloadedmetadata?
+		&	scripting.attr.onloadstart?
+		&	scripting.attr.onmousedown?
+		&	scripting.attr.onmousemove?
+		&	scripting.attr.onmouseout?
+		&	scripting.attr.onmouseover?
+		&	scripting.attr.onmouseup?
+		&	scripting.attr.onmousewheel?
+		&	scripting.attr.onpause?
+		&	scripting.attr.onplay?
+		&	scripting.attr.onplaying?
+		&	scripting.attr.onprogress?
+		&	scripting.attr.onratechange?
+		&	scripting.attr.onreadystatechange?
+		&	scripting.attr.onscroll?
+		&	scripting.attr.onseeked?
+		&	scripting.attr.onseeking?
+		&	scripting.attr.onselect?
+		&	scripting.attr.onshow?
+		&	scripting.attr.onstalled?
+		&	scripting.attr.onsubmit?
+		&	scripting.attr.onsuspend?
+		&	scripting.attr.ontimeupdate?
+		&	scripting.attr.onvolumechange?
+		&	scripting.attr.onwaiting?
+		)
+		
+	common.attrs.other &= common.attrs.scripting
+
+	scripting.attr.onabort =
+		attribute onabort { string }
+	scripting.attr.onblur =
+		attribute onblur { string }
+	scripting.attr.oncanplay =
+		attribute oncanplay { string }
+	scripting.attr.oncanplaythrough =
+		attribute oncanplaythrough { string }
+	scripting.attr.onchange =
+		attribute onchange { string }
+	scripting.attr.onclick =
+		attribute onclick { string }
+	scripting.attr.oncontextmenu =
+		attribute oncontextmenu { string }
+	scripting.attr.ondblclick =
+		attribute ondblclick { string }
+	scripting.attr.ondrag =
+		attribute ondrag { string }
+	scripting.attr.ondragend =
+		attribute ondragend { string }
+	scripting.attr.ondragenter =
+		attribute ondragenter { string }
+	scripting.attr.ondragleave =
+		attribute ondragleave { string }
+	scripting.attr.ondragover =
+		attribute ondragover { string }
+	scripting.attr.ondragstart =
+		attribute ondragstart { string }
+	scripting.attr.ondrop =
+		attribute ondrop { string }
+	scripting.attr.ondurationchange =
+		attribute ondurationchange { string }
+	scripting.attr.onemptied =
+		attribute onemptied { string }
+	scripting.attr.onended =
+		attribute onended { string }
+	scripting.attr.onerror =
+		attribute onerror { string }
+	scripting.attr.onfocus =
+		attribute onfocus { string }
+	scripting.attr.onformchange =
+		attribute onformchange { string }
+	scripting.attr.onforminput =
+		attribute onforminput { string }
+	scripting.attr.oninput =
+		attribute oninput { string }
+	scripting.attr.oninvalid =
+		attribute oninvalid { string }
+	scripting.attr.onkeydown =
+		attribute onkeydown { string }
+	scripting.attr.onkeypress =
+		attribute onkeypress { string }
+	scripting.attr.onkeyup =
+		attribute onkeyup { string }
+	scripting.attr.onload =
+		attribute onload { string }
+	scripting.attr.onloadeddata =
+		attribute onloadeddata { string }
+	scripting.attr.onloadedmetadata =
+		attribute onloadedmetadata { string }
+	scripting.attr.onloadstart =
+		attribute onloadstart { string }
+	scripting.attr.onmousedown =
+		attribute onmousedown { string }
+	scripting.attr.onmousemove =
+		attribute onmousemove { string }
+	scripting.attr.onmouseout =
+		attribute onmouseout { string }
+	scripting.attr.onmouseover =
+		attribute onmouseover { string }
+	scripting.attr.onmouseup =
+		attribute onmouseup { string }
+	scripting.attr.onmousewheel =
+		attribute onmousewheel { string }
+	scripting.attr.onpause =
+		attribute onpause { string }
+	scripting.attr.onplay =
+		attribute onplay { string }
+	scripting.attr.onplaying =
+		attribute onplaying { string }
+	scripting.attr.onprogress =
+		attribute onprogress { string }
+	scripting.attr.onratechange =
+		attribute onratechange { string }
+	scripting.attr.onreadystatechange =
+		attribute onreadystatechange { string }
+	scripting.attr.onscroll =
+		attribute onscroll { string }
+	scripting.attr.onseeked =
+		attribute onseeked { string }
+	scripting.attr.onseeking =
+		attribute onseeking { string }
+	scripting.attr.onselect =
+		attribute onselect { string }
+	scripting.attr.onshow =
+		attribute onshow { string }
+	scripting.attr.onstalled =
+		attribute onstalled { string }
+	scripting.attr.onsubmit =
+		attribute onsubmit { string }
+	scripting.attr.onsuspend =
+		attribute onsuspend { string }
+	scripting.attr.ontimeupdate =
+		attribute ontimeupdate { string }
+	scripting.attr.onvolumechange =
+		attribute onvolumechange { string }
+	scripting.attr.onwaiting =
+		attribute onwaiting { string }
+
+#	scripting.attr.common =
+#		(	scripting.attr.mouse
+#		&	scripting.attr.keyboard
+#		&	scripting.attr.focus
+#		)
+#	
+#	scripting.attr.mouse =
+#		(	scripting.attr.mouse.click?
+#		&	scripting.attr.mouse.dblclick?
+#		&	scripting.attr.mouse.down?
+#		&	scripting.attr.mouse.up?
+#		&	scripting.attr.mouse.over?
+#		&	scripting.attr.mouse.move?
+#		&	scripting.attr.mouse.out?
+#		)
+#		scripting.attr.mouse.click =
+#			attribute onclick { string }
+#		scripting.attr.mouse.dblclick =
+#			attribute ondblclick { string }
+#		scripting.attr.mouse.down =
+#			attribute onmousedown { string }
+#		scripting.attr.mouse.up =
+#			attribute onmouseup { string }
+#		scripting.attr.mouse.over =
+#			attribute onmouseover { string }
+#		scripting.attr.mouse.move =
+#			attribute onmousemove { string }
+#		scripting.attr.mouse.out =
+#			attribute onmouseout { string }
+#	
+#	scripting.attr.keyboard =
+#		(	scripting.attr.keyboard.press?
+#		&	scripting.attr.keyboard.down?
+#		&	scripting.attr.keyboard.up?
+#		)
+#		scripting.attr.keyboard.press =
+#			attribute onkeypress { string }
+#		scripting.attr.keyboard.down =
+#			attribute onkeydown { string }
+#		scripting.attr.keyboard.up =
+#			attribute onkeyup { string }
+#	
+#	
+#	scripting.attr.focus =
+#		(	scripting.attr.focus.gain?
+#		&	scripting.attr.focus.lose?
+#		)
+#		scripting.attr.focus.gain =
+#			attribute onfocus { string }
+#		scripting.attr.focus.lose =
+#			attribute onblur { string }
+#	
+#	scripting.attr.loading =
+#		(	scripting.attr.loading.load?
+#		&	scripting.attr.loading.unload?
+#		)
+#		scripting.attr.loading.load =
+#			attribute onload { string }
+#		scripting.attr.loading.unload =
+#			attribute onunload { string }
+
+
+# #####################################################################
+# Event Handler Attribute Assignments
+
+#	body.attrs   &= scripting.attr.loading
diff --git a/xml/relaxng/testData/highlighting/html5/data.rnc b/xml/relaxng/testData/highlighting/html5/data.rnc
new file mode 100644
index 0000000..477f66b
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/data.rnc
@@ -0,0 +1,69 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Static Data Markup                    #
+# #####################################################################
+
+## Time: <time>
+
+	time.elem =
+		element time { time.inner & time.attrs }
+	time.attrs =
+		(	common.attrs
+		&	time.attrs.datetime?
+		&	time.attrs.pubdate?
+		)
+		time.attrs.datetime =
+			attribute datetime {
+				common.data.date-or-time #REVISIT check format
+			}
+		time.attrs.pubdate =
+			attribute pubdate {
+				w:string "pubdate" | w:string ""
+			}
+	time.inner =
+		( common.inner.phrasing ) #Cannot enforce textContent format here
+
+	common.elem.phrasing |= time.elem
+
+## Scalar Gauge: <meter>
+
+	meter.elem =
+		element meter { meter.inner & meter.attrs }
+	meter.attrs =
+		(	common.attrs
+		&	meter.attrs.value
+		&	meter.attrs.min?
+		&	meter.attrs.low?
+		&	meter.attrs.high?
+		&	meter.attrs.max?
+		&	meter.attrs.optimum?
+		)
+		meter.attrs.value =
+			attribute value {
+				common.data.float
+			}
+		meter.attrs.min =
+			attribute min {
+				common.data.float
+			}
+		meter.attrs.low =
+			attribute low {
+				common.data.float
+			}
+		meter.attrs.high =
+			attribute high {
+				common.data.float
+			}
+		meter.attrs.max =
+			attribute max {
+				common.data.float
+			}
+		meter.attrs.optimum =
+			attribute optimum {
+				common.data.float
+			}
+	meter.inner =
+		( common.inner.phrasing ) #Cannot enforce textContent format here
+
+	common.elem.phrasing |= meter.elem
diff --git a/xml/relaxng/testData/highlighting/html5/embed.rnc b/xml/relaxng/testData/highlighting/html5/embed.rnc
new file mode 100644
index 0000000..29f7015
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/embed.rnc
@@ -0,0 +1,565 @@
+datatypes w = "http://whattf.org/datatype-draft"
+namespace local = ""
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Embedded Content                      #
+# #####################################################################
+
+#######################################################################
+## Replaced Content
+
+## Images: <img>
+
+	img.elem =
+		element img { img.inner & img.attrs }
+	img.attrs =
+		(	common.attrs
+		&	img.attrs.src
+		&	img.attrs.alt?
+		&	img.attrs.height?
+		&	img.attrs.width?
+		&	img.attrs.usemap?
+		&	img.attrs.ismap?
+		& img.attrs.border? # obsolete
+		&	common.attrs.aria?
+		)
+		img.attrs.src =
+			attribute src {
+				common.data.uri
+			}
+		img.attrs.alt =
+			attribute alt {
+				text
+			}
+		img.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		img.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+		img.attrs.usemap =
+			attribute usemap {
+				common.data.hash-name
+			}
+		img.attrs.ismap =
+			attribute ismap {
+				w:string "ismap" | w:string ""
+			}
+		img.attrs.border =
+			attribute border {
+				common.data.zero
+			}
+	img.inner =
+		empty
+
+	common.elem.phrasing |= img.elem
+
+## Plug-ins: <embed>
+
+	embed.elem =
+		element embed { embed.inner & embed.attrs }
+	embed.attrs =
+		(	common.attrs
+		&	embed.attrs.src?
+		&	embed.attrs.type?
+		&	embed.attrs.height?
+		&	embed.attrs.width?
+		&	embed.attrs.other*
+		)
+		embed.attrs.src =
+			attribute src {
+				common.data.uri
+			}
+		embed.attrs.type =
+			attribute type {
+				common.data.mimetype
+			}
+		embed.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		embed.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+		embed.attrs.other = # REVISIT common.attrs
+			attribute local:* - ( src 
+			                    | type 
+			                    | height 
+			                    | width 
+			                    | id 
+			                    | class
+			                    | title 
+			                    | dir 
+			                    | lang 
+			                    | style 
+			                    | tabindex 
+			                    | contextmenu 
+			                    | contenteditable 
+			                    | draggable 
+			                    | hidden
+			                    | onabort
+			                    | onblur
+			                    | oncanplay
+			                    | oncanplaythrough
+			                    | onchange
+			                    | onclick
+			                    | oncontextmenu
+			                    | ondblclick
+			                    | ondrag
+			                    | ondragend
+			                    | ondragenter
+			                    | ondragleave
+			                    | ondragover
+			                    | ondragstart
+			                    | ondrop
+			                    | ondurationchange
+			                    | onemptied
+			                    | onended
+			                    | onerror
+			                    | onfocus
+			                    | onformchange
+			                    | onforminput
+			                    | oninput
+			                    | oninvalid
+			                    | onkeydown
+			                    | onkeypress
+			                    | onkeyup
+			                    | onload
+			                    | onloadeddata
+			                    | onloadedmetadata
+			                    | onloadstart
+			                    | onmousedown
+			                    | onmousemove
+			                    | onmouseout
+			                    | onmouseover
+			                    | onmouseup
+			                    | onmousewheel
+			                    | onpause
+			                    | onplay
+			                    | onplaying
+			                    | onprogress
+			                    | onratechange
+			                    | onreadystatechange
+			                    | onscroll
+			                    | onseeked
+			                    | onseeking
+			                    | onselect
+			                    | onshow
+			                    | onstalled
+			                    | onsubmit
+			                    | onsuspend
+			                    | ontimeupdate
+			                    | onvolumechange
+			                    | onwaiting
+			                    | onafterprint
+			                    | onbeforeprint
+			                    | onbeforeunload
+			                    | onhashchange
+			                    | onmessage
+			                    | onoffline
+			                    | ononline
+			                    | onpopstate
+			                    | onredo
+			                    | onresize
+			                    | onstorage
+			                    | onundo
+			                    | onunload
+			                    | role
+			                    | aria-atomic
+			                    | aria-busy
+			                    | aria-controls
+			                    | aria-describedby
+			                    | aria-disabled
+			                    | aria-dropeffect
+			                    | aria-flowto
+			                    | aria-grabbed
+			                    | aria-haspopup
+			                    | aria-hidden
+			                    | aria-invalid
+			                    | aria-label
+			                    | aria-labelledby
+			                    | aria-live
+			                    | aria-owns
+			                    | aria-relevant
+			                    | aria-required	
+			                    | spellcheck
+			                    | accesskey
+			                    | itemref
+			                    | itemprop
+			                    | itemscope
+			                    | itemtype
+			                    | itemid
+			                    | name
+			                    | align
+			                    ) 
+			{
+				string
+			}
+	embed.inner =
+		empty
+
+	common.elem.phrasing |= embed.elem
+
+## Generic Objects: <object>
+
+	object.elem.flow =
+		element object { object.inner.flow & object.attrs }
+	object.elem.phrasing =
+		element object { object.inner.phrasing & object.attrs }
+	object.attrs =
+		(	common.attrs
+		&	(	(	object.attrs.data
+				&	object.attrs.type?
+				)
+			|	object.attrs.type
+			)
+#		&	object.attrs.classid?
+#		&	object.attrs.codebase?
+#		&	object.attrs.codetype?
+		&	object.attrs.height?
+		&	object.attrs.width?
+		&	object.attrs.usemap?
+		&	object.attrs.name?
+		&	common-form.attrs.form?
+		&	common.attrs.aria?
+		)
+		object.attrs.data =
+			attribute data {
+				common.data.uri
+			}
+		object.attrs.type =
+			attribute type {
+				common.data.mimetype
+			}
+		object.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		object.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+		object.attrs.usemap =
+			attribute usemap {
+				common.data.hash-name
+			}
+		object.attrs.name =
+			attribute name {
+				common.data.browsing-context
+			}
+	object.inner.flow =
+		(	param.elem*
+		,	common.inner.flow
+		)
+	object.inner.phrasing =
+		(	param.elem*
+		,	common.inner.phrasing
+		)
+
+	common.elem.flow |= object.elem.flow
+	common.elem.phrasing |= object.elem.phrasing
+
+## Initialization Parameters: <param>
+
+	param.elem =
+		element param { param.inner & param.attrs }
+	param.attrs =
+		(	common.attrs
+		&	param.attrs.name
+		&	param.attrs.value
+		)
+		param.attrs.name =
+			attribute name {
+				string
+			}
+		param.attrs.value =
+			attribute value {
+				string
+			}
+	param.inner =
+		( empty )
+
+## Inline Frame: <iframe>
+
+	iframe.elem =
+		element iframe { iframe.inner & iframe.attrs }
+	iframe.attrs =
+		(	common.attrs
+		&	iframe.attrs.src?
+		&	iframe.attrs.name?
+		&	iframe.attrs.width?
+		&	iframe.attrs.height?
+		&	iframe.attrs.sandbox?
+		&	iframe.attrs.seamless?
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.region
+			)?
+		)
+		iframe.attrs.src =
+			attribute src {
+				common.data.uri
+			}
+		iframe.attrs.name =
+			attribute name {
+				common.data.browsing-context
+			}
+		iframe.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		iframe.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+		iframe.attrs.seamless =
+			attribute seamless {
+				w:string "seamless" | w:string ""
+			} & v5only
+		iframe.attrs.sandbox =
+			attribute sandbox
+				{	list 
+					{	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-scripts" )?
+					}
+				|	list 
+					{	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-forms" )?
+					}
+				|	list 
+					{	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-scripts" )?
+					}
+				|	list 
+					{	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-same-origin" )?
+					}
+				|	list 
+					{	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-forms" )?
+					}
+				|	list 
+					{	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-same-origin" )?
+					}
+				|	list 
+					{	( w:string "allow-same-origin" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-scripts" )?
+					}
+				|	list 
+					{	( w:string "allow-same-origin" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-forms" )?
+					}
+				|	list 
+					{	( w:string "allow-forms" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-scripts" )?
+					}
+				|	list 
+					{	( w:string "allow-forms" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-same-origin" )?
+					}
+				|	list 
+					{	( w:string "allow-scripts" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-forms" )?
+					}
+				|	list 
+					{	( w:string "allow-scripts" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-same-origin" )?
+					}
+				|	list 
+					{	( w:string "allow-same-origin" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-scripts" )?
+					}
+				|	list 
+					{	( w:string "allow-same-origin" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-forms" )?
+					}
+				|	list 
+					{	( w:string "allow-forms" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-scripts" )?
+					}
+				|	list 
+					{	( w:string "allow-forms" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-same-origin" )?
+					}
+				|	list 
+					{	( w:string "allow-scripts" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-forms" )?
+					}
+				|	list 
+					{	( w:string "allow-scripts" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-top-navigation" )?
+					,	( w:string "allow-same-origin" )?
+					}
+				|	list 
+					{	( w:string "allow-same-origin" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-top-navigation" )?
+					}
+				|	list 
+					{	( w:string "allow-same-origin" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-top-navigation" )?
+					}
+				|	list 
+					{	( w:string "allow-forms" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-top-navigation" )?
+					}
+				|	list 
+					{	( w:string "allow-forms" )?
+					,	( w:string "allow-scripts" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-top-navigation" )?
+					}
+				|	list 
+					{	( w:string "allow-scripts" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-top-navigation" )?
+					}
+				|	list 
+					{	( w:string "allow-scripts" )?
+					,	( w:string "allow-forms" )?
+					,	( w:string "allow-same-origin" )?
+					,	( w:string "allow-top-navigation" )?
+					}
+				} & v5only
+	iframe.inner =
+		( text )
+
+	common.elem.phrasing |= iframe.elem
+
+#######################################################################
+## Image Maps
+
+## Map Definition: <map>
+
+	map.elem.flow =
+		element map { map.inner.flow & map.attrs }
+	map.elem.phrasing  =
+		element map { map.inner.phrasing & map.attrs }
+	map.attrs =
+		(	common.attrs
+		&	map.attrs.name
+		) # REVISIT make id required in Schematron
+		map.attrs.name =
+			attribute name {
+				common.data.name
+			}
+	map.inner.flow =
+		( common.inner.flow )
+	map.inner.phrasing =
+		( common.inner.phrasing )
+
+	common.elem.flow |= map.elem.flow
+	common.elem.phrasing |= map.elem.phrasing
+
+## Map Area Definition: <area>
+
+	area.elem =
+		element area { area.inner & area.attrs }
+	area.attrs =
+		(	common.attrs
+		&	(	area.attrs.alt
+			&	shared-hyperlink.attrs.href
+			)?
+		&	shared-hyperlink.attrs.target?
+		&	shared-hyperlink.attrs.ping?
+		&	shared-hyperlink.attrs.rel?
+		&	shared-hyperlink.attrs.media?
+		&	shared-hyperlink.attrs.hreflang?
+		&	shared-hyperlink.attrs.type?
+		&	area.attrs.shape?
+		)
+		area.attrs.alt =
+			attribute alt {
+				text
+			}
+		area.attrs.shape =
+			(	( area.attrs.shape.rect?  & area.attrs.coords.rect   )
+			|	( area.attrs.shape.circle & area.attrs.coords.circle )
+			|	( area.attrs.shape.poly   & area.attrs.coords.poly   )
+			|	( area.attrs.shape.default )
+			)
+		area.attrs.shape.rect =
+			attribute shape {
+				w:string "rect"
+			}
+		area.attrs.coords.rect =
+			attribute coords {
+				w:rectangle
+#				xsd:token {
+#					pattern = "-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+"
+#				}
+			}
+		area.attrs.shape.circle =
+			attribute shape {
+				w:string "circle"
+			}
+		area.attrs.coords.circle =
+			attribute coords {
+				w:circle
+#				xsd:token {
+#					pattern = "-?[0-9]+,-?[0-9]+,[0-9]+"
+#				}
+			}
+		area.attrs.shape.poly =
+			attribute shape {
+				w:string "poly"
+			}
+		area.attrs.coords.poly =
+			attribute coords {
+				w:polyline
+#				xsd:token {
+#					pattern = "-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+(,-?[0-9]+,-?[0-9]+)*"
+#				}
+			}
+		area.attrs.shape.default =
+			attribute shape {
+				w:string "default"
+			}
+	area.inner =
+		( empty )
+
+	common.elem.phrasing |= area.elem
diff --git a/xml/relaxng/testData/highlighting/html5/form-datatypes.rnc b/xml/relaxng/testData/highlighting/html5/form-datatypes.rnc
new file mode 100644
index 0000000..6debbce
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/form-datatypes.rnc
@@ -0,0 +1,52 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Datatypes related to forms            #
+# #####################################################################
+
+## MIME types
+		
+	form.data.mimetypelist = 
+		w:mime-type-list
+		
+	form.data.charsetlist =
+		string # FIXME should be a "a space- and/or comma-delimited 
+		       # list of charset values"
+
+## ECMAScript Regular Expression
+		
+	form.data.pattern = 
+		w:pattern
+		
+## Temporal
+		
+	form.data.datetime-local =
+		w:datetime-local
+	
+	form.data.date =
+		w:date
+	
+	form.data.month =
+		w:month
+	
+	form.data.week =
+		w:week
+	
+	form.data.time =
+		w:time
+
+## Email
+
+	form.data.emailaddress =
+		w:email-address
+
+	form.data.emailaddresslist =
+		w:email-address-list
+
+## Color
+
+	form.data.color =
+		w:color
+#		xsd:string {
+#			pattern = "#[a-fA-F0-9]{6}"
+#		}
diff --git a/xml/relaxng/testData/highlighting/html5/html5.rnc b/xml/relaxng/testData/highlighting/html5/html5.rnc
new file mode 100644
index 0000000..14c913a
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/html5.rnc
@@ -0,0 +1,56 @@
+default namespace = "http://www.w3.org/1999/xhtml/html5"
+# #####################################################################
+##  RELAX NG Schema for HTML 5                                       #
+# #####################################################################
+
+  # To validate an HTML 5 document, you must first validate against  #
+  # this schema and then ALSO validate against assertions.sch        #
+
+  ## HTML flavor RELAX NG schemas can only be used after the         #
+  ## document has been transformed to well-formed XML.               #
+  ##   - Insert closing slashes in all empty element tags            #
+  ##   - Insert all optional start and end tags                      #
+  ##   - Add xmlns "http://www.w3.org/1999/xhtml"                    #
+  ##   - Properly escape <script> and <style> CDATA                  #
+  ##   - Parse and transform all HTML-only entities to numeric       #
+  ##     character references                                        #
+  ## Obviously, syntax-checking involving these features cannot be   #
+  ## done by the RELAX NG schema and must be checked, along with the #
+  ## <!DOCTYPE> requirement, by some other application.              #
+
+# #####################################################################
+## Schema Framework & Parameters
+
+include "common.rnc" {
+	# XHTML flavor #
+		XMLonly = notAllowed
+		HTMLonly = empty
+	# HTML 4 compat #
+		v5only = empty
+	# HTML-serializability #
+		nonHTMLizable = notAllowed
+	# HTML-roundtrippability #
+		nonRoundtrippable = notAllowed
+}
+
+# #####################################################################
+## Language Definitions
+
+start = html.elem
+
+include "meta.rnc"
+include "phrase.rnc"
+include "block.rnc"
+include "sectional.rnc"
+include "structural.rnc"
+include "revision.rnc"
+include "embed.rnc"
+include "ruby.rnc"
+include "media.rnc"
+include "core-scripting.rnc"
+include "tables.rnc"
+include "form-datatypes.rnc"
+include "web-forms.rnc"
+include "web-forms2.rnc"
+include "applications.rnc"
+include "data.rnc"
diff --git a/xml/relaxng/testData/highlighting/html5/html5exclusions.rnc b/xml/relaxng/testData/highlighting/html5/html5exclusions.rnc
new file mode 100644
index 0000000..1fa0915
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/html5exclusions.rnc
@@ -0,0 +1,63 @@
+default namespace = "http://www.w3.org/1999/xhtml"
+# #####################################################################
+##  RELAX NG Schema for (X)HTML 5: Exclusions                         #
+# #####################################################################
+
+  ## This file is unmaintained. Please use assertions.sch instead.
+  
+# #####################################################################
+## Schema Framework & Parameters
+
+	start = normal.elem.all-inclusive
+
+# #####################################################################
+##  Normal Element Patterns
+
+## Any attribute from any namespace
+
+	normal.attr.anything =
+		attribute * { text }*
+
+## Any element from any namespace except exceptional elements,
+## but allowing those elements as descendants
+
+	normal.elem.all =
+		element * - (dfn) {
+			normal.elem.all-inclusive
+		}
+
+## Any element from any namespace including exceptional elements
+
+	normal.elem.all-inclusive =
+		wildcard.elem.exclude-all | dfn.elem.exclude-self
+
+
+# #####################################################################
+##  Exclusion Element Patterns
+
+  # exclude all exceptional elements from the name classes;
+  # list them explicitly in content models instead
+
+normal.elem.exclude-dfn =
+	element * - (dfn) {
+		normal.elem.exclude-dfn
+	}
+
+dfn.elem.exclude-self =
+	element dfn {
+		(	normal.attr.anything
+		&	normal.elem.exclude-dfn
+		)
+	}
+
+# FIXME this part was cut off -- hsivonen
+wildcard.elem.exclude-all = 
+	notAllowed
+
+#FIXME no nested forms in HTML-serializable docs
+
+#FIXME no nested labels
+
+#FIXME no blockquote inside header or footer
+
+#FIXME exactly one hn in header
diff --git a/xml/relaxng/testData/highlighting/html5/media.rnc b/xml/relaxng/testData/highlighting/html5/media.rnc
new file mode 100644
index 0000000..7f692a8
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/media.rnc
@@ -0,0 +1,151 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Advanced Embedded Content             #
+# #####################################################################
+
+## Attributes Common to Media Elements
+
+	# src not included
+	media.attrs = 
+		(	media.attrs.autoplay?
+		&	media.attrs.preload?
+		&	media.attrs.controls?
+		&	media.attrs.loop?
+		)
+		media.attrs.autoplay   =
+			attribute autoplay   {
+				w:string "autoplay" | w:string ""
+			}
+		media.attrs.preload   =
+			attribute preload   {
+				w:string "none" | w:string "metadata" | w:string "auto" | w:string ""
+			}
+		media.attrs.controls  =
+			attribute controls  {
+				w:string "controls" | w:string ""
+			}
+		media.attrs.loop =
+			attribute loop {
+				w:string "loop" | w:string ""
+			}
+		
+## Source: <source>
+
+	source.elem =
+		element source { source.inner & source.attrs }
+	source.attrs =
+		(	common.attrs
+		&	source.attrs.src
+		&	source.attrs.type?
+		&	source.attrs.media?
+		)
+		source.attrs.src =
+			attribute src {
+				common.data.uri
+			}
+		source.attrs.type =
+			attribute type {
+				common.data.mimetype
+			}
+		source.attrs.media =
+			attribute media {
+				common.data.mediaquery
+			}
+	source.inner =
+		( empty )
+
+## Media Source
+
+	media.source = 
+		(	media.attrs.src
+		|	source.elem*
+		)
+
+	media.attrs.src =
+		attribute src {
+			common.data.uri
+		}
+
+## Video: <video>
+
+	video.elem.flow =
+		element video { video.inner.flow & video.attrs }
+	video.elem.phrasing =
+		element video { video.inner.phrasing & video.attrs }
+	video.attrs =
+		(	common.attrs
+		&	media.attrs
+		&	video.attrs.poster?
+		&	video.attrs.height?
+		&	video.attrs.width?
+		)
+		video.attrs.poster =
+			attribute poster {
+				common.data.uri
+			}
+		video.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		video.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+	video.inner.flow =
+		(	media.source
+		,	common.inner.flow
+		)
+	video.inner.phrasing =
+		(	media.source
+		,	common.inner.phrasing
+		)
+
+	common.elem.flow |= video.elem.flow
+	common.elem.phrasing |= video.elem.phrasing
+
+## Audio: <audio>
+
+	audio.elem.flow =
+		element audio { audio.inner.flow & audio.attrs }
+	audio.elem.phrasing =
+		element audio { audio.inner.phrasing & audio.attrs }
+	audio.attrs =
+		(	common.attrs
+		&	media.attrs
+		)
+	audio.inner.flow =
+		(	media.source
+		,	common.inner.flow
+		)
+	audio.inner.phrasing =
+		(	media.source
+		,	common.inner.phrasing
+		)
+
+	common.elem.flow |= audio.elem.flow
+	common.elem.phrasing |= audio.elem.phrasing
+
+## Captioned Content: <figure>
+
+	figure.elem =
+		element figure { figure.inner & figure.attrs }
+	figure.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.img?
+		)
+	figure.inner =
+		(	( figcaption.elem, common.inner.flow )
+		|	( common.inner.flow, figcaption.elem? )
+		)
+
+	common.elem.flow |= figure.elem
+
+## Figure caption: <figcaption>
+
+	figcaption.elem =
+		element figcaption { figcaption.inner & figcaption.attrs }
+	figcaption.attrs =
+		( common.attrs )
+	figcaption.inner =
+		( common.inner.flow )
diff --git a/xml/relaxng/testData/highlighting/html5/meta.rnc b/xml/relaxng/testData/highlighting/html5/meta.rnc
new file mode 100644
index 0000000..ba0b886
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/meta.rnc
@@ -0,0 +1,331 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Global Structure & Metadata          #
+# #####################################################################
+
+## Root Element: <html>
+
+	html.elem =
+		element html { html.inner & html.attrs }
+	html.attrs =
+		( common.attrs )
+	html.inner =
+		(	head.elem
+		,	body.elem
+		)
+
+## Metadata Container: <head>
+
+	head.elem =
+		element head { head.inner & head.attrs }
+	head.attrs =
+		(	common.attrs
+#		&	head.attrs.profile?
+		)
+#		head.attrs.profile =
+#			attribute profile {
+#				common.data.uris #REVISIT should these be absolute (zero or more)
+#			}
+	head.inner =
+		(	title.elem
+		&	base.elem? # REVISIT need a non-schema checker or Schematron
+		&	common.inner.metadata # Limit encoding decl position in Schematron
+		)
+#	head.inner =
+#		(	meta.elem.encoding?
+#		,	(	title.elem
+#			&	base.elem? # REVISIT need a non-schema checker or Schematron
+#			&	common.inner.metadata
+#			)
+#		)
+		
+## Content Container: <body>
+
+	body.elem =
+		element body { body.inner & body.attrs }
+	body.attrs =
+		(	common.attrs
+		&	(	common.attrs.aria.landmark.application
+			|	common.attrs.aria.landmark.document
+			|	common.attrs.aria.implicit.structure
+			)?
+		&	body.attrs.onafterprint?
+		&	body.attrs.onbeforeprint?
+		&	body.attrs.onbeforeunload?
+		&	body.attrs.onhashchange?
+		&	body.attrs.onmessage?
+		&	body.attrs.onoffline?
+		&	body.attrs.ononline?
+		&	body.attrs.onpopstate?
+		&	body.attrs.onredo?
+		&	body.attrs.onresize?
+		&	body.attrs.onstorage?
+		&	body.attrs.onundo?
+		&	body.attrs.onunload?
+		)
+	body.inner =
+		( common.inner.flow )
+
+	body.attrs.onafterprint =
+		attribute onafterprint { string }
+	body.attrs.onbeforeprint =
+		attribute onbeforeprint { string }
+	body.attrs.onbeforeunload =
+		attribute onbeforeunload { string }
+	body.attrs.onhashchange =
+		attribute onhashchange { string }
+	body.attrs.onmessage =
+		attribute onmessage { string }
+	body.attrs.onoffline =
+		attribute onoffline { string }
+	body.attrs.ononline =
+		attribute ononline { string }
+	body.attrs.onpopstate =
+		attribute onpopstate { string }
+	body.attrs.onredo =
+		attribute onredo { string }
+	body.attrs.onresize =
+		attribute onresize { string }
+	body.attrs.onstorage =
+		attribute onstorage { string }
+	body.attrs.onundo =
+		attribute onundo { string }
+	body.attrs.onunload =
+		attribute onunload { string }
+
+## Document Title: <title>
+
+	title.elem =
+		element title { title.inner & title.attrs }
+	title.attrs =
+		( common.attrs )
+	title.inner =
+		( text )
+
+## Base URI: <base>
+
+	base.elem =
+		element base { base.inner & base.attrs }
+	base.attrs =
+		(	common.attrs
+		&	(	(	base.attrs.href
+				&	base.attrs.target?
+				)
+			|	base.attrs.target
+			)
+		)
+	base.attrs.href =
+		attribute href {
+			common.data.uri
+		}
+	base.attrs.target =
+		attribute target {
+			common.data.browsing-context-or-keyword
+		}
+	base.inner =
+		( empty )
+
+## Global Relationships: <link>
+
+	link.elem =
+		element link { link.inner & link.attrs }
+	link.attrs =
+		(	common.attrs
+		&	shared-hyperlink.attrs.href
+		&	shared-hyperlink.attrs.rel
+		&	shared-hyperlink.attrs.hreflang?
+		&	shared-hyperlink.attrs.media?
+		&	shared-hyperlink.attrs.type?
+		&	link.attrs.sizes?
+		#	link.attrs.title included in common.attrs
+		)
+		link.attrs.sizes =
+			attribute sizes {
+				w:string "any" | common.data.sizes
+			}
+	link.inner =
+		( empty )
+		
+	common.elem.metadata |= link.elem
+
+## Global Style: <style>
+
+	style.elem =
+		element style { style.inner & style.attrs }
+	style.attrs =
+		(	common.attrs
+		&	style.attrs.type?
+		&	style.attrs.media?
+		#	style.attrs.title included in common.attrs
+		)
+		style.attrs.type =
+			attribute type {
+				common.data.mimetype
+			}
+		style.attrs.media =
+			attribute media {
+				common.data.mediaquery
+			}
+	style.inner =
+		( common.inner.anything )
+		
+	common.elem.metadata |= style.elem
+
+## Scoped Style: <style scoped>
+
+	style.elem.scoped =
+		element style { style.inner & style.scoped.attrs }
+	style.scoped.attrs =
+		(	common.attrs
+		&	style.attrs.type?
+		&	style.attrs.media?
+		&	style.attrs.scoped
+		#	style.attrs.title included in common.attrs
+		)
+		style.attrs.scoped =
+			attribute scoped {
+				w:string "scoped" | w:string ""
+			}
+
+## Name-Value Metadata: <meta name>
+
+	meta.name.elem =
+		element meta { meta.inner & meta.name.attrs }
+	meta.name.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	meta.name.attrs.name
+		&	meta.name.attrs.content
+		)
+		meta.name.attrs.name =
+			attribute name {
+				string
+			}
+		meta.name.attrs.content =
+			attribute content {
+				string
+			}
+	meta.inner =
+		( empty )
+		
+	common.elem.metadata |= meta.name.elem
+
+## "refresh" pragma directive: <meta http-equiv='refresh'>
+
+	meta.http-equiv.refresh.elem =
+		element meta { meta.inner & meta.http-equiv.refresh.attrs }
+	meta.http-equiv.refresh.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	meta.http-equiv.attrs.http-equiv.refresh
+		&	meta.http-equiv.attrs.content.refresh
+		)
+		meta.http-equiv.attrs.http-equiv.refresh =
+			attribute http-equiv {
+				w:string "refresh"
+			}
+		meta.http-equiv.attrs.content.refresh =
+			attribute content { 
+				common.data.refresh
+			}
+	common.elem.metadata |= meta.http-equiv.refresh.elem # not quite right per spec
+                                                       # if the definition is 
+                                                       # reused in another language
+
+## "default-style" pragma directive: <meta http-equiv='default-style'>
+
+	meta.http-equiv.default-style.elem =
+		element meta { meta.inner & meta.http-equiv.default-style.attrs }
+	meta.http-equiv.default-style.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	meta.http-equiv.attrs.http-equiv.default-style
+		&	meta.http-equiv.attrs.content.default-style
+		)
+		meta.http-equiv.attrs.http-equiv.default-style =
+			attribute http-equiv {
+				w:string "default-style"
+			}
+		meta.http-equiv.attrs.content.default-style =
+			attribute content {
+				common.data.default-style
+			}
+		
+	common.elem.metadata |= meta.http-equiv.default-style.elem # not quite right per spec
+                                                               # if the definition is 
+                                                               # reused in another language
+
+## "content-language" pragma directive: <meta http-equiv='content-language'> (obsolete)
+
+	meta.http-equiv.content-language.elem =
+		element meta { meta.inner & meta.http-equiv.content-language.attrs }
+	meta.http-equiv.content-language.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	meta.http-equiv.attrs.http-equiv.content-language
+		&	meta.http-equiv.attrs.content.content-language
+		)
+		meta.http-equiv.attrs.http-equiv.content-language =
+			attribute http-equiv {
+				w:string "content-language"
+			}
+		meta.http-equiv.attrs.content.content-language =
+			attribute content {
+				common.data.langcode
+			}
+		
+	common.elem.metadata |= meta.http-equiv.content-language.elem # not quite right per spec
+                                                               # if the definition is 
+                                                               # reused in another language
+
+## Inline Character Encoding Statement for HTML: <meta charset>
+
+	meta.charset.elem =
+		element meta { meta.inner & meta.charset.attrs }
+	meta.charset.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	meta.charset.attrs.charset
+		)
+		meta.charset.attrs.charset =
+			attribute charset {
+				(common.data.charset & HTMLonly)
+				| (xsd:string {
+					pattern = "[uU][tT][fF]-8"
+				} & XMLonly )
+			} 
+
+## Inline Character Encoding Statement for HTML: <meta http-equiv='content-type'>
+
+	meta.http-equiv.content-type.elem =
+		element meta { meta.inner & meta.http-equiv.content-type.attrs }
+		& HTMLonly
+	meta.http-equiv.content-type.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	meta.http-equiv.attrs.http-equiv.content-type
+		&	meta.http-equiv.attrs.content.content-type
+		)
+		meta.http-equiv.attrs.http-equiv.content-type =
+			attribute http-equiv {
+				w:string "content-type"
+			}
+		meta.http-equiv.attrs.content.content-type =
+			attribute content {
+				common.data.meta-charset
+			}
+
+	common.elem.metadata |= ( meta.charset.elem | meta.http-equiv.content-type.elem )
diff --git a/xml/relaxng/testData/highlighting/html5/microdata.rnc b/xml/relaxng/testData/highlighting/html5/microdata.rnc
new file mode 100644
index 0000000..72ab7ac4
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/microdata.rnc
@@ -0,0 +1,80 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Microdata                             #
+# #####################################################################
+
+common.attrs.microdata =
+	(	common.attrs.microdata.itemref?
+	&	common.attrs.microdata.itemprop?
+	&	common.attrs.microdata.itemscope?
+	&	common.attrs.microdata.itemtype?
+	&	common.attrs.microdata.itemid?
+	)
+	common.attrs.microdata.itemref =
+		attribute itemref {
+			common.data.idrefs
+		}
+	common.attrs.microdata.itemprop =
+		attribute itemprop {
+			common.data.microdata-identifier
+		}
+	common.attrs.microdata.itemscope =
+		attribute itemscope {
+			w:string "itemscope" | w:string ""
+		}
+	common.attrs.microdata.itemtype =
+		attribute itemtype {
+			common.data.uri
+		}
+	common.attrs.microdata.itemid =
+		attribute itemid {
+			common.data.uri
+		}
+
+common.attrs &= common.attrs.microdata
+
+	link.elem.phrasing =
+		element link { link.inner & link.phrasing.attrs }
+	link.phrasing.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	common.attrs.microdata.itemprop
+		&	common.attrs.microdata.itemref?
+		&	common.attrs.microdata.itemscope?
+		&	common.attrs.microdata.itemtype?
+		&	common.attrs.microdata.itemid?
+		&	shared-hyperlink.attrs.href
+		&	shared-hyperlink.attrs.rel
+		&	shared-hyperlink.attrs.hreflang?
+		&	shared-hyperlink.attrs.media?
+		&	shared-hyperlink.attrs.type?
+		&	link.attrs.sizes?
+		#	link.attrs.title included in common.attrs
+		)
+	common.elem.phrasing |= link.elem.phrasing
+
+## Property Metadata: <meta itemprop>
+
+	meta.itemprop.elem =
+		element meta { meta.inner & meta.itemprop.attrs }
+	meta.itemprop.attrs =
+		(	common.attrs.basic
+		&	common.attrs.i18n
+		&	common.attrs.present
+		&	common.attrs.other
+		&	common.attrs.microdata.itemprop
+		&	common.attrs.microdata.itemref?
+		&	common.attrs.microdata.itemscope?
+		&	common.attrs.microdata.itemtype?
+		&	common.attrs.microdata.itemid?
+		&	meta.itemprop.attrs.content
+		)
+		meta.itemprop.attrs.content =
+			attribute content {
+				string
+			}
+	common.elem.metadata |= meta.itemprop.elem
+	common.elem.phrasing |= meta.itemprop.elem
diff --git a/xml/relaxng/testData/highlighting/html5/phrase.rnc b/xml/relaxng/testData/highlighting/html5/phrase.rnc
new file mode 100644
index 0000000..8925ccb
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/phrase.rnc
@@ -0,0 +1,324 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Phrase Markup                         #
+# #####################################################################
+
+## Contextual Hyperlink: <a>
+
+	a.elem.phrasing =
+		element a { a.inner.phrasing & a.attrs }
+	a.elem.flow =
+		element a { a.inner.flow & a.attrs }
+	a.attrs =
+		(	common.attrs
+		& a.attrs.name?
+		&	shared-hyperlink.attrs.href?
+		&	shared-hyperlink.attrs.target?
+		&	shared-hyperlink.attrs.rel?
+		&	shared-hyperlink.attrs.hreflang?
+		&	shared-hyperlink.attrs.media?
+		&	shared-hyperlink.attrs.type?
+		&	shared-hyperlink.attrs.ping?
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.link
+			)?
+		)
+		a.attrs.name =
+		  attribute name {
+		    common.data.id # XXX not what the spec says
+		  }
+	a.inner.phrasing =
+		( common.inner.phrasing )
+	a.inner.flow =
+		( common.inner.flow )
+
+	common.elem.phrasing |= a.elem.phrasing
+	common.elem.flow |= a.elem.flow
+
+## Shared hyperlink attributes
+
+  shared-hyperlink.attrs.href =
+    attribute href {
+      common.data.uri
+    }
+  shared-hyperlink.attrs.target =
+    attribute target {
+      common.data.browsing-context-or-keyword
+    }
+  shared-hyperlink.attrs.rel =
+    attribute rel {
+      common.data.tokens
+    }
+  shared-hyperlink.attrs.hreflang =
+    attribute hreflang {
+      common.data.langcode
+    }
+  shared-hyperlink.attrs.media =
+    attribute media {
+      common.data.mediaquery
+    }
+  shared-hyperlink.attrs.type =
+    attribute type {
+      common.data.mimetype
+    }
+  shared-hyperlink.attrs.ping =
+    attribute ping {
+      common.data.uris
+    } & v5only
+
+## Emphatic Stress: <em>
+
+	em.elem =
+		element em { em.inner & em.attrs }
+	em.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	em.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= em.elem
+
+## Strong Importance: <strong>
+
+	strong.elem =
+		element strong { strong.inner & strong.attrs }
+	strong.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	strong.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= strong.elem
+
+## Small Print and Side Comments: <small>
+
+	small.elem =
+		element small { small.inner & small.attrs }
+	small.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	small.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= small.elem
+
+## Marked (Highlighted) Text: <mark>
+
+	mark.elem =
+		element mark { mark.inner & mark.attrs }
+		& v5only
+	mark.attrs =
+		( common.attrs )
+	mark.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= mark.elem
+
+## Abbreviation: <abbr>
+
+	abbr.elem =
+		element abbr { abbr.inner & abbr.attrs }
+	abbr.attrs =
+		(	common.attrs
+		#	abbr.attrs.title included in common.attrs
+		&	common.attrs.aria?
+		)
+	abbr.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= abbr.elem
+
+## Defining Instance: <dfn>
+
+	dfn.elem =
+		element dfn { dfn.inner & dfn.attrs }
+	dfn.attrs =
+		(	common.attrs
+		#	dfn.attrs.title included in common.attrs
+		&	common.attrs.aria?
+		)
+	dfn.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= dfn.elem
+
+## Italic: <i>
+
+	i.elem =
+		element i { i.inner & i.attrs }
+	i.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	i.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= i.elem
+
+## Bold: <b>
+
+	b.elem =
+		element b { b.inner & b.attrs }
+	b.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	b.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= b.elem
+
+## Code Fragment: <code>
+
+	code.elem =
+		element code { code.inner & code.attrs }
+	code.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	code.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= code.elem
+
+## Variable or Placeholder: <var>
+
+	var.elem =
+		element var { var.inner & var.attrs }
+	var.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	var.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= var.elem
+
+## (Sample) Output: <samp>
+
+	samp.elem =
+		element samp { samp.inner & samp.attrs }
+	samp.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	samp.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= samp.elem
+
+## User Input: <kbd>
+
+	kbd.elem =
+		element kbd { kbd.inner & kbd.attrs }
+	kbd.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	kbd.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= kbd.elem
+
+## Superscript: <sup>
+
+	sup.elem =
+		element sup { sup.inner & sup.attrs }
+	sup.attrs =
+		( common.attrs )
+	sup.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= sup.elem
+
+## Subscript: <sub>
+
+	sub.elem =
+		element sub { sub.inner & sub.attrs }
+	sub.attrs =
+		( common.attrs )
+	sub.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= sub.elem
+
+## Quotation: <q>
+
+	q.elem =
+		element q { q.inner & q.attrs }
+	q.attrs =
+		(	common.attrs
+		&	q.attrs.cite?
+		&	common.attrs.aria?
+		)
+		q.attrs.cite =
+			attribute cite {
+				common.data.uri
+			}
+	q.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= q.elem
+
+## Title of Work: <cite>
+
+	cite.elem =
+		element cite { cite.inner & cite.attrs }
+	cite.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	cite.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= cite.elem
+
+## Generic Span: <span>
+
+	span.elem =
+		element span { span.inner & span.attrs }
+	span.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	span.inner =
+		( common.inner.phrasing ) # REVISIT allow ol and ul?
+
+	common.elem.phrasing |= span.elem
+
+## Bidirectional Override: <bdo>
+
+	bdo.elem =
+		element bdo { bdo.inner & bdo.attrs }
+	bdo.attrs =
+		( common.attrs ) # dir required in Schematron
+	bdo.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= bdo.elem
+
+## Line Break: <br>
+
+	br.elem =
+		element br { br.inner & br.attrs }
+	br.attrs =
+		( common.attrs )
+	br.inner =
+		( empty )
+
+	common.elem.phrasing |= br.elem
+
+## Line-break opportunity: <wbr>
+
+	wbr.elem =
+		element wbr { wbr.inner & wbr.attrs }
+	wbr.attrs =
+		( common.attrs )
+	wbr.inner =
+		( empty )
+
+	common.elem.phrasing |= wbr.elem
diff --git a/xml/relaxng/testData/highlighting/html5/revision.rnc b/xml/relaxng/testData/highlighting/html5/revision.rnc
new file mode 100644
index 0000000..b0d77a4
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/revision.rnc
@@ -0,0 +1,52 @@
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Revision Annotations                  #
+# #####################################################################
+
+## Common Attributes
+
+	edit.attrs.cite =
+		attribute cite {
+			common.data.uri
+		}
+	edit.attrs.datetime =
+		attribute datetime {
+			common.data.datetime
+		}
+
+## Inserts: <ins>
+
+	ins.elem.flow =
+		element ins { ins.inner.flow & ins.attrs }
+	ins.elem.phrasing =
+		element ins { ins.inner.phrasing & ins.attrs }
+	ins.attrs =
+		(	common.attrs
+		&	edit.attrs.cite?
+		&	edit.attrs.datetime?
+		)
+	ins.inner.flow =
+		( common.inner.flow )
+	ins.inner.phrasing =
+		( common.inner.phrasing )
+
+	common.elem.flow |= ins.elem.flow
+	common.elem.phrasing |= ins.elem.phrasing
+
+## Deletions: <del>
+
+	del.elem.flow =
+		element del { del.inner.flow & del.attrs }
+	del.elem.phrasing =
+		element del { del.inner.phrasing & del.attrs }
+	del.attrs =
+		(	common.attrs
+		&	edit.attrs.cite?
+		&	edit.attrs.datetime?
+		)
+	del.inner.flow =
+		( common.inner.flow )
+	del.inner.phrasing =
+		( common.inner.phrasing )
+
+	common.elem.flow |= del.elem.flow
+	common.elem.phrasing |= del.elem.phrasing
diff --git a/xml/relaxng/testData/highlighting/html5/ruby.rnc b/xml/relaxng/testData/highlighting/html5/ruby.rnc
new file mode 100644
index 0000000..cd95ff8
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/ruby.rnc
@@ -0,0 +1,51 @@
+datatypes w = "http://whattf.org/datatype-draft"
+namespace local = ""
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Ruby                                  #
+# #####################################################################
+
+#######################################################################
+
+## Ruby Annotation: <ruby>
+
+	ruby.elem =
+		element ruby { ruby.inner & ruby.attrs }
+	ruby.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	ruby.inner =
+		(  (  common.inner.phrasing
+		   ,  (  rt.elem
+		      |  (  rp.elem
+		         ,  rt.elem
+		         ,  rp.elem
+		         )
+		      )
+		   )+
+		)
+
+	common.elem.phrasing |= ruby.elem
+
+## Ruby Text: <rt>
+
+	rt.elem =
+		element rt { rt.inner & rt.attrs }
+	rt.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	rt.inner =
+		( common.inner.phrasing )
+	
+## Ruby Parenthesis: <rp>
+
+	rp.elem =
+		element rp { rp.inner & rp.attrs }
+	rp.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	rp.inner =
+		( common.inner.phrasing )
diff --git a/xml/relaxng/testData/highlighting/html5/sectional.rnc b/xml/relaxng/testData/highlighting/html5/sectional.rnc
new file mode 100644
index 0000000..f7931bc
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/sectional.rnc
@@ -0,0 +1,140 @@
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Sectioning Markup                     #
+# #####################################################################
+
+# #####################################################################
+## Headings
+
+## Heading (Rank 1): <h1>
+
+	h1.elem =
+		element h1 { h1.inner & h1.attrs }
+	h1.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	h1.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= h1.elem
+
+## Heading (Rank 2): <h2>
+
+	h2.elem =
+		element h2 { h2.inner & h2.attrs }
+	h2.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	h2.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= h2.elem
+
+## Heading (Rank 3): <h3>
+
+	h3.elem =
+		element h3 { h3.inner & h3.attrs }
+	h3.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	h3.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= h3.elem
+
+## Heading (Rank 4): <h4>
+
+	h4.elem =
+		element h4 { h4.inner & h4.attrs }
+	h4.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	h4.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= h4.elem
+
+## Heading (Rank 5): <h5>
+
+	h5.elem =
+		element h5 { h5.inner & h5.attrs }
+	h5.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	h5.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= h5.elem
+
+## Heading (Rank 6): <h6>
+
+	h6.elem =
+		element h6 { h6.inner & h6.attrs }
+	h6.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	h6.inner =
+		( common.inner.phrasing )
+
+	common.elem.flow |= h6.elem
+
+## Heading Group: <hgroup>
+
+	hgroup.elem =
+		element hgroup { hgroup.inner & hgroup.attrs }
+	hgroup.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.structure?
+		)
+	hgroup.inner =
+		(	h1.elem
+		|	h2.elem
+		|	h3.elem
+		|	h4.elem
+		|	h5.elem
+		|	h6.elem
+		)+
+
+	common.elem.flow |= hgroup.elem
+
+# #####################################################################
+## Section Meta
+
+## Contact Info: <address>
+
+	address.elem =
+		element address { address.inner & address.attrs }
+	address.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.region?
+		)
+	address.inner = 
+		( common.inner.flow )
+
+	common.elem.flow |= address.elem
+
+# #####################################################################
+## Quotations	
+
+## Block Quotes: <blockquote>
+
+	blockquote.elem =
+		element blockquote { blockquote.inner & blockquote.attrs }
+	blockquote.attrs =
+		(	common.attrs
+		&	blockquote.attrs.cite?
+		&	common.attrs.aria?
+		)
+		blockquote.attrs.cite =
+			attribute cite {
+				common.data.uri
+			}
+	blockquote.inner =
+		( common.inner.flow )
+
+	common.elem.flow |= blockquote.elem
diff --git a/xml/relaxng/testData/highlighting/html5/structural.rnc b/xml/relaxng/testData/highlighting/html5/structural.rnc
new file mode 100644
index 0000000..f79fcad
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/structural.rnc
@@ -0,0 +1,105 @@
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Block Markup Added in HTML5           #
+# #####################################################################
+
+## Section: <section>
+
+	section.elem =
+		element section { section.inner & section.attrs }
+	section.attrs =
+		(	common.attrs
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.region
+			)?
+		)
+	section.inner =
+		(	style.elem.scoped*
+		,	common.inner.flow 
+		)
+
+	common.elem.flow |= section.elem
+
+## Navigational Links: <nav>
+
+	nav.elem =
+		element nav { nav.inner & nav.attrs }
+	nav.attrs =
+		(	common.attrs
+		&	( common.attrs.aria.implicit.region
+		  | common.attrs.aria.landmark.navigation
+		  )?
+		)
+	nav.inner =
+		( common.inner.flow )
+
+	common.elem.flow |= nav.elem
+
+## Article: <article>
+
+	article.elem =
+		element article { article.inner & article.attrs }
+	article.attrs =
+		(	common.attrs
+		&	( common.attrs.aria.implicit.region
+		  | common.attrs.aria.landmark.article
+		  | common.attrs.aria.landmark.main
+		  | common.attrs.aria.landmark.document
+		  | common.attrs.aria.landmark.application
+		  )?
+		)
+	article.inner =
+		(	style.elem*
+		,	common.inner.flow 
+		)
+		
+	common.elem.flow |= article.elem
+
+## Tangential Aside: <aside>
+
+	aside.elem =
+		element aside { aside.inner & aside.attrs }
+	aside.attrs =
+		(	common.attrs
+		&	( common.attrs.aria.implicit.region
+		  | common.attrs.aria.landmark.complementary
+		  | common.attrs.aria.landmark.search
+		  | common.attrs.aria.landmark.note
+		  )?
+		)
+	aside.inner =
+		(	style.elem*
+		,	common.inner.flow 
+		)
+
+	common.elem.flow |= aside.elem
+
+## Header: <header>
+
+	header.elem =
+		element header { header.inner & header.attrs }
+	header.attrs =
+		(	common.attrs
+		&	( common.attrs.aria.implicit.region
+		  | common.attrs.aria.landmark.banner
+		  )?
+		)
+	header.inner =
+		( common.inner.flow )
+
+	common.elem.flow |= header.elem
+
+## Footer: <footer>
+
+	footer.elem =
+		element footer { footer.inner & footer.attrs }
+	footer.attrs =
+		(	common.attrs
+		&	( common.attrs.aria.implicit.region
+		  | common.attrs.aria.landmark.contentinfo
+		  )?
+		)
+	footer.inner =
+		( common.inner.flow )
+
+	common.elem.flow |= footer.elem
+
diff --git a/xml/relaxng/testData/highlighting/html5/tables.rnc b/xml/relaxng/testData/highlighting/html5/tables.rnc
new file mode 100644
index 0000000..ad5da39
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/tables.rnc
@@ -0,0 +1,224 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Tables                                #
+# #####################################################################
+
+# #####################################################################
+## Table Envelope
+
+## Table Datatypes
+
+#	tables.data.multilen =
+#		(	common.data.integer.positive
+#		|	common.data.percent
+#		|	xsd:token { pattern = "[0-9]+\*" } #REVISIT should this one be string? 
+#		)
+
+## Table Alignment Attributes
+
+	tables.attrs.alignment =
+		(	tables.attrs.align?
+		&	tables.attrs.char?
+		&	tables.attrs.valign?
+		)
+		tables.attrs.align =
+			attribute align {
+				(	w:string "left" 
+				|	w:string "center"
+				|	w:string "right"
+				|	w:string "justify"
+				|	w:string "char"
+				)
+			}
+		tables.attrs.char =
+			attribute char {
+				xsd:string { pattern = "." }
+			}
+		tables.attrs.valign =
+			attribute valign {
+				(	w:string "top"
+				|	w:string "middle"
+				|	w:string "bottom"
+				|	w:string "baseline"
+				)
+			}
+
+## Data Table: <table>
+
+	table.elem =
+		element table { table.inner & table.attrs }
+	table.attrs =
+		(	common.attrs
+		&	table.attrs.summary? # obsolete
+		&	common.attrs.aria?
+		)
+		table.attrs.summary =
+			attribute summary {
+				string
+			}
+	table.inner =
+		(	caption.elem?
+		,	colgroup.elem*
+		,	thead.elem?
+		,	(	(	tfoot.elem
+				,	( tbody.elem* | tr.elem+ )
+				)
+			|	(	( tbody.elem* | tr.elem+ )
+				,	tfoot.elem?
+				)
+			)
+		) 
+
+	common.elem.flow |= table.elem
+
+## Table Caption: <caption>
+
+	caption.elem =
+		element caption { caption.inner & caption.attrs }
+	caption.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.region?
+		)
+	caption.inner =
+		( common.inner.flow )
+
+# #####################################################################
+## Table Super Structure
+
+## Table Column Group: <colgroup>
+
+	colgroup.elem =
+		element colgroup { colgroup.inner & colgroup.attrs }
+	colgroup.attrs =
+		( common.attrs )
+		colgroup.attrs.span =
+			attribute span {
+				common.data.integer.positive
+			}
+	colgroup.inner =
+		(	col.elem*
+		|	colgroup.attrs.span?
+		)
+
+## Table Column: <col>
+
+	col.elem =
+		element col { col.inner & col.attrs }
+	col.attrs =
+		(	common.attrs
+		&	col.attrs.span?
+		)
+		col.attrs.span =
+			attribute span {
+				common.data.integer.positive
+			}
+	col.inner =
+		( empty )
+
+## Table Header Row Group
+
+	thead.elem =
+		element thead { thead.inner & thead.attrs }
+	thead.attrs =
+		( common.attrs )
+	thead.inner =
+		( tr.elem* )
+
+## Table Footer Row Group
+
+	tfoot.elem =
+		element tfoot { tfoot.inner & tfoot.attrs }
+	tfoot.attrs =
+		( common.attrs )
+	tfoot.inner =
+		( tr.elem* )
+
+## Table Row Group
+
+	tbody.elem =
+		element tbody { tbody.inner & tbody.attrs }
+	tbody.attrs =
+		( common.attrs )
+	tbody.inner =
+		( tr.elem* )
+
+# #####################################################################
+## Cell Structure
+
+## Table Row
+
+	tr.elem =
+		element tr { tr.inner & tr.attrs }
+	tr.attrs =
+		(	common.attrs
+		&	common.attrs.aria?
+		)
+	tr.inner =
+		( ( td.elem | th.elem )* )
+
+## Common Table Cell Attributes
+
+	tables.attrs.cell-structure =
+		(	tables.attrs.colspan?
+		&	tables.attrs.rowspan?
+		)
+		tables.attrs.colspan =
+			attribute colspan {
+				common.data.integer.positive
+			}
+		tables.attrs.rowspan =
+			attribute rowspan {
+				common.data.integer.non-negative
+			}
+
+	tables.attrs.access-headers =
+		( tables.attrs.headers? )
+		tables.attrs.headers =
+			attribute headers {
+				common.data.idrefs
+			}
+
+	tables.attrs.define-headers =
+		( tables.attrs.scope? )
+		tables.attrs.scope =
+			attribute scope {
+				(	w:string "row"
+				|	w:string "col"
+				|	w:string "rowgroup"
+				|	w:string "colgroup"
+				)
+			}
+		tables.attrs.abbr =
+			attribute abbr {
+				text
+			}
+
+## Table Data Cell: <td>
+
+	td.elem =
+		element td { td.inner & td.attrs }
+	td.attrs =
+		(	common.attrs
+		&	tables.attrs.cell-structure
+		&	tables.attrs.headers?
+#		&	tables.attrs.alignment
+		&	common.attrs.aria?
+		)
+	td.inner =
+		( common.inner.flow )
+
+## Table Header Cells: <th>
+
+	th.elem =
+		element th { th.inner & th.attrs }
+	th.attrs =
+		(	common.attrs
+		&	tables.attrs.cell-structure
+		&	tables.attrs.scope?
+		&	tables.attrs.headers?
+#		&	tables.attrs.alignment
+		&	common.attrs.aria.implicit.th?
+		)
+	th.inner =
+		( common.inner.phrasing )
diff --git a/xml/relaxng/testData/highlighting/html5/web-forms-scripting.rnc b/xml/relaxng/testData/highlighting/html5/web-forms-scripting.rnc
new file mode 100644
index 0000000..63fe1c4
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/web-forms-scripting.rnc
@@ -0,0 +1,27 @@
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Web Forms 1.0 Scripting               #
+# #####################################################################
+
+	scripting.attr.form.select =
+		attribute onselect { string }
+	scripting.attr.form.change =
+		attribute onchange { string }
+
+#	input.text.attrs &=
+#		(	scripting.attr.form.select?
+#		)
+
+#	shared-form.attrs &=
+#		(	scripting.attr.form.change?
+#		)
+
+#	form.attrs &=
+#		(	scripting.attr.form.reset?
+#		&	scripting.attr.form.submit?
+#		)
+		scripting.attr.form.submit =
+			attribute onsubmit { string }
+		scripting.attr.form.reset =
+			attribute onreset { string } 
+		
+		
diff --git a/xml/relaxng/testData/highlighting/html5/web-forms.rnc b/xml/relaxng/testData/highlighting/html5/web-forms.rnc
new file mode 100644
index 0000000..8c22d48
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/web-forms.rnc
@@ -0,0 +1,536 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Web Forms 1.0 markup                  #
+# #####################################################################
+
+## Shared attributes for form controls
+
+	common-form.attrs =
+		(	common-form.attrs.name?
+		&	common-form.attrs.disabled?
+		)
+		
+	common-form.attrs.name = 
+		attribute name {
+			string #REVISIT should this be restricted somehow? No & and = perhaps?
+		}
+
+	common-form.attrs.disabled = 
+		attribute disabled {
+			w:string "disabled" | w:string ""
+		}
+
+	shared-form.attrs.readonly = 
+		attribute readonly {
+			w:string "readonly" | w:string ""
+		}
+
+	shared-form.attrs.maxlength = 
+		attribute maxlength {
+			common.data.integer.positive #REVISIT should this be non-negative?
+		}
+
+	shared-form.attrs.size = 
+		attribute size {
+			common.data.integer.positive
+		}
+	
+	# REVISIT tabindex goes in common.attrs
+
+## Shared attributes for <input>
+	
+	input.attrs.checked = 
+		attribute checked {
+			w:string "checked" | w:string ""
+		}
+
+## Text Field: <input type='text'>
+
+	input.text.elem = 
+		element input { input.text.attrs }
+	input.text.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.text.attrs.type?
+		&	shared-form.attrs.maxlength? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.size?
+		&	input.text.attrs.value? 
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.input
+			)?
+		)		
+		input.text.attrs.type = 
+			attribute type {
+				w:string "text"
+			}
+		input.text.attrs.value =
+			attribute value {
+				string #REVISIT "nominally" free of line breaks?
+			}
+		
+	input.elem = input.text.elem
+
+## Password Field: <input type='password'>
+
+	input.password.elem = 
+		element input { input.password.attrs }
+	input.password.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.password.attrs.type
+		&	shared-form.attrs.maxlength? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.size?
+		&	input.password.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)
+		input.password.attrs.type = 
+			attribute type {
+				w:string "password"
+			}
+		input.password.attrs.value =
+			attribute value {
+				string #REVISIT "nominally" free of line breaks?			
+			}
+		
+	input.elem |= input.password.elem
+		
+## Checkbox: <input type='checkbox'>
+
+	input.checkbox.elem = 
+		element input { input.checkbox.attrs }
+	input.checkbox.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.checkbox.attrs.type
+		&	input.attrs.checked? 
+		&	input.checkbox.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)
+		input.checkbox.attrs.type = 
+			attribute type {
+				w:string "checkbox"
+			}
+		input.checkbox.attrs.value =
+			attribute value {
+				string #REVISIT require non-empty value?
+			}
+		
+	input.elem |= input.checkbox.elem
+	
+## Radiobutton: <input type='radio'>
+
+	input.radio.elem = 
+		element input { input.radio.attrs }
+	input.radio.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.radio.attrs.type
+		&	input.attrs.checked? 
+		&	input.radio.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)
+		input.radio.attrs.type = 
+			attribute type {
+				w:string "radio"
+			}
+		input.radio.attrs.value =
+			attribute value {
+				string #REVISIT require non-empty value?
+			}
+		
+	input.elem |= input.radio.elem
+	
+## Scripting Hook Button: <input type='button'>
+
+	input.button.elem = 
+		element input { input.button.attrs }
+	input.button.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.button.attrs.type
+		&	input.button.attrs.value? 
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.button
+			)?
+		)
+		input.button.attrs.type = 
+			attribute type {
+				w:string "button"
+			}
+		input.button.attrs.value =
+			attribute value {
+				string #REVISIT require non-empty value?
+			}
+		
+	input.elem |= input.button.elem
+	#REVISIT should this be enabled by a scripting module only?
+	
+## Submit Button: <input type='submit'>
+
+	input.submit.elem = 
+		element input { input.submit.attrs }
+	input.submit.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.submit.attrs.type
+		&	input.submit.attrs.value? 
+		&	common.attrs.aria.implicit.button?
+		)
+		input.submit.attrs.type = 
+			attribute type {
+				w:string "submit"
+			}
+		input.submit.attrs.value =
+			attribute value {
+				string #REVISIT require non-empty value?
+			}
+		
+	input.elem |= input.submit.elem
+		
+## Reset Button: <input type='reset'>
+
+	input.reset.elem = 
+		element input { input.reset.attrs }
+	input.reset.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.reset.attrs.type
+		&	input.reset.attrs.value? 
+		&	common.attrs.aria.implicit.button?
+		)
+		input.reset.attrs.type = 
+			attribute type {
+				w:string "reset"
+			}
+		input.reset.attrs.value =
+			attribute value {
+				string #REVISIT require non-empty value?
+			}
+		
+	input.elem |= input.reset.elem
+	# REVISIT does reset make sense outside a form?
+		
+## File Upload: <input type='file'>
+
+	input.file.elem = 
+		element input { input.file.attrs }
+	input.file.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.file.attrs.type
+		&	input.file.attrs.accept?
+		&	common.attrs.aria.implicit.input?
+		)
+		input.file.attrs.type = 
+			attribute type {
+				w:string "file"
+			}
+		input.file.attrs.accept = 
+			attribute accept {
+				form.data.mimetypelist
+			}
+
+	input.elem |= input.file.elem
+	
+## Hidden String: <input type='hidden'>
+
+	input.hidden.elem = 
+		element input { input.hidden.attrs }
+	input.hidden.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.hidden.attrs.type
+		&	input.hidden.attrs.value? 
+		)
+		input.hidden.attrs.type = 
+			attribute type {
+				w:string "hidden"
+			}
+		input.hidden.attrs.value =
+			attribute value {
+				string
+			}
+		
+	input.elem |= input.hidden.elem
+		
+## Image Submit Button: <input type='image'>
+
+	input.image.elem = 
+		element input { input.image.attrs }
+	input.image.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.image.attrs.type
+		&	input.image.attrs.alt 
+		&	input.image.attrs.src? 
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.button
+			)?
+		)	
+		input.image.attrs.type = 
+			attribute type {
+				w:string "image"
+			}
+		input.image.attrs.alt = 
+			attribute alt {
+				string # XXX non-empty
+			}
+		input.image.attrs.src = 
+			attribute src {
+				common.data.uri
+			}
+	
+	input.elem |= input.image.elem
+	
+	common.elem.phrasing |= input.elem
+
+## Text Area: <textarea>
+
+	textarea.elem =
+		element textarea { textarea.inner & textarea.attrs }
+	textarea.attrs =
+		(	common.attrs
+		&	common-form.attrs
+		&	shared-form.attrs.readonly?
+		&	textarea.attrs.rows-and-cols-wf1
+		&	common.attrs.aria.implicit.input?
+		#FIXME onfocus, onblur, onselect,onchange
+		)
+		# This is ugly. 
+		textarea.attrs.rows-and-cols-wf1 = 
+			textarea.attrs.rows-and-cols-wf1.inner	
+		textarea.attrs.rows-and-cols-wf1.inner =
+			(	textarea.attrs.cols
+			&	textarea.attrs.rows
+			)
+		textarea.attrs.cols = 
+			attribute cols {
+				common.data.integer.positive
+			}
+		textarea.attrs.rows = 
+			attribute rows {
+				common.data.integer.positive
+			}
+	textarea.inner =
+		( text )
+
+	common.elem.phrasing |= textarea.elem
+
+# Due to limitations with interleave, handling single/multiple selection
+# enforcement in RELAX NG seems to be possible but really awkward.
+# Tried it. Leaving it to Schematron.
+
+## Select menu option: <option selected>
+
+	option.elem =
+		element option { option.inner & option.attrs }
+	option.attrs =
+		(	common.attrs
+		&	common-form.attrs.disabled?
+		&	option.attrs.selected?
+		&	option.attrs.label?
+		&	option.attrs.value?
+		&	common.attrs.aria.implicit.input?
+		)
+		option.attrs.selected =
+			attribute selected {
+				w:string "selected" | w:string ""
+			}
+		option.attrs.label =
+			attribute label {
+				string
+			}		
+		option.attrs.value =
+			attribute value {
+				string
+			}		
+	option.inner =
+		( text )
+
+## Option Group: <optgroup>
+
+	optgroup.elem =
+		element optgroup { optgroup.inner & optgroup.attrs }
+	optgroup.attrs = 
+		(	common.attrs
+		&	optgroup.attrs.label
+		&	common-form.attrs.disabled?
+		)
+		optgroup.attrs.label =
+			attribute label {
+				string
+			}
+	optgroup.inner =
+		( option.elem* )
+
+## Selection Menu: <select>
+
+	select.elem =
+		element select { select.inner & select.attrs }	
+	select.attrs =
+		(	common.attrs
+		&	common-form.attrs
+		&	select.attrs.size?
+		&	select.attrs.multiple?
+		# FIXME onfocus, onblur, onchange
+		)
+		select.attrs.size =
+			attribute size {
+				common.data.integer.positive
+			}
+		select.attrs.multiple =
+			attribute multiple {
+				w:string "multiple" | w:string ""
+			}
+	select.inner =
+		(	optgroup.elem*
+		&	option.elem*
+		)
+
+	common.elem.phrasing |= select.elem
+	
+## Shared Definitions for Complex Button
+	
+	button.attrs.value =
+		attribute value {
+			string
+		}
+	button.inner = 
+		( common.inner.phrasing )
+	
+## Complex Submit Button: <button type='submit'>
+
+	button.submit.elem =
+		element button { button.inner & button.submit.attrs }	
+	button.submit.attrs =
+		(	common.attrs
+		&	common-form.attrs
+		&	button.submit.attrs.type?
+		&	button.attrs.value?
+		&	common.attrs.aria.implicit.button?
+		)
+		button.submit.attrs.type =
+			attribute type {
+				w:string "submit"
+			}
+
+	button.elem = button.submit.elem
+	
+## Complex Reset Button: <button type='reset'>
+
+	button.reset.elem =
+		element button { button.inner & button.reset.attrs }	
+	button.reset.attrs =
+		(	common.attrs
+		&	common-form.attrs
+		&	button.reset.attrs.type
+		&	button.attrs.value? #REVISIT I guess this still affects the DOM
+		&	common.attrs.aria.implicit.button?
+		)
+		button.reset.attrs.type =
+			attribute type {
+				w:string "reset"
+			}
+
+	button.elem |= button.reset.elem
+	
+## Complex Push Button: <button type='button'>
+
+	button.button.elem =
+		element button { button.inner & button.button.attrs }	
+	button.button.attrs =
+		(	common.attrs
+		&	common-form.attrs
+		&	button.button.attrs.type
+		&	button.attrs.value? #REVISIT I guess this still affects the DOM
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.button
+			)?
+		)
+		button.button.attrs.type =
+			attribute type {
+				w:string "button"
+			}
+
+	button.elem |= button.button.elem
+
+	common.elem.phrasing |= button.elem
+
+## Form: <form>
+
+	form.elem =
+		element form { form.inner & form.attrs }
+	form.attrs =
+		(	common.attrs
+		&	form.attrs.action? #REVISIT Should this be required anyway?
+		&	form.attrs.method?
+		&	form.attrs.enctype?
+		&	common-form.attrs.name?
+		&	form.attrs.accept-charset?
+		&	(	common.attrs.aria
+			|	common.attrs.aria.implicit.region
+			)?
+		)
+		form.attrs.action =
+			attribute action {
+				common.data.uri
+			}
+		form.attrs.method =
+			attribute method {
+				form.attrs.method.data
+			}
+			form.attrs.method.data = 
+				( w:string "get" | w:string "post" )
+		form.attrs.enctype =
+			attribute enctype {
+				form.attrs.enctype.data
+			}
+			form.attrs.enctype.data = 
+				(	w:string "application/x-www-form-urlencoded" 
+				|	w:string "multipart/form-data"
+				)
+		form.attrs.accept-charset =
+			attribute accept-charset {
+				form.data.charsetlist
+			}	
+	form.inner =
+		( common.inner.flow )
+
+	common.elem.flow |= form.elem
+
+## Fieldset: <fieldset>
+
+	fieldset.elem =
+		element fieldset { fieldset.inner & fieldset.attrs }
+	fieldset.attrs =
+		(	common.attrs
+		&	common.attrs.aria.implicit.group?
+		)	
+	fieldset.inner =
+		(	legend.elem? #REVISIT should this be required?
+		,	common.inner.flow
+		)
+
+	common.elem.flow |= fieldset.elem
+	
+## Label: <label>
+
+	label.elem =
+		element label { label.inner & label.attrs }
+	label.attrs =
+		(	common.attrs
+		&	label.attrs.for?
+		&	common.attrs.aria.implicit.region?
+		)
+		label.attrs.for =
+			attribute for {
+				common.data.idref
+			}
+	label.inner =
+		( common.inner.phrasing ) #REVISIT making obvious guess
+
+	common.elem.phrasing |= label.elem
+
diff --git a/xml/relaxng/testData/highlighting/html5/web-forms2-scripting.rnc b/xml/relaxng/testData/highlighting/html5/web-forms2-scripting.rnc
new file mode 100644
index 0000000..aedf81c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/web-forms2-scripting.rnc
@@ -0,0 +1,15 @@
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Web Forms 2.0 Scripting               #
+# #####################################################################
+
+	scripting.attr.form.formchange =
+		attribute onformchange { string }
+
+	scripting.attr.form.forminput =
+		attribute onforminput { string }
+
+#	output.attrs &=
+#		(	scripting.attr.form.formchange?
+#		&	scripting.attr.form.forminput?
+#		&	scripting.attr.form.change?
+#		)
diff --git a/xml/relaxng/testData/highlighting/html5/web-forms2.rnc b/xml/relaxng/testData/highlighting/html5/web-forms2.rnc
new file mode 100644
index 0000000..175c224
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/web-forms2.rnc
@@ -0,0 +1,790 @@
+datatypes w = "http://whattf.org/datatype-draft"
+
+# #####################################################################
+##  RELAX NG Schema for HTML 5: Web Forms 2.0 markup                  #
+# #####################################################################
+
+## Shared attributes for form controls
+
+	common-form.attrs &=
+		( common-form.attrs.form? )
+
+	common-form.attrs.form |= 
+		attribute form {
+			common.data.idref
+		}
+
+	shared-form.attrs.formaction =
+		attribute formaction {
+			common.data.uri
+		}
+
+	shared-form.attrs.formenctype =
+		attribute formenctype {
+			shared-form.attrs.formenctype.data
+		}
+		shared-form.attrs.formenctype.data = 
+			(	w:string "application/x-www-form-urlencoded" 
+			|	w:string "multipart/form-data"
+			|	w:string "text/plain"
+			)
+
+	shared-form.attrs.formmethod =
+		attribute formmethod {
+			shared-form.attrs.formmethod.data
+		}
+		shared-form.attrs.formmethod.data = 
+			( w:string "get"
+			| w:string "post"
+			| w:string "put"
+			| w:string "delete"
+			)
+
+	shared-form.attrs.formtarget = 
+		attribute formtarget {
+			common.data.browsing-context-or-keyword
+		}
+
+	shared-form.attrs.formnovalidate = 
+		attribute formnovalidate {
+			w:string "formnovalidate" | w:string ""
+		}
+
+	shared-form.attrs.autofocus = 
+		attribute autofocus {
+			w:string "autofocus" | w:string ""
+		}
+	
+	shared-form.attrs.pattern = 
+		attribute pattern {
+			form.data.pattern
+		}
+
+	shared-form.attrs.template = 
+		attribute template {
+			common.data.idref
+		}
+
+	shared-form.attrs.required = 
+		attribute required {
+			w:string "required" | w:string ""
+		}
+
+	shared-form.attrs.placeholder = 
+		attribute placeholder {
+			string # FIXME line breaks
+		}
+
+## Shared attributes for <input>
+		
+	input.attrs.autocomplete = 
+		attribute autocomplete {
+			w:string "on" | w:string "off"
+		}
+	
+	input.attrs.list = 
+		attribute list {
+			common.data.idref
+		}
+	
+	input.attrs.step.float = 
+		attribute step {
+			w:string "any" | common.data.float.positive
+		}
+	
+	input.attrs.step.integer = 
+		attribute step {
+			w:string "any" | common.data.integer.positive 
+		}
+	
+	input.attrs.multiple = 
+		attribute multiple {
+			w:string "multiple" | w:string ""
+		}
+		
+## Text Field: <input type='text'>, Extensions
+
+	input.text.attrs &=
+		(	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	shared-form.attrs.pattern? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.placeholder?
+		)
+
+## Password Field: <input type='password'>, Extensions
+
+	input.password.attrs &=
+		(	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.pattern? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.placeholder?
+		)
+
+## Checkbox <input type='checkbox'>, Extensions
+
+	input.checkbox.attrs &=
+		(	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.required? 
+		)
+
+## Radiobutton: <input type='radio'>, Extensions
+
+	input.radio.attrs &=
+		(	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.required? 
+		)
+
+## Scripting Hook Button: <input type='button'>, Extensions
+
+	input.button.attrs &=
+		( shared-form.attrs.autofocus? )
+
+## Submit Button: <input type='submit'>, Extensions
+
+	input.submit.attrs &=
+		(	shared-form.attrs.formaction? 
+		&	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.formenctype? 
+		&	shared-form.attrs.formmethod? 
+		&	shared-form.attrs.formtarget? 
+		&	shared-form.attrs.formnovalidate? 
+		)
+
+## Reset Button: <input type='reset'>, Extensions
+
+	input.reset.attrs &=
+		( shared-form.attrs.autofocus? )
+
+## File Upload: <input type='file'>, Extensions
+
+	input.file.attrs &=
+		(	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.required? 
+		&	input.attrs.multiple? 
+		)
+
+## Image Submit Button: <input type='image'>, Extensions
+
+	input.image.attrs &=
+		(	shared-form.attrs.formaction? 
+		&	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.formenctype? 
+		&	shared-form.attrs.formmethod? 
+		&	shared-form.attrs.formtarget? 
+		&	shared-form.attrs.formnovalidate? 
+		&	input.image.attrs.height?
+		&	input.image.attrs.width?
+		)	
+		input.image.attrs.height =
+			attribute height {
+				common.data.integer.non-negative
+			}
+		input.image.attrs.width =
+			attribute width {
+				common.data.integer.non-negative
+			}
+
+## Global Date and Time: <input type='datetime'>
+
+	input.datetime.elem = 
+		element input { input.datetime.attrs }	
+	input.datetime.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.datetime.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.datetime.attrs.min? 
+		&	input.datetime.attrs.max? 
+		&	input.attrs.step.float? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.datetime.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.datetime.attrs.type = 
+			attribute type {
+				w:string "datetime"
+			}
+		input.datetime.attrs.min =
+			attribute min {
+				common.data.datetime
+			}
+		input.datetime.attrs.max =
+			attribute max {
+				common.data.datetime
+			}	
+		input.datetime.attrs.value =
+			attribute value {
+				common.data.datetime
+			}
+		
+	input.elem |= input.datetime.elem
+
+## Date and Time with No Time Zone Information: <input type='datetime-local'>
+
+	input.datetime-local.elem = 
+		element input { input.datetime-local.attrs }
+	input.datetime-local.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.datetime-local.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.datetime-local.attrs.min? 
+		&	input.datetime-local.attrs.max? 
+		&	input.attrs.step.float? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.datetime-local.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.datetime-local.attrs.type = 
+			attribute type {
+				w:string "datetime-local"
+			}
+		input.datetime-local.attrs.min =
+			attribute min {
+				form.data.datetime-local
+			}
+		input.datetime-local.attrs.max =
+			attribute max {
+				form.data.datetime-local			
+			}	
+		input.datetime-local.attrs.value =
+			attribute value {
+				form.data.datetime-local
+			}
+		
+	input.elem |= input.datetime-local.elem
+
+## Date: <input type='date'>
+
+	input.date.elem = 
+		element input { input.date.attrs }
+	input.date.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.date.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.date.attrs.min? 
+		&	input.date.attrs.max? 
+		&	input.attrs.step.integer? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.date.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.date.attrs.type = 
+			attribute type {
+				w:string "date"
+			}
+		input.date.attrs.min =
+			attribute min {
+				form.data.date
+			}
+		input.date.attrs.max =
+			attribute max {
+				form.data.date			
+			}	
+		input.date.attrs.value =
+			attribute value {
+				form.data.date
+			}
+		
+	input.elem |= input.date.elem
+
+## Year and Month: <input type='month'>
+
+	input.month.elem = 
+		element input { input.month.attrs }
+	input.month.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.month.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.month.attrs.min? 
+		&	input.month.attrs.max? 
+		&	input.attrs.step.integer? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.month.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.month.attrs.type = 
+			attribute type {
+				w:string "month"
+			}
+		input.month.attrs.min =
+			attribute min {
+				form.data.month
+			}
+		input.month.attrs.max =
+			attribute max {
+				form.data.month			
+			}	
+		input.month.attrs.value =
+			attribute value {
+				form.data.month
+			}
+		
+	input.elem |= input.month.elem
+
+## Time without Time Zone Information: <input type='time'>
+
+	input.time.elem = 
+		element input { input.time.attrs }
+	input.time.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.time.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.time.attrs.min? 
+		&	input.time.attrs.max? 
+		&	input.attrs.step.float? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.time.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.time.attrs.type = 
+			attribute type {
+				w:string "time"
+			}
+		input.time.attrs.min =
+			attribute min {
+				form.data.time
+			}
+		input.time.attrs.max =
+			attribute max {
+				form.data.time			
+			}	
+		input.time.attrs.value =
+			attribute value {
+				form.data.time
+			}
+		
+	input.elem |= input.time.elem
+
+## Year and Week: <input type='week'>
+
+	input.week.elem = 
+		element input { input.week.attrs }
+	input.week.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.week.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.week.attrs.min? 
+		&	input.week.attrs.max? 
+		&	input.attrs.step.integer? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.week.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.week.attrs.type = 
+			attribute type {
+				w:string "week"
+			}
+		input.week.attrs.min =
+			attribute min {
+				form.data.week
+			}
+		input.week.attrs.max =
+			attribute max {
+				form.data.week			
+			}	
+		input.week.attrs.value =
+			attribute value {
+				form.data.week
+			}
+		
+	input.elem |= input.week.elem
+
+## Number: <input type='number'>
+
+	input.number.elem = 
+		element input { input.number.attrs }
+	input.number.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.number.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.number.attrs.min? 
+		&	input.number.attrs.max? 
+		&	input.attrs.step.float? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	input.number.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.number.attrs.type = 
+			attribute type {
+				w:string "number"
+			}
+		input.number.attrs.min =
+			attribute min {
+				common.data.float
+			}
+		input.number.attrs.max =
+			attribute max {
+				common.data.float			
+			}	
+		input.number.attrs.value =
+			attribute value {
+				common.data.float
+			}
+		
+	input.elem |= input.number.elem
+
+## Imprecise Number: <input type='range'>
+
+	input.range.elem = 
+		element input { input.range.attrs }
+	input.range.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.range.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.range.attrs.min? 
+		&	input.range.attrs.max? 
+		&	input.attrs.step.float? 
+		&	input.range.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.range.attrs.type = 
+			attribute type {
+				w:string "range"
+			}
+		input.range.attrs.min =
+			attribute min {
+				common.data.float
+			}
+		input.range.attrs.max =
+			attribute max {
+				common.data.float			
+			}	
+		input.range.attrs.value =
+			attribute value {
+				common.data.float
+			}
+		
+	input.elem |= input.range.elem
+
+## Email Address: <input type='email'>
+
+	input.email.elem = 
+		element input { input.email.attrs }	
+	input.email.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.email.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	shared-form.attrs.maxlength? 
+		&	shared-form.attrs.pattern? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.size?
+		&	shared-form.attrs.placeholder?
+		&	(	(	input.attrs.multiple
+				&	input.email.attrs.value.multiple?
+				)
+			|	input.email.attrs.value.single?
+			)?
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.email.attrs.type = 
+			attribute type {
+				w:string "email"
+			}
+		input.email.attrs.value.single =
+			attribute value {
+				form.data.emailaddress
+			}
+		input.email.attrs.value.multiple =
+			attribute value {
+				form.data.emailaddresslist
+			}
+		
+	input.elem |= input.email.elem
+
+## IRI: <input type='url'>
+
+	input.url.elem = 
+		element input { input.url.attrs }	
+	input.url.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.url.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	shared-form.attrs.maxlength? 
+		&	shared-form.attrs.pattern? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.size?
+		&	shared-form.attrs.placeholder?
+		&	input.url.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.url.attrs.type = 
+			attribute type {
+				w:string "url"
+			}
+		input.url.attrs.value =
+			attribute value {
+				w:string "" | common.data.uri.absolute
+			}
+		
+	input.elem |= input.url.elem
+
+## Search: <input type='search'>
+
+	input.search.elem = 
+		element input { input.search.attrs }	
+	input.search.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.search.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	shared-form.attrs.maxlength? 
+		&	shared-form.attrs.pattern? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.size?
+		&	shared-form.attrs.placeholder?
+		&	input.search.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.search.attrs.type = 
+			attribute type {
+				w:string "search"
+			}
+		input.search.attrs.value =
+			attribute value {
+				string # FIXME line breaks
+			}
+		
+	input.elem |= input.search.elem
+
+## Telephone Number: <input type='tel'>
+
+	input.tel.elem = 
+		element input { input.tel.attrs }	
+	input.tel.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.tel.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	shared-form.attrs.maxlength? 
+		&	shared-form.attrs.pattern? 
+		&	shared-form.attrs.readonly? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.size?
+		&	shared-form.attrs.placeholder?
+		&	input.tel.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.tel.attrs.type = 
+			attribute type {
+				w:string "tel"
+			}
+		input.tel.attrs.value =
+			attribute value {
+				string # FIXME line breaks
+			}
+		
+	input.elem |= input.tel.elem
+
+## Color: <input type='color'>
+
+	input.color.elem = 
+		element input { input.color.attrs }	
+	input.color.attrs = 
+		(	common.attrs
+		&	common-form.attrs
+		&	input.color.attrs.type
+		&	input.attrs.autocomplete? 
+		&	shared-form.attrs.autofocus? 
+		&	input.attrs.list? 
+		&	input.color.attrs.value? 
+		&	common.attrs.aria.implicit.input?
+		)	
+		input.color.attrs.type = 
+			attribute type {
+				w:string "color"
+			}
+		input.color.attrs.value =
+			attribute value {
+				form.data.color
+			}
+		
+	input.elem |= input.color.elem
+
+## Form Output: <output>
+
+	output.elem =
+		element output { output.inner & output.attrs }
+	output.attrs =
+		(	common.attrs
+		&	common-form.attrs.name?
+		&	common-form.attrs.form?
+		&	output.attrs.for?
+		&	common.attrs.aria.implicit.region?
+		)
+		output.attrs.for = 
+			attribute for {
+				common.data.idrefs #REVISIT spec says space--not whitespace
+			}
+	output.inner =
+		( common.inner.phrasing )
+
+	common.elem.phrasing |= output.elem
+
+## Text Area: <textarea>, extensions
+
+	textarea.attrs.rows-and-cols-wf1.inner &=
+		notAllowed
+	textarea.attrs.rows-and-cols-wf1 |= 
+		empty
+	textarea.attrs &=
+		(	shared-form.attrs.maxlength?
+		&	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.required? 
+		&	shared-form.attrs.placeholder?
+		&	textarea.attrs.rows?
+		&	(	(	textarea.attrs.wrap.hard 
+				&	textarea.attrs.cols
+				)
+			|	(	textarea.attrs.wrap.soft?
+				&	textarea.attrs.cols?
+				)
+			)
+		)
+		textarea.attrs.wrap.hard =
+			attribute wrap {
+				w:string "hard"
+			}
+		textarea.attrs.wrap.soft =
+			attribute wrap {
+				w:string "soft"
+			}
+
+## List of Prefill Data: <datalist>
+
+	#REVISIT should the options in datalist be non-selectable?
+
+	datalist.elem =
+		element datalist { datalist.inner & datalist.attrs }
+	datalist.inner =
+		( option.elem* & common.inner.phrasing )
+	datalist.attrs =
+		( common.attrs )
+
+	common.elem.phrasing |= datalist.elem
+
+## Complex Submit Button: <button type='submit'>, extensions
+
+	button.submit.attrs &=
+		(	shared-form.attrs.formaction? 
+		&	shared-form.attrs.autofocus? 
+		&	shared-form.attrs.formenctype? 
+		&	shared-form.attrs.formmethod? 
+		&	shared-form.attrs.formtarget? 
+		&	shared-form.attrs.formnovalidate? 
+		)
+	
+## Complex Reset Button: <button type='reset'>, extensions
+
+	button.reset.attrs &=
+		( shared-form.attrs.autofocus? )
+	
+## Complex Push Button: <button type='button'>, extensions
+
+	button.button.attrs &=
+		( shared-form.attrs.autofocus? )
+
+## Form: <form>, extensions
+	form.attrs &= 
+		(	form.attrs.novalidate?
+		&	form.attrs.target?
+		&	form.attrs.autocomplete?
+		)
+		form.attrs.novalidate = 
+			attribute novalidate {
+				w:string "novalidate" | w:string ""
+			}
+		form.attrs.target = 
+			attribute target {
+				common.data.browsing-context-or-keyword
+			}
+		form.attrs.autocomplete = 
+			attribute autocomplete {
+				w:string "on" | w:string "off"
+			}
+		# REVISIT should this be case-insensitive in conforming XHTML documents?
+		form.attrs.enctype.data |= 
+			( w:string "text/plain" )
+		form.attrs.method.data |= 
+			( w:string "put" | w:string "delete" )
+
+## Fieldset: <fieldset>, extensions
+
+	fieldset.attrs &=
+		( common-form.attrs )
+
+## Label: <label>, extensions
+
+	label.attrs &=
+		( common-form.attrs.form? )
+
+## Key-pair generator/input control: <keygen>
+
+	keygen.elem =
+		element keygen { keygen.inner & keygen.attrs }
+	keygen.attrs =
+		(	common.attrs
+		&	keygen.attrs.challenge?
+		&	keygen.attrs.keytype?
+		&	shared-form.attrs.autofocus? 
+		&	common-form.attrs?
+		#REVISIT which ARIA attributes needed here
+		)
+		keygen.attrs.challenge =
+			attribute challenge {
+				string
+			}
+		keygen.attrs.keytype = 
+			attribute keytype {
+				w:string "rsa"
+			}
+	keygen.inner =
+		( empty )
+
+	common.elem.phrasing |= keygen.elem
+
diff --git a/xml/relaxng/testData/highlighting/html5/xhtml5.rnc b/xml/relaxng/testData/highlighting/html5/xhtml5.rnc
new file mode 100644
index 0000000..01ec782
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/html5/xhtml5.rnc
@@ -0,0 +1,40 @@
+default namespace = "http://www.w3.org/1999/xhtml/html5"
+# #####################################################################
+##  RELAX NG Schema for XHTML 5                                       #
+# #####################################################################
+
+  # To validate an XHTML 5 document, you must first validate against #
+  # this schema and then ALSO validate against assertions.sch        #
+
+# #####################################################################
+## Schema Framework & Parameters
+
+include "common.rnc" {
+	# XHTML flavor #
+		XMLonly = empty
+		HTMLonly = notAllowed
+	# HTML 4 compat #
+		v5only = empty
+}
+
+# #####################################################################
+## Language Definitions
+
+start = html.elem
+
+include "meta.rnc"
+include "phrase.rnc"
+include "block.rnc"
+include "sectional.rnc"
+include "structural.rnc"
+include "revision.rnc"
+include "embed.rnc"
+include "ruby.rnc"
+include "media.rnc"
+include "core-scripting.rnc"
+include "tables.rnc"
+include "form-datatypes.rnc"
+include "web-forms.rnc"
+include "web-forms2.rnc"
+include "applications.rnc"
+include "data.rnc"
diff --git a/xml/relaxng/testData/highlighting/jpdl-3.1.xsd b/xml/relaxng/testData/highlighting/jpdl-3.1.xsd
new file mode 100644
index 0000000..718783c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/jpdl-3.1.xsd
@@ -0,0 +1,456 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema xmlns=          "urn:jbpm.org:jpdl-3.1" 
+           targetNamespace="urn:jbpm.org:jpdl-3.1" 
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified">
+
+  <!--  PROCESS-DEFINITION -->
+  <!--  ################## -->
+  <xs:element name="process-definition">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="swimlane" />
+        <xs:element ref="start-state" />
+        <xs:group   ref="node-elements"/>
+        <xs:group   ref="action-elements" />
+        <xs:element ref="event" />
+        <xs:element ref="exception-handler" />
+        <xs:element ref="task" />
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <!--  SWIMLANE -->
+  <!--  ######## -->
+  <xs:element name="swimlane">
+    <xs:complexType>
+      <xs:sequence minOccurs="0" maxOccurs="1">
+        <xs:element ref="assignment"/>
+      </xs:sequence>
+      <xs:attribute name="name" type="xs:string" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <!--  NODES -->
+  <!--  ##### -->
+  <xs:element name="start-state">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="task"/>
+        <xs:element ref="transition"/>
+        <xs:element ref="event"/>
+        <xs:element ref="exception-handler"/>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="end-state">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="event"/>
+        <xs:element ref="exception-handler"/>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="decision">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element name="handler" type="delegation" />
+        <xs:element ref="event"/>
+        <xs:element ref="exception-handler"/>
+        <xs:element name="transition">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:element name="condition">
+                <xs:complexType mixed="true">
+                  <xs:sequence minOccurs="0" maxOccurs="unbounded">
+                    <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+                  </xs:sequence>
+                  <xs:attribute name="expression" type="xs:string" />
+                </xs:complexType>
+              </xs:element>
+              <xs:group ref="action-elements"/>
+              <xs:element ref="exception-handler"/>
+            </xs:choice>
+            <xs:attribute name="to" type="xs:string" use="required" />
+            <xs:attribute name="name" type="xs:string" />
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="expression" type="xs:string" />
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="fork">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="script" />
+        <xs:group ref="node-content-elements" />
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+  
+  <xs:element name="join">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="node-content-elements" />
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="node">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice minOccurs="0">
+          <xs:group ref="action-elements" />
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:group ref="node-content-elements" />
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="process-state">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element name="sub-process">
+          <xs:complexType>
+            <xs:attribute name="name" type="xs:string" use="required" />
+            <xs:attribute name="version" type="xs:integer" />
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="variable" />
+        <xs:group ref="node-content-elements" />
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="state">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="node-content-elements"/>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="super-state">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="node-elements"/>
+        <xs:group ref="node-content-elements"/>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="task-node">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="task" />
+        <xs:group ref="node-content-elements" />
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="create-tasks" type="booleanType" default="true" />
+      <xs:attribute name="end-tasks" type="booleanType" default="false" />
+      <xs:attribute name="signal" default="last">
+        <xs:simpleType>
+          <xs:restriction base="xs:string">
+            <xs:enumeration value="unsynchronized"/>
+            <xs:enumeration value="never"/>
+            <xs:enumeration value="first"/>
+            <xs:enumeration value="first-wait"/>
+            <xs:enumeration value="last"/>
+            <xs:enumeration value="last-wait"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+
+  <!--  TRANSITION -->
+  <!--  ########## -->
+  <xs:element name="transition">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="action-elements"/>
+        <xs:element ref="exception-handler" />
+      </xs:choice>
+      <xs:attribute name="to" type="xs:string" use="required" />
+      <xs:attribute name="name" type="xs:string" />
+    </xs:complexType>
+  </xs:element>
+
+  <!-- ACTIONS -->
+  <!-- ####### -->
+  <xs:element name="action">
+    <xs:complexType mixed="true">
+      <xs:sequence>
+        <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+      </xs:sequence>
+      <xs:attribute name="class" type="xs:string" />
+      <xs:attribute name="config-type" default="field">
+        <xs:simpleType>
+          <xs:restriction base="xs:string">
+            <xs:enumeration value="field"/>
+            <xs:enumeration value="bean"/>
+            <xs:enumeration value="constructor"/>
+            <xs:enumeration value="configuration-property"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="name" type="xs:string" />
+      <xs:attribute name="ref-name" type="xs:string" />
+      <xs:attribute name="accept-propagated-events" type="booleanType" default="true" />
+      <xs:attribute name="expression" type="xs:string" />
+      <xs:attribute name="async" type="xs:string" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="cancel-timer">
+    <xs:complexType>
+      <xs:attribute name="name" type="xs:string" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="create-timer">
+    <xs:complexType>
+      <xs:choice>
+        <xs:element ref="action"/>
+        <xs:element ref="script"/>
+      </xs:choice>
+      <xs:attribute name="duedate" type="xs:string" use="required" />
+      <xs:attribute name="name" type="xs:string" />
+      <xs:attribute name="repeat" type="xs:string" />
+      <xs:attribute name="transition" type="xs:string" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="script">
+    <xs:complexType  mixed="true">
+      <xs:sequence>
+        <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+      </xs:sequence>
+      <xs:attribute name="name" type="xs:string" />
+      <xs:attribute name="accept-propagated-events" type="booleanType" default="true" />
+    </xs:complexType>
+  </xs:element>
+
+  <!--  EVENT -->
+  <!--  ##### -->
+  <xs:element name="event">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="action-elements"/>
+      </xs:choice>
+      <xs:attribute name="type" use="required">
+        <xs:simpleType>
+          <xs:union>
+            <xs:simpleType>
+              <xs:restriction base="xs:string"/>
+            </xs:simpleType>
+            <xs:simpleType>
+              <xs:restriction base="xs:string">
+                <xs:enumeration value="node-enter"/>
+                <xs:enumeration value="node-leave"/>
+                <xs:enumeration value="process-start"/>
+                <xs:enumeration value="process-end"/>
+                <xs:enumeration value="task-create"/>
+                <xs:enumeration value="task-assign"/>
+                <xs:enumeration value="task-start"/>
+                <xs:enumeration value="task-end"/>
+                <xs:enumeration value="before-signal"/>
+                <xs:enumeration value="after-signal"/>
+                <xs:enumeration value="superstate-enter"/>
+                <xs:enumeration value="superstate-leave"/>
+                <xs:enumeration value="timer-create"/>
+                <xs:enumeration value="subprocess-created"/>
+                <xs:enumeration value="subprocess-end"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:union>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <!--  EXCEPTION-HANDLER -->
+  <!--  ################# -->
+  <xs:element name="exception-handler">
+    <xs:complexType>
+      <xs:choice minOccurs="1" maxOccurs="unbounded">
+        <xs:element ref="action"/>
+        <xs:element ref="script"/>
+      </xs:choice>
+      <xs:attribute name="exception-class" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+
+  <!--  TASK -->
+  <!--  #### -->
+  <xs:element name="task">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="assignment"/>
+        <xs:element ref="controller"/>
+        <xs:element ref="event"/>
+        <xs:element ref="timer"/>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" />
+      <xs:attribute name="blocking" type="booleanType" default="false"/>
+      <xs:attribute name="signalling" type="booleanType" default="true"/>
+      <xs:attribute name="description" type="xs:string" />
+      <xs:attribute name="duedate" type="xs:string" />
+      <xs:attribute name="swimlane" type="xs:string" />
+      <xs:attribute name="priority" type="priorityType" default="normal" />
+    </xs:complexType>
+  </xs:element>
+  
+  <xs:element name="controller" type="delegation" />
+
+  <xs:element name="assignment">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="delegation">
+          <xs:attribute name="expression" type="xs:string" />
+          <xs:attribute name="actor-id" type="xs:string" />
+          <xs:attribute name="pooled-actors" type="xs:string" />
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <!--  TIMER -->
+  <!--  ##### -->
+  <xs:element name="timer">
+    <xs:complexType>
+      <xs:choice>
+        <xs:element ref="action"/>
+        <xs:element ref="script"/>
+      </xs:choice>
+      <xs:attribute name="duedate" type="xs:string" use="required" />
+      <xs:attribute name="name" type="xs:string" />
+      <xs:attribute name="repeat" type="xs:string" />
+      <xs:attribute name="transition" type="xs:string" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="variable">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+      </xs:sequence>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="access" type="xs:string" default="read,write"/>
+      <xs:attribute name="mapped-name" type="xs:string" />
+    </xs:complexType>
+  </xs:element>
+  
+  <!-- TYPES AND GROUPS -->
+  <!-- ################ -->
+  <xs:complexType name="delegation" mixed="true">
+    <xs:sequence>
+      <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+    </xs:sequence>
+    <xs:attribute name="class" type="xs:string" />
+    <xs:attribute name="config-type" default="field">
+      <xs:simpleType>
+        <xs:restriction base="xs:string">
+          <xs:enumeration value="field"/>
+          <xs:enumeration value="bean"/>
+          <xs:enumeration value="constructor"/>
+          <xs:enumeration value="configuration-property"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:complexType>
+
+  <xs:simpleType name="configType">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="field"/>
+      <xs:enumeration value="bean"/>
+      <xs:enumeration value="constructor"/>
+      <xs:enumeration value="configuration-property"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="booleanType">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="yes"/>
+      <xs:enumeration value="no"/>
+      <xs:enumeration value="true"/>
+      <xs:enumeration value="false"/>
+      <xs:enumeration value="on"/>
+      <xs:enumeration value="off"/>
+    </xs:restriction>
+  </xs:simpleType>
+  
+  <xs:simpleType name="priorityType">
+    <xs:union>
+      <xs:simpleType>
+        <xs:restriction base="xs:string">
+          <xs:enumeration value="highest"/>
+          <xs:enumeration value="high"/>
+          <xs:enumeration value="normal"/>
+          <xs:enumeration value="low"/>
+          <xs:enumeration value="lowest"/>
+        </xs:restriction>
+      </xs:simpleType>
+      <xs:simpleType>
+        <xs:restriction base="xs:int"/>
+      </xs:simpleType>
+    </xs:union>
+  </xs:simpleType>
+
+  <xs:group name="node-elements">
+    <xs:choice>
+      <xs:element ref="node"/>
+      <xs:element ref="state"/>
+      <xs:element ref="task-node"/>
+      <xs:element ref="super-state"/>
+      <xs:element ref="process-state"/>
+      <xs:element ref="fork"/>
+      <xs:element ref="join"/>
+      <xs:element ref="decision"/>
+      <xs:element ref="end-state"/>
+    </xs:choice>
+  </xs:group>
+  
+  <xs:group name="action-elements">
+    <xs:choice>
+      <xs:element ref="action"/>
+      <xs:element ref="script"/>
+      <xs:element ref="create-timer"/>
+      <xs:element ref="cancel-timer"/>
+    </xs:choice>
+  </xs:group>
+  
+  <xs:group name="node-content-elements">
+    <xs:choice>
+      <xs:element ref="event"/>
+      <xs:element ref="exception-handler"/>
+      <xs:element ref="timer"/>
+      <xs:element ref="transition"/>
+    </xs:choice>
+  </xs:group>
+
+</xs:schema>
diff --git a/xml/relaxng/testData/highlighting/mybook.xml b/xml/relaxng/testData/highlighting/mybook.xml
new file mode 100644
index 0000000..c423ba8
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/mybook.xml
@@ -0,0 +1,525 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<book version="5.0" xmlns="http://docbook.org/ns/docbook"
+      xmlns:xlink="http://www.w3.org/1999/xlink"
+      xmlns:xi="http://www.w3.org/2001/XInclude"
+      xmlns:svg="http://www.w3.org/2000/svg"
+      xmlns:mml="http://www.w3.org/1998/Math/MathML"
+      xmlns:html="http://www.w3.org/1999/xhtml"
+      xmlns:db="http://docbook.org/ns/docbook">
+  <db:info>
+    <title>Lorem Ipsum</title>
+
+    <subtitle>Nulla scelerisque, nulla turpis</subtitle>
+    
+    <authorgroup>
+      <author>
+        <personname>
+          <firstname>Petri</firstname>
+          <surname>Mäkijärvi</surname>
+        </personname>
+
+        <affiliation>
+          <orgname>European Synchrotron Radiation Facility</orgname>
+
+          <address>Grenoble, France</address>
+        </affiliation>
+      </author>
+
+      <author>
+        <personname>
+          <honorific>Dr</honorific>
+          <firstname>I.</firstname>
+          <othername>M.</othername>
+          <surname>Noman</surname>
+        </personname>
+
+        <affiliation>
+          <orgname>Acme Industries, Inc.</orgname>
+
+          <address>Anytown, U.S.A.</address>
+        </affiliation>
+      </author>
+
+      <author>
+        <personname>
+          <firstname>Maxwell</firstname>
+          <surname>Smart</surname>
+        </personname>
+
+        <affiliation>
+          <orgname>C.O.N.T.R.O.L.</orgname>
+
+          <address>Washington D.C., U.S.A.</address>
+        </affiliation>
+      </author>
+    </authorgroup>
+
+    <publisher>
+      <publishername>European Synchrotron Radiation Facility</publishername>
+
+      <address>Grenoble, France</address>
+    </publisher>
+
+    <copyright>
+      <year>2007</year>
+
+      <holder>European Synchrotron Radiation Facility</holder>
+    </copyright>
+
+    <pubdate>$Date: 2010/06/09 15:19:01 $</pubdate>
+
+    <releaseinfo>$Revision: 1.3 $</releaseinfo>
+
+  </db:info>
+
+  <chapter version="5.0" xml:id="lorem" xmlns="http://docbook.org/ns/docbook"
+           xmlns:xlink="http://www.w3.org/1999/xlink"
+           xmlns:xi="http://www.w3.org/2001/XInclude"
+           xmlns:svg="http://www.w3.org/2000/svg"
+           xmlns:mml="http://www.w3.org/1998/Math/MathML"
+           xmlns:html="http://www.w3.org/1999/xhtml"
+           xmlns:db="http://docbook.org/ns/docbook">
+    <db:info xml:id="loremipsum">
+      <title>Lorem Ipsum</title>
+
+      <authorgroup>
+        <author>
+          <personname>
+            <firstname>Petri</firstname>
+            <surname>Mäkijärvi</surname>
+          </personname>
+        </author>
+
+        <author>
+          <personname>
+            <honorific>Dr</honorific>
+            <firstname>I.</firstname>
+            <othername>M.</othername>
+            <surname>Noman</surname>
+          </personname>
+        </author>
+      </authorgroup>
+
+      <pubdate>$Date: 2010/06/09 15:19:01 $</pubdate>
+
+      <releaseinfo>$Revision: 1.3 $</releaseinfo>
+    </db:info>
+
+    <sect1 xml:id="consectetuer">
+      <title>Consectetuer adipiscing elit</title>
+
+      <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
+        <indexterm>
+          <primary>Curabitur</primary>
+
+          <secondary>urna</secondary>
+
+          <seealso>Consectetuer</seealso>
+        </indexterm>
+        Curabitur urna. Maecenas eu nisi faucibus risus ornare
+        fringilla. Nam laoreet accumsan metus. Maecenas ac nunc non enim consequat
+        ultrices. Duis egestas condimentum velit. Nulla scelerisque. Nulla turpis.
+        Nam ante tortor, convallis sit amet, commodo at, dignissim at, dolor.
+        Proin sodales. Maecenas at enim. Aliquam nunc. Curabitur ullamcorper
+        molestie neque. Aliquam erat volutpat. Sed non dui et tellus ultrices
+        porttitor.
+      </para>
+
+      <para>Curabitur rutrum lobortis orci. Vivamus a urna. Nulla feugiat
+        euismod massa. In odio quam, posuere at, mattis at, pretium quis, nisi.
+        Sed eget nibh. Vestibulum ante enim, mattis at, mollis eu, ullamcorper sit
+        amet, augue. Mauris quam massa, vestibulum rhoncus, bibendum eget,
+        adipiscing at, enim. Sed pharetra. Praesent ac nibh id massa bibendum
+        elementum. Sed urna nibh, pharetra in, dapibus at, tristique at, velit.
+        Maecenas lectus. Pellentesque aliquet pharetra lacus. Aliquam et tellus.
+        Aenean gravida tristique ipsum. Duis suscipit euismod dolor. Etiam
+        facilisis mi nec risus. Nam non purus sed nibh cursus luctus. Morbi nunc
+        sem, hendrerit eu, mattis sit amet, pulvinar nec, nulla. Duis lobortis
+        metus ut orci. Curabitur facilisis.
+      </para>
+
+      <sect2 xml:id="morbi">
+        <title>Morbi a eros</title>
+
+        <para>Cum sociis natoque penatibus et magnis dis parturient montes,
+          nascetur ridiculus mus
+          <footnote>
+            <para>Aenean in odio et dui vestibulum eleifend. Donec aliquet
+              magna.
+            </para>
+          </footnote>
+          . Curabitur nulla orci, porta eget, tincidunt dapibus,
+          tincidunt sed, ligula. Nunc vel sapien. In nec diam fermentum purus
+          tincidunt ullamcorper:
+        </para>
+
+        <para>Donec facilisis aliquet libero. Maecenas sem dui, scelerisque
+          vitae, convallis at, gravida eu, purus. Proin quis nisl. Mauris ac purus
+          eu dolor fringilla tempus. Aliquam elementum. In a neque. Praesent
+          ipsum. Maecenas elementum magna sit amet eros. Praesent non
+          sapien.
+        </para>
+
+        <figure xml:id="fig_morbi">
+          <title>Morbi maecanas sem dui</title>
+
+          <mediaobject role="html">
+            <imageobject>
+              <imagedata fileref="images/morib_lib2.png" />
+            </imageobject>
+          </mediaobject>
+
+          <mediaobject role="fo">
+            <imageobject>
+              <imagedata fileref="../images/morib_lib2.png" />
+            </imageobject>
+          </mediaobject>
+        </figure>
+
+        <sect3 xml:id="nullam">
+          <title>Nullam dapibus</title>
+
+          <para>Mauris et erat egestas libero volutpat vestibulum. Curabitur
+            viverra iaculis quam. Nulla egestas dui eget odio. Nam dictum elit in
+            massa. Phasellus nec elit. Maecenas bibendum. Lorem ipsum dolor sit
+            amet, consectetuer adipiscing elit. Nullam dapibus, erat suscipit
+            iaculis porta, turpis arcu laoreet elit, sed ultrices ligula risus eu
+            velit. Phasellus risus lorem, vulputate vitae, ultricies id, elementum
+            ut, quam. Donec augue dui, vestibulum vitae, vehicula venenatis,
+            hendrerit venenatis, mi. Sed at libero eu tortor consequat aliquam.
+            Donec odio lectus, scelerisque eget, auctor id, tincidunt ac, libero.
+            Duis interdum hendrerit arcu. Pellentesque habitant morbi tristique
+            senectus et netus et malesuada fames ac turpis egestas. Etiam
+            tincidunt feugiat purus. Nulla suscipit libero et dui. Vestibulum
+            dignissim urna a risus.
+          </para>
+        </sect3>
+      </sect2>
+
+      <sect2 xml:id="vestibulum">
+        <title>Vestibulum ante</title>
+
+        <para>Vestibulum ante ipsum primis in faucibus orci
+          <indexterm 
+              class="startofrange" xml:id="luctus">
+            <primary>luctus</primary>
+
+            <secondary>ultirce</secondary>
+          </indexterm>
+          luctus et ultrice
+          <indexterm class="endofrange"
+                     startref="luctus" />
+          posuere cubilia Curae; Cras purus odio, faucibus
+          et, euismod sollicitudin, vehicula eu, urna. Mauris tempor. Vivamus sit
+          amet nisi vel dolor ultricies placerat. Nulla adipiscing feugiat erat.
+          Pellentesque vulputate posuere pede. Ut id sem at neque commodo
+          <indexterm>
+            <primary>ultricie</primary>
+          </indexterm>
+          ultricies. Suspendisse sed enim. Nulla facilisi. Proin
+          ullamcorper vestibulum tellus. Donec varius scelerisque eros.
+          Pellentesque feugiat velit et neque. Proin urna neque, interdum sed,
+          auctor sed, vulputate et, nunc. In cursus nisl. Etiam pharetra, nisl
+          quis sagittis ultricies, sapien tellus tincidunt ante, in congue mauris
+          enim eu metus. Suspendisse fringilla elementum libero. Cras nonummy sem
+          mattis tellus. Praesent faucibus sem eu dui. Nam vel lacus vitae diam
+          sollicitudin tristique. Nulla facilisi.
+        </para>
+
+        <para>Donec egestas nisl id neque. Nullam
+          <indexterm>
+            <primary>leo leo</primary>
+          </indexterm>
+          leo leo, bibendum sit amet, pellentesque sit amet,
+          sagittis eu, nibh. Praesent malesuada dictum nunc. In interdum imperdiet
+          felis. Cras rutrum leo sit amet odio. Mauris ultrices, augue sit amet
+          lacinia sollicitudin, lorem leo euismod elit, in pharetra mauris augue
+          id turpis. Vestibulum dictum sapien et sapien. Donec eleifend felis quis
+          leo fringilla consequat. Mauris vitae dolor pretium velit tincidunt
+          vehicula. Suspendisse facilisis rutrum urna. Proin viverra vulputate
+          magna. Vivamus massa nibh, eleifend condimentum, elementum eget,
+          lobortis nec, diam. Phasellus sollicitudin. Donec quis orci ornare felis
+          cursus porta. Nullam purus lectus, fringilla eu, feugiat vel, tristique
+          eu, est.
+        </para>
+      </sect2>
+    </sect1>
+
+    <sect1 xml:id="donec">
+      <title>Donec eleifend</title>
+
+      <para>Donec eleifend, justo ac interdum rutrum, massa ligula convallis
+        tellus, quis elementum elit lectus eu sapien. Ut metus massa, vehicula ut,
+        semper ut, eleifend eu, quam. Cras quis augue. Maecenas enim ante, cursus
+        vestibulum, consectetuer et, dictum sit amet, dolor. Phasellus ultrices
+        est id est. Maecenas scelerisque nisl quis eros. Vivamus rhoncus.
+        Pellentesque habitant morbi tristique senectus et netus et malesuada fames
+        ac turpis egestas. Mauris diam turpis, faucibus non, scelerisque sit amet,
+        porttitor a, enim. Ut bibendum pulvinar neque.
+      </para>
+
+      <para>Pellentesque lacinia, eros at dapibus rhoncus, lectus magna pharetra
+        sapien, sed convallis ligula mi a sapien. Donec tempor libero ut nibh.
+        Quisque et lectus eu arcu iaculis rutrum. Donec et ligula. Integer gravida
+        aliquam diam. Curabitur in augue non massa convallis accumsan. Mauris nisl
+        neque, dictum quis, eleifend nec, ornare a, nisl. Praesent id elit. Mauris
+        et leo at odio placerat iaculis. Morbi faucibus dictum nibh.
+      </para>
+    </sect1>
+
+    <sect1 xml:id="pellentesque">
+      <title>Pellentesque augue</title>
+
+      <para>Quisque molestie dignissim urna. Donec mattis pellentesque augue.
+        Nullam neque diam, bibendum ut, placerat nec, pharetra ac, eros. Sed
+        libero risus, nonummy vitae, tincidunt a, blandit ut, tortor. Nulla quis
+        libero. Vivamus ac ligula. Proin dignissim, orci ut mattis sodales, lectus
+        ligula convallis libero, sed feugiat libero odio non massa. Sed elementum.
+        Nullam id enim. Sed non arcu quis leo vulputate adipiscing. Nam et orci.
+        Integer sed nunc. Maecenas sem turpis, pulvinar ac, volutpat non,
+        ultricies rhoncus, tellus. Fusce porttitor. Nullam cursus odio vel nisi
+        elementum elementum. Integer venenatis. Sed hendrerit, tortor a semper
+        ultrices, lorem sapien lacinia erat, eu suscipit risus nisl id elit. In
+        hac habitasse platea dictumst.
+      </para>
+
+      <para>Nulla facilisi. Morbi imperdiet varius ante. Proin enim est, tempus
+        eget, laoreet eget, aliquet nec, pede. Aliquam justo risus, luctus vel,
+        consectetuer in, sollicitudin in, lectus. Donec eu diam et dolor dapibus
+        sagittis. Aliquam aliquam, neque eget imperdiet lobortis, turpis ligula
+        elementum pede, eget sodales purus dui nec mi. Integer vel purus. Cras
+        adipiscing lobortis arcu. Integer commodo. Curabitur pretium, purus a
+        adipiscing vestibulum, lacus justo faucibus sapien, a sagittis est urna
+        sit amet est. Nullam diam. Maecenas vulputate, lacus et adipiscing
+        ultrices, tortor urna euismod arcu, in vestibulum quam nibh nec erat.
+        Quisque bibendum lorem vitae diam. Nulla lobortis. Nam porttitor, nisl et
+        convallis mollis, metus nisl euismod nisl, sed adipiscing tortor augue ut
+        leo. Donec eleifend lorem quis tellus.
+      </para>
+    </sect1>
+  </chapter>
+
+  <chapter version="5.0" xml:id="duis" xmlns="http://docbook.org/ns/docbook"
+           xmlns:xlink="http://www.w3.org/1999/xlink"
+           xmlns:xi="http://www.w3.org/2001/XInclude"
+           xmlns:svg="http://www.w3.org/2000/svg"
+           xmlns:mml="http://www.w3.org/1998/Math/MathML"
+           xmlns:html="http://www.w3.org/1999/xhtml"
+           xmlns:db="http://docbook.org/ns/docbook">
+    <db:info xml:id="duisegestas">
+      <title>Duis egestas condimentum</title>
+
+      <authorgroup>
+        <author>
+          <personname>
+            <firstname>Petri</firstname>
+            <surname>Mäkijärvi</surname>
+          </personname>
+        </author>
+
+        <author>
+          <personname>
+            <firstname>Maxwell</firstname>
+            <surname>Smart</surname>
+          </personname>
+        </author>
+      </authorgroup>
+      <pubdate>$Date: 2010/06/09 15:19:01 $</pubdate>
+
+      <releaseinfo>$Revision: 1.3 $</releaseinfo>
+    </db:info>
+
+    <sect1 xml:id="x2_consectetuer">
+      <title>Maecenas at enim</title>
+
+      <para>Aliquam erat volutpat, consectetuer adipiscing elit.
+        <indexterm>
+          <primary>Curabitur</primary>
+
+          <secondary>urna</secondary>
+
+          <seealso>Consectetuer</seealso>
+        </indexterm>
+        Curabitur urna. Maecenas eu nisi faucibus risus ornare
+        fringilla. Nam laoreet accumsan metus. Maecenas ac nunc non enim consequat
+        ultrices. Duis egestas condimentum velit. Nulla scelerisque. Nulla turpis.
+        Nam ante tortor, convallis sit amet, commodo at, dignissim at, dolor.
+        Proin sodales. Maecenas at enim. Aliquam nunc. Curabitur ullamcorper
+        molestie neque. Aliquam erat volutpat. Sed non dui et tellus ultrices
+        porttitor.
+      </para>
+
+      <para>Curabitur rutrum lobortis orci. Vivamus a urna. Nulla feugiat
+        euismod massa. In odio quam, posuere at, mattis at, pretium quis, nisi.
+        Sed eget nibh. Vestibulum ante enim, mattis at, mollis eu, ullamcorper sit
+        amet, augue. Mauris quam massa, vestibulum rhoncus, bibendum eget,
+        adipiscing at, enim. Sed pharetra. Praesent ac nibh id massa bibendum
+        elementum. Sed urna nibh, pharetra in, dapibus at, tristique at, velit.
+        Maecenas lectus. Pellentesque aliquet pharetra lacus. Aliquam et tellus.
+        Aenean gravida tristique ipsum. Duis suscipit euismod dolor. Etiam
+        facilisis mi nec risus. Nam non purus sed nibh cursus luctus. Morbi nunc
+        sem, hendrerit eu, mattis sit amet, pulvinar nec, nulla. Duis lobortis
+        metus ut orci. Curabitur facilisis.
+      </para>
+
+      <sect2 xml:id="x2_morbi">
+        <title>Curabitur nulla orci</title>
+
+        <para>Cum sociis natoque penatibus et magnis dis parturient montes,
+          nascetur ridiculus mus
+          <footnote>
+            <para>Aenean in odio et dui vestibulum eleifend. Donec aliquet
+              magna.
+            </para>
+          </footnote>
+          . Curabitur nulla orci, porta eget, tincidunt dapibus,
+          tincidunt sed, ligula. Nunc vel sapien. In nec diam fermentum purus
+          tincidunt ullamcorper:
+        </para>
+
+        <para>Donec facilisis aliquet libero. Maecenas sem dui, scelerisque
+          vitae, convallis at, gravida eu, purus. Proin quis nisl. Mauris ac purus
+          eu dolor fringilla tempus. Aliquam elementum. In a neque. Praesent
+          ipsum. Maecenas elementum magna sit amet eros. Praesent non
+          sapien.
+        </para>
+
+        <sect3 xml:id="x2_nullam">
+          <title>Maecenas bibendum</title>
+
+          <para>Nulla facilisi. Morbi imperdiet varius ante. Proin enim est, tempus
+            eget, laoreet eget, aliquet nec, pede. Aliquam justo risus, luctus vel,
+            consectetuer in, sollicitudin in, lectus. Donec eu diam et dolor dapibus
+            sagittis. Aliquam aliquam, neque eget imperdiet lobortis, turpis ligula
+            elementum pede, eget sodales purus dui nec mi. Integer vel purus. Cras
+            adipiscing lobortis arcu. Integer commodo. Curabitur pretium, purus a
+            adipiscing vestibulum, lacus justo faucibus sapien, a sagittis est urna
+            sit amet est. Nullam diam. Maecenas vulputate, lacus et adipiscing
+            ultrices, tortor urna euismod arcu, in vestibulum quam nibh nec erat.
+            Quisque bibendum lorem vitae diam. Nulla lobortis. Nam porttitor, nisl et
+            convallis mollis, metus nisl euismod nisl, sed adipiscing tortor augue ut
+            leo. Donec eleifend lorem quis tellus.
+          </para>
+
+          <para>Mauris et erat egestas libero volutpat vestibulum. Curabitur
+            viverra iaculis quam. Nulla egestas dui eget odio. Nam dictum elit in
+            massa. Phasellus nec elit. Maecenas bibendum. Lorem ipsum dolor sit
+            amet, consectetuer adipiscing elit. Nullam dapibus, erat suscipit
+            iaculis porta, turpis arcu laoreet elit, sed ultrices ligula risus eu
+            velit. Phasellus risus lorem, vulputate vitae, ultricies id, elementum
+            ut, quam. Donec augue dui, vestibulum vitae, vehicula venenatis,
+            hendrerit venenatis, mi. Sed at libero eu tortor consequat aliquam.
+            Donec odio lectus, scelerisque eget, auctor id, tincidunt ac, libero.
+            Duis interdum hendrerit arcu. Pellentesque habitant morbi tristique
+            senectus et netus et malesuada fames ac turpis egestas. Etiam
+            tincidunt feugiat purus. Nulla suscipit libero et dui. Vestibulum
+            dignissim urna a risus.
+          </para>
+        </sect3>
+      </sect2>
+
+      <sect2 xml:id="x2_vestibulum">
+        <title>faucibus orci</title>
+
+        <para>Vestibulum ante ipsum primis in faucibus orci
+          <indexterm
+              class="startofrange" xml:id="x2_luctus">
+            <primary>luctus</primary>
+
+            <secondary>ultirce</secondary>
+          </indexterm>
+          luctus et ultrice
+          <indexterm class="endofrange"
+                     startref="luctus" />
+          posuere cubilia Curae; Cras purus odio, faucibus
+          et, euismod sollicitudin, vehicula eu, urna. Mauris tempor. Vivamus sit
+          amet nisi vel dolor ultricies placerat. Nulla adipiscing feugiat erat.
+          Pellentesque vulputate posuere pede. Ut id sem at neque commodo
+          <indexterm>
+            <primary>ultricie</primary>
+          </indexterm>
+          ultricies. Suspendisse sed enim. Nulla facilisi. Proin
+          ullamcorper vestibulum tellus. Donec varius scelerisque eros.
+          Pellentesque feugiat velit et neque. Proin urna neque, interdum sed,
+          auctor sed, vulputate et, nunc. In cursus nisl. Etiam pharetra, nisl
+          quis sagittis ultricies, sapien tellus tincidunt ante, in congue mauris
+          enim eu metus. Suspendisse fringilla elementum libero. Cras nonummy sem
+          mattis tellus. Praesent faucibus sem eu dui. Nam vel lacus vitae diam
+          sollicitudin tristique. Nulla facilisi.
+        </para>
+
+        <para>Donec egestas nisl id neque. Nullam
+          <indexterm>
+            <primary>leo leo</primary>
+          </indexterm>
+          leo leo, bibendum sit amet, pellentesque sit amet,
+          sagittis eu, nibh. Praesent malesuada dictum nunc. In interdum imperdiet
+          felis. Cras rutrum leo sit amet odio. Mauris ultrices, augue sit amet
+          lacinia sollicitudin, lorem leo euismod elit, in pharetra mauris augue
+          id turpis. Vestibulum dictum sapien et sapien. Donec eleifend felis quis
+          leo fringilla consequat. Mauris vitae dolor pretium velit tincidunt
+          vehicula. Suspendisse facilisis rutrum urna. Proin viverra vulputate
+          magna. Vivamus massa nibh, eleifend condimentum, elementum eget,
+          lobortis nec, diam. Phasellus sollicitudin. Donec quis orci ornare felis
+          cursus porta. Nullam purus lectus, fringilla eu, feugiat vel, tristique
+          eu, est.
+        </para>
+      </sect2>
+    </sect1>
+
+    <sect1 xml:id="x2_donec">
+      <title>Maecenas scelerisque</title>
+
+      <para>Donec eleifend, justo ac interdum rutrum, massa ligula convallis
+        tellus, quis elementum elit lectus eu sapien. Ut metus massa, vehicula ut,
+        semper ut, eleifend eu, quam. Cras quis augue. Maecenas enim ante, cursus
+        vestibulum, consectetuer et, dictum sit amet, dolor. Phasellus ultrices
+        est id est. Maecenas scelerisque nisl quis eros. Vivamus rhoncus.
+        Pellentesque habitant morbi tristique senectus et netus et malesuada fames
+        ac turpis egestas. Mauris diam turpis, faucibus non, scelerisque sit amet,
+        porttitor a, enim. Ut bibendum pulvinar neque.
+      </para>
+
+      <para>Pellentesque lacinia, eros at dapibus rhoncus, lectus magna pharetra
+        sapien, sed convallis ligula mi a sapien. Donec tempor libero ut nibh.
+        Quisque et lectus eu arcu iaculis rutrum. Donec et ligula. Integer gravida
+        aliquam diam. Curabitur in augue non massa convallis accumsan. Mauris nisl
+        neque, dictum quis, eleifend nec, ornare a, nisl. Praesent id elit. Mauris
+        et leo at odio placerat iaculis. Morbi faucibus dictum nibh.
+      </para>
+    </sect1>
+
+    <sect1 xml:id="x2_pellentesque">
+      <title>Dignissim urna</title>
+
+      <para>Quisque molestie dignissim urna. Donec mattis pellentesque augue.
+        Nullam neque diam, bibendum ut, placerat nec, pharetra ac, eros. Sed
+        libero risus, nonummy vitae, tincidunt a, blandit ut, tortor. Nulla quis
+        libero. Vivamus ac ligula. Proin dignissim, orci ut mattis sodales, lectus
+        ligula convallis libero, sed feugiat libero odio non massa. Sed elementum.
+        Nullam id enim. Sed non arcu quis leo vulputate adipiscing. Nam et orci.
+        Integer sed nunc. Maecenas sem turpis, pulvinar ac, volutpat non,
+        ultricies rhoncus, tellus. Fusce porttitor. Nullam cursus odio vel nisi
+        elementum elementum. Integer venenatis. Sed hendrerit, tortor a semper
+        ultrices, lorem sapien lacinia erat, eu suscipit risus nisl id elit. In
+        hac habitasse platea dictumst.
+      </para>
+
+      <para>Nulla facilisi. Morbi imperdiet varius ante. Proin enim est, tempus
+        eget, laoreet eget, aliquet nec, pede. Aliquam justo risus, luctus vel,
+        consectetuer in, sollicitudin in, lectus. Donec eu diam et dolor dapibus
+        sagittis. Aliquam aliquam, neque eget imperdiet lobortis, turpis ligula
+        elementum pede, eget sodales purus dui nec mi. Integer vel purus. Cras
+        adipiscing lobortis arcu. Integer commodo. Curabitur pretium, purus a
+        adipiscing vestibulum, lacus justo faucibus sapien, a sagittis est urna
+        sit amet est. Nullam diam. Maecenas vulputate, lacus et adipiscing
+        ultrices, tortor urna euismod arcu, in vestibulum quam nibh nec erat.
+        Quisque bibendum lorem vitae diam. Nulla lobortis. Nam porttitor, nisl et
+        convallis mollis, metus nisl euismod nisl, sed adipiscing tortor augue ut
+        leo. Donec eleifend lorem quis tellus.
+      </para>
+    </sect1>
+  </chapter>
+
+  <index xml:id="index" />
+</book>
diff --git a/xml/relaxng/testData/highlighting/nested-composite.rng b/xml/relaxng/testData/highlighting/nested-composite.rng
new file mode 100644
index 0000000..76962fc
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/nested-composite.rng
@@ -0,0 +1,16 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <start>
+    <element name="foo">
+      <attribute name="name">
+        <choice>
+          <data type="string" />
+          <choice>
+            <value>id</value>
+            <value>name</value>
+            <value>content-type</value>
+          </choice>
+        </choice>
+      </attribute>
+    </element>
+  </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/nested-fragment-2.xml b/xml/relaxng/testData/highlighting/nested-fragment-2.xml
new file mode 100644
index 0000000..7426fc0
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/nested-fragment-2.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<process-definition
+    name="pagesWorkflow"
+    xmlns="urn:jbpm.org:jpdl-3.1"
+    xmlns:s="urn:intelliForm:Spaces"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="urn:jbpm.org:jpdl-3.1 jpdl-3.1.xsd">
+
+  <start-state name="Start">
+
+    <task name="start-task" />
+
+    <transition name="ZumEnde" to="Ende">
+      <script>
+        <expression>
+          java.io.ByteArrayOutputStream b = new java.io.ByteArrayOutputStream();
+          de.cit.util.java.io.StreamUtil.copy(new java.io.FileInputStream("c:\\temp\\input.odt"), b, true);
+          byte[] data = b.toByteArray();
+          attachments.createAttachment("input", "input.odt", "application/vnd.oasis.opendocument.text", data);
+
+          b = new java.io.ByteArrayOutputStream();
+          de.cit.util.java.io.StreamUtil.copy(new java.io.FileInputStream("c:\\temp\\input.xml"), b, true);
+          data = b.toByteArray();
+          attachments.createAttachment("data", "data.xml", "text/xml", data);
+        </expression>
+      </script>
+
+      <action class="de.cit.intelliform.spaces.actions.PagesRenderAction" config-type="constructor">
+        <s:input-document>input</s:input-document>
+        <s:data-document>data</s:data-document>
+        <s:output-document>output</s:output-document>
+        <s:output-type>application/pdf</s:output-type>
+        <s:output-name>Created-by-Pages.pdf</s:output-name>
+      </action>
+
+      <action class="de.cit.intelliform.spaces.actions.SaveAttachmentsAction" config-type="constructor">
+        <f:attachments xmlns:f="urn:intelliForm:AttachmentFilter">
+          <f:and>
+            <f:property-filter name="id" value="output" />
+
+            <f:filter>
+              <f:expression>System.out.println("id = " + attachment.getId()); return "true";</f:expression>
+            </f:filter>
+
+            <f:not>
+              <f:property-filter name="name" value="*.exe" />
+            </f:not>
+
+            <f:not>
+              <f:default-filter />
+            </f:not>
+
+            <f:property-filter name="content-type" value="application/pdf" />
+
+            <f:and>
+              <f:size-filter max="200" unit="kb" />
+            </f:and>
+          </f:and>
+        </f:attachments>
+      </action>
+
+      <!--
+            <action class="de.cit.intelliform.spaces.actions.SaveFileAction" config-type="constructor">
+              <s:name>output.pdf</s:name>
+              <s:attachmentId>output</s:attachmentId>
+            </action>
+      -->
+
+      <action class="de.cit.intelliform.spaces.actions.SetFolderMessageAction" config-type="constructor">
+        <s:type>INFO</s:type>
+        <s:message>Glückwunsch, Saschas Workflow!</s:message>
+      </action>
+
+    </transition>
+
+  </start-state>
+
+
+  <end-state name="Ende" />
+
+</process-definition>
diff --git a/xml/relaxng/testData/highlighting/nested-fragment.xml b/xml/relaxng/testData/highlighting/nested-fragment.xml
new file mode 100644
index 0000000..4b48d47
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/nested-fragment.xml
@@ -0,0 +1,7 @@
+<outer xmlns="urn:test:undefined">
+  <optional-element xmlns="urn:test:simple.rng">
+    <b>
+      <c />
+    </b>
+  </optional-element>
+</outer>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/optional-attribute_1.xml b/xml/relaxng/testData/highlighting/optional-attribute_1.xml
new file mode 100644
index 0000000..23a34ce
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/optional-attribute_1.xml
@@ -0,0 +1,2 @@
+<optional-attribute xmlns="urn:test:simple.rng">
+</optional-attribute>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/optional-attribute_2.xml b/xml/relaxng/testData/highlighting/optional-attribute_2.xml
new file mode 100644
index 0000000..e9d8157
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/optional-attribute_2.xml
@@ -0,0 +1,2 @@
+<optional-attribute xmlns="urn:test:simple.rng" x="abc" <error>y</error>="abc">
+</optional-attribute>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/optional-element_1.xml b/xml/relaxng/testData/highlighting/optional-element_1.xml
new file mode 100644
index 0000000..9b035d4
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/optional-element_1.xml
@@ -0,0 +1,5 @@
+<optional-element xmlns="urn:test:simple.rng">
+  <b>
+    <c />
+  </b>
+</optional-element>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/relaxng.rng b/xml/relaxng/testData/highlighting/relaxng.rng
new file mode 100644
index 0000000..f6d1618
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/relaxng.rng
@@ -0,0 +1,335 @@
+<?xml version="1.0"?>
+<!-- RELAX NG for RELAX NG -->
+<!-- $Id: relaxng.rng,v 1.1 2007/07/25 21:36:59 sweinreuter Exp $ -->
+<grammar datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
+         ns="http://relaxng.org/ns/structure/1.0"
+         xmlns="http://relaxng.org/ns/structure/1.0">
+  <start>
+    <ref name="pattern"/>
+  </start>
+
+  <define name="pattern">
+    <choice>
+      <element name="element">
+        <choice>
+          <attribute name="name">
+            <data type="QName"/>
+          </attribute>
+          <ref name="open-name-class"/>
+        </choice>
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="attribute">
+        <ref name="common-atts"/>
+        <choice>
+	  <attribute name="name">
+	    <data type="QName"/>
+	  </attribute>
+          <ref name="open-name-class"/>
+        </choice>
+        <interleave>
+          <ref name="other"/>
+          <optional>
+            <ref name="pattern"/>
+          </optional>
+        </interleave>
+      </element>
+      <element name="group">
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="interleave">
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="choice">
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="optional">
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="zeroOrMore">
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="oneOrMore">
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="list">
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="mixed">
+        <ref name="common-atts"/>
+        <ref name="open-patterns"/>
+      </element>
+      <element name="ref">
+        <attribute name="name">
+          <data type="NCName"/>
+        </attribute>
+        <ref name="common-atts"/>
+        <ref name="other"/>
+      </element>
+      <element name="parentRef">
+        <attribute name="name">
+          <data type="NCName"/>
+        </attribute>
+        <ref name="common-atts"/>
+        <ref name="other"/>
+      </element>
+      <element name="empty">
+        <ref name="common-atts"/>
+        <ref name="other"/>
+      </element>
+      <element name="text">
+        <ref name="common-atts"/>
+        <ref name="other"/>
+      </element>
+      <element name="value">
+        <optional>
+          <attribute name="type">
+            <data type="NCName"/>
+          </attribute>
+        </optional>
+        <ref name="common-atts"/>
+        <text/>
+      </element>
+      <element name="data">
+        <attribute name="type">
+          <data type="NCName"/>
+        </attribute>
+        <ref name="common-atts"/>
+        <interleave>
+          <ref name="other"/>
+          <group>
+	    <zeroOrMore>
+	      <element name="param">
+		<attribute name="name">
+		  <data type="NCName"/>
+		</attribute>
+                <ref name="common-atts"/>
+		<text/>
+	      </element>
+	    </zeroOrMore>
+            <optional>
+              <element name="except">
+		<ref name="common-atts"/>
+		<ref name="open-patterns"/>
+              </element>
+            </optional>
+          </group>
+        </interleave>
+      </element>
+      <element name="notAllowed">
+        <ref name="common-atts"/>
+        <ref name="other"/>
+      </element>
+      <element name="externalRef">
+        <attribute name="href">
+          <data type="anyURI"/>
+        </attribute>
+        <ref name="common-atts"/>
+        <ref name="other"/>
+      </element>
+      <element name="grammar">
+        <ref name="common-atts"/>
+        <ref name="grammar-content"/>
+      </element>
+    </choice>
+  </define>
+
+  <define name="grammar-content">
+    <interleave>
+      <ref name="other"/>
+      <zeroOrMore>
+        <choice>
+          <ref name="start-element"/>
+          <ref name="define-element"/>
+          <element name="div">
+            <ref name="common-atts"/>
+            <ref name="grammar-content"/>
+          </element>
+          <element name="include">
+            <attribute name="href">
+              <data type="anyURI"/>
+            </attribute>
+            <ref name="common-atts"/>
+            <ref name="include-content"/>
+          </element>
+        </choice>
+      </zeroOrMore>
+    </interleave>
+  </define>
+
+  <define name="include-content">
+    <interleave>
+      <ref name="other"/>
+      <zeroOrMore>
+        <choice>
+          <ref name="start-element"/>
+          <ref name="define-element"/>
+          <element name="div">
+            <ref name="common-atts"/>
+            <ref name="include-content"/>
+          </element>
+        </choice>
+      </zeroOrMore>
+    </interleave>
+  </define>
+
+  <define name="start-element">
+    <element name="start">
+      <ref name="combine-att"/>
+      <ref name="common-atts"/>
+      <ref name="open-pattern"/>
+    </element>
+  </define>
+
+  <define name="define-element">
+    <element name="define">
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+      <ref name="combine-att"/>
+      <ref name="common-atts"/>
+      <ref name="open-patterns"/>
+    </element>
+  </define>
+
+  <define name="combine-att">
+    <optional>
+      <attribute name="combine">
+        <choice>
+          <value>choice</value>
+          <value>interleave</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  
+  <define name="open-patterns">
+    <interleave>
+      <ref name="other"/>
+      <oneOrMore>
+        <ref name="pattern"/>
+      </oneOrMore>
+    </interleave>
+  </define>
+
+  <define name="open-pattern">
+    <interleave>
+      <ref name="other"/>
+      <ref name="pattern"/>
+    </interleave>
+  </define>
+
+  <define name="name-class">
+    <choice>
+      <element name="name">
+        <ref name="common-atts"/>
+        <data type="QName"/>
+      </element>
+      <element name="anyName">
+        <ref name="common-atts"/>
+        <ref name="except-name-class"/>
+      </element>
+      <element name="nsName">
+        <ref name="common-atts"/>
+        <ref name="except-name-class"/>
+      </element>
+      <element name="choice">
+        <ref name="common-atts"/>
+        <ref name="open-name-classes"/>
+      </element>
+    </choice>
+  </define>
+
+  <define name="except-name-class">
+    <interleave>
+      <ref name="other"/>
+      <optional>
+        <element name="except">
+          <ref name="open-name-classes"/>
+        </element>
+      </optional>
+    </interleave>
+  </define>
+
+  <define name="open-name-classes">
+    <interleave>
+      <ref name="other"/>
+      <oneOrMore>
+        <ref name="name-class"/>
+      </oneOrMore>
+    </interleave>
+  </define>
+
+  <define name="open-name-class">
+    <interleave>
+      <ref name="other"/>
+      <ref name="name-class"/>
+    </interleave>
+  </define>
+
+  <define name="common-atts">
+    <optional>
+      <attribute name="ns"/>
+    </optional>
+    <optional>
+      <attribute name="datatypeLibrary">
+        <data type="anyURI"/>
+      </attribute>
+    </optional>
+    <zeroOrMore>
+      <attribute>
+        <anyName>
+          <except>
+            <nsName/>
+            <nsName ns=""/>
+          </except>
+        </anyName>
+      </attribute>
+    </zeroOrMore>
+  </define>
+
+  <define name="other">
+    <zeroOrMore>
+      <element>
+        <anyName>
+          <except>
+            <nsName/>
+          </except>
+        </anyName>
+        <zeroOrMore>
+          <choice>
+            <attribute>
+              <anyName/>
+            </attribute>
+            <text/>
+            <ref name="any"/>
+          </choice>
+        </zeroOrMore>
+      </element>
+    </zeroOrMore>
+  </define>
+
+  <define name="any">
+    <element>
+      <anyName/>
+      <zeroOrMore>
+        <choice>
+          <attribute>
+            <anyName/>
+          </attribute>
+          <text/>
+          <ref name="any"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+
+</grammar>
diff --git a/xml/relaxng/testData/highlighting/rnc/addressbook.rnc b/xml/relaxng/testData/highlighting/rnc/addressbook.rnc
new file mode 100644
index 0000000..abce028
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/addressbook.rnc
@@ -0,0 +1,10 @@
+default namespace = "urn:test:addressBook"
+
+element addressBook {
+  element card {
+    (attribute name { text }
+     | (attribute givenName { text },
+        attribute familyName { text })),
+    attribute email { text }
+  }*
+}
diff --git a/xml/relaxng/testData/highlighting/rnc/annotation.rnc b/xml/relaxng/testData/highlighting/rnc/annotation.rnc
new file mode 100644
index 0000000..1804595
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/annotation.rnc
@@ -0,0 +1,9 @@
+namespace a = "http://www.example.com/annotation"
+
+element addressBook {
+  [ a:documentation [ xml:lang="en" "Information about a single address." ] ]
+  element card {
+    element name { text },
+    element email { text }
+  }*
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/backward-include-def.rnc b/xml/relaxng/testData/highlighting/rnc/backward-include-def.rnc
new file mode 100644
index 0000000..6724dc7b
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/backward-include-def.rnc
@@ -0,0 +1,6 @@
+default namespace = "backward-include-def.rng"
+
+include "backward-include-ref.rnc"
+start = element t { foo }
+foo = element foo { backward }
+backward = element x { empty }
diff --git a/xml/relaxng/testData/highlighting/rnc/backward-include-ref.rnc b/xml/relaxng/testData/highlighting/rnc/backward-include-ref.rnc
new file mode 100644
index 0000000..1417891
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/backward-include-ref.rnc
@@ -0,0 +1,3 @@
+default namespace = "backward-include-def.rng"
+
+foo |= element bar { backward }
diff --git a/xml/relaxng/testData/highlighting/rnc/bad-element.xml b/xml/relaxng/testData/highlighting/rnc/bad-element.xml
new file mode 100644
index 0000000..c6fe83f
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/bad-element.xml
@@ -0,0 +1,3 @@
+<addressBook xmlns="urn:test:addressBook">
+  <<error descr="Element foo is not allowed here">foo</error> />
+</addressBook>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/bad-parent-ref-1.rnc b/xml/relaxng/testData/highlighting/rnc/bad-parent-ref-1.rnc
new file mode 100644
index 0000000..cc3a641
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/bad-parent-ref-1.rnc
@@ -0,0 +1,8 @@
+grammar {
+  start = foo
+
+  foo = grammar {
+    x = element bar { parent <error>outer</error> }
+    outer = attribute outer.att { text }
+  }
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/create-datatypes-prefix-1.rnc b/xml/relaxng/testData/highlighting/rnc/create-datatypes-prefix-1.rnc
new file mode 100644
index 0000000..14b82c4
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/create-datatypes-prefix-1.rnc
@@ -0,0 +1 @@
+a = element foo { <caret>xxx:string }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/create-datatypes-prefix-1_after.rnc b/xml/relaxng/testData/highlighting/rnc/create-datatypes-prefix-1_after.rnc
new file mode 100644
index 0000000..6453a73
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/create-datatypes-prefix-1_after.rnc
@@ -0,0 +1,2 @@
+datatypes xxx = ""
+a = element foo { xxx:string }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/create-definition-1.rnc b/xml/relaxng/testData/highlighting/rnc/create-definition-1.rnc
new file mode 100644
index 0000000..06e3aac
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/create-definition-1.rnc
@@ -0,0 +1,2 @@
+
+start = <caret>doesntexist
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/create-definition-1_after.rnc b/xml/relaxng/testData/highlighting/rnc/create-definition-1_after.rnc
new file mode 100644
index 0000000..b9b44ab
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/create-definition-1_after.rnc
@@ -0,0 +1,3 @@
+
+start = doesntexist
+doesntexist = <caret>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/create-definition-2.rnc b/xml/relaxng/testData/highlighting/rnc/create-definition-2.rnc
new file mode 100644
index 0000000..8d41409
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/create-definition-2.rnc
@@ -0,0 +1,5 @@
+
+foo = grammar {
+  start = parent <caret>unresolved
+}
+bar = element bar { empty }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/create-definition-2_after.rnc b/xml/relaxng/testData/highlighting/rnc/create-definition-2_after.rnc
new file mode 100644
index 0000000..669f6c4
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/create-definition-2_after.rnc
@@ -0,0 +1,6 @@
+
+foo = grammar {
+  start = parent unresolved
+}
+bar = element bar { empty }
+unresolved = 
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/create-ns-prefix-1.rnc b/xml/relaxng/testData/highlighting/rnc/create-ns-prefix-1.rnc
new file mode 100644
index 0000000..7dcf4e3
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/create-ns-prefix-1.rnc
@@ -0,0 +1 @@
+a = element <caret>xxx:foo { }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/create-ns-prefix-1_after.rnc b/xml/relaxng/testData/highlighting/rnc/create-ns-prefix-1_after.rnc
new file mode 100644
index 0000000..fef6eef
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/create-ns-prefix-1_after.rnc
@@ -0,0 +1,2 @@
+namespace xxx = ""
+a = element xxx:foo { }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/datatype-prefix.rnc b/xml/relaxng/testData/highlighting/rnc/datatype-prefix.rnc
new file mode 100644
index 0000000..8214bf8
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/datatype-prefix.rnc
@@ -0,0 +1,3 @@
+datatypes xxx = "yyy"
+
+element foo { xxx:string }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/docbook.rnc b/xml/relaxng/testData/highlighting/rnc/docbook.rnc
new file mode 100644
index 0000000..219b6ac
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/docbook.rnc
@@ -0,0 +1,10639 @@
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+namespace ctrl = "http://nwalsh.com/xmlns/schema-control/"
+default namespace db = "http://docbook.org/ns/docbook"
+namespace html = "http://www.w3.org/1999/xhtml"
+namespace mml = "http://www.w3.org/1998/Math/MathML"
+namespace rng = "http://relaxng.org/ns/structure/1.0"
+namespace s = "http://www.ascc.net/xml/schematron"
+namespace svg = "http://www.w3.org/2000/svg"
+namespace xlink = "http://www.w3.org/1999/xlink"
+s:ns [
+  prefix = "a"
+  uri = "http://relaxng.org/ns/compatibility/annotations/1.0"
+]
+s:ns [ prefix = "ctrl" uri = "http://nwalsh.com/xmlns/schema-control/" ]
+s:ns [ prefix = "db" uri = "http://docbook.org/ns/docbook" ]
+s:ns [
+  prefix = "dbx"
+  uri =
+    "http://sourceforge.net/projects/docbook/defguide/schema/extra-markup"
+]
+s:ns [ prefix = "html" uri = "http://www.w3.org/1999/xhtml" ]
+s:ns [ prefix = "mml" uri = "http://www.w3.org/1998/Math/MathML" ]
+s:ns [ prefix = "rng" uri = "http://relaxng.org/ns/structure/1.0" ]
+s:ns [ prefix = "s" uri = "http://www.ascc.net/xml/schematron" ]
+s:ns [ prefix = "svg" uri = "http://www.w3.org/2000/svg" ]
+s:ns [ prefix = "xlink" uri = "http://www.w3.org/1999/xlink" ]
+
+#  DocBook V5.0CR5
+
+# See http://docbook.org/ns/docbook
+
+# This file is part of DocBook V5.0CR5
+# 
+# Copyright 1992-2005 HaL Computer Systems, Inc.,
+# O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+# Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+# Organization for the Advancement of Structured Information
+# Standards (OASIS).
+# 
+# Release: $Id: docbook.rnc,v 1.1 2007/08/24 17:36:05 sweinreuter Exp $
+# 
+# Permission to use, copy, modify and distribute the DocBook schema
+# and its accompanying documentation for any purpose and without fee
+# is hereby granted in perpetuity, provided that the above copyright
+# notice and this paragraph appear in all copies. The copyright
+# holders make no representation about the suitability of the schema
+# for any purpose. It is provided "as is" without expressed or implied
+# warranty.
+# 
+# If you modify the DocBook schema in any way, label your schema as a
+# variant of DocBook. See the reference documentation
+# (http://docbook.org/tdg5/en/html/ch05.html#s-notdocbook)
+# for more information.
+# 
+# Please direct all questions, bug reports, or suggestions for changes
+# to the [email protected] mailing list. For more
+# information, see http://www.oasis-open.org/docbook/.
+# 
+# ======================================================================
+start =
+  (db.set
+   | db.book
+   | db.divisions
+   | db.components
+   | db.navigation.components
+   | db.section
+   | db.para)
+  | (db.sect1 | db.sect2 | db.sect3 | db.sect4 | db.sect5)
+  | (db.refentry | db.refsection)
+  | (db.refsect1 | db.refsect2 | db.refsect3)
+  | db.setindex
+div {
+  db._any.attribute =
+    
+    ## Any attribute including in any attribute in any namespace.
+    attribute * { text }
+  db._any =
+    
+    ## Any element from almost any namespace
+    element * - (db:* | html:*) {
+      (db._any.attribute | text | db._any)*
+    }
+}
+db.arch.attribute =
+  
+  ## Designates the computer or chip architecture to which the element applies
+  attribute arch { text }
+db.audience.attribute =
+  
+  ## Designates the intended audience to which the element applies, for example, system administrators, programmers, or new users.
+  attribute audience { text }
+db.condition.attribute =
+  
+  ## provides a standard place for application-specific effectivity
+  attribute condition { text }
+db.conformance.attribute =
+  
+  ## Indicates standards conformance characteristics of the element
+  attribute conformance { text }
+db.os.attribute =
+  
+  ## Indicates the operating system to which the element is applicable
+  attribute os { text }
+db.revision.attribute =
+  
+  ## Indicates the editorial revision to which the element belongs
+  attribute revision { text }
+db.security.attribute =
+  
+  ## Indicates something about the security level associated with the element to which it applies
+  attribute security { text }
+db.userlevel.attribute =
+  
+  ## Indicates the level of user experience for which the element applies
+  attribute userlevel { text }
+db.vendor.attribute =
+  
+  ## Indicates the computer vendor to which the element applies.
+  attribute vendor { text }
+db.wordsize.attribute =
+  
+  ## Indicates the word size (width in bits) of the computer architecture to which the element applies
+  attribute wordsize { text }
+db.effectivity.attributes =
+  db.arch.attribute?
+  & db.audience.attribute?
+  & db.condition.attribute?
+  & db.conformance.attribute?
+  & db.os.attribute?
+  & db.revision.attribute?
+  & db.security.attribute?
+  & db.userlevel.attribute?
+  & db.vendor.attribute?
+  & db.wordsize.attribute?
+db.endterm.attribute =
+  
+  ## Points to the element whose content is to be used as the text of the link
+  attribute endterm { xsd:IDREF }
+db.linkend.attribute =
+  
+  ## Points to an internal link target by identifying the value of its xml:id attribute
+  attribute linkend { xsd:IDREF }
+db.linkends.attribute =
+  
+  ## Points to one or more internal link targets by identifying the value of their xml:id attributes
+  attribute linkends { xsd:IDREFS }
+db.xlink.href.attribute =
+  
+  ## Identifies a link target with a URI
+  attribute xlink:href { xsd:anyURI }
+db.xlink.type.attribute =
+  
+  ## Identifies the XLink link type
+  attribute xlink:type {
+    
+    ## An XLink simple link
+    "simple"
+  }
+db.xlink.role.attribute =
+  
+  ## Identifies the XLink role of the link
+  attribute xlink:role { xsd:anyURI }
+db.xlink.arcrole.attribute =
+  
+  ## Identifies the XLink arcrole of the link
+  attribute xlink:arcrole { xsd:anyURI }
+db.xlink.title.attribute =
+  
+  ## Identifies the XLink title of the link
+  attribute xlink:title { text }?
+db.xlink.show.enumeration =
+  
+  ## An application traversing to the ending resource should load it in a new window, frame, pane, or other relevant presentation context.
+  "new"
+  | 
+    ## An application traversing to the ending resource should load the resource in the same window, frame, pane, or other relevant presentation context in which the starting resource was loaded.
+    "replace"
+  | 
+    ## An application traversing to the ending resource should load its presentation in place of the presentation of the starting resource.
+    "embed"
+  | 
+    ## The behavior of an application traversing to the ending resource is unconstrained by XLink. The application should look for other markup present in the link to determine the appropriate behavior.
+    "other"
+  | 
+    ## The behavior of an application traversing to the ending resource is unconstrained by this specification. No other markup is present to help the application determine the appropriate behavior.
+    "none"
+db.xlink.show.attribute =
+  
+  ## Identifies the XLink show behavior of the link
+  attribute xlink:show { db.xlink.show.enumeration }
+db.xlink.actuate.enumeration =
+  
+  ## An application should traverse to the ending resource immediately on loading the starting resource.
+  "onLoad"
+  | 
+    ## An application should traverse from the starting resource to the ending resource only on a post-loading event triggered for the purpose of traversal.
+    "onRequest"
+  | 
+    ## The behavior of an application traversing to the ending resource is unconstrained by this specification. The application should look for other markup present in the link to determine the appropriate behavior.
+    "other"
+  | 
+    ## The behavior of an application traversing to the ending resource is unconstrained by this specification. No other markup is present to help the application determine the appropriate behavior.
+    "none"
+db.xlink.actuate.attribute =
+  
+  ## Identifies the XLink actuate behavior of the link
+  attribute xlink:actuate { db.xlink.actuate.enumeration }
+db.href.attributes =
+  db.xlink.href.attribute
+  & db.xlink.type.attribute?
+  & db.xlink.role.attribute?
+  & db.xlink.arcrole.attribute?
+  & db.xlink.title.attribute?
+  & db.xlink.show.attribute?
+  & db.xlink.actuate.attribute?
+db.xml.id.attribute =
+  
+  ## Identifies the unique ID value of the element
+  attribute xml:id { xsd:ID }
+db.version.attribute =
+  
+  ## Specifies the DocBook version of the element and its descendants
+  attribute version { text }
+db.xml.lang.attribute =
+  
+  ## Specifies the natural language of the element and its descendants
+  attribute xml:lang { text }
+db.xml.base.attribute =
+  
+  ## Specifies the base URI of the element and its descendants
+  attribute xml:base { xsd:anyURI }
+db.remap.attribute =
+  
+  ## Provides the name or similar semantic identifier assigned to the content in some previous markup scheme
+  attribute remap { text }
+db.xreflabel.attribute =
+  
+  ## Provides the text that is to be generated for a cross reference to the element
+  attribute xreflabel { text }
+db.xrefstyle.attribute =
+  
+  ## Specifies a keyword or keywords identifying additional style information
+  attribute xrefstyle { text }
+db.revisionflag.enumeration =
+  
+  ## The element has been changed.
+  "changed"
+  | 
+    ## The element is new (has been added to the document).
+    "added"
+  | 
+    ## The element has been deleted.
+    "deleted"
+  | 
+    ## Explicitly turns off revision markup for this element.
+    "off"
+db.revisionflag.attribute =
+  
+  ## Identifies the revision status of the element
+  attribute revisionflag { db.revisionflag.enumeration }
+db.dir.enumeration =
+  
+  ## Left-to-right text
+  "ltr"
+  | 
+    ## Right-to-left text
+    "rtl"
+  | 
+    ## Left-to-right override
+    "lro"
+  | 
+    ## Right-to-left override
+    "rlo"
+db.dir.attribute =
+  
+  ## Identifies the direction of text in an element
+  attribute dir { db.dir.enumeration }
+db.common.base.attributes =
+  db.version.attribute?
+  & db.xml.lang.attribute?
+  & db.xml.base.attribute?
+  & db.remap.attribute?
+  & db.xreflabel.attribute?
+  & db.revisionflag.attribute?
+  & db.dir.attribute?
+  & db.effectivity.attributes
+db.common.attributes =
+  db.xml.id.attribute?
+  & db.common.base.attributes
+  & db.annotations.attribute?
+db.common.idreq.attributes =
+  db.xml.id.attribute
+  & db.common.base.attributes
+  & db.annotations.attribute?
+db.common.linking.attributes =
+  (db.linkend.attribute | db.href.attributes)?
+db.common.req.linking.attributes =
+  db.linkend.attribute | db.href.attributes
+db.common.data.attributes =
+  
+  ## Specifies the format of the data
+  attribute format { text }?,
+  (
+   ## Indentifies the location of the data by URI
+   attribute fileref { xsd:anyURI }
+   | 
+     ## Identifies the location of the data by external identifier (entity name)
+     attribute entityref { xsd:ENTITY })
+db.verbatim.continuation.enumeration =
+  
+  ## Line numbering continues from the immediately preceding element with the same name.
+  "continues"
+  | 
+    ## Line numbering restarts (begins at 1, usually).
+    "restarts"
+db.verbatim.continuation.attribute =
+  
+  ## Determines whether line numbering continues from the previous element or restarts.
+  attribute continuation { db.verbatim.continuation.enumeration }
+db.verbatim.linenumbering.enumeration =
+  
+  ## Lines are numbered.
+  "numbered"
+  | 
+    ## Lines are not numbered.
+    "unnumbered"
+db.verbatim.linenumbering.attribute =
+  
+  ## Determines whether lines are numbered.
+  attribute linenumbering { db.verbatim.linenumbering.enumeration }
+db.verbatim.startinglinenumber.attribute =
+  
+  ## Specifies the initial line number.
+  attribute startinglinenumber { xsd:integer }
+db.verbatim.language.attribute =
+  
+  ## Identifies the language (i.e. programming language) of the verbatim content.
+  attribute language { text }
+db.verbatim.xml.space.attribute =
+  
+  ## Can be used to indicate explicitly that whitespace in the verbatim environment is preserved. Whitespace must always be preserved in verbatim environments whether this attribute is specified or not.
+  attribute xml:space {
+    
+    ## Whitespace must be preserved.
+    "preserve"
+  }
+db.verbatim.attributes =
+  db.verbatim.continuation.attribute?
+  & db.verbatim.linenumbering.attribute?
+  & db.verbatim.startinglinenumber.attribute?
+  & db.verbatim.language.attribute?
+  & db.verbatim.xml.space.attribute?
+db.label.attribute =
+  
+  ## Specifies an identifying string for presentation purposes
+  attribute label { text }
+db.width.characters.attribute =
+  
+  ## Specifies the width (in characters) of the element
+  attribute width { xsd:nonNegativeInteger }
+db.spacing.enumeration =
+  
+  ## The spacing should be "compact".
+  "compact"
+  | 
+    ## The spacing should be "normal".
+    "normal"
+db.spacing.attribute =
+  
+  ## Specifies (a hint about) the spacing of the content
+  attribute spacing { db.spacing.enumeration }
+db.pgwide.enumeration =
+  
+  ## The element should be rendered in the current text flow (with the flow column width).
+  "0"
+  | 
+    ## The element should be rendered across the full text page.
+    "1"
+db.pgwide.attribute =
+  
+  ## Indicates if the element is rendered across the column or the page
+  attribute pgwide { db.pgwide.enumeration }
+db.language.attribute =
+  
+  ## Identifies the language (i.e. programming language) of the content.
+  attribute language { text }
+db.performance.enumeration =
+  
+  ## The content describes an optional step or steps.
+  "optional"
+  | 
+    ## The content describes a required step or steps.
+    "required"
+db.performance.attribute =
+  
+  ## Specifies if the content is required or optional.
+  attribute performance { db.performance.enumeration }
+db.floatstyle.attribute =
+  
+  ## Specifies style information to be used when rendering the float
+  attribute floatstyle { text }
+db.width.attribute =
+  
+  ## Specifies the width of the element
+  attribute width { text }
+db.depth.attribute =
+  
+  ## Specifies the depth of the element
+  attribute depth { text }
+db.contentwidth.attribute =
+  
+  ## Specifies the width of the content rectangle
+  attribute contentwidth { text }
+db.contentdepth.attribute =
+  
+  ## Specifies the depth of the content rectangle
+  attribute contentdepth { text }
+db.scalefit.enumeration =
+  
+  ## False (do not scale-to-fit; anamorphic scaling may occur)
+  "0"
+  | 
+    ## True (scale-to-fit; anamorphic scaling is forbidden)
+    "1"
+db.scale.attribute =
+  
+  ## Specifies the scaling factor
+  attribute scale { xsd:positiveInteger }
+db.halign.enumeration =
+  
+  ## Centered horizontally
+  "center"
+  | 
+    ## Aligned horizontally on the specified character
+    "char"
+  | 
+    ## Fully justified (left and right margins or edges)
+    "justify"
+  | 
+    ## Left aligned
+    "left"
+  | 
+    ## Right aligned
+    "right"
+db.valign.enumeration =
+  
+  ## Aligned on the bottom of the region
+  "bottom"
+  | 
+    ## Centered vertically
+    "middle"
+  | 
+    ## Aligned on the top of the region
+    "top"
+db.biblio.class.enumeration =
+  
+  ## A document object identifier.
+  "doi"
+  | 
+    ## An international standard book number.
+    "isbn"
+  | 
+    ## An international standard technical report number (ISO 10444).
+    "isrn"
+  | 
+    ## An international standard serial number.
+    "issn"
+  | 
+    ## A Library of Congress reference number.
+    "libraryofcongress"
+  | 
+    ## A publication number (an internal number or possibly organizational standard).
+    "pubsnumber"
+  | 
+    ## A Uniform Resource Identifier
+    "uri"
+db.biblio.class-enum.attribute =
+  
+  ## Identifies the kind of bibliographic identifier
+  attribute class { db.biblio.class.enumeration }?
+db.biblio.class-other.attribute =
+  
+  ## Identifies the nature of the non-standard bibliographic identifier
+  attribute otherclass { xsd:NMTOKEN }
+db.biblio.class-other.attributes =
+  
+  ## Identifies the kind of bibliographic identifier
+  attribute class {
+    
+    ## Indicates that the identifier is some 'other' kind.
+    "other"
+  }
+  & db.biblio.class-other.attribute
+db.biblio.class.attribute =
+  db.biblio.class-enum.attribute | db.biblio.class-other.attributes
+db.ubiq.inlines =
+  (db.inlinemediaobject
+   | db.remark
+   | db.superscript
+   | db.subscript
+   | db.link.inlines
+   | db.alt)
+  | db.annotation
+  | db.indexterm
+db._text = (text | db.ubiq.inlines | db._phrase | db.replaceable)*
+db._title = db.title? & db.titleabbrev? & db.subtitle?
+db._title.req = db.title & db.titleabbrev? & db.subtitle?
+db._title.only = db.title? & db.titleabbrev?
+db._title.onlyreq = db.title & db.titleabbrev?
+db._info = (db._title.req?, db.titleforbidden.info?) | db.info?
+db._info.title.req =
+  (db._title.req, db.titleforbidden.info?) | db.titlereq.info
+db._info.title.only =
+  (db._title.only, db.titleforbidden.info?) | db.titleonly.info
+db._info.title.onlyreq =
+  (db._title.onlyreq, db.titleforbidden.info?) | db.titleonlyreq.info
+db._info.title.forbidden = db.titleforbidden.info?
+db.all.inlines =
+  text
+  | db.ubiq.inlines
+  | db.general.inlines
+  | db.domain.inlines
+  | db.extension.inlines
+db.general.inlines =
+  db.publishing.inlines
+  | db.product.inlines
+  | db.bibliography.inlines
+  | db.graphic.inlines
+  | db.indexing.inlines
+  | db.link.inlines
+db.domain.inlines =
+  (db.technical.inlines
+   | db.error.inlines
+   | db.os.inlines
+   | db.programming.inlines
+   | db.markup.inlines
+   | db.gui.inlines
+   | db.keyboard.inlines)
+  | db.math.inlines
+db.technical.inlines =
+  (db.replaceable
+   | db.systemitem
+   | db.option
+   | db.optional
+   | db.package
+   | db.parameter
+   | db.property)
+  | db.termdef
+  | db.nonterminal
+db.error.inlines =
+  db.errorcode | db.errortext | db.errorname | db.errortype
+db.oo.inlines = db.ooclass | db.ooexception | db.oointerface
+db.programming.inlines =
+  db.function
+  | db.parameter
+  | db.varname
+  | db.returnvalue
+  | db.type
+  | db.classname
+  | db.exceptionname
+  | db.interfacename
+  | db.methodname
+  | db.modifier
+  | db.initializer
+  | db.oo.inlines
+db.product.inlines =
+  db.productnumber
+  | db.productname
+  | db.database
+  | db.application
+  | db.hardware
+  | db.trademark
+db.os.inlines =
+  db.prompt
+  | db.envar
+  | db.filename
+  | db.command
+  | db.computeroutput
+  | db.userinput
+db.markup.inlines =
+  db.tag
+  | db.markup
+  | db.token
+  | db.symbol
+  | db.literal
+  | db.code
+  | db.constant
+  | db.email
+  | db.uri
+db.bibliography.inlines =
+  db.citation
+  | db.citerefentry
+  | db.citetitle
+  | db.citebiblioid
+  | db.author
+  | db.person
+  | db.personname
+  | db.org
+  | db.orgname
+  | db.editor
+  | db.jobtitle
+db.publishing.inlines =
+  (db.abbrev
+   | db.acronym
+   | db.date
+   | db.emphasis
+   | db.footnote
+   | db.footnoteref
+   | db.foreignphrase
+   | db.phrase
+   | db.quote
+   | db.subscript
+   | db.superscript
+   | db.wordasword)
+  | db.glossary.inlines
+  | db.coref
+db.graphic.inlines = db.inlinemediaobject
+db.indexing.inlines = notAllowed | db.indexterm
+db.gui.inlines =
+  db.guiicon
+  | db.guibutton
+  | db.guimenuitem
+  | db.guimenu
+  | db.guisubmenu
+  | db.guilabel
+  | db.menuchoice
+  | db.mousebutton
+db.keyboard.inlines =
+  db.keycombo
+  | db.keycap
+  | db.keycode
+  | db.keysym
+  | db.shortcut
+  | db.accel
+db.link.inlines =
+  (db.xref | db.link | db.olink | db.anchor) | db.biblioref
+db.extension.inlines = notAllowed
+db.nopara.blocks =
+  (db.list.blocks
+   | db.admonition.blocks
+   | db.formal.blocks
+   | db.informal.blocks
+   | db.publishing.blocks
+   | db.graphic.blocks
+   | db.technical.blocks
+   | db.verbatim.blocks
+   | db.synopsis.blocks
+   | db.bridgehead
+   | db.remark
+   | db.revhistory)
+  | db.indexterm
+db.para.blocks = db.anchor | db.para | db.formalpara | db.simpara
+db.all.blocks =
+  (db.nopara.blocks | db.para.blocks | db.extension.blocks)
+  | db.annotation
+db.formal.blocks = (db.example | db.figure | db.table) | db.equation
+db.informal.blocks =
+  (db.informalexample | db.informalfigure | db.informaltable)
+  | db.informalequation
+db.publishing.blocks =
+  db.sidebar | db.blockquote | db.address | db.epigraph
+db.graphic.blocks = db.mediaobject | db.screenshot
+db.technical.blocks =
+  db.procedure
+  | db.task
+  | (db.productionset | db.constraintdef)
+  | db.msgset
+db.admonition.blocks =
+  db.caution | db.important | db.note | db.tip | db.warning
+db.list.blocks =
+  (db.itemizedlist
+   | db.orderedlist
+   | db.procedure
+   | db.simplelist
+   | db.variablelist
+   | db.segmentedlist)
+  | db.glosslist
+  | db.bibliolist
+  | db.calloutlist
+  | db.qandaset
+db.verbatim.blocks =
+  (db.programlisting | db.screen | db.literallayout | db.synopsis)
+  | (db.programlistingco | db.screenco)
+db.synopsis.blocks =
+  db.cmdsynopsis
+  | db.funcsynopsis
+  | db.classsynopsis
+  | db.methodsynopsis
+  | db.constructorsynopsis
+  | db.destructorsynopsis
+  | db.fieldsynopsis
+db.extension.blocks = notAllowed
+db.info.extension = db._any
+db.info.elements =
+  (db.abstract
+   | db.address
+   | db.artpagenums
+   | db.author
+   | db.authorgroup
+   | db.authorinitials
+   | db.bibliocoverage
+   | db.biblioid
+   | db.bibliosource
+   | db.collab
+   | db.confgroup
+   | db.contractsponsor
+   | db.contractnum
+   | db.copyright
+   | db.cover
+   | db.date
+   | db.edition
+   | db.editor
+   | db.issuenum
+   | db.keywordset
+   | db.legalnotice
+   | db.mediaobject
+   | db.org
+   | db.orgname
+   | db.othercredit
+   | db.pagenums
+   | db.printhistory
+   | db.productname
+   | db.productnumber
+   | db.pubdate
+   | db.publisher
+   | db.publishername
+   | db.releaseinfo
+   | db.revhistory
+   | db.seriesvolnums
+   | db.subjectset
+   | db.volumenum
+   | db.info.extension)
+  | db.annotation
+  | db.extendedlink
+  | (db.bibliomisc | db.bibliomset | db.bibliorelation | db.biblioset)
+  | db.itermset
+db.bibliographic.elements =
+  db.info.elements
+  | db.publishing.inlines
+  | db.citerefentry
+  | db.citetitle
+  | db.citebiblioid
+  | db.person
+  | db.personname
+  | db.subtitle
+  | db.title
+div {
+  db.title.role.attribute = attribute role { text }
+  db.title.attlist =
+    db.title.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.title =
+    
+    ## The text of the title of a section of a document or of a formal block-level element
+    element title { db.title.attlist, db.all.inlines* }
+}
+div {
+  db.titleabbrev.role.attribute = attribute role { text }
+  db.titleabbrev.attlist =
+    db.titleabbrev.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.titleabbrev =
+    
+    ## The abbreviation of a title
+    element titleabbrev { db.titleabbrev.attlist, db.all.inlines* }
+}
+div {
+  db.subtitle.role.attribute = attribute role { text }
+  db.subtitle.attlist =
+    db.subtitle.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.subtitle =
+    
+    ## The subtitle of a document
+    element subtitle { db.subtitle.attlist, db.all.inlines* }
+}
+div {
+  db.info.role.attribute = attribute role { text }
+  db.info.attlist = db.info.role.attribute? & db.common.attributes
+  db.info =
+    
+    ## A wrapper for information about a component or other block
+    element info { db.info.attlist, (db._title & db.info.elements*) }
+}
+div {
+  db.titlereq.info.role.attribute = attribute role { text }
+  db.titlereq.info.attlist =
+    db.titlereq.info.role.attribute? & db.common.attributes
+  db.titlereq.info =
+    
+    ## A wrapper for information about a component or other block with a required title
+    element info {
+      db.titlereq.info.attlist, (db._title.req & db.info.elements*)
+    }
+}
+div {
+  db.titleonly.info.role.attribute = attribute role { text }
+  db.titleonly.info.attlist =
+    db.titleonly.info.role.attribute? & db.common.attributes
+  db.titleonly.info =
+    
+    ## A wrapper for information about a component or other block with only a title
+    element info {
+      db.titleonly.info.attlist, (db._title.only & db.info.elements*)
+    }
+}
+div {
+  db.titleonlyreq.info.role.attribute = attribute role { text }
+  db.titleonlyreq.info.attlist =
+    db.titleonlyreq.info.role.attribute? & db.common.attributes
+  db.titleonlyreq.info =
+    
+    ## A wrapper for information about a component or other block with only a required title
+    element info {
+      db.titleonlyreq.info.attlist,
+      (db._title.onlyreq & db.info.elements*)
+    }
+}
+div {
+  db.titleforbidden.info.role.attribute = attribute role { text }
+  db.titleforbidden.info.attlist =
+    db.titleforbidden.info.role.attribute? & db.common.attributes
+  db.titleforbidden.info =
+    
+    ## A wrapper for information about a component or other block without a title
+    element info { db.titleforbidden.info.attlist, db.info.elements* }
+}
+div {
+  db.subjectset.role.attribute = attribute role { text }
+  db.subjectset.scheme.attribute =
+    
+    ## Identifies the controlled vocabulary used by this set's terms
+    attribute scheme { xsd:NMTOKEN }
+  db.subjectset.attlist =
+    db.subjectset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.subjectset.scheme.attribute?
+  db.subjectset =
+    
+    ## A set of terms describing the subject matter of a document
+    element subjectset { db.subjectset.attlist, db.subject+ }
+}
+div {
+  db.subject.role.attribute = attribute role { text }
+  db.subject.weight.attribute =
+    
+    ## Specifies a ranking for this subject relative to other subjects in the same set
+    attribute weight { text }
+  db.subject.attlist =
+    db.subject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.subject.weight.attribute?
+  db.subject =
+    
+    ## One of a group of terms describing the subject matter of a document
+    element subject { db.subject.attlist, db.subjectterm+ }
+}
+div {
+  db.subjectterm.role.attribute = attribute role { text }
+  db.subjectterm.attlist =
+    db.subjectterm.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.subjectterm =
+    
+    ## A term in a group of terms describing the subject matter of a document
+    element subjectterm { db.subjectterm.attlist, text }
+}
+div {
+  db.keywordset.role.attribute = attribute role { text }
+  db.keywordset.attlist =
+    db.keywordset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.keywordset =
+    
+    ## A set of keywords describing the content of a document
+    element keywordset { db.keywordset.attlist, db.keyword+ }
+}
+div {
+  db.keyword.role.attribute = attribute role { text }
+  db.keyword.attlist =
+    db.keyword.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.keyword =
+    
+    ## One of a set of keywords describing the content of a document
+    element keyword { db.keyword.attlist, text }
+}
+db.table.choice = notAllowed | db.cals.table | db.html.table
+db.informaltable.choice =
+  notAllowed | db.cals.informaltable | db.html.informaltable
+db.table = db.table.choice
+db.informaltable = db.informaltable.choice
+div {
+  db.procedure.role.attribute = attribute role { text }
+  db.procedure.attlist =
+    db.procedure.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.procedure.info = db._info.title.only
+  db.procedure =
+    
+    ## A list of operations to be performed in a well-defined sequence
+    element procedure {
+      db.procedure.attlist, db.procedure.info, db.all.blocks*, db.step+
+    }
+}
+div {
+  db.step.role.attribute = attribute role { text }
+  db.step.attlist =
+    db.step.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.performance.attribute?
+  db.step.info = db._info.title.only
+  # 
+  # This content model is blocks*, step|stepalternatives, blocks* but
+  # expressed this way it avoids UPA issues in XSD and DTD versions
+  db.step =
+    
+    ## A unit of action in a procedure
+    element step {
+      db.step.attlist,
+      db.step.info,
+      ((db.all.blocks+,
+        ((db.substeps | db.stepalternatives), db.all.blocks*)?)
+       | ((db.substeps | db.stepalternatives), db.all.blocks*))
+    }
+}
+div {
+  db.stepalternatives.role.attribute = attribute role { text }
+  db.stepalternatives.attlist =
+    db.stepalternatives.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.performance.attribute?
+  db.stepalternatives.info = db._info.title.forbidden
+  db.stepalternatives =
+    
+    ## Alternative steps in a procedure
+    element stepalternatives {
+      db.stepalternatives.attlist, db.stepalternatives.info, db.step+
+    }
+}
+div {
+  db.substeps.role.attribute = attribute role { text }
+  db.substeps.attlist =
+    db.substeps.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.performance.attribute?
+  db.substeps =
+    
+    ## A wrapper for steps that occur within steps in a procedure
+    element substeps { db.substeps.attlist, db.step+ }
+}
+div {
+  db.sidebar.role.attribute = attribute role { text }
+  db.sidebar.attlist =
+    db.sidebar.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.sidebar.info = db._info.title.only
+  db.sidebar =
+    
+    ## A portion of a document that is isolated from the main narrative flow
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:sidebar"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:sidebar)"
+            "sidebar must not occur in the descendants of sidebar"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element sidebar {
+      db.sidebar.attlist, db.sidebar.info, db.all.blocks+
+    }
+}
+div {
+  db.abstract.role.attribute = attribute role { text }
+  db.abstract.attlist =
+    db.abstract.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.abstract.info = db._info.title.only
+  db.abstract =
+    
+    ## A summary
+    element abstract {
+      db.abstract.attlist, db.abstract.info, db.para.blocks+
+    }
+}
+div {
+  db.personblurb.role.attribute = attribute role { text }
+  db.personblurb.attlist =
+    db.personblurb.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.personblurb.info = db._info.title.only
+  db.personblurb =
+    
+    ## A short description or note about a person
+    element personblurb {
+      db.personblurb.attlist, db.personblurb.info, db.para.blocks+
+    }
+}
+div {
+  db.blockquote.role.attribute = attribute role { text }
+  db.blockquote.attlist =
+    db.blockquote.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.blockquote.info = db._info.title.only
+  db.blockquote =
+    
+    ## A quotation set off from the main text
+    element blockquote {
+      db.blockquote.attlist,
+      db.blockquote.info,
+      db.attribution?,
+      db.all.blocks+
+    }
+}
+div {
+  db.attribution.role.attribute = attribute role { text }
+  db.attribution.attlist =
+    db.attribution.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.attribution =
+    
+    ## The source of a block quote or epigraph
+    element attribution {
+      db.attribution.attlist,
+      (db._text
+       | db.person
+       | db.personname
+       | db.citetitle
+       | db.citation)*
+    }
+}
+div {
+  db.bridgehead.renderas.enumeration =
+    
+    ## Render as a first-level section
+    "sect1"
+    | 
+      ## Render as a second-level section
+      "sect2"
+    | 
+      ## Render as a third-level section
+      "sect3"
+    | 
+      ## Render as a fourth-level section
+      "sect4"
+    | 
+      ## Render as a fifth-level section
+      "sect5"
+  db.bridgehead.renderas-enum.attribute =
+    
+    ## Indicates how the bridge head should be rendered
+    attribute renderas { db.bridgehead.renderas.enumeration }?
+  db.bridgehead.renderas-other.attribute =
+    
+    ## Identifies the nature of the non-standard rendering
+    attribute otherrenderas { xsd:NMTOKEN }
+  db.bridgehead.renderas-other.attributes =
+    
+    ## Indicates how the bridge head should be rendered
+    attribute renderas {
+      
+      ## Identifies a non-standard rendering
+      "other"
+    }
+    & db.bridgehead.renderas-other.attribute
+  db.bridgehead.renderas.attribute =
+    db.bridgehead.renderas-enum.attribute
+    | db.bridgehead.renderas-other.attributes
+  db.bridgehead.role.attribute = attribute role { text }
+  db.bridgehead.attlist =
+    db.bridgehead.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.bridgehead.renderas.attribute?
+  db.bridgehead =
+    
+    ## A free-floating heading
+    element bridgehead { db.bridgehead.attlist, db.all.inlines* }
+}
+div {
+  db.remark.role.attribute = attribute role { text }
+  db.remark.attlist =
+    db.remark.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.remark =
+    
+    ## A remark (or comment) intended for presentation in a draft manuscript
+    element remark { db.remark.attlist, db._text }
+}
+div {
+  db.epigraph.role.attribute = attribute role { text }
+  db.epigraph.attlist =
+    db.epigraph.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.epigraph.info = db._info.title.forbidden
+  db.epigraph =
+    
+    ## A short inscription at the beginning of a document or component
+    element epigraph {
+      db.epigraph.attlist,
+      db.epigraph.info,
+      db.attribution?,
+      (db.para.blocks | db.literallayout)+
+    }
+}
+div {
+  db.footnote.role.attribute = attribute role { text }
+  db.footnote.label.attribute =
+    
+    ## Identifies the desired footnote mark
+    attribute label { xsd:NMTOKEN }
+  db.footnote.attlist =
+    db.footnote.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.footnote.label.attribute?
+  db.footnote =
+    
+    ## A footnote
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:footnote)"
+            "footnote must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:table)"
+            "table must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:indexterm)"
+            "indexterm must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:sidebar)"
+            "sidebar must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:task)"
+            "task must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:epigraph)"
+            "epigraph must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element footnote { db.footnote.attlist, db.all.blocks+ }
+}
+div {
+  db.formalpara.role.attribute = attribute role { text }
+  db.formalpara.attlist =
+    db.formalpara.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.formalpara.info = db._info.title.onlyreq
+  db.formalpara =
+    
+    ## A paragraph with a title
+    element formalpara {
+      db.formalpara.attlist,
+      db.formalpara.info,
+      db.indexing.inlines*,
+      db.para
+    }
+}
+div {
+  db.para.role.attribute = attribute role { text }
+  db.para.attlist =
+    db.para.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.para.info = db._info.title.forbidden
+  db.para =
+    
+    ## A paragraph
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:para"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element para {
+      db.para.attlist,
+      db.para.info,
+      (db.all.inlines | db.nopara.blocks)*
+    }
+}
+div {
+  db.simpara.role.attribute = attribute role { text }
+  db.simpara.attlist =
+    db.simpara.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.simpara.info = db._info.title.forbidden
+  db.simpara =
+    
+    ## A paragraph that contains only text and inline markup, no block elements
+    element simpara {
+      db.simpara.attlist, db.simpara.info, db.all.inlines*
+    }
+}
+db.admonition.contentmodel = db._info.title.only, db.all.blocks+
+div {
+  db.caution.role.attribute = attribute role { text }
+  db.caution.attlist =
+    db.caution.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.caution =
+    
+    ## A note of caution
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caution"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of caution"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caution"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of caution"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caution"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of caution"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caution"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of caution"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caution"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of caution"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element caution { db.caution.attlist, db.admonition.contentmodel }
+}
+div {
+  db.important.role.attribute = attribute role { text }
+  db.important.attlist =
+    db.important.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.important =
+    
+    ## An admonition set off from the text
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:important"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of important"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:important"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of important"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:important"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of important"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:important"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of important"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:important"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of important"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element important {
+      db.important.attlist, db.admonition.contentmodel
+    }
+}
+div {
+  db.note.role.attribute = attribute role { text }
+  db.note.attlist =
+    db.note.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.note =
+    
+    ## A message set off from the text
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:note"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of note"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:note"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of note"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:note"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of note"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:note"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of note"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:note"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of note"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element note { db.note.attlist, db.admonition.contentmodel }
+}
+div {
+  db.tip.role.attribute = attribute role { text }
+  db.tip.attlist =
+    db.tip.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.tip =
+    
+    ## A suggestion to the user, set off from the text
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:tip"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of tip"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:tip"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of tip"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:tip"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of tip"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:tip"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of tip"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:tip"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of tip"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element tip { db.tip.attlist, db.admonition.contentmodel }
+}
+div {
+  db.warning.role.attribute = attribute role { text }
+  db.warning.attlist =
+    db.warning.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.warning =
+    
+    ## An admonition set off from the text
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:warning"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of warning"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:warning"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of warning"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:warning"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of warning"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:warning"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of warning"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:warning"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of warning"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element warning { db.warning.attlist, db.admonition.contentmodel }
+}
+div {
+  db.itemizedlist.role.attribute = attribute role { text }
+  db.itemizedlist.mark.attribute =
+    
+    ## Identifies the type of mark to be used on items in this list
+    attribute mark { xsd:NMTOKEN }
+  db.itemizedlist.attlist =
+    db.itemizedlist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.spacing.attribute?
+    & db.itemizedlist.mark.attribute?
+  db.itemizedlist.info = db._info.title.only
+  db.itemizedlist =
+    
+    ## A list in which each entry is marked with a bullet or other dingbat
+    element itemizedlist {
+      db.itemizedlist.attlist,
+      db.itemizedlist.info,
+      db.all.blocks*,
+      db.listitem+
+    }
+}
+div {
+  db.orderedlist.role.attribute = attribute role { text }
+  db.orderedlist.continuation.enumeration =
+    
+    ## Specifies that numbering should begin where the preceding list left off
+    "continues"
+    | 
+      ## Specifies that numbering should begin again at 1
+      "restarts"
+  db.orderedlist.continuation.attribute =
+    
+    ## Indicates how list numbering should begin relative to the immediately preceding list
+    attribute continuation { db.orderedlist.continuation.enumeration }
+  db.orderedlist.startingnumber.attribute =
+    
+    ## Specifies the initial line number.
+    attribute startingnumber { xsd:integer }
+  db.orderedlist.inheritnum.enumeration =
+    
+    ## Specifies that numbering should ignore list nesting
+    "ignore"
+    | 
+      ## Specifies that numbering should inherit from outer-level lists
+      "inherit"
+  db.orderedlist.inheritnum.attribute =
+    
+    ## Indicates whether or not item numbering should be influenced by list nesting
+    attribute inheritnum { db.orderedlist.inheritnum.enumeration }
+  db.orderedlist.numeration.enumeration =
+    
+    ## Specifies Arabic numeration (1, 2, 3, …)
+    "arabic"
+    | 
+      ## Specifies upper-case alphabetic numeration (A, B, C, …)
+      "upperalpha"
+    | 
+      ## Specifies lower-case alphabetic numeration (a, b, c, …)
+      "loweralpha"
+    | 
+      ## Specifies upper-case Roman numeration (I, II, III, …)
+      "upperroman"
+    | 
+      ## Specifies lower-case Roman numeration (i, ii, iii …)
+      "lowerroman"
+  db.orderedlist.numeration.attribute =
+    
+    ## Indicates the desired numeration
+    attribute numeration { db.orderedlist.numeration.enumeration }
+  db.orderedlist.attlist =
+    db.orderedlist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.spacing.attribute?
+    & (db.orderedlist.continuation.attribute
+       | db.orderedlist.startingnumber.attribute)?
+    & db.orderedlist.inheritnum.attribute?
+    & db.orderedlist.numeration.attribute?
+  db.orderedlist.info = db._info.title.only
+  db.orderedlist =
+    
+    ## A list in which each entry is marked with a sequentially incremented label
+    element orderedlist {
+      db.orderedlist.attlist,
+      db.orderedlist.info,
+      db.all.blocks*,
+      db.listitem+
+    }
+}
+div {
+  db.listitem.role.attribute = attribute role { text }
+  db.listitem.override.attribute =
+    
+    ## Specifies the keyword for the type of mark that should be used on this
+    ##  item, instead of the mark that would be used by default
+    attribute override { xsd:NMTOKEN }
+  db.listitem.attlist =
+    db.listitem.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.listitem.override.attribute?
+  db.listitem =
+    
+    ## A wrapper for the elements of a list item
+    element listitem { db.listitem.attlist, db.all.blocks+ }
+}
+div {
+  db.segmentedlist.role.attribute = attribute role { text }
+  db.segmentedlist.attlist =
+    db.segmentedlist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.segmentedlist.info = db._info.title.only
+  db.segmentedlist =
+    
+    ## A segmented list, a list of sets of elements
+    element segmentedlist {
+      db.segmentedlist.attlist,
+      db.segmentedlist.info,
+      db.segtitle+,
+      db.seglistitem+
+    }
+}
+div {
+  db.segtitle.role.attribute = attribute role { text }
+  db.segtitle.attlist =
+    db.segtitle.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.segtitle =
+    
+    ## The title of an element of a list item in a segmented list
+    element segtitle { db.segtitle.attlist, db.all.inlines* }
+}
+div {
+  db.seglistitem.role.attribute = attribute role { text }
+  db.seglistitem.attlist =
+    db.seglistitem.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.seglistitem =
+    
+    ## A list item in a segmented list
+    [
+      s:pattern [
+        name = "Cardinality of segments and titles"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:seglistitem"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "count(db:seg) = count(../db:segtitle)"
+            "The number of seg elements must be the same as the number of segtitle elements in the parent segmentedlist"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element seglistitem { db.seglistitem.attlist, db.seg+ }
+}
+div {
+  db.seg.role.attribute = attribute role { text }
+  db.seg.attlist =
+    db.seg.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.seg =
+    
+    ## An element of a list item in a segmented list
+    element seg { db.seg.attlist, db.all.inlines* }
+}
+div {
+  db.simplelist.role.attribute = attribute role { text }
+  db.simplelist.type.enumeration =
+    
+    ## A tabular presentation in row-major order.
+    "horiz"
+    | 
+      ## A tabular presentation in column-major order.
+      "vert"
+    | 
+      ## An inline presentation, usually a comma-delimited list.
+      "inline"
+  db.simplelist.type.attribute =
+    
+    ## Specifies the type of list presentation.
+    [ a:defaultValue = "vert" ]
+    attribute type { db.simplelist.type.enumeration }
+  db.simplelist.columns.attribute =
+    
+    ## Specifies the number of columns for horizontal or vertical presentation
+    attribute columns { xsd:integer }
+  db.simplelist.attlist =
+    db.simplelist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.simplelist.type.attribute?
+    & db.simplelist.columns.attribute?
+  db.simplelist =
+    
+    ## An undecorated list of single words or short phrases
+    element simplelist { db.simplelist.attlist, db.member+ }
+}
+div {
+  db.member.role.attribute = attribute role { text }
+  db.member.attlist =
+    db.member.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.member =
+    
+    ## An element of a simple list
+    element member { db.member.attlist, db.all.inlines* }
+}
+div {
+  db.variablelist.role.attribute = attribute role { text }
+  db.variablelist.termlength.attribute =
+    
+    ## Indicates a length beyond which the presentation system may consider a term too long and select an alternate presentation for that term, item, or list
+    attribute termlength { text }
+  db.variablelist.attlist =
+    db.variablelist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.spacing.attribute?
+    & db.variablelist.termlength.attribute?
+  db.variablelist.info = db._info.title.only
+  db.variablelist =
+    
+    ## A list in which each entry is composed of a set of one or more terms and an associated description
+    element variablelist {
+      db.variablelist.attlist,
+      db.variablelist.info,
+      db.all.blocks*,
+      db.varlistentry+
+    }
+}
+div {
+  db.varlistentry.role.attribute = attribute role { text }
+  db.varlistentry.attlist =
+    db.varlistentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.varlistentry =
+    
+    ## A wrapper for a set of terms and the associated description in a variable list
+    element varlistentry {
+      db.varlistentry.attlist, db.term+, db.listitem
+    }
+}
+div {
+  db.term.role.attribute = attribute role { text }
+  db.term.attlist =
+    db.term.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.term =
+    
+    ## The word or phrase being defined or described in a variable list
+    element term { db.term.attlist, db.all.inlines* }
+}
+div {
+  db.example.role.attribute = attribute role { text }
+  db.example.label.attribute = db.label.attribute
+  db.example.width.attribute = db.width.characters.attribute
+  db.example.pgwide.attribute = db.pgwide.attribute
+  db.example.floatstyle.attribute = db.floatstyle.attribute
+  db.example.attlist =
+    db.example.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.example.label.attribute?
+    & db.example.floatstyle.attribute?
+    & (db.example.width.attribute | db.example.pgwide.attribute)?
+  db.example.info = db._info.title.onlyreq
+  db.example =
+    
+    ## A formal example, with a title
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:table)"
+            "table must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element example {
+      db.example.attlist, db.example.info, db.all.blocks+, db.caption?
+    }
+}
+div {
+  db.informalexample.role.attribute = attribute role { text }
+  db.informalexample.width.attribute = db.width.characters.attribute
+  db.informalexample.floatstyle.attribute = db.floatstyle.attribute
+  db.informalexample.attlist =
+    db.informalexample.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.informalexample.floatstyle.attribute?
+    & db.informalexample.width.attribute?
+  db.informalexample.info = db._info.title.forbidden
+  db.informalexample =
+    
+    ## A displayed example without a title
+    element informalexample {
+      db.informalexample.attlist,
+      db.informalexample.info,
+      db.all.blocks+,
+      db.caption?
+    }
+}
+db.verbatim.inlines = (db.all.inlines | db.lineannotation) | db.co
+db.verbatim.contentmodel =
+  db._info.title.forbidden, (db.textobject | db.verbatim.inlines*)
+div {
+  db.programlisting.role.attribute = attribute role { text }
+  db.programlisting.width.attribute = db.width.characters.attribute
+  db.programlisting.attlist =
+    db.programlisting.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+    & db.programlisting.width.attribute?
+  db.programlisting =
+    
+    ## A literal listing of all or part of a program
+    element programlisting {
+      db.programlisting.attlist, db.verbatim.contentmodel
+    }
+}
+div {
+  db.literallayout.role.attribute = attribute role { text }
+  db.literallayout.class.enumeration =
+    
+    ## The literal layout should be formatted with a monospaced font
+    "monospaced"
+    | 
+      ## The literal layout should be formatted with the current font
+      "normal"
+  db.literallayout.class.attribute =
+    
+    ## Specifies the class of literal layout
+    attribute class { db.literallayout.class.enumeration }
+  db.literallayout.attlist =
+    db.literallayout.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+    & db.literallayout.class.attribute?
+  db.literallayout =
+    
+    ## A block of text in which line breaks and white space are to be reproduced faithfully
+    element literallayout {
+      db.literallayout.attlist, db.verbatim.contentmodel
+    }
+}
+div {
+  db.screen.role.attribute = attribute role { text }
+  db.screen.width.attribute = db.width.characters.attribute
+  db.screen.attlist =
+    db.screen.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+    & db.screen.width.attribute?
+  db.screen =
+    
+    ## Text that a user sees or might see on a computer screen
+    element screen { db.screen.attlist, db.verbatim.contentmodel }
+}
+div {
+  db.screenshot.role.attribute = attribute role { text }
+  db.screenshot.attlist =
+    db.screenshot.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.screenshot.info = db._info
+  db.screenshot =
+    
+    ## A representation of what the user sees or might see on a computer screen
+    element screenshot {
+      db.screenshot.attlist, db.screenshot.info, db.mediaobject
+    }
+}
+div {
+  db.figure.role.attribute = attribute role { text }
+  db.figure.label.attribute = db.label.attribute
+  db.figure.pgwide.attribute = db.pgwide.attribute
+  db.figure.floatstyle.attribute = db.floatstyle.attribute
+  db.figure.attlist =
+    db.figure.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.figure.label.attribute?
+    & db.figure.pgwide.attribute?
+    & db.figure.floatstyle.attribute?
+  db.figure.info = db._info.title.onlyreq
+  db.figure =
+    
+    ## A formal figure, generally an illustration, with a title
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:table)"
+            "table must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element figure {
+      db.figure.attlist, db.figure.info, db.all.blocks+, db.caption?
+    }
+}
+div {
+  db.informalfigure.role.attribute = attribute role { text }
+  db.informalfigure.label.attribute = db.label.attribute
+  db.informalfigure.pgwide.attribute = db.pgwide.attribute
+  db.informalfigure.floatstyle.attribute = db.floatstyle.attribute
+  db.informalfigure.attlist =
+    db.informalfigure.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.informalfigure.label.attribute?
+    & db.informalfigure.pgwide.attribute?
+    & db.informalfigure.floatstyle.attribute?
+  db.informalfigure.info = db._info.title.forbidden
+  db.informalfigure =
+    
+    ## A untitled figure
+    element informalfigure {
+      db.informalfigure.attlist,
+      db.informalfigure.info,
+      db.all.blocks+,
+      db.caption?
+    }
+}
+db.mediaobject.content =
+  (db.videoobject | db.audioobject | db.imageobject | db.textobject)
+  | db.imageobjectco
+div {
+  db.mediaobject.role.attribute = attribute role { text }
+  db.mediaobject.attlist =
+    db.mediaobject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.mediaobject.info = db._info.title.forbidden
+  db.mediaobject =
+    
+    ## A displayed media object (video, audio, image, etc.)
+    element mediaobject {
+      db.mediaobject.attlist,
+      db.mediaobject.info,
+      db.alt?,
+      db.mediaobject.content+,
+      db.caption?
+    }
+}
+div {
+  db.inlinemediaobject.role.attribute = attribute role { text }
+  db.inlinemediaobject.attlist =
+    db.inlinemediaobject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.inlinemediaobject.info = db._info.title.forbidden
+  db.inlinemediaobject =
+    
+    ## An inline media object (video, audio, image, and so on)
+    element inlinemediaobject {
+      db.inlinemediaobject.attlist,
+      db.inlinemediaobject.info,
+      db.alt?,
+      db.mediaobject.content+
+    }
+}
+div {
+  db.videoobject.role.attribute = attribute role { text }
+  db.videoobject.attlist =
+    db.videoobject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.videoobject.info = db._info.title.forbidden
+  db.videoobject =
+    
+    ## A wrapper for video data and its associated meta-information
+    element videoobject {
+      db.videoobject.attlist, db.videoobject.info, db.videodata
+    }
+}
+div {
+  db.audioobject.role.attribute = attribute role { text }
+  db.audioobject.attlist =
+    db.audioobject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.audioobject.info = db._info.title.forbidden
+  db.audioobject =
+    
+    ## A wrapper for audio data and its associated meta-information
+    element audioobject {
+      db.audioobject.attlist, db.audioobject.info, db.audiodata
+    }
+}
+db.imageobject.content =
+  db.imagedata | db.imagedata.mathml | db.imagedata.svg
+div {
+  db.imageobject.role.attribute = attribute role { text }
+  db.imageobject.attlist =
+    db.imageobject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.imageobject.info = db._info.title.forbidden
+  db.imageobject =
+    
+    ## A wrapper for image data and its associated meta-information
+    element imageobject {
+      db.imageobject.attlist,
+      db.imageobject.info,
+      db.imageobject.content
+    }
+}
+div {
+  db.textobject.role.attribute = attribute role { text }
+  db.textobject.attlist =
+    db.textobject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.textobject.info = db._info.title.forbidden
+  db.textobject =
+    
+    ## A wrapper for a text description of an object and its associated meta-information
+    element textobject {
+      db.textobject.attlist,
+      db.textobject.info,
+      (db.phrase | db.textdata | db.all.blocks+)
+    }
+}
+div {
+  db.videodata.role.attribute = attribute role { text }
+  db.videodata.align.enumeration = db.halign.enumeration
+  db.videodata.align.attribute =
+    
+    ## Specifies the (horizontal) alignment of the video data
+    attribute align { db.videodata.align.enumeration }
+  db.videodata.valign.enumeration = db.valign.enumeration
+  db.videodata.valign.attribute =
+    
+    ## Specifies the vertical alignment of the video data
+    attribute valign { db.videodata.valign.enumeration }
+  db.videodata.width.attribute = db.width.attribute
+  db.videodata.depth.attribute = db.depth.attribute
+  db.videodata.contentwidth.attribute = db.contentwidth.attribute
+  db.videodata.contentdepth.attribute = db.contentdepth.attribute
+  db.videodata.scalefit.enumeration = db.scalefit.enumeration
+  db.videodata.scalefit.attribute =
+    
+    ## Determines if anamorphic scaling is forbidden
+    attribute scalefit { db.videodata.scalefit.enumeration }
+  db.videodata.scale.attribute = db.scale.attribute
+  db.videodata.attlist =
+    db.videodata.role.attribute?
+    & db.common.attributes
+    & db.common.data.attributes
+    & db.videodata.align.attribute?
+    & db.videodata.valign.attribute?
+    & db.videodata.width.attribute?
+    & db.videodata.contentwidth.attribute?
+    & db.videodata.scalefit.attribute?
+    & db.videodata.scale.attribute?
+    & db.videodata.depth.attribute?
+    & db.videodata.contentdepth.attribute?
+  db.videodata.info = db._info.title.forbidden
+  db.videodata =
+    
+    ## Pointer to external video data
+    element videodata { db.videodata.attlist, db.videodata.info }
+}
+div {
+  db.audiodata.role.attribute = attribute role { text }
+  db.audiodata.attlist =
+    db.audiodata.role.attribute?
+    & db.common.attributes
+    & db.common.data.attributes
+  db.audiodata.info = db._info.title.forbidden
+  db.audiodata =
+    
+    ## Pointer to external audio data
+    element audiodata { db.audiodata.attlist, db.audiodata.info }
+}
+div {
+  db.imagedata.role.attribute = attribute role { text }
+  db.imagedata.align.enumeration = db.halign.enumeration
+  db.imagedata.align.attribute =
+    
+    ## Specifies the (horizontal) alignment of the image data
+    attribute align { db.imagedata.align.enumeration }
+  db.imagedata.valign.enumeration = db.valign.enumeration
+  db.imagedata.valign.attribute =
+    
+    ## Specifies the vertical alignment of the image data
+    attribute valign { db.imagedata.valign.enumeration }
+  db.imagedata.width.attribute = db.width.attribute
+  db.imagedata.depth.attribute = db.depth.attribute
+  db.imagedata.contentwidth.attribute = db.contentwidth.attribute
+  db.imagedata.contentdepth.attribute = db.contentdepth.attribute
+  db.imagedata.scalefit.enumeration = db.scalefit.enumeration
+  db.imagedata.scalefit.attribute =
+    
+    ## Determines if anamorphic scaling is forbidden
+    attribute scalefit { db.imagedata.scalefit.enumeration }
+  db.imagedata.scale.attribute = db.scale.attribute
+  db.imagedata.attlist =
+    db.imagedata.role.attribute?
+    & db.common.attributes
+    & db.common.data.attributes
+    & db.imagedata.align.attribute?
+    & db.imagedata.valign.attribute?
+    & db.imagedata.width.attribute?
+    & db.imagedata.contentwidth.attribute?
+    & db.imagedata.scalefit.attribute?
+    & db.imagedata.scale.attribute?
+    & db.imagedata.depth.attribute?
+    & db.imagedata.contentdepth.attribute?
+  db.imagedata.info = db._info.title.forbidden
+  db.imagedata =
+    
+    ## Pointer to external image data
+    element imagedata { db.imagedata.attlist, db.imagedata.info }
+}
+div {
+  db.textdata.role.attribute = attribute role { text }
+  db.textdata.encoding.attribute =
+    
+    ## Identifies the encoding of the text in the external file
+    attribute encoding { text }
+  db.textdata.attlist =
+    db.textdata.role.attribute?
+    & db.common.attributes
+    & db.common.data.attributes
+    & db.textdata.encoding.attribute?
+  db.textdata.info = db._info.title.forbidden
+  db.textdata =
+    
+    ## Pointer to external text data
+    element textdata { db.textdata.attlist, db.textdata.info }
+}
+div {
+  db.caption.role.attribute = attribute role { text }
+  db.caption.attlist =
+    db.caption.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.caption.info = db._info.title.forbidden
+  db.caption =
+    
+    ## A caption
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:table)"
+            "table must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:sidebar)"
+            "sidebar must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:task)"
+            "task must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element caption {
+      db.caption.attlist, db.caption.info, db.all.blocks+
+    }
+}
+div {
+  db.synopsis.role.attribute = attribute role { text }
+  db.synopsis.label.attribute = db.label.attribute
+  db.synopsis.attlist =
+    db.synopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+    & db.synopsis.label.attribute?
+  db.synopsis =
+    
+    ## A general-purpose element for representing the syntax of commands or functions
+    element synopsis { db.synopsis.attlist, db.verbatim.contentmodel }
+}
+div {
+  db.cmdsynopsis.role.attribute = attribute role { text }
+  db.cmdsynopsis.sepchar.attribute =
+    
+    ## Specifies the character that should separate the command and its top-level arguments
+    attribute sepchar { text }
+  db.cmdsynopsis.cmdlength.attribute =
+    
+    ## Indicates the displayed length of the command; this information may be used to intelligently indent command synopses which extend beyond one line
+    attribute cmdlength { text }
+  db.cmdsynopsis.label.attribute = db.label.attribute
+  db.cmdsynopsis.attlist =
+    db.cmdsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.cmdsynopsis.sepchar.attribute?
+    & db.cmdsynopsis.cmdlength.attribute?
+    & db.cmdsynopsis.label.attribute?
+  db.cmdsynopsis.info = db._info.title.forbidden
+  db.cmdsynopsis =
+    
+    ## A syntax summary for a software command
+    element cmdsynopsis {
+      db.cmdsynopsis.attlist,
+      db.cmdsynopsis.info,
+      (db.command | db.arg | db.group | db.sbr)+,
+      db.synopfragment*
+    }
+}
+db.rep.enumeration =
+  
+  ## Can not be repeated.
+  "norepeat"
+  | 
+    ## Can be repeated.
+    "repeat"
+db.rep.attribute =
+  
+  ## Indicates whether or not repetition is possible.
+  [ a:defaultValue = "norepeat" ] attribute rep { db.rep.enumeration }
+db.choice.enumeration =
+  
+  ## Formatted to indicate that it is optional.
+  "opt"
+  | 
+    ## Formatted without indication.
+    "plain"
+  | 
+    ## Formatted to indicate that it is required.
+    "req"
+db.choice.opt.attribute =
+  
+  ## Indicates optionality.
+  [ a:defaultValue = "opt" ] attribute choice { db.choice.enumeration }
+db.choice.req.attribute =
+  
+  ## Indicates optionality.
+  [ a:defaultValue = "req" ] attribute choice { db.choice.enumeration }
+div {
+  db.arg.role.attribute = attribute role { text }
+  db.arg.rep.attribute = db.rep.attribute
+  db.arg.choice.attribute = db.choice.opt.attribute
+  db.arg.attlist =
+    db.arg.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.arg.rep.attribute?
+    & db.arg.choice.attribute?
+  db.arg =
+    
+    ## An argument in a CmdSynopsis
+    element arg {
+      db.arg.attlist,
+      (db._text
+       | db.arg
+       | db.group
+       | db.option
+       | db.synopfragmentref
+       | db.sbr)*
+    }
+}
+div {
+  db.group.role.attribute = attribute role { text }
+  db.group.rep.attribute = db.rep.attribute
+  db.group.choice.attribute = db.choice.opt.attribute
+  db.group.attlist =
+    db.group.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.group.rep.attribute?
+    & db.group.choice.attribute?
+  db.group =
+    
+    ## A group of elements in a CmdSynopsis
+    element group {
+      db.group.attlist,
+      (db.arg
+       | db.group
+       | db.option
+       | db.synopfragmentref
+       | db.replaceable
+       | db.sbr)+
+    }
+}
+div {
+  db.sbr.role.attribute = attribute role { text }
+  db.sbr.attlist = db.sbr.role.attribute? & db.common.attributes
+  db.sbr =
+    
+    ## An explicit line break in a command synopsis
+    element sbr { db.sbr.attlist, empty }
+}
+div {
+  db.synopfragment.role.attribute = attribute role { text }
+  db.synopfragment.attlist =
+    db.synopfragment.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.synopfragment =
+    
+    ## A portion of a CmdSynopsis broken out from the main body of the synopsis
+    element synopfragment {
+      db.synopfragment.attlist, (db.arg | db.group)+
+    }
+}
+div {
+  db.synopfragmentref.role.attribute = attribute role { text }
+  db.synopfragmentref.attlist =
+    db.synopfragmentref.role.attribute?
+    & db.common.attributes
+    & db.linkend.attribute
+  db.synopfragmentref =
+    
+    ## A reference to a fragment of a command synopsis
+    [
+      s:pattern [
+        name = "Synopsis fragment type constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:synopfragmentref"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test =
+              "local-name(//*[@xml:id=current()/@linkend]) = 'synopfragment' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+            "@linkend on synopfragmentref must point to a synopfragment."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element synopfragmentref { db.synopfragmentref.attlist, text }
+}
+div {
+  db.funcsynopsis.role.attribute = attribute role { text }
+  db.funcsynopsis.attlist =
+    db.funcsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.language.attribute?
+  db.funcsynopsis.info = db._info.title.forbidden
+  db.funcsynopsis =
+    
+    ## The syntax summary for a function definition
+    element funcsynopsis {
+      db.funcsynopsis.attlist,
+      db.funcsynopsis.info,
+      (db.funcsynopsisinfo | db.funcprototype)+
+    }
+}
+div {
+  db.funcsynopsisinfo.role.attribute = attribute role { text }
+  db.funcsynopsisinfo.attlist =
+    db.funcsynopsisinfo.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+  db.funcsynopsisinfo =
+    
+    ## Information supplementing the FuncDefs of a FuncSynopsis
+    element funcsynopsisinfo {
+      db.funcsynopsisinfo.attlist, db.verbatim.contentmodel
+    }
+}
+div {
+  db.funcprototype.role.attribute = attribute role { text }
+  db.funcprototype.attlist =
+    db.funcprototype.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.funcprototype =
+    
+    ## The prototype of a function
+    element funcprototype {
+      db.funcprototype.attlist,
+      db.modifier*,
+      db.funcdef,
+      (db.void | db.varargs | (db.paramdef+, db.varargs?)),
+      db.modifier*
+    }
+}
+div {
+  db.funcdef.role.attribute = attribute role { text }
+  db.funcdef.attlist =
+    db.funcdef.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.funcdef =
+    
+    ## A function (subroutine) name and its return type
+    element funcdef {
+      db.funcdef.attlist, (db._text | db.type | db.function)*
+    }
+}
+div {
+  db.void.role.attribute = attribute role { text }
+  db.void.attlist =
+    db.void.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.void =
+    
+    ## An empty element in a function synopsis indicating that the function in question takes no arguments
+    element void { db.void.attlist, empty }
+}
+div {
+  db.varargs.role.attribute = attribute role { text }
+  db.varargs.attlist =
+    db.varargs.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.varargs =
+    
+    ## An empty element in a function synopsis indicating a variable number of arguments
+    element varargs { db.varargs.attlist, empty }
+}
+div {
+  db.paramdef.role.attribute = attribute role { text }
+  db.paramdef.choice.enumeration =
+    
+    ## Formatted to indicate that it is optional.
+    "opt"
+    | 
+      ## Formatted to indicate that it is required.
+      "req"
+  db.paramdef.choice.attribute =
+    
+    ## Indicates optionality.
+    [ a:defaultValue = "opt" ]
+    attribute choice { db.paramdef.choice.enumeration }
+  db.paramdef.attlist =
+    db.paramdef.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.paramdef.choice.attribute?
+  db.paramdef =
+    
+    ## Information about a function parameter in a programming language
+    element paramdef {
+      db.paramdef.attlist,
+      (db._text
+       | db.initializer
+       | db.type
+       | db.parameter
+       | db.funcparams)*
+    }
+}
+div {
+  db.funcparams.role.attribute = attribute role { text }
+  db.funcparams.attlist =
+    db.funcparams.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.funcparams =
+    
+    ## Parameters for a function referenced through a function pointer in a synopsis
+    element funcparams { db.funcparams.attlist, db._text }
+}
+div {
+  db.classsynopsis.role.attribute = attribute role { text }
+  db.classsynopsis.class.enumeration =
+    
+    ## This is the synopsis of a class
+    "class"
+    | 
+      ## This is the synopsis of an interface
+      "interface"
+  db.classsynopsis.class.attribute =
+    
+    ## Specifies the nature of the synopsis
+    attribute class { db.classsynopsis.class.enumeration }
+  db.classsynopsis.attlist =
+    db.classsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.language.attribute?
+    & db.classsynopsis.class.attribute?
+  db.classsynopsis =
+    
+    ## The syntax summary for a class definition
+    element classsynopsis {
+      db.classsynopsis.attlist,
+      db.oo.inlines+,
+      (db.classsynopsisinfo
+       | db.methodsynopsis
+       | db.constructorsynopsis
+       | db.destructorsynopsis
+       | db.fieldsynopsis)*
+    }
+}
+div {
+  db.classsynopsisinfo.role.attribute = attribute role { text }
+  db.classsynopsisinfo.attlist =
+    db.classsynopsisinfo.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+  db.classsynopsisinfo =
+    
+    ## Information supplementing the contents of a ClassSynopsis
+    element classsynopsisinfo {
+      db.classsynopsisinfo.attlist, db.verbatim.contentmodel
+    }
+}
+div {
+  db.ooclass.role.attribute = attribute role { text }
+  db.ooclass.attlist =
+    db.ooclass.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.ooclass =
+    
+    ## A class in an object-oriented programming language
+    element ooclass {
+      db.ooclass.attlist, (db.package | db.modifier)*, db.classname
+    }
+}
+div {
+  db.oointerface.role.attribute = attribute role { text }
+  db.oointerface.attlist =
+    db.oointerface.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.oointerface =
+    
+    ## An interface in an object-oriented programming language
+    element oointerface {
+      db.oointerface.attlist,
+      (db.package | db.modifier)*,
+      db.interfacename
+    }
+}
+div {
+  db.ooexception.role.attribute = attribute role { text }
+  db.ooexception.attlist =
+    db.ooexception.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.ooexception =
+    
+    ## An exception in an object-oriented programming language
+    element ooexception {
+      db.ooexception.attlist,
+      (db.package | db.modifier)*,
+      db.exceptionname
+    }
+}
+db.modifier.xml.space.attribute =
+  
+  ## Can be used to indicate that whitespace in the modifier should be preserved (for multi-line annotations, for example).
+  attribute xml:space {
+    
+    ## Extra whitespace and line breaks must be preserved.
+    [
+      # Ideally the definition of xml:space used on modifier would be
+      # different from the definition used on the verbatim elements. The
+      # verbatim elements forbid the use of xml:space="default" which
+      # wouldn't be a problem on modifier. But doing that causes the
+      # generated XSD schemas to be broken so I'm just reusing the existing
+      # definition for now. It won't be backwards incompatible to fix this
+      # problem in the future.
+      #    | ## Extra whitespace and line breaks are not preserved.
+      #      "default"
+      
+    ]
+    "preserve"
+  }
+div {
+  db.modifier.role.attribute = attribute role { text }
+  db.modifier.attlist =
+    db.modifier.xml.space.attribute?
+    & db.modifier.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.modifier =
+    
+    ## Modifiers in a synopsis
+    element modifier { db.modifier.attlist, db._text }
+}
+div {
+  db.interfacename.role.attribute = attribute role { text }
+  db.interfacename.attlist =
+    db.interfacename.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.interfacename =
+    
+    ## The name of an interface
+    element interfacename { db.interfacename.attlist, db._text }
+}
+div {
+  db.exceptionname.role.attribute = attribute role { text }
+  db.exceptionname.attlist =
+    db.exceptionname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.exceptionname =
+    
+    ## The name of an exception
+    element exceptionname { db.exceptionname.attlist, db._text }
+}
+div {
+  db.fieldsynopsis.role.attribute = attribute role { text }
+  db.fieldsynopsis.attlist =
+    db.fieldsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.language.attribute?
+  db.fieldsynopsis =
+    
+    ## The name of a field in a class definition
+    element fieldsynopsis {
+      db.fieldsynopsis.attlist,
+      db.modifier*,
+      db.type?,
+      db.varname,
+      db.initializer?
+    }
+}
+div {
+  db.initializer.role.attribute = attribute role { text }
+  db.initializer.attlist =
+    db.initializer.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.initializer =
+    
+    ## The initializer for a FieldSynopsis
+    element initializer { db.initializer.attlist, db._text }
+}
+div {
+  db.constructorsynopsis.role.attribute = attribute role { text }
+  db.constructorsynopsis.attlist =
+    db.constructorsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.language.attribute?
+  db.constructorsynopsis =
+    
+    ## A syntax summary for a constructor
+    element constructorsynopsis {
+      db.constructorsynopsis.attlist,
+      db.modifier*,
+      db.methodname?,
+      (db.methodparam+ | db.void?),
+      db.exceptionname*
+    }
+}
+div {
+  db.destructorsynopsis.role.attribute = attribute role { text }
+  db.destructorsynopsis.attlist =
+    db.destructorsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.language.attribute?
+  db.destructorsynopsis =
+    
+    ## A syntax summary for a destructor
+    element destructorsynopsis {
+      db.destructorsynopsis.attlist,
+      db.modifier*,
+      db.methodname?,
+      (db.methodparam+ | db.void?),
+      db.exceptionname*
+    }
+}
+div {
+  db.methodsynopsis.role.attribute = attribute role { text }
+  db.methodsynopsis.attlist =
+    db.methodsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.language.attribute?
+  db.methodsynopsis =
+    
+    ## A syntax summary for a method
+    element methodsynopsis {
+      db.methodsynopsis.attlist,
+      db.modifier*,
+      (db.type | db.void)?,
+      db.methodname,
+      (db.methodparam+ | db.void),
+      db.exceptionname*,
+      db.modifier*
+    }
+}
+div {
+  db.methodname.role.attribute = attribute role { text }
+  db.methodname.attlist =
+    db.methodname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.methodname =
+    
+    ## The name of a method
+    element methodname { db.methodname.attlist, db._text }
+}
+div {
+  db.methodparam.role.attribute = attribute role { text }
+  db.methodparam.rep.attribute = db.rep.attribute
+  db.methodparam.choice.attribute = db.choice.req.attribute
+  db.methodparam.attlist =
+    db.methodparam.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.methodparam.rep.attribute?
+    & db.methodparam.choice.attribute?
+  db.methodparam =
+    
+    ## Parameters to a method
+    element methodparam {
+      db.methodparam.attlist,
+      db.modifier*,
+      db.type?,
+      ((db.modifier*, db.parameter, db.initializer?) | db.funcparams),
+      db.modifier*
+    }
+}
+div {
+  db.address.role.attribute = attribute role { text }
+  db.address.attlist =
+    db.address.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+  db.address =
+    
+    ## A real-world address, generally a postal address
+    element address {
+      db.address.attlist,
+      (db._text
+       | db.personname
+       | db.pob
+       | db.street
+       | db.city
+       | db.state
+       | db.postcode
+       | db.country
+       | db.phone
+       | db.fax
+       | db.email
+       | db.otheraddr)*
+    }
+}
+div {
+  db.street.role.attribute = attribute role { text }
+  db.street.attlist =
+    db.street.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.street =
+    
+    ## A street address in an address
+    element street { db.street.attlist, db._text }
+}
+div {
+  db.pob.role.attribute = attribute role { text }
+  db.pob.attlist =
+    db.pob.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.pob =
+    
+    ## A post office box in an address
+    element pob { db.pob.attlist, db._text }
+}
+div {
+  db.postcode.role.attribute = attribute role { text }
+  db.postcode.attlist =
+    db.postcode.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.postcode =
+    
+    ## A postal code in an address
+    element postcode { db.postcode.attlist, db._text }
+}
+div {
+  db.city.role.attribute = attribute role { text }
+  db.city.attlist =
+    db.city.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.city =
+    
+    ## The name of a city in an address
+    element city { db.city.attlist, db._text }
+}
+div {
+  db.state.role.attribute = attribute role { text }
+  db.state.attlist =
+    db.state.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.state =
+    
+    ## A state or province in an address
+    element state { db.state.attlist, db._text }
+}
+div {
+  db.country.role.attribute = attribute role { text }
+  db.country.attlist =
+    db.country.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.country =
+    
+    ## The name of a country
+    element country { db.country.attlist, db._text }
+}
+div {
+  db.phone.role.attribute = attribute role { text }
+  db.phone.attlist =
+    db.phone.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.phone =
+    
+    ## A telephone number
+    element phone { db.phone.attlist, db._text }
+}
+div {
+  db.fax.role.attribute = attribute role { text }
+  db.fax.attlist =
+    db.fax.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.fax =
+    
+    ## A fax number
+    element fax { db.fax.attlist, db._text }
+}
+div {
+  db.otheraddr.role.attribute = attribute role { text }
+  db.otheraddr.attlist =
+    db.otheraddr.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.otheraddr =
+    
+    ## Uncategorized information in address
+    element otheraddr { db.otheraddr.attlist, db._text }
+}
+div {
+  db.affiliation.role.attribute = attribute role { text }
+  db.affiliation.attlist =
+    db.affiliation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.affiliation =
+    
+    ## The institutional affiliation of an individual
+    element affiliation {
+      db.affiliation.attlist,
+      db.shortaffil?,
+      db.jobtitle*,
+      (db.org? | (db.orgname?, db.orgdiv*, db.address*))
+    }
+}
+div {
+  db.shortaffil.role.attribute = attribute role { text }
+  db.shortaffil.attlist =
+    db.shortaffil.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.shortaffil =
+    
+    ## A brief description of an affiliation
+    element shortaffil { db.shortaffil.attlist, db._text }
+}
+div {
+  db.jobtitle.role.attribute = attribute role { text }
+  db.jobtitle.attlist =
+    db.jobtitle.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.jobtitle =
+    
+    ## The title of an individual in an organization
+    element jobtitle { db.jobtitle.attlist, db._text }
+}
+div {
+  db.orgname.class.enumeration =
+    
+    ## A consortium
+    "consortium"
+    | 
+      ## A corporation
+      "corporation"
+    | 
+      ## An informal organization
+      "informal"
+    | 
+      ## A non-profit organization
+      "nonprofit"
+  db.orgname.class-enum.attribute =
+    
+    ## Specifies the nature of the organization
+    attribute class { db.orgname.class.enumeration }
+  db.orgname.class-other.attributes =
+    
+    ## Specifies the nature of the organization
+    attribute class {
+      
+      ## Indicates a non-standard organization class
+      "other"
+    },
+    
+    ## Identifies the non-standard nature of the organization
+    attribute otherclass { text }
+  db.orgname.class.attribute =
+    db.orgname.class-enum.attribute | db.orgname.class-other.attributes
+  db.orgname.role.attribute = attribute role { text }
+  db.orgname.attlist =
+    db.orgname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.orgname.class.attribute?
+  db.orgname =
+    
+    ## The name of an organization other than a corporation 
+    element orgname { db.orgname.attlist, db._text }
+}
+div {
+  db.orgdiv.role.attribute = attribute role { text }
+  db.orgdiv.attlist =
+    db.orgdiv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.orgdiv =
+    
+    ## A division of an organization
+    element orgdiv { db.orgdiv.attlist, db.all.inlines* }
+}
+div {
+  db.artpagenums.role.attribute = attribute role { text }
+  db.artpagenums.attlist =
+    db.artpagenums.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.artpagenums =
+    
+    ## The page numbers of an article as published
+    element artpagenums { db.artpagenums.attlist, db._text }
+}
+div {
+  db.personname.role.attribute = attribute role { text }
+  db.personname.attlist =
+    db.personname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.personname =
+    
+    ## The personal name of an individual
+    element personname {
+      db.personname.attlist,
+      (db._text
+       | (db.honorific
+          | db.firstname
+          | db.surname
+          | db.lineage
+          | db.othername)+)
+    }
+}
+db.person.author.contentmodel =
+  db.personname,
+  (db.personblurb
+   | db.affiliation
+   | db.email
+   | db.address
+   | db.contrib)*
+db.org.author.contentmodel =
+  db.orgname,
+  (db.orgdiv | db.affiliation | db.email | db.address | db.contrib)*
+db.credit.contentmodel =
+  db.person.author.contentmodel | db.org.author.contentmodel
+div {
+  db.author.role.attribute = attribute role { text }
+  db.author.attlist =
+    db.author.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.author =
+    
+    ## The name of an individual author
+    element author { db.author.attlist, db.credit.contentmodel }
+}
+div {
+  db.authorgroup.role.attribute = attribute role { text }
+  db.authorgroup.attlist =
+    db.authorgroup.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.authorgroup =
+    
+    ## Wrapper for author information when a document has multiple authors or collabarators
+    element authorgroup {
+      db.authorgroup.attlist, (db.author | db.editor | db.othercredit)+
+    }
+}
+div {
+  db.collab.role.attribute = attribute role { text }
+  db.collab.attlist =
+    db.collab.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.collab =
+    
+    ## Identifies a collaborator
+    element collab {
+      db.collab.attlist,
+      (db.person | db.personname | db.org | db.orgname)+,
+      db.affiliation*
+    }
+}
+div {
+  db.authorinitials.role.attribute = attribute role { text }
+  db.authorinitials.attlist =
+    db.authorinitials.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.authorinitials =
+    
+    ## The initials or other short identifier for an author
+    element authorinitials { db.authorinitials.attlist, db._text }
+}
+div {
+  db.person.role.attribute = attribute role { text }
+  db.person.attlist =
+    db.person.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.person =
+    
+    ## A person and associated metadata
+    element person {
+      db.person.attlist,
+      db.personname,
+      (db.address | db.affiliation | db.email | db.personblurb)*
+    }
+}
+div {
+  db.org.role.attribute = attribute role { text }
+  db.org.attlist =
+    db.org.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.org =
+    
+    ## An organization and associated metadata
+    element org {
+      db.org.attlist,
+      db.orgname,
+      (db.address | db.affiliation | db.email | db.orgdiv)*
+    }
+}
+div {
+  db.confgroup.role.attribute = attribute role { text }
+  db.confgroup.attlist =
+    db.confgroup.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.confgroup =
+    
+    ## A wrapper for document meta-information about a conference
+    element confgroup {
+      db.confgroup.attlist,
+      (db.confdates
+       | db.conftitle
+       | db.confnum
+       | db.confsponsor
+       | db.address)*
+    }
+}
+div {
+  db.confdates.role.attribute = attribute role { text }
+  db.confdates.attlist =
+    db.confdates.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.confdates =
+    
+    ## The dates of a conference for which a document was written
+    element confdates { db.confdates.attlist, db._text }
+}
+div {
+  db.conftitle.role.attribute = attribute role { text }
+  db.conftitle.attlist =
+    db.conftitle.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.conftitle =
+    
+    ## The title of a conference for which a document was written
+    element conftitle { db.conftitle.attlist, db._text }
+}
+div {
+  db.confnum.role.attribute = attribute role { text }
+  db.confnum.attlist =
+    db.confnum.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.confnum =
+    
+    ## An identifier, frequently numerical, associated with a conference for which a document was written
+    element confnum { db.confnum.attlist, db._text }
+}
+div {
+  db.confsponsor.role.attribute = attribute role { text }
+  db.confsponsor.attlist =
+    db.confsponsor.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.confsponsor =
+    
+    ## The sponsor of a conference for which a document was written
+    element confsponsor { db.confsponsor.attlist, db._text }
+}
+div {
+  db.contractnum.role.attribute = attribute role { text }
+  db.contractnum.attlist =
+    db.contractnum.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.contractnum =
+    
+    ## The contract number of a document
+    element contractnum { db.contractnum.attlist, db._text }
+}
+div {
+  db.contractsponsor.role.attribute = attribute role { text }
+  db.contractsponsor.attlist =
+    db.contractsponsor.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.contractsponsor =
+    
+    ## The sponsor of a contract
+    element contractsponsor { db.contractsponsor.attlist, db._text }
+}
+div {
+  db.copyright.role.attribute = attribute role { text }
+  db.copyright.attlist =
+    db.copyright.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.copyright =
+    
+    ## Copyright information about a document
+    element copyright { db.copyright.attlist, db.year+, db.holder* }
+}
+div {
+  db.year.role.attribute = attribute role { text }
+  db.year.attlist =
+    db.year.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.year =
+    
+    ## The year of publication of a document
+    element year { db.year.attlist, db._text }
+}
+div {
+  db.holder.role.attribute = attribute role { text }
+  db.holder.attlist =
+    db.holder.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.holder =
+    
+    ## The name of the individual or organization that holds a copyright
+    element holder { db.holder.attlist, db._text }
+}
+db.cover.contentmodel =
+  (db.para.blocks
+   | db.extension.blocks
+   | db.list.blocks
+   | db.informal.blocks
+   | db.publishing.blocks
+   | db.graphic.blocks
+   | db.technical.blocks
+   | db.verbatim.blocks
+   | db.bridgehead
+   | db.synopsis.blocks
+   | db.remark
+   | db.revhistory)+
+div {
+  db.cover.role.attribute = attribute role { text }
+  db.cover.attlist =
+    db.cover.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.cover =
+    
+    ## Additional content for the cover of a publication
+    element cover { db.cover.attlist, db.cover.contentmodel }
+}
+db.date.contentmodel =
+  xsd:date | xsd:dateTime | xsd:gYearMonth | xsd:gYear | text
+div {
+  db.date.role.attribute = attribute role { text }
+  db.date.attlist =
+    db.date.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.date =
+    
+    ## The date of publication or revision of a document
+    element date { db.date.attlist, db.date.contentmodel }
+}
+div {
+  db.edition.role.attribute = attribute role { text }
+  db.edition.attlist =
+    db.edition.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.edition =
+    
+    ## The name or number of an edition of a document
+    element edition { db.edition.attlist, db._text }
+}
+div {
+  db.editor.role.attribute = attribute role { text }
+  db.editor.attlist =
+    db.editor.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.editor =
+    
+    ## The name of the editor of a document
+    element editor { db.editor.attlist, db.credit.contentmodel }
+}
+div {
+  db.biblioid.role.attribute = attribute role { text }
+  db.biblioid.attlist =
+    db.biblioid.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.biblio.class.attribute
+  db.biblioid =
+    
+    ## An identifier for a document
+    element biblioid { db.biblioid.attlist, db._text }
+}
+div {
+  db.citebiblioid.role.attribute = attribute role { text }
+  db.citebiblioid.attlist =
+    db.citebiblioid.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.biblio.class.attribute
+  db.citebiblioid =
+    
+    ## A citation of a bibliographic identifier
+    element citebiblioid { db.citebiblioid.attlist, db._text }
+}
+div {
+  db.bibliosource.role.attribute = attribute role { text }
+  db.bibliosource.attlist =
+    db.bibliosource.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.biblio.class.attribute
+  db.bibliosource =
+    
+    ## The source of a document
+    element bibliosource { db.bibliosource.attlist, db._text }
+}
+div {
+  db.bibliorelation.type.enumeration =
+    
+    ## The described resource pre-existed the referenced resource, which is essentially the same intellectual content presented in another format
+    "hasformat"
+    | 
+      ## The described resource includes the referenced resource either physically or logically
+      "haspart"
+    | 
+      ## The described resource has a version, edition, or adaptation, namely, the referenced resource
+      "hasversion"
+    | 
+      ## The described resource is the same intellectual content of the referenced resource, but presented in another format
+      "isformatof"
+    | 
+      ## The described resource is a physical or logical part of the referenced resource
+      "ispartof"
+    | 
+      ## The described resource is referenced, cited, or otherwise pointed to by the referenced resource
+      "isreferencedby"
+    | 
+      ## The described resource is supplanted, displaced, or superceded by the referenced resource
+      "isreplacedby"
+    | 
+      ## The described resource is required by the referenced resource, either physically or logically
+      "isrequiredby"
+    | 
+      ## The described resource is a version, edition, or adaptation of the referenced resource; changes in version imply substantive changes in content rather than differences in format
+      "isversionof"
+    | 
+      ## The described resource references, cites, or otherwise points to the referenced resource
+      "references"
+    | 
+      ## The described resource supplants, displaces, or supersedes the referenced resource
+      "replaces"
+    | 
+      ## The described resource requires the referenced resource to support its function, delivery, or coherence of content
+      "requires"
+  db.bibliorelation.type-enum.attribute =
+    
+    ## Identifies the type of relationship
+    attribute type { db.bibliorelation.type.enumeration }?
+  db.bibliorelation.type-other.attributes =
+    
+    ## Identifies the type of relationship
+    attribute type {
+      
+      ## The described resource has a non-standard relationship with the referenced resource
+      "othertype"
+    }?,
+    
+    ## A keyword that identififes the type of the non-standard relationship
+    attribute othertype { xsd:NMTOKEN }
+  db.bibliorelation.type.attribute =
+    db.bibliorelation.type-enum.attribute
+    | db.bibliorelation.type-other.attributes
+  db.bibliorelation.role.attribute = attribute role { text }
+  db.bibliorelation.attlist =
+    db.bibliorelation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.biblio.class.attribute
+    & db.bibliorelation.type.attribute
+  db.bibliorelation =
+    
+    ## The relationship of a document to another
+    element bibliorelation { db.bibliorelation.attlist, db._text }
+}
+div {
+  db.bibliocoverage.spacial.enumeration =
+    
+    ## The DCMI Point identifies a point in space using its geographic coordinates
+    "dcmipoint"
+    | 
+      ## ISO 3166 Codes for the representation of names of countries
+      "iso3166"
+    | 
+      ## The DCMI Box identifies a region of space using its geographic limits
+      "dcmibox"
+    | 
+      ## The Getty Thesaurus of Geographic Names
+      "tgn"
+  db.bibliocoverage.spatial-enum.attribute =
+    
+    ## Specifies the type of spatial coverage
+    attribute spatial { db.bibliocoverage.spacial.enumeration }?
+  db.bibliocoverage.spatial-other.attributes =
+    
+    ## Specifies the type of spatial coverage
+    attribute spatial {
+      
+      ## Identifies a non-standard type of coverage
+      "otherspatial"
+    }?,
+    
+    ## A keyword that identifies the type of non-standard coverage
+    attribute otherspatial { xsd:NMTOKEN }
+  db.bibliocoverage.spatial.attribute =
+    db.bibliocoverage.spatial-enum.attribute
+    | db.bibliocoverage.spatial-other.attributes
+  db.bibliocoverage.temporal.enumeration =
+    
+    ## A specification of the limits of a time interval
+    "dcmiperiod"
+    | 
+      ## W3C Encoding rules for dates and times - a profile based on ISO 8601
+      "w3c-dtf"
+  db.bibliocoverage.temporal-enum.attribute =
+    
+    ## Specifies the type of temporal coverage
+    attribute temporal { db.bibliocoverage.temporal.enumeration }?
+  db.bibliocoverage.temporal-other.attributes =
+    
+    ## Specifies the type of temporal coverage
+    attribute temporal {
+      
+      ## Specifies a non-standard type of coverage
+      "othertemporal"
+    }?,
+    
+    ## A keyword that identifies the type of non-standard coverage
+    attribute othertemporal { xsd:NMTOKEN }
+  db.bibliocoverage.temporal.attribute =
+    db.bibliocoverage.temporal-enum.attribute
+    | db.bibliocoverage.temporal-other.attributes
+  db.bibliocoverage.coverage.attrib =
+    db.bibliocoverage.spatial.attribute
+    & db.bibliocoverage.temporal.attribute
+  db.bibliocoverage.role.attribute = attribute role { text }
+  db.bibliocoverage.attlist =
+    db.bibliocoverage.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.bibliocoverage.coverage.attrib
+  db.bibliocoverage =
+    
+    ## The spatial or temporal coverage of a document
+    element bibliocoverage { db.bibliocoverage.attlist, db._text }
+}
+div {
+  db.legalnotice.role.attribute = attribute role { text }
+  db.legalnotice.attlist =
+    db.legalnotice.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.legalnotice.info = db._info.title.only
+  db.legalnotice =
+    
+    ## A statement of legal obligations or requirements
+    element legalnotice {
+      db.legalnotice.attlist, db.legalnotice.info, db.all.blocks+
+    }
+}
+div {
+  db.othercredit.class.enumeration =
+    
+    ## A copy editor
+    "copyeditor"
+    | 
+      ## A graphic designer
+      "graphicdesigner"
+    | 
+      ## Some other contributor
+      "other"
+    | 
+      ## A production editor
+      "productioneditor"
+    | 
+      ## A technical editor
+      "technicaleditor"
+    | 
+      ## A translator
+      "translator"
+  db.othercredit.class-enum.attribute =
+    
+    ## Identifies the nature of the contributor
+    attribute class { db.othercredit.class.enumeration }?
+  db.othercredit.class-other.attribute =
+    
+    ## Identifies the nature of the non-standard contribution
+    attribute otherclass { xsd:NMTOKEN }
+  db.othercredit.class-other.attributes =
+    
+    ## Identifies the nature of the contributor
+    attribute class {
+      
+      ## Identifies a non-standard contribution
+      "other"
+    }
+    & db.othercredit.class-other.attribute
+  db.othercredit.class.attribute =
+    db.othercredit.class-enum.attribute
+    | db.othercredit.class-other.attributes
+  db.othercredit.role.attribute = attribute role { text }
+  db.othercredit.attlist =
+    db.othercredit.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.othercredit.class.attribute
+  db.othercredit =
+    
+    ## A person or entity, other than an author or editor, credited in a document
+    element othercredit {
+      db.othercredit.attlist, db.credit.contentmodel
+    }
+}
+div {
+  db.pagenums.role.attribute = attribute role { text }
+  db.pagenums.attlist =
+    db.pagenums.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.pagenums =
+    
+    ## The numbers of the pages in a book, for use in a bibliographic entry
+    element pagenums { db.pagenums.attlist, db._text }
+}
+div {
+  db.contrib.role.attribute = attribute role { text }
+  db.contrib.attlist =
+    db.contrib.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.contrib =
+    
+    ## A summary of the contributions made to a document by a credited source
+    element contrib { db.contrib.attlist, db._text }
+}
+div {
+  db.honorific.role.attribute = attribute role { text }
+  db.honorific.attlist =
+    db.honorific.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.honorific =
+    
+    ## The title of a person
+    element honorific { db.honorific.attlist, db._text }
+}
+div {
+  db.firstname.role.attribute = attribute role { text }
+  db.firstname.attlist =
+    db.firstname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.firstname =
+    
+    ## The first name of a person
+    element firstname { db.firstname.attlist, db._text }
+}
+div {
+  db.surname.role.attribute = attribute role { text }
+  db.surname.attlist =
+    db.surname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.surname =
+    
+    ## A family name; in western cultures the last name
+    element surname { db.surname.attlist, db._text }
+}
+div {
+  db.lineage.role.attribute = attribute role { text }
+  db.lineage.attlist =
+    db.lineage.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.lineage =
+    
+    ## The portion of a person's name indicating a relationship to ancestors
+    element lineage { db.lineage.attlist, db._text }
+}
+div {
+  db.othername.role.attribute = attribute role { text }
+  db.othername.attlist =
+    db.othername.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.othername =
+    
+    ## A component of a persons name that is not a first name, surname, or lineage
+    element othername { db.othername.attlist, db._text }
+}
+div {
+  db.printhistory.role.attribute = attribute role { text }
+  db.printhistory.attlist =
+    db.printhistory.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.printhistory =
+    
+    ## The printing history of a document
+    element printhistory { db.printhistory.attlist, db.para.blocks+ }
+}
+div {
+  db.productname.role.attribute = attribute role { text }
+  db.productname.class.enumeration =
+    
+    ## A name with a copyright
+    "copyright"
+    | 
+      ## A name with a registered copyright
+      "registered"
+    | 
+      ## A name of a service
+      "service"
+    | 
+      ## A name which is trademarked
+      "trade"
+  db.productname.class.attribute =
+    
+    ## Specifies the class of product name
+    attribute class { db.productname.class.enumeration }
+  db.productname.attlist =
+    db.productname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.productname.class.attribute?
+  db.productname =
+    
+    ## The formal name of a product
+    element productname { db.productname.attlist, db._text }
+}
+div {
+  db.productnumber.role.attribute = attribute role { text }
+  db.productnumber.attlist =
+    db.productnumber.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.productnumber =
+    
+    ## A number assigned to a product
+    element productnumber { db.productnumber.attlist, db._text }
+}
+div {
+  db.pubdate.role.attribute = attribute role { text }
+  db.pubdate.attlist =
+    db.pubdate.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.pubdate =
+    
+    ## The date of publication of a document
+    element pubdate { db.pubdate.attlist, db.date.contentmodel }
+}
+div {
+  db.publisher.role.attribute = attribute role { text }
+  db.publisher.attlist =
+    db.publisher.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.publisher =
+    
+    ## The publisher of a document
+    element publisher {
+      db.publisher.attlist, db.publishername, db.address*
+    }
+}
+div {
+  db.publishername.role.attribute = attribute role { text }
+  db.publishername.attlist =
+    db.publishername.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.publishername =
+    
+    ## The name of the publisher of a document
+    element publishername { db.publishername.attlist, db._text }
+}
+div {
+  db.releaseinfo.role.attribute = attribute role { text }
+  db.releaseinfo.attlist =
+    db.releaseinfo.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.releaseinfo =
+    
+    ## Information about a particular release of a document
+    element releaseinfo { db.releaseinfo.attlist, db._text }
+}
+div {
+  db.revhistory.role.attribute = attribute role { text }
+  db.revhistory.attlist =
+    db.revhistory.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.revhistory.info = db._info.title.only
+  db.revhistory =
+    
+    ## A history of the revisions to a document
+    element revhistory {
+      db.revhistory.attlist, db.revhistory.info, db.revision+
+    }
+}
+div {
+  db.revision.role.attribute = attribute role { text }
+  db.revision.attlist =
+    db.revision.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.revision =
+    
+    ## An entry describing a single revision in the history of the revisions to a document
+    element revision {
+      db.revision.attlist,
+      db.revnumber?,
+      db.date,
+      (db.authorinitials | db.author)*,
+      (db.revremark | db.revdescription)?
+    }
+}
+div {
+  db.revnumber.role.attribute = attribute role { text }
+  db.revnumber.attlist =
+    db.revnumber.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.revnumber =
+    
+    ## A document revision number
+    element revnumber { db.revnumber.attlist, db._text }
+}
+div {
+  db.revremark.role.attribute = attribute role { text }
+  db.revremark.attlist =
+    db.revremark.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.revremark =
+    
+    ## A description of a revision to a document
+    element revremark { db.revremark.attlist, db._text }
+}
+div {
+  db.revdescription.role.attribute = attribute role { text }
+  db.revdescription.attlist =
+    db.revdescription.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.revdescription =
+    
+    ## A extended description of a revision to a document
+    element revdescription { db.revdescription.attlist, db.all.blocks* }
+}
+div {
+  db.seriesvolnums.role.attribute = attribute role { text }
+  db.seriesvolnums.attlist =
+    db.seriesvolnums.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.seriesvolnums =
+    
+    ## Numbers of the volumes in a series of books
+    element seriesvolnums { db.seriesvolnums.attlist, db._text }
+}
+div {
+  db.volumenum.role.attribute = attribute role { text }
+  db.volumenum.attlist =
+    db.volumenum.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.volumenum =
+    
+    ## The volume number of a document in a set (as of books in a set or articles in a journal)
+    element volumenum { db.volumenum.attlist, db._text }
+}
+div {
+  db.issuenum.role.attribute = attribute role { text }
+  db.issuenum.attlist =
+    db.issuenum.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.issuenum =
+    
+    ## The number of an issue of a journal
+    element issuenum { db.issuenum.attlist, db._text }
+}
+div {
+  db.accel.role.attribute = attribute role { text }
+  db.accel.attlist =
+    db.accel.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.accel =
+    
+    ## A graphical user interface (GUI) keyboard shortcut
+    element accel { db.accel.attlist, db._text }
+}
+div {
+  db.application.class.enumeration =
+    
+    ## A hardware application
+    "hardware"
+    | 
+      ## A software application
+      "software"
+  db.application.class.attribute =
+    
+    ## Identifies the class of application
+    attribute class { db.application.class.enumeration }
+  db.application.role.attribute = attribute role { text }
+  db.application.attlist =
+    db.application.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.application.class.attribute?
+  db.application =
+    
+    ## The name of a software program
+    element application { db.application.attlist, db._text }
+}
+div {
+  db.package.role.attribute = attribute role { text }
+  db.package.attlist =
+    db.package.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.package =
+    
+    ## A software or application package
+    element package { db.package.attlist, db._text }
+}
+div {
+  db.classname.role.attribute = attribute role { text }
+  db.classname.attlist =
+    db.classname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.classname =
+    
+    ## The name of a class, in the object-oriented programming sense
+    element classname { db.classname.attlist, db._text }
+}
+div {
+  db.command.role.attribute = attribute role { text }
+  db.command.attlist =
+    db.command.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.command =
+    
+    ## The name of an executable program or other software command
+    element command { db.command.attlist, db._text }
+}
+db.computeroutput.inlines =
+  (text
+   | db.ubiq.inlines
+   | db.os.inlines
+   | db.technical.inlines
+   | db.markup.inlines)
+  | db.co
+div {
+  db.computeroutput.role.attribute = attribute role { text }
+  db.computeroutput.attlist =
+    db.computeroutput.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.computeroutput =
+    
+    ## Data, generally text, displayed or presented by a computer
+    element computeroutput {
+      db.computeroutput.attlist, db.computeroutput.inlines*
+    }
+}
+div {
+  db.database.class.enumeration =
+    
+    ## An alternate or secondary key
+    "altkey"
+    | 
+      ## A constraint
+      "constraint"
+    | 
+      ## A data type
+      "datatype"
+    | 
+      ## A field
+      "field"
+    | 
+      ## A foreign key
+      "foreignkey"
+    | 
+      ## A group
+      "group"
+    | 
+      ## An index
+      "index"
+    | 
+      ## The first or primary key
+      "key1"
+    | 
+      ## An alternate or secondary key
+      "key2"
+    | 
+      ## A name
+      "name"
+    | 
+      ## The primary key
+      "primarykey"
+    | 
+      ## A (stored) procedure
+      "procedure"
+    | 
+      ## A record
+      "record"
+    | 
+      ## A rule
+      "rule"
+    | 
+      ## The secondary key
+      "secondarykey"
+    | 
+      ## A table
+      "table"
+    | 
+      ## A user
+      "user"
+    | 
+      ## A view
+      "view"
+  db.database.class.attribute =
+    
+    ## Identifies the class of database artifact
+    attribute class { db.database.class.enumeration }
+  db.database.role.attribute = attribute role { text }
+  db.database.attlist =
+    db.database.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.database.class.attribute?
+  db.database =
+    
+    ## The name of a database, or part of a database
+    element database { db.database.attlist, db._text }
+}
+div {
+  db.email.role.attribute = attribute role { text }
+  db.email.attlist =
+    db.email.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.email =
+    
+    ## An email address
+    element email { db.email.attlist, db._text }
+}
+div {
+  db.envar.role.attribute = attribute role { text }
+  db.envar.attlist =
+    db.envar.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.envar =
+    
+    ## A software environment variable
+    element envar { db.envar.attlist, db._text }
+}
+div {
+  db.errorcode.role.attribute = attribute role { text }
+  db.errorcode.attlist =
+    db.errorcode.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.errorcode =
+    
+    ## An error code
+    element errorcode { db.errorcode.attlist, db._text }
+}
+div {
+  db.errorname.role.attribute = attribute role { text }
+  db.errorname.attlist =
+    db.errorname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.errorname =
+    
+    ## An error name
+    element errorname { db.errorname.attlist, db._text }
+}
+div {
+  db.errortext.role.attribute = attribute role { text }
+  db.errortext.attlist =
+    db.errortext.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.errortext =
+    
+    ## An error message.
+    element errortext { db.errortext.attlist, db._text }
+}
+div {
+  db.errortype.role.attribute = attribute role { text }
+  db.errortype.attlist =
+    db.errortype.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.errortype =
+    
+    ## The classification of an error message
+    element errortype { db.errortype.attlist, db._text }
+}
+div {
+  db.filename.class.enumeration =
+    
+    ## A device
+    "devicefile"
+    | 
+      ## A directory
+      "directory"
+    | 
+      ## A filename extension
+      "extension"
+    | 
+      ## A header file (as for a programming language)
+      "headerfile"
+    | 
+      ## A library file
+      "libraryfile"
+    | 
+      ## A partition (as of a hard disk)
+      "partition"
+    | 
+      ## A symbolic link
+      "symlink"
+  db.filename.class.attribute =
+    
+    ## Identifies the class of filename
+    attribute class { db.filename.class.enumeration }
+  db.filename.path.attribute =
+    
+    ## Specifies the path of the filename
+    attribute path { text }
+  db.filename.role.attribute = attribute role { text }
+  db.filename.attlist =
+    db.filename.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.filename.path.attribute?
+    & db.filename.class.attribute?
+  db.filename =
+    
+    ## The name of a file
+    element filename { db.filename.attlist, db._text }
+}
+div {
+  db.function.role.attribute = attribute role { text }
+  db.function.attlist =
+    db.function.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.function =
+    
+    ## The name of a function or subroutine, as in a programming language
+    element function { db.function.attlist, db._text }
+}
+div {
+  db.guibutton.role.attribute = attribute role { text }
+  db.guibutton.attlist =
+    db.guibutton.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.guibutton =
+    
+    ## The text on a button in a GUI
+    element guibutton {
+      db.guibutton.attlist,
+      (db._text | db.accel | db.superscript | db.subscript)*
+    }
+}
+div {
+  db.guiicon.role.attribute = attribute role { text }
+  db.guiicon.attlist =
+    db.guiicon.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.guiicon =
+    
+    ## Graphic and/or text appearing as a icon in a GUI
+    element guiicon {
+      db.guiicon.attlist,
+      (db._text | db.accel | db.superscript | db.subscript)*
+    }
+}
+div {
+  db.guilabel.role.attribute = attribute role { text }
+  db.guilabel.attlist =
+    db.guilabel.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.guilabel =
+    
+    ## The text of a label in a GUI
+    element guilabel {
+      db.guilabel.attlist,
+      (db._text | db.accel | db.superscript | db.subscript)*
+    }
+}
+div {
+  db.guimenu.role.attribute = attribute role { text }
+  db.guimenu.attlist =
+    db.guimenu.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.guimenu =
+    
+    ## The name of a menu in a GUI
+    element guimenu {
+      db.guimenu.attlist,
+      (db._text | db.accel | db.superscript | db.subscript)*
+    }
+}
+div {
+  db.guimenuitem.role.attribute = attribute role { text }
+  db.guimenuitem.attlist =
+    db.guimenuitem.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.guimenuitem =
+    
+    ## The name of a terminal menu item in a GUI
+    element guimenuitem {
+      db.guimenuitem.attlist,
+      (db._text | db.accel | db.superscript | db.subscript)*
+    }
+}
+div {
+  db.guisubmenu.role.attribute = attribute role { text }
+  db.guisubmenu.attlist =
+    db.guisubmenu.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.guisubmenu =
+    
+    ## The name of a submenu in a GUI
+    element guisubmenu {
+      db.guisubmenu.attlist,
+      (db._text | db.accel | db.superscript | db.subscript)*
+    }
+}
+div {
+  db.hardware.role.attribute = attribute role { text }
+  db.hardware.attlist =
+    db.hardware.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.hardware =
+    
+    ## A physical part of a computer system
+    element hardware { db.hardware.attlist, db._text }
+}
+div {
+  db.keycap.function.enumeration =
+    
+    ## The "Alt" key
+    "alt"
+    | 
+      ## The "Backspace" key
+      "backspace"
+    | 
+      ## The "Command" key
+      "command"
+    | 
+      ## The "Control" key
+      "control"
+    | 
+      ## The "Delete" key
+      "delete"
+    | 
+      ## The down arrow
+      "down"
+    | 
+      ## The "End" key
+      "end"
+    | 
+      ## The "Enter" or "Return" key
+      "enter"
+    | 
+      ## The "Escape" key
+      "escape"
+    | 
+      ## The "Home" key
+      "home"
+    | 
+      ## The "Insert" key
+      "insert"
+    | 
+      ## The left arrow
+      "left"
+    | 
+      ## The "Meta" key
+      "meta"
+    | 
+      ## The "Option" key
+      "option"
+    | 
+      ## The page down key
+      "pagedown"
+    | 
+      ## The page up key
+      "pageup"
+    | 
+      ## The right arrow
+      "right"
+    | 
+      ## The "Shift" key
+      "shift"
+    | 
+      ## The spacebar
+      "space"
+    | 
+      ## The "Tab" key
+      "tab"
+    | 
+      ## The up arrow
+      "up"
+  db.keycap.function-enum.attribute =
+    
+    ## Identifies the function key
+    attribute function { db.keycap.function.enumeration }?
+  db.keycap.function-other.attributes =
+    
+    ## Identifies the function key
+    attribute function {
+      
+      ## Indicates a non-standard function key
+      "other"
+    }?,
+    
+    ## Specifies a keyword that identifies the non-standard key
+    attribute otherfunction { text }
+  db.keycap.function.attrib =
+    db.keycap.function-enum.attribute
+    | db.keycap.function-other.attributes
+  db.keycap.role.attribute = attribute role { text }
+  db.keycap.attlist =
+    db.keycap.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.keycap.function.attrib
+  db.keycap =
+    
+    ## The text printed on a key on a keyboard
+    element keycap { db.keycap.attlist, db._text }
+}
+div {
+  db.keycode.role.attribute = attribute role { text }
+  db.keycode.attlist =
+    db.keycode.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.keycode =
+    
+    ## The internal, frequently numeric, identifier for a key on a keyboard
+    element keycode { db.keycode.attlist, db._text }
+}
+div {
+  db.keycombo.action.enumeration =
+    
+    ## A (single) mouse click.
+    "click"
+    | 
+      ## A double mouse click.
+      "double-click"
+    | 
+      ## A mouse or key press.
+      "press"
+    | 
+      ## Sequential clicks or presses.
+      "seq"
+    | 
+      ## Simultaneous clicks or presses.
+      "simul"
+  db.keycombo.action-enum.attribute =
+    
+    ## Identifies the nature of the action taken. If keycombo
+    ##  contains more than one element, simul
+    ##  is the default, otherwise there is no default.
+    attribute action { db.keycombo.action.enumeration }?
+  db.keycombo.action-other.attributes =
+    
+    ## Identifies the nature of the action taken
+    attribute action {
+      
+      ## Indicates a non-standard action
+      "other"
+    }?,
+    
+    ## Identifies the non-standard action in some unspecified way.
+    attribute otheraction { text }
+  db.keycombo.action.attrib =
+    db.keycombo.action-enum.attribute
+    | db.keycombo.action-other.attributes
+  db.keycombo.role.attribute = attribute role { text }
+  db.keycombo.attlist =
+    db.keycombo.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.keycombo.action.attrib
+  db.keycombo =
+    
+    ## A combination of input actions
+    element keycombo {
+      db.keycombo.attlist,
+      (db.keycap | db.keycombo | db.keysym | db.mousebutton)+
+    }
+}
+div {
+  db.keysym.role.attribute = attribute role { text }
+  db.keysym.attlist =
+    db.keysym.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.keysym =
+    
+    ## The symbolic name of a key on a keyboard
+    element keysym { db.keysym.attlist, db._text }
+}
+div {
+  db.lineannotation.role.attribute = attribute role { text }
+  db.lineannotation.attlist =
+    db.lineannotation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.lineannotation =
+    
+    ## A comment on a line in a verbatim listing
+    element lineannotation { db.lineannotation.attlist, db._text }
+}
+div {
+  db.literal.role.attribute = attribute role { text }
+  db.literal.attlist =
+    db.literal.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.literal =
+    
+    ## Inline text that is some literal value
+    element literal { db.literal.attlist, db._text }
+}
+div {
+  code.language.attribute =
+    
+    ## Identifies the (computer) language of the code fragment
+    attribute language { text }
+  db.code.role.attribute = attribute role { text }
+  db.code.attlist =
+    db.code.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & code.language.attribute?
+  db.code =
+    
+    ## An inline code fragment
+    element code {
+      db.code.attlist, (db.programming.inlines | db._text)*
+    }
+}
+div {
+  db.constant.class.attribute =
+    
+    ## Identifies the class of constant
+    attribute class {
+      
+      ## The value is a limit of some kind
+      "limit"
+    }
+  db.constant.role.attribute = attribute role { text }
+  db.constant.attlist =
+    db.constant.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.constant.class.attribute?
+  db.constant =
+    
+    ## A programming or system constant
+    element constant { db.constant.attlist, db._text }
+}
+div {
+  db.varname.role.attribute = attribute role { text }
+  db.varname.attlist =
+    db.varname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.varname =
+    
+    ## The name of a variable
+    element varname { db.varname.attlist, db._text }
+}
+div {
+  db.markup.role.attribute = attribute role { text }
+  db.markup.attlist =
+    db.markup.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.markup =
+    
+    ## A string of formatting markup in text that is to be represented literally
+    element markup { db.markup.attlist, db._text }
+}
+div {
+  db.menuchoice.role.attribute = attribute role { text }
+  db.menuchoice.attlist =
+    db.menuchoice.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.menuchoice =
+    
+    ## A selection or series of selections from a menu
+    element menuchoice {
+      db.menuchoice.attlist,
+      db.shortcut?,
+      (db.guibutton
+       | db.guiicon
+       | db.guilabel
+       | db.guimenu
+       | db.guimenuitem
+       | db.guisubmenu)+
+    }
+}
+div {
+  db.shortcut.action.attrib = db.keycombo.action.attrib
+  db.shortcut.role.attribute = attribute role { text }
+  db.shortcut.attlist =
+    db.shortcut.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.shortcut.action.attrib
+  db.shortcut =
+    
+    ## A key combination for an action that is also accessible through a menu
+    element shortcut {
+      db.shortcut.attlist,
+      (db.keycap | db.keycombo | db.keysym | db.mousebutton)+
+    }
+}
+div {
+  db.mousebutton.role.attribute = attribute role { text }
+  db.mousebutton.attlist =
+    db.mousebutton.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.mousebutton =
+    
+    ## The conventional name of a mouse button
+    element mousebutton { db.mousebutton.attlist, db._text }
+}
+div {
+  db.option.role.attribute = attribute role { text }
+  db.option.attlist =
+    db.option.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.option =
+    
+    ## An option for a software command
+    element option { db.option.attlist, db._text }
+}
+div {
+  db.optional.role.attribute = attribute role { text }
+  db.optional.attlist =
+    db.optional.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.optional =
+    
+    ## Optional information
+    element optional { db.optional.attlist, db._text }
+}
+div {
+  db.property.role.attribute = attribute role { text }
+  db.property.attlist =
+    db.property.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.property =
+    
+    ## A unit of data associated with some part of a computer system
+    element property { db.property.attlist, db._text }
+}
+div {
+  db.parameter.class.enumeration =
+    
+    ## A command
+    "command"
+    | 
+      ## A function
+      "function"
+    | 
+      ## An option
+      "option"
+  db.parameter.class.attribute =
+    
+    ## Identifies the class of parameter
+    attribute class { db.parameter.class.enumeration }
+  db.parameter.role.attribute = attribute role { text }
+  db.parameter.attlist =
+    db.parameter.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.parameter.class.attribute?
+  db.parameter =
+    
+    ## A value or a symbolic reference to a value
+    element parameter { db.parameter.attlist, db._text }
+}
+db.prompt.inlines = db._text | db.co
+div {
+  db.prompt.role.attribute = attribute role { text }
+  db.prompt.attlist =
+    db.prompt.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.prompt =
+    
+    ## A character or string indicating the start of an input field in a  computer display
+    element prompt { db.prompt.attlist, db.prompt.inlines* }
+}
+db.replaceable.inlines = db._text | db.co
+div {
+  db.replaceable.class.enumeration =
+    
+    ## A command
+    "command"
+    | 
+      ## A function
+      "function"
+    | 
+      ## An option
+      "option"
+    | 
+      ## A parameter
+      "parameter"
+  db.replaceable.class.attribute =
+    
+    ## Identifies the nature of the replaceable text
+    attribute class { db.replaceable.class.enumeration }
+  db.replaceable.role.attribute = attribute role { text }
+  db.replaceable.attlist =
+    db.replaceable.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.replaceable.class.attribute?
+  db.replaceable =
+    
+    ## Content that may or must be replaced by the user
+    element replaceable {
+      db.replaceable.attlist, db.replaceable.inlines*
+    }
+}
+div {
+  db.returnvalue.role.attribute = attribute role { text }
+  db.returnvalue.attlist =
+    db.returnvalue.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.returnvalue =
+    
+    ## The value returned by a function
+    element returnvalue { db.returnvalue.attlist, db._text }
+}
+div {
+  db.tag.role.attribute = attribute role { text }
+  db.tag.class.enumeration =
+    
+    ## An attribute
+    "attribute"
+    | 
+      ## An attribute value
+      "attvalue"
+    | 
+      ## An element
+      "element"
+    | 
+      ## An empty element tag
+      "emptytag"
+    | 
+      ## An end tag
+      "endtag"
+    | 
+      ## A general entity
+      "genentity"
+    | 
+      ## The local name part of a qualified name
+      "localname"
+    | 
+      ## A namespace
+      "namespace"
+    | 
+      ## A numeric character reference
+      "numcharref"
+    | 
+      ## A parameter entity
+      "paramentity"
+    | 
+      ## A processing instruction
+      "pi"
+    | 
+      ## The prefix part of a qualified name
+      "prefix"
+    | 
+      ## An SGML comment
+      "comment"
+    | 
+      ## A start tag
+      "starttag"
+    | 
+      ## An XML processing instruction
+      "xmlpi"
+  db.tag.class.attribute =
+    
+    ## Identifies the nature of the tag content
+    attribute class { db.tag.class.enumeration }
+  db.tag.namespace.attribute =
+    
+    ## Identifies the namespace of the tag content
+    attribute namespace { xsd:anyURI }
+  db.tag.attlist =
+    db.tag.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.tag.class.attribute?
+    & db.tag.namespace.attribute?
+  db.tag =
+    
+    ## A component of XML (or SGML) markup
+    element tag { db.tag.attlist, db._text }
+}
+div {
+  db.symbol.class.attribute =
+    
+    ## Identifies the class of symbol
+    attribute class {
+      
+      ## The value is a limit of some kind
+      "limit"
+    }
+  db.symbol.role.attribute = attribute role { text }
+  db.symbol.attlist =
+    db.symbol.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.symbol.class.attribute?
+  db.symbol =
+    
+    ## A name that is replaced by a value before processing
+    element symbol { db.symbol.attlist, db._text }
+}
+db.systemitem.inlines = db._text | db.co
+div {
+  db.systemitem.class.enumeration =
+    
+    ## A daemon or other system process (syslogd)
+    "daemon"
+    | 
+      ## A domain name (example.com)
+      "domainname"
+    | 
+      ## An ethernet address (00:05:4E:49:FD:8E)
+      "etheraddress"
+    | 
+      ## An event of some sort (SIGHUP)
+      "event"
+    | 
+      ## An event handler of some sort (hangup)
+      "eventhandler"
+    | 
+      ## A filesystem (ext3)
+      "filesystem"
+    | 
+      ## A fully qualified domain name (my.example.com)
+      "fqdomainname"
+    | 
+      ## A group name (wheel)
+      "groupname"
+    | 
+      ## An IP address (127.0.0.1)
+      "ipaddress"
+    | 
+      ## A library (libncurses)
+      "library"
+    | 
+      ## A macro
+      "macro"
+    | 
+      ## A netmask (255.255.255.192)
+      "netmask"
+    | 
+      ## A newsgroup (comp.text.xml)
+      "newsgroup"
+    | 
+      ## An operating system name (Hurd)
+      "osname"
+    | 
+      ## A process (gnome-cups-icon)
+      "process"
+    | 
+      ## A protocol (ftp)
+      "protocol"
+    | 
+      ## A resource
+      "resource"
+    | 
+      ## A server (mail.example.com)
+      "server"
+    | 
+      ## A service (ppp)
+      "service"
+    | 
+      ## A system name (hephaistos)
+      "systemname"
+    | 
+      ## A user name (ndw)
+      "username"
+  db.systemitem.class.attribute =
+    
+    ## Identifies the nature of the system item
+    attribute class { db.systemitem.class.enumeration }
+  db.systemitem.role.attribute = attribute role { text }
+  db.systemitem.attlist =
+    db.systemitem.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.systemitem.class.attribute?
+  db.systemitem =
+    
+    ## A system-related item or term
+    element systemitem { db.systemitem.attlist, db.systemitem.inlines* }
+}
+div {
+  db.uri.type.attribute =
+    
+    ## Identifies the type of URI specified
+    attribute type { text }?
+  db.uri.role.attribute = attribute role { text }
+  db.uri.attlist =
+    db.uri.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.uri.type.attribute
+  db.uri =
+    
+    ## A Uniform Resource Identifier
+    element uri { db.uri.attlist, db._text }
+}
+div {
+  db.token.role.attribute = attribute role { text }
+  db.token.attlist =
+    db.token.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.token =
+    
+    ## A unit of information
+    element token { db.token.attlist, db._text }
+}
+div {
+  db.type.role.attribute = attribute role { text }
+  db.type.attlist =
+    db.type.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.type =
+    
+    ## The classification of a value
+    element type { db.type.attlist, db._text }
+}
+db.userinput.inlines =
+  (text
+   | db.ubiq.inlines
+   | db.os.inlines
+   | db.technical.inlines
+   | db.markup.inlines)
+  | db.co
+div {
+  db.userinput.role.attribute = attribute role { text }
+  db.userinput.attlist =
+    db.userinput.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.userinput =
+    
+    ## Data entered by the user
+    element userinput { db.userinput.attlist, db.userinput.inlines* }
+}
+div {
+  db.abbrev.role.attribute = attribute role { text }
+  db.abbrev.attlist =
+    db.abbrev.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.abbrev =
+    
+    ## An abbreviation, especially one followed by a period
+    element abbrev {
+      db.abbrev.attlist,
+      (db._text | db.superscript | db.subscript | db.trademark)*
+    }
+}
+div {
+  db.acronym.role.attribute = attribute role { text }
+  db.acronym.attlist =
+    db.acronym.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.acronym =
+    
+    ## An often pronounceable word made from the initial (or selected) letters of a name or phrase
+    element acronym {
+      db.acronym.attlist,
+      (db._text | db.superscript | db.subscript | db.trademark)*
+    }
+}
+div {
+  db.citation.role.attribute = attribute role { text }
+  db.citation.attlist =
+    db.citation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.citation =
+    
+    ## An inline bibliographic reference to another published work
+    element citation { db.citation.attlist, db.all.inlines* }
+}
+div {
+  db.citerefentry.role.attribute = attribute role { text }
+  db.citerefentry.attlist =
+    db.citerefentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.citerefentry =
+    
+    ## A citation to a reference page
+    element citerefentry {
+      db.citerefentry.attlist, db.refentrytitle, db.manvolnum?
+    }
+}
+div {
+  db.refentrytitle.role.attribute = attribute role { text }
+  db.refentrytitle.attlist =
+    db.refentrytitle.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refentrytitle =
+    
+    ## The title of a reference page
+    element refentrytitle { db.refentrytitle.attlist, db.all.inlines* }
+}
+div {
+  db.manvolnum.role.attribute = attribute role { text }
+  db.manvolnum.attlist =
+    db.manvolnum.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.manvolnum =
+    
+    ## A reference volume number
+    element manvolnum { db.manvolnum.attlist, db._text }
+}
+div {
+  db.citetitle.pubwork.enumeration =
+    
+    ## An article
+    "article"
+    | 
+      ## A bulletin board system
+      "bbs"
+    | 
+      ## A book
+      "book"
+    | 
+      ## A CD-ROM
+      "cdrom"
+    | 
+      ## A chapter (as of a book)
+      "chapter"
+    | 
+      ## A DVD
+      "dvd"
+    | 
+      ## An email message
+      "emailmessage"
+    | 
+      ## A gopher page
+      "gopher"
+    | 
+      ## A journal
+      "journal"
+    | 
+      ## A manuscript
+      "manuscript"
+    | 
+      ## A posting to a newsgroup
+      "newsposting"
+    | 
+      ## A part (as of a book)
+      "part"
+    | 
+      ## A reference entry
+      "refentry"
+    | 
+      ## A section (as of a book or article)
+      "section"
+    | 
+      ## A series
+      "series"
+    | 
+      ## A set (as of books)
+      "set"
+    | 
+      ## A web page
+      "webpage"
+    | 
+      ## A wiki page
+      "wiki"
+  db.citetitle.pubwork.attribute =
+    
+    ## Identifies the nature of the publication being cited
+    attribute pubwork { db.citetitle.pubwork.enumeration }
+  db.citetitle.role.attribute = attribute role { text }
+  db.citetitle.attlist =
+    db.citetitle.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.citetitle.pubwork.attribute?
+  db.citetitle =
+    
+    ## The title of a cited work
+    element citetitle { db.citetitle.attlist, db.all.inlines* }
+}
+div {
+  db.emphasis.role.attribute = attribute role { text }
+  db.emphasis.attlist =
+    db.emphasis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.emphasis =
+    
+    ## Emphasized text
+    element emphasis { db.emphasis.attlist, db.all.inlines* }
+}
+div {
+  db._emphasis =
+    
+    ## A limited span of emphasized text
+    element emphasis { db.emphasis.attlist, (db._text | db._emphasis)* }
+}
+div {
+  db.foreignphrase.role.attribute = attribute role { text }
+  db.foreignphrase.attlist =
+    db.foreignphrase.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.foreignphrase =
+    
+    ## A word or phrase in a language other than the primary language of the document
+    element foreignphrase {
+      db.foreignphrase.attlist, (text | db.general.inlines)*
+    }
+}
+div {
+  db.phrase.role.attribute = attribute role { text }
+  db.phrase.attlist =
+    db.phrase.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.phrase =
+    
+    ## A span of text
+    element phrase { db.phrase.attlist, db.all.inlines* }
+}
+div {
+  db._phrase =
+    
+    ## A limited span of text
+    element phrase { db.phrase.attlist, db._text }
+}
+div {
+  db.quote.role.attribute = attribute role { text }
+  db.quote.attlist =
+    db.quote.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.quote =
+    
+    ## An inline quotation
+    element quote { db.quote.attlist, db.all.inlines* }
+}
+div {
+  db.subscript.role.attribute = attribute role { text }
+  db.subscript.attlist =
+    db.subscript.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.subscript =
+    
+    ## A subscript (as in H2
+    ## O, the molecular formula for water)
+    element subscript { db.subscript.attlist, db._text }
+}
+div {
+  db.superscript.role.attribute = attribute role { text }
+  db.superscript.attlist =
+    db.superscript.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.superscript =
+    
+    ## A superscript (as in x^2, the mathematical notation for x multiplied by itself)
+    element superscript { db.superscript.attlist, db._text }
+}
+div {
+  db.trademark.class.enumeration =
+    
+    ## A copyright
+    "copyright"
+    | 
+      ## A registered copyright
+      "registered"
+    | 
+      ## A service
+      "service"
+    | 
+      ## A trademark
+      "trade"
+  db.trademark.class.attribute =
+    
+    ## Identifies the class of trade mark
+    attribute class { db.trademark.class.enumeration }
+  db.trademark.role.attribute = attribute role { text }
+  db.trademark.attlist =
+    db.trademark.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.trademark.class.attribute?
+  db.trademark =
+    
+    ## A trademark
+    element trademark { db.trademark.attlist, db._text }
+}
+div {
+  db.wordasword.role.attribute = attribute role { text }
+  db.wordasword.attlist =
+    db.wordasword.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.wordasword =
+    
+    ## A word meant specifically as a word and not representing anything else
+    element wordasword { db.wordasword.attlist, db._text }
+}
+div {
+  db.footnoteref.role.attribute = attribute role { text }
+  db.footnoteref.label.attribute = db.label.attribute
+  db.footnoteref.attlist =
+    db.footnoteref.role.attribute?
+    & db.common.attributes
+    & db.linkend.attribute
+    & db.footnoteref.label.attribute?
+  db.footnoteref =
+    
+    ## A cross reference to a footnote (a footnote mark)
+    [
+      s:pattern [
+        name = "Footnote reference type constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnoteref"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test =
+              "local-name(//*[@xml:id=current()/@linkend]) = 'footnote' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+            "@linkend on footnoteref must point to a footnote."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element footnoteref { db.footnoteref.attlist, empty }
+}
+div {
+  db.xref.role.attribute = attribute role { text }
+  db.xref.xrefstyle.attribute = db.xrefstyle.attribute
+  db.xref.endterm.attribute = db.endterm.attribute
+  db.xref.attlist =
+    db.xref.role.attribute?
+    & db.common.attributes
+    & db.common.req.linking.attributes
+    & db.xref.xrefstyle.attribute?
+    & db.xref.endterm.attribute?
+  db.xref =
+    
+    ## A cross reference to another part of the document
+    element xref { db.xref.attlist, empty }
+}
+div {
+  db.link.role.attribute = attribute role { text }
+  db.link.xrefstyle.attribute = db.xrefstyle.attribute
+  db.link.endterm.attribute = db.endterm.attribute
+  db.link.attlist =
+    db.link.role.attribute?
+    & db.common.attributes
+    & db.common.req.linking.attributes
+    & db.link.xrefstyle.attribute?
+    & db.link.endterm.attribute?
+  db.link =
+    
+    ## A hypertext link
+    element link { db.link.attlist, db.all.inlines* }
+}
+div {
+  db.olink.role.attribute = attribute role { text }
+  db.olink.xrefstyle.attribute = db.xrefstyle.attribute
+  db.olink.localinfo.attribute =
+    
+    ## Holds additional information that may be used by the applicatoin when resolving the link
+    attribute localinfo { text }
+  db.olink.targetdoc.attribute =
+    
+    ## Specifies the URI of the document in which the link target appears
+    attribute targetdoc { xsd:anyURI }
+  db.olink.targetptr.attribute =
+    
+    ## Specifies the location of the link target in the document
+    attribute targetptr { text }
+  db.olink.type.attribute =
+    
+    ## Identifies application-specific customization of the link behavior
+    attribute type { text }
+  db.olink.attlist =
+    db.common.attributes
+    & db.olink.targetdoc.attribute?
+    & db.olink.role.attribute?
+    & db.olink.xrefstyle.attribute?
+    & db.olink.localinfo.attribute?
+    & db.olink.targetptr.attribute?
+    & db.olink.type.attribute?
+  db.olink =
+    
+    ## A link that addresses its target indirectly
+    element olink { db.olink.attlist, db.all.inlines* }
+}
+div {
+  db.anchor.role.attribute = attribute role { text }
+  db.anchor.attlist =
+    db.anchor.role.attribute? & db.common.idreq.attributes
+  db.anchor =
+    
+    ## A spot in the document
+    element anchor { db.anchor.attlist, empty }
+}
+div {
+  db.alt.role.attribute = attribute role { text }
+  db.alt.attlist = db.alt.role.attribute? & db.common.attributes
+  db.alt =
+    
+    ## A text-only annotation, often used for accessibility
+    element alt { db.alt.attlist, (text | db.inlinemediaobject)* }
+}
+db.annotations.attribute =
+  
+  ## Identifies one or more annotations that apply to this element
+  attribute annotations { text }
+div {
+  db.annotation.role.attribute = attribute role { text }
+  db.annotation.annotates.attribute =
+    
+    ## Identifies one ore more elements to which this annotation applies
+    attribute annotates { text }
+  db.annotation.attlist =
+    db.annotation.role.attribute?
+    & db.annotation.annotates.attribute?
+    & db.common.attributes
+  db.annotation.info = db._info.title.only
+  db.annotation =
+    
+    ## An annotation
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:annotation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:annotation)"
+            "annotation must not occur in the descendants of annotation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element annotation {
+      db.annotation.attlist, db.annotation.info, db.all.blocks+
+    }
+}
+db.xlink.from.attribute =
+  
+  ## Specifies the XLink traversal-from
+  attribute xlink:from { xsd:NMTOKEN }?
+db.xlink.label.attribute =
+  
+  ## Specifies the XLink label
+  attribute xlink:label { xsd:NMTOKEN }?
+db.xlink.to.attribute =
+  
+  ## Specifies the XLink traversal-to
+  attribute xlink:to { xsd:NMTOKEN }?
+div {
+  db.extendedlink.role.attribute = attribute role { text }
+  db.extendedlink.attlist =
+    db.extendedlink.role.attribute?
+    & db.common.attributes
+    & 
+      ## Identifies the XLink link type 
+      [ a:defaultValue = "extended" ]
+      attribute xlink:type {
+        
+        ## An XLink extended link
+        "extended"
+      }?
+    & db.xlink.role.attribute?
+    & db.xlink.title.attribute?
+  db.extendedlink =
+    
+    ## An XLink extended link
+    element extendedlink {
+      db.extendedlink.attlist, (db.locator | db.arc)+
+    }
+}
+div {
+  db.locator.role.attribute = attribute role { text }
+  db.locator.attlist =
+    db.locator.role.attribute?
+    & db.common.attributes
+    & 
+      ## Identifies the XLink link type 
+      [ a:defaultValue = "locator" ]
+      attribute xlink:type {
+        
+        ## An XLink locator link
+        "locator"
+      }?
+    & db.xlink.href.attribute
+    & db.xlink.role.attribute?
+    & db.xlink.title.attribute?
+    & db.xlink.label.attribute?
+  db.locator =
+    
+    ## An XLink locator in an extendedlink
+    element locator { db.locator.attlist, empty }
+}
+div {
+  db.arc.role.attribute = attribute role { text }
+  db.arc.attlist =
+    db.arc.role.attribute?
+    & db.common.attributes
+    & 
+      ## Identifies the XLink link type 
+      [ a:defaultValue = "arc" ]
+      attribute xlink:type {
+        
+        ## An XLink arc link
+        "arc"
+      }?
+    & db.xlink.arcrole.attribute?
+    & db.xlink.title.attribute?
+    & db.xlink.show.attribute?
+    & db.xlink.actuate.attribute?
+    & db.xlink.from.attribute?
+    & db.xlink.to.attribute?
+  db.arc =
+    
+    ## An XLink arc in an extendedlink
+    element arc { db.arc.attlist, empty }
+}
+db.status.attribute =
+  
+  ## Identifies the editorial or publication status of the element on which it occurs
+  attribute status { text }
+db.toplevel.sections =
+  ((db.section+, db.simplesect*) | db.simplesect+)
+  | (db.sect1+, db.simplesect*)
+  | db.refentry+
+db.toplevel.blocks.or.sections =
+  (db.all.blocks+, db.toplevel.sections?) | db.toplevel.sections
+db.recursive.sections =
+  ((db.section+, db.simplesect*) | db.simplesect+)
+  | db.refentry+
+db.recursive.blocks.or.sections =
+  (db.all.blocks+, db.recursive.sections?) | db.recursive.sections
+db.divisions = db.part | db.reference
+db.components =
+  db.dedication
+  | db.acknowledgements
+  | db.preface
+  | db.chapter
+  | db.appendix
+  | db.article
+  | db.colophon
+db.navigation.components =
+  notAllowed | db.glossary | db.bibliography | db.index | db.toc
+db.component.contentmodel =
+  db.navigation.components*,
+  db.toplevel.blocks.or.sections,
+  db.navigation.components*
+db.setindex.components = notAllowed | db.setindex
+db.toc.components = notAllowed | db.toc
+db.set.components = db.set | db.book
+div {
+  db.set.status.attribute = db.status.attribute
+  db.set.role.attribute = attribute role { text }
+  db.set.attlist =
+    db.set.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.set.status.attribute?
+  db.set.info = db._info.title.req
+  db.set =
+    
+    ## A collection of books
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:set"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element set {
+      db.set.attlist,
+      db.set.info,
+      db.toc.components?,
+      db.set.components+,
+      db.setindex.components?
+    }
+}
+div {
+  db.book.status.attribute = db.status.attribute
+  db.book.role.attribute = attribute role { text }
+  db.book.attlist =
+    db.book.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.book.status.attribute?
+  db.book.info = db._info.title.req
+  db.book =
+    
+    ## A book
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:book"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element book {
+      db.book.attlist,
+      db.book.info,
+      (db.navigation.components | db.components | db.divisions)+
+    }
+}
+div {
+  db.dedication.status.attribute = db.status.attribute
+  db.dedication.role.attribute = attribute role { text }
+  db.dedication.attlist =
+    db.dedication.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.dedication.status.attribute?
+  db.dedication.info = db._info
+  db.dedication =
+    
+    ## The dedication of a book or other component
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:dedication"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element dedication {
+      db.dedication.attlist, db.dedication.info, db.all.blocks+
+    }
+}
+div {
+  db.acknowledgements.status.attribute = db.status.attribute
+  db.acknowledgements.role.attribute = attribute role { text }
+  db.acknowledgements.attlist =
+    db.acknowledgements.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.acknowledgements.status.attribute?
+  db.acknowledgements.info = db._info
+  db.acknowledgements =
+    
+    ## Acknowledgements of a book or other component
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:acknowledgements"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element acknowledgements {
+      db.acknowledgements.attlist,
+      db.acknowledgements.info,
+      db.all.blocks+
+    }
+}
+div {
+  db.colophon.status.attribute = db.status.attribute
+  db.colophon.role.attribute = attribute role { text }
+  db.colophon.attlist =
+    db.colophon.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.colophon.status.attribute?
+  db.colophon.info = db._info
+  db.colophon =
+    
+    ## Text at the back of a book describing facts about its production
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:colophon"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element colophon {
+      db.colophon.attlist, db.colophon.info, db.all.blocks+
+    }
+}
+div {
+  db.appendix.status.attribute = db.status.attribute
+  db.appendix.role.attribute = attribute role { text }
+  db.appendix.attlist =
+    db.appendix.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.appendix.status.attribute?
+  db.appendix.info = db._info.title.req
+  db.appendix =
+    
+    ## An appendix in a Book or Article
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:appendix"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element appendix {
+      db.appendix.attlist, db.appendix.info, db.component.contentmodel
+    }
+}
+div {
+  db.chapter.status.attribute = db.status.attribute
+  db.chapter.role.attribute = attribute role { text }
+  db.chapter.attlist =
+    db.chapter.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.chapter.status.attribute?
+  db.chapter.info = db._info.title.req
+  db.chapter =
+    
+    ## A chapter, as of a book
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:chapter"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element chapter {
+      db.chapter.attlist, db.chapter.info, db.component.contentmodel
+    }
+}
+db.part.components =
+  (db.navigation.components | db.components)
+  | (db.refentry | db.reference)
+div {
+  db.part.status.attribute = db.status.attribute
+  db.part.role.attribute = attribute role { text }
+  db.part.attlist =
+    db.part.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.part.status.attribute?
+  db.part.info = db._info.title.req
+  db.part =
+    
+    ## A division in a book
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:part"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element part {
+      db.part.attlist, db.part.info, db.partintro?, db.part.components+
+    }
+}
+div {
+  db.preface.status.attribute = db.status.attribute
+  db.preface.role.attribute = attribute role { text }
+  db.preface.attlist =
+    db.preface.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.preface.status.attribute?
+  db.preface.info = db._info.title.req
+  db.preface =
+    
+    ## Introductory matter preceding the first chapter of a book
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:preface"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element preface {
+      db.preface.attlist, db.preface.info, db.component.contentmodel
+    }
+}
+div {
+  db.partintro.status.attribute = db.status.attribute
+  db.partintro.role.attribute = attribute role { text }
+  db.partintro.attlist =
+    db.partintro.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.partintro.status.attribute?
+  db.partintro.info = db._info
+  db.partintro =
+    
+    ## An introduction to the contents of a part
+    element partintro {
+      db.partintro.attlist,
+      db.partintro.info,
+      db.toplevel.blocks.or.sections
+    }
+}
+div {
+  db.section.status.attribute = db.status.attribute
+  db.section.role.attribute = attribute role { text }
+  db.section.attlist =
+    db.section.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.section.status.attribute?
+  db.section.info = db._info.title.req
+  db.section =
+    
+    ## A recursive section
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:section"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element section {
+      db.section.attlist,
+      db.section.info,
+      db.recursive.blocks.or.sections,
+      db.navigation.components*
+    }
+}
+div {
+  db.simplesect.status.attribute = db.status.attribute
+  db.simplesect.role.attribute = attribute role { text }
+  db.simplesect.attlist =
+    db.simplesect.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.simplesect.status.attribute?
+  db.simplesect.info = db._info.title.req
+  db.simplesect =
+    
+    ## A section of a document with no subdivisions
+    element simplesect {
+      db.simplesect.attlist, db.simplesect.info, db.all.blocks+
+    }
+}
+db.article.components = db.toplevel.sections
+div {
+  db.article.status.attribute = db.status.attribute
+  db.article.class.enumeration =
+    
+    ## A collection of frequently asked questions.
+    "faq"
+    | 
+      ## An article in a journal or other periodical.
+      "journalarticle"
+    | 
+      ## A description of a product.
+      "productsheet"
+    | 
+      ## A specification.
+      "specification"
+    | 
+      ## A technical report.
+      "techreport"
+    | 
+      ## A white paper.
+      "whitepaper"
+  db.article.class.attribute =
+    
+    ## Identifies the nature of the article
+    attribute class { db.article.class.enumeration }
+  db.article.role.attribute = attribute role { text }
+  db.article.attlist =
+    db.article.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.article.status.attribute?
+    & db.article.class.attribute?
+  db.article.info = db._info.title.req
+  db.article =
+    
+    ## An article
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:article"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element article {
+      db.article.attlist,
+      db.article.info,
+      (db.navigation.components
+       | db.appendix
+       | db.acknowledgements
+       | db.colophon)*,
+      ((db.all.blocks+, db.article.components?)
+       | db.article.components),
+      (db.navigation.components
+       | db.appendix
+       | db.acknowledgements
+       | db.colophon)*
+    }
+}
+db.sect1.sections = (db.sect2+, db.simplesect*) | db.simplesect+
+div {
+  db.sect1.status.attribute = db.status.attribute
+  db.sect1.role.attribute = attribute role { text }
+  db.sect1.attlist =
+    db.sect1.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.sect1.status.attribute?
+  db.sect1.info = db._info.title.req
+  db.sect1 =
+    
+    ## A top-level section of document
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:sect1"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element sect1 {
+      db.sect1.attlist,
+      db.sect1.info,
+      ((db.all.blocks+, db.sect1.sections?) | db.sect1.sections),
+      db.navigation.components*
+    }
+}
+db.sect2.sections = (db.sect3+, db.simplesect*) | db.simplesect+
+div {
+  db.sect2.status.attribute = db.status.attribute
+  db.sect2.role.attribute = attribute role { text }
+  db.sect2.attlist =
+    db.sect2.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.sect2.status.attribute?
+  db.sect2.info = db._info.title.req
+  db.sect2 =
+    
+    ## A subsection within a Sect1
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:sect2"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element sect2 {
+      db.sect2.attlist,
+      db.sect2.info,
+      ((db.all.blocks+, db.sect2.sections?) | db.sect2.sections),
+      db.navigation.components*
+    }
+}
+db.sect3.sections = (db.sect4+, db.simplesect*) | db.simplesect+
+div {
+  db.sect3.status.attribute = db.status.attribute
+  db.sect3.role.attribute = attribute role { text }
+  db.sect3.attlist =
+    db.sect3.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.sect3.status.attribute?
+  db.sect3.info = db._info.title.req
+  db.sect3 =
+    
+    ## A subsection within a Sect2
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:sect3"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element sect3 {
+      db.sect3.attlist,
+      db.sect3.info,
+      ((db.all.blocks+, db.sect3.sections?) | db.sect3.sections),
+      db.navigation.components*
+    }
+}
+db.sect4.sections = (db.sect5+, db.simplesect*) | db.simplesect+
+div {
+  db.sect4.status.attribute = db.status.attribute
+  db.sect4.role.attribute = attribute role { text }
+  db.sect4.attlist =
+    db.sect4.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.sect4.status.attribute?
+  db.sect4.info = db._info.title.req
+  db.sect4 =
+    
+    ## A subsection within a Sect3
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:sect4"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element sect4 {
+      db.sect4.attlist,
+      db.sect4.info,
+      ((db.all.blocks+, db.sect4.sections?) | db.sect4.sections),
+      db.navigation.components*
+    }
+}
+db.sect5.sections = db.simplesect+
+div {
+  db.sect5.status.attribute = db.status.attribute
+  db.sect5.role.attribute = attribute role { text }
+  db.sect5.attlist =
+    db.sect5.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.sect5.status.attribute?
+  db.sect5.info = db._info.title.req
+  db.sect5 =
+    
+    ## A subsection within a Sect4
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:sect5"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element sect5 {
+      db.sect5.attlist,
+      db.sect5.info,
+      ((db.all.blocks+, db.sect5.sections?) | db.sect5.sections),
+      db.navigation.components*
+    }
+}
+db.toplevel.refsection = db.refsection+ | db.refsect1+
+db.secondlevel.refsection = db.refsection+ | db.refsect2+
+db.reference.components = db.refentry
+div {
+  db.reference.role.attribute = attribute role { text }
+  db.reference.attlist =
+    db.reference.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.status.attribute?
+    & db.label.attribute?
+  db.reference.info = db._info.title.req
+  db.reference =
+    
+    ## A collection of reference entries
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:reference"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element reference {
+      db.reference.attlist,
+      db.reference.info,
+      db.partintro?,
+      db.reference.components+
+    }
+}
+div {
+  db.refentry.role.attribute = attribute role { text }
+  db.refentry.attlist =
+    db.refentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.status.attribute?
+    & db.label.attribute?
+  db.refentry.info = db._info.title.forbidden
+  db.refentry =
+    
+    ## A reference page (originally a UNIX man-style reference page)
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:refentry"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element refentry {
+      db.refentry.attlist,
+      db.indexterm*,
+      db.refentry.info,
+      db.refmeta?,
+      db.refnamediv+,
+      db.refsynopsisdiv?,
+      db.toplevel.refsection
+    }
+}
+div {
+  db.refmeta.role.attribute = attribute role { text }
+  db.refmeta.attlist =
+    db.refmeta.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refmeta =
+    
+    ## Meta-information for a reference entry
+    element refmeta {
+      db.refmeta.attlist,
+      db.indexterm*,
+      db.refentrytitle,
+      db.manvolnum?,
+      db.refmiscinfo*,
+      db.indexterm*
+    }
+}
+db.refmiscinfo.class.enumeration =
+  
+  ## The name of the software product or component to which this topic applies
+  "source"
+  | 
+    ## The version of the software product or component to which this topic applies
+    "version"
+  | 
+    ## The section title of the reference page (e.g., User Commands)
+    "manual"
+  | 
+    ## The section title of the reference page (believed synonymous with "manual" but in wide use)
+    "sectdesc"
+  | 
+    ## The name of the software product or component to which this topic applies (e.g., SunOS x.y; believed synonymous with "source" but in wide use)
+    "software"
+db.refmiscinfo.class-enum.attribute =
+  
+  ## Identifies the kind of miscellaneous information
+  attribute class { db.refmiscinfo.class.enumeration }?
+db.refmiscinfo.class-other.attribute =
+  
+  ## Identifies the nature of non-standard miscellaneous information
+  attribute otherclass { text }
+db.refmiscinfo.class-other.attributes =
+  
+  ## Identifies the kind of miscellaneious information
+  attribute class {
+    
+    ## Indicates that the information is some 'other' kind.
+    "other"
+  }
+  & db.refmiscinfo.class-other.attribute
+db.refmiscinfo.class.attribute =
+  db.refmiscinfo.class-enum.attribute
+  | db.refmiscinfo.class-other.attributes
+div {
+  db.refmiscinfo.role.attribute = attribute role { text }
+  db.refmiscinfo.attlist =
+    db.refmiscinfo.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.refmiscinfo.class.attribute?
+  db.refmiscinfo =
+    
+    ## Meta-information for a reference entry other than the title and volume number
+    element refmiscinfo { db.refmiscinfo.attlist, db._text }
+}
+div {
+  db.refnamediv.role.attribute = attribute role { text }
+  db.refnamediv.attlist =
+    db.refnamediv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refnamediv =
+    
+    ## The name, purpose, and classification of a reference page
+    element refnamediv {
+      db.refnamediv.attlist,
+      db.refdescriptor?,
+      db.refname+,
+      db.refpurpose,
+      db.refclass*
+    }
+}
+div {
+  db.refdescriptor.role.attribute = attribute role { text }
+  db.refdescriptor.attlist =
+    db.refdescriptor.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refdescriptor =
+    
+    ## A description of the topic of a reference page
+    element refdescriptor { db.refdescriptor.attlist, db.all.inlines* }
+}
+div {
+  db.refname.role.attribute = attribute role { text }
+  db.refname.attlist =
+    db.refname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refname =
+    
+    ## The name of (one of) the subject(s) of a reference page
+    element refname { db.refname.attlist, db.all.inlines* }
+}
+div {
+  db.refpurpose.role.attribute = attribute role { text }
+  db.refpurpose.attlist =
+    db.refpurpose.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refpurpose =
+    
+    ## A short (one sentence) synopsis of the topic of a reference page
+    element refpurpose { db.refpurpose.attlist, db.all.inlines* }
+}
+div {
+  db.refclass.role.attribute = attribute role { text }
+  db.refclass.attlist =
+    db.refclass.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refclass =
+    
+    ## The scope or other indication of applicability of a reference entry
+    element refclass { db.refclass.attlist, (text | db.application)* }
+}
+div {
+  db.refsynopsisdiv.role.attribute = attribute role { text }
+  db.refsynopsisdiv.attlist =
+    db.refsynopsisdiv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refsynopsisdiv.info = db._info
+  db.refsynopsisdiv =
+    
+    ## A syntactic synopsis of the subject of the reference page
+    element refsynopsisdiv {
+      db.refsynopsisdiv.attlist,
+      db.refsynopsisdiv.info,
+      ((db.all.blocks+, db.secondlevel.refsection?)
+       | db.secondlevel.refsection)
+    }
+}
+div {
+  db.refsection.role.attribute = attribute role { text }
+  db.refsection.attlist =
+    db.refsection.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.status.attribute?
+    & db.label.attribute?
+  db.refsection.info = db._info.title.req
+  db.refsection =
+    
+    ## A recursive section in a refentry
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:refsection"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element refsection {
+      db.refsection.attlist,
+      db.refsection.info,
+      ((db.all.blocks+, db.refsection*) | db.refsection+)
+    }
+}
+db.refsect1.sections = db.refsect2+
+div {
+  db.refsect1.status.attribute = db.status.attribute
+  db.refsect1.role.attribute = attribute role { text }
+  db.refsect1.attlist =
+    db.refsect1.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.refsect1.status.attribute?
+  db.refsect1.info = db._info.title.req
+  db.refsect1 =
+    
+    ## A major subsection of a reference entry
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:refsect1"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element refsect1 {
+      db.refsect1.attlist,
+      db.refsect1.info,
+      ((db.all.blocks+, db.refsect1.sections?) | db.refsect1.sections)
+    }
+}
+db.refsect2.sections = db.refsect3+
+div {
+  db.refsect2.status.attribute = db.status.attribute
+  db.refsect2.role.attribute = attribute role { text }
+  db.refsect2.attlist =
+    db.refsect2.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.refsect2.status.attribute?
+  db.refsect2.info = db._info.title.req
+  db.refsect2 =
+    
+    ## A subsection of a refsect1
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:refsect2"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element refsect2 {
+      db.refsect2.attlist,
+      db.refsect2.info,
+      ((db.all.blocks+, db.refsect2.sections?) | db.refsect2.sections)
+    }
+}
+div {
+  db.refsect3.status.attribute = db.status.attribute
+  db.refsect3.role.attribute = attribute role { text }
+  db.refsect3.attlist =
+    db.refsect3.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.refsect3.status.attribute?
+  db.refsect3.info = db._info.title.req
+  db.refsect3 =
+    
+    ## A subsection of a refsect2
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:refsect3"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element refsect3 {
+      db.refsect3.attlist, db.refsect3.info, db.all.blocks+
+    }
+}
+db.glossary.inlines = db.firstterm | db.glossterm
+db.baseform.attribute =
+  
+  ## Specifies the base form of the term, the one that appears in the glossary. This allows adjectival, plural, and other variations of the term to appear in the element. The element content is the default base form.
+  attribute baseform { text }?
+div {
+  db.glosslist.role.attribute = attribute role { text }
+  db.glosslist.attlist =
+    db.glosslist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.glosslist.info = db._info.title.only
+  db.glosslist =
+    
+    ## A wrapper for a list of glossary entries
+    element glosslist {
+      db.glosslist.attlist,
+      db.glosslist.info?,
+      db.all.blocks*,
+      db.glossentry+
+    }
+}
+div {
+  db.glossentry.role.attribute = attribute role { text }
+  db.glossentry.sortas.attribute =
+    
+    ## Specifies the string by which the element's content is to be sorted; if unspecified, the content is used
+    attribute sortas { text }
+  db.glossentry.attlist =
+    db.glossentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.glossentry.sortas.attribute?
+  db.glossentry =
+    
+    ## An entry in a Glossary or GlossList
+    element glossentry {
+      db.glossentry.attlist,
+      db.glossterm,
+      db.acronym?,
+      db.abbrev?,
+      db.indexterm*,
+      (db.glosssee | db.glossdef+)
+    }
+}
+div {
+  db.glossdef.role.attribute = attribute role { text }
+  db.glossdef.subject.attribute =
+    
+    ## Specifies a list of keywords for the definition
+    attribute subject { text }
+  db.glossdef.attlist =
+    db.glossdef.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.glossdef.subject.attribute?
+  db.glossdef =
+    
+    ## A definition in a GlossEntry
+    element glossdef {
+      db.glossdef.attlist, db.all.blocks+, db.glossseealso*
+    }
+}
+div {
+  db.glosssee.role.attribute = attribute role { text }
+  db.glosssee.otherterm.attribute =
+    
+    ## Identifies the other term
+    attribute otherterm { xsd:IDREF }
+  db.glosssee.attlist =
+    db.glosssee.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.glosssee.otherterm.attribute?
+  db.glosssee =
+    
+    ## A cross-reference from one glossentry
+    ##  to another
+    [
+      s:pattern [
+        name = "Glosssary 'see' type constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:glosssee[@otherterm]"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test =
+              "local-name(//*[@xml:id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'"
+            "@otherterm on glosssee must point to a glossentry."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element glosssee { db.glosssee.attlist, db.all.inlines* }
+}
+div {
+  db.glossseealso.role.attribute = attribute role { text }
+  db.glossseealso.otherterm.attribute =
+    
+    ## Identifies the other term
+    attribute otherterm { xsd:IDREF }
+  db.glossseealso.attlist =
+    db.glossseealso.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.glossseealso.otherterm.attribute?
+  db.glossseealso =
+    
+    ## A cross-reference from one GlossEntry to another
+    [
+      s:pattern [
+        name = "Glossary 'seealso' type constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:glossseealso[@otherterm]"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test =
+              "local-name(//*[@xml:id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'"
+            "@otherterm on glossseealso must point to a glossentry."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element glossseealso { db.glossseealso.attlist, db.all.inlines* }
+}
+div {
+  db.firstterm.role.attribute = attribute role { text }
+  db.firstterm.attlist =
+    db.firstterm.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.baseform.attribute
+  db.firstterm =
+    
+    ## The first occurrence of a term
+    [
+      s:pattern [
+        name = "Glossary 'firstterm' type constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:firstterm[@linkend]"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test =
+              "local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+            "@linkend on firstterm must point to a glossentry."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element firstterm { db.firstterm.attlist, db.all.inlines* }
+}
+div {
+  db.glossterm.role.attribute = attribute role { text }
+  db.glossterm.attlist =
+    db.glossterm.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.baseform.attribute
+  db.glossterm =
+    
+    ## A glossary term
+    [
+      s:pattern [
+        name = "Glossary 'glossterm' type constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:glossterm[@linkend]"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test =
+              "local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+            "@linkend on glossterm must point to a glossentry."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element glossterm { db.glossterm.attlist, db.all.inlines* }
+}
+div {
+  db.glossary.status.attribute = db.status.attribute
+  db.glossary.role.attribute = attribute role { text }
+  db.glossary.attlist =
+    db.glossary.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.glossary.status.attribute?
+  db.glossary.info = db._info
+  db.glossary =
+    
+    ## A glossary
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:glossary"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element glossary {
+      db.glossary.attlist,
+      db.glossary.info,
+      db.all.blocks*,
+      (db.glossdiv* | db.glossentry*),
+      db.bibliography?
+    }
+}
+div {
+  db.glossdiv.status.attribute = db.status.attribute
+  db.glossdiv.role.attribute = attribute role { text }
+  db.glossdiv.attlist =
+    db.glossdiv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.glossdiv.status.attribute?
+  db.glossdiv.info = db._info.title.req
+  db.glossdiv =
+    
+    ## A division in a Glossary
+    element glossdiv {
+      db.glossdiv.attlist,
+      db.glossdiv.info,
+      db.all.blocks*,
+      db.glossentry+
+    }
+}
+div {
+  db.termdef.role.attribute = attribute role { text }
+  db.termdef.attlist =
+    db.termdef.role.attribute?
+    & db.glossentry.sortas.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.baseform.attribute
+  db.termdef =
+    
+    ## An inline definition of a term
+    [
+      s:pattern [
+        name = "Glossary term definition constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:termdef"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "count(db:firstterm) = 1"
+            "A termdef must contain exactly one firstterm"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element termdef { db.termdef.attlist, db.all.inlines* }
+}
+db.relation.attribute =
+  
+  ## Identifies the relationship between the bibliographic elemnts
+  attribute relation { text }
+div {
+  db.biblioentry.role.attribute = attribute role { text }
+  db.biblioentry.attlist =
+    db.biblioentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.biblioentry =
+    
+    ## An entry in a Bibliography
+    element biblioentry {
+      db.biblioentry.attlist, db.bibliographic.elements+
+    }
+}
+div {
+  db.bibliomixed.role.attribute = attribute role { text }
+  db.bibliomixed.attlist =
+    db.bibliomixed.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.bibliomixed =
+    
+    ## An entry in a Bibliography
+    element bibliomixed {
+      db.bibliomixed.attlist, (text | db.bibliographic.elements)*
+    }
+}
+div {
+  db.biblioset.relation.attribute = db.relation.attribute
+  db.biblioset.role.attribute = attribute role { text }
+  db.biblioset.attlist =
+    db.biblioset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.biblioset.relation.attribute?
+  db.biblioset =
+    
+    ## A raw container for related bibliographic information
+    element biblioset {
+      db.biblioset.attlist, db.bibliographic.elements+
+    }
+}
+div {
+  db.bibliomset.relation.attribute = db.relation.attribute
+  db.bibliomset.role.attribute = attribute role { text }
+  db.bibliomset.attlist =
+    db.bibliomset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.bibliomset.relation.attribute?
+  db.bibliomset =
+    
+    ## A cooked container for related bibliographic information
+    element bibliomset {
+      db.bibliomset.attlist, (db._text | db.bibliographic.elements)*
+    }
+}
+div {
+  db.bibliomisc.role.attribute = attribute role { text }
+  db.bibliomisc.attlist =
+    db.bibliomisc.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.bibliomisc =
+    
+    ## Untyped bibliographic information
+    element bibliomisc { db.bibliomisc.attlist, db._text }
+}
+div {
+  db.bibliography.status.attrib = db.status.attribute
+  db.bibliography.role.attribute = attribute role { text }
+  db.bibliography.attlist =
+    db.bibliography.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.bibliography.status.attrib?
+  db.bibliography.info = db._info
+  db.bibliography =
+    
+    ## A bibliography
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:bibliography"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element bibliography {
+      db.bibliography.attlist,
+      db.bibliography.info,
+      db.all.blocks*,
+      (db.bibliodiv+ | (db.biblioentry | db.bibliomixed)+)
+    }
+}
+div {
+  db.bibliodiv.status.attrib = db.status.attribute
+  db.bibliodiv.role.attribute = attribute role { text }
+  db.bibliodiv.attlist =
+    db.bibliodiv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.bibliodiv.status.attrib?
+  db.bibliodiv.info = db._info.title.req
+  db.bibliodiv =
+    
+    ## A section of a Bibliography
+    element bibliodiv {
+      db.bibliodiv.attlist,
+      db.bibliodiv.info,
+      db.all.blocks*,
+      (db.biblioentry | db.bibliomixed)+
+    }
+}
+div {
+  db.bibliolist.role.attribute = attribute role { text }
+  db.bibliolist.attlist =
+    db.bibliolist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.bibliolist.info = db._info.title.only
+  db.bibliolist =
+    
+    ## A wrapper for a list of bibliography entries
+    element bibliolist {
+      db.bibliolist.attlist,
+      db.bibliolist.info?,
+      db.all.blocks*,
+      (db.biblioentry | db.bibliomixed)+
+    }
+}
+div {
+  db.biblioref.role.attribute = attribute role { text }
+  db.biblioref.xrefstyle.attribute = db.xrefstyle.attribute
+  db.biblioref.endterm.attribute = db.endterm.attribute
+  db.biblioref.units.attribute =
+    
+    ## The units (for example, pages) used to identify the beginning and ending of a reference.
+    attribute units { xsd:token }
+  db.biblioref.begin.attribute =
+    
+    ## Identifies the beginning of a reference; the location within the work that is being referenced.
+    attribute begin { xsd:token }
+  db.biblioref.end.attribute =
+    
+    ## Identifies the end of a reference.
+    attribute end { xsd:token }
+  db.biblioref.attlist =
+    db.biblioref.role.attribute?
+    & db.common.attributes
+    & db.common.req.linking.attributes
+    & db.biblioref.xrefstyle.attribute?
+    & db.biblioref.endterm.attribute?
+    & db.biblioref.units.attribute?
+    & db.biblioref.begin.attribute?
+    & db.biblioref.end.attribute?
+  db.biblioref =
+    
+    ## A cross-reference to a bibliographic entry
+    element biblioref { db.biblioref.attlist, empty }
+}
+db.significance.enumeration =
+  
+  ## Normal
+  "normal"
+  | 
+    ## Preferred
+    "preferred"
+db.significance.attribute =
+  
+  ## Specifies the significance of the term
+  attribute significance { db.significance.enumeration }
+db.zone.attribute =
+  
+  ## Specifies the IDs of the elements to which this term applies
+  attribute zone { xsd:IDREFS }
+db.indexterm.pagenum.attribute =
+  
+  ## Indicates the page on which this index term occurs in some version of the printed document
+  attribute pagenum { text }
+db.scope.enumeration =
+  
+  ## All indexes
+  "all"
+  | 
+    ## The global index (as for a combined index of a set of box)
+    "global"
+  | 
+    ## The local index (the index for this document only)
+    "local"
+db.scope.attribute =
+  
+  ## Specifies the scope of the index term
+  attribute scope { db.scope.enumeration }
+db.sortas.attribute =
+  
+  ## Specifies the string by which the term is to be sorted; if unspecified, the term content is used
+  attribute sortas { text }
+db.index.type.attribute =
+  
+  ## Specifies the target index for this term
+  attribute type { text }
+div {
+  db.itermset.role.attribute = attribute role { text }
+  db.itermset.attlist =
+    db.itermset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.itermset =
+    
+    ## A set of index terms in the meta-information of a document
+    element itermset { db.itermset.attlist, db.indexterm.singular+ }
+}
+db.indexterm.contentmodel =
+  db.primary?,
+  ((db.secondary,
+    ((db.tertiary, (db.see | db.seealso+)?)
+     | db.see
+     | db.seealso+)?)
+   | db.see
+   | db.seealso+)?
+div {
+  db.indexterm.singular.role.attribute = attribute role { text }
+  db.indexterm.singular.class.attribute =
+    
+    ## Identifies the class of index term
+    attribute class {
+      
+      ## A singular index term
+      "singular"
+    }
+  db.indexterm.singular.attlist =
+    db.indexterm.singular.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.significance.attribute?
+    & db.zone.attribute?
+    & db.indexterm.pagenum.attribute?
+    & db.scope.attribute?
+    & db.index.type.attribute?
+    & db.indexterm.singular.class.attribute?
+  db.indexterm.singular =
+    
+    ## A wrapper for an indexed term
+    element indexterm {
+      db.indexterm.singular.attlist, db.indexterm.contentmodel
+    }
+}
+div {
+  db.indexterm.startofrange.role.attribute = attribute role { text }
+  db.indexterm.startofrange.class.attribute =
+    
+    ## Identifies the class of index term
+    attribute class {
+      
+      ## The start of a range
+      "startofrange"
+    }
+  db.indexterm.startofrange.attlist =
+    db.indexterm.startofrange.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.significance.attribute?
+    & db.zone.attribute?
+    & db.indexterm.pagenum.attribute?
+    & db.scope.attribute?
+    & db.index.type.attribute?
+    & db.indexterm.startofrange.class.attribute
+  db.indexterm.startofrange =
+    
+    ## A wrapper for an indexed term that covers a range
+    element indexterm {
+      db.indexterm.startofrange.attlist, db.indexterm.contentmodel
+    }
+}
+div {
+  db.indexterm.endofrange.role.attribute = attribute role { text }
+  db.indexterm.endofrange.class.attribute =
+    
+    ## Identifies the class of index term
+    attribute class {
+      
+      ## The end of a range
+      "endofrange"
+    }
+  db.indexterm.endofrange.startref.attribute =
+    
+    ## Points to the start of the range
+    attribute startref { xsd:IDREF }
+  db.indexterm.endofrange.attlist =
+    db.indexterm.endofrange.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.indexterm.endofrange.class.attribute
+    & db.indexterm.endofrange.startref.attribute
+  db.indexterm.endofrange =
+    
+    ## Identifies the end of a range associated with an indexed term
+    element indexterm { db.indexterm.endofrange.attlist, empty }
+}
+div {
+  db.indexterm =
+    db.indexterm.singular
+    | db.indexterm.startofrange
+    | db.indexterm.endofrange
+}
+div {
+  db.primary.role.attribute = attribute role { text }
+  db.primary.attlist =
+    db.primary.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.sortas.attribute?
+  db.primary =
+    
+    ## The primary word or phrase under which an index term should be sorted
+    element primary { db.primary.attlist, db.all.inlines* }
+}
+div {
+  db.secondary.role.attribute = attribute role { text }
+  db.secondary.attlist =
+    db.secondary.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.sortas.attribute?
+  db.secondary =
+    
+    ## A secondary word or phrase in an index term
+    element secondary { db.secondary.attlist, db.all.inlines* }
+}
+div {
+  db.tertiary.role.attribute = attribute role { text }
+  db.tertiary.attlist =
+    db.tertiary.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.sortas.attribute?
+  db.tertiary =
+    
+    ## A tertiary word or phrase in an index term
+    element tertiary { db.tertiary.attlist, db.all.inlines* }
+}
+div {
+  db.see.role.attribute = attribute role { text }
+  db.see.attlist =
+    db.see.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.see =
+    
+    ## Part of an index term directing the reader instead to another entry in the index
+    element see { db.see.attlist, db.all.inlines* }
+}
+div {
+  db.seealso.role.attribute = attribute role { text }
+  db.seealso.attlist =
+    db.seealso.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.seealso =
+    
+    ## Part of an index term directing the reader also to another entry in the index
+    element seealso { db.seealso.attlist, db.all.inlines* }
+}
+div {
+  db.index.status.attribute = db.status.attribute
+  db.index.role.attribute = attribute role { text }
+  db.index.attlist =
+    db.index.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.index.status.attribute?
+    & db.index.type.attribute?
+  db.index.info = db._info
+  # 
+  # Yes, db.indexdiv* and db.indexentry*; that way an <index/> is valid.
+  # Authors can use an empty index to indicate where a generated index should
+  # appear.
+  db.index =
+    
+    ## An index to a book or part of a book
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:index"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element index {
+      db.index.attlist,
+      db.index.info,
+      db.all.blocks*,
+      (db.indexdiv* | db.indexentry* | db.segmentedlist)
+    }
+}
+div {
+  db.setindex.status.attribute = db.status.attribute
+  db.setindex.role.attribute = attribute role { text }
+  db.setindex.attlist =
+    db.setindex.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.setindex.status.attribute?
+    & db.index.type.attribute?
+  db.setindex.info = db._info
+  db.setindex =
+    
+    ## An index to a set of books
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:setindex"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element setindex {
+      db.setindex.attlist,
+      db.setindex.info,
+      db.all.blocks*,
+      (db.indexdiv* | db.indexentry*)
+    }
+}
+div {
+  db.indexdiv.status.attribute = db.status.attribute
+  db.indexdiv.role.attribute = attribute role { text }
+  db.indexdiv.attlist =
+    db.indexdiv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.indexdiv.status.attribute?
+  db.indexdiv.info = db._info.title.req
+  db.indexdiv =
+    
+    ## A division in an index
+    element indexdiv {
+      db.indexdiv.attlist,
+      db.indexdiv.info,
+      db.all.blocks*,
+      (db.indexentry+ | db.segmentedlist)
+    }
+}
+div {
+  db.indexentry.role.attribute = attribute role { text }
+  db.indexentry.attlist =
+    db.indexentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.indexentry =
+    
+    ## An entry in an index
+    element indexentry {
+      db.indexentry.attlist,
+      db.primaryie,
+      (db.seeie | db.seealsoie)*,
+      (db.secondaryie, (db.seeie | db.seealsoie | db.tertiaryie)*)*
+    }
+}
+div {
+  db.primaryie.role.attribute = attribute role { text }
+  db.primaryie.attlist =
+    db.primaryie.role.attribute?
+    & db.common.attributes
+    & db.linkends.attribute?
+  db.primaryie =
+    
+    ## A primary term in an index entry, not in the text
+    element primaryie { db.primaryie.attlist, db.all.inlines* }
+}
+div {
+  db.secondaryie.role.attribute = attribute role { text }
+  db.secondaryie.attlist =
+    db.secondaryie.role.attribute?
+    & db.common.attributes
+    & db.linkends.attribute?
+  db.secondaryie =
+    
+    ## A secondary term in an index entry, rather than in the text
+    element secondaryie { db.secondaryie.attlist, db.all.inlines* }
+}
+div {
+  db.tertiaryie.role.attribute = attribute role { text }
+  db.tertiaryie.attlist =
+    db.tertiaryie.role.attribute?
+    & db.common.attributes
+    & db.linkends.attribute?
+  db.tertiaryie =
+    
+    ## A tertiary term in an index entry, rather than in the text
+    element tertiaryie { db.tertiaryie.attlist, db.all.inlines* }
+}
+div {
+  db.seeie.role.attribute = attribute role { text }
+  db.seeie.attlist =
+    db.seeie.role.attribute?
+    & db.common.attributes
+    & db.linkend.attribute?
+  db.seeie =
+    
+    ## A See
+    ## entry in an index, rather than in the text
+    element seeie { db.seeie.attlist, db.all.inlines* }
+}
+div {
+  db.seealsoie.role.attribute = attribute role { text }
+  db.seealsoie.attlist =
+    db.seealsoie.role.attribute?
+    & db.common.attributes
+    & db.linkends.attribute?
+  db.seealsoie =
+    
+    ## A See also
+    ##  entry in an index, rather than in the text
+    element seealsoie { db.seealsoie.attlist, db.all.inlines* }
+}
+db.toc.pagenum.attribute =
+  
+  ## Indicates the page on which this element occurs in some version of the printed document
+  attribute pagenum { text }
+div {
+  db.toc.role.attribute = attribute role { text }
+  db.toc.attlist =
+    db.toc.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.toc.info = db._info.title.only
+  db.toc =
+    
+    ## A table of contents
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:toc"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element toc {
+      db.toc.attlist,
+      db.toc.info,
+      db.all.blocks*,
+      (db.tocdiv | db.tocentry)*
+    }
+}
+div {
+  db.tocdiv.role.attribute = attribute role { text }
+  db.tocdiv.pagenum.attribute = db.toc.pagenum.attribute
+  db.tocdiv.attlist =
+    db.tocdiv.role.attribute?
+    & db.common.attributes
+    & db.tocdiv.pagenum.attribute?
+    & db.linkend.attribute?
+  db.tocdiv.info = db._info
+  db.tocdiv =
+    
+    ## A division in a table of contents
+    element tocdiv {
+      db.tocdiv.attlist,
+      db.tocdiv.info,
+      db.all.blocks*,
+      (db.tocdiv | db.tocentry)+
+    }
+}
+div {
+  db.tocentry.role.attribute = attribute role { text }
+  db.tocentry.pagenum.attribute = db.toc.pagenum.attribute
+  db.tocentry.attlist =
+    db.tocentry.role.attribute?
+    & db.common.attributes
+    & db.tocentry.pagenum.attribute?
+    & db.linkend.attribute?
+  db.tocentry =
+    
+    ## A component title in a table of contents
+    element tocentry { db.tocentry.attlist, db.all.inlines* }
+}
+db.task.info = db._info.title.req
+div {
+  db.task.role.attribute = attribute role { text }
+  db.task.attlist =
+    db.task.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.task =
+    
+    ## A task to be completed
+    element task {
+      db.task.attlist,
+      db.task.info,
+      db.tasksummary?,
+      db.taskprerequisites?,
+      db.procedure,
+      db.example*,
+      db.taskrelated?
+    }
+}
+div {
+  db.tasksummary.role.attribute = attribute role { text }
+  db.tasksummary.attlist =
+    db.tasksummary.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.tasksummary.info = db._info.title.only
+  db.tasksummary =
+    
+    ## A summary of a task
+    element tasksummary {
+      db.tasksummary.attlist, db.tasksummary.info, db.all.blocks+
+    }
+}
+div {
+  db.taskprerequisites.role.attribute = attribute role { text }
+  db.taskprerequisites.attlist =
+    db.taskprerequisites.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.taskprerequisites.info = db._info.title.only
+  db.taskprerequisites =
+    
+    ## The prerequisites for a task
+    element taskprerequisites {
+      db.taskprerequisites.attlist,
+      db.taskprerequisites.info,
+      db.all.blocks+
+    }
+}
+div {
+  db.taskrelated.role.attribute = attribute role { text }
+  db.taskrelated.attlist =
+    db.taskrelated.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.taskrelated.info = db._info.title.only
+  db.taskrelated =
+    
+    ## Information related to a task
+    element taskrelated {
+      db.taskrelated.attlist, db.taskrelated.info, db.all.blocks+
+    }
+}
+db.area.units.enumeration =
+  
+  ## Coordinates expressed as a pair of CALS graphic coordinates.
+  "calspair"
+  | 
+    ## Coordinates expressed as a line and column.
+    "linecolumn"
+  | 
+    ## Coordinates expressed as a pair of lines and columns.
+    "linecolumnpair"
+  | 
+    ## Coordinates expressed as a line range.
+    "linerange"
+db.area.units-enum.attribute =
+  
+  ## Identifies the units used in the coords attribute The default units vary according to the type of callout specified: calspair
+  ##  for graphics and linecolumn
+  ##  for line-oriented elements.
+  attribute units { db.area.units.enumeration }?
+db.area.units-other.attributes =
+  
+  ## Indicates that non-standard units are used for this area
+  ## . In this case otherunits
+  ##  must be specified.
+  attribute units {
+    
+    ## Coordinates expressed in some non-standard units.
+    "other"
+  }?,
+  
+  ## Identifies the units used in the coords
+  ##  attribute when the units
+  ##  attribute is other
+  ## . This attribute is forbidden otherwise.
+  attribute otherunits { xsd:NMTOKEN }
+db.area.units.attribute =
+  db.area.units-enum.attribute | db.area.units-other.attributes
+div {
+  db.calloutlist.role.attribute = attribute role { text }
+  db.calloutlist.attlist =
+    db.calloutlist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.calloutlist.info = db._info.title.only
+  db.calloutlist =
+    
+    ## A list of callout
+    ## s
+    element calloutlist {
+      db.calloutlist.attlist,
+      db.calloutlist.info,
+      db.all.blocks*,
+      db.callout+
+    }
+}
+div {
+  db.callout.role.attribute = attribute role { text }
+  db.callout.arearefs.attribute =
+    
+    ## Identifies the areas described by this callout.
+    attribute arearefs { xsd:IDREFS }
+  db.callout.attlist =
+    db.callout.role.attribute?
+    & db.common.attributes
+    & db.callout.arearefs.attribute
+  db.callout =
+    
+    ## A called out
+    ##  description of a marked Area
+    element callout { db.callout.attlist, db.all.blocks+ }
+}
+div {
+  db.programlistingco.role.attribute = attribute role { text }
+  db.programlistingco.attlist =
+    db.programlistingco.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.programlistingco.info = db._info.title.forbidden
+  db.programlistingco =
+    
+    ## A program listing with associated areas used in callouts
+    element programlistingco {
+      db.programlistingco.attlist,
+      db.programlistingco.info,
+      db.areaspec,
+      db.programlisting,
+      db.calloutlist*
+    }
+}
+div {
+  db.areaspec.role.attribute = attribute role { text }
+  db.areaspec.attlist =
+    db.areaspec.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.area.units.attribute
+  db.areaspec =
+    
+    ## A collection of regions in a graphic or code example
+    element areaspec { db.areaspec.attlist, (db.area | db.areaset)+ }
+}
+div {
+  db.area.role.attribute = attribute role { text }
+  db.area.linkends.attribute =
+    
+    ## Point to the callout
+    ## s which refer to this area. (This provides bidirectional linking which may be useful in online presentation.)
+    attribute linkends { xsd:IDREFS }
+  db.area.label.attribute =
+    
+    ## Specifies an identifying number or string that may be used in presentation. The area label might be drawn on top of the figure, for example, at the position indicated by the coords attribute.
+    attribute label { text }
+  db.area.coords.attribute =
+    
+    ## Provides the coordinates of the area. The coordinates must be interpreted using the units
+    ##  specified.
+    attribute coords { text }
+  db.area.attlist =
+    db.area.role.attribute?
+    & db.common.idreq.attributes
+    & db.area.units.attribute
+    & (db.area.linkends.attribute | db.href.attributes)?
+    & db.area.label.attribute?
+    & db.area.coords.attribute
+  db.area =
+    
+    ## A region defined for a Callout in a graphic or code example
+    element area { db.area.attlist, db.alt? }
+}
+div {
+  # The only difference is that xml:id is optional
+  db.area.inareaset.attlist =
+    db.area.role.attribute?
+    & db.common.attributes
+    & db.area.units.attribute
+    & (db.area.linkends.attribute | db.href.attributes)?
+    & db.area.label.attribute?
+    & db.area.coords.attribute
+  db.area.inareaset =
+    
+    ## A region defined for a Callout in a graphic or code example
+    element area { db.area.inareaset.attlist, db.alt? }
+}
+div {
+  db.areaset.role.attribute = attribute role { text }
+  db.areaset.linkends.attribute = db.linkends.attribute
+  db.areaset.label.attribute = db.label.attribute
+  db.areaset.attlist =
+    db.areaset.role.attribute?
+    & db.common.idreq.attributes
+    & db.area.units.attribute
+    & (db.areaset.linkends.attribute | db.href.attributes)?
+    & db.areaset.label.attribute?
+  db.areaset =
+    
+    ## A set of related areas in a graphic or code example
+    element areaset { db.areaset.attlist, db.area.inareaset+ }
+}
+div {
+  db.screenco.role.attribute = attribute role { text }
+  db.screenco.attlist =
+    db.screenco.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.screenco.info = db._info.title.forbidden
+  db.screenco =
+    
+    ## A screen with associated areas used in callouts
+    element screenco {
+      db.screenco.attlist,
+      db.screenco.info,
+      db.areaspec,
+      db.screen,
+      db.calloutlist*
+    }
+}
+div {
+  db.imageobjectco.role.attribute = attribute role { text }
+  db.imageobjectco.attlist =
+    db.imageobjectco.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.imageobjectco.info = db._info.title.forbidden
+  db.imageobjectco =
+    
+    ## A wrapper for an image object with callouts
+    element imageobjectco {
+      db.imageobjectco.attlist,
+      db.imageobjectco.info,
+      db.areaspec,
+      db.imageobject+,
+      db.calloutlist*
+    }
+}
+div {
+  db.co.role.attribute = attribute role { text }
+  db.co.linkends.attribute = db.linkends.attribute
+  db.co.label.attribute = db.label.attribute
+  db.co.attlist =
+    db.co.role.attribute?
+    & db.common.idreq.attributes
+    & db.co.linkends.attribute?
+    & db.co.label.attribute?
+  db.co =
+    
+    ## The location of a callout embedded in text
+    element co { db.co.attlist, empty }
+}
+div {
+  db.coref.role.attribute = attribute role { text }
+  db.coref.label.attribute = db.label.attribute
+  db.coref.attlist =
+    db.coref.role.attribute?
+    & db.common.attributes
+    & db.linkend.attribute
+    & db.coref.label.attribute?
+  db.coref =
+    
+    ## A cross reference to a co
+    element coref { db.coref.attlist, empty }
+}
+div {
+  db.productionset.role.attribute = attribute role { text }
+  db.productionset.attlist =
+    db.productionset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.productionset.info = db._info.title.only
+  db.productionset =
+    
+    ## A set of EBNF productions
+    element productionset {
+      db.productionset.attlist,
+      db.productionset.info,
+      (db.production | db.productionrecap)+
+    }
+}
+div {
+  db.production.role.attribute = attribute role { text }
+  db.production.attlist =
+    db.production.role.attribute?
+    & db.common.idreq.attributes
+    & db.common.linking.attributes
+  db.production =
+    
+    ## A production in a set of EBNF productions
+    element production {
+      db.production.attlist, db.lhs, db.rhs, db.constraint*
+    }
+}
+div {
+  db.lhs.role.attribute = attribute role { text }
+  db.lhs.attlist =
+    db.lhs.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.lhs =
+    
+    ## The left-hand side of an EBNF production
+    element lhs { db.lhs.attlist, text }
+}
+div {
+  db.rhs.role.attribute = attribute role { text }
+  db.rhs.attlist =
+    db.rhs.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.rhs =
+    
+    ## The right-hand side of an EBNF production
+    element rhs {
+      db.rhs.attlist,
+      (text | db.nonterminal | db.lineannotation | db.sbr)*
+    }
+}
+div {
+  db.nonterminal.role.attribute = attribute role { text }
+  db.nonterminal.def.attribute =
+    
+    ## Specifies a URI that points to a production
+    ## where the nonterminal
+    ##  is defined
+    attribute def { xsd:anyURI }
+  db.nonterminal.attlist =
+    db.nonterminal.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.nonterminal.def.attribute
+  db.nonterminal =
+    
+    ## A non-terminal in an EBNF production
+    element nonterminal { db.nonterminal.attlist, text }
+}
+div {
+  db.constraint.role.attribute = attribute role { text }
+  db.constraint.attlist =
+    db.constraint.role.attribute?
+    & db.common.attributes
+    & db.common.req.linking.attributes
+  db.constraint =
+    
+    ## A constraint in an EBNF production
+    element constraint { db.constraint.attlist, empty }
+}
+div {
+  db.productionrecap.role.attribute = attribute role { text }
+  db.productionrecap.attlist =
+    db.productionrecap.role.attribute?
+    & db.common.attributes
+    & db.common.req.linking.attributes
+  db.productionrecap =
+    
+    ## A cross-reference to an EBNF production
+    element productionrecap { db.productionrecap.attlist, empty }
+}
+div {
+  db.constraintdef.role.attribute = attribute role { text }
+  db.constraintdef.attlist =
+    db.constraintdef.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.constraintdef.info = db._info.title.only
+  db.constraintdef =
+    
+    ## The definition of a constraint in an EBNF production
+    element constraintdef {
+      db.constraintdef.attlist, db.constraintdef.info, db.all.blocks+
+    }
+}
+db.char.attribute =
+  
+  ## Specifies the alignment character when align
+  ##  is set to char
+  ## .
+  attribute char { text }
+db.charoff.attribute =
+  
+  ## Specifies the percentage of the column's total width that should appear to the left of the first occurance of the character identified in char
+  ##  when align
+  ##  is set to char
+  ## .
+  attribute charoff {
+    xsd:decimal { minExclusive = "0" maxExclusive = "100" }
+  }
+db.frame.attribute =
+  
+  ## Specifies how the table is to be framed. Note that there is no way to obtain a border on only the starting edge (left, in left-to-right writing systems) of the table.
+  attribute frame {
+    
+    ## Frame all four sides of the table. In some environments with limited control over table border formatting, such as HTML, this may imply additional borders.
+    "all"
+    | 
+      ## Frame only the bottom of the table.
+      "bottom"
+    | 
+      ## Place no border on the table. In some environments with limited control over table border formatting, such as HTML, this may disable other borders as well.
+      "none"
+    | 
+      ## Frame the left and right sides of the table.
+      "sides"
+    | 
+      ## Frame the top of the table.
+      "top"
+    | 
+      ## Frame the top and bottom of the table.
+      "topbot"
+  }
+db.colsep.attribute =
+  
+  ## Specifies the presence or absence of the column separator
+  attribute colsep {
+    
+    ## No column separator rule.
+    "0"
+    | 
+      ## Provide a column separator rule on the right
+      "1"
+  }
+db.rowsep.attribute =
+  
+  ## Specifies the presence or absence of the row separator
+  attribute rowsep {
+    
+    ## No row separator rule.
+    "0"
+    | 
+      ## Provide a row separator rule below
+      "1"
+  }
+db.orient.attribute =
+  
+  ## Specifies the orientation of the table
+  attribute orient {
+    
+    ## 90 degrees counter-clockwise from the rest of the text flow.
+    "land"
+    | 
+      ## The same orientation as the rest of the text flow.
+      "port"
+  }
+db.tabstyle.attribute =
+  
+  ## Specifies the table style
+  attribute tabstyle { text }
+db.rowheader.attribute =
+  
+  ## Indicates whether or not the entries in the first column should be considered row headers
+  attribute rowheader {
+    
+    ## Indicates that entries in the first column of the table are functionally row headers (analogous to the way that a thead provides column headers).
+    "firstcol"
+    | 
+      ## Indicates that entries in the first column have no special significance with respect to column headers.
+      "norowheader"
+  }
+db.align.attribute =
+  
+  ## Specifies the horizontal alignment of text in an entry.
+  attribute align {
+    
+    ## Centered.
+    "center"
+    | 
+      ## Aligned on a particular character.
+      "char"
+    | 
+      ## Left and right justified.
+      "justify"
+    | 
+      ## Left justified.
+      "left"
+    | 
+      ## Right justified.
+      "right"
+  }
+db.valign.attribute =
+  
+  ## Specifies the vertical alignment of text in an entry.
+  attribute valign {
+    
+    ## Aligned on the bottom of the entry.
+    "bottom"
+    | 
+      ## Aligned in the middle.
+      "middle"
+    | 
+      ## Aligned at the top of the entry.
+      "top"
+  }
+db.specify-col-by-colname.attributes =
+  
+  ## Specifies a column specification by name.
+  attribute colname { text }
+db.specify-col-by-namest.attributes =
+  
+  ## Specifies a starting column by name.
+  attribute namest { text }
+db.specify-span-by-spanspec.attributes =
+  
+  ## Specifies a span by name.
+  attribute spanname { text }
+db.specify-span-directly.attributes =
+  
+  ## Specifies a starting column by name.
+  attribute namest { text }
+  & 
+    ## Specifies an ending column by name.
+    attribute nameend { text }
+db.column-spec.attributes =
+  db.specify-col-by-colname.attributes
+  | db.specify-col-by-namest.attributes
+  | db.specify-span-by-spanspec.attributes
+  | db.specify-span-directly.attributes
+db.colname.attribute =
+  
+  ## Provides a name for a column specification.
+  attribute colname { text }
+db.spanname.attribute =
+  
+  ## Provides a name for a span specification.
+  attribute spanname { text }
+div {
+  db.tgroup.role.attribute = attribute role { text }
+  db.tgroup.tgroupstyle.attribute =
+    
+    ## Additional style information for downstream processing; typically the name of a style.
+    attribute tgroupstyle { text }
+  db.tgroup.cols.attribute =
+    
+    ## The number of columns in the table. Must be an integer greater than zero.
+    attribute cols { xsd:positiveInteger }
+  db.tgroup.attlist =
+    db.tgroup.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.char.attribute?
+    & db.charoff.attribute?
+    & db.tgroup.tgroupstyle.attribute?
+    & db.tgroup.cols.attribute
+    & db.colsep.attribute?
+    & db.rowsep.attribute?
+    & db.align.attribute?
+  db.tgroup =
+    
+    ## A wrapper for the main content of a table, or part of a table
+    element tgroup {
+      db.tgroup.attlist,
+      db.colspec*,
+      db.spanspec*,
+      db.cals.thead?,
+      db.cals.tfoot?,
+      db.cals.tbody
+    }
+}
+div {
+  db.colspec.role.attribute = attribute role { text }
+  db.colspec.colnum.attribute =
+    
+    ## The number of the column to which this specification applies. Must be greater than any preceding column number. Defaults to one more than the number of the preceding column, if there is one, or one.
+    attribute colnum { xsd:positiveInteger }
+  db.colspec.colwidth.attribute =
+    
+    ## Specifies the width of the column.
+    attribute colwidth { text }
+  db.colspec.attlist =
+    db.colspec.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.colspec.colnum.attribute?
+    & db.char.attribute?
+    & db.colsep.attribute?
+    & db.colspec.colwidth.attribute?
+    & db.charoff.attribute?
+    & db.colname.attribute?
+    & db.rowsep.attribute?
+    & db.align.attribute?
+  db.colspec =
+    
+    ## Specifications for a column in a table
+    element colspec { db.colspec.attlist, empty }
+}
+div {
+  db.spanspec.role.attribute = attribute role { text }
+  db.spanspec.namest.attribute =
+    
+    ## Specifies a starting column by name.
+    attribute namest { text }
+  db.spanspec.nameend.attribute =
+    
+    ## Specifies an ending column by name.
+    attribute nameend { text }
+  db.spanspec.attlist =
+    db.spanspec.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.spanname.attribute
+    & db.spanspec.namest.attribute
+    & db.spanspec.nameend.attribute
+    & db.char.attribute?
+    & db.colsep.attribute?
+    & db.charoff.attribute?
+    & db.rowsep.attribute?
+    & db.align.attribute?
+  db.spanspec =
+    
+    ## Formatting information for a spanned column in a table
+    element spanspec { db.spanspec.attlist, empty }
+}
+div {
+  db.cals.thead.role.attribute = attribute role { text }
+  db.cals.thead.attlist =
+    db.cals.thead.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.valign.attribute?
+  db.cals.thead =
+    
+    ## A table header consisting of one or more rows
+    element thead { db.cals.thead.attlist, db.colspec*, db.row+ }
+}
+div {
+  db.cals.tfoot.role.attribute = attribute role { text }
+  db.cals.tfoot.attlist =
+    db.cals.tfoot.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.valign.attribute?
+  db.cals.tfoot =
+    
+    ## A table footer consisting of one or more rows
+    element tfoot { db.cals.tfoot.attlist, db.colspec*, db.row+ }
+}
+div {
+  db.cals.tbody.role.attribute = attribute role { text }
+  db.cals.tbody.attlist =
+    db.cals.tbody.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.valign.attribute?
+  db.cals.tbody =
+    
+    ## A wrapper for the rows of a table or informal table
+    element tbody { db.cals.tbody.attlist, db.row+ }
+}
+div {
+  db.row.role.attribute = attribute role { text }
+  db.row.attlist =
+    db.row.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.rowsep.attribute?
+    & db.valign.attribute?
+  db.row =
+    
+    ## A row in a table
+    element row { db.row.attlist, (db.entry | db.entrytbl)+ }
+}
+div {
+  db.entry.role.attribute = attribute role { text }
+  db.entry.morerows.attribute =
+    
+    ## Specifies the number of additional rows which this entry occupies. Defaults to zero.
+    attribute morerows { xsd:integer }
+  db.entry.rotate.attribute =
+    
+    ## Specifies the rotation of this entry. A value of 1 (true) rotates the cell 90 degrees counter-clockwise. A value of 0 (false) leaves the cell unrotated.
+    attribute rotate {
+      
+      ## Do not rotate the cell.
+      "0"
+      | 
+        ## Rotate the cell 90 degrees counter-clockwise.
+        "1"
+    }
+  db.entry.attlist =
+    db.entry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.valign.attribute?
+    & db.char.attribute?
+    & db.colsep.attribute?
+    & db.charoff.attribute?
+    & db.entry.morerows.attribute?
+    & db.column-spec.attributes?
+    & db.rowsep.attribute?
+    & db.entry.rotate.attribute?
+    & db.align.attribute?
+  db.entry =
+    
+    ## A cell in a table
+    element entry {
+      db.entry.attlist, (db.all.inlines* | db.all.blocks*)
+    }
+}
+div {
+  db.entrytbl.role.attribute = attribute role { text }
+  db.entrytbl.tgroupstyle.attribute =
+    
+    ## Additional style information for downstream processing; typically the name of a style.
+    attribute tgroupstyle { text }
+  db.entrytbl.cols.attribute =
+    
+    ## The number of columns in the entry table. Must be an integer greater than zero.
+    attribute cols { xsd:positiveInteger }
+  db.entrytbl.attlist =
+    db.entrytbl.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.char.attribute?
+    & db.charoff.attribute?
+    & db.column-spec.attributes?
+    & db.entrytbl.tgroupstyle.attribute?
+    & db.entrytbl.cols.attribute?
+    & db.colsep.attribute?
+    & db.rowsep.attribute?
+    & db.align.attribute?
+  db.entrytbl =
+    
+    ## A subtable appearing in place of an Entry in a table
+    element entrytbl {
+      db.entrytbl.attlist,
+      db.colspec*,
+      db.spanspec*,
+      db.cals.entrytbl.thead?,
+      db.cals.entrytbl.tbody
+    }
+}
+div {
+  db.cals.entrytbl.thead.role.attribute = attribute role { text }
+  db.cals.entrytbl.thead.attlist =
+    db.cals.entrytbl.thead.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.valign.attribute?
+  db.cals.entrytbl.thead =
+    
+    ## A table header consisting of one or more rows
+    element thead {
+      db.cals.entrytbl.thead.attlist, db.colspec*, db.entrytbl.row+
+    }
+}
+div {
+  db.cals.entrytbl.tbody.role.attribute = attribute role { text }
+  db.cals.entrytbl.tbody.attlist =
+    db.cals.entrytbl.tbody.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.valign.attribute?
+  db.cals.entrytbl.tbody =
+    
+    ## A wrapper for the rows of a table or informal table
+    element tbody { db.cals.entrytbl.tbody.attlist, db.entrytbl.row+ }
+}
+div {
+  db.entrytbl.row.role.attribute = attribute role { text }
+  db.entrytbl.row.attlist =
+    db.entrytbl.row.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.rowsep.attribute?
+    & db.valign.attribute?
+  db.entrytbl.row =
+    
+    ## A row in a table
+    element row { db.entrytbl.row.attlist, db.entry+ }
+}
+div {
+  db.cals.table.role.attribute = attribute role { text }
+  db.cals.table.label.attribute = db.label.attribute
+  db.cals.table.attlist =
+    db.cals.table.role.attribute?
+    & db.cals.table.label.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.tabstyle.attribute?
+    & db.floatstyle.attribute?
+    & db.orient.attribute?
+    & db.colsep.attribute?
+    & db.rowsep.attribute?
+    & db.frame.attribute?
+    & db.pgwide.attribute?
+    & 
+      ## Indicates if the short or long title should be used in a List of Tables
+      attribute shortentry {
+        
+        ## Indicates that the full title should be used.
+        "0"
+        | 
+          ## Indicates that the short short title (titleabbrev) should be used.
+          "1"
+      }?
+    & 
+      ## Indicates if the table should appear in a List of Tables
+      attribute tocentry {
+        
+        ## Indicates that the table should not occur in the List of Tables.
+        "0"
+        | 
+          ## Indicates that the table should appear in the List of Tables.
+          "1"
+      }?
+    & db.rowheader.attribute?
+  db.cals.table.info = db._info.title.onlyreq
+  db.cals.table =
+    
+    ## A formal table in a document
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:informaltable)"
+            "informaltable must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element table {
+      db.cals.table.attlist,
+      db.cals.table.info,
+      (db.alt? & db.indexing.inlines* & db.textobject*),
+      (db.mediaobject+ | db.tgroup+),
+      db.caption?
+    }
+}
+div {
+  db.cals.informaltable.role.attribute = attribute role { text }
+  db.cals.informaltable.attlist =
+    db.cals.informaltable.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.tabstyle.attribute?
+    & db.floatstyle.attribute?
+    & db.orient.attribute?
+    & db.colsep.attribute?
+    & db.rowsep.attribute?
+    & db.frame.attribute?
+    & db.pgwide.attribute?
+    & db.rowheader.attribute?
+  db.cals.informaltable.info = db._info.title.forbidden
+  db.cals.informaltable =
+    
+    ## A table without a title
+    element informaltable {
+      db.cals.informaltable.attlist,
+      db.cals.informaltable.info,
+      (db.alt? & db.indexing.inlines* & db.textobject*),
+      (db.mediaobject+ | db.tgroup+),
+      db.caption?
+    }
+}
+db.html.coreattrs =
+  
+  ## This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names. Multiple class names must be separated by white space characters.
+  attribute class { text }?
+  & 
+    ## This attribute specifies style information for the current element.
+    attribute style { text }?
+  & 
+    ## This attribute offers advisory information about the element for which it is set.
+    attribute title { text }?
+db.html.i18n =
+  
+  ## This attribute specifies the base language of an element's attribute values and text content. The default value of this attribute is unknown.
+  attribute lang { text }?
+db.html.events =
+  
+  ## Occurs when the pointing device button is clicked over an element.
+  attribute onclick { text }?
+  & 
+    ## Occurs when the pointing device button is double clicked over an element.
+    attribute ondblclick { text }?
+  & 
+    ## Occurs when the pointing device button is pressed over an element.
+    attribute onmousedown { text }?
+  & 
+    ## Occurs when the pointing device button is released over an element.
+    attribute onmouseup { text }?
+  & 
+    ## Occurs when the pointing device is moved onto an element.
+    attribute onmouseover { text }?
+  & 
+    ## Occurs when the pointing device is moved while it is over an element.
+    attribute onmousemove { text }?
+  & 
+    ## Occurs when the pointing device is moved away from an element.
+    attribute onmouseout { text }?
+  & 
+    ## Occurs when a key is pressed and released over an element.
+    attribute onkeypress { text }?
+  & 
+    ## Occurs when a key is pressed down over an element.
+    attribute onkeydown { text }?
+  & 
+    ## Occurs when a key is released over an element.
+    attribute onkeyup { text }?
+db.html.attrs =
+  db.common.attributes
+  & db.html.coreattrs
+  & db.html.i18n
+  & db.html.events
+db.html.cellhalign =
+  
+  ## Specifies the alignment of data and the justification of text in a cell.
+  attribute align {
+    
+    ## Left-flush data/Left-justify text. This is the default value for table data.
+    "left"
+    | 
+      ## Center data/Center-justify text. This is the default value for table headers.
+      "center"
+    | 
+      ## Right-flush data/Right-justify text.
+      "right"
+    | 
+      ## Double-justify text.
+      "justify"
+    | 
+      ## Align text around a specific character. If a user agent doesn't support character alignment, behavior in the presence of this value is unspecified.
+      "char"
+  }?
+  & 
+    ## This attribute specifies a single character within a text fragment to act as an axis for alignment. The default value for this attribute is the decimal point character for the current language as set by the lang attribute (e.g., the period in English and the comma in French). User agents are not required to support this attribute.
+    attribute char { text }?
+  & 
+    ## When present, this attribute specifies the offset to the first occurrence of the alignment character on each line. If a line doesn't include the alignment character, it should be horizontally shifted to end at the alignment position. When charoff is used to set the offset of an alignment character, the direction of offset is determined by the current text direction (set by the dir attribute). In left-to-right texts (the default), offset is from the left margin. In right-to-left texts, offset is from the right margin. User agents are not required to support this attribute.
+    attribute charoff {
+      xsd:integer
+      | xsd:string { pattern = "[0-9]+%" }
+    }?
+db.html.cellvalign =
+  
+  ## Specifies the vertical position of data within a cell.
+  attribute valign {
+    
+    ## Cell data is flush with the top of the cell.
+    "top"
+    | 
+      ## Cell data is centered vertically within the cell. This is the default value.
+      "middle"
+    | 
+      ## Cell data is flush with the bottom of the cell.
+      "bottom"
+    | 
+      ## All cells in the same row as a cell whose valign attribute has this value should have their textual data positioned so that the first text line occurs on a baseline common to all cells in the row. This constraint does not apply to subsequent text lines in these cells.
+      "baseline"
+  }?
+db.html.table.attributes =
+  
+  ## Provides a summary of the table's purpose and structure for user agents rendering to non-visual media such as speech and Braille.
+  attribute summary { text }?
+  & 
+    ## Specifies the desired width of the entire table and is intended for visual user agents. When the value is a percentage value, the value is relative to the user agent's available horizontal space. In the absence of any width specification, table width is determined by the user agent.
+    attribute width {
+      xsd:integer
+      | xsd:string { pattern = "[0-9]+%" }
+    }?
+  & 
+    ## Specifies the width (in pixels only) of the frame around a table.
+    attribute border { xsd:nonNegativeInteger }?
+  & 
+    ## Specifies which sides of the frame surrounding a table will be visible.
+    attribute frame {
+      
+      ## No sides. This is the default value.
+      "void"
+      | 
+        ## The top side only.
+        "above"
+      | 
+        ## The bottom side only.
+        "below"
+      | 
+        ## The top and bottom sides only.
+        "hsides"
+      | 
+        ## The left-hand side only.
+        "lhs"
+      | 
+        ## The right-hand side only.
+        "rhs"
+      | 
+        ## The right and left sides only.
+        "vsides"
+      | 
+        ## All four sides.
+        "box"
+      | 
+        ## All four sides.
+        "border"
+    }?
+  & 
+    ## Specifies which rules will appear between cells within a table. The rendering of rules is user agent dependent.
+    attribute rules {
+      
+      ## No rules. This is the default value.
+      "none"
+      | 
+        ## Rules will appear between row groups (see thead, tfoot, and tbody) and column groups (see colgroup and col) only.
+        "groups"
+      | 
+        ## Rules will appear between rows only.
+        "rows"
+      | 
+        ## Rules will appear between columns only.
+        "cols"
+      | 
+        ## Rules will appear between all rows and columns.
+        "all"
+    }?
+  & 
+    ## Specifies how much space the user agent should leave between the left side of the table and the left-hand side of the leftmost column, the top of the table and the top side of the topmost row, and so on for the right and bottom of the table. The attribute also specifies the amount of space to leave between cells.
+    attribute cellspacing {
+      xsd:integer
+      | xsd:string { pattern = "[0-9]+%" }
+    }?
+  & 
+    ## Specifies the amount of space between the border of the cell and its contents. If the value of this attribute is a pixel length, all four margins should be this distance from the contents. If the value of the attribute is a percentage length, the top and bottom margins should be equally separated from the content based on a percentage of the available vertical space, and the left and right margins should be equally separated from the content based on a percentage of the available horizontal space.
+    attribute cellpadding {
+      xsd:integer
+      | xsd:string { pattern = "[0-9]+%" }
+    }?
+db.html.tablecell.attributes =
+  
+  ## Provides an abbreviated form of the cell's content and may be rendered by user agents when appropriate in place of the cell's content. Abbreviated names should be short since user agents may render them repeatedly. For instance, speech synthesizers may render the abbreviated headers relating to a particular cell before rendering that cell's content.
+  attribute abbr { text }?
+  & 
+    ## This attribute may be used to place a cell into conceptual categories that can be considered to form axes in an n-dimensional space. User agents may give users access to these categories (e.g., the user may query the user agent for all cells that belong to certain categories, the user agent may present a table in the form of a table of contents, etc.). Please consult an HTML reference for more details.
+    attribute axis { text }?
+  & 
+    ## Specifies the list of header cells that provide header information for the current data cell. The value of this attribute is a space-separated list of cell names; those cells must be named by setting their id attribute. Authors generally use the headers attribute to help non-visual user agents render header information about data cells (e.g., header information is spoken prior to the cell data), but the attribute may also be used in conjunction with style sheets.
+    attribute headers { text }?
+  & 
+    ## Specifies the set of data cells for which the current header cell provides header information. This attribute may be used in place of the headers attribute, particularly for simple tables.
+    attribute scope {
+      
+      ## The current cell provides header information for the rest of the row that contains it
+      "row"
+      | 
+        ## The current cell provides header information for the rest of the column that contains it.
+        "col"
+      | 
+        ## The header cell provides header information for the rest of the row group that contains it.
+        "rowgroup"
+      | 
+        ## The header cell provides header information for the rest of the column group that contains it.
+        "colgroup"
+    }?
+  & 
+    ## Specifies the number of rows spanned by the current cell. The default value of this attribute is one (1
+    ## ). The value zero (0
+    ## ) means that the cell spans all rows from the current row to the last row of the table section (thead
+    ## , tbody
+    ## , or tfoot
+    ## ) in which the cell is defined.
+    attribute rowspan { xsd:nonNegativeInteger }?
+  & 
+    ## Specifies the number of columns spanned by the current cell. The default value of this attribute is one (1
+    ## ). The value zero (0
+    ## ) means that the cell spans all columns from the current column to the last column of the column group (colgroup
+    ## ) in which the cell is defined.
+    attribute colspan { xsd:nonNegativeInteger }?
+db.html.table.info = db._info.title.forbidden
+db.html.table.model =
+  db.html.table.info?,
+  db.html.caption,
+  (db.html.col* | db.html.colgroup*),
+  db.html.thead?,
+  db.html.tfoot?,
+  (db.html.tbody+ | db.html.tr+)
+db.html.informaltable.info = db._info.title.forbidden
+db.html.informaltable.model =
+  db.html.informaltable.info?,
+  (db.html.col* | db.html.colgroup*),
+  db.html.thead?,
+  db.html.tfoot?,
+  (db.html.tbody+ | db.html.tr+)
+div {
+  db.html.table.role.attribute = attribute role { text }
+  db.html.table.label.attribute = db.label.attribute
+  db.html.table.attlist =
+    db.html.attrs
+    & db.html.table.attributes
+    & db.html.table.role.attribute?
+    & db.html.table.label.attribute?
+    & db.orient.attribute?
+    & db.pgwide.attribute?
+    & db.tabstyle.attribute?
+    & db.floatstyle.attribute?
+  db.html.table =
+    
+    ## A formal (captioned) HTML table in a document
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:informaltable)"
+            "informaltable must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element table { db.html.table.attlist, db.html.table.model }
+}
+div {
+  db.html.informaltable.attlist =
+    db.html.attrs & db.html.table.attributes
+  db.html.informaltable =
+    
+    ## An HTML table without a title
+    element informaltable {
+      db.html.informaltable.attlist, db.html.informaltable.model
+    }
+}
+div {
+  db.html.caption.attlist = db.html.attrs
+  db.html.caption =
+    
+    ## An HTML table caption
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:table)"
+            "table must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:sidebar)"
+            "sidebar must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:task)"
+            "task must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element caption { db.html.caption.attlist, db.all.inlines* }
+}
+div {
+  db.html.col.attlist =
+    db.html.attrs
+    & 
+      ## This attribute, whose value must be an integer > 0, specifies the number of columns spanned
+      ##  by the col
+      ##  element; the col
+      ##  element shares its attributes with all the columns it spans. The default value for this attribute is 1 (i.e., a single column). If the span attribute is set to N > 1, the current col
+      ##  element shares its attributes with the next N-1 columns.
+      attribute span { xsd:nonNegativeInteger }?
+    & 
+      ## Specifies a default width for each column spanned by the current col
+      ##  element. It has the same meaning as the width
+      ##  attribute for the colgroup
+      ##  element and overrides it.
+      attribute width { text }?
+    & db.html.cellhalign
+    & db.html.cellvalign
+  db.html.col =
+    
+    ## Specifications for a column in an HTML table
+    element col { db.html.col.attlist, empty }
+}
+div {
+  db.html.colgroup.attlist =
+    db.html.attrs
+    & 
+      ## This attribute, which must be an integer > 0, specifies the number of columns in a column group. In the absence of a span attribute, each colgroup
+      ##  defines a column group containing one column. If the span attribute is set to N > 0, the current colgroup
+      ##  element defines a column group containing N columns. User agents must ignore this attribute if the colgroup
+      ##  element contains one or more col
+      ##  elements.
+      attribute span { xsd:nonNegativeInteger }?
+    & 
+      ## This attribute specifies a default width for each column in the current column group. In addition to the standard pixel, percentage, and relative values, this attribute allows the special form 0*
+      ##  (zero asterisk) which means that the width of the each column in the group should be the minimum width necessary to hold the column's contents. This implies that a column's entire contents must be known before its width may be correctly computed. Authors should be aware that specifying 0*
+      ##  will prevent visual user agents from rendering a table incrementally. This attribute is overridden for any column in the column group whose width is specified via a col
+      ##  element.
+      attribute width { text }?
+    & db.html.cellhalign
+    & db.html.cellvalign
+  db.html.colgroup =
+    
+    ## A group of columns in an HTML table
+    element colgroup { db.html.colgroup.attlist, db.html.col* }
+}
+div {
+  db.html.thead.attlist =
+    db.html.attrs & db.html.cellhalign & db.html.cellvalign
+  db.html.thead =
+    
+    ## A table header consisting of one or more rows in an HTML table
+    element thead { db.html.thead.attlist, db.html.tr+ }
+}
+div {
+  db.html.tfoot.attlist =
+    db.html.attrs & db.html.cellhalign & db.html.cellvalign
+  db.html.tfoot =
+    
+    ## A table footer consisting of one or more rows in an HTML table
+    element tfoot { db.html.tfoot.attlist, db.html.tr+ }
+}
+div {
+  db.html.tbody.attlist =
+    db.html.attrs & db.html.cellhalign & db.html.cellvalign
+  db.html.tbody =
+    
+    ## A wrapper for the rows of an HTML table or informal HTML table
+    element tbody { db.html.tbody.attlist, db.html.tr+ }
+}
+div {
+  db.html.tr.attlist =
+    db.html.attrs & db.html.cellhalign & db.html.cellvalign
+  db.html.tr =
+    
+    ## A row in an HTML table
+    element tr { db.html.tr.attlist, (db.html.th | db.html.td)+ }
+}
+div {
+  db.html.th.attlist =
+    db.html.attrs
+    & db.html.tablecell.attributes
+    & db.html.cellhalign
+    & db.html.cellvalign
+  db.html.th =
+    
+    ## A table header entry in an HTML table
+    element th {
+      db.html.th.attlist, (db.all.inlines* | db.all.blocks*)
+    }
+}
+div {
+  db.html.td.attlist =
+    db.html.attrs
+    & db.html.tablecell.attributes
+    & db.html.cellhalign
+    & db.html.cellvalign
+  db.html.td =
+    
+    ## A table entry in an HTML table
+    element td {
+      db.html.td.attlist, (db.all.inlines* | db.all.blocks*)
+    }
+}
+div {
+  db.msgset.role.attribute = attribute role { text }
+  db.msgset.attlist =
+    db.msgset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgset.info = db._info.title.only
+  db.msgset =
+    
+    ## A detailed set of messages, usually error messages
+    element msgset {
+      db.msgset.attlist,
+      db.msgset.info,
+      (db.msgentry+ | db.simplemsgentry+)
+    }
+}
+div {
+  db.msgentry.role.attribute = attribute role { text }
+  db.msgentry.attlist =
+    db.msgentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgentry =
+    
+    ## A wrapper for an entry in a message set
+    element msgentry {
+      db.msgentry.attlist, db.msg+, db.msginfo?, db.msgexplan*
+    }
+}
+div {
+  db.simplemsgentry.role.attribute = attribute role { text }
+  db.simplemsgentry.msgaud.attribute =
+    
+    ## The audience to which the message relevant
+    attribute msgaud { text }
+  db.simplemsgentry.msgorig.attribute =
+    
+    ## The origin of the message
+    attribute msgorig { text }
+  db.simplemsgentry.msglevel.attribute =
+    
+    ## The level of importance or severity of a message
+    attribute msglevel { text }
+  db.simplemsgentry.attlist =
+    db.simplemsgentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.simplemsgentry.msgaud.attribute?
+    & db.simplemsgentry.msgorig.attribute?
+    & db.simplemsgentry.msglevel.attribute?
+  db.simplemsgentry =
+    
+    ## A wrapper for a simpler entry in a message set
+    element simplemsgentry {
+      db.simplemsgentry.attlist, db.msgtext, db.msgexplan+
+    }
+}
+div {
+  db.msg.role.attribute = attribute role { text }
+  db.msg.attlist =
+    db.msg.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msg.info = db._info.title.only
+  db.msg =
+    
+    ## A message in a message set
+    element msg {
+      db.msg.attlist, db.msg.info, db.msgmain, (db.msgsub | db.msgrel)*
+    }
+}
+div {
+  db.msgmain.role.attribute = attribute role { text }
+  db.msgmain.attlist =
+    db.msgmain.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgmain.info = db._info.title.only
+  db.msgmain =
+    
+    ## The primary component of a message in a message set 
+    element msgmain { db.msgmain.attlist, db.msgmain.info, db.msgtext }
+}
+div {
+  db.msgsub.role.attribute = attribute role { text }
+  db.msgsub.attlist =
+    db.msgsub.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgsub.info = db._info.title.only
+  db.msgsub =
+    
+    ## A subcomponent of a message in a message set
+    element msgsub { db.msgsub.attlist, db.msgsub.info, db.msgtext }
+}
+div {
+  db.msgrel.role.attribute = attribute role { text }
+  db.msgrel.attlist =
+    db.msgrel.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgrel.info = db._info.title.only
+  db.msgrel =
+    
+    ## A related component of a message in a message set
+    element msgrel { db.msgrel.attlist, db.msgrel.info, db.msgtext }
+}
+div {
+  db.msgtext.role.attribute = attribute role { text }
+  db.msgtext.attlist =
+    db.msgtext.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgtext =
+    
+    ## The actual text of a message component in a message set
+    element msgtext { db.msgtext.attlist, db.all.blocks+ }
+}
+div {
+  db.msginfo.role.attribute = attribute role { text }
+  db.msginfo.attlist =
+    db.msginfo.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msginfo =
+    
+    ## Information about a message in a message set
+    element msginfo {
+      db.msginfo.attlist, (db.msglevel | db.msgorig | db.msgaud)*
+    }
+}
+div {
+  db.msglevel.role.attribute = attribute role { text }
+  db.msglevel.attlist =
+    db.msglevel.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msglevel =
+    
+    ## The level of importance or severity of a message in a message set
+    element msglevel { db.msglevel.attlist, db._text }
+}
+div {
+  db.msgorig.role.attribute = attribute role { text }
+  db.msgorig.attlist =
+    db.msgorig.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgorig =
+    
+    ## The origin of a message in a message set
+    element msgorig { db.msgorig.attlist, db._text }
+}
+div {
+  db.msgaud.role.attribute = attribute role { text }
+  db.msgaud.attlist =
+    db.msgaud.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgaud =
+    
+    ## The audience to which a message in a message set is relevant
+    element msgaud { db.msgaud.attlist, db._text }
+}
+div {
+  db.msgexplan.role.attribute = attribute role { text }
+  db.msgexplan.attlist =
+    db.msgexplan.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgexplan.info = db._info.title.only
+  db.msgexplan =
+    
+    ## Explanatory material relating to a message in a message set
+    element msgexplan {
+      db.msgexplan.attlist, db.msgexplan.info, db.all.blocks+
+    }
+}
+div {
+  db.qandaset.role.attribute = attribute role { text }
+  db.qandaset.defaultlabel.enumeration =
+    
+    ## No labels
+    "none"
+    | 
+      ## Numeric labels
+      "number"
+    | 
+      ## "Q:" and "A:" labels
+      "qanda"
+  db.qandaset.defaultlabel.attribute =
+    
+    ## Specifies the default labelling
+    attribute defaultlabel { db.qandaset.defaultlabel.enumeration }
+  db.qandaset.attlist =
+    db.qandaset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.qandaset.defaultlabel.attribute?
+  db.qandaset.info = db._info.title.only
+  db.qandaset =
+    
+    ## A question-and-answer set
+    element qandaset {
+      db.qandaset.attlist,
+      db.qandaset.info,
+      db.all.blocks*,
+      (db.qandadiv+ | db.qandaentry+)
+    }
+}
+div {
+  db.qandadiv.role.attribute = attribute role { text }
+  db.qandadiv.attlist =
+    db.qandadiv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.qandadiv.info = db._info.title.only
+  db.qandadiv =
+    
+    ## A titled division in a QandASet
+    element qandadiv {
+      db.qandadiv.attlist,
+      db.qandadiv.info,
+      db.all.blocks*,
+      (db.qandadiv+ | db.qandaentry+)
+    }
+}
+div {
+  db.qandaentry.role.attribute = attribute role { text }
+  db.qandaentry.attlist =
+    db.qandaentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.qandaentry.info = db._info.title.only
+  db.qandaentry =
+    
+    ## A question/answer set within a QandASet
+    element qandaentry {
+      db.qandaentry.attlist, db.qandaentry.info, db.question, db.answer*
+    }
+}
+div {
+  db.question.role.attribute = attribute role { text }
+  db.question.attlist =
+    db.question.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.question =
+    
+    ## A question in a QandASet
+    element question { db.question.attlist, db.label?, db.all.blocks+ }
+}
+div {
+  db.answer.role.attribute = attribute role { text }
+  db.answer.attlist =
+    db.answer.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.answer =
+    
+    ## An answer to a question posed in a QandASet
+    element answer { db.answer.attlist, db.label?, db.all.blocks+ }
+}
+div {
+  db.label.role.attribute = attribute role { text }
+  db.label.attlist =
+    db.label.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.label =
+    
+    ## A label on a Question or Answer
+    element label { db.label.attlist, db._text }
+}
+db.math.inlines = db.inlineequation
+db.equation.content = (db.mediaobject+ | db.mathphrase+) | db._any.mml+
+db.inlineequation.content = db.inlinemediaobject+ | db.mathphrase+
+div {
+  db.equation.role.attribute = attribute role { text }
+  db.equation.label.attribute = db.label.attribute
+  db.equation.attlist =
+    db.equation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.equation.label.attribute?
+    & db.pgwide.attribute?
+    & db.floatstyle.attribute?
+  db.equation.info = db._info.title.only
+  db.equation =
+    
+    ## A displayed mathematical equation
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:table)"
+            "table must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element equation {
+      db.equation.attlist,
+      db.equation.info,
+      db.alt?,
+      db.equation.content,
+      db.caption?
+    }
+}
+div {
+  db.informalequation.role.attribute = attribute role { text }
+  db.informalequation.attlist =
+    db.informalequation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.informalequation.info = db._info.title.forbidden
+  db.informalequation =
+    
+    ## A displayed mathematical equation without a title
+    element informalequation {
+      db.informalequation.attlist,
+      db.informalequation.info,
+      db.alt?,
+      db.equation.content,
+      db.caption?
+    }
+}
+div {
+  db.inlineequation.role.attribute = attribute role { text }
+  db.inlineequation.attlist =
+    db.inlineequation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.inlineequation =
+    
+    ## A mathematical equation or expression occurring inline
+    element inlineequation {
+      db.inlineequation.attlist, db.alt?, db.inlineequation.content
+    }
+}
+div {
+  db.mathphrase.role.attribute = attribute role { text }
+  db.mathphrase.attlist =
+    db.mathphrase.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.mathphrase =
+    
+    ## A mathematical phrase, an expression that can be represented with ordinary text and a small amount of markup
+    element mathphrase {
+      db.mathphrase.attlist,
+      (db._text | db.ubiq.inlines | db._emphasis)*
+    }
+}
+div {
+  db.imagedata.mathml.role.attribute = attribute role { text }
+  db.imagedata.mathml.attlist =
+    db.imagedata.mathml.role.attribute?
+    & db.common.attributes
+    & 
+      ## Specifies that the format of the data is MathML
+      attribute format {
+        
+        ## Specifies MathML.
+        "mathml"
+      }?
+    & db.imagedata.align.attribute?
+    & db.imagedata.valign.attribute?
+    & db.imagedata.width.attribute?
+    & db.imagedata.contentwidth.attribute?
+    & db.imagedata.scalefit.attribute?
+    & db.imagedata.scale.attribute?
+    & db.imagedata.depth.attribute?
+    & db.imagedata.contentdepth.attribute?
+  db.imagedata.mathml.info = db._info.title.forbidden
+  db.imagedata.mathml =
+    
+    ## A MathML expression in a media object
+    element imagedata {
+      db.imagedata.mathml.attlist,
+      db.imagedata.mathml.info,
+      db._any.mml+
+    }
+}
+div {
+  db._any.mml =
+    
+    ## Any element from the MathML namespace
+    element mml:* { (db._any.attribute | text | db._any)* }
+}
+div {
+  db.imagedata.svg.role.attribute = attribute role { text }
+  db.imagedata.svg.attlist =
+    db.imagedata.svg.role.attribute?
+    & db.common.attributes
+    & 
+      ## Specifies that the format of the data is SVG
+      attribute format {
+        
+        ## Specifies SVG.
+        "svg"
+      }?
+    & db.imagedata.align.attribute?
+    & db.imagedata.valign.attribute?
+    & db.imagedata.width.attribute?
+    & db.imagedata.contentwidth.attribute?
+    & db.imagedata.scalefit.attribute?
+    & db.imagedata.scale.attribute?
+    & db.imagedata.depth.attribute?
+    & db.imagedata.contentdepth.attribute?
+  db.imagedata.svg.info = db._info.title.forbidden
+  db.imagedata.svg =
+    
+    ## An SVG drawing in a media object
+    element imagedata {
+      db.imagedata.svg.attlist, db.imagedata.svg.info, db._any.svg+
+    }
+}
+div {
+  db._any.svg =
+    
+    ## Any element from the SVG namespace
+    element svg:* { (db._any.attribute | text | db._any)* }
+}
diff --git a/xml/relaxng/testData/highlighting/rnc/fo/basic_properties.rnc b/xml/relaxng/testData/highlighting/rnc/fo/basic_properties.rnc
new file mode 100644
index 0000000..ed2ce42
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/fo/basic_properties.rnc
@@ -0,0 +1,648 @@
+# =========================================================
+#                                                          
+# (c) 2004, RenderX                                        
+#                                                          
+# Author: Alexander Peshkov <[email protected]>          
+#                                                          
+# Permission is granted to use this document, copy and     
+# modify free of charge, provided that every derived work  
+# bear a reference to the present document.                
+#                                                          
+# This document contains a computer program written in     
+# XSL Transformations Language. It is published with no    
+# warranty of any kind about its usability, as a mere      
+# example of XSL technology. RenderX shall not be          
+# considered liable for any damage or loss of data caused  
+# by use of this program.                                  
+#                                                          
+# =========================================================
+
+namespace local = ""
+default namespace fo = "http://www.w3.org/1999/XSL/Format"
+namespace rx = "http://www.renderx.com/XSL/Extensions"
+
+include "datatype.rnc"
+
+# ===============================================================   
+# Common properties content models used by several attributes
+# ===============================================================   
+border-style.attr-content =
+    "none"
+    | "hidden"
+    | "dotted"
+    | "dashed"
+    | "solid"
+    | "double"
+    | "groove"
+    | "ridge"
+    | "inset"
+    | "outset"
+    | "inherit"
+
+orientation.attr-content =
+    "0"
+    | "90"
+    | "180"
+    | "270"
+    | "-90"
+    | "-180"
+    | "-270"
+    | "0deg"
+    | "90deg"
+    | "180deg"
+    | "270deg"
+    | "-90deg"
+    | "-180deg"
+    | "-270deg"
+    | "inherit"
+
+keep.attr-content = "auto" | "always" | integer.datatype
+
+# ===============================================================   
+# Definitions of all the attributes (properties) used in XSL FO
+# includeing those from RX extensions
+# (definitions of attributes bearing 'rx' namespace named as rx-...,
+# but sorted according to the actual attribute name)
+# ===============================================================
+absolute-position.attr = attribute absolute-position { 
+    "absolute" | "fixed" 
+   }
+#MEMO: We forced to separate this property from actual 'absolute-position'
+container-position.attr = attribute absolute-position { 
+    "auto" | "inherit" | expr.datatype 
+   }
+
+active-state.attr = attribute active-state { 
+    "link" | "visited" | "active" | "hover" | "focus" | expr.datatype 
+   }
+alignment-adjust.attr = attribute alignment-adjust {  text | expr.datatype }
+alignment-baseline.attr = attribute alignment-baseline { 
+    "auto"
+    | "baseline"
+    | "before-edge"
+    | "text-before-edge"
+    | "middle"
+    | "central"
+    | "after-edge"
+    | "text-after-edge"
+    | "top"
+    | "text-top"
+    | "bottom"
+    | "text-bottom"
+    | "ideographic"
+    | "alphabetic"
+    | "hanging"
+    | "mathematical"
+    | "inherit"
+    | expr.datatype 
+   }
+auto-restore.attr = attribute auto-restore {  "true" | "false" | expr.datatype }
+azimuth.attr = attribute azimuth {  text | expr.datatype }
+background.attr = attribute background {  text | expr.datatype }
+background-attachment.attr = attribute background-attachment {  "scroll" | "fixed" | "inherit" | expr.datatype }
+background-color.attr = attribute background-color {  text | expr.datatype }
+background-image.attr = attribute background-image {  text | expr.datatype }
+background-position.attr = attribute background-position {  text | expr.datatype }
+background-position-horizontal.attr = attribute background-position-horizontal {  text | expr.datatype }
+background-position-vertical.attr = attribute background-position-vertical {  text | expr.datatype }
+background-repeat.attr = attribute background-repeat { 
+    "repeat" | "repeat-x" | "repeat-y" | "no-repeat" | "inherit" | expr.datatype 
+   }
+#RenderX extension attributes
+rx-background-content-type.attr = attribute rx:background-content-type { text | expr.datatype  }
+rx-background-content-height.attr = attribute rx:background-content-height { text | expr.datatype  }
+rx-background-content-width.attr = attribute rx:background-content-width { text | expr.datatype  }
+rx-background-scaling.attr = attribute rx:background-scaling { "uniform" | "non-uniform" | expr.datatype  }
+
+baseline-shift.attr = attribute baseline-shift {  text | expr.datatype }
+blank-or-not-blank.attr = attribute blank-or-not-blank { 
+    "blank" | "not-blank" | "any" | "inherit" | expr.datatype 
+   }
+block-progression-dimension.attr = attribute block-progression-dimension {  text | expr.datatype }
+block-progression-dimension.maximum.attr = attribute block-progression-dimension.maximum {  text | expr.datatype }
+block-progression-dimension.minimum.attr = attribute block-progression-dimension.minimum {  text | expr.datatype }
+block-progression-dimension.optimum.attr = attribute block-progression-dimension.optimum {  text | expr.datatype }
+border.attr = attribute border {  text | expr.datatype }
+border-after-color.attr = attribute border-after-color {  text | expr.datatype }
+border-after-precedence.attr = attribute border-after-precedence {  text | expr.datatype }
+border-after-style.attr = attribute border-after-style { border-style.attr-content | expr.datatype  }
+border-after-width.attr = attribute border-after-width {  text | expr.datatype }
+border-after-width.conditionality.attr = attribute border-after-width.conditionality {  "discard" | "retain" | expr.datatype }
+border-after-width.length.attr = attribute border-after-width.length {  text | expr.datatype }
+border-before-color.attr = attribute border-before-color {  text | expr.datatype }
+border-before-precedence.attr = attribute border-before-precedence {  text | expr.datatype }
+border-before-style.attr = attribute border-before-style { border-style.attr-content | expr.datatype  }
+border-before-width.attr = attribute border-before-width {  text | expr.datatype }
+border-before-width.conditionality.attr = attribute border-before-width.conditionality { 
+    "discard" | "retain" | expr.datatype 
+   }
+border-before-width.length.attr = attribute border-before-width.length {  text | expr.datatype }
+border-bottom.attr = attribute border-bottom {  text | expr.datatype }
+border-bottom-color.attr = attribute border-bottom-color {  text | expr.datatype }
+border-bottom-style.attr = attribute border-bottom-style { border-style.attr-content | expr.datatype  }
+border-bottom-width.attr = attribute border-bottom-width {  text | expr.datatype }
+border-bottom-width.conditionality.attr = attribute border-bottom-width.conditionality { 
+    "discard" | "retain" | expr.datatype 
+   }
+border-bottom-width.length.attr = attribute border-bottom-width.length {  text | expr.datatype }
+border-collapse.attr = attribute border-collapse { 
+    "collapse" | "collapse-with-precedence" | "separate" | "inherit" | expr.datatype 
+   }
+border-color.attr = attribute border-color {  text | expr.datatype }
+border-end-color.attr = attribute border-end-color {  text | expr.datatype }
+border-end-precedence.attr = attribute border-end-precedence {  text | expr.datatype }
+border-end-style.attr = attribute border-end-style { border-style.attr-content | expr.datatype  }
+border-end-width.attr = attribute border-end-width {  text | expr.datatype }
+border-end-width.conditionality.attr = attribute border-end-width.conditionality {  "discard" | "retain" | expr.datatype }
+border-end-width.length.attr = attribute border-end-width.length {  text | expr.datatype }
+border-left.attr = attribute border-left {  text | expr.datatype }
+border-left-color.attr = attribute border-left-color {  text | expr.datatype }
+border-left-style.attr = attribute border-left-style { border-style.attr-content | expr.datatype  }
+border-left-width.attr = attribute border-left-width {  text | expr.datatype }
+border-left-width.conditionality.attr = attribute border-left-width.conditionality {  "discard" | "retain" | expr.datatype }
+border-left-width.length.attr = attribute border-left-width.length {  text | expr.datatype }
+border-right.attr = attribute border-right {  text | expr.datatype }
+border-right-color.attr = attribute border-right-color {  text | expr.datatype }
+border-right-style.attr = attribute border-right-style { border-style.attr-content | expr.datatype }
+border-right-width.attr = attribute border-right-width {  text | expr.datatype }
+border-right-width.conditionality.attr = attribute border-right-width.conditionality {  "discard" | "retain" | expr.datatype }
+border-right-width.length.attr = attribute border-right-width.length {  text | expr.datatype }
+border-separation.attr = attribute border-separation {  text | expr.datatype }
+border-separation.block-progression-direction.attr = attribute border-separation.block-progression-direction {  text | expr.datatype }
+border-separation.inline-progression-direction.attr = attribute border-separation.inline-progression-direction {  text | expr.datatype }
+border-spacing.attr = attribute border-spacing {  text | expr.datatype }
+border-start-color.attr = attribute border-start-color {  text | expr.datatype }
+border-start-precedence.attr = attribute border-start-precedence {  text | expr.datatype }
+border-start-style.attr = attribute border-start-style { border-style.attr-content | expr.datatype  }
+border-start-width.attr = attribute border-start-width {  text | expr.datatype }
+border-start-width.conditionality.attr = attribute border-start-width.conditionality {  "discard" | "retain" | expr.datatype }
+border-start-width.length.attr = attribute border-start-width.length {  text | expr.datatype }
+border-style.attr = attribute border-style {  text | expr.datatype }
+border-top.attr = attribute border-top {  text | expr.datatype }
+border-top-color.attr = attribute border-top-color {  text | expr.datatype }
+border-top-style.attr = attribute border-top-style { border-style.attr-content | expr.datatype  }
+border-top-width.attr = attribute border-top-width {  text | expr.datatype }
+border-top-width.conditionality.attr = attribute border-top-width.conditionality {  "discard" | "retain" | expr.datatype }
+border-top-width.length.attr = attribute border-top-width.length {  text | expr.datatype }
+border-width.attr = attribute border-width {  text | expr.datatype }
+bottom.attr = attribute bottom {  text | expr.datatype }
+break-after.attr = attribute break-after { 
+    "auto" | "column" | "page" | "even-page" | "odd-page" | "inherit" | expr.datatype 
+   }
+break-before.attr = attribute break-before { 
+    "auto" | "column" | "page" | "even-page" | "odd-page" | "inherit" | expr.datatype 
+   }
+caption-side.attr = attribute caption-side { 
+    "before"
+    | "after"
+    | "start"
+    | "end"
+    | "top"
+    | "bottom"
+    | "left"
+    | "right"
+    | "inherit"
+    | expr.datatype 
+   }
+case-name.attr = attribute case-name {  text | expr.datatype }
+case-title.attr = attribute case-title {  text | expr.datatype }
+character.attr = attribute character {  text  }
+clear.attr = attribute clear { 
+    "start" | "end" | "left" | "right" | "both" | "none" | "inherit" | expr.datatype 
+   }
+clip.attr = attribute clip {  shape.datatype | "auto" | "inherit" | expr.datatype }
+collapse-subtree.attr = attribute collapse-subtree { "true" | "false" | expr.datatype  }
+color.attr = attribute color {  text | expr.datatype }
+color-profile-name.attr = attribute color-profile-name {  text  }
+column-count.attr = attribute column-count {  text | expr.datatype }
+column-gap.attr = attribute column-gap {  text | expr.datatype }
+column-number.attr = attribute column-number {  text | expr.datatype }
+column-width.attr = attribute column-width {  text | expr.datatype }
+content-height.attr = attribute content-height {  text | expr.datatype }
+content-type.attr = attribute content-type {  text | expr.datatype }
+content-width.attr = attribute content-width {  text | expr.datatype }
+country.attr = attribute country {  text | expr.datatype }
+cue.attr = attribute cue {  text | expr.datatype }
+cue-after.attr = attribute cue-after {  text | expr.datatype }
+cue-before.attr = attribute cue-before {  text | expr.datatype }
+destination-placement-offset.attr = attribute destination-placement-offset {  text | expr.datatype }
+direction.attr = attribute direction {  "ltr" | "rtl" | "inherit" | expr.datatype }
+display-align.attr = attribute display-align { 
+    "auto" | "before" | "center" | "after" | "inherit" | expr.datatype 
+   }
+dominant-baseline.attr = attribute dominant-baseline { 
+    "auto"
+    | "use-script"
+    | "no-change"
+    | "reset-size"
+    | "ideographic"
+    | "alphabetic"
+    | "hanging"
+    | "mathematical"
+    | "central"
+    | "middle"
+    | "text-after-edge"
+    | "text-before-edge"
+    | "inherit"
+    | expr.datatype 
+   }
+elevation.attr = attribute elevation {  text | expr.datatype }
+empty-cells.attr = attribute empty-cells {  "show" | "hide" | "inherit" | expr.datatype }
+end-indent.attr = attribute end-indent {  text | expr.datatype }
+ends-row.attr = attribute ends-row {  "true" | "false" | expr.datatype }
+extent.attr = attribute extent {  text | expr.datatype }
+external-destination.attr = attribute external-destination {  text | expr.datatype }
+#MEMO: We have separated this property into the two (for side and before floats)
+#MEMO: Float values "inside" and "outside" are RenderX extensions.
+before-float.attr = attribute float { 
+    "before"
+   }
+side-float.attr = attribute float { 
+    "start" | "end" | "left" | "right" | "none" | "inside" | "outside" | "inherit" | expr.datatype 
+   }
+ flow-name.attr = attribute flow-name {  text  }
+font.attr = attribute font {  text | expr.datatype }
+font-family.attr = attribute font-family {  text | expr.datatype }
+font-selection-strategy.attr = attribute font-selection-strategy { 
+    "auto" | "character-by-character" | "inherit" | expr.datatype 
+   }
+font-size.attr = attribute font-size {  text | expr.datatype }
+font-size-adjust.attr = attribute font-size-adjust {  text | expr.datatype }
+font-stretch.attr = attribute font-stretch { 
+    "normal"
+    | "wider"
+    | "narrower"
+    | "ultra-condensed"
+    | "extra-condensed"
+    | "condensed"
+    | "semi-condensed"
+    | "semi-expanded"
+    | "expanded"
+    | "extra-expanded"
+    | "ultra-expanded"
+    | "inherit"
+    | expr.datatype 
+   }
+font-style.attr = attribute font-style { 
+    "normal" | "italic" | "oblique" | "backslant" | "inherit" | expr.datatype 
+   }
+font-variant.attr = attribute font-variant {  "normal" | "small-caps" | "inherit" | expr.datatype }
+font-weight.attr = attribute font-weight { 
+    "normal"
+    | "bold"
+    | "bolder"
+    | "lighter"
+    | "inherit"
+    | "100"
+    | "200"
+    | "300"
+    | "400"
+    | "500"
+    | "600"
+    | "700"
+    | "800"
+    | "900"
+    | expr.datatype 
+   }
+force-page-count.attr = attribute force-page-count { 
+    "auto"
+    | "even"
+    | "odd"
+    | "end-on-even"
+    | "end-on-odd"
+    | "no-force"
+    | "inherit"
+    | expr.datatype 
+   }
+format.attr = attribute format {  text  }
+glyph-orientation-horizontal.attr = attribute glyph-orientation-horizontal { orientation.attr-content | expr.datatype  } 
+glyph-orientation-vertical.attr = attribute glyph-orientation-vertical { orientation.attr-content | expr.datatype  } 
+grouping-separator.attr = attribute grouping-separator {  text  }
+grouping-size.attr = attribute grouping-size {  text | expr.datatype }
+height.attr = attribute height {  text | expr.datatype }
+hyphenate.attr = attribute hyphenate {  "false" | "true" | "inherit" | expr.datatype }
+hyphenation-character.attr = attribute hyphenation-character {  text  }
+hyphenation-keep.attr = attribute hyphenation-keep { 
+    "auto" | "column" | "page" | "inherit" | expr.datatype 
+   }
+hyphenation-ladder-count.attr = attribute hyphenation-ladder-count {  text | expr.datatype }
+hyphenation-push-character-count.attr = attribute hyphenation-push-character-count {  text | expr.datatype }
+hyphenation-remain-character-count.attr = attribute hyphenation-remain-character-count {  text | expr.datatype }
+id.attr = attribute id {  text  }
+indicate-destination.attr = attribute indicate-destination {  "true" | "false" | expr.datatype }
+initial-page-number.attr = attribute initial-page-number {  text | expr.datatype }
+inline-progression-dimension.attr = attribute inline-progression-dimension {  text | expr.datatype }
+inline-progression-dimension.maximum.attr = attribute inline-progression-dimension.maximum {  text | expr.datatype }
+inline-progression-dimension.minimum.attr = attribute inline-progression-dimension.minimum {  text | expr.datatype }
+inline-progression-dimension.optimum.attr = attribute inline-progression-dimension.optimum {  text | expr.datatype }
+internal-destination.attr = attribute internal-destination {  text  }
+intrusion-displace.attr = attribute intrusion-displace { 
+    "auto" | "none" | "line" | "indent" | "block" | "inherit" | expr.datatype 
+   }
+keep-together.attr = attribute keep-together {  keep.attr-content | expr.datatype }
+keep-together.within-column.attr = attribute keep-together.within-column {  keep.attr-content | expr.datatype }
+keep-together.within-line.attr = attribute keep-together.within-line {  keep.attr-content | expr.datatype }
+keep-together.within-page.attr = attribute keep-together.within-page {  keep.attr-content | expr.datatype }
+keep-with-next.attr = attribute keep-with-next {  keep.attr-content | expr.datatype }
+keep-with-next.within-column.attr = attribute keep-with-next.within-column {  keep.attr-content | expr.datatype }
+keep-with-next.within-line.attr = attribute keep-with-next.within-line {  keep.attr-content | expr.datatype }
+keep-with-next.within-page.attr = attribute keep-with-next.within-page {  keep.attr-content | expr.datatype }
+keep-with-previous.attr = attribute keep-with-previous {  keep.attr-content | expr.datatype }
+keep-with-previous.within-column.attr = attribute keep-with-previous.within-column {  keep.attr-content | expr.datatype }
+keep-with-previous.within-line.attr = attribute keep-with-previous.within-line {  keep.attr-content | expr.datatype }
+keep-with-previous.within-page.attr = attribute keep-with-previous.within-page {  keep.attr-content | expr.datatype }
+#RenderX extension attribute
+rx-key.attr = attribute rx:key { text }
+language.attr = attribute language {  text | expr.datatype }
+last-line-end-indent.attr = attribute last-line-end-indent {  text | expr.datatype }
+leader-alignment.attr = attribute leader-alignment { 
+    "none" | "reference-area" | "page" | "inherit" | expr.datatype 
+   }
+leader-length.attr = attribute leader-length {  text | expr.datatype }
+leader-length.maximum.attr = attribute leader-length.maximum {  text | expr.datatype }
+leader-length.minimum.attr = attribute leader-length.minimum {  text | expr.datatype }
+leader-length.optimum.attr = attribute leader-length.optimum {  text | expr.datatype }
+leader-pattern.attr = attribute leader-pattern { 
+    "space" | "rule" | "dots" | "use-content" | "inherit" | expr.datatype 
+   }
+leader-pattern-width.attr = attribute leader-pattern-width {  text | expr.datatype }
+left.attr = attribute left {  text | expr.datatype }
+letter-spacing.attr = attribute letter-spacing {  text | expr.datatype }
+letter-spacing.conditionality.attr = attribute letter-spacing.conditionality {  "retain" | "discard" | expr.datatype }
+letter-spacing.maximum.attr = attribute letter-spacing.maximum {  text | expr.datatype }
+letter-spacing.minimum.attr = attribute letter-spacing.minimum {  text | expr.datatype }
+letter-spacing.optimum.attr = attribute letter-spacing.optimum {  text | expr.datatype }
+letter-spacing.precedence.attr = attribute letter-spacing.precedence {  text | expr.datatype }
+letter-value.attr = attribute letter-value {  "auto" | "alphabetic" | "traditional" | expr.datatype }
+line-height.attr = attribute line-height {  text | expr.datatype }
+line-height-shift-adjustment.attr = attribute line-height-shift-adjustment {  text | expr.datatype }
+line-height.conditionality.attr = attribute line-height.conditionality {  "retain" | "discard" | expr.datatype }
+line-height.maximum.attr = attribute line-height.maximum {  text | expr.datatype }
+line-height.minimum.attr = attribute line-height.minimum {  text | expr.datatype }
+line-height.optimum.attr = attribute line-height.optimum {  text | expr.datatype }
+line-height.precedence.attr = attribute line-height.precedence {  text | expr.datatype }
+line-stacking-strategy.attr = attribute line-stacking-strategy { 
+    "line-height" | "font-height" | "max-height" | "inherit" | expr.datatype 
+   }
+linefeed-treatment.attr = attribute linefeed-treatment { 
+    "ignore"
+    | "preserve"
+    | "treat-as-space"
+    | "treat-as-zero-width-space"
+    | "inherit"
+    | expr.datatype 
+   }
+link-back.attr = attribute link-back {  text | expr.datatype }
+list-separator.attr = attribute list-separator {  text  }
+margin.attr = attribute margin {  text | expr.datatype }
+margin-bottom.attr = attribute margin-bottom {  text | expr.datatype }
+margin-left.attr = attribute margin-left {  text | expr.datatype }
+margin-right.attr = attribute margin-right {  text | expr.datatype }
+margin-top.attr = attribute margin-top {  text | expr.datatype }
+marker-class-name.attr = attribute marker-class-name {  text  }
+master-name.attr = attribute master-name {  text  }
+master-reference.attr = attribute master-reference {  text  }
+max-height.attr = attribute max-height {  text | expr.datatype }
+max-width.attr = attribute max-width {  text | expr.datatype }
+maximum-repeats.attr = attribute maximum-repeats {  text | expr.datatype }
+media-usage.attr = attribute media-usage { 
+    "auto" | "paginate" | "bounded-in-one-dimension" | "unbounded" | expr.datatype 
+   }
+merge-subsequent-page-numbers.attr = attribute merge-subsequent-page-numbers {  text | expr.datatype }
+min-height.attr = attribute min-height {  text | expr.datatype }
+min-width.attr = attribute min-width {  text | expr.datatype }
+#NOTE: It's RenderX extension attribute (belongs to rx:meta-field). It enumerates values currently available in XEP
+name.attr = attribute name { 
+    "author" | "title" | "subject" | "keywords" | expr.datatype 
+   }
+number-columns-repeated.attr = attribute number-columns-repeated {  text | expr.datatype }
+number-columns-spanned.attr = attribute number-columns-spanned {  text | expr.datatype }
+number-rows-spanned.attr = attribute number-rows-spanned {  text | expr.datatype }
+odd-or-even.attr = attribute odd-or-even {  "odd" | "even" | "any" | "inherit" | expr.datatype }
+rx-table-omit-initial-header.attr = attribute rx:table-omit-initial-header { "true" | "false" | expr.datatype  }
+orphans.attr = attribute orphans {  text | expr.datatype }
+overflow.attr = attribute overflow { 
+    "visible"
+    | "hidden"
+    | "scroll"
+    | "auto"
+    | "error-if-overflow"
+    | "inherit" | expr.datatype 
+   }
+padding.attr = attribute padding {  text | expr.datatype }
+padding-after.attr = attribute padding-after {  text | expr.datatype }
+padding-after.conditionality.attr = attribute padding-after.conditionality {  "discard" | "retain" | expr.datatype }
+padding-after.length.attr = attribute padding-after.length {  text | expr.datatype }
+padding-before.attr = attribute padding-before {  text | expr.datatype }
+padding-before.conditionality.attr = attribute padding-before.conditionality {  "discard" | "retain" | expr.datatype }
+padding-before.length.attr = attribute padding-before.length {  text | expr.datatype }
+padding-bottom.attr = attribute padding-bottom {  text | expr.datatype }
+padding-bottom.conditionality.attr = attribute padding-bottom.conditionality {  "discard" | "retain" | expr.datatype }
+padding-bottom.length.attr = attribute padding-bottom.length {  text | expr.datatype }
+padding-end.attr = attribute padding-end {  text | expr.datatype }
+padding-end.conditionality.attr = attribute padding-end.conditionality {  "discard" | "retain" | expr.datatype }
+padding-end.length.attr = attribute padding-end.length {  text | expr.datatype }
+padding-left.attr = attribute padding-left {  text | expr.datatype }
+padding-left.conditionality.attr = attribute padding-left.conditionality {  "discard" | "retain" | expr.datatype }
+padding-left.length.attr = attribute padding-left.length {  text | expr.datatype }
+padding-right.attr = attribute padding-right {  text | expr.datatype }
+padding-right.conditionality.attr = attribute padding-right.conditionality {  "discard" | "retain" | expr.datatype }
+padding-right.length.attr = attribute padding-right.length {  text | expr.datatype }
+padding-start.attr = attribute padding-start {  text | expr.datatype }
+padding-start.conditionality.attr = attribute padding-start.conditionality {  "discard" | "retain" | expr.datatype }
+padding-start.length.attr = attribute padding-start.length {  text | expr.datatype }
+padding-top.attr = attribute padding-top {  text | expr.datatype }
+padding-top.conditionality.attr = attribute padding-top.conditionality {  "discard" | "retain" | expr.datatype }
+padding-top.length.attr = attribute padding-top.length {  text | expr.datatype }
+page-break-after.attr = attribute page-break-after { 
+    "auto" | "always" | "avoid" | "left" | "right" | "inherit" | expr.datatype 
+   }
+page-break-before.attr = attribute page-break-before { 
+    "auto" | "always" | "avoid" | "left" | "right" | "inherit" | expr.datatype 
+   }
+page-break-inside.attr = attribute page-break-inside {  "avoid" | "auto" | "inherit" | expr.datatype }
+page-height.attr = attribute page-height {  text | expr.datatype }
+page-position.attr = attribute page-position { 
+    "first" | "last" | "rest" | "any" | "inherit" | expr.datatype 
+   }
+page-width.attr = attribute page-width {  text | expr.datatype }
+pause.attr = attribute pause {  text | expr.datatype }
+pause-after.attr = attribute pause-after {  text | expr.datatype }
+pause-before.attr = attribute pause-before {  text | expr.datatype }
+pitch.attr = attribute pitch {  text | expr.datatype }
+pitch-range.attr = attribute pitch-range {  text | expr.datatype }
+play-during.attr = attribute play-during {  text | expr.datatype }
+#MEMO: We forced to devide this shorthand since we have separate absolute-container element
+absolute-position-shorthand.attr = attribute position { 
+    "absolute" | "fixed"
+   }
+relative-position-shorthand.attr = attribute position { 
+    "static" | "relative" | "inherit" | expr.datatype 
+   }
+precedence.attr = attribute precedence { "true" | "false" | "inherit" | expr.datatype }
+provisional-distance-between-starts.attr = attribute provisional-distance-between-starts {  text | expr.datatype }
+provisional-label-separation.attr = attribute provisional-label-separation {  text | expr.datatype }
+range-separator.attr = attribute range-separator {  text  }
+ref-id.attr = attribute ref-id {  text  }
+ref-key.attr = attribute ref-key {  text  }
+reference-orientation.attr = attribute reference-orientation { orientation.attr-content | expr.datatype  }
+region-name.attr = attribute region-name {  text  }
+relative-align.attr = attribute relative-align {  "before" | "baseline" | "inherit" | expr.datatype }
+relative-position.attr = attribute relative-position { 
+    "auto" | "static" | "relative" | "inherit" | expr.datatype 
+   }
+rendering-intent.attr = attribute rendering-intent { 
+    "auto" | "perceptual" | "relative-colorimetric" | "saturation" | "absolute-colorimetric" | "inherit" | expr.datatype 
+   }?
+retrieve-boundary.attr = attribute retrieve-boundary {  "page" | "page-sequence" | "document" | expr.datatype }
+retrieve-class-name.attr = attribute retrieve-class-name {  text  }
+retrieve-position.attr = attribute retrieve-position { 
+    "first-starting-within-page"
+    | "first-including-carryover"
+    | "last-starting-within-page"
+    | "last-ending-within-page"
+    | expr.datatype 
+   }
+richness.attr = attribute richness {  text | expr.datatype }
+right.attr = attribute right {  text | expr.datatype }
+role.attr = attribute role {  text  }
+rule-style.attr = attribute rule-style { 
+    "none"
+    | "dotted"
+    | "dashed"
+    | "solid"
+    | "double"
+    | "groove"
+    | "ridge"
+    | "inherit"
+    | expr.datatype 
+   }
+rule-thickness.attr = attribute rule-thickness {  text | expr.datatype }
+scaling.attr = attribute scaling {  "uniform" | "non-uniform" | "inherit" | expr.datatype }
+scaling-method.attr = attribute scaling-method { 
+    "auto" | "integer-pixels" | "resample-any-method" | "inherit" | expr.datatype 
+   }
+score-spaces.attr = attribute score-spaces {  "true" | "false" | "inherit" | expr.datatype }
+script.attr = attribute script {  text | expr.datatype }
+show-destination.attr = attribute show-destination {  "replace" | "new" | expr.datatype }
+size.attr = attribute size {  text | expr.datatype }
+source-document.attr = attribute source-document {  text  }
+space-after.attr = attribute space-after {  text | expr.datatype }
+space-after.conditionality.attr = attribute space-after.conditionality {  "retain" | "discard" | expr.datatype }
+space-after.maximum.attr = attribute space-after.maximum {  text | expr.datatype }
+space-after.minimum.attr = attribute space-after.minimum {  text | expr.datatype }
+space-after.optimum.attr = attribute space-after.optimum {  text | expr.datatype }
+space-after.precedence.attr = attribute space-after.precedence {  text | expr.datatype }
+space-before.attr = attribute space-before {  text | expr.datatype }
+space-before.conditionality.attr = attribute space-before.conditionality {  "retain" | "discard" | expr.datatype }
+space-before.maximum.attr = attribute space-before.maximum {  text | expr.datatype }
+space-before.minimum.attr = attribute space-before.minimum {  text | expr.datatype }
+space-before.optimum.attr = attribute space-before.optimum {  text | expr.datatype }
+space-before.precedence.attr = attribute space-before.precedence {  text | expr.datatype }
+space-end.attr = attribute space-end {  text | expr.datatype }
+space-end.conditionality.attr = attribute space-end.conditionality {  "retain" | "discard" | expr.datatype }
+space-end.maximum.attr = attribute space-end.maximum {  text | expr.datatype }
+space-end.minimum.attr = attribute space-end.minimum {  text | expr.datatype }
+space-end.optimum.attr = attribute space-end.optimum {  text | expr.datatype }
+space-end.precedence.attr = attribute space-end.precedence {  text | expr.datatype }
+space-start.attr = attribute space-start {  text | expr.datatype }
+space-start.conditionality.attr = attribute space-start.conditionality {  "retain" | "discard" | expr.datatype }
+space-start.maximum.attr = attribute space-start.maximum {  text | expr.datatype }
+space-start.minimum.attr = attribute space-start.minimum {  text | expr.datatype }
+space-start.optimum.attr = attribute space-start.optimum {  text | expr.datatype }
+space-start.precedence.attr = attribute space-start.precedence {  text | expr.datatype }
+span.attr = attribute span {  "none" | "all" | "inherit" | expr.datatype }
+speak.attr = attribute speak {  "normal" | "none" | "spell-out" | "inherit" | expr.datatype }
+speak-header.attr = attribute speak-header {  "once" | "always" | "inherit" | expr.datatype }
+speak-numeral.attr = attribute speak-numeral {  "digits" | "continuous" | "inherit" | expr.datatype }
+speak-punctuation.attr = attribute speak-punctuation {  "code" | "none" | "inherit" | expr.datatype }
+speech-rate.attr = attribute speech-rate {  text | expr.datatype }
+src.attr = attribute src {  text | expr.datatype }
+start-indent.attr = attribute start-indent {  text | expr.datatype }
+starting-state.attr = attribute starting-state {  text | expr.datatype }
+starts-row.attr = attribute starts-row {  "true" | "false" | expr.datatype }
+stress.attr = attribute stress {  text | expr.datatype }
+suppress-at-line-break.attr = attribute suppress-at-line-break { 
+    "auto" | "suppress" | "retain" | "inherit" | expr.datatype 
+   }
+switch-to.attr = attribute switch-to {  text | expr.datatype }
+table-layout.attr = attribute table-layout {  "auto" | "fixed" | "inherit" | expr.datatype }
+table-omit-footer-at-break.attr = attribute table-omit-footer-at-break {  "true" | "false" | "inherit" | expr.datatype }
+table-omit-header-at-break.attr = attribute table-omit-header-at-break { 
+    "true" | "false" | "inherit" | expr.datatype 
+   }
+target-presentation-context.attr = attribute target-presentation-context {  text  }
+target-processing-context.attr = attribute target-processing-context {  text  }
+target-stylesheet.attr = attribute target-stylesheet {  text  }
+#MEMO: <string> values are temporarily excluded from text-align and text-align-last
+text-align.attr = attribute text-align { 
+    "start"
+    | "center"
+    | "end"
+    | "justify"
+    | "inside"
+    | "outside"
+    | "left"
+    | "right"
+    | "inherit"
+    | expr.datatype 
+   }
+text-align-last.attr = attribute text-align-last { 
+    "relative"
+    | "start"
+    | "center"
+    | "end"
+    | "justify"
+    | "inside"
+    | "outside"
+    | "left"
+    | "right"
+    | "inherit"
+    | expr.datatype 
+   }
+text-altitude.attr = attribute text-altitude {  text | expr.datatype }
+text-decoration.attr = attribute text-decoration {  xsd:NMTOKENS | expr.datatype }
+text-depth.attr = attribute text-depth {  text | expr.datatype }
+text-indent.attr = attribute text-indent {  text | expr.datatype }
+text-shadow.attr = attribute text-shadow {  text | expr.datatype }
+text-transform.attr = attribute text-transform { 
+    "capitalize" | "uppercase" | "lowercase" | "none" | "inherit" | expr.datatype 
+   }
+top.attr = attribute top {  text | expr.datatype }
+treat-as-word-space.attr = attribute treat-as-word-space { 
+    "auto" | "true" | "false" | "inherit" | expr.datatype 
+   }
+unicode-bidi.attr = attribute unicode-bidi { 
+    "normal" | "embed" | "bidi-override" | "inherit" | expr.datatype 
+   }
+value.attr = attribute value {  text  }
+vertical-align.attr = attribute vertical-align {  text | expr.datatype }
+visibility.attr = attribute visibility { 
+    "visible" | "hidden" | "collapse" | "inherit" | expr.datatype 
+   }
+voice-family.attr = attribute voice-family {  text | expr.datatype }
+volume.attr = attribute volume {  text | expr.datatype }
+white-space.attr = attribute white-space {  "normal" | "pre" | "nowrap" | "inherit" | expr.datatype }
+white-space-collapse.attr = attribute white-space-collapse {  "false" | "true" | "inherit" | expr.datatype }
+white-space-treatment.attr = attribute white-space-treatment { 
+    "ignore"
+    | "preserve"
+    | "ignore-if-before-linefeed"
+    | "ignore-if-after-linefeed"
+    | "ignore-if-surrounding-linefeed"
+    | "inherit"
+    | expr.datatype 
+   }
+widows.attr = attribute widows {  text | expr.datatype }
+width.attr = attribute width {  text | expr.datatype }
+word-spacing.attr = attribute word-spacing {  text | expr.datatype }
+word-spacing.conditionality.attr = attribute word-spacing.conditionality {  "retain" | "discard" | expr.datatype }
+word-spacing.maximum.attr = attribute word-spacing.maximum {  text | expr.datatype }
+word-spacing.minimum.attr = attribute word-spacing.minimum {  text | expr.datatype }
+word-spacing.optimum.attr = attribute word-spacing.optimum {  text | expr.datatype }
+word-spacing.precedence.attr = attribute word-spacing.precedence {  text | expr.datatype }
+wrap-option.attr = attribute wrap-option {  "no-wrap" | "wrap" | "inherit" | expr.datatype }
+writing-mode.attr = attribute writing-mode { 
+    "lr-tb" | "rl-tb" | "tb-rl" | "lr" | "rl" | "tb" | "inherit" | expr.datatype 
+   }
+z-index.attr = attribute z-index {  text | expr.datatype }
diff --git a/xml/relaxng/testData/highlighting/rnc/fo/datatype.rnc b/xml/relaxng/testData/highlighting/rnc/fo/datatype.rnc
new file mode 100644
index 0000000..a2a954f
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/fo/datatype.rnc
@@ -0,0 +1,54 @@
+# =========================================================
+#                                                          
+# (c) 2004, RenderX                                        
+#                                                          
+# Author: Alexander Peshkov <[email protected]>          
+#                                                          
+# Permission is granted to use this document, copy and     
+# modify free of charge, provided that every derived work  
+# bear a reference to the present document.                
+#                                                          
+# This document contains a computer program written in     
+# XSL Transformations Language. It is published with no    
+# warranty of any kind about its usability, as a mere      
+# example of XSL technology. RenderX shall not be          
+# considered liable for any damage or loss of data caused  
+# by use of this program.                                  
+#                                                          
+# =========================================================
+
+namespace local = ""
+default namespace fo = "http://www.w3.org/1999/XSL/Format"
+namespace rx = "http://www.renderx.com/XSL/Extensions"
+
+# ***************************************************************
+# Common XSL FO datatypes definitions
+# ***************************************************************
+integer.datatype = xsd:integer
+number.datatype = xsd:decimal
+length.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em)" }
+angle.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)(deg|grad|rad)" }
+percentage.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)%" }
+character.datatype = xsd:string { pattern = ".|\r|\n" }
+string.datatype = string
+name.datatype = xsd:NCName
+family-name.datatype = xsd:normalizedString
+#MEMO: Should I add some constraints to the family-name.datatype?
+color.datatype= xsd:token
+#MEMO: Should I add some constraints to the color.datatype?
+country.datatype = xsd:string { pattern = "\w{2,3}" }
+language.datatype = xsd:string { pattern = "\w{2,3}" }
+script.datatype = xsd:string { pattern = "\w" }
+#MEMO: Should I add detailed constraints to the country/language/script.datatype?
+uri-specification.datatype = xsd:string
+#MEMO: Should I add some constraints to the uri-specification.datatype?
+time.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)(m?s)" }
+frequency.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)(k?Hz)" }
+# NOTE: <shape> datatype added in XSL FO 1.0 Errata
+shape.datatype = xsd:normalizedString { pattern = "(([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto)" }
+
+# ***************************************************************
+# Special datatype - expressions
+# ***************************************************************
+#MEMO: simple example of constraint for functions
+expr.datatype = xsd:normalizedString { pattern = ".*\(.*\).*" }
diff --git a/xml/relaxng/testData/highlighting/rnc/fo/elements.rnc b/xml/relaxng/testData/highlighting/rnc/fo/elements.rnc
new file mode 100644
index 0000000..327b499
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/fo/elements.rnc
@@ -0,0 +1,554 @@
+# =========================================================
+#                                                          
+# (c) 2004, RenderX                                        
+#                                                          
+# Author: Alexander Peshkov <[email protected]>          
+#                                                          
+# Permission is granted to use this document, copy and     
+# modify free of charge, provided that every derived work  
+# bear a reference to the present document.                
+#                                                          
+# This document contains a computer program written in     
+# XSL Transformations Language. It is published with no    
+# warranty of any kind about its usability, as a mere      
+# example of XSL technology. RenderX shall not be          
+# considered liable for any damage or loss of data caused  
+# by use of this program.                                  
+#                                                          
+# =========================================================
+
+namespace local = ""
+default namespace fo = "http://www.w3.org/1999/XSL/Format"
+namespace rx = "http://www.renderx.com/XSL/Extensions"
+
+include "properties.rnc"
+
+# ****************************************************************************************
+# Common content models used by content-bearing elements
+# ****************************************************************************************
+very-basic-inlines =
+ character
+  | external-graphic
+  | instream-foreign-object
+  | inline-container
+  | leader
+  | page-number
+  | page-number-citation
+  | multi-toggle #MEMO: To be strict, we have to control that this element is a descendant of an fo:multi-case.
+  | page-index
+  | begin-index-range
+  | end-index-range
+
+#NOTE: An absolute-container can be treated both as block and as outline.
+basic-blocks =
+  block | block-container | table-and-caption | table | list-block
+
+#NOTE: Unlike other out-of-lines fo:footnote can be used only in the context where inlines are permitted
+out-of-lines-block = before-float | side-float | absolute-container 
+out-of-lines = footnote | out-of-lines-block
+
+# As a compromise for intricated inline content model prescribed by XSL FO spec
+# we define two types of inline content:
+# first as restrictive as required by spec for descendants of an fo:leader or of an fo:inline
+# child of an fo:footnote (and for some other cases where we believe it is reasonable),
+# it permits inline level elements only, except for descendants of fo:inline-container;
+# second as loose as prescribed by spec for the general cases
+basic-inlines-inline = very-basic-inlines  | basic-link-inline | inline-inline |  bidi-override-inline
+basic-inlines = very-basic-inlines  | basic-link | inline |  bidi-override
+
+# We have three content models for wrappers:
+# first one allows inline content only (based on basic-inlines-inline described above);
+# second one requires block-level elements to be at the top of it;
+# third one is for mixed content (general case);
+wrappers-inline =
+  multi-switch-inline | multi-properties-inline | wrapper-inline | retrieve-marker
+wrappers-block =
+  multi-switch-block | multi-properties-block | wrapper-block | retrieve-marker
+wrappers =
+  multi-switch | multi-properties | wrapper | retrieve-marker
+
+# We have two extended content models for inlines:
+# first one is stricter, with inline elements only (exception for fo:inline-container descendants)
+# and with no outlines (actually they are bared in main.rnc anyway);
+# second one is loose, with all possible inlines and outlines.
+# In general those content models corresponds very well with two possible contexts:
+# block context and inline context
+inlines-inline = text | basic-inlines-inline | wrappers-inline
+inlines = text | basic-inlines | out-of-lines | wrappers
+
+# Content model for blocks including  block-level outlines
+blocks = basic-blocks | wrappers-block | out-of-lines-block
+# Mixed content model - broadest one
+mix = inlines | basic-blocks
+
+# ****************************************************************************************
+# Element structure for content-bearing elements
+# ****************************************************************************************
+# ===============================================================
+# Block is the base element for all content areas. 
+# ===============================================================
+block =
+  element fo:block {
+    block.attlist, block.content
+  }
+block.content = marker*, ( initial-property-set | mix )*
+
+# ===============================================================
+# Block container
+# ===============================================================
+#MEMO: We are forced to create separate element 'absolute-container' in order 
+# to satisfy XSL FO spec requirements. Note that this is the *only* place where 
+# properties really interfer with element-level structure (well, actually fo:float is the second place). 
+# A separate fo:absolute-container is clearly necessary.
+# Absolutely possitioned block-container cannot contain markers and and outlines.
+# It's behaviour is quite similar to the outline elements such as float.
+# 'Folint' do not control absolutely positioned container restriction 
+# (due to expressions that can result in absolute position)
+# 'Folint' also permits  empty block-containers, that is against the spec.
+# Spec defines fo:block-container content as (%block;)+
+
+absolute-container = notAllowed
+absolute-container-real = 
+  element fo:block-container { absolute-container.attlist, absolute-container.content }
+absolute-container.content = blocks+
+
+block-container =
+  element fo:block-container { block-container.attlist, block-container.content }
+block-container.content = marker*, blocks+
+
+# ****************************************************************************************
+# Inline elements
+# ****************************************************************************************
+# ===============================================================
+# Unicode bidi-override
+# ===============================================================
+#MEMO: According to spec this element CAN have block level children except for the cases listed below:
+# XSL> An fo:bidi-override that is a descendant of an fo:leader or of an fo:inline child 
+# XSL> of an fo:footnote may not have block-level children, unless it has a nearer ancestor
+# XSL> that is an fo:inline-container.
+# NOTE: This is contradictory to the description of fo:leader element (6.6.9. fo:leader) that 
+# prohibits (some) block-level elements/outlines to be fo:leader descendants
+# no matter if they wrapped in any fo:inline-containers and  fo:bidi-override.
+# We have two models:
+# first (restrictive) used by descendants of an fo:title, fo:leader or of an fo:inline child of an fo:footnote;
+# second (loose) as prescribed by spec for the general cases
+# 'Folint' believes that no block level elements should be allowed in this element in either way. 
+bidi-override-inline =
+  element fo:bidi-override { bidi-override.attlist, bidi-override-inline.content }
+bidi-override-inline.content = marker*, inlines-inline*
+
+bidi-override =
+  element fo:bidi-override { bidi-override.attlist, bidi-override.content }
+bidi-override.content = marker*, mix*
+
+# ===============================================================
+# Single character
+# ===============================================================
+character = element fo:character { character.attlist, empty }
+
+# ===============================================================
+# Initial property set specifies properties for one or more lines
+# ===============================================================
+initial-property-set =
+  element fo:initial-property-set {
+    initial-property-set.attlist, empty 
+  }
+
+# ===============================================================
+# External graphic
+# ===============================================================
+external-graphic =
+  element fo:external-graphic { external-graphic.attlist, empty }
+
+# ===============================================================
+# In-stream graphic
+# ===============================================================
+instream-foreign-object =
+  element fo:instream-foreign-object {
+    instream-foreign-object.attlist, any
+  }
+
+# ===============================================================
+# Inline
+# ===============================================================
+#MEMO: This element used by content model that consists of inlines only
+# with exception for descendants of inline-container
+inline-inline = element fo:inline { inline.attlist, inline-inline.content }
+inline-inline.content = marker*, inlines-inline*
+
+inline = element fo:inline { inline.attlist, inline.content }
+inline.content = marker*, mix*
+
+# XSL> An fo:inline that is a child of an fo:footnote may not have block-level children.
+# XSL> An fo:inline that is a descendant of an fo:leader or of the fo:inline child of 
+# XSL> an fo:footnote may not have block-level children, unless it has a nearer 
+# XSL> ancestor that is an fo:inline-container.
+#NOTE: This definition is contradictory to the one of the fo:leader since latter prohibits
+# fo:inline-container as a descendant. But it's the definition of fo:leader that should be fixed
+# since content model described above is the only sane content model in the inline context.
+# It should be the same for fo:bidi-override. However definition must  be adjasted 
+# in order to mention fo:title since this element is a typical inline. 
+#
+# 'Folint' believes that block elements are allowed here and thoroughly tests for  
+# all those tricky exceptions. This behavior seems to be quite inconsisten with the 
+# one regarding fo:bidi-override treatment.
+
+# ===============================================================
+# Inline container
+# ===============================================================
+inline-container =
+  element fo:inline-container { inline-container.attlist, inline-container.content }
+inline-container.content = marker*, blocks*
+
+# ===============================================================
+# Leader
+# ===============================================================
+leader = element fo:leader { leader.attlist, leader.content }
+leader.content = inlines-inline*
+#MEMO: Following two lines used together with tricky redefinition in main.rnc 
+# in order to prevent fo:leader nesting.
+#leader.content = notAllowed
+#leader.content-real = inlines-inline*
+
+#MEMO: We use inline content model here which is consistent with 
+# such elements as fo:inline child of fo:footnote. It allows blocks/outlines, but only as a 
+# descendant of  inline-container. XSL FO spec is quite uneven at this point (and should be fixed).
+# According to spec, this element can contain inline level elements and text, but
+# XSL> The content must not contain an fo:leader, fo:inline-container, fo:block-container,
+# XSL> fo:float, fo:footnote, or fo:marker either as a direct child or as a descendant.
+# NOTE: XSL FO spec DO NOT prohibit blocks or tables as descendants of fo:leader!
+# NOTE: fo:leader constraints are contradictory to those of fo:inline since section "6.6.7. fo:inline" 
+# states implicitly that there could be an fo:inline-container that is a descendent of fo:leader.
+#
+# 'Folint' respects these constraints partially: it prohibits fo:block-container as a descendant,
+# but permits fo:marker, fo:leader, fo:inline-container, fo:float, fo:footnote.
+# It also prohibits use of fo:block as descendant.
+
+# ===============================================================
+# Page Number
+# ===============================================================
+page-number = element fo:page-number { page-number.attlist, empty }
+
+# ===============================================================
+# Page number citation
+# ===============================================================
+page-number-citation =
+  element fo:page-number-citation {
+    page-number-citation.attlist, empty 
+  }
+
+# ===============================================================
+# Atomic elements for index ranges markup
+# ===============================================================
+begin-index-range =
+  element rx:begin-index-range { begin-index-range.attlist, empty }
+
+end-index-range =
+  element rx:end-index-range { end-index-range.attlist, empty }
+
+# ===============================================================
+# Page number list - index entry
+# ===============================================================
+page-index = element rx:page-index { page-index.attlist,  page-index.content }
+#MEMO: Currently page-index must contain at least one rx:index-item element, 
+# empty content is allowed for backward compatibility.
+page-index.content = index-item*
+
+index-item = element rx:index-item { index-item.attlist, empty }
+
+# ****************************************************************************************
+# Formatting objects for tables.
+# ****************************************************************************************
+
+# ===============================================================
+# Table & Caption is a wrapper to all the stuff pertinent to a
+# given table. It generates a block consisting of two subblocks:
+# one for the caption, another one for the table itself. The
+# placement of these two blocks is controlled by the
+# 'caption-side' property: if  caption-side="before"|"after" (or
+# their absolute orientation equivalents), the two blocks are
+# drawn one after another; if it is "start"|"end", then the
+# caption is displayed on the correspondent side of the table.
+# In this case, the relative alignment of the two blocks is given
+# by the 'relative-align'/'display-align' property.
+#
+# ===============================================================
+table-and-caption =
+  element fo:table-and-caption {
+    table-and-caption.attlist, 
+    table-and-caption.content
+  }
+table-and-caption.content = marker*, table-caption?, table
+
+# ===============================================================
+# Table caption is an area container.
+# ===============================================================
+table-caption =
+  element fo:table-caption { table-caption.attlist, table-caption.content }
+table-caption.content = marker*, blocks+ 
+
+# ===============================================================
+# fo:table is the basic element for all tables. All the contents
+# placed inside it is distributed over a single rectangular grid
+# of rows and columns.
+# ===============================================================
+table =
+  element fo:table {
+    table.attlist,
+    table.content
+  }
+table.content =
+    marker*,
+    table-column*,
+    table-header?,
+    table-footer?,
+    table-body+
+
+# ===============================================================
+# Table column specifies common properties to ascribe to all
+# cells in a column *or a group of columns*. Note that, if both
+# 'number-columns-repeated' and 'number-columns-spanned' exceed
+# 1, the column counter is increased by 'number-columns-spanned'.
+# it means that you only set properties for columns:
+# 'column-number'
+# 'column-number' + 'number-columns-spanned'
+# 'column-number' + 2 * 'number-columns-spanned'
+# and so on, leaving default properties for intermediate columns.
+# ===============================================================
+table-column = element fo:table-column { table-column.attlist, empty }
+
+# ===============================================================
+# Table header, table footer, and table body are wrappers for
+# groups of rows. They contain either one or more fo:table-rows,
+# or one or more fo:table-cells; in the latter case, row breaks
+# are specified in the cells by 'starts-row'/'ends-row'.
+# All these elements are identical both in the content structure
+# and in the attributes.
+# ===============================================================
+row-group = marker*, (table-row+ | table-cell+)
+table-header =
+  element fo:table-header { table-header.attlist, table-header.content }
+table-header.content = row-group
+
+table-footer =
+  element fo:table-footer { table-footer.attlist, table-footer.content }
+table-footer.content = row-group
+
+table-body = element fo:table-body { table-body.attlist, table-body.content }
+table-body.content = row-group
+
+# ===============================================================
+# Table row.
+# ===============================================================
+table-row = element fo:table-row { table-row.attlist, table-row.content }
+table-row.content = table-cell+
+#MEMO: We are more strict here, so this note is about 'Folint': 
+# 'Folint' permits  empty fo:table-row, that is against the spec.
+# XSL FO spec defines  fo:table-row content as (table-cell+)
+
+# ===============================================================
+# Table cell.
+# ===============================================================
+table-cell = element fo:table-cell { table-cell.attlist, table-cell.content }
+table-cell.content = marker*, blocks+
+#MEMO: We are more strict here, so this note is about 'Folint':
+# 'Folint' permits empty table-cells that is against the spec. Spec defines fo:table-cell
+# content as (%block;)+
+# Note that 'Folint' is quite consistent regarding this matter - it simillary allows empty 
+# block-containers and table-rows
+
+# ****************************************************************************************
+# Formatting objects for lists.
+# ****************************************************************************************
+# ===============================================================
+# List block is a block, with some extra features to control the
+# disposition of list items.
+# ===============================================================
+list-block = element fo:list-block { list-block.attlist, list-block.content }
+list-block.content = marker*, list-item+ 
+
+# ===============================================================
+# List item is a coupling of item label and item body.
+# ===============================================================
+list-item =
+  element fo:list-item {
+    list-item.attlist, 
+    list-item.content
+  }
+list-item.content = marker*, list-item-label, list-item-body
+
+# ===============================================================
+# List item label and list item body
+# ===============================================================
+list-item-label =
+  element fo:list-item-label { list-item-label.attlist, list-item-label.content }
+list-item-label.content = marker*, blocks+
+
+list-item-body =
+  element fo:list-item-body { list-item-body.attlist, list-item-body.content }
+list-item-body.content = marker*, blocks+
+#MEMO: We are more strict here, so this note is about 'Folint':
+# 'Folint' permits  empty fo:list-item-label/body, that is clearly the spec.
+# Spec defines  fo:list-item-label/body content as (%block;)+
+
+#****************************************************************************************
+# Out-of-lines.
+#****************************************************************************************
+# ===============================================================
+# Floats and footnotes resemble containers. Accordingly, we treat
+# them as block sequences.
+# ===============================================================
+#MEMO: We do not allows absolutely positioned container as an outline descendant.
+# 'Folint' is loose here - it do not check this condition.
+#MEMO: We are forced to create two types of floats: side-floats and before-floats
+# because they have different restrictions (side-floats can appear in static content, 
+# before-floats can't bear 'clear' property)
+# NOTE: 'Folint' does not allows any floats inside absolutely positioned containers too.
+side-float = notAllowed
+side-float-real = element fo:float { side-float.attlist, float.content }
+before-float = notAllowed
+before-float-real = element fo:float { before-float.attlist, float.content }
+float.content = blocks+
+
+# XSL> It is an error if the fo:footnote occurs as a descendant of a flow that is not assigned
+# XSL> to a region-body, or of an fo:block-container that generates absolutely positioned areas.
+footnote = notAllowed
+footnote-real =
+  element fo:footnote { footnote.attlist, footnote.content }
+# XSL> An fo:inline that is a child of an fo:footnote may not have block-level children.
+# XSL> An fo:inline that is a descendant of an fo:leader or of the fo:inline child of 
+# XSL> an fo:footnote may not have block-level children, unless it has a nearer 
+# XSL> ancestor that is an fo:inline-container.
+# We do check here that first inline have no block-level children/descendants unlless 
+# they are wrapped into an inline-container.
+# 'Folint' does the same.
+footnote.content = inline-inline, footnote-body 
+
+footnote-body =
+  element fo:footnote-body { footnote-body.attlist, footnote-body.content }
+footnote-body.content =  blocks+
+
+# ===============================================================
+# Simple link. From the formatting point of view, it's nothing
+# but a regular inline sequence.
+# ===============================================================
+# This elment is for separate 'inline' content model
+basic-link-inline = element fo:basic-link { basic-link.attlist, basic-link-inline.content }
+basic-link-inline.content = marker*, inlines-inline*
+
+basic-link = element fo:basic-link { basic-link.attlist, basic-link.content }
+basic-link.content = marker*, mix*
+
+# ****************************************************************************************
+# Wrappers and Markers.
+# ****************************************************************************************
+# ===============================================================
+# Wrapper. This may be useful but it seriously complicates validation of
+# content models for blocks and inlines.
+# ===============================================================
+#There are 3 different kind of wrappers for different contexts
+wrapper-inline = element fo:wrapper { wrapper.attlist, wrapper-inline.content }
+wrapper-inline.content = marker*, inlines-inline*
+
+wrapper-block = element fo:wrapper { wrapper.attlist, wrapper-block.content }
+wrapper-block.content = marker*, blocks*
+
+wrapper = element fo:wrapper { wrapper.attlist, wrapper.content }
+wrapper.content = marker*, mix*
+
+# ===============================================================
+# Marker.
+# ===============================================================
+marker = notAllowed
+marker-real = element fo:marker { marker.attlist, marker.content }
+marker.content = mix*
+
+# ===============================================================
+# Marker retrieval.
+# We are more strict here making retrieve-class-name attribute a mandatory, 
+# but marker with no retrieve-class-name is meaningless.
+# ===============================================================
+retrieve-marker = notAllowed
+retrieve-marker-real = element fo:retrieve-marker { retrieve-marker.attlist, empty }
+
+# ****************************************************************************************
+# Multistate stuff.
+# All those elements are practically  unused and XSL content model invloved is 
+# intricated. Therefor validation is not absolutely strict here.
+# ****************************************************************************************
+# ===============================================================
+# Switch. This is a pure logical operator; no formatting may be
+# conveyed through it.
+# ===============================================================
+#Thera are 3 different kind of multi-switch (because there are 3 kinds of multi-case)
+multi-switch-inline =
+  element fo:multi-switch { multi-switch.attlist, multi-switch-inline.content }
+multi-switch-inline.content = multi-case-inline+
+
+multi-switch-block =
+  element fo:multi-switch { multi-switch.attlist, multi-switch-block.content }
+multi-switch-block.content = multi-case-block+
+
+multi-switch =
+  element fo:multi-switch { multi-switch.attlist, multi-switch.content }
+multi-switch.content = multi-case+
+
+# ===============================================================
+# Single case. Block-level formatting may be conveyed.
+# ===============================================================
+#Thera are 3 different kind of multi-case (similar to fo:wrapper)
+multi-case-inline = element fo:multi-case { multi-case.attlist, multi-case-inline.content }
+multi-case-inline.content = inlines-inline*
+
+multi-case-block = element fo:multi-case { multi-case.attlist, multi-case-block.content }
+multi-case-block.content = blocks*
+
+multi-case = element fo:multi-case { multi-case.attlist, multi-case.content }
+multi-case.content = mix*
+
+# ===============================================================
+# Toggle. This is a typical inline.
+# ===============================================================
+#MEMO: This element is only permitted as a descendant of an fo:multi-case.
+multi-toggle =
+  element fo:multi-toggle { multi-toggle.attlist, multi-toggle.content }
+multi-toggle.content = mix*
+
+# ===============================================================
+# Multi-properties.
+# ===============================================================
+#Thera are 3 different kind of multi-properties (similar to fo:wrapper)
+multi-properties-inline =
+  element fo:multi-properties {
+    multi-properties.attlist, multi-properties-inline.content
+  }
+multi-properties-inline.content = multi-property-set+, wrapper-inline 
+
+multi-properties-block =
+  element fo:multi-properties {
+    multi-properties.attlist, multi-properties-block.content
+  }
+multi-properties-block.content = multi-property-set+, wrapper-block 
+
+multi-properties =
+  element fo:multi-properties {
+    multi-properties.attlist, multi-properties.content
+  }
+multi-properties.content = multi-property-set+, wrapper 
+
+# ===============================================================
+# Multi property set.
+# ===============================================================
+multi-property-set =
+  element fo:multi-property-set { multi-property-set.attlist, empty }
+
+# ===============================================================
+# "Match anything" definition, used by fo:instream-foreign-object
+# ===============================================================
+#MEMO: Should we exclude elements which belongs to fo: namespace?
+any =
+  (element * {
+     attribute * { text }*,
+     any
+   }
+   | text)*
diff --git a/xml/relaxng/testData/highlighting/rnc/fo/fo-test.xml b/xml/relaxng/testData/highlighting/rnc/fo/fo-test.xml
new file mode 100644
index 0000000..1158c1f
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/fo/fo-test.xml
@@ -0,0 +1,34 @@
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+  <fo:layout-master-set>
+    <fo:simple-page-master
+        margin-top="60pt"
+        margin-bottom="18pt"
+        margin-left="1cm"
+        margin-right="1cm"
+        page-width="297mm"
+        page-height="210mm"
+        master-name="first">
+
+      <fo:region-body margin-bottom="24pt"/>
+      <fo:region-after extent="24pt"/>
+    </fo:simple-page-master>
+
+  </fo:layout-master-set>
+
+  <fo:page-sequence master-reference="first" font-family="Courier" font-size="8pt" line-height="12pt">
+
+    <fo:static-content flow-name="xsl-region-after">
+      <fo:block text-align="left" space-before="12pt">
+        Report
+      </fo:block>
+    </fo:static-content>
+
+    <fo:flow flow-name="xsl-region-body">
+
+      <fo:block font-weight="bold" space-after="12pt">
+        <fo:inline>eCS Nachrichtenauswertung</fo:inline>
+      </fo:block>
+    </fo:flow>
+  </fo:page-sequence>
+</fo:root>
diff --git a/xml/relaxng/testData/highlighting/rnc/fo/main.rnc b/xml/relaxng/testData/highlighting/rnc/fo/main.rnc
new file mode 100644
index 0000000..2232854
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/fo/main.rnc
@@ -0,0 +1,239 @@
+# =========================================================
+#                                                          
+# (c) 2004, RenderX                                        
+#                                                          
+# Author: Alexander Peshkov <[email protected]>          
+#                                                          
+# Permission is granted to use this document, copy and     
+# modify free of charge, provided that every derived work  
+# bear a reference to the present document.                
+#                                                          
+# This document contains a computer program written in     
+# XSL Transformations Language. It is published with no    
+# warranty of any kind about its usability, as a mere      
+# example of XSL technology. RenderX shall not be          
+# considered liable for any damage or loss of data caused  
+# by use of this program.                                  
+#                                                          
+# =========================================================
+
+namespace local = ""
+default namespace fo = "http://www.w3.org/1999/XSL/Format"
+namespace rx = "http://www.renderx.com/XSL/Extensions"
+
+include "elements.rnc"
+
+start = root
+
+# ****************************************************************************************
+# Element structure for top-level elements
+# ****************************************************************************************
+# ===============================================================
+# Root element. Contains everything, generates nothing. It has an
+# id, a FO namespace prefix declaration, and other namespace
+# declarations if used.
+# ===============================================================
+root = element fo:root { root.attlist, root.content }
+root.content = 
+  meta-info?,
+  layout-master-set,
+  declarations?,
+  outline?,
+  page-sequence+
+
+# ===============================================================
+# Document meta information - RenderX extension
+# ===============================================================
+meta-info = element rx:meta-info { meta-info.attlist, meta-info.content }
+meta-info.content = meta-field+ 
+
+meta-field = element rx:meta-field { meta-field.attlist, empty }
+
+# ===============================================================
+# Color profile declarations
+# ===============================================================
+declarations = element fo:declarations { declarations.attlist, declarations.content }
+declarations.content = color-profile+ 
+
+color-profile = element fo:color-profile { color-profile.attlist, empty }
+
+# ===============================================================
+# Bookmarks - RenderX extension
+# ===============================================================
+outline = element rx:outline { outline.attlist, outline.content }
+outline.content = bookmark+
+
+bookmark = element rx:bookmark { bookmark.attlist, bookmark.content }
+bookmark.content = bookmark-label, bookmark*
+
+bookmark-label = element rx:bookmark-label { bookmark-label.attlist, bookmark-label.content }
+bookmark-label.content = text
+
+# ===============================================================
+# Layout-master-set. Contains a set of page-masters.
+# Content model made more strict than in the spec, to enforce
+# that a page-sequence-master be always accompanied by at least
+# one simple-page-master.
+# ===============================================================
+layout-master-set = element fo:layout-master-set { layout-master-set.attlist, layout-master-set.content }
+layout-master-set.content = page-sequence-master* & simple-page-master+
+
+# ===============================================================
+# Page sequence master
+# ===============================================================
+page-sequence-master = 
+  element fo:page-sequence-master { 
+    page-sequence-master.attlist, page-sequence-master.content
+  }
+page-sequence-master.content = 
+  (single-page-master-reference
+   | repeatable-page-master-reference
+   | repeatable-page-master-alternatives)+
+
+# ===============================================================
+# Sequence specifiers are predefined sequences of page masters
+# that are used by page sequence master to construct a desired
+# page collection.
+# ===============================================================
+single-page-master-reference = 
+  element fo:single-page-master-reference {
+    single-page-master-reference.attlist, empty
+  }
+
+repeatable-page-master-reference = 
+  element fo:repeatable-page-master-reference {
+    repeatable-page-master-reference.attlist, empty
+  }
+
+repeatable-page-master-alternatives = 
+  element fo:repeatable-page-master-alternatives {
+    repeatable-page-master-alternatives.attlist, repeatable-page-master-alternatives.content
+  }
+repeatable-page-master-alternatives.content = conditional-page-master-reference+
+
+conditional-page-master-reference = 
+  element fo:conditional-page-master-reference {
+    conditional-page-master-reference.attlist, empty
+  }
+
+# ===============================================================
+# Simple page master defines a page layout. It does not
+# explicitly generate any content.
+# ===============================================================
+simple-page-master =
+  element fo:simple-page-master {
+    simple-page-master.attlist,
+    simple-page-master.content
+  }
+simple-page-master.content =
+    region-body,
+    region-before?,
+    region-after?,
+    region-start?,
+    region-end?
+
+# ===============================================================
+# Regions. The page instance is divided into subareas, whose
+# properties are described by the five region-* elements. These
+# elements by themselves do not generate any content.
+# ===============================================================
+
+# ===============================================================
+# Body region: middle of the page.
+# ===============================================================
+region-body = element fo:region-body { region-body.attlist, empty }
+
+# ===============================================================
+# Side regions: page edges.
+# ===============================================================
+
+region-before = element fo:region-before { region-before.attlist, empty }
+region-after = element fo:region-after { region-after.attlist, empty }
+region-start = element fo:region-start { region-start.attlist, empty }
+region-end = element fo:region-end { region-end.attlist, empty }
+
+# ===============================================================
+# Page sequence defines the order of choosing page masters to
+# accomodate all the contents generated by its fo:flow and
+# fo:static-content children, and the way of numbering them.
+# ===============================================================
+page-sequence = element fo:page-sequence { page-sequence.attlist, page-sequence.content }
+page-sequence.content = title?, static-content*, flow
+
+# ===============================================================
+# Title. May not contain out-of-lines.
+# ===============================================================
+#MEMO: Spec states:
+# XSL> Additionally, an fo:title is not permitted to have as a descendant an fo:block-container
+# XSL> that generates an absolutely positioned area.
+# We prohibit block-level descendants except for those descendats of fo:inline-container.
+# This content model shared by fo:leader and fo:inline child of an fo:footnote.
+title = element fo:title { title.attlist, title.content }
+title.content = inlines-inline*
+
+# ===============================================================
+# Flows. They are just sequences of blocks. 'flow-name' feature
+# defines linkage of the flow to a region in the page master.
+# ===============================================================
+# ===============================================================
+# An extension element, rx:flow-section, has been added in order
+# to overcome limitations on multicolumn layout imposed by XSL FO
+# ===============================================================
+#NOTE: We use tricks with nested grammar in order control marker/retrieve-marker 
+#and outlines  appearance inside fo:static-content and fo:flow
+#MEMO: We forcedly prohibit side-floats as descendants of ablsoutely positioned
+# block-containers. This problem appears due to the 'half-outline' behavior of
+# an absolute-container - it cannot contain outlines except for side-float and it cannot
+# be nested into any other outlines.
+#NOTE: 'Folint' prohibits use of side-floats in static-content that is against the spec.
+static-content = element fo:static-content { static-content.attlist, static-content.content }
+static-content.content = grammar {
+  start = blocks+
+  include "elements.rnc" {
+    retrieve-marker =  retrieve-marker-real
+    absolute-container = absolute-container-real
+    absolute-container.content = parent absolute-container.content
+    side-float = side-float-real
+    float.content = parent float.content
+    leader.content = parent leader.content
+  }
+}
+
+flow = element fo:flow { flow.attlist, flow.content }
+flow.content = grammar {
+  start =marker*, (blocks | flow-section)+
+  include "elements.rnc" {
+    absolute-container = absolute-container-real
+    #MEMO: We have two options here:
+    # * use parent content model which is too strict (side-floats descendants not allowed);
+    # * use current content model which is too loose (all outline descendants are allowed).
+    # We prefer stricter mode.
+    absolute-container.content = parent absolute-container.content
+    marker = marker-real
+    marker.content = parent marker.content
+    side-float = side-float-real
+    before-float = before-float-real
+    float.content = parent float.content
+    footnote = footnote-real
+    footnote.content = parent footnote.content
+    #NOTE: fo:leader can't have outlines and marker descendants
+    leader.content = parent leader.content
+  }
+  # Extension element. Acts like a top-level block with multiple columns.
+  flow-section = element rx:flow-section { flow-section.attlist, flow-section.content }
+  flow-section.content = blocks+
+}  
+
+#MEMO: Spec prohibits use of fo:leader as a descendant of itself.
+# We find this constraint somewhat abusive so we do not enforce it.
+# 'Folint' also does not controll this constraint
+# However following trick can be used to prevent fo:leader to appear as it's own child.
+# (to make it work we have to set leader.content to be notAllowed and move
+# actual content into leader.content-real in elements.rnc)
+#leader.content |= grammar {
+# start = leader.content-real
+#  include "elements.rnc" {
+#    leader = notAllowed 
+#  }
+#}
+
diff --git a/xml/relaxng/testData/highlighting/rnc/fo/mybook.fo b/xml/relaxng/testData/highlighting/rnc/fo/mybook.fo
new file mode 100644
index 0000000..6d40b18
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/fo/mybook.fo
@@ -0,0 +1,2627 @@
+<?xml version="1.0"?>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="serif,Symbol,ZapfDingbats" font-size="10"
+         text-align="justify" line-height="normal" font-selection-strategy="character-by-character"
+         line-height-shift-adjustment="disregard-shifts" language="en">
+  <fo:layout-master-set>
+    <fo:simple-page-master master-name="blank" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body display-align="center" margin-bottom="1.0cm" margin-top="2.0cm" />
+      <fo:region-before region-name="xsl-region-before-blank" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-blank" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="titlepage-first" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-first" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-first" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="titlepage-odd" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-odd" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-odd" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="titlepage-even" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-even" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-even" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="lot-first" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-first" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-first" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="lot-odd" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-odd" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-odd" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="lot-even" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-even" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-even" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="front-first" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-first" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-first" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="front-odd" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-odd" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-odd" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="front-even" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-even" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-even" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="body-first" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-first" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-first" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="body-odd" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-odd" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-odd" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="body-even" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-even" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-even" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="back-first" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-first" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-first" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="back-odd" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-odd" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-odd" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="back-even" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm - 0pt" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="1" />
+      <fo:region-before region-name="xsl-region-before-even" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-even" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="index-first" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="2" />
+      <fo:region-before region-name="xsl-region-before-first" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-first" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="index-odd" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="2" />
+      <fo:region-before region-name="xsl-region-before-odd" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-odd" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="index-even" page-width="210mm" page-height="297mm" margin-top="0.5cm"
+                           margin-bottom="0.5cm" margin-left="1.5cm" margin-right="1.5cm">
+      <fo:region-body margin-bottom="1.0cm" margin-top="2.0cm" column-gap="12pt" column-count="2" />
+      <fo:region-before region-name="xsl-region-before-even" extent="2.0cm" display-align="before" />
+      <fo:region-after region-name="xsl-region-after-even" extent="1.5cm" display-align="after" />
+    </fo:simple-page-master>
+    <fo:page-sequence-master master-name="titlepage">
+      <fo:repeatable-page-master-alternatives>
+        <fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank" />
+        <fo:conditional-page-master-reference master-reference="titlepage-first" page-position="first" />
+        <fo:conditional-page-master-reference master-reference="titlepage-odd" odd-or-even="odd" />
+        <fo:conditional-page-master-reference odd-or-even="even" master-reference="titlepage-even" />
+      </fo:repeatable-page-master-alternatives>
+    </fo:page-sequence-master>
+    <fo:page-sequence-master master-name="lot">
+      <fo:repeatable-page-master-alternatives>
+        <fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank" />
+        <fo:conditional-page-master-reference master-reference="lot-first" page-position="first" />
+        <fo:conditional-page-master-reference master-reference="lot-odd" odd-or-even="odd" />
+        <fo:conditional-page-master-reference odd-or-even="even" master-reference="lot-even" />
+      </fo:repeatable-page-master-alternatives>
+    </fo:page-sequence-master>
+    <fo:page-sequence-master master-name="front">
+      <fo:repeatable-page-master-alternatives>
+        <fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank" />
+        <fo:conditional-page-master-reference master-reference="front-first" page-position="first" />
+        <fo:conditional-page-master-reference master-reference="front-odd" odd-or-even="odd" />
+        <fo:conditional-page-master-reference odd-or-even="even" master-reference="front-even" />
+      </fo:repeatable-page-master-alternatives>
+    </fo:page-sequence-master>
+    <fo:page-sequence-master master-name="body">
+      <fo:repeatable-page-master-alternatives>
+        <fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank" />
+        <fo:conditional-page-master-reference master-reference="body-first" page-position="first" />
+        <fo:conditional-page-master-reference master-reference="body-odd" odd-or-even="odd" />
+        <fo:conditional-page-master-reference odd-or-even="even" master-reference="body-even" />
+      </fo:repeatable-page-master-alternatives>
+    </fo:page-sequence-master>
+    <fo:page-sequence-master master-name="back">
+      <fo:repeatable-page-master-alternatives>
+        <fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank" />
+        <fo:conditional-page-master-reference master-reference="back-first" page-position="first" />
+        <fo:conditional-page-master-reference master-reference="back-odd" odd-or-even="odd" />
+        <fo:conditional-page-master-reference odd-or-even="even" master-reference="back-even" />
+      </fo:repeatable-page-master-alternatives>
+    </fo:page-sequence-master>
+    <fo:page-sequence-master master-name="index">
+      <fo:repeatable-page-master-alternatives>
+        <fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank" />
+        <fo:conditional-page-master-reference master-reference="index-first" page-position="first" />
+        <fo:conditional-page-master-reference master-reference="index-odd" odd-or-even="odd" />
+        <fo:conditional-page-master-reference odd-or-even="even" master-reference="index-even" />
+      </fo:repeatable-page-master-alternatives>
+    </fo:page-sequence-master>
+  </fo:layout-master-set>
+  <rx:outline xmlns:rx="http://www.renderx.com/XSL/Extensions">
+    <rx:bookmark internal-destination="id2594914">
+      <rx:bookmark-label>Lorem Ipsum</rx:bookmark-label>
+    </rx:bookmark>
+    <rx:bookmark internal-destination="toc...id2594914">
+      <rx:bookmark-label>Table of Contents</rx:bookmark-label>
+    </rx:bookmark>
+    <rx:bookmark internal-destination="lorem">
+      <rx:bookmark-label>Chapter&#xA0;1.&#xA0;Lorem Ipsum</rx:bookmark-label>
+      <rx:bookmark internal-destination="consectetuer">
+        <rx:bookmark-label>Consectetuer adipiscing elit</rx:bookmark-label>
+        <rx:bookmark internal-destination="morbi">
+          <rx:bookmark-label>Morbi a eros</rx:bookmark-label>
+          <rx:bookmark internal-destination="nullam">
+            <rx:bookmark-label>Nullam dapibus</rx:bookmark-label>
+          </rx:bookmark>
+        </rx:bookmark>
+        <rx:bookmark internal-destination="vestibulum">
+          <rx:bookmark-label>Vestibulum ante</rx:bookmark-label>
+        </rx:bookmark>
+      </rx:bookmark>
+      <rx:bookmark internal-destination="donec">
+        <rx:bookmark-label>Donec eleifend</rx:bookmark-label>
+      </rx:bookmark>
+      <rx:bookmark internal-destination="pellentesque">
+        <rx:bookmark-label>Pellentesque augue</rx:bookmark-label>
+      </rx:bookmark>
+    </rx:bookmark>
+    <rx:bookmark internal-destination="duis">
+      <rx:bookmark-label>Chapter&#xA0;2.&#xA0;Duis egestas condimentum</rx:bookmark-label>
+      <rx:bookmark internal-destination="x2_consectetuer">
+        <rx:bookmark-label>Maecenas at enim</rx:bookmark-label>
+        <rx:bookmark internal-destination="x2_morbi">
+          <rx:bookmark-label>Curabitur nulla orci</rx:bookmark-label>
+          <rx:bookmark internal-destination="x2_nullam">
+            <rx:bookmark-label>Maecenas bibendum</rx:bookmark-label>
+          </rx:bookmark>
+        </rx:bookmark>
+        <rx:bookmark internal-destination="x2_vestibulum">
+          <rx:bookmark-label>faucibus orci</rx:bookmark-label>
+        </rx:bookmark>
+      </rx:bookmark>
+      <rx:bookmark internal-destination="x2_donec">
+        <rx:bookmark-label>Maecenas scelerisque</rx:bookmark-label>
+      </rx:bookmark>
+      <rx:bookmark internal-destination="x2_pellentesque">
+        <rx:bookmark-label>Dignissim urna</rx:bookmark-label>
+      </rx:bookmark>
+    </rx:bookmark>
+    <rx:bookmark internal-destination="index">
+      <rx:bookmark-label>Index</rx:bookmark-label>
+    </rx:bookmark>
+  </rx:outline>
+  <fo:page-sequence hyphenate="false" master-reference="titlepage" language="en" format="1" initial-page-number="1"
+                    force-page-count="end-on-even" hyphenation-character="-" hyphenation-push-character-count="2"
+                    hyphenation-remain-character-count="2">
+    <fo:static-content flow-name="xsl-region-before-first">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt" />
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-odd">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-even">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-blank">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-footnote-separator">
+      <fo:block>
+        <fo:leader color="black" leader-pattern="rule" leader-length="1in" />
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-first">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt" />
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-odd">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-even">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-blank">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:flow flow-name="xsl-region-body">
+      <fo:block id="id2594914">
+        <fo:block>
+          <fo:block>
+            <fo:block font-family="sans-serif,Symbol,ZapfDingbats" font-weight="bold" font-size="24.8832pt"
+                      text-align="center" space-before="18.6624pt">
+              <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                        keep-with-next.within-column="always" hyphenate="false">Lorem Ipsum
+              </fo:block>
+            </fo:block>
+            <fo:block font-family="sans-serif,Symbol,ZapfDingbats" font-weight="bold" font-size="20.736pt"
+                      text-align="center" space-before="15.552pt">Nulla scelerisque, nulla turpis
+            </fo:block>
+            <fo:block font-family="sans-serif,Symbol,ZapfDingbats" font-weight="bold" font-size="12pt"
+                      text-align="center" space-before="2in">
+              <fo:block>
+                <fo:block>Petri M&#xE4;kij&#xE4;rvi, European Synchrotron Radiation Facility</fo:block>
+                <fo:block>Dr. I. M. Noman, Acme Industries, Inc.</fo:block>
+                <fo:block>Maxwell Smart, C.O.N.T.R.O.L.</fo:block>
+              </fo:block>
+            </fo:block>
+          </fo:block>
+          <fo:block>
+            <fo:block break-after="page" />
+            <fo:block font-size="14.4pt" font-weight="bold" font-family="sans-serif,Symbol,ZapfDingbats">
+              <fo:block>Lorem Ipsum: Nulla scelerisque, nulla turpis</fo:block>
+            </fo:block>
+            <fo:block font-size="10pt">
+              <fo:block>by Petri M&#xE4;kij&#xE4;rvi, Dr. I. M. Noman, and Maxwell Smart</fo:block>
+            </fo:block>
+            <fo:block font-size="10pt" space-before="0.5em">$Revision: 1.1 $</fo:block>
+            <fo:block font-size="10pt" space-before="1em">
+              <fo:block>Published $Date: 2007/09/12 17:12:04 $</fo:block>
+            </fo:block>
+            <fo:block font-size="10pt">Copyright
+              <fo:inline font-family="serif">&#xA9;</fo:inline>
+              2007 European Synchrotron Radiation Facility
+            </fo:block>
+          </fo:block>
+          <fo:block break-after="page" />
+        </fo:block>
+      </fo:block>
+    </fo:flow>
+  </fo:page-sequence>
+  <fo:page-sequence hyphenate="false" master-reference="lot" language="en" format="i" initial-page-number="auto-odd"
+                    force-page-count="end-on-even" hyphenation-character="-" hyphenation-push-character-count="2"
+                    hyphenation-remain-character-count="2">
+    <fo:static-content flow-name="xsl-region-before-first">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-odd">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    Lorem Ipsum
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-even">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    Lorem Ipsum
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-blank">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-footnote-separator">
+      <fo:block>
+        <fo:leader color="black" leader-pattern="rule" leader-length="1in" />
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-first">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-odd">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-even">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-blank">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:flow flow-name="xsl-region-body" start-indent="4pc" end-indent="0pt">
+      <fo:block id="toc...id2594914" space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em"
+                space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em">
+        <fo:block>
+          <fo:block>
+            <fo:block space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em"
+                      space-after="0.5em" margin-left="0pt" start-indent="0pt" font-size="17.28pt" font-weight="bold"
+                      font-family="sans-serif,Symbol,ZapfDingbats">Table of Contents
+            </fo:block>
+          </fo:block>
+        </fo:block>
+        <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                  text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+          <fo:inline keep-with-next.within-line="always">
+            <fo:basic-link internal-destination="lorem">1. Lorem Ipsum</fo:basic-link>
+          </fo:inline>
+          <fo:inline keep-together.within-line="always">
+            <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                       keep-with-next.within-line="always" />
+            <fo:basic-link internal-destination="lorem">
+              <fo:page-number-citation ref-id="lorem" />
+            </fo:basic-link>
+          </fo:inline>
+        </fo:block>
+        <fo:block id="toc.id2594914.lorem" margin-left="24pt">
+          <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                    text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+            <fo:inline keep-with-next.within-line="always">
+              <fo:basic-link internal-destination="consectetuer">Consectetuer adipiscing elit</fo:basic-link>
+            </fo:inline>
+            <fo:inline keep-together.within-line="always">
+              <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                         keep-with-next.within-line="always" />
+              <fo:basic-link internal-destination="consectetuer">
+                <fo:page-number-citation ref-id="consectetuer" />
+              </fo:basic-link>
+            </fo:inline>
+          </fo:block>
+          <fo:block id="toc.id2594914.consectetuer" margin-left="24pt">
+            <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                      text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+              <fo:inline keep-with-next.within-line="always">
+                <fo:basic-link internal-destination="morbi">Morbi a eros</fo:basic-link>
+              </fo:inline>
+              <fo:inline keep-together.within-line="always">
+                <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                           keep-with-next.within-line="always" />
+                <fo:basic-link internal-destination="morbi">
+                  <fo:page-number-citation ref-id="morbi" />
+                </fo:basic-link>
+              </fo:inline>
+            </fo:block>
+            <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                      text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+              <fo:inline keep-with-next.within-line="always">
+                <fo:basic-link internal-destination="vestibulum">Vestibulum ante</fo:basic-link>
+              </fo:inline>
+              <fo:inline keep-together.within-line="always">
+                <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                           keep-with-next.within-line="always" />
+                <fo:basic-link internal-destination="vestibulum">
+                  <fo:page-number-citation ref-id="vestibulum" />
+                </fo:basic-link>
+              </fo:inline>
+            </fo:block>
+          </fo:block>
+          <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                    text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+            <fo:inline keep-with-next.within-line="always">
+              <fo:basic-link internal-destination="donec">Donec eleifend</fo:basic-link>
+            </fo:inline>
+            <fo:inline keep-together.within-line="always">
+              <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                         keep-with-next.within-line="always" />
+              <fo:basic-link internal-destination="donec">
+                <fo:page-number-citation ref-id="donec" />
+              </fo:basic-link>
+            </fo:inline>
+          </fo:block>
+          <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                    text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+            <fo:inline keep-with-next.within-line="always">
+              <fo:basic-link internal-destination="pellentesque">Pellentesque augue</fo:basic-link>
+            </fo:inline>
+            <fo:inline keep-together.within-line="always">
+              <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                         keep-with-next.within-line="always" />
+              <fo:basic-link internal-destination="pellentesque">
+                <fo:page-number-citation ref-id="pellentesque" />
+              </fo:basic-link>
+            </fo:inline>
+          </fo:block>
+        </fo:block>
+        <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                  text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+          <fo:inline keep-with-next.within-line="always">
+            <fo:basic-link internal-destination="duis">2. Duis egestas condimentum</fo:basic-link>
+          </fo:inline>
+          <fo:inline keep-together.within-line="always">
+            <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                       keep-with-next.within-line="always" />
+            <fo:basic-link internal-destination="duis">
+              <fo:page-number-citation ref-id="duis" />
+            </fo:basic-link>
+          </fo:inline>
+        </fo:block>
+        <fo:block id="toc.id2594914.duis" margin-left="24pt">
+          <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                    text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+            <fo:inline keep-with-next.within-line="always">
+              <fo:basic-link internal-destination="x2_consectetuer">Maecenas at enim</fo:basic-link>
+            </fo:inline>
+            <fo:inline keep-together.within-line="always">
+              <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                         keep-with-next.within-line="always" />
+              <fo:basic-link internal-destination="x2_consectetuer">
+                <fo:page-number-citation ref-id="x2_consectetuer" />
+              </fo:basic-link>
+            </fo:inline>
+          </fo:block>
+          <fo:block id="toc.id2594914.x2_consectetuer" margin-left="24pt">
+            <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                      text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+              <fo:inline keep-with-next.within-line="always">
+                <fo:basic-link internal-destination="x2_morbi">Curabitur nulla orci</fo:basic-link>
+              </fo:inline>
+              <fo:inline keep-together.within-line="always">
+                <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                           keep-with-next.within-line="always" />
+                <fo:basic-link internal-destination="x2_morbi">
+                  <fo:page-number-citation ref-id="x2_morbi" />
+                </fo:basic-link>
+              </fo:inline>
+            </fo:block>
+            <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                      text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+              <fo:inline keep-with-next.within-line="always">
+                <fo:basic-link internal-destination="x2_vestibulum">faucibus orci</fo:basic-link>
+              </fo:inline>
+              <fo:inline keep-together.within-line="always">
+                <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                           keep-with-next.within-line="always" />
+                <fo:basic-link internal-destination="x2_vestibulum">
+                  <fo:page-number-citation ref-id="x2_vestibulum" />
+                </fo:basic-link>
+              </fo:inline>
+            </fo:block>
+          </fo:block>
+          <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                    text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+            <fo:inline keep-with-next.within-line="always">
+              <fo:basic-link internal-destination="x2_donec">Maecenas scelerisque</fo:basic-link>
+            </fo:inline>
+            <fo:inline keep-together.within-line="always">
+              <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                         keep-with-next.within-line="always" />
+              <fo:basic-link internal-destination="x2_donec">
+                <fo:page-number-citation ref-id="x2_donec" />
+              </fo:basic-link>
+            </fo:inline>
+          </fo:block>
+          <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                    text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+            <fo:inline keep-with-next.within-line="always">
+              <fo:basic-link internal-destination="x2_pellentesque">Dignissim urna</fo:basic-link>
+            </fo:inline>
+            <fo:inline keep-together.within-line="always">
+              <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                         keep-with-next.within-line="always" />
+              <fo:basic-link internal-destination="x2_pellentesque">
+                <fo:page-number-citation ref-id="x2_pellentesque" />
+              </fo:basic-link>
+            </fo:inline>
+          </fo:block>
+        </fo:block>
+        <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                  text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+          <fo:inline keep-with-next.within-line="always">
+            <fo:basic-link internal-destination="index">Index</fo:basic-link>
+          </fo:inline>
+          <fo:inline keep-together.within-line="always">
+            <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                       keep-with-next.within-line="always" />
+            <fo:basic-link internal-destination="index">
+              <fo:page-number-citation ref-id="index" />
+            </fo:basic-link>
+          </fo:inline>
+        </fo:block>
+      </fo:block>
+    </fo:flow>
+  </fo:page-sequence>
+  <fo:page-sequence hyphenate="false" master-reference="lot" language="en" format="i" initial-page-number="auto-odd"
+                    force-page-count="end-on-even" hyphenation-character="-" hyphenation-push-character-count="2"
+                    hyphenation-remain-character-count="2">
+    <fo:static-content flow-name="xsl-region-before-first">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-odd">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    Lorem Ipsum
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-even">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    Lorem Ipsum
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-blank">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-footnote-separator">
+      <fo:block>
+        <fo:leader color="black" leader-pattern="rule" leader-length="1in" />
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-first">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-odd">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-even">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-blank">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:flow flow-name="xsl-region-body" start-indent="4pc" end-indent="0pt">
+      <fo:block id="lot...figure...id2594914">
+        <fo:block>
+          <fo:block>
+            <fo:block space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em"
+                      space-after="0.5em" margin-left="0pt" start-indent="0pt" font-size="17.28pt" font-weight="bold"
+                      font-family="sans-serif,Symbol,ZapfDingbats">List of Figures
+            </fo:block>
+          </fo:block>
+        </fo:block>
+        <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" text-align-last="justify"
+                  text-align="start" end-indent="24pt" last-line-end-indent="-24pt">
+          <fo:inline keep-with-next.within-line="always">
+            <fo:basic-link internal-destination="fig_morbi">1.1. Morbi maecanas sem dui</fo:basic-link>
+          </fo:inline>
+          <fo:inline keep-together.within-line="always">
+            <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area"
+                       keep-with-next.within-line="always" />
+            <fo:basic-link internal-destination="fig_morbi">
+              <fo:page-number-citation ref-id="fig_morbi" />
+            </fo:basic-link>
+          </fo:inline>
+        </fo:block>
+      </fo:block>
+    </fo:flow>
+  </fo:page-sequence>
+  <fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="false"
+                    master-reference="body" language="en" format="1" initial-page-number="1"
+                    force-page-count="end-on-even" hyphenation-character="-" hyphenation-push-character-count="2"
+                    hyphenation-remain-character-count="2">
+    <fo:static-content flow-name="xsl-region-before-first">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-odd">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:retrieve-marker retrieve-class-name="section.head.marker"
+                                        retrieve-position="first-including-carryover"
+                                        retrieve-boundary="page-sequence" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-even">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:retrieve-marker retrieve-class-name="section.head.marker"
+                                        retrieve-position="first-including-carryover"
+                                        retrieve-boundary="page-sequence" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-blank">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-footnote-separator">
+      <fo:block>
+        <fo:leader color="black" leader-pattern="rule" leader-length="1in" />
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-first">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-odd">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-even">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-blank">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:flow flow-name="xsl-region-body" start-indent="4pc" end-indent="0pt">
+      <fo:block id="lorem">
+        <fo:block font-family="sans-serif,Symbol,ZapfDingbats">
+          <fo:block margin-left="0pt">
+            <fo:block font-size="24.8832pt" font-weight="bold">
+              <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                        keep-with-next.within-column="always" space-before.optimum="10pt"
+                        space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false"
+                        text-align="left" start-indent="0pt" hyphenation-character="-"
+                        hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter&#xA0;1.&#xA0;Lorem
+                Ipsum
+              </fo:block>
+            </fo:block>
+            <fo:block space-before="0.5em" space-after="0.5em" font-size="14.4pt">
+              <fo:block>
+                <fo:block>Petri M&#xE4;kij&#xE4;rvi</fo:block>
+                <fo:block>Dr. I. M. Noman</fo:block>
+              </fo:block>
+            </fo:block>
+            <fo:block>$Revision: 1.1 $</fo:block>
+            <fo:block>
+              <fo:block>Published $Date: 2007/09/12 17:12:04 $</fo:block>
+            </fo:block>
+          </fo:block>
+        </fo:block>
+      </fo:block>
+      <fo:block id="consectetuer">
+        <fo:block>
+          <fo:block>
+            <fo:block keep-together.within-column="always" margin-left="0pt"
+                      font-family="sans-serif,Symbol,ZapfDingbats">
+              <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                        keep-with-next.within-column="always">
+                <fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always"
+                          space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em"
+                          text-align="left" start-indent="0pt">
+                  <fo:marker marker-class-name="section.head.marker">Consectetuer adipiscing elit</fo:marker>
+                  <fo:block font-size="20.736pt">Consectetuer adipiscing elit</fo:block>
+                </fo:block>
+              </fo:block>
+            </fo:block>
+          </fo:block>
+        </fo:block>
+        <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Lorem ipsum dolor
+          sit amet, consectetuer adipiscing elit.<fo:wrapper id="id2675423"><!--Curabitur, urna--></fo:wrapper>Curabitur
+          urna. Maecenas eu nisi faucibus risus ornare
+          fringilla. Nam laoreet accumsan metus. Maecenas ac nunc non enim consequat
+          ultrices. Duis egestas condimentum velit. Nulla scelerisque. Nulla turpis.
+          Nam ante tortor, convallis sit amet, commodo at, dignissim at, dolor.
+          Proin sodales. Maecenas at enim. Aliquam nunc. Curabitur ullamcorper
+          molestie neque. Aliquam erat volutpat. Sed non dui et tellus ultrices
+          porttitor.
+        </fo:block>
+        <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Curabitur rutrum
+          lobortis orci. Vivamus a urna. Nulla feugiat
+          euismod massa. In odio quam, posuere at, mattis at, pretium quis, nisi.
+          Sed eget nibh. Vestibulum ante enim, mattis at, mollis eu, ullamcorper sit
+          amet, augue. Mauris quam massa, vestibulum rhoncus, bibendum eget,
+          adipiscing at, enim. Sed pharetra. Praesent ac nibh id massa bibendum
+          elementum. Sed urna nibh, pharetra in, dapibus at, tristique at, velit.
+          Maecenas lectus. Pellentesque aliquet pharetra lacus. Aliquam et tellus.
+          Aenean gravida tristique ipsum. Duis suscipit euismod dolor. Etiam
+          facilisis mi nec risus. Nam non purus sed nibh cursus luctus. Morbi nunc
+          sem, hendrerit eu, mattis sit amet, pulvinar nec, nulla. Duis lobortis
+          metus ut orci. Curabitur facilisis.
+        </fo:block>
+        <fo:block id="morbi">
+          <fo:block>
+            <fo:block>
+              <fo:block keep-together.within-column="always" margin-left="0pt"
+                        font-family="sans-serif,Symbol,ZapfDingbats">
+                <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                          keep-with-next.within-column="always">
+                  <fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always"
+                            space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em"
+                            text-align="left" start-indent="0pt">
+                    <fo:block font-size="17.28pt">Morbi a eros</fo:block>
+                  </fo:block>
+                </fo:block>
+              </fo:block>
+            </fo:block>
+          </fo:block>
+          <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Cum sociis
+            natoque penatibus et magnis dis parturient montes,
+            nascetur ridiculus mus
+            <fo:footnote>
+              <fo:inline>
+                <fo:inline font-size="75%" font-weight="normal" font-style="normal" baseline-shift="super">1</fo:inline>
+              </fo:inline>
+              <fo:footnote-body font-family="serif,Symbol,ZapfDingbats" font-size="8pt" font-weight="normal"
+                                font-style="normal" text-align="justify" start-indent="0pt" text-indent="0pt">
+                <fo:block><fo:inline font-size="75%" font-weight="normal" font-style="normal" baseline-shift="super">
+                  1</fo:inline>Aenean in odio et dui vestibulum eleifend. Donec aliquet
+                  magna.
+                </fo:block>
+              </fo:footnote-body>
+            </fo:footnote>
+            . Curabitur nulla orci, porta eget, tincidunt dapibus,
+            tincidunt sed, ligula. Nunc vel sapien. In nec diam fermentum purus
+            tincidunt ullamcorper:
+          </fo:block>
+          <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Donec facilisis
+            aliquet libero. Maecenas sem dui, scelerisque
+            vitae, convallis at, gravida eu, purus. Proin quis nisl. Mauris ac purus
+            eu dolor fringilla tempus. Aliquam elementum. In a neque. Praesent
+            ipsum. Maecenas elementum magna sit amet eros. Praesent non
+            sapien.
+          </fo:block>
+          <fo:block id="fig_morbi" space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em"
+                    space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em"
+                    keep-together.within-column="always">
+            <fo:block font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em"
+                      space-after.optimum="0.6em" space-after.maximum="0.8em" space-before.optimum="1em"
+                      space-before.minimum="0.8em" space-before.maximum="1.2em" keep-with-next.within-column="always">
+              Figure&#xA0;1.1.&#xA0;Morbi maecanas sem dui
+            </fo:block>
+            <fo:block id="id2675504">
+              <fo:external-graphic src="url(images/morib_lib2.png)" width="auto" height="auto" content-width="auto"
+                                   content-height="auto" />
+            </fo:block>
+            <fo:block id="id2674634">
+              <fo:external-graphic src="url(../images/morib_lib2.png)" width="auto" height="auto" content-width="auto"
+                                   content-height="auto" />
+            </fo:block>
+          </fo:block>
+          <fo:block id="nullam">
+            <fo:block>
+              <fo:block>
+                <fo:block keep-together.within-column="always" margin-left="0pt"
+                          font-family="sans-serif,Symbol,ZapfDingbats">
+                  <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                            keep-with-next.within-column="always">
+                    <fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always"
+                              space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em"
+                              text-align="left" start-indent="0pt">
+                      <fo:block font-size="14.4pt">Nullam dapibus</fo:block>
+                    </fo:block>
+                  </fo:block>
+                </fo:block>
+              </fo:block>
+            </fo:block>
+            <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Mauris et
+              erat egestas libero volutpat vestibulum. Curabitur
+              viverra iaculis quam. Nulla egestas dui eget odio. Nam dictum elit in
+              massa. Phasellus nec elit. Maecenas bibendum. Lorem ipsum dolor sit
+              amet, consectetuer adipiscing elit. Nullam dapibus, erat suscipit
+              iaculis porta, turpis arcu laoreet elit, sed ultrices ligula risus eu
+              velit. Phasellus risus lorem, vulputate vitae, ultricies id, elementum
+              ut, quam. Donec augue dui, vestibulum vitae, vehicula venenatis,
+              hendrerit venenatis, mi. Sed at libero eu tortor consequat aliquam.
+              Donec odio lectus, scelerisque eget, auctor id, tincidunt ac, libero.
+              Duis interdum hendrerit arcu. Pellentesque habitant morbi tristique
+              senectus et netus et malesuada fames ac turpis egestas. Etiam
+              tincidunt feugiat purus. Nulla suscipit libero et dui. Vestibulum
+              dignissim urna a risus.
+            </fo:block>
+          </fo:block>
+        </fo:block>
+        <fo:block id="vestibulum">
+          <fo:block>
+            <fo:block>
+              <fo:block keep-together.within-column="always" margin-left="0pt"
+                        font-family="sans-serif,Symbol,ZapfDingbats">
+                <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                          keep-with-next.within-column="always">
+                  <fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always"
+                            space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em"
+                            text-align="left" start-indent="0pt">
+                    <fo:block font-size="17.28pt">Vestibulum ante</fo:block>
+                  </fo:block>
+                </fo:block>
+              </fo:block>
+            </fo:block>
+          </fo:block>
+          <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Vestibulum ante
+            ipsum primis in faucibus orci<fo:wrapper id="luctus"><!--luctus, ultirce--></fo:wrapper>luctus et ultrice
+            <fo:wrapper id="id2674708"><!----></fo:wrapper>
+            posuere cubilia Curae; Cras purus odio, faucibus
+            et, euismod sollicitudin, vehicula eu, urna. Mauris tempor. Vivamus sit
+            amet nisi vel dolor ultricies placerat. Nulla adipiscing feugiat erat.
+            Pellentesque vulputate posuere pede. Ut id sem at neque commodo
+            <fo:wrapper id="id2674720"><!--ultricie--></fo:wrapper>ultricies. Suspendisse sed enim. Nulla facilisi.
+            Proin
+            ullamcorper vestibulum tellus. Donec varius scelerisque eros.
+            Pellentesque feugiat velit et neque. Proin urna neque, interdum sed,
+            auctor sed, vulputate et, nunc. In cursus nisl. Etiam pharetra, nisl
+            quis sagittis ultricies, sapien tellus tincidunt ante, in congue mauris
+            enim eu metus. Suspendisse fringilla elementum libero. Cras nonummy sem
+            mattis tellus. Praesent faucibus sem eu dui. Nam vel lacus vitae diam
+            sollicitudin tristique. Nulla facilisi.
+          </fo:block>
+          <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Donec egestas
+            nisl id neque. Nullam<fo:wrapper id="id2674740"><!--leo leo--></fo:wrapper>leo leo, bibendum sit amet,
+            pellentesque sit amet,
+            sagittis eu, nibh. Praesent malesuada dictum nunc. In interdum imperdiet
+            felis. Cras rutrum leo sit amet odio. Mauris ultrices, augue sit amet
+            lacinia sollicitudin, lorem leo euismod elit, in pharetra mauris augue
+            id turpis. Vestibulum dictum sapien et sapien. Donec eleifend felis quis
+            leo fringilla consequat. Mauris vitae dolor pretium velit tincidunt
+            vehicula. Suspendisse facilisis rutrum urna. Proin viverra vulputate
+            magna. Vivamus massa nibh, eleifend condimentum, elementum eget,
+            lobortis nec, diam. Phasellus sollicitudin. Donec quis orci ornare felis
+            cursus porta. Nullam purus lectus, fringilla eu, feugiat vel, tristique
+            eu, est.
+          </fo:block>
+        </fo:block>
+      </fo:block>
+      <fo:block id="donec">
+        <fo:block>
+          <fo:block>
+            <fo:block keep-together.within-column="always" margin-left="0pt"
+                      font-family="sans-serif,Symbol,ZapfDingbats">
+              <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                        keep-with-next.within-column="always">
+                <fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always"
+                          space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em"
+                          text-align="left" start-indent="0pt">
+                  <fo:marker marker-class-name="section.head.marker">Donec eleifend</fo:marker>
+                  <fo:block font-size="20.736pt">Donec eleifend</fo:block>
+                </fo:block>
+              </fo:block>
+            </fo:block>
+          </fo:block>
+        </fo:block>
+        <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Donec eleifend,
+          justo ac interdum rutrum, massa ligula convallis
+          tellus, quis elementum elit lectus eu sapien. Ut metus massa, vehicula ut,
+          semper ut, eleifend eu, quam. Cras quis augue. Maecenas enim ante, cursus
+          vestibulum, consectetuer et, dictum sit amet, dolor. Phasellus ultrices
+          est id est. Maecenas scelerisque nisl quis eros. Vivamus rhoncus.
+          Pellentesque habitant morbi tristique senectus et netus et malesuada fames
+          ac turpis egestas. Mauris diam turpis, faucibus non, scelerisque sit amet,
+          porttitor a, enim. Ut bibendum pulvinar neque.
+        </fo:block>
+        <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Pellentesque
+          lacinia, eros at dapibus rhoncus, lectus magna pharetra
+          sapien, sed convallis ligula mi a sapien. Donec tempor libero ut nibh.
+          Quisque et lectus eu arcu iaculis rutrum. Donec et ligula. Integer gravida
+          aliquam diam. Curabitur in augue non massa convallis accumsan. Mauris nisl
+          neque, dictum quis, eleifend nec, ornare a, nisl. Praesent id elit. Mauris
+          et leo at odio placerat iaculis. Morbi faucibus dictum nibh.
+        </fo:block>
+      </fo:block>
+      <fo:block id="pellentesque">
+        <fo:block>
+          <fo:block>
+            <fo:block keep-together.within-column="always" margin-left="0pt"
+                      font-family="sans-serif,Symbol,ZapfDingbats">
+              <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                        keep-with-next.within-column="always">
+                <fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always"
+                          space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em"
+                          text-align="left" start-indent="0pt">
+                  <fo:marker marker-class-name="section.head.marker">Pellentesque augue</fo:marker>
+                  <fo:block font-size="20.736pt">Pellentesque augue</fo:block>
+                </fo:block>
+              </fo:block>
+            </fo:block>
+          </fo:block>
+        </fo:block>
+        <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Quisque molestie
+          dignissim urna. Donec mattis pellentesque augue.
+          Nullam neque diam, bibendum ut, placerat nec, pharetra ac, eros. Sed
+          libero risus, nonummy vitae, tincidunt a, blandit ut, tortor. Nulla quis
+          libero. Vivamus ac ligula. Proin dignissim, orci ut mattis sodales, lectus
+          ligula convallis libero, sed feugiat libero odio non massa. Sed elementum.
+          Nullam id enim. Sed non arcu quis leo vulputate adipiscing. Nam et orci.
+          Integer sed nunc. Maecenas sem turpis, pulvinar ac, volutpat non,
+          ultricies rhoncus, tellus. Fusce porttitor. Nullam cursus odio vel nisi
+          elementum elementum. Integer venenatis. Sed hendrerit, tortor a semper
+          ultrices, lorem sapien lacinia erat, eu suscipit risus nisl id elit. In
+          hac habitasse platea dictumst.
+        </fo:block>
+        <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Nulla facilisi.
+          Morbi imperdiet varius ante. Proin enim est, tempus
+          eget, laoreet eget, aliquet nec, pede. Aliquam justo risus, luctus vel,
+          consectetuer in, sollicitudin in, lectus. Donec eu diam et dolor dapibus
+          sagittis. Aliquam aliquam, neque eget imperdiet lobortis, turpis ligula
+          elementum pede, eget sodales purus dui nec mi. Integer vel purus. Cras
+          adipiscing lobortis arcu. Integer commodo. Curabitur pretium, purus a
+          adipiscing vestibulum, lacus justo faucibus sapien, a sagittis est urna
+          sit amet est. Nullam diam. Maecenas vulputate, lacus et adipiscing
+          ultrices, tortor urna euismod arcu, in vestibulum quam nibh nec erat.
+          Quisque bibendum lorem vitae diam. Nulla lobortis. Nam porttitor, nisl et
+          convallis mollis, metus nisl euismod nisl, sed adipiscing tortor augue ut
+          leo. Donec eleifend lorem quis tellus.
+        </fo:block>
+      </fo:block>
+    </fo:flow>
+  </fo:page-sequence>
+  <fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="false"
+                    master-reference="body" language="en" format="1" initial-page-number="auto-odd"
+                    force-page-count="end-on-even" hyphenation-character="-" hyphenation-push-character-count="2"
+                    hyphenation-remain-character-count="2">
+    <fo:static-content flow-name="xsl-region-before-first">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-odd">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:retrieve-marker retrieve-class-name="section.head.marker"
+                                        retrieve-position="first-including-carryover"
+                                        retrieve-boundary="page-sequence" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-even">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:retrieve-marker retrieve-class-name="section.head.marker"
+                                        retrieve-position="first-including-carryover"
+                                        retrieve-boundary="page-sequence" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-blank">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-footnote-separator">
+      <fo:block>
+        <fo:leader color="black" leader-pattern="rule" leader-length="1in" />
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-first">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-odd">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-even">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-blank">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:flow flow-name="xsl-region-body" start-indent="4pc" end-indent="0pt">
+      <fo:block id="duis">
+        <fo:block font-family="sans-serif,Symbol,ZapfDingbats">
+          <fo:block margin-left="0pt">
+            <fo:block font-size="24.8832pt" font-weight="bold">
+              <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                        keep-with-next.within-column="always" space-before.optimum="10pt"
+                        space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false"
+                        text-align="left" start-indent="0pt" hyphenation-character="-"
+                        hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter&#xA0;2.&#xA0;Duis
+                egestas condimentum
+              </fo:block>
+            </fo:block>
+            <fo:block space-before="0.5em" space-after="0.5em" font-size="14.4pt">
+              <fo:block>
+                <fo:block>Petri M&#xE4;kij&#xE4;rvi</fo:block>
+                <fo:block>Maxwell Smart</fo:block>
+              </fo:block>
+            </fo:block>
+            <fo:block>$Revision: 1.1 $</fo:block>
+            <fo:block>
+              <fo:block>Published $Date: 2007/09/12 17:12:04 $</fo:block>
+            </fo:block>
+          </fo:block>
+        </fo:block>
+      </fo:block>
+      <fo:block id="x2_consectetuer">
+        <fo:block>
+          <fo:block>
+            <fo:block keep-together.within-column="always" margin-left="0pt"
+                      font-family="sans-serif,Symbol,ZapfDingbats">
+              <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                        keep-with-next.within-column="always">
+                <fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always"
+                          space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em"
+                          text-align="left" start-indent="0pt">
+                  <fo:marker marker-class-name="section.head.marker">Maecenas at enim</fo:marker>
+                  <fo:block font-size="20.736pt">Maecenas at enim</fo:block>
+                </fo:block>
+              </fo:block>
+            </fo:block>
+          </fo:block>
+        </fo:block>
+        <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Aliquam erat
+          volutpat, consectetuer adipiscing elit.<fo:wrapper id="id2674888"><!--Curabitur, urna--></fo:wrapper>Curabitur
+          urna. Maecenas eu nisi faucibus risus ornare
+          fringilla. Nam laoreet accumsan metus. Maecenas ac nunc non enim consequat
+          ultrices. Duis egestas condimentum velit. Nulla scelerisque. Nulla turpis.
+          Nam ante tortor, convallis sit amet, commodo at, dignissim at, dolor.
+          Proin sodales. Maecenas at enim. Aliquam nunc. Curabitur ullamcorper
+          molestie neque. Aliquam erat volutpat. Sed non dui et tellus ultrices
+          porttitor.
+        </fo:block>
+        <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Curabitur rutrum
+          lobortis orci. Vivamus a urna. Nulla feugiat
+          euismod massa. In odio quam, posuere at, mattis at, pretium quis, nisi.
+          Sed eget nibh. Vestibulum ante enim, mattis at, mollis eu, ullamcorper sit
+          amet, augue. Mauris quam massa, vestibulum rhoncus, bibendum eget,
+          adipiscing at, enim. Sed pharetra. Praesent ac nibh id massa bibendum
+          elementum. Sed urna nibh, pharetra in, dapibus at, tristique at, velit.
+          Maecenas lectus. Pellentesque aliquet pharetra lacus. Aliquam et tellus.
+          Aenean gravida tristique ipsum. Duis suscipit euismod dolor. Etiam
+          facilisis mi nec risus. Nam non purus sed nibh cursus luctus. Morbi nunc
+          sem, hendrerit eu, mattis sit amet, pulvinar nec, nulla. Duis lobortis
+          metus ut orci. Curabitur facilisis.
+        </fo:block>
+        <fo:block id="x2_morbi">
+          <fo:block>
+            <fo:block>
+              <fo:block keep-together.within-column="always" margin-left="0pt"
+                        font-family="sans-serif,Symbol,ZapfDingbats">
+                <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                          keep-with-next.within-column="always">
+                  <fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always"
+                            space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em"
+                            text-align="left" start-indent="0pt">
+                    <fo:block font-size="17.28pt">Curabitur nulla orci</fo:block>
+                  </fo:block>
+                </fo:block>
+              </fo:block>
+            </fo:block>
+          </fo:block>
+          <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Cum sociis
+            natoque penatibus et magnis dis parturient montes,
+            nascetur ridiculus mus
+            <fo:footnote>
+              <fo:inline>
+                <fo:inline font-size="75%" font-weight="normal" font-style="normal" baseline-shift="super">1</fo:inline>
+              </fo:inline>
+              <fo:footnote-body font-family="serif,Symbol,ZapfDingbats" font-size="8pt" font-weight="normal"
+                                font-style="normal" text-align="justify" start-indent="0pt" text-indent="0pt">
+                <fo:block><fo:inline font-size="75%" font-weight="normal" font-style="normal" baseline-shift="super">
+                  1</fo:inline>Aenean in odio et dui vestibulum eleifend. Donec aliquet
+                  magna.
+                </fo:block>
+              </fo:footnote-body>
+            </fo:footnote>
+            . Curabitur nulla orci, porta eget, tincidunt dapibus,
+            tincidunt sed, ligula. Nunc vel sapien. In nec diam fermentum purus
+            tincidunt ullamcorper:
+          </fo:block>
+          <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Donec facilisis
+            aliquet libero. Maecenas sem dui, scelerisque
+            vitae, convallis at, gravida eu, purus. Proin quis nisl. Mauris ac purus
+            eu dolor fringilla tempus. Aliquam elementum. In a neque. Praesent
+            ipsum. Maecenas elementum magna sit amet eros. Praesent non
+            sapien.
+          </fo:block>
+          <fo:block id="x2_nullam">
+            <fo:block>
+              <fo:block>
+                <fo:block keep-together.within-column="always" margin-left="0pt"
+                          font-family="sans-serif,Symbol,ZapfDingbats">
+                  <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                            keep-with-next.within-column="always">
+                    <fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always"
+                              space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em"
+                              text-align="left" start-indent="0pt">
+                      <fo:block font-size="14.4pt">Maecenas bibendum</fo:block>
+                    </fo:block>
+                  </fo:block>
+                </fo:block>
+              </fo:block>
+            </fo:block>
+            <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Nulla
+              facilisi. Morbi imperdiet varius ante. Proin enim est, tempus
+              eget, laoreet eget, aliquet nec, pede. Aliquam justo risus, luctus vel,
+              consectetuer in, sollicitudin in, lectus. Donec eu diam et dolor dapibus
+              sagittis. Aliquam aliquam, neque eget imperdiet lobortis, turpis ligula
+              elementum pede, eget sodales purus dui nec mi. Integer vel purus. Cras
+              adipiscing lobortis arcu. Integer commodo. Curabitur pretium, purus a
+              adipiscing vestibulum, lacus justo faucibus sapien, a sagittis est urna
+              sit amet est. Nullam diam. Maecenas vulputate, lacus et adipiscing
+              ultrices, tortor urna euismod arcu, in vestibulum quam nibh nec erat.
+              Quisque bibendum lorem vitae diam. Nulla lobortis. Nam porttitor, nisl et
+              convallis mollis, metus nisl euismod nisl, sed adipiscing tortor augue ut
+              leo. Donec eleifend lorem quis tellus.
+            </fo:block>
+            <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Mauris et
+              erat egestas libero volutpat vestibulum. Curabitur
+              viverra iaculis quam. Nulla egestas dui eget odio. Nam dictum elit in
+              massa. Phasellus nec elit. Maecenas bibendum. Lorem ipsum dolor sit
+              amet, consectetuer adipiscing elit. Nullam dapibus, erat suscipit
+              iaculis porta, turpis arcu laoreet elit, sed ultrices ligula risus eu
+              velit. Phasellus risus lorem, vulputate vitae, ultricies id, elementum
+              ut, quam. Donec augue dui, vestibulum vitae, vehicula venenatis,
+              hendrerit venenatis, mi. Sed at libero eu tortor consequat aliquam.
+              Donec odio lectus, scelerisque eget, auctor id, tincidunt ac, libero.
+              Duis interdum hendrerit arcu. Pellentesque habitant morbi tristique
+              senectus et netus et malesuada fames ac turpis egestas. Etiam
+              tincidunt feugiat purus. Nulla suscipit libero et dui. Vestibulum
+              dignissim urna a risus.
+            </fo:block>
+          </fo:block>
+        </fo:block>
+        <fo:block id="x2_vestibulum">
+          <fo:block>
+            <fo:block>
+              <fo:block keep-together.within-column="always" margin-left="0pt"
+                        font-family="sans-serif,Symbol,ZapfDingbats">
+                <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                          keep-with-next.within-column="always">
+                  <fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always"
+                            space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em"
+                            text-align="left" start-indent="0pt">
+                    <fo:block font-size="17.28pt">faucibus orci</fo:block>
+                  </fo:block>
+                </fo:block>
+              </fo:block>
+            </fo:block>
+          </fo:block>
+          <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Vestibulum ante
+            ipsum primis in faucibus orci<fo:wrapper id="x2_luctus"><!--luctus, ultirce--></fo:wrapper>luctus et ultrice
+            <fo:wrapper id="id2675599"><!----></fo:wrapper>
+            posuere cubilia Curae; Cras purus odio, faucibus
+            et, euismod sollicitudin, vehicula eu, urna. Mauris tempor. Vivamus sit
+            amet nisi vel dolor ultricies placerat. Nulla adipiscing feugiat erat.
+            Pellentesque vulputate posuere pede. Ut id sem at neque commodo
+            <fo:wrapper id="id2675610"><!--ultricie--></fo:wrapper>ultricies. Suspendisse sed enim. Nulla facilisi.
+            Proin
+            ullamcorper vestibulum tellus. Donec varius scelerisque eros.
+            Pellentesque feugiat velit et neque. Proin urna neque, interdum sed,
+            auctor sed, vulputate et, nunc. In cursus nisl. Etiam pharetra, nisl
+            quis sagittis ultricies, sapien tellus tincidunt ante, in congue mauris
+            enim eu metus. Suspendisse fringilla elementum libero. Cras nonummy sem
+            mattis tellus. Praesent faucibus sem eu dui. Nam vel lacus vitae diam
+            sollicitudin tristique. Nulla facilisi.
+          </fo:block>
+          <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Donec egestas
+            nisl id neque. Nullam<fo:wrapper id="id2675630"><!--leo leo--></fo:wrapper>leo leo, bibendum sit amet,
+            pellentesque sit amet,
+            sagittis eu, nibh. Praesent malesuada dictum nunc. In interdum imperdiet
+            felis. Cras rutrum leo sit amet odio. Mauris ultrices, augue sit amet
+            lacinia sollicitudin, lorem leo euismod elit, in pharetra mauris augue
+            id turpis. Vestibulum dictum sapien et sapien. Donec eleifend felis quis
+            leo fringilla consequat. Mauris vitae dolor pretium velit tincidunt
+            vehicula. Suspendisse facilisis rutrum urna. Proin viverra vulputate
+            magna. Vivamus massa nibh, eleifend condimentum, elementum eget,
+            lobortis nec, diam. Phasellus sollicitudin. Donec quis orci ornare felis
+            cursus porta. Nullam purus lectus, fringilla eu, feugiat vel, tristique
+            eu, est.
+          </fo:block>
+        </fo:block>
+      </fo:block>
+      <fo:block id="x2_donec">
+        <fo:block>
+          <fo:block>
+            <fo:block keep-together.within-column="always" margin-left="0pt"
+                      font-family="sans-serif,Symbol,ZapfDingbats">
+              <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                        keep-with-next.within-column="always">
+                <fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always"
+                          space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em"
+                          text-align="left" start-indent="0pt">
+                  <fo:marker marker-class-name="section.head.marker">Maecenas scelerisque</fo:marker>
+                  <fo:block font-size="20.736pt">Maecenas scelerisque</fo:block>
+                </fo:block>
+              </fo:block>
+            </fo:block>
+          </fo:block>
+        </fo:block>
+        <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Donec eleifend,
+          justo ac interdum rutrum, massa ligula convallis
+          tellus, quis elementum elit lectus eu sapien. Ut metus massa, vehicula ut,
+          semper ut, eleifend eu, quam. Cras quis augue. Maecenas enim ante, cursus
+          vestibulum, consectetuer et, dictum sit amet, dolor. Phasellus ultrices
+          est id est. Maecenas scelerisque nisl quis eros. Vivamus rhoncus.
+          Pellentesque habitant morbi tristique senectus et netus et malesuada fames
+          ac turpis egestas. Mauris diam turpis, faucibus non, scelerisque sit amet,
+          porttitor a, enim. Ut bibendum pulvinar neque.
+        </fo:block>
+        <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Pellentesque
+          lacinia, eros at dapibus rhoncus, lectus magna pharetra
+          sapien, sed convallis ligula mi a sapien. Donec tempor libero ut nibh.
+          Quisque et lectus eu arcu iaculis rutrum. Donec et ligula. Integer gravida
+          aliquam diam. Curabitur in augue non massa convallis accumsan. Mauris nisl
+          neque, dictum quis, eleifend nec, ornare a, nisl. Praesent id elit. Mauris
+          et leo at odio placerat iaculis. Morbi faucibus dictum nibh.
+        </fo:block>
+      </fo:block>
+      <fo:block id="x2_pellentesque">
+        <fo:block>
+          <fo:block>
+            <fo:block keep-together.within-column="always" margin-left="0pt"
+                      font-family="sans-serif,Symbol,ZapfDingbats">
+              <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                        keep-with-next.within-column="always">
+                <fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always"
+                          space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em"
+                          text-align="left" start-indent="0pt">
+                  <fo:marker marker-class-name="section.head.marker">Dignissim urna</fo:marker>
+                  <fo:block font-size="20.736pt">Dignissim urna</fo:block>
+                </fo:block>
+              </fo:block>
+            </fo:block>
+          </fo:block>
+        </fo:block>
+        <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Quisque molestie
+          dignissim urna. Donec mattis pellentesque augue.
+          Nullam neque diam, bibendum ut, placerat nec, pharetra ac, eros. Sed
+          libero risus, nonummy vitae, tincidunt a, blandit ut, tortor. Nulla quis
+          libero. Vivamus ac ligula. Proin dignissim, orci ut mattis sodales, lectus
+          ligula convallis libero, sed feugiat libero odio non massa. Sed elementum.
+          Nullam id enim. Sed non arcu quis leo vulputate adipiscing. Nam et orci.
+          Integer sed nunc. Maecenas sem turpis, pulvinar ac, volutpat non,
+          ultricies rhoncus, tellus. Fusce porttitor. Nullam cursus odio vel nisi
+          elementum elementum. Integer venenatis. Sed hendrerit, tortor a semper
+          ultrices, lorem sapien lacinia erat, eu suscipit risus nisl id elit. In
+          hac habitasse platea dictumst.
+        </fo:block>
+        <fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Nulla facilisi.
+          Morbi imperdiet varius ante. Proin enim est, tempus
+          eget, laoreet eget, aliquet nec, pede. Aliquam justo risus, luctus vel,
+          consectetuer in, sollicitudin in, lectus. Donec eu diam et dolor dapibus
+          sagittis. Aliquam aliquam, neque eget imperdiet lobortis, turpis ligula
+          elementum pede, eget sodales purus dui nec mi. Integer vel purus. Cras
+          adipiscing lobortis arcu. Integer commodo. Curabitur pretium, purus a
+          adipiscing vestibulum, lacus justo faucibus sapien, a sagittis est urna
+          sit amet est. Nullam diam. Maecenas vulputate, lacus et adipiscing
+          ultrices, tortor urna euismod arcu, in vestibulum quam nibh nec erat.
+          Quisque bibendum lorem vitae diam. Nulla lobortis. Nam porttitor, nisl et
+          convallis mollis, metus nisl euismod nisl, sed adipiscing tortor augue ut
+          leo. Donec eleifend lorem quis tellus.
+        </fo:block>
+      </fo:block>
+    </fo:flow>
+  </fo:page-sequence>
+  <fo:page-sequence hyphenate="false" master-reference="index" language="en" format="1" initial-page-number="auto-odd"
+                    force-page-count="end-on-even" hyphenation-character="-" hyphenation-push-character-count="2"
+                    hyphenation-remain-character-count="2">
+    <fo:static-content flow-name="xsl-region-before-first">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-odd">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:retrieve-marker retrieve-class-name="section.head.marker"
+                                        retrieve-position="first-including-carryover"
+                                        retrieve-boundary="page-sequence" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-even">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:external-graphic content-height="1.2cm" src="url(../images/esrflogo_small.png)" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook">
+                    <fo:retrieve-marker retrieve-class-name="section.head.marker"
+                                        retrieve-position="first-including-carryover"
+                                        retrieve-boundary="page-sequence" />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-before-blank">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="before" relative-align="baseline">
+                <fo:block>
+                  <fo:block xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:d="http://docbook.org/ns/docbook" />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-footnote-separator">
+      <fo:block>
+        <fo:leader color="black" leader-pattern="rule" leader-length="1in" />
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-first">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-odd">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-even">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after-blank">
+      <fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="0pt">
+        <fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid"
+                  border-top-color="black">
+          <fo:table-column column-number="1" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="2" column-width="proportional-column-width(1)" />
+          <fo:table-column column-number="3" column-width="proportional-column-width(1)" />
+          <fo:table-body>
+            <fo:table-row block-progression-dimension.minimum="14pt">
+              <fo:table-cell text-align="left" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block>
+                    <fo:page-number />
+                  </fo:block>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" display-align="after" relative-align="baseline">
+                <fo:block>
+                  <fo:block />
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </fo:static-content>
+    <fo:flow flow-name="xsl-region-body">
+      <fo:block id="index">
+        <fo:block>
+          <fo:block>
+            <fo:block margin-left="0pt" font-size="24.8832pt" font-family="sans-serif,Symbol,ZapfDingbats"
+                      font-weight="bold">
+              <fo:block xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                        keep-with-next.within-column="always" space-before.optimum="10pt"
+                        space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false"
+                        text-align="left" start-indent="0pt" span="inherit" hyphenation-character="-"
+                        hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Index
+              </fo:block>
+            </fo:block>
+          </fo:block>
+        </fo:block>
+      </fo:block>
+      <fo:block xmlns:rx="http://www.renderx.com/XSL/Extensions"
+                xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
+        <fo:block>
+          <fo:block margin-left="0pt" font-size="14.4pt" font-family="sans-serif,Symbol,ZapfDingbats" font-weight="bold"
+                    keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8"
+                    start-indent="0pt">C
+          </fo:block>
+          <fo:block start-indent="0pt">
+            <fo:block>Curabitur</fo:block>
+            <fo:block start-indent="1pc">
+              <fo:block>urna,
+                <fo:basic-link internal-destination="id2675423">
+                  <fo:page-number-citation ref-id="id2675423" />
+                </fo:basic-link>
+                ,
+                <fo:basic-link internal-destination="id2674888">
+                  <fo:page-number-citation ref-id="id2674888" />
+                </fo:basic-link>
+              </fo:block>
+              <fo:block start-indent="2pc">
+                <fo:block>(see also Consectetuer)</fo:block>
+              </fo:block>
+            </fo:block>
+          </fo:block>
+        </fo:block>
+        <fo:block>
+          <fo:block margin-left="0pt" font-size="14.4pt" font-family="sans-serif,Symbol,ZapfDingbats" font-weight="bold"
+                    keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8"
+                    start-indent="0pt">L
+          </fo:block>
+          <fo:block start-indent="0pt">
+            <fo:block>leo leo,
+              <fo:basic-link internal-destination="id2674740">
+                <fo:page-number-citation ref-id="id2674740" />
+              </fo:basic-link>
+              ,
+              <fo:basic-link internal-destination="id2675630">
+                <fo:page-number-citation ref-id="id2675630" />
+              </fo:basic-link>
+            </fo:block>
+            <fo:block>luctus</fo:block>
+            <fo:block start-indent="1pc">
+              <fo:block>ultirce,
+                <fo:basic-link internal-destination="luctus">
+                  <fo:page-number-citation ref-id="luctus" />
+                </fo:basic-link>
+                -
+                <fo:basic-link internal-destination="id2675599">
+                  <fo:page-number-citation ref-id="id2675599" />
+                </fo:basic-link>
+                ,
+                <fo:basic-link internal-destination="x2_luctus">
+                  <fo:page-number-citation ref-id="x2_luctus" />
+                </fo:basic-link>
+              </fo:block>
+            </fo:block>
+          </fo:block>
+        </fo:block>
+        <fo:block>
+          <fo:block margin-left="0pt" font-size="14.4pt" font-family="sans-serif,Symbol,ZapfDingbats" font-weight="bold"
+                    keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8"
+                    start-indent="0pt">U
+          </fo:block>
+          <fo:block start-indent="0pt">
+            <fo:block>ultricie,
+              <fo:basic-link internal-destination="id2674720">
+                <fo:page-number-citation ref-id="id2674720" />
+              </fo:basic-link>
+              ,
+              <fo:basic-link internal-destination="id2675610">
+                <fo:page-number-citation ref-id="id2675610" />
+              </fo:basic-link>
+            </fo:block>
+          </fo:block>
+        </fo:block>
+      </fo:block>
+    </fo:flow>
+  </fo:page-sequence>
+</fo:root>
diff --git a/xml/relaxng/testData/highlighting/rnc/fo/properties.rnc b/xml/relaxng/testData/highlighting/rnc/fo/properties.rnc
new file mode 100644
index 0000000..8aef991
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/fo/properties.rnc
@@ -0,0 +1,658 @@
+# =========================================================
+#                                                          
+# (c) 2004, RenderX                                        
+#                                                          
+# Author: Alexander Peshkov <[email protected]>          
+#                                                          
+# Permission is granted to use this document, copy and     
+# modify free of charge, provided that every derived work  
+# bear a reference to the present document.                
+#                                                          
+# This document contains a computer program written in     
+# XSL Transformations Language. It is published with no    
+# warranty of any kind about its usability, as a mere      
+# example of XSL technology. RenderX shall not be          
+# considered liable for any damage or loss of data caused  
+# by use of this program.                                  
+#                                                          
+# =========================================================
+
+namespace local = ""
+default namespace fo = "http://www.w3.org/1999/XSL/Format"
+namespace rx = "http://www.renderx.com/XSL/Extensions"
+
+include "properties_groups.rnc"
+
+# ****************************************************************************************
+# Properties used by top-level elements
+# ****************************************************************************************
+# ===============================================================
+# Root element can bear inheritable properties, passed further to 
+# fo:flows/fo:static-contents. Inheritable properties from fo:layout-master-set 
+# are banned in this version of schema.
+# ===============================================================
+root.attlist = 
+  media-usage.attr?,
+  inheritable-properties
+
+# ===============================================================
+# Document meta information - RenderX extension
+# ===============================================================
+meta-info.attlist = empty
+
+meta-field.attlist = 
+  name.attr,
+  value.attr
+
+# ===============================================================
+# Color profile declarations
+# ===============================================================
+declarations.attlist = empty
+
+color-profile.attlist = 
+  src.attr,
+  color-profile-name.attr,
+  rendering-intent.attr?
+
+# ===============================================================
+# Bookmarks - RenderX extension
+# ===============================================================
+outline.attlist = empty
+
+bookmark.attlist = 
+  (internal-destination.attr | external-destination.attr),
+  collapse-subtree.attr?
+
+bookmark-label.attlist = empty
+
+# ===============================================================
+# Layout-master-set contains a set of page-masters. Neither of
+# its descendants generates any area, so no inherited elements
+# can be specified on it or on its children.
+# ===============================================================
+layout-master-set.attlist = empty
+
+# ===============================================================
+# Page sequence master
+# ===============================================================
+page-sequence-master.attlist = master-name.attr
+
+# ===============================================================
+# Sequence specifiers.
+# ===============================================================
+single-page-master-reference.attlist = master-reference.attr
+
+repeatable-page-master-reference.attlist = 
+  master-reference.attr,
+  maximum-repeats.attr?
+
+repeatable-page-master-alternatives.attlist = maximum-repeats.attr?
+
+conditional-page-master-reference.attlist =
+  master-reference.attr,
+  page-position.attr?,
+  odd-or-even.attr?,
+  blank-or-not-blank.attr?
+
+# ===============================================================
+# Simple page master defines a page layout. It does not
+# explicitly generate any content. Most of its properties are
+# local except for writing-mode and reference-orientation that
+# are inherited by the underlying region-* objects.
+# ===============================================================
+# NOTE. We could think about a common background/padding/border
+# for every page instance generated by the page master. For such
+# a scope, we may add borders/padding/background to its features.
+# However, in the current version this is ruled out explicitly by the XSL specs.
+  
+simple-page-master.attlist =
+  margin-properties-CSS,
+  master-name.attr,
+  page-height.attr?,
+  page-width.attr?,
+  reference-orientation.attr?,
+  size.attr?,
+  writing-mode.attr?
+  
+# ===============================================================
+# Region elements by themselves do not generate any content.
+# Reference-orientation and writing-mode may be inherited from
+# the page master; all other features are local.
+# ===============================================================
+
+region-properties =
+  border-padding-background-properties,
+  area-properties,
+  region-name.attr?
+
+# ===============================================================
+# Body region: middle of the page. Unlike side regions, this one
+# may have multiple columns.
+# ===============================================================  
+# NOTE: We have restricted margin properties to be margin-only,
+# allowing no spaces. This is done because no clear semantics
+# can be ascribed to single components of a space vector.
+  
+region-body.attlist =
+  region-properties,
+  margin-properties-CSS,
+  column-count.attr?,
+  column-gap.attr?
+
+# ===============================================================
+# Side regions: page edges. These regions have extent and
+# precedence that is used to arbitrate corner conflicts. Side
+# regions are viewed as frames, and may not have margins.
+# ===============================================================
+# NOTE: Extent made obligatory: its default value of 0.0pt does not
+# make much sense.
+region-before.attlist = 
+  region-properties,
+  extent.attr,
+  precedence.attr?
+
+region-after.attlist = 
+  region-properties,
+  extent.attr,
+  precedence.attr?
+
+region-start.attlist = 
+  region-properties,
+  extent.attr
+
+region-end.attlist = 
+  region-properties,
+  extent.attr
+
+# ===============================================================
+# Page sequence. 
+# ===============================================================
+page-sequence.attlist =
+  format.attr?,
+  letter-value.attr?,
+  grouping-separator.attr?,
+  grouping-size.attr?,
+  id.attr?,
+  rx-key.attr?,
+  initial-page-number.attr?,
+  force-page-count.attr?,
+  master-reference.attr,
+  inheritable-properties
+
+# ===============================================================
+# Title
+# ===============================================================
+#MEMO: Why 'id' attribute is not allowed here?
+#MEMO: Does it makes sence to add relative-position here? 
+# According to Section 7.12.1. "relative-position" it is allowed everywhere except fo:block-container
+#Should we allow all inline properties here??
+title.attlist = 
+  accessibility-properties,
+  aural-properties-unheritable,
+  border-padding-background-properties,
+  margin-properties-inline,
+  inheritable-properties
+
+# ===============================================================
+# Flows. 'flow-name' feature defines linkage of the flow to a region in the page master.
+# ===============================================================
+flow-properties =
+  id.attr?,
+  rx-key.attr?,
+  flow-name.attr,
+  inheritable-properties
+
+flow.attlist = flow-properties
+static-content.attlist = flow-properties
+
+# ===============================================================
+# An extension element, rx:flow-section.
+# Acts like a top-level block with multiple columns.
+# ===============================================================
+flow-section.attlist =
+    column-count.attr?,
+    column-gap.attr?,
+    border-padding-background-properties,
+    margin-properties-block,
+    inheritable-properties
+
+# ****************************************************************************************
+# Properties used by content-bearing elements
+# ****************************************************************************************
+
+# ===============================================================
+# Properties of block formatting objects.
+# ===============================================================
+# ===============================================================
+# Besides properties used to format the block itself, it also conveys
+# formatting information to its inline-level children.
+# ===============================================================
+block.attlist =
+  block-properties,
+  character-properties-unheritable,
+  text-altitude.attr?, 
+  text-depth.attr?
+
+# ===============================================================
+# Block container
+# ===============================================================
+
+#MEMO: We are forced to create separate element 'absolute-container' in order 
+# to satisfy XSL FO spec requirements. 
+absolute-container.attlist = 
+  absolute-position-properties, 
+  area-properties-unheritable,
+  box-size-properties,
+  common-block-properties,
+  z-index.attr?
+
+# 'Usual' container element
+#MEMO: XSLFO spec prohibits use of 'relative-position' for fo:block-container,
+# but we believe that it should be allowed for non-absolutely positioned containers.
+block-container.attlist =
+  area-properties-unheritable,
+  box-size-properties,
+  block-properties,
+  container-position.attr?,
+  z-index.attr?
+
+# ===============================================================
+# Properties of inline formatting objects.
+# ===============================================================
+# ===============================================================
+# Unicode bidi-override
+# ===============================================================
+#MEMO: This element is 'half-inline' accroding to spec, since it's exhibits the same 
+# bahavior and used in the same context but yet cannot carry some of inline-level
+# properties such as margins and border.
+# We use the same set of properties as for inline here (except for unicode-bidi and
+# width properties) since we believe that this is a typical inline element.
+# Moreover fo:bidi-override is redundant from semantic point of view since it do not 
+# carry any additional information compared to regular fo:inline - just add
+# 'unicode-bidi' to fo:inline and you do not need fo:bidi-override anymore.
+bidi-override.attlist = 
+  inline-properties,
+  unicode-bidi.attr?
+#MEMO: 'Folint' believes that direction property is required for fo:bidi-override,
+# but this is against the spec since this property can be inherited.
+
+# ===============================================================
+# Single character
+# ===============================================================
+character.attlist =
+  character.attr,
+  suppress-at-line-break.attr?,
+  treat-as-word-space.attr?,
+  common-inline-properties
+
+# ===============================================================
+# Initial property set specifies properties for one or more lines
+# ===============================================================
+#MEMO: Spec is contradictory here. It states that use of this object is equivalent to
+# the fo:wrapper around the first line. At the same time spec allows on this element
+# such properties as 'Common Border, Padding, and Background Properties' 
+# - fo:wrapper can't have border/padding/etc and can bear inheritable properties only.
+# We believe that this element should be treated as inline and thus should have
+# appropriate properties set.
+initial-property-set.attlist = 
+  common-inline-properties
+
+# ===============================================================
+# External graphic
+# ===============================================================
+external-graphic.attlist =
+  graphic-properties,
+  src.attr?
+  
+# ===============================================================
+# In-stream graphic
+# ===============================================================
+instream-foreign-object.attlist =
+  graphic-properties
+
+# ===============================================================
+# Inline
+# ===============================================================
+inline.attlist =
+  height-properties,
+  inline-properties
+
+# ===============================================================
+# Inline container
+# ===============================================================
+# FIXME! We believe that this element should not bear not-inheritable properties,
+# which applies to text since it can't have text children.
+# Therefor we do not use 'common-inline-properties' set.
+inline-container.attlist = 
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  aural-properties-unheritable,
+  area-alignment-properties,
+  border-padding-background-properties,
+  keeps-properties-atomic,
+  margin-properties-inline,
+  relative-position-properties,  
+  area-properties-unheritable,
+  box-size-properties,
+  inheritable-properties
+  
+# ===============================================================
+# Leader
+# ===============================================================
+leader.attlist =
+  inline-properties
+
+#MEMO: Note that 'inline-properties' includes block-level inheritable properties.
+# But it's OK in our content-model since it allows block-level descendants wrapped
+# into fo:inline-container.
+# At the same time block-level inheritable properties includes leader properties,
+# since they are inheritable... 
+
+# ===============================================================
+# Page Number
+# ===============================================================
+page-number.attlist =
+  common-inline-properties,
+  wrap-option.attr?
+
+# ===============================================================
+# Page number citation
+# ===============================================================
+page-number-citation.attlist =
+  common-inline-properties,
+  wrap-option.attr?,
+  ref-id.attr
+  
+# ===============================================================
+# Atomic elements for index ranges markup
+# ===============================================================
+begin-index-range.attlist = id.attr, rx-key.attr
+end-index-range.attlist = ref-id.attr
+
+# ===============================================================
+# Page number list - index entry
+# ===============================================================
+page-index.attlist =
+  common-inline-properties,
+  wrap-option.attr?,
+  list-separator.attr?,
+  ref-key.attr?
+#MEMO: There is no 'ref-key' attribute on page-index now, but it is allowed for 
+# backward compatibility.
+#MEMO: Actually it makes sense to exclude id/rx:key fom the set of availabe properties 
+# for 'index-item', however we prefer no to do it just to avoid creation of yet another content
+# model (attribute set) for thid inline element.
+index-item.attlist =
+  common-inline-properties,
+  wrap-option.attr?,
+  ref-key.attr,
+  link-back.attr?,
+  range-separator.attr?,
+  merge-subsequent-page-numbers.attr?
+
+# ===============================================================
+# Properties of table formatting objects.
+# ===============================================================
+# ===============================================================
+# Table & Caption.
+# ===============================================================
+table-and-caption.attlist = 
+  common-block-properties,
+  clear.attr?,
+  relative-position-properties,
+  keeps-and-breaks-properties-atomic
+
+#MEMO: Spec do not allows margins on fo:table-caption that is against common sence 
+# since this is a typical container.
+# We do allow margins (they are included in common-block-properties).
+# 'Folint' does the same.
+table-caption.attlist = 
+  clear.attr?,
+  common-block-properties,
+  relative-position-properties,
+  box-size-properties
+
+table.attlist =
+  clear.attr?,
+  common-block-properties,
+  box-size-properties,
+  keeps-and-breaks-properties-atomic,
+  table-properties-unheritable
+  
+# ===============================================================
+# Table column specifies common properties to ascribe to all
+# cells in a column *or a group of columns*. Note that, if both
+# 'number-columns-repeated' and 'number-columns-spanned' exceed
+# 1, the column counter is increased by 'number-columns-spanned'.
+# it means that you only set properties for columns:
+# 'column-number'
+# 'column-number' + 'number-columns-spanned'
+# 'column-number' + 2 * 'number-columns-spanned'
+# and so on, leaving default properties for intermediate columns.
+# ===============================================================
+table-column.attlist =
+  column-number.attr?,
+  column-width.attr?,
+  number-columns-repeated.attr?,
+  number-columns-spanned.attr?,
+  background-properties,
+#MEMO: Border properties applies to this formatting object only if the value of border-collapse
+# for the table is "collapse" or "collapse-with-precedence" 
+  border-properties,
+  border-precedence-properties,
+  inheritable-properties
+
+# ===============================================================
+# Table header, table footer, and table body.
+# ===============================================================
+row-group.attlist = 
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  aural-properties-unheritable,
+  background-properties,
+#MEMO: Border properties applies to this formatting object only if the value of border-collapse
+# for the table is "collapse" or "collapse-with-precedence" 
+  border-properties,
+  border-precedence-properties,
+  relative-position-properties,
+  inheritable-properties
+
+table-header.attlist = row-group.attlist
+table-footer.attlist = row-group.attlist
+#MEMO: Spec do not list "Keep" properties almong applicable to fo:table-body that is a clear
+# case of  errata.
+table-body.attlist = 
+  row-group.attlist,
+  keeps-and-breaks-properties-atomic
+  
+# ===============================================================
+# Table row.
+# ===============================================================
+#MEMO: Should we create separate collection of properties in 'properties_groups.rnc'
+# based on row-group.attlist?
+table-row.attlist =
+  row-group.attlist,
+  height-properties,
+  keeps-and-breaks-properties-atomic
+
+# ===============================================================
+# Table cell.
+# ===============================================================
+#MEMO: Spec do not allows margins on fo:table-cell but 'Folint' does.
+# We excluded margins from this element and therefor don't use 'common-block-properties'
+#MEMO: Spec do not list "Keep" properties almong applicable to fo:table-cell that is a clear
+# case of  errata.
+table-cell.attlist =
+  id.attr?,
+  rx-key.attr?,
+  column-number.attr?,
+  accessibility-properties,
+  aural-properties-unheritable,
+  border-padding-background-properties,
+  border-precedence-properties,
+  box-size-properties,
+  ends-row.attr?,
+  keeps-and-breaks-properties-atomic,
+  number-columns-spanned.attr?,
+  number-rows-spanned.attr?,
+  starts-row.attr?,
+  inheritable-properties
+  
+# ===============================================================
+# Properties of list formatting objects.
+# ===============================================================  
+# ===============================================================
+# List block.
+# ===============================================================
+list-block.attlist = 
+  clear.attr?,
+  common-block-properties,
+  keeps-and-breaks-properties-atomic,
+  relative-position-properties
+
+# ===============================================================
+# List item.
+# ===============================================================
+list-item.attlist = 
+  common-block-properties,
+  keeps-and-breaks-properties-atomic,
+  relative-position-properties  
+
+# ===============================================================
+# List item label and list item body
+# ===============================================================
+list-item-label.attlist = 
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  inheritable-properties
+
+list-item-body.attlist = 
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  inheritable-properties
+  
+# ===============================================================
+# Floats and footnotes.
+# ===============================================================
+#MEMO: Outlines can't have id and therefor can't have rx:key properties so we are strict here.
+# 'Folint' is loose here - it allows use of these properties.
+#MEMO: We are forced to create two types of floats: side-floats and before-floats.
+side-float.attlist = 
+  side-float.attr?,
+  clear.attr?,
+  inheritable-properties
+# NOTE: before-float can't bear 'clear' property
+before-float.attlist = 
+  before-float.attr?,
+  inheritable-properties
+
+footnote.attlist = 
+  accessibility-properties,
+  inheritable-properties
+
+footnote-body.attlist = 
+  accessibility-properties,
+  inheritable-properties
+
+# ===============================================================
+# Simple link.
+# ===============================================================
+basic-link.attlist =
+  inline-properties,
+  external-destination.attr?,
+  internal-destination.attr?,
+  indicate-destination.attr?,
+  show-destination.attr?,
+  destination-placement-offset.attr?,
+  target-processing-context.attr?,
+  target-presentation-context.attr?,
+  target-stylesheet.attr?
+
+# ===============================================================
+# Wrappers.
+# ===============================================================
+wrapper.attlist =
+  id.attr?,
+  rx-key.attr?,
+  inheritable-properties
+
+# ===============================================================
+# Marker. This element may embrace any content but cannot pass
+# properties to its children; so, it may not have features other
+# than marker-class-name.
+# ===============================================================
+#MEMO: We are more strict here making marker-class-name attribute a mandatory,
+# but marker with no marker-class-name is meaningless.
+marker.attlist = marker-class-name.attr
+
+# ===============================================================
+# Marker retrieval.
+# ===============================================================
+# FIXME! We are more strict here making retrieve-class-name attribute a mandatory, 
+# but marker with no retrieve-class-name is meaningless.
+retrieve-marker.attlist =
+  retrieve-class-name.attr,
+  retrieve-position.attr?,
+  retrieve-boundary.attr?,
+  #MEMO: Is it OK to allow inheritable properties here? There are no explicit arguments
+  # against it in the spec.
+  inheritable-properties
+
+# ===============================================================
+# Multistate stuff.
+# ===============================================================
+# ===============================================================
+# Switch. 
+# ===============================================================
+#MEMO: Should we have Aural Properties here as well?
+multi-switch.attlist =
+  id.attr?,
+  rx-key.attr?,
+  auto-restore.attr?,
+  accessibility-properties,
+  inheritable-properties
+
+# ===============================================================
+# Single case.
+# ===============================================================
+multi-case.attlist =
+  id.attr?,
+  rx-key.attr?,
+  starting-state.attr?,
+  case-name.attr?,
+  case-title.attr?,
+  accessibility-properties,
+  inheritable-properties
+  
+# ===============================================================
+# Toggle. 
+# ===============================================================
+#MEMO: Should we have here inline-level properties only?
+multi-toggle.attlist =
+  switch-to.attr?,
+  accessibility-properties,
+  inheritable-properties
+
+# ===============================================================
+# Multi-properties.
+# ===============================================================
+#Should we allow here any possible properties applicable to the objects inside of the flow?
+multi-properties.attlist = 
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  inheritable-properties
+  
+# ===============================================================
+# Multi property set.
+# ===============================================================
+#Should we allow here any possible properties applicable to the objects inside of the flow?
+multi-property-set.attlist =
+  id.attr?,
+  rx-key.attr?,
+  active-state.attr,
+  inheritable-properties  
diff --git a/xml/relaxng/testData/highlighting/rnc/fo/properties_groups.rnc b/xml/relaxng/testData/highlighting/rnc/fo/properties_groups.rnc
new file mode 100644
index 0000000..dab15a7
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/fo/properties_groups.rnc
@@ -0,0 +1,562 @@
+# =========================================================
+#                                                          
+# (c) 2004, RenderX                                        
+#                                                          
+# Author: Alexander Peshkov <[email protected]>          
+#                                                          
+# Permission is granted to use this document, copy and     
+# modify free of charge, provided that every derived work  
+# bear a reference to the present document.                
+#                                                          
+# This document contains a computer program written in     
+# XSL Transformations Language. It is published with no    
+# warranty of any kind about its usability, as a mere      
+# example of XSL technology. RenderX shall not be          
+# considered liable for any damage or loss of data caused  
+# by use of this program.                                  
+#                                                          
+# =========================================================
+
+namespace local = ""
+default namespace fo = "http://www.w3.org/1999/XSL/Format"
+namespace rx = "http://www.renderx.com/XSL/Extensions"
+
+include "basic_properties.rnc"
+
+# ===============================================================  
+# Properties grouping. Groups used by different elements classes
+# ===============================================================
+
+
+# ===============================================================
+# Entity definitions for common groups of properties
+# This grouping reflects properties co occurrence, rather than
+# property semantics. It does not correspond to grouping in the
+# spec.
+# ===============================================================
+
+# Accessibility Properties
+accessibility-properties =
+  source-document.attr?,
+  role.attr?
+#MEMO: XSLFO is selfcontradictory:
+# Those properties allowed on all inline elements excep to for fo:character, fo:bidi-override and fo:inline-conteiner
+# At the same time spec says about those properties:
+# XSL> It is used by all formatting objects that can be contained in fo:flow or fo:static-content (all formatting
+# XSL> objects that can be directly created from an XML source element).
+# Thus they must be present on fo:character, fo:bidi-override, fo:inline-conteiner as well
+# (there are more elements missing these properties)
+# Note also, that comment in the round brackets seems to be meaningless.
+
+# Relative Position Properties
+# 'position' shorthand property also makes part of this group
+relative-position-properties =
+  relative-position.attr?,
+  relative-position-shorthand.attr? 
+
+# Absolute Position Properties
+absolute-position-properties =
+  absolute-position.attr,
+  absolute-position-shorthand.attr?,
+  top.attr?,
+  right.attr?,
+  bottom.attr?,
+  left.attr?
+  
+# Aural Properties
+# 'cue' and 'pause' shorthand properties are also included
+#MEMO: XSLFO is selfcontradictory here in the same way
+# it is for  Accessibility Properties - Aural properties allowed everywhere
+# but yet not specified on some elements, e.g. fo:block-container or fo:inline-container.
+# We believe this is an omission and therefor those properties are available  everywhere.
+aural-properties-inheritable =
+  azimuth.attr?,
+  elevation.attr?,
+  pitch.attr?,
+  pitch-range.attr?,
+  play-during.attr?,
+  richness.attr?,
+  speak.attr?,
+  speak-header.attr?,
+  speak-numeral.attr?,
+  speak-punctuation.attr?,
+  speech-rate.attr?,
+  stress.attr?,
+  voice-family.attr?,
+  volume.attr?
+aural-properties-unheritable =
+  cue.attr?,
+  cue-after.attr?,
+  cue-before.attr?,
+  pause.attr?,
+  pause-after.attr?,
+  pause-before.attr?
+aural-properties = aural-properties-inheritable, aural-properties-unheritable
+
+# Common Border, Padding, and Background Properties
+# Related shorthand properties are also included
+border-properties = 
+  border.attr?,
+  border-after-color.attr?,
+  border-after-style.attr?,
+  border-after-width.attr?,
+  border-after-width.length.attr?,
+  border-after-width.conditionality.attr?,
+  border-before-color.attr?,
+  border-before-style.attr?,
+  border-before-width.attr?,
+  border-before-width.length.attr?,
+  border-before-width.conditionality.attr?,
+  border-bottom.attr?,
+  border-bottom-color.attr?,
+  border-bottom-style.attr?,
+  border-bottom-width.attr?,
+  border-bottom-width.length.attr?,
+  border-bottom-width.conditionality.attr?,
+  border-color.attr?,
+  border-end-color.attr?,
+  border-end-style.attr?,
+  border-end-width.attr?,
+  border-end-width.length.attr?,
+  border-end-width.conditionality.attr?,
+  border-left.attr?,
+  border-left-color.attr?,
+  border-left-style.attr?,
+  border-left-width.attr?,
+  border-left-width.length.attr?,
+  border-left-width.conditionality.attr?,
+  border-right.attr?,
+  border-right-color.attr?,
+  border-right-style.attr?,
+  border-right-width.attr?,
+  border-right-width.length.attr?,
+  border-right-width.conditionality.attr?,
+  border-start-color.attr?,
+  border-start-style.attr?,
+  border-start-width.attr?,
+  border-start-width.length.attr?,
+  border-start-width.conditionality.attr?,
+  border-style.attr?,
+  border-top.attr?,
+  border-top-color.attr?,
+  border-top-style.attr?,
+  border-top-width.attr?,
+  border-top-width.length.attr?,
+  border-top-width.conditionality.attr?,
+  border-width.attr?
+
+padding-properties = 
+  padding.attr?,
+  padding-after.attr?,
+  padding-after.length.attr?,
+  padding-after.conditionality.attr?,
+  padding-before.attr?,
+  padding-before.length.attr?,
+  padding-before.conditionality.attr?,
+  padding-bottom.attr?,
+  padding-bottom.length.attr?,
+  padding-bottom.conditionality.attr?,
+  padding-end.attr?,
+  padding-end.length.attr?,
+  padding-end.conditionality.attr?,
+  padding-left.attr?,
+  padding-left.length.attr?,
+  padding-left.conditionality.attr?,
+  padding-right.attr?,
+  padding-right.length.attr?,
+  padding-right.conditionality.attr?,
+  padding-start.attr?,
+  padding-start.length.attr?,
+  padding-start.conditionality.attr?,
+  padding-top.attr?,
+  padding-top.length.attr?,
+  padding-top.conditionality.attr?
+
+background-properties =
+  background.attr?,
+  background-attachment.attr?,
+  background-color.attr?,
+  background-image.attr?,
+  background-position.attr?,
+  background-position-vertical.attr?,
+  background-position-horizontal.attr?,
+  background-repeat.attr?,
+  rx-background-content-type.attr?,
+  rx-background-content-height.attr?,
+  rx-background-content-width.attr?,
+  rx-background-scaling.attr?
+
+border-padding-background-properties = 
+  border-properties,
+  padding-properties,
+  background-properties
+
+# Border Precedence Properties for tables
+border-precedence-properties =
+  border-after-precedence.attr?,
+  border-before-precedence.attr?,
+  border-end-precedence.attr?,
+  border-start-precedence.attr?
+
+# Box Size Properties
+height-properties =
+  height.attr?,
+  min-height.attr?,
+  max-height.attr?,
+  block-progression-dimension.attr?,
+  block-progression-dimension.minimum.attr?,
+  block-progression-dimension.optimum.attr?,
+  block-progression-dimension.maximum.attr?
+
+width-properties =
+  width.attr?,
+  min-width.attr?,
+  max-width.attr?,
+  inline-progression-dimension.attr?,
+  inline-progression-dimension.minimum.attr?,
+  inline-progression-dimension.optimum.attr?,
+  inline-progression-dimension.maximum.attr?
+
+box-size-properties =
+  height-properties,
+  width-properties
+
+# Common Area Properties
+area-properties-inheritable =
+  display-align.attr?,
+  reference-orientation.attr?,
+  writing-mode.attr?
+area-properties-unheritable =
+  clip.attr?,
+  overflow.attr?
+area-properties = area-properties-inheritable, area-properties-unheritable
+
+# Common Font Properties
+# 'font' shorthand property is also included
+font-properties =
+  font.attr?,
+  font-selection-strategy.attr?,
+  font-family.attr?,
+  font-size.attr?,
+  font-size-adjust.attr?,
+  font-stretch.attr?,
+  font-style.attr?,
+  font-variant.attr?,
+  font-weight.attr?
+
+# Common Hyphenation Properties - Inline
+# 'xml:lang' shorthand property is also included
+hyphenation-properties-inline =
+  country.attr?,
+  language.attr?,
+  script.attr?,
+  attribute xml:lang { text }?,
+  hyphenate.attr?,
+  hyphenation-character.attr?,
+  hyphenation-push-character-count.attr?,
+  hyphenation-remain-character-count.attr?
+# Common Hyphenation Properties - Block
+hyphenation-properties-block =
+  hyphenation-keep.attr?,
+  hyphenation-ladder-count.attr?
+hyphenation-properties = hyphenation-properties-inline, hyphenation-properties-block
+
+# Common CSS Margin Properties
+# 'margin' shorthand property is also included
+margin-properties-CSS =
+  margin.attr?,
+  margin-bottom.attr?,
+  margin-left.attr?,
+  margin-right.attr?,
+  margin-top.attr?
+
+# Common Margin Properties - Block
+margin-properties-inheritable = 
+  start-indent.attr?,
+  end-indent.attr?
+
+margin-properties-block =
+  margin-properties-CSS,
+  space-after.attr?,
+  space-after.minimum.attr?,
+  space-after.optimum.attr?,
+  space-after.maximum.attr?,
+  space-after.precedence.attr?,
+  space-after.conditionality.attr?,
+  space-before.attr?,
+  space-before.minimum.attr?,
+  space-before.optimum.attr?,
+  space-before.maximum.attr?,
+  space-before.precedence.attr?,
+  space-before.conditionality.attr?
+
+# Common Margin Properties - Inline
+margin-properties-inline =
+  margin-properties-CSS,
+  space-start.attr?,
+  space-start.minimum.attr?,
+  space-start.optimum.attr?,
+  space-start.maximum.attr?,
+  space-start.precedence.attr?,
+  space-start.conditionality.attr?,
+  space-end.attr?,
+  space-end.minimum.attr?,
+  space-end.optimum.attr?,
+  space-end.maximum.attr?,
+  space-end.precedence.attr?,
+  space-end.conditionality.attr?
+
+# Area Alignment Properties
+# 'vertical-align' shorthand is added
+# 'relative-align' - excluded
+area-alignment-properties =
+  alignment-adjust.attr?,
+  alignment-baseline.attr?,
+  baseline-shift.attr?,
+  dominant-baseline.attr?,
+  vertical-align.attr?
+
+# Line Height Properties
+line-height-properties =
+  line-height.attr?,
+  line-height.minimum.attr?,
+  line-height.optimum.attr?,
+  line-height.maximum.attr?,
+  line-height.precedence.attr?,
+  line-height.conditionality.attr?,
+  line-height-shift-adjustment.attr?
+
+# Line Related Properties
+line-related-properties =
+  text-align.attr?,
+  text-align-last.attr?,
+  text-indent.attr?,
+  last-line-end-indent.attr?,
+  line-stacking-strategy.attr?,
+  linefeed-treatment.attr?,
+  white-space.attr?,
+  white-space-treatment.attr?,
+  white-space-collapse.attr?,
+  wrap-option.attr?,
+  direction.attr?
+
+# Character Properties
+character-properties-inheritable =
+  letter-spacing.attr?,
+  letter-spacing.minimum.attr?,
+  letter-spacing.optimum.attr?,
+  letter-spacing.maximum.attr?,
+  letter-spacing.precedence.attr?,
+  letter-spacing.conditionality.attr?,
+  word-spacing.attr?,
+  word-spacing.minimum.attr?,
+  word-spacing.optimum.attr?,
+  word-spacing.maximum.attr?,
+  word-spacing.precedence.attr?,
+  word-spacing.conditionality.attr?,
+  glyph-orientation-horizontal.attr?,
+  glyph-orientation-vertical.attr?,
+  score-spaces.attr?,
+  text-transform.attr?
+character-properties-unheritable=
+#MEMO: There is a problem with these two properties in XSL FO spec.
+# They are assumed to be allowed everywhere but somehow on of them
+# missing on fo:inline, another on fo:leader and both absent on fo:bidi-override.
+# They are not present on fo:block also.
+# We suppose that those omissions are erratic. and allow them on all elements that can cotain text.
+# It makes sence to allow text-decoration on the graphical inlines also.
+  text-decoration.attr?,
+  text-shadow.attr?
+  #NOTE: Those properties apllies to char elements but they are already included into 'inheritable-properties' set
+  #font-properties,
+  #line-height-properties
+character-properties = character-properties-inheritable, character-properties-unheritable
+
+# Common Keeps and Breaks Properties - Atomic objects
+# Keeps only
+keeps-properties-atomic =
+  keep-with-next.attr?,
+  keep-with-next.within-line.attr?,
+  keep-with-next.within-column.attr?,
+  keep-with-next.within-page.attr?,
+  keep-with-previous.attr?,
+  keep-with-previous.within-line.attr?,
+  keep-with-previous.within-column.attr?,
+  keep-with-previous.within-page.attr?
+
+# Common Keeps and Breaks Properties - Atomic objects
+# Keeps and Breaks
+# 'page-break-*' shorthand properties are also included
+keeps-and-breaks-properties-atomic =
+  keeps-properties-atomic,
+  break-after.attr?,
+  break-before.attr?,
+  page-break-after.attr?,
+  page-break-before.attr?
+
+# Common Keeps and Breaks Properties - Inline
+# 'page-break-inside' shorthand property is also included
+keeps-and-breaks-properties-inline-inheritable = 
+  keep-together.attr?,
+  keep-together.within-line.attr?,
+  keep-together.within-column.attr?,
+  keep-together.within-page.attr?,
+  page-break-inside.attr?
+
+#MEMO: Do we really need separate block and inline groups here
+  
+# Common Keeps and Breaks Properties - Block
+keeps-and-breaks-properties-block-inheritable = 
+  orphans.attr?,
+  widows.attr?
+  
+# Leader and Rule Properties
+leader-properties =
+  leader-alignment.attr?,
+  leader-pattern.attr?,
+  leader-pattern-width.attr?,
+  leader-length.attr?,
+  leader-length.minimum.attr?,
+  leader-length.optimum.attr?,
+  leader-length.maximum.attr?,
+  rule-style.attr?,
+  rule-thickness.attr?
+
+# Table Properties
+# 'border-spacing' shorthand property is also included
+# 'inherit' property added to table-omit-...er-at-break
+table-properties-inheritable =
+  border-collapse.attr?,
+  border-spacing.attr?,
+  border-separation.attr?,
+  border-separation.inline-progression-direction.attr?,
+  border-separation.block-progression-direction.attr?,
+  caption-side.attr?,
+  empty-cells.attr?
+table-properties-unheritable =
+  table-layout.attr?,
+  table-omit-header-at-break.attr?,
+  table-omit-footer-at-break.attr?,
+  rx-table-omit-initial-header.attr?
+table-properties = table-properties-inheritable, table-properties-unheritable
+
+# List Properties
+list-properties =
+  provisional-distance-between-starts.attr?,
+  provisional-label-separation.attr?
+
+# Visibility Properties
+# NOTE: 'visibility' is inheritable, but 'z-index' is not.
+visibility-properties = visibility.attr?,  z-index.attr?
+
+# ===============================================================
+# Set of 'explicitly' inheritable properties. This includes attributes
+# marked as inheritable in the spec only!
+# We define two sets of inheritable properties:
+# 1. Basic properties applicable to inline-level elements with character-only content
+# 2. Full set of inheritable properties 
+# ===============================================================
+inheritable-properties-inline = 
+  aural-properties-inheritable,
+  color.attr?,
+  character-properties-inheritable,
+  font-properties,
+  hyphenation-properties-inline,
+  line-height-properties,
+  visibility.attr?
+  
+inheritable-properties-block =
+  table-properties-inheritable,
+  area-properties-inheritable,
+  hyphenation-properties-block,
+  margin-properties-inheritable,
+  intrusion-displace.attr?, 
+  # 'intrusion-displace' applies to: fo:block, fo:block-container, fo:table-and-caption, fo:table, fo:table-caption, fo:list-block, fo:list-item.
+  keeps-and-breaks-properties-inline-inheritable,
+  keeps-and-breaks-properties-block-inheritable,
+  leader-properties,
+  #MEMO: Should we move this one to inheritable-properties-inline?
+  line-related-properties,
+  list-properties,
+  relative-align.attr?  #NOTE: Property 'relative-align' applies to fo:list-item and fo:table-cell only.
+
+inheritable-properties = 
+  inheritable-properties-inline,
+  inheritable-properties-block
+
+# ===============================================================
+# Common property subsets.
+# ===============================================================
+# Common block properties (those properties applies to any type of block-container as well
+common-block-properties =
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  aural-properties-unheritable,
+  border-padding-background-properties,
+  margin-properties-block,
+  inheritable-properties
+
+# Properties for fo:block and fo:block-container
+block-properties =
+  common-block-properties,
+  clear.attr?,
+  span.attr?,
+  keeps-and-breaks-properties-atomic,
+  relative-position-properties
+
+# Common inline properties
+#MEMO: Spec says that text-altitude/text-depth applicable only to
+# fo:block, fo:character, fo:leader, fo:page-number, fo:page-number-citation
+# We believe this is an omission and they must be allowed on all elements
+# that can have text children.
+common-inline-properties =
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  aural-properties-unheritable,
+  area-alignment-properties,
+  border-padding-background-properties,
+  character-properties-unheritable,
+  keeps-properties-atomic,
+  margin-properties-inline,
+  relative-position-properties,
+  text-altitude.attr?,
+  text-depth.attr?,
+  inheritable-properties-inline
+ 
+# Properties for nonempty inline elements
+inline-properties =
+  common-inline-properties,
+  inheritable-properties-block
+  
+# Properties for graphical inline elements
+# NOTE: src attribute exclueded since it's not applicable to fo:instream-foreign-object
+graphic-properties =
+#MEMO: We can replace part of the definition here with 'common-inline-properties' set
+# - it will be formaly rightfil since the only difference made by text-shadow,   text-altitude,
+#  text-depth  and inheritable-properties-inline and both of them are allowed here.
+# At the same time those properties do not make any sense being specified on those
+# elements since they will be never applied.
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  aural-properties,
+  area-properties-unheritable,
+  border-padding-background-properties,
+  margin-properties-inline,
+  relative-position-properties,
+  area-alignment-properties,
+  box-size-properties,  
+  keeps-properties-atomic,
+  line-height-properties,
+  display-align.attr?, 
+  content-type.attr?,
+  content-height.attr?,
+  content-width.attr?,
+  scaling.attr?,
+  scaling-method.attr?,
+  text-align.attr?,
+  text-decoration.attr?
+
+
diff --git a/xml/relaxng/testData/highlighting/rnc/include.rnc b/xml/relaxng/testData/highlighting/rnc/include.rnc
new file mode 100644
index 0000000..3857413
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/include.rnc
@@ -0,0 +1,3 @@
+include "included.rnc"
+
+start = AddressBook
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/include1.rnc b/xml/relaxng/testData/highlighting/rnc/include1.rnc
new file mode 100644
index 0000000..6be67d5
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/include1.rnc
@@ -0,0 +1,2 @@
+
+myelement = element myelement {myattrs}
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/include1_1.rnc b/xml/relaxng/testData/highlighting/rnc/include1_1.rnc
new file mode 100644
index 0000000..38c4964
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/include1_1.rnc
@@ -0,0 +1,2 @@
+
+myattrs =  ( empty )
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/include1_2.rnc b/xml/relaxng/testData/highlighting/rnc/include1_2.rnc
new file mode 100644
index 0000000..d12253b
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/include1_2.rnc
@@ -0,0 +1,3 @@
+
+include "include1_1.rnc"
+include "include1.rnc"
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/included.rnc b/xml/relaxng/testData/highlighting/rnc/included.rnc
new file mode 100644
index 0000000..5b8802c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/included.rnc
@@ -0,0 +1,8 @@
+default namespace = "include.rnc"
+
+grammar {
+  AddressBook = element addressBook { Card* }
+  Card = element card { Name, Email }
+  Name = element name { text }
+  Email = element email { text }
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/missing-attribute.xml b/xml/relaxng/testData/highlighting/rnc/missing-attribute.xml
new file mode 100644
index 0000000..f7c566c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/missing-attribute.xml
@@ -0,0 +1,3 @@
+<addressBook xmlns="urn:test:addressBook">
+  <<error descr="Element card doesn't have required attribute email">card</error> />
+</addressBook>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/missing-content.rnc b/xml/relaxng/testData/highlighting/rnc/missing-content.rnc
new file mode 100644
index 0000000..1b1a9c1
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/missing-content.rnc
@@ -0,0 +1,4 @@
+
+element missing-content {
+
+<error>}</error> 
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/missing-start.rnc b/xml/relaxng/testData/highlighting/rnc/missing-start.rnc
new file mode 100644
index 0000000..cf39ec8
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/missing-start.rnc
@@ -0,0 +1 @@
+<error>include</error> "included.rnc"
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/ns-prefix-keyword.rnc b/xml/relaxng/testData/highlighting/rnc/ns-prefix-keyword.rnc
new file mode 100644
index 0000000..250d62b
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/ns-prefix-keyword.rnc
@@ -0,0 +1,3 @@
+namespace text = "yyy"
+
+element text:foo { text }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/ns-prefix.rnc b/xml/relaxng/testData/highlighting/rnc/ns-prefix.rnc
new file mode 100644
index 0000000..d004e5c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/ns-prefix.rnc
@@ -0,0 +1,3 @@
+namespace xxx = "yyy"
+
+element xxx:foo { text }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/parent-ref.rnc b/xml/relaxng/testData/highlighting/rnc/parent-ref.rnc
new file mode 100644
index 0000000..13befb3
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/parent-ref.rnc
@@ -0,0 +1,9 @@
+grammar {
+  start = foo
+
+  foo = grammar {
+    x = element bar { parent bar }
+  }
+
+  bar = attribute bar.att { text }
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/ref-3.rnc b/xml/relaxng/testData/highlighting/rnc/ref-3.rnc
new file mode 100644
index 0000000..6b8818e
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/ref-3.rnc
@@ -0,0 +1,9 @@
+default namespace = "urn:test:simple.rng"
+
+start = target1
+div {
+  target1 = element a { empty }
+}
+div {
+  target2 = target1
+}
diff --git a/xml/relaxng/testData/highlighting/rnc/rng-schema.rnc b/xml/relaxng/testData/highlighting/rnc/rng-schema.rnc
new file mode 100644
index 0000000..21daad3
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/rng-schema.rnc
@@ -0,0 +1,63 @@
+# RELAX NG XML syntax specified in compact syntax.
+
+default namespace rng = "http://relaxng.org/ns/structure/1.0"
+namespace local = ""
+datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
+
+start = pattern                                                 
+
+pattern =
+  element element { (nameQName | nameClass), (common & pattern+) }
+  | element attribute { (nameQName | nameClass), (common & pattern?) }
+  | element group|interleave|choice|optional
+            |zeroOrMore|oneOrMore|list|mixed { common & pattern+ }
+  | element ref|parentRef { nameNCName, common }
+  | element empty|notAllowed|text { common }
+  | element data { type, param*, (common & exceptPattern?) }
+  | element value { commonAttributes, type?, xsd:string }
+  | element externalRef { href, common }
+  | element grammar { common & grammarContent* }
+
+param = element param { commonAttributes, nameNCName, xsd:string }
+
+exceptPattern = element except { common & pattern+ }
+
+grammarContent =
+  definition
+  | element div { common & grammarContent* }
+  | element include { href, (common & includeContent*) }
+
+includeContent =
+  definition
+  | element div { common & includeContent* }
+
+definition =
+  element start { combine?, (common & pattern+) }
+  | element define { nameNCName, combine?, (common & pattern+) }
+
+combine = attribute combine { "choice" | "interleave" }
+
+nameClass =
+  element name { commonAttributes, xsd:QName }
+  | element anyName { common & exceptNameClass? }
+  | element nsName { common & exceptNameClass? }
+  | element choice { common & nameClass+ }
+
+exceptNameClass = element except { common & nameClass+ }
+
+nameQName = attribute name { xsd:QName }
+nameNCName = attribute name { xsd:NCName }
+href = attribute href { xsd:anyURI }
+type = attribute type { xsd:NCName }
+
+common = commonAttributes, foreignElement*
+
+commonAttributes =
+  attribute ns { xsd:string }?,
+  attribute datatypeLibrary { xsd:anyURI }?,
+  foreignAttribute*
+
+foreignElement = element * - rng:* { (anyAttribute | text | anyElement)* }
+foreignAttribute = attribute * - (rng:*|local:*) { text }
+anyElement = element * { (anyAttribute | text | anyElement)* }
+anyAttribute = attribute * { text }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/suppressed-unused-define.rnc b/xml/relaxng/testData/highlighting/rnc/suppressed-unused-define.rnc
new file mode 100644
index 0000000..67b25ab
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/suppressed-unused-define.rnc
@@ -0,0 +1,5 @@
+
+start = element foo { empty }
+
+#suppress UnusedDefine
+foo = element bar { empty }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/undefined-ref-ok.rnc b/xml/relaxng/testData/highlighting/rnc/undefined-ref-ok.rnc
new file mode 100644
index 0000000..67a372d
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/undefined-ref-ok.rnc
@@ -0,0 +1,4 @@
+# the display of "unresolved pattern" errors from the external parser is
+# intentionally disabled - the internal validator is a) just as smart and
+# b) knows about backward includes
+start = doesntexist
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/undefined-ref.rnc b/xml/relaxng/testData/highlighting/rnc/undefined-ref.rnc
new file mode 100644
index 0000000..785956e
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/undefined-ref.rnc
@@ -0,0 +1,2 @@
+
+start = <error>doesntexist</error>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/unresolved-datatype-prefix-1.rnc b/xml/relaxng/testData/highlighting/rnc/unresolved-datatype-prefix-1.rnc
new file mode 100644
index 0000000..05ec22c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/unresolved-datatype-prefix-1.rnc
@@ -0,0 +1 @@
+element foo { <error>xxx</error>:string }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/unresolved-datatype-prefix-2.rnc b/xml/relaxng/testData/highlighting/rnc/unresolved-datatype-prefix-2.rnc
new file mode 100644
index 0000000..8740f00
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/unresolved-datatype-prefix-2.rnc
@@ -0,0 +1,3 @@
+namespace xxx = "yyy"
+
+element foo { <error>xxx</error>:string }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/unresolved-include.rnc b/xml/relaxng/testData/highlighting/rnc/unresolved-include.rnc
new file mode 100644
index 0000000..0534fa6
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/unresolved-include.rnc
@@ -0,0 +1,2 @@
+
+include "<error>doesntexist.rnc</error>"
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/unresolved-ns-prefix-1.rnc b/xml/relaxng/testData/highlighting/rnc/unresolved-ns-prefix-1.rnc
new file mode 100644
index 0000000..9ced39c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/unresolved-ns-prefix-1.rnc
@@ -0,0 +1 @@
+element <error>xxx</error>:foo { text }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/unresolved-ns-prefix-2.rnc b/xml/relaxng/testData/highlighting/rnc/unresolved-ns-prefix-2.rnc
new file mode 100644
index 0000000..a5f1b63
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/unresolved-ns-prefix-2.rnc
@@ -0,0 +1,3 @@
+datatypes xxx = "yyy"
+
+element <error>xxx</error>:foo { text }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/unresolved-ns-prefix-3.rnc b/xml/relaxng/testData/highlighting/rnc/unresolved-ns-prefix-3.rnc
new file mode 100644
index 0000000..6d29e36
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/unresolved-ns-prefix-3.rnc
@@ -0,0 +1,9 @@
+namespace a = "http://www.example.com/annotation"
+
+element addressBook {
+  [ <error>b</error>:documentation [ xml:lang="en" "Information about a single address." ] ]
+  element card {
+    element name { text },
+    element email { text }
+  }*
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/unused-define.rnc b/xml/relaxng/testData/highlighting/rnc/unused-define.rnc
new file mode 100644
index 0000000..b10778c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/unused-define.rnc
@@ -0,0 +1,4 @@
+
+start = element foo { empty }
+
+<warning>foo</warning> = element bar { empty }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/used-define.rnc b/xml/relaxng/testData/highlighting/rnc/used-define.rnc
new file mode 100644
index 0000000..8c3ccf7
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/used-define.rnc
@@ -0,0 +1,4 @@
+
+start = foo
+
+foo = element bar { empty }
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/valid-rnc-include.xml b/xml/relaxng/testData/highlighting/rnc/valid-rnc-include.xml
new file mode 100644
index 0000000..de55b73
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/valid-rnc-include.xml
@@ -0,0 +1,6 @@
+<addressBook xmlns="include.rnc">
+  <card>
+    <name>x</name>
+    <email>y</email>
+  </card>
+</addressBook>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rnc/valid-rnc.xml b/xml/relaxng/testData/highlighting/rnc/valid-rnc.xml
new file mode 100644
index 0000000..29565d6
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rnc/valid-rnc.xml
@@ -0,0 +1,3 @@
+<addressBook xmlns="urn:test:addressBook">
+  <card email="[email protected]" name="bar" />
+</addressBook>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/backward-file1.rng b/xml/relaxng/testData/highlighting/rng/backward-file1.rng
new file mode 100644
index 0000000..b1ef93f
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/backward-file1.rng
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <include href="backward-included.rng"/>
+
+  <start>
+    <element name="root">
+      <ref name="child1"/>
+      <ref name="bar"/>
+    </element>
+  </start>
+
+  <define name="child1">
+    <element name="root-child1">
+      <data type="string"/>
+    </element>
+  </define>
+
+</grammar>
diff --git a/xml/relaxng/testData/highlighting/rng/backward-include-def.rng b/xml/relaxng/testData/highlighting/rng/backward-include-def.rng
new file mode 100644
index 0000000..fb64e3a
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/backward-include-def.rng
@@ -0,0 +1,20 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="backward-include-def.rng">
+
+  <include href="backward-include-ref.rng" />
+
+  <start>
+    <element name="t">
+      <ref name="foo" />
+    </element>
+  </start>
+
+  <define name="foo">
+    <element name="foo">
+      <ref name="backward" />
+    </element>
+  </define>
+
+  <define name="backward">
+    <element name="x"><empty /></element>
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/backward-include-ref.rng b/xml/relaxng/testData/highlighting/rng/backward-include-ref.rng
new file mode 100644
index 0000000..d313c8b
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/backward-include-ref.rng
@@ -0,0 +1,8 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="backward-include-def.rng">
+
+  <define name="foo" combine="choice">
+    <element name="bar">
+      <ref name="backward" />
+    </element>
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/backward-included.rng b/xml/relaxng/testData/highlighting/rng/backward-included.rng
new file mode 100644
index 0000000..2b6336f
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/backward-included.rng
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <define name="bar">
+    <element name="bar">
+      <data type="string"/>
+    </element>
+  </define>
+</grammar>
diff --git a/xml/relaxng/testData/highlighting/rng/backward-with-include.rng b/xml/relaxng/testData/highlighting/rng/backward-with-include.rng
new file mode 100644
index 0000000..0c7f55a
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/backward-with-include.rng
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <include href="backward-included.rng"/>
+
+  <start>
+    <element name="root">
+      <ref name="<error>child1</error>"/>
+    </element>
+  </start>
+
+</grammar>
diff --git a/xml/relaxng/testData/highlighting/rng/bad-element.rng b/xml/relaxng/testData/highlighting/rng/bad-element.rng
new file mode 100644
index 0000000..798c723
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/bad-element.rng
@@ -0,0 +1,6 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <start>
+    <<error>element</error>>
+    </<error>element</error>>
+  </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/bad-include.rng b/xml/relaxng/testData/highlighting/rng/bad-include.rng
new file mode 100644
index 0000000..db6f4d2
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/bad-include.rng
@@ -0,0 +1,8 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <include href="<error>does-not-exist.rng</error>" />
+
+  <start>
+    <element name="foo"><empty /></element>
+  </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/bad-ns-prefix.rng b/xml/relaxng/testData/highlighting/rng/bad-ns-prefix.rng
new file mode 100644
index 0000000..dbbf6b6
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/bad-ns-prefix.rng
@@ -0,0 +1,5 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <start>
+    <element name="<error>x</error>:foo"><empty /></element>
+  </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/bad-parent-ref-1.rng b/xml/relaxng/testData/highlighting/rng/bad-parent-ref-1.rng
new file mode 100644
index 0000000..c713ae3
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/bad-parent-ref-1.rng
@@ -0,0 +1,24 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <start>
+    <ref name="target1" />
+  </start>
+
+  <define name="target1">
+    <grammar>
+      <start>
+        <ref name="foo" />
+      </start>
+
+      <define name="foo">
+        <element name="foo">
+          <empty />
+          <parentRef name="<error>outer</error>" />
+        </element>
+      </define>
+
+      <define name="outer">
+        <element name="foo"><empty /></element>
+      </define>
+    </grammar>
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/bad-parent-ref-2.rng b/xml/relaxng/testData/highlighting/rng/bad-parent-ref-2.rng
new file mode 100644
index 0000000..8c81026
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/bad-parent-ref-2.rng
@@ -0,0 +1,17 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <start>
+    <ref name="target2" />
+  </start>
+
+  <include href="bad-parent-ref-1.rng">
+    <define name="target1">
+      <parentRef name="<error>target2</error>" />
+    </define>
+  </include>
+
+  <define name="target2">
+    <element name="foo">
+      <empty />
+    </element>
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/bad-ref-2.rng b/xml/relaxng/testData/highlighting/rng/bad-ref-2.rng
new file mode 100644
index 0000000..f981f3c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/bad-ref-2.rng
@@ -0,0 +1,16 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <start>
+    <ref name="target1" />
+  </start>
+
+  <define name="target1">
+    <grammar>
+        <start>
+            <ref name="<error>inner</error>" />
+        </start>
+    </grammar>
+  </define>
+
+  <define name="inner" />
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/bad-ref-3.rng b/xml/relaxng/testData/highlighting/rng/bad-ref-3.rng
new file mode 100644
index 0000000..d2732a7
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/bad-ref-3.rng
@@ -0,0 +1,12 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <start>
+    <ref name="<error>inner</error>" />
+  </start>
+
+  <define name="target1">
+    <grammar>
+      <define name="inner" />
+    </grammar>
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/bad-ref-4.rng b/xml/relaxng/testData/highlighting/rng/bad-ref-4.rng
new file mode 100644
index 0000000..cab3b58
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/bad-ref-4.rng
@@ -0,0 +1,14 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <start>
+    <interleave>
+      <ref name="<error>unresolved</error>"/>
+    </interleave>
+  </start>
+
+  <define name="interleave-ref">
+    <interleave>
+      <ref name="<error>unresolved</error>"/>
+    </interleave>
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/bad-ref.rng b/xml/relaxng/testData/highlighting/rng/bad-ref.rng
new file mode 100644
index 0000000..aca6df0
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/bad-ref.rng
@@ -0,0 +1,5 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <start>
+    <ref name="<error>undefined</error>" />
+  </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/create-definition-1.rng b/xml/relaxng/testData/highlighting/rng/create-definition-1.rng
new file mode 100644
index 0000000..8d3717c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/create-definition-1.rng
@@ -0,0 +1,6 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+    <start>
+        <ref name="<caret>unresolved" />
+    </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/create-definition-1_after.rng b/xml/relaxng/testData/highlighting/rng/create-definition-1_after.rng
new file mode 100644
index 0000000..07cea72
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/create-definition-1_after.rng
@@ -0,0 +1,9 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+    <start>
+        <ref name="unresolved" />
+    </start>
+    <define name="unresolved">
+
+    </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/create-definition-2.rng b/xml/relaxng/testData/highlighting/rng/create-definition-2.rng
new file mode 100644
index 0000000..ee52a3b
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/create-definition-2.rng
@@ -0,0 +1,9 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+    <define name="foo">
+      <grammar>
+          <start>
+              <parentRef name="<caret>unresolved" />
+          </start>
+      </grammar>
+    </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/create-definition-2_after.rng b/xml/relaxng/testData/highlighting/rng/create-definition-2_after.rng
new file mode 100644
index 0000000..07a59d3
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/create-definition-2_after.rng
@@ -0,0 +1,12 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+    <define name="foo">
+      <grammar>
+          <start>
+              <parentRef name="unresolved" />
+          </start>
+      </grammar>
+    </define>
+    <define name="unresolved">
+
+    </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/good-external-ref.rng b/xml/relaxng/testData/highlighting/rng/good-external-ref.rng
new file mode 100644
index 0000000..364ce91
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/good-external-ref.rng
@@ -0,0 +1,11 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <start>
+    <ref name="start" />
+  </start>
+
+  <define name="start">
+    <externalRef href="include.rng" />
+
+    <ref name="start" />
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/good-include-ref-1.rng b/xml/relaxng/testData/highlighting/rng/good-include-ref-1.rng
new file mode 100644
index 0000000..637c30c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/good-include-ref-1.rng
@@ -0,0 +1,8 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <include href="include.rng" />
+
+  <start>
+    <ref name="included" />
+  </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/good-include.rng b/xml/relaxng/testData/highlighting/rng/good-include.rng
new file mode 100644
index 0000000..d25b1e5
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/good-include.rng
@@ -0,0 +1,8 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <include href="include.rng" />
+
+  <start>
+    <element name="foo"><empty /></element>
+  </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/include.rng b/xml/relaxng/testData/highlighting/rng/include.rng
new file mode 100644
index 0000000..c983a93
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/include.rng
@@ -0,0 +1,4 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <define name="included">
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/included-grammar.rng b/xml/relaxng/testData/highlighting/rng/included-grammar.rng
new file mode 100644
index 0000000..d33487e
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/included-grammar.rng
@@ -0,0 +1,6 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <define name="foo">
+    <element name="foo"><empty /></element>
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/including-grammar.rng b/xml/relaxng/testData/highlighting/rng/including-grammar.rng
new file mode 100644
index 0000000..63cae9c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/including-grammar.rng
@@ -0,0 +1,8 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <include href="included-grammar.rng" />
+
+  <start>
+    <ref name="foo" />
+  </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/missing-start-element-and-include.rng b/xml/relaxng/testData/highlighting/rng/missing-start-element-and-include.rng
new file mode 100644
index 0000000..ee0c49d2
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/missing-start-element-and-include.rng
@@ -0,0 +1,8 @@
+<<error>grammar</error> xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <include href="included-grammar.rng" />
+
+  <define name="foo" combine="choice">
+    <element name="foo"><empty /></element>
+  </define>
+</<error>grammar</error>>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/missing-start-element.rng b/xml/relaxng/testData/highlighting/rng/missing-start-element.rng
new file mode 100644
index 0000000..7347c49
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/missing-start-element.rng
@@ -0,0 +1,6 @@
+<<error>grammar</error> xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <define name="foo">
+    <element name="foo"><empty /></element>
+  </define>
+</<error>grammar</error>>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/parent-ref-1.rng b/xml/relaxng/testData/highlighting/rng/parent-ref-1.rng
new file mode 100644
index 0000000..6371d8a
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/parent-ref-1.rng
@@ -0,0 +1,12 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <define name="outer" />
+
+  <define name="target1">
+    <grammar>
+      <define name="foo">
+        <parentRef name="outer" />
+      </define>
+    </grammar>
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/parent-ref-2.rng b/xml/relaxng/testData/highlighting/rng/parent-ref-2.rng
new file mode 100644
index 0000000..6de4c7a
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/parent-ref-2.rng
@@ -0,0 +1,14 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <include href="include.rng" />
+
+  <define name="target1">
+    <grammar>
+      <include href="include.rng">
+        <define name="included">
+          <parentRef name="included" />
+        </define>
+      </include>
+    </grammar>
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/ref-1.rng b/xml/relaxng/testData/highlighting/rng/ref-1.rng
new file mode 100644
index 0000000..4c5e679e
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/ref-1.rng
@@ -0,0 +1,12 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <start>
+    <ref name="target1" />
+    <ref name="target2" />
+  </start>
+
+  <define name="target1" />
+
+  <div>
+    <define name="target2" />
+  </div>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/ref-2.rng b/xml/relaxng/testData/highlighting/rng/ref-2.rng
new file mode 100644
index 0000000..f9428ab
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/ref-2.rng
@@ -0,0 +1,32 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <start>
+    <ref name="target1" />
+  </start>
+
+  <define name="target1">
+    <grammar>
+        <start>
+            <ref name="inner" />
+        </start>
+
+        <define name="inner">
+            <element name="a"><empty /></element>
+        </define>
+    </grammar>
+  </define>
+
+  <div>
+    <define name="target2">
+      <grammar>
+          <start>
+              <ref name="inner" />
+          </start>
+
+          <define name="inner">
+              <element name="a"><empty /></element>
+          </define>
+      </grammar>
+    </define>
+  </div>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/ref-3.rng b/xml/relaxng/testData/highlighting/rng/ref-3.rng
new file mode 100644
index 0000000..c2ff4cb
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/ref-3.rng
@@ -0,0 +1,18 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <start>
+    <ref name="target1" />
+  </start>
+
+  <div>
+    <define name="target1">
+      <element name="a"><empty /></element>
+    </define>
+  </div>
+
+  <div>
+    <define name="target2">
+      <ref name="target1" />
+    </define>
+  </div>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/resolve-include-ref-1.rng b/xml/relaxng/testData/highlighting/rng/resolve-include-ref-1.rng
new file mode 100644
index 0000000..d2a17542
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/resolve-include-ref-1.rng
@@ -0,0 +1,8 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <include href="include.rng" />
+
+  <start>
+    <ref name="<caret>included" />
+  </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/resolve-include-ref-2.rng b/xml/relaxng/testData/highlighting/rng/resolve-include-ref-2.rng
new file mode 100644
index 0000000..83c97ff
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/resolve-include-ref-2.rng
@@ -0,0 +1,12 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <include href="include.rng">
+    <define name="included">
+      <element name="foo"><empty /></element>
+    </define>
+  </include>
+
+  <start>
+    <ref name="<caret>included" />
+  </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/simple.rng b/xml/relaxng/testData/highlighting/rng/simple.rng
new file mode 100644
index 0000000..6b10d6f
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/simple.rng
@@ -0,0 +1,88 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <start>
+    <choice>
+      <element name="simple-element">
+        <ref name="simple-element" />
+      </element>
+      <element name="optional-element">
+        <ref name="optional-element" />
+      </element>
+      <element name="simple-attribute">
+        <ref name="simple-attribute" />
+      </element>
+      <element name="optional-attribute">
+        <ref name="optional-attribute" />
+      </element>
+      <element name="fixed-attribute">
+        <ref name="fixed-attribute" />
+      </element>
+      <element name="attribute-choice">
+        <ref name="attribute-choice" />
+      </element>
+      <element name="value-choice">
+        <ref name="value-choice" />
+      </element>
+    </choice>
+  </start>
+
+  <define name="attribute-choice">
+    <choice>
+      <group>
+        <attribute name="type">
+          <value>a</value>
+        </attribute>
+        <element name="a"><empty /></element>
+      </group>
+      <group>
+        <attribute name="type">
+          <value>b</value>
+        </attribute>
+        <element name="b"><empty /></element>
+      </group>
+    </choice>
+  </define>
+
+  <define name="simple-element">
+    <element name="b">
+      <empty />
+    </element>
+  </define>
+
+  <define name="optional-element">
+    <element name="b">
+      <optional>
+        <element name="c">
+          <empty />
+        </element>
+      </optional>
+    </element>
+  </define>
+
+  <define name="simple-attribute">
+    <attribute name="x" />
+  </define>
+
+  <define name="optional-attribute">
+    <optional>
+      <attribute name="x" />
+    </optional>
+  </define>
+
+  <define name="fixed-attribute">
+    <attribute name="x">
+      <value>1.0</value>
+    </attribute>
+  </define>
+
+  <define name="value-choice">
+    <attribute name="x">
+      <choice>
+        <choice>
+          <value>a</value>
+          <value>b</value>
+        </choice>
+      </choice>
+    </attribute>
+  </define>
+
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/unused-define-1.rng b/xml/relaxng/testData/highlighting/rng/unused-define-1.rng
new file mode 100644
index 0000000..aa2920c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/unused-define-1.rng
@@ -0,0 +1,3 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <define name=<warning>"foo"</warning> />
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/unused-define-2.rng b/xml/relaxng/testData/highlighting/rng/unused-define-2.rng
new file mode 100644
index 0000000..2cc3451
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/unused-define-2.rng
@@ -0,0 +1,5 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <define name=<warning>"foo"</warning>>
+    <ref name="foo" />
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/used-define-1.rng b/xml/relaxng/testData/highlighting/rng/used-define-1.rng
new file mode 100644
index 0000000..668ed0b
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/used-define-1.rng
@@ -0,0 +1,6 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <start>
+    <ref name="foo" />
+  </start>
+  <define name="foo" />
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/used-define-2.rng b/xml/relaxng/testData/highlighting/rng/used-define-2.rng
new file mode 100644
index 0000000..d6851f1
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/used-define-2.rng
@@ -0,0 +1,8 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <start>
+    <ref name="foo" />
+  </start>
+
+  <define name="foo" />
+  <define name="foo" combine="choice"/>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/used-define-3-include.rng b/xml/relaxng/testData/highlighting/rng/used-define-3-include.rng
new file mode 100644
index 0000000..69807d7
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/used-define-3-include.rng
@@ -0,0 +1,4 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+
+  <define name="foo" />
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/rng/used-define-3.rng b/xml/relaxng/testData/highlighting/rng/used-define-3.rng
new file mode 100644
index 0000000..6d2e2b6
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/rng/used-define-3.rng
@@ -0,0 +1,7 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <include href="used-define-3-include.rng" />
+
+  <start>
+    <ref name="foo" />
+  </start>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/simple-attribute_1.xml b/xml/relaxng/testData/highlighting/simple-attribute_1.xml
new file mode 100644
index 0000000..5c97b08
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/simple-attribute_1.xml
@@ -0,0 +1,2 @@
+<simple-attribute xmlns="urn:test:simple.rng" x="abc" <error>y</error>="abc">
+</simple-attribute>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/simple-attribute_2.xml b/xml/relaxng/testData/highlighting/simple-attribute_2.xml
new file mode 100644
index 0000000..af6d9cc
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/simple-attribute_2.xml
@@ -0,0 +1,2 @@
+<<error>simple-attribute</error> xmlns="urn:test:simple.rng">
+</<error>simple-attribute</error>>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/simple-element_1.xml b/xml/relaxng/testData/highlighting/simple-element_1.xml
new file mode 100644
index 0000000..f7e431c
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/simple-element_1.xml
@@ -0,0 +1,5 @@
+<simple-element xmlns="urn:test:simple.rng">
+  <b>
+    <<error>c</error> />
+  </b>
+</simple-element>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/simple.rng b/xml/relaxng/testData/highlighting/simple.rng
new file mode 100644
index 0000000..ded1e7e
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/simple.rng
@@ -0,0 +1,99 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <start>
+    <choice>
+      <element name="simple-element">
+        <ref name="simple-element" />
+      </element>
+      <element name="optional-element">
+        <ref name="optional-element" />
+      </element>
+      <element name="simple-attribute">
+        <ref name="simple-attribute" />
+      </element>
+      <element name="optional-attribute">
+        <ref name="optional-attribute" />
+      </element>
+      <element name="fixed-attribute">
+        <ref name="fixed-attribute" />
+      </element>
+      <element name="attribute-choice">
+        <ref name="attribute-choice" />
+      </element>
+      <element name="value-choice">
+        <ref name="value-choice" />
+      </element>
+      <element name="token-datatype">
+        <ref name="token-datatype" />
+      </element>
+    </choice>
+  </start>
+
+  <define name="attribute-choice">
+    <choice>
+      <group>
+        <attribute name="type">
+          <value>a</value>
+        </attribute>
+        <element name="a"><empty /></element>
+      </group>
+      <group>
+        <attribute name="type">
+          <value>b</value>
+        </attribute>
+        <element name="b"><empty /></element>
+      </group>
+    </choice>
+  </define>
+
+  <define name="simple-element">
+    <element name="b">
+      <empty />
+    </element>
+  </define>
+
+  <define name="optional-element">
+    <element name="b">
+      <optional>
+        <element name="c">
+          <empty />
+        </element>
+      </optional>
+    </element>
+  </define>
+
+  <define name="simple-attribute">
+    <attribute name="x" />
+  </define>
+
+  <define name="optional-attribute">
+    <optional>
+      <attribute name="x" />
+    </optional>
+  </define>
+
+  <define name="fixed-attribute">
+    <attribute name="x">
+      <value>1.0</value>
+    </attribute>
+  </define>
+
+  <define name="value-choice">
+    <attribute name="x">
+      <choice>
+        <choice>
+          <value>a</value>
+          <value>b</value>
+        </choice>
+      </choice>
+    </attribute>
+  </define>
+
+  <define name="token-datatype">
+    <attribute name="a"><value>v</value></attribute>
+    <attribute name="b"><value>v</value></attribute>
+    <attribute name="c"><value>x y</value></attribute>
+    <attribute name="s1"><value type="string">v</value></attribute>
+    <attribute name="s2"><value type="string"> v </value></attribute>
+    <attribute name="s3"><value type="string">v</value></attribute>
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/token-datatype.xml b/xml/relaxng/testData/highlighting/token-datatype.xml
new file mode 100644
index 0000000..d6e508e
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/token-datatype.xml
@@ -0,0 +1,4 @@
+<token-datatype xmlns="urn:test:simple.rng"
+                a=" v " b="v" c=" x   y " 
+                s1="v"  s2=" v "
+                s3=<error>"  v  "</error> />
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/value-choice-1.xml b/xml/relaxng/testData/highlighting/value-choice-1.xml
new file mode 100644
index 0000000..090a85f
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/value-choice-1.xml
@@ -0,0 +1,2 @@
+<value-choice xmlns="urn:test:simple.rng" x="a">
+</value-choice>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/value-choice-2.xml b/xml/relaxng/testData/highlighting/value-choice-2.xml
new file mode 100644
index 0000000..8b026fe
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/value-choice-2.xml
@@ -0,0 +1,2 @@
+<value-choice xmlns="urn:test:simple.rng" x=<error>"c"</error>>
+</value-choice>
\ No newline at end of file
diff --git a/xml/relaxng/testData/highlighting/xslt.rng b/xml/relaxng/testData/highlighting/xslt.rng
new file mode 100644
index 0000000..0246a5a
--- /dev/null
+++ b/xml/relaxng/testData/highlighting/xslt.rng
@@ -0,0 +1,895 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- This was mostly generated from the syntax summary in the XSLT
+     Recommendation (using XSLT of course). -->
+<!-- Issues: this validates extension elements as literal result
+     elements, which is overly restrictive. -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+         ns="http://www.w3.org/1999/XSL/Transform"
+         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+   <start>
+      <choice>
+         <ref name="stylesheet.element"/>
+         <ref name="transform.element"/>
+         <ref name="literal-result-element-as-stylesheet"/>
+      </choice>
+   </start>
+   <define name="version">
+      <value>1.0</value>
+   </define>
+   <define name="top-level-elements.model">
+      <zeroOrMore>
+         <choice>
+            <ref name="top-level-element.category"/>
+            <ref name="top-level-extension"/>
+         </choice>
+      </zeroOrMore>
+   </define>
+   <define name="top-level-extension">
+      <element>
+         <anyName>
+            <except>
+               <nsName/>
+               <nsName ns=""/>
+            </except>
+         </anyName>
+         <grammar>
+            <start>
+              <ref name="any"/>
+            </start>
+            <define name="any">
+	       <zeroOrMore>
+		  <choice>
+		     <attribute>
+			<anyName/>
+		     </attribute>
+		     <text/>
+		     <element>
+			<anyName/>
+			<ref name="any"/>
+		     </element>
+		  </choice>
+	       </zeroOrMore>
+            </define>
+         </grammar>
+      </element>
+   </define>
+   <define name="template.model">
+      <zeroOrMore>
+         <choice>
+            <ref name="instruction.category"/>
+            <ref name="literal-result-element"/>
+            <text/>
+         </choice>
+      </zeroOrMore>
+   </define>
+   <define name="literal-result-element-as-stylesheet">
+      <element>
+         <anyName>
+            <except>
+               <nsName/>
+            </except>
+         </anyName>
+         <attribute>
+            <name>version</name>
+            <ref name="version"/>
+         </attribute>
+         <ref name="literal-result-element-no-version.atts"/>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="literal-result-element">
+      <element>
+         <anyName>
+            <except>
+               <nsName/>
+            </except>
+         </anyName>
+         <ref name="literal-result-element.atts"/>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="literal-result-element.atts">
+      <ref name="literal-result-element-no-version.atts"/>
+      <optional>
+	 <attribute>
+	    <name>version</name>
+	    <ref name="version"/>
+	 </attribute>
+      </optional>
+   </define>
+   <define name="literal-result-element-no-version.atts">
+      <zeroOrMore>
+         <choice>
+            <attribute>
+	       <anyName>
+		  <except>
+		     <nsName/>
+		  </except>
+	       </anyName>
+               <ref name="avt.datatype"/>
+            </attribute>
+            <attribute>
+               <name>extension-element-prefixes</name>
+               <ref name="prefixes.datatype"/>
+	    </attribute>
+            <attribute>
+               <name>exclude-result-prefixes</name>
+               <ref name="prefixes.datatype"/>
+	    </attribute>
+            <attribute>
+               <name>use-attribute-sets</name>
+               <ref name="qnames.datatype"/>
+            </attribute>
+         </choice>
+      </zeroOrMore>
+   </define>
+   <define name="top-level-element.category">
+      <choice>
+         <ref name="include.element"/>
+         <ref name="strip-space.element"/>
+         <ref name="preserve-space.element"/>
+         <ref name="template.element"/>
+         <ref name="namespace-alias.element"/>
+         <ref name="attribute-set.element"/>
+         <ref name="variable.element"/>
+         <ref name="param.element"/>
+         <ref name="key.element"/>
+         <ref name="decimal-format.element"/>
+         <ref name="output.element"/>
+      </choice>
+   </define>
+   <define name="instruction.category">
+      <choice>
+         <ref name="apply-templates.element"/>
+         <ref name="apply-imports.element"/>
+         <ref name="call-template.element"/>
+         <ref name="element.element"/>
+         <ref name="attribute.element"/>
+         <ref name="text.element"/>
+         <ref name="processing-instruction.element"/>
+         <ref name="comment.element"/>
+         <ref name="copy.element"/>
+         <ref name="value-of.element"/>
+         <ref name="number.element"/>
+         <ref name="for-each.element"/>
+         <ref name="if.element"/>
+         <ref name="choose.element"/>
+         <ref name="variable.element"/>
+         <ref name="copy-of.element"/>
+         <ref name="message.element"/>
+         <ref name="fallback.element"/>
+      </choice>
+   </define>
+   <define name="extension.atts">
+      <zeroOrMore>
+         <attribute>
+            <anyName>
+               <except>
+                  <nsName/>
+                  <nsName ns=""/>
+               </except>
+            </anyName>
+         </attribute>
+      </zeroOrMore>
+   </define>
+   <define name="stylesheet.element">
+      <element name="stylesheet">
+         <ref name="stylesheet.model"/>
+      </element>
+   </define>
+   <define name="transform.element">
+      <element name="transform">
+         <ref name="stylesheet.model"/>
+      </element>
+   </define>
+   <define name="stylesheet.model">
+      <ref name="extension.atts"/>
+      <optional>
+	 <attribute name="id">
+	    <data type="NCName"/>
+	 </attribute>
+      </optional>
+      <optional>
+	 <attribute name="extension-element-prefixes">
+            <ref name="prefixes.datatype"/>
+	 </attribute>
+      </optional>
+      <optional>
+	 <attribute name="exclude-result-prefixes">
+            <ref name="prefixes.datatype"/>
+	 </attribute>
+      </optional>
+      <attribute name="version">
+	 <ref name="version"/>
+      </attribute>
+      <group>
+	 <zeroOrMore>
+	    <ref name="import.element"/>
+	 </zeroOrMore>
+	 <ref name="top-level-elements.model"/>
+      </group>
+   </define>
+   <define name="include.element">
+      <element name="include">
+         <ref name="extension.atts"/>
+         <attribute name="href">
+            <data type="anyURI"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="import.element">
+      <element name="import">
+         <ref name="extension.atts"/>
+         <attribute name="href">
+            <data type="anyURI"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="strip-space.element">
+      <element name="strip-space">
+         <ref name="extension.atts"/>
+         <attribute name="elements">
+            <ref name="wildcards.datatype"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="preserve-space.element">
+      <element name="preserve-space">
+         <ref name="extension.atts"/>
+         <attribute name="elements">
+            <ref name="wildcards.datatype"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="template.element">
+      <element name="template">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="match">
+               <ref name="pattern.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="name">
+               <ref name="qname.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="priority">
+               <ref name="number.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="mode">
+               <ref name="qname.datatype"/>
+            </attribute>
+         </optional>
+         <group>
+            <zeroOrMore>
+               <ref name="param.element"/>
+            </zeroOrMore>
+            <ref name="template.model"/>
+         </group>
+      </element>
+   </define>
+   <define name="apply-templates.element">
+      <element name="apply-templates">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="select">
+               <ref name="expression.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="mode">
+               <ref name="qname.datatype"/>
+            </attribute>
+         </optional>
+         <zeroOrMore>
+            <choice>
+               <ref name="sort.element"/>
+               <ref name="with-param.element"/>
+            </choice>
+         </zeroOrMore>
+      </element>
+   </define>
+   <define name="apply-imports.element">
+      <element name="apply-imports">
+         <ref name="extension.atts"/>
+      </element>
+   </define>
+   <define name="call-template.element">
+      <element name="call-template">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <ref name="qname.datatype"/>
+         </attribute>
+         <zeroOrMore>
+            <ref name="with-param.element"/>
+         </zeroOrMore>
+      </element>
+   </define>
+   <define name="namespace-alias.element">
+      <element name="namespace-alias">
+         <ref name="extension.atts"/>
+         <attribute name="stylesheet-prefix">
+            <ref name="prefix.datatype"/>
+         </attribute>
+         <attribute name="result-prefix">
+            <ref name="prefix.datatype"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="element.element">
+      <element name="element">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <choice>
+               <ref name="qname.datatype"/>
+               <ref name="expr-avt.datatype"/>
+            </choice>
+         </attribute>
+         <optional>
+            <attribute name="namespace">
+               <choice>
+                  <data type="anyURI"/>
+                  <ref name="brace-avt.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="use-attribute-sets">
+               <ref name="qnames.datatype"/>
+            </attribute>
+         </optional>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="attribute.element">
+      <element name="attribute">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <choice>
+               <ref name="qname.datatype"/>
+               <ref name="expr-avt.datatype"/>
+            </choice>
+         </attribute>
+         <optional>
+            <attribute name="namespace">
+               <choice>
+                  <data type="anyURI"/>
+                  <ref name="brace-avt.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="attribute-set.element">
+      <element name="attribute-set">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <ref name="qname.datatype"/>
+         </attribute>
+         <optional>
+            <attribute name="use-attribute-sets">
+               <ref name="qnames.datatype"/>
+            </attribute>
+         </optional>
+         <zeroOrMore>
+            <ref name="attribute.element"/>
+         </zeroOrMore>
+      </element>
+   </define>
+   <define name="text.element">
+      <element name="text">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="disable-output-escaping">
+               <choice>
+                  <value type="string">yes</value>
+                  <value type="string">no</value>
+               </choice>
+            </attribute>
+         </optional>
+         <text/>
+      </element>
+   </define>
+   <define name="processing-instruction.element">
+      <element name="processing-instruction">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <choice>
+               <data type="NCName"/>
+               <ref name="expr-avt.datatype"/>
+            </choice>
+         </attribute>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="comment.element">
+      <element name="comment">
+         <ref name="extension.atts"/>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="copy.element">
+      <element name="copy">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="use-attribute-sets">
+               <ref name="qnames.datatype"/>
+            </attribute>
+         </optional>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="value-of.element">
+      <element name="value-of">
+         <ref name="extension.atts"/>
+         <attribute name="select">
+            <ref name="expression.datatype"/>
+         </attribute>
+         <optional>
+            <attribute name="disable-output-escaping">
+               <choice>
+                  <value type="string">yes</value>
+                  <value type="string">no</value>
+               </choice>
+            </attribute>
+         </optional>
+      </element>
+   </define>
+   <define name="number.element">
+      <element name="number">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="level">
+               <choice>
+                  <value type="string">single</value>
+                  <value type="string">multiple</value>
+                  <value type="string">any</value>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="count">
+               <ref name="pattern.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="from">
+               <ref name="pattern.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="value">
+               <ref name="expression.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="format">
+               <ref name="avt.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="lang">
+               <choice>
+                  <data type="NMTOKEN"/>
+                  <ref name="expr-avt.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="letter-value">
+	       <choice>
+		  <value type="string">alphabetic</value>
+		  <value type="string">traditional</value>
+		  <ref name="expr-avt.datatype"/>
+	       </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="grouping-separator">
+               <choice>
+                  <ref name="char.datatype"/>
+                  <ref name="expr-avt.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="grouping-size">
+               <choice>
+                  <ref name="number.datatype"/>
+                  <ref name="expr-avt.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+      </element>
+   </define>
+   <define name="for-each.element">
+      <element name="for-each">
+         <ref name="extension.atts"/>
+         <attribute name="select">
+            <ref name="expression.datatype"/>
+         </attribute>
+         <group>
+            <zeroOrMore>
+               <ref name="sort.element"/>
+            </zeroOrMore>
+            <ref name="template.model"/>
+         </group>
+      </element>
+   </define>
+   <define name="if.element">
+      <element name="if">
+         <ref name="extension.atts"/>
+         <attribute name="test">
+            <ref name="expression.datatype"/>
+         </attribute>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="choose.element">
+      <element name="choose">
+         <ref name="extension.atts"/>
+         <group>
+            <oneOrMore>
+               <ref name="when.element"/>
+            </oneOrMore>
+            <optional>
+               <ref name="otherwise.element"/>
+            </optional>
+         </group>
+      </element>
+   </define>
+   <define name="when.element">
+      <element name="when">
+         <ref name="extension.atts"/>
+         <attribute name="test">
+            <ref name="expression.datatype"/>
+         </attribute>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="otherwise.element">
+      <element name="otherwise">
+         <ref name="extension.atts"/>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="sort.element">
+      <element name="sort">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="select">
+               <ref name="expression.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="lang">
+               <choice>
+                  <data type="NMTOKEN"/>
+                  <ref name="expr-avt.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="data-type">
+	       <choice>
+		  <value type="string">text</value>
+		  <value type="string">number</value>
+		  <ref name="qname-but-not-ncname.datatype"/>
+		  <ref name="expr-avt.datatype"/>
+	       </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="order">
+	       <choice>
+		  <value type="string">ascending</value>
+		  <value type="string">descending</value>
+		  <ref name="expr-avt.datatype"/>
+	       </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="case-order">
+	       <choice>
+		  <value type="string">upper-first</value>
+		  <value type="string">lower-first</value>
+		  <ref name="expr-avt.datatype"/>
+	       </choice>
+            </attribute>
+         </optional>
+      </element>
+   </define>
+   <define name="variable.element">
+      <element name="variable">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <ref name="qname.datatype"/>
+         </attribute>
+         <choice>
+            <attribute name="select">
+               <ref name="expression.datatype"/>
+            </attribute>
+            <ref name="template.model"/>
+         </choice>
+      </element>
+   </define>
+   <define name="param.element">
+      <element name="param">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <ref name="qname.datatype"/>
+         </attribute>
+         <choice>
+            <attribute name="select">
+               <ref name="expression.datatype"/>
+            </attribute>
+            <ref name="template.model"/>
+         </choice>
+      </element>
+   </define>
+   <define name="copy-of.element">
+      <element name="copy-of">
+         <ref name="extension.atts"/>
+         <attribute name="select">
+            <ref name="expression.datatype"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="with-param.element">
+      <element name="with-param">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <ref name="qname.datatype"/>
+         </attribute>
+         <choice>
+            <attribute name="select">
+               <ref name="expression.datatype"/>
+            </attribute>
+            <ref name="template.model"/>
+         </choice>
+      </element>
+   </define>
+   <define name="key.element">
+      <element name="key">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <ref name="qname.datatype"/>
+         </attribute>
+         <attribute name="match">
+            <ref name="pattern.datatype"/>
+         </attribute>
+         <attribute name="use">
+            <ref name="expression.datatype"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="decimal-format.element">
+      <element name="decimal-format">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="name">
+               <ref name="qname.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="decimal-separator">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="grouping-separator">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="infinity">
+               <text/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="minus-sign">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="NaN">
+               <text/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="percent">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="per-mille">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="zero-digit">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="digit">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="pattern-separator">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+      </element>
+   </define>
+   <define name="message.element">
+      <element name="message">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="terminate">
+               <choice>
+                  <value type="string">yes</value>
+                  <value type="string">no</value>
+               </choice>
+            </attribute>
+         </optional>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="fallback.element">
+      <element name="fallback">
+         <ref name="extension.atts"/>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="output.element">
+      <element name="output">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="method">
+               <choice>
+                  <value type="string">xml</value>
+                  <value type="string">html</value>
+                  <value type="string">text</value>
+                  <ref name="qname-but-not-ncname.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="version">
+               <data type="NMTOKEN"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="encoding">
+               <text/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="omit-xml-declaration">
+               <choice>
+                  <value type="string">yes</value>
+                  <value type="string">no</value>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="standalone">
+               <choice>
+                  <value type="string">yes</value>
+                  <value type="string">no</value>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="doctype-public">
+               <text/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="doctype-system">
+               <text/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="cdata-section-elements">
+               <ref name="qnames.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="indent">
+               <choice>
+                  <value type="string">yes</value>
+                  <value type="string">no</value>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="media-type">
+               <text/>
+            </attribute>
+         </optional>
+      </element>
+   </define>
+   <define name="prefixes.datatype">
+      <list>
+         <zeroOrMore>
+            <choice>
+               <data type="NCName"/>
+               <value>#default</value>
+            </choice>
+         </zeroOrMore>
+      </list>
+   </define>
+   <define name="prefix.datatype">
+      <choice>
+	 <data type="NCName"/>
+	 <value>#default</value>
+      </choice>
+   </define>
+   <define name="wildcards.datatype">
+      <list>
+         <zeroOrMore>
+	    <choice>
+	       <data type="QName"/>
+	       <data type="token">
+		  <param name="pattern">\*|\i\c*:\*</param>
+	       </data>
+	    </choice>
+         </zeroOrMore>
+      </list> 
+   </define>
+   <define name="qname.datatype">
+      <data type="QName"/>
+   </define>
+   <define name="qnames.datatype">
+      <list>
+         <zeroOrMore>
+            <data type="QName"/>
+         </zeroOrMore>
+      </list>
+   </define>
+   <define name="char.datatype">
+      <data type="string">
+         <param name="length">1</param>
+      </data>
+   </define>
+   <define name="number.datatype">
+      <data type="decimal"/>
+   </define>
+   <define name="expression.datatype">
+      <text/>
+   </define>
+   <define name="pattern.datatype">
+      <text/>
+   </define>
+   <define name="qname-but-not-ncname.datatype">
+      <data type="QName">
+        <param name="pattern">.*:.*</param>
+      </data>
+   </define>
+   <!-- An AVT containing at least one expression. -->
+   <define name="expr-avt.datatype">
+      <data type="string">
+         <param name="pattern">([^\{\}]|\{\{|\}\})*\{([^&#34;'\{\}]|&#34;[^&#34;]*&#34;|'[^']*')+\}([^\{\}]|\{\{|\}\}|\{([^&#34;'\{\}]|&#34;[^&#34;]*&#34;|'[^']*')+\})*</param>
+      </data>
+   </define>
+   <!-- An AVT containing at least one brace; ie where instantiated AVT
+        is not the same as the literal AVT. -->
+   <define name="brace-avt.datatype">
+      <data type="string">
+         <param name="pattern">[^\{\}]*(\{\{|\}\}|\{([^&#34;'\{\}]|&#34;[^&#34;]*&#34;|'[^']*')+\})([^\{\}]|\{\{|\}\}|\{([^&#34;'\{\}]|&#34;[^&#34;]*&#34;|'[^']*')+\})*</param>
+      </data>
+   </define>
+   <define name="avt.datatype">
+      <data type="string">
+         <param name="pattern">([^\{\}]|\{\{|\}\}|\{([^&#34;'\{\}]|&#34;[^&#34;]*&#34;|'[^']*')+\})*</param>
+      </data>
+   </define>
+</grammar>
diff --git a/xml/relaxng/testData/log4j.dtd b/xml/relaxng/testData/log4j.dtd
new file mode 100644
index 0000000..0f0e4f5
--- /dev/null
+++ b/xml/relaxng/testData/log4j.dtd
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!-- Authors: Chris Taylor, Ceki Gulcu. -->
+
+<!-- A configuration element consists of optional renderer
+elements,appender elements, categories and an optional root
+element. -->
+
+<!ELEMENT log4j:configuration (renderer*, appender*,category*,root?)>
+
+<!-- The disable attribute takes a priority value such that all -->
+<!-- logging statements with a prioroty equal or below this value are -->
+<!-- disabled. -->
+
+<!-- The disableOverride attribute allows the user to override any   -->
+<!-- BasicConfigurator.disable invocations made from within the      -->
+<!-- application.                                                    -->
+     
+<!-- By default, disableOverride is "null", meaning that we          -->
+<!-- do not touch the disable flag.                                  -->
+     
+<!-- Setting the "debug" or "configDebug" attributes enable the printing --> 
+<!-- of internal log4j logging statements.                               -->
+<!-- The "debug" and "configDebug" attributes are equivalent altough     -->
+<!-- the latter is deprecated and should no longer be used.              -->
+<!-- By default, debug and configDebug attributes are "null", meaning    -->
+<!-- that we not touch internal log4j logging settings.                  --> 
+
+     
+<!ATTLIST log4j:configuration
+  xmlns:log4j              CDATA #FIXED "http://jakarta.apache.org/log4j/" 
+  disable                  (debug|info|warn|error|fatal|null)  "null"
+  disableOverride          (true|false|null)  "null"
+  debug                    (true|false|null)  "null"
+  configDebug              (true|false|null)  "null"
+>
+
+
+<!-- DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED -->
+<!-- WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING   -->
+<!-- DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED -->
+
+<!-- Use "log4j:configuration" above instead of the "configuration" -->
+<!-- element. -->
+
+<!-- DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED -->
+<!-- WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING   -->
+<!-- DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED -->
+
+<!ELEMENT configuration (renderer*, appender*,category*,root?)>
+<!ATTLIST configuration
+  disable                  (debug|info|warn|error|fatal|null)  "null"
+  disableOverride          (true|false|null)  "null"
+  configDebug              (true|false|null)  "null"
+>
+
+
+<!-- renderer elements allow the user to customize the conversion of  -->
+<!-- message objects to String.                                       -->
+
+<!ELEMENT renderer EMPTY>
+<!ATTLIST renderer
+  renderedClass  CDATA #REQUIRED
+  renderingClass CDATA #REQUIRED
+>
+
+<!-- Appenders must have a name and a class. -->
+<!-- Appenders may contain an error handler, a layout, optional parameters -->
+<!-- and filters. They may also reference (or include) other appenders. -->
+<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)>
+<!ATTLIST appender
+  name 		ID 	#REQUIRED
+  class 	CDATA	#REQUIRED
+>
+
+<!ELEMENT layout (param*)>
+<!ATTLIST layout
+  class		CDATA	#REQUIRED
+>
+
+
+
+<!ELEMENT filter (param*)>
+<!ATTLIST filter
+  class		CDATA	#REQUIRED
+>
+
+
+<!-- ErrorHandlers can be of any class. They can admit any number of -->
+<!-- parameters. -->
+
+<!ELEMENT errorHandler (param*)> 
+<!ATTLIST errorHandler
+   class        CDATA   #REQUIRED 
+>
+
+
+
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+  name		CDATA   #REQUIRED
+  value		CDATA	#REQUIRED
+>
+
+<!-- The priority class is org.apache.log4j.Priority by default -->
+<!ELEMENT priority (param*)>
+<!ATTLIST priority
+  class   CDATA	#IMPLIED
+  value	  CDATA #REQUIRED
+>
+
+<!-- If no priority element is specified, then the configurator MUST not -->
+<!-- touch the priority of the named category. -->
+<!ELEMENT category (param*, priority?, appender-ref*)>
+<!ATTLIST category
+  class         CDATA   #IMPLIED
+  name		CDATA	#REQUIRED
+  additivity	(true|false) "true"  
+>
+
+<!ELEMENT appender-ref EMPTY>
+<!ATTLIST appender-ref
+  ref IDREF #REQUIRED
+>
+
+<!-- If no priority element is specified, then the configurator MUST not -->
+<!-- touch the priority of root. -->
+<!-- The root category always exists and cannot be subclassed. -->
+<!ELEMENT root (param*, priority?, appender-ref*)>
+
+
+
+<!-- ==================================================================== -->
+<!--                       A logging event                                -->
+<!-- ==================================================================== -->
+<!ELEMENT log4j:eventSet (log4j:event*)>
+<!ATTLIST log4j:eventSet
+  includesLocationInfo   (true|false) "true"
+>
+
+
+
+<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?, 
+                       log4j:locationInfo?) >
+
+<!-- The timestamp format is application dependent. -->
+<!ATTLIST log4j:event
+    category   CDATA #REQUIRED
+    priority   CDATA #REQUIRED
+    thread     CDATA #REQUIRED
+    timestamp  CDATA #REQUIRED
+>
+
+<!ELEMENT log4j:message (#PCDATA)>
+<!ELEMENT log4j:NDC (#PCDATA)>
+
+<!ELEMENT log4j:throwable (#PCDATA)>
+
+<!ELEMENT log4j:locationInfo EMPTY>
+<!ATTLIST log4j:locationInfo
+  class  CDATA	#REQUIRED
+  method CDATA	#REQUIRED
+  file   CDATA	#REQUIRED
+  line   CDATA	#REQUIRED
+>
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/escaped-broken-1.rnc b/xml/relaxng/testData/parsing/escaped-broken-1.rnc
new file mode 100644
index 0000000..c655559
--- /dev/null
+++ b/xml/relaxng/testData/parsing/escaped-broken-1.rnc
@@ -0,0 +1 @@
+element<error> \x{ </error>{ empty }
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/escaped-broken-2.rnc b/xml/relaxng/testData/parsing/escaped-broken-2.rnc
new file mode 100644
index 0000000..1798ba6
--- /dev/null
+++ b/xml/relaxng/testData/parsing/escaped-broken-2.rnc
@@ -0,0 +1 @@
+<error>element \x{</error>
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/escaped-broken-3.rnc b/xml/relaxng/testData/parsing/escaped-broken-3.rnc
new file mode 100644
index 0000000..a27ec4d
--- /dev/null
+++ b/xml/relaxng/testData/parsing/escaped-broken-3.rnc
@@ -0,0 +1 @@
+<error>element \x{55</error>
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/escaped-broken-4.rnc b/xml/relaxng/testData/parsing/escaped-broken-4.rnc
new file mode 100644
index 0000000..e4f0793
--- /dev/null
+++ b/xml/relaxng/testData/parsing/escaped-broken-4.rnc
@@ -0,0 +1 @@
+element<error> \x{} </error>{ empty }
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/escaped-broken-5.rnc b/xml/relaxng/testData/parsing/escaped-broken-5.rnc
new file mode 100644
index 0000000..87f7160
--- /dev/null
+++ b/xml/relaxng/testData/parsing/escaped-broken-5.rnc
@@ -0,0 +1 @@
+element \x{abc<error>x</error>} { empty }
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/escaped.rnc b/xml/relaxng/testData/parsing/escaped.rnc
new file mode 100644
index 0000000..6833cb8
--- /dev/null
+++ b/xml/relaxng/testData/parsing/escaped.rnc
@@ -0,0 +1 @@
+element \x{41}\x{41} { empty }
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/annotations/Following.rnc b/xml/relaxng/testData/parsing/psi/annotations/Following.rnc
new file mode 100644
index 0000000..c896238e
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/annotations/Following.rnc
@@ -0,0 +1,3 @@
+element foo {
+  text >> x[] >> y[]
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/annotations/Following.txt b/xml/relaxng/testData/parsing/psi/annotations/Following.txt
new file mode 100644
index 0000000..e1a53b7
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/annotations/Following.txt
@@ -0,0 +1,31 @@
+RncFileImpl:Following.rnc
+  DOCUMENT
+    GRAMMAR_PATTERN
+      PATTERN
+        PsiElement(KEYWORD_ELEMENT)('element')
+        PsiWhiteSpace(' ')
+        NAME_CLASS
+          PsiElement(IDENTIFIER)('foo')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        TEXT_PATTERN
+          PsiElement(KEYWORD_TEXT)('text')
+        PsiWhiteSpace(' ')
+        FORWARD_ANNOTATION
+          PsiElement(FANNOTATE)('>>')
+          PsiWhiteSpace(' ')
+          NAME
+            PsiElement(IDENTIFIER)('x')
+          PsiElement([)('[')
+          PsiElement(])(']')
+        PsiWhiteSpace(' ')
+        FORWARD_ANNOTATION
+          PsiElement(FANNOTATE)('>>')
+          PsiWhiteSpace(' ')
+          NAME
+            PsiElement(IDENTIFIER)('y')
+          PsiElement([)('[')
+          PsiElement(])(']')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/annotations/FollowingIncomplete.rnc b/xml/relaxng/testData/parsing/psi/annotations/FollowingIncomplete.rnc
new file mode 100644
index 0000000..26edf3c
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/annotations/FollowingIncomplete.rnc
@@ -0,0 +1,3 @@
+element foo {
+  text >>
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/annotations/FollowingIncomplete.txt b/xml/relaxng/testData/parsing/psi/annotations/FollowingIncomplete.txt
new file mode 100644
index 0000000..9650ed8
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/annotations/FollowingIncomplete.txt
@@ -0,0 +1,18 @@
+RncFileImpl:FollowingIncomplete.rnc
+  DOCUMENT
+    GRAMMAR_PATTERN
+      PATTERN
+        PsiElement(KEYWORD_ELEMENT)('element')
+        PsiWhiteSpace(' ')
+        NAME_CLASS
+          PsiElement(IDENTIFIER)('foo')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        TEXT_PATTERN
+          PsiElement(KEYWORD_TEXT)('text')
+        PsiWhiteSpace(' ')
+        FORWARD_ANNOTATION
+          PsiElement(FANNOTATE)('>>')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/annotations/GrammarLevel.rnc b/xml/relaxng/testData/parsing/psi/annotations/GrammarLevel.rnc
new file mode 100644
index 0000000..7256ffd
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/annotations/GrammarLevel.rnc
@@ -0,0 +1,7 @@
+namespace x = "http://www.example.com"
+
+start = foo
+
+x:entity [ name="picture" systemId="picture.jpeg" notation="jpeg" ]
+
+foo = element foo { empty }
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/annotations/GrammarLevel.txt b/xml/relaxng/testData/parsing/psi/annotations/GrammarLevel.txt
new file mode 100644
index 0000000..72d91f2
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/annotations/GrammarLevel.txt
@@ -0,0 +1,57 @@
+RncFileImpl:GrammarLevel.rnc
+  DOCUMENT
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('x')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.example.com"')
+    PsiWhiteSpace('\n\n')
+    GRAMMAR_PATTERN
+      START
+        PsiElement(KEYWORD_START)('start')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('foo')
+        PsiWhiteSpace('\n\n')
+        ANNOTATION_ELEMENT
+          NAME
+            PsiElement(PREFIXED_NAME)('x:entity')
+          PsiWhiteSpace(' ')
+          PsiElement([)('[')
+          PsiWhiteSpace(' ')
+          PsiElement(IDENTIFIER)('name')
+          PsiElement(=)('=')
+          PsiElement(LITERAL)('"picture"')
+          PsiWhiteSpace(' ')
+          PsiElement(IDENTIFIER)('systemId')
+          PsiElement(=)('=')
+          PsiElement(LITERAL)('"picture.jpeg"')
+          PsiWhiteSpace(' ')
+          PsiElement(IDENTIFIER)('notation')
+          PsiElement(=)('=')
+          PsiElement(LITERAL)('"jpeg"')
+          PsiWhiteSpace(' ')
+          PsiElement(])(']')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('foo')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('foo')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          EMPTY_PATTERN
+            PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/annotations/Nested.rnc b/xml/relaxng/testData/parsing/psi/annotations/Nested.rnc
new file mode 100644
index 0000000..9e9ebd9
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/annotations/Nested.rnc
@@ -0,0 +1,11 @@
+s:pattern [
+    name = "Element exclusion"
+
+    s:rule [
+        context = "db:warning"
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of warning"
+          ]
+    ]
+]
diff --git a/xml/relaxng/testData/parsing/psi/annotations/Nested.txt b/xml/relaxng/testData/parsing/psi/annotations/Nested.txt
new file mode 100644
index 0000000..61d7124
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/annotations/Nested.txt
@@ -0,0 +1,47 @@
+RncFileImpl:Nested.rnc
+  DOCUMENT
+    ANNOTATION_ELEMENT
+      NAME
+        PsiElement(PREFIXED_NAME)('s:pattern')
+      PsiWhiteSpace(' ')
+      PsiElement([)('[')
+      PsiWhiteSpace('\n    ')
+      PsiElement(IDENTIFIER)('name')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"Element exclusion"')
+      PsiWhiteSpace('\n\n    ')
+      ANNOTATION_ELEMENT
+        NAME
+          PsiElement(PREFIXED_NAME)('s:rule')
+        PsiWhiteSpace(' ')
+        PsiElement([)('[')
+        PsiWhiteSpace('\n        ')
+        PsiElement(IDENTIFIER)('context')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PsiElement(LITERAL)('"db:warning"')
+        PsiWhiteSpace('\n          ')
+        ANNOTATION_ELEMENT
+          NAME
+            PsiElement(PREFIXED_NAME)('s:assert')
+          PsiWhiteSpace(' ')
+          PsiElement([)('[')
+          PsiWhiteSpace('\n            ')
+          PsiElement(IDENTIFIER)('test')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PsiElement(LITERAL)('"not(.//db:note)"')
+          PsiWhiteSpace('\n            ')
+          PsiElement(LITERAL)('"note must not occur in the descendants of warning"')
+          PsiWhiteSpace('\n          ')
+          PsiElement(])(']')
+        PsiWhiteSpace('\n    ')
+        PsiElement(])(']')
+      PsiWhiteSpace('\n')
+      PsiElement(])(']')
+    GRAMMAR_PATTERN
+      <empty list>
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/annotations/Simple1.rnc b/xml/relaxng/testData/parsing/psi/annotations/Simple1.rnc
new file mode 100644
index 0000000..bfe4b56
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/annotations/Simple1.rnc
@@ -0,0 +1,12 @@
+namespace doc = "http://www.example.com/documentation"
+
+[doc:href="address.html#addressBook"]
+element addressBook {
+  [doc:href="address.html#card"]
+  element card {
+    [doc:href="address.html#name"]
+    element name { text },
+    [doc:href="address.html#email"]
+    element email { text }
+  }*
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/annotations/Simple1.txt b/xml/relaxng/testData/parsing/psi/annotations/Simple1.txt
new file mode 100644
index 0000000..2470e86
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/annotations/Simple1.txt
@@ -0,0 +1,89 @@
+RncFileImpl:Simple1.rnc
+  DOCUMENT
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('doc')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.example.com/documentation"')
+    PsiWhiteSpace('\n\n')
+    ANNOTATION
+      PsiElement([)('[')
+      PsiElement(PREFIXED_NAME)('doc:href')
+      PsiElement(=)('=')
+      PsiElement(LITERAL)('"address.html#addressBook"')
+      PsiElement(])(']')
+    PsiWhiteSpace('\n')
+    GRAMMAR_PATTERN
+      PATTERN
+        PsiElement(KEYWORD_ELEMENT)('element')
+        PsiWhiteSpace(' ')
+        NAME_CLASS
+          PsiElement(IDENTIFIER)('addressBook')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        ZERO_OR_MORE
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiElement(PREFIXED_NAME)('doc:href')
+              PsiElement(=)('=')
+              PsiElement(LITERAL)('"address.html#card"')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n  ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('card')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n    ')
+            SEQUENCE
+              PATTERN
+                ANNOTATION
+                  PsiElement([)('[')
+                  PsiElement(PREFIXED_NAME)('doc:href')
+                  PsiElement(=)('=')
+                  PsiElement(LITERAL)('"address.html#name"')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n    ')
+                PsiElement(KEYWORD_ELEMENT)('element')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace(' ')
+                TEXT_PATTERN
+                  PsiElement(KEYWORD_TEXT)('text')
+                PsiWhiteSpace(' ')
+                PsiElement(})('}')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n    ')
+              PATTERN
+                ANNOTATION
+                  PsiElement([)('[')
+                  PsiElement(PREFIXED_NAME)('doc:href')
+                  PsiElement(=)('=')
+                  PsiElement(LITERAL)('"address.html#email"')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n    ')
+                PsiElement(KEYWORD_ELEMENT)('element')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('email')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace(' ')
+                TEXT_PATTERN
+                  PsiElement(KEYWORD_TEXT)('text')
+                PsiWhiteSpace(' ')
+                PsiElement(})('}')
+            PsiWhiteSpace('\n  ')
+            PsiElement(})('}')
+          PsiElement(*)('*')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/annotations/Simple2.rnc b/xml/relaxng/testData/parsing/psi/annotations/Simple2.rnc
new file mode 100644
index 0000000..1804595
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/annotations/Simple2.rnc
@@ -0,0 +1,9 @@
+namespace a = "http://www.example.com/annotation"
+
+element addressBook {
+  [ a:documentation [ xml:lang="en" "Information about a single address." ] ]
+  element card {
+    element name { text },
+    element email { text }
+  }*
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/annotations/Simple2.txt b/xml/relaxng/testData/parsing/psi/annotations/Simple2.txt
new file mode 100644
index 0000000..f62905ee
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/annotations/Simple2.txt
@@ -0,0 +1,80 @@
+RncFileImpl:Simple2.rnc
+  DOCUMENT
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('a')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.example.com/annotation"')
+    PsiWhiteSpace('\n\n')
+    GRAMMAR_PATTERN
+      PATTERN
+        PsiElement(KEYWORD_ELEMENT)('element')
+        PsiWhiteSpace(' ')
+        NAME_CLASS
+          PsiElement(IDENTIFIER)('addressBook')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        ZERO_OR_MORE
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace(' ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('a:documentation')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace(' ')
+                PsiElement(PREFIXED_NAME)('xml:lang')
+                PsiElement(=)('=')
+                PsiElement(LITERAL)('"en"')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Information about a single address."')
+                PsiWhiteSpace(' ')
+                PsiElement(])(']')
+              PsiWhiteSpace(' ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n  ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('card')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n    ')
+            SEQUENCE
+              PATTERN
+                PsiElement(KEYWORD_ELEMENT)('element')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace(' ')
+                TEXT_PATTERN
+                  PsiElement(KEYWORD_TEXT)('text')
+                PsiWhiteSpace(' ')
+                PsiElement(})('}')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n    ')
+              PATTERN
+                PsiElement(KEYWORD_ELEMENT)('element')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('email')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace(' ')
+                TEXT_PATTERN
+                  PsiElement(KEYWORD_TEXT)('text')
+                PsiWhiteSpace(' ')
+                PsiElement(})('}')
+            PsiWhiteSpace('\n  ')
+            PsiElement(})('}')
+          PsiElement(*)('*')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/complex/Datatype.rnc b/xml/relaxng/testData/parsing/psi/complex/Datatype.rnc
new file mode 100644
index 0000000..7eae7a6
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/Datatype.rnc
@@ -0,0 +1,58 @@
+# =========================================================
+#                                                          
+# (c) 2004, RenderX                                        
+#                                                          
+# Author: Alexander Peshkov <[email protected]>          
+#                                                          
+# Permission is granted to use this document, copy and     
+# modify free of charge, provided that every derived work  
+# bear a reference to the present document.                
+#                                                          
+# This document contains a computer program written in     
+# XSL Transformations Language. It is published with no    
+# warranty of any kind about its usability, as a mere      
+# example of XSL technology. RenderX shall not be          
+# considered liable for any damage or loss of data caused  
+# by use of this program.                                  
+#                                                          
+# =========================================================
+
+namespace local = ""
+default namespace fo = "http://www.w3.org/1999/XSL/Format"
+namespace rx = "http://www.renderx.com/XSL/Extensions"
+
+# ***************************************************************
+# Common XSL FO datatypes definitions
+# ***************************************************************
+integer.datatype = xsd:integer
+number.datatype = xsd:decimal
+length.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em)" }
+angle.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)(deg|grad|rad)" }
+percentage.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)%" }
+character.datatype = xsd:string { pattern = ".|\r|\n" }
+string.datatype = string
+name.datatype = xsd:NCName
+family-name.datatype = xsd:normalizedString
+#MEMO: Should I add some constraints to the family-name.datatype?
+color.datatype= xsd:token
+#MEMO: Should I add some constraints to the color.datatype?
+country.datatype = xsd:string { pattern = "\w{2,3}" }
+language.datatype = xsd:string { pattern = "\w{2,3}" }
+script.datatype = xsd:string { pattern = "\w" }
+#MEMO: Should I add detailed constraints to the country/language/script.datatype?
+uri-specification.datatype = xsd:string
+#MEMO: Should I add some constraints to the uri-specification.datatype?
+time.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)(m?s)" }
+frequency.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)(k?Hz)" }
+# NOTE: <shape> datatype added in XSL FO 1.0 Errata
+shape.datatype = xsd:normalizedString { pattern = "(([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto)" }
+
+# ***************************************************************
+# Special datatype - expressions
+# ***************************************************************
+#MEMO: simple example of constraint for functions
+expr.datatype = xsd:normalizedString { pattern = ".*\(.*\).*" }
+
+x = abc:x {
+
+}
diff --git a/xml/relaxng/testData/parsing/psi/complex/Datatype.txt b/xml/relaxng/testData/parsing/psi/complex/Datatype.txt
new file mode 100644
index 0000000..c7669a7
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/Datatype.txt
@@ -0,0 +1,363 @@
+RncFileImpl:Datatype.rnc
+  PsiComment(SINGLE_LINE_COMMENT)('# =========================================================')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# (c) 2004, RenderX                                        ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Author: Alexander Peshkov <[email protected]>          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Permission is granted to use this document, copy and     ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# modify free of charge, provided that every derived work  ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# bear a reference to the present document.                ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# This document contains a computer program written in     ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL Transformations Language. It is published with no    ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# warranty of any kind about its usability, as a mere      ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# example of XSL technology. RenderX shall not be          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# considered liable for any damage or loss of data caused  ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# by use of this program.                                  ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# =========================================================')
+  PsiWhiteSpace('\n\n')
+  DOCUMENT
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('local')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('""')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_DEFAULT)('default')
+      PsiWhiteSpace(' ')
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('fo')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.w3.org/1999/XSL/Format"')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('rx')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.renderx.com/XSL/Extensions"')
+    PsiWhiteSpace('\n\n')
+    PsiComment(SINGLE_LINE_COMMENT)('# ***************************************************************')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Common XSL FO datatypes definitions')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ***************************************************************')
+    PsiWhiteSpace('\n')
+    GRAMMAR_PATTERN
+      DEFINE
+        PsiElement(IDENTIFIER)('integer.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:integer')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('number.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:decimal')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('length.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:string')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          PARAM
+            PsiElement(IDENTIFIER)('pattern')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"[\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em)"')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('angle.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:string')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          PARAM
+            PsiElement(IDENTIFIER)('pattern')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"[\-+]?(\d*\.?\d+)(deg|grad|rad)"')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('percentage.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:string')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          PARAM
+            PsiElement(IDENTIFIER)('pattern')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"[\-+]?(\d*\.?\d+)%"')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('character.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:string')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          PARAM
+            PsiElement(IDENTIFIER)('pattern')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('".|\r|\n"')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('string.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          PsiElement(KEYWORD_STRING)('string')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('name.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:NCName')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('family-name.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:normalizedString')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: Should I add some constraints to the family-name.datatype?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('color.datatype')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:token')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: Should I add some constraints to the color.datatype?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('country.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:string')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          PARAM
+            PsiElement(IDENTIFIER)('pattern')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"\w{2,3}"')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('language.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:string')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          PARAM
+            PsiElement(IDENTIFIER)('pattern')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"\w{2,3}"')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('script.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:string')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          PARAM
+            PsiElement(IDENTIFIER)('pattern')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"\w"')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: Should I add detailed constraints to the country/language/script.datatype?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('uri-specification.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:string')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: Should I add some constraints to the uri-specification.datatype?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('time.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:string')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          PARAM
+            PsiElement(IDENTIFIER)('pattern')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"[\-+]?(\d*\.?\d+)(m?s)"')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('frequency.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:string')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          PARAM
+            PsiElement(IDENTIFIER)('pattern')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"[\-+]?(\d*\.?\d+)(k?Hz)"')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# NOTE: <shape> datatype added in XSL FO 1.0 Errata')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('shape.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:normalizedString')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          PARAM
+            PsiElement(IDENTIFIER)('pattern')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"(([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto)"')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ***************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Special datatype - expressions')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ***************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: simple example of constraint for functions')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('expr.datatype')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('xsd:normalizedString')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          PARAM
+            PsiElement(IDENTIFIER)('pattern')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('".*\(.*\).*"')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('x')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        DATATYPE_PATTERN
+          NAME
+            PsiElement(PREFIXED_NAME)('abc:x')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n\n')
+          PsiElement(})('}')
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/complex/Docbook.rnc b/xml/relaxng/testData/parsing/psi/complex/Docbook.rnc
new file mode 100644
index 0000000..df5453d
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/Docbook.rnc
@@ -0,0 +1,10638 @@
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+namespace ctrl = "http://nwalsh.com/xmlns/schema-control/"
+default namespace db = "http://docbook.org/ns/docbook"
+namespace html = "http://www.w3.org/1999/xhtml"
+namespace mml = "http://www.w3.org/1998/Math/MathML"
+namespace rng = "http://relaxng.org/ns/structure/1.0"
+namespace s = "http://www.ascc.net/xml/schematron"
+namespace svg = "http://www.w3.org/2000/svg"
+namespace xlink = "http://www.w3.org/1999/xlink"
+s:ns [
+  prefix = "a"
+  uri = "http://relaxng.org/ns/compatibility/annotations/1.0"
+]
+s:ns [ prefix = "ctrl" uri = "http://nwalsh.com/xmlns/schema-control/" ]
+s:ns [ prefix = "db" uri = "http://docbook.org/ns/docbook" ]
+s:ns [
+  prefix = "dbx"
+  uri =
+    "http://sourceforge.net/projects/docbook/defguide/schema/extra-markup"
+]
+s:ns [ prefix = "html" uri = "http://www.w3.org/1999/xhtml" ]
+s:ns [ prefix = "mml" uri = "http://www.w3.org/1998/Math/MathML" ]
+s:ns [ prefix = "rng" uri = "http://relaxng.org/ns/structure/1.0" ]
+s:ns [ prefix = "s" uri = "http://www.ascc.net/xml/schematron" ]
+s:ns [ prefix = "svg" uri = "http://www.w3.org/2000/svg" ]
+s:ns [ prefix = "xlink" uri = "http://www.w3.org/1999/xlink" ]
+
+#  DocBook V5.0CR5
+
+# See http://docbook.org/ns/docbook
+
+# This file is part of DocBook V5.0CR5
+# 
+# Copyright 1992-2005 HaL Computer Systems, Inc.,
+# O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+# Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+# Organization for the Advancement of Structured Information
+# Standards (OASIS).
+# 
+# 
+# Permission to use, copy, modify and distribute the DocBook schema
+# and its accompanying documentation for any purpose and without fee
+# is hereby granted in perpetuity, provided that the above copyright
+# notice and this paragraph appear in all copies. The copyright
+# holders make no representation about the suitability of the schema
+# for any purpose. It is provided "as is" without expressed or implied
+# warranty.
+# 
+# If you modify the DocBook schema in any way, label your schema as a
+# variant of DocBook. See the reference documentation
+# (http://docbook.org/tdg5/en/html/ch05.html#s-notdocbook)
+# for more information.
+# 
+# Please direct all questions, bug reports, or suggestions for changes
+# to the [email protected] mailing list. For more
+# information, see http://www.oasis-open.org/docbook/.
+# 
+# ======================================================================
+start =
+  (db.set
+   | db.book
+   | db.divisions
+   | db.components
+   | db.navigation.components
+   | db.section
+   | db.para)
+  | (db.sect1 | db.sect2 | db.sect3 | db.sect4 | db.sect5)
+  | (db.refentry | db.refsection)
+  | (db.refsect1 | db.refsect2 | db.refsect3)
+  | db.setindex
+div {
+  db._any.attribute =
+    
+    ## Any attribute including in any attribute in any namespace.
+    attribute * { text }
+  db._any =
+    
+    ## Any element from almost any namespace
+    element * - (db:* | html:*) {
+      (db._any.attribute | text | db._any)*
+    }
+}
+db.arch.attribute =
+  
+  ## Designates the computer or chip architecture to which the element applies
+  attribute arch { text }
+db.audience.attribute =
+  
+  ## Designates the intended audience to which the element applies, for example, system administrators, programmers, or new users.
+  attribute audience { text }
+db.condition.attribute =
+  
+  ## provides a standard place for application-specific effectivity
+  attribute condition { text }
+db.conformance.attribute =
+  
+  ## Indicates standards conformance characteristics of the element
+  attribute conformance { text }
+db.os.attribute =
+  
+  ## Indicates the operating system to which the element is applicable
+  attribute os { text }
+db.revision.attribute =
+  
+  ## Indicates the editorial revision to which the element belongs
+  attribute revision { text }
+db.security.attribute =
+  
+  ## Indicates something about the security level associated with the element to which it applies
+  attribute security { text }
+db.userlevel.attribute =
+  
+  ## Indicates the level of user experience for which the element applies
+  attribute userlevel { text }
+db.vendor.attribute =
+  
+  ## Indicates the computer vendor to which the element applies.
+  attribute vendor { text }
+db.wordsize.attribute =
+  
+  ## Indicates the word size (width in bits) of the computer architecture to which the element applies
+  attribute wordsize { text }
+db.effectivity.attributes =
+  db.arch.attribute?
+  & db.audience.attribute?
+  & db.condition.attribute?
+  & db.conformance.attribute?
+  & db.os.attribute?
+  & db.revision.attribute?
+  & db.security.attribute?
+  & db.userlevel.attribute?
+  & db.vendor.attribute?
+  & db.wordsize.attribute?
+db.endterm.attribute =
+  
+  ## Points to the element whose content is to be used as the text of the link
+  attribute endterm { xsd:IDREF }
+db.linkend.attribute =
+  
+  ## Points to an internal link target by identifying the value of its xml:id attribute
+  attribute linkend { xsd:IDREF }
+db.linkends.attribute =
+  
+  ## Points to one or more internal link targets by identifying the value of their xml:id attributes
+  attribute linkends { xsd:IDREFS }
+db.xlink.href.attribute =
+  
+  ## Identifies a link target with a URI
+  attribute xlink:href { xsd:anyURI }
+db.xlink.type.attribute =
+  
+  ## Identifies the XLink link type
+  attribute xlink:type {
+    
+    ## An XLink simple link
+    "simple"
+  }
+db.xlink.role.attribute =
+  
+  ## Identifies the XLink role of the link
+  attribute xlink:role { xsd:anyURI }
+db.xlink.arcrole.attribute =
+  
+  ## Identifies the XLink arcrole of the link
+  attribute xlink:arcrole { xsd:anyURI }
+db.xlink.title.attribute =
+  
+  ## Identifies the XLink title of the link
+  attribute xlink:title { text }?
+db.xlink.show.enumeration =
+  
+  ## An application traversing to the ending resource should load it in a new window, frame, pane, or other relevant presentation context.
+  "new"
+  | 
+    ## An application traversing to the ending resource should load the resource in the same window, frame, pane, or other relevant presentation context in which the starting resource was loaded.
+    "replace"
+  | 
+    ## An application traversing to the ending resource should load its presentation in place of the presentation of the starting resource.
+    "embed"
+  | 
+    ## The behavior of an application traversing to the ending resource is unconstrained by XLink. The application should look for other markup present in the link to determine the appropriate behavior.
+    "other"
+  | 
+    ## The behavior of an application traversing to the ending resource is unconstrained by this specification. No other markup is present to help the application determine the appropriate behavior.
+    "none"
+db.xlink.show.attribute =
+  
+  ## Identifies the XLink show behavior of the link
+  attribute xlink:show { db.xlink.show.enumeration }
+db.xlink.actuate.enumeration =
+  
+  ## An application should traverse to the ending resource immediately on loading the starting resource.
+  "onLoad"
+  | 
+    ## An application should traverse from the starting resource to the ending resource only on a post-loading event triggered for the purpose of traversal.
+    "onRequest"
+  | 
+    ## The behavior of an application traversing to the ending resource is unconstrained by this specification. The application should look for other markup present in the link to determine the appropriate behavior.
+    "other"
+  | 
+    ## The behavior of an application traversing to the ending resource is unconstrained by this specification. No other markup is present to help the application determine the appropriate behavior.
+    "none"
+db.xlink.actuate.attribute =
+  
+  ## Identifies the XLink actuate behavior of the link
+  attribute xlink:actuate { db.xlink.actuate.enumeration }
+db.href.attributes =
+  db.xlink.href.attribute
+  & db.xlink.type.attribute?
+  & db.xlink.role.attribute?
+  & db.xlink.arcrole.attribute?
+  & db.xlink.title.attribute?
+  & db.xlink.show.attribute?
+  & db.xlink.actuate.attribute?
+db.xml.id.attribute =
+  
+  ## Identifies the unique ID value of the element
+  attribute xml:id { xsd:ID }
+db.version.attribute =
+  
+  ## Specifies the DocBook version of the element and its descendants
+  attribute version { text }
+db.xml.lang.attribute =
+  
+  ## Specifies the natural language of the element and its descendants
+  attribute xml:lang { text }
+db.xml.base.attribute =
+  
+  ## Specifies the base URI of the element and its descendants
+  attribute xml:base { xsd:anyURI }
+db.remap.attribute =
+  
+  ## Provides the name or similar semantic identifier assigned to the content in some previous markup scheme
+  attribute remap { text }
+db.xreflabel.attribute =
+  
+  ## Provides the text that is to be generated for a cross reference to the element
+  attribute xreflabel { text }
+db.xrefstyle.attribute =
+  
+  ## Specifies a keyword or keywords identifying additional style information
+  attribute xrefstyle { text }
+db.revisionflag.enumeration =
+  
+  ## The element has been changed.
+  "changed"
+  | 
+    ## The element is new (has been added to the document).
+    "added"
+  | 
+    ## The element has been deleted.
+    "deleted"
+  | 
+    ## Explicitly turns off revision markup for this element.
+    "off"
+db.revisionflag.attribute =
+  
+  ## Identifies the revision status of the element
+  attribute revisionflag { db.revisionflag.enumeration }
+db.dir.enumeration =
+  
+  ## Left-to-right text
+  "ltr"
+  | 
+    ## Right-to-left text
+    "rtl"
+  | 
+    ## Left-to-right override
+    "lro"
+  | 
+    ## Right-to-left override
+    "rlo"
+db.dir.attribute =
+  
+  ## Identifies the direction of text in an element
+  attribute dir { db.dir.enumeration }
+db.common.base.attributes =
+  db.version.attribute?
+  & db.xml.lang.attribute?
+  & db.xml.base.attribute?
+  & db.remap.attribute?
+  & db.xreflabel.attribute?
+  & db.revisionflag.attribute?
+  & db.dir.attribute?
+  & db.effectivity.attributes
+db.common.attributes =
+  db.xml.id.attribute?
+  & db.common.base.attributes
+  & db.annotations.attribute?
+db.common.idreq.attributes =
+  db.xml.id.attribute
+  & db.common.base.attributes
+  & db.annotations.attribute?
+db.common.linking.attributes =
+  (db.linkend.attribute | db.href.attributes)?
+db.common.req.linking.attributes =
+  db.linkend.attribute | db.href.attributes
+db.common.data.attributes =
+  
+  ## Specifies the format of the data
+  attribute format { text }?,
+  (
+   ## Indentifies the location of the data by URI
+   attribute fileref { xsd:anyURI }
+   | 
+     ## Identifies the location of the data by external identifier (entity name)
+     attribute entityref { xsd:ENTITY })
+db.verbatim.continuation.enumeration =
+  
+  ## Line numbering continues from the immediately preceding element with the same name.
+  "continues"
+  | 
+    ## Line numbering restarts (begins at 1, usually).
+    "restarts"
+db.verbatim.continuation.attribute =
+  
+  ## Determines whether line numbering continues from the previous element or restarts.
+  attribute continuation { db.verbatim.continuation.enumeration }
+db.verbatim.linenumbering.enumeration =
+  
+  ## Lines are numbered.
+  "numbered"
+  | 
+    ## Lines are not numbered.
+    "unnumbered"
+db.verbatim.linenumbering.attribute =
+  
+  ## Determines whether lines are numbered.
+  attribute linenumbering { db.verbatim.linenumbering.enumeration }
+db.verbatim.startinglinenumber.attribute =
+  
+  ## Specifies the initial line number.
+  attribute startinglinenumber { xsd:integer }
+db.verbatim.language.attribute =
+  
+  ## Identifies the language (i.e. programming language) of the verbatim content.
+  attribute language { text }
+db.verbatim.xml.space.attribute =
+  
+  ## Can be used to indicate explicitly that whitespace in the verbatim environment is preserved. Whitespace must always be preserved in verbatim environments whether this attribute is specified or not.
+  attribute xml:space {
+    
+    ## Whitespace must be preserved.
+    "preserve"
+  }
+db.verbatim.attributes =
+  db.verbatim.continuation.attribute?
+  & db.verbatim.linenumbering.attribute?
+  & db.verbatim.startinglinenumber.attribute?
+  & db.verbatim.language.attribute?
+  & db.verbatim.xml.space.attribute?
+db.label.attribute =
+  
+  ## Specifies an identifying string for presentation purposes
+  attribute label { text }
+db.width.characters.attribute =
+  
+  ## Specifies the width (in characters) of the element
+  attribute width { xsd:nonNegativeInteger }
+db.spacing.enumeration =
+  
+  ## The spacing should be "compact".
+  "compact"
+  | 
+    ## The spacing should be "normal".
+    "normal"
+db.spacing.attribute =
+  
+  ## Specifies (a hint about) the spacing of the content
+  attribute spacing { db.spacing.enumeration }
+db.pgwide.enumeration =
+  
+  ## The element should be rendered in the current text flow (with the flow column width).
+  "0"
+  | 
+    ## The element should be rendered across the full text page.
+    "1"
+db.pgwide.attribute =
+  
+  ## Indicates if the element is rendered across the column or the page
+  attribute pgwide { db.pgwide.enumeration }
+db.language.attribute =
+  
+  ## Identifies the language (i.e. programming language) of the content.
+  attribute language { text }
+db.performance.enumeration =
+  
+  ## The content describes an optional step or steps.
+  "optional"
+  | 
+    ## The content describes a required step or steps.
+    "required"
+db.performance.attribute =
+  
+  ## Specifies if the content is required or optional.
+  attribute performance { db.performance.enumeration }
+db.floatstyle.attribute =
+  
+  ## Specifies style information to be used when rendering the float
+  attribute floatstyle { text }
+db.width.attribute =
+  
+  ## Specifies the width of the element
+  attribute width { text }
+db.depth.attribute =
+  
+  ## Specifies the depth of the element
+  attribute depth { text }
+db.contentwidth.attribute =
+  
+  ## Specifies the width of the content rectangle
+  attribute contentwidth { text }
+db.contentdepth.attribute =
+  
+  ## Specifies the depth of the content rectangle
+  attribute contentdepth { text }
+db.scalefit.enumeration =
+  
+  ## False (do not scale-to-fit; anamorphic scaling may occur)
+  "0"
+  | 
+    ## True (scale-to-fit; anamorphic scaling is forbidden)
+    "1"
+db.scale.attribute =
+  
+  ## Specifies the scaling factor
+  attribute scale { xsd:positiveInteger }
+db.halign.enumeration =
+  
+  ## Centered horizontally
+  "center"
+  | 
+    ## Aligned horizontally on the specified character
+    "char"
+  | 
+    ## Fully justified (left and right margins or edges)
+    "justify"
+  | 
+    ## Left aligned
+    "left"
+  | 
+    ## Right aligned
+    "right"
+db.valign.enumeration =
+  
+  ## Aligned on the bottom of the region
+  "bottom"
+  | 
+    ## Centered vertically
+    "middle"
+  | 
+    ## Aligned on the top of the region
+    "top"
+db.biblio.class.enumeration =
+  
+  ## A document object identifier.
+  "doi"
+  | 
+    ## An international standard book number.
+    "isbn"
+  | 
+    ## An international standard technical report number (ISO 10444).
+    "isrn"
+  | 
+    ## An international standard serial number.
+    "issn"
+  | 
+    ## A Library of Congress reference number.
+    "libraryofcongress"
+  | 
+    ## A publication number (an internal number or possibly organizational standard).
+    "pubsnumber"
+  | 
+    ## A Uniform Resource Identifier
+    "uri"
+db.biblio.class-enum.attribute =
+  
+  ## Identifies the kind of bibliographic identifier
+  attribute class { db.biblio.class.enumeration }?
+db.biblio.class-other.attribute =
+  
+  ## Identifies the nature of the non-standard bibliographic identifier
+  attribute otherclass { xsd:NMTOKEN }
+db.biblio.class-other.attributes =
+  
+  ## Identifies the kind of bibliographic identifier
+  attribute class {
+    
+    ## Indicates that the identifier is some 'other' kind.
+    "other"
+  }
+  & db.biblio.class-other.attribute
+db.biblio.class.attribute =
+  db.biblio.class-enum.attribute | db.biblio.class-other.attributes
+db.ubiq.inlines =
+  (db.inlinemediaobject
+   | db.remark
+   | db.superscript
+   | db.subscript
+   | db.link.inlines
+   | db.alt)
+  | db.annotation
+  | db.indexterm
+db._text = (text | db.ubiq.inlines | db._phrase | db.replaceable)*
+db._title = db.title? & db.titleabbrev? & db.subtitle?
+db._title.req = db.title & db.titleabbrev? & db.subtitle?
+db._title.only = db.title? & db.titleabbrev?
+db._title.onlyreq = db.title & db.titleabbrev?
+db._info = (db._title.req?, db.titleforbidden.info?) | db.info?
+db._info.title.req =
+  (db._title.req, db.titleforbidden.info?) | db.titlereq.info
+db._info.title.only =
+  (db._title.only, db.titleforbidden.info?) | db.titleonly.info
+db._info.title.onlyreq =
+  (db._title.onlyreq, db.titleforbidden.info?) | db.titleonlyreq.info
+db._info.title.forbidden = db.titleforbidden.info?
+db.all.inlines =
+  text
+  | db.ubiq.inlines
+  | db.general.inlines
+  | db.domain.inlines
+  | db.extension.inlines
+db.general.inlines =
+  db.publishing.inlines
+  | db.product.inlines
+  | db.bibliography.inlines
+  | db.graphic.inlines
+  | db.indexing.inlines
+  | db.link.inlines
+db.domain.inlines =
+  (db.technical.inlines
+   | db.error.inlines
+   | db.os.inlines
+   | db.programming.inlines
+   | db.markup.inlines
+   | db.gui.inlines
+   | db.keyboard.inlines)
+  | db.math.inlines
+db.technical.inlines =
+  (db.replaceable
+   | db.systemitem
+   | db.option
+   | db.optional
+   | db.package
+   | db.parameter
+   | db.property)
+  | db.termdef
+  | db.nonterminal
+db.error.inlines =
+  db.errorcode | db.errortext | db.errorname | db.errortype
+db.oo.inlines = db.ooclass | db.ooexception | db.oointerface
+db.programming.inlines =
+  db.function
+  | db.parameter
+  | db.varname
+  | db.returnvalue
+  | db.type
+  | db.classname
+  | db.exceptionname
+  | db.interfacename
+  | db.methodname
+  | db.modifier
+  | db.initializer
+  | db.oo.inlines
+db.product.inlines =
+  db.productnumber
+  | db.productname
+  | db.database
+  | db.application
+  | db.hardware
+  | db.trademark
+db.os.inlines =
+  db.prompt
+  | db.envar
+  | db.filename
+  | db.command
+  | db.computeroutput
+  | db.userinput
+db.markup.inlines =
+  db.tag
+  | db.markup
+  | db.token
+  | db.symbol
+  | db.literal
+  | db.code
+  | db.constant
+  | db.email
+  | db.uri
+db.bibliography.inlines =
+  db.citation
+  | db.citerefentry
+  | db.citetitle
+  | db.citebiblioid
+  | db.author
+  | db.person
+  | db.personname
+  | db.org
+  | db.orgname
+  | db.editor
+  | db.jobtitle
+db.publishing.inlines =
+  (db.abbrev
+   | db.acronym
+   | db.date
+   | db.emphasis
+   | db.footnote
+   | db.footnoteref
+   | db.foreignphrase
+   | db.phrase
+   | db.quote
+   | db.subscript
+   | db.superscript
+   | db.wordasword)
+  | db.glossary.inlines
+  | db.coref
+db.graphic.inlines = db.inlinemediaobject
+db.indexing.inlines = notAllowed | db.indexterm
+db.gui.inlines =
+  db.guiicon
+  | db.guibutton
+  | db.guimenuitem
+  | db.guimenu
+  | db.guisubmenu
+  | db.guilabel
+  | db.menuchoice
+  | db.mousebutton
+db.keyboard.inlines =
+  db.keycombo
+  | db.keycap
+  | db.keycode
+  | db.keysym
+  | db.shortcut
+  | db.accel
+db.link.inlines =
+  (db.xref | db.link | db.olink | db.anchor) | db.biblioref
+db.extension.inlines = notAllowed
+db.nopara.blocks =
+  (db.list.blocks
+   | db.admonition.blocks
+   | db.formal.blocks
+   | db.informal.blocks
+   | db.publishing.blocks
+   | db.graphic.blocks
+   | db.technical.blocks
+   | db.verbatim.blocks
+   | db.synopsis.blocks
+   | db.bridgehead
+   | db.remark
+   | db.revhistory)
+  | db.indexterm
+db.para.blocks = db.anchor | db.para | db.formalpara | db.simpara
+db.all.blocks =
+  (db.nopara.blocks | db.para.blocks | db.extension.blocks)
+  | db.annotation
+db.formal.blocks = (db.example | db.figure | db.table) | db.equation
+db.informal.blocks =
+  (db.informalexample | db.informalfigure | db.informaltable)
+  | db.informalequation
+db.publishing.blocks =
+  db.sidebar | db.blockquote | db.address | db.epigraph
+db.graphic.blocks = db.mediaobject | db.screenshot
+db.technical.blocks =
+  db.procedure
+  | db.task
+  | (db.productionset | db.constraintdef)
+  | db.msgset
+db.admonition.blocks =
+  db.caution | db.important | db.note | db.tip | db.warning
+db.list.blocks =
+  (db.itemizedlist
+   | db.orderedlist
+   | db.procedure
+   | db.simplelist
+   | db.variablelist
+   | db.segmentedlist)
+  | db.glosslist
+  | db.bibliolist
+  | db.calloutlist
+  | db.qandaset
+db.verbatim.blocks =
+  (db.programlisting | db.screen | db.literallayout | db.synopsis)
+  | (db.programlistingco | db.screenco)
+db.synopsis.blocks =
+  db.cmdsynopsis
+  | db.funcsynopsis
+  | db.classsynopsis
+  | db.methodsynopsis
+  | db.constructorsynopsis
+  | db.destructorsynopsis
+  | db.fieldsynopsis
+db.extension.blocks = notAllowed
+db.info.extension = db._any
+db.info.elements =
+  (db.abstract
+   | db.address
+   | db.artpagenums
+   | db.author
+   | db.authorgroup
+   | db.authorinitials
+   | db.bibliocoverage
+   | db.biblioid
+   | db.bibliosource
+   | db.collab
+   | db.confgroup
+   | db.contractsponsor
+   | db.contractnum
+   | db.copyright
+   | db.cover
+   | db.date
+   | db.edition
+   | db.editor
+   | db.issuenum
+   | db.keywordset
+   | db.legalnotice
+   | db.mediaobject
+   | db.org
+   | db.orgname
+   | db.othercredit
+   | db.pagenums
+   | db.printhistory
+   | db.productname
+   | db.productnumber
+   | db.pubdate
+   | db.publisher
+   | db.publishername
+   | db.releaseinfo
+   | db.revhistory
+   | db.seriesvolnums
+   | db.subjectset
+   | db.volumenum
+   | db.info.extension)
+  | db.annotation
+  | db.extendedlink
+  | (db.bibliomisc | db.bibliomset | db.bibliorelation | db.biblioset)
+  | db.itermset
+db.bibliographic.elements =
+  db.info.elements
+  | db.publishing.inlines
+  | db.citerefentry
+  | db.citetitle
+  | db.citebiblioid
+  | db.person
+  | db.personname
+  | db.subtitle
+  | db.title
+div {
+  db.title.role.attribute = attribute role { text }
+  db.title.attlist =
+    db.title.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.title =
+    
+    ## The text of the title of a section of a document or of a formal block-level element
+    element title { db.title.attlist, db.all.inlines* }
+}
+div {
+  db.titleabbrev.role.attribute = attribute role { text }
+  db.titleabbrev.attlist =
+    db.titleabbrev.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.titleabbrev =
+    
+    ## The abbreviation of a title
+    element titleabbrev { db.titleabbrev.attlist, db.all.inlines* }
+}
+div {
+  db.subtitle.role.attribute = attribute role { text }
+  db.subtitle.attlist =
+    db.subtitle.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.subtitle =
+    
+    ## The subtitle of a document
+    element subtitle { db.subtitle.attlist, db.all.inlines* }
+}
+div {
+  db.info.role.attribute = attribute role { text }
+  db.info.attlist = db.info.role.attribute? & db.common.attributes
+  db.info =
+    
+    ## A wrapper for information about a component or other block
+    element info { db.info.attlist, (db._title & db.info.elements*) }
+}
+div {
+  db.titlereq.info.role.attribute = attribute role { text }
+  db.titlereq.info.attlist =
+    db.titlereq.info.role.attribute? & db.common.attributes
+  db.titlereq.info =
+    
+    ## A wrapper for information about a component or other block with a required title
+    element info {
+      db.titlereq.info.attlist, (db._title.req & db.info.elements*)
+    }
+}
+div {
+  db.titleonly.info.role.attribute = attribute role { text }
+  db.titleonly.info.attlist =
+    db.titleonly.info.role.attribute? & db.common.attributes
+  db.titleonly.info =
+    
+    ## A wrapper for information about a component or other block with only a title
+    element info {
+      db.titleonly.info.attlist, (db._title.only & db.info.elements*)
+    }
+}
+div {
+  db.titleonlyreq.info.role.attribute = attribute role { text }
+  db.titleonlyreq.info.attlist =
+    db.titleonlyreq.info.role.attribute? & db.common.attributes
+  db.titleonlyreq.info =
+    
+    ## A wrapper for information about a component or other block with only a required title
+    element info {
+      db.titleonlyreq.info.attlist,
+      (db._title.onlyreq & db.info.elements*)
+    }
+}
+div {
+  db.titleforbidden.info.role.attribute = attribute role { text }
+  db.titleforbidden.info.attlist =
+    db.titleforbidden.info.role.attribute? & db.common.attributes
+  db.titleforbidden.info =
+    
+    ## A wrapper for information about a component or other block without a title
+    element info { db.titleforbidden.info.attlist, db.info.elements* }
+}
+div {
+  db.subjectset.role.attribute = attribute role { text }
+  db.subjectset.scheme.attribute =
+    
+    ## Identifies the controlled vocabulary used by this set's terms
+    attribute scheme { xsd:NMTOKEN }
+  db.subjectset.attlist =
+    db.subjectset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.subjectset.scheme.attribute?
+  db.subjectset =
+    
+    ## A set of terms describing the subject matter of a document
+    element subjectset { db.subjectset.attlist, db.subject+ }
+}
+div {
+  db.subject.role.attribute = attribute role { text }
+  db.subject.weight.attribute =
+    
+    ## Specifies a ranking for this subject relative to other subjects in the same set
+    attribute weight { text }
+  db.subject.attlist =
+    db.subject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.subject.weight.attribute?
+  db.subject =
+    
+    ## One of a group of terms describing the subject matter of a document
+    element subject { db.subject.attlist, db.subjectterm+ }
+}
+div {
+  db.subjectterm.role.attribute = attribute role { text }
+  db.subjectterm.attlist =
+    db.subjectterm.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.subjectterm =
+    
+    ## A term in a group of terms describing the subject matter of a document
+    element subjectterm { db.subjectterm.attlist, text }
+}
+div {
+  db.keywordset.role.attribute = attribute role { text }
+  db.keywordset.attlist =
+    db.keywordset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.keywordset =
+    
+    ## A set of keywords describing the content of a document
+    element keywordset { db.keywordset.attlist, db.keyword+ }
+}
+div {
+  db.keyword.role.attribute = attribute role { text }
+  db.keyword.attlist =
+    db.keyword.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.keyword =
+    
+    ## One of a set of keywords describing the content of a document
+    element keyword { db.keyword.attlist, text }
+}
+db.table.choice = notAllowed | db.cals.table | db.html.table
+db.informaltable.choice =
+  notAllowed | db.cals.informaltable | db.html.informaltable
+db.table = db.table.choice
+db.informaltable = db.informaltable.choice
+div {
+  db.procedure.role.attribute = attribute role { text }
+  db.procedure.attlist =
+    db.procedure.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.procedure.info = db._info.title.only
+  db.procedure =
+    
+    ## A list of operations to be performed in a well-defined sequence
+    element procedure {
+      db.procedure.attlist, db.procedure.info, db.all.blocks*, db.step+
+    }
+}
+div {
+  db.step.role.attribute = attribute role { text }
+  db.step.attlist =
+    db.step.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.performance.attribute?
+  db.step.info = db._info.title.only
+  # 
+  # This content model is blocks*, step|stepalternatives, blocks* but
+  # expressed this way it avoids UPA issues in XSD and DTD versions
+  db.step =
+    
+    ## A unit of action in a procedure
+    element step {
+      db.step.attlist,
+      db.step.info,
+      ((db.all.blocks+,
+        ((db.substeps | db.stepalternatives), db.all.blocks*)?)
+       | ((db.substeps | db.stepalternatives), db.all.blocks*))
+    }
+}
+div {
+  db.stepalternatives.role.attribute = attribute role { text }
+  db.stepalternatives.attlist =
+    db.stepalternatives.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.performance.attribute?
+  db.stepalternatives.info = db._info.title.forbidden
+  db.stepalternatives =
+    
+    ## Alternative steps in a procedure
+    element stepalternatives {
+      db.stepalternatives.attlist, db.stepalternatives.info, db.step+
+    }
+}
+div {
+  db.substeps.role.attribute = attribute role { text }
+  db.substeps.attlist =
+    db.substeps.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.performance.attribute?
+  db.substeps =
+    
+    ## A wrapper for steps that occur within steps in a procedure
+    element substeps { db.substeps.attlist, db.step+ }
+}
+div {
+  db.sidebar.role.attribute = attribute role { text }
+  db.sidebar.attlist =
+    db.sidebar.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.sidebar.info = db._info.title.only
+  db.sidebar =
+    
+    ## A portion of a document that is isolated from the main narrative flow
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:sidebar"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:sidebar)"
+            "sidebar must not occur in the descendants of sidebar"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element sidebar {
+      db.sidebar.attlist, db.sidebar.info, db.all.blocks+
+    }
+}
+div {
+  db.abstract.role.attribute = attribute role { text }
+  db.abstract.attlist =
+    db.abstract.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.abstract.info = db._info.title.only
+  db.abstract =
+    
+    ## A summary
+    element abstract {
+      db.abstract.attlist, db.abstract.info, db.para.blocks+
+    }
+}
+div {
+  db.personblurb.role.attribute = attribute role { text }
+  db.personblurb.attlist =
+    db.personblurb.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.personblurb.info = db._info.title.only
+  db.personblurb =
+    
+    ## A short description or note about a person
+    element personblurb {
+      db.personblurb.attlist, db.personblurb.info, db.para.blocks+
+    }
+}
+div {
+  db.blockquote.role.attribute = attribute role { text }
+  db.blockquote.attlist =
+    db.blockquote.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.blockquote.info = db._info.title.only
+  db.blockquote =
+    
+    ## A quotation set off from the main text
+    element blockquote {
+      db.blockquote.attlist,
+      db.blockquote.info,
+      db.attribution?,
+      db.all.blocks+
+    }
+}
+div {
+  db.attribution.role.attribute = attribute role { text }
+  db.attribution.attlist =
+    db.attribution.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.attribution =
+    
+    ## The source of a block quote or epigraph
+    element attribution {
+      db.attribution.attlist,
+      (db._text
+       | db.person
+       | db.personname
+       | db.citetitle
+       | db.citation)*
+    }
+}
+div {
+  db.bridgehead.renderas.enumeration =
+    
+    ## Render as a first-level section
+    "sect1"
+    | 
+      ## Render as a second-level section
+      "sect2"
+    | 
+      ## Render as a third-level section
+      "sect3"
+    | 
+      ## Render as a fourth-level section
+      "sect4"
+    | 
+      ## Render as a fifth-level section
+      "sect5"
+  db.bridgehead.renderas-enum.attribute =
+    
+    ## Indicates how the bridge head should be rendered
+    attribute renderas { db.bridgehead.renderas.enumeration }?
+  db.bridgehead.renderas-other.attribute =
+    
+    ## Identifies the nature of the non-standard rendering
+    attribute otherrenderas { xsd:NMTOKEN }
+  db.bridgehead.renderas-other.attributes =
+    
+    ## Indicates how the bridge head should be rendered
+    attribute renderas {
+      
+      ## Identifies a non-standard rendering
+      "other"
+    }
+    & db.bridgehead.renderas-other.attribute
+  db.bridgehead.renderas.attribute =
+    db.bridgehead.renderas-enum.attribute
+    | db.bridgehead.renderas-other.attributes
+  db.bridgehead.role.attribute = attribute role { text }
+  db.bridgehead.attlist =
+    db.bridgehead.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.bridgehead.renderas.attribute?
+  db.bridgehead =
+    
+    ## A free-floating heading
+    element bridgehead { db.bridgehead.attlist, db.all.inlines* }
+}
+div {
+  db.remark.role.attribute = attribute role { text }
+  db.remark.attlist =
+    db.remark.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.remark =
+    
+    ## A remark (or comment) intended for presentation in a draft manuscript
+    element remark { db.remark.attlist, db._text }
+}
+div {
+  db.epigraph.role.attribute = attribute role { text }
+  db.epigraph.attlist =
+    db.epigraph.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.epigraph.info = db._info.title.forbidden
+  db.epigraph =
+    
+    ## A short inscription at the beginning of a document or component
+    element epigraph {
+      db.epigraph.attlist,
+      db.epigraph.info,
+      db.attribution?,
+      (db.para.blocks | db.literallayout)+
+    }
+}
+div {
+  db.footnote.role.attribute = attribute role { text }
+  db.footnote.label.attribute =
+    
+    ## Identifies the desired footnote mark
+    attribute label { xsd:NMTOKEN }
+  db.footnote.attlist =
+    db.footnote.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.footnote.label.attribute?
+  db.footnote =
+    
+    ## A footnote
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:footnote)"
+            "footnote must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:table)"
+            "table must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:indexterm)"
+            "indexterm must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:sidebar)"
+            "sidebar must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:task)"
+            "task must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnote"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:epigraph)"
+            "epigraph must not occur in the descendants of footnote"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element footnote { db.footnote.attlist, db.all.blocks+ }
+}
+div {
+  db.formalpara.role.attribute = attribute role { text }
+  db.formalpara.attlist =
+    db.formalpara.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.formalpara.info = db._info.title.onlyreq
+  db.formalpara =
+    
+    ## A paragraph with a title
+    element formalpara {
+      db.formalpara.attlist,
+      db.formalpara.info,
+      db.indexing.inlines*,
+      db.para
+    }
+}
+div {
+  db.para.role.attribute = attribute role { text }
+  db.para.attlist =
+    db.para.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.para.info = db._info.title.forbidden
+  db.para =
+    
+    ## A paragraph
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:para"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element para {
+      db.para.attlist,
+      db.para.info,
+      (db.all.inlines | db.nopara.blocks)*
+    }
+}
+div {
+  db.simpara.role.attribute = attribute role { text }
+  db.simpara.attlist =
+    db.simpara.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.simpara.info = db._info.title.forbidden
+  db.simpara =
+    
+    ## A paragraph that contains only text and inline markup, no block elements
+    element simpara {
+      db.simpara.attlist, db.simpara.info, db.all.inlines*
+    }
+}
+db.admonition.contentmodel = db._info.title.only, db.all.blocks+
+div {
+  db.caution.role.attribute = attribute role { text }
+  db.caution.attlist =
+    db.caution.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.caution =
+    
+    ## A note of caution
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caution"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of caution"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caution"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of caution"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caution"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of caution"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caution"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of caution"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caution"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of caution"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element caution { db.caution.attlist, db.admonition.contentmodel }
+}
+div {
+  db.important.role.attribute = attribute role { text }
+  db.important.attlist =
+    db.important.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.important =
+    
+    ## An admonition set off from the text
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:important"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of important"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:important"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of important"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:important"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of important"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:important"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of important"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:important"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of important"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element important {
+      db.important.attlist, db.admonition.contentmodel
+    }
+}
+div {
+  db.note.role.attribute = attribute role { text }
+  db.note.attlist =
+    db.note.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.note =
+    
+    ## A message set off from the text
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:note"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of note"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:note"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of note"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:note"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of note"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:note"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of note"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:note"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of note"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element note { db.note.attlist, db.admonition.contentmodel }
+}
+div {
+  db.tip.role.attribute = attribute role { text }
+  db.tip.attlist =
+    db.tip.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.tip =
+    
+    ## A suggestion to the user, set off from the text
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:tip"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of tip"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:tip"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of tip"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:tip"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of tip"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:tip"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of tip"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:tip"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of tip"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element tip { db.tip.attlist, db.admonition.contentmodel }
+}
+div {
+  db.warning.role.attribute = attribute role { text }
+  db.warning.attlist =
+    db.warning.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.warning =
+    
+    ## An admonition set off from the text
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:warning"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of warning"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:warning"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of warning"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:warning"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of warning"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:warning"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of warning"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:warning"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of warning"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element warning { db.warning.attlist, db.admonition.contentmodel }
+}
+div {
+  db.itemizedlist.role.attribute = attribute role { text }
+  db.itemizedlist.mark.attribute =
+    
+    ## Identifies the type of mark to be used on items in this list
+    attribute mark { xsd:NMTOKEN }
+  db.itemizedlist.attlist =
+    db.itemizedlist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.spacing.attribute?
+    & db.itemizedlist.mark.attribute?
+  db.itemizedlist.info = db._info.title.only
+  db.itemizedlist =
+    
+    ## A list in which each entry is marked with a bullet or other dingbat
+    element itemizedlist {
+      db.itemizedlist.attlist,
+      db.itemizedlist.info,
+      db.all.blocks*,
+      db.listitem+
+    }
+}
+div {
+  db.orderedlist.role.attribute = attribute role { text }
+  db.orderedlist.continuation.enumeration =
+    
+    ## Specifies that numbering should begin where the preceding list left off
+    "continues"
+    | 
+      ## Specifies that numbering should begin again at 1
+      "restarts"
+  db.orderedlist.continuation.attribute =
+    
+    ## Indicates how list numbering should begin relative to the immediately preceding list
+    attribute continuation { db.orderedlist.continuation.enumeration }
+  db.orderedlist.startingnumber.attribute =
+    
+    ## Specifies the initial line number.
+    attribute startingnumber { xsd:integer }
+  db.orderedlist.inheritnum.enumeration =
+    
+    ## Specifies that numbering should ignore list nesting
+    "ignore"
+    | 
+      ## Specifies that numbering should inherit from outer-level lists
+      "inherit"
+  db.orderedlist.inheritnum.attribute =
+    
+    ## Indicates whether or not item numbering should be influenced by list nesting
+    attribute inheritnum { db.orderedlist.inheritnum.enumeration }
+  db.orderedlist.numeration.enumeration =
+    
+    ## Specifies Arabic numeration (1, 2, 3, ...)
+    "arabic"
+    | 
+      ## Specifies upper-case alphabetic numeration (A, B, C, ...)
+      "upperalpha"
+    | 
+      ## Specifies lower-case alphabetic numeration (a, b, c, ...)
+      "loweralpha"
+    | 
+      ## Specifies upper-case Roman numeration (I, II, III, ...)
+      "upperroman"
+    | 
+      ## Specifies lower-case Roman numeration (i, ii, iii ...)
+      "lowerroman"
+  db.orderedlist.numeration.attribute =
+    
+    ## Indicates the desired numeration
+    attribute numeration { db.orderedlist.numeration.enumeration }
+  db.orderedlist.attlist =
+    db.orderedlist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.spacing.attribute?
+    & (db.orderedlist.continuation.attribute
+       | db.orderedlist.startingnumber.attribute)?
+    & db.orderedlist.inheritnum.attribute?
+    & db.orderedlist.numeration.attribute?
+  db.orderedlist.info = db._info.title.only
+  db.orderedlist =
+    
+    ## A list in which each entry is marked with a sequentially incremented label
+    element orderedlist {
+      db.orderedlist.attlist,
+      db.orderedlist.info,
+      db.all.blocks*,
+      db.listitem+
+    }
+}
+div {
+  db.listitem.role.attribute = attribute role { text }
+  db.listitem.override.attribute =
+    
+    ## Specifies the keyword for the type of mark that should be used on this
+    ##  item, instead of the mark that would be used by default
+    attribute override { xsd:NMTOKEN }
+  db.listitem.attlist =
+    db.listitem.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.listitem.override.attribute?
+  db.listitem =
+    
+    ## A wrapper for the elements of a list item
+    element listitem { db.listitem.attlist, db.all.blocks+ }
+}
+div {
+  db.segmentedlist.role.attribute = attribute role { text }
+  db.segmentedlist.attlist =
+    db.segmentedlist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.segmentedlist.info = db._info.title.only
+  db.segmentedlist =
+    
+    ## A segmented list, a list of sets of elements
+    element segmentedlist {
+      db.segmentedlist.attlist,
+      db.segmentedlist.info,
+      db.segtitle+,
+      db.seglistitem+
+    }
+}
+div {
+  db.segtitle.role.attribute = attribute role { text }
+  db.segtitle.attlist =
+    db.segtitle.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.segtitle =
+    
+    ## The title of an element of a list item in a segmented list
+    element segtitle { db.segtitle.attlist, db.all.inlines* }
+}
+div {
+  db.seglistitem.role.attribute = attribute role { text }
+  db.seglistitem.attlist =
+    db.seglistitem.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.seglistitem =
+    
+    ## A list item in a segmented list
+    [
+      s:pattern [
+        name = "Cardinality of segments and titles"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:seglistitem"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "count(db:seg) = count(../db:segtitle)"
+            "The number of seg elements must be the same as the number of segtitle elements in the parent segmentedlist"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element seglistitem { db.seglistitem.attlist, db.seg+ }
+}
+div {
+  db.seg.role.attribute = attribute role { text }
+  db.seg.attlist =
+    db.seg.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.seg =
+    
+    ## An element of a list item in a segmented list
+    element seg { db.seg.attlist, db.all.inlines* }
+}
+div {
+  db.simplelist.role.attribute = attribute role { text }
+  db.simplelist.type.enumeration =
+    
+    ## A tabular presentation in row-major order.
+    "horiz"
+    | 
+      ## A tabular presentation in column-major order.
+      "vert"
+    | 
+      ## An inline presentation, usually a comma-delimited list.
+      "inline"
+  db.simplelist.type.attribute =
+    
+    ## Specifies the type of list presentation.
+    [ a:defaultValue = "vert" ]
+    attribute type { db.simplelist.type.enumeration }
+  db.simplelist.columns.attribute =
+    
+    ## Specifies the number of columns for horizontal or vertical presentation
+    attribute columns { xsd:integer }
+  db.simplelist.attlist =
+    db.simplelist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.simplelist.type.attribute?
+    & db.simplelist.columns.attribute?
+  db.simplelist =
+    
+    ## An undecorated list of single words or short phrases
+    element simplelist { db.simplelist.attlist, db.member+ }
+}
+div {
+  db.member.role.attribute = attribute role { text }
+  db.member.attlist =
+    db.member.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.member =
+    
+    ## An element of a simple list
+    element member { db.member.attlist, db.all.inlines* }
+}
+div {
+  db.variablelist.role.attribute = attribute role { text }
+  db.variablelist.termlength.attribute =
+    
+    ## Indicates a length beyond which the presentation system may consider a term too long and select an alternate presentation for that term, item, or list
+    attribute termlength { text }
+  db.variablelist.attlist =
+    db.variablelist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.spacing.attribute?
+    & db.variablelist.termlength.attribute?
+  db.variablelist.info = db._info.title.only
+  db.variablelist =
+    
+    ## A list in which each entry is composed of a set of one or more terms and an associated description
+    element variablelist {
+      db.variablelist.attlist,
+      db.variablelist.info,
+      db.all.blocks*,
+      db.varlistentry+
+    }
+}
+div {
+  db.varlistentry.role.attribute = attribute role { text }
+  db.varlistentry.attlist =
+    db.varlistentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.varlistentry =
+    
+    ## A wrapper for a set of terms and the associated description in a variable list
+    element varlistentry {
+      db.varlistentry.attlist, db.term+, db.listitem
+    }
+}
+div {
+  db.term.role.attribute = attribute role { text }
+  db.term.attlist =
+    db.term.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.term =
+    
+    ## The word or phrase being defined or described in a variable list
+    element term { db.term.attlist, db.all.inlines* }
+}
+div {
+  db.example.role.attribute = attribute role { text }
+  db.example.label.attribute = db.label.attribute
+  db.example.width.attribute = db.width.characters.attribute
+  db.example.pgwide.attribute = db.pgwide.attribute
+  db.example.floatstyle.attribute = db.floatstyle.attribute
+  db.example.attlist =
+    db.example.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.example.label.attribute?
+    & db.example.floatstyle.attribute?
+    & (db.example.width.attribute | db.example.pgwide.attribute)?
+  db.example.info = db._info.title.onlyreq
+  db.example =
+    
+    ## A formal example, with a title
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:table)"
+            "table must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:example"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of example"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element example {
+      db.example.attlist, db.example.info, db.all.blocks+, db.caption?
+    }
+}
+div {
+  db.informalexample.role.attribute = attribute role { text }
+  db.informalexample.width.attribute = db.width.characters.attribute
+  db.informalexample.floatstyle.attribute = db.floatstyle.attribute
+  db.informalexample.attlist =
+    db.informalexample.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.informalexample.floatstyle.attribute?
+    & db.informalexample.width.attribute?
+  db.informalexample.info = db._info.title.forbidden
+  db.informalexample =
+    
+    ## A displayed example without a title
+    element informalexample {
+      db.informalexample.attlist,
+      db.informalexample.info,
+      db.all.blocks+,
+      db.caption?
+    }
+}
+db.verbatim.inlines = (db.all.inlines | db.lineannotation) | db.co
+db.verbatim.contentmodel =
+  db._info.title.forbidden, (db.textobject | db.verbatim.inlines*)
+div {
+  db.programlisting.role.attribute = attribute role { text }
+  db.programlisting.width.attribute = db.width.characters.attribute
+  db.programlisting.attlist =
+    db.programlisting.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+    & db.programlisting.width.attribute?
+  db.programlisting =
+    
+    ## A literal listing of all or part of a program
+    element programlisting {
+      db.programlisting.attlist, db.verbatim.contentmodel
+    }
+}
+div {
+  db.literallayout.role.attribute = attribute role { text }
+  db.literallayout.class.enumeration =
+    
+    ## The literal layout should be formatted with a monospaced font
+    "monospaced"
+    | 
+      ## The literal layout should be formatted with the current font
+      "normal"
+  db.literallayout.class.attribute =
+    
+    ## Specifies the class of literal layout
+    attribute class { db.literallayout.class.enumeration }
+  db.literallayout.attlist =
+    db.literallayout.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+    & db.literallayout.class.attribute?
+  db.literallayout =
+    
+    ## A block of text in which line breaks and white space are to be reproduced faithfully
+    element literallayout {
+      db.literallayout.attlist, db.verbatim.contentmodel
+    }
+}
+div {
+  db.screen.role.attribute = attribute role { text }
+  db.screen.width.attribute = db.width.characters.attribute
+  db.screen.attlist =
+    db.screen.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+    & db.screen.width.attribute?
+  db.screen =
+    
+    ## Text that a user sees or might see on a computer screen
+    element screen { db.screen.attlist, db.verbatim.contentmodel }
+}
+div {
+  db.screenshot.role.attribute = attribute role { text }
+  db.screenshot.attlist =
+    db.screenshot.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.screenshot.info = db._info
+  db.screenshot =
+    
+    ## A representation of what the user sees or might see on a computer screen
+    element screenshot {
+      db.screenshot.attlist, db.screenshot.info, db.mediaobject
+    }
+}
+div {
+  db.figure.role.attribute = attribute role { text }
+  db.figure.label.attribute = db.label.attribute
+  db.figure.pgwide.attribute = db.pgwide.attribute
+  db.figure.floatstyle.attribute = db.floatstyle.attribute
+  db.figure.attlist =
+    db.figure.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.figure.label.attribute?
+    & db.figure.pgwide.attribute?
+    & db.figure.floatstyle.attribute?
+  db.figure.info = db._info.title.onlyreq
+  db.figure =
+    
+    ## A formal figure, generally an illustration, with a title
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:table)"
+            "table must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:figure"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of figure"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element figure {
+      db.figure.attlist, db.figure.info, db.all.blocks+, db.caption?
+    }
+}
+div {
+  db.informalfigure.role.attribute = attribute role { text }
+  db.informalfigure.label.attribute = db.label.attribute
+  db.informalfigure.pgwide.attribute = db.pgwide.attribute
+  db.informalfigure.floatstyle.attribute = db.floatstyle.attribute
+  db.informalfigure.attlist =
+    db.informalfigure.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.informalfigure.label.attribute?
+    & db.informalfigure.pgwide.attribute?
+    & db.informalfigure.floatstyle.attribute?
+  db.informalfigure.info = db._info.title.forbidden
+  db.informalfigure =
+    
+    ## A untitled figure
+    element informalfigure {
+      db.informalfigure.attlist,
+      db.informalfigure.info,
+      db.all.blocks+,
+      db.caption?
+    }
+}
+db.mediaobject.content =
+  (db.videoobject | db.audioobject | db.imageobject | db.textobject)
+  | db.imageobjectco
+div {
+  db.mediaobject.role.attribute = attribute role { text }
+  db.mediaobject.attlist =
+    db.mediaobject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.mediaobject.info = db._info.title.forbidden
+  db.mediaobject =
+    
+    ## A displayed media object (video, audio, image, etc.)
+    element mediaobject {
+      db.mediaobject.attlist,
+      db.mediaobject.info,
+      db.alt?,
+      db.mediaobject.content+,
+      db.caption?
+    }
+}
+div {
+  db.inlinemediaobject.role.attribute = attribute role { text }
+  db.inlinemediaobject.attlist =
+    db.inlinemediaobject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.inlinemediaobject.info = db._info.title.forbidden
+  db.inlinemediaobject =
+    
+    ## An inline media object (video, audio, image, and so on)
+    element inlinemediaobject {
+      db.inlinemediaobject.attlist,
+      db.inlinemediaobject.info,
+      db.alt?,
+      db.mediaobject.content+
+    }
+}
+div {
+  db.videoobject.role.attribute = attribute role { text }
+  db.videoobject.attlist =
+    db.videoobject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.videoobject.info = db._info.title.forbidden
+  db.videoobject =
+    
+    ## A wrapper for video data and its associated meta-information
+    element videoobject {
+      db.videoobject.attlist, db.videoobject.info, db.videodata
+    }
+}
+div {
+  db.audioobject.role.attribute = attribute role { text }
+  db.audioobject.attlist =
+    db.audioobject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.audioobject.info = db._info.title.forbidden
+  db.audioobject =
+    
+    ## A wrapper for audio data and its associated meta-information
+    element audioobject {
+      db.audioobject.attlist, db.audioobject.info, db.audiodata
+    }
+}
+db.imageobject.content =
+  db.imagedata | db.imagedata.mathml | db.imagedata.svg
+div {
+  db.imageobject.role.attribute = attribute role { text }
+  db.imageobject.attlist =
+    db.imageobject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.imageobject.info = db._info.title.forbidden
+  db.imageobject =
+    
+    ## A wrapper for image data and its associated meta-information
+    element imageobject {
+      db.imageobject.attlist,
+      db.imageobject.info,
+      db.imageobject.content
+    }
+}
+div {
+  db.textobject.role.attribute = attribute role { text }
+  db.textobject.attlist =
+    db.textobject.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.textobject.info = db._info.title.forbidden
+  db.textobject =
+    
+    ## A wrapper for a text description of an object and its associated meta-information
+    element textobject {
+      db.textobject.attlist,
+      db.textobject.info,
+      (db.phrase | db.textdata | db.all.blocks+)
+    }
+}
+div {
+  db.videodata.role.attribute = attribute role { text }
+  db.videodata.align.enumeration = db.halign.enumeration
+  db.videodata.align.attribute =
+    
+    ## Specifies the (horizontal) alignment of the video data
+    attribute align { db.videodata.align.enumeration }
+  db.videodata.valign.enumeration = db.valign.enumeration
+  db.videodata.valign.attribute =
+    
+    ## Specifies the vertical alignment of the video data
+    attribute valign { db.videodata.valign.enumeration }
+  db.videodata.width.attribute = db.width.attribute
+  db.videodata.depth.attribute = db.depth.attribute
+  db.videodata.contentwidth.attribute = db.contentwidth.attribute
+  db.videodata.contentdepth.attribute = db.contentdepth.attribute
+  db.videodata.scalefit.enumeration = db.scalefit.enumeration
+  db.videodata.scalefit.attribute =
+    
+    ## Determines if anamorphic scaling is forbidden
+    attribute scalefit { db.videodata.scalefit.enumeration }
+  db.videodata.scale.attribute = db.scale.attribute
+  db.videodata.attlist =
+    db.videodata.role.attribute?
+    & db.common.attributes
+    & db.common.data.attributes
+    & db.videodata.align.attribute?
+    & db.videodata.valign.attribute?
+    & db.videodata.width.attribute?
+    & db.videodata.contentwidth.attribute?
+    & db.videodata.scalefit.attribute?
+    & db.videodata.scale.attribute?
+    & db.videodata.depth.attribute?
+    & db.videodata.contentdepth.attribute?
+  db.videodata.info = db._info.title.forbidden
+  db.videodata =
+    
+    ## Pointer to external video data
+    element videodata { db.videodata.attlist, db.videodata.info }
+}
+div {
+  db.audiodata.role.attribute = attribute role { text }
+  db.audiodata.attlist =
+    db.audiodata.role.attribute?
+    & db.common.attributes
+    & db.common.data.attributes
+  db.audiodata.info = db._info.title.forbidden
+  db.audiodata =
+    
+    ## Pointer to external audio data
+    element audiodata { db.audiodata.attlist, db.audiodata.info }
+}
+div {
+  db.imagedata.role.attribute = attribute role { text }
+  db.imagedata.align.enumeration = db.halign.enumeration
+  db.imagedata.align.attribute =
+    
+    ## Specifies the (horizontal) alignment of the image data
+    attribute align { db.imagedata.align.enumeration }
+  db.imagedata.valign.enumeration = db.valign.enumeration
+  db.imagedata.valign.attribute =
+    
+    ## Specifies the vertical alignment of the image data
+    attribute valign { db.imagedata.valign.enumeration }
+  db.imagedata.width.attribute = db.width.attribute
+  db.imagedata.depth.attribute = db.depth.attribute
+  db.imagedata.contentwidth.attribute = db.contentwidth.attribute
+  db.imagedata.contentdepth.attribute = db.contentdepth.attribute
+  db.imagedata.scalefit.enumeration = db.scalefit.enumeration
+  db.imagedata.scalefit.attribute =
+    
+    ## Determines if anamorphic scaling is forbidden
+    attribute scalefit { db.imagedata.scalefit.enumeration }
+  db.imagedata.scale.attribute = db.scale.attribute
+  db.imagedata.attlist =
+    db.imagedata.role.attribute?
+    & db.common.attributes
+    & db.common.data.attributes
+    & db.imagedata.align.attribute?
+    & db.imagedata.valign.attribute?
+    & db.imagedata.width.attribute?
+    & db.imagedata.contentwidth.attribute?
+    & db.imagedata.scalefit.attribute?
+    & db.imagedata.scale.attribute?
+    & db.imagedata.depth.attribute?
+    & db.imagedata.contentdepth.attribute?
+  db.imagedata.info = db._info.title.forbidden
+  db.imagedata =
+    
+    ## Pointer to external image data
+    element imagedata { db.imagedata.attlist, db.imagedata.info }
+}
+div {
+  db.textdata.role.attribute = attribute role { text }
+  db.textdata.encoding.attribute =
+    
+    ## Identifies the encoding of the text in the external file
+    attribute encoding { text }
+  db.textdata.attlist =
+    db.textdata.role.attribute?
+    & db.common.attributes
+    & db.common.data.attributes
+    & db.textdata.encoding.attribute?
+  db.textdata.info = db._info.title.forbidden
+  db.textdata =
+    
+    ## Pointer to external text data
+    element textdata { db.textdata.attlist, db.textdata.info }
+}
+div {
+  db.caption.role.attribute = attribute role { text }
+  db.caption.attlist =
+    db.caption.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.caption.info = db._info.title.forbidden
+  db.caption =
+    
+    ## A caption
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:table)"
+            "table must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:sidebar)"
+            "sidebar must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:task)"
+            "task must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element caption {
+      db.caption.attlist, db.caption.info, db.all.blocks+
+    }
+}
+div {
+  db.synopsis.role.attribute = attribute role { text }
+  db.synopsis.label.attribute = db.label.attribute
+  db.synopsis.attlist =
+    db.synopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+    & db.synopsis.label.attribute?
+  db.synopsis =
+    
+    ## A general-purpose element for representing the syntax of commands or functions
+    element synopsis { db.synopsis.attlist, db.verbatim.contentmodel }
+}
+div {
+  db.cmdsynopsis.role.attribute = attribute role { text }
+  db.cmdsynopsis.sepchar.attribute =
+    
+    ## Specifies the character that should separate the command and its top-level arguments
+    attribute sepchar { text }
+  db.cmdsynopsis.cmdlength.attribute =
+    
+    ## Indicates the displayed length of the command; this information may be used to intelligently indent command synopses which extend beyond one line
+    attribute cmdlength { text }
+  db.cmdsynopsis.label.attribute = db.label.attribute
+  db.cmdsynopsis.attlist =
+    db.cmdsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.cmdsynopsis.sepchar.attribute?
+    & db.cmdsynopsis.cmdlength.attribute?
+    & db.cmdsynopsis.label.attribute?
+  db.cmdsynopsis.info = db._info.title.forbidden
+  db.cmdsynopsis =
+    
+    ## A syntax summary for a software command
+    element cmdsynopsis {
+      db.cmdsynopsis.attlist,
+      db.cmdsynopsis.info,
+      (db.command | db.arg | db.group | db.sbr)+,
+      db.synopfragment*
+    }
+}
+db.rep.enumeration =
+  
+  ## Can not be repeated.
+  "norepeat"
+  | 
+    ## Can be repeated.
+    "repeat"
+db.rep.attribute =
+  
+  ## Indicates whether or not repetition is possible.
+  [ a:defaultValue = "norepeat" ] attribute rep { db.rep.enumeration }
+db.choice.enumeration =
+  
+  ## Formatted to indicate that it is optional.
+  "opt"
+  | 
+    ## Formatted without indication.
+    "plain"
+  | 
+    ## Formatted to indicate that it is required.
+    "req"
+db.choice.opt.attribute =
+  
+  ## Indicates optionality.
+  [ a:defaultValue = "opt" ] attribute choice { db.choice.enumeration }
+db.choice.req.attribute =
+  
+  ## Indicates optionality.
+  [ a:defaultValue = "req" ] attribute choice { db.choice.enumeration }
+div {
+  db.arg.role.attribute = attribute role { text }
+  db.arg.rep.attribute = db.rep.attribute
+  db.arg.choice.attribute = db.choice.opt.attribute
+  db.arg.attlist =
+    db.arg.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.arg.rep.attribute?
+    & db.arg.choice.attribute?
+  db.arg =
+    
+    ## An argument in a CmdSynopsis
+    element arg {
+      db.arg.attlist,
+      (db._text
+       | db.arg
+       | db.group
+       | db.option
+       | db.synopfragmentref
+       | db.sbr)*
+    }
+}
+div {
+  db.group.role.attribute = attribute role { text }
+  db.group.rep.attribute = db.rep.attribute
+  db.group.choice.attribute = db.choice.opt.attribute
+  db.group.attlist =
+    db.group.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.group.rep.attribute?
+    & db.group.choice.attribute?
+  db.group =
+    
+    ## A group of elements in a CmdSynopsis
+    element group {
+      db.group.attlist,
+      (db.arg
+       | db.group
+       | db.option
+       | db.synopfragmentref
+       | db.replaceable
+       | db.sbr)+
+    }
+}
+div {
+  db.sbr.role.attribute = attribute role { text }
+  db.sbr.attlist = db.sbr.role.attribute? & db.common.attributes
+  db.sbr =
+    
+    ## An explicit line break in a command synopsis
+    element sbr { db.sbr.attlist, empty }
+}
+div {
+  db.synopfragment.role.attribute = attribute role { text }
+  db.synopfragment.attlist =
+    db.synopfragment.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.synopfragment =
+    
+    ## A portion of a CmdSynopsis broken out from the main body of the synopsis
+    element synopfragment {
+      db.synopfragment.attlist, (db.arg | db.group)+
+    }
+}
+div {
+  db.synopfragmentref.role.attribute = attribute role { text }
+  db.synopfragmentref.attlist =
+    db.synopfragmentref.role.attribute?
+    & db.common.attributes
+    & db.linkend.attribute
+  db.synopfragmentref =
+    
+    ## A reference to a fragment of a command synopsis
+    [
+      s:pattern [
+        name = "Synopsis fragment type constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:synopfragmentref"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test =
+              "local-name(//*[@xml:id=current()/@linkend]) = 'synopfragment' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+            "@linkend on synopfragmentref must point to a synopfragment."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element synopfragmentref { db.synopfragmentref.attlist, text }
+}
+div {
+  db.funcsynopsis.role.attribute = attribute role { text }
+  db.funcsynopsis.attlist =
+    db.funcsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.language.attribute?
+  db.funcsynopsis.info = db._info.title.forbidden
+  db.funcsynopsis =
+    
+    ## The syntax summary for a function definition
+    element funcsynopsis {
+      db.funcsynopsis.attlist,
+      db.funcsynopsis.info,
+      (db.funcsynopsisinfo | db.funcprototype)+
+    }
+}
+div {
+  db.funcsynopsisinfo.role.attribute = attribute role { text }
+  db.funcsynopsisinfo.attlist =
+    db.funcsynopsisinfo.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+  db.funcsynopsisinfo =
+    
+    ## Information supplementing the FuncDefs of a FuncSynopsis
+    element funcsynopsisinfo {
+      db.funcsynopsisinfo.attlist, db.verbatim.contentmodel
+    }
+}
+div {
+  db.funcprototype.role.attribute = attribute role { text }
+  db.funcprototype.attlist =
+    db.funcprototype.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.funcprototype =
+    
+    ## The prototype of a function
+    element funcprototype {
+      db.funcprototype.attlist,
+      db.modifier*,
+      db.funcdef,
+      (db.void | db.varargs | (db.paramdef+, db.varargs?)),
+      db.modifier*
+    }
+}
+div {
+  db.funcdef.role.attribute = attribute role { text }
+  db.funcdef.attlist =
+    db.funcdef.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.funcdef =
+    
+    ## A function (subroutine) name and its return type
+    element funcdef {
+      db.funcdef.attlist, (db._text | db.type | db.function)*
+    }
+}
+div {
+  db.void.role.attribute = attribute role { text }
+  db.void.attlist =
+    db.void.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.void =
+    
+    ## An empty element in a function synopsis indicating that the function in question takes no arguments
+    element void { db.void.attlist, empty }
+}
+div {
+  db.varargs.role.attribute = attribute role { text }
+  db.varargs.attlist =
+    db.varargs.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.varargs =
+    
+    ## An empty element in a function synopsis indicating a variable number of arguments
+    element varargs { db.varargs.attlist, empty }
+}
+div {
+  db.paramdef.role.attribute = attribute role { text }
+  db.paramdef.choice.enumeration =
+    
+    ## Formatted to indicate that it is optional.
+    "opt"
+    | 
+      ## Formatted to indicate that it is required.
+      "req"
+  db.paramdef.choice.attribute =
+    
+    ## Indicates optionality.
+    [ a:defaultValue = "opt" ]
+    attribute choice { db.paramdef.choice.enumeration }
+  db.paramdef.attlist =
+    db.paramdef.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.paramdef.choice.attribute?
+  db.paramdef =
+    
+    ## Information about a function parameter in a programming language
+    element paramdef {
+      db.paramdef.attlist,
+      (db._text
+       | db.initializer
+       | db.type
+       | db.parameter
+       | db.funcparams)*
+    }
+}
+div {
+  db.funcparams.role.attribute = attribute role { text }
+  db.funcparams.attlist =
+    db.funcparams.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.funcparams =
+    
+    ## Parameters for a function referenced through a function pointer in a synopsis
+    element funcparams { db.funcparams.attlist, db._text }
+}
+div {
+  db.classsynopsis.role.attribute = attribute role { text }
+  db.classsynopsis.class.enumeration =
+    
+    ## This is the synopsis of a class
+    "class"
+    | 
+      ## This is the synopsis of an interface
+      "interface"
+  db.classsynopsis.class.attribute =
+    
+    ## Specifies the nature of the synopsis
+    attribute class { db.classsynopsis.class.enumeration }
+  db.classsynopsis.attlist =
+    db.classsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.language.attribute?
+    & db.classsynopsis.class.attribute?
+  db.classsynopsis =
+    
+    ## The syntax summary for a class definition
+    element classsynopsis {
+      db.classsynopsis.attlist,
+      db.oo.inlines+,
+      (db.classsynopsisinfo
+       | db.methodsynopsis
+       | db.constructorsynopsis
+       | db.destructorsynopsis
+       | db.fieldsynopsis)*
+    }
+}
+div {
+  db.classsynopsisinfo.role.attribute = attribute role { text }
+  db.classsynopsisinfo.attlist =
+    db.classsynopsisinfo.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+  db.classsynopsisinfo =
+    
+    ## Information supplementing the contents of a ClassSynopsis
+    element classsynopsisinfo {
+      db.classsynopsisinfo.attlist, db.verbatim.contentmodel
+    }
+}
+div {
+  db.ooclass.role.attribute = attribute role { text }
+  db.ooclass.attlist =
+    db.ooclass.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.ooclass =
+    
+    ## A class in an object-oriented programming language
+    element ooclass {
+      db.ooclass.attlist, (db.package | db.modifier)*, db.classname
+    }
+}
+div {
+  db.oointerface.role.attribute = attribute role { text }
+  db.oointerface.attlist =
+    db.oointerface.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.oointerface =
+    
+    ## An interface in an object-oriented programming language
+    element oointerface {
+      db.oointerface.attlist,
+      (db.package | db.modifier)*,
+      db.interfacename
+    }
+}
+div {
+  db.ooexception.role.attribute = attribute role { text }
+  db.ooexception.attlist =
+    db.ooexception.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.ooexception =
+    
+    ## An exception in an object-oriented programming language
+    element ooexception {
+      db.ooexception.attlist,
+      (db.package | db.modifier)*,
+      db.exceptionname
+    }
+}
+db.modifier.xml.space.attribute =
+  
+  ## Can be used to indicate that whitespace in the modifier should be preserved (for multi-line annotations, for example).
+  attribute xml:space {
+    
+    ## Extra whitespace and line breaks must be preserved.
+    [
+      # Ideally the definition of xml:space used on modifier would be
+      # different from the definition used on the verbatim elements. The
+      # verbatim elements forbid the use of xml:space="default" which
+      # wouldn't be a problem on modifier. But doing that causes the
+      # generated XSD schemas to be broken so I'm just reusing the existing
+      # definition for now. It won't be backwards incompatible to fix this
+      # problem in the future.
+      #    | ## Extra whitespace and line breaks are not preserved.
+      #      "default"
+      
+    ]
+    "preserve"
+  }
+div {
+  db.modifier.role.attribute = attribute role { text }
+  db.modifier.attlist =
+    db.modifier.xml.space.attribute?
+    & db.modifier.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.modifier =
+    
+    ## Modifiers in a synopsis
+    element modifier { db.modifier.attlist, db._text }
+}
+div {
+  db.interfacename.role.attribute = attribute role { text }
+  db.interfacename.attlist =
+    db.interfacename.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.interfacename =
+    
+    ## The name of an interface
+    element interfacename { db.interfacename.attlist, db._text }
+}
+div {
+  db.exceptionname.role.attribute = attribute role { text }
+  db.exceptionname.attlist =
+    db.exceptionname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.exceptionname =
+    
+    ## The name of an exception
+    element exceptionname { db.exceptionname.attlist, db._text }
+}
+div {
+  db.fieldsynopsis.role.attribute = attribute role { text }
+  db.fieldsynopsis.attlist =
+    db.fieldsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.language.attribute?
+  db.fieldsynopsis =
+    
+    ## The name of a field in a class definition
+    element fieldsynopsis {
+      db.fieldsynopsis.attlist,
+      db.modifier*,
+      db.type?,
+      db.varname,
+      db.initializer?
+    }
+}
+div {
+  db.initializer.role.attribute = attribute role { text }
+  db.initializer.attlist =
+    db.initializer.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.initializer =
+    
+    ## The initializer for a FieldSynopsis
+    element initializer { db.initializer.attlist, db._text }
+}
+div {
+  db.constructorsynopsis.role.attribute = attribute role { text }
+  db.constructorsynopsis.attlist =
+    db.constructorsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.language.attribute?
+  db.constructorsynopsis =
+    
+    ## A syntax summary for a constructor
+    element constructorsynopsis {
+      db.constructorsynopsis.attlist,
+      db.modifier*,
+      db.methodname?,
+      (db.methodparam+ | db.void?),
+      db.exceptionname*
+    }
+}
+div {
+  db.destructorsynopsis.role.attribute = attribute role { text }
+  db.destructorsynopsis.attlist =
+    db.destructorsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.language.attribute?
+  db.destructorsynopsis =
+    
+    ## A syntax summary for a destructor
+    element destructorsynopsis {
+      db.destructorsynopsis.attlist,
+      db.modifier*,
+      db.methodname?,
+      (db.methodparam+ | db.void?),
+      db.exceptionname*
+    }
+}
+div {
+  db.methodsynopsis.role.attribute = attribute role { text }
+  db.methodsynopsis.attlist =
+    db.methodsynopsis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.language.attribute?
+  db.methodsynopsis =
+    
+    ## A syntax summary for a method
+    element methodsynopsis {
+      db.methodsynopsis.attlist,
+      db.modifier*,
+      (db.type | db.void)?,
+      db.methodname,
+      (db.methodparam+ | db.void),
+      db.exceptionname*,
+      db.modifier*
+    }
+}
+div {
+  db.methodname.role.attribute = attribute role { text }
+  db.methodname.attlist =
+    db.methodname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.methodname =
+    
+    ## The name of a method
+    element methodname { db.methodname.attlist, db._text }
+}
+div {
+  db.methodparam.role.attribute = attribute role { text }
+  db.methodparam.rep.attribute = db.rep.attribute
+  db.methodparam.choice.attribute = db.choice.req.attribute
+  db.methodparam.attlist =
+    db.methodparam.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.methodparam.rep.attribute?
+    & db.methodparam.choice.attribute?
+  db.methodparam =
+    
+    ## Parameters to a method
+    element methodparam {
+      db.methodparam.attlist,
+      db.modifier*,
+      db.type?,
+      ((db.modifier*, db.parameter, db.initializer?) | db.funcparams),
+      db.modifier*
+    }
+}
+div {
+  db.address.role.attribute = attribute role { text }
+  db.address.attlist =
+    db.address.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.verbatim.attributes
+  db.address =
+    
+    ## A real-world address, generally a postal address
+    element address {
+      db.address.attlist,
+      (db._text
+       | db.personname
+       | db.pob
+       | db.street
+       | db.city
+       | db.state
+       | db.postcode
+       | db.country
+       | db.phone
+       | db.fax
+       | db.email
+       | db.otheraddr)*
+    }
+}
+div {
+  db.street.role.attribute = attribute role { text }
+  db.street.attlist =
+    db.street.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.street =
+    
+    ## A street address in an address
+    element street { db.street.attlist, db._text }
+}
+div {
+  db.pob.role.attribute = attribute role { text }
+  db.pob.attlist =
+    db.pob.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.pob =
+    
+    ## A post office box in an address
+    element pob { db.pob.attlist, db._text }
+}
+div {
+  db.postcode.role.attribute = attribute role { text }
+  db.postcode.attlist =
+    db.postcode.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.postcode =
+    
+    ## A postal code in an address
+    element postcode { db.postcode.attlist, db._text }
+}
+div {
+  db.city.role.attribute = attribute role { text }
+  db.city.attlist =
+    db.city.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.city =
+    
+    ## The name of a city in an address
+    element city { db.city.attlist, db._text }
+}
+div {
+  db.state.role.attribute = attribute role { text }
+  db.state.attlist =
+    db.state.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.state =
+    
+    ## A state or province in an address
+    element state { db.state.attlist, db._text }
+}
+div {
+  db.country.role.attribute = attribute role { text }
+  db.country.attlist =
+    db.country.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.country =
+    
+    ## The name of a country
+    element country { db.country.attlist, db._text }
+}
+div {
+  db.phone.role.attribute = attribute role { text }
+  db.phone.attlist =
+    db.phone.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.phone =
+    
+    ## A telephone number
+    element phone { db.phone.attlist, db._text }
+}
+div {
+  db.fax.role.attribute = attribute role { text }
+  db.fax.attlist =
+    db.fax.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.fax =
+    
+    ## A fax number
+    element fax { db.fax.attlist, db._text }
+}
+div {
+  db.otheraddr.role.attribute = attribute role { text }
+  db.otheraddr.attlist =
+    db.otheraddr.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.otheraddr =
+    
+    ## Uncategorized information in address
+    element otheraddr { db.otheraddr.attlist, db._text }
+}
+div {
+  db.affiliation.role.attribute = attribute role { text }
+  db.affiliation.attlist =
+    db.affiliation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.affiliation =
+    
+    ## The institutional affiliation of an individual
+    element affiliation {
+      db.affiliation.attlist,
+      db.shortaffil?,
+      db.jobtitle*,
+      (db.org? | (db.orgname?, db.orgdiv*, db.address*))
+    }
+}
+div {
+  db.shortaffil.role.attribute = attribute role { text }
+  db.shortaffil.attlist =
+    db.shortaffil.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.shortaffil =
+    
+    ## A brief description of an affiliation
+    element shortaffil { db.shortaffil.attlist, db._text }
+}
+div {
+  db.jobtitle.role.attribute = attribute role { text }
+  db.jobtitle.attlist =
+    db.jobtitle.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.jobtitle =
+    
+    ## The title of an individual in an organization
+    element jobtitle { db.jobtitle.attlist, db._text }
+}
+div {
+  db.orgname.class.enumeration =
+    
+    ## A consortium
+    "consortium"
+    | 
+      ## A corporation
+      "corporation"
+    | 
+      ## An informal organization
+      "informal"
+    | 
+      ## A non-profit organization
+      "nonprofit"
+  db.orgname.class-enum.attribute =
+    
+    ## Specifies the nature of the organization
+    attribute class { db.orgname.class.enumeration }
+  db.orgname.class-other.attributes =
+    
+    ## Specifies the nature of the organization
+    attribute class {
+      
+      ## Indicates a non-standard organization class
+      "other"
+    },
+    
+    ## Identifies the non-standard nature of the organization
+    attribute otherclass { text }
+  db.orgname.class.attribute =
+    db.orgname.class-enum.attribute | db.orgname.class-other.attributes
+  db.orgname.role.attribute = attribute role { text }
+  db.orgname.attlist =
+    db.orgname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.orgname.class.attribute?
+  db.orgname =
+    
+    ## The name of an organization other than a corporation 
+    element orgname { db.orgname.attlist, db._text }
+}
+div {
+  db.orgdiv.role.attribute = attribute role { text }
+  db.orgdiv.attlist =
+    db.orgdiv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.orgdiv =
+    
+    ## A division of an organization
+    element orgdiv { db.orgdiv.attlist, db.all.inlines* }
+}
+div {
+  db.artpagenums.role.attribute = attribute role { text }
+  db.artpagenums.attlist =
+    db.artpagenums.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.artpagenums =
+    
+    ## The page numbers of an article as published
+    element artpagenums { db.artpagenums.attlist, db._text }
+}
+div {
+  db.personname.role.attribute = attribute role { text }
+  db.personname.attlist =
+    db.personname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.personname =
+    
+    ## The personal name of an individual
+    element personname {
+      db.personname.attlist,
+      (db._text
+       | (db.honorific
+          | db.firstname
+          | db.surname
+          | db.lineage
+          | db.othername)+)
+    }
+}
+db.person.author.contentmodel =
+  db.personname,
+  (db.personblurb
+   | db.affiliation
+   | db.email
+   | db.address
+   | db.contrib)*
+db.org.author.contentmodel =
+  db.orgname,
+  (db.orgdiv | db.affiliation | db.email | db.address | db.contrib)*
+db.credit.contentmodel =
+  db.person.author.contentmodel | db.org.author.contentmodel
+div {
+  db.author.role.attribute = attribute role { text }
+  db.author.attlist =
+    db.author.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.author =
+    
+    ## The name of an individual author
+    element author { db.author.attlist, db.credit.contentmodel }
+}
+div {
+  db.authorgroup.role.attribute = attribute role { text }
+  db.authorgroup.attlist =
+    db.authorgroup.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.authorgroup =
+    
+    ## Wrapper for author information when a document has multiple authors or collabarators
+    element authorgroup {
+      db.authorgroup.attlist, (db.author | db.editor | db.othercredit)+
+    }
+}
+div {
+  db.collab.role.attribute = attribute role { text }
+  db.collab.attlist =
+    db.collab.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.collab =
+    
+    ## Identifies a collaborator
+    element collab {
+      db.collab.attlist,
+      (db.person | db.personname | db.org | db.orgname)+,
+      db.affiliation*
+    }
+}
+div {
+  db.authorinitials.role.attribute = attribute role { text }
+  db.authorinitials.attlist =
+    db.authorinitials.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.authorinitials =
+    
+    ## The initials or other short identifier for an author
+    element authorinitials { db.authorinitials.attlist, db._text }
+}
+div {
+  db.person.role.attribute = attribute role { text }
+  db.person.attlist =
+    db.person.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.person =
+    
+    ## A person and associated metadata
+    element person {
+      db.person.attlist,
+      db.personname,
+      (db.address | db.affiliation | db.email | db.personblurb)*
+    }
+}
+div {
+  db.org.role.attribute = attribute role { text }
+  db.org.attlist =
+    db.org.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.org =
+    
+    ## An organization and associated metadata
+    element org {
+      db.org.attlist,
+      db.orgname,
+      (db.address | db.affiliation | db.email | db.orgdiv)*
+    }
+}
+div {
+  db.confgroup.role.attribute = attribute role { text }
+  db.confgroup.attlist =
+    db.confgroup.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.confgroup =
+    
+    ## A wrapper for document meta-information about a conference
+    element confgroup {
+      db.confgroup.attlist,
+      (db.confdates
+       | db.conftitle
+       | db.confnum
+       | db.confsponsor
+       | db.address)*
+    }
+}
+div {
+  db.confdates.role.attribute = attribute role { text }
+  db.confdates.attlist =
+    db.confdates.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.confdates =
+    
+    ## The dates of a conference for which a document was written
+    element confdates { db.confdates.attlist, db._text }
+}
+div {
+  db.conftitle.role.attribute = attribute role { text }
+  db.conftitle.attlist =
+    db.conftitle.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.conftitle =
+    
+    ## The title of a conference for which a document was written
+    element conftitle { db.conftitle.attlist, db._text }
+}
+div {
+  db.confnum.role.attribute = attribute role { text }
+  db.confnum.attlist =
+    db.confnum.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.confnum =
+    
+    ## An identifier, frequently numerical, associated with a conference for which a document was written
+    element confnum { db.confnum.attlist, db._text }
+}
+div {
+  db.confsponsor.role.attribute = attribute role { text }
+  db.confsponsor.attlist =
+    db.confsponsor.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.confsponsor =
+    
+    ## The sponsor of a conference for which a document was written
+    element confsponsor { db.confsponsor.attlist, db._text }
+}
+div {
+  db.contractnum.role.attribute = attribute role { text }
+  db.contractnum.attlist =
+    db.contractnum.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.contractnum =
+    
+    ## The contract number of a document
+    element contractnum { db.contractnum.attlist, db._text }
+}
+div {
+  db.contractsponsor.role.attribute = attribute role { text }
+  db.contractsponsor.attlist =
+    db.contractsponsor.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.contractsponsor =
+    
+    ## The sponsor of a contract
+    element contractsponsor { db.contractsponsor.attlist, db._text }
+}
+div {
+  db.copyright.role.attribute = attribute role { text }
+  db.copyright.attlist =
+    db.copyright.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.copyright =
+    
+    ## Copyright information about a document
+    element copyright { db.copyright.attlist, db.year+, db.holder* }
+}
+div {
+  db.year.role.attribute = attribute role { text }
+  db.year.attlist =
+    db.year.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.year =
+    
+    ## The year of publication of a document
+    element year { db.year.attlist, db._text }
+}
+div {
+  db.holder.role.attribute = attribute role { text }
+  db.holder.attlist =
+    db.holder.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.holder =
+    
+    ## The name of the individual or organization that holds a copyright
+    element holder { db.holder.attlist, db._text }
+}
+db.cover.contentmodel =
+  (db.para.blocks
+   | db.extension.blocks
+   | db.list.blocks
+   | db.informal.blocks
+   | db.publishing.blocks
+   | db.graphic.blocks
+   | db.technical.blocks
+   | db.verbatim.blocks
+   | db.bridgehead
+   | db.synopsis.blocks
+   | db.remark
+   | db.revhistory)+
+div {
+  db.cover.role.attribute = attribute role { text }
+  db.cover.attlist =
+    db.cover.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.cover =
+    
+    ## Additional content for the cover of a publication
+    element cover { db.cover.attlist, db.cover.contentmodel }
+}
+db.date.contentmodel =
+  xsd:date | xsd:dateTime | xsd:gYearMonth | xsd:gYear | text
+div {
+  db.date.role.attribute = attribute role { text }
+  db.date.attlist =
+    db.date.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.date =
+    
+    ## The date of publication or revision of a document
+    element date { db.date.attlist, db.date.contentmodel }
+}
+div {
+  db.edition.role.attribute = attribute role { text }
+  db.edition.attlist =
+    db.edition.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.edition =
+    
+    ## The name or number of an edition of a document
+    element edition { db.edition.attlist, db._text }
+}
+div {
+  db.editor.role.attribute = attribute role { text }
+  db.editor.attlist =
+    db.editor.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.editor =
+    
+    ## The name of the editor of a document
+    element editor { db.editor.attlist, db.credit.contentmodel }
+}
+div {
+  db.biblioid.role.attribute = attribute role { text }
+  db.biblioid.attlist =
+    db.biblioid.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.biblio.class.attribute
+  db.biblioid =
+    
+    ## An identifier for a document
+    element biblioid { db.biblioid.attlist, db._text }
+}
+div {
+  db.citebiblioid.role.attribute = attribute role { text }
+  db.citebiblioid.attlist =
+    db.citebiblioid.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.biblio.class.attribute
+  db.citebiblioid =
+    
+    ## A citation of a bibliographic identifier
+    element citebiblioid { db.citebiblioid.attlist, db._text }
+}
+div {
+  db.bibliosource.role.attribute = attribute role { text }
+  db.bibliosource.attlist =
+    db.bibliosource.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.biblio.class.attribute
+  db.bibliosource =
+    
+    ## The source of a document
+    element bibliosource { db.bibliosource.attlist, db._text }
+}
+div {
+  db.bibliorelation.type.enumeration =
+    
+    ## The described resource pre-existed the referenced resource, which is essentially the same intellectual content presented in another format
+    "hasformat"
+    | 
+      ## The described resource includes the referenced resource either physically or logically
+      "haspart"
+    | 
+      ## The described resource has a version, edition, or adaptation, namely, the referenced resource
+      "hasversion"
+    | 
+      ## The described resource is the same intellectual content of the referenced resource, but presented in another format
+      "isformatof"
+    | 
+      ## The described resource is a physical or logical part of the referenced resource
+      "ispartof"
+    | 
+      ## The described resource is referenced, cited, or otherwise pointed to by the referenced resource
+      "isreferencedby"
+    | 
+      ## The described resource is supplanted, displaced, or superceded by the referenced resource
+      "isreplacedby"
+    | 
+      ## The described resource is required by the referenced resource, either physically or logically
+      "isrequiredby"
+    | 
+      ## The described resource is a version, edition, or adaptation of the referenced resource; changes in version imply substantive changes in content rather than differences in format
+      "isversionof"
+    | 
+      ## The described resource references, cites, or otherwise points to the referenced resource
+      "references"
+    | 
+      ## The described resource supplants, displaces, or supersedes the referenced resource
+      "replaces"
+    | 
+      ## The described resource requires the referenced resource to support its function, delivery, or coherence of content
+      "requires"
+  db.bibliorelation.type-enum.attribute =
+    
+    ## Identifies the type of relationship
+    attribute type { db.bibliorelation.type.enumeration }?
+  db.bibliorelation.type-other.attributes =
+    
+    ## Identifies the type of relationship
+    attribute type {
+      
+      ## The described resource has a non-standard relationship with the referenced resource
+      "othertype"
+    }?,
+    
+    ## A keyword that identififes the type of the non-standard relationship
+    attribute othertype { xsd:NMTOKEN }
+  db.bibliorelation.type.attribute =
+    db.bibliorelation.type-enum.attribute
+    | db.bibliorelation.type-other.attributes
+  db.bibliorelation.role.attribute = attribute role { text }
+  db.bibliorelation.attlist =
+    db.bibliorelation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.biblio.class.attribute
+    & db.bibliorelation.type.attribute
+  db.bibliorelation =
+    
+    ## The relationship of a document to another
+    element bibliorelation { db.bibliorelation.attlist, db._text }
+}
+div {
+  db.bibliocoverage.spacial.enumeration =
+    
+    ## The DCMI Point identifies a point in space using its geographic coordinates
+    "dcmipoint"
+    | 
+      ## ISO 3166 Codes for the representation of names of countries
+      "iso3166"
+    | 
+      ## The DCMI Box identifies a region of space using its geographic limits
+      "dcmibox"
+    | 
+      ## The Getty Thesaurus of Geographic Names
+      "tgn"
+  db.bibliocoverage.spatial-enum.attribute =
+    
+    ## Specifies the type of spatial coverage
+    attribute spatial { db.bibliocoverage.spacial.enumeration }?
+  db.bibliocoverage.spatial-other.attributes =
+    
+    ## Specifies the type of spatial coverage
+    attribute spatial {
+      
+      ## Identifies a non-standard type of coverage
+      "otherspatial"
+    }?,
+    
+    ## A keyword that identifies the type of non-standard coverage
+    attribute otherspatial { xsd:NMTOKEN }
+  db.bibliocoverage.spatial.attribute =
+    db.bibliocoverage.spatial-enum.attribute
+    | db.bibliocoverage.spatial-other.attributes
+  db.bibliocoverage.temporal.enumeration =
+    
+    ## A specification of the limits of a time interval
+    "dcmiperiod"
+    | 
+      ## W3C Encoding rules for dates and times—a profile based on ISO 8601
+      "w3c-dtf"
+  db.bibliocoverage.temporal-enum.attribute =
+    
+    ## Specifies the type of temporal coverage
+    attribute temporal { db.bibliocoverage.temporal.enumeration }?
+  db.bibliocoverage.temporal-other.attributes =
+    
+    ## Specifies the type of temporal coverage
+    attribute temporal {
+      
+      ## Specifies a non-standard type of coverage
+      "othertemporal"
+    }?,
+    
+    ## A keyword that identifies the type of non-standard coverage
+    attribute othertemporal { xsd:NMTOKEN }
+  db.bibliocoverage.temporal.attribute =
+    db.bibliocoverage.temporal-enum.attribute
+    | db.bibliocoverage.temporal-other.attributes
+  db.bibliocoverage.coverage.attrib =
+    db.bibliocoverage.spatial.attribute
+    & db.bibliocoverage.temporal.attribute
+  db.bibliocoverage.role.attribute = attribute role { text }
+  db.bibliocoverage.attlist =
+    db.bibliocoverage.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.bibliocoverage.coverage.attrib
+  db.bibliocoverage =
+    
+    ## The spatial or temporal coverage of a document
+    element bibliocoverage { db.bibliocoverage.attlist, db._text }
+}
+div {
+  db.legalnotice.role.attribute = attribute role { text }
+  db.legalnotice.attlist =
+    db.legalnotice.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.legalnotice.info = db._info.title.only
+  db.legalnotice =
+    
+    ## A statement of legal obligations or requirements
+    element legalnotice {
+      db.legalnotice.attlist, db.legalnotice.info, db.all.blocks+
+    }
+}
+div {
+  db.othercredit.class.enumeration =
+    
+    ## A copy editor
+    "copyeditor"
+    | 
+      ## A graphic designer
+      "graphicdesigner"
+    | 
+      ## Some other contributor
+      "other"
+    | 
+      ## A production editor
+      "productioneditor"
+    | 
+      ## A technical editor
+      "technicaleditor"
+    | 
+      ## A translator
+      "translator"
+  db.othercredit.class-enum.attribute =
+    
+    ## Identifies the nature of the contributor
+    attribute class { db.othercredit.class.enumeration }?
+  db.othercredit.class-other.attribute =
+    
+    ## Identifies the nature of the non-standard contribution
+    attribute otherclass { xsd:NMTOKEN }
+  db.othercredit.class-other.attributes =
+    
+    ## Identifies the nature of the contributor
+    attribute class {
+      
+      ## Identifies a non-standard contribution
+      "other"
+    }
+    & db.othercredit.class-other.attribute
+  db.othercredit.class.attribute =
+    db.othercredit.class-enum.attribute
+    | db.othercredit.class-other.attributes
+  db.othercredit.role.attribute = attribute role { text }
+  db.othercredit.attlist =
+    db.othercredit.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.othercredit.class.attribute
+  db.othercredit =
+    
+    ## A person or entity, other than an author or editor, credited in a document
+    element othercredit {
+      db.othercredit.attlist, db.credit.contentmodel
+    }
+}
+div {
+  db.pagenums.role.attribute = attribute role { text }
+  db.pagenums.attlist =
+    db.pagenums.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.pagenums =
+    
+    ## The numbers of the pages in a book, for use in a bibliographic entry
+    element pagenums { db.pagenums.attlist, db._text }
+}
+div {
+  db.contrib.role.attribute = attribute role { text }
+  db.contrib.attlist =
+    db.contrib.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.contrib =
+    
+    ## A summary of the contributions made to a document by a credited source
+    element contrib { db.contrib.attlist, db._text }
+}
+div {
+  db.honorific.role.attribute = attribute role { text }
+  db.honorific.attlist =
+    db.honorific.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.honorific =
+    
+    ## The title of a person
+    element honorific { db.honorific.attlist, db._text }
+}
+div {
+  db.firstname.role.attribute = attribute role { text }
+  db.firstname.attlist =
+    db.firstname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.firstname =
+    
+    ## The first name of a person
+    element firstname { db.firstname.attlist, db._text }
+}
+div {
+  db.surname.role.attribute = attribute role { text }
+  db.surname.attlist =
+    db.surname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.surname =
+    
+    ## A family name; in western cultures the last name
+    element surname { db.surname.attlist, db._text }
+}
+div {
+  db.lineage.role.attribute = attribute role { text }
+  db.lineage.attlist =
+    db.lineage.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.lineage =
+    
+    ## The portion of a person's name indicating a relationship to ancestors
+    element lineage { db.lineage.attlist, db._text }
+}
+div {
+  db.othername.role.attribute = attribute role { text }
+  db.othername.attlist =
+    db.othername.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.othername =
+    
+    ## A component of a persons name that is not a first name, surname, or lineage
+    element othername { db.othername.attlist, db._text }
+}
+div {
+  db.printhistory.role.attribute = attribute role { text }
+  db.printhistory.attlist =
+    db.printhistory.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.printhistory =
+    
+    ## The printing history of a document
+    element printhistory { db.printhistory.attlist, db.para.blocks+ }
+}
+div {
+  db.productname.role.attribute = attribute role { text }
+  db.productname.class.enumeration =
+    
+    ## A name with a copyright
+    "copyright"
+    | 
+      ## A name with a registered copyright
+      "registered"
+    | 
+      ## A name of a service
+      "service"
+    | 
+      ## A name which is trademarked
+      "trade"
+  db.productname.class.attribute =
+    
+    ## Specifies the class of product name
+    attribute class { db.productname.class.enumeration }
+  db.productname.attlist =
+    db.productname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.productname.class.attribute?
+  db.productname =
+    
+    ## The formal name of a product
+    element productname { db.productname.attlist, db._text }
+}
+div {
+  db.productnumber.role.attribute = attribute role { text }
+  db.productnumber.attlist =
+    db.productnumber.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.productnumber =
+    
+    ## A number assigned to a product
+    element productnumber { db.productnumber.attlist, db._text }
+}
+div {
+  db.pubdate.role.attribute = attribute role { text }
+  db.pubdate.attlist =
+    db.pubdate.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.pubdate =
+    
+    ## The date of publication of a document
+    element pubdate { db.pubdate.attlist, db.date.contentmodel }
+}
+div {
+  db.publisher.role.attribute = attribute role { text }
+  db.publisher.attlist =
+    db.publisher.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.publisher =
+    
+    ## The publisher of a document
+    element publisher {
+      db.publisher.attlist, db.publishername, db.address*
+    }
+}
+div {
+  db.publishername.role.attribute = attribute role { text }
+  db.publishername.attlist =
+    db.publishername.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.publishername =
+    
+    ## The name of the publisher of a document
+    element publishername { db.publishername.attlist, db._text }
+}
+div {
+  db.releaseinfo.role.attribute = attribute role { text }
+  db.releaseinfo.attlist =
+    db.releaseinfo.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.releaseinfo =
+    
+    ## Information about a particular release of a document
+    element releaseinfo { db.releaseinfo.attlist, db._text }
+}
+div {
+  db.revhistory.role.attribute = attribute role { text }
+  db.revhistory.attlist =
+    db.revhistory.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.revhistory.info = db._info.title.only
+  db.revhistory =
+    
+    ## A history of the revisions to a document
+    element revhistory {
+      db.revhistory.attlist, db.revhistory.info, db.revision+
+    }
+}
+div {
+  db.revision.role.attribute = attribute role { text }
+  db.revision.attlist =
+    db.revision.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.revision =
+    
+    ## An entry describing a single revision in the history of the revisions to a document
+    element revision {
+      db.revision.attlist,
+      db.revnumber?,
+      db.date,
+      (db.authorinitials | db.author)*,
+      (db.revremark | db.revdescription)?
+    }
+}
+div {
+  db.revnumber.role.attribute = attribute role { text }
+  db.revnumber.attlist =
+    db.revnumber.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.revnumber =
+    
+    ## A document revision number
+    element revnumber { db.revnumber.attlist, db._text }
+}
+div {
+  db.revremark.role.attribute = attribute role { text }
+  db.revremark.attlist =
+    db.revremark.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.revremark =
+    
+    ## A description of a revision to a document
+    element revremark { db.revremark.attlist, db._text }
+}
+div {
+  db.revdescription.role.attribute = attribute role { text }
+  db.revdescription.attlist =
+    db.revdescription.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.revdescription =
+    
+    ## A extended description of a revision to a document
+    element revdescription { db.revdescription.attlist, db.all.blocks* }
+}
+div {
+  db.seriesvolnums.role.attribute = attribute role { text }
+  db.seriesvolnums.attlist =
+    db.seriesvolnums.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.seriesvolnums =
+    
+    ## Numbers of the volumes in a series of books
+    element seriesvolnums { db.seriesvolnums.attlist, db._text }
+}
+div {
+  db.volumenum.role.attribute = attribute role { text }
+  db.volumenum.attlist =
+    db.volumenum.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.volumenum =
+    
+    ## The volume number of a document in a set (as of books in a set or articles in a journal)
+    element volumenum { db.volumenum.attlist, db._text }
+}
+div {
+  db.issuenum.role.attribute = attribute role { text }
+  db.issuenum.attlist =
+    db.issuenum.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.issuenum =
+    
+    ## The number of an issue of a journal
+    element issuenum { db.issuenum.attlist, db._text }
+}
+div {
+  db.accel.role.attribute = attribute role { text }
+  db.accel.attlist =
+    db.accel.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.accel =
+    
+    ## A graphical user interface (GUI) keyboard shortcut
+    element accel { db.accel.attlist, db._text }
+}
+div {
+  db.application.class.enumeration =
+    
+    ## A hardware application
+    "hardware"
+    | 
+      ## A software application
+      "software"
+  db.application.class.attribute =
+    
+    ## Identifies the class of application
+    attribute class { db.application.class.enumeration }
+  db.application.role.attribute = attribute role { text }
+  db.application.attlist =
+    db.application.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.application.class.attribute?
+  db.application =
+    
+    ## The name of a software program
+    element application { db.application.attlist, db._text }
+}
+div {
+  db.package.role.attribute = attribute role { text }
+  db.package.attlist =
+    db.package.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.package =
+    
+    ## A software or application package
+    element package { db.package.attlist, db._text }
+}
+div {
+  db.classname.role.attribute = attribute role { text }
+  db.classname.attlist =
+    db.classname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.classname =
+    
+    ## The name of a class, in the object-oriented programming sense
+    element classname { db.classname.attlist, db._text }
+}
+div {
+  db.command.role.attribute = attribute role { text }
+  db.command.attlist =
+    db.command.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.command =
+    
+    ## The name of an executable program or other software command
+    element command { db.command.attlist, db._text }
+}
+db.computeroutput.inlines =
+  (text
+   | db.ubiq.inlines
+   | db.os.inlines
+   | db.technical.inlines
+   | db.markup.inlines)
+  | db.co
+div {
+  db.computeroutput.role.attribute = attribute role { text }
+  db.computeroutput.attlist =
+    db.computeroutput.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.computeroutput =
+    
+    ## Data, generally text, displayed or presented by a computer
+    element computeroutput {
+      db.computeroutput.attlist, db.computeroutput.inlines*
+    }
+}
+div {
+  db.database.class.enumeration =
+    
+    ## An alternate or secondary key
+    "altkey"
+    | 
+      ## A constraint
+      "constraint"
+    | 
+      ## A data type
+      "datatype"
+    | 
+      ## A field
+      "field"
+    | 
+      ## A foreign key
+      "foreignkey"
+    | 
+      ## A group
+      "group"
+    | 
+      ## An index
+      "index"
+    | 
+      ## The first or primary key
+      "key1"
+    | 
+      ## An alternate or secondary key
+      "key2"
+    | 
+      ## A name
+      "name"
+    | 
+      ## The primary key
+      "primarykey"
+    | 
+      ## A (stored) procedure
+      "procedure"
+    | 
+      ## A record
+      "record"
+    | 
+      ## A rule
+      "rule"
+    | 
+      ## The secondary key
+      "secondarykey"
+    | 
+      ## A table
+      "table"
+    | 
+      ## A user
+      "user"
+    | 
+      ## A view
+      "view"
+  db.database.class.attribute =
+    
+    ## Identifies the class of database artifact
+    attribute class { db.database.class.enumeration }
+  db.database.role.attribute = attribute role { text }
+  db.database.attlist =
+    db.database.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.database.class.attribute?
+  db.database =
+    
+    ## The name of a database, or part of a database
+    element database { db.database.attlist, db._text }
+}
+div {
+  db.email.role.attribute = attribute role { text }
+  db.email.attlist =
+    db.email.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.email =
+    
+    ## An email address
+    element email { db.email.attlist, db._text }
+}
+div {
+  db.envar.role.attribute = attribute role { text }
+  db.envar.attlist =
+    db.envar.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.envar =
+    
+    ## A software environment variable
+    element envar { db.envar.attlist, db._text }
+}
+div {
+  db.errorcode.role.attribute = attribute role { text }
+  db.errorcode.attlist =
+    db.errorcode.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.errorcode =
+    
+    ## An error code
+    element errorcode { db.errorcode.attlist, db._text }
+}
+div {
+  db.errorname.role.attribute = attribute role { text }
+  db.errorname.attlist =
+    db.errorname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.errorname =
+    
+    ## An error name
+    element errorname { db.errorname.attlist, db._text }
+}
+div {
+  db.errortext.role.attribute = attribute role { text }
+  db.errortext.attlist =
+    db.errortext.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.errortext =
+    
+    ## An error message.
+    element errortext { db.errortext.attlist, db._text }
+}
+div {
+  db.errortype.role.attribute = attribute role { text }
+  db.errortype.attlist =
+    db.errortype.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.errortype =
+    
+    ## The classification of an error message
+    element errortype { db.errortype.attlist, db._text }
+}
+div {
+  db.filename.class.enumeration =
+    
+    ## A device
+    "devicefile"
+    | 
+      ## A directory
+      "directory"
+    | 
+      ## A filename extension
+      "extension"
+    | 
+      ## A header file (as for a programming language)
+      "headerfile"
+    | 
+      ## A library file
+      "libraryfile"
+    | 
+      ## A partition (as of a hard disk)
+      "partition"
+    | 
+      ## A symbolic link
+      "symlink"
+  db.filename.class.attribute =
+    
+    ## Identifies the class of filename
+    attribute class { db.filename.class.enumeration }
+  db.filename.path.attribute =
+    
+    ## Specifies the path of the filename
+    attribute path { text }
+  db.filename.role.attribute = attribute role { text }
+  db.filename.attlist =
+    db.filename.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.filename.path.attribute?
+    & db.filename.class.attribute?
+  db.filename =
+    
+    ## The name of a file
+    element filename { db.filename.attlist, db._text }
+}
+div {
+  db.function.role.attribute = attribute role { text }
+  db.function.attlist =
+    db.function.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.function =
+    
+    ## The name of a function or subroutine, as in a programming language
+    element function { db.function.attlist, db._text }
+}
+div {
+  db.guibutton.role.attribute = attribute role { text }
+  db.guibutton.attlist =
+    db.guibutton.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.guibutton =
+    
+    ## The text on a button in a GUI
+    element guibutton {
+      db.guibutton.attlist,
+      (db._text | db.accel | db.superscript | db.subscript)*
+    }
+}
+div {
+  db.guiicon.role.attribute = attribute role { text }
+  db.guiicon.attlist =
+    db.guiicon.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.guiicon =
+    
+    ## Graphic and/or text appearing as a icon in a GUI
+    element guiicon {
+      db.guiicon.attlist,
+      (db._text | db.accel | db.superscript | db.subscript)*
+    }
+}
+div {
+  db.guilabel.role.attribute = attribute role { text }
+  db.guilabel.attlist =
+    db.guilabel.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.guilabel =
+    
+    ## The text of a label in a GUI
+    element guilabel {
+      db.guilabel.attlist,
+      (db._text | db.accel | db.superscript | db.subscript)*
+    }
+}
+div {
+  db.guimenu.role.attribute = attribute role { text }
+  db.guimenu.attlist =
+    db.guimenu.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.guimenu =
+    
+    ## The name of a menu in a GUI
+    element guimenu {
+      db.guimenu.attlist,
+      (db._text | db.accel | db.superscript | db.subscript)*
+    }
+}
+div {
+  db.guimenuitem.role.attribute = attribute role { text }
+  db.guimenuitem.attlist =
+    db.guimenuitem.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.guimenuitem =
+    
+    ## The name of a terminal menu item in a GUI
+    element guimenuitem {
+      db.guimenuitem.attlist,
+      (db._text | db.accel | db.superscript | db.subscript)*
+    }
+}
+div {
+  db.guisubmenu.role.attribute = attribute role { text }
+  db.guisubmenu.attlist =
+    db.guisubmenu.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.guisubmenu =
+    
+    ## The name of a submenu in a GUI
+    element guisubmenu {
+      db.guisubmenu.attlist,
+      (db._text | db.accel | db.superscript | db.subscript)*
+    }
+}
+div {
+  db.hardware.role.attribute = attribute role { text }
+  db.hardware.attlist =
+    db.hardware.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.hardware =
+    
+    ## A physical part of a computer system
+    element hardware { db.hardware.attlist, db._text }
+}
+div {
+  db.keycap.function.enumeration =
+    
+    ## The "Alt" key
+    "alt"
+    | 
+      ## The "Backspace" key
+      "backspace"
+    | 
+      ## The "Command" key
+      "command"
+    | 
+      ## The "Control" key
+      "control"
+    | 
+      ## The "Delete" key
+      "delete"
+    | 
+      ## The down arrow
+      "down"
+    | 
+      ## The "End" key
+      "end"
+    | 
+      ## The "Enter" or "Return" key
+      "enter"
+    | 
+      ## The "Escape" key
+      "escape"
+    | 
+      ## The "Home" key
+      "home"
+    | 
+      ## The "Insert" key
+      "insert"
+    | 
+      ## The left arrow
+      "left"
+    | 
+      ## The "Meta" key
+      "meta"
+    | 
+      ## The "Option" key
+      "option"
+    | 
+      ## The page down key
+      "pagedown"
+    | 
+      ## The page up key
+      "pageup"
+    | 
+      ## The right arrow
+      "right"
+    | 
+      ## The "Shift" key
+      "shift"
+    | 
+      ## The spacebar
+      "space"
+    | 
+      ## The "Tab" key
+      "tab"
+    | 
+      ## The up arrow
+      "up"
+  db.keycap.function-enum.attribute =
+    
+    ## Identifies the function key
+    attribute function { db.keycap.function.enumeration }?
+  db.keycap.function-other.attributes =
+    
+    ## Identifies the function key
+    attribute function {
+      
+      ## Indicates a non-standard function key
+      "other"
+    }?,
+    
+    ## Specifies a keyword that identifies the non-standard key
+    attribute otherfunction { text }
+  db.keycap.function.attrib =
+    db.keycap.function-enum.attribute
+    | db.keycap.function-other.attributes
+  db.keycap.role.attribute = attribute role { text }
+  db.keycap.attlist =
+    db.keycap.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.keycap.function.attrib
+  db.keycap =
+    
+    ## The text printed on a key on a keyboard
+    element keycap { db.keycap.attlist, db._text }
+}
+div {
+  db.keycode.role.attribute = attribute role { text }
+  db.keycode.attlist =
+    db.keycode.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.keycode =
+    
+    ## The internal, frequently numeric, identifier for a key on a keyboard
+    element keycode { db.keycode.attlist, db._text }
+}
+div {
+  db.keycombo.action.enumeration =
+    
+    ## A (single) mouse click.
+    "click"
+    | 
+      ## A double mouse click.
+      "double-click"
+    | 
+      ## A mouse or key press.
+      "press"
+    | 
+      ## Sequential clicks or presses.
+      "seq"
+    | 
+      ## Simultaneous clicks or presses.
+      "simul"
+  db.keycombo.action-enum.attribute =
+    
+    ## Identifies the nature of the action taken. If keycombo
+    ##  contains more than one element, simul
+    ##  is the default, otherwise there is no default.
+    attribute action { db.keycombo.action.enumeration }?
+  db.keycombo.action-other.attributes =
+    
+    ## Identifies the nature of the action taken
+    attribute action {
+      
+      ## Indicates a non-standard action
+      "other"
+    }?,
+    
+    ## Identifies the non-standard action in some unspecified way.
+    attribute otheraction { text }
+  db.keycombo.action.attrib =
+    db.keycombo.action-enum.attribute
+    | db.keycombo.action-other.attributes
+  db.keycombo.role.attribute = attribute role { text }
+  db.keycombo.attlist =
+    db.keycombo.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.keycombo.action.attrib
+  db.keycombo =
+    
+    ## A combination of input actions
+    element keycombo {
+      db.keycombo.attlist,
+      (db.keycap | db.keycombo | db.keysym | db.mousebutton)+
+    }
+}
+div {
+  db.keysym.role.attribute = attribute role { text }
+  db.keysym.attlist =
+    db.keysym.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.keysym =
+    
+    ## The symbolic name of a key on a keyboard
+    element keysym { db.keysym.attlist, db._text }
+}
+div {
+  db.lineannotation.role.attribute = attribute role { text }
+  db.lineannotation.attlist =
+    db.lineannotation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.lineannotation =
+    
+    ## A comment on a line in a verbatim listing
+    element lineannotation { db.lineannotation.attlist, db._text }
+}
+div {
+  db.literal.role.attribute = attribute role { text }
+  db.literal.attlist =
+    db.literal.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.literal =
+    
+    ## Inline text that is some literal value
+    element literal { db.literal.attlist, db._text }
+}
+div {
+  code.language.attribute =
+    
+    ## Identifies the (computer) language of the code fragment
+    attribute language { text }
+  db.code.role.attribute = attribute role { text }
+  db.code.attlist =
+    db.code.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & code.language.attribute?
+  db.code =
+    
+    ## An inline code fragment
+    element code {
+      db.code.attlist, (db.programming.inlines | db._text)*
+    }
+}
+div {
+  db.constant.class.attribute =
+    
+    ## Identifies the class of constant
+    attribute class {
+      
+      ## The value is a limit of some kind
+      "limit"
+    }
+  db.constant.role.attribute = attribute role { text }
+  db.constant.attlist =
+    db.constant.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.constant.class.attribute?
+  db.constant =
+    
+    ## A programming or system constant
+    element constant { db.constant.attlist, db._text }
+}
+div {
+  db.varname.role.attribute = attribute role { text }
+  db.varname.attlist =
+    db.varname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.varname =
+    
+    ## The name of a variable
+    element varname { db.varname.attlist, db._text }
+}
+div {
+  db.markup.role.attribute = attribute role { text }
+  db.markup.attlist =
+    db.markup.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.markup =
+    
+    ## A string of formatting markup in text that is to be represented literally
+    element markup { db.markup.attlist, db._text }
+}
+div {
+  db.menuchoice.role.attribute = attribute role { text }
+  db.menuchoice.attlist =
+    db.menuchoice.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.menuchoice =
+    
+    ## A selection or series of selections from a menu
+    element menuchoice {
+      db.menuchoice.attlist,
+      db.shortcut?,
+      (db.guibutton
+       | db.guiicon
+       | db.guilabel
+       | db.guimenu
+       | db.guimenuitem
+       | db.guisubmenu)+
+    }
+}
+div {
+  db.shortcut.action.attrib = db.keycombo.action.attrib
+  db.shortcut.role.attribute = attribute role { text }
+  db.shortcut.attlist =
+    db.shortcut.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.shortcut.action.attrib
+  db.shortcut =
+    
+    ## A key combination for an action that is also accessible through a menu
+    element shortcut {
+      db.shortcut.attlist,
+      (db.keycap | db.keycombo | db.keysym | db.mousebutton)+
+    }
+}
+div {
+  db.mousebutton.role.attribute = attribute role { text }
+  db.mousebutton.attlist =
+    db.mousebutton.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.mousebutton =
+    
+    ## The conventional name of a mouse button
+    element mousebutton { db.mousebutton.attlist, db._text }
+}
+div {
+  db.option.role.attribute = attribute role { text }
+  db.option.attlist =
+    db.option.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.option =
+    
+    ## An option for a software command
+    element option { db.option.attlist, db._text }
+}
+div {
+  db.optional.role.attribute = attribute role { text }
+  db.optional.attlist =
+    db.optional.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.optional =
+    
+    ## Optional information
+    element optional { db.optional.attlist, db._text }
+}
+div {
+  db.property.role.attribute = attribute role { text }
+  db.property.attlist =
+    db.property.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.property =
+    
+    ## A unit of data associated with some part of a computer system
+    element property { db.property.attlist, db._text }
+}
+div {
+  db.parameter.class.enumeration =
+    
+    ## A command
+    "command"
+    | 
+      ## A function
+      "function"
+    | 
+      ## An option
+      "option"
+  db.parameter.class.attribute =
+    
+    ## Identifies the class of parameter
+    attribute class { db.parameter.class.enumeration }
+  db.parameter.role.attribute = attribute role { text }
+  db.parameter.attlist =
+    db.parameter.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.parameter.class.attribute?
+  db.parameter =
+    
+    ## A value or a symbolic reference to a value
+    element parameter { db.parameter.attlist, db._text }
+}
+db.prompt.inlines = db._text | db.co
+div {
+  db.prompt.role.attribute = attribute role { text }
+  db.prompt.attlist =
+    db.prompt.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.prompt =
+    
+    ## A character or string indicating the start of an input field in a  computer display
+    element prompt { db.prompt.attlist, db.prompt.inlines* }
+}
+db.replaceable.inlines = db._text | db.co
+div {
+  db.replaceable.class.enumeration =
+    
+    ## A command
+    "command"
+    | 
+      ## A function
+      "function"
+    | 
+      ## An option
+      "option"
+    | 
+      ## A parameter
+      "parameter"
+  db.replaceable.class.attribute =
+    
+    ## Identifies the nature of the replaceable text
+    attribute class { db.replaceable.class.enumeration }
+  db.replaceable.role.attribute = attribute role { text }
+  db.replaceable.attlist =
+    db.replaceable.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.replaceable.class.attribute?
+  db.replaceable =
+    
+    ## Content that may or must be replaced by the user
+    element replaceable {
+      db.replaceable.attlist, db.replaceable.inlines*
+    }
+}
+div {
+  db.returnvalue.role.attribute = attribute role { text }
+  db.returnvalue.attlist =
+    db.returnvalue.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.returnvalue =
+    
+    ## The value returned by a function
+    element returnvalue { db.returnvalue.attlist, db._text }
+}
+div {
+  db.tag.role.attribute = attribute role { text }
+  db.tag.class.enumeration =
+    
+    ## An attribute
+    "attribute"
+    | 
+      ## An attribute value
+      "attvalue"
+    | 
+      ## An element
+      "element"
+    | 
+      ## An empty element tag
+      "emptytag"
+    | 
+      ## An end tag
+      "endtag"
+    | 
+      ## A general entity
+      "genentity"
+    | 
+      ## The local name part of a qualified name
+      "localname"
+    | 
+      ## A namespace
+      "namespace"
+    | 
+      ## A numeric character reference
+      "numcharref"
+    | 
+      ## A parameter entity
+      "paramentity"
+    | 
+      ## A processing instruction
+      "pi"
+    | 
+      ## The prefix part of a qualified name
+      "prefix"
+    | 
+      ## An SGML comment
+      "comment"
+    | 
+      ## A start tag
+      "starttag"
+    | 
+      ## An XML processing instruction
+      "xmlpi"
+  db.tag.class.attribute =
+    
+    ## Identifies the nature of the tag content
+    attribute class { db.tag.class.enumeration }
+  db.tag.namespace.attribute =
+    
+    ## Identifies the namespace of the tag content
+    attribute namespace { xsd:anyURI }
+  db.tag.attlist =
+    db.tag.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.tag.class.attribute?
+    & db.tag.namespace.attribute?
+  db.tag =
+    
+    ## A component of XML (or SGML) markup
+    element tag { db.tag.attlist, db._text }
+}
+div {
+  db.symbol.class.attribute =
+    
+    ## Identifies the class of symbol
+    attribute class {
+      
+      ## The value is a limit of some kind
+      "limit"
+    }
+  db.symbol.role.attribute = attribute role { text }
+  db.symbol.attlist =
+    db.symbol.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.symbol.class.attribute?
+  db.symbol =
+    
+    ## A name that is replaced by a value before processing
+    element symbol { db.symbol.attlist, db._text }
+}
+db.systemitem.inlines = db._text | db.co
+div {
+  db.systemitem.class.enumeration =
+    
+    ## A daemon or other system process (syslogd)
+    "daemon"
+    | 
+      ## A domain name (example.com)
+      "domainname"
+    | 
+      ## An ethernet address (00:05:4E:49:FD:8E)
+      "etheraddress"
+    | 
+      ## An event of some sort (SIGHUP)
+      "event"
+    | 
+      ## An event handler of some sort (hangup)
+      "eventhandler"
+    | 
+      ## A filesystem (ext3)
+      "filesystem"
+    | 
+      ## A fully qualified domain name (my.example.com)
+      "fqdomainname"
+    | 
+      ## A group name (wheel)
+      "groupname"
+    | 
+      ## An IP address (127.0.0.1)
+      "ipaddress"
+    | 
+      ## A library (libncurses)
+      "library"
+    | 
+      ## A macro
+      "macro"
+    | 
+      ## A netmask (255.255.255.192)
+      "netmask"
+    | 
+      ## A newsgroup (comp.text.xml)
+      "newsgroup"
+    | 
+      ## An operating system name (Hurd)
+      "osname"
+    | 
+      ## A process (gnome-cups-icon)
+      "process"
+    | 
+      ## A protocol (ftp)
+      "protocol"
+    | 
+      ## A resource
+      "resource"
+    | 
+      ## A server (mail.example.com)
+      "server"
+    | 
+      ## A service (ppp)
+      "service"
+    | 
+      ## A system name (hephaistos)
+      "systemname"
+    | 
+      ## A user name (ndw)
+      "username"
+  db.systemitem.class.attribute =
+    
+    ## Identifies the nature of the system item
+    attribute class { db.systemitem.class.enumeration }
+  db.systemitem.role.attribute = attribute role { text }
+  db.systemitem.attlist =
+    db.systemitem.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.systemitem.class.attribute?
+  db.systemitem =
+    
+    ## A system-related item or term
+    element systemitem { db.systemitem.attlist, db.systemitem.inlines* }
+}
+div {
+  db.uri.type.attribute =
+    
+    ## Identifies the type of URI specified
+    attribute type { text }?
+  db.uri.role.attribute = attribute role { text }
+  db.uri.attlist =
+    db.uri.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.uri.type.attribute
+  db.uri =
+    
+    ## A Uniform Resource Identifier
+    element uri { db.uri.attlist, db._text }
+}
+div {
+  db.token.role.attribute = attribute role { text }
+  db.token.attlist =
+    db.token.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.token =
+    
+    ## A unit of information
+    element token { db.token.attlist, db._text }
+}
+div {
+  db.type.role.attribute = attribute role { text }
+  db.type.attlist =
+    db.type.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.type =
+    
+    ## The classification of a value
+    element type { db.type.attlist, db._text }
+}
+db.userinput.inlines =
+  (text
+   | db.ubiq.inlines
+   | db.os.inlines
+   | db.technical.inlines
+   | db.markup.inlines)
+  | db.co
+div {
+  db.userinput.role.attribute = attribute role { text }
+  db.userinput.attlist =
+    db.userinput.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.userinput =
+    
+    ## Data entered by the user
+    element userinput { db.userinput.attlist, db.userinput.inlines* }
+}
+div {
+  db.abbrev.role.attribute = attribute role { text }
+  db.abbrev.attlist =
+    db.abbrev.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.abbrev =
+    
+    ## An abbreviation, especially one followed by a period
+    element abbrev {
+      db.abbrev.attlist,
+      (db._text | db.superscript | db.subscript | db.trademark)*
+    }
+}
+div {
+  db.acronym.role.attribute = attribute role { text }
+  db.acronym.attlist =
+    db.acronym.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.acronym =
+    
+    ## An often pronounceable word made from the initial (or selected) letters of a name or phrase
+    element acronym {
+      db.acronym.attlist,
+      (db._text | db.superscript | db.subscript | db.trademark)*
+    }
+}
+div {
+  db.citation.role.attribute = attribute role { text }
+  db.citation.attlist =
+    db.citation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.citation =
+    
+    ## An inline bibliographic reference to another published work
+    element citation { db.citation.attlist, db.all.inlines* }
+}
+div {
+  db.citerefentry.role.attribute = attribute role { text }
+  db.citerefentry.attlist =
+    db.citerefentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.citerefentry =
+    
+    ## A citation to a reference page
+    element citerefentry {
+      db.citerefentry.attlist, db.refentrytitle, db.manvolnum?
+    }
+}
+div {
+  db.refentrytitle.role.attribute = attribute role { text }
+  db.refentrytitle.attlist =
+    db.refentrytitle.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refentrytitle =
+    
+    ## The title of a reference page
+    element refentrytitle { db.refentrytitle.attlist, db.all.inlines* }
+}
+div {
+  db.manvolnum.role.attribute = attribute role { text }
+  db.manvolnum.attlist =
+    db.manvolnum.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.manvolnum =
+    
+    ## A reference volume number
+    element manvolnum { db.manvolnum.attlist, db._text }
+}
+div {
+  db.citetitle.pubwork.enumeration =
+    
+    ## An article
+    "article"
+    | 
+      ## A bulletin board system
+      "bbs"
+    | 
+      ## A book
+      "book"
+    | 
+      ## A CD-ROM
+      "cdrom"
+    | 
+      ## A chapter (as of a book)
+      "chapter"
+    | 
+      ## A DVD
+      "dvd"
+    | 
+      ## An email message
+      "emailmessage"
+    | 
+      ## A gopher page
+      "gopher"
+    | 
+      ## A journal
+      "journal"
+    | 
+      ## A manuscript
+      "manuscript"
+    | 
+      ## A posting to a newsgroup
+      "newsposting"
+    | 
+      ## A part (as of a book)
+      "part"
+    | 
+      ## A reference entry
+      "refentry"
+    | 
+      ## A section (as of a book or article)
+      "section"
+    | 
+      ## A series
+      "series"
+    | 
+      ## A set (as of books)
+      "set"
+    | 
+      ## A web page
+      "webpage"
+    | 
+      ## A wiki page
+      "wiki"
+  db.citetitle.pubwork.attribute =
+    
+    ## Identifies the nature of the publication being cited
+    attribute pubwork { db.citetitle.pubwork.enumeration }
+  db.citetitle.role.attribute = attribute role { text }
+  db.citetitle.attlist =
+    db.citetitle.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.citetitle.pubwork.attribute?
+  db.citetitle =
+    
+    ## The title of a cited work
+    element citetitle { db.citetitle.attlist, db.all.inlines* }
+}
+div {
+  db.emphasis.role.attribute = attribute role { text }
+  db.emphasis.attlist =
+    db.emphasis.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.emphasis =
+    
+    ## Emphasized text
+    element emphasis { db.emphasis.attlist, db.all.inlines* }
+}
+div {
+  db._emphasis =
+    
+    ## A limited span of emphasized text
+    element emphasis { db.emphasis.attlist, (db._text | db._emphasis)* }
+}
+div {
+  db.foreignphrase.role.attribute = attribute role { text }
+  db.foreignphrase.attlist =
+    db.foreignphrase.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.foreignphrase =
+    
+    ## A word or phrase in a language other than the primary language of the document
+    element foreignphrase {
+      db.foreignphrase.attlist, (text | db.general.inlines)*
+    }
+}
+div {
+  db.phrase.role.attribute = attribute role { text }
+  db.phrase.attlist =
+    db.phrase.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.phrase =
+    
+    ## A span of text
+    element phrase { db.phrase.attlist, db.all.inlines* }
+}
+div {
+  db._phrase =
+    
+    ## A limited span of text
+    element phrase { db.phrase.attlist, db._text }
+}
+div {
+  db.quote.role.attribute = attribute role { text }
+  db.quote.attlist =
+    db.quote.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.quote =
+    
+    ## An inline quotation
+    element quote { db.quote.attlist, db.all.inlines* }
+}
+div {
+  db.subscript.role.attribute = attribute role { text }
+  db.subscript.attlist =
+    db.subscript.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.subscript =
+    
+    ## A subscript (as in H2
+    ## O, the molecular formula for water)
+    element subscript { db.subscript.attlist, db._text }
+}
+div {
+  db.superscript.role.attribute = attribute role { text }
+  db.superscript.attlist =
+    db.superscript.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.superscript =
+    
+    ## A superscript (as in x^2, the mathematical notation for x multiplied by itself)
+    element superscript { db.superscript.attlist, db._text }
+}
+div {
+  db.trademark.class.enumeration =
+    
+    ## A copyright
+    "copyright"
+    | 
+      ## A registered copyright
+      "registered"
+    | 
+      ## A service
+      "service"
+    | 
+      ## A trademark
+      "trade"
+  db.trademark.class.attribute =
+    
+    ## Identifies the class of trade mark
+    attribute class { db.trademark.class.enumeration }
+  db.trademark.role.attribute = attribute role { text }
+  db.trademark.attlist =
+    db.trademark.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.trademark.class.attribute?
+  db.trademark =
+    
+    ## A trademark
+    element trademark { db.trademark.attlist, db._text }
+}
+div {
+  db.wordasword.role.attribute = attribute role { text }
+  db.wordasword.attlist =
+    db.wordasword.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.wordasword =
+    
+    ## A word meant specifically as a word and not representing anything else
+    element wordasword { db.wordasword.attlist, db._text }
+}
+div {
+  db.footnoteref.role.attribute = attribute role { text }
+  db.footnoteref.label.attribute = db.label.attribute
+  db.footnoteref.attlist =
+    db.footnoteref.role.attribute?
+    & db.common.attributes
+    & db.linkend.attribute
+    & db.footnoteref.label.attribute?
+  db.footnoteref =
+    
+    ## A cross reference to a footnote (a footnote mark)
+    [
+      s:pattern [
+        name = "Footnote reference type constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:footnoteref"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test =
+              "local-name(//*[@xml:id=current()/@linkend]) = 'footnote' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+            "@linkend on footnoteref must point to a footnote."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element footnoteref { db.footnoteref.attlist, empty }
+}
+div {
+  db.xref.role.attribute = attribute role { text }
+  db.xref.xrefstyle.attribute = db.xrefstyle.attribute
+  db.xref.endterm.attribute = db.endterm.attribute
+  db.xref.attlist =
+    db.xref.role.attribute?
+    & db.common.attributes
+    & db.common.req.linking.attributes
+    & db.xref.xrefstyle.attribute?
+    & db.xref.endterm.attribute?
+  db.xref =
+    
+    ## A cross reference to another part of the document
+    element xref { db.xref.attlist, empty }
+}
+div {
+  db.link.role.attribute = attribute role { text }
+  db.link.xrefstyle.attribute = db.xrefstyle.attribute
+  db.link.endterm.attribute = db.endterm.attribute
+  db.link.attlist =
+    db.link.role.attribute?
+    & db.common.attributes
+    & db.common.req.linking.attributes
+    & db.link.xrefstyle.attribute?
+    & db.link.endterm.attribute?
+  db.link =
+    
+    ## A hypertext link
+    element link { db.link.attlist, db.all.inlines* }
+}
+div {
+  db.olink.role.attribute = attribute role { text }
+  db.olink.xrefstyle.attribute = db.xrefstyle.attribute
+  db.olink.localinfo.attribute =
+    
+    ## Holds additional information that may be used by the applicatoin when resolving the link
+    attribute localinfo { text }
+  db.olink.targetdoc.attribute =
+    
+    ## Specifies the URI of the document in which the link target appears
+    attribute targetdoc { xsd:anyURI }
+  db.olink.targetptr.attribute =
+    
+    ## Specifies the location of the link target in the document
+    attribute targetptr { text }
+  db.olink.type.attribute =
+    
+    ## Identifies application-specific customization of the link behavior
+    attribute type { text }
+  db.olink.attlist =
+    db.common.attributes
+    & db.olink.targetdoc.attribute?
+    & db.olink.role.attribute?
+    & db.olink.xrefstyle.attribute?
+    & db.olink.localinfo.attribute?
+    & db.olink.targetptr.attribute?
+    & db.olink.type.attribute?
+  db.olink =
+    
+    ## A link that addresses its target indirectly
+    element olink { db.olink.attlist, db.all.inlines* }
+}
+div {
+  db.anchor.role.attribute = attribute role { text }
+  db.anchor.attlist =
+    db.anchor.role.attribute? & db.common.idreq.attributes
+  db.anchor =
+    
+    ## A spot in the document
+    element anchor { db.anchor.attlist, empty }
+}
+div {
+  db.alt.role.attribute = attribute role { text }
+  db.alt.attlist = db.alt.role.attribute? & db.common.attributes
+  db.alt =
+    
+    ## A text-only annotation, often used for accessibility
+    element alt { db.alt.attlist, (text | db.inlinemediaobject)* }
+}
+db.annotations.attribute =
+  
+  ## Identifies one or more annotations that apply to this element
+  attribute annotations { text }
+div {
+  db.annotation.role.attribute = attribute role { text }
+  db.annotation.annotates.attribute =
+    
+    ## Identifies one ore more elements to which this annotation applies
+    attribute annotates { text }
+  db.annotation.attlist =
+    db.annotation.role.attribute?
+    & db.annotation.annotates.attribute?
+    & db.common.attributes
+  db.annotation.info = db._info.title.only
+  db.annotation =
+    
+    ## An annotation
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:annotation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:annotation)"
+            "annotation must not occur in the descendants of annotation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element annotation {
+      db.annotation.attlist, db.annotation.info, db.all.blocks+
+    }
+}
+db.xlink.from.attribute =
+  
+  ## Specifies the XLink traversal-from
+  attribute xlink:from { xsd:NMTOKEN }?
+db.xlink.label.attribute =
+  
+  ## Specifies the XLink label
+  attribute xlink:label { xsd:NMTOKEN }?
+db.xlink.to.attribute =
+  
+  ## Specifies the XLink traversal-to
+  attribute xlink:to { xsd:NMTOKEN }?
+div {
+  db.extendedlink.role.attribute = attribute role { text }
+  db.extendedlink.attlist =
+    db.extendedlink.role.attribute?
+    & db.common.attributes
+    & 
+      ## Identifies the XLink link type 
+      [ a:defaultValue = "extended" ]
+      attribute xlink:type {
+        
+        ## An XLink extended link
+        "extended"
+      }?
+    & db.xlink.role.attribute?
+    & db.xlink.title.attribute?
+  db.extendedlink =
+    
+    ## An XLink extended link
+    element extendedlink {
+      db.extendedlink.attlist, (db.locator | db.arc)+
+    }
+}
+div {
+  db.locator.role.attribute = attribute role { text }
+  db.locator.attlist =
+    db.locator.role.attribute?
+    & db.common.attributes
+    & 
+      ## Identifies the XLink link type 
+      [ a:defaultValue = "locator" ]
+      attribute xlink:type {
+        
+        ## An XLink locator link
+        "locator"
+      }?
+    & db.xlink.href.attribute
+    & db.xlink.role.attribute?
+    & db.xlink.title.attribute?
+    & db.xlink.label.attribute?
+  db.locator =
+    
+    ## An XLink locator in an extendedlink
+    element locator { db.locator.attlist, empty }
+}
+div {
+  db.arc.role.attribute = attribute role { text }
+  db.arc.attlist =
+    db.arc.role.attribute?
+    & db.common.attributes
+    & 
+      ## Identifies the XLink link type 
+      [ a:defaultValue = "arc" ]
+      attribute xlink:type {
+        
+        ## An XLink arc link
+        "arc"
+      }?
+    & db.xlink.arcrole.attribute?
+    & db.xlink.title.attribute?
+    & db.xlink.show.attribute?
+    & db.xlink.actuate.attribute?
+    & db.xlink.from.attribute?
+    & db.xlink.to.attribute?
+  db.arc =
+    
+    ## An XLink arc in an extendedlink
+    element arc { db.arc.attlist, empty }
+}
+db.status.attribute =
+  
+  ## Identifies the editorial or publication status of the element on which it occurs
+  attribute status { text }
+db.toplevel.sections =
+  ((db.section+, db.simplesect*) | db.simplesect+)
+  | (db.sect1+, db.simplesect*)
+  | db.refentry+
+db.toplevel.blocks.or.sections =
+  (db.all.blocks+, db.toplevel.sections?) | db.toplevel.sections
+db.recursive.sections =
+  ((db.section+, db.simplesect*) | db.simplesect+)
+  | db.refentry+
+db.recursive.blocks.or.sections =
+  (db.all.blocks+, db.recursive.sections?) | db.recursive.sections
+db.divisions = db.part | db.reference
+db.components =
+  db.dedication
+  | db.acknowledgements
+  | db.preface
+  | db.chapter
+  | db.appendix
+  | db.article
+  | db.colophon
+db.navigation.components =
+  notAllowed | db.glossary | db.bibliography | db.index | db.toc
+db.component.contentmodel =
+  db.navigation.components*,
+  db.toplevel.blocks.or.sections,
+  db.navigation.components*
+db.setindex.components = notAllowed | db.setindex
+db.toc.components = notAllowed | db.toc
+db.set.components = db.set | db.book
+div {
+  db.set.status.attribute = db.status.attribute
+  db.set.role.attribute = attribute role { text }
+  db.set.attlist =
+    db.set.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.set.status.attribute?
+  db.set.info = db._info.title.req
+  db.set =
+    
+    ## A collection of books
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:set"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element set {
+      db.set.attlist,
+      db.set.info,
+      db.toc.components?,
+      db.set.components+,
+      db.setindex.components?
+    }
+}
+div {
+  db.book.status.attribute = db.status.attribute
+  db.book.role.attribute = attribute role { text }
+  db.book.attlist =
+    db.book.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.book.status.attribute?
+  db.book.info = db._info.title.req
+  db.book =
+    
+    ## A book
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:book"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element book {
+      db.book.attlist,
+      db.book.info,
+      (db.navigation.components | db.components | db.divisions)+
+    }
+}
+div {
+  db.dedication.status.attribute = db.status.attribute
+  db.dedication.role.attribute = attribute role { text }
+  db.dedication.attlist =
+    db.dedication.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.dedication.status.attribute?
+  db.dedication.info = db._info
+  db.dedication =
+    
+    ## The dedication of a book or other component
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:dedication"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element dedication {
+      db.dedication.attlist, db.dedication.info, db.all.blocks+
+    }
+}
+div {
+  db.acknowledgements.status.attribute = db.status.attribute
+  db.acknowledgements.role.attribute = attribute role { text }
+  db.acknowledgements.attlist =
+    db.acknowledgements.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.acknowledgements.status.attribute?
+  db.acknowledgements.info = db._info
+  db.acknowledgements =
+    
+    ## Acknowledgements of a book or other component
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:acknowledgements"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element acknowledgements {
+      db.acknowledgements.attlist,
+      db.acknowledgements.info,
+      db.all.blocks+
+    }
+}
+div {
+  db.colophon.status.attribute = db.status.attribute
+  db.colophon.role.attribute = attribute role { text }
+  db.colophon.attlist =
+    db.colophon.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.colophon.status.attribute?
+  db.colophon.info = db._info
+  db.colophon =
+    
+    ## Text at the back of a book describing facts about its production
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:colophon"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element colophon {
+      db.colophon.attlist, db.colophon.info, db.all.blocks+
+    }
+}
+div {
+  db.appendix.status.attribute = db.status.attribute
+  db.appendix.role.attribute = attribute role { text }
+  db.appendix.attlist =
+    db.appendix.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.appendix.status.attribute?
+  db.appendix.info = db._info.title.req
+  db.appendix =
+    
+    ## An appendix in a Book or Article
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:appendix"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element appendix {
+      db.appendix.attlist, db.appendix.info, db.component.contentmodel
+    }
+}
+div {
+  db.chapter.status.attribute = db.status.attribute
+  db.chapter.role.attribute = attribute role { text }
+  db.chapter.attlist =
+    db.chapter.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.chapter.status.attribute?
+  db.chapter.info = db._info.title.req
+  db.chapter =
+    
+    ## A chapter, as of a book
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:chapter"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element chapter {
+      db.chapter.attlist, db.chapter.info, db.component.contentmodel
+    }
+}
+db.part.components =
+  (db.navigation.components | db.components)
+  | (db.refentry | db.reference)
+div {
+  db.part.status.attribute = db.status.attribute
+  db.part.role.attribute = attribute role { text }
+  db.part.attlist =
+    db.part.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.part.status.attribute?
+  db.part.info = db._info.title.req
+  db.part =
+    
+    ## A division in a book
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:part"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element part {
+      db.part.attlist, db.part.info, db.partintro?, db.part.components+
+    }
+}
+div {
+  db.preface.status.attribute = db.status.attribute
+  db.preface.role.attribute = attribute role { text }
+  db.preface.attlist =
+    db.preface.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.preface.status.attribute?
+  db.preface.info = db._info.title.req
+  db.preface =
+    
+    ## Introductory matter preceding the first chapter of a book
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:preface"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element preface {
+      db.preface.attlist, db.preface.info, db.component.contentmodel
+    }
+}
+div {
+  db.partintro.status.attribute = db.status.attribute
+  db.partintro.role.attribute = attribute role { text }
+  db.partintro.attlist =
+    db.partintro.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.partintro.status.attribute?
+  db.partintro.info = db._info
+  db.partintro =
+    
+    ## An introduction to the contents of a part
+    element partintro {
+      db.partintro.attlist,
+      db.partintro.info,
+      db.toplevel.blocks.or.sections
+    }
+}
+div {
+  db.section.status.attribute = db.status.attribute
+  db.section.role.attribute = attribute role { text }
+  db.section.attlist =
+    db.section.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.section.status.attribute?
+  db.section.info = db._info.title.req
+  db.section =
+    
+    ## A recursive section
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:section"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element section {
+      db.section.attlist,
+      db.section.info,
+      db.recursive.blocks.or.sections,
+      db.navigation.components*
+    }
+}
+div {
+  db.simplesect.status.attribute = db.status.attribute
+  db.simplesect.role.attribute = attribute role { text }
+  db.simplesect.attlist =
+    db.simplesect.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.simplesect.status.attribute?
+  db.simplesect.info = db._info.title.req
+  db.simplesect =
+    
+    ## A section of a document with no subdivisions
+    element simplesect {
+      db.simplesect.attlist, db.simplesect.info, db.all.blocks+
+    }
+}
+db.article.components = db.toplevel.sections
+div {
+  db.article.status.attribute = db.status.attribute
+  db.article.class.enumeration =
+    
+    ## A collection of frequently asked questions.
+    "faq"
+    | 
+      ## An article in a journal or other periodical.
+      "journalarticle"
+    | 
+      ## A description of a product.
+      "productsheet"
+    | 
+      ## A specification.
+      "specification"
+    | 
+      ## A technical report.
+      "techreport"
+    | 
+      ## A white paper.
+      "whitepaper"
+  db.article.class.attribute =
+    
+    ## Identifies the nature of the article
+    attribute class { db.article.class.enumeration }
+  db.article.role.attribute = attribute role { text }
+  db.article.attlist =
+    db.article.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.article.status.attribute?
+    & db.article.class.attribute?
+  db.article.info = db._info.title.req
+  db.article =
+    
+    ## An article
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:article"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element article {
+      db.article.attlist,
+      db.article.info,
+      (db.navigation.components
+       | db.appendix
+       | db.acknowledgements
+       | db.colophon)*,
+      ((db.all.blocks+, db.article.components?)
+       | db.article.components),
+      (db.navigation.components
+       | db.appendix
+       | db.acknowledgements
+       | db.colophon)*
+    }
+}
+db.sect1.sections = (db.sect2+, db.simplesect*) | db.simplesect+
+div {
+  db.sect1.status.attribute = db.status.attribute
+  db.sect1.role.attribute = attribute role { text }
+  db.sect1.attlist =
+    db.sect1.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.sect1.status.attribute?
+  db.sect1.info = db._info.title.req
+  db.sect1 =
+    
+    ## A top-level section of document
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:sect1"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element sect1 {
+      db.sect1.attlist,
+      db.sect1.info,
+      ((db.all.blocks+, db.sect1.sections?) | db.sect1.sections),
+      db.navigation.components*
+    }
+}
+db.sect2.sections = (db.sect3+, db.simplesect*) | db.simplesect+
+div {
+  db.sect2.status.attribute = db.status.attribute
+  db.sect2.role.attribute = attribute role { text }
+  db.sect2.attlist =
+    db.sect2.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.sect2.status.attribute?
+  db.sect2.info = db._info.title.req
+  db.sect2 =
+    
+    ## A subsection within a Sect1
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:sect2"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element sect2 {
+      db.sect2.attlist,
+      db.sect2.info,
+      ((db.all.blocks+, db.sect2.sections?) | db.sect2.sections),
+      db.navigation.components*
+    }
+}
+db.sect3.sections = (db.sect4+, db.simplesect*) | db.simplesect+
+div {
+  db.sect3.status.attribute = db.status.attribute
+  db.sect3.role.attribute = attribute role { text }
+  db.sect3.attlist =
+    db.sect3.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.sect3.status.attribute?
+  db.sect3.info = db._info.title.req
+  db.sect3 =
+    
+    ## A subsection within a Sect2
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:sect3"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element sect3 {
+      db.sect3.attlist,
+      db.sect3.info,
+      ((db.all.blocks+, db.sect3.sections?) | db.sect3.sections),
+      db.navigation.components*
+    }
+}
+db.sect4.sections = (db.sect5+, db.simplesect*) | db.simplesect+
+div {
+  db.sect4.status.attribute = db.status.attribute
+  db.sect4.role.attribute = attribute role { text }
+  db.sect4.attlist =
+    db.sect4.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.sect4.status.attribute?
+  db.sect4.info = db._info.title.req
+  db.sect4 =
+    
+    ## A subsection within a Sect3
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:sect4"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element sect4 {
+      db.sect4.attlist,
+      db.sect4.info,
+      ((db.all.blocks+, db.sect4.sections?) | db.sect4.sections),
+      db.navigation.components*
+    }
+}
+db.sect5.sections = db.simplesect+
+div {
+  db.sect5.status.attribute = db.status.attribute
+  db.sect5.role.attribute = attribute role { text }
+  db.sect5.attlist =
+    db.sect5.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.sect5.status.attribute?
+  db.sect5.info = db._info.title.req
+  db.sect5 =
+    
+    ## A subsection within a Sect4
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:sect5"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element sect5 {
+      db.sect5.attlist,
+      db.sect5.info,
+      ((db.all.blocks+, db.sect5.sections?) | db.sect5.sections),
+      db.navigation.components*
+    }
+}
+db.toplevel.refsection = db.refsection+ | db.refsect1+
+db.secondlevel.refsection = db.refsection+ | db.refsect2+
+db.reference.components = db.refentry
+div {
+  db.reference.role.attribute = attribute role { text }
+  db.reference.attlist =
+    db.reference.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.status.attribute?
+    & db.label.attribute?
+  db.reference.info = db._info.title.req
+  db.reference =
+    
+    ## A collection of reference entries
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:reference"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element reference {
+      db.reference.attlist,
+      db.reference.info,
+      db.partintro?,
+      db.reference.components+
+    }
+}
+div {
+  db.refentry.role.attribute = attribute role { text }
+  db.refentry.attlist =
+    db.refentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.status.attribute?
+    & db.label.attribute?
+  db.refentry.info = db._info.title.forbidden
+  db.refentry =
+    
+    ## A reference page (originally a UNIX man-style reference page)
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:refentry"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element refentry {
+      db.refentry.attlist,
+      db.indexterm*,
+      db.refentry.info,
+      db.refmeta?,
+      db.refnamediv+,
+      db.refsynopsisdiv?,
+      db.toplevel.refsection
+    }
+}
+div {
+  db.refmeta.role.attribute = attribute role { text }
+  db.refmeta.attlist =
+    db.refmeta.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refmeta =
+    
+    ## Meta-information for a reference entry
+    element refmeta {
+      db.refmeta.attlist,
+      db.indexterm*,
+      db.refentrytitle,
+      db.manvolnum?,
+      db.refmiscinfo*,
+      db.indexterm*
+    }
+}
+db.refmiscinfo.class.enumeration =
+  
+  ## The name of the software product or component to which this topic applies
+  "source"
+  | 
+    ## The version of the software product or component to which this topic applies
+    "version"
+  | 
+    ## The section title of the reference page (e.g., User Commands)
+    "manual"
+  | 
+    ## The section title of the reference page (believed synonymous with "manual" but in wide use)
+    "sectdesc"
+  | 
+    ## The name of the software product or component to which this topic applies (e.g., SunOS x.y; believed synonymous with "source" but in wide use)
+    "software"
+db.refmiscinfo.class-enum.attribute =
+  
+  ## Identifies the kind of miscellaneous information
+  attribute class { db.refmiscinfo.class.enumeration }?
+db.refmiscinfo.class-other.attribute =
+  
+  ## Identifies the nature of non-standard miscellaneous information
+  attribute otherclass { text }
+db.refmiscinfo.class-other.attributes =
+  
+  ## Identifies the kind of miscellaneious information
+  attribute class {
+    
+    ## Indicates that the information is some 'other' kind.
+    "other"
+  }
+  & db.refmiscinfo.class-other.attribute
+db.refmiscinfo.class.attribute =
+  db.refmiscinfo.class-enum.attribute
+  | db.refmiscinfo.class-other.attributes
+div {
+  db.refmiscinfo.role.attribute = attribute role { text }
+  db.refmiscinfo.attlist =
+    db.refmiscinfo.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.refmiscinfo.class.attribute?
+  db.refmiscinfo =
+    
+    ## Meta-information for a reference entry other than the title and volume number
+    element refmiscinfo { db.refmiscinfo.attlist, db._text }
+}
+div {
+  db.refnamediv.role.attribute = attribute role { text }
+  db.refnamediv.attlist =
+    db.refnamediv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refnamediv =
+    
+    ## The name, purpose, and classification of a reference page
+    element refnamediv {
+      db.refnamediv.attlist,
+      db.refdescriptor?,
+      db.refname+,
+      db.refpurpose,
+      db.refclass*
+    }
+}
+div {
+  db.refdescriptor.role.attribute = attribute role { text }
+  db.refdescriptor.attlist =
+    db.refdescriptor.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refdescriptor =
+    
+    ## A description of the topic of a reference page
+    element refdescriptor { db.refdescriptor.attlist, db.all.inlines* }
+}
+div {
+  db.refname.role.attribute = attribute role { text }
+  db.refname.attlist =
+    db.refname.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refname =
+    
+    ## The name of (one of) the subject(s) of a reference page
+    element refname { db.refname.attlist, db.all.inlines* }
+}
+div {
+  db.refpurpose.role.attribute = attribute role { text }
+  db.refpurpose.attlist =
+    db.refpurpose.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refpurpose =
+    
+    ## A short (one sentence) synopsis of the topic of a reference page
+    element refpurpose { db.refpurpose.attlist, db.all.inlines* }
+}
+div {
+  db.refclass.role.attribute = attribute role { text }
+  db.refclass.attlist =
+    db.refclass.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refclass =
+    
+    ## The scope or other indication of applicability of a reference entry
+    element refclass { db.refclass.attlist, (text | db.application)* }
+}
+div {
+  db.refsynopsisdiv.role.attribute = attribute role { text }
+  db.refsynopsisdiv.attlist =
+    db.refsynopsisdiv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.refsynopsisdiv.info = db._info
+  db.refsynopsisdiv =
+    
+    ## A syntactic synopsis of the subject of the reference page
+    element refsynopsisdiv {
+      db.refsynopsisdiv.attlist,
+      db.refsynopsisdiv.info,
+      ((db.all.blocks+, db.secondlevel.refsection?)
+       | db.secondlevel.refsection)
+    }
+}
+div {
+  db.refsection.role.attribute = attribute role { text }
+  db.refsection.attlist =
+    db.refsection.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.status.attribute?
+    & db.label.attribute?
+  db.refsection.info = db._info.title.req
+  db.refsection =
+    
+    ## A recursive section in a refentry
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:refsection"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element refsection {
+      db.refsection.attlist,
+      db.refsection.info,
+      ((db.all.blocks+, db.refsection*) | db.refsection+)
+    }
+}
+db.refsect1.sections = db.refsect2+
+div {
+  db.refsect1.status.attribute = db.status.attribute
+  db.refsect1.role.attribute = attribute role { text }
+  db.refsect1.attlist =
+    db.refsect1.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.refsect1.status.attribute?
+  db.refsect1.info = db._info.title.req
+  db.refsect1 =
+    
+    ## A major subsection of a reference entry
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:refsect1"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element refsect1 {
+      db.refsect1.attlist,
+      db.refsect1.info,
+      ((db.all.blocks+, db.refsect1.sections?) | db.refsect1.sections)
+    }
+}
+db.refsect2.sections = db.refsect3+
+div {
+  db.refsect2.status.attribute = db.status.attribute
+  db.refsect2.role.attribute = attribute role { text }
+  db.refsect2.attlist =
+    db.refsect2.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.refsect2.status.attribute?
+  db.refsect2.info = db._info.title.req
+  db.refsect2 =
+    
+    ## A subsection of a refsect1
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:refsect2"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element refsect2 {
+      db.refsect2.attlist,
+      db.refsect2.info,
+      ((db.all.blocks+, db.refsect2.sections?) | db.refsect2.sections)
+    }
+}
+div {
+  db.refsect3.status.attribute = db.status.attribute
+  db.refsect3.role.attribute = attribute role { text }
+  db.refsect3.attlist =
+    db.refsect3.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.refsect3.status.attribute?
+  db.refsect3.info = db._info.title.req
+  db.refsect3 =
+    
+    ## A subsection of a refsect2
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:refsect3"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element refsect3 {
+      db.refsect3.attlist, db.refsect3.info, db.all.blocks+
+    }
+}
+db.glossary.inlines = db.firstterm | db.glossterm
+db.baseform.attribute =
+  
+  ## Specifies the base form of the term, the one that appears in the glossary. This allows adjectival, plural, and other variations of the term to appear in the element. The element content is the default base form.
+  attribute baseform { text }?
+div {
+  db.glosslist.role.attribute = attribute role { text }
+  db.glosslist.attlist =
+    db.glosslist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.glosslist.info = db._info.title.only
+  db.glosslist =
+    
+    ## A wrapper for a list of glossary entries
+    element glosslist {
+      db.glosslist.attlist,
+      db.glosslist.info?,
+      db.all.blocks*,
+      db.glossentry+
+    }
+}
+div {
+  db.glossentry.role.attribute = attribute role { text }
+  db.glossentry.sortas.attribute =
+    
+    ## Specifies the string by which the element's content is to be sorted; if unspecified, the content is used
+    attribute sortas { text }
+  db.glossentry.attlist =
+    db.glossentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.glossentry.sortas.attribute?
+  db.glossentry =
+    
+    ## An entry in a Glossary or GlossList
+    element glossentry {
+      db.glossentry.attlist,
+      db.glossterm,
+      db.acronym?,
+      db.abbrev?,
+      db.indexterm*,
+      (db.glosssee | db.glossdef+)
+    }
+}
+div {
+  db.glossdef.role.attribute = attribute role { text }
+  db.glossdef.subject.attribute =
+    
+    ## Specifies a list of keywords for the definition
+    attribute subject { text }
+  db.glossdef.attlist =
+    db.glossdef.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.glossdef.subject.attribute?
+  db.glossdef =
+    
+    ## A definition in a GlossEntry
+    element glossdef {
+      db.glossdef.attlist, db.all.blocks+, db.glossseealso*
+    }
+}
+div {
+  db.glosssee.role.attribute = attribute role { text }
+  db.glosssee.otherterm.attribute =
+    
+    ## Identifies the other term
+    attribute otherterm { xsd:IDREF }
+  db.glosssee.attlist =
+    db.glosssee.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.glosssee.otherterm.attribute?
+  db.glosssee =
+    
+    ## A cross-reference from one glossentry
+    ##  to another
+    [
+      s:pattern [
+        name = "Glosssary 'see' type constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:glosssee[@otherterm]"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test =
+              "local-name(//*[@xml:id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'"
+            "@otherterm on glosssee must point to a glossentry."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element glosssee { db.glosssee.attlist, db.all.inlines* }
+}
+div {
+  db.glossseealso.role.attribute = attribute role { text }
+  db.glossseealso.otherterm.attribute =
+    
+    ## Identifies the other term
+    attribute otherterm { xsd:IDREF }
+  db.glossseealso.attlist =
+    db.glossseealso.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.glossseealso.otherterm.attribute?
+  db.glossseealso =
+    
+    ## A cross-reference from one GlossEntry to another
+    [
+      s:pattern [
+        name = "Glossary 'seealso' type constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:glossseealso[@otherterm]"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test =
+              "local-name(//*[@xml:id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'"
+            "@otherterm on glossseealso must point to a glossentry."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element glossseealso { db.glossseealso.attlist, db.all.inlines* }
+}
+div {
+  db.firstterm.role.attribute = attribute role { text }
+  db.firstterm.attlist =
+    db.firstterm.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.baseform.attribute
+  db.firstterm =
+    
+    ## The first occurrence of a term
+    [
+      s:pattern [
+        name = "Glossary 'firstterm' type constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:firstterm[@linkend]"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test =
+              "local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+            "@linkend on firstterm must point to a glossentry."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element firstterm { db.firstterm.attlist, db.all.inlines* }
+}
+div {
+  db.glossterm.role.attribute = attribute role { text }
+  db.glossterm.attlist =
+    db.glossterm.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.baseform.attribute
+  db.glossterm =
+    
+    ## A glossary term
+    [
+      s:pattern [
+        name = "Glossary 'glossterm' type constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:glossterm[@linkend]"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test =
+              "local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+            "@linkend on glossterm must point to a glossentry."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element glossterm { db.glossterm.attlist, db.all.inlines* }
+}
+div {
+  db.glossary.status.attribute = db.status.attribute
+  db.glossary.role.attribute = attribute role { text }
+  db.glossary.attlist =
+    db.glossary.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.glossary.status.attribute?
+  db.glossary.info = db._info
+  db.glossary =
+    
+    ## A glossary
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:glossary"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element glossary {
+      db.glossary.attlist,
+      db.glossary.info,
+      db.all.blocks*,
+      (db.glossdiv* | db.glossentry*),
+      db.bibliography?
+    }
+}
+div {
+  db.glossdiv.status.attribute = db.status.attribute
+  db.glossdiv.role.attribute = attribute role { text }
+  db.glossdiv.attlist =
+    db.glossdiv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.glossdiv.status.attribute?
+  db.glossdiv.info = db._info.title.req
+  db.glossdiv =
+    
+    ## A division in a Glossary
+    element glossdiv {
+      db.glossdiv.attlist,
+      db.glossdiv.info,
+      db.all.blocks*,
+      db.glossentry+
+    }
+}
+div {
+  db.termdef.role.attribute = attribute role { text }
+  db.termdef.attlist =
+    db.termdef.role.attribute?
+    & db.glossentry.sortas.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.baseform.attribute
+  db.termdef =
+    
+    ## An inline definition of a term
+    [
+      s:pattern [
+        name = "Glossary term definition constraint"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:termdef"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "count(db:firstterm) = 1"
+            "A termdef must contain exactly one firstterm"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element termdef { db.termdef.attlist, db.all.inlines* }
+}
+db.relation.attribute =
+  
+  ## Identifies the relationship between the bibliographic elemnts
+  attribute relation { text }
+div {
+  db.biblioentry.role.attribute = attribute role { text }
+  db.biblioentry.attlist =
+    db.biblioentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.biblioentry =
+    
+    ## An entry in a Bibliography
+    element biblioentry {
+      db.biblioentry.attlist, db.bibliographic.elements+
+    }
+}
+div {
+  db.bibliomixed.role.attribute = attribute role { text }
+  db.bibliomixed.attlist =
+    db.bibliomixed.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.bibliomixed =
+    
+    ## An entry in a Bibliography
+    element bibliomixed {
+      db.bibliomixed.attlist, (text | db.bibliographic.elements)*
+    }
+}
+div {
+  db.biblioset.relation.attribute = db.relation.attribute
+  db.biblioset.role.attribute = attribute role { text }
+  db.biblioset.attlist =
+    db.biblioset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.biblioset.relation.attribute?
+  db.biblioset =
+    
+    ## A raw container for related bibliographic information
+    element biblioset {
+      db.biblioset.attlist, db.bibliographic.elements+
+    }
+}
+div {
+  db.bibliomset.relation.attribute = db.relation.attribute
+  db.bibliomset.role.attribute = attribute role { text }
+  db.bibliomset.attlist =
+    db.bibliomset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.bibliomset.relation.attribute?
+  db.bibliomset =
+    
+    ## A cooked container for related bibliographic information
+    element bibliomset {
+      db.bibliomset.attlist, (db._text | db.bibliographic.elements)*
+    }
+}
+div {
+  db.bibliomisc.role.attribute = attribute role { text }
+  db.bibliomisc.attlist =
+    db.bibliomisc.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.bibliomisc =
+    
+    ## Untyped bibliographic information
+    element bibliomisc { db.bibliomisc.attlist, db._text }
+}
+div {
+  db.bibliography.status.attrib = db.status.attribute
+  db.bibliography.role.attribute = attribute role { text }
+  db.bibliography.attlist =
+    db.bibliography.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.bibliography.status.attrib?
+  db.bibliography.info = db._info
+  db.bibliography =
+    
+    ## A bibliography
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:bibliography"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element bibliography {
+      db.bibliography.attlist,
+      db.bibliography.info,
+      db.all.blocks*,
+      (db.bibliodiv+ | (db.biblioentry | db.bibliomixed)+)
+    }
+}
+div {
+  db.bibliodiv.status.attrib = db.status.attribute
+  db.bibliodiv.role.attribute = attribute role { text }
+  db.bibliodiv.attlist =
+    db.bibliodiv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.bibliodiv.status.attrib?
+  db.bibliodiv.info = db._info.title.req
+  db.bibliodiv =
+    
+    ## A section of a Bibliography
+    element bibliodiv {
+      db.bibliodiv.attlist,
+      db.bibliodiv.info,
+      db.all.blocks*,
+      (db.biblioentry | db.bibliomixed)+
+    }
+}
+div {
+  db.bibliolist.role.attribute = attribute role { text }
+  db.bibliolist.attlist =
+    db.bibliolist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.bibliolist.info = db._info.title.only
+  db.bibliolist =
+    
+    ## A wrapper for a list of bibliography entries
+    element bibliolist {
+      db.bibliolist.attlist,
+      db.bibliolist.info?,
+      db.all.blocks*,
+      (db.biblioentry | db.bibliomixed)+
+    }
+}
+div {
+  db.biblioref.role.attribute = attribute role { text }
+  db.biblioref.xrefstyle.attribute = db.xrefstyle.attribute
+  db.biblioref.endterm.attribute = db.endterm.attribute
+  db.biblioref.units.attribute =
+    
+    ## The units (for example, pages) used to identify the beginning and ending of a reference.
+    attribute units { xsd:token }
+  db.biblioref.begin.attribute =
+    
+    ## Identifies the beginning of a reference; the location within the work that is being referenced.
+    attribute begin { xsd:token }
+  db.biblioref.end.attribute =
+    
+    ## Identifies the end of a reference.
+    attribute end { xsd:token }
+  db.biblioref.attlist =
+    db.biblioref.role.attribute?
+    & db.common.attributes
+    & db.common.req.linking.attributes
+    & db.biblioref.xrefstyle.attribute?
+    & db.biblioref.endterm.attribute?
+    & db.biblioref.units.attribute?
+    & db.biblioref.begin.attribute?
+    & db.biblioref.end.attribute?
+  db.biblioref =
+    
+    ## A cross-reference to a bibliographic entry
+    element biblioref { db.biblioref.attlist, empty }
+}
+db.significance.enumeration =
+  
+  ## Normal
+  "normal"
+  | 
+    ## Preferred
+    "preferred"
+db.significance.attribute =
+  
+  ## Specifies the significance of the term
+  attribute significance { db.significance.enumeration }
+db.zone.attribute =
+  
+  ## Specifies the IDs of the elements to which this term applies
+  attribute zone { xsd:IDREFS }
+db.indexterm.pagenum.attribute =
+  
+  ## Indicates the page on which this index term occurs in some version of the printed document
+  attribute pagenum { text }
+db.scope.enumeration =
+  
+  ## All indexes
+  "all"
+  | 
+    ## The global index (as for a combined index of a set of box)
+    "global"
+  | 
+    ## The local index (the index for this document only)
+    "local"
+db.scope.attribute =
+  
+  ## Specifies the scope of the index term
+  attribute scope { db.scope.enumeration }
+db.sortas.attribute =
+  
+  ## Specifies the string by which the term is to be sorted; if unspecified, the term content is used
+  attribute sortas { text }
+db.index.type.attribute =
+  
+  ## Specifies the target index for this term
+  attribute type { text }
+div {
+  db.itermset.role.attribute = attribute role { text }
+  db.itermset.attlist =
+    db.itermset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.itermset =
+    
+    ## A set of index terms in the meta-information of a document
+    element itermset { db.itermset.attlist, db.indexterm.singular+ }
+}
+db.indexterm.contentmodel =
+  db.primary?,
+  ((db.secondary,
+    ((db.tertiary, (db.see | db.seealso+)?)
+     | db.see
+     | db.seealso+)?)
+   | db.see
+   | db.seealso+)?
+div {
+  db.indexterm.singular.role.attribute = attribute role { text }
+  db.indexterm.singular.class.attribute =
+    
+    ## Identifies the class of index term
+    attribute class {
+      
+      ## A singular index term
+      "singular"
+    }
+  db.indexterm.singular.attlist =
+    db.indexterm.singular.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.significance.attribute?
+    & db.zone.attribute?
+    & db.indexterm.pagenum.attribute?
+    & db.scope.attribute?
+    & db.index.type.attribute?
+    & db.indexterm.singular.class.attribute?
+  db.indexterm.singular =
+    
+    ## A wrapper for an indexed term
+    element indexterm {
+      db.indexterm.singular.attlist, db.indexterm.contentmodel
+    }
+}
+div {
+  db.indexterm.startofrange.role.attribute = attribute role { text }
+  db.indexterm.startofrange.class.attribute =
+    
+    ## Identifies the class of index term
+    attribute class {
+      
+      ## The start of a range
+      "startofrange"
+    }
+  db.indexterm.startofrange.attlist =
+    db.indexterm.startofrange.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.significance.attribute?
+    & db.zone.attribute?
+    & db.indexterm.pagenum.attribute?
+    & db.scope.attribute?
+    & db.index.type.attribute?
+    & db.indexterm.startofrange.class.attribute
+  db.indexterm.startofrange =
+    
+    ## A wrapper for an indexed term that covers a range
+    element indexterm {
+      db.indexterm.startofrange.attlist, db.indexterm.contentmodel
+    }
+}
+div {
+  db.indexterm.endofrange.role.attribute = attribute role { text }
+  db.indexterm.endofrange.class.attribute =
+    
+    ## Identifies the class of index term
+    attribute class {
+      
+      ## The end of a range
+      "endofrange"
+    }
+  db.indexterm.endofrange.startref.attribute =
+    
+    ## Points to the start of the range
+    attribute startref { xsd:IDREF }
+  db.indexterm.endofrange.attlist =
+    db.indexterm.endofrange.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.indexterm.endofrange.class.attribute
+    & db.indexterm.endofrange.startref.attribute
+  db.indexterm.endofrange =
+    
+    ## Identifies the end of a range associated with an indexed term
+    element indexterm { db.indexterm.endofrange.attlist, empty }
+}
+div {
+  db.indexterm =
+    db.indexterm.singular
+    | db.indexterm.startofrange
+    | db.indexterm.endofrange
+}
+div {
+  db.primary.role.attribute = attribute role { text }
+  db.primary.attlist =
+    db.primary.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.sortas.attribute?
+  db.primary =
+    
+    ## The primary word or phrase under which an index term should be sorted
+    element primary { db.primary.attlist, db.all.inlines* }
+}
+div {
+  db.secondary.role.attribute = attribute role { text }
+  db.secondary.attlist =
+    db.secondary.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.sortas.attribute?
+  db.secondary =
+    
+    ## A secondary word or phrase in an index term
+    element secondary { db.secondary.attlist, db.all.inlines* }
+}
+div {
+  db.tertiary.role.attribute = attribute role { text }
+  db.tertiary.attlist =
+    db.tertiary.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.sortas.attribute?
+  db.tertiary =
+    
+    ## A tertiary word or phrase in an index term
+    element tertiary { db.tertiary.attlist, db.all.inlines* }
+}
+div {
+  db.see.role.attribute = attribute role { text }
+  db.see.attlist =
+    db.see.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.see =
+    
+    ## Part of an index term directing the reader instead to another entry in the index
+    element see { db.see.attlist, db.all.inlines* }
+}
+div {
+  db.seealso.role.attribute = attribute role { text }
+  db.seealso.attlist =
+    db.seealso.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.seealso =
+    
+    ## Part of an index term directing the reader also to another entry in the index
+    element seealso { db.seealso.attlist, db.all.inlines* }
+}
+div {
+  db.index.status.attribute = db.status.attribute
+  db.index.role.attribute = attribute role { text }
+  db.index.attlist =
+    db.index.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.index.status.attribute?
+    & db.index.type.attribute?
+  db.index.info = db._info
+  # 
+  # Yes, db.indexdiv* and db.indexentry*; that way an <index/> is valid.
+  # Authors can use an empty index to indicate where a generated index should
+  # appear.
+  db.index =
+    
+    ## An index to a book or part of a book
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:index"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element index {
+      db.index.attlist,
+      db.index.info,
+      db.all.blocks*,
+      (db.indexdiv* | db.indexentry* | db.segmentedlist)
+    }
+}
+div {
+  db.setindex.status.attribute = db.status.attribute
+  db.setindex.role.attribute = attribute role { text }
+  db.setindex.attlist =
+    db.setindex.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.setindex.status.attribute?
+    & db.index.type.attribute?
+  db.setindex.info = db._info
+  db.setindex =
+    
+    ## An index to a set of books
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:setindex"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element setindex {
+      db.setindex.attlist,
+      db.setindex.info,
+      db.all.blocks*,
+      (db.indexdiv* | db.indexentry*)
+    }
+}
+div {
+  db.indexdiv.status.attribute = db.status.attribute
+  db.indexdiv.role.attribute = attribute role { text }
+  db.indexdiv.attlist =
+    db.indexdiv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.label.attribute?
+    & db.indexdiv.status.attribute?
+  db.indexdiv.info = db._info.title.req
+  db.indexdiv =
+    
+    ## A division in an index
+    element indexdiv {
+      db.indexdiv.attlist,
+      db.indexdiv.info,
+      db.all.blocks*,
+      (db.indexentry+ | db.segmentedlist)
+    }
+}
+div {
+  db.indexentry.role.attribute = attribute role { text }
+  db.indexentry.attlist =
+    db.indexentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.indexentry =
+    
+    ## An entry in an index
+    element indexentry {
+      db.indexentry.attlist,
+      db.primaryie,
+      (db.seeie | db.seealsoie)*,
+      (db.secondaryie, (db.seeie | db.seealsoie | db.tertiaryie)*)*
+    }
+}
+div {
+  db.primaryie.role.attribute = attribute role { text }
+  db.primaryie.attlist =
+    db.primaryie.role.attribute?
+    & db.common.attributes
+    & db.linkends.attribute?
+  db.primaryie =
+    
+    ## A primary term in an index entry, not in the text
+    element primaryie { db.primaryie.attlist, db.all.inlines* }
+}
+div {
+  db.secondaryie.role.attribute = attribute role { text }
+  db.secondaryie.attlist =
+    db.secondaryie.role.attribute?
+    & db.common.attributes
+    & db.linkends.attribute?
+  db.secondaryie =
+    
+    ## A secondary term in an index entry, rather than in the text
+    element secondaryie { db.secondaryie.attlist, db.all.inlines* }
+}
+div {
+  db.tertiaryie.role.attribute = attribute role { text }
+  db.tertiaryie.attlist =
+    db.tertiaryie.role.attribute?
+    & db.common.attributes
+    & db.linkends.attribute?
+  db.tertiaryie =
+    
+    ## A tertiary term in an index entry, rather than in the text
+    element tertiaryie { db.tertiaryie.attlist, db.all.inlines* }
+}
+div {
+  db.seeie.role.attribute = attribute role { text }
+  db.seeie.attlist =
+    db.seeie.role.attribute?
+    & db.common.attributes
+    & db.linkend.attribute?
+  db.seeie =
+    
+    ## A See
+    ## entry in an index, rather than in the text
+    element seeie { db.seeie.attlist, db.all.inlines* }
+}
+div {
+  db.seealsoie.role.attribute = attribute role { text }
+  db.seealsoie.attlist =
+    db.seealsoie.role.attribute?
+    & db.common.attributes
+    & db.linkends.attribute?
+  db.seealsoie =
+    
+    ## A See also
+    ##  entry in an index, rather than in the text
+    element seealsoie { db.seealsoie.attlist, db.all.inlines* }
+}
+db.toc.pagenum.attribute =
+  
+  ## Indicates the page on which this element occurs in some version of the printed document
+  attribute pagenum { text }
+div {
+  db.toc.role.attribute = attribute role { text }
+  db.toc.attlist =
+    db.toc.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.toc.info = db._info.title.only
+  db.toc =
+    
+    ## A table of contents
+    [
+      s:pattern [
+        name = "Root must have version"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "/db:toc"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "@version"
+            "The root element must have a version attribute."
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element toc {
+      db.toc.attlist,
+      db.toc.info,
+      db.all.blocks*,
+      (db.tocdiv | db.tocentry)*
+    }
+}
+div {
+  db.tocdiv.role.attribute = attribute role { text }
+  db.tocdiv.pagenum.attribute = db.toc.pagenum.attribute
+  db.tocdiv.attlist =
+    db.tocdiv.role.attribute?
+    & db.common.attributes
+    & db.tocdiv.pagenum.attribute?
+    & db.linkend.attribute?
+  db.tocdiv.info = db._info
+  db.tocdiv =
+    
+    ## A division in a table of contents
+    element tocdiv {
+      db.tocdiv.attlist,
+      db.tocdiv.info,
+      db.all.blocks*,
+      (db.tocdiv | db.tocentry)+
+    }
+}
+div {
+  db.tocentry.role.attribute = attribute role { text }
+  db.tocentry.pagenum.attribute = db.toc.pagenum.attribute
+  db.tocentry.attlist =
+    db.tocentry.role.attribute?
+    & db.common.attributes
+    & db.tocentry.pagenum.attribute?
+    & db.linkend.attribute?
+  db.tocentry =
+    
+    ## A component title in a table of contents
+    element tocentry { db.tocentry.attlist, db.all.inlines* }
+}
+db.task.info = db._info.title.req
+div {
+  db.task.role.attribute = attribute role { text }
+  db.task.attlist =
+    db.task.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.task =
+    
+    ## A task to be completed
+    element task {
+      db.task.attlist,
+      db.task.info,
+      db.tasksummary?,
+      db.taskprerequisites?,
+      db.procedure,
+      db.example*,
+      db.taskrelated?
+    }
+}
+div {
+  db.tasksummary.role.attribute = attribute role { text }
+  db.tasksummary.attlist =
+    db.tasksummary.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.tasksummary.info = db._info.title.only
+  db.tasksummary =
+    
+    ## A summary of a task
+    element tasksummary {
+      db.tasksummary.attlist, db.tasksummary.info, db.all.blocks+
+    }
+}
+div {
+  db.taskprerequisites.role.attribute = attribute role { text }
+  db.taskprerequisites.attlist =
+    db.taskprerequisites.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.taskprerequisites.info = db._info.title.only
+  db.taskprerequisites =
+    
+    ## The prerequisites for a task
+    element taskprerequisites {
+      db.taskprerequisites.attlist,
+      db.taskprerequisites.info,
+      db.all.blocks+
+    }
+}
+div {
+  db.taskrelated.role.attribute = attribute role { text }
+  db.taskrelated.attlist =
+    db.taskrelated.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.taskrelated.info = db._info.title.only
+  db.taskrelated =
+    
+    ## Information related to a task
+    element taskrelated {
+      db.taskrelated.attlist, db.taskrelated.info, db.all.blocks+
+    }
+}
+db.area.units.enumeration =
+  
+  ## Coordinates expressed as a pair of CALS graphic coordinates.
+  "calspair"
+  | 
+    ## Coordinates expressed as a line and column.
+    "linecolumn"
+  | 
+    ## Coordinates expressed as a pair of lines and columns.
+    "linecolumnpair"
+  | 
+    ## Coordinates expressed as a line range.
+    "linerange"
+db.area.units-enum.attribute =
+  
+  ## Identifies the units used in the coords attribute The default units vary according to the type of callout specified: calspair
+  ##  for graphics and linecolumn
+  ##  for line-oriented elements.
+  attribute units { db.area.units.enumeration }?
+db.area.units-other.attributes =
+  
+  ## Indicates that non-standard units are used for this area
+  ## . In this case otherunits
+  ##  must be specified.
+  attribute units {
+    
+    ## Coordinates expressed in some non-standard units.
+    "other"
+  }?,
+  
+  ## Identifies the units used in the coords
+  ##  attribute when the units
+  ##  attribute is other
+  ## . This attribute is forbidden otherwise.
+  attribute otherunits { xsd:NMTOKEN }
+db.area.units.attribute =
+  db.area.units-enum.attribute | db.area.units-other.attributes
+div {
+  db.calloutlist.role.attribute = attribute role { text }
+  db.calloutlist.attlist =
+    db.calloutlist.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.calloutlist.info = db._info.title.only
+  db.calloutlist =
+    
+    ## A list of callout
+    ## s
+    element calloutlist {
+      db.calloutlist.attlist,
+      db.calloutlist.info,
+      db.all.blocks*,
+      db.callout+
+    }
+}
+div {
+  db.callout.role.attribute = attribute role { text }
+  db.callout.arearefs.attribute =
+    
+    ## Identifies the areas described by this callout.
+    attribute arearefs { xsd:IDREFS }
+  db.callout.attlist =
+    db.callout.role.attribute?
+    & db.common.attributes
+    & db.callout.arearefs.attribute
+  db.callout =
+    
+    ## A called out
+    ##  description of a marked Area
+    element callout { db.callout.attlist, db.all.blocks+ }
+}
+div {
+  db.programlistingco.role.attribute = attribute role { text }
+  db.programlistingco.attlist =
+    db.programlistingco.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.programlistingco.info = db._info.title.forbidden
+  db.programlistingco =
+    
+    ## A program listing with associated areas used in callouts
+    element programlistingco {
+      db.programlistingco.attlist,
+      db.programlistingco.info,
+      db.areaspec,
+      db.programlisting,
+      db.calloutlist*
+    }
+}
+div {
+  db.areaspec.role.attribute = attribute role { text }
+  db.areaspec.attlist =
+    db.areaspec.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.area.units.attribute
+  db.areaspec =
+    
+    ## A collection of regions in a graphic or code example
+    element areaspec { db.areaspec.attlist, (db.area | db.areaset)+ }
+}
+div {
+  db.area.role.attribute = attribute role { text }
+  db.area.linkends.attribute =
+    
+    ## Point to the callout
+    ## s which refer to this area. (This provides bidirectional linking which may be useful in online presentation.)
+    attribute linkends { xsd:IDREFS }
+  db.area.label.attribute =
+    
+    ## Specifies an identifying number or string that may be used in presentation. The area label might be drawn on top of the figure, for example, at the position indicated by the coords attribute.
+    attribute label { text }
+  db.area.coords.attribute =
+    
+    ## Provides the coordinates of the area. The coordinates must be interpreted using the units
+    ##  specified.
+    attribute coords { text }
+  db.area.attlist =
+    db.area.role.attribute?
+    & db.common.idreq.attributes
+    & db.area.units.attribute
+    & (db.area.linkends.attribute | db.href.attributes)?
+    & db.area.label.attribute?
+    & db.area.coords.attribute
+  db.area =
+    
+    ## A region defined for a Callout in a graphic or code example
+    element area { db.area.attlist, db.alt? }
+}
+div {
+  # The only difference is that xml:id is optional
+  db.area.inareaset.attlist =
+    db.area.role.attribute?
+    & db.common.attributes
+    & db.area.units.attribute
+    & (db.area.linkends.attribute | db.href.attributes)?
+    & db.area.label.attribute?
+    & db.area.coords.attribute
+  db.area.inareaset =
+    
+    ## A region defined for a Callout in a graphic or code example
+    element area { db.area.inareaset.attlist, db.alt? }
+}
+div {
+  db.areaset.role.attribute = attribute role { text }
+  db.areaset.linkends.attribute = db.linkends.attribute
+  db.areaset.label.attribute = db.label.attribute
+  db.areaset.attlist =
+    db.areaset.role.attribute?
+    & db.common.idreq.attributes
+    & db.area.units.attribute
+    & (db.areaset.linkends.attribute | db.href.attributes)?
+    & db.areaset.label.attribute?
+  db.areaset =
+    
+    ## A set of related areas in a graphic or code example
+    element areaset { db.areaset.attlist, db.area.inareaset+ }
+}
+div {
+  db.screenco.role.attribute = attribute role { text }
+  db.screenco.attlist =
+    db.screenco.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.screenco.info = db._info.title.forbidden
+  db.screenco =
+    
+    ## A screen with associated areas used in callouts
+    element screenco {
+      db.screenco.attlist,
+      db.screenco.info,
+      db.areaspec,
+      db.screen,
+      db.calloutlist*
+    }
+}
+div {
+  db.imageobjectco.role.attribute = attribute role { text }
+  db.imageobjectco.attlist =
+    db.imageobjectco.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.imageobjectco.info = db._info.title.forbidden
+  db.imageobjectco =
+    
+    ## A wrapper for an image object with callouts
+    element imageobjectco {
+      db.imageobjectco.attlist,
+      db.imageobjectco.info,
+      db.areaspec,
+      db.imageobject+,
+      db.calloutlist*
+    }
+}
+div {
+  db.co.role.attribute = attribute role { text }
+  db.co.linkends.attribute = db.linkends.attribute
+  db.co.label.attribute = db.label.attribute
+  db.co.attlist =
+    db.co.role.attribute?
+    & db.common.idreq.attributes
+    & db.co.linkends.attribute?
+    & db.co.label.attribute?
+  db.co =
+    
+    ## The location of a callout embedded in text
+    element co { db.co.attlist, empty }
+}
+div {
+  db.coref.role.attribute = attribute role { text }
+  db.coref.label.attribute = db.label.attribute
+  db.coref.attlist =
+    db.coref.role.attribute?
+    & db.common.attributes
+    & db.linkend.attribute
+    & db.coref.label.attribute?
+  db.coref =
+    
+    ## A cross reference to a co
+    element coref { db.coref.attlist, empty }
+}
+div {
+  db.productionset.role.attribute = attribute role { text }
+  db.productionset.attlist =
+    db.productionset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.productionset.info = db._info.title.only
+  db.productionset =
+    
+    ## A set of EBNF productions
+    element productionset {
+      db.productionset.attlist,
+      db.productionset.info,
+      (db.production | db.productionrecap)+
+    }
+}
+div {
+  db.production.role.attribute = attribute role { text }
+  db.production.attlist =
+    db.production.role.attribute?
+    & db.common.idreq.attributes
+    & db.common.linking.attributes
+  db.production =
+    
+    ## A production in a set of EBNF productions
+    element production {
+      db.production.attlist, db.lhs, db.rhs, db.constraint*
+    }
+}
+div {
+  db.lhs.role.attribute = attribute role { text }
+  db.lhs.attlist =
+    db.lhs.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.lhs =
+    
+    ## The left-hand side of an EBNF production
+    element lhs { db.lhs.attlist, text }
+}
+div {
+  db.rhs.role.attribute = attribute role { text }
+  db.rhs.attlist =
+    db.rhs.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.rhs =
+    
+    ## The right-hand side of an EBNF production
+    element rhs {
+      db.rhs.attlist,
+      (text | db.nonterminal | db.lineannotation | db.sbr)*
+    }
+}
+div {
+  db.nonterminal.role.attribute = attribute role { text }
+  db.nonterminal.def.attribute =
+    
+    ## Specifies a URI that points to a production
+    ## where the nonterminal
+    ##  is defined
+    attribute def { xsd:anyURI }
+  db.nonterminal.attlist =
+    db.nonterminal.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.nonterminal.def.attribute
+  db.nonterminal =
+    
+    ## A non-terminal in an EBNF production
+    element nonterminal { db.nonterminal.attlist, text }
+}
+div {
+  db.constraint.role.attribute = attribute role { text }
+  db.constraint.attlist =
+    db.constraint.role.attribute?
+    & db.common.attributes
+    & db.common.req.linking.attributes
+  db.constraint =
+    
+    ## A constraint in an EBNF production
+    element constraint { db.constraint.attlist, empty }
+}
+div {
+  db.productionrecap.role.attribute = attribute role { text }
+  db.productionrecap.attlist =
+    db.productionrecap.role.attribute?
+    & db.common.attributes
+    & db.common.req.linking.attributes
+  db.productionrecap =
+    
+    ## A cross-reference to an EBNF production
+    element productionrecap { db.productionrecap.attlist, empty }
+}
+div {
+  db.constraintdef.role.attribute = attribute role { text }
+  db.constraintdef.attlist =
+    db.constraintdef.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.constraintdef.info = db._info.title.only
+  db.constraintdef =
+    
+    ## The definition of a constraint in an EBNF production
+    element constraintdef {
+      db.constraintdef.attlist, db.constraintdef.info, db.all.blocks+
+    }
+}
+db.char.attribute =
+  
+  ## Specifies the alignment character when align
+  ##  is set to char
+  ## .
+  attribute char { text }
+db.charoff.attribute =
+  
+  ## Specifies the percentage of the column's total width that should appear to the left of the first occurance of the character identified in char
+  ##  when align
+  ##  is set to char
+  ## .
+  attribute charoff {
+    xsd:decimal { minExclusive = "0" maxExclusive = "100" }
+  }
+db.frame.attribute =
+  
+  ## Specifies how the table is to be framed. Note that there is no way to obtain a border on only the starting edge (left, in left-to-right writing systems) of the table.
+  attribute frame {
+    
+    ## Frame all four sides of the table. In some environments with limited control over table border formatting, such as HTML, this may imply additional borders.
+    "all"
+    | 
+      ## Frame only the bottom of the table.
+      "bottom"
+    | 
+      ## Place no border on the table. In some environments with limited control over table border formatting, such as HTML, this may disable other borders as well.
+      "none"
+    | 
+      ## Frame the left and right sides of the table.
+      "sides"
+    | 
+      ## Frame the top of the table.
+      "top"
+    | 
+      ## Frame the top and bottom of the table.
+      "topbot"
+  }
+db.colsep.attribute =
+  
+  ## Specifies the presence or absence of the column separator
+  attribute colsep {
+    
+    ## No column separator rule.
+    "0"
+    | 
+      ## Provide a column separator rule on the right
+      "1"
+  }
+db.rowsep.attribute =
+  
+  ## Specifies the presence or absence of the row separator
+  attribute rowsep {
+    
+    ## No row separator rule.
+    "0"
+    | 
+      ## Provide a row separator rule below
+      "1"
+  }
+db.orient.attribute =
+  
+  ## Specifies the orientation of the table
+  attribute orient {
+    
+    ## 90 degrees counter-clockwise from the rest of the text flow.
+    "land"
+    | 
+      ## The same orientation as the rest of the text flow.
+      "port"
+  }
+db.tabstyle.attribute =
+  
+  ## Specifies the table style
+  attribute tabstyle { text }
+db.rowheader.attribute =
+  
+  ## Indicates whether or not the entries in the first column should be considered row headers
+  attribute rowheader {
+    
+    ## Indicates that entries in the first column of the table are functionally row headers (analogous to the way that a thead provides column headers).
+    "firstcol"
+    | 
+      ## Indicates that entries in the first column have no special significance with respect to column headers.
+      "norowheader"
+  }
+db.align.attribute =
+  
+  ## Specifies the horizontal alignment of text in an entry.
+  attribute align {
+    
+    ## Centered.
+    "center"
+    | 
+      ## Aligned on a particular character.
+      "char"
+    | 
+      ## Left and right justified.
+      "justify"
+    | 
+      ## Left justified.
+      "left"
+    | 
+      ## Right justified.
+      "right"
+  }
+db.valign.attribute =
+  
+  ## Specifies the vertical alignment of text in an entry.
+  attribute valign {
+    
+    ## Aligned on the bottom of the entry.
+    "bottom"
+    | 
+      ## Aligned in the middle.
+      "middle"
+    | 
+      ## Aligned at the top of the entry.
+      "top"
+  }
+db.specify-col-by-colname.attributes =
+  
+  ## Specifies a column specification by name.
+  attribute colname { text }
+db.specify-col-by-namest.attributes =
+  
+  ## Specifies a starting column by name.
+  attribute namest { text }
+db.specify-span-by-spanspec.attributes =
+  
+  ## Specifies a span by name.
+  attribute spanname { text }
+db.specify-span-directly.attributes =
+  
+  ## Specifies a starting column by name.
+  attribute namest { text }
+  & 
+    ## Specifies an ending column by name.
+    attribute nameend { text }
+db.column-spec.attributes =
+  db.specify-col-by-colname.attributes
+  | db.specify-col-by-namest.attributes
+  | db.specify-span-by-spanspec.attributes
+  | db.specify-span-directly.attributes
+db.colname.attribute =
+  
+  ## Provides a name for a column specification.
+  attribute colname { text }
+db.spanname.attribute =
+  
+  ## Provides a name for a span specification.
+  attribute spanname { text }
+div {
+  db.tgroup.role.attribute = attribute role { text }
+  db.tgroup.tgroupstyle.attribute =
+    
+    ## Additional style information for downstream processing; typically the name of a style.
+    attribute tgroupstyle { text }
+  db.tgroup.cols.attribute =
+    
+    ## The number of columns in the table. Must be an integer greater than zero.
+    attribute cols { xsd:positiveInteger }
+  db.tgroup.attlist =
+    db.tgroup.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.char.attribute?
+    & db.charoff.attribute?
+    & db.tgroup.tgroupstyle.attribute?
+    & db.tgroup.cols.attribute
+    & db.colsep.attribute?
+    & db.rowsep.attribute?
+    & db.align.attribute?
+  db.tgroup =
+    
+    ## A wrapper for the main content of a table, or part of a table
+    element tgroup {
+      db.tgroup.attlist,
+      db.colspec*,
+      db.spanspec*,
+      db.cals.thead?,
+      db.cals.tfoot?,
+      db.cals.tbody
+    }
+}
+div {
+  db.colspec.role.attribute = attribute role { text }
+  db.colspec.colnum.attribute =
+    
+    ## The number of the column to which this specification applies. Must be greater than any preceding column number. Defaults to one more than the number of the preceding column, if there is one, or one.
+    attribute colnum { xsd:positiveInteger }
+  db.colspec.colwidth.attribute =
+    
+    ## Specifies the width of the column.
+    attribute colwidth { text }
+  db.colspec.attlist =
+    db.colspec.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.colspec.colnum.attribute?
+    & db.char.attribute?
+    & db.colsep.attribute?
+    & db.colspec.colwidth.attribute?
+    & db.charoff.attribute?
+    & db.colname.attribute?
+    & db.rowsep.attribute?
+    & db.align.attribute?
+  db.colspec =
+    
+    ## Specifications for a column in a table
+    element colspec { db.colspec.attlist, empty }
+}
+div {
+  db.spanspec.role.attribute = attribute role { text }
+  db.spanspec.namest.attribute =
+    
+    ## Specifies a starting column by name.
+    attribute namest { text }
+  db.spanspec.nameend.attribute =
+    
+    ## Specifies an ending column by name.
+    attribute nameend { text }
+  db.spanspec.attlist =
+    db.spanspec.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.spanname.attribute
+    & db.spanspec.namest.attribute
+    & db.spanspec.nameend.attribute
+    & db.char.attribute?
+    & db.colsep.attribute?
+    & db.charoff.attribute?
+    & db.rowsep.attribute?
+    & db.align.attribute?
+  db.spanspec =
+    
+    ## Formatting information for a spanned column in a table
+    element spanspec { db.spanspec.attlist, empty }
+}
+div {
+  db.cals.thead.role.attribute = attribute role { text }
+  db.cals.thead.attlist =
+    db.cals.thead.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.valign.attribute?
+  db.cals.thead =
+    
+    ## A table header consisting of one or more rows
+    element thead { db.cals.thead.attlist, db.colspec*, db.row+ }
+}
+div {
+  db.cals.tfoot.role.attribute = attribute role { text }
+  db.cals.tfoot.attlist =
+    db.cals.tfoot.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.valign.attribute?
+  db.cals.tfoot =
+    
+    ## A table footer consisting of one or more rows
+    element tfoot { db.cals.tfoot.attlist, db.colspec*, db.row+ }
+}
+div {
+  db.cals.tbody.role.attribute = attribute role { text }
+  db.cals.tbody.attlist =
+    db.cals.tbody.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.valign.attribute?
+  db.cals.tbody =
+    
+    ## A wrapper for the rows of a table or informal table
+    element tbody { db.cals.tbody.attlist, db.row+ }
+}
+div {
+  db.row.role.attribute = attribute role { text }
+  db.row.attlist =
+    db.row.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.rowsep.attribute?
+    & db.valign.attribute?
+  db.row =
+    
+    ## A row in a table
+    element row { db.row.attlist, (db.entry | db.entrytbl)+ }
+}
+div {
+  db.entry.role.attribute = attribute role { text }
+  db.entry.morerows.attribute =
+    
+    ## Specifies the number of additional rows which this entry occupies. Defaults to zero.
+    attribute morerows { xsd:integer }
+  db.entry.rotate.attribute =
+    
+    ## Specifies the rotation of this entry. A value of 1 (true) rotates the cell 90 degrees counter-clockwise. A value of 0 (false) leaves the cell unrotated.
+    attribute rotate {
+      
+      ## Do not rotate the cell.
+      "0"
+      | 
+        ## Rotate the cell 90 degrees counter-clockwise.
+        "1"
+    }
+  db.entry.attlist =
+    db.entry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.valign.attribute?
+    & db.char.attribute?
+    & db.colsep.attribute?
+    & db.charoff.attribute?
+    & db.entry.morerows.attribute?
+    & db.column-spec.attributes?
+    & db.rowsep.attribute?
+    & db.entry.rotate.attribute?
+    & db.align.attribute?
+  db.entry =
+    
+    ## A cell in a table
+    element entry {
+      db.entry.attlist, (db.all.inlines* | db.all.blocks*)
+    }
+}
+div {
+  db.entrytbl.role.attribute = attribute role { text }
+  db.entrytbl.tgroupstyle.attribute =
+    
+    ## Additional style information for downstream processing; typically the name of a style.
+    attribute tgroupstyle { text }
+  db.entrytbl.cols.attribute =
+    
+    ## The number of columns in the entry table. Must be an integer greater than zero.
+    attribute cols { xsd:positiveInteger }
+  db.entrytbl.attlist =
+    db.entrytbl.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.char.attribute?
+    & db.charoff.attribute?
+    & db.column-spec.attributes?
+    & db.entrytbl.tgroupstyle.attribute?
+    & db.entrytbl.cols.attribute?
+    & db.colsep.attribute?
+    & db.rowsep.attribute?
+    & db.align.attribute?
+  db.entrytbl =
+    
+    ## A subtable appearing in place of an Entry in a table
+    element entrytbl {
+      db.entrytbl.attlist,
+      db.colspec*,
+      db.spanspec*,
+      db.cals.entrytbl.thead?,
+      db.cals.entrytbl.tbody
+    }
+}
+div {
+  db.cals.entrytbl.thead.role.attribute = attribute role { text }
+  db.cals.entrytbl.thead.attlist =
+    db.cals.entrytbl.thead.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.valign.attribute?
+  db.cals.entrytbl.thead =
+    
+    ## A table header consisting of one or more rows
+    element thead {
+      db.cals.entrytbl.thead.attlist, db.colspec*, db.entrytbl.row+
+    }
+}
+div {
+  db.cals.entrytbl.tbody.role.attribute = attribute role { text }
+  db.cals.entrytbl.tbody.attlist =
+    db.cals.entrytbl.tbody.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.valign.attribute?
+  db.cals.entrytbl.tbody =
+    
+    ## A wrapper for the rows of a table or informal table
+    element tbody { db.cals.entrytbl.tbody.attlist, db.entrytbl.row+ }
+}
+div {
+  db.entrytbl.row.role.attribute = attribute role { text }
+  db.entrytbl.row.attlist =
+    db.entrytbl.row.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.rowsep.attribute?
+    & db.valign.attribute?
+  db.entrytbl.row =
+    
+    ## A row in a table
+    element row { db.entrytbl.row.attlist, db.entry+ }
+}
+div {
+  db.cals.table.role.attribute = attribute role { text }
+  db.cals.table.label.attribute = db.label.attribute
+  db.cals.table.attlist =
+    db.cals.table.role.attribute?
+    & db.cals.table.label.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.tabstyle.attribute?
+    & db.floatstyle.attribute?
+    & db.orient.attribute?
+    & db.colsep.attribute?
+    & db.rowsep.attribute?
+    & db.frame.attribute?
+    & db.pgwide.attribute?
+    & 
+      ## Indicates if the short or long title should be used in a List of Tables
+      attribute shortentry {
+        
+        ## Indicates that the full title should be used.
+        "0"
+        | 
+          ## Indicates that the short short title (titleabbrev) should be used.
+          "1"
+      }?
+    & 
+      ## Indicates if the table should appear in a List of Tables
+      attribute tocentry {
+        
+        ## Indicates that the table should not occur in the List of Tables.
+        "0"
+        | 
+          ## Indicates that the table should appear in the List of Tables.
+          "1"
+      }?
+    & db.rowheader.attribute?
+  db.cals.table.info = db._info.title.onlyreq
+  db.cals.table =
+    
+    ## A formal table in a document
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:informaltable)"
+            "informaltable must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element table {
+      db.cals.table.attlist,
+      db.cals.table.info,
+      (db.alt? & db.indexing.inlines* & db.textobject*),
+      (db.mediaobject+ | db.tgroup+),
+      db.caption?
+    }
+}
+div {
+  db.cals.informaltable.role.attribute = attribute role { text }
+  db.cals.informaltable.attlist =
+    db.cals.informaltable.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.tabstyle.attribute?
+    & db.floatstyle.attribute?
+    & db.orient.attribute?
+    & db.colsep.attribute?
+    & db.rowsep.attribute?
+    & db.frame.attribute?
+    & db.pgwide.attribute?
+    & db.rowheader.attribute?
+  db.cals.informaltable.info = db._info.title.forbidden
+  db.cals.informaltable =
+    
+    ## A table without a title
+    element informaltable {
+      db.cals.informaltable.attlist,
+      db.cals.informaltable.info,
+      (db.alt? & db.indexing.inlines* & db.textobject*),
+      (db.mediaobject+ | db.tgroup+),
+      db.caption?
+    }
+}
+db.html.coreattrs =
+  
+  ## This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names. Multiple class names must be separated by white space characters.
+  attribute class { text }?
+  & 
+    ## This attribute specifies style information for the current element.
+    attribute style { text }?
+  & 
+    ## This attribute offers advisory information about the element for which it is set.
+    attribute title { text }?
+db.html.i18n =
+  
+  ## This attribute specifies the base language of an element's attribute values and text content. The default value of this attribute is unknown.
+  attribute lang { text }?
+db.html.events =
+  
+  ## Occurs when the pointing device button is clicked over an element.
+  attribute onclick { text }?
+  & 
+    ## Occurs when the pointing device button is double clicked over an element.
+    attribute ondblclick { text }?
+  & 
+    ## Occurs when the pointing device button is pressed over an element.
+    attribute onmousedown { text }?
+  & 
+    ## Occurs when the pointing device button is released over an element.
+    attribute onmouseup { text }?
+  & 
+    ## Occurs when the pointing device is moved onto an element.
+    attribute onmouseover { text }?
+  & 
+    ## Occurs when the pointing device is moved while it is over an element.
+    attribute onmousemove { text }?
+  & 
+    ## Occurs when the pointing device is moved away from an element.
+    attribute onmouseout { text }?
+  & 
+    ## Occurs when a key is pressed and released over an element.
+    attribute onkeypress { text }?
+  & 
+    ## Occurs when a key is pressed down over an element.
+    attribute onkeydown { text }?
+  & 
+    ## Occurs when a key is released over an element.
+    attribute onkeyup { text }?
+db.html.attrs =
+  db.common.attributes
+  & db.html.coreattrs
+  & db.html.i18n
+  & db.html.events
+db.html.cellhalign =
+  
+  ## Specifies the alignment of data and the justification of text in a cell.
+  attribute align {
+    
+    ## Left-flush data/Left-justify text. This is the default value for table data.
+    "left"
+    | 
+      ## Center data/Center-justify text. This is the default value for table headers.
+      "center"
+    | 
+      ## Right-flush data/Right-justify text.
+      "right"
+    | 
+      ## Double-justify text.
+      "justify"
+    | 
+      ## Align text around a specific character. If a user agent doesn't support character alignment, behavior in the presence of this value is unspecified.
+      "char"
+  }?
+  & 
+    ## This attribute specifies a single character within a text fragment to act as an axis for alignment. The default value for this attribute is the decimal point character for the current language as set by the lang attribute (e.g., the period in English and the comma in French). User agents are not required to support this attribute.
+    attribute char { text }?
+  & 
+    ## When present, this attribute specifies the offset to the first occurrence of the alignment character on each line. If a line doesn't include the alignment character, it should be horizontally shifted to end at the alignment position. When charoff is used to set the offset of an alignment character, the direction of offset is determined by the current text direction (set by the dir attribute). In left-to-right texts (the default), offset is from the left margin. In right-to-left texts, offset is from the right margin. User agents are not required to support this attribute.
+    attribute charoff {
+      xsd:integer
+      | xsd:string { pattern = "[0-9]+%" }
+    }?
+db.html.cellvalign =
+  
+  ## Specifies the vertical position of data within a cell.
+  attribute valign {
+    
+    ## Cell data is flush with the top of the cell.
+    "top"
+    | 
+      ## Cell data is centered vertically within the cell. This is the default value.
+      "middle"
+    | 
+      ## Cell data is flush with the bottom of the cell.
+      "bottom"
+    | 
+      ## All cells in the same row as a cell whose valign attribute has this value should have their textual data positioned so that the first text line occurs on a baseline common to all cells in the row. This constraint does not apply to subsequent text lines in these cells.
+      "baseline"
+  }?
+db.html.table.attributes =
+  
+  ## Provides a summary of the table's purpose and structure for user agents rendering to non-visual media such as speech and Braille.
+  attribute summary { text }?
+  & 
+    ## Specifies the desired width of the entire table and is intended for visual user agents. When the value is a percentage value, the value is relative to the user agent's available horizontal space. In the absence of any width specification, table width is determined by the user agent.
+    attribute width {
+      xsd:integer
+      | xsd:string { pattern = "[0-9]+%" }
+    }?
+  & 
+    ## Specifies the width (in pixels only) of the frame around a table.
+    attribute border { xsd:nonNegativeInteger }?
+  & 
+    ## Specifies which sides of the frame surrounding a table will be visible.
+    attribute frame {
+      
+      ## No sides. This is the default value.
+      "void"
+      | 
+        ## The top side only.
+        "above"
+      | 
+        ## The bottom side only.
+        "below"
+      | 
+        ## The top and bottom sides only.
+        "hsides"
+      | 
+        ## The left-hand side only.
+        "lhs"
+      | 
+        ## The right-hand side only.
+        "rhs"
+      | 
+        ## The right and left sides only.
+        "vsides"
+      | 
+        ## All four sides.
+        "box"
+      | 
+        ## All four sides.
+        "border"
+    }?
+  & 
+    ## Specifies which rules will appear between cells within a table. The rendering of rules is user agent dependent.
+    attribute rules {
+      
+      ## No rules. This is the default value.
+      "none"
+      | 
+        ## Rules will appear between row groups (see thead, tfoot, and tbody) and column groups (see colgroup and col) only.
+        "groups"
+      | 
+        ## Rules will appear between rows only.
+        "rows"
+      | 
+        ## Rules will appear between columns only.
+        "cols"
+      | 
+        ## Rules will appear between all rows and columns.
+        "all"
+    }?
+  & 
+    ## Specifies how much space the user agent should leave between the left side of the table and the left-hand side of the leftmost column, the top of the table and the top side of the topmost row, and so on for the right and bottom of the table. The attribute also specifies the amount of space to leave between cells.
+    attribute cellspacing {
+      xsd:integer
+      | xsd:string { pattern = "[0-9]+%" }
+    }?
+  & 
+    ## Specifies the amount of space between the border of the cell and its contents. If the value of this attribute is a pixel length, all four margins should be this distance from the contents. If the value of the attribute is a percentage length, the top and bottom margins should be equally separated from the content based on a percentage of the available vertical space, and the left and right margins should be equally separated from the content based on a percentage of the available horizontal space.
+    attribute cellpadding {
+      xsd:integer
+      | xsd:string { pattern = "[0-9]+%" }
+    }?
+db.html.tablecell.attributes =
+  
+  ## Provides an abbreviated form of the cell's content and may be rendered by user agents when appropriate in place of the cell's content. Abbreviated names should be short since user agents may render them repeatedly. For instance, speech synthesizers may render the abbreviated headers relating to a particular cell before rendering that cell's content.
+  attribute abbr { text }?
+  & 
+    ## This attribute may be used to place a cell into conceptual categories that can be considered to form axes in an n-dimensional space. User agents may give users access to these categories (e.g., the user may query the user agent for all cells that belong to certain categories, the user agent may present a table in the form of a table of contents, etc.). Please consult an HTML reference for more details.
+    attribute axis { text }?
+  & 
+    ## Specifies the list of header cells that provide header information for the current data cell. The value of this attribute is a space-separated list of cell names; those cells must be named by setting their id attribute. Authors generally use the headers attribute to help non-visual user agents render header information about data cells (e.g., header information is spoken prior to the cell data), but the attribute may also be used in conjunction with style sheets.
+    attribute headers { text }?
+  & 
+    ## Specifies the set of data cells for which the current header cell provides header information. This attribute may be used in place of the headers attribute, particularly for simple tables.
+    attribute scope {
+      
+      ## The current cell provides header information for the rest of the row that contains it
+      "row"
+      | 
+        ## The current cell provides header information for the rest of the column that contains it.
+        "col"
+      | 
+        ## The header cell provides header information for the rest of the row group that contains it.
+        "rowgroup"
+      | 
+        ## The header cell provides header information for the rest of the column group that contains it.
+        "colgroup"
+    }?
+  & 
+    ## Specifies the number of rows spanned by the current cell. The default value of this attribute is one (1
+    ## ). The value zero (0
+    ## ) means that the cell spans all rows from the current row to the last row of the table section (thead
+    ## , tbody
+    ## , or tfoot
+    ## ) in which the cell is defined.
+    attribute rowspan { xsd:nonNegativeInteger }?
+  & 
+    ## Specifies the number of columns spanned by the current cell. The default value of this attribute is one (1
+    ## ). The value zero (0
+    ## ) means that the cell spans all columns from the current column to the last column of the column group (colgroup
+    ## ) in which the cell is defined.
+    attribute colspan { xsd:nonNegativeInteger }?
+db.html.table.info = db._info.title.forbidden
+db.html.table.model =
+  db.html.table.info?,
+  db.html.caption,
+  (db.html.col* | db.html.colgroup*),
+  db.html.thead?,
+  db.html.tfoot?,
+  (db.html.tbody+ | db.html.tr+)
+db.html.informaltable.info = db._info.title.forbidden
+db.html.informaltable.model =
+  db.html.informaltable.info?,
+  (db.html.col* | db.html.colgroup*),
+  db.html.thead?,
+  db.html.tfoot?,
+  (db.html.tbody+ | db.html.tr+)
+div {
+  db.html.table.role.attribute = attribute role { text }
+  db.html.table.label.attribute = db.label.attribute
+  db.html.table.attlist =
+    db.html.attrs
+    & db.html.table.attributes
+    & db.html.table.role.attribute?
+    & db.html.table.label.attribute?
+    & db.orient.attribute?
+    & db.pgwide.attribute?
+    & db.tabstyle.attribute?
+    & db.floatstyle.attribute?
+  db.html.table =
+    
+    ## A formal (captioned) HTML table in a document
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:table"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:informaltable)"
+            "informaltable must not occur in the descendants of table"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element table { db.html.table.attlist, db.html.table.model }
+}
+div {
+  db.html.informaltable.attlist =
+    db.html.attrs & db.html.table.attributes
+  db.html.informaltable =
+    
+    ## An HTML table without a title
+    element informaltable {
+      db.html.informaltable.attlist, db.html.informaltable.model
+    }
+}
+div {
+  db.html.caption.attlist = db.html.attrs
+  db.html.caption =
+    
+    ## An HTML table caption
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:table)"
+            "table must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:sidebar)"
+            "sidebar must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:caption"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:task)"
+            "task must not occur in the descendants of caption"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element caption { db.html.caption.attlist, db.all.inlines* }
+}
+div {
+  db.html.col.attlist =
+    db.html.attrs
+    & 
+      ## This attribute, whose value must be an integer > 0, specifies the number of columns spanned
+      ##  by the col
+      ##  element; the col
+      ##  element shares its attributes with all the columns it spans. The default value for this attribute is 1 (i.e., a single column). If the span attribute is set to N > 1, the current col
+      ##  element shares its attributes with the next N-1 columns.
+      attribute span { xsd:nonNegativeInteger }?
+    & 
+      ## Specifies a default width for each column spanned by the current col
+      ##  element. It has the same meaning as the width
+      ##  attribute for the colgroup
+      ##  element and overrides it.
+      attribute width { text }?
+    & db.html.cellhalign
+    & db.html.cellvalign
+  db.html.col =
+    
+    ## Specifications for a column in an HTML table
+    element col { db.html.col.attlist, empty }
+}
+div {
+  db.html.colgroup.attlist =
+    db.html.attrs
+    & 
+      ## This attribute, which must be an integer > 0, specifies the number of columns in a column group. In the absence of a span attribute, each colgroup
+      ##  defines a column group containing one column. If the span attribute is set to N > 0, the current colgroup
+      ##  element defines a column group containing N columns. User agents must ignore this attribute if the colgroup
+      ##  element contains one or more col
+      ##  elements.
+      attribute span { xsd:nonNegativeInteger }?
+    & 
+      ## This attribute specifies a default width for each column in the current column group. In addition to the standard pixel, percentage, and relative values, this attribute allows the special form 0*
+      ##  (zero asterisk) which means that the width of the each column in the group should be the minimum width necessary to hold the column's contents. This implies that a column's entire contents must be known before its width may be correctly computed. Authors should be aware that specifying 0*
+      ##  will prevent visual user agents from rendering a table incrementally. This attribute is overridden for any column in the column group whose width is specified via a col
+      ##  element.
+      attribute width { text }?
+    & db.html.cellhalign
+    & db.html.cellvalign
+  db.html.colgroup =
+    
+    ## A group of columns in an HTML table
+    element colgroup { db.html.colgroup.attlist, db.html.col* }
+}
+div {
+  db.html.thead.attlist =
+    db.html.attrs & db.html.cellhalign & db.html.cellvalign
+  db.html.thead =
+    
+    ## A table header consisting of one or more rows in an HTML table
+    element thead { db.html.thead.attlist, db.html.tr+ }
+}
+div {
+  db.html.tfoot.attlist =
+    db.html.attrs & db.html.cellhalign & db.html.cellvalign
+  db.html.tfoot =
+    
+    ## A table footer consisting of one or more rows in an HTML table
+    element tfoot { db.html.tfoot.attlist, db.html.tr+ }
+}
+div {
+  db.html.tbody.attlist =
+    db.html.attrs & db.html.cellhalign & db.html.cellvalign
+  db.html.tbody =
+    
+    ## A wrapper for the rows of an HTML table or informal HTML table
+    element tbody { db.html.tbody.attlist, db.html.tr+ }
+}
+div {
+  db.html.tr.attlist =
+    db.html.attrs & db.html.cellhalign & db.html.cellvalign
+  db.html.tr =
+    
+    ## A row in an HTML table
+    element tr { db.html.tr.attlist, (db.html.th | db.html.td)+ }
+}
+div {
+  db.html.th.attlist =
+    db.html.attrs
+    & db.html.tablecell.attributes
+    & db.html.cellhalign
+    & db.html.cellvalign
+  db.html.th =
+    
+    ## A table header entry in an HTML table
+    element th {
+      db.html.th.attlist, (db.all.inlines* | db.all.blocks*)
+    }
+}
+div {
+  db.html.td.attlist =
+    db.html.attrs
+    & db.html.tablecell.attributes
+    & db.html.cellhalign
+    & db.html.cellvalign
+  db.html.td =
+    
+    ## A table entry in an HTML table
+    element td {
+      db.html.td.attlist, (db.all.inlines* | db.all.blocks*)
+    }
+}
+div {
+  db.msgset.role.attribute = attribute role { text }
+  db.msgset.attlist =
+    db.msgset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgset.info = db._info.title.only
+  db.msgset =
+    
+    ## A detailed set of messages, usually error messages
+    element msgset {
+      db.msgset.attlist,
+      db.msgset.info,
+      (db.msgentry+ | db.simplemsgentry+)
+    }
+}
+div {
+  db.msgentry.role.attribute = attribute role { text }
+  db.msgentry.attlist =
+    db.msgentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgentry =
+    
+    ## A wrapper for an entry in a message set
+    element msgentry {
+      db.msgentry.attlist, db.msg+, db.msginfo?, db.msgexplan*
+    }
+}
+div {
+  db.simplemsgentry.role.attribute = attribute role { text }
+  db.simplemsgentry.msgaud.attribute =
+    
+    ## The audience to which the message relevant
+    attribute msgaud { text }
+  db.simplemsgentry.msgorig.attribute =
+    
+    ## The origin of the message
+    attribute msgorig { text }
+  db.simplemsgentry.msglevel.attribute =
+    
+    ## The level of importance or severity of a message
+    attribute msglevel { text }
+  db.simplemsgentry.attlist =
+    db.simplemsgentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.simplemsgentry.msgaud.attribute?
+    & db.simplemsgentry.msgorig.attribute?
+    & db.simplemsgentry.msglevel.attribute?
+  db.simplemsgentry =
+    
+    ## A wrapper for a simpler entry in a message set
+    element simplemsgentry {
+      db.simplemsgentry.attlist, db.msgtext, db.msgexplan+
+    }
+}
+div {
+  db.msg.role.attribute = attribute role { text }
+  db.msg.attlist =
+    db.msg.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msg.info = db._info.title.only
+  db.msg =
+    
+    ## A message in a message set
+    element msg {
+      db.msg.attlist, db.msg.info, db.msgmain, (db.msgsub | db.msgrel)*
+    }
+}
+div {
+  db.msgmain.role.attribute = attribute role { text }
+  db.msgmain.attlist =
+    db.msgmain.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgmain.info = db._info.title.only
+  db.msgmain =
+    
+    ## The primary component of a message in a message set 
+    element msgmain { db.msgmain.attlist, db.msgmain.info, db.msgtext }
+}
+div {
+  db.msgsub.role.attribute = attribute role { text }
+  db.msgsub.attlist =
+    db.msgsub.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgsub.info = db._info.title.only
+  db.msgsub =
+    
+    ## A subcomponent of a message in a message set
+    element msgsub { db.msgsub.attlist, db.msgsub.info, db.msgtext }
+}
+div {
+  db.msgrel.role.attribute = attribute role { text }
+  db.msgrel.attlist =
+    db.msgrel.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgrel.info = db._info.title.only
+  db.msgrel =
+    
+    ## A related component of a message in a message set
+    element msgrel { db.msgrel.attlist, db.msgrel.info, db.msgtext }
+}
+div {
+  db.msgtext.role.attribute = attribute role { text }
+  db.msgtext.attlist =
+    db.msgtext.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgtext =
+    
+    ## The actual text of a message component in a message set
+    element msgtext { db.msgtext.attlist, db.all.blocks+ }
+}
+div {
+  db.msginfo.role.attribute = attribute role { text }
+  db.msginfo.attlist =
+    db.msginfo.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msginfo =
+    
+    ## Information about a message in a message set
+    element msginfo {
+      db.msginfo.attlist, (db.msglevel | db.msgorig | db.msgaud)*
+    }
+}
+div {
+  db.msglevel.role.attribute = attribute role { text }
+  db.msglevel.attlist =
+    db.msglevel.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msglevel =
+    
+    ## The level of importance or severity of a message in a message set
+    element msglevel { db.msglevel.attlist, db._text }
+}
+div {
+  db.msgorig.role.attribute = attribute role { text }
+  db.msgorig.attlist =
+    db.msgorig.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgorig =
+    
+    ## The origin of a message in a message set
+    element msgorig { db.msgorig.attlist, db._text }
+}
+div {
+  db.msgaud.role.attribute = attribute role { text }
+  db.msgaud.attlist =
+    db.msgaud.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgaud =
+    
+    ## The audience to which a message in a message set is relevant
+    element msgaud { db.msgaud.attlist, db._text }
+}
+div {
+  db.msgexplan.role.attribute = attribute role { text }
+  db.msgexplan.attlist =
+    db.msgexplan.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.msgexplan.info = db._info.title.only
+  db.msgexplan =
+    
+    ## Explanatory material relating to a message in a message set
+    element msgexplan {
+      db.msgexplan.attlist, db.msgexplan.info, db.all.blocks+
+    }
+}
+div {
+  db.qandaset.role.attribute = attribute role { text }
+  db.qandaset.defaultlabel.enumeration =
+    
+    ## No labels
+    "none"
+    | 
+      ## Numeric labels
+      "number"
+    | 
+      ## "Q:" and "A:" labels
+      "qanda"
+  db.qandaset.defaultlabel.attribute =
+    
+    ## Specifies the default labelling
+    attribute defaultlabel { db.qandaset.defaultlabel.enumeration }
+  db.qandaset.attlist =
+    db.qandaset.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.qandaset.defaultlabel.attribute?
+  db.qandaset.info = db._info.title.only
+  db.qandaset =
+    
+    ## A question-and-answer set
+    element qandaset {
+      db.qandaset.attlist,
+      db.qandaset.info,
+      db.all.blocks*,
+      (db.qandadiv+ | db.qandaentry+)
+    }
+}
+div {
+  db.qandadiv.role.attribute = attribute role { text }
+  db.qandadiv.attlist =
+    db.qandadiv.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.qandadiv.info = db._info.title.only
+  db.qandadiv =
+    
+    ## A titled division in a QandASet
+    element qandadiv {
+      db.qandadiv.attlist,
+      db.qandadiv.info,
+      db.all.blocks*,
+      (db.qandadiv+ | db.qandaentry+)
+    }
+}
+div {
+  db.qandaentry.role.attribute = attribute role { text }
+  db.qandaentry.attlist =
+    db.qandaentry.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.qandaentry.info = db._info.title.only
+  db.qandaentry =
+    
+    ## A question/answer set within a QandASet
+    element qandaentry {
+      db.qandaentry.attlist, db.qandaentry.info, db.question, db.answer*
+    }
+}
+div {
+  db.question.role.attribute = attribute role { text }
+  db.question.attlist =
+    db.question.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.question =
+    
+    ## A question in a QandASet
+    element question { db.question.attlist, db.label?, db.all.blocks+ }
+}
+div {
+  db.answer.role.attribute = attribute role { text }
+  db.answer.attlist =
+    db.answer.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.answer =
+    
+    ## An answer to a question posed in a QandASet
+    element answer { db.answer.attlist, db.label?, db.all.blocks+ }
+}
+div {
+  db.label.role.attribute = attribute role { text }
+  db.label.attlist =
+    db.label.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.label =
+    
+    ## A label on a Question or Answer
+    element label { db.label.attlist, db._text }
+}
+db.math.inlines = db.inlineequation
+db.equation.content = (db.mediaobject+ | db.mathphrase+) | db._any.mml+
+db.inlineequation.content = db.inlinemediaobject+ | db.mathphrase+
+div {
+  db.equation.role.attribute = attribute role { text }
+  db.equation.label.attribute = db.label.attribute
+  db.equation.attlist =
+    db.equation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.equation.label.attribute?
+    & db.pgwide.attribute?
+    & db.floatstyle.attribute?
+  db.equation.info = db._info.title.only
+  db.equation =
+    
+    ## A displayed mathematical equation
+    [
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:example)"
+            "example must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:figure)"
+            "figure must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:table)"
+            "table must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:equation)"
+            "equation must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:caution)"
+            "caution must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:important)"
+            "important must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:note)"
+            "note must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:tip)"
+            "tip must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+      s:pattern [
+        name = "Element exclusion"
+        "\x{a}" ~
+        "          "
+        s:rule [
+          context = "db:equation"
+          "\x{a}" ~
+          "            "
+          s:assert [
+            test = "not(.//db:warning)"
+            "warning must not occur in the descendants of equation"
+          ]
+          "\x{a}" ~
+          "          "
+        ]
+        "\x{a}" ~
+        "        "
+      ]
+    ]
+    element equation {
+      db.equation.attlist,
+      db.equation.info,
+      db.alt?,
+      db.equation.content,
+      db.caption?
+    }
+}
+div {
+  db.informalequation.role.attribute = attribute role { text }
+  db.informalequation.attlist =
+    db.informalequation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.informalequation.info = db._info.title.forbidden
+  db.informalequation =
+    
+    ## A displayed mathematical equation without a title
+    element informalequation {
+      db.informalequation.attlist,
+      db.informalequation.info,
+      db.alt?,
+      db.equation.content,
+      db.caption?
+    }
+}
+div {
+  db.inlineequation.role.attribute = attribute role { text }
+  db.inlineequation.attlist =
+    db.inlineequation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.inlineequation =
+    
+    ## A mathematical equation or expression occurring inline
+    element inlineequation {
+      db.inlineequation.attlist, db.alt?, db.inlineequation.content
+    }
+}
+div {
+  db.mathphrase.role.attribute = attribute role { text }
+  db.mathphrase.attlist =
+    db.mathphrase.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+  db.mathphrase =
+    
+    ## A mathematical phrase, an expression that can be represented with ordinary text and a small amount of markup
+    element mathphrase {
+      db.mathphrase.attlist,
+      (db._text | db.ubiq.inlines | db._emphasis)*
+    }
+}
+div {
+  db.imagedata.mathml.role.attribute = attribute role { text }
+  db.imagedata.mathml.attlist =
+    db.imagedata.mathml.role.attribute?
+    & db.common.attributes
+    & 
+      ## Specifies that the format of the data is MathML
+      attribute format {
+        
+        ## Specifies MathML.
+        "mathml"
+      }?
+    & db.imagedata.align.attribute?
+    & db.imagedata.valign.attribute?
+    & db.imagedata.width.attribute?
+    & db.imagedata.contentwidth.attribute?
+    & db.imagedata.scalefit.attribute?
+    & db.imagedata.scale.attribute?
+    & db.imagedata.depth.attribute?
+    & db.imagedata.contentdepth.attribute?
+  db.imagedata.mathml.info = db._info.title.forbidden
+  db.imagedata.mathml =
+    
+    ## A MathML expression in a media object
+    element imagedata {
+      db.imagedata.mathml.attlist,
+      db.imagedata.mathml.info,
+      db._any.mml+
+    }
+}
+div {
+  db._any.mml =
+    
+    ## Any element from the MathML namespace
+    element mml:* { (db._any.attribute | text | db._any)* }
+}
+div {
+  db.imagedata.svg.role.attribute = attribute role { text }
+  db.imagedata.svg.attlist =
+    db.imagedata.svg.role.attribute?
+    & db.common.attributes
+    & 
+      ## Specifies that the format of the data is SVG
+      attribute format {
+        
+        ## Specifies SVG.
+        "svg"
+      }?
+    & db.imagedata.align.attribute?
+    & db.imagedata.valign.attribute?
+    & db.imagedata.width.attribute?
+    & db.imagedata.contentwidth.attribute?
+    & db.imagedata.scalefit.attribute?
+    & db.imagedata.scale.attribute?
+    & db.imagedata.depth.attribute?
+    & db.imagedata.contentdepth.attribute?
+  db.imagedata.svg.info = db._info.title.forbidden
+  db.imagedata.svg =
+    
+    ## An SVG drawing in a media object
+    element imagedata {
+      db.imagedata.svg.attlist, db.imagedata.svg.info, db._any.svg+
+    }
+}
+div {
+  db._any.svg =
+    
+    ## Any element from the SVG namespace
+    element svg:* { (db._any.attribute | text | db._any)* }
+}
diff --git a/xml/relaxng/testData/parsing/psi/complex/Docbook.txt b/xml/relaxng/testData/parsing/psi/complex/Docbook.txt
new file mode 100644
index 0000000..dfb6292
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/Docbook.txt
@@ -0,0 +1,55100 @@
+RncFileImpl:Docbook.rnc
+  DOCUMENT
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('a')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://relaxng.org/ns/compatibility/annotations/1.0"')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('ctrl')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://nwalsh.com/xmlns/schema-control/"')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_DEFAULT)('default')
+      PsiWhiteSpace(' ')
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('db')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://docbook.org/ns/docbook"')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('html')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.w3.org/1999/xhtml"')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('mml')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.w3.org/1998/Math/MathML"')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('rng')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://relaxng.org/ns/structure/1.0"')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('s')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.ascc.net/xml/schematron"')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('svg')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.w3.org/2000/svg"')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('xlink')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.w3.org/1999/xlink"')
+    PsiWhiteSpace('\n')
+    ANNOTATION_ELEMENT
+      NAME
+        PsiElement(PREFIXED_NAME)('s:ns')
+      PsiWhiteSpace(' ')
+      PsiElement([)('[')
+      PsiWhiteSpace('\n  ')
+      PsiElement(IDENTIFIER)('prefix')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"a"')
+      PsiWhiteSpace('\n  ')
+      PsiElement(IDENTIFIER)('uri')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://relaxng.org/ns/compatibility/annotations/1.0"')
+      PsiWhiteSpace('\n')
+      PsiElement(])(']')
+    PsiWhiteSpace('\n')
+    ANNOTATION_ELEMENT
+      NAME
+        PsiElement(PREFIXED_NAME)('s:ns')
+      PsiWhiteSpace(' ')
+      PsiElement([)('[')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('prefix')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"ctrl"')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('uri')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://nwalsh.com/xmlns/schema-control/"')
+      PsiWhiteSpace(' ')
+      PsiElement(])(']')
+    PsiWhiteSpace('\n')
+    ANNOTATION_ELEMENT
+      NAME
+        PsiElement(PREFIXED_NAME)('s:ns')
+      PsiWhiteSpace(' ')
+      PsiElement([)('[')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('prefix')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"db"')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('uri')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://docbook.org/ns/docbook"')
+      PsiWhiteSpace(' ')
+      PsiElement(])(']')
+    PsiWhiteSpace('\n')
+    ANNOTATION_ELEMENT
+      NAME
+        PsiElement(PREFIXED_NAME)('s:ns')
+      PsiWhiteSpace(' ')
+      PsiElement([)('[')
+      PsiWhiteSpace('\n  ')
+      PsiElement(IDENTIFIER)('prefix')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"dbx"')
+      PsiWhiteSpace('\n  ')
+      PsiElement(IDENTIFIER)('uri')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace('\n    ')
+      PsiElement(LITERAL)('"http://sourceforge.net/projects/docbook/defguide/schema/extra-markup"')
+      PsiWhiteSpace('\n')
+      PsiElement(])(']')
+    PsiWhiteSpace('\n')
+    ANNOTATION_ELEMENT
+      NAME
+        PsiElement(PREFIXED_NAME)('s:ns')
+      PsiWhiteSpace(' ')
+      PsiElement([)('[')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('prefix')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"html"')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('uri')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.w3.org/1999/xhtml"')
+      PsiWhiteSpace(' ')
+      PsiElement(])(']')
+    PsiWhiteSpace('\n')
+    ANNOTATION_ELEMENT
+      NAME
+        PsiElement(PREFIXED_NAME)('s:ns')
+      PsiWhiteSpace(' ')
+      PsiElement([)('[')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('prefix')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"mml"')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('uri')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.w3.org/1998/Math/MathML"')
+      PsiWhiteSpace(' ')
+      PsiElement(])(']')
+    PsiWhiteSpace('\n')
+    ANNOTATION_ELEMENT
+      NAME
+        PsiElement(PREFIXED_NAME)('s:ns')
+      PsiWhiteSpace(' ')
+      PsiElement([)('[')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('prefix')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"rng"')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('uri')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://relaxng.org/ns/structure/1.0"')
+      PsiWhiteSpace(' ')
+      PsiElement(])(']')
+    PsiWhiteSpace('\n')
+    ANNOTATION_ELEMENT
+      NAME
+        PsiElement(PREFIXED_NAME)('s:ns')
+      PsiWhiteSpace(' ')
+      PsiElement([)('[')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('prefix')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"s"')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('uri')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.ascc.net/xml/schematron"')
+      PsiWhiteSpace(' ')
+      PsiElement(])(']')
+    PsiWhiteSpace('\n')
+    ANNOTATION_ELEMENT
+      NAME
+        PsiElement(PREFIXED_NAME)('s:ns')
+      PsiWhiteSpace(' ')
+      PsiElement([)('[')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('prefix')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"svg"')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('uri')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.w3.org/2000/svg"')
+      PsiWhiteSpace(' ')
+      PsiElement(])(']')
+    PsiWhiteSpace('\n')
+    ANNOTATION_ELEMENT
+      NAME
+        PsiElement(PREFIXED_NAME)('s:ns')
+      PsiWhiteSpace(' ')
+      PsiElement([)('[')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('prefix')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"xlink"')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('uri')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.w3.org/1999/xlink"')
+      PsiWhiteSpace(' ')
+      PsiElement(])(']')
+    PsiWhiteSpace('\n\n')
+    PsiComment(SINGLE_LINE_COMMENT)('#  DocBook V5.0CR5')
+    PsiWhiteSpace('\n\n')
+    PsiComment(SINGLE_LINE_COMMENT)('# See http://docbook.org/ns/docbook')
+    PsiWhiteSpace('\n\n')
+    PsiComment(SINGLE_LINE_COMMENT)('# This file is part of DocBook V5.0CR5')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Copyright 1992-2005 HaL Computer Systems, Inc.,')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Corporation, Norman Walsh, Sun Microsystems, Inc., and the')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Organization for the Advancement of Structured Information')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Standards (OASIS).')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Permission to use, copy, modify and distribute the DocBook schema')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# and its accompanying documentation for any purpose and without fee')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# is hereby granted in perpetuity, provided that the above copyright')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# notice and this paragraph appear in all copies. The copyright')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# holders make no representation about the suitability of the schema')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# for any purpose. It is provided "as is" without expressed or implied')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# warranty.')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# If you modify the DocBook schema in any way, label your schema as a')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# variant of DocBook. See the reference documentation')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# (http://docbook.org/tdg5/en/html/ch05.html#s-notdocbook)')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# for more information.')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Please direct all questions, bug reports, or suggestions for changes')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# to the [email protected] mailing list. For more')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# information, see http://www.oasis-open.org/docbook/.')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ')
+    PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ======================================================================')
+    PsiWhiteSpace('\n')
+    GRAMMAR_PATTERN
+      START
+        PsiElement(KEYWORD_START)('start')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.set')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.book')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.divisions')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.components')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.navigation.components')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.section')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.para')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect1')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect2')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect3')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect4')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect5')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refentry')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsection')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect1')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect2')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect3')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.setindex')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db._any.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Any attribute including in any attribute in any namespace.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db._any')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Any element from almost any namespace')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(*)('*')
+              PsiWhiteSpace(' ')
+              EXCEPT_NAME_CLASS
+                PsiElement(-)('-')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(()('(')
+                  NAME_CLASS_CHOICE
+                    NAME_CLASS
+                      NAME
+                        PsiElement(PREFIX_STAR)('db:*')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    NAME_CLASS
+                      NAME
+                        PsiElement(PREFIX_STAR)('html:*')
+                  PsiElement())(')')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            ZERO_OR_MORE
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db._any.attribute')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  TEXT_PATTERN
+                    PsiElement(KEYWORD_TEXT)('text')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db._any')
+                PsiElement())(')')
+              PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.arch.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Designates the computer or chip architecture to which the element applies')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('arch')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.audience.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Designates the intended audience to which the element applies, for example, system administrators, programmers, or new users.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('audience')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.condition.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## provides a standard place for application-specific effectivity')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('condition')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.conformance.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates standards conformance characteristics of the element')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('conformance')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.os.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates the operating system to which the element is applicable')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('os')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.revision.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates the editorial revision to which the element belongs')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('revision')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.security.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates something about the security level associated with the element to which it applies')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('security')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.userlevel.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates the level of user experience for which the element applies')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('userlevel')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.vendor.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates the computer vendor to which the element applies.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('vendor')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.wordsize.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates the word size (width in bits) of the computer architecture to which the element applies')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('wordsize')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.effectivity.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.arch.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.audience.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.condition.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.conformance.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.os.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.revision.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.security.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.userlevel.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.vendor.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.wordsize.attribute')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.endterm.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Points to the element whose content is to be used as the text of the link')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('endterm')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:IDREF')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.linkend.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Points to an internal link target by identifying the value of its xml:id attribute')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('linkend')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:IDREF')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.linkends.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Points to one or more internal link targets by identifying the value of their xml:id attributes')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('linkends')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:IDREFS')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xlink.href.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies a link target with a URI')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('xlink:href')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:anyURI')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xlink.type.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the XLink link type')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('xlink:type')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An XLink simple link')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"simple"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xlink.role.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the XLink role of the link')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('xlink:role')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:anyURI')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xlink.arcrole.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the XLink arcrole of the link')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('xlink:arcrole')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:anyURI')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xlink.title.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the XLink title of the link')
+        PsiWhiteSpace('\n  ')
+        OPTIONAL
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              NAME
+                PsiElement(PREFIXED_NAME)('xlink:title')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xlink.show.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## An application traversing to the ending resource should load it in a new window, frame, pane, or other relevant presentation context.')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"new"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## An application traversing to the ending resource should load the resource in the same window, frame, pane, or other relevant presentation context in which the starting resource was loaded.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"replace"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## An application traversing to the ending resource should load its presentation in place of the presentation of the starting resource.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"embed"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The behavior of an application traversing to the ending resource is unconstrained by XLink. The application should look for other markup present in the link to determine the appropriate behavior.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"other"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The behavior of an application traversing to the ending resource is unconstrained by this specification. No other markup is present to help the application determine the appropriate behavior.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"none"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xlink.show.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the XLink show behavior of the link')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('xlink:show')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.xlink.show.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xlink.actuate.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## An application should traverse to the ending resource immediately on loading the starting resource.')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"onLoad"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## An application should traverse from the starting resource to the ending resource only on a post-loading event triggered for the purpose of traversal.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"onRequest"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The behavior of an application traversing to the ending resource is unconstrained by this specification. The application should look for other markup present in the link to determine the appropriate behavior.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"other"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The behavior of an application traversing to the ending resource is unconstrained by this specification. No other markup is present to help the application determine the appropriate behavior.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"none"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xlink.actuate.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the XLink actuate behavior of the link')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('xlink:actuate')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.xlink.actuate.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.href.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.xlink.href.attribute')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.xlink.type.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.xlink.role.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.xlink.arcrole.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.xlink.title.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.xlink.show.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.xlink.actuate.attribute')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xml.id.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the unique ID value of the element')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('xml:id')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:ID')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.version.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the DocBook version of the element and its descendants')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('version')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xml.lang.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the natural language of the element and its descendants')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('xml:lang')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xml.base.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the base URI of the element and its descendants')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('xml:base')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:anyURI')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.remap.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Provides the name or similar semantic identifier assigned to the content in some previous markup scheme')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('remap')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xreflabel.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Provides the text that is to be generated for a cross reference to the element')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('xreflabel')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xrefstyle.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies a keyword or keywords identifying additional style information')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('xrefstyle')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.revisionflag.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## The element has been changed.')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"changed"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The element is new (has been added to the document).')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"added"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The element has been deleted.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"deleted"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Explicitly turns off revision markup for this element.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"off"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.revisionflag.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the revision status of the element')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('revisionflag')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.revisionflag.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.dir.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Left-to-right text')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"ltr"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Right-to-left text')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"rtl"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Left-to-right override')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"lro"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Right-to-left override')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"rlo"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.dir.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the direction of text in an element')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('dir')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.dir.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.common.base.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.version.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.xml.lang.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.xml.base.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.remap.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.xreflabel.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.revisionflag.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.dir.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.effectivity.attributes')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.common.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.xml.id.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.common.base.attributes')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.annotations.attribute')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.common.idreq.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.xml.id.attribute')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.common.base.attributes')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.annotations.attribute')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        OPTIONAL
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.linkend.attribute')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.href.attributes')
+            PsiElement())(')')
+          PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.common.req.linking.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.linkend.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.href.attributes')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.common.data.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the format of the data')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('format')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            PsiWhiteSpace('\n   ')
+            PsiComment(DOCUMENTATION)('## Indentifies the location of the data by URI')
+            PsiWhiteSpace('\n   ')
+            CHOICE
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('fileref')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace(' ')
+                DATATYPE_PATTERN
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xsd:anyURI')
+                PsiWhiteSpace(' ')
+                PsiElement(})('}')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' \n     ')
+              PsiComment(DOCUMENTATION)('## Identifies the location of the data by external identifier (entity name)')
+              PsiWhiteSpace('\n     ')
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('entityref')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace(' ')
+                DATATYPE_PATTERN
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xsd:ENTITY')
+                PsiWhiteSpace(' ')
+                PsiElement(})('}')
+            PsiElement())(')')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.verbatim.continuation.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Line numbering continues from the immediately preceding element with the same name.')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"continues"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Line numbering restarts (begins at 1, usually).')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"restarts"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.verbatim.continuation.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Determines whether line numbering continues from the previous element or restarts.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('continuation')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.verbatim.continuation.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.verbatim.linenumbering.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Lines are numbered.')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"numbered"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Lines are not numbered.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"unnumbered"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.verbatim.linenumbering.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Determines whether lines are numbered.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('linenumbering')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.verbatim.linenumbering.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.verbatim.startinglinenumber.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the initial line number.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('startinglinenumber')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:integer')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.verbatim.language.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the language (i.e. programming language) of the verbatim content.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('language')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.verbatim.xml.space.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Can be used to indicate explicitly that whitespace in the verbatim environment is preserved. Whitespace must always be preserved in verbatim environments whether this attribute is specified or not.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('xml:space')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Whitespace must be preserved.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"preserve"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.verbatim.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.verbatim.continuation.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.verbatim.linenumbering.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.verbatim.startinglinenumber.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.verbatim.language.attribute')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.verbatim.xml.space.attribute')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.label.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies an identifying string for presentation purposes')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('label')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.width.characters.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the width (in characters) of the element')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('width')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:nonNegativeInteger')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.spacing.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## The spacing should be "compact".')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"compact"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The spacing should be "normal".')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"normal"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.spacing.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies (a hint about) the spacing of the content')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('spacing')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.spacing.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.pgwide.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## The element should be rendered in the current text flow (with the flow column width).')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"0"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The element should be rendered across the full text page.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"1"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.pgwide.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates if the element is rendered across the column or the page')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('pgwide')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.pgwide.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.language.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the language (i.e. programming language) of the content.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('language')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.performance.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## The content describes an optional step or steps.')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"optional"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The content describes a required step or steps.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"required"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.performance.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies if the content is required or optional.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('performance')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.performance.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.floatstyle.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies style information to be used when rendering the float')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('floatstyle')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.width.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the width of the element')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('width')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.depth.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the depth of the element')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('depth')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.contentwidth.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the width of the content rectangle')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('contentwidth')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.contentdepth.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the depth of the content rectangle')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('contentdepth')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.scalefit.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## False (do not scale-to-fit; anamorphic scaling may occur)')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"0"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## True (scale-to-fit; anamorphic scaling is forbidden)')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"1"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.scale.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the scaling factor')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('scale')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:positiveInteger')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.halign.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Centered horizontally')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"center"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Aligned horizontally on the specified character')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"char"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Fully justified (left and right margins or edges)')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"justify"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Left aligned')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"left"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Right aligned')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"right"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.valign.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Aligned on the bottom of the region')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"bottom"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Centered vertically')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"middle"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Aligned on the top of the region')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"top"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.biblio.class.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## A document object identifier.')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"doi"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## An international standard book number.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"isbn"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## An international standard technical report number (ISO 10444).')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"isrn"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## An international standard serial number.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"issn"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## A Library of Congress reference number.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"libraryofcongress"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## A publication number (an internal number or possibly organizational standard).')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"pubsnumber"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## A Uniform Resource Identifier')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"uri"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.biblio.class-enum.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the kind of bibliographic identifier')
+        PsiWhiteSpace('\n  ')
+        OPTIONAL
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.biblio.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.biblio.class-other.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the nature of the non-standard bibliographic identifier')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('otherclass')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.biblio.class-other.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the kind of bibliographic identifier')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n    \n    ')
+            PsiComment(DOCUMENTATION)('## Indicates that the identifier is some 'other' kind.')
+            PsiWhiteSpace('\n    ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"other"')
+            PsiWhiteSpace('\n  ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.biblio.class-other.attribute')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.biblio.class.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.biblio.class-enum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.biblio.class-other.attributes')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.ubiq.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.inlinemediaobject')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.remark')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.superscript')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subscript')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.link.inlines')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.alt')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.annotation')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.indexterm')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db._text')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ZERO_OR_MORE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.ubiq.inlines')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._phrase')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.replaceable')
+            PsiElement())(')')
+          PsiElement(*)('*')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db._title')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        INTERLEAVE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.title')
+            PsiElement(?)('?')
+          PsiWhiteSpace(' ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.titleabbrev')
+            PsiElement(?)('?')
+          PsiWhiteSpace(' ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.subtitle')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db._title.req')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        INTERLEAVE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.title')
+          PsiWhiteSpace(' ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.titleabbrev')
+            PsiElement(?)('?')
+          PsiWhiteSpace(' ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.subtitle')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db._title.only')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        INTERLEAVE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.title')
+            PsiElement(?)('?')
+          PsiWhiteSpace(' ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.titleabbrev')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db._title.onlyreq')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        INTERLEAVE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.title')
+          PsiWhiteSpace(' ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.titleabbrev')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db._info')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            SEQUENCE
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db._title.req')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.titleforbidden.info')
+                PsiElement(?)('?')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.info')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._title.req')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.titleforbidden.info')
+                PsiElement(?)('?')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.titlereq.info')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._title.only')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.titleforbidden.info')
+                PsiElement(?)('?')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.titleonly.info')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db._info.title.onlyreq')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._title.onlyreq')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.titleforbidden.info')
+                PsiElement(?)('?')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.titleonlyreq.info')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        OPTIONAL
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.titleforbidden.info')
+          PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.all.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.ubiq.inlines')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.general.inlines')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.domain.inlines')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.extension.inlines')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.general.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.publishing.inlines')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.product.inlines')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.bibliography.inlines')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.graphic.inlines')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.indexing.inlines')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.link.inlines')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.domain.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.technical.inlines')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.error.inlines')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.os.inlines')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.programming.inlines')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.markup.inlines')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.gui.inlines')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keyboard.inlines')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.math.inlines')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.technical.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.replaceable')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.systemitem')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.option')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.optional')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.package')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.parameter')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.property')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.termdef')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.nonterminal')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.error.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.errorcode')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.errortext')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.errorname')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.errortype')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.oo.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.ooclass')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.ooexception')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.oointerface')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.programming.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.function')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.parameter')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.varname')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.returnvalue')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.type')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.classname')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.exceptionname')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.interfacename')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.methodname')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.modifier')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.initializer')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.oo.inlines')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.product.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.productnumber')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.productname')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.database')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.application')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.hardware')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.trademark')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.os.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.prompt')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.envar')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.filename')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.command')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.computeroutput')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.userinput')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.markup.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.tag')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.markup')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.token')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.symbol')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.literal')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.code')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.constant')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.email')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.uri')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.bibliography.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.citation')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.citerefentry')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.citetitle')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.citebiblioid')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.author')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.person')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.personname')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.org')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.orgname')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.editor')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.jobtitle')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.publishing.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.abbrev')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.acronym')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.date')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.emphasis')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.footnote')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.footnoteref')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.foreignphrase')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.phrase')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.quote')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subscript')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.superscript')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.wordasword')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.glossary.inlines')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.coref')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.graphic.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('db.inlinemediaobject')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.indexing.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          NOT_ALLOWED_PATTERN
+            PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.indexterm')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.gui.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.guiicon')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.guibutton')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.guimenuitem')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.guimenu')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.guisubmenu')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.guilabel')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.menuchoice')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.mousebutton')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.keyboard.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.keycombo')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.keycap')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.keycode')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.keysym')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.shortcut')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.accel')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.link.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xref')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.link')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.olink')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.anchor')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.biblioref')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.extension.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        NOT_ALLOWED_PATTERN
+          PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.nopara.blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.list.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.admonition.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.formal.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informal.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.publishing.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.graphic.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.technical.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.verbatim.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.synopsis.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bridgehead')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.remark')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revhistory')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.indexterm')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.para.blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.anchor')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.para')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.formalpara')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.simpara')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.all.blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.nopara.blocks')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.para.blocks')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.extension.blocks')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.annotation')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.formal.blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.example')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.figure')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.table')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.equation')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.informal.blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalexample')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalfigure')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informaltable')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.informalequation')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.publishing.blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.sidebar')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.blockquote')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.address')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.epigraph')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.graphic.blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.mediaobject')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.screenshot')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.technical.blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.procedure')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.task')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.productionset')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.constraintdef')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.msgset')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.admonition.blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.caution')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.important')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.note')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.tip')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.warning')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.list.blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.itemizedlist')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orderedlist')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.procedure')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplelist')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.variablelist')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.segmentedlist')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.glosslist')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.bibliolist')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.calloutlist')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.qandaset')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.verbatim.blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.programlisting')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.screen')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.literallayout')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.synopsis')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.programlistingco')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.screenco')
+            PsiElement())(')')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.synopsis.blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.cmdsynopsis')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.funcsynopsis')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.classsynopsis')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.methodsynopsis')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.constructorsynopsis')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.destructorsynopsis')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.fieldsynopsis')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.extension.blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        NOT_ALLOWED_PATTERN
+          PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.info.extension')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('db._any')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.info.elements')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.abstract')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.address')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.artpagenums')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.author')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.authorgroup')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.authorinitials')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliocoverage')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioid')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliosource')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.collab')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.confgroup')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.contractsponsor')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.contractnum')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.copyright')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cover')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.date')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.edition')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.editor')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.issuenum')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keywordset')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.legalnotice')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.mediaobject')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.org')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orgname')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.othercredit')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.pagenums')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.printhistory')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.productname')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.productnumber')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.pubdate')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.publisher')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.publishername')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.releaseinfo')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revhistory')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.seriesvolnums')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subjectset')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.volumenum')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.info.extension')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.annotation')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.extendedlink')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliomisc')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliomset')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliorelation')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioset')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.itermset')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.bibliographic.elements')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.info.elements')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.publishing.inlines')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.citerefentry')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.citetitle')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.citebiblioid')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.person')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.personname')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.subtitle')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.title')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.title.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.title.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.title.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.title')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The text of the title of a section of a document or of a formal block-level element')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('title')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.title.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titleabbrev.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titleabbrev.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.titleabbrev.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titleabbrev')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The abbreviation of a title')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('titleabbrev')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.titleabbrev.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subtitle.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subtitle.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subtitle.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subtitle')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The subtitle of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('subtitle')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subtitle.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.info.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.info.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.info.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for information about a component or other block')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('info')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.info.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                INTERLEAVE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db._title')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.info.elements')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titlereq.info.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titlereq.info.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.titlereq.info.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titlereq.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for information about a component or other block with a required title')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('info')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.titlereq.info.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                INTERLEAVE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db._title.req')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.info.elements')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titleonly.info.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titleonly.info.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.titleonly.info.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titleonly.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for information about a component or other block with only a title')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('info')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.titleonly.info.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                INTERLEAVE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db._title.only')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.info.elements')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titleonlyreq.info.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titleonlyreq.info.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.titleonlyreq.info.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titleonlyreq.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for information about a component or other block with only a required title')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('info')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.titleonlyreq.info.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                INTERLEAVE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db._title.onlyreq')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.info.elements')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titleforbidden.info.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titleforbidden.info.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.titleforbidden.info.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.titleforbidden.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for information about a component or other block without a title')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('info')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.titleforbidden.info.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.info.elements')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subjectset.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subjectset.scheme.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the controlled vocabulary used by this set's terms')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('scheme')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subjectset.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subjectset.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subjectset.scheme.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subjectset')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A set of terms describing the subject matter of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('subjectset')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subjectset.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.subject')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subject.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subject.weight.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies a ranking for this subject relative to other subjects in the same set')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('weight')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subject.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subject.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subject.weight.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subject')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## One of a group of terms describing the subject matter of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('subject')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subject.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.subjectterm')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subjectterm.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subjectterm.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subjectterm.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subjectterm')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A term in a group of terms describing the subject matter of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('subjectterm')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subjectterm.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keywordset.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keywordset.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keywordset.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keywordset')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A set of keywords describing the content of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('keywordset')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keywordset.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.keyword')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keyword.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keyword.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keyword.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keyword')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## One of a set of keywords describing the content of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('keyword')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keyword.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.table.choice')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          NOT_ALLOWED_PATTERN
+            PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.cals.table')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.html.table')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.informaltable.choice')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          NOT_ALLOWED_PATTERN
+            PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.cals.informaltable')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.html.informaltable')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.table')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('db.table.choice')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.informaltable')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('db.informaltable.choice')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.procedure.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.procedure.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.procedure.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.procedure.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.procedure')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A list of operations to be performed in a well-defined sequence')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('procedure')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.procedure.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.procedure.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.step')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.step.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.step.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.step.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.performance.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.step.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        PsiComment(SINGLE_LINE_COMMENT)('# ')
+        PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n  # This content model is blocks*, step|stepalternatives, blocks* but')
+        PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n  # expressed this way it avoids UPA issues in XSD and DTD versions')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.step')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A unit of action in a procedure')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('step')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.step.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.step.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      ONE_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.all.blocks')
+                        PsiElement(+)('+')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace('\n        ')
+                      OPTIONAL
+                        GROUP_PATTERN
+                          PsiElement(()('(')
+                          SEQUENCE
+                            GROUP_PATTERN
+                              PsiElement(()('(')
+                              CHOICE
+                                REF_PATTERN
+                                  PsiElement(IDENTIFIER)('db.substeps')
+                                PsiWhiteSpace(' ')
+                                PsiElement(|)('|')
+                                PsiWhiteSpace(' ')
+                                REF_PATTERN
+                                  PsiElement(IDENTIFIER)('db.stepalternatives')
+                              PsiElement())(')')
+                            PsiElement(,)(',')
+                            PsiWhiteSpace(' ')
+                            ZERO_OR_MORE
+                              REF_PATTERN
+                                PsiElement(IDENTIFIER)('db.all.blocks')
+                              PsiElement(*)('*')
+                          PsiElement())(')')
+                        PsiElement(?)('?')
+                    PsiElement())(')')
+                  PsiWhiteSpace('\n       ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      GROUP_PATTERN
+                        PsiElement(()('(')
+                        CHOICE
+                          REF_PATTERN
+                            PsiElement(IDENTIFIER)('db.substeps')
+                          PsiWhiteSpace(' ')
+                          PsiElement(|)('|')
+                          PsiWhiteSpace(' ')
+                          REF_PATTERN
+                            PsiElement(IDENTIFIER)('db.stepalternatives')
+                        PsiElement())(')')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      ZERO_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.all.blocks')
+                        PsiElement(*)('*')
+                    PsiElement())(')')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.stepalternatives.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.stepalternatives.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.stepalternatives.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.performance.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.stepalternatives.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.stepalternatives')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Alternative steps in a procedure')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('stepalternatives')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.stepalternatives.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.stepalternatives.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.step')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.substeps.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.substeps.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.substeps.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.performance.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.substeps')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for steps that occur within steps in a procedure')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('substeps')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.substeps.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.step')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sidebar.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sidebar.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sidebar.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sidebar.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sidebar')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A portion of a document that is isolated from the main narrative flow')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:sidebar"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:sidebar)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"sidebar must not occur in the descendants of sidebar"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('sidebar')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sidebar.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sidebar.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.abstract.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.abstract.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.abstract.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.abstract.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.abstract')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A summary')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('abstract')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.abstract.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.abstract.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.para.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.personblurb.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.personblurb.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.personblurb.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.personblurb.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.personblurb')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A short description or note about a person')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('personblurb')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.personblurb.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.personblurb.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.para.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.blockquote.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.blockquote.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.blockquote.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.blockquote.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.blockquote')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A quotation set off from the main text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('blockquote')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.blockquote.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.blockquote.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.attribution')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.attribution.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.attribution.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.attribution.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.attribution')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The source of a block quote or epigraph')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('attribution')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.attribution.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.person')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.personname')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.citetitle')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.citation')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bridgehead.renderas.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Render as a first-level section')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"sect1"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Render as a second-level section')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"sect2"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Render as a third-level section')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"sect3"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Render as a fourth-level section')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"sect4"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Render as a fifth-level section')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"sect5"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bridgehead.renderas-enum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Indicates how the bridge head should be rendered')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('renderas')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bridgehead.renderas.enumeration')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bridgehead.renderas-other.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the nature of the non-standard rendering')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('otherrenderas')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bridgehead.renderas-other.attributes')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Indicates how the bridge head should be rendered')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('renderas')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace('\n      \n      ')
+              PsiComment(DOCUMENTATION)('## Identifies a non-standard rendering')
+              PsiWhiteSpace('\n      ')
+              DATATYPE_PATTERN
+                PsiElement(LITERAL)('"other"')
+              PsiWhiteSpace('\n    ')
+              PsiElement(})('}')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.bridgehead.renderas-other.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bridgehead.renderas.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.bridgehead.renderas-enum.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.bridgehead.renderas-other.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bridgehead.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bridgehead.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bridgehead.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bridgehead.renderas.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bridgehead')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A free-floating heading')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('bridgehead')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bridgehead.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.remark.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.remark.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.remark.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.remark')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A remark (or comment) intended for presentation in a draft manuscript')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('remark')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.remark.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.epigraph.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.epigraph.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.epigraph.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.epigraph.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.epigraph')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A short inscription at the beginning of a document or component')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('epigraph')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.epigraph.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.epigraph.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.attribution')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.para.blocks')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.literallayout')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.footnote.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.footnote.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the desired footnote mark')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('label')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.footnote.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.footnote.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.footnote.label.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.footnote')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A footnote')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:footnote)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"footnote must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:example)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"example must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:figure)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"figure must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:table)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"table must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:equation)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"equation must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:caution)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"caution must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:important)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"important must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:note)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"note must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:tip)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"tip must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:warning)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"warning must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:indexterm)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"indexterm must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:sidebar)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"sidebar must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:task)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"task must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnote"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:epigraph)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"epigraph must not occur in the descendants of footnote"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('footnote')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.footnote.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.formalpara.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.formalpara.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.formalpara.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.formalpara.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.onlyreq')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.formalpara')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A paragraph with a title')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('formalpara')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.formalpara.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.formalpara.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.indexing.inlines')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.para')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.para.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.para.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.para.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.para.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.para')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A paragraph')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:para"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('para')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.para.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.para.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.all.inlines')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.nopara.blocks')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simpara.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simpara.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simpara.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simpara.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simpara')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A paragraph that contains only text and inline markup, no block elements')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('simpara')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simpara.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simpara.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.admonition.contentmodel')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.all.blocks')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.caution.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.caution.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.caution.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.caution')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A note of caution')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caution"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:caution)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"caution must not occur in the descendants of caution"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caution"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:important)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"important must not occur in the descendants of caution"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caution"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:note)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"note must not occur in the descendants of caution"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caution"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:tip)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"tip must not occur in the descendants of caution"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caution"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:warning)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"warning must not occur in the descendants of caution"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('caution')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.caution.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.admonition.contentmodel')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.important.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.important.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.important.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.important')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An admonition set off from the text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:important"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:caution)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"caution must not occur in the descendants of important"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:important"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:important)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"important must not occur in the descendants of important"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:important"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:note)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"note must not occur in the descendants of important"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:important"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:tip)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"tip must not occur in the descendants of important"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:important"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:warning)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"warning must not occur in the descendants of important"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('important')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.important.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.admonition.contentmodel')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.note.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.note.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.note.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.note')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A message set off from the text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:note"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:caution)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"caution must not occur in the descendants of note"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:note"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:important)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"important must not occur in the descendants of note"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:note"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:note)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"note must not occur in the descendants of note"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:note"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:tip)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"tip must not occur in the descendants of note"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:note"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:warning)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"warning must not occur in the descendants of note"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('note')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.note.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.admonition.contentmodel')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tip.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tip.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tip.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tip')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A suggestion to the user, set off from the text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:tip"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:caution)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"caution must not occur in the descendants of tip"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:tip"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:important)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"important must not occur in the descendants of tip"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:tip"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:note)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"note must not occur in the descendants of tip"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:tip"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:tip)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"tip must not occur in the descendants of tip"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:tip"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:warning)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"warning must not occur in the descendants of tip"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tip')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tip.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.admonition.contentmodel')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.warning.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.warning.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.warning.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.warning')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An admonition set off from the text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:warning"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:caution)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"caution must not occur in the descendants of warning"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:warning"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:important)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"important must not occur in the descendants of warning"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:warning"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:note)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"note must not occur in the descendants of warning"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:warning"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:tip)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"tip must not occur in the descendants of warning"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:warning"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:warning)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"warning must not occur in the descendants of warning"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('warning')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.warning.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.admonition.contentmodel')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.itemizedlist.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.itemizedlist.mark.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the type of mark to be used on items in this list')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('mark')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.itemizedlist.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.itemizedlist.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.spacing.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.itemizedlist.mark.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.itemizedlist.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.itemizedlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A list in which each entry is marked with a bullet or other dingbat')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('itemizedlist')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.itemizedlist.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.itemizedlist.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.listitem')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orderedlist.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orderedlist.continuation.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies that numbering should begin where the preceding list left off')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"continues"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Specifies that numbering should begin again at 1')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"restarts"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orderedlist.continuation.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Indicates how list numbering should begin relative to the immediately preceding list')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('continuation')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.orderedlist.continuation.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orderedlist.startingnumber.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the initial line number.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('startingnumber')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:integer')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orderedlist.inheritnum.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies that numbering should ignore list nesting')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"ignore"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Specifies that numbering should inherit from outer-level lists')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"inherit"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orderedlist.inheritnum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Indicates whether or not item numbering should be influenced by list nesting')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('inheritnum')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.orderedlist.inheritnum.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orderedlist.numeration.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies Arabic numeration (1, 2, 3, ...)')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"arabic"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Specifies upper-case alphabetic numeration (A, B, C, ...)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"upperalpha"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Specifies lower-case alphabetic numeration (a, b, c, ...)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"loweralpha"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Specifies upper-case Roman numeration (I, II, III, ...)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"upperroman"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Specifies lower-case Roman numeration (i, ii, iii ...)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"lowerroman"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orderedlist.numeration.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Indicates the desired numeration')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('numeration')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.orderedlist.numeration.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orderedlist.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orderedlist.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.spacing.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.orderedlist.continuation.attribute')
+                  PsiWhiteSpace('\n       ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.orderedlist.startingnumber.attribute')
+                PsiElement())(')')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orderedlist.inheritnum.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orderedlist.numeration.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orderedlist.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orderedlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A list in which each entry is marked with a sequentially incremented label')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('orderedlist')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orderedlist.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orderedlist.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.listitem')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.listitem.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.listitem.override.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the keyword for the type of mark that should be used on this')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ##  item, instead of the mark that would be used by default')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('override')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.listitem.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.listitem.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.listitem.override.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.listitem')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for the elements of a list item')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('listitem')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.listitem.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.segmentedlist.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.segmentedlist.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.segmentedlist.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.segmentedlist.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.segmentedlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A segmented list, a list of sets of elements')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('segmentedlist')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.segmentedlist.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.segmentedlist.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.segtitle')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.seglistitem')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.segtitle.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.segtitle.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.segtitle.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.segtitle')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The title of an element of a list item in a segmented list')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('segtitle')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.segtitle.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seglistitem.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seglistitem.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.seglistitem.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seglistitem')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A list item in a segmented list')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Cardinality of segments and titles"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:seglistitem"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"count(db:seg) = count(../db:segtitle)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The number of seg elements must be the same as the number of segtitle elements in the parent segmentedlist"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('seglistitem')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.seglistitem.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.seg')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seg.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seg.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.seg.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seg')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An element of a list item in a segmented list')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('seg')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.seg.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplelist.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplelist.type.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A tabular presentation in row-major order.')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"horiz"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A tabular presentation in column-major order.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"vert"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An inline presentation, usually a comma-delimited list.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"inline"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplelist.type.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the type of list presentation.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace(' ')
+              PsiElement(PREFIXED_NAME)('a:defaultValue')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              PsiElement(LITERAL)('"vert"')
+              PsiWhiteSpace(' ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('type')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.simplelist.type.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplelist.columns.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the number of columns for horizontal or vertical presentation')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('columns')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:integer')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplelist.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplelist.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplelist.type.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplelist.columns.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplelist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An undecorated list of single words or short phrases')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('simplelist')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplelist.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.member')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.member.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.member.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.member.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.member')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An element of a simple list')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('member')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.member.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.variablelist.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.variablelist.termlength.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Indicates a length beyond which the presentation system may consider a term too long and select an alternate presentation for that term, item, or list')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('termlength')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.variablelist.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.variablelist.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.spacing.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.variablelist.termlength.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.variablelist.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.variablelist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A list in which each entry is composed of a set of one or more terms and an associated description')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('variablelist')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.variablelist.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.variablelist.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.varlistentry')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.varlistentry.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.varlistentry.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.varlistentry.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.varlistentry')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for a set of terms and the associated description in a variable list')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('varlistentry')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.varlistentry.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.term')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.listitem')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.term.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.term.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.term.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.term')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The word or phrase being defined or described in a variable list')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('term')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.term.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.example.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.example.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.label.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.example.width.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.width.characters.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.example.pgwide.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.pgwide.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.example.floatstyle.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.floatstyle.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.example.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.example.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.example.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.example.floatstyle.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.example.width.attribute')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.example.pgwide.attribute')
+                PsiElement())(')')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.example.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.onlyreq')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.example')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A formal example, with a title')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:example"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:example)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"example must not occur in the descendants of example"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:example"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:figure)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"figure must not occur in the descendants of example"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:example"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:table)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"table must not occur in the descendants of example"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:example"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:equation)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"equation must not occur in the descendants of example"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:example"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:caution)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"caution must not occur in the descendants of example"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:example"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:important)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"important must not occur in the descendants of example"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:example"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:note)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"note must not occur in the descendants of example"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:example"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:tip)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"tip must not occur in the descendants of example"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:example"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:warning)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"warning must not occur in the descendants of example"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('example')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.example.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.example.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.caption')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalexample.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalexample.width.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.width.characters.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalexample.floatstyle.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.floatstyle.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalexample.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalexample.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalexample.floatstyle.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalexample.width.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalexample.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalexample')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A displayed example without a title')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('informalexample')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalexample.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalexample.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.caption')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.verbatim.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.all.inlines')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.lineannotation')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.co')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.verbatim.contentmodel')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.textobject')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.verbatim.inlines')
+                PsiElement(*)('*')
+            PsiElement())(')')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.programlisting.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.programlisting.width.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.width.characters.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.programlisting.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.programlisting.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.verbatim.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.programlisting.width.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.programlisting')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A literal listing of all or part of a program')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('programlisting')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.programlisting.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.verbatim.contentmodel')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.literallayout.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.literallayout.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The literal layout should be formatted with a monospaced font')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"monospaced"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The literal layout should be formatted with the current font')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"normal"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.literallayout.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the class of literal layout')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.literallayout.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.literallayout.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.literallayout.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.verbatim.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.literallayout.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.literallayout')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A block of text in which line breaks and white space are to be reproduced faithfully')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('literallayout')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.literallayout.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.verbatim.contentmodel')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.screen.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.screen.width.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.width.characters.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.screen.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.screen.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.verbatim.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.screen.width.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.screen')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Text that a user sees or might see on a computer screen')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('screen')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.screen.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.verbatim.contentmodel')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.screenshot.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.screenshot.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.screenshot.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.screenshot.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.screenshot')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A representation of what the user sees or might see on a computer screen')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('screenshot')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.screenshot.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.screenshot.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.mediaobject')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.figure.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.figure.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.label.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.figure.pgwide.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.pgwide.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.figure.floatstyle.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.floatstyle.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.figure.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.figure.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.figure.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.figure.pgwide.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.figure.floatstyle.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.figure.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.onlyreq')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.figure')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A formal figure, generally an illustration, with a title')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:figure"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:example)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"example must not occur in the descendants of figure"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:figure"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:figure)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"figure must not occur in the descendants of figure"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:figure"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:table)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"table must not occur in the descendants of figure"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:figure"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:equation)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"equation must not occur in the descendants of figure"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:figure"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:caution)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"caution must not occur in the descendants of figure"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:figure"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:important)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"important must not occur in the descendants of figure"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:figure"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:note)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"note must not occur in the descendants of figure"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:figure"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:tip)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"tip must not occur in the descendants of figure"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:figure"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:warning)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"warning must not occur in the descendants of figure"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('figure')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.figure.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.figure.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.caption')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalfigure.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalfigure.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.label.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalfigure.pgwide.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.pgwide.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalfigure.floatstyle.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.floatstyle.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalfigure.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalfigure.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalfigure.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalfigure.pgwide.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalfigure.floatstyle.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalfigure.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalfigure')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A untitled figure')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('informalfigure')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalfigure.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalfigure.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.caption')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.mediaobject.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videoobject')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.audioobject')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imageobject')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.textobject')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.imageobjectco')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.mediaobject.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.mediaobject.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.mediaobject.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.mediaobject.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.mediaobject')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A displayed media object (video, audio, image, etc.)')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('mediaobject')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.mediaobject.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.mediaobject.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.alt')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.mediaobject.content')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.caption')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.inlinemediaobject.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.inlinemediaobject.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.inlinemediaobject.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.inlinemediaobject.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.inlinemediaobject')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An inline media object (video, audio, image, and so on)')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('inlinemediaobject')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.inlinemediaobject.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.inlinemediaobject.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.alt')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.mediaobject.content')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videoobject.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videoobject.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videoobject.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videoobject.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videoobject')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for video data and its associated meta-information')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('videoobject')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videoobject.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videoobject.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videodata')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.audioobject.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.audioobject.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.audioobject.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.audioobject.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.audioobject')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for audio data and its associated meta-information')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('audioobject')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.audioobject.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.audioobject.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.audiodata')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.imageobject.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.imagedata')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.imagedata.mathml')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.imagedata.svg')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imageobject.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imageobject.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imageobject.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imageobject.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imageobject')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for image data and its associated meta-information')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('imageobject')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imageobject.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imageobject.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imageobject.content')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.textobject.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.textobject.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.textobject.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.textobject.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.textobject')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for a text description of an object and its associated meta-information')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('textobject')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.textobject.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.textobject.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.phrase')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.textdata')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.all.blocks')
+                    PsiElement(+)('+')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.align.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.halign.enumeration')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.align.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the (horizontal) alignment of the video data')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('align')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.videodata.align.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.valign.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.valign.enumeration')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.valign.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the vertical alignment of the video data')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('valign')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.videodata.valign.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.width.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.width.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.depth.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.depth.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.contentwidth.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.contentwidth.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.contentdepth.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.contentdepth.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.scalefit.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.scalefit.enumeration')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.scalefit.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Determines if anamorphic scaling is forbidden')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('scalefit')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.videodata.scalefit.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.scale.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.scale.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videodata.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.data.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videodata.align.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videodata.valign.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videodata.width.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videodata.contentwidth.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videodata.scalefit.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videodata.scale.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videodata.depth.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videodata.contentdepth.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.videodata')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Pointer to external video data')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('videodata')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videodata.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.videodata.info')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.audiodata.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.audiodata.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.audiodata.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.data.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.audiodata.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.audiodata')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Pointer to external audio data')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('audiodata')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.audiodata.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.audiodata.info')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.align.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.halign.enumeration')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.align.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the (horizontal) alignment of the image data')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('align')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.imagedata.align.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.valign.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.valign.enumeration')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.valign.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the vertical alignment of the image data')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('valign')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.imagedata.valign.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.width.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.width.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.depth.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.depth.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.contentwidth.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.contentwidth.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.contentdepth.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.contentdepth.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.scalefit.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.scalefit.enumeration')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.scalefit.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Determines if anamorphic scaling is forbidden')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('scalefit')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.imagedata.scalefit.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.scale.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.scale.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.data.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.align.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.valign.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.width.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.contentwidth.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.scalefit.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.scale.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.depth.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.contentdepth.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Pointer to external image data')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('imagedata')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.info')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.textdata.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.textdata.encoding.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the encoding of the text in the external file')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('encoding')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.textdata.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.textdata.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.data.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.textdata.encoding.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.textdata.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.textdata')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Pointer to external text data')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('textdata')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.textdata.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.textdata.info')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.caption.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.caption.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.caption.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.caption.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.caption')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A caption')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:example)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"example must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:figure)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"figure must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:table)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"table must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:equation)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"equation must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:caution)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"caution must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:important)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"important must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:note)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"note must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:tip)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"tip must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:warning)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"warning must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:sidebar)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"sidebar must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:task)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"task must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('caption')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.caption.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.caption.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.synopsis.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.synopsis.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.label.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.synopsis.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.synopsis.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.verbatim.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.synopsis.label.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.synopsis')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A general-purpose element for representing the syntax of commands or functions')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('synopsis')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.synopsis.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.verbatim.contentmodel')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cmdsynopsis.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cmdsynopsis.sepchar.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the character that should separate the command and its top-level arguments')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('sepchar')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cmdsynopsis.cmdlength.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Indicates the displayed length of the command; this information may be used to intelligently indent command synopses which extend beyond one line')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('cmdlength')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cmdsynopsis.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.label.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cmdsynopsis.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cmdsynopsis.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cmdsynopsis.sepchar.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cmdsynopsis.cmdlength.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cmdsynopsis.label.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cmdsynopsis.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cmdsynopsis')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A syntax summary for a software command')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('cmdsynopsis')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cmdsynopsis.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cmdsynopsis.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.command')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.arg')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.group')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.sbr')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.synopfragment')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.rep.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Can not be repeated.')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"norepeat"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Can be repeated.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"repeat"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.rep.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates whether or not repetition is possible.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          ANNOTATION
+            PsiElement([)('[')
+            PsiWhiteSpace(' ')
+            PsiElement(PREFIXED_NAME)('a:defaultValue')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"norepeat"')
+            PsiWhiteSpace(' ')
+            PsiElement(])(']')
+          PsiWhiteSpace(' ')
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('rep')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.rep.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.choice.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Formatted to indicate that it is optional.')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"opt"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Formatted without indication.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"plain"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Formatted to indicate that it is required.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"req"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.choice.opt.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates optionality.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          ANNOTATION
+            PsiElement([)('[')
+            PsiWhiteSpace(' ')
+            PsiElement(PREFIXED_NAME)('a:defaultValue')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"opt"')
+            PsiWhiteSpace(' ')
+            PsiElement(])(']')
+          PsiWhiteSpace(' ')
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('choice')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.choice.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.choice.req.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates optionality.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          ANNOTATION
+            PsiElement([)('[')
+            PsiWhiteSpace(' ')
+            PsiElement(PREFIXED_NAME)('a:defaultValue')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"req"')
+            PsiWhiteSpace(' ')
+            PsiElement(])(']')
+          PsiWhiteSpace(' ')
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('choice')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.choice.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.arg.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.arg.rep.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.rep.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.arg.choice.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.choice.opt.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.arg.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.arg.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.arg.rep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.arg.choice.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.arg')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An argument in a CmdSynopsis')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('arg')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.arg.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.arg')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.group')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.option')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.synopfragmentref')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.sbr')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.group.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.group.rep.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.rep.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.group.choice.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.choice.opt.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.group.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.group.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.group.rep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.group.choice.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.group')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A group of elements in a CmdSynopsis')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('group')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.group.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.arg')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.group')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.option')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.synopfragmentref')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.replaceable')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.sbr')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sbr.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sbr.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sbr.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sbr')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An explicit line break in a command synopsis')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('sbr')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sbr.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.synopfragment.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.synopfragment.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.synopfragment.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.synopfragment')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A portion of a CmdSynopsis broken out from the main body of the synopsis')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('synopfragment')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.synopfragment.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.arg')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.group')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.synopfragmentref.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.synopfragmentref.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.synopfragmentref.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.linkend.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.synopfragmentref')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A reference to a fragment of a command synopsis')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Synopsis fragment type constraint"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:synopfragmentref"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace('\n              ')
+                    PsiElement(LITERAL)('"local-name(//*[@xml:id=current()/@linkend]) = 'synopfragment' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"@linkend on synopfragmentref must point to a synopfragment."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('synopfragmentref')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.synopfragmentref.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcsynopsis.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcsynopsis.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.funcsynopsis.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.language.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcsynopsis.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcsynopsis')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The syntax summary for a function definition')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('funcsynopsis')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.funcsynopsis.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.funcsynopsis.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.funcsynopsisinfo')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.funcprototype')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcsynopsisinfo.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcsynopsisinfo.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.funcsynopsisinfo.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.verbatim.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcsynopsisinfo')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Information supplementing the FuncDefs of a FuncSynopsis')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('funcsynopsisinfo')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.funcsynopsisinfo.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.verbatim.contentmodel')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcprototype.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcprototype.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.funcprototype.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcprototype')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The prototype of a function')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('funcprototype')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.funcprototype.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.modifier')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.funcdef')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.void')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.varargs')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      ONE_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.paramdef')
+                        PsiElement(+)('+')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      OPTIONAL
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.varargs')
+                        PsiElement(?)('?')
+                    PsiElement())(')')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.modifier')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcdef.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcdef.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.funcdef.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcdef')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A function (subroutine) name and its return type')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('funcdef')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.funcdef.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.type')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.function')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.void.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.void.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.void.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.void')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An empty element in a function synopsis indicating that the function in question takes no arguments')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('void')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.void.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.varargs.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.varargs.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.varargs.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.varargs')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An empty element in a function synopsis indicating a variable number of arguments')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('varargs')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.varargs.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.paramdef.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.paramdef.choice.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Formatted to indicate that it is optional.')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"opt"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Formatted to indicate that it is required.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"req"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.paramdef.choice.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Indicates optionality.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace(' ')
+              PsiElement(PREFIXED_NAME)('a:defaultValue')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              PsiElement(LITERAL)('"opt"')
+              PsiWhiteSpace(' ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('choice')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.paramdef.choice.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.paramdef.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.paramdef.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.paramdef.choice.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.paramdef')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Information about a function parameter in a programming language')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('paramdef')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.paramdef.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.initializer')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.type')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.parameter')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.funcparams')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcparams.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcparams.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.funcparams.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.funcparams')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Parameters for a function referenced through a function pointer in a synopsis')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('funcparams')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.funcparams.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.classsynopsis.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.classsynopsis.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## This is the synopsis of a class')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"class"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## This is the synopsis of an interface')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"interface"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.classsynopsis.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the nature of the synopsis')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.classsynopsis.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.classsynopsis.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.classsynopsis.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.language.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.classsynopsis.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.classsynopsis')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The syntax summary for a class definition')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('classsynopsis')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.classsynopsis.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.oo.inlines')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.classsynopsisinfo')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.methodsynopsis')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.constructorsynopsis')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.destructorsynopsis')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.fieldsynopsis')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.classsynopsisinfo.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.classsynopsisinfo.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.classsynopsisinfo.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.verbatim.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.classsynopsisinfo')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Information supplementing the contents of a ClassSynopsis')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('classsynopsisinfo')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.classsynopsisinfo.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.verbatim.contentmodel')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.ooclass.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.ooclass.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.ooclass.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.ooclass')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A class in an object-oriented programming language')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('ooclass')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.ooclass.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.package')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.modifier')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.classname')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.oointerface.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.oointerface.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.oointerface.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.oointerface')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An interface in an object-oriented programming language')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('oointerface')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.oointerface.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.package')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.modifier')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.interfacename')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.ooexception.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.ooexception.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.ooexception.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.ooexception')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An exception in an object-oriented programming language')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('ooexception')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.ooexception.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.package')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.modifier')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.exceptionname')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.modifier.xml.space.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Can be used to indicate that whitespace in the modifier should be preserved (for multi-line annotations, for example).')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('xml:space')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Extra whitespace and line breaks must be preserved.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              PsiComment(SINGLE_LINE_COMMENT)('# Ideally the definition of xml:space used on modifier would be')
+              PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n      # different from the definition used on the verbatim elements. The')
+              PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n      # verbatim elements forbid the use of xml:space="default" which')
+              PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n      # wouldn't be a problem on modifier. But doing that causes the')
+              PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n      # generated XSD schemas to be broken so I'm just reusing the existing')
+              PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n      # definition for now. It won't be backwards incompatible to fix this')
+              PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n      # problem in the future.')
+              PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n      #    | ## Extra whitespace and line breaks are not preserved.')
+              PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n      #      "default"')
+              PsiWhiteSpace('\n      \n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(LITERAL)('"preserve"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.modifier.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.modifier.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.modifier.xml.space.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.modifier.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.modifier')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Modifiers in a synopsis')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('modifier')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.modifier.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.interfacename.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.interfacename.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.interfacename.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.interfacename')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of an interface')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('interfacename')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.interfacename.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.exceptionname.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.exceptionname.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.exceptionname.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.exceptionname')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of an exception')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('exceptionname')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.exceptionname.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.fieldsynopsis.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.fieldsynopsis.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.fieldsynopsis.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.language.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.fieldsynopsis')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of a field in a class definition')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('fieldsynopsis')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.fieldsynopsis.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.modifier')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.type')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.varname')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.initializer')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.initializer.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.initializer.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.initializer.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.initializer')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The initializer for a FieldSynopsis')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('initializer')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.initializer.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constructorsynopsis.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constructorsynopsis.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.constructorsynopsis.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.language.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constructorsynopsis')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A syntax summary for a constructor')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('constructorsynopsis')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.constructorsynopsis.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.modifier')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.methodname')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.methodparam')
+                    PsiElement(+)('+')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  OPTIONAL
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.void')
+                    PsiElement(?)('?')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.exceptionname')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.destructorsynopsis.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.destructorsynopsis.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.destructorsynopsis.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.language.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.destructorsynopsis')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A syntax summary for a destructor')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('destructorsynopsis')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.destructorsynopsis.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.modifier')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.methodname')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.methodparam')
+                    PsiElement(+)('+')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  OPTIONAL
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.void')
+                    PsiElement(?)('?')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.exceptionname')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.methodsynopsis.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.methodsynopsis.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.methodsynopsis.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.language.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.methodsynopsis')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A syntax summary for a method')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('methodsynopsis')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.methodsynopsis.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.modifier')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.type')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.void')
+                  PsiElement())(')')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.methodname')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.methodparam')
+                    PsiElement(+)('+')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.void')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.exceptionname')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.modifier')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.methodname.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.methodname.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.methodname.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.methodname')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of a method')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('methodname')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.methodname.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.methodparam.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.methodparam.rep.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.rep.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.methodparam.choice.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.choice.req.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.methodparam.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.methodparam.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.methodparam.rep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.methodparam.choice.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.methodparam')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Parameters to a method')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('methodparam')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.methodparam.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.modifier')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.type')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      ZERO_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.modifier')
+                        PsiElement(*)('*')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      REF_PATTERN
+                        PsiElement(IDENTIFIER)('db.parameter')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      OPTIONAL
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.initializer')
+                        PsiElement(?)('?')
+                    PsiElement())(')')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.funcparams')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.modifier')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.address.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.address.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.address.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.verbatim.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.address')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A real-world address, generally a postal address')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('address')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.address.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.personname')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.pob')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.street')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.city')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.state')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.postcode')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.country')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.phone')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.fax')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.email')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.otheraddr')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.street.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.street.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.street.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.street')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A street address in an address')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('street')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.street.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.pob.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.pob.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.pob.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.pob')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A post office box in an address')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('pob')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.pob.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.postcode.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.postcode.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.postcode.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.postcode')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A postal code in an address')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('postcode')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.postcode.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.city.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.city.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.city.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.city')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of a city in an address')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('city')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.city.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.state.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.state.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.state.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.state')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A state or province in an address')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('state')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.state.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.country.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.country.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.country.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.country')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of a country')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('country')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.country.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.phone.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.phone.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.phone.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.phone')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A telephone number')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('phone')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.phone.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.fax.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.fax.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.fax.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.fax')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A fax number')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('fax')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.fax.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.otheraddr.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.otheraddr.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.otheraddr.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.otheraddr')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Uncategorized information in address')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('otheraddr')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.otheraddr.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.affiliation.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.affiliation.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.affiliation.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.affiliation')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The institutional affiliation of an individual')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('affiliation')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.affiliation.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.shortaffil')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.jobtitle')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  OPTIONAL
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.org')
+                    PsiElement(?)('?')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      OPTIONAL
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.orgname')
+                        PsiElement(?)('?')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      ZERO_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.orgdiv')
+                        PsiElement(*)('*')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      ZERO_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.address')
+                        PsiElement(*)('*')
+                    PsiElement())(')')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.shortaffil.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.shortaffil.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.shortaffil.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.shortaffil')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A brief description of an affiliation')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('shortaffil')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.shortaffil.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.jobtitle.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.jobtitle.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.jobtitle.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.jobtitle')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The title of an individual in an organization')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('jobtitle')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.jobtitle.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orgname.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A consortium')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"consortium"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A corporation')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"corporation"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An informal organization')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"informal"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A non-profit organization')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"nonprofit"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orgname.class-enum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the nature of the organization')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.orgname.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orgname.class-other.attributes')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the nature of the organization')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('class')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace('\n      \n      ')
+              PsiComment(DOCUMENTATION)('## Indicates a non-standard organization class')
+              PsiWhiteSpace('\n      ')
+              DATATYPE_PATTERN
+                PsiElement(LITERAL)('"other"')
+              PsiWhiteSpace('\n    ')
+              PsiElement(})('}')
+            PsiElement(,)(',')
+            PsiWhiteSpace('\n    \n    ')
+            PsiComment(DOCUMENTATION)('## Identifies the non-standard nature of the organization')
+            PsiWhiteSpace('\n    ')
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('otherclass')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orgname.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.orgname.class-enum.attribute')
+            PsiWhiteSpace(' ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.orgname.class-other.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orgname.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orgname.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orgname.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orgname.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orgname')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of an organization other than a corporation ')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('orgname')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orgname.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orgdiv.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orgdiv.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orgdiv.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.orgdiv')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A division of an organization')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('orgdiv')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orgdiv.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.artpagenums.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.artpagenums.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.artpagenums.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.artpagenums')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The page numbers of an article as published')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('artpagenums')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.artpagenums.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.personname.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.personname.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.personname.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.personname')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The personal name of an individual')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('personname')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.personname.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db._text')
+                  PsiWhiteSpace('\n       ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ONE_OR_MORE
+                    GROUP_PATTERN
+                      PsiElement(()('(')
+                      CHOICE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.honorific')
+                        PsiWhiteSpace('\n          ')
+                        PsiElement(|)('|')
+                        PsiWhiteSpace(' ')
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.firstname')
+                        PsiWhiteSpace('\n          ')
+                        PsiElement(|)('|')
+                        PsiWhiteSpace(' ')
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.surname')
+                        PsiWhiteSpace('\n          ')
+                        PsiElement(|)('|')
+                        PsiWhiteSpace(' ')
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.lineage')
+                        PsiWhiteSpace('\n          ')
+                        PsiElement(|)('|')
+                        PsiWhiteSpace(' ')
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.othername')
+                      PsiElement())(')')
+                    PsiElement(+)('+')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.person.author.contentmodel')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.personname')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          ZERO_OR_MORE
+            GROUP_PATTERN
+              PsiElement(()('(')
+              CHOICE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.personblurb')
+                PsiWhiteSpace('\n   ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.affiliation')
+                PsiWhiteSpace('\n   ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.email')
+                PsiWhiteSpace('\n   ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.address')
+                PsiWhiteSpace('\n   ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.contrib')
+              PsiElement())(')')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.org.author.contentmodel')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.orgname')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          ZERO_OR_MORE
+            GROUP_PATTERN
+              PsiElement(()('(')
+              CHOICE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.orgdiv')
+                PsiWhiteSpace(' ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.affiliation')
+                PsiWhiteSpace(' ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.email')
+                PsiWhiteSpace(' ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.address')
+                PsiWhiteSpace(' ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.contrib')
+              PsiElement())(')')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.credit.contentmodel')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.person.author.contentmodel')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.org.author.contentmodel')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.author.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.author.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.author.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.author')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of an individual author')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('author')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.author.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.credit.contentmodel')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.authorgroup.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.authorgroup.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.authorgroup.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.authorgroup')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Wrapper for author information when a document has multiple authors or collabarators')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('authorgroup')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.authorgroup.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.author')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.editor')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.othercredit')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.collab.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.collab.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.collab.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.collab')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies a collaborator')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('collab')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.collab.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.person')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.personname')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.org')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.orgname')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.affiliation')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.authorinitials.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.authorinitials.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.authorinitials.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.authorinitials')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The initials or other short identifier for an author')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('authorinitials')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.authorinitials.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.person.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.person.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.person.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.person')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A person and associated metadata')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('person')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.person.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.personname')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.address')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.affiliation')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.email')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.personblurb')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.org.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.org.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.org.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.org')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An organization and associated metadata')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('org')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.org.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orgname')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.address')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.affiliation')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.email')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.orgdiv')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.confgroup.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.confgroup.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.confgroup.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.confgroup')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for document meta-information about a conference')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('confgroup')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.confgroup.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.confdates')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.conftitle')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.confnum')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.confsponsor')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.address')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.confdates.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.confdates.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.confdates.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.confdates')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The dates of a conference for which a document was written')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('confdates')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.confdates.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.conftitle.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.conftitle.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.conftitle.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.conftitle')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The title of a conference for which a document was written')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('conftitle')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.conftitle.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.confnum.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.confnum.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.confnum.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.confnum')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An identifier, frequently numerical, associated with a conference for which a document was written')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('confnum')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.confnum.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.confsponsor.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.confsponsor.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.confsponsor.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.confsponsor')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The sponsor of a conference for which a document was written')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('confsponsor')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.confsponsor.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.contractnum.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.contractnum.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.contractnum.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.contractnum')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The contract number of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('contractnum')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.contractnum.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.contractsponsor.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.contractsponsor.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.contractsponsor.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.contractsponsor')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The sponsor of a contract')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('contractsponsor')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.contractsponsor.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.copyright.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.copyright.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.copyright.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.copyright')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Copyright information about a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('copyright')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.copyright.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.year')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.holder')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.year.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.year.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.year.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.year')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The year of publication of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('year')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.year.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.holder.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.holder.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.holder.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.holder')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of the individual or organization that holds a copyright')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('holder')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.holder.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.cover.contentmodel')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        ONE_OR_MORE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.para.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.extension.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.list.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informal.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.publishing.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.graphic.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.technical.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.verbatim.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bridgehead')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.synopsis.blocks')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.remark')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revhistory')
+            PsiElement())(')')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cover.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cover.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cover.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cover')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Additional content for the cover of a publication')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('cover')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cover.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cover.contentmodel')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.date.contentmodel')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:date')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:dateTime')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:gYearMonth')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:gYear')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.date.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.date.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.date.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.date')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The date of publication or revision of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('date')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.date.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.date.contentmodel')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.edition.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.edition.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.edition.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.edition')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name or number of an edition of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('edition')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.edition.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.editor.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.editor.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.editor.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.editor')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of the editor of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('editor')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.editor.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.credit.contentmodel')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioid.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioid.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioid.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.biblio.class.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioid')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An identifier for a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('biblioid')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioid.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citebiblioid.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citebiblioid.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.citebiblioid.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.biblio.class.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citebiblioid')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A citation of a bibliographic identifier')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('citebiblioid')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.citebiblioid.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliosource.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliosource.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliosource.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.biblio.class.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliosource')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The source of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('bibliosource')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliosource.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliorelation.type.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The described resource pre-existed the referenced resource, which is essentially the same intellectual content presented in another format')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"hasformat"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The described resource includes the referenced resource either physically or logically')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"haspart"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The described resource has a version, edition, or adaptation, namely, the referenced resource')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"hasversion"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The described resource is the same intellectual content of the referenced resource, but presented in another format')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"isformatof"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The described resource is a physical or logical part of the referenced resource')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"ispartof"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The described resource is referenced, cited, or otherwise pointed to by the referenced resource')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"isreferencedby"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The described resource is supplanted, displaced, or superceded by the referenced resource')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"isreplacedby"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The described resource is required by the referenced resource, either physically or logically')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"isrequiredby"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The described resource is a version, edition, or adaptation of the referenced resource; changes in version imply substantive changes in content rather than differences in format')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"isversionof"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The described resource references, cites, or otherwise points to the referenced resource')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"references"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The described resource supplants, displaces, or supersedes the referenced resource')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"replaces"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The described resource requires the referenced resource to support its function, delivery, or coherence of content')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"requires"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliorelation.type-enum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the type of relationship')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('type')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliorelation.type.enumeration')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliorelation.type-other.attributes')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the type of relationship')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            OPTIONAL
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('type')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace('\n      \n      ')
+                PsiComment(DOCUMENTATION)('## The described resource has a non-standard relationship with the referenced resource')
+                PsiWhiteSpace('\n      ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"othertype"')
+                PsiWhiteSpace('\n    ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiElement(,)(',')
+            PsiWhiteSpace('\n    \n    ')
+            PsiComment(DOCUMENTATION)('## A keyword that identififes the type of the non-standard relationship')
+            PsiWhiteSpace('\n    ')
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('othertype')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              DATATYPE_PATTERN
+                NAME
+                  PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliorelation.type.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.bibliorelation.type-enum.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.bibliorelation.type-other.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliorelation.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliorelation.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliorelation.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.biblio.class.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.bibliorelation.type.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliorelation')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The relationship of a document to another')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('bibliorelation')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliorelation.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliocoverage.spacial.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The DCMI Point identifies a point in space using its geographic coordinates')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"dcmipoint"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## ISO 3166 Codes for the representation of names of countries')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"iso3166"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The DCMI Box identifies a region of space using its geographic limits')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"dcmibox"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The Getty Thesaurus of Geographic Names')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"tgn"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliocoverage.spatial-enum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the type of spatial coverage')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('spatial')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliocoverage.spacial.enumeration')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliocoverage.spatial-other.attributes')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the type of spatial coverage')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            OPTIONAL
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('spatial')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace('\n      \n      ')
+                PsiComment(DOCUMENTATION)('## Identifies a non-standard type of coverage')
+                PsiWhiteSpace('\n      ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"otherspatial"')
+                PsiWhiteSpace('\n    ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiElement(,)(',')
+            PsiWhiteSpace('\n    \n    ')
+            PsiComment(DOCUMENTATION)('## A keyword that identifies the type of non-standard coverage')
+            PsiWhiteSpace('\n    ')
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('otherspatial')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              DATATYPE_PATTERN
+                NAME
+                  PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliocoverage.spatial.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.bibliocoverage.spatial-enum.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.bibliocoverage.spatial-other.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliocoverage.temporal.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A specification of the limits of a time interval')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"dcmiperiod"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## W3C Encoding rules for dates and times—a profile based on ISO 8601')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"w3c-dtf"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliocoverage.temporal-enum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the type of temporal coverage')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('temporal')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliocoverage.temporal.enumeration')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliocoverage.temporal-other.attributes')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the type of temporal coverage')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            OPTIONAL
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('temporal')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace('\n      \n      ')
+                PsiComment(DOCUMENTATION)('## Specifies a non-standard type of coverage')
+                PsiWhiteSpace('\n      ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"othertemporal"')
+                PsiWhiteSpace('\n    ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiElement(,)(',')
+            PsiWhiteSpace('\n    \n    ')
+            PsiComment(DOCUMENTATION)('## A keyword that identifies the type of non-standard coverage')
+            PsiWhiteSpace('\n    ')
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('othertemporal')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              DATATYPE_PATTERN
+                NAME
+                  PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliocoverage.temporal.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.bibliocoverage.temporal-enum.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.bibliocoverage.temporal-other.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliocoverage.coverage.attrib')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.bibliocoverage.spatial.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.bibliocoverage.temporal.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliocoverage.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliocoverage.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliocoverage.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.bibliocoverage.coverage.attrib')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliocoverage')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The spatial or temporal coverage of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('bibliocoverage')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliocoverage.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.legalnotice.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.legalnotice.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.legalnotice.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.legalnotice.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.legalnotice')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A statement of legal obligations or requirements')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('legalnotice')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.legalnotice.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.legalnotice.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.othercredit.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A copy editor')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"copyeditor"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A graphic designer')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"graphicdesigner"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Some other contributor')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"other"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A production editor')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"productioneditor"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A technical editor')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"technicaleditor"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A translator')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"translator"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.othercredit.class-enum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the nature of the contributor')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('class')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.othercredit.class.enumeration')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.othercredit.class-other.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the nature of the non-standard contribution')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('otherclass')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.othercredit.class-other.attributes')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the nature of the contributor')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('class')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace('\n      \n      ')
+              PsiComment(DOCUMENTATION)('## Identifies a non-standard contribution')
+              PsiWhiteSpace('\n      ')
+              DATATYPE_PATTERN
+                PsiElement(LITERAL)('"other"')
+              PsiWhiteSpace('\n    ')
+              PsiElement(})('}')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.othercredit.class-other.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.othercredit.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.othercredit.class-enum.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.othercredit.class-other.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.othercredit.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.othercredit.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.othercredit.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.othercredit.class.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.othercredit')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A person or entity, other than an author or editor, credited in a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('othercredit')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.othercredit.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.credit.contentmodel')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.pagenums.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.pagenums.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.pagenums.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.pagenums')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The numbers of the pages in a book, for use in a bibliographic entry')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('pagenums')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.pagenums.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.contrib.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.contrib.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.contrib.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.contrib')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A summary of the contributions made to a document by a credited source')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('contrib')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.contrib.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.honorific.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.honorific.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.honorific.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.honorific')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The title of a person')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('honorific')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.honorific.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.firstname.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.firstname.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.firstname.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.firstname')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The first name of a person')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('firstname')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.firstname.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.surname.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.surname.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.surname.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.surname')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A family name; in western cultures the last name')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('surname')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.surname.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.lineage.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.lineage.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.lineage.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.lineage')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The portion of a person's name indicating a relationship to ancestors')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('lineage')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.lineage.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.othername.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.othername.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.othername.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.othername')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A component of a persons name that is not a first name, surname, or lineage')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('othername')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.othername.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.printhistory.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.printhistory.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.printhistory.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.printhistory')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The printing history of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('printhistory')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.printhistory.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.para.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productname.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productname.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A name with a copyright')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"copyright"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A name with a registered copyright')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"registered"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A name of a service')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"service"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A name which is trademarked')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"trade"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productname.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the class of product name')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.productname.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productname.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.productname.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.productname.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productname')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The formal name of a product')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('productname')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.productname.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productnumber.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productnumber.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.productnumber.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productnumber')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A number assigned to a product')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('productnumber')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.productnumber.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.pubdate.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.pubdate.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.pubdate.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.pubdate')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The date of publication of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('pubdate')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.pubdate.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.date.contentmodel')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.publisher.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.publisher.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.publisher.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.publisher')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The publisher of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('publisher')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.publisher.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.publishername')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.address')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.publishername.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.publishername.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.publishername.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.publishername')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of the publisher of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('publishername')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.publishername.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.releaseinfo.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.releaseinfo.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.releaseinfo.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.releaseinfo')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Information about a particular release of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('releaseinfo')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.releaseinfo.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revhistory.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revhistory.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revhistory.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revhistory.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revhistory')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A history of the revisions to a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('revhistory')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revhistory.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revhistory.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.revision')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revision.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revision.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revision.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revision')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An entry describing a single revision in the history of the revisions to a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('revision')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revision.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.revnumber')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.date')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.authorinitials')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.author')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.revremark')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.revdescription')
+                  PsiElement())(')')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revnumber.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revnumber.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revnumber.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revnumber')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A document revision number')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('revnumber')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revnumber.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revremark.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revremark.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revremark.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revremark')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A description of a revision to a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('revremark')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revremark.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revdescription.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revdescription.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revdescription.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.revdescription')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A extended description of a revision to a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('revdescription')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.revdescription.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seriesvolnums.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seriesvolnums.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.seriesvolnums.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seriesvolnums')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Numbers of the volumes in a series of books')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('seriesvolnums')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.seriesvolnums.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.volumenum.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.volumenum.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.volumenum.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.volumenum')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The volume number of a document in a set (as of books in a set or articles in a journal)')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('volumenum')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.volumenum.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.issuenum.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.issuenum.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.issuenum.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.issuenum')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The number of an issue of a journal')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('issuenum')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.issuenum.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.accel.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.accel.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.accel.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.accel')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A graphical user interface (GUI) keyboard shortcut')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('accel')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.accel.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.application.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A hardware application')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"hardware"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A software application')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"software"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.application.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the class of application')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.application.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.application.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.application.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.application.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.application.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.application')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of a software program')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('application')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.application.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.package.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.package.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.package.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.package')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A software or application package')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('package')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.package.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.classname.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.classname.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.classname.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.classname')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of a class, in the object-oriented programming sense')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('classname')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.classname.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.command.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.command.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.command.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.command')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of an executable program or other software command')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('command')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.command.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.computeroutput.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.ubiq.inlines')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.os.inlines')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.technical.inlines')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.markup.inlines')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.co')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.computeroutput.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.computeroutput.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.computeroutput.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.computeroutput')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Data, generally text, displayed or presented by a computer')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('computeroutput')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.computeroutput.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.computeroutput.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.database.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An alternate or secondary key')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"altkey"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A constraint')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"constraint"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A data type')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"datatype"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A field')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"field"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A foreign key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"foreignkey"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A group')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"group"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An index')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"index"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The first or primary key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"key1"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An alternate or secondary key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"key2"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A name')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"name"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The primary key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"primarykey"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A (stored) procedure')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"procedure"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A record')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"record"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A rule')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"rule"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The secondary key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"secondarykey"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A table')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"table"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A user')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"user"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A view')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"view"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.database.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the class of database artifact')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.database.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.database.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.database.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.database.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.database.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.database')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of a database, or part of a database')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('database')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.database.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.email.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.email.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.email.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.email')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An email address')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('email')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.email.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.envar.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.envar.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.envar.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.envar')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A software environment variable')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('envar')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.envar.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.errorcode.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.errorcode.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.errorcode.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.errorcode')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An error code')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('errorcode')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.errorcode.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.errorname.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.errorname.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.errorname.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.errorname')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An error name')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('errorname')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.errorname.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.errortext.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.errortext.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.errortext.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.errortext')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An error message.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('errortext')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.errortext.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.errortype.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.errortype.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.errortype.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.errortype')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The classification of an error message')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('errortype')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.errortype.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.filename.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A device')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"devicefile"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A directory')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"directory"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A filename extension')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"extension"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A header file (as for a programming language)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"headerfile"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A library file')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"libraryfile"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A partition (as of a hard disk)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"partition"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A symbolic link')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"symlink"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.filename.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the class of filename')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.filename.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.filename.path.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the path of the filename')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('path')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.filename.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.filename.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.filename.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.filename.path.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.filename.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.filename')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of a file')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('filename')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.filename.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.function.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.function.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.function.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.function')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of a function or subroutine, as in a programming language')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('function')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.function.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guibutton.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guibutton.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.guibutton.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guibutton')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The text on a button in a GUI')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('guibutton')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.guibutton.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.accel')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.superscript')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.subscript')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guiicon.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guiicon.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.guiicon.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guiicon')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Graphic and/or text appearing as a icon in a GUI')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('guiicon')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.guiicon.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.accel')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.superscript')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.subscript')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guilabel.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guilabel.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.guilabel.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guilabel')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The text of a label in a GUI')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('guilabel')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.guilabel.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.accel')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.superscript')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.subscript')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guimenu.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guimenu.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.guimenu.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guimenu')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of a menu in a GUI')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('guimenu')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.guimenu.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.accel')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.superscript')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.subscript')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guimenuitem.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guimenuitem.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.guimenuitem.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guimenuitem')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of a terminal menu item in a GUI')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('guimenuitem')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.guimenuitem.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.accel')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.superscript')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.subscript')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guisubmenu.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guisubmenu.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.guisubmenu.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.guisubmenu')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of a submenu in a GUI')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('guisubmenu')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.guisubmenu.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.accel')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.superscript')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.subscript')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.hardware.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.hardware.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.hardware.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.hardware')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A physical part of a computer system')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('hardware')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.hardware.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycap.function.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The "Alt" key')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"alt"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The "Backspace" key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"backspace"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The "Command" key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"command"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The "Control" key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"control"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The "Delete" key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"delete"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The down arrow')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"down"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The "End" key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"end"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The "Enter" or "Return" key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"enter"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The "Escape" key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"escape"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The "Home" key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"home"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The "Insert" key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"insert"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The left arrow')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"left"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The "Meta" key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"meta"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The "Option" key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"option"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The page down key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"pagedown"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The page up key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"pageup"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The right arrow')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"right"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The "Shift" key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"shift"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The spacebar')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"space"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The "Tab" key')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"tab"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The up arrow')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"up"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycap.function-enum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the function key')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('function')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keycap.function.enumeration')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycap.function-other.attributes')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the function key')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            OPTIONAL
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('function')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace('\n      \n      ')
+                PsiComment(DOCUMENTATION)('## Indicates a non-standard function key')
+                PsiWhiteSpace('\n      ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"other"')
+                PsiWhiteSpace('\n    ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiElement(,)(',')
+            PsiWhiteSpace('\n    \n    ')
+            PsiComment(DOCUMENTATION)('## Specifies a keyword that identifies the non-standard key')
+            PsiWhiteSpace('\n    ')
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('otherfunction')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycap.function.attrib')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.keycap.function-enum.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.keycap.function-other.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycap.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycap.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keycap.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.keycap.function.attrib')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycap')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The text printed on a key on a keyboard')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('keycap')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keycap.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycode.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycode.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keycode.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycode')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The internal, frequently numeric, identifier for a key on a keyboard')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('keycode')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keycode.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycombo.action.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A (single) mouse click.')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"click"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A double mouse click.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"double-click"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A mouse or key press.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"press"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Sequential clicks or presses.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"seq"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Simultaneous clicks or presses.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"simul"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycombo.action-enum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the nature of the action taken. If keycombo')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ##  contains more than one element, simul')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ##  is the default, otherwise there is no default.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('action')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keycombo.action.enumeration')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycombo.action-other.attributes')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the nature of the action taken')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            OPTIONAL
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('action')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace('\n      \n      ')
+                PsiComment(DOCUMENTATION)('## Indicates a non-standard action')
+                PsiWhiteSpace('\n      ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"other"')
+                PsiWhiteSpace('\n    ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiElement(,)(',')
+            PsiWhiteSpace('\n    \n    ')
+            PsiComment(DOCUMENTATION)('## Identifies the non-standard action in some unspecified way.')
+            PsiWhiteSpace('\n    ')
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('otheraction')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycombo.action.attrib')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.keycombo.action-enum.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.keycombo.action-other.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycombo.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycombo.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keycombo.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.keycombo.action.attrib')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keycombo')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A combination of input actions')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('keycombo')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keycombo.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.keycap')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.keycombo')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.keysym')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.mousebutton')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keysym.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keysym.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keysym.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.keysym')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The symbolic name of a key on a keyboard')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('keysym')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.keysym.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.lineannotation.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.lineannotation.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.lineannotation.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.lineannotation')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A comment on a line in a verbatim listing')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('lineannotation')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.lineannotation.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.literal.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.literal.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.literal.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.literal')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Inline text that is some literal value')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('literal')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.literal.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('code.language.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the (computer) language of the code fragment')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('language')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.code.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.code.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.code.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('code.language.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.code')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An inline code fragment')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('code')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.code.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.programming.inlines')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constant.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the class of constant')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      \n      ')
+            PsiComment(DOCUMENTATION)('## The value is a limit of some kind')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"limit"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constant.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constant.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.constant.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.constant.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constant')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A programming or system constant')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('constant')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.constant.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.varname.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.varname.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.varname.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.varname')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of a variable')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('varname')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.varname.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.markup.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.markup.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.markup.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.markup')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A string of formatting markup in text that is to be represented literally')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('markup')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.markup.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.menuchoice.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.menuchoice.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.menuchoice.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.menuchoice')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A selection or series of selections from a menu')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('menuchoice')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.menuchoice.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.shortcut')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.guibutton')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.guiicon')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.guilabel')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.guimenu')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.guimenuitem')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.guisubmenu')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.shortcut.action.attrib')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.keycombo.action.attrib')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.shortcut.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.shortcut.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.shortcut.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.shortcut.action.attrib')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.shortcut')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A key combination for an action that is also accessible through a menu')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('shortcut')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.shortcut.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.keycap')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.keycombo')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.keysym')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.mousebutton')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.mousebutton.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.mousebutton.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.mousebutton.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.mousebutton')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The conventional name of a mouse button')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('mousebutton')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.mousebutton.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.option.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.option.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.option.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.option')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An option for a software command')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('option')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.option.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.optional.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.optional.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.optional.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.optional')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Optional information')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('optional')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.optional.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.property.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.property.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.property.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.property')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A unit of data associated with some part of a computer system')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('property')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.property.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.parameter.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A command')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"command"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A function')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"function"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An option')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"option"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.parameter.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the class of parameter')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.parameter.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.parameter.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.parameter.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.parameter.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.parameter.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.parameter')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A value or a symbolic reference to a value')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('parameter')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.parameter.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.prompt.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._text')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.co')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.prompt.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.prompt.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.prompt.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.prompt')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A character or string indicating the start of an input field in a  computer display')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('prompt')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.prompt.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.prompt.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.replaceable.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._text')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.co')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.replaceable.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A command')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"command"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A function')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"function"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An option')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"option"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A parameter')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"parameter"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.replaceable.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the nature of the replaceable text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.replaceable.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.replaceable.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.replaceable.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.replaceable.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.replaceable.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.replaceable')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Content that may or must be replaced by the user')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('replaceable')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.replaceable.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.replaceable.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.returnvalue.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.returnvalue.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.returnvalue.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.returnvalue')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The value returned by a function')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('returnvalue')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.returnvalue.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tag.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tag.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An attribute')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"attribute"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An attribute value')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"attvalue"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An element')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"element"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An empty element tag')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"emptytag"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An end tag')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"endtag"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A general entity')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"genentity"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The local name part of a qualified name')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"localname"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A namespace')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"namespace"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A numeric character reference')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"numcharref"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A parameter entity')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"paramentity"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A processing instruction')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"pi"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The prefix part of a qualified name')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"prefix"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An SGML comment')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"comment"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A start tag')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"starttag"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An XML processing instruction')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"xmlpi"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tag.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the nature of the tag content')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.tag.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tag.namespace.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the namespace of the tag content')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(KEYWORD_NAMESPACE)('namespace')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:anyURI')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tag.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tag.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tag.class.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tag.namespace.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tag')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A component of XML (or SGML) markup')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tag')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tag.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.symbol.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the class of symbol')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      \n      ')
+            PsiComment(DOCUMENTATION)('## The value is a limit of some kind')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"limit"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.symbol.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.symbol.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.symbol.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.symbol.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.symbol')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A name that is replaced by a value before processing')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('symbol')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.symbol.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.systemitem.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._text')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.co')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.systemitem.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A daemon or other system process (syslogd)')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"daemon"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A domain name (example.com)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"domainname"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An ethernet address (00:05:4E:49:FD:8E)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"etheraddress"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An event of some sort (SIGHUP)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"event"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An event handler of some sort (hangup)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"eventhandler"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A filesystem (ext3)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"filesystem"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A fully qualified domain name (my.example.com)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"fqdomainname"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A group name (wheel)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"groupname"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An IP address (127.0.0.1)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"ipaddress"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A library (libncurses)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"library"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A macro')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"macro"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A netmask (255.255.255.192)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"netmask"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A newsgroup (comp.text.xml)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"newsgroup"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An operating system name (Hurd)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"osname"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A process (gnome-cups-icon)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"process"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A protocol (ftp)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"protocol"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A resource')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"resource"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A server (mail.example.com)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"server"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A service (ppp)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"service"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A system name (hephaistos)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"systemname"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A user name (ndw)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"username"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.systemitem.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the nature of the system item')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.systemitem.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.systemitem.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.systemitem.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.systemitem.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.systemitem.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.systemitem')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A system-related item or term')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('systemitem')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.systemitem.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.systemitem.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.uri.type.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the type of URI specified')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('type')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.uri.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.uri.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.uri.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.uri.type.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.uri')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A Uniform Resource Identifier')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('uri')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.uri.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.token.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.token.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.token.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.token')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A unit of information')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(KEYWORD_TOKEN)('token')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.token.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.type.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.type.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.type.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.type')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The classification of a value')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('type')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.type.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.userinput.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.ubiq.inlines')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.os.inlines')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.technical.inlines')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.markup.inlines')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.co')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.userinput.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.userinput.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.userinput.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.userinput')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Data entered by the user')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('userinput')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.userinput.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.userinput.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.abbrev.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.abbrev.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.abbrev.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.abbrev')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An abbreviation, especially one followed by a period')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('abbrev')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.abbrev.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.superscript')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.subscript')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.trademark')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.acronym.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.acronym.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.acronym.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.acronym')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An often pronounceable word made from the initial (or selected) letters of a name or phrase')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('acronym')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.acronym.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.superscript')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.subscript')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.trademark')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citation.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citation.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.citation.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citation')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An inline bibliographic reference to another published work')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('citation')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.citation.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citerefentry.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citerefentry.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.citerefentry.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citerefentry')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A citation to a reference page')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('citerefentry')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.citerefentry.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refentrytitle')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.manvolnum')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refentrytitle.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refentrytitle.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refentrytitle.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refentrytitle')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The title of a reference page')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refentrytitle')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refentrytitle.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.manvolnum.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.manvolnum.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.manvolnum.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.manvolnum')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A reference volume number')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('manvolnum')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.manvolnum.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citetitle.pubwork.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An article')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"article"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A bulletin board system')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"bbs"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A book')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"book"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A CD-ROM')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"cdrom"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A chapter (as of a book)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"chapter"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A DVD')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"dvd"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An email message')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"emailmessage"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A gopher page')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"gopher"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A journal')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"journal"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A manuscript')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"manuscript"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A posting to a newsgroup')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"newsposting"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A part (as of a book)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"part"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A reference entry')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"refentry"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A section (as of a book or article)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"section"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A series')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"series"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A set (as of books)')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"set"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A web page')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"webpage"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A wiki page')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"wiki"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citetitle.pubwork.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the nature of the publication being cited')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('pubwork')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.citetitle.pubwork.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citetitle.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citetitle.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.citetitle.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.citetitle.pubwork.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.citetitle')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The title of a cited work')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('citetitle')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.citetitle.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.emphasis.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.emphasis.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.emphasis.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.emphasis')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Emphasized text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('emphasis')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.emphasis.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db._emphasis')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A limited span of emphasized text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('emphasis')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.emphasis.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._emphasis')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.foreignphrase.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.foreignphrase.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.foreignphrase.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.foreignphrase')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A word or phrase in a language other than the primary language of the document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('foreignphrase')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.foreignphrase.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    TEXT_PATTERN
+                      PsiElement(KEYWORD_TEXT)('text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.general.inlines')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.phrase.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.phrase.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.phrase.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.phrase')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A span of text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('phrase')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.phrase.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db._phrase')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A limited span of text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('phrase')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.phrase.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.quote.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.quote.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.quote.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.quote')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An inline quotation')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('quote')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.quote.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subscript.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subscript.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subscript.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.subscript')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A subscript (as in H2')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ## O, the molecular formula for water)')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('subscript')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.subscript.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.superscript.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.superscript.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.superscript.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.superscript')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A superscript (as in x^2, the mathematical notation for x multiplied by itself)')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('superscript')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.superscript.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.trademark.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A copyright')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"copyright"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A registered copyright')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"registered"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A service')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"service"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A trademark')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"trade"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.trademark.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the class of trade mark')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.trademark.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.trademark.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.trademark.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.trademark.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.trademark.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.trademark')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A trademark')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('trademark')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.trademark.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.wordasword.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.wordasword.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.wordasword.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.wordasword')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A word meant specifically as a word and not representing anything else')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('wordasword')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.wordasword.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.footnoteref.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.footnoteref.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.label.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.footnoteref.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.footnoteref.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.linkend.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.footnoteref.label.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.footnoteref')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A cross reference to a footnote (a footnote mark)')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Footnote reference type constraint"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:footnoteref"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace('\n              ')
+                    PsiElement(LITERAL)('"local-name(//*[@xml:id=current()/@linkend]) = 'footnote' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"@linkend on footnoteref must point to a footnote."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('footnoteref')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.footnoteref.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.xref.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.xref.xrefstyle.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.xrefstyle.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.xref.endterm.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.endterm.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.xref.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xref.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.req.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xref.xrefstyle.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xref.endterm.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.xref')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A cross reference to another part of the document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('xref')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xref.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.link.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.link.xrefstyle.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.xrefstyle.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.link.endterm.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.endterm.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.link.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.link.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.req.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.link.xrefstyle.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.link.endterm.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.link')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A hypertext link')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('link')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.link.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.olink.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.olink.xrefstyle.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.xrefstyle.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.olink.localinfo.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Holds additional information that may be used by the applicatoin when resolving the link')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('localinfo')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.olink.targetdoc.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the URI of the document in which the link target appears')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('targetdoc')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:anyURI')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.olink.targetptr.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the location of the link target in the document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('targetptr')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.olink.type.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies application-specific customization of the link behavior')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('type')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.olink.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.olink.targetdoc.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.olink.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.olink.xrefstyle.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.olink.localinfo.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.olink.targetptr.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.olink.type.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.olink')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A link that addresses its target indirectly')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('olink')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.olink.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.anchor.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.anchor.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.anchor.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.idreq.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.anchor')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A spot in the document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('anchor')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.anchor.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.alt.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.alt.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.alt.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.alt')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A text-only annotation, often used for accessibility')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('alt')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.alt.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    TEXT_PATTERN
+                      PsiElement(KEYWORD_TEXT)('text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.inlinemediaobject')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.annotations.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies one or more annotations that apply to this element')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('annotations')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.annotation.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.annotation.annotates.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies one ore more elements to which this annotation applies')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('annotates')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.annotation.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.annotation.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.annotation.annotates.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.annotation.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.annotation')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An annotation')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:annotation"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:annotation)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"annotation must not occur in the descendants of annotation"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('annotation')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.annotation.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.annotation.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xlink.from.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the XLink traversal-from')
+        PsiWhiteSpace('\n  ')
+        OPTIONAL
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              NAME
+                PsiElement(PREFIXED_NAME)('xlink:from')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xlink.label.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the XLink label')
+        PsiWhiteSpace('\n  ')
+        OPTIONAL
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              NAME
+                PsiElement(PREFIXED_NAME)('xlink:label')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.xlink.to.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the XLink traversal-to')
+        PsiWhiteSpace('\n  ')
+        OPTIONAL
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              NAME
+                PsiElement(PREFIXED_NAME)('xlink:to')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.extendedlink.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.extendedlink.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.extendedlink.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Identifies the XLink link type ')
+            PsiWhiteSpace('\n      ')
+            OPTIONAL
+              PATTERN
+                ANNOTATION
+                  PsiElement([)('[')
+                  PsiWhiteSpace(' ')
+                  PsiElement(PREFIXED_NAME)('a:defaultValue')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"extended"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n      ')
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xlink:type')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace('\n        \n        ')
+                PsiComment(DOCUMENTATION)('## An XLink extended link')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"extended"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xlink.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xlink.title.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.extendedlink')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An XLink extended link')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('extendedlink')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.extendedlink.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.locator')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.arc')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.locator.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.locator.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.locator.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Identifies the XLink link type ')
+            PsiWhiteSpace('\n      ')
+            OPTIONAL
+              PATTERN
+                ANNOTATION
+                  PsiElement([)('[')
+                  PsiWhiteSpace(' ')
+                  PsiElement(PREFIXED_NAME)('a:defaultValue')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"locator"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n      ')
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xlink:type')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace('\n        \n        ')
+                PsiComment(DOCUMENTATION)('## An XLink locator link')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"locator"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.xlink.href.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xlink.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xlink.title.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xlink.label.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.locator')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An XLink locator in an extendedlink')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('locator')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.locator.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.arc.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.arc.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.arc.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Identifies the XLink link type ')
+            PsiWhiteSpace('\n      ')
+            OPTIONAL
+              PATTERN
+                ANNOTATION
+                  PsiElement([)('[')
+                  PsiWhiteSpace(' ')
+                  PsiElement(PREFIXED_NAME)('a:defaultValue')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"arc"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n      ')
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xlink:type')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace('\n        \n        ')
+                PsiComment(DOCUMENTATION)('## An XLink arc link')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"arc"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xlink.arcrole.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xlink.title.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xlink.show.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xlink.actuate.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xlink.from.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.xlink.to.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.arc')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An XLink arc in an extendedlink')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('arc')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.arc.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the editorial or publication status of the element on which it occurs')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('status')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.toplevel.sections')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              GROUP_PATTERN
+                PsiElement(()('(')
+                SEQUENCE
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.section')
+                    PsiElement(+)('+')
+                  PsiElement(,)(',')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.simplesect')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.simplesect')
+                PsiElement(+)('+')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            SEQUENCE
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.sect1')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.simplesect')
+                PsiElement(*)('*')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.refentry')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.toplevel.blocks.or.sections')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            SEQUENCE
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.toplevel.sections')
+                PsiElement(?)('?')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.toplevel.sections')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.recursive.sections')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              GROUP_PATTERN
+                PsiElement(()('(')
+                SEQUENCE
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.section')
+                    PsiElement(+)('+')
+                  PsiElement(,)(',')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.simplesect')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.simplesect')
+                PsiElement(+)('+')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.refentry')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.recursive.blocks.or.sections')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            SEQUENCE
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.recursive.sections')
+                PsiElement(?)('?')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.recursive.sections')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.divisions')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.part')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.reference')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.components')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.dedication')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.acknowledgements')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.preface')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.chapter')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.appendix')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.article')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.colophon')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.navigation.components')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          NOT_ALLOWED_PATTERN
+            PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.glossary')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.bibliography')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.index')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.toc')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.component.contentmodel')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.navigation.components')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.toplevel.blocks.or.sections')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.navigation.components')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.setindex.components')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          NOT_ALLOWED_PATTERN
+            PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.setindex')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.toc.components')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          NOT_ALLOWED_PATTERN
+            PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.toc')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.set.components')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.set')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.book')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.set.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.set.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.set.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.set.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.set.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.set.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.set')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A collection of books')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:set"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('set')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.set.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.set.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.toc.components')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.set.components')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.setindex.components')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.book.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.book.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.book.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.book.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.book.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.book.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.book')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A book')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:book"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('book')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.book.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.book.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.navigation.components')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.components')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.divisions')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.dedication.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.dedication.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.dedication.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.dedication.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.dedication.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.dedication.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.dedication')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The dedication of a book or other component')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:dedication"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('dedication')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.dedication.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.dedication.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.acknowledgements.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.acknowledgements.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.acknowledgements.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.acknowledgements.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.acknowledgements.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.acknowledgements.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.acknowledgements')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Acknowledgements of a book or other component')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:acknowledgements"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('acknowledgements')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.acknowledgements.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.acknowledgements.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.colophon.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.colophon.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.colophon.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colophon.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colophon.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.colophon.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.colophon')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Text at the back of a book describing facts about its production')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:colophon"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('colophon')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colophon.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colophon.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.appendix.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.appendix.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.appendix.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.appendix.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.appendix.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.appendix.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.appendix')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An appendix in a Book or Article')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:appendix"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('appendix')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.appendix.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.appendix.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.component.contentmodel')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.chapter.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.chapter.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.chapter.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.chapter.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.chapter.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.chapter.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.chapter')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A chapter, as of a book')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:chapter"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('chapter')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.chapter.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.chapter.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.component.contentmodel')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.part.components')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.navigation.components')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.components')
+            PsiElement())(')')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refentry')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.reference')
+            PsiElement())(')')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.part.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.part.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.part.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.part.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.part.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.part.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.part')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A division in a book')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:part"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('part')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.part.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.part.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.partintro')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.part.components')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.preface.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.preface.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.preface.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.preface.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.preface.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.preface.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.preface')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Introductory matter preceding the first chapter of a book')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:preface"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('preface')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.preface.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.preface.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.component.contentmodel')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.partintro.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.partintro.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.partintro.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.partintro.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.partintro.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.partintro.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.partintro')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An introduction to the contents of a part')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('partintro')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.partintro.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.partintro.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.toplevel.blocks.or.sections')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.section.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.section.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.section.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.section.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.section.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.section.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.section')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A recursive section')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:section"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('section')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.section.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.section.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.recursive.blocks.or.sections')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.navigation.components')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplesect.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplesect.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplesect.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplesect.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplesect.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplesect.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplesect')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A section of a document with no subdivisions')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('simplesect')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplesect.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplesect.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.article.components')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('db.toplevel.sections')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.article.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.article.class.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A collection of frequently asked questions.')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"faq"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## An article in a journal or other periodical.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"journalarticle"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A description of a product.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"productsheet"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A specification.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"specification"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A technical report.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"techreport"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## A white paper.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"whitepaper"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.article.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the nature of the article')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.article.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.article.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.article.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.article.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.article.status.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.article.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.article.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.article')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An article')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:article"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('article')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.article.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.article.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.navigation.components')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.appendix')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.acknowledgements')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.colophon')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      ONE_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.all.blocks')
+                        PsiElement(+)('+')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      OPTIONAL
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.article.components')
+                        PsiElement(?)('?')
+                    PsiElement())(')')
+                  PsiWhiteSpace('\n       ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.article.components')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.navigation.components')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.appendix')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.acknowledgements')
+                    PsiWhiteSpace('\n       ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.colophon')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.sect1.sections')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            SEQUENCE
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.sect2')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.simplesect')
+                PsiElement(*)('*')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.simplesect')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect1.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect1.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect1.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect1.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect1.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect1.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect1')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A top-level section of document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:sect1"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('sect1')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect1.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect1.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      ONE_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.all.blocks')
+                        PsiElement(+)('+')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      OPTIONAL
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.sect1.sections')
+                        PsiElement(?)('?')
+                    PsiElement())(')')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.sect1.sections')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.navigation.components')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.sect2.sections')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            SEQUENCE
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.sect3')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.simplesect')
+                PsiElement(*)('*')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.simplesect')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect2.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect2.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect2.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect2.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect2.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect2.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect2')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A subsection within a Sect1')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:sect2"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('sect2')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect2.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect2.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      ONE_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.all.blocks')
+                        PsiElement(+)('+')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      OPTIONAL
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.sect2.sections')
+                        PsiElement(?)('?')
+                    PsiElement())(')')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.sect2.sections')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.navigation.components')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.sect3.sections')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            SEQUENCE
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.sect4')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.simplesect')
+                PsiElement(*)('*')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.simplesect')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect3.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect3.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect3.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect3.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect3.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect3.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect3')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A subsection within a Sect2')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:sect3"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('sect3')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect3.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect3.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      ONE_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.all.blocks')
+                        PsiElement(+)('+')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      OPTIONAL
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.sect3.sections')
+                        PsiElement(?)('?')
+                    PsiElement())(')')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.sect3.sections')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.navigation.components')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.sect4.sections')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            SEQUENCE
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.sect5')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.simplesect')
+                PsiElement(*)('*')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.simplesect')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect4.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect4.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect4.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect4.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect4.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect4.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect4')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A subsection within a Sect3')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:sect4"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('sect4')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect4.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect4.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      ONE_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.all.blocks')
+                        PsiElement(+)('+')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      OPTIONAL
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.sect4.sections')
+                        PsiElement(?)('?')
+                    PsiElement())(')')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.sect4.sections')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.navigation.components')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.sect5.sections')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.simplesect')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect5.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect5.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect5.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect5.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect5.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect5.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.sect5')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A subsection within a Sect4')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:sect5"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('sect5')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect5.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sect5.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      ONE_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.all.blocks')
+                        PsiElement(+)('+')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      OPTIONAL
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.sect5.sections')
+                        PsiElement(?)('?')
+                    PsiElement())(')')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.sect5.sections')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.navigation.components')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.toplevel.refsection')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.refsection')
+            PsiElement(+)('+')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.refsect1')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.secondlevel.refsection')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.refsection')
+            PsiElement(+)('+')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.refsect2')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.reference.components')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('db.refentry')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.reference.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.reference.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.reference.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.status.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.reference.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.reference')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A collection of reference entries')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:reference"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('reference')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.reference.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.reference.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.partintro')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.reference.components')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refentry.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refentry.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refentry.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.status.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refentry.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refentry')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A reference page (originally a UNIX man-style reference page)')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:refentry"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refentry')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refentry.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.indexterm')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refentry.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.refmeta')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.refnamediv')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.refsynopsisdiv')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.toplevel.refsection')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refmeta.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refmeta.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refmeta.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refmeta')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Meta-information for a reference entry')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refmeta')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refmeta.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.indexterm')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refentrytitle')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.manvolnum')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.refmiscinfo')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.indexterm')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.refmiscinfo.class.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## The name of the software product or component to which this topic applies')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"source"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The version of the software product or component to which this topic applies')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"version"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The section title of the reference page (e.g., User Commands)')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"manual"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The section title of the reference page (believed synonymous with "manual" but in wide use)')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"sectdesc"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The name of the software product or component to which this topic applies (e.g., SunOS x.y; believed synonymous with "source" but in wide use)')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"software"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.refmiscinfo.class-enum.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the kind of miscellaneous information')
+        PsiWhiteSpace('\n  ')
+        OPTIONAL
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.refmiscinfo.class.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.refmiscinfo.class-other.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the nature of non-standard miscellaneous information')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('otherclass')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.refmiscinfo.class-other.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the kind of miscellaneious information')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n    \n    ')
+            PsiComment(DOCUMENTATION)('## Indicates that the information is some 'other' kind.')
+            PsiWhiteSpace('\n    ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"other"')
+            PsiWhiteSpace('\n  ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.refmiscinfo.class-other.attribute')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.refmiscinfo.class.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.refmiscinfo.class-enum.attribute')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.refmiscinfo.class-other.attributes')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refmiscinfo.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refmiscinfo.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refmiscinfo.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refmiscinfo.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refmiscinfo')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Meta-information for a reference entry other than the title and volume number')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refmiscinfo')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refmiscinfo.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refnamediv.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refnamediv.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refnamediv.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refnamediv')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name, purpose, and classification of a reference page')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refnamediv')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refnamediv.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.refdescriptor')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.refname')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refpurpose')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.refclass')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refdescriptor.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refdescriptor.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refdescriptor.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refdescriptor')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A description of the topic of a reference page')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refdescriptor')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refdescriptor.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refname.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refname.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refname.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refname')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The name of (one of) the subject(s) of a reference page')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refname')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refname.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refpurpose.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refpurpose.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refpurpose.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refpurpose')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A short (one sentence) synopsis of the topic of a reference page')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refpurpose')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refpurpose.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refclass.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refclass.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refclass.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refclass')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The scope or other indication of applicability of a reference entry')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refclass')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refclass.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    TEXT_PATTERN
+                      PsiElement(KEYWORD_TEXT)('text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.application')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsynopsisdiv.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsynopsisdiv.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsynopsisdiv.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsynopsisdiv.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsynopsisdiv')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A syntactic synopsis of the subject of the reference page')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refsynopsisdiv')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsynopsisdiv.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsynopsisdiv.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      ONE_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.all.blocks')
+                        PsiElement(+)('+')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      OPTIONAL
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.secondlevel.refsection')
+                        PsiElement(?)('?')
+                    PsiElement())(')')
+                  PsiWhiteSpace('\n       ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.secondlevel.refsection')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsection.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsection.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsection.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.status.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsection.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsection')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A recursive section in a refentry')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:refsection"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refsection')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsection.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsection.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      ONE_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.all.blocks')
+                        PsiElement(+)('+')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      ZERO_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.refsection')
+                        PsiElement(*)('*')
+                    PsiElement())(')')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.refsection')
+                    PsiElement(+)('+')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.refsect1.sections')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.refsect2')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect1.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect1.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect1.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect1.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect1.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect1.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect1')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A major subsection of a reference entry')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:refsect1"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refsect1')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect1.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect1.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      ONE_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.all.blocks')
+                        PsiElement(+)('+')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      OPTIONAL
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.refsect1.sections')
+                        PsiElement(?)('?')
+                    PsiElement())(')')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.refsect1.sections')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.refsect2.sections')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.refsect3')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect2.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect2.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect2.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect2.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect2.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect2.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect2')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A subsection of a refsect1')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:refsect2"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refsect2')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect2.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect2.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  GROUP_PATTERN
+                    PsiElement(()('(')
+                    SEQUENCE
+                      ONE_OR_MORE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.all.blocks')
+                        PsiElement(+)('+')
+                      PsiElement(,)(',')
+                      PsiWhiteSpace(' ')
+                      OPTIONAL
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.refsect2.sections')
+                        PsiElement(?)('?')
+                    PsiElement())(')')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.refsect2.sections')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect3.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect3.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect3.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect3.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect3.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect3.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.refsect3')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A subsection of a refsect2')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:refsect3"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('refsect3')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect3.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.refsect3.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.glossary.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.firstterm')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.glossterm')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.baseform.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the base form of the term, the one that appears in the glossary. This allows adjectival, plural, and other variations of the term to appear in the element. The element content is the default base form.')
+        PsiWhiteSpace('\n  ')
+        OPTIONAL
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('baseform')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glosslist.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glosslist.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glosslist.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glosslist.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glosslist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for a list of glossary entries')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('glosslist')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glosslist.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.glosslist.info')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.glossentry')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossentry.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossentry.sortas.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the string by which the element's content is to be sorted; if unspecified, the content is used')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('sortas')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossentry.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossentry.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossentry.sortas.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossentry')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An entry in a Glossary or GlossList')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('glossentry')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossentry.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossterm')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.acronym')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.abbrev')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.indexterm')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.glosssee')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.glossdef')
+                    PsiElement(+)('+')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossdef.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossdef.subject.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies a list of keywords for the definition')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('subject')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossdef.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossdef.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossdef.subject.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossdef')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A definition in a GlossEntry')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('glossdef')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossdef.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.glossseealso')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glosssee.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glosssee.otherterm.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the other term')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('otherterm')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:IDREF')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glosssee.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glosssee.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glosssee.otherterm.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glosssee')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A cross-reference from one glossentry')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ##  to another')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Glosssary 'see' type constraint"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:glosssee[@otherterm]"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace('\n              ')
+                    PsiElement(LITERAL)('"local-name(//*[@xml:id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"@otherterm on glosssee must point to a glossentry."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('glosssee')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glosssee.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossseealso.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossseealso.otherterm.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the other term')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('otherterm')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:IDREF')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossseealso.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossseealso.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossseealso.otherterm.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossseealso')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A cross-reference from one GlossEntry to another')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Glossary 'seealso' type constraint"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:glossseealso[@otherterm]"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace('\n              ')
+                    PsiElement(LITERAL)('"local-name(//*[@xml:id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"@otherterm on glossseealso must point to a glossentry."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('glossseealso')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossseealso.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.firstterm.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.firstterm.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.firstterm.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.baseform.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.firstterm')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The first occurrence of a term')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Glossary 'firstterm' type constraint"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:firstterm[@linkend]"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace('\n              ')
+                    PsiElement(LITERAL)('"local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"@linkend on firstterm must point to a glossentry."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('firstterm')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.firstterm.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossterm.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossterm.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossterm.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.baseform.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossterm')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A glossary term')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Glossary 'glossterm' type constraint"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:glossterm[@linkend]"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace('\n              ')
+                    PsiElement(LITERAL)('"local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"@linkend on glossterm must point to a glossentry."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('glossterm')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossterm.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossary.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossary.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossary.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossary.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossary.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossary.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossary')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A glossary')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:glossary"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('glossary')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossary.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossary.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.glossdiv')
+                    PsiElement(*)('*')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.glossentry')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.bibliography')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossdiv.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossdiv.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossdiv.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossdiv.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossdiv.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossdiv.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.glossdiv')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A division in a Glossary')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('glossdiv')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossdiv.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossdiv.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.glossentry')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.termdef.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.termdef.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.termdef.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.glossentry.sortas.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.baseform.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.termdef')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An inline definition of a term')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Glossary term definition constraint"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:termdef"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"count(db:firstterm) = 1"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"A termdef must contain exactly one firstterm"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('termdef')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.termdef.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.relation.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the relationship between the bibliographic elemnts')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('relation')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioentry.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioentry.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioentry.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioentry')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An entry in a Bibliography')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('biblioentry')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioentry.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.bibliographic.elements')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliomixed.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliomixed.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliomixed.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliomixed')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An entry in a Bibliography')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('bibliomixed')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliomixed.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    TEXT_PATTERN
+                      PsiElement(KEYWORD_TEXT)('text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.bibliographic.elements')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioset.relation.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.relation.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioset.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioset.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioset.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioset.relation.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioset')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A raw container for related bibliographic information')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('biblioset')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioset.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.bibliographic.elements')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliomset.relation.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.relation.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliomset.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliomset.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliomset.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliomset.relation.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliomset')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A cooked container for related bibliographic information')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('bibliomset')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliomset.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.bibliographic.elements')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliomisc.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliomisc.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliomisc.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliomisc')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Untyped bibliographic information')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('bibliomisc')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliomisc.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliography.status.attrib')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliography.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliography.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliography.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliography.status.attrib')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliography.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliography')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A bibliography')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:bibliography"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('bibliography')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliography.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliography.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.bibliodiv')
+                    PsiElement(+)('+')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ONE_OR_MORE
+                    GROUP_PATTERN
+                      PsiElement(()('(')
+                      CHOICE
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.biblioentry')
+                        PsiWhiteSpace(' ')
+                        PsiElement(|)('|')
+                        PsiWhiteSpace(' ')
+                        REF_PATTERN
+                          PsiElement(IDENTIFIER)('db.bibliomixed')
+                      PsiElement())(')')
+                    PsiElement(+)('+')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliodiv.status.attrib')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliodiv.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliodiv.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliodiv.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliodiv.status.attrib')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliodiv.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliodiv')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A section of a Bibliography')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('bibliodiv')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliodiv.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliodiv.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.biblioentry')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.bibliomixed')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliolist.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliolist.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliolist.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliolist.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.bibliolist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for a list of bibliography entries')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('bibliolist')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.bibliolist.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.bibliolist.info')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.biblioentry')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.bibliomixed')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioref.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioref.xrefstyle.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.xrefstyle.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioref.endterm.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.endterm.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioref.units.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The units (for example, pages) used to identify the beginning and ending of a reference.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('units')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:token')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioref.begin.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the beginning of a reference; the location within the work that is being referenced.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('begin')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:token')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioref.end.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the end of a reference.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('end')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:token')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioref.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioref.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.req.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioref.xrefstyle.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioref.endterm.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioref.units.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioref.begin.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioref.end.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.biblioref')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A cross-reference to a bibliographic entry')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('biblioref')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.biblioref.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.significance.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Normal')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"normal"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Preferred')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"preferred"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.significance.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the significance of the term')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('significance')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.significance.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.zone.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the IDs of the elements to which this term applies')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('zone')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:IDREFS')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.indexterm.pagenum.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates the page on which this index term occurs in some version of the printed document')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('pagenum')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.scope.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## All indexes')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"all"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The global index (as for a combined index of a set of box)')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"global"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## The local index (the index for this document only)')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"local"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.scope.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the scope of the index term')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('scope')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.scope.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.sortas.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the string by which the term is to be sorted; if unspecified, the term content is used')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('sortas')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.index.type.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the target index for this term')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('type')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.itermset.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.itermset.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.itermset.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.itermset')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A set of index terms in the meta-information of a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('itermset')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.itermset.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.indexterm.singular')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.indexterm.contentmodel')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.primary')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            GROUP_PATTERN
+              PsiElement(()('(')
+              CHOICE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  SEQUENCE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.secondary')
+                    PsiElement(,)(',')
+                    PsiWhiteSpace('\n    ')
+                    OPTIONAL
+                      GROUP_PATTERN
+                        PsiElement(()('(')
+                        CHOICE
+                          GROUP_PATTERN
+                            PsiElement(()('(')
+                            SEQUENCE
+                              REF_PATTERN
+                                PsiElement(IDENTIFIER)('db.tertiary')
+                              PsiElement(,)(',')
+                              PsiWhiteSpace(' ')
+                              OPTIONAL
+                                GROUP_PATTERN
+                                  PsiElement(()('(')
+                                  CHOICE
+                                    REF_PATTERN
+                                      PsiElement(IDENTIFIER)('db.see')
+                                    PsiWhiteSpace(' ')
+                                    PsiElement(|)('|')
+                                    PsiWhiteSpace(' ')
+                                    ONE_OR_MORE
+                                      REF_PATTERN
+                                        PsiElement(IDENTIFIER)('db.seealso')
+                                      PsiElement(+)('+')
+                                  PsiElement())(')')
+                                PsiElement(?)('?')
+                            PsiElement())(')')
+                          PsiWhiteSpace('\n     ')
+                          PsiElement(|)('|')
+                          PsiWhiteSpace(' ')
+                          REF_PATTERN
+                            PsiElement(IDENTIFIER)('db.see')
+                          PsiWhiteSpace('\n     ')
+                          PsiElement(|)('|')
+                          PsiWhiteSpace(' ')
+                          ONE_OR_MORE
+                            REF_PATTERN
+                              PsiElement(IDENTIFIER)('db.seealso')
+                            PsiElement(+)('+')
+                        PsiElement())(')')
+                      PsiElement(?)('?')
+                  PsiElement())(')')
+                PsiWhiteSpace('\n   ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.see')
+                PsiWhiteSpace('\n   ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                ONE_OR_MORE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.seealso')
+                  PsiElement(+)('+')
+              PsiElement())(')')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm.singular.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm.singular.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the class of index term')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      \n      ')
+            PsiComment(DOCUMENTATION)('## A singular index term')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"singular"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm.singular.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexterm.singular.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.significance.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.zone.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexterm.pagenum.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.scope.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.index.type.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexterm.singular.class.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm.singular')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for an indexed term')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('indexterm')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexterm.singular.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexterm.contentmodel')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm.startofrange.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm.startofrange.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the class of index term')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      \n      ')
+            PsiComment(DOCUMENTATION)('## The start of a range')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"startofrange"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm.startofrange.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexterm.startofrange.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.significance.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.zone.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexterm.pagenum.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.scope.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.index.type.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.indexterm.startofrange.class.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm.startofrange')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for an indexed term that covers a range')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('indexterm')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexterm.startofrange.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexterm.contentmodel')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm.endofrange.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm.endofrange.class.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the class of index term')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('class')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      \n      ')
+            PsiComment(DOCUMENTATION)('## The end of a range')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"endofrange"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm.endofrange.startref.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Points to the start of the range')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('startref')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:IDREF')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm.endofrange.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexterm.endofrange.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.indexterm.endofrange.class.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.indexterm.endofrange.startref.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm.endofrange')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the end of a range associated with an indexed term')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('indexterm')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexterm.endofrange.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexterm')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.indexterm.singular')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.indexterm.startofrange')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.indexterm.endofrange')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.primary.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.primary.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.primary.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sortas.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.primary')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The primary word or phrase under which an index term should be sorted')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('primary')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.primary.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.secondary.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.secondary.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.secondary.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sortas.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.secondary')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A secondary word or phrase in an index term')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('secondary')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.secondary.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tertiary.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tertiary.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tertiary.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.sortas.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tertiary')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A tertiary word or phrase in an index term')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tertiary')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tertiary.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.see.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.see.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.see.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.see')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Part of an index term directing the reader instead to another entry in the index')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('see')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.see.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seealso.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seealso.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.seealso.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seealso')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Part of an index term directing the reader also to another entry in the index')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('seealso')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.seealso.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.index.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.index.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.index.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.index.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.index.status.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.index.type.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.index.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info')
+        PsiWhiteSpace('\n  ')
+        PsiComment(SINGLE_LINE_COMMENT)('# ')
+        PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n  # Yes, db.indexdiv* and db.indexentry*; that way an <index/> is valid.')
+        PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n  # Authors can use an empty index to indicate where a generated index should')
+        PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n  # appear.')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.index')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An index to a book or part of a book')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:index"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('index')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.index.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.index.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.indexdiv')
+                    PsiElement(*)('*')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.indexentry')
+                    PsiElement(*)('*')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.segmentedlist')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.setindex.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.setindex.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.setindex.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.setindex.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.setindex.status.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.index.type.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.setindex.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.setindex')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An index to a set of books')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:setindex"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('setindex')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.setindex.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.setindex.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.indexdiv')
+                    PsiElement(*)('*')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.indexentry')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexdiv.status.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.status.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexdiv.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexdiv.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexdiv.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexdiv.status.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexdiv.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.req')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexdiv')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A division in an index')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('indexdiv')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexdiv.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexdiv.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.indexentry')
+                    PsiElement(+)('+')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.segmentedlist')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexentry.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexentry.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexentry.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.indexentry')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An entry in an index')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('indexentry')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.indexentry.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.primaryie')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.seeie')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.seealsoie')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  SEQUENCE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.secondaryie')
+                    PsiElement(,)(',')
+                    PsiWhiteSpace(' ')
+                    ZERO_OR_MORE
+                      GROUP_PATTERN
+                        PsiElement(()('(')
+                        CHOICE
+                          REF_PATTERN
+                            PsiElement(IDENTIFIER)('db.seeie')
+                          PsiWhiteSpace(' ')
+                          PsiElement(|)('|')
+                          PsiWhiteSpace(' ')
+                          REF_PATTERN
+                            PsiElement(IDENTIFIER)('db.seealsoie')
+                          PsiWhiteSpace(' ')
+                          PsiElement(|)('|')
+                          PsiWhiteSpace(' ')
+                          REF_PATTERN
+                            PsiElement(IDENTIFIER)('db.tertiaryie')
+                        PsiElement())(')')
+                      PsiElement(*)('*')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.primaryie.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.primaryie.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.primaryie.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.linkends.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.primaryie')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A primary term in an index entry, not in the text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('primaryie')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.primaryie.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.secondaryie.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.secondaryie.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.secondaryie.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.linkends.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.secondaryie')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A secondary term in an index entry, rather than in the text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('secondaryie')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.secondaryie.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tertiaryie.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tertiaryie.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tertiaryie.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.linkends.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tertiaryie')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A tertiary term in an index entry, rather than in the text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tertiaryie')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tertiaryie.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seeie.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seeie.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.seeie.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.linkend.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seeie')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A See')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ## entry in an index, rather than in the text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('seeie')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.seeie.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seealsoie.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seealsoie.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.seealsoie.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.linkends.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.seealsoie')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A See also')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ##  entry in an index, rather than in the text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('seealsoie')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.seealsoie.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.toc.pagenum.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates the page on which this element occurs in some version of the printed document')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('pagenum')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.toc.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.toc.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.toc.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.toc.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.toc')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A table of contents')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Root must have version"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"/db:toc"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"@version"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"The root element must have a version attribute."')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('toc')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.toc.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.toc.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.tocdiv')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.tocentry')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tocdiv.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tocdiv.pagenum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.toc.pagenum.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tocdiv.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tocdiv.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tocdiv.pagenum.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.linkend.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tocdiv.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tocdiv')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A division in a table of contents')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tocdiv')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tocdiv.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tocdiv.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.tocdiv')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.tocentry')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tocentry.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tocentry.pagenum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.toc.pagenum.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tocentry.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tocentry.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tocentry.pagenum.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.linkend.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tocentry')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A component title in a table of contents')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tocentry')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tocentry.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.task.info')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('db._info.title.req')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.task.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.task.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.task.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.task')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A task to be completed')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('task')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.task.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.task.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.tasksummary')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.taskprerequisites')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.procedure')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.example')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.taskrelated')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tasksummary.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tasksummary.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tasksummary.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tasksummary.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tasksummary')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A summary of a task')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tasksummary')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tasksummary.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tasksummary.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.taskprerequisites.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.taskprerequisites.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.taskprerequisites.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.taskprerequisites.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.taskprerequisites')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The prerequisites for a task')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('taskprerequisites')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.taskprerequisites.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.taskprerequisites.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.taskrelated.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.taskrelated.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.taskrelated.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.taskrelated.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.taskrelated')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Information related to a task')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('taskrelated')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.taskrelated.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.taskrelated.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.area.units.enumeration')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Coordinates expressed as a pair of CALS graphic coordinates.')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"calspair"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Coordinates expressed as a line and column.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"linecolumn"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Coordinates expressed as a pair of lines and columns.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"linecolumnpair"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Coordinates expressed as a line range.')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            PsiElement(LITERAL)('"linerange"')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.area.units-enum.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Identifies the units used in the coords attribute The default units vary according to the type of callout specified: calspair')
+        PsiComment(DOCUMENTATION_CONTINUE)('\n  ##  for graphics and linecolumn')
+        PsiComment(DOCUMENTATION_CONTINUE)('\n  ##  for line-oriented elements.')
+        PsiWhiteSpace('\n  ')
+        OPTIONAL
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('units')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.area.units.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.area.units-other.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates that non-standard units are used for this area')
+        PsiComment(DOCUMENTATION_CONTINUE)('\n  ## . In this case otherunits')
+        PsiComment(DOCUMENTATION_CONTINUE)('\n  ##  must be specified.')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('units')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace('\n    \n    ')
+              PsiComment(DOCUMENTATION)('## Coordinates expressed in some non-standard units.')
+              PsiWhiteSpace('\n    ')
+              DATATYPE_PATTERN
+                PsiElement(LITERAL)('"other"')
+              PsiWhiteSpace('\n  ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  \n  ')
+          PsiComment(DOCUMENTATION)('## Identifies the units used in the coords')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n  ##  attribute when the units')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n  ##  attribute is other')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n  ## . This attribute is forbidden otherwise.')
+          PsiWhiteSpace('\n  ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('otherunits')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:NMTOKEN')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.area.units.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.area.units-enum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.area.units-other.attributes')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.calloutlist.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.calloutlist.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.calloutlist.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.calloutlist.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.calloutlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A list of callout')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ## s')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('calloutlist')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.calloutlist.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.calloutlist.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.callout')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.callout.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.callout.arearefs.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Identifies the areas described by this callout.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('arearefs')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:IDREFS')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.callout.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.callout.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.callout.arearefs.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.callout')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A called out')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ##  description of a marked Area')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('callout')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.callout.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.programlistingco.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.programlistingco.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.programlistingco.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.programlistingco.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.programlistingco')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A program listing with associated areas used in callouts')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('programlistingco')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.programlistingco.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.programlistingco.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.areaspec')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.programlisting')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.calloutlist')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.areaspec.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.areaspec.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.areaspec.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.area.units.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.areaspec')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A collection of regions in a graphic or code example')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('areaspec')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.areaspec.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.area')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.areaset')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.area.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.area.linkends.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Point to the callout')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ## s which refer to this area. (This provides bidirectional linking which may be useful in online presentation.)')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('linkends')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:IDREFS')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.area.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies an identifying number or string that may be used in presentation. The area label might be drawn on top of the figure, for example, at the position indicated by the coords attribute.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('label')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.area.coords.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Provides the coordinates of the area. The coordinates must be interpreted using the units')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ##  specified.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('coords')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.area.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.area.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.idreq.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.area.units.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.area.linkends.attribute')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.href.attributes')
+                PsiElement())(')')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.area.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.area.coords.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.area')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A region defined for a Callout in a graphic or code example')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('area')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.area.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.alt')
+                PsiElement(?)('?')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        PsiComment(SINGLE_LINE_COMMENT)('# The only difference is that xml:id is optional')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.area.inareaset.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.area.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.area.units.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.area.linkends.attribute')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.href.attributes')
+                PsiElement())(')')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.area.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.area.coords.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.area.inareaset')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A region defined for a Callout in a graphic or code example')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('area')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.area.inareaset.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.alt')
+                PsiElement(?)('?')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.areaset.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.areaset.linkends.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.linkends.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.areaset.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.label.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.areaset.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.areaset.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.idreq.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.area.units.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.areaset.linkends.attribute')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db.href.attributes')
+                PsiElement())(')')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.areaset.label.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.areaset')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A set of related areas in a graphic or code example')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('areaset')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.areaset.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.area.inareaset')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.screenco.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.screenco.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.screenco.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.screenco.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.screenco')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A screen with associated areas used in callouts')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('screenco')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.screenco.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.screenco.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.areaspec')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.screen')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.calloutlist')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imageobjectco.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imageobjectco.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imageobjectco.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imageobjectco.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imageobjectco')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for an image object with callouts')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('imageobjectco')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imageobjectco.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imageobjectco.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.areaspec')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.imageobject')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.calloutlist')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.co.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.co.linkends.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.linkends.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.co.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.label.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.co.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.co.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.idreq.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.co.linkends.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.co.label.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.co')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The location of a callout embedded in text')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('co')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.co.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.coref.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.coref.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.label.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.coref.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.coref.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.linkend.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.coref.label.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.coref')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A cross reference to a co')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('coref')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.coref.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productionset.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productionset.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.productionset.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productionset.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productionset')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A set of EBNF productions')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('productionset')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.productionset.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.productionset.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.production')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.productionrecap')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.production.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.production.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.production.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.idreq.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.production')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A production in a set of EBNF productions')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('production')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.production.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.lhs')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rhs')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.constraint')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.lhs.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.lhs.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.lhs.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.lhs')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The left-hand side of an EBNF production')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('lhs')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.lhs.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.rhs.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.rhs.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rhs.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.rhs')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The right-hand side of an EBNF production')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('rhs')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rhs.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    TEXT_PATTERN
+                      PsiElement(KEYWORD_TEXT)('text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.nonterminal')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.lineannotation')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.sbr')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.nonterminal.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.nonterminal.def.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies a URI that points to a production')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ## where the nonterminal')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ##  is defined')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('def')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:anyURI')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.nonterminal.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.nonterminal.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.nonterminal.def.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.nonterminal')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A non-terminal in an EBNF production')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('nonterminal')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.nonterminal.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constraint.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constraint.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.constraint.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.req.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constraint')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A constraint in an EBNF production')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('constraint')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.constraint.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productionrecap.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productionrecap.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.productionrecap.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.req.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.productionrecap')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A cross-reference to an EBNF production')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('productionrecap')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.productionrecap.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constraintdef.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constraintdef.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.constraintdef.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constraintdef.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.constraintdef')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The definition of a constraint in an EBNF production')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('constraintdef')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.constraintdef.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.constraintdef.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.char.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the alignment character when align')
+        PsiComment(DOCUMENTATION_CONTINUE)('\n  ##  is set to char')
+        PsiComment(DOCUMENTATION_CONTINUE)('\n  ## .')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('char')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.charoff.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the percentage of the column's total width that should appear to the left of the first occurance of the character identified in char')
+        PsiComment(DOCUMENTATION_CONTINUE)('\n  ##  when align')
+        PsiComment(DOCUMENTATION_CONTINUE)('\n  ##  is set to char')
+        PsiComment(DOCUMENTATION_CONTINUE)('\n  ## .')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('charoff')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:decimal')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            PARAM
+              PsiElement(IDENTIFIER)('minExclusive')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              PsiElement(LITERAL)('"0"')
+            PsiWhiteSpace(' ')
+            PARAM
+              PsiElement(IDENTIFIER)('maxExclusive')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              PsiElement(LITERAL)('"100"')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.frame.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies how the table is to be framed. Note that there is no way to obtain a border on only the starting edge (left, in left-to-right writing systems) of the table.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('frame')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Frame all four sides of the table. In some environments with limited control over table border formatting, such as HTML, this may imply additional borders.')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"all"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Frame only the bottom of the table.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"bottom"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Place no border on the table. In some environments with limited control over table border formatting, such as HTML, this may disable other borders as well.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"none"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Frame the left and right sides of the table.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"sides"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Frame the top of the table.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"top"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Frame the top and bottom of the table.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"topbot"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.colsep.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the presence or absence of the column separator')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('colsep')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## No column separator rule.')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"0"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Provide a column separator rule on the right')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"1"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.rowsep.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the presence or absence of the row separator')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('rowsep')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## No row separator rule.')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"0"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Provide a row separator rule below')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"1"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.orient.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the orientation of the table')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('orient')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## 90 degrees counter-clockwise from the rest of the text flow.')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"land"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## The same orientation as the rest of the text flow.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"port"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.tabstyle.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the table style')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('tabstyle')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.rowheader.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Indicates whether or not the entries in the first column should be considered row headers')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('rowheader')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Indicates that entries in the first column of the table are functionally row headers (analogous to the way that a thead provides column headers).')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"firstcol"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Indicates that entries in the first column have no special significance with respect to column headers.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"norowheader"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.align.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the horizontal alignment of text in an entry.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('align')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Centered.')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"center"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Aligned on a particular character.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"char"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Left and right justified.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"justify"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Left justified.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"left"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Right justified.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"right"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.valign.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the vertical alignment of text in an entry.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('valign')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Aligned on the bottom of the entry.')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"bottom"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Aligned in the middle.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"middle"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Aligned at the top of the entry.')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"top"')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.specify-col-by-colname.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies a column specification by name.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('colname')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.specify-col-by-namest.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies a starting column by name.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('namest')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.specify-span-by-spanspec.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies a span by name.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('spanname')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.specify-span-directly.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies a starting column by name.')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('namest')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies an ending column by name.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('nameend')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.column-spec.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.specify-col-by-colname.attributes')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.specify-col-by-namest.attributes')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.specify-span-by-spanspec.attributes')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.specify-span-directly.attributes')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.colname.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Provides a name for a column specification.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('colname')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.spanname.attribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Provides a name for a span specification.')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('spanname')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tgroup.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tgroup.tgroupstyle.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Additional style information for downstream processing; typically the name of a style.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tgroupstyle')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tgroup.cols.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The number of columns in the table. Must be an integer greater than zero.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('cols')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:positiveInteger')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tgroup.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tgroup.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.char.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.charoff.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tgroup.tgroupstyle.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.tgroup.cols.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rowsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.align.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.tgroup')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for the main content of a table, or part of a table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tgroup')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tgroup.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.colspec')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.spanspec')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.cals.thead')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.cals.tfoot')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.tbody')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.colspec.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.colspec.colnum.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The number of the column to which this specification applies. Must be greater than any preceding column number. Defaults to one more than the number of the preceding column, if there is one, or one.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('colnum')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:positiveInteger')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.colspec.colwidth.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the width of the column.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('colwidth')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.colspec.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colspec.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colspec.colnum.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.char.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colspec.colwidth.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.charoff.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colname.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rowsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.align.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.colspec')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifications for a column in a table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('colspec')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colspec.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.spanspec.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.spanspec.namest.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies a starting column by name.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('namest')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.spanspec.nameend.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies an ending column by name.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('nameend')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.spanspec.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.spanspec.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.spanname.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.spanspec.namest.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.spanspec.nameend.attribute')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.char.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.charoff.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rowsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.align.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.spanspec')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Formatting information for a spanned column in a table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('spanspec')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.spanspec.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.thead.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.thead.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.thead.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.valign.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.thead')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A table header consisting of one or more rows')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('thead')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.thead.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.colspec')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.row')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.tfoot.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.tfoot.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.tfoot.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.valign.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.tfoot')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A table footer consisting of one or more rows')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tfoot')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.tfoot.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.colspec')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.row')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.tbody.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.tbody.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.tbody.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.valign.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.tbody')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for the rows of a table or informal table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tbody')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.tbody.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.row')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.row.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.row.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.row.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rowsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.valign.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.row')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A row in a table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('row')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.row.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.entry')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.entrytbl')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.entry.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.entry.morerows.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the number of additional rows which this entry occupies. Defaults to zero.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('morerows')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:integer')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.entry.rotate.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the rotation of this entry. A value of 1 (true) rotates the cell 90 degrees counter-clockwise. A value of 0 (false) leaves the cell unrotated.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('rotate')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      \n      ')
+            PsiComment(DOCUMENTATION)('## Do not rotate the cell.')
+            PsiWhiteSpace('\n      ')
+            CHOICE
+              DATATYPE_PATTERN
+                PsiElement(LITERAL)('"0"')
+              PsiWhiteSpace('\n      ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' \n        ')
+              PsiComment(DOCUMENTATION)('## Rotate the cell 90 degrees counter-clockwise.')
+              PsiWhiteSpace('\n        ')
+              DATATYPE_PATTERN
+                PsiElement(LITERAL)('"1"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.entry.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.entry.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.valign.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.char.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.charoff.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.entry.morerows.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.column-spec.attributes')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rowsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.entry.rotate.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.align.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.entry')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A cell in a table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('entry')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.entry.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.all.inlines')
+                    PsiElement(*)('*')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.all.blocks')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.entrytbl.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.entrytbl.tgroupstyle.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Additional style information for downstream processing; typically the name of a style.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tgroupstyle')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.entrytbl.cols.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The number of columns in the entry table. Must be an integer greater than zero.')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('cols')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:positiveInteger')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.entrytbl.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.entrytbl.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.char.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.charoff.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.column-spec.attributes')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.entrytbl.tgroupstyle.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.entrytbl.cols.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rowsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.align.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.entrytbl')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A subtable appearing in place of an Entry in a table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('entrytbl')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.entrytbl.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.colspec')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.spanspec')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.cals.entrytbl.thead')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.entrytbl.tbody')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.entrytbl.thead.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.entrytbl.thead.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.entrytbl.thead.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.valign.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.entrytbl.thead')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A table header consisting of one or more rows')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('thead')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.entrytbl.thead.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.colspec')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.entrytbl.row')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.entrytbl.tbody.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.entrytbl.tbody.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.entrytbl.tbody.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.valign.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.entrytbl.tbody')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for the rows of a table or informal table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tbody')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.entrytbl.tbody.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.entrytbl.row')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.entrytbl.row.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.entrytbl.row.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.entrytbl.row.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rowsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.valign.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.entrytbl.row')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A row in a table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('row')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.entrytbl.row.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.entry')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.table.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.table.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.label.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.table.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.table.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.table.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tabstyle.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.floatstyle.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orient.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rowsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.frame.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.pgwide.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Indicates if the short or long title should be used in a List of Tables')
+            PsiWhiteSpace('\n      ')
+            OPTIONAL
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('shortentry')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace('\n        \n        ')
+                PsiComment(DOCUMENTATION)('## Indicates that the full title should be used.')
+                PsiWhiteSpace('\n        ')
+                CHOICE
+                  DATATYPE_PATTERN
+                    PsiElement(LITERAL)('"0"')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' \n          ')
+                  PsiComment(DOCUMENTATION)('## Indicates that the short short title (titleabbrev) should be used.')
+                  PsiWhiteSpace('\n          ')
+                  DATATYPE_PATTERN
+                    PsiElement(LITERAL)('"1"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Indicates if the table should appear in a List of Tables')
+            PsiWhiteSpace('\n      ')
+            OPTIONAL
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('tocentry')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace('\n        \n        ')
+                PsiComment(DOCUMENTATION)('## Indicates that the table should not occur in the List of Tables.')
+                PsiWhiteSpace('\n        ')
+                CHOICE
+                  DATATYPE_PATTERN
+                    PsiElement(LITERAL)('"0"')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' \n          ')
+                  PsiComment(DOCUMENTATION)('## Indicates that the table should appear in the List of Tables.')
+                  PsiWhiteSpace('\n          ')
+                  DATATYPE_PATTERN
+                    PsiElement(LITERAL)('"1"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rowheader.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.table.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.onlyreq')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.table')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A formal table in a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:example)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"example must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:figure)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"figure must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:equation)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"equation must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:caution)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"caution must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:important)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"important must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:note)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"note must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:tip)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"tip must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:warning)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"warning must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:informaltable)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"informaltable must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('table')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.table.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.table.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                INTERLEAVE
+                  OPTIONAL
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.alt')
+                    PsiElement(?)('?')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.indexing.inlines')
+                    PsiElement(*)('*')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.textobject')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.mediaobject')
+                    PsiElement(+)('+')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.tgroup')
+                    PsiElement(+)('+')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.caption')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.informaltable.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.informaltable.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.informaltable.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tabstyle.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.floatstyle.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orient.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.colsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rowsep.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.frame.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.pgwide.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.rowheader.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.informaltable.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.cals.informaltable')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A table without a title')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('informaltable')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.informaltable.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.cals.informaltable.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                INTERLEAVE
+                  OPTIONAL
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.alt')
+                    PsiElement(?)('?')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.indexing.inlines')
+                    PsiElement(*)('*')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.textobject')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.mediaobject')
+                    PsiElement(+)('+')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.tgroup')
+                    PsiElement(+)('+')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.caption')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.html.coreattrs')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names. Multiple class names must be separated by white space characters.')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('class')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## This attribute specifies style information for the current element.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('style')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## This attribute offers advisory information about the element for which it is set.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('title')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.html.i18n')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## This attribute specifies the base language of an element's attribute values and text content. The default value of this attribute is unknown.')
+        PsiWhiteSpace('\n  ')
+        OPTIONAL
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('lang')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.html.events')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Occurs when the pointing device button is clicked over an element.')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('onclick')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Occurs when the pointing device button is double clicked over an element.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('ondblclick')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Occurs when the pointing device button is pressed over an element.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('onmousedown')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Occurs when the pointing device button is released over an element.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('onmouseup')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Occurs when the pointing device is moved onto an element.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('onmouseover')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Occurs when the pointing device is moved while it is over an element.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('onmousemove')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Occurs when the pointing device is moved away from an element.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('onmouseout')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Occurs when a key is pressed and released over an element.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('onkeypress')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Occurs when a key is pressed down over an element.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('onkeydown')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Occurs when a key is released over an element.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('onkeyup')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.html.attrs')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.common.attributes')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.html.coreattrs')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.html.i18n')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.html.events')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.html.cellhalign')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the alignment of data and the justification of text in a cell.')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('align')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace('\n    \n    ')
+              PsiComment(DOCUMENTATION)('## Left-flush data/Left-justify text. This is the default value for table data.')
+              PsiWhiteSpace('\n    ')
+              CHOICE
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"left"')
+                PsiWhiteSpace('\n    ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n      ')
+                PsiComment(DOCUMENTATION)('## Center data/Center-justify text. This is the default value for table headers.')
+                PsiWhiteSpace('\n      ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"center"')
+                PsiWhiteSpace('\n    ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n      ')
+                PsiComment(DOCUMENTATION)('## Right-flush data/Right-justify text.')
+                PsiWhiteSpace('\n      ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"right"')
+                PsiWhiteSpace('\n    ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n      ')
+                PsiComment(DOCUMENTATION)('## Double-justify text.')
+                PsiWhiteSpace('\n      ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"justify"')
+                PsiWhiteSpace('\n    ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n      ')
+                PsiComment(DOCUMENTATION)('## Align text around a specific character. If a user agent doesn't support character alignment, behavior in the presence of this value is unspecified.')
+                PsiWhiteSpace('\n      ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"char"')
+              PsiWhiteSpace('\n  ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## This attribute specifies a single character within a text fragment to act as an axis for alignment. The default value for this attribute is the decimal point character for the current language as set by the lang attribute (e.g., the period in English and the comma in French). User agents are not required to support this attribute.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('char')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## When present, this attribute specifies the offset to the first occurrence of the alignment character on each line. If a line doesn't include the alignment character, it should be horizontally shifted to end at the alignment position. When charoff is used to set the offset of an alignment character, the direction of offset is determined by the current text direction (set by the dir attribute). In left-to-right texts (the default), offset is from the left margin. In right-to-left texts, offset is from the right margin. User agents are not required to support this attribute.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('charoff')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace('\n      ')
+              CHOICE
+                DATATYPE_PATTERN
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xsd:integer')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                DATATYPE_PATTERN
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xsd:string')
+                  PsiWhiteSpace(' ')
+                  PsiElement({)('{')
+                  PsiWhiteSpace(' ')
+                  PARAM
+                    PsiElement(IDENTIFIER)('pattern')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"[0-9]+%"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(})('}')
+              PsiWhiteSpace('\n    ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.html.cellvalign')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Specifies the vertical position of data within a cell.')
+        PsiWhiteSpace('\n  ')
+        OPTIONAL
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('valign')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n    \n    ')
+            PsiComment(DOCUMENTATION)('## Cell data is flush with the top of the cell.')
+            PsiWhiteSpace('\n    ')
+            CHOICE
+              DATATYPE_PATTERN
+                PsiElement(LITERAL)('"top"')
+              PsiWhiteSpace('\n    ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' \n      ')
+              PsiComment(DOCUMENTATION)('## Cell data is centered vertically within the cell. This is the default value.')
+              PsiWhiteSpace('\n      ')
+              DATATYPE_PATTERN
+                PsiElement(LITERAL)('"middle"')
+              PsiWhiteSpace('\n    ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' \n      ')
+              PsiComment(DOCUMENTATION)('## Cell data is flush with the bottom of the cell.')
+              PsiWhiteSpace('\n      ')
+              DATATYPE_PATTERN
+                PsiElement(LITERAL)('"bottom"')
+              PsiWhiteSpace('\n    ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' \n      ')
+              PsiComment(DOCUMENTATION)('## All cells in the same row as a cell whose valign attribute has this value should have their textual data positioned so that the first text line occurs on a baseline common to all cells in the row. This constraint does not apply to subsequent text lines in these cells.')
+              PsiWhiteSpace('\n      ')
+              DATATYPE_PATTERN
+                PsiElement(LITERAL)('"baseline"')
+            PsiWhiteSpace('\n  ')
+            PsiElement(})('}')
+          PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.html.table.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Provides a summary of the table's purpose and structure for user agents rendering to non-visual media such as speech and Braille.')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('summary')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the desired width of the entire table and is intended for visual user agents. When the value is a percentage value, the value is relative to the user agent's available horizontal space. In the absence of any width specification, table width is determined by the user agent.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('width')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace('\n      ')
+              CHOICE
+                DATATYPE_PATTERN
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xsd:integer')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                DATATYPE_PATTERN
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xsd:string')
+                  PsiWhiteSpace(' ')
+                  PsiElement({)('{')
+                  PsiWhiteSpace(' ')
+                  PARAM
+                    PsiElement(IDENTIFIER)('pattern')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"[0-9]+%"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(})('}')
+              PsiWhiteSpace('\n    ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the width (in pixels only) of the frame around a table.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('border')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              DATATYPE_PATTERN
+                NAME
+                  PsiElement(PREFIXED_NAME)('xsd:nonNegativeInteger')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies which sides of the frame surrounding a table will be visible.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('frame')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace('\n      \n      ')
+              PsiComment(DOCUMENTATION)('## No sides. This is the default value.')
+              PsiWhiteSpace('\n      ')
+              CHOICE
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"void"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## The top side only.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"above"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## The bottom side only.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"below"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## The top and bottom sides only.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"hsides"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## The left-hand side only.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"lhs"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## The right-hand side only.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"rhs"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## The right and left sides only.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"vsides"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## All four sides.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"box"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## All four sides.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"border"')
+              PsiWhiteSpace('\n    ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies which rules will appear between cells within a table. The rendering of rules is user agent dependent.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('rules')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace('\n      \n      ')
+              PsiComment(DOCUMENTATION)('## No rules. This is the default value.')
+              PsiWhiteSpace('\n      ')
+              CHOICE
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"none"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## Rules will appear between row groups (see thead, tfoot, and tbody) and column groups (see colgroup and col) only.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"groups"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## Rules will appear between rows only.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"rows"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## Rules will appear between columns only.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"cols"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## Rules will appear between all rows and columns.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"all"')
+              PsiWhiteSpace('\n    ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies how much space the user agent should leave between the left side of the table and the left-hand side of the leftmost column, the top of the table and the top side of the topmost row, and so on for the right and bottom of the table. The attribute also specifies the amount of space to leave between cells.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('cellspacing')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace('\n      ')
+              CHOICE
+                DATATYPE_PATTERN
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xsd:integer')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                DATATYPE_PATTERN
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xsd:string')
+                  PsiWhiteSpace(' ')
+                  PsiElement({)('{')
+                  PsiWhiteSpace(' ')
+                  PARAM
+                    PsiElement(IDENTIFIER)('pattern')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"[0-9]+%"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(})('}')
+              PsiWhiteSpace('\n    ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the amount of space between the border of the cell and its contents. If the value of this attribute is a pixel length, all four margins should be this distance from the contents. If the value of the attribute is a percentage length, the top and bottom margins should be equally separated from the content based on a percentage of the available vertical space, and the left and right margins should be equally separated from the content based on a percentage of the available horizontal space.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('cellpadding')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace('\n      ')
+              CHOICE
+                DATATYPE_PATTERN
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xsd:integer')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                DATATYPE_PATTERN
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xsd:string')
+                  PsiWhiteSpace(' ')
+                  PsiElement({)('{')
+                  PsiWhiteSpace(' ')
+                  PARAM
+                    PsiElement(IDENTIFIER)('pattern')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"[0-9]+%"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(})('}')
+              PsiWhiteSpace('\n    ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.html.tablecell.attributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  \n  ')
+        PsiComment(DOCUMENTATION)('## Provides an abbreviated form of the cell's content and may be rendered by user agents when appropriate in place of the cell's content. Abbreviated names should be short since user agents may render them repeatedly. For instance, speech synthesizers may render the abbreviated headers relating to a particular cell before rendering that cell's content.')
+        PsiWhiteSpace('\n  ')
+        INTERLEAVE
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('abbr')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## This attribute may be used to place a cell into conceptual categories that can be considered to form axes in an n-dimensional space. User agents may give users access to these categories (e.g., the user may query the user agent for all cells that belong to certain categories, the user agent may present a table in the form of a table of contents, etc.). Please consult an HTML reference for more details.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('axis')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the list of header cells that provide header information for the current data cell. The value of this attribute is a space-separated list of cell names; those cells must be named by setting their id attribute. Authors generally use the headers attribute to help non-visual user agents render header information about data cells (e.g., header information is spoken prior to the cell data), but the attribute may also be used in conjunction with style sheets.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('headers')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the set of data cells for which the current header cell provides header information. This attribute may be used in place of the headers attribute, particularly for simple tables.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('scope')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace('\n      \n      ')
+              PsiComment(DOCUMENTATION)('## The current cell provides header information for the rest of the row that contains it')
+              PsiWhiteSpace('\n      ')
+              CHOICE
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"row"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## The current cell provides header information for the rest of the column that contains it.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"col"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## The header cell provides header information for the rest of the row group that contains it.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"rowgroup"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' \n        ')
+                PsiComment(DOCUMENTATION)('## The header cell provides header information for the rest of the column group that contains it.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"colgroup"')
+              PsiWhiteSpace('\n    ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the number of rows spanned by the current cell. The default value of this attribute is one (1')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ## ). The value zero (0')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ## ) means that the cell spans all rows from the current row to the last row of the table section (thead')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ## , tbody')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ## , or tfoot')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ## ) in which the cell is defined.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('rowspan')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              DATATYPE_PATTERN
+                NAME
+                  PsiElement(PREFIXED_NAME)('xsd:nonNegativeInteger')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiWhiteSpace('\n  ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the number of columns spanned by the current cell. The default value of this attribute is one (1')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ## ). The value zero (0')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ## ) means that the cell spans all columns from the current column to the last column of the column group (colgroup')
+          PsiComment(DOCUMENTATION_CONTINUE)('\n    ## ) in which the cell is defined.')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('colspan')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              DATATYPE_PATTERN
+                NAME
+                  PsiElement(PREFIXED_NAME)('xsd:nonNegativeInteger')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.html.table.info')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('db._info.title.forbidden')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.html.table.model')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.table.info')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.html.caption')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.html.col')
+                PsiElement(*)('*')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.html.colgroup')
+                PsiElement(*)('*')
+            PsiElement())(')')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.thead')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.tfoot')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.html.tbody')
+                PsiElement(+)('+')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.html.tr')
+                PsiElement(+)('+')
+            PsiElement())(')')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.html.informaltable.info')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('db._info.title.forbidden')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.html.informaltable.model')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.informaltable.info')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.html.col')
+                PsiElement(*)('*')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.html.colgroup')
+                PsiElement(*)('*')
+            PsiElement())(')')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.thead')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.tfoot')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.html.tbody')
+                PsiElement(+)('+')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.html.tr')
+                PsiElement(+)('+')
+            PsiElement())(')')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.table.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.table.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.label.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.table.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.attrs')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.table.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.table.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.table.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.orient.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.pgwide.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.tabstyle.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.floatstyle.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.table')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A formal (captioned) HTML table in a document')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:example)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"example must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:figure)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"figure must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:equation)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"equation must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:caution)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"caution must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:important)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"important must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:note)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"note must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:tip)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"tip must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:warning)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"warning must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:table"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:informaltable)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"informaltable must not occur in the descendants of table"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('table')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.table.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.table.model')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.informaltable.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.attrs')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.table.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.informaltable')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An HTML table without a title')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('informaltable')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.informaltable.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.informaltable.model')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.caption.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.html.attrs')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.caption')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An HTML table caption')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:example)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"example must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:figure)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"figure must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:table)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"table must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:equation)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"equation must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:caution)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"caution must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:important)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"important must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:note)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"note must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:tip)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"tip must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:warning)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"warning must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:sidebar)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"sidebar must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:caption"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:task)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"task must not occur in the descendants of caption"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('caption')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.caption.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.inlines')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.col.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.attrs')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## This attribute, whose value must be an integer > 0, specifies the number of columns spanned')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  by the col')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  element; the col')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  element shares its attributes with all the columns it spans. The default value for this attribute is 1 (i.e., a single column). If the span attribute is set to N > 1, the current col')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  element shares its attributes with the next N-1 columns.')
+            PsiWhiteSpace('\n      ')
+            OPTIONAL
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('span')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace(' ')
+                DATATYPE_PATTERN
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xsd:nonNegativeInteger')
+                PsiWhiteSpace(' ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Specifies a default width for each column spanned by the current col')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  element. It has the same meaning as the width')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  attribute for the colgroup')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  element and overrides it.')
+            PsiWhiteSpace('\n      ')
+            OPTIONAL
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('width')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace(' ')
+                TEXT_PATTERN
+                  PsiElement(KEYWORD_TEXT)('text')
+                PsiWhiteSpace(' ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellhalign')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellvalign')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.col')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifications for a column in an HTML table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('col')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.col.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              EMPTY_PATTERN
+                PsiElement(KEYWORD_EMPTY)('empty')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.colgroup.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.attrs')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## This attribute, which must be an integer > 0, specifies the number of columns in a column group. In the absence of a span attribute, each colgroup')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  defines a column group containing one column. If the span attribute is set to N > 0, the current colgroup')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  element defines a column group containing N columns. User agents must ignore this attribute if the colgroup')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  element contains one or more col')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  elements.')
+            PsiWhiteSpace('\n      ')
+            OPTIONAL
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('span')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace(' ')
+                DATATYPE_PATTERN
+                  NAME
+                    PsiElement(PREFIXED_NAME)('xsd:nonNegativeInteger')
+                PsiWhiteSpace(' ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## This attribute specifies a default width for each column in the current column group. In addition to the standard pixel, percentage, and relative values, this attribute allows the special form 0*')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  (zero asterisk) which means that the width of the each column in the group should be the minimum width necessary to hold the column's contents. This implies that a column's entire contents must be known before its width may be correctly computed. Authors should be aware that specifying 0*')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  will prevent visual user agents from rendering a table incrementally. This attribute is overridden for any column in the column group whose width is specified via a col')
+            PsiComment(DOCUMENTATION_CONTINUE)('\n      ##  element.')
+            PsiWhiteSpace('\n      ')
+            OPTIONAL
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('width')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace(' ')
+                TEXT_PATTERN
+                  PsiElement(KEYWORD_TEXT)('text')
+                PsiWhiteSpace(' ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellhalign')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellvalign')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.colgroup')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A group of columns in an HTML table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('colgroup')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.colgroup.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.html.col')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.thead.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.attrs')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellhalign')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellvalign')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.thead')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A table header consisting of one or more rows in an HTML table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('thead')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.thead.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.html.tr')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.tfoot.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.attrs')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellhalign')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellvalign')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.tfoot')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A table footer consisting of one or more rows in an HTML table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tfoot')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.tfoot.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.html.tr')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.tbody.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.attrs')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellhalign')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellvalign')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.tbody')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for the rows of an HTML table or informal HTML table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tbody')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.tbody.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.html.tr')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.tr.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.attrs')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellhalign')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellvalign')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.tr')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A row in an HTML table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('tr')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.tr.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.html.th')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.html.td')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.th.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.attrs')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.tablecell.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellhalign')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellvalign')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.th')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A table header entry in an HTML table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('th')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.th.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.all.inlines')
+                    PsiElement(*)('*')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.all.blocks')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.td.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.attrs')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.tablecell.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellhalign')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.html.cellvalign')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.html.td')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A table entry in an HTML table')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('td')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.html.td.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.all.inlines')
+                    PsiElement(*)('*')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.all.blocks')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgset.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgset.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgset.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgset.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgset')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A detailed set of messages, usually error messages')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msgset')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgset.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgset.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.msgentry')
+                    PsiElement(+)('+')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.simplemsgentry')
+                    PsiElement(+)('+')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgentry.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgentry.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgentry.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgentry')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for an entry in a message set')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msgentry')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgentry.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.msg')
+                PsiElement(+)('+')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.msginfo')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.msgexplan')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplemsgentry.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplemsgentry.msgaud.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The audience to which the message relevant')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msgaud')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplemsgentry.msgorig.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The origin of the message')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msgorig')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplemsgentry.msglevel.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The level of importance or severity of a message')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msglevel')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplemsgentry.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplemsgentry.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplemsgentry.msgaud.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplemsgentry.msgorig.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplemsgentry.msglevel.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.simplemsgentry')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A wrapper for a simpler entry in a message set')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('simplemsgentry')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.simplemsgentry.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgtext')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.msgexplan')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msg.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msg.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msg.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msg.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msg')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A message in a message set')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msg')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msg.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msg.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgmain')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.msgsub')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.msgrel')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgmain.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgmain.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgmain.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgmain.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgmain')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The primary component of a message in a message set ')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msgmain')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgmain.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgmain.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgtext')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgsub.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgsub.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgsub.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgsub.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgsub')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A subcomponent of a message in a message set')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msgsub')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgsub.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgsub.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgtext')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgrel.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgrel.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgrel.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgrel.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgrel')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A related component of a message in a message set')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msgrel')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgrel.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgrel.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgtext')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgtext.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgtext.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgtext.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgtext')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The actual text of a message component in a message set')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msgtext')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgtext.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msginfo.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msginfo.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msginfo.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msginfo')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Information about a message in a message set')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msginfo')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msginfo.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.msglevel')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.msgorig')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.msgaud')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msglevel.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msglevel.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msglevel.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msglevel')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The level of importance or severity of a message in a message set')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msglevel')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msglevel.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgorig.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgorig.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgorig.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgorig')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The origin of a message in a message set')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msgorig')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgorig.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgaud.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgaud.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgaud.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgaud')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## The audience to which a message in a message set is relevant')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msgaud')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgaud.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgexplan.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgexplan.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgexplan.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgexplan.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.msgexplan')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Explanatory material relating to a message in a message set')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('msgexplan')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgexplan.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.msgexplan.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandaset.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandaset.defaultlabel.enumeration')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## No labels')
+          PsiWhiteSpace('\n    ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"none"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Numeric labels')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"number"')
+            PsiWhiteSpace('\n    ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## "Q:" and "A:" labels')
+            PsiWhiteSpace('\n      ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"qanda"')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandaset.defaultlabel.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Specifies the default labelling')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('defaultlabel')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.qandaset.defaultlabel.enumeration')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandaset.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.qandaset.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.qandaset.defaultlabel.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandaset.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandaset')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A question-and-answer set')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('qandaset')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.qandaset.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.qandaset.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.qandadiv')
+                    PsiElement(+)('+')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.qandaentry')
+                    PsiElement(+)('+')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandadiv.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandadiv.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.qandadiv.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandadiv.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandadiv')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A titled division in a QandASet')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('qandadiv')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.qandadiv.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.qandadiv.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.qandadiv')
+                    PsiElement(+)('+')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.qandaentry')
+                    PsiElement(+)('+')
+                PsiElement())(')')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandaentry.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandaentry.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.qandaentry.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandaentry.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.qandaentry')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A question/answer set within a QandASet')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('qandaentry')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.qandaentry.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.qandaentry.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.question')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.answer')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.question.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.question.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.question.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.question')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A question in a QandASet')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('question')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.question.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.label')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.answer.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.answer.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.answer.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.answer')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An answer to a question posed in a QandASet')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('answer')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.answer.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.label')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.all.blocks')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.label.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.label.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.label')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A label on a Question or Answer')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('label')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.label.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db._text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.math.inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('db.inlineequation')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.equation.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.mediaobject')
+                PsiElement(+)('+')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.mathphrase')
+                PsiElement(+)('+')
+            PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db._any.mml')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('db.inlineequation.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.inlinemediaobject')
+            PsiElement(+)('+')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.mathphrase')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.equation.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.equation.label.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db.label.attribute')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.equation.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.equation.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.equation.label.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.pgwide.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.floatstyle.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.equation.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.only')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.equation')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A displayed mathematical equation')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            ANNOTATION
+              PsiElement([)('[')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:equation"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:example)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"example must not occur in the descendants of equation"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:equation"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:figure)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"figure must not occur in the descendants of equation"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:equation"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:table)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"table must not occur in the descendants of equation"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:equation"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:equation)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"equation must not occur in the descendants of equation"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:equation"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:caution)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"caution must not occur in the descendants of equation"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:equation"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:important)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"important must not occur in the descendants of equation"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:equation"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:note)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"note must not occur in the descendants of equation"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:equation"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:tip)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"tip must not occur in the descendants of equation"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n      ')
+              ANNOTATION_ELEMENT
+                NAME
+                  PsiElement(PREFIXED_NAME)('s:pattern')
+                PsiWhiteSpace(' ')
+                PsiElement([)('[')
+                PsiWhiteSpace('\n        ')
+                PsiElement(IDENTIFIER)('name')
+                PsiWhiteSpace(' ')
+                PsiElement(=)('=')
+                PsiWhiteSpace(' ')
+                PsiElement(LITERAL)('"Element exclusion"')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"          "')
+                PsiWhiteSpace('\n        ')
+                ANNOTATION_ELEMENT
+                  NAME
+                    PsiElement(PREFIXED_NAME)('s:rule')
+                  PsiWhiteSpace(' ')
+                  PsiElement([)('[')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(IDENTIFIER)('context')
+                  PsiWhiteSpace(' ')
+                  PsiElement(=)('=')
+                  PsiWhiteSpace(' ')
+                  PsiElement(LITERAL)('"db:equation"')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"            "')
+                  PsiWhiteSpace('\n          ')
+                  ANNOTATION_ELEMENT
+                    NAME
+                      PsiElement(PREFIXED_NAME)('s:assert')
+                    PsiWhiteSpace(' ')
+                    PsiElement([)('[')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(IDENTIFIER)('test')
+                    PsiWhiteSpace(' ')
+                    PsiElement(=)('=')
+                    PsiWhiteSpace(' ')
+                    PsiElement(LITERAL)('"not(.//db:warning)"')
+                    PsiWhiteSpace('\n            ')
+                    PsiElement(LITERAL)('"warning must not occur in the descendants of equation"')
+                    PsiWhiteSpace('\n          ')
+                    PsiElement(])(']')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"\x{a}"')
+                  PsiWhiteSpace(' ')
+                  PsiElement(~)('~')
+                  PsiWhiteSpace('\n          ')
+                  PsiElement(LITERAL)('"          "')
+                  PsiWhiteSpace('\n        ')
+                  PsiElement(])(']')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"\x{a}"')
+                PsiWhiteSpace(' ')
+                PsiElement(~)('~')
+                PsiWhiteSpace('\n        ')
+                PsiElement(LITERAL)('"        "')
+                PsiWhiteSpace('\n      ')
+                PsiElement(])(']')
+              PsiWhiteSpace('\n    ')
+              PsiElement(])(']')
+            PsiWhiteSpace('\n    ')
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('equation')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.equation.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.equation.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.alt')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.equation.content')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.caption')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalequation.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalequation.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalequation.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalequation.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.informalequation')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A displayed mathematical equation without a title')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('informalequation')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalequation.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.informalequation.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.alt')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.equation.content')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.caption')
+                PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.inlineequation.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.inlineequation.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.inlineequation.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.inlineequation')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A mathematical equation or expression occurring inline')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('inlineequation')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.inlineequation.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db.alt')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.inlineequation.content')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.mathphrase.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.mathphrase.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.mathphrase.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.linking.attributes')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.mathphrase')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A mathematical phrase, an expression that can be represented with ordinary text and a small amount of markup')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('mathphrase')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.mathphrase.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ZERO_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._text')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db.ubiq.inlines')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('db._emphasis')
+                  PsiElement())(')')
+                PsiElement(*)('*')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.mathml.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.mathml.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.mathml.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Specifies that the format of the data is MathML')
+            PsiWhiteSpace('\n      ')
+            OPTIONAL
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('format')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace('\n        \n        ')
+                PsiComment(DOCUMENTATION)('## Specifies MathML.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"mathml"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.align.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.valign.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.width.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.contentwidth.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.scalefit.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.scale.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.depth.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.contentdepth.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.mathml.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.mathml')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## A MathML expression in a media object')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('imagedata')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.mathml.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.mathml.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace('\n      ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db._any.mml')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db._any.mml')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Any element from the MathML namespace')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              NAME
+                PsiElement(PREFIX_STAR)('mml:*')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            ZERO_OR_MORE
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db._any.attribute')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  TEXT_PATTERN
+                    PsiElement(KEYWORD_TEXT)('text')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db._any')
+                PsiElement())(')')
+              PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.svg.role.attribute')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('role')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            TEXT_PATTERN
+              PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.svg.attlist')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    ')
+          INTERLEAVE
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.svg.role.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('db.common.attributes')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' \n      ')
+            PsiComment(DOCUMENTATION)('## Specifies that the format of the data is SVG')
+            PsiWhiteSpace('\n      ')
+            OPTIONAL
+              PATTERN
+                PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(IDENTIFIER)('format')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace('\n        \n        ')
+                PsiComment(DOCUMENTATION)('## Specifies SVG.')
+                PsiWhiteSpace('\n        ')
+                DATATYPE_PATTERN
+                  PsiElement(LITERAL)('"svg"')
+                PsiWhiteSpace('\n      ')
+                PsiElement(})('}')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.align.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.valign.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.width.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.contentwidth.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.scalefit.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.scale.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.depth.attribute')
+              PsiElement(?)('?')
+            PsiWhiteSpace('\n    ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            OPTIONAL
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.contentdepth.attribute')
+              PsiElement(?)('?')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.svg.info')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('db._info.title.forbidden')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db.imagedata.svg')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## An SVG drawing in a media object')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('imagedata')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n      ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.svg.attlist')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('db.imagedata.svg.info')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('db._any.svg')
+                PsiElement(+)('+')
+            PsiWhiteSpace('\n    ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DIV
+        PsiElement(KEYWORD_DIV)('div')
+        PsiWhiteSpace(' ')
+        PsiElement({)('{')
+        PsiWhiteSpace('\n  ')
+        DEFINE
+          PsiElement(IDENTIFIER)('db._any.svg')
+          PsiWhiteSpace(' ')
+          PsiElement(=)('=')
+          PsiWhiteSpace('\n    \n    ')
+          PsiComment(DOCUMENTATION)('## Any element from the SVG namespace')
+          PsiWhiteSpace('\n    ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              NAME
+                PsiElement(PREFIX_STAR)('svg:*')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            ZERO_OR_MORE
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db._any.attribute')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  TEXT_PATTERN
+                    PsiElement(KEYWORD_TEXT)('text')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('db._any')
+                PsiElement())(')')
+              PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+        PsiWhiteSpace('\n')
+        PsiElement(})('}')
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/complex/Elements.rnc b/xml/relaxng/testData/parsing/psi/complex/Elements.rnc
new file mode 100644
index 0000000..327b499
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/Elements.rnc
@@ -0,0 +1,554 @@
+# =========================================================
+#                                                          
+# (c) 2004, RenderX                                        
+#                                                          
+# Author: Alexander Peshkov <[email protected]>          
+#                                                          
+# Permission is granted to use this document, copy and     
+# modify free of charge, provided that every derived work  
+# bear a reference to the present document.                
+#                                                          
+# This document contains a computer program written in     
+# XSL Transformations Language. It is published with no    
+# warranty of any kind about its usability, as a mere      
+# example of XSL technology. RenderX shall not be          
+# considered liable for any damage or loss of data caused  
+# by use of this program.                                  
+#                                                          
+# =========================================================
+
+namespace local = ""
+default namespace fo = "http://www.w3.org/1999/XSL/Format"
+namespace rx = "http://www.renderx.com/XSL/Extensions"
+
+include "properties.rnc"
+
+# ****************************************************************************************
+# Common content models used by content-bearing elements
+# ****************************************************************************************
+very-basic-inlines =
+ character
+  | external-graphic
+  | instream-foreign-object
+  | inline-container
+  | leader
+  | page-number
+  | page-number-citation
+  | multi-toggle #MEMO: To be strict, we have to control that this element is a descendant of an fo:multi-case.
+  | page-index
+  | begin-index-range
+  | end-index-range
+
+#NOTE: An absolute-container can be treated both as block and as outline.
+basic-blocks =
+  block | block-container | table-and-caption | table | list-block
+
+#NOTE: Unlike other out-of-lines fo:footnote can be used only in the context where inlines are permitted
+out-of-lines-block = before-float | side-float | absolute-container 
+out-of-lines = footnote | out-of-lines-block
+
+# As a compromise for intricated inline content model prescribed by XSL FO spec
+# we define two types of inline content:
+# first as restrictive as required by spec for descendants of an fo:leader or of an fo:inline
+# child of an fo:footnote (and for some other cases where we believe it is reasonable),
+# it permits inline level elements only, except for descendants of fo:inline-container;
+# second as loose as prescribed by spec for the general cases
+basic-inlines-inline = very-basic-inlines  | basic-link-inline | inline-inline |  bidi-override-inline
+basic-inlines = very-basic-inlines  | basic-link | inline |  bidi-override
+
+# We have three content models for wrappers:
+# first one allows inline content only (based on basic-inlines-inline described above);
+# second one requires block-level elements to be at the top of it;
+# third one is for mixed content (general case);
+wrappers-inline =
+  multi-switch-inline | multi-properties-inline | wrapper-inline | retrieve-marker
+wrappers-block =
+  multi-switch-block | multi-properties-block | wrapper-block | retrieve-marker
+wrappers =
+  multi-switch | multi-properties | wrapper | retrieve-marker
+
+# We have two extended content models for inlines:
+# first one is stricter, with inline elements only (exception for fo:inline-container descendants)
+# and with no outlines (actually they are bared in main.rnc anyway);
+# second one is loose, with all possible inlines and outlines.
+# In general those content models corresponds very well with two possible contexts:
+# block context and inline context
+inlines-inline = text | basic-inlines-inline | wrappers-inline
+inlines = text | basic-inlines | out-of-lines | wrappers
+
+# Content model for blocks including  block-level outlines
+blocks = basic-blocks | wrappers-block | out-of-lines-block
+# Mixed content model - broadest one
+mix = inlines | basic-blocks
+
+# ****************************************************************************************
+# Element structure for content-bearing elements
+# ****************************************************************************************
+# ===============================================================
+# Block is the base element for all content areas. 
+# ===============================================================
+block =
+  element fo:block {
+    block.attlist, block.content
+  }
+block.content = marker*, ( initial-property-set | mix )*
+
+# ===============================================================
+# Block container
+# ===============================================================
+#MEMO: We are forced to create separate element 'absolute-container' in order 
+# to satisfy XSL FO spec requirements. Note that this is the *only* place where 
+# properties really interfer with element-level structure (well, actually fo:float is the second place). 
+# A separate fo:absolute-container is clearly necessary.
+# Absolutely possitioned block-container cannot contain markers and and outlines.
+# It's behaviour is quite similar to the outline elements such as float.
+# 'Folint' do not control absolutely positioned container restriction 
+# (due to expressions that can result in absolute position)
+# 'Folint' also permits  empty block-containers, that is against the spec.
+# Spec defines fo:block-container content as (%block;)+
+
+absolute-container = notAllowed
+absolute-container-real = 
+  element fo:block-container { absolute-container.attlist, absolute-container.content }
+absolute-container.content = blocks+
+
+block-container =
+  element fo:block-container { block-container.attlist, block-container.content }
+block-container.content = marker*, blocks+
+
+# ****************************************************************************************
+# Inline elements
+# ****************************************************************************************
+# ===============================================================
+# Unicode bidi-override
+# ===============================================================
+#MEMO: According to spec this element CAN have block level children except for the cases listed below:
+# XSL> An fo:bidi-override that is a descendant of an fo:leader or of an fo:inline child 
+# XSL> of an fo:footnote may not have block-level children, unless it has a nearer ancestor
+# XSL> that is an fo:inline-container.
+# NOTE: This is contradictory to the description of fo:leader element (6.6.9. fo:leader) that 
+# prohibits (some) block-level elements/outlines to be fo:leader descendants
+# no matter if they wrapped in any fo:inline-containers and  fo:bidi-override.
+# We have two models:
+# first (restrictive) used by descendants of an fo:title, fo:leader or of an fo:inline child of an fo:footnote;
+# second (loose) as prescribed by spec for the general cases
+# 'Folint' believes that no block level elements should be allowed in this element in either way. 
+bidi-override-inline =
+  element fo:bidi-override { bidi-override.attlist, bidi-override-inline.content }
+bidi-override-inline.content = marker*, inlines-inline*
+
+bidi-override =
+  element fo:bidi-override { bidi-override.attlist, bidi-override.content }
+bidi-override.content = marker*, mix*
+
+# ===============================================================
+# Single character
+# ===============================================================
+character = element fo:character { character.attlist, empty }
+
+# ===============================================================
+# Initial property set specifies properties for one or more lines
+# ===============================================================
+initial-property-set =
+  element fo:initial-property-set {
+    initial-property-set.attlist, empty 
+  }
+
+# ===============================================================
+# External graphic
+# ===============================================================
+external-graphic =
+  element fo:external-graphic { external-graphic.attlist, empty }
+
+# ===============================================================
+# In-stream graphic
+# ===============================================================
+instream-foreign-object =
+  element fo:instream-foreign-object {
+    instream-foreign-object.attlist, any
+  }
+
+# ===============================================================
+# Inline
+# ===============================================================
+#MEMO: This element used by content model that consists of inlines only
+# with exception for descendants of inline-container
+inline-inline = element fo:inline { inline.attlist, inline-inline.content }
+inline-inline.content = marker*, inlines-inline*
+
+inline = element fo:inline { inline.attlist, inline.content }
+inline.content = marker*, mix*
+
+# XSL> An fo:inline that is a child of an fo:footnote may not have block-level children.
+# XSL> An fo:inline that is a descendant of an fo:leader or of the fo:inline child of 
+# XSL> an fo:footnote may not have block-level children, unless it has a nearer 
+# XSL> ancestor that is an fo:inline-container.
+#NOTE: This definition is contradictory to the one of the fo:leader since latter prohibits
+# fo:inline-container as a descendant. But it's the definition of fo:leader that should be fixed
+# since content model described above is the only sane content model in the inline context.
+# It should be the same for fo:bidi-override. However definition must  be adjasted 
+# in order to mention fo:title since this element is a typical inline. 
+#
+# 'Folint' believes that block elements are allowed here and thoroughly tests for  
+# all those tricky exceptions. This behavior seems to be quite inconsisten with the 
+# one regarding fo:bidi-override treatment.
+
+# ===============================================================
+# Inline container
+# ===============================================================
+inline-container =
+  element fo:inline-container { inline-container.attlist, inline-container.content }
+inline-container.content = marker*, blocks*
+
+# ===============================================================
+# Leader
+# ===============================================================
+leader = element fo:leader { leader.attlist, leader.content }
+leader.content = inlines-inline*
+#MEMO: Following two lines used together with tricky redefinition in main.rnc 
+# in order to prevent fo:leader nesting.
+#leader.content = notAllowed
+#leader.content-real = inlines-inline*
+
+#MEMO: We use inline content model here which is consistent with 
+# such elements as fo:inline child of fo:footnote. It allows blocks/outlines, but only as a 
+# descendant of  inline-container. XSL FO spec is quite uneven at this point (and should be fixed).
+# According to spec, this element can contain inline level elements and text, but
+# XSL> The content must not contain an fo:leader, fo:inline-container, fo:block-container,
+# XSL> fo:float, fo:footnote, or fo:marker either as a direct child or as a descendant.
+# NOTE: XSL FO spec DO NOT prohibit blocks or tables as descendants of fo:leader!
+# NOTE: fo:leader constraints are contradictory to those of fo:inline since section "6.6.7. fo:inline" 
+# states implicitly that there could be an fo:inline-container that is a descendent of fo:leader.
+#
+# 'Folint' respects these constraints partially: it prohibits fo:block-container as a descendant,
+# but permits fo:marker, fo:leader, fo:inline-container, fo:float, fo:footnote.
+# It also prohibits use of fo:block as descendant.
+
+# ===============================================================
+# Page Number
+# ===============================================================
+page-number = element fo:page-number { page-number.attlist, empty }
+
+# ===============================================================
+# Page number citation
+# ===============================================================
+page-number-citation =
+  element fo:page-number-citation {
+    page-number-citation.attlist, empty 
+  }
+
+# ===============================================================
+# Atomic elements for index ranges markup
+# ===============================================================
+begin-index-range =
+  element rx:begin-index-range { begin-index-range.attlist, empty }
+
+end-index-range =
+  element rx:end-index-range { end-index-range.attlist, empty }
+
+# ===============================================================
+# Page number list - index entry
+# ===============================================================
+page-index = element rx:page-index { page-index.attlist,  page-index.content }
+#MEMO: Currently page-index must contain at least one rx:index-item element, 
+# empty content is allowed for backward compatibility.
+page-index.content = index-item*
+
+index-item = element rx:index-item { index-item.attlist, empty }
+
+# ****************************************************************************************
+# Formatting objects for tables.
+# ****************************************************************************************
+
+# ===============================================================
+# Table & Caption is a wrapper to all the stuff pertinent to a
+# given table. It generates a block consisting of two subblocks:
+# one for the caption, another one for the table itself. The
+# placement of these two blocks is controlled by the
+# 'caption-side' property: if  caption-side="before"|"after" (or
+# their absolute orientation equivalents), the two blocks are
+# drawn one after another; if it is "start"|"end", then the
+# caption is displayed on the correspondent side of the table.
+# In this case, the relative alignment of the two blocks is given
+# by the 'relative-align'/'display-align' property.
+#
+# ===============================================================
+table-and-caption =
+  element fo:table-and-caption {
+    table-and-caption.attlist, 
+    table-and-caption.content
+  }
+table-and-caption.content = marker*, table-caption?, table
+
+# ===============================================================
+# Table caption is an area container.
+# ===============================================================
+table-caption =
+  element fo:table-caption { table-caption.attlist, table-caption.content }
+table-caption.content = marker*, blocks+ 
+
+# ===============================================================
+# fo:table is the basic element for all tables. All the contents
+# placed inside it is distributed over a single rectangular grid
+# of rows and columns.
+# ===============================================================
+table =
+  element fo:table {
+    table.attlist,
+    table.content
+  }
+table.content =
+    marker*,
+    table-column*,
+    table-header?,
+    table-footer?,
+    table-body+
+
+# ===============================================================
+# Table column specifies common properties to ascribe to all
+# cells in a column *or a group of columns*. Note that, if both
+# 'number-columns-repeated' and 'number-columns-spanned' exceed
+# 1, the column counter is increased by 'number-columns-spanned'.
+# it means that you only set properties for columns:
+# 'column-number'
+# 'column-number' + 'number-columns-spanned'
+# 'column-number' + 2 * 'number-columns-spanned'
+# and so on, leaving default properties for intermediate columns.
+# ===============================================================
+table-column = element fo:table-column { table-column.attlist, empty }
+
+# ===============================================================
+# Table header, table footer, and table body are wrappers for
+# groups of rows. They contain either one or more fo:table-rows,
+# or one or more fo:table-cells; in the latter case, row breaks
+# are specified in the cells by 'starts-row'/'ends-row'.
+# All these elements are identical both in the content structure
+# and in the attributes.
+# ===============================================================
+row-group = marker*, (table-row+ | table-cell+)
+table-header =
+  element fo:table-header { table-header.attlist, table-header.content }
+table-header.content = row-group
+
+table-footer =
+  element fo:table-footer { table-footer.attlist, table-footer.content }
+table-footer.content = row-group
+
+table-body = element fo:table-body { table-body.attlist, table-body.content }
+table-body.content = row-group
+
+# ===============================================================
+# Table row.
+# ===============================================================
+table-row = element fo:table-row { table-row.attlist, table-row.content }
+table-row.content = table-cell+
+#MEMO: We are more strict here, so this note is about 'Folint': 
+# 'Folint' permits  empty fo:table-row, that is against the spec.
+# XSL FO spec defines  fo:table-row content as (table-cell+)
+
+# ===============================================================
+# Table cell.
+# ===============================================================
+table-cell = element fo:table-cell { table-cell.attlist, table-cell.content }
+table-cell.content = marker*, blocks+
+#MEMO: We are more strict here, so this note is about 'Folint':
+# 'Folint' permits empty table-cells that is against the spec. Spec defines fo:table-cell
+# content as (%block;)+
+# Note that 'Folint' is quite consistent regarding this matter - it simillary allows empty 
+# block-containers and table-rows
+
+# ****************************************************************************************
+# Formatting objects for lists.
+# ****************************************************************************************
+# ===============================================================
+# List block is a block, with some extra features to control the
+# disposition of list items.
+# ===============================================================
+list-block = element fo:list-block { list-block.attlist, list-block.content }
+list-block.content = marker*, list-item+ 
+
+# ===============================================================
+# List item is a coupling of item label and item body.
+# ===============================================================
+list-item =
+  element fo:list-item {
+    list-item.attlist, 
+    list-item.content
+  }
+list-item.content = marker*, list-item-label, list-item-body
+
+# ===============================================================
+# List item label and list item body
+# ===============================================================
+list-item-label =
+  element fo:list-item-label { list-item-label.attlist, list-item-label.content }
+list-item-label.content = marker*, blocks+
+
+list-item-body =
+  element fo:list-item-body { list-item-body.attlist, list-item-body.content }
+list-item-body.content = marker*, blocks+
+#MEMO: We are more strict here, so this note is about 'Folint':
+# 'Folint' permits  empty fo:list-item-label/body, that is clearly the spec.
+# Spec defines  fo:list-item-label/body content as (%block;)+
+
+#****************************************************************************************
+# Out-of-lines.
+#****************************************************************************************
+# ===============================================================
+# Floats and footnotes resemble containers. Accordingly, we treat
+# them as block sequences.
+# ===============================================================
+#MEMO: We do not allows absolutely positioned container as an outline descendant.
+# 'Folint' is loose here - it do not check this condition.
+#MEMO: We are forced to create two types of floats: side-floats and before-floats
+# because they have different restrictions (side-floats can appear in static content, 
+# before-floats can't bear 'clear' property)
+# NOTE: 'Folint' does not allows any floats inside absolutely positioned containers too.
+side-float = notAllowed
+side-float-real = element fo:float { side-float.attlist, float.content }
+before-float = notAllowed
+before-float-real = element fo:float { before-float.attlist, float.content }
+float.content = blocks+
+
+# XSL> It is an error if the fo:footnote occurs as a descendant of a flow that is not assigned
+# XSL> to a region-body, or of an fo:block-container that generates absolutely positioned areas.
+footnote = notAllowed
+footnote-real =
+  element fo:footnote { footnote.attlist, footnote.content }
+# XSL> An fo:inline that is a child of an fo:footnote may not have block-level children.
+# XSL> An fo:inline that is a descendant of an fo:leader or of the fo:inline child of 
+# XSL> an fo:footnote may not have block-level children, unless it has a nearer 
+# XSL> ancestor that is an fo:inline-container.
+# We do check here that first inline have no block-level children/descendants unlless 
+# they are wrapped into an inline-container.
+# 'Folint' does the same.
+footnote.content = inline-inline, footnote-body 
+
+footnote-body =
+  element fo:footnote-body { footnote-body.attlist, footnote-body.content }
+footnote-body.content =  blocks+
+
+# ===============================================================
+# Simple link. From the formatting point of view, it's nothing
+# but a regular inline sequence.
+# ===============================================================
+# This elment is for separate 'inline' content model
+basic-link-inline = element fo:basic-link { basic-link.attlist, basic-link-inline.content }
+basic-link-inline.content = marker*, inlines-inline*
+
+basic-link = element fo:basic-link { basic-link.attlist, basic-link.content }
+basic-link.content = marker*, mix*
+
+# ****************************************************************************************
+# Wrappers and Markers.
+# ****************************************************************************************
+# ===============================================================
+# Wrapper. This may be useful but it seriously complicates validation of
+# content models for blocks and inlines.
+# ===============================================================
+#There are 3 different kind of wrappers for different contexts
+wrapper-inline = element fo:wrapper { wrapper.attlist, wrapper-inline.content }
+wrapper-inline.content = marker*, inlines-inline*
+
+wrapper-block = element fo:wrapper { wrapper.attlist, wrapper-block.content }
+wrapper-block.content = marker*, blocks*
+
+wrapper = element fo:wrapper { wrapper.attlist, wrapper.content }
+wrapper.content = marker*, mix*
+
+# ===============================================================
+# Marker.
+# ===============================================================
+marker = notAllowed
+marker-real = element fo:marker { marker.attlist, marker.content }
+marker.content = mix*
+
+# ===============================================================
+# Marker retrieval.
+# We are more strict here making retrieve-class-name attribute a mandatory, 
+# but marker with no retrieve-class-name is meaningless.
+# ===============================================================
+retrieve-marker = notAllowed
+retrieve-marker-real = element fo:retrieve-marker { retrieve-marker.attlist, empty }
+
+# ****************************************************************************************
+# Multistate stuff.
+# All those elements are practically  unused and XSL content model invloved is 
+# intricated. Therefor validation is not absolutely strict here.
+# ****************************************************************************************
+# ===============================================================
+# Switch. This is a pure logical operator; no formatting may be
+# conveyed through it.
+# ===============================================================
+#Thera are 3 different kind of multi-switch (because there are 3 kinds of multi-case)
+multi-switch-inline =
+  element fo:multi-switch { multi-switch.attlist, multi-switch-inline.content }
+multi-switch-inline.content = multi-case-inline+
+
+multi-switch-block =
+  element fo:multi-switch { multi-switch.attlist, multi-switch-block.content }
+multi-switch-block.content = multi-case-block+
+
+multi-switch =
+  element fo:multi-switch { multi-switch.attlist, multi-switch.content }
+multi-switch.content = multi-case+
+
+# ===============================================================
+# Single case. Block-level formatting may be conveyed.
+# ===============================================================
+#Thera are 3 different kind of multi-case (similar to fo:wrapper)
+multi-case-inline = element fo:multi-case { multi-case.attlist, multi-case-inline.content }
+multi-case-inline.content = inlines-inline*
+
+multi-case-block = element fo:multi-case { multi-case.attlist, multi-case-block.content }
+multi-case-block.content = blocks*
+
+multi-case = element fo:multi-case { multi-case.attlist, multi-case.content }
+multi-case.content = mix*
+
+# ===============================================================
+# Toggle. This is a typical inline.
+# ===============================================================
+#MEMO: This element is only permitted as a descendant of an fo:multi-case.
+multi-toggle =
+  element fo:multi-toggle { multi-toggle.attlist, multi-toggle.content }
+multi-toggle.content = mix*
+
+# ===============================================================
+# Multi-properties.
+# ===============================================================
+#Thera are 3 different kind of multi-properties (similar to fo:wrapper)
+multi-properties-inline =
+  element fo:multi-properties {
+    multi-properties.attlist, multi-properties-inline.content
+  }
+multi-properties-inline.content = multi-property-set+, wrapper-inline 
+
+multi-properties-block =
+  element fo:multi-properties {
+    multi-properties.attlist, multi-properties-block.content
+  }
+multi-properties-block.content = multi-property-set+, wrapper-block 
+
+multi-properties =
+  element fo:multi-properties {
+    multi-properties.attlist, multi-properties.content
+  }
+multi-properties.content = multi-property-set+, wrapper 
+
+# ===============================================================
+# Multi property set.
+# ===============================================================
+multi-property-set =
+  element fo:multi-property-set { multi-property-set.attlist, empty }
+
+# ===============================================================
+# "Match anything" definition, used by fo:instream-foreign-object
+# ===============================================================
+#MEMO: Should we exclude elements which belongs to fo: namespace?
+any =
+  (element * {
+     attribute * { text }*,
+     any
+   }
+   | text)*
diff --git a/xml/relaxng/testData/parsing/psi/complex/Elements.txt b/xml/relaxng/testData/parsing/psi/complex/Elements.txt
new file mode 100644
index 0000000..d5352b5
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/Elements.txt
@@ -0,0 +1,2713 @@
+RncFileImpl:Elements.rnc
+  PsiComment(SINGLE_LINE_COMMENT)('# =========================================================')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# (c) 2004, RenderX                                        ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Author: Alexander Peshkov <[email protected]>          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Permission is granted to use this document, copy and     ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# modify free of charge, provided that every derived work  ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# bear a reference to the present document.                ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# This document contains a computer program written in     ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL Transformations Language. It is published with no    ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# warranty of any kind about its usability, as a mere      ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# example of XSL technology. RenderX shall not be          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# considered liable for any damage or loss of data caused  ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# by use of this program.                                  ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# =========================================================')
+  PsiWhiteSpace('\n\n')
+  DOCUMENT
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('local')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('""')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_DEFAULT)('default')
+      PsiWhiteSpace(' ')
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('fo')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.w3.org/1999/XSL/Format"')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('rx')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.renderx.com/XSL/Extensions"')
+    PsiWhiteSpace('\n\n')
+    GRAMMAR_PATTERN
+      INCLUDE
+        PsiElement(KEYWORD_INCLUDE)('include')
+        PsiWhiteSpace(' ')
+        PsiElement(LITERAL)('"properties.rnc"')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Common content models used by content-bearing elements')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ****************************************************************************************')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('very-basic-inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('character')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('external-graphic')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('instream-foreign-object')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inline-container')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('leader')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('page-number')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('page-number-citation')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('multi-toggle')
+          PsiWhiteSpace(' ')
+          PsiComment(SINGLE_LINE_COMMENT)('#MEMO: To be strict, we have to control that this element is a descendant of an fo:multi-case.')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('page-index')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('begin-index-range')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('end-index-range')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#NOTE: An absolute-container can be treated both as block and as outline.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('basic-blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('block')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('block-container')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('table-and-caption')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('table')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('list-block')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#NOTE: Unlike other out-of-lines fo:footnote can be used only in the context where inlines are permitted')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('out-of-lines-block')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('before-float')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('side-float')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('absolute-container')
+      PsiWhiteSpace(' \n')
+      DEFINE
+        PsiElement(IDENTIFIER)('out-of-lines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('footnote')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('out-of-lines-block')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# As a compromise for intricated inline content model prescribed by XSL FO spec')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# we define two types of inline content:')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# first as restrictive as required by spec for descendants of an fo:leader or of an fo:inline')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# child of an fo:footnote (and for some other cases where we believe it is reasonable),')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# it permits inline level elements only, except for descendants of fo:inline-container;')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# second as loose as prescribed by spec for the general cases')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('basic-inlines-inline')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('very-basic-inlines')
+          PsiWhiteSpace('  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('basic-link-inline')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inline-inline')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace('  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('bidi-override-inline')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('basic-inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('very-basic-inlines')
+          PsiWhiteSpace('  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('basic-link')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inline')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace('  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('bidi-override')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# We have three content models for wrappers:')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# first one allows inline content only (based on basic-inlines-inline described above);')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# second one requires block-level elements to be at the top of it;')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# third one is for mixed content (general case);')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('wrappers-inline')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('multi-switch-inline')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('multi-properties-inline')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('wrapper-inline')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('retrieve-marker')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('wrappers-block')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('multi-switch-block')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('multi-properties-block')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('wrapper-block')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('retrieve-marker')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('wrappers')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('multi-switch')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('multi-properties')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('wrapper')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('retrieve-marker')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# We have two extended content models for inlines:')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# first one is stricter, with inline elements only (exception for fo:inline-container descendants)')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# and with no outlines (actually they are bared in main.rnc anyway);')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# second one is loose, with all possible inlines and outlines.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# In general those content models corresponds very well with two possible contexts:')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# block context and inline context')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('inlines-inline')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('basic-inlines-inline')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('wrappers-inline')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('inlines')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('basic-inlines')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('out-of-lines')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('wrappers')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# Content model for blocks including  block-level outlines')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('blocks')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('basic-blocks')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('wrappers-block')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('out-of-lines-block')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# Mixed content model - broadest one')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('mix')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inlines')
+          PsiWhiteSpace(' ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('basic-blocks')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Element structure for content-bearing elements')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Block is the base element for all content areas. ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('block')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:block')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('block.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('block.content')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('block.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            GROUP_PATTERN
+              PsiElement(()('(')
+              PsiWhiteSpace(' ')
+              CHOICE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('initial-property-set')
+                PsiWhiteSpace(' ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('mix')
+              PsiWhiteSpace(' ')
+              PsiElement())(')')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Block container')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: We are forced to create separate element 'absolute-container' in order ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# to satisfy XSL FO spec requirements. Note that this is the *only* place where ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# properties really interfer with element-level structure (well, actually fo:float is the second place). ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# A separate fo:absolute-container is clearly necessary.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Absolutely possitioned block-container cannot contain markers and and outlines.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# It's behaviour is quite similar to the outline elements such as float.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'Folint' do not control absolutely positioned container restriction ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# (due to expressions that can result in absolute position)')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'Folint' also permits  empty block-containers, that is against the spec.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Spec defines fo:block-container content as (%block;)+')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('absolute-container')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        NOT_ALLOWED_PATTERN
+          PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('absolute-container-real')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:block-container')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('absolute-container.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('absolute-container.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('absolute-container.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('blocks')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('block-container')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:block-container')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('block-container.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('block-container.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('block-container.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('blocks')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Inline elements')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Unicode bidi-override')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: According to spec this element CAN have block level children except for the cases listed below:')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> An fo:bidi-override that is a descendant of an fo:leader or of an fo:inline child ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> of an fo:footnote may not have block-level children, unless it has a nearer ancestor')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> that is an fo:inline-container.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# NOTE: This is contradictory to the description of fo:leader element (6.6.9. fo:leader) that ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# prohibits (some) block-level elements/outlines to be fo:leader descendants')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# no matter if they wrapped in any fo:inline-containers and  fo:bidi-override.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# We have two models:')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# first (restrictive) used by descendants of an fo:title, fo:leader or of an fo:inline child of an fo:footnote;')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# second (loose) as prescribed by spec for the general cases')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'Folint' believes that no block level elements should be allowed in this element in either way. ')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('bidi-override-inline')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:bidi-override')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('bidi-override.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('bidi-override-inline.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('bidi-override-inline.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('inlines-inline')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('bidi-override')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:bidi-override')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('bidi-override.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('bidi-override.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('bidi-override.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('mix')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Single character')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('character')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:character')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('character.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Initial property set specifies properties for one or more lines')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('initial-property-set')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:initial-property-set')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('initial-property-set.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' \n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# External graphic')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('external-graphic')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:external-graphic')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('external-graphic.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# In-stream graphic')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('instream-foreign-object')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:instream-foreign-object')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('instream-foreign-object.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('any')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Inline')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: This element used by content model that consists of inlines only')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# with exception for descendants of inline-container')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('inline-inline')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:inline')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('inline.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('inline-inline.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('inline-inline.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('inlines-inline')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('inline')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:inline')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('inline.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('inline.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('inline.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('mix')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# XSL> An fo:inline that is a child of an fo:footnote may not have block-level children.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> An fo:inline that is a descendant of an fo:leader or of the fo:inline child of ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> an fo:footnote may not have block-level children, unless it has a nearer ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> ancestor that is an fo:inline-container.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#NOTE: This definition is contradictory to the one of the fo:leader since latter prohibits')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# fo:inline-container as a descendant. But it's the definition of fo:leader that should be fixed')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# since content model described above is the only sane content model in the inline context.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# It should be the same for fo:bidi-override. However definition must  be adjasted ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# in order to mention fo:title since this element is a typical inline. ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'Folint' believes that block elements are allowed here and thoroughly tests for  ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# all those tricky exceptions. This behavior seems to be quite inconsisten with the ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# one regarding fo:bidi-override treatment.')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Inline container')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('inline-container')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:inline-container')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('inline-container.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('inline-container.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('inline-container.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('blocks')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Leader')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('leader')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:leader')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('leader.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('leader.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('leader.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ZERO_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inlines-inline')
+          PsiElement(*)('*')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: Following two lines used together with tricky redefinition in main.rnc ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# in order to prevent fo:leader nesting.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#leader.content = notAllowed')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#leader.content-real = inlines-inline*')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: We use inline content model here which is consistent with ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# such elements as fo:inline child of fo:footnote. It allows blocks/outlines, but only as a ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# descendant of  inline-container. XSL FO spec is quite uneven at this point (and should be fixed).')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# According to spec, this element can contain inline level elements and text, but')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> The content must not contain an fo:leader, fo:inline-container, fo:block-container,')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> fo:float, fo:footnote, or fo:marker either as a direct child or as a descendant.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# NOTE: XSL FO spec DO NOT prohibit blocks or tables as descendants of fo:leader!')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# NOTE: fo:leader constraints are contradictory to those of fo:inline since section "6.6.7. fo:inline" ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# states implicitly that there could be an fo:inline-container that is a descendent of fo:leader.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'Folint' respects these constraints partially: it prohibits fo:block-container as a descendant,')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# but permits fo:marker, fo:leader, fo:inline-container, fo:float, fo:footnote.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# It also prohibits use of fo:block as descendant.')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Page Number')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('page-number')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:page-number')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('page-number.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Page number citation')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('page-number-citation')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:page-number-citation')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('page-number-citation.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' \n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Atomic elements for index ranges markup')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('begin-index-range')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('rx:begin-index-range')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('begin-index-range.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('end-index-range')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('rx:end-index-range')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('end-index-range.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Page number list - index entry')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('page-index')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('rx:page-index')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('page-index.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace('  ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('page-index.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: Currently page-index must contain at least one rx:index-item element, ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# empty content is allowed for backward compatibility.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('page-index.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ZERO_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('index-item')
+          PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('index-item')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('rx:index-item')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('index-item.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Formatting objects for tables.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ****************************************************************************************')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Table & Caption is a wrapper to all the stuff pertinent to a')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# given table. It generates a block consisting of two subblocks:')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# one for the caption, another one for the table itself. The')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# placement of these two blocks is controlled by the')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'caption-side' property: if  caption-side="before"|"after" (or')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# their absolute orientation equivalents), the two blocks are')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# drawn one after another; if it is "start"|"end", then the')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# caption is displayed on the correspondent side of the table.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# In this case, the relative alignment of the two blocks is given')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# by the 'relative-align'/'display-align' property.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-and-caption')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:table-and-caption')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-and-caption.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' \n    ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-and-caption.content')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-and-caption.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-caption')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('table')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Table caption is an area container.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-caption')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:table-caption')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-caption.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-caption.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-caption.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('blocks')
+            PsiElement(+)('+')
+      PsiWhiteSpace(' \n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# fo:table is the basic element for all tables. All the contents')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# placed inside it is distributed over a single rectangular grid')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# of rows and columns.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:table')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace('\n    ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table.content')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n    ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n    ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-column')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-header')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-footer')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n    ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-body')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Table column specifies common properties to ascribe to all')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# cells in a column *or a group of columns*. Note that, if both')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'number-columns-repeated' and 'number-columns-spanned' exceed')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 1, the column counter is increased by 'number-columns-spanned'.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# it means that you only set properties for columns:')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'column-number'')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'column-number' + 'number-columns-spanned'')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'column-number' + 2 * 'number-columns-spanned'')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# and so on, leaving default properties for intermediate columns.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-column')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:table-column')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-column.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Table header, table footer, and table body are wrappers for')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# groups of rows. They contain either one or more fo:table-rows,')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# or one or more fo:table-cells; in the latter case, row breaks')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# are specified in the cells by 'starts-row'/'ends-row'.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# All these elements are identical both in the content structure')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# and in the attributes.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('row-group')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('table-row')
+                PsiElement(+)('+')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('table-cell')
+                PsiElement(+)('+')
+            PsiElement())(')')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-header')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:table-header')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-header.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-header.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-header.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('row-group')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-footer')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:table-footer')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-footer.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-footer.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-footer.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('row-group')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-body')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:table-body')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-body.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-body.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-body.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('row-group')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Table row.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-row')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:table-row')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-row.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-row.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-row.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('table-cell')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: We are more strict here, so this note is about 'Folint': ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'Folint' permits  empty fo:table-row, that is against the spec.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL FO spec defines  fo:table-row content as (table-cell+)')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Table cell.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-cell')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:table-cell')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-cell.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('table-cell.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-cell.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('blocks')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: We are more strict here, so this note is about 'Folint':')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'Folint' permits empty table-cells that is against the spec. Spec defines fo:table-cell')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# content as (%block;)+')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Note that 'Folint' is quite consistent regarding this matter - it simillary allows empty ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# block-containers and table-rows')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Formatting objects for lists.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# List block is a block, with some extra features to control the')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# disposition of list items.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('list-block')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:list-block')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('list-block.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('list-block.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('list-block.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('list-item')
+            PsiElement(+)('+')
+      PsiWhiteSpace(' \n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# List item is a coupling of item label and item body.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('list-item')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:list-item')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('list-item.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' \n    ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('list-item.content')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('list-item.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('list-item-label')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('list-item-body')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# List item label and list item body')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('list-item-label')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:list-item-label')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('list-item-label.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('list-item-label.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('list-item-label.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('blocks')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('list-item-body')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:list-item-body')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('list-item-body.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('list-item-body.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('list-item-body.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('blocks')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: We are more strict here, so this note is about 'Folint':')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'Folint' permits  empty fo:list-item-label/body, that is clearly the spec.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Spec defines  fo:list-item-label/body content as (%block;)+')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Out-of-lines.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Floats and footnotes resemble containers. Accordingly, we treat')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# them as block sequences.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: We do not allows absolutely positioned container as an outline descendant.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'Folint' is loose here - it do not check this condition.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: We are forced to create two types of floats: side-floats and before-floats')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# because they have different restrictions (side-floats can appear in static content, ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# before-floats can't bear 'clear' property)')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# NOTE: 'Folint' does not allows any floats inside absolutely positioned containers too.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('side-float')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        NOT_ALLOWED_PATTERN
+          PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('side-float-real')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:float')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('side-float.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('float.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('before-float')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        NOT_ALLOWED_PATTERN
+          PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('before-float-real')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:float')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('before-float.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('float.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('float.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('blocks')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# XSL> It is an error if the fo:footnote occurs as a descendant of a flow that is not assigned')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> to a region-body, or of an fo:block-container that generates absolutely positioned areas.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('footnote')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        NOT_ALLOWED_PATTERN
+          PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('footnote-real')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:footnote')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('footnote.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('footnote.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# XSL> An fo:inline that is a child of an fo:footnote may not have block-level children.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> An fo:inline that is a descendant of an fo:leader or of the fo:inline child of ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> an fo:footnote may not have block-level children, unless it has a nearer ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> ancestor that is an fo:inline-container.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# We do check here that first inline have no block-level children/descendants unlless ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# they are wrapped into an inline-container.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'Folint' does the same.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('footnote.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inline-inline')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('footnote-body')
+      PsiWhiteSpace(' \n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('footnote-body')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:footnote-body')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('footnote-body.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('footnote-body.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('footnote-body.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('  ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('blocks')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Simple link. From the formatting point of view, it's nothing')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# but a regular inline sequence.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# This elment is for separate 'inline' content model')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('basic-link-inline')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:basic-link')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('basic-link.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('basic-link-inline.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('basic-link-inline.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('inlines-inline')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('basic-link')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:basic-link')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('basic-link.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('basic-link.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('basic-link.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('mix')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Wrappers and Markers.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Wrapper. This may be useful but it seriously complicates validation of')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# content models for blocks and inlines.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#There are 3 different kind of wrappers for different contexts')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('wrapper-inline')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:wrapper')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('wrapper.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('wrapper-inline.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('wrapper-inline.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('inlines-inline')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('wrapper-block')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:wrapper')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('wrapper.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('wrapper-block.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('wrapper-block.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('blocks')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('wrapper')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:wrapper')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('wrapper.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('wrapper.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('wrapper.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('mix')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Marker.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('marker')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        NOT_ALLOWED_PATTERN
+          PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('marker-real')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:marker')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('marker.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('marker.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ZERO_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('mix')
+          PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Marker retrieval.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# We are more strict here making retrieve-class-name attribute a mandatory, ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# but marker with no retrieve-class-name is meaningless.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('retrieve-marker')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        NOT_ALLOWED_PATTERN
+          PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('retrieve-marker-real')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:retrieve-marker')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('retrieve-marker.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Multistate stuff.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# All those elements are practically  unused and XSL content model invloved is ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# intricated. Therefor validation is not absolutely strict here.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Switch. This is a pure logical operator; no formatting may be')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# conveyed through it.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#Thera are 3 different kind of multi-switch (because there are 3 kinds of multi-case)')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-switch-inline')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:multi-switch')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-switch.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-switch-inline.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-switch-inline.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('multi-case-inline')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-switch-block')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:multi-switch')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-switch.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-switch-block.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-switch-block.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('multi-case-block')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-switch')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:multi-switch')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-switch.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-switch.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-switch.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('multi-case')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Single case. Block-level formatting may be conveyed.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#Thera are 3 different kind of multi-case (similar to fo:wrapper)')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-case-inline')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:multi-case')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-case.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-case-inline.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-case-inline.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ZERO_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inlines-inline')
+          PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-case-block')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:multi-case')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-case.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-case-block.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-case-block.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ZERO_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('blocks')
+          PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-case')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:multi-case')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-case.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-case.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-case.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ZERO_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('mix')
+          PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Toggle. This is a typical inline.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: This element is only permitted as a descendant of an fo:multi-case.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-toggle')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:multi-toggle')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-toggle.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-toggle.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-toggle.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ZERO_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('mix')
+          PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Multi-properties.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#Thera are 3 different kind of multi-properties (similar to fo:wrapper)')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-properties-inline')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:multi-properties')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-properties.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-properties-inline.content')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-properties-inline.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-property-set')
+            PsiElement(+)('+')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('wrapper-inline')
+      PsiWhiteSpace(' \n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-properties-block')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:multi-properties')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-properties.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-properties-block.content')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-properties-block.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-property-set')
+            PsiElement(+)('+')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('wrapper-block')
+      PsiWhiteSpace(' \n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-properties')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:multi-properties')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-properties.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-properties.content')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-properties.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-property-set')
+            PsiElement(+)('+')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('wrapper')
+      PsiWhiteSpace(' \n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Multi property set.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-property-set')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:multi-property-set')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('multi-property-set.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# "Match anything" definition, used by fo:instream-foreign-object')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: Should we exclude elements which belongs to fo: namespace?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('any')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        ZERO_OR_MORE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              PATTERN
+                PsiElement(KEYWORD_ELEMENT)('element')
+                PsiWhiteSpace(' ')
+                NAME_CLASS
+                  PsiElement(*)('*')
+                PsiWhiteSpace(' ')
+                PsiElement({)('{')
+                PsiWhiteSpace('\n     ')
+                SEQUENCE
+                  ZERO_OR_MORE
+                    PATTERN
+                      PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+                      PsiWhiteSpace(' ')
+                      NAME_CLASS
+                        PsiElement(*)('*')
+                      PsiWhiteSpace(' ')
+                      PsiElement({)('{')
+                      PsiWhiteSpace(' ')
+                      TEXT_PATTERN
+                        PsiElement(KEYWORD_TEXT)('text')
+                      PsiWhiteSpace(' ')
+                      PsiElement(})('}')
+                    PsiElement(*)('*')
+                  PsiElement(,)(',')
+                  PsiWhiteSpace('\n     ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('any')
+                PsiWhiteSpace('\n   ')
+                PsiElement(})('}')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              TEXT_PATTERN
+                PsiElement(KEYWORD_TEXT)('text')
+            PsiElement())(')')
+          PsiElement(*)('*')
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/complex/Main.rnc b/xml/relaxng/testData/parsing/psi/complex/Main.rnc
new file mode 100644
index 0000000..2232854
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/Main.rnc
@@ -0,0 +1,239 @@
+# =========================================================
+#                                                          
+# (c) 2004, RenderX                                        
+#                                                          
+# Author: Alexander Peshkov <[email protected]>          
+#                                                          
+# Permission is granted to use this document, copy and     
+# modify free of charge, provided that every derived work  
+# bear a reference to the present document.                
+#                                                          
+# This document contains a computer program written in     
+# XSL Transformations Language. It is published with no    
+# warranty of any kind about its usability, as a mere      
+# example of XSL technology. RenderX shall not be          
+# considered liable for any damage or loss of data caused  
+# by use of this program.                                  
+#                                                          
+# =========================================================
+
+namespace local = ""
+default namespace fo = "http://www.w3.org/1999/XSL/Format"
+namespace rx = "http://www.renderx.com/XSL/Extensions"
+
+include "elements.rnc"
+
+start = root
+
+# ****************************************************************************************
+# Element structure for top-level elements
+# ****************************************************************************************
+# ===============================================================
+# Root element. Contains everything, generates nothing. It has an
+# id, a FO namespace prefix declaration, and other namespace
+# declarations if used.
+# ===============================================================
+root = element fo:root { root.attlist, root.content }
+root.content = 
+  meta-info?,
+  layout-master-set,
+  declarations?,
+  outline?,
+  page-sequence+
+
+# ===============================================================
+# Document meta information - RenderX extension
+# ===============================================================
+meta-info = element rx:meta-info { meta-info.attlist, meta-info.content }
+meta-info.content = meta-field+ 
+
+meta-field = element rx:meta-field { meta-field.attlist, empty }
+
+# ===============================================================
+# Color profile declarations
+# ===============================================================
+declarations = element fo:declarations { declarations.attlist, declarations.content }
+declarations.content = color-profile+ 
+
+color-profile = element fo:color-profile { color-profile.attlist, empty }
+
+# ===============================================================
+# Bookmarks - RenderX extension
+# ===============================================================
+outline = element rx:outline { outline.attlist, outline.content }
+outline.content = bookmark+
+
+bookmark = element rx:bookmark { bookmark.attlist, bookmark.content }
+bookmark.content = bookmark-label, bookmark*
+
+bookmark-label = element rx:bookmark-label { bookmark-label.attlist, bookmark-label.content }
+bookmark-label.content = text
+
+# ===============================================================
+# Layout-master-set. Contains a set of page-masters.
+# Content model made more strict than in the spec, to enforce
+# that a page-sequence-master be always accompanied by at least
+# one simple-page-master.
+# ===============================================================
+layout-master-set = element fo:layout-master-set { layout-master-set.attlist, layout-master-set.content }
+layout-master-set.content = page-sequence-master* & simple-page-master+
+
+# ===============================================================
+# Page sequence master
+# ===============================================================
+page-sequence-master = 
+  element fo:page-sequence-master { 
+    page-sequence-master.attlist, page-sequence-master.content
+  }
+page-sequence-master.content = 
+  (single-page-master-reference
+   | repeatable-page-master-reference
+   | repeatable-page-master-alternatives)+
+
+# ===============================================================
+# Sequence specifiers are predefined sequences of page masters
+# that are used by page sequence master to construct a desired
+# page collection.
+# ===============================================================
+single-page-master-reference = 
+  element fo:single-page-master-reference {
+    single-page-master-reference.attlist, empty
+  }
+
+repeatable-page-master-reference = 
+  element fo:repeatable-page-master-reference {
+    repeatable-page-master-reference.attlist, empty
+  }
+
+repeatable-page-master-alternatives = 
+  element fo:repeatable-page-master-alternatives {
+    repeatable-page-master-alternatives.attlist, repeatable-page-master-alternatives.content
+  }
+repeatable-page-master-alternatives.content = conditional-page-master-reference+
+
+conditional-page-master-reference = 
+  element fo:conditional-page-master-reference {
+    conditional-page-master-reference.attlist, empty
+  }
+
+# ===============================================================
+# Simple page master defines a page layout. It does not
+# explicitly generate any content.
+# ===============================================================
+simple-page-master =
+  element fo:simple-page-master {
+    simple-page-master.attlist,
+    simple-page-master.content
+  }
+simple-page-master.content =
+    region-body,
+    region-before?,
+    region-after?,
+    region-start?,
+    region-end?
+
+# ===============================================================
+# Regions. The page instance is divided into subareas, whose
+# properties are described by the five region-* elements. These
+# elements by themselves do not generate any content.
+# ===============================================================
+
+# ===============================================================
+# Body region: middle of the page.
+# ===============================================================
+region-body = element fo:region-body { region-body.attlist, empty }
+
+# ===============================================================
+# Side regions: page edges.
+# ===============================================================
+
+region-before = element fo:region-before { region-before.attlist, empty }
+region-after = element fo:region-after { region-after.attlist, empty }
+region-start = element fo:region-start { region-start.attlist, empty }
+region-end = element fo:region-end { region-end.attlist, empty }
+
+# ===============================================================
+# Page sequence defines the order of choosing page masters to
+# accomodate all the contents generated by its fo:flow and
+# fo:static-content children, and the way of numbering them.
+# ===============================================================
+page-sequence = element fo:page-sequence { page-sequence.attlist, page-sequence.content }
+page-sequence.content = title?, static-content*, flow
+
+# ===============================================================
+# Title. May not contain out-of-lines.
+# ===============================================================
+#MEMO: Spec states:
+# XSL> Additionally, an fo:title is not permitted to have as a descendant an fo:block-container
+# XSL> that generates an absolutely positioned area.
+# We prohibit block-level descendants except for those descendats of fo:inline-container.
+# This content model shared by fo:leader and fo:inline child of an fo:footnote.
+title = element fo:title { title.attlist, title.content }
+title.content = inlines-inline*
+
+# ===============================================================
+# Flows. They are just sequences of blocks. 'flow-name' feature
+# defines linkage of the flow to a region in the page master.
+# ===============================================================
+# ===============================================================
+# An extension element, rx:flow-section, has been added in order
+# to overcome limitations on multicolumn layout imposed by XSL FO
+# ===============================================================
+#NOTE: We use tricks with nested grammar in order control marker/retrieve-marker 
+#and outlines  appearance inside fo:static-content and fo:flow
+#MEMO: We forcedly prohibit side-floats as descendants of ablsoutely positioned
+# block-containers. This problem appears due to the 'half-outline' behavior of
+# an absolute-container - it cannot contain outlines except for side-float and it cannot
+# be nested into any other outlines.
+#NOTE: 'Folint' prohibits use of side-floats in static-content that is against the spec.
+static-content = element fo:static-content { static-content.attlist, static-content.content }
+static-content.content = grammar {
+  start = blocks+
+  include "elements.rnc" {
+    retrieve-marker =  retrieve-marker-real
+    absolute-container = absolute-container-real
+    absolute-container.content = parent absolute-container.content
+    side-float = side-float-real
+    float.content = parent float.content
+    leader.content = parent leader.content
+  }
+}
+
+flow = element fo:flow { flow.attlist, flow.content }
+flow.content = grammar {
+  start =marker*, (blocks | flow-section)+
+  include "elements.rnc" {
+    absolute-container = absolute-container-real
+    #MEMO: We have two options here:
+    # * use parent content model which is too strict (side-floats descendants not allowed);
+    # * use current content model which is too loose (all outline descendants are allowed).
+    # We prefer stricter mode.
+    absolute-container.content = parent absolute-container.content
+    marker = marker-real
+    marker.content = parent marker.content
+    side-float = side-float-real
+    before-float = before-float-real
+    float.content = parent float.content
+    footnote = footnote-real
+    footnote.content = parent footnote.content
+    #NOTE: fo:leader can't have outlines and marker descendants
+    leader.content = parent leader.content
+  }
+  # Extension element. Acts like a top-level block with multiple columns.
+  flow-section = element rx:flow-section { flow-section.attlist, flow-section.content }
+  flow-section.content = blocks+
+}  
+
+#MEMO: Spec prohibits use of fo:leader as a descendant of itself.
+# We find this constraint somewhat abusive so we do not enforce it.
+# 'Folint' also does not controll this constraint
+# However following trick can be used to prevent fo:leader to appear as it's own child.
+# (to make it work we have to set leader.content to be notAllowed and move
+# actual content into leader.content-real in elements.rnc)
+#leader.content |= grammar {
+# start = leader.content-real
+#  include "elements.rnc" {
+#    leader = notAllowed 
+#  }
+#}
+
diff --git a/xml/relaxng/testData/parsing/psi/complex/Main.txt b/xml/relaxng/testData/parsing/psi/complex/Main.txt
new file mode 100644
index 0000000..021c46d
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/Main.txt
@@ -0,0 +1,1206 @@
+RncFileImpl:Main.rnc
+  PsiComment(SINGLE_LINE_COMMENT)('# =========================================================')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# (c) 2004, RenderX                                        ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Author: Alexander Peshkov <[email protected]>          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Permission is granted to use this document, copy and     ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# modify free of charge, provided that every derived work  ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# bear a reference to the present document.                ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# This document contains a computer program written in     ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL Transformations Language. It is published with no    ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# warranty of any kind about its usability, as a mere      ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# example of XSL technology. RenderX shall not be          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# considered liable for any damage or loss of data caused  ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# by use of this program.                                  ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# =========================================================')
+  PsiWhiteSpace('\n\n')
+  DOCUMENT
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('local')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('""')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_DEFAULT)('default')
+      PsiWhiteSpace(' ')
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('fo')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.w3.org/1999/XSL/Format"')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('rx')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.renderx.com/XSL/Extensions"')
+    PsiWhiteSpace('\n\n')
+    GRAMMAR_PATTERN
+      INCLUDE
+        PsiElement(KEYWORD_INCLUDE)('include')
+        PsiWhiteSpace(' ')
+        PsiElement(LITERAL)('"elements.rnc"')
+      PsiWhiteSpace('\n\n')
+      START
+        PsiElement(KEYWORD_START)('start')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('root')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Element structure for top-level elements')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Root element. Contains everything, generates nothing. It has an')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# id, a FO namespace prefix declaration, and other namespace')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# declarations if used.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('root')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:root')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('root.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('root.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('root.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('meta-info')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('layout-master-set')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('declarations')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('outline')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('page-sequence')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Document meta information - RenderX extension')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('meta-info')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('rx:meta-info')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('meta-info.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('meta-info.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('meta-info.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('meta-field')
+          PsiElement(+)('+')
+      PsiWhiteSpace(' \n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('meta-field')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('rx:meta-field')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('meta-field.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Color profile declarations')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('declarations')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:declarations')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('declarations.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('declarations.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('declarations.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('color-profile')
+          PsiElement(+)('+')
+      PsiWhiteSpace(' \n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('color-profile')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:color-profile')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('color-profile.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Bookmarks - RenderX extension')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('outline')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('rx:outline')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('outline.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('outline.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('outline.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('bookmark')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('bookmark')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('rx:bookmark')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('bookmark.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('bookmark.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('bookmark.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('bookmark-label')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('bookmark')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('bookmark-label')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('rx:bookmark-label')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('bookmark-label.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('bookmark-label.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('bookmark-label.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        TEXT_PATTERN
+          PsiElement(KEYWORD_TEXT)('text')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Layout-master-set. Contains a set of page-masters.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Content model made more strict than in the spec, to enforce')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# that a page-sequence-master be always accompanied by at least')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# one simple-page-master.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('layout-master-set')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:layout-master-set')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('layout-master-set.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('layout-master-set.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('layout-master-set.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        INTERLEAVE
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('page-sequence-master')
+            PsiElement(*)('*')
+          PsiWhiteSpace(' ')
+          PsiElement(&)('&')
+          PsiWhiteSpace(' ')
+          ONE_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('simple-page-master')
+            PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Page sequence master')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('page-sequence-master')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:page-sequence-master')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' \n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('page-sequence-master.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('page-sequence-master.content')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('page-sequence-master.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        ONE_OR_MORE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('single-page-master-reference')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('repeatable-page-master-reference')
+              PsiWhiteSpace('\n   ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('repeatable-page-master-alternatives')
+            PsiElement())(')')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Sequence specifiers are predefined sequences of page masters')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# that are used by page sequence master to construct a desired')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# page collection.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('single-page-master-reference')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:single-page-master-reference')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('single-page-master-reference.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('repeatable-page-master-reference')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:repeatable-page-master-reference')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('repeatable-page-master-reference.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('repeatable-page-master-alternatives')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:repeatable-page-master-alternatives')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('repeatable-page-master-alternatives.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('repeatable-page-master-alternatives.content')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('repeatable-page-master-alternatives.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ONE_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('conditional-page-master-reference')
+          PsiElement(+)('+')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('conditional-page-master-reference')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:conditional-page-master-reference')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('conditional-page-master-reference.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Simple page master defines a page layout. It does not')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# explicitly generate any content.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('simple-page-master')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:simple-page-master')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n    ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('simple-page-master.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace('\n    ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('simple-page-master.content')
+          PsiWhiteSpace('\n  ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('simple-page-master.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n    ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('region-body')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('region-before')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('region-after')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('region-start')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('region-end')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Regions. The page instance is divided into subareas, whose')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# properties are described by the five region-* elements. These')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# elements by themselves do not generate any content.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Body region: middle of the page.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('region-body')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:region-body')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('region-body.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Side regions: page edges.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('region-before')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:region-before')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('region-before.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('region-after')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:region-after')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('region-after.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('region-start')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:region-start')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('region-start.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('region-end')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:region-end')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('region-end.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            EMPTY_PATTERN
+              PsiElement(KEYWORD_EMPTY)('empty')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Page sequence defines the order of choosing page masters to')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# accomodate all the contents generated by its fo:flow and')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# fo:static-content children, and the way of numbering them.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('page-sequence')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:page-sequence')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('page-sequence.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('page-sequence.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('page-sequence.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('title')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('static-content')
+            PsiElement(*)('*')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('flow')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Title. May not contain out-of-lines.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: Spec states:')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> Additionally, an fo:title is not permitted to have as a descendant an fo:block-container')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL> that generates an absolutely positioned area.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# We prohibit block-level descendants except for those descendats of fo:inline-container.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# This content model shared by fo:leader and fo:inline child of an fo:footnote.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('title')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:title')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('title.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('title.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('title.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        ZERO_OR_MORE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inlines-inline')
+          PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Flows. They are just sequences of blocks. 'flow-name' feature')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# defines linkage of the flow to a region in the page master.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# An extension element, rx:flow-section, has been added in order')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# to overcome limitations on multicolumn layout imposed by XSL FO')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#NOTE: We use tricks with nested grammar in order control marker/retrieve-marker ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#and outlines  appearance inside fo:static-content and fo:flow')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: We forcedly prohibit side-floats as descendants of ablsoutely positioned')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# block-containers. This problem appears due to the 'half-outline' behavior of')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# an absolute-container - it cannot contain outlines except for side-float and it cannot')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# be nested into any other outlines.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#NOTE: 'Folint' prohibits use of side-floats in static-content that is against the spec.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('static-content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:static-content')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('static-content.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('static-content.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('static-content.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        GRAMMAR_PATTERN
+          PsiElement(KEYWORD_GRAMMAR)('grammar')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n  ')
+          START
+            PsiElement(KEYWORD_START)('start')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            ONE_OR_MORE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('blocks')
+              PsiElement(+)('+')
+          PsiWhiteSpace('\n  ')
+          INCLUDE
+            PsiElement(KEYWORD_INCLUDE)('include')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"elements.rnc"')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('retrieve-marker')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace('  ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('retrieve-marker-real')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('absolute-container')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('absolute-container-real')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('absolute-container.content')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              PARENT_REF
+                PsiElement(KEYWORD_PARENT)('parent')
+                PsiWhiteSpace(' ')
+                PsiElement(IDENTIFIER)('absolute-container.content')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('side-float')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('side-float-real')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('float.content')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              PARENT_REF
+                PsiElement(KEYWORD_PARENT)('parent')
+                PsiWhiteSpace(' ')
+                PsiElement(IDENTIFIER)('float.content')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('leader.content')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              PARENT_REF
+                PsiElement(KEYWORD_PARENT)('parent')
+                PsiWhiteSpace(' ')
+                PsiElement(IDENTIFIER)('leader.content')
+            PsiWhiteSpace('\n  ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('flow')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            NAME
+              PsiElement(PREFIXED_NAME)('fo:flow')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('flow.attlist')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('flow.content')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('flow.content')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        GRAMMAR_PATTERN
+          PsiElement(KEYWORD_GRAMMAR)('grammar')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace('\n  ')
+          START
+            PsiElement(KEYWORD_START)('start')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            SEQUENCE
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('marker')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                GROUP_PATTERN
+                  PsiElement(()('(')
+                  CHOICE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('blocks')
+                    PsiWhiteSpace(' ')
+                    PsiElement(|)('|')
+                    PsiWhiteSpace(' ')
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('flow-section')
+                  PsiElement())(')')
+                PsiElement(+)('+')
+          PsiWhiteSpace('\n  ')
+          INCLUDE
+            PsiElement(KEYWORD_INCLUDE)('include')
+            PsiWhiteSpace(' ')
+            PsiElement(LITERAL)('"elements.rnc"')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('absolute-container')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('absolute-container-real')
+            PsiWhiteSpace('\n    ')
+            PsiComment(SINGLE_LINE_COMMENT)('#MEMO: We have two options here:')
+            PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n    # * use parent content model which is too strict (side-floats descendants not allowed);')
+            PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n    # * use current content model which is too loose (all outline descendants are allowed).')
+            PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n    # We prefer stricter mode.')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('absolute-container.content')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              PARENT_REF
+                PsiElement(KEYWORD_PARENT)('parent')
+                PsiWhiteSpace(' ')
+                PsiElement(IDENTIFIER)('absolute-container.content')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('marker')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('marker-real')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('marker.content')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              PARENT_REF
+                PsiElement(KEYWORD_PARENT)('parent')
+                PsiWhiteSpace(' ')
+                PsiElement(IDENTIFIER)('marker.content')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('side-float')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('side-float-real')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('before-float')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('before-float-real')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('float.content')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              PARENT_REF
+                PsiElement(KEYWORD_PARENT)('parent')
+                PsiWhiteSpace(' ')
+                PsiElement(IDENTIFIER)('float.content')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('footnote')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('footnote-real')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('footnote.content')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              PARENT_REF
+                PsiElement(KEYWORD_PARENT)('parent')
+                PsiWhiteSpace(' ')
+                PsiElement(IDENTIFIER)('footnote.content')
+            PsiWhiteSpace('\n    ')
+            PsiComment(SINGLE_LINE_COMMENT)('#NOTE: fo:leader can't have outlines and marker descendants')
+            PsiWhiteSpace('\n    ')
+            DEFINE
+              PsiElement(IDENTIFIER)('leader.content')
+              PsiWhiteSpace(' ')
+              PsiElement(=)('=')
+              PsiWhiteSpace(' ')
+              PARENT_REF
+                PsiElement(KEYWORD_PARENT)('parent')
+                PsiWhiteSpace(' ')
+                PsiElement(IDENTIFIER)('leader.content')
+            PsiWhiteSpace('\n  ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiComment(SINGLE_LINE_COMMENT)('# Extension element. Acts like a top-level block with multiple columns.')
+          PsiWhiteSpace('\n  ')
+          DEFINE
+            PsiElement(IDENTIFIER)('flow-section')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            PATTERN
+              PsiElement(KEYWORD_ELEMENT)('element')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                NAME
+                  PsiElement(PREFIXED_NAME)('rx:flow-section')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              SEQUENCE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('flow-section.attlist')
+                PsiElement(,)(',')
+                PsiWhiteSpace(' ')
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('flow-section.content')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          DEFINE
+            PsiElement(IDENTIFIER)('flow-section.content')
+            PsiWhiteSpace(' ')
+            PsiElement(=)('=')
+            PsiWhiteSpace(' ')
+            ONE_OR_MORE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('blocks')
+              PsiElement(+)('+')
+          PsiWhiteSpace('\n')
+          PsiElement(})('}')
+  PsiWhiteSpace('  \n\n')
+  PsiComment(SINGLE_LINE_COMMENT)('#MEMO: Spec prohibits use of fo:leader as a descendant of itself.')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# We find this constraint somewhat abusive so we do not enforce it.')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'Folint' also does not controll this constraint')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# However following trick can be used to prevent fo:leader to appear as it's own child.')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# (to make it work we have to set leader.content to be notAllowed and move')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# actual content into leader.content-real in elements.rnc)')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#leader.content |= grammar {')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# start = leader.content-real')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#  include "elements.rnc" {')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#    leader = notAllowed ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#  }')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#}')
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/complex/Properties.rnc b/xml/relaxng/testData/parsing/psi/complex/Properties.rnc
new file mode 100644
index 0000000..1e4825b
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/Properties.rnc
@@ -0,0 +1,659 @@
+# =========================================================
+#                                                          
+# (c) 2004, RenderX                                        
+#                                                          
+# Author: Alexander Peshkov <[email protected]>          
+#                                                          
+# Permission is granted to use this document, copy and     
+# modify free of charge, provided that every derived work  
+# bear a reference to the present document.                
+#                                                          
+# This document contains a computer program written in     
+# XSL Transformations Language. It is published with no    
+# warranty of any kind about its usability, as a mere      
+# example of XSL technology. RenderX shall not be          
+# considered liable for any damage or loss of data caused  
+# by use of this program.
+#                                                          
+# =========================================================
+
+namespace local = ""
+default namespace fo = "http://www.w3.org/1999/XSL/Format"
+namespace rx = "http://www.renderx.com/XSL/Extensions"
+
+include "properties_groups.rnc"
+
+# ****************************************************************************************
+# Properties used by top-level elements
+# ****************************************************************************************
+# ===============================================================
+# Root element can bear inheritable properties, passed further to 
+# fo:flows/fo:static-contents. Inheritable properties from fo:layout-master-set 
+# are banned in this version of schema.
+# ===============================================================
+root.attlist = 
+  media-usage.attr?,
+  inheritable-properties
+
+# ===============================================================
+# Document meta information - RenderX extension
+# ===============================================================
+meta-info.attlist = empty
+
+# lknl klkj kjk
+meta-field.attlist = 
+  name.attr,
+  value.attr
+
+# ===============================================================
+# Color profile declarations
+# ===============================================================
+declarations.attlist = empty
+
+color-profile.attlist = 
+  src.attr,
+  color-profile-name.attr,
+  rendering-intent.attr?
+
+# ===============================================================
+# Bookmarks - RenderX extension
+# ===============================================================
+outline.attlist = empty
+
+bookmark.attlist = 
+  (internal-destination.attr | external-destination.attr),
+  collapse-subtree.attr?
+
+bookmark-label.attlist = empty
+
+# ===============================================================
+# Layout-master-set contains a set of page-masters. Neither of
+# its descendants generates any area, so no inherited elements
+# can be specified on it or on its children.
+# ===============================================================
+layout-master-set.attlist = empty
+
+# ===============================================================
+# Page sequence master
+# ===============================================================
+page-sequence-master.attlist = master-name.attr
+
+# ===============================================================
+# Sequence specifiers.
+# ===============================================================
+single-page-master-reference.attlist = master-reference.attr
+
+repeatable-page-master-reference.attlist = 
+  master-reference.attr,
+  maximum-repeats.attr?
+
+repeatable-page-master-alternatives.attlist = maximum-repeats.attr?
+
+conditional-page-master-reference.attlist =
+  master-reference.attr,
+  page-position.attr?,
+  odd-or-even.attr?,
+  blank-or-not-blank.attr?
+
+# ===============================================================
+# Simple page master defines a page layout. It does not
+# explicitly generate any content. Most of its properties are
+# local except for writing-mode and reference-orientation that
+# are inherited by the underlying region-* objects.
+# ===============================================================
+# NOTE. We could think about a common background/padding/border
+# for every page instance generated by the page master. For such
+# a scope, we may add borders/padding/background to its features.
+# However, in the current version this is ruled out explicitly by the XSL specs.
+  
+simple-page-master.attlist =
+  margin-properties-CSS,
+  master-name.attr,
+  page-height.attr?,
+  page-width.attr?,
+  reference-orientation.attr?,
+  size.attr?,
+  writing-mode.attr?
+  
+# ===============================================================
+# Region elements by themselves do not generate any content.
+# Reference-orientation and writing-mode may be inherited from
+# the page master; all other features are local.
+# ===============================================================
+
+region-properties =
+  border-padding-background-properties,
+  area-properties,
+  region-name.attr?
+
+# ===============================================================
+# Body region: middle of the page. Unlike side regions, this one
+# may have multiple columns.
+# ===============================================================  
+# NOTE: We have restricted margin properties to be margin-only,
+# allowing no spaces. This is done because no clear semantics
+# can be ascribed to single components of a space vector.
+  
+region-body.attlist =
+  region-properties,
+  margin-properties-CSS,
+  column-count.attr?,
+  column-gap.attr?
+
+# ===============================================================
+# Side regions: page edges. These regions have extent and
+# precedence that is used to arbitrate corner conflicts. Side
+# regions are viewed as frames, and may not have margins.
+# ===============================================================
+# NOTE: Extent made obligatory: its default value of 0.0pt does not
+# make much sense.
+region-before.attlist = 
+  region-properties,
+  extent.attr,
+  precedence.attr?
+
+region-after.attlist = 
+  region-properties,
+  extent.attr,
+  precedence.attr?
+
+region-start.attlist = 
+  region-properties,
+  extent.attr
+
+region-end.attlist = 
+  region-properties,
+  extent.attr
+
+# ===============================================================
+# Page sequence. 
+# ===============================================================
+page-sequence.attlist =
+  format.attr?,
+  letter-value.attr?,
+  grouping-separator.attr?,
+  grouping-size.attr?,
+  id.attr?,
+  rx-key.attr?,
+  initial-page-number.attr?,
+  force-page-count.attr?,
+  master-reference.attr,
+  inheritable-properties
+
+# ===============================================================
+# Title
+# ===============================================================
+#MEMO: Why 'id' attribute is not allowed here?
+#MEMO: Does it makes sence to add relative-position here? 
+# According to Section 7.12.1. "relative-position" it is allowed everywhere except fo:block-container
+#Should we allow all inline properties here??
+title.attlist = 
+  accessibility-properties,
+  aural-properties-unheritable,
+  border-padding-background-properties,
+  margin-properties-inline,
+  inheritable-properties
+
+# ===============================================================
+# Flows. 'flow-name' feature defines linkage of the flow to a region in the page master.
+# ===============================================================
+flow-properties =
+  id.attr?,
+  rx-key.attr?,
+  flow-name.attr,
+  inheritable-properties
+
+flow.attlist = flow-properties
+static-content.attlist = flow-properties
+
+# ===============================================================
+# An extension element, rx:flow-section.
+# Acts like a top-level block with multiple columns.
+# ===============================================================
+flow-section.attlist =
+    column-count.attr?,
+    column-gap.attr?,
+    border-padding-background-properties,
+    margin-properties-block,
+    inheritable-properties
+
+# ****************************************************************************************
+# Properties used by content-bearing elements
+# ****************************************************************************************
+
+# ===============================================================
+# Properties of block formatting objects.
+# ===============================================================
+# ===============================================================
+# Besides properties used to format the block itself, it also conveys
+# formatting information to its inline-level children.
+# ===============================================================
+block.attlist =
+  block-properties,
+  character-properties-unheritable,
+  text-altitude.attr?, 
+  text-depth.attr?
+
+# ===============================================================
+# Block container
+# ===============================================================
+
+#MEMO: We are forced to create separate element 'absolute-container' in order 
+# to satisfy XSL FO spec requirements. 
+absolute-container.attlist = 
+  absolute-position-properties, 
+  area-properties-unheritable,
+  box-size-properties,
+  common-block-properties,
+  z-index.attr?
+
+# 'Usual' container element
+#MEMO: XSLFO spec prohibits use of 'relative-position' for fo:block-container,
+# but we believe that it should be allowed for non-absolutely positioned containers.
+block-container.attlist =
+  area-properties-unheritable,
+  box-size-properties,
+  block-properties,
+  container-position.attr?,
+  z-index.attr?
+
+# ===============================================================
+# Properties of inline formatting objects.
+# ===============================================================
+# ===============================================================
+# Unicode bidi-override
+# ===============================================================
+#MEMO: This element is 'half-inline' accroding to spec, since it's exhibits the same 
+# bahavior and used in the same context but yet cannot carry some of inline-level
+# properties such as margins and border.
+# We use the same set of properties as for inline here (except for unicode-bidi and
+# width properties) since we believe that this is a typical inline element.
+# Moreover fo:bidi-override is redundant from semantic point of view since it do not 
+# carry any additional information compared to regular fo:inline - just add
+# 'unicode-bidi' to fo:inline and you do not need fo:bidi-override anymore.
+bidi-override.attlist = 
+  inline-properties,
+  unicode-bidi.attr?
+#MEMO: 'Folint' believes that direction property is required for fo:bidi-override,
+# but this is against the spec since this property can be inherited.
+
+# ===============================================================
+# Single character
+# ===============================================================
+character.attlist =
+  character.attr,
+  suppress-at-line-break.attr?,
+  treat-as-word-space.attr?,
+  common-inline-properties
+
+# ===============================================================
+# Initial property set specifies properties for one or more lines
+# ===============================================================
+#MEMO: Spec is contradictory here. It states that use of this object is equivalent to
+# the fo:wrapper around the first line. At the same time spec allows on this element
+# such properties as 'Common Border, Padding, and Background Properties' 
+# - fo:wrapper can't have border/padding/etc and can bear inheritable properties only.
+# We believe that this element should be treated as inline and thus should have
+# appropriate properties set.
+initial-property-set.attlist = 
+  common-inline-properties
+
+# ===============================================================
+# External graphic
+# ===============================================================
+external-graphic.attlist =
+  graphic-properties,
+  src.attr?
+  
+# ===============================================================
+# In-stream graphic
+# ===============================================================
+instream-foreign-object.attlist =
+  graphic-properties
+
+# ===============================================================
+# Inline
+# ===============================================================
+inline.attlist =
+  height-properties,
+  inline-properties
+
+# ===============================================================
+# Inline container
+# ===============================================================
+# FIXME! We believe that this element should not bear not-inheritable properties,
+# which applies to text since it can't have text children.
+# Therefor we do not use 'common-inline-properties' set.
+inline-container.attlist = 
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  aural-properties-unheritable,
+  area-alignment-properties,
+  border-padding-background-properties,
+  keeps-properties-atomic,
+  margin-properties-inline,
+  relative-position-properties,  
+  area-properties-unheritable,
+  box-size-properties,
+  inheritable-properties
+  
+# ===============================================================
+# Leader
+# ===============================================================
+leader.attlist =
+  inline-properties
+
+#MEMO: Note that 'inline-properties' includes block-level inheritable properties.
+# But it's OK in our content-model since it allows block-level descendants wrapped
+# into fo:inline-container.
+# At the same time block-level inheritable properties includes leader properties,
+# since they are inheritable... 
+
+# ===============================================================
+# Page Number
+# ===============================================================
+page-number.attlist =
+  common-inline-properties,
+  wrap-option.attr?
+
+# ===============================================================
+# Page number citation
+# ===============================================================
+page-number-citation.attlist =
+  common-inline-properties,
+  wrap-option.attr?,
+  ref-id.attr
+  
+# ===============================================================
+# Atomic elements for index ranges markup
+# ===============================================================
+begin-index-range.attlist = id.attr, rx-key.attr
+end-index-range.attlist = ref-id.attr
+
+# ===============================================================
+# Page number list - index entry
+# ===============================================================
+page-index.attlist =
+  common-inline-properties,
+  wrap-option.attr?,
+  list-separator.attr?,
+  ref-key.attr?
+#MEMO: There is no 'ref-key' attribute on page-index now, but it is allowed for 
+# backward compatibility.
+#MEMO: Actually it makes sense to exclude id/rx:key fom the set of availabe properties 
+# for 'index-item', however we prefer no to do it just to avoid creation of yet another content
+# model (attribute set) for thid inline element.
+index-item.attlist =
+  common-inline-properties,
+  wrap-option.attr?,
+  ref-key.attr,
+  link-back.attr?,
+  range-separator.attr?,
+  merge-subsequent-page-numbers.attr?
+
+# ===============================================================
+# Properties of table formatting objects.
+# ===============================================================
+# ===============================================================
+# Table & Caption.
+# ===============================================================
+table-and-caption.attlist = 
+  common-block-properties,
+  clear.attr?,
+  relative-position-properties,
+  keeps-and-breaks-properties-atomic
+
+#MEMO: Spec do not allows margins on fo:table-caption that is against common sence 
+# since this is a typical container.
+# We do allow margins (they are included in common-block-properties).
+# 'Folint' does the same.
+table-caption.attlist = 
+  clear.attr?,
+  common-block-properties,
+  relative-position-properties,
+  box-size-properties
+
+table.attlist =
+  clear.attr?,
+  common-block-properties,
+  box-size-properties,
+  keeps-and-breaks-properties-atomic,
+  table-properties-unheritable
+  
+# ===============================================================
+# Table column specifies common properties to ascribe to all
+# cells in a column *or a group of columns*. Note that, if both
+# 'number-columns-repeated' and 'number-columns-spanned' exceed
+# 1, the column counter is increased by 'number-columns-spanned'.
+# it means that you only set properties for columns:
+# 'column-number'
+# 'column-number' + 'number-columns-spanned'
+# 'column-number' + 2 * 'number-columns-spanned'
+# and so on, leaving default properties for intermediate columns.
+# ===============================================================
+table-column.attlist =
+  column-number.attr?,
+  column-width.attr?,
+  number-columns-repeated.attr?,
+  number-columns-spanned.attr?,
+  background-properties,
+#MEMO: Border properties applies to this formatting object only if the value of border-collapse
+# for the table is "collapse" or "collapse-with-precedence" 
+  border-properties,
+  border-precedence-properties,
+  inheritable-properties
+
+# ===============================================================
+# Table header, table footer, and table body.
+# ===============================================================
+row-group.attlist = 
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  aural-properties-unheritable,
+  background-properties,
+#MEMO: Border properties applies to this formatting object only if the value of border-collapse
+# for the table is "collapse" or "collapse-with-precedence" 
+  border-properties,
+  border-precedence-properties,
+  relative-position-properties,
+  inheritable-properties
+
+table-header.attlist = row-group.attlist
+table-footer.attlist = row-group.attlist
+#MEMO: Spec do not list "Keep" properties almong applicable to fo:table-body that is a clear
+# case of  errata.
+table-body.attlist = 
+  row-group.attlist,
+  keeps-and-breaks-properties-atomic
+  
+# ===============================================================
+# Table row.
+# ===============================================================
+#MEMO: Should we create separate collection of properties in 'properties_groups.rnc'
+# based on row-group.attlist?
+table-row.attlist =
+  row-group.attlist,
+  height-properties,
+  keeps-and-breaks-properties-atomic
+
+# ===============================================================
+# Table cell.
+# ===============================================================
+#MEMO: Spec do not allows margins on fo:table-cell but 'Folint' does.
+# We excluded margins from this element and therefor don't use 'common-block-properties'
+#MEMO: Spec do not list "Keep" properties almong applicable to fo:table-cell that is a clear
+# case of  errata.
+table-cell.attlist =
+  id.attr?,
+  rx-key.attr?,
+  column-number.attr?,
+  accessibility-properties,
+  aural-properties-unheritable,
+  border-padding-background-properties,
+  border-precedence-properties,
+  box-size-properties,
+  ends-row.attr?,
+  keeps-and-breaks-properties-atomic,
+  number-columns-spanned.attr?,
+  number-rows-spanned.attr?,
+  starts-row.attr?,
+  inheritable-properties
+  
+# ===============================================================
+# Properties of list formatting objects.
+# ===============================================================  
+# ===============================================================
+# List block.
+# ===============================================================
+list-block.attlist = 
+  clear.attr?,
+  common-block-properties,
+  keeps-and-breaks-properties-atomic,
+  relative-position-properties
+
+# ===============================================================
+# List item.
+# ===============================================================
+list-item.attlist = 
+  common-block-properties,
+  keeps-and-breaks-properties-atomic,
+  relative-position-properties  
+
+# ===============================================================
+# List item label and list item body
+# ===============================================================
+list-item-label.attlist = 
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  inheritable-properties
+
+list-item-body.attlist = 
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  inheritable-properties
+  
+# ===============================================================
+# Floats and footnotes.
+# ===============================================================
+#MEMO: Outlines can't have id and therefor can't have rx:key properties so we are strict here.
+# 'Folint' is loose here - it allows use of these properties.
+#MEMO: We are forced to create two types of floats: side-floats and before-floats.
+side-float.attlist = 
+  side-float.attr?,
+  clear.attr?,
+  inheritable-properties
+# NOTE: before-float can't bear 'clear' property
+before-float.attlist = 
+  before-float.attr?,
+  inheritable-properties
+
+footnote.attlist = 
+  accessibility-properties,
+  inheritable-properties
+
+footnote-body.attlist = 
+  accessibility-properties,
+  inheritable-properties
+
+# ===============================================================
+# Simple link.
+# ===============================================================
+basic-link.attlist =
+  inline-properties,
+  external-destination.attr?,
+  internal-destination.attr?,
+  indicate-destination.attr?,
+  show-destination.attr?,
+  destination-placement-offset.attr?,
+  target-processing-context.attr?,
+  target-presentation-context.attr?,
+  target-stylesheet.attr?
+
+# ===============================================================
+# Wrappers.
+# ===============================================================
+wrapper.attlist =
+  id.attr?,
+  rx-key.attr?,
+  inheritable-properties
+
+# ===============================================================
+# Marker. This element may embrace any content but cannot pass
+# properties to its children; so, it may not have features other
+# than marker-class-name.
+# ===============================================================
+#MEMO: We are more strict here making marker-class-name attribute a mandatory,
+# but marker with no marker-class-name is meaningless.
+marker.attlist = marker-class-name.attr
+
+# ===============================================================
+# Marker retrieval.
+# ===============================================================
+# FIXME! We are more strict here making retrieve-class-name attribute a mandatory, 
+# but marker with no retrieve-class-name is meaningless.
+retrieve-marker.attlist =
+  retrieve-class-name.attr,
+  retrieve-position.attr?,
+  retrieve-boundary.attr?,
+  #MEMO: Is it OK to allow inheritable properties here? There are no explicit arguments
+  # against it in the spec.
+  inheritable-properties
+
+# ===============================================================
+# Multistate stuff.
+# ===============================================================
+# ===============================================================
+# Switch. 
+# ===============================================================
+#MEMO: Should we have Aural Properties here as well?
+multi-switch.attlist =
+  id.attr?,
+  rx-key.attr?,
+  auto-restore.attr?,
+  accessibility-properties,
+  inheritable-properties
+
+# ===============================================================
+# Single case.
+# ===============================================================
+multi-case.attlist =
+  id.attr?,
+  rx-key.attr?,
+  starting-state.attr?,
+  case-name.attr?,
+  case-title.attr?,
+  accessibility-properties,
+  inheritable-properties
+  
+# ===============================================================
+# Toggle. 
+# ===============================================================
+#MEMO: Should we have here inline-level properties only?
+multi-toggle.attlist =
+  switch-to.attr?,
+  accessibility-properties,
+  inheritable-properties
+
+# ===============================================================
+# Multi-properties.
+# ===============================================================
+#Should we allow here any possible properties applicable to the objects inside of the flow?
+multi-properties.attlist = 
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  inheritable-properties
+  
+# ===============================================================
+# Multi property set.
+# ===============================================================
+#Should we allow here any possible properties applicable to the objects inside of the flow?
+multi-property-set.attlist =
+  id.attr?,
+  rx-key.attr?,
+  active-state.attr,
+  inheritable-properties  
diff --git a/xml/relaxng/testData/parsing/psi/complex/Properties.txt b/xml/relaxng/testData/parsing/psi/complex/Properties.txt
new file mode 100644
index 0000000..b934429
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/Properties.txt
@@ -0,0 +1,1904 @@
+RncFileImpl:Properties.rnc
+  PsiComment(SINGLE_LINE_COMMENT)('# =========================================================')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# (c) 2004, RenderX                                        ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Author: Alexander Peshkov <[email protected]>          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Permission is granted to use this document, copy and     ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# modify free of charge, provided that every derived work  ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# bear a reference to the present document.                ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# This document contains a computer program written in     ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# XSL Transformations Language. It is published with no    ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# warranty of any kind about its usability, as a mere      ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# example of XSL technology. RenderX shall not be          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# considered liable for any damage or loss of data caused  ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# by use of this program.')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#                                                          ')
+  PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# =========================================================')
+  PsiWhiteSpace('\n\n')
+  DOCUMENT
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('local')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('""')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_DEFAULT)('default')
+      PsiWhiteSpace(' ')
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('fo')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.w3.org/1999/XSL/Format"')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('rx')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.renderx.com/XSL/Extensions"')
+    PsiWhiteSpace('\n\n')
+    GRAMMAR_PATTERN
+      INCLUDE
+        PsiElement(KEYWORD_INCLUDE)('include')
+        PsiWhiteSpace(' ')
+        PsiElement(LITERAL)('"properties_groups.rnc"')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Properties used by top-level elements')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Root element can bear inheritable properties, passed further to ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# fo:flows/fo:static-contents. Inheritable properties from fo:layout-master-set ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# are banned in this version of schema.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('root.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('media-usage.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Document meta information - RenderX extension')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('meta-info.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        EMPTY_PATTERN
+          PsiElement(KEYWORD_EMPTY)('empty')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# lknl klkj kjk')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('meta-field.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('name.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('value.attr')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Color profile declarations')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('declarations.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        EMPTY_PATTERN
+          PsiElement(KEYWORD_EMPTY)('empty')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('color-profile.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('src.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('color-profile-name.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('rendering-intent.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Bookmarks - RenderX extension')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('outline.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        EMPTY_PATTERN
+          PsiElement(KEYWORD_EMPTY)('empty')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('bookmark.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          GROUP_PATTERN
+            PsiElement(()('(')
+            CHOICE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('internal-destination.attr')
+              PsiWhiteSpace(' ')
+              PsiElement(|)('|')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('external-destination.attr')
+            PsiElement())(')')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('collapse-subtree.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('bookmark-label.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        EMPTY_PATTERN
+          PsiElement(KEYWORD_EMPTY)('empty')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Layout-master-set contains a set of page-masters. Neither of')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# its descendants generates any area, so no inherited elements')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# can be specified on it or on its children.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('layout-master-set.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        EMPTY_PATTERN
+          PsiElement(KEYWORD_EMPTY)('empty')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Page sequence master')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('page-sequence-master.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('master-name.attr')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Sequence specifiers.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('single-page-master-reference.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('master-reference.attr')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('repeatable-page-master-reference.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('master-reference.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('maximum-repeats.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('repeatable-page-master-alternatives.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        OPTIONAL
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('maximum-repeats.attr')
+          PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('conditional-page-master-reference.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('master-reference.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('page-position.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('odd-or-even.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('blank-or-not-blank.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Simple page master defines a page layout. It does not')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# explicitly generate any content. Most of its properties are')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# local except for writing-mode and reference-orientation that')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# are inherited by the underlying region-* objects.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# NOTE. We could think about a common background/padding/border')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# for every page instance generated by the page master. For such')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# a scope, we may add borders/padding/background to its features.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# However, in the current version this is ruled out explicitly by the XSL specs.')
+      PsiWhiteSpace('\n  \n')
+      DEFINE
+        PsiElement(IDENTIFIER)('simple-page-master.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('margin-properties-CSS')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('master-name.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('page-height.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('page-width.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('reference-orientation.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('size.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('writing-mode.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n  \n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Region elements by themselves do not generate any content.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Reference-orientation and writing-mode may be inherited from')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# the page master; all other features are local.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('region-properties')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('border-padding-background-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('area-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('region-name.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Body region: middle of the page. Unlike side regions, this one')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# may have multiple columns.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================  ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# NOTE: We have restricted margin properties to be margin-only,')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# allowing no spaces. This is done because no clear semantics')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# can be ascribed to single components of a space vector.')
+      PsiWhiteSpace('\n  \n')
+      DEFINE
+        PsiElement(IDENTIFIER)('region-body.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('region-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('margin-properties-CSS')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('column-count.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('column-gap.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Side regions: page edges. These regions have extent and')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# precedence that is used to arbitrate corner conflicts. Side')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# regions are viewed as frames, and may not have margins.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# NOTE: Extent made obligatory: its default value of 0.0pt does not')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# make much sense.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('region-before.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('region-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('extent.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('precedence.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('region-after.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('region-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('extent.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('precedence.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('region-start.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('region-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('extent.attr')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('region-end.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('region-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('extent.attr')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Page sequence. ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('page-sequence.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('format.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('letter-value.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('grouping-separator.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('grouping-size.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('id.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('rx-key.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('initial-page-number.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('force-page-count.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('master-reference.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Title')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: Why 'id' attribute is not allowed here?')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: Does it makes sence to add relative-position here? ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# According to Section 7.12.1. "relative-position" it is allowed everywhere except fo:block-container')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#Should we allow all inline properties here??')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('title.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('accessibility-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('aural-properties-unheritable')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('border-padding-background-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('margin-properties-inline')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Flows. 'flow-name' feature defines linkage of the flow to a region in the page master.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('flow-properties')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('id.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('rx-key.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('flow-name.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('flow.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('flow-properties')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('static-content.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('flow-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# An extension element, rx:flow-section.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Acts like a top-level block with multiple columns.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('flow-section.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n    ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('column-count.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n    ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('column-gap.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n    ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('border-padding-background-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n    ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('margin-properties-block')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n    ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ****************************************************************************************')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Properties used by content-bearing elements')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ****************************************************************************************')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Properties of block formatting objects.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Besides properties used to format the block itself, it also conveys')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# formatting information to its inline-level children.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('block.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('block-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('character-properties-unheritable')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('text-altitude.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' \n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('text-depth.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Block container')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: We are forced to create separate element 'absolute-container' in order ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# to satisfy XSL FO spec requirements. ')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('absolute-container.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('absolute-position-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' \n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('area-properties-unheritable')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('box-size-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('common-block-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('z-index.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# 'Usual' container element')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: XSLFO spec prohibits use of 'relative-position' for fo:block-container,')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# but we believe that it should be allowed for non-absolutely positioned containers.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('block-container.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('area-properties-unheritable')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('box-size-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('block-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('container-position.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('z-index.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Properties of inline formatting objects.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Unicode bidi-override')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: This element is 'half-inline' accroding to spec, since it's exhibits the same ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# bahavior and used in the same context but yet cannot carry some of inline-level')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# properties such as margins and border.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# We use the same set of properties as for inline here (except for unicode-bidi and')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# width properties) since we believe that this is a typical inline element.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Moreover fo:bidi-override is redundant from semantic point of view since it do not ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# carry any additional information compared to regular fo:inline - just add')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'unicode-bidi' to fo:inline and you do not need fo:bidi-override anymore.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('bidi-override.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inline-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('unicode-bidi.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: 'Folint' believes that direction property is required for fo:bidi-override,')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# but this is against the spec since this property can be inherited.')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Single character')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('character.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('character.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('suppress-at-line-break.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('treat-as-word-space.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('common-inline-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Initial property set specifies properties for one or more lines')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: Spec is contradictory here. It states that use of this object is equivalent to')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# the fo:wrapper around the first line. At the same time spec allows on this element')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# such properties as 'Common Border, Padding, and Background Properties' ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# - fo:wrapper can't have border/padding/etc and can bear inheritable properties only.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# We believe that this element should be treated as inline and thus should have')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# appropriate properties set.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('initial-property-set.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('common-inline-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# External graphic')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('external-graphic.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('graphic-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('src.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n  \n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# In-stream graphic')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('instream-foreign-object.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('graphic-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Inline')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('inline.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('height-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inline-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Inline container')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# FIXME! We believe that this element should not bear not-inheritable properties,')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# which applies to text since it can't have text children.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Therefor we do not use 'common-inline-properties' set.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('inline-container.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('id.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('rx-key.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('accessibility-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('aural-properties-unheritable')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('area-alignment-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('border-padding-background-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('keeps-properties-atomic')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('margin-properties-inline')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('relative-position-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('  \n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('area-properties-unheritable')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('box-size-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n  \n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Leader')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('leader.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('inline-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: Note that 'inline-properties' includes block-level inheritable properties.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# But it's OK in our content-model since it allows block-level descendants wrapped')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# into fo:inline-container.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# At the same time block-level inheritable properties includes leader properties,')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# since they are inheritable... ')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Page Number')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('page-number.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('common-inline-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('wrap-option.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Page number citation')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('page-number-citation.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('common-inline-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('wrap-option.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('ref-id.attr')
+      PsiWhiteSpace('\n  \n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Atomic elements for index ranges markup')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('begin-index-range.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('id.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('rx-key.attr')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('end-index-range.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('ref-id.attr')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Page number list - index entry')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('page-index.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('common-inline-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('wrap-option.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('list-separator.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('ref-key.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: There is no 'ref-key' attribute on page-index now, but it is allowed for ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# backward compatibility.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: Actually it makes sense to exclude id/rx:key fom the set of availabe properties ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# for 'index-item', however we prefer no to do it just to avoid creation of yet another content')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# model (attribute set) for thid inline element.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('index-item.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('common-inline-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('wrap-option.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('ref-key.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('link-back.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('range-separator.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('merge-subsequent-page-numbers.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Properties of table formatting objects.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Table & Caption.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-and-caption.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('common-block-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('clear.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('relative-position-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('keeps-and-breaks-properties-atomic')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: Spec do not allows margins on fo:table-caption that is against common sence ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# since this is a typical container.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# We do allow margins (they are included in common-block-properties).')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'Folint' does the same.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-caption.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('clear.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('common-block-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('relative-position-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('box-size-properties')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('clear.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('common-block-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('box-size-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('keeps-and-breaks-properties-atomic')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('table-properties-unheritable')
+      PsiWhiteSpace('\n  \n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Table column specifies common properties to ascribe to all')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# cells in a column *or a group of columns*. Note that, if both')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'number-columns-repeated' and 'number-columns-spanned' exceed')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 1, the column counter is increased by 'number-columns-spanned'.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# it means that you only set properties for columns:')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'column-number'')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'column-number' + 'number-columns-spanned'')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'column-number' + 2 * 'number-columns-spanned'')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# and so on, leaving default properties for intermediate columns.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-column.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('column-number.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('column-width.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('number-columns-repeated.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('number-columns-spanned.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('background-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n')
+          PsiComment(SINGLE_LINE_COMMENT)('#MEMO: Border properties applies to this formatting object only if the value of border-collapse')
+          PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# for the table is "collapse" or "collapse-with-precedence" ')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('border-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('border-precedence-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Table header, table footer, and table body.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('row-group.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('id.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('rx-key.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('accessibility-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('aural-properties-unheritable')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('background-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n')
+          PsiComment(SINGLE_LINE_COMMENT)('#MEMO: Border properties applies to this formatting object only if the value of border-collapse')
+          PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# for the table is "collapse" or "collapse-with-precedence" ')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('border-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('border-precedence-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('relative-position-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-header.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('row-group.attlist')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-footer.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('row-group.attlist')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('#MEMO: Spec do not list "Keep" properties almong applicable to fo:table-body that is a clear')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# case of  errata.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-body.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('row-group.attlist')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('keeps-and-breaks-properties-atomic')
+      PsiWhiteSpace('\n  \n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Table row.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: Should we create separate collection of properties in 'properties_groups.rnc'')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# based on row-group.attlist?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-row.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('row-group.attlist')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('height-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('keeps-and-breaks-properties-atomic')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Table cell.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: Spec do not allows margins on fo:table-cell but 'Folint' does.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# We excluded margins from this element and therefor don't use 'common-block-properties'')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: Spec do not list "Keep" properties almong applicable to fo:table-cell that is a clear')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# case of  errata.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('table-cell.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('id.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('rx-key.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('column-number.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('accessibility-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('aural-properties-unheritable')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('border-padding-background-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('border-precedence-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('box-size-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('ends-row.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('keeps-and-breaks-properties-atomic')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('number-columns-spanned.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('number-rows-spanned.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('starts-row.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n  \n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Properties of list formatting objects.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================  ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# List block.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('list-block.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('clear.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('common-block-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('keeps-and-breaks-properties-atomic')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('relative-position-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# List item.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('list-item.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('common-block-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('keeps-and-breaks-properties-atomic')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('relative-position-properties')
+      PsiWhiteSpace('  \n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# List item label and list item body')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('list-item-label.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('id.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('rx-key.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('accessibility-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('list-item-body.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('id.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('rx-key.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('accessibility-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n  \n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Floats and footnotes.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: Outlines can't have id and therefor can't have rx:key properties so we are strict here.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# 'Folint' is loose here - it allows use of these properties.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: We are forced to create two types of floats: side-floats and before-floats.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('side-float.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('side-float.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('clear.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# NOTE: before-float can't bear 'clear' property')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('before-float.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('before-float.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('footnote.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('accessibility-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('footnote-body.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('accessibility-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Simple link.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('basic-link.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inline-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('external-destination.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('internal-destination.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('indicate-destination.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('show-destination.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('destination-placement-offset.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('target-processing-context.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('target-presentation-context.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('target-stylesheet.attr')
+            PsiElement(?)('?')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Wrappers.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('wrapper.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('id.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('rx-key.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Marker. This element may embrace any content but cannot pass')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# properties to its children; so, it may not have features other')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# than marker-class-name.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: We are more strict here making marker-class-name attribute a mandatory,')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# but marker with no marker-class-name is meaningless.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('marker.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('marker-class-name.attr')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Marker retrieval.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# FIXME! We are more strict here making retrieve-class-name attribute a mandatory, ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# but marker with no retrieve-class-name is meaningless.')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('retrieve-marker.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('retrieve-class-name.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('retrieve-position.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('retrieve-boundary.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          PsiComment(SINGLE_LINE_COMMENT)('#MEMO: Is it OK to allow inheritable properties here? There are no explicit arguments')
+          PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n  # against it in the spec.')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Multistate stuff.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Switch. ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: Should we have Aural Properties here as well?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-switch.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('id.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('rx-key.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('auto-restore.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('accessibility-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Single case.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-case.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('id.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('rx-key.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('starting-state.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('case-name.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('case-title.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('accessibility-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n  \n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Toggle. ')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#MEMO: Should we have here inline-level properties only?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-toggle.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('switch-to.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('accessibility-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n\n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Multi-properties.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#Should we allow here any possible properties applicable to the objects inside of the flow?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-properties.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' \n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('id.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('rx-key.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('accessibility-properties')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
+      PsiWhiteSpace('\n  \n')
+      PsiComment(SINGLE_LINE_COMMENT)('# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# Multi property set.')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n# ===============================================================')
+      PsiComment(SINGLE_LINE_COMMENT_CONTINUE)('\n#Should we allow here any possible properties applicable to the objects inside of the flow?')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('multi-property-set.attlist')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('id.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('rx-key.attr')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('active-state.attr')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('inheritable-properties')
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/complex/RelaxNG.rnc b/xml/relaxng/testData/parsing/psi/complex/RelaxNG.rnc
new file mode 100644
index 0000000..42d253d
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/RelaxNG.rnc
@@ -0,0 +1,63 @@
+# RELAX NG XML syntax specified in compact syntax.
+
+default namespace rng = "http://relaxng.org/ns/structure/1.0"
+namespace local = ""
+datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
+
+start = pattern
+
+pattern =
+  element element { (nameQName | nameClass), (common & pattern+) }
+  | element attribute { (nameQName | nameClass), (common & pattern?) }
+  | element group|interleave|choice|optional
+            |zeroOrMore|oneOrMore|list|mixed { common & pattern+ }
+  | element ref|parentRef { nameNCName, common }
+  | element empty|notAllowed|text { common }
+  | element data { type, param*, (common & exceptPattern?) }
+  | element value { commonAttributes, type?, xsd:string }
+  | element externalRef { href, common }
+  | element grammar { common & grammarContent* }
+
+param = element param { commonAttributes, nameNCName, xsd:string }
+
+exceptPattern = element except { common & pattern+ }
+
+grammarContent =
+  definition
+  | element div { common & grammarContent* }
+  | element include { href, (common & includeContent*) }
+
+includeContent =
+  definition
+  | element div { common & includeContent* }
+
+definition =
+  element start { combine?, (common & pattern+) }
+  | element define { nameNCName, combine?, (common & pattern+) }
+
+combine = attribute combine { "choice" | "interleave" }
+
+nameClass =
+  element name { commonAttributes, xsd:QName }
+  | element anyName { common & exceptNameClass? }
+  | element nsName { common & exceptNameClass? }
+  | element choice { common & nameClass+ }
+
+exceptNameClass = element except { common & nameClass+ }
+
+nameQName = attribute name { xsd:QName }
+nameNCName = attribute name { xsd:NCName }
+href = attribute href { xsd:anyURI }
+type = attribute type { xsd:NCName }
+
+common = commonAttributes, foreignElement*
+
+commonAttributes =
+  attribute ns { xsd:string }?,
+  attribute datatypeLibrary { xsd:anyURI }?,
+  foreignAttribute*
+
+foreignElement = element * - rng:* { (anyAttribute | text | anyElement)* }
+foreignAttribute = attribute * - (rng:*|local:*) { text }
+anyElement = element * { (anyAttribute | text | anyElement)* }
+anyAttribute = attribute * { text }
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/complex/RelaxNG.txt b/xml/relaxng/testData/parsing/psi/complex/RelaxNG.txt
new file mode 100644
index 0000000..03e21e7
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/RelaxNG.txt
@@ -0,0 +1,953 @@
+RncFileImpl:RelaxNG.rnc
+  PsiComment(SINGLE_LINE_COMMENT)('# RELAX NG XML syntax specified in compact syntax.')
+  PsiWhiteSpace('\n\n')
+  DOCUMENT
+    NS_DECL
+      PsiElement(KEYWORD_DEFAULT)('default')
+      PsiWhiteSpace(' ')
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('rng')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://relaxng.org/ns/structure/1.0"')
+    PsiWhiteSpace('\n')
+    NS_DECL
+      PsiElement(KEYWORD_NAMESPACE)('namespace')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('local')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('""')
+    PsiWhiteSpace('\n')
+    DATATYPES_DECL
+      PsiElement(KEYWORD_DATATYPES)('datatypes')
+      PsiWhiteSpace(' ')
+      PsiElement(IDENTIFIER)('xsd')
+      PsiWhiteSpace(' ')
+      PsiElement(=)('=')
+      PsiWhiteSpace(' ')
+      PsiElement(LITERAL)('"http://www.w3.org/2001/XMLSchema-datatypes"')
+    PsiWhiteSpace('\n\n')
+    GRAMMAR_PATTERN
+      START
+        PsiElement(KEYWORD_START)('start')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        REF_PATTERN
+          PsiElement(IDENTIFIER)('pattern')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('pattern')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('nameQName')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('nameClass')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                INTERLEAVE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('common')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('pattern')
+                    PsiElement(+)('+')
+                PsiElement())(')')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              GROUP_PATTERN
+                PsiElement(()('(')
+                CHOICE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('nameQName')
+                  PsiWhiteSpace(' ')
+                  PsiElement(|)('|')
+                  PsiWhiteSpace(' ')
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('nameClass')
+                PsiElement())(')')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                INTERLEAVE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('common')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  OPTIONAL
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('pattern')
+                    PsiElement(?)('?')
+                PsiElement())(')')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS_CHOICE
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('group')
+              PsiElement(|)('|')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('interleave')
+              PsiElement(|)('|')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('choice')
+              PsiElement(|)('|')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('optional')
+              PsiWhiteSpace('\n            ')
+              PsiElement(|)('|')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('zeroOrMore')
+              PsiElement(|)('|')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('oneOrMore')
+              PsiElement(|)('|')
+              NAME_CLASS
+                PsiElement(KEYWORD_LIST)('list')
+              PsiElement(|)('|')
+              NAME_CLASS
+                PsiElement(KEYWORD_MIXED)('mixed')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            INTERLEAVE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('common')
+              PsiWhiteSpace(' ')
+              PsiElement(&)('&')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('pattern')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS_CHOICE
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('ref')
+              PsiElement(|)('|')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('parentRef')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('nameNCName')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('common')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS_CHOICE
+              NAME_CLASS
+                PsiElement(KEYWORD_EMPTY)('empty')
+              PsiElement(|)('|')
+              NAME_CLASS
+                PsiElement(KEYWORD_NOTALLOWED)('notAllowed')
+              PsiElement(|)('|')
+              NAME_CLASS
+                PsiElement(KEYWORD_TEXT)('text')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('common')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('data')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('type')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('param')
+                PsiElement(*)('*')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                INTERLEAVE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('common')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  OPTIONAL
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('exceptPattern')
+                    PsiElement(?)('?')
+                PsiElement())(')')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('value')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('commonAttributes')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('type')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              DATATYPE_PATTERN
+                NAME
+                  PsiElement(PREFIXED_NAME)('xsd:string')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('externalRef')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('href')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('common')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(KEYWORD_GRAMMAR)('grammar')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            INTERLEAVE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('common')
+              PsiWhiteSpace(' ')
+              PsiElement(&)('&')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('grammarContent')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('param')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('param')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          SEQUENCE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('commonAttributes')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('nameNCName')
+            PsiElement(,)(',')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              NAME
+                PsiElement(PREFIXED_NAME)('xsd:string')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('exceptPattern')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('except')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('common')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            ONE_OR_MORE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('pattern')
+              PsiElement(+)('+')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('grammarContent')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('definition')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(KEYWORD_DIV)('div')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            INTERLEAVE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('common')
+              PsiWhiteSpace(' ')
+              PsiElement(&)('&')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('grammarContent')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(KEYWORD_INCLUDE)('include')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('href')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                INTERLEAVE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('common')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  ZERO_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('includeContent')
+                    PsiElement(*)('*')
+                PsiElement())(')')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('includeContent')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('definition')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(KEYWORD_DIV)('div')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            INTERLEAVE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('common')
+              PsiWhiteSpace(' ')
+              PsiElement(&)('&')
+              PsiWhiteSpace(' ')
+              ZERO_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('includeContent')
+                PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('definition')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(KEYWORD_START)('start')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('combine')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                INTERLEAVE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('common')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('pattern')
+                    PsiElement(+)('+')
+                PsiElement())(')')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('define')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('nameNCName')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('combine')
+                PsiElement(?)('?')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              GROUP_PATTERN
+                PsiElement(()('(')
+                INTERLEAVE
+                  REF_PATTERN
+                    PsiElement(IDENTIFIER)('common')
+                  PsiWhiteSpace(' ')
+                  PsiElement(&)('&')
+                  PsiWhiteSpace(' ')
+                  ONE_OR_MORE
+                    REF_PATTERN
+                      PsiElement(IDENTIFIER)('pattern')
+                    PsiElement(+)('+')
+                PsiElement())(')')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('combine')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('combine')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          CHOICE
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"choice"')
+            PsiWhiteSpace(' ')
+            PsiElement(|)('|')
+            PsiWhiteSpace(' ')
+            DATATYPE_PATTERN
+              PsiElement(LITERAL)('"interleave"')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('nameClass')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        CHOICE
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('name')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            SEQUENCE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('commonAttributes')
+              PsiElement(,)(',')
+              PsiWhiteSpace(' ')
+              DATATYPE_PATTERN
+                NAME
+                  PsiElement(PREFIXED_NAME)('xsd:QName')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('anyName')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            INTERLEAVE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('common')
+              PsiWhiteSpace(' ')
+              PsiElement(&)('&')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('exceptNameClass')
+                PsiElement(?)('?')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('nsName')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            INTERLEAVE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('common')
+              PsiWhiteSpace(' ')
+              PsiElement(&)('&')
+              PsiWhiteSpace(' ')
+              OPTIONAL
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('exceptNameClass')
+                PsiElement(?)('?')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+          PsiWhiteSpace('\n  ')
+          PsiElement(|)('|')
+          PsiWhiteSpace(' ')
+          PATTERN
+            PsiElement(KEYWORD_ELEMENT)('element')
+            PsiWhiteSpace(' ')
+            NAME_CLASS
+              PsiElement(IDENTIFIER)('choice')
+            PsiWhiteSpace(' ')
+            PsiElement({)('{')
+            PsiWhiteSpace(' ')
+            INTERLEAVE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('common')
+              PsiWhiteSpace(' ')
+              PsiElement(&)('&')
+              PsiWhiteSpace(' ')
+              ONE_OR_MORE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('nameClass')
+                PsiElement(+)('+')
+            PsiWhiteSpace(' ')
+            PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('exceptNameClass')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('except')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          INTERLEAVE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('common')
+            PsiWhiteSpace(' ')
+            PsiElement(&)('&')
+            PsiWhiteSpace(' ')
+            ONE_OR_MORE
+              REF_PATTERN
+                PsiElement(IDENTIFIER)('nameClass')
+              PsiElement(+)('+')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('nameQName')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('name')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:QName')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('nameNCName')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('name')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:NCName')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('href')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('href')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:anyURI')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('type')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(IDENTIFIER)('type')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          DATATYPE_PATTERN
+            NAME
+              PsiElement(PREFIXED_NAME)('xsd:NCName')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('common')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        SEQUENCE
+          REF_PATTERN
+            PsiElement(IDENTIFIER)('commonAttributes')
+          PsiElement(,)(',')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('foreignElement')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('commonAttributes')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace('\n  ')
+        SEQUENCE
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('ns')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              DATATYPE_PATTERN
+                NAME
+                  PsiElement(PREFIXED_NAME)('xsd:string')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          OPTIONAL
+            PATTERN
+              PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(IDENTIFIER)('datatypeLibrary')
+              PsiWhiteSpace(' ')
+              PsiElement({)('{')
+              PsiWhiteSpace(' ')
+              DATATYPE_PATTERN
+                NAME
+                  PsiElement(PREFIXED_NAME)('xsd:anyURI')
+              PsiWhiteSpace(' ')
+              PsiElement(})('}')
+            PsiElement(?)('?')
+          PsiElement(,)(',')
+          PsiWhiteSpace('\n  ')
+          ZERO_OR_MORE
+            REF_PATTERN
+              PsiElement(IDENTIFIER)('foreignAttribute')
+            PsiElement(*)('*')
+      PsiWhiteSpace('\n\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('foreignElement')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            EXCEPT_NAME_CLASS
+              PsiElement(-)('-')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                NAME
+                  PsiElement(PREFIX_STAR)('rng:*')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            GROUP_PATTERN
+              PsiElement(()('(')
+              CHOICE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('anyAttribute')
+                PsiWhiteSpace(' ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                TEXT_PATTERN
+                  PsiElement(KEYWORD_TEXT)('text')
+                PsiWhiteSpace(' ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('anyElement')
+              PsiElement())(')')
+            PsiElement(*)('*')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('foreignAttribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(*)('*')
+            PsiWhiteSpace(' ')
+            EXCEPT_NAME_CLASS
+              PsiElement(-)('-')
+              PsiWhiteSpace(' ')
+              NAME_CLASS
+                PsiElement(()('(')
+                NAME_CLASS_CHOICE
+                  NAME_CLASS
+                    NAME
+                      PsiElement(PREFIX_STAR)('rng:*')
+                  PsiElement(|)('|')
+                  NAME_CLASS
+                    NAME
+                      PsiElement(PREFIX_STAR)('local:*')
+                PsiElement())(')')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('anyElement')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ELEMENT)('element')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(*)('*')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          ZERO_OR_MORE
+            GROUP_PATTERN
+              PsiElement(()('(')
+              CHOICE
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('anyAttribute')
+                PsiWhiteSpace(' ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                TEXT_PATTERN
+                  PsiElement(KEYWORD_TEXT)('text')
+                PsiWhiteSpace(' ')
+                PsiElement(|)('|')
+                PsiWhiteSpace(' ')
+                REF_PATTERN
+                  PsiElement(IDENTIFIER)('anyElement')
+              PsiElement())(')')
+            PsiElement(*)('*')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
+      PsiWhiteSpace('\n')
+      DEFINE
+        PsiElement(IDENTIFIER)('anyAttribute')
+        PsiWhiteSpace(' ')
+        PsiElement(=)('=')
+        PsiWhiteSpace(' ')
+        PATTERN
+          PsiElement(KEYWORD_ATTRIBUTE)('attribute')
+          PsiWhiteSpace(' ')
+          NAME_CLASS
+            PsiElement(*)('*')
+          PsiWhiteSpace(' ')
+          PsiElement({)('{')
+          PsiWhiteSpace(' ')
+          TEXT_PATTERN
+            PsiElement(KEYWORD_TEXT)('text')
+          PsiWhiteSpace(' ')
+          PsiElement(})('}')
\ No newline at end of file
diff --git a/xml/relaxng/testData/parsing/psi/complex/basic_properties.rnc b/xml/relaxng/testData/parsing/psi/complex/basic_properties.rnc
new file mode 100644
index 0000000..ed2ce42
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/basic_properties.rnc
@@ -0,0 +1,648 @@
+# =========================================================
+#                                                          
+# (c) 2004, RenderX                                        
+#                                                          
+# Author: Alexander Peshkov <[email protected]>          
+#                                                          
+# Permission is granted to use this document, copy and     
+# modify free of charge, provided that every derived work  
+# bear a reference to the present document.                
+#                                                          
+# This document contains a computer program written in     
+# XSL Transformations Language. It is published with no    
+# warranty of any kind about its usability, as a mere      
+# example of XSL technology. RenderX shall not be          
+# considered liable for any damage or loss of data caused  
+# by use of this program.                                  
+#                                                          
+# =========================================================
+
+namespace local = ""
+default namespace fo = "http://www.w3.org/1999/XSL/Format"
+namespace rx = "http://www.renderx.com/XSL/Extensions"
+
+include "datatype.rnc"
+
+# ===============================================================   
+# Common properties content models used by several attributes
+# ===============================================================   
+border-style.attr-content =
+    "none"
+    | "hidden"
+    | "dotted"
+    | "dashed"
+    | "solid"
+    | "double"
+    | "groove"
+    | "ridge"
+    | "inset"
+    | "outset"
+    | "inherit"
+
+orientation.attr-content =
+    "0"
+    | "90"
+    | "180"
+    | "270"
+    | "-90"
+    | "-180"
+    | "-270"
+    | "0deg"
+    | "90deg"
+    | "180deg"
+    | "270deg"
+    | "-90deg"
+    | "-180deg"
+    | "-270deg"
+    | "inherit"
+
+keep.attr-content = "auto" | "always" | integer.datatype
+
+# ===============================================================   
+# Definitions of all the attributes (properties) used in XSL FO
+# includeing those from RX extensions
+# (definitions of attributes bearing 'rx' namespace named as rx-...,
+# but sorted according to the actual attribute name)
+# ===============================================================
+absolute-position.attr = attribute absolute-position { 
+    "absolute" | "fixed" 
+   }
+#MEMO: We forced to separate this property from actual 'absolute-position'
+container-position.attr = attribute absolute-position { 
+    "auto" | "inherit" | expr.datatype 
+   }
+
+active-state.attr = attribute active-state { 
+    "link" | "visited" | "active" | "hover" | "focus" | expr.datatype 
+   }
+alignment-adjust.attr = attribute alignment-adjust {  text | expr.datatype }
+alignment-baseline.attr = attribute alignment-baseline { 
+    "auto"
+    | "baseline"
+    | "before-edge"
+    | "text-before-edge"
+    | "middle"
+    | "central"
+    | "after-edge"
+    | "text-after-edge"
+    | "top"
+    | "text-top"
+    | "bottom"
+    | "text-bottom"
+    | "ideographic"
+    | "alphabetic"
+    | "hanging"
+    | "mathematical"
+    | "inherit"
+    | expr.datatype 
+   }
+auto-restore.attr = attribute auto-restore {  "true" | "false" | expr.datatype }
+azimuth.attr = attribute azimuth {  text | expr.datatype }
+background.attr = attribute background {  text | expr.datatype }
+background-attachment.attr = attribute background-attachment {  "scroll" | "fixed" | "inherit" | expr.datatype }
+background-color.attr = attribute background-color {  text | expr.datatype }
+background-image.attr = attribute background-image {  text | expr.datatype }
+background-position.attr = attribute background-position {  text | expr.datatype }
+background-position-horizontal.attr = attribute background-position-horizontal {  text | expr.datatype }
+background-position-vertical.attr = attribute background-position-vertical {  text | expr.datatype }
+background-repeat.attr = attribute background-repeat { 
+    "repeat" | "repeat-x" | "repeat-y" | "no-repeat" | "inherit" | expr.datatype 
+   }
+#RenderX extension attributes
+rx-background-content-type.attr = attribute rx:background-content-type { text | expr.datatype  }
+rx-background-content-height.attr = attribute rx:background-content-height { text | expr.datatype  }
+rx-background-content-width.attr = attribute rx:background-content-width { text | expr.datatype  }
+rx-background-scaling.attr = attribute rx:background-scaling { "uniform" | "non-uniform" | expr.datatype  }
+
+baseline-shift.attr = attribute baseline-shift {  text | expr.datatype }
+blank-or-not-blank.attr = attribute blank-or-not-blank { 
+    "blank" | "not-blank" | "any" | "inherit" | expr.datatype 
+   }
+block-progression-dimension.attr = attribute block-progression-dimension {  text | expr.datatype }
+block-progression-dimension.maximum.attr = attribute block-progression-dimension.maximum {  text | expr.datatype }
+block-progression-dimension.minimum.attr = attribute block-progression-dimension.minimum {  text | expr.datatype }
+block-progression-dimension.optimum.attr = attribute block-progression-dimension.optimum {  text | expr.datatype }
+border.attr = attribute border {  text | expr.datatype }
+border-after-color.attr = attribute border-after-color {  text | expr.datatype }
+border-after-precedence.attr = attribute border-after-precedence {  text | expr.datatype }
+border-after-style.attr = attribute border-after-style { border-style.attr-content | expr.datatype  }
+border-after-width.attr = attribute border-after-width {  text | expr.datatype }
+border-after-width.conditionality.attr = attribute border-after-width.conditionality {  "discard" | "retain" | expr.datatype }
+border-after-width.length.attr = attribute border-after-width.length {  text | expr.datatype }
+border-before-color.attr = attribute border-before-color {  text | expr.datatype }
+border-before-precedence.attr = attribute border-before-precedence {  text | expr.datatype }
+border-before-style.attr = attribute border-before-style { border-style.attr-content | expr.datatype  }
+border-before-width.attr = attribute border-before-width {  text | expr.datatype }
+border-before-width.conditionality.attr = attribute border-before-width.conditionality { 
+    "discard" | "retain" | expr.datatype 
+   }
+border-before-width.length.attr = attribute border-before-width.length {  text | expr.datatype }
+border-bottom.attr = attribute border-bottom {  text | expr.datatype }
+border-bottom-color.attr = attribute border-bottom-color {  text | expr.datatype }
+border-bottom-style.attr = attribute border-bottom-style { border-style.attr-content | expr.datatype  }
+border-bottom-width.attr = attribute border-bottom-width {  text | expr.datatype }
+border-bottom-width.conditionality.attr = attribute border-bottom-width.conditionality { 
+    "discard" | "retain" | expr.datatype 
+   }
+border-bottom-width.length.attr = attribute border-bottom-width.length {  text | expr.datatype }
+border-collapse.attr = attribute border-collapse { 
+    "collapse" | "collapse-with-precedence" | "separate" | "inherit" | expr.datatype 
+   }
+border-color.attr = attribute border-color {  text | expr.datatype }
+border-end-color.attr = attribute border-end-color {  text | expr.datatype }
+border-end-precedence.attr = attribute border-end-precedence {  text | expr.datatype }
+border-end-style.attr = attribute border-end-style { border-style.attr-content | expr.datatype  }
+border-end-width.attr = attribute border-end-width {  text | expr.datatype }
+border-end-width.conditionality.attr = attribute border-end-width.conditionality {  "discard" | "retain" | expr.datatype }
+border-end-width.length.attr = attribute border-end-width.length {  text | expr.datatype }
+border-left.attr = attribute border-left {  text | expr.datatype }
+border-left-color.attr = attribute border-left-color {  text | expr.datatype }
+border-left-style.attr = attribute border-left-style { border-style.attr-content | expr.datatype  }
+border-left-width.attr = attribute border-left-width {  text | expr.datatype }
+border-left-width.conditionality.attr = attribute border-left-width.conditionality {  "discard" | "retain" | expr.datatype }
+border-left-width.length.attr = attribute border-left-width.length {  text | expr.datatype }
+border-right.attr = attribute border-right {  text | expr.datatype }
+border-right-color.attr = attribute border-right-color {  text | expr.datatype }
+border-right-style.attr = attribute border-right-style { border-style.attr-content | expr.datatype }
+border-right-width.attr = attribute border-right-width {  text | expr.datatype }
+border-right-width.conditionality.attr = attribute border-right-width.conditionality {  "discard" | "retain" | expr.datatype }
+border-right-width.length.attr = attribute border-right-width.length {  text | expr.datatype }
+border-separation.attr = attribute border-separation {  text | expr.datatype }
+border-separation.block-progression-direction.attr = attribute border-separation.block-progression-direction {  text | expr.datatype }
+border-separation.inline-progression-direction.attr = attribute border-separation.inline-progression-direction {  text | expr.datatype }
+border-spacing.attr = attribute border-spacing {  text | expr.datatype }
+border-start-color.attr = attribute border-start-color {  text | expr.datatype }
+border-start-precedence.attr = attribute border-start-precedence {  text | expr.datatype }
+border-start-style.attr = attribute border-start-style { border-style.attr-content | expr.datatype  }
+border-start-width.attr = attribute border-start-width {  text | expr.datatype }
+border-start-width.conditionality.attr = attribute border-start-width.conditionality {  "discard" | "retain" | expr.datatype }
+border-start-width.length.attr = attribute border-start-width.length {  text | expr.datatype }
+border-style.attr = attribute border-style {  text | expr.datatype }
+border-top.attr = attribute border-top {  text | expr.datatype }
+border-top-color.attr = attribute border-top-color {  text | expr.datatype }
+border-top-style.attr = attribute border-top-style { border-style.attr-content | expr.datatype  }
+border-top-width.attr = attribute border-top-width {  text | expr.datatype }
+border-top-width.conditionality.attr = attribute border-top-width.conditionality {  "discard" | "retain" | expr.datatype }
+border-top-width.length.attr = attribute border-top-width.length {  text | expr.datatype }
+border-width.attr = attribute border-width {  text | expr.datatype }
+bottom.attr = attribute bottom {  text | expr.datatype }
+break-after.attr = attribute break-after { 
+    "auto" | "column" | "page" | "even-page" | "odd-page" | "inherit" | expr.datatype 
+   }
+break-before.attr = attribute break-before { 
+    "auto" | "column" | "page" | "even-page" | "odd-page" | "inherit" | expr.datatype 
+   }
+caption-side.attr = attribute caption-side { 
+    "before"
+    | "after"
+    | "start"
+    | "end"
+    | "top"
+    | "bottom"
+    | "left"
+    | "right"
+    | "inherit"
+    | expr.datatype 
+   }
+case-name.attr = attribute case-name {  text | expr.datatype }
+case-title.attr = attribute case-title {  text | expr.datatype }
+character.attr = attribute character {  text  }
+clear.attr = attribute clear { 
+    "start" | "end" | "left" | "right" | "both" | "none" | "inherit" | expr.datatype 
+   }
+clip.attr = attribute clip {  shape.datatype | "auto" | "inherit" | expr.datatype }
+collapse-subtree.attr = attribute collapse-subtree { "true" | "false" | expr.datatype  }
+color.attr = attribute color {  text | expr.datatype }
+color-profile-name.attr = attribute color-profile-name {  text  }
+column-count.attr = attribute column-count {  text | expr.datatype }
+column-gap.attr = attribute column-gap {  text | expr.datatype }
+column-number.attr = attribute column-number {  text | expr.datatype }
+column-width.attr = attribute column-width {  text | expr.datatype }
+content-height.attr = attribute content-height {  text | expr.datatype }
+content-type.attr = attribute content-type {  text | expr.datatype }
+content-width.attr = attribute content-width {  text | expr.datatype }
+country.attr = attribute country {  text | expr.datatype }
+cue.attr = attribute cue {  text | expr.datatype }
+cue-after.attr = attribute cue-after {  text | expr.datatype }
+cue-before.attr = attribute cue-before {  text | expr.datatype }
+destination-placement-offset.attr = attribute destination-placement-offset {  text | expr.datatype }
+direction.attr = attribute direction {  "ltr" | "rtl" | "inherit" | expr.datatype }
+display-align.attr = attribute display-align { 
+    "auto" | "before" | "center" | "after" | "inherit" | expr.datatype 
+   }
+dominant-baseline.attr = attribute dominant-baseline { 
+    "auto"
+    | "use-script"
+    | "no-change"
+    | "reset-size"
+    | "ideographic"
+    | "alphabetic"
+    | "hanging"
+    | "mathematical"
+    | "central"
+    | "middle"
+    | "text-after-edge"
+    | "text-before-edge"
+    | "inherit"
+    | expr.datatype 
+   }
+elevation.attr = attribute elevation {  text | expr.datatype }
+empty-cells.attr = attribute empty-cells {  "show" | "hide" | "inherit" | expr.datatype }
+end-indent.attr = attribute end-indent {  text | expr.datatype }
+ends-row.attr = attribute ends-row {  "true" | "false" | expr.datatype }
+extent.attr = attribute extent {  text | expr.datatype }
+external-destination.attr = attribute external-destination {  text | expr.datatype }
+#MEMO: We have separated this property into the two (for side and before floats)
+#MEMO: Float values "inside" and "outside" are RenderX extensions.
+before-float.attr = attribute float { 
+    "before"
+   }
+side-float.attr = attribute float { 
+    "start" | "end" | "left" | "right" | "none" | "inside" | "outside" | "inherit" | expr.datatype 
+   }
+ flow-name.attr = attribute flow-name {  text  }
+font.attr = attribute font {  text | expr.datatype }
+font-family.attr = attribute font-family {  text | expr.datatype }
+font-selection-strategy.attr = attribute font-selection-strategy { 
+    "auto" | "character-by-character" | "inherit" | expr.datatype 
+   }
+font-size.attr = attribute font-size {  text | expr.datatype }
+font-size-adjust.attr = attribute font-size-adjust {  text | expr.datatype }
+font-stretch.attr = attribute font-stretch { 
+    "normal"
+    | "wider"
+    | "narrower"
+    | "ultra-condensed"
+    | "extra-condensed"
+    | "condensed"
+    | "semi-condensed"
+    | "semi-expanded"
+    | "expanded"
+    | "extra-expanded"
+    | "ultra-expanded"
+    | "inherit"
+    | expr.datatype 
+   }
+font-style.attr = attribute font-style { 
+    "normal" | "italic" | "oblique" | "backslant" | "inherit" | expr.datatype 
+   }
+font-variant.attr = attribute font-variant {  "normal" | "small-caps" | "inherit" | expr.datatype }
+font-weight.attr = attribute font-weight { 
+    "normal"
+    | "bold"
+    | "bolder"
+    | "lighter"
+    | "inherit"
+    | "100"
+    | "200"
+    | "300"
+    | "400"
+    | "500"
+    | "600"
+    | "700"
+    | "800"
+    | "900"
+    | expr.datatype 
+   }
+force-page-count.attr = attribute force-page-count { 
+    "auto"
+    | "even"
+    | "odd"
+    | "end-on-even"
+    | "end-on-odd"
+    | "no-force"
+    | "inherit"
+    | expr.datatype 
+   }
+format.attr = attribute format {  text  }
+glyph-orientation-horizontal.attr = attribute glyph-orientation-horizontal { orientation.attr-content | expr.datatype  } 
+glyph-orientation-vertical.attr = attribute glyph-orientation-vertical { orientation.attr-content | expr.datatype  } 
+grouping-separator.attr = attribute grouping-separator {  text  }
+grouping-size.attr = attribute grouping-size {  text | expr.datatype }
+height.attr = attribute height {  text | expr.datatype }
+hyphenate.attr = attribute hyphenate {  "false" | "true" | "inherit" | expr.datatype }
+hyphenation-character.attr = attribute hyphenation-character {  text  }
+hyphenation-keep.attr = attribute hyphenation-keep { 
+    "auto" | "column" | "page" | "inherit" | expr.datatype 
+   }
+hyphenation-ladder-count.attr = attribute hyphenation-ladder-count {  text | expr.datatype }
+hyphenation-push-character-count.attr = attribute hyphenation-push-character-count {  text | expr.datatype }
+hyphenation-remain-character-count.attr = attribute hyphenation-remain-character-count {  text | expr.datatype }
+id.attr = attribute id {  text  }
+indicate-destination.attr = attribute indicate-destination {  "true" | "false" | expr.datatype }
+initial-page-number.attr = attribute initial-page-number {  text | expr.datatype }
+inline-progression-dimension.attr = attribute inline-progression-dimension {  text | expr.datatype }
+inline-progression-dimension.maximum.attr = attribute inline-progression-dimension.maximum {  text | expr.datatype }
+inline-progression-dimension.minimum.attr = attribute inline-progression-dimension.minimum {  text | expr.datatype }
+inline-progression-dimension.optimum.attr = attribute inline-progression-dimension.optimum {  text | expr.datatype }
+internal-destination.attr = attribute internal-destination {  text  }
+intrusion-displace.attr = attribute intrusion-displace { 
+    "auto" | "none" | "line" | "indent" | "block" | "inherit" | expr.datatype 
+   }
+keep-together.attr = attribute keep-together {  keep.attr-content | expr.datatype }
+keep-together.within-column.attr = attribute keep-together.within-column {  keep.attr-content | expr.datatype }
+keep-together.within-line.attr = attribute keep-together.within-line {  keep.attr-content | expr.datatype }
+keep-together.within-page.attr = attribute keep-together.within-page {  keep.attr-content | expr.datatype }
+keep-with-next.attr = attribute keep-with-next {  keep.attr-content | expr.datatype }
+keep-with-next.within-column.attr = attribute keep-with-next.within-column {  keep.attr-content | expr.datatype }
+keep-with-next.within-line.attr = attribute keep-with-next.within-line {  keep.attr-content | expr.datatype }
+keep-with-next.within-page.attr = attribute keep-with-next.within-page {  keep.attr-content | expr.datatype }
+keep-with-previous.attr = attribute keep-with-previous {  keep.attr-content | expr.datatype }
+keep-with-previous.within-column.attr = attribute keep-with-previous.within-column {  keep.attr-content | expr.datatype }
+keep-with-previous.within-line.attr = attribute keep-with-previous.within-line {  keep.attr-content | expr.datatype }
+keep-with-previous.within-page.attr = attribute keep-with-previous.within-page {  keep.attr-content | expr.datatype }
+#RenderX extension attribute
+rx-key.attr = attribute rx:key { text }
+language.attr = attribute language {  text | expr.datatype }
+last-line-end-indent.attr = attribute last-line-end-indent {  text | expr.datatype }
+leader-alignment.attr = attribute leader-alignment { 
+    "none" | "reference-area" | "page" | "inherit" | expr.datatype 
+   }
+leader-length.attr = attribute leader-length {  text | expr.datatype }
+leader-length.maximum.attr = attribute leader-length.maximum {  text | expr.datatype }
+leader-length.minimum.attr = attribute leader-length.minimum {  text | expr.datatype }
+leader-length.optimum.attr = attribute leader-length.optimum {  text | expr.datatype }
+leader-pattern.attr = attribute leader-pattern { 
+    "space" | "rule" | "dots" | "use-content" | "inherit" | expr.datatype 
+   }
+leader-pattern-width.attr = attribute leader-pattern-width {  text | expr.datatype }
+left.attr = attribute left {  text | expr.datatype }
+letter-spacing.attr = attribute letter-spacing {  text | expr.datatype }
+letter-spacing.conditionality.attr = attribute letter-spacing.conditionality {  "retain" | "discard" | expr.datatype }
+letter-spacing.maximum.attr = attribute letter-spacing.maximum {  text | expr.datatype }
+letter-spacing.minimum.attr = attribute letter-spacing.minimum {  text | expr.datatype }
+letter-spacing.optimum.attr = attribute letter-spacing.optimum {  text | expr.datatype }
+letter-spacing.precedence.attr = attribute letter-spacing.precedence {  text | expr.datatype }
+letter-value.attr = attribute letter-value {  "auto" | "alphabetic" | "traditional" | expr.datatype }
+line-height.attr = attribute line-height {  text | expr.datatype }
+line-height-shift-adjustment.attr = attribute line-height-shift-adjustment {  text | expr.datatype }
+line-height.conditionality.attr = attribute line-height.conditionality {  "retain" | "discard" | expr.datatype }
+line-height.maximum.attr = attribute line-height.maximum {  text | expr.datatype }
+line-height.minimum.attr = attribute line-height.minimum {  text | expr.datatype }
+line-height.optimum.attr = attribute line-height.optimum {  text | expr.datatype }
+line-height.precedence.attr = attribute line-height.precedence {  text | expr.datatype }
+line-stacking-strategy.attr = attribute line-stacking-strategy { 
+    "line-height" | "font-height" | "max-height" | "inherit" | expr.datatype 
+   }
+linefeed-treatment.attr = attribute linefeed-treatment { 
+    "ignore"
+    | "preserve"
+    | "treat-as-space"
+    | "treat-as-zero-width-space"
+    | "inherit"
+    | expr.datatype 
+   }
+link-back.attr = attribute link-back {  text | expr.datatype }
+list-separator.attr = attribute list-separator {  text  }
+margin.attr = attribute margin {  text | expr.datatype }
+margin-bottom.attr = attribute margin-bottom {  text | expr.datatype }
+margin-left.attr = attribute margin-left {  text | expr.datatype }
+margin-right.attr = attribute margin-right {  text | expr.datatype }
+margin-top.attr = attribute margin-top {  text | expr.datatype }
+marker-class-name.attr = attribute marker-class-name {  text  }
+master-name.attr = attribute master-name {  text  }
+master-reference.attr = attribute master-reference {  text  }
+max-height.attr = attribute max-height {  text | expr.datatype }
+max-width.attr = attribute max-width {  text | expr.datatype }
+maximum-repeats.attr = attribute maximum-repeats {  text | expr.datatype }
+media-usage.attr = attribute media-usage { 
+    "auto" | "paginate" | "bounded-in-one-dimension" | "unbounded" | expr.datatype 
+   }
+merge-subsequent-page-numbers.attr = attribute merge-subsequent-page-numbers {  text | expr.datatype }
+min-height.attr = attribute min-height {  text | expr.datatype }
+min-width.attr = attribute min-width {  text | expr.datatype }
+#NOTE: It's RenderX extension attribute (belongs to rx:meta-field). It enumerates values currently available in XEP
+name.attr = attribute name { 
+    "author" | "title" | "subject" | "keywords" | expr.datatype 
+   }
+number-columns-repeated.attr = attribute number-columns-repeated {  text | expr.datatype }
+number-columns-spanned.attr = attribute number-columns-spanned {  text | expr.datatype }
+number-rows-spanned.attr = attribute number-rows-spanned {  text | expr.datatype }
+odd-or-even.attr = attribute odd-or-even {  "odd" | "even" | "any" | "inherit" | expr.datatype }
+rx-table-omit-initial-header.attr = attribute rx:table-omit-initial-header { "true" | "false" | expr.datatype  }
+orphans.attr = attribute orphans {  text | expr.datatype }
+overflow.attr = attribute overflow { 
+    "visible"
+    | "hidden"
+    | "scroll"
+    | "auto"
+    | "error-if-overflow"
+    | "inherit" | expr.datatype 
+   }
+padding.attr = attribute padding {  text | expr.datatype }
+padding-after.attr = attribute padding-after {  text | expr.datatype }
+padding-after.conditionality.attr = attribute padding-after.conditionality {  "discard" | "retain" | expr.datatype }
+padding-after.length.attr = attribute padding-after.length {  text | expr.datatype }
+padding-before.attr = attribute padding-before {  text | expr.datatype }
+padding-before.conditionality.attr = attribute padding-before.conditionality {  "discard" | "retain" | expr.datatype }
+padding-before.length.attr = attribute padding-before.length {  text | expr.datatype }
+padding-bottom.attr = attribute padding-bottom {  text | expr.datatype }
+padding-bottom.conditionality.attr = attribute padding-bottom.conditionality {  "discard" | "retain" | expr.datatype }
+padding-bottom.length.attr = attribute padding-bottom.length {  text | expr.datatype }
+padding-end.attr = attribute padding-end {  text | expr.datatype }
+padding-end.conditionality.attr = attribute padding-end.conditionality {  "discard" | "retain" | expr.datatype }
+padding-end.length.attr = attribute padding-end.length {  text | expr.datatype }
+padding-left.attr = attribute padding-left {  text | expr.datatype }
+padding-left.conditionality.attr = attribute padding-left.conditionality {  "discard" | "retain" | expr.datatype }
+padding-left.length.attr = attribute padding-left.length {  text | expr.datatype }
+padding-right.attr = attribute padding-right {  text | expr.datatype }
+padding-right.conditionality.attr = attribute padding-right.conditionality {  "discard" | "retain" | expr.datatype }
+padding-right.length.attr = attribute padding-right.length {  text | expr.datatype }
+padding-start.attr = attribute padding-start {  text | expr.datatype }
+padding-start.conditionality.attr = attribute padding-start.conditionality {  "discard" | "retain" | expr.datatype }
+padding-start.length.attr = attribute padding-start.length {  text | expr.datatype }
+padding-top.attr = attribute padding-top {  text | expr.datatype }
+padding-top.conditionality.attr = attribute padding-top.conditionality {  "discard" | "retain" | expr.datatype }
+padding-top.length.attr = attribute padding-top.length {  text | expr.datatype }
+page-break-after.attr = attribute page-break-after { 
+    "auto" | "always" | "avoid" | "left" | "right" | "inherit" | expr.datatype 
+   }
+page-break-before.attr = attribute page-break-before { 
+    "auto" | "always" | "avoid" | "left" | "right" | "inherit" | expr.datatype 
+   }
+page-break-inside.attr = attribute page-break-inside {  "avoid" | "auto" | "inherit" | expr.datatype }
+page-height.attr = attribute page-height {  text | expr.datatype }
+page-position.attr = attribute page-position { 
+    "first" | "last" | "rest" | "any" | "inherit" | expr.datatype 
+   }
+page-width.attr = attribute page-width {  text | expr.datatype }
+pause.attr = attribute pause {  text | expr.datatype }
+pause-after.attr = attribute pause-after {  text | expr.datatype }
+pause-before.attr = attribute pause-before {  text | expr.datatype }
+pitch.attr = attribute pitch {  text | expr.datatype }
+pitch-range.attr = attribute pitch-range {  text | expr.datatype }
+play-during.attr = attribute play-during {  text | expr.datatype }
+#MEMO: We forced to devide this shorthand since we have separate absolute-container element
+absolute-position-shorthand.attr = attribute position { 
+    "absolute" | "fixed"
+   }
+relative-position-shorthand.attr = attribute position { 
+    "static" | "relative" | "inherit" | expr.datatype 
+   }
+precedence.attr = attribute precedence { "true" | "false" | "inherit" | expr.datatype }
+provisional-distance-between-starts.attr = attribute provisional-distance-between-starts {  text | expr.datatype }
+provisional-label-separation.attr = attribute provisional-label-separation {  text | expr.datatype }
+range-separator.attr = attribute range-separator {  text  }
+ref-id.attr = attribute ref-id {  text  }
+ref-key.attr = attribute ref-key {  text  }
+reference-orientation.attr = attribute reference-orientation { orientation.attr-content | expr.datatype  }
+region-name.attr = attribute region-name {  text  }
+relative-align.attr = attribute relative-align {  "before" | "baseline" | "inherit" | expr.datatype }
+relative-position.attr = attribute relative-position { 
+    "auto" | "static" | "relative" | "inherit" | expr.datatype 
+   }
+rendering-intent.attr = attribute rendering-intent { 
+    "auto" | "perceptual" | "relative-colorimetric" | "saturation" | "absolute-colorimetric" | "inherit" | expr.datatype 
+   }?
+retrieve-boundary.attr = attribute retrieve-boundary {  "page" | "page-sequence" | "document" | expr.datatype }
+retrieve-class-name.attr = attribute retrieve-class-name {  text  }
+retrieve-position.attr = attribute retrieve-position { 
+    "first-starting-within-page"
+    | "first-including-carryover"
+    | "last-starting-within-page"
+    | "last-ending-within-page"
+    | expr.datatype 
+   }
+richness.attr = attribute richness {  text | expr.datatype }
+right.attr = attribute right {  text | expr.datatype }
+role.attr = attribute role {  text  }
+rule-style.attr = attribute rule-style { 
+    "none"
+    | "dotted"
+    | "dashed"
+    | "solid"
+    | "double"
+    | "groove"
+    | "ridge"
+    | "inherit"
+    | expr.datatype 
+   }
+rule-thickness.attr = attribute rule-thickness {  text | expr.datatype }
+scaling.attr = attribute scaling {  "uniform" | "non-uniform" | "inherit" | expr.datatype }
+scaling-method.attr = attribute scaling-method { 
+    "auto" | "integer-pixels" | "resample-any-method" | "inherit" | expr.datatype 
+   }
+score-spaces.attr = attribute score-spaces {  "true" | "false" | "inherit" | expr.datatype }
+script.attr = attribute script {  text | expr.datatype }
+show-destination.attr = attribute show-destination {  "replace" | "new" | expr.datatype }
+size.attr = attribute size {  text | expr.datatype }
+source-document.attr = attribute source-document {  text  }
+space-after.attr = attribute space-after {  text | expr.datatype }
+space-after.conditionality.attr = attribute space-after.conditionality {  "retain" | "discard" | expr.datatype }
+space-after.maximum.attr = attribute space-after.maximum {  text | expr.datatype }
+space-after.minimum.attr = attribute space-after.minimum {  text | expr.datatype }
+space-after.optimum.attr = attribute space-after.optimum {  text | expr.datatype }
+space-after.precedence.attr = attribute space-after.precedence {  text | expr.datatype }
+space-before.attr = attribute space-before {  text | expr.datatype }
+space-before.conditionality.attr = attribute space-before.conditionality {  "retain" | "discard" | expr.datatype }
+space-before.maximum.attr = attribute space-before.maximum {  text | expr.datatype }
+space-before.minimum.attr = attribute space-before.minimum {  text | expr.datatype }
+space-before.optimum.attr = attribute space-before.optimum {  text | expr.datatype }
+space-before.precedence.attr = attribute space-before.precedence {  text | expr.datatype }
+space-end.attr = attribute space-end {  text | expr.datatype }
+space-end.conditionality.attr = attribute space-end.conditionality {  "retain" | "discard" | expr.datatype }
+space-end.maximum.attr = attribute space-end.maximum {  text | expr.datatype }
+space-end.minimum.attr = attribute space-end.minimum {  text | expr.datatype }
+space-end.optimum.attr = attribute space-end.optimum {  text | expr.datatype }
+space-end.precedence.attr = attribute space-end.precedence {  text | expr.datatype }
+space-start.attr = attribute space-start {  text | expr.datatype }
+space-start.conditionality.attr = attribute space-start.conditionality {  "retain" | "discard" | expr.datatype }
+space-start.maximum.attr = attribute space-start.maximum {  text | expr.datatype }
+space-start.minimum.attr = attribute space-start.minimum {  text | expr.datatype }
+space-start.optimum.attr = attribute space-start.optimum {  text | expr.datatype }
+space-start.precedence.attr = attribute space-start.precedence {  text | expr.datatype }
+span.attr = attribute span {  "none" | "all" | "inherit" | expr.datatype }
+speak.attr = attribute speak {  "normal" | "none" | "spell-out" | "inherit" | expr.datatype }
+speak-header.attr = attribute speak-header {  "once" | "always" | "inherit" | expr.datatype }
+speak-numeral.attr = attribute speak-numeral {  "digits" | "continuous" | "inherit" | expr.datatype }
+speak-punctuation.attr = attribute speak-punctuation {  "code" | "none" | "inherit" | expr.datatype }
+speech-rate.attr = attribute speech-rate {  text | expr.datatype }
+src.attr = attribute src {  text | expr.datatype }
+start-indent.attr = attribute start-indent {  text | expr.datatype }
+starting-state.attr = attribute starting-state {  text | expr.datatype }
+starts-row.attr = attribute starts-row {  "true" | "false" | expr.datatype }
+stress.attr = attribute stress {  text | expr.datatype }
+suppress-at-line-break.attr = attribute suppress-at-line-break { 
+    "auto" | "suppress" | "retain" | "inherit" | expr.datatype 
+   }
+switch-to.attr = attribute switch-to {  text | expr.datatype }
+table-layout.attr = attribute table-layout {  "auto" | "fixed" | "inherit" | expr.datatype }
+table-omit-footer-at-break.attr = attribute table-omit-footer-at-break {  "true" | "false" | "inherit" | expr.datatype }
+table-omit-header-at-break.attr = attribute table-omit-header-at-break { 
+    "true" | "false" | "inherit" | expr.datatype 
+   }
+target-presentation-context.attr = attribute target-presentation-context {  text  }
+target-processing-context.attr = attribute target-processing-context {  text  }
+target-stylesheet.attr = attribute target-stylesheet {  text  }
+#MEMO: <string> values are temporarily excluded from text-align and text-align-last
+text-align.attr = attribute text-align { 
+    "start"
+    | "center"
+    | "end"
+    | "justify"
+    | "inside"
+    | "outside"
+    | "left"
+    | "right"
+    | "inherit"
+    | expr.datatype 
+   }
+text-align-last.attr = attribute text-align-last { 
+    "relative"
+    | "start"
+    | "center"
+    | "end"
+    | "justify"
+    | "inside"
+    | "outside"
+    | "left"
+    | "right"
+    | "inherit"
+    | expr.datatype 
+   }
+text-altitude.attr = attribute text-altitude {  text | expr.datatype }
+text-decoration.attr = attribute text-decoration {  xsd:NMTOKENS | expr.datatype }
+text-depth.attr = attribute text-depth {  text | expr.datatype }
+text-indent.attr = attribute text-indent {  text | expr.datatype }
+text-shadow.attr = attribute text-shadow {  text | expr.datatype }
+text-transform.attr = attribute text-transform { 
+    "capitalize" | "uppercase" | "lowercase" | "none" | "inherit" | expr.datatype 
+   }
+top.attr = attribute top {  text | expr.datatype }
+treat-as-word-space.attr = attribute treat-as-word-space { 
+    "auto" | "true" | "false" | "inherit" | expr.datatype 
+   }
+unicode-bidi.attr = attribute unicode-bidi { 
+    "normal" | "embed" | "bidi-override" | "inherit" | expr.datatype 
+   }
+value.attr = attribute value {  text  }
+vertical-align.attr = attribute vertical-align {  text | expr.datatype }
+visibility.attr = attribute visibility { 
+    "visible" | "hidden" | "collapse" | "inherit" | expr.datatype 
+   }
+voice-family.attr = attribute voice-family {  text | expr.datatype }
+volume.attr = attribute volume {  text | expr.datatype }
+white-space.attr = attribute white-space {  "normal" | "pre" | "nowrap" | "inherit" | expr.datatype }
+white-space-collapse.attr = attribute white-space-collapse {  "false" | "true" | "inherit" | expr.datatype }
+white-space-treatment.attr = attribute white-space-treatment { 
+    "ignore"
+    | "preserve"
+    | "ignore-if-before-linefeed"
+    | "ignore-if-after-linefeed"
+    | "ignore-if-surrounding-linefeed"
+    | "inherit"
+    | expr.datatype 
+   }
+widows.attr = attribute widows {  text | expr.datatype }
+width.attr = attribute width {  text | expr.datatype }
+word-spacing.attr = attribute word-spacing {  text | expr.datatype }
+word-spacing.conditionality.attr = attribute word-spacing.conditionality {  "retain" | "discard" | expr.datatype }
+word-spacing.maximum.attr = attribute word-spacing.maximum {  text | expr.datatype }
+word-spacing.minimum.attr = attribute word-spacing.minimum {  text | expr.datatype }
+word-spacing.optimum.attr = attribute word-spacing.optimum {  text | expr.datatype }
+word-spacing.precedence.attr = attribute word-spacing.precedence {  text | expr.datatype }
+wrap-option.attr = attribute wrap-option {  "no-wrap" | "wrap" | "inherit" | expr.datatype }
+writing-mode.attr = attribute writing-mode { 
+    "lr-tb" | "rl-tb" | "tb-rl" | "lr" | "rl" | "tb" | "inherit" | expr.datatype 
+   }
+z-index.attr = attribute z-index {  text | expr.datatype }
diff --git a/xml/relaxng/testData/parsing/psi/complex/properties_groups.rnc b/xml/relaxng/testData/parsing/psi/complex/properties_groups.rnc
new file mode 100644
index 0000000..dab15a7
--- /dev/null
+++ b/xml/relaxng/testData/parsing/psi/complex/properties_groups.rnc
@@ -0,0 +1,562 @@
+# =========================================================
+#                                                          
+# (c) 2004, RenderX                                        
+#                                                          
+# Author: Alexander Peshkov <[email protected]>          
+#                                                          
+# Permission is granted to use this document, copy and     
+# modify free of charge, provided that every derived work  
+# bear a reference to the present document.                
+#                                                          
+# This document contains a computer program written in     
+# XSL Transformations Language. It is published with no    
+# warranty of any kind about its usability, as a mere      
+# example of XSL technology. RenderX shall not be          
+# considered liable for any damage or loss of data caused  
+# by use of this program.                                  
+#                                                          
+# =========================================================
+
+namespace local = ""
+default namespace fo = "http://www.w3.org/1999/XSL/Format"
+namespace rx = "http://www.renderx.com/XSL/Extensions"
+
+include "basic_properties.rnc"
+
+# ===============================================================  
+# Properties grouping. Groups used by different elements classes
+# ===============================================================
+
+
+# ===============================================================
+# Entity definitions for common groups of properties
+# This grouping reflects properties co occurrence, rather than
+# property semantics. It does not correspond to grouping in the
+# spec.
+# ===============================================================
+
+# Accessibility Properties
+accessibility-properties =
+  source-document.attr?,
+  role.attr?
+#MEMO: XSLFO is selfcontradictory:
+# Those properties allowed on all inline elements excep to for fo:character, fo:bidi-override and fo:inline-conteiner
+# At the same time spec says about those properties:
+# XSL> It is used by all formatting objects that can be contained in fo:flow or fo:static-content (all formatting
+# XSL> objects that can be directly created from an XML source element).
+# Thus they must be present on fo:character, fo:bidi-override, fo:inline-conteiner as well
+# (there are more elements missing these properties)
+# Note also, that comment in the round brackets seems to be meaningless.
+
+# Relative Position Properties
+# 'position' shorthand property also makes part of this group
+relative-position-properties =
+  relative-position.attr?,
+  relative-position-shorthand.attr? 
+
+# Absolute Position Properties
+absolute-position-properties =
+  absolute-position.attr,
+  absolute-position-shorthand.attr?,
+  top.attr?,
+  right.attr?,
+  bottom.attr?,
+  left.attr?
+  
+# Aural Properties
+# 'cue' and 'pause' shorthand properties are also included
+#MEMO: XSLFO is selfcontradictory here in the same way
+# it is for  Accessibility Properties - Aural properties allowed everywhere
+# but yet not specified on some elements, e.g. fo:block-container or fo:inline-container.
+# We believe this is an omission and therefor those properties are available  everywhere.
+aural-properties-inheritable =
+  azimuth.attr?,
+  elevation.attr?,
+  pitch.attr?,
+  pitch-range.attr?,
+  play-during.attr?,
+  richness.attr?,
+  speak.attr?,
+  speak-header.attr?,
+  speak-numeral.attr?,
+  speak-punctuation.attr?,
+  speech-rate.attr?,
+  stress.attr?,
+  voice-family.attr?,
+  volume.attr?
+aural-properties-unheritable =
+  cue.attr?,
+  cue-after.attr?,
+  cue-before.attr?,
+  pause.attr?,
+  pause-after.attr?,
+  pause-before.attr?
+aural-properties = aural-properties-inheritable, aural-properties-unheritable
+
+# Common Border, Padding, and Background Properties
+# Related shorthand properties are also included
+border-properties = 
+  border.attr?,
+  border-after-color.attr?,
+  border-after-style.attr?,
+  border-after-width.attr?,
+  border-after-width.length.attr?,
+  border-after-width.conditionality.attr?,
+  border-before-color.attr?,
+  border-before-style.attr?,
+  border-before-width.attr?,
+  border-before-width.length.attr?,
+  border-before-width.conditionality.attr?,
+  border-bottom.attr?,
+  border-bottom-color.attr?,
+  border-bottom-style.attr?,
+  border-bottom-width.attr?,
+  border-bottom-width.length.attr?,
+  border-bottom-width.conditionality.attr?,
+  border-color.attr?,
+  border-end-color.attr?,
+  border-end-style.attr?,
+  border-end-width.attr?,
+  border-end-width.length.attr?,
+  border-end-width.conditionality.attr?,
+  border-left.attr?,
+  border-left-color.attr?,
+  border-left-style.attr?,
+  border-left-width.attr?,
+  border-left-width.length.attr?,
+  border-left-width.conditionality.attr?,
+  border-right.attr?,
+  border-right-color.attr?,
+  border-right-style.attr?,
+  border-right-width.attr?,
+  border-right-width.length.attr?,
+  border-right-width.conditionality.attr?,
+  border-start-color.attr?,
+  border-start-style.attr?,
+  border-start-width.attr?,
+  border-start-width.length.attr?,
+  border-start-width.conditionality.attr?,
+  border-style.attr?,
+  border-top.attr?,
+  border-top-color.attr?,
+  border-top-style.attr?,
+  border-top-width.attr?,
+  border-top-width.length.attr?,
+  border-top-width.conditionality.attr?,
+  border-width.attr?
+
+padding-properties = 
+  padding.attr?,
+  padding-after.attr?,
+  padding-after.length.attr?,
+  padding-after.conditionality.attr?,
+  padding-before.attr?,
+  padding-before.length.attr?,
+  padding-before.conditionality.attr?,
+  padding-bottom.attr?,
+  padding-bottom.length.attr?,
+  padding-bottom.conditionality.attr?,
+  padding-end.attr?,
+  padding-end.length.attr?,
+  padding-end.conditionality.attr?,
+  padding-left.attr?,
+  padding-left.length.attr?,
+  padding-left.conditionality.attr?,
+  padding-right.attr?,
+  padding-right.length.attr?,
+  padding-right.conditionality.attr?,
+  padding-start.attr?,
+  padding-start.length.attr?,
+  padding-start.conditionality.attr?,
+  padding-top.attr?,
+  padding-top.length.attr?,
+  padding-top.conditionality.attr?
+
+background-properties =
+  background.attr?,
+  background-attachment.attr?,
+  background-color.attr?,
+  background-image.attr?,
+  background-position.attr?,
+  background-position-vertical.attr?,
+  background-position-horizontal.attr?,
+  background-repeat.attr?,
+  rx-background-content-type.attr?,
+  rx-background-content-height.attr?,
+  rx-background-content-width.attr?,
+  rx-background-scaling.attr?
+
+border-padding-background-properties = 
+  border-properties,
+  padding-properties,
+  background-properties
+
+# Border Precedence Properties for tables
+border-precedence-properties =
+  border-after-precedence.attr?,
+  border-before-precedence.attr?,
+  border-end-precedence.attr?,
+  border-start-precedence.attr?
+
+# Box Size Properties
+height-properties =
+  height.attr?,
+  min-height.attr?,
+  max-height.attr?,
+  block-progression-dimension.attr?,
+  block-progression-dimension.minimum.attr?,
+  block-progression-dimension.optimum.attr?,
+  block-progression-dimension.maximum.attr?
+
+width-properties =
+  width.attr?,
+  min-width.attr?,
+  max-width.attr?,
+  inline-progression-dimension.attr?,
+  inline-progression-dimension.minimum.attr?,
+  inline-progression-dimension.optimum.attr?,
+  inline-progression-dimension.maximum.attr?
+
+box-size-properties =
+  height-properties,
+  width-properties
+
+# Common Area Properties
+area-properties-inheritable =
+  display-align.attr?,
+  reference-orientation.attr?,
+  writing-mode.attr?
+area-properties-unheritable =
+  clip.attr?,
+  overflow.attr?
+area-properties = area-properties-inheritable, area-properties-unheritable
+
+# Common Font Properties
+# 'font' shorthand property is also included
+font-properties =
+  font.attr?,
+  font-selection-strategy.attr?,
+  font-family.attr?,
+  font-size.attr?,
+  font-size-adjust.attr?,
+  font-stretch.attr?,
+  font-style.attr?,
+  font-variant.attr?,
+  font-weight.attr?
+
+# Common Hyphenation Properties - Inline
+# 'xml:lang' shorthand property is also included
+hyphenation-properties-inline =
+  country.attr?,
+  language.attr?,
+  script.attr?,
+  attribute xml:lang { text }?,
+  hyphenate.attr?,
+  hyphenation-character.attr?,
+  hyphenation-push-character-count.attr?,
+  hyphenation-remain-character-count.attr?
+# Common Hyphenation Properties - Block
+hyphenation-properties-block =
+  hyphenation-keep.attr?,
+  hyphenation-ladder-count.attr?
+hyphenation-properties = hyphenation-properties-inline, hyphenation-properties-block
+
+# Common CSS Margin Properties
+# 'margin' shorthand property is also included
+margin-properties-CSS =
+  margin.attr?,
+  margin-bottom.attr?,
+  margin-left.attr?,
+  margin-right.attr?,
+  margin-top.attr?
+
+# Common Margin Properties - Block
+margin-properties-inheritable = 
+  start-indent.attr?,
+  end-indent.attr?
+
+margin-properties-block =
+  margin-properties-CSS,
+  space-after.attr?,
+  space-after.minimum.attr?,
+  space-after.optimum.attr?,
+  space-after.maximum.attr?,
+  space-after.precedence.attr?,
+  space-after.conditionality.attr?,
+  space-before.attr?,
+  space-before.minimum.attr?,
+  space-before.optimum.attr?,
+  space-before.maximum.attr?,
+  space-before.precedence.attr?,
+  space-before.conditionality.attr?
+
+# Common Margin Properties - Inline
+margin-properties-inline =
+  margin-properties-CSS,
+  space-start.attr?,
+  space-start.minimum.attr?,
+  space-start.optimum.attr?,
+  space-start.maximum.attr?,
+  space-start.precedence.attr?,
+  space-start.conditionality.attr?,
+  space-end.attr?,
+  space-end.minimum.attr?,
+  space-end.optimum.attr?,
+  space-end.maximum.attr?,
+  space-end.precedence.attr?,
+  space-end.conditionality.attr?
+
+# Area Alignment Properties
+# 'vertical-align' shorthand is added
+# 'relative-align' - excluded
+area-alignment-properties =
+  alignment-adjust.attr?,
+  alignment-baseline.attr?,
+  baseline-shift.attr?,
+  dominant-baseline.attr?,
+  vertical-align.attr?
+
+# Line Height Properties
+line-height-properties =
+  line-height.attr?,
+  line-height.minimum.attr?,
+  line-height.optimum.attr?,
+  line-height.maximum.attr?,
+  line-height.precedence.attr?,
+  line-height.conditionality.attr?,
+  line-height-shift-adjustment.attr?
+
+# Line Related Properties
+line-related-properties =
+  text-align.attr?,
+  text-align-last.attr?,
+  text-indent.attr?,
+  last-line-end-indent.attr?,
+  line-stacking-strategy.attr?,
+  linefeed-treatment.attr?,
+  white-space.attr?,
+  white-space-treatment.attr?,
+  white-space-collapse.attr?,
+  wrap-option.attr?,
+  direction.attr?
+
+# Character Properties
+character-properties-inheritable =
+  letter-spacing.attr?,
+  letter-spacing.minimum.attr?,
+  letter-spacing.optimum.attr?,
+  letter-spacing.maximum.attr?,
+  letter-spacing.precedence.attr?,
+  letter-spacing.conditionality.attr?,
+  word-spacing.attr?,
+  word-spacing.minimum.attr?,
+  word-spacing.optimum.attr?,
+  word-spacing.maximum.attr?,
+  word-spacing.precedence.attr?,
+  word-spacing.conditionality.attr?,
+  glyph-orientation-horizontal.attr?,
+  glyph-orientation-vertical.attr?,
+  score-spaces.attr?,
+  text-transform.attr?
+character-properties-unheritable=
+#MEMO: There is a problem with these two properties in XSL FO spec.
+# They are assumed to be allowed everywhere but somehow on of them
+# missing on fo:inline, another on fo:leader and both absent on fo:bidi-override.
+# They are not present on fo:block also.
+# We suppose that those omissions are erratic. and allow them on all elements that can cotain text.
+# It makes sence to allow text-decoration on the graphical inlines also.
+  text-decoration.attr?,
+  text-shadow.attr?
+  #NOTE: Those properties apllies to char elements but they are already included into 'inheritable-properties' set
+  #font-properties,
+  #line-height-properties
+character-properties = character-properties-inheritable, character-properties-unheritable
+
+# Common Keeps and Breaks Properties - Atomic objects
+# Keeps only
+keeps-properties-atomic =
+  keep-with-next.attr?,
+  keep-with-next.within-line.attr?,
+  keep-with-next.within-column.attr?,
+  keep-with-next.within-page.attr?,
+  keep-with-previous.attr?,
+  keep-with-previous.within-line.attr?,
+  keep-with-previous.within-column.attr?,
+  keep-with-previous.within-page.attr?
+
+# Common Keeps and Breaks Properties - Atomic objects
+# Keeps and Breaks
+# 'page-break-*' shorthand properties are also included
+keeps-and-breaks-properties-atomic =
+  keeps-properties-atomic,
+  break-after.attr?,
+  break-before.attr?,
+  page-break-after.attr?,
+  page-break-before.attr?
+
+# Common Keeps and Breaks Properties - Inline
+# 'page-break-inside' shorthand property is also included
+keeps-and-breaks-properties-inline-inheritable = 
+  keep-together.attr?,
+  keep-together.within-line.attr?,
+  keep-together.within-column.attr?,
+  keep-together.within-page.attr?,
+  page-break-inside.attr?
+
+#MEMO: Do we really need separate block and inline groups here
+  
+# Common Keeps and Breaks Properties - Block
+keeps-and-breaks-properties-block-inheritable = 
+  orphans.attr?,
+  widows.attr?
+  
+# Leader and Rule Properties
+leader-properties =
+  leader-alignment.attr?,
+  leader-pattern.attr?,
+  leader-pattern-width.attr?,
+  leader-length.attr?,
+  leader-length.minimum.attr?,
+  leader-length.optimum.attr?,
+  leader-length.maximum.attr?,
+  rule-style.attr?,
+  rule-thickness.attr?
+
+# Table Properties
+# 'border-spacing' shorthand property is also included
+# 'inherit' property added to table-omit-...er-at-break
+table-properties-inheritable =
+  border-collapse.attr?,
+  border-spacing.attr?,
+  border-separation.attr?,
+  border-separation.inline-progression-direction.attr?,
+  border-separation.block-progression-direction.attr?,
+  caption-side.attr?,
+  empty-cells.attr?
+table-properties-unheritable =
+  table-layout.attr?,
+  table-omit-header-at-break.attr?,
+  table-omit-footer-at-break.attr?,
+  rx-table-omit-initial-header.attr?
+table-properties = table-properties-inheritable, table-properties-unheritable
+
+# List Properties
+list-properties =
+  provisional-distance-between-starts.attr?,
+  provisional-label-separation.attr?
+
+# Visibility Properties
+# NOTE: 'visibility' is inheritable, but 'z-index' is not.
+visibility-properties = visibility.attr?,  z-index.attr?
+
+# ===============================================================
+# Set of 'explicitly' inheritable properties. This includes attributes
+# marked as inheritable in the spec only!
+# We define two sets of inheritable properties:
+# 1. Basic properties applicable to inline-level elements with character-only content
+# 2. Full set of inheritable properties 
+# ===============================================================
+inheritable-properties-inline = 
+  aural-properties-inheritable,
+  color.attr?,
+  character-properties-inheritable,
+  font-properties,
+  hyphenation-properties-inline,
+  line-height-properties,
+  visibility.attr?
+  
+inheritable-properties-block =
+  table-properties-inheritable,
+  area-properties-inheritable,
+  hyphenation-properties-block,
+  margin-properties-inheritable,
+  intrusion-displace.attr?, 
+  # 'intrusion-displace' applies to: fo:block, fo:block-container, fo:table-and-caption, fo:table, fo:table-caption, fo:list-block, fo:list-item.
+  keeps-and-breaks-properties-inline-inheritable,
+  keeps-and-breaks-properties-block-inheritable,
+  leader-properties,
+  #MEMO: Should we move this one to inheritable-properties-inline?
+  line-related-properties,
+  list-properties,
+  relative-align.attr?  #NOTE: Property 'relative-align' applies to fo:list-item and fo:table-cell only.
+
+inheritable-properties = 
+  inheritable-properties-inline,
+  inheritable-properties-block
+
+# ===============================================================
+# Common property subsets.
+# ===============================================================
+# Common block properties (those properties applies to any type of block-container as well
+common-block-properties =
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  aural-properties-unheritable,
+  border-padding-background-properties,
+  margin-properties-block,
+  inheritable-properties
+
+# Properties for fo:block and fo:block-container
+block-properties =
+  common-block-properties,
+  clear.attr?,
+  span.attr?,
+  keeps-and-breaks-properties-atomic,
+  relative-position-properties
+
+# Common inline properties
+#MEMO: Spec says that text-altitude/text-depth applicable only to
+# fo:block, fo:character, fo:leader, fo:page-number, fo:page-number-citation
+# We believe this is an omission and they must be allowed on all elements
+# that can have text children.
+common-inline-properties =
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  aural-properties-unheritable,
+  area-alignment-properties,
+  border-padding-background-properties,
+  character-properties-unheritable,
+  keeps-properties-atomic,
+  margin-properties-inline,
+  relative-position-properties,
+  text-altitude.attr?,
+  text-depth.attr?,
+  inheritable-properties-inline
+ 
+# Properties for nonempty inline elements
+inline-properties =
+  common-inline-properties,
+  inheritable-properties-block
+  
+# Properties for graphical inline elements
+# NOTE: src attribute exclueded since it's not applicable to fo:instream-foreign-object
+graphic-properties =
+#MEMO: We can replace part of the definition here with 'common-inline-properties' set
+# - it will be formaly rightfil since the only difference made by text-shadow,   text-altitude,
+#  text-depth  and inheritable-properties-inline and both of them are allowed here.
+# At the same time those properties do not make any sense being specified on those
+# elements since they will be never applied.
+  id.attr?,
+  rx-key.attr?,
+  accessibility-properties,
+  aural-properties,
+  area-properties-unheritable,
+  border-padding-background-properties,
+  margin-properties-inline,
+  relative-position-properties,
+  area-alignment-properties,
+  box-size-properties,  
+  keeps-properties-atomic,
+  line-height-properties,
+  display-align.attr?, 
+  content-type.attr?,
+  content-height.attr?,
+  content-width.attr?,
+  scaling.attr?,
+  scaling-method.attr?,
+  text-align.attr?,
+  text-decoration.attr?
+
+
diff --git a/xml/relaxng/testData/parsing/simple.rnc b/xml/relaxng/testData/parsing/simple.rnc
new file mode 100644
index 0000000..37778c1
--- /dev/null
+++ b/xml/relaxng/testData/parsing/simple.rnc
@@ -0,0 +1 @@
+element foo { empty } 
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rnc/rename-datatype-prefix-1.rnc b/xml/relaxng/testData/rename/rnc/rename-datatype-prefix-1.rnc
new file mode 100644
index 0000000..c9a7f33
--- /dev/null
+++ b/xml/relaxng/testData/rename/rnc/rename-datatype-prefix-1.rnc
@@ -0,0 +1,4 @@
+namespace aaa = "xxx"
+datatypes aaa = "yyy"
+
+start = element foo { <caret>aaa:string }
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rnc/rename-datatype-prefix-1_after.rnc b/xml/relaxng/testData/rename/rnc/rename-datatype-prefix-1_after.rnc
new file mode 100644
index 0000000..46dc5c6
--- /dev/null
+++ b/xml/relaxng/testData/rename/rnc/rename-datatype-prefix-1_after.rnc
@@ -0,0 +1,4 @@
+namespace aaa = "xxx"
+datatypes bar = "yyy"
+
+start = element foo { bar:string }
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rnc/rename-definition-1.rnc b/xml/relaxng/testData/rename/rnc/rename-definition-1.rnc
new file mode 100644
index 0000000..4f9becd8
--- /dev/null
+++ b/xml/relaxng/testData/rename/rnc/rename-definition-1.rnc
@@ -0,0 +1,3 @@
+start = <caret>pattern
+pattern = grammar {
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rnc/rename-definition-1_after.rnc b/xml/relaxng/testData/rename/rnc/rename-definition-1_after.rnc
new file mode 100644
index 0000000..dc3fcc5
--- /dev/null
+++ b/xml/relaxng/testData/rename/rnc/rename-definition-1_after.rnc
@@ -0,0 +1,3 @@
+start = bar
+bar = grammar {
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rnc/rename-definition-2.rnc b/xml/relaxng/testData/rename/rnc/rename-definition-2.rnc
new file mode 100644
index 0000000..4f9becd8
--- /dev/null
+++ b/xml/relaxng/testData/rename/rnc/rename-definition-2.rnc
@@ -0,0 +1,3 @@
+start = <caret>pattern
+pattern = grammar {
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rnc/rename-definition-2_after.rnc b/xml/relaxng/testData/rename/rnc/rename-definition-2_after.rnc
new file mode 100644
index 0000000..d8aa825
--- /dev/null
+++ b/xml/relaxng/testData/rename/rnc/rename-definition-2_after.rnc
@@ -0,0 +1,3 @@
+start = \element
+\element = grammar {
+}
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rnc/rename-definition-3.rnc b/xml/relaxng/testData/rename/rnc/rename-definition-3.rnc
new file mode 100644
index 0000000..4d2e7a2
--- /dev/null
+++ b/xml/relaxng/testData/rename/rnc/rename-definition-3.rnc
@@ -0,0 +1,2 @@
+start = element foo { <caret>pattern }
+pattern = element bar { empty }
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rnc/rename-definition-3_after.rnc b/xml/relaxng/testData/rename/rnc/rename-definition-3_after.rnc
new file mode 100644
index 0000000..58339f1
--- /dev/null
+++ b/xml/relaxng/testData/rename/rnc/rename-definition-3_after.rnc
@@ -0,0 +1,2 @@
+start = element foo { bar }
+bar = element bar { empty }
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rnc/rename-in-include-ref.rnc b/xml/relaxng/testData/rename/rnc/rename-in-include-ref.rnc
new file mode 100644
index 0000000..a2f95c5
--- /dev/null
+++ b/xml/relaxng/testData/rename/rnc/rename-in-include-ref.rnc
@@ -0,0 +1 @@
+start = element foo { empty }
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rnc/rename-in-include.rnc b/xml/relaxng/testData/rename/rnc/rename-in-include.rnc
new file mode 100644
index 0000000..8c18eba
--- /dev/null
+++ b/xml/relaxng/testData/rename/rnc/rename-in-include.rnc
@@ -0,0 +1 @@
+include "rename-in-include-ref.rnc"
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rnc/rename-in-include_after.rnc b/xml/relaxng/testData/rename/rnc/rename-in-include_after.rnc
new file mode 100644
index 0000000..308705a
--- /dev/null
+++ b/xml/relaxng/testData/rename/rnc/rename-in-include_after.rnc
@@ -0,0 +1 @@
+include "rename-after.rnc"
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rnc/rename-ns-prefix-1.rnc b/xml/relaxng/testData/rename/rnc/rename-ns-prefix-1.rnc
new file mode 100644
index 0000000..c522b7b
--- /dev/null
+++ b/xml/relaxng/testData/rename/rnc/rename-ns-prefix-1.rnc
@@ -0,0 +1,3 @@
+default namespace rng = "http://relaxng.org/ns/structure/1.0"
+
+start = element <caret>rng:foo { text }
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rnc/rename-ns-prefix-1_after.rnc b/xml/relaxng/testData/rename/rnc/rename-ns-prefix-1_after.rnc
new file mode 100644
index 0000000..9944638
--- /dev/null
+++ b/xml/relaxng/testData/rename/rnc/rename-ns-prefix-1_after.rnc
@@ -0,0 +1,3 @@
+default namespace bar = "http://relaxng.org/ns/structure/1.0"
+
+start = element bar:foo { text }
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rng/rename-ref-1.rng b/xml/relaxng/testData/rename/rng/rename-ref-1.rng
new file mode 100644
index 0000000..2d9ce7f
--- /dev/null
+++ b/xml/relaxng/testData/rename/rng/rename-ref-1.rng
@@ -0,0 +1,7 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <start>
+    <ref name="<caret>start.element" />
+  </start>
+
+  <define name="start.element" />
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/rename/rng/rename-ref-1_after.rng b/xml/relaxng/testData/rename/rng/rename-ref-1_after.rng
new file mode 100644
index 0000000..ef25945
--- /dev/null
+++ b/xml/relaxng/testData/rename/rng/rename-ref-1_after.rng
@@ -0,0 +1,7 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <start>
+    <ref name="<caret>start" />
+  </start>
+
+  <define name="start" />
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/broken-rnc.xml b/xml/relaxng/testData/validation/broken-rnc.xml
new file mode 100644
index 0000000..f8c041d
--- /dev/null
+++ b/xml/relaxng/testData/validation/broken-rnc.xml
@@ -0,0 +1,3 @@
+<foo xmlns="broken.rnc">
+  <bar />
+</foo>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/broken-rng.xml b/xml/relaxng/testData/validation/broken-rng.xml
new file mode 100644
index 0000000..cc7f3a6
--- /dev/null
+++ b/xml/relaxng/testData/validation/broken-rng.xml
@@ -0,0 +1,3 @@
+<foo xmlns="broken.rng">
+  <bar />
+</foo>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/broken.rnc b/xml/relaxng/testData/validation/broken.rnc
new file mode 100644
index 0000000..f1d29ee
--- /dev/null
+++ b/xml/relaxng/testData/validation/broken.rnc
@@ -0,0 +1,7 @@
+default namespace = "broken.rnc"
+
+start = element foo {
+  (element bar { empty } | foo)
+}
+
+foo = element x { a }
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/broken.rng b/xml/relaxng/testData/validation/broken.rng
new file mode 100644
index 0000000..3422b89
--- /dev/null
+++ b/xml/relaxng/testData/validation/broken.rng
@@ -0,0 +1,15 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="broken.rng">
+  <start>
+    <choice>
+      <element name="foo">
+        <element name="bar"><empty /></element>
+      </element>
+
+      <ref name="foo" />
+    </choice>
+  </start>
+
+  <define name="foo">
+    <element></element>
+  </define>
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/cdata-test.xml b/xml/relaxng/testData/validation/cdata-test.xml
new file mode 100644
index 0000000..0fe59d2
--- /dev/null
+++ b/xml/relaxng/testData/validation/cdata-test.xml
@@ -0,0 +1,3 @@
+<cdata-element xmlns="urn:test:simple.rng">
+<![CDATA[<a & b>]]>
+</cdata-element>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/entity-included-2.xml b/xml/relaxng/testData/validation/entity-included-2.xml
new file mode 100644
index 0000000..e790b23
--- /dev/null
+++ b/xml/relaxng/testData/validation/entity-included-2.xml
@@ -0,0 +1,3 @@
+<required xmlns="urn:test:simple.rng">
+  <foo xmlns="" />
+</required>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/entity-included.xml b/xml/relaxng/testData/validation/entity-included.xml
new file mode 100644
index 0000000..1b3d1aa
--- /dev/null
+++ b/xml/relaxng/testData/validation/entity-included.xml
@@ -0,0 +1 @@
+<required xmlns="urn:test:simple.rng" />
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/entity-test-1.xml b/xml/relaxng/testData/validation/entity-test-1.xml
new file mode 100644
index 0000000..03b1655
--- /dev/null
+++ b/xml/relaxng/testData/validation/entity-test-1.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE missing-element [
+  <!ENTITY content SYSTEM "entity-included.xml" >
+]>
+<missing-element xmlns="urn:test:simple.rng">
+  &content;
+</missing-element>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/entity-test-2.xml b/xml/relaxng/testData/validation/entity-test-2.xml
new file mode 100644
index 0000000..90fbdb5
--- /dev/null
+++ b/xml/relaxng/testData/validation/entity-test-2.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE missing-element [
+  <!ENTITY content SYSTEM "entity-included-2.xml" >
+]>
+<<error descr="unknown element "foo"">missing-element</error> xmlns="urn:test:simple.rng">
+  &content;
+</missing-element>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/entity-test-3.xml b/xml/relaxng/testData/validation/entity-test-3.xml
new file mode 100644
index 0000000..56e19d2
--- /dev/null
+++ b/xml/relaxng/testData/validation/entity-test-3.xml
@@ -0,0 +1,5 @@
+<?xml encoding="iso-8859-1" version="1.0" ?>
+<!DOCTYPE entity-element [
+    <!ENTITY uuml "ü" >
+]>
+<entity-element xmlns="urn:test:simple.rng">&uuml;&quot;</entity-element>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/invalid-element-rnc.xml b/xml/relaxng/testData/validation/invalid-element-rnc.xml
new file mode 100644
index 0000000..7b815fe
--- /dev/null
+++ b/xml/relaxng/testData/validation/invalid-element-rnc.xml
@@ -0,0 +1,4 @@
+<invalid-element xmlns="urn:test:simple.rnc">
+  <required />
+  <<error>required</error> />
+</invalid-element>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/invalid-element.xml b/xml/relaxng/testData/validation/invalid-element.xml
new file mode 100644
index 0000000..880b247
--- /dev/null
+++ b/xml/relaxng/testData/validation/invalid-element.xml
@@ -0,0 +1,4 @@
+<invalid-element xmlns="urn:test:simple.rng">
+  <required />
+  <<error>required</error> />
+</invalid-element>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/missing-element-rnc.xml b/xml/relaxng/testData/validation/missing-element-rnc.xml
new file mode 100644
index 0000000..0e6cc2d
--- /dev/null
+++ b/xml/relaxng/testData/validation/missing-element-rnc.xml
@@ -0,0 +1,2 @@
+<<error>missing-element</error> xmlns="urn:test:simple.rnc">
+</<error>missing-element</error>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/missing-element.xml b/xml/relaxng/testData/validation/missing-element.xml
new file mode 100644
index 0000000..52a9f69
--- /dev/null
+++ b/xml/relaxng/testData/validation/missing-element.xml
@@ -0,0 +1,2 @@
+<<error>missing-element</error> xmlns="urn:test:simple.rng">
+</<error>missing-element</error>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/simple.rnc b/xml/relaxng/testData/validation/simple.rnc
new file mode 100644
index 0000000..4f0bc97
--- /dev/null
+++ b/xml/relaxng/testData/validation/simple.rnc
@@ -0,0 +1,9 @@
+default namespace = "urn:test:simple.rnc"
+
+element missing-element {
+  element required { empty }
+} |
+element invalid-element {
+  element required { empty }
+}
+
diff --git a/xml/relaxng/testData/validation/simple.rng b/xml/relaxng/testData/validation/simple.rng
new file mode 100644
index 0000000..d22e684
--- /dev/null
+++ b/xml/relaxng/testData/validation/simple.rng
@@ -0,0 +1,33 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng">
+  <start>
+    <choice>
+      <element name="missing-element">
+        <element name="required"><empty /></element>
+      </element>
+
+      <element name="invalid-element">
+        <element name="required"><empty /></element>
+      </element>
+
+      <element name="text-content">
+        <oneOrMore>
+          <element name="boolean">
+            <choice>
+              <value>true</value>
+              <value>false</value>
+            </choice>
+          </element>
+        </oneOrMore>
+      </element>
+
+      <element name="entity-element">
+        <value type="string">ü"</value>
+      </element>
+
+      <element name="cdata-element">
+        <value type="token"><![CDATA[<a & b>]]></value>
+      </element>
+    </choice>
+  </start>
+
+</grammar>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/text-content.xml b/xml/relaxng/testData/validation/text-content.xml
new file mode 100644
index 0000000..f27dfec
--- /dev/null
+++ b/xml/relaxng/testData/validation/text-content.xml
@@ -0,0 +1,5 @@
+<text-content xmlns="urn:test:simple.rng">
+  <boolean>true</boolean>
+  <boolean>false</boolean>
+  <<error>boolean</error>>blubb</<error>boolean</error>>
+</text-content>
\ No newline at end of file
diff --git a/xml/relaxng/testData/validation/xslt.rng b/xml/relaxng/testData/validation/xslt.rng
new file mode 100644
index 0000000..0246a5a
--- /dev/null
+++ b/xml/relaxng/testData/validation/xslt.rng
@@ -0,0 +1,895 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- This was mostly generated from the syntax summary in the XSLT
+     Recommendation (using XSLT of course). -->
+<!-- Issues: this validates extension elements as literal result
+     elements, which is overly restrictive. -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+         ns="http://www.w3.org/1999/XSL/Transform"
+         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+   <start>
+      <choice>
+         <ref name="stylesheet.element"/>
+         <ref name="transform.element"/>
+         <ref name="literal-result-element-as-stylesheet"/>
+      </choice>
+   </start>
+   <define name="version">
+      <value>1.0</value>
+   </define>
+   <define name="top-level-elements.model">
+      <zeroOrMore>
+         <choice>
+            <ref name="top-level-element.category"/>
+            <ref name="top-level-extension"/>
+         </choice>
+      </zeroOrMore>
+   </define>
+   <define name="top-level-extension">
+      <element>
+         <anyName>
+            <except>
+               <nsName/>
+               <nsName ns=""/>
+            </except>
+         </anyName>
+         <grammar>
+            <start>
+              <ref name="any"/>
+            </start>
+            <define name="any">
+	       <zeroOrMore>
+		  <choice>
+		     <attribute>
+			<anyName/>
+		     </attribute>
+		     <text/>
+		     <element>
+			<anyName/>
+			<ref name="any"/>
+		     </element>
+		  </choice>
+	       </zeroOrMore>
+            </define>
+         </grammar>
+      </element>
+   </define>
+   <define name="template.model">
+      <zeroOrMore>
+         <choice>
+            <ref name="instruction.category"/>
+            <ref name="literal-result-element"/>
+            <text/>
+         </choice>
+      </zeroOrMore>
+   </define>
+   <define name="literal-result-element-as-stylesheet">
+      <element>
+         <anyName>
+            <except>
+               <nsName/>
+            </except>
+         </anyName>
+         <attribute>
+            <name>version</name>
+            <ref name="version"/>
+         </attribute>
+         <ref name="literal-result-element-no-version.atts"/>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="literal-result-element">
+      <element>
+         <anyName>
+            <except>
+               <nsName/>
+            </except>
+         </anyName>
+         <ref name="literal-result-element.atts"/>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="literal-result-element.atts">
+      <ref name="literal-result-element-no-version.atts"/>
+      <optional>
+	 <attribute>
+	    <name>version</name>
+	    <ref name="version"/>
+	 </attribute>
+      </optional>
+   </define>
+   <define name="literal-result-element-no-version.atts">
+      <zeroOrMore>
+         <choice>
+            <attribute>
+	       <anyName>
+		  <except>
+		     <nsName/>
+		  </except>
+	       </anyName>
+               <ref name="avt.datatype"/>
+            </attribute>
+            <attribute>
+               <name>extension-element-prefixes</name>
+               <ref name="prefixes.datatype"/>
+	    </attribute>
+            <attribute>
+               <name>exclude-result-prefixes</name>
+               <ref name="prefixes.datatype"/>
+	    </attribute>
+            <attribute>
+               <name>use-attribute-sets</name>
+               <ref name="qnames.datatype"/>
+            </attribute>
+         </choice>
+      </zeroOrMore>
+   </define>
+   <define name="top-level-element.category">
+      <choice>
+         <ref name="include.element"/>
+         <ref name="strip-space.element"/>
+         <ref name="preserve-space.element"/>
+         <ref name="template.element"/>
+         <ref name="namespace-alias.element"/>
+         <ref name="attribute-set.element"/>
+         <ref name="variable.element"/>
+         <ref name="param.element"/>
+         <ref name="key.element"/>
+         <ref name="decimal-format.element"/>
+         <ref name="output.element"/>
+      </choice>
+   </define>
+   <define name="instruction.category">
+      <choice>
+         <ref name="apply-templates.element"/>
+         <ref name="apply-imports.element"/>
+         <ref name="call-template.element"/>
+         <ref name="element.element"/>
+         <ref name="attribute.element"/>
+         <ref name="text.element"/>
+         <ref name="processing-instruction.element"/>
+         <ref name="comment.element"/>
+         <ref name="copy.element"/>
+         <ref name="value-of.element"/>
+         <ref name="number.element"/>
+         <ref name="for-each.element"/>
+         <ref name="if.element"/>
+         <ref name="choose.element"/>
+         <ref name="variable.element"/>
+         <ref name="copy-of.element"/>
+         <ref name="message.element"/>
+         <ref name="fallback.element"/>
+      </choice>
+   </define>
+   <define name="extension.atts">
+      <zeroOrMore>
+         <attribute>
+            <anyName>
+               <except>
+                  <nsName/>
+                  <nsName ns=""/>
+               </except>
+            </anyName>
+         </attribute>
+      </zeroOrMore>
+   </define>
+   <define name="stylesheet.element">
+      <element name="stylesheet">
+         <ref name="stylesheet.model"/>
+      </element>
+   </define>
+   <define name="transform.element">
+      <element name="transform">
+         <ref name="stylesheet.model"/>
+      </element>
+   </define>
+   <define name="stylesheet.model">
+      <ref name="extension.atts"/>
+      <optional>
+	 <attribute name="id">
+	    <data type="NCName"/>
+	 </attribute>
+      </optional>
+      <optional>
+	 <attribute name="extension-element-prefixes">
+            <ref name="prefixes.datatype"/>
+	 </attribute>
+      </optional>
+      <optional>
+	 <attribute name="exclude-result-prefixes">
+            <ref name="prefixes.datatype"/>
+	 </attribute>
+      </optional>
+      <attribute name="version">
+	 <ref name="version"/>
+      </attribute>
+      <group>
+	 <zeroOrMore>
+	    <ref name="import.element"/>
+	 </zeroOrMore>
+	 <ref name="top-level-elements.model"/>
+      </group>
+   </define>
+   <define name="include.element">
+      <element name="include">
+         <ref name="extension.atts"/>
+         <attribute name="href">
+            <data type="anyURI"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="import.element">
+      <element name="import">
+         <ref name="extension.atts"/>
+         <attribute name="href">
+            <data type="anyURI"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="strip-space.element">
+      <element name="strip-space">
+         <ref name="extension.atts"/>
+         <attribute name="elements">
+            <ref name="wildcards.datatype"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="preserve-space.element">
+      <element name="preserve-space">
+         <ref name="extension.atts"/>
+         <attribute name="elements">
+            <ref name="wildcards.datatype"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="template.element">
+      <element name="template">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="match">
+               <ref name="pattern.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="name">
+               <ref name="qname.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="priority">
+               <ref name="number.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="mode">
+               <ref name="qname.datatype"/>
+            </attribute>
+         </optional>
+         <group>
+            <zeroOrMore>
+               <ref name="param.element"/>
+            </zeroOrMore>
+            <ref name="template.model"/>
+         </group>
+      </element>
+   </define>
+   <define name="apply-templates.element">
+      <element name="apply-templates">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="select">
+               <ref name="expression.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="mode">
+               <ref name="qname.datatype"/>
+            </attribute>
+         </optional>
+         <zeroOrMore>
+            <choice>
+               <ref name="sort.element"/>
+               <ref name="with-param.element"/>
+            </choice>
+         </zeroOrMore>
+      </element>
+   </define>
+   <define name="apply-imports.element">
+      <element name="apply-imports">
+         <ref name="extension.atts"/>
+      </element>
+   </define>
+   <define name="call-template.element">
+      <element name="call-template">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <ref name="qname.datatype"/>
+         </attribute>
+         <zeroOrMore>
+            <ref name="with-param.element"/>
+         </zeroOrMore>
+      </element>
+   </define>
+   <define name="namespace-alias.element">
+      <element name="namespace-alias">
+         <ref name="extension.atts"/>
+         <attribute name="stylesheet-prefix">
+            <ref name="prefix.datatype"/>
+         </attribute>
+         <attribute name="result-prefix">
+            <ref name="prefix.datatype"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="element.element">
+      <element name="element">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <choice>
+               <ref name="qname.datatype"/>
+               <ref name="expr-avt.datatype"/>
+            </choice>
+         </attribute>
+         <optional>
+            <attribute name="namespace">
+               <choice>
+                  <data type="anyURI"/>
+                  <ref name="brace-avt.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="use-attribute-sets">
+               <ref name="qnames.datatype"/>
+            </attribute>
+         </optional>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="attribute.element">
+      <element name="attribute">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <choice>
+               <ref name="qname.datatype"/>
+               <ref name="expr-avt.datatype"/>
+            </choice>
+         </attribute>
+         <optional>
+            <attribute name="namespace">
+               <choice>
+                  <data type="anyURI"/>
+                  <ref name="brace-avt.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="attribute-set.element">
+      <element name="attribute-set">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <ref name="qname.datatype"/>
+         </attribute>
+         <optional>
+            <attribute name="use-attribute-sets">
+               <ref name="qnames.datatype"/>
+            </attribute>
+         </optional>
+         <zeroOrMore>
+            <ref name="attribute.element"/>
+         </zeroOrMore>
+      </element>
+   </define>
+   <define name="text.element">
+      <element name="text">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="disable-output-escaping">
+               <choice>
+                  <value type="string">yes</value>
+                  <value type="string">no</value>
+               </choice>
+            </attribute>
+         </optional>
+         <text/>
+      </element>
+   </define>
+   <define name="processing-instruction.element">
+      <element name="processing-instruction">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <choice>
+               <data type="NCName"/>
+               <ref name="expr-avt.datatype"/>
+            </choice>
+         </attribute>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="comment.element">
+      <element name="comment">
+         <ref name="extension.atts"/>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="copy.element">
+      <element name="copy">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="use-attribute-sets">
+               <ref name="qnames.datatype"/>
+            </attribute>
+         </optional>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="value-of.element">
+      <element name="value-of">
+         <ref name="extension.atts"/>
+         <attribute name="select">
+            <ref name="expression.datatype"/>
+         </attribute>
+         <optional>
+            <attribute name="disable-output-escaping">
+               <choice>
+                  <value type="string">yes</value>
+                  <value type="string">no</value>
+               </choice>
+            </attribute>
+         </optional>
+      </element>
+   </define>
+   <define name="number.element">
+      <element name="number">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="level">
+               <choice>
+                  <value type="string">single</value>
+                  <value type="string">multiple</value>
+                  <value type="string">any</value>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="count">
+               <ref name="pattern.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="from">
+               <ref name="pattern.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="value">
+               <ref name="expression.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="format">
+               <ref name="avt.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="lang">
+               <choice>
+                  <data type="NMTOKEN"/>
+                  <ref name="expr-avt.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="letter-value">
+	       <choice>
+		  <value type="string">alphabetic</value>
+		  <value type="string">traditional</value>
+		  <ref name="expr-avt.datatype"/>
+	       </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="grouping-separator">
+               <choice>
+                  <ref name="char.datatype"/>
+                  <ref name="expr-avt.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="grouping-size">
+               <choice>
+                  <ref name="number.datatype"/>
+                  <ref name="expr-avt.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+      </element>
+   </define>
+   <define name="for-each.element">
+      <element name="for-each">
+         <ref name="extension.atts"/>
+         <attribute name="select">
+            <ref name="expression.datatype"/>
+         </attribute>
+         <group>
+            <zeroOrMore>
+               <ref name="sort.element"/>
+            </zeroOrMore>
+            <ref name="template.model"/>
+         </group>
+      </element>
+   </define>
+   <define name="if.element">
+      <element name="if">
+         <ref name="extension.atts"/>
+         <attribute name="test">
+            <ref name="expression.datatype"/>
+         </attribute>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="choose.element">
+      <element name="choose">
+         <ref name="extension.atts"/>
+         <group>
+            <oneOrMore>
+               <ref name="when.element"/>
+            </oneOrMore>
+            <optional>
+               <ref name="otherwise.element"/>
+            </optional>
+         </group>
+      </element>
+   </define>
+   <define name="when.element">
+      <element name="when">
+         <ref name="extension.atts"/>
+         <attribute name="test">
+            <ref name="expression.datatype"/>
+         </attribute>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="otherwise.element">
+      <element name="otherwise">
+         <ref name="extension.atts"/>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="sort.element">
+      <element name="sort">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="select">
+               <ref name="expression.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="lang">
+               <choice>
+                  <data type="NMTOKEN"/>
+                  <ref name="expr-avt.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="data-type">
+	       <choice>
+		  <value type="string">text</value>
+		  <value type="string">number</value>
+		  <ref name="qname-but-not-ncname.datatype"/>
+		  <ref name="expr-avt.datatype"/>
+	       </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="order">
+	       <choice>
+		  <value type="string">ascending</value>
+		  <value type="string">descending</value>
+		  <ref name="expr-avt.datatype"/>
+	       </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="case-order">
+	       <choice>
+		  <value type="string">upper-first</value>
+		  <value type="string">lower-first</value>
+		  <ref name="expr-avt.datatype"/>
+	       </choice>
+            </attribute>
+         </optional>
+      </element>
+   </define>
+   <define name="variable.element">
+      <element name="variable">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <ref name="qname.datatype"/>
+         </attribute>
+         <choice>
+            <attribute name="select">
+               <ref name="expression.datatype"/>
+            </attribute>
+            <ref name="template.model"/>
+         </choice>
+      </element>
+   </define>
+   <define name="param.element">
+      <element name="param">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <ref name="qname.datatype"/>
+         </attribute>
+         <choice>
+            <attribute name="select">
+               <ref name="expression.datatype"/>
+            </attribute>
+            <ref name="template.model"/>
+         </choice>
+      </element>
+   </define>
+   <define name="copy-of.element">
+      <element name="copy-of">
+         <ref name="extension.atts"/>
+         <attribute name="select">
+            <ref name="expression.datatype"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="with-param.element">
+      <element name="with-param">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <ref name="qname.datatype"/>
+         </attribute>
+         <choice>
+            <attribute name="select">
+               <ref name="expression.datatype"/>
+            </attribute>
+            <ref name="template.model"/>
+         </choice>
+      </element>
+   </define>
+   <define name="key.element">
+      <element name="key">
+         <ref name="extension.atts"/>
+         <attribute name="name">
+            <ref name="qname.datatype"/>
+         </attribute>
+         <attribute name="match">
+            <ref name="pattern.datatype"/>
+         </attribute>
+         <attribute name="use">
+            <ref name="expression.datatype"/>
+         </attribute>
+      </element>
+   </define>
+   <define name="decimal-format.element">
+      <element name="decimal-format">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="name">
+               <ref name="qname.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="decimal-separator">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="grouping-separator">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="infinity">
+               <text/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="minus-sign">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="NaN">
+               <text/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="percent">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="per-mille">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="zero-digit">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="digit">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="pattern-separator">
+               <ref name="char.datatype"/>
+            </attribute>
+         </optional>
+      </element>
+   </define>
+   <define name="message.element">
+      <element name="message">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="terminate">
+               <choice>
+                  <value type="string">yes</value>
+                  <value type="string">no</value>
+               </choice>
+            </attribute>
+         </optional>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="fallback.element">
+      <element name="fallback">
+         <ref name="extension.atts"/>
+         <ref name="template.model"/>
+      </element>
+   </define>
+   <define name="output.element">
+      <element name="output">
+         <ref name="extension.atts"/>
+         <optional>
+            <attribute name="method">
+               <choice>
+                  <value type="string">xml</value>
+                  <value type="string">html</value>
+                  <value type="string">text</value>
+                  <ref name="qname-but-not-ncname.datatype"/>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="version">
+               <data type="NMTOKEN"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="encoding">
+               <text/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="omit-xml-declaration">
+               <choice>
+                  <value type="string">yes</value>
+                  <value type="string">no</value>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="standalone">
+               <choice>
+                  <value type="string">yes</value>
+                  <value type="string">no</value>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="doctype-public">
+               <text/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="doctype-system">
+               <text/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="cdata-section-elements">
+               <ref name="qnames.datatype"/>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="indent">
+               <choice>
+                  <value type="string">yes</value>
+                  <value type="string">no</value>
+               </choice>
+            </attribute>
+         </optional>
+         <optional>
+            <attribute name="media-type">
+               <text/>
+            </attribute>
+         </optional>
+      </element>
+   </define>
+   <define name="prefixes.datatype">
+      <list>
+         <zeroOrMore>
+            <choice>
+               <data type="NCName"/>
+               <value>#default</value>
+            </choice>
+         </zeroOrMore>
+      </list>
+   </define>
+   <define name="prefix.datatype">
+      <choice>
+	 <data type="NCName"/>
+	 <value>#default</value>
+      </choice>
+   </define>
+   <define name="wildcards.datatype">
+      <list>
+         <zeroOrMore>
+	    <choice>
+	       <data type="QName"/>
+	       <data type="token">
+		  <param name="pattern">\*|\i\c*:\*</param>
+	       </data>
+	    </choice>
+         </zeroOrMore>
+      </list> 
+   </define>
+   <define name="qname.datatype">
+      <data type="QName"/>
+   </define>
+   <define name="qnames.datatype">
+      <list>
+         <zeroOrMore>
+            <data type="QName"/>
+         </zeroOrMore>
+      </list>
+   </define>
+   <define name="char.datatype">
+      <data type="string">
+         <param name="length">1</param>
+      </data>
+   </define>
+   <define name="number.datatype">
+      <data type="decimal"/>
+   </define>
+   <define name="expression.datatype">
+      <text/>
+   </define>
+   <define name="pattern.datatype">
+      <text/>
+   </define>
+   <define name="qname-but-not-ncname.datatype">
+      <data type="QName">
+        <param name="pattern">.*:.*</param>
+      </data>
+   </define>
+   <!-- An AVT containing at least one expression. -->
+   <define name="expr-avt.datatype">
+      <data type="string">
+         <param name="pattern">([^\{\}]|\{\{|\}\})*\{([^&#34;'\{\}]|&#34;[^&#34;]*&#34;|'[^']*')+\}([^\{\}]|\{\{|\}\}|\{([^&#34;'\{\}]|&#34;[^&#34;]*&#34;|'[^']*')+\})*</param>
+      </data>
+   </define>
+   <!-- An AVT containing at least one brace; ie where instantiated AVT
+        is not the same as the literal AVT. -->
+   <define name="brace-avt.datatype">
+      <data type="string">
+         <param name="pattern">[^\{\}]*(\{\{|\}\}|\{([^&#34;'\{\}]|&#34;[^&#34;]*&#34;|'[^']*')+\})([^\{\}]|\{\{|\}\}|\{([^&#34;'\{\}]|&#34;[^&#34;]*&#34;|'[^']*')+\})*</param>
+      </data>
+   </define>
+   <define name="avt.datatype">
+      <data type="string">
+         <param name="pattern">([^\{\}]|\{\{|\}\}|\{([^&#34;'\{\}]|&#34;[^&#34;]*&#34;|'[^']*')+\})*</param>
+      </data>
+   </define>
+</grammar>
diff --git a/xml/tests/src/com/intellij/codeInsight/SearchingInXmlTest.java b/xml/tests/src/com/intellij/codeInsight/SearchingInXmlTest.java
new file mode 100644
index 0000000..64f96c8
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/SearchingInXmlTest.java
@@ -0,0 +1,27 @@
+package com.intellij.codeInsight;
+
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.testFramework.LightIdeaTestCase;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.util.XmlUtil;
+
+/**
+ * author: lesya
+ */
+public class SearchingInXmlTest extends LightIdeaTestCase {
+  public void test() throws IncorrectOperationException {
+    XmlTag xmlTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<root>" +
+                                                     "<tag1><name>name1</name><value>1</value></tag1>" +
+                                                     "<tag1><name>name2</name><value>2</value></tag1>" +
+                                                     "<tag1><name>name3</name><value>3</value></tag1>" +
+                                                     "<tag1><name>name4</name><value>4</value></tag1>" +
+                                                     "<tag1><name>name5</name><value>5</value></tag1>" +
+                                                     "<tag1><name>name6</name><value>6</value></tag1>" +
+                                                     "<tag1><name>name7</name><value>7</value></tag1>" +
+                                                     "</root>");
+    XmlTag found = XmlUtil.find("name", "name4", "tag1", xmlTag);
+
+    assertEquals("4", found.findFirstSubTag("value").getValue().getText());
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlBuilderTest.java b/xml/tests/src/com/intellij/codeInsight/XmlBuilderTest.java
new file mode 100644
index 0000000..b735141
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlBuilderTest.java
@@ -0,0 +1,257 @@
+/*
+ * @author max
+ */
+package com.intellij.codeInsight;
+
+import com.intellij.psi.impl.source.parsing.xml.XmlBuilder;
+import com.intellij.psi.impl.source.parsing.xml.XmlBuilderDriver;
+import com.intellij.testFramework.LightCodeInsightTestCase;
+import org.jetbrains.annotations.Nullable;
+
+public class XmlBuilderTest extends LightCodeInsightTestCase {
+  private static class TestXmlBuilder implements XmlBuilder {
+    private final StringBuilder builder = new StringBuilder();
+    private final StringBuilder currentPhysicalText = new StringBuilder();
+    private final StringBuilder currentDisplayText = new StringBuilder();
+    private final ProcessingOrder myTagProcessingOrder;
+
+    public TestXmlBuilder(final ProcessingOrder tagsAndAttributes) {
+      myTagProcessingOrder = tagsAndAttributes;
+    }
+
+    @Override
+    public void attribute(final CharSequence name, final CharSequence value, final int startoffset, final int endoffset) {
+      flushText();
+      builder.append("ATT: name='").append(name).append("' value='").append(value).append("'\n");
+    }
+
+    @Override
+    public void endTag(final CharSequence localName, final String namespace, final int startoffset, final int endoffset) {
+      flushText();
+      builder.append("ENDTAG: name='").append(localName).append("' namespace='").append(namespace).append("'\n");
+    }
+
+    @Override
+    public void doctype(@Nullable final CharSequence publicId, @Nullable final CharSequence systemId, final int startOffset, final int endOffset) {
+        }
+
+    @Override
+    public ProcessingOrder startTag(final CharSequence localName, final String namespace, final int startoffset, final int endoffset,
+                                    final int headerEndOffset) {
+      flushText();
+      builder.append("TAG: name='").append(localName).append("' namespace='").append(namespace).append("'\n");
+      return myTagProcessingOrder;
+    }
+
+    @Override
+    public void textElement(final CharSequence display, final CharSequence physical, final int startoffset, final int endoffset) {
+      currentPhysicalText.append(physical);
+      currentDisplayText.append(display);
+    }
+
+    @Override
+    public void entityRef(final CharSequence ref, final int startOffset, final int endOffset) {
+      flushText();
+      builder.append("REF: '").append(ref).append("'\n");
+    }
+
+    @Override
+    public void error(String message, int startOffset, int endOffset) {
+      flushText();
+      builder.append("ERROR: '").append(message).append("'\n");
+    }
+
+    private void flushText() {
+      if (currentPhysicalText.length() > 0) {
+        builder.append("TEXT: '").append(currentPhysicalText).append("' DISPLAY: '").append(currentDisplayText).append("'\n");
+        currentPhysicalText.setLength(0);
+        currentDisplayText.setLength(0);
+      }
+    }
+
+    public String getResult() {
+      flushText();
+      return builder.toString();
+    }
+  }
+  
+  public void testEmptyXml() throws Exception {
+    doTest("<root/>", "TAG: name='root' namespace=''\n" +
+                      "ENDTAG: name='root' namespace=''\n", XmlBuilder.ProcessingOrder.TAGS_AND_ATTRIBUTES);
+  }
+
+  public void testRealJspx() throws Exception {
+    doTest(
+      /* Test: */
+      "<jsp:root xmlns:jsp=\"http://java.sun.com/JSP/Page\" xmlns=\"http://www.w3.org/1999/xhtml\" version=\"2.0\"\n" +
+      "          xmlns:spring=\"http://www.springframework.org/tags\" xmlns:c=\"http://java.sun.com/jsp/jstl/core\">\n" +
+      "<html>\n" +
+      "  <c:set var=\"foo\" value=\"${1}\"/>\n" +
+      "  <c:set var=\"foobar\" value=\"${2}\"/>\n" +
+      "  <spring:bind path=\"test.fieldName\">\n" +
+      "    <jsp:scriptlet></jsp:scriptlet>\n" +
+      "    </spring:bind>\n" +
+      "</html>\n" +
+      "</jsp:root>",
+
+      /* Expected result: */
+      "TAG: name='root' namespace='http://java.sun.com/JSP/Page'\n" +
+      "ATT: name='xmlns:jsp' value='http://java.sun.com/JSP/Page'\n" +
+      "ATT: name='xmlns' value='http://www.w3.org/1999/xhtml'\n" +
+      "ATT: name='version' value='2.0'\n" +
+      "ATT: name='xmlns:spring' value='http://www.springframework.org/tags'\n" +
+      "ATT: name='xmlns:c' value='http://java.sun.com/jsp/jstl/core'\n" +
+      "TAG: name='html' namespace='http://www.w3.org/1999/xhtml'\n" +
+      "TAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
+      "ATT: name='var' value='foo'\n" +
+      "ATT: name='value' value='${1}'\n" +
+      "ENDTAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
+      "TAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
+      "ATT: name='var' value='foobar'\n" +
+      "ATT: name='value' value='${2}'\n" +
+      "ENDTAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
+      "TAG: name='bind' namespace='http://www.springframework.org/tags'\n" +
+      "ATT: name='path' value='test.fieldName'\n" +
+      "TAG: name='scriptlet' namespace='http://java.sun.com/JSP/Page'\n" +
+      "ENDTAG: name='scriptlet' namespace='http://java.sun.com/JSP/Page'\n" +
+      "ENDTAG: name='bind' namespace='http://www.springframework.org/tags'\n" +
+      "ENDTAG: name='html' namespace='http://www.w3.org/1999/xhtml'\n" +
+      "ENDTAG: name='root' namespace='http://java.sun.com/JSP/Page'\n",
+      XmlBuilder.ProcessingOrder.TAGS_AND_ATTRIBUTES);
+  }
+
+  public void testRealJspxNoAttributes() throws Exception {
+    doTest(
+      /* Test: */
+      "<jsp:root xmlns:jsp=\"http://java.sun.com/JSP/Page\" xmlns=\"http://www.w3.org/1999/xhtml\" version=\"2.0\"\n" +
+      "          xmlns:spring=\"http://www.springframework.org/tags\" xmlns:c=\"http://java.sun.com/jsp/jstl/core\">\n" +
+      "<html>\n" +
+      "  <c:set var=\"foo\" value=\"${1}\"/>\n" +
+      "  <c:set var=\"foobar\" value=\"${2}\"/>\n" +
+      "  <spring:bind path=\"test.fieldName\">\n" +
+      "    <jsp:scriptlet></jsp:scriptlet>\n" +
+      "    </spring:bind>\n" +
+      "</html>\n" +
+      "</jsp:root>",
+
+      /* Expected result: */
+      "TAG: name='root' namespace='http://java.sun.com/JSP/Page'\n" +
+      "TAG: name='html' namespace='http://www.w3.org/1999/xhtml'\n" +
+      "TAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
+      "ENDTAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
+      "TAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
+      "ENDTAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
+      "TAG: name='bind' namespace='http://www.springframework.org/tags'\n" +
+      "TAG: name='scriptlet' namespace='http://java.sun.com/JSP/Page'\n" +
+      "ENDTAG: name='scriptlet' namespace='http://java.sun.com/JSP/Page'\n" +
+      "ENDTAG: name='bind' namespace='http://www.springframework.org/tags'\n" +
+      "ENDTAG: name='html' namespace='http://www.w3.org/1999/xhtml'\n" +
+      "ENDTAG: name='root' namespace='http://java.sun.com/JSP/Page'\n",
+      XmlBuilder.ProcessingOrder.TAGS);
+  }
+
+
+  public void testNamespaceOverride() throws Exception {
+    doTest(
+      "<c:x xmlns:c=\"ns1\">\n" +
+      "  <c:y/>\n" +
+      "  <c:x xmlns:c=\"ns2\">\n" +
+      "    <c:y/>\n" +
+      "  </c:x>\n" +
+      "  <c:y/>\n" +
+      "</c:x>\n",
+
+      "TAG: name='x' namespace='ns1'\n" +
+      "ATT: name='xmlns:c' value='ns1'\n" +
+      "TAG: name='y' namespace='ns1'\n" +
+      "ENDTAG: name='y' namespace='ns1'\n" +
+      "TAG: name='x' namespace='ns2'\n" +
+      "ATT: name='xmlns:c' value='ns2'\n" +
+      "TAG: name='y' namespace='ns2'\n" +
+      "ENDTAG: name='y' namespace='ns2'\n" +
+      "ENDTAG: name='x' namespace='ns2'\n" +
+      "TAG: name='y' namespace='ns1'\n" +
+      "ENDTAG: name='y' namespace='ns1'\n" +
+      "ENDTAG: name='x' namespace='ns1'\n",
+      XmlBuilder.ProcessingOrder.TAGS_AND_ATTRIBUTES);
+  }
+
+  public void testSimpleEntityResolution() throws Exception {
+    doTest(
+      "<root>&lt;</root>",
+      "TAG: name='root' namespace=''\n" +
+      "TEXT: '&lt;' DISPLAY: '<'\n" +
+      "ENDTAG: name='root' namespace=''\n",
+      XmlBuilder.ProcessingOrder.TAGS_AND_TEXTS);
+  }
+
+  public void testCDATA() throws Exception {
+    doTest(
+      "<root><![CDATA[<asis/>]]></root>",
+      "TAG: name='root' namespace=''\n" +
+      "TEXT: '<![CDATA[<asis/>]]>' DISPLAY: '<asis/>'\n" +
+      "ENDTAG: name='root' namespace=''\n",
+      XmlBuilder.ProcessingOrder.TAGS_AND_TEXTS
+    );
+  }
+
+  public void testErrors() throws Exception {
+    doTest(
+      "<root>" +
+      "<foo>" +
+      "<bar" +
+      "<" +
+      "</root>",
+      "TAG: name='root' namespace=''\n" +
+      "TAG: name='foo' namespace=''\n" +
+      "ERROR: 'Element foo is not closed'\n" +
+      "ENDTAG: name='foo' namespace=''\n" +
+      "TAG: name='bar' namespace=''\n" +
+      "ERROR: 'Tag start is not closed'\n" +
+      "ENDTAG: name='bar' namespace=''\n" +
+      "TAG: name='' namespace=''\n" +
+      "ERROR: 'Tag name expected'\n" +
+      "ENDTAG: name='' namespace=''\n" +
+      "ENDTAG: name='root' namespace=''\n",
+      XmlBuilder.ProcessingOrder.TAGS_AND_TEXTS
+    );
+  }
+
+  public void testComments() throws Exception {
+    doTest(
+      "<root>" +
+      "<foo>" +
+      "<!--aa-->" +
+      "</foo>" +
+      "<foo>" +
+      "<!---->" +
+      "</foo>" +
+      "<foo>" +
+      "aaa<!--aa-->aaa" +
+      "</foo>" +
+      "<foo>" +
+      "\naaa\n<!--aa-->\naaa\n" +
+      "</foo>" +
+      "</root>",
+      "TAG: name='root' namespace=''\n" +
+      "TAG: name='foo' namespace=''\n" +
+      "ENDTAG: name='foo' namespace=''\n" +
+      "TAG: name='foo' namespace=''\n" +
+      "ENDTAG: name='foo' namespace=''\n" +
+      "TAG: name='foo' namespace=''\n" +
+      "TEXT: 'aaaaaa' DISPLAY: 'aaaaaa'\n" +
+      "ENDTAG: name='foo' namespace=''\n" +
+      "TAG: name='foo' namespace=''\n" +
+      "TEXT: '\naaa\n\naaa\n' DISPLAY: '\naaa\n\naaa\n'\n" +
+      "ENDTAG: name='foo' namespace=''\n" +
+      "ENDTAG: name='root' namespace=''\n",
+      XmlBuilder.ProcessingOrder.TAGS_AND_TEXTS
+    );
+  }
+
+  private static void doTest(String xml, String expectedEventSequence, final XmlBuilder.ProcessingOrder tagsAndAttributes) throws Exception {
+    final TestXmlBuilder builder = new TestXmlBuilder(tagsAndAttributes);
+    new XmlBuilderDriver(xml).build(builder);
+    assertEquals(expectedEventSequence, builder.getResult());
+  }
+}
\ No newline at end of file
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlDtdTest.java b/xml/tests/src/com/intellij/codeInsight/XmlDtdTest.java
new file mode 100644
index 0000000..fcf3713
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlDtdTest.java
@@ -0,0 +1,322 @@
+package com.intellij.codeInsight;
+
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiFileFactory;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.testFramework.PsiTestCase;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.impl.dtd.XmlElementDescriptorImpl;
+import com.intellij.xml.impl.dtd.XmlNSDescriptorImpl;
+
+/**
+ * @author Mike
+ */
+public class XmlDtdTest extends PsiTestCase {
+  public void testDocumentDescriptor1() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor("<!ELEMENT principals (#PCDATA)><!ELEMENT data-sources (#PCDATA)>");
+
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag("principals"));
+    assertNotNull(elementDescriptor);
+
+    elementDescriptor = NSDescriptor.getElementDescriptor(tag("data-sources"));
+    assertNotNull(elementDescriptor);
+
+    elementDescriptor = NSDescriptor.getElementDescriptor(tag("xxx"));
+    assertNull(elementDescriptor);
+  }
+
+  public void testElementDescriptor1() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor("<!ELEMENT principals (#PCDATA)><!ELEMENT data-sources (#PCDATA)>");
+
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag("principals"));
+    assertEquals("principals", elementDescriptor.getName());
+
+    elementDescriptor = NSDescriptor.getElementDescriptor(tag("data-sources"));
+    assertEquals("data-sources", elementDescriptor.getName());
+  }
+
+  public void testElementDescriptor2() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<!ELEMENT principals (#PCDATA)><!ELEMENT data-sources ANY>" +
+        "<!ELEMENT read-access (namespace-resource)><!ELEMENT group EMPTY>");
+
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag("principals"));
+    assertEquals(elementDescriptor.getContentType(), XmlElementDescriptor.CONTENT_TYPE_MIXED);
+
+    elementDescriptor = NSDescriptor.getElementDescriptor(tag("data-sources"));
+    assertEquals(elementDescriptor.getContentType(), XmlElementDescriptor.CONTENT_TYPE_ANY);
+
+    elementDescriptor = NSDescriptor.getElementDescriptor(tag("read-access"));
+    assertEquals(elementDescriptor.getContentType(), XmlElementDescriptor.CONTENT_TYPE_CHILDREN);
+
+    elementDescriptor = NSDescriptor.getElementDescriptor(tag("group"));
+    assertEquals(elementDescriptor.getContentType(), XmlElementDescriptor.CONTENT_TYPE_EMPTY);
+  }
+
+  public void testElementDescriptor3() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<!ELEMENT principals ANY><!ATTLIST principals path CDATA #IMPLIED smtp-host CDATA #REQUIRED>" +
+        "<!ATTLIST principals address CDATA #IMPLIED>");
+
+    final XmlTag tag = tag("principals");
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("path", tag);
+    assertNotNull(attributeDescriptor);
+
+    attributeDescriptor = elementDescriptor.getAttributeDescriptor("xxx", tag);
+    assertNull(attributeDescriptor);
+
+    attributeDescriptor = elementDescriptor.getAttributeDescriptor("smtp-host", tag);
+    assertNotNull(attributeDescriptor);
+
+    attributeDescriptor = elementDescriptor.getAttributeDescriptor("address", tag);
+    assertNotNull(attributeDescriptor);
+
+    XmlAttributeDescriptor[] descriptors = elementDescriptor.getAttributesDescriptors(tag);
+    assertEquals("path", descriptors[0].getName());
+    assertEquals("smtp-host", descriptors[1].getName());
+    assertEquals("address", descriptors[2].getName());
+    assertEquals(3, descriptors.length);
+  }
+
+  public void testElementDescriptor4() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<!ELEMENT orion-application (ejb-module*, persistence?, namespace-access)>" +
+        "<!ELEMENT ejb-module ANY>" +
+        "<!ELEMENT persistence ANY>" +
+        "<!ELEMENT namespace-access ANY>");
+
+    XmlTag documentTag = tag("orion-application");
+    XmlElementDescriptorImpl elementDescriptor = (XmlElementDescriptorImpl)NSDescriptor.getElementDescriptor(documentTag);
+
+    XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(documentTag);
+
+    assertEquals(3, elements.length);
+    assertEquals("ejb-module", elements[0].getName());
+    assertEquals("persistence", elements[1].getName());
+    assertEquals("namespace-access", elements[2].getName());
+
+    elements = elements[0].getElementsDescriptors(documentTag);
+    assertEquals(4, elements.length);
+    assertEquals("orion-application", elements[0].getName());
+    assertEquals("ejb-module", elements[1].getName());
+    assertEquals("persistence", elements[2].getName());
+    assertEquals("namespace-access", elements[3].getName());
+  }
+
+  public void testAttributeDescriptor1() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<!ELEMENT principals ANY><!ATTLIST principals path CDATA #IMPLIED>");
+
+    final XmlTag tag = tag("principals");
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("path", tag);
+    assertEquals("path", attributeDescriptor.getName());
+    assertTrue(!attributeDescriptor.isRequired());
+    assertTrue(!attributeDescriptor.isFixed());
+    assertTrue(!attributeDescriptor.isEnumerated());
+    assertNull(attributeDescriptor.getDefaultValue());
+  }
+
+  public void testAttributeDescriptor2() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<!ELEMENT principals ANY><!ATTLIST principals path CDATA #IMPLIED>");
+
+    final XmlTag tag = tag("principals");
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("path", tag);
+    assertTrue(!attributeDescriptor.isRequired());
+    assertTrue(!attributeDescriptor.isFixed());
+    assertTrue(!attributeDescriptor.isEnumerated());
+    assertNull(attributeDescriptor.getDefaultValue());
+  }
+
+  public void testAttributeDescriptor3() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<!ELEMENT toc ANY> <!ATTLIST toc version CDATA #FIXED \"1.0\">");
+
+    final XmlTag tag = tag("toc");
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("version", tag);
+    assertTrue(!attributeDescriptor.isRequired());
+    assertTrue(attributeDescriptor.isFixed());
+    assertTrue(!attributeDescriptor.isEnumerated());
+    assertEquals("1.0", attributeDescriptor.getDefaultValue());
+  }
+
+  public void testAttributeDescriptor4() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<!ELEMENT toc ANY> <!ATTLIST toc remote (true|false) \"false\">");
+
+    final XmlTag tag = tag("toc");
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("remote", tag);
+    assertTrue(!attributeDescriptor.isRequired());
+    assertTrue(!attributeDescriptor.isFixed());
+    assertTrue(attributeDescriptor.isEnumerated());
+    assertEquals("false", attributeDescriptor.getDefaultValue());
+
+    String[] values = attributeDescriptor.getEnumeratedValues();
+    assertEquals(2, values.length);
+    assertEquals("true", values[0]);
+    assertEquals("false", values[1]);
+  }
+
+  public void testAttributeDescriptor5() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<!ELEMENT toc ANY> <!ATTLIST toc remote (0|1|2) #REQUIRED>");
+
+    final XmlTag tag = tag("toc");
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("remote", tag);
+    assertTrue(attributeDescriptor.isRequired());
+    assertTrue(!attributeDescriptor.isFixed());
+    assertTrue(attributeDescriptor.isEnumerated());
+    assertNull(attributeDescriptor.getDefaultValue());
+
+    String[] values = attributeDescriptor.getEnumeratedValues();
+    assertEquals(3, values.length);
+    assertEquals("0", values[0]);
+    assertEquals("1", values[1]);
+    assertEquals("2", values[2]);
+  }
+
+  public void testEntityDeclElement1() throws Exception {
+    final XmlNSDescriptor NSDescriptor = createDescriptor(
+      "<!ENTITY % types \"fileset | patternset \"> <!ELEMENT project (target | taskdef | %types; | property )*> " +
+      "<!ELEMENT target><!ELEMENT taskdef><!ELEMENT fileset><!ELEMENT patternset><!ELEMENT property>");
+
+    XmlTag projectTag = tag("project");
+    final XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(projectTag);
+
+    final XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(projectTag);
+
+    assertEquals(5, elements.length);
+  }
+
+  public void testEntityDecl1() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<!ENTITY % boolean \"(true|false|on|off|yes|no)\"> <!ELEMENT toc ANY> <!ATTLIST toc remote %boolean; \"false\"");
+
+    final XmlTag tag = tag("toc");
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("remote", tag);
+    assertTrue(!attributeDescriptor.isRequired());
+    assertTrue(!attributeDescriptor.isFixed());
+    assertTrue(attributeDescriptor.isEnumerated());
+    assertEquals("false", (attributeDescriptor.getDefaultValue()));
+
+    String[] values = attributeDescriptor.getEnumeratedValues();
+    assertEquals(6, values.length);
+    assertEquals("true", values[0]);
+    assertEquals("false", values[1]);
+    assertEquals("on", values[2]);
+    assertEquals("off", values[3]);
+    assertEquals("yes", values[4]);
+    assertEquals("no", values[5]);
+  }
+
+  public void testEntityDecl2() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<!ENTITY % coreattrs \"id D #IMPLIED\"> <!ELEMENT a ANY> <!ATTLIST a %coreattrs; version CDATA #FIXED \"1.0\"");
+
+    final XmlTag tag = tag("a");
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    final XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
+    assertEquals(2, attributes.length);
+    assertEquals("id", attributes[0].getName());
+    assertEquals("version", attributes[1].getName());
+  }
+
+  public void testEntityDecl3() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<!ENTITY % att1 \"id1 D #IMPLIED\"> <!ENTITY % att2 \"id2 D #IMPLIED\"> <!ELEMENT a ANY> <!ATTLIST a %att1; %att2; ");
+
+    final XmlTag tag = tag("a");
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    final XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
+    assertEquals(2, attributes.length);
+    assertEquals("id1", attributes[0].getName());
+    assertEquals("id2", attributes[1].getName());
+  }
+
+  public void testEntityDecl4() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<!ENTITY % boolean \'(true|false|on|off|yes|no)\'> <!ENTITY % bool \"%boolean;\">  <!ELEMENT toc ANY> <!ATTLIST toc remote %bool; \"false\"");
+
+    final XmlTag tag = tag("toc");
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("remote", tag);
+    assertTrue(!attributeDescriptor.isRequired());
+    assertTrue(!attributeDescriptor.isFixed());
+    assertTrue(attributeDescriptor.isEnumerated());
+    assertEquals("false", attributeDescriptor.getDefaultValue());
+
+    String[] values = attributeDescriptor.getEnumeratedValues();
+    assertEquals(6, values.length);
+    assertEquals("true", values[0]);
+    assertEquals("false", values[1]);
+    assertEquals("on", values[2]);
+    assertEquals("off", values[3]);
+    assertEquals("yes", values[4]);
+    assertEquals("no", values[5]);
+  }
+
+  public void testEntityDecl5() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<!ENTITY % boolean \"true | false\" > <!ELEMENT foo EMPTY> <!ATTLIST foo someBoolean (%boolean;) \"true\" someString CDATA #IMPLIED >");
+
+    final XmlTag tag = tag("foo");
+    final XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+    final XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
+
+    assertEquals(2, attributes.length);
+    assertEquals("someBoolean", attributes[0].getName());
+    assertEquals("someString", attributes[1].getName());
+
+    assertTrue(attributes[0].isEnumerated());
+    assertEquals(2, attributes[0].getEnumeratedValues().length);
+    assertEquals("true", attributes[0].getEnumeratedValues()[0]);
+    assertEquals("false", attributes[0].getEnumeratedValues()[1]);
+  }
+
+  public void testEmbeddedDtd1() throws Exception {
+    XmlFile xmlFile = (XmlFile)createDummyFile("test.xml",
+      "<!DOCTYPE tv [ <!ELEMENT tv (date)*> <!ELEMENT date (#PCDATA)> ]> <tv></tv>");
+
+    final XmlTag tag = xmlFile.getDocument().getRootTag();
+    assertNotNull(tag);
+    final XmlElementDescriptor desc = xmlFile.getDocument().getRootTagNSDescriptor().getElementDescriptor(tag);
+    assertNotNull(desc);
+
+    final XmlElementDescriptor[] elements = desc.getElementsDescriptors(tag);
+    assertEquals(1, elements.length);
+    assertEquals("date", elements[0].getName());
+  }
+
+  private XmlNSDescriptor createDescriptor(String dtdText) throws Exception {
+    PsiFile dtdFile = createDummyFile("test.dtd", dtdText);
+
+    XmlNSDescriptorImpl descriptor = new XmlNSDescriptorImpl();
+    descriptor.init(dtdFile);
+    return descriptor;
+  }
+
+  private XmlTag tag(String tagName) throws Exception {
+    XmlFile file = (XmlFile)PsiFileFactory.getInstance(myPsiManager.getProject()).createFileFromText("tag.xml", "<" + tagName + "/>");
+    return file.getDocument().getRootTag();
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlEventsTest.java b/xml/tests/src/com/intellij/codeInsight/XmlEventsTest.java
new file mode 100644
index 0000000..5ccbdba
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlEventsTest.java
@@ -0,0 +1,238 @@
+package com.intellij.codeInsight;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.ex.DocumentEx;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.pom.PomManager;
+import com.intellij.pom.PomModel;
+import com.intellij.pom.PomModelAspect;
+import com.intellij.pom.event.PomChangeSet;
+import com.intellij.pom.event.PomModelEvent;
+import com.intellij.pom.event.PomModelListener;
+import com.intellij.pom.xml.XmlAspect;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.impl.source.PsiFileImpl;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlText;
+import com.intellij.testFramework.LightCodeInsightTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+
+public class XmlEventsTest extends LightCodeInsightTestCase {
+  public void test1() throws Exception{
+    final PomModel model = PomManager.getModel(getProject());
+    final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
+    model.addModelListener(listener);
+    final XmlTag tagFromText = XmlElementFactory.getInstance(getProject()).createTagFromText("<a/>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tagFromText.setAttribute("a", "b");
+      }
+    });
+
+    assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
+  }
+
+  public void test2() throws Exception{
+    final PomModel model = PomManager.getModel(getProject());
+    final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
+    model.addModelListener(listener);
+    final XmlTag tagFromText = XmlElementFactory.getInstance(getProject()).createTagFromText("<a>aaa</a>");
+    final XmlTag otherTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<a/>");
+    final XmlText xmlText = tagFromText.getValue().getTextElements()[0];
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        xmlText.insertAtOffset(otherTag, 2);
+      }
+    });
+
+    assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
+  }
+
+  public void test3() throws Exception{
+    final PomModel model = PomManager.getModel(getProject());
+    final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
+    model.addModelListener(listener);
+    final XmlTag tagFromText = XmlElementFactory.getInstance(getProject()).createTagFromText("<a>aaa</a>");
+    final XmlText xmlText = tagFromText.getValue().getTextElements()[0];
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        xmlText.insertText("bb", 2);
+      }
+    });
+
+    assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
+  }
+
+  public void test4() throws Exception{
+    final PomModel model = PomManager.getModel(getProject());
+    final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
+    model.addModelListener(listener);
+    final XmlTag tagFromText = XmlElementFactory.getInstance(getProject()).createTagFromText("<a>a </a>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tagFromText.addAfter(tagFromText.getValue().getTextElements()[0], tagFromText.getValue().getTextElements()[0]);
+      }
+    });
+
+    assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
+  }
+
+  public void test5() throws Exception{
+    final PomModel model = PomManager.getModel(getProject());
+    final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
+    model.addModelListener(listener);
+    final XmlTag tagFromText = XmlElementFactory.getInstance(getProject()).createTagFromText("<a>aaa</a>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tagFromText.delete();
+      }
+    });
+
+    assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
+  }
+
+  public void testBulkUpdate() throws Exception{
+    final PomModel model = PomManager.getModel(getProject());
+    final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
+    model.addModelListener(listener);
+    final PsiFile file = createFile("a.xml", "<a/>");
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        final Document document = PsiDocumentManager.getInstance(getProject()).getDocument(file);
+        ((DocumentEx)document).setInBulkUpdate(true);
+        document.insertString(0, " ");
+        commitDocument(document);
+        ((DocumentEx)document).setInBulkUpdate(false);
+      }
+    }.execute();
+    assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
+  }
+
+  public void testDocumentChange1() throws Exception{
+    final String rootTagText = "<a/>";
+    final String stringToInsert = "b=\"c\"";
+    final int positionToInsert = 2;
+
+    checkEventsByDocumentChange(rootTagText, positionToInsert, stringToInsert);
+  }
+
+  public void testDocumentChange2() throws Exception{
+    final String rootTagText = "<a />";
+    final String stringToInsert = "b=\"c\"";
+    final int positionToInsert = 3;
+
+    checkEventsByDocumentChange(rootTagText, positionToInsert, stringToInsert);
+  }
+
+
+  public void testDocumentChange3() throws Exception{
+    final String rootTagText = "<b><a /></b>";
+    final String stringToInsert = "b=\"c\"";
+    final int positionToInsert = 6;
+
+    checkEventsByDocumentChange(rootTagText, positionToInsert, stringToInsert);
+  }
+
+  public void testAttributeValueReplace() throws Exception {
+    final String text = "<target name=\"old\"/>";
+    final PomModel model = PomManager.getModel(getProject());
+    final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
+    model.addModelListener(listener);
+
+    final XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText(text);
+    final XmlAttribute attribute = tag.getAttribute("name", null);
+    assert attribute != null;
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        attribute.setValue("new");
+      }
+    });
+
+
+    assertEquals(attribute.getValue(), "new");
+    assertEquals("(Attribute \"name\" for tag \"target\" set to \"\"new\"\")\n", listener.getEventString());
+  }
+
+  private void checkEventsByDocumentChange(final String rootTagText, final int positionToInsert, final String stringToInsert)
+    throws Exception {
+    final PomModel model = PomManager.getModel(getProject());
+    final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
+    model.addModelListener(listener);
+    final XmlTag tagFromText = ((XmlFile)createFile("file.xml", rootTagText)).getDocument().getRootTag();
+    final PsiFileImpl containingFile = (PsiFileImpl)tagFromText.getContainingFile();
+    final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(getProject());
+    final Document document = documentManager.getDocument(containingFile);
+    CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
+      @Override
+      public void run() {
+        ApplicationManager.getApplication().runWriteAction(new Runnable() {
+          @Override
+          public void run() {
+            document.insertString(positionToInsert, stringToInsert);
+            documentManager.commitDocument(document);
+          }
+        });
+      }
+    }, "", null);
+
+    assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
+  }
+
+  private static class Listener implements PomModelListener{
+    private final XmlAspect myAspect;
+    private final StringBuffer myBuffer = new StringBuffer();
+
+    public Listener(XmlAspect modelAspect) {
+      myAspect = modelAspect;
+    }
+
+    @Override
+    public void modelChanged(PomModelEvent event) {
+      final PomChangeSet changeSet = event.getChangeSet(myAspect);
+      if(changeSet == null) return;
+      myBuffer.append(changeSet);
+      myBuffer.append("\n");
+    }
+
+    @Override
+    public boolean isAspectChangeInteresting(PomModelAspect aspect) {
+      return aspect == myAspect;
+    }
+
+    String getEventString(){
+      return myBuffer.toString();
+    }
+  }
+
+  private static void assertFileTextEquals(String targetDataName, String treeText) throws Exception {
+    String fullName = PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/')+ "/xml/tests/testData/psi/events" + File.separatorChar + targetDataName;
+    try{
+      String expectedText = loadFile(fullName);
+      assertEquals(expectedText.trim(), treeText.trim());
+    }
+    catch(FileNotFoundException e){
+      //FileUtil.writeToFile(new File(fullName), StringUtil.convertLineSeparators(treeText).getBytes("UTF-8"));
+      fail("No output file found. Created file "+fullName);
+    }
+  }
+
+
+  protected static String loadFile(String fullName) throws Exception {
+    String text = FileUtil.loadFile(new File(fullName)).trim();
+    text = StringUtil.convertLineSeparators(text);
+    return text;
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlInsightTest.java b/xml/tests/src/com/intellij/codeInsight/XmlInsightTest.java
new file mode 100644
index 0000000..cfc5426
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlInsightTest.java
@@ -0,0 +1,144 @@
+package com.intellij.codeInsight;
+
+import com.intellij.psi.PsiFileFactory;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.testFramework.PsiTestCase;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+
+/**
+ * @author Mike
+ */
+public class XmlInsightTest extends PsiTestCase {
+  public void testDocumentDescriptor1() throws Exception {
+    XmlFile file = createFile("<root><a></a><b></b><a></a></root>");
+    XmlNSDescriptor descriptor = createDescriptor(file);
+
+    XmlElementDescriptor element = descriptor.getElementDescriptor(file.getDocument().getRootTag());
+    assertNotNull(element);
+    assertEquals("root", element.getName());
+
+    element = descriptor.getElementDescriptor(file.getDocument().getRootTag().getSubTags()[0]);
+    assertNotNull(element);
+    assertEquals("a", element.getName());
+
+    element = descriptor.getElementDescriptor(file.getDocument().getRootTag().getSubTags()[1]);
+    assertNotNull(element);
+    assertEquals("b", element.getName());
+
+    element = descriptor.getElementDescriptor(file.getDocument().getRootTag().getSubTags()[2]);
+    assertNotNull(element);
+    assertEquals("a", element.getName());
+  }
+
+  public void testElementDescriptor1() throws Exception {
+    XmlFile file = createFile("<root><a></a><b></b><a></a></root>");
+    XmlNSDescriptor descriptor = createDescriptor(file);
+
+    XmlTag rootTag = file.getDocument().getRootTag();
+    XmlElementDescriptor element = descriptor.getElementDescriptor(rootTag);
+
+    XmlElementDescriptor[] elements = element.getElementsDescriptors(rootTag);
+
+    assertEquals(2, elements.length);
+    assertEquals("a", elements[0].getName());
+    assertEquals("b", elements[1].getName());
+  }
+
+  public void testElementDescriptor2() throws Exception {
+    XmlFile file = createFile("<root><a><b/></a><a><c/></a></root>");
+    XmlNSDescriptor descriptor = createDescriptor(file);
+
+    XmlTag rootTag = file.getDocument().getRootTag();
+    XmlElementDescriptor element = descriptor.getElementDescriptor(rootTag);
+    element = element.getElementsDescriptors(rootTag)[0];
+
+    XmlElementDescriptor[] elements = element.getElementsDescriptors(rootTag.getSubTags()[0]);
+
+    assertEquals(2, elements.length);
+    assertEquals("b", elements[0].getName());
+    assertEquals("c", elements[1].getName());
+  }
+
+  public void testElementDescriptor3() throws Exception {
+    XmlFile file = createFile("<root><a><b/><c></c></a><a><c/></a></root>");
+    XmlNSDescriptor descriptor = createDescriptor(file);
+
+    XmlTag rootTag = file.getDocument().getRootTag();
+    XmlElementDescriptor element = descriptor.getElementDescriptor(rootTag);
+    element = element.getElementsDescriptors(rootTag)[0];
+
+    XmlElementDescriptor[] elements = element.getElementsDescriptors(rootTag.getSubTags()[0]);
+
+    assertEquals(2, elements.length);
+    assertEquals("b", elements[0].getName());
+    //assertTrue(elements[0].getContentType() == XmlElementDescriptor.CONTENT_TYPE_EMPTY);
+
+    assertEquals("c", elements[1].getName());
+    //assertTrue(elements[1].getContentType() == XmlElementDescriptor.CONTENT_TYPE_CHILDREN);
+  }
+
+  public void testElementDescriptor4() throws Exception {
+    XmlFile file = createFile("<root><a attr2=''></a><a attr1=''></a></root>");
+    XmlNSDescriptor descriptor = createDescriptor(file);
+
+    XmlTag rootTag = file.getDocument().getRootTag();
+    XmlElementDescriptor element = descriptor.getElementDescriptor(rootTag);
+    element = element.getElementsDescriptors(rootTag)[0];
+
+    XmlAttributeDescriptor[] attributes = element.getAttributesDescriptors(rootTag);
+
+    assertEquals(2, attributes.length);
+    assertEquals("attr1", attributes[0].getName());
+    assertEquals("attr2", attributes[1].getName());
+  }
+
+  public void testAttributeDescriptor1() throws Exception {
+    XmlFile file = createFile("<root><a attr1=''></a><a attr2='' attr1=''></a></root>");
+    XmlNSDescriptor descriptor = createDescriptor(file);
+
+    XmlTag rootTag = file.getDocument().getRootTag();
+    XmlElementDescriptor element = descriptor.getElementDescriptor(rootTag);
+    element = element.getElementsDescriptors(rootTag)[0];
+
+    XmlAttributeDescriptor[] attributes = element.getAttributesDescriptors(rootTag);
+
+    assertEquals("attr1", attributes[0].getName());
+    assertTrue(attributes[0].isRequired());
+
+    assertEquals("attr2", attributes[1].getName());
+    assertTrue(!attributes[1].isRequired());
+  }
+
+  public void testAttributeDescriptor2() throws Exception {
+    XmlFile file = createFile("<root><a c='' a=''></a></root>");
+    XmlNSDescriptor descriptor = createDescriptor(file);
+
+    XmlTag rootTag = file.getDocument().getRootTag();
+    XmlElementDescriptor element = descriptor.getElementDescriptor(rootTag);
+    element = element.getElementsDescriptors(rootTag)[0];
+
+    XmlAttributeDescriptor[] attributes = element.getAttributesDescriptors(rootTag);
+
+    assertEquals("c", attributes[0].getName());
+    assertTrue(attributes[0].isRequired());
+
+    assertEquals("a", attributes[1].getName());
+    assertTrue(attributes[1].isRequired());
+  }
+
+  private XmlFile createFile(String text) throws Exception {
+    return (XmlFile)createDummyFile("test.xml", text);
+  }
+
+  private XmlNSDescriptor createDescriptor(XmlFile file) throws Exception{
+    return file.getDocument().getRootTagNSDescriptor();
+  }
+
+  private XmlTag tag(String tagName) throws Exception {
+    XmlFile file = (XmlFile)PsiFileFactory.getInstance(myPsiManager.getProject()).createFileFromText("tag.xml", "<" + tagName + "/>");
+    return file.getDocument().getRootTag();
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlParsingTest.java b/xml/tests/src/com/intellij/codeInsight/XmlParsingTest.java
new file mode 100644
index 0000000..acb90d9
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlParsingTest.java
@@ -0,0 +1,679 @@
+package com.intellij.codeInsight;
+
+import com.intellij.lang.*;
+import com.intellij.lang.dtd.DTDLanguage;
+import com.intellij.lang.dtd.DTDParserDefinition;
+import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.html.HTMLParserDefinition;
+import com.intellij.lang.xml.XMLLanguage;
+import com.intellij.lang.xml.XMLParserDefinition;
+import com.intellij.lang.xml.XmlASTFactory;
+import com.intellij.lexer.FilterLexer;
+import com.intellij.lexer.HtmlEmbeddedTokenTypesProvider;
+import com.intellij.lexer.Lexer;
+import com.intellij.lexer.XmlLexer;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.DebugUtil;
+import com.intellij.psi.impl.source.parsing.xml.DtdParsing;
+import com.intellij.psi.impl.source.tree.CompositeElement;
+import com.intellij.psi.impl.source.tree.LeafElement;
+import com.intellij.psi.impl.source.tree.TreeUtil;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.xml.*;
+import com.intellij.testFramework.ParsingTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
+import com.intellij.util.ThrowableRunnable;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.File;
+
+/**
+ * @author Mike, ik
+ */
+public class XmlParsingTest extends ParsingTestCase {
+  public XmlParsingTest() {
+    super("psi", "???");
+    myLanguage = XMLLanguage.INSTANCE;
+  }
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+    addExplicitExtension(LanguageParserDefinitions.INSTANCE, XMLLanguage.INSTANCE, new XMLParserDefinition());
+    addExplicitExtension(LanguageParserDefinitions.INSTANCE, DTDLanguage.INSTANCE, new DTDParserDefinition());
+    addExplicitExtension(LanguageASTFactory.INSTANCE, XMLLanguage.INSTANCE, new XmlASTFactory());
+    addExplicitExtension(LanguageASTFactory.INSTANCE, DTDLanguage.INSTANCE, new XmlASTFactory());
+    registerExtensionPoint(new ExtensionPointName<XmlChildRole.StartTagEndTokenProvider>("com.intellij.xml.startTagEndToken"),
+                           XmlChildRole.StartTagEndTokenProvider.class);
+  }
+
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
+  }
+
+  private void doTestXml(@NonNls String text) throws Exception {
+    myLanguage = XMLLanguage.INSTANCE;
+    doTest(text, "test.xml");
+  }
+  private void doTestDtd(@NonNls String text) throws Exception {
+    myLanguage = DTDLanguage.INSTANCE;
+    doTest(text, "test.dtd");
+  }
+  private void doTest(@NonNls String text, @NonNls String fileName) throws Exception {
+    PsiFile file = createFile(fileName, text);
+    checkResult("test" +getTestName(false), file);
+  }
+
+  public void testNewParsing1() throws Exception {
+    doTestXml("<a></a>");
+  }
+
+  public void testEmptyCommentParsing() throws Exception {
+    doTestXml("<!---->");
+  }
+
+  public void testNewParsing2() throws Exception {
+    doTestXml("<a>   </a>");
+  }
+
+  public void testNewParsing3() throws Exception {
+    doTestXml("<a   </a>");
+  }
+
+  public void testNewParsing4() throws Exception {
+    doTestXml("<a> <b> </a>");
+  }
+
+  public void testNewParsing5() throws Exception {
+    doTestXml("<a> <b/> </a>");
+  }
+
+  public void testNewParsing6() throws Exception {
+    doTestXml("<!DOCTYPE greeting SYSTEM \"hello.dtd\" [<!ELEMENT greeting EMPTY>]> <a> <b/> </a>");
+  }
+
+  public void testNewParsing7() throws Exception {
+    doTestXml("<a> <b> <c> <d> </a>");
+  }
+
+  public void testNewParsing8() throws Exception {
+    doTestXml("<a blah=\"blah\"/>");
+  }
+
+  public void testNewParsing9() throws Exception {
+    doTestXml("<a asd=\"asd\"></a>");
+  }
+
+  public void testNewParsing10() throws Exception {
+    doTestXml("<a asd=\"asd\"> <s> </a>");
+  }
+
+  public void testNewParsing11() throws Exception {
+    doTestXml("<!-- <!-- --> <a asd=\"asd\"> <s> </a>");
+  }
+
+  public void testNewParsing12() throws Exception {
+    doTestXml("<a><a ajsdg<a></a></a>");
+  }
+
+  public void testNewParsing13() throws Exception {
+    doTestXml("<a><b><c>\n" + "xxx \n" + "xxxx\n" + "<</b></a>");
+  }
+
+  public void testNewParsing14() throws Exception {
+    doTestXml("<a><a ajsdg = \"\"></a></a>");
+  }
+
+  public void testNewParsing15() throws Exception {
+    doTestXml("<!DOCTYPE a [<!ELEMENT a (a)>]> <a><a ajsdg = \"\"></a></a>");
+  }
+
+  public void testNewParsing19() throws Exception {
+    doTestXml("<!DOCTYPE aaa [" + "<!ELEMENT a #EMPTY>" + "<!ATTLIST a" + " xx CDATA #IMPLIED" + " yy  #IMPLIED" + " zz CDATA #IMPLIED>]>\n" +
+              "<a> <b> </b> </a>");
+  }
+
+  public void testNewParsing20() throws Exception {
+    doTestXml("<!DOCTYPE root [\n" + "<!\n" + "]>\n" + "<root>\n" + "\n" + "</root>");
+  }
+
+  public void testEntityInAttr() throws Exception {
+    doTestXml("<a href=\"&n\"/>");
+  }
+
+  public void testEntityInContent() throws Exception {
+    doTestXml("<a> &n </a>");
+  }
+
+  public void testMultyRoots() throws Exception {
+    doTestXml("<a href=\"\"/> <b/>");
+  }
+
+  public void testMultyRootsWithErrorsBetween() throws Exception {
+    doTestXml("<a href=\"\"/> </ss><b/>");
+  }
+
+  public void testGtInTagContent() throws Exception {
+    doTestXml("<a>></a>");
+  }
+
+  public void testManyErrors() throws Exception {
+    doTestXml(loadFile("manyErrors.xml"));
+  }
+
+  public void _testLexerPerformance1() throws Exception {
+    final String text = loadFile("pallada.xml");
+    XmlLexer lexer = new XmlLexer();
+    doLex(lexer, text);
+    final FilterLexer filterLexer = new FilterLexer(new XmlLexer(),
+                                                    new FilterLexer.SetFilter(
+                                                      LanguageParserDefinitions.INSTANCE.forLanguage(XMLLanguage.INSTANCE)
+                                                        .getWhitespaceTokens()));
+    doLex(filterLexer, text);
+    doLex(lexer, text);
+    doLex(filterLexer, text);
+    doLex(filterLexer, text);
+  }
+
+  public void _testLexerPerformance2() throws Exception {
+    final String text = loadFile("performance2.xml");
+    XmlLexer lexer = new XmlLexer();
+    doLex(lexer, text);
+    final FilterLexer filterLexer = new FilterLexer(new XmlLexer(),
+                                                    new FilterLexer.SetFilter(
+                                                      LanguageParserDefinitions.INSTANCE.forLanguage(XMLLanguage.INSTANCE)
+                                                        .getWhitespaceTokens()));
+    doLex(filterLexer, text);
+    doLex(lexer, text);
+    for (int i = 0; i < 20; i++) {
+      doLex(filterLexer, text);
+    }
+  }
+
+  private static void doLex(Lexer lexer, final String text) {
+    lexer.start(text);
+    long time = System.currentTimeMillis();
+    int count = 0;
+    while (lexer.getTokenType() != null) {
+      lexer.advance();
+      count++;
+    }
+    System.out.println("Plain lexing took " + (System.currentTimeMillis() - time) + "ms lexems count:" + count);
+  }
+
+  private void transformAllChildren(final ASTNode file) {
+    for (ASTNode child = file.getFirstChildNode(); child != null; child = child.getTreeNext()) {
+      transformAllChildren(child);
+    }
+  }
+
+
+  public void _testPerformance1() throws Exception {
+    final String text = loadFile("pallada.xml");
+    long time = System.currentTimeMillis();
+    final PsiFile file = createFile("test.xml", text);
+    transformAllChildren(file.getNode());
+    System.out.println("Old parsing took " + (System.currentTimeMillis() - time) + "ms");
+    int index = 0;
+    while (index++ < 10) {
+      newParsing(text);
+    }
+    LeafElement firstLeaf = TreeUtil.findFirstLeaf(file.getNode());
+    index = 0;
+    do {
+      index++;
+    }
+    while ((firstLeaf = TreeUtil.nextLeaf(firstLeaf, null)) != null);
+    System.out.println("For " + index + " lexems");
+  }
+
+  public void _testReparsePerformance() throws Exception {
+    final String text = loadFile("performance2.xml");
+    final PsiFile file = createFile("test.xml", text);
+    transformAllChildren(file.getNode());
+    final Document doc = PsiDocumentManager.getInstance(getProject()).getDocument(file);
+
+    System.gc();
+    System.gc();
+
+    new WriteCommandAction(getProject(), file) {
+      @Override
+      protected void run(final Result result) throws Throwable {
+        PlatformTestUtil.startPerformanceTest("XML reparse using PsiBuilder", 2500, new ThrowableRunnable() {
+          @Override
+          public void run() throws Exception {
+            for (int i = 0; i < 10; i++) {
+              final long tm = System.currentTimeMillis();
+              doc.insertString(0, "<additional root=\"tag\"/>");
+              PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
+              System.out.println("Reparsed for: " + (System.currentTimeMillis() - tm));
+            }
+          }
+        }).cpuBound().assertTiming();
+      }
+    }.execute();
+  }
+
+  public void _testPerformance2() throws Exception {
+    final String text = loadFile("performance2.xml");
+    long time = System.currentTimeMillis();
+    final PsiFile file = createFile("test.xml", text);
+    transformAllChildren(file.getNode());
+    System.out.println("Old parsing took " + (System.currentTimeMillis() - time) + "ms");
+    int index = 0;
+    while (index++ < 10) {
+      newParsing(text);
+    }
+    LeafElement firstLeaf = TreeUtil.findFirstLeaf(file.getNode());
+    index = 0;
+    do {
+      index++;
+    }
+    while ((firstLeaf = TreeUtil.nextLeaf(firstLeaf, null)) != null);
+    System.out.println("For " + index + " lexems");
+  }
+
+  private static void newParsing(final String text) {
+    long time = System.currentTimeMillis();
+
+    ASTFactory.lazy(XmlElementType.XML_FILE, text).getFirstChildNode(); // ensure parsed
+
+    System.out.println("parsed for " + (System.currentTimeMillis() - time) + "ms");
+  }
+
+  public void testXmlDecl() throws Exception {
+    doTestXml("<?xml version=\"1.0\" encoding='cp1251' ?>");
+  }
+
+  public void testXmlDecl2() throws Exception {
+    doTestXml("<?xml version=\"1.0\" encoding='cp1251' ?> <foo></foo>");
+  }
+
+  public void testXmlDecl3() throws Exception {
+    doTestXml("<?xml version=\"1.0\" encoding='cp1251' > <foo></foo>");
+  }
+
+  public void testDoctype1() throws Exception {
+    doTestXml("<!DOCTYPE greeting SYSTEM \"hello.dtd\">");
+  }
+
+  public void testDoctype2() throws Exception {
+    doTestXml("<!DOCTYPE toc " + "PUBLIC \"-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 1.0//EN\" " +
+           "\"http://java.sun.com/products/javahelp/toc_1_0.dtd\">");
+  }
+
+  public void testDoctype3() throws Exception {
+    doTestXml("<!DOCTYPE greeting [" + "<!ELEMENT greeting (#PCDATA)>" + "]>");
+  }
+
+  public void testDoctype4() throws Exception {
+    doTestXml("<!DOCTYPE greeting [" + "<!ELEMENT br EMPTY>" + "]>");
+  }
+
+  public void testDoctype5() throws Exception {
+    doTestXml("<!DOCTYPE greeting [" + "<!ELEMENT p (#PCDATA|a|ul|b|i|em)*>" + "]>");
+  }
+
+  public void testDoctype6() throws Exception {
+    doTestXml("<!DOCTYPE greeting [" + "<!ELEMENT %name.para; %content.para; >" + "]>");
+  }
+
+  public void testDoctype7() throws Exception {
+    doTestXml("<?xml version='1.0' encoding='ISO-8859-1' ?>" + "<!DOCTYPE toc SYSTEM 'dtds/ejb-jar_2_0.dtd'>" + "<test>" + "</test>");
+  }
+
+  public void testAttlist1() throws Exception {
+    doTestDtd("<!ATTLIST termdef id ID #REQUIRED name CDATA #IMPLIED>");
+  }
+
+  public void testAttlist2() throws Exception {
+    doTestDtd("<!ATTLIST termdef type (bullets|ordered|glossary)  \"ordered\">");
+  }
+
+  public void testAttlist3() throws Exception {
+    doTestDtd("<!ATTLIST termdef  method  CDATA   #FIXED \"POST\">");
+  }
+
+  public void testAttlist4() throws Exception {
+    doTestDtd("<!ATTLIST termdef default-charset %CHARSET; \"iso-8859-1\">");
+  }
+
+  public void testComment1() throws Exception {
+    doTestXml("<!-- declarations for <head> & <body> -->");
+  }
+
+  public void testComment2() throws Exception {
+    doTestDtd("<!ELEMENT data-sources (#PCDATA)> <!-- abc --> <!ATTLIST data-sources path CDATA #IMPLIED");
+  }
+
+  public void testComment3() throws Exception {
+    doTestXml("<a><!--<b>--></a>");
+  }
+
+  public void testElements1() throws Exception {
+    doTestXml("<a></a>");
+  }
+
+  public void testElements2() throws Exception {
+    doTestXml("<a/>");
+  }
+
+  public void testElements3() throws Exception {
+    doTestXml("<a><b><c/><d/></b><e/><f><g/></f></a>");
+  }
+
+  public void testElements4() throws Exception {
+    doTestXml("<project name=\"IDEA_ZKM\">\n" + "<!-- set global properties for this build -->\n" + "<property value=\"off\" />\n" +
+           "</project>\n");
+  }
+
+  public void testElements5() throws Exception {
+    doTestXml("<ns1:a><ns2:b/></ns1:a>");
+  }
+
+  public void testElements6() throws Exception {
+    doTestXml("<!DOCTYPE project [" + "<!ENTITY targets SYSTEM \"file:../myproject/targets.xml\">" + "]>" + "<project>" + "</project>");
+  }
+
+  public void testAttributes1() throws Exception {
+    doTestXml("<a att1='val1' att2=\"val2\"></a>");
+  }
+
+  public void testAttributes2() throws Exception {
+    doTestXml("<a><b c=\"\" > </b> </a>");
+  }
+
+  public void testAttributes3() throws Exception {
+    doTestXml("<a><b c=\"a, b, c\" > </b> </a>");
+  }
+
+  public void testAttributes4() throws Exception {
+    doTestXml("<a><b c=\"a  b\" > </b> </a>");
+  }
+
+  public void testAttributes5() throws Exception {
+    doTestXml("<a><b c=\"a\"d=\"\" > </b> </a>");
+  }
+
+  public void testManualEmptyAttributeParsing() throws Exception{
+    String value = "<a><b c=\"\" > </b> </a>";
+    final CompositeElement element = parseManually(value, XmlElementType.XML_ELEMENT_DECL, XmlEntityDecl.EntityContextType.GENERIC_XML);
+    checkResult("testManualEmptyAttributeParsing.txt", DebugUtil.treeToString(element, false));
+  }
+
+  private CompositeElement parseManually(final String value, final IElementType xmlElementDecl, XmlEntityDecl.EntityContextType parseType) {
+    return (CompositeElement)new DtdParsing(value, xmlElementDecl, parseType, null).parse();
+  }
+
+  public void testCharacters1() throws Exception {
+    doTestXml("<a>someChar\nData</a>");
+  }
+
+  public void testEditing1() throws Exception {
+    doTestXml("<<a></a>");
+  }
+
+  public void testEditing2() throws Exception {
+    doTestXml("<a><b/> < <c/></a>");
+  }
+
+  public void testEditing3() throws Exception {
+    doTestXml("<a><b <c/></a>");
+  }
+
+  public void testEditing4() throws Exception {
+    doTestXml("<a><b>< <c/></a>");
+  }
+
+  public void testEditing5() throws Exception {
+    doTestXml("<a><b></ <c/></a>");
+  }
+
+  public void testEditing6() throws Exception {
+    doTestXml("<one>     <two ,b\"/></one>");
+  }
+
+  public void testEditing7() throws Exception {
+    doTestXml("<one>     <two a,b\"/></one>");
+  }
+
+  public void testEditing8() throws Exception {
+    doTestXml("<one>     <two a b=\"\"/></one>");
+  }
+
+  public void testEditing9() throws Exception {
+    doTestXml("<one> <two a b=\"\"> ashdgjkasgd <aksjhdk></two></one>");
+  }
+
+
+  public void testCdata1() throws Exception {
+    doTestXml("<a><![CDATA[<greeting>Hello, world!</greeting>]]></a>");
+  }
+
+  public void testCdata2() throws Exception {
+    doTestXml("<a><![CDATA[someData <!--</greeting>--> more data]]></a>");
+  }
+
+  public void testDtd1() throws Exception {
+    doTestDtd("<!ELEMENT data-sources (#PCDATA)> <!ATTLIST data-sources path CDATA #IMPLIED>");
+  }
+
+  public void testElementDecl1() throws Exception {
+    doTestDtd("<!ELEMENT data-sources EMPTY>");
+  }
+
+  public void testElementDecl2() throws Exception {
+    doTestDtd("<!ELEMENT data-sources ANY>");
+  }
+
+  public void testConditionalSection1() throws Exception {
+    doTestDtd("<![ INCLUDE [ <!ELEMENT data-sources ANY> ]]>");
+  }
+
+  public void testConditionalSection2() throws Exception {
+    doTestDtd("<![%sgml.features;[\n" + "<![IGNORE[\n" +
+              "<!ENTITY % dbgenent SYSTEM \"http://www.oasis-open.org/docbook/xml/configerror.txt\">\n" + "]]>\n" + "]]>");
+  }
+
+  public void testConditionalSection3() throws Exception {
+    doTestDtd("<!ENTITY % dbhier.module \"INCLUDE\">\n" + "<![ %dbhier.module; [\n" + "<!ENTITY % dbhier PUBLIC\n" +
+              "\"-//OASIS//ELEMENTS DocBook Document Hierarchy V4.4//EN\"\n" + "\"dbhierx.mod\">\n" + "%dbhier;\n" + "]]>");
+  }
+
+  public void testEntityRef1() throws Exception {
+    doTestXml("<a>%types;</a>");
+  }
+
+  public void testEntityRef3() throws Exception {
+    doTestDtd("<!ELEMENT project (target | taskdef | %types; | property )*>");
+  }
+
+  public void testEntityRef4() throws Exception {
+    doTestXml("<a b=\"aa &gt; bb\" />");
+  }
+
+  public void testEntityRef5() throws Exception {
+    doTestDtd("<!ATTLIST a %coreattrs; version CDATA #FIXED \"1.0\"");
+  }
+
+  public void testEntityRef6() throws Exception {
+    doTestDtd("&common;");
+  }
+
+  public void testEntityRef7() throws Exception {
+    doTestDtd("<!ATTLIST foo someBoolean (%boolean;) \"true\" someString CDATA #IMPLIED >");
+  }
+
+  public void testEntityDecl1() throws Exception {
+    doTestDtd("<!ENTITY % types \"fileset | patternset mapper\">");
+  }
+
+  public void testEntityDecl2() throws Exception {
+    doTestDtd("<!ENTITY types \"fileset | patternset mapper\">");
+  }
+
+  public void testEntityDecl3() throws Exception {
+    doTestDtd("<!ENTITY build-common SYSTEM \"common.xml\">");
+  }
+
+  public void testEntityDecl4() throws Exception {
+    doTestDtd(
+      "<!ENTITY open-hatch PUBLIC \"-//Textuality//TEXT Standard open-hatch boilerplate//EN\" \"http://www.textuality.com/boilerplate/OpenHatch.xml\">");
+  }
+
+  public void testUnbalanced1() throws Exception {
+    doTestXml("<a><b></a>");
+  }
+
+  public void testUnbalanced2() throws Exception {
+    doTestXml("<a><b><c></a>");
+  }
+
+  public void testUnbalanced3() throws Exception {
+    doTestXml("<a><b></bb></a>");
+  }
+
+  public void testUnbalanced4() throws Exception {
+    doTestXml("<a><b><b/></c></a>");
+  }
+
+  public void testDtdUrl1() throws Exception {
+    XmlFile file = (XmlFile)createFile("test.xml", "<!DOCTYPE greeting SYSTEM \"hello.dtd\">");
+
+    XmlDocument document = file.getDocument();
+    XmlProlog prolog = document.getProlog();
+    XmlDoctype doctype = prolog.getDoctype();
+    String url = doctype.getDtdUri();
+    assertTrue("testDtdUrl1", "hello.dtd".equals(url));
+  }
+
+  public void testContent1() throws Exception {
+    XmlFile file = (XmlFile)createFile("test.xml", "<a>   \nxxx   \n</a>");
+    checkResult("testContent1", file);
+    assertTrue("xxx".equals(file.getDocument().getRootTag().getValue().getTrimmedText()));
+  }
+
+  public void testUnopenedTag1() throws Exception {
+    doTestXml("</foo>");
+  }
+
+  public void testUnclosedTag() throws Exception {
+    XmlFile file = (XmlFile)createFile("test.xml", "<a>xxx");
+    checkResult("testUnclosedTag", file);
+    assertTrue("xxx".equals(file.getDocument().getRootTag().getValue().getText()));
+  }
+
+  public void testUnclosedTag2() throws Exception {
+    doTestXml("<a");
+  }
+
+  public void testProcessingInstruction1() throws Exception {
+    doTestXml("<?This is=\"PI\"?>");
+  }
+
+  public void testProcessingInstruction2() throws Exception {
+    doTestXml("<a><?This is=\"PI\"?></a>");
+  }
+
+  public void testProcessingInstruction3() throws Exception {
+    doTestXml("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<?xml-stylesheet type=\"text/xsl\" href=\"document.xsl\"?>" +
+           "<!-- @(#) $Id$ -->" + "<!DOCTYPE api SYSTEM \"document.dtd\">" + "<api>" + "</api>");
+  }
+
+  public void testCharRef1() throws Exception {
+    doTestXml("<a>&#123;</a>");
+  }
+
+  public void testCharRef2() throws Exception {
+    doTestXml("<a>&#x123;</a>");
+  }
+
+  public void testCharRef3() throws Exception {
+    doTestXml("&#123;");
+  }
+
+  public void testCharRef4() throws Exception {
+    doTestXml("&#xaBcD123;");
+  }
+
+  public void testCharRef5() throws Exception {
+    doTestXml("<a attr=\"abc&#123;\"/>");
+  }
+
+  public void testNotation1() throws Exception {
+    doTestDtd("<!NOTATION data-sources SYSTEM \"x3\">");
+  }
+
+  public void testPrologInDtd() throws Exception {
+    doTestDtd("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + "<!ELEMENT idea-plugin>\n" + "<!ATTLIST idea-plugin\n" +
+              "    url CDATA #IMPLIED>");
+  }
+
+  public void testEmptyElementsInDtd() throws Exception {
+    doTestDtd("<!ELEMENT >\n<!ELEMENT name (,)\n<!ATTLIST > <!ELEMENT zzz (aa?, bb)+> <!ELEMENT xxx(aaa,)>" + "<!ATTLIST %aaa;>");
+  }
+
+  public void testElementDeclaration() throws Exception {
+    doTestDtd(
+      "<!ELEMENT xxx EMPTY>\n<!ELEMENT xxx2 ANY>\n<!ELEMENT %name.para; %content.para; >\n<!ELEMENT xxx3 (#PCDATA | a) >\n<!ELEMENT xxx4 >");
+  }
+
+  public void testEntityDeclaration() throws Exception {
+    doTestDtd("<!ENTITY xxx > <!ENTITY >");
+  }
+
+  public void testEntityDeclaration2() throws Exception {
+    String s = "| %pre.qname; | %blockquote.qname; | %address.qname;";
+    CompositeElement element = parseManually(s, XmlElementType.XML_ELEMENT_CONTENT_SPEC, XmlEntityDecl.EntityContextType.ELEMENT_CONTENT_SPEC);
+    checkResult("testEntityDeclaration2.txt", DebugUtil.treeToString(element, false));
+  }
+
+  public void testEntityInAttlistDeclaration() throws Exception {
+    doTestDtd("<!ATTLIST %span.qname;      %Common.attrib;>");
+  }
+
+  public void testSGMLDtd() throws Exception {
+    doTestDtd("<!ELEMENT name - - (%inline;)* +(A)> <!ATTLIST (A|B) >\n" +
+              "<!ELEMENT (E|E2) - O (%flow;)*       -- table header cell, table data cell-->\n" +
+              "<!ELEMENT BODY O O (%block;|SCRIPT)+ +(INS|DEL) -- document body -->");
+  }
+
+  public void testNotation2() throws Exception {
+    doTestXml("<!DOCTYPE x3 [<!NOTATION data-sources SYSTEM \"x3\">]>");
+  }
+
+  public void testCustomMimeType() throws Exception {
+    final Language language = new MyLanguage();
+    addExplicitExtension(LanguageHtmlScriptContentProvider.INSTANCE, language, new HtmlScriptContentProvider() {
+      @Override
+      public IElementType getScriptElementType() {
+        return new IElementType("MyElementType", language);
+      }
+
+      @Nullable
+      @Override
+      public Lexer getHighlightingLexer() {
+        return null;
+      }
+    });
+    addExplicitExtension(LanguageParserDefinitions.INSTANCE, HTMLLanguage.INSTANCE, new HTMLParserDefinition());
+    addExplicitExtension(LanguageASTFactory.INSTANCE, HTMLLanguage.INSTANCE, new XmlASTFactory());
+    registerExtensionPoint(new ExtensionPointName<HtmlEmbeddedTokenTypesProvider>("com.intellij.html.embeddedTokenTypesProvider"),
+                           HtmlEmbeddedTokenTypesProvider.class);
+    myLanguage = HTMLLanguage.INSTANCE;
+    doTest("<script type=\"application/custom\">Custom Script</script>", "test.html");
+  }
+
+  static class MyLanguage extends Language {
+    protected MyLanguage() {
+      super("MyLanguage", "application/custom");
+    }
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlPerformanceTest.java b/xml/tests/src/com/intellij/codeInsight/XmlPerformanceTest.java
new file mode 100644
index 0000000..fc5fec2
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlPerformanceTest.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: Maxim.Mossienko
+ * Date: Sep 8, 2006
+ * Time: 3:40:30 PM
+ */
+package com.intellij.codeInsight;
+
+import com.intellij.codeInsight.daemon.quickFix.LightQuickFixTestCase;
+import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.editor.actionSystem.EditorActionManager;
+import com.intellij.testFramework.IdeaTestUtil;
+import com.intellij.testFramework.PlatformTestUtil;
+import com.intellij.util.ThrowableRunnable;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @by Maxim.Mossienko
+ */
+public class XmlPerformanceTest extends LightQuickFixTestCase {
+  private final Set<String> ourTestsWithFolding = new HashSet<String>(Arrays.asList("IndentUnindent2"));
+
+  @Override
+  protected String getBasePath() {
+    return "performance/";
+  }
+
+  @NotNull
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
+  }
+
+  public void testDummy() {
+    @SuppressWarnings({"UnusedDeclaration"})
+    Class clazz = IdeaTestUtil.class;
+  }
+
+  public void testIndentUnindent() throws Exception {
+    doIndentTest(2000);
+  }
+
+  public void testIndentUnindent2() throws Exception {
+    doIndentTest(2001);
+  }
+
+  @Override
+  protected boolean doFolding() {
+    return ourTestsWithFolding.contains(getTestName(false));
+  }
+
+  private void doIndentTest(int time) throws Exception {
+    configureByFile(getBasePath() + getTestName(false)+".xml");
+    doHighlighting();
+    myEditor.getSelectionModel().setSelection(0,myEditor.getDocument().getTextLength());
+
+    PlatformTestUtil.startPerformanceTest("Fix long indent/unindent "+time, time, new ThrowableRunnable() {
+      @Override
+      public void run() {
+        EditorActionManager.getInstance().getActionHandler("EditorIndentSelection").execute(myEditor, new DataContext() {
+          @Override
+          @Nullable
+          public Object getData(String dataId) {
+            return null;
+          }
+        });
+
+        EditorActionManager.getInstance().getActionHandler("EditorUnindentSelection").execute(myEditor, new DataContext() {
+          @Override
+          @Nullable
+          public Object getData(String dataId) {
+            return null;
+          }
+        });
+      }
+    }).assertTiming();
+    final int startOffset = myEditor.getCaretModel().getOffset();
+    myEditor.getSelectionModel().setSelection(startOffset,startOffset);
+    checkResultByFile(getBasePath() + getTestName(false)+".xml");
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlReparseTest.java b/xml/tests/src/com/intellij/codeInsight/XmlReparseTest.java
new file mode 100644
index 0000000..08107e7
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlReparseTest.java
@@ -0,0 +1,165 @@
+/*
+ * Created by IntelliJ IDEA.
+ * User: mike
+ * Date: Oct 4, 2002
+ * Time: 2:14:24 PM
+ * To change template for new class use 
+ * Code Style | Class Templates options (Tools | IDE Options).
+ */
+package com.intellij.codeInsight;
+
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.psi.AbstractReparseTestCase;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.DebugUtil;
+import com.intellij.psi.impl.source.xml.XmlFileImpl;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.testFramework.ParsingTestCase;
+import com.intellij.testFramework.PlatformTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
+import com.intellij.util.IncorrectOperationException;
+
+import java.io.File;
+
[email protected]
+public class XmlReparseTest extends AbstractReparseTestCase {
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+    setFileType(StdFileTypes.XML);
+  }
+
+  public void test1() throws Exception{
+    String s1 = "<a>";
+    String s2 = "</a>";
+
+    prepareFile(s1, s2);
+    final String beforeReparse = DebugUtil.treeToString(((XmlFileImpl)myDummyFile).getTreeElement(), true);
+    insert("");
+    assertEquals("Tree changed after empty reparse", beforeReparse, DebugUtil.treeToString(((XmlFileImpl)myDummyFile).getTreeElement(), true));
+  }
+
+  public void testTagData1() throws Exception {
+    String s1 = "<a>";
+    String s2 = "</a>";
+
+    prepareFile(s1, s2);
+    insert("x");
+    insert(" ");
+    insert("xxxxx");
+    insert("\n");
+    insert("xxxxx");
+  }
+
+  public void testTagData2() throws Exception {
+    String s1 = "<a><b>\nSomeDataHere";
+    String s2 = "\n</b></a>";
+
+    prepareFile(s1, s2);
+
+    PsiElement element1 = ((XmlFile)myDummyFile).getDocument().getRootTag();
+
+    insert("x");
+    insert(" ");
+    insert("xxxxx");
+    insert("\n");
+    insert("xxxxx");
+
+    assertSame(element1, ((XmlFile)myDummyFile).getDocument().getRootTag());
+  }
+
+  public void testTagInTag1() throws Exception {
+    String s1 = "<a><b>";
+    String s2 = "</b></a>";
+
+    prepareFile(s1, s2);
+
+    insert("<");
+    insert("c");
+    insert("/");
+    insert(">");
+  }
+
+  public void testTagInTag2() throws Exception {
+    String s1 = "<a><b>";
+    String s2 = "</b></a>";
+
+    prepareFile(s1, s2);
+
+    insert("<");
+    insert("c");
+    insert(">");
+    insert("\nxxx \nxxxx\n");
+    insert("<");
+    insert("/");
+    insert("c");
+    insert(">");
+  }
+
+  public void testTagInTag3() throws Exception {
+    String s1 = "<a><b>";
+    String s2 = "</b></a>";
+
+    prepareFile(s1, s2);
+
+    insert("<");
+    insert("/");
+    insert("b");
+    insert(">");
+  }
+
+  public void testSCR5925() throws Exception {
+    String s1 = "<one>     <two ";
+    String s2 = ",b\"/></one>";
+
+    prepareFile(s1, s2);
+    insert("a");
+    insert("t");
+    insert("t");
+    insert("r");
+    insert("=");
+    insert("\"");
+  }
+
+  public void testXmlReparseProblem() throws IncorrectOperationException {
+    prepareFile("<table>\n" +
+                "    <tr>\n" +
+                "<td>\n" +
+                "<table width"," </td>\n" +
+               "    </tr>\n" +
+               "</table>");
+    insert("=");
+  }
+  private static final String marker = "<marker>";
+  public void testXmlDeclDtd() throws Exception {
+    PsiFile file = createFile("x.xml", "<!DOCTYPE name [\n" +
+                                       "  <!ELEMENT name (" + marker+ "a b c d" + marker+ ")>\n" +
+                                       "  <!ELEMENT name2 (" + marker+ "%entity;" + marker+ ")>\n" +
+                                       "]>\n" +
+                                       "<name></name>");
+
+    PsiDocumentManager documentManager = PsiDocumentManager.getInstance(getProject());
+    Document document = documentManager.getDocument(file);
+
+    removeGarbage(document);
+
+    documentManager.commitAllDocuments();
+    String myFullDataPath = getTestDataPath() + "psi/";
+    ParsingTestCase.doCheckResult(myFullDataPath, file, true, "testXmlDeclDtd", false, false);
+  }
+
+  private static void removeGarbage(Document document) {
+    int i = document.getText().indexOf(marker);
+    if (i==-1) return;
+    document.replaceString(i,i+marker.length(),"");
+    removeGarbage(document);
+  }
+
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlSchemaTest.java b/xml/tests/src/com/intellij/codeInsight/XmlSchemaTest.java
new file mode 100644
index 0000000..fc9fe64
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlSchemaTest.java
@@ -0,0 +1,757 @@
+package com.intellij.codeInsight;
+
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.xml.XmlAttribute;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.testFramework.LightCodeInsightTestCase;
+import com.intellij.xml.XmlAttributeDescriptor;
+import com.intellij.xml.XmlElementDescriptor;
+import com.intellij.xml.XmlNSDescriptor;
+import com.intellij.xml.impl.schema.XmlElementDescriptorImpl;
+import com.intellij.xml.impl.schema.XmlNSDescriptorImpl;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.NonNls;
+
+/**
+ * @author Mike
+ */
+public class XmlSchemaTest extends LightCodeInsightTestCase {
+  private XmlTag SHIP_TO;
+  private XmlTag UNKNOWN_TAG;
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+    SHIP_TO = XmlTestUtil.tag("shipTo", getProject());
+    UNKNOWN_TAG = XmlTestUtil.tag("xxx", getProject());
+  }
+
+  public void testDocumentDescriptor1() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:element name=\"comment\" type=\"xsd:string\"/>" +
+        "</xsd:schema>");
+
+    assertNotNull(NSDescriptor);
+    assertNotNull(NSDescriptor.getElementDescriptor(XmlTestUtil.tag("purchaseOrder", getProject())));
+    assertNotNull(NSDescriptor.getElementDescriptor(XmlTestUtil.tag("comment", getProject())));
+    assertNull(NSDescriptor.getElementDescriptor(UNKNOWN_TAG));
+  }
+
+  public void testElementDescriptor1() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:element name=\"comment\" type=\"xsd:string\"/>" +
+        "</xsd:schema>");
+
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(XmlTestUtil.tag("purchaseOrder", getProject()));
+    assertEquals("purchaseOrder", elementDescriptor.getName());
+
+    elementDescriptor = NSDescriptor.getElementDescriptor(XmlTestUtil.tag("comment", getProject()));
+    assertEquals("comment", elementDescriptor.getName());
+  }
+
+  public void testElementDescriptor2() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"comment\" type=\"xsd:string\"/>" +
+        "</xsd:schema>");
+
+    XmlTag tag = XmlTestUtil.tag("comment", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
+    assertEquals(0, elements.length);
+
+    XmlAttributeDescriptor[] descriptors = elementDescriptor.getAttributesDescriptors(tag);
+    assertEquals(0, descriptors.length);
+
+    assertEquals(elementDescriptor.getContentType(), XmlElementDescriptor.CONTENT_TYPE_MIXED);
+  }
+
+  public void testElementDescriptor3() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:sequence>" +
+        "     <xsd:element name=\"shipTo\" type=\"USAddress\"/>" +
+        "     <xsd:element name=\"billTo\" type=\"USAddress\"/>" +
+        "     <xsd:element name=\"items\" type=\"Items\"/>" +
+        "   </xsd:sequence>" +
+        "</xsd:complexType>" +
+        "</xsd:schema>");
+
+    XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
+    assertEquals(3, elements.length);
+    assertEquals("shipTo", elements[0].getName());
+    assertEquals("billTo", elements[1].getName());
+    assertEquals("items", elements[2].getName());
+
+    assertEquals("shipTo", elementDescriptor.getElementDescriptor(SHIP_TO, null).getName());
+    assertNull(elementDescriptor.getElementDescriptor(UNKNOWN_TAG, null));
+  }
+
+  public void testElementDescriptor4() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:attribute name=\"orderDate\" type=\"xsd:date\"/>" +
+        "   <xsd:attribute name=\"name\" type=\"xsd:string\"/>" +
+        "</xsd:complexType>" +
+        "</xsd:schema>");
+
+    final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
+
+    assertEquals(2, attributes.length);
+    assertEquals("orderDate", attributes[0].getName());
+    assertEquals("name", attributes[1].getName());
+
+    assertEquals("name", elementDescriptor.getAttributeDescriptor("name", tag).getName());
+
+    assertNull(elementDescriptor.getAttributeDescriptor("xxx", tag));
+  }
+
+  public void testElementDescriptor5() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:sequence>" +
+        "     <xsd:element name=\"shipTo\" type=\"USAddress\"/>" +
+        "     <xsd:element name=\"billTo\" type=\"USAddress\"/>" +
+        "     <xsd:element name=\"items\" type=\"Items\"/>" +
+        "   </xsd:sequence>" +
+        "</xsd:complexType>" +
+        "<xsd:complexType name=\"USAddress\">" +
+        "  <xsd:sequence>" +
+        "    <xsd:element name=\"name\" type=\"xsd:string\"/>" +
+        "    <xsd:element name=\"street\" type=\"xsd:string\"/>" +
+        "    <xsd:element name=\"city\" type=\"xsd:string\"/>" +
+        "    <xsd:element name=\"state\" type=\"xsd:string\"/>" +
+        "    <xsd:element name=\"zip\" type=\"xsd:decimal\"/>" +
+        "  </xsd:sequence>" +
+        "  <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>" +
+        "</xsd:complexType>" +
+        "</xsd:schema>");
+
+    XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag).getElementDescriptor(SHIP_TO, null);
+
+    XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
+    assertEquals(5, elements.length);
+    assertEquals("name", elements[0].getName());
+    assertEquals("street", elements[1].getName());
+    assertEquals("city", elements[2].getName());
+    assertEquals("state", elements[3].getName());
+    assertEquals("zip", elements[4].getName());
+
+    final XmlTag context = tag.findFirstSubTag(elements[2].getName());
+    assertEquals(0, elements[2].getElementsDescriptors(context).length);
+
+    XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(context);
+    assertEquals(1, attributes.length);
+    assertEquals("country", attributes[0].getName());
+  }
+
+  public void testElementDescriptor6() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:sequence>" +
+        "     <xsd:element name=\"shipTo\">" +
+        "       <xsd:complexType name=\"USAddress\">" +
+        "         <xsd:sequence>" +
+        "           <xsd:element name=\"name\" type=\"xsd:string\"/>" +
+        "           <xsd:element name=\"street\" type=\"xsd:string\"/>" +
+        "           <xsd:element name=\"city\" type=\"xsd:string\"/>" +
+        "           <xsd:element name=\"state\" type=\"xsd:string\"/>" +
+        "           <xsd:element name=\"zip\" type=\"xsd:decimal\"/>" +
+        "         </xsd:sequence>" +
+        "         <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>" +
+        "       </xsd:complexType>" +
+        "     </xsd:element>" +
+        "   </xsd:sequence>" +
+        "</xsd:complexType>" +
+        "</xsd:schema>");
+
+    XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag).getElementDescriptor(SHIP_TO, null);
+
+    XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
+    assertEquals(5, elements.length);
+    assertEquals("name", elements[0].getName());
+    assertEquals("street", elements[1].getName());
+    assertEquals("city", elements[2].getName());
+    assertEquals("state", elements[3].getName());
+    assertEquals("zip", elements[4].getName());
+
+    final XmlTag context = tag.findFirstSubTag(elements[2].getName());
+    assertEquals(0, elements[2].getElementsDescriptors(context).length);
+
+    XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(context);
+    assertEquals(1, attributes.length);
+    assertEquals("country", attributes[0].getName());
+  }
+
+  public void testElementDescriptor7() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\">" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:sequence>" +
+        "     <xsd:element name=\"shipTo\">" +
+        "       <xsd:complexType name=\"USAddress\">" +
+        "         <xsd:sequence>" +
+        "           <xsd:element name=\"name\" type=\"xsd:string\"/>" +
+        "           <xsd:element name=\"street\" type=\"xsd:string\"/>" +
+        "           <xsd:element name=\"city\" type=\"xsd:string\"/>" +
+        "           <xsd:element name=\"state\" type=\"xsd:string\"/>" +
+        "           <xsd:element name=\"zip\" type=\"xsd:decimal\"/>" +
+        "         </xsd:sequence>" +
+        "         <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>" +
+        "       </xsd:complexType>" +
+        "     </xsd:element>" +
+        "   </xsd:sequence>" +
+        "</xsd:complexType>" +
+        "</xsd:element>" +
+        "</xsd:schema>");
+
+    XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+    XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
+    assertEquals(0, attributes.length);
+
+    XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
+    assertEquals(1, elements.length);
+    assertEquals("shipTo", elements[0].getName());
+  }
+
+  public void testElementDescriptor8() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:sequence>" +
+        "     <xsd:element ref=\"items\"/>" +
+        "   </xsd:sequence>" +
+        "</xsd:complexType>" +
+        "<xsd:element name=\"items\" type=\"xsd:string\"/>" +
+        "</xsd:schema>");
+
+    XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
+    assertEquals(1, elements.length);
+    assertEquals("items", elements[0].getName());
+
+    assertEquals("items", elementDescriptor.getElementDescriptor(XmlTestUtil.tag("items", getProject()), null).getName());
+    assertNull(elementDescriptor.getElementDescriptor(UNKNOWN_TAG, null));
+  }
+
+  public void testElementDescriptor9() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:sequence>" +
+        "     <xsd:group ref=\"ddd:mainBookElements\"/>" +
+        "   </xsd:sequence>" +
+        "</xsd:complexType>" +
+        "<xsd:group name=\"mainBookElements\">" +
+        "   <xsd:sequence>" +
+        "       <xsd:element name=\"title\" type=\"nameType\"/>" +
+        "       <xsd:element name=\"author\" type=\"nameType\"/>" +
+        "   </xsd:sequence>" +
+        "</xsd:group>" +
+        "</xsd:schema>");
+
+    XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
+    assertEquals(2, elements.length);
+    assertEquals("title", elements[0].getName());
+    assertEquals("author", elements[1].getName());
+
+    assertEquals("title", elementDescriptor.getElementDescriptor(XmlTestUtil.tag("title", getProject()), null).getName());
+    assertNull(elementDescriptor.getElementDescriptor(UNKNOWN_TAG, null));
+  }
+
+  public void testElementDescriptor10() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "    <xsd:attributeGroup ref=\"ddd:bookAttributes\"/>" +
+        "</xsd:complexType>" +
+        "<xsd:attributeGroup name=\"bookAttributes\">" +
+        "   <xsd:attribute name=\"isbn\" type=\"xs:string\" use=\"required\"/>" +
+        "   <xsd:attribute name=\"available\" type=\"xs:string\"/>" +
+        "</xsd:attributeGroup>" +
+        "</xsd:schema>");
+
+    final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
+
+    assertEquals(2, attributes.length);
+    assertEquals("isbn", attributes[0].getName());
+    assertEquals("available", attributes[1].getName());
+
+    assertEquals("isbn", elementDescriptor.getAttributeDescriptor("isbn", tag).getName());
+
+    assertNull(elementDescriptor.getAttributeDescriptor("xxx", tag));
+  }
+
+  public void testElementDescriptor11() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "    <xsd:complexContent>" +
+        "     <xsd:restriction base=\"PurchaseOrderType2\">" +
+        "       <xsd:element name=\"shipTo2\" type=\"USAddress\"/>" +
+        "       <xsd:element name=\"items\" type=\"Items\"/>" +
+        "     </xsd:restriction>" +
+        "    </xsd:complexContent>" +
+        "</xsd:complexType>" +
+        "<xsd:complexType name=\"PurchaseOrderType2\">" +
+        "   <xsd:sequence>" +
+        "     <xsd:element name=\"shipTo\" type=\"USAddress\"/>" +
+        "     <xsd:element name=\"billTo\" type=\"USAddress\"/>" +
+        "     <xsd:element name=\"items\" type=\"Items\"/>" +
+        "   </xsd:sequence>" +
+        "</xsd:complexType>" +
+        "</xsd:schema>");
+
+    XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
+
+    assertEquals(4, elements.length);
+    assertEquals("shipTo", elements[0].getName());
+    assertEquals("billTo", elements[1].getName());
+    assertEquals("shipTo2", elements[2].getName());
+    assertEquals("items", elements[3].getName());
+  }
+
+  public void testElementDescriptor15() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "    <xsd:complexContent>" +
+        "     <xsd:extension base=\"PurchaseOrderType2\">" +
+        "       <xsd:element name=\"shipTo2\" type=\"USAddress\"/>" +
+        "     </xsd:extension>" +
+        "    </xsd:complexContent>" +
+        "</xsd:complexType>" +
+        "<xsd:complexType name=\"PurchaseOrderType2\">" +
+        "   <xsd:sequence>" +
+        "     <xsd:element name=\"shipTo\" type=\"USAddress\"/>" +
+        "     <xsd:element name=\"billTo\" type=\"USAddress\"/>" +
+        "     <xsd:element name=\"items\" type=\"Items\"/>" +
+        "   </xsd:sequence>" +
+        "</xsd:complexType>" +
+        "</xsd:schema>");
+
+    XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
+
+    assertEquals(4, elements.length);
+    assertEquals("shipTo", elements[0].getName());
+    assertEquals("billTo", elements[1].getName());
+    assertEquals("items", elements[2].getName());
+    assertEquals("shipTo2", elements[3].getName());
+  }
+
+  public void testElementDescriptor12() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "    <xsd:complexContent>" +
+        "     <xsd:restriction base=\"PurchaseOrderType2\">" +
+        "       <xsd:attribute name=\"orderDate2\" type=\"xsd:date\"/>" +
+        "       <xsd:attribute name=\"name\" type=\"xsd:date\"/>" +
+        "     </xsd:restriction>" +
+        "    </xsd:complexContent>" +
+        "</xsd:complexType>" +
+        "<xsd:complexType name=\"PurchaseOrderType2\">" +
+        "   <xsd:sequence>" +
+        "     <xsd:attribute name=\"orderDate\" type=\"xsd:date\"/>" +
+        "     <xsd:attribute name=\"name\" type=\"xsd:string\"/>" +
+        "   </xsd:sequence>" +
+        "</xsd:complexType>" +
+        "</xsd:schema>");
+
+    final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
+
+    assertEquals(3, attributes.length);
+    assertEquals("orderDate", attributes[0].getName());
+    assertEquals("orderDate2", attributes[1].getName());
+    assertEquals("name", attributes[2].getName());
+  }
+
+  public void testElementDescriptor13() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\">" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:sequence>" +
+        "     <xsd:element ref=\"shipTo\"/>" +
+        "   </xsd:sequence>" +
+        "</xsd:complexType>" +
+        "</xsd:element>" +
+        "<xsd:element name=\"shipTo\" abstract=\"true\">" +
+        "</xsd:schema>");
+
+    XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    final XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
+    assertEquals(0, elements.length);
+  }
+
+  public void testElementDescriptor14() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema targetNamespace=\"http://www.deansoft.com/AddressBook\" xmlns:ab=\"http://www.deansoft.com/AddressBook\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\">" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:sequence>" +
+        "     <xsd:element ref=\"shipTo\"/>" +
+        "   </xsd:sequence>" +
+        "</xsd:complexType>" +
+        "</xsd:element>" +
+        "<xsd:element name=\"shipTo\" abstract=\"true\">" +
+        "   <xsd:complexType name=\"USAddress\">" +
+        "       <xsd:attribute name=\"orderDate\" type=\"xsd:date\"/>" +
+        "       <xsd:element name=\"items\" type=\"Items\"/>" +
+        "   </xsd:complexType>" +
+        "</xsd:element>" +
+        "<xsd:element name=\"name\" substitutionGroup=\"ab:shipTo\"/>" +
+        "</xsd:schema>");
+
+    XmlTag tag = XmlTestUtil.tag("purchaseOrder", "http://www.deansoft.com/AddressBook", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    final XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
+    assertEquals(1, elements.length);
+    assertEquals("name", elements[0].getName());
+    XmlAttributeDescriptor[] attrs = elements[0].getAttributesDescriptors(tag);
+    assertEquals(1, attrs.length);
+    assertEquals("orderDate", attrs[0].getName());
+    XmlElementDescriptor[] element0Descriptors = elements[0].getElementsDescriptors(tag.findFirstSubTag(elements[0].getName()));
+    assertEquals(1, element0Descriptors.length);
+    assertEquals("items", element0Descriptors[0].getName());
+  }
+
+  public void testAttributeDescriptor1() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:attribute name=\"orderDate\" type=\"xsd:date\"/>" +
+        "</xsd:complexType>" +
+        "</xsd:schema>");
+
+    final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+    XmlAttributeDescriptor attribute = elementDescriptor.getAttributeDescriptor("orderDate", tag);
+
+    assertTrue(!attribute.isEnumerated());
+    assertTrue(!attribute.isFixed());
+    assertTrue(!attribute.isRequired());
+    assertNull(attribute.getDefaultValue());
+  }
+
+  public void testAttributeDescriptorProhibited() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:attribute name=\"orderDate\" type=\"xsd:date\" use=\"prohibited\" />" +
+        "</xsd:complexType>" +
+        "</xsd:schema>");
+
+    final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+    XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
+    assertEquals(0, attributes.length);
+  }
+
+  public void testAttributeDescriptorProhibited2() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "    <xsd:complexContent>" +
+        "     <xsd:restriction base=\"PurchaseOrderType2\">" +
+        "       <xsd:attribute name=\"orderDate\" type=\"xsd:date\" use=\"prohibited\"/>" +
+        "     </xsd:restriction>" +
+        "    </xsd:complexContent>" +
+        "</xsd:complexType>" +
+        "<xsd:complexType name=\"PurchaseOrderType2\">" +
+        "   <xsd:sequence>" +
+        "     <xsd:attribute name=\"orderDate\" type=\"xsd:date\"/>" +
+        "     <xsd:attribute name=\"name\" type=\"xsd:string\"/>" +
+        "   </xsd:sequence>" +
+        "</xsd:complexType>" +
+        "</xsd:schema>");
+
+    final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+
+    XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
+
+    assertEquals(1, attributes.length);
+    assertEquals("name", attributes[0].getName());
+  }
+
+  public void testAttributeDescriptor2() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:attribute name=\"orderDate\" type=\"xsd:date\" use=\"required\" default=\" 2002 \"/>" +
+        "</xsd:complexType>" +
+        "</xsd:schema>");
+
+    final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+    XmlAttributeDescriptor attribute = elementDescriptor.getAttributeDescriptor("orderDate", tag);
+
+    assertTrue(!attribute.isEnumerated());
+    assertTrue(!attribute.isFixed());
+    assertTrue(attribute.isRequired());
+    assertEquals(" 2002 ", attribute.getDefaultValue());
+  }
+
+  public void testAttributeDescriptor3() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:attribute name=\"orderDate\" type=\"xsd:date\" fixed=\"1 01 2001\"/>" +
+        "</xsd:complexType>" +
+        "</xsd:schema>");
+
+    final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+    XmlAttributeDescriptor attribute = elementDescriptor.getAttributeDescriptor("orderDate", tag);
+
+    assertTrue(!attribute.isEnumerated());
+    assertTrue(attribute.isFixed());
+    assertTrue(!attribute.isRequired());
+    assertEquals("1 01 2001", attribute.getDefaultValue());
+  }
+
+  public void testAttributeDescriptor4() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:attribute ref=\"orderDate\" use=\"required\"/>" +
+        "</xsd:complexType>" +
+        "   <xsd:attribute name=\"orderDate\" type=\"xsd:date\" fixed=\"1 01 2001\"/>" +
+        "</xsd:schema>");
+
+    final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
+    XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
+    XmlAttributeDescriptor attribute = elementDescriptor.getAttributeDescriptor("orderDate", tag);
+
+    assertNotNull(attribute);
+    assertTrue(!attribute.isEnumerated());
+    assertTrue(attribute.isFixed());
+    assertTrue(attribute.isRequired());
+    assertEquals("1 01 2001", attribute.getDefaultValue());
+  }
+
+  public void testNamespace1() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xs:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xs:element name=\"comment\" type=\"xs:string\"/>" +
+        "</xs:schema>");
+
+    assertNotNull(NSDescriptor);
+    assertNotNull(NSDescriptor.getElementDescriptor(XmlTestUtil.tag("purchaseOrder", getProject())));
+    assertNotNull(NSDescriptor.getElementDescriptor(XmlTestUtil.tag("comment", getProject())));
+    assertNull(NSDescriptor.getElementDescriptor(UNKNOWN_TAG));
+  }
+
+  public void testNamespace2() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema targetNamespace=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" >" +
+        "<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<xsd:complexType name=\"PurchaseOrderType\">" +
+        "   <xsd:sequence>" +
+        "     <xsd:element ref=\"xsd:items\"/>" +
+        "   </xsd:sequence>" +
+        "</xsd:complexType>" +
+        "<xsd:element name=\"items\" type=\"xsd:string\"/>" +
+        "</xsd:schema>");
+
+    XmlTag tag = XmlTestUtil.tag("purchaseOrder", "http://www.w3.org/2001/XMLSchema", getProject());
+    XmlElementDescriptorImpl elementDescriptor = (XmlElementDescriptorImpl)NSDescriptor.getElementDescriptor(tag);
+
+    XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
+    assertEquals(1, elements.length);
+    assertEquals("items", elements[0].getName());
+
+    assertEquals("items", elementDescriptor.getElementDescriptor("items").getName());
+    assertNull(elementDescriptor.getElementDescriptor("xxx"));
+  }
+
+  public void testNamespace3() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xs:schema xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" +
+        "<xs:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
+        "<element name=\"comment\" type=\"xs:string\"/>" +
+        "</xs:schema>");
+
+    assertNotNull(NSDescriptor);
+    assertNotNull(NSDescriptor.getElementDescriptor(XmlTestUtil.tag("purchaseOrder", "http://www.w3.org/2001/XMLSchema", getProject())));
+    assertNotNull(NSDescriptor.getElementDescriptor(XmlTestUtil.tag("comment", "http://www.w3.org/2001/XMLSchema", getProject())));
+    assertNull(NSDescriptor.getElementDescriptor(UNKNOWN_TAG));
+  }
+
+  //public void testAny1() throws Exception {
+  //  XmlDocumentDescriptor documentDescriptor = createDescriptorImpl(
+  //      "<xsd:schema targetNamespace=\"http://foo\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" >" +
+  //      "  <xsd:element name=\"root\">" +
+  //      "    <xsd:complexType>" +
+  //      "      <xsd:sequence minOccurs=\"1\" maxOccurs=\"1\">" +
+  //      "        <xsd:any namespace=\"##other\" minOccurs=\"0\" maxOccurs=\"unbounded\" processContents=\"skip\"/>" +
+  //      "      </xsd:sequence>" +
+  //      "    </xsd:complexType>" +
+  //      "  </xsd:element>" +
+  //      "</xsd:schema>"
+  //  );
+  //
+  //  XmlFile xmlFile = (XmlFile)createFile("file.xml",
+  //      "<root xmlns=\"http://foo\">" +
+  //      "  <a:a xmlns:a=\"http://bar\" />" +
+  //      "</root>"
+  //  );
+  //
+  //  XmlElementDescriptor rootDescriptor = documentDescriptor.getElementDescriptor(xmlFile.saveToString().getRootTag());
+  //  assertNotNull(rootDescriptor);
+  //
+  //  XmlTag aTag = xmlFile.saveToString().getRootTag().findSubTag("a:a");
+  //  assertNotNull(aTag);
+  //  XmlElementDescriptor aDescriptor = documentDescriptor.getElementDescriptor(aTag);
+  //  assertNotNull(aDescriptor);
+  //}
+
+  public void testAny2() throws Exception {
+    PsiFile dtdFile = createFile("test.xml", "<xsd:schema targetNamespace=\"http://foo\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" >" +
+                                             "  <xsd:element name=\"root\">" +
+                                             "    <xsd:complexType>" +
+                                             "      <xsd:sequence minOccurs=\"1\" maxOccurs=\"1\">" +
+                                             "        <xsd:any namespace=\"##other\" minOccurs=\"0\" maxOccurs=\"unbounded\" processContents=\"skip\"/>" +
+                                             "      </xsd:sequence>" +
+                                             "    </xsd:complexType>" +
+                                             "  </xsd:element>" +
+                                             "</xsd:schema>");
+
+    XmlNSDescriptor NSDescriptor = new XmlNSDescriptorImpl((XmlFile)dtdFile);
+
+    XmlFile xmlFile = (XmlFile)createFile("file.xml",
+                                          "<foo:root xmlns:foo=\"http://foo\">" +
+                                          "  <foo:a xmlns:a=\"http://bar\" />" +
+                                          "</foo:root>"
+    );
+
+    XmlElementDescriptor rootDescriptor = NSDescriptor.getElementDescriptor(xmlFile.getDocument().getRootTag());
+    assertNotNull(rootDescriptor);
+
+    XmlTag aTag = xmlFile.getDocument().getRootTag().findFirstSubTag("foo:a");
+    assertNotNull(aTag);
+    //XmlElementDescriptor aDescriptor = NSDescriptor.getElementDescriptor(aTag);
+    //assertNull(aDescriptor);
+  }
+
+  public void testAny3() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema targetNamespace=\"http://foo\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" >" +
+        "  <xsd:element name=\"root\">" +
+        "    <xsd:complexType>" +
+        "        <xsd:anyAttribute namespace=\"##other\" processContents=\"skip\"/>" +
+        "    </xsd:complexType>" +
+        "  </xsd:element>" +
+        "</xsd:schema>"
+    );
+
+    XmlFile xmlFile = (XmlFile)createFile("file.xml",
+                                          "<root xmlns=\"http://foo\" y:a=\"1\">" +
+                                          "</root>"
+    );
+
+    final XmlTag rootTag = xmlFile.getDocument().getRootTag();
+    XmlElementDescriptor rootDescriptor = NSDescriptor.getElementDescriptor(rootTag);
+    assertNotNull(rootDescriptor);
+
+    XmlAttribute attribute = rootTag.getAttribute("y:a", XmlUtil.EMPTY_URI);
+    assertNotNull(attribute);
+    XmlAttributeDescriptor aDescriptor = rootDescriptor.getAttributeDescriptor("y:a", rootTag);
+    assertNotNull(aDescriptor);
+  }
+
+  public void testAny4() throws Exception {
+    XmlNSDescriptor NSDescriptor = createDescriptor(
+        "<xsd:schema targetNamespace=\"http://foo\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" >" +
+        "  <xsd:element name=\"root\">" +
+        "    <xsd:complexType>" +
+        "        <xsd:anyAttribute namespace=\"##other\" processContents=\"skip\"/>" +
+        "    </xsd:complexType>" +
+        "  </xsd:element>" +
+        "</xsd:schema>"
+    );
+
+    XmlFile xmlFile = (XmlFile)createFile("file.xml",
+                                          "<root xmlns=\"http://foo\" a=\"1\">" +
+                                          "</root>"
+    );
+
+    final XmlTag rootTag = xmlFile.getDocument().getRootTag();
+    XmlElementDescriptor rootDescriptor = NSDescriptor.getElementDescriptor(rootTag);
+    assertNotNull(rootDescriptor);
+
+    XmlAttribute attribute = rootTag.getAttribute("a", XmlUtil.EMPTY_URI);
+    assertNotNull(attribute);
+    XmlAttributeDescriptor aDescriptor = rootDescriptor.getAttributeDescriptor("a", rootTag);
+    assertNull(aDescriptor);
+
+    attribute = rootTag.getAttribute("a", "http://foo");
+    assertNull(attribute);
+    attribute = rootTag.getAttribute("a", XmlUtil.ANT_URI);
+    assertNull(attribute);
+  }
+
+  private static XmlNSDescriptor createDescriptor(@NonNls String dtdText) throws Exception {
+    PsiFile dtdFile = createFile("test.xml", dtdText);
+
+    return new XmlNSDescriptorImpl((XmlFile)dtdFile);
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlTagTest.java b/xml/tests/src/com/intellij/codeInsight/XmlTagTest.java
new file mode 100644
index 0000000..3201d43
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlTagTest.java
@@ -0,0 +1,975 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.command.UndoConfirmationPolicy;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.RangeMarker;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFileManager;
+import com.intellij.psi.*;
+import com.intellij.psi.codeStyle.CodeStyleManager;
+import com.intellij.psi.xml.*;
+import com.intellij.testFramework.LightCodeInsightTestCase;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.LocalTimeCounter;
+import com.intellij.xml.util.XmlTagUtil;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Arrays;
+
+/**
+ * @author peter
+ */
+@SuppressWarnings({"ConstantConditions", "EmptyCatchBlock"})
+public class XmlTagTest extends LightCodeInsightTestCase {
+  private static XmlTag createTag(String value) throws IncorrectOperationException {
+    return XmlElementFactory.getInstance(getProject()).createTagFromText("<foo>" + value + "</foo>");
+  }
+
+  public void testGetTextValue() throws Throwable {
+    assertEquals("bar", createTag("bar").getValue().getText());
+  }
+
+  public void testCharRefs() throws Throwable {
+    String[] names = XmlTagUtil.getCharacterEntityNames();
+    for (String name : names) {
+      XmlTag tag = createTag("foo&" + name + ";bar");
+      assertEquals("foo" + XmlTagUtil.getCharacterByEntityName(name) + "bar", tag.getValue().getTrimmedText());
+    }
+  }
+
+  public void testLocalNSDeclarations() throws Throwable {
+    final XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("<foo xmlns='aaa' xmlns:a='bbbb'/>");
+    final Object[] nsPrefixes = ArrayUtil.toObjectArray(tag.getLocalNamespaceDeclarations().keySet());
+    Arrays.sort(nsPrefixes);
+    assertEquals(2, nsPrefixes.length);
+    assertEquals("a",nsPrefixes[1]);
+    assertEquals("",nsPrefixes[0]);
+  }
+
+  public void testCDATA() throws Throwable {
+    XmlTag tag = createTag("foo<![CDATA[<>&'\"]]>bar");
+    assertEquals("foo<>&'\"bar", tag.getValue().getTrimmedText());
+  }
+
+  public void testWhitespacesInAttributes() throws Throwable {
+    XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("<a c=d>b</a>");
+    assertEquals("b", tag.getValue().getText());
+  }
+
+  public void testCreateChildTag() throws Throwable {
+    final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<a xmlns=\"aNamespace\"/>");
+    final XmlTag childTag = rootTag.createChildTag("b", "bNamespace", null, true);
+    assertEquals("bNamespace", childTag.getNamespace());
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        XmlTag beanTag = (XmlTag)rootTag.add(childTag);
+        assertEquals("bNamespace", beanTag.getNamespace());
+      }
+    });
+  }
+
+  public void testDeleteTag() throws Throwable {
+    XmlTag aTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<a><b/> </a>");
+    final XmlTag bTag = aTag.findFirstSubTag("b");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        bTag.delete();
+      }
+    });
+
+    assertEquals(0, aTag.getSubTags().length);
+  }
+
+  public void testReplaceTag() throws Throwable {
+    final XmlTag aTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<a><b/></a>");
+    final XmlTag bTag = aTag.findFirstSubTag("b");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        PsiElement cTag = bTag.replace(XmlElementFactory.getInstance(getProject()).createTagFromText("<c/>"));
+        assertEquals(1, aTag.getSubTags().length);
+        assertEquals(cTag, aTag.getSubTags()[0]);
+      }
+    });
+  }
+
+  public void testAddText() throws Exception{
+    final XmlElementFactory elementFactory = XmlElementFactory.getInstance(getProject());
+    final XmlTag aTag = elementFactory.createTagFromText("<a>1</a>");
+    final XmlText displayText = elementFactory.createDisplayText("2");
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        final PsiElement psiElement = aTag.addAfter(displayText, aTag.getValue().getChildren()[0]);
+        assertEquals(psiElement.getContainingFile(), aTag.getContainingFile());
+      }
+    });
+  }
+
+  public void testWhitespaceInsideTag() throws Exception {
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        XmlElementFactory.getInstance(getProject()).createTagFromText("<p/>").getValue().setText("\n");
+      }
+    });
+  }
+
+  public void testSetAttribute_ForXhtml() throws Exception {
+    XmlFile xhtmlFile = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("dummy.xhtml", "<html/>");
+    final XmlTag rootTag = xhtmlFile.getDocument().getRootTag();
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        rootTag.setAttribute("foo", "bar");
+      }
+    });
+
+    assertEquals(1, rootTag.getAttributes().length);
+    assertEquals("bar", rootTag.getAttributeValue("foo"));
+    assertEquals("foo", rootTag.getAttributes()[0].getName());
+  }
+
+  public void testSetAttribute() throws Exception {
+    final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html/>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        rootTag.setAttribute("foo", "bar");
+      }
+    });
+
+    assertEquals(1, rootTag.getAttributes().length);
+    assertEquals("bar", rootTag.getAttributeValue("foo"));
+    assertEquals("foo", rootTag.getAttributes()[0].getName());
+    assertEquals("<html foo=\"bar\"/>", rootTag.getText());
+  }
+
+  public void testSetAttributeWithQuotes() throws Exception {
+    final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html/>");
+    final String value = "a \"b\" c";
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        rootTag.setAttribute("foo", value);
+      }
+    });
+
+    assertEquals(1, rootTag.getAttributes().length);
+    assertEquals(value, rootTag.getAttributeValue("foo"));
+    assertEquals("foo", rootTag.getAttributes()[0].getName());
+    assertEquals("<html foo='" + value + "'/>", rootTag.getText());
+  }
+
+  public void testSetAttributeWithQuotes2() throws Exception {
+    final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html/>");
+    final String value = "'a \"b\" c'";
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        rootTag.setAttribute("foo", value);
+      }
+    });
+
+    final String expected = value.replaceAll("\"", "&quot;");
+    assertEquals(1, rootTag.getAttributes().length);
+    assertEquals(expected, rootTag.getAttributeValue("foo"));
+    assertEquals(value, rootTag.getAttribute("foo").getDisplayValue());
+    assertEquals("foo", rootTag.getAttributes()[0].getName());
+    assertEquals("<html foo=\"" + expected + "\"/>", rootTag.getText());
+  }
+
+  public void testSetAttributeUpdateText() throws Exception {
+    final String value = "a \"b\" c";
+    final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html foo='" + value + "'/>");
+
+    assertEquals(1, rootTag.getAttributes().length);
+    assertEquals(value, rootTag.getAttributeValue("foo"));
+
+    final XmlAttribute foo = rootTag.getAttribute("foo");
+    final String text = foo.getValueElement().getText();
+    assertEquals("'" + value + "'", text);
+
+    ((PsiLanguageInjectionHost)foo.getValueElement()).updateText(text);
+    assertEquals("<html foo='" + value + "'/>", rootTag.getText());
+  }
+
+  public void testSetAttributeWithNamespaces() throws Exception {
+    final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<ns:tag xmlns:ns=\"xxx\"/>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        rootTag.setAttribute("foo", "", "bar");
+      }
+    });
+
+    assertEquals(2, rootTag.getAttributes().length);
+    assertEquals("bar", rootTag.getAttributeValue("foo"));
+    assertEquals("foo", rootTag.getAttributes()[1].getName());
+    assertEquals("<ns:tag xmlns:ns=\"xxx\" foo=\"bar\"/>", rootTag.getText());
+  }
+
+  public void testTextEdit1() throws Exception {
+    final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html>aaa</html>");
+    final XmlText xmlText = rootTag.getValue().getTextElements()[0];
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        xmlText.removeText(0, 3);
+      }
+    });
+
+    assertEquals("<html></html>", rootTag.getText());
+  }
+
+  public void testTextEdit2() throws Exception {
+    final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html>a&lt;a</html>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        rootTag.getValue().getTextElements()[0].removeText(0, 3);
+      }
+    });
+
+    assertEquals("<html></html>", rootTag.getText());
+  }
+
+  public void testTextEdit3() throws Exception {
+    final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html>a&lt;a</html>");
+    final XmlText xmlText = rootTag.getValue().getTextElements()[0];
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        xmlText.removeText(1, 2);
+      }
+    });
+
+    assertEquals(1, xmlText.getChildren().length);
+    assertEquals("<html>aa</html>", rootTag.getText());
+  }
+
+  public void testTextEdit4() throws Exception {
+    final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html>aaa</html>");
+    final XmlText xmlText = rootTag.getValue().getTextElements()[0];
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        xmlText.removeText(1, 2);
+      }
+    });
+
+    assertEquals(1, xmlText.getChildren().length);
+    assertEquals("<html>aa</html>", rootTag.getText());
+  }
+
+  public void testTextEdit5() throws Exception {
+    final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html><x>xxx</x>\n<y>yyy</y></html>");
+    final XmlTag y = rootTag.findFirstSubTag("y");
+
+    final PsiFile file = y.getContainingFile();
+    String text = y.getValue().getText();
+    TextRange textRange = y.getValue().getTextRange();
+
+    assertEquals(text, textRange.substring(file.getText()));
+
+    new WriteCommandAction(getProject(), file) {
+      @Override
+      protected void run(final Result result) throws Throwable {
+        CodeStyleManager.getInstance(getProject()).adjustLineIndent(file, y.getTextOffset());
+      }
+    }.execute();
+
+    text = y.getValue().getText();
+    textRange = y.getValue().getTextRange();
+
+    assertEquals(text, textRange.substring(file.getText()));
+  }
+
+  public void testTextEdit6() throws Exception {
+    final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html>a<b>1</b>c</html>");
+    final XmlTag xmlTag = rootTag.findFirstSubTag("b");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        xmlTag.delete();
+      }
+    });
+
+    assertEquals("<html>ac</html>", rootTag.getText());
+  }
+
+  public void testBrace() throws Exception {
+   final XmlTag tagFromText = XmlElementFactory.getInstance(getProject()).createTagFromText("<a/>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tagFromText.getValue().setText("<");
+      }
+    });
+
+    assertEquals("<", tagFromText.getValue().getTextElements()[0].getValue());
+  }
+
+  public void testEmptyTextRange() throws Exception {
+    final String text = "<a></a>";
+    final String name = "test.xhtml";
+    XmlTag rootTag = createTag(name, text);
+    TextRange textRange = rootTag.getValue().getTextRange();
+    assertEquals(3, textRange.getStartOffset());
+    assertEquals(3, textRange.getEndOffset());
+  }
+
+  public void testDeleteTagBetweenText() throws Exception {
+    final XmlTag tag = createTag("foo.xhtml", "<p>a<div/>b</p>");
+    final XmlTag div = tag.getSubTags()[0];
+    new WriteCommandAction(getProject(), tag.getContainingFile()) {
+      @Override
+      protected void run(final Result result) throws Throwable {
+        div.delete();
+      }
+    }.execute();
+    assertEquals("<p>ab</p>", tag.getText());
+  }
+
+  private static XmlTag createTag(final String name, final String text) {
+    final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject())
+      .createFileFromText(name, StdFileTypes.XML, text, LocalTimeCounter.currentTime(), true);
+    return file.getDocument().getRootTag();
+  }
+
+  // tests whether rangemarker gets changed when texts are merged, passes
+  public void testRangeMarker1() throws IOException, IncorrectOperationException {
+    final XmlFile file = (XmlFile)createFile("file.xhtml", "<a>1234<b></b>567</a>");
+    final XmlTag root = file.getDocument().getRootTag();
+    final XmlTag tag = root.findFirstSubTag("b");
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      @Override
+      public void run() {
+        CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
+          @Override
+          public void run() {
+            final int offset = tag.getTextOffset();
+
+            Document document = PsiDocumentManager.getInstance(getProject()).getDocument(root.getContainingFile());
+            RangeMarker marker = document.createRangeMarker(offset - 3, offset);
+            tag.delete();
+
+
+            assertEquals(4, marker.getStartOffset());
+            assertEquals(7, marker.getEndOffset());
+          }
+        }, "", null);
+      }
+    });
+  }
+
+  // this one fails, the difference is that we do some manipulations before: move "234" before the tag
+  public void testRangeMarker2() throws IOException, IncorrectOperationException {
+    final XmlTag root = createTag("file.xhtml", "<a>1<b>234</b>567</a>");
+    final XmlTag tag = root.findFirstSubTag("b");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      @Override
+      public void run() {
+        CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
+          @Override
+          public void run() {
+            Document document = PsiDocumentManager.getInstance(getProject()).getDocument(root.getContainingFile());
+            XmlTagChild child = tag.getValue().getChildren()[0];
+            assertTrue(child instanceof XmlText && child.getText().equals("234"));
+
+            try {
+              tag.getParent().addBefore(child, tag);
+
+              assertEquals(7, tag.getTextOffset());
+              RangeMarker marker = document.createRangeMarker(4, 7);
+              tag.delete();
+
+              assertEquals(4, marker.getStartOffset());
+              assertEquals(7, marker.getEndOffset());
+
+            }
+            catch (IncorrectOperationException e) {
+            }
+          }
+        }, "", null);
+      }
+    });
+  }
+
+  // the previous test relveals one problem with text merge, "234" in fact is not merged with "1"
+  public void test3() throws IOException, IncorrectOperationException {
+    final XmlTag root = XmlElementFactory.getInstance(getProject()).createTagFromText("<a>1<b>234</b>456</a>");
+    final XmlTag tag = root.findFirstSubTag("b");
+
+    final XmlTagChild child = tag.getValue().getChildren()[0];
+    assertTrue(child instanceof XmlText && child.getText().equals("234"));
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        assertNotNull(tag.getParent().addBefore(child, tag));
+        tag.delete();
+      }
+    });
+
+
+    assertEquals(1, root.getValue().getChildren().length);
+    assertEquals("1234456", root.getValue().getChildren()[0].getText());
+  }
+
+  public void test3XHTML() throws IOException, IncorrectOperationException {
+    final XmlTag root = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>1<b>234</b>456</a>");
+    final XmlTag tag = root.findFirstSubTag("b");
+
+    final XmlTagChild child = tag.getValue().getChildren()[0];
+    assertTrue(child instanceof XmlText && child.getText().equals("234"));
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        assertNotNull(tag.getParent().addBefore(child, tag));
+        tag.delete();
+      }
+    });
+
+
+    assertEquals(1, root.getValue().getChildren().length);
+    assertEquals("1234456", root.getValue().getChildren()[0].getText());
+  }
+
+  public void testDisplayText() throws Throwable {
+    final XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("  <foo/>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tag.add(XmlElementFactory.getInstance(getProject()).createDisplayText("aaa\nbbb"));
+      }
+    });
+
+    assertEquals("aaa\nbbb", tag.getValue().getTextElements()[0].getValue());
+  }
+
+  public void testXHTMLAddBefore1() throws Exception {
+    final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("test.xhtml",
+                                                                                                              "<a>a <b>123</b> c</a>");
+    final XmlTag tagB = file.getDocument().getRootTag().findFirstSubTag("b");
+
+    final XmlTagChild[] tagElements = tagB.getValue().getChildren();
+    final PsiElement parent = tagB.getParent();
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        PsiElement first = parent.addBefore(tagElements[0], tagB);
+        assertNotNull(first);
+      }
+    });
+  }
+
+  public void testXHTMLSetAttribute1() throws Exception {
+    new WriteCommandAction.Simple(getProject()) {
+      @Override
+      protected void run() throws Throwable {
+        final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("test.xhtml", "<a/>");
+        final XmlTag tagB = file.getDocument().getRootTag();
+
+        tagB.setAttribute("a", "");
+        assertEquals("<a a=\"\"/>", tagB.getText());
+
+        tagB.setAttribute("b", "");
+        assertEquals("<a a=\"\" b=\"\"/>", tagB.getText());
+
+        tagB.setAttribute("c", "");
+        assertEquals("<a a=\"\" b=\"\" c=\"\"/>", tagB.getText());
+
+        tagB.getAttributes()[1].delete();
+        assertEquals("<a a=\"\"  c=\"\"/>", tagB.getText());
+      }
+    }.execute().throwException();
+  }
+
+  public void testXHTMLNbsp1() throws Exception {
+    final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("test.xhtml", "<a>&nbsp;</a>");
+    final XmlTag tagB = file.getDocument().getRootTag();
+    assertEquals(tagB.getValue().getTextElements().length, 1);
+    assertEquals(tagB.getValue().getTextElements()[0].getValue(), "\u00a0");
+  }
+
+  public void testDeleteTagWithMultilineWhitespace1() throws Exception {
+    final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("test.xml",
+                                                                                                              "<a>\n  <a/>\n</a>");
+    final XmlTag tagB = file.getDocument().getRootTag();
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tagB.getSubTags()[0].delete();
+      }
+    });
+
+    assertEquals("<a>\n  </a>", tagB.getText());
+  }
+
+  public void testDeleteTagWithMultilineWhitespace2() throws Exception {
+    final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject())
+      .createFileFromText("test.xml", "<a>\n    <a>\n <b>\n     hasgdgasjdgasdg    asgdjhasgd</b>\n </a>\n</a>");
+    final XmlTag tagB = file.getDocument().getRootTag();
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tagB.getSubTags()[0].getSubTags()[0].delete();
+      }
+    });
+
+    assertEquals("<a>\n    <a>\n </a>\n</a>", tagB.getText());
+  }
+
+  public void testXHTMLRangeMarkers2() throws Exception {
+    XmlTag tag = createTag("file.xhtml", "<a>xyz</a>");
+    PsiFile psiFile = tag.getContainingFile();
+    Document document = PsiDocumentManager.getInstance(psiFile.getProject()).getDocument(psiFile);
+    RangeMarker rangeMarker = document.createRangeMarker(5, 5);
+    final XmlText text = (XmlText) tag.getValue().getChildren()[0];
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      @Override
+      public void run() {
+        CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
+          @Override
+          public void run() {
+            try{
+              text.removeText(2, 3);
+            }
+            catch(IncorrectOperationException ioe){}
+          }
+        }, "", null, UndoConfirmationPolicy.DO_NOT_REQUEST_CONFIRMATION);
+      }
+    });
+
+    assertEquals(5, rangeMarker.getStartOffset());
+    assertEquals(5, rangeMarker.getEndOffset());
+  }
+
+  public void testXHTMLTextInsert() throws Exception {
+    final XmlTag tag = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>xyz</a>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tag.getValue().getTextElements()[0].insertText("<", 1);
+      }
+    });
+
+    assertEquals("<a>x&lt;yz</a>", tag.getText());
+  }
+
+  public void testSimpleTextInsertion() throws Throwable {
+    doTestSimpleInsertion("xyz", "a");
+    doTestSimpleInsertion(" xyz", "a");
+    doTestSimpleInsertion("x yz", "a");
+    doTestSimpleInsertion("xy z", "a");
+    doTestSimpleInsertion("xyz ", "a");
+    doTestSimpleInsertion(" xyz ", "a");
+    doTestSimpleInsertion(" x y z ", "a");
+  }
+
+  public void testWhitespaceTextInsertion() throws Throwable {
+    doTestSimpleInsertion("xyz", " ");
+  }
+
+  public void testSimpleTextDeletion() throws Throwable {
+    doTestSimpleDeletion("xyz");
+    doTestSimpleDeletion(" xyz");
+    doTestSimpleDeletion("x yz");
+    doTestSimpleDeletion("xy z");
+    doTestSimpleDeletion("xyz ");
+    doTestSimpleDeletion(" xyz ");
+    doTestSimpleDeletion(" x y z ");
+  }
+
+  public void testWhitespaceDeletion() throws Throwable {
+    doTestSimpleDeletion(" xyz");
+    doTestSimpleDeletion("x yz");
+    doTestSimpleDeletion("xy z");
+    doTestSimpleDeletion("xyz ");
+    doTestSimpleDeletion(" xyz ");
+    doTestSimpleDeletion(" x y z ");
+  }
+
+  private static void doTestSimpleDeletion(final String text) throws IncorrectOperationException {
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        for (int i = 0; i < text.length(); i++) {
+          for (int j = i; j < text.length(); j++) {
+            XmlTag tag = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>" + text + "</a>");
+            final PsiElement[] children = tag.getValue().getTextElements();
+            assertEquals(1, children.length);
+            final XmlText xmlText = (XmlText)children[0];
+            assertEquals(text, xmlText.getText());
+            xmlText.removeText(i, j);
+            final StringBuffer expected = new StringBuffer(text);
+            expected.delete(i, j);
+            assertEquals(expected.toString(), xmlText.getValue());
+          }
+        }
+      }
+    });
+  }
+
+  private static void doTestSimpleInsertion(final String text, final String textToInsert) throws IncorrectOperationException {
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        for (int i = 0; i <= text.length(); i++) {
+          XmlTag tag = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>" + text + "</a>");
+          final PsiElement[] children = tag.getValue().getTextElements();
+          assertEquals(1, children.length);
+          final XmlText xmlText = (XmlText)children[0];
+          assertEquals(text, xmlText.getValue());
+          xmlText.insertText(textToInsert, i);
+          final StringBuffer expected = new StringBuffer(text);
+          expected.insert(i, textToInsert);
+          assertEquals(expected.toString(), xmlText.getValue());
+        }
+      }
+    });
+  }
+
+  public void testEscapedInsertion() throws Throwable {
+    doTestEscapedInsertion("xyz", "&");
+    doTestEscapedInsertion("xyz", "&&");
+    doTestEscapedInsertion("xyz", "&x&");
+    doTestEscapedInsertion("&xyz", "a");
+    doTestEscapedInsertion("&xyz", " ");
+    doTestEscapedInsertion("x&yz", "a");
+    doTestEscapedInsertion("x&yz", " ");
+    doTestEscapedInsertion("xy&z", "a");
+    doTestEscapedInsertion("xy&z", " ");
+    doTestEscapedInsertion("xyz&", "a");
+    doTestEscapedInsertion("xyz&", " ");
+    doTestEscapedInsertion("&x&y&z&", "a");
+    doTestEscapedInsertion(" x&y&z&", "a");
+    doTestEscapedInsertion(" x y&z&", "a");
+    doTestEscapedInsertion("&x y&z&", "a");
+    doTestEscapedInsertion("&x y&z ", "a");
+    doTestEscapedInsertion("&x&y&z&", "<");
+    doTestEscapedInsertion("&x&y&z&", ">");
+    doTestEscapedInsertion("_xyz", "a");
+    doTestEscapedInsertion("x_yz", "a");
+    doTestEscapedInsertion("xy_z", "a");
+    doTestEscapedInsertion("xyz_", "a");
+    doTestEscapedInsertion("_xyz_", "a");
+    doTestEscapedInsertion("_x_y_z_", "a");
+  }
+
+  public static void notestEscapedDeletion() throws Throwable {
+    doTestEscapedDeletion("&");
+    doTestEscapedDeletion("&&");
+    doTestEscapedDeletion(" &&");
+    doTestEscapedDeletion(" & &");
+    doTestEscapedDeletion(" & & ");
+    doTestEscapedDeletion(" && ");
+    doTestEscapedDeletion("&& ");
+    doTestEscapedDeletion("& ");
+    doTestEscapedDeletion(" ");
+    doTestEscapedDeletion("&abc");
+    doTestEscapedDeletion("a&bc");
+    doTestEscapedDeletion("ab&c");
+    doTestEscapedDeletion("abc&");
+    doTestEscapedDeletion(" &abc");
+    doTestEscapedDeletion("a &bc");
+    doTestEscapedDeletion("ab &c");
+    doTestEscapedDeletion("abc &");
+    doTestEscapedDeletion("& abc");
+    doTestEscapedDeletion("a& bc");
+    doTestEscapedDeletion("ab& c");
+    doTestEscapedDeletion("abc& ");
+  }
+
+  private static void doTestEscapedInsertion(final String text, final String textToInsert) throws IncorrectOperationException {
+    String tagText = toEscapedText(text);
+    for (int i = 0; i <= text.length(); i++) {
+      XmlTag tag = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>" + tagText + "</a>");
+      final PsiElement[] children = tag.getValue().getTextElements();
+      assertEquals(1, children.length);
+      final XmlText xmlText = (XmlText)children[0];
+      assertEquals(tagText, xmlText.getText());
+      xmlText.insertText(textToInsert, i);
+      final StringBuffer expectedDisplay = new StringBuffer(text.replace('_', '\u00a0'));
+      expectedDisplay.insert(i, textToInsert);
+      assertEquals(expectedDisplay.toString(), xmlText.getValue());
+
+//      final String expectedText = toEscapedText(expectedDisplay.toString());
+//      assertEquals(expectedText, xmlText.getText());
+    }
+  }
+
+  private static void doTestEscapedDeletion(final String text) throws IncorrectOperationException {
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        String tagText = toEscapedText(text);
+        for (int i = 0; i < text.length(); i++) {
+          for (int j = i; j < text.length(); j++) {
+            XmlTag tag = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>" + tagText + "</a>");
+            final PsiElement[] children = tag.getValue().getTextElements();
+            assertEquals(1, children.length);
+            final XmlText xmlText = (XmlText)children[0];
+            assertEquals(tagText, xmlText.getText());
+            xmlText.removeText(i, j);
+            final StringBuffer expectedDisplay = new StringBuffer(text.replace('_', ' '));
+            expectedDisplay.delete(i, j);
+            assertEquals(expectedDisplay.toString(), xmlText.getValue());
+
+            final String expectedText = toEscapedText(expectedDisplay.toString());
+            assertEquals(expectedText, xmlText.getText());
+          }
+        }
+      }
+    });
+  }
+
+  public void testWhitespacesInEmptyXHTMLTag() throws Exception{
+    final XmlTag tag = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a> <b/> </a>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tag.findFirstSubTag("b").delete();
+      }
+    });
+
+    assertEquals("<a>  </a>", tag.getText());
+  }
+
+  public void test2() throws Exception {
+    XmlFile file = (XmlFile)createFile("file.xml", "<a>x y</a>");
+    XmlTag tag = file.getDocument().getRootTag();
+    final XmlText xmlText = tag.getValue().getTextElements()[0];
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      @Override
+      public void run() {
+        CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
+          @Override
+          public void run() {
+            try {
+              xmlText.insertText("z", 1);
+            }
+            catch (IncorrectOperationException e) {
+              throw new RuntimeException(e);
+            }
+          }
+        }, "", null, UndoConfirmationPolicy.DO_NOT_REQUEST_CONFIRMATION);
+      }
+    });
+    assertEquals("<a>xz y</a>", tag.getText());
+  }
+
+  private static String toDisplay(String text) {
+    text = text.replaceAll("&lt;", "<");
+    text = text.replaceAll("&gt;", ">");
+    text = text.replaceAll("&amp;", "&");
+    text = text.replaceAll("&apos;", "'");
+    text = text.replaceAll("&quot;", "\"");
+    text = text.replaceAll("<!\\[CDATA\\[", "");
+    text = text.replaceAll("\\]\\]>", "");
+    return text.replaceAll("&nbsp;", "_");
+  }
+
+  private static String toEscapedText(String original) {
+    String text = original.replaceAll("<", "&lt;");
+    text = text.replaceAll(">", "&gt;");
+    text = text.replaceAll("&", "&amp;");
+    text = text.replaceAll("'", "&apos;");
+    text = text.replaceAll("\"", "&quot;");
+    text = text.replaceAll("_", "&nbsp;");
+    assertEquals(original, toDisplay(text));
+    return text;
+  }
+
+  public void testCoordinateMappingConsistent() throws Exception {
+    doCoordinateMappingConsistentFromDisplayText("abc");
+    doCoordinateMappingConsistentFromDisplayText(" abc");
+    doCoordinateMappingConsistentFromDisplayText(" a bc");
+    doCoordinateMappingConsistentFromDisplayText(" a b c");
+    doCoordinateMappingConsistentFromDisplayText(" a b c ");
+    doCoordinateMappingConsistentFromDisplayText(" ab c ");
+    doCoordinateMappingConsistentFromDisplayText(" abc ");
+    doCoordinateMappingConsistentFromDisplayText("abc ");
+
+    doCoordinateMappingConsistentFromDisplayText(" ");
+    doCoordinateMappingConsistentFromDisplayText("&");
+
+    doCoordinateMappingConsistentFromDisplayText("&abc");
+    doCoordinateMappingConsistentFromDisplayText(" &abc");
+    doCoordinateMappingConsistentFromDisplayText(" a& bc");
+    doCoordinateMappingConsistentFromDisplayText(" a &b c");
+    doCoordinateMappingConsistentFromDisplayText(" a b& c ");
+    doCoordinateMappingConsistentFromDisplayText(" ab c& ");
+    doCoordinateMappingConsistentFromDisplayText(" ab&c ");
+    doCoordinateMappingConsistentFromDisplayText("abc &");
+    doCoordinateMappingConsistentFromDisplayText("abc&");
+    doCoordinateMappingConsistentFromDisplayText("ab&c&");
+    doCoordinateMappingConsistentFromDisplayText("ab&c");
+    doCoordinateMappingConsistentFromDisplayText("a&b&c");
+
+    doCoordinateMappingConsistentFromEscapedText("<![CDATA[ ]]>");
+    doCoordinateMappingConsistentFromEscapedText("<![CDATA[x]]>");
+    doCoordinateMappingConsistentFromEscapedText("xxx<![CDATA[x]]>");
+    doCoordinateMappingConsistentFromEscapedText("xxx<![CDATA[x]]>xxx");
+    doCoordinateMappingConsistentFromEscapedText("xxx&amp;<![CDATA[x]]>xxx");
+    doCoordinateMappingConsistentFromEscapedText("xxx&amp;<![CDATA[x]]>&amp;xxx");
+    doCoordinateMappingConsistentFromEscapedText("xxx<![CDATA[x]]>&amp;xxx");
+    doCoordinateMappingConsistentFromEscapedText("xxx<![CDATA[xas]]>&amp;xxx");
+    doCoordinateMappingConsistentFromEscapedText("xxx<![CDATA[xa>s]]>&amp;xxx");
+    doCoordinateMappingConsistentFromEscapedText("xxx<![CDATA[x<a>s]]>&amp;xxx");
+  }
+
+  public void testNBSP() throws Exception {
+    final XmlTag tagA = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>1<b>&nbsp;</b></a>");
+
+    final XmlTag tagB = tagA.findFirstSubTag("b");
+    final XmlTagChild nbsp = tagB.getValue().getChildren()[0];
+    assertEquals("&nbsp;", nbsp.getText());
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tagA.addBefore(nbsp.copy(), tagB);
+      }
+    });
+
+    XmlTagChild nbsp1 = tagA.getValue().getChildren()[0];
+    assertEquals("1&nbsp;", nbsp1.getText());
+  }
+
+  private static void doCoordinateMappingConsistentFromDisplayText(final String text) throws IncorrectOperationException {
+    doCoordinateMappingConsistentFromEscapedText(toEscapedText(text));
+  }
+                                               
+  private static void doCoordinateMappingConsistentFromEscapedText(final String tagText) throws IncorrectOperationException {
+    String text = toDisplay(tagText);
+    XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("<a>" + tagText + "</a>");
+    final PsiElement[] children = tag.getValue().getTextElements();
+    assertEquals(1, children.length);
+    final XmlText xmlText = (XmlText)children[0];
+    assertEquals(tagText, xmlText.getText());
+
+    for (int i = 0; i <= text.length(); i++) {
+      final int physical = xmlText.displayToPhysical(i);
+      final int display = xmlText.physicalToDisplay(physical);
+      assertEquals("Coords mapping failed for: '" + tagText + "' - " + physical, display, i);
+    }
+
+    assertEquals("Coords mapping failed for: '" + tagText + "'", 0, xmlText.physicalToDisplay(0));
+    assertEquals(tagText.length(), xmlText.displayToPhysical(text.length()));
+    assertEquals(text.length(), xmlText.physicalToDisplay(tagText.length()));
+  }
+
+  public void testStrangeCharactesInText() throws Throwable {
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        XmlElementFactory.getInstance(getProject()).createTagFromText("<a/>").getValue().setText("@#$%@$%$${${''}");
+      }
+    });
+  }
+
+  public void testPsiToDocumentSynchronizationFailed() throws Throwable {
+    String text = "<wpd><methods> </methods></wpd>";
+    final File tempFile = FileUtil.createTempFile("idea-test", ".xml");
+    tempFile.createNewFile();
+    final FileOutputStream fileOutputStream = new FileOutputStream(tempFile);
+    fileOutputStream.write(text.getBytes());
+    fileOutputStream.flush();
+    fileOutputStream.close();
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      @Override
+      public void run() {
+        CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
+          @Override
+          @SuppressWarnings({"ConstantConditions"})
+          public void run() {
+            VirtualFileManager.getInstance().syncRefresh();
+            XmlFile file ;//createTemporaryFile("wpd.xml", text));
+            try {
+              file = (XmlFile)getPsiManager().findFile(VfsUtil.findFileByURL(tempFile.toURL()));
+            }
+            catch (MalformedURLException e) {
+              throw new RuntimeException(e);
+            }
+
+            final XmlTag methodTag = file.getDocument().getRootTag().findFirstSubTag("methods");
+            try {
+              methodTag.add(XmlElementFactory.getInstance(getProject()).createTagFromText("<method/>"));
+            }
+            catch (IncorrectOperationException e) {
+              throw new RuntimeException(e);
+            }
+          }
+        }, "", null, UndoConfirmationPolicy.DO_NOT_REQUEST_CONFIRMATION);
+      }
+    });
+  }
+
+  public void testXmlFormattingException() throws Throwable {
+    final XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("<foo>bar</foo>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tag.add(XmlElementFactory.getInstance(getProject()).createTagFromText("<bar/>"));
+      }
+    });
+  }
+
+  public void testSetNamespace() throws Exception {
+    XmlFile xhtmlFile = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("dummy.xml",
+                                                                                                             "<html><body/></html>");
+
+    final XmlTag rootTag = xhtmlFile.getDocument().getRootTag();
+
+    rootTag.getSubTags()[0].getNamespace();  // fill the cache
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        rootTag.setAttribute("xmlns", "http://www.ru");
+      }
+    });
+
+    assertEquals("http://www.ru", rootTag.getSubTags()[0].getNamespace());
+  }
+
+   public void testInsert() throws Exception {
+     String html = "<html><head /><body><hr /></body>\n</html>";
+     XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("xxx.xhtml", html);
+     XmlTag body = file.getDocument().getRootTag().findFirstSubTag("body");
+     final XmlTag hr = body.getSubTags()[0];
+
+     final XmlText text = XmlElementFactory.getInstance(getProject()).createDisplayText("p");
+     ApplicationManager.getApplication().runWriteAction(new Runnable() {
+       public void run() {
+         PsiElement element = hr.getParentTag().addAfter(text, hr);
+         assertEquals(element.getParent(), hr.getParentTag());
+       }
+     });
+   }
+
+  public void testCollapse() throws IncorrectOperationException {
+    final XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("<foo></foo>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        tag.collapseIfEmpty();
+        assertEquals("<foo/>", tag.getText());
+
+        final XmlTag tag1 = XmlElementFactory.getInstance(getProject()).createTagFromText("<foo>abc</foo>");
+        tag1.collapseIfEmpty();
+        assertEquals("<foo/>", tag1.getText());
+
+        final XmlTag tag2 = XmlElementFactory.getInstance(getProject()).createTagFromText("<foo><boo/></foo>");
+        tag2.collapseIfEmpty();
+        assertEquals("<foo><boo/></foo>", tag2.getText());
+      }
+    });
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlTagWriteTest.java b/xml/tests/src/com/intellij/codeInsight/XmlTagWriteTest.java
new file mode 100644
index 0000000..7728fe5
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlTagWriteTest.java
@@ -0,0 +1,61 @@
+package com.intellij.codeInsight;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlText;
+import com.intellij.testFramework.LightCodeInsightTestCase;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.xml.util.XmlUtil;
+
+/**
+ * @author lesya, dsl
+ */
+public class XmlTagWriteTest extends LightCodeInsightTestCase{
+  public void test1() throws IncorrectOperationException {
+    XmlElementFactory elementFactory = XmlElementFactory.getInstance(getProject());
+    final XmlTag xmlTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<tag1/>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        xmlTag.add(xmlTag.createChildTag("tag2", XmlUtil.EMPTY_URI, null, false));
+      }
+    });
+
+
+    assertEquals("<tag1><tag2/></tag1>", xmlTag.getText());
+    XmlTag createdFromText = elementFactory.createTagFromText(xmlTag.getText());
+    assertEquals("tag1", createdFromText.getName());
+    assertEquals(1, createdFromText.getSubTags().length);
+    assertEquals("tag2", createdFromText.getSubTags()[0].getName());
+  }
+
+  public void test2() throws IncorrectOperationException {
+    final XmlTag xmlTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<tag1></tag1>");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        xmlTag.add(xmlTag.createChildTag("tag2", XmlUtil.EMPTY_URI, null, false));
+      }
+    });
+
+
+    assertEquals("<tag1><tag2/></tag1>", xmlTag.getText());
+    XmlTag createdFromText = XmlElementFactory.getInstance(getProject()).createTagFromText(xmlTag.getText());
+    assertEquals("tag1", createdFromText.getName());
+    assertEquals(1, createdFromText.getSubTags().length);
+    assertEquals("tag2", createdFromText.getSubTags()[0].getName());
+  }
+
+  public void test3() throws Exception{
+    final XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("<b>\n0123456</b>");
+    final XmlText text = (XmlText) tag.getValue().getChildren()[0];
+    String textS = text.getText();
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        text.insertText("lala", 2);
+      }
+    });
+
+    XmlText text2 = (XmlText)tag.getValue().getChildren()[0];
+    assertEquals(textS.substring(0, 2) + "lala" + textS.substring(2), text2.getText());
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlTestUtil.java b/xml/tests/src/com/intellij/codeInsight/XmlTestUtil.java
new file mode 100644
index 0000000..75aa882
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlTestUtil.java
@@ -0,0 +1,22 @@
+package com.intellij.codeInsight;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiFileFactory;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import org.jetbrains.annotations.NonNls;
+
+public class XmlTestUtil {
+
+  public static XmlTag tag(@NonNls String tagName, Project project) throws Exception {
+    XmlFile file = (XmlFile)PsiFileFactory.getInstance(project).createFileFromText("tag.xml", "<" + tagName + "/>");
+    return file.getDocument().getRootTag();
+  }
+
+  public static XmlTag tag(@NonNls String tagName, @NonNls String namespace, Project project) throws Exception {
+    XmlFile file = (XmlFile)PsiFileFactory.getInstance(project)
+      .createFileFromText("tag.xml", "<" + tagName + " xmlns=\"" + namespace + "\"/>");
+    return file.getDocument().getRootTag();
+  }
+
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlTextTest.java b/xml/tests/src/com/intellij/codeInsight/XmlTextTest.java
new file mode 100644
index 0000000..55cdc25
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlTextTest.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
+ */
+
+package com.intellij.codeInsight;
+
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.psi.PsiFileFactory;
+import com.intellij.psi.XmlElementFactory;
+import com.intellij.psi.impl.source.codeStyle.CodeEditUtil;
+import com.intellij.psi.xml.XmlElement;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.psi.xml.XmlText;
+import com.intellij.testFramework.LightCodeInsightTestCase;
+
+/**
+ * @author mike
+ */
+public class XmlTextTest extends LightCodeInsightTestCase {
+  public void testInsertAtOffset() throws Exception {
+    new WriteCommandAction(getProject()) {
+
+      @Override
+      protected void run(final Result result) throws Throwable {
+        String xml = "<root>0123456789</root>";
+        XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject())
+          .createFileFromText("foo.xml", StdFileTypes.XML, xml, (long)1, true, false);
+        //System.out.println(DebugUtil.psiToString(file, false));
+        XmlTag root = file.getDocument().getRootTag();
+        final XmlText text1 = root.getValue().getTextElements()[0];
+
+        assertFalse(CodeEditUtil.isNodeGenerated(root.getNode()));
+        final XmlText text = text1;
+
+        final XmlElement element = text.insertAtOffset(XmlElementFactory.getInstance(getProject()).createTagFromText("<bar/>"), 5);
+        assertNotNull(element);
+        assertTrue(element instanceof XmlText);
+        assertEquals("01234", element.getText());
+        assertEquals("<root>01234<bar/>56789</root>", text.getContainingFile().getText());
+      }
+    }.execute();
+  }
+
+  public void testPhysicalToDisplayIfHasGaps2() throws Exception {
+    String xml = "<div>&amp;abc</div>";
+    XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("foo.xml", xml);
+    XmlTag root = file.getDocument().getRootTag();
+    final XmlText text = root.getValue().getTextElements()[0];
+
+    assertEquals("&abc", text.getValue());
+    assertEquals(0, text.physicalToDisplay(0));
+    assertEquals(1, text.physicalToDisplay(5));
+    assertEquals(2, text.physicalToDisplay(6));
+    assertEquals(3, text.physicalToDisplay(7));
+    assertEquals(4, text.physicalToDisplay(8));
+  }
+
+  public void testDisplayToPhysical() throws Exception {
+    String xml = "<div>&amp;abc</div>";
+    XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("foo.xml", xml);
+    XmlTag root = file.getDocument().getRootTag();
+    final XmlText text = root.getValue().getTextElements()[0];
+                                                              
+    assertEquals("&abc", text.getValue());
+    assertEquals(0, text.displayToPhysical(0));
+    assertEquals(5, text.displayToPhysical(1));
+    assertEquals(6, text.displayToPhysical(2));
+    assertEquals(7, text.displayToPhysical(3));
+    assertEquals(8, text.displayToPhysical(4));
+  }
+
+  public void testDisplayToPhysical2() throws Exception {
+    String xml = "<div><![CDATA[ ]]></div>";
+    XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("foo.xml", xml);
+    XmlTag root = file.getDocument().getRootTag();
+    final XmlText text = root.getValue().getTextElements()[0];
+
+    assertEquals(" ", text.getValue());
+    assertEquals(9, text.displayToPhysical(0));
+    assertEquals(13, text.displayToPhysical(1));
+  }
+
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlWrongClosingTagNameInspectionTest.java b/xml/tests/src/com/intellij/codeInsight/XmlWrongClosingTagNameInspectionTest.java
new file mode 100644
index 0000000..f36fa46
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlWrongClosingTagNameInspectionTest.java
@@ -0,0 +1,25 @@
+package com.intellij.codeInsight;
+
+import com.intellij.codeInsight.daemon.quickFix.LightQuickFixTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.File;
+
+/**
+ * @author spleaner
+ */
+public class XmlWrongClosingTagNameInspectionTest extends LightQuickFixTestCase {
+  public void test() throws Exception { doAllTests(); }
+
+  @Override
+  protected String getBasePath() {
+    return "/wrongClosingTagName";
+  }
+
+  @NotNull
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/inspections";
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlXIncludeTest.groovy b/xml/tests/src/com/intellij/codeInsight/XmlXIncludeTest.groovy
new file mode 100644
index 0000000..161eda9
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/XmlXIncludeTest.groovy
@@ -0,0 +1,99 @@
+package com.intellij.codeInsight;
+
+
+import com.intellij.openapi.fileEditor.FileDocumentManager
+import com.intellij.openapi.util.text.StringUtil
+import com.intellij.psi.PsiDocumentManager
+import com.intellij.psi.xml.XmlFile
+import com.intellij.psi.xml.XmlTag
+import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
+import com.intellij.openapi.vfs.VirtualFile
+import com.intellij.openapi.application.WriteAction
+
+/**
+ * @author mike
+ */
+public class XmlXIncludeTest extends LightCodeInsightFixtureTestCase {
+  private static final String BASE_PATH = "/psi/xi";
+
+  public void testBasicXi() throws Exception {
+    configure();
+    assertSubtagNames("before", "include1", "after");
+  }
+
+  public void testXpointerXi1() throws Exception {
+    configure();
+    assertSubtagNames("before", "foo", "bar", "after");
+  }
+
+  @Override
+  protected String getBasePath() {
+    return "/xml/tests/testData/" + BASE_PATH;
+  }
+
+  private void assertSubtagNames(String... expectedNames) {
+    final XmlTag tag = ((XmlFile)myFixture.file).document.rootTag
+    final List<String> names = tag.getSubTags().collect { it.name }
+
+    assertEquals(
+      "subtags are different",
+      StringUtil.join(expectedNames, "\n"), StringUtil.join(names, "\n")
+    );
+  }
+
+  private void configure() throws Exception {
+    myFixture.configureByFiles(getName() + ".xml", "/include1.xml");
+  }
+
+  public void testModifyingIncludedFile() {
+    myFixture.configureByText 'a.xml', '''
+<root xmlns:xi="http://www.w3.org/2001/XInclude">
+  <before/>
+  <xi:include href="include1.xml" xpointer="xpointer(/include1/*)"/>
+  <after/>
+</root>
+'''
+    def inc1 = myFixture.copyFileToProject("include1.xml")
+    assertSubtagNames("before", "foo", "bar", "after")
+
+    changeText inc1, '<include1><a/></include1>'
+    
+    assertSubtagNames("before", "a", "after")
+  }
+
+  public void testModifyingTransitivelyIncludedFile() {
+    myFixture.configureByText 'a.xml', '''
+<root xmlns:xi="http://www.w3.org/2001/XInclude">
+  <before/>
+  <xi:include href="include1.xml" xpointer="xpointer(/include1/*)"/>
+  <after/>
+</root>
+'''
+    myFixture.addFileToProject("include1.xml", """
+<include1 xmlns:xi="http://www.w3.org/2001/XInclude">
+  <foo attr1="val1"> <fooChild/> </foo>
+  <bar/>
+  <xi:include href="include2.xml""/>
+</include1>
+""")
+    def inc2 = myFixture.addFileToProject("include2.xml", '<a/>')
+
+    assertSubtagNames("before", "foo", "bar", "a", "after")
+
+    changeText inc2.virtualFile, '<b/>'
+
+    assertSubtagNames("before", "foo", "bar", "b", "after")
+
+  }
+
+  private changeText(VirtualFile inc1, String s) {
+    def token = WriteAction.start()
+    try {
+      FileDocumentManager.instance.getDocument(inc1).setText s
+      PsiDocumentManager.getInstance(project).commitAllDocuments()
+    }
+    finally {
+      token.finish()
+    }
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/completion/XmlCompletionTest.java b/xml/tests/src/com/intellij/codeInsight/completion/XmlCompletionTest.java
new file mode 100644
index 0000000..999dd03
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/completion/XmlCompletionTest.java
@@ -0,0 +1,618 @@
+package com.intellij.codeInsight.completion;
+
+import com.intellij.codeInsight.CodeInsightSettings;
+import com.intellij.codeInsight.completion.impl.CamelHumpMatcher;
+import com.intellij.codeInsight.lookup.Lookup;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupManager;
+import com.intellij.codeInsight.lookup.impl.LookupImpl;
+import com.intellij.codeInsight.template.TemplateManager;
+import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
+import com.intellij.javaee.ExternalResourceManager;
+import com.intellij.javaee.ExternalResourceManagerEx;
+import com.intellij.javaee.ExternalResourceManagerImpl;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.statistics.StatisticsManager;
+import com.intellij.psi.statistics.impl.StatisticsManagerImpl;
+import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
+import com.intellij.xml.util.XmlUtil;
+
+/**
+ * @by Maxim.Mossienko
+ */
+public class XmlCompletionTest extends LightCodeInsightFixtureTestCase {
+
+  private String myOldDoctype;
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+
+    addResource("http://www.springframework.org/schema/beans",
+                getTestDataPath() + "/spring-beans-2.0.xsd");
+    final ExternalResourceManagerEx manager = ExternalResourceManagerEx.getInstanceEx();
+    myOldDoctype = manager.getDefaultHtmlDoctype(getProject());
+    manager.setDefaultHtmlDoctype(XmlUtil.XHTML_URI, getProject());
+    CamelHumpMatcher.forceStartMatching(getTestRootDisposable());
+  }
+
+  @Override
+  protected void tearDown() throws Exception {
+    ExternalResourceManagerEx.getInstanceEx().setDefaultHtmlDoctype(myOldDoctype, getProject());
+    super.tearDown();
+  }
+
+  @Override
+  protected String getBasePath() {
+    return "/xml/tests/testData/completion/";
+  }
+
+  private void addResource(final String url, final String location) {
+    final ExternalResourceManager manager = ExternalResourceManager.getInstance();
+    final String old = manager.getResourceLocation(url, (String)null);
+    if (old != null &&
+        old != url //strange hack: ERM returns url as location sometimes
+      ) {
+      return;
+    }
+
+    ExternalResourceManagerImpl.addTestResource(url, location, myTestRootDisposable);
+  }
+
+  @Override
+  protected void runTest() throws Throwable {
+    new WriteCommandAction(getProject()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        XmlCompletionTest.super.runTest();
+      }
+    }.execute();
+  }
+
+  public void testCompleteWithAnyInSchema() throws Exception {
+    String location = "29.xsd";
+    addResource("aaa",location);
+
+    configureByFiles("29.xml", location);
+    complete();
+    checkResultByFile("29_after.xml");
+  }
+
+  private void checkResultByFile(String s) {
+    myFixture.checkResultByFile(s);
+  }
+
+  private void complete() {
+    myFixture.completeBasic();
+  }
+
+  private void configureByFiles(String... files) {
+    myFixture.configureByFiles(files);
+  }
+
+  public void testCompleteWithAnyInSchema2() throws Exception {
+    configureByFiles("32.xml", "32.xsd", "32_2.xsd");
+    complete();
+    checkResultByFile("/32_after.xml");
+
+    configureByFiles("32_2.xml", "32.xsd", "32_2.xsd");
+    complete();
+    checkResultByFile("32_2_after.xml");
+  }
+
+  public void testCompleteWithAnyInSchema3() throws Exception {
+    addResource("http://www.springframework.org/schema/tx",
+                getTestDataPath() + "/spring-tx-2.0.xsd");
+    addResource("http://www.springframework.org/schema/util",
+                getTestDataPath() + "/spring-util-2.0.xsd");
+
+    configureByFiles("36.xml");
+    complete();
+    checkResultByFile("36_after.xml");
+
+    configureByFiles("36_2.xml");
+    complete();
+    checkResultByFile("36_2_after.xml");
+
+    configureByFiles("36_3.xml");
+    complete();
+    myFixture.type('\n');
+    checkResultByFile("36_3_after.xml");
+  }
+
+  public void testXmlNonQualifiedElementCompletion() throws Exception {
+    String location = "25.xsd";
+    String url = "http://www.dummy-temp-address";
+    addResource(url,location);
+
+    configureByFiles("25.xml",
+                     location);
+    complete();
+    checkResultByFile("25_after.xml");
+  }
+
+  public void testXmlCompletion() throws Exception {
+    String location = "xslt.xsd";
+    String location2 = "xhtml1-strict.xsd";
+
+    String url = "http://www.w3.org/1999/XSL/Transform";
+    addResource(url, location);
+    String url2 = "http://www.w3.org/1999/xhtml";
+    addResource(url2, location2);
+
+    configureByFiles("10.xml",
+                     location,
+                     location2);
+    complete();
+    checkResultByFile("/10_after.xml");
+
+    configureByFiles("11.xml",
+                     location,
+                     location2);
+    complete();
+    checkResultByFile("/11_after.xml");
+  }
+
+  public void testXmlCompletionWhenTagsWithSemicolon() throws Exception {
+    configureByFiles("XmlCompletionWhenTagsWithSemicolon.xml", "XmlCompletionWhenTagsWithSemicolon.dtd");
+    complete();
+    checkResultByFile("XmlCompletionWhenTagsWithSemicolon_after.xml");
+  }
+
+  public void testCompleteTagWithXsiTypeInParent() throws Exception {
+    final String testName = getTestName(false);
+    String url = "urn:test";
+    doCompletionTest("xml", url, testName + ".xsd");
+  }
+
+  public void testAttributesTemplateFinishWithSpace() throws Throwable {
+    ((TemplateManagerImpl)TemplateManager.getInstance(getProject())).setTemplateTesting(true);
+    try {
+      configureByFile(getTestName(false) + ".xml");
+      type('b');
+      type('e');
+      type('a');
+      type('n');
+      type(' ');
+      checkResultByFile(getTestName(false) + "_after.xml");
+    }
+    finally {
+      ((TemplateManagerImpl)TemplateManager.getInstance(getProject())).setTemplateTesting(false);
+    }
+  }
+
+  private void configureByFile(String s) {
+    myFixture.configureByFile(s);
+    myFixture.completeBasic();
+  }
+
+  public void testNoAttributesTemplateFinishWithSpace() throws Throwable {
+    ((TemplateManagerImpl)TemplateManager.getInstance(getProject())).setTemplateTesting(true);
+    try {
+      configureByFile(getTestName(false) + ".xml");
+      type('d');
+      type('e');
+      type(' ');
+      checkResultByFile(getTestName(false) + "_after.xml");
+    }
+    finally {
+      ((TemplateManagerImpl)TemplateManager.getInstance(getProject())).setTemplateTesting(false);
+    }
+  }
+
+  private void type(char c) {
+    myFixture.type(c);
+  }
+
+  private void doCompletionTest(final String ext, final String url, final String location) throws Exception {
+    final String testName = getTestName(false);
+    addResource(url, location);
+
+    configureByFiles(testName + "." + ext,
+                     location);
+    complete();
+    checkResultByFile(testName + "_after." + ext);
+  }
+
+  public void testSingleCompletionVariantAtRootTag() throws Exception {
+    addResource("http://www.springframework.org/dtd/spring-beans.dtd", getTestDataPath() + "/spring-beans-2.0.dtd");
+
+    basicDoTest("");
+  }
+
+  public void testDtdCompletion() throws Exception {
+    final String baseTestFileName = getTestName(false);
+    configureByFile(baseTestFileName + ".dtd");
+    selectItem(myFixture.getLookupElements()[0], (char)0);
+    checkResultByFile(baseTestFileName + "_after.dtd");
+
+    configureByFile(baseTestFileName + "2.dtd");
+    checkResultByFile(baseTestFileName + "2_after.dtd");
+
+    configureByFile(baseTestFileName + "3.dtd");
+    checkResultByFile(baseTestFileName + "3_after.dtd");
+
+    configureByFile(baseTestFileName + "4.dtd");
+    checkResultByFile(baseTestFileName + "4_after.dtd");
+
+    configureByFile(baseTestFileName + "5.dtd");
+    checkResultByFile(baseTestFileName + "5_after.dtd");
+  }
+
+  public void testSchemaEnumerationCompletion() throws Exception {
+    addResource("http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd", getTestDataPath() + "/web-app_2_4.xsd");
+    configureByFile("12.xml");
+    complete();
+    checkResultByFile("12_after.xml");
+
+    configureByFile("12_3.xml");
+    complete();
+    checkResultByFile("12_3_after.xml");
+
+    configureByFiles("12_4.xml", "12_4_sample.xsd", "12_4_included-sample.xsd");
+    complete();
+    checkResultByFile("12_4_after.xml");
+  }
+
+  public void testEntityRefCompletion() throws Exception {
+    configureByFile("13.xml");
+    checkResultByFile("13_after.xml");
+  }
+
+  public void testEntityRefCompletion_2() throws Exception {
+    configureByFile("13_2.xml");
+    checkResultByFile("13_2_after.xml");
+  }
+
+  public void testEntityRefCompletion2() throws Exception {
+    configureByFiles("28.xml", "28.ent");
+    complete();
+    type('\n');
+    checkResultByFile("28_after.xml");
+  }
+
+  public void testEntityRefCompletion3() throws Exception {
+    configureByFile("13_3.xml");
+    checkResultByFile("13_3_after.xml");
+  }
+
+  public void testElementRefCompletionInSchema() throws Exception {
+    boolean old = CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CODE_COMPLETION;
+    CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CODE_COMPLETION = false;
+    try {
+      configureByFile("27.xsd");
+      selectItem(myFixture.getLookupElements()[0], '\'');
+      checkResultByFile("27_after.xsd");
+    }
+    finally {
+      CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CODE_COMPLETION = old;
+    }
+  }
+
+  public void testFilePathCompletionInSystem() throws Exception {
+    configureByFile("14.xml");
+    checkResultByFile("14_after.xml");
+  }
+
+  public void testFilePathCompletionInSchema() throws Exception {
+    configureByFile("15.xml");
+    checkResultByFile("15_after.xml");
+  }
+
+  public void testUrlCompletionInSchema() throws Exception {
+    String url = "http://www.w3.org/1999/xhtml";
+    String location = "xhtml1-strict.xsd";
+    addResource(url,location);
+
+    configureByFile("16.xml");
+    assertNullOrEmpty(myFixture.getLookupElementStrings());
+    checkResultByFile("16_after.xml");
+
+    configureByFile("17.xml");
+    assertNullOrEmpty(myFixture.getLookupElementStrings());
+    checkResultByFile("17_after.xml");
+
+    configureByFile("31.xml");
+    assertNullOrEmpty(myFixture.getLookupElementStrings());
+    checkResultByFile("31_after.xml");
+  }
+
+  public void testInsertExtraRequiredAttribute() throws Exception {
+    configureByFile("37.xml");
+    selectItem(myFixture.getLookupElements()[0], '\t');
+    checkResultByFile("37_after.xml");
+  }
+
+  public void testBeforeAttributeValue() throws Throwable {
+    configureByFile(getTestName(true) + ".xml");
+    assertEmpty(myFixture.getLookupElements());
+    checkResultByFile(getTestName(true) + ".xml");
+  }
+
+  public void testUrlCompletionInDtd() throws Exception {
+    configureByFile("20.xml");
+    final PsiReference referenceAt = myFixture.getFile().findReferenceAt(myFixture.getEditor().getCaretModel().getOffset() - 1);
+    assertNotNull(referenceAt);
+    assertTrue(referenceAt.getVariants().length > 0);
+  }
+
+  public void testElementFromSchemaIncludeCompletion() throws Exception {
+    String location = "21.xsd";
+    String location2 = "21_2.xsd";
+
+    addResource(location, location);
+    addResource(location2, location2);
+    configureByFiles("21.xml",
+                     location,
+                     location2);
+    complete();
+    checkResultByFile("21_after.xml");
+  }
+
+  public void testSchemaTypeReferenceCompletion() throws Exception {
+    configureByFile("22.xsd");
+    checkResultByFile("22_after.xsd");
+  }
+
+  public void testSchemaTypeReferenceCompletion2() throws Exception {
+    configureByFile("23.xsd");
+    checkResultByFile("23_after.xsd");
+  }
+
+  public void testSchemaTypeReferenceCompletion3() throws Exception {
+    configureByFile("34.xsd");
+    checkResultByFile("34_after.xsd");
+  }
+
+  public void testSchemaTypeReferenceCompletion4() throws Exception {
+    configureByFile("35.xsd");
+    checkResultByFile("35_after.xsd");
+  }
+
+  public void testSchemaNonAllowedElementCompletion() throws Exception {
+    configureByFiles("33.xml",
+                     "33.xsd",
+                     "33_2.xsd");
+    complete();
+    checkResultByFile("33_after.xml");
+
+    configureByFiles("33_2.xml",
+                     "33.xsd",
+                     "33_2.xsd");
+    complete();
+    checkResultByFile("33_2_after.xml");
+  }
+
+  public void testSchemaBooleanCompletion() throws Exception {
+    configureByFile("SchemaBooleanCompletion.xsd");
+    checkResultByFile("SchemaBooleanCompletion_after.xsd");
+  }
+
+  public void testXIncludeCompletion() throws Exception {
+    configureByFile("XIncludeCompletion.xsd");
+    checkResultByFile("XIncludeCompletion_after.xsd");
+  }
+
+  public void testCorrectPrefixInsertion() throws Exception {
+    configureByFile("CorrectPrefixInsertion.xml");
+    checkResultByFile("CorrectPrefixInsertion_after.xml");
+  }
+
+  public void testDoNotSuggestAbstractElementsFromSchema() throws Exception {
+    basicDoTest("");
+  }
+
+  private void basicDoTest(String ext) throws Exception {
+    final String testName = getTestName(false) + ext;
+    configureByFile(testName + ".xml");
+    checkResultByFile(testName + "_after.xml");
+  }
+
+  public void testDoNotSuggestTagsFromOtherNsInXslt() throws Exception {
+    basicDoTest("");
+  }
+
+  public void testDoNotSuggestTagsFromOtherNsInXslt_2() throws Exception {
+    final String testName = getTestName(false);
+    configureByFile(testName + ".xml");
+    myFixture.type('\n');
+    checkResultByFile(testName + "_after.xml");
+  }
+  
+  public void testDoNotSuggestTagsFromOtherNsInXslt_3() throws Exception {
+    final String testName = getTestName(false);
+    configureByFile(testName + ".xml");
+    myFixture.type('\n');
+    checkResultByFile(testName + "_after.xml");
+  }
+
+  public void testDoNotSuggestTagsInXHtml() throws Exception {
+    basicDoTest("");
+  }
+
+  public void testSuggestTagsInXHtml() throws Exception {
+    basicDoTest("");
+    basicDoTest("_2");
+  }
+
+  public void testCompleteWithSubstitutionGroup() throws Exception {
+    configureByFiles(getTestName(false) + ".xml", "mule.xsd", "mule-management.xsd");
+    complete();
+    myFixture.type('\n');
+    checkResultByFile(getTestName(false) + "_after.xml");
+  }
+
+  public void testCorrectSelectionInsertion() throws Exception {
+    ((StatisticsManagerImpl)StatisticsManager.getInstance()).enableStatistics(getTestRootDisposable());
+    addResource("http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd",
+                getTestDataPath() + "/hibernate-mapping-3.0.dtd");
+
+    configureByFile("CorrectSelectionInsertion.xml");
+    selectItem(myFixture.getLookupElements()[4], '\t');
+    checkResultByFile("CorrectSelectionInsertion_after.xml");
+    
+    CompletionLookupArranger.applyLastCompletionStatisticsUpdate();
+
+    configureByFile("CorrectSelectionInsertion2.xml");
+    myFixture.getEditor().getSelectionModel().removeSelection();
+    selectItem(myFixture.getLookupElements()[0], '\t');
+    checkResultByFile("CorrectSelectionInsertion2_after.xml");
+  }
+
+  public void testCasePreference() throws Exception {
+    final int old = CodeInsightSettings.getInstance().COMPLETION_CASE_SENSITIVE;
+    CodeInsightSettings.getInstance().COMPLETION_CASE_SENSITIVE = CodeInsightSettings.NONE;
+
+    String location = "30.dtd";
+    try {
+
+      addResource(location, location);
+      configureByFiles("30.xml",
+                       location);
+      complete();
+
+      assertOrderedEquals(myFixture.getLookupElementStrings(), "map", "Map");
+    }
+    finally {
+      CodeInsightSettings.getInstance().COMPLETION_CASE_SENSITIVE = old;
+    }
+  }
+
+  public void testCompleteXmlLang() throws Exception {
+    basicDoTest("");
+    basicDoTest("_2");
+  }
+
+  public void testCompleteWhenNoNsSchemaLocation() throws Exception {
+    boolean old = CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CODE_COMPLETION;
+    CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CODE_COMPLETION = false;
+    try {
+      final String testName = getTestName(false);
+
+      configureByFiles(testName + ".xml",
+                       testName + ".xsd");
+      complete();
+      selectItem(myFixture.getLookupElements()[0], '\"');
+      checkResultByFile(testName + "_after.xml");
+    }
+    finally {
+      CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CODE_COMPLETION = old;
+    }
+  }
+
+  public void testCompleteWhenUnqualifiedElements() throws Exception {
+    final String testName = getTestName(false);
+
+    configureByFiles(testName + ".xml",
+                     testName + ".xsd");
+    complete();
+    checkResultByFile(testName + "_after.xml");
+  }
+
+  public void _testIDEADEV_32773() throws Exception {
+    final String testName = getTestName(false);
+
+    configureByFiles(testName + ".xml",
+                     testName + ".xsd",
+                     testName + "-vm.xsd",
+                     testName + "-jms.xsd",
+                     testName + "-stdio.xsd",
+                     testName + "-schemadoc.xsd");
+    complete();
+    checkResultByFile(testName + "_after.xml");
+  }
+
+  public void testCompleteEnumeration() throws Exception {
+    final String testName = getTestName(false);
+
+    configureByFiles(testName + ".xml",
+                     testName + "_importedSchema.xsd",
+                     testName + "_outerSchema.xsd");
+    complete();
+    checkResultByFile(testName + "_after.xml");
+  }
+
+  public void testAttributeNameInAttributeValue() throws Throwable {
+    configureByFile(getTestName(false) + ".xml");
+    complete();
+    assertEmpty(myFixture.getLookupElements());
+    checkResultByFile(getTestName(false) + "_after.xml");
+  }
+
+  public void testNoFixedAttrComplete() throws Exception {
+    basicDoTest("");
+  }
+
+  public void testCompleteWords() throws Exception {
+    myFixture.addClass("public class ABxxZ {}");
+
+    final String testName = getTestName(false);
+    myFixture.configureByFile(testName + ".xml");
+    myFixture.complete(CompletionType.BASIC, 2);
+    assertEquals("ABxxZ", myFixture.getLookupElements()[0].getLookupString());
+    assertEquals("ABxxCDEF", myFixture.getLookupElements()[1].getLookupString());
+    selectItem(myFixture.getLookupElements()[1], Lookup.NORMAL_SELECT_CHAR);
+    checkResultByFile(testName + "_after.xml");
+  }
+
+  public void testClassNamesOutrankWords() throws Exception {
+    myFixture.addClass("package foo; public class SomeClass {}");
+
+    final String testName = getTestName(false);
+    myFixture.configureByFile(testName + ".xml");
+    myFixture.complete(CompletionType.BASIC, 2);
+    selectItem(assertOneElement(myFixture.getLookupElements()), Lookup.NORMAL_SELECT_CHAR);
+    checkResultByFile(testName + "_after.xml");
+  }
+
+  public void testColonInTagName() throws Throwable {
+    configureByFile(getTestName(false) + ".xml");
+    type('f');
+    type('o');
+    type('o');
+    type(':');
+    assertNotNull(LookupManager.getActiveLookup(myFixture.getEditor()));
+  }
+
+  public void testDoNotInsertClosingTagB4Text() throws Exception {
+    configureByFile("doNotInsertClosingTagB4Text.xml");
+    selectItem(myFixture.getLookupElements()[0], '>');
+    checkResultByFile("doNotInsertClosingTagB4Text_after.xml");
+  }
+
+  private void selectItem(LookupElement element, char ch) {
+    final LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(myFixture.getEditor());
+    lookup.setCurrentItem(element);
+    lookup.finishLookup(ch);
+  }
+
+  public void testDoNotInsertClosingTagWithoutTagName() throws Exception {
+    configureByFile("doNotInsertClosingTagWithoutTagName.xml");
+    type('>');
+    //assertNotNull(myItems);
+    //selectItem(myItems[0], '>');
+    checkResultByFile("doNotInsertClosingTagWithoutTagName_after.xml");
+  }
+
+  public void testCompleteXmlTag() throws Exception {
+    addResource("http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd", getTestDataPath() + "archetype-descriptor-1.0.0.xsd");
+    basicDoTest("");
+  }
+
+  public void testCompleteXsl() throws Exception {
+    basicDoTest("");
+  }
+
+  public void testAttributeWildcardFromAnotherNamespace() throws Exception {
+    configureByFiles("foo.xsd", "bar.xsd");
+    basicDoTest("");
+  }
+
+  public void testCompleteQualifiedTopLevelTags() throws Exception {
+    configureByFiles("foo.xsd", "bar.xsd");
+    basicDoTest("");
+  }
+}
+
diff --git a/xml/tests/src/com/intellij/codeInsight/completion/XmlSmartEnterTest.java b/xml/tests/src/com/intellij/codeInsight/completion/XmlSmartEnterTest.java
new file mode 100644
index 0000000..0ec36a3
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/completion/XmlSmartEnterTest.java
@@ -0,0 +1,140 @@
+package com.intellij.codeInsight.completion;
+
+import com.intellij.codeInsight.CodeInsightSettings;
+import com.intellij.codeInsight.lookup.Lookup;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.codeInsight.lookup.LookupEvent;
+import com.intellij.codeInsight.lookup.LookupManager;
+import com.intellij.codeInsight.lookup.impl.LookupImpl;
+import com.intellij.codeInsight.lookup.impl.LookupManagerImpl;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.testFramework.LightCodeInsightTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.File;
+
+/**
+ * @author spleaner
+ */
+@SuppressWarnings({"ALL"})
+public class XmlSmartEnterTest extends LightCodeInsightTestCase {
+  private static final String BASE_PATH = "/smartEnter";
+  private LookupElement[] myItems;
+
+  public void testSmartFinish1() throws Throwable {
+    doCompletionPopupTest(getTestName(false));
+  }
+
+  public void testSmartFinish2() throws Throwable {
+    boolean old = CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CODE_COMPLETION;
+    CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CODE_COMPLETION = false;
+    try {
+      doCompletionPopupTest(getTestName(false));
+    }
+    finally {
+      CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CODE_COMPLETION = old;
+    }
+  }
+
+  public void testSmartFinish3() throws Exception {
+    doSmartEnterTest("SmartFinish1");
+  }
+
+  public void testSmartFinish4() throws Exception {
+    doSmartEnterTest("SmartFinish2");
+  }
+
+  public void testSmartFinish5() throws Exception {
+    doSmartEnterTest("SmartFinish3");
+  }
+
+  public void testSmartFinish_IDEADEV_29628() throws Exception {
+    doSmartEnterTest("IDEADEV_29628");
+  }
+
+  public void testSmartFinishWithWrongAttribute() throws Exception {
+    doSmartEnterTest("WrongAttribute");
+  }
+
+  public void testOpenAttribute() throws Exception {
+    doSmartEnterTest("OpenAttribute");
+  }
+
+  public void testComplete1() throws Exception {
+    _doTest("Tag.xml", "Tag_after.xml");
+  }
+
+  private void doCompletionPopupTest(String baseName) throws Exception {
+    _doTestCompletion(baseName + ".xml", baseName + "_after.xml");
+  }
+
+  public void testSmartCloseTag() throws Exception {
+    configureByFile(BASE_PATH + "/" + "CompleteMissingTag.xml");
+    performSmartEnterAction();
+    checkResultByFile("", BASE_PATH + "/" + "CompleteMissingTag_after_1.xml", true);
+    performSmartEnterAction();
+    checkResultByFile("", BASE_PATH + "/" + "CompleteMissingTag_after_2.xml", true);
+    performSmartEnterAction();
+    checkResultByFile("", BASE_PATH + "/" + "CompleteMissingTag_after_3.xml", true);
+    performSmartEnterAction();
+    checkResultByFile("", BASE_PATH + "/" + "CompleteMissingTag_after_4.xml", true);
+    performSmartEnterAction();
+    checkResultByFile("", BASE_PATH + "/" + "CompleteMissingTag_after_5.xml", true);
+  }
+
+  private void _doTestCompletion(final String name, final String after_name) throws Exception {
+    configureByFile(BASE_PATH + "/" + name);
+    performCompletionAction();
+    select(Lookup.COMPLETE_STATEMENT_SELECT_CHAR);
+    checkResultByFile(BASE_PATH + "/" + after_name);
+  }
+
+  private void doSmartEnterTest(String baseName) throws Exception {
+    _doTest(baseName + ".xml", baseName + "_after.xml");
+  }
+
+  private void _doTest(String filename, String filename_after) throws Exception {
+    configureByFile(BASE_PATH + "/" + filename);
+    performSmartEnterAction();
+    checkResultByFile("", BASE_PATH + "/" + filename_after, true);
+  }
+
+  private void performSmartEnterAction() {
+    new WriteCommandAction(getProject()) {
+      protected void run(final Result result) throws Throwable {
+        new XmlSmartEnterProcessor().process(getProject(), getEditor(), getFile());
+      }
+    }.execute();
+  }
+
+  private void performCompletionAction() {
+    new CodeCompletionHandlerBase(CompletionType.BASIC).invokeCompletion(getProject(), getEditor());
+    final LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(getEditor());
+    myItems = lookup == null ? null : lookup.getItems().toArray(LookupElement.EMPTY_ARRAY);
+  }
+
+  private void select(final char c) {
+    if (!LookupEvent.isSpecialCompletionChar(c)) {
+      type(c);
+      return;
+    }
+
+    final LookupManagerImpl manager = (LookupManagerImpl) LookupManager.getInstance(getProject());
+    final Lookup lookup = manager.getActiveLookup();
+    if(lookup != null) {
+      manager.forceSelection(c, lookup.getCurrentItem());
+    }
+  }
+
+  protected String getBasePath() {
+    return "";
+  }
+
+  @NotNull
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/daemon/XmlHighlightingTest.java b/xml/tests/src/com/intellij/codeInsight/daemon/XmlHighlightingTest.java
new file mode 100644
index 0000000..fa3797b
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/daemon/XmlHighlightingTest.java
@@ -0,0 +1,2070 @@
+package com.intellij.codeInsight.daemon;
+
+import com.intellij.application.options.XmlSettings;
+import com.intellij.codeInsight.completion.CodeCompletionHandlerBase;
+import com.intellij.codeInsight.completion.CompletionType;
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor;
+import com.intellij.codeInsight.daemon.impl.analysis.XmlPathReferenceInspection;
+import com.intellij.codeInsight.daemon.impl.analysis.XmlUnboundNsPrefixInspection;
+import com.intellij.codeInsight.daemon.impl.quickfix.AddXsiSchemaLocationForExtResourceAction;
+import com.intellij.codeInsight.lookup.LookupManager;
+import com.intellij.codeInspection.LocalInspectionTool;
+import com.intellij.codeInspection.htmlInspections.HtmlUnknownTagInspection;
+import com.intellij.codeInspection.htmlInspections.RequiredAttributesInspection;
+import com.intellij.codeInspection.htmlInspections.XmlWrongRootElementInspection;
+import com.intellij.ide.DataManager;
+import com.intellij.ide.highlighter.HighlighterFactory;
+import com.intellij.ide.highlighter.XmlHighlighterFactory;
+import com.intellij.javaee.ExternalResourceManagerEx;
+import com.intellij.javaee.ExternalResourceManagerImpl;
+import com.intellij.javaee.UriUtil;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.lang.ant.dom.AntResolveInspection;
+import com.intellij.openapi.actionSystem.ActionManager;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.IdeActions;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.EditorFactory;
+import com.intellij.openapi.editor.EditorModificationUtil;
+import com.intellij.openapi.editor.colors.EditorColorsManager;
+import com.intellij.openapi.editor.highlighter.EditorHighlighter;
+import com.intellij.openapi.editor.highlighter.HighlighterIterator;
+import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.pom.Navigatable;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.include.FileIncludeManager;
+import com.intellij.psi.search.PsiElementProcessor;
+import com.intellij.psi.xml.*;
+import com.intellij.testFramework.PlatformTestUtil;
+import com.intellij.util.Processor;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.xml.XmlBundle;
+import com.intellij.xml.util.*;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.reflect.Method;
+import java.util.*;
+
+@SuppressWarnings({"HardCodedStringLiteral", "ConstantConditions"})
+public class XmlHighlightingTest extends DaemonAnalyzerTestCase {
+  private static final String BASE_PATH = "/xml/";
+
+  private boolean myTestJustJaxpValidation;
+  @NonNls private static final String CREATE_NAMESPACE_DECLARATION_INTENTION_NAME = "Create Namespace Declaration";
+  private boolean old;
+  private String myOldDoctype;
+
+  private void doTest() throws Exception {
+    doTest(false);
+  }
+  private void doTest(boolean checkWarnings) throws Exception {
+    doTest(getFullRelativeTestName(), checkWarnings, false);
+  }
+
+  private String getFullRelativeTestName() {
+    return getFullRelativeTestName(".xml");
+  }
+
+  private String getFullRelativeTestName(String ext) {
+    return BASE_PATH + getTestName(false) + ext;
+  }
+
+  @NotNull
+  @Override
+  protected List<HighlightInfo> doHighlighting() {
+    if(myTestJustJaxpValidation) {
+      XmlHighlightVisitor.setDoJaxpTesting(true);
+    }
+
+    final List<HighlightInfo> highlightInfos = super.doHighlighting();
+    if(myTestJustJaxpValidation) {
+      XmlHighlightVisitor.setDoJaxpTesting(false);
+    }
+
+    return highlightInfos;
+  }
+
+  @Override
+  protected boolean forceExternalValidation() {
+    return myTestJustJaxpValidation;
+  }
+
+  public void testclosedTag1() throws Exception { doTest(); }
+  public void testClosedTag2() throws Exception { doTest(); }
+  public void testwrongRootTag1() throws Exception { doTest(); }
+  public void testrootTag1() throws Exception { doTest(); }
+  public void testManyRootTags() throws Exception { doTest(); }
+  public void testCommentBeforeProlog() throws Exception { doTest(); }
+  public void testCommentBeforeProlog_2() throws Exception { doTest(); }
+  //public void testNoRootTag() throws Exception { doTest(); }
+
+  public void testduplicateAttribute() throws Exception { doTest(); }
+
+  public void testduplicateAttribute2() throws Exception {
+    configureByFiles(null, BASE_PATH + getTestName(false) + ".xml", BASE_PATH + getTestName(false) + ".xsd");
+
+    final String url = "http://www.foo.org/schema";
+    final String url2 = "http://www.bar.org/foo";
+    ExternalResourceManagerImpl.registerResourceTemporarily(url, getTestName(false) + ".xsd", getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily(url2, getTestName(false) + ".xsd", getTestRootDisposable());
+    try {
+      final Collection<HighlightInfo> infoCollection = doDoTest(true, false, true);
+      final TextRange startTagNameRange = XmlTagUtil.getStartTagNameElement(((XmlFile)myFile).getDocument().getRootTag()).getTextRange();
+
+      HighlightInfo infoAtTagName = null;
+
+      for(HighlightInfo info:infoCollection) {
+        if (info.startOffset == startTagNameRange.getStartOffset() && info.endOffset == startTagNameRange.getEndOffset()) {
+          if (info.description.equals("Attribute \"foo\" bound to namespace \"http://www.w3.org/2000/xmlns/\" was already specified for element \"root\".")) {
+            infoAtTagName = info;
+            break;
+          }
+        }
+      }
+
+      assertNotNull( infoAtTagName );
+    }
+    finally {
+    }
+  }
+
+  // TODO: external validator should not be launched due to error detected after general highlighting pass!
+  @HighlightingFlags(HighlightingFlag.SkipExternalValidation)
+  public void testDuplicateIdAttribute() throws Exception { doTest(); }
+  public void testDuplicateIdAttribute2() throws Exception {
+    doTest();
+  }
+  public void testDuplicateNameAttribute() throws Exception {
+    doSchemaTestWithManyFilesFromSeparateDir(
+      new String[][] {
+        {"http://www.springframework.org/schema/beans/spring-beans-2.5.xsd", "spring-beans-2.5.xsd"},
+      },
+      null
+    );
+  }
+
+  @HighlightingFlags(HighlightingFlag.SkipExternalValidation)
+  public void testInvalidIdRefAttribute() throws Exception { doTest(); }
+  public void testEntityRefWithNoDtd() throws Exception { doTest(); }
+  public void testNoSpaceBeforeAttrAndNoCdataEnd() throws Exception { doTest(); }
+
+  // TODO: external validator should not be lauched due to error detected after general highlighting pass!
+  @HighlightingFlags(HighlightingFlag.SkipExternalValidation)
+  public void testEntityRefWithEmptyDtd() throws Exception { doTest(); }
+  public void testEmptyNSRef() throws Exception { doTest(); }
+
+  @HighlightingFlags(HighlightingFlag.SkipExternalValidation)
+  public void testDoctypeWithoutSchema() throws Exception {
+    final String baseName = BASE_PATH + getTestName(false);
+
+    configureByFiles(null, getVirtualFile(baseName + ".xml"), getVirtualFile(baseName + ".ent"));
+    doDoTest(true,false);
+    myFile.accept(new XmlRecursiveElementVisitor() {
+      @Override
+      public void visitXmlAttributeValue(XmlAttributeValue value) {
+        final PsiElement[] children = value.getChildren();
+        for (PsiElement child : children) {
+          if (child instanceof XmlEntityRef) {
+            PsiElement psiElement = child.getReferences()[0].resolve();
+            assertNotNull(psiElement);
+            assertEquals(getTestName(false) + ".ent", psiElement.getContainingFile().getVirtualFile().getName());
+            assertTrue(((Navigatable)psiElement).canNavigate());
+          }
+        }
+      }
+    });
+  }
+
+  public void testNavigateToDeclDefinedWithEntity() throws Exception {
+    final String baseName = BASE_PATH + getTestName(false);
+
+    configureByFiles(null, getVirtualFile(baseName + ".xml"), getVirtualFile(baseName + ".dtd"), getVirtualFile(baseName + ".ent"));
+    doDoTest(true,false);
+    final List<PsiReference> refs = new ArrayList<PsiReference>();
+    myFile.accept(new XmlRecursiveElementVisitor() {
+      @Override
+      public void visitXmlAttribute(final XmlAttribute attribute) {
+        refs.add(attribute.getReference());
+      }
+
+      @Override
+      public void visitXmlTag(final XmlTag tag) {
+        refs.add(tag.getReference());
+        super.visitXmlTag(tag);
+      }
+    });
+
+    assertEquals(2, refs.size());
+
+    for(PsiReference ref:refs) {
+      final PsiElement element = ref.resolve();
+      // In order to navigate to entity defined things we need correctly setup navigation element among other things
+      assertTrue(element instanceof PsiNamedElement);
+      assertSame(element.getNavigationElement(), element);
+      assertTrue(!element.isPhysical());
+
+      final PsiElement original = element.getOriginalElement();
+      // TODO: fix XmlAttlistDecl to return proper original element
+      if (original != element && !(element instanceof XmlAttlistDecl)) {
+        assertNotNull(original);
+        assertTrue(original.isPhysical());
+      }
+    }
+  }
+
+  public void testDoctypeWithoutSchema2() throws Exception {
+    final String baseName = BASE_PATH + "DoctypeWithoutSchema";
+
+    configureByFiles(null, getVirtualFile(baseName + ".xml"), getVirtualFile(baseName + ".ent"));
+    doDoTest(true, false);
+  }
+
+  public void testComplexSchemaValidation8() throws IOException {
+    final String testName = getTestName(false);
+    String location = testName +".xsd";
+    String location2 = testName +"_2.xsd";
+    String url = "http://drools.org/rules";
+    String url2 = "http://drools.org/semantics/groovy";
+
+    ExternalResourceManagerImpl.registerResourceTemporarily(url, location, getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily(url2, location2, getTestRootDisposable());
+    final String basePath = BASE_PATH + testName;
+    configureByFiles(null, getVirtualFile(basePath + ".xml"), getVirtualFile(basePath + ".xsd"), getVirtualFile(basePath + "_2.xsd"));
+    doDoTest(true,false);
+
+  }
+
+  public void testComplexSchemaValidation9() throws IOException {
+    final String basePath = BASE_PATH + getTestName(false);
+
+    configureByFiles(null, getVirtualFile(basePath + ".xml" ), getVirtualFile(basePath + ".xsd" ));
+    doDoTest(true,false);
+  }
+
+  public void testComplexSchemaValidation10() throws IOException {
+    final String testName = getTestName(false);
+
+    final String basePath = BASE_PATH + testName;
+    configureByFiles(null, getVirtualFile(basePath + ".xsd" ), getVirtualFile(basePath + "_2.xsd" ));
+    doDoTest(true,false);
+
+    final List<PsiReference> refs = new ArrayList<PsiReference>(2);
+
+    myFile.acceptChildren(new XmlRecursiveElementVisitor() {
+
+      @Override public void visitXmlTag(XmlTag tag) {
+        super.visitXmlTag(tag);
+
+        addRefsInPresent(tag, "base", refs);
+        if ("group".equals(tag.getLocalName())) {
+          addRefsInPresent(tag, "ref", refs);
+        }
+      }
+    });
+
+    assertEquals(2, refs.size());
+    PsiElement psiElement = refs.get(0).resolve();
+    assertNotNull(psiElement);
+    assertEquals(getTestName(false) + "_2.xsd",psiElement.getContainingFile().getName());
+
+    psiElement = refs.get(1).resolve();
+    assertNotNull(psiElement);
+    assertEquals(getTestName(false) + "_2.xsd",psiElement.getContainingFile().getName());
+  }
+
+  private static void addRefsInPresent(final XmlTag tag, final String name, final List<PsiReference> refs) {
+    if (tag.getAttributeValue(name) != null) {
+      ContainerUtil.addAll(refs, tag.getAttribute(name, null).getValueElement().getReferences());
+    }
+  }
+
+  public void testComplexSchemaValidation11() throws Exception {
+    final String testName = getTestName(false);
+    doTestWithLocations(
+      new String[][] {
+        {"http://www.springframework.org/schema/beans",testName + ".xsd"},
+        {"http://www.springframework.org/schema/util",testName + "_2.xsd"}
+      },
+      "xml"
+    );
+  }
+
+  private void doTestWithLocations(@Nullable String[][] resources, String ext) throws Exception {
+    try {
+      doConfigureWithLocations(resources, ext);
+      doDoTest(true,false);
+    } finally {
+      unregisterResources(resources);
+    }
+  }
+
+  private static void unregisterResources(final String[][] resources) {
+    if (resources == null) return;
+  }
+
+  private void doConfigureWithLocations(final String[][] resources, final String ext) throws Exception {
+
+    String[] testNames = new String[(resources != null? resources.length:0) + 1];
+    testNames[0] = BASE_PATH + getTestName(false) + "." + ext;
+
+    if (resources != null) {
+      int curResource = 0;
+      for(String[] resource:resources) {
+        ExternalResourceManagerImpl
+            .registerResourceTemporarily(resource[0], getTestDataPath() + BASE_PATH + resource[1], getTestRootDisposable());
+        testNames[++curResource] = BASE_PATH + resource[1];
+      }
+    }
+
+    configureByFiles(
+      null,
+      testNames
+    );
+  }
+
+  public void testComplexSchemaValidation12() throws Exception {
+    final String basePath = BASE_PATH + getTestName(false);
+    configureByFile(
+      basePath + ".xsd",
+      null
+    );
+    doDoTest(true,false);
+  }
+
+  public void testInvalidIdRefInXsl() throws Exception {
+    doTest(getFullRelativeTestName(), false, false);
+  }
+
+  public void testXercesMessageOnPI() throws Exception {
+    try {
+      myTestJustJaxpValidation = true;
+      doTest();
+    } finally {
+      myTestJustJaxpValidation = false;
+    }
+  }
+  public void testXercesMessageOnDtd() throws Exception { doTest(); }
+  public void testXercesMessagesBinding5() throws Exception {
+    try {
+      myTestJustJaxpValidation = true;
+      doTest();
+    } finally {
+      myTestJustJaxpValidation = false;
+    }
+  }
+
+  public void testXercesCachingProblem() throws Exception {
+    final String[][] resources = {{"http://www.test.com/test", getTestName(false) + ".dtd"}};
+    doConfigureWithLocations(resources, "xml");
+
+    try {
+      doDoTest(true,true);
+      ApplicationManager.getApplication().runWriteAction(new Runnable() {
+        public void run() {
+          myEditor.getDocument().insertString(myEditor.getDocument().getCharsSequence().toString().indexOf("?>") + 2, "\n");
+        }
+      });
+
+      doDoTest(true,true);
+    }
+    finally {
+      unregisterResources(resources);
+    }
+  }
+
+  public void testComplexSchemaValidation13() throws Exception {
+    doTestWithLocations(new String[][] { {"urn:test", getTestName(false) + "_2.xsd"} }, "xsd");
+  }
+
+  public void testComplexSchemaValidation14() throws Exception {
+    doTestWithLocations(new String[][]{{"parent", getTestName(false) + ".xsd"}}, "xml");
+  }
+
+  public void testComplexSchemaValidation14_2() throws Exception {
+    doTest(getFullRelativeTestName(".xsd"), true, false);
+  }
+
+  public void testComplexSchemaValidation15() throws Exception {
+    doTestWithLocations(
+      new String[][] {
+        {"http://www.linkedin.com/lispring", getTestName(false) + ".xsd"},
+        {"http://www.springframework.org/schema/beans", getTestName(false) + "_2.xsd"}
+      },
+      "xml"
+    );
+  }
+
+  @HighlightingFlags(HighlightingFlag.SkipExternalValidation)
+  public void testComplexSchemaValidation16() throws Exception {
+    doTestWithLocations(
+      new String[][] {
+        {"http://www.inversoft.com/schemas/savant-2.0/project", getTestName(false) + ".xsd"},
+        {"http://www.inversoft.com/schemas/savant-2.0/base", getTestName(false) + "_2.xsd"}
+      },
+      "xml"
+    );
+  }
+
+  public void testComplexSchemaValidation17() throws Exception {
+    doTestWithLocations(
+      new String[][]{
+        {"urn:test", getTestName(false) + ".xsd"}
+      },
+      "xml"
+    );
+  }
+
+  public void testSchemaReferencesValidation() throws Exception {
+    doTest(getFullRelativeTestName(".xsd"), false, false);
+  }
+
+  public void testXhtmlSchemaHighlighting() throws Exception {
+    disableHtmlSupport();
+    try {
+      configureByFiles(null, getVirtualFile(BASE_PATH + "xhtml1-transitional.xsd"), getVirtualFile(BASE_PATH + "xhtml-special.ent"),
+                       getVirtualFile(BASE_PATH + "xhtml-symbol.ent"), getVirtualFile(BASE_PATH + "xhtml-lat1.ent"));
+      doDoTest(true,false);
+    }
+    finally {
+      enableHtmlSupport();
+    }
+  }
+
+  public void testSchemaValidation() throws Exception {
+    doTest();
+  }
+
+  public void testSchemaValidation2() throws Exception {
+    configureByFiles(null, getVirtualFile(BASE_PATH + getTestName(false)+".xml"), getVirtualFile(BASE_PATH + getTestName(false)+".xsd"));
+    doDoTest(true,false);
+
+    final XmlTag rootTag = ((XmlFile)myFile).getDocument().getRootTag();
+    final XmlAttributeValue valueElement = rootTag.getAttribute("noNamespaceSchemaLocation", XmlUtil.XML_SCHEMA_INSTANCE_URI).getValueElement();
+    final PsiReference[] references = valueElement.getReferences();
+
+    final String expectedFileName = getTestName(false) + ".xsd";
+
+    assertEquals(1, references.length);
+    final PsiElement schema = references[0].resolve();
+    assertNotNull(schema);
+
+    assertEquals(expectedFileName,schema.getContainingFile().getName());
+
+    final PsiReference referenceAt = myFile.findReferenceAt(myEditor.getCaretModel().getOffset());
+    assertNotNull(referenceAt);
+    final PsiElement psiElement = referenceAt.resolve();
+    assertTrue(psiElement instanceof XmlTag &&
+               "complexType".equals(((XmlTag)psiElement).getLocalName()) &&
+               "Y".equals(((XmlTag)psiElement).getAttributeValue("name"))
+               );
+
+    assertEquals(expectedFileName,psiElement.getContainingFile().getName());
+  }
+
+  public void testSchemaValidation3() throws Exception {
+    String location = getTestName(false)+".xsd";
+    String location2 = getTestName(false)+"_2.xsd";
+    String url = "parent";
+    String url2 = "child";
+
+    ExternalResourceManagerImpl.registerResourceTemporarily(url, location, getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily(url2, location2, getTestRootDisposable());
+
+    configureByFiles(null, getVirtualFile(BASE_PATH + getTestName(false) + ".xml"), getVirtualFile(BASE_PATH + location),
+                     getVirtualFile(BASE_PATH + location2));
+    doDoTest(true,false);
+
+  }
+
+  public void testSchemaValidation4() throws Exception {
+    String schemaLocation = getTestName(false)+".xsd";
+
+    configureByFiles(null, getVirtualFile(BASE_PATH + getTestName(false) + ".xml"), getVirtualFile(BASE_PATH + schemaLocation));
+
+    ExternalResourceManagerImpl.registerResourceTemporarily(schemaLocation, schemaLocation, getTestRootDisposable());
+    doDoTest(true, false);
+  }
+
+  public void testSchemaValidation5() throws Exception {
+    String schemaLocation = getTestName(false)+".xsd";
+
+    configureByFile(BASE_PATH + schemaLocation);
+    doDoTest(true, false);
+    final List<PsiReference> myTypeOrElementRefs = new ArrayList<PsiReference>(1);
+    final List<XmlTag> myTypesAndElementDecls = new ArrayList<XmlTag>(1);
+
+    myFile.accept(new XmlRecursiveElementVisitor() {
+      @Override public void visitXmlAttributeValue(XmlAttributeValue value) {
+        final PsiElement parent = value.getParent();
+        if (!(parent instanceof XmlAttribute)) return;
+        final String name = ((XmlAttribute)parent).getName();
+        if ("type".equals(name) || "base".equals(name) || "ref".equals(name)) {
+          myTypeOrElementRefs.add(value.getReferences()[0]);
+        }
+      }
+
+      @Override public void visitXmlTag(XmlTag tag) {
+        super.visitXmlTag(tag);
+        final String localName = tag.getLocalName();
+        if ("complexType".equals(localName) || "simpleType".equals(localName) || "element".equals(localName)) {
+          if (tag.getAttributeValue("name") != null) myTypesAndElementDecls.add(tag);
+        }
+      }
+    });
+
+    assertEquals(9,myTypesAndElementDecls.size());
+    assertEquals(5,myTypeOrElementRefs.size());
+    for(XmlTag t:myTypesAndElementDecls) {
+      final XmlAttribute attribute = t.getAttribute("name", null);
+      final XmlAttributeValue valueElement = attribute.getValueElement();
+      final PsiReference nameReference = valueElement.getReferences()[0];
+      ApplicationManager.getApplication().runWriteAction(new Runnable() {
+        public void run() {
+          nameReference.handleElementRename("zzz");
+        }
+      });
+    }
+
+    for(PsiReference ref:myTypeOrElementRefs)  {
+      assertNull(ref.resolve());
+    }
+  }
+
+  public void testExternalValidatorOnValidXmlWithNamespacesNotSetup() throws Exception {
+    final ExternalResourceManagerEx instanceEx = ExternalResourceManagerEx.getInstanceEx();
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        instanceEx.addIgnoredResource("http://xml.apache.org/axis/wsdd2/");
+        instanceEx.addIgnoredResource("http://xml.apache.org/axis/wsdd2/providers/java");
+        instanceEx.addIgnoredResource("http://soapinterop.org/xsd2");
+      }
+    });
+
+    doTest(getFullRelativeTestName(".xml"), true, false);
+  }
+
+  @HighlightingFlags(HighlightingFlag.SkipExternalValidation)
+  public void testExternalValidatorOnValidXmlWithNamespacesNotSetup2() throws Exception {
+    final ExternalResourceManagerEx instanceEx = ExternalResourceManagerEx.getInstanceEx();
+    try {
+      ApplicationManager.getApplication().runWriteAction(new Runnable() {
+        public void run() {
+          instanceEx.addIgnoredResource("");
+        }
+      });
+
+      doTest(getFullRelativeTestName(".xml"), true, false);
+    } finally {
+      ApplicationManager.getApplication().runWriteAction(new Runnable() {
+        public void run() {
+          instanceEx.removeIgnoredResource("");
+        }
+      });
+    }
+  }
+
+  public void testXercesMessagesBinding() throws Exception {
+    doTest(getFullRelativeTestName(".xml"), true, false);
+  }
+
+  public void testXercesMessagesBinding3() throws Exception {
+    doTest(getFullRelativeTestName(".xml"), true, false);
+  }
+
+  public void testXercesMessagesBinding4() throws Exception {
+    String url = "antlib:org.apache.maven.artifact.ant";
+
+    enableInspectionTool(new AntResolveInspection());
+    doTestWithLocations(new String[][]{{url, getTestName(false) + ".xsd"}}, "xml");
+  }
+
+  public void testWrongRegExpInSchema() throws Exception {
+    doTest(getFullRelativeTestName(".xsd"), true, false);
+    doTest(getFullRelativeTestName("2.xsd"), true, false);
+  }
+
+  public void testXercesMessagesBinding2() throws Exception {
+    final String url = getTestName(false) + ".xsd";
+    ExternalResourceManagerImpl.registerResourceTemporarily(url, url, getTestRootDisposable());
+
+    doTest(
+      new VirtualFile[] {
+        getVirtualFile(getFullRelativeTestName(".xml")),
+        getVirtualFile(getFullRelativeTestName(".xsd"))
+      },
+      true,
+      false
+    );
+
+    final String url2 = getTestName(false) + "_2.xsd";
+
+    ExternalResourceManagerImpl.registerResourceTemporarily(url2, url2, getTestRootDisposable());
+
+    doTest(
+      new VirtualFile[] {
+        getVirtualFile(getFullRelativeTestName("_2.xml")),
+        getVirtualFile(getFullRelativeTestName("_2.xsd"))
+      },
+      true,
+      false
+    );
+
+  }
+
+  public void testValidationOfDtdFile() throws Exception {
+    doTest(getFullRelativeTestName(".dtd"), false, false);
+  }
+
+  public void testXHtmlValidation() throws Exception {
+    doTest();
+  }
+
+  public void testXHtmlValidation2() throws Exception {
+    configureByFile(getFullRelativeTestName());
+    doDoTest(true, true, true);
+  }
+
+  public void testXHtmlValidation3() throws Exception {
+    doManyFilesFromSeparateDirTest(
+      "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd",
+      "xhtml-basic11.dtd",
+      new Runnable() {
+        @Override
+        public void run() {
+          final List<XmlAttribute> attrs = new ArrayList<XmlAttribute>();
+
+          myFile.acceptChildren(new XmlRecursiveElementVisitor() {
+            @Override
+            public void visitXmlAttribute(final XmlAttribute attribute) {
+              if (attribute.getDescriptor() != null) attrs.add(attribute);
+            }
+          });
+
+          assertEquals(8, attrs.size());
+          for (XmlAttribute a : attrs) {
+            final PsiElement element = a.getDescriptor().getDeclaration();
+            assertTrue(((Navigatable)element).canNavigate());
+          }
+        }
+      }
+    );
+  }
+
+  public void testReferencingTargetNamespace() throws Exception {
+    doTest();
+  }
+
+  public void testWebApp() throws Exception {
+    doTest();
+  }
+
+  public void testEnumeratedAttributesValidation() throws Exception {
+    doTest(BASE_PATH + getTestName(false) + ".xsd", false, false);
+  }
+
+  public void testStackOverflow() throws Exception {
+    String location = "relaxng.xsd";
+    String url = "http://relaxng.org/ns/structure/fake/1.0";
+    ExternalResourceManagerImpl.registerResourceTemporarily(url, location, getTestRootDisposable());
+    doTest(new VirtualFile[]{getVirtualFile(getFullRelativeTestName()), getVirtualFile(BASE_PATH + location)}, false, false);
+  }
+
+  public void testStackOverflow2() throws Exception {
+    final String url = "urn:aaa";
+    final String location = getTestName(false) + ".xsd";
+    ExternalResourceManagerImpl.registerResourceTemporarily(url, location, getTestRootDisposable());
+    doTest(getFullRelativeTestName(".xsd"), false, false);
+
+  }
+
+  public void testComplexSchemaValidation() throws Exception {
+//    disableHtmlSupport();
+    try {
+      doTest(getFullRelativeTestName(), false, false);
+    }
+    finally {
+//      enableHtmlSupport();
+    }
+  }
+
+  public void testComplexDtdValidation() throws Exception {
+    String location = "Tapestry_3_0.dtd";
+    String url = "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd";
+    ExternalResourceManagerImpl.registerResourceTemporarily(url, location, getTestRootDisposable());
+
+    myTestJustJaxpValidation = true;
+    doTest(new VirtualFile[] { getVirtualFile(getFullRelativeTestName()), getVirtualFile(BASE_PATH + location) }, false,false);
+    myTestJustJaxpValidation = false;
+  }
+
+  public void testComplexDtdValidation2() throws Exception {
+    String location = getTestName(false)+".dtd";
+    ExternalResourceManagerImpl.registerResourceTemporarily(location, location, getTestRootDisposable());
+
+    myTestJustJaxpValidation = true;
+    doTest(new VirtualFile[] { getVirtualFile(getFullRelativeTestName()), getVirtualFile(BASE_PATH + location) }, false,false);
+    myTestJustJaxpValidation = false;
+  }
+
+  public void testComplexSchemaValidation2() throws Exception {
+    doTest(new VirtualFile[] { getVirtualFile(getFullRelativeTestName()), getVirtualFile(BASE_PATH + "jdo_2_0.xsd") }, false,false);
+  }
+
+  public void testComplexSchemaValidation3() throws Exception {
+    List<VirtualFile> files = new ArrayList<VirtualFile>();
+    files.add(getVirtualFile(getFullRelativeTestName()));
+
+    final VirtualFile virtualFile = getVirtualFile(BASE_PATH + "ComplexSchemaValidation3Schemas");
+    ContainerUtil.addAll(files, virtualFile.getChildren());
+
+    doTest(VfsUtil.toVirtualFileArray(files), true, false);
+  }
+
+  public void testComplexSchemaValidation4() throws Exception {
+    String[][] urls = {{"http://www.unece.org/etrades/unedocs/repository/codelists/xml/CountryCode.xsd"},
+      {"http://www.swissdec.ch/schema/sd/20050902/SalaryDeclarationServiceTypes"},
+      {"http://www.swissdec.ch/schema/sd/20050902/SalaryDeclarationContainer"},
+      {"http://www.swissdec.ch/schema/sd/20050902/SalaryDeclaration"}};
+
+    doSchemaTestWithManyFilesFromSeparateDir(urls, null);
+  }
+
+  public void testComplexSchemaValidation5() throws Exception {
+    String location = getTestName(false)+".xsd";
+    String url = "http://www.etas.com/TELEGY/Test";
+    ExternalResourceManagerImpl.registerResourceTemporarily(url, location, getTestRootDisposable());
+    doTest(new VirtualFile[] { getVirtualFile(getFullRelativeTestName()), getVirtualFile(BASE_PATH + location) }, false,false);
+
+    final XmlTag[] subTags = ((XmlFile)myFile).getDocument().getRootTag().getSubTags();
+
+    for(XmlTag t:subTags) {
+      final PsiReference reference = t.getReference();
+      assertNotNull(reference);
+      final PsiElement psiElement = reference.resolve();
+      assertTrue(psiElement instanceof XmlTag && "xsd:element".equals(((XmlTag)psiElement).getName()));
+    }
+
+  }
+
+  @Override
+  protected boolean doExternalValidation() {
+    return !methodOfTestHasAnnotation(getClass(), getTestName(false), HighlightingFlag.SkipExternalValidation) && super.doExternalValidation();
+  }
+
+  public void testComplexSchemaValidation6() throws Exception {
+    String location = getTestName(false)+".xsd";
+    String url = "http://abcde/pg.html";
+    ExternalResourceManagerImpl.registerResourceTemporarily(url, location, getTestRootDisposable());
+    doTest(new VirtualFile[]{getVirtualFile(getFullRelativeTestName()), getVirtualFile(BASE_PATH + location)}, true, false);
+  }
+
+  public void testComplexSchemaValidation7() throws Exception {
+    String[][] urlLocationPairs = {
+      {"http://schemas.xmlsoap.org/wsdl/","wsdl.xsd"},
+      {"http://schemas.xmlsoap.org/wsdl/soap/","soap.xsd"},
+      {"http://schemas.xmlsoap.org/soap/encoding/","encoding.xsd"},
+      {"http://schemas.xmlsoap.org/wsdl/mime/","mime.xsd"},
+      {"http://schemas.xmlsoap.org/wsdl/http/","http.xsd"}
+    };
+
+
+    doSchemaTestWithManyFilesFromSeparateDir(
+      urlLocationPairs,
+      new Processor<List<VirtualFile>>() {
+        @Override
+        public boolean process(final List<VirtualFile> files) {
+          try {
+            files.set(0, getVirtualFile(BASE_PATH + getTestName(false) + "_2.xml"));
+            doTest(VfsUtil.toVirtualFileArray(files), true, false);
+            return true;
+          }
+          catch (Exception e) {
+            throw new RuntimeException(e);
+          }
+        }
+      }
+    );
+  }
+
+  public void testComplexSchemaValidation7_() throws Exception {
+    doTest(
+      new VirtualFile[]{
+        getVirtualFile(getFullRelativeTestName()),
+        getVirtualFile(getFullRelativeTestName(".xsd"))
+      },
+      false,
+      false
+    );
+  }
+
+  public void testWsdlValidation() throws Exception {
+    doTest(getFullRelativeTestName(".wsdl"), false, false);
+  }
+
+  public void testErrorInDtd() throws Exception {
+    String location = "def_xslt.dtd";
+    String url = "http://www.w3.org/1999/XSL/Transform";
+    ExternalResourceManagerImpl.registerResourceTemporarily(url, location, getTestRootDisposable());
+    doTest(new VirtualFile[]{getVirtualFile(getFullRelativeTestName()), getVirtualFile(BASE_PATH + location)}, false, false);
+  }
+
+  public void testMavenValidation() throws Exception {
+    doTest(getFullRelativeTestName(), false, false);
+  }
+
+  public void testResolveEntityUrl() throws Throwable {
+    doTest(new VirtualFile[] {
+      getVirtualFile(getFullRelativeTestName()),
+      getVirtualFile(BASE_PATH + "entities.dtd")
+    }, false, false);
+  }
+
+  public void testXsiSchemaLocation() throws Exception {
+    doTest();
+    doTest(getFullRelativeTestName("_2.xml"), false, false);
+  }
+
+  public void testXmlPsi() throws Exception {
+    configureByFile(BASE_PATH + getTestName(false) + ".xml");
+
+    final XmlTag root = ((XmlFile)myFile).getDocument().getRootTag();
+    final XmlTag tag1 = root.getSubTags()[0];
+    assert tag1.getLocalName().equals("foo");
+
+    assertEquals("xxx" ,tag1.getAttributeValue("xxx", "abc"));
+
+    final XmlTag tag2 = root.getSubTags()[0].getSubTags()[0];
+    assert tag2.getLocalName().equals("bar");
+
+    assertEquals("yyy", tag2.getAttributeValue("yyy", "abc"));
+    assertEquals("zzz", tag2.getAttributeValue("zzz"));
+    assertNull(tag2.getAttributeValue("zzz", "unknown"));
+    assertNull(tag2.getAttributeValue("zzz", "abc"));
+
+    final XmlTag tag3 = root.getSubTags()[0].getSubTags()[1];
+    assert tag3.getLocalName().equals("bar2");
+    assertEquals("zzz", tag3.getAttributeValue("zzz", "def"));
+  }
+
+  public void testXsiSchemaLocation2() throws Exception {
+    doTest(
+      new VirtualFile[] {
+        getVirtualFile(getFullRelativeTestName()),
+        getVirtualFile(BASE_PATH + getTestName(false) + "_1.xsd"),
+        getVirtualFile(BASE_PATH + getTestName(false) + "_2.xsd"),
+        getVirtualFile(BASE_PATH + getTestName(false) + "_3.xsd"),
+      },
+      false,
+      false
+    );
+
+    XmlTag rootTag = ((XmlFile)myFile).getDocument().getRootTag();
+    checkOneTagForSchemaAttribute(rootTag, "xmlns:test2", getTestName(false) + "_2.xsd");
+
+    configureByFiles(null, getVirtualFile(BASE_PATH + getTestName(false) + "_2.xsd"), getVirtualFile(BASE_PATH + getTestName(false) + "_3.xsd"));
+
+    rootTag = ((XmlFile)myFile).getDocument().getRootTag();
+    final List<XmlTag> tags = new ArrayList<XmlTag>();
+
+    XmlUtil.processXmlElements(
+      rootTag,
+      new PsiElementProcessor() {
+        @Override
+        public boolean execute(@NotNull final PsiElement element) {
+          if (element instanceof XmlTag &&
+              (((XmlTag)element).getName().equals("xs:element") ||
+               ((XmlTag)element).getName().equals("xs:attribute") ||
+               ((XmlTag)element).getName().equals("xs:restriction") ||
+               ((XmlTag)element).getName().equals("xs:group") ||
+               ((XmlTag)element).getName().equals("xs:attributeGroup")
+              ) &&
+                ( ((XmlTag)element).getAttributeValue("type") != null ||
+                  ((XmlTag)element).getAttributeValue("ref") != null ||
+                  ((XmlTag)element).getAttributeValue("base") != null
+                )
+             ) {
+            tags.add((XmlTag)element);
+          }
+          return true;
+        }
+      },
+      true
+    );
+
+    assertEquals("Should be adequate number of tags", 11, tags.size());
+
+    final String resolveFileName = getTestName(false) + "_3.xsd";
+    checkOneTagForSchemaAttribute(tags.get(1), "type", resolveFileName);
+    checkOneTagForSchemaAttribute(tags.get(0), "ref", resolveFileName);
+    checkOneTagForSchemaAttribute(tags.get(3), "type", resolveFileName);
+    checkOneTagForSchemaAttribute(tags.get(4), "base", resolveFileName);
+    final String schemaFile = "XMLSchema.xsd";
+    checkOneTagForSchemaAttribute(tags.get(5), "base", schemaFile);
+
+    checkOneTagForSchemaAttribute(rootTag, "xmlns:xs", schemaFile);
+    checkOneTagForSchemaAttribute(tags.get(6), "ref", resolveFileName);
+    checkOneTagForSchemaAttribute(tags.get(7), "ref", resolveFileName);
+    checkOneTagForSchemaAttribute(rootTag, "xmlns:test2", getTestName(false) + "_2.xsd");
+
+    checkOneTagForSchemaAttribute(tags.get(8), "type", schemaFile);
+    checkOneTagForSchemaAttribute(tags.get(9), "ref", schemaFile);
+    checkOneTagForSchemaAttribute(tags.get(10), "ref", resolveFileName);
+  }
+
+  private static void checkOneTagForSchemaAttribute(XmlTag tag,String schemaAttrName, String resolveFileName) {
+    String attributeValue = tag.getAttributeValue(schemaAttrName);
+
+    if (attributeValue != null) {
+      XmlAttribute attribute = tag.getAttribute(schemaAttrName, null);
+      PsiReference[] references = attribute.getValueElement().getReferences();
+      assertTrue(
+        "There should resolvable reference to " + schemaAttrName,
+        references.length > 0
+      );
+
+      for (PsiReference reference : references) {
+        PsiElement element = reference.resolve();
+        if (element != null && element.getContainingFile().getName().equals(resolveFileName)) {
+          return;
+        }
+      }
+      assertTrue("There should resolvable reference to "+ schemaAttrName + ", 2", true);              
+    }
+  }
+
+  @Override
+  protected LocalInspectionTool[] configureLocalInspectionTools() {
+    return new LocalInspectionTool[]{
+      new RequiredAttributesInspection(),
+      new XmlDuplicatedIdInspection(),
+      new CheckDtdReferencesInspection(),
+      new XmlUnboundNsPrefixInspection(),
+      new XmlPathReferenceInspection()
+    };
+  }
+
+  @HighlightingFlags({HighlightingFlag.SkipExternalValidation})
+  public void testXsltValidation() throws Exception {
+    doTest(getFullRelativeTestName(".xsl"), true, false);
+    doTest(getFullRelativeTestName("2.xsl"), true, false);
+  }
+
+  public void testXsltValidation3() throws Exception {
+    doTest(getFullRelativeTestName(".xsl"), true, false);
+  }
+
+  public void testXsiSchemaLocation3() throws Exception {
+
+    configureByFile(getFullRelativeTestName(".xsd"), null);
+
+    doDoTest(true,false);
+
+    final List<XmlTag> tags = new ArrayList<XmlTag>();
+
+    XmlUtil.processXmlElements(
+      ((XmlFile)myFile).getDocument(),
+      new PsiElementProcessor() {
+        @Override
+        public boolean execute(@NotNull final PsiElement element) {
+          if (element instanceof XmlTag &&
+              ((XmlTag)element).getName().equals("xs:include")
+             ) {
+            tags.add((XmlTag)element);
+          }
+          return true;
+        }
+      },
+      true
+    );
+
+    assertEquals("Should be three tags", 3, tags.size());
+    String location = "xslt-1_0.xsd";
+    checkOneTagForSchemaAttribute(tags.get(2), "schemaLocation", location);
+  }
+
+  public void testResolvingEntitiesInDtd() throws Exception {
+    configureByFiles(null, getVirtualFile(BASE_PATH + getTestName(false) + ".xml"),
+                     getVirtualFile(BASE_PATH + getTestName(false) + "/RatingandServiceSelectionRequest.dtd"),
+                     getVirtualFile(BASE_PATH + getTestName(false) + "/XpciInterchange.dtd"),
+                     getVirtualFile(BASE_PATH + getTestName(false) + "/Xpcivocabulary.dtd"));
+    doDoTest(true, false);
+  }
+
+  // TODO: external validator should not be lauched due to error detected after general highlighting pass!
+  @HighlightingFlags(HighlightingFlag.SkipExternalValidation)
+  public void testEntityHighlighting() throws Exception {
+    doTest();
+    final XmlTag rootTag = ((XmlFile)myFile).getDocument().getRootTag();
+    final List<XmlEntityRef> refs = new ArrayList<XmlEntityRef>();
+
+    XmlUtil.processXmlElements(
+      rootTag,
+      new PsiElementProcessor() {
+        @Override
+        public boolean execute(@NotNull final PsiElement element) {
+          if (element instanceof XmlEntityRef) {
+            refs.add((XmlEntityRef)element);
+          }
+          return true;
+        }
+      },
+      true
+    );
+
+    assertEquals("Should be 2 entity refs",2,refs.size());
+
+    PsiReference[] entityRefs = refs.get(0).getReferences();
+    assertTrue(entityRefs.length == 1 &&
+               entityRefs[0].resolve() == null
+              );
+    entityRefs = refs.get(1).getReferences();
+    assertTrue(entityRefs.length == 1 &&
+               entityRefs[0].resolve() != null
+              );
+
+    doTest(getFullRelativeTestName("2.xml"), false, false);
+  }
+
+  public void testEntityRefBadFormat() throws Exception {
+    doTest();
+  }
+
+  public void testIgnoredNamespaceHighlighting() throws Exception {
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        ExternalResourceManagerEx.getInstanceEx().addIgnoredResource("http://ignored/uri");
+      }
+    });
+
+    doTest();
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        ExternalResourceManagerEx.getInstanceEx().removeIgnoredResource("http://ignored/uri");
+      }
+    });
+  }
+
+  public void testNonEnumeratedValuesHighlighting() throws Exception {
+    final String url = "http://www.w3.org/1999/XSL/Format";
+    ExternalResourceManagerImpl.registerResourceTemporarily(url, "fop.xsd", getTestRootDisposable());
+    configureByFiles(null, getVirtualFile(BASE_PATH + getTestName(false) + ".xml"), getVirtualFile(BASE_PATH + "fop.xsd"));
+    doDoTest(true, false);
+  }
+
+  public void testEditorHighlighting() throws Exception {
+    //                       10
+    //             0123456789012
+    String text = "<html></html>";
+    EditorHighlighter xmlHighlighter = XmlHighlighterFactory.createXMLHighlighter(EditorColorsManager.getInstance().getGlobalScheme());
+    xmlHighlighter.setText(text);
+    HighlighterIterator iterator = xmlHighlighter.createIterator(1);
+    assertSame("Xml tag name", iterator.getTokenType(), XmlTokenType.XML_TAG_NAME);
+    iterator = xmlHighlighter.createIterator(8);
+    assertSame("Xml tag name at end of tag", iterator.getTokenType(), XmlTokenType.XML_TAG_NAME);
+
+    //               10        20         30
+    //      0123456789012345678901234567890
+    text = "<a:xxx /> <a:xxx attr = \"1111\"/>";
+    xmlHighlighter.setText(text);
+
+    iterator = xmlHighlighter.createIterator(6);
+    assertEquals(XmlTokenType.TAG_WHITE_SPACE, iterator.getTokenType());
+
+    iterator = xmlHighlighter.createIterator(21);
+    assertEquals(XmlTokenType.TAG_WHITE_SPACE, iterator.getTokenType());
+
+    iterator = xmlHighlighter.createIterator(23);
+    assertEquals(XmlTokenType.TAG_WHITE_SPACE, iterator.getTokenType());
+
+    iterator = xmlHighlighter.createIterator(9);
+    assertEquals(XmlTokenType.XML_REAL_WHITE_SPACE, iterator.getTokenType());
+
+    //                10        20        30        40          50        60
+    //      012345678901234567890123456789012345678901 234567 890123456789012 345678 90
+    text = "<!DOCTYPE schema [ <!ENTITY RelativeURL  \"[^:#/\\?]*(:{0,0}|[#/\\?].*)\">";
+    xmlHighlighter.setText(text);
+    iterator = xmlHighlighter.createIterator(53);
+    assertSame("Xml attribute value", iterator.getTokenType(), XmlTokenType.XML_DATA_CHARACTERS);
+    assertEquals(iterator.getStart(),41);
+    assertEquals(iterator.getEnd(),70);
+
+    //              10        20        30        40          50        60
+    //    012345678901234567890123456789012345678901 234567 890123456789012 345678 90
+    text="<a name='$'/>";
+
+    xmlHighlighter.setText(text);
+    iterator = xmlHighlighter.createIterator(9);
+    assertEquals("$ in attr value",XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN,iterator.getTokenType());
+    iterator = xmlHighlighter.createIterator(10);
+    assertEquals("' after $ in attr value",XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER,iterator.getTokenType());
+
+    //                10         20         30        40           50        60
+    //      0123456789012345678 901 23456789012345678901 2345 67 890123456789012 345678 90
+    text = "<project><jar file=\"${\"> </jar><jar file=\"${}\"/></project> ";
+
+    xmlHighlighter.setText(text);
+    iterator = xmlHighlighter.createIterator(22);
+    assertEquals("${ in attr value",XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER,iterator.getTokenType());
+
+    //                10
+    //      01234567890123456789
+    text = "<!--&nbsp; &aaa;-->";
+
+    xmlHighlighter.setText(text);
+    iterator = xmlHighlighter.createIterator(5);
+    assertEquals(
+      "char entity in comment",
+      XmlTokenType.XML_COMMENT_CHARACTERS,
+      iterator.getTokenType()
+    );
+
+    iterator = xmlHighlighter.createIterator(12);
+    assertEquals(
+      "entity ref in comment",
+      XmlTokenType.XML_COMMENT_CHARACTERS,
+      iterator.getTokenType()
+    );
+
+    //                10
+    //      01234567890123456789
+    text = "<!-- -- -->";
+
+    xmlHighlighter.setText(text);
+    iterator = xmlHighlighter.createIterator(5);
+    assertEquals(
+      "double -- in xml comment",
+      XmlTokenType.XML_BAD_CHARACTER,
+      iterator.getTokenType()
+    );
+
+  }
+
+  public void testUsingDtdReference() throws Exception {
+    final String baseName = BASE_PATH + getTestName(false);
+
+    configureByFiles(null, getVirtualFile(baseName + ".xml"), getVirtualFile(baseName + ".dtd"), getVirtualFile(baseName + "2.dtd"));
+    doDoTest(true, false);
+  }
+
+  public void testUnboundNsHighlighting() throws Exception {
+    configureByFile(BASE_PATH + "web-app_2_4.xsd");
+    final String testName = getTestName(false);
+    doTest(BASE_PATH + testName +".xml",true, false);
+
+    doTestWithUnboundNSQuickFix(BASE_PATH + testName + "2");
+//    doTestWithUnboundNSQuickFix(BASE_PATH + testName + "3");
+
+    configureByFiles(null, BASE_PATH + testName +"4.xml", BASE_PATH + testName +"4.dtd");
+    doDoTest(true, false);
+
+    doTestWithUnboundNSQuickFix(BASE_PATH + testName + "5");
+  }
+
+  public void testUnboundNsHighlighting6() throws Exception {
+    configureByFile(BASE_PATH + "web-app_2_4.xsd");
+    doTestWithQuickFix(BASE_PATH + getTestName(false), CREATE_NAMESPACE_DECLARATION_INTENTION_NAME, true);
+  }
+
+  private void doTestWithUnboundNSQuickFix(final String s) throws Exception {
+    doTestWithQuickFix(s, CREATE_NAMESPACE_DECLARATION_INTENTION_NAME, false);
+  }
+
+  private void doTestWithQuickFix(final String s, final String intentionActionName, boolean withInfos) throws Exception {
+    configureByFile(s + ".xml");
+    Collection<HighlightInfo> infos = doDoTest(true, withInfos);
+
+    findAndInvokeIntentionAction(infos, intentionActionName, myEditor, myFile);
+    checkResultByFile(s + "_after.xml");
+  }
+
+  public void testSpecifyXsiSchemaLocationQuickFix() throws Exception {
+    configureByFile(BASE_PATH + "web-app_2_4.xsd");
+    final String testName = getTestName(false);
+    final String actionName = XmlBundle.message(AddXsiSchemaLocationForExtResourceAction.KEY);
+    doTestWithQuickFix(BASE_PATH + testName, actionName, true);
+    doTestWithQuickFix(BASE_PATH + testName + "2", actionName, true);
+    doTestWithQuickFix(BASE_PATH + testName + "3", actionName, true);
+    doTestWithQuickFix(BASE_PATH + testName + "4", actionName, true);
+  }
+
+  public void testHighlightingWithConditionalSectionsInDtd() throws Exception {
+    final String testName = getTestName(false);
+
+    configureByFiles(null, getVirtualFile(BASE_PATH + testName +".xml"), getVirtualFile(BASE_PATH + testName +".dtd"));
+    doDoTest(true, false);
+
+    configureByFiles(null, getVirtualFile(BASE_PATH + testName +"2.xml"), getVirtualFile(BASE_PATH + testName +".dtd"));
+    doDoTest(true, false);
+  }
+
+  public void testUnresolvedDtdElementReferences() throws Exception {
+    doDtdRefsWithQuickFixTestSequence(BASE_PATH + getTestName(false), "dtd");
+  }
+
+  public void testResolvedDtdElementReferences() throws Exception {
+    configureByFile(BASE_PATH + getTestName(false)+".dtd");
+    doDoTest(true, false);
+
+    final String text = myEditor.getDocument().getText();
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        myEditor.getSelectionModel().setSelection(0, myEditor.getDocument().getTextLength());
+      }
+    });
+
+    AnAction action = ActionManager.getInstance().getAction(IdeActions.ACTION_COMMENT_BLOCK);
+    action.actionPerformed(new AnActionEvent(null, DataManager.getInstance().getDataContext(), "", action.getTemplatePresentation(),
+                                             ActionManager.getInstance(), 0));
+    assertNotSame(text,myEditor.getDocument().getText());
+    PsiDocumentManager.getInstance(myProject).commitDocument(myEditor.getDocument());
+    Collection<HighlightInfo> infos = doHighlighting();
+    assertEquals(0, infos.size());
+    
+    action.actionPerformed(new AnActionEvent(null, DataManager.getInstance().getDataContext(), "", action.getTemplatePresentation(),
+                                             ActionManager.getInstance(), 0));
+    assertEquals(text,myEditor.getDocument().getText().trim());
+    PsiDocumentManager.getInstance(myProject).commitDocument(myEditor.getDocument());
+    infos = doHighlighting();
+    assertEquals(0, infos.size());
+  }
+
+  // TODO: external validator should not be lauched due to error detected after general highlighting pass!
+  @HighlightingFlags(HighlightingFlag.SkipExternalValidation)
+  public void testUnresolvedDtdElementReferencesInXml() throws Exception {
+    doDtdRefsWithQuickFixTestSequence(BASE_PATH + getTestName(false), "xml");
+  }
+
+  public void testUnresolvedDtdElementReferencesInXml2() throws Exception {
+    final String s = BASE_PATH + getTestName(false);
+    doDtdEntityRefWithQuickFixTest(s, "xml");
+    doDtdEntityRefWithQuickFixTest(s + "_2", "xml");
+  }
+
+  public void testUnresolvedDtdElementReferencesInXml3() throws Exception {
+    doDtdEntityRefWithQuickFixTest(BASE_PATH + getTestName(false), "xml");
+  }
+
+  public void testUnresolvedDtdEntityReference() throws Exception {
+    final String s = BASE_PATH + getTestName(false);
+    doDtdEntityRefWithQuickFixTest(s, "dtd");
+  }
+
+  private void doDtdEntityRefWithQuickFixTest(final String s, String ext) throws Exception {
+    configureByFile(s + "." + ext);
+    Collection<HighlightInfo> infos = doDoTest(true, false);
+    findAndInvokeIntentionAction(infos, "Create Entity Declaration entity", myEditor, myFile);
+    checkResultByFile(s+"_after" + "." + ext);
+  }
+
+  private void doDtdRefsWithQuickFixTestSequence(final String s, final String extension) throws Exception {
+    configureByFile(s + "." + extension);
+    Collection<HighlightInfo> infos = doDoTest(true, false);
+
+    findAndInvokeIntentionAction(infos, "Create Element Declaration aaa", myEditor, myFile);
+    checkResultByFile(s+"_after." + extension);
+    PsiDocumentManager.getInstance(myProject).commitDocument(myEditor.getDocument());
+    infos = doHighlighting();
+    findAndInvokeIntentionAction(infos, "Create Entity Declaration entity", myEditor, myFile);
+    checkResultByFile(s+"_after2." + extension);
+    PsiDocumentManager.getInstance(myProject).commitDocument(myEditor.getDocument());
+  }
+
+  @HighlightingFlags(HighlightingFlag.SkipExternalValidation)
+  public void testDocBookHighlighting() throws Exception {
+    doManyFilesFromSeparateDirTest("http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd", "docbookx.dtd", new Runnable() {
+      @Override
+      public void run() {
+        XmlTag rootTag = ((XmlFile)myFile).getDocument().getRootTag();
+        PsiElement psiElement = rootTag.getReferences()[0].resolve();
+        assertTrue(((Navigatable)psiElement).canNavigate());
+      }
+    });
+  }
+
+  public void testDocBookHighlighting2() throws Exception {
+    doManyFilesFromSeparateDirTest("http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd", "docbookx.dtd", null);
+  }
+
+  public void testOasisDocumentHighlighting() throws Exception {
+    doManyFilesFromSeparateDirTest("concept.dtd", "concept.dtd", null);
+  }
+
+  private void doManyFilesFromSeparateDirTest(final String url, final String mainDtdName, @Nullable Runnable additionalTestAction) throws Exception {
+    List<VirtualFile> files = new ArrayList<VirtualFile>();
+    files.add(getVirtualFile(getFullRelativeTestName()));
+
+    final VirtualFile virtualFile = getVirtualFile(BASE_PATH + getTestName(false));
+    ContainerUtil.addAll(files, virtualFile.getChildren());
+
+    ExternalResourceManagerImpl
+        .registerResourceTemporarily(url, UriUtil.findRelativeFile(mainDtdName, virtualFile).getPath(), getTestRootDisposable());
+    doTest(VfsUtil.toVirtualFileArray(files), true, false);
+
+    if (additionalTestAction != null) additionalTestAction.run();
+
+  }
+
+  private void doSchemaTestWithManyFilesFromSeparateDir(final String[][] urls, @Nullable Processor<List<VirtualFile>> additionalTestingProcessor) throws Exception {
+    try {
+      List<VirtualFile> files = new ArrayList<VirtualFile>(6);
+      files.add( getVirtualFile(BASE_PATH + getTestName(false) + ".xml"));
+
+      final Set<VirtualFile> usedFiles = new THashSet<VirtualFile>();
+      final String base = BASE_PATH + getTestName(false) + "Schemas/";
+
+      for(String[] pair:urls) {
+        final String url = pair[0];
+        final String filename = pair.length > 1 ? pair[1]:url.substring(url.lastIndexOf('/')+1) + (url.endsWith(".xsd")?"":".xsd");
+
+        final VirtualFile virtualFile = getVirtualFile(base + filename);
+        usedFiles.add(virtualFile);
+
+        if (url != null) ExternalResourceManagerImpl.registerResourceTemporarily(url, virtualFile.getPath(), getTestRootDisposable());
+        files.add( virtualFile );
+      }
+
+      for(VirtualFile file: LocalFileSystem.getInstance().findFileByPath(getTestDataPath() + base.substring(0, base.length() - 1)).getChildren()) {
+        if (!usedFiles.contains(file)) {
+          files.add(file);
+        }
+      }
+
+      doTest(VfsUtil.toVirtualFileArray(files), true, false);
+
+      if (additionalTestingProcessor != null) additionalTestingProcessor.process(files);
+    }
+    finally {
+      unregisterResources(urls);
+    }
+  }
+
+  enum HighlightingFlag {
+    SkipExternalValidation
+  }
+
+  @Retention(RetentionPolicy.RUNTIME)
+  @Target({ElementType.METHOD})
+  @interface HighlightingFlags {
+    HighlightingFlag[] value() default {};
+  }
+
+  private static boolean methodOfTestHasAnnotation(final Class testClass, final String testName, final HighlightingFlag flag) {
+    Method method;
+    try {
+      method = testClass.getMethod("test" + testName);
+    } catch (Exception e) {
+      throw new RuntimeException(e);
+    }
+
+    final HighlightingFlags annotation = method.getAnnotation(HighlightingFlags.class);
+    if (annotation != null) {
+      final HighlightingFlag[] testOptions = annotation.value();
+
+      if (testOptions != null) {
+        Arrays.sort(testOptions);
+        return Arrays.binarySearch(testOptions, flag) >= 0;
+      }
+    }
+
+    return false;
+  }
+
+  @HighlightingFlags(HighlightingFlag.SkipExternalValidation)
+  public void testSchemaUpdate() throws IOException {
+    String location = getTestName(false)+".xsd";
+    String url = "http://example.org/ns/books/";
+    ExternalResourceManagerImpl.registerResourceTemporarily(url, location, getTestRootDisposable());
+    configureByFiles(null, getVirtualFile(getFullRelativeTestName()), getVirtualFile(BASE_PATH + location));
+
+    doDoTest(true,false);
+
+    Editor[] allEditors = EditorFactory.getInstance().getAllEditors();
+    final Editor schemaEditor = allEditors[0] == myEditor ? allEditors[1]:allEditors[0];
+    final String text = schemaEditor.getDocument().getText();
+    final String newText = text.replaceAll("xsd","xs");
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        schemaEditor.getDocument().replaceString(0, text.length(), newText);
+      }
+    });
+
+    doDoTest(true, false);
+  }
+
+  public void testXHtmlEditorHighlighting() throws Exception {
+    //                       10
+    //             0123456789012
+    String text = "<html></html>";
+    EditorHighlighter xhtmlHighlighter = HighlighterFactory.createHighlighter(StdFileTypes.XHTML,EditorColorsManager.getInstance().getGlobalScheme(),myProject);
+    xhtmlHighlighter.setText(text);
+    HighlighterIterator iterator = xhtmlHighlighter.createIterator(1);
+    assertSame("Xml tag name", iterator.getTokenType(), XmlTokenType.XML_TAG_NAME);
+    iterator = xhtmlHighlighter.createIterator(8);
+    assertSame("Xml tag name at end of tag", iterator.getTokenType(), XmlTokenType.XML_TAG_NAME);
+
+  }
+
+  public void testSchemaValidation6() throws Exception {
+    String location = getTestName(false)+".xsd";
+    String url = "aaa";
+    ExternalResourceManagerImpl.registerResourceTemporarily(url, location, getTestRootDisposable());
+    configureByFiles(null, getVirtualFile(getFullRelativeTestName()), getVirtualFile(BASE_PATH + location));
+
+    doDoTest(true,false);
+
+  }
+
+  public void testDTDEditorHighlighting() throws Exception {
+    //                       10        20
+    //             012345678901234567890 123456 789
+    String text = "<!ENTITY % Charsets \"CDATA\">";
+    EditorHighlighter dtdHighlighter = HighlighterFactory.createHighlighter(StdFileTypes.DTD,EditorColorsManager.getInstance().getGlobalScheme(),myProject);
+    dtdHighlighter.setText(text);
+    HighlighterIterator iterator = dtdHighlighter.createIterator(3);
+
+    assertSame("Xml entity name", iterator.getTokenType(), XmlTokenType.XML_ENTITY_DECL_START);
+    iterator = dtdHighlighter.createIterator(13);
+    assertSame("Xml name in dtd", iterator.getTokenType(), XmlTokenType.XML_NAME);
+    iterator = dtdHighlighter.createIterator(23);
+    assertSame("Xml attribute value in dtd", iterator.getTokenType(), XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN);
+
+    //                10        20        30        40
+    //      0123456789012345678901 2345678901234567890123456789
+    text = "<!ELEMENT base EMPTY>\n<!ATTLIST base id ID #IMPLIED>";
+    dtdHighlighter.setText(text);
+    iterator = dtdHighlighter.createIterator(3);
+    assertSame("Xml element name", iterator.getTokenType(), XmlTokenType.XML_ELEMENT_DECL_START);
+    iterator = dtdHighlighter.createIterator(25);
+    assertSame("Xml attr list", iterator.getTokenType(), XmlTokenType.XML_ATTLIST_DECL_START);
+
+    iterator = dtdHighlighter.createIterator(14);
+    assertSame("Xml attr list", iterator.getTokenType(), TokenType.WHITE_SPACE);
+
+    iterator = dtdHighlighter.createIterator(21);
+    assertSame("Xml attr list", iterator.getTokenType(), TokenType.WHITE_SPACE);
+
+    //                10        20        30        40        50        60
+    //      0123456789012345678901234567890123456789012345678901234567890123456789
+    text = "<![%sgml;[<![IGNORE[<![ INCLUDE [<!ENTITY % aaa SYSTEM 'zzz'>]]>]]>]]>";
+
+    dtdHighlighter.setText(text);
+    iterator = dtdHighlighter.createIterator(2);
+    assertEquals("Xml conditional section start",XmlTokenType.XML_CONDITIONAL_SECTION_START,iterator.getTokenType());
+
+    iterator = dtdHighlighter.createIterator(67);
+    assertEquals("Xml conditional section end",XmlTokenType.XML_CONDITIONAL_SECTION_END,iterator.getTokenType());
+
+    iterator = dtdHighlighter.createIterator(5);
+    assertEquals("entity ref in conditional section",XmlTokenType.XML_ENTITY_REF_TOKEN,iterator.getTokenType());
+
+    iterator = dtdHighlighter.createIterator(15);
+    assertEquals("ignore in conditional section",XmlTokenType.XML_CONDITIONAL_IGNORE,iterator.getTokenType());
+
+    iterator = dtdHighlighter.createIterator(27);
+    assertEquals("include in conditional section",XmlTokenType.XML_CONDITIONAL_INCLUDE,iterator.getTokenType());
+
+    iterator = dtdHighlighter.createIterator(9);
+    assertEquals("markup start in conditional section",XmlTokenType.XML_MARKUP_START,iterator.getTokenType());
+
+    iterator = dtdHighlighter.createIterator(33);
+    assertEquals("entity decl start in conditional section",XmlTokenType.XML_ENTITY_DECL_START,iterator.getTokenType());
+
+    //                10        20          30         40        50        60         70
+    //      012345678901234567890123 456789 0 123456789012345678901234567890123456 7890123456789
+    text = "<!ENTITY % ContentType \"CDATA\"\n    -- media type, as per [RFC2045]\n    -- --xxx-->";
+    dtdHighlighter.setText(text);
+    iterator = dtdHighlighter.createIterator(35);
+    assertEquals("Dtd comment start",XmlTokenType.XML_COMMENT_START,iterator.getTokenType());
+    iterator = dtdHighlighter.createIterator(40);
+    assertEquals("Dtd comment content",XmlTokenType.XML_COMMENT_CHARACTERS,iterator.getTokenType());
+    iterator = dtdHighlighter.createIterator(71);
+    assertEquals("Dtd comment end",XmlTokenType.XML_COMMENT_END,iterator.getTokenType());
+    
+    iterator = dtdHighlighter.createIterator(78);
+    assertEquals("Dtd comment content",XmlTokenType.XML_COMMENT_CHARACTERS,iterator.getTokenType());
+  }
+
+  public void testSgmlDTD() throws Exception {
+    doTest(getFullRelativeTestName(".dtd"), true, false);
+  }
+
+  public void testImportProblems() throws Exception {
+    final String testName = getTestName(false);
+    configureByFiles(
+      null,
+      BASE_PATH + testName +".xsd",
+      BASE_PATH +testName +"2.xsd"
+    );
+    doDoTest(true, false, true);
+  }
+
+  public void testEncoding() throws Exception { doTest(true); }
+
+  public void testSchemaImportHighlightingAndResolve() throws Exception {
+    doTestWithLocations(new String[][] { {"http://www.springframework.org/schema/beans", "ComplexSchemaValidation11.xsd"} },"xsd");
+  }
+
+  public void testDocBookV5() throws Exception {
+    doTestWithLocations(
+      new String[][] {
+        {"http://docbook.org/ns/docbook", "DocBookV5.xsd"},
+        {"http://www.w3.org/1999/xlink", "xlink.xsd"},
+        {"http://www.w3.org/XML/1998/namespace", "xml.xsd"}
+      },
+      "xml"
+    );
+
+    doTestWithLocations(
+      new String[][] {
+        {"http://www.w3.org/1999/xlink", "xlink.xsd"},
+        {"http://www.w3.org/XML/1998/namespace", "xml.xsd"}
+      },
+      "xsd"
+    );
+  }
+
+  @HighlightingFlags(HighlightingFlag.SkipExternalValidation)
+  public void testDocBook5() throws Exception {
+    doTestWithLocations(
+      new String[][] {
+        {"http://docbook.org/ns/docbook", "DocBookV5.xsd"},
+        {"http://www.w3.org/1999/xlink", "xlink.xsd"},
+        {"http://www.w3.org/XML/1998/namespace", "xml.xsd"}
+      },
+      "xml"
+    );
+  }
+
+  public void testCorrectGeneratedDtdUpdate() throws Exception {
+    configureByFile(BASE_PATH + getTestName(false) + ".xml");
+    Collection<HighlightInfo> infos = filterInfos(doHighlighting());
+    assertEquals(2, infos.size());
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        EditorModificationUtil.deleteSelectedText(myEditor);
+      }
+    });
+
+    infos = filterInfos(doHighlighting());
+
+    assertEquals(11, infos.size());
+
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        EditorModificationUtil.insertStringAtCaret(myEditor, "<");
+      }
+    });
+
+    new CodeCompletionHandlerBase(CompletionType.BASIC).invokeCompletion(myProject, myEditor);
+    infos = filterInfos(doHighlighting());
+    assertEquals(2, infos.size());
+    LookupManager.getInstance(myProject).hideActiveLookup();
+  }
+
+  private static Collection<HighlightInfo> filterInfos(final Collection<HighlightInfo> highlightInfos) {
+    for(Iterator<HighlightInfo> i = highlightInfos.iterator(); i.hasNext();) {
+      final HighlightInfo highlightInfo = i.next();
+      if (highlightInfo.getSeverity() == HighlightSeverity.INFORMATION) i.remove();
+    }
+    return highlightInfos;
+  }
+
+  public void testUsingSchemaDtd() throws Exception {
+    doTestWithLocations(null, "xsd");
+  }
+
+  @HighlightingFlags(HighlightingFlag.SkipExternalValidation)
+  public void testDtdElementRefs() throws Exception {
+    doTestWithLocations(
+      new String[] [] {
+        {"http://example.com/persistence","XIncludeTestSchema.xsd"}
+      },
+      "xml"
+    );
+  }
+
+  public void testDuplicates() throws Exception {
+    doTestWithLocations(null, "xsd");
+    doTestWithLocations(null, "dtd");
+    doTestWithLocations(null, "xml");
+  }
+
+  public void testMinMaxOccursInSchema() throws Exception {
+    doTestWithLocations(null, "xsd");
+  }
+
+  public void testXslt2() throws Exception {
+    doTestWithLocations(null, "xsl");
+  }
+
+  public void testDefaultAndFixedInSchema() throws Exception {
+    doTestWithLocations(null, "xsd");
+  }
+
+  public void testAnyAttributesInAttrGroup() throws Exception {
+    doTestWithLocations(
+      new String[] [] {
+        {"http://www.foo.org/test",getTestName(false)+".xsd"},
+        {"http://www.bar.org/test",getTestName(false)+"_2.xsd"}
+      },
+      "xml"
+    );
+  }
+
+  public void testXInclude() throws Exception {
+    final String testName = getTestName(false);
+    configureByFiles(
+      null,
+      BASE_PATH + testName +".xml",
+      BASE_PATH +testName +"-inc.xml",
+      BASE_PATH +testName +"TestSchema.xsd"
+    );
+    ApplicationManager.getApplication().runWriteAction(new Runnable() {
+      public void run() {
+        ExternalResourceManagerEx.getInstanceEx().addIgnoredResource("oxf:/apps/somefile.xml");
+      }
+    });
+
+    doDoTest(true, false, true);
+
+    VirtualFile[] includedFiles = FileIncludeManager.getManager(getProject()).getIncludedFiles(getFile().getVirtualFile(), true);
+    assertEquals(1, includedFiles.length);
+  }
+
+  public void testComplexRedefine() throws Exception {
+    final String[][] urls = {
+      {"http://graphml.graphdrawing.org/xmlns","graphml.xsd"},
+      {"http://graphml.graphdrawing.org/xmlns/1.0/graphml-structure.xsd","graphml-structure.xsd"},
+      {"http://www.w3.org/1999/xlink","xlink.xsd"}
+    };
+    doSchemaTestWithManyFilesFromSeparateDir(urls, null);
+  }
+
+  public void testComplexRedefine2() throws Exception {
+    final String[][] urls = {
+      {"http://www.yworks.com/xml/schema/graphml/1.0/ygraphml.xsd","ygraphml.xsd"},
+      {"http://graphml.graphdrawing.org/xmlns/1.0/xlink.xsd","xlink.xsd"}
+    };
+    doSchemaTestWithManyFilesFromSeparateDir(urls, null);
+  }
+
+  public void testMuleConfigHighlighting() throws Exception {
+    final String[][] urls = {
+      {"http://www.springframework.org/schema/beans/spring-beans-2.0.xsd", "spring-beans-2.0.xsd"},
+      {"http://www.springframework.org/schema/tool", "spring-tool-2.5.xsd"},
+      {"http://www.springframework.org/schema/context/spring-context-2.5.xsd", "spring-context-2.5.xsd"},
+      {"urn:xxx","mule.xsd"},
+      {"urn:yyy","mule-management.xsd"}
+    };
+    doTestWithLocations(urls, "xml");
+  }
+
+  public void testMuleConfigHighlighting2() throws Exception {
+    String path = getTestName(false) + File.separatorChar;
+    final String[][] urls = {
+      {"http://www.springframework.org/schema/beans/spring-beans-2.0.xsd", "spring-beans-2.0.xsd"},
+      {"http://www.springframework.org/schema/tool", "spring-tool-2.5.xsd"},
+      {"http://www.springframework.org/schema/context/spring-context-2.5.xsd", "spring-context-2.5.xsd"},
+      {"http://www.mulesource.org/schema/mule/core/2.2",path + "mule2_2.xsd"},
+      {"http://www.mulesource.org/schema/mule/cxf/2.2",path + "mule2_2-cxf.xsd"},
+      {"http://cxf.apache.org/core",path + "cxf_core.xsd"},
+      {"http://cxf.apache.org/configuration/beans",path + "cxf-beans.xsd"},
+      {"http://www.mulesource.org/schema/mule/schemadoc/2.2",path + "mule2_2-schemadoc.xsd"}
+    };
+    doTestWithLocations(urls, "xml");
+  }
+
+  @Override
+  protected boolean clearModelBeforeConfiguring() {
+    return "testComplexRedefine3".equals(getName());
+  }
+
+  public void testComplexRedefine3() throws Exception {
+    final String testName = getTestName(false);
+
+    VirtualFile[] files = {getVirtualFile(BASE_PATH + testName + "_2.xsd"), getVirtualFile(BASE_PATH + testName + "_3.xsd")};
+    doTest(files, true, false);
+
+    files = new VirtualFile[] {getVirtualFile(BASE_PATH + testName + ".xsd"),
+      getVirtualFile(BASE_PATH + testName + "_2.xsd"), getVirtualFile(BASE_PATH + testName + "_3.xsd")};
+    doTest(files, true, false);
+  }
+
+  public void testComplexRedefine4() throws Exception {
+    final String testName = getTestName(false);
+    VirtualFile[] files = {getVirtualFile(BASE_PATH + testName + ".xml"),
+      getVirtualFile(BASE_PATH + testName + ".xsd"), getVirtualFile(BASE_PATH + testName + "_2.xsd")};
+    doTest(files, true, false);
+  }
+
+  public void testComplexRedefine5() throws Exception {
+    final String testName = getTestName(false);
+    String[][] urls = {
+      {"http://extended", testName + ".xsd"},
+      {"http://simple", testName + "_2.xsd"}
+    };
+    doTestWithLocations(urls,"xml");
+  }
+
+  public void testComplexRedefine6() throws Exception {
+    final String testName = getTestName(false);
+    String[][] urls = {
+      {"urn:jboss:bean-deployer:2.0", testName + ".xsd"},
+      {null, testName + "_2.xsd"}
+    };
+    doTestWithLocations(urls,"xml");
+  }
+
+  public void testRedefineQualifiedType() throws Exception {
+    final String testName = getTestName(false);
+    VirtualFile[] files = {
+      getVirtualFile(BASE_PATH + testName + ".xml"),
+      getVirtualFile(BASE_PATH + testName + ".xsd"),
+      getVirtualFile(BASE_PATH + testName + "_2.xsd")
+    };
+    doTest(files, true, false);
+  }
+
+  public void testRedefineBaseType() throws Exception {
+    final String testName = getTestName(false);
+    VirtualFile[] files = {
+      getVirtualFile(BASE_PATH + testName + ".xml"),
+      getVirtualFile(BASE_PATH + testName + ".xsd"),
+      getVirtualFile(BASE_PATH + testName + "_2.xsd")
+    };
+    doTest(files, true, false);
+  }
+
+  public void testComplexSchemaValidation18() throws Exception {
+    final String testName = getTestName(false);
+    doTest(
+      new VirtualFile[] {
+        getVirtualFile(BASE_PATH + testName + ".xml"),
+        getVirtualFile(BASE_PATH + testName + ".xsd"),
+        getVirtualFile(BASE_PATH + testName + "_2.xsd")
+      },
+      true,
+      false
+    );
+  }
+
+  public void testComplexSchemaValidation19() throws Exception {
+    final String testName = getTestName(false);
+    doTest(
+      new VirtualFile[] {
+        getVirtualFile(BASE_PATH + testName + ".xml"),
+        getVirtualFile(BASE_PATH + testName + ".xsd"),
+        getVirtualFile(BASE_PATH + testName + "_2.xsd")
+      },
+      true,
+      false
+    );
+  }
+
+  public void testComplexSchemaValidation20() throws Exception {
+    final String testName = getTestName(false);
+    doTest(
+      new VirtualFile[] {
+        getVirtualFile(BASE_PATH + testName + ".xml"),
+        getVirtualFile(BASE_PATH + testName + ".xsd"),
+        getVirtualFile(BASE_PATH + testName + "_2.xsd")
+      },
+      true,
+      false
+    );
+  }
+
+  public void testSubstitutionFromInclude() throws Exception {
+    ExternalResourceManagerImpl
+        .registerResourceTemporarily("http://www.omg.org/spec/BPMN/20100524/MODEL", "BPMN20.xsd", getTestRootDisposable());
+
+    doTest(
+      new VirtualFile[] {
+        getVirtualFile(BASE_PATH + "FinancialReportProcess.bpmn20.xml"),
+        getVirtualFile(BASE_PATH + "BPMN20.xsd"),
+        getVirtualFile(BASE_PATH + "Semantic.xsd")
+      },
+      true,
+      false
+    );
+  }
+
+  public void testComplexRedefineFromJar() throws Exception {
+    String[][] urls = null;
+
+    configureByFiles(null,BASE_PATH + getTestName(false) + ".xml", BASE_PATH + "mylib.jar");
+    String path = myFile.getVirtualFile().getParent().getPath() + "/";
+    urls = new String[][] {
+      {"http://graphml.graphdrawing.org/xmlns",path + "mylib.jar!/graphml.xsd"},
+      {"http://graphml.graphdrawing.org/xmlns/1.0/graphml-structure.xsd",path + "mylib.jar!/graphml-structure.xsd"},
+      {"http://www.w3.org/1999/xlink",path + "mylib.jar!/xlink.xsd"}
+    };
+
+    for(String[] s:urls) ExternalResourceManagerImpl.registerResourceTemporarily(s[0], s[1], getTestRootDisposable());
+    doDoTest(true, false);
+  }
+
+  public void testChangeRootElement() throws Exception {
+    enableInspectionTool(new XmlWrongRootElementInspection());
+    final String testName = getTestName(false);
+    configureByFile(BASE_PATH + testName + ".xml");
+    Collection<HighlightInfo> infos = doDoTest(true, false);
+
+    findAndInvokeIntentionAction(infos, "Change Root Tag Name to xxx", myEditor, myFile);
+    checkResultByFile(BASE_PATH + testName+"_after.xml");
+  }
+
+  public void testUnqualifiedAttributePsi() throws Exception {
+    doTestWithLocations(null, "xml");
+    final List<XmlAttribute> attrs = new ArrayList<XmlAttribute>(2);
+
+    myFile.acceptChildren(new XmlRecursiveElementVisitor() {
+      @Override public void visitXmlAttribute(final XmlAttribute attribute) {
+        if (!attribute.isNamespaceDeclaration()) attrs.add(attribute);
+      }
+    });
+
+    assertEquals(4,attrs.size());
+    checkAttribute(attrs.get(0), "");
+    checkAttribute(attrs.get(1), "foo2");
+    checkAttribute(attrs.get(2), "");
+    checkAttribute(attrs.get(3), "foo4");
+  }
+
+  private static void checkAttribute(final XmlAttribute xmlAttribute, String expectedNs) {
+    final String attrNs = xmlAttribute.getNamespace();
+    assertEquals(expectedNs, attrNs);
+    final XmlTag parent = xmlAttribute.getParent();
+
+    assertEquals(parent.getAttribute(xmlAttribute.getLocalName(), attrNs), xmlAttribute);
+    //final String parentNs = parent.getNamespace();
+    //if (!parentNs.equals(attrNs)) assertNull(parent.getAttribute(xmlAttribute.getLocalName(), parentNs));
+    assertEquals(parent.getAttributeValue(xmlAttribute.getLocalName(), attrNs), xmlAttribute.getValue());
+    //if (!parentNs.equals(attrNs)) assertNull(parent.getAttributeValue(xmlAttribute.getLocalName(), parentNs));
+  }
+
+  @HighlightingFlags({HighlightingFlag.SkipExternalValidation})
+  public void testHighlightWhenNoNsSchemaLocation() throws Exception {
+    final String testName = getTestName(false);
+
+    doTest(
+      new VirtualFile[] {
+        getVirtualFile(BASE_PATH + testName + ".xml"),
+        getVirtualFile(BASE_PATH + testName + ".xsd")
+      },
+      true,
+      false
+    );
+  }
+
+  public void testSchemaAutodetection() throws Exception {
+    doTest(
+      new VirtualFile[] {
+        getVirtualFile(BASE_PATH + "SchemaAutodetection/policy.xml"),
+        getVirtualFile(BASE_PATH + "SchemaAutodetection/cs-xacml-schema-policy-01.xsd"),
+        getVirtualFile(BASE_PATH + "SchemaAutodetection/cs-xacml-schema-context-01.xsd")
+      },
+      true,
+      false
+    );
+  }
+
+  public void testDtdAutodetection() throws Exception {
+    doTest(
+      new VirtualFile[] {
+        getVirtualFile(BASE_PATH + "nuancevoicexml-2-0.xml"),
+        getVirtualFile(BASE_PATH + "nuancevoicexml-2-0.dtd")
+      },
+      true,
+      false
+    );
+  }
+
+  public void testSchemaWithXmlId() throws Exception {
+    final String testName = getTestName(false);
+
+    doTest(
+      new VirtualFile[] {
+        getVirtualFile(BASE_PATH + testName + ".xml")
+      },
+      true,
+      false
+    );
+  }
+
+  public void testProblemWithImportedNsReference() throws Exception {
+    doTestWithLocations(null,"xsd");
+  }
+
+  public void testBadXmlns() throws Exception {
+    configureByFile(BASE_PATH + "badXmlns.xml");
+    doHighlighting();
+  }
+
+  public void testProblemWithMemberTypes() throws Exception {
+    doTestWithLocations(null,"xsd");
+  }
+
+  public void testDtdHighlighting() throws Exception {
+    final String testName = getTestName(false);
+
+    doTestWithLocations(
+      new String[][] {
+        {"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlstyle-1.mod",testName + ".mod"}
+      },
+      "dtd"
+    );
+  }
+
+  public void testNoNamespaceLocation() throws Exception {
+    final String testName = getTestName(false);
+
+    doTest(
+      new VirtualFile[] {
+        getVirtualFile(BASE_PATH + testName + ".xml"),
+        getVirtualFile(BASE_PATH + testName + ".xsd")
+      },
+      true,
+      false
+    );
+  }
+
+  public void testUnresolvedSymbolForForAttribute() throws Exception {
+    doTest();
+  }
+
+  public void testXsiType() throws Exception {
+    final String testName = getTestName(false);
+
+    doTest(
+      new VirtualFile[] {
+        getVirtualFile(BASE_PATH + testName + ".xml"),
+        getVirtualFile(BASE_PATH + testName + "_TypesV1.00.xsd"),
+        getVirtualFile(BASE_PATH + testName + "_ActivationRequestV1.00.xsd"),
+        getVirtualFile(BASE_PATH + testName + "_GenericActivationRequestV1.00.xsd")
+      },
+      true,
+      false
+    );
+  }
+
+  public void testMappedSchemaLocation() throws Exception {
+    doTestWithLocations(new String[][]{
+      { "schemas/Forms.xsd", "Forms.xsd"}
+    }, "xml");
+  }
+
+  public void testMuleConfigValidation() throws Exception {
+    doSchemaTestWithManyFilesFromSeparateDir(
+      new String[][] {
+        {"http://www.springframework.org/schema/tool", "spring-tool-2.5.xsd"},
+        {"http://www.springframework.org/schema/beans/spring-beans-2.5.xsd", "spring-beans-2.5.xsd"},
+        {"http://www.mulesource.org/schema/mule/core/2.2/mule.xsd", "mule.xsd"},
+        {"http://www.mulesource.org/schema/mule/stdio/2.2/mule-stdio.xsd", "mule-stdio.xsd"},
+        {"http://www.springframework.org/schema/context/spring-context-2.5.xsd", "spring-context-2.5.xsd"},
+        {"http://www.mulesource.org/schema/mule/schemadoc/2.2/mule-schemadoc.xsd", "mule-schemadoc.xsd"},
+      },
+      null
+    );
+  }
+
+  public void testMobileHtml() throws Exception {
+    enableInspectionTool(new HtmlUnknownTagInspection());
+    doTest(getFullRelativeTestName(".html"), true, true);
+  }
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+    if (!getTestName(false).equals("DoctypeWithoutSchema2")) enableInspectionTool(new CheckXmlFileWithXercesValidatorInspection());
+
+    old = XmlSettings.getInstance().SHOW_XML_ADD_IMPORT_HINTS;
+    XmlSettings.getInstance().SHOW_XML_ADD_IMPORT_HINTS = false;
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://www.springframework.org/schema/beans/spring-beans-2.5.xsd",
+                                                            getTestDataPath() + BASE_PATH + "spring-beans-2.5.xsd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd",
+                                                            getTestDataPath() + BASE_PATH + "web-app_2_4.xsd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd",
+                                                            getTestDataPath() + BASE_PATH + "web-app_2_4.xsd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/dtd/web-app_2_3.dtd",
+                                                            getTestDataPath() + BASE_PATH + "web-app_2_3.dtd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://struts.apache.org/dtds/struts-config_1_2.dtd",
+                                                            getTestDataPath() + BASE_PATH + "struts-config_1_2.dtd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/dtd/ejb-jar_2_0.dtd",
+                                                            getTestDataPath() + BASE_PATH + "ejb-jar_2_0.dtd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://schemas.xmlsoap.org/wsdl/",
+                                                            getTestDataPath() + BASE_PATH + "wsdl11.xsd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://schemas.xmlsoap.org/wsdl/soap/",
+                                                            getTestDataPath() + BASE_PATH + "wsdl11_soapbinding.xsd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://schemas.xmlsoap.org/soap/encoding/",
+                                                            getTestDataPath() + BASE_PATH + "soap-encoding.xsd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd",
+                                                            getTestDataPath() + BASE_PATH + "application-client_1_4.xsd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd",
+                                                            getTestDataPath() + BASE_PATH + "hibernate-mapping-3.0.dtd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://maven.apache.org/maven-v4_0_0.xsd",
+                                                            getTestDataPath() + BASE_PATH + "maven-4.0.0.xsd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd",
+                                                            getTestDataPath() + BASE_PATH + "web-jsptaglibrary_1_2.dtd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/JSP/Page",
+                                                            getTestDataPath() + BASE_PATH + "jsp_2_0.xsd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd",
+                                                            getTestDataPath() + BASE_PATH + "web-jsptaglibrary_2_0.xsd",
+                                                            getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd",
+                                                            getTestDataPath() + BASE_PATH + "hibernate-configuration-3.0.dtd",
+                                                            getTestRootDisposable());
+  }
+
+  private void disableHtmlSupport() {
+    final ExternalResourceManagerEx manager = ExternalResourceManagerEx.getInstanceEx();
+    myOldDoctype = manager.getDefaultHtmlDoctype(getProject());
+    manager.setDefaultHtmlDoctype("fake", getProject());
+  }
+
+  private void enableHtmlSupport() {
+    ExternalResourceManagerEx.getInstanceEx().setDefaultHtmlDoctype(myOldDoctype, getProject());
+  }
+
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
+  }
+
+  @Override
+  protected void tearDown() throws Exception {
+    XmlSettings.getInstance().SHOW_XML_ADD_IMPORT_HINTS = old;
+    super.tearDown();
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/daemon/quickFix/ExtractExternalResourceLinksTest.java b/xml/tests/src/com/intellij/codeInsight/daemon/quickFix/ExtractExternalResourceLinksTest.java
new file mode 100644
index 0000000..85b1069
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/daemon/quickFix/ExtractExternalResourceLinksTest.java
@@ -0,0 +1,108 @@
+package com.intellij.codeInsight.daemon.quickFix;
+
+import com.intellij.codeInsight.CodeInsightTestCase;
+import com.intellij.codeInsight.daemon.impl.quickfix.FetchExtResourceAction;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.testFramework.PlatformTestUtil;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ExtractExternalResourceLinksTest extends CodeInsightTestCase {
+
+  protected static String getBasePath() {
+    return "/quickFix/fetchExternalResources";
+  }
+
+  public void testExtractionOfEmbeddedFiles() throws Exception {
+    doExtractionOfEmbeddedFiles(
+      "1.dtd",
+      new String[] {"xhtml-lat1.ent", "xhtml-symbol.ent", "xhtml-special.ent"}
+    );
+
+    doExtractionOfEmbeddedFiles(
+      "1.xsd",
+      new String[] {"j2ee_1_4.xsd", "jsp_2_0.xsd"}
+    );
+
+    doExtractionOfEmbeddedFiles(
+      new String[] { "2.dtd", "2.mod" },
+      new String[][] {
+        new String[] {"dbnotnx.mod", "dbcentx.mod", "dbpoolx.mod", "dbhierx.mod", "dbgenent.mod"},
+        new String[] {"htmltblx.mod", "calstblx.dtd"}
+      }
+    );
+
+    doExtractionOfEmbeddedFiles(
+      new String[] { "3.dtd"},
+      new String[][] {
+        new String[] {"onix-international.elt"}
+      }
+    );
+
+    doExtractionOfEmbeddedFiles(
+      "3.xsd",
+      new String[] {"j2ee_1_4.xsd", "jsp_2_0.xsd"}
+    );
+
+    doExtractionOfEmbeddedFiles(
+      "4.xml",
+      new String[] {
+        "http://www.springframework.org/schema/beans/spring-beans.xsd",
+        "http://www.springframework.org/schema/aop/spring-aop.xsd",
+        "http://www.springframework.org/schema/tx/spring-tx.xsd"
+      }
+    );
+
+    doExtractionOfEmbeddedFiles(
+      "5.xml",
+      new String[] {
+        "http://geronimo.apache.org/xml/ns/geronimo-naming-1.1.xsd",
+        "http://geronimo.apache.org/xml/ns/geronimo-security-1.1.xsd",
+        "http://geronimo.apache.org/xml/ns/geronimo-module-1.1.xsd"
+      }
+    );
+
+    doExtractionOfEmbeddedFiles(
+      "6.xml",
+      new String[] {
+        "http://jboss.com/products/seam/components-1.2.xsd"
+      }
+    );
+  }
+
+  private void doExtractionOfEmbeddedFiles(String shortFileName,String[] expectedFileNames) throws Exception {
+    doExtractionOfEmbeddedFiles(new String[] {shortFileName}, new String[][] {expectedFileNames} );
+  }
+
+  private void doExtractionOfEmbeddedFiles(String[] shortFileName,String[][] expectedFileNames) throws Exception {
+    final List<VirtualFile> files = new ArrayList<VirtualFile>(shortFileName.length);
+    for(String s:shortFileName) {
+      files.add(getVirtualFile( getBasePath() + "/"+ s ));
+    }
+
+    int fileIndex = 0;
+
+    for(String[] expectedFileNameArray:expectedFileNames) {
+      List<String> strings = FetchExtResourceAction.extractEmbeddedFileReferences(
+        files.get(fileIndex), fileIndex != 0? files.get(0): null, getPsiManager()
+      );
+
+      assertEquals(expectedFileNameArray.length,strings.size());
+      int index = 0;
+
+      for (final String string : strings) {
+        assertEquals(string, expectedFileNameArray[index]);
+        ++index;
+      }
+
+      fileIndex++;
+    }
+  }
+
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/daemon/quickFix/FetchExternalResourcesFixTest.java b/xml/tests/src/com/intellij/codeInsight/daemon/quickFix/FetchExternalResourcesFixTest.java
new file mode 100644
index 0000000..63d2142
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/daemon/quickFix/FetchExternalResourcesFixTest.java
@@ -0,0 +1,45 @@
+package com.intellij.codeInsight.daemon.quickFix;
+
+import com.intellij.codeInsight.daemon.impl.quickfix.FetchExtResourceAction;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.testFramework.PlatformTestUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.File;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ik
+ * Date: 03.09.2003
+ * Time: 19:32:51
+ * To change this template use Options | File Templates.
+ */
+public class FetchExternalResourcesFixTest extends LightQuickFixTestCase {
+  public void test() throws Exception { doAllTests(); }
+
+  @Override
+  protected String getBasePath() {
+    return "/quickFix/fetchExternalResources";
+  }
+
+  // just check for action availability
+  @Override
+  protected void doAction(String text, boolean actionShouldBeAvailable, String testFullPath, String testName) throws Exception {
+    IntentionAction action = findActionWithText(text);
+    if (action == null && actionShouldBeAvailable) {
+      fail("Action with text '" + text + "' is not available in test " + testFullPath);
+    }
+
+    if (actionShouldBeAvailable && testName.equals("5.xml")) {
+      final String uri = FetchExtResourceAction.findUri(myFile, myEditor.getCaretModel().getOffset());
+      final String url = FetchExtResourceAction.findUrl(myFile, myEditor.getCaretModel().getOffset(),uri);
+      assertEquals("http://www.springframework.org/schema/aop/spring-aop.xsd",url);
+    }
+  }
+
+  @NotNull
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/daemon/quickFix/IgnoreExternalResourcesFixTest.java b/xml/tests/src/com/intellij/codeInsight/daemon/quickFix/IgnoreExternalResourcesFixTest.java
new file mode 100644
index 0000000..8fd0277
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/daemon/quickFix/IgnoreExternalResourcesFixTest.java
@@ -0,0 +1,31 @@
+package com.intellij.codeInsight.daemon.quickFix;
+
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.testFramework.PlatformTestUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.File;
+
+public class IgnoreExternalResourcesFixTest extends LightQuickFixTestCase {
+  public void test() throws Exception { doAllTests(); }
+
+  @Override
+  protected String getBasePath() {
+    return "/quickFix/ignoreExternalResources";
+  }
+
+  // just check for action availability
+  @Override
+  protected void doAction(String text, boolean actionShouldBeAvailable, String testFullPath, String testName) throws Exception {
+    IntentionAction action = findActionWithText(text);
+    if (action == null && actionShouldBeAvailable) {
+      fail("Action with text '" + text + "' is not available in test " + testFullPath);
+    }
+  }
+
+  @NotNull
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/daemon/quickFix/ManuallySetupExternalResourcesFixTest.java b/xml/tests/src/com/intellij/codeInsight/daemon/quickFix/ManuallySetupExternalResourcesFixTest.java
new file mode 100644
index 0000000..9a479ec09
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/daemon/quickFix/ManuallySetupExternalResourcesFixTest.java
@@ -0,0 +1,31 @@
+package com.intellij.codeInsight.daemon.quickFix;
+
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.testFramework.PlatformTestUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.File;
+
+public class ManuallySetupExternalResourcesFixTest extends LightQuickFixTestCase {
+  public void test() throws Exception { doAllTests(); }
+
+  @Override
+  protected String getBasePath() {
+    return "/quickFix/manuallySetupExternalResources";
+  }
+
+  // just check for action availability
+  @Override
+  protected void doAction(String text, boolean actionShouldBeAvailable, String testFullPath, String testName) throws Exception {
+    IntentionAction action = findActionWithText(text);
+    if (action == null && actionShouldBeAvailable) {
+      fail("Action with text '" + text + "' is not available in test " + testFullPath);
+    }
+  }
+
+  @NotNull
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
+  }
+}
diff --git a/xml/tests/src/com/intellij/codeInsight/editorActions/moveUpDown/XmlMoverTest.java b/xml/tests/src/com/intellij/codeInsight/editorActions/moveUpDown/XmlMoverTest.java
new file mode 100644
index 0000000..e2621fa
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/editorActions/moveUpDown/XmlMoverTest.java
@@ -0,0 +1,71 @@
+package com.intellij.codeInsight.editorActions.moveUpDown;
+
+import com.intellij.codeInsight.CodeInsightTestCase;
+import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
+import com.intellij.testFramework.PlatformTestUtil;
+import org.jetbrains.annotations.NonNls;
+
+import java.io.File;
+
+/**
+ * @author spleaner
+ */
+@SuppressWarnings({"ALL"})
+public class XmlMoverTest extends CodeInsightTestCase {
+
+  public void testTag() throws Exception { doTest("xml"); }
+  public void testTag2() throws Exception { doTest("xml"); }
+  public void testTag3() throws Exception { doTest("xml"); }
+  public void testTag4() throws Exception { doTest("xml"); }
+  public void testTag5() throws Exception { doTest("xml"); }
+  public void testTag6() throws Exception { doTest("xml"); }
+  public void testTag7() throws Exception { doTest("xml"); }
+  public void testTag8() throws Exception { doTest("xml"); }
+  public void testTag9() throws Exception { doTest("xml"); }
+  public void testTag10() throws Exception { doTest("xml"); }
+  public void testTag11() throws Exception { doTest("xml"); }
+
+  public void testMultiLineTag() throws Exception { doTest("xml"); }
+
+  public void testRootTag() throws Exception { doTest("xml"); }
+  public void testRootTag1() throws Exception { doTest("xml"); }
+  public void testSingleTag() throws Exception { doTest("xml"); }
+  public void testMoveTag() throws Exception { doTest("xml"); }
+  public void testMoveTag1() throws Exception { doTest("xml"); }
+  public void testMoveTagWithEmptyLines() throws Exception { doTest("xml"); }
+
+  public void test1() throws Exception { doTest("html"); }
+
+
+  private void doTest(String ext) throws Exception {
+    final String baseName = getBasePath() + '/' + getTestName(true);
+    final String fileName = baseName + "."+ext;
+
+    @NonNls String afterFileName = baseName + "_afterUp." + ext;
+    EditorActionHandler handler = new MoveStatementUpAction().getHandler();
+    performAction(fileName, handler, afterFileName);
+
+    afterFileName = baseName + "_afterDown." + ext;
+    handler = new MoveStatementDownAction().getHandler();
+    performAction(fileName, handler, afterFileName);
+  }
+
+  private void performAction(final String fileName, final EditorActionHandler handler, final String afterFileName) throws Exception {
+    configureByFile(fileName);
+    final boolean enabled = handler.isEnabled(myEditor, null);
+    assertEquals("not enabled for " + afterFileName, new File(getTestDataPath(), afterFileName).exists(), enabled);
+    if (enabled) {
+      handler.execute(myEditor, null);
+      checkResultByFile(afterFileName);
+    }
+  }
+
+  protected String getBasePath() {
+    return "/mover";
+  }
+
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData";
+  }
+}
\ No newline at end of file
diff --git a/xml/tests/src/com/intellij/codeInsight/template/XmlLiveTemplateTest.groovy b/xml/tests/src/com/intellij/codeInsight/template/XmlLiveTemplateTest.groovy
new file mode 100644
index 0000000..6ae391d
--- /dev/null
+++ b/xml/tests/src/com/intellij/codeInsight/template/XmlLiveTemplateTest.groovy
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.codeInsight.template
+import com.intellij.codeInsight.CodeInsightSettings
+import com.intellij.codeInsight.template.impl.ConstantNode
+import com.intellij.codeInsight.template.impl.EmptyNode
+import com.intellij.codeInsight.template.impl.TemplateManagerImpl
+import com.intellij.codeInsight.template.impl.TemplateState
+import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
+/**
+ * @author peter
+ */
+public class XmlLiveTemplateTest extends LightCodeInsightFixtureTestCase {
+
+  private TemplateState getState() {
+    TemplateManagerImpl.getTemplateState(myFixture.getEditor())
+  }
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+    ((TemplateManagerImpl)TemplateManager.getInstance(getProject())).setTemplateTesting(true);
+  }
+
+  @Override
+  protected void tearDown() throws Exception {
+    CodeInsightSettings.instance.COMPLETION_CASE_SENSITIVE = CodeInsightSettings.FIRST_LETTER
+      ((TemplateManagerImpl)TemplateManager.getInstance(getProject())).setTemplateTesting(false);
+    if (state != null) {
+      state.gotoEnd();
+    }
+    super.tearDown();
+  }
+
+  public void "test tag template in xml"() {
+    final TemplateManager manager = TemplateManager.getInstance(getProject());
+    final Template template = manager.createTemplate("frm", "user", '$VAR$');
+    template.addVariable('VAR', new EmptyNode(), new ConstantNode("<"), true)
+    
+    myFixture.configureByText 'a.xml', '<tag><caret></tag>'
+    manager.startTemplate(myFixture.getEditor(), template);
+    myFixture.checkResult '<tag><selection><</selection><caret></tag>'
+  }
+  
+}
diff --git a/xml/tests/src/com/intellij/psi/formatter/XmlFormatterTestBase.java b/xml/tests/src/com/intellij/psi/formatter/XmlFormatterTestBase.java
new file mode 100644
index 0000000..7372754
--- /dev/null
+++ b/xml/tests/src/com/intellij/psi/formatter/XmlFormatterTestBase.java
@@ -0,0 +1,54 @@
+package com.intellij.psi.formatter;
+
+import com.intellij.psi.impl.source.xml.XmlFileImpl;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.application.ApplicationManager;
+
+/**
+ * @author yole
+ */
+public abstract class XmlFormatterTestBase extends XmlFormatterTestCase {
+  protected void checkFormattingDoesNotProduceException(String name) throws Exception {
+
+    String text = loadFile(name + ".xml", null);
+    final XmlFileImpl file = (XmlFileImpl)createFile(name + ".xml", text);
+    myTextRange = new TextRange(10000, 10001);
+    CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
+      @Override
+      public void run() {
+        ApplicationManager.getApplication().runWriteAction(new Runnable() {
+          @Override
+          public void run() {
+            performFormatting(file);
+          }
+        });
+      }
+    }, "", "");
+
+    myTextRange = new TextRange(1000000, 1000001);
+    CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
+      @Override
+      public void run() {
+        ApplicationManager.getApplication().runWriteAction(new Runnable() {
+          @Override
+          public void run() {
+            performFormatting(file);
+          }
+        });
+      }
+    }, "", "");
+    myTextRange = new TextRange(0, text.length());
+    CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
+      @Override
+      public void run() {
+        ApplicationManager.getApplication().runWriteAction(new Runnable() {
+          @Override
+          public void run() {
+            performFormatting(file);
+          }
+        });
+      }
+    }, "", "");
+  }
+}
diff --git a/xml/tests/src/com/intellij/psi/formatter/XmlFormatterTestCase.java b/xml/tests/src/com/intellij/psi/formatter/XmlFormatterTestCase.java
new file mode 100644
index 0000000..70cd879
--- /dev/null
+++ b/xml/tests/src/com/intellij/psi/formatter/XmlFormatterTestCase.java
@@ -0,0 +1,25 @@
+package com.intellij.psi.formatter;
+
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.formatter.xml.XmlCodeStyleSettings;
+
+/**
+ * @author peter
+ */
+public abstract class XmlFormatterTestCase extends FormatterTestCase{
+
+  public void testDontKeepLineBreaksInText() throws Throwable {
+    final CodeStyleSettings settings = getSettings();
+    final XmlCodeStyleSettings xmlSettings = settings.getCustomSettings(XmlCodeStyleSettings.class);
+    settings.RIGHT_MARGIN = 15;
+
+    settings.HTML_KEEP_LINE_BREAKS_IN_TEXT = false;
+    xmlSettings.XML_KEEP_LINE_BREAKS_IN_TEXT = false;
+    doTextTest("<tag>aaa\nbbb\nccc\nddd\n</tag>", "<tag>aaa bbb\n    ccc ddd\n</tag>");
+
+    settings.HTML_TEXT_WRAP = CodeStyleSettings.DO_NOT_WRAP;
+    xmlSettings.XML_TEXT_WRAP = CodeStyleSettings.DO_NOT_WRAP;
+    doTextTest("<tag>aaa\nbbb\nccc\nddd\n</tag>", "<tag>aaa bbb ccc ddd\n</tag>");
+  }
+
+}
diff --git a/xml/tests/src/com/intellij/xml/XMLCatalogManagerTest.java b/xml/tests/src/com/intellij/xml/XMLCatalogManagerTest.java
new file mode 100644
index 0000000..445c23a
--- /dev/null
+++ b/xml/tests/src/com/intellij/xml/XMLCatalogManagerTest.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.codeInsight.daemon.impl.HighlightInfo;
+import com.intellij.javaee.ExternalResourceManagerEx;
+import com.intellij.javaee.XMLCatalogConfigurable;
+import com.intellij.javaee.XMLCatalogManager;
+import com.intellij.testFramework.IdeaTestCase;
+import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
+import org.apache.xml.resolver.CatalogManager;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.util.List;
+import java.util.Vector;
+
+/**
+ * @author Dmitry Avdeev
+ *         Date: 7/20/12
+ */
+@SuppressWarnings("UseOfObsoleteCollectionType")
+public class XMLCatalogManagerTest extends LightPlatformCodeInsightFixtureTestCase {
+
+  public void testCatalogManager() throws Exception {
+    XMLCatalogManager manager = getManager();
+    CatalogManager catalogManager = manager.getManager();
+    Vector files = catalogManager.getCatalogFiles();
+    assertEquals(1, files.size());
+    String filePath = (String)files.get(0);
+    assertTrue(filePath, filePath.endsWith("catalog.xml"));
+    assertTrue(filePath, new File(new URI(filePath)).exists());
+  }
+
+  public void testResolvePublic() throws Exception {
+    String resolve = getManager().resolve("-//W3C//DTD XHTML 1.0 Strict//EN");
+    assertNotNull(resolve);
+    assertTrue(resolve, resolve.endsWith("/catalog/xhtml1-strict.dtd"));
+  }
+
+  public void testResolveSystem() throws Exception {
+    String resolve = getManager().resolve("http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd");
+    assertNotNull(resolve);
+    assertTrue(resolve, resolve.endsWith("/catalog/xhtml1-strict.dtd"));
+  }
+
+  public void testHighlighting() {
+    myFixture.configureByFile("policy.xml");
+    List<HighlightInfo> infos = myFixture.doHighlighting();
+    assertEquals("urn:oasis:names:tc:xacml:1.0:policy", infos.get(0).text);
+  }
+
+  public void testFixedHighlighting() throws Exception {
+    myFixture.configureByFile("policy.xml");
+    try {
+      ExternalResourceManagerEx.getInstanceEx().setCatalogPropertiesFile(getTestDataPath() + "catalog.properties");
+      List<HighlightInfo> infos = myFixture.doHighlighting();
+      assertEquals(infos.toString(), 0, infos.size());
+    }
+    finally {
+      ExternalResourceManagerEx.getInstanceEx().setCatalogPropertiesFile(null);
+    }
+  }
+
+  public void testConfigurable() throws Exception {
+    assertFalse(new XMLCatalogConfigurable().isModified());
+  }
+
+  private XMLCatalogManager getManager() throws IOException {
+    return new XMLCatalogManager(getTestDataPath() + "catalog.properties");
+  }
+
+  @Override
+  protected boolean isWriteActionRequired() {
+    return false;
+  }
+
+  @Override
+  protected String getBasePath() {
+    return "/xml/tests/testData/catalog/";
+  }
+
+  @Override
+  protected boolean isCommunity() {
+    return true;
+  }
+
+  @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
+  public XMLCatalogManagerTest() {
+    IdeaTestCase.initPlatformPrefix();
+  }
+}
diff --git a/xml/tests/src/com/intellij/xml/XmlConstraintsTest.java b/xml/tests/src/com/intellij/xml/XmlConstraintsTest.java
new file mode 100644
index 0000000..98b5cab
--- /dev/null
+++ b/xml/tests/src/com/intellij/xml/XmlConstraintsTest.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.xml.XmlTag;
+import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.Convertor;
+import com.intellij.xml.actions.ValidateXmlActionHandler;
+import org.apache.xerces.impl.Constants;
+import org.apache.xerces.impl.xs.XSComplexTypeDecl;
+import org.apache.xerces.impl.xs.XSElementDecl;
+import org.apache.xerces.impl.xs.models.CMBuilder;
+import org.apache.xerces.impl.xs.models.CMNodeFactory;
+import org.apache.xerces.impl.xs.models.XSCMValidator;
+import org.apache.xerces.xni.grammars.Grammar;
+import org.apache.xerces.xni.grammars.XMLGrammarDescription;
+import org.apache.xerces.xni.grammars.XMLGrammarPool;
+import org.apache.xerces.xni.grammars.XSGrammar;
+import org.apache.xerces.xs.XSComplexTypeDefinition;
+import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSModel;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.Vector;
+
+/**
+ * @author Dmitry Avdeev
+ */
+@SuppressWarnings({"UseOfObsoleteCollectionType"})
+public class XmlConstraintsTest extends CodeInsightFixtureTestCase {
+
+  public void testXercesGrammar() throws Exception {
+    XSModel xsModel = getXSModel("test.xml", "test.xsd");
+    XSElementDeclaration elementDeclaration = xsModel.getElementDeclaration("a", "");
+    XSComplexTypeDefinition typeDefinition = (XSComplexTypeDefinition)elementDeclaration.getTypeDefinition();
+    CMBuilder cmBuilder = new CMBuilder(new CMNodeFactory());
+    XSCMValidator validator = cmBuilder.getContentModel((XSComplexTypeDecl)typeDefinition, true);
+    int[] ints = validator.startContentModel();
+    Vector vector = validator.whatCanGoHere(ints);
+    XSElementDecl o = (XSElementDecl)vector.get(0);
+    assertEquals("b", o.getName());
+  }
+
+  public void testXercesIncomplete() throws Exception {
+    XSModel xsModel = getXSModel("testIncomplete.xml", "test.xsd");
+    XSElementDeclaration elementDeclaration = xsModel.getElementDeclaration("a", "");
+    XSComplexTypeDefinition typeDefinition = (XSComplexTypeDefinition)elementDeclaration.getTypeDefinition();
+    CMBuilder cmBuilder = new CMBuilder(new CMNodeFactory());
+    XSCMValidator validator = cmBuilder.getContentModel((XSComplexTypeDecl)typeDefinition, true);
+    int[] ints = validator.startContentModel();
+    Vector vector = validator.whatCanGoHere(ints);
+    XSElementDecl o = (XSElementDecl)vector.get(0);
+    assertEquals("b", o.getName());
+  }
+
+  public void testXercesForCompletion() throws Exception {
+    XSModel xsModel = getXSModel("testCompletion.xml", "test.xsd");
+    PsiElement element = myFixture.getFile().findElementAt(getEditor().getCaretModel().getOffset());
+    XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class);
+
+    assert tag != null;
+    XSElementDeclaration elementDeclaration = xsModel.getElementDeclaration(tag.getLocalName(), tag.getNamespace());
+    XSComplexTypeDefinition typeDefinition = (XSComplexTypeDefinition)elementDeclaration.getTypeDefinition();
+    CMBuilder cmBuilder = new CMBuilder(new CMNodeFactory());
+    XSCMValidator validator = cmBuilder.getContentModel((XSComplexTypeDecl)typeDefinition, true);
+    int[] ints = validator.startContentModel();
+    Vector vector = validator.whatCanGoHere(ints);
+    XSElementDecl o = (XSElementDecl)vector.get(0);
+    assertEquals("b", o.getName());
+  }
+
+  private XSModel getXSModel(String... files) {
+    myFixture.configureByFiles(files);
+
+    XmlFile file = (XmlFile)myFixture.getFile();
+    ValidateXmlActionHandler handler = new ValidateXmlActionHandler(false) {
+      @Override
+      protected SAXParser createParser() throws SAXException, ParserConfigurationException {
+        SAXParser parser = super.createParser();
+        parser.getXMLReader().setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE, true);
+        return parser;
+      }
+    };
+    handler.setErrorReporter(handler.new TestErrorReporter());
+    handler.doValidate(file);
+    XMLGrammarPool grammarPool = ValidateXmlActionHandler.getGrammarPool(file);
+    assert grammarPool != null;
+    Grammar[] grammars = grammarPool.retrieveInitialGrammarSet(XMLGrammarDescription.XML_SCHEMA);
+    XSGrammar grammar = (XSGrammar)grammars[0];
+    return grammar.toXSModel();
+  }
+
+  public void testXsdConstraints() throws Exception {
+    Map<String, XmlElementDescriptor> map = configure("test.xml", "test.xsd");
+    XmlElementDescriptor a = map.get("a");
+    XmlElementsGroup topGroup = a.getTopGroup();
+  }
+
+  public void testDtdConstraints() throws Exception {
+
+    Map<String, XmlElementDescriptor> map = configure("testDtd.xml");
+    XmlElementDescriptor a = map.get("a");
+    XmlElementDescriptor b = map.get("b");
+
+    XmlElementDescriptor c = map.get("c");
+
+    XmlElementDescriptor d = map.get("d");
+
+    XmlElementDescriptor e = map.get("e");
+  }
+
+  private Map<String, XmlElementDescriptor> configure(String... files) {
+    myFixture.configureByFiles(files);
+    XmlTag tag = ((XmlFile)getFile()).getRootTag();
+    assertNotNull(tag);
+    XmlElementDescriptor descriptor = tag.getDescriptor();
+    assertNotNull(descriptor);
+    XmlElementDescriptor[] descriptors = descriptor.getElementsDescriptors(tag);
+    Map<String, XmlElementDescriptor> map =
+      ContainerUtil.newMapFromValues(Arrays.asList(descriptors).iterator(), new Convertor<XmlElementDescriptor, String>() {
+        @Override
+        public String convert(XmlElementDescriptor o) {
+          return o.getName();
+        }
+      });
+    map.put(tag.getName(), tag.getDescriptor());
+    return map;
+  }
+
+  @Override
+  protected String getBasePath() {
+    return "/xml/tests/testData/constraints";
+  }
+
+  @Override
+  protected boolean isCommunity() {
+    return true;
+  }
+}
diff --git a/xml/tests/src/com/intellij/xml/XmlFoldingTest.java b/xml/tests/src/com/intellij/xml/XmlFoldingTest.java
new file mode 100644
index 0000000..c6f76e3
--- /dev/null
+++ b/xml/tests/src/com/intellij/xml/XmlFoldingTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml;
+
+import com.intellij.testFramework.IdeaTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
+import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
+
+import java.io.File;
+
+/**
+ * User: zolotov
+ * Date: 8/3/12
+ */
+public class XmlFoldingTest extends LightPlatformCodeInsightFixtureTestCase {
+
+  public void testTagFolding() throws Throwable { doTest(); }
+
+  public void testStyleAttributeFolding() throws Throwable { doTest(); }
+  public void testStyleAttributeFolding2() throws Throwable { doTest(".xml"); }
+
+
+
+  @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
+  public XmlFoldingTest() {
+    IdeaTestCase.initPlatformPrefix();
+  }
+
+  private void doTest() throws Throwable {
+    doTest(".html");
+  }
+
+  private void doTest(String extension) throws Throwable {
+    myFixture.testFolding(getTestDataPath() + getTestName(true) + extension);
+  }
+
+  @Override
+  protected String getBasePath() {
+    return "/xml/tests/testData/folding/";
+  }
+
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + getBasePath();
+  }
+}
diff --git a/xml/tests/src/com/intellij/xml/XmlNamespacesTest.java b/xml/tests/src/com/intellij/xml/XmlNamespacesTest.java
new file mode 100644
index 0000000..03d221c
--- /dev/null
+++ b/xml/tests/src/com/intellij/xml/XmlNamespacesTest.java
@@ -0,0 +1,261 @@
+package com.intellij.xml;
+
+import com.intellij.codeInsight.actions.OptimizeImportsProcessor;
+import com.intellij.codeInsight.daemon.impl.analysis.XmlUnusedNamespaceInspection;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInspection.htmlInspections.XmlInspectionToolProvider;
+import com.intellij.javaee.ExternalResourceManagerImpl;
+import com.intellij.openapi.application.Result;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.testFramework.IdeaTestCase;
+import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlNamespacesTest extends CodeInsightFixtureTestCase {
+
+  @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
+  public XmlNamespacesTest() {
+    IdeaTestCase.initPlatformPrefix();
+  }
+
+  public void testUnusedNamespaces() throws Exception {
+    doUnusedDeclarationTest(
+      "<all xmlns=\"http://www.w3.org/2001/XMLSchema\" <warning descr=\"Namespace declaration is never used\">xmlns:xsi=\"http://www.w3.org/2001/XMLSc<caret>hema-instance\"</warning>/>",
+      "<all xmlns=\"http://www.w3.org/2001/XMLSchema\"/>", XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix.NAME);
+  }
+
+  public void testUnusedDefaultNamespace() throws Exception {
+    doUnusedDeclarationTest("<schema:schema \n" +
+                            "            xmlns:schema=\"http://www.w3.org/2001/XMLSchema\"\n" +
+                            "            <warning descr=\"Namespace declaration is never used\">xmlns=\"http://www.w3.org/2001/X<caret>Include\"</warning>\n" +
+                            "            xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                            "            <warning descr=\"Namespace location is never used\">xsi:noNamespaceSchemaLocation=\"http://www.w3.org/2001/XInclude\"</warning>>\n" +
+                            "</schema:schema>",
+
+                            "<schema:schema\n" +
+                            "        xmlns:schema=\"http://www.w3.org/2001/XMLSchema\"\n" +
+                            "        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                            "        >\n" +
+                            "</schema:schema>", XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix.NAME, false);
+
+    doOptimizeImportsTest("<schema:schema \n" +
+                          "            xmlns:schema=\"http://www.w3.org/2001/XMLSchema\"\n" +
+                          "            xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                          "        >\n" +
+                          "</schema:schema>");
+  }
+
+  public void testDifferentPrefixes() throws Exception {
+    doUnusedDeclarationTest(
+      "<x:all  <warning descr=\"Namespace declaration is never used\">xmlns=\"http://www.w3.org/2001/XMLS<caret>chema\"</warning>\n" +
+      "        xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
+      "        <warning descr=\"Namespace declaration is never used\">xmlns:y=\"http://www.w3.org/2001/XMLSchema\"</warning>/>",
+
+      "<x:all\n" +
+      "        xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
+      "        xmlns:y=\"http://www.w3.org/2001/XMLSchema\"/>",
+      XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix.NAME, false);
+
+    doOptimizeImportsTest("<x:all\n" +
+                          "        xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
+                          "        />");
+  }
+
+  public void testUnusedLocation() throws Exception {
+    doUnusedDeclarationTest("<x:all\n" +
+                            "        xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
+                            "        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                            "        xsi:schemaLocation=\"<warning descr=\"Namespace location is never used\">http://www.w3.org/2001/XML<caret>Sche</warning> " +
+                            "<warning descr=\"Namespace location is never used\">http://www.w3.org/2001/XMLSchema.xsd</warning>\"/>",
+                            "<x:all\n" +
+                            "        xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
+                            "        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                            "        />",
+                            XmlUnusedNamespaceInspection.RemoveNamespaceLocationFix.NAME);
+  }
+
+  public void testUnusedLocationOnly() throws Exception {
+    doUnusedDeclarationTest("<x:all\n" +
+                            "        xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
+                            "        <warning descr=\"Namespace declaration is never used\">xmlns:y=\"http://www.w3.org/2001/XInclude\"</warning>\n" +
+                            "        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                            "        xsi:schemaLocation=\"<warning descr=\"Namespace location is never used\">http://www.w3.org/2001/XI<caret>nclude</warning> <warning descr=\"Namespace location is never used\">http://www.w3.org/2001/XInclude.xsd</warning>\n" +
+                            "        http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd\"/>",
+                            "<x:all\n" +
+                            "        xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
+                            "        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                            "        xsi:schemaLocation=\"http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd\"/>",
+                            XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix.NAME);
+  }
+
+  public void testUnusedDefaultLocation() throws Exception {
+    doUnusedDeclarationTest("<x:all\n" +
+                            "        xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
+                            "        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                            "        <warning descr=\"Namespace location is never used\">xsi:noNamespaceSc<caret>hemaLocation=\"<error descr=\"Cannot resolve file 'zzz'\">zzz</error>\"</warning> />",
+                            "<x:all\n" +
+                            "        xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
+                            "        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                            "        />",
+                            XmlUnusedNamespaceInspection.RemoveNamespaceLocationFix.NAME);
+  }
+
+  public void testKeepFormatting() throws Exception {
+    doUnusedDeclarationTest("<xs:schema attributeFormDefault=\"unqualified\"\n" +
+                            "           <warning descr=\"Namespace declaration is never used\">xmlns:xsi=\"http://www.w3.org/20<caret>01/XMLSchema-instance\"</warning>\n" +
+                            "           elementFormDefault=\"qualified\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n" +
+                            "\n" +
+                            "        <!-- keep formatting here-->\n" +
+                            "    <xs:element name=\"a\" type=\"aType\"/>\n" +
+                            "  <xs:complexType name=\"aType\">\n" +
+                            "\n" +
+                            "  </xs:complexType>\n" +
+                            "</xs:schema>",
+                            "<xs:schema attributeFormDefault=\"unqualified\"\n" +
+                            "           elementFormDefault=\"qualified\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n" +
+                            "\n" +
+                            "        <!-- keep formatting here-->\n" +
+                            "    <xs:element name=\"a\" type=\"aType\"/>\n" +
+                            "  <xs:complexType name=\"aType\">\n" +
+                            "\n" +
+                            "  </xs:complexType>\n" +
+                            "</xs:schema>",
+                            XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix.NAME);
+  }
+
+  public void testImplicitPrefixUsage() throws Exception {
+    myFixture.configureByText("a.xml", "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"\n" +
+                                       "           xmlns:x2=\"http://www.w3.org/2001/XMLSchema\"\n" +
+                                       "           <warning descr=\"Namespace declaration is never used\">xmlns:x3=\"http://www.w3.org/2001/XMLSchema\"</warning> >\n" +
+                                       "  <xs:element name=\"a\" type=\"x2:string\"/>\n" +
+                                       "</xs:schema>");
+    myFixture.testHighlighting();
+  }
+
+  public void testUnusedLocationDetection() throws Exception {
+    myFixture.configureByFile("web-app_2_5.xsd");
+    myFixture.configureByText("a.xml", "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\"\n" +
+                                       "         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                                       "         <warning descr=\"Namespace declaration is never used\">xmlns:web=\"http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\"</warning>\n" +
+                                       "         xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee\n" +
+                                       "         web-app_2_5.xsd\"\n" +
+                                       "         version=\"2.5\">\n" +
+                                       "</web-app>");
+    myFixture.testHighlighting();
+  }
+
+  public void testWSDD() throws Exception {
+    myFixture.configureByText("a.xml",
+                              "<deployment xmlns=\"http://xml.apache.org/axis/wsdd/\" xmlns:java=\"http://xml.apache.org/axis/wsdd/providers/java\">\n" +
+                              "<typeMapping deserializer=\"org.apache.axis.encoding.ser.BeanDeserializerFactory\" encodingStyle=\"\" qname=\"ns38:AxisAnalysis\" serializer=\"org.apache.axis.encoding.ser.BeanSerializerFactory\" languageSpecificType=\"java:com.pls.xactservice.axis.bindings.AxisAnalysis\"/>\n" +
+                              "</deployment>");
+    myFixture.testHighlighting();
+  }
+
+  public void testPrefixesInTagValues() throws Exception {
+    myFixture.configureByText("a.xml",
+                              "<<info descr=\"Namespace '' is not bound\">nodeTypes</info> xmlns:nt=\"<error descr=\"URI is not registered (Settings | Project Settings | Schemas and DTDs)\">http://www.jcp.org/jcr/nt/1.0</error>\" xmlns:customns=\"<error descr=\"URI is not registered (Settings | Project Settings | Schemas and DTDs)\">http://customurl</error>\">\n" +
+                              "<nodeType name=\"customns:item\" isMixin=\"false\" hasOrderableChildNodes=\"false\">\n" +
+                              "   <supertypes>\n" +
+                              "      <supertype>nt:folder</supertype>\n" +
+                              "   </supertypes>\n" +
+                              "</nodeType>\n" +
+                              "</<info descr=\"Namespace '' is not bound\">nodeTypes</info>>");
+    myFixture.testHighlighting();
+  }
+
+  public void testLocallyUsedNamespace() throws Exception {
+    myFixture.configureByText("a.xml", "<x:all\n" +
+                                       "        xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
+                                       "        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                                       "        xsi:schemaLocation=\"http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd\n" +
+                                       "                http://www.w3.org/2001/XInclude http://www.w3.org/2001/XInclude.xsd\">\n" +
+                                       "\n" +
+                                       "    <<error descr=\"An 'include' failed, and no 'fallback' element was found.\">include</error> xmlns=\"http://www.w3.org/2001/XInclude\" href=\"<error descr=\"Cannot resolve file 'a.xml'\">a.xml</error>\"/>\n" +
+                                       "</x:all>");
+    myFixture.testHighlighting();
+  }
+
+  public void testLocallyUsedNamespaceWithPrefix() throws Exception {
+    myFixture.configureByText("a.xml", "<s:foo xmlns:s=\"<error descr=\"URI is not registered (Settings | Project Settings | Schemas and DTDs)\">http://foo</error>\"\n" +
+                                       "       <warning descr=\"Namespace declaration is never used\">xmlns:bar=\"<error descr=\"URI is not registered (Settings | Project Settings | Schemas and DTDs)\">http://bar</error>\"</warning>\n" +
+                                       "       xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                                       "       xsi:schemaLocation=\"http://bar <error descr=\"Cannot resolve file 'bar.xsd'\">bar.xsd</error> http://foo <error descr=\"Cannot resolve file 'foo.xsd'\">foo.xsd</error>\">\n" +
+                                       "\n" +
+                                       "    <bar xmlns=\"<error descr=\"URI is not registered (Settings | Project Settings | Schemas and DTDs)\">http://bar</error>\"/>\n" +
+                                       "\n" +
+                                       "</s:foo>");
+    myFixture.testHighlighting();
+  }
+
+  public void testSubDirectory() throws Exception {
+    myFixture.testHighlighting("moved.xml", "trg/move-def.xsd");
+  }
+
+  public void testSuppressedOptimize() throws Exception {
+    myFixture.configureByFile("web-app_2_5.xsd");
+    String text = "<!--suppress XmlUnusedNamespaceDeclaration -->\n" +
+                  "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\"\n" +
+                  "         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                  "         xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee\n" +
+                  "         web-app_2_5.xsd\"\n" +
+                  "         version=\"2.5\">\n" +
+                  "</web-app>";
+    myFixture.configureByText("a.xml", text);
+
+    doOptimizeImportsTest(text);
+  }
+
+  private void doUnusedDeclarationTest(String text, String after, String name) throws Exception {
+    doUnusedDeclarationTest(text, after, name, true);
+  }
+
+  private void doUnusedDeclarationTest(String text, String after, String name, boolean testOptimizeImports) throws Exception {
+    myFixture.configureByText("a.xml", text);
+    myFixture.testHighlighting();
+    IntentionAction action = myFixture.getAvailableIntention(name);
+    assertNotNull(name + " not found", action);
+    myFixture.launchAction(action);
+    myFixture.checkResult(after);
+
+    myFixture.configureByText("a.xml", text);
+    if (testOptimizeImports) {
+      doOptimizeImportsTest(after);
+    }
+  }
+
+  private void doOptimizeImportsTest(String after) {
+    myFixture.testHighlighting();
+    new WriteCommandAction(getProject(), getFile()) {
+      @Override
+      protected void run(Result result) throws Throwable {
+        new OptimizeImportsProcessor(getProject(), getFile()).runWithoutProgress();
+      }
+    }.execute();
+    myFixture.checkResult(after);
+  }
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+    myFixture.enableInspections(new XmlInspectionToolProvider());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd",
+                                                            getTestDataPath() + "/web-app_2_5.xsd", getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://xml.apache.org/axis/wsdd/",
+                                                            getTestDataPath() + "/wsdd.dtd", getTestRootDisposable());
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://xml.apache.org/axis/wsdd/providers/java",
+                                                            getTestDataPath() + "/wsdd_provider_java.xsd", getTestRootDisposable());
+  }
+
+  @Override
+  protected String getBasePath() {
+    return "/xml/tests/testData/unusedNs";
+  }
+
+  @Override
+  protected boolean isCommunity() {
+    return true;
+  }
+}
diff --git a/xml/tests/src/com/intellij/xml/XmlSchemaPrefixTest.java b/xml/tests/src/com/intellij/xml/XmlSchemaPrefixTest.java
new file mode 100644
index 0000000..feae6f6
--- /dev/null
+++ b/xml/tests/src/com/intellij/xml/XmlSchemaPrefixTest.java
@@ -0,0 +1,47 @@
+package com.intellij.xml;
+
+import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
+import com.intellij.testFramework.fixtures.CodeInsightTestUtil;
+import com.intellij.xml.refactoring.SchemaPrefixRenameHandler;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class XmlSchemaPrefixTest extends CodeInsightFixtureTestCase {
+
+  public void testPrefixUsages() throws Exception {
+    doFindUsages("usages.xml", 16);
+    doFindUsages("usages1.xml", 16);
+  }
+
+  public void testRename() throws Exception {doRename();}
+  public void testRename1() throws Exception {doRename();}
+
+  public void testRename2() throws Exception {doRename();}
+  public void testRenameFromClosingTag() throws Exception {doRename();}
+
+  private void doRename() throws Exception {
+    doRename("xsd");
+  }
+
+  private void doRename(String newValue) throws Exception {
+    final String name = getTestName(true);
+    CodeInsightTestUtil.doInlineRenameTest(new SchemaPrefixRenameHandler(), name, "xml", newValue, myFixture);
+  }
+
+  @Override
+  protected String getBasePath() {
+    return "/xml/tests/testData/schemaPrefix";
+  }
+
+  @Override
+  protected boolean isCommunity() {
+    return true;
+  }
+
+  protected void doFindUsages(String filename, int usages) {
+    final int size = myFixture.testFindUsages(filename).size();
+    assert size == usages : "Threre should be " + usages + " usages, but found " + size + ". File: " + filename;
+  }
+
+}
diff --git a/xml/tests/src/com/intellij/xml/XmlSmartCompletionTest.java b/xml/tests/src/com/intellij/xml/XmlSmartCompletionTest.java
new file mode 100644
index 0000000..4a01392
--- /dev/null
+++ b/xml/tests/src/com/intellij/xml/XmlSmartCompletionTest.java
@@ -0,0 +1,118 @@
+package com.intellij.xml;
+
+import com.intellij.codeInsight.CodeInsightSettings;
+import com.intellij.codeInsight.completion.CompletionType;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.javaee.ExternalResourceManagerImpl;
+import com.intellij.testFramework.IdeaTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
+import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class XmlSmartCompletionTest extends LightPlatformCodeInsightFixtureTestCase {
+
+  @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
+  public XmlSmartCompletionTest() {
+    IdeaTestCase.initPlatformPrefix();
+  }
+
+  public void testCompletion() throws Exception {
+    doTest(new String[]{"testCompletion.xml", "test.xsd"}, "b");
+  }
+
+  public void testCompletionNext() throws Exception {
+    doTest(new String[]{"testCompletionNext.xml", "test.xsd"}, "c");
+  }
+
+  public void testCompletion3() throws Exception {
+    doTest(new String[]{"testCompletion3.xml", "test.xsd"}, "c", "d");
+  }
+
+  public void testServlet() throws Exception {
+    doTest(new String[]{"Servlet.xml"}, "icon", "servlet-name");
+  }
+
+  public void testServletName() throws Exception {
+
+    doForText("<!DOCTYPE web-app\n" +
+              "        PUBLIC \"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN\"\n" +
+              "        \"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd\">\n" +
+              "<web-app>\n" +
+              "\n" +
+              "    <servlet>\n" +
+              "        <s<caret>\n" +
+              "    </servlet>\n" +
+              "</web-app>",
+              "<!DOCTYPE web-app\n" +
+              "        PUBLIC \"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN\"\n" +
+              "        \"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd\">\n" +
+              "<web-app>\n" +
+              "\n" +
+              "    <servlet>\n" +
+              "        <servlet-name\n" +
+              "    </servlet>\n" +
+              "</web-app>");
+  }
+
+  public void testPrefix() throws Exception {
+    doForText("<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n" +
+              "    <ann<caret>\n" +
+              "</xs:schema>",
+              "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n" +
+              "    <xs:annotation\n" +
+              "</xs:schema>");
+  }
+
+  private void doForText(String before, String after) {
+    myFixture.configureByText("a.xml", before);
+    myFixture.complete(CompletionType.SMART);
+    myFixture.checkResult(after);
+  }
+
+  private void doTest(String[] files, String... items) {
+    myFixture.configureByFiles(files);
+    LookupElement[] elements;
+    try {
+      CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_SMART_TYPE_COMPLETION = false;
+      elements = myFixture.complete(CompletionType.SMART);
+    }
+    finally {
+      CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_SMART_TYPE_COMPLETION = true;
+    }
+    assert elements != null;
+    List<String> strings = ContainerUtil.map(elements, new Function<LookupElement, String>() {
+      @Override
+      public String fun(LookupElement lookupElement) {
+        return lookupElement.getLookupString();
+      }
+    });
+    assertEquals(Arrays.asList(items), strings);
+  }
+
+
+  @Override
+  public void setUp() throws Exception {
+    super.setUp();
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/j2ee/dtds/web-app_2_3.dtd",
+                                                            getTestDataPath() + "/web-app_2_3.dtd", getTestRootDisposable());
+  }
+
+  @Override
+  protected String getBasePath() {
+    return "/xml/tests/testData/smartCompletion";
+  }
+
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + getBasePath();
+  }
+
+}
diff --git a/xml/tests/src/com/intellij/xml/actions/GenerateXmlTagTest.java b/xml/tests/src/com/intellij/xml/actions/GenerateXmlTagTest.java
new file mode 100644
index 0000000..fca9d69
--- /dev/null
+++ b/xml/tests/src/com/intellij/xml/actions/GenerateXmlTagTest.java
@@ -0,0 +1,84 @@
+package com.intellij.xml.actions;
+
+import com.intellij.javaee.ExternalResourceManagerImpl;
+import com.intellij.testFramework.IdeaTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
+import com.intellij.testFramework.fixtures.CodeInsightTestUtil;
+import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
+
+import java.io.File;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class GenerateXmlTagTest extends LightPlatformCodeInsightFixtureTestCase {
+
+  public GenerateXmlTagTest() {
+    IdeaTestCase.initPlatformPrefix();
+  }
+
+  public void testGenerate() throws Exception {
+    myFixture.configureByFile("web-app_2_5.xsd");
+    doTest("generate.xml", "security-constraint");
+  }
+
+  public void testGenerateEmpty() throws Exception {
+    myFixture.configureByFile("javaee_5.xsd");
+    myFixture.configureByFile("web-app_2_5.xsd");
+    doTest("generateEmpty.xml", "distributable");
+  }
+
+  public void testGenerateDTD() throws Exception {
+    doTest("generateDTD.xml", "b");
+  }
+
+  public void testGenerateDTDComplex() throws Exception {
+    doTest("generateDTDComplex.xml", "b");
+  }
+
+  public void testSpring() throws Exception {
+    myFixture.configureByFile("spring-beans_3.0.xsd");
+    doTest("spring.xml", "bean");
+  }
+
+  public void testSpringAtCaret() throws Exception {
+    myFixture.configureByFile("spring-beans_3.0.xsd");
+    doTest("springAtCaret.xml", "bean");
+  }
+
+  public void testSpringAfterBean() throws Exception {
+    myFixture.configureByFile("spring-beans_3.0.xsd");
+    doTest("springAfterBean.xml", "bean");
+  }
+
+  public void testSpringAlias() throws Exception {
+    myFixture.configureByFile("spring-beans_3.0.xsd");
+    doTest("springAlias.xml", "alias");
+  }
+
+  public void testInitParam() throws Exception {
+    doTest("initParam.xml", "context-param");
+  }
+
+  private void doTest(String file, String tagName) {
+    GenerateXmlTagAction.TEST_THREAD_LOCAL.set(tagName);
+    CodeInsightTestUtil.doActionTest(new GenerateXmlTagAction(), file, myFixture);
+  }
+
+  @Override
+  public void setUp() throws Exception {
+    super.setUp();
+    ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/j2ee/dtds/web-app_2_3.dtd",
+                                                            getTestDataPath() + "/web-app_2_3.dtd", getTestRootDisposable());
+  }
+
+  @Override
+  protected String getBasePath() {
+    return "/xml/tests/testData/generateTag";
+  }
+
+  @Override
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + getBasePath();
+  }
+}
diff --git a/xml/tests/src/com/intellij/xml/actions/SplitTagActionTest.java b/xml/tests/src/com/intellij/xml/actions/SplitTagActionTest.java
new file mode 100644
index 0000000..256bb15
--- /dev/null
+++ b/xml/tests/src/com/intellij/xml/actions/SplitTagActionTest.java
@@ -0,0 +1,28 @@
+package com.intellij.xml.actions;
+
+import com.intellij.codeInsight.daemon.LightIntentionActionTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author spleaner
+ */
+@SuppressWarnings({"ALL"})
+public class SplitTagActionTest extends LightIntentionActionTestCase {
+  public void test() throws Exception { doAllTests(); }
+
+  @Override
+  protected boolean shouldBeAvailableAfterExecution() {
+    return true;
+  }
+
+  @Override
+  protected String getBasePath() {
+    return "";
+  }
+
+  @NotNull
+  protected String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath() + "/xml/tests/testData/intentions/splitTag";
+  }
+}
\ No newline at end of file
diff --git a/xml/tests/src/com/intellij/xml/index/XmlSchemaIndexTest.java b/xml/tests/src/com/intellij/xml/index/XmlSchemaIndexTest.java
new file mode 100644
index 0000000..f610b15
--- /dev/null
+++ b/xml/tests/src/com/intellij/xml/index/XmlSchemaIndexTest.java
@@ -0,0 +1,120 @@
+package com.intellij.xml.index;
+
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtilCore;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.testFramework.IdeaTestCase;
+import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.indexing.FileBasedIndex;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.*;
+
+/**
+ * @author Dmitry Avdeev
+ */
+@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
+public class XmlSchemaIndexTest extends CodeInsightFixtureTestCase {
+
+  private static final String NS = "http://java.jb.com/xml/ns/javaee";
+
+  @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
+  public XmlSchemaIndexTest() {
+    IdeaTestCase.initPlatformPrefix();
+  }
+
+  public void testBuilder() throws IOException {
+
+    VirtualFile file = myFixture.copyFileToProject("spring-beans-2.0.xsd");
+    assert file != null;
+    final Collection<String> tags = XsdTagNameBuilder.computeTagNames(file.getInputStream());
+    assert tags != null;
+    assertEquals(22, tags.size());
+
+    final String ns = XsdNamespaceBuilder.computeNamespace(file.getInputStream());
+    assertEquals("http://www.springframework.org/schema/beans", ns);
+
+    final VirtualFile xsd = myFixture.copyFileToProject("XMLSchema.xsd");
+    assert xsd != null;
+    final String xsns = XsdNamespaceBuilder.computeNamespace(xsd.getInputStream());
+    assertEquals("http://www.w3.org/2001/XMLSchema", xsns);
+
+    final Collection<String> xstags = XsdTagNameBuilder.computeTagNames(xsd.getInputStream());
+    assert xstags != null;
+    assertEquals(69, xstags.size());
+    assertTrue(xstags.contains("schema"));
+  }
+
+  public void testXsdNamespaceBuilder() throws Exception {
+    VirtualFile file = myFixture.copyFileToProject("web-app_2_5.xsd");
+    final XsdNamespaceBuilder builder = XsdNamespaceBuilder.computeNamespace(new InputStreamReader(file.getInputStream()));
+    assertEquals(NS, builder.getNamespace());
+    assertEquals("2.5", builder.getVersion());
+    assertEquals(Arrays.asList("web-app"), builder.getTags());
+  }
+
+  public void testTagNameIndex() {
+
+    myFixture.copyDirectoryToProject("", "");
+
+    final Project project = getProject();
+    final Collection<String> tags = XmlTagNamesIndex.getAllTagNames(project);
+    assertTrue(tags.size() > 26);
+    final Collection<VirtualFile> files = XmlTagNamesIndex.getFilesByTagName("bean", project);
+    assertEquals(1, files.size());
+    Module module = ModuleUtilCore.findModuleForFile(files.iterator().next(), project);
+    assert module != null;
+    final Collection<VirtualFile> files1 = FileBasedIndex.getInstance().getContainingFiles(XmlTagNamesIndex.NAME, "web-app", module.getModuleContentScope());
+
+    assertEquals(new ArrayList<VirtualFile>(files1).toString(), 2, files1.size());
+
+    List<String> names = new ArrayList<String>(ContainerUtil.map(files1, new Function<VirtualFile, String>() {
+      @Override
+      public String fun(VirtualFile virtualFile) {
+        return virtualFile.getName();
+      }
+    }));
+    Collections.sort(names);
+    assertEquals(Arrays.asList("web-app_2_5.xsd", "web-app_3_0.xsd"), names);
+  }
+
+  public void testNamespaceIndex() {
+
+    myFixture.copyDirectoryToProject("", "");
+
+    final List<IndexedRelevantResource<String, XsdNamespaceBuilder>> files =
+      XmlNamespaceIndex.getResourcesByNamespace(NS,
+                                                getProject(),
+                                                myModule);
+    assertEquals(2, files.size());
+
+    IndexedRelevantResource<String, XsdNamespaceBuilder>
+      resource = XmlNamespaceIndex.guessSchema(NS, "web-app", "3.0", myModule);
+    assertNotNull(resource);
+    XsdNamespaceBuilder builder = resource.getValue();
+    assertEquals(NS, builder.getNamespace());
+    assertEquals("3.0", builder.getVersion());
+    assertEquals(Arrays.asList("web-app"), builder.getTags());
+
+    resource = XmlNamespaceIndex.guessSchema(NS, "web-app", "2.5", myModule);
+    assertNotNull(resource);
+    builder = resource.getValue();
+    assertEquals(NS, builder.getNamespace());
+    assertEquals("2.5", builder.getVersion());
+    assertEquals(Arrays.asList("web-app"), builder.getTags());
+  }
+
+  @Override
+  protected String getBasePath() {
+    return "/xml/tests/testData/index";
+  }
+
+  @Override
+  protected boolean isCommunity() {
+    return true;
+  }
+}
diff --git a/xml/tests/src/com/intellij/xml/index/XmlSchemaTypeInheritanceTest.java b/xml/tests/src/com/intellij/xml/index/XmlSchemaTypeInheritanceTest.java
new file mode 100644
index 0000000..dd9f13e
--- /dev/null
+++ b/xml/tests/src/com/intellij/xml/index/XmlSchemaTypeInheritanceTest.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2000-2012 JetBrains s.r.o.
+ *
+ * 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.
+ */
+package com.intellij.xml.index;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.testFramework.IdeaTestCase;
+import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
+import com.intellij.util.containers.MultiMap;
+import com.intellij.util.containers.hash.HashSet;
+import junit.framework.Assert;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: Irina.Chernushina
+ * Date: 7/5/12
+ * Time: 12:52 PM
+ */
+public class XmlSchemaTypeInheritanceTest extends CodeInsightFixtureTestCase {
+  private final static String ourNs = "http://www.omg.org/spec/BPMN/20100524/MODEL";
+
+  @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
+  public XmlSchemaTypeInheritanceTest() {
+    IdeaTestCase.initPlatformPrefix();
+  }
+
+  @Test
+  public void testBuilder() throws Exception {
+    VirtualFile file = myFixture.copyFileToProject("Semantic.xsd");
+    assert file != null;
+    final FileInputStream is = new FileInputStream(new File(file.getPath()));
+    final MultiMap<SchemaTypeInfo, SchemaTypeInfo> map = XsdComplexTypeInfoBuilder.parse(is);
+
+    final Collection<SchemaTypeInfo> node = map.get(new SchemaTypeInfo("tConversationNode", true, ourNs));
+    Assert.assertNotNull(node);
+    Assert.assertEquals(3, node.size());
+
+    final Set<SchemaTypeInfo> expected = new HashSet<SchemaTypeInfo>();
+    expected.add(new SchemaTypeInfo("tConversation", true, ourNs));
+    expected.add(new SchemaTypeInfo("tCallConversation", true, ourNs));
+    expected.add(new SchemaTypeInfo("tSubConversation", true, ourNs));
+    for (SchemaTypeInfo info : node) {
+      expected.remove(info);
+    }
+    Assert.assertTrue(expected.isEmpty());
+    //
+    final Collection<SchemaTypeInfo> stringNode = map.get(new SchemaTypeInfo("string", true, "http://www.w3.org/2001/XMLSchema"));
+    Assert.assertNotNull(stringNode);
+    Assert.assertEquals(9, stringNode.size());
+    Assert.assertTrue(stringNode.contains(new SchemaTypeInfo("tAdHocOrdering", true, ourNs)));
+    Assert.assertTrue(stringNode.contains(new SchemaTypeInfo("tEventBasedGatewayType", true, ourNs)));
+    //
+    final Collection<SchemaTypeInfo> baseNode = map.get(new SchemaTypeInfo("tBaseElement", true, ourNs));
+    Assert.assertNotNull(baseNode);
+    Assert.assertEquals(39, baseNode.size());
+    Assert.assertTrue(baseNode.contains(new SchemaTypeInfo("tAuditing", true, ourNs)));
+    Assert.assertTrue(baseNode.contains(new SchemaTypeInfo("tDataInput", true, ourNs)));
+    Assert.assertTrue(baseNode.contains(new SchemaTypeInfo("tDataOutput", true, ourNs)));
+    Assert.assertTrue(baseNode.contains(new SchemaTypeInfo("tFlowElement", true, ourNs)));
+  }
+
+  @Test
+  public void testIndex() throws Exception {
+    myFixture.copyDirectoryToProject("", "");
+
+    final Project project = getProject();
+    final List<Set<SchemaTypeInfo>> childrenOfType = SchemaTypeInheritanceIndex.getWorker(project, null).convert("http://a.b.c", "baseSimpleType");
+    Assert.assertNotNull(childrenOfType);
+
+    final Set<SchemaTypeInfo> expected = new HashSet<SchemaTypeInfo>();
+    expected.add(new SchemaTypeInfo("extSimple4", true, "http://a.b.c"));
+    expected.add(new SchemaTypeInfo("extSimple1", true, "http://a.b.c"));
+    expected.add(new SchemaTypeInfo("extComplex2", true, "http://a.b.c"));
+    expected.add(new SchemaTypeInfo("extComplex2", true, "http://a.b.c.d"));
+
+    for (Set<SchemaTypeInfo> infos : childrenOfType) {
+      for (SchemaTypeInfo info : infos) {
+        expected.remove(info);
+      }
+    }
+
+    Assert.assertTrue(expected.isEmpty());
+    //
+    final List<Set<SchemaTypeInfo>> childrenOfSimple4Type = SchemaTypeInheritanceIndex.getWorker(project, null).convert("http://a.b.c", "extSimple4");
+    Assert.assertNotNull(childrenOfSimple4Type);
+    final Set<SchemaTypeInfo> expectedSimple4 = new HashSet<SchemaTypeInfo>();
+    expectedSimple4.add(new SchemaTypeInfo("extSimple5", true, "http://a.b.c"));
+    expectedSimple4.add(new SchemaTypeInfo("wiseElement", false, "http://a.b.c"));
+
+    for (Set<SchemaTypeInfo> infos : childrenOfSimple4Type) {
+      for (SchemaTypeInfo info : infos) {
+        expectedSimple4.remove(info);
+      }
+    }
+
+    Assert.assertTrue(expectedSimple4.isEmpty());
+  }
+
+  @Override
+  protected String getBasePath() {
+    return "/xml/tests/testData/index";
+  }
+
+  @Override
+  protected boolean isCommunity() {
+    return true;
+  }
+}
diff --git a/xml/tests/testData/catalog/catalog.properties b/xml/tests/testData/catalog/catalog.properties
new file mode 100644
index 0000000..a6cb7b8
--- /dev/null
+++ b/xml/tests/testData/catalog/catalog.properties
@@ -0,0 +1,4 @@
+# Catalogs are relative to this properties file
+relative-catalogs=false
+# Catalog list
+catalogs=catalog.xml
\ No newline at end of file
diff --git a/xml/tests/testData/catalog/catalog.xml b/xml/tests/testData/catalog/catalog.xml
new file mode 100644
index 0000000..1e97c2c
--- /dev/null
+++ b/xml/tests/testData/catalog/catalog.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<catalog
+  xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+
+  <public publicId="-//W3C//DTD XHTML 1.0 Strict//EN"
+    uri="xhtml1-strict.dtd"/>
+  <system systemId="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+            uri="xhtml1-strict.dtd"/>
+  <system systemId="urn:oasis:names:tc:xacml:1.0:policy"
+            uri="catalog/cs-xacml-schema-policy-01.xsd"/>
+</catalog>
\ No newline at end of file
diff --git a/xml/tests/testData/catalog/catalog/cs-xacml-schema-policy-01.xsd b/xml/tests/testData/catalog/catalog/cs-xacml-schema-policy-01.xsd
new file mode 100644
index 0000000..3ce43da
--- /dev/null
+++ b/xml/tests/testData/catalog/catalog/cs-xacml-schema-policy-01.xsd
@@ -0,0 +1,250 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="urn:oasis:names:tc:xacml:1.0:policy" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xacml="urn:oasis:names:tc:xacml:1.0:policy" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<!-- -->
+	<xs:element name="PolicySet" type="xacml:PolicySetType"/>
+	<xs:complexType name="PolicySetType">
+		<xs:sequence>
+			<xs:element ref="xacml:Description" minOccurs="0"/>
+			<xs:element ref="xacml:PolicySetDefaults" minOccurs="0"/>
+			<xs:element ref="xacml:Target"/>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element ref="xacml:PolicySet"/>
+				<xs:element ref="xacml:Policy"/>
+				<xs:element ref="xacml:PolicySetIdReference"/>
+				<xs:element ref="xacml:PolicyIdReference"/>
+			</xs:choice>
+			<xs:element ref="xacml:Obligations" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute name="PolicySetId" type="xs:anyURI" use="required"/>
+		<xs:attribute name="PolicyCombiningAlgId" type="xs:anyURI" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="PolicySetIdReference" type="xs:anyURI"/>
+	<xs:element name="PolicyIdReference" type="xs:anyURI"/>
+	<!-- -->
+	<xs:element name="PolicySetDefaults" type="xacml:DefaultsType"/>
+	<xs:element name="PolicyDefaults" type="xacml:DefaultsType"/>
+	<xs:complexType name="DefaultsType">
+		<xs:sequence>
+			<xs:choice>
+				<xs:element ref="xacml:XPathVersion"/>
+			</xs:choice>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="XPathVersion" type="xs:anyURI"/>
+	<!-- -->
+	<xs:element name="Policy" type="xacml:PolicyType"/>
+	<xs:complexType name="PolicyType">
+		<xs:sequence>
+			<xs:element ref="xacml:Description" minOccurs="0"/>
+			<xs:element ref="xacml:PolicyDefaults" minOccurs="0"/>
+			<xs:element ref="xacml:Target"/>
+			<xs:element ref="xacml:Rule" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="xacml:Obligations" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute name="PolicyId" type="xs:anyURI" use="required"/>
+		<xs:attribute name="RuleCombiningAlgId" type="xs:anyURI" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Description" type="xs:string"/>
+	<!-- -->
+	<xs:element name="Rule" type="xacml:RuleType"/>
+	<xs:complexType name="RuleType">
+		<xs:sequence>
+			<xs:element ref="xacml:Description" minOccurs="0"/>
+			<xs:element ref="xacml:Target" minOccurs="0"/>
+			<xs:element ref="xacml:Condition" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute name="RuleId" type="xs:anyURI" use="required"/>
+		<xs:attribute name="Effect" type="xacml:EffectType" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:simpleType name="EffectType">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="Permit"/>
+			<xs:enumeration value="Deny"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<!-- -->
+	<xs:element name="Target" type="xacml:TargetType"/>
+	<xs:complexType name="TargetType">
+		<xs:sequence>
+			<xs:element ref="xacml:Subjects"/>
+			<xs:element ref="xacml:Resources"/>
+			<xs:element ref="xacml:Actions"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Subjects" type="xacml:SubjectsType"/>
+	<xs:complexType name="SubjectsType">
+		<xs:choice>
+			<xs:element ref="xacml:Subject" maxOccurs="unbounded"/>
+			<xs:element ref="xacml:AnySubject"/>
+		</xs:choice>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Subject" type="xacml:SubjectType"/>
+	<xs:complexType name="SubjectType">
+		<xs:sequence>
+			<xs:element ref="xacml:SubjectMatch" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="AnySubject"/>
+	<!-- -->
+	<xs:element name="Resources" type="xacml:ResourcesType"/>
+	<xs:complexType name="ResourcesType">
+		<xs:choice>
+			<xs:element ref="xacml:Resource" maxOccurs="unbounded"/>
+			<xs:element ref="xacml:AnyResource"/>
+		</xs:choice>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="AnyResource"/>
+	<!-- -->
+	<xs:element name="Resource" type="xacml:ResourceType"/>
+	<xs:complexType name="ResourceType">
+		<xs:sequence>
+			<xs:element ref="xacml:ResourceMatch" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Actions" type="xacml:ActionsType"/>
+	<xs:complexType name="ActionsType">
+		<xs:choice>
+			<xs:element ref="xacml:Action" maxOccurs="unbounded"/>
+			<xs:element ref="xacml:AnyAction"/>
+		</xs:choice>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="AnyAction"/>
+	<!-- -->
+	<xs:element name="Action" type="xacml:ActionType"/>
+	<xs:complexType name="ActionType">
+		<xs:sequence>
+			<xs:element ref="xacml:ActionMatch" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="SubjectMatch" type="xacml:SubjectMatchType"/>
+	<xs:complexType name="SubjectMatchType">
+		<xs:sequence>
+			<xs:element ref="xacml:AttributeValue"/>
+			<xs:choice>
+				<xs:element ref="xacml:SubjectAttributeDesignator"/>
+				<xs:element ref="xacml:AttributeSelector"/>
+			</xs:choice>
+		</xs:sequence>
+		<xs:attribute name="MatchId" type="xs:anyURI" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="ResourceMatch" type="xacml:ResourceMatchType"/>
+	<xs:complexType name="ResourceMatchType">
+		<xs:sequence>
+			<xs:element ref="xacml:AttributeValue"/>
+			<xs:choice>
+				<xs:element ref="xacml:ResourceAttributeDesignator"/>
+				<xs:element ref="xacml:AttributeSelector"/>
+			</xs:choice>
+		</xs:sequence>
+		<xs:attribute name="MatchId" type="xs:anyURI" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="ActionMatch" type="xacml:ActionMatchType"/>
+	<xs:complexType name="ActionMatchType">
+		<xs:sequence>
+			<xs:element ref="xacml:AttributeValue"/>
+			<xs:choice>
+				<xs:element ref="xacml:ActionAttributeDesignator"/>
+				<xs:element ref="xacml:AttributeSelector"/>
+			</xs:choice>
+		</xs:sequence>
+		<xs:attribute name="MatchId" type="xs:anyURI" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="AttributeSelector" type="xacml:AttributeSelectorType"/>
+	<xs:complexType name="AttributeSelectorType">
+		<xs:attribute name="RequestContextPath" type="xs:string" use="required"/>
+		<xs:attribute name="DataType" type="xs:anyURI" use="required"/>
+		<xs:attribute name="MustBePresent" type="xs:boolean" use="optional" default="false"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="ResourceAttributeDesignator" type="xacml:AttributeDesignatorType"/>
+	<xs:element name="ActionAttributeDesignator" type="xacml:AttributeDesignatorType"/>
+	<xs:element name="EnvironmentAttributeDesignator" type="xacml:AttributeDesignatorType"/>
+	<!-- -->
+	<xs:complexType name="AttributeDesignatorType">
+		<xs:attribute name="AttributeId" type="xs:anyURI" use="required"/>
+		<xs:attribute name="DataType" type="xs:anyURI" use="required"/>
+		<xs:attribute name="Issuer" type="xs:string" use="optional"/>
+		<xs:attribute name="MustBePresent" type="xs:boolean" use="optional" default="false"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="SubjectAttributeDesignator" type="xacml:SubjectAttributeDesignatorType"/>
+	<xs:complexType name="SubjectAttributeDesignatorType">
+		<xs:complexContent>
+			<xs:extension base="xacml:AttributeDesignatorType">
+				<xs:attribute name="SubjectCategory" type="xs:anyURI" use="optional" default="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="AttributeValue" type="xacml:AttributeValueType"/>
+	<xs:complexType name="AttributeValueType" mixed="true">
+		<xs:sequence>
+			<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:attribute name="DataType" type="xs:anyURI" use="required"/>
+		<xs:anyAttribute namespace="##any" processContents="lax"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Function" type="xacml:FunctionType"/>
+	<xs:complexType name="FunctionType">
+		<xs:attribute name="FunctionId" type="xs:anyURI" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Apply" type="xacml:ApplyType"/>
+	<xs:element name="Condition" type="xacml:ApplyType"/>
+	<!-- -->
+	<xs:complexType name="ApplyType">
+		<xs:choice minOccurs="0" maxOccurs="unbounded">
+			<xs:element ref="xacml:Apply"/>
+			<xs:element ref="xacml:Function"/>
+			<xs:element ref="xacml:AttributeValue"/>
+			<xs:element ref="xacml:SubjectAttributeDesignator"/>
+			<xs:element ref="xacml:ResourceAttributeDesignator"/>
+			<xs:element ref="xacml:ActionAttributeDesignator"/>
+			<xs:element ref="xacml:EnvironmentAttributeDesignator"/>
+			<xs:element ref="xacml:AttributeSelector"/>
+		</xs:choice>
+		<xs:attribute name="FunctionId" type="xs:anyURI" use="required"/>
+		<!-- Legal types for the first and subsequent operands are defined in the accompanying table -->
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Obligations" type="xacml:ObligationsType"/>
+	<xs:complexType name="ObligationsType">
+		<xs:sequence>
+			<xs:element ref="xacml:Obligation" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Obligation" type="xacml:ObligationType"/>
+	<xs:complexType name="ObligationType">
+		<xs:sequence>
+			<xs:element ref="xacml:AttributeAssignment" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:attribute name="ObligationId" type="xs:anyURI" use="required"/>
+		<xs:attribute name="FulfillOn" type="xacml:EffectType" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="AttributeAssignment" type="xacml:AttributeAssignmentType"/>
+	<xs:complexType name="AttributeAssignmentType" mixed="true">
+		<xs:complexContent mixed="true">
+			<xs:extension base="xacml:AttributeValueType">
+				<xs:attribute name="AttributeId" type="xs:anyURI" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- -->
+</xs:schema>
diff --git a/xml/tests/testData/catalog/policy.xml b/xml/tests/testData/catalog/policy.xml
new file mode 100644
index 0000000..9ea5785
--- /dev/null
+++ b/xml/tests/testData/catalog/policy.xml
@@ -0,0 +1,18 @@
+<x:PolicySet
+        xmlns:x="urn:oasis:names:tc:xacml:1.0:policy"
+        PolicyCombiningAlgId="" PolicySetId="">
+  <x:Description>xxx</x:Description>
+    <x:Target>
+        <x:Subjects>
+            <x:Subject>
+                <x:SubjectMatch MatchId="">
+                    <x:AttributeValue DataType=""/>
+                    <x:AttributeSelector RequestContextPath="" DataType=""/>
+    </x:SubjectMatch>
+            </x:Subject>
+        </x:Subjects><x:Resources><x:Resource><x:ResourceMatch MatchId=""><x:AttributeValue
+            DataType=""/><x:AttributeSelector RequestContextPath="" DataType=""/>
+    </x:ResourceMatch></x:Resource></x:Resources>
+        <x:Actions><x:AnyAction/></x:Actions>
+        </x:Target>
+</x:PolicySet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/10.xml b/xml/tests/testData/completion/10.xml
new file mode 100644
index 0000000..98ec2df
--- /dev/null
+++ b/xml/tests/testData/completion/10.xml
@@ -0,0 +1,6 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"
+        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd"/>
+    <xsl:tem<caret>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/10_after.xml b/xml/tests/testData/completion/10_after.xml
new file mode 100644
index 0000000..033514f
--- /dev/null
+++ b/xml/tests/testData/completion/10_after.xml
@@ -0,0 +1,6 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"
+        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd"/>
+    <xsl:template<caret>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/11.xml b/xml/tests/testData/completion/11.xml
new file mode 100644
index 0000000..5f63911
--- /dev/null
+++ b/xml/tests/testData/completion/11.xml
@@ -0,0 +1,8 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"
+        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd"/>
+    <xsl:template match="/page">
+    <ht<caret> html xmlns="http://www.w3.org/1999/xhtml"
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/11_after.xml b/xml/tests/testData/completion/11_after.xml
new file mode 100644
index 0000000..72d8baf
--- /dev/null
+++ b/xml/tests/testData/completion/11_after.xml
@@ -0,0 +1,13 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"
+        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd"/>
+    <xsl:template match="/page">
+    <html>
+        <head>
+            <title></title>
+        </head>
+        <body></body>
+    </html> html xmlns="http://www.w3.org/1999/xhtml"
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/12.xml b/xml/tests/testData/completion/12.xml
new file mode 100644
index 0000000..f466556
--- /dev/null
+++ b/xml/tests/testData/completion/12.xml
@@ -0,0 +1,9 @@
+<web-app version="2.4"
+         xmlns="http://java.sun.com/xml/ns/j2ee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+    <filter-mapping>
+        <dispatcher> FO<caret>
+        </dispatcher>
+    </filter-mapping>
+</web-app>
diff --git a/xml/tests/testData/completion/12_3.xml b/xml/tests/testData/completion/12_3.xml
new file mode 100644
index 0000000..cab5aaf
--- /dev/null
+++ b/xml/tests/testData/completion/12_3.xml
@@ -0,0 +1,7 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:complexType name="AAA">
+    <xs:sequence>
+      <xs:element minOccurs="1" maxOccurs="un<caret>"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/12_3_after.xml b/xml/tests/testData/completion/12_3_after.xml
new file mode 100644
index 0000000..19938e8
--- /dev/null
+++ b/xml/tests/testData/completion/12_3_after.xml
@@ -0,0 +1,7 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:complexType name="AAA">
+    <xs:sequence>
+      <xs:element minOccurs="1" maxOccurs="unbounded<caret>"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/12_4.xml b/xml/tests/testData/completion/12_4.xml
new file mode 100644
index 0000000..000de9a
--- /dev/null
+++ b/xml/tests/testData/completion/12_4.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="Windows-1251"?>
+<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="12_4_sample.xsd sample.xsd"
+          xmlns="12_4_sample.xsd">
+
+        <sample align="LE<caret>"/>
+</root>
+
diff --git a/xml/tests/testData/completion/12_4_after.xml b/xml/tests/testData/completion/12_4_after.xml
new file mode 100644
index 0000000..a1ea232
--- /dev/null
+++ b/xml/tests/testData/completion/12_4_after.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="Windows-1251"?>
+<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="12_4_sample.xsd sample.xsd"
+          xmlns="12_4_sample.xsd">
+
+        <sample align="LEFT<caret>"/>
+</root>
+
diff --git a/xml/tests/testData/completion/12_4_included-sample.xsd b/xml/tests/testData/completion/12_4_included-sample.xsd
new file mode 100644
index 0000000..b539c72
--- /dev/null
+++ b/xml/tests/testData/completion/12_4_included-sample.xsd
@@ -0,0 +1,18 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            attributeFormDefault="unqualified"
+            elementFormDefault="qualified">
+
+        <xsd:element name="sample">
+                <xsd:complexType>
+                        <xsd:attribute name="align" type="sampleEnum"/>
+                </xsd:complexType>
+        </xsd:element>
+
+        <xsd:simpleType name="sampleEnum">
+                <xsd:restriction base="xsd:string">
+                        <xsd:enumeration value="CENTER"/>
+                        <xsd:enumeration value="LEFT"/>
+                        <xsd:enumeration value="RIGHT"/>
+                </xsd:restriction>
+        </xsd:simpleType>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/12_4_sample.xsd b/xml/tests/testData/completion/12_4_sample.xsd
new file mode 100644
index 0000000..37ac0d7
--- /dev/null
+++ b/xml/tests/testData/completion/12_4_sample.xsd
@@ -0,0 +1,16 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            attributeFormDefault="unqualified"
+            elementFormDefault="qualified"
+            targetNamespace="http://jb-bugs.ru/sample"
+            xmlns="http://jb-bugs.ru/sample">
+
+        <xsd:include schemaLocation="12_4_included-sample.xsd"/>
+
+        <xsd:element name="root" type="rootElement"/>
+
+        <xsd:complexType name="rootElement">
+                <xsd:sequence>
+                        <xsd:element ref="sample" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+        </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/completion/12_after.xml b/xml/tests/testData/completion/12_after.xml
new file mode 100644
index 0000000..724194f
--- /dev/null
+++ b/xml/tests/testData/completion/12_after.xml
@@ -0,0 +1,9 @@
+<web-app version="2.4"
+         xmlns="http://java.sun.com/xml/ns/j2ee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+    <filter-mapping>
+        <dispatcher> FORWARD<caret>
+        </dispatcher>
+    </filter-mapping>
+</web-app>
diff --git a/xml/tests/testData/completion/13.xml b/xml/tests/testData/completion/13.xml
new file mode 100644
index 0000000..fceef6f
--- /dev/null
+++ b/xml/tests/testData/completion/13.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE a [
+<!ELEMENT a (#PCDATA)>
+<!ENTITY nbsp "!!!" >  
+]>
+<a>
+  &nb<caret>
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/13_2.xml b/xml/tests/testData/completion/13_2.xml
new file mode 100644
index 0000000..91ecae6
--- /dev/null
+++ b/xml/tests/testData/completion/13_2.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE a [
+<!ELEMENT a (#PCDATA)>
+<!ENTITY help SYSTEM "file:Z.xml">
+]>
+<a>
+  &he<caret>
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/13_2_after.xml b/xml/tests/testData/completion/13_2_after.xml
new file mode 100644
index 0000000..cad4333
--- /dev/null
+++ b/xml/tests/testData/completion/13_2_after.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE a [
+<!ELEMENT a (#PCDATA)>
+<!ENTITY help SYSTEM "file:Z.xml">
+]>
+<a>
+  &help;<caret>
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/13_3.xml b/xml/tests/testData/completion/13_3.xml
new file mode 100644
index 0000000..62f437237
--- /dev/null
+++ b/xml/tests/testData/completion/13_3.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-configuration PUBLIC
+  "-//Hibernate/Hibernate Configuration DTD//EN"
+  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+[<!ENTITY baseEntity SYSTEM "classpath://foo/incl.xml">]>
+<hibernate-configuration>
+    &b<caret>
+
+</hibernate-configuration>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/13_3_after.xml b/xml/tests/testData/completion/13_3_after.xml
new file mode 100644
index 0000000..481b9dd
--- /dev/null
+++ b/xml/tests/testData/completion/13_3_after.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-configuration PUBLIC
+  "-//Hibernate/Hibernate Configuration DTD//EN"
+  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+[<!ENTITY baseEntity SYSTEM "classpath://foo/incl.xml">]>
+<hibernate-configuration>
+    &baseEntity;<caret>
+
+</hibernate-configuration>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/13_after.xml b/xml/tests/testData/completion/13_after.xml
new file mode 100644
index 0000000..f245da1
--- /dev/null
+++ b/xml/tests/testData/completion/13_after.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE a [
+<!ELEMENT a (#PCDATA)>
+<!ENTITY nbsp "!!!" >  
+]>
+<a>
+  &nbsp;<caret>
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/14.xml b/xml/tests/testData/completion/14.xml
new file mode 100644
index 0000000..7b56ab1
--- /dev/null
+++ b/xml/tests/testData/completion/14.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE a [
+<!ELEMENT a (#PCDATA)>
+<!ENTITY nbsp2 SYSTEM "1<caret>" >  
+]>
+<a>
+  &nbsp2;
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/14_after.xml b/xml/tests/testData/completion/14_after.xml
new file mode 100644
index 0000000..d117cda
--- /dev/null
+++ b/xml/tests/testData/completion/14_after.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE a [
+<!ELEMENT a (#PCDATA)>
+<!ENTITY nbsp2 SYSTEM "14.xml<caret>" >  
+]>
+<a>
+  &nbsp2;
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/15.xml b/xml/tests/testData/completion/15.xml
new file mode 100644
index 0000000..374266c
--- /dev/null
+++ b/xml/tests/testData/completion/15.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:schemas-dig-de:test2">
+    <xs:include schemaLocation="1<xml>"/>
+</xs:schema>
diff --git a/xml/tests/testData/completion/15_after.xml b/xml/tests/testData/completion/15_after.xml
new file mode 100644
index 0000000..374266c
--- /dev/null
+++ b/xml/tests/testData/completion/15_after.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:schemas-dig-de:test2">
+    <xs:include schemaLocation="1<xml>"/>
+</xs:schema>
diff --git a/xml/tests/testData/completion/16.xml b/xml/tests/testData/completion/16.xml
new file mode 100644
index 0000000..68139f5
--- /dev/null
+++ b/xml/tests/testData/completion/16.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:schemas-dig-de:test2">
+    <xs:include schemaLocation="http://www.w3.org/1999/xh<caret>"/>
+</xs:schema>
diff --git a/xml/tests/testData/completion/16_after.xml b/xml/tests/testData/completion/16_after.xml
new file mode 100644
index 0000000..bf86f91
--- /dev/null
+++ b/xml/tests/testData/completion/16_after.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:schemas-dig-de:test2">
+    <xs:include schemaLocation="http://www.w3.org/1999/xhtml<caret>"/>
+</xs:schema>
diff --git a/xml/tests/testData/completion/17.xml b/xml/tests/testData/completion/17.xml
new file mode 100644
index 0000000..a617a61
--- /dev/null
+++ b/xml/tests/testData/completion/17.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema-i<caret>" targetNamespace="urn:schemas-dig-de:test2">
+</xs:schema>
diff --git a/xml/tests/testData/completion/17_after.xml b/xml/tests/testData/completion/17_after.xml
new file mode 100644
index 0000000..371a6e7
--- /dev/null
+++ b/xml/tests/testData/completion/17_after.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance<caret>" targetNamespace="urn:schemas-dig-de:test2">
+</xs:schema>
diff --git a/xml/tests/testData/completion/19.xml b/xml/tests/testData/completion/19.xml
new file mode 100644
index 0000000..d4078eb
--- /dev/null
+++ b/xml/tests/testData/completion/19.xml
@@ -0,0 +1,9 @@
+<!DOCTYPE beans [
+<!ELEMENT property (#PCDATA)>
+<!ATTLIST pr<caret>
+]>
+<beans>
+  <bean class="java.lang.StringBuffer">
+    <property name="len"/>
+  </bean>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/19_after.xml b/xml/tests/testData/completion/19_after.xml
new file mode 100644
index 0000000..f002e7e
--- /dev/null
+++ b/xml/tests/testData/completion/19_after.xml
@@ -0,0 +1,9 @@
+<!DOCTYPE beans [
+<!ELEMENT property (#PCDATA)>
+<!ATTLIST property<caret>
+]>
+<beans>
+  <bean class="java.lang.StringBuffer">
+    <property name="len"/>
+  </bean>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/20.xml b/xml/tests/testData/completion/20.xml
new file mode 100644
index 0000000..66be1f2
--- /dev/null
+++ b/xml/tests/testData/completion/20.xml
@@ -0,0 +1,3 @@
+<!DOCTYPE html PUBLIC "" "http://www.w3.org/1999/xh<caret>">
+<html>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/21.xml b/xml/tests/testData/completion/21.xml
new file mode 100644
index 0000000..fc61925
--- /dev/null
+++ b/xml/tests/testData/completion/21.xml
@@ -0,0 +1 @@
+<a<caret> xmlns="21.xsd">
diff --git a/xml/tests/testData/completion/21.xsd b/xml/tests/testData/completion/21.xsd
new file mode 100644
index 0000000..7ef6443
--- /dev/null
+++ b/xml/tests/testData/completion/21.xsd
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema targetNamespace="21.xsd" xmlns="21.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+  <xs:include schemaLocation="21_2.xsd"/>
+  <xs:element name="bbb">
+  </xs:element>
+</xs:schema>
diff --git a/xml/tests/testData/completion/21_2.xsd b/xml/tests/testData/completion/21_2.xsd
new file mode 100644
index 0000000..c7984fc
--- /dev/null
+++ b/xml/tests/testData/completion/21_2.xsd
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema targetNamespace="21.xsd" xmlns="21.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+  <xs:element name="aaa">
+  </xs:element>
+</xs:schema>
diff --git a/xml/tests/testData/completion/21_after.xml b/xml/tests/testData/completion/21_after.xml
new file mode 100644
index 0000000..c22b1f9
--- /dev/null
+++ b/xml/tests/testData/completion/21_after.xml
@@ -0,0 +1 @@
+<aaa<caret> xmlns="21.xsd">
diff --git a/xml/tests/testData/completion/22.xsd b/xml/tests/testData/completion/22.xsd
new file mode 100644
index 0000000..9bc94f0
--- /dev/null
+++ b/xml/tests/testData/completion/22.xsd
@@ -0,0 +1,10 @@
+<xs:schema targetNamespace="22.xsd" xmlns="22.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+  <xs:element name="bbb"/>
+  <xs:element name="ccc">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="b<caret>"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/22_after.xsd b/xml/tests/testData/completion/22_after.xsd
new file mode 100644
index 0000000..f15c4b1
--- /dev/null
+++ b/xml/tests/testData/completion/22_after.xsd
@@ -0,0 +1,10 @@
+<xs:schema targetNamespace="22.xsd" xmlns="22.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+  <xs:element name="bbb"/>
+  <xs:element name="ccc">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="bbb"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/23.xsd b/xml/tests/testData/completion/23.xsd
new file mode 100644
index 0000000..db247582
--- /dev/null
+++ b/xml/tests/testData/completion/23.xsd
@@ -0,0 +1,11 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	   elementFormDefault="qualified"
+	   attributeFormDefault="unqualified"
+           xmlns:aaa="AAA"
+           targetNamespace="AAA">
+	<xs:complexType name="Y">
+	  <xs:sequence>
+            <xs:element type="aaa<caret>" />
+          </xs:sequence>	
+	</xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/completion/23_after.xsd b/xml/tests/testData/completion/23_after.xsd
new file mode 100644
index 0000000..8bcfa41
--- /dev/null
+++ b/xml/tests/testData/completion/23_after.xsd
@@ -0,0 +1,11 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	   elementFormDefault="qualified"
+	   attributeFormDefault="unqualified"
+           xmlns:aaa="AAA"
+           targetNamespace="AAA">
+	<xs:complexType name="Y">
+	  <xs:sequence>
+            <xs:element type="aaa:Y<caret>" />
+          </xs:sequence>	
+	</xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/completion/25.xml b/xml/tests/testData/completion/25.xml
new file mode 100644
index 0000000..b72e27f
--- /dev/null
+++ b/xml/tests/testData/completion/25.xml
@@ -0,0 +1,8 @@
+ <FEUAddMessages>
+      <feu:full-event-update xmlns:feu="http://www.dummy-temp-address">
+         <message-header>
+            <sender>abc</sender>
+             <se<caret>
+         </message-header>
+      </feu:full-event-update>
+   </FEUAddMessages>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/25.xsd b/xml/tests/testData/completion/25.xsd
new file mode 100644
index 0000000..907366a
--- /dev/null
+++ b/xml/tests/testData/completion/25.xsd
@@ -0,0 +1,19 @@
+<xs:schema targetNamespace="http://www.dummy-temp-address"
+   xmlns="http://www.dummy-temp-address"
+   xmlns:xs="http://www.w3.org/2001/XMLSchema"
+   xmlns:cars="http://www.crc-corp.com/schemas/cars/schema_annotation"
+   elementFormDefault="unqualified"
+   attributeFormDefault="unqualified"
+   version="DRAFT">
+<xs:element name="full-event-update" type="FullEventUpdate"/>
+<xs:complexType name="FullEventUpdate" >
+      <xs:sequence>
+         <xs:element name="message-header" type="MessageHeader" />
+      </xs:sequence>
+</xs:complexType>
+<xs:complexType name="MessageHeader" >
+      <xs:sequence>
+         <xs:element name="sender" type="xs:string" />
+      </xs:sequence>
+</xs:complexType>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/25_after.xml b/xml/tests/testData/completion/25_after.xml
new file mode 100644
index 0000000..5bb913f
--- /dev/null
+++ b/xml/tests/testData/completion/25_after.xml
@@ -0,0 +1,8 @@
+ <FEUAddMessages>
+      <feu:full-event-update xmlns:feu="http://www.dummy-temp-address">
+         <message-header>
+            <sender>abc</sender>
+             <sender><caret></sender>
+         </message-header>
+      </feu:full-event-update>
+   </FEUAddMessages>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/27.xsd b/xml/tests/testData/completion/27.xsd
new file mode 100644
index 0000000..23f45b8
--- /dev/null
+++ b/xml/tests/testData/completion/27.xsd
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema version="1.0" xml:lang="en"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.w3.org/1999/xhtml"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:xml="http://www.w3.org/XML/1998/namespace"
+    elementFormDefault="qualified">
+
+  <xs:group name="special">
+    <xs:choice>
+      <xs:element ref="obj<caret>"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:element name="objectXYZ">
+    <xs:complexType mixed="true">
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/27_after.xsd b/xml/tests/testData/completion/27_after.xsd
new file mode 100644
index 0000000..3382e69
--- /dev/null
+++ b/xml/tests/testData/completion/27_after.xsd
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema version="1.0" xml:lang="en"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.w3.org/1999/xhtml"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:xml="http://www.w3.org/XML/1998/namespace"
+    elementFormDefault="qualified">
+
+  <xs:group name="special">
+    <xs:choice>
+      <xs:element ref="objectXYZ"<caret>/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:element name="objectXYZ">
+    <xs:complexType mixed="true">
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/28.ent b/xml/tests/testData/completion/28.ent
new file mode 100644
index 0000000..70d898b
--- /dev/null
+++ b/xml/tests/testData/completion/28.ent
@@ -0,0 +1,19 @@
+<!ENTITY ORGS.ACCOUNTABILITY_ROLE "ACCOUNTABILITY_ROLE">
+<!ENTITY ORGS.ADDRESS_TYPE "ADDRESS_TYPE">
+<!ENTITY ORGS.JDO_CLASS "JDO_CLASS">
+<!ENTITY ORGS.MEMBER "MEMBER">
+<!ENTITY ORGS.MEMBER_INFO "MEMBER_INFO">
+<!ENTITY ORGS.ORG_UNIT "ORG_UNIT">
+<!ENTITY ORGS.ORG_UNIT_LINK "ORG_UNIT_LINK">
+<!ENTITY ORGS.ORG_UNIT_LINK_TYPE "ORG_UNIT_LINK_TYPE">
+<!ENTITY ORGS.ORG_UNIT_TYPE "ORG_UNIT_TYPE">
+<!ENTITY ORGS.ORG_UNIT_TYPE_ROLE "ORG_UNIT_TYPE_ROLE">
+<!ENTITY ORGS.POLITICAL_PARTY "POLITICAL_PARTY">
+<!ENTITY ORGS.POSITION "POSITION">
+<!ENTITY ORGS.POSITION_ACCOUNTABILITY "POSITION_ACCOUNTABILITY">
+<!ENTITY ORGS.POSITION_ADDRESS "POSITION_ADDRESS">
+<!ENTITY ORGS.POSITION_COMPATIBILITY_GROUP "POSITION_COMPATIBILITY_GROUP">
+<!ENTITY ORGS.POST "POST">
+<!ENTITY ORGS.POST_ACCOUNTABILITY "POST_ACCOUNTABILITY">
+<!ENTITY ORGS.ROLE "ROLE">
+<!ENTITY ORGS.ROLE_GROUP "ROLE_GROUP">
\ No newline at end of file
diff --git a/xml/tests/testData/completion/28.xml b/xml/tests/testData/completion/28.xml
new file mode 100644
index 0000000..4591d18
--- /dev/null
+++ b/xml/tests/testData/completion/28.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapping [
+  <!ENTITY % package.tables SYSTEM  "28.ent">
+  %package.tables;
+]>
+
+<mapping>
+  <package name="com.peacetech.orgs.jdo">
+    <class name="AccountabilityRoleImpl">
+      <jdbc-class-map type="base" table="&ORGS.ACC<caret>"/>
+    </class>
+   </package>
+</mapping>
diff --git a/xml/tests/testData/completion/28_after.xml b/xml/tests/testData/completion/28_after.xml
new file mode 100644
index 0000000..f80b8d7
--- /dev/null
+++ b/xml/tests/testData/completion/28_after.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapping [
+  <!ENTITY % package.tables SYSTEM  "28.ent">
+  %package.tables;
+]>
+
+<mapping>
+  <package name="com.peacetech.orgs.jdo">
+    <class name="AccountabilityRoleImpl">
+      <jdbc-class-map type="base" table="&ORGS.ACCOUNTABILITY_ROLE;<caret>"/>
+    </class>
+   </package>
+</mapping>
diff --git a/xml/tests/testData/completion/29.xml b/xml/tests/testData/completion/29.xml
new file mode 100644
index 0000000..e844a84
--- /dev/null
+++ b/xml/tests/testData/completion/29.xml
@@ -0,0 +1,3 @@
+<userrole xmlns="aaa">
+  <la<caret>
+</userrole>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/29.xsd b/xml/tests/testData/completion/29.xsd
new file mode 100644
index 0000000..8bd2b16
--- /dev/null
+++ b/xml/tests/testData/completion/29.xsd
@@ -0,0 +1,21 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="aaa">
+  <xs:element name="userrole">
+    <xs:complexType mixed="true">
+      <xs:sequence minOccurs="0">
+        <xs:any namespace="http://www.w3.org/1999/xhtml ##targetNamespace" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="label">
+    <xs:complexType>
+      <xs:attribute name="key" use="required">
+        <xs:simpleType>
+          <xs:restriction base="xs:string">
+            <xs:whiteSpace value="collapse"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/29_after.xml b/xml/tests/testData/completion/29_after.xml
new file mode 100644
index 0000000..0c52404
--- /dev/null
+++ b/xml/tests/testData/completion/29_after.xml
@@ -0,0 +1,3 @@
+<userrole xmlns="aaa">
+  <label key=""<caret>
+</userrole>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/30.dtd b/xml/tests/testData/completion/30.dtd
new file mode 100644
index 0000000..909d0c0
--- /dev/null
+++ b/xml/tests/testData/completion/30.dtd
@@ -0,0 +1,3475 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!-- $Id: waveset.dtd,v 1.75 2006/04/20 22:29:53 gw149702 Exp $ -->
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= DTD for Waveset Objects                             =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ENTITY % deprecatedObjects
+  "ConfigurationKeyword |
+   WorkflowConfig |
+   WorkflowProcess |
+   WorkflowCase |
+   WorkflowTask">
+
+<!ENTITY % persistentObject
+  "Administrator |
+  AdminGroup |
+  AdminRole |
+  AuditConfig |
+  AuditPolicy |
+  ComplianceViolation |
+  AuditQuery |
+  ObjectGroup |
+  LoginConfig |
+  Policy |
+  Resource |
+  ResourceAction |
+  ResourceAccount |
+  Account |
+  Application |
+  LoginApp |
+  LoginModGroup |
+  Role |
+  User |
+  AttributeDefinition |
+  EmailTemplate |
+  Rule |
+  Extract |
+  LoadConfig |
+  WorkItem |
+  Discovery |
+  Configuration |
+  TaskDefinition |
+  TaskSchedule |
+  TaskInstance |
+  TaskResult |
+  TaskResultPage |
+  TaskTemplate |
+  RemedyConfig |
+  DataStore |
+  Server |
+  ServerRepository |
+  EncryptionKey |
+  RepositoryConfiguration |
+  ReportLog |
+  ReportCounter |
+  UsageReport |
+  Form |
+  Log |
+  Syslog |
+  AttrParse |
+  XmlData |
+  SnapShot |
+  MetaView |
+  Miscellaneous |
+  %deprecatedObjects;
+  ">
+
+<!-- The root for configuration import files. -->
+
+<!ELEMENT Waveset ((
+  %persistentObject; |
+  WavesetResult |
+  ImportCommand
+)*)>
+
+<!-- The root for exchange files. -->
+
+<!ELEMENT Exchange ((
+  User
+)*)>
+
+<!ATTLIST Exchange
+  source CDATA #IMPLIED
+>
+
+<!-- bug#422: Deprecating "lastModTime" in favor of "lastMod"  -->
+<!ENTITY % persistentObjectAttributes
+  "id CDATA #IMPLIED
+   name CDATA #IMPLIED
+   authType CDATA #IMPLIED
+   lock CDATA #IMPLIED
+   displayName CDATA #IMPLIED
+   subtype CDATA #IMPLIED
+   creator CDATA #IMPLIED
+   createDate CDATA #IMPLIED
+   lastModifier CDATA #IMPLIED
+   lastModDate CDATA #IMPLIED
+   counter CDATA #IMPLIED
+   wstype CDATA #IMPLIED
+   protected (true | false) 'false'
+   protectedFromDelete (true | false) 'false'
+   hidden (true | false) 'false'
+   lastModTime CDATA #IMPLIED
+   lastMod CDATA #IMPLIED
+">
+
+<!ENTITY % persistentObjectElements
+  "MemberObjectGroups | Properties">
+
+<!ELEMENT MemberObjectGroups ((ObjectRef)*)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= XPRESS Functions                                    =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ENTITY % exnode
+  "s | i | o | null | ref | extref | set | get | block | if | then | else |
+    call | print | defun | defvar | defarg | eval |
+    eq | neq | gt | gte | lt | lte | and | or | not | select | cmp | ncmp |
+    isTrue | isFalse | isnull | notnull | add | sub | mult | div | mod |
+    trim | ltrim | rtrim | ztrim | upcase | downcase |
+    substr | concat | join | expand | cond | switch |
+    match | trace | breakpoint | index | member | getobj | list | array | map |
+    lconcat | filterdup | filternull | indexOf | split | insert |
+    remove | removeAll | append | appendAll | retainAll |
+    contains | containsAny | containsAll |
+    while | dolist | length | break | pad | new | invoke |
+    script | message | rule | instanceof">
+
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Generic XML Objects                                 =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!-- Generic XML objects, plus some waveset-specific ones we've defined. -->
+<!ENTITY % xmlObject
+  " %persistentObject; |
+   WavesetResult | ResultError | ResourceResult | ResultTable |
+   ResultData | Report | RepositoryResult |
+   WFProcess | WFCase | EncryptedData | Binary | AuthContext | Library |
+   RepositoryConfiguration | Form | SOAPConfig | UserUIConfig | ObjectRef |
+   null | Map | List | String | Integer | Long | Boolean | Date | Object |
+   Op | OpField | BulkOpTaskState | GenericAttribute |
+   Message | ErrorMessage | DeviceResetConfig | Component | Attribute |
+   RoleAttribute | TimePeriod | Question | CustomCatalog |
+   ResourceInfo | Subject | SimpleProperties | AttributeCondition |
+   Variable | Activity | Action | Argument | Return | ActionResult |
+   Transition | AuthTypes | Modification | License |
+   Field | FieldLoop | FieldRef | FormRef | Number | DateTime | Display |
+   ManualAction | MetaViewAttribute | CertificateData | SignedData |
+   MetaViewTarget | MetaViewSource">
+
+<!-- we frequently want to mix XPRESS nodes and XML Objects -->
+
+<!ENTITY % exnodeOrObject "%exnode; | %xmlObject; | expression">
+
+<!ELEMENT String (#PCDATA)>
+<!ELEMENT Integer (#PCDATA)>
+<!ELEMENT Long (#PCDATA)>
+<!ELEMENT Boolean (#PCDATA)>
+<!ELEMENT Date (#PCDATA)>
+
+<!ELEMENT List ((%xmlObject;)*)>
+
+<!ELEMENT Map ((MapEntry)*)>
+
+<!-- sigh, trying to deprecate MapKey and MapValue but have to leave around
+  == for awhile
+-->
+<!ELEMENT MapEntry (MapKey?, MapValue?, (%xmlObject;)*)>
+<!ATTLIST MapEntry
+  key CDATA #IMPLIED
+  value CDATA #IMPLIED
+>
+<!ELEMENT MapKey (%xmlObject;)>
+<!ELEMENT MapValue (%xmlObject;)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Some simple XML Objects                             =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT EncryptedData (#PCDATA)>
+<!ELEMENT Binary (#PCDATA)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Property Lists                                      =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!-- Similar to Map but key must be a string and Property
+     looks better embedded in things than MapEntry
+     Added the ability for a Property value to be calculated
+     by an expression.  This is used for properties within
+     Display elements, so we're kind of overloading the
+     element in two contexts.  Still, it might be useful to
+     allow general property lists to have calculated
+     values, so lets allow it.
+-->
+
+<!ELEMENT Properties ((Property)*)>
+<!ELEMENT Property ((%exnodeOrObject;)?)>
+<!ATTLIST Property
+  name CDATA #REQUIRED
+  value CDATA #IMPLIED
+>
+
+<!-- a semantically higher level bag-o-properties -->
+
+<!ELEMENT Component ((Property)*)>
+<!ATTLIST Component
+  class CDATA #IMPLIED
+>
+
+<!-- Simple name=value style properties as content -->
+
+<!ELEMENT SimpleProperties (#PCDATA)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= ObjectRef                                           =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!-- might want to reconsider generic object refs, and instead
+  == have type-specific reference elements?
+  -->
+
+<!ELEMENT ObjectRef EMPTY>
+<!ATTLIST ObjectRef
+  type CDATA #REQUIRED
+  id   CDATA #IMPLIED
+  name CDATA #IMPLIED
+  displayName CDATA #IMPLIED
+  qualifier CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Configuration                                       =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Configuration ((Extension | FormRef | %persistentObjectElements;)*)>
+<!ATTLIST Configuration
+  %persistentObjectAttributes;
+  type CDATA #IMPLIED
+>
+
+<!ELEMENT Extension ((%xmlObject;)*)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= AuditConfig                                         =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT AuditConfig ((FilterGroup | %persistentObjectElements;)*)>
+<!ATTLIST AuditConfig
+  %persistentObjectAttributes;
+  AuditState CDATA #IMPLIED
+  RecordLife CDATA #IMPLIED
+>
+
+<!ELEMENT FilterGroup ((Filter)*)>
+<!ATTLIST FilterGroup
+  GroupName CDATA #IMPLIED
+  SuccessState CDATA #IMPLIED
+  FailureState CDATA #IMPLIED
+>
+
+<!-- This is really empty, but the toXml method is emitting
+     a newline with an end tag, so we have to allow text.
+-->
+<!ELEMENT Filter (#PCDATA)>
+<!ATTLIST Filter
+  fname CDATA #IMPLIED
+  filtermask CDATA #IMPLIED
+  objecttype CDATA #IMPLIED
+  action CDATA #IMPLIED
+  status CDATA #IMPLIED
+  SuccessState CDATA #IMPLIED
+  FailureState CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= RemedyConfig                                        =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+
+<!ELEMENT RemedyConfig ((
+  RemedyTemplate |
+  %persistentObjectElements;)*)>
+
+<!ATTLIST RemedyConfig
+  %persistentObjectAttributes;
+  isConfigured CDATA #IMPLIED
+  UserName CDATA #IMPLIED
+  Password CDATA #IMPLIED
+  RemedyServer CDATA #IMPLIED
+>
+
+<!ELEMENT RemedyTemplate (( RemedyField )*)>
+<!ATTLIST RemedyTemplate
+  name CDATA #IMPLIED
+  schema CDATA #IMPLIED
+>
+
+<!ELEMENT RemedyField (( RemedyEnumValue )*)>
+<!ATTLIST RemedyField
+  name CDATA #IMPLIED
+  Id CDATA #IMPLIED
+  type CDATA #IMPLIED
+  value CDATA #IMPLIED
+>
+
+<!ELEMENT RemedyEnumValue EMPTY>
+<!ATTLIST RemedyEnumValue
+  choice CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= AuditQuery                                          =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT AuditQuery (( QueryConditions | %persistentObjectElements;)*)>
+<!ATTLIST AuditQuery %persistentObjectAttributes; >
+
+<!ELEMENT QueryConditions (AttributeCondition+)>
+
+<!ELEMENT AttributeCondition EMPTY>
+<!ATTLIST AttributeCondition
+  attrName CDATA #REQUIRED
+  operator CDATA #REQUIRED
+  operand  CDATA #REQUIRED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= WorkflowRegistry                                    =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT WorkflowRegistry ((WorkflowApplication)*)>
+
+<!ELEMENT WorkflowApplication
+  ((ArgumentDefinition | ResultDefinition | Comments)*)>
+
+<!ATTLIST WorkflowApplication
+  name     CDATA #IMPLIED
+  internal CDATA #IMPLIED
+  class    CDATA #IMPLIED
+  op       CDATA #IMPLIED
+  randomArguments (true | false) 'false'
+>
+
+<!ELEMENT ArgumentDefinition
+  ((Comments | AllowedValues | (%xmlObject;))*)>
+
+<!ATTLIST ArgumentDefinition
+  name CDATA #REQUIRED
+  displayName CDATA #IMPLIED
+  value CDATA #IMPLIED
+  required (true | false) 'false'
+  hidden (true | false) 'false'
+  from CDATA #IMPLIED
+>
+
+<!ELEMENT AllowedValues ((ValueDefinition | (%xmlObject;))*)>
+<!ATTLIST AllowedValues
+  allowOthers (true | false) 'false'
+>
+
+<!ELEMENT ValueDefinition (Comments?)>
+<!ATTLIST ValueDefinition
+  name CDATA #REQUIRED
+  value CDATA #IMPLIED
+>
+
+<!ELEMENT ResultDefinition (Comments?)>
+<!ATTLIST ResultDefinition
+  name CDATA #REQUIRED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= FormRegistry                                        =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT FormRegistry ((HTMLComponent)*)>
+
+<!ELEMENT HTMLComponent ((
+  PropertyDefinition |
+  Comments
+)*)>
+
+<!-- excludeProperties is deprecated -->
+
+<!ATTLIST HTMLComponent
+  name CDATA #REQUIRED
+  extends CDATA #IMPLIED
+  primary CDATA #IMPLIED
+  exclude CDATA #IMPLIED
+  excludeProperties (true | false) 'false'
+>
+
+<!ELEMENT PropertyDefinition ((Comments | AllowedValues)*)>
+
+<!ATTLIST PropertyDefinition
+  name CDATA #REQUIRED
+  type CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= RuleRegistry                                        =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT RuleRegistry ((XFunction)*)>
+
+<!ELEMENT XFunction ((
+  XSignature |
+  XAttribute |
+  XArgument |
+  Comments
+)*)>
+
+<!ATTLIST XFunction
+  name CDATA #REQUIRED
+  varargs (true | false) 'false'
+  argtype CDATA #IMPLIED
+  mixed (true | false) 'false'
+  tip CDATA #IMPLIED
+>
+
+<!ELEMENT XSignature ((
+  XAttribute |
+  XArgument |
+  Comments
+)*)>
+
+<!ATTLIST XSignature
+  name CDATA #IMPLIED
+  varargs (true | false) 'false'
+  argtype CDATA #IMPLIED
+  mixed (true | false) 'false'
+  tip CDATA #IMPLIED
+>
+
+<!ELEMENT XAttribute ((
+  Comments
+)*)>
+
+<!ATTLIST XAttribute
+  name CDATA #IMPLIED
+  type (string | int | boolean | script | any | object | ref) 'string'
+  prompt CDATA #IMPLIED
+  default CDATA #IMPLIED
+  required (true | false) 'false'
+>
+
+<!ELEMENT XArgument ((
+  Comments
+)*)>
+
+<!ATTLIST XArgument
+  name CDATA #IMPLIED
+  type CDATA #IMPLIED
+  prompt CDATA #IMPLIED
+  default CDATA #IMPLIED
+  annotation CDATA #IMPLIED
+  required (true | false) 'false'
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= WFProcess                                           =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT WFProcess ((
+    Variable |
+    Transition |
+    Activity |
+    ReportTitle |
+    Status |
+    Comments |
+    WFProcess)*)
+>
+<!ATTLIST WFProcess
+  name CDATA #IMPLIED
+  title CDATA #IMPLIED
+  trace CDATA #IMPLIED
+  maxSteps CDATA #IMPLIED
+  audit (true | false) 'false'
+>
+
+<!ELEMENT Status ((%exnode;)?)>
+<!ELEMENT Comments (#PCDATA)>
+
+<!ELEMENT WorkflowEditor EMPTY>
+<!ATTLIST WorkflowEditor
+  x CDATA #IMPLIED
+  y CDATA #IMPLIED
+>
+
+<!ELEMENT Variable ((Comments | (%exnodeOrObject;))*)>
+<!ATTLIST Variable
+  name	  CDATA #REQUIRED
+  value	  CDATA #IMPLIED
+  input   (true | false) 'false'
+  output   (true | false) 'false'
+  external   (true | false) 'false'
+>
+
+<!-- Join, Owner, Split are deprecated -->
+
+<!ELEMENT Activity ((
+    WorkflowEditor |
+    ReportTitle |
+    Join |
+    Owner |
+    Variable |
+    Action |
+    ManualAction |
+    JoinBreak |
+    Transition |
+    Comments |
+    Split |
+    FormRule)*)>
+
+<!ATTLIST Activity
+  name CDATA #REQUIRED
+  id CDATA #IMPLIED
+  audit (true | false) 'false'
+  andJoin (true | false) 'false'
+  andSplit (true | false) 'false'
+  hidden (true | false) 'false'
+>
+
+<!ELEMENT ReportTitle ((%exnode;)?)>
+<!ELEMENT JoinBreak ((%exnode;)?)>
+<!ELEMENT FormRule ((%exnode; | String)?)>
+
+<!-- ExternalProcess is deprecated, use SubProcess instead -->
+
+<!ELEMENT Action (
+  (ReportTitle | Iterate | Argument | Variable | Return |
+   ActionResult | Condition | Timeout | expression | script |
+   SubProcess | ExternalProcess | Comments |
+   WorkItemRequest | WorkItemRequester | WorkItemDescription | WorkItemDelegator |
+   (%exnode;) )*)>
+
+<!-- applicationClass and class are deprecated, always use application
+-->
+
+<!ATTLIST Action
+  name		   CDATA #IMPLIED
+  id               CDATA #IMPLIED
+  application	   CDATA #IMPLIED
+  process          CDATA #IMPLIED
+  timeout	   CDATA #IMPLIED
+  hidden (true | false) 'false'
+  applicationClass CDATA #IMPLIED
+  class            CDATA #IMPLIED
+  checkError	   (true | false) 'false'
+  audit CDATA #IMPLIED
+>
+
+<!ELEMENT SubProcess ((ObjectRef | String | (%exnode;)))>
+<!ELEMENT ExternalProcess (ObjectRef)>
+<!ELEMENT WorkItemRequest (%exnode;)>
+<!ELEMENT WorkItemRequester (%exnode;)>
+<!ELEMENT WorkItemDescription (%exnode;)>
+<!ELEMENT WorkItemDelegator ((%exnodeOrObject;)?)>
+
+<!ELEMENT ActionResult ((Comments | (%exnodeOrObject;))*)>
+<!ATTLIST ActionResult
+  name CDATA #IMPLIED
+  type CDATA #IMPLIED
+  value CDATA #IMPLIED
+  overwrite (true | false) 'false'
+  resultName CDATA #IMPLIED
+>
+
+<!ELEMENT ManualAction (
+    (Iterate | Owner | Argument | Variable | Return | Timeout |
+     FormRef | Form | FormRule | ReportTitle | Comments | Condition |
+     ExposedVariables | EditableVariables |
+     WorkItemRequest | WorkItemRequester | WorkItemDescription | WorkItemName | WorkItemDelegator |
+     ViewVariables)*
+)>
+
+<!ATTLIST ManualAction
+  name		   CDATA #IMPLIED
+  id               CDATA #IMPLIED
+  timeout	   CDATA #IMPLIED
+  hidden	   (true | false) 'false'
+  syncExec	   (true | false) 'false'
+  checkErrors	   (true | false) 'false'
+  ignoreTimeout	   (true | false) 'false'
+  itemType         CDATA #IMPLIED
+  authType         CDATA #IMPLIED
+>
+
+<!ELEMENT Owner ((%exnode;)?)>
+<!ATTLIST Owner
+  name CDATA #IMPLIED
+>
+
+<!ELEMENT WorkItemName ((%exnode;)?)>
+
+<!ELEMENT ExposedVariables ((%exnodeOrObject;)?)>
+<!ELEMENT EditableVariables ((%exnodeOrObject;)?)>
+<!ELEMENT ViewVariables (List?)>
+
+<!ELEMENT Condition (%exnode;)>
+<!ELEMENT Timeout (%exnode;)>
+
+<!-- name is deprectaed, appendTo is deprecated  -->
+<!ELEMENT Return ((Comments | (%exnodeOrObject;))*)>
+<!ATTLIST Return
+  from CDATA #IMPLIED
+  to CDATA #IMPLIED
+  append (true | false) 'false'
+  appendTo CDATA #IMPLIED
+  name CDATA #IMPLIED
+>
+
+<!ELEMENT Iterate (Break?)>
+<!ATTLIST Iterate
+  for CDATA #IMPLIED
+  in CDATA #IMPLIED
+>
+
+<!ELEMENT Break (%exnode;)>
+
+<!ELEMENT Argument ((Comments | (%exnodeOrObject;))*)>
+<!ATTLIST Argument
+  name CDATA #REQUIRED
+  value CDATA #IMPLIED
+  from CDATA #IMPLIED
+>
+
+<!ELEMENT Transition ((Comments | (%exnode;))*)>
+<!ATTLIST Transition to CDATA #REQUIRED>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= WFCase                                              =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT WFCase ((
+    (ObjectRef | Variables | Step | WavesetResult |
+     NewWorkItems | InvalidWorkItems | ValidatedProcesses)*
+)*)>
+
+<!ATTLIST WFCase
+  name CDATA #IMPLIED
+  pending (true | false) 'false'
+  complete (true | false) 'false'
+  terminated (true | false) 'false'
+  title CDATA #IMPLIED
+>
+
+<!ELEMENT NewWorkItems ((WorkItem)*)>
+<!ELEMENT InvalidWorkItems ((String)*)>
+<!ELEMENT ValidatedProcesses (List)>
+<!ELEMENT AutoTransitions ((String)*)>
+
+<!-- var list is deprected -->
+
+<!ELEMENT Variables ( (%xmlObject;)? | Map? | (var)*)>
+
+<!ELEMENT Step ((Variables | Result)*)>
+
+<!ATTLIST Step
+  id CDATA #IMPLIED
+  name CDATA #IMPLIED
+  title CDATA #IMPLIED
+  activityId CDATA #IMPLIED
+  state CDATA #IMPLIED
+  joins CDATA #IMPLIED
+  feeds CDATA #IMPLIED
+  transitions CDATA #IMPLIED
+  joinBreak (true | false) 'false'
+>
+
+<!ELEMENT Results ((Result)*)>
+
+<!--
+  status attribute is deprecated
+  Messages and Exception deprectaed
+-->
+
+<!ELEMENT Result ((Variables | Arguments | Result | WFCase)* |
+                  (Messages | Exception)*)>
+
+<!ATTLIST Result
+  actionId CDATA #IMPLIED
+  name CDATA #IMPLIED
+  status (ok | warning | error) #IMPLIED
+  complete (true | false) 'false'
+  workItem CDATA #IMPLIED
+  title CDATA #IMPLIED
+  timeout CDATA #IMPLIED
+  owner CDATA #IMPLIED
+>
+
+<!ELEMENT Messages ((msg)*)>
+
+<!ELEMENT msg (#PCDATA)>
+
+<!ELEMENT Exception (#PCDATA)>
+
+<!ELEMENT Arguments (Map?)>
+
+<!-- Old, holdover from the the original WorkflowCase,
+  == deprecate these!
+  == Value may be an attribute for simple strings, or pcdata if a more
+  == complex object.  I hate this, need to evolve a nice common
+  == name/value representation.
+  == Added ability to let the values be an XmlObject as well as pcdata.
+  -->
+<!ELEMENT var (%xmlObject;)>
+<!ATTLIST var
+  name	      CDATA #REQUIRED
+  value	      CDATA #IMPLIED
+  modified    (1 | 0) #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= WorkItem                                            =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT WorkItem ((
+    Description |
+    Variables |
+    Modifications |
+    TaskInstanceRef |
+    FormRef |
+    Form |
+    ViewVariables |
+    %persistentObjectElements;)*)>
+
+<!ELEMENT Modifications (Map?)>
+<!ELEMENT TaskInstanceRef (ObjectRef)>
+
+<!ATTLIST WorkItem
+  %persistentObjectAttributes;
+  owner		CDATA #REQUIRED
+  delegator CDATA #IMPLIED
+  process	CDATA #IMPLIED
+  activity	CDATA #IMPLIED
+  complete      (true | false) 'false'
+  dirty         (true | false) 'false'
+  timeout	CDATA #IMPLIED
+  syncExec	(true | false) 'false'
+  request       CDATA #IMPLIED
+  requester     CDATA #IMPLIED
+  ignoreTimeout (true | false) 'false'
+  itemType      CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Policy                                              =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Policy ((
+    Description |
+    Attributes |
+    GeoAttributes |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST Policy
+  %persistentObjectAttributes;
+  class CDATA #REQUIRED
+>
+
+<!ELEMENT Description (#PCDATA)>
+<!ELEMENT GeoAttributes ((%xmlObject;) | expression)?>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Resource                                            =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Resource ((
+    IdPolicy |
+    PasswordPolicy |
+    ResourcePasswordPolicy |
+    ExcludedAccountsRule |
+    ResourceAttributes |
+    AccountAttributeTypes |
+    Template |
+    Retries |
+    Approvers |
+    Notifyees |
+    LoginConfigEntry |
+    ResourceUserForm |
+    ObjectTypes |
+    Features |
+    UserNameGenerationRule | UserAccountConfirmationRule |
+    RPCEncryptionKey |
+    AccountTypes |
+    %persistentObjectElements;)*)
+>
+
+<!ATTLIST Resource
+  %persistentObjectAttributes;
+  class CDATA #REQUIRED
+  hasId (true | false) 'true'
+  supportsScanning (true | false) 'false'
+  typeString CDATA #IMPLIED
+  typeDisplayString CDATA #IMPLIED
+  noDelete (true | false) #IMPLIED
+  applicationName CDATA #IMPLIED
+  timeLastExamined CDATA #IMPLIED
+  reconcileTime CDATA #IMPLIED
+  deprecated (true | false) 'false'
+  unlockOnPasswordReset (true | false) 'false'
+  syncSource CDATA #IMPLIED
+  facets CDATA #IMPLIED
+  startupType CDATA #IMPLIED
+>
+
+<!ELEMENT IdPolicy (ObjectRef)>
+<!ELEMENT PasswordPolicy (ObjectRef)>
+<!ELEMENT ResourcePasswordPolicy (ObjectRef)>
+<!ELEMENT ExcludedAccountsRule (ObjectRef)>
+<!ELEMENT RPCEncryptionKey (ObjectRef)>
+
+<!ELEMENT Template ((text | AttrDef | ObjectRef)*)>
+
+<!ELEMENT Retries EMPTY>
+<!ATTLIST Retries
+  max CDATA #IMPLIED
+  delay CDATA #IMPLIED
+  email CDATA #IMPLIED
+  emailThreshold CDATA #IMPLIED>
+
+<!ELEMENT text (#PCDATA)>
+<!ELEMENT AttrDef EMPTY>
+<!ATTLIST AttrDef
+  name CDATA #REQUIRED
+  type CDATA #IMPLIED
+  syntax CDATA 'string'
+  multi (true | false) 'false'
+>
+
+<!ELEMENT ResourceUserForm ((ObjectRef)*)>
+
+<!ELEMENT ObjectTypes ((ObjectType)*)>
+
+<!ELEMENT ObjectType ((ObjectClasses | ObjectFeatures | ObjectAttributes)*)>
+<!ATTLIST ObjectType
+  name CDATA #REQUIRED
+  nameKey CDATA #IMPLIED
+  icon CDATA #IMPLIED
+  container (true | false) 'false'
+  products CDATA #IMPLIED
+>
+
+<!ELEMENT ObjectClasses ((ObjectClass)*)>
+<!ATTLIST ObjectClasses
+  primary  CDATA #IMPLIED
+  operator CDATA #REQUIRED
+>
+
+<!ELEMENT ObjectClass EMPTY>
+<!ATTLIST ObjectClass
+  name CDATA #REQUIRED
+>
+
+<!ELEMENT ObjectFeatures ((ObjectFeature)*)>
+
+<!ELEMENT ObjectFeature EMPTY>
+<!ATTLIST ObjectFeature
+  name CDATA #REQUIRED
+  defaultForm CDATA #IMPLIED
+  form CDATA #IMPLIED
+  target CDATA #IMPLIED
+>
+
+<!ELEMENT ObjectAttributes ((ObjectAttribute)*)>
+<!ATTLIST ObjectAttributes
+  idAttr CDATA #IMPLIED
+  displayNameAttr CDATA #IMPLIED
+  descriptionAttr CDATA #IMPLIED
+  objectClassAttr CDATA #IMPLIED
+>
+
+<!ELEMENT ObjectAttribute EMPTY>
+<!ATTLIST ObjectAttribute
+  name CDATA #REQUIRED
+  type CDATA #IMPLIED
+  namingAttr CDATA #IMPLIED
+  audit (true | false) 'false'
+>
+
+<!ELEMENT Features ((Feature)*)>
+
+<!ELEMENT Feature EMPTY>
+<!ATTLIST Feature
+  name CDATA #REQUIRED
+  denied (true | false) 'false'
+  onDeny (ignore | error) 'error'
+>
+
+<!ELEMENT AccountTypes (Map)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= ResourceAttributes                                  =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT ResourceAttributes ((ResourceAttribute)*)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= AccountAttributeTypes                               =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT AccountAttributeTypes ((AccountAttributeType)*)>
+<!ATTLIST AccountAttributeTypes
+  nextId CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= ResourceAttribute                                   =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT ResourceAttribute ((value)*)>
+<!ATTLIST ResourceAttribute
+  name CDATA #REQUIRED
+  displayName CDATA #IMPLIED
+  type CDATA #IMPLIED
+  syntax CDATA #IMPLIED
+  noTrim (true|false) #IMPLIED
+  multi (true | false) #IMPLIED
+  description CDATA #IMPLIED
+  value CDATA #IMPLIED
+  facets CDATA #IMPLIED
+  parameter (true|false) #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= value                                               =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!-- Originally used "value" for simple literals, but we also
+  == need to store semi-arbitrary objects in a few places.
+  == Added "object", though I suppose we could merge that
+  == with "value"?
+  -->
+
+<!ELEMENT value (#PCDATA)>
+<!ATTLIST value
+  type CDATA #IMPLIED
+  syntax (string | int) 'string'
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= AccountAttributeType                                =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT AccountAttributeType ((value | AttributeDefinitionRef | Views)*)>
+<!ATTLIST AccountAttributeType
+  id CDATA #IMPLIED
+  name CDATA #REQUIRED
+  mapName CDATA #REQUIRED
+  mapType CDATA #REQUIRED
+  required (true | false) 'false'
+  auditable (true | false) 'false'
+  multi (true | false) 'false'
+  ordered (true | false) 'false'
+  readOnly (true | false) 'false'
+  writeOnly (true | false) 'false'
+  visualize (true | false) 'false'
+  type CDATA #IMPLIED
+  syntax CDATA #IMPLIED
+  value CDATA #IMPLIED
+>
+
+<!ELEMENT Views ((String)*)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Application                                         =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Application ((
+    Resources |
+    Services |
+    RoleAttributes |
+    RoleExclusionRefs |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST Application
+  %persistentObjectAttributes;
+  opaque (true | false) 'false'
+  ordered (true | false) 'false'
+>
+
+<!ELEMENT Resources ((ObjectRef)*)>
+<!ELEMENT RoleAttributes ((RoleAttribute)*)>
+<!ELEMENT RoleExclusionRefs ((ObjectRef)*)>
+<!ELEMENT Authenticator (ObjectRef?)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= LoginApp                                            =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT LoginApp ((
+    LoginModGroups |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST LoginApp
+  %persistentObjectAttributes;
+  subjectTimeout CDATA #REQUIRED
+  obfuscateLoginErrors (true | false) 'false'
+  disabled (true | false) 'false'
+>
+
+<!ELEMENT LoginModGroups ((ObjectRef)*)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= LoginModGroup                                       =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+<!ELEMENT LoginModGroup ((
+    LoginConfigEntryRefs |
+    LoginConstraintRule |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST LoginModGroup
+    %persistentObjectAttributes;
+>
+<!ELEMENT LoginConfigEntryRefs ((LoginConfigEntryRef)*)>
+<!ELEMENT LoginConfigEntryRef (AuthnPropertyRefs?,
+                               UidAttributes?,
+                               Contexts?,
+                               LoginCorrelationRule?,
+                               NewUserNameRule?)>
+<!ATTLIST LoginConfigEntryRef
+    name CDATA #REQUIRED
+    authnResourceType CDATA #REQUIRED
+    authnResourceName CDATA #IMPLIED
+    authnResourceDisplayName CDATA #IMPLIED
+    control CDATA #REQUIRED
+>
+
+<!ELEMENT AuthnPropertyRefs ((AuthnPropertyRef)*)>
+
+<!ELEMENT AuthnPropertyRef EMPTY>
+<!ATTLIST AuthnPropertyRef
+    name CDATA #REQUIRED
+    mapName CDATA #IMPLIED
+    wsAdminId CDATA #IMPLIED
+>
+
+<!ELEMENT UidAttributes ((UidAttribute)*)>
+
+<!ELEMENT UidAttribute EMPTY>
+<!ATTLIST UidAttribute
+    name CDATA #REQUIRED
+>
+
+<!ELEMENT Contexts ((Context)*)>
+
+<!ELEMENT Context EMPTY>
+<!ATTLIST Context
+    name CDATA #REQUIRED
+>
+
+<!ELEMENT LoginConstraintRule (ObjectRef)>
+<!ELEMENT LoginCorrelationRule (ObjectRef)>
+<!ELEMENT NewUserNameRule (ObjectRef)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= LoggedInTo                                          =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT LoggedInTo ((%xmlObject;)*)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Role                                                =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Role ((
+          PasswordExpiry |
+          PasswordExpiryWarning |
+          TempPasswordExpiry |
+          AuthenticationQuestions |
+          ResetLimit |
+          Services |
+          SuperRoles |
+          Approvers |
+          Notifyees |
+          ApprovalAdministrator |
+          Resources |
+          RoleAttributes |
+          RoleExclusionRefs |
+          %persistentObjectElements;)*)
+>
+
+<!ATTLIST Role
+  %persistentObjectAttributes;
+  administrator         CDATA #IMPLIED
+  idSource                CDATA #IMPLIED
+  passwordSource        CDATA #IMPLIED
+  provisionCheck        CDATA #IMPLIED
+  accountLock                CDATA #IMPLIED
+  resetOption                CDATA #IMPLIED
+  resetCheck                CDATA #IMPLIED
+  questionPolicy        CDATA #IMPLIED
+  randomQuestionCount   CDATA #IMPLIED
+  roundRobinQuestionIndex CDATA #IMPLIED
+  opaque (true | false) 'false'
+  ordered (true | false) 'false'
+>
+
+<!ELEMENT PasswordExpiry (TimePeriod)>
+
+<!ELEMENT PasswordExpiryWarning (TimePeriod)>
+
+<!ELEMENT TempPasswordExpiry (TimePeriod)>
+
+<!ELEMENT AuthenticationQuestions ((Question)*)>
+<!ELEMENT Question (#PCDATA)>
+<!ATTLIST Question
+  id CDATA #REQUIRED
+>
+
+<!ELEMENT ResetLimit (TimePeriod?)>
+<!ATTLIST ResetLimit count CDATA #IMPLIED>
+
+<!ELEMENT Services ((ObjectRef)*)>
+<!ELEMENT SuperRoles ((ObjectRef)*)>
+
+<!-- deprecated, should see Approvers -->
+<!ELEMENT ApprovalAdministrator ((ObjectRef)*)>
+
+<!ELEMENT Approvers ((ObjectRef)*)>
+<!ELEMENT Notifyees ((ObjectRef)*)>
+
+<!ELEMENT TimePeriod EMPTY>
+<!ATTLIST TimePeriod
+  unit (minutes | hours | days | weeks | months) #REQUIRED
+  count CDATA #REQUIRED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= User                                                =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!-- Resources is deprecated, should now use Services -->
+
+<!ELEMENT User ((
+    UserRole |
+    Roles |
+    Policies |
+    AdminRoles |
+    Attribute |
+    Answers |
+    Resources |
+    Services |
+    Exclusions |
+	LockExpiration |
+	LoggedInTo |
+    ResourceInfoList |
+    ResourceIdentityList |
+    PasswordHistory |
+    PasswordResetHistory |
+    PasswordExpiration |
+    PasswordExpirationWarning |
+    PrivateKeys |
+    Permissions |
+    ControlledObjectGroups |
+    ExpandedControlledObjectGroups |
+    AdminGroups |
+    ExpandedAdminGroups |
+    Forward |
+	Delegates |
+    UserForm |
+    ViewUserForm |
+    ComplianceViolations |
+    AuditPolicies |
+    IdmManager |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST User
+    %persistentObjectAttributes;
+    asciipassword CDATA #IMPLIED
+    password CDATA #IMPLIED
+    email CDATA #IMPLIED
+    passwordChanged (true | false) 'false'
+    disabled (true | false) 'false'
+	locked (true | false) 'false'
+	questionLocked (true | false) 'false'
+    failedPasswordLoginAttemptsCount CDATA #IMPLIED
+    failedQuestionLoginAttemptsCount CDATA #IMPLIED
+    nullAccountId (true | false) 'false'
+    lastPasswordUpdate CDATA #IMPLIED
+    lastAuditorScan CDATA #IMPLIED
+>
+
+<!-- this is for backward compatibility with single-role users -->
+<!ELEMENT UserRole (ObjectRef)>
+<!ELEMENT Roles ((ObjectRef)*)>
+<!ELEMENT Policies ((ObjectRef)*)>
+<!ELEMENT Exclusions ((ObjectRef)*)>
+<!ELEMENT IdmManager (ObjectRef)>
+<!ELEMENT AdminRoles ((ObjectRef)*)>
+
+<!ELEMENT Answers ((Answer)*)>
+
+<!ELEMENT PasswordExpiration (#PCDATA)>
+
+<!ELEMENT PasswordExpirationWarning (#PCDATA)>
+
+<!ELEMENT LockExpiration (#PCDATA)>
+
+<!ELEMENT Answer (#PCDATA)>
+<!ATTLIST Answer
+  id CDATA #REQUIRED
+  ascii CDATA #IMPLIED
+  loginInterface CDATA #IMPLIED
+  suppliedQuestion CDATA #IMPLIED
+>
+
+<!ELEMENT ResourceInfoList ((ResourceInfo)*)>
+<!-- Map is deprecated, attributes should now be wrapped in
+     the AccountAttributes element
+-->
+<!ELEMENT ResourceInfo ((
+  ObjectRef |
+  AccountAttributeValues |
+  ResourcePropertyValues |
+  ResourceAttributeValues |
+  ResourceInstanceValues |
+  Map |
+  PasswordHistory
+)*)>
+
+<!ATTLIST ResourceInfo
+  accountId CDATA #IMPLIED
+  accountGUID CDATA #IMPLIED
+  tempId CDATA #IMPLIED
+  accountDisplayName CDATA #IMPLIED
+  accountType CDATA #IMPLIED
+  asciipassword CDATA #IMPLIED
+  password CDATA #IMPLIED
+  created (true | false) 'false'
+  error (true | false) 'false'
+  disabled (true | false) 'false'
+  protected (true | false) 'false'
+  passwordProtected (true | false) 'false'
+  passwordReset (true | false) 'false'
+  dependentResourceId CDATA #IMPLIED
+  pendingApproval (true | false) 'false'
+  rejector CDATA #IMPLIED
+  lastPasswordUpdate CDATA #IMPLIED
+  instanceId CDATA #IMPLIED
+>
+
+<!ELEMENT AccountAttributeValues (Map?)>
+<!ELEMENT AccountPropertyValues (Map?)>
+<!ELEMENT ResourceAttributeValues (Map?)>
+<!ELEMENT ResourcePropertyValues (Map?)>
+<!ELEMENT PasswordHistory (List?)>
+
+<!ELEMENT ResourceIdentityList ((ResourceIdentity)*)>
+<!ELEMENT ResourceIdentity (ObjectRef?)>
+<!ATTLIST ResourceIdentity
+  accountId CDATA #IMPLIED
+>
+
+<!ELEMENT PasswordResetHistory ((Timestamp)*)>
+<!ELEMENT Timestamp (#PCDATA)>
+
+<!ELEMENT PrivateKeys ((PrivateKey)*)>
+<!ELEMENT PrivateKey (#PCDATA)>
+<!ATTLIST PrivateKey
+  application CDATA #IMPLIED
+  url CDATA #REQUIRED
+  accountId CDATA #IMPLIED
+  asciipassword CDATA #IMPLIED
+  password CDATA #IMPLIED
+  hasCapabilities CDATA #IMPLIED
+>
+
+<!ELEMENT Forward (ObjectRef?)>
+
+<!ELEMENT Delegates ((Delegate)*)>
+
+<!ELEMENT Delegate ((AdminGroups | DelegateTo | StartDelegationOn | EndDelegationOn)*)>
+<!ATTLIST Delegate
+	notify (true | false) 'false'
+>
+
+<!ELEMENT DelegateTo ((ObjectRef)*)>
+<!ATTLIST DelegateTo
+	type CDATA #REQUIRED
+>
+
+<!ELEMENT StartDelegationOn (#PCDATA)>
+
+<!ELEMENT EndDelegationOn (#PCDATA)>
+
+<!ELEMENT Permissions ((Permission)*)>
+
+<!ELEMENT Permission ((Objects | ObjectGroups)*)>
+<!ATTLIST Permission
+    type CDATA #REQUIRED
+    rights CDATA #REQUIRED
+    instances CDATA #IMPLIED
+    daytime CDATA #IMPLIED
+>
+
+<!ELEMENT Objects ((ObjectRef)*)>
+<!ELEMENT ObjectGroups ((ObjectRef)*)>
+
+<!ELEMENT ControlledObjectGroups ((ObjectRef)*)>
+
+<!ELEMENT ExpandedControlledObjectGroups ((ObjectRef)*)>
+
+<!ELEMENT AdminGroups ((ObjectRef)*)>
+
+<!ELEMENT ExpandedAdminGroups ((ObjectRef)*)>
+
+<!ELEMENT UserForm (ObjectRef)>
+
+<!ELEMENT ViewUserForm (ObjectRef)>
+
+<!ELEMENT ComplianceViolations ((ObjectRef)*)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Subject                                             =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Subject ((
+  AdminRoles |
+  Principals |
+  Options)*)
+>
+
+<!ATTLIST Subject
+  name CDATA #REQUIRED
+  readOnly (true | false) 'false'
+  subjectTimeout CDATA #IMPLIED
+  lastAccessTime CDATA #IMPLIED
+>
+
+<!ELEMENT Principals ((ObjectRef)*)>
+<!ELEMENT Options ((Map?))>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= ResourceAccount - deprecated in favor of Account.   =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT ResourceAccount ((
+  %persistentObjectElements; |
+  PotentialOwners |
+  CurrentAttributes |
+  PreviousAttributes)*)
+>
+
+<!ATTLIST ResourceAccount
+  %persistentObjectAttributes;
+  resource CDATA #IMPLIED
+  resourceId CDATA #IMPLIED
+  accountId CDATA #REQUIRED
+  owner CDATA #IMPLIED
+  userid CDATA #IMPLIED
+  situation CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Account - supersedes ResourceAccount.               =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Account ((
+  %persistentObjectElements; |
+  PotentialOwners |
+  Explanation |
+  CurrentAttributes |
+  PreviousAttributes |
+  ResourceInstanceParameters)*)
+>
+
+<!ATTLIST Account
+  %persistentObjectAttributes;
+  resourceId CDATA #REQUIRED
+  accountId CDATA #REQUIRED
+  owner CDATA #IMPLIED
+  userid CDATA #IMPLIED
+  situation CDATA #IMPLIED
+  situationChanged CDATA #IMPLIED
+  discoveredSituation CDATA #IMPLIED
+  nativeGUID CDATA #IMPLIED
+  nativeId CDATA #IMPLIED
+  accountExists (true | false) 'false'
+  disabled (true | false) #IMPLIED
+  typeString CDATA #IMPLIED
+  resource CDATA #IMPLIED
+>
+
+<!ELEMENT PotentialOwners (List?)>
+<!ELEMENT CurrentAttributes (Map?)>
+<!ELEMENT PreviousAttributes (Map?)>
+<!ELEMENT Explanation ((%xmlObject;)?)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= EncryptionKey                                       =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT EncryptionKey ((%persistentObjectElements;)*)>
+
+<!ATTLIST EncryptionKey
+  %persistentObjectAttributes;
+  value CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= SpecificSituation                                   =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT SpecificSituation ((
+  UserRef | ResourceRef)*)
+>
+
+<!ATTLIST SpecificSituation
+  situation CDATA #REQUIRED
+  accountId CDATA #IMPLIED
+  context CDATA #IMPLIED
+>
+
+<!ELEMENT UserRef (ObjectRef?)>
+
+<!ELEMENT ResourceRef (ObjectRef?)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= RoleAttribute                                       =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT RoleAttribute ((
+    ResourceRef |
+    Requirement |
+    AttributeValueRef |
+    AttributeValueString |
+    AttributeValueType |
+    Comment |
+    AttributeName |
+    %xmlObject;))*>
+
+<!ATTLIST RoleAttribute
+  name CDATA #REQUIRED
+  csv (true | false) 'false'
+>
+
+<!ELEMENT Requirement (#PCDATA)>
+<!ELEMENT AttributeValueRef (ObjectRef?)>
+<!ELEMENT AttributeValueString (String | List)>
+<!ELEMENT AttributeValueType (#PCDATA)>
+<!ELEMENT Comment (#PCDATA)>
+<!ELEMENT AttributeName (#PCDATA)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Administrator                                       =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Administrator ((
+    Permissions |
+    ControlledObjectGroups |
+    MemberObjectGroups |
+    AdminGroups |
+    Forward |
+    UserForm |
+    ViewUserForm |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST Administrator
+    %persistentObjectAttributes;
+    asciipassword CDATA #IMPLIED
+    password CDATA #IMPLIED
+    email CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= AdminGroup                                          =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT AdminGroup ((
+    Permissions |
+    ControlledObjectGroups |
+    AdminGroups |
+    Assigners |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST AdminGroup
+    %persistentObjectAttributes;
+    description CDATA #IMPLIED
+>
+
+<!ELEMENT Assigners ((ObjectRef)*)>
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= AdminRole                                           =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT AdminRole ((
+    Permissions |
+    AdminGroups |
+    AdminGroupsRule |
+    ControlledObjectGroups |
+    ControlledObjectGroupsRule |
+    ControlledObjectSubGroups |
+    UserForm |
+    ViewUserForm |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST AdminRole
+    %persistentObjectAttributes;
+>
+
+<!ELEMENT AdminGroupsRule (ObjectRef)>
+
+<!ELEMENT ControlledObjectGroupsRule (ObjectRef)>
+
+<!ELEMENT ControlledObjectSubGroups ((
+    ControlledObjectSubGroup)*)>
+
+<!ELEMENT ControlledObjectSubGroup ((
+    ObjectRef |
+    IncludeObjects |
+    ExcludeObjects)*)>
+
+<!ELEMENT IncludeObjects ((ObjectRef)*)>
+<!ELEMENT ExcludeObjects ((ObjectRef)*)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= ObjectGroup                                         =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT ObjectGroup ((Parent |
+                        Policies |
+                        Approvers |
+                        Notifyees |
+                        UserForm |
+                        ViewUserForm |
+                        ResourceContainerInfo |
+                        UserMembersRule |
+                        AuditPolicies |
+                        PathFromTop |
+                        %persistentObjectElements;)*)>
+<!ATTLIST ObjectGroup
+    %persistentObjectAttributes;
+>
+
+<!ELEMENT Parent (ObjectRef)>
+<!ELEMENT ResourceContainerInfo (ObjectRef)>
+<!ELEMENT AuditPolicies ((ObjectRef)*)>
+
+<!ATTLIST ResourceContainerInfo
+    junction (true | false) 'false'
+    containerId CDATA #IMPLIED
+    containerType CDATA #IMPLIED
+>
+
+<!ELEMENT UserMembersRule (ObjectRef)>
+<!ATTLIST UserMembersRule
+    cacheTimeout CDATA #IMPLIED
+>
+
+<!ELEMENT PathFromTop (List?)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= LoginConfig                                         =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT LoginConfig ((
+    LoginConfigEntries |
+    Applications |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST LoginConfig
+    %persistentObjectAttributes;
+>
+
+<!ELEMENT LoginConfigEntries ((LoginConfigEntry)*)>
+
+<!ATTLIST LoginConfigEntry
+    name CDATA #REQUIRED
+    type CDATA #REQUIRED
+    displayName CDATA #REQUIRED
+    shortDisplayName CDATA #IMPLIED
+>
+
+<!ELEMENT LoginConfigEntry ((AuthnProperties | SupportedApplications)*)>
+
+<!ELEMENT AuthnProperties ((AuthnProperty)*)>
+
+<!ELEMENT AuthnProperty EMPTY>
+<!ATTLIST AuthnProperty
+    name CDATA #REQUIRED
+    displayName CDATA #IMPLIED
+    doNotMap (true | false) 'false'
+    isId CDATA #IMPLIED
+    formFieldType CDATA #IMPLIED
+    dataSource CDATA #IMPLIED
+>
+
+<!ELEMENT SupportedApplications ((SupportedApplication)*)>
+
+<!ELEMENT SupportedApplication EMPTY>
+<!ATTLIST SupportedApplication
+    name CDATA #REQUIRED
+>
+
+<!ELEMENT Applications ((App)*)>
+
+<!ATTLIST App
+    name CDATA #REQUIRED
+    displayName CDATA #IMPLIED
+    loginInterface (true | false) 'false'
+    subjectTimeout CDATA #REQUIRED
+    obfuscateLoginErrors (true | false) 'false'
+>
+
+<!-- note that AllowedLoginConfigEntries is deprecated, but we have
+     to keep it around until we transition old repositories
+-->
+
+<!ELEMENT App ((AllowedLoginConfigEntries | LoginConfigEntryRefs)*)>
+
+<!ELEMENT AllowedLoginConfigEntries ((AllowedLoginConfigEntry)*)>
+
+<!ELEMENT AllowedLoginConfigEntry EMPTY>
+<!ATTLIST AllowedLoginConfigEntry
+    name CDATA #REQUIRED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= AttributeDefinitions                                =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT AttributeDefinition ((%persistentObjectElements;)*)>
+
+<!ATTLIST AttributeDefinition
+    %persistentObjectAttributes;
+    type CDATA #IMPLIED
+    syntax CDATA 'string'
+    multi (true | false) 'false'
+    ordered (true | false) 'false'
+>
+
+<!ELEMENT AttributeDefinitionRef (ObjectRef)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Attributes                                          =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Attributes ((Attribute)*)>
+
+<!--
+ Sigh, this element is now also used inside Object but those
+ only allow the name & value attributes.  I don't want to
+ introduce a new Attribute type or namespaces yet, so let
+ them overload.  The objects that use the original Attributes
+ could very well be migrated to using the Generic Object
+ representation of attributes with Forms someday.
+-->
+
+<!ELEMENT Attribute ((value | (%xmlObject;))*)>
+<!ATTLIST Attribute
+  name CDATA #REQUIRED
+  type CDATA #IMPLIED
+  syntax CDATA 'string'
+  ordered (true | false) #IMPLIED
+  value CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= EmailTemplate                                       =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT EmailTemplate ((
+    Comments |
+    Variable |
+    subject |
+    body |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST EmailTemplate
+    %persistentObjectAttributes;
+    smtpHost CDATA #IMPLIED
+    fromAddress CDATA #IMPLIED
+    toAddress CDATA #IMPLIED
+    htmlEnabled (true | false) 'false'
+    mimeType CDATA #IMPLIED
+    cc CDATA #IMPLIED
+>
+
+<!ELEMENT subject (#PCDATA)>
+<!ELEMENT body (#PCDATA)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Rule                                                =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Rule ((
+  Description | Comments | RuleArgument | RuleAccess | RunAsUser |
+  (%exnodeOrObject;) | Value |
+  %persistentObjectElements;)*)
+>
+
+<!ATTLIST Rule
+  %persistentObjectAttributes;
+  localScope (true | false) 'false'
+  authorize (true | false) 'false'
+>
+
+<!-- deprecated, just use an xmlObject without a wrapper -->
+<!ELEMENT Value (%xmlObject;)>
+
+<!ELEMENT RunAsUser (ObjectRef)>
+
+<!ELEMENT RuleArgument ((Comments | (%exnodeOrObject;))*)>
+<!ATTLIST RuleArgument
+  name CDATA #IMPLIED
+  value CDATA #IMPLIED
+  locked (true | false) 'false'
+>
+
+<!ELEMENT RuleAccess ((ObjectRef)*)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Extract                                             =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Extract ((
+  Source |
+  RoleRule |
+  FixedRole|
+  GroupRule |
+  CorrelationRule | UserNameGenerationRule | UserAccountConfirmationRule |
+  FixedGroup |
+  %persistentObjectElements;)*)
+>
+
+<!ATTLIST Extract
+  %persistentObjectAttributes;
+  correlation CDATA #IMPLIED
+  log CDATA #IMPLIED
+  output CDATA #IMPLIED
+  prefix CDATA #IMPLIED
+  maxErrors CDATA #IMPLIED
+  maxAccounts CDATA #IMPLIED
+  outputFormat CDATA #IMPLIED
+>
+
+<!ELEMENT Source (ObjectRef)>
+<!ELEMENT FixedRole (ObjectRef)>
+<!ELEMENT RoleRule (ObjectRef)>
+<!ELEMENT FixedGroup (ObjectRef)>
+<!ELEMENT GroupRule (ObjectRef)>
+<!-- Deprecate "CorrelationRule" in favor of "UserNameGenerationRule". -->
+<!ELEMENT CorrelationRule (ObjectRef)>
+<!ELEMENT UserNameGenerationRule (ObjectRef)>
+<!ELEMENT UserAccountConfirmationRule (ObjectRef)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= LoadConfig                                          =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT LoadConfig ((
+  %persistentObjectElements; |
+  RoleRule |
+  FixedRole |
+  GroupRule |
+  EventResource |
+  MergeAttributes |
+  FixedGroup |
+  CorrelationRule | UserNameGenerationRule | UserAccountConfirmationRule |
+  DefaultPassword |
+  FormRef)*)
+>
+
+<!ATTLIST LoadConfig
+  %persistentObjectAttributes;
+  inFile CDATA #IMPLIED
+  outFile CDATA #IMPLIED
+  logFile CDATA #IMPLIED
+  source CDATA #IMPLIED
+  correlation CDATA #IMPLIED
+  prefix CDATA #IMPLIED
+  provision (true | false) #IMPLIED
+  reProvision (true | false) #IMPLIED
+  ignorePasswords (true | false) #IMPLIED
+  generatePasswords (true | false) #IMPLIED
+  ignoreRoles (true | false) #IMPLIED
+  ignoreGroups (true | false) #IMPLIED
+  correlationRequired (true | false) 'false'
+  updateExisting (true | false) 'false'
+  updateAttributes (true | false) 'false'
+  updateGroups (true | false) 'false'
+  updateRoles (true | false) 'false'
+  testMode (true | false) #IMPLIED
+  external (true | false) #IMPLIED
+  maxErrors CDATA #IMPLIED
+  eventLoad (true | false) #IMPLIED
+  estimatedAccounts CDATA #IMPLIED
+  applyMetaView (true | false) 'false'
+>
+
+<!ELEMENT EventResource (ObjectRef)>
+<!ELEMENT DefaultPassword (EncryptedData)>
+<!ELEMENT MergeAttributes ((String | List))>
+
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Discovery                                           =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Discovery ((
+  %persistentObjectElements; |
+  Object)*)
+>
+
+<!ATTLIST Discovery
+  %persistentObjectAttributes;
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Message                                             =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!--
+  == This was originally defined to contain "value" elements,
+  == but later "object" was added for more flexibility.
+  == Still later XmlObject & XmlObjectFactory utilities were
+  == added which is now the standard way to represent
+  == arbitrary Java objects.
+  == Messages serialized in Java will use XmlObjects,
+  == but we still recognize value and object elements for
+  == backward compatibility with Messages formatted by
+  == the C++ agent.  Someday this should be updated.
+  == UPDATE: These originally stored preformatted text
+  == in an attribute, but that allows the parser to screw with formatting.
+  == now text is inside the Text element.
+  == The text attribute is deprecated.
+  -->
+
+<!ELEMENT Message ((Text | (%xmlObject;) | value | object)*)>
+<!ATTLIST Message
+  id CDATA #IMPLIED
+  text CDATA #IMPLIED
+  owner CDATA #IMPLIED
+>
+
+<!ELEMENT DateTime EMPTY>
+<!ATTLIST DateTime
+    jan1970millis CDATA #REQUIRED
+    style         CDATA #IMPLIED
+>
+
+<!ELEMENT Number EMPTY>
+<!ATTLIST Number
+    number CDATA #REQUIRED
+    isLong CDATA #IMPLIED
+    style  CDATA #IMPLIED
+>
+
+<!ELEMENT Text (#PCDATA)>
+
+<!-- We'll let object have anything in it, though it should
+  == only be either PCDATA or a PersistentObject?
+  -->
+
+<!ELEMENT object ANY>
+<!ATTLIST object
+  class CDATA #REQUIRED
+>
+
+<!ELEMENT ErrorMessage ((Text | (%xmlObject;))*)>
+<!ATTLIST ErrorMessage
+  id CDATA #IMPLIED
+  severity (ok | warning | error) 'error'
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= WavesetResult                                       =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT WavesetResults ((WavesetResult)*)>
+
+<!-- status is no longer used on the Java side, but keep it around
+     for awhile in case the agent still generates it
+-->
+
+<!ELEMENT WavesetResult ((ResultItem)*)>
+<!ATTLIST WavesetResult
+  name CDATA #IMPLIED
+  title CDATA #IMPLIED
+  status CDATA #IMPLIED
+>
+
+<!-- kludge, maintain temporary backward compatibility with the
+  == old "object" element.
+  == status is no longer used, but keep it around in case
+  == the agent still generates it.
+-->
+<!ELEMENT ResultItem ((object | %xmlObject;)*)>
+<!ATTLIST ResultItem
+  name CDATA #IMPLIED
+  type CDATA #IMPLIED
+  status (ok | warning | error) 'ok'
+>
+
+<!ELEMENT ResultError ((Message | StackTrace | ResultError)*)>
+<!ATTLIST ResultError
+  throwable CDATA #IMPLIED
+>
+
+<!ELEMENT StackTrace (#PCDATA)>
+
+<!ELEMENT ResourceResult (WavesetResult?)>
+<!ATTLIST ResourceResult
+  name CDATA #IMPLIED
+  accountId CDATA #IMPLIED
+  operation CDATA #IMPLIED
+  error (true | false) 'false'
+  protected (true | false) 'false'
+>
+
+<!ELEMENT ResultTable ((ResultTitle?, ResultColumns?, ResultRows?))>
+<!ATTLIST ResultTable
+  name CDATA #IMPLIED
+>
+
+<!ELEMENT ResultTitle ((Message))>
+<!ELEMENT ResultColumns ((List?))>
+<!ELEMENT ResultRows ((List?))>
+
+<!ELEMENT ResultData ((%xmlObject;)?)>
+<!ATTLIST ResultData
+  name CDATA #IMPLIED
+  value CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= TaskDefinition                                      =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT TaskDefinition ((
+  %persistentObjectElements; |
+  ExtendedResultTypes |
+  Extension |
+  Form |
+  Description |
+  Hosts)*)
+>
+
+<!ELEMENT ExtendedResultTypes ((List?))>
+
+<!-- Deprecate overloading "type"
+     in favor of explicit "taskType"
+  -->
+
+<!ATTLIST TaskDefinition
+  %persistentObjectAttributes;
+  type CDATA #IMPLIED
+  taskType CDATA #IMPLIED
+  executor CDATA #REQUIRED
+  requiresExecutorDelete (true | false) 'false'
+  singleton (true | false) 'false'
+  suspendable (true | false) 'false'
+  restartable (true | false) 'false'
+  syncControlAllowed (true | false) 'false'
+  execMode (sync | async | asyncImmediate) 'async'
+  execLimit CDATA #IMPLIED
+  resultLimit CDATA #IMPLIED
+  resultOption (wait | delete | rename | terminate) 'delete'
+  quotaName CDATA #IMPLIED
+  visibility CDATA #IMPLIED
+  reportsProgress (true | false) 'false'
+  progressInterval CDATA #IMPLIED
+  displayName CDATA #IMPLIED
+  resultFormatter CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Form                                                =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!-- Note, attributes might ordinarilly be required, but we're
+     letting them be implied so the form editor can process
+     (and generate) invalid files and fix them.
+-->
+
+<!ELEMENT Form (Description | Comments |
+                Display | Namespace | Include | Field |
+                FieldLoop | FieldRef | FormRef | Properties |
+                defun | defvar)*>
+<!ATTLIST Form
+  name CDATA #IMPLIED
+  title CDATA #IMPLIED
+  subTitle CDATA #IMPLIED
+  help CDATA #IMPLIED
+  baseContext CDATA #IMPLIED
+  noDefaultButtons (true | false) 'false'
+  trace (true | false) 'false'
+  objectLocationID CDATA #IMPLIED
+>
+
+<!ELEMENT Namespace EMPTY>
+<!ATTLIST Namespace
+  name CDATA #IMPLIED
+  value CDATA #IMPLIED
+>
+
+<!-- kludge: allowing pre-resolved objects in the Include list for
+     HttpSession serialization
+-->
+<!ELEMENT Include ((ObjectRef | Form | Library)*)>
+
+<!ELEMENT FieldLoop
+  ((expression | Comments | Field | FieldRef | FormRef | FieldLoop)*)>
+<!ATTLIST FieldLoop
+  for CDATA #IMPLIED
+  in CDATA #IMPLIED
+>
+
+<!ELEMENT FieldMap ((Comments)*)>
+<!ATTLIST FieldMap
+  name CDATA #IMPLIED
+  source CDATA #IMPLIED
+  readOnly (true | false) 'false'
+>
+
+<!ELEMENT FieldRef ((Comments | Property)*)>
+<!ATTLIST FieldRef
+  name CDATA #IMPLIED
+  baseContext CDATA #IMPLIED
+>
+
+<!ELEMENT FormRef ((Comments | Property | ObjectRef)*)>
+<!ATTLIST FormRef
+  name CDATA #IMPLIED
+  baseContext CDATA #IMPLIED
+>
+
+<!ELEMENT Field ((Comments | Help | Default | FieldValue | Hidden | Disable |
+                  Enable | Expansion | Derivation | Display |
+                  Constraints | Validation | expression |
+                  Field | FieldLoop | FieldRef | FormRef | FieldAction |
+                  defun | defvar | Properties)*)>
+<!--
+   jsl - attributes below "display" are deprecated, new forms
+   should use the Display element with generic display properties
+-->
+
+<!ATTLIST Field
+  name CDATA #IMPLIED
+  type CDATA #IMPLIED
+  syntax CDATA 'string'
+  required (true | false) 'false'
+  confirm CDATA #IMPLIED
+  library (true | false) 'false'
+  button (true | false) 'false'
+  hidden (true | false) 'false'
+
+  display (true | false) 'false'
+  container (true | false) 'false'
+  default CDATA #IMPLIED
+  prompt CDATA #IMPLIED
+  alwaysEvaluate (true | false) 'false'
+  pagename CDATA #IMPLIED
+  displaytype CDATA #IMPLIED
+  forcedisplay CDATA #IMPLIED
+  secret (true | false) 'false'
+  availabletitle CDATA #IMPLIED
+  selectedtitle CDATA #IMPLIED
+  nowrap (true | false) 'false'
+  resacctattr (true | false) 'false'
+  size CDATA #IMPLIED
+  maxlen CDATA #IMPLIED
+  labels CDATA #IMPLIED
+  rows CDATA #IMPLIED
+  columns CDATA #IMPLIED
+  help CDATA #IMPLIED
+>
+
+<!ELEMENT Help (#PCDATA)>
+
+<!ELEMENT FieldValue (ExpansionGroup*)>
+<!ATTLIST FieldValue
+  value CDATA #IMPLIED
+>
+
+<!ELEMENT Hidden ((%exnode;))>
+<!ELEMENT Visible ((%exnode;))>
+<!ELEMENT Disable ((%exnode;))>
+<!ELEMENT Enable ((%exnode;))>
+<!ELEMENT Derivation ((%exnodeOrObject;))>
+<!ELEMENT Validation ((%exnode;))>
+<!ELEMENT Expansion ((%exnodeOrObject;))>
+<!ELEMENT Default ((%exnodeOrObject;))>
+<!ELEMENT Constraints ((%exnodeOrObject;))>
+<!ELEMENT FieldAction ((%exnode;))>
+
+<!ELEMENT ExpansionGroup (expression?, FieldExpansion*)>
+
+<!ELEMENT FieldExpansion (expression?)>
+<!ATTLIST FieldExpansion
+  name CDATA #IMPLIED
+  value CDATA #IMPLIED
+>
+
+<!-- the type attribute is equivalent to the displaytype in Field -->
+
+<!ELEMENT Display ((Property)*)>
+<!ATTLIST Display
+  type CDATA #IMPLIED
+  class CDATA #IMPLIED
+  syntax CDATA #IMPLIED
+  action (true | false) 'false'
+>
+<!-- display properties include:
+  secret
+  actionselect
+  multiselect
+  availabletitle
+  selectedtitle
+  label
+  sectionlabel
+  nowrap
+  resacctattr
+  size
+  maxlen
+  confirm
+  labels
+  columns
+  rows
+-->
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= CustomCatalog                                      =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT CustomCatalog ((MessageSet)*)>
+<!ATTLIST CustomCatalog
+  id CDATA #IMPLIED
+  enabled CDATA #IMPLIED
+>
+
+<!ELEMENT MessageSet ((Msg)*)>
+<!ATTLIST MessageSet
+  language CDATA #IMPLIED
+  country CDATA #IMPLIED
+  variant CDATA #IMPLIED
+>
+
+<!ELEMENT Msg (#PCDATA)>
+<!ATTLIST Msg
+  id CDATA #REQUIRED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= TaskInstance                                        =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT TaskInstance ((
+  %persistentObjectElements; |
+  TaskDefinitionRef |
+  TaskScheduleRef |
+  Description |
+  Variables |
+  SubjectRef |
+  WavesetResult |
+  Extension |
+  Hosts)*)
+>
+
+<!ELEMENT SubjectRef (#PCDATA)>
+
+<!ATTLIST TaskInstance
+  %persistentObjectAttributes;
+  state (ready | executing | suspended | finished) 'ready'
+  owner CDATA #IMPLIED
+  terminated (true | false) 'false'
+  started CDATA #IMPLIED
+  expires CDATA #IMPLIED
+  resumes CDATA #IMPLIED
+  execTime CDATA #IMPLIED
+  host CDATA #IMPLIED
+  hostname CDATA #IMPLIED
+  progress CDATA #IMPLIED
+  hasExtendedResult (true | false) 'false'
+  extendedStatus CDATA #IMPLIED
+  resultLimit CDATA #IMPLIED
+>
+
+<!ELEMENT TaskDefinitionRef (ObjectRef?)>
+
+<!ELEMENT TaskScheduleRef (ObjectRef?)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= TaskResult                                          =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT TaskResult ((
+  %persistentObjectElements; |
+  TaskInstanceRef |
+  WavesetResult)*)
+>
+
+<!ATTLIST TaskResult
+  %persistentObjectAttributes;
+  sequence CDATA #REQUIRED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= TaskResultPage                                      =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT TaskResultPage ((
+  %persistentObjectElements; |
+  html)*)
+>
+
+<!ATTLIST TaskResultPage
+  %persistentObjectAttributes;
+  taskid CDATA #REQUIRED
+  page CDATA #IMPLIED
+  from CDATA #IMPLIED
+  to CDATA #IMPLIED
+  fromSequence CDATA #IMPLIED
+  toSequence CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= TaskTemplate                                        =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT TaskTemplate ((
+  %persistentObjectElements; |
+  FormRef |
+  TaskDefinitionRef |
+  Variables |
+  Description |
+  Hosts)*)
+>
+
+<!-- jsl - taskTypeDisplayName isn't required and should be removed -->
+
+<!ATTLIST TaskTemplate
+  %persistentObjectAttributes;
+  visibility CDATA #IMPLIED
+  taskType CDATA #IMPLIED
+  taskName CDATA #IMPLIED
+  mode CDATA #IMPLIED
+  taskTypeDisplayName CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Event                                               =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Event ((Extension | %persistentObjectElements;)*)>
+
+<!ATTLIST Event
+  %persistentObjectAttributes;
+  eventType CDATA #IMPLIED
+>
+
+<!-- an Event extension used for task events -->
+
+<!ELEMENT TaskEvent EMPTY>
+<!ATTLIST TaskEvent
+  taskId CDATA #REQUIRED
+  host CDATA #IMPLIED
+  state CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= TaskSchedule                                        =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT TaskSchedule ((
+  %persistentObjectElements; |
+  TaskDefinitionRef |
+  ObjectGroupRef |
+  Description |
+  Variables |
+  SubjectRef |
+  WavesetResult |
+  Hosts |
+  NextRepetitionRule)*)
+>
+
+<!ELEMENT Hosts ((%xmlObject;)*)>
+
+<!ATTLIST TaskSchedule
+  %persistentObjectAttributes;
+  taskName CDATA #IMPLIED
+  start CDATA #IMPLIED
+  time CDATA #IMPLIED
+  executionCount CDATA #IMPLIED
+  repetitionCount CDATA #IMPLIED
+  repetitionUnit CDATA #IMPLIED
+  skipMissedTimes (true | false) 'false'
+  resultOption (wait | delete | rename | terminate) 'delete'
+  singleton (true | false) 'false'
+  disabled (true | false) 'false'
+  daemon (true | false) 'false'
+  maxInstances CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= expression                                          =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Library ((Comments | Library | %xmlObject; | %persistentObject; |
+                     defun | defvar)*)>
+<!ATTLIST Library
+  name CDATA #IMPLIED
+  disabled (true | false) 'false'
+>
+
+<!-- XPRESS not recognizes any xmlObject and wraps then in a value node -->
+<!ELEMENT expression ((%exnode; | %xmlObject;))>
+
+<!ELEMENT s (#PCDATA)>
+<!ELEMENT i (#PCDATA)>
+<!ELEMENT o ((%xmlObject;))>
+<!ELEMENT null EMPTY>
+<!ELEMENT ref (#PCDATA | %exnode;)*>
+<!ELEMENT extref (#PCDATA | %exnode;)*>
+<!ELEMENT set ((%exnode;)?, (%exnode;)?, (%exnodeOrObject;)?)>
+<!ATTLIST set name CDATA #IMPLIED>
+<!ELEMENT block ((%exnodeOrObject;)*)>
+<!ATTLIST block name CDATA #IMPLIED trace (true | false) 'false'>
+<!ELEMENT if ((%exnode;), (%exnodeOrObject;), (%exnodeOrObject;)?)>
+<!ELEMENT then ((%exnodeOrObject;)*)>
+<!ELEMENT else ((%exnodeOrObject;)*)>
+<!ELEMENT call ((%exnodeOrObject;)*)>
+<!ATTLIST call name CDATA #REQUIRED>
+<!ELEMENT print ((%exnodeOrObject;)*)>
+<!ELEMENT defun ((%exnodeOrObject;)*)>
+<!ATTLIST defun name CDATA #REQUIRED>
+<!ELEMENT defvar ((%exnodeOrObject;)*)>
+<!ATTLIST defvar name CDATA #REQUIRED>
+<!ELEMENT defarg ((%exnodeOrObject;)*)>
+<!ATTLIST defarg name CDATA #REQUIRED>
+<!ELEMENT eval ((%exnode;)*)>
+<!ELEMENT eq ((%exnode;)*)>
+<!ELEMENT neq ((%exnode;)*)>
+<!ELEMENT gt ((%exnode;), (%exnode;))>
+<!ELEMENT gte ((%exnode;), (%exnode;))>
+<!ELEMENT lt ((%exnode;), (%exnode;))>
+<!ELEMENT lte ((%exnode;), (%exnode;))>
+<!ELEMENT and ((%exnode;)*)>
+<!ELEMENT or ((%exnode;)*)>
+<!ELEMENT select ((%exnode;)*)>
+<!ELEMENT not (%exnode;)>
+<!ELEMENT cmp ((%exnode;), (%exnode;))>
+<!ELEMENT ncmp ((%exnode;), (%exnode;))>
+<!ELEMENT isTrue (%exnodeOrObject;)>
+<!ELEMENT isFalse (%exnodeOrObject;)>
+<!ELEMENT isnull (%exnodeOrObject;)>
+<!ELEMENT notnull (%exnodeOrObject;)>
+<!ELEMENT add ((%exnode;)*)>
+<!ELEMENT sub ((%exnode;)*)>
+<!ELEMENT mult ((%exnode;)*)>
+<!ELEMENT div ((%exnode;)*)>
+<!ELEMENT mod ((%exnode;)*)>
+<!ELEMENT trim (%exnode;)>
+<!ELEMENT ltrim (%exnode;)>
+<!ELEMENT rtrim (%exnode;)>
+<!ELEMENT ztrim (%exnode;)>
+<!ELEMENT upcase (%exnode;)>
+<!ELEMENT downcase (%exnode;)>
+<!ELEMENT substr ((%exnode;)*)>
+<!ATTLIST substr s CDATA #IMPLIED l CDATA #IMPLIED>
+<!ELEMENT concat ((%exnodeOrObject;)*)>
+<!ELEMENT expand (%exnode;)>
+<!ELEMENT length (%exnodeOrObject;)>
+<!ELEMENT list ((%exnodeOrObject;)*)>
+<!ELEMENT map ((%exnodeOrObject;)*)>
+<!ELEMENT array ((%exnodeOrObject;)*)>
+<!ELEMENT filterdup (%exnodeOrObject;)>
+<!ATTLIST filterdup name CDATA #IMPLIED>
+<!ELEMENT filternull (%exnodeOrObject;)>
+<!ATTLIST filternull name CDATA #IMPLIED>
+<!ELEMENT insert ((%exnode;), (%exnode;), (%exnodeOrObject;)?)>
+<!ATTLIST insert name CDATA #IMPLIED>
+<!ELEMENT lconcat ((%exnodeOrObject;)*)>
+<!ELEMENT contains    ((%exnode;), (%exnodeOrObject;))>
+<!ELEMENT containsAll ((%exnode;), (%exnodeOrObject;))>
+<!ELEMENT containsAny ((%exnode;), (%exnodeOrObject;))>
+<!ELEMENT join ((%exnodeOrObject;)*)>
+<!ELEMENT cond ((%exnode;), (%exnodeOrObject;), (%exnodeOrObject;)?)>
+<!ELEMENT switch ((%exnode;), case*)>
+<!ELEMENT case ((%exnodeOrObject;), (%exnodeOrObject;)?)>
+<!ATTLIST case default (true | false) 'false'>
+<!ELEMENT indexOf ((%exnodeOrObject;), (%exnodeOrObject;), (%exnodeOrObject;)?)>
+<!ELEMENT split ((%exnode;), (%exnode;))>
+<!ELEMENT remove ((%exnodeOrObject;)*)>
+<!ATTLIST remove name CDATA #IMPLIED>
+<!ELEMENT removeAll ((%exnodeOrObject;)*)>
+<!ATTLIST removeAll name CDATA #IMPLIED>
+<!ELEMENT retainAll ((%exnodeOrObject;)*)>
+<!ATTLIST retainAll name CDATA #IMPLIED>
+<!ELEMENT append ((%exnodeOrObject;)*)>
+<!ATTLIST append name CDATA #IMPLIED>
+<!ELEMENT appendAll ((%exnode;)*)>
+<!ATTLIST appendAll name CDATA #IMPLIED>
+<!ELEMENT match ((%exnode;), (%exnode;))>
+<!ELEMENT trace (%exnode;)>
+<!ELEMENT break (%exnode;)>
+<!ATTLIST break name CDATA #IMPLIED>
+<!ELEMENT breakpoint EMPTY>
+<!ELEMENT get ((%exnodeOrObject;), (%exnode;))>
+<!ELEMENT index ((%exnodeOrObject;)*)>
+<!ATTLIST index i CDATA #IMPLIED>
+<!ELEMENT member ((%exnodeOrObject;), (%exnodeOrObject;))>
+<!ELEMENT getobj ((%exnode;)*)>
+<!ELEMENT dolist ((%exnode;)*)>
+<!ATTLIST dolist name CDATA #REQUIRED>
+<!ELEMENT pad ((%exnode;)*)>
+<!ELEMENT new ((%exnode;)*)>
+<!ATTLIST new class CDATA #IMPLIED>
+<!ELEMENT invoke ((%exnodeOrObject;)*)>
+<!ATTLIST invoke class CDATA #IMPLIED name CDATA #IMPLIED>
+<!ELEMENT while ((%exnode;)*)>
+<!ELEMENT script (#PCDATA)>
+<!ELEMENT message ((%exnode;)*)>
+<!ATTLIST message name CDATA #REQUIRED>
+<!ATTLIST message severity (ok | warning | error) 'ok'>
+<!ELEMENT rule ((%exnode;)?, (argument)*)>
+<!ATTLIST rule
+  name CDATA #IMPLIED
+  passThrough (true | false) 'false'
+>
+<!ELEMENT argument ((%exnodeOrObject;)?)>
+<!ATTLIST argument
+  name CDATA #REQUIRED
+  value CDATA #IMPLIED
+>
+<!ELEMENT instanceof ((%exnodeOrObject;))>
+<!ATTLIST instanceof name CDATA #IMPLIED>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Server                                              =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Server (( %persistentObjectElements;)*)>
+<!ATTLIST Server
+    %persistentObjectAttributes;
+    state CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= SecureCounter                                       =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT SecureCounter (( SecureCounterValue | %persistentObjectElements;)*)>
+<!ATTLIST SecureCounter
+    %persistentObjectAttributes;
+>
+
+<!ELEMENT SecureCounterValue (EncryptedData)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Repository Configuration                            =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT ServerRepository (DataStore)>
+
+<!ELEMENT DataStore ((%persistentObjectElements;)*)>
+<!ATTLIST DataStore
+  %persistentObjectAttributes;
+  instanceOf CDATA #IMPLIED
+  class (com.waveset.repository.LocalFiles |
+         com.waveset.repository.RelationalDataStore |
+         com.waveset.repository.MysqlDataStore |
+         com.waveset.repository.SqlServerDataStore |
+         com.waveset.repository.DirectoryDataStore
+        ) #REQUIRED
+  file CDATA #IMPLIED
+  initialContextFactory CDATA #IMPLIED
+  dataSourcePath CDATA #IMPLIED
+  providerUrl CDATA #IMPLIED
+  url CDATA #IMPLIED
+  connectAsUser CDATA #IMPLIED
+  connectWithPassword CDATA #IMPLIED
+  jdbcDriver CDATA #IMPLIED
+>
+
+<!--
+#  Deprecate attribute "blockSize" in favor of
+#  "blockRowsGet" and "blockRowsList" (bug#872).
+#  Because list methods do not fetch object XML,
+#  "blockRowsList" can be larger than "blockRowsGet".
+-->
+<!ELEMENT RepositoryConfiguration (RelocatedTypes?)>
+<!ATTLIST RepositoryConfiguration
+  lockTimeoutMillis CDATA #IMPLIED
+  maxConcurrentConnections CDATA #IMPLIED
+  blockSize CDATA #IMPLIED
+  blockRowsGet CDATA #IMPLIED
+  blockRowsList CDATA #IMPLIED
+  maxAttrValLength CDATA #IMPLIED
+  maxLogAcctAttrChangesLength CDATA #IMPLIED
+  maxSummaryLength CDATA #IMPLIED
+  maxXmlLength CDATA #IMPLIED
+  optimizeReplaceAttributes CDATA #IMPLIED
+  maxInList CDATA #IMPLIED
+  maxDelSet CDATA #IMPLIED
+  mcDBCall CDATA #IMPLIED
+  mcDeleteAttrVal CDATA #IMPLIED
+  mcInsertAttrVal CDATA #IMPLIED
+  mcUpdateAttrVal CDATA #IMPLIED
+  instanceOf CDATA #IMPLIED
+>
+
+<!ELEMENT RelocatedTypes (TypeDataStore)*>
+
+<!ELEMENT TypeDataStore (ObjectRef?)>
+<!ATTLIST TypeDataStore
+  typeName CDATA #REQUIRED
+  deleteDestroyInterval CDATA #IMPLIED
+  lockTimeoutMillis CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= ReportLog                                           =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT ReportLog ((
+  EventParameter |
+  %persistentObjectElements;)*)>
+
+
+<!ATTLIST ReportLog
+  %persistentObjectAttributes;
+  Type CDATA #IMPLIED
+  type CDATA #IMPLIED
+  Action CDATA #IMPLIED
+  Status CDATA #IMPLIED
+  TimeStamp CDATA #IMPLIED
+  DayOfYear CDATA #IMPLIED
+  ObjectDesc CDATA #IMPLIED
+  ReasonDenied CDATA #IMPLIED
+  Subject CDATA #IMPLIED
+  Client CDATA #IMPLIED
+  Server CDATA #IMPLIED
+  EventDate CDATA #IMPLIED
+  EventTime CDATA #IMPLIED
+  EventParms CDATA #IMPLIED
+>
+
+<!ELEMENT EventParameter EMPTY>
+<!ATTLIST EventParameter
+  EventParmValue CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= BulkOpTask                                           =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT BulkOpTaskState EMPTY>
+<!ATTLIST BulkOpTaskState
+  nextOp CDATA #IMPLIED
+  taskResultCnt CDATA #IMPLIED
+  errors CDATA #IMPLIED
+>
+
+<!ELEMENT Op ((OpFields)*)>
+<!ATTLIST Op
+  type CDATA #REQUIRED
+  name CDATA #IMPLIED
+>
+
+<!ELEMENT OpFields (List)>
+
+<!ELEMENT OpField (%xmlObject;)>
+<!ATTLIST OpField
+  directive CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= GenericAttribute                                    =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT GenericAttribute (Object)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= AuthTypes                                           =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT AuthTypes ((AuthType)*)>
+
+<!ELEMENT AuthType EMPTY>
+<!ATTLIST AuthType
+  name CDATA #IMPLIED
+  displayName CDATA #IMPLIED
+  extends CDATA #IMPLIED
+  auditKey CDATA #IMPLIED
+  rights CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= AuthContext                                         =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT AuthContext ((AuthGroup | UrlAcl)*)>
+
+<!ELEMENT AuthGroup ((UserRef | GroupRef)*)>
+<!ATTLIST AuthGroup
+  name CDATA #REQUIRED
+  anonymous (true | false) 'false'
+>
+
+<!ELEMENT UrlAcl ((UserRef | GroupRef)*)>
+<!ATTLIST UrlAcl
+  url CDATA #IMPLIED
+  regexp CDATA #IMPLIED
+>
+
+<!--
+  taking this out, UserRef it conflicts with the element defined
+     for SpecificSituation, and we're not using AuthContext anyway
+
+<!ELEMENT UserRef EMPTY>
+<!ATTLIST UserRef
+  name CDATA #REQUIRED
+>
+-->
+
+<!ELEMENT GroupRef EMPTY>
+<!ATTLIST GroupRef
+  name CDATA #REQUIRED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= SOAPConfig  big comment for simple object           =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT SOAPConfig (Map?)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= UserUIConfig  big comment for simple object           =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT UserUIConfig ((SummaryAttrTypes | SummaryAttrNames | QueryableAttrNames |
+   AppletColumns | FindResults | FindSearchAttrs | RepoIndexAttrs |
+   TopButtonPages | TaskBarPages | AppletSortColumn | FindResultsSortColumn |
+   DefaultFindSearchAttr | AdminDisplayAttribute |
+   ShowProvisioningSearchAttr | ShowDisabledSearchAttr | ShowListCache |
+   SummaryAttrrResourceCountLimit | CapabilityGroup | FindSearchOperators |
+   PolicySpecialChars | PolicyAccountAttributeNames | PolicyPasswordAttributeNames |
+   PolicyOtherAttributeNames | ShowFindResourcesSearch |
+   ShowFindAttribute1 | ShowFindAttribute2 | ShowFindAttribute3 |
+   ShowFindAttribute4 | ShowFindAttribute5 | ShowFindRoleSearch |
+   ShowFindOrganizationSearch | ShowFindCapabilitiesSearch | ShowFindSearch |
+   ListViewAttributes | UserListViewer)*)>
+<!ELEMENT SummaryAttrTypes (List?)>
+<!ELEMENT SummaryAttrNames (List?)>
+<!ELEMENT QueryableAttrNames (List?)>
+<!ELEMENT AppletColumns (List?)>
+<!ELEMENT FindResults (List?)>
+<!ELEMENT FindSearchAttrs (List?)>
+<!ELEMENT RepoIndexAttrs (List?)>
+<!ELEMENT TopButtonPages (List?)>
+<!ELEMENT TaskBarPages (List?)>
+<!ELEMENT AppletSortColumn (Integer?)>
+<!ELEMENT FindResultsSortColumn (Integer?)>
+<!ELEMENT DefaultFindSearchAttr (String?)>
+<!ELEMENT ShowProvisioningSearchAttr (Boolean?)>
+<!ELEMENT ShowDisabledSearchAttr (Boolean?)>
+<!ELEMENT ShowFindResourcesSearch (Boolean?)>
+<!ELEMENT ShowFindAttribute1 (Boolean?)>
+<!ELEMENT ShowFindAttribute2 (Boolean?)>
+<!ELEMENT ShowFindAttribute3 (Boolean?)>
+<!ELEMENT ShowFindAttribute4 (Boolean?)>
+<!ELEMENT ShowFindAttribute5 (Boolean?)>
+<!ELEMENT ShowFindRoleSearch (Boolean?)>
+<!ELEMENT ShowFindOrganizationSearch (Boolean?)>
+<!ELEMENT ShowFindCapabilitiesSearch (Boolean?)>
+<!ELEMENT ShowListCache (Boolean?)>
+<!ELEMENT SummaryAttrrResourceCountLimit (Integer?)>
+<!ELEMENT CapabilityGroup (List?)>
+<!ATTLIST CapabilityGroup name CDATA #IMPLIED>
+<!ATTLIST CapabilityGroup displayName CDATA #IMPLIED>
+<!ELEMENT FindSearchOperators (List?)>
+<!ELEMENT PolicySpecialChars (String?)>
+<!ELEMENT PolicyAccountAttributeNames (List?)>
+<!ELEMENT PolicyPasswordAttributeNames (List?)>
+<!ELEMENT PolicyOtherAttributeNames (List?)>
+<!ELEMENT AdminDisplayAttribute (String?)>
+<!ELEMENT ListViewAttributes (Map?)>
+<!ELEMENT UserListViewer (String?)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= ReportCounter                                       =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+<!ELEMENT ReportCounter ((  Counter |
+  %persistentObjectElements;)*)>
+
+<!ATTLIST ReportCounter
+  %persistentObjectAttributes;
+  total CDATA #IMPLIED
+  currentDay CDATA #IMPLIED
+>
+
+<!ELEMENT Counter EMPTY>
+
+<!ATTLIST Counter
+  dateString CDATA #REQUIRED
+  num CDATA #REQUIRED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= UsageReport                                         =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT UsageReport ((%persistentObjectElements;)*)>
+
+<!ATTLIST UsageReport
+  %persistentObjectAttributes;
+  Type CDATA #IMPLIED
+  Action CDATA #IMPLIED
+  Status CDATA #IMPLIED
+  reportType CDATA #IMPLIED
+  timeLine CDATA #IMPLIED
+  startDateString CDATA #IMPLIED
+  endDateString CDATA #IMPLIED
+  resultUnit CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= ImportCommand                                       =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!--
+These can be included in import files to cause certain events
+unrelated with object creation.
+
+Sigh, attribute "name" feels much more natural than "type" so
+I added support for that, we still maintain compatibility with "type"
+for awhile. I took out the command name enumeration here, the Importer
+will check this so it isn't really necessary for the parser to do it. - jsl
+
+Changed the content model to allow any xmlObject, since the addConfiguration
+command can theoritically allow List, Boolean, etc.  In practice, the
+content will usually be ObjectRef, Map, or List.
+There can be more than one ObjectRef.
+-->
+
+<!ELEMENT ImportCommand ((%xmlObject;)*)>
+<!ATTLIST ImportCommand
+  name CDATA #IMPLIED
+  type CDATA #IMPLIED
+  class CDATA #IMPLIED
+  newName CDATA #IMPLIED
+  newId CDATA #IMPLIED
+  newType CDATA #IMPLIED
+  oldType CDATA #IMPLIED
+  moveOrCopy CDATA #IMPLIED
+  targetType CDATA #IMPLIED
+  blockSize CDATA #IMPLIED
+  key CDATA #IMPLIED
+  value CDATA #IMPLIED
+  doLock CDATA #IMPLIED
+  file CDATA #IMPLIED
+  option CDATA #IMPLIED
+  objectType CDATA #IMPLIED
+  generateKey CDATA #IMPLIED
+  pkcs5Encrypt CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Prototypes                                          =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!--
+  This is meant to be wrapped in a Configuration for storage.
+  The system should treat these objects as alternatives to
+  the prototype instances coded into the Resource and Policy
+  classes.
+-->
+
+<!ELEMENT Prototypes ((Resource | Policy)*)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Generic Objects                                     =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Object ((Form | FormRef | Attribute)*)>
+<!ATTLIST Object
+  type CDATA #IMPLIED
+  name CDATA #IMPLIED
+  id CDATA #IMPLIED
+>
+
+<!--
+sigh, Attribute was already defined, the older definition
+has more stuff than we allow, but I don't want to mess
+with namespaces just yet.
+-->
+
+<!ELEMENT Modification ((%xmlObject;)?)>
+<!ATTLIST Modification
+  type (add | delete | replace) 'replace'
+>
+
+<!--=======================================================
+==
+== DTD for Waveset Reports
+==
+== Duplicated in report.dtd.  Moved over here so we can represent
+== reports as an XmlObject within a WavesetResult.
+==
+== This describes a simple generic document that can be generated by
+== background tasks to convey what the task accomplished.  This
+== is convenient for the GUI, as it only needs to render the report,
+== it doesn't have to know any other task details.
+==
+== Its not especially complete, but keep it simple so the tasks don't
+== have to think about it too much.  Try to keep style oriented
+== markup to a minimum so we have greater flexibility in rendering.
+==
+== Try to figure out a way to do this with an external entity.
+==
+==-=======================================================-->
+
+<!ELEMENT Report ((preamble?, section*))>
+
+<!ELEMENT preamble ((title | author | date)*)>
+
+<!ELEMENT title (#PCDATA | Message)*>
+<!ELEMENT author (#PCDATA)>
+<!ELEMENT date (#PCDATA | DateTime)*>
+
+<!ELEMENT section ((title?,(pre | html | p | table | section)*))>
+
+<!ELEMENT p (#PCDATA)>
+
+<!ELEMENT table ((title?, columns?, rows?))>
+<!ATTLIST table
+   linkurl CDATA #IMPLIED
+   linkcol CDATA #IMPLIED
+   nosort (true | false) 'false'
+>
+
+<!ELEMENT columns ((col*))>
+
+<!ELEMENT col (#PCDATA | Message | DateTime)*>
+
+<!ELEMENT rows ((row)*)>
+
+<!ELEMENT row ((col)*)>
+<!ATTLIST row
+   urlkey CDATA #IMPLIED
+>
+
+<!ELEMENT pre (#PCDATA)>
+
+<!ELEMENT html (#PCDATA)>
+
+<!ELEMENT ol ((li*))>
+
+<!ELEMENT ul ((li*))>
+
+<!ELEMENT li (#PCDATA)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Log                                                 =-->
+<!--=                                                     =-->
+<!--= NOTE : As of 4.1 AuditableAccountAttributes is      =-->
+<!--= deprecated and replaced with AuditableAttributes    =-->
+<!--=======================================================-->
+
+<!ELEMENT Log ((
+  LogRecordParameters |
+  AuditableAccountAttributes |
+  AuditableAttributes |
+  OverflowAttributes |
+  %persistentObjectElements;)*)>
+
+<!ATTLIST Log
+  %persistentObjectAttributes;
+  objectType CDATA #IMPLIED
+  Action CDATA #IMPLIED
+  Status CDATA #IMPLIED
+  TimeStamp CDATA #IMPLIED
+  ObjectDesc CDATA #IMPLIED
+  ReasonDenied CDATA #IMPLIED
+  Subject CDATA #IMPLIED
+  Client CDATA #IMPLIED
+  Server CDATA #IMPLIED
+  accountId CDATA #IMPLIED
+  resource CDATA #IMPLIED
+  message CDATA #IMPLIED
+  acctAttrChanges CDATA #IMPLIED
+  sequence CDATA #IMPLIED
+>
+
+<!ELEMENT LogRecordParameters (Map)>
+<!ELEMENT AuditableAccountAttributes (Map)>
+<!ELEMENT AuditableAttributes (Map)>
+<!ELEMENT OverflowAttributes (Map)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Syslog                                              =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Syslog ((
+  Message |
+  ErrorCause |
+  %persistentObjectElements;)*)>
+
+<!ATTLIST Syslog
+  %persistentObjectAttributes;
+  TimeStamp CDATA #IMPLIED
+  severity CDATA #IMPLIED
+  Server CDATA #IMPLIED
+  component CDATA #IMPLIED
+  errorCode CDATA #IMPLIED
+>
+
+<!ELEMENT ErrorCause (ResultError)>
+
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= DeviceResetConfig                                   =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT DeviceResetConfig (#PCDATA)>
+
+<!ATTLIST DeviceResetConfig
+  serverName CDATA #IMPLIED
+  user CDATA #IMPLIED
+  password CDATA #IMPLIED
+  asciipassword CDATA #IMPLIED
+  debug CDATA #IMPLIED
+  timeout CDATA #IMPLIED
+  idleTimeout CDATA #IMPLIED
+  port CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= License                                             =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT License ((licensedProducts | licensedCompany | licensedResourceTypes |
+licenseKey | licenseExpiration)*)>
+<!ELEMENT licensedProducts (List?)>
+<!ELEMENT licensedCompany (String?)>
+<!ELEMENT licensedResourceTypes (List?)>
+<!ELEMENT licenseKey (String?)>
+<!ELEMENT licenseExpiration (String?)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= XmlData                                             =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+<!ELEMENT XmlData ((Extension | %persistentObjectElements;)*)>
+<!ATTLIST XmlData
+  %persistentObjectAttributes;
+  type CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= SnapShot                                             =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+<!ELEMENT SnapShot ((Extension | %persistentObjectElements;)*)>
+<!ATTLIST SnapShot
+  %persistentObjectAttributes;
+  type CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= MetaView                                            =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+<!ELEMENT MetaView ((MetaViewAttribute | %persistentObjectElements;)*)>
+<!ATTLIST MetaView
+  %persistentObjectAttributes;
+  servicedType CDATA #IMPLIED
+  enabledApplications CDATA #IMPLIED
+  lastSeenResourceLastMod CDATA #IMPLIED
+>
+
+<!ELEMENT MetaViewAttribute ((Sources | Targets)*)>
+<!ATTLIST MetaViewAttribute
+  name CDATA #IMPLIED
+  storeLocally (true | false) 'false'
+  authoritative (true | false) 'true'
+>
+<!ELEMENT Sources ((MetaViewSource)*)>
+<!ELEMENT Targets ((MetaViewTarget)*)>
+
+<!ELEMENT MetaViewSource ((ObjectRef | ConstantValue)*)>
+<!ATTLIST MetaViewSource
+  sourceAttributeName CDATA #IMPLIED
+>
+<!ELEMENT ConstantValue (%xmlObject;)>
+
+<!ELEMENT MetaViewTarget ((TargetResource | TargetCondition)*)>
+<!ATTLIST MetaViewTarget
+  eventTypes CDATA #IMPLIED
+>
+
+<!ELEMENT TargetResource ((ObjectRef)?)>
+<!ATTLIST TargetResource
+  targetAttributeName CDATA #REQUIRED
+  global (true | false) 'false'
+>
+<!ELEMENT TargetCondition (ObjectRef)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= CertificateData                                     =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+<!ELEMENT CertificateData ((Variables)?)>
+<!ATTLIST CertificateData
+    certificateDataManager CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= SignedData                                          =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+<!ELEMENT SignedData ((SignerInfo|X509Certificate)*)>
+<!ATTLIST SignedData
+   signedContent CDATA #IMPLIED
+>
+<!ELEMENT SignerInfo (#PCDATA)>
+<!ATTLIST SignerInfo
+   signature CDATA #IMPLIED
+   signatureAlgorithm CDATA #IMPLIED
+   serialNumber CDATA #IMPLIED
+   issuerDN CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= X509Certificate                                     =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+<!ELEMENT X509Certificate (#PCDATA)>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Miscellaneous                                       =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!ELEMENT Miscellaneous ((%persistentObjectElements;)*)>
+<!ATTLIST Miscellaneous
+  %persistentObjectAttributes;
+  miscData CDATA #IMPLIED
+>
+
+<!--=======================================================-->
+<!--=                                                     =-->
+<!--= Deprecated Objects                                  =-->
+<!--=                                                     =-->
+<!--=======================================================-->
+
+<!--
+These have to be retained in the DTD so that we can
+parse export files created with older releases, though they
+will be ignored during import.  We can eventually weed these
+out, but we will always have to retain the definitions from
+at least one prior release.
+-->
+
+<!ELEMENT ConfigurationKeyword ((%persistentObjectElements;)*)>
+<!ATTLIST ConfigurationKeyword
+  %persistentObjectAttributes;
+  Value CDATA #IMPLIED
+>
+
+<!ELEMENT WorkflowConfig ((WorkflowApp | %persistentObjectElements;)*)>
+<!ATTLIST WorkflowConfig
+  %persistentObjectAttributes;
+>
+
+<!ELEMENT WorkflowApp EMPTY>
+<!ATTLIST WorkflowApp
+  name CDATA #REQUIRED
+  class CDATA #REQUIRED
+>
+
+<!ELEMENT WorkflowProcess ((
+    Variable |
+    Activity |
+    Action |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST WorkflowProcess %persistentObjectAttributes;>
+
+<!ELEMENT Join EMPTY>
+<!ATTLIST Join type (and | or) #REQUIRED>
+
+<!ELEMENT Split EMPTY>
+<!ATTLIST Split type (and | xor) #REQUIRED>
+
+<!ELEMENT WorkflowCase ((
+    Variables |
+    Messages |
+    Result |
+    Task |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST WorkflowCase
+  %persistentObjectAttributes;
+  processName         CDATA #IMPLIED
+  processId         CDATA #IMPLIED
+  state                 (inactive | active | complete) #REQUIRED
+>
+
+<!ELEMENT Task EMPTY>
+<!ATTLIST Task
+  index           CDATA #REQUIRED
+  activity CDATA #IMPLIED
+  state           (inactive | active | waiting | complete) #REQUIRED
+  joins           NMTOKENS #IMPLIED
+>
+
+<!ELEMENT WorkflowTask ((
+    Variables |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST WorkflowTask
+  %persistentObjectAttributes;
+  index                CDATA #REQUIRED
+  state                (active | complete) #REQUIRED
+  owner                CDATA #REQUIRED
+  caseId        CDATA #REQUIRED
+  caseName        CDATA #IMPLIED
+  processName        CDATA #IMPLIED
+  activityName        CDATA #IMPLIED
+>
+
+<!ELEMENT ResourceAction ((
+    ResTypeAction |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST ResourceAction
+  %persistentObjectAttributes;
+>
+
+
+<!ELEMENT ResTypeAction ((
+  act |
+  RunAsPassword)*)>
+
+<!ATTLIST ResTypeAction
+  restype CDATA #REQUIRED
+  timeout CDATA #IMPLIED
+  actionType CDATA #IMPLIED
+  runAsUser CDATA #IMPLIED
+>
+
+<!ELEMENT act (#PCDATA)>
+
+<!ELEMENT RunAsPassword ((
+  EncryptedData |
+  String))>
+
+<!-- AttrParse elements -->
+
+<!ENTITY % apNode
+ "t |
+  int |
+  str |
+  eol |
+  skipToEol |
+  skip |
+  skipWhitespace |
+  flag |
+  multiLine |
+  opt |
+  skipLinesUntil |
+  collectCsvHeader |
+  collectCsvLines |
+  loop"
+>
+
+<!ELEMENT t (#PCDATA)>
+
+<!ATTLIST t
+  offset CDATA #IMPLIED
+  termToken CDATA #IMPLIED
+>
+
+<!ELEMENT int EMPTY>
+
+<!ATTLIST int
+  name CDATA #REQUIRED
+  noval CDATA #IMPLIED
+  len CDATA #IMPLIED
+>
+
+<!ELEMENT str EMPTY>
+
+<!ATTLIST str
+  name CDATA #REQUIRED
+  len CDATA #IMPLIED
+  multi CDATA #IMPLIED
+  multiLine CDATA #IMPLIED
+  delim CDATA #IMPLIED
+  indent CDATA #IMPLIED
+  noval CDATA #IMPLIED
+  append CDATA #IMPLIED
+  trim CDATA #IMPLIED
+  term CDATA #IMPLIED
+  termToken CDATA #IMPLIED
+  appendSeparator CDATA #IMPLIED
+>
+
+<!ELEMENT eol EMPTY>
+
+<!ELEMENT skipToEol EMPTY>
+
+<!ELEMENT skip EMPTY>
+
+<!ATTLIST skip
+  len CDATA #REQUIRED
+>
+
+<!ELEMENT skipWhitespace EMPTY>
+
+<!ELEMENT flag (#PCDATA)>
+
+<!ATTLIST flag
+  name CDATA #REQUIRED
+  offset CDATA #IMPLIED
+  termToken CDATA #IMPLIED
+>
+
+<!ELEMENT multiLine ((%apNode;)*)>
+
+<!ATTLIST multiLine
+  opt CDATA #IMPLIED
+>
+
+<!ELEMENT apMatch (%apNode;)>
+
+<!ELEMENT opt ((AttrParse | apMatch)*)>
+
+<!ELEMENT loop ((AttrParse))>
+
+<!ELEMENT skipLinesUntil EMPTY>
+
+<!ATTLIST skipLinesUntil
+  token CDATA #IMPLIED
+  pattern CDATA #IMPLIED
+  minCount CDATA #IMPLIED
+>
+
+<!ELEMENT collectCsvHeader EMPTY>
+
+<!ATTLIST collectCsvHeader
+  idHeader CDATA #IMPLIED
+  nameHeader CDATA #IMPLIED
+  combine CDATA #IMPLIED
+  delim CDATA #IMPLIED
+  minCount CDATA #IMPLIED
+  trim CDATA #IMPLIED
+  unQuote CDATA #IMPLIED
+  line CDATA #IMPLIED
+>
+
+<!ELEMENT collectCsvLines EMPTY>
+
+<!ATTLIST collectCsvLines
+  combine CDATA #IMPLIED
+  trim CDATA #IMPLIED
+  unQuote CDATA #IMPLIED
+>
+
+<!ATTLIST AttrParse
+  %persistentObjectAttributes;
+>
+
+<!ELEMENT AttrParse ((
+    %apNode; |
+    %persistentObjectElements;)*)>
+
+<!ELEMENT WorkflowRef ((ObjectRef))>
+<!ELEMENT Remediators ((%xmlObject;)*)>
+<!ELEMENT PolicyRules ((%xmlObject;)*)>
+
+<!ELEMENT AuditPolicy ((
+    Description |
+    WorkflowRef |
+    Remediators |
+    PolicyRules |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST AuditPolicy
+  %persistentObjectAttributes;
+>
+
+<!ELEMENT RuleRef ((ObjectRef))>
+<!ELEMENT AuditPolicyRef ((ObjectRef))>
+<!ELEMENT RemediatorRef ((ObjectRef))>
+<!ELEMENT ViolationState (#PCDATA)>
+
+<!ELEMENT ComplianceViolation ((
+    Comments |
+    Description |
+    RuleRef |
+    AuditPolicyRef |
+    RemediatorRef |
+    ViolationState |
+    UserRef |
+    ResourceRef |
+    %persistentObjectElements;)*)>
+
+<!ATTLIST ComplianceViolation
+  %persistentObjectAttributes;
+  expirationDate CDATA #IMPLIED
+  remediationDate CDATA #IMPLIED
+  violationCount CDATA #IMPLIED
+>
diff --git a/xml/tests/testData/completion/30.xml b/xml/tests/testData/completion/30.xml
new file mode 100644
index 0000000..e454183
--- /dev/null
+++ b/xml/tests/testData/completion/30.xml
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE Configuration PUBLIC 'waveset.dtd' '30.dtd'>
+<Configuration authType='Library' id='#ID#Library#XPRESS_Library' name='LHT_Library' lock='Configurator#1152711628726'
+               creator='Configurator' createDate='1152189128478' lastModifier='Configurator' lastModDate='1152711327455' lastMod='129'>
+    <Extension>
+        <Library>
+            <Rule name='foo'>
+              <map<caret>
+
+
+            </Rule>
+        </Library>
+    </Extension>
+</Configuration>
diff --git a/xml/tests/testData/completion/31.xml b/xml/tests/testData/completion/31.xml
new file mode 100644
index 0000000..756d092
--- /dev/null
+++ b/xml/tests/testData/completion/31.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions
+	xmlns:tns="http://www.themindelectric.com/wsdl/Country/"
+	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+	xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+	xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        xmlns:mxsutil="http://www.theminde<caret>"
+	name="Country" targetNamespace="http://www.themindelectric.com/wsdl/Country/">
+    <wsdl:documentation>
+        The Country service provides access to all countries and regions. Each country is connected to one region.
+    </wsdl:documentation>
+  <wsdl:types>
+    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.themindelectric.com/package/com.marketxs.soap.util/">
+      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+      <xsd:complexType name="DataWrapper" abstract="true">
+        <xsd:sequence/>
+      </xsd:complexType>
+    </xsd:schema>
+  </wsdl:types>
+</wsdl:definitions>
diff --git a/xml/tests/testData/completion/31_after.xml b/xml/tests/testData/completion/31_after.xml
new file mode 100644
index 0000000..73997d7
--- /dev/null
+++ b/xml/tests/testData/completion/31_after.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions
+	xmlns:tns="http://www.themindelectric.com/wsdl/Country/"
+	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+	xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+	xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        xmlns:mxsutil="http://www.themindelectric.com/package/com.marketxs.soap.util/<caret>"
+	name="Country" targetNamespace="http://www.themindelectric.com/wsdl/Country/">
+    <wsdl:documentation>
+        The Country service provides access to all countries and regions. Each country is connected to one region.
+    </wsdl:documentation>
+  <wsdl:types>
+    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.themindelectric.com/package/com.marketxs.soap.util/">
+      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+      <xsd:complexType name="DataWrapper" abstract="true">
+        <xsd:sequence/>
+      </xsd:complexType>
+    </xsd:schema>
+  </wsdl:types>
+</wsdl:definitions>
diff --git a/xml/tests/testData/completion/32.xml b/xml/tests/testData/completion/32.xml
new file mode 100644
index 0000000..9826786
--- /dev/null
+++ b/xml/tests/testData/completion/32.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<foo:foo xmlns:foo="http://www.foo.org/test"
+         xmlns:bar="http://www.bar.org/test"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://www.foo.org/test 32.xsd http://www.bar.org/test 32_2.xsd"
+         bar:bar="tr<caret>"/>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/32.xsd b/xml/tests/testData/completion/32.xsd
new file mode 100644
index 0000000..16ab020
--- /dev/null
+++ b/xml/tests/testData/completion/32.xsd
@@ -0,0 +1,12 @@
+<xsd:schema xmlns="http://www.foo.org/test"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	targetNamespace="http://www.foo.org/test"
+	elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+  <xsd:element name="foo">
+    <xsd:complexType>
+      <xsd:anyAttribute namespace="##other"/>
+    </xsd:complexType>
+  </xsd:element>
+
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/32_2.xml b/xml/tests/testData/completion/32_2.xml
new file mode 100644
index 0000000..f254556
--- /dev/null
+++ b/xml/tests/testData/completion/32_2.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<foo:foo xmlns:foo="http://www.foo.org/test"
+         xmlns:bar="http://www.bar.org/test"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://www.foo.org/test 32.xsd http://www.bar.org/test 32_2.xsd"
+         bar:<caret> />
\ No newline at end of file
diff --git a/xml/tests/testData/completion/32_2.xsd b/xml/tests/testData/completion/32_2.xsd
new file mode 100644
index 0000000..5589f11
--- /dev/null
+++ b/xml/tests/testData/completion/32_2.xsd
@@ -0,0 +1,8 @@
+<xsd:schema xmlns="http://www.bar.org/test"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	targetNamespace="http://www.bar.org/test"
+	elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+  <xsd:attribute name="bar" type="xsd:boolean"/>
+
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/32_2_after.xml b/xml/tests/testData/completion/32_2_after.xml
new file mode 100644
index 0000000..420e4f4
--- /dev/null
+++ b/xml/tests/testData/completion/32_2_after.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<foo:foo xmlns:foo="http://www.foo.org/test"
+         xmlns:bar="http://www.bar.org/test"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://www.foo.org/test 32.xsd http://www.bar.org/test 32_2.xsd"
+         bar:bar="<caret>" />
\ No newline at end of file
diff --git a/xml/tests/testData/completion/32_after.xml b/xml/tests/testData/completion/32_after.xml
new file mode 100644
index 0000000..6bb0972
--- /dev/null
+++ b/xml/tests/testData/completion/32_after.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<foo:foo xmlns:foo="http://www.foo.org/test"
+         xmlns:bar="http://www.bar.org/test"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://www.foo.org/test 32.xsd http://www.bar.org/test 32_2.xsd"
+         bar:bar="true<caret>"/>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/33.xml b/xml/tests/testData/completion/33.xml
new file mode 100644
index 0000000..8849528
--- /dev/null
+++ b/xml/tests/testData/completion/33.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<foo:foo xmlns:foo="http://www.foo.org/test"
+         xmlns:bar="http://www.bar.org/test"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://www.bar.org/test 33_2.xsd http://www.foo.org/test 33.xsd">
+  <bar:b<caret>
+</foo:foo>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/33.xsd b/xml/tests/testData/completion/33.xsd
new file mode 100644
index 0000000..101f520
--- /dev/null
+++ b/xml/tests/testData/completion/33.xsd
@@ -0,0 +1,14 @@
+<xsd:schema xmlns="http://www.foo.org/test"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://www.foo.org/test"
+            elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+  <xsd:element name="foo">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element name="child"/>
+      </xsd:sequence>
+    </xsd:complexType>
+  </xsd:element>
+
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/33_2.xml b/xml/tests/testData/completion/33_2.xml
new file mode 100644
index 0000000..c3170d39
--- /dev/null
+++ b/xml/tests/testData/completion/33_2.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<foo:foo xmlns:foo="http://www.foo.org/test"
+         xmlns:bar="http://www.bar.org/test"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://www.bar.org/test 33_2.xsd http://www.foo.org/test 33.xsd">
+  <fo<caret>
+</foo:foo>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/33_2.xsd b/xml/tests/testData/completion/33_2.xsd
new file mode 100644
index 0000000..594cd1f
--- /dev/null
+++ b/xml/tests/testData/completion/33_2.xsd
@@ -0,0 +1,9 @@
+<xsd:schema xmlns="http://www.bar.org/test"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		targetNamespace="http://www.bar.org/test"
+		elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+  <xsd:element name="bar-a"/>
+  <xsd:element name="bar-b"/>
+
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/33_2_after.xml b/xml/tests/testData/completion/33_2_after.xml
new file mode 100644
index 0000000..45d4415
--- /dev/null
+++ b/xml/tests/testData/completion/33_2_after.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<foo:foo xmlns:foo="http://www.foo.org/test"
+         xmlns:bar="http://www.bar.org/test"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://www.bar.org/test 33_2.xsd http://www.foo.org/test 33.xsd">
+  <foo:child><caret></foo:child>
+</foo:foo>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/33_after.xml b/xml/tests/testData/completion/33_after.xml
new file mode 100644
index 0000000..8849528
--- /dev/null
+++ b/xml/tests/testData/completion/33_after.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<foo:foo xmlns:foo="http://www.foo.org/test"
+         xmlns:bar="http://www.bar.org/test"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://www.bar.org/test 33_2.xsd http://www.foo.org/test 33.xsd">
+  <bar:b<caret>
+</foo:foo>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/34.xsd b/xml/tests/testData/completion/34.xsd
new file mode 100644
index 0000000..01c22e4
--- /dev/null
+++ b/xml/tests/testData/completion/34.xsd
@@ -0,0 +1,9 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified"
+           attributeFormDefault="unqualified">
+  <xs:complexType name="YYY">
+    <xs:sequence>
+      <xs:element type="YY<caret>"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/completion/34_after.xsd b/xml/tests/testData/completion/34_after.xsd
new file mode 100644
index 0000000..849976f
--- /dev/null
+++ b/xml/tests/testData/completion/34_after.xsd
@@ -0,0 +1,9 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified"
+           attributeFormDefault="unqualified">
+  <xs:complexType name="YYY">
+    <xs:sequence>
+      <xs:element type="YYY<caret>"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/completion/35.xsd b/xml/tests/testData/completion/35.xsd
new file mode 100644
index 0000000..ba13b97
--- /dev/null
+++ b/xml/tests/testData/completion/35.xsd
@@ -0,0 +1,7 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified"
+           attributeFormDefault="unqualified">
+  <xs:simpleType name="YYY">
+    <xs:list itemType="xs:inte<caret>"/>
+  </xs:simpleType>
+</xs:schema>
diff --git a/xml/tests/testData/completion/35_after.xsd b/xml/tests/testData/completion/35_after.xsd
new file mode 100644
index 0000000..1f787bc
--- /dev/null
+++ b/xml/tests/testData/completion/35_after.xsd
@@ -0,0 +1,7 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified"
+           attributeFormDefault="unqualified">
+  <xs:simpleType name="YYY">
+    <xs:list itemType="xs:integer<caret>"/>
+  </xs:simpleType>
+</xs:schema>
diff --git a/xml/tests/testData/completion/36.xml b/xml/tests/testData/completion/36.xml
new file mode 100644
index 0000000..c9a6261
--- /dev/null
+++ b/xml/tests/testData/completion/36.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:tx="http://www.springframework.org/schema/tx"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                           http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                           http://www.springframework.org/schema/tx
+                           http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
+
+  <tx:advice id="defaultTxAdvice">
+    <tx:attributes>
+      <tx:method name="get*" read-only="true"/>
+      <t<caret>
+    </tx:attributes>
+  </tx:advice>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/36_2.xml b/xml/tests/testData/completion/36_2.xml
new file mode 100644
index 0000000..211fd81
--- /dev/null
+++ b/xml/tests/testData/completion/36_2.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <beans xmlns="http://www.springframework.org/schema/beans"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns:aop="http://www.springframework.org/schema/aop"
+        xmlns:util="http://www.springframework.org/schema/util"
+        xsi:schemaLocation="http://www.springframework.org/schema/beans
+                            http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                            http://www.springframework.org/schema/aop
+                            http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
+                            http://www.springframework.org/schema/util
+                            http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+   <util:list id="list1">
+     <util:l<caret>
+   </util:list>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/36_2_after.xml b/xml/tests/testData/completion/36_2_after.xml
new file mode 100644
index 0000000..e953969
--- /dev/null
+++ b/xml/tests/testData/completion/36_2_after.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <beans xmlns="http://www.springframework.org/schema/beans"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns:aop="http://www.springframework.org/schema/aop"
+        xmlns:util="http://www.springframework.org/schema/util"
+        xsi:schemaLocation="http://www.springframework.org/schema/beans
+                            http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                            http://www.springframework.org/schema/aop
+                            http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
+                            http://www.springframework.org/schema/util
+                            http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+   <util:list id="list1">
+     <util:list<caret>
+   </util:list>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/36_3.xml b/xml/tests/testData/completion/36_3.xml
new file mode 100644
index 0000000..8eb7921
--- /dev/null
+++ b/xml/tests/testData/completion/36_3.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <beans xmlns="http://www.springframework.org/schema/beans"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns:aop="http://www.springframework.org/schema/aop"
+        xmlns:util="http://www.springframework.org/schema/util"
+        xsi:schemaLocation="http://www.springframework.org/schema/beans
+                            http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                            http://www.springframework.org/schema/aop
+                            http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
+                            http://www.springframework.org/schema/util
+                            http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+   <util:list id="list1">
+     <u<caret>
+   </util:list>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/36_3_after.xml b/xml/tests/testData/completion/36_3_after.xml
new file mode 100644
index 0000000..181945e
--- /dev/null
+++ b/xml/tests/testData/completion/36_3_after.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <beans xmlns="http://www.springframework.org/schema/beans"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns:aop="http://www.springframework.org/schema/aop"
+        xmlns:util="http://www.springframework.org/schema/util"
+        xsi:schemaLocation="http://www.springframework.org/schema/beans
+                            http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                            http://www.springframework.org/schema/aop
+                            http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
+                            http://www.springframework.org/schema/util
+                            http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+   <util:list id="list1">
+     <util:constant static-field=""<caret>
+   </util:list>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/36_after.xml b/xml/tests/testData/completion/36_after.xml
new file mode 100644
index 0000000..89b047e
--- /dev/null
+++ b/xml/tests/testData/completion/36_after.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:tx="http://www.springframework.org/schema/tx"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                           http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                           http://www.springframework.org/schema/tx
+                           http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
+
+  <tx:advice id="defaultTxAdvice">
+    <tx:attributes>
+      <tx:method name="get*" read-only="true"/>
+      <tx:method name=""<caret>
+    </tx:attributes>
+  </tx:advice>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/37.xml b/xml/tests/testData/completion/37.xml
new file mode 100644
index 0000000..b9dc47e
--- /dev/null
+++ b/xml/tests/testData/completion/37.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE aaa [
+  <!ELEMENT aaa (#PCDATA)>
+  <!ATTLIST aaa
+    bbb CDATA #REQUIRED>
+  ]>
+<<caret>aaa bbb="ccc"
\ No newline at end of file
diff --git a/xml/tests/testData/completion/37_after.xml b/xml/tests/testData/completion/37_after.xml
new file mode 100644
index 0000000..70c41dd0
--- /dev/null
+++ b/xml/tests/testData/completion/37_after.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE aaa [
+  <!ELEMENT aaa (#PCDATA)>
+  <!ATTLIST aaa
+    bbb CDATA #REQUIRED>
+  ]>
+<aaa<caret> bbb="ccc"
\ No newline at end of file
diff --git a/xml/tests/testData/completion/9.xml b/xml/tests/testData/completion/9.xml
new file mode 100644
index 0000000..d7bca4b
--- /dev/null
+++ b/xml/tests/testData/completion/9.xml
@@ -0,0 +1,3 @@
+<foo xmlns="myns1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="myns1 ./8.xsd"
+  visibility="<caret>" />
\ No newline at end of file
diff --git a/xml/tests/testData/completion/AttributeNameInAttributeValue.xml b/xml/tests/testData/completion/AttributeNameInAttributeValue.xml
new file mode 100644
index 0000000..3de4bb0
--- /dev/null
+++ b/xml/tests/testData/completion/AttributeNameInAttributeValue.xml
@@ -0,0 +1,4 @@
+<root>
+    <include file="aaa" value="bbb"/>
+    <include file=<caret>""
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/AttributeNameInAttributeValue_after.xml b/xml/tests/testData/completion/AttributeNameInAttributeValue_after.xml
new file mode 100644
index 0000000..3de4bb0
--- /dev/null
+++ b/xml/tests/testData/completion/AttributeNameInAttributeValue_after.xml
@@ -0,0 +1,4 @@
+<root>
+    <include file="aaa" value="bbb"/>
+    <include file=<caret>""
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/AttributeWildcardFromAnotherNamespace.xml b/xml/tests/testData/completion/AttributeWildcardFromAnotherNamespace.xml
new file mode 100644
index 0000000..25230c7
--- /dev/null
+++ b/xml/tests/testData/completion/AttributeWildcardFromAnotherNamespace.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<foo:root xmlns:foo="http://www.foo.org/test"
+
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://www.foo.org/test foo.xsd http://www.bar.org/test bar.xsd">
+
+
+<foo:foo foo=""/>
+
+<foo:foo xmlns:bar="http://www.bar.org/test"  bar:<caret>/>
+
+
+</foo:root>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/AttributeWildcardFromAnotherNamespace_after.xml b/xml/tests/testData/completion/AttributeWildcardFromAnotherNamespace_after.xml
new file mode 100644
index 0000000..6305db2
--- /dev/null
+++ b/xml/tests/testData/completion/AttributeWildcardFromAnotherNamespace_after.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<foo:root xmlns:foo="http://www.foo.org/test"
+
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://www.foo.org/test foo.xsd http://www.bar.org/test bar.xsd">
+
+
+<foo:foo foo=""/>
+
+<foo:foo xmlns:bar="http://www.bar.org/test"  bar:bar=""/>
+
+
+</foo:root>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/AttributesTemplateFinishWithSpace.xml b/xml/tests/testData/completion/AttributesTemplateFinishWithSpace.xml
new file mode 100644
index 0000000..c905634
--- /dev/null
+++ b/xml/tests/testData/completion/AttributesTemplateFinishWithSpace.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <<caret>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/AttributesTemplateFinishWithSpace_after.xml b/xml/tests/testData/completion/AttributesTemplateFinishWithSpace_after.xml
new file mode 100644
index 0000000..e9594e8
--- /dev/null
+++ b/xml/tests/testData/completion/AttributesTemplateFinishWithSpace_after.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean <caret>=""
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/ClassNamesOutrankWords.xml b/xml/tests/testData/completion/ClassNamesOutrankWords.xml
new file mode 100644
index 0000000..0541ff2
--- /dev/null
+++ b/xml/tests/testData/completion/ClassNamesOutrankWords.xml
@@ -0,0 +1,4 @@
+<root>
+  <element attribute="foo.SomeClass"/>
+  <element attribute="SomeCl<caret>"/>
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/ClassNamesOutrankWords_after.xml b/xml/tests/testData/completion/ClassNamesOutrankWords_after.xml
new file mode 100644
index 0000000..45bcb23
--- /dev/null
+++ b/xml/tests/testData/completion/ClassNamesOutrankWords_after.xml
@@ -0,0 +1,4 @@
+<root>
+  <element attribute="foo.SomeClass"/>
+  <element attribute="foo.SomeClass<caret>"/>
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/ColonInTagName.xml b/xml/tests/testData/completion/ColonInTagName.xml
new file mode 100644
index 0000000..0ddfba5
--- /dev/null
+++ b/xml/tests/testData/completion/ColonInTagName.xml
@@ -0,0 +1,7 @@
+<zzz xmlns:foo="">
+    <foo:kk>
+
+    </foo:kk>
+    <<caret>
+</zzz>
+
diff --git a/xml/tests/testData/completion/CompleteEnumeration.xml b/xml/tests/testData/completion/CompleteEnumeration.xml
new file mode 100644
index 0000000..64a7b2a
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteEnumeration.xml
@@ -0,0 +1,11 @@
+<report xmlns="http://www.foobar.com/outer"
+                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                 xmlns:imported="http://www.foobar.com/imported"
+                 xsi:schemaLocation="http://www.foobar.com/outer CompleteEnumeration_outerSchema.xsd
+                 http://www.foobar.com/imported CompleteEnumeration_importedSchema.xsd">
+
+    <someParams>
+        <imported:someEnumeratedType>F<caret></imported:someEnumeratedType>
+    </someParams>
+
+</report>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteEnumeration_after.xml b/xml/tests/testData/completion/CompleteEnumeration_after.xml
new file mode 100644
index 0000000..359d33d
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteEnumeration_after.xml
@@ -0,0 +1,11 @@
+<report xmlns="http://www.foobar.com/outer"
+                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                 xmlns:imported="http://www.foobar.com/imported"
+                 xsi:schemaLocation="http://www.foobar.com/outer CompleteEnumeration_outerSchema.xsd
+                 http://www.foobar.com/imported CompleteEnumeration_importedSchema.xsd">
+
+    <someParams>
+        <imported:someEnumeratedType>Foo<caret></imported:someEnumeratedType>
+    </someParams>
+
+</report>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteEnumeration_importedSchema.xsd b/xml/tests/testData/completion/CompleteEnumeration_importedSchema.xsd
new file mode 100644
index 0000000..1e4bd4f
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteEnumeration_importedSchema.xsd
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:imported="http://www.foobar.com/imported"
+	targetNamespace="http://www.foobar.com/imported"
+	elementFormDefault="qualified">
+	<xs:complexType name="OptionalParametersType">
+		<xs:sequence>
+			<xs:element name="someEnumeratedType" type="imported:SomeEnumeratedType"
+				maxOccurs="1" minOccurs="0">
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:simpleType name="SomeEnumeratedType">
+		<xs:annotation>
+		</xs:annotation>
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="Foo" />
+			<xs:enumeration value="Bar" />
+		</xs:restriction>
+	</xs:simpleType>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteEnumeration_outerSchema.xsd b/xml/tests/testData/completion/CompleteEnumeration_outerSchema.xsd
new file mode 100644
index 0000000..3f0245a
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteEnumeration_outerSchema.xsd
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema xmlns:ta="http://www.foobar.com/outer"
+	xmlns:imported="http://www.foobar.com/imported"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.foobar.com/outer"
+	elementFormDefault="qualified">
+	<xs:import schemaLocation="CompleteEnumeration_importedSchema.xsd"
+		namespace="http://www.foobar.com/imported" />
+	<xs:element name="report">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="someParams" type="imported:OptionalParametersType"
+					minOccurs="1" maxOccurs="1" />
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteQualifiedTopLevelTags.xml b/xml/tests/testData/completion/CompleteQualifiedTopLevelTags.xml
new file mode 100644
index 0000000..bde33a0
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteQualifiedTopLevelTags.xml
@@ -0,0 +1,7 @@
+<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+    <de<caret>
+</beans:beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteQualifiedTopLevelTags_after.xml b/xml/tests/testData/completion/CompleteQualifiedTopLevelTags_after.xml
new file mode 100644
index 0000000..3ecf192
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteQualifiedTopLevelTags_after.xml
@@ -0,0 +1,7 @@
+<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+    <beans:description></beans:description>
+</beans:beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteTagWithXsiTypeInParent.xml b/xml/tests/testData/completion/CompleteTagWithXsiTypeInParent.xml
new file mode 100644
index 0000000..f90baa0
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteTagWithXsiTypeInParent.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<utest:type1 xmlns:utest="urn:test"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:type="utest:TestType2"
+       >
+	<utest:int1>3</utest:int1>
+    <utest:int2>3</utest:int2>
+    <utest:do<caret>
+</utest:type1>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteTagWithXsiTypeInParent.xsd b/xml/tests/testData/completion/CompleteTagWithXsiTypeInParent.xsd
new file mode 100644
index 0000000..0576d49
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteTagWithXsiTypeInParent.xsd
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="urn:test" xmlns:utest="urn:test" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified" attributeFormDefault="unqualified">
+    <xs:element name="type1" type="utest:TestType1"/>
+
+    <xs:complexType name="TestType1">
+        <xs:sequence>
+            <xs:element name="int1" type="xs:int"></xs:element>
+            <xs:element name="int2" type="xs:int"></xs:element>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="TestType2">
+        <xs:complexContent>
+            <xs:extension base="utest:TestType1">
+                <xs:sequence>
+                    <xs:element name="double" type="xs:int" >
+                    </xs:element>
+                </xs:sequence>
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/completion/CompleteTagWithXsiTypeInParent_after.xml b/xml/tests/testData/completion/CompleteTagWithXsiTypeInParent_after.xml
new file mode 100644
index 0000000..910c134
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteTagWithXsiTypeInParent_after.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<utest:type1 xmlns:utest="urn:test"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:type="utest:TestType2"
+       >
+	<utest:int1>3</utest:int1>
+    <utest:int2>3</utest:int2>
+    <utest:double><caret></utest:double>
+</utest:type1>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteWhenNoNsSchemaLocation.xml b/xml/tests/testData/completion/CompleteWhenNoNsSchemaLocation.xml
new file mode 100644
index 0000000..3415a5f
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteWhenNoNsSchemaLocation.xml
@@ -0,0 +1,6 @@
+<build number="1" xsi:noNamespaceSchemaLocation="CompleteWhenNoNsSchemaLocation.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<statusInfo status="S<caret>"/>
+<statsValue key="dd" value="asd">asd</statsValue>
+<statsValue key="dd1" value="asd1"/>
+<statusInfo status="sdsd1">aa1</statusInfo>
+</build>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteWhenNoNsSchemaLocation.xsd b/xml/tests/testData/completion/CompleteWhenNoNsSchemaLocation.xsd
new file mode 100644
index 0000000..da7cefa
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteWhenNoNsSchemaLocation.xsd
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema version="1.0"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+  >
+  <xsd:element name="build" type="buildType" />
+
+  <xsd:complexType name="buildType" mixed="true">
+    <xsd:sequence>
+      <xsd:element name="statusInfo" type="statusInfoType" minOccurs="0" />
+      <xsd:element name="statsValue" type="statsValueType" maxOccurs="unbounded" minOccurs="0" />
+    </xsd:sequence>
+    <xsd:attribute name="number" type="xsd:string" />
+  </xsd:complexType>
+
+  <xsd:complexType name="statsValueType">
+    <xsd:attribute name="key" type="xsd:string" />
+    <xsd:attribute name="value" type="xsd:decimal" />
+  </xsd:complexType>
+
+  <xsd:complexType name="statusInfoType">
+    <xsd:sequence>
+      <xsd:element name="text" type="statusInfoTextType" maxOccurs="unbounded" minOccurs="0" />
+    </xsd:sequence>
+    <xsd:attribute name="status" type="statusType"/>
+  </xsd:complexType>
+
+  <xsd:complexType name="statusInfoTextType" mixed="true">
+    <xsd:attribute name="action" type="actionType" />
+  </xsd:complexType>
+
+  <xsd:simpleType name="actionType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="prepend"/>
+      <xsd:enumeration value="append"/>
+      <xsd:enumeration value="replace"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="statusType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="SUCCESS"/>
+      <xsd:enumeration value="NORMAL"/>
+      <xsd:enumeration value="FAILURE"/>
+      <xsd:enumeration value="ERROR"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteWhenNoNsSchemaLocation_after.xml b/xml/tests/testData/completion/CompleteWhenNoNsSchemaLocation_after.xml
new file mode 100644
index 0000000..049b6a1
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteWhenNoNsSchemaLocation_after.xml
@@ -0,0 +1,6 @@
+<build number="1" xsi:noNamespaceSchemaLocation="CompleteWhenNoNsSchemaLocation.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<statusInfo status="SUCCESS"<caret>/>
+<statsValue key="dd" value="asd">asd</statsValue>
+<statsValue key="dd1" value="asd1"/>
+<statusInfo status="sdsd1">aa1</statusInfo>
+</build>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteWhenUnqualifiedElements.xml b/xml/tests/testData/completion/CompleteWhenUnqualifiedElements.xml
new file mode 100644
index 0000000..24dea9f
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteWhenUnqualifiedElements.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <tc:tc-config xmlns:tc="http://www.terracotta.org/config"
+               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xsi:schemaLocation="http://www.terracotta.org/config CompleteWhenUnqualifiedElements.xsd">
+     <application>
+         <dso>
+             <instrumented-classes>
+                 <include>
+                     <cl<caret>
+                 </include>
+             </instrumented-classes>
+         </dso>
+     </application>
+ </tc:tc-config>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteWhenUnqualifiedElements.xsd b/xml/tests/testData/completion/CompleteWhenUnqualifiedElements.xsd
new file mode 100644
index 0000000..cf2ab4ab
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteWhenUnqualifiedElements.xsd
@@ -0,0 +1,1020 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  targetNamespace="http://www.terracotta.org/config"
+  xmlns="http://www.terracotta.org/config" version="4">
+
+  <xs:element name="tc-config">
+    <xs:complexType>
+      <xs:all>
+        <xs:element name="system" type="system" minOccurs="0">
+          <xs:annotation>
+            <xs:documentation>
+              The 'system' section contains configuration
+              data that affects the entire Terracotta
+              system as a whole; things like the configuration
+              mode go here.
+            </xs:documentation>
+          </xs:annotation>
+        </xs:element>
+
+        <xs:element name="servers" type="servers" minOccurs="0">
+          <xs:annotation>
+            <xs:documentation>
+              This section defines the servers present
+              in your Terracotta system. You can omit
+              this section entirely, in which case it
+              behaves as if there's a single server
+              with all values set at their default.
+              You can include exactly one server entry
+              here (the common case), or, if you're
+              going to run multiple servers for
+              failover, you can include multiple
+              servers here.
+
+              If you include more than one server
+              here, note that each server will need to
+              know which configuration it should use
+              as it starts up. If you name your
+              servers according to the host that they
+              run on (and no host contains more than
+              one server), then they will find the
+              hostname themselves and work
+              automatically.
+
+              If you name your servers in any other
+              fashion (and, again, only if there is
+              more than one 'server' element present
+              here), then you will need to pass the
+              command-line option "-n <![CDATA[ <name>]]>"
+              to the start-tc-server script, passing
+              it the name of a server configuration
+              from this file.
+            </xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="clients" type="client" minOccurs="0">
+          <xs:annotation>
+            <xs:documentation>
+              This section contains settings that affect
+              all clients that connect to the system.
+
+              Note that while these settings are applied
+              uniformly across all clients, this does not
+              prevent you from applying different settings
+              to various clients. There are two ways of
+              doing this:
+
+              Certain parameters ('logs', below) undergo
+              parameter expansion before being used by the
+              client. This allows you to use various
+              predefined substitutions (like '%h' for
+              host), or a general one (%(myprop) to use
+              the value of Java system property 'myprop'),
+              for these values; expansions are carried out
+              in each client's JVM independently.
+
+              For each client to have its own
+              configuration you can set 'tc.config' to the
+              configuration file. If the configuration
+              model is production then the 'application'
+              section for all of the clients comes from
+              the application section of the server's
+              config file.
+            </xs:documentation>
+          </xs:annotation>
+        </xs:element>
+
+        <xs:element name="application" type="application" minOccurs="0">
+          <xs:annotation>
+            <xs:documentation>
+              This section contains items that affect the
+              core behavior of Terracotta as it relates to
+              your application. This data must be kept
+              consistent across clients and servers in
+              order for Terracotta to function properly,
+              and so the system will enforce this.
+            </xs:documentation>
+          </xs:annotation>
+        </xs:element>
+      </xs:all>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="class-expression">
+    <xs:restriction base="xs:token">
+      <xs:pattern value="(@[A-Za-z_0-9$\*\.]+ )*[@A-Za-z_0-9$\*\.]+\+?"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:simpleType name="method-expression">
+    <xs:restriction base="xs:token">
+      <xs:pattern value="(@[A-Za-z_0-9$\*\.]+ )*([A-Za-z_0-9$\*\.\[\] \+]+ )[A-Za-z_0-9$\*\.\+]+(\([A-Za-z_0-9$,\*\. \[\]]*\))"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:simpleType name="field-expression">
+    <xs:restriction base="xs:token">
+      <xs:pattern value="(@[A-Za-z_0-9$\*\.]+ ){0,1}([A-Za-z_0-9$\*\.\[\] \+]){2,}"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <!--
+  <xs:simpleType name="method-name-expression">
+    <xs:restriction base="xs:token">
+      <xs:pattern value="[A-Za-z_0-9$\. \[\]]+(\([A-Za-z_0-9$,\. \[\]]*\))" />
+    </xs:restriction>
+  </xs:simpleType>
+  -->
+
+  <xs:simpleType name="web-application-name-expression">
+    <xs:restriction base="xs:token">
+      <xs:pattern value="[^\*]*" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="lock-level">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="write" />
+      <xs:enumeration value="read" />
+      <xs:enumeration value="concurrent" />
+      <xs:enumeration value="synchronous-write" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:complexType name="named-lock">
+    <xs:all>
+      <xs:element name="lock-name" type="java-identifier" />
+      <xs:element name="method-expression" type="method-expression" />
+      <xs:element name="lock-level" type="lock-level" minOccurs="0" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="autolock">
+    <xs:all>
+      <xs:element name="method-expression" type="method-expression" />
+      <xs:element name="lock-level" type="lock-level" minOccurs="0" />
+    </xs:all>
+    <xs:attribute name="auto-synchronized" type="xs:boolean" default="false"/>
+  </xs:complexType>
+
+  <xs:complexType name="locks">
+    <xs:sequence maxOccurs="unbounded">
+      <xs:element name="autolock" type="autolock" minOccurs="0" />
+      <xs:element name="named-lock" type="named-lock" minOccurs="0" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="root">
+    <xs:annotation>
+      <xs:documentation>
+        Declares a DSO root. A root can have a name that defaults to its fully
+        qualified field name.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="root-name" type="java-identifier" minOccurs="0" />
+      <xs:element name="field-name" type="qualified-field-name" maxOccurs="1" minOccurs="0"/>
+      <xs:element name="field-expression" type="field-expression" maxOccurs="1" minOccurs="0"/>
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="roots">
+    <xs:sequence>
+      <xs:element name="root" type="root" maxOccurs="unbounded" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="include">
+    <xs:all>
+      <xs:element name="class-expression" type="class-expression" />
+      <xs:element name="honor-transient" type="xs:boolean" minOccurs="0" default="false" />
+      <xs:element name="on-load" type="on-load" minOccurs="0" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="on-load">
+    <xs:choice>
+      <xs:element name="execute" type="xs:string" />
+      <xs:element name="method" type="method-name" />
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="instrumented-classes">
+    <xs:sequence maxOccurs="unbounded">
+      <xs:element name="include" type="include" minOccurs="0" />
+      <xs:element name="exclude" type="class-expression" minOccurs="0" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="distributed-methods">
+    <xs:sequence>
+      <xs:element name="method-expression" maxOccurs="unbounded">
+        <xs:complexType>
+          <xs:simpleContent>
+            <xs:extension base="method-expression">
+              <xs:attribute name="run-on-all-nodes" type="xs:boolean" use="optional" default="true"/>
+            </xs:extension>
+          </xs:simpleContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="web-applications">
+    <xs:sequence>
+      <xs:element name="web-application" type="web-application" maxOccurs="unbounded" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="web-application">
+    <xs:simpleContent>
+      <xs:extension base="web-application-name-expression">
+        <xs:attribute name="synchronous-write" type="xs:boolean" use="optional" default="false" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:complexType name="instrumentation-logging">
+    <xs:all>
+      <xs:element name="class" type="xs:boolean" minOccurs="0" default="false" />
+      <xs:element name="hierarchy" type="xs:boolean" minOccurs="0" default="true" />
+      <xs:element name="locks" type="xs:boolean" minOccurs="0" default="false" />
+      <xs:element name="transient-root" type="xs:boolean" minOccurs="0" default="true" />
+      <xs:element name="roots" type="xs:boolean" minOccurs="0" default="false" />
+      <xs:element name="distributed-methods" type="xs:boolean" minOccurs="0" default="false" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="runtime-logging">
+    <xs:all>
+      <xs:element name="non-portable-dump" type="xs:boolean" minOccurs="0" default="true">
+        <xs:annotation>
+          <xs:documentation xmlns="http://www.w3.org/1999/xhtml">
+            When an attempt is made to distribute a non-portable object, the object (and any objects
+            to which it refers) will be logged in the terracotta log file.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="lock-debug" type="xs:boolean" minOccurs="0" default="false" />
+      <xs:element name="field-change-debug" type="xs:boolean" minOccurs="0" default="false" />
+      <xs:element name="wait-notify-debug" type="xs:boolean" minOccurs="0" default="false" />
+      <xs:element name="distributed-method-debug" type="xs:boolean" minOccurs="0" default="false" />
+      <xs:element name="new-object-debug" type="xs:boolean" minOccurs="0" default="false" />
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="additional-boot-jar-classes">
+    <xs:sequence>
+      <xs:element name="include" type="qualified-class-name" maxOccurs="unbounded" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="transient-fields">
+    <xs:sequence>
+      <xs:element name="field-name" type="qualified-field-name" maxOccurs="unbounded" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="runtime-output-options">
+    <xs:all>
+      <xs:element name="auto-lock-details" type="xs:boolean" minOccurs="0" default="false" />
+      <xs:element name="caller" type="xs:boolean" minOccurs="0" default="false" />
+      <xs:element name="full-stack" type="xs:boolean" minOccurs="0" default="false" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="dso-client-debugging">
+    <xs:all>
+      <xs:element name="instrumentation-logging" type="instrumentation-logging" minOccurs="0" />
+      <xs:element name="runtime-logging" type="runtime-logging" minOccurs="0" />
+      <xs:element name="runtime-output-options" type="runtime-output-options" minOccurs="0" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="dso-client-data">
+    <xs:all>
+      <xs:element name="fault-count" type="non-negative-int" default="500" minOccurs="0" />
+      <xs:element name="debugging" type="dso-client-debugging" minOccurs="0" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="garbage-collection">
+    <xs:all>
+      <xs:element name="enabled" type="xs:boolean" minOccurs="0" default="true" />
+      <xs:element name="verbose" type="xs:boolean" minOccurs="0" default="false" />
+      <xs:element name="interval" type="positive-int" minOccurs="0" default="3600" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:simpleType name="persistence-mode">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="temporary-swap-only" />
+      <xs:enumeration value="permanent-store" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:complexType name="persistence">
+    <xs:all>
+      <xs:element name="mode" type="persistence-mode" minOccurs="0" default="temporary-swap-only" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="dso-server-data">
+    <xs:all>
+      <xs:element name="client-reconnect-window" type="positive-int" minOccurs="0" default="120" />
+      <xs:element name="persistence" type="persistence" minOccurs="0"/>
+      <xs:element name="garbage-collection" type="garbage-collection" minOccurs="0" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="module">
+    <xs:annotation>
+      <xs:documentation>
+        Identifies a module/version to use, this module must be located
+        in either a) the default repository shipped with Terracotta or
+        b) one of the repositories listed in the <![CDATA[<module>]]>
+        section.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="name" type="xs:string" />
+    <xs:attribute name="version" type="xs:string" />
+    <xs:attribute name="group-id" type="xs:string" default="org.terracotta.modules" />
+  </xs:complexType>
+
+  <xs:complexType name="modules">
+    <xs:sequence maxOccurs="unbounded">
+      <xs:element name="repository" type="xs:anyURI" minOccurs="0" />
+      <xs:element name="module" type="module" minOccurs="0" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="dso-application">
+    <xs:all>
+      <xs:element name="instrumented-classes" type="instrumented-classes" minOccurs="0" />
+      <xs:element name="transient-fields" type="transient-fields" minOccurs="0" />
+
+      <xs:element name="locks" type="locks" minOccurs="0" />
+      <xs:element name="roots" type="roots" minOccurs="0" />
+      <xs:element name="distributed-methods" type="distributed-methods" minOccurs="0" />
+
+      <xs:element name="additional-boot-jar-classes" type="additional-boot-jar-classes" minOccurs="0" />
+      <xs:element name="web-applications" type="web-applications" minOccurs="0" />
+
+      <xs:element name="dso-reflection-enabled" type="xs:boolean" minOccurs="0" default="true"/>
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="spring-application">
+    <xs:sequence>
+      <xs:element name="jee-application" type="spring-apps" minOccurs="1" maxOccurs="unbounded" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="spring-bean">
+    <xs:sequence>
+      <xs:element name="bean" type="non-distributed-fields" minOccurs="0" maxOccurs="unbounded" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="non-distributed-fields">
+    <xs:sequence>
+      <xs:element name="non-distributed-field" type="java-identifier" minOccurs="0" maxOccurs="unbounded" />
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:string" use="required" />
+  </xs:complexType>
+
+  <xs:complexType name="spring-app-contexts">
+    <xs:sequence>
+      <xs:element name="application-context" type="spring-app-context" maxOccurs="unbounded" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="spring-distributed-event">
+    <xs:sequence>
+      <xs:element name="distributed-event" type="non-blank-token" maxOccurs="unbounded" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="spring-app-context">
+    <xs:all>
+      <xs:element name="root-name" type="java-identifier" minOccurs="0"/>
+      <xs:element name="enable-location-info" type="xs:boolean" minOccurs="0"/>
+      <xs:element name="paths" type="spring-path" />
+      <xs:element name="distributed-events" type="spring-distributed-event" minOccurs="0" />
+      <xs:element name="beans" type="spring-bean" minOccurs="0" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="spring-path">
+    <xs:sequence>
+      <xs:element name="path" type="path" maxOccurs="unbounded" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="spring-apps">
+    <xs:all>
+      <xs:element name="fast-proxy" type="xs:boolean" minOccurs="0" default="false" />
+      <xs:element name="session-support" type="xs:boolean" minOccurs="0" default="false" />
+      <xs:element name="locks" type="locks" minOccurs="0" />
+      <xs:element name="instrumented-classes" type="instrumented-classes" minOccurs="0" />
+        <xs:element name="application-contexts" type="spring-app-contexts" minOccurs="0" />
+      <xs:element name="transient-fields" type="transient-fields" minOccurs="0" />
+    </xs:all>
+    <xs:attribute name="name" type="xs:string" use="required" />
+  </xs:complexType>
+
+  <xs:complexType name="authentication">
+    <xs:all>
+      <xs:element name="password-file" type="path" minOccurs="0"
+        default="%(java.home)/lib/management/jmxremote.password" />
+      <xs:element name="access-file" type="path" minOccurs="0"
+        default="%(java.home)/lib/management/jmxremote.access" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="ha">
+    <xs:all>
+      <xs:element name="mode" type="ha-mode" minOccurs="0" default="disk-based-active-passive" />
+      <xs:element name="networked-active-passive" type="networked-active-passive" minOccurs="0" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="networked-active-passive">
+    <xs:all>
+      <xs:element name="election-time" type="positive-int" minOccurs="0" default="5" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="server">
+    <xs:annotation>
+      <xs:documentation xmlns="http://www.w3.org/1999/xhtml">
+        Data specific to one of your servers.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="authentication" type="authentication" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation xmlns="http://www.w3.org/1999/xhtml"> Turn on authentication for the Terracotta server. An
+            empty tag &lt;authentication/&gt; defaults to the standard Java JMX authentication mechanism referring
+            to password and access files in: $JAVA_HOME/jre/lib/management.
+            <ul>
+              <li>$JAVA_HOME/jre/lib/management/jmxremote.password</li>
+              <li>$JAVA_HOME/jre/lib/management/jmxremote.access</li>
+            </ul>
+            You must modify these files as such (if none exist create them):
+            <p>jmxremote.password</p>
+            add a line to the end of the file declaring your username and password followed by a caridge return:
+            <p>secretusername secretpassword</p>
+            <p>jmxremote.access</p>
+            add the following line (with a caridge return) to the end of your file:
+            <p>secretusername      readwrite</p>
+            You must also:<br/>
+            $ chmod 500 jmxremote.password<br/>
+            $ chown &lt;user who will execute the tc-server&gt; jmxremote.password
+            <br/><br/>
+            NOTE: This will not work unless you're correctly running the Terracotta server with Java version >= 1.5
+              </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+
+      <xs:element name="data" type="path" minOccurs="0"
+        default="data">
+        <xs:annotation>
+          <xs:documentation>
+            Where should the server store its persistent
+            data? (This includes stored object data for
+            DSO.) This value undergoes parameter
+            substitution before being used; this allows you
+            to use placeholders like '%h' (for the hostname)
+            or '%(com.mycompany.propname)' (to substitute in
+            the value of Java system property
+            'com.mycompany.propname'). Thus, a value of
+            'server-data-%h' would expand to
+            'server-data-artichoke' if running on host
+            'artichoke'.
+
+            If this is a relative path, then it is
+            interpreted relative to the current working
+            directory of the server (that is, the directory
+            you were in when you started the server). It is
+            thus recommended that you specify an absolute
+            path here.
+
+            Default: 'data'
+
+            This places the 'data' directory in the
+            directory you were in when you invoked
+            'start-tc-server'.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="logs" type="path" minOccurs="0"
+        default="logs">
+        <xs:annotation>
+          <xs:documentation>
+            In which directory should the server store its
+            log files? Again, this value undergoes parameter
+            substitution before being used; thus, a value
+            like 'server-logs-%h' would expand to
+            'server-logs-artichoke' if running on host
+            'artichoke'.
+
+            If this is a relative path, then it is
+            interpreted relative to the current working
+            directory of the server (that is, the directory
+            you were in when you started server). It is thus
+            recommended that you specify an absolute path
+            here.
+
+            Default: 'logs'
+
+            This places the 'logs' directory in the
+            directory you were in when you invoked
+            'start-tc-server'.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="dso-port" type="port" minOccurs="0"
+        default="9510">
+        <xs:annotation>
+          <xs:documentation>
+            On what port should the DSO server listen for
+            connections from DSO clients? This can be any
+            port you like, but note that ports below 1024
+            typically require 'root' privileges to use on
+            Unix-style systems (Linux, Solaris).
+
+            Default:9510
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="jmx-port" type="port" minOccurs="0"
+        default="9520">
+        <xs:annotation>
+          <xs:documentation>
+            On what port should the server listen for
+            connections from the Terracotta administration
+            console? This can be any port you like, but note
+            that ports below 1024 typically require 'root'
+            privileges to use on Unix-style systems (Linux,
+            Solaris).
+
+            Default: 9520
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="l2-group-port" type="port" minOccurs="0" default="9530">
+        <xs:annotation>
+          <xs:documentation>
+            Port for server to server communication which must
+            be indicated when HA mode is networked-active-passive.
+            This can be any port you like, but note that ports
+            below 1024 typically require 'root' privileges to
+            use on Unix-style systems (Linux, Solaris).
+
+            Default: 9530
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+
+      <xs:element name="dso" type="dso-server-data"
+        minOccurs="0">
+        <xs:annotation>
+          <xs:documentation>
+            Configuration data for DSO that's specific to
+            the DSO server.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+    <xs:attribute name="host" type="host" use="optional">
+      <xs:annotation>
+        <xs:documentation>
+          The host that the server runs on, expansion parameters
+          may be used in this attribute.  Defaults to "%i" (the
+          machine IP address).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="name" type="non-blank-token"
+      use="optional">
+      <xs:annotation>
+        <xs:documentation>
+          The symbolic name of the server, expansion parameters may
+          be used.  Defaults to "host:dso-port".
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+
+  <xs:complexType name="client">
+    <xs:annotation>
+      <xs:documentation>
+        This section contains settings that affect all clients
+        that connect to the system.
+
+        Note that while these settings are applied uniformly
+        across all clients, this does not prevent you from
+        applying different settings to various clients. There
+        are two ways of doing this:
+
+        - Certain parameters ('logs', below) undergo parameter
+        expansion before being used by the client. This allows
+        you to use various predefined substitutions (like '%h'
+        for host), or a general one (%(myprop) to use the value
+        of Java system property 'myprop'), for these values;
+        expansions are carried out in each client's JVM
+        independently.
+
+        - For each client to have its own configuration you can
+        set 'tc.config' to the configuration file. If the
+        configuration model is production then the 'application'
+        section for all of the clients comes from the
+        application section of the server's config file.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="modules" type="modules"
+        minOccurs="0">
+        <xs:annotation>
+          <xs:documentation>
+            This section contains the list of modules to use in
+            the client.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="logs" type="path" minOccurs="0"
+        default="logs-%i">
+        <xs:annotation>
+          <xs:documentation>
+            Where should the client write its log files?
+
+            This value undergoes parameter substitution
+            before being used; thus, a value like
+            'client-logs-%h' would expand to
+            'client-logs-banana' if running on host
+            'banana'.
+
+            If this is a relative path, then it is
+            interpreted relative to the current working
+            directory of the client (that is, the directory
+            you were in when you started the program that
+            uses Terracotta services). It is thus
+            recommended that you specify an absolute path
+            here.
+
+            Default: 'logs-%i';
+
+            this places the logs in a directory relative to
+            the directory you were in when you invoked the
+            program that uses Terracotta services (your
+            client), and calls that directory, for example,
+            'logs-10.0.0.57' if the machine that the client
+            is on has assigned IP address 10.0.0.57.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="dso" type="dso-client-data"
+        minOccurs="0">
+        <xs:annotation>
+          <xs:documentation>
+            This section contains data for Terracotta DSO
+            that's specific to the DSO client only.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="application">
+    <xs:annotation>
+      <xs:documentation>
+        This section contains items that affect the core
+        behavior of Terracotta as it relates to your
+        application. This data must be kept consistent across
+        clients and servers in order for Terracotta to function
+        properly, and so the system will enforce this; see the
+        comments for the 'configuration-model' switch, above,
+        for more details.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="dso" type="dso-application"
+        minOccurs="0">
+        <xs:annotation>
+          <xs:documentation>
+            This section controls how Terracotta DSO behaves
+            in your application.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+
+      <xs:element name="spring" type="spring-application"
+        minOccurs="0">
+        <xs:annotation>
+          <xs:documentation>
+            This section is a self-contained configuration
+            that controls how Terracotta for Spring behaves in
+            your application.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="servers">
+    <xs:annotation>
+      <xs:documentation>
+        This section defines the servers present in your
+        Terracotta system. You can omit this section entirely, in
+        which case it behaves as if there's a single server with
+        all values set at their default. You can include exactly
+        one server entry here (the common case), or, if you're
+        going to run multiple servers for failover, you can
+        include multiple servers here.
+
+        If you include more than one server here, note that each
+        server will need to know which configuration it should use
+        as it starts up. If you name your servers according to the
+        host that they run on (and no host contains more than one
+        server), then they will find the hostname themselves and
+        work automatically.
+
+        If you name your servers in any other fashion (and, again,
+        only if there is more than one 'server' element present
+        here), then you will need to pass the command-line option
+        "-n
+        <![CDATA[ <name>]]>
+        " to the start-tc-server script, passing it the name of a
+        server configuration from this file.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:sequence maxOccurs="1">
+                <xs:sequence>
+        <xs:element name="server" type="server"
+          maxOccurs="unbounded" />
+      </xs:sequence>
+      <xs:element name="ha" type="ha" maxOccurs="1" minOccurs="0"></xs:element>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:simpleType name="configuration-model">
+    <xs:annotation>
+      <xs:documentation>
+        The configuration model: 'development' or 'production'.
+
+        The clients can each have their own configuration
+        file or all use the server's configuration file.
+
+        The server's configuration file is located at
+        http://localhost:9515/config
+
+        If the configuration model is production then the
+        'application' section for all of the clients comes
+        from the application section of the server's config
+        file.
+
+        If the configuration model is development then each
+        of the clients's 'application' section is determined
+        by their own configuration file.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="development" />
+      <xs:enumeration value="production" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="license-type">
+    <xs:annotation>
+      <xs:documentation>
+        What type of license is in use? This can be 'trial' or
+        'production', and does not affect the behavior of the
+        system other than ensuring that the license in use
+        matches this type. (This prevents you from accidentally
+        putting a trial license onto your production server and
+        then panicking thirty days later when that license
+        expires.)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="none" />
+      <xs:enumeration value="trial" />
+      <xs:enumeration value="production" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:complexType name="license">
+    <xs:all>
+      <xs:element name="location" type="path">
+        <xs:annotation>
+          <xs:documentation>
+            Where is the license file? Each server must have
+            access to this file (which may be a relative or
+            absolute path). This item can use parameter
+            substitution, which allows you to insert data
+            like '%h' and have it expand to the current
+            hostname; this allows flexibility in the case
+            where different servers have their license file
+            in different locations.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="type" type="license-type"
+        default="none">
+        <xs:annotation>
+          <xs:documentation>
+            What type of license is in use? This can be
+            'trial' or 'production', and does not affect the
+            behavior of the system other than ensuring that
+            the license in use matches this type. (This
+            prevents you from accidentally putting a trial
+            license onto your production server and then
+            panicking thirty days later when that license
+            expires.)
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+
+  <xs:complexType name="system">
+    <xs:annotation>
+      <xs:documentation>
+        The 'system' section contains configuration data that
+        affects the entire Terracotta system as a whole; things
+        like whether to activate DSO services go here.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="license" type="license" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation>
+            The 'license' element requires a 'location' and
+            'type' to be specified. If you omit the
+            'license' element, Terracotta will run in a
+            limited 'initial' mode, which limits server
+            runtime and limits the maximum number of
+            simultaneously-connected clients.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="configuration-model"
+        type="configuration-model" minOccurs="0" default="development" />
+    </xs:all>
+  </xs:complexType>
+
+  <xs:simpleType name="ha-mode">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="networked-active-passive" />
+      <xs:enumeration value="disk-based-active-passive" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="non-blank-token">
+    <xs:restriction base="xs:token">
+      <xs:minLength value="1" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="path">
+    <xs:annotation>
+      <xs:documentation>
+        Several different predefined substitutions are available
+        for your use:
+
+        %h expands to the fully-qualified host name of the
+        machine running your application
+
+        %i expands to the IP adress of the machine running
+        your application
+
+        %H refers to the home directory of the user running
+        running your application
+
+        %n refers to the username of the user running
+        running your application
+
+        %o refers to the name of the operating system
+        running running your application
+
+        %a refers to the processor architecture of the
+        machine running running your application %v refers
+        to the version of the operating system running
+        running your application
+
+        %t refers to the temporary directory of the machine
+        running your application(on Linux or Solaris, e.g.,
+        /tmp)
+
+        %(property) refers to the java system property of
+        the JVM running on the machine(e.g. %(java.home) )
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:minLength value="1" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="fixed-string-unlimited">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="unlimited" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="fixed-string-none">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="none" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="positive-int">
+    <xs:restriction base="xs:positiveInteger">
+      <xs:maxInclusive value="2147483647" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="non-negative-int">
+    <xs:restriction base="xs:nonNegativeInteger">
+      <xs:maxInclusive value="2147483647" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="positive-int-or-none">
+    <xs:union memberTypes="positive-int fixed-string-none" />
+  </xs:simpleType>
+
+  <xs:simpleType name="port">
+    <xs:restriction base="xs:nonNegativeInteger">
+      <xs:minInclusive value="0" />
+      <xs:maxInclusive value="65535" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="host">
+    <xs:restriction base="xs:string">
+      <xs:whiteSpace value="collapse" />
+      <xs:minLength value="1" />
+      <xs:maxLength value="255" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="qualified-class-name">
+    <xs:restriction base="xs:token">
+      <xs:pattern
+        value="[A-Za-z_][A-Za-z_0-9$]*(\.[A-Za-z_][A-Za-z_0-9$]*)*" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="class-name">
+    <xs:restriction base="xs:token">
+      <xs:pattern value="[A-Za-z_][A-Za-z_0-9$]*" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="qualified-field-name">
+    <xs:restriction base="xs:token">
+      <xs:pattern
+        value="[A-Za-z_][A-Za-z_0-9$]*(\.[A-Za-z_][A-Za-z_0-9$]*)+" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="field-name">
+    <xs:restriction base="xs:token">
+      <xs:pattern value="[A-Za-z_][A-Za-z_0-9$]*" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="method-name">
+    <xs:restriction base="xs:token">
+      <xs:pattern value="[A-Za-z_][A-Za-z_0-9$]*" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="qualified-method-name">
+    <xs:restriction base="xs:token">
+      <xs:pattern
+        value="[A-Za-z_][A-Za-z_0-9$]*(\.[A-Za-z_][A-Za-z_0-9$]*)+" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="optionally-qualified-method-name">
+    <xs:restriction base="xs:token">
+      <xs:pattern
+        value="[A-Za-z_][A-Za-z_0-9$]*(\.[A-Za-z_][A-Za-z_0-9$]*)*" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="java-identifier">
+    <xs:restriction base="xs:token">
+      <xs:pattern value="[A-Za-z_][A-Za-z_0-9$]*" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="dso" type="dso-application">
+    <xs:annotation>
+      <xs:documentation>
+        Terracotta Plug-in configuration element
+      </xs:documentation>
+    </xs:annotation>
+  </xs:element>
+
+</xs:schema>
diff --git a/xml/tests/testData/completion/CompleteWhenUnqualifiedElements_after.xml b/xml/tests/testData/completion/CompleteWhenUnqualifiedElements_after.xml
new file mode 100644
index 0000000..d2ed4cb
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteWhenUnqualifiedElements_after.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <tc:tc-config xmlns:tc="http://www.terracotta.org/config"
+               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xsi:schemaLocation="http://www.terracotta.org/config CompleteWhenUnqualifiedElements.xsd">
+     <application>
+         <dso>
+             <instrumented-classes>
+                 <include>
+                     <class-expression><caret></class-expression>
+                 </include>
+             </instrumented-classes>
+         </dso>
+     </application>
+ </tc:tc-config>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteWithSubstitutionGroup.xml b/xml/tests/testData/completion/CompleteWithSubstitutionGroup.xml
new file mode 100644
index 0000000..4c25218
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteWithSubstitutionGroup.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mule xmlns="http://www.mulesource.org/schema/mule/core/2.0"
+      xmlns:management="http://www.mulesource.org/schema/mule/management/2.0"
+      xmlns:spring="http://www.springframework.org/schema/beans"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
+      xsi:schemaLocation="http://www.mulesource.org/schema/mule/core/2.0 mule.xsd
+        http://www.mulesource.org/schema/mule/management/2.0 mule-management.xsd
+        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+    <managem<caret>
+</mule>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteWithSubstitutionGroup_after.xml b/xml/tests/testData/completion/CompleteWithSubstitutionGroup_after.xml
new file mode 100644
index 0000000..c542f32
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteWithSubstitutionGroup_after.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mule xmlns="http://www.mulesource.org/schema/mule/core/2.0"
+      xmlns:management="http://www.mulesource.org/schema/mule/management/2.0"
+      xmlns:spring="http://www.springframework.org/schema/beans"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
+      xsi:schemaLocation="http://www.mulesource.org/schema/mule/core/2.0 mule.xsd
+        http://www.mulesource.org/schema/mule/management/2.0 mule-management.xsd
+        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+    <management:chainsaw-notifications chainsawHost="" chainsawPort=""<caret>
+</mule>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteWords.xml b/xml/tests/testData/completion/CompleteWords.xml
new file mode 100644
index 0000000..4b72d78
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteWords.xml
@@ -0,0 +1,4 @@
+<root>
+  <element attribute="ABxxCDEF"/>
+  <element attribute="ABxx<caret>"/>
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteWords_after.xml b/xml/tests/testData/completion/CompleteWords_after.xml
new file mode 100644
index 0000000..57f24c8
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteWords_after.xml
@@ -0,0 +1,4 @@
+<root>
+  <element attribute="ABxxCDEF"/>
+  <element attribute="ABxxCDEF<caret>"/>
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteXmlLang.xml b/xml/tests/testData/completion/CompleteXmlLang.xml
new file mode 100644
index 0000000..61b8631
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteXmlLang.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+    <bean xml:l<caret>/>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteXmlLang_2.xml b/xml/tests/testData/completion/CompleteXmlLang_2.xml
new file mode 100644
index 0000000..40eb375
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteXmlLang_2.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+    <bean xml:lang="eee">
+        <description xml:l<caret>/>
+    </bean>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteXmlLang_2_after.xml b/xml/tests/testData/completion/CompleteXmlLang_2_after.xml
new file mode 100644
index 0000000..40eb375
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteXmlLang_2_after.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+    <bean xml:lang="eee">
+        <description xml:l<caret>/>
+    </bean>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteXmlLang_after.xml b/xml/tests/testData/completion/CompleteXmlLang_after.xml
new file mode 100644
index 0000000..c3118ac
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteXmlLang_after.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+    <bean xml:lang="<caret>"/>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteXmlTag.xml b/xml/tests/testData/completion/CompleteXmlTag.xml
new file mode 100644
index 0000000..01403de
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteXmlTag.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
+                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                      xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
+                      name="Backbase Portal Archetype Blank">
+
+    <re<caret>
+</archetype-descriptor>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteXmlTag_after.xml b/xml/tests/testData/completion/CompleteXmlTag_after.xml
new file mode 100644
index 0000000..0185c3a
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteXmlTag_after.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
+                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                      xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
+                      name="Backbase Portal Archetype Blank">
+
+    <requiredProperties><caret></requiredProperties>
+</archetype-descriptor>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteXsl.xml b/xml/tests/testData/completion/CompleteXsl.xml
new file mode 100644
index 0000000..99fa535
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteXsl.xml
@@ -0,0 +1,12 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<xsl:template name="hoo" match="/">
+  <html>
+  <body>
+  <xsl:for-each select="devguru_staff/programmer">
+    <ch<caret>
+  </xsl:for-each>
+  </body>
+  </html>
+</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CompleteXsl_after.xml b/xml/tests/testData/completion/CompleteXsl_after.xml
new file mode 100644
index 0000000..043ad7c
--- /dev/null
+++ b/xml/tests/testData/completion/CompleteXsl_after.xml
@@ -0,0 +1,14 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<xsl:template name="hoo" match="/">
+  <html>
+  <body>
+  <xsl:for-each select="devguru_staff/programmer">
+    <xsl:choose>
+        <xsl:when test=""></xsl:when>
+    </xsl:choose>
+  </xsl:for-each>
+  </body>
+  </html>
+</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CorrectPrefixInsertion.xml b/xml/tests/testData/completion/CorrectPrefixInsertion.xml
new file mode 100644
index 0000000..9fef41e
--- /dev/null
+++ b/xml/tests/testData/completion/CorrectPrefixInsertion.xml
@@ -0,0 +1,8 @@
+<!DOCTYPE tribhip [
+  <!ELEMENT tribhip EMPTY>
+  <!ATTLIST tribhip
+	startaend CDATA #IMPLIED
+	startbend CDATA #IMPLIED
+	weight CDATA #IMPLIED>
+  ]>
+<tribhip star<caret>taend="value" weight="true"/>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CorrectPrefixInsertion_after.xml b/xml/tests/testData/completion/CorrectPrefixInsertion_after.xml
new file mode 100644
index 0000000..9fef41e
--- /dev/null
+++ b/xml/tests/testData/completion/CorrectPrefixInsertion_after.xml
@@ -0,0 +1,8 @@
+<!DOCTYPE tribhip [
+  <!ELEMENT tribhip EMPTY>
+  <!ATTLIST tribhip
+	startaend CDATA #IMPLIED
+	startbend CDATA #IMPLIED
+	weight CDATA #IMPLIED>
+  ]>
+<tribhip star<caret>taend="value" weight="true"/>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CorrectSelectionInsertion.xml b/xml/tests/testData/completion/CorrectSelectionInsertion.xml
new file mode 100644
index 0000000..36e4439
--- /dev/null
+++ b/xml/tests/testData/completion/CorrectSelectionInsertion.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+		"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+		"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" <caret><selection>default-cascade="all"</selection>>
+</hibernate-mapping>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CorrectSelectionInsertion2.xml b/xml/tests/testData/completion/CorrectSelectionInsertion2.xml
new file mode 100644
index 0000000..2eab708
--- /dev/null
+++ b/xml/tests/testData/completion/CorrectSelectionInsertion2.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+		"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+		"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" <caret>default-cascade="all">
+</hibernate-mapping>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CorrectSelectionInsertion2_after.xml b/xml/tests/testData/completion/CorrectSelectionInsertion2_after.xml
new file mode 100644
index 0000000..7516de74
--- /dev/null
+++ b/xml/tests/testData/completion/CorrectSelectionInsertion2_after.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+		"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+		"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" package="<caret>all">
+</hibernate-mapping>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/CorrectSelectionInsertion_after.xml b/xml/tests/testData/completion/CorrectSelectionInsertion_after.xml
new file mode 100644
index 0000000..ca3e90d
--- /dev/null
+++ b/xml/tests/testData/completion/CorrectSelectionInsertion_after.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+		"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+		"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" package="<caret>">
+</hibernate-mapping>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DoNotSuggestAbstractElementsFromSchema.xml b/xml/tests/testData/completion/DoNotSuggestAbstractElementsFromSchema.xml
new file mode 100644
index 0000000..9f20057
--- /dev/null
+++ b/xml/tests/testData/completion/DoNotSuggestAbstractElementsFromSchema.xml
@@ -0,0 +1,8 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"
+        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd"/>
+    <xsl:template>
+      <xsl:top-level<caret>
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DoNotSuggestAbstractElementsFromSchema_after.xml b/xml/tests/testData/completion/DoNotSuggestAbstractElementsFromSchema_after.xml
new file mode 100644
index 0000000..9f20057
--- /dev/null
+++ b/xml/tests/testData/completion/DoNotSuggestAbstractElementsFromSchema_after.xml
@@ -0,0 +1,8 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"
+        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd"/>
+    <xsl:template>
+      <xsl:top-level<caret>
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt.xml b/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt.xml
new file mode 100644
index 0000000..82d694e
--- /dev/null
+++ b/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt.xml
@@ -0,0 +1,7 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:spring="http://www.springframework.org/schema/beans">
+    <xsl:template>
+      <xsl:call-template name="zzz">
+        <spr<caret>
+      </xsl:call-template>
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_2.xml b/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_2.xml
new file mode 100644
index 0000000..7ca0c68
--- /dev/null
+++ b/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_2.xml
@@ -0,0 +1,12 @@
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+
+  <xsl:template match="/*">
+    <taglib>
+      <xsl:if test="@version">
+        <tlib-version><xsl:ap<caret></tlib-version>
+      </xsl:if>
+    </taglib>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_2_after.xml b/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_2_after.xml
new file mode 100644
index 0000000..07f2c1a
--- /dev/null
+++ b/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_2_after.xml
@@ -0,0 +1,12 @@
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+
+  <xsl:template match="/*">
+    <taglib>
+      <xsl:if test="@version">
+        <tlib-version><xsl:apply-imports/><caret></tlib-version>
+      </xsl:if>
+    </taglib>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_3.xml b/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_3.xml
new file mode 100644
index 0000000..917d521
--- /dev/null
+++ b/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_3.xml
@@ -0,0 +1,12 @@
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd">
+
+  <xsl:template match="/*">
+    <taglib>
+      <xsl:if test="@version">
+        <tlib-version><xsl:ap<caret></tlib-version>
+      </xsl:if>
+    </taglib>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_3_after.xml b/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_3_after.xml
new file mode 100644
index 0000000..5ff4683
--- /dev/null
+++ b/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_3_after.xml
@@ -0,0 +1,12 @@
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd">
+
+  <xsl:template match="/*">
+    <taglib>
+      <xsl:if test="@version">
+        <tlib-version><xsl:apply-imports/><caret></tlib-version>
+      </xsl:if>
+    </taglib>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_after.xml b/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_after.xml
new file mode 100644
index 0000000..82d694e
--- /dev/null
+++ b/xml/tests/testData/completion/DoNotSuggestTagsFromOtherNsInXslt_after.xml
@@ -0,0 +1,7 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:spring="http://www.springframework.org/schema/beans">
+    <xsl:template>
+      <xsl:call-template name="zzz">
+        <spr<caret>
+      </xsl:call-template>
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DoNotSuggestTagsInXHtml.xml b/xml/tests/testData/completion/DoNotSuggestTagsInXHtml.xml
new file mode 100644
index 0000000..f09238f
--- /dev/null
+++ b/xml/tests/testData/completion/DoNotSuggestTagsInXHtml.xml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:foo="foo">
+  <head>
+    <title>test</title>
+    <bo<caret>
+  </head>
+
+  <body>
+  </body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DoNotSuggestTagsInXHtml_after.xml b/xml/tests/testData/completion/DoNotSuggestTagsInXHtml_after.xml
new file mode 100644
index 0000000..f09238f
--- /dev/null
+++ b/xml/tests/testData/completion/DoNotSuggestTagsInXHtml_after.xml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:foo="foo">
+  <head>
+    <title>test</title>
+    <bo<caret>
+  </head>
+
+  <body>
+  </body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DtdCompletion.dtd b/xml/tests/testData/completion/DtdCompletion.dtd
new file mode 100644
index 0000000..32fec3e6
--- /dev/null
+++ b/xml/tests/testData/completion/DtdCompletion.dtd
@@ -0,0 +1,2 @@
+<!ELEMENT IdeaConfig>
+<!ELEMENT <caret>>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DtdCompletion2.dtd b/xml/tests/testData/completion/DtdCompletion2.dtd
new file mode 100644
index 0000000..2d378dca
--- /dev/null
+++ b/xml/tests/testData/completion/DtdCompletion2.dtd
@@ -0,0 +1,2 @@
+<!ELEMENT IdeaConfig>
+<!EL<caret>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DtdCompletion2_after.dtd b/xml/tests/testData/completion/DtdCompletion2_after.dtd
new file mode 100644
index 0000000..32fec3e6
--- /dev/null
+++ b/xml/tests/testData/completion/DtdCompletion2_after.dtd
@@ -0,0 +1,2 @@
+<!ELEMENT IdeaConfig>
+<!ELEMENT <caret>>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DtdCompletion3.dtd b/xml/tests/testData/completion/DtdCompletion3.dtd
new file mode 100644
index 0000000..65cd6b3
--- /dev/null
+++ b/xml/tests/testData/completion/DtdCompletion3.dtd
@@ -0,0 +1 @@
+<!ELEMENT IdeaConfig #P<caret>>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DtdCompletion3_after.dtd b/xml/tests/testData/completion/DtdCompletion3_after.dtd
new file mode 100644
index 0000000..d073752b
--- /dev/null
+++ b/xml/tests/testData/completion/DtdCompletion3_after.dtd
@@ -0,0 +1 @@
+<!ELEMENT IdeaConfig #PCDATA<caret>>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DtdCompletion4.dtd b/xml/tests/testData/completion/DtdCompletion4.dtd
new file mode 100644
index 0000000..e5d9eb7
--- /dev/null
+++ b/xml/tests/testData/completion/DtdCompletion4.dtd
@@ -0,0 +1 @@
+<!ELEMENT tag EM<caret>>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DtdCompletion4_after.dtd b/xml/tests/testData/completion/DtdCompletion4_after.dtd
new file mode 100644
index 0000000..51415aa
--- /dev/null
+++ b/xml/tests/testData/completion/DtdCompletion4_after.dtd
@@ -0,0 +1 @@
+<!ELEMENT tag EMPTY<caret>>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DtdCompletion5.dtd b/xml/tests/testData/completion/DtdCompletion5.dtd
new file mode 100644
index 0000000..b907625
--- /dev/null
+++ b/xml/tests/testData/completion/DtdCompletion5.dtd
@@ -0,0 +1,4 @@
+<!ATTLIST tag2 id2 ID #IMPLIED
+  session         %Bo<caret> 
+>
+<!ENTITY % Boolean "(true|false|yes|no)">
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DtdCompletion5_after.dtd b/xml/tests/testData/completion/DtdCompletion5_after.dtd
new file mode 100644
index 0000000..692e9c6
--- /dev/null
+++ b/xml/tests/testData/completion/DtdCompletion5_after.dtd
@@ -0,0 +1,4 @@
+<!ATTLIST tag2 id2 ID #IMPLIED
+  session         %Boolean;<caret> 
+>
+<!ENTITY % Boolean "(true|false|yes|no)">
\ No newline at end of file
diff --git a/xml/tests/testData/completion/DtdCompletion_after.dtd b/xml/tests/testData/completion/DtdCompletion_after.dtd
new file mode 100644
index 0000000..ccbe0cb
--- /dev/null
+++ b/xml/tests/testData/completion/DtdCompletion_after.dtd
@@ -0,0 +1,2 @@
+<!ELEMENT IdeaConfig>
+<!ELEMENT IdeaConfig<caret>>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/IDEADEV_32773-jms.xsd b/xml/tests/testData/completion/IDEADEV_32773-jms.xsd
new file mode 100644
index 0000000..2450610
--- /dev/null
+++ b/xml/tests/testData/completion/IDEADEV_32773-jms.xsd
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/jms/2.1"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:mule="http://www.mulesource.org/schema/mule/core/2.1"
+            xmlns:schemadoc="http://www.mulesource.org/schema/mule/schemadoc/2.1"
+            targetNamespace="http://www.mulesource.org/schema/mule/jms/2.1"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+    <xsd:import namespace="http://www.mulesource.org/schema/mule/core/2.1"
+                schemaLocation="IDEADEV_32773.xsd" />
+    <xsd:import namespace = "http://www.mulesource.org/schema/mule/schemadoc/2.1"
+                schemaLocation = "IDEADEV_32773-schemadoc.xsd"/>
+
+    <xsd:annotation>
+        <xsd:documentation>The JMS transport provides support for sending messages via JMS queues.</xsd:documentation>
+        <xsd:appinfo>
+            <schemadoc:short-name>JMS</schemadoc:short-name>
+            <schemadoc:page-title>JMS Transport</schemadoc:page-title>
+            <schemadoc:transport-features receiveEvents="true" dispatchEvents="true" responseEvents="true"
+                                          requestEvents="true"
+                                          transactions="true" streaming="true">
+                <schemadoc:inboundMEPs in-only="true" in-optional-out="true" in-out="true"/>
+                <schemadoc:outboundMEPs out-only="true" out-in="true" out-optional-in="true"/>
+            </schemadoc:transport-features>
+        </xsd:appinfo>
+    </xsd:annotation>
+
+    <!-- Generic JMS Connector -->
+    <xsd:element name="connector" type="genericConnectorType" substitutionGroup="mule:abstract-connector">
+        <xsd:annotation>
+            <xsd:documentation>
+                A generic connector for sending and receiving messages over JMS queues.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="genericConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:connectorType">
+                <!-- The ConnectionFactory is required for non-vendor JMS configs -->
+                <xsd:attribute name="connectionFactory-ref" type="xsd:NMTOKEN"/>
+                <xsd:attributeGroup ref="jmsConnectorAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Custom JMS Connector -->
+    <xsd:element name="custom-connector" substitutionGroup="mule:abstract-connector">
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="mule:customConnectorType">
+                    <xsd:attributeGroup ref="jmsConnectorAttributes"/>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:attributeGroup name="jmsConnectorAttributes">
+        <xsd:attribute name="redeliveryHandlerFactory-ref" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="acknowledgementMode" default="AUTO_ACKNOWLEDGE">
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="AUTO_ACKNOWLEDGE"/>
+                    <xsd:enumeration value="CLIENT_ACKNOWLEDGE"/>
+                    <xsd:enumeration value="DUPS_OK_ACKNOWLEDGE"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="clientId" type="xsd:string"/>
+        <xsd:attribute name="durable" type="mule:substitutableBoolean"/>
+        <xsd:attribute name="noLocal" type="mule:substitutableBoolean"/>
+        <xsd:attribute name="persistentDelivery" type="mule:substitutableBoolean"/>
+        <xsd:attribute name="honorQosHeaders" type="mule:substitutableBoolean"/>
+        <xsd:attribute name="maxRedelivery" type="mule:substitutableInt"/>
+        <xsd:attribute name="cacheJmsSessions" type="mule:substitutableBoolean"/>
+        <xsd:attribute name="recoverJmsConnections" type="mule:substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Deprecated.  This attribute is no longer relevant for the new retry policies.  See MULE-3812
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="eagerConsumer" type="mule:substitutableBoolean"/>
+        <!-- Defaults to org.mule.transport.jms.JmsConstants.JMS_SPECIFICATION_102B  -->
+        <xsd:attribute name="specification" default="1.0.2b">
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="1.0.2b"/>
+                    <xsd:enumeration value="1.1"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="username" type="xsd:string"/>
+        <xsd:attribute name="password" type="xsd:string"/>
+        <xsd:attribute name="numberOfConsumers" type="mule:substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Configures the number of concurrent consumers that will be used to receive JMS messages.
+                    (Note: If you use this attribute you should not configure the 'numberOfConcurrentTransactedReceivers' which has the same effect.)
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="jndiInitialFactory" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Configures the initial factory class to use when connecting to JNDI.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="jndiProviderUrl" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Configures the URL to use when connecting to JNDI.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="jndiProviderProperties-ref" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Configures a reference to a Map that contains additional provider properties.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="connectionFactoryJndiName" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Configures the name to use when looking up the connection factory from JNDI.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="jndiDestinations" type="xsd:boolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Set this to true if you want to lookup queues or topics from JNDI instead of
+                    creating them from the session.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="forceJndiDestinations" type="xsd:boolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If this is set to true, Mule to fails when a topic or queue cannot be retrieved
+                    from JNDI. If this is set to false, Mule will create a topic or queue from the
+                    JMS session if the JNDI lookup fails.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+
+    <!-- Vendor-specific JMS Connectors -->
+
+    <xsd:complexType name="vendorJmsConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:connectorType">
+                <!-- Optional, a default ConnectionFactory is provided for vendor JMS configs -->
+                <xsd:attribute name="connectionFactory-ref" type="xsd:NMTOKEN" use="optional"/>
+                <xsd:attributeGroup ref="jmsConnectorAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="activemq-connector" type="activeMqConnectorType" substitutionGroup="mule:abstract-connector"/>
+    <xsd:element name="activemq-xa-connector" type="activeMqConnectorType" substitutionGroup="mule:abstract-connector"/>
+    <xsd:complexType name="activeMqConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="vendorJmsConnectorType">
+                <xsd:attribute name="brokerURL" type="xsd:string"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="weblogic-connector" type="vendorJmsConnectorType" substitutionGroup="mule:abstract-connector"/>
+    <xsd:element name="websphere-connector" type="vendorJmsConnectorType" substitutionGroup="mule:abstract-connector"/>
+
+    <xsd:element name="transaction" type="mule:baseTransactionType" substitutionGroup="mule:abstract-transaction"/>
+    <xsd:element name="client-ack-transaction" type="mule:baseTransactionType" substitutionGroup="mule:abstract-transaction"/>
+
+    <xsd:element name="jmsmessage-to-object-transformer" type="mule:abstractTransformerType" substitutionGroup="mule:abstract-transformer"/>
+    <xsd:element name="object-to-jmsmessage-transformer" type="mule:abstractTransformerType" substitutionGroup="mule:abstract-transformer"/>
+
+    <xsd:element name="inbound-endpoint" type="inboundEndpointType" substitutionGroup="mule:abstract-inbound-endpoint"/>
+    <xsd:complexType name="inboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractInboundEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="mule:defaultEndpointAttributes"/>
+                <xsd:attributeGroup ref="addressAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="outbound-endpoint" type="outboundEndpointType" substitutionGroup="mule:abstract-outbound-endpoint"/>
+    <xsd:complexType name="outboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractOutboundEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="mule:defaultEndpointAttributes"/>
+                <xsd:attributeGroup ref="addressAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="endpoint" type="globalEndpointType" substitutionGroup="mule:abstract-global-endpoint"/>
+    <xsd:complexType name="globalEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractGlobalEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="mule:defaultEndpointAttributes"/>
+                <xsd:attributeGroup ref="addressAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:attributeGroup name="addressAttributes">
+        <xsd:attribute name="queue" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The queue name.
+                    This cannot be used with the topic attribute (the two are exclusive).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="topic" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The topic name.  The "topic:" prefix will be added automatically.
+                    This cannot be used with the queue attribute (the two are exclusive).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <!-- these include option/repeats - should be embedded once -->
+    <!-- this is a modified version of what is in mule.xsd, allowing either a selector or a
+         normal filter to be set -->
+    <xsd:group name="defaultEndpointElements">
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="mule:endpointTransformers"/>
+                <xsd:element ref="mule:abstract-transaction" minOccurs="0"/>
+                <xsd:element ref="mule:abstract-xa-transaction" minOccurs="0"/>
+                <xsd:choice>
+                    <xsd:element ref="mule:abstract-filter" minOccurs="0"/>
+                    <xsd:element name="selector" type="jmsSelectorFilter" minOccurs="0"/>
+                </xsd:choice>
+                <xsd:element ref="mule:abstract-security-filter" minOccurs="0"/>
+                <xsd:group ref="mule:propertiesGroup"/>
+            </xsd:sequence>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:complexType name="jmsSelectorFilter">
+        <xsd:annotation>
+            <xsd:documentation>
+                This sets a selector on the underlying JMS transport.
+                It is not a standard Mule filter and cannot be combined with other filters.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="expression" type="xsd:string"/>
+    </xsd:complexType>
+
+    <xsd:element name="property-filter" substitutionGroup="mule:abstract-filter">
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="mule:abstractFilterType">
+                    <xsd:attribute name="propertyName" type="xsd:string"/>
+                    <xsd:attribute name="propertyClass" type="xsd:string"/>
+                    <xsd:attribute name="expression" type="xsd:string"/>
+                    <xsd:attribute name="pattern" type="xsd:string"/>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+</xsd:schema>
diff --git a/xml/tests/testData/completion/IDEADEV_32773-schemadoc.xsd b/xml/tests/testData/completion/IDEADEV_32773-schemadoc.xsd
new file mode 100644
index 0000000..caf521b
--- /dev/null
+++ b/xml/tests/testData/completion/IDEADEV_32773-schemadoc.xsd
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/schemadoc/2.1"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://www.mulesource.org/schema/mule/schemadoc/2.1"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+    <xsd:annotation>
+        <xsd:documentation>This schema provides a schema doc extentions that can be embedded in Mule schemas. These
+            elements will be used to render additional wiki content associated with the element being annotated.
+            Elements within this schema should be embedded under 'xsd:element/xsd:annotation/xsd:appinfo'.
+            To stick to convention and to ensure that XSLs will work this schema should be included in other mule
+            schemas using the 'schemadoc' prefix namespace.
+        </xsd:documentation>
+        <xsd:appinfo>
+            <page-title>SchemaDoc Reference</page-title>
+        </xsd:appinfo>
+    </xsd:annotation>
+
+    <xsd:element name="snippet" type="snippetType">
+        <xsd:annotation>
+            <xsd:documentation>The snippet allows for code snippets to be associated with an element in a schema. This
+                is useful for surfacing documentation on the wiki. When the schema reference is generated for the wiki,
+                the code snippets will also be rendered when using the 'single-element-wike.xsl'.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="page-title" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>The page title to use when rendering this schema.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="short-name" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>The short name of the module or transport, i.e. 'xml' or 'tcp'.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="additional-documentation" type="additionalDocumentationType">
+        <xsd:annotation>
+            <xsd:documentation>Additional documentation that can be rendered with the schema. Note that this element can
+                only be used in {{/xsd:schema/xsd:annotation/xsd:appinfo}}, it will be ignorred if used anywhere else.
+                Enter
+                the documentation in the body of this element.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="additionalDocumentationType" mixed="true">
+        <xsd:attribute name="where" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The point at which the documentation is rendered.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="before-common-elements">
+                        <xsd:annotation>
+                            <xsd:documentation>The documentation will appear after any title text but before any of the
+                                common elements are rendered.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="after-common-elements">
+                        <xsd:annotation>
+                            <xsd:documentation>The documentation will appear right after common elements are rendered.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="before-specific-elements">
+                        <xsd:annotation>
+                            <xsd:documentation>The documentation will appear right before the elements specific to the
+                                schema are rendered.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="after-specific-elements">
+                        <xsd:annotation>
+                            <xsd:documentation>The documentation will appear right after the elements specific to the
+                                schema are rendered.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="before-single-element">
+                        <xsd:annotation>
+                            <xsd:documentation>If a specific element was named, this documentation will appear directly
+                                before the element. The mode is less useful but supported for completeness.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="after-single-element">
+                        <xsd:annotation>
+                            <xsd:documentation>If a specific element was named, this documentation will appear directly
+                                after the element. The mode is less useful but supported for completeness.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="snippetType" mixed="true">
+        <xsd:attribute name="id" type="xsd:NMTOKEN" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The ID of the snippet to embed in the wiki page. This ID is embedded in the source
+                    file using a START SNIPPET xxx comment.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="lang">
+            <xsd:annotation>
+                <xsd:documentation>The language format to use when rendering the content of the snippet on the wiki.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="xml"/>
+                    <xsd:enumeration value="java"/>
+                    <xsd:enumeration value="javadoc"/>
+                    <xsd:enumeration value="bash"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="sourcePath" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>This is the path to the source file. Note this should be relative to the project root
+                    directory i.e. transport/jms/src/main/resources/etc...
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="transport-features" type="transportFeaturesType">
+        <xsd:annotation>
+            <xsd:documentation>Defines meta information about transports such as whether they can send or receive events
+                and if they supprt transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="transportFeaturesType">
+        <xsd:sequence>
+            <xsd:element name="inboundMEPs" type="inboundMEPsType" minOccurs="1">
+                <xsd:annotation>
+                    <xsd:documentation>The Inbound MEPs that are supported by this Transport.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="outboundMEPs" type="outboundMEPsType" minOccurs="1">
+                <xsd:annotation>
+                    <xsd:documentation>The Outbound MEPs that are supported by this Transport.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="receiveEvents" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether the transport can receive events and thus can be used for an inbound
+                    endpoint.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="dispatchEvents" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Ehether the transport can be used to dispatch events and thus is supported as an
+                    outbound endpoint.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="requestEvents" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether the transport can be used to request events directly from the source.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="responseEvents" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether the transport can be used in request/response style messaging. This means
+                    that the transport provides a back-channel to the callee.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="transactions" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether transactions are supported by the transports. Transports that support (/)A
+                    transactions can be configured in a distributed 2 Phase Commit (Distributed) transaction.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="transactionTypes" type="xsd:string" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>A comma separated list of transaction types, i.e. local, XA</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="streaming" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether the transport supports streaming of the data is provides or publishes.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:complexType name="inboundMEPsType">
+        <xsd:attribute name="none" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="in-only" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="in-out" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="in-optional-out" type="xsd:boolean"></xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="outboundMEPsType">
+        <xsd:attribute name="none" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="out-only" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="out-in" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="out-optional-in" type="xsd:boolean"></xsd:attribute>
+    </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/completion/IDEADEV_32773-stdio.xsd b/xml/tests/testData/completion/IDEADEV_32773-stdio.xsd
new file mode 100644
index 0000000..476ac98
--- /dev/null
+++ b/xml/tests/testData/completion/IDEADEV_32773-stdio.xsd
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/stdio/2.1"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:mule="http://www.mulesource.org/schema/mule/core/2.1"
+            xmlns:schemadoc="http://www.mulesource.org/schema/mule/schemadoc/2.1"
+            targetNamespace="http://www.mulesource.org/schema/mule/stdio/2.1"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+    <xsd:import namespace="http://www.mulesource.org/schema/mule/core/2.1"
+                schemaLocation="IDEADEV_32773.xsd" />
+    <xsd:import namespace = "http://www.mulesource.org/schema/mule/schemadoc/2.1"
+                schemaLocation = "IDEADEV_32773-schemadoc.xsd"/>
+
+    <xsd:annotation>
+        <xsd:documentation>
+            The STDIO transport The STDIO Transport allows the reading and writing of streaming data to Java's System.out and System.in objects for debugging.
+        </xsd:documentation>
+        <xsd:appinfo>
+            <schemadoc:short-name>STDIO</schemadoc:short-name>
+            <schemadoc:page-title>STDIO Transport</schemadoc:page-title>
+            <schemadoc:transport-features receiveEvents="true" dispatchEvents="true" responseEvents="false"
+                                          requestEvents="true"
+                                          transactions="false" streaming="true">
+                <schemadoc:inboundMEPs in-only="true"/>
+                <schemadoc:outboundMEPs out-only="true"/>
+            </schemadoc:transport-features>
+        </xsd:appinfo>
+    </xsd:annotation>
+    <xsd:element name="connector" type="stdioConnectorType" substitutionGroup="mule:abstract-connector"/>
+
+    <xsd:complexType name="stdioConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:connectorType">
+                <xsd:attribute name="messageDelayTime" type="mule:substitutableLong">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Delay in milliseconds before printing the prompt to stdout.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="outputMessage" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Text printed to stdout when a message is sent.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="promptMessage" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Text printed to stdout when waiting for input.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="promptMessageCode" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Code used to retrieve prompt message from resource bundle.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="outputMessageCode" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Code used to retrieve output message from resource bundle.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="resourceBundle" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Resource bundle to provide prompt with promptMessageCode.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="inbound-endpoint" type="inboundEndpointType" substitutionGroup="mule:abstract-inbound-endpoint"/>
+    <xsd:complexType name="inboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:inboundEndpointType">
+                <xsd:attributeGroup ref="addressAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="outbound-endpoint" type="outboundEndpointType" substitutionGroup="mule:abstract-outbound-endpoint"/>
+    <xsd:complexType name="outboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:outboundEndpointType">
+                <xsd:attributeGroup ref="addressAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="endpoint" type="globalEndpointType" substitutionGroup="mule:abstract-global-endpoint"/>
+    <xsd:complexType name="globalEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:globalEndpointType">
+                <xsd:attributeGroup ref="addressAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:attributeGroup name="addressAttributes">
+        <xsd:attribute name="system">
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="IN"/>
+                    <xsd:enumeration value="OUT"/>
+                    <xsd:enumeration value="ERR"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+</xsd:schema>
diff --git a/xml/tests/testData/completion/IDEADEV_32773-vm.xsd b/xml/tests/testData/completion/IDEADEV_32773-vm.xsd
new file mode 100644
index 0000000..084687c
--- /dev/null
+++ b/xml/tests/testData/completion/IDEADEV_32773-vm.xsd
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/vm/2.1"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:mule="http://www.mulesource.org/schema/mule/core/2.1"
+            xmlns:schemadoc="http://www.mulesource.org/schema/mule/schemadoc/2.1"
+            targetNamespace="http://www.mulesource.org/schema/mule/vm/2.1"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+    <xsd:import namespace="http://www.mulesource.org/schema/mule/core/2.1"
+                schemaLocation="IDEADEV_32773.xsd" />
+    <xsd:import namespace = "http://www.mulesource.org/schema/mule/schemadoc/2.1"
+                schemaLocation = "IDEADEV_32773-schemadoc.xsd"/>
+
+    <xsd:annotation>
+        <xsd:documentation>
+            The VM transport is used for intra-VM communication between components managed by Mule. The transport provides options for configuring VM transient or persistent queues.
+        </xsd:documentation>
+        <xsd:appinfo>
+            <schemadoc:short-name>VM</schemadoc:short-name>
+            <schemadoc:page-title>VM Transport</schemadoc:page-title>
+            <schemadoc:transport-features receiveEvents="true" dispatchEvents="true" responseEvents="true"
+                                          requestEvents="true"
+                                          transactions="true" streaming="true">
+                <schemadoc:inboundMEPs in-only="true" in-out="true" in-optional-out="true"/>
+                <schemadoc:outboundMEPs out-only="true" out-in="true" out-optional-in="true"/>
+            </schemadoc:transport-features>
+        </xsd:appinfo>
+    </xsd:annotation>
+    <xsd:element name="connector" type="vmConnectorType" substitutionGroup="mule:abstract-connector"/>
+    <xsd:complexType name="vmConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:connectorType">
+                <xsd:sequence>
+                    <xsd:element name="queueProfile" type="mule:queueProfileType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>DEPRECATED. USE "&lt;queue-profile&gt;" instead.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="queue-profile" type="mule:queueProfileType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Configures the properties of this connector's queue (see [Configuring Queues]).
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="queueEvents" type="mule:substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Determines whether queues should be set up for listeners on the connector. If set to false, the connector simply forwards messsages to components via the Mule server. If it is set to true, the queues are configured using the queuing profile.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="queueTimeout" type="xsd:positiveInteger">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The timeout setting for the queue.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+   </xsd:complexType>
+
+    <xsd:element name="inbound-endpoint" type="inboundEndpointType" substitutionGroup="mule:abstract-inbound-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                The endpoint on which this connector receives messages from the transport.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="inboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:inboundEndpointWithXaType">
+                <xsd:attributeGroup ref="addressAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="outbound-endpoint" type="outboundEndpointType" substitutionGroup="mule:abstract-outbound-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                The endpoint to which this connector sends messages.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="outboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:outboundEndpointWithXaType">
+                <xsd:attributeGroup ref="addressAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="endpoint" type="globalEndpointType" substitutionGroup="mule:abstract-global-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An endpoint "template" that can be used to construct an inbound or outbound endpoint elsewhere in the configuration by referencing the endpoint name.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="globalEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:globalEndpointWithXaType">
+                <xsd:attributeGroup ref="addressAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:attributeGroup name="addressAttributes">
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The queue path, such as {{dispatchInQueue}} to create the address {{vm://dispatchInQueue}}.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:element name="transaction" type="mule:baseTransactionType" substitutionGroup="mule:abstract-transaction">
+        <xsd:annotation>
+            <xsd:documentation>
+                The transaction configuration.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+</xsd:schema>
diff --git a/xml/tests/testData/completion/IDEADEV_32773.xml b/xml/tests/testData/completion/IDEADEV_32773.xml
new file mode 100644
index 0000000..257312e6
--- /dev/null
+++ b/xml/tests/testData/completion/IDEADEV_32773.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mule xmlns="http://www.mulesource.org/schema/mule/core/2.1"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:spring="http://www.springframework.org/schema/beans"
+       xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.1"
+       xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.1"
+       xmlns:jms="http://www.mulesource.org/schema/mule/jms/2.1"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:jee="http://www.springframework.org/schema/jee"
+       xsi:schemaLocation="
+               http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+               http://www.mulesource.org/schema/mule/core/2.1 IDEADEV_32773.xsd
+               http://www.mulesource.org/schema/mule/stdio/2.1 IDEADEV_32773-stdio.xsd
+               http://www.mulesource.org/schema/mule/vm/2.1 IDEADEV_32773-vm.xsd
+               http://www.mulesource.org/schema/mule/jms/2.1 IDEADEV_32773-jms.xsd
+               http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
+               http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">
+
+    <description>
+    </description>
+
+
+
+    <jms:connector name="JMSConnector"
+        jndiInitialFactory="org.jnp.interfaces.NamingContextFactory"
+        connectionFactoryJndiName="ConnectionFactory"
+        jndiProviderUrl="jnp://localhost:1099"
+        specification="1.1"
+        jndiDestinations="true"
+        forceJndiDestinations="true"/>
+
+    <jms:object-to-jmsmessage-transformer name="ObjectToJMSMessage"/>
+    <jms:jmsmessage-to-object-transformer name="JMSMessageToObject"/>
+
+    <!--
+        The Mule model initialises and manages your UMO components
+    -->
+    <model name="helloSample">
+
+        <service name="JMSTest">
+            <inbound>
+                <jms:inbound-endpoint queue="queue/testQueue" transformer-refs="JMSMessageToObject">
+                    <jms:tra<caret>
+                </jms:inbound-endpoint>
+            </inbound>
+
+            <outbound>
+                <pass-through-router>
+                    <stdio:outbound-endpoint system="OUT"/>
+                </pass-through-router>
+            </outbound>
+        </service>
+
+    </model>
+
+</mule>
+
diff --git a/xml/tests/testData/completion/IDEADEV_32773.xsd b/xml/tests/testData/completion/IDEADEV_32773.xsd
new file mode 100644
index 0000000..68a282c
--- /dev/null
+++ b/xml/tests/testData/completion/IDEADEV_32773.xsd
@@ -0,0 +1,4136 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/core/2.1"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:spring="http://www.springframework.org/schema/beans"
+            xmlns:spring-context="http://www.springframework.org/schema/context"
+            targetNamespace="http://www.mulesource.org/schema/mule/core/2.1"
+            attributeFormDefault="unqualified"
+            elementFormDefault="qualified">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+    <xsd:import namespace="http://www.springframework.org/schema/beans"
+                schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"/>
+    <xsd:import namespace="http://www.springframework.org/schema/context"
+                schemaLocation="http://www.springframework.org/schema/context/spring-context-2.5.xsd"/>
+
+    <!--==============================================================-->
+    <!--   Structure                                                  -->
+    <!--==============================================================-->
+
+    <!-- This defines the structure in abstract terms (except for a few simple/unique things like
+         global properties).  We then provide some implementations below.  Other modules
+         can provide other implementations. -->
+
+    <xsd:element name="mule" type="muleType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Either the root element of a Mule configuration, or a "top-level" element in a Spring configuration, that contains further Mule elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="muleType">
+        <xsd:sequence>
+            <xsd:element name="description" type="descriptionType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        This can hold any kind of documentation consistent with the overall XML format). It is intended to be "human readable" only and is not used by the system.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="springRootElements"/>
+                <xsd:group ref="muleRootElements"/>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:group name="springRootElements">
+        <xsd:choice>
+            <xsd:element ref="spring:beans">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Allow embedding of further spring documents.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="spring:bean">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        We support direct use of spring beans via this tag.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="spring-context:property-placeholder">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        We support direct use of property placeholders via this tag.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:group name="muleRootElements">
+        <xsd:choice>
+            <xsd:element name="global-property" type="globalPropertyType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        A global property is a named string. It can be inserted in most attribute values using the #\[...\] syntax. So the attribute value "#\[foo\]" would be replaced by the value associated with the property named "foo".
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="configuration" type="configurationType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Defaults and general settings for the entire Mule system.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="notifications" type="notificationManagerType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Register listeners for notifications and associate interfaces with particular events.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-extension"/>
+            <xsd:element ref="abstract-security-manager"/>
+            <xsd:element ref="abstract-transaction-manager"/>
+            <xsd:element ref="abstract-connector"/>
+            <xsd:element ref="abstract-global-endpoint"/>
+            <xsd:element ref="abstract-transformer"/>
+            <xsd:element ref="abstract-filter"/>
+            <xsd:element ref="abstract-model"/>
+            <xsd:element ref="abstract-interceptor-stack"/>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:complexType name="descriptionType">
+        <xsd:complexContent mixed="true">
+            <xsd:extension base="xsd:anyType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-extension" abstract="true" type="abstractExtensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for arbitrary extensions as children of the mule element. Other transports and modules may extend this if they need to add global elements to the configuration (but consider the more specific elements like abstract-connector first).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractExtensionType"/>
+
+    <xsd:element name="abstract-connector" abstract="true" type="abstractConnectorType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for connector elements. Connector elements allow properties to be configured across all endpoints that use the same transport. If multiple connectors are defined for the same transport then each endpoint must name which connector is being used.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractConnectorType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the connector so that other elements can reference it.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-global-endpoint" abstract="true" type="abstractGlobalEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for global endpoint elements. Global endpoints are named templates that allow us to define an endpoint once and refer to it in several places. Currently the same template is used for both inbound and outbound endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractGlobalEndpointType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the endpoint so that other elements can reference it. This name can also be referenced in MuleClient.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-inbound-endpoint" abstract="true" type="abstractInboundEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for inbound endpoint elements. Inbound endpoints receive messages from the underlying transport. The message payload is then delivered to the component for processing.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInboundEndpointType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the inbound endpoint in the registry, but is of relatively little use - it cannot be referred to from MuleClient, for example. For more useful aliases, use global endpoints.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-outbound-endpoint" abstract="true" type="abstractOutboundEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for outbound endpoint elements. Outbound endpoints dispatch messages to the underlying transport.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractOutboundEndpointType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the outbound endpoint in the registry, but is of relatively little use - it cannot be referred to from MuleClient, for example. For more useful aliases, use global endpoints.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-transformer" abstract="true" type="abstractTransformerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transformer elements. Transformers convert message payloads.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransformerType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the transformer so that other elements can reference it. Required if the transformer is defined at the global level.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="returnClass" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class of the message generated by the transformer. This is used if transformers are auto-selected (which is somewhat incomplete at the moment).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="ignoreBadInput" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Many transformers only accept certain classes. Such transformers are never called with inappropriate input (whatever the value of this attribute). If a transformer forms part of a chain and cannot accept the current message class, then this flag controls whether the remaining part of the chain is evaluated. If true, the next transformer is called. If false the chain ends, keeping the result generated up to that point.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="globalPropertyType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the property. This is used inside #[...].
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="value" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The value of the property. This replaces each occurence of #[...].
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- seemed pointless making these simple container types abstract -->
+    <xsd:complexType name="inboundCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-inbound-router" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-catch-all-strategy" minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:attribute name="matchAll" type="substitutableBoolean" default="true">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, the input message will be passed through inbound routers, otherwise only the first matching router is used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-catch-all-strategy" abstract="true" type="abstractCatchAllStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for catch-all strategy elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractCatchAllStrategyType"/>
+
+    <xsd:element name="abstract-inbound-router" abstract="true" type="abstractInboundRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for inbound router elements. Inbound routers control how incoming messages are handled.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInboundRouterType"/>
+
+    <xsd:element name="abstract-filter" abstract="true" type="abstractFilterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for filter elements. Filters are used to make decisions within the Mule framework.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractFilterType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the filter so that other elements can reference it. Required if the filter is defined at the global level.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="not" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Inverts the filter condition.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="outboundCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-outbound-router" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-catch-all-strategy" minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:attribute name="matchAll" type="substitutableBoolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, the output message will be sent to all routers, otherwise only the first matching router is used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-outbound-router" abstract="true" type="abstractOutboundRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for outbound router elements. Outbound routers control how outgoing messages are delivered to the outbound endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractOutboundRouterType"/>
+
+    <xsd:element name="abstract-transaction-manager" abstract="true" type="abstractTransactionManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transaction manager elements. Transaction managers are used to co-ordinate transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransactionManagerType"/>
+
+    <xsd:complexType name="configurationType">
+        <xsd:sequence>
+            <xsd:element name="default-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default threading profile, used by components and by endpoints for dispatching and receiving if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-dispatcher-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default dispatching threading profile, modifies the default-threading-profile values and is used by endpoints for dispatching if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-receiver-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default receiving threading profile, modifies the default-threading-profile values and is used by endpoints for receiving if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-service-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default service threading profile, modifies the default-threading-profile values and is used if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-retry-policy" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default retry policy, used by connectors and endpoints if no more specific policy is configured for them.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="defaultSynchronousEndpoints" type="substitutableBoolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true then connections to endpoints will wait for a response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="defaultRemoteSync" type="substitutableBoolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true then connections to endpoints will wait for a response from the remote service.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="defaultSynchronousEventTimeout" type="xsd:string" default="3000">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The default period (ms) to wait for a synchronous response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="defaultTransactionTimeout" type="xsd:string" default="5000">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The default timeout for transactions, used if no more specific configuration is given.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="notificationManagerType">
+        <xsd:sequence>
+            <xsd:element name="notification" type="defineNotificationType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Associate an event with an interface. Listeners which implement the interface will receive instances of the event.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="disable-notification" type="disableNotificationType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Block the association of an event with a particular interface. This filters events after the association with a particular interface (and so takes precedence).
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="notification-listener" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Register a bean as a listener with the notification system. Events are dispatched by reflection - the listener will receive all events associated with any interfaces it implements. The relationship between interfaces and events is configured by the notification and disable-notification elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                    <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The bean that will receive notifications.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="subscription" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                An optional string that is compared with the event resource identifier. Only events with matching identifiers will be sent. If no value is given, all events are sent.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="dynamic" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If the notification manager is dynamic then programatic updates to the manager (ie via Java code) will affect all messages. Otherwise, some parts of the system may cache state for efficiency and so not generate newly enabled notifications. The default value is false.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="defineNotificationType">
+        <xsd:attribute name="event-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class associated with a notification event that will be delivered to the interface. This can be used instead of the event attribute to specify a custom class.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="event" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The notification event to deliver.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface (class name) that will receive the notification event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface that will receive the notification event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="disableNotificationType">
+        <xsd:attribute name="event-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class associated with an event that will no longer be delivered to any interface. This can be used instead of the event attribute to specify a custom class.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="event" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The event to not deliver.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface (class name) that will no longer receive an event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface that will no longer receive an event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+
+    <xsd:simpleType name="notificationTypes">
+        <xsd:restriction base="xsd:NMTOKEN">
+            <xsd:enumeration value="CONTEXT"/>
+            <xsd:enumeration value="MODEL"/>
+            <xsd:enumeration value="SERVICE"/>
+            <xsd:enumeration value="SECURITY"/>
+            <xsd:enumeration value="ENDPOINT-MESSAGE"/>
+            <xsd:enumeration value="COMPONENT-MESSAGE"/>
+            <xsd:enumeration value="MANAGEMENT"/>
+            <xsd:enumeration value="CONNECTION"/>
+            <xsd:enumeration value="REGISTRY"/>
+            <xsd:enumeration value="CUSTOM"/>
+            <xsd:enumeration value="EXCEPTION"/>
+            <xsd:enumeration value="TRANSACTION"/>
+            <xsd:enumeration value="ROUTING"/>
+            <!-- DEPRECATED -->
+            <xsd:enumeration value="MESSAGE"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <!--==============================================================-->
+    <!-- Models                                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-model" abstract="true" type="abstractModelType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for model elements. A model provides basic settings and processing for all the services it contains.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractModelType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-exception-strategy" minOccurs="0"/>
+            <xsd:group ref="entryPointResolvers"/>
+            <xsd:element ref="abstract-service" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="name" type="nonBlankString">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name used to identify this model.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="seda-model" type="sedaModelType" substitutionGroup="abstract-model">
+        <xsd:annotation>
+            <xsd:documentation>
+                A SEDA (Staged Event Drivern Architecture) model has separate threads and queues for each component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="sedaModelType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractModelType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-queue-profile" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="inherit" type="xsd:boolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If true then this model element is an extension of a previous model element with the same name.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="model" type="defaultModelType" substitutionGroup="abstract-model">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default model is a SEDA model.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="defaultModelType">
+        <xsd:complexContent>
+            <xsd:extension base="sedaModelType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Model elements -->
+
+    <xsd:element name="abstract-queue-profile" abstract="true" type="abstractQueueProfileType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for queue profile elements. A queue profile controls how messages are queued before being processed.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractQueueProfileType"/>
+
+    <!-- to give a cleaner config we allow either a set or an individual entry (but not both).-->
+    <xsd:group name="entryPointResolvers">
+        <xsd:choice>
+            <xsd:element ref="abstract-entry-point-resolver-set" minOccurs="0"/>
+            <!-- we could allow many of these, but it looks ugly -->
+            <xsd:element ref="abstract-entry-point-resolver" minOccurs="0"/>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:element name="abstract-entry-point-resolver-set" abstract="true" type="abstractEntryPointResolverSetType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for entry point resolver set elements. These combine a group of entry point resolvers, trying them in turn until one succeeds.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractEntryPointResolverSetType"/>
+
+    <xsd:element name="legacy-entry-point-resolver-set" type="extensibleEntryPointResolverSet"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                An extensible set of entry point resolvers (which determine how a message is passed to a component in Java) that already contains resolvers to implement the standard logic. This is already provided by default and is only needed explicitly if it will be extended with other entry point resolvers. This element can be set on the model or component; the model value provides a default which individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="entry-point-resolver-set" type="extensibleEntryPointResolverSet"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                An extensible set of entry point resolvers. These determine how a message is passed to a component in Java. Each entry point resolver is tried in turn until one succeeds in delivering the messge to the component. This element can be set on the model or component; the model value provides a default which individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="extensibleEntryPointResolverSet">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverSetType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-entry-point-resolver" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-entry-point-resolver-set" type="customEntryPointResolverSetType"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom entry point resolver set. This allows user-supplied code to determine how a message is passed to a component in Java. This element can be set on the model or component; the model value provides a default which individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customEntryPointResolverSetType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverSetType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the EntryPointResolverSet interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-entry-point-resolver" abstract="true" type="abstractEntryPointResolverType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an entry point resolver element. Entry point resolvers define how payloads are delivered to Java code by choosing the method to call.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="callable-entry-point-resolver" type="abstractEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                An entry point resolver for components that implement the Callable interface. This passes a MuleEventContext to the component. This element can be set on the model or component; the model value provides a default which individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractEntryPointResolverType"/>
+
+    <xsd:element name="custom-entry-point-resolver" type="customEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom entry point resolver. This allows user-supplied code to determine how a message is passed to a component in Java. This element can be set on the model or component; the model value provides a default which individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the EntryPointResolver interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverType">
+                <xsd:attribute name="transformFirst" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether the message should be transformed before being delivered to the component. By default, messages are transformed.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="acceptVoidMethods" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether the resolver should call void methods. By default, void methods are not considered as possible candidates for message delivery.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="property-entry-point-resolver" type="propertyEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Use a message property to select the component method to be called. This element can be set on the model or component; the model value provides a default which individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="propertyEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:attribute name="property" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the message property used to select a method on the component.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="method-entry-point-resolver" type="methodEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Deliver the message to a named method. This element can be set on the model or component; the model value provides a default which individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="methodEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="include-entry-point" minOccurs="1" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="reflection-entry-point-resolver" type="reflectionEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Generate a list of candidate methods from the component via reflections. This element can be set on the model or component; the model value provides a default which individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="reflectionEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element name="exclude-object-methods" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                If specified, methods in the Java Object interface are not included in the list of possible methods that can receive the message.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="exclude-entry-point" type="methodType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Explicitly exclude a named method from receiving the message.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="array-entry-point-resolver" type="complexEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Deliver the message to a method which takes a single array as argument. This element can be set on the model or component; the model value provides a default which individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="no-arguments-entry-point-resolver" type="complexEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Call a method without arguments (the message is not passed to the component).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="complexEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="reflectionEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="include-entry-point" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="enableDiscovery" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="include-entry-point" type="methodType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A possible method for delivery.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="methodType">
+        <xsd:attribute name="method" type="nonBlankString">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the method.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--  Services                                                    -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-service" abstract="true" type="abstractServiceType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a service element. Services combine message routing with a Java (typically) component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractServiceType">
+        <xsd:attribute name="name" type="nonBlankString" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name used to identify this service.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseServiceType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Base support for a model-based wrapper around the POJO service (SEDA, Streaming, etc.)
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractServiceType">
+                <xsd:sequence>
+                    <xsd:element name="description" type="descriptionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                This can hold any kind of documentation consistent with the overall XML format). It is intended to be "human readable" only and is not used by the system.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="inbound" type="inboundCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within "inbound" describe how a service receives messages.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <!-- minOccurs="0" to allow for <forwarding-router/> and/or default component -->
+                    <xsd:element ref="abstract-component" minOccurs="0"/>
+                    <xsd:element name="outbound" type="outboundCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within "outbound" describe how a services sends or dispatches messages.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="async-reply" type="asyncReplyCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within "async-reply" describe how asynchronous replies are handled.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element ref="abstract-exception-strategy" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="initialState" default="started">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The initial state of the service. Usually a service is started automatically, but this attribute can block any initial startup ("stopped") or stop the service immediately after initial startup ("paused").
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="started"/>
+                            <xsd:enumeration value="stopped"/>
+                            <xsd:enumeration value="paused"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-exception-strategy" abstract="true" type="abstractExceptionStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an exception strategy element. Exception strategies define how Mule should react to errors.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="abstractExceptionStrategyType">
+        <xsd:sequence>
+            <xsd:element name="commit-transaction" type="exceptionPatternType" maxOccurs="1" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Defines when a current transaction gets rolled-back depending on the name of the exception caught. Users can set a comma delimited list of wildcard patterns that wil be matched angainst the fully qualified classname of the current exception. Patterns defined for this element will leave the current transaction (if any) untouched and llow it to be committed.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="rollback-transaction" type="exceptionPatternType" maxOccurs="1" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Defines when a current transaction gets rolled-back depending on the name of the exception caught. Users can set a comma delimited list of wildcard patterns that wil be matched angainst the fully qualified classname of the current exception. Patterns defined for this element will rollback the current transaction (if any).
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="enableNotifications" type="xsd:boolean">
+            <xsd:annotation>
+                <xsd:documentation>Determines whether ExceptionNotifications wil be fired from this strategy when an exception occurs.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="exceptionPatternType">
+        <xsd:attribute name="exception-pattern" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>A comma-separate list of wildcard expressions that will be matched against the fully qualified cassname of the current exception received by the ExceptionStrategy.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-retry-policy" abstract="true" type="abstractRetryPolicyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a retry policy element. Retry policies define how Mule should retry a failed message send/dispatch/request.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractRetryPolicyType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-retry-notifier" minOccurs="0" maxOccurs="1"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-retry-notifier" abstract="true" type="abstractRetryNotifierType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a retry notifier element. The RetryNotifier interface is a callback that allows actions to be performed after each retry. For example, when retrying connections Mule will fire server notification events on success or failure.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractRetryNotifierType"/>
+
+    <xsd:complexType name="asyncReplyCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-inbound-endpoint" minOccurs="1" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-async-reply-router" minOccurs="0" maxOccurs="1"/>
+            <!-- TODO leaving this commented here, but I do not think there should be a transformer here -->
+            <!--<xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>-->
+        </xsd:sequence>
+        <xsd:attribute name="timeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The timeout (ms) to wait for a reply.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="failOnTimeout" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If the router times out before all expected events have been received should an exception be thrown or should the current events be returned for processing. The default is false.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-async-reply-router" abstract="true" type="abstractAsyncReplyRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an async reply router element. Asynchronous replies are handled via this router.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractAsyncReplyRouterType"/>
+
+    <xsd:element name="service" type="sedaServiceType" substitutionGroup="abstract-service">
+        <xsd:annotation>
+            <xsd:documentation>
+                The standard SEDA service. A service describes how to receive messages, deliver them to a component, and handle the results (if any).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="sedaServiceType">
+        <xsd:complexContent>
+            <xsd:extension base="baseServiceType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-service-threading-profile" minOccurs="0"/>
+                    <xsd:element ref="abstract-queue-profile" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="queueTimeout" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The timeout used when taking messages from the SEDA queue.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-service" type="customServiceType" substitutionGroup="abstract-service">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemeted service (typically used only in testing).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customServiceType">
+        <xsd:complexContent>
+            <xsd:extension base="baseServiceType">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The class to use for the service.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-service-threading-profile" abstract="true"
+                 type="abstractServiceThreadingProfileType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for service threading profile element. Threading profiles define how thread pools interact with the component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractServiceThreadingProfileType"/>
+
+    <!--==============================================================-->
+    <!-- Components                                              -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-component" abstract="true" type="abstractComponentType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for component element. A component processes data. Typically it is a Java object.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractComponentType">
+        <xsd:group ref="interceptorGroup" minOccurs="0"/>
+    </xsd:complexType>
+
+    <xsd:element name="component" type="defaultJavaComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                A simple POJO (Plain Old Java Object) component that will be invoked by Mule when a message is received. The instance can be specified via a factory, or via a class.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="defaultJavaComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractComponentType">
+                <xsd:sequence>
+                    <xsd:group ref="entryPointResolvers"/>
+                    <xsd:element ref="abstract-object-factory" minOccurs="0"/>
+                    <xsd:element ref="abstract-lifecycle-adapter-factory" minOccurs="0"/>
+                    <xsd:element name="binding" type="pojoBindingType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                A binding associates a Mule endpoint with an injected Java interface. This is like using Spring to inject a bean, but instead of calling a method on the bean a message is sent to an endpoint.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Specify a component class. This is a shortcut that is equivalent to providing a prototype-object element.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="pooled-component" type="pooledJavaComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                A pooled POJO (Plain Old Java Object) component that will be invoked by Mule when a message is received. The instance can be specified via a factory, or via a class.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="pooledJavaComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="defaultJavaComponentType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-pooling-profile" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Characteristics of the object pool</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <xsd:complexType name="pojoBindingType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-outbound-endpoint" minOccurs="1" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="interface" use="required" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface to be injected. A proxy will be created that implements this interface by calling out to the endpoint.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="method" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The method on the interface that should be used. This can be omitted if the interface has a single method.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="defaultComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractComponentType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="bridge-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                This transfers a message from inbound to outbound endpoints. This name is provided for backwards compatability - it is equivalent to not specifying any component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!-- don't expose this, it's not needed -->
+    <!-- xsd:element name="pass-through-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default, "do nothing" component.
+                The message is simply transferred from inbound to outbound endpoints.
+                This is the default and need not be specified.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element -->
+
+    <xsd:element name="echo-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                This logs the message and returns the payload back as the result.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="log-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                This logs the message content (or content length if it is a large message).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="null-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                This will throw an exception if it receives a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+
+    <!--==============================================================-->
+    <!--   Transactions                                               -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-transaction" abstract="true" type="abstractTransactionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transaction elements. Transactions allow a series of operations to be grouped together.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="abstract-xa-transaction" abstract="true" type="abstractTransactionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for XA transaction elements. XA Transactions allow a series of operations to be grouped together spanning different transports, e.g. JMS and JDBC.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransactionType">
+        <xsd:attribute name="action">
+            <xsd:annotation>
+                <xsd:documentation>
+                    NONE - Never participate in a transaction;
+                    ALWAYS_BEGIN - Always start a new transaction when receiving an event. An exception will be thrown
+                    if a transaction already exists;
+                    BEGIN_OR_JOIN - If a transaction is already in progress when an event is received, join the
+                    transaction, otherwise start a new transaction;
+                    ALWAYS_JOIN - Always expects a transaction to be in progress when an event is received, if there is
+                    no transaction an exception is thrown;
+                    JOIN_IF_POSSIBLE - Will join the current transaction if one is available otherwise no transaction is
+                    created.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="NONE"/>
+                    <xsd:enumeration value="ALWAYS_BEGIN"/>
+                    <xsd:enumeration value="BEGIN_OR_JOIN"/>
+                    <xsd:enumeration value="ALWAYS_JOIN"/>
+                    <xsd:enumeration value="JOIN_IF_POSSIBLE"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="timeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Timeout for transaction (ms).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseTransactionType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-transaction" type="customTransactionType" substitutionGroup="abstract-transaction">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allow access to user-defined or otherwise unsupported third-party transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransactionType">
+        <xsd:complexContent>
+            <xsd:extension base="baseTransactionType">
+                <xsd:attribute name="factory-class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the TransactionFactory interface that will be instantiated and used to generate a transaction. This attribute and the "factory-ref" attribute are mutually exclusive; one of the two is required.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="factory-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A bean that implements the TransactionFactory interface that will be used to generate a transaction. This attribute and the "factory-class" attribute are mutually exclusive; one of the two is required.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="xa-transaction" type="xaTransactionType" substitutionGroup="abstract-transaction">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allow access to XA transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="xaTransactionType">
+        <xsd:complexContent>
+            <xsd:extension base="baseTransactionType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="transactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionManagerType">
+                <xsd:attribute name="name" type="substitutableName" default="transactionManager" use="optional">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An optional name for the transaction manager. The default value is "transactionManager".
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="websphere-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The WebSphere transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="jboss-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The JBoss transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="jndiTransactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionManagerType">
+                <xsd:sequence>
+                    <xsd:element name="environment" type="mapType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The JNDI environment.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="weblogic-transaction-manager" type="jndiTransactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The WebLogic transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="jrun-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The JRun transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="resin-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The Resin transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="jndi-transaction-manager" substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                Retrieve a named transaction manager factory from JNDI.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="jndiTransactionManagerType">
+                    <xsd:attribute name="jndiName" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The name of the manager factory to retrieve (eg java:/TransactionManager).
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="custom-transaction-manager" type="customTransactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="jndiTransactionManagerType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The class to instantiate to create a transaction manager.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--   Endpoint elements                                          -->
+    <!--==============================================================-->
+
+    <xsd:element name="endpoint" type="globalEndpointType" substitutionGroup="abstract-global-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An endpoint "template" that can be used to construct an inbound or outbound endpoint elsewhere in the configuration by referencing the endpoint name. Each transport implements its own endpoint element, with a more friendly syntax, but this generic element can be used with any transport by supplying the correct address URI. For example, "vm://foo" describes a VM transport endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="globalEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractGlobalEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- extend this type for endpoints that support XA transactions -->
+    <xsd:complexType name="globalEndpointWithXaType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractGlobalEndpointType">
+                <xsd:group ref="defaultXaEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="inbound-endpoint" type="inboundEndpointType" substitutionGroup="abstract-inbound-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An inbound endpoint receives messages from the associated transport. Each transport implements its own inbound endpoint element, with a more friendly syntax, but this generic element can be used with any transport by supplying the correct address URI. For example, "vm://foo" describes a VM transport endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="inboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInboundEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- extend this type for endpoints that support XA transactions -->
+    <xsd:complexType name="inboundEndpointWithXaType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInboundEndpointType">
+                <xsd:group ref="defaultXaEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="outbound-endpoint" type="outboundEndpointType" substitutionGroup="abstract-outbound-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An outbound endpoint sends messages to the associated transport. Each transport implements its own outbound endpoint element, with a more friendly syntax, but this generic element can be used with any transport by supplying the correct address URI. For example, "vm://foo" describes a VM transport endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="outboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:complexType name="outboundEndpointWithXaType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundEndpointType">
+                <xsd:group ref="defaultXaEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- these include option/repeats - should be embedded once -->
+    <xsd:group name="defaultEndpointElements">
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="endpointTransformers"/>
+                <xsd:element ref="abstract-transaction" minOccurs="0"/>
+                <xsd:element ref="abstract-filter" minOccurs="0"/>
+                <xsd:element ref="abstract-security-filter" minOccurs="0"/>
+                <xsd:element ref="abstract-retry-policy" minOccurs="0"/>
+                <xsd:group ref="propertiesGroup"/>
+            </xsd:sequence>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:group name="defaultXaEndpointElements">
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="endpointTransformers"/>
+                <xsd:element ref="abstract-transaction" minOccurs="0"/>
+                <xsd:element ref="abstract-xa-transaction" minOccurs="0"/>
+                <xsd:element ref="abstract-filter" minOccurs="0"/>
+                <xsd:element ref="abstract-security-filter" minOccurs="0"/>
+                <xsd:group ref="propertiesGroup"/>
+            </xsd:sequence>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:element name="abstract-security-filter" abstract="true" type="abstractSecurityFilterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for security filter elements. Security filters can control access to the system, etc.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractSecurityFilterType"/>
+
+    <xsd:attributeGroup name="defaultEndpointAttributes">
+        <xsd:attributeGroup ref="restrictedEndpointAttributes"/>
+        <!-- these next two attributes are mutually exclusive and one is required.
+             but there is no way to define this in a schema... -->
+        <!-- endpoint references - dynamically checked to make sure not top level -->
+        <xsd:attribute name="ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A reference to a global endpoint. If this attribute is used then the endpoint is used as a template to construct this endpoint. A template fixes the address (protocol, path, host, etc.), and may specify initial values for various properties, but further properties can be defined locally (as long as they do not change the address in any way).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <!-- explicit or global endpoints -->
+        <xsd:attribute name="address" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The generic address for this endpoint. If this attribute is used, the protocol must be specified as part of the URI. Alternatively, most transports provide their own attributes for specifying the address (path, host, etc.). Note that the address attribute cannot be combined with "ref" or with the transport-provided alternative attributes.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:attributeGroup name="restrictedEndpointAttributes">
+        <xsd:attribute name="synchronous" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, the result from the component processing the incoming message will be returned as a response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="remoteSync" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, the component will wait for a response to the outgoing message before replying to the incoming message.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="remoteSyncTimeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The timeout for the remoteSync wait (ms).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="encoding" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    String encoding used for messages.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="connector-ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the connector associated with this endpoint. This must be specified if more than one connector is defined for this transport.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A list of the transformers that will be applied to the message in order before it is delivered to the component.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="responseTransformer-refs" type="xsd:NMTOKENS">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A list of the transformers that will be applied to the synchronous response in order before it is returned via the transport.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:complexType name="endpointRefType">
+        <xsd:attribute name="address" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The destination address for a reply message.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The reference name of a global endpoint to use. If this EndpointRef will be associated to a message such as a Reply-To address, this endpoint ref has to be available on the remote Mule instance that reads the Reply-To address.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:group name="endpointTransformers">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows the user to specify either a simple list of (normal) transformers or separate bracketed lists of normal and response transformers.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:choice>
+            <xsd:group ref="transformersList"/>
+            <xsd:sequence>
+                <xsd:element name="transformers" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A list of transformer elements that will be applied to the message before it is delivered to the component. Note that a list of transformers can also be specified directly (without the "transformers" element), but then it is not possible to also specify response transformers (using the "response-transformers" element).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:complexType>
+                        <xsd:group ref="transformersList"/>
+                    </xsd:complexType>
+                </xsd:element>
+                <xsd:element name="response-transformers" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A list of transformer elements that will be applied to the response message returned from the component.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:complexType>
+                        <xsd:group ref="transformersList"/>
+                    </xsd:complexType>
+                </xsd:element>
+            </xsd:sequence>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:group name="transformersList">
+        <xsd:annotation>
+            <xsd:documentation>
+                A list of transformers - normal or response, depending on context.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!--==============================================================-->
+    <!--   Filter elements                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="filter" type="refFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that is defined elsewhere (at the global level, or as a Spring bean).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="refFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the filter to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="not-filter" type="unitaryFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Invert the enclosed filter (so if it returns true for some message, this will return false, and vice-versa).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="unitaryFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="and-filter" type="collectionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Return true only if all the enclosed filters return true.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="or-filter" type="collectionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Return true if any of the enclosed filters returns true.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="collectionFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter" minOccurs="2" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="wildcard-filter" type="wildcardFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches string messages against wildcards. It performs matches with "*", for example, "jms.events.*" would catch "jms.events.customer" and "jms.events.receipts". This filter accepts a comma-separated list of patterns, so more than one filter pattern can be matched for a given argument: "jms.events.*, jms.actions.*" will match "jms.events.system" and "jms.actions" but not "jms.queue".
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="wildcardFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="caseSensitivePatternFilterType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="expression-filter" type="expressionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that can evaluate a range of expressions. It supports some base expression types such as header, payload (payload type), regex, and wildcard.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="expressionFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="evaluator" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>The expression evaluator to use. The expression filter supports some types such as header, payload, exception, wildcard and regex, that are in-built filters not registered with the ExpressionEvaluatorManager. All others are registered with the ExpressionEvaluatorManager. Where XPath, bean, and ONGL are used, the expression should be a boolean expression.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="substitutableName">
+                            <xsd:enumeration value="header"/>
+                            <xsd:enumeration value="payload-type"/>
+                            <xsd:enumeration value="exception-type"/>
+                            <xsd:enumeration value="wildcard"/>
+                            <xsd:enumeration value="regex"/>
+                            <xsd:enumeration value="ognl"/>
+                            <xsd:enumeration value="xpath"/>
+                            <xsd:enumeration value="jxpath"/>
+                            <xsd:enumeration value="groovy"/>
+                            <xsd:enumeration value="bean"/>
+                            <xsd:enumeration value="custom"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="expression" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>The expression that will be evaluated. This should always be a boolean expression. The syntax of the expression will be determined by the expression language being used.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="customEvaluator" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>Must be set if the evaluator is set to custom. The custom evaluator must be registered with the ExpressionEvaluatorManager if it is to be used here.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="nullReturnsTrue" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>Whether the filter should return true if the specified expression returns null.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <xsd:element name="regex-filter" type="patternFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches string messages against a regular expression. The Java regular expression engine (java.util.regex.Pattern) is used.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="patternFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="pattern" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The property name and possibly value to use when matching. If the expression is just a property name, the filter will check that the property exists. Users can also uses '=' and '!=' to determine a specific value for a property.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-property-filter" type="caseSensitivePatternFilterType"
+                 substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches properties on a message. This can be very useful as the message properties represent all the meta information about the message from the underlying transport, so for a message received over HTTP, you can check for HTTP headers and so forth. The pattern should be expressed as a key/value pair, such as "propertyName=value". If you want to compare more than one property, you can use the logic filters for And, Or, and Not expressions. By default the comparison is case sensitive, which you can override with the caseSensitive property.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="caseSensitivePatternFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="patternFilterType">
+                <xsd:attribute name="caseSensitive" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If false, the comparison ignores case.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="exception-type-filter" type="typeFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches the type of an exception.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="payload-type-filter" type="typeFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches the type of the payload.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="typeFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="expectedType" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The expected class used in the comparison.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-filter" type="customFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented filter.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the Filter interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   Interceptor elements                                       -->
+    <!--==============================================================-->
+    <xsd:element name="abstract-interceptor-stack" abstract="true" type="abstractInterceptorStackType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for interceptor stack elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInterceptorStackType">
+        <xsd:sequence maxOccurs="unbounded">
+            <xsd:element ref="abstract-interceptor"/>
+        </xsd:sequence>
+        <xsd:attribute name="name" type="nonBlankString" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name used to identify this interceptor stack.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:element name="interceptor-stack" type="abstractInterceptorStackType" substitutionGroup="abstract-interceptor-stack"/>
+
+
+    <xsd:element name="abstract-interceptor" abstract="true" type="abstractInterceptorType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an interceptor element.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInterceptorType"/>
+
+    <xsd:group name="interceptorGroup">
+        <xsd:sequence>
+            <xsd:choice maxOccurs="unbounded">
+                <xsd:element ref="abstract-interceptor"/>
+                <xsd:element name="interceptor-stack" type="refInterceptorStackType"/>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:complexType name="refInterceptorStackType">
+        <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the interceptor stack to use.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="timer-interceptor" type="abstractInterceptorType" substitutionGroup="abstract-interceptor">
+        <xsd:annotation>
+            <xsd:documentation>
+                The timer interceptor (ported from 1.x).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="logging-interceptor" type="abstractInterceptorType" substitutionGroup="abstract-interceptor">
+        <xsd:annotation>
+            <xsd:documentation>
+                The logging interceptor (ported from 1.x).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="custom-interceptor" type="customInterceptorType" substitutionGroup="abstract-interceptor">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented interceptor.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customInterceptorType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInterceptorType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the Interceptor interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- security filters -->
+
+    <xsd:element name="encryption-security-filter" type="encryptionSecurityFilterType"
+                 substitutionGroup="abstract-security-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that provides password-based encyption.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="encryptionSecurityFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractSecurityFilterType">
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the encryption strategy to use. This should be configured using the password-encryption-strategy element, inside a security-manager element at the top level.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--   Transformer elements                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="transformer" type="refTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A reference to a transformer defined elsewhere.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="refTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the transformer to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="auto-transformer" type="abstractTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that uses the transform discovery mechanism to convert the message payload. This transformer works much better when transforming custom object types rather than Java types, because there is less chance for ambiguity.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="custom-transformer" type="customTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented transformer.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the Transformer interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-properties-transformer" type="messagePropertiesTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that can add or delete message properties.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="messagePropertiesTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:choice minOccurs="1" maxOccurs="unbounded">
+                    <xsd:element name="delete-message-property" type="keyType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Delete a message property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="add-message-property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Add a message property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="rename-message-property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Rename a message property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="add-message-properties" type="mapType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Add a set of message properties.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:choice>
+                <xsd:attribute name="overwrite" type="substitutableBoolean" use="optional" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If false, a property is not added if the message already contains a property with that name.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="no-action-transformer" type="abstractTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that has no effect.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="base64-encoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that base64 encodes a string or byte array message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="base64-decoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that base64 decodes a message to give an array of bytes.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="xml-entity-encoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that encodes a string using XML entities.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="xml-entity-decoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that decodes a string containing XML entities.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="gzip-compress-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that compresses a byte array using gzip.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="gzip-uncompress-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that uncompresses a byte array using gzip.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-hex-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to a string of hexadecimal digits.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="hex-string-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a string of hexadecimal digits to a byte array.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-object-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to an object (either deserializing or converting to a string).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="object-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that serializes all objects except strings (which are converted using getBytes()).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="object-to-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that gives a human-readable description of various types (useful for debugging).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-serializable-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to an object (deserializing the object).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="serializable-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts an object to a byte array (serializing the object).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to a string.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="string-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a string to a byte array.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="append-string-transformer" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that appends a string to a string payload.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="abstractTransformerType">
+                    <xsd:attribute name="message" type="xsd:string" use="required">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The string to append.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="encrypt-transformer" type="encryptionTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that encrypts a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="decrypt-transformer" type="encryptionTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that decrypts a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="encryptionTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the encryption strategy to use. This should be configured using the password-encryption-strategy element, inside a security-manager element at the top level.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="expression-transformer" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that evaluates one or more expressions on the current event. Each expression equates to a parameter in the return message. The return message for two or more expressions will be an Object[].
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="abstractTransformerType">
+                    <xsd:sequence minOccurs="1" maxOccurs="unbounded">
+                        <xsd:element name="return-argument">
+                            <xsd:complexType>
+                                <xsd:attributeGroup ref="expressionAttributes"/>
+                                <xsd:attribute name="optional" type="substitutableBoolean" use="optional">
+                                    <xsd:annotation>
+                                        <xsd:documentation>If the expression evaluates to null, whether to continue to the next expression without error.
+                                        </xsd:documentation>
+                                    </xsd:annotation>
+                                </xsd:attribute>
+                            </xsd:complexType>
+                        </xsd:element>
+                    </xsd:sequence>
+                    <xsd:attribute name="returnSourceIfNull" type="xsd:boolean" use="optional">
+                        <xsd:annotation>
+                            <xsd:documentation>If all expressions return null on this transformer, this flag will cause the source payload to be returned without modification.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:attributeGroup name="expressionAttributes">
+        <xsd:attribute name="evaluator" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The expression evaluator to use. Expression Evaluators must be registered with the ExpressionEvaluatrManager before thay can be used. Using the custom evaluator allows the developer to define their own in the 'custom-evaluator' attribute. Note that some evaluators such as xpath, groovy, and bean are loaded from other Mule modules (XML and Scripting, respectively). These modules must be on your classpath before the evaluator can be used.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="substitutableName">
+                    <xsd:enumeration value="groovy"/>
+                    <xsd:enumeration value="header"/>
+                    <xsd:enumeration value="headers"/>
+                    <xsd:enumeration value="headers-list"/>
+                    <xsd:enumeration value="attachment"/>
+                    <xsd:enumeration value="attachments"/>
+                    <xsd:enumeration value="attachments-list"/>
+                    <xsd:enumeration value="message"/>
+                    <xsd:enumeration value="map-payload"/>
+                    <xsd:enumeration value="payload"/>
+                    <xsd:enumeration value="xpath"/>
+                    <xsd:enumeration value="jxpath"/>
+                    <xsd:enumeration value="bean"/>
+                    <xsd:enumeration value="ognl"/>
+                    <xsd:enumeration value="function"/>
+                    <xsd:enumeration value="custom"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="expression" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The expression to evaluate. The syntax of this attribute will change depending on the evaluator being used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="custom-evaluator" type="substitutableName" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>The name of the custom evaluator to use. This attribute is only used when the evaluator attribute is set to custom. You can plug in your own expression evaluators by registering them with the ExpressionEvaluatorManager.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <!--==============================================================-->
+    <!--   Shared elements                                             -->
+    <!--==============================================================-->
+
+    <xsd:element name="queue-profile" type="queueProfileType" substitutionGroup="abstract-queue-profile">
+        <xsd:annotation>
+            <xsd:documentation>
+                Specifies the properties of an internal Mule queue. Internal queues are used to queue messages for each component managed by Mule.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="queueProfileType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractQueueProfileType">
+                <xsd:attribute name="maxOutstandingMessages" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Defines the maximum number of messages that can be queued.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="persistent" type="substitutableBoolean" default="false">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether Mule messages are persisted to a store. Primarily, this is used for persisting queued messages to disk so that the internal state of the server is mirrored on disk in case the server fails and needs to be restarted. Default is false.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-security-manager" type="abstractSecurityManagerType" abstract="true">
+        <xsd:annotation>
+            <xsd:documentation>
+                A security manager is a container for security providers. More than one security manager may be configured; each contains providers from a particular module and has that module type. This element is abstract - a security-related module or transport will provide a suitable implementation.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="abstractSecurityManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                An empty holder that can be extended by modules that want to provide security managers. Typically it will contain elements called module:type-security-provider, which extend securityProviderType where "module" might be "acegi" and "type" might de "delegate", for example. It can also contain encryption strategies, which should follow a similar scheme and extend encryptionStrategyType.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="id" fixed="_muleSecurityManager"/>
+        <xsd:attribute name="name" fixed="_muleSecurityManager"/>
+    </xsd:complexType>
+
+    <xsd:element name="security-manager" type="securityManagerType" substitutionGroup="abstract-security-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default security manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="securityManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default security manager (type mule:defaultSecurityManagerType) provides basic support for security functions. Other modules (Acegi, JAAS, PGP) provide more advanced functionality.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractSecurityManagerType">
+                <xsd:sequence>
+                    <xsd:element name="custom-security-provider" type="customSecurityProviderType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Allow any implementation of SecurityProvider to be used.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="custom-encryption-strategy" type="customEncryptionStrategyType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Allow any implementation of EncryptionStrategy to be used.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="secret-key-encryption-strategy" type="secretKeyEncryptionStrategyType"
+                                 minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Provides secret key-based encryption using JCE.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="password-encryption-strategy" type="passwordEncryptionStrategyType"
+                                 minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Provides password-based encryption using JCE. Users must specify a password and optionally a salt and iteration count as well. The default algorithm is PBEWithMD5AndDES, but users can specify any valid algorithm supported by JCE.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="securityProviderType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A security provider is a source of specific security-related functionality.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="name" type="substitutableName" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="encryptionStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                An encryption strategy provides support for a specific encryption algorithm.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="name" type="substitutableName" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="customSecurityProviderType">
+        <xsd:complexContent>
+            <xsd:extension base="securityProviderType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="provider-ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the security provider to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="customEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A reference to the encryption strategy (which may be a Spring bean that implements the EncryptionStrategy interface).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="passwordEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:attribute name="password" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The password to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="salt" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The salt to use (this helps prevent dictionary attacks).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="iterationCount" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The number of itreations to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="secretKeyEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:attribute name="key" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The key to use. This and the keyFactory-ref attribute are mutually exclusive.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="keyFactory-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the key factory to use. This should implement the ObjectFactory interface and return a byte array. This and the key attribute are mutually exclusive.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="threading-profile" type="threadingProfileType"
+                 substitutionGroup="abstract-service-threading-profile">
+        <xsd:annotation>
+            <xsd:documentation>
+                The threading profile to use for the service.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <!-- this is a general threading type used by various elements here -->
+    <xsd:complexType name="threadingProfileType">
+        <xsd:complexContent>
+            <!-- this is a hack that allows us to use this general threading profile as a component threading profile
+                 without retyping everything -->
+            <xsd:extension base="abstractServiceThreadingProfileType">
+                <xsd:attribute name="maxThreadsActive" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The maximum number of threads that will be used.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="maxThreadsIdle" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The maximum number of idle or inactive threads that can be in the pool before they are destroyed.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="threadTTL" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Detemines how long an inactive thread is kept in the pool before being discarded.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="poolExhaustedAction">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            When the maximum pool size or queue size is bounded, this value determines how to handle incoming tasks. Possible values are: WAIT (wait until a thread becomes available. This policy should, in general, not be used if the minimum number of threads is zero, in which case a thread may never become available.), DISCARD (throw away the current request and return), DISCARD_OLDEST (throw away the oldest request and return), ABORT (throw a RuntimeException), and RUN (the thread making the execute request runs the task itself. This policy helps guard against lockup.)
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="WAIT"/>
+                            <xsd:enumeration value="DISCARD"/>
+                            <xsd:enumeration value="DISCARD_OLDEST"/>
+                            <xsd:enumeration value="ABORT"/>
+                            <xsd:enumeration value="RUN"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="threadWaitTimeout" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            How long to wait in milliseconds when the pool exhausted action is WAIT. If the value is negative, it will wait indefinitely.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="doThreading" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether threading should be used (default is true).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="maxBufferSize" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Determines how many requests are queued when the pool is at maximum usage capacity and the pool exhausted action is WAIT. The buffer is used as an overflow.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   Exception strategies                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="default-service-exception-strategy" type="endpointExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Provide default exception handling via an endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="default-connector-exception-strategy" type="endpointExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Provide default exception handling via an endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="endpointExceptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractExceptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-exception-strategy" type="customExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-defined exception stratgey.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customExceptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="endpointExceptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the ExceptionListener interface. In addition, if an outbound-endpoint element is specified, it is set as an "endpoint" bean property.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Custom connector element -->
+
+    <xsd:element name="custom-connector" type="customConnectorType" substitutionGroup="abstract-connector">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-defined connector.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="connectorType">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the Connector interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--  Object stores                                                     -->
+    <!--==============================================================-->
+
+
+    <xsd:complexType name="abstractObjectStoreType"/>
+
+        <xsd:element name="abstract-object-store" abstract="true" type="abstractObjectStoreType">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A placeholder for an object store that can be used by routers to maintain state.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:element>
+
+        <xsd:element name="in-memory-store" type="abstractMonitoredObjectStoreType"
+                     substitutionGroup="abstract-object-store">
+            <xsd:annotation>
+                <xsd:documentation>
+                    An optionally bounded in-memory store for message IDs with periodic expiry of old entries. The bounded size is a soft limit and is only enforced periodically by the expiry process; this means that the store may temporarily exceed its maximum size between expiry runs but will eventually shrink to its configured size.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:element>
+
+        <xsd:element name="simple-text-file-store" type="textFileObjectStoreType" substitutionGroup="abstract-object-store">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A Simple object store that stores String objects by key to a text file. This store is only suitable for storing simple key value pair strings. This store is backed by an in-memory store and supports the ability to expire and apply TTL to objects in the store.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:element>
+
+        <xsd:complexType name="textFileObjectStoreType">
+            <xsd:complexContent>
+                <xsd:extension base="abstractMonitoredObjectStoreType">
+                    <xsd:attribute name="directory" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The file location (directory) where the object store will be saved. If this value is not set, Mule defaults to using the {{mule.working.dir/objectstore}}.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+
+        <xsd:complexType name="abstractMonitoredObjectStoreType">
+            <xsd:complexContent>
+                <xsd:extension base="abstractObjectStoreType">
+                    <xsd:attribute name="name" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                An ID for this store that can be used for logging and identification purposes.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="maxEntries" type="substitutableInt">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The maximum number of entries that this store keeps around. Specify {{-1}} if the store is supposed to be "unbounded".
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="entryTTL" type="substitutableInt">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The time-to-live for each message ID, specified in seconds, or {{-1}} for entries that should never expire. DO NOT combine this with an unbounded store!
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="expirationInterval" type="substitutableInt">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The interval for periodic bounded size enforcement and entry expiration, specified in seconds. Arbitrary positive values between one second and several hours or days are possible, but should be chosen carefully according to the expected message rate to prevent OutOfMemory conditions.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--  Routers                                                     -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-message-info-mapping" abstract="true" type="abstractMessageInfoMappingType">
+        <xsd:annotation>
+            <xsd:documentation>Maps the attributes of the current message to known message elements in Mule; namely, Message ID, CorrrelationID.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractMessageInfoMappingType"/>
+
+    <!-- Inbound Router implementations -->
+
+    <xsd:complexType name="filteredInboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter" minOccurs="0"/>
+                    <!-- TODO this does not make sense here, need to re-visit <xsd:element ref="abstract-message-info-mapping" minOccurs="0"/>-->
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="idempotent-receiver-router" type="idempotentReceiverType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Ensures that only unique messages are received by a service by checking the unique ID of the incoming message. Note that the ID used can be generated from the message using an expression defined in the {{idExpression}} attribute. By default, the expression used is #\[message:id\], which means the underlying endpoint must support unique message IDs for this to work. Otherwise, a {{UniqueIdNotSupportedException}} is thrown.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="idempotent-secure-hash-receiver-router" type="idempotentSecureHashReceiverType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Ensures that only unique messages are received by a service by calculating the hash of the message itself using a message digest algorithm. This provides a value with an infinitesimally small chance of a collision. This can be used to filter message duplicates. Keep in mind that the hash is calculated over the entire byte array representing the message, so any leading or trailing spaces or extraneous bytes (like padding) can produce different hash values for the same semantic message content. Care should be taken to ensure that messages do not contain extraneous bytes. This class is useful when the message does not support unique identifiers.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="idempotentReceiverType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-object-store" maxOccurs="1" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="idExpression" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Defines one or more expressions to use when extrating the ID from the message. For example, it would be possible to combine to headers as the ID of the message to provide idempotency: "#\[headers:foo,bar\]". Or, you could combine the message ID with a header: "#\[message:id\]-#[header:foo]". If this property is not set, "#\[message:id\]" will be used by default.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="idempotentSecureHashReceiverType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-object-store" maxOccurs="1" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="messageDigestAlgorithm" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The secure hashing algorithm to use. If not set, the default is SHA-256.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <xsd:element name="wire-tap-router" type="wireTapRouterType" substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                The WireTap inbound router allows you to route certain messages to a different endpoint as well as to the component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="wireTapRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="1" maxOccurs="1"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="forwarding-router" type="selectiveConsumerRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows messages to be forwarded to the outbound routers without first being processed by a component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="selective-consumer-router" type="selectiveConsumerRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Applies one or more filters to the incoming message. If the filters match, the message is forwarded to the component. Otherwise, the message is forwarded to the catch-all strategy on the router. If no catch-all strategy is configured, the message is ignored and a warning is logged.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="correlation-resequencer-router" type="baseAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Holds back a group of messages and resequences them using each message's correlation sequence property.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="selectiveConsumerRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS"/>
+                <xsd:attribute name="transformFirst" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-chunking-aggregator-router" type="messageChunkingAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Combines two or more messages into a single message by matching messages with a given Correlation ID. Correlation IDs are set on messages when they are dispatched by certain outbound routers, such as the Recipient List and Message Splitter routers. These messages can be aggregated back together again using this router.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="messageChunkingAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="baseAggregatorRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-message-info-mapping" minOccurs="0"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-correlation-aggregator-router" type="customCorrelationAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a custom message aggregator. Mule provides an abstract implementation that has a template method that performs the message aggregation. A common use of the aggregator router is to combine the results of multiple requests such as "ask this set of vendors for the best price of X".
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customCorrelationAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="messageChunkingAggregatorRouterType">
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="collection-aggregator-router" type="baseAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a Collection Response Router. This will return a MuleMessageCollection message type that will contain all events received for a each correlation group.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="custom-inbound-router" type="customInboundRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows for custom inbound routers to be configured.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="customInboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of InboundRouter (fully qualified Java class name)
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:attribute name="timeout" type="substitutableInt"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- ResponseRouters -->
+
+    <xsd:element name="single-async-reply-router" type="asyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a Single Response Router. This will return the first message it receives on a reply endpoint and will discard the rest.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="collection-async-reply-router" type="asyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a Collection Response Router. This will return a MuleMessageCollection message type that will contain all messages received for the current correlation.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="asyncReplyRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractAsyncReplyRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element ref="abstract-message-info-mapping" minOccurs="0"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-async-reply-router" type="customAsyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router"/>
+    <xsd:complexType name="customAsyncReplyRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="asyncReplyRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- Outbound Router implementations -->
+
+    <!-- Outbound router element and attribute groups -->
+
+    <xsd:group name="defaultOutboundRouterElements">
+        <xsd:sequence>
+            <xsd:element name="reply-to" type="endpointRefType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Defines where the message should be routed after the recipient of the message this service dispatches to has finished with it.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-transaction" minOccurs="0" />
+            <xsd:element ref="abstract-message-info-mapping" minOccurs="0" />
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:group name="defaultFilteredOutboundRouterElements">
+        <xsd:sequence>
+            <xsd:group ref="defaultOutboundRouterElements" />
+            <xsd:element ref="abstract-filter" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Filters the messages to be processed by this router.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Filters are applied before message transformations. A transformer can be configured here to transform messages before they are filtered.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:attributeGroup name="defaultOutboundRouterAttributes">
+        <xsd:attribute name="enableCorrelation" default="IF_NOT_SET">
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="ALWAYS" />
+                    <xsd:enumeration value="NEVER" />
+                    <xsd:enumeration value="IF_NOT_SET" />
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:attributeGroup name="defaultFilteredOutboundRouterAttributes">
+        <xsd:attributeGroup ref="defaultOutboundRouterAttributes"/>
+        <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS"/>
+    </xsd:attributeGroup>
+
+    <!-- Default Outbound Router Types -->
+    <xsd:complexType name="outboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint"/>
+                    <xsd:group ref="defaultOutboundRouterElements"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultOutboundRouterAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="filteringOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint"/>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+     <xsd:complexType name="multipleEndpointFilteringOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" maxOccurs="unbounded"/>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--  Concrete Outbound Routers -->
+
+    <xsd:element name="pass-through-router" type="outboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                This router always matches and simply sends or dispatches message via the endpoint that is configured.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!--  FilteringOutboundRouter only uses a single endpoint. For now this needs to support multiple endpoints for MessageBuilderComponent usage only. -->
+    <xsd:element name="filtering-router" type="multipleEndpointFilteringOutboundRouterType" substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Uses filters to determine whether the message matches a particular criteria and if so will route the message to the endpoint configured on the router.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="template-endpoint-router" type="filteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows endpoints to be altered at runtime based on properties set on the current message or fallback values set on the endpoint properties. Templated values are expressed using square braces around a property name.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="chaining-router" type="multipleEndpointFilteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends the message through multiple endpoints using the result of the first invocation as the input for the next.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="exception-based-router" type="multipleEndpointFilteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends a message over an endpoint by selecting the first endpoint that can connect to the transport.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="multicasting-router" type="multipleEndpointFilteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends the same message over multiple endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="endpoint-selector-router" type="endpointSelectorRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                // TODO
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="endpointSelectorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="multipleEndpointFilteringOutboundRouterType">
+                <xsd:attributeGroup ref="expressionAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Splitter routers -->
+    <xsd:element name="list-message-splitter-router" type="messageSplitterOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Accepts a list of objects that will be routed to different endpoints. The actual endpoint used for each object in the list is determined by a filter configured on the endpoint itself.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="messageSplitterOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="multipleEndpointFilteringOutboundRouterType">
+                <!-- this is not exposed to the user afaict? -->
+                <!-- xsd:attribute name="multimatch" type="substitutableBoolean"/ -->
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="expression-splitter-router" type="expressionSplitterOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Splits the message based on an expression. The expression must return one or more message parts in order to be effective.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+
+    <xsd:complexType name="expressionSplitterOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="messageSplitterOutboundRouterType">
+                <xsd:attributeGroup ref="expressionAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-chunking-router" type="chunkingRouterType" substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows you to split a single message into a number of fixed-length messages that will all be routed to the same endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="chunkingRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="multipleEndpointFilteringOutboundRouterType">
+                <xsd:attribute name="messageSize" type="substitutableInt"/>
+                <xsd:attribute name="numberOfMessages" type="substitutableInt"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="static-recipient-list-router" type="staticRecipientListRouterType" substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends the same message to multiple endpoints over the same endpoint or to implement routing-slip behaviour where the next destination for the message is determined from message properties or the payload. It uses a static list of recipient endpoints, which are specified via the attribute recipientsProperty and delimited by the attribute recipientsDelimieter.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="staticRecipientListRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                    <xsd:element name="recipients" type="listOrSetType" minOccurs="0" maxOccurs="1"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+                <xsd:attribute name="recipientsProperty" type="xsd:string"/>
+                <xsd:attribute name="recipientsDelimiter" type="xsd:string"/>
+                <xsd:attribute name="synchronous" type="xsd:boolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="expression-recipient-list-router" type="expressionRecipientListRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends the same message to multiple endpoints over the same endpoint or implements routing-slip behaviour where the next destination for the message is determined from message properties or the payload. It uses a list of recipients endpoints, which are extracted from the message using an expression. (As of 2.1)
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="expressionRecipientListRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                    <xsd:element name="recipients" type="listOrSetType" minOccurs="0" maxOccurs="1"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+                <xsd:attributeGroup ref="expressionAttributes"/>
+                <xsd:attribute name="synchronous" type="xsd:boolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-outbound-router" type="customOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows you to configure a custom outbound router by specifying the custom router class and by using Spring properties.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of OutboundRouter (fully qualified Java class name)
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- Catch all strategy implementations -->
+    <xsd:element name="logging-catch-all-strategy" type="loggingCatchAllStrategyType" substitutionGroup="abstract-catch-all-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                 Does nothing with the message but simply logs (using the WARN log level) the fact that the message was not dispatched because no routing path was defined.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="loggingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-catch-all-strategy" type="customCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="customCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="forwarding-catch-all-strategy" type="forwardingCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Forwards the message to the specified endpoint if no outbound routers match.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="forwardingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-forwarding-catch-all-strategy" type="customForwardingCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="customForwardingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="forwardingCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Message Info Mappers -->
+
+    <xsd:element name="expression-message-info-mapping" type="expressionMessageInfoMappingType"
+                 substitutionGroup="abstract-message-info-mapping">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows expressions to be configured to extract the message information.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="expressionMessageInfoMappingType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractMessageInfoMappingType">
+                <xsd:attribute name="messageIdExpression" type="xsd:string" use="required"/>
+                <xsd:attribute name="correlationIdExpression" type="xsd:string" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-message-info-mapping" type="customMessageInfoMappingType"
+                 substitutionGroup="abstract-message-info-mapping">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows configuraton of a custom implementation of MessageInfoMapping.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customMessageInfoMappingType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractMessageInfoMappingType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the MessageInfoMapping interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!--==============================================================-->
+    <!--  Lifecycle Adapters                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-lifecycle-adapter-factory" abstract="true" type="abstractLifecycleAdapterFactory"/>
+    <xsd:complexType name="abstractLifecycleAdapterFactory">
+        <xsd:annotation>
+            <xsd:documentation>
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:complexType>
+    <xsd:complexType name="customLifecycleAdapterFactory">
+        <xsd:complexContent>
+            <xsd:extension base="abstractLifecycleAdapterFactory">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the LifecycleAdapter interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:element name="custom-lifecycle-adapter-factory" type="customLifecycleAdapterFactory"
+                 substitutionGroup="abstract-lifecycle-adapter-factory">
+        <xsd:annotation>
+            <xsd:documentation>
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!--==============================================================-->
+    <!--  Object Factories                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-object-factory" abstract="true" type="abstractObjectFactoryType"/>
+    <xsd:complexType name="abstractObjectFactoryType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A factory that will be used by Mule to create new instances of this object.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="propertiesGroup">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Properties to be set on the created object.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:group>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="genericObjectFactoryType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-object-factory"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="spring-object" type="springBeanLookupType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="springBeanLookupType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="bean" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>Name of Spring bean to look up.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="singleton-object" type="singletonObjectFactoryType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="singletonObjectFactoryType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>Class name</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="prototype-object" type="prototypeObjectFactoryType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="prototypeObjectFactoryType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>Class name</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-pooling-profile" abstract="true" type="abstractPoolingProfileType"/>
+    <xsd:complexType name="abstractPoolingProfileType"/>
+
+    <xsd:element name="pooling-profile" type="poolingProfileType" substitutionGroup="abstract-pooling-profile"/>
+    <xsd:complexType name="poolingProfileType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A pooling profile is used to configure the pooling behaviour of Mule components. Each service sets its own pooling profile. The org.mule.config.PoolingProfile class contains all the necessary values to create a pool of component proxies.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractPoolingProfileType">
+                <xsd:attribute name="maxActive" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>Controls the maximum number of Mule components that can be borrowed from a session at one time. When set to a negative value, there is no limit to the number of components that may be active at one time. When maxActive is exceeded, the pool is said to be exhausted.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="maxIdle" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>Controls the maximum number of Mule components that can sit idle in the pool at any time. When set to a negative value, there is no limit to the number of Mule components that may be idle at one time.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="initialisationPolicy" default="INITIALISE_ONE">
+                    <xsd:annotation>
+                        <xsd:documentation>Determines how components in a pool should be initialized. The possible values are: INITIALISE_NONE (will not load any components into the pool on startup), INITIALISE_ONE (will load one initial component into the pool on startup), or INITIALISE_ALL (will load all components in the pool on startup)</xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="INITIALISE_NONE"/>
+                            <xsd:enumeration value="INITIALISE_ONE"/>
+                            <xsd:enumeration value="INITIALISE_ALL"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="exhaustedAction" default="WHEN_EXHAUSTED_GROW">
+                    <xsd:annotation>
+                        <xsd:documentation>Specifies the behavior of the Mule component pool when the pool is exhausted. Possible values are: "WHEN_EXHAUSTED_FAIL", which will throw a NoSuchElementException, "WHEN_EXHAUSTED_WAIT", which will block (invoke Object.wait(long)) until a new or idle object is available, or WHEN_EXHAUSTED_GROW, which will create a new Mule and return it, essentially making maxActive meaningless. If a positive maxWait value is supplied, it will block for at most that many milliseconds, after which a NoSuchElementException will be thrown. If maxThreadWait is a negative value, it will block indefinitely.</xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="WHEN_EXHAUSTED_GROW"/>
+                            <xsd:enumeration value="WHEN_EXHAUSTED_WAIT"/>
+                            <xsd:enumeration value="WHEN_EXHAUSTED_FAIL"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="maxWait" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>Specifies the number of milliseconds to wait for a pooled component to become available when the pool is exhausted and the exhaustedAction is set to WHEN_EXHAUSTED_BLOCK.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <!-- <xsd:attribute name="factory" type="xsd:string" default="org.mule.config.pool.CommonsPoolFactory"/> -->
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--  Utils / Standard Types                                      -->
+    <!--==============================================================-->
+
+
+    <xsd:complexType name="abstractAgentType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for agents. Not used in core, but common to several modules.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractExtensionType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsIndirectKeyStore, named as tls-client in transport namespace -->
+    <xsd:complexType name="tlsClientKeyStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configure client key stores. TLS/SSL connections are made on behalf of an entity, which can be anonymous or identified by a certificate - this interface specifies how a keystore can be used to provide the certificates (and associated private keys) necessary for identification. This is also used as the trust store if no other trust store is specified and the explicitTrustStoreOnly parameter in the server trust store configuration is false. WARNING - due to restrictions in library implementations the values specified here typically apply to all connectors using this transport.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if possible) of the keystore that contains public certificates and private keys for identification.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the keystore.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The type of keystore used (a Java class name).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsDirectKeyStore, named as tls-key-store in transport namespace -->
+    <xsd:complexType name="tlsKeyStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures key stores. TLS/SSL connections are made on behalf of an entity, which can be anonymous or identified by a certificate - this interface specifies how a keystore can be used to provide the certificates (and associated private keys) necessary for identification.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if possible) of the keystore that contains public certificates and private keys for identification.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The type of keystore used (a Java class name).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="keyPassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the private key.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the keystore.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="algorithm" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The algorithm used by the key store.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsIndirectTrustStore, named as tls-trust-store in transport namespace -->
+    <xsd:complexType name="tlsTrustStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a trust store. TLS/SSL connections are made to trusted systems - the public certificates of trusted systems are store in a keystore (called a trust store) and used to verify that the connection made to a remote system "really is" the expected identity.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if possible) of the keystore that contains public certificates of trusted servers.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protected the trust store.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsDirectTrustStore, named as tls-server in transport namespace
+         note that this extends tlsTrustStoreType, so only one of the two is needed -->
+    <xsd:complexType name="tlsServerTrustStoreType">
+        <xsd:complexContent>
+            <xsd:extension base="tlsTrustStoreType">
+                <xsd:attribute name="class" type="substitutableClass"/>
+                <xsd:attribute name="algorithm" type="xsd:string"/>
+                <!-- should be of type TrustManagerFactory -->
+                <xsd:attribute name="factory-ref" type="xsd:NMTOKEN"/>
+                <xsd:attribute name="explicitOnly" type="substitutableBoolean"/>
+                <xsd:attribute name="requireClientAuthentication" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsProtocolHandler, named as tls-protocol-handler -->
+    <xsd:complexType name="tlsProtocolHandler">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures the global Java protocol handler. WARNING - Untested.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="property" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Sets the java.protocol.handler.pkgs system property.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:simpleType name="propertyPlaceholderType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A type that defines a Mule-style property placeholder
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:string">
+            <xsd:pattern value="(\#\[[^\]]+\]|\$\{[^\}]+\})"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableClass">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:NMTOKEN-like type that also allows for Ant-style property placeholders and a leading [
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:string">
+                    <xsd:pattern value="\[?[A-Za-z0-9_\.$]+"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="nonBlankString">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:string-like type that cannot be empty.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:string">
+                    <xsd:pattern value=".*[^ ]+.*"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableName">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:NMTOKEN type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutablePortNumber">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:int type that also allows for Ant-style property placeholders and restricts the int value to a valid port number.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:int">
+                    <xsd:minInclusive value="0"/>
+                    <xsd:maxInclusive value="65536"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableInt">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:int type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:int"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableLong">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:long type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:long"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableBoolean">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:boolean type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:boolean"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <!-- i found this a bit confusing, so here is some background...
+         this type is typically called from something like
+           <xsd:element name="properties" type="mapType/>
+         and the "properties" element generates a ChildMapDefinitionParser that
+         can "receive" the map entries generated by the embedded spring <entry..>
+         elements and which is then set via "setProperties" on the parent.
+         in other words, it's a map, and despite the name "properties" has
+         nothing to do with the spring <property ...> element.
+         spring elements like <entry...> are handled by
+         MuleHierarchicalBeanDefinitionParserDelegate which punts them to
+         the spring handler -->
+    <xsd:element name="properties" type="mapType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sets Mule properties. These are name/value pairs that can be set on components, services, etc., and which provide a generic way of configuring the system. In Mule 2.x, you shouldn't need to use generic properties like this, since almost all functionality is exposed via dedicated elements. However, they can be useful in configuring obscure or overlooked options and in configuring transports from the generic endpoint elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="mapType">
+        <xsd:complexContent>
+            <xsd:extension base="spring:mapType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:group name="propertiesGroup">
+        <xsd:sequence>
+            <xsd:element name="property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Sets a Mule property. This is a name/value pair that can be set on components, services, etc., and which provide a generic way of configuring the system. In Mule 2.x, you shouldn't need to use a generic property like this, since almost all functionality is exposed via dedicated elements. However, it can be useful in configuring obscure or overlooked options and in configuring transports from the generic endpoint elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="properties" minOccurs="0"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:complexType name="listOrSetType">
+        <xsd:complexContent>
+            <xsd:extension base="spring:listOrSetType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="referenceType">
+        <xsd:attribute name="ref" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="keyType">
+        <xsd:attribute name="key" type="xsd:string"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="valueType">
+        <xsd:attribute name="value" type="xsd:string"/>
+        <xsd:attribute name="value-ref" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="keyValueType">
+        <xsd:complexContent>
+            <xsd:extension base="keyType">
+                <xsd:attribute name="value" type="xsd:string"/>
+                <xsd:attribute name="value-ref" type="xsd:NMTOKEN"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   Connector support                                          -->
+    <!--==============================================================-->
+
+    <xsd:complexType name="connectorType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractConnectorType">
+                <xsd:sequence>
+                    <!-- for normal connectors, this is for emergency use only, but it is
+                         critical for custom connector -->
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element name="receiver-threading-profile" type="threadingProfileType" minOccurs="0"/>
+                    <xsd:element name="dispatcher-threading-profile" type="threadingProfileType" minOccurs="0"/>
+                    <xsd:element ref="abstract-exception-strategy" minOccurs="0"/>
+                    <xsd:element ref="abstract-retry-policy" minOccurs="0"/>
+                    <xsd:element name="service-overrides" type="serviceOverridesType" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="createMultipleTransactedReceivers" type="substitutableBoolean"/>
+                <xsd:attribute name="numberOfConcurrentTransactedReceivers" type="substitutableInt"/>
+                <xsd:attribute name="dynamicNotification" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="serviceOverridesType">
+        <xsd:attribute name="messageReceiver" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="transactedMessageReceiver" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="xaTransactedMessageReceiver" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="dispatcherFactory" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="inboundTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="outboundTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="responseTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="endpointBuilder" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="messageAdapter" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="streamMessageAdapter" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="serviceFinder" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="sessionHandler" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   JNDI support                                               -->
+    <!--==============================================================-->
+
+    <xsd:complexType name="jndiConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="connectorType">
+                <xsd:sequence>
+                    <xsd:element name="jndi-provider-property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Direct setting of a JNDI property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="jndi-provider-properties" type="mapType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Direct setting of JNDI properties (allows access to the full Spring map entry).
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="jndiContext-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Set the complete context directly, via a bean reference.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiInitialFactory" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The initial context factory to use. The value of the property should be the fully qualified class name of the factory class that will create an initial context.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiProviderUrl" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The service provider to use. The value of the property should contain a URL string (such as "ldap://somehost:389").
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiUrlPkgPrefixes" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The list of package prefixes to use when loading in URL context factories. The value of the property should be a colon-separated list of package prefixes for the class name of the factory class that will create a URL context factory.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="dataReferenceType" mixed="true">
+        <xsd:attribute name="file" type="xsd:string"/>
+        <xsd:attribute name="ref" type="xsd:string"/>
+        <!--I don't like this flag, may be we could use content-type mappings... -->
+        <xsd:attribute name="binary" type="substitutableBoolean"/>
+    </xsd:complexType>
+
+    <!-- these cannot be references (unless we use qualified attribute names, which are ugly),
+         but serve as templates to cut+paste in individual transports
+
+    <xsd:attribute name="path" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A file location.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="user" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A username.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="password" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A password.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="host" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                An IP address (eg www.mulesource.com, localhost, 127.0.0.1).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="port" type="substitutablePortNumber">
+        <xsd:annotation>
+            <xsd:documentation>
+                A port number.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    -->
+
+
+</xsd:schema>
diff --git a/xml/tests/testData/completion/IDEADEV_32773_after.xml b/xml/tests/testData/completion/IDEADEV_32773_after.xml
new file mode 100644
index 0000000..bb355e9
--- /dev/null
+++ b/xml/tests/testData/completion/IDEADEV_32773_after.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mule xmlns="http://www.mulesource.org/schema/mule/core/2.1"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:spring="http://www.springframework.org/schema/beans"
+       xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.1"
+       xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.1"
+       xmlns:jms="http://www.mulesource.org/schema/mule/jms/2.1"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:jee="http://www.springframework.org/schema/jee"
+       xsi:schemaLocation="
+               http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+               http://www.mulesource.org/schema/mule/core/2.1 IDEADEV_32773.xsd
+               http://www.mulesource.org/schema/mule/stdio/2.1 IDEADEV_32773-stdio.xsd
+               http://www.mulesource.org/schema/mule/vm/2.1 IDEADEV_32773-vm.xsd
+               http://www.mulesource.org/schema/mule/jms/2.1 IDEADEV_32773-jms.xsd
+               http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
+               http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">
+
+    <description>
+    </description>
+
+
+
+    <jms:connector name="JMSConnector"
+        jndiInitialFactory="org.jnp.interfaces.NamingContextFactory"
+        connectionFactoryJndiName="ConnectionFactory"
+        jndiProviderUrl="jnp://localhost:1099"
+        specification="1.1"
+        jndiDestinations="true"
+        forceJndiDestinations="true"/>
+
+    <jms:object-to-jmsmessage-transformer name="ObjectToJMSMessage"/>
+    <jms:jmsmessage-to-object-transformer name="JMSMessageToObject"/>
+
+    <!--
+        The Mule model initialises and manages your UMO components
+    -->
+    <model name="helloSample">
+
+        <service name="JMSTest">
+            <inbound>
+                <jms:inbound-endpoint queue="queue/testQueue" transformer-refs="JMSMessageToObject">
+                    <jms:transaction<caret>
+                </jms:inbound-endpoint>
+            </inbound>
+
+            <outbound>
+                <pass-through-router>
+                    <stdio:outbound-endpoint system="OUT"/>
+                </pass-through-router>
+            </outbound>
+        </service>
+
+    </model>
+
+</mule>
+
diff --git a/xml/tests/testData/completion/NoAttributesTemplateFinishWithSpace.xml b/xml/tests/testData/completion/NoAttributesTemplateFinishWithSpace.xml
new file mode 100644
index 0000000..c905634
--- /dev/null
+++ b/xml/tests/testData/completion/NoAttributesTemplateFinishWithSpace.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <<caret>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/NoAttributesTemplateFinishWithSpace_after.xml b/xml/tests/testData/completion/NoAttributesTemplateFinishWithSpace_after.xml
new file mode 100644
index 0000000..93fb01e
--- /dev/null
+++ b/xml/tests/testData/completion/NoAttributesTemplateFinishWithSpace_after.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <description <caret>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/NoFixedAttrComplete.xml b/xml/tests/testData/completion/NoFixedAttrComplete.xml
new file mode 100644
index 0000000..bfc3ac3
--- /dev/null
+++ b/xml/tests/testData/completion/NoFixedAttrComplete.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE zzz [
+  <!ELEMENT zzz (#PCDATA)>
+  <!ATTLIST zzz
+    id CDATA #FIXED "111">
+  ]>
+<zz<caret>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/NoFixedAttrComplete_after.xml b/xml/tests/testData/completion/NoFixedAttrComplete_after.xml
new file mode 100644
index 0000000..053f564
--- /dev/null
+++ b/xml/tests/testData/completion/NoFixedAttrComplete_after.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE zzz [
+  <!ELEMENT zzz (#PCDATA)>
+  <!ATTLIST zzz
+    id CDATA #FIXED "111">
+  ]>
+<zzz<caret>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/SchemaBooleanCompletion.xsd b/xml/tests/testData/completion/SchemaBooleanCompletion.xsd
new file mode 100644
index 0000000..8cd4429
--- /dev/null
+++ b/xml/tests/testData/completion/SchemaBooleanCompletion.xsd
@@ -0,0 +1,11 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	   elementFormDefault="qualified"
+	   attributeFormDefault="unqualified"
+           xmlns:aaa="AAA"
+           targetNamespace="AAA">
+	<xs:complexType name="Y">
+	  <xs:sequence>
+            <xs:element nillable="t<caret>" />
+          </xs:sequence>	
+	</xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/completion/SchemaBooleanCompletion_after.xsd b/xml/tests/testData/completion/SchemaBooleanCompletion_after.xsd
new file mode 100644
index 0000000..d5e0b8e
--- /dev/null
+++ b/xml/tests/testData/completion/SchemaBooleanCompletion_after.xsd
@@ -0,0 +1,11 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	   elementFormDefault="qualified"
+	   attributeFormDefault="unqualified"
+           xmlns:aaa="AAA"
+           targetNamespace="AAA">
+	<xs:complexType name="Y">
+	  <xs:sequence>
+            <xs:element nillable="true<caret>" />
+          </xs:sequence>	
+	</xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/completion/SingleCompletionVariantAtRootTag.xml b/xml/tests/testData/completion/SingleCompletionVariantAtRootTag.xml
new file mode 100644
index 0000000..f131b12
--- /dev/null
+++ b/xml/tests/testData/completion/SingleCompletionVariantAtRootTag.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<be<caret>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/SingleCompletionVariantAtRootTag_after.xml b/xml/tests/testData/completion/SingleCompletionVariantAtRootTag_after.xml
new file mode 100644
index 0000000..1dd4e88
--- /dev/null
+++ b/xml/tests/testData/completion/SingleCompletionVariantAtRootTag_after.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<beans<caret>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/SuggestTagsInXHtml.xml b/xml/tests/testData/completion/SuggestTagsInXHtml.xml
new file mode 100644
index 0000000..f09238f
--- /dev/null
+++ b/xml/tests/testData/completion/SuggestTagsInXHtml.xml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:foo="foo">
+  <head>
+    <title>test</title>
+    <bo<caret>
+  </head>
+
+  <body>
+  </body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/SuggestTagsInXHtml_2.xml b/xml/tests/testData/completion/SuggestTagsInXHtml_2.xml
new file mode 100644
index 0000000..1c087e4
--- /dev/null
+++ b/xml/tests/testData/completion/SuggestTagsInXHtml_2.xml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:foo="foo">
+  <head>
+    <title>test</title>
+    <ti<caret>
+  </head>
+
+  <body>
+  </body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/SuggestTagsInXHtml_2_after.xml b/xml/tests/testData/completion/SuggestTagsInXHtml_2_after.xml
new file mode 100644
index 0000000..05205ac
--- /dev/null
+++ b/xml/tests/testData/completion/SuggestTagsInXHtml_2_after.xml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:foo="foo">
+  <head>
+    <title>test</title>
+    <title<caret>
+  </head>
+
+  <body>
+  </body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/SuggestTagsInXHtml_after.xml b/xml/tests/testData/completion/SuggestTagsInXHtml_after.xml
new file mode 100644
index 0000000..f09238f
--- /dev/null
+++ b/xml/tests/testData/completion/SuggestTagsInXHtml_after.xml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:foo="foo">
+  <head>
+    <title>test</title>
+    <bo<caret>
+  </head>
+
+  <body>
+  </body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/XIncludeCompletion.xsd b/xml/tests/testData/completion/XIncludeCompletion.xsd
new file mode 100644
index 0000000..d167a34a
--- /dev/null
+++ b/xml/tests/testData/completion/XIncludeCompletion.xsd
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<persistence xmlns="http://example.com/persistence"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xmlns:xi="http://www.w3.org/2001/XInclude"
+             xsi:schemaLocation="http://example.com/persistence XIncludeTestSchema.xsd"
+             >
+  <xi:i<caret>
+</persistence>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/XIncludeCompletion_after.xsd b/xml/tests/testData/completion/XIncludeCompletion_after.xsd
new file mode 100644
index 0000000..635f490
--- /dev/null
+++ b/xml/tests/testData/completion/XIncludeCompletion_after.xsd
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<persistence xmlns="http://example.com/persistence"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xmlns:xi="http://www.w3.org/2001/XInclude"
+             xsi:schemaLocation="http://example.com/persistence XIncludeTestSchema.xsd"
+             >
+  <xi:include<caret>
+</persistence>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/XmlCompletionWhenTagsWithSemicolon.dtd b/xml/tests/testData/completion/XmlCompletionWhenTagsWithSemicolon.dtd
new file mode 100644
index 0000000..4f35c2f
--- /dev/null
+++ b/xml/tests/testData/completion/XmlCompletionWhenTagsWithSemicolon.dtd
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!-- Authors: Chris Taylor, Ceki Gulcu. -->
+
+<!-- A configuration element consists of optional renderer
+elements,appender elements, categories and an optional root
+element. -->
+
+<!ELEMENT log4j:configuration (renderer*, appender*,category*,root?)>
+
+<!-- The disable attribute takes a priority value such that all -->
+<!-- logging statements with a prioroty equal or below this value are -->
+<!-- disabled. -->
+
+<!-- The disableOverride attribute allows the user to override any   -->
+<!-- BasicConfigurator.disable invocations made from within the      -->
+<!-- application.                                                    -->
+
+<!-- By default, disableOverride is "null", meaning that we          -->
+<!-- do not touch the disable flag.                                  -->
+
+<!-- Setting the "debug" or "configDebug" attributes enable the printing -->
+<!-- of internal log4j logging statements.                               -->
+<!-- The "debug" and "configDebug" attributes are equivalent altough     -->
+<!-- the latter is deprecated and should no longer be used.              -->
+<!-- By default, debug and configDebug attributes are "null", meaning    -->
+<!-- that we not touch internal log4j logging settings.                  -->
+
+
+<!ATTLIST log4j:configuration
+  xmlns:log4j              CDATA #FIXED "http://jakarta.apache.org/log4j/"
+  disable                  (debug|info|warn|error|fatal|null)  "null"
+  disableOverride          (true|false|null)  "null"
+  debug                    (true|false|null)  "null"
+  configDebug              (true|false|null)  "null"
+>
+
+
+<!-- DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED -->
+<!-- WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING   -->
+<!-- DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED -->
+
+<!-- Use "log4j:configuration" above instead of the "configuration" -->
+<!-- element. -->
+
+<!-- DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED -->
+<!-- WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING   -->
+<!-- DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED -->
+
+<!ELEMENT configuration (renderer*, appender*,category*,root?)>
+<!ATTLIST configuration
+  disable                  (debug|info|warn|error|fatal|null)  "null"
+  disableOverride          (true|false|null)  "null"
+  configDebug              (true|false|null)  "null"
+>
+
+
+<!-- renderer elements allow the user to customize the conversion of  -->
+<!-- message objects to String.                                       -->
+
+<!ELEMENT renderer EMPTY>
+<!ATTLIST renderer
+  renderedClass  CDATA #REQUIRED
+  renderingClass CDATA #REQUIRED
+>
+
+<!-- Appenders must have a name and a class. -->
+<!-- Appenders may contain an error handler, a layout, optional parameters -->
+<!-- and filters. They may also reference (or include) other appenders. -->
+<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)>
+<!ATTLIST appender
+  name 		ID 	#REQUIRED
+  class 	CDATA	#REQUIRED
+>
+
+<!ELEMENT layout (param*)>
+<!ATTLIST layout
+  class		CDATA	#REQUIRED
+>
+
+
+
+<!ELEMENT filter (param*)>
+<!ATTLIST filter
+  class		CDATA	#REQUIRED
+>
+
+
+<!-- ErrorHandlers can be of any class. They can admit any number of -->
+<!-- parameters. -->
+
+<!ELEMENT errorHandler (param*)>
+<!ATTLIST errorHandler
+   class        CDATA   #REQUIRED
+>
+
+
+
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+  name		CDATA   #REQUIRED
+  value		CDATA	#REQUIRED
+>
+
+<!-- The priority class is org.apache.log4j.Priority by default -->
+<!ELEMENT priority (param*)>
+<!ATTLIST priority
+  class   CDATA	#IMPLIED
+  value	  CDATA #REQUIRED
+>
+
+<!-- If no priority element is specified, then the configurator MUST not -->
+<!-- touch the priority of the named category. -->
+<!ELEMENT category (param*, priority?, appender-ref*)>
+<!ATTLIST category
+  class         CDATA   #IMPLIED
+  name		CDATA	#REQUIRED
+  additivity	(true|false) "true"
+>
+
+<!ELEMENT appender-ref EMPTY>
+<!ATTLIST appender-ref
+  ref IDREF #REQUIRED
+>
+
+<!-- If no priority element is specified, then the configurator MUST not -->
+<!-- touch the priority of root. -->
+<!-- The root category always exists and cannot be subclassed. -->
+<!ELEMENT root (param*, priority?, appender-ref*)>
+
+
+
+<!-- ==================================================================== -->
+<!--                       A logging event                                -->
+<!-- ==================================================================== -->
+<!ELEMENT log4j:eventSet (log4j:event*)>
+<!ATTLIST log4j:eventSet
+  includesLocationInfo   (true|false) "true"
+>
+
+
+
+<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?,
+                       log4j:locationInfo?) >
+
+<!-- The timestamp format is application dependent. -->
+<!ATTLIST log4j:event
+    category   CDATA #REQUIRED
+    priority   CDATA #REQUIRED
+    thread     CDATA #REQUIRED
+    timestamp  CDATA #REQUIRED
+>
+
+<!ELEMENT log4j:message (#PCDATA)>
+<!ELEMENT log4j:NDC (#PCDATA)>
+
+<!ELEMENT log4j:throwable (#PCDATA)>
+
+<!ELEMENT log4j:locationInfo EMPTY>
+<!ATTLIST log4j:locationInfo
+  class  CDATA	#REQUIRED
+  method CDATA	#REQUIRED
+  file   CDATA	#REQUIRED
+  line   CDATA	#REQUIRED
+>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/XmlCompletionWhenTagsWithSemicolon.xml b/xml/tests/testData/completion/XmlCompletionWhenTagsWithSemicolon.xml
new file mode 100644
index 0000000..030afc0
--- /dev/null
+++ b/xml/tests/testData/completion/XmlCompletionWhenTagsWithSemicolon.xml
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='ISO-8859-1' ?>
+
+<!DOCTYPE log4j:configuration SYSTEM "XmlCompletionWhenTagsWithSemicolon.dtd">
+
+<log4j:configuration>
+  <root>
+    <priority value="INFO"/>
+    <appender-ref ref="ACTIVITIES.LOG"/>
+    <cat<caret>
+  </root>
+</log4j:configuration>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/XmlCompletionWhenTagsWithSemicolon_after.xml b/xml/tests/testData/completion/XmlCompletionWhenTagsWithSemicolon_after.xml
new file mode 100644
index 0000000..030afc0
--- /dev/null
+++ b/xml/tests/testData/completion/XmlCompletionWhenTagsWithSemicolon_after.xml
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='ISO-8859-1' ?>
+
+<!DOCTYPE log4j:configuration SYSTEM "XmlCompletionWhenTagsWithSemicolon.dtd">
+
+<log4j:configuration>
+  <root>
+    <priority value="INFO"/>
+    <appender-ref ref="ACTIVITIES.LOG"/>
+    <cat<caret>
+  </root>
+</log4j:configuration>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/archetype-descriptor-1.0.0.xsd b/xml/tests/testData/completion/archetype-descriptor-1.0.0.xsd
new file mode 100644
index 0000000..1d780ba
--- /dev/null
+++ b/xml/tests/testData/completion/archetype-descriptor-1.0.0.xsd
@@ -0,0 +1,189 @@
+<?xml version="1.0"?>
+<!-- =================== DO NOT EDIT THIS FILE ====================         -->
+<!-- Generated by Modello 1.4 on 2010-10-28 03:21:56,                       -->
+<!-- any modifications will be overwritten.                                 -->
+<!-- ==============================================================         -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" targetNamespace="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0">
+  <xs:element name="archetype-descriptor" type="ArchetypeDescriptor">
+    <xs:annotation>
+      <xs:documentation source="version">0.0.0+</xs:documentation>
+    </xs:annotation>
+  </xs:element>
+  <xs:complexType name="ArchetypeDescriptor">
+    <xs:annotation>
+      <xs:documentation source="version">0.0.0+</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element minOccurs="0" name="requiredProperties">
+        <xs:annotation>
+          <xs:documentation source="version">0.0.0+</xs:documentation>
+          <xs:documentation source="description">List of required properties to generate a project from this archetype.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="requiredProperty" minOccurs="0" maxOccurs="unbounded" type="RequiredProperty"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element minOccurs="0" name="fileSets">
+        <xs:annotation>
+          <xs:documentation source="version">0.0.0+</xs:documentation>
+          <xs:documentation source="description">File sets definition.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="fileSet" minOccurs="0" maxOccurs="unbounded" type="FileSet"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element minOccurs="0" name="modules">
+        <xs:annotation>
+          <xs:documentation source="version">0.0.0+</xs:documentation>
+          <xs:documentation source="description">Modules definition.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="module" minOccurs="0" maxOccurs="unbounded" type="ModuleDescriptor"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+    <xs:attribute name="name" type="xs:string">
+      <xs:annotation>
+        <xs:documentation source="version">0.0.0+</xs:documentation>
+        <xs:documentation source="description">Name of the Archetype, that will be displayed to the user when choosing an archetype.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="partial" type="xs:boolean" default="false">
+      <xs:annotation>
+        <xs:documentation source="version">0.0.0+</xs:documentation>
+        <xs:documentation source="description">Is this archetype representing a full Maven project or only parts?</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+  <xs:complexType name="FileSet">
+    <xs:annotation>
+      <xs:documentation source="version">0.0.0+</xs:documentation>
+      <xs:documentation source="description">A fileset defines the way the project&apos;s files located in the jar file are used by the Archetype Plugin to generate a project.</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element minOccurs="0" name="directory" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">0.0.0+</xs:documentation>
+          <xs:documentation source="description">The directory where the files will be searched for, which is also the directory where the
+           project&apos;s files will be generated.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element minOccurs="0" name="includes">
+        <xs:annotation>
+          <xs:documentation source="version">0.0.0+</xs:documentation>
+          <xs:documentation source="description">Inclusion definition &quot;à la&quot; Ant.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="include" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element minOccurs="0" name="excludes">
+        <xs:annotation>
+          <xs:documentation source="version">0.0.0+</xs:documentation>
+          <xs:documentation source="description">Exclusion definition &quot;à la&quot; Ant.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+    <xs:attribute name="filtered" type="xs:boolean" default="false">
+      <xs:annotation>
+        <xs:documentation source="version">0.0.0+</xs:documentation>
+        <xs:documentation source="description">Filesets can be filtered, which means the selected files will be used as Velocity templates.
+          They can be non-filtered, which means the selected files will be copied without modification.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="packaged" type="xs:boolean" default="false">
+      <xs:annotation>
+        <xs:documentation source="version">0.0.0+</xs:documentation>
+        <xs:documentation source="description">Filesets can be packaged, which means the selected files will be generated/copied in a directory
+           structure that is prepended by the package property. They can be non-packaged, which means that the selected
+           files will be generated/copied without that prepend.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="encoding" type="xs:string">
+      <xs:annotation>
+        <xs:documentation source="version">0.0.0+</xs:documentation>
+        <xs:documentation source="description">Encoding to use when filtering content.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+  <xs:complexType name="RequiredProperty">
+    <xs:annotation>
+      <xs:documentation source="version">0.0.0+</xs:documentation>
+      <xs:documentation source="description">Definition of a property required when generating a project from this archetype.</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element minOccurs="0" name="defaultValue" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">0.0.0+</xs:documentation>
+          <xs:documentation source="description">Default value of the property.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+    <xs:attribute name="key" type="xs:string">
+      <xs:annotation>
+        <xs:documentation source="version">0.0.0+</xs:documentation>
+        <xs:documentation source="description">Key value of the property.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+  <xs:complexType name="ModuleDescriptor">
+    <xs:annotation>
+      <xs:documentation source="version">0.0.0+</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element minOccurs="0" name="fileSets">
+        <xs:annotation>
+          <xs:documentation source="version">0.0.0+</xs:documentation>
+          <xs:documentation source="description">File sets definition.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="fileSet" minOccurs="0" maxOccurs="unbounded" type="FileSet"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element minOccurs="0" name="modules">
+        <xs:annotation>
+          <xs:documentation source="version">0.0.0+</xs:documentation>
+          <xs:documentation source="description">Modules definition.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="module" minOccurs="0" maxOccurs="unbounded" type="ModuleDescriptor"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+    <xs:attribute name="id" type="xs:string">
+      <xs:annotation>
+        <xs:documentation source="version">0.0.0+</xs:documentation>
+        <xs:documentation source="description">The module&apos;s artifactId.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dir" type="xs:string">
+      <xs:annotation>
+        <xs:documentation source="version">0.0.0+</xs:documentation>
+        <xs:documentation source="description">The module&apos;s directory.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="name" type="xs:string">
+      <xs:annotation>
+        <xs:documentation source="version">0.0.0+</xs:documentation>
+        <xs:documentation source="description">The module&apos;s name.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/bar.xsd b/xml/tests/testData/completion/bar.xsd
new file mode 100644
index 0000000..cbfd062
--- /dev/null
+++ b/xml/tests/testData/completion/bar.xsd
@@ -0,0 +1,14 @@
+<xsd:schema xmlns="http://www.bar.org/test"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	targetNamespace="http://www.bar.org/test"
+	elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+    <xsd:element name="bar">
+        <xsd:complexType>
+            <xsd:anyAttribute processContents="skip"/>
+        </xsd:complexType>
+    </xsd:element>
+
+<xsd:attribute name="bar"/>
+
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/beforeAttributeValue.xml b/xml/tests/testData/completion/beforeAttributeValue.xml
new file mode 100644
index 0000000..34206cb
--- /dev/null
+++ b/xml/tests/testData/completion/beforeAttributeValue.xml
@@ -0,0 +1,5 @@
+<a>
+  <include file="" value=""/>
+  <include file=<caret>""/>
+
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/doNotInsertClosingTagB4Text.xml b/xml/tests/testData/completion/doNotInsertClosingTagB4Text.xml
new file mode 100644
index 0000000..f4c6a07
--- /dev/null
+++ b/xml/tests/testData/completion/doNotInsertClosingTagB4Text.xml
@@ -0,0 +1,10 @@
+<a>
+  <b>
+    <a1>a1</a1>
+    test
+    <a2>a2</a2>
+    text
+    <a<caret>
+    text
+  </b>
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/doNotInsertClosingTagB4Text_after.xml b/xml/tests/testData/completion/doNotInsertClosingTagB4Text_after.xml
new file mode 100644
index 0000000..3c8daca
--- /dev/null
+++ b/xml/tests/testData/completion/doNotInsertClosingTagB4Text_after.xml
@@ -0,0 +1,10 @@
+<a>
+  <b>
+    <a1>a1</a1>
+    test
+    <a2>a2</a2>
+    text
+    <a1><caret>
+      text
+  </b>
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/doNotInsertClosingTagWithoutTagName.xml b/xml/tests/testData/completion/doNotInsertClosingTagWithoutTagName.xml
new file mode 100644
index 0000000..2c25f51
--- /dev/null
+++ b/xml/tests/testData/completion/doNotInsertClosingTagWithoutTagName.xml
@@ -0,0 +1,4 @@
+<code>
+  <<caret>
+  not_a_name
+</code>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/doNotInsertClosingTagWithoutTagName_after.xml b/xml/tests/testData/completion/doNotInsertClosingTagWithoutTagName_after.xml
new file mode 100644
index 0000000..c07438d
--- /dev/null
+++ b/xml/tests/testData/completion/doNotInsertClosingTagWithoutTagName_after.xml
@@ -0,0 +1,4 @@
+<code>
+  <><caret>
+  not_a_name
+</code>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/foo.xsd b/xml/tests/testData/completion/foo.xsd
new file mode 100644
index 0000000..1ba269f
--- /dev/null
+++ b/xml/tests/testData/completion/foo.xsd
@@ -0,0 +1,20 @@
+<xsd:schema xmlns="http://www.foo.org/test"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	targetNamespace="http://www.foo.org/test"
+	elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+  <xsd:element name="root">
+      <xsd:complexType>
+          <xsd:sequence maxOccurs="unbounded">
+              <xsd:element ref="foo"/>
+          </xsd:sequence>
+      </xsd:complexType>
+  </xsd:element>
+
+  <xsd:element name="foo">
+    <xsd:complexType>
+      <xsd:anyAttribute processContents="skip"/>
+    </xsd:complexType>
+  </xsd:element>
+
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/completion/hibernate-3.0.dtd b/xml/tests/testData/completion/hibernate-3.0.dtd
new file mode 100644
index 0000000..4c5e002
--- /dev/null
+++ b/xml/tests/testData/completion/hibernate-3.0.dtd
@@ -0,0 +1,1118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+     Attention: Generated code! Do not modify by hand!
+     Generated by: hibernate.hbm.xml.vsl in andromda-hibernate-cartridge.
+  -->
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+          "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping default-cascade="$entity.hibernateDefaultCascade">
+    <class name="com.tickets.common.util.registry.ClassRegistryEntry" table="CLASS_REGISTRY_ENTRY" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="className" type="java.lang.String">
+            <column name="CLASS_NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+    <class name="com.tickets.account.domain.ReturnRule" table="RETURN_RULE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.Long" unsaved-value="null">
+            <column name="ID" sql-type="BIGINT"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="dateRange" type="com.tickets.common.util.DateRange">
+            <column name="DATE_RANGE" not-null="true" unique="false" sql-type="tdc_datatype::DateRange"/>
+        </property>
+        <property name="active" type="boolean">
+            <column name="ACTIVE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <property name="priority" type="int">
+            <column name="PRIORITY" not-null="true" unique="false" sql-type="INTEGER"/>
+        </property>
+    <class name="com.tickets.common.domain.Correspondence" table="CORRESPONDENCE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="contactDate" type="java.util.Date">
+            <column name="CONTACT_DATE" not-null="true" unique="false" sql-type="DATE"/>
+        </property>
+        <property name="closeDate" type="java.util.Date">
+            <column name="CLOSE_DATE" not-null="true" unique="false" sql-type="DATE"/>
+        </property>
+        <property name="followupDate" type="java.util.Date">
+            <column name="FOLLOWUP_DATE" not-null="true" unique="false" sql-type="DATE"/>
+        </property>
+        <property name="resolved" type="boolean">
+            <column name="RESOLVED" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+    <class name="com.tickets.common.trait.EnumeratedTrait" table="ENUMERATED_TRAIT" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="values" type="java.util.Collection">
+            <column name="VALUES" not-null="true" unique="false" sql-type="datatype::Collection"/>
+        </property>
+    <class name="com.tickets.account.domain.Account" table="ACCOUNT" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="traitMap" type="java.util.Map">
+            <column name="TRAIT_MAP" not-null="true" unique="false" sql-type="datatype::Map"/>
+        </property>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <set name="accountTypes" order-by="ACCOUNT_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="ACCOUNTTYPE_ACCOUNT_FKC">
+                <column name="ACCOUNT_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="$otherEnd.type.fullyQualifiedEntityImplementationName"/>
+        </set>
+        <set name="entries" order-by="ACCOUNT_FK" lazy="true" fetch="select" inverse="true">
+            <key foreign-key="ACCOUNT_ENTRY_ACCOUNT_FKC">
+                <column name="ACCOUNT_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.account.domain.AccountEntry"/>
+        </set>
+        <set name="serviceAgreements" order-by="ACCOUNT_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="SERVICE_AGREEMENT_ACCOUNT_FKC">
+                <column name="ACCOUNT_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.contract.domain.ServiceAgreement"/>
+        </set>
+        <set name="orders" order-by="ACCOUNT_FK" lazy="true" fetch="select" inverse="true">
+            <key foreign-key="ORDER_ACCOUNT_FKC">
+                <column name="ACCOUNT_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.order.domain.Order"/>
+        </set>
+        <many-to-one name="primaryOwner" class="com.tickets.patron.domain.Party" foreign-key="ACCOUNT_PRIMARY_OWNER_FKC" lazy="proxy" fetch="select">
+            <column name="PRIMARY_OWNER_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+        <many-to-one name="owners" class="com.tickets.patron.domain.Party" foreign-key="ACCOUNT_OWNERS_FKC" lazy="proxy" fetch="select">
+            <column name="OWNERS_FK" not-null="true" sql-type="CHARACTER VARYING(1024)"/>
+        </many-to-one>
+    <class name="com.tickets.contract.domain.ItemSlidingScaleCalculation" table="ITEM_SLIDING_SCALE_CALCULATION" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="feeScale" class="com.tickets.contract.domain.FeeScale" foreign-key="ABSTRACT_SLIDING_SCALE_CALCULA" lazy="proxy" fetch="select">
+            <column name="FEE_SCALE_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="code" type="java.lang.String">
+            <column name="CODE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="upperFeeCap" type="com.tickets.common.util.Money">
+            <column name="UPPER_FEE_CAP" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+        <property name="lowerFeeCap" type="com.tickets.common.util.Money">
+            <column name="LOWER_FEE_CAP" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+        <many-to-one name="feeCalculationType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" cascade="delete" foreign-key="ABSTRACT_FEE_CALCULATION_nullC" lazy="false" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.contract.domain.FeeScale" table="FEE_SCALE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <set name="feeSchedule" order-by="FEE_SCALE_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="FEE_SCALE_ENTRY_FEE_SCALE_FKC">
+                <column name="FEE_SCALE_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.contract.domain.FeeScaleEntry"/>
+        </set>
+    <class name="com.tickets.account.domain.Ledger" table="LEDGER" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="traitMap" type="java.util.Map">
+            <column name="TRAIT_MAP" not-null="true" unique="false" sql-type="datatype::Map"/>
+        </property>
+        <set name="accounts" order-by="LEDGER_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="ACCOUNT_LEDGER_FKC">
+                <column name="LEDGER_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.account.domain.Account"/>
+        </set>
+        <many-to-one name="owner" class="com.tickets.patron.domain.Organization" foreign-key="LEDGER_OWNER_FKC" lazy="proxy" fetch="select">
+            <column name="OWNER_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.contract.domain.FeeScaleEntry" table="FEE_SCALE_ENTRY" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.Long" unsaved-value="null">
+            <column name="ID" sql-type="BIGINT"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="range" type="com.tickets.common.util.Range">
+            <column name="RANGE" not-null="true" unique="false" sql-type="tdc_datatype::Range"/>
+        </property>
+        <property name="amount" type="com.tickets.common.util.Money">
+            <column name="AMOUNT" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+    <class name="com.tickets.common.trait.IntegerCharacteristic" table="INTEGER_CHARACTERISTIC" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="trait" class="com.tickets.common.trait.Trait" foreign-key="CHARACTERISTIC_TRAIT_FKC" lazy="proxy" fetch="select">
+            <column name="TRAIT_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+        <property name="value" type="java.lang.Integer">
+            <column name="VALUE" not-null="true" unique="false" sql-type="INTEGER"/>
+        </property>
+    <class name="com.tickets.fulfillment.domain.DispositionLineItem" table="DISPOSITION_LINE_ITEM" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="dateCreated" type="java.util.Date">
+            <column name="DATE_CREATED" not-null="true" unique="false" sql-type="DATE"/>
+        </property>
+        <property name="active" type="boolean">
+            <column name="ACTIVE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <many-to-one name="disposition" class="com.tickets.fulfillment.domain.Disposition" foreign-key="DISPOSITION_LINE_ITEM_DISPOSIT" lazy="proxy" fetch="select">
+            <column name="DISPOSITION_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.contract.domain.FixedCalculation" table="FIXED_CALCULATION" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="code" type="java.lang.String">
+            <column name="CODE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="upperFeeCap" type="com.tickets.common.util.Money">
+            <column name="UPPER_FEE_CAP" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+        <property name="lowerFeeCap" type="com.tickets.common.util.Money">
+            <column name="LOWER_FEE_CAP" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+        <many-to-one name="feeCalculationType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" cascade="delete" foreign-key="ABSTRACT_FEE_CALCULATION_nullC" lazy="false" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.account.domain.ExchangeRule" table="EXCHANGE_RULE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.Long" unsaved-value="null">
+            <column name="ID" sql-type="BIGINT"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="dateRange" type="com.tickets.common.util.DateRange">
+            <column name="DATE_RANGE" not-null="true" unique="false" sql-type="tdc_datatype::DateRange"/>
+        </property>
+        <property name="active" type="boolean">
+            <column name="ACTIVE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <property name="priority" type="int">
+            <column name="PRIORITY" not-null="true" unique="false" sql-type="INTEGER"/>
+        </property>
+    <class name="com.tickets.account.domain.PaymentRule" table="PAYMENT_RULE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.Long" unsaved-value="null">
+            <column name="ID" sql-type="BIGINT"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="dateRange" type="com.tickets.common.util.DateRange">
+            <column name="DATE_RANGE" not-null="true" unique="false" sql-type="tdc_datatype::DateRange"/>
+        </property>
+        <property name="active" type="boolean">
+            <column name="ACTIVE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <property name="priority" type="int">
+            <column name="PRIORITY" not-null="true" unique="false" sql-type="INTEGER"/>
+        </property>
+    <class name="com.tickets.common.trait.SelectionCharacteristic" table="SELECTION_CHARACTERISTIC" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="trait" class="com.tickets.common.trait.Trait" foreign-key="CHARACTERISTIC_TRAIT_FKC" lazy="proxy" fetch="select">
+            <column name="TRAIT_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+        <property name="values" type="java.util.Collection">
+            <column name="VALUES" not-null="true" unique="false" sql-type="datatype::Collection"/>
+        </property>
+        <property name="multiSelect" type="boolean">
+            <column name="MULTI_SELECT" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+    <class name="com.tickets.common.domain.DynamicBusinessRule" table="DYNAMIC_BUSINESS_RULE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+    <class name="com.tickets.common.domain.AbstractBusinessRule" table="ABSTRACT_BUSINESS_RULE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+    <class name="com.tickets.common.trait.TraitRegistrarEntry" table="TRAIT_REGISTRAR_ENTRY" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="classId" type="java.lang.String">
+            <column name="CLASS_ID" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="traits" type="java.util.Set">
+            <column name="TRAITS" not-null="true" unique="false" sql-type="datatype::Set"/>
+        </property>
+    <class name="com.tickets.common.domain.CreditCard" table="CREDIT_CARD" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="number" type="java.lang.String">
+            <column name="NUMBER" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="expirationMonth" type="java.lang.String">
+            <column name="EXPIRATION_MONTH" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="expirationYear" type="java.lang.String">
+            <column name="EXPIRATION_YEAR" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <many-to-one name="party" class="com.tickets.patron.domain.Party" foreign-key="CREDIT_CARD_PARTY_FKC" lazy="proxy" fetch="select">
+            <column name="PARTY_FK" not-null="true" sql-type="CHARACTER VARYING(1024)"/>
+        </many-to-one>
+        <many-to-one name="creditCardType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" cascade="delete" foreign-key="CREDIT_CARD_nullC" lazy="false" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.contract.domain.FeeTemplate" table="FEE_TEMPLATE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="code" type="java.lang.String">
+            <column name="CODE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="applicant" type="java.lang.String">
+            <column name="APPLICANT" not-null="true" unique="false" sql-type="com::tickets::patron::domain::Organization"/>
+        </property>
+        <property name="feeType" type="com.tickets.contract.domain.FeeType">
+            <column name="FEE_TYPE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="feeCalculationType" type="com.tickets.contract.domain.FeeCalculationType">
+            <column name="FEE_CALCULATION_TYPE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="validFrom" type="java.util.Date">
+            <column name="VALID_FROM" not-null="true" unique="false" sql-type="DATE"/>
+        </property>
+        <property name="validTo" type="java.util.Date">
+            <column name="VALID_TO" not-null="true" unique="false" sql-type="DATE"/>
+        </property>
+        <property name="enabled" type="boolean">
+            <column name="ENABLED" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+    <class name="com.tickets.payment.domain.CreditCardPaymentMethod" table="CREDIT_CARD_PAYMENT_METHOD" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.Long" unsaved-value="null">
+            <column name="ID" sql-type="BIGINT"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="creditCardType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" cascade="delete" foreign-key="CREDIT_CARD_PAYMENT_METHOD_nul" lazy="false" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.patron.domain.Person" table="PERSON" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="phonetics" type="java.lang.String">
+            <column name="PHONETICS" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="formattedName" type="java.lang.String">
+            <column name="FORMATTED_NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="formatOverride" type="boolean">
+            <column name="FORMAT_OVERRIDE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <property name="active" type="boolean">
+            <column name="ACTIVE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <set name="creditCards" order-by="PARTY_FK" lazy="true" fetch="select" inverse="true">
+            <key foreign-key="CREDIT_CARD_PARTY_FKC">
+                <column name="PARTY_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.common.domain.CreditCard"/>
+        </set>
+        <set name="contacts" order-by="PARTY_FK" lazy="true" fetch="select" inverse="true">
+            <key foreign-key="CONTACT_PARTY_FKC">
+                <column name="PARTY_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.common.domain.Contact"/>
+        </set>
+        <set name="notes" order-by="PARTY_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="CORRESPONDENCE_PARTY_FKC">
+                <column name="PARTY_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.common.domain.Correspondence"/>
+        </set>
+        <set name="linkedPatrons" order-by="PARTY_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="PATRON_LINK_PARTY_FKC">
+                <column name="PARTY_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.patron.domain.PatronLink"/>
+        </set>
+        <many-to-one name="subordinate" class="com.tickets.patron.domain.Party" foreign-key="PARTY_SUBORDINATE_FKC" lazy="proxy" fetch="select">
+            <column name="SUBORDINATE_FK" not-null="false" sql-type="CHARACTER VARYING(1024)"/>
+        </many-to-one>
+        <property name="traitMap" type="java.util.Map">
+            <column name="TRAIT_MAP" not-null="true" unique="false" sql-type="datatype::Map"/>
+        </property>
+        <property name="firstName" type="java.lang.String">
+            <column name="FIRST_NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(50)"/>
+        </property>
+        <property name="middleName" type="java.lang.String">
+            <column name="MIDDLE_NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="lastName" type="java.lang.String">
+            <column name="LAST_NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="formalSalutation" type="java.lang.String">
+            <column name="FORMAL_SALUTATION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="salutationOverride" type="boolean">
+            <column name="SALUTATION_OVERRIDE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <property name="namePrefix" type="java.lang.String">
+            <column name="NAME_PREFIX" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="nameSuffix" type="java.lang.String">
+            <column name="NAME_SUFFIX" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+    <class name="com.tickets.contract.domain.PriceSlidingScaleCalculation" table="PRICE_SLIDING_SCALE_CALCULATIO" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="feeScale" class="com.tickets.contract.domain.FeeScale" foreign-key="ABSTRACT_SLIDING_SCALE_CALCULA" lazy="proxy" fetch="select">
+            <column name="FEE_SCALE_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="code" type="java.lang.String">
+            <column name="CODE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="upperFeeCap" type="com.tickets.common.util.Money">
+            <column name="UPPER_FEE_CAP" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+        <property name="lowerFeeCap" type="com.tickets.common.util.Money">
+            <column name="LOWER_FEE_CAP" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+        <many-to-one name="feeCalculationType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" cascade="delete" foreign-key="ABSTRACT_FEE_CALCULATION_nullC" lazy="false" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.contract.domain.DynamicFeeCalculation" table="DYNAMIC_FEE_CALCULATION" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="code" type="java.lang.String">
+            <column name="CODE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="upperFeeCap" type="com.tickets.common.util.Money">
+            <column name="UPPER_FEE_CAP" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+        <property name="lowerFeeCap" type="com.tickets.common.util.Money">
+            <column name="LOWER_FEE_CAP" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+        <many-to-one name="feeCalculationType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" cascade="delete" foreign-key="ABSTRACT_FEE_CALCULATION_nullC" lazy="false" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.account.domain.TransferRule" table="TRANSFER_RULE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.Long" unsaved-value="null">
+            <column name="ID" sql-type="BIGINT"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="dateRange" type="com.tickets.common.util.DateRange">
+            <column name="DATE_RANGE" not-null="true" unique="false" sql-type="tdc_datatype::DateRange"/>
+        </property>
+        <property name="active" type="boolean">
+            <column name="ACTIVE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <property name="priority" type="int">
+            <column name="PRIORITY" not-null="true" unique="false" sql-type="INTEGER"/>
+        </property>
+    <class name="com.tickets.common.domain.Operator" table="OPERATOR" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="traitMap" type="java.util.Map">
+            <column name="TRAIT_MAP" not-null="true" unique="false" sql-type="datatype::Map"/>
+        </property>
+        <property name="firstName" type="java.lang.String">
+            <column name="FIRST_NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="lastName" type="java.lang.String">
+            <column name="LAST_NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="login" type="java.lang.String">
+            <column name="LOGIN" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="password" type="java.lang.String">
+            <column name="PASSWORD" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <many-to-one name="role" class="$otherEnd.type.fullyQualifiedEntityImplementationName" foreign-key="OPERATOR_nullC" lazy="proxy" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.order.domain.TransferTransaction" table="TRANSFER_TRANSACTION" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <set name="destinationAccount" order-by="TRANSFER_TRANSACTION_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="ACCOUNT_TRANSFER_TRANSACTION_F">
+                <column name="TRANSFER_TRANSACTION_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.account.domain.Account"/>
+        </set>
+    <class name="com.tickets.common.trait.CurrencyCharacteristic" table="CURRENCY_CHARACTERISTIC" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="trait" class="com.tickets.common.trait.Trait" foreign-key="CHARACTERISTIC_TRAIT_FKC" lazy="proxy" fetch="select">
+            <column name="TRAIT_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+        <property name="value" type="com.tickets.common.util.Money">
+            <column name="VALUE" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+    <class name="com.tickets.common.domain.AbstractItem" table="ABSTRACT_ITEM" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="amount" type="com.tickets.common.util.Money">
+            <column name="AMOUNT" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+    <class name="com.tickets.account.domain.AccountEntry" table="ACCOUNT_ENTRY" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="date" type="java.util.Date">
+            <column name="DATE" not-null="true" unique="false" sql-type="DATE"/>
+        </property>
+        <property name="amount" type="com.tickets.common.util.Money">
+            <column name="AMOUNT" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+        <property name="transaction" type="com.tickets.common.util.Money">
+            <column name="TRANSACTION" not-null="true" unique="false" sql-type="com::tickets::account::domain::AccountTransaction"/>
+        </property>
+        <many-to-one name="accountEntryType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" foreign-key="ACCOUNT_ENTRY_nullC" lazy="proxy" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+        <many-to-one name="account" class="com.tickets.account.domain.Account" foreign-key="ACCOUNT_ENTRY_ACCOUNT_FKC" lazy="proxy" fetch="select">
+            <column name="ACCOUNT_FK" not-null="true" sql-type="CHARACTER VARYING(1024)"/>
+        </many-to-one>
+    <class name="com.tickets.common.domain.Address" table="ADDRESS" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="rankingType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" foreign-key="CONTACT_nullC" lazy="proxy" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+        <many-to-one name="usageType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" foreign-key="CONTACT_nullC" lazy="proxy" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+        <many-to-one name="party" class="com.tickets.patron.domain.Party" foreign-key="CONTACT_PARTY_FKC" lazy="proxy" fetch="select">
+            <column name="PARTY_FK" not-null="true" sql-type="CHARACTER VARYING(1024)"/>
+        </many-to-one>
+        <property name="address1" type="java.lang.String">
+            <column name="ADDRESS1" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="address2" type="java.lang.String">
+            <column name="ADDRESS2" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="city" type="java.lang.String">
+            <column name="CITY" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="zipCode" type="java.lang.String">
+            <column name="ZIP_CODE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <set name="phoneNumbers" order-by="ADDRESS_FK" lazy="true" fetch="select" inverse="true">
+            <key foreign-key="PHONE_ADDRESS_FKC">
+                <column name="ADDRESS_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.common.domain.Phone"/>
+        </set>
+        <set name="labels" order-by="ADDRESS_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="LABEL_TYPE_ADDRESS_FKC">
+                <column name="ADDRESS_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.common.domain.LabelType"/>
+        </set>
+        <many-to-one name="country" class="$otherEnd.type.fullyQualifiedEntityImplementationName" foreign-key="ADDRESS_nullC" lazy="proxy" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+        <many-to-one name="state" class="$otherEnd.type.fullyQualifiedEntityImplementationName" foreign-key="ADDRESS_nullC" lazy="proxy" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.common.domain.LabelType" table="LABEL_TYPE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="active" type="boolean">
+            <column name="ACTIVE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <many-to-one name="template" class="com.tickets.common.domain.LabelTemplate" foreign-key="LABEL_TYPE_TEMPLATE_FKC" lazy="proxy" fetch="select">
+            <column name="TEMPLATE_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.payment.domain.Payment" table="PAYMENT" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="paymentType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" cascade="delete" foreign-key="PAYMENT_nullC" lazy="false" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.payment.domain.PurchaseOrder" table="PURCHASE_ORDER" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="poNumber" type="java.lang.String">
+            <column name="PO_NUMBER" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="contact" type="java.lang.String">
+            <column name="CONTACT" not-null="true" unique="false" sql-type="com::tickets::patron::domain::Person"/>
+        </property>
+    <class name="com.tickets.common.audit.Audit" table="AUDIT" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="modifiedBy" type="java.lang.String">
+            <column name="MODIFIED_BY" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="modifiedOn" type="java.util.Date">
+            <column name="MODIFIED_ON" not-null="true" unique="false" sql-type="DATE"/>
+        </property>
+        <many-to-one name="auditable" class="com.tickets.common.domain.DomainObject" foreign-key="AUDIT_AUDITABLE_FKC" lazy="proxy" fetch="select">
+            <column name="AUDITABLE_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+        <many-to-one name="auditType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" foreign-key="AUDIT_nullC" lazy="proxy" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.contract.domain.PaymentMethod" table="PAYMENT_METHOD" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.Long" unsaved-value="null">
+            <column name="ID" sql-type="BIGINT"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="code" type="java.lang.String">
+            <column name="CODE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <many-to-one name="paymentType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" cascade="delete" foreign-key="PAYMENT_METHOD_nullC" lazy="false" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.order.domain.Order" table="ORDER" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="dateCreated" type="java.util.Date">
+            <column name="DATE_CREATED" not-null="true" unique="false" sql-type="DATE"/>
+        </property>
+        <set name="lineItems" order-by="ORDER_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="LINEITEM_ORDER_FKC">
+                <column name="ORDER_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="$otherEnd.type.fullyQualifiedEntityImplementationName"/>
+        </set>
+        <many-to-one name="orderTransaction" class="com.tickets.order.domain.OrderTransaction" foreign-key="ORDER_ORDER_TRANSACTION_FKC" lazy="proxy" fetch="select">
+            <column name="ORDER_TRANSACTION_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+        <many-to-one name="account" class="com.tickets.account.domain.Account" foreign-key="ORDER_ACCOUNT_FKC" lazy="proxy" fetch="select">
+            <column name="ACCOUNT_FK" not-null="true" sql-type="CHARACTER VARYING(1024)"/>
+        </many-to-one>
+        <set name="merchant" order-by="ORDER_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="PARTY_ORDER_FKC">
+                <column name="ORDER_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.patron.domain.Party"/>
+        </set>
+    <class name="com.tickets.order.domain.OrderTransaction" table="ORDER_TRANSACTION" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="amount" type="com.tickets.common.util.Money">
+            <column name="AMOUNT" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+        <property name="dateCreated" type="com.tickets.common.util.DateTime">
+            <column name="DATE_CREATED" not-null="true" unique="false" sql-type="TIMESTAMP WITHOUT TIME ZONE"/>
+        </property>
+        <property name="operator" type="com.tickets.common.util.DateTime">
+            <column name="OPERATOR" not-null="true" unique="false" sql-type="com::tickets::common::domain::Operator"/>
+        </property>
+        <set name="lineItems" order-by="ORDER_TRANSACTION_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="LINEITEM_ORDER_TRANSACTION_FKC">
+                <column name="ORDER_TRANSACTION_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="$otherEnd.type.fullyQualifiedEntityImplementationName"/>
+        </set>
+        <many-to-one name="accountTransaction" class="com.tickets.account.domain.AccountTransaction" foreign-key="ORDER_TRANSACTION_ACCOUNT_TRAN" lazy="proxy" fetch="select">
+            <column name="ACCOUNT_TRANSACTION_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+        <set name="orderTransactions" order-by="ORDER_TRANSACTION_FK" lazy="true" fetch="select" inverse="true">
+            <key foreign-key="ORDER_TRANSACTION_ORDER_TRANSA">
+                <column name="ORDER_TRANSACTION_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.order.domain.OrderTransaction"/>
+        </set>
+        <many-to-one name="orderTransaction" class="com.tickets.order.domain.OrderTransaction" foreign-key="ORDER_TRANSACTION_ORDER_TRANSA" lazy="proxy" fetch="select">
+            <column name="ORDER_TRANSACTION_FK" not-null="true" sql-type="CHARACTER VARYING(1024)"/>
+        </many-to-one>
+        <many-to-one name="order" class="com.tickets.order.domain.Order" foreign-key="ORDER_TRANSACTION_ORDER_FKC" lazy="proxy" fetch="select">
+            <column name="ORDER_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+        <many-to-one name="merchant" class="com.tickets.patron.domain.Organization" foreign-key="ORDER_TRANSACTION_MERCHANT_FKC" lazy="proxy" fetch="select">
+            <column name="MERCHANT_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.payment.domain.CheckPayment" table="CHECK_PAYMENT" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="bankRoute" type="java.lang.String">
+            <column name="BANK_ROUTE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="bankAccount" type="java.lang.String">
+            <column name="BANK_ACCOUNT" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="bankName" type="java.lang.String">
+            <column name="BANK_NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="bankAccountName" type="java.lang.String">
+            <column name="BANK_ACCOUNT_NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+    <class name="com.tickets.payment.domain.CreditCardPayment" table="CREDIT_CARD_PAYMENT" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="creditCard" class="com.tickets.common.domain.CreditCard" cascade="delete" foreign-key="CREDIT_CARD_PAYMENT_CREDIT_CAR" lazy="false" fetch="select">
+            <column name="CREDIT_CARD_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.common.trait.StringLiteralCharacteristic" table="STRING_LITERAL_CHARACTERISTIC" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="trait" class="com.tickets.common.trait.Trait" foreign-key="CHARACTERISTIC_TRAIT_FKC" lazy="proxy" fetch="select">
+            <column name="TRAIT_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+        <property name="value" type="java.lang.String">
+            <column name="VALUE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="multiLine" type="boolean">
+            <column name="MULTI_LINE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+    <class name="com.tickets.common.trait.DatetimeCharacteristic" table="DATETIME_CHARACTERISTIC" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="trait" class="com.tickets.common.trait.Trait" foreign-key="CHARACTERISTIC_TRAIT_FKC" lazy="proxy" fetch="select">
+            <column name="TRAIT_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+        <property name="value" type="com.tickets.common.util.DateTime">
+            <column name="VALUE" not-null="true" unique="false" sql-type="TIMESTAMP WITHOUT TIME ZONE"/>
+        </property>
+    <class name="com.tickets.common.domain.Email" table="EMAIL" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="rankingType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" foreign-key="CONTACT_nullC" lazy="proxy" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+        <many-to-one name="usageType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" foreign-key="CONTACT_nullC" lazy="proxy" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+        <many-to-one name="party" class="com.tickets.patron.domain.Party" foreign-key="CONTACT_PARTY_FKC" lazy="proxy" fetch="select">
+            <column name="PARTY_FK" not-null="true" sql-type="CHARACTER VARYING(1024)"/>
+        </many-to-one>
+        <property name="emailAddress" type="java.lang.String">
+            <column name="EMAIL_ADDRESS" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+    <class name="com.tickets.fulfillment.domain.Disposition" table="DISPOSITION" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="code" type="java.lang.String">
+            <column name="CODE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <many-to-one name="dispositionType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" cascade="delete" foreign-key="DISPOSITION_nullC" lazy="false" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.patron.domain.Organization" table="ORGANIZATION" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="phonetics" type="java.lang.String">
+            <column name="PHONETICS" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="formattedName" type="java.lang.String">
+            <column name="FORMATTED_NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="formatOverride" type="boolean">
+            <column name="FORMAT_OVERRIDE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <property name="active" type="boolean">
+            <column name="ACTIVE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <set name="creditCards" order-by="PARTY_FK" lazy="true" fetch="select" inverse="true">
+            <key foreign-key="CREDIT_CARD_PARTY_FKC">
+                <column name="PARTY_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.common.domain.CreditCard"/>
+        </set>
+        <set name="contacts" order-by="PARTY_FK" lazy="true" fetch="select" inverse="true">
+            <key foreign-key="CONTACT_PARTY_FKC">
+                <column name="PARTY_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.common.domain.Contact"/>
+        </set>
+        <set name="notes" order-by="PARTY_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="CORRESPONDENCE_PARTY_FKC">
+                <column name="PARTY_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.common.domain.Correspondence"/>
+        </set>
+        <set name="linkedPatrons" order-by="PARTY_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="PATRON_LINK_PARTY_FKC">
+                <column name="PARTY_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.patron.domain.PatronLink"/>
+        </set>
+        <many-to-one name="subordinate" class="com.tickets.patron.domain.Party" foreign-key="PARTY_SUBORDINATE_FKC" lazy="proxy" fetch="select">
+            <column name="SUBORDINATE_FK" not-null="false" sql-type="CHARACTER VARYING(1024)"/>
+        </many-to-one>
+        <property name="traitMap" type="java.util.Map">
+            <column name="TRAIT_MAP" not-null="true" unique="false" sql-type="datatype::Map"/>
+        </property>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <set name="children" order-by="PARENT_FK" lazy="true" fetch="select" inverse="true">
+            <key foreign-key="ORGANIZATION_PARENT_FKC">
+                <column name="PARENT_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.patron.domain.Organization"/>
+        </set>
+        <many-to-one name="parent" class="com.tickets.patron.domain.Organization" foreign-key="ORGANIZATION_PARENT_FKC" lazy="proxy" fetch="select">
+            <column name="PARENT_FK" not-null="true" sql-type="CHARACTER VARYING(1024)"/>
+        </many-to-one>
+    <class name="com.tickets.patron.domain.PatronLink" table="PATRON_LINK" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="patron" class="com.tickets.patron.domain.Party" foreign-key="PATRON_LINK_PATRON_FKC" lazy="proxy" fetch="select">
+            <column name="PATRON_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.account.domain.AccountTransaction" table="ACCOUNT_TRANSACTION" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="posted" type="boolean">
+            <column name="POSTED" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <set name="accountEntries" order-by="ACCOUNT_TRANSACTION_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="ACCOUNT_ENTRY_ACCOUNT_TRANSACT">
+                <column name="ACCOUNT_TRANSACTION_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.account.domain.AccountEntry"/>
+        </set>
+        <many-to-one name="orderTransaction" class="com.tickets.order.domain.OrderTransaction" foreign-key="ACCOUNT_TRANSACTION_ORDER_TRAN" lazy="proxy" fetch="select">
+            <column name="ORDER_TRANSACTION_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.contract.domain.Fee" table="FEE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <set name="feeTemplates" order-by="FEE_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="FEE_TEMPLATE_FEE_FKC">
+                <column name="FEE_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.contract.domain.FeeTemplate"/>
+        </set>
+    <class name="com.tickets.account.domain.SaleRule" table="SALE_RULE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.Long" unsaved-value="null">
+            <column name="ID" sql-type="BIGINT"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="dateRange" type="com.tickets.common.util.DateRange">
+            <column name="DATE_RANGE" not-null="true" unique="false" sql-type="tdc_datatype::DateRange"/>
+        </property>
+        <property name="active" type="boolean">
+            <column name="ACTIVE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <property name="priority" type="int">
+            <column name="PRIORITY" not-null="true" unique="false" sql-type="INTEGER"/>
+        </property>
+    <class name="com.tickets.common.trait.Trait" table="TRAIT" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="required" type="boolean">
+            <column name="REQUIRED" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <set name="children" order-by="PARENT_FK" lazy="true" fetch="select" inverse="true">
+            <key foreign-key="TRAIT_PARENT_FKC">
+                <column name="PARENT_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.common.trait.Trait"/>
+        </set>
+        <many-to-one name="parent" class="com.tickets.common.trait.Trait" foreign-key="TRAIT_PARENT_FKC" lazy="proxy" fetch="select">
+            <column name="PARENT_FK" not-null="true" sql-type="CHARACTER VARYING(1024)"/>
+        </many-to-one>
+        <many-to-one name="traitType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" foreign-key="TRAIT_nullC" lazy="proxy" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    <class name="com.tickets.common.domain.Phone" table="PHONE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="rankingType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" foreign-key="CONTACT_nullC" lazy="proxy" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+        <many-to-one name="usageType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" foreign-key="CONTACT_nullC" lazy="proxy" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+        <many-to-one name="party" class="com.tickets.patron.domain.Party" foreign-key="CONTACT_PARTY_FKC" lazy="proxy" fetch="select">
+            <column name="PARTY_FK" not-null="true" sql-type="CHARACTER VARYING(1024)"/>
+        </many-to-one>
+        <property name="countryCode" type="java.lang.String">
+            <column name="COUNTRY_CODE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="areaCode" type="java.lang.String">
+            <column name="AREA_CODE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="localNumber" type="java.lang.String">
+            <column name="LOCAL_NUMBER" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="extension" type="java.lang.String">
+            <column name="EXTENSION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="phoneDisplay" type="java.lang.String">
+            <column name="PHONE_DISPLAY" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="telemarket" type="boolean">
+            <column name="TELEMARKET" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+        <many-to-one name="address" class="com.tickets.common.domain.Address" foreign-key="PHONE_ADDRESS_FKC" lazy="proxy" fetch="select">
+            <column name="ADDRESS_FK" not-null="true" sql-type="CHARACTER VARYING(1024)"/>
+        </many-to-one>
+    <class name="com.tickets.contract.domain.ServiceAgreement" table="SERVICE_AGREEMENT" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="validDuring" type="com.tickets.common.util.DateRange">
+            <column name="VALID_DURING" not-null="true" unique="false" sql-type="tdc_datatype::DateRange"/>
+        </property>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <set name="postingRules" order-by="SERVICE_AGREEMENT_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="POSTINGRULE_SERVICE_AGREEMENT_">
+                <column name="SERVICE_AGREEMENT_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="$otherEnd.type.fullyQualifiedEntityImplementationName"/>
+        </set>
+        <set name="fees" order-by="SERVICE_AGREEMENT_FK" lazy="true" fetch="select" inverse="false">
+            <key foreign-key="FEE_TEMPLATE_SERVICE_AGREEMENT">
+                <column name="SERVICE_AGREEMENT_FK" sql-type="CHARACTER VARYING(1024)"/>
+            </key>
+            <one-to-many class="com.tickets.contract.domain.FeeTemplate"/>
+        </set>
+    <class name="com.tickets.common.domain.LabelTemplate" table="LABEL_TEMPLATE" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="body" type="java.lang.String">
+            <column name="BODY" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="height" type="int">
+            <column name="HEIGHT" not-null="true" unique="false" sql-type="INTEGER"/>
+        </property>
+        <property name="width" type="int">
+            <column name="WIDTH" not-null="true" unique="false" sql-type="INTEGER"/>
+        </property>
+        <property name="font" type="java.lang.String">
+            <column name="FONT" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="fontSize" type="int">
+            <column name="FONT_SIZE" not-null="true" unique="false" sql-type="INTEGER"/>
+        </property>
+    <class name="com.tickets.common.trait.BooleanCharacteristic" table="BOOLEAN_CHARACTERISTIC" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <many-to-one name="trait" class="com.tickets.common.trait.Trait" foreign-key="CHARACTERISTIC_TRAIT_FKC" lazy="proxy" fetch="select">
+            <column name="TRAIT_FK" not-null="true" sql-type="CHARACTER VARYING(1024)" unique="true"/>
+        </many-to-one>
+        <property name="value" type="java.lang.Boolean">
+            <column name="VALUE" not-null="true" unique="false" sql-type="BOOLEAN"/>
+        </property>
+    <class name="com.tickets.contract.domain.PercentageCalculation" table="PERCENTAGE_CALCULATION" dynamic-insert="false" dynamic-update="false">
+        <id name="id" type="java.lang.String" unsaved-value="null">
+            <column name="ID" sql-type="CHARACTER VARYING(1024)"/>
+            <generator class="com.tickets.common.util.hibernate.IdGenerator">
+            </generator>
+        </id>
+        <property name="name" type="java.lang.String">
+            <column name="NAME" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="code" type="java.lang.String">
+            <column name="CODE" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="description" type="java.lang.String">
+            <column name="DESCRIPTION" not-null="true" unique="false" sql-type="CHARACTER VARYING(1024)"/>
+        </property>
+        <property name="upperFeeCap" type="com.tickets.common.util.Money">
+            <column name="UPPER_FEE_CAP" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+        <property name="lowerFeeCap" type="com.tickets.common.util.Money">
+            <column name="LOWER_FEE_CAP" not-null="true" unique="false" sql-type="DOUBLE PRECISION"/>
+        </property>
+        <many-to-one name="feeCalculationType" class="$otherEnd.type.fullyQualifiedEntityImplementationName" cascade="delete" foreign-key="ABSTRACT_FEE_CALCULATION_nullC" lazy="false" fetch="select">
+            <column name="$otherEnd.columnName" not-null="true" sql-type="$otherEnd.sqlType" unique="true"/>
+        </many-to-one>
+    </class>
+</hibernate-mapping>
diff --git a/xml/tests/testData/completion/hibernate-mapping-3.0.dtd b/xml/tests/testData/completion/hibernate-mapping-3.0.dtd
new file mode 100644
index 0000000..de7bf3d
--- /dev/null
+++ b/xml/tests/testData/completion/hibernate-mapping-3.0.dtd
@@ -0,0 +1,1036 @@
+<!-- Hibernate Mapping DTD.
+
+<!DOCTYPE hibernate-mapping PUBLIC 
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+An instance of this XML document may contain mappings for an arbitrary 
+number of classes. The class mappings may contain associations to classes
+mapped in the same document or in another document. No class may be 
+mapped more than once. Each document may also contain definitions of an
+arbitrary number of queries, and import declarations of arbitrary classes. 
+
+-->
+
+<!--
+	The document root.
+ -->
+
+<!ELEMENT hibernate-mapping (
+	meta*, 
+	typedef*, 
+	import*, 
+	(class|subclass|joined-subclass|union-subclass)*,
+    resultset*,
+	(query|sql-query)*,
+	filter-def*,
+    database-object*
+)>
+	<!ATTLIST hibernate-mapping schema CDATA #IMPLIED>									<!-- default: none -->
+	<!ATTLIST hibernate-mapping catalog CDATA #IMPLIED>									<!-- default: none -->
+	<!ATTLIST hibernate-mapping default-cascade CDATA "none">
+	<!ATTLIST hibernate-mapping default-access CDATA "property">
+	<!ATTLIST hibernate-mapping default-lazy (true|false) "true">
+	<!ATTLIST hibernate-mapping auto-import (true|false) "true">
+	<!ATTLIST hibernate-mapping package CDATA #IMPLIED>									<!-- default: none -->
+
+<!--
+	META element definition; used to assign meta-level attributes to a class
+	or property.  Is currently used by codegenerator as a placeholder for
+	values that is not directly related to OR mappings.
+-->
+<!ELEMENT meta (#PCDATA)>
+	<!ATTLIST meta attribute CDATA #REQUIRED>
+	<!ATTLIST meta inherit (true|false) "true">
+
+<!--
+	TYPEDEF element definition; defines a new name for a Hibernate type. May
+	contain parameters for parameterizable types.
+-->
+<!ELEMENT typedef (param*)>
+	<!ATTLIST typedef class CDATA #REQUIRED>
+	<!ATTLIST typedef name CDATA #REQUIRED>
+
+<!--
+	IMPORT element definition; an explicit query language "import"
+-->
+<!ELEMENT import EMPTY>
+	<!ATTLIST import class CDATA #REQUIRED>
+	<!ATTLIST import rename CDATA #IMPLIED>	<!-- default: unqualified class name -->
+
+<!--
+	Root entity mapping.  Poorly named as entities do not have to be represented by 
+	classes at all.  Mapped entities may be represented via different methodologies 
+	(POJO, Map, Dom4j).
+-->
+<!ELEMENT class (
+ 	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+    tuplizer*,
+	(id|composite-id),
+	discriminator?,
+	natural-id?,
+	(version|timestamp)?,
+	(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,
+	((join*,subclass*)|joined-subclass*|union-subclass*),
+	loader?,sql-insert?,sql-update?,sql-delete?,
+	filter*,
+    resultset*,
+	(query|sql-query)*
+)>
+	<!ATTLIST class entity-name CDATA #IMPLIED>
+	<!ATTLIST class name CDATA #IMPLIED>                            <!-- this is the class name -->
+	<!ATTLIST class proxy CDATA #IMPLIED>							<!-- default: no proxy interface -->
+	<!ATTLIST class lazy (true|false) #IMPLIED>
+	<!ATTLIST class table CDATA #IMPLIED>							<!-- default: unqualified classname -->
+	<!ATTLIST class schema CDATA #IMPLIED>							<!-- default: none -->
+	<!ATTLIST class catalog CDATA #IMPLIED>							<!-- default: none -->
+	<!ATTLIST class subselect CDATA #IMPLIED>
+	<!ATTLIST class discriminator-value CDATA #IMPLIED>				<!-- default: unqualified class name | none -->
+	<!ATTLIST class mutable (true|false) "true">
+	<!ATTLIST class abstract (true|false) #IMPLIED>
+	<!ATTLIST class polymorphism (implicit|explicit) "implicit">
+	<!ATTLIST class where CDATA #IMPLIED>							<!-- default: none -->
+	<!ATTLIST class persister CDATA #IMPLIED>
+	<!ATTLIST class dynamic-update (true|false) "false">
+	<!ATTLIST class dynamic-insert (true|false) "false">
+	<!ATTLIST class batch-size CDATA #IMPLIED>
+	<!ATTLIST class select-before-update (true|false) "false">
+	<!ATTLIST class optimistic-lock (none|version|dirty|all) "version">
+	<!ATTLIST class check CDATA #IMPLIED>							<!-- default: none -->
+	<!ATTLIST class rowid CDATA #IMPLIED>
+	<!ATTLIST class node CDATA #IMPLIED>
+
+<!--
+    TUPLIZER element; defines tuplizer to use for a component/entity for a given entity-mode
+-->
+<!ELEMENT tuplizer EMPTY>
+    <!ATTLIST tuplizer entity-mode (pojo|dom4j|dynamic-map) #IMPLIED>   <!-- entity mode for which tuplizer is in effect -->
+    <!ATTLIST tuplizer class CDATA #REQUIRED>                           <!-- the tuplizer class to use -->
+
+<!--
+	FILTER-DEF element; top-level filter definition.
+-->
+<!ELEMENT filter-def (#PCDATA|filter-param)*>
+	<!ATTLIST filter-def name CDATA #REQUIRED> <!-- The filter name -->
+	<!ATTLIST filter-def condition CDATA #IMPLIED>
+
+<!--
+	FILTER-PARAM element; qualifies parameters found within a FILTER-DEF
+	condition.
+-->
+<!ELEMENT filter-param EMPTY>
+	<!ATTLIST filter-param name CDATA #REQUIRED> <!-- The parameter name -->
+	<!ATTLIST filter-param type CDATA #REQUIRED> <!-- The parameter type -->
+
+<!--
+	FILTER element; used to apply a filter.
+-->
+<!ELEMENT filter (#PCDATA)>
+	<!ATTLIST filter name CDATA #REQUIRED>
+	<!ATTLIST filter condition CDATA #IMPLIED>
+
+
+<!-- A join allows some properties of a class to be persisted to a second table -->
+
+<!ELEMENT join ( 
+	subselect?,
+	comment?,
+	key,
+	(property|many-to-one|component|dynamic-component|any)*,
+	sql-insert?,sql-update?,sql-delete?
+)>
+	<!ATTLIST join table CDATA #REQUIRED>
+	<!ATTLIST join schema CDATA #IMPLIED>						<!-- default: none -->
+	<!ATTLIST join catalog CDATA #IMPLIED>						<!-- default: none -->
+	<!ATTLIST join subselect CDATA #IMPLIED>
+	<!ATTLIST join fetch (join|select) "join">
+	<!ATTLIST join inverse (true|false) "false">
+	<!ATTLIST join optional (true|false) "false">
+
+<!-- A natural-id element allows declaration of the unique business key -->
+
+<!ELEMENT natural-id ( (property|many-to-one|component|dynamic-component|any)* )>
+	<!ATTLIST natural-id mutable (true|false) "false">
+
+<!-- Declares the id type, column and generation algorithm for an entity class.
+If a name attribut is given, the id is exposed to the application through the 
+named property of the class. If not, the id is only exposed to the application 
+via Session.getIdentifier() -->
+
+<!ELEMENT id (meta*,column*,type?,generator?)>
+	<!ATTLIST id name CDATA #IMPLIED>
+	<!ATTLIST id node CDATA #IMPLIED>
+	<!ATTLIST id access CDATA #IMPLIED>
+	<!ATTLIST id column CDATA #IMPLIED>
+	<!ATTLIST id type CDATA #IMPLIED>
+	<!ATTLIST id length CDATA #IMPLIED>
+	<!ATTLIST id unsaved-value CDATA #IMPLIED>					<!-- any|none|null|undefined|0|-1|... -->
+
+<!-- A composite key may be modelled by a java class with a property for each 
+key column. The class must implement java.io.Serializable and reimplement equals() 
+and hashCode(). -->
+
+<!ELEMENT composite-id ( meta*, (key-property|key-many-to-one)+ )>
+	<!ATTLIST composite-id class CDATA #IMPLIED>
+	<!ATTLIST composite-id mapped (true|false) "false">
+	<!ATTLIST composite-id name CDATA #IMPLIED>
+	<!ATTLIST composite-id node CDATA #IMPLIED>
+	<!ATTLIST composite-id access CDATA #IMPLIED>
+	<!ATTLIST composite-id unsaved-value (undefined|any|none) "undefined"> 
+
+<!-- Polymorphic data requires a column holding a class discriminator value. This
+value is not directly exposed to the application. -->
+
+<!ELEMENT discriminator ((column|formula)?)>
+	<!ATTLIST discriminator column CDATA #IMPLIED>				<!-- default: "class"|none -->
+	<!ATTLIST discriminator formula CDATA #IMPLIED>
+	<!ATTLIST discriminator type CDATA "string">
+	<!ATTLIST discriminator not-null (true|false) "true">
+	<!ATTLIST discriminator length CDATA #IMPLIED>
+	<!ATTLIST discriminator force (true|false) "false">
+	<!ATTLIST discriminator insert (true|false) "true">
+	
+<!-- Versioned data requires a column holding a version number. This is exposed to the
+application through a property of the Java class. -->
+
+<!ELEMENT version (meta*,column*)>
+	<!ATTLIST version name CDATA #REQUIRED>
+	<!ATTLIST version node CDATA #IMPLIED>
+	<!ATTLIST version access CDATA #IMPLIED>
+	<!ATTLIST version column CDATA #IMPLIED>
+	<!ATTLIST version type CDATA "integer">
+	<!ATTLIST version unsaved-value (null|negative|undefined) "undefined">
+    <!ATTLIST version generated (never|always) "never">
+    <!ATTLIST version insert (true|false) #IMPLIED>
+
+<!ELEMENT timestamp (meta*)>
+	<!ATTLIST timestamp name CDATA #REQUIRED>
+	<!ATTLIST timestamp node CDATA #IMPLIED>
+	<!ATTLIST timestamp column CDATA #IMPLIED>
+	<!ATTLIST timestamp access CDATA #IMPLIED>
+	<!ATTLIST timestamp unsaved-value (null|undefined) "null">
+    <!ATTLIST timestamp source (vm|db) "vm">
+    <!ATTLIST timestamp generated (never|always) "never">
+
+
+<!--
+	Subclass declarations are nested beneath the root class declaration to achieve
+	polymorphic persistence with the table-per-hierarchy mapping strategy.
+
+	See the note on the class element regarding <pojo/> vs. @name usage...
+-->
+<!ELEMENT subclass (
+ 	meta*,
+    tuplizer*,
+	synchronize*,
+	(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|idbag|array|primitive-array)*,
+	join*, 
+	subclass*,
+	loader?,sql-insert?,sql-update?,sql-delete?,
+    resultset*,
+	(query|sql-query)*
+)>
+	<!ATTLIST subclass entity-name CDATA #IMPLIED>
+	<!ATTLIST subclass name CDATA #IMPLIED>
+	<!ATTLIST subclass proxy CDATA #IMPLIED>							<!-- default: no proxy interface -->
+	<!ATTLIST subclass discriminator-value CDATA #IMPLIED>				<!-- default: unqualified class name | none -->
+	<!ATTLIST subclass dynamic-update (true|false) "false">
+	<!ATTLIST subclass dynamic-insert (true|false) "false">
+	<!ATTLIST subclass select-before-update (true|false) "false">
+	<!ATTLIST subclass extends CDATA #IMPLIED>							<!-- default: empty when a toplevel, otherwise the nearest class definition -->
+	<!ATTLIST subclass lazy (true|false) #IMPLIED>
+	<!ATTLIST subclass abstract (true|false) #IMPLIED>
+	<!ATTLIST subclass persister CDATA #IMPLIED>
+	<!ATTLIST subclass batch-size CDATA #IMPLIED>
+	<!ATTLIST subclass node CDATA #IMPLIED>
+
+<!--
+	Joined subclasses are used for the normalized table-per-subclass mapping strategy
+
+	See the note on the class element regarding <pojo/> vs. @name usage...
+-->
+<!ELEMENT joined-subclass (
+	meta*,
+	subselect?,
+	synchronize*,
+	comment?,
+    tuplizer*,
+	key,
+	(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*, 
+	joined-subclass*,
+	loader?,sql-insert?,sql-update?,sql-delete?,
+    resultset*,
+	(query|sql-query)*
+)>
+	<!ATTLIST joined-subclass entity-name CDATA #IMPLIED>
+	<!ATTLIST joined-subclass name CDATA #IMPLIED>
+	<!ATTLIST joined-subclass proxy CDATA #IMPLIED>				 		<!-- default: no proxy interface -->
+	<!ATTLIST joined-subclass table CDATA #IMPLIED>				 		<!-- default: unqualified class name -->
+	<!ATTLIST joined-subclass schema CDATA #IMPLIED>
+	<!ATTLIST joined-subclass catalog CDATA #IMPLIED>
+	<!ATTLIST joined-subclass subselect CDATA #IMPLIED>
+	<!ATTLIST joined-subclass dynamic-update (true|false) "false">
+	<!ATTLIST joined-subclass dynamic-insert (true|false) "false">
+	<!ATTLIST joined-subclass select-before-update (true|false) "false">
+	<!ATTLIST joined-subclass extends CDATA #IMPLIED>			 		<!-- default: none when toplevel, otherwise the nearest class definition -->
+	<!ATTLIST joined-subclass lazy (true|false) #IMPLIED>
+	<!ATTLIST joined-subclass abstract (true|false) #IMPLIED>
+	<!ATTLIST joined-subclass persister CDATA #IMPLIED>
+	<!ATTLIST joined-subclass check CDATA #IMPLIED>				 		<!-- default: none -->
+	<!ATTLIST joined-subclass batch-size CDATA #IMPLIED>
+	<!ATTLIST joined-subclass node CDATA #IMPLIED>
+
+<!--
+	Union subclasses are used for the table-per-concrete-class mapping strategy
+
+	See the note on the class element regarding <pojo/> vs. @name usage...
+-->
+<!ELEMENT union-subclass (
+ 	meta*,
+	subselect?,
+	synchronize*,
+	comment?,
+    tuplizer*,
+	(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,
+	union-subclass*,
+	loader?,sql-insert?,sql-update?,sql-delete?,
+    resultset*,
+	(query|sql-query)*
+)>
+	<!ATTLIST union-subclass entity-name CDATA #IMPLIED>
+	<!ATTLIST union-subclass name CDATA #IMPLIED>
+	<!ATTLIST union-subclass proxy CDATA #IMPLIED>						<!-- default: no proxy interface -->
+	<!ATTLIST union-subclass table CDATA #IMPLIED>						<!-- default: unqualified class name -->
+	<!ATTLIST union-subclass schema CDATA #IMPLIED>
+	<!ATTLIST union-subclass catalog CDATA #IMPLIED>
+	<!ATTLIST union-subclass subselect CDATA #IMPLIED>
+	<!ATTLIST union-subclass dynamic-update (true|false) "false">
+	<!ATTLIST union-subclass dynamic-insert (true|false) "false">
+	<!ATTLIST union-subclass select-before-update (true|false) "false">
+	<!ATTLIST union-subclass extends CDATA #IMPLIED>					<!-- default: none when toplevel, otherwise the nearest class definition -->
+	<!ATTLIST union-subclass lazy (true|false) #IMPLIED>
+	<!ATTLIST union-subclass abstract (true|false) #IMPLIED>
+	<!ATTLIST union-subclass persister CDATA #IMPLIED>
+	<!ATTLIST union-subclass check CDATA #IMPLIED>						<!-- default: none -->
+	<!ATTLIST union-subclass batch-size CDATA #IMPLIED>
+	<!ATTLIST union-subclass node CDATA #IMPLIED>
+
+<!-- Property of an entity class or component, component-element, composite-id, etc. 
+JavaBeans style properties are mapped to table columns. -->
+
+<!ELEMENT property (meta*,(column|formula)*,type?)>
+	<!ATTLIST property name CDATA #REQUIRED>
+	<!ATTLIST property node CDATA #IMPLIED>
+	<!ATTLIST property access CDATA #IMPLIED>
+	<!ATTLIST property type CDATA #IMPLIED>
+	<!ATTLIST property column CDATA #IMPLIED>
+	<!ATTLIST property length CDATA #IMPLIED>
+	<!ATTLIST property precision CDATA #IMPLIED>
+	<!ATTLIST property scale CDATA #IMPLIED>
+	<!ATTLIST property not-null (true|false) #IMPLIED>
+	<!ATTLIST property unique (true|false) "false">
+	<!ATTLIST property unique-key CDATA #IMPLIED>
+	<!ATTLIST property index CDATA #IMPLIED>				<!-- include the columns spanned by this property in an index -->
+	<!ATTLIST property update (true|false) #IMPLIED>
+	<!ATTLIST property insert (true|false) #IMPLIED>
+	<!ATTLIST property optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST property formula CDATA #IMPLIED>
+	<!ATTLIST property lazy (true|false) "false">
+    <!ATTLIST property generated (never|insert|always) "never">
+
+<!-- Declares the type of the containing property (overrides an eventually existing type
+attribute of the property). May contain param elements to customize a ParametrizableType. -->
+<!ELEMENT type (param*)>
+	<!ATTLIST type name CDATA #REQUIRED>
+	
+<!-- Declares an association between two entities (Or from a component, component element,
+etc. to an entity). -->
+
+<!ELEMENT many-to-one (meta*,(column|formula)*)>
+	<!ATTLIST many-to-one name CDATA #REQUIRED>
+	<!ATTLIST many-to-one access CDATA #IMPLIED>
+	<!ATTLIST many-to-one class CDATA #IMPLIED>
+	<!ATTLIST many-to-one entity-name CDATA #IMPLIED>
+	<!ATTLIST many-to-one column CDATA #IMPLIED>
+	<!ATTLIST many-to-one not-null (true|false) #IMPLIED>
+	<!ATTLIST many-to-one unique (true|false) "false">
+	<!ATTLIST many-to-one unique-key CDATA #IMPLIED>
+	<!ATTLIST many-to-one index CDATA #IMPLIED>
+	<!ATTLIST many-to-one cascade CDATA #IMPLIED>
+	<!ATTLIST many-to-one outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST many-to-one fetch (join|select) #IMPLIED>
+	<!ATTLIST many-to-one update (true|false) "true">
+	<!ATTLIST many-to-one insert (true|false) "true">
+	<!ATTLIST many-to-one optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST many-to-one foreign-key CDATA #IMPLIED>
+	<!ATTLIST many-to-one property-ref CDATA #IMPLIED>
+	<!ATTLIST many-to-one formula CDATA #IMPLIED>
+	<!ATTLIST many-to-one lazy (false|proxy|no-proxy) #IMPLIED>
+	<!ATTLIST many-to-one not-found (exception|ignore) "exception">
+	<!ATTLIST many-to-one node CDATA #IMPLIED>
+	<!ATTLIST many-to-one embed-xml (true|false) "true">
+	
+<!-- Declares a one-to-one association between two entities (Or from a component, 
+component element, etc. to an entity). -->
+
+<!ELEMENT one-to-one (meta*,formula*)>
+	<!ATTLIST one-to-one name CDATA #REQUIRED>
+	<!ATTLIST one-to-one formula CDATA #IMPLIED>
+	<!ATTLIST one-to-one access CDATA #IMPLIED>
+	<!ATTLIST one-to-one class CDATA #IMPLIED>
+	<!ATTLIST one-to-one entity-name CDATA #IMPLIED>
+	<!ATTLIST one-to-one cascade CDATA #IMPLIED>
+	<!ATTLIST one-to-one outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST one-to-one fetch (join|select) #IMPLIED>
+	<!ATTLIST one-to-one constrained (true|false) "false">
+	<!ATTLIST one-to-one foreign-key CDATA #IMPLIED>
+	<!ATTLIST one-to-one property-ref CDATA #IMPLIED>
+	<!ATTLIST one-to-one lazy (false|proxy|no-proxy) #IMPLIED>
+	<!ATTLIST one-to-one node CDATA #IMPLIED>
+	<!ATTLIST one-to-one embed-xml (true|false) "true">
+	
+<!-- A property embedded in a composite identifier or map index (always not-null). -->
+
+<!ELEMENT key-property (meta*,column*,type?)>
+	<!ATTLIST key-property name CDATA #REQUIRED>
+	<!ATTLIST key-property access CDATA #IMPLIED>
+	<!ATTLIST key-property type CDATA #IMPLIED>
+	<!ATTLIST key-property column CDATA #IMPLIED>
+	<!ATTLIST key-property length CDATA #IMPLIED>
+	<!ATTLIST key-property node CDATA #IMPLIED>
+
+<!-- A many-to-one association embedded in a composite identifier or map index 
+(always not-null, never cascade). -->
+
+<!ELEMENT key-many-to-one (meta*,column*)>
+	<!ATTLIST key-many-to-one name CDATA #REQUIRED>
+	<!ATTLIST key-many-to-one access CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one class CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one entity-name CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one column CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one foreign-key CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one lazy (false|proxy) #IMPLIED>
+
+<!-- An "any" association is a polymorphic association to any table with
+the given identifier type. The first listed column is a VARCHAR column 
+holding the name of the class (for that row). -->
+
+<!ELEMENT any (meta*,meta-value*,column,column+)>
+	<!ATTLIST any id-type CDATA #REQUIRED>
+	<!ATTLIST any meta-type CDATA #IMPLIED>			 	<!--- default: Hibernate.STRING -->
+	<!ATTLIST any name CDATA #REQUIRED>
+	<!ATTLIST any access CDATA #IMPLIED>
+	<!ATTLIST any insert (true|false) "true">
+	<!ATTLIST any update (true|false) "true">
+	<!ATTLIST any cascade CDATA #IMPLIED>
+	<!ATTLIST any index CDATA #IMPLIED>					<!-- include the columns spanned by this association in an index -->
+	<!ATTLIST any optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST any lazy (true|false) "false">
+	<!ATTLIST any node CDATA #IMPLIED>
+	
+<!ELEMENT meta-value EMPTY>
+	<!ATTLIST meta-value value CDATA #REQUIRED>
+	<!ATTLIST meta-value class CDATA #REQUIRED>
+
+<!-- A component is a user-defined class, persisted along with its containing entity
+to the table of the entity class. JavaBeans style properties of the component are
+mapped to columns of the table of the containing entity. A null component reference
+is mapped to null values in all columns and vice versa. Components do not support
+shared reference semantics. -->
+
+<!ELEMENT component (
+	meta*,
+    tuplizer*,
+	parent?,
+	(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|array|primitive-array)*
+)>
+	<!ATTLIST component class CDATA #IMPLIED>
+	<!ATTLIST component name CDATA #REQUIRED>
+	<!ATTLIST component access CDATA #IMPLIED>
+	<!ATTLIST component unique (true|false) "false">
+	<!ATTLIST component update (true|false) "true">
+	<!ATTLIST component insert (true|false) "true">
+	<!ATTLIST component lazy (true|false) "false">
+	<!ATTLIST component optimistic-lock (true|false) "true">
+	<!ATTLIST component node CDATA #IMPLIED>
+	
+<!-- A dynamic-component maps columns of the database entity to a java.util.Map 
+at the Java level -->
+
+<!ELEMENT dynamic-component (
+	(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|array|primitive-array)*
+)>
+	<!ATTLIST dynamic-component name CDATA #REQUIRED>
+	<!ATTLIST dynamic-component access CDATA #IMPLIED>
+	<!ATTLIST dynamic-component unique (true|false) "false">
+	<!ATTLIST dynamic-component update (true|false) "true">
+	<!ATTLIST dynamic-component insert (true|false) "true">
+	<!ATTLIST dynamic-component optimistic-lock (true|false) "true">
+	<!ATTLIST dynamic-component node CDATA #IMPLIED>
+
+<!-- properties declares that the contained properties form an alternate key. The name
+attribute allows an alternate key to be used as the target of a property-ref. -->
+
+<!ELEMENT properties (
+	(property|many-to-one|component|dynamic-component)*
+)>
+	<!ATTLIST properties name CDATA #REQUIRED>
+	<!ATTLIST properties unique (true|false) "false">
+	<!ATTLIST properties insert (true|false) "true">
+	<!ATTLIST properties update (true|false) "true">
+	<!ATTLIST properties optimistic-lock (true|false) "true">
+	<!ATTLIST properties node CDATA #IMPLIED>
+	
+<!-- The parent element maps a property of the component class as a pointer back to
+the owning entity. -->
+
+<!ELEMENT parent EMPTY>
+	<!ATTLIST parent name CDATA #REQUIRED>
+
+<!-- Collection declarations nested inside a class declaration indicate a foreign key 
+relationship from the collection table to the enclosing class. -->
+
+<!ELEMENT map (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+	key, 
+	(map-key|composite-map-key|map-key-many-to-many|index|composite-index|index-many-to-many|index-many-to-any), 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST map name CDATA #REQUIRED>
+	<!ATTLIST map access CDATA #IMPLIED>
+	<!ATTLIST map table CDATA #IMPLIED>																<!-- default: name -->
+	<!ATTLIST map schema CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST map subselect CDATA #IMPLIED>
+	<!ATTLIST map catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST map lazy (true|false|extra) #IMPLIED>
+	<!ATTLIST map mutable (true|false) "true">
+	<!ATTLIST map inverse (true|false) "false">
+	<!ATTLIST map sort CDATA "unsorted">														 	<!-- unsorted|natural|"comparator class", default: unsorted -->
+	<!ATTLIST map cascade CDATA #IMPLIED>
+	<!ATTLIST map order-by CDATA #IMPLIED>													 		<!-- default: none -->
+	<!ATTLIST map where CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST map batch-size CDATA #IMPLIED>
+	<!ATTLIST map outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST map fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST map check CDATA #IMPLIED>																<!-- default: none -->	
+	<!ATTLIST map persister CDATA #IMPLIED>														
+	<!ATTLIST map collection-type CDATA #IMPLIED>	
+	<!ATTLIST map optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST map node CDATA #IMPLIED>
+	<!ATTLIST map embed-xml (true|false) "true">
+	
+<!ELEMENT set (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+	key, 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST set name CDATA #REQUIRED>
+	<!ATTLIST set access CDATA #IMPLIED>
+	<!ATTLIST set table CDATA #IMPLIED>																<!-- default: name -->
+	<!ATTLIST set schema CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST set catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST set subselect CDATA #IMPLIED>
+	<!ATTLIST set lazy (true|false|extra) #IMPLIED>
+	<!ATTLIST set sort CDATA "unsorted">														 	<!-- unsorted|natural|"comparator class" -->
+	<!ATTLIST set inverse (true|false) "false">
+	<!ATTLIST set mutable (true|false) "true">
+	<!ATTLIST set cascade CDATA #IMPLIED>
+	<!ATTLIST set order-by CDATA #IMPLIED>													 		<!-- default: none -->
+	<!ATTLIST set where CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST set batch-size CDATA #IMPLIED>
+	<!ATTLIST set outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST set fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST set persister CDATA #IMPLIED>	
+	<!ATTLIST set collection-type CDATA #IMPLIED>														
+	<!ATTLIST set check CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST set optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST set node CDATA #IMPLIED>
+	<!ATTLIST set embed-xml (true|false) "true">
+
+<!ELEMENT bag (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+	key, 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST bag name CDATA #REQUIRED>
+	<!ATTLIST bag access CDATA #IMPLIED>
+	<!ATTLIST bag table CDATA #IMPLIED>																<!-- default: name -->
+	<!ATTLIST bag schema CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST bag catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST bag subselect CDATA #IMPLIED>
+	<!ATTLIST bag lazy (true|false|extra) #IMPLIED>
+	<!ATTLIST bag inverse (true|false) "false">
+	<!ATTLIST bag mutable (true|false) "true">
+	<!ATTLIST bag cascade CDATA #IMPLIED>
+	<!ATTLIST bag order-by CDATA #IMPLIED>													 		<!-- default: none -->
+	<!ATTLIST bag where CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST bag batch-size CDATA #IMPLIED>
+	<!ATTLIST bag outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST bag fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST bag persister CDATA #IMPLIED>															
+	<!ATTLIST bag collection-type CDATA #IMPLIED>	
+	<!ATTLIST bag check CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST bag optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST bag node CDATA #IMPLIED>
+	<!ATTLIST bag embed-xml (true|false) "true">
+
+<!ELEMENT idbag (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+	collection-id,
+	key, 
+	(element|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST idbag name CDATA #REQUIRED>
+	<!ATTLIST idbag access CDATA #IMPLIED>
+	<!ATTLIST idbag table CDATA #IMPLIED>															<!-- default: name -->
+	<!ATTLIST idbag schema CDATA #IMPLIED>														 	<!-- default: none -->
+	<!ATTLIST idbag catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST idbag subselect CDATA #IMPLIED>
+	<!ATTLIST idbag lazy (true|false|extra) #IMPLIED>
+	<!ATTLIST idbag mutable (true|false) "true">
+	<!ATTLIST idbag cascade CDATA #IMPLIED>
+	<!ATTLIST idbag order-by CDATA #IMPLIED>													 	<!-- default: none -->
+	<!ATTLIST idbag where CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST idbag batch-size CDATA #IMPLIED>
+	<!ATTLIST idbag outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST idbag fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST idbag persister CDATA #IMPLIED>															
+	<!ATTLIST idbag collection-type CDATA #IMPLIED>
+	<!ATTLIST idbag check CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST idbag optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST idbag node CDATA #IMPLIED>
+	<!ATTLIST idbag embed-xml (true|false) "true">
+
+<!ELEMENT list (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+	key, 
+	(index|list-index), 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST list name CDATA #REQUIRED>
+	<!ATTLIST list access CDATA #IMPLIED>
+	<!ATTLIST list table CDATA #IMPLIED>														 	<!-- default: name -->
+	<!ATTLIST list schema CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST list catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST list subselect CDATA #IMPLIED>
+	<!ATTLIST list lazy (true|false|extra) #IMPLIED>
+	<!ATTLIST list inverse (true|false) "false">
+	<!ATTLIST list mutable (true|false) "true">
+	<!ATTLIST list cascade CDATA #IMPLIED>
+	<!ATTLIST list where CDATA #IMPLIED>														 	<!-- default: none -->
+	<!ATTLIST list batch-size CDATA #IMPLIED>
+	<!ATTLIST list outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST list fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST list persister CDATA #IMPLIED>																
+	<!ATTLIST list collection-type CDATA #IMPLIED>
+	<!ATTLIST list check CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST list optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST list node CDATA #IMPLIED>
+	<!ATTLIST list embed-xml (true|false) "true">
+
+<!ELEMENT array (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+	key, 
+	(index|list-index), 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?
+)>
+	<!ATTLIST array name CDATA #REQUIRED>
+	<!ATTLIST array access CDATA #IMPLIED>
+	<!ATTLIST array table CDATA #IMPLIED>															<!-- default: name -->
+	<!ATTLIST array schema CDATA #IMPLIED>													 		<!-- default: none -->
+	<!ATTLIST array catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST array subselect CDATA #IMPLIED>
+	<!ATTLIST array inverse (true|false) "false">
+	<!ATTLIST array mutable (true|false) "true">
+	<!ATTLIST array element-class CDATA #IMPLIED>
+	<!ATTLIST array cascade CDATA #IMPLIED>
+	<!ATTLIST array where CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST array batch-size CDATA #IMPLIED>
+	<!ATTLIST array outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST array fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST array persister CDATA #IMPLIED>															
+	<!ATTLIST array collection-type CDATA #IMPLIED>
+	<!ATTLIST array check CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST array optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST array node CDATA #IMPLIED>
+	<!ATTLIST array embed-xml (true|false) "true">
+
+<!ELEMENT primitive-array (
+	meta*, 
+	subselect?,
+	cache?, 
+	synchronize*,
+	comment?,
+	key, 
+	(index|list-index), 
+	element,
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?
+)>
+	<!ATTLIST primitive-array name CDATA #REQUIRED>
+	<!ATTLIST primitive-array access CDATA #IMPLIED>
+	<!ATTLIST primitive-array table CDATA #IMPLIED>									<!-- default: name -->
+	<!ATTLIST primitive-array schema CDATA #IMPLIED>								<!-- default: none -->
+	<!ATTLIST primitive-array catalog CDATA #IMPLIED>								<!-- default: none -->
+	<!ATTLIST primitive-array subselect CDATA #IMPLIED>
+	<!ATTLIST primitive-array mutable (true|false) "true">
+	<!ATTLIST primitive-array where CDATA #IMPLIED>									<!-- default: none -->
+	<!ATTLIST primitive-array batch-size CDATA #IMPLIED>
+	<!ATTLIST primitive-array outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST primitive-array fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST primitive-array persister CDATA #IMPLIED>																
+	<!ATTLIST primitive-array collection-type CDATA #IMPLIED>
+	<!ATTLIST primitive-array check CDATA #IMPLIED>									<!-- default: none -->
+	<!ATTLIST primitive-array optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST primitive-array node CDATA #IMPLIED>
+	<!ATTLIST primitive-array embed-xml (true|false) "true">
+
+<!-- Declares the element type of a collection of basic type -->
+
+<!ELEMENT element ( (column|formula)*, type? )>
+	<!ATTLIST element column CDATA #IMPLIED>
+	<!ATTLIST element node CDATA #IMPLIED>
+	<!ATTLIST element formula CDATA #IMPLIED>
+	<!ATTLIST element type CDATA #IMPLIED>
+	<!ATTLIST element length CDATA #IMPLIED>
+	<!ATTLIST element precision CDATA #IMPLIED>
+	<!ATTLIST element scale CDATA #IMPLIED>
+	<!ATTLIST element not-null (true|false) "false">
+	<!ATTLIST element unique (true|false) "false">
+
+<!-- One to many association. This tag declares the entity-class
+element type of a collection and specifies a one-to-many relational model -->
+
+<!ELEMENT one-to-many EMPTY>
+	<!ATTLIST one-to-many class CDATA #IMPLIED>
+	<!ATTLIST one-to-many not-found (exception|ignore) "exception">
+	<!ATTLIST one-to-many node CDATA #IMPLIED>
+	<!ATTLIST one-to-many embed-xml (true|false) "true">
+	<!ATTLIST one-to-many entity-name CDATA #IMPLIED>
+	<!-- No column declaration attributes required in this case. The primary
+	key column of the associated class is already mapped elsewhere.-->
+
+<!-- Many to many association. This tag declares the entity-class
+element type of a collection and specifies a many-to-many relational model -->
+
+<!ELEMENT many-to-many (meta*,(column|formula)*,filter*)>
+	<!ATTLIST many-to-many class CDATA #IMPLIED>
+	<!ATTLIST many-to-many node CDATA #IMPLIED>
+	<!ATTLIST many-to-many embed-xml (true|false) "true">
+	<!ATTLIST many-to-many entity-name CDATA #IMPLIED>
+	<!ATTLIST many-to-many column CDATA #IMPLIED>
+	<!ATTLIST many-to-many formula CDATA #IMPLIED>
+	<!ATTLIST many-to-many not-found (exception|ignore) "exception">
+	<!ATTLIST many-to-many outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST many-to-many fetch (join|select) #IMPLIED>
+	<!ATTLIST many-to-many lazy (false|proxy) #IMPLIED>
+	<!ATTLIST many-to-many foreign-key CDATA #IMPLIED>
+	<!ATTLIST many-to-many unique (true|false) "false">
+	<!ATTLIST many-to-many where CDATA #IMPLIED>
+	<!ATTLIST many-to-many order-by CDATA #IMPLIED>
+	<!ATTLIST many-to-many property-ref CDATA #IMPLIED>
+
+<!-- A composite element allows a collection to hold instances of an arbitrary 
+class, without the requirement of joining to an entity table. Composite elements
+have component semantics - no shared references and ad hoc null value semantics. 
+Composite elements may not hold nested collections. -->
+
+<!ELEMENT composite-element ( 
+	(meta*),
+	parent?,
+	(property|many-to-one|any|nested-composite-element)* 
+)>
+	<!ATTLIST composite-element class CDATA #REQUIRED>
+	<!ATTLIST composite-element node CDATA #IMPLIED>
+
+<!ELEMENT nested-composite-element ( 
+	parent?,
+	(property|many-to-one|any|nested-composite-element)* 
+)>
+	<!ATTLIST nested-composite-element class CDATA #REQUIRED>
+	<!ATTLIST nested-composite-element name CDATA #REQUIRED>
+	<!ATTLIST nested-composite-element access CDATA #IMPLIED>
+	<!ATTLIST nested-composite-element node CDATA #IMPLIED>
+	
+<!-- Declares the column name of a foreign key. -->
+
+<!ELEMENT key (column*)>
+	<!ATTLIST key column CDATA #IMPLIED>
+	<!ATTLIST key property-ref CDATA #IMPLIED>
+	<!ATTLIST key foreign-key CDATA #IMPLIED>
+	<!ATTLIST key on-delete (cascade|noaction) "noaction">
+	<!ATTLIST key not-null (true|false) #IMPLIED>
+	<!ATTLIST key update (true|false) #IMPLIED>
+	<!ATTLIST key unique (true|false) #IMPLIED>
+	
+<!-- Declares the type and column mapping for a collection index (array or
+list index, or key of a map). -->
+
+<!ELEMENT list-index (column?)>
+	<!ATTLIST list-index column CDATA #IMPLIED>
+	<!ATTLIST list-index base CDATA "0">
+
+<!ELEMENT map-key ((column|formula)*)>
+	<!ATTLIST map-key column CDATA #IMPLIED>
+	<!ATTLIST map-key formula CDATA #IMPLIED>
+	<!ATTLIST map-key type CDATA #REQUIRED>
+	<!ATTLIST map-key length CDATA #IMPLIED>
+	<!ATTLIST map-key node CDATA #IMPLIED>
+
+<!ELEMENT index (column*)>
+	<!ATTLIST index column CDATA #IMPLIED>
+	<!ATTLIST index type CDATA #IMPLIED>			<!-- required for maps -->
+	<!ATTLIST index length CDATA #IMPLIED>
+
+<!-- Many to many association mapped to the key of a map. ie. a map keyed
+on entities. -->
+
+<!ELEMENT map-key-many-to-many ((column|formula)*)>
+	<!ATTLIST map-key-many-to-many class CDATA #IMPLIED>
+	<!ATTLIST map-key-many-to-many entity-name CDATA #IMPLIED>
+	<!ATTLIST map-key-many-to-many column CDATA #IMPLIED>
+	<!ATTLIST map-key-many-to-many formula CDATA #IMPLIED>
+	<!ATTLIST map-key-many-to-many foreign-key CDATA #IMPLIED>
+
+<!ELEMENT index-many-to-many (column*)>
+	<!ATTLIST index-many-to-many class CDATA #REQUIRED>
+	<!ATTLIST index-many-to-many entity-name CDATA #IMPLIED>
+	<!ATTLIST index-many-to-many column CDATA #IMPLIED>
+	<!ATTLIST index-many-to-many foreign-key CDATA #IMPLIED>
+
+<!-- Composite index of a map ie. a map keyed on components. -->
+
+<!ELEMENT composite-map-key ( (key-property|key-many-to-one)+ )>
+	<!ATTLIST composite-map-key class CDATA #REQUIRED>
+
+<!ELEMENT composite-index ( (key-property|key-many-to-one)+ )>
+	<!ATTLIST composite-index class CDATA #REQUIRED>
+
+<!-- A "many to any" defines a polymorphic association to any table 
+with the given identifier type. The first listed column is a VARCHAR column 
+holding the name of the class (for that row). -->
+
+<!ELEMENT many-to-any (meta-value*,column, column+)>
+	<!ATTLIST many-to-any id-type CDATA #REQUIRED>
+	<!ATTLIST many-to-any meta-type CDATA #IMPLIED>			<!--- default: Hibernate.CLASS -->
+
+<!ELEMENT index-many-to-any (column, column+)>
+	<!ATTLIST index-many-to-any id-type CDATA #REQUIRED>
+	<!ATTLIST index-many-to-any meta-type CDATA #IMPLIED>	<!--- default: Hibernate.CLASS -->
+
+<!ELEMENT collection-id (meta*, column*, generator)>
+	<!ATTLIST collection-id column CDATA #REQUIRED>
+	<!ATTLIST collection-id type CDATA #REQUIRED>
+	<!ATTLIST collection-id length CDATA #IMPLIED>
+	
+<!-- Generators generate unique identifiers. The class attribute specifies a Java 
+class implementing an id generation algorithm. -->
+
+<!ELEMENT generator (param*)>
+	<!ATTLIST generator class CDATA #REQUIRED>
+<!ELEMENT param (#PCDATA)>
+	<!ATTLIST param name CDATA #REQUIRED>
+
+<!-- The column element is an alternative to column attributes and required for 
+mapping associations to classes with composite ids. -->
+
+<!ELEMENT column (comment?)>
+	<!ATTLIST column name CDATA #REQUIRED>
+	<!ATTLIST column length CDATA #IMPLIED>						<!-- default: 255 -->
+	<!ATTLIST column precision CDATA #IMPLIED>
+	<!ATTLIST column scale CDATA #IMPLIED>
+	<!ATTLIST column not-null (true|false) #IMPLIED>		 	<!-- default: false (except for id properties) -->
+	<!ATTLIST column unique (true|false) #IMPLIED>			 	<!-- default: false (except for id properties) -->
+	<!ATTLIST column unique-key CDATA #IMPLIED>					<!-- default: no unique key -->
+	<!ATTLIST column sql-type CDATA #IMPLIED>					<!-- override default column type for hibernate type -->
+	<!ATTLIST column index CDATA #IMPLIED>
+	<!ATTLIST column check CDATA #IMPLIED>						<!-- default: no check constraint -->
+    <!ATTLIST column default CDATA #IMPLIED>                    <!-- default: no default value -->
+
+<!-- The formula and subselect elements allow us to map derived properties and 
+entities. -->
+
+<!ELEMENT formula (#PCDATA)>
+<!ELEMENT subselect (#PCDATA)>
+
+<!-- The cache element enables caching of an entity class. -->
+<!ELEMENT cache EMPTY>
+	<!ATTLIST cache usage (read-only|read-write|nonstrict-read-write|transactional) #REQUIRED>				
+	<!ATTLIST cache region CDATA #IMPLIED>						<!-- default: class or collection role name -->
+	<!ATTLIST cache include (all|non-lazy) "all">
+
+<!-- The comment element allows definition of a database table or column comment. -->
+
+<!ELEMENT comment (#PCDATA)>
+
+<!-- The loader element allows specification of a named query to be used for fetching
+an entity or collection -->
+
+<!ELEMENT loader EMPTY>
+	<!ATTLIST loader query-ref CDATA #REQUIRED>
+
+<!-- The query element declares a named Hibernate query string -->
+
+<!ELEMENT query (#PCDATA|query-param)*>
+	<!ATTLIST query name CDATA #REQUIRED>
+	<!ATTLIST query flush-mode (auto|never|always) #IMPLIED>
+	<!ATTLIST query cacheable (true|false) "false">
+	<!ATTLIST query cache-region CDATA #IMPLIED>
+	<!ATTLIST query fetch-size CDATA #IMPLIED>
+	<!ATTLIST query timeout CDATA #IMPLIED>
+	<!ATTLIST query cache-mode (get|ignore|normal|put|refresh) #IMPLIED>
+    <!ATTLIST query read-only (true|false) #IMPLIED>
+    <!ATTLIST query comment CDATA #IMPLIED>
+
+<!-- The sql-query element declares a named SQL query string -->
+
+<!ELEMENT sql-query (#PCDATA|return-scalar|return|return-join|load-collection|synchronize|query-param)*>
+	<!ATTLIST sql-query name CDATA #REQUIRED>
+    <!ATTLIST sql-query resultset-ref CDATA #IMPLIED>
+	<!ATTLIST sql-query flush-mode (auto|never|always) #IMPLIED>
+	<!ATTLIST sql-query cacheable (true|false) "false">
+	<!ATTLIST sql-query cache-region CDATA #IMPLIED>
+	<!ATTLIST sql-query fetch-size CDATA #IMPLIED>
+	<!ATTLIST sql-query timeout CDATA #IMPLIED>
+	<!ATTLIST sql-query cache-mode (get|ignore|normal|put|refresh) #IMPLIED>
+    <!ATTLIST sql-query read-only (true|false) #IMPLIED>
+    <!ATTLIST sql-query comment CDATA #IMPLIED>
+	<!ATTLIST sql-query callable (true|false) "false">
+
+<!-- The query-param element is used only by tools that generate
+finder methods for named queries -->
+
+<!ELEMENT query-param EMPTY>
+	<!ATTLIST query-param name CDATA #REQUIRED>
+	<!ATTLIST query-param type CDATA #REQUIRED>
+
+<!-- The resultset element declares a named resultset mapping definition for SQL queries -->
+<!ELEMENT resultset (return-scalar|return|return-join|load-collection)*>
+	<!ATTLIST resultset name CDATA #REQUIRED>
+
+<!--
+	Defines a return component for a sql-query.  Alias refers to the alias
+	used in the actual sql query; lock-mode specifies the locking to be applied
+	when the query is executed.  The class, collection, and role attributes are mutually exclusive;
+	class refers to the class name of a "root entity" in the object result; collection refers
+	to a collection of a given class and is used to define custom sql to load that owned collection
+	and takes the form "ClassName.propertyName"; role refers to the property path for an eager fetch
+	and takes the form "owningAlias.propertyName"
+-->
+<!ELEMENT return (return-discriminator?,return-property)*>
+	<!ATTLIST return alias CDATA #IMPLIED>
+	<!ATTLIST return entity-name CDATA #IMPLIED>
+	<!ATTLIST return class CDATA #IMPLIED>
+	<!ATTLIST return lock-mode (none|read|upgrade|upgrade-nowait|write) "read">	
+
+<!ELEMENT return-property (return-column*)> 
+	<!ATTLIST return-property name CDATA #REQUIRED>
+	<!ATTLIST return-property column CDATA #IMPLIED>
+
+<!ELEMENT return-column EMPTY> 
+	<!ATTLIST return-column name CDATA #REQUIRED>
+
+<!ELEMENT return-discriminator EMPTY> 
+	<!ATTLIST return-discriminator column CDATA #REQUIRED>
+	
+<!ELEMENT return-join (return-property)*> 
+	<!ATTLIST return-join alias CDATA #REQUIRED>
+	<!ATTLIST return-join property CDATA #REQUIRED>
+	<!ATTLIST return-join lock-mode (none|read|upgrade|upgrade-nowait|write) "read">
+
+<!ELEMENT load-collection (return-property)*> 
+	<!ATTLIST load-collection alias CDATA #REQUIRED>
+	<!ATTLIST load-collection role CDATA #REQUIRED>
+	<!ATTLIST load-collection lock-mode (none|read|upgrade|upgrade-nowait|write) "read">
+
+<!ELEMENT return-scalar EMPTY>
+	<!ATTLIST return-scalar column CDATA #REQUIRED>
+	<!ATTLIST return-scalar type CDATA #IMPLIED>
+
+<!ELEMENT synchronize EMPTY>
+	<!ATTLIST synchronize table CDATA #REQUIRED>
+	
+<!-- custom sql operations -->
+<!ELEMENT sql-insert (#PCDATA)>
+	<!ATTLIST sql-insert callable (true|false) "false">
+	<!ATTLIST sql-insert check (none|rowcount|param) #IMPLIED>
+
+<!ELEMENT sql-update (#PCDATA)>
+	<!ATTLIST sql-update callable (true|false) "false">
+	<!ATTLIST sql-update check (none|rowcount|param) #IMPLIED>
+
+<!ELEMENT sql-delete (#PCDATA)>
+	<!ATTLIST sql-delete callable (true|false) "false">
+	<!ATTLIST sql-delete check (none|rowcount|param) #IMPLIED>
+
+<!ELEMENT sql-delete-all (#PCDATA)>
+	<!ATTLIST sql-delete-all callable (true|false) "false">
+	<!ATTLIST sql-delete-all check (none|rowcount|param) #IMPLIED>
+
+<!--
+    Element for defining "auxiliary" database objects.  Must be one of two forms:
+
+    #1 :
+        <database-object>
+            <definition class="CustomClassExtendingAuxiliaryObject"/>
+        </database-object>
+
+    #2 :
+        <database-object>
+            <create>CREATE OR REPLACE ....</create>
+            <drop>DROP ....</drop>
+        </database-object>
+-->
+<!ELEMENT database-object ( (definition|(create,drop)), dialect-scope* )>
+
+<!ELEMENT definition EMPTY>
+    <!ATTLIST definition class CDATA #REQUIRED>
+
+<!ELEMENT create (#PCDATA)>
+<!ELEMENT drop (#PCDATA)>
+
+<!--
+    dialect-scope element allows scoping auxiliary-objects to a particular
+    Hibernate dialect implementation.
+-->
+<!ELEMENT dialect-scope (#PCDATA)>
+    <!ATTLIST dialect-scope name CDATA #REQUIRED>
+
diff --git a/xml/tests/testData/completion/mule-management.xsd b/xml/tests/testData/completion/mule-management.xsd
new file mode 100644
index 0000000..71c5c45
--- /dev/null
+++ b/xml/tests/testData/completion/mule-management.xsd
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/management/2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:mule="http://www.mulesource.org/schema/mule/core/2.0"
+            xmlns:spring="http://www.springframework.org/schema/beans"
+            targetNamespace="http://www.mulesource.org/schema/mule/management/2.0" elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:import namespace="http://www.mulesource.org/schema/mule/core/2.0"
+                schemaLocation="mule.xsd" />
+    <xsd:import namespace="http://www.springframework.org/schema/beans"
+                schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"/>
+
+    <!-- JMX Agent-->
+    <xsd:element name="jmx-server" type="jmxServerType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="jmxServerType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType">
+                <xsd:sequence>
+                    <xsd:element name="connector-server" type="connectorServerType" minOccurs="0" />
+                    <xsd:element name="credentials" type="mule:mapType" minOccurs="0" />
+                </xsd:sequence>
+                <xsd:attribute name="server-ref" type="xsd:NMTOKEN"/>
+                <xsd:attribute name="locateServer" type="mule:substitutableBoolean" default="true" />
+                <xsd:attribute name="createServer" type="mule:substitutableBoolean" default="true" />
+                <xsd:attribute name="enableStatistics" type="mule:substitutableBoolean" default="true" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="connectorServerType">
+        <xsd:attribute name="url" type="xsd:string" use="required" />
+        <xsd:attribute name="rebind" type="mule:substitutableBoolean" use="optional" default="true" />
+    </xsd:complexType>
+
+    <!-- JMX Adaptors -->
+    <xsd:element name="jmx-mx4j-adaptor" type="jmxMx4jAdaptorType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="jmxMx4jAdaptorType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType">
+                <xsd:sequence>
+                    <xsd:element name="socketFactoryProperties" type="mule:mapType" minOccurs="0" />
+                </xsd:sequence>
+                <xsd:attribute name="jmxAdaptorUrl" type="xsd:string" />
+                <xsd:attribute name="login" type="xsd:string" />
+                <xsd:attribute name="password" type="xsd:string" />
+                <xsd:attribute name="authenticationMethod" default="basic">
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="none" />
+                            <xsd:enumeration value="basic" />
+                            <xsd:enumeration value="digest" />
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="cacheXsl" type="xsd:string" default="true" />
+                <xsd:attribute name="xslFilePath" type="xsd:string" />
+                <xsd:attribute name="pathInJar" type="xsd:string" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--  JMX Agents -->
+
+    <!-- Rmi Registry Agent -->
+    <xsd:element name="rmi-server" type="rmiServerTyper" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="rmiServerTyper">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType">
+                <xsd:attribute name="serverUri" type="xsd:string" />
+                <xsd:attribute name="createRegistry" type="mule:substitutableBoolean" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="jmx-log4j" type="jmxLog4jType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="jmxLog4jType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType" />
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="jmx-default-config" type="jmxDefaultConfigType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="jmxDefaultConfigType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType">
+                <xsd:sequence>
+                    <xsd:element name="credentials" type="mule:mapType" minOccurs="0" />
+                </xsd:sequence>
+                <xsd:attribute name="registerMx4jAdapter" type="mule:substitutableBoolean" />
+                <xsd:attribute name="host" type="xsd:string" />
+                <xsd:attribute name="port" type="mule:substitutablePortNumber" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- JMX Notifications -->
+
+    <xsd:complexType name="notificationLoggerAgentType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType">
+                <xsd:attribute name="ignoreManagerNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreModelNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreComponentNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreConnectionNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreSecurityNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreManagementNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreCustomNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreAdminNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreMessageNotifications" type="mule:substitutableBoolean" default="false"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="jmx-notifications" type="jmxNotificationType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="jmxNotificationType">
+        <xsd:complexContent>
+            <xsd:extension base="notificationLoggerAgentType" />
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="log4j-notifications" type="log4jNotificationType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="log4jNotificationType">
+        <xsd:complexContent>
+            <xsd:extension base="notificationLoggerAgentType">
+                <xsd:sequence>
+                    <xsd:element name="level-mapping" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:complexType>
+                            <xsd:attribute name="severity" type="serveritySimpleType" default="INFO" />
+                            <xsd:attribute name="eventId" type="xsd:string" use="required" />
+                        </xsd:complexType>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="logName" type="xsd:string" />
+                <xsd:attribute name="logConfigFile" type="xsd:string" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="chainsaw-notifications" type="chainsawNotificationType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="chainsawNotificationType">
+        <xsd:complexContent>
+            <xsd:extension base="notificationLoggerAgentType">
+                <xsd:sequence>
+                    <xsd:element name="level-mapping" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:complexType>
+                            <xsd:attribute name="severity" type="serveritySimpleType" default="INFO" />
+                            <xsd:attribute name="eventId" type="xsd:string" use="required" />
+                        </xsd:complexType>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="chainsawHost" type="xsd:string" use="required" />
+                <xsd:attribute name="chainsawPort" type="mule:substitutablePortNumber" use="required" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:simpleType name="serveritySimpleType">
+        <xsd:restriction base="xsd:NMTOKEN">
+            <xsd:enumeration value="DEBUG" />
+            <xsd:enumeration value="INFO" />
+            <xsd:enumeration value="WARN" />
+            <xsd:enumeration value="ERROR" />
+            <xsd:enumeration value="FATAL" />
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <xsd:element name="publish-notifications" type="publishNotificationType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="publishNotificationType">
+        <xsd:complexContent>
+            <xsd:extension base="notificationLoggerAgentType">
+                <xsd:attribute name="endpointAddress" type="xsd:string" use="required" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="yourkit-profiler" substitutionGroup="mule:abstract-extension"/>
+
+    <xsd:element name="custom-agent" type="customAgentType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="customAgentType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="xsd:NMTOKEN" use="required"/>
+                <xsd:attribute name="name" type="mule:substitutableName" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Identifies the agent in the registry.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/completion/mule.xsd b/xml/tests/testData/completion/mule.xsd
new file mode 100644
index 0000000..595bd71
--- /dev/null
+++ b/xml/tests/testData/completion/mule.xsd
@@ -0,0 +1,3827 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/core/2.0"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:spring="http://www.springframework.org/schema/beans"
+            xmlns:spring-context="http://www.springframework.org/schema/context"
+            targetNamespace="http://www.mulesource.org/schema/mule/core/2.0"
+            attributeFormDefault="unqualified"
+            elementFormDefault="qualified">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+    <xsd:import namespace="http://www.springframework.org/schema/beans"
+                schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"/>
+    <xsd:import namespace="http://www.springframework.org/schema/context"
+                schemaLocation="http://www.springframework.org/schema/context/spring-context-2.5.xsd"/>
+
+    <!--==============================================================-->
+    <!--   Structure                                                  -->
+    <!--==============================================================-->
+
+    <!-- This defines the structure in abstract terms (except for a few simple/unique things like
+         global properties).  We then provide some implementations below.  Other modules
+         can provide other implementations. -->
+
+    <xsd:element name="mule" type="muleType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Either the root element of a Mule configuration,
+                or a "top-level" element in a Spring configuration,
+                that contains further Mule elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="muleType">
+        <xsd:sequence>
+            <xsd:element name="description" type="descriptionType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        This can hold any kind of documentation consistent with the overall XML format).
+                        It is intended to be "human readable" only and is not used by the system.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="springRootElements"/>
+                <xsd:group ref="muleRootElements"/>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:group name="springRootElements">
+        <xsd:choice>
+            <xsd:element ref="spring:beans">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Allow embedding of further spring documents.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="spring:bean">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        We support direct use of spring beans via this tag.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="spring-context:property-placeholder">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        We support direct use of property placeholders via this tag.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:group name="muleRootElements">
+        <xsd:choice>
+            <xsd:element name="global-property" type="globalPropertyType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        An global property is a named string.
+                        It can be used inserted in most attribute values using the ${...} syntax.
+                        So the attribute value "${foo}" would be replaced by the value associated with
+                        the property named "foo".
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="configuration" type="configurationType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Defaults and general settings for the entire Mule system.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="notifications" type="notificationManagerType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Register listeners for notifications
+                        and associate interfaces with particular events.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-extension"/>
+            <xsd:element ref="abstract-security-manager"/>
+            <xsd:element ref="abstract-transaction-manager"/>
+            <xsd:element ref="abstract-connector"/>
+            <xsd:element ref="abstract-global-endpoint"/>
+            <xsd:element ref="abstract-transformer"/>
+            <xsd:element ref="abstract-filter"/>
+            <xsd:element ref="abstract-model"/>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:complexType name="descriptionType">
+        <xsd:complexContent mixed="true">
+            <xsd:extension base="xsd:anyType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-extension" abstract="true" type="abstractExtensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for arbitrary extensions as children of the mule element.
+                Other transports and modules may extend this if they need to add global
+                elements to the configuration (but consider the more specific elements
+                like abstract-connector first).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractExtensionType"/>
+
+    <xsd:element name="abstract-connector" abstract="true" type="abstractConnectorType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for connector elements.
+                Connector elements allow properties to be configured across all endpoints that
+                use the same transport.
+                If multiple connectors are defined for the same transport then each endpoint
+                must name which connector is being used.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractConnectorType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the connector so that other elements can reference it.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-global-endpoint" abstract="true" type="abstractGlobalEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for global endpoint elements.
+                Global endpoints are named templates that allow us to define an endpoint once
+                and refer to it in several places.
+                Currently the same template is used for both inbound and outbound endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractGlobalEndpointType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the endpoint so that other elements can reference it.
+                    This name can also be referenced in MuleClient.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-inbound-endpoint" abstract="true" type="abstractInboundEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for inbound endpoint elements.
+                Inbound endpoints receive messages from the underlying transport.
+                The message payload is then delivered to the component for processing.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInboundEndpointType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the inbound endpoint in the registry, but is of relatively little use
+                    - it cannot be referred to from MuleClient, for example.
+                    For more useful aliases, use global endpoints.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-outbound-endpoint" abstract="true" type="abstractOutboundEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for outbound endpoint elements.
+                Outbound endpoints dispatch messages to the underlying transport.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractOutboundEndpointType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the outbound endpoint in the registry, but is of relatively little use
+                    - it cannot be referred to from MuleClient, for example.
+                    For more useful aliases, use global endpoints.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-transformer" abstract="true" type="abstractTransformerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transformer elements.
+                Transformers convert message payloads.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransformerType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the transformer so that other elements can reference it.
+                    Required if the transformer is defined at the global level.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="returnClass" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class of the message generated by the transformer.
+                    This is used if transformers are auto-selected
+                    (which is somewhat incomplete at the moment?).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="ignoreBadInput" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Many transformers only accept certain classes.
+                    Such transformers are never called with inappropriate input
+                    (whatever the value of this attribute).
+                    If a transformer forms part of a chain and cannot accept the current message class,
+                    then this flag controls whether the remaining part of the chain is evaluated.
+                    If true, the next transformer is called.
+                    If false the chain ends, keeping the result generated up to that point.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="globalPropertyType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the property.
+                    This is used inside ${...}.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="value" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The value of the property.
+                    This replaces each occurence of ${...}.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- seemed pointless making these simple container types abstract -->
+    <xsd:complexType name="inboundCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-catch-all-strategy" minOccurs="0"/>
+            <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-inbound-router" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-catch-all-strategy" abstract="true" type="abstractCatchAllStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for catch-all strategy elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractCatchAllStrategyType"/>
+
+    <xsd:element name="abstract-inbound-router" abstract="true" type="abstractInboundRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for inbound router elements.
+                Inbound routers control how incoming messages are handled.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInboundRouterType"/>
+
+    <xsd:element name="abstract-filter" abstract="true" type="abstractFilterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for filter elements.
+                Filters are used to make decisions within the Mule framework.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractFilterType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the filter so that other elements can reference it.
+                    Required if the filter is defined at the global level.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="not" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Inverts the filter's condition.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="outboundCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-catch-all-strategy" minOccurs="0"/>
+            <xsd:element ref="abstract-outbound-router" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="matchAll" type="substitutableBoolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, the output message will be sent to all routers, otherwise only
+                    the first matching router is used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-outbound-router" abstract="true" type="abstractOutboundRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for outbound router elements.
+                Outbound routers control how outgoing messages are delivered to the outbound endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractOutboundRouterType"/>
+
+    <xsd:element name="abstract-transaction-manager" abstract="true" type="abstractTransactionManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transaction manager elements.
+                Transaction managers are used to co-ordinate transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransactionManagerType"/>
+
+    <xsd:complexType name="configurationType">
+        <xsd:sequence>
+            <xsd:element name="default-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default threading profile,
+                        used by components and by endpoints for dispatching and receiving
+                        if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-dispatcher-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default dispatching threading profile, modifies the default-threading-profile
+                        values and is used by endpoints for dispatching
+                        if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-receiver-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default receiving threading profile, modifies the default-threading-profile
+                        values and is used by endpoints for receiving
+                        if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-component-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default component threading profile, modifies the default-threading-profile
+                        values and is used if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="defaultSynchronousEndpoints" type="substitutableBoolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true then connections to endpoints will wait for a response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="defaultRemoteSync" type="substitutableBoolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true then connections to endpoints will wait for a response from the remote service.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="defaultSynchronousEventTimeout" type="xsd:string" default="3000">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The default period (ms) to wait for a synchronous response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="defaultTransactionTimeout" type="xsd:string" default="5000">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The default timeout for transactions,
+                    used if no more specific configuration is given.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="notificationManagerType">
+        <xsd:sequence>
+            <xsd:element name="notification" type="defineNotificationType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Associate an event with an interface.
+                        Listeners which implement the interface will receive instances of the event.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="disable-notification" type="disableNotificationType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Block the association of an event with a particular interface.
+                        This filters events after the association with a particular interface
+                        (and so takes precedence).
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="notification-listener" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Register a bean as a listener with the notification system.
+                        Events are dispatched by reflection - the listener will receive all events
+                        associated with any interfaces it implements.
+                        The relationship between interfaces and events is configured by the
+                        notification and disable-notification elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                    <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The bean that will receive notifications.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="subscription" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                An optional string that is compared with the event's resource identifier.
+                                Only events with matching identifiers will be sent.
+                                If no value is given, all events are sent.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="dynamic" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If the notification manager is dynamic then programatic updates to the manager
+                    (ie via Java code) will affect all messages.
+                    Otherwise, some parts of the system may cache state for
+                    efficiency and so not generate newly enabled notifications.
+                    The default value is false.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="defineNotificationType">
+        <xsd:attribute name="event-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class associated with a notification event that will be delivered to the interface.
+                    This can be used instead of the event attribute to specify a custom class.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="event" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The notification event to deliver.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface (class name) that will receive the notification event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface that will receive the notification event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="disableNotificationType">
+        <xsd:attribute name="event-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class associated with an event that will no longer be delivered to any interface.
+                    This can be used instead of the event attribute to specify a custom class.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="event" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The event to not deliver.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface (class name) that will no longer receive an event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface that will no longer receive an event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+
+    <xsd:simpleType name="notificationTypes">
+        <xsd:annotation>
+            <xsd:documentation>
+                The interface that will no longer receive an event.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:NMTOKEN">
+            <xsd:enumeration value="MANAGER"/>
+            <xsd:enumeration value="MODEL"/>
+            <xsd:enumeration value="SERVICE"/>
+            <xsd:enumeration value="SECURITY"/>
+            <xsd:enumeration value="MESSAGE"/>
+            <xsd:enumeration value="MANAGEMENT"/>
+            <xsd:enumeration value="CONNECTION"/>
+            <xsd:enumeration value="REGISTRY"/>
+            <xsd:enumeration value="CUSTOM"/>
+            <xsd:enumeration value="EXCEPTION"/>
+            <xsd:enumeration value="TRANSACTION"/>
+            <xsd:enumeration value="ROUTING"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <!--==============================================================-->
+    <!-- Models                                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-model" abstract="true" type="abstractModelType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for model elements.
+                A model provides basic settings and processing for all the services it contains.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractModelType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-exception-strategy" minOccurs="0"/>
+            <xsd:group ref="entryPointResolvers"/>
+            <xsd:element ref="abstract-service" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="name" type="nonBlankString">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name used to identify this model.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="seda-model" type="sedaModelType" substitutionGroup="abstract-model">
+        <xsd:annotation>
+            <xsd:documentation>
+                A SEDA (Staged Event Drivern Architecture) model has separate threads and
+                queues for each component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="sedaModelType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractModelType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-queue-profile" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="inherit" type="xsd:boolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If true then this model element is an extension of a previous model
+                            element with the same name.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="model" type="defaultModelType" substitutionGroup="abstract-model">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default model is a SEDA model.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="defaultModelType">
+        <xsd:complexContent>
+            <xsd:extension base="sedaModelType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Model elements -->
+
+    <xsd:element name="abstract-queue-profile" abstract="true" type="abstractQueueProfileType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for queue profile elements.
+                A queue profile controls how messages are queued before being processed.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractQueueProfileType"/>
+
+    <!-- to give a cleaner config we allow either a set or an individual entry (but not both).-->
+    <xsd:group name="entryPointResolvers">
+        <xsd:choice>
+            <xsd:element ref="abstract-entry-point-resolver-set" minOccurs="0"/>
+            <!-- we could allow many of these, but it looks ugly -->
+            <xsd:element ref="abstract-entry-point-resolver" minOccurs="0"/>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:element name="abstract-entry-point-resolver-set" abstract="true" type="abstractEntryPointResolverSetType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for entry point resolver set elements.
+                These combine a group of entry point resolvers, trying them in turn until one succeeds.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractEntryPointResolverSetType"/>
+
+    <xsd:element name="legacy-entry-point-resolver-set" type="extensibleEntryPointResolverSet"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                An extensible set of entry point resolvers (which determine how a message is passed to a component in
+                Java)
+                that already contains resolvers to implement the standard logic.
+                This is already provided by default and is only needed explicitly if
+                it will be extended with other entry point resolvers.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="entry-point-resolver-set" type="extensibleEntryPointResolverSet"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                An extensible set of entry point resolvers.
+                These determine how a message is passed to a component in Java.
+                Each entry point resolver is tried in turn until one succeeds in delivering the messge to the component.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="extensibleEntryPointResolverSet">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverSetType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-entry-point-resolver" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-entry-point-resolver-set" type="customEntryPointResolverSetType"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom entry point resolver set.
+                This allows user-supplied code to determine how a message is passed to a component in Java.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customEntryPointResolverSetType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverSetType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the EntryPointResolverSet interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-entry-point-resolver" abstract="true" type="abstractEntryPointResolverType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an entry point resolver element.
+                Entry point resolvers define how payloads are delivered to Java code
+                (ie they choose the method to call).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="callable-entry-point-resolver" type="abstractEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                An entry point resolver for components that implement the Callable interface.
+                This passes a MuleEventContext to the component.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+                This element can also be used directly or as part of a set of resolvers;
+                the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractEntryPointResolverType"/>
+
+    <xsd:element name="custom-entry-point-resolver" type="customEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom entry point resolver.
+                This allows user-supplied code to determine how a message is passed to a component in Java.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+                This element can also be used directly or as part of a set of resolvers;
+                the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the EntryPointResolver interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverType">
+                <xsd:attribute name="transformFirst" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Should the message be transformer before being delivered to the component?
+                            By default, messages are transformed.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="acceptVoidMethods" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Should the resolver call void methods?
+                            By default, void methods are not considered as possible candidates for message delivery.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="property-entry-point-resolver" type="propertyEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Use a message property to select the component method to be called.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+                This element can also be used directly or as part of a set of resolvers;
+                the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="propertyEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:attribute name="property" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the message property used to select a method on the component.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="method-entry-point-resolver" type="methodEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Deliver the message to a named method.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+                This element can also be used directly or as part of a set of resolvers;
+                the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="methodEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="include-entry-point" minOccurs="1" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="reflection-entry-point-resolver" type="reflectionEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Generate a list of candidate methods from the component via reflections.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+                This element can also be used directly or as part of a set of resolvers;
+                the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="reflectionEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element name="exclude-object-methods" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                If specified, methods in the Java Object interface are not included in
+                                the list of possible methods that can receive the message.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="exclude-entry-point" type="methodType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Explicitly exclude a named method from receiving the message.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="array-entry-point-resolver" type="complexEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Deliver the message to a method which takes a single array as argument.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+                This element can also be used directly or as part of a set of resolvers;
+                the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="no-arguments-entry-point-resolver" type="complexEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Call a method without arguments (the message is not passed to the component).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="complexEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="reflectionEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="include-entry-point" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="enableDiscovery" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="include-entry-point" type="methodType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A possible method for delivery.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="methodType">
+        <xsd:attribute name="method" type="nonBlankString">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the method.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--  Services                                                    -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-service" abstract="true" type="abstractServiceType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a service element.
+                Services combine message routing with a Java (typically) component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractServiceType">
+        <xsd:attribute name="name" type="nonBlankString" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name used to identify this service.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseServiceType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Base support for a model-based wrapper around the POJO service (SEDA, Streaming, etc.)
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractServiceType">
+                <xsd:sequence>
+                    <xsd:element name="description" type="descriptionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                This can hold any kind of documentation consistent with the overall XML format).
+                                It is intended to be "human readable" only and is not used by the system.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="inbound" type="inboundCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within "inbound" describe how messages enter the service.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <!-- minOccurs="0" to allow for <forwarding-router/> and/or default component -->
+                    <xsd:element ref="abstract-component" minOccurs="0"/>
+                    <xsd:element name="outbound" type="outboundCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within "outbound" describe how messages leave the service.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="async-reply" type="asyncReplyCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within "async-reply" describe how asynchronous replies are handled.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element ref="abstract-exception-strategy" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="initialState" default="started">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The initial state of the service.
+                            Usually a service is started automatically, but this attribute can block any
+                            initial startup ("stopped") or stop the service immediately after initial
+                            startup ("paused").
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="started"/>
+                            <xsd:enumeration value="stopped"/>
+                            <xsd:enumeration value="paused"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-exception-strategy" abstract="true" type="abstractExceptionStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an exception strategy element.
+                Exception strategies define how Mule should react to errors.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="abstractExceptionStrategyType">
+        <xsd:sequence>
+            <xsd:element name="commit-transaction" type="exceptionPatternType" maxOccurs="1" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Defines when a current transaction gets rolled-back depending on the name of the
+                        exception caught. Users can set a comma delimited list of wildcard patterns that wil be matched
+                        angainst the fully qualified classname of the current exception. Patterns defined for this
+                        element will leave the current transaction (if any) untouched and llow it to be committed.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="rollback-transaction" type="exceptionPatternType" maxOccurs="1" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Defines when a current transaction gets rolled-back depending on the name of the
+                        exception caught. Users can set a comma delimited list of wildcard patterns that wil be matched
+                        angainst the fully qualified classname of the current exception. Patterns defined for this
+                        element will rollback the current transaction (if any).
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="enableNotifications" type="xsd:boolean">
+            <xsd:annotation>
+                <xsd:documentation>Determines whether ExceptionNotifications wil be fired from this strategy when an
+                    exception occurs.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="exceptionPatternType">
+        <xsd:attribute name="exception-pattern" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>A comma-separate list of wildcard expressions that will be matched against the
+                    fully qualified cassname of the current exception received by the ExceptionStrategy.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="asyncReplyCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-async-reply-router" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="timeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The timeout (ms) to wait for a reply.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="failOnTimeout" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If the router times out before all expected events have been received should an exception be thrown
+                    or should the current events be returned for processing. The default is false.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-async-reply-router" abstract="true" type="abstractAsyncReplyRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an async reply router element.
+                Asynchronous replies are handled via this router.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractAsyncReplyRouterType"/>
+
+    <xsd:element name="service" type="sedaServiceType" substitutionGroup="abstract-service">
+        <xsd:annotation>
+            <xsd:documentation>
+                The standard SEDA service.
+                A service describes how to receive messages, deliver them to
+                a component, and handle the results (if any).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="sedaServiceType">
+        <xsd:complexContent>
+            <xsd:extension base="baseServiceType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-component-threading-profile" minOccurs="0"/>
+                    <xsd:element ref="abstract-queue-profile" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="queueTimeout" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The timeout used when taking messages from the SEDA queue.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-service" type="customServiceType" substitutionGroup="abstract-service">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemeted service
+                (typically used only in testing).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customServiceType">
+        <xsd:complexContent>
+            <xsd:extension base="baseServiceType">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The class to use for the service.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-component-threading-profile" abstract="true"
+                 type="abstractComponentThreadingProfileType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for component threading profile element.
+                Threading profils define how thread pools interact with the component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractComponentThreadingProfileType"/>
+
+    <!--==============================================================-->
+    <!-- Components                                              -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-component" abstract="true" type="abstractComponentType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for component element.
+                A component processes data. Typically it is a Java object.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractComponentType">
+        <xsd:sequence>
+            <xsd:group ref="entryPointResolvers"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="component" type="defaultJavaComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                A simple POJO (Plain Old Java Object) component
+                that will be invoked by Mule when a message is received.
+                The instance can be specified via a factory, or via a class.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="defaultJavaComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractComponentType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-object-factory" minOccurs="0"/>
+                    <xsd:element ref="abstract-lifecycle-adapter-factory" minOccurs="0"/>
+                    <xsd:element name="binding" type="pojoBindingType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                A binding associates a Mule endpoint with an injected Java interface
+                                (this is like using Spring to inject a bean, but instead of calling a
+                                method on the bean a message is sent to an endpoint).
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Specify a component class.
+                            This is a shortcut that is equivalent to providing a prototype-object element.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="pooled-component" type="pooledJavaComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                A pooled POJO (Plain Old Java Object) component
+                that will be invoked by Mule when a message is received.
+                The instance can be specified via a factory, or via a class.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="pooledJavaComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="defaultJavaComponentType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-pooling-profile" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Characteristics of the object pool</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <xsd:complexType name="pojoBindingType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="interface" use="required" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface to be injected.
+                    A proxy will be created that implements this interface by calling out to the endpoint.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="method" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The method on the interface that should be used.
+                    This can be omitted if the interface has a single method.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="defaultComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractComponentType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="bridge-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                This transfers a message from inbound to outbound endpoints.
+                This name is provided for backwards compatability - it is equivalent to not specifying any component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!-- don't expose this, it's not needed -->
+    <!-- xsd:element name="pass-through-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default, "do nothing" component.
+                The message is simply transferred from inbound to outbound endpoints.
+                This is the default and need not be specified.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element -->
+
+    <xsd:element name="echo-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                This logs the message and returns the payload back as the result.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="log-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                This logs the message content (or content length if it is a large message).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="null-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                This will throw an exception if it receives a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+
+    <!--==============================================================-->
+    <!--   Transactions                                               -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-transaction" abstract="true" type="abstractTransactionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transaction elements.
+                Transactions allow a series of operations to be grouped together.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransactionType">
+        <xsd:attribute name="action">
+            <xsd:annotation>
+                <xsd:documentation>
+                    NONE - Never participate in a transaction;
+                    ALWAYS_BEGIN - Always start a new transaction when receiving an event. An exception will be thrown
+                    if a transaction already exists;
+                    BEGIN_OR_JOIN - If a transaction is already in progress when an event is received, join the
+                    transaction, otherwise start a new transaction;
+                    ALWAYS_JOIN - Always expects a transaction to be in progress when an event is received, if there is
+                    no transaction an exception is thrown;
+                    JOIN_IF_POSSIBLE - Will join the current transaction if one is available otherwise no transaction is
+                    created.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="NONE"/>
+                    <xsd:enumeration value="ALWAYS_BEGIN"/>
+                    <xsd:enumeration value="BEGIN_OR_JOIN"/>
+                    <xsd:enumeration value="ALWAYS_JOIN"/>
+                    <xsd:enumeration value="JOIN_IF_POSSIBLE"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="timeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Timeout for transaction (ms).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseTransactionType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-transaction" type="customTransactionType" substitutionGroup="abstract-transaction">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allow access to user-defined or otherwise unsupported third party transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransactionType">
+        <xsd:complexContent>
+            <xsd:extension base="baseTransactionType">
+                <xsd:attribute name="factory-class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the TransactionFactory interface.
+                            This will be instantiated and used to generate a transaction.
+                            The attribute and the "factory-ref" attribute are mutually exclusive;
+                            one of the two is required.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="factory-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A bean that implements the TransactionFactory interface.
+                            This will be used to generate a transaction.
+                            The attribute and the "factory-class" attribute are mutually exclusive;
+                            one of the two is required.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="transactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionManagerType">
+                <xsd:attribute name="name" type="substitutableName" default="transactionManager" use="optional">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An optional name for the transaction manager.
+                            The default value is "transactionManager".
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="websphere-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The Websphere transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="jboss-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The JBoss transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="jndiTransactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionManagerType">
+                <xsd:sequence>
+                    <xsd:element name="environment" type="mapType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The JNDI environment.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="weblogic-transaction-manager" type="jndiTransactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The Weblogic transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="jrun-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The JRun transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="resin-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The Resin transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="jndi-transaction-manager" substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                Retrieve a named transaction manager factory from JNDI.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="jndiTransactionManagerType">
+                    <xsd:attribute name="jndiName" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The name of the manager factory to retrieve (eg java:/TransactionManager).
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="custom-transaction-manager" type="customTransactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="jndiTransactionManagerType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The class to instantiate to create a transaction manager.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--   Endpoint elements                                          -->
+    <!--==============================================================-->
+
+    <xsd:element name="endpoint" type="globalEndpointType" substitutionGroup="abstract-global-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An endpoint "template" which can be used to construct an inbound or outbound endpoint
+                elsewhere in the configuration by referencing the endpoint's name.
+                Each transport implements its own endpoint element, with a more friendly syntax,
+                but this generic element can be used with any transport by supplying the correct
+                address URI. For example, "vm://foo" describes a VM transport endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="globalEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractGlobalEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="inbound-endpoint" type="inboundEndpointType" substitutionGroup="abstract-inbound-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An inbound endpoint receives messages from the associated transport.
+                Each transport implements its own inbound endpoint element, with a more friendly syntax,
+                but this generic element can be used with any transport by supplying the correct
+                address URI. For example, "vm://foo" describes a VM transport endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="inboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInboundEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="outbound-endpoint" type="outboundEndpointType" substitutionGroup="abstract-outbound-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An outbound endpoint sends messages to the associated transport.
+                Each transport implements its own outbound endpoint element, with a more friendly syntax,
+                but this generic element can be used with any transport by supplying the correct
+                address URI. For example, "vm://foo" describes a VM transport endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="outboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- these include option/repeats - should be embedded once -->
+    <xsd:group name="defaultEndpointElements">
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="endpointTransformers"/>
+                <xsd:element ref="abstract-transaction" minOccurs="0"/>
+                <xsd:element ref="abstract-filter" minOccurs="0"/>
+                <xsd:element ref="abstract-security-filter" minOccurs="0"/>
+                <xsd:group ref="propertiesGroup"/>
+            </xsd:sequence>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:element name="abstract-security-filter" abstract="true" type="abstractSecurityFilterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for security filter elements.
+                Security filters can control access to the system, etc.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractSecurityFilterType"/>
+
+    <xsd:attributeGroup name="defaultEndpointAttributes">
+        <xsd:attributeGroup ref="restrictedEndpointAttributes"/>
+        <!-- these next two attributes are mutually exclusive and one is required.
+             but there is no way to define this in a schema... -->
+        <!-- endpoint references - dynamically checked to make sure not top level -->
+        <xsd:attribute name="ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A reference to a global endpoint.
+                    If this attribute is used then the endpoint is used as a template to construct this endpoint.
+                    A template fixes the address (protocol, path, host, etc), and may specify initial values for
+                    various properties, but further properties can be defined locally (as long as they don't
+                    change the address in any way).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <!-- explicit or global endpoints -->
+        <xsd:attribute name="address" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The generic address for this endpoint.
+                    If this attribute is used then the protocol must be specified as part of the URI.
+                    Alternatively, most transports provide alternative attributes for specifying the address
+                    (path, host etc).
+                    Note that the address attribute cannot be combined with "ref" or with the transport-provided
+                    alternative attributes.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:attributeGroup name="restrictedEndpointAttributes">
+        <xsd:attribute name="synchronous" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true the result from the component processing the incoming message will be
+                    returned as a response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="remoteSync" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true the component will wait for a response to the outgoing message before
+                    replying to the incoming message.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="remoteSyncTimeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The timeout for the remoteSync wait (ms).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="encoding" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    String encoding used for messages.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="connector-ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the connector associated with this endpoint.
+                    This must be specified if more than one connector is defined for this transport.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A list of transformers which will be applied in order to the message before it is
+                    delivered to the component.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="responseTransformer-refs" type="xsd:NMTOKENS">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A list of transformers which will be applied in order to the synchronous response
+                    before it is returned via the transport.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:complexType name="endpointRefType">
+        <xsd:attribute name="address" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The destination address for a reply message.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The reference name of a global endpoint to use. If this EndpointRef will be associated to a message
+                    such as a Reply-To address, this endpoint ref has to be available on the remote Mule instance that reads the
+                    Reply-To address.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:group name="endpointTransformers">
+        <xsd:annotation>
+            <xsd:documentation>
+                This allows the user to specify either a simple list of (normal) transformers or
+                separate bracketed lists of normal and response transformers.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:choice>
+            <xsd:group ref="transformersList"/>
+            <xsd:sequence>
+                <xsd:element name="transformers" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A list of transformer elements that will be applied to the message
+                            before it is delivered to the component.
+                            Note that a list of transformers can also be specified directly
+                            (without the "transformers" element), but then it is not possible
+                            to also specify response transformers
+                            (using the "response-transformers" element).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:complexType>
+                        <xsd:group ref="transformersList"/>
+                    </xsd:complexType>
+                </xsd:element>
+                <xsd:element name="response-transformers" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A list of transformer elements that will be applied to the response message
+                            returned from the component.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:complexType>
+                        <xsd:group ref="transformersList"/>
+                    </xsd:complexType>
+                </xsd:element>
+            </xsd:sequence>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:group name="transformersList">
+        <xsd:annotation>
+            <xsd:documentation>
+                A list of transformers - normal or response, depending on context.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!--==============================================================-->
+    <!--   Filter elements                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="filter" type="refFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that is defined elsewhere (at the global level, or as a Spring bean).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="refFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the filter to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="not-filter" type="unitaryFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Invert the enclosed filter
+                (so if it returns true for some message, this will return false, and vice-versa).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="unitaryFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="and-filter" type="collectionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Return true only if all the enclosed filters return true.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="or-filter" type="collectionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Return true if any of the enclosed filters returns true.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="collectionFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter" minOccurs="2" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="wildcard-filter" type="wildcardFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches string messages against wildcards.
+                It performs matches with "*", i.e. "jms.events.*" would catch "jms.events.customer"
+                and "jms.events.receipts".
+                This filter accepts a comma-separated list of patterns, so more than one filter pattern can be
+                matched for a given argument: "jms.events.*, jms.actions.*" will match "jms.events.system"
+                and "jms.actions" but not "jms.queue".
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="wildcardFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="caseSensitivePatternFilterType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="expression-filter" type="expressionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that can evaluate a range of expressions. It supports some base expression types
+                such as 'header', 'payload' (payload type), 'regex' and 'wildcard'.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="expressionFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="evaluator" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>The expression evaluator to use. The expression filter supports some types
+                            such as header, payload, exception, wildcard and regex, that are in-built filters not
+                            registered with the ExpressionEvaluatorManager. All others are registered with the
+                            ExpressionEvaluatorManager. Where XPath, bean and ongl are used, the expression should be a
+                            boolean expression.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="substitutableName">
+                            <xsd:enumeration value="header"/>
+                            <xsd:enumeration value="payload-type"/>
+                            <xsd:enumeration value="exception-type"/>
+                            <xsd:enumeration value="wildcard"/>
+                            <xsd:enumeration value="regex"/>
+                            <xsd:enumeration value="ognl"/>
+                            <xsd:enumeration value="xpath"/>
+                            <xsd:enumeration value="jxpath"/>
+                            <xsd:enumeration value="bean"/>
+                            <xsd:enumeration value="custom"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="expression" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>The expression that will be evaluated. This should always be a boolean
+                            expression.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="customEvaluator" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>Must be set if the evaluator is set to 'custom'. Also the custom evaluator
+                            must be registered with the ExpressionEvaluatorManager if it is to be used here.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="nullReturnsTrue" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>If the specified expression returns null should the filter return true or
+                            false.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <xsd:element name="regex-filter" type="patternFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches string messages against a regular expression.
+                The Java regular expression engine (java.util.regex.Pattern) is used.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="patternFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="pattern" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The pattern to use when matching.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-property-filter" type="caseSensitivePatternFilterType"
+                 substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches properties on an event.
+                This can be very useful as the event properties represent all the meta information about the event
+                from the underlying transport, so for an event received over HTTP you can check for HTTP headers etc.
+                The pattern should be expressed as a key/value pair, i.e. "propertyName=value".
+                If you want to compare more than one property you can use the logic filters for And, Or and Not
+                expressions.
+                By default the comparison is case sensitive; you can set the caseSensitive property to override this.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="caseSensitivePatternFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="patternFilterType">
+                <xsd:attribute name="caseSensitive" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If false, the comparison ignores case.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="exception-type-filter" type="typeFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches the type of an exception.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="payload-type-filter" type="typeFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches the type of the payload.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="typeFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="expectedType" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The expected class used in the comparison.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-filter" type="customFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented filter.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the Filter interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- security filters -->
+
+    <xsd:element name="encryption-security-filter" type="encryptionSecurityFilterType"
+                 substitutionGroup="abstract-security-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that provides password based encyption.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="encryptionSecurityFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractSecurityFilterType">
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the encryption strategy to use.
+                            This should be configured using the password-encryption-strategy element,
+                            inside a security-manager element at the top level.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--   Transformer elements                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="transformer" type="refTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A reference to a transformer defined elsewhere.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="refTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the transformer to use,
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="auto-transformer" type="abstractTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that uses the transform discovery mechanism to convert the message payload. This
+                transformer works much better when transforming custom object types rather that java types since there
+                is less chance for ambiguity.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="custom-transformer" type="customTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented transformer.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the Transformer interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-properties-transformer" type="messagePropertiesTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that can add or delete message properties.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="messagePropertiesTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:sequence>
+                    <xsd:element name="delete-message-property" type="keyType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Delete a message property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="add-message-property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Add a message property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="add-message-properties" type="mapType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Add a set of message properties.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="overwrite" type="substitutableBoolean" use="optional" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If false, a property is not added if the message already contains a property with that name.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="no-action-transformer" type="abstractTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that has no effect.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="base64-encoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that base64 encodes a string or byte array message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="base64-decoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that base64 decodes a message to give an array of bytes.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="xml-entity-encoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that encodes a string using XML entities.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="xml-entity-decoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that decodes a string containing XML entities.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="gzip-compress-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that compresses a byte array using gzip.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="gzip-uncompress-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that uncompresses a byte array using gzip.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-hex-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to a string of hexadecimal digits.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="hex-string-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a string of hexadecimal digits to a byte array.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-object-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to an object (either deserializing or converting to a string).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="object-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that serializes all objects except strings (which are converted using getBytes()).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="object-to-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that gives a human-readable description of various types (useful for debugging).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-serializable-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to an object (ie deserializing the object).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="serializable-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts an object to a byte array (ie serializing the object).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to a string.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="string-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a string to a byte array.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="append-string-transformer" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that appends a string to a string payload.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="abstractTransformerType">
+                    <xsd:attribute name="message" type="xsd:string" use="required">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The string to append.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="encrypt-transformer" type="encryptionTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that encrypts a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="decrypt-transformer" type="encryptionTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that decrypts a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="encryptionTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the encryption strategy to use.
+                            This should be configured using the password-encryption-strategy element,
+                            inside a security-manager element at the top level.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="expression-transformer" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that evaluates one or more expressions on the current event. Each expression equates to a
+                parameter in the return message. The return message for 2 or more expressions will be an Object[].
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="abstractTransformerType">
+                    <xsd:sequence minOccurs="1" maxOccurs="unbounded">
+                        <xsd:element name="return-argument">
+                            <xsd:complexType>
+                                <xsd:attributeGroup ref="expressionAttributes"/>
+                                <xsd:attribute name="optional" type="substitutableBoolean" use="optional">
+                                    <xsd:annotation>
+                                        <xsd:documentation>An optional expression means that if the expression evaluates
+                                            to null, it will continue to the next expression without error.
+                                        </xsd:documentation>
+                                    </xsd:annotation>
+                                </xsd:attribute>
+                            </xsd:complexType>
+                        </xsd:element>
+                    </xsd:sequence>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:attributeGroup name="expressionAttributes">
+        <xsd:attribute name="evaluator" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The expression evaluator to use. Expression Evaluators must be registered with the
+                    ExpressionEvaluatrManager before thay can be used. Using the custom evaluator allows the developer
+                    to define their on in the 'custom-evaluator' attribute. Note that some evaluators such as xpath,
+                    groovy and bean are loaded from other mule modules (xml and scripting respectively), these modules
+                    wll need to be on your classpath before the evaluator can be used.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="substitutableName">
+                    <xsd:enumeration value="groovy"/>
+                    <xsd:enumeration value="header"/>
+                    <xsd:enumeration value="headers"/>
+                    <xsd:enumeration value="headers-list"/>
+                    <xsd:enumeration value="attachment"/>
+                    <xsd:enumeration value="attachments"/>
+                    <xsd:enumeration value="attachments-list"/>
+                    <xsd:enumeration value="payload"/>
+                    <xsd:enumeration value="xpath"/>
+                    <xsd:enumeration value="jxpath"/>
+                    <xsd:enumeration value="bean"/>
+                    <xsd:enumeration value="ognl"/>
+                    <xsd:enumeration value="function"/>
+                    <xsd:enumeration value="custom"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="expression" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The expression to evaluate. The syntax of this will change depeneding on the
+                    evaluator being used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="custom-evaluator" type="substitutableName" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>The name of the custom evaluator to use. This attribute is only used when the
+                    evaluator attribute is set to 'custom'. Users can plug in their own expression evaluators by
+                    registering them with the ExpressionEvaluatorManager.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <!--==============================================================-->
+    <!--   Shared elements                                             -->
+    <!--==============================================================-->
+
+    <xsd:element name="queue-profile" type="queueProfileType" substitutionGroup="abstract-queue-profile">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configure the queue used on a component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="queueProfileType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractQueueProfileType">
+                <xsd:attribute name="maxOutstandingMessages" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The maximum size of the queue.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="persistent" type="substitutableBoolean" default="false">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether the queue is persistent.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-security-manager" type="abstractSecurityManagerType" abstract="true">
+        <xsd:annotation>
+            <xsd:documentation>
+                A security manager is a container for security providers. More than one
+                security manager may be configured; each contains providers from a particular
+                module and has that module's type. This element is abstract - a security
+                related module or transport will provide a suitable implementation.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="abstractSecurityManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                This is an empty holder that can be extended by modules that want to
+                provide security managers. Typically it will contain elements called
+                module:type-security-provider which extend securityProviderType
+                where "module" might be "acegi" and "type" might de "delegate", for example.
+                Alternatively (or in addition) it may contain encryption strategies,
+                which should follow a similar scheme and extend encryptionStrategyType.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="id" fixed="_muleSecurityManager"/>
+        <xsd:attribute name="name" fixed="_muleSecurityManager"/>
+    </xsd:complexType>
+
+    <xsd:element name="security-manager" type="securityManagerType" substitutionGroup="abstract-security-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default security manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="securityManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default security manager (type mule:defaultSecurityManagerType) provides
+                basic support for security functions. Other modules (eg Acegi, JAAS, PGP)
+                provide more advanced functionality.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractSecurityManagerType">
+                <xsd:sequence>
+                    <xsd:element name="custom-security-provider" type="customSecurityProviderType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Allow any implementation of UMOSecurityProvider to be used.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="custom-encryption-strategy" type="customEncryptionStrategyType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Allow any implementation of UMOEncryptionStrategy to be used.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="secret-key-encryption-strategy" type="secretKeyEncryptionStrategyType"
+                                 minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Provides secret key-based encryption using JCE.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="password-encryption-strategy" type="passwordEncryptionStrategyType"
+                                 minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Provides password-based encryption using JCE. Users must specify a password and
+                                optionally a salt and iteration count as well. The default algorithm is
+                                PBEWithMD5AndDES, but users can specify any valid algorithm supported by JCE.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="securityProviderType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A security provider is a source of a particular security-related functionality.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="name" type="substitutableName" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="encryptionStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                An encryption strategy provides support for a particular encryption algorithm.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="name" type="substitutableName" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="customSecurityProviderType">
+        <xsd:complexContent>
+            <xsd:extension base="securityProviderType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="provider-ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the security provider to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="customEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A reference to the encryption strategy (which may be a Spring bean that
+                            implements the EncryptionStrategy interface).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="passwordEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:attribute name="password" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The password to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="salt" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The salt to use (this helps prevent dictionary attacks).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="iterationCount" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The number of itreations to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="secretKeyEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:attribute name="key" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The key to use.
+                            This and the keyFactory-ref attribute are mutually exclusive.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="keyFactory-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the key factory to use.
+                            This should implement the ObjectFactory interface and return a byte array.
+                            This and the key attribute are mutually exclusive.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="component-threading-profile" type="threadingProfileType"
+                 substitutionGroup="abstract-component-threading-profile">
+        <xsd:annotation>
+            <xsd:documentation>
+                The threading profile to use on the component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <!-- this is a general threading type used by various elements here -->
+    <xsd:complexType name="threadingProfileType">
+        <xsd:complexContent>
+            <!-- this is a hack that allows us to use this general threading profile as a component threading profile
+                 without retyping everything -->
+            <xsd:extension base="abstractComponentThreadingProfileType">
+                <xsd:attribute name="maxThreadsActive" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The maximum number of threads that will be used.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="maxThreadsIdle" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The maximum number of idle threads stored in the pool.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="threadTTL" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The time excess threads in the pool live before being discarded.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="poolExhaustedAction">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            How tasks should be handled when no more threads are available.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="WAIT"/>
+                            <xsd:enumeration value="DISCARD"/>
+                            <xsd:enumeration value="DISCARD_OLDEST"/>
+                            <xsd:enumeration value="ABORT"/>
+                            <xsd:enumeration value="RUN"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="threadWaitTimeout" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            How long to wait (when the pool exhausted action is WAIT).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="doThreading" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether threading should be used at all (default is true).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="maxBufferSize" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The size of the queue used (when the pool exhausted action is WAIT).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   Exception strategies                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="default-service-exception-strategy" type="endpointExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Provide default exception handling via an endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="default-connector-exception-strategy" type="endpointExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Provide default exception handling via an endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="endpointExceptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractExceptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-exception-strategy" type="customExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-defined exception stratgey.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customExceptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="endpointExceptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the ExceptionListener interface.
+                            In addition, if an outbound-endpoint element is specified,
+                            it is set as an "endpoint" bean property.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- Custom connector element -->
+
+    <xsd:element name="custom-connector" type="customConnectorType" substitutionGroup="abstract-connector">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-defined connector.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="connectorType">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the Connector interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--  Routers                                                     -->
+    <!--==============================================================-->
+
+    <!-- Inbound Router implementations -->
+
+    <xsd:element name="idempotent-secure-hash-receiver-router" type="filteredInboundRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+    <xsd:element name="inbound-pass-through-router" type="filteredInboundRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+    <xsd:complexType name="filteredInboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter" minOccurs="0"/>
+                    <!-- TODO this doesn't make sense here, need to re-visit <xsd:element ref="abstract-message-info-mapping" minOccurs="0"/>-->
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-message-info-mapping" abstract="true" type="abstractMessageInfoMappingType"/>
+    <xsd:complexType name="abstractMessageInfoMappingType"/>
+
+    <xsd:element name="idempotent-receiver-router" type="filteredInboundRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+
+    <xsd:element name="wire-tap-router" type="wireTapRouterType" substitutionGroup="abstract-inbound-router"/>
+    <xsd:complexType name="wireTapRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="1" maxOccurs="1"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="forwarding-router" type="selectiveConsumerRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+
+    <xsd:element name="selective-consumer-router" type="selectiveConsumerRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+
+    <xsd:element name="correlation-resequencer-router" type="baseAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+
+    <xsd:complexType name="selectiveConsumerRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS"/>
+                <xsd:attribute name="transformFirst" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-chunking-aggregator-router" type="messageChunkingAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+    <xsd:complexType name="messageChunkingAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="baseAggregatorRouterType">
+                <xsd:attribute name="correlationExpression" type="xsd:string"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-correlation-aggregator-router" type="customCorrelationAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+    <xsd:complexType name="customCorrelationAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="messageChunkingAggregatorRouterType">
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="collection-aggregator-router" type="baseAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+
+    <xsd:element name="custom-inbound-router" type="customInboundRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+
+    <xsd:complexType name="customInboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:attribute name="timeout" type="substitutableInt"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- ResponseRouters -->
+
+    <xsd:element name="single-async-reply-router" type="asyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router">
+        <xsd:annotation>
+            <xsd:documentation>Configures a Single Response Router. This will return the first event it receives on a
+                reply endpoint and will discard the rest.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="collection-async-reply-router" type="asyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router">
+        <xsd:annotation>
+            <xsd:documentation>Configures a Collection Response Router. This will return a MuleMEssageCollection message
+                type that will contain all events recieved for the current correlation.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="asyncReplyRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractAsyncReplyRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element ref="abstract-message-info-mapping" minOccurs="0"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-async-reply-router" type="customAsyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router"/>
+    <xsd:complexType name="customAsyncReplyRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="asyncReplyRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- Outbound Router implementations -->
+
+    <xsd:element name="outbound-pass-through-router" type="outboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="outboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element name="reply-to" type="endpointRefType" minOccurs="0"/>
+                    <xsd:element ref="abstract-transaction" minOccurs="0"/>
+                    <xsd:element ref="abstract-message-info-mapping" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="enableCorrelation" default="IF_NOT_SET">
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="ALWAYS"/>
+                            <xsd:enumeration value="NEVER"/>
+                            <xsd:enumeration value="IF_NOT_SET"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="filtering-router" type="filteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:element name="chaining-router" type="filteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:element name="exception-based-router" type="filteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:element name="multicasting-router" type="filteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:element name="template-endpoint-router" type="filteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="filteringOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="outboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter" minOccurs="0"/>
+                    <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="endpoint-selector-router" type="endpointSelectorRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="endpointSelectorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteringOutboundRouterType">
+                <xsd:attributeGroup ref="expressionAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="list-message-splitter-router" type="messageSplitterOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="messageSplitterOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteringOutboundRouterType">
+                <!-- this isn't exposed to the user afaict? -->
+                <!-- xsd:attribute name="multimatch" type="substitutableBoolean"/ -->
+                <xsd:attribute name="honorSynchronicity" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-chunking-router" type="chunkingRouterType" substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="chunkingRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteringOutboundRouterType">
+                <xsd:attribute name="messageSize" type="substitutableInt"/>
+                <xsd:attribute name="numberOfMessages" type="substitutableInt"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="static-recipient-list-router" type="staticRecipientListRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="staticRecipientListRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteringOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element name="recipients" type="listOrSetType" minOccurs="0" maxOccurs="1"/>
+                </xsd:sequence>
+                <xsd:attribute name="recipientsProperty" type="xsd:string"/>
+                <xsd:attribute name="recipientsDelimiter" type="xsd:string"/>
+                <xsd:attribute name="synchronous" type="xsd:boolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="recipient-list-router" type="recipientListRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="recipientListRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteringOutboundRouterType">
+                <xsd:attributeGroup ref="expressionAttributes"/>
+                <xsd:attribute name="synchronous" type="xsd:boolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-outbound-router" type="customOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="customOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteringOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- Catch all strategy implementations -->
+
+    <xsd:element name="logging-catch-all-strategy" type="loggingCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="loggingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-catch-all-strategy" type="customCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="customCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="forwarding-catch-all-strategy" type="forwardingCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="forwardingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-forwarding-catch-all-strategy" type="customForwardingCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="customForwardingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="forwardingCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Message Info Mappers -->
+
+    <xsd:element name="expression-message-info-mapping" type="expressionMessageInfoMappingType"
+                 substitutionGroup="abstract-message-info-mapping">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows expressions to be configured to extract the message information.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="expressionMessageInfoMappingType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractMessageInfoMappingType">
+                <xsd:attribute name="messageIdExpression" type="xsd:string" use="required"/>
+                <xsd:attribute name="correlationIdExpression" type="xsd:string" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-message-info-mapping" type="customMessageInfoMappingType"
+                 substitutionGroup="abstract-message-info-mapping">
+        <xsd:annotation>
+            <xsd:documentation>
+                This allows configuraton of a custom implementation of MessageInfoMapping
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customMessageInfoMappingType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractMessageInfoMappingType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the MessageInfoMapping interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!--==============================================================-->
+    <!--  Lifecycle Adapters                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-lifecycle-adapter-factory" abstract="true" type="abstractLifecycleAdapterFactory"/>
+    <xsd:complexType name="abstractLifecycleAdapterFactory">
+        <xsd:annotation>
+            <xsd:documentation>
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:complexType>
+    <xsd:complexType name="customLifecycleAdapterFactory">
+        <xsd:complexContent>
+            <xsd:extension base="abstractLifecycleAdapterFactory">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the LifecycleAdapter interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:element name="custom-lifecycle-adapter-factory" type="customLifecycleAdapterFactory"
+                 substitutionGroup="abstract-lifecycle-adapter-factory">
+        <xsd:annotation>
+            <xsd:documentation>
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!--==============================================================-->
+    <!--  Object Factories                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-object-factory" abstract="true" type="abstractObjectFactoryType"/>
+    <xsd:complexType name="abstractObjectFactoryType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A factory which will be used by Mule to create new instances of this object
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="propertiesGroup">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Properties to be set on the created object
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:group>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="genericObjectFactoryType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-object-factory"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="spring-object" type="springBeanLookupType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="springBeanLookupType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="bean" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>Name of Spring bean to look up</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="singleton-object" type="singletonObjectFactoryType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="singletonObjectFactoryType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>Class name</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="prototype-object" type="prototypeObjectFactoryType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="prototypeObjectFactoryType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>Class name</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-pooling-profile" abstract="true" type="abstractPoolingProfileType"/>
+    <xsd:complexType name="abstractPoolingProfileType"/>
+
+    <xsd:element name="pooling-profile" type="poolingProfileType" substitutionGroup="abstract-pooling-profile"/>
+    <xsd:complexType name="poolingProfileType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractPoolingProfileType">
+                <xsd:attribute name="maxActive" type="xsd:string"/>
+                <xsd:attribute name="maxIdle" type="xsd:string"/>
+                <xsd:attribute name="initialisationPolicy" default="INITIALISE_ONE">
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="INITIALISE_NONE"/>
+                            <xsd:enumeration value="INITIALISE_ONE"/>
+                            <xsd:enumeration value="INITIALISE_ALL"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="exhaustedAction" default="WHEN_EXHAUSTED_GROW">
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="WHEN_EXHAUSTED_GROW"/>
+                            <xsd:enumeration value="WHEN_EXHAUSTED_WAIT"/>
+                            <xsd:enumeration value="WHEN_EXHAUSTED_FAIL"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="maxWait" type="xsd:string"/>
+                <!-- <xsd:attribute name="factory" type="xsd:string" default="org.mule.config.pool.CommonsPoolFactory"/> -->
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--  Utils / Standard Types                                      -->
+    <!--==============================================================-->
+
+
+    <xsd:complexType name="abstractAgentType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for agents. Not used in core, but common to several modules.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractExtensionType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsIndirectKeyStore, named as tls-client in transport namespace -->
+    <xsd:complexType name="tlsClientKeyStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configure client key stores.
+                TLS/SSL connections are made on behalf of an entity, which can be anonymous or identified by a
+                certificate - this interface specifies how a keystore can be used to provide the certificates
+                (and associated private keys) necessary for identification.
+                This is also used as the trust store if no other trust store is specified and the
+                explicitTrustStoreOnly parameter in the server trust store configuration is false.
+                WARNING - due to restrictions in library implementations the values specified here typically apply
+                to all connectors using this transport.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if
+                    possible) of the keystore that contains public certificates and private keys for identification.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the keystore.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The type of keystore used (a Java class name).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsDirectKeyStore, named as tls-key-store in transport namespace -->
+    <xsd:complexType name="tlsKeyStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configure key stores.
+                TLS/SSL connections are made on behalf of an entity, which can be anonymous or identified by a
+                certificate - this interface specifies how a keystore can be used to provide the certificates
+                (and associated private keys) necessary for identification.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if
+                    possible) of the keystore that contains public certificates and private keys for identification.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The type of keystore used (a Java class name).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="keyPassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the private key.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the keystore.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="algorithm" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The algorithm used by the key store.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsIndirectTrustStore, named as tls-trust-store in transport namespace -->
+    <xsd:complexType name="tlsTrustStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configure a trust store.
+                TLS/SSL connections are made to trusted systems - the public certificates of trusted systems are store
+                in a keystore (called a trust store) and used to verify that the connection made to a remote system
+                "really is" the expected identity.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if
+                    possible) of the keystore that contains public certificates of trusted servers.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protected the trust store.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsDirectTrustStore, named as tls-server in transport namespace
+         note that this extends tlsTrustStoreType, so only one of the two is needed -->
+    <xsd:complexType name="tlsServerTrustStoreType">
+        <xsd:complexContent>
+            <xsd:extension base="tlsTrustStoreType">
+                <xsd:attribute name="class" type="substitutableClass"/>
+                <xsd:attribute name="algorithm" type="xsd:string"/>
+                <!-- should be of type TrustManagerFactory -->
+                <xsd:attribute name="factory-ref" type="xsd:NMTOKEN"/>
+                <xsd:attribute name="explicitOnly" type="substitutableBoolean"/>
+                <xsd:attribute name="requireClientAuthentication" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsProtocolHandler, named as tls-protocol-handler -->
+    <xsd:complexType name="tlsProtocolHandler">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configure the global Java protocol handler.
+                WARNING - Untested.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="property" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Set the java.protocol.handler.pkgs system property.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:simpleType name="propertyPlaceholderType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A type that defines an Ant-style property placeholder
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:string">
+            <xsd:pattern value="(\$\{[^\}]+\})"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableClass">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:NMTOKEN-like type that also allows for Ant-style property placeholders
+                and a leading [
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:string">
+                    <xsd:pattern value="\[?[A-Za-z0-9_\.$]+"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="nonBlankString">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:string-like type that cannot be empty
+                (is there a better way?)
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:string">
+                    <xsd:pattern value=".*[^ ]+.*"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableName">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:NMTOKEN type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutablePortNumber">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:int type that also allows for Ant-style property placeholders and restrict the
+                int value to a valid port number
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:int">
+                    <xsd:minInclusive value="0"/>
+                    <xsd:maxInclusive value="65536"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableInt">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:int type that also allows for Ant-style property placeholders
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:int"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableLong">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:long type that also allows for Ant-style property placeholders
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:long"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableBoolean">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:boolean type that also allows for Ant-style property placeholders
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:boolean"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <!-- i found this a bit confusing, so here's some background...
+         this type is typically called from something like
+           <xsd:element name="properties" type="mapType/>
+         and the "properties" element generates a ChildMapDefinitionParser that
+         can "receive" the map entries generated by the embedded spring <entry..>
+         elements and which is then set via "setProperties" on the parent.
+         in other words, it's a map, and despite the name "properties" has
+         nothing to do with the spring <property ...> element.
+         spring elements like <entry...> are handled by
+         MuleHierarchicalBeanDefinitionParserDelegate which punts them to
+         the spring handler -->
+    <xsd:element name="properties" type="mapType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Set Mule properties.
+                These are name/value pairs that can be set on components, services, etc,
+                and which provide a generic way of configuring the system.
+                In Mule v2 you typically shouldn't need to use generic properties like
+                this, since almost all functionality is exposed via dedicated elements.
+                However, they can be useful in configuring obscure or overlooked options
+                and in configuring transports from the generic endpoint elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="mapType">
+        <xsd:complexContent>
+            <xsd:extension base="spring:mapType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:group name="propertiesGroup">
+        <xsd:sequence>
+            <xsd:element name="property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Set a Mule property.
+                        This is a name/value pair that can be set on components, services, etc,
+                        and which provide a generic way of configuring the system.
+                        In Mule v2 you typically shouldn't need to use a generic property like
+                        this, since almost all functionality is exposed via dedicated elements.
+                        However, it can be useful in configuring obscure or overlooked options
+                        and in configuring transports from the generic endpoint elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="properties" minOccurs="0"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:complexType name="listOrSetType">
+        <xsd:complexContent>
+            <xsd:extension base="spring:listOrSetType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="referenceType">
+        <xsd:attribute name="ref" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="keyType">
+        <xsd:attribute name="key" type="xsd:string"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="valueType">
+        <xsd:attribute name="value" type="xsd:string"/>
+        <xsd:attribute name="value-ref" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="keyValueType">
+        <xsd:complexContent>
+            <xsd:extension base="keyType">
+                <xsd:attribute name="value" type="xsd:string"/>
+                <xsd:attribute name="value-ref" type="xsd:NMTOKEN"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--   Connector support                                          -->
+    <!--==============================================================-->
+
+    <xsd:complexType name="connectorType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractConnectorType">
+                <xsd:sequence>
+                    <!-- for normal connectors, this is for emergency use only, but it is
+                         critical for custom connector -->
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element name="receiver-threading-profile" type="threadingProfileType" minOccurs="0"/>
+                    <xsd:element name="dispatcher-threading-profile" type="threadingProfileType" minOccurs="0"/>
+                    <xsd:element ref="abstract-exception-strategy" minOccurs="0"/>
+                    <xsd:element name="service-overrides" type="serviceOverridesType" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="createDispatcherPerRequest" type="substitutableBoolean"/>
+                <xsd:attribute name="createMultipleTransactedReceivers" type="substitutableBoolean"/>
+                <xsd:attribute name="numberOfConcurrentTransactedReceivers" type="substitutableInt"/>
+                <xsd:attribute name="dynamicNotification" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="serviceOverridesType">
+        <xsd:attribute name="messageReceiver" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="transactedMessageReceiver" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="dispatcherFactory" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="inboundTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="outboundTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="responseTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="endpointBuilder" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="messageAdapter" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="streamMessageAdapter" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="serviceFinder" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="sessionHandler" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   JNDI support                                               -->
+    <!--==============================================================-->
+
+    <xsd:complexType name="jndiConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="connectorType">
+                <xsd:sequence>
+                    <xsd:element name="jndi-provider-property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Direct setting of a JNDI property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="jndi-provider-properties" type="mapType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Direct setting of JNDI properties
+                                (this allows access to the full Spring map entry).
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="jndiContext-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Set the complete context directly, via a bean reference.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiInitialFactory" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The initial context factory to use. The value
+                            of the property should be the fully qualified class name
+                            of the factory class that will create an initial context.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiProviderUrl" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The service provider to use. The value of the property
+                            should contain a URL string (e.g. "ldap://somehost:389").
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiUrlPkgPrefixes" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The list of package prefixes to use when
+                            loading in URL context factories. The value
+                            of the property should be a colon-separated list of package
+                            prefixes for the class name of the factory class that will create
+                            a URL context factory.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="dataReferenceType" mixed="true">
+        <xsd:attribute name="file" type="xsd:string"/>
+        <xsd:attribute name="ref" type="xsd:string"/>
+        <!--I don't like this flag, may be we could use content-type mappings... -->
+        <xsd:attribute name="binary" type="substitutableBoolean"/>
+    </xsd:complexType>
+
+    <!-- these cannot be references (unless we use qualified attribute names, which are ugly),
+         but serve as templates to cut+paste in individual transports
+
+    <xsd:attribute name="path" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A file location.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="user" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A username.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="password" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A password.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="host" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                An IP address (eg www.mulesource.com, localhost, 127.0.0.1).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="port" type="substitutablePortNumber">
+        <xsd:annotation>
+            <xsd:documentation>
+                A port number.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    -->
+
+
+</xsd:schema>
diff --git a/xml/tests/testData/completion/spring-beans-2.0.dtd b/xml/tests/testData/completion/spring-beans-2.0.dtd
new file mode 100644
index 0000000..a54cd93
--- /dev/null
+++ b/xml/tests/testData/completion/spring-beans-2.0.dtd
@@ -0,0 +1,677 @@
+<!--
+	Spring XML Beans DTD, version 2.0
+	Authors: Rod Johnson, Juergen Hoeller, Alef Arendsen, Colin Sampaleanu, Rob Harrop
+
+	This defines a simple and consistent way of creating a namespace
+	of JavaBeans objects, managed by a Spring BeanFactory, read by
+	XmlBeanDefinitionReader (with DefaultBeanDefinitionDocumentReader).
+
+	This document type is used by most Spring functionality, including
+	web application contexts, which are based on bean factories.
+
+	Each "bean" element in this document defines a JavaBean.
+	Typically the bean class is specified, along with JavaBean properties
+	and/or constructor arguments.
+
+	A bean instance can be a "singleton" (shared instance) or a "prototype"
+	(independent instance). Further scopes can be provided by extended
+	bean factories, for example in a web environment.
+
+	References among beans are supported, that is, setting a JavaBean property
+	or a constructor argument to refer to another bean in the same factory
+	(or an ancestor factory).
+
+	As alternative to bean references, "inner bean definitions" can be used.
+	Singleton flags of such inner bean definitions are effectively ignored:
+	Inner beans are typically anonymous prototypes.
+
+	There is also support for lists, sets, maps, and java.util.Properties
+	as bean property types or constructor argument types.
+
+	For simple purposes, this DTD is sufficient. As of Spring 2.0,
+	XSD-based bean definitions are supported as more powerful alternative.
+
+	XML documents that conform to this DTD should declare the following doctype:
+
+	<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
+		  "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
+-->
+
+
+<!--
+	The document root. A document can contain bean definitions only,
+	imports only, or a mixture of both (typically with imports first).
+-->
+<!ELEMENT beans (
+	description?,
+	(import | alias | bean)*
+)>
+
+<!--
+	Default values for all bean definitions. Can be overridden at
+	the "bean" level. See those attribute definitions for details.
+-->
+<!ATTLIST beans default-lazy-init (true | false) "false">
+<!ATTLIST beans default-autowire (no | byName | byType | constructor | autodetect) "no">
+<!ATTLIST beans default-dependency-check (none | objects | simple | all) "none">
+<!ATTLIST beans default-init-method CDATA #IMPLIED>
+<!ATTLIST beans default-destroy-method CDATA #IMPLIED>
+<!ATTLIST beans default-merge (true | false) "false">
+
+<!--
+	Element containing informative text describing the purpose of the enclosing
+	element. Always optional.
+	Used primarily for user documentation of XML bean definition documents.
+-->
+<!ELEMENT description (#PCDATA)>
+
+
+<!--
+	Specifies an XML bean definition resource to import.
+-->
+<!ELEMENT import EMPTY>
+
+<!--
+	The relative resource location of the XML bean definition file to import,
+	for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml".
+-->
+<!ATTLIST import resource CDATA #REQUIRED>
+
+
+<!--
+	Defines an alias for a bean, which can reside in a different definition file.
+-->
+<!ELEMENT alias EMPTY>
+
+<!--
+	The name of the bean to define an alias for.
+-->
+<!ATTLIST alias name CDATA #REQUIRED>
+
+<!--
+	The alias name to define for the bean.
+-->
+<!ATTLIST alias alias CDATA #REQUIRED>
+
+<!--
+  Allows for arbitrary metadata to be attached to a bean definition.
+-->
+<!ELEMENT meta EMPTY>
+
+<!--
+  Specifies the key name of the metadata parameter being defined.
+-->
+<!ATTLIST meta key CDATA #REQUIRED>
+
+<!--
+  Specifies the value of the metadata parameter being defined as a String.
+-->
+<!ATTLIST meta value CDATA #REQUIRED>
+
+<!--
+	Defines a single (usually named) bean.
+
+	A bean definition may contain nested tags for constructor arguments,
+	property values, lookup methods, and replaced methods. Mixing constructor
+	injection and setter injection on the same bean is explicitly supported.
+-->
+<!ELEMENT bean (
+	description?,
+	(meta | constructor-arg | property | lookup-method | replaced-method)*
+)>
+
+<!--
+	Beans can be identified by an id, to enable reference checking.
+
+	There are constraints on a valid XML id: if you want to reference your bean
+	in Java code using a name that's illegal as an XML id, use the optional
+	"name" attribute. If neither is given, the bean class name is used as id
+	(with an appended counter like "#2" if there is already a bean with that name).
+-->
+<!ATTLIST bean id ID #IMPLIED>
+
+<!--
+	Optional. Can be used to create one or more aliases illegal in an id.
+	Multiple aliases can be separated by any number of spaces, commas, or
+	semi-colons (or indeed any mixture of the three).
+-->
+<!ATTLIST bean name CDATA #IMPLIED>
+
+<!--
+	Each bean definition must specify the fully qualified name of the class,
+	except if it pure serves as parent for child bean definitions.
+-->
+<!ATTLIST bean class CDATA #IMPLIED>
+
+<!--
+	Optionally specify a parent bean definition.
+
+	Will use the bean class of the parent if none specified, but can
+	also override it. In the latter case, the child bean class must be
+	compatible with the parent, i.e. accept the parent's property values
+	and constructor argument values, if any.
+
+	A child bean definition will inherit constructor argument values,
+	property values and method overrides from the parent, with the option
+	to add new values. If init method, destroy method, factory bean and/or factory
+	method are specified, they will override the corresponding parent settings.
+
+	The remaining settings will always be taken from the child definition:
+	depends on, autowire mode, dependency check, scope, lazy init.
+-->
+<!ATTLIST bean parent CDATA #IMPLIED>
+
+<!--
+	The scope of this bean: typically "singleton" (one shared instance,
+	which will be returned by all calls to getBean() with the id),
+	or "prototype" (independent instance resulting from each call to
+	getBean(). Default is "singleton".
+
+	Singletons are most commonly used, and are ideal for multi-threaded
+	service objects. Further scopes, such as "request" or "session",
+	might be supported by extended bean factories (for example, in a
+	web environment).
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+
+	Inner bean definitions inherit the singleton status of their containing
+	bean definition, unless explicitly specified: The inner bean will be a
+	singleton if the containing bean is a singleton, and a prototype if
+	the containing bean has any other scope.
+-->
+<!ATTLIST bean scope CDATA #IMPLIED>
+
+<!--
+	Is this bean "abstract", i.e. not meant to be instantiated itself but
+	rather just serving as parent for concrete child bean definitions.
+	Default is "false". Specify "true" to tell the bean factory to not try to
+	instantiate that particular bean in any case.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per abstract bean definition.
+-->
+<!ATTLIST bean abstract (true | false) #IMPLIED>
+
+<!--
+	If this bean should be lazily initialized.
+	If false, it will get instantiated on startup by bean factories
+	that perform eager initialization of singletons.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+-->
+<!ATTLIST bean lazy-init (true | false | default) "default">
+
+<!--
+  Indicates whether or not this bean should be considered when looking
+  for candidates to satisfy another beans autowiring requirements.
+-->
+<!ATTLIST bean autowire-candidate (true | false) #IMPLIED>
+
+<!--
+	Optional attribute controlling whether to "autowire" bean properties.
+	This is an automagical process in which bean references don't need to be coded
+	explicitly in the XML bean definition file, but Spring works out dependencies.
+
+	There are 5 modes:
+
+	1. "no"
+	The traditional Spring default. No automagical wiring. Bean references
+	must be defined in the XML file via the <ref> element. We recommend this
+	in most cases as it makes documentation more explicit.
+
+	2. "byName"
+	Autowiring by property name. If a bean of class Cat exposes a dog property,
+	Spring will try to set this to the value of the bean "dog" in the current factory.
+	If there is no matching bean by name, nothing special happens;
+	use dependency-check="objects" to raise an error in that case.
+
+	3. "byType"
+	Autowiring if there is exactly one bean of the property type in the bean factory.
+	If there is more than one, a fatal error is raised, and you can't use byType
+	autowiring for that bean. If there is none, nothing special happens;
+	use dependency-check="objects" to raise an error in that case.
+
+	4. "constructor"
+	Analogous to "byType" for constructor arguments. If there isn't exactly one bean
+	of the constructor argument type in the bean factory, a fatal error is raised.
+
+	5. "autodetect"
+	Chooses "constructor" or "byType" through introspection of the bean class.
+	If a default constructor is found, "byType" gets applied.
+
+	The latter two are similar to PicoContainer and make bean factories simple to
+	configure for small namespaces, but doesn't work as well as standard Spring
+	behaviour for bigger applications.
+
+	Note that explicit dependencies, i.e. "property" and "constructor-arg" elements,
+	always override autowiring. Autowire behavior can be combined with dependency
+	checking, which will be performed after all autowiring has been completed.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+-->
+<!ATTLIST bean autowire (no | byName | byType | constructor | autodetect | default) "default">
+
+<!--
+	Optional attribute controlling whether to check whether all this
+	beans dependencies, expressed in its properties, are satisfied.
+	Default is no dependency checking.
+
+	"simple" type dependency checking includes primitives and String
+	"object" includes collaborators (other beans in the factory)
+	"all" includes both types of dependency checking
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+-->
+<!ATTLIST bean dependency-check (none | objects | simple | all | default) "default">
+
+<!--
+	The names of the beans that this bean depends on being initialized.
+	The bean factory will guarantee that these beans get initialized before.
+
+	Note that dependencies are normally expressed through bean properties or
+	constructor arguments. This property should just be necessary for other kinds
+	of dependencies like statics (*ugh*) or database preparation on startup.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+-->
+<!ATTLIST bean depends-on CDATA #IMPLIED>
+
+<!--
+	Optional attribute for the name of the custom initialization method
+	to invoke after setting bean properties. The method must have no arguments,
+	but may throw any exception.
+-->
+<!ATTLIST bean init-method CDATA #IMPLIED>
+
+<!--
+	Optional attribute for the name of the custom destroy method to invoke
+	on bean factory shutdown. The method must have no arguments,
+	but may throw any exception.
+
+	Note: Only invoked on beans whose lifecycle is under full control
+	of the factory - which is always the case for singletons, but not
+	guaranteed for any other scope.
+-->
+<!ATTLIST bean destroy-method CDATA #IMPLIED>
+
+<!--
+	Optional attribute specifying the name of a factory method to use to
+	create this object. Use constructor-arg elements to specify arguments
+	to the factory method, if it takes arguments. Autowiring does not apply
+	to factory methods.
+
+	If the "class" attribute is present, the factory method will be a static
+	method on the class specified by the "class" attribute on this bean
+	definition. Often this will be the same class as that of the constructed
+	object - for example, when the factory method is used as an alternative
+	to a constructor. However, it may be on a different class. In that case,
+	the created object will *not* be of the class specified in the "class"
+	attribute. This is analogous to FactoryBean behavior.
+
+	If the "factory-bean" attribute is present, the "class" attribute is not
+	used, and the factory method will be an instance method on the object
+	returned from a getBean call with the specified bean name. The factory
+	bean may be defined as a singleton or a prototype.
+
+	The factory method can have any number of arguments. Autowiring is not
+	supported. Use indexed constructor-arg elements in conjunction with the
+	factory-method attribute.
+
+	Setter Injection can be used in conjunction with a factory method.
+	Method Injection cannot, as the factory method returns an instance,
+	which will be used when the container creates the bean.
+-->
+<!ATTLIST bean factory-method CDATA #IMPLIED>
+
+<!--
+	Alternative to class attribute for factory-method usage.
+	If this is specified, no class attribute should be used.
+	This should be set to the name of a bean in the current or
+	ancestor factories that contains the relevant factory method.
+	This allows the factory itself to be configured using Dependency
+	Injection, and an instance (rather than static) method to be used.
+-->
+<!ATTLIST bean factory-bean CDATA #IMPLIED>
+
+<!--
+	Bean definitions can specify zero or more constructor arguments.
+	This is an alternative to "autowire constructor".
+	Arguments correspond to either a specific index of the constructor argument
+	list or are supposed to be matched generically by type.
+
+	Note: A single generic argument value will just be used once, rather than
+	potentially matched multiple times (as of Spring 1.1).
+
+	constructor-arg elements are also used in conjunction with the factory-method
+	element to construct beans using static or instance factory methods.
+-->
+<!ELEMENT constructor-arg (
+	description?,
+	(bean | ref | idref | value | null | list | set | map | props)?
+)>
+
+<!--
+	The constructor-arg tag can have an optional index attribute,
+	to specify the exact index in the constructor argument list. Only needed
+	to avoid ambiguities, e.g. in case of 2 arguments of the same type.
+-->
+<!ATTLIST constructor-arg index CDATA #IMPLIED>
+
+<!--
+	The constructor-arg tag can have an optional type attribute,
+	to specify the exact type of the constructor argument. Only needed
+	to avoid ambiguities, e.g. in case of 2 single argument constructors
+	that can both be converted from a String.
+-->
+<!ATTLIST constructor-arg type CDATA #IMPLIED>
+
+<!--
+  A short-cut alternative to a child element "ref bean=".
+-->
+<!ATTLIST constructor-arg ref CDATA #IMPLIED>
+
+<!--
+  A short-cut alternative to a child element "value".
+-->
+<!ATTLIST constructor-arg value CDATA #IMPLIED>
+
+
+<!--
+	Bean definitions can have zero or more properties.
+	Property elements correspond to JavaBean setter methods exposed
+	by the bean classes. Spring supports primitives, references to other
+	beans in the same or related factories, lists, maps and properties.
+-->
+<!ELEMENT property (
+	description?, meta*,
+	(bean | ref | idref | value | null | list | set | map | props)?
+)>
+
+<!--
+	The property name attribute is the name of the JavaBean property.
+	This follows JavaBean conventions: a name of "age" would correspond
+	to setAge()/optional getAge() methods.
+-->
+<!ATTLIST property name CDATA #REQUIRED>
+
+<!--
+  A short-cut alternative to a child element "ref bean=".
+-->
+<!ATTLIST property ref CDATA #IMPLIED>
+
+<!--
+  A short-cut alternative to a child element "value".
+-->
+<!ATTLIST property value CDATA #IMPLIED>
+
+
+<!--
+	A lookup method causes the IoC container to override the given method and return
+	the bean with the name given in the bean attribute. This is a form of Method Injection.
+	It's particularly useful as an alternative to implementing the BeanFactoryAware
+	interface, in order to be able to make getBean() calls for non-singleton instances
+	at runtime. In this case, Method Injection is a less invasive alternative.
+-->
+<!ELEMENT lookup-method EMPTY>
+
+<!--
+	Name of a lookup method. This method should take no arguments.
+-->
+<!ATTLIST lookup-method name CDATA #IMPLIED>
+
+<!--
+	Name of the bean in the current or ancestor factories that the lookup method
+	should resolve to. Often this bean will be a prototype, in which case the
+	lookup method will return a distinct instance on every invocation. This
+	is useful for single-threaded objects.
+-->
+<!ATTLIST lookup-method bean CDATA #IMPLIED>
+
+
+<!--
+	Similar to the lookup method mechanism, the replaced-method element is used to control
+	IoC container method overriding: Method Injection. This mechanism allows the overriding
+	of a method with arbitrary code.
+-->
+<!ELEMENT replaced-method (
+	(arg-type)*
+)>
+
+<!--
+	Name of the method whose implementation should be replaced by the IoC container.
+	If this method is not overloaded, there's no need to use arg-type subelements.
+	If this method is overloaded, arg-type subelements must be used for all
+	override definitions for the method.
+-->
+<!ATTLIST replaced-method name CDATA #IMPLIED>
+
+<!--
+	Bean name of an implementation of the MethodReplacer interface in the current
+	or ancestor factories. This may be a singleton or prototype bean. If it's
+	a prototype, a new instance will be used for each method replacement.
+	Singleton usage is the norm.
+-->
+<!ATTLIST replaced-method replacer CDATA #IMPLIED>
+
+<!--
+	Subelement of replaced-method identifying an argument for a replaced method
+	in the event of method overloading.
+-->
+<!ELEMENT arg-type (#PCDATA)>
+
+<!--
+	Specification of the type of an overloaded method argument as a String.
+	For convenience, this may be a substring of the FQN. E.g. all the
+	following would match "java.lang.String":
+	- java.lang.String
+	- String
+	- Str
+
+	As the number of arguments will be checked also, this convenience can often
+	be used to save typing.
+-->
+<!ATTLIST arg-type match CDATA #IMPLIED>
+
+
+<!--
+	Defines a reference to another bean in this factory or an external
+	factory (parent or included factory).
+-->
+<!ELEMENT ref EMPTY>
+
+<!--
+	References must specify a name of the target bean.
+	The "bean" attribute can reference any name from any bean in the context,
+	to be checked at runtime.
+	Local references, using the "local" attribute, have to use bean ids;
+	they can be checked by this DTD, thus should be preferred for references
+	within the same bean factory XML file.
+-->
+<!ATTLIST ref bean CDATA #IMPLIED>
+<!ATTLIST ref local IDREF #IMPLIED>
+<!ATTLIST ref parent CDATA #IMPLIED>
+
+
+<!--
+	Defines a string property value, which must also be the id of another
+	bean in this factory or an external factory (parent or included factory).
+	While a regular 'value' element could instead be used for the same effect,
+	using idref in this case allows validation of local bean ids by the XML
+	parser, and name completion by supporting tools.
+-->
+<!ELEMENT idref EMPTY>
+
+<!--
+	ID refs must specify a name of the target bean.
+	The "bean" attribute can reference any name from any bean in the context,
+	potentially to be checked at runtime by bean factory implementations.
+	Local references, using the "local" attribute, have to use bean ids;
+	they can be checked by this DTD, thus should be preferred for references
+	within the same bean factory XML file.
+-->
+<!ATTLIST idref bean CDATA #IMPLIED>
+<!ATTLIST idref local IDREF #IMPLIED>
+
+
+<!--
+	Contains a string representation of a property value.
+	The property may be a string, or may be converted to the required
+	type using the JavaBeans PropertyEditor machinery. This makes it
+	possible for application developers to write custom PropertyEditor
+	implementations that can convert strings to arbitrary target objects.
+
+	Note that this is recommended for simple objects only.
+	Configure more complex objects by populating JavaBean
+	properties with references to other beans.
+-->
+<!ELEMENT value (#PCDATA)>
+
+<!--
+	The value tag can have an optional type attribute, to specify the
+	exact type that the value should be converted to. Only needed
+	if the type of the target property or constructor argument is
+	too generic: for example, in case of a collection element.
+-->
+<!ATTLIST value type CDATA #IMPLIED>
+
+<!--
+	Denotes a Java null value. Necessary because an empty "value" tag
+	will resolve to an empty String, which will not be resolved to a
+	null value unless a special PropertyEditor does so.
+-->
+<!ELEMENT null (#PCDATA)>
+
+
+<!--
+	A list can contain multiple inner bean, ref, collection, or value elements.
+	Java lists are untyped, pending generics support in Java 1.5,
+	although references will be strongly typed.
+	A list can also map to an array type. The necessary conversion
+	is automatically performed by the BeanFactory.
+-->
+<!ELEMENT list (
+	(bean | ref | idref | value | null | list | set | map | props)*
+)>
+
+<!--
+	Enable/disable merging for collections when using parent/child beans.
+-->
+<!ATTLIST list merge (true | false | default) "default">
+
+<!--
+	Specify the default Java type for nested values.
+-->
+<!ATTLIST list value-type CDATA #IMPLIED>
+
+
+<!--
+	A set can contain multiple inner bean, ref, collection, or value elements.
+	Java sets are untyped, pending generics support in Java 1.5,
+	although references will be strongly typed.
+-->
+<!ELEMENT set (
+	(bean | ref | idref | value | null | list | set | map | props)*
+)>
+
+<!--
+	Enable/disable merging for collections when using parent/child beans.
+-->
+<!ATTLIST set merge (true | false | default) "default">
+
+<!--
+	Specify the default Java type for nested values.
+-->
+<!ATTLIST set value-type CDATA #IMPLIED>
+
+
+<!--
+	A Spring map is a mapping from a string key to object.
+	Maps may be empty.
+-->
+<!ELEMENT map (
+	(entry)*
+)>
+
+<!--
+	Enable/disable merging for collections when using parent/child beans.
+-->
+<!ATTLIST map merge (true | false | default) "default">
+
+<!--
+	Specify the default Java type for nested entry keys.
+-->
+<!ATTLIST map key-type CDATA #IMPLIED>
+
+<!--
+	Specify the default Java type for nested entry values.
+-->
+<!ATTLIST map value-type CDATA #IMPLIED>
+
+<!--
+	A map entry can be an inner bean, ref, value, or collection.
+	The key of the entry is given by the "key" attribute or child element.
+-->
+<!ELEMENT entry (
+  key?,
+	(bean | ref | idref | value | null | list | set | map | props)?
+)>
+
+<!--
+	Each map element must specify its key as attribute or as child element.
+	A key attribute is always a String value.
+-->
+<!ATTLIST entry key CDATA #IMPLIED>
+
+<!--
+  A short-cut alternative to a "key" element with a "ref bean=" child element.
+-->
+<!ATTLIST entry key-ref CDATA #IMPLIED>
+
+<!--
+  A short-cut alternative to a child element "value".
+-->
+<!ATTLIST entry value CDATA #IMPLIED>
+
+<!--
+  A short-cut alternative to a child element "ref bean=".
+-->
+<!ATTLIST entry value-ref CDATA #IMPLIED>
+
+<!--
+	A key element can contain an inner bean, ref, value, or collection.
+-->
+<!ELEMENT key (
+	(bean | ref | idref | value | null | list | set | map | props)
+)>
+
+
+<!--
+	Props elements differ from map elements in that values must be strings.
+	Props may be empty.
+-->
+<!ELEMENT props (
+	(prop)*
+)>
+
+<!--
+	Enable/disable merging for collections when using parent/child beans.
+-->
+<!ATTLIST props merge (true | false | default) "default">
+
+<!--
+	Element content is the string value of the property.
+	Note that whitespace is trimmed off to avoid unwanted whitespace
+	caused by typical XML formatting.
+-->
+<!ELEMENT prop (#PCDATA)>
+
+<!--
+	Each property element must specify its key.
+-->
+<!ATTLIST prop key CDATA #REQUIRED>
+
diff --git a/xml/tests/testData/completion/spring-beans-2.0.xsd b/xml/tests/testData/completion/spring-beans-2.0.xsd
new file mode 100644
index 0000000..6825d93
--- /dev/null
+++ b/xml/tests/testData/completion/spring-beans-2.0.xsd
@@ -0,0 +1,1076 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/beans"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		targetNamespace="http://www.springframework.org/schema/beans">
+
+	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Spring XML Beans Schema, version 2.0
+	Authors: Rob Harrop, Juergen Hoeller
+
+	This defines a simple and consistent way of creating a namespace
+	of JavaBeans objects, managed by a Spring BeanFactory, read by
+	XmlBeanDefinitionReader (with DefaultBeanDefinitionDocumentReader).
+
+	This document type is used by most Spring functionality, including
+	web application contexts, which are based on bean factories.
+
+	Each "bean" element in this document defines a JavaBean.
+	Typically the bean class is specified, along with JavaBean properties
+	and/or constructor arguments.
+
+	A bean instance can be a "singleton" (shared instance) or a "prototype"
+	(independent instance). Further scopes can be provided by extended
+	bean factories, for example in a web environment.
+
+	References among beans are supported, that is, setting a JavaBean property
+	or a constructor argument to refer to another bean in the same factory
+	(or an ancestor factory).
+
+	As alternative to bean references, "inner bean definitions" can be used.
+	Singleton flags of such inner bean definitions are effectively ignored:
+	inner beans are typically anonymous prototypes.
+
+	There is also support for lists, sets, maps, and java.util.Properties
+	as bean property types or constructor argument types.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<!-- base types -->
+	<xsd:complexType name="identifiedType" abstract="true">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The unique identifier for a bean. The scope of the identifier
+	is the enclosing bean factory.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:attribute name="id" type="xsd:ID">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The unique identifier for a bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Top-level <beans> tag -->
+	<xsd:element name="beans">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The top level (typically root) element. Allows the definition
+	of default values for all nested bean definitions.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="import"/>
+					<xsd:element ref="alias"/>
+					<xsd:element ref="bean"/>
+					<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="default-lazy-init" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'lazy-init' value; see the documentation for the
+	'lazy-init' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-merge" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'merge' value; see the documentation for the
+	'merge' attribute of the various collection elements. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-dependency-check" default="none">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'dependency-check' value; see the documentation for the
+	'dependency-check' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="none"/>
+						<xsd:enumeration value="simple"/>
+						<xsd:enumeration value="objects"/>
+						<xsd:enumeration value="all"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-autowire" default="no">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'autowire' value; see the documentation for the
+	'autowire' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="no"/>
+						<xsd:enumeration value="byName"/>
+						<xsd:enumeration value="byType"/>
+						<xsd:enumeration value="constructor"/>
+						<xsd:enumeration value="autodetect"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-init-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'init-method' value; see the documentation for the
+	'init-method' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-destroy-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'destroy-method' value; see the documentation for the
+	'destroy-method' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="description">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains informative text describing the purpose of the enclosing
+	element.
+	Used primarily for user documentation of XML bean definition documents.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="import">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.core.io.Resource"><![CDATA[
+	Specifies an XML bean definition resource to import.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="resource" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The relative resource location of the XML (bean definition) file to import,
+	for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml".
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="alias">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines an alias for a bean (which can reside in a different definition
+	resource).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean to define an alias for.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="alias" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The alias name to define for the bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:group name="beanElements">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="constructor-arg"/>
+				<xsd:element ref="property"/>
+				<xsd:element ref="lookup-method"/>
+				<xsd:element ref="replaced-method"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:attributeGroup name="beanAttributes">
+		<xsd:attribute name="name" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Can be used to create one or more aliases illegal in an (XML) id.
+	Multiple aliases can be separated by any number of spaces, commas,
+	or semi-colons (or indeed any mixture of the three).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="class" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The fully qualified name of the bean's class, except if it pure serves as parent for child bean definitions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="parent" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the parent bean definition.
+
+	Will use the bean class of the parent if none is specified, but can
+	also override it. In the latter case, the child bean class must be
+	compatible with the parent, i.e. accept the parent's property values
+	and constructor argument values, if any.
+
+	A child bean definition will inherit constructor argument values,
+	property values and method overrides from the parent, with the option
+	to add new values. If init method, destroy method, factory bean and/or
+	factory method are specified, they will override the corresponding
+	parent settings.
+
+	The remaining settings will always be taken from the child definition:
+	depends on, autowire mode, dependency check, scope, lazy init.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="scope" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The scope of this bean: typically "singleton" (one shared instance,
+	which will be returned by all calls to getBean with the given id), or
+	"prototype" (independent instance resulting from each call to getBean).
+	Default is "singleton".
+
+	Singletons are most commonly used, and are ideal for multi-threaded
+	service objects. Further scopes, such as "request" or "session", might
+	be supported by extended bean factories (e.g. in a web environment).
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+
+	Inner bean definitions inherit the singleton status of their containing
+	bean definition, unless explicitly specified: The inner bean will be a
+	singleton if the containing bean is a singleton, and a prototype if
+	the containing bean has any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="abstract" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Is this bean "abstract", that is, not meant to be instantiated itself
+	but rather just serving as parent for concrete child bean definitions?
+	The default is "false". Specify "true" to tell the bean factory to not
+	try to instantiate that particular bean in any case.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per abstract bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="lazy-init" default="default" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean is to be lazily initialized.
+	If false, it will be instantiated on startup by bean factories
+	that perform eager initialization of singletons. The default is
+	"false".
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether bean properties are "autowired".
+	This is an automagical process in which bean references don't need
+	to be coded explicitly in the XML bean definition file, but rather the
+	Spring container works out dependencies.
+
+	There are 5 modes:
+
+	1. "no"
+	The traditional Spring default. No automagical wiring. Bean references
+	must be defined in the XML file via the <ref/> element (or "ref"
+	attribute). We recommend this in most cases as it makes documentation
+	more explicit.
+
+	2. "byName"
+	Autowiring by property name. If a bean of class Cat exposes a dog
+	property, Spring will try to set this to the value of the bean "dog"
+	in the current container. If there is no matching bean by name, nothing
+	special happens; use dependency-check="objects" to raise an error in
+	that case.
+
+	3. "byType"
+	Autowiring if there is exactly one bean of the property type in the
+	container. If there is more than one, a fatal error is raised, and
+	you cannot use byType autowiring for that bean. If there is none,
+	nothing special happens; use dependency-check="objects" to raise an
+	error in that case.
+
+	4. "constructor"
+	Analogous to "byType" for constructor arguments. If there is not exactly
+	one bean of the constructor argument type in the bean factory, a fatal
+	error is raised.
+
+	5. "autodetect"
+	Chooses "constructor" or "byType" through introspection of the bean
+	class. If a default constructor is found, "byType" gets applied.
+
+	Note that explicit dependencies, i.e. "property" and "constructor-arg"
+	elements, always override autowiring. Autowire behavior can be combined
+	with dependency checking, which will be performed after all autowiring
+	has been completed.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="no"/>
+					<xsd:enumeration value="byName"/>
+					<xsd:enumeration value="byType"/>
+					<xsd:enumeration value="constructor"/>
+					<xsd:enumeration value="autodetect"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="dependency-check" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether or not to check whether all of this
+	beans dependencies, expressed in its properties, are satisfied.
+	The default is to perform no dependency checking.
+
+	"simple" type dependency checking includes primitives and String
+	"object" includes collaborators (other beans in the factory)
+	"all" includes both types of dependency checking
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="none"/>
+					<xsd:enumeration value="simple"/>
+					<xsd:enumeration value="objects"/>
+					<xsd:enumeration value="all"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="depends-on" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The names of the beans that this bean depends on being initialized.
+	The bean factory will guarantee that these beans get initialized
+	before this bean.
+
+	Note that dependencies are normally expressed through bean properties
+	or constructor arguments. This property should just be necessary for
+	other kinds of dependencies like statics (*ugh*) or database preparation
+	on startup.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="init-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom initialization method to invoke after setting
+	bean properties. The method must have no arguments, but may throw any
+	exception.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="destroy-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom destroy method to invoke on bean factory
+	shutdown. The method must have no arguments, but may throw any
+	exception.
+
+	Note: Only invoked on beans whose lifecycle is under the full
+	control of the factory - which is always the case for singletons,
+	but not guaranteed for any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of a factory method to use to create this object. Use
+	constructor-arg elements to specify arguments to the factory method,
+	if it takes arguments. Autowiring does not apply to factory methods.
+
+	If the "class" attribute is present, the factory method will be a static
+	method on the class specified by the "class" attribute on this bean
+	definition. Often this will be the same class as that of the constructed
+	object - for example, when the factory method is used as an alternative
+	to a constructor. However, it may be on a different class. In that case,
+	the created object will *not* be of the class specified in the "class"
+	attribute. This is analogous to FactoryBean behavior.
+
+	If the "factory-bean" attribute is present, the "class" attribute is not
+	used, and the factory method will be an instance method on the object
+	returned from a getBean call with the specified bean name. The factory
+	bean may be defined as a singleton or a prototype.
+
+	The factory method can have any number of arguments. Autowiring is not
+	supported. Use indexed constructor-arg elements in conjunction with the
+	factory-method attribute.
+
+	Setter Injection can be used in conjunction with a factory method.
+	Method Injection cannot, as the factory method returns an instance,
+	which will be used when the container creates the bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-bean" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Alternative to class attribute for factory-method usage.
+	If this is specified, no class attribute should be used.
+	This must be set to the name of a bean in the current or
+	ancestor factories that contains the relevant factory method.
+	This allows the factory itself to be configured using Dependency
+	Injection, and an instance (rather than static) method to be used.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire-candidate" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean should be considered when looking
+	for candidates to satisfy another bean's autowiring requirements.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:attributeGroup>
+
+	<xsd:element name="meta" type="metaType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Arbitrary metadata attached to a bean definition.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:complexType name="metaType">
+		<xsd:attribute name="key" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The key name of the metadata parameter being defined.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The value of the metadata parameter being defined (as a simple String).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<xsd:element name="bean">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.BeanDefinition"><![CDATA[
+	Defines a single (usually named) bean.
+
+	A bean definition may contain nested tags for constructor arguments,
+	property values, lookup methods, and replaced methods. Mixing constructor
+	injection and setter injection on the same bean is explicitly supported.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="identifiedType">
+					<xsd:group ref="beanElements"/>
+					<xsd:attributeGroup ref="beanAttributes"/>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="constructor-arg">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.ConstructorArgumentValues">
+				<![CDATA[
+	Bean definitions can specify zero or more constructor arguments.
+	This is an alternative to "autowire constructor".
+	Arguments correspond to either a specific index of the constructor
+	argument list or are supposed to be matched generically by type.
+
+	Note: A single generic argument value will just be used once, rather
+	than potentially matched multiple times (as of Spring 1.1).
+
+	constructor-arg elements are also used in conjunction with the
+	factory-method element to construct beans using static or instance
+	factory methods.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="1">
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+					<xsd:any namespace="##other" processContents="strict"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="index" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact index of thr argument in the constructor argument list.
+	Only needed to avoid ambiguities, e.g. in case of 2 arguments of
+	the exact same type.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type of the constructor argument. Only needed to avoid
+	ambiguities, e.g. in case of 2 single argument constructors
+	that can both be converted from a String.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="ref" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>" element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="value" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...<value/>"
+	element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="property" type="propertyType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Bean definitions can have zero or more properties.
+	Property elements correspond to JavaBean setter methods exposed
+	by the bean classes. Spring supports primitives, references to other
+	beans in the same or related factories, lists, maps and properties.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="lookup-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A lookup method causes the IoC container to override the given method
+	and return the bean with the name given in the bean attribute. This is
+	a form of Method Injection. It is particularly useful as an alternative
+	to implementing the BeanFactoryAware interface, in order to be able to
+	make getBean() calls for non-singleton instances at runtime. In this
+	case, Method Injection is a less invasive alternative.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the lookup method. This method must take no arguments.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean in the current or ancestor factories that
+	the lookup method should resolve to. Often this bean will be a
+	prototype, in which case the lookup method will return a distinct
+	instance on every invocation. This is useful for single-threaded objects.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="replaced-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Similar to the lookup method mechanism, the replaced-method element
+	is used to control IoC container method overriding: Method Injection.
+	This mechanism allows the overriding of a method with arbitrary code.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="arg-type"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="name" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The name of the method whose implementation must be replaced by the
+	IoC container. If this method is not overloaded, there is no need
+	to use arg-type subelements. If this method is overloaded, arg-type
+	subelements must be used for all override definitions for the method.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="replacer" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation source="java:org.springframework.beans.factory.support.MethodReplacer"><![CDATA[
+	Bean name of an implementation of the MethodReplacer interface in the
+	current or ancestor factories. This may be a singleton or prototype
+	bean. If it is a prototype, a new instance will be used for each
+	method replacement. Singleton usage is the norm.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="arg-type">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Identifies an argument for a replaced method in the event of
+	method overloading.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="match" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Specification of the type of an overloaded method argument as a String.
+	For convenience, this may be a substring of the FQN. E.g. all the
+	following would match "java.lang.String":
+	- java.lang.String
+	- String
+	- Str
+
+	As the number of arguments will be checked also, this convenience
+	can often be used to save typing.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="ref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines a reference to another bean in this factory or an external
+	factory (parent or included factory).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID,
+	and thus can be checked by the XML parser, thus should be preferred
+	for references within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="parent" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean *in a parent factory*.
+						]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="idref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The id of another bean in this factory or an external factory
+	(parent or included factory).
+	While a regular 'value' element could instead be used for the
+	same effect, using idref in this case allows validation of local
+	bean ids by the XML parser, and name completion by supporting tools.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID,
+	and thus can be checked by the XML parser, thus should be preferred
+	for references within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="value">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains a string representation of a property value.
+	The property may be a string, or may be converted to the required
+	type using the JavaBeans PropertyEditor machinery. This makes it
+	possible for application developers to write custom PropertyEditor
+	implementations that can convert strings to arbitrary target objects.
+
+	Note that this is recommended for simple objects only. Configure
+	more complex objects by populating JavaBean properties with
+	references to other beans.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type that the value should be converted to. Only needed
+	if the type of the target property or constructor argument is
+	too generic: for example, in case of a collection element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="null">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Denotes a Java null value. Necessary because an empty "value" tag
+	will resolve to an empty String, which will not be resolved to a
+	null value unless a special PropertyEditor does so.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<!-- Collection Elements -->
+	<xsd:group name="collectionElements">
+		<xsd:sequence>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:element name="list" type="listOrSetType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A list can contain multiple inner bean, ref, collection, or value
+	elements. Java lists are untyped, pending generics support in Java5,
+	although references will be strongly typed. A list can also map to
+	an array type. The necessary conversion is automatically performed
+	by the BeanFactory.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="set" type="listOrSetType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A set can contain multiple inner bean, ref, collection, or value
+	elements. Java sets are untyped, pending generics support in Java5,
+	although references will be strongly typed.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="map" type="mapType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A mapping from a key to an object. Maps may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="entry" type="entryType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A map entry can be an inner bean, ref, value, or collection.
+	The key of the entry is given by the "key" attribute or child element.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="props" type="propsType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Props elements differ from map elements in that values must be strings.
+	Props may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="key">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A key element can contain an inner bean, ref, value, or collection.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:group ref="collectionElements"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="prop">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The string value of the property. Note that whitespace is trimmed
+	off to avoid unwanted whitespace caused by typical XML formatting.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="key" type="xsd:string" use="required">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The key of the property entry.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="propertyType">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="1">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict"/>
+			</xsd:choice>
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the property, following JavaBean naming conventions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>"
+	element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Collection Types -->
+
+	<!-- base collection type -->
+	<xsd:complexType name="baseCollectionType">
+		<xsd:attribute name="merge" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- base type for collections that have (possibly) typed nested values -->
+	<xsd:complexType name="typedCollectionType">
+		<xsd:complexContent>
+			<xsd:extension base="baseCollectionType">
+				<xsd:attribute name="value-type" type="xsd:string">
+					<xsd:annotation>
+						<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested values. Must be a fully qualified
+	class name.
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:attribute>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'map' element type -->
+	<xsd:complexType name="mapType">
+		<xsd:complexContent>
+			<xsd:extension base="typedCollectionType">
+				<xsd:sequence>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="entry"/>
+					</xsd:choice>
+				</xsd:sequence>
+				<xsd:attribute name="key-type" type="xsd:string">
+					<xsd:annotation>
+						<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested entry keys. Must be a fully qualified
+	class name. 	
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:attribute>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'entry' element type -->
+	<xsd:complexType name="entryType">
+		<xsd:sequence>
+			<xsd:element ref="key" minOccurs="0"/>
+			<xsd:group ref="collectionElements"/>
+		</xsd:sequence>
+		<xsd:attribute name="key" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Each map element must specify its key as attribute or as child element.
+	A key attribute is always a String value.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="key-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a to a "key" element with a nested
+	"<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>"
+	element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- 'list' and 'set' collection type -->
+	<xsd:complexType name="listOrSetType">
+		<xsd:complexContent>
+			<xsd:extension base="typedCollectionType">
+				<xsd:group ref="collectionElements"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'props' collection type -->
+	<xsd:complexType name="propsType">
+		<xsd:complexContent>
+			<xsd:extension base="baseCollectionType">
+				<xsd:sequence>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="prop"/>
+					</xsd:choice>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- simple internal types -->
+	<xsd:simpleType name="defaultable-boolean">
+		<xsd:restriction base="xsd:NMTOKEN">
+			<xsd:enumeration value="default"/>
+			<xsd:enumeration value="true"/>
+			<xsd:enumeration value="false"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/completion/spring-beans.xsd b/xml/tests/testData/completion/spring-beans.xsd
new file mode 100644
index 0000000..aaf2a4b
--- /dev/null
+++ b/xml/tests/testData/completion/spring-beans.xsd
@@ -0,0 +1,368 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	targetNamespace="http://www.springframework.org/schema/beans">
+
+	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+
+	<!-- Top-level <beans> tag -->
+	<xsd:element name="beans">
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="import"/>
+					<xsd:element ref="alias"/>
+					<xsd:element ref="bean"/>
+					<xsd:any namespace="##other"
+						minOccurs="0" maxOccurs="unbounded"
+						processContents="strict"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="default-lazy-init" default="false">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="true"/>
+						<xsd:enumeration value="false"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-dependency-check" default="none">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="none"/>
+						<xsd:enumeration value="all"/>
+						<xsd:enumeration value="objects"/>
+						<xsd:enumeration value="simple"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-autowire" default="no">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="byType"/>
+						<xsd:enumeration value="byName"/>
+						<xsd:enumeration value="no"/>
+						<xsd:enumeration value="autodetect"/>
+						<xsd:enumeration value="constructor"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-init-method" default="-" type="xsd:string"/>
+			<xsd:attribute name="default-destroy-method" default="-" type="xsd:string"/>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="description">
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="import">
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="resource" type="xsd:string" use="required"/>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="alias">
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string" use="required"/>
+					<xsd:attribute name="alias" type="xsd:string" use="required"/>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:group name="beanElements">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="constructor-arg"/>
+				<xsd:element ref="property"/>
+				<xsd:element ref="lookup-method"/>
+				<xsd:element ref="replaced-method"/>
+				<xsd:any namespace="##other"
+					minOccurs="0" maxOccurs="unbounded"
+					processContents="strict"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<!-- definition of an attribute group -->
+	<xsd:attributeGroup name="beanAttributes">
+		<xsd:attribute name="id" type="xsd:ID"/>
+		<xsd:attribute name="name" type="xsd:string"/>
+		<xsd:attribute name="class" type="xsd:string"/>
+		<xsd:attribute name="parent" type="xsd:string"/>
+		<xsd:attribute name="abstract" default="false">
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="true"/>
+					<xsd:enumeration value="false"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="singleton" default="true">
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="true"/>
+					<xsd:enumeration value="false"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="lazy-init" default="default">
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="true"/>
+					<xsd:enumeration value="false"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="autowire" default="default">
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="byType"/>
+					<xsd:enumeration value="byName"/>
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="no"/>
+					<xsd:enumeration value="autodetect"/>
+					<xsd:enumeration value="constructor"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="dependency-check" default="default">
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="none"/>
+					<xsd:enumeration value="all"/>
+					<xsd:enumeration value="objects"/>
+					<xsd:enumeration value="simple"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="depends-on" type="xsd:string"/>
+		<xsd:attribute name="init-method" type="xsd:string"/>
+		<xsd:attribute name="destroy-method" type="xsd:string"/>
+		<xsd:attribute name="factory-method" type="xsd:string"/>
+		<xsd:attribute name="factory-bean" type="xsd:string"/>
+		<xsd:anyAttribute processContents="strict" namespace="##other"/>
+	</xsd:attributeGroup>
+
+	<xsd:element name="bean">
+		<xsd:complexType>
+			<xsd:group ref="beanElements"/>
+			<xsd:attributeGroup ref="beanAttributes"/>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="constructor-arg">
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0">
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="index" type="xsd:string"/>
+			<xsd:attribute name="type" type="xsd:string"/>
+			<xsd:attribute name="ref" type="xsd:string"/>
+			<xsd:attribute name="value" type="xsd:string"/>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="property">
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0">
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+					<xsd:any namespace="##other"
+						minOccurs="0" maxOccurs="unbounded"
+						processContents="strict"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="name" type="xsd:string" use="required"/>
+			<xsd:attribute name="ref" type="xsd:string"/>
+			<xsd:attribute name="value" type="xsd:string"/>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="lookup-method">
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string"/>
+					<xsd:attribute name="bean" type="xsd:string"/>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="replaced-method">
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="arg-type"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="name" type="xsd:string"/>
+			<xsd:attribute name="replacer" type="xsd:string"/>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="arg-type">
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="match" type="xsd:string"/>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="ref">
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string"/>
+					<xsd:attribute name="local" type="xsd:IDREF"/>
+					<xsd:attribute name="parent" type="xsd:string"/>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="idref">
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string"/>
+					<xsd:attribute name="local" type="xsd:IDREF"/>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="value">
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="type" type="xsd:string"/>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="null">
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="list">
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+				</xsd:choice>
+			</xsd:sequence>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="set">
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+				</xsd:choice>
+			</xsd:sequence>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="map">
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="entry"/>
+				</xsd:choice>
+			</xsd:sequence>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="entry">
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="key" minOccurs="0"/>
+				<xsd:choice minOccurs="0">
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="key" type="xsd:string"/>
+			<xsd:attribute name="key-ref" type="xsd:string"/>
+			<xsd:attribute name="value" type="xsd:string"/>
+			<xsd:attribute name="value-ref" type="xsd:string"/>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="key">
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice>
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+				</xsd:choice>
+			</xsd:sequence>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="props">
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="prop"/>
+				</xsd:choice>
+			</xsd:sequence>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="prop">
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="key" type="xsd:string" use="required"/>
+		</xsd:complexType>
+	</xsd:element>
+
+</xsd:schema>
diff --git a/xml/tests/testData/completion/spring-tx-2.0.xsd b/xml/tests/testData/completion/spring-tx-2.0.xsd
new file mode 100644
index 0000000..128cef1
--- /dev/null
+++ b/xml/tests/testData/completion/spring-tx-2.0.xsd
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/tx"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		xmlns:beans="http://www.springframework.org/schema/beans"
+		xmlns:tool="http://www.springframework.org/schema/tool"
+		targetNamespace="http://www.springframework.org/schema/tx"
+		elementFormDefault="qualified"
+		attributeFormDefault="unqualified">
+
+	<xsd:import namespace="http://www.springframework.org/schema/beans"/>
+	<xsd:import namespace="http://www.springframework.org/schema/tool"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Defines the elements used in the Spring Framework's declarative
+	transaction management infrastructure.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<xsd:element name="advice">
+		<xsd:complexType>
+			<xsd:annotation>
+				<xsd:documentation source="java:org.springframework.transaction.interceptor.TransactionInterceptor"><![CDATA[
+	Defines the transactional semantics of the AOP advice that is to be
+	executed.
+	
+	That is, this advice element is where the transactional semantics of
+	any	number of methods are defined (where transactional semantics
+	includes the propagation settings, the isolation level, the rollback
+	rules, and suchlike).
+				]]></xsd:documentation>
+				<xsd:appinfo>
+					<tool:annotation>
+						<tool:exports type="org.springframework.transaction.interceptor.TransactionInterceptor"/>
+					</tool:annotation>
+				</xsd:appinfo>
+			</xsd:annotation>
+			<xsd:complexContent>
+				<xsd:extension base="beans:identifiedType">
+					<xsd:sequence>
+						<xsd:element name="attributes" type="attributesType" minOccurs="0" maxOccurs="1"/>
+					</xsd:sequence>
+					<xsd:attribute name="transaction-manager" type="xsd:string" default="transactionManager">
+						<xsd:annotation>
+							<xsd:documentation source="java:org.springframework.transaction.PlatformTransactionManager"><![CDATA[
+	The bean name of the PlatformTransactionManager that is to be used
+	to drive transactions.
+	
+	This attribute is not required, and only needs to be specified
+	explicitly if the bean name of the desired PlatformTransactionManager
+	is not 'transactionManager'.
+							]]></xsd:documentation>
+							<xsd:appinfo>
+								<tool:annotation kind="ref">
+									<tool:expected-type type="org.springframework.transaction.PlatformTransactionManager"/>
+								</tool:annotation>
+							</xsd:appinfo>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="annotation-driven">
+		<xsd:complexType>
+			<xsd:annotation>
+				<xsd:documentation source="java:org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"><![CDATA[
+	Indicates that transaction configuration is defined by Java5
+	annotations on bean classes, and that proxies are automatically
+	to be created for the relevant annotated beans.
+	
+	Transaction semantics such as propagation settings, the isolation
+	level, the rollback rules, etc are all defined in the annotation
+	metadata.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:attribute name="transaction-manager" type="xsd:string" default="transactionManager">
+				<xsd:annotation>
+					<xsd:documentation source="java:org.springframework.transaction.PlatformTransactionManager"><![CDATA[
+	The bean name of the PlatformTransactionManager that is to be used
+	to drive transactions.
+	
+	This attribute is not required, and only needs to be specified
+	explicitly if the bean name of the desired PlatformTransactionManager
+	is not 'transactionManager'.
+					]]></xsd:documentation>
+					<xsd:appinfo>
+						<tool:annotation kind="ref">
+							<tool:expected-type type="org.springframework.transaction.PlatformTransactionManager"/>
+						</tool:annotation>
+					</xsd:appinfo>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="proxy-target-class" type="xsd:boolean" default="false">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Are class-based (CGLIB) proxies to be created? By default, standard
+	Java interface-based proxies are created.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="order" type="xsd:int">
+				<xsd:annotation>
+					<xsd:documentation source="java:org.springframework.core.Ordered"><![CDATA[
+	Controls the ordering of the execution of the transaction advisor
+	when multiple advice executes at a specific joinpoint.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="attributesType">
+		<xsd:sequence>
+			<xsd:element name="method" minOccurs="1" maxOccurs="unbounded">
+				<xsd:complexType>
+					<xsd:attribute name="name" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The method name(s) with which the transaction attributes are to be
+	associated. The wildcard (*) character can be used to associate the
+	same transaction attribute settings with a number of methods; for
+	example, 'get*', 'handle*', '*Order', etc.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="propagation" default="REQUIRED">
+						<xsd:simpleType>
+							<xsd:annotation>
+								<xsd:documentation source="java:org.springframework.transaction.annotation.Propagation"><![CDATA[
+	The transaction propagation behavior.
+								]]></xsd:documentation>
+							</xsd:annotation>
+							<xsd:restriction base="xsd:string">
+								<xsd:enumeration value="REQUIRED"/>
+								<xsd:enumeration value="SUPPORTS"/>
+								<xsd:enumeration value="MANDATORY"/>
+								<xsd:enumeration value="REQUIRES_NEW"/>
+								<xsd:enumeration value="NOT_SUPPORTED"/>
+								<xsd:enumeration value="NEVER"/>
+								<xsd:enumeration value="NESTED"/>
+							</xsd:restriction>
+						</xsd:simpleType>
+					</xsd:attribute>
+					<xsd:attribute name="isolation" default="DEFAULT">
+						<xsd:simpleType>
+							<xsd:annotation>
+								<xsd:documentation source="java:org.springframework.transaction.annotation.Isolation"><![CDATA[
+	The transaction isolation level.
+								]]></xsd:documentation>
+							</xsd:annotation>
+							<xsd:restriction base="xsd:string">
+								<xsd:enumeration value="DEFAULT"/>
+								<xsd:enumeration value="READ_UNCOMMITTED"/>
+								<xsd:enumeration value="READ_COMMITTED"/>
+								<xsd:enumeration value="REPEATABLE_READ"/>
+								<xsd:enumeration value="SERIALIZABLE"/>
+							</xsd:restriction>
+						</xsd:simpleType>
+					</xsd:attribute>
+					<xsd:attribute name="timeout" type="xsd:integer" default="-1">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The transaction timeout value (in seconds).
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="read-only" type="xsd:boolean" default="false">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Is this transaction read-only?
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="rollback-for" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The Exception(s) that will trigger rollback; comma-delimited.
+	For example, 'com.foo.MyBusinessException,ServletException'
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="no-rollback-for" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The Exception(s) that will *not* trigger rollback; comma-delimited.
+	For example, 'com.foo.MyBusinessException,ServletException'
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:complexType>
+			</xsd:element>
+		</xsd:sequence>
+	</xsd:complexType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/completion/spring-util-2.0.xsd b/xml/tests/testData/completion/spring-util-2.0.xsd
new file mode 100644
index 0000000..afc7b01
--- /dev/null
+++ b/xml/tests/testData/completion/spring-util-2.0.xsd
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/util"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		xmlns:beans="http://www.springframework.org/schema/beans"
+		xmlns:tool="http://www.springframework.org/schema/tool"
+		targetNamespace="http://www.springframework.org/schema/util"
+		elementFormDefault="qualified"
+		attributeFormDefault="unqualified">
+
+	<xsd:import namespace="http://www.springframework.org/schema/beans"/>
+	<xsd:import namespace="http://www.springframework.org/schema/tool"/>
+
+	<xsd:element name="constant">
+		<xsd:annotation>
+			<xsd:documentation>
+	Reference a public, static field on a type and expose its value as
+	a bean. For example <code>&lt;util:constant static-field=&quot;java.lang.Integer.MAX_VALUE&quot;/&gt;</code>.
+			</xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:attribute name="id" type="xsd:ID"/>
+			<xsd:attribute name="static-field" type="xsd:string" use="required"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="property-path">
+		<xsd:annotation>
+			<xsd:documentation>
+	Reference a property on a bean (or as a nested value) and expose its values as
+	a bean. For example &lt;util:property-path path=&quot;order.customer.name&quot;/&gt;.
+			</xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:attribute name="id" type="xsd:ID"/>
+			<xsd:attribute name="path" type="xsd:string" use="required"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="list">
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="beans:listOrSetType">
+					<xsd:annotation>
+						<xsd:documentation source="java:org.springframework.beans.factory.config.ListFactoryBean">
+	Builds a List instance of the specified type, populated with the specified content.
+						</xsd:documentation>
+						<xsd:appinfo>
+							<tool:annotation>
+								<tool:exports type="java.util.List"/>
+							</tool:annotation>
+						</xsd:appinfo>
+					</xsd:annotation>
+					<xsd:attribute name="id" type="xsd:ID"/>
+					<xsd:attribute name="list-class" type="xsd:string">
+						<xsd:annotation>
+							<xsd:appinfo>
+								<tool:annotation>
+									<tool:expected-type type="java.lang.Class"/>
+									<tool:assignable-to type="java.util.List"/>
+								</tool:annotation>
+							</xsd:appinfo>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="scope" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The scope of this collection bean: typically "singleton" (one shared instance,
+	which will be returned by all calls to getBean with the given id), or
+	"prototype" (independent instance resulting from each call to getBean).
+	Default is "singleton". Further scopes, such as "request" or "session",
+	might be supported by extended bean factories (e.g. in a web environment).
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="set">
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="beans:listOrSetType">
+					<xsd:annotation>
+						<xsd:documentation source="java:org.springframework.beans.factory.config.SetFactoryBean">
+	Builds a Set instance of the specified type, populated with the specified content.
+						</xsd:documentation>
+						<xsd:appinfo>
+							<tool:annotation>
+								<tool:exports type="java.util.Set"/>
+							</tool:annotation>
+						</xsd:appinfo>
+					</xsd:annotation>
+					<xsd:attribute name="id" type="xsd:ID"/>
+					<xsd:attribute name="set-class" type="xsd:string">
+						<xsd:annotation>
+							<xsd:appinfo>
+								<tool:annotation>
+									<tool:expected-type type="java.lang.Class"/>
+									<tool:assignable-to type="java.util.Set"/>
+								</tool:annotation>
+							</xsd:appinfo>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="scope" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The scope of this collection bean: typically "singleton" (one shared instance,
+	which will be returned by all calls to getBean with the given id), or
+	"prototype" (independent instance resulting from each call to getBean).
+	Default is "singleton". Further scopes, such as "request" or "session",
+	might be supported by extended bean factories (e.g. in a web environment).
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="map">
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="beans:mapType">
+					<xsd:annotation>
+						<xsd:documentation source="java:org.springframework.beans.factory.config.MapFactoryBean">
+	Builds a Map instance of the specified type, populated with the specified content.
+						</xsd:documentation>
+						<xsd:appinfo>
+							<tool:annotation>
+								<tool:exports type="java.util.Map"/>
+							</tool:annotation>
+						</xsd:appinfo>
+					</xsd:annotation>
+					<xsd:attribute name="id" type="xsd:ID"/>
+					<xsd:attribute name="map-class" type="xsd:string">
+						<xsd:annotation>
+							<xsd:appinfo>
+								<tool:annotation>
+									<tool:expected-type type="java.lang.Class"/>
+									<tool:assignable-to type="java.util.Map"/>
+								</tool:annotation>
+							</xsd:appinfo>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="scope" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The scope of this collection bean: typically "singleton" (one shared instance,
+	which will be returned by all calls to getBean with the given id), or
+	"prototype" (independent instance resulting from each call to getBean).
+	Default is "singleton". Further scopes, such as "request" or "session",
+	might be supported by extended bean factories (e.g. in a web environment).
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="properties">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.PropertiesFactoryBean">
+	Loads a Properties instance from the resource location specified by the '<code>location</code>' attribute.
+			</xsd:documentation>
+			<xsd:appinfo>
+				<tool:annotation>
+					<tool:exports type="java.util.Properties"/>
+				</tool:annotation>
+			</xsd:appinfo>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="beans:propsType">
+					<xsd:attribute name="id" type="xsd:ID"/>
+					<xsd:attribute name="location" type="xsd:string">
+						<xsd:annotation>
+							<xsd:appinfo>
+								<tool:annotation>
+									<tool:expected-type type="org.springframework.core.io.Resource"/>
+								</tool:annotation>
+							</xsd:appinfo>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="scope" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The scope of this collection bean: typically "singleton" (one shared instance,
+	which will be returned by all calls to getBean with the given id), or
+	"prototype" (independent instance resulting from each call to getBean).
+	Default is "singleton". Further scopes, such as "request" or "session",
+	might be supported by extended bean factories (e.g. in a web environment).
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+</xsd:schema>
diff --git a/xml/tests/testData/completion/springbeans.dtd b/xml/tests/testData/completion/springbeans.dtd
new file mode 100644
index 0000000..4dc4825
--- /dev/null
+++ b/xml/tests/testData/completion/springbeans.dtd
@@ -0,0 +1,587 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+	Spring XML Beans DTD
+	Authors: Rod Johnson, Juergen Hoeller, Alef Arendsen, Colin Sampaleanu
+
+	This defines a simple and consistent way of creating a namespace
+	of JavaBeans objects, managed by a Spring BeanFactory, read by
+	XmlBeanDefinitionReader (with DefaultXmlBeanDefinitionParser).
+
+	This document type is used by most Spring functionality, including
+	web application contexts, which are based on bean factories.
+
+	Each "bean" element in this document defines a JavaBean.
+	Typically the bean class is specified, along with JavaBean properties
+	and/or constructor arguments.
+
+	Bean instances can be "singletons" (shared instances) or "prototypes"
+	(independent instances). Further scopes are supposed to be built on top
+	of the core BeanFactory infrastructure and are therefore not part of it.
+
+	References among beans are supported, i.e. setting a JavaBean property
+	or a constructor argument to refer to another bean in the same factory
+	(or an ancestor factory).
+
+	As alternative to bean references, "inner bean definitions" can be used.
+	Singleton flags of such inner bean definitions are effectively ignored:
+	Inner beans are typically anonymous prototypes.
+
+	There is also support for lists, sets, maps, and java.util.Properties
+	as bean property types or constructor argument types.
+
+	As the format is simple, a DTD is sufficient, and there's no need
+	for a schema at this point.
+
+	XML documents that conform to this DTD should declare the following doctype:
+
+	<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
+		"http://www.springframework.org/dtd/spring-beans.dtd">
+-->
+
+
+<!--
+	The document root. A document can contain bean definitions only,
+	imports only, or a mixture of both (typically with imports first).
+-->
+<!ELEMENT beans (
+	description?,
+	(import | alias | bean)*
+)>
+
+<!--
+	Default values for all bean definitions. Can be overridden at
+	the "bean" level. See those attribute definitions for details.
+-->
+<!ATTLIST beans default-lazy-init (true | false) "false">
+<!ATTLIST beans default-dependency-check (none | objects | simple | all) "none">
+<!ATTLIST beans default-autowire (no | byName | byType | constructor | autodetect) "no">
+
+<!--
+	Element containing informative text describing the purpose of the enclosing
+	element. Always optional.
+	Used primarily for user documentation of XML bean definition documents.
+-->
+<!ELEMENT description (#PCDATA)>
+
+
+<!--
+	Specifies an XML bean definition resource to import.
+-->
+<!ELEMENT import EMPTY>
+
+<!--
+	The relative resource location of the XML bean definition file to import,
+	for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml".
+-->
+<!ATTLIST import resource CDATA #REQUIRED>
+
+
+<!--
+	Defines an alias for a bean, which can reside in a different definition file.
+-->
+<!ELEMENT alias EMPTY>
+
+<!--
+	The name of the bean to define an alias for.
+-->
+<!ATTLIST alias name CDATA #REQUIRED>
+
+<!--
+	The alias name to define for the bean.
+-->
+<!ATTLIST alias alias CDATA #REQUIRED>
+
+
+<!--
+	Defines a single (usually named) bean.
+
+	A bean definition may contain nested tags for constructor arguments,
+	property values, lookup methods, and replaced methods. Mixing constructor
+	injection and setter injection on the same bean is explicitly supported.
+-->
+<!ELEMENT bean (
+	description?,
+	(constructor-arg | property | lookup-method | replaced-method)*
+)>
+
+<!--
+	Beans can be identified by an id, to enable reference checking.
+
+	There are constraints on a valid XML id: if you want to reference your bean
+	in Java code using a name that's illegal as an XML id, use the optional
+	"name" attribute. If neither is given, the bean class name is used as id
+	(with an appended counter like "#2" if there is already a bean with that name).
+-->
+<!ATTLIST bean id ID #IMPLIED>
+
+<!--
+	Optional. Can be used to create one or more aliases illegal in an id.
+	Multiple aliases can be separated by any number of spaces or commas.
+-->
+<!ATTLIST bean name CDATA #IMPLIED>
+
+<!--
+	Each bean definition must specify the fully qualified name of the class,
+	except if it pure serves as parent for child bean definitions.
+-->
+<!ATTLIST bean class CDATA #IMPLIED>
+
+<!--
+	Optionally specify a parent bean definition.
+
+	Will use the bean class of the parent if none specified, but can
+	also override it. In the latter case, the child bean class must be
+	compatible with the parent, i.e. accept the parent's property values
+	and constructor argument values, if any.
+
+	A child bean definition will inherit constructor argument values,
+	property values and method overrides from the parent, with the option
+	to add new values. If init method, destroy method, factory bean and/or factory
+	method are specified, they will override the corresponding parent settings.
+
+	The remaining settings will always be taken from the child definition:
+	depends on, autowire mode, dependency check, singleton, lazy init.
+-->
+<!ATTLIST bean parent CDATA #IMPLIED>
+
+<!--
+	Is this bean "abstract", i.e. not meant to be instantiated itself but
+	rather just serving as parent for concrete child bean definitions.
+	Default is false. Specify true to tell the bean factory to not try to
+	instantiate that particular bean in any case.
+-->
+<!ATTLIST bean abstract (true | false) "false">
+
+<!--
+	Is this bean a "singleton" (one shared instance, which will
+	be returned by all calls to getBean() with the id),
+	or a "prototype" (independent instance resulting from each call to
+	getBean(). Default is singleton.
+
+	Singletons are most commonly used, and are ideal for multi-threaded
+	service objects.
+-->
+<!ATTLIST bean singleton (true | false) "true">
+
+<!--
+	If this bean should be lazily initialized.
+	If false, it will get instantiated on startup by bean factories
+	that perform eager initialization of singletons.
+-->
+<!ATTLIST bean lazy-init (true | false | default) "default">
+
+<!--
+	Optional attribute controlling whether to "autowire" bean properties.
+	This is an automagical process in which bean references don't need to be coded
+	explicitly in the XML bean definition file, but Spring works out dependencies.
+
+	There are 5 modes:
+
+	1. "no"
+	The traditional Spring default. No automagical wiring. Bean references
+	must be defined in the XML file via the <ref> element. We recommend this
+	in most cases as it makes documentation more explicit.
+
+	2. "byName"
+	Autowiring by property name. If a bean of class Cat exposes a dog property,
+	Spring will try to set this to the value of the bean "dog" in the current factory.
+	If there is no matching bean by name, nothing special happens;
+	use dependency-check="objects" to raise an error in that case.
+
+	3. "byType"
+	Autowiring if there is exactly one bean of the property type in the bean factory.
+	If there is more than one, a fatal error is raised, and you can't use byType
+	autowiring for that bean. If there is none, nothing special happens;
+	use dependency-check="objects" to raise an error in that case.
+
+	4. "constructor"
+	Analogous to "byType" for constructor arguments. If there isn't exactly one bean
+	of the constructor argument type in the bean factory, a fatal error is raised.
+
+	5. "autodetect"
+	Chooses "constructor" or "byType" through introspection of the bean class.
+	If a default constructor is found, "byType" gets applied.
+
+	The latter two are similar to PicoContainer and make bean factories simple to
+	configure for small namespaces, but doesn't work as well as standard Spring
+	behaviour for bigger applications.
+
+	Note that explicit dependencies, i.e. "property" and "constructor-arg" elements,
+	always override autowiring. Autowire behaviour can be combined with dependency
+	checking, which will be performed after all autowiring has been completed.
+-->
+<!ATTLIST bean autowire (no | byName | byType | constructor | autodetect | default) "default">
+
+<!--
+	Optional attribute controlling whether to check whether all this
+	beans dependencies, expressed in its properties, are satisfied.
+	Default is no dependency checking.
+
+	"simple" type dependency checking includes primitives and String
+	"object" includes collaborators (other beans in the factory)
+	"all" includes both types of dependency checking
+-->
+<!ATTLIST bean dependency-check (none | objects | simple | all | default) "default">
+
+<!--
+	The names of the beans that this bean depends on being initialized.
+	The bean factory will guarantee that these beans get initialized before.
+
+	Note that dependencies are normally expressed through bean properties or
+	constructor arguments. This property should just be necessary for other kinds
+	of dependencies like statics (*ugh*) or database preparation on startup.
+-->
+<!ATTLIST bean depends-on CDATA #IMPLIED>
+
+<!--
+	Optional attribute for the name of the custom initialization method
+	to invoke after setting bean properties. The method must have no arguments,
+	but may throw any exception.
+-->
+<!ATTLIST bean init-method CDATA #IMPLIED>
+
+<!--
+	Optional attribute for the name of the custom destroy method to invoke
+	on bean factory shutdown. The method must have no arguments,
+	but may throw any exception. Note: Only invoked on singleton beans!
+-->
+<!ATTLIST bean destroy-method CDATA #IMPLIED>
+
+<!--
+	Optional attribute specifying the name of a factory method to use to
+	create this object. Use constructor-arg elements to specify arguments
+	to the factory method, if it takes arguments. Autowiring does not apply
+	to factory methods.
+
+	If the "class" attribute is present, the factory method will be a static
+	method on the class specified by the "class" attribute on this bean
+	definition. Often this will be the same class as that of the constructed
+	object - for example, when the factory method is used as an alternative
+	to a constructor. However, it may be on a different class. In that case,
+	the created object will *not* be of the class specified in the "class"
+	attribute. This is analogous to FactoryBean behavior.
+
+	If the "factory-bean" attribute is present, the "class" attribute is not
+	used, and the factory method will be an instance method on the object
+	returned from a getBean call with the specified bean name. The factory
+	bean may be defined as a singleton or a prototype.
+
+	The factory method can have any number of arguments. Autowiring is not
+	supported. Use indexed constructor-arg elements in conjunction with the
+	factory-method attribute.
+
+	Setter Injection can be used in conjunction with a factory method.
+	Method Injection cannot, as the factory method returns an instance,
+	which will be used when the container creates the bean.
+-->
+<!ATTLIST bean factory-method CDATA #IMPLIED>
+
+<!--
+	Alternative to class attribute for factory-method usage.
+	If this is specified, no class attribute should be used.
+	This should be set to the name of a bean in the current or
+	ancestor factories that contains the relevant factory method.
+	This allows the factory itself to be configured using Dependency
+	Injection, and an instance (rather than static) method to be used.
+-->
+<!ATTLIST bean factory-bean CDATA #IMPLIED>
+
+
+<!--
+	Bean definitions can specify zero or more constructor arguments.
+	This is an alternative to "autowire constructor".
+	Arguments correspond to either a specific index of the constructor argument
+	list or are supposed to be matched generically by type.
+
+	Note: A single generic argument value will just be used once, rather than
+	potentially matched multiple times (as of Spring 1.1).
+
+	constructor-arg elements are also used in conjunction with the factory-method
+	element to construct beans using static or instance factory methods.
+-->
+<!ELEMENT constructor-arg (
+	description?,
+	(bean | ref | idref | value | null | list | set | map | props)?
+)>
+
+<!--
+	The constructor-arg tag can have an optional index attribute,
+	to specify the exact index in the constructor argument list. Only needed
+	to avoid ambiguities, e.g. in case of 2 arguments of the same type.
+-->
+<!ATTLIST constructor-arg index CDATA #IMPLIED>
+
+<!--
+	The constructor-arg tag can have an optional type attribute,
+	to specify the exact type of the constructor argument. Only needed
+	to avoid ambiguities, e.g. in case of 2 single argument constructors
+	that can both be converted from a String.
+-->
+<!ATTLIST constructor-arg type CDATA #IMPLIED>
+
+<!--
+  A short-cut alternative to a child element "ref bean=".
+-->
+<!ATTLIST constructor-arg ref CDATA #IMPLIED>
+
+<!--
+  A short-cut alternative to a child element "value".
+-->
+<!ATTLIST constructor-arg value CDATA #IMPLIED>
+
+
+<!--
+	Bean definitions can have zero or more properties.
+	Property elements correspond to JavaBean setter methods exposed
+	by the bean classes. Spring supports primitives, references to other
+	beans in the same or related factories, lists, maps and properties.
+-->
+<!ELEMENT property (
+	description?,
+	(bean | ref | idref | value | null | list | set | map | props)?
+)>
+
+<!--
+	The property name attribute is the name of the JavaBean property.
+	This follows JavaBean conventions: a name of "age" would correspond
+	to setAge()/optional getAge() methods.
+-->
+<!ATTLIST property name CDATA #REQUIRED>
+
+<!--
+  A short-cut alternative to a child element "ref bean=".
+-->
+<!ATTLIST property ref CDATA #IMPLIED>
+
+<!--
+  A short-cut alternative to a child element "value".
+-->
+<!ATTLIST property value CDATA #IMPLIED>
+
+
+<!--
+	A lookup method causes the IoC container to override the given method and return
+	the bean with the name given in the bean attribute. This is a form of Method Injection.
+	It's particularly useful as an alternative to implementing the BeanFactoryAware
+	interface, in order to be able to make getBean() calls for non-singleton instances
+	at runtime. In this case, Method Injection is a less invasive alternative.
+-->
+<!ELEMENT lookup-method EMPTY>
+
+<!--
+	Name of a lookup method. This method should take no arguments.
+-->
+<!ATTLIST lookup-method name CDATA #IMPLIED>
+
+<!--
+	Name of the bean in the current or ancestor factories that the lookup method
+	should resolve to. Often this bean will be a prototype, in which case the
+	lookup method will return a distinct instance on every invocation. This
+	is useful for single-threaded objects.
+-->
+<!ATTLIST lookup-method bean CDATA #IMPLIED>
+
+
+<!--
+	Similar to the lookup method mechanism, the replaced-method element is used to control
+	IoC container method overriding: Method Injection. This mechanism allows the overriding
+	of a method with arbitrary code. 
+-->
+<!ELEMENT replaced-method (
+	(arg-type)*
+)>
+
+<!--
+	Name of the method whose implementation should be replaced by the IoC container.
+	If this method is not overloaded, there's no need to use arg-type subelements.
+	If this method is overloaded, arg-type subelements must be used for all 
+	override definitions for the method.
+-->
+<!ATTLIST replaced-method name CDATA #IMPLIED>
+
+<!--
+	Bean name of an implementation of the MethodReplacer interface
+	in the current or ancestor factories. This may be a singleton or prototype
+	bean. If it's a prototype, a new instance will be used for each method replacement.
+	Singleton usage is the norm.
+-->
+<!ATTLIST replaced-method replacer CDATA #IMPLIED>
+
+<!--
+	Subelement of replaced-method identifying an argument for a replaced method
+	in the event of method overloading.
+-->
+<!ELEMENT arg-type (#PCDATA)>
+
+<!--
+	Specification of the type of an overloaded method argument as a String. 
+	For convenience, this may be a substring of the FQN. E.g. all the
+	following would match "java.lang.String":
+	- java.lang.String
+	- String
+	- Str
+	
+	As the number of arguments will be checked also, this convenience can often
+	be used to save typing.
+-->
+<!ATTLIST arg-type match CDATA #IMPLIED>
+
+
+<!--
+	Defines a reference to another bean in this factory or an external
+	factory (parent or included factory).
+-->
+<!ELEMENT ref EMPTY>
+
+<!--
+	References must specify a name of the target bean.
+	The "bean" attribute can reference any name from any bean in the context,
+	to be checked at runtime.
+	Local references, using the "local" attribute, have to use bean ids;
+	they can be checked by this DTD, thus should be preferred for references
+	within the same bean factory XML file.
+-->
+<!ATTLIST ref bean CDATA #IMPLIED>
+<!ATTLIST ref local IDREF #IMPLIED>
+<!ATTLIST ref parent CDATA #IMPLIED>
+
+
+<!--
+	Defines a string property value, which must also be the id of another
+	bean in this factory or an external factory (parent or included factory).
+	While a regular 'value' element could instead be used for the same effect,
+	using idref in this case allows validation of local bean ids by the xml
+	parser, and name completion by helper tools.
+-->
+<!ELEMENT idref EMPTY>
+
+<!--
+	ID refs must specify a name of the target bean.
+	The "bean" attribute can reference any name from any bean in the context,
+	potentially to be checked at runtime by bean factory implementations.
+	Local references, using the "local" attribute, have to use bean ids;
+	they can be checked by this DTD, thus should be preferred for references
+	within the same bean factory XML file.
+-->
+<!ATTLIST idref bean CDATA #IMPLIED>
+<!ATTLIST idref local IDREF #IMPLIED>
+
+
+<!--
+	Contains a string representation of a property value.
+	The property may be a string, or may be converted to the
+	required type using the JavaBeans PropertyEditor
+	machinery. This makes it possible for application developers
+	to write custom PropertyEditor implementations that can
+	convert strings to objects.
+
+	Note that this is recommended for simple objects only.
+	Configure more complex objects by populating JavaBean
+	properties with references to other beans.
+-->
+<!ELEMENT value (#PCDATA)>
+
+<!--
+	The value tag can have an optional type attribute, to specify the
+	exact type that the value should be converted to. Only needed
+	if the type of the target property or constructor argument is
+	too generic: for example, in case of a collection element.
+-->
+<!ATTLIST value type CDATA #IMPLIED>
+
+<!--
+	Denotes a Java null value. Necessary because an empty "value" tag
+	will resolve to an empty String, which will not be resolved to a
+	null value unless a special PropertyEditor does so.
+-->
+<!ELEMENT null (#PCDATA)>
+
+
+<!--
+	A list can contain multiple inner bean, ref, collection, or value elements.
+	Java lists are untyped, pending generics support in Java 1.5,
+	although references will be strongly typed.
+	A list can also map to an array type. The necessary conversion
+	is automatically performed by the BeanFactory.
+-->
+<!ELEMENT list (
+	(bean | ref | idref | value | null | list | set | map | props)*
+)>
+
+<!--
+	A set can contain multiple inner bean, ref, collection, or value elements.
+	Java sets are untyped, pending generics support in Java 1.5,
+	although references will be strongly typed.
+-->
+<!ELEMENT set (
+	(bean | ref | idref | value | null | list | set | map | props)*
+)>
+
+
+<!--
+	A Spring map is a mapping from a string key to object.
+	Maps may be empty.
+-->
+<!ELEMENT map (
+	(entry)*
+)>
+
+<!--
+	A map entry can be an inner bean, ref, value, or collection.
+	The key of the entry is given by the "key" attribute or child element.
+-->
+<!ELEMENT entry (
+  key?,
+	(bean | ref | idref | value | null | list | set | map | props)?
+)>
+
+<!--
+	Each map element must specify its key as attribute or as child element.
+	A key attribute is always a String value.
+-->
+<!ATTLIST entry key CDATA #IMPLIED>
+
+<!--
+  A short-cut alternative to a "key" element with a "ref bean=" child element.
+-->
+<!ATTLIST entry key-ref CDATA #IMPLIED>
+
+<!--
+  A short-cut alternative to a child element "value".
+-->
+<!ATTLIST entry value CDATA #IMPLIED>
+
+<!--
+  A short-cut alternative to a child element "ref bean=".
+-->
+<!ATTLIST entry value-ref CDATA #IMPLIED>
+
+<!--
+	A key element can contain an inner bean, ref, value, or collection.
+-->
+<!ELEMENT key (
+	(bean | ref | idref | value | null | list | set | map | props)
+)>
+
+
+<!--
+	Props elements differ from map elements in that values must be strings.
+	Props may be empty.
+-->
+<!ELEMENT props (
+	(prop)*
+)>
+
+<!--
+	Element content is the string value of the property.
+	Note that whitespace is trimmed off to avoid unwanted whitespace
+	caused by typical XML formatting.
+-->
+<!ELEMENT prop (#PCDATA)>
+
+<!--
+	Each property element must specify its key.
+-->
+<!ATTLIST prop key CDATA #REQUIRED>
+
diff --git a/xml/tests/testData/completion/web-app_2_4.xsd b/xml/tests/testData/completion/web-app_2_4.xsd
new file mode 100644
index 0000000..9e4f58dc
--- /dev/null
+++ b/xml/tests/testData/completion/web-app_2_4.xsd
@@ -0,0 +1,1242 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+	    targetNamespace="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	    elementFormDefault="qualified"
+	    attributeFormDefault="unqualified"
+	    version="2.4">
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)web-app_2_4.xsds	1.61 04/04/16
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+      Copyright 2003-2007 Sun Microsystems, Inc. All rights reserved.
+
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+
+      Contributor(s):
+
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[
+
+	This is the XML Schema for the Servlet 2.4 deployment descriptor.
+	The deployment descriptor must be named "WEB-INF/web.xml" in the
+	web application's war file.  All Servlet deployment descriptors
+	must indicate the web application schema by using the J2EE
+	namespace:
+
+	http://java.sun.com/xml/ns/j2ee
+
+	and by indicating the version of the schema by
+	using the version element as shown below:
+
+	    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	      xsi:schemaLocation="..."
+	      version="2.4">
+	      ...
+	    </web-app>
+
+	The instance documents may indicate the published version of
+	the schema using the xsi:schemaLocation attribute for J2EE
+	namespace with the following location:
+
+	http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
+
+	]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all J2EE
+      deployment descriptor elements unless indicated otherwise.
+
+      - In elements that specify a pathname to a file within the
+	same JAR file, relative filenames (i.e., those not
+	starting with "/") are considered relative to the root of
+	the JAR file's namespace.  Absolute filenames (i.e., those
+	starting with "/") also specify names in the root of the
+	JAR file's namespace.  In general, relative names are
+	preferred.  The exception is .war files where absolute
+	names are preferred for consistency with the Servlet API.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="j2ee_1_4.xsd"/>
+  <xsd:include schemaLocation="jsp_2_0.xsd"/>
+
+
+<!-- **************************************************** -->
+
+
+  <xsd:element name="web-app" type="j2ee:web-appType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The web-app element is the root of the deployment
+	descriptor for a web application.  Note that the sub-elements
+	of this element can be in the arbitrary order. Because of
+	that, the multiplicity of the elements of distributable,
+	session-config, welcome-file-list, jsp-config, login-config,
+	and locale-encoding-mapping-list was changed from "?" to "*"
+	in this schema.  However, the deployment descriptor instance
+	file must not contain multiple elements of session-config,
+	jsp-config, and login-config. When there are multiple elements of
+	welcome-file-list or locale-encoding-mapping-list, the container
+	must concatinate the element contents.  The multiple occurance
+	of the element distributable is redundant and the container
+	treats that case exactly in the same way when there is only
+	one distributable.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:unique name="web-app-servlet-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The servlet element contains the name of a servlet.
+	  The name must be unique within the web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:servlet"/>
+      <xsd:field    xpath="j2ee:servlet-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-filter-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The filter element contains the name of a filter.
+	  The name must be unique within the web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:filter"/>
+      <xsd:field    xpath="j2ee:filter-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-ejb-local-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The ejb-local-ref-name element contains the name of an EJB
+	  reference. The EJB reference is an entry in the web
+	  application's environment and is relative to the
+	  java:comp/env context.  The name must be unique within
+	  the web application.
+
+	  It is recommended that name is prefixed with "ejb/".
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:ejb-local-ref"/>
+      <xsd:field    xpath="j2ee:ejb-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-ejb-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The ejb-ref-name element contains the name of an EJB
+	  reference. The EJB reference is an entry in the web
+	  application's environment and is relative to the
+	  java:comp/env context.  The name must be unique within
+	  the web application.
+
+	  It is recommended that name is prefixed with "ejb/".
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:ejb-ref"/>
+      <xsd:field    xpath="j2ee:ejb-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-resource-env-ref-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The resource-env-ref-name element specifies the name of
+	  a resource environment reference; its value is the
+	  environment entry name used in the web application code.
+	  The name is a JNDI name relative to the java:comp/env
+	  context and must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:resource-env-ref"/>
+      <xsd:field    xpath="j2ee:resource-env-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-message-destination-ref-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The message-destination-ref-name element specifies the name of
+	  a message destination reference; its value is the
+	  environment entry name used in the web application code.
+	  The name is a JNDI name relative to the java:comp/env
+	  context and must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:message-destination-ref"/>
+      <xsd:field    xpath="j2ee:message-destination-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-res-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The res-ref-name element specifies the name of a
+	  resource manager connection factory reference.  The name
+	  is a JNDI name relative to the java:comp/env context.
+	  The name must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:resource-ref"/>
+      <xsd:field    xpath="j2ee:res-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-env-entry-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The env-entry-name element contains the name of a web
+	  application's environment entry.  The name is a JNDI
+	  name relative to the java:comp/env context.  The name
+	  must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:selector xpath="j2ee:env-entry"/>
+      <xsd:field    xpath="j2ee:env-entry-name"/>
+    </xsd:unique>
+
+    <xsd:key name="web-app-role-name-key">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  A role-name-key is specified to allow the references
+	  from the security-role-refs.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:security-role"/>
+      <xsd:field    xpath="j2ee:role-name"/>
+    </xsd:key>
+
+    <xsd:keyref name="web-app-role-name-references"
+		refer="j2ee:web-app-role-name-key">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The keyref indicates the references from
+	  security-role-ref to a specified role-name.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:servlet/j2ee:security-role-ref"/>
+      <xsd:field    xpath="j2ee:role-link"/>
+    </xsd:keyref>
+  </xsd:element>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="auth-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The auth-constraintType indicates the user roles that
+	should be permitted access to this resource
+	collection. The role-name used here must either correspond
+	to the role-name of one of the security-role elements
+	defined for this web application, or be the specially
+	reserved role-name "*" that is a compact syntax for
+	indicating all roles in the web application. If both "*"
+	and rolenames appear, the container interprets this as all
+	roles.  If no roles are defined, no user is allowed access
+	to the portion of the web application described by the
+	containing security-constraint.  The container matches
+	role names case sensitively when determining access.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="j2ee:descriptionType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+		   type="j2ee:role-nameType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="auth-methodType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The auth-methodType is used to configure the authentication
+	mechanism for the web application. As a prerequisite to
+	gaining access to any web resources which are protected by
+	an authorization constraint, a user must have authenticated
+	using the configured mechanism. Legal values are "BASIC",
+	"DIGEST", "FORM", "CLIENT-CERT", or a vendor-specific
+	authentication scheme.
+
+	Used in: login-config
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="dispatcherType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The dispatcher has four legal values: FORWARD, REQUEST, INCLUDE,
+	and ERROR. A value of FORWARD means the Filter will be applied
+	under RequestDispatcher.forward() calls.  A value of REQUEST
+	means the Filter will be applied under ordinary client calls to
+	the path or servlet. A value of INCLUDE means the Filter will be
+	applied under RequestDispatcher.include() calls.  A value of
+	ERROR means the Filter will be applied under the error page
+	mechanism.  The absence of any dispatcher elements in a
+	filter-mapping indicates a default of applying filters only under
+	ordinary client calls to the path or servlet.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:enumeration value="FORWARD"/>
+	<xsd:enumeration value="INCLUDE"/>
+	<xsd:enumeration value="REQUEST"/>
+	<xsd:enumeration value="ERROR"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="encodingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The encodingType defines IANA character sets.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="[^\s]+"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="error-codeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The error-code contains an HTTP error code, ex: 404
+
+	Used in: error-page
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:xsdPositiveIntegerType">
+	<xsd:pattern value="\d{3}"/>
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="error-pageType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The error-pageType contains a mapping between an error code
+	or exception type to the path of a resource in the web
+	application.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:choice>
+	<xsd:element name="error-code"
+		     type="j2ee:error-codeType"/>
+
+	<xsd:element name="exception-type"
+		     type="j2ee:fully-qualified-classType">
+	  <xsd:annotation>
+	    <xsd:documentation>
+
+	      The exception-type contains a fully qualified class
+	      name of a Java exception type.
+
+	    </xsd:documentation>
+	  </xsd:annotation>
+	</xsd:element>
+      </xsd:choice>
+
+      <xsd:element name="location"
+		   type="j2ee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The location element contains the location of the
+	    resource in the web application relative to the root of
+	    the web application. The value of the location must have
+	    a leading `/'.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filter-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	Declaration of the filter mappings in this web
+	application is done by using filter-mappingType.
+	The container uses the filter-mapping
+	declarations to decide which filters to apply to a request,
+	and in what order. The container matches the request URI to
+	a Servlet in the normal way. To determine which filters to
+	apply it matches filter-mapping declarations either on
+	servlet-name, or on url-pattern for each filter-mapping
+	element, depending on which style is used. The order in
+	which filters are invoked is the order in which
+	filter-mapping declarations that match a request URI for a
+	servlet appear in the list of filter-mapping elements.The
+	filter-name value must be the value of the filter-name
+	sub-elements of one of the filter declarations in the
+	deployment descriptor.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="filter-name"
+		   type="j2ee:filter-nameType"/>
+      <xsd:choice>
+	<xsd:element name="url-pattern"
+		     type="j2ee:url-patternType"/>
+	<xsd:element name="servlet-name"
+		     type="j2ee:servlet-nameType"/>
+      </xsd:choice>
+      <xsd:element name="dispatcher"
+		   type="j2ee:dispatcherType"
+		   minOccurs="0" maxOccurs="4"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filter-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The logical name of the filter is declare
+	by using filter-nameType. This name is used to map the
+	filter.  Each filter name is unique within the web
+	application.
+
+	Used in: filter, filter-mapping
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:extension base="j2ee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filterType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The filterType is used to declare a filter in the web
+	application. The filter is mapped to either a servlet or a
+	URL pattern in the filter-mapping element, using the
+	filter-name value to reference. Filters can access the
+	initialization parameters declared in the deployment
+	descriptor at runtime via the FilterConfig interface.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="j2ee:descriptionGroup"/>
+      <xsd:element name="filter-name"
+		   type="j2ee:filter-nameType"/>
+      <xsd:element name="filter-class"
+		   type="j2ee:fully-qualified-classType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The fully qualified classname of the filter.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="init-param"
+		   type="j2ee:param-valueType"
+		   minOccurs="0" maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The init-param element contains a name/value pair as
+	    an initialization param of a servlet filter
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="form-login-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The form-login-configType specifies the login and error
+	pages that should be used in form based login. If form based
+	authentication is not used, these elements are ignored.
+
+	Used in: login-config
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+
+      <xsd:element name="form-login-page"
+		   type="j2ee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The form-login-page element defines the location in the web
+	    app where the page that can be used for login can be
+	    found.  The path begins with a leading / and is interpreted
+	    relative to the root of the WAR.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="form-error-page"
+		   type="j2ee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The form-error-page element defines the location in
+	    the web app where the error page that is displayed
+	    when login is not successful can be found.
+	    The path begins with a leading / and is interpreted
+	    relative to the root of the WAR.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="http-methodType">
+    <xsd:annotation>
+
+      <xsd:documentation>
+
+	The http-method contains an HTTP method recognized by the
+	web-app, for example GET, POST, ...
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:enumeration value="GET"/>
+	<xsd:enumeration value="POST"/>
+	<xsd:enumeration value="PUT"/>
+	<xsd:enumeration value="DELETE"/>
+	<xsd:enumeration value="HEAD"/>
+	<xsd:enumeration value="OPTIONS"/>
+	<xsd:enumeration value="TRACE"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="locale-encoding-mapping-listType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The locale-encoding-mapping-list contains one or more
+	locale-encoding-mapping(s).
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="locale-encoding-mapping"
+		   type="j2ee:locale-encoding-mappingType"
+		   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="locale-encoding-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The locale-encoding-mapping contains locale name and
+	encoding name. The locale name must be either "Language-code",
+	such as "ja", defined by ISO-639 or "Language-code_Country-code",
+	such as "ja_JP".  "Country code" is defined by ISO-3166.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="locale"
+		   type="j2ee:localeType"/>
+      <xsd:element name="encoding"
+		   type="j2ee:encodingType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="localeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The localeType defines valid locale defined by ISO-639-1
+	and ISO-3166.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="[a-z]{2}(_|-)?([\p{L}\-\p{Nd}]{2})?"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="login-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The login-configType is used to configure the authentication
+	method that should be used, the realm name that should be
+	used for this application, and the attributes that are
+	needed by the form login mechanism.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="auth-method"
+		   type="j2ee:auth-methodType"
+		   minOccurs="0"/>
+      <xsd:element name="realm-name"
+		   type="j2ee:string" minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The realm name element specifies the realm name to
+	    use in HTTP Basic authorization.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="form-login-config"
+		   type="j2ee:form-login-configType"
+		   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mime-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The mime-mappingType defines a mapping between an extension
+	and a mime type.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The extension element contains a string describing an
+	  extension. example: "txt"
+
+	</xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:element name="extension"
+		   type="j2ee:string"/>
+      <xsd:element name="mime-type"
+		   type="j2ee:mime-typeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mime-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The mime-typeType is used to indicate a defined mime type.
+
+	Example:
+	"text/plain"
+
+	Used in: mime-mapping
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:pattern value="[^\p{Cc}^\s]+/[^\p{Cc}^\s]+"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="nonEmptyStringType">
+    <xsd:annotation>
+      <xsd:documentation>
+	This type defines a string which contains at least one
+	character.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:minLength value="1"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The security-constraintType is used to associate
+	security constraints with one or more web resource
+	collections
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="display-name"
+		   type="j2ee:display-nameType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="web-resource-collection"
+		   type="j2ee:web-resource-collectionType"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="auth-constraint"
+		   type="j2ee:auth-constraintType"
+		   minOccurs="0"/>
+      <xsd:element name="user-data-constraint"
+		   type="j2ee:user-data-constraintType"
+		   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servlet-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servlet-mappingType defines a mapping between a
+	servlet and a url pattern.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="servlet-name"
+		   type="j2ee:servlet-nameType"/>
+      <xsd:element name="url-pattern"
+		   type="j2ee:url-patternType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servlet-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servlet-name element contains the canonical name of the
+	servlet. Each servlet name is unique within the web
+	application.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:extension base="j2ee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servletType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servletType is used to declare a servlet.
+	It contains the declarative data of a
+	servlet. If a jsp-file is specified and the load-on-startup
+	element is present, then the JSP should be precompiled and
+	loaded.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="j2ee:descriptionGroup"/>
+      <xsd:element name="servlet-name"
+		   type="j2ee:servlet-nameType"/>
+      <xsd:choice>
+	<xsd:element name="servlet-class"
+		     type="j2ee:fully-qualified-classType">
+	  <xsd:annotation>
+	    <xsd:documentation>
+
+	      The servlet-class element contains the fully
+	      qualified class name of the servlet.
+
+	    </xsd:documentation>
+	  </xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="jsp-file"
+		     type="j2ee:jsp-fileType"/>
+
+      </xsd:choice>
+
+      <xsd:element name="init-param"
+		   type="j2ee:param-valueType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="load-on-startup"
+		   type="j2ee:xsdIntegerType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The load-on-startup element indicates that this
+	    servlet should be loaded (instantiated and have
+	    its init() called) on the startup of the web
+	    application. The optional contents of these
+	    element must be an integer indicating the order in
+	    which the servlet should be loaded. If the value
+	    is a negative integer, or the element is not
+	    present, the container is free to load the servlet
+	    whenever it chooses. If the value is a positive
+	    integer or 0, the container must load and
+	    initialize the servlet as the application is
+	    deployed. The container must guarantee that
+	    servlets marked with lower integers are loaded
+	    before servlets marked with higher integers. The
+	    container may choose the order of loading of
+	    servlets with the same load-on-start-up value.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="run-as"
+		   type="j2ee:run-asType"
+		   minOccurs="0"/>
+      <xsd:element name="security-role-ref"
+		   type="j2ee:security-role-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="session-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The session-configType defines the session parameters
+	for this web application.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="session-timeout"
+		   type="j2ee:xsdIntegerType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The session-timeout element defines the default
+	    session timeout interval for all sessions created
+	    in this web application. The specified timeout
+	    must be expressed in a whole number of minutes.
+	    If the timeout is 0 or less, the container ensures
+	    the default behaviour of sessions is never to time
+	    out. If this element is not specified, the container
+	    must set its default timeout period.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="transport-guaranteeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The transport-guaranteeType specifies that the communication
+	between client and server should be NONE, INTEGRAL, or
+	CONFIDENTIAL. NONE means that the application does not
+	require any transport guarantees. A value of INTEGRAL means
+	that the application requires that the data sent between the
+	client and server be sent in such a way that it can't be
+	changed in transit. CONFIDENTIAL means that the application
+	requires that the data be transmitted in a fashion that
+	prevents other entities from observing the contents of the
+	transmission. In most cases, the presence of the INTEGRAL or
+	CONFIDENTIAL flag will indicate that the use of SSL is
+	required.
+
+	Used in: user-data-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:enumeration value="NONE"/>
+	<xsd:enumeration value="INTEGRAL"/>
+	<xsd:enumeration value="CONFIDENTIAL"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="user-data-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The user-data-constraintType is used to indicate how
+	data communicated between the client and container should be
+	protected.
+
+	Used in: security-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="j2ee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="transport-guarantee"
+		   type="j2ee:transport-guaranteeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="war-pathType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The elements that use this type designate a path starting
+	with a "/" and interpreted relative to the root of a WAR
+	file.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:pattern value="/.*"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="web-app-versionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type contains the recognized versions of
+	web-application supported. It is used to designate the
+	version of the web application.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="2.4"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="web-appType">
+
+    <xsd:choice minOccurs="0" maxOccurs="unbounded">
+      <xsd:group ref="j2ee:descriptionGroup"/>
+      <xsd:element name="distributable"
+		   type="j2ee:emptyType"/>
+      <xsd:element name="context-param"
+		   type="j2ee:param-valueType">
+
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The context-param element contains the declaration
+	    of a web application's servlet context
+	    initialization parameters.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="filter"
+		   type="j2ee:filterType"/>
+      <xsd:element name="filter-mapping"
+		   type="j2ee:filter-mappingType"/>
+      <xsd:element name="listener"
+		   type="j2ee:listenerType"/>
+      <xsd:element name="servlet"
+		   type="j2ee:servletType"/>
+      <xsd:element name="servlet-mapping"
+		   type="j2ee:servlet-mappingType"/>
+      <xsd:element name="session-config"
+		   type="j2ee:session-configType"/>
+      <xsd:element name="mime-mapping"
+		   type="j2ee:mime-mappingType"/>
+      <xsd:element name="welcome-file-list"
+		   type="j2ee:welcome-file-listType"/>
+      <xsd:element name="error-page"
+		   type="j2ee:error-pageType"/>
+      <xsd:element name="jsp-config"
+		   type="j2ee:jsp-configType"/>
+      <xsd:element name="security-constraint"
+		   type="j2ee:security-constraintType"/>
+      <xsd:element name="login-config"
+		   type="j2ee:login-configType"/>
+      <xsd:element name="security-role"
+		   type="j2ee:security-roleType"/>
+      <xsd:group ref="j2ee:jndiEnvironmentRefsGroup"/>
+      <xsd:element name="message-destination"
+		   type="j2ee:message-destinationType"/>
+      <xsd:element name="locale-encoding-mapping-list"
+		   type="j2ee:locale-encoding-mapping-listType"/>
+    </xsd:choice>
+
+    <xsd:attribute name="version"
+		   type="j2ee:web-app-versionType"
+		   use="required"/>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="web-resource-collectionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The web-resource-collectionType is used to identify a subset
+	of the resources and HTTP methods on those resources within
+	a web application to which a security constraint applies. If
+	no HTTP methods are specified, then the security constraint
+	applies to all HTTP methods.
+
+	Used in: security-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="web-resource-name"
+		   type="j2ee:string">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The web-resource-name contains the name of this web
+	    resource collection.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="description"
+		   type="j2ee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="url-pattern"
+		   type="j2ee:url-patternType"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="http-method"
+		   type="j2ee:http-methodType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="welcome-file-listType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The welcome-file-list contains an ordered list of welcome
+	files elements.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="welcome-file"
+		   type="xsd:string"
+		   maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The welcome-file element contains file name to use
+	    as a default welcome file, such as index.html
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+</xsd:schema>
+
diff --git a/xml/tests/testData/completion/xhtml1-strict.xsd b/xml/tests/testData/completion/xhtml1-strict.xsd
new file mode 100644
index 0000000..d9480a5
--- /dev/null
+++ b/xml/tests/testData/completion/xhtml1-strict.xsd
@@ -0,0 +1,2211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema version="1.0" xml:lang="en"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.w3.org/1999/xhtml"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:xml="http://www.w3.org/XML/1998/namespace"
+    elementFormDefault="qualified">
+
+  <xs:annotation>
+    <xs:documentation>
+    XHTML 1.0 (Second Edition) Strict in XML Schema
+
+    This is the same as HTML 4 Strict except for
+    changes due to the differences between XML and SGML.
+
+    Namespace = http://www.w3.org/1999/xhtml
+
+    For further information, see: http://www.w3.org/TR/xhtml1
+
+    Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
+    All Rights Reserved. 
+
+    The DTD version is identified by the PUBLIC and SYSTEM identifiers:
+
+    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+
+    $Id: xhtml1-strict.xsd,v 1.1 2004/11/12 19:18:03 Maxim.Mossienko Exp $
+    </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>
+    ================ Character mnemonic entities =========================
+
+    XHTML entity sets are identified by the PUBLIC and SYSTEM identifiers:
+  
+    PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent"
+
+    PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent"
+
+    PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent"
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Imported Names ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="ContentType">
+    <xs:annotation>
+      <xs:documentation>
+      media type, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="ContentTypes">
+    <xs:annotation>
+      <xs:documentation>
+      comma-separated list of media types, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Charset">
+    <xs:annotation>
+      <xs:documentation>
+      a character encoding, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Charsets">
+    <xs:annotation>
+      <xs:documentation>
+      a space separated list of character encodings, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="LanguageCode">
+    <xs:annotation>
+      <xs:documentation>
+      a language code, as per [RFC3066]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:language"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Character">
+    <xs:annotation>
+      <xs:documentation>
+      a single character, as per section 2.2 of [XML]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:length value="1" fixed="true"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Number">
+    <xs:annotation>
+      <xs:documentation>
+      one or more digits
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger">
+      <xs:pattern value="[0-9]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="tabindexNumber">
+    <xs:annotation>
+      <xs:documentation>
+      tabindex attribute specifies the position of the current element
+      in the tabbing order for the current document. This value must be
+      a number between 0 and 32767. User agents should ignore leading zeros. 
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="Number">
+      <xs:minInclusive value="0"/>
+      <xs:maxInclusive value="32767"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="LinkTypes">
+    <xs:annotation>
+      <xs:documentation>
+      space-separated list of link types
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKENS"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="MediaDesc">
+    <xs:annotation>
+      <xs:documentation>
+      single or comma-separated list of media descriptors
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[^,]+(,\s*[^,]+)*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="URI">
+    <xs:annotation>
+      <xs:documentation>
+      a Uniform Resource Identifier, see [RFC2396]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:anyURI"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="UriList">
+    <xs:annotation>
+      <xs:documentation>
+      a space separated list of Uniform Resource Identifiers
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Datetime">
+    <xs:annotation>
+      <xs:documentation>
+      date and time information. ISO date format
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:dateTime"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Script">
+    <xs:annotation>
+      <xs:documentation>
+      script expression
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="StyleSheet">
+    <xs:annotation>
+      <xs:documentation>
+      style sheet data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Text">
+    <xs:annotation>
+      <xs:documentation>
+      used for titles etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Length">
+    <xs:annotation>
+      <xs:documentation>
+      nn for pixels or nn% for percentage length
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[\-+]?(\d+|\d+(\.\d+)?%)"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="MultiLength">
+    <xs:annotation>
+      <xs:documentation>
+      pixel, percentage, or relative
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[\-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Pixels">
+    <xs:annotation>
+      <xs:documentation>
+      integer representing length in pixels
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger"/>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    these are used for image maps
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="Shape">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="rect"/>
+      <xs:enumeration value="circle"/>
+      <xs:enumeration value="poly"/>
+      <xs:enumeration value="default"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Coords">
+    <xs:annotation>
+      <xs:documentation>
+      comma separated list of lengths
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern
+          value="[\-+]?(\d+|\d+(\.\d+)?%)(,\s*[\-+]?(\d+|\d+(\.\d+)?%))*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Generic Attributes ===============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attributeGroup name="coreattrs">
+    <xs:annotation>
+      <xs:documentation>
+      core attributes common to most elements
+      id       document-wide unique id
+      class    space separated list of classes
+      style    associated style info
+      title    advisory title/amplification
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="id" type="xs:ID"/>
+    <xs:attribute name="class" type="xs:NMTOKENS"/>
+    <xs:attribute name="style" type="StyleSheet"/>
+    <xs:attribute name="title" type="Text"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="i18n">
+    <xs:annotation>
+      <xs:documentation>
+      internationalization attributes
+      lang        language code (backwards compatible)
+      xml:lang    language code (as per XML 1.0 spec)
+      dir         direction for weak/neutral text
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="lang" type="LanguageCode"/>
+    <xs:attribute ref="xml:lang"/>
+    <xs:attribute name="dir">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="ltr"/>
+          <xs:enumeration value="rtl"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="events">
+    <xs:annotation>
+      <xs:documentation>
+      attributes for common UI events
+      onclick     a pointer button was clicked
+      ondblclick  a pointer button was double clicked
+      onmousedown a pointer button was pressed down
+      onmouseup   a pointer button was released
+      onmousemove a pointer was moved onto the element
+      onmouseout  a pointer was moved away from the element
+      onkeypress  a key was pressed and released
+      onkeydown   a key was pressed down
+      onkeyup     a key was released
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="onclick" type="Script"/>
+    <xs:attribute name="ondblclick" type="Script"/>
+    <xs:attribute name="onmousedown" type="Script"/>
+    <xs:attribute name="onmouseup" type="Script"/>
+    <xs:attribute name="onmouseover" type="Script"/>
+    <xs:attribute name="onmousemove" type="Script"/>
+    <xs:attribute name="onmouseout" type="Script"/>
+    <xs:attribute name="onkeypress" type="Script"/>
+    <xs:attribute name="onkeydown" type="Script"/>
+    <xs:attribute name="onkeyup" type="Script"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="focus">
+    <xs:annotation>
+      <xs:documentation>
+      attributes for elements that can get the focus
+      accesskey   accessibility key character
+      tabindex    position in tabbing order
+      onfocus     the element got the focus
+      onblur      the element lost the focus
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="accesskey" type="Character"/>
+    <xs:attribute name="tabindex" type="tabindexNumber"/>
+    <xs:attribute name="onfocus" type="Script"/>
+    <xs:attribute name="onblur" type="Script"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="attrs">
+    <xs:attributeGroup ref="coreattrs"/>
+    <xs:attributeGroup ref="i18n"/>
+    <xs:attributeGroup ref="events"/>
+  </xs:attributeGroup>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Text Elements ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="special.pre">
+    <xs:choice>
+      <xs:element ref="br"/>
+      <xs:element ref="span"/>
+      <xs:element ref="bdo"/>
+      <xs:element ref="map"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="special">
+    <xs:choice>
+      <xs:group ref="special.pre"/>
+      <xs:element ref="object"/>
+      <xs:element ref="img"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle">
+    <xs:choice>
+      <xs:element ref="tt"/>
+      <xs:element ref="i"/>
+      <xs:element ref="b"/>
+      <xs:element ref="big"/>
+      <xs:element ref="small"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase">
+    <xs:choice>
+      <xs:element ref="em"/>
+      <xs:element ref="strong"/>
+      <xs:element ref="dfn"/>
+      <xs:element ref="code"/>
+      <xs:element ref="q"/>
+      <xs:element ref="samp"/>
+      <xs:element ref="kbd"/>
+      <xs:element ref="var"/>
+      <xs:element ref="cite"/>
+      <xs:element ref="abbr"/>
+      <xs:element ref="acronym"/>
+      <xs:element ref="sub"/>
+      <xs:element ref="sup"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="inline.forms">
+    <xs:choice>
+      <xs:element ref="input"/>
+      <xs:element ref="select"/>
+      <xs:element ref="textarea"/>
+      <xs:element ref="label"/>
+      <xs:element ref="button"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="misc.inline">
+    <xs:choice>
+      <xs:element ref="ins"/>
+      <xs:element ref="del"/>
+      <xs:element ref="script"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="misc">
+    <xs:annotation>
+      <xs:documentation>
+      these can only occur at block level
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:element ref="noscript"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="inline">
+    <xs:choice>
+      <xs:element ref="a"/>
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="inline.forms"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="Inline" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      "Inline" covers inline or "text-level" elements
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="inline"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Block level elements ==============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="heading">
+    <xs:choice>
+      <xs:element ref="h1"/>
+      <xs:element ref="h2"/>
+      <xs:element ref="h3"/>
+      <xs:element ref="h4"/>
+      <xs:element ref="h5"/>
+      <xs:element ref="h6"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="lists">
+    <xs:choice>
+      <xs:element ref="ul"/>
+      <xs:element ref="ol"/>
+      <xs:element ref="dl"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="blocktext">
+    <xs:choice>
+      <xs:element ref="pre"/>
+      <xs:element ref="hr"/>
+      <xs:element ref="blockquote"/>
+      <xs:element ref="address"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="block">
+    <xs:choice>
+      <xs:element ref="p"/>
+      <xs:group ref="heading"/>
+      <xs:element ref="div"/>
+      <xs:group ref="lists"/>
+      <xs:group ref="blocktext"/>
+      <xs:element ref="fieldset"/>
+      <xs:element ref="table"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="Block">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:element ref="form"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="Flow" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      "Flow" mixes block and inline and is used for list items etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:element ref="form"/>
+      <xs:group ref="inline"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Content models for exclusions =====================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:complexType name="a.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      a elements use "Inline" excluding a
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="inline.forms"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="pre.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      pre uses "Inline" excluding big, small, sup or sup
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="a"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="special.pre"/>
+      <xs:group ref="misc.inline"/>
+      <xs:group ref="inline.forms"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="form.content">
+    <xs:annotation>
+      <xs:documentation>
+      form uses "Block" excluding form
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="button.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      button uses "Flow" but excludes a, form and form controls
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="p"/>
+      <xs:group ref="heading"/>
+      <xs:element ref="div"/>
+      <xs:group ref="lists"/>
+      <xs:group ref="blocktext"/>
+      <xs:element ref="table"/>
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Document Structure ==================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="html">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="head"/>
+        <xs:element ref="body"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Document Head =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="head.misc">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="script"/>
+        <xs:element ref="style"/>
+        <xs:element ref="meta"/>
+        <xs:element ref="link"/>
+        <xs:element ref="object"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:group>
+
+  <xs:element name="head">
+    <xs:annotation>
+      <xs:documentation>
+      content model is "head.misc" combined with a single
+      title and an optional base element in any order
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="head.misc"/>
+        <xs:choice>
+          <xs:sequence>
+            <xs:element ref="title"/>
+            <xs:group ref="head.misc"/>
+            <xs:sequence minOccurs="0">
+              <xs:element ref="base"/>
+              <xs:group ref="head.misc"/>
+            </xs:sequence>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element ref="base"/>
+            <xs:group ref="head.misc"/>
+            <xs:element ref="title"/>
+            <xs:group ref="head.misc"/>
+          </xs:sequence>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="profile" type="URI"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="title">
+    <xs:annotation>
+      <xs:documentation>
+      The title element is not considered part of the flow of text.
+      It should be displayed, for example as the page header or
+      window title. Exactly one title is required per document.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="base">
+    <xs:annotation>
+      <xs:documentation>
+      document base URI
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="href" use="required" type="URI"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="meta">
+    <xs:annotation>
+      <xs:documentation>
+      generic metainformation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="http-equiv"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="content" use="required"/>
+      <xs:attribute name="scheme"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="link">
+    <xs:annotation>
+      <xs:documentation>
+      Relationship values can be used in principle:
+
+      a) for document specific toolbars/menus when used
+         with the link element in document head e.g.
+           start, contents, previous, next, index, end, help
+      b) to link to a separate style sheet (rel="stylesheet")
+      c) to make a link to a script (rel="script")
+      d) by stylesheets to control how collections of
+         html nodes are rendered into printed documents
+      e) to make a link to a printable version of this document
+         e.g. a PostScript or PDF version (rel="alternate" media="print")
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="charset" type="Charset"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="hreflang" type="LanguageCode"/>
+      <xs:attribute name="type" type="ContentType"/>
+      <xs:attribute name="rel" type="LinkTypes"/>
+      <xs:attribute name="rev" type="LinkTypes"/>
+      <xs:attribute name="media" type="MediaDesc"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="style">
+    <xs:annotation>
+      <xs:documentation>
+      style info, which may include CDATA sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="type" use="required" type="ContentType"/>
+      <xs:attribute name="media" type="MediaDesc"/>
+      <xs:attribute name="title" type="Text"/>
+      <xs:attribute ref="xml:space" fixed="preserve"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="script">
+    <xs:annotation>
+      <xs:documentation>
+      script statements, which may include CDATA sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="charset" type="Charset"/>
+      <xs:attribute name="type" use="required" type="ContentType"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="defer">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="defer"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute ref="xml:space" fixed="preserve"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="noscript">
+    <xs:annotation>
+      <xs:documentation>
+      alternate content container for non script-based rendering
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="Block">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Document Body ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="body">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="Block">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="onload" type="Script"/>
+          <xs:attribute name="onunload" type="Script"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="div">
+    <xs:annotation>
+      <xs:documentation>
+      generic language/style container      
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Paragraphs =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="p">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Headings =========================================
+
+    There are six levels of headings from h1 (the most important)
+    to h6 (the least important).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="h1">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h2">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h3">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h4">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h5">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h6">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Lists ============================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="ul">
+    <xs:annotation>
+      <xs:documentation>
+      Unordered list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="ol">
+    <xs:annotation>
+      <xs:documentation>
+      Ordered (numbered) list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="li">
+    <xs:annotation>
+      <xs:documentation>
+      list item
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    definition lists - dt for term, dd for its definition
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="dl">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="dt"/>
+        <xs:element ref="dd"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dt">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dd">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Address ==========================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="address">
+    <xs:annotation>
+      <xs:documentation>
+      information on author
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Horizontal Rule ==================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="hr">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Preformatted Text ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="pre">
+    <xs:annotation>
+      <xs:documentation>
+      content is "Inline" excluding "img|object|big|small|sub|sup"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="pre.content">
+           <xs:attributeGroup ref="attrs"/>
+           <xs:attribute ref="xml:space" fixed="preserve"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Block-like Quotes ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="blockquote">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="Block">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Inserted/Deleted Text ============================
+
+    ins/del are allowed in block and inline content, but its
+    inappropriate to include block content within an ins element
+    occurring in inline content.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="ins">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+          <xs:attribute name="datetime" type="Datetime"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="del">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+          <xs:attribute name="datetime" type="Datetime"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== The Anchor Element ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="a">
+    <xs:annotation>
+      <xs:documentation>
+      content is "Inline" except that anchors shouldn't be nested
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="a.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="focus"/>
+          <xs:attribute name="charset" type="Charset"/>
+          <xs:attribute name="type" type="ContentType"/>
+          <xs:attribute name="name" type="xs:NMTOKEN"/>
+          <xs:attribute name="href" type="URI"/>
+          <xs:attribute name="hreflang" type="LanguageCode"/>
+          <xs:attribute name="rel" type="LinkTypes"/>
+          <xs:attribute name="rev" type="LinkTypes"/>
+          <xs:attribute name="shape" default="rect" type="Shape"/>
+          <xs:attribute name="coords" type="Coords"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ===================== Inline Elements ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="span">
+    <xs:annotation>
+      <xs:documentation>
+      generic language/style container
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="bdo">
+    <xs:annotation>
+      <xs:documentation>
+      I18N BiDi over-ride
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attributeGroup ref="events"/>
+          <xs:attribute name="lang" type="LanguageCode"/>
+          <xs:attribute ref="xml:lang"/>
+          <xs:attribute name="dir" use="required">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="ltr"/>
+                <xs:enumeration value="rtl"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="br">
+    <xs:annotation>
+      <xs:documentation>
+      forced line break
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="coreattrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="em">
+    <xs:annotation>
+      <xs:documentation>
+      emphasis
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="strong">
+    <xs:annotation>
+      <xs:documentation>
+      strong emphasis
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dfn">
+    <xs:annotation>
+      <xs:documentation>
+      definitional
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="code">
+    <xs:annotation>
+      <xs:documentation>
+      program code
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="samp">
+    <xs:annotation>
+      <xs:documentation>
+      sample
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="kbd">
+    <xs:annotation>
+      <xs:documentation>
+      something user would type
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="var">
+    <xs:annotation>
+      <xs:documentation>
+      variable
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="cite">
+    <xs:annotation>
+      <xs:documentation>
+      citation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="abbr">
+    <xs:annotation>
+      <xs:documentation>
+      abbreviation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="acronym">
+    <xs:annotation>
+      <xs:documentation>
+      acronym
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="q">
+    <xs:annotation>
+      <xs:documentation>
+      inlined quote
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="sub">
+    <xs:annotation>
+      <xs:documentation>
+      subscript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="sup">
+    <xs:annotation>
+      <xs:documentation>
+      superscript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tt">
+    <xs:annotation>
+      <xs:documentation>
+      fixed pitch font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="i">
+    <xs:annotation>
+      <xs:documentation>
+      italic font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="b">
+    <xs:annotation>
+      <xs:documentation>
+      bold font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="big">
+    <xs:annotation>
+      <xs:documentation>
+      bigger font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="small">
+    <xs:annotation>
+      <xs:documentation>
+      smaller font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ==================== Object ======================================
+
+    object is used to embed objects as part of HTML pages.
+    param elements should precede other content. Parameters
+    can also be expressed as attribute/value pairs on the
+    object element itself when brevity is desired.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="object">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="param"/>
+        <xs:group ref="block"/>
+        <xs:element ref="form"/>
+        <xs:group ref="inline"/>
+        <xs:group ref="misc"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="declare">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="declare"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="classid" type="URI"/>
+      <xs:attribute name="codebase" type="URI"/>
+      <xs:attribute name="data" type="URI"/>
+      <xs:attribute name="type" type="ContentType"/>
+      <xs:attribute name="codetype" type="ContentType"/>
+      <xs:attribute name="archive" type="UriList"/>
+      <xs:attribute name="standby" type="Text"/>
+      <xs:attribute name="height" type="Length"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="usemap" type="URI"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="tabindex" type="tabindexNumber"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="param">
+    <xs:annotation>
+      <xs:documentation>
+      param is used to supply a named property value.
+      In XML it would seem natural to follow RDF and support an
+      abbreviated syntax where the param elements are replaced
+      by attribute value pairs on the object start tag.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="value"/>
+      <xs:attribute name="valuetype" default="data">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="data"/>
+            <xs:enumeration value="ref"/>
+            <xs:enumeration value="object"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="type" type="ContentType"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Images ===========================================
+
+    To avoid accessibility problems for people who aren't
+    able to see the image, you should provide a text
+    description using the alt and longdesc attributes.
+    In addition, avoid the use of server-side image maps.
+    Note that in this DTD there is no name attribute. That
+    is only available in the transitional and frameset DTD.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="img">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="src" use="required" type="URI"/>
+      <xs:attribute name="alt" use="required" type="Text"/>
+      <xs:attribute name="longdesc" type="URI"/>
+      <xs:attribute name="height" type="Length"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="usemap" type="URI">
+	<xs:annotation>
+	  <xs:documentation>
+          usemap points to a map element which may be in this document
+          or an external document, although the latter is not widely supported
+          </xs:documentation>
+	</xs:annotation>
+      </xs:attribute>
+      <xs:attribute name="ismap">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="ismap"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Client-side image maps ============================
+
+    These can be placed in the same document or grouped in a
+    separate document although this isn't yet widely supported
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="map">
+    <xs:complexType>
+      <xs:choice>
+        <xs:choice maxOccurs="unbounded">
+          <xs:group ref="block"/>
+          <xs:element ref="form"/>
+          <xs:group ref="misc"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="area"/>
+      </xs:choice>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attributeGroup ref="events"/>
+      <xs:attribute name="id" use="required" type="xs:ID"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style" type="StyleSheet"/>
+      <xs:attribute name="title" type="Text"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="area">
+    <xs:complexType>
+        <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="shape" default="rect" type="Shape"/>
+      <xs:attribute name="coords" type="Coords"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="nohref">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="nohref"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="alt" use="required" type="Text"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Forms ===============================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="form">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="form.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="action" use="required" type="URI"/>
+          <xs:attribute name="method" default="get">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="get"/>
+                <xs:enumeration value="post"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="enctype" type="ContentType"
+              default="application/x-www-form-urlencoded"/>
+          <xs:attribute name="onsubmit" type="Script"/>
+          <xs:attribute name="onreset" type="Script"/>
+          <xs:attribute name="accept" type="ContentTypes"/>
+          <xs:attribute name="accept-charset" type="Charsets"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="label">
+    <xs:annotation>
+      <xs:documentation>
+      Each label must not contain more than ONE field
+      Label elements shouldn't be nested.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="for" type="xs:IDREF"/>
+          <xs:attribute name="accesskey" type="Character"/>
+          <xs:attribute name="onfocus" type="Script"/>
+          <xs:attribute name="onblur" type="Script"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="InputType">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="text"/>
+      <xs:enumeration value="password"/>
+      <xs:enumeration value="checkbox"/>
+      <xs:enumeration value="radio"/>
+      <xs:enumeration value="submit"/>
+      <xs:enumeration value="reset"/>
+      <xs:enumeration value="file"/>
+      <xs:enumeration value="hidden"/>
+      <xs:enumeration value="image"/>
+      <xs:enumeration value="button"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="input">
+    <xs:annotation>
+      <xs:documentation>
+      form control
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="type" default="text" type="InputType"/>
+      <xs:attribute name="name">
+	<xs:annotation>
+	  <xs:documentation>
+          the name attribute is required for all but submit &amp; reset
+          </xs:documentation>
+	</xs:annotation>
+      </xs:attribute>
+      <xs:attribute name="value"/>
+      <xs:attribute name="checked">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="checked"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="readonly">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="readonly"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="size"/>
+      <xs:attribute name="maxlength" type="Number"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="alt"/>
+      <xs:attribute name="usemap" type="URI"/>
+      <xs:attribute name="onselect" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+      <xs:attribute name="accept" type="ContentTypes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="select">
+    <xs:annotation>
+      <xs:documentation>
+      option selector
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="optgroup"/>
+        <xs:element ref="option"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="size" type="Number"/>
+      <xs:attribute name="multiple">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="multiple"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="tabindex" type="tabindexNumber"/>
+      <xs:attribute name="onfocus" type="Script"/>
+      <xs:attribute name="onblur" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="optgroup">
+    <xs:annotation>
+      <xs:documentation>
+      option group
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="option"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="label" use="required" type="Text"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="option">
+    <xs:annotation>
+      <xs:documentation>
+      selectable choice
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="selected">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="selected"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="label" type="Text"/>
+      <xs:attribute name="value"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="textarea">
+    <xs:annotation>
+      <xs:documentation>
+      multi-line text field
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="rows" use="required" type="Number"/>
+      <xs:attribute name="cols" use="required" type="Number"/>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="readonly">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="readonly"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="onselect" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="fieldset">
+    <xs:annotation>
+      <xs:documentation>
+      The fieldset element is used to group form fields.
+      Only one legend element should occur in the content
+      and if present should only be preceded by whitespace.
+
+      NOTE: this content model is different from the XHTML 1.0 DTD,
+      closer to the intended content model in HTML4 DTD
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:sequence>
+        <xs:element ref="legend"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:group ref="block"/>
+          <xs:element ref="form"/>
+          <xs:group ref="inline"/>
+          <xs:group ref="misc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="legend">
+    <xs:annotation>
+      <xs:documentation>
+      fieldset label
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="accesskey" type="Character"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="button">
+    <xs:annotation>
+      <xs:documentation>
+      Content is "Flow" excluding a, form and form controls
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="button.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="focus"/>
+          <xs:attribute name="name"/>
+          <xs:attribute name="value"/>
+          <xs:attribute name="type" default="submit">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="button"/>
+                <xs:enumeration value="submit"/>
+                <xs:enumeration value="reset"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="disabled">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="disabled"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ======================= Tables =======================================
+
+    Derived from IETF HTML table standard, see [RFC1942]
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="TFrame">
+    <xs:annotation>
+      <xs:documentation>
+      The border attribute sets the thickness of the frame around the
+      table. The default units are screen pixels.
+
+      The frame attribute specifies which parts of the frame around
+      the table should be rendered. The values are not the same as
+      CALS to avoid a name clash with the valign attribute.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="void"/>
+      <xs:enumeration value="above"/>
+      <xs:enumeration value="below"/>
+      <xs:enumeration value="hsides"/>
+      <xs:enumeration value="lhs"/>
+      <xs:enumeration value="rhs"/>
+      <xs:enumeration value="vsides"/>
+      <xs:enumeration value="box"/>
+      <xs:enumeration value="border"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="TRules">
+    <xs:annotation>
+      <xs:documentation>
+      The rules attribute defines which rules to draw between cells:
+
+      If rules is absent then assume:
+          "none" if border is absent or border="0" otherwise "all"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="none"/>
+      <xs:enumeration value="groups"/>
+      <xs:enumeration value="rows"/>
+      <xs:enumeration value="cols"/>
+      <xs:enumeration value="all"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:attributeGroup name="cellhalign">
+    <xs:annotation>
+      <xs:documentation>
+      horizontal alignment attributes for cell contents
+
+      char        alignment char, e.g. char=':'
+      charoff     offset for alignment char
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="align">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="left"/>
+          <xs:enumeration value="center"/>
+          <xs:enumeration value="right"/>
+          <xs:enumeration value="justify"/>
+          <xs:enumeration value="char"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="char" type="Character"/>
+    <xs:attribute name="charoff" type="Length"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="cellvalign">
+    <xs:annotation>
+      <xs:documentation>
+      vertical alignment attributes for cell contents
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="valign">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="top"/>
+          <xs:enumeration value="middle"/>
+          <xs:enumeration value="bottom"/>
+          <xs:enumeration value="baseline"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:element name="table">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="caption"/>
+        <xs:choice>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="colgroup"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="thead"/>
+        <xs:element minOccurs="0" ref="tfoot"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="tbody"/>
+          <xs:element maxOccurs="unbounded" ref="tr"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="summary" type="Text"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="border" type="Pixels"/>
+      <xs:attribute name="frame" type="TFrame"/>
+      <xs:attribute name="rules" type="TRules"/>
+      <xs:attribute name="cellspacing" type="Length"/>
+      <xs:attribute name="cellpadding" type="Length"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="caption">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    Use thead to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    tbody sections are rendered in scrolling panel.
+
+    Use tfoot to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    tbody sections are rendered in scrolling panel.
+
+    Use multiple tbody sections when rules are needed
+    between groups of table rows.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="thead">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tfoot">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tbody">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="colgroup">
+    <xs:annotation>
+      <xs:documentation>
+      colgroup groups a set of col elements. It allows you to group
+      several semantically related columns together.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="span" default="1" type="Number"/>
+      <xs:attribute name="width" type="MultiLength"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="col">
+    <xs:annotation>
+      <xs:documentation>
+      col elements define the alignment properties for cells in
+      one or more columns.
+
+      The width attribute specifies the width of the columns, e.g.
+
+          width=64        width in screen pixels
+          width=0.5*      relative width of 0.5
+
+      The span attribute causes the attributes of one
+      col element to apply to more than one column.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="span" default="1" type="Number"/>
+      <xs:attribute name="width" type="MultiLength"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tr">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="th"/>
+        <xs:element ref="td"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="Scope">
+    <xs:annotation>
+      <xs:documentation>
+      Scope is simpler than headers attribute for common tables
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="row"/>
+      <xs:enumeration value="col"/>
+      <xs:enumeration value="rowgroup"/>
+      <xs:enumeration value="colgroup"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    th is for headers, td for data and for cells acting as both
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="th">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="abbr" type="Text"/>
+          <xs:attribute name="axis"/>
+          <xs:attribute name="headers" type="xs:IDREFS"/>
+          <xs:attribute name="scope" type="Scope"/>
+          <xs:attribute name="rowspan" default="1" type="Number"/>
+          <xs:attribute name="colspan" default="1" type="Number"/>
+          <xs:attributeGroup ref="cellhalign"/>
+          <xs:attributeGroup ref="cellvalign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="td">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="abbr" type="Text"/>
+          <xs:attribute name="axis"/>
+          <xs:attribute name="headers" type="xs:IDREFS"/>
+          <xs:attribute name="scope" type="Scope"/>
+          <xs:attribute name="rowspan" default="1" type="Number"/>
+          <xs:attribute name="colspan" default="1" type="Number"/>
+          <xs:attributeGroup ref="cellhalign"/>
+          <xs:attributeGroup ref="cellvalign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+</xs:schema>
diff --git a/xml/tests/testData/completion/xslt.xsd b/xml/tests/testData/completion/xslt.xsd
new file mode 100644
index 0000000..27da9ae
--- /dev/null
+++ b/xml/tests/testData/completion/xslt.xsd
@@ -0,0 +1,628 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+XSLT v1.0 XSD Schema for Visual Studio.NET
+(c) 2002 Fesersoft. All Rights Reserved.
+http://www.fesersoft.com/dotnet
[email protected]
+v1.1.5 5/10/2003
+-->
+<xsd:schema
+xmlns="http://www.w3.org/1999/XSL/Transform" 
+xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+version="1.0" 
+targetNamespace="http://www.w3.org/1999/XSL/Transform" 
+elementFormDefault="qualified" 
+xmlns:vs="http://schemas.fesersoft.com/Visual-Studio-Intellisense" 
+vs:ishtmlschema="false" 
+vs:iscasesensitive="true" 
+vs:friendlyname="XSLT v1.0 Schema"
+>
+
+	<xsd:element name="apply-imports">
+		<xsd:simpleType>
+			<xsd:restriction base="xsd:string">
+				<xsd:maxLength value="0"/>
+			</xsd:restriction>
+		</xsd:simpleType>
+	</xsd:element>
+	
+	<xsd:element name="apply-templates">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="sort" />
+				<xsd:element ref="with-param" />
+			</xsd:choice>
+			<xsd:attribute name="select" />
+			<xsd:attribute name="mode" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="attribute">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-imports" />
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="fallback" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="message" />
+				<xsd:element ref="number" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+			<xsd:attribute name="name" use="required" />
+			<xsd:attribute name="namespace" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="attribute-set">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="attribute" />
+			</xsd:choice>
+			<xsd:attribute name="name" use="required" />
+			<xsd:attribute name="use-attribute-sets" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="call-template">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="with-param" />
+			</xsd:choice>
+			<xsd:attribute name="name" use="required" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="choose">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="otherwise" />
+				<xsd:element ref="when" />
+			</xsd:choice>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="comment">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-imports" />
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="fallback" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="message" />
+				<xsd:element ref="number" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="copy">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="attribute" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="comment" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="element" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="processing-instruction" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+			<xsd:attribute name="use-attribute-sets" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="copy-of">
+		<xsd:complexType mixed="true">
+			<xsd:attribute name="select" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="decimal-format">
+		<xsd:complexType mixed="true">
+			<xsd:attribute name="name" />
+			<xsd:attribute name="decimal-separator" />
+			<xsd:attribute name="grouping-separator" />
+			<xsd:attribute name="infinity" />
+			<xsd:attribute name="minus-sign" />
+			<xsd:attribute name="NaN" />
+			<xsd:attribute name="percent" />
+			<xsd:attribute name="per-mille" />
+			<xsd:attribute name="zero-digit" />
+			<xsd:attribute name="digit" />
+			<xsd:attribute name="pattern-separator" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="element">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="attribute" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="comment" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="element" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="processing-instruction" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+			<xsd:attribute name="name" use="required" />
+			<xsd:attribute name="namespace" />
+			<xsd:attribute name="use-attribute-sets" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="fallback">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="attribute" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="comment" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="element" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="processing-instruction" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="for-each">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-imports" />
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="attribute" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="comment" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="element" />
+				<xsd:element ref="fallback" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="message" />
+				<xsd:element ref="number" />
+				<xsd:element ref="processing-instruction" />
+				<xsd:element ref="sort" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+			<xsd:attribute name="select" use="required" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="if">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="attribute" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="comment" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="element" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="processing-instruction" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+			<xsd:attribute name="test" use="required" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="import">
+		<xsd:complexType mixed="true">
+			<xsd:attribute name="href" use="required" type="xsd:anyURI" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="include">
+		<xsd:complexType mixed="true">
+			<xsd:attribute name="href" use="required" type="xsd:anyURI" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="key">
+		<xsd:complexType mixed="true">
+			<xsd:attribute name="name" />
+			<xsd:attribute name="match" />
+			<xsd:attribute name="use" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="message">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="attribute" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="comment" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="element" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+					<xsd:element ref="processing-instruction" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+			<xsd:attribute name="terminate" default="no">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="no" />
+						<xsd:enumeration value="yes" />
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="namespace-alias">
+		<xsd:complexType mixed="true">
+			<xsd:attribute name="stylesheet-prefix" />
+			<xsd:attribute name="result-prefix" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="number">
+		<xsd:complexType mixed="true">
+			<xsd:attribute name="level" default="single">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="single" />
+						<xsd:enumeration value="multiple" />
+						<xsd:enumeration value="any" />
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="count" />
+			<xsd:attribute name="from" />
+			<xsd:attribute name="value" />
+			<xsd:attribute name="format" />
+			<xsd:attribute name="lang" />
+			<xsd:attribute name="letter-value" default="alphabetic">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="alphabetic" />
+						<xsd:enumeration value="traditional" />
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="grouping-separator" />
+			<xsd:attribute name="grouping-size" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="otherwise">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="attribute" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="comment" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="element" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="processing-instruction" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="output">
+		<xsd:complexType mixed="true">
+			<xsd:attribute name="method" default="xml">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="xml" />
+						<xsd:enumeration value="html" />
+						<xsd:enumeration value="text" />
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="version" />
+			<xsd:attribute name="encoding" />
+			<xsd:attribute name="omit-xml-declaration" default="yes">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="yes" />
+						<xsd:enumeration value="no" />
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="standalone" default="no">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="yes" />
+						<xsd:enumeration value="no" />
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="doctype-public" />
+			<xsd:attribute name="cdata-section-elements" />
+			<xsd:attribute name="indent" default="yes">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="yes" />
+						<xsd:enumeration value="no" />
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="media-type" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="param">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="attribute" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="comment" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="element" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="processing-instruction" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+			<xsd:attribute name="name" use="required" />
+			<xsd:attribute name="select" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="preserve-space">
+		<xsd:complexType mixed="true">
+			<xsd:attribute name="elements" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="processing-instruction">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-imports" />
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="fallback" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="message" />
+				<xsd:element ref="number" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+			<xsd:attribute name="name" use="required" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="sort">
+		<xsd:complexType mixed="true">
+			<xsd:attribute name="select" />
+			<xsd:attribute name="lang" />
+			<xsd:attribute name="data-type">
+				<xsd:simpleType>
+					<xsd:union>
+						<xsd:simpleType>
+							<xsd:restriction base="xsd:NMTOKEN">
+								<xsd:enumeration value="text" />
+								<xsd:enumeration value="number" />
+							</xsd:restriction>
+						</xsd:simpleType>
+						<xsd:simpleType>
+							<xsd:restriction base="xsd:string" />
+						</xsd:simpleType>
+					</xsd:union>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="order" default="ascending">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="ascending" />
+						<xsd:enumeration value="descending" />
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="case-order" default="upper-first">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="upper-first" />
+						<xsd:enumeration value="lower-first" />
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="strip-space">
+		<xsd:complexType mixed="true">
+			<xsd:attribute name="elements" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="stylesheet" vs:defaultelement="1">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="attribute-set" />
+				<xsd:element ref="decimal-format" />
+				<xsd:element ref="import" />
+				<xsd:element ref="include" />
+				<xsd:element ref="key" />
+				<xsd:element ref="output" />
+				<xsd:element ref="param" />
+				<xsd:element ref="preserve-space" />
+				<xsd:element ref="strip-space" />
+				<xsd:element ref="template" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+			<xsd:attribute name="id" />
+			<xsd:attribute name="extension-element-prefixes" />
+			<xsd:attribute name="exclude-result-prefixes" />
+			<xsd:attribute name="version" type="xsd:double" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="template">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-imports" />
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="attribute" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="comment" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="element" />
+				<xsd:element ref="fallback" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="message" />
+				<xsd:element ref="number" />
+				<xsd:element ref="param" />
+				<xsd:element ref="processing-instruction" />
+				<xsd:element ref="preserve-space" />
+				<xsd:element ref="strip-space" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+                		<xsd:any namespace="http://www.w3.org/1999/xhtml" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+			<xsd:attribute name="name" />
+			<xsd:attribute name="match" />
+			<xsd:attribute name="priority" type="xsd:double" />
+			<xsd:attribute name="mode" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="text">
+		<xsd:complexType mixed="true">
+			<xsd:attribute name="disable-output-escaping" default="no">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="yes" />
+						<xsd:enumeration value="no" />
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="transform">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="attribute-set" />
+				<xsd:element ref="import" />
+				<xsd:element ref="include" />
+				<xsd:element ref="output" />
+				<xsd:element ref="param" />
+				<xsd:element ref="template" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+			<xsd:attribute name="id" />
+			<xsd:attribute name="extension-element-prefixes" />
+			<xsd:attribute name="exclude-result-prefixes" />
+			<xsd:attribute name="version" type="xsd:double" use="required" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="value-of">
+		<xsd:complexType mixed="true">
+			<xsd:attribute name="select" use="required" />
+			<xsd:attribute name="disable-output-escaping" default="no">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="yes" />
+						<xsd:enumeration value="no" />
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="variable">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="attribute" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="comment" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="element" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="processing-instruction" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+			<xsd:attribute name="name" use="required" />
+			<xsd:attribute name="select" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="when">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="attribute" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="comment" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="element" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="processing-instruction" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+			<xsd:attribute name="test" use="required" />
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:element name="with-param">
+		<xsd:complexType mixed="true">
+			<xsd:choice>
+				<xsd:element ref="apply-templates" />
+				<xsd:element ref="attribute" />
+				<xsd:element ref="call-template" />
+				<xsd:element ref="choose" />
+				<xsd:element ref="comment" />
+				<xsd:element ref="copy" />
+				<xsd:element ref="copy-of" />
+				<xsd:element ref="element" />
+				<xsd:element ref="for-each" />
+				<xsd:element ref="if" />
+				<xsd:element ref="processing-instruction" />
+				<xsd:element ref="text" />
+				<xsd:element ref="value-of" />
+				<xsd:element ref="variable" />
+			</xsd:choice>
+			<xsd:attribute name="name" use="required" />
+			<xsd:attribute name="select" />
+		</xsd:complexType>
+	</xsd:element>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/constraints/test.xml b/xml/tests/testData/constraints/test.xml
new file mode 100644
index 0000000..624fb36
--- /dev/null
+++ b/xml/tests/testData/constraints/test.xml
@@ -0,0 +1,3 @@
+<a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd">
+
+</a>
diff --git a/xml/tests/testData/constraints/test.xsd b/xml/tests/testData/constraints/test.xsd
new file mode 100644
index 0000000..64a520e
--- /dev/null
+++ b/xml/tests/testData/constraints/test.xsd
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="unqualified"
+           elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:element name="a" type="aType"/>
+  <xs:complexType name="aType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="b"/>
+      <xs:element type="xs:string" name="c" minOccurs="1" maxOccurs="5"/>
+      <xs:element type="xs:string" name="d" minOccurs="z" maxOccurs="x"/>
+      <xs:element type="xs:string" name="e" maxOccurs="unbounded"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/constraints/testCompletion.xml b/xml/tests/testData/constraints/testCompletion.xml
new file mode 100644
index 0000000..7345f6a
--- /dev/null
+++ b/xml/tests/testData/constraints/testCompletion.xml
@@ -0,0 +1,4 @@
+<a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd">
+  <b></b>
+  <<caret>
+</a>
diff --git a/xml/tests/testData/constraints/testDtd.xml b/xml/tests/testData/constraints/testDtd.xml
new file mode 100644
index 0000000..4d8c5e6
--- /dev/null
+++ b/xml/tests/testData/constraints/testDtd.xml
@@ -0,0 +1,10 @@
+<!DOCTYPE a [
+        <!ELEMENT a (b, c?, d+, e*)>
+        <!ELEMENT b (#PCDATA)>
+        <!ELEMENT c (#PCDATA)>
+        <!ELEMENT d (#PCDATA)>
+        <!ELEMENT e (#PCDATA)>
+        ]>
+<a >
+
+</a>
diff --git a/xml/tests/testData/constraints/testIncomplete.xml b/xml/tests/testData/constraints/testIncomplete.xml
new file mode 100644
index 0000000..007f5601
--- /dev/null
+++ b/xml/tests/testData/constraints/testIncomplete.xml
@@ -0,0 +1,3 @@
+<a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd">
+  <
+</a>
diff --git a/xml/tests/testData/folding/styleAttributeFolding.html b/xml/tests/testData/folding/styleAttributeFolding.html
new file mode 100644
index 0000000..92b0dfc
--- /dev/null
+++ b/xml/tests/testData/folding/styleAttributeFolding.html
@@ -0,0 +1,5 @@
+<html<fold text='...'>>
+<body class="c1" id="#seriou" style="<fold text='...'>border: 1px solid black;</fold>"<fold text='...'>>
+<strong style="<fold text='...'>color: rgb(51,51,51);</fold>"/>
+</body</fold>>
+</html</fold>>
\ No newline at end of file
diff --git a/xml/tests/testData/folding/styleAttributeFolding2.xml b/xml/tests/testData/folding/styleAttributeFolding2.xml
new file mode 100644
index 0000000..1273ae0
--- /dev/null
+++ b/xml/tests/testData/folding/styleAttributeFolding2.xml
@@ -0,0 +1,3 @@
+<body class="c1" id="#seriou" style="border: 1px solid black"<fold text='...'>>
+<strong style="color: rgb(51,51,51);"/>
+</body</fold>>
\ No newline at end of file
diff --git a/xml/tests/testData/folding/tagFolding.html b/xml/tests/testData/folding/tagFolding.html
new file mode 100644
index 0000000..2ae5365
--- /dev/null
+++ b/xml/tests/testData/folding/tagFolding.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+    "http://www.w3.org/TR/html4/loose.dtd">
+<html<fold text='...'>>
+  <head<fold text='...'>>
+    <title>Title</title>
+  </head</fold>>
+  <body class="container"<fold text='...'>>
+    <p>this is a</p>
+    <p<fold text='...'>>
+      test
+    </p</fold>>
+  </body</fold>>
+</html</fold>>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/generate.xml b/xml/tests/testData/generateTag/generate.xml
new file mode 100644
index 0000000..ba0d537
--- /dev/null
+++ b/xml/tests/testData/generateTag/generate.xml
@@ -0,0 +1,8 @@
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+		  web-app_2_5.xsd"
+         version="2.5">
+
+  <caret>
+</web-app>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/generateDTD.xml b/xml/tests/testData/generateTag/generateDTD.xml
new file mode 100644
index 0000000..d35500a
--- /dev/null
+++ b/xml/tests/testData/generateTag/generateDTD.xml
@@ -0,0 +1,17 @@
+<!DOCTYPE a [
+
+        <!ELEMENT a (b)* >
+
+        <!ELEMENT  b  (c, d)>
+        <!ELEMENT  c  (#PCDATA)>
+        <!ATTLIST b
+                x       CDATA          #REQUIRED
+                y       CDATA          #IMPLIED
+        >
+
+        <!ELEMENT  d  (#PCDATA)>
+        ]>
+
+<a>
+    <caret>
+</a>
diff --git a/xml/tests/testData/generateTag/generateDTDComplex.xml b/xml/tests/testData/generateTag/generateDTDComplex.xml
new file mode 100644
index 0000000..b35503e
--- /dev/null
+++ b/xml/tests/testData/generateTag/generateDTDComplex.xml
@@ -0,0 +1,19 @@
+<!DOCTYPE a [
+
+        <!ELEMENT a (b)* >
+
+        <!ELEMENT  b  (c, d)>
+        <!ELEMENT  c  (#PCDATA)>
+        <!ATTLIST b
+                x       CDATA          #REQUIRED
+                y       CDATA          #IMPLIED
+        >
+
+        <!ELEMENT  d  EMPTY>
+        <!ATTLIST d
+                z       CDATA          #REQUIRED
+        >
+        ]>
+<a>
+  <caret>
+</a>
diff --git a/xml/tests/testData/generateTag/generateDTDComplex_after.xml b/xml/tests/testData/generateTag/generateDTDComplex_after.xml
new file mode 100644
index 0000000..2f2db8a
--- /dev/null
+++ b/xml/tests/testData/generateTag/generateDTDComplex_after.xml
@@ -0,0 +1,22 @@
+<!DOCTYPE a [
+
+        <!ELEMENT a (b)* >
+
+        <!ELEMENT  b  (c, d)>
+        <!ELEMENT  c  (#PCDATA)>
+        <!ATTLIST b
+                x       CDATA          #REQUIRED
+                y       CDATA          #IMPLIED
+        >
+
+        <!ELEMENT  d  EMPTY>
+        <!ATTLIST d
+                z       CDATA          #REQUIRED
+        >
+        ]>
+<a>
+  <b x="">
+      <c></c>
+      <d z=""/>
+  </b>
+</a>
diff --git a/xml/tests/testData/generateTag/generateDTD_after.xml b/xml/tests/testData/generateTag/generateDTD_after.xml
new file mode 100644
index 0000000..f401f51
--- /dev/null
+++ b/xml/tests/testData/generateTag/generateDTD_after.xml
@@ -0,0 +1,20 @@
+<!DOCTYPE a [
+
+        <!ELEMENT a (b)* >
+
+        <!ELEMENT  b  (c, d)>
+        <!ELEMENT  c  (#PCDATA)>
+        <!ATTLIST b
+                x       CDATA          #REQUIRED
+                y       CDATA          #IMPLIED
+        >
+
+        <!ELEMENT  d  (#PCDATA)>
+        ]>
+
+<a>
+    <b x="">
+        <c></c>
+        <d></d>
+    </b>
+</a>
diff --git a/xml/tests/testData/generateTag/generateEmpty.xml b/xml/tests/testData/generateTag/generateEmpty.xml
new file mode 100644
index 0000000..ba0d537
--- /dev/null
+++ b/xml/tests/testData/generateTag/generateEmpty.xml
@@ -0,0 +1,8 @@
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+		  web-app_2_5.xsd"
+         version="2.5">
+
+  <caret>
+</web-app>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/generateEmpty_after.xml b/xml/tests/testData/generateTag/generateEmpty_after.xml
new file mode 100644
index 0000000..707c8d3
--- /dev/null
+++ b/xml/tests/testData/generateTag/generateEmpty_after.xml
@@ -0,0 +1,8 @@
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+		  web-app_2_5.xsd"
+         version="2.5">
+
+  <distributable/>
+</web-app>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/generate_after.xml b/xml/tests/testData/generateTag/generate_after.xml
new file mode 100644
index 0000000..58b865b
--- /dev/null
+++ b/xml/tests/testData/generateTag/generate_after.xml
@@ -0,0 +1,13 @@
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+		  web-app_2_5.xsd"
+         version="2.5">
+
+  <security-constraint>
+      <web-resource-collection>
+          <web-resource-name></web-resource-name>
+          <url-pattern></url-pattern>
+      </web-resource-collection>
+  </security-constraint>
+</web-app>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/initParam.xml b/xml/tests/testData/generateTag/initParam.xml
new file mode 100644
index 0000000..ec73f0e
--- /dev/null
+++ b/xml/tests/testData/generateTag/initParam.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+        "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
+<web-app>
+
+  <caret>
+
+</web-app>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/initParam_after.xml b/xml/tests/testData/generateTag/initParam_after.xml
new file mode 100644
index 0000000..c57f802
--- /dev/null
+++ b/xml/tests/testData/generateTag/initParam_after.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+        "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
+<web-app>
+
+  <context-param>
+      <param-name></param-name>
+      <param-value></param-value>
+  </context-param>
+
+</web-app>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/javaee_5.xsd b/xml/tests/testData/generateTag/javaee_5.xsd
new file mode 100644
index 0000000..59b6575
--- /dev/null
+++ b/xml/tests/testData/generateTag/javaee_5.xsd
@@ -0,0 +1,2117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ The contents of this file are subject to the terms
+ of the Common Development and Distribution License
+ (the "License").  You may not use this file except
+ in compliance with the License.
+
+ You can obtain a copy of the license at
+ glassfish/bootstrap/legal/CDDLv1.0.txt or
+ https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ See the License for the specific language governing
+ permissions and limitations under the License.
+
+ When distributing Covered Code, include this CDDL
+ HEADER in each file and include the License file at
+ glassfish/bootstrap/legal/CDDLv1.0.txt.  If applicable,
+ add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your
+ own identifying information: Portions Copyright [yyyy]
+ [name of copyright owner]
+-->
+
+<xsd:schema
+     targetNamespace="http://java.sun.com/xml/ns/javaee"
+     xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+     elementFormDefault="qualified"
+     attributeFormDefault="unqualified"
+     version="5">
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)javaee_5.xsds	1.63 06/02/07
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      Copyright 2003-2005 Sun Microsystems, Inc.
+      4150 Network Circle
+      Santa Clara, California 95054
+      U.S.A
+      All rights reserved.
+
+      Sun Microsystems, Inc. has intellectual property rights
+      relating to technology described in this document. In
+      particular, and without limitation, these intellectual
+      property rights may include one or more of the U.S. patents
+      listed at http://www.sun.com/patents and one or more
+      additional patents or pending patent applications in the
+      U.S. and other countries.
+
+      This document and the technology which it describes are
+      distributed under licenses restricting their use, copying,
+      distribution, and decompilation. No part of this document
+      may be reproduced in any form by any means without prior
+      written authorization of Sun and its licensors, if any.
+
+      Third-party software, including font technology, is
+      copyrighted and licensed from Sun suppliers.
+
+      Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
+      JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+      Cup logo are trademarks or registered trademarks of Sun
+      Microsystems, Inc. in the U.S. and other countries.
+
+      Federal Acquisitions: Commercial Software - Government Users
+      Subject to Standard License Terms and Conditions.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+<xsd:annotation>
+<xsd:documentation>
+
+The following definitions that appear in the common
+shareable schema(s) of J2EE deployment descriptors should be
+interpreted with respect to the context they are included:
+
+Deployment Component may indicate one of the following:
+    j2ee application;
+    application client;
+    web application;
+    enterprise bean;
+    resource adapter;
+
+Deployment File may indicate one of the following:
+    ear file;
+    war file;
+    jar file;
+    rar file;
+
+</xsd:documentation>
+</xsd:annotation>
+
+  <xsd:import namespace="http://www.w3.org/XML/1998/namespace"
+	      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+
+  <xsd:include schemaLocation="javaee_web_services_client_1_2.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:group name="descriptionGroup">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This group keeps the usage of the contained description related
+	elements consistent across Java EE deployment descriptors.
+
+	All elements may occur multiple times with different languages,
+	to support localization of the content.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="display-name"
+		   type="javaee:display-nameType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="icon"
+		   type="javaee:iconType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:group>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="descriptionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The description type is used by a description element to
+	provide text describing the parent element.  The elements
+	that use this type should include any information that the
+	Deployment Component's Deployment File file producer wants
+	to provide to the consumer of the Deployment Component's
+	Deployment File (i.e., to the Deployer). Typically, the
+	tools used by such a Deployment File consumer will display
+	the description when processing the parent element that
+	contains the description.
+
+	The lang attribute defines the language that the
+	description is provided in. The default value is "en" (English).
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:xsdStringType">
+	<xsd:attribute ref="xml:lang"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="dewey-versionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type defines a dewey decimal that is used
+	to describe versions of documents.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="\.?[0-9]+(\.[0-9]+)*"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="display-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The display-name type contains a short name that is intended
+	  to be displayed by tools. It is used by display-name
+	  elements.  The display name need not be unique.
+
+	  Example:
+
+	  ...
+	     <display-name xml:lang="en">
+	       Employee Self Service
+	     </display-name>
+
+	  The value of the xml:lang attribute is "en" (English) by default.
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:string">
+	<xsd:attribute ref="xml:lang"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-linkType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The ejb-linkType is used by ejb-link
+	  elements in the ejb-ref or ejb-local-ref elements to specify
+	  that an EJB reference is linked to enterprise bean.
+
+	  The value of the ejb-link element must be the ejb-name of an
+	  enterprise bean in the same ejb-jar file or in another ejb-jar
+	  file in the same Java EE application unit.
+
+	  Alternatively, the name in the ejb-link element may be
+	  composed of a path name specifying the ejb-jar containing the
+	  referenced enterprise bean with the ejb-name of the target
+	  bean appended and separated from the path name by "#".  The
+	  path name is relative to the Deployment File containing
+	  Deployment Component that is referencing the enterprise
+	  bean.  This allows multiple enterprise beans with the same
+	  ejb-name to be uniquely identified.
+
+	  Examples:
+
+	      <ejb-link>EmployeeRecord</ejb-link>
+
+	      <ejb-link>../products/product.jar#ProductEJB</ejb-link>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-local-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The ejb-local-refType is used by ejb-local-ref elements for
+	the declaration of a reference to an enterprise bean's local
+	home or to the local business interface of a 3.0 bean.
+        The declaration consists of:
+
+	    - an optional description
+	    - the EJB reference name used in the code of the Deployment
+	      Component that's referencing the enterprise bean.
+	    - the optional expected type of the referenced enterprise bean
+	    - the optional expected local interface of the referenced
+              enterprise bean or the local business interface of the
+              referenced enterprise bean.
+	    - the optional expected local home interface of the referenced
+              enterprise bean. Not applicable if this ejb-local-ref refers
+              to the local business interface of a 3.0 bean.
+	    - optional ejb-link information, used to specify the
+	      referenced enterprise bean
+            - optional elements to define injection of the named enterprise
+              bean into a component field or property.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-ref-name"
+		   type="javaee:ejb-ref-nameType"/>
+      <xsd:element name="ejb-ref-type"
+		   type="javaee:ejb-ref-typeType"
+                   minOccurs="0"/>
+      <xsd:element name="local-home"
+		   type="javaee:local-homeType"
+                   minOccurs="0"/>
+      <xsd:element name="local"
+		   type="javaee:localType"
+                   minOccurs="0"/>
+      <xsd:element name="ejb-link"
+		   type="javaee:ejb-linkType"
+		   minOccurs="0"/>
+      <xsd:group ref="javaee:resourceGroup"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-ref-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The ejb-ref-name element contains the name of an EJB
+	  reference. The EJB reference is an entry in the
+	  Deployment Component's environment and is relative to the
+	  java:comp/env context.  The name must be unique within the
+	  Deployment Component.
+
+	  It is recommended that name is prefixed with "ejb/".
+
+	  Example:
+
+	  <ejb-ref-name>ejb/Payroll</ejb-ref-name>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:jndi-nameType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-ref-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The ejb-ref-typeType contains the expected type of the
+	referenced enterprise bean.
+
+	The ejb-ref-type designates a value
+	that must be one of the following:
+
+	    Entity
+	    Session
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="Entity"/>
+	<xsd:enumeration value="Session"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The ejb-refType is used by ejb-ref elements for the
+	declaration of a reference to an enterprise bean's home or
+        to the remote business interface of a 3.0 bean.
+	The declaration consists of:
+
+	    - an optional description
+	    - the EJB reference name used in the code of
+	      the Deployment Component that's referencing the enterprise
+	      bean.
+	    - the optional expected type of the referenced enterprise bean
+            - the optional remote interface of the referenced enterprise bean
+              or the remote business interface of the referenced enterprise
+              bean
+	    - the optional expected home interface of the referenced
+              enterprise bean.  Not applicable if this ejb-ref
+              refers to the remote business interface of a 3.0 bean.
+	    - optional ejb-link information, used to specify the
+	      referenced enterprise bean
+            - optional elements to define injection of the named enterprise
+              bean into a component field or property
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-ref-name"
+		   type="javaee:ejb-ref-nameType"/>
+      <xsd:element name="ejb-ref-type"
+		   type="javaee:ejb-ref-typeType"
+		   minOccurs="0"/>
+      <xsd:element name="home"
+		   type="javaee:homeType"
+		   minOccurs="0"/>
+      <xsd:element name="remote"
+		   type="javaee:remoteType"
+                   minOccurs="0"/>
+      <xsd:element name="ejb-link"
+		   type="javaee:ejb-linkType"
+		   minOccurs="0"/>
+      <xsd:group ref="javaee:resourceGroup"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="emptyType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type is used to designate an empty
+	element when used.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="env-entry-type-valuesType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  This type contains the fully-qualified Java type of the
+	  environment entry value that is expected by the
+	  application's code.
+
+	  The following are the legal values of env-entry-type-valuesType:
+
+	      java.lang.Boolean
+	      java.lang.Byte
+	      java.lang.Character
+	      java.lang.String
+	      java.lang.Short
+	      java.lang.Integer
+	      java.lang.Long
+	      java.lang.Float
+	      java.lang.Double
+
+	  Example:
+
+	  <env-entry-type>java.lang.Boolean</env-entry-type>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="java.lang.Boolean"/>
+	<xsd:enumeration value="java.lang.Byte"/>
+	<xsd:enumeration value="java.lang.Character"/>
+	<xsd:enumeration value="java.lang.String"/>
+	<xsd:enumeration value="java.lang.Short"/>
+	<xsd:enumeration value="java.lang.Integer"/>
+	<xsd:enumeration value="java.lang.Long"/>
+	<xsd:enumeration value="java.lang.Float"/>
+	<xsd:enumeration value="java.lang.Double"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="env-entryType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The env-entryType is used to declare an application's
+	environment entry. The declaration consists of an optional
+	description, the name of the environment entry, a type
+	(optional if the value is injected, otherwise required), and
+	an optional value.
+
+	It also includes optional elements to define injection of
+	the named resource into fields or JavaBeans properties.
+
+	If a value is not specified and injection is requested,
+	no injection will occur and no entry of the specified name
+	will be created.  This allows an initial value to be
+	specified in the source code without being incorrectly
+	changed when no override has been specified.
+
+	If a value is not specified and no injection is requested,
+	a value must be supplied during deployment.
+
+	This type is used by env-entry elements.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="env-entry-name"
+		   type="javaee:jndi-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      The env-entry-name element contains the name of a
+	      Deployment Component's environment entry.  The name
+	      is a JNDI name relative to the java:comp/env
+	      context.  The name must be unique within a
+	      Deployment Component. The uniqueness
+	      constraints must be defined within the declared
+	      context.
+
+	      Example:
+
+	      <env-entry-name>minAmount</env-entry-name>
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="env-entry-type"
+		   type="javaee:env-entry-type-valuesType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      The env-entry-type element contains the Java language
+	      type of the environment entry.  If an injection target
+	      is specified for the environment entry, the type may
+	      be omitted, or must match the type of the injection
+	      target.  If no injection target is specified, the type
+	      is required.
+
+	      Example:
+
+	      <env-entry-type>java.lang.Integer</env-entry-type>
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="env-entry-value"
+		   type="javaee:xsdStringType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      The env-entry-value designates the value of a
+	      Deployment Component's environment entry. The value
+	      must be a String that is valid for the
+	      constructor of the specified type that takes a
+	      single String parameter, or for java.lang.Character,
+	      a single character.
+
+	      Example:
+
+	      <env-entry-value>100.00</env-entry-value>
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:group ref="javaee:resourceGroup"/>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="fully-qualified-classType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The elements that use this type designate the name of a
+	Java class or interface.  The name is in the form of a
+	"binary name", as defined in the JLS.  This is the form
+	of name used in Class.forName().  Tools that need the
+	canonical name (the name used in source code) will need
+	to convert this binary name to the canonical name.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="generic-booleanType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type defines four different values which can designate
+	boolean values. This includes values yes and no which are
+	not designated by xsd:boolean
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="true"/>
+	<xsd:enumeration value="false"/>
+	<xsd:enumeration value="yes"/>
+	<xsd:enumeration value="no"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="homeType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The homeType defines the fully-qualified name of
+	  an enterprise bean's home interface.
+
+	  Example:
+
+	      <home>com.aardvark.payroll.PayrollHome</home>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="iconType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The icon type contains small-icon and large-icon elements
+	that specify the file names for small and large GIF, JPEG,
+	or PNG icon images used to represent the parent element in a
+	GUI tool.
+
+	The xml:lang attribute defines the language that the
+	icon file names are provided in. Its value is "en" (English)
+	by default.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="small-icon" type="javaee:pathType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      The small-icon element contains the name of a file
+	      containing a small (16 x 16) icon image. The file
+	      name is a relative path within the Deployment
+	      Component's Deployment File.
+
+	      The image may be in the GIF, JPEG, or PNG format.
+	      The icon can be used by tools.
+
+	      Example:
+
+	      <small-icon>employee-service-icon16x16.jpg</small-icon>
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="large-icon" type="javaee:pathType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      The large-icon element contains the name of a file
+	      containing a large
+	      (32 x 32) icon image. The file name is a relative
+	      path within the Deployment Component's Deployment
+	      File.
+
+	      The image may be in the GIF, JPEG, or PNG format.
+	      The icon can be used by tools.
+
+	      Example:
+
+	      <large-icon>employee-service-icon32x32.jpg</large-icon>
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+    </xsd:sequence>
+
+    <xsd:attribute ref="xml:lang"/>
+    <xsd:attribute name="id" type="xsd:ID"/>
+
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="injection-targetType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	An injection target specifies a class and a name within
+	that class into which a resource should be injected.
+
+	The injection target class specifies the fully qualified
+	class name that is the target of the injection.  The
+	Java EE specifications describe which classes can be an
+	injection target.
+
+	The injection target name specifies the target within
+	the specified class.  The target is first looked for as a
+	JavaBeans property name.  If not found, the target is
+	looked for as a field name.
+
+	The specified resource will be injected into the target
+	during initialization of the class by either calling the
+	set method for the target property or by setting a value
+	into the named field.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="injection-target-class"
+		   type="javaee:fully-qualified-classType"/>
+      <xsd:element name="injection-target-name"
+		   type="javaee:java-identifierType"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="java-identifierType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The java-identifierType defines a Java identifier.
+	The users of this type should further verify that
+	the content does not contain Java reserved keywords.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:pattern value="($|_|\p{L})(\p{L}|\p{Nd}|_|$)*"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="java-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This is a generic type that designates a Java primitive
+	type or a fully qualified name of a Java interface/type,
+	or an array of such types.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:pattern value="[^\p{Z}]*"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="jndi-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The jndi-nameType type designates a JNDI name in the
+	Deployment Component's environment and is relative to the
+	java:comp/env context.  A JNDI name must be unique within the
+	Deployment Component.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:group name="jndiEnvironmentRefsGroup">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This group keeps the usage of the contained JNDI environment
+	reference elements consistent across Java EE deployment descriptors.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="env-entry"
+		   type="javaee:env-entryType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="ejb-ref"
+		   type="javaee:ejb-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="ejb-local-ref"
+		   type="javaee:ejb-local-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:group ref="javaee:service-refGroup"/>
+      <xsd:element name="resource-ref"
+		   type="javaee:resource-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="resource-env-ref"
+		   type="javaee:resource-env-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="message-destination-ref"
+		   type="javaee:message-destination-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="persistence-context-ref"
+		   type="javaee:persistence-context-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="persistence-unit-ref"
+		   type="javaee:persistence-unit-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="post-construct"
+		   type="javaee:lifecycle-callbackType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="pre-destroy"
+		   type="javaee:lifecycle-callbackType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:group>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="lifecycle-callbackType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The lifecycle-callback type specifies a method on a
+	class to be called when a lifecycle event occurs.
+	Note that each class may have only one lifecycle callback
+        method for any given event and that the method may not
+	be overloaded.
+
+        If the lifefycle-callback-class element is missing then
+        the class defining the callback is assumed to be the
+        component class in scope at the place in the descriptor
+        in which the callback definition appears.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="lifecycle-callback-class"
+		   type="javaee:fully-qualified-classType"
+                   minOccurs="0"/>
+      <xsd:element name="lifecycle-callback-method"
+		   type="javaee:java-identifierType"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="listenerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The listenerType indicates the deployment properties for a web
+	application listener bean.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="listener-class"
+		   type="javaee:fully-qualified-classType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The listener-class element declares a class in the
+	    application must be registered as a web
+	    application listener bean. The value is the fully
+	    qualified classname of the listener class.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="local-homeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The local-homeType defines the fully-qualified
+	name of an enterprise bean's local home interface.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="localType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The localType defines the fully-qualified name of an
+	enterprise bean's local interface.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destination-linkType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The message-destination-linkType is used to link a message
+	destination reference or message-driven bean to a message
+	destination.
+
+	The Assembler sets the value to reflect the flow of messages
+	between producers and consumers in the application.
+
+	The value must be the message-destination-name of a message
+	destination in the same Deployment File or in another
+	Deployment File in the same Java EE application unit.
+
+	Alternatively, the value may be composed of a path name
+	specifying a Deployment File containing the referenced
+	message destination with the message-destination-name of the
+	destination appended and separated from the path name by
+	"#". The path name is relative to the Deployment File
+	containing Deployment Component that is referencing the
+	message destination.  This allows multiple message
+	destinations with the same name to be uniquely identified.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destination-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The message-destination-ref element contains a declaration
+	  of Deployment Component's reference to a message destination
+	  associated with a resource in Deployment Component's
+	  environment. It consists of:
+
+		  - an optional description
+		  - the message destination reference name
+		  - an optional message destination type
+		  - an optional specification as to whether
+		    the destination is used for
+		    consuming or producing messages, or both.
+		    if not specified, "both" is assumed.
+		  - an optional link to the message destination
+		  - optional injection targets
+
+	  The message destination type must be supplied unless an
+	  injection target is specified, in which case the type
+	  of the target is used.  If both are specified, the type
+	  must be assignment compatible with the type of the injection
+	  target.
+
+	  Examples:
+
+	  <message-destination-ref>
+		  <message-destination-ref-name>jms/StockQueue
+		  </message-destination-ref-name>
+		  <message-destination-type>javax.jms.Queue
+		  </message-destination-type>
+		  <message-destination-usage>Consumes
+		  </message-destination-usage>
+		  <message-destination-link>CorporateStocks
+		  </message-destination-link>
+	  </message-destination-ref>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="message-destination-ref-name"
+		   type="javaee:jndi-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The message-destination-ref-name element specifies
+	    the name of a message destination reference; its
+	    value is the environment entry name used in
+	    Deployment Component code.  The name is a JNDI name
+	    relative to the java:comp/env context and must be
+	    unique within an ejb-jar (for enterprise beans) or a
+	    Deployment File (for others).
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="message-destination-type"
+		   type="javaee:message-destination-typeType"
+		   minOccurs="0"/>
+      <xsd:element name="message-destination-usage"
+		   type="javaee:message-destination-usageType"
+		   minOccurs="0"/>
+      <xsd:element name="message-destination-link"
+		   type="javaee:message-destination-linkType"
+		   minOccurs="0"/>
+
+      <xsd:group ref="javaee:resourceGroup"/>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destination-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The message-destination-typeType specifies the type of
+	  the destination. The type is specified by the Java interface
+	  expected to be implemented by the destination.
+
+	  Example:
+
+	    <message-destination-type>javax.jms.Queue
+	    </message-destination-type>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destination-usageType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The message-destination-usageType specifies the use of the
+	message destination indicated by the reference.  The value
+	indicates whether messages are consumed from the message
+	destination, produced for the destination, or both.  The
+	Assembler makes use of this information in linking producers
+	of a destination with its consumers.
+
+	The value of the message-destination-usage element must be
+	one of the following:
+	    Consumes
+	    Produces
+	    ConsumesProduces
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="Consumes"/>
+	<xsd:enumeration value="Produces"/>
+	<xsd:enumeration value="ConsumesProduces"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destinationType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The message-destinationType specifies a message
+	  destination. The logical destination described by this
+	  element is mapped to a physical destination by the Deployer.
+
+	  The message destination element contains:
+
+		  - an optional description
+		  - an optional display-name
+		  - an optional icon
+		  - a message destination name which must be unique
+		    among message destination names within the same
+		    Deployment File.
+		  - an optional mapped name
+
+	  Example:
+
+	  <message-destination>
+		  <message-destination-name>CorporateStocks
+		  </message-destination-name>
+	  </message-destination>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="message-destination-name"
+		   type="javaee:string">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The message-destination-name element specifies a
+	    name for a message destination.  This name must be
+	    unique among the names of message destinations
+	    within the Deployment File.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="mapped-name"
+		   type="javaee:xsdStringType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      A product specific name that this message destination
+	      should be mapped to.  Each message-destination-ref
+	      element that references this message destination will
+	      define a name in the namespace of the referencing
+	      component.  (It's a name in the JNDI java:comp/env
+	      namespace.)  Many application servers provide a way to
+	      map these local names to names of resources known to the
+	      application server.  This mapped name is often a global
+	      JNDI name, but may be a name of any form.  Each of the
+	      local names should be mapped to this same global name.
+
+	      Application servers are not required to support any
+	      particular form or type of mapped name, nor the ability
+	      to use mapped names.  The mapped name is
+	      product-dependent and often installation-dependent.  No
+	      use of a mapped name is portable.
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="param-valueType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type is a general type that can be used to declare
+	parameter/value lists.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="param-name"
+		   type="javaee:string">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The param-name element contains the name of a
+	    parameter.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="param-value"
+		   type="javaee:xsdStringType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The param-value element contains the value of a
+	    parameter.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="pathType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The elements that use this type designate either a relative
+	path or an absolute path starting with a "/".
+
+	In elements that specify a pathname to a file within the
+	same Deployment File, relative filenames (i.e., those not
+	starting with "/") are considered relative to the root of
+	the Deployment File's namespace.  Absolute filenames (i.e.,
+	those starting with "/") also specify names in the root of
+	the Deployment File's namespace.  In general, relative names
+	are preferred.  The exception is .war files where absolute
+	names are preferred for consistency with the Servlet API.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-context-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The persistence-context-ref element contains a declaration
+	  of Deployment Component's reference to a persistence context
+	  associated within a Deployment Component's
+	  environment. It consists of:
+
+		  - an optional description
+		  - the persistence context reference name
+		  - an optional persistence unit name.  If not specified,
+                    the default persistence unit is assumed.
+		  - an optional specification as to whether
+		    the persistence context is Transactional or
+		    Extended.  If not specificed, Transactional is assumed.
+                  - an optional list of persistence properties
+		  - optional injection targets
+
+	  Examples:
+
+            <persistence-context-ref>
+              <persistence-context-ref-name>myPersistenceContext
+              </persistence-context-ref-name>
+            </persistence-context-ref>
+
+            <persistence-context-ref>
+              <persistence-context-ref-name>myPersistenceContext
+                </persistence-context-ref-name>
+              <persistence-unit-name>PersistenceUnit1
+                </persistence-unit-name>
+              <persistence-context-type>Extended</persistence-context-type>
+            </persistence-context-ref>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="persistence-context-ref-name"
+		   type="javaee:jndi-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The persistence-context-ref-name element specifies
+	    the name of a persistence context reference; its
+	    value is the environment entry name used in
+	    Deployment Component code.  The name is a JNDI name
+	    relative to the java:comp/env context.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="persistence-unit-name"
+		   type="javaee:string"
+		   minOccurs="0">
+        <xsd:annotation>
+	  <xsd:documentation>
+
+            The Application Assembler(or BeanProvider) may use the
+            following syntax to avoid the need to rename persistence
+            units to have unique names within a Java EE application.
+
+            The Application Assembler specifies the pathname of the
+            root of the persistence.xml file for the referenced
+            persistence unit and appends the name of the persistence
+            unit separated from the pathname by #. The pathname is
+            relative to the referencing application component jar file.
+            In this manner, multiple persistence units with the same
+            persistence unit name may be uniquely identified when the
+            Application Assembler cannot change persistence unit names.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="persistence-context-type"
+		   type="javaee:persistence-context-typeType"
+		   minOccurs="0"/>
+
+      <xsd:element name="persistence-property"
+		   type="javaee:propertyType"
+		   minOccurs="0"
+		   maxOccurs="unbounded">
+        <xsd:annotation>
+	  <xsd:documentation>
+
+            Used to specify properties for the container or persistence
+            provider.  Vendor-specific properties may be included in
+            the set of properties.  Properties that are not recognized
+            by a vendor must be ignored.  Entries that make use of the
+            namespace javax.persistence and its subnamespaces must not
+            be used for vendor-specific properties.  The namespace
+            javax.persistence is reserved for use by the specification.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:group ref="javaee:resourceGroup"/>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-context-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The persistence-context-typeType specifies the transactional
+	nature of a persistence context reference.
+
+	The value of the persistence-context-type element must be
+	one of the following:
+	    Transactional
+            Extended
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="Transactional"/>
+	<xsd:enumeration value="Extended"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-unit-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The persistence-unit-ref element contains a declaration
+	  of Deployment Component's reference to a persistence unit
+	  associated within a Deployment Component's
+	  environment. It consists of:
+
+		  - an optional description
+		  - the persistence unit reference name
+		  - an optional persistence unit name.  If not specified,
+                    the default persistence unit is assumed.
+		  - optional injection targets
+
+	  Examples:
+
+            <persistence-unit-ref>
+              <persistence-unit-ref-name>myPersistenceUnit
+              </persistence-unit-ref-name>
+            </persistence-unit-ref>
+
+            <persistence-unit-ref>
+              <persistence-unit-ref-name>myPersistenceUnit
+                </persistence-unit-ref-name>
+              <persistence-unit-name>PersistenceUnit1
+                </persistence-unit-name>
+            </persistence-unit-ref>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="persistence-unit-ref-name"
+		   type="javaee:jndi-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The persistence-unit-ref-name element specifies
+	    the name of a persistence unit reference; its
+	    value is the environment entry name used in
+	    Deployment Component code.  The name is a JNDI name
+	    relative to the java:comp/env context.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="persistence-unit-name"
+		   type="javaee:string"
+		   minOccurs="0">
+        <xsd:annotation>
+	  <xsd:documentation>
+
+            The Application Assembler(or BeanProvider) may use the
+            following syntax to avoid the need to rename persistence
+            units to have unique names within a Java EE application.
+
+            The Application Assembler specifies the pathname of the
+            root of the persistence.xml file for the referenced
+            persistence unit and appends the name of the persistence
+            unit separated from the pathname by #. The pathname is
+            relative to the referencing application component jar file.
+            In this manner, multiple persistence units with the same
+            persistence unit name may be uniquely identified when the
+            Application Assembler cannot change persistence unit names.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:group ref="javaee:resourceGroup"/>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="propertyType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	Specifies a name/value pair.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="name"
+		   type="javaee:xsdStringType">
+      </xsd:element>
+      <xsd:element name="value"
+		   type="javaee:xsdStringType">
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="remoteType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The remote element contains the fully-qualified name
+	  of the enterprise bean's remote interface.
+
+	  Example:
+
+	      <remote>com.wombat.empl.EmployeeService</remote>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="res-authType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The res-authType specifies whether the Deployment Component
+	code signs on programmatically to the resource manager, or
+	whether the Container will sign on to the resource manager
+	on behalf of the Deployment Component. In the latter case,
+	the Container uses information that is supplied by the
+	Deployer.
+
+	The value must be one of the two following:
+
+	    Application
+	    Container
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="Application"/>
+	<xsd:enumeration value="Container"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="res-sharing-scopeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The res-sharing-scope type specifies whether connections
+	obtained through the given resource manager connection
+	factory reference can be shared. The value, if specified,
+	must be one of the two following:
+
+	    Shareable
+	    Unshareable
+
+	The default value is Shareable.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="Shareable"/>
+	<xsd:enumeration value="Unshareable"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="resource-env-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The resource-env-refType is used to define
+	  resource-env-type elements.  It contains a declaration of a
+	  Deployment Component's reference to an administered object
+	  associated with a resource in the Deployment Component's
+	  environment.  It consists of an optional description, the
+	  resource environment reference name, and an optional
+	  indication of the resource environment reference type
+	  expected by the Deployment Component code.
+
+	  It also includes optional elements to define injection of
+	  the named resource into fields or JavaBeans properties.
+
+	  The resource environment type must be supplied unless an
+	  injection target is specified, in which case the type
+	  of the target is used.  If both are specified, the type
+	  must be assignment compatible with the type of the injection
+	  target.
+
+	  Example:
+
+	  <resource-env-ref>
+	      <resource-env-ref-name>jms/StockQueue
+	      </resource-env-ref-name>
+	      <resource-env-ref-type>javax.jms.Queue
+	      </resource-env-ref-type>
+	  </resource-env-ref>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="resource-env-ref-name"
+		   type="javaee:jndi-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The resource-env-ref-name element specifies the name
+	    of a resource environment reference; its value is
+	    the environment entry name used in
+	    the Deployment Component code.  The name is a JNDI
+	    name relative to the java:comp/env context and must
+	    be unique within a Deployment Component.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="resource-env-ref-type"
+		   type="javaee:fully-qualified-classType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The resource-env-ref-type element specifies the type
+	    of a resource environment reference.  It is the
+	    fully qualified name of a Java language class or
+	    interface.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:group ref="javaee:resourceGroup"/>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="resource-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The resource-refType contains a declaration of a
+	  Deployment Component's reference to an external resource. It
+	  consists of an optional description, the resource manager
+	  connection factory reference name, an optional indication of
+	  the resource manager connection factory type expected by the
+	  Deployment Component code, an optional type of authentication
+	  (Application or Container), and an optional specification of
+	  the shareability of connections obtained from the resource
+	  (Shareable or Unshareable).
+
+	  It also includes optional elements to define injection of
+	  the named resource into fields or JavaBeans properties.
+
+	  The connection factory type must be supplied unless an
+	  injection target is specified, in which case the type
+	  of the target is used.  If both are specified, the type
+	  must be assignment compatible with the type of the injection
+	  target.
+
+	  Example:
+
+	  <resource-ref>
+	      <res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
+	      <res-type>javax.sql.DataSource</res-type>
+	      <res-auth>Container</res-auth>
+	      <res-sharing-scope>Shareable</res-sharing-scope>
+	  </resource-ref>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="res-ref-name"
+		   type="javaee:jndi-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The res-ref-name element specifies the name of a
+	    resource manager connection factory reference.
+	    The name is a JNDI name relative to the
+	    java:comp/env context.
+	    The name must be unique within a Deployment File.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="res-type"
+		   type="javaee:fully-qualified-classType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The res-type element specifies the type of the data
+	    source. The type is specified by the fully qualified
+	    Java language class or interface
+	    expected to be implemented by the data source.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="res-auth"
+		   type="javaee:res-authType"
+		   minOccurs="0"/>
+
+      <xsd:element name="res-sharing-scope"
+		   type="javaee:res-sharing-scopeType"
+		   minOccurs="0"/>
+
+      <xsd:group ref="javaee:resourceGroup"/>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:group name="resourceGroup">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This group collects elements that are common to all the
+	JNDI resource elements.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="mapped-name"
+		   type="javaee:xsdStringType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      A product specific name that this resource should be
+	      mapped to.  The name of this resource, as defined by the
+	      resource's name element or defaulted, is a name that is
+	      local to the application component using the resource.
+	      (It's a name in the JNDI java:comp/env namespace.)  Many
+	      application servers provide a way to map these local
+	      names to names of resources known to the application
+	      server.  This mapped name is often a global JNDI name,
+	      but may be a name of any form.
+
+	      Application servers are not required to support any
+	      particular form or type of mapped name, nor the ability
+	      to use mapped names.  The mapped name is
+	      product-dependent and often installation-dependent.  No
+	      use of a mapped name is portable.
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="injection-target"
+		   type="javaee:injection-targetType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:group>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="role-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The role-nameType designates the name of a security role.
+
+	The name must conform to the lexical rules for a token.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="run-asType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The run-asType specifies the run-as identity to be
+	used for the execution of a component. It contains an
+	optional description, and the name of a security role.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+		   type="javaee:role-nameType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-role-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The security-role-refType contains the declaration of a
+	security role reference in a component's or a
+	Deployment Component's code. The declaration consists of an
+	optional description, the security role name used in the
+	code, and an optional link to a security role. If the
+	security role is not specified, the Deployer must choose an
+	appropriate security role.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+		   type="javaee:role-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The value of the role-name element must be the String used
+	    as the parameter to the
+	    EJBContext.isCallerInRole(String roleName) method or the
+	    HttpServletRequest.isUserInRole(String role) method.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="role-link"
+		   type="javaee:role-nameType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The role-link element is a reference to a defined
+	    security role. The role-link element must contain
+	    the name of one of the security roles defined in the
+	    security-role elements.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-roleType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The security-roleType contains the definition of a security
+	  role. The definition consists of an optional description of
+	  the security role, and the security role name.
+
+	  Example:
+
+	      <security-role>
+	      <description>
+		  This role includes all employees who are authorized
+		  to access the employee service application.
+	      </description>
+	      <role-name>employee</role-name>
+	      </security-role>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+		   type="javaee:role-nameType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="string">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This is a special string datatype that is defined by Java EE as
+	a base type for defining collapsed strings. When schemas
+	require trailing/leading space elimination as well as
+	collapsing the existing whitespace, this base type may be
+	used.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:token">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="true-falseType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This simple type designates a boolean with only two
+	permissible values
+
+	- true
+	- false
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:xsdBooleanType">
+	<xsd:pattern value="(true|false)"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="url-patternType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The url-patternType contains the url pattern of the mapping.
+	It must follow the rules specified in Section 11.2 of the
+	Servlet API Specification. This pattern is assumed to be in
+	URL-decoded form and must not contain CR(#xD) or LF(#xA).
+	If it contains those characters, the container must inform
+	the developer with a descriptive error message.
+	The container must preserve all characters including whitespaces.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdAnyURIType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:anyURI.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:anyURI">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdBooleanType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:boolean.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:boolean">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdIntegerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:integer.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:integer">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdNMTOKENType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:NMTOKEN.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:NMTOKEN">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdNonNegativeIntegerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:nonNegativeInteger.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:nonNegativeInteger">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdPositiveIntegerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:positiveInteger.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:positiveInteger">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdQNameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:QName.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:QName">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdStringType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:string.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:string">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+</xsd:schema>
+
diff --git a/xml/tests/testData/generateTag/spring-beans_3.0.xsd b/xml/tests/testData/generateTag/spring-beans_3.0.xsd
new file mode 100644
index 0000000..0d6b848
--- /dev/null
+++ b/xml/tests/testData/generateTag/spring-beans_3.0.xsd
@@ -0,0 +1,1162 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/beans"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		targetNamespace="http://www.springframework.org/schema/beans">
+
+	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Spring XML Beans Schema, version 2.5
+	Authors: Rob Harrop, Juergen Hoeller, Mark Fisher
+
+	This defines a simple and consistent way of creating a namespace
+	of JavaBeans objects, managed by a Spring BeanFactory, read by
+	XmlBeanDefinitionReader (with DefaultBeanDefinitionDocumentReader).
+
+	This document type is used by most Spring functionality, including
+	web application contexts, which are based on bean factories.
+
+	Each "bean" element in this document defines a JavaBean.
+	Typically the bean class is specified, along with JavaBean properties
+	and/or constructor arguments.
+
+	A bean instance can be a "singleton" (shared instance) or a "prototype"
+	(independent instance). Further scopes can be provided by extended
+	bean factories, for example in a web environment.
+
+	References among beans are supported, that is, setting a JavaBean property
+	or a constructor argument to refer to another bean in the same factory
+	(or an ancestor factory).
+
+	As alternative to bean references, "inner bean definitions" can be used.
+	Singleton flags of such inner bean definitions are effectively ignored:
+	inner beans are typically anonymous prototypes.
+
+	There is also support for lists, sets, maps, and java.util.Properties
+	as bean property types or constructor argument types.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<!-- base types -->
+	<xsd:complexType name="identifiedType" abstract="true">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The unique identifier for a bean. The scope of the identifier
+	is the enclosing bean factory.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:attribute name="id" type="xsd:ID">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The unique identifier for a bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Top-level <beans> tag -->
+	<xsd:element name="beans">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The top level (typically root) element. Allows the definition
+	of default values for all nested bean definitions.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="import"/>
+					<xsd:element ref="alias"/>
+					<xsd:element ref="bean"/>
+					<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="default-lazy-init" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'lazy-init' value; see the documentation for the
+	'lazy-init' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-merge" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'merge' value; see the documentation for the
+	'merge' attribute of the various collection elements.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-autowire" default="no">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'autowire' value; see the documentation for the
+	'autowire' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="no"/>
+						<xsd:enumeration value="byName"/>
+						<xsd:enumeration value="byType"/>
+						<xsd:enumeration value="constructor"/>
+						<xsd:enumeration value="autodetect"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-dependency-check" default="none">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'dependency-check' value; see the documentation for the
+	'dependency-check' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="none"/>
+						<xsd:enumeration value="simple"/>
+						<xsd:enumeration value="objects"/>
+						<xsd:enumeration value="all"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-autowire-candidates" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A default bean name pattern for identifying autowire candidates:
+	e.g. "*Service", "data*", "*Service*", "data*Service".
+	Also accepts a comma-separated list of patterns: e.g. "*Service,*Dao".
+	See the documentation for the 'autowire-candidate' attribute of the
+	'<bean/>' element for the semantic details of autowire candidate beans.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-init-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'init-method' value; see the documentation for the
+	'init-method' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-destroy-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'destroy-method' value; see the documentation for the
+	'destroy-method' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:anyAttribute namespace="##other" processContents="lax"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="description">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains informative text describing the purpose of the enclosing element.
+	Used primarily for user documentation of XML bean definition documents.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="import">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.core.io.Resource"><![CDATA[
+	Specifies an XML bean definition resource to import.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="resource" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The relative resource location of the XML (bean definition) file to import,
+	for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml".
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="alias">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines an alias for a bean (which can reside in a different definition
+	resource).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean to define an alias for.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="alias" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The alias name to define for the bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:group name="beanElements">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="constructor-arg"/>
+				<xsd:element ref="property"/>
+				<xsd:element ref="qualifier"/>
+				<xsd:element ref="lookup-method"/>
+				<xsd:element ref="replaced-method"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:attributeGroup name="beanAttributes">
+		<xsd:attribute name="name" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Can be used to create one or more aliases illegal in an (XML) id.
+	Multiple aliases can be separated by any number of spaces, commas,
+	or semi-colons (or indeed any mixture of the three).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="class" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The fully qualified name of the bean's class, except if it serves only
+	as a parent definition for child bean definitions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="parent" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the parent bean definition.
+
+	Will use the bean class of the parent if none is specified, but can
+	also override it. In the latter case, the child bean class must be
+	compatible with the parent, i.e. accept the parent's property values
+	and constructor argument values, if any.
+
+	A child bean definition will inherit constructor argument values,
+	property values and method overrides from the parent, with the option
+	to add new values. If init method, destroy method, factory bean and/or
+	factory method are specified, they will override the corresponding
+	parent settings.
+
+	The remaining settings will always be taken from the child definition:
+	depends on, autowire mode, dependency check, scope, lazy init.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="scope" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The scope of this bean: typically "singleton" (one shared instance,
+	which will be returned by all calls to getBean with the given id), or
+	"prototype" (independent instance resulting from each call to getBean).
+	Default is "singleton".
+
+	Singletons are most commonly used, and are ideal for multi-threaded
+	service objects. Further scopes, such as "request" or "session", might
+	be supported by extended bean factories (e.g. in a web environment).
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+
+	Inner bean definitions inherit the singleton status of their containing
+	bean definition, unless explicitly specified: The inner bean will be a
+	singleton if the containing bean is a singleton, and a prototype if
+	the containing bean has any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="abstract" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Is this bean "abstract", that is, not meant to be instantiated itself
+	but rather just serving as parent for concrete child bean definitions?
+	The default is "false". Specify "true" to tell the bean factory to not
+	try to instantiate that particular bean in any case.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per abstract bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="lazy-init" default="default" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean is to be lazily initialized.
+	If false, it will be instantiated on startup by bean factories
+	that perform eager initialization of singletons. The default is
+	"false".
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether bean properties are "autowired".
+	This is an automagical process in which bean references don't need
+	to be coded explicitly in the XML bean definition file, but rather the
+	Spring container works out dependencies.
+
+	There are 5 modes:
+
+	1. "no"
+	The traditional Spring default. No automagical wiring. Bean references
+	must be defined in the XML file via the <ref/> element (or "ref"
+	attribute). We recommend this in most cases as it makes documentation
+	more explicit.
+
+	2. "byName"
+	Autowiring by property name. If a bean of class Cat exposes a dog
+	property, Spring will try to set this to the value of the bean "dog"
+	in the current container. If there is no matching bean by name, nothing
+	special happens; use dependency-check="objects" to raise an error in
+	that case.
+
+	3. "byType"
+	Autowiring if there is exactly one bean of the property type in the
+	container. If there is more than one, a fatal error is raised, and
+	you cannot use byType autowiring for that bean. If there is none,
+	nothing special happens; use dependency-check="objects" to raise an
+	error in that case.
+
+	4. "constructor"
+	Analogous to "byType" for constructor arguments. If there is not exactly
+	one bean of the constructor argument type in the bean factory, a fatal
+	error is raised.
+
+	5. "autodetect"
+	Chooses "constructor" or "byType" through introspection of the bean
+	class. If a default constructor is found, "byType" gets applied.
+
+	Note that explicit dependencies, i.e. "property" and "constructor-arg"
+	elements, always override autowiring. Autowire behavior can be combined
+	with dependency checking, which will be performed after all autowiring
+	has been completed.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="no"/>
+					<xsd:enumeration value="byName"/>
+					<xsd:enumeration value="byType"/>
+					<xsd:enumeration value="constructor"/>
+					<xsd:enumeration value="autodetect"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="dependency-check" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether or not to check whether all of this
+	bean's dependencies, expressed in its properties, are satisfied.
+	The default is to perform no dependency checking.
+
+	"simple" type dependency checking includes primitives and String;
+	"objects" includes collaborators (other beans in the factory);
+	"all" includes both types of dependency checking.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="none"/>
+					<xsd:enumeration value="simple"/>
+					<xsd:enumeration value="objects"/>
+					<xsd:enumeration value="all"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="depends-on" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The names of the beans that this bean depends on being initialized.
+	The bean factory will guarantee that these beans get initialized
+	before this bean.
+
+	Note that dependencies are normally expressed through bean properties
+	or constructor arguments. This property should just be necessary for
+	other kinds of dependencies like statics (*ugh*) or database preparation
+	on startup.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire-candidate" default="default" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean should be considered when looking
+	for matching candidates to satisfy another bean's autowiring requirements.
+	Note that this does not affect explicit references by name, which will get
+	resolved even if the specified bean is not marked as an autowire candidate.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="primary" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Specifies that this bean should be given preference when multiple
+	candidates are qualified to autowire a single-valued dependency.
+	If exactly one 'primary' bean exists among the candidates, it
+	will be the autowired value.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="init-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom initialization method to invoke after setting
+	bean properties. The method must have no arguments, but may throw any
+	exception.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="destroy-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom destroy method to invoke on bean factory
+	shutdown. The method must have no arguments, but may throw any
+	exception.
+
+	Note: Only invoked on beans whose lifecycle is under the full
+	control of the factory - which is always the case for singletons,
+	but not guaranteed for any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of a factory method to use to create this object. Use
+	constructor-arg elements to specify arguments to the factory method,
+	if it takes arguments. Autowiring does not apply to factory methods.
+
+	If the "class" attribute is present, the factory method will be a static
+	method on the class specified by the "class" attribute on this bean
+	definition. Often this will be the same class as that of the constructed
+	object - for example, when the factory method is used as an alternative
+	to a constructor. However, it may be on a different class. In that case,
+	the created object will *not* be of the class specified in the "class"
+	attribute. This is analogous to FactoryBean behavior.
+
+	If the "factory-bean" attribute is present, the "class" attribute is not
+	used, and the factory method will be an instance method on the object
+	returned from a getBean call with the specified bean name. The factory
+	bean may be defined as a singleton or a prototype.
+
+	The factory method can have any number of arguments. Autowiring is not
+	supported. Use indexed constructor-arg elements in conjunction with the
+	factory-method attribute.
+
+	Setter Injection can be used in conjunction with a factory method.
+	Method Injection cannot, as the factory method returns an instance,
+	which will be used when the container creates the bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-bean" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Alternative to class attribute for factory-method usage.
+	If this is specified, no class attribute should be used.
+	This must be set to the name of a bean in the current or
+	ancestor factories that contains the relevant factory method.
+	This allows the factory itself to be configured using Dependency
+	Injection, and an instance (rather than static) method to be used.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:attributeGroup>
+
+	<xsd:element name="meta" type="metaType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Arbitrary metadata attached to a bean definition.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:complexType name="metaType">
+		<xsd:attribute name="key" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The key name of the metadata attribute being defined.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The value of the metadata attribute being defined (as a simple String).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<xsd:element name="bean">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.BeanDefinition"><![CDATA[
+	Defines a single (usually named) bean.
+
+	A bean definition may contain nested tags for constructor arguments,
+	property values, lookup methods, and replaced methods. Mixing constructor
+	injection and setter injection on the same bean is explicitly supported.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="identifiedType">
+					<xsd:group ref="beanElements"/>
+					<xsd:attributeGroup ref="beanAttributes"/>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="constructor-arg">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.ConstructorArgumentValues">
+				<![CDATA[
+	Bean definitions can specify zero or more constructor arguments.
+	This is an alternative to "autowire constructor".
+	Arguments correspond to either a specific index of the constructor
+	argument list or are supposed to be matched generically by type.
+
+	Note: A single generic argument value will just be used once, rather
+	than potentially matched multiple times (as of Spring 1.1).
+
+	constructor-arg elements are also used in conjunction with the
+	factory-method element to construct beans using static or instance
+	factory methods.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="1">
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+					<xsd:any namespace="##other" processContents="strict"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="index" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact index of the argument in the constructor argument list.
+	Only needed to avoid ambiguities, e.g. in case of 2 arguments of
+	the exact same type.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type of the constructor argument. Only needed to avoid
+	ambiguities, e.g. in case of 2 single argument constructors
+	that can both be converted from a String.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="ref" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>" element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="value" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...<value/>" element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="property" type="propertyType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Bean definitions can have zero or more properties.
+	Property elements correspond to JavaBean setter methods exposed
+	by the bean classes. Spring supports primitives, references to other
+	beans in the same or related factories, lists, maps and properties.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="qualifier">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Bean definitions can provide qualifiers to match against annotations
+	on a field or parameter for fine-grained autowire candidate resolution.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="attribute" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:sequence>
+			<xsd:attribute name="type" type="xsd:string" default="org.springframework.beans.factory.annotation.Qualifier"/>
+			<xsd:attribute name="value" type="xsd:string"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="attribute" type="metaType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A qualifier element may contain attribute child elements as key-value
+	pairs. These will be available for matching against attributes of a
+	qualifier annotation on an autowired field or parameter if present.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="lookup-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A lookup method causes the IoC container to override the given method
+	and return the bean with the name given in the bean attribute. This is
+	a form of Method Injection. It is particularly useful as an alternative
+	to implementing the BeanFactoryAware interface, in order to be able to
+	make getBean() calls for non-singleton instances at runtime. In this
+	case, Method Injection is a less invasive alternative.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the lookup method. This method must take no arguments.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean in the current or ancestor factories that
+	the lookup method should resolve to. Often this bean will be a
+	prototype, in which case the lookup method will return a distinct
+	instance on every invocation. This is useful for single-threaded objects.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="replaced-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Similar to the lookup method mechanism, the replaced-method element
+	is used to control IoC container method overriding: Method Injection.
+	This mechanism allows the overriding of a method with arbitrary code.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="arg-type"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="name" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The name of the method whose implementation must be replaced by the
+	IoC container. If this method is not overloaded, there is no need
+	to use arg-type subelements. If this method is overloaded, arg-type
+	subelements must be used for all override definitions for the method.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="replacer" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation source="java:org.springframework.beans.factory.support.MethodReplacer"><![CDATA[
+	Bean name of an implementation of the MethodReplacer interface in the
+	current or ancestor factories. This may be a singleton or prototype
+	bean. If it is a prototype, a new instance will be used for each
+	method replacement. Singleton usage is the norm.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="arg-type">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Identifies an argument for a replaced method in the event of
+	method overloading.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="match" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Specification of the type of an overloaded method argument as a String.
+	For convenience, this may be a substring of the FQN. E.g. all the
+	following would match "java.lang.String":
+	- java.lang.String
+	- String
+	- Str
+
+	As the number of arguments will be checked also, this convenience
+	can often be used to save typing.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="ref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines a reference to another bean in this factory or an external
+	factory (parent or included factory).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID and thus can
+	be checked by the XML parser. This is therefore the preferred technique
+	for referencing beans within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="parent" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean in a parent factory.
+						]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="idref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The id of another bean in this factory or an external factory
+	(parent or included factory).
+	While a regular 'value' element could instead be used for the
+	same effect, using idref in this case allows validation of local
+	bean ids by the XML parser, and name completion by supporting tools.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID and thus can
+	be checked by the XML parser. This is therefore the preferred technique
+	for referencing beans within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="value">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains a string representation of a property value.
+	The property may be a string, or may be converted to the required
+	type using the JavaBeans PropertyEditor machinery. This makes it
+	possible for application developers to write custom PropertyEditor
+	implementations that can convert strings to arbitrary target objects.
+
+	Note that this is recommended for simple objects only. Configure
+	more complex objects by populating JavaBean properties with
+	references to other beans.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type that the value should be converted to. Only needed
+	if the type of the target property or constructor argument is
+	too generic: for example, in case of a collection element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="null">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Denotes a Java null value. Necessary because an empty "value" tag
+	will resolve to an empty String, which will not be resolved to a
+	null value unless a special PropertyEditor does so.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<!-- Collection Elements -->
+	<xsd:group name="collectionElements">
+		<xsd:sequence>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:element name="list">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A list can contain multiple inner bean, ref, collection, or value elements.
+	A list can also map to an array type; the necessary conversion is performed
+	automatically.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="listOrSetType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="set">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A set can contain multiple inner bean, ref, collection, or value elements.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="listOrSetType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="map">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A mapping from a key to an object. Maps may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="mapType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="entry" type="entryType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A map entry can be an inner bean, ref, value, or collection.
+	The key of the entry is given by the "key" attribute or child element.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="props">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Props elements differ from map elements in that values must be strings.
+	Props may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="propsType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="key">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A key element can contain an inner bean, ref, value, or collection.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:group ref="collectionElements"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="prop">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The string value of the property. Note that whitespace is trimmed
+	off to avoid unwanted whitespace caused by typical XML formatting.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="key" type="xsd:string" use="required">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The key of the property entry.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="propertyType">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="1">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict"/>
+			</xsd:choice>
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the property, following JavaBean naming conventions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>" element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Collection Types -->
+
+	<!-- base type for collections that have (possibly) typed nested values -->
+	<xsd:complexType name="collectionType">
+		<xsd:attribute name="value-type" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested values. Must be a fully qualified
+	class name.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- 'list' and 'set' collection type -->
+	<xsd:complexType name="listOrSetType">
+		<xsd:complexContent>
+			<xsd:extension base="collectionType">
+				<xsd:group ref="collectionElements"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'map' element type -->
+	<xsd:complexType name="mapType">
+		<xsd:complexContent>
+			<xsd:extension base="collectionType">
+				<xsd:sequence>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="entry"/>
+					</xsd:choice>
+				</xsd:sequence>
+				<xsd:attribute name="key-type" type="xsd:string">
+					<xsd:annotation>
+						<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested entry keys. Must be a fully qualified
+	class name.
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:attribute>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'entry' element type -->
+	<xsd:complexType name="entryType">
+		<xsd:sequence>
+			<xsd:element ref="key" minOccurs="0"/>
+			<xsd:group ref="collectionElements"/>
+		</xsd:sequence>
+		<xsd:attribute name="key" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Each map element must specify its key as attribute or as child element.
+	A key attribute is always a String value.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="key-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a to a "key" element with a nested
+	"<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>"
+	element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- 'props' collection type -->
+	<xsd:complexType name="propsType">
+		<xsd:complexContent>
+			<xsd:extension base="collectionType">
+				<xsd:sequence>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="prop"/>
+					</xsd:choice>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- simple internal types -->
+	<xsd:simpleType name="defaultable-boolean">
+		<xsd:restriction base="xsd:NMTOKEN">
+			<xsd:enumeration value="default"/>
+			<xsd:enumeration value="true"/>
+			<xsd:enumeration value="false"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/generateTag/spring.xml b/xml/tests/testData/generateTag/spring.xml
new file mode 100644
index 0000000..d1de923
--- /dev/null
+++ b/xml/tests/testData/generateTag/spring.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+       spring-beans_3.0.xsd">
+
+  <caret>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/springAfterBean.xml b/xml/tests/testData/generateTag/springAfterBean.xml
new file mode 100644
index 0000000..060afedb
--- /dev/null
+++ b/xml/tests/testData/generateTag/springAfterBean.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+       spring-beans_3.0.xsd">
+
+  <bean id="old"/>
+
+  <caret>
+
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/springAfterBean_after.xml b/xml/tests/testData/generateTag/springAfterBean_after.xml
new file mode 100644
index 0000000..34f3dd7
--- /dev/null
+++ b/xml/tests/testData/generateTag/springAfterBean_after.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+       spring-beans_3.0.xsd">
+
+  <bean id="old"/>
+
+  <bean
+
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/springAlias.xml b/xml/tests/testData/generateTag/springAlias.xml
new file mode 100644
index 0000000..d1de923
--- /dev/null
+++ b/xml/tests/testData/generateTag/springAlias.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+       spring-beans_3.0.xsd">
+
+  <caret>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/springAlias_after.xml b/xml/tests/testData/generateTag/springAlias_after.xml
new file mode 100644
index 0000000..43b1132
--- /dev/null
+++ b/xml/tests/testData/generateTag/springAlias_after.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+       spring-beans_3.0.xsd">
+
+  <alias name="" alias=""/>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/springAtCaret.xml b/xml/tests/testData/generateTag/springAtCaret.xml
new file mode 100644
index 0000000..694aec7
--- /dev/null
+++ b/xml/tests/testData/generateTag/springAtCaret.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+       spring-beans_3.0.xsd">
+
+  <caret>
+  <bean id="old"/>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/springAtCaret_after.xml b/xml/tests/testData/generateTag/springAtCaret_after.xml
new file mode 100644
index 0000000..35a9c23
--- /dev/null
+++ b/xml/tests/testData/generateTag/springAtCaret_after.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+       spring-beans_3.0.xsd">
+
+  <bean
+  <bean id="old"/>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/spring_after.xml b/xml/tests/testData/generateTag/spring_after.xml
new file mode 100644
index 0000000..9de096a
--- /dev/null
+++ b/xml/tests/testData/generateTag/spring_after.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+       spring-beans_3.0.xsd">
+
+  <bean
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/generateTag/web-app_2_3.dtd b/xml/tests/testData/generateTag/web-app_2_3.dtd
new file mode 100644
index 0000000..5e3ab01
--- /dev/null
+++ b/xml/tests/testData/generateTag/web-app_2_3.dtd
@@ -0,0 +1,1063 @@
+<!--
+Copyright (c) 2000 Sun Microsystems, Inc.,
+901 San Antonio Road,
+Palo Alto, California 94303, U.S.A.
+All rights reserved.
+
+Sun Microsystems, Inc. has intellectual property rights relating to
+technology embodied in the product that is described in this document.
+In particular, and without limitation, these intellectual property
+rights may include one or more of the U.S. patents listed at
+http://www.sun.com/patents and one or more additional patents or
+pending patent applications in the U.S. and in other countries.
+
+This document and the product to which it pertains are distributed
+under licenses restricting their use, copying, distribution, and
+decompilation.  This document may be reproduced and distributed but may
+not be changed without prior written authorization of Sun and its
+licensors, if any.
+
+Third-party software, including font technology, is copyrighted and
+licensed from Sun suppliers.
+
+Sun,  Sun Microsystems,  the Sun logo,  Java,  JavaServer Pages,  Java
+Naming and Directory Interface,  JDBC,  JDK,  JavaMail and  and
+Enterprise JavaBeans are trademarks or registered trademarks of Sun
+Microsystems, Inc. in the U.S. and other countries.
+
+Federal Acquisitions: Commercial Software - Government Users Subject to
+Standard License Terms and Conditions.
+
+DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
+CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
+WARRANTY OF MERCHANTABILITY, FITNESS FOR FOR A PARTICULAR PURPOSE OR
+NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH
+DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
+
+
+_________________________________________________________________________
+
+Copyright (c) 2000 Sun Microsystems, Inc.,
+901 San Antonio Road,
+Palo Alto, California 94303, E'tats-Unis.
+Tous droits re'serve's.
+
+Sun Microsystems, Inc. a les droits de proprie'te' intellectuels
+relatants a` la technologie incorpore'e dans le produit qui est de'crit
+dans ce document. En particulier, et sans la limitation, ces droits de
+proprie'te' intellectuels peuvent inclure un ou plus des brevets
+ame'ricains e'nume're's a` http://www.sun.com/patents et un ou les
+brevets plus supple'mentaires ou les applications de brevet en attente
+dans les E'tats-Unis et dans les autres pays.
+
+Ce produit ou document est prote'ge' par un copyright et distribue'
+avec des licences qui en restreignent l'utilisation, la copie, la
+distribution, et la de'compilation.  Ce documention associe n peut
+e^tre reproduite et distribuer, par quelque moyen que ce soit, sans
+l'autorisation pre'alable et e'crite de Sun et de ses bailleurs de
+licence, le cas e'che'ant.
+
+Le logiciel de'tenu par des tiers, et qui comprend la technologie
+relative aux polices de caracte`res, est prote'ge' par un copyright et
+licencie' par des fournisseurs de Sun.
+
+Sun,  Sun Microsystems,  le logo Sun,  Java,  JavaServer Pages,  Java
+Naming and Directory Interface,  JDBC,  JDK,  JavaMail et  and
+Enterprise JavaBeans sont des marques de fabrique ou des marques
+de'pose'es de Sun Microsystems, Inc. aux E'tats-Unis et dans d'autres
+pays.
+
+LA DOCUMENTATION EST FOURNIE "EN L'E'TAT" ET TOUTES AUTRES CONDITIONS,
+DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT
+EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS
+NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A
+L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE
+CONTREFAC,ON.
+-->
+
+<!--
+This is the XML DTD for the Servlet 2.3 deployment descriptor.
+All Servlet 2.3 deployment descriptors must include a DOCTYPE
+of the following form:
+
+  <!DOCTYPE web-app PUBLIC
+	"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+	"http://java.sun.com/dtd/web-app_2_3.dtd">
+
+-->
+
+<!--
+The following conventions apply to all J2EE deployment descriptor
+elements unless indicated otherwise.
+
+- In elements that contain PCDATA, leading and trailing whitespace
+  in the data may be ignored.
+
+- In elements whose value is an "enumerated type", the value is
+  case sensitive.
+
+- In elements that specify a pathname to a file within the same
+  JAR file, relative filenames (i.e., those not starting with "/")
+  are considered relative to the root of the JAR file's namespace.
+  Absolute filenames (i.e., those starting with "/") also specify
+  names in the root of the JAR file's namespace.  In general, relative
+  names are preferred.  The exception is .war files where absolute
+  names are preferred for consistency with the servlet API.
+-->
+
+
+<!--
+The web-app element is the root of the deployment descriptor for
+a web application.
+-->
+<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
+context-param*, filter*, filter-mapping*, listener*, servlet*,
+servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
+error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,
+login-config?, security-role*, env-entry*, ejb-ref*,  ejb-local-ref*)>
+
+<!--
+The auth-constraint element indicates the user roles that should
+be permitted access to this resource collection. The role-name
+used here must either correspond to the role-name of one of the
+security-role elements defined for this web application, or be
+the specially reserved role-name "*" that is a compact syntax for
+indicating all roles in the web application. If both "*" and
+rolenames appear, the container interprets this as all roles.
+If no roles are defined, no user is allowed access to the portion of
+the web application described by the containing security-constraint.
+The container matches role names case sensitively when determining
+access.
+
+
+Used in: security-constraint
+-->
+<!ELEMENT auth-constraint (description?, role-name*)>
+
+<!--
+The auth-method element is used to configure the authentication
+mechanism for the web application. As a prerequisite to gaining access to any web resources which are protected by an authorization
+constraint, a user must have authenticated using the configured
+mechanism. Legal values for this element are "BASIC", "DIGEST",
+"FORM", or "CLIENT-CERT".
+
+Used in: login-config
+-->
+<!ELEMENT auth-method (#PCDATA)>
+
+<!--
+The context-param element contains the declaration of a web
+application's servlet context initialization parameters.
+
+Used in: web-app
+-->
+<!ELEMENT context-param (param-name, param-value, description?)>
+
+<!--
+The description element is used to provide text describing the parent
+element.  The description element should include any information that
+the web application war file producer wants to provide to the consumer of
+the web application war file (i.e., to the Deployer). Typically, the tools
+used by the web application war file consumer will display the description
+when processing the parent element that contains the description.
+
+Used in: auth-constraint, context-param, ejb-local-ref, ejb-ref,
+env-entry, filter, init-param, resource-env-ref, resource-ref, run-as,
+security-role, security-role-ref, servlet, user-data-constraint,
+web-app, web-resource-collection
+-->
+<!ELEMENT description (#PCDATA)>
+
+<!--
+The display-name element contains a short name that is intended to be
+displayed by tools.  The display name need not be unique.
+
+Used in: filter, security-constraint, servlet, web-app
+
+Example:
+
+<display-name>Employee Self Service</display-name>
+-->
+<!ELEMENT display-name (#PCDATA)>
+
+<!--
+The distributable element, by its presence in a web application
+deployment descriptor, indicates that this web application is
+programmed appropriately to be deployed into a distributed servlet
+container
+
+Used in: web-app
+-->
+<!ELEMENT distributable EMPTY>
+
+<!--
+The ejb-link element is used in the ejb-ref or ejb-local-ref
+elements to specify that an EJB reference is linked to an
+enterprise bean.
+
+The name in the ejb-link element is composed of a
+path name specifying the ejb-jar containing the referenced enterprise
+bean with the ejb-name of the target bean appended and separated from
+the path name by "#".  The path name is relative to the war file
+containing the web application that is referencing the enterprise bean.
+This allows multiple enterprise beans with the same ejb-name to be
+uniquely identified.
+
+Used in: ejb-local-ref, ejb-ref
+
+Examples:
+
+	<ejb-link>EmployeeRecord</ejb-link>
+
+	<ejb-link>../products/product.jar#ProductEJB</ejb-link>
+
+-->
+<!ELEMENT ejb-link (#PCDATA)>
+
+<!--
+The ejb-local-ref element is used for the declaration of a reference to
+an enterprise bean's local home. The declaration consists of:
+
+	- an optional description
+	- the EJB reference name used in the code of the web application
+	  that's referencing the enterprise bean
+	- the expected type of the referenced enterprise bean
+	- the expected local home and local interfaces of the referenced
+	  enterprise bean
+	- optional ejb-link information, used to specify the referenced
+	  enterprise bean
+
+Used in: web-app
+-->
+<!ELEMENT ejb-local-ref (description?, ejb-ref-name, ejb-ref-type,
+		local-home, local, ejb-link?)>
+
+<!--
+The ejb-ref element is used for the declaration of a reference to
+an enterprise bean's home. The declaration consists of:
+
+	- an optional description
+	- the EJB reference name used in the code of
+	  the web application that's referencing the enterprise bean
+	- the expected type of the referenced enterprise bean
+	- the expected home and remote interfaces of the referenced
+	  enterprise bean
+	- optional ejb-link information, used to specify the referenced
+	  enterprise bean
+
+Used in: web-app
+-->
+<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type,
+		home, remote, ejb-link?)>
+
+<!--
+The ejb-ref-name element contains the name of an EJB reference. The
+EJB reference is an entry in the web application's environment and is
+relative to the java:comp/env context.  The name must be unique
+within the web application.
+
+It is recommended that name is prefixed with "ejb/".
+
+Used in: ejb-local-ref, ejb-ref
+
+Example:
+
+<ejb-ref-name>ejb/Payroll</ejb-ref-name>
+-->
+<!ELEMENT ejb-ref-name (#PCDATA)>
+
+<!--
+The ejb-ref-type element contains the expected type of the
+referenced enterprise bean.
+
+The ejb-ref-type element must be one of the following:
+
+	<ejb-ref-type>Entity</ejb-ref-type>
+	<ejb-ref-type>Session</ejb-ref-type>
+
+Used in: ejb-local-ref, ejb-ref
+-->
+<!ELEMENT ejb-ref-type (#PCDATA)>
+
+<!--
+The env-entry element contains the declaration of a web application's
+environment entry. The declaration consists of an optional
+description, the name of the environment entry, and an optional
+value.  If a value is not specified, one must be supplied
+during deployment.
+-->
+<!ELEMENT env-entry (description?, env-entry-name, env-entry-value?,
+env-entry-type)>
+
+<!--
+The env-entry-name element contains the name of a web applications's
+environment entry.  The name is a JNDI name relative to the
+java:comp/env context.  The name must be unique within a web application.
+
+Example:
+
+<env-entry-name>minAmount</env-entry-name>
+
+Used in: env-entry
+-->
+<!ELEMENT env-entry-name (#PCDATA)>
+
+<!--
+The env-entry-type element contains the fully-qualified Java type of
+the environment entry value that is expected by the web application's
+code.
+
+The following are the legal values of env-entry-type:
+
+	java.lang.Boolean
+	java.lang.Byte
+	java.lang.Character
+	java.lang.String
+	java.lang.Short
+	java.lang.Integer
+	java.lang.Long
+	java.lang.Float
+	java.lang.Double
+
+Used in: env-entry
+-->
+<!ELEMENT env-entry-type (#PCDATA)>
+
+<!--
+The env-entry-value element contains the value of a web application's
+environment entry. The value must be a String that is valid for the
+constructor of the specified type that takes a single String
+parameter, or for java.lang.Character, a single character.
+
+Example:
+
+<env-entry-value>100.00</env-entry-value>
+
+Used in: env-entry
+-->
+<!ELEMENT env-entry-value (#PCDATA)>
+
+<!--
+The error-code contains an HTTP error code, ex: 404
+
+Used in: error-page
+-->
+<!ELEMENT error-code (#PCDATA)>
+
+<!--
+The error-page element contains a mapping between an error code
+or exception type to the path of a resource in the web application
+
+Used in: web-app
+-->
+<!ELEMENT error-page ((error-code | exception-type), location)>
+
+<!--
+The exception type contains a fully qualified class name of a
+Java exception type.
+
+Used in: error-page
+-->
+<!ELEMENT exception-type (#PCDATA)>
+
+<!--
+The extension element contains a string describing an
+extension. example: "txt"
+
+Used in: mime-mapping
+-->
+<!ELEMENT extension (#PCDATA)>
+
+<!--
+Declares a filter in the web application. The filter is mapped to
+either a servlet or a URL pattern in the filter-mapping element, using
+the filter-name value to reference. Filters can access the
+initialization parameters declared in the deployment descriptor at
+runtime via the FilterConfig interface.
+
+Used in: web-app
+-->
+<!ELEMENT filter (icon?, filter-name, display-name?, description?,
+filter-class, init-param*)>
+
+<!--
+The fully qualified classname of the filter.
+
+Used in: filter
+-->
+<!ELEMENT filter-class (#PCDATA)>
+
+<!--
+Declaration of the filter mappings in this web application. The
+container uses the filter-mapping declarations to decide which filters
+to apply to a request, and in what order. The container matches the
+request URI to a Servlet in the normal way. To determine which filters
+to apply it matches filter-mapping declarations either on servlet-name,
+or on url-pattern for each filter-mapping element, depending on which
+style is used. The order in which filters are invoked is the order in
+which filter-mapping declarations that match a request URI for a
+servlet appear in the list of filter-mapping elements.The filter-name
+value must be the value of the <filter-name> sub-elements of one of the
+<filter> declarations in the deployment descriptor.
+
+Used in: web-app
+-->
+<!ELEMENT filter-mapping (filter-name, (url-pattern | servlet-name))>
+
+<!--
+The logical name of the filter. This name is used to map the filter.
+Each filter name is unique within the web application.
+
+Used in: filter, filter-mapping
+-->
+<!ELEMENT filter-name (#PCDATA)>
+
+<!--
+The form-error-page element defines the location in the web app
+where the error page that is displayed when login is not successful
+can be found. The path begins with a leading / and is interpreted
+relative to the root of the WAR.
+
+Used in: form-login-config
+-->
+<!ELEMENT form-error-page (#PCDATA)>
+
+<!--
+The form-login-config element specifies the login and error pages
+that should be used in form based login. If form based authentication
+is not used, these elements are ignored.
+
+Used in: login-config
+-->
+<!ELEMENT form-login-config (form-login-page, form-error-page)>
+
+<!--
+The form-login-page element defines the location in the web app
+where the page that can be used for login can be found. The path
+begins with a leading / and is interpreted relative to the root of the WAR.
+
+Used in: form-login-config
+-->
+<!ELEMENT form-login-page (#PCDATA)>
+
+<!--
+The home element contains the fully-qualified name of the enterprise
+bean's home interface.
+
+Used in: ejb-ref
+
+Example:
+
+<home>com.aardvark.payroll.PayrollHome</home>
+-->
+<!ELEMENT home (#PCDATA)>
+
+<!--
+The http-method contains an HTTP method (GET | POST |...).
+
+Used in: web-resource-collection
+-->
+<!ELEMENT http-method (#PCDATA)>
+
+<!--
+The icon element contains small-icon and large-icon elements that
+specify the file names for small and a large GIF or JPEG icon images
+used to represent the parent element in a GUI tool.
+
+Used in: filter, servlet, web-app
+-->
+<!ELEMENT icon (small-icon?, large-icon?)>
+
+<!--
+The init-param element contains a name/value pair as an
+initialization param of the servlet
+
+Used in: filter, servlet
+-->
+<!ELEMENT init-param (param-name, param-value, description?)>
+
+<!--
+The jsp-file element contains the full path to a JSP file within
+the web application beginning with a `/'.
+
+Used in: servlet
+-->
+<!ELEMENT jsp-file (#PCDATA)>
+
+<!--
+The large-icon element contains the name of a file
+containing a large (32 x 32) icon image. The file
+name is a relative path within the web application's
+war file.
+
+The image may be either in the JPEG or GIF format.
+The icon can be used by tools.
+
+Used in: icon
+
+Example:
+
+<large-icon>employee-service-icon32x32.jpg</large-icon>
+-->
+<!ELEMENT large-icon (#PCDATA)>
+
+<!--
+The listener element indicates the deployment properties for a web
+application listener bean.
+
+Used in: web-app
+-->
+<!ELEMENT listener (listener-class)>
+
+<!--
+The listener-class element declares a class in the application must be
+registered as a web application listener bean. The value is the fully qualified classname of the listener class.
+
+
+Used in: listener
+-->
+<!ELEMENT listener-class (#PCDATA)>
+
+<!--
+The load-on-startup element indicates that this servlet should be
+loaded (instantiated and have its init() called) on the startup
+of the web application. The optional contents of
+these element must be an integer indicating the order in which
+the servlet should be loaded. If the value is a negative integer,
+or the element is not present, the container is free to load the
+servlet whenever it chooses. If the value is a positive integer
+or 0, the container must load and initialize the servlet as the
+application is deployed. The container must guarantee that
+servlets marked with lower integers are loaded before servlets
+marked with higher integers. The container may choose the order
+of loading of servlets with the same load-on-start-up value.
+
+Used in: servlet
+-->
+<!ELEMENT load-on-startup (#PCDATA)>
+
+<!--
+
+The local element contains the fully-qualified name of the
+enterprise bean's local interface.
+
+Used in: ejb-local-ref
+
+-->
+<!ELEMENT local (#PCDATA)>
+
+<!--
+
+The local-home element contains the fully-qualified name of the
+enterprise bean's local home interface.
+
+Used in: ejb-local-ref
+-->
+<!ELEMENT local-home (#PCDATA)>
+
+<!--
+The location element contains the location of the resource in the web
+application relative to the root of the web application. The value of
+the location must have a leading `/'.
+
+Used in: error-page
+-->
+<!ELEMENT location (#PCDATA)>
+
+<!--
+The login-config element is used to configure the authentication
+method that should be used, the realm name that should be used for
+this application, and the attributes that are needed by the form login
+mechanism.
+
+Used in: web-app
+-->
+<!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)>
+
+<!--
+The mime-mapping element defines a mapping between an extension
+and a mime type.
+
+Used in: web-app
+-->
+<!ELEMENT mime-mapping (extension, mime-type)>
+
+<!--
+The mime-type element contains a defined mime type. example:
+"text/plain"
+
+Used in: mime-mapping
+-->
+<!ELEMENT mime-type (#PCDATA)>
+
+<!--
+The param-name element contains the name of a parameter. Each parameter
+name must be unique in the web application.
+
+
+Used in: context-param, init-param
+-->
+<!ELEMENT param-name (#PCDATA)>
+
+<!--
+The param-value element contains the value of a parameter.
+
+Used in: context-param, init-param
+-->
+<!ELEMENT param-value (#PCDATA)>
+
+<!--
+The realm name element specifies the realm name to use in HTTP
+Basic authorization.
+
+Used in: login-config
+-->
+<!ELEMENT realm-name (#PCDATA)>
+
+<!--
+The remote element contains the fully-qualified name of the enterprise
+bean's remote interface.
+
+Used in: ejb-ref
+
+Example:
+
+<remote>com.wombat.empl.EmployeeService</remote>
+-->
+<!ELEMENT remote (#PCDATA)>
+
+<!--
+The res-auth element specifies whether the web application code signs
+on programmatically to the resource manager, or whether the Container
+will sign on to the resource manager on behalf of the web application. In the
+latter case, the Container uses information that is supplied by the
+Deployer.
+
+The value of this element must be one of the two following:
+
+	<res-auth>Application</res-auth>
+	<res-auth>Container</res-auth>
+
+Used in: resource-ref
+-->
+<!ELEMENT res-auth (#PCDATA)>
+
+<!--
+The res-ref-name element specifies the name of a resource manager
+connection factory reference.  The name is a JNDI name relative to the
+java:comp/env context.  The name must be unique within a web application.
+
+Used in: resource-ref
+-->
+<!ELEMENT res-ref-name (#PCDATA)>
+
+<!--
+The res-sharing-scope element specifies whether connections obtained
+through the given resource manager connection factory reference can be
+shared. The value of this element, if specified, must be one of the
+two following:
+
+	<res-sharing-scope>Shareable</res-sharing-scope>
+	<res-sharing-scope>Unshareable</res-sharing-scope>
+
+The default value is Shareable.
+
+Used in: resource-ref
+-->
+<!ELEMENT res-sharing-scope (#PCDATA)>
+
+<!--
+The res-type element specifies the type of the data source. The type
+is specified by the fully qualified Java language class or interface
+expected to be implemented by the data source.
+
+Used in: resource-ref
+-->
+<!ELEMENT res-type (#PCDATA)>
+
+<!--
+The resource-env-ref element contains a declaration of a web application's
+reference to an administered object associated with a resource
+in the web application's environment.  It consists of an optional
+description, the resource environment reference name, and an
+indication of the resource environment reference type expected by
+the web application code.
+
+Used in: web-app
+
+Example:
+
+<resource-env-ref>
+    <resource-env-ref-name>jms/StockQueue</resource-env-ref-name>
+    <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
+</resource-env-ref>
+-->
+<!ELEMENT resource-env-ref (description?, resource-env-ref-name,
+		resource-env-ref-type)>
+
+<!--
+The resource-env-ref-name element specifies the name of a resource
+environment reference; its value is the environment entry name used in
+the web application code.  The name is a JNDI name relative to the
+java:comp/env context and must be unique within a web application.
+
+Used in: resource-env-ref
+-->
+<!ELEMENT resource-env-ref-name (#PCDATA)>
+
+<!--
+The resource-env-ref-type element specifies the type of a resource
+environment reference.  It is the fully qualified name of a Java
+language class or interface.
+
+Used in: resource-env-ref
+-->
+<!ELEMENT resource-env-ref-type (#PCDATA)>
+
+<!--
+The resource-ref element contains a declaration of a web application's
+reference to an external resource. It consists of an optional
+description, the resource manager connection factory reference name,
+the indication of the resource manager connection factory type
+expected by the web application code, the type of authentication
+(Application or Container), and an optional specification of the
+shareability of connections obtained from the resource (Shareable or
+Unshareable).
+
+Used in: web-app
+
+Example:
+
+    <resource-ref>
+	<res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
+	<res-type>javax.sql.DataSource</res-type>
+	<res-auth>Container</res-auth>
+	<res-sharing-scope>Shareable</res-sharing-scope>
+    </resource-ref>
+-->
+<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth,
+		res-sharing-scope?)>
+
+<!--
+The role-link element is a reference to a defined security role. The
+role-link element must contain the name of one of the security roles
+defined in the security-role elements.
+
+Used in: security-role-ref
+-->
+<!ELEMENT role-link (#PCDATA)>
+
+<!--
+The role-name element contains the name of a security role.
+
+The name must conform to the lexical rules for an NMTOKEN.
+
+Used in: auth-constraint, run-as, security-role, security-role-ref
+-->
+<!ELEMENT role-name (#PCDATA)>
+
+<!--
+The run-as element specifies the run-as identity to be used for the
+execution of the web application. It contains an optional description, and
+the name of a security role.
+
+Used in: servlet
+-->
+<!ELEMENT run-as (description?, role-name)>
+
+<!--
+The security-constraint element is used to associate security
+constraints with one or more web resource collections
+
+Used in: web-app
+-->
+<!ELEMENT security-constraint (display-name?, web-resource-collection+,
+auth-constraint?, user-data-constraint?)>
+
+<!--
+The security-role element contains the definition of a security
+role. The definition consists of an optional description of the
+security role, and the security role name.
+
+Used in: web-app
+
+Example:
+
+    <security-role>
+	<description>
+	    This role includes all employees who are authorized
+	    to access the employee service application.
+	</description>
+	<role-name>employee</role-name>
+    </security-role>
+-->
+<!ELEMENT security-role (description?, role-name)>
+
+<!--
+The security-role-ref element contains the declaration of a security
+role reference in the web application's code. The declaration consists
+of an optional description, the security role name used in the code,
+and an optional link to a security role. If the security role is not
+specified, the Deployer must choose an appropriate security role.
+
+The value of the role-name element must be the String used as the
+parameter to the EJBContext.isCallerInRole(String roleName) method
+or the HttpServletRequest.isUserInRole(String role) method.
+
+Used in: servlet
+
+-->
+<!ELEMENT security-role-ref (description?, role-name, role-link?)>
+
+<!--
+The servlet element contains the declarative data of a
+servlet. If a jsp-file is specified and the load-on-startup element is
+present, then the JSP should be precompiled and loaded.
+
+Used in: web-app
+-->
+<!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
+(servlet-class|jsp-file), init-param*, load-on-startup?, run-as?, security-role-ref*)>
+
+<!--
+The servlet-class element contains the fully qualified class name
+of the servlet.
+
+Used in: servlet
+-->
+<!ELEMENT servlet-class (#PCDATA)>
+
+<!--
+The servlet-mapping element defines a mapping between a servlet
+and a url pattern
+
+Used in: web-app
+-->
+<!ELEMENT servlet-mapping (servlet-name, url-pattern)>
+
+<!--
+The servlet-name element contains the canonical name of the
+servlet. Each servlet name is unique within the web application.
+
+Used in: filter-mapping, servlet, servlet-mapping
+-->
+<!ELEMENT servlet-name (#PCDATA)>
+
+<!--
+The session-config element defines the session parameters for
+this web application.
+
+Used in: web-app
+-->
+<!ELEMENT session-config (session-timeout?)>
+
+<!--
+The session-timeout element defines the default session timeout
+interval for all sessions created in this web application. The
+specified timeout must be expressed in a whole number of minutes.
+If the timeout is 0 or less, the container ensures the default
+behaviour of sessions is never to time out.
+
+Used in: session-config
+-->
+<!ELEMENT session-timeout (#PCDATA)>
+
+<!--
+The small-icon element contains the name of a file
+containing a small (16 x 16) icon image. The file
+name is a relative path within the web application's
+war file.
+
+The image may be either in the JPEG or GIF format.
+The icon can be used by tools.
+
+Used in: icon
+
+Example:
+
+<small-icon>employee-service-icon16x16.jpg</small-icon>
+-->
+<!ELEMENT small-icon (#PCDATA)>
+
+<!--
+The taglib element is used to describe a JSP tag library.
+
+Used in: web-app
+-->
+<!ELEMENT taglib (taglib-uri, taglib-location)>
+
+<!--
+the taglib-location element contains the location (as a resource
+relative to the root of the web application) where to find the Tag
+Libary Description file for the tag library.
+
+Used in: taglib
+-->
+<!ELEMENT taglib-location (#PCDATA)>
+
+<!--
+The taglib-uri element describes a URI, relative to the location
+of the web.xml document, identifying a Tag Library used in the Web
+Application.
+
+Used in: taglib
+-->
+<!ELEMENT taglib-uri (#PCDATA)>
+
+<!--
+The transport-guarantee element specifies that the communication
+between client and server should be NONE, INTEGRAL, or
+CONFIDENTIAL. NONE means that the application does not require any
+transport guarantees. A value of INTEGRAL means that the application
+requires that the data sent between the client and server be sent in
+such a way that it can't be changed in transit. CONFIDENTIAL means
+that the application requires that the data be transmitted in a
+fashion that prevents other entities from observing the contents of
+the transmission. In most cases, the presence of the INTEGRAL or
+CONFIDENTIAL flag will indicate that the use of SSL is required.
+
+Used in: user-data-constraint
+-->
+<!ELEMENT transport-guarantee (#PCDATA)>
+
+<!--
+The url-pattern element contains the url pattern of the mapping. Must
+follow the rules specified in Section 11.2 of the Servlet API
+Specification.
+
+Used in: filter-mapping, servlet-mapping, web-resource-collection
+-->
+<!ELEMENT url-pattern (#PCDATA)>
+
+<!--
+The user-data-constraint element is used to indicate how data
+communicated between the client and container should be protected.
+
+Used in: security-constraint
+-->
+<!ELEMENT user-data-constraint (description?, transport-guarantee)>
+
+<!--
+The web-resource-collection element is used to identify a subset
+of the resources and HTTP methods on those resources within a web
+application to which a security constraint applies. If no HTTP methods
+are specified, then the security constraint applies to all HTTP
+methods.
+
+Used in: security-constraint
+-->
+<!ELEMENT web-resource-collection (web-resource-name, description?,
+url-pattern*, http-method*)>
+
+<!--
+The web-resource-name contains the name of this web resource
+collection.
+
+Used in: web-resource-collection
+-->
+<!ELEMENT web-resource-name (#PCDATA)>
+
+<!--
+The welcome-file element contains file name to use as a default
+welcome file, such as index.html
+
+Used in: welcome-file-list
+-->
+<!ELEMENT welcome-file (#PCDATA)>
+
+<!--
+The welcome-file-list contains an ordered list of welcome files
+elements.
+
+Used in: web-app
+-->
+<!ELEMENT welcome-file-list (welcome-file+)>
+
+<!--
+The ID mechanism is to allow tools that produce additional deployment
+information (i.e., information beyond the standard deployment
+descriptor information) to store the non-standard information in a
+separate file, and easily refer from these tool-specific files to the
+information in the standard deployment descriptor.
+
+Tools are not allowed to add the non-standard information into the
+standard deployment descriptor.
+-->
+
+<!ATTLIST auth-constraint id ID #IMPLIED>
+<!ATTLIST auth-method id ID #IMPLIED>
+<!ATTLIST context-param id ID #IMPLIED>
+<!ATTLIST description id ID #IMPLIED>
+<!ATTLIST display-name id ID #IMPLIED>
+<!ATTLIST distributable id ID #IMPLIED>
+<!ATTLIST ejb-link id ID #IMPLIED>
+<!ATTLIST ejb-local-ref id ID #IMPLIED>
+<!ATTLIST ejb-ref id ID #IMPLIED>
+<!ATTLIST ejb-ref-name id ID #IMPLIED>
+<!ATTLIST ejb-ref-type id ID #IMPLIED>
+<!ATTLIST env-entry id ID #IMPLIED>
+<!ATTLIST env-entry-name id ID #IMPLIED>
+<!ATTLIST env-entry-type id ID #IMPLIED>
+<!ATTLIST env-entry-value id ID #IMPLIED>
+<!ATTLIST error-code id ID #IMPLIED>
+<!ATTLIST error-page id ID #IMPLIED>
+<!ATTLIST exception-type id ID #IMPLIED>
+<!ATTLIST extension id ID #IMPLIED>
+<!ATTLIST filter id ID #IMPLIED>
+<!ATTLIST filter-class id ID #IMPLIED>
+<!ATTLIST filter-mapping id ID #IMPLIED>
+<!ATTLIST filter-name id ID #IMPLIED>
+<!ATTLIST form-error-page id ID #IMPLIED>
+<!ATTLIST form-login-config id ID #IMPLIED>
+<!ATTLIST form-login-page id ID #IMPLIED>
+<!ATTLIST home id ID #IMPLIED>
+<!ATTLIST http-method id ID #IMPLIED>
+<!ATTLIST icon id ID #IMPLIED>
+<!ATTLIST init-param id ID #IMPLIED>
+<!ATTLIST jsp-file id ID #IMPLIED>
+<!ATTLIST large-icon id ID #IMPLIED>
+<!ATTLIST listener id ID #IMPLIED>
+<!ATTLIST listener-class id ID #IMPLIED>
+<!ATTLIST load-on-startup id ID #IMPLIED>
+<!ATTLIST local id ID #IMPLIED>
+<!ATTLIST local-home id ID #IMPLIED>
+<!ATTLIST location id ID #IMPLIED>
+<!ATTLIST login-config id ID #IMPLIED>
+<!ATTLIST mime-mapping id ID #IMPLIED>
+<!ATTLIST mime-type id ID #IMPLIED>
+<!ATTLIST param-name id ID #IMPLIED>
+<!ATTLIST param-value id ID #IMPLIED>
+<!ATTLIST realm-name id ID #IMPLIED>
+<!ATTLIST remote id ID #IMPLIED>
+<!ATTLIST res-auth id ID #IMPLIED>
+<!ATTLIST res-ref-name id ID #IMPLIED>
+<!ATTLIST res-sharing-scope id ID #IMPLIED>
+<!ATTLIST res-type id ID #IMPLIED>
+<!ATTLIST resource-env-ref id ID #IMPLIED>
+<!ATTLIST resource-env-ref-name id ID #IMPLIED>
+<!ATTLIST resource-env-ref-type id ID #IMPLIED>
+<!ATTLIST resource-ref id ID #IMPLIED>
+<!ATTLIST role-link id ID #IMPLIED>
+<!ATTLIST role-name id ID #IMPLIED>
+<!ATTLIST run-as id ID #IMPLIED>
+<!ATTLIST security-constraint id ID #IMPLIED>
+<!ATTLIST security-role id ID #IMPLIED>
+<!ATTLIST security-role-ref id ID #IMPLIED>
+<!ATTLIST servlet id ID #IMPLIED>
+<!ATTLIST servlet-class id ID #IMPLIED>
+<!ATTLIST servlet-mapping id ID #IMPLIED>
+<!ATTLIST servlet-name id ID #IMPLIED>
+<!ATTLIST session-config id ID #IMPLIED>
+<!ATTLIST session-timeout id ID #IMPLIED>
+<!ATTLIST small-icon id ID #IMPLIED>
+<!ATTLIST taglib id ID #IMPLIED>
+<!ATTLIST taglib-location id ID #IMPLIED>
+<!ATTLIST taglib-uri id ID #IMPLIED>
+<!ATTLIST transport-guarantee id ID #IMPLIED>
+<!ATTLIST url-pattern id ID #IMPLIED>
+<!ATTLIST user-data-constraint id ID #IMPLIED>
+<!ATTLIST web-app id ID #IMPLIED>
+<!ATTLIST web-resource-collection id ID #IMPLIED>
+<!ATTLIST web-resource-name id ID #IMPLIED>
+<!ATTLIST welcome-file id ID #IMPLIED>
+<!ATTLIST welcome-file-list id ID #IMPLIED>
diff --git a/xml/tests/testData/generateTag/web-app_2_5.xsd b/xml/tests/testData/generateTag/web-app_2_5.xsd
new file mode 100644
index 0000000..28e956f
--- /dev/null
+++ b/xml/tests/testData/generateTag/web-app_2_5.xsd
@@ -0,0 +1,1290 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ The contents of this file are subject to the terms
+ of the Common Development and Distribution License
+ (the "License").  You may not use this file except
+ in compliance with the License.
+
+ You can obtain a copy of the license at
+ glassfish/bootstrap/legal/CDDLv1.0.txt or
+ https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ See the License for the specific language governing
+ permissions and limitations under the License.
+
+ When distributing Covered Code, include this CDDL
+ HEADER in each file and include the License file at
+ glassfish/bootstrap/legal/CDDLv1.0.txt.  If applicable,
+ add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your
+ own identifying information: Portions Copyright [yyyy]
+ [name of copyright owner]
+-->
+
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+	    targetNamespace="http://java.sun.com/xml/ns/javaee"
+	    xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	    elementFormDefault="qualified"
+	    attributeFormDefault="unqualified"
+	    version="2.5">
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)web-app_2_5.xsds	1.62 05/08/06
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      Copyright 2003-2005 Sun Microsystems, Inc.
+      4150 Network Circle
+      Santa Clara, California 95054
+      U.S.A
+      All rights reserved.
+
+      Sun Microsystems, Inc. has intellectual property rights
+      relating to technology described in this document. In
+      particular, and without limitation, these intellectual
+      property rights may include one or more of the U.S. patents
+      listed at http://www.sun.com/patents and one or more
+      additional patents or pending patent applications in the
+      U.S. and other countries.
+
+      This document and the technology which it describes are
+      distributed under licenses restricting their use, copying,
+      distribution, and decompilation. No part of this document
+      may be reproduced in any form by any means without prior
+      written authorization of Sun and its licensors, if any.
+
+      Third-party software, including font technology, is
+      copyrighted and licensed from Sun suppliers.
+
+      Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
+      JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+      Cup logo are trademarks or registered trademarks of Sun
+      Microsystems, Inc. in the U.S. and other countries.
+
+      Federal Acquisitions: Commercial Software - Government Users
+      Subject to Standard License Terms and Conditions.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[
+
+	This is the XML Schema for the Servlet 2.5 deployment descriptor.
+	The deployment descriptor must be named "WEB-INF/web.xml" in the
+	web application's war file.  All Servlet deployment descriptors
+	must indicate the web application schema by using the Java EE
+	namespace:
+
+	http://java.sun.com/xml/ns/javaee
+
+	and by indicating the version of the schema by
+	using the version element as shown below:
+
+	    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
+	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	      xsi:schemaLocation="..."
+	      version="2.5">
+	      ...
+	    </web-app>
+
+	The instance documents may indicate the published version of
+	the schema using the xsi:schemaLocation attribute for Java EE
+	namespace with the following location:
+
+	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
+
+	]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all Java EE
+      deployment descriptor elements unless indicated otherwise.
+
+      - In elements that specify a pathname to a file within the
+	same JAR file, relative filenames (i.e., those not
+	starting with "/") are considered relative to the root of
+	the JAR file's namespace.  Absolute filenames (i.e., those
+	starting with "/") also specify names in the root of the
+	JAR file's namespace.  In general, relative names are
+	preferred.  The exception is .war files where absolute
+	names are preferred for consistency with the Servlet API.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="javaee_5.xsd"/>
+  <xsd:include schemaLocation="jsp_2_1.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:element name="web-app" type="javaee:web-appType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The web-app element is the root of the deployment
+	descriptor for a web application.  Note that the sub-elements
+	of this element can be in the arbitrary order. Because of
+	that, the multiplicity of the elements of distributable,
+	session-config, welcome-file-list, jsp-config, login-config,
+	and locale-encoding-mapping-list was changed from "?" to "*"
+	in this schema.  However, the deployment descriptor instance
+	file must not contain multiple elements of session-config,
+	jsp-config, and login-config. When there are multiple elements of
+	welcome-file-list or locale-encoding-mapping-list, the container
+	must concatenate the element contents.  The multiple occurence
+	of the element distributable is redundant and the container
+	treats that case exactly in the same way when there is only
+	one distributable.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:unique name="web-app-servlet-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The servlet element contains the name of a servlet.
+	  The name must be unique within the web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:servlet"/>
+      <xsd:field    xpath="javaee:servlet-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-filter-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The filter element contains the name of a filter.
+	  The name must be unique within the web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:filter"/>
+      <xsd:field    xpath="javaee:filter-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-ejb-local-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The ejb-local-ref-name element contains the name of an EJB
+	  reference. The EJB reference is an entry in the web
+	  application's environment and is relative to the
+	  java:comp/env context.  The name must be unique within
+	  the web application.
+
+	  It is recommended that name is prefixed with "ejb/".
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:ejb-local-ref"/>
+      <xsd:field    xpath="javaee:ejb-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-ejb-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The ejb-ref-name element contains the name of an EJB
+	  reference. The EJB reference is an entry in the web
+	  application's environment and is relative to the
+	  java:comp/env context.  The name must be unique within
+	  the web application.
+
+	  It is recommended that name is prefixed with "ejb/".
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:ejb-ref"/>
+      <xsd:field    xpath="javaee:ejb-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-resource-env-ref-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The resource-env-ref-name element specifies the name of
+	  a resource environment reference; its value is the
+	  environment entry name used in the web application code.
+	  The name is a JNDI name relative to the java:comp/env
+	  context and must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-env-ref"/>
+      <xsd:field    xpath="javaee:resource-env-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-message-destination-ref-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The message-destination-ref-name element specifies the name of
+	  a message destination reference; its value is the
+	  environment entry name used in the web application code.
+	  The name is a JNDI name relative to the java:comp/env
+	  context and must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:message-destination-ref"/>
+      <xsd:field    xpath="javaee:message-destination-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-res-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The res-ref-name element specifies the name of a
+	  resource manager connection factory reference.  The name
+	  is a JNDI name relative to the java:comp/env context.
+	  The name must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-ref"/>
+      <xsd:field    xpath="javaee:res-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-env-entry-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The env-entry-name element contains the name of a web
+	  application's environment entry.  The name is a JNDI
+	  name relative to the java:comp/env context.  The name
+	  must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:selector xpath="javaee:env-entry"/>
+      <xsd:field    xpath="javaee:env-entry-name"/>
+    </xsd:unique>
+
+    <xsd:key name="web-app-role-name-key">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  A role-name-key is specified to allow the references
+	  from the security-role-refs.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:security-role"/>
+      <xsd:field    xpath="javaee:role-name"/>
+    </xsd:key>
+
+    <xsd:keyref name="web-app-role-name-references"
+		refer="javaee:web-app-role-name-key">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The keyref indicates the references from
+	  security-role-ref to a specified role-name.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:servlet/javaee:security-role-ref"/>
+      <xsd:field    xpath="javaee:role-link"/>
+    </xsd:keyref>
+  </xsd:element>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="auth-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The auth-constraintType indicates the user roles that
+	should be permitted access to this resource
+	collection. The role-name used here must either correspond
+	to the role-name of one of the security-role elements
+	defined for this web application, or be the specially
+	reserved role-name "*" that is a compact syntax for
+	indicating all roles in the web application. If both "*"
+	and rolenames appear, the container interprets this as all
+	roles.  If no roles are defined, no user is allowed access
+	to the portion of the web application described by the
+	containing security-constraint.  The container matches
+	role names case sensitively when determining access.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+		   type="javaee:role-nameType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="auth-methodType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The auth-methodType is used to configure the authentication
+	mechanism for the web application. As a prerequisite to
+	gaining access to any web resources which are protected by
+	an authorization constraint, a user must have authenticated
+	using the configured mechanism. Legal values are "BASIC",
+	"DIGEST", "FORM", "CLIENT-CERT", or a vendor-specific
+	authentication scheme.
+
+	Used in: login-config
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="dispatcherType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The dispatcher has four legal values: FORWARD, REQUEST, INCLUDE,
+	and ERROR. A value of FORWARD means the Filter will be applied
+	under RequestDispatcher.forward() calls.  A value of REQUEST
+	means the Filter will be applied under ordinary client calls to
+	the path or servlet. A value of INCLUDE means the Filter will be
+	applied under RequestDispatcher.include() calls.  A value of
+	ERROR means the Filter will be applied under the error page
+	mechanism.  The absence of any dispatcher elements in a
+	filter-mapping indicates a default of applying filters only under
+	ordinary client calls to the path or servlet.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="FORWARD"/>
+	<xsd:enumeration value="INCLUDE"/>
+	<xsd:enumeration value="REQUEST"/>
+	<xsd:enumeration value="ERROR"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="encodingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The encodingType defines IANA character sets.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="[^\s]+"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="error-codeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The error-code contains an HTTP error code, ex: 404
+
+	Used in: error-page
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:xsdPositiveIntegerType">
+	<xsd:pattern value="\d{3}"/>
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="error-pageType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The error-pageType contains a mapping between an error code
+	or exception type to the path of a resource in the web
+	application.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:choice>
+	<xsd:element name="error-code"
+		     type="javaee:error-codeType"/>
+
+	<xsd:element name="exception-type"
+		     type="javaee:fully-qualified-classType">
+	  <xsd:annotation>
+	    <xsd:documentation>
+
+	      The exception-type contains a fully qualified class
+	      name of a Java exception type.
+
+	    </xsd:documentation>
+	  </xsd:annotation>
+	</xsd:element>
+      </xsd:choice>
+
+      <xsd:element name="location"
+		   type="javaee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The location element contains the location of the
+	    resource in the web application relative to the root of
+	    the web application. The value of the location must have
+	    a leading `/'.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filter-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	Declaration of the filter mappings in this web
+	application is done by using filter-mappingType.
+	The container uses the filter-mapping
+	declarations to decide which filters to apply to a request,
+	and in what order. The container matches the request URI to
+	a Servlet in the normal way. To determine which filters to
+	apply it matches filter-mapping declarations either on
+	servlet-name, or on url-pattern for each filter-mapping
+	element, depending on which style is used. The order in
+	which filters are invoked is the order in which
+	filter-mapping declarations that match a request URI for a
+	servlet appear in the list of filter-mapping elements.The
+	filter-name value must be the value of the filter-name
+	sub-elements of one of the filter declarations in the
+	deployment descriptor.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="filter-name"
+		   type="javaee:filter-nameType"/>
+      <xsd:choice minOccurs="1" maxOccurs="unbounded">
+	<xsd:element name="url-pattern"
+		     type="javaee:url-patternType"/>
+	<xsd:element name="servlet-name"
+		     type="javaee:servlet-nameType"/>
+      </xsd:choice>
+      <xsd:element name="dispatcher"
+		   type="javaee:dispatcherType"
+		   minOccurs="0" maxOccurs="4"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filter-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The logical name of the filter is declare
+	by using filter-nameType. This name is used to map the
+	filter.  Each filter name is unique within the web
+	application.
+
+	Used in: filter, filter-mapping
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filterType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The filterType is used to declare a filter in the web
+	application. The filter is mapped to either a servlet or a
+	URL pattern in the filter-mapping element, using the
+	filter-name value to reference. Filters can access the
+	initialization parameters declared in the deployment
+	descriptor at runtime via the FilterConfig interface.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="filter-name"
+		   type="javaee:filter-nameType"/>
+      <xsd:element name="filter-class"
+		   type="javaee:fully-qualified-classType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The fully qualified classname of the filter.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="init-param"
+		   type="javaee:param-valueType"
+		   minOccurs="0" maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The init-param element contains a name/value pair as
+	    an initialization param of a servlet filter
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="form-login-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The form-login-configType specifies the login and error
+	pages that should be used in form based login. If form based
+	authentication is not used, these elements are ignored.
+
+	Used in: login-config
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+
+      <xsd:element name="form-login-page"
+		   type="javaee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The form-login-page element defines the location in the web
+	    app where the page that can be used for login can be
+	    found.  The path begins with a leading / and is interpreted
+	    relative to the root of the WAR.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="form-error-page"
+		   type="javaee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The form-error-page element defines the location in
+	    the web app where the error page that is displayed
+	    when login is not successful can be found.
+	    The path begins with a leading / and is interpreted
+	    relative to the root of the WAR.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="http-methodType">
+    <xsd:annotation>
+
+      <xsd:documentation>
+
+	A HTTP method type as defined in HTTP 1.1 section 2.2.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+     <xsd:restriction base="xsd:token">
+         <xsd:pattern value="[\p{L}-[\p{Cc}\p{Z}]]+"/>
+     </xsd:restriction>
+
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="load-on-startupType">
+    <xsd:union memberTypes="javaee:null-charType xsd:integer"/>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="locale-encoding-mapping-listType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The locale-encoding-mapping-list contains one or more
+	locale-encoding-mapping(s).
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="locale-encoding-mapping"
+		   type="javaee:locale-encoding-mappingType"
+		   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="locale-encoding-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The locale-encoding-mapping contains locale name and
+	encoding name. The locale name must be either "Language-code",
+	such as "ja", defined by ISO-639 or "Language-code_Country-code",
+	such as "ja_JP".  "Country code" is defined by ISO-3166.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="locale"
+		   type="javaee:localeType"/>
+      <xsd:element name="encoding"
+		   type="javaee:encodingType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="localeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The localeType defines valid locale defined by ISO-639-1
+	and ISO-3166.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="[a-z]{2}(_|-)?([\p{L}\-\p{Nd}]{2})?"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="login-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The login-configType is used to configure the authentication
+	method that should be used, the realm name that should be
+	used for this application, and the attributes that are
+	needed by the form login mechanism.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="auth-method"
+		   type="javaee:auth-methodType"
+		   minOccurs="0"/>
+      <xsd:element name="realm-name"
+		   type="javaee:string" minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The realm name element specifies the realm name to
+	    use in HTTP Basic authorization.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="form-login-config"
+		   type="javaee:form-login-configType"
+		   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mime-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The mime-mappingType defines a mapping between an extension
+	and a mime type.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The extension element contains a string describing an
+	  extension. example: "txt"
+
+	</xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:element name="extension"
+		   type="javaee:string"/>
+      <xsd:element name="mime-type"
+		   type="javaee:mime-typeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mime-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The mime-typeType is used to indicate a defined mime type.
+
+	Example:
+	"text/plain"
+
+	Used in: mime-mapping
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:pattern value="[^\p{Cc}^\s]+/[^\p{Cc}^\s]+"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="nonEmptyStringType">
+    <xsd:annotation>
+      <xsd:documentation>
+	This type defines a string which contains at least one
+	character.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:minLength value="1"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="null-charType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value=""/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The security-constraintType is used to associate
+	security constraints with one or more web resource
+	collections
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="display-name"
+		   type="javaee:display-nameType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="web-resource-collection"
+		   type="javaee:web-resource-collectionType"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="auth-constraint"
+		   type="javaee:auth-constraintType"
+		   minOccurs="0"/>
+      <xsd:element name="user-data-constraint"
+		   type="javaee:user-data-constraintType"
+		   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servlet-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servlet-mappingType defines a mapping between a
+	servlet and a url pattern.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="servlet-name"
+		   type="javaee:servlet-nameType"/>
+      <xsd:element name="url-pattern"
+		   type="javaee:url-patternType"
+           minOccurs="1" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servlet-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servlet-name element contains the canonical name of the
+	servlet. Each servlet name is unique within the web
+	application.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servletType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servletType is used to declare a servlet.
+	It contains the declarative data of a
+	servlet. If a jsp-file is specified and the load-on-startup
+	element is present, then the JSP should be precompiled and
+	loaded.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="servlet-name"
+		   type="javaee:servlet-nameType"/>
+      <xsd:choice>
+	<xsd:element name="servlet-class"
+		     type="javaee:fully-qualified-classType">
+	  <xsd:annotation>
+	    <xsd:documentation>
+
+	      The servlet-class element contains the fully
+	      qualified class name of the servlet.
+
+	    </xsd:documentation>
+	  </xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="jsp-file"
+		     type="javaee:jsp-fileType"/>
+
+      </xsd:choice>
+
+      <xsd:element name="init-param"
+		   type="javaee:param-valueType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="load-on-startup"
+		   type="javaee:load-on-startupType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The load-on-startup element indicates that this
+	    servlet should be loaded (instantiated and have
+	    its init() called) on the startup of the web
+	    application. The optional contents of these
+	    element must be an integer indicating the order in
+	    which the servlet should be loaded. If the value
+	    is a negative integer, or the element is not
+	    present, the container is free to load the servlet
+	    whenever it chooses. If the value is a positive
+	    integer or 0, the container must load and
+	    initialize the servlet as the application is
+	    deployed. The container must guarantee that
+	    servlets marked with lower integers are loaded
+	    before servlets marked with higher integers. The
+	    container may choose the order of loading of
+	    servlets with the same load-on-start-up value.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="run-as"
+		   type="javaee:run-asType"
+		   minOccurs="0"/>
+      <xsd:element name="security-role-ref"
+		   type="javaee:security-role-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="session-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The session-configType defines the session parameters
+	for this web application.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="session-timeout"
+		   type="javaee:xsdIntegerType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The session-timeout element defines the default
+	    session timeout interval for all sessions created
+	    in this web application. The specified timeout
+	    must be expressed in a whole number of minutes.
+	    If the timeout is 0 or less, the container ensures
+	    the default behaviour of sessions is never to time
+	    out. If this element is not specified, the container
+	    must set its default timeout period.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="transport-guaranteeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The transport-guaranteeType specifies that the communication
+	between client and server should be NONE, INTEGRAL, or
+	CONFIDENTIAL. NONE means that the application does not
+	require any transport guarantees. A value of INTEGRAL means
+	that the application requires that the data sent between the
+	client and server be sent in such a way that it can't be
+	changed in transit. CONFIDENTIAL means that the application
+	requires that the data be transmitted in a fashion that
+	prevents other entities from observing the contents of the
+	transmission. In most cases, the presence of the INTEGRAL or
+	CONFIDENTIAL flag will indicate that the use of SSL is
+	required.
+
+	Used in: user-data-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="NONE"/>
+	<xsd:enumeration value="INTEGRAL"/>
+	<xsd:enumeration value="CONFIDENTIAL"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="user-data-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The user-data-constraintType is used to indicate how
+	data communicated between the client and container should be
+	protected.
+
+	Used in: security-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="transport-guarantee"
+		   type="javaee:transport-guaranteeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="war-pathType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The elements that use this type designate a path starting
+	with a "/" and interpreted relative to the root of a WAR
+	file.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:pattern value="/.*"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="web-app-versionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type contains the recognized versions of
+	web-application supported. It is used to designate the
+	version of the web application.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="2.5"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="web-appType">
+
+    <xsd:choice minOccurs="0" maxOccurs="unbounded">
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="distributable"
+		   type="javaee:emptyType"/>
+      <xsd:element name="context-param"
+		   type="javaee:param-valueType">
+
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The context-param element contains the declaration
+	    of a web application's servlet context
+	    initialization parameters.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="filter"
+		   type="javaee:filterType"/>
+      <xsd:element name="filter-mapping"
+		   type="javaee:filter-mappingType"/>
+      <xsd:element name="listener"
+		   type="javaee:listenerType"/>
+      <xsd:element name="servlet"
+		   type="javaee:servletType"/>
+      <xsd:element name="servlet-mapping"
+		   type="javaee:servlet-mappingType"/>
+      <xsd:element name="session-config"
+		   type="javaee:session-configType"/>
+      <xsd:element name="mime-mapping"
+		   type="javaee:mime-mappingType"/>
+      <xsd:element name="welcome-file-list"
+		   type="javaee:welcome-file-listType"/>
+      <xsd:element name="error-page"
+		   type="javaee:error-pageType"/>
+      <xsd:element name="jsp-config"
+		   type="javaee:jsp-configType"/>
+      <xsd:element name="security-constraint"
+		   type="javaee:security-constraintType"/>
+      <xsd:element name="login-config"
+		   type="javaee:login-configType"/>
+      <xsd:element name="security-role"
+		   type="javaee:security-roleType"/>
+      <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
+      <xsd:element name="message-destination"
+		   type="javaee:message-destinationType"/>
+      <xsd:element name="locale-encoding-mapping-list"
+		   type="javaee:locale-encoding-mapping-listType"/>
+    </xsd:choice>
+
+    <xsd:attribute name="version"
+		   type="javaee:web-app-versionType"
+		   use="required"/>
+    <xsd:attribute name="id" type="xsd:ID"/>
+
+    <xsd:attribute name="metadata-complete" type="xsd:boolean">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The metadata-complete attribute defines whether this
+	  deployment descriptor and other related deployment
+	  descriptors for this module (e.g., web service
+	  descriptors) are complete, or whether the class
+	  files available to this module and packaged with
+	  this application should be examined for annotations
+	  that specify deployment information.
+
+	  If metadata-complete is set to "true", the deployment
+	  tool must ignore any annotations that specify deployment
+	  information, which might be present in the class files
+	  of the application.
+
+	  If metadata-complete is not specified or is set to
+	  "false", the deployment tool must examine the class
+	  files of the application for annotations, as
+	  specified by the specifications.
+
+	</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="web-resource-collectionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The web-resource-collectionType is used to identify a subset
+	of the resources and HTTP methods on those resources within
+	a web application to which a security constraint applies. If
+	no HTTP methods are specified, then the security constraint
+	applies to all HTTP methods.
+
+	Used in: security-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="web-resource-name"
+		   type="javaee:string">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The web-resource-name contains the name of this web
+	    resource collection.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="url-pattern"
+		   type="javaee:url-patternType"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="http-method"
+		   type="javaee:http-methodType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="welcome-file-listType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The welcome-file-list contains an ordered list of welcome
+	files elements.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="welcome-file"
+		   type="xsd:string"
+		   maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The welcome-file element contains file name to use
+	    as a default welcome file, such as index.html
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+</xsd:schema>
+
diff --git a/xml/tests/testData/index/Semantic.xsd b/xml/tests/testData/index/Semantic.xsd
new file mode 100644
index 0000000..b4be8a3
--- /dev/null
+++ b/xml/tests/testData/index/Semantic.xsd
@@ -0,0 +1,1562 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
+            xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL">
+
+	<xsd:element name="activity" type="tActivity"/>
+	<xsd:complexType name="tActivity" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowNode">
+				<xsd:sequence>
+					<xsd:element ref="ioSpecification" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="property" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="dataInputAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="dataOutputAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="resourceRole" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="loopCharacteristics" minOccurs="0"/>
+				</xsd:sequence>
+				<xsd:attribute name="isForCompensation" type="xsd:boolean" default="false"/>
+				<xsd:attribute name="startQuantity" type="xsd:integer" default="1"/>
+				<xsd:attribute name="completionQuantity" type="xsd:integer" default="1"/>
+				<xsd:attribute name="default" type="xsd:IDREF" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="adHocSubProcess" type="tAdHocSubProcess" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tAdHocSubProcess">
+		<xsd:complexContent>
+			<xsd:extension base="tSubProcess">
+				<xsd:sequence>
+					<xsd:element name="completionCondition" type="tExpression" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="cancelRemainingInstances" type="xsd:boolean" default="true"/>
+				<xsd:attribute name="ordering" type="tAdHocOrdering"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:simpleType name="tAdHocOrdering">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="Parallel"/>
+			<xsd:enumeration value="Sequential"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+	<xsd:element name="artifact" type="tArtifact"/>
+	<xsd:complexType name="tArtifact" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="assignment" type="tAssignment" />
+	<xsd:complexType name="tAssignment">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="from" type="tExpression" minOccurs="1" maxOccurs="1"/>
+					<xsd:element name="to" type="tExpression" minOccurs="1" maxOccurs="1"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="association" type="tAssociation" substitutionGroup="artifact"/>
+	<xsd:complexType name="tAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tArtifact">
+				<xsd:attribute name="sourceRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="targetRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="associationDirection" type="tAssociationDirection" default="None"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:simpleType name="tAssociationDirection">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="None"/>
+			<xsd:enumeration value="One"/>
+			<xsd:enumeration value="Both"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+	<xsd:element name="auditing" type="tAuditing"/>
+	<xsd:complexType name="tAuditing">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="baseElement" type="tBaseElement"/>
+	<xsd:complexType name="tBaseElement" abstract="true">
+		<xsd:sequence>
+			<xsd:element ref="documentation" minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:element ref="extensionElements" minOccurs="0" maxOccurs="1" />
+		</xsd:sequence>
+		<xsd:attribute name="id" type="xsd:ID" use="optional"/>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:complexType>
+
+	<xsd:element name="baseElementWithMixedContent" type="tBaseElementWithMixedContent"/>
+	<xsd:complexType name="tBaseElementWithMixedContent" abstract="true" mixed="true">
+		<xsd:sequence>
+			<xsd:element ref="documentation" minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:element ref="extensionElements" minOccurs="0" maxOccurs="1" />
+		</xsd:sequence>
+		<xsd:attribute name="id" type="xsd:ID" use="optional"/>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:complexType>
+
+	<xsd:element name="boundaryEvent" type="tBoundaryEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tBoundaryEvent">
+		<xsd:complexContent>
+			<xsd:extension base="tCatchEvent">
+				<xsd:attribute name="cancelActivity" type="xsd:boolean" default="true"/>
+				<xsd:attribute name="attachedToRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="businessRuleTask" type="tBusinessRuleTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tBusinessRuleTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask">
+				<xsd:attribute name="implementation" type="tImplementation" default="##unspecified"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="callableElement" type="tCallableElement"/>
+	<xsd:complexType name="tCallableElement">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element name="supportedInterfaceRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="ioSpecification" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="ioBinding" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="callActivity" type="tCallActivity" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tCallActivity">
+		<xsd:complexContent>
+			<xsd:extension base="tActivity">
+				<xsd:attribute name="calledElement" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="callChoreography" type="tCallChoreography" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tCallChoreography">
+		<xsd:complexContent>
+			<xsd:extension base="tChoreographyActivity">
+				<xsd:sequence>
+					<xsd:element ref="participantAssociation" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="calledChoreographyRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="callConversation" type="tCallConversation" substitutionGroup="conversationNode"/>
+	<xsd:complexType name="tCallConversation">
+		<xsd:complexContent>
+			<xsd:extension base="tConversationNode">
+				<xsd:sequence>
+					<xsd:element ref="participantAssociation" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="calledCollaborationRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="cancelEventDefinition" type="tCancelEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tCancelEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="catchEvent" type="tCatchEvent"/>
+	<xsd:complexType name="tCatchEvent" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tEvent">
+				<xsd:sequence>
+					<xsd:element ref="dataOutput" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="dataOutputAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="outputSet" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="eventDefinition" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="eventDefinitionRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="parallelMultiple" type="xsd:boolean" default="false"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="category" type="tCategory" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tCategory">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element ref="categoryValue" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="categoryValue" type="tCategoryValue"/>
+	<xsd:complexType name="tCategoryValue">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="value" type="xsd:string" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="choreography" type="tChoreography" substitutionGroup="collaboration"/>
+	<xsd:complexType name="tChoreography">
+		<xsd:complexContent>
+			<xsd:extension base="tCollaboration">
+				<xsd:sequence>
+					<xsd:element ref="flowElement" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="choreographyActivity" type="tChoreographyActivity"/>
+	<xsd:complexType name="tChoreographyActivity" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowNode">
+				<xsd:sequence>
+					<xsd:element name="participantRef" type="xsd:QName" minOccurs="2" maxOccurs="unbounded"/>
+					<xsd:element ref="correlationKey" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="initiatingParticipantRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="loopType" type="tChoreographyLoopType" default="None"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:simpleType name="tChoreographyLoopType">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="None"/>
+			<xsd:enumeration value="Standard"/>
+			<xsd:enumeration value="MultiInstanceSequential"/>
+			<xsd:enumeration value="MultiInstanceParallel"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+	<xsd:element name="choreographyTask" type="tChoreographyTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tChoreographyTask">
+		<xsd:complexContent>
+			<xsd:extension base="tChoreographyActivity">
+				<xsd:sequence>
+					<xsd:element name="messageFlowRef" type="xsd:QName" minOccurs="1" maxOccurs="2"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="collaboration" type="tCollaboration" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tCollaboration">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element ref="participant" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="messageFlow" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="conversationNode" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="conversationAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="participantAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="messageFlowAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="correlationKey" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="choreographyRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="conversationLink" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="isClosed" type="xsd:boolean" default="false"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="compensateEventDefinition" type="tCompensateEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tCompensateEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:attribute name="waitForCompletion" type="xsd:boolean"/>
+				<xsd:attribute name="activityRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="complexBehaviorDefinition" type="tComplexBehaviorDefinition"/>
+	<xsd:complexType name="tComplexBehaviorDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="condition" type="tFormalExpression" minOccurs="1" maxOccurs="1"/>
+					<xsd:element name="event" type="tImplicitThrowEvent" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="complexGateway" type="tComplexGateway" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tComplexGateway">
+		<xsd:complexContent>
+			<xsd:extension base="tGateway">
+				<xsd:sequence>
+					<xsd:element name="activationCondition" type="tExpression" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="default" type="xsd:IDREF"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="conditionalEventDefinition" type="tConditionalEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tConditionalEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:sequence>
+					<xsd:element name="condition" type="tExpression"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="conversation" type="tConversation" substitutionGroup="conversationNode"/>
+	<xsd:complexType name="tConversation">
+		<xsd:complexContent>
+			<xsd:extension base="tConversationNode"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="conversationAssociation" type="tConversationAssociation"/>
+	<xsd:complexType name="tConversationAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="innerConversationNodeRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="outerConversationNodeRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="conversationLink" type="tConversationLink"/>
+	<xsd:complexType name="tConversationLink">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="name" type="xsd:string" use="optional"/>
+				<xsd:attribute name="sourceRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="targetRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="conversationNode" type="tConversationNode"/>
+	<xsd:complexType name="tConversationNode" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="participantRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="messageFlowRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="correlationKey" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="correlationKey" type="tCorrelationKey"/>
+	<xsd:complexType name="tCorrelationKey">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="correlationPropertyRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="correlationProperty" type="tCorrelationProperty" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tCorrelationProperty">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element ref="correlationPropertyRetrievalExpression" minOccurs="1" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="optional"/>
+				<xsd:attribute name="type" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="correlationPropertyBinding" type="tCorrelationPropertyBinding"/>
+	<xsd:complexType name="tCorrelationPropertyBinding">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="dataPath" type="tFormalExpression" minOccurs="1" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="correlationPropertyRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="correlationPropertyRetrievalExpression" type="tCorrelationPropertyRetrievalExpression"/>
+	<xsd:complexType name="tCorrelationPropertyRetrievalExpression">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="messagePath" type="tFormalExpression" minOccurs="1" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="messageRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="correlationSubscription" type="tCorrelationSubscription"/>
+	<xsd:complexType name="tCorrelationSubscription">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="correlationPropertyBinding" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="correlationKeyRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataAssociation" type="tDataAssociation" />
+	<xsd:complexType name="tDataAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="sourceRef" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="targetRef" type="xsd:IDREF" minOccurs="1" maxOccurs="1"/>
+					<xsd:element name="transformation" type="tFormalExpression" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="assignment" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataInput" type="tDataInput" />
+	<xsd:complexType name="tDataInput">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="optional"/>
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName" />
+				<xsd:attribute name="isCollection" type="xsd:boolean" default="false"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataInputAssociation" type="tDataInputAssociation" />
+	<xsd:complexType name="tDataInputAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tDataAssociation"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataObject" type="tDataObject" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tDataObject">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName"/>
+				<xsd:attribute name="isCollection" type="xsd:boolean" default="false"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataObjectReference" type="tDataObjectReference" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tDataObjectReference">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName"/>
+				<xsd:attribute name="dataObjectRef" type="xsd:IDREF"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataOutput" type="tDataOutput" />
+	<xsd:complexType name="tDataOutput">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="optional" />
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName"/>
+				<xsd:attribute name="isCollection" type="xsd:boolean" default="false"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataOutputAssociation" type="tDataOutputAssociation" />
+	<xsd:complexType name="tDataOutputAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tDataAssociation"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataState" type="tDataState" />
+	<xsd:complexType name="tDataState">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataStore" type="tDataStore" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tDataStore">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="capacity" type="xsd:integer"/>
+				<xsd:attribute name="isUnlimited" type="xsd:boolean" default="true"/>
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataStoreReference" type="tDataStoreReference" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tDataStoreReference">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName"/>
+				<xsd:attribute name="dataStoreRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="documentation" type="tDocumentation"/>
+	<xsd:complexType name="tDocumentation" mixed="true">
+		<xsd:sequence>
+			<xsd:any namespace="##any" processContents="lax" minOccurs="0"/>
+		</xsd:sequence>
+		<xsd:attribute name="id" type="xsd:ID" use="optional"/>
+		<xsd:attribute name="textFormat" type="xsd:string" default="text/plain"/>
+	</xsd:complexType>
+
+	<xsd:element name="endEvent" type="tEndEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tEndEvent">
+		<xsd:complexContent>
+			<xsd:extension base="tThrowEvent"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="endPoint" type="tEndPoint" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tEndPoint">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="error" type="tError" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tError">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="errorCode" type="xsd:string"/>
+				<xsd:attribute name="structureRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="errorEventDefinition" type="tErrorEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tErrorEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:attribute name="errorRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="escalation" type="tEscalation" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tEscalation">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="escalationCode" type="xsd:string"/>
+				<xsd:attribute name="structureRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="escalationEventDefinition" type="tEscalationEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tEscalationEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:attribute name="escalationRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="event" type="tEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tEvent" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowNode">
+				<xsd:sequence>
+					<xsd:element ref="property" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="eventBasedGateway" type="tEventBasedGateway" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tEventBasedGateway">
+		<xsd:complexContent>
+			<xsd:extension base="tGateway">
+				<xsd:attribute name="instantiate" type="xsd:boolean" default="false"/>
+				<xsd:attribute name="eventGatewayType" type="tEventBasedGatewayType" default="Exclusive"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:simpleType name="tEventBasedGatewayType">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="Exclusive"/>
+			<xsd:enumeration value="Parallel"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+	<xsd:element name="eventDefinition" type="tEventDefinition" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tEventDefinition" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="exclusiveGateway" type="tExclusiveGateway" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tExclusiveGateway">
+		<xsd:complexContent>
+			<xsd:extension base="tGateway">
+				<xsd:attribute name="default" type="xsd:IDREF" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="expression" type="tExpression"/>
+	<xsd:complexType name="tExpression">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElementWithMixedContent"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="extension" type="tExtension"/>
+	<xsd:complexType name="tExtension">
+		<xsd:sequence>
+			<xsd:element ref="documentation" minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:sequence>
+		<xsd:attribute name="definition" type="xsd:QName"/>
+		<xsd:attribute name="mustUnderstand" type="xsd:boolean" use="optional" default="false"/>
+	</xsd:complexType>
+
+	<xsd:element name="extensionElements" type="tExtensionElements" />
+	<xsd:complexType name="tExtensionElements">
+		<xsd:sequence>
+			<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+	</xsd:complexType>
+
+	<xsd:element name="flowElement" type="tFlowElement"/>
+	<xsd:complexType name="tFlowElement" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="auditing" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="monitoring" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="categoryValueRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="flowNode" type="tFlowNode"/>
+	<xsd:complexType name="tFlowNode" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowElement">
+				<xsd:sequence>
+					<xsd:element name="incoming" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="outgoing" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="formalExpression" type="tFormalExpression" substitutionGroup="expression"/>
+	<xsd:complexType name="tFormalExpression">
+		<xsd:complexContent>
+			<xsd:extension base="tExpression">
+				<xsd:attribute name="language" type="xsd:anyURI" use="optional"/>
+				<xsd:attribute name="evaluatesToTypeRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="gateway" type="tGateway" abstract="true"/>
+	<xsd:complexType name="tGateway">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowNode">
+				<xsd:attribute name="gatewayDirection" type="tGatewayDirection" default="Unspecified"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:simpleType name="tGatewayDirection">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="Unspecified"/>
+			<xsd:enumeration value="Converging"/>
+			<xsd:enumeration value="Diverging"/>
+			<xsd:enumeration value="Mixed"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+	<xsd:element name="globalBusinessRuleTask" type="tGlobalBusinessRuleTask" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tGlobalBusinessRuleTask">
+		<xsd:complexContent>
+			<xsd:extension base="tGlobalTask">
+				<xsd:attribute name="implementation" type="tImplementation" default="##unspecified"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="globalChoreographyTask" type="tGlobalChoreographyTask" substitutionGroup="choreography"/>
+	<xsd:complexType name="tGlobalChoreographyTask">
+		<xsd:complexContent>
+			<xsd:extension base="tChoreography">
+				<xsd:attribute name="initiatingParticipantRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	<xsd:element name="globalConversation" type="tGlobalConversation" substitutionGroup="collaboration"/>
+	<xsd:complexType name="tGlobalConversation">
+		<xsd:complexContent>
+			<xsd:extension base="tCollaboration"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="globalManualTask" type="tGlobalManualTask" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tGlobalManualTask">
+		<xsd:complexContent>
+			<xsd:extension base="tGlobalTask"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="globalScriptTask" type="tGlobalScriptTask"  substitutionGroup="rootElement"/>
+	<xsd:complexType name="tGlobalScriptTask">
+		<xsd:complexContent>
+			<xsd:extension base="tGlobalTask">
+				<xsd:sequence>
+					<xsd:element ref="script" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="scriptLanguage" type="xsd:anyURI"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="globalTask" type="tGlobalTask" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tGlobalTask">
+		<xsd:complexContent>
+			<xsd:extension base="tCallableElement">
+				<xsd:sequence>
+					<xsd:element ref="resourceRole" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="globalUserTask" type="tGlobalUserTask" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tGlobalUserTask">
+		<xsd:complexContent>
+			<xsd:extension base="tGlobalTask">
+				<xsd:sequence>
+					<xsd:element ref="rendering" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="implementation" type="tImplementation" default="##unspecified"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="group" type="tGroup" substitutionGroup="artifact"/>
+	<xsd:complexType name="tGroup">
+		<xsd:complexContent>
+			<xsd:extension base="tArtifact">
+				<xsd:attribute name="categoryValueRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="humanPerformer" type="tHumanPerformer" substitutionGroup="performer"/>
+	<xsd:complexType name="tHumanPerformer">
+		<xsd:complexContent>
+			<xsd:extension base="tPerformer"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:simpleType name="tImplementation">
+		<xsd:union memberTypes="xsd:anyURI">
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:token">
+					<xsd:enumeration value="##unspecified" />
+					<xsd:enumeration value="##WebService" />
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:union>
+	</xsd:simpleType>
+
+	<xsd:element name="implicitThrowEvent" type="tImplicitThrowEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tImplicitThrowEvent">
+		<xsd:complexContent>
+			<xsd:extension base="tThrowEvent"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="inclusiveGateway" type="tInclusiveGateway" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tInclusiveGateway">
+		<xsd:complexContent>
+			<xsd:extension base="tGateway">
+				<xsd:attribute name="default" type="xsd:IDREF" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="inputSet" type="tInputSet" />
+	<xsd:complexType name="tInputSet">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="dataInputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="optionalInputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="whileExecutingInputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="outputSetRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" />
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="interface" type="tInterface" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tInterface">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element ref="operation" minOccurs="1" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="required"/>
+				<xsd:attribute name="implementationRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="intermediateCatchEvent" type="tIntermediateCatchEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tIntermediateCatchEvent">
+		<xsd:complexContent>
+			<xsd:extension base="tCatchEvent"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="intermediateThrowEvent" type="tIntermediateThrowEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tIntermediateThrowEvent">
+		<xsd:complexContent>
+			<xsd:extension base="tThrowEvent"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="ioBinding" type="tInputOutputBinding" />
+	<xsd:complexType name="tInputOutputBinding">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="operationRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="inputDataRef" type="xsd:IDREF" use="required"/>
+				<xsd:attribute name="outputDataRef" type="xsd:IDREF" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="ioSpecification" type="tInputOutputSpecification" />
+	<xsd:complexType name="tInputOutputSpecification">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="dataInput" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="dataOutput" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="inputSet" minOccurs="1" maxOccurs="unbounded"/>
+					<xsd:element ref="outputSet" minOccurs="1" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="itemDefinition" type="tItemDefinition" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tItemDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:attribute name="structureRef" type="xsd:QName"/>
+				<xsd:attribute name="isCollection" type="xsd:boolean" default="false"/>
+				<xsd:attribute name="itemKind" type="tItemKind" default="Information"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:simpleType name="tItemKind">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="Information"/>
+			<xsd:enumeration value="Physical"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+	<xsd:element name="lane" type="tLane"/>
+	<xsd:complexType name="tLane">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="partitionElement" type="tBaseElement" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="flowNodeRef" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="childLaneSet" type="tLaneSet" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="partitionElementRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="laneSet" type="tLaneSet"/>
+	<xsd:complexType name="tLaneSet">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="lane" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="linkEventDefinition" type="tLinkEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tLinkEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:sequence>
+					<xsd:element name="source" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="target" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="loopCharacteristics" type="tLoopCharacteristics"/>
+	<xsd:complexType name="tLoopCharacteristics" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="manualTask" type="tManualTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tManualTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="message" type="tMessage" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tMessage">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="itemRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="messageEventDefinition" type="tMessageEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tMessageEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:sequence>
+					<xsd:element name="operationRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="messageRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="messageFlow" type="tMessageFlow"/>
+	<xsd:complexType name="tMessageFlow">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="name" type="xsd:string" use="optional"/>
+				<xsd:attribute name="sourceRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="targetRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="messageRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="messageFlowAssociation" type="tMessageFlowAssociation"/>
+	<xsd:complexType name="tMessageFlowAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="innerMessageFlowRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="outerMessageFlowRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="monitoring" type="tMonitoring"/>
+	<xsd:complexType name="tMonitoring">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="multiInstanceLoopCharacteristics" type="tMultiInstanceLoopCharacteristics"  substitutionGroup="loopCharacteristics"/>
+	<xsd:complexType name="tMultiInstanceLoopCharacteristics">
+		<xsd:complexContent>
+			<xsd:extension base="tLoopCharacteristics">
+				<xsd:sequence>
+					<xsd:element name="loopCardinality" type="tExpression" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="loopDataInputRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="loopDataOutputRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="inputDataItem" type="tDataInput" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="outputDataItem" type="tDataOutput" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="complexBehaviorDefinition" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="completionCondition" type="tExpression" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="isSequential" type="xsd:boolean" default="false"/>
+				<xsd:attribute name="behavior" type="tMultiInstanceFlowCondition" default="All"/>
+				<xsd:attribute name="oneBehaviorEventRef" type="xsd:QName" use="optional"/>
+				<xsd:attribute name="noneBehaviorEventRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:simpleType name="tMultiInstanceFlowCondition">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="None"/>
+			<xsd:enumeration value="One"/>
+			<xsd:enumeration value="All"/>
+			<xsd:enumeration value="Complex"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+	<xsd:element name="operation" type="tOperation"/>
+	<xsd:complexType name="tOperation">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="inMessageRef" type="xsd:QName" minOccurs="1" maxOccurs="1"/>
+					<xsd:element name="outMessageRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="errorRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="required"/>
+				<xsd:attribute name="implementationRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="outputSet" type="tOutputSet" />
+	<xsd:complexType name="tOutputSet">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="dataOutputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="optionalOutputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="whileExecutingOutputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="inputSetRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="parallelGateway" type="tParallelGateway" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tParallelGateway">
+		<xsd:complexContent>
+			<xsd:extension base="tGateway"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="participant" type="tParticipant"/>
+	<xsd:complexType name="tParticipant">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="interfaceRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="endPointRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="participantMultiplicity" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="processRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="participantAssociation" type="tParticipantAssociation"/>
+	<xsd:complexType name="tParticipantAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="innerParticipantRef" type="xsd:QName" minOccurs="1" maxOccurs="1"/>
+					<xsd:element name="outerParticipantRef" type="xsd:QName" minOccurs="1" maxOccurs="1"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="participantMultiplicity" type="tParticipantMultiplicity"/>
+	<xsd:complexType name="tParticipantMultiplicity">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="minimum" type="xsd:int" default="0"/>
+				<xsd:attribute name="maximum" type="xsd:int" default="1"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="partnerEntity" type="tPartnerEntity" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tPartnerEntity">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element name="participantRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="partnerRole" type="tPartnerRole" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tPartnerRole">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element name="participantRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="performer" type="tPerformer" substitutionGroup="resourceRole"/>
+	<xsd:complexType name="tPerformer">
+		<xsd:complexContent>
+			<xsd:extension base="tResourceRole"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="potentialOwner" type="tPotentialOwner" substitutionGroup="performer"/>
+	<xsd:complexType name="tPotentialOwner">
+		<xsd:complexContent>
+			<xsd:extension base="tHumanPerformer"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="process" type="tProcess" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tProcess">
+		<xsd:complexContent>
+			<xsd:extension base="tCallableElement">
+				<xsd:sequence>
+					<xsd:element ref="auditing" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="monitoring" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="property" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="laneSet" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="flowElement" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="resourceRole" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="correlationSubscription" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="supports" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="processType" type="tProcessType" default="None"/>
+				<xsd:attribute name="isClosed" type="xsd:boolean" default="false"/>
+				<xsd:attribute name="isExecutable" type="xsd:boolean"/>
+				<xsd:attribute name="definitionalCollaborationRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:simpleType name="tProcessType">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="None"/>
+			<xsd:enumeration value="Public"/>
+			<xsd:enumeration value="Private"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+	<xsd:element name="property" type="tProperty" />
+	<xsd:complexType name="tProperty">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="receiveTask" type="tReceiveTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tReceiveTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask">
+				<xsd:attribute name="implementation" type="tImplementation" default="##WebService"/>
+				<xsd:attribute name="instantiate" type="xsd:boolean" default="false"/>
+				<xsd:attribute name="messageRef" type="xsd:QName" use="optional"/>
+				<xsd:attribute name="operationRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="relationship" type="tRelationship"/>
+	<xsd:complexType name="tRelationship">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="source" type="xsd:QName" minOccurs="1" maxOccurs="unbounded"/>
+					<xsd:element name="target" type="xsd:QName" minOccurs="1" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="type" type="xsd:string" use="required"/>
+				<xsd:attribute name="direction" type="tRelationshipDirection"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:simpleType name="tRelationshipDirection">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="None"/>
+			<xsd:enumeration value="Forward"/>
+			<xsd:enumeration value="Backward"/>
+			<xsd:enumeration value="Both"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+	<xsd:element name="rendering" type="tRendering"/>
+	<xsd:complexType name="tRendering">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="resource" type="tResource" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tResource">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element ref="resourceParameter" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="resourceAssignmentExpression" type="tResourceAssignmentExpression"/>
+	<xsd:complexType name="tResourceAssignmentExpression">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="expression" minOccurs="1" maxOccurs="1"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="resourceParameter" type="tResourceParameter"/>
+	<xsd:complexType name="tResourceParameter">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="type" type="xsd:QName"/>
+				<xsd:attribute name="isRequired" type="xsd:boolean"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="resourceParameterBinding" type="tResourceParameterBinding"/>
+	<xsd:complexType name="tResourceParameterBinding">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="expression" minOccurs="1" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="parameterRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="resourceRole" type="tResourceRole"/>
+	<xsd:complexType name="tResourceRole">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:choice>
+					<xsd:sequence>
+						<xsd:element name="resourceRef" type="xsd:QName"/>
+						<xsd:element ref="resourceParameterBinding" minOccurs="0" maxOccurs="unbounded"/>
+					</xsd:sequence>
+					<xsd:element ref="resourceAssignmentExpression" minOccurs="0" maxOccurs="1"/>
+				</xsd:choice>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="rootElement" type="tRootElement"/>
+	<xsd:complexType name="tRootElement" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="scriptTask" type="tScriptTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tScriptTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask">
+				<xsd:sequence>
+					<xsd:element ref="script" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="scriptFormat" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="script" type="tScript"/>
+	<xsd:complexType name="tScript" mixed="true">
+		<xsd:sequence>
+			<xsd:any namespace="##any" processContents="lax" minOccurs="0"/>
+		</xsd:sequence>
+	</xsd:complexType>
+
+	<xsd:element name="sendTask" type="tSendTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tSendTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask">
+				<xsd:attribute name="implementation" type="tImplementation" default="##WebService"/>
+				<xsd:attribute name="messageRef" type="xsd:QName" use="optional"/>
+				<xsd:attribute name="operationRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="sequenceFlow" type="tSequenceFlow" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tSequenceFlow">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowElement">
+				<xsd:sequence>
+					<xsd:element name="conditionExpression"  type="tExpression" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="sourceRef" type="xsd:IDREF" use="required"/>
+				<xsd:attribute name="targetRef" type="xsd:IDREF" use="required"/>
+				<xsd:attribute name="isImmediate" type="xsd:boolean" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="serviceTask" type="tServiceTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tServiceTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask">
+				<xsd:attribute name="implementation" type="tImplementation" default="##WebService"/>
+				<xsd:attribute name="operationRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="signal" type="tSignal" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tSignal">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="structureRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="signalEventDefinition" type="tSignalEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tSignalEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:attribute name="signalRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="standardLoopCharacteristics" type="tStandardLoopCharacteristics"  substitutionGroup="loopCharacteristics"/>
+	<xsd:complexType name="tStandardLoopCharacteristics">
+		<xsd:complexContent>
+			<xsd:extension base="tLoopCharacteristics">
+				<xsd:sequence>
+					<xsd:element name="loopCondition" type="tExpression" minOccurs="0"/>
+				</xsd:sequence>
+				<xsd:attribute name="testBefore" type="xsd:boolean" default="false"/>
+				<xsd:attribute name="loopMaximum" type="xsd:integer" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="startEvent" type="tStartEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tStartEvent">
+		<xsd:complexContent>
+			<xsd:extension base="tCatchEvent">
+				<xsd:attribute name="isInterrupting" type="xsd:boolean" default="true"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="subChoreography" type="tSubChoreography" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tSubChoreography">
+		<xsd:complexContent>
+			<xsd:extension base="tChoreographyActivity">
+				<xsd:sequence>
+					<xsd:element ref="flowElement" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="subConversation" type="tSubConversation" substitutionGroup="conversationNode"/>
+	<xsd:complexType name="tSubConversation">
+		<xsd:complexContent>
+			<xsd:extension base="tConversationNode">
+				<xsd:sequence>
+					<xsd:element ref="conversationNode" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="subProcess" type="tSubProcess" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tSubProcess">
+		<xsd:complexContent>
+			<xsd:extension base="tActivity">
+				<xsd:sequence>
+					<xsd:element ref="laneSet" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="flowElement" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="triggeredByEvent" type="xsd:boolean" default="false"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="task" type="tTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tTask">
+		<xsd:complexContent>
+			<xsd:extension base="tActivity"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="terminateEventDefinition" type="tTerminateEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tTerminateEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="textAnnotation" type="tTextAnnotation" substitutionGroup="artifact"/>
+	<xsd:complexType name="tTextAnnotation">
+		<xsd:complexContent>
+			<xsd:extension base="tArtifact">
+				<xsd:sequence>
+					<xsd:element ref="text" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="textFormat" type="xsd:string" default="text/plain"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="text" type="tText"/>
+	<xsd:complexType name="tText" mixed="true">
+		<xsd:sequence>
+			<xsd:any namespace="##any" processContents="lax" minOccurs="0"/>
+		</xsd:sequence>
+	</xsd:complexType>
+
+	<xsd:element name="throwEvent" type="tThrowEvent"/>
+	<xsd:complexType name="tThrowEvent" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tEvent">
+				<xsd:sequence>
+					<xsd:element ref="dataInput" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="dataInputAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="inputSet" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="eventDefinition" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="eventDefinitionRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="timerEventDefinition" type="tTimerEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tTimerEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:choice>
+					<xsd:element name="timeDate" type="tExpression" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="timeDuration" type="tExpression" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="timeCycle" type="tExpression" minOccurs="0" maxOccurs="1"/>
+				</xsd:choice>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="transaction" type="tTransaction" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tTransaction">
+		<xsd:complexContent>
+			<xsd:extension base="tSubProcess">
+				<xsd:attribute name="method" type="tTransactionMethod" default="##Compensate"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:simpleType name="tTransactionMethod">
+		<xsd:union memberTypes="xsd:anyURI">
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:token">
+					<xsd:enumeration value="##Compensate" />
+					<xsd:enumeration value="##Image" />
+					<xsd:enumeration value="##Store" />
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:union>
+	</xsd:simpleType>
+
+	<xsd:element name="userTask" type="tUserTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tUserTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask">
+				<xsd:sequence>
+					<xsd:element ref="rendering" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="implementation" type="tImplementation" default="##unspecified"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/index/XMLSchema.xsd b/xml/tests/testData/index/XMLSchema.xsd
new file mode 100644
index 0000000..07e8e42
--- /dev/null
+++ b/xml/tests/testData/index/XMLSchema.xsd
@@ -0,0 +1,2468 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<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/xml/tests/testData/index/base.xsd b/xml/tests/testData/index/base.xsd
new file mode 100644
index 0000000..0304bf0
--- /dev/null
+++ b/xml/tests/testData/index/base.xsd
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
+	xmlns="http://a.b.c"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://a.b.c">
+  <xsd:element name="someElement" type="baseComplexType"/>
+  <xsd:complexType name="baseComplexType" abstract="true">
+    <xsd:complexContent>
+      <xsd:extension base="xsd:simpleType">
+      <xsd:sequence>
+        <xsd:element name="el1" type="xsd:string"/>
+        <xsd:element name="el2" type="xsd:string"/>
+      </xsd:sequence>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  <xsd:simpleType name="baseSimpleType">
+    <xsd:restriction base="xsd:anyURI"></xsd:restriction>
+  </xsd:simpleType>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/index/ext1.xsd b/xml/tests/testData/index/ext1.xsd
new file mode 100644
index 0000000..744f9f6
--- /dev/null
+++ b/xml/tests/testData/index/ext1.xsd
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
+	xmlns="http://a.b.c"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://a.b.c">
+  <xsd:include schemaLocation="base.xsd"/>
+  <xsd:simpleType name="extSimple1">
+    <xsd:restriction base="baseSimpleType"/>
+  </xsd:simpleType>
+  <xsd:simpleType name="extSimple2">
+    <xsd:restriction base="extSimple1"/>
+  </xsd:simpleType>
+  <xsd:complexType name="extComplex1">
+    <xsd:complexContent>
+      <xsd:extension base="baseComplexType"/>
+    </xsd:complexContent>
+  </xsd:complexType>
+  <xsd:complexType name="extComplex2">
+    <xsd:complexContent>
+      <xsd:extension base="baseSimpleType"/>
+    </xsd:complexContent>
+  </xsd:complexType>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/index/ext2.xsd b/xml/tests/testData/index/ext2.xsd
new file mode 100644
index 0000000..b2cb285
--- /dev/null
+++ b/xml/tests/testData/index/ext2.xsd
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
+	xmlns="http://a.b.c"
+        xmlns:more="http://a.b.c.d"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://a.b.c">
+  <xsd:include schemaLocation="base.xsd"/>
+  <xsd:simpleType name="extSimple4">
+    <xsd:restriction base="baseSimpleType"/>
+  </xsd:simpleType>
+  <xsd:simpleType name="extSimple5">
+    <xsd:restriction base="extSimple4"/>
+  </xsd:simpleType>
+  <xsd:complexType name="more:extComplex1">
+    <xsd:complexContent>
+      <xsd:extension base="baseComplexType"/>
+    </xsd:complexContent>
+  </xsd:complexType>
+  <xsd:complexType name="more:extComplex2">
+    <xsd:complexContent>
+      <xsd:extension base="baseSimpleType"/>
+    </xsd:complexContent>
+  </xsd:complexType>
+  <xsd:element name="wiseElement">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:extension base="extSimple4"/>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/index/spring-beans-2.0.xsd b/xml/tests/testData/index/spring-beans-2.0.xsd
new file mode 100644
index 0000000..6825d93
--- /dev/null
+++ b/xml/tests/testData/index/spring-beans-2.0.xsd
@@ -0,0 +1,1076 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/beans"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		targetNamespace="http://www.springframework.org/schema/beans">
+
+	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Spring XML Beans Schema, version 2.0
+	Authors: Rob Harrop, Juergen Hoeller
+
+	This defines a simple and consistent way of creating a namespace
+	of JavaBeans objects, managed by a Spring BeanFactory, read by
+	XmlBeanDefinitionReader (with DefaultBeanDefinitionDocumentReader).
+
+	This document type is used by most Spring functionality, including
+	web application contexts, which are based on bean factories.
+
+	Each "bean" element in this document defines a JavaBean.
+	Typically the bean class is specified, along with JavaBean properties
+	and/or constructor arguments.
+
+	A bean instance can be a "singleton" (shared instance) or a "prototype"
+	(independent instance). Further scopes can be provided by extended
+	bean factories, for example in a web environment.
+
+	References among beans are supported, that is, setting a JavaBean property
+	or a constructor argument to refer to another bean in the same factory
+	(or an ancestor factory).
+
+	As alternative to bean references, "inner bean definitions" can be used.
+	Singleton flags of such inner bean definitions are effectively ignored:
+	inner beans are typically anonymous prototypes.
+
+	There is also support for lists, sets, maps, and java.util.Properties
+	as bean property types or constructor argument types.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<!-- base types -->
+	<xsd:complexType name="identifiedType" abstract="true">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The unique identifier for a bean. The scope of the identifier
+	is the enclosing bean factory.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:attribute name="id" type="xsd:ID">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The unique identifier for a bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Top-level <beans> tag -->
+	<xsd:element name="beans">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The top level (typically root) element. Allows the definition
+	of default values for all nested bean definitions.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="import"/>
+					<xsd:element ref="alias"/>
+					<xsd:element ref="bean"/>
+					<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="default-lazy-init" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'lazy-init' value; see the documentation for the
+	'lazy-init' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-merge" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'merge' value; see the documentation for the
+	'merge' attribute of the various collection elements. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-dependency-check" default="none">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'dependency-check' value; see the documentation for the
+	'dependency-check' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="none"/>
+						<xsd:enumeration value="simple"/>
+						<xsd:enumeration value="objects"/>
+						<xsd:enumeration value="all"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-autowire" default="no">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'autowire' value; see the documentation for the
+	'autowire' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="no"/>
+						<xsd:enumeration value="byName"/>
+						<xsd:enumeration value="byType"/>
+						<xsd:enumeration value="constructor"/>
+						<xsd:enumeration value="autodetect"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-init-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'init-method' value; see the documentation for the
+	'init-method' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-destroy-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'destroy-method' value; see the documentation for the
+	'destroy-method' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="description">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains informative text describing the purpose of the enclosing
+	element.
+	Used primarily for user documentation of XML bean definition documents.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="import">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.core.io.Resource"><![CDATA[
+	Specifies an XML bean definition resource to import.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="resource" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The relative resource location of the XML (bean definition) file to import,
+	for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml".
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="alias">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines an alias for a bean (which can reside in a different definition
+	resource).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean to define an alias for.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="alias" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The alias name to define for the bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:group name="beanElements">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="constructor-arg"/>
+				<xsd:element ref="property"/>
+				<xsd:element ref="lookup-method"/>
+				<xsd:element ref="replaced-method"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:attributeGroup name="beanAttributes">
+		<xsd:attribute name="name" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Can be used to create one or more aliases illegal in an (XML) id.
+	Multiple aliases can be separated by any number of spaces, commas,
+	or semi-colons (or indeed any mixture of the three).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="class" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The fully qualified name of the bean's class, except if it pure serves as parent for child bean definitions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="parent" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the parent bean definition.
+
+	Will use the bean class of the parent if none is specified, but can
+	also override it. In the latter case, the child bean class must be
+	compatible with the parent, i.e. accept the parent's property values
+	and constructor argument values, if any.
+
+	A child bean definition will inherit constructor argument values,
+	property values and method overrides from the parent, with the option
+	to add new values. If init method, destroy method, factory bean and/or
+	factory method are specified, they will override the corresponding
+	parent settings.
+
+	The remaining settings will always be taken from the child definition:
+	depends on, autowire mode, dependency check, scope, lazy init.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="scope" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The scope of this bean: typically "singleton" (one shared instance,
+	which will be returned by all calls to getBean with the given id), or
+	"prototype" (independent instance resulting from each call to getBean).
+	Default is "singleton".
+
+	Singletons are most commonly used, and are ideal for multi-threaded
+	service objects. Further scopes, such as "request" or "session", might
+	be supported by extended bean factories (e.g. in a web environment).
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+
+	Inner bean definitions inherit the singleton status of their containing
+	bean definition, unless explicitly specified: The inner bean will be a
+	singleton if the containing bean is a singleton, and a prototype if
+	the containing bean has any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="abstract" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Is this bean "abstract", that is, not meant to be instantiated itself
+	but rather just serving as parent for concrete child bean definitions?
+	The default is "false". Specify "true" to tell the bean factory to not
+	try to instantiate that particular bean in any case.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per abstract bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="lazy-init" default="default" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean is to be lazily initialized.
+	If false, it will be instantiated on startup by bean factories
+	that perform eager initialization of singletons. The default is
+	"false".
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether bean properties are "autowired".
+	This is an automagical process in which bean references don't need
+	to be coded explicitly in the XML bean definition file, but rather the
+	Spring container works out dependencies.
+
+	There are 5 modes:
+
+	1. "no"
+	The traditional Spring default. No automagical wiring. Bean references
+	must be defined in the XML file via the <ref/> element (or "ref"
+	attribute). We recommend this in most cases as it makes documentation
+	more explicit.
+
+	2. "byName"
+	Autowiring by property name. If a bean of class Cat exposes a dog
+	property, Spring will try to set this to the value of the bean "dog"
+	in the current container. If there is no matching bean by name, nothing
+	special happens; use dependency-check="objects" to raise an error in
+	that case.
+
+	3. "byType"
+	Autowiring if there is exactly one bean of the property type in the
+	container. If there is more than one, a fatal error is raised, and
+	you cannot use byType autowiring for that bean. If there is none,
+	nothing special happens; use dependency-check="objects" to raise an
+	error in that case.
+
+	4. "constructor"
+	Analogous to "byType" for constructor arguments. If there is not exactly
+	one bean of the constructor argument type in the bean factory, a fatal
+	error is raised.
+
+	5. "autodetect"
+	Chooses "constructor" or "byType" through introspection of the bean
+	class. If a default constructor is found, "byType" gets applied.
+
+	Note that explicit dependencies, i.e. "property" and "constructor-arg"
+	elements, always override autowiring. Autowire behavior can be combined
+	with dependency checking, which will be performed after all autowiring
+	has been completed.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="no"/>
+					<xsd:enumeration value="byName"/>
+					<xsd:enumeration value="byType"/>
+					<xsd:enumeration value="constructor"/>
+					<xsd:enumeration value="autodetect"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="dependency-check" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether or not to check whether all of this
+	beans dependencies, expressed in its properties, are satisfied.
+	The default is to perform no dependency checking.
+
+	"simple" type dependency checking includes primitives and String
+	"object" includes collaborators (other beans in the factory)
+	"all" includes both types of dependency checking
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="none"/>
+					<xsd:enumeration value="simple"/>
+					<xsd:enumeration value="objects"/>
+					<xsd:enumeration value="all"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="depends-on" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The names of the beans that this bean depends on being initialized.
+	The bean factory will guarantee that these beans get initialized
+	before this bean.
+
+	Note that dependencies are normally expressed through bean properties
+	or constructor arguments. This property should just be necessary for
+	other kinds of dependencies like statics (*ugh*) or database preparation
+	on startup.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="init-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom initialization method to invoke after setting
+	bean properties. The method must have no arguments, but may throw any
+	exception.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="destroy-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom destroy method to invoke on bean factory
+	shutdown. The method must have no arguments, but may throw any
+	exception.
+
+	Note: Only invoked on beans whose lifecycle is under the full
+	control of the factory - which is always the case for singletons,
+	but not guaranteed for any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of a factory method to use to create this object. Use
+	constructor-arg elements to specify arguments to the factory method,
+	if it takes arguments. Autowiring does not apply to factory methods.
+
+	If the "class" attribute is present, the factory method will be a static
+	method on the class specified by the "class" attribute on this bean
+	definition. Often this will be the same class as that of the constructed
+	object - for example, when the factory method is used as an alternative
+	to a constructor. However, it may be on a different class. In that case,
+	the created object will *not* be of the class specified in the "class"
+	attribute. This is analogous to FactoryBean behavior.
+
+	If the "factory-bean" attribute is present, the "class" attribute is not
+	used, and the factory method will be an instance method on the object
+	returned from a getBean call with the specified bean name. The factory
+	bean may be defined as a singleton or a prototype.
+
+	The factory method can have any number of arguments. Autowiring is not
+	supported. Use indexed constructor-arg elements in conjunction with the
+	factory-method attribute.
+
+	Setter Injection can be used in conjunction with a factory method.
+	Method Injection cannot, as the factory method returns an instance,
+	which will be used when the container creates the bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-bean" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Alternative to class attribute for factory-method usage.
+	If this is specified, no class attribute should be used.
+	This must be set to the name of a bean in the current or
+	ancestor factories that contains the relevant factory method.
+	This allows the factory itself to be configured using Dependency
+	Injection, and an instance (rather than static) method to be used.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire-candidate" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean should be considered when looking
+	for candidates to satisfy another bean's autowiring requirements.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:attributeGroup>
+
+	<xsd:element name="meta" type="metaType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Arbitrary metadata attached to a bean definition.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:complexType name="metaType">
+		<xsd:attribute name="key" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The key name of the metadata parameter being defined.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The value of the metadata parameter being defined (as a simple String).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<xsd:element name="bean">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.BeanDefinition"><![CDATA[
+	Defines a single (usually named) bean.
+
+	A bean definition may contain nested tags for constructor arguments,
+	property values, lookup methods, and replaced methods. Mixing constructor
+	injection and setter injection on the same bean is explicitly supported.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="identifiedType">
+					<xsd:group ref="beanElements"/>
+					<xsd:attributeGroup ref="beanAttributes"/>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="constructor-arg">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.ConstructorArgumentValues">
+				<![CDATA[
+	Bean definitions can specify zero or more constructor arguments.
+	This is an alternative to "autowire constructor".
+	Arguments correspond to either a specific index of the constructor
+	argument list or are supposed to be matched generically by type.
+
+	Note: A single generic argument value will just be used once, rather
+	than potentially matched multiple times (as of Spring 1.1).
+
+	constructor-arg elements are also used in conjunction with the
+	factory-method element to construct beans using static or instance
+	factory methods.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="1">
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+					<xsd:any namespace="##other" processContents="strict"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="index" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact index of thr argument in the constructor argument list.
+	Only needed to avoid ambiguities, e.g. in case of 2 arguments of
+	the exact same type.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type of the constructor argument. Only needed to avoid
+	ambiguities, e.g. in case of 2 single argument constructors
+	that can both be converted from a String.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="ref" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>" element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="value" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...<value/>"
+	element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="property" type="propertyType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Bean definitions can have zero or more properties.
+	Property elements correspond to JavaBean setter methods exposed
+	by the bean classes. Spring supports primitives, references to other
+	beans in the same or related factories, lists, maps and properties.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="lookup-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A lookup method causes the IoC container to override the given method
+	and return the bean with the name given in the bean attribute. This is
+	a form of Method Injection. It is particularly useful as an alternative
+	to implementing the BeanFactoryAware interface, in order to be able to
+	make getBean() calls for non-singleton instances at runtime. In this
+	case, Method Injection is a less invasive alternative.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the lookup method. This method must take no arguments.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean in the current or ancestor factories that
+	the lookup method should resolve to. Often this bean will be a
+	prototype, in which case the lookup method will return a distinct
+	instance on every invocation. This is useful for single-threaded objects.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="replaced-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Similar to the lookup method mechanism, the replaced-method element
+	is used to control IoC container method overriding: Method Injection.
+	This mechanism allows the overriding of a method with arbitrary code.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="arg-type"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="name" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The name of the method whose implementation must be replaced by the
+	IoC container. If this method is not overloaded, there is no need
+	to use arg-type subelements. If this method is overloaded, arg-type
+	subelements must be used for all override definitions for the method.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="replacer" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation source="java:org.springframework.beans.factory.support.MethodReplacer"><![CDATA[
+	Bean name of an implementation of the MethodReplacer interface in the
+	current or ancestor factories. This may be a singleton or prototype
+	bean. If it is a prototype, a new instance will be used for each
+	method replacement. Singleton usage is the norm.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="arg-type">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Identifies an argument for a replaced method in the event of
+	method overloading.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="match" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Specification of the type of an overloaded method argument as a String.
+	For convenience, this may be a substring of the FQN. E.g. all the
+	following would match "java.lang.String":
+	- java.lang.String
+	- String
+	- Str
+
+	As the number of arguments will be checked also, this convenience
+	can often be used to save typing.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="ref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines a reference to another bean in this factory or an external
+	factory (parent or included factory).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID,
+	and thus can be checked by the XML parser, thus should be preferred
+	for references within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="parent" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean *in a parent factory*.
+						]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="idref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The id of another bean in this factory or an external factory
+	(parent or included factory).
+	While a regular 'value' element could instead be used for the
+	same effect, using idref in this case allows validation of local
+	bean ids by the XML parser, and name completion by supporting tools.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID,
+	and thus can be checked by the XML parser, thus should be preferred
+	for references within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="value">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains a string representation of a property value.
+	The property may be a string, or may be converted to the required
+	type using the JavaBeans PropertyEditor machinery. This makes it
+	possible for application developers to write custom PropertyEditor
+	implementations that can convert strings to arbitrary target objects.
+
+	Note that this is recommended for simple objects only. Configure
+	more complex objects by populating JavaBean properties with
+	references to other beans.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type that the value should be converted to. Only needed
+	if the type of the target property or constructor argument is
+	too generic: for example, in case of a collection element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="null">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Denotes a Java null value. Necessary because an empty "value" tag
+	will resolve to an empty String, which will not be resolved to a
+	null value unless a special PropertyEditor does so.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<!-- Collection Elements -->
+	<xsd:group name="collectionElements">
+		<xsd:sequence>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:element name="list" type="listOrSetType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A list can contain multiple inner bean, ref, collection, or value
+	elements. Java lists are untyped, pending generics support in Java5,
+	although references will be strongly typed. A list can also map to
+	an array type. The necessary conversion is automatically performed
+	by the BeanFactory.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="set" type="listOrSetType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A set can contain multiple inner bean, ref, collection, or value
+	elements. Java sets are untyped, pending generics support in Java5,
+	although references will be strongly typed.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="map" type="mapType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A mapping from a key to an object. Maps may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="entry" type="entryType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A map entry can be an inner bean, ref, value, or collection.
+	The key of the entry is given by the "key" attribute or child element.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="props" type="propsType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Props elements differ from map elements in that values must be strings.
+	Props may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="key">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A key element can contain an inner bean, ref, value, or collection.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:group ref="collectionElements"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="prop">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The string value of the property. Note that whitespace is trimmed
+	off to avoid unwanted whitespace caused by typical XML formatting.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="key" type="xsd:string" use="required">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The key of the property entry.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="propertyType">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="1">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict"/>
+			</xsd:choice>
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the property, following JavaBean naming conventions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>"
+	element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Collection Types -->
+
+	<!-- base collection type -->
+	<xsd:complexType name="baseCollectionType">
+		<xsd:attribute name="merge" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- base type for collections that have (possibly) typed nested values -->
+	<xsd:complexType name="typedCollectionType">
+		<xsd:complexContent>
+			<xsd:extension base="baseCollectionType">
+				<xsd:attribute name="value-type" type="xsd:string">
+					<xsd:annotation>
+						<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested values. Must be a fully qualified
+	class name.
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:attribute>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'map' element type -->
+	<xsd:complexType name="mapType">
+		<xsd:complexContent>
+			<xsd:extension base="typedCollectionType">
+				<xsd:sequence>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="entry"/>
+					</xsd:choice>
+				</xsd:sequence>
+				<xsd:attribute name="key-type" type="xsd:string">
+					<xsd:annotation>
+						<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested entry keys. Must be a fully qualified
+	class name. 	
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:attribute>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'entry' element type -->
+	<xsd:complexType name="entryType">
+		<xsd:sequence>
+			<xsd:element ref="key" minOccurs="0"/>
+			<xsd:group ref="collectionElements"/>
+		</xsd:sequence>
+		<xsd:attribute name="key" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Each map element must specify its key as attribute or as child element.
+	A key attribute is always a String value.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="key-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a to a "key" element with a nested
+	"<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>"
+	element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- 'list' and 'set' collection type -->
+	<xsd:complexType name="listOrSetType">
+		<xsd:complexContent>
+			<xsd:extension base="typedCollectionType">
+				<xsd:group ref="collectionElements"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'props' collection type -->
+	<xsd:complexType name="propsType">
+		<xsd:complexContent>
+			<xsd:extension base="baseCollectionType">
+				<xsd:sequence>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="prop"/>
+					</xsd:choice>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- simple internal types -->
+	<xsd:simpleType name="defaultable-boolean">
+		<xsd:restriction base="xsd:NMTOKEN">
+			<xsd:enumeration value="default"/>
+			<xsd:enumeration value="true"/>
+			<xsd:enumeration value="false"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/index/spring-tool-2.0.xsd b/xml/tests/testData/index/spring-tool-2.0.xsd
new file mode 100644
index 0000000..3d278bf
--- /dev/null
+++ b/xml/tests/testData/index/spring-tool-2.0.xsd
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/tool"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		targetNamespace="http://www.springframework.org/schema/tool"
+		elementFormDefault="qualified">
+
+	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Defines the tool support annotations for Spring's configuration namespaces.
+	Used in other namespace XSD files; not intended for direct use in config files.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<xsd:element name="annotation">
+		<xsd:complexType>
+			<xsd:sequence minOccurs="0">
+				<xsd:element name="expected-type" type="typedParameterType" minOccurs="0" maxOccurs="1"/>
+				<xsd:element name="assignable-to" type="typedParameterType" minOccurs="0" maxOccurs="1"/>
+				<xsd:element name="exports" type="exportsType" minOccurs="0" maxOccurs="1"/>
+			</xsd:sequence>
+			<xsd:attribute name="kind" default="direct">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:string">
+						<xsd:enumeration value="ref"/>
+						<xsd:enumeration value="direct"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="typedParameterType">
+		<xsd:attribute name="type" type="xsd:string" use="required"/>
+	</xsd:complexType>
+
+	<xsd:complexType name="exportsType">
+		<xsd:annotation>
+			<xsd:documentation>
+				Indicates that an annotated type exports an application visible component.
+			</xsd:documentation>
+		</xsd:annotation>
+		<xsd:attribute name="type" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation>
+					The type of the exported component. May be null if the type is not known until runtime.
+				</xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="identifier" type="xsd:string" default="@id">
+			<xsd:annotation>
+				<xsd:documentation>
+					Defines an XPath query that can be executed against the node annotated with this
+					type to determine the identifier of any exported component.
+				</xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/index/web-app_2_5.xsd b/xml/tests/testData/index/web-app_2_5.xsd
new file mode 100644
index 0000000..370f0f5
--- /dev/null
+++ b/xml/tests/testData/index/web-app_2_5.xsd
@@ -0,0 +1,1290 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ The contents of this file are subject to the terms
+ of the Common Development and Distribution License
+ (the "License").  You may not use this file except
+ in compliance with the License.
+
+ You can obtain a copy of the license at
+ glassfish/bootstrap/legal/CDDLv1.0.txt or
+ https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ See the License for the specific language governing
+ permissions and limitations under the License.
+
+ When distributing Covered Code, include this CDDL
+ HEADER in each file and include the License file at
+ glassfish/bootstrap/legal/CDDLv1.0.txt.  If applicable,
+ add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your
+ own identifying information: Portions Copyright [yyyy]
+ [name of copyright owner]
+-->
+
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+	    targetNamespace="http://java.jb.com/xml/ns/javaee"
+	    xmlns:javaee="http://java.jb.com/xml/ns/javaee"
+	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	    elementFormDefault="qualified"
+	    attributeFormDefault="unqualified"
+	    version="2.5">
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)web-app_2_5.xsds	1.62 05/08/06
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      Copyright 2003-2005 Sun Microsystems, Inc.
+      4150 Network Circle
+      Santa Clara, California 95054
+      U.S.A
+      All rights reserved.
+
+      Sun Microsystems, Inc. has intellectual property rights
+      relating to technology described in this document. In
+      particular, and without limitation, these intellectual
+      property rights may include one or more of the U.S. patents
+      listed at http://www.sun.com/patents and one or more
+      additional patents or pending patent applications in the
+      U.S. and other countries.
+
+      This document and the technology which it describes are
+      distributed under licenses restricting their use, copying,
+      distribution, and decompilation. No part of this document
+      may be reproduced in any form by any means without prior
+      written authorization of Sun and its licensors, if any.
+
+      Third-party software, including font technology, is
+      copyrighted and licensed from Sun suppliers.
+
+      Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
+      JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+      Cup logo are trademarks or registered trademarks of Sun
+      Microsystems, Inc. in the U.S. and other countries.
+
+      Federal Acquisitions: Commercial Software - Government Users
+      Subject to Standard License Terms and Conditions.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[
+
+	This is the XML Schema for the Servlet 2.5 deployment descriptor.
+	The deployment descriptor must be named "WEB-INF/web.xml" in the
+	web application's war file.  All Servlet deployment descriptors
+	must indicate the web application schema by using the Java EE
+	namespace:
+
+	http://java.sun.com/xml/ns/javaee
+
+	and by indicating the version of the schema by
+	using the version element as shown below:
+
+	    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
+	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	      xsi:schemaLocation="..."
+	      version="2.5">
+	      ...
+	    </web-app>
+
+	The instance documents may indicate the published version of
+	the schema using the xsi:schemaLocation attribute for Java EE
+	namespace with the following location:
+
+	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
+
+	]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all Java EE
+      deployment descriptor elements unless indicated otherwise.
+
+      - In elements that specify a pathname to a file within the
+	same JAR file, relative filenames (i.e., those not
+	starting with "/") are considered relative to the root of
+	the JAR file's namespace.  Absolute filenames (i.e., those
+	starting with "/") also specify names in the root of the
+	JAR file's namespace.  In general, relative names are
+	preferred.  The exception is .war files where absolute
+	names are preferred for consistency with the Servlet API.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="javaee_5.xsd"/>
+  <xsd:include schemaLocation="jsp_2_1.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:element name="web-app" type="javaee:web-appType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The web-app element is the root of the deployment
+	descriptor for a web application.  Note that the sub-elements
+	of this element can be in the arbitrary order. Because of
+	that, the multiplicity of the elements of distributable,
+	session-config, welcome-file-list, jsp-config, login-config,
+	and locale-encoding-mapping-list was changed from "?" to "*"
+	in this schema.  However, the deployment descriptor instance
+	file must not contain multiple elements of session-config,
+	jsp-config, and login-config. When there are multiple elements of
+	welcome-file-list or locale-encoding-mapping-list, the container
+	must concatenate the element contents.  The multiple occurence
+	of the element distributable is redundant and the container
+	treats that case exactly in the same way when there is only
+	one distributable.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:unique name="web-app-servlet-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The servlet element contains the name of a servlet.
+	  The name must be unique within the web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:servlet"/>
+      <xsd:field    xpath="javaee:servlet-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-filter-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The filter element contains the name of a filter.
+	  The name must be unique within the web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:filter"/>
+      <xsd:field    xpath="javaee:filter-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-ejb-local-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The ejb-local-ref-name element contains the name of an EJB
+	  reference. The EJB reference is an entry in the web
+	  application's environment and is relative to the
+	  java:comp/env context.  The name must be unique within
+	  the web application.
+
+	  It is recommended that name is prefixed with "ejb/".
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:ejb-local-ref"/>
+      <xsd:field    xpath="javaee:ejb-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-ejb-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The ejb-ref-name element contains the name of an EJB
+	  reference. The EJB reference is an entry in the web
+	  application's environment and is relative to the
+	  java:comp/env context.  The name must be unique within
+	  the web application.
+
+	  It is recommended that name is prefixed with "ejb/".
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:ejb-ref"/>
+      <xsd:field    xpath="javaee:ejb-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-resource-env-ref-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The resource-env-ref-name element specifies the name of
+	  a resource environment reference; its value is the
+	  environment entry name used in the web application code.
+	  The name is a JNDI name relative to the java:comp/env
+	  context and must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-env-ref"/>
+      <xsd:field    xpath="javaee:resource-env-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-message-destination-ref-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The message-destination-ref-name element specifies the name of
+	  a message destination reference; its value is the
+	  environment entry name used in the web application code.
+	  The name is a JNDI name relative to the java:comp/env
+	  context and must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:message-destination-ref"/>
+      <xsd:field    xpath="javaee:message-destination-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-res-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The res-ref-name element specifies the name of a
+	  resource manager connection factory reference.  The name
+	  is a JNDI name relative to the java:comp/env context.
+	  The name must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-ref"/>
+      <xsd:field    xpath="javaee:res-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-env-entry-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The env-entry-name element contains the name of a web
+	  application's environment entry.  The name is a JNDI
+	  name relative to the java:comp/env context.  The name
+	  must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:selector xpath="javaee:env-entry"/>
+      <xsd:field    xpath="javaee:env-entry-name"/>
+    </xsd:unique>
+
+    <xsd:key name="web-app-role-name-key">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  A role-name-key is specified to allow the references
+	  from the security-role-refs.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:security-role"/>
+      <xsd:field    xpath="javaee:role-name"/>
+    </xsd:key>
+
+    <xsd:keyref name="web-app-role-name-references"
+		refer="javaee:web-app-role-name-key">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The keyref indicates the references from
+	  security-role-ref to a specified role-name.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:servlet/javaee:security-role-ref"/>
+      <xsd:field    xpath="javaee:role-link"/>
+    </xsd:keyref>
+  </xsd:element>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="auth-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The auth-constraintType indicates the user roles that
+	should be permitted access to this resource
+	collection. The role-name used here must either correspond
+	to the role-name of one of the security-role elements
+	defined for this web application, or be the specially
+	reserved role-name "*" that is a compact syntax for
+	indicating all roles in the web application. If both "*"
+	and rolenames appear, the container interprets this as all
+	roles.  If no roles are defined, no user is allowed access
+	to the portion of the web application described by the
+	containing security-constraint.  The container matches
+	role names case sensitively when determining access.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+		   type="javaee:role-nameType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="auth-methodType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The auth-methodType is used to configure the authentication
+	mechanism for the web application. As a prerequisite to
+	gaining access to any web resources which are protected by
+	an authorization constraint, a user must have authenticated
+	using the configured mechanism. Legal values are "BASIC",
+	"DIGEST", "FORM", "CLIENT-CERT", or a vendor-specific
+	authentication scheme.
+
+	Used in: login-config
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="dispatcherType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The dispatcher has four legal values: FORWARD, REQUEST, INCLUDE,
+	and ERROR. A value of FORWARD means the Filter will be applied
+	under RequestDispatcher.forward() calls.  A value of REQUEST
+	means the Filter will be applied under ordinary client calls to
+	the path or servlet. A value of INCLUDE means the Filter will be
+	applied under RequestDispatcher.include() calls.  A value of
+	ERROR means the Filter will be applied under the error page
+	mechanism.  The absence of any dispatcher elements in a
+	filter-mapping indicates a default of applying filters only under
+	ordinary client calls to the path or servlet.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="FORWARD"/>
+	<xsd:enumeration value="INCLUDE"/>
+	<xsd:enumeration value="REQUEST"/>
+	<xsd:enumeration value="ERROR"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="encodingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The encodingType defines IANA character sets.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="[^\s]+"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="error-codeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The error-code contains an HTTP error code, ex: 404
+
+	Used in: error-page
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:xsdPositiveIntegerType">
+	<xsd:pattern value="\d{3}"/>
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="error-pageType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The error-pageType contains a mapping between an error code
+	or exception type to the path of a resource in the web
+	application.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:choice>
+	<xsd:element name="error-code"
+		     type="javaee:error-codeType"/>
+
+	<xsd:element name="exception-type"
+		     type="javaee:fully-qualified-classType">
+	  <xsd:annotation>
+	    <xsd:documentation>
+
+	      The exception-type contains a fully qualified class
+	      name of a Java exception type.
+
+	    </xsd:documentation>
+	  </xsd:annotation>
+	</xsd:element>
+      </xsd:choice>
+
+      <xsd:element name="location"
+		   type="javaee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The location element contains the location of the
+	    resource in the web application relative to the root of
+	    the web application. The value of the location must have
+	    a leading `/'.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filter-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	Declaration of the filter mappings in this web
+	application is done by using filter-mappingType.
+	The container uses the filter-mapping
+	declarations to decide which filters to apply to a request,
+	and in what order. The container matches the request URI to
+	a Servlet in the normal way. To determine which filters to
+	apply it matches filter-mapping declarations either on
+	servlet-name, or on url-pattern for each filter-mapping
+	element, depending on which style is used. The order in
+	which filters are invoked is the order in which
+	filter-mapping declarations that match a request URI for a
+	servlet appear in the list of filter-mapping elements.The
+	filter-name value must be the value of the filter-name
+	sub-elements of one of the filter declarations in the
+	deployment descriptor.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="filter-name"
+		   type="javaee:filter-nameType"/>
+      <xsd:choice minOccurs="1" maxOccurs="unbounded">
+	<xsd:element name="url-pattern"
+		     type="javaee:url-patternType"/>
+	<xsd:element name="servlet-name"
+		     type="javaee:servlet-nameType"/>
+      </xsd:choice>
+      <xsd:element name="dispatcher"
+		   type="javaee:dispatcherType"
+		   minOccurs="0" maxOccurs="4"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filter-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The logical name of the filter is declare
+	by using filter-nameType. This name is used to map the
+	filter.  Each filter name is unique within the web
+	application.
+
+	Used in: filter, filter-mapping
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filterType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The filterType is used to declare a filter in the web
+	application. The filter is mapped to either a servlet or a
+	URL pattern in the filter-mapping element, using the
+	filter-name value to reference. Filters can access the
+	initialization parameters declared in the deployment
+	descriptor at runtime via the FilterConfig interface.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="filter-name"
+		   type="javaee:filter-nameType"/>
+      <xsd:element name="filter-class"
+		   type="javaee:fully-qualified-classType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The fully qualified classname of the filter.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="init-param"
+		   type="javaee:param-valueType"
+		   minOccurs="0" maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The init-param element contains a name/value pair as
+	    an initialization param of a servlet filter
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="form-login-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The form-login-configType specifies the login and error
+	pages that should be used in form based login. If form based
+	authentication is not used, these elements are ignored.
+
+	Used in: login-config
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+
+      <xsd:element name="form-login-page"
+		   type="javaee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The form-login-page element defines the location in the web
+	    app where the page that can be used for login can be
+	    found.  The path begins with a leading / and is interpreted
+	    relative to the root of the WAR.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="form-error-page"
+		   type="javaee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The form-error-page element defines the location in
+	    the web app where the error page that is displayed
+	    when login is not successful can be found.
+	    The path begins with a leading / and is interpreted
+	    relative to the root of the WAR.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="http-methodType">
+    <xsd:annotation>
+
+      <xsd:documentation>
+
+	A HTTP method type as defined in HTTP 1.1 section 2.2.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+     <xsd:restriction base="xsd:token">
+         <xsd:pattern value="[\p{L}-[\p{Cc}\p{Z}]]+"/>
+     </xsd:restriction>
+
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="load-on-startupType">
+    <xsd:union memberTypes="javaee:null-charType xsd:integer"/>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="locale-encoding-mapping-listType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The locale-encoding-mapping-list contains one or more
+	locale-encoding-mapping(s).
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="locale-encoding-mapping"
+		   type="javaee:locale-encoding-mappingType"
+		   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="locale-encoding-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The locale-encoding-mapping contains locale name and
+	encoding name. The locale name must be either "Language-code",
+	such as "ja", defined by ISO-639 or "Language-code_Country-code",
+	such as "ja_JP".  "Country code" is defined by ISO-3166.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="locale"
+		   type="javaee:localeType"/>
+      <xsd:element name="encoding"
+		   type="javaee:encodingType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="localeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The localeType defines valid locale defined by ISO-639-1
+	and ISO-3166.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="[a-z]{2}(_|-)?([\p{L}\-\p{Nd}]{2})?"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="login-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The login-configType is used to configure the authentication
+	method that should be used, the realm name that should be
+	used for this application, and the attributes that are
+	needed by the form login mechanism.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="auth-method"
+		   type="javaee:auth-methodType"
+		   minOccurs="0"/>
+      <xsd:element name="realm-name"
+		   type="javaee:string" minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The realm name element specifies the realm name to
+	    use in HTTP Basic authorization.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="form-login-config"
+		   type="javaee:form-login-configType"
+		   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mime-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The mime-mappingType defines a mapping between an extension
+	and a mime type.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The extension element contains a string describing an
+	  extension. example: "txt"
+
+	</xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:element name="extension"
+		   type="javaee:string"/>
+      <xsd:element name="mime-type"
+		   type="javaee:mime-typeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mime-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The mime-typeType is used to indicate a defined mime type.
+
+	Example:
+	"text/plain"
+
+	Used in: mime-mapping
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:pattern value="[^\p{Cc}^\s]+/[^\p{Cc}^\s]+"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="nonEmptyStringType">
+    <xsd:annotation>
+      <xsd:documentation>
+	This type defines a string which contains at least one
+	character.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:minLength value="1"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="null-charType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value=""/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The security-constraintType is used to associate
+	security constraints with one or more web resource
+	collections
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="display-name"
+		   type="javaee:display-nameType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="web-resource-collection"
+		   type="javaee:web-resource-collectionType"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="auth-constraint"
+		   type="javaee:auth-constraintType"
+		   minOccurs="0"/>
+      <xsd:element name="user-data-constraint"
+		   type="javaee:user-data-constraintType"
+		   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servlet-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servlet-mappingType defines a mapping between a
+	servlet and a url pattern.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="servlet-name"
+		   type="javaee:servlet-nameType"/>
+      <xsd:element name="url-pattern"
+		   type="javaee:url-patternType"
+           minOccurs="1" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servlet-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servlet-name element contains the canonical name of the
+	servlet. Each servlet name is unique within the web
+	application.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servletType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servletType is used to declare a servlet.
+	It contains the declarative data of a
+	servlet. If a jsp-file is specified and the load-on-startup
+	element is present, then the JSP should be precompiled and
+	loaded.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="servlet-name"
+		   type="javaee:servlet-nameType"/>
+      <xsd:choice>
+	<xsd:element name="servlet-class"
+		     type="javaee:fully-qualified-classType">
+	  <xsd:annotation>
+	    <xsd:documentation>
+
+	      The servlet-class element contains the fully
+	      qualified class name of the servlet.
+
+	    </xsd:documentation>
+	  </xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="jsp-file"
+		     type="javaee:jsp-fileType"/>
+
+      </xsd:choice>
+
+      <xsd:element name="init-param"
+		   type="javaee:param-valueType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="load-on-startup"
+		   type="javaee:load-on-startupType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The load-on-startup element indicates that this
+	    servlet should be loaded (instantiated and have
+	    its init() called) on the startup of the web
+	    application. The optional contents of these
+	    element must be an integer indicating the order in
+	    which the servlet should be loaded. If the value
+	    is a negative integer, or the element is not
+	    present, the container is free to load the servlet
+	    whenever it chooses. If the value is a positive
+	    integer or 0, the container must load and
+	    initialize the servlet as the application is
+	    deployed. The container must guarantee that
+	    servlets marked with lower integers are loaded
+	    before servlets marked with higher integers. The
+	    container may choose the order of loading of
+	    servlets with the same load-on-start-up value.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="run-as"
+		   type="javaee:run-asType"
+		   minOccurs="0"/>
+      <xsd:element name="security-role-ref"
+		   type="javaee:security-role-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="session-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The session-configType defines the session parameters
+	for this web application.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="session-timeout"
+		   type="javaee:xsdIntegerType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The session-timeout element defines the default
+	    session timeout interval for all sessions created
+	    in this web application. The specified timeout
+	    must be expressed in a whole number of minutes.
+	    If the timeout is 0 or less, the container ensures
+	    the default behaviour of sessions is never to time
+	    out. If this element is not specified, the container
+	    must set its default timeout period.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="transport-guaranteeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The transport-guaranteeType specifies that the communication
+	between client and server should be NONE, INTEGRAL, or
+	CONFIDENTIAL. NONE means that the application does not
+	require any transport guarantees. A value of INTEGRAL means
+	that the application requires that the data sent between the
+	client and server be sent in such a way that it can't be
+	changed in transit. CONFIDENTIAL means that the application
+	requires that the data be transmitted in a fashion that
+	prevents other entities from observing the contents of the
+	transmission. In most cases, the presence of the INTEGRAL or
+	CONFIDENTIAL flag will indicate that the use of SSL is
+	required.
+
+	Used in: user-data-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="NONE"/>
+	<xsd:enumeration value="INTEGRAL"/>
+	<xsd:enumeration value="CONFIDENTIAL"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="user-data-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The user-data-constraintType is used to indicate how
+	data communicated between the client and container should be
+	protected.
+
+	Used in: security-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="transport-guarantee"
+		   type="javaee:transport-guaranteeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="war-pathType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The elements that use this type designate a path starting
+	with a "/" and interpreted relative to the root of a WAR
+	file.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:pattern value="/.*"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="web-app-versionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type contains the recognized versions of
+	web-application supported. It is used to designate the
+	version of the web application.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="2.5"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="web-appType">
+
+    <xsd:choice minOccurs="0" maxOccurs="unbounded">
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="distributable"
+		   type="javaee:emptyType"/>
+      <xsd:element name="context-param"
+		   type="javaee:param-valueType">
+
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The context-param element contains the declaration
+	    of a web application's servlet context
+	    initialization parameters.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="filter"
+		   type="javaee:filterType"/>
+      <xsd:element name="filter-mapping"
+		   type="javaee:filter-mappingType"/>
+      <xsd:element name="listener"
+		   type="javaee:listenerType"/>
+      <xsd:element name="servlet"
+		   type="javaee:servletType"/>
+      <xsd:element name="servlet-mapping"
+		   type="javaee:servlet-mappingType"/>
+      <xsd:element name="session-config"
+		   type="javaee:session-configType"/>
+      <xsd:element name="mime-mapping"
+		   type="javaee:mime-mappingType"/>
+      <xsd:element name="welcome-file-list"
+		   type="javaee:welcome-file-listType"/>
+      <xsd:element name="error-page"
+		   type="javaee:error-pageType"/>
+      <xsd:element name="jsp-config"
+		   type="javaee:jsp-configType"/>
+      <xsd:element name="security-constraint"
+		   type="javaee:security-constraintType"/>
+      <xsd:element name="login-config"
+		   type="javaee:login-configType"/>
+      <xsd:element name="security-role"
+		   type="javaee:security-roleType"/>
+      <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
+      <xsd:element name="message-destination"
+		   type="javaee:message-destinationType"/>
+      <xsd:element name="locale-encoding-mapping-list"
+		   type="javaee:locale-encoding-mapping-listType"/>
+    </xsd:choice>
+
+    <xsd:attribute name="version"
+		   type="javaee:web-app-versionType"
+		   use="required"/>
+    <xsd:attribute name="id" type="xsd:ID"/>
+
+    <xsd:attribute name="metadata-complete" type="xsd:boolean">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The metadata-complete attribute defines whether this
+	  deployment descriptor and other related deployment
+	  descriptors for this module (e.g., web service
+	  descriptors) are complete, or whether the class
+	  files available to this module and packaged with
+	  this application should be examined for annotations
+	  that specify deployment information.
+
+	  If metadata-complete is set to "true", the deployment
+	  tool must ignore any annotations that specify deployment
+	  information, which might be present in the class files
+	  of the application.
+
+	  If metadata-complete is not specified or is set to
+	  "false", the deployment tool must examine the class
+	  files of the application for annotations, as
+	  specified by the specifications.
+
+	</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="web-resource-collectionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The web-resource-collectionType is used to identify a subset
+	of the resources and HTTP methods on those resources within
+	a web application to which a security constraint applies. If
+	no HTTP methods are specified, then the security constraint
+	applies to all HTTP methods.
+
+	Used in: security-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="web-resource-name"
+		   type="javaee:string">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The web-resource-name contains the name of this web
+	    resource collection.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="url-pattern"
+		   type="javaee:url-patternType"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="http-method"
+		   type="javaee:http-methodType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="welcome-file-listType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The welcome-file-list contains an ordered list of welcome
+	files elements.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="welcome-file"
+		   type="xsd:string"
+		   maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The welcome-file element contains file name to use
+	    as a default welcome file, such as index.html
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+</xsd:schema>
+
diff --git a/xml/tests/testData/index/web-app_3_0.xsd b/xml/tests/testData/index/web-app_3_0.xsd
new file mode 100644
index 0000000..06f9564
--- /dev/null
+++ b/xml/tests/testData/index/web-app_3_0.xsd
@@ -0,0 +1,272 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://java.jb.com/xml/ns/javaee"
+            xmlns:javaee="http://java.jb.com/xml/ns/javaee"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified"
+            version="3.0">
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[[
+      This is the XML Schema for the Servlet 3.0 deployment descriptor.
+      The deployment descriptor must be named "WEB-INF/web.xml" in the
+      web application's war file.  All Servlet deployment descriptors
+      must indicate the web application schema by using the Java EE
+      namespace:
+      
+      http://java.sun.com/xml/ns/javaee 
+      
+      and by indicating the version of the schema by 
+      using the version element as shown below: 
+      
+      <web-app xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="..."
+      version="3.0"> 
+      ...
+      </web-app>
+      
+      The instance documents may indicate the published version of
+      the schema using the xsi:schemaLocation attribute for Java EE
+      namespace with the following location:
+      
+      http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd
+      
+      ]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all Java EE
+      deployment descriptor elements unless indicated otherwise.
+      
+      - In elements that specify a pathname to a file within the
+      same JAR file, relative filenames (i.e., those not
+      starting with "/") are considered relative to the root of
+      the JAR file's namespace.  Absolute filenames (i.e., those
+      starting with "/") also specify names in the root of the
+      JAR file's namespace.  In general, relative names are
+      preferred.  The exception is .war files where absolute
+      names are preferred for consistency with the Servlet API.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="web-common_3_0.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:element name="web-app"
+               type="javaee:web-appType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The web-app element is the root of the deployment
+        descriptor for a web application.  Note that the sub-elements
+        of this element can be in the arbitrary order. Because of
+        that, the multiplicity of the elements of distributable,
+        session-config, welcome-file-list, jsp-config, login-config,
+        and locale-encoding-mapping-list was changed from "?" to "*"
+        in this schema.  However, the deployment descriptor instance
+        file must not contain multiple elements of session-config,
+        jsp-config, and login-config. When there are multiple elements of
+        welcome-file-list or locale-encoding-mapping-list, the container
+        must concatenate the element contents.  The multiple occurence
+        of the element distributable is redundant and the container
+        treats that case exactly in the same way when there is only
+        one distributable. 
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:unique name="web-common-servlet-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The servlet element contains the name of a servlet.
+          The name must be unique within the web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:servlet"/>
+      <xsd:field xpath="javaee:servlet-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-filter-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The filter element contains the name of a filter.
+          The name must be unique within the web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:filter"/>
+      <xsd:field xpath="javaee:filter-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-ejb-local-ref-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The ejb-local-ref-name element contains the name of an EJB
+          reference. The EJB reference is an entry in the web
+          application's environment and is relative to the
+          java:comp/env context.  The name must be unique within
+          the web application.
+          
+          It is recommended that name is prefixed with "ejb/".
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:ejb-local-ref"/>
+      <xsd:field xpath="javaee:ejb-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-ejb-ref-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The ejb-ref-name element contains the name of an EJB
+          reference. The EJB reference is an entry in the web
+          application's environment and is relative to the
+          java:comp/env context.  The name must be unique within
+          the web application.
+          
+          It is recommended that name is prefixed with "ejb/".
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:ejb-ref"/>
+      <xsd:field xpath="javaee:ejb-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-resource-env-ref-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The resource-env-ref-name element specifies the name of
+          a resource environment reference; its value is the
+          environment entry name used in the web application code.
+          The name is a JNDI name relative to the java:comp/env
+          context and must be unique within a web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-env-ref"/>
+      <xsd:field xpath="javaee:resource-env-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-message-destination-ref-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The message-destination-ref-name element specifies the name of
+          a message destination reference; its value is the
+          environment entry name used in the web application code.
+          The name is a JNDI name relative to the java:comp/env
+          context and must be unique within a web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:message-destination-ref"/>
+      <xsd:field xpath="javaee:message-destination-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-res-ref-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The res-ref-name element specifies the name of a
+          resource manager connection factory reference.  The name
+          is a JNDI name relative to the java:comp/env context.
+          The name must be unique within a web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-ref"/>
+      <xsd:field xpath="javaee:res-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-env-entry-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The env-entry-name element contains the name of a web
+          application's environment entry.  The name is a JNDI
+          name relative to the java:comp/env context.  The name
+          must be unique within a web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:env-entry"/>
+      <xsd:field xpath="javaee:env-entry-name"/>
+    </xsd:unique>
+    <xsd:key name="web-common-role-name-key">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          A role-name-key is specified to allow the references
+          from the security-role-refs.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:security-role"/>
+      <xsd:field xpath="javaee:role-name"/>
+    </xsd:key>
+    <xsd:keyref name="web-common-role-name-references"
+                refer="javaee:web-common-role-name-key">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The keyref indicates the references from
+          security-role-ref to a specified role-name.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:servlet/javaee:security-role-ref"/>
+      <xsd:field xpath="javaee:role-link"/>
+    </xsd:keyref>
+  </xsd:element>
+
+</xsd:schema>
diff --git a/xml/tests/testData/inspections/wrongClosingTagName/after0.xhtml b/xml/tests/testData/inspections/wrongClosingTagName/after0.xhtml
new file mode 100644
index 0000000..c2d6c3f
--- /dev/null
+++ b/xml/tests/testData/inspections/wrongClosingTagName/after0.xhtml
@@ -0,0 +1,10 @@
+<!-- "Rename start tag 'div' to 'h3'" "true" -->
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <body>
+    <h3>test</<caret>h3>
+  </body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/inspections/wrongClosingTagName/after1.xhtml b/xml/tests/testData/inspections/wrongClosingTagName/after1.xhtml
new file mode 100644
index 0000000..426510a
--- /dev/null
+++ b/xml/tests/testData/inspections/wrongClosingTagName/after1.xhtml
@@ -0,0 +1,10 @@
+<!-- "Rename end tag 'h3' to 'div'" "true" -->
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <body>
+    <div<caret>>test</div>
+  </body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/inspections/wrongClosingTagName/after2.xhtml b/xml/tests/testData/inspections/wrongClosingTagName/after2.xhtml
new file mode 100644
index 0000000..a30224b
--- /dev/null
+++ b/xml/tests/testData/inspections/wrongClosingTagName/after2.xhtml
@@ -0,0 +1,10 @@
+<!-- "Rename end tag 'h3' to 'div'" "true" -->
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <body>
+    <div>test</div<caret>>
+  </body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/inspections/wrongClosingTagName/after3.xml b/xml/tests/testData/inspections/wrongClosingTagName/after3.xml
new file mode 100644
index 0000000..8a521d5
--- /dev/null
+++ b/xml/tests/testData/inspections/wrongClosingTagName/after3.xml
@@ -0,0 +1,3 @@
+<!-- "Rename end tag 'html2' to 'html'" "true" -->
+<html<caret> lang="en">
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/inspections/wrongClosingTagName/before0.xhtml b/xml/tests/testData/inspections/wrongClosingTagName/before0.xhtml
new file mode 100644
index 0000000..82e1f61
--- /dev/null
+++ b/xml/tests/testData/inspections/wrongClosingTagName/before0.xhtml
@@ -0,0 +1,10 @@
+<!-- "Rename start tag 'div' to 'h3'" "true" -->
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <body>
+    <div>test</<caret>h3>
+  </body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/inspections/wrongClosingTagName/before1.xhtml b/xml/tests/testData/inspections/wrongClosingTagName/before1.xhtml
new file mode 100644
index 0000000..45d671f
--- /dev/null
+++ b/xml/tests/testData/inspections/wrongClosingTagName/before1.xhtml
@@ -0,0 +1,10 @@
+<!-- "Rename end tag 'h3' to 'div'" "true" -->
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <body>
+    <div<caret>>test</h3>
+  </body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/inspections/wrongClosingTagName/before2.xhtml b/xml/tests/testData/inspections/wrongClosingTagName/before2.xhtml
new file mode 100644
index 0000000..affc7c6
--- /dev/null
+++ b/xml/tests/testData/inspections/wrongClosingTagName/before2.xhtml
@@ -0,0 +1,10 @@
+<!-- "Rename end tag 'h3' to 'div'" "true" -->
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <body>
+    <div>test</h3<caret>>
+  </body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/inspections/wrongClosingTagName/before3.xml b/xml/tests/testData/inspections/wrongClosingTagName/before3.xml
new file mode 100644
index 0000000..64c250d
--- /dev/null
+++ b/xml/tests/testData/inspections/wrongClosingTagName/before3.xml
@@ -0,0 +1,3 @@
+<!-- "Rename end tag 'html2' to 'html'" "true" -->
+<html<caret> lang="en">
+</html2>
\ No newline at end of file
diff --git a/xml/tests/testData/intentions/splitTag/after1.html b/xml/tests/testData/intentions/splitTag/after1.html
new file mode 100644
index 0000000..5729be0
--- /dev/null
+++ b/xml/tests/testData/intentions/splitTag/after1.html
@@ -0,0 +1,13 @@
+<!-- "Split current tag" "true" -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+        "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+  <title>a</title>
+</head>
+<body>
+<p>this is a</p>
+
+<p><caret> test</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/intentions/splitTag/after3.html b/xml/tests/testData/intentions/splitTag/after3.html
new file mode 100644
index 0000000..63d3972
--- /dev/null
+++ b/xml/tests/testData/intentions/splitTag/after3.html
@@ -0,0 +1,13 @@
+<!-- "Split current tag" "true" -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+        "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+  <title>a</title>
+</head>
+<body>
+<p class="class1 class2" id="test_id" style="color: #eee;">this is a </p>
+
+<p class="class1 class2" style="color: #eee;"><caret>test text</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/intentions/splitTag/after4.html b/xml/tests/testData/intentions/splitTag/after4.html
new file mode 100644
index 0000000..238506c
--- /dev/null
+++ b/xml/tests/testData/intentions/splitTag/after4.html
@@ -0,0 +1,2 @@
+<!-- "Split current tag" "true" -->
+<p>Integer hac elit tortor lacus nisi odio sit?</p><p><caret> Amet lectus, <a href="/">scelerisque</a></p><p>
\ No newline at end of file
diff --git a/xml/tests/testData/intentions/splitTag/before0.html b/xml/tests/testData/intentions/splitTag/before0.html
new file mode 100644
index 0000000..74584b1
--- /dev/null
+++ b/xml/tests/testData/intentions/splitTag/before0.html
@@ -0,0 +1,13 @@
+<!-- "Split current tag" "false" -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+        "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+  <title>a</title>
+</head>
+<body>
+this is a
+<caret>
+test
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/intentions/splitTag/before1.html b/xml/tests/testData/intentions/splitTag/before1.html
new file mode 100644
index 0000000..d98ad1d
--- /dev/null
+++ b/xml/tests/testData/intentions/splitTag/before1.html
@@ -0,0 +1,11 @@
+<!-- "Split current tag" "true" -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+        "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+  <title>a</title>
+</head>
+<body>
+<p>this is a<caret> test</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/intentions/splitTag/before2.html b/xml/tests/testData/intentions/splitTag/before2.html
new file mode 100644
index 0000000..7901523
--- /dev/null
+++ b/xml/tests/testData/intentions/splitTag/before2.html
@@ -0,0 +1,11 @@
+<!-- "Split current tag" "false" -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+        "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+  <title>this is<caret> a test</title>
+</head>
+<body>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/intentions/splitTag/before3.html b/xml/tests/testData/intentions/splitTag/before3.html
new file mode 100644
index 0000000..2382251
--- /dev/null
+++ b/xml/tests/testData/intentions/splitTag/before3.html
@@ -0,0 +1,11 @@
+<!-- "Split current tag" "true" -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+        "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+  <title>a</title>
+</head>
+<body>
+<p class="class1 class2" id="test_id" style="color: #eee;">this is a <caret>test text</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/intentions/splitTag/before4.html b/xml/tests/testData/intentions/splitTag/before4.html
new file mode 100644
index 0000000..b35bf0a
--- /dev/null
+++ b/xml/tests/testData/intentions/splitTag/before4.html
@@ -0,0 +1,2 @@
+<!-- "Split current tag" "true" -->
+<p>Integer hac elit tortor lacus nisi odio sit?<caret> Amet lectus, <a href="/">scelerisque</a><p>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/1.html b/xml/tests/testData/mover/1.html
new file mode 100644
index 0000000..c41da40
--- /dev/null
+++ b/xml/tests/testData/mover/1.html
@@ -0,0 +1,9 @@
+<html>
+<body>
+<hr>
+<a name="a">name a</a>
+<a name="b"><caret>name b</a>
+<a name="c">name c</a>
+<hr>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/1_afterDown.html b/xml/tests/testData/mover/1_afterDown.html
new file mode 100644
index 0000000..4e3682d
--- /dev/null
+++ b/xml/tests/testData/mover/1_afterDown.html
@@ -0,0 +1,9 @@
+<html>
+<body>
+<hr>
+<a name="a">name a</a>
+<a name="c">name c</a>
+<a name="b"><caret>name b</a>
+<hr>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/1_afterUp.html b/xml/tests/testData/mover/1_afterUp.html
new file mode 100644
index 0000000..9eb9e6d
--- /dev/null
+++ b/xml/tests/testData/mover/1_afterUp.html
@@ -0,0 +1,9 @@
+<html>
+<body>
+<hr>
+<a name="b"><caret>name b</a>
+<a name="a">name a</a>
+<a name="c">name c</a>
+<hr>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/moveTag.xml b/xml/tests/testData/mover/moveTag.xml
new file mode 100644
index 0000000..01f19b7
--- /dev/null
+++ b/xml/tests/testData/mover/moveTag.xml
@@ -0,0 +1,17 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:element name="a">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+    <xs:ele<caret>ment name="b">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="c">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/moveTag1.xml b/xml/tests/testData/mover/moveTag1.xml
new file mode 100644
index 0000000..29dd321
--- /dev/null
+++ b/xml/tests/testData/mover/moveTag1.xml
@@ -0,0 +1,13 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:element name="b">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+    <xs:ele<caret>ment name="a"/>
+    <xs:element name="c">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+</xs:schema>
diff --git a/xml/tests/testData/mover/moveTag1_afterDown.xml b/xml/tests/testData/mover/moveTag1_afterDown.xml
new file mode 100644
index 0000000..ee3a871
--- /dev/null
+++ b/xml/tests/testData/mover/moveTag1_afterDown.xml
@@ -0,0 +1,13 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:element name="b">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="c">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+    <xs:ele<caret>ment name="a"/>
+</xs:schema>
diff --git a/xml/tests/testData/mover/moveTag1_afterUp.xml b/xml/tests/testData/mover/moveTag1_afterUp.xml
new file mode 100644
index 0000000..be2a02e
--- /dev/null
+++ b/xml/tests/testData/mover/moveTag1_afterUp.xml
@@ -0,0 +1,13 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:ele<caret>ment name="a"/>
+    <xs:element name="b">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="c">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+</xs:schema>
diff --git a/xml/tests/testData/mover/moveTagWithEmptyLines.xml b/xml/tests/testData/mover/moveTagWithEmptyLines.xml
new file mode 100644
index 0000000..c296dd3
--- /dev/null
+++ b/xml/tests/testData/mover/moveTagWithEmptyLines.xml
@@ -0,0 +1,15 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:element name="b">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+
+    <xs:ele<caret>ment name="a"/>
+
+    <xs:element name="c">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+</xs:schema>
diff --git a/xml/tests/testData/mover/moveTagWithEmptyLines_afterDown.xml b/xml/tests/testData/mover/moveTagWithEmptyLines_afterDown.xml
new file mode 100644
index 0000000..883575b
--- /dev/null
+++ b/xml/tests/testData/mover/moveTagWithEmptyLines_afterDown.xml
@@ -0,0 +1,15 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:element name="b">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+
+
+    <xs:ele<caret>ment name="a"/>
+    <xs:element name="c">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+</xs:schema>
diff --git a/xml/tests/testData/mover/moveTagWithEmptyLines_afterUp.xml b/xml/tests/testData/mover/moveTagWithEmptyLines_afterUp.xml
new file mode 100644
index 0000000..4817362
--- /dev/null
+++ b/xml/tests/testData/mover/moveTagWithEmptyLines_afterUp.xml
@@ -0,0 +1,15 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:element name="b">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+    <xs:ele<caret>ment name="a"/>
+
+
+    <xs:element name="c">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+</xs:schema>
diff --git a/xml/tests/testData/mover/moveTag_afterDown.xml b/xml/tests/testData/mover/moveTag_afterDown.xml
new file mode 100644
index 0000000..2acf84e
--- /dev/null
+++ b/xml/tests/testData/mover/moveTag_afterDown.xml
@@ -0,0 +1,17 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:element name="a">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="c">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+    <xs:ele<caret>ment name="b">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/moveTag_afterUp.xml b/xml/tests/testData/mover/moveTag_afterUp.xml
new file mode 100644
index 0000000..a10cb8b
--- /dev/null
+++ b/xml/tests/testData/mover/moveTag_afterUp.xml
@@ -0,0 +1,17 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:ele<caret>ment name="b">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="a">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="c">
+        <xs:complexType>
+
+        </xs:complexType>
+    </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/multiLineTag.xml b/xml/tests/testData/mover/multiLineTag.xml
new file mode 100644
index 0000000..6553715
--- /dev/null
+++ b/xml/tests/testData/mover/multiLineTag.xml
@@ -0,0 +1,8 @@
+<test>
+    <element
+            attribute="test1"/>
+    <element
+  <caret>     attribute="test2"/>
+    <element
+            attribute="test3"/>
+</test>
diff --git a/xml/tests/testData/mover/multiLineTag_afterDown.xml b/xml/tests/testData/mover/multiLineTag_afterDown.xml
new file mode 100644
index 0000000..1839644
--- /dev/null
+++ b/xml/tests/testData/mover/multiLineTag_afterDown.xml
@@ -0,0 +1,8 @@
+<test>
+    <element
+            attribute="test1"/>
+    <element
+            attribute="test3"/>
+    <element
+            attribute="test2"/>
+</test>
diff --git a/xml/tests/testData/mover/multiLineTag_afterUp.xml b/xml/tests/testData/mover/multiLineTag_afterUp.xml
new file mode 100644
index 0000000..577140a
--- /dev/null
+++ b/xml/tests/testData/mover/multiLineTag_afterUp.xml
@@ -0,0 +1,8 @@
+<test>
+    <element
+            attribute="test2"/>
+    <element
+            attribute="test1"/>
+    <element
+            attribute="test3"/>
+</test>
diff --git a/xml/tests/testData/mover/rootTag.xml b/xml/tests/testData/mover/rootTag.xml
new file mode 100644
index 0000000..a648517
--- /dev/null
+++ b/xml/tests/testData/mover/rootTag.xml
@@ -0,0 +1,6 @@
+<te<caret>st>
+    <element
+            attribute="test1"/>
+    <element
+            attribute="test2"/>
+</test>
diff --git a/xml/tests/testData/mover/rootTag1.xml b/xml/tests/testData/mover/rootTag1.xml
new file mode 100644
index 0000000..5a3cc31
--- /dev/null
+++ b/xml/tests/testData/mover/rootTag1.xml
@@ -0,0 +1,6 @@
+<test>
+    <element
+            attribute="test1"/>
+    <element
+            attribute="test2"/>
+</te<caret>st>
diff --git a/xml/tests/testData/mover/singleTag.xml b/xml/tests/testData/mover/singleTag.xml
new file mode 100644
index 0000000..74614a3
--- /dev/null
+++ b/xml/tests/testData/mover/singleTag.xml
@@ -0,0 +1,8 @@
+<root>
+    <te<caret>st>
+        <element
+            attribute="test1"/>
+        <element
+            attribute="test2"/>
+    </test>
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/singleTag_afterUp.xml b/xml/tests/testData/mover/singleTag_afterUp.xml
new file mode 100644
index 0000000..22056ac
--- /dev/null
+++ b/xml/tests/testData/mover/singleTag_afterUp.xml
@@ -0,0 +1,8 @@
+<test>
+    <element
+            attribute="test1"/>
+    <element
+            attribute="test2"/>
+</test>
+<root>
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag.xml b/xml/tests/testData/mover/tag.xml
new file mode 100644
index 0000000..1eabe39
--- /dev/null
+++ b/xml/tests/testData/mover/tag.xml
@@ -0,0 +1,5 @@
+<x>
+ <caret><a/>
+<b>
+</b>
+</x>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag10.xml b/xml/tests/testData/mover/tag10.xml
new file mode 100644
index 0000000..146f363
--- /dev/null
+++ b/xml/tests/testData/mover/tag10.xml
@@ -0,0 +1,3 @@
+<components xmlns:pay="http://lufthansatechnik.com/mscoreengine"
+<caret>xmlns:core="http://jboss.com/products/seam/core"
+/>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag11.xml b/xml/tests/testData/mover/tag11.xml
new file mode 100644
index 0000000..fa8c00a
--- /dev/null
+++ b/xml/tests/testData/mover/tag11.xml
@@ -0,0 +1,6 @@
+<aaa>
+  <test />
+  <!--test comment-->
+  <test2 <caret>/>
+  <test />
+</aaa>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag11_afterDown.xml b/xml/tests/testData/mover/tag11_afterDown.xml
new file mode 100644
index 0000000..517df8a6
--- /dev/null
+++ b/xml/tests/testData/mover/tag11_afterDown.xml
@@ -0,0 +1,6 @@
+<aaa>
+  <test />
+  <!--test comment-->
+  <test />
+    <test2 <caret>/>
+</aaa>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag11_afterUp.xml b/xml/tests/testData/mover/tag11_afterUp.xml
new file mode 100644
index 0000000..3ad838c
--- /dev/null
+++ b/xml/tests/testData/mover/tag11_afterUp.xml
@@ -0,0 +1,6 @@
+<aaa>
+  <test />
+    <test2 <caret>/>
+    <!--test comment-->
+  <test />
+</aaa>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag2.xml b/xml/tests/testData/mover/tag2.xml
new file mode 100644
index 0000000..5380180
--- /dev/null
+++ b/xml/tests/testData/mover/tag2.xml
@@ -0,0 +1,5 @@
+<x>
+    <b>
+        <caret><<selection>a/</selection>>
+    </b>
+</x>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag2_afterDown.xml b/xml/tests/testData/mover/tag2_afterDown.xml
new file mode 100644
index 0000000..4cc2ce7
--- /dev/null
+++ b/xml/tests/testData/mover/tag2_afterDown.xml
@@ -0,0 +1,5 @@
+<x>
+    <b>
+    </b>
+    <caret><<selection>a/</selection>>
+</x>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag2_afterUp.xml b/xml/tests/testData/mover/tag2_afterUp.xml
new file mode 100644
index 0000000..f512773
--- /dev/null
+++ b/xml/tests/testData/mover/tag2_afterUp.xml
@@ -0,0 +1,5 @@
+<x>
+    <caret><<selection>a/</selection>>
+    <b>
+    </b>
+</x>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag3.xml b/xml/tests/testData/mover/tag3.xml
new file mode 100644
index 0000000..6374057
--- /dev/null
+++ b/xml/tests/testData/mover/tag3.xml
@@ -0,0 +1,10 @@
+<x>
+    <b c="d"
+      a = "b"
+    >
+        <caret><<selection>a/</selection>>
+      <b2 c2="d2"
+      a2 = "b2">
+        </b2>
+    </b>
+</x>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag3_afterDown.xml b/xml/tests/testData/mover/tag3_afterDown.xml
new file mode 100644
index 0000000..4ae16ef
--- /dev/null
+++ b/xml/tests/testData/mover/tag3_afterDown.xml
@@ -0,0 +1,10 @@
+<x>
+    <b c="d"
+      a = "b"
+    >
+      <b2 c2="d2"
+      a2 = "b2">
+          <caret><<selection>a/</selection>>
+      </b2>
+    </b>
+</x>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag3_afterUp.xml b/xml/tests/testData/mover/tag3_afterUp.xml
new file mode 100644
index 0000000..1e2a810
--- /dev/null
+++ b/xml/tests/testData/mover/tag3_afterUp.xml
@@ -0,0 +1,10 @@
+<x>
+    <caret><<selection>a/</selection>>
+    <b c="d"
+      a = "b"
+    >
+      <b2 c2="d2"
+      a2 = "b2">
+        </b2>
+    </b>
+</x>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag4.xml b/xml/tests/testData/mover/tag4.xml
new file mode 100644
index 0000000..7ae0ebc
--- /dev/null
+++ b/xml/tests/testData/mover/tag4.xml
@@ -0,0 +1,7 @@
+<x>
+    <b c="d"
+      a = "b"
+    >
+    </b>
+</x>
+<caret><<selection>a/</selection>>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag4_afterUp.xml b/xml/tests/testData/mover/tag4_afterUp.xml
new file mode 100644
index 0000000..0971db0
--- /dev/null
+++ b/xml/tests/testData/mover/tag4_afterUp.xml
@@ -0,0 +1,7 @@
+<x>
+    <b c="d"
+      a = "b"
+    >
+    </b>
+    <caret><<selection>a/</selection>>
+</x>
diff --git a/xml/tests/testData/mover/tag5.xml b/xml/tests/testData/mover/tag5.xml
new file mode 100644
index 0000000..9b768c7
--- /dev/null
+++ b/xml/tests/testData/mover/tag5.xml
@@ -0,0 +1,11 @@
+<orcontainer>
+  <empty1 attr1="N0"/>
+  <empty1 attr1="N1"
+                  attr2="some">
+          <sub-empty/>
+  </empty1>
+  <empty1 attr1="N2"/>
+  <empty1 attr1="N3"
+     attr2="some"/>
+<caret><selection>  <empty1 attr1="N4"/></selection>
+</orcontainer>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag5_afterUp.xml b/xml/tests/testData/mover/tag5_afterUp.xml
new file mode 100644
index 0000000..174ea7a
--- /dev/null
+++ b/xml/tests/testData/mover/tag5_afterUp.xml
@@ -0,0 +1,11 @@
+<orcontainer>
+  <empty1 attr1="N0"/>
+  <empty1 attr1="N1"
+                  attr2="some">
+          <sub-empty/>
+  </empty1>
+  <empty1 attr1="N2"/>
+<caret><selection>    <empty1 attr1="N4"/></selection>
+    <empty1 attr1="N3"
+     attr2="some"/>
+</orcontainer>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag6.xml b/xml/tests/testData/mover/tag6.xml
new file mode 100644
index 0000000..969059b
--- /dev/null
+++ b/xml/tests/testData/mover/tag6.xml
@@ -0,0 +1,11 @@
+<orcontainer>
+    <empty1 attr1="N0"/>
+    <empty1 attr1="N1"
+                    attr2="some">
+            <sub-empty/>
+    </empty1>
+    <empty1 attr1="N2"/>
+    <empty1 att<caret>r1="N3"
+                    attr2="some"/>
+    <empty1 attr1="N4"/>
+</orcontainer>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag6_afterDown.xml b/xml/tests/testData/mover/tag6_afterDown.xml
new file mode 100644
index 0000000..679162e5
--- /dev/null
+++ b/xml/tests/testData/mover/tag6_afterDown.xml
@@ -0,0 +1,11 @@
+<orcontainer>
+    <empty1 attr1="N0"/>
+    <empty1 attr1="N1"
+                    attr2="some">
+            <sub-empty/>
+    </empty1>
+    <empty1 attr1="N2"/>
+    <empty1 attr1="N4"/>
+    <empty1 att<caret>r1="N3"
+            attr2="some"/>
+</orcontainer>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag6_afterUp.xml b/xml/tests/testData/mover/tag6_afterUp.xml
new file mode 100644
index 0000000..76719ed
--- /dev/null
+++ b/xml/tests/testData/mover/tag6_afterUp.xml
@@ -0,0 +1,11 @@
+<orcontainer>
+    <empty1 attr1="N0"/>
+    <empty1 attr1="N1"
+                    attr2="some">
+            <sub-empty/>
+    </empty1>
+    <empty1 att<caret>r1="N3"
+            attr2="some"/>
+    <empty1 attr1="N2"/>
+    <empty1 attr1="N4"/>
+</orcontainer>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag7.xml b/xml/tests/testData/mover/tag7.xml
new file mode 100644
index 0000000..f899c30
--- /dev/null
+++ b/xml/tests/testData/mover/tag7.xml
@@ -0,0 +1,11 @@
+<orcontainer>
+    <empty1 attr1="N0"/>
+    <empty1 attr1="N1"
+                    attr2="some">
+            <sub-empty/>
+    </empty1>
+    <empty1 attr1="N2"/>
+    <empty1 attr1="N3"
+               <caret>     attr2="some"/>
+    <empty1 attr1="N4"/>
+</orcontainer>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag7_afterDown.xml b/xml/tests/testData/mover/tag7_afterDown.xml
new file mode 100644
index 0000000..2d68b6d
--- /dev/null
+++ b/xml/tests/testData/mover/tag7_afterDown.xml
@@ -0,0 +1,11 @@
+<orcontainer>
+    <empty1 attr1="N0"/>
+    <empty1 attr1="N1"
+                    attr2="some">
+            <sub-empty/>
+    </empty1>
+    <empty1 attr1="N2"/>
+    <empty1 attr1="N4"/>
+    <empty1 attr1="N3"
+            <caret>attr2="some"/>
+</orcontainer>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag7_afterUp.xml b/xml/tests/testData/mover/tag7_afterUp.xml
new file mode 100644
index 0000000..a6f3cf2
--- /dev/null
+++ b/xml/tests/testData/mover/tag7_afterUp.xml
@@ -0,0 +1,11 @@
+<orcontainer>
+    <empty1 attr1="N0"/>
+    <empty1 attr1="N1"
+                    attr2="some">
+            <sub-empty/>
+    </empty1>
+    <empty1 attr1="N3"
+            <caret>attr2="some"/>
+    <empty1 attr1="N2"/>
+    <empty1 attr1="N4"/>
+</orcontainer>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag8.xml b/xml/tests/testData/mover/tag8.xml
new file mode 100644
index 0000000..c44cfb3
--- /dev/null
+++ b/xml/tests/testData/mover/tag8.xml
@@ -0,0 +1,16 @@
+<components xmlns:pay="http://lufthansatechnik.com/mscoreengine"
+xmlns:core="http://jboss.com/products/seam/core"
+xmlns:persistence="http://jboss.com/products/seam/persistence"
+xmlns:framework="http://jboss.com/products/seam/framework"
+xmlns:web="http://jboss.com/products/seam/web"
+xmlns:security="http://jboss.com/products/seam/security"
+xmlns:xsi
+  ="http://www.w3.org/2001/XMLSchema-instance"
+<caret>xmlns:async="http://jboss.com/products/seam/async"
+xsi:schemaLocation=
+  "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
+  http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.0.xsd
+  http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
+  http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.0.xsd
+http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd"
+/>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag8_afterDown.xml b/xml/tests/testData/mover/tag8_afterDown.xml
new file mode 100644
index 0000000..d5ba112
--- /dev/null
+++ b/xml/tests/testData/mover/tag8_afterDown.xml
@@ -0,0 +1,16 @@
+<components xmlns:pay="http://lufthansatechnik.com/mscoreengine"
+xmlns:core="http://jboss.com/products/seam/core"
+xmlns:persistence="http://jboss.com/products/seam/persistence"
+xmlns:framework="http://jboss.com/products/seam/framework"
+xmlns:web="http://jboss.com/products/seam/web"
+xmlns:security="http://jboss.com/products/seam/security"
+xmlns:xsi
+  ="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation=
+  "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
+  http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.0.xsd
+  http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
+  http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.0.xsd
+http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd"
+<caret>xmlns:async="http://jboss.com/products/seam/async"
+        />
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag8_afterUp.xml b/xml/tests/testData/mover/tag8_afterUp.xml
new file mode 100644
index 0000000..69f0525
--- /dev/null
+++ b/xml/tests/testData/mover/tag8_afterUp.xml
@@ -0,0 +1,16 @@
+<components xmlns:pay="http://lufthansatechnik.com/mscoreengine"
+xmlns:core="http://jboss.com/products/seam/core"
+xmlns:persistence="http://jboss.com/products/seam/persistence"
+xmlns:framework="http://jboss.com/products/seam/framework"
+xmlns:web="http://jboss.com/products/seam/web"
+xmlns:security="http://jboss.com/products/seam/security"
+<caret>xmlns:async="http://jboss.com/products/seam/async"
+xmlns:xsi
+  ="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation=
+  "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
+  http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.0.xsd
+  http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
+  http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.0.xsd
+http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd"
+/>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag9.xml b/xml/tests/testData/mover/tag9.xml
new file mode 100644
index 0000000..00b9e54
--- /dev/null
+++ b/xml/tests/testData/mover/tag9.xml
@@ -0,0 +1,15 @@
+<components xmlns:pay="http://lufthansatechnik.com/mscoreengine"
+xmlns:core="http://jboss.com/products/seam/core"
+xmlns:persistence="http://jboss.com/products/seam/persistence"
+xmlns:framework="http://jboss.com/products/seam/framework"
+xmlns:web="http://jboss.com/products/seam/web"
+xmlns:security="http://jboss.com/products/seam/security"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<caret>xsi:schemaLocation=
+  "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
+  http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.0.xsd
+  http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
+  http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.0.xsd
+http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd"
+xmlns:async="http://jboss.com/products/seam/async"
+/>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag9_afterDown.xml b/xml/tests/testData/mover/tag9_afterDown.xml
new file mode 100644
index 0000000..7064032
--- /dev/null
+++ b/xml/tests/testData/mover/tag9_afterDown.xml
@@ -0,0 +1,15 @@
+<components xmlns:pay="http://lufthansatechnik.com/mscoreengine"
+xmlns:core="http://jboss.com/products/seam/core"
+xmlns:persistence="http://jboss.com/products/seam/persistence"
+xmlns:framework="http://jboss.com/products/seam/framework"
+xmlns:web="http://jboss.com/products/seam/web"
+xmlns:security="http://jboss.com/products/seam/security"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:async="http://jboss.com/products/seam/async"
+<caret>xsi:schemaLocation=
+        "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
+  http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.0.xsd
+  http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
+  http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.0.xsd
+http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd"
+        />
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag9_afterUp.xml b/xml/tests/testData/mover/tag9_afterUp.xml
new file mode 100644
index 0000000..0cca261
--- /dev/null
+++ b/xml/tests/testData/mover/tag9_afterUp.xml
@@ -0,0 +1,15 @@
+<components xmlns:pay="http://lufthansatechnik.com/mscoreengine"
+xmlns:core="http://jboss.com/products/seam/core"
+xmlns:persistence="http://jboss.com/products/seam/persistence"
+xmlns:framework="http://jboss.com/products/seam/framework"
+xmlns:web="http://jboss.com/products/seam/web"
+xmlns:security="http://jboss.com/products/seam/security"
+<caret>xsi:schemaLocation=
+        "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
+  http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.0.xsd
+  http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
+  http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.0.xsd
+http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:async="http://jboss.com/products/seam/async"
+/>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag_afterDown.xml b/xml/tests/testData/mover/tag_afterDown.xml
new file mode 100644
index 0000000..7a947dd
--- /dev/null
+++ b/xml/tests/testData/mover/tag_afterDown.xml
@@ -0,0 +1,5 @@
+<x>
+<b>
+    <caret><a/>
+</b>
+</x>
\ No newline at end of file
diff --git a/xml/tests/testData/mover/tag_afterUp.xml b/xml/tests/testData/mover/tag_afterUp.xml
new file mode 100644
index 0000000..dc24007
--- /dev/null
+++ b/xml/tests/testData/mover/tag_afterUp.xml
@@ -0,0 +1,5 @@
+<caret><a/>
+<x>
+<b>
+</b>
+</x>
\ No newline at end of file
diff --git a/xml/tests/testData/performance/IndentUnindent.xml b/xml/tests/testData/performance/IndentUnindent.xml
new file mode 100644
index 0000000..43d183a
--- /dev/null
+++ b/xml/tests/testData/performance/IndentUnindent.xml
@@ -0,0 +1,3361 @@
+                <?xml version="1.0" encoding="UTF-8"?>
+
+                <stopWord language="de">
+                        <word>[email protected]</word>
+                        <word>aaalso</word>
+                        <word>abbaust</word>
+                        <word>abbekommst</word>
+                        <word>abbekommt</word>
+                        <word>abbr?_ch</word>
+                        <word>abbuchung</word>
+                        <word>abdeckungen</word>
+                        <word>abdriften</word>
+                        <word>abe^hitzl</word>
+                        <word>abenteu</word>
+                        <word>abenteuerlichen</word>
+                        <word>abholari</word>
+                        <word>abholpaket</word>
+                        <word>abholt</word>
+                        <word>abh?�ngt</word>
+                        <word>abh?ren</word>
+                        <word>abkleben</word>
+                        <word>abk?_rzungen</word>
+                        <word>ablassen</word>
+                        <word>abner</word>
+                        <word>abraham</word>
+                        <word>abrechnungstakt</word>
+                        <word>abrechnungszeitraum</word>
+                        <word>abred</word>
+                        <word>abrei?_endem</word>
+                        <word>abroad</word>
+                        <word>abruf</word>
+                        <word>abschl?�gig</word>
+                        <word>abschrecken</word>
+                        <word>absendet</word>
+                        <word>absichtlich</word>
+                        <word>absoluten</word>
+                        <word>abspecken</word>
+                        <word>abspielf?�hig</word>
+                        <word>absterben</word>
+                        <word>abstrahlen</word>
+                        <word>abstrus</word>
+                        <word>abstuerzt</word>
+                        <word>absturzsicherheit</word>
+                        <word>abtun</word>
+                        <word>abundzu</word>
+                        <word>abwechselnd</word>
+                        <word>abwinken</word>
+                        <word>abw?�g</word>
+                        <word>abzahlst</word>
+                        <word>abzeichnen</word>
+                        <word>abzock</word>
+                        <word>abzutun</word>
+                        <word>accessoir</word>
+                        <word>accessori</word>
+                        <word>achim</word>
+                        <word>achtet</word>
+                        <word>acknowledg</word>
+                        <word>acm</word>
+                        <word>actionspielen</word>
+                        <word>actual</word>
+                        <word>adac</word>
+                        <word>adam</word>
+                        <word>addin</word>
+                        <word>adult</word>
+                        <word>advanx</word>
+                        <word>advic</word>
+                        <word>aehm</word>
+                        <word>aein</word>
+                        <word>aem</word>
+                        <word>aesch</word>
+                        <word>afairc</word>
+                        <word>agilemobil</word>
+                        <word>aknowledge</word>
+                        <word>albernheit</word>
+                        <word>albrecht</word>
+                        <word>aldo</word>
+                        <word>alfr</word>
+                        <word>alleinstehenden</word>
+                        <word>allenfals</word>
+                        <word>aloha</word>
+                        <word>altbekannten</word>
+                        <word>altersbedingt</word>
+                        <word>alterung</word>
+                        <word>amper</word>
+                        <word>andersen</word>
+                        <word>anderw?�rtig</word>
+                        <word>andre</word>
+                        <word>andr?c</word>
+                        <word>anerkannten</word>
+                        <word>anerkennen</word>
+                        <word>anfeinden</word>
+                        <word>anfeindung</word>
+                        <word>angeberhandi</word>
+                        <word>angedeutet</word>
+                        <word>angela</word>
+                        <word>angeleiert</word>
+                        <word>angemacht</word>
+                        <word>angemailt</word>
+                        <word>angrinst</word>
+                        <word>ankam</word>
+                        <word>anklingl</word>
+                        <word>ankopiert</word>
+                        <word>ankopplung</word>
+                        <word>anmeldest</word>
+                        <word>anmerken</word>
+                        <word>ansosnsten</word>
+                        <word>ansonsten</word>
+                        <word>ansteuerbar</word>
+                        <word>anst?pseln</word>
+                        <word>anybodi</word>
+                        <word>anzapfen</word>
+                        <word>anzustinken</word>
+                        <word>armselig</word>
+                        <word>assemblierung</word>
+                        <word>astrein</word>
+                        <word>augenkrebs</word>
+                        <word>augenweide</word>
+                        <word>autsch</word>
+                        <word>auweia</word>
+                        <word>awk</word>
+                        <word>babi</word>
+                        <word>bartsch</word>
+                        <word>beidem</word>
+                        <word>beider</word>
+                        <word>beiderseitig</word>
+                        <word>beizeiten</word>
+                        <word>beizubehalten</word>
+                        <word>bejaen</word>
+                        <word>benelux</word>
+                        <word>bern</word>
+                        <word>ber?_hmt</word>
+                        <word>beschaltet</word>
+                        <word>bescheuert</word>
+                        <word>beschleicht</word>
+                        <word>bewaldet</word>
+                        <word>bewandert</word>
+                        <word>beweglich</word>
+                        <word>bezueglich</word>
+                        <word>bezugm?glichkeiten</word>
+                        <word>be?tigt</word>
+                        <word>binder</word>
+                        <word>bird</word>
+                        <word>bischl</word>
+                        <word>bisserl</word>
+                        <word>bissig</word>
+                        <word>bon</word>
+                        <word>bonk</word>
+                        <word>bordel</word>
+                        <word>borg</word>
+                        <word>bormann</word>
+                        <word>branch</word>
+                        <word>braunarsch</word>
+                        <word>braun?�rschen</word>
+                        <word>brit</word>
+                        <word>brite</word>
+                        <word>bum</word>
+                        <word>californian</word>
+                        <word>cannstadt</word>
+                        <word>cannst?�dter</word>
+                        <word>castro</word>
+                        <word>cheap</word>
+                        <word>cheaper</word>
+                        <word>checkt</word>
+                        <word>chrisi</word>
+                        <word>dachtest</word>
+                        <word>dahingehend</word>
+                        <word>dahinrafft</word>
+                        <word>dankend</word>
+                        <word>dankt</word>
+                        <word>daruaf</word>
+                        <word>darauf</word>
+                        <word>dazugeh?renden</word>
+                        <word>dazugeh?rig</word>
+                        <word>dazugeh?rigen</word>
+                        <word>dazustellen</word>
+                        <word>dazwischenfunkt</word>
+                        <word>dazwischenliegen</word>
+                        <word>deaktivierbar</word>
+                        <word>des?fteren</word>
+                        <word>detlef</word>
+                        <word>deutet</word>
+                        <word>deutschalnd</word>
+                        <word>dildo</word>
+                        <word>draufgespielt</word>
+                        <word>draufgestossen</word>
+                        <word>draufkopiert</word>
+                        <word>drauflosschreibst</word>
+                        <word>draufmachen</word>
+                        <word>draufpacken</word>
+                        <word>drauftun</word>
+                        <word>draufzulegen</word>
+                        <word>draufzuspielen</word>
+                        <word>dreist</word>
+                        <word>dreister</word>
+                        <word>drinhatt</word>
+                        <word>drinsteckt</word>
+                        <word>dr?_ben</word>
+                        <word>dunkelheit</word>
+                        <word>dunkelt</word>
+                        <word>durchforstet</word>
+                        <word>durchgehalten</word>
+                        <word>duschen</word>
+                        <word>d?_mmer</word>
+                        <word>d?_mmlich</word>
+                        <word>d?_mmsten</word>
+                        <word>d?_nnste</word>
+                        <word>d?_rft</word>
+                        <word>d?_rftest</word>
+                        <word>eckert</word>
+                        <word>ehem</word>
+                        <word>ehhh</word>
+                        <word>einsenden</word>
+                        <word>einstein</word>
+                        <word>elektrischen</word>
+                        <word>elektromagnetisch</word>
+                        <word>elmar</word>
+                        <word>ensprechend</word>
+                        <word>ergonomischst</word>
+                        <word>erhaeltlich</word>
+                        <word>erhardt</word>
+                        <word>eventuellen</word>
+                        <word>fahrend</word>
+                        <word>fahrerei</word>
+                        <word>faltbar</word>
+                        <word>fanden</word>
+                        <word>fangen</word>
+                        <word>feinen</word>
+                        <word>feinheit</word>
+                        <word>feinheiten</word>
+                        <word>festgehalten</word>
+                        <word>festgelegten</word>
+                        <word>festgezurrt</word>
+                        <word>fidel</word>
+                        <word>firebird</word>
+                        <word>firefox</word>
+                        <word>frahlmann</word>
+                        <word>freebsd</word>
+                        <word>fritsch</word>
+                        <word>frodo</word>
+                        <word>frueh</word>
+                        <word>fuck</word>
+                        <word>fuji</word>
+                        <word>fuktion</word>
+                        <word>fummelig</word>
+                        <word>fummlig</word>
+                        <word>funkend</word>
+                        <word>f?rmlich</word>
+                        <word>f?_hle</word>
+                        <word>f?_nfer</word>
+                        <word>f?_nffach</word>
+                        <word>f?_nfte</word>
+                        <word>f?_nfthandi</word>
+                        <word>gedr?_ckhalten</word>
+                        <word>gehansel</word>
+                        <word>gehauen</word>
+                        <word>geisler</word>
+                        <word>genua</word>
+                        <word>gequirlt</word>
+                        <word>gequirlten</word>
+                        <word>gesaugten</word>
+                        <word>geschaut</word>
+                        <word>gew?hnlichen</word>
+                        <word>glatt</word>
+                        <word>gleichartig</word>
+                        <word>glock</word>
+                        <word>grell</word>
+                        <word>grellen</word>
+                        <word>grottenschlecht</word>
+                        <word>gr?_n</word>
+                        <word>guckt</word>
+                        <word>hanisch</word>
+                        <word>happahappa</word>
+                        <word>hartmann</word>
+                        <word>hauaha</word>
+                        <word>hee</word>
+                        <word>heidenreich</word>
+                        <word>heinrich</word>
+                        <word>herbert</word>
+                        <word>herrmann</word>
+                        <word>hilbert</word>
+                        <word>hinauszuschauen</word>
+                        <word>hinauszuschreiben</word>
+                        <word>hineinbekommen</word>
+                        <word>hineininterpretiert</word>
+                        <word>hineinschreiben</word>
+                        <word>hin?_ber</word>
+                        <word>hipp</word>
+                        <word>hire</word>
+                        <word>hk</word>
+                        <word>hoden</word>
+                        <word>hodensack</word>
+                        <word>hoerensagen</word>
+                        <word>homo</word>
+                        <word>h?�ndisch</word>
+                        <word>h?flicherweise</word>
+                        <word>igitt</word>
+                        <word>internem</word>
+                        <word>irendwo</word>
+                        <word>irgendwann</word>
+                        <word>irgendein</word>
+                        <word>italian</word>
+                        <word>jack</word>
+                        <word>jaensch</word>
+                        <word>jakob</word>
+                        <word>jan</word>
+                        <word>jefferson</word>
+                        <word>jens</word>
+                        <word>jetzt</word>
+                        <word>jetzigen</word>
+                        <word>joachim</word>
+                        <word>jochen</word>
+                        <word>joerg</word>
+                        <word>joga</word>
+                        <word>john</word>
+                        <word>judith</word>
+                        <word>juni</word>
+                        <word>karlheinz</word>
+                        <word>karpowitz</word>
+                        <word>karsten</word>
+                        <word>kg</word>
+                        <word>knackt</word>
+                        <word>knips</word>
+                        <word>kn?_ller</word>
+                        <word>kontra</word>
+                        <word>kurzum</word>
+                        <word>kyrillischen</word>
+                        <word>k?nnte</word>
+                        <word>k?rpereigen</word>
+                        <word>k?rperseiten</word>
+                        <word>k?_ndigt</word>
+                        <word>k?_nftig</word>
+                        <word>k?_rze</word>
+                        <word>laenger</word>
+                        <word>la?_t</word>
+                        <word>leergezogen</word>
+                        <word>lehel</word>
+                        <word>leiern</word>
+                        <word>leisem</word>
+                        <word>leo</word>
+                        <word>letzlich</word>
+                        <word>lincoln</word>
+                        <word>lisa</word>
+                        <word>macaroni</word>
+                        <word>martin</word>
+                        <word>mark</word>
+                        <word>max</word>
+                        <word>mcdonald</word>
+                        <word>merkel</word>
+                        <word>mirco</word>
+                        <word>mobi</word>
+                        <word>mobile2dai</word>
+                        <word>mobilemast</word>
+                        <word>mobilewindoof</word>
+                        <word>mobilfunkanbiet</word>
+                        <word>mobilfunkbetreib</word>
+                        <word>mobilfunkspezialisten</word>
+                        <word>mobilfunktelefon</word>
+                        <word>mobilfunkunternehmen</word>
+                        <word>mobilfunkvertrag</word>
+                        <word>mobilnetz</word>
+                        <word>mobiltel</word>
+                        <word>mobtec</word>
+                        <word>modellierung</word>
+                        <word>modemsymbol</word>
+                        <word>modemtreibern</word>
+                        <word>modemtyp</word>
+                        <word>modemverbindung</word>
+                        <word>moderiert</word>
+                        <word>modern</word>
+                        <word>modernst</word>
+                        <word>modicapagov</word>
+                        <word>modifik</word>
+                        <word>modu</word>
+                        <word>modulen</word>
+                        <word>moechten</word>
+                        <word>moechtest</word>
+                        <word>moeglichst</word>
+                        <word>mohbeil</word>
+                        <word>moher</word>
+
+                        <word>mord</word>
+                        <word>moremsg</word>
+                        <word>motorla</word>
+                        <word>motto</word>
+                        <word>mount</word>
+                        <word>movabl</word>
+                        <word>mqt23ft3mnguifqzjyaqzworj7uqqkkmlgszjn2puelfs8ms2aue2t2oluyqtzxspi4pwkhj</word>
+                        <word>msg</word>
+                        <word>msiexec</word>
+                        <word>mtc</word>
+                        <word>mtv</word>
+                        <word>muenster</word>
+                        <word>mulder</word>
+                        <word>mulitmediacard</word>
+                        <word>multibankf?�hig</word>
+                        <word>multimediaanwendungen</word>
+                        <word>multimediaplay</word>
+                        <word>musikdateien</word>
+                        <word>musikh?ren</word>
+                        <word>musktitel</word>
+                        <word>muster</word>
+                        <word>mute</word>
+                        <word>mu?_e</word>
+                        <word>[email protected]</word>
+                        <word>mvp0ihtyyr6uk2jaotjuxgt70r7rozmfkqk3ycbnj1ohqjma14vtnp2whvkktoaqdupsb61x</word>
+                        <word>mysteri?s</word>
+                        <word>m?_uesst</word>
+                        <word>m?_?glichst</word>
+                        <word>m?_???_?_test</word>
+                        <word>m?�nnerstimm</word>
+                        <word>m?�rkte</word>
+                        <word>m?�rz</word>
+                        <word>m?�use</word>
+                        <word>m?cht</word>
+                        <word>m?chtetst</word>
+                        <word>m?glichkeinen</word>
+                        <word>m?hre</word>
+                        <word>m?_helo</word>
+                        <word>m?_sst</word>
+                        <word>m?_?_test</word>
+                        <word>n'abend</word>
+                        <word>n3330</word>
+                        <word>n6210</word>
+                        <word>n910</word>
+                        <word>n917</word>
+                        <word>[email protected]</word>
+                        <word>nachbauprodukt</word>
+                        <word>nacheinand</word>
+                        <word>nacherf?_llungsschuldn</word>
+                        <word>nachgebessert</word>
+                        <word>nachgeholt</word>
+                        <word>nachgekauft</word>
+                        <word>nachgekauften</word>
+                        <word>nachgelesen</word>
+                        <word>nachgeliefert</word>
+                        <word>nachgeruestet</word>
+                        <word>nachgetragen</word>
+                        <word>nachinstallieren</word>
+                        <word>nachkonfigurieren</word>
+                        <word>nachnahm</word>
+                        <word>nachpr?_fen</word>
+                        <word>nachregeln</word>
+                        <word>nachrichteneingang</word>
+                        <word>nachrichtenmagazin</word>
+                        <word>nachrichtent?n</word>
+                        <word>nachr?_startikel</word>
+                        <word>nachschlagewerk</word>
+                        <word>nachst?bern</word>
+                        <word>nachtdienst</word>
+                        <word>nachtisch</word>
+                        <word>nachtmodu</word>
+                        <word>nachtrsigmglich</word>
+                        <word>nachudenken</word>
+                        <word>nachwei</word>
+                        <word>nachwievor</word>
+                        <word>nachwuchsprodukt</word>
+                        <word>nachzahlen</word>
+                        <word>nachzulesen</word>
+                        <word>nachzumachen</word>
+                        <word>nachzur?_sten</word>
+                        <word>nachzuschauen</word>
+                        <word>nachzusehen</word>
+                        <word>nachzuvollziehen</word>
+                        <word>nachzuw?�hlen</word>
+                        <word>nackt</word>
+                        <word>nafol</word>
+                        <word>nafop</word>
+                        <word>nagel</word>
+                        <word>nahaufnahmen</word>
+                        <word>nahegelegt</word>
+                        <word>naheliegendst</word>
+                        <word>nahem</word>
+                        <word>naher</word>
+                        <word>nahtlo</word>
+                        <word>nahu</word>
+                        <word>naiv</word>
+                        <word>name=patches_</word>
+                        <word>namenslist</word>
+                        <word>namespac</word>
+                        <word>nanana</word>
+                        <word>nanu</word>
+                        <word>nasen</word>
+                        <word>nass</word>
+                        <word>natasigan</word>
+                        <word>natimeripi</word>
+                        <word>navdvf8a1p5x8dmabzfmkp8amazzhu3noo5u57d2rwzpiazizcfkaicjskwtq86yqelpj71l</word>
+                        <word>navigationsger?�t</word>
+                        <word>navigationsprogamm</word>
+                        <word>navigationssystemen</word>
+                        <word>na?_</word>
+                        <word>nbertragen</word>
+                        <word>nde</word>
+                        <word>ndwann</word>
+                        <word>nearli</word>
+                        <word>nebel</word>
+                        <word>nebelbomben</word>
+                        <word>nebenan</word>
+                        <word>nebenbemerkungen</word>
+                        <word>nebenwirkungen</word>
+                        <word>nef</word>
+                        <word>neidisch</word>
+                        <word>nemerix</word>
+                        <word>nenen</word>
+                        <word>nenenswert</word>
+                        <word>nennspannung</word>
+                        <word>nero</word>
+                        <word>nervenfutt</word>
+                        <word>nervton</word>
+                        <word>nervt?tenden</word>
+                        <word>nerv?</word>
+                        <word>netcom</word>
+                        <word>netikett</word>
+                        <word>netiquett</word>
+                        <word>netphon</word>
+                        <word>nettigkeiten</word>
+                        <word>netzbetreibern</word>
+                        <word>netzeinstellungen</word>
+                        <word>netzfunkt</word>
+                        <word>netzintern</word>
+                        <word>netzlock</word>
+                        <word>netzseitigen</word>
+                        <word>netzstandard</word>
+                        <word>netztbetreib</word>
+                        <word>netzzugang</word>
+                        <word>neuauflag</word>
+                        <word>neubauer</word>
+                        <word>neubaustreck</word>
+                        <word>neubooten</word>
+                        <word>neueinbuchungen</word>
+                        <word>neuentwicklung</word>
+                        <word>neuesm</word>
+                        <word>neuester</word>
+                        <word>neugestarteten</word>
+                        <word>neugierig</word>
+                        <word>neustartoptionen</word>
+                        <word>neusten</word>
+                        <word>neuteil</word>
+                        <word>neuwagen</word>
+                        <word>neuwertig</word>
+                        <word>neuwertigen</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>newsgruppen</word>
+                        <word>[email protected]</word>
+                        <word>newstick</word>
+                        <word>[email protected]</word>
+                        <word>ngig</word>
+                        <word>nhar</word>
+                        <word>nicht_</word>
+                        <word>nichtanzeig</word>
+                        <word>nichtfl?_chtigen</word>
+                        <word>nichtfunktionierendem</word>
+                        <word>nichtfunktionierenden</word>
+                        <word>nichtoriginalen</word>
+                        <word>nichtsaussagenden</word>
+                        <word>nichtssagend</word>
+                        <word>nicht?_bereinstimmung</word>
+                        <word>nid</word>
+                        <word>niedergelegt</word>
+                        <word>niederl?_??ndisch</word>
+                        <word>niederl?�ndisch</word>
+                        <word>niederl?�ndischen</word>
+                        <word>niedrigen</word>
+                        <word>nietzsch</word>
+                        <word>nil</word>
+                        <word>nintendo</word>
+                        <word>nn</word>
+                        <word>nnqrkxuvsg7tobrdt0dzpvutrorgp7lyonkjkh8ipgnc5hfav0ehhdaldtixvimc12lwnp71</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>nodec</word>
+                        <word>nofal</word>
+                        <word>nofop</word>
+                        <word>nokiaartig</word>
+                        <word>nokiaerfahrenen</word>
+                        <word>nokiah?�ndl</word>
+                        <word>nokiastor</word>
+                        <word>noll</word>
+                        <word>[email protected]</word>
+                        <word>none@home</word>
+                        <word>nonplusultra</word>
+                        <word>norb</word>
+                        <word>nordenham</word>
+                        <word>normalewrweis</word>
+                        <word>normalfal</word>
+                        <word>normalprofil</word>
+                        <word>normalus</word>
+                        <word>nosaxilom</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>nossil</word>
+                        <word>notapothek</word>
+                        <word>notarzt</word>
+                        <word>notaufnahmepatienten</word>
+                        <word>notbehelf</word>
+                        <word>notieren</word>
+                        <word>notiz</word>
+                        <word>notizzettel</word>
+                        <word>novemb</word>
+                        <word>ns</word>
+                        <word>nsfs6z47vpjf9lis8gt8u9pdimutrjxy3r6r2ijukpbjlbt23v4dqpqkzbyc8j0rc31w5azo</word>
+                        <word>nste</word>
+                        <word>nt</word>
+                        <word>nu0oir6u7ecippeaehjznvswpqg80d70pwibh50kirezwyegstxsx5bincbhvssf25bnzmnc</word>
+                        <word>nuhec</word>
+                        <word>nullen</word>
+                        <word>num=20&amp;hl=de&amp;q=remote+p900+download&amp;btng=suche&amp;meta=lr%3dlang_d</word>
+                        <word>numerischen</word>
+                        <word>nummerierung</word>
+                        <word>nummernwechsel</word>
+                        <word>nummmer</word>
+                        <word>nunmehr</word>
+                        <word>nurmehr</word>
+                        <word>nutcrack</word>
+                        <word>nutzanwendern</word>
+                        <word>nutzern</word>
+                        <word>nutzerprofil</word>
+                        <word>nutzerwechsel</word>
+                        <word>nutzungen</word>
+                        <word>nutzungsabh?�ngigen</word>
+                        <word>nutzungsgewohnheiten</word>
+                        <word>nutzungsverhalten</word>
+                        <word>nutzwert</word>
+                        <word>nvkrvi83i6vl8yyjecm5kkyce1tnxp20l5rnwjesblgds9j7xuv0mmdugqei0xyy9zjtmhta</word>
+                        <word>nvsym9xe0siaceipdakacfwmtajlnyxeczswikdcd3nkbmyagmb7e9ayogece5aoovjzgqbo</word>
+                        <word>nx7000</word>
+                        <word>nyxclock</word>
+                        <word>n|b|r|f</word>
+                        <word>n?_?tig</word>
+                        <word>n?_??chste</word>
+                        <word>n?�chstem</word>
+                        <word>n?�chstgelegen</word>
+                        <word>n?�hmlich</word>
+                        <word>n?ig</word>
+                        <word>n?_rnberger</word>
+                        <word>n?_tzlichem</word>
+                        <word>n?_x</word>
+                        <word>o'keeff</word>
+                        <word>o2?-estim</word>
+                        <word>o5oipac0s96l6yrexg1jitihsqfejr5nfarrc0bzxedicnihnjnnamiffgd9qikaurmgay1d</word>
+                        <word>obendrein</word>
+                        <word>oberwellen</word>
+                        <word>obgleich</word>
+                        <word>objekten</word>
+                        <word>obligatorischen</word>
+                        <word>obskur</word>
+                        <word>oeffentlich</word>
+                        <word>oefter</word>
+                        <word>oem</word>
+                        <word>offenhat</word>
+                        <word>offtop</word>
+                        <word>og</word>
+                        <word>oginalen</word>
+                        <word>ohnedi</word>
+                        <word>okt</word>
+                        <word>oktob</word>
+                        <word>[email protected]</word>
+                        <word>oled-au?_?_endisplai</word>
+                        <word>olt</word>
+                        <word>olympu</word>
+                        <word>omi</word>
+                        <word>omin?s</word>
+                        <word>onetoucheasi</word>
+                        <word>ongo</word>
+                        <word>onkel</word>
+                        <word>ontop</word>
+                        <word>ooop</word>
+                        <word>openoffic</word>
+                        <word>openvm</word>
+                        <word>opera</word>
+                        <word>operieren</word>
+                        <word>opma</word>
+                        <word>optimistisch</word>
+                        <word>optimum</word>
+                        <word>option=com_content&task=view&id=485</word>
+                        <word>option=com_content&task=view&id=511</word>
+                        <word>optional</word>
+                        <word>optoinen</word>
+                        <word>oral</word>
+                        <word>ordentliceh</word>
+                        <word>ordin?�r</word>
+                        <word>ordnern</word>
+                        <word>ordnerpositionen</word>
+                        <word>ordnerstruktur</word>
+                        <word>ordnungsgem?�?_</word>
+                        <word>organismu</word>
+                        <word>orginalkabel</word>
+                        <word>orientierung</word>
+                        <word>orientierungshilf</word>
+                        <word>original</word>
+                        <word>originalakkublock</word>
+                        <word>originaldatei</word>
+                        <word>originalgr??_</word>
+                        <word>originaltasch</word>
+                        <word>originalvers</word>
+                        <word>orten</word>
+                        <word>orth</word>
+                        <word>ortmann</word>
+                        <word>ortsbezeichnung</word>
+                        <word>osteurop?�ischen</word>
+                        <word>osthoff</word>
+                        <word>ott</word>
+                        <word>ottxvi2fi5soby7ufrtbuziqsuiu0yfk2joohkpyguymcrg7pm06uhsqmuguourm95p0nubu</word>
+                        <word>oudtoor</word>
+                        <word>oukxgukfcsyfchqrgbqoukxgukfcsyfchqrgbqoukxgukfcsyfchqrgbqoukxgukfcsyfchq</word>
+                        <word>outback</word>
+                        <word>outbank</word>
+                        <word>outdoor</word>
+                        <word>outllok</word>
+                        <word>overlap</word>
+                        <word>overs</word>
+                        <word>ovipesmuahhpiplane80sidqixec1gncvuciersjxx7uygimtxrcqkvsahm8rmoigfsopvim</word>
+                        <word>oxygenephonemanag</word>
+                        <word>oxygensoftwar</word>
+                        <word>o|</word>
+                        <word>o|o|</word>
+                        <word>o?_-brand</word>
+                        <word>o?�</word>
+                        <word>[email protected]</word>
+                        <word>p7389</word>
+                        <word>paaren</word>
+                        <word>packet</word>
+                        <word>packung?ffnen</word>
+                        <word>paduck</word>
+                        <word>paferi</word>
+                        <word>pagal</word>
+                        <word>pai</word>
+                        <word>paint</word>
+                        <word>palmdesktop</word>
+                        <word>palmon</word>
+                        <word>pampig</word>
+                        <word>[email protected]</word>
+                        <word>panel</word>
+                        <word>panikmach</word>
+                        <word>pap</word>
+                        <word>papiertaschentuch</word>
+                        <word>pappen</word>
+                        <word>parachut</word>
+                        <word>paradox</word>
+                        <word>paranoia</word>
+                        <word>parkuhr</word>
+                        <word>partout</word>
+                        <word>passendend</word>
+                        <word>passiern</word>
+                        <word>passworteingab</word>
+                        <word>pasta</word>
+                        <word>pattern</word>
+                        <word>[email protected]</word>
+                        <word>pausen</word>
+                        <word>payment</word>
+                        <word>pcsync</word>
+                        <word>pda??</word>
+                        <word>pdid=hz514&catid=4013&rate=5&vid=913</word>
+                        <word>pdp</word>
+                        <word>pdu</word>
+                        <word>pedahepanu</word>
+                        <word>[email protected]</word>
+                        <word>peiffer</word>
+                        <word>penefor</word>
+                        <word>penetrant</word>
+                        <word>peon</word>
+                        <word>percal</word>
+                        <word>perfect</word>
+                        <word>performanceproblem</word>
+                        <word>perl</word>
+                        <word>perplex</word>
+                        <word>persoenlich</word>
+                        <word>perspekt</word>
+                        <word>perversl</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>petir</word>
+                        <word>peuss</word>
+                        <word>pev</word>
+                        <word>pevapagol</word>
+                        <word>pfabigan</word>
+                        <word>pferd</word>
+                        <word>[email protected]</word>
+                        <word>pflege</word>
+                        <word>pflegen</word>
+                        <word>pflegeresourcen</word>
+                        <word>pflichten</word>
+                        <word>pflock</word>
+                        <word>pforzheim</word>
+                        <word>pfuschig</word>
+                        <word>pf?rtner</word>
+                        <word>pgp-schl???_ssel</word>
+                        <word>ph</word>
+                        <word>philosoph</word>
+                        <word>philosophi</word>
+                        <word>phne</word>
+                        <word>phoneid=328&countryid=13&bearerid=5&contractid=191&sitelanguageid=124&captchaenabled=true&step=netwo</word>
+                        <word>photo</word>
+                        <word>phun</word>
+                        <word>physic</word>
+                        <word>physiologisch</word>
+                        <word>pickel</word>
+                        <word>pictbridg</word>
+                        <word>piepser</word>
+                        <word>piepton</word>
+                        <word>[email protected]</word>
+                        <word>pillen</word>
+                        <word>pinior</word>
+                        <word>pintan</word>
+                        <word>pipelin</word>
+                        <word>pitumateho</word>
+                        <word>pivep</word>
+                        <word>pjsacvli3feypkiklqzzxukpiiofm55puqojfztmuqthseakm3e0wwd6kkdirisyhnmapha</word>
+                        <word>plackerei</word>
+                        <word>plan</word>
+                        <word>planki</word>
+                        <word>plantron</word>
+                        <word>planungen</word>
+                        <word>plastikbeutel</word>
+                        <word>plastikk?�fig</word>
+                        <word>[email protected]</word>
+                        <word>platzgr?_nden</word>
+                        <word>platzmangel</word>
+                        <word>plauzi</word>
+                        <word>[email protected]</word>
+                        <word>playlisten</word>
+                        <word>pleitewel</word>
+                        <word>plenkt</word>
+                        <word>pluspunkt</word>
+                        <word>[email protected]</word>
+                        <word>pl?tzlichen</word>
+                        <word>po</word>
+                        <word>pocekesot</word>
+                        <word>pocketword</word>
+                        <word>pogorzelski</word>
+                        <word>pointer</word>
+                        <word>pointiert</word>
+                        <word>polchi</word>
+                        <word>polemik</word>
+                        <word>pool</word>
+                        <word>poppen</word>
+                        <word>popper</word>
+                        <word>poppt</word>
+                        <word>popup</word>
+                        <word>por</word>
+                        <word>portabl</word>
+                        <word>porti</word>
+                        <word>portugisisch</word>
+                        <word>[email protected]</word>
+                        <word>postadressen</word>
+                        <word>poster</word>
+                        <word>postid=149729#post149729</word>
+                        <word>postit</word>
+                        <word>potenti</word>
+                        <word>potentiel</word>
+                        <word>potenz</word>
+                        <word>potenziel</word>
+                        <word>potxdmniezrke9z86v8ar13iqrzwb1jlnjdyebgsamu97kkpbjrm1fdruodu5yn86vatmccu</word>
+                        <word>powerbook</word>
+                        <word>powerleucht</word>
+                        <word>poxenuhod</word>
+                        <word>pp</word>
+                        <word>ppc2002</word>
+                        <word>praechtig</word>
+                        <word>[email protected]</word>
+                        <word>praesentieren</word>
+                        <word>praktikabel</word>
+                        <word>praktischerweis</word>
+                        <word>praxisfremd</word>
+                        <word>praxistauglich</word>
+                        <word>praxistest</word>
+                        <word>preced</word>
+                        <word>preinstal</word>
+                        <word>preisgef?_g</word>
+                        <word>preisg?_nstiger</word>
+                        <word>preisobergrenz</word>
+                        <word>preisskala</word>
+                        <word>preisverd?�chtig</word>
+                        <word>preiszugeben</word>
+                        <word>preller</word>
+                        <word>prepaidkarten</word>
+                        <word>prepaidpacks_</word>
+                        <word>presst</word>
+                        <word>pretoria</word>
+                        <word>prevent</word>
+                        <word>previous</word>
+                        <word>prg</word>
+                        <word>prgcxc125873_eu_1_a</word>
+                        <word>price</word>
+                        <word>prickelnd</word>
+                        <word>primatenabteilung</word>
+                        <word>prinzp</word>
+                        <word>prite</word>
+                        <word>privatbereich</word>
+                        <word>privatdaten</word>
+                        <word>privatisierung</word>
+                        <word>privilegien</word>
+                        <word>probem</word>
+                        <word>products_id=1854</word>
+                        <word>produktgenerationen</word>
+                        <word>produktionsdatum</word>
+                        <word>produktionsfehl</word>
+                        <word>produktionsseri</word>
+                        <word>produktmanag</word>
+                        <word>produktseit</word>
+                        <word>produktsuch</word>
+                        <word>professionellen</word>
+                        <word>proffesionel</word>
+                        <word>profilanweisung</word>
+                        <word>profilverwaltung</word>
+                        <word>profil?�nderungen</word>
+                        <word>profitabel</word>
+                        <word>profitorientiert</word>
+                        <word>programmanbiet</word>
+                        <word>programmdownload</word>
+                        <word>programmierkenntniss</word>
+                        <word>programmiersprach</word>
+                        <word>programmmen?_punkt</word>
+                        <word>prominent</word>
+                        <word>promis</word>
+                        <word>prommer</word>
+                        <word>proper</word>
+                        <word>properit?_??r</word>
+                        <word>properti</word>
+                        <word>proport</word>
+                        <word>propos</word>
+                        <word>proprietaer</word>
+                        <word>propriet?�r</word>
+                        <word>propriet?�rem</word>
+                        <word>protect</word>
+                        <word>protocolstack</word>
+                        <word>protokolldatei</word>
+                        <word>protokollieren</word>
+                        <word>protokolllierungsoptionen</word>
+                        <word>providerabh?�ngig</word>
+                        <word>provisioniert</word>
+                        <word>provoziert</word>
+                        <word>prozesskostenrechnung</word>
+                        <word>prozessoren</word>
+                        <word>prozessorlast</word>
+                        <word>prozessorleistung</word>
+                        <word>pr?�sent</word>
+                        <word>pr?�sentiert</word>
+                        <word>pr?�zise</word>
+                        <word>pr?_fling</word>
+                        <word>pr?_fsumm</word>
+                        <word>psy</word>
+                        <word>ptt</word>
+                        <word>puffer</word>
+                        <word>puh</word>
+                        <word>pull</word>
+                        <word>pulsung</word>
+                        <word>punkten</word>
+                        <word>punktet</word>
+                        <word>pure</word>
+                        <word>purer</word>
+                        <word>putzen</word>
+                        <word>pw</word>
+                        <word>pxa</word>
+                        <word>python</word>
+                        <word>p|e|c|m|s|o|d|a|u|v</word>
+                        <word>q=29+euro+group%3ade.comm.geraete.mobil.siemens&qt_s=such</word>
+                        <word>qd</word>
+                        <word>qdgt9kupbxbqrqucpideepnmlhgfemu0ui6di1iiokpwgfksrqznkehhpnilyyp1flbxtsf</word>
+                        <word>qkjk3lyb0pfezf2hoqejdztuglz9485ofau0fsm6uepeeksownywxxnsciuqfts072pfwqv8</word>
+                        <word>qrifcn0ovrihirdrcij7cciaiwcgtzwthfqyaile5egixmszjon24on7clokyzrho5prkxaw</word>
+                        <word>qrwz2yaahemacacdcpq0wdne0on27vnqzotjaemujqpqadnvnpwspuyyplxkeadnfbay0n9j</word>
+                        <word>qtech</word>
+                        <word>quadantenn</word>
+                        <word>qualiti</word>
+                        <word>qualit?_??t</word>
+                        <word>qualit?�tsstufen</word>
+                        <word>qualit?�tsverlust</word>
+                        <word>quarter</word>
+                        <word>quengeln</word>
+                        <word>quergelesen</word>
+                        <word>quickbutton</word>
+                        <word>quickoffic</word>
+                        <word>quicksync</word>
+                        <word>quittiet</word>
+                        <word>quittung</word>
+                        <word>quittungst?n</word>
+                        <word>quizfrag</word>
+                        <word>quoten</word>
+                        <word>qu?�kig</word>
+                        <word>qyrsypbnjm8xokdmakqvaskugnspnrxuabpsicak2yq6gnip7t3dzuiwoqaqtij0odikz2qi</word>
+                        <word>[email protected]</word>
+                        <word>r1j002</word>
+                        <word>r2ai</word>
+                        <word>r2ay004</word>
+                        <word>r310</word>
+                        <word>r520</word>
+                        <word>ra</word>
+                        <word>ra0iakyimlidjnadkgzohftshvbfsodnaaje0yyekuvbheh1rx8goakgkpjikmlwfzpqxix</word>
+                        <word>[email protected]</word>
+                        <word>rad</word>
+                        <word>radik</word>
+                        <word>radiofrequenzen</word>
+                        <word>radion</word>
+                        <word>radiostream</word>
+                        <word>radiu</word>
+                        <word>raimon</word>
+                        <word>[email protected]</word>
+                        <word>rais</word>
+                        <word>rajah</word>
+                        <word>ral</word>
+                        <word>ralav</word>
+                        <word>ralli</word>
+                        <word>ralo</word>
+                        <word>rambo</word>
+                        <word>randbemerkung</word>
+                        <word>randomli</word>
+                        <word>rane</word>
+                        <word>rang</word>
+                        <word>rapememet</word>
+                        <word>rapid</word>
+                        <word>rare</word>
+                        <word>rasend</word>
+                        <word>raskin</word>
+                        <word>rassistischen</word>
+                        <word>rateb</word>
+                        <word>ratschlaeg</word>
+                        <word>ratten</word>
+                        <word>raufbringen</word>
+                        <word>rausbekommt</word>
+                        <word>rausbringt</word>
+                        <word>rauscht</word>
+                        <word>rausgeholt</word>
+                        <word>rausgekomen</word>
+                        <word>rausgesucht</word>
+                        <word>rauslesen</word>
+                        <word>rausreissen</word>
+                        <word>rauszufinden</word>
+                        <word>rautetast</word>
+                        <word>rd</word>
+                        <word>rde</word>
+                        <word>rden</word>
+                        <word>reaktivierung</word>
+                        <word>realem</word>
+                        <word>realisierbar</word>
+                        <word>realit?�ten</word>
+                        <word>realplay</word>
+                        <word>rebootfunkt</word>
+                        <word>recheckschwingungungen</word>
+                        <word>rechenzentren</word>
+                        <word>recherch</word>
+                        <word>rechnenexempel</word>
+                        <word>rechnern</word>
+                        <word>rechtm?�?_igen</word>
+                        <word>rechtsanwalt</word>
+                        <word>rechtschreibfehl</word>
+                        <word>rechtswidrigen</word>
+                        <word>rechtzeititg</word>
+                        <word>recipi</word>
+                        <word>recognit</word>
+                        <word>redirect</word>
+                        <word>redmond</word>
+                        <word>redund</word>
+                        <word>referenz</word>
+                        <word>reflect</word>
+                        <word>reflexartig</word>
+                        <word>refus</word>
+                        <word>regalen</word>
+                        <word>regardless</word>
+                        <word>regelmaessig</word>
+                        <word>regelrecht</word>
+                        <word>regelst</word>
+                        <word>regelt</word>
+                        <word>regelungen</word>
+                        <word>regen</word>
+                        <word>region</word>
+                        <word>registr</word>
+                        <word>registriercod</word>
+                        <word>regulierung</word>
+                        <word>regul?�ren</word>
+                        <word>reiehenfolg</word>
+                        <word>reifen</word>
+                        <word>reindeer</word>
+                        <word>reinfal</word>
+                        <word>reingefallen</word>
+                        <word>reingesteckt</word>
+                        <word>reingetaucht</word>
+                        <word>reinigung</word>
+                        <word>reinimplementiert</word>
+                        <word>reinkam</word>
+                        <word>reinkommen</word>
+                        <word>reinkommt</word>
+                        <word>reinkriegen</word>
+                        <word>reinlauf</word>
+                        <word>reinmachen</word>
+                        <word>reinmachst</word>
+                        <word>reinrufen</word>
+                        <word>reinstecken</word>
+                        <word>reinst?pseln</word>
+                        <word>reintun</word>
+                        <word>reinzuf?�llig</word>
+                        <word>reis</word>
+                        <word>reiser</word>
+                        <word>reissen</word>
+                        <word>reiter</word>
+                        <word>reizt</word>
+                        <word>reject</word>
+                        <word>reklamationen</word>
+                        <word>rel</word>
+                        <word>relat</word>
+                        <word>relevant</word>
+                        <word>reliabl</word>
+                        <word>reluct</word>
+                        <word>rememb</word>
+                        <word>removeaempir</word>
+                        <word>removethi</word>
+                        <word>renesa</word>
+                        <word>rennt</word>
+                        <word>renommierten</word>
+                        <word>reparaturdienst</word>
+                        <word>reparaturkennung</word>
+                        <word>reparaturoptionen</word>
+                        <word>reparaturvertrag</word>
+                        <word>reparier</word>
+                        <word>repertoir</word>
+                        <word>replizieren</word>
+                        <word>replyto</word>
+                        <word>reppenhagen</word>
+                        <word>request</word>
+                        <word>reserveger?�t</word>
+                        <word>reservierung</word>
+                        <word>respond</word>
+                        <word>respons</word>
+                        <word>ressourcen</word>
+                        <word>restlaufzeit</word>
+                        <word>restriktiv</word>
+                        <word>result</word>
+                        <word>resultat</word>
+                        <word>resum</word>
+                        <word>retten</word>
+                        <word>reuss</word>
+                        <word>reveal</word>
+                        <word>revolution?�r</word>
+                        <word>rewind</word>
+                        <word>[email protected]</word>
+                        <word>rg7qdwnttslvvpjqd1bgv6xrcnaqkfhycoainu7f3dkhrhebuy12yk1hzottkxsppteq7wgu</word>
+                        <word>rgbt9ghocrhippcfyeiam275kccafslk2imnw7efzainowx5eaqccpslju30d0a7radnaksz</word>
+                        <word>rhode</word>
+                        <word>ric</word>
+                        <word>richt</word>
+                        <word>richtigem</word>
+                        <word>richtigzustellen</word>
+                        <word>riesenaufwand</word>
+                        <word>riexing</word>
+                        <word>rigaweg</word>
+                        <word>rio</word>
+                        <word>riskieren</word>
+                        <word>[email protected]</word>
+                        <word>rn</word>
+                        <word>rnfeind</word>
+                        <word>ro</word>
+                        <word>roamingbedingungen</word>
+                        <word>robin</word>
+                        <word>rofidacima</word>
+                        <word>rogramm</word>
+                        <word>rohotanimir</word>
+                        <word>rollbar</word>
+                        <word>rollt</word>
+                        <word>rolo</word>
+                        <word>roof</word>
+                        <word>ropamumetol</word>
+                        <word>rose</word>
+                        <word>rosig</word>
+                        <word>rosina</word>
+                        <word>rotflbtc</word>
+                        <word>rotflol</word>
+                        <word>roth</word>
+                        <word>rotwein</word>
+                        <word>routenberechnung</word>
+                        <word>routenplan</word>
+                        <word>routinem?�?_ig</word>
+                        <word>routiniert</word>
+                        <word>rovehifa</word>
+                        <word>rpfqrmgoiq41wnqs28a9kgznukq9rayxdaj0rpi7r4nqftiwisbx704i5jtokbkkh3iliymt</word>
+                        <word>rs232</word>
+                        <word>rsap</word>
+                        <word>ru1</word>
+                        <word>ruckizucki</word>
+                        <word>ruebergekommen</word>
+                        <word>rueckfrag</word>
+                        <word>rueckmeldungen</word>
+                        <word>rueckrufen</word>
+                        <word>rufannahmeverz?gerung</word>
+                        <word>ruflist</word>
+                        <word>rufnummernuebermittlung</word>
+                        <word>rufnummernunterdr?_ckung</word>
+                        <word>rufst</word>
+                        <word>ruftonlautst?�rk</word>
+                        <word>ruft?_?n</word>
+                        <word>ruh</word>
+                        <word>ruhigen</word>
+                        <word>ruhotinemar</word>
+                        <word>ruinieren</word>
+                        <word>ruin?s</word>
+                        <word>rule</word>
+                        <word>rumdr?_cken</word>
+                        <word>rumfliegen</word>
+                        <word>rumfliegt</word>
+                        <word>rumforschen</word>
+                        <word>rumgefummelt</word>
+                        <word>rumgelaufen</word>
+                        <word>rumlaufen</word>
+                        <word>rumprobieren</word>
+                        <word>rumq?�ken</word>
+                        <word>rumspazieren</word>
+                        <word>rumspielst</word>
+                        <word>rumstehen</word>
+                        <word>rumzuspinnen</word>
+                        <word>rumzu?�rgern</word>
+                        <word>runderneurten</word>
+                        <word>rundfunkbereich</word>
+                        <word>runterf?�llt</word>
+                        <word>runtergerittenen</word>
+                        <word>runtergesicherten</word>
+                        <word>runterlad</word>
+                        <word>runterspuelen</word>
+                        <word>russichen</word>
+                        <word>rut</word>
+                        <word>rv</word>
+                        <word>rxwkmegdupeqwwpdoi2jiijnhpqt7vhnaj0pgwpisvlaiqdfkxmanvmgbe0regpbfjbwflsm</word>
+                        <word>r?_??tsel</word>
+                        <word>r?�nder</word>
+                        <word>r?�uberpistolen</word>
+                        <word>r?�umt</word>
+                        <word>r?delt</word>
+                        <word>r?ntgenstrahlung</word>
+                        <word>r?_ckdeckel</word>
+                        <word>r?_cken</word>
+                        <word>r?_ckgelieferten</word>
+                        <word>r?_ckg?�nfig</word>
+                        <word>r?_ckg?�ngig</word>
+                        <word>r?_ckl?�ufer</word>
+                        <word>r?_ckruf</word>
+                        <word>r?_cksendung</word>
+                        <word>r?_ckspielen</word>
+                        <word>r?_cktritt</word>
+                        <word>r?_sten</word>
+                        <word>s&e-pack</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>s200</word>
+                        <word>s25@nce</word>
+                        <word>s288</word>
+                        <word>s65er</word>
+                        <word>s65v</word>
+                        <word>s80</word>
+                        <word>[email protected]</word>
+                        <word>s=&amp;threadid=134246&amp;pagenumber=4</word>
+                        <word>s=&amp;threadid=166047&amp;highlight=pushtotalk</word>
+                        <word>s=&amp;threadid=167413</word>
+                        <word>sa</word>
+                        <word>sabin</word>
+                        <word>sachdienlich</word>
+                        <word>sachlichen</word>
+                        <word>sachm?_??ngelhaftung</word>
+                        <word>sachm?�ngelhaftung</word>
+                        <word>sadasacowot</word>
+                        <word>sadismu</word>
+                        <word>saemtlich</word>
+                        <word>saetzen</word>
+                        <word>safarigr?_n</word>
+                        <word>safe</word>
+                        <word>sahen</word>
+                        <word>sahra</word>
+                        <word>sakura</word>
+                        <word>sal</word>
+                        <word>saldenabfrag</word>
+                        <word>saldo</word>
+                        <word>salopp</word>
+                        <word>salv</word>
+                        <word>samenzellen</word>
+                        <word>samimogemun</word>
+                        <word>sampl</word>
+                        <word>samt</word>
+                        <word>sanddisk</word>
+                        <word>sandisc</word>
+                        <word>sanduhr</word>
+                        <word>sanfter</word>
+                        <word>sank</word>
+                        <word>sarati</word>
+                        <word>sarek</word>
+                        <word>sash</word>
+                        <word>sasirolavo</word>
+                        <word>satelliten</word>
+                        <word>[email protected]</word>
+                        <word>sattsam</word>
+                        <word>sauberen</word>
+                        <word>sauerei</word>
+                        <word>sauerkraut</word>
+                        <word>saufen</word>
+                        <word>saugnapf</word>
+                        <word>savvi</word>
+                        <word>scene</word>
+                        <word>schablon</word>
+                        <word>[email protected]</word>
+                        <word>schaltelektronik</word>
+                        <word>schand</word>
+                        <word>scharfstellen</word>
+                        <word>schatten</word>
+                        <word>schatz</word>
+                        <word>schatzamt</word>
+                        <word>scheib</word>
+                        <word>scheif</word>
+                        <word>scheitern</word>
+                        <word>schema</word>
+                        <word>scheme</word>
+                        <word>schichten</word>
+                        <word>schichtplan</word>
+                        <word>schieben</word>
+                        <word>schiebeschalt</word>
+                        <word>schien</word>
+                        <word>schiessen</word>
+                        <word>schiesst</word>
+                        <word>schie?_en</word>
+                        <word>schildert</word>
+                        <word>schili</word>
+                        <word>schimpft</word>
+                        <word>schlaf</word>
+                        <word>schlage</word>
+                        <word>schlagen</word>
+                        <word>schlagwaff</word>
+                        <word>schleifen</word>
+                        <word>schleifpapi</word>
+                        <word>schlichtus</word>
+                        <word>schltet</word>
+                        <word>schlug</word>
+                        <word>schlu?_</word>
+                        <word>schl?�ge</word>
+                        <word>schl?_sse</word>
+                        <word>schmalbr?_stig</word>
+                        <word>schmalhof</word>
+                        <word>schmecken</word>
+                        <word>schmetterling</word>
+                        <word>schmunzeln</word>
+                        <word>schmutzig</word>
+                        <word>schnap</word>
+                        <word>schnappsch?_ss</word>
+                        <word>schneckenhaft</word>
+                        <word>schneiden</word>
+                        <word>schnellen</word>
+                        <word>schnellst</word>
+                        <word>schnickschnackspielzeug</word>
+                        <word>schnipp</word>
+                        <word>schnittstellenbeschaffenheit</word>
+                        <word>schnitzer</word>
+                        <word>schnupp</word>
+                        <word>schnurlosen</word>
+                        <word>schnurlostelefon</word>
+                        <word>schn?selig</word>
+                        <word>schn?selniveau</word>
+                        <word>schob</word>
+                        <word>schoben</word>
+                        <word>schomal</word>
+                        <word>schonbez?_g</word>
+                        <word>schonn</word>
+                        <word>schooeeeen</word>
+                        <word>schraubenzieh</word>
+                        <word>schraubst</word>
+                        <word>schreckt</word>
+                        <word>schrei</word>
+                        <word>schreibend</word>
+                        <word>schreibrecht</word>
+                        <word>schreibtisch</word>
+                        <word>schreibtischlad</word>
+                        <word>schreibvorgang</word>
+                        <word>schrein</word>
+                        <word>schreitet</word>
+                        <word>schriftarten</word>
+                        <word>schriftbild</word>
+                        <word>schriftlich</word>
+                        <word>schriftstueck</word>
+                        <word>schriftverkehr</word>
+                        <word>schriftz?_gen</word>
+                        <word>schrill</word>
+                        <word>schrottig</word>
+                        <word>schr?_?der</word>
+                        <word>schr?�nkt</word>
+                        <word>schuenemann</word>
+                        <word>schuf</word>
+                        <word>schultern</word>
+                        <word>schultz</word>
+                        <word>schutzklausel</word>
+                        <word>schutzsoftwar</word>
+                        <word>schwachpunkt</word>
+                        <word>schwachsinnigen</word>
+                        <word>schwaecher</word>
+                        <word>[email protected]</word>
+                        <word>schwankend</word>
+                        <word>schwarzem</word>
+                        <word>schwarzfunken</word>
+                        <word>schwarzkamp</word>
+                        <word>schwedisch</word>
+                        <word>schweif</word>
+                        <word>schweigend</word>
+                        <word>schwerwiegend</word>
+                        <word>schwerwiegendem</word>
+                        <word>schwiegervat</word>
+                        <word>schwierigeren</word>
+                        <word>schw?�cher</word>
+                        <word>schw?�rmen</word>
+                        <word>schw?ren</word>
+                        <word>sch?_?n</word>
+                        <word>sch?_?ne</word>
+                        <word>sch?�digt</word>
+                        <word>sch?�digung</word>
+                        <word>sch?�dlich</word>
+                        <word>sch?�rfe</word>
+                        <word>sch?neren</word>
+                        <word>sch?nreden</word>
+                        <word>sch?_tze</word>
+                        <word>sch?_tzt</word>
+                        <word>scientif</word>
+                        <word>scnr???_</word>
+                        <word>scotland</word>
+                        <word>screw</word>
+                        <word>scripten</word>
+                        <word>scriptfehl</word>
+                        <word>sculli</word>
+                        <word>sdc_p=po1026937fcl0s5mnu&</word>
+                        <word>sdp</word>
+                        <word>sechst</word>
+                        <word>sed</word>
+                        <word>segeln</word>
+                        <word>segen</word>
+                        <word>sehnend</word>
+                        <word>sehnsucht</word>
+                        <word>seinerzeit</word>
+                        <word>seither</word>
+                        <word>seitlch</word>
+                        <word>seitlich</word>
+                        <word>sekundengenau</word>
+                        <word>sekund?�r</word>
+                        <word>selbigen</word>
+                        <word>selbsternannten</word>
+                        <word>selbstklebend</word>
+                        <word>selbstleuchtend</word>
+                        <word>selbstst?�ndig</word>
+                        <word>selbsttest</word>
+                        <word>selbstverst?�ndlichkeiten</word>
+                        <word>selektieren</word>
+                        <word>selfdestruct</word>
+                        <word>seltenen</word>
+                        <word>seltsamsten</word>
+                        <word>semaf</word>
+                        <word>semamago</word>
+                        <word>semiotik</word>
+                        <word>semk</word>
+                        <word>sendeeinheit</word>
+                        <word>sendefrequenz</word>
+                        <word>sendend</word>
+                        <word>sendenden</word>
+                        <word>sendest</word>
+                        <word>sendest?�rk</word>
+                        <word>sendeversuch</word>
+                        <word>senior</word>
+                        <word>sensor</word>
+                        <word>sent</word>
+                        <word>sequenc</word>
+                        <word>serienger?�t</word>
+                        <word>serienm?�?_ig</word>
+                        <word>serva</word>
+                        <word>serversynchronis</word>
+                        <word>[email protected]</word>
+                        <word>setemoi</word>
+                        <word>sexualit?�t</word>
+                        <word>sgxujhrs2ytyaqcggekyywyuqiiauehskbajixtgia5owzwgsoojhlgc96ikhvijmeudirj6</word>
+                        <word>shield</word>
+                        <word>ship</word>
+                        <word>shoppen</word>
+                        <word>showtopic=9263&amp;hl=</word>
+                        <word>shutdown</word>
+                        <word>si</word>
+                        <word>sic</word>
+                        <word>sicherer</word>
+                        <word>sicherheitseinstellungen</word>
+                        <word>sicherheitskopien</word>
+                        <word>sicherheitskritisch</word>
+                        <word>sicherheitsvorkehrungen</word>
+                        <word>sicherungsadatei</word>
+                        <word>sicherungsdatei</word>
+                        <word>sicherungsdefinitionen</word>
+                        <word>sicherungsfunkt</word>
+                        <word>sicherungskopien</word>
+                        <word>sicherungsvorgang</word>
+                        <word>sichtbaren</word>
+                        <word>sichtverbindung</word>
+                        <word>sichtweis</word>
+                        <word>sid</word>
+                        <word>sidimecer</word>
+                        <word>sidiseba</word>
+                        <word>siedl</word>
+                        <word>siegel</word>
+                        <word>siem</word>
+                        <word>siemensger?_??t</word>
+                        <word>siemensmodel</word>
+                        <word>siemensseit</word>
+                        <word>siemensusb</word>
+                        <word>siemesn</word>
+                        <word>signalisierungsprofil</word>
+                        <word>sihc</word>
+                        <word>silli</word>
+                        <word>silosoc</word>
+                        <word>simbian</word>
+                        <word>simple_</word>
+                        <word>simplifi</word>
+                        <word>simplyfi</word>
+                        <word>simulieren</word>
+                        <word>simuliert</word>
+                        <word>simultan</word>
+                        <word>sinnentleerung</word>
+                        <word>sinnfrei</word>
+                        <word>sinnfreiheit</word>
+                        <word>sinnlosen</word>
+                        <word>sinuswellen</word>
+                        <word>sinvol</word>
+                        <word>sip</word>
+                        <word>sir</word>
+                        <word>sirabimecix</word>
+                        <word>sirenent?nen</word>
+                        <word>siteribego</word>
+                        <word>sitten</word>
+                        <word>sitzung</word>
+                        <word>sitzungen</word>
+                        <word>sk</word>
+                        <word>skepsi</word>
+                        <word>skeptisch</word>
+                        <word>skin</word>
+                        <word>[email protected]</word>
+                        <word>skript</word>
+                        <word>skurril</word>
+                        <word>sl150</word>
+                        <word>sl1color</word>
+                        <word>sl42</word>
+                        <word>sl44</word>
+                        <word>sl740</word>
+                        <word>slavischen</word>
+                        <word>sleep</word>
+                        <word>slide</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>slx</word>
+                        <word>smarphon</word>
+                        <word>smartkei</word>
+                        <word>smash</word>
+                        <word>smd</word>
+                        <word>sms</word>
+                        <word>snack</word>
+                        <word>snap</word>
+                        <word>snappermail</word>
+                        <word>snipe</word>
+                        <word>snipl</word>
+                        <word>snipp</word>
+                        <word>so'n</word>
+                        <word>soalng</word>
+                        <word>socamoxelag</word>
+                        <word>socket</word>
+                        <word>soda</word>
+                        <word>sodisibib</word>
+                        <word>sofortaustausch</word>
+                        <word>softwareabsturz</word>
+                        <word>softwarebasi</word>
+                        <word>softwaredownload</word>
+                        <word>softwaremaessig</word>
+                        <word>softwarest?�nden</word>
+                        <word>softwarevorschl?�gen</word>
+                        <word>software?�nderung</word>
+                        <word>sonderausstattung</word>
+                        <word>sonderedit</word>
+                        <word>sondermuel</word>
+                        <word>sonderprofil</word>
+                        <word>sonderz?_gen</word>
+                        <word>sonnig</word>
+                        <word>sonstigen</word>
+                        <word>sonstwo</word>
+                        <word>soost</word>
+                        <word>sore</word>
+                        <word>sorg</word>
+                        <word>soundwiedergab</word>
+                        <word>souvenir</word>
+                        <word>sowet</word>
+                        <word>soxiven</word>
+                        <word>soziologisch</word>
+                        <word>sozusagen</word>
+                        <word>so????n</word>
+                        <word>sp$</word>
+                        <word>space</word>
+                        <word>spaet</word>
+                        <word>spafford</word>
+                        <word>spalten</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>spanish</word>
+                        <word>spannend</word>
+                        <word>spannungsmess</word>
+                        <word>spannungsteil</word>
+                        <word>sparst</word>
+                        <word>spassvol</word>
+                        <word>spazieren</word>
+                        <word>spa?_?_</word>
+                        <word>[email protected]</word>
+                        <word>specifi</word>
+                        <word>speicherbereich</word>
+                        <word>speicherfress</word>
+                        <word>speicherkapazit?�t</word>
+                        <word>speichermanag</word>
+                        <word>speicherort</word>
+                        <word>speichkart</word>
+                        <word>spelter</word>
+                        <word>spermien</word>
+                        <word>sperren</word>
+                        <word>spezialfal</word>
+                        <word>spezialforen</word>
+                        <word>spezialhalterung</word>
+                        <word>spezialvorschrift</word>
+                        <word>speziellem</word>
+                        <word>spezifikationen</word>
+                        <word>spezifisch</word>
+                        <word>spezifischen</word>
+                        <word>spiegel</word>
+                        <word>spiegelt</word>
+                        <word>spielregeln</word>
+                        <word>spigt</word>
+                        <word>spionag</word>
+                        <word>spitzenprodukt</word>
+                        <word>split</word>
+                        <word>splitter</word>
+                        <word>spontanen</word>
+                        <word>sport</word>
+                        <word>spottprei</word>
+                        <word>sprachfluss</word>
+                        <word>sprachkan</word>
+                        <word>sprachraum</word>
+                        <word>sprachvers</word>
+                        <word>sprachverst?�ndigung</word>
+                        <word>spread</word>
+                        <word>sprechanlag</word>
+                        <word>sprechzeit</word>
+                        <word>spritzwasserdichtung</word>
+                        <word>spritzwasserfest</word>
+                        <word>spr?_chen</word>
+                        <word>spr?_nge</word>
+                        <word>spuk</word>
+                        <word>spuren</word>
+                        <word>spyra</word>
+                        <word>spywar</word>
+                        <word>spzifisch</word>
+                        <word>sp?_??tsommer</word>
+                        <word>sp?�tsommer</word>
+                        <word>sp?_rbar</word>
+                        <word>sseatuabuhtict2half5l4op7zegmdqycsgwjyu4mkdyqghztktin1q3tfbzsersguqpntcz</word>
+                        <word>staedten</word>
+                        <word>staedter</word>
+                        <word>stahlbeton</word>
+                        <word>stahlplatt</word>
+                        <word>stammen</word>
+                        <word>stammkund</word>
+                        <word>stammten</word>
+                        <word>standardakku</word>
+                        <word>standardbauformen</word>
+                        <word>standardbildschirm</word>
+                        <word>standardisierungsgremium</word>
+                        <word>standardm?�ssig</word>
+                        <word>standardnumm</word>
+                        <word>standardpiepst?n</word>
+                        <word>standardspiel</word>
+                        <word>standardtext</word>
+                        <word>standardton</word>
+                        <word>standardumleitungsnumm</word>
+                        <word>standardverhalten</word>
+                        <word>standardvorgab</word>
+                        <word>standbild</word>
+                        <word>standbyverbrauch</word>
+                        <word>standort</word>
+                        <word>standpunkt</word>
+                        <word>stang</word>
+                        <word>starken</word>
+                        <word>starker</word>
+                        <word>starr</word>
+                        <word>startguthaben</word>
+                        <word>startup</word>
+                        <word>stati</word>
+                        <word>station?�r</word>
+                        <word>statisch</word>
+                        <word>statistisch</word>
+                        <word>stattdessen</word>
+                        <word>stattfindend</word>
+                        <word>stattgefunden</word>
+                        <word>statusberichten</word>
+                        <word>statusleist</word>
+                        <word>statusmeldung</word>
+                        <word>staubk?rnern</word>
+                        <word>std</word>
+                        <word>steel</word>
+                        <word>[email protected]</word>
+                        <word>stehr</word>
+                        <word>steig</word>
+                        <word>steigen</word>
+                        <word>steigst</word>
+                        <word>steinalt</word>
+                        <word>steinschlag</word>
+                        <word>stelo</word>
+                        <word>stereoheadset</word>
+                        <word>stern</word>
+                        <word>sternchen</word>
+                        <word>sternen</word>
+                        <word>sternenbild</word>
+                        <word>stesa</word>
+                        <word>steuererklaerung</word>
+                        <word>steuert</word>
+                        <word>steuerzeichen</word>
+                        <word>stichworten</word>
+                        <word>stichwortverzeichni</word>
+                        <word>sticker</word>
+                        <word>stieber</word>
+                        <word>stiefm?_tterlich</word>
+                        <word>stieg</word>
+                        <word>stielt</word>
+                        <word>stiften</word>
+                        <word>stiftung</word>
+                        <word>stifung</word>
+                        <word>stirbt</word>
+                        <word>stoeren</word>
+                        <word>stoert</word>
+                        <word>stoesst</word>
+                        <word>stoffteil</word>
+                        <word>stoiber</word>
+                        <word>stolen</word>
+                        <word>stomverbrauch</word>
+                        <word>sto?_d?�mpfung</word>
+                        <word>sto?_gesch?_tzt</word>
+                        <word>sto?_sich</word>
+                        <word>str</word>
+                        <word>strafanzeigen</word>
+                        <word>strafbar</word>
+                        <word>strafgeb?_hr</word>
+                        <word>straftat</word>
+                        <word>straftatbest?�nd</word>
+                        <word>straftaten</word>
+                        <word>strahlenbelastungen</word>
+                        <word>strassen</word>
+                        <word>strato</word>
+                        <word>stra?_e</word>
+                        <word>stra?_enbahn</word>
+                        <word>stra?_?_</word>
+                        <word>stra?_?_enbahn</word>
+                        <word>streck</word>
+                        <word>strehl</word>
+                        <word>streikt</word>
+                        <word>streit</word>
+                        <word>streng</word>
+                        <word>strengt</word>
+                        <word>streuung</word>
+                        <word>stripp</word>
+                        <word>strolchen</word>
+                        <word>stromaufnahm</word>
+                        <word>strombegrenzung</word>
+                        <word>stromm?�?_ig</word>
+                        <word>stromnetz</word>
+                        <word>stromsparen</word>
+                        <word>stromverbrauch</word>
+                        <word>stromversorgung</word>
+                        <word>strunck</word>
+                        <word>studieren</word>
+                        <word>studiert</word>
+                        <word>stueck</word>
+                        <word>stufenlo</word>
+                        <word>stuhl</word>
+                        <word>stummen</word>
+                        <word>stummprofil</word>
+                        <word>stummschalt</word>
+                        <word>stummschalterei</word>
+                        <word>stummtast</word>
+                        <word>stupid</word>
+                        <word>stur</word>
+                        <word>style</word>
+                        <word>stymmt</word>
+                        <word>st?_?ckchen</word>
+                        <word>st?_?rt</word>
+                        <word>st?_?rung</word>
+                        <word>st?_??rzt</word>
+                        <word>st?�dten</word>
+                        <word>st?�dtisch</word>
+                        <word>st?�rken</word>
+                        <word>st?�rksten</word>
+                        <word>st?ber</word>
+                        <word>st?hrend</word>
+                        <word>st?renden</word>
+                        <word>st?rger?�uschen</word>
+                        <word>st?_ckzahl</word>
+                        <word>st?_nde</word>
+                        <word>st?_tzt</word>
+                        <word>su</word>
+                        <word>suah</word>
+                        <word>subject=3dsend_me_your_public_kei</word>
+                        <word>subjectlin</word>
+                        <word>subjekt</word>
+                        <word>subvent</word>
+                        <word>subventionieren</word>
+                        <word>suchmaschin</word>
+                        <word>suchtipp</word>
+                        <word>suchwoertern</word>
+                        <word>sudomain</word>
+                        <word>sum</word>
+                        <word>sumerlechn</word>
+                        <word>summer</word>
+                        <word>summieren</word>
+                        <word>sung</word>
+                        <word>superbillich</word>
+                        <word>surf&email-pack</word>
+                        <word>suse</word>
+                        <word>suuuuuper</word>
+                        <word>sv42</word>
+                        <word>svbcqfiurj3q3xvpbva7uu6rclbx5kyf5vqlvdmc8sd1elkf00xbfinzhmkjcxmfwg4jbp60</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>svf7w96gzbng1jt3c6jcssmsawal4jvkhyimjqraaiqichfpica1no7is2xwgbcwzzstf970</word>
+                        <word>sw91</word>
+                        <word>sweetmorn</word>
+                        <word>swyl0f4qgj7zahe9uanl5radtojaryj7nxzwxk1q9b4u6107shsafvgwcasmiswamwcayt1p</word>
+                        <word>sx</word>
+                        <word>sx440</word>
+                        <word>sx445</word>
+                        <word>sychronisieren</word>
+                        <word>sympathischer</word>
+                        <word>synchen</word>
+                        <word>synchronisationspaket</word>
+                        <word>synchronisationsversuch</word>
+                        <word>synchronisierungsvorgang</word>
+                        <word>syncm?glichkeit</word>
+                        <word>syncstat</word>
+                        <word>synct</word>
+                        <word>synonym</word>
+                        <word>syntax</word>
+                        <word>synvhronisieren</word>
+                        <word>systemleist</word>
+                        <word>systemnachricht</word>
+                        <word>systemprogramm</word>
+                        <word>systemverhalten</word>
+                        <word>systemverzeichni</word>
+                        <word>szeneboard</word>
+                        <word>s?_??mtlicher</word>
+                        <word>s?_nde</word>
+                        <word>s?_ndenbock</word>
+                        <word>s?_?_er</word>
+                        <word>[email protected]</word>
+                        <word>t0yqezfyynvzdfyzmsszjmi2teeypo09vwpkkxrdyb8gztpmcmkqzgntby8jnl2lrevkcxco</word>
+                        <word>t191</word>
+                        <word>t230</word>
+                        <word>t28</word>
+                        <word>t68</word>
+                        <word>t86i</word>
+                        <word>t86ytkvyqeqyrveldubeuflszntst7zxwuotrjfkekl0cgoamikhbpnmjqrmccuprsirezpi</word>
+                        <word>[email protected]</word>
+                        <word>tabellarischen</word>
+                        <word>tabl</word>
+                        <word>tacacano</word>
+                        <word>tackl</word>
+                        <word>taetgksta9r8qq1jiirmm5aogg3jikfcegp5sk9ukqbut2rkqkibtgdjninrhantms5nia3b</word>
+                        <word>tagebuch</word>
+                        <word>tagelang</word>
+                        <word>tagesangab</word>
+                        <word>tagesgebrauch</word>
+                        <word>tagesordnung</word>
+                        <word>tageszeiten</word>
+                        <word>tageszulassung</word>
+                        <word>tagung</word>
+                        <word>tai</word>
+                        <word>taken</word>
+                        <word>talfahrt</word>
+                        <word>tamet</word>
+                        <word>tariffal</word>
+                        <word>tariflich</word>
+                        <word>tariftabel</word>
+                        <word>tarifumstellung</word>
+                        <word>taschenlampenfunkt</word>
+                        <word>taschenrechnern</word>
+                        <word>taskmanag</word>
+                        <word>tastaturbelegung</word>
+                        <word>tastaturverriegelung</word>
+                        <word>tastatusmatt</word>
+                        <word>tastenfolg</word>
+                        <word>tastenfunktionen</word>
+                        <word>tatsachen</word>
+                        <word>tauglichkeit</word>
+                        <word>tausenden</word>
+                        <word>taxi</word>
+                        <word>tcp</word>
+                        <word>tdc</word>
+                        <word>technicu</word>
+                        <word>techniqu</word>
+                        <word>technolog</word>
+                        <word>teilabgeschriebenem</word>
+                        <word>teilnehmerzahl</word>
+                        <word>teilthread</word>
+                        <word>telbuch</word>
+                        <word>telefion</word>
+                        <word>telefonanlagen</word>
+                        <word>telefonaten</word>
+                        <word>telefonbuchbearbeitung</word>
+                        <word>telefonbuchdaten</word>
+                        <word>telefonbucheintr?_??g</word>
+                        <word>telefonbuchtast</word>
+                        <word>telefoneintrag</word>
+                        <word>telefongespr?�chen</word>
+                        <word>telefonhardwar</word>
+                        <word>telefonierverhalten</word>
+                        <word>telefonieseit</word>
+                        <word>telefonino</word>
+                        <word>telefoninstallateur</word>
+                        <word>telefonkosten</word>
+                        <word>telefonladen</word>
+                        <word>telefonl?�den</word>
+                        <word>telefonmodellen</word>
+                        <word>telefonmonitor</word>
+                        <word>telefonnetz</word>
+                        <word>telefonnr</word>
+                        <word>telefonqualit?�ten</word>
+                        <word>telefonregist</word>
+                        <word>telefonsoftwar</word>
+                        <word>telefonsperr</word>
+                        <word>telefonzellen</word>
+                        <word>telekommunikationseinrichtungen</word>
+                        <word>telephonen</word>
+                        <word>tellerrand</word>
+                        <word>telli</word>
+                        <word>tem</word>
+                        <word>temperatur</word>
+                        <word>temperatursensoren</word>
+                        <word>tempo</word>
+                        <word>temporari</word>
+                        <word>tempratur</word>
+                        <word>tenor</word>
+                        <word>terminaleigenschaften</word>
+                        <word>terminalemul</word>
+                        <word>terminalprogramm</word>
+                        <word>terminkonflikthervorhebung</word>
+                        <word>terriern</word>
+                        <word>tesa</word>
+                        <word>testbild</word>
+                        <word>testet</word>
+                        <word>testkontakt</word>
+                        <word>testmust</word>
+                        <word>testverbindungen</word>
+                        <word>[email protected]</word>
+                        <word>testzeit</word>
+                        <word>teuerer</word>
+                        <word>teuerest</word>
+                        <word>teuersten</word>
+                        <word>teufel</word>
+                        <word>teunabh</word>
+                        <word>teureren</word>
+                        <word>textbereich</word>
+                        <word>texteditor</word>
+                        <word>texteingabemodi</word>
+                        <word>texten</word>
+                        <word>texterkennung</word>
+                        <word>textfeld</word>
+                        <word>textform</word>
+                        <word>textkonvertierung</word>
+                        <word>textmail</word>
+                        <word>theft</word>
+                        <word>themenblock</word>
+                        <word>theo</word>
+                        <word>they'r</word>
+                        <word>thilo</word>
+                        <word>threadid=10649&amp;sid=99992f2117f9a777dde1ed8a0c98931f</word>
+                        <word>threadid=143264&amp;page=1</word>
+                        <word>thronen</word>
+                        <word>thurrott</word>
+                        <word>tibonof</word>
+                        <word>ticicina</word>
+                        <word>tiefentladung</word>
+                        <word>tiefgarag</word>
+                        <word>tiefschl?�g</word>
+                        <word>tieh</word>
+                        <word>tierisch</word>
+                        <word>tiger</word>
+                        <word>tigern</word>
+                        <word>tight</word>
+                        <word>timuvumif</word>
+                        <word>tino</word>
+                        <word>tippfehl</word>
+                        <word>tippselt</word>
+                        <word>tippt</word>
+                        <word>tipptast</word>
+                        <word>tiradaya</word>
+                        <word>tirelep</word>
+                        <word>tischlad</word>
+                        <word>titelseit</word>
+                        <word>tjbakg5hbojjagpu04yxmqfyoivbgfwktjsbppfiaqrmk04sctmzfnyjm5imbssdguaxkci9</word>
+                        <word>tl</word>
+                        <word>tobi</word>
+                        <word>[email protected]</word>
+                        <word>tobisatora</word>
+                        <word>tocobadec</word>
+                        <word>toedlich</word>
+                        <word>toi</word>
+                        <word>tolerierbar</word>
+                        <word>tolkien</word>
+                        <word>toller</word>
+                        <word>[email protected]</word>
+                        <word>tomblin</word>
+                        <word>[email protected]</word>
+                        <word>tonn</word>
+                        <word>topf</word>
+                        <word>topf?_hler</word>
+                        <word>topp</word>
+                        <word>totalabsturz</word>
+                        <word>totalausfal</word>
+                        <word>totalaustausch</word>
+                        <word>totgehofften</word>
+                        <word>tour</word>
+                        <word>toyesixi</word>
+                        <word>track</word>
+                        <word>tracktiert</word>
+                        <word>trade</word>
+                        <word>trainieren</word>
+                        <word>transformlist</word>
+                        <word>translat</word>
+                        <word>transmiss</word>
+                        <word>transp</word>
+                        <word>transportier</word>
+                        <word>transvosg</word>
+                        <word>trappeln</word>
+                        <word>trauben</word>
+                        <word>traue</word>
+                        <word>trauer</word>
+                        <word>trauf</word>
+                        <word>traumhaft</word>
+                        <word>trayappl</word>
+                        <word>treat</word>
+                        <word>treffend</word>
+                        <word>treibersoftwar</word>
+                        <word>treibervers</word>
+                        <word>treibt</word>
+                        <word>trial</word>
+                        <word>trio</word>
+                        <word>trixi</word>
+                        <word>trocken</word>
+                        <word>trockenen</word>
+                        <word>trockengewischt</word>
+                        <word>trocker</word>
+                        <word>trolli</word>
+                        <word>trotzki</word>
+                        <word>trs_en_de_bg-bg_et-ee_lv-lv_lt-lt_ro_ru-ru_uk-ua_.jar</word>
+                        <word>truetsch</word>
+                        <word>trycktil</word>
+                        <word>tr?�ge</word>
+                        <word>tr?�gheit</word>
+                        <word>tr?�nkenwagen</word>
+                        <word>tr?�ume</word>
+                        <word>tr?dler</word>
+                        <word>tr?_ben</word>
+                        <word>tr?_gerischen</word>
+                        <word>tschechisch</word>
+                        <word>tschudlig</word>
+                        <word>tsch?</word>
+                        <word>[email protected]</word>
+                        <word>tt</word>
+                        <word>tt3</word>
+                        <word>ttn</word>
+                        <word>tuch</word>
+                        <word>tuen</word>
+                        <word>tune</word>
+                        <word>tunlichst</word>
+                        <word>turn</word>
+                        <word>tussi</word>
+                        <word>tust</word>
+                        <word>tv</word>
+                        <word>twc6exfswiosors2fnt9qmhxxllwi5qu1dshjpjhfwxxy4mvxawsueritvdgtm7eaffoz70n</word>
+                        <word>twdggdomofdm0ymktsczaobjoawjruh1gimuv9dygxiigim06sgsix6uony7vxogdn0zwr8i</word>
+                        <word>twzciyqesydhjsdwt6mptqn9dghznahwlckoqcdfyoe1cj8o7yvsor6k5uxadg2metwiijfu</word>
+                        <word>typischen</word>
+                        <word>tze</word>
+                        <word>t?_?ne</word>
+                        <word>t?_cke</word>
+                        <word>t?_rglocken</word>
+                        <word>t?_rsprechstellen</word>
+                        <word>uah</word>
+                        <word>udat</word>
+                        <word>udp</word>
+                        <word>ue</word>
+                        <word>ueberfordert</word>
+                        <word>ueberlegt</word>
+                        <word>ueberlegung</word>
+                        <word>uebersehen</word>
+                        <word>ugspvscqrgmad1ds6fxrmgpjnxegullydabh2isnxdkfujkjw5rdojrva1cf1rgay7ehsfu</word>
+                        <word>uhren</word>
+                        <word>uhrenabgleich</word>
+                        <word>uhrenhintergrund</word>
+                        <word>uhs</word>
+                        <word>uhu</word>
+                        <word>ui</word>
+                        <word>uii</word>
+                        <word>uiuiui</word>
+                        <word>ulk</word>
+                        <word>umbelgt</word>
+                        <word>umbringen</word>
+                        <word>umbr?_ch</word>
+                        <word>umeleitung</word>
+                        <word>umelitung</word>
+                        <word>umgebaut</word>
+                        <word>umgebend</word>
+                        <word>umgebogen</word>
+                        <word>umgedeutet</word>
+                        <word>umgeh</word>
+                        <word>umgehend</word>
+                        <word>umgehung</word>
+                        <word>umgelenkt</word>
+                        <word>umgeschaut</word>
+                        <word>umgew?hnung</word>
+                        <word>umgezogen</word>
+                        <word>umlauf</word>
+                        <word>umleit</word>
+                        <word>umleitet</word>
+                        <word>umleitungseinstellungen</word>
+                        <word>umleitungslotteri</word>
+                        <word>umleitungsquatsch</word>
+                        <word>umm</word>
+                        <word>umrechnen</word>
+                        <word>umruestung</word>
+                        <word>umr?_stung</word>
+                        <word>umsatzabfrag</word>
+                        <word>umschaltung</word>
+                        <word>umschreiben</word>
+                        <word>umso</word>
+                        <word>umstaendlich</word>
+                        <word>umsteck</word>
+                        <word>umsteigern</word>
+                        <word>umstellt</word>
+                        <word>umst?�nd</word>
+                        <word>umtausch</word>
+                        <word>umtauschaktionen</word>
+                        <word>umtauschen</word>
+                        <word>umtauschgrund</word>
+                        <word>umwelteinfl?_ssen</word>
+                        <word>umzingelt</word>
+                        <word>umzubelegen</word>
+                        <word>umzubenennen</word>
+                        <word>umzug</word>
+                        <word>umzupolen</word>
+                        <word>umzusetzen</word>
+                        <word>umzustricken</word>
+                        <word>unabh?_??ngig</word>
+                        <word>unansehnlich</word>
+                        <word>unbeaufsichtigt</word>
+                        <word>unbedeutend</word>
+                        <word>unbedienbar</word>
+                        <word>unbegreiflich</word>
+                        <word>unbekanntem</word>
+                        <word>unbelegt</word>
+                        <word>unbenutzbarkeit</word>
+                        <word>unbequem</word>
+                        <word>unberechtigterweis</word>
+                        <word>unber?_hrt</word>
+                        <word>unbeschadet</word>
+                        <word>unbestimmt</word>
+                        <word>unbestritten</word>
+                        <word>unbest?�tigt</word>
+                        <word>unbeweglich</word>
+                        <word>unbrand</word>
+                        <word>unbrauchbarem</word>
+                        <word>unc</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>uncool</word>
+                        <word>underlin</word>
+                        <word>undicht</word>
+                        <word>unertr?�glich</word>
+                        <word>unerw?_nschten</word>
+                        <word>unfalldetail</word>
+                        <word>unfreiwillig</word>
+                        <word>unfreundlich</word>
+                        <word>unfreundlichen</word>
+                        <word>unfruchtbarkeit</word>
+                        <word>unf?�ll</word>
+                        <word>ung</word>
+                        <word>ungarn</word>
+                        <word>ungebremst</word>
+                        <word>ungeduld</word>
+                        <word>ungef?�hren</word>
+                        <word>ungef?�hrlich</word>
+                        <word>ungef?�hrlichkeit</word>
+                        <word>ungeheu</word>
+                        <word>ungehindert</word>
+                        <word>ungelesenen</word>
+                        <word>ungen?_genden</word>
+                        <word>ungeschickt</word>
+                        <word>ungesch?_tzt</word>
+                        <word>ungewiss</word>
+                        <word>ungewohnten</word>
+                        <word>unglaubw?_rdig</word>
+                        <word>ungleichm?�?_ig</word>
+                        <word>unhip</word>
+                        <word>uni</word>
+                        <word>unicod</word>
+                        <word>uninformiert</word>
+                        <word>uninstal</word>
+                        <word>universum</word>
+                        <word>unix</word>
+                        <word>unkaputtbar</word>
+                        <word>unkenntlich</word>
+                        <word>unklar</word>
+                        <word>unknown</word>
+                        <word>unkoordiniert</word>
+                        <word>unleserlich</word>
+                        <word>unlockt</word>
+                        <word>unlogik</word>
+                        <word>unmisverst?�ndlich</word>
+                        <word>unmut</word>
+                        <word>unm?glichen</word>
+                        <word>unnorm</word>
+                        <word>unnutzbar</word>
+                        <word>unn?_tzer</word>
+                        <word>unoriginel</word>
+                        <word>unrechtm?�?_ig</word>
+                        <word>unrechtm?�?_igen</word>
+                        <word>unregelmaessigen</word>
+                        <word>unrichtig</word>
+                        <word>unschuldig</word>
+                        <word>unschwer</word>
+                        <word>unsch?�rfer</word>
+                        <word>unserem</word>
+                        <word>unseren</word>
+                        <word>unsich</word>
+                        <word>unsicherer</word>
+                        <word>unsinnigerweis</word>
+                        <word>unst</word>
+                        <word>unstrukturiert</word>
+                        <word>unstrukturierten</word>
+                        <word>untaugichen</word>
+                        <word>unterbindung</word>
+                        <word>unterbrochen</word>
+                        <word>unterdr?_cken</word>
+                        <word>untereinand</word>
+                        <word>untereintrag</word>
+                        <word>unterfangen</word>
+                        <word>unterfordert</word>
+                        <word>unterhalb</word>
+                        <word>unterlassung</word>
+                        <word>unterlassungen</word>
+                        <word>unternimmt</word>
+                        <word>unterrichtet</word>
+                        <word>unterschl?�gt</word>
+                        <word>unterschl?_ssel</word>
+                        <word>unterstrichen</word>
+                        <word>unterst?_??tzt</word>
+                        <word>unterst?_tztem</word>
+                        <word>unterwerfen</word>
+                        <word>unterworfen</word>
+                        <word>unterzogen</word>
+                        <word>untrust</word>
+                        <word>unverf?�nglich</word>
+                        <word>unverh?�ltnism?�?_ig</word>
+                        <word>unversch?�mtheit</word>
+                        <word>unversch?�mtheiten</word>
+                        <word>unverst?�ndni</word>
+                        <word>unver?�nderbar</word>
+                        <word>unver?�ndert</word>
+                        <word>unvis</word>
+                        <word>unwahrscheinlichen</word>
+                        <word>unweigerlich</word>
+                        <word>unwirksam</word>
+                        <word>unwork</word>
+                        <word>unzweifelsfrei</word>
+                        <word>unz?_??hligen</word>
+                        <word>un?tig</word>
+                        <word>updatebar</word>
+                        <word>upged</word>
+                        <word>upgegradet</word>
+                        <word>upload</word>
+                        <word>upp</word>
+                        <word>uptod</word>
+                        <word>ur</word>
+                        <word>uralten</word>
+                        <word>uranisch</word>
+                        <word>uriv9imafkmkmeru3ulkgmoqabqsxalytmson3et6lbl04usbmtv11u4g8n6a8lpfs7dcbl</word>
+                        <word>urlaubsbildern</word>
+                        <word>urn</word>
+                        <word>ursprungsmail</word>
+                        <word>ursprungspost</word>
+                        <word>urspr?_??nglich</word>
+                        <word>urspr?_nglichen</word>
+                        <word>urs?�chlich</word>
+                        <word>urteilst</word>
+                        <word>usb\vid_0815&pid_0100&mi_00</word>
+                        <word>usenet8951</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>usern</word>
+                        <word>usim</word>
+                        <word>usp</word>
+                        <word>usual</word>
+                        <word>uswi</word>
+                        <word>ut</word>
+                        <word>uti</word>
+                        <word>utmfrjueijpahnvxjaeqbuvvxjung4ek8ioflrvyr6ty8sm5tgfaq7idopc9h61eidkrp5bq</word>
+                        <word>uwedoern</word>
+                        <word>uwg</word>
+                        <word>v1050</word>
+                        <word>v19</word>
+                        <word>v23</word>
+                        <word>v3688</word>
+                        <word>v52</word>
+                        <word>v560</word>
+                        <word>[email protected]</word>
+                        <word>v600</word>
+                        <word>v620</word>
+                        <word>v66i</word>
+                        <word>v800</word>
+                        <word>vamefi</word>
+                        <word>variabl</word>
+                        <word>variieren</word>
+                        <word>vawotor</word>
+                        <word>vdo</word>
+                        <word>vdr</word>
+                        <word>vegetari</word>
+                        <word>venosa</word>
+                        <word>verabreicht</word>
+                        <word>verallgemeinerungen</word>
+                        <word>veranlasst</word>
+                        <word>veranschlagt</word>
+                        <word>veranstalt</word>
+                        <word>verantwortlichen</word>
+                        <word>verantwortlichkeit</word>
+                        <word>verarbeiten</word>
+                        <word>verarbeitet</word>
+                        <word>verarbeitungsqualit?�t</word>
+                        <word>verbal</word>
+                        <word>verbesserten</word>
+                        <word>verbindest</word>
+                        <word>verbleiben</word>
+                        <word>verbracht</word>
+                        <word>verbreitet</word>
+                        <word>verbring</word>
+                        <word>verbugt</word>
+                        <word>verdachtsmo</word>
+                        <word>verdeutlichung</word>
+                        <word>verdienst</word>
+                        <word>verdonner</word>
+                        <word>verdrahtung</word>
+                        <word>verdruss</word>
+                        <word>verdunkeln</word>
+                        <word>verdunkelt</word>
+                        <word>verd?�chtig</word>
+                        <word>verd?�chtigungen</word>
+                        <word>vereinbarung</word>
+                        <word>vereinfacht</word>
+                        <word>vereinfachung</word>
+                        <word>vereinigten</word>
+                        <word>verfassen</word>
+                        <word>verfasst</word>
+                        <word>verfassung</word>
+                        <word>verfolgung</word>
+                        <word>verfuegbarkeit</word>
+                        <word>verfusselt</word>
+                        <word>verf?_??gbaren</word>
+                        <word>verf?_??gbarkeit</word>
+                        <word>verf?�lschten</word>
+                        <word>vergangen</word>
+                        <word>vergangenheit</word>
+                        <word>vergewissert</word>
+                        <word>vergiessen</word>
+                        <word>vergiss</word>
+                        <word>vergi?_</word>
+                        <word>vergleichszeitraum</word>
+                        <word>vergn?_gen</word>
+                        <word>vergr?ssert</word>
+                        <word>verhandlungen</word>
+                        <word>verharmlosen</word>
+                        <word>verheddert</word>
+                        <word>verheiratet</word>
+                        <word>verh?�ltniss</word>
+                        <word>verifi</word>
+                        <word>verin</word>
+                        <word>verison</word>
+                        <word>verkaufsofferten</word>
+                        <word>verkaufsshop</word>
+                        <word>verkaufssumm</word>
+                        <word>verkaufszahlen</word>
+                        <word>verkehrsfunknachrichten</word>
+                        <word>verkehrt</word>
+                        <word>verkloppt</word>
+                        <word>verkn?_pft</word>
+                        <word>verkn?_pfungen</word>
+                        <word>verkrampfen</word>
+                        <word>verkrueppelt</word>
+                        <word>verk?_??uf</word>
+                        <word>verk?_ndend</word>
+                        <word>verk?_rzten</word>
+                        <word>verlang</word>
+                        <word>verlangst</word>
+                        <word>verlauten</word>
+                        <word>verleiten</word>
+                        <word>verliebt</word>
+                        <word>verlief</word>
+                        <word>verlie?_</word>
+                        <word>verlinkt</word>
+                        <word>verlinkten</word>
+                        <word>verlor</word>
+                        <word>verlorenen</word>
+                        <word>verlorenst</word>
+                        <word>verl?�ngerung</word>
+                        <word>verl?�ngerungskabel</word>
+                        <word>verl?�sst</word>
+                        <word>vermarktet</word>
+                        <word>vermeidet</word>
+                        <word>vermeintlichen</word>
+                        <word>vermieten</word>
+                        <word>verm?gen</word>
+                        <word>verm?gensvorteil</word>
+                        <word>vernachlaessigen</word>
+                        <word>verneinen</word>
+                        <word>vernunft</word>
+                        <word>verordnungen</word>
+                        <word>verpackungen</word>
+                        <word>verpassten</word>
+                        <word>verpflichtungen</word>
+                        <word>verquer</word>
+                        <word>verquickung</word>
+                        <word>verrechnet</word>
+                        <word>verrechnung</word>
+                        <word>verringern</word>
+                        <word>verrissen</word>
+                        <word>verrutschen</word>
+                        <word>versandgeb?_hren</word>
+                        <word>versandkostenzuschlag</word>
+                        <word>versandt</word>
+                        <word>verschaffen</word>
+                        <word>verschieb</word>
+                        <word>verschiedensten</word>
+                        <word>verschienden</word>
+                        <word>verschimmeln</word>
+                        <word>verschlafen</word>
+                        <word>verschlusshebel</word>
+                        <word>verschl?_sselung</word>
+                        <word>verschmerzen</word>
+                        <word>verschob</word>
+                        <word>verschobenen</word>
+                        <word>verschrauben</word>
+                        <word>verschwand</word>
+                        <word>verschwei?_ten</word>
+                        <word>verschw?rungstheorien</word>
+                        <word>versieht</word>
+                        <word>versionsangaben</word>
+                        <word>versorgung</word>
+                        <word>verspielten</word>
+                        <word>verspricht</word>
+                        <word>verstaendlich</word>
+                        <word>verstauen</word>
+                        <word>verstellbar</word>
+                        <word>versto?_</word>
+                        <word>verstrichen</word>
+                        <word>verstummen</word>
+                        <word>verst??_t</word>
+                        <word>verst?_mmelt</word>
+                        <word>verteilerkasten</word>
+                        <word>verteilerlist</word>
+                        <word>verteilt</word>
+                        <word>vertik</word>
+                        <word>vertragsablauf</word>
+                        <word>vertragsabschluss</word>
+                        <word>vertragsabschlu?_</word>
+                        <word>vertragsverh?�ltni</word>
+                        <word>vertragsverl?�ngerungsangebot</word>
+                        <word>vertrau</word>
+                        <word>vertreiben</word>
+                        <word>vertreibt</word>
+                        <word>vertret</word>
+                        <word>vertr?�gt</word>
+                        <word>verusacht</word>
+                        <word>verwaltungszeichen</word>
+                        <word>verwandt</word>
+                        <word>verwechest</word>
+                        <word>verwechsleret</word>
+                        <word>verwechslung</word>
+                        <word>verweigerung</word>
+                        <word>verweilt</word>
+                        <word>verwerfen</word>
+                        <word>verwertbaren</word>
+                        <word>verwiesen</word>
+                        <word>verwirkt</word>
+                        <word>verwirrend</word>
+                        <word>verzehrt</word>
+                        <word>verzieren</word>
+                        <word>verzoegert</word>
+                        <word>verzoegerung</word>
+                        <word>verzweifel</word>
+                        <word>verzweiflung</word>
+                        <word>verzweigung</word>
+                        <word>verzwickt</word>
+                        <word>verz?gert</word>
+                        <word>verz?_ckt</word>
+                        <word>ver?�nderbar</word>
+                        <word>ver?�nderbarkeit</word>
+                        <word>ver?�nderungen</word>
+                        <word>ver?�u?_ern</word>
+                        <word>vetr?�gt</word>
+                        <word>vewutiruvuh</word>
+                        <word>vga</word>
+                        <word>viamichelin</word>
+                        <word>viausb</word>
+                        <word>vibramotor</word>
+                        <word>vibrationsmotor</word>
+                        <word>videoaufnahmen</word>
+                        <word>videoqualit?�t</word>
+                        <word>viedeo</word>
+                        <word>vieler</word>
+                        <word>vielerlei</word>
+                        <word>vielmal</word>
+                        <word>vielmehr</word>
+                        <word>vieltelefonier</word>
+                        <word>viert</word>
+                        <word>vietelefonier</word>
+                        <word>viewitem&category=24010&item=6409732511</word>
+                        <word>viewitem&item=6401819203</word>
+                        <word>viewitem&item=7540266050</word>
+                        <word>vihifix</word>
+                        <word>viiiiel</word>
+                        <word>viiiiiiiiiielen</word>
+                        <word>vim</word>
+                        <word>vin</word>
+                        <word>viorgeschlagen</word>
+                        <word>virenfrei</word>
+                        <word>virengefahr</word>
+                        <word>visa</word>
+                        <word>visibl</word>
+                        <word>visitenkart</word>
+                        <word>visitkarten</word>
+                        <word>visualisierung</word>
+                        <word>viva</word>
+                        <word>vk</word>
+                        <word>vodafol</word>
+                        <word>vodafoneleut</word>
+                        <word>vodkamann</word>
+                        <word>vodoofon</word>
+                        <word>voicedial</word>
+                        <word>voil?�</word>
+                        <word>voiw1pxnrbrlw1gh3ozbr5ibzyqkkafwh1zvwbl21olit37umktftqzxbybdfusczammage0</word>
+                        <word>vokabel</word>
+                        <word>volksmund</word>
+                        <word>vollast</word>
+                        <word>vollidioten</word>
+                        <word>vollmond</word>
+                        <word>vollmundig</word>
+                        <word>vollst</word>
+                        <word>vollzitat</word>
+                        <word>vollzitiererei</word>
+                        <word>voltag</word>
+                        <word>voltair</word>
+                        <word>vorangetrieben</word>
+                        <word>vorank?_ndigungen</word>
+                        <word>voraussetzt</word>
+                        <word>vorauszusagen</word>
+                        <word>vorbehalt</word>
+                        <word>vorbeibekommen</word>
+                        <word>vorbeigeht</word>
+                        <word>vorbeigeschaut</word>
+                        <word>vorbeikommen</word>
+                        <word>vorbeikommt</word>
+                        <word>vorbereitung</word>
+                        <word>vorbestellen</word>
+                        <word>vorbeugend</word>
+                        <word>voreingegeben</word>
+                        <word>voreingestellten</word>
+                        <word>vorenth?�lt</word>
+                        <word>vorfahrtstrass</word>
+                        <word>vorfeld</word>
+                        <word>vorgaukelt</word>
+                        <word>vorgedudelt</word>
+                        <word>vorgef?_hrt</word>
+                        <word>vorgegangen</word>
+                        <word>vorgehendweis</word>
+                        <word>vorgeschlagenen</word>
+                        <word>vorgestellt</word>
+                        <word>vorgewagt</word>
+                        <word>vorhandensein</word>
+                        <word>vorinstal</word>
+                        <word>vorjahr</word>
+                        <word>vorkommend</word>
+                        <word>vorletzt</word>
+                        <word>vorlieben</word>
+                        <word>vorl?�ufermodel</word>
+                        <word>vornedran</word>
+                        <word>vornehm</word>
+                        <word>vorprodukt</word>
+                        <word>vorschlaeg</word>
+                        <word>vorschlagen</word>
+                        <word>vorschriftsm?�ssigen</word>
+                        <word>vorsehen</word>
+                        <word>vorsichtigem</word>
+                        <word>vorsichtsma?_?_nahmen</word>
+                        <word>vorspiegelung</word>
+                        <word>vorstellbar</word>
+                        <word>vors?�tzlich</word>
+                        <word>vorteol</word>
+                        <word>vortragen</word>
+                        <word>vortritt</word>
+                        <word>vort?�uschen</word>
+                        <word>vorwerfen</word>
+                        <word>vorzeigen</word>
+                        <word>vorzeit</word>
+                        <word>vorzugeben</word>
+                        <word>vorz?_glich</word>
+                        <word>vor?_ber</word>
+                        <word>vsqnxz074aswrgm524jj0fjftm7ciu4v5ococlwc5q38nmtvxd01naif4cjvbj86qro2xcet</word>
+                        <word>[email protected]</word>
+                        <word>vt</word>
+                        <word>vtbxw7yirdr2otk4x2oq7zg7sds06lycoxaqkdemfdvmccjtsdb1lracoi4otqvl9jeu40hb</word>
+                        <word>vtdvhsr5vnzuc9qgfdlgpc1gn8ysdj966itjapnzslovssvjhi3y55pjvqwg1wdgzquw</word>
+                        <word>vulkanschwarz</word>
+                        <word>vv</word>
+                        <word>v?_?lligen</word>
+                        <word>v?llst?�ndig</word>
+                        <word>v?lp</word>
+                        <word>w2ksp3</word>
+                        <word>w95</word>
+                        <word>w=fcrd</word>
+                        <word>[email protected]</word>
+                        <word>wab</word>
+                        <word>wackelig</word>
+                        <word>wackelkontakt</word>
+                        <word>wackelnd</word>
+                        <word>waehlerei</word>
+                        <word>waeren</word>
+                        <word>waffen</word>
+                        <word>wagt</word>
+                        <word>wahlsieg</word>
+                        <word>wahrer</word>
+                        <word>wahrgenommen</word>
+                        <word>wahrlo</word>
+                        <word>wahrsch</word>
+                        <word>wait</word>
+                        <word>waldspaziergang</word>
+                        <word>wandeln</word>
+                        <word>want</word>
+                        <word>wapovergpr</word>
+                        <word>wapverbindungen</word>
+                        <word>war`</word>
+                        <word>warnungen</word>
+                        <word>wasch^w</word>
+                        <word>wasserschaden</word>
+                        <word>wassertropfen</word>
+                        <word>wasserversorgung</word>
+                        <word>water</word>
+                        <word>watscheneinfach</word>
+                        <word>watson</word>
+                        <word>wdcma</word>
+                        <word>weak</word>
+                        <word>webadress</word>
+                        <word>weboberfl?�ch</word>
+                        <word>webpag</word>
+                        <word>webster</word>
+                        <word>websuch</word>
+                        <word>wechner</word>
+                        <word>wechseldatentr?�g</word>
+                        <word>wechselsprechen</word>
+                        <word>wechseltag</word>
+                        <word>wedbrwxjjnbh7ilsncjyadt0a1wttukeimknajdzqrojpsxygktmgqpvekdtt2jswmusadpa</word>
+                        <word>wegbekam</word>
+                        <word>wegdr?_ckst</word>
+                        <word>weggebracht</word>
+                        <word>weggedr?_ckt</word>
+                        <word>weggeht</word>
+                        <word>weggelassen</word>
+                        <word>weghaengt</word>
+                        <word>wegschwimmen</word>
+                        <word>wegspeichern</word>
+                        <word>wegwerfen</word>
+                        <word>wegwerfkart</word>
+                        <word>wegzubekommen</word>
+                        <word>wehe</word>
+                        <word>wehren</word>
+                        <word>wehret</word>
+                        <word>weia</word>
+                        <word>weich</word>
+                        <word>weichen</word>
+                        <word>weidlich</word>
+                        <word>weilchen</word>
+                        <word>weisen</word>
+                        <word>weiterbearbeiten</word>
+                        <word>weiterbenutzen</word>
+                        <word>weiterbesteht</word>
+                        <word>weiterbilden</word>
+                        <word>weiterentwickelt</word>
+                        <word>weiterf?_hrenden</word>
+                        <word>weitergebracht</word>
+                        <word>weitergehend</word>
+                        <word>weitergeholfen</word>
+                        <word>weitergeleitet</word>
+                        <word>weitern</word>
+                        <word>weiterversenden</word>
+                        <word>weiterverwenden</word>
+                        <word>wellenform</word>
+                        <word>weltkonzern</word>
+                        <word>weltweiten</word>
+                        <word>wenigisten</word>
+                        <word>wenngleich</word>
+                        <word>wennich</word>
+                        <word>werbespruch</word>
+                        <word>werbetext</word>
+                        <word>werbung@</word>
+                        <word>werdden</word>
+                        <word>werdend</word>
+                        <word>werksgaranti</word>
+                        <word>werksseitigen</word>
+                        <word>werkszustand</word>
+                        <word>werkzeugmaschinen</word>
+                        <word>[email protected]</word>
+                        <word>wertigkeit</word>
+                        <word>wertvol</word>
+                        <word>wettbewerbsverzerrung</word>
+                        <word>wetterst</word>
+                        <word>whiskyfan</word>
+                        <word>wich</word>
+                        <word>widcommtreib</word>
+                        <word>wide</word>
+                        <word>wideangl</word>
+                        <word>wider</word>
+                        <word>widerrufen</word>
+                        <word>widersprechen</word>
+                        <word>widerwilleg</word>
+                        <word>widerwillig</word>
+                        <word>wiederfinden</word>
+                        <word>wiederherstellt</word>
+                        <word>wiederholbar</word>
+                        <word>wiederholend</word>
+                        <word>wiederholung</word>
+                        <word>wiederholungsfunktionen</word>
+                        <word>wiederzufinden</word>
+                        <word>wiemann</word>
+                        <word>wife</word>
+                        <word>wildbahn</word>
+                        <word>wilk</word>
+                        <word>wimmelt</word>
+                        <word>win2000</word>
+                        <word>win98</word>
+                        <word>winamp</word>
+                        <word>windoof</word>
+                        <word>windowseigenen</word>
+                        <word>winfoni</word>
+                        <word>winppc2003</word>
+                        <word>[email protected]</word>
+                        <word>winterschlaf</word>
+                        <word>winxp_sp2</word>
+                        <word>wirklicj</word>
+                        <word>wirkungslo</word>
+                        <word>wirs</word>
+                        <word>wiss</word>
+                        <word>wissenschaft</word>
+                        <word>wissenswert</word>
+                        <word>wissenwert</word>
+                        <word>witt</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>witzigerweis</word>
+                        <word>wks7tnsab92hn26owhapcbgwkkatugsx7gu9azwy3nhpnblu96jjq2wxjbvjtufmmkgazp97</word>
+                        <word>wm</word>
+                        <word>wnn</word>
+                        <word>wochentermin</word>
+                        <word>woellten</word>
+                        <word>woerterbuch</word>
+                        <word>wogegen</word>
+                        <word>wohingegen</word>
+                        <word>wohler</word>
+                        <word>wohlt?�tigkeit</word>
+                        <word>wohnen</word>
+                        <word>wolken</word>
+                        <word>woll</word>
+                        <word>wolt</word>
+                        <word>wonder</word>
+                        <word>wonn</word>
+                        <word>worch</word>
+                        <word>worin</word>
+                        <word>workflow</word>
+                        <word>workstat</word>
+                        <word>wortlist</word>
+                        <word>wortwahl</word>
+                        <word>wpsdjzdnqbl57anduw7cbmcjlma4hzqx0fuzc0exltimlaxoumz3ny2pmckcn50ykkwqda0u</word>
+                        <word>wpxtun77iqzn9a6d17wj1hp9ooglw3xccvisbxjpvwi1wg1vh2f63kez6ztknsgslq47x4k8</word>
+                        <word>wrist</word>
+                        <word>ws2ltsjwoyk5gn2rnrq6klgaavvxbfdlgpo7ujzrupkjogabr2qq575zuwgbyfm2dwaagcak</word>
+                        <word>[email protected]</word>
+                        <word>wucher</word>
+                        <word>wunderbaren</word>
+                        <word>wundersam</word>
+                        <word>wundersch?n</word>
+                        <word>wunschdenken</word>
+                        <word>wunschgem?�?_</word>
+                        <word>wunschzeitraum</word>
+                        <word>wunschzettel</word>
+                        <word>wuppert</word>
+                        <word>wurm</word>
+                        <word>wurmverseucht</word>
+                        <word>wurstfing</word>
+                        <word>wurzel</word>
+                        <word>wusstest</word>
+                        <word>wu?_?_t</word>
+                        <word>www.mobileunlocked.com/unlock_codes.php</word>
+                        <word>www.trycktill.com/eng/unlock_swe.asp</word>
+                        <word>w?_??nschend</word>
+                        <word>w?�hlton</word>
+                        <word>w?�hlverbindung</word>
+                        <word>w?�hrung</word>
+                        <word>w?�rmsten</word>
+                        <word>w?�rst</word>
+                        <word>w?�rtst</word>
+                        <word>w?chentlich</word>
+                        <word>w?_nschst</word>
+                        <word>w?_r</word>
+                        <word>w?_rg</word>
+                        <word>w?_rmer</word>
+                        <word>x%</word>
+                        <word>x'p</word>
+                        <word>x'post</word>
+                        <word>x160</word>
+                        <word>x2</word>
+                        <word>x45</word>
+                        <word>x86</word>
+                        <word>x86ern</word>
+                        <word>xagor</word>
+                        <word>xd</word>
+                        <word>xe</word>
+                        <word>xe7ga8rz0trdwjthdtaj5me1c66ve2tlmcua7hbkcctwg6z1w58npvaue2pxrn3vdedcmmji</word>
+                        <word>xecalefap</word>
+                        <word>xelibri</word>
+                        <word>xenahadotec</word>
+                        <word>xhtml</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>xplore</word>
+                        <word>xpsp2</word>
+                        <word>xrvcsrjqswzej8aem7miqpsoiumapwllcckqdtposisvz6hktsoiuesttdl7hpmrmehipyb2</word>
+                        <word>xscale</word>
+                        <word>xtnc</word>
+                        <word>xtndconnectpc</word>
+                        <word>xtndconnetct</word>
+                        <word>xtrapack</word>
+                        <word>xwbml4er5ukdliqbjn3pe3aookthy1kzvyu3budooyjeub5ypxukrvyygtsg9ioah31l8tzv</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>yahooseit</word>
+                        <word>yap</word>
+                        <word>yarjilzbhehlvpmgkmwljbqs0kdjimah3fkume54hf2rofhj9mlzqnlnt1rvpytt5l0unj</word>
+                        <word>yase</word>
+                        <word>yheeki</word>
+                        <word>[email protected]</word>
+                        <word>ym4c0k4mapko1npokec91u9omhgflslyypvtsgmzuzjmegqxoti18wezj2crm1ktqaqeftsw</word>
+                        <word>york</word>
+                        <word>yorkshir</word>
+                        <word>yotiyasuxav</word>
+                        <word>z500</word>
+                        <word>[email protected]</word>
+                        <word>[email protected]</word>
+                        <word>zahlendreh</word>
+                        <word>zaphod</word>
+                        <word>zaubern</word>
+                        <word>zaunpfahl</word>
+                        <word>zbetwaoazt6vrknema52qyfsdlorz87hc5hp9kf2eyawaoipkrfkhu0mxqtu2aozixuhuuct</word>
+                        <word>zehnstellig</word>
+                        <word>zeichnet</word>
+                        <word>zeilenend</word>
+                        <word>zeitabstaenden</word>
+                        <word>zeitgem?�?_</word>
+                        <word>zeitgesteuert</word>
+                        <word>zeitgleich</word>
+                        <word>zeitlich</word>
+                        <word>zeitraum</word>
+                        <word>zeitr?�um</word>
+                        <word>zeitschaltuhr</word>
+                        <word>zeitverz?gerung</word>
+                        <word>[email protected]</word>
+                        <word>zelebrieren</word>
+                        <word>zellmembranen</word>
+                        <word>zellverlust</word>
+                        <word>zellwechseln</word>
+                        <word>zerkratzten</word>
+                        <word>zerrissen</word>
+                        <word>zerschneiden</word>
+                        <word>zerschossenen</word>
+                        <word>zersetzungseffekten</word>
+                        <word>zerst</word>
+                        <word>zerst?rst</word>
+                        <word>zerst?rung</word>
+                        <word>zerst?rungsfrei</word>
+                        <word>zertifizierungen</word>
+                        <word>zeugni?_</word>
+                        <word>zewa</word>
+                        <word>zickt</word>
+                        <word>ziehst</word>
+                        <word>zielort</word>
+                        <word>zieser</word>
+                        <word>ziffern</word>
+                        <word>zifferntastatur</word>
+                        <word>zigarett</word>
+                        <word>zigarettenanz?_??nd</word>
+                        <word>zilxes3ynmmzamt5ppkbicannj9aiwgwt6wc0bbsimd6rsgbgzyaybqjhtbimjvsgatm59d6</word>
+                        <word>zire</word>
+                        <word>zitier</word>
+                        <word>zitiert</word>
+                        <word>zittrig</word>
+                        <word>zivil</word>
+                        <word>zmcuryyprgeaijujoimt3zrgkh2ormgabhriizaxtzw1kktmaj14m4oodascvpxfxtqhe09m</word>
+                        <word>zoellner</word>
+                        <word>zone</word>
+                        <word>zonen</word>
+                        <word>zoohandlung</word>
+                        <word>zoomplay</word>
+                        <word>zordn</word>
+                        <word>zr2owzsr9rpkqb2hc1gtast4mmymmrdxal9rqmueaa4udsbxutxwpsqwyv144cy77ebxlxr</word>
+                        <word>[email protected]</word>
+                        <word>zsammenabreit</word>
+                        <word>zubehoerherstellern</word>
+                        <word>zubeh?ranbiet</word>
+                        <word>zubeh?rverf?_gbarkeit</word>
+                        <word>zueinand</word>
+                        <word>zufolg</word>
+                        <word>zufriedengestellt</word>
+                        <word>zufriedenheit</word>
+                        <word>zufriedenstellend</word>
+                        <word>zuf?_??llig</word>
+                        <word>zuf?_hren</word>
+                        <word>zugangsm?glichkeit</word>
+                        <word>zugeflogen</word>
+                        <word>zugegeben</word>
+                        <word>zugegebenerma?_en</word>
+                        <word>zugegriffen</word>
+                        <word>zugeh?rend</word>
+                        <word>zugeklapptem</word>
+                        <word>zugelassen</word>
+                        <word>zugeordnetem</word>
+                        <word>zugeordneten</word>
+                        <word>zugeschlagen</word>
+                        <word>zugeschnitten</word>
+                        <word>zugesichert</word>
+                        <word>zugetragen</word>
+                        <word>zugreift</word>
+                        <word>zug?�ng</word>
+                        <word>zug?�nglichen</word>
+                        <word>zukangspunkt</word>
+                        <word>zukaufger?�ten</word>
+                        <word>zuklappen</word>
+                        <word>zukleben</word>
+                        <word>zulassungen</word>
+                        <word>zulassungsfrag</word>
+                        <word>zuleitung</word>
+                        <word>zulieferanten</word>
+                        <word>zumailen</word>
+                        <word>zumut</word>
+                        <word>zumutet</word>
+                        <word>zunahm</word>
+                        <word>zunehmend</word>
+                        <word>zunehmenden</word>
+                        <word>zunummt</word>
+                        <word>zurechtgeflickt</word>
+                        <word>zurechtkommen</word>
+                        <word>zurechtkommst</word>
+                        <word>zureden</word>
+                        <word>zurerst</word>
+                        <word>zurgiff</word>
+                        <word>zurp?_cksichern</word>
+                        <word>zurueckgebliebenen</word>
+                        <word>zurueckliegenden</word>
+                        <word>zur?_??ckgegriffen</word>
+                        <word>zur?_??ckschicken</word>
+                        <word>zur?_ckgeb</word>
+                        <word>zur?_ckgegeben</word>
+                        <word>zur?_ckgekehrt</word>
+                        <word>zur?_ckgeschickt</word>
+                        <word>zur?_ckgestellt</word>
+                        <word>zur?_ckgewechselt</word>
+                        <word>zur?_ckhaltend</word>
+                        <word>zur?_ckhangelst</word>
+                        <word>zur?_ckkommt</word>
+                        <word>zur?_ckschalten</word>
+                        <word>zur?_cksetzt</word>
+                        <word>zur?_ckstecken</word>
+                        <word>zur?_cktauschen</word>
+                        <word>zur?_cktritt</word>
+                        <word>zur?_ckwechseln</word>
+                        <word>zur?_ckzubl?�ttern</word>
+                        <word>zur?_ckzukommen</word>
+                        <word>zur?_ckzuschauen</word>
+                        <word>zusammenarbeitet</word>
+                        <word>zusammendr?_cken</word>
+                        <word>zusammengebaut</word>
+                        <word>zusammengefasst</word>
+                        <word>zusammengekasperten</word>
+                        <word>zusammenh?�ngend</word>
+                        <word>zusammenloeten</word>
+                        <word>zusammensammeln</word>
+                        <word>zusammenstellung</word>
+                        <word>zusammenzuf?_gen</word>
+                        <word>zusammenzuf?_hren</word>
+                        <word>zusammenzustellen</word>
+                        <word>zusatzangebot</word>
+                        <word>zusatzfeatur</word>
+                        <word>zusatzgeb?_hr</word>
+                        <word>zusatzinform</word>
+                        <word>zusatzkontakt</word>
+                        <word>zusatzrent</word>
+                        <word>zuschl?�gt</word>
+                        <word>zusetzen</word>
+                        <word>zuspachteln</word>
+                        <word>zustellbest?�tigung</word>
+                        <word>zustellmeldungen</word>
+                        <word>zustellzeit</word>
+                        <word>zustimm</word>
+                        <word>zustimmen</word>
+                        <word>zust?_??ndig</word>
+                        <word>zus?_??tzlich</word>
+                        <word>zuteilen</word>
+                        <word>zutrau</word>
+                        <word>zutrauen</word>
+                        <word>zuvorgekommen</word>
+                        <word>zuzuordnen</word>
+                        <word>zuzuschlagen</word>
+                        <word>zuzuweisen</word>
+                        <word>zwangsl?�ufig</word>
+                        <word>zweckm?�?_ig</word>
+                        <word>zweifelhaften</word>
+                        <word>zweifelsohn</word>
+                        <word>zweitger?�t</word>
+                        <word>zweitverwertung</word>
+                        <word>zwiener</word>
+                        <word>zwirner</word>
+                        <word>zwischenk?�stchen</word>
+                        <word>zwischenziel</word>
+                        <word>zwitschern</word>
+                        <word>zxbiy1owojfcib9safqstryaiarioyi45prgirraycgjq6onmilabzhnk2j3pwrtfikmrbpz</word>
+                        <word>zxnlbsbiyw5kesbuawnodcbtzwhylibnzwluies3ntbpighhyibpy2ggc2nob24gymvzdgvsbhqg</word>
+                        <word>zyklen</word>
+                        <word>zzgl</word>
+                        <word>zztqrujbkdiikg3nhftwt5nninvkguyklxijwpwql6iha7tlelzfaq2hocvt9s07c4rgexnj</word>
+                        <word>z?gern</word>
+                        <word>z?_gige</word>
+                        <word>z?_ndung</word>
+                        <word>z?_ndungserkennung</word>
+                        <word>|*</word>
+                        <word>|/o</word>
+                        <word>|__|_|</word>
+                        <word>|||</word>
+                        <word>~$</word>
+                        <word>~100</word>
+                        <word>~3</word>
+                        <word>~30=a4</word>
+                        <word>~~~~~~~~~~~</word>
+                        <word>?145</word>
+                        <word>??thoma</word>
+                        <word>???_?"</word>
+                        <word>?_?_ber</word>
+                        <word>?_?_berlegen</word>
+                        <word>?_?_bertragung</word>
+                        <word>?_??berhaubt</word>
+                        <word>?_??bertragbar</word>
+                        <word>?_??bertragen</word>
+                        <word>?_??hnelt</word>
+                        <word>?_??ndern</word>
+                        <word>?�hnelt</word>
+                        <word>?�hnlicher</word>
+                        <word>?�lterer</word>
+                        <word>?�nden</word>
+                        <word>?�nder</word>
+                        <word>?�pfel</word>
+                        <word>?�quivalenten</word>
+                        <word>?�ussern</word>
+                        <word>?ffnungen</word>
+                        <word>?ieber</word>
+                        <word>?kostr?_mpf</word>
+                        <word>?rtlichen</word>
+                        <word>?sterreichisch</word>
+                        <word>?_berbr?_ckt</word>
+                        <word>?_bereinstimmt</word>
+                        <word>?_berflogen</word>
+                        <word>?_berfl?_ssigen</word>
+                        <word>?_bergab</word>
+                        <word>?_berhatt</word>
+                        <word>?_berheblich</word>
+                        <word>?_berholt</word>
+                        <word>?_berlang</word>
+                        <word>?_berlastung</word>
+                        <word>?_berlebt</word>
+                        <word>?_berlegungen</word>
+                        <word>?_bermitteln</word>
+                        <word>?_bern</word>
+                        <word>?_bernahm</word>
+                        <word>?_bernahmewert</word>
+                        <word>?_bernehm</word>
+                        <word>?_berorganisieren</word>
+                        <word>?_berpr?_ft</word>
+                        <word>?_berpr?_fungen</word>
+                        <word>?_berragend</word>
+                        <word>?_berraschen</word>
+                        <word>?_berredungsk?_nst</word>
+                        <word>?_berschaubarem</word>
+                        <word>?_berschreiten</word>
+                        <word>?_berschrift</word>
+                        <word>?_bersch?�tzt</word>
+                        <word>?_berseh</word>
+                        <word>?_bersetzt</word>
+                        <word>?_bersetzungen</word>
+                        <word>?_bersichtlichkeit</word>
+                        <word>?_bersiehst</word>
+                        <word>?_berspielen</word>
+                        <word>?_berspielt</word>
+                        <word>?_bersprechen</word>
+                        <word>?_bers?�t</word>
+                        <word>?_berteagen</word>
+                        <word>?_bertragunen</word>
+                        <word>?_bertragungsgeschwindigkeiten</word>
+                        <word>?_bertreffen</word>
+                        <word>?_bertreten</word>
+                        <word>?_bertrifft</word>
+                        <word>?_berweisungsbeleg</word>
+                        <word>?_berzeugung</word>
+                        <word>?_betragen</word>
+                        <word>?_betragungsmodu</word>
+                        <word>?_birgen</word>
+                        <word>?_brigend</word>
+                        <word>?_briggebliebenen</word>
+                        <word>?_bung</word>
+                        <word>?_r</word>
+
+                        <word>kurz</word>
+                        <word>aber</word>
+                        <word>alle</word>
+                        <word>allem</word>
+                        <word>allen</word>
+                        <word>aller</word>
+                        <word>alles</word>
+                        <word>als</word>
+                        <word>also</word>
+                        <word>am</word>
+                        <word>anander</word>
+                        <word>andere</word>
+                        <word>anderem</word>
+                        <word>anderen</word>
+                        <word>anderer</word>
+                        <word>anderes</word>
+                        <word>anderm</word>
+                        <word>andern</word>
+                        <word>anderr</word>
+                        <word>andersauch</word>
+                        <word>auf</word>
+                        <word>aus</word>
+                        <word>bei</word>
+                        <word>bin</word>
+                        <word>bis</word>
+                        <word>bist</word>
+                        <word>da</word>
+                        <word>damit</word>
+                        <word>dann</word>
+                        <word>der</word>
+                        <word>den</word>
+                        <word>des</word>
+                        <word>dem</word>
+                        <word>die</word>
+                        <word>das</word>
+                        <word>da?_derselbe</word>
+                        <word>derselben</word>
+                        <word>denselben</word>
+                        <word>desselben</word>
+                        <word>demselben</word>
+                        <word>dieselbe</word>
+                        <word>dieselben</word>
+                        <word>dasselbe</word>
+                        <word>dazu</word>
+                        <word>dein</word>
+                        <word>deine</word>
+                        <word>deinem</word>
+                        <word>deinen</word>
+                        <word>deiner</word>
+                        <word>deines</word>
+                        <word>denn</word>
+                        <word>derer</word>
+                        <word>dessen</word>
+                        <word>dich</word>
+                        <word>dir</word>
+                        <word>du</word>
+                        <word>dies</word>
+                        <word>diese</word>
+                        <word>diesem</word>
+                        <word>diesen</word>
+                        <word>dieser</word>
+                        <word>dieses</word>
+                        <word>doch</word>
+                        <word>dort</word>
+                        <word>durch</word>
+                        <word>ein</word>
+                        <word>eine</word>
+                        <word>einem</word>
+                        <word>einen</word>
+                        <word>einer</word>
+                        <word>eines</word>
+                        <word>einig</word>
+                        <word>einige</word>
+                        <word>einigem</word>
+                        <word>einigen</word>
+                        <word>einiger</word>
+                        <word>einiges</word>
+                        <word>einmal</word>
+                        <word>er</word>
+                        <word>ihn</word>
+                        <word>ihm</word>
+                        <word>es</word>
+                        <word>etwas</word>
+                        <word>euer</word>
+                        <word>eure</word>
+                        <word>eurem</word>
+                        <word>euren</word>
+                        <word>eurer</word>
+                        <word>eures</word>
+                        <word>f?_r</word>
+                        <word>gegen</word>
+                        <word>gewesen</word>
+                        <word>hab</word>
+                        <word>habe</word>
+                        <word>haben</word>
+                        <word>hat</word>
+                        <word>hatte</word>
+                        <word>hatten</word>
+                        <word>hier</word>
+                        <word>hin</word>
+                        <word>hinter</word>
+                        <word>ich</word>
+                        <word>mich</word>
+                        <word>mir</word>
+                        <word>ihr</word>
+                        <word>ihre</word>
+                        <word>ihrem</word>
+                        <word>ihren</word>
+                        <word>ihrer</word>
+                        <word>ihres</word>
+                        <word>euch</word>
+                        <word>im</word>
+                        <word>in</word>
+                        <word>indem</word>
+                        <word>ins</word>
+                        <word>ist</word>
+                        <word>jede</word>
+                        <word>jedem</word>
+                        <word>jeden</word>
+                        <word>jeder</word>
+                        <word>jedes</word>
+                        <word>jene</word>
+                        <word>jenem</word>
+                        <word>jenen</word>
+                        <word>jener</word>
+                        <word>jenes</word>
+                        <word>jetzt</word>
+                        <word>kann</word>
+                        <word>kein</word>
+                        <word>keine</word>
+                        <word>keinem</word>
+                        <word>keinen</word>
+                        <word>keiner</word>
+                        <word>keines</word>
+                        <word>k?nnen</word>
+                        <word>k?nnte</word>
+                        <word>machen</word>
+                        <word>man</word>
+                        <word>manche</word>
+                        <word>manchem</word>
+                        <word>manchen</word>
+                        <word>mancher</word>
+                        <word>manches</word>
+                        <word>mein</word>
+                        <word>meine</word>
+                        <word>meinem</word>
+                        <word>meinen</word>
+                        <word>meiner</word>
+                        <word>meines</word>
+                        <word>mit</word>
+                        <word>muss</word>
+                        <word>musste</word>
+                        <word>nach</word>
+                        <word>nicht</word>
+                        <word>nichts</word>
+                        <word>noch</word>
+                        <word>nun</word>
+                        <word>nur</word>
+                        <word>ob</word>
+                        <word>oder</word>
+                        <word>ohne</word>
+                        <word>sehr</word>
+                        <word>sein</word>
+                        <word>seine</word>
+                        <word>seinem</word>
+                        <word>seinen</word>
+                        <word>seiner</word>
+                        <word>seines</word>
+                        <word>selbst</word>
+                        <word>sich</word>
+                        <word>sie</word>
+                        <word>ihnen</word>
+                        <word>sind</word>
+                        <word>so</word>
+                        <word>solche</word>
+                        <word>solchem</word>
+                        <word>solchen</word>
+                        <word>solcher</word>
+                        <word>solches</word>
+                        <word>soll</word>
+                        <word>sollte</word>
+                        <word>sondern</word>
+                        <word>sonst</word>
+                        <word>?_ber</word>
+                        <word>um</word>
+                        <word>und</word>
+                        <word>uns</word>
+                        <word>unse</word>
+                        <word>unsem</word>
+                        <word>unsen</word>
+                        <word>unser</word>
+                        <word>unses</word>
+                        <word>unter</word>
+                        <word>viel</word>
+                        <word>vom</word>
+                        <word>von</word>
+                        <word>vor</word>
+                        <word>w?�hrend</word>
+                        <word>war</word>
+                        <word>waren</word>
+                        <word>warst</word>
+                        <word>was</word>
+                        <word>weg</word>
+                        <word>weil</word>
+                        <word>weiter</word>
+                        <word>welche</word>
+                        <word>welchem</word>
+                        <word>welchen</word>
+                        <word>welcher</word>
+                        <word>welches</word>
+                        <word>wenn</word>
+                        <word>werde</word>
+                        <word>werden</word>
+                        <word>wie</word>
+                        <word>wieder</word>
+                        <word>will</word>
+                        <word>wir</word>
+                        <word>wird</word>
+                        <word>wirst</word>
+                        <word>wo</word>
+                        <word>wollen</word>
+                        <word>wollte</word>
+                        <word>w?_rde</word>
+                        <word>w?_rden</word>
+                        <word>zu</word>
+                        <word>zum</word>
+
+                </stopWord>
\ No newline at end of file
diff --git a/xml/tests/testData/performance/IndentUnindent2.xml b/xml/tests/testData/performance/IndentUnindent2.xml
new file mode 100644
index 0000000..e7eeddf
--- /dev/null
+++ b/xml/tests/testData/performance/IndentUnindent2.xml
@@ -0,0 +1,2870 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE schema
+PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
+[
+<!ATTLIST schema
+xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
+<!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
+<!ENTITY % p ''>
+<!ENTITY % s ''>
+]>
+
+<!-- Schema for XML Signatures
+http://www.w3.org/2000/09/xmldsig#
+$Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
+
+Copyright 2001 The Internet Society and W3C (Massachusetts Institute
+of Technology, Institut National de Recherche en Informatique et en
+Automatique, Keio University). All Rights Reserved.
+http://www.w3.org/Consortium/Legal/
+
+This document is governed by the W3C Software License [1] as described
+in the FAQ [2].
+
+[1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
+targetNamespace="http://www.w3.org/2000/09/xmldsig#"
+version="0.1" elementFormDefault="qualified">
+
+<!-- Basic Types Defined for Signatures -->
+
+<simpleType name="CryptoBinary">
+<restriction base="base64Binary">
+</restriction>
+</simpleType>
+
+<!-- Start Signature -->
+
+<element name="Signature" type="ds:SignatureType"/>
+<complexType name="SignatureType">
+<sequence>
+<element ref="ds:SignedInfo"/>
+<element ref="ds:SignatureValue"/>
+<element ref="ds:KeyInfo" minOccurs="0"/>
+<element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
+</sequence>
+<attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="SignatureValue" type="ds:SignatureValueType"/>
+<complexType name="SignatureValueType">
+<simpleContent>
+<extension base="base64Binary">
+<attribute name="Id" type="ID" use="optional"/>
+</extension>
+</simpleContent>
+</complexType>
+
+<!-- Start SignedInfo -->
+
+<element name="SignedInfo" type="ds:SignedInfoType"/>
+<complexType name="SignedInfoType">
+<sequence>
+<element ref="ds:CanonicalizationMethod"/>
+<element ref="ds:SignatureMethod"/>
+<element ref="ds:Reference" maxOccurs="unbounded"/>
+</sequence>
+<attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
+<complexType name="CanonicalizationMethodType" mixed="true">
+<sequence>
+<any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
+<!-- (0,unbounded) elements from (1,1) namespace -->
+</sequence>
+<attribute name="Algorithm" type="anyURI" use="required"/>
+</complexType>
+
+<element name="SignatureMethod" type="ds:SignatureMethodType"/>
+<complexType name="SignatureMethodType" mixed="true">
+<sequence>
+<element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
+<any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+<!-- (0,unbounded) elements from (1,1) external namespace -->
+</sequence>
+<attribute name="Algorithm" type="anyURI" use="required"/>
+</complexType>
+
+<!-- Start Reference -->
+
+<element name="Reference" type="ds:ReferenceType"/>
+<complexType name="ReferenceType">
+<sequence>
+<element ref="ds:Transforms" minOccurs="0"/>
+<element ref="ds:DigestMethod"/>
+<element ref="ds:DigestValue"/>
+</sequence>
+<attribute name="Id" type="ID" use="optional"/>
+<attribute name="URI" type="anyURI" use="optional"/>
+<attribute name="Type" type="anyURI" use="optional"/>
+</complexType>
+
+<element name="Transforms" type="ds:TransformsType"/>
+<complexType name="TransformsType">
+<sequence>
+<element ref="ds:Transform" maxOccurs="unbounded"/>
+</sequence>
+</complexType>
+
+<element name="Transform" type="ds:TransformType"/>
+<complexType name="TransformType" mixed="true">
+<choice minOccurs="0" maxOccurs="unbounded">
+<any namespace="##other" processContents="lax"/>
+<!-- (1,1) elements from (0,unbounded) namespaces -->
+<element name="XPath" type="string"/>
+</choice>
+<attribute name="Algorithm" type="anyURI" use="required"/>
+</complexType>
+
+<!-- End Reference -->
+
+<element name="DigestMethod" type="ds:DigestMethodType"/>
+<complexType name="DigestMethodType" mixed="true">
+<sequence>
+<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+</sequence>
+<attribute name="Algorithm" type="anyURI" use="required"/>
+</complexType>
+
+<element name="DigestValue" type="ds:DigestValueType"/>
+<simpleType name="DigestValueType">
+<restriction base="base64Binary"/>
+</simpleType>
+
+<!-- End SignedInfo -->
+
+<!-- Start KeyInfo -->
+
+<element name="KeyInfo" type="ds:KeyInfoType"/>
+<complexType name="KeyInfoType" mixed="true">
+<choice maxOccurs="unbounded">
+<element ref="ds:KeyName"/>
+<element ref="ds:KeyValue"/>
+<element ref="ds:RetrievalMethod"/>
+<element ref="ds:X509Data"/>
+<element ref="ds:PGPData"/>
+<element ref="ds:SPKIData"/>
+<element ref="ds:MgmtData"/>
+<any processContents="lax" namespace="##other"/>
+<!-- (1,1) elements from (0,unbounded) namespaces -->
+</choice>
+<attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="KeyName" type="string"/>
+<element name="MgmtData" type="string"/>
+
+<element name="KeyValue" type="ds:KeyValueType"/>
+<complexType name="KeyValueType" mixed="true">
+<choice>
+<element ref="ds:DSAKeyValue"/>
+<element ref="ds:RSAKeyValue"/>
+<any namespace="##other" processContents="lax"/>
+</choice>
+</complexType>
+
+<element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
+<complexType name="RetrievalMethodType">
+<sequence>
+<element ref="ds:Transforms" minOccurs="0"/>
+</sequence>
+<attribute name="URI" type="anyURI"/>
+<attribute name="Type" type="anyURI" use="optional"/>
+</complexType>
+
+<!-- Start X509Data -->
+
+<element name="X509Data" type="ds:X509DataType"/>
+<complexType name="X509DataType">
+<sequence maxOccurs="unbounded">
+<choice>
+<element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
+<element name="X509SKI" type="base64Binary"/>
+<element name="X509SubjectName" type="string"/>
+<element name="X509Certificate" type="base64Binary"/>
+<element name="X509CRL" type="base64Binary"/>
+<any namespace="##other" processContents="lax"/>
+</choice>
+</sequence>
+</complexType>
+
+<complexType name="X509IssuerSerialType">
+<sequence>
+<element name="X509IssuerName" type="string"/>
+<element name="X509SerialNumber" type="integer"/>
+</sequence>
+</complexType>
+
+<!-- End X509Data -->
+
+<!-- Begin PGPData -->
+
+<element name="PGPData" type="ds:PGPDataType"/>
+<complexType name="PGPDataType">
+<choice>
+<sequence>
+<element name="PGPKeyID" type="base64Binary"/>
+<element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
+<any namespace="##other" processContents="lax" minOccurs="0"
+maxOccurs="unbounded"/>
+</sequence>
+<sequence>
+<element name="PGPKeyPacket" type="base64Binary"/>
+<any namespace="##other" processContents="lax" minOccurs="0"
+maxOccurs="unbounded"/>
+</sequence>
+</choice>
+</complexType>
+
+<!-- End PGPData -->
+
+<!-- Begin SPKIData -->
+
+<element name="SPKIData" type="ds:SPKIDataType"/>
+<complexType name="SPKIDataType">
+<sequence maxOccurs="unbounded">
+<element name="SPKISexp" type="base64Binary"/>
+<any namespace="##other" processContents="lax" minOccurs="0"/>
+</sequence>
+</complexType>
+
+<!-- End SPKIData -->
+
+<!-- End KeyInfo -->
+
+<!-- Start Object (Manifest, SignatureProperty) -->
+
+<element name="Object" type="ds:ObjectType"/>
+<complexType name="ObjectType" mixed="true">
+<sequence minOccurs="0" maxOccurs="unbounded">
+<any namespace="##any" processContents="lax"/>
+</sequence>
+<attribute name="Id" type="ID" use="optional"/>
+<attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
+<attribute name="Encoding" type="anyURI" use="optional"/>
+</complexType>
+
+<element name="Manifest" type="ds:ManifestType"/>
+<complexType name="ManifestType">
+<sequence>
+<element ref="ds:Reference" maxOccurs="unbounded"/>
+</sequence>
+<attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
+<complexType name="SignaturePropertiesType">
+<sequence>
+<element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
+</sequence>
+<attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="SignatureProperty" type="ds:SignaturePropertyType"/>
+<complexType name="SignaturePropertyType" mixed="true">
+<choice maxOccurs="unbounded">
+<any namespace="##other" processContents="lax"/>
+<!-- (1,1) elements from (1,unbounded) namespaces -->
+</choice>
+<attribute name="Target" type="anyURI" use="required"/>
+<attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<!-- End Object (Manifest, SignatureProperty) -->
+
+<!-- Start Algorithm Parameters -->
+
+<simpleType name="HMACOutputLengthType">
+<restriction base="integer"/>
+</simpleType>
+
+<!-- Start KeyValue Element-types -->
+
+<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
+<complexType name="DSAKeyValueType">
+<sequence>
+<sequence minOccurs="0">
+<element name="P" type="ds:CryptoBinary"/>
+<element name="Q" type="ds:CryptoBinary"/>
+</sequence>
+<element name="G" type="ds:CryptoBinary" minOccurs="0"/>
+<element name="Y" type="ds:CryptoBinary"/>
+<element name="J" type="ds:CryptoBinary" minOccurs="0"/>
+<sequence minOccurs="0">
+<element name="Seed" type="ds:CryptoBinary"/>
+<element name="PgenCounter" type="ds:CryptoBinary"/>
+</sequence>
+</sequence>
+</complexType>
+
+<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
+<complexType name="RSAKeyValueType">
+<sequence>
+<element name="Modulus" type="ds:CryptoBinary"/>
+<element name="Exponent" type="ds:CryptoBinary"/>
+</sequence>
+</complexType>
+
+<!-- End KeyValue Element-types -->
+
+<!-- End Signature -->
+
+</schema>
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE schema
+  PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
+ [
+   <!ATTLIST schema
+     xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
+   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
+   <!ENTITY % p ''>
+   <!ENTITY % s ''>
+  ]>
+
+<!-- Schema for XML Signatures
+    http://www.w3.org/2000/09/xmldsig#
+    $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
+
+    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
+    of Technology, Institut National de Recherche en Informatique et en
+    Automatique, Keio University). All Rights Reserved.
+    http://www.w3.org/Consortium/Legal/
+
+    This document is governed by the W3C Software License [1] as described
+    in the FAQ [2].
+
+    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
+        targetNamespace="http://www.w3.org/2000/09/xmldsig#"
+        version="0.1" elementFormDefault="qualified">
+
+<!-- Basic Types Defined for Signatures -->
+
+<simpleType name="CryptoBinary">
+  <restriction base="base64Binary">
+  </restriction>
+</simpleType>
+
+<!-- Start Signature -->
+
+<element name="Signature" type="ds:SignatureType"/>
+<complexType name="SignatureType">
+  <sequence>
+    <element ref="ds:SignedInfo"/>
+    <element ref="ds:SignatureValue"/>
+    <element ref="ds:KeyInfo" minOccurs="0"/>
+    <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="SignatureValue" type="ds:SignatureValueType"/>
+  <complexType name="SignatureValueType">
+    <simpleContent>
+      <extension base="base64Binary">
+        <attribute name="Id" type="ID" use="optional"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+<!-- Start SignedInfo -->
+
+<element name="SignedInfo" type="ds:SignedInfoType"/>
+<complexType name="SignedInfoType">
+  <sequence>
+    <element ref="ds:CanonicalizationMethod"/>
+    <element ref="ds:SignatureMethod"/>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
+  <complexType name="CanonicalizationMethodType" mixed="true">
+    <sequence>
+      <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+  <element name="SignatureMethod" type="ds:SignatureMethodType"/>
+  <complexType name="SignatureMethodType" mixed="true">
+    <sequence>
+      <element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
+      <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) external namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- Start Reference -->
+
+<element name="Reference" type="ds:ReferenceType"/>
+<complexType name="ReferenceType">
+  <sequence>
+    <element ref="ds:Transforms" minOccurs="0"/>
+    <element ref="ds:DigestMethod"/>
+    <element ref="ds:DigestValue"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="URI" type="anyURI" use="optional"/>
+  <attribute name="Type" type="anyURI" use="optional"/>
+</complexType>
+
+  <element name="Transforms" type="ds:TransformsType"/>
+  <complexType name="TransformsType">
+    <sequence>
+      <element ref="ds:Transform" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+
+  <element name="Transform" type="ds:TransformType"/>
+  <complexType name="TransformType" mixed="true">
+    <choice minOccurs="0" maxOccurs="unbounded">
+      <any namespace="##other" processContents="lax"/>
+      <!-- (1,1) elements from (0,unbounded) namespaces -->
+      <element name="XPath" type="string"/>
+    </choice>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- End Reference -->
+
+<element name="DigestMethod" type="ds:DigestMethodType"/>
+<complexType name="DigestMethodType" mixed="true">
+  <sequence>
+    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Algorithm" type="anyURI" use="required"/>
+</complexType>
+
+<element name="DigestValue" type="ds:DigestValueType"/>
+<simpleType name="DigestValueType">
+  <restriction base="base64Binary"/>
+</simpleType>
+
+<!-- End SignedInfo -->
+
+<!-- Start KeyInfo -->
+
+<element name="KeyInfo" type="ds:KeyInfoType"/>
+<complexType name="KeyInfoType" mixed="true">
+  <choice maxOccurs="unbounded">
+    <element ref="ds:KeyName"/>
+    <element ref="ds:KeyValue"/>
+    <element ref="ds:RetrievalMethod"/>
+    <element ref="ds:X509Data"/>
+    <element ref="ds:PGPData"/>
+    <element ref="ds:SPKIData"/>
+    <element ref="ds:MgmtData"/>
+    <any processContents="lax" namespace="##other"/>
+    <!-- (1,1) elements from (0,unbounded) namespaces -->
+  </choice>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="KeyName" type="string"/>
+  <element name="MgmtData" type="string"/>
+
+  <element name="KeyValue" type="ds:KeyValueType"/>
+  <complexType name="KeyValueType" mixed="true">
+   <choice>
+     <element ref="ds:DSAKeyValue"/>
+     <element ref="ds:RSAKeyValue"/>
+     <any namespace="##other" processContents="lax"/>
+   </choice>
+  </complexType>
+
+  <element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
+  <complexType name="RetrievalMethodType">
+    <sequence>
+      <element ref="ds:Transforms" minOccurs="0"/>
+    </sequence>
+    <attribute name="URI" type="anyURI"/>
+    <attribute name="Type" type="anyURI" use="optional"/>
+  </complexType>
+
+<!-- Start X509Data -->
+
+<element name="X509Data" type="ds:X509DataType"/>
+<complexType name="X509DataType">
+  <sequence maxOccurs="unbounded">
+    <choice>
+      <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
+      <element name="X509SKI" type="base64Binary"/>
+      <element name="X509SubjectName" type="string"/>
+      <element name="X509Certificate" type="base64Binary"/>
+      <element name="X509CRL" type="base64Binary"/>
+      <any namespace="##other" processContents="lax"/>
+    </choice>
+  </sequence>
+</complexType>
+
+<complexType name="X509IssuerSerialType">
+  <sequence>
+    <element name="X509IssuerName" type="string"/>
+    <element name="X509SerialNumber" type="integer"/>
+  </sequence>
+</complexType>
+
+<!-- End X509Data -->
+
+<!-- Begin PGPData -->
+
+<element name="PGPData" type="ds:PGPDataType"/>
+<complexType name="PGPDataType">
+  <choice>
+    <sequence>
+      <element name="PGPKeyID" type="base64Binary"/>
+      <element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+    <sequence>
+      <element name="PGPKeyPacket" type="base64Binary"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+  </choice>
+</complexType>
+
+<!-- End PGPData -->
+
+<!-- Begin SPKIData -->
+
+<element name="SPKIData" type="ds:SPKIDataType"/>
+<complexType name="SPKIDataType">
+  <sequence maxOccurs="unbounded">
+    <element name="SPKISexp" type="base64Binary"/>
+    <any namespace="##other" processContents="lax" minOccurs="0"/>
+  </sequence>
+</complexType>
+
+<!-- End SPKIData -->
+
+<!-- End KeyInfo -->
+
+<!-- Start Object (Manifest, SignatureProperty) -->
+
+<element name="Object" type="ds:ObjectType"/>
+<complexType name="ObjectType" mixed="true">
+  <sequence minOccurs="0" maxOccurs="unbounded">
+    <any namespace="##any" processContents="lax"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
+  <attribute name="Encoding" type="anyURI" use="optional"/>
+</complexType>
+
+<element name="Manifest" type="ds:ManifestType"/>
+<complexType name="ManifestType">
+  <sequence>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
+<complexType name="SignaturePropertiesType">
+  <sequence>
+    <element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+   <element name="SignatureProperty" type="ds:SignaturePropertyType"/>
+   <complexType name="SignaturePropertyType" mixed="true">
+     <choice maxOccurs="unbounded">
+       <any namespace="##other" processContents="lax"/>
+       <!-- (1,1) elements from (1,unbounded) namespaces -->
+     </choice>
+     <attribute name="Target" type="anyURI" use="required"/>
+     <attribute name="Id" type="ID" use="optional"/>
+   </complexType>
+
+<!-- End Object (Manifest, SignatureProperty) -->
+
+<!-- Start Algorithm Parameters -->
+
+<simpleType name="HMACOutputLengthType">
+  <restriction base="integer"/>
+</simpleType>
+
+<!-- Start KeyValue Element-types -->
+
+<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
+<complexType name="DSAKeyValueType">
+  <sequence>
+    <sequence minOccurs="0">
+      <element name="P" type="ds:CryptoBinary"/>
+      <element name="Q" type="ds:CryptoBinary"/>
+    </sequence>
+    <element name="G" type="ds:CryptoBinary" minOccurs="0"/>
+    <element name="Y" type="ds:CryptoBinary"/>
+    <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
+    <sequence minOccurs="0">
+      <element name="Seed" type="ds:CryptoBinary"/>
+      <element name="PgenCounter" type="ds:CryptoBinary"/>
+    </sequence>
+  </sequence>
+</complexType>
+
+<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
+<complexType name="RSAKeyValueType">
+  <sequence>
+    <element name="Modulus" type="ds:CryptoBinary"/>
+    <element name="Exponent" type="ds:CryptoBinary"/>
+  </sequence>
+</complexType>
+
+<!-- End KeyValue Element-types -->
+
+<!-- End Signature -->
+
+</schema>
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE schema
+  PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
+ [
+   <!ATTLIST schema
+     xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
+   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
+   <!ENTITY % p ''>
+   <!ENTITY % s ''>
+  ]>
+
+<!-- Schema for XML Signatures
+    http://www.w3.org/2000/09/xmldsig#
+    $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
+
+    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
+    of Technology, Institut National de Recherche en Informatique et en
+    Automatique, Keio University). All Rights Reserved.
+    http://www.w3.org/Consortium/Legal/
+
+    This document is governed by the W3C Software License [1] as described
+    in the FAQ [2].
+
+    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
+        targetNamespace="http://www.w3.org/2000/09/xmldsig#"
+        version="0.1" elementFormDefault="qualified">
+
+<!-- Basic Types Defined for Signatures -->
+
+<simpleType name="CryptoBinary">
+  <restriction base="base64Binary">
+  </restriction>
+</simpleType>
+
+<!-- Start Signature -->
+
+<element name="Signature" type="ds:SignatureType"/>
+<complexType name="SignatureType">
+  <sequence>
+    <element ref="ds:SignedInfo"/>
+    <element ref="ds:SignatureValue"/>
+    <element ref="ds:KeyInfo" minOccurs="0"/>
+    <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="SignatureValue" type="ds:SignatureValueType"/>
+  <complexType name="SignatureValueType">
+    <simpleContent>
+      <extension base="base64Binary">
+        <attribute name="Id" type="ID" use="optional"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+<!-- Start SignedInfo -->
+
+<element name="SignedInfo" type="ds:SignedInfoType"/>
+<complexType name="SignedInfoType">
+  <sequence>
+    <element ref="ds:CanonicalizationMethod"/>
+    <element ref="ds:SignatureMethod"/>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
+  <complexType name="CanonicalizationMethodType" mixed="true">
+    <sequence>
+      <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+  <element name="SignatureMethod" type="ds:SignatureMethodType"/>
+  <complexType name="SignatureMethodType" mixed="true">
+    <sequence>
+      <element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
+      <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) external namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- Start Reference -->
+
+<element name="Reference" type="ds:ReferenceType"/>
+<complexType name="ReferenceType">
+  <sequence>
+    <element ref="ds:Transforms" minOccurs="0"/>
+    <element ref="ds:DigestMethod"/>
+    <element ref="ds:DigestValue"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="URI" type="anyURI" use="optional"/>
+  <attribute name="Type" type="anyURI" use="optional"/>
+</complexType>
+
+  <element name="Transforms" type="ds:TransformsType"/>
+  <complexType name="TransformsType">
+    <sequence>
+      <element ref="ds:Transform" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+
+  <element name="Transform" type="ds:TransformType"/>
+  <complexType name="TransformType" mixed="true">
+    <choice minOccurs="0" maxOccurs="unbounded">
+      <any namespace="##other" processContents="lax"/>
+      <!-- (1,1) elements from (0,unbounded) namespaces -->
+      <element name="XPath" type="string"/>
+    </choice>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- End Reference -->
+
+<element name="DigestMethod" type="ds:DigestMethodType"/>
+<complexType name="DigestMethodType" mixed="true">
+  <sequence>
+    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Algorithm" type="anyURI" use="required"/>
+</complexType>
+
+<element name="DigestValue" type="ds:DigestValueType"/>
+<simpleType name="DigestValueType">
+  <restriction base="base64Binary"/>
+</simpleType>
+
+<!-- End SignedInfo -->
+
+<!-- Start KeyInfo -->
+
+<element name="KeyInfo" type="ds:KeyInfoType"/>
+<complexType name="KeyInfoType" mixed="true">
+  <choice maxOccurs="unbounded">
+    <element ref="ds:KeyName"/>
+    <element ref="ds:KeyValue"/>
+    <element ref="ds:RetrievalMethod"/>
+    <element ref="ds:X509Data"/>
+    <element ref="ds:PGPData"/>
+    <element ref="ds:SPKIData"/>
+    <element ref="ds:MgmtData"/>
+    <any processContents="lax" namespace="##other"/>
+    <!-- (1,1) elements from (0,unbounded) namespaces -->
+  </choice>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="KeyName" type="string"/>
+  <element name="MgmtData" type="string"/>
+
+  <element name="KeyValue" type="ds:KeyValueType"/>
+  <complexType name="KeyValueType" mixed="true">
+   <choice>
+     <element ref="ds:DSAKeyValue"/>
+     <element ref="ds:RSAKeyValue"/>
+     <any namespace="##other" processContents="lax"/>
+   </choice>
+  </complexType>
+
+  <element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
+  <complexType name="RetrievalMethodType">
+    <sequence>
+      <element ref="ds:Transforms" minOccurs="0"/>
+    </sequence>
+    <attribute name="URI" type="anyURI"/>
+    <attribute name="Type" type="anyURI" use="optional"/>
+  </complexType>
+
+<!-- Start X509Data -->
+
+<element name="X509Data" type="ds:X509DataType"/>
+<complexType name="X509DataType">
+  <sequence maxOccurs="unbounded">
+    <choice>
+      <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
+      <element name="X509SKI" type="base64Binary"/>
+      <element name="X509SubjectName" type="string"/>
+      <element name="X509Certificate" type="base64Binary"/>
+      <element name="X509CRL" type="base64Binary"/>
+      <any namespace="##other" processContents="lax"/>
+    </choice>
+  </sequence>
+</complexType>
+
+<complexType name="X509IssuerSerialType">
+  <sequence>
+    <element name="X509IssuerName" type="string"/>
+    <element name="X509SerialNumber" type="integer"/>
+  </sequence>
+</complexType>
+
+<!-- End X509Data -->
+
+<!-- Begin PGPData -->
+
+<element name="PGPData" type="ds:PGPDataType"/>
+<complexType name="PGPDataType">
+  <choice>
+    <sequence>
+      <element name="PGPKeyID" type="base64Binary"/>
+      <element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+    <sequence>
+      <element name="PGPKeyPacket" type="base64Binary"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+  </choice>
+</complexType>
+
+<!-- End PGPData -->
+
+<!-- Begin SPKIData -->
+
+<element name="SPKIData" type="ds:SPKIDataType"/>
+<complexType name="SPKIDataType">
+  <sequence maxOccurs="unbounded">
+    <element name="SPKISexp" type="base64Binary"/>
+    <any namespace="##other" processContents="lax" minOccurs="0"/>
+  </sequence>
+</complexType>
+
+<!-- End SPKIData -->
+
+<!-- End KeyInfo -->
+
+<!-- Start Object (Manifest, SignatureProperty) -->
+
+<element name="Object" type="ds:ObjectType"/>
+<complexType name="ObjectType" mixed="true">
+  <sequence minOccurs="0" maxOccurs="unbounded">
+    <any namespace="##any" processContents="lax"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
+  <attribute name="Encoding" type="anyURI" use="optional"/>
+</complexType>
+
+<element name="Manifest" type="ds:ManifestType"/>
+<complexType name="ManifestType">
+  <sequence>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
+<complexType name="SignaturePropertiesType">
+  <sequence>
+    <element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+   <element name="SignatureProperty" type="ds:SignaturePropertyType"/>
+   <complexType name="SignaturePropertyType" mixed="true">
+     <choice maxOccurs="unbounded">
+       <any namespace="##other" processContents="lax"/>
+       <!-- (1,1) elements from (1,unbounded) namespaces -->
+     </choice>
+     <attribute name="Target" type="anyURI" use="required"/>
+     <attribute name="Id" type="ID" use="optional"/>
+   </complexType>
+
+<!-- End Object (Manifest, SignatureProperty) -->
+
+<!-- Start Algorithm Parameters -->
+
+<simpleType name="HMACOutputLengthType">
+  <restriction base="integer"/>
+</simpleType>
+
+<!-- Start KeyValue Element-types -->
+
+<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
+<complexType name="DSAKeyValueType">
+  <sequence>
+    <sequence minOccurs="0">
+      <element name="P" type="ds:CryptoBinary"/>
+      <element name="Q" type="ds:CryptoBinary"/>
+    </sequence>
+    <element name="G" type="ds:CryptoBinary" minOccurs="0"/>
+    <element name="Y" type="ds:CryptoBinary"/>
+    <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
+    <sequence minOccurs="0">
+      <element name="Seed" type="ds:CryptoBinary"/>
+      <element name="PgenCounter" type="ds:CryptoBinary"/>
+    </sequence>
+  </sequence>
+</complexType>
+
+<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
+<complexType name="RSAKeyValueType">
+  <sequence>
+    <element name="Modulus" type="ds:CryptoBinary"/>
+    <element name="Exponent" type="ds:CryptoBinary"/>
+  </sequence>
+</complexType>
+
+<!-- End KeyValue Element-types -->
+
+<!-- End Signature -->
+
+</schema>
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE schema
+  PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
+ [
+   <!ATTLIST schema
+     xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
+   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
+   <!ENTITY % p ''>
+   <!ENTITY % s ''>
+  ]>
+
+<!-- Schema for XML Signatures
+    http://www.w3.org/2000/09/xmldsig#
+    $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
+
+    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
+    of Technology, Institut National de Recherche en Informatique et en
+    Automatique, Keio University). All Rights Reserved.
+    http://www.w3.org/Consortium/Legal/
+
+    This document is governed by the W3C Software License [1] as described
+    in the FAQ [2].
+
+    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
+        targetNamespace="http://www.w3.org/2000/09/xmldsig#"
+        version="0.1" elementFormDefault="qualified">
+
+<!-- Basic Types Defined for Signatures -->
+
+<simpleType name="CryptoBinary">
+  <restriction base="base64Binary">
+  </restriction>
+</simpleType>
+
+<!-- Start Signature -->
+
+<element name="Signature" type="ds:SignatureType"/>
+<complexType name="SignatureType">
+  <sequence>
+    <element ref="ds:SignedInfo"/>
+    <element ref="ds:SignatureValue"/>
+    <element ref="ds:KeyInfo" minOccurs="0"/>
+    <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="SignatureValue" type="ds:SignatureValueType"/>
+  <complexType name="SignatureValueType">
+    <simpleContent>
+      <extension base="base64Binary">
+        <attribute name="Id" type="ID" use="optional"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+<!-- Start SignedInfo -->
+
+<element name="SignedInfo" type="ds:SignedInfoType"/>
+<complexType name="SignedInfoType">
+  <sequence>
+    <element ref="ds:CanonicalizationMethod"/>
+    <element ref="ds:SignatureMethod"/>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
+  <complexType name="CanonicalizationMethodType" mixed="true">
+    <sequence>
+      <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+  <element name="SignatureMethod" type="ds:SignatureMethodType"/>
+  <complexType name="SignatureMethodType" mixed="true">
+    <sequence>
+      <element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
+      <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) external namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- Start Reference -->
+
+<element name="Reference" type="ds:ReferenceType"/>
+<complexType name="ReferenceType">
+  <sequence>
+    <element ref="ds:Transforms" minOccurs="0"/>
+    <element ref="ds:DigestMethod"/>
+    <element ref="ds:DigestValue"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="URI" type="anyURI" use="optional"/>
+  <attribute name="Type" type="anyURI" use="optional"/>
+</complexType>
+
+  <element name="Transforms" type="ds:TransformsType"/>
+  <complexType name="TransformsType">
+    <sequence>
+      <element ref="ds:Transform" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+
+  <element name="Transform" type="ds:TransformType"/>
+  <complexType name="TransformType" mixed="true">
+    <choice minOccurs="0" maxOccurs="unbounded">
+      <any namespace="##other" processContents="lax"/>
+      <!-- (1,1) elements from (0,unbounded) namespaces -->
+      <element name="XPath" type="string"/>
+    </choice>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- End Reference -->
+
+<element name="DigestMethod" type="ds:DigestMethodType"/>
+<complexType name="DigestMethodType" mixed="true">
+  <sequence>
+    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Algorithm" type="anyURI" use="required"/>
+</complexType>
+
+<element name="DigestValue" type="ds:DigestValueType"/>
+<simpleType name="DigestValueType">
+  <restriction base="base64Binary"/>
+</simpleType>
+
+<!-- End SignedInfo -->
+
+<!-- Start KeyInfo -->
+
+<element name="KeyInfo" type="ds:KeyInfoType"/>
+<complexType name="KeyInfoType" mixed="true">
+  <choice maxOccurs="unbounded">
+    <element ref="ds:KeyName"/>
+    <element ref="ds:KeyValue"/>
+    <element ref="ds:RetrievalMethod"/>
+    <element ref="ds:X509Data"/>
+    <element ref="ds:PGPData"/>
+    <element ref="ds:SPKIData"/>
+    <element ref="ds:MgmtData"/>
+    <any processContents="lax" namespace="##other"/>
+    <!-- (1,1) elements from (0,unbounded) namespaces -->
+  </choice>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="KeyName" type="string"/>
+  <element name="MgmtData" type="string"/>
+
+  <element name="KeyValue" type="ds:KeyValueType"/>
+  <complexType name="KeyValueType" mixed="true">
+   <choice>
+     <element ref="ds:DSAKeyValue"/>
+     <element ref="ds:RSAKeyValue"/>
+     <any namespace="##other" processContents="lax"/>
+   </choice>
+  </complexType>
+
+  <element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
+  <complexType name="RetrievalMethodType">
+    <sequence>
+      <element ref="ds:Transforms" minOccurs="0"/>
+    </sequence>
+    <attribute name="URI" type="anyURI"/>
+    <attribute name="Type" type="anyURI" use="optional"/>
+  </complexType>
+
+<!-- Start X509Data -->
+
+<element name="X509Data" type="ds:X509DataType"/>
+<complexType name="X509DataType">
+  <sequence maxOccurs="unbounded">
+    <choice>
+      <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
+      <element name="X509SKI" type="base64Binary"/>
+      <element name="X509SubjectName" type="string"/>
+      <element name="X509Certificate" type="base64Binary"/>
+      <element name="X509CRL" type="base64Binary"/>
+      <any namespace="##other" processContents="lax"/>
+    </choice>
+  </sequence>
+</complexType>
+
+<complexType name="X509IssuerSerialType">
+  <sequence>
+    <element name="X509IssuerName" type="string"/>
+    <element name="X509SerialNumber" type="integer"/>
+  </sequence>
+</complexType>
+
+<!-- End X509Data -->
+
+<!-- Begin PGPData -->
+
+<element name="PGPData" type="ds:PGPDataType"/>
+<complexType name="PGPDataType">
+  <choice>
+    <sequence>
+      <element name="PGPKeyID" type="base64Binary"/>
+      <element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+    <sequence>
+      <element name="PGPKeyPacket" type="base64Binary"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+  </choice>
+</complexType>
+
+<!-- End PGPData -->
+
+<!-- Begin SPKIData -->
+
+<element name="SPKIData" type="ds:SPKIDataType"/>
+<complexType name="SPKIDataType">
+  <sequence maxOccurs="unbounded">
+    <element name="SPKISexp" type="base64Binary"/>
+    <any namespace="##other" processContents="lax" minOccurs="0"/>
+  </sequence>
+</complexType>
+
+<!-- End SPKIData -->
+
+<!-- End KeyInfo -->
+
+<!-- Start Object (Manifest, SignatureProperty) -->
+
+<element name="Object" type="ds:ObjectType"/>
+<complexType name="ObjectType" mixed="true">
+  <sequence minOccurs="0" maxOccurs="unbounded">
+    <any namespace="##any" processContents="lax"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
+  <attribute name="Encoding" type="anyURI" use="optional"/>
+</complexType>
+
+<element name="Manifest" type="ds:ManifestType"/>
+<complexType name="ManifestType">
+  <sequence>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
+<complexType name="SignaturePropertiesType">
+  <sequence>
+    <element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+   <element name="SignatureProperty" type="ds:SignaturePropertyType"/>
+   <complexType name="SignaturePropertyType" mixed="true">
+     <choice maxOccurs="unbounded">
+       <any namespace="##other" processContents="lax"/>
+       <!-- (1,1) elements from (1,unbounded) namespaces -->
+     </choice>
+     <attribute name="Target" type="anyURI" use="required"/>
+     <attribute name="Id" type="ID" use="optional"/>
+   </complexType>
+
+<!-- End Object (Manifest, SignatureProperty) -->
+
+<!-- Start Algorithm Parameters -->
+
+<simpleType name="HMACOutputLengthType">
+  <restriction base="integer"/>
+</simpleType>
+
+<!-- Start KeyValue Element-types -->
+
+<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
+<complexType name="DSAKeyValueType">
+  <sequence>
+    <sequence minOccurs="0">
+      <element name="P" type="ds:CryptoBinary"/>
+      <element name="Q" type="ds:CryptoBinary"/>
+    </sequence>
+    <element name="G" type="ds:CryptoBinary" minOccurs="0"/>
+    <element name="Y" type="ds:CryptoBinary"/>
+    <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
+    <sequence minOccurs="0">
+      <element name="Seed" type="ds:CryptoBinary"/>
+      <element name="PgenCounter" type="ds:CryptoBinary"/>
+    </sequence>
+  </sequence>
+</complexType>
+
+<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
+<complexType name="RSAKeyValueType">
+  <sequence>
+    <element name="Modulus" type="ds:CryptoBinary"/>
+    <element name="Exponent" type="ds:CryptoBinary"/>
+  </sequence>
+</complexType>
+
+<!-- End KeyValue Element-types -->
+
+<!-- End Signature -->
+
+</schema>
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE schema
+  PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
+ [
+   <!ATTLIST schema
+     xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
+   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
+   <!ENTITY % p ''>
+   <!ENTITY % s ''>
+  ]>
+
+<!-- Schema for XML Signatures
+    http://www.w3.org/2000/09/xmldsig#
+    $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
+
+    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
+    of Technology, Institut National de Recherche en Informatique et en
+    Automatique, Keio University). All Rights Reserved.
+    http://www.w3.org/Consortium/Legal/
+
+    This document is governed by the W3C Software License [1] as described
+    in the FAQ [2].
+
+    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
+        targetNamespace="http://www.w3.org/2000/09/xmldsig#"
+        version="0.1" elementFormDefault="qualified">
+
+<!-- Basic Types Defined for Signatures -->
+
+<simpleType name="CryptoBinary">
+  <restriction base="base64Binary">
+  </restriction>
+</simpleType>
+
+<!-- Start Signature -->
+
+<element name="Signature" type="ds:SignatureType"/>
+<complexType name="SignatureType">
+  <sequence>
+    <element ref="ds:SignedInfo"/>
+    <element ref="ds:SignatureValue"/>
+    <element ref="ds:KeyInfo" minOccurs="0"/>
+    <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="SignatureValue" type="ds:SignatureValueType"/>
+  <complexType name="SignatureValueType">
+    <simpleContent>
+      <extension base="base64Binary">
+        <attribute name="Id" type="ID" use="optional"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+<!-- Start SignedInfo -->
+
+<element name="SignedInfo" type="ds:SignedInfoType"/>
+<complexType name="SignedInfoType">
+  <sequence>
+    <element ref="ds:CanonicalizationMethod"/>
+    <element ref="ds:SignatureMethod"/>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
+  <complexType name="CanonicalizationMethodType" mixed="true">
+    <sequence>
+      <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+  <element name="SignatureMethod" type="ds:SignatureMethodType"/>
+  <complexType name="SignatureMethodType" mixed="true">
+    <sequence>
+      <element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
+      <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) external namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- Start Reference -->
+
+<element name="Reference" type="ds:ReferenceType"/>
+<complexType name="ReferenceType">
+  <sequence>
+    <element ref="ds:Transforms" minOccurs="0"/>
+    <element ref="ds:DigestMethod"/>
+    <element ref="ds:DigestValue"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="URI" type="anyURI" use="optional"/>
+  <attribute name="Type" type="anyURI" use="optional"/>
+</complexType>
+
+  <element name="Transforms" type="ds:TransformsType"/>
+  <complexType name="TransformsType">
+    <sequence>
+      <element ref="ds:Transform" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+
+  <element name="Transform" type="ds:TransformType"/>
+  <complexType name="TransformType" mixed="true">
+    <choice minOccurs="0" maxOccurs="unbounded">
+      <any namespace="##other" processContents="lax"/>
+      <!-- (1,1) elements from (0,unbounded) namespaces -->
+      <element name="XPath" type="string"/>
+    </choice>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- End Reference -->
+
+<element name="DigestMethod" type="ds:DigestMethodType"/>
+<complexType name="DigestMethodType" mixed="true">
+  <sequence>
+    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Algorithm" type="anyURI" use="required"/>
+</complexType>
+
+<element name="DigestValue" type="ds:DigestValueType"/>
+<simpleType name="DigestValueType">
+  <restriction base="base64Binary"/>
+</simpleType>
+
+<!-- End SignedInfo -->
+
+<!-- Start KeyInfo -->
+
+<element name="KeyInfo" type="ds:KeyInfoType"/>
+<complexType name="KeyInfoType" mixed="true">
+  <choice maxOccurs="unbounded">
+    <element ref="ds:KeyName"/>
+    <element ref="ds:KeyValue"/>
+    <element ref="ds:RetrievalMethod"/>
+    <element ref="ds:X509Data"/>
+    <element ref="ds:PGPData"/>
+    <element ref="ds:SPKIData"/>
+    <element ref="ds:MgmtData"/>
+    <any processContents="lax" namespace="##other"/>
+    <!-- (1,1) elements from (0,unbounded) namespaces -->
+  </choice>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="KeyName" type="string"/>
+  <element name="MgmtData" type="string"/>
+
+  <element name="KeyValue" type="ds:KeyValueType"/>
+  <complexType name="KeyValueType" mixed="true">
+   <choice>
+     <element ref="ds:DSAKeyValue"/>
+     <element ref="ds:RSAKeyValue"/>
+     <any namespace="##other" processContents="lax"/>
+   </choice>
+  </complexType>
+
+  <element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
+  <complexType name="RetrievalMethodType">
+    <sequence>
+      <element ref="ds:Transforms" minOccurs="0"/>
+    </sequence>
+    <attribute name="URI" type="anyURI"/>
+    <attribute name="Type" type="anyURI" use="optional"/>
+  </complexType>
+
+<!-- Start X509Data -->
+
+<element name="X509Data" type="ds:X509DataType"/>
+<complexType name="X509DataType">
+  <sequence maxOccurs="unbounded">
+    <choice>
+      <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
+      <element name="X509SKI" type="base64Binary"/>
+      <element name="X509SubjectName" type="string"/>
+      <element name="X509Certificate" type="base64Binary"/>
+      <element name="X509CRL" type="base64Binary"/>
+      <any namespace="##other" processContents="lax"/>
+    </choice>
+  </sequence>
+</complexType>
+
+<complexType name="X509IssuerSerialType">
+  <sequence>
+    <element name="X509IssuerName" type="string"/>
+    <element name="X509SerialNumber" type="integer"/>
+  </sequence>
+</complexType>
+
+<!-- End X509Data -->
+
+<!-- Begin PGPData -->
+
+<element name="PGPData" type="ds:PGPDataType"/>
+<complexType name="PGPDataType">
+  <choice>
+    <sequence>
+      <element name="PGPKeyID" type="base64Binary"/>
+      <element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+    <sequence>
+      <element name="PGPKeyPacket" type="base64Binary"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+  </choice>
+</complexType>
+
+<!-- End PGPData -->
+
+<!-- Begin SPKIData -->
+
+<element name="SPKIData" type="ds:SPKIDataType"/>
+<complexType name="SPKIDataType">
+  <sequence maxOccurs="unbounded">
+    <element name="SPKISexp" type="base64Binary"/>
+    <any namespace="##other" processContents="lax" minOccurs="0"/>
+  </sequence>
+</complexType>
+
+<!-- End SPKIData -->
+
+<!-- End KeyInfo -->
+
+<!-- Start Object (Manifest, SignatureProperty) -->
+
+<element name="Object" type="ds:ObjectType"/>
+<complexType name="ObjectType" mixed="true">
+  <sequence minOccurs="0" maxOccurs="unbounded">
+    <any namespace="##any" processContents="lax"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
+  <attribute name="Encoding" type="anyURI" use="optional"/>
+</complexType>
+
+<element name="Manifest" type="ds:ManifestType"/>
+<complexType name="ManifestType">
+  <sequence>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
+<complexType name="SignaturePropertiesType">
+  <sequence>
+    <element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+   <element name="SignatureProperty" type="ds:SignaturePropertyType"/>
+   <complexType name="SignaturePropertyType" mixed="true">
+     <choice maxOccurs="unbounded">
+       <any namespace="##other" processContents="lax"/>
+       <!-- (1,1) elements from (1,unbounded) namespaces -->
+     </choice>
+     <attribute name="Target" type="anyURI" use="required"/>
+     <attribute name="Id" type="ID" use="optional"/>
+   </complexType>
+
+<!-- End Object (Manifest, SignatureProperty) -->
+
+<!-- Start Algorithm Parameters -->
+
+<simpleType name="HMACOutputLengthType">
+  <restriction base="integer"/>
+</simpleType>
+
+<!-- Start KeyValue Element-types -->
+
+<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
+<complexType name="DSAKeyValueType">
+  <sequence>
+    <sequence minOccurs="0">
+      <element name="P" type="ds:CryptoBinary"/>
+      <element name="Q" type="ds:CryptoBinary"/>
+    </sequence>
+    <element name="G" type="ds:CryptoBinary" minOccurs="0"/>
+    <element name="Y" type="ds:CryptoBinary"/>
+    <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
+    <sequence minOccurs="0">
+      <element name="Seed" type="ds:CryptoBinary"/>
+      <element name="PgenCounter" type="ds:CryptoBinary"/>
+    </sequence>
+  </sequence>
+</complexType>
+
+<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
+<complexType name="RSAKeyValueType">
+  <sequence>
+    <element name="Modulus" type="ds:CryptoBinary"/>
+    <element name="Exponent" type="ds:CryptoBinary"/>
+  </sequence>
+</complexType>
+
+<!-- End KeyValue Element-types -->
+
+<!-- End Signature -->
+
+</schema>
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE schema
+  PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
+ [
+   <!ATTLIST schema
+     xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
+   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
+   <!ENTITY % p ''>
+   <!ENTITY % s ''>
+  ]>
+
+<!-- Schema for XML Signatures
+    http://www.w3.org/2000/09/xmldsig#
+    $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
+
+    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
+    of Technology, Institut National de Recherche en Informatique et en
+    Automatique, Keio University). All Rights Reserved.
+    http://www.w3.org/Consortium/Legal/
+
+    This document is governed by the W3C Software License [1] as described
+    in the FAQ [2].
+
+    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
+        targetNamespace="http://www.w3.org/2000/09/xmldsig#"
+        version="0.1" elementFormDefault="qualified">
+
+<!-- Basic Types Defined for Signatures -->
+
+<simpleType name="CryptoBinary">
+  <restriction base="base64Binary">
+  </restriction>
+</simpleType>
+
+<!-- Start Signature -->
+
+<element name="Signature" type="ds:SignatureType"/>
+<complexType name="SignatureType">
+  <sequence>
+    <element ref="ds:SignedInfo"/>
+    <element ref="ds:SignatureValue"/>
+    <element ref="ds:KeyInfo" minOccurs="0"/>
+    <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="SignatureValue" type="ds:SignatureValueType"/>
+  <complexType name="SignatureValueType">
+    <simpleContent>
+      <extension base="base64Binary">
+        <attribute name="Id" type="ID" use="optional"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+<!-- Start SignedInfo -->
+
+<element name="SignedInfo" type="ds:SignedInfoType"/>
+<complexType name="SignedInfoType">
+  <sequence>
+    <element ref="ds:CanonicalizationMethod"/>
+    <element ref="ds:SignatureMethod"/>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
+  <complexType name="CanonicalizationMethodType" mixed="true">
+    <sequence>
+      <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+  <element name="SignatureMethod" type="ds:SignatureMethodType"/>
+  <complexType name="SignatureMethodType" mixed="true">
+    <sequence>
+      <element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
+      <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) external namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- Start Reference -->
+
+<element name="Reference" type="ds:ReferenceType"/>
+<complexType name="ReferenceType">
+  <sequence>
+    <element ref="ds:Transforms" minOccurs="0"/>
+    <element ref="ds:DigestMethod"/>
+    <element ref="ds:DigestValue"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="URI" type="anyURI" use="optional"/>
+  <attribute name="Type" type="anyURI" use="optional"/>
+</complexType>
+
+  <element name="Transforms" type="ds:TransformsType"/>
+  <complexType name="TransformsType">
+    <sequence>
+      <element ref="ds:Transform" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+
+  <element name="Transform" type="ds:TransformType"/>
+  <complexType name="TransformType" mixed="true">
+    <choice minOccurs="0" maxOccurs="unbounded">
+      <any namespace="##other" processContents="lax"/>
+      <!-- (1,1) elements from (0,unbounded) namespaces -->
+      <element name="XPath" type="string"/>
+    </choice>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- End Reference -->
+
+<element name="DigestMethod" type="ds:DigestMethodType"/>
+<complexType name="DigestMethodType" mixed="true">
+  <sequence>
+    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Algorithm" type="anyURI" use="required"/>
+</complexType>
+
+<element name="DigestValue" type="ds:DigestValueType"/>
+<simpleType name="DigestValueType">
+  <restriction base="base64Binary"/>
+</simpleType>
+
+<!-- End SignedInfo -->
+
+<!-- Start KeyInfo -->
+
+<element name="KeyInfo" type="ds:KeyInfoType"/>
+<complexType name="KeyInfoType" mixed="true">
+  <choice maxOccurs="unbounded">
+    <element ref="ds:KeyName"/>
+    <element ref="ds:KeyValue"/>
+    <element ref="ds:RetrievalMethod"/>
+    <element ref="ds:X509Data"/>
+    <element ref="ds:PGPData"/>
+    <element ref="ds:SPKIData"/>
+    <element ref="ds:MgmtData"/>
+    <any processContents="lax" namespace="##other"/>
+    <!-- (1,1) elements from (0,unbounded) namespaces -->
+  </choice>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="KeyName" type="string"/>
+  <element name="MgmtData" type="string"/>
+
+  <element name="KeyValue" type="ds:KeyValueType"/>
+  <complexType name="KeyValueType" mixed="true">
+   <choice>
+     <element ref="ds:DSAKeyValue"/>
+     <element ref="ds:RSAKeyValue"/>
+     <any namespace="##other" processContents="lax"/>
+   </choice>
+  </complexType>
+
+  <element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
+  <complexType name="RetrievalMethodType">
+    <sequence>
+      <element ref="ds:Transforms" minOccurs="0"/>
+    </sequence>
+    <attribute name="URI" type="anyURI"/>
+    <attribute name="Type" type="anyURI" use="optional"/>
+  </complexType>
+
+<!-- Start X509Data -->
+
+<element name="X509Data" type="ds:X509DataType"/>
+<complexType name="X509DataType">
+  <sequence maxOccurs="unbounded">
+    <choice>
+      <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
+      <element name="X509SKI" type="base64Binary"/>
+      <element name="X509SubjectName" type="string"/>
+      <element name="X509Certificate" type="base64Binary"/>
+      <element name="X509CRL" type="base64Binary"/>
+      <any namespace="##other" processContents="lax"/>
+    </choice>
+  </sequence>
+</complexType>
+
+<complexType name="X509IssuerSerialType">
+  <sequence>
+    <element name="X509IssuerName" type="string"/>
+    <element name="X509SerialNumber" type="integer"/>
+  </sequence>
+</complexType>
+
+<!-- End X509Data -->
+
+<!-- Begin PGPData -->
+
+<element name="PGPData" type="ds:PGPDataType"/>
+<complexType name="PGPDataType">
+  <choice>
+    <sequence>
+      <element name="PGPKeyID" type="base64Binary"/>
+      <element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+    <sequence>
+      <element name="PGPKeyPacket" type="base64Binary"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+  </choice>
+</complexType>
+
+<!-- End PGPData -->
+
+<!-- Begin SPKIData -->
+
+<element name="SPKIData" type="ds:SPKIDataType"/>
+<complexType name="SPKIDataType">
+  <sequence maxOccurs="unbounded">
+    <element name="SPKISexp" type="base64Binary"/>
+    <any namespace="##other" processContents="lax" minOccurs="0"/>
+  </sequence>
+</complexType>
+
+<!-- End SPKIData -->
+
+<!-- End KeyInfo -->
+
+<!-- Start Object (Manifest, SignatureProperty) -->
+
+<element name="Object" type="ds:ObjectType"/>
+<complexType name="ObjectType" mixed="true">
+  <sequence minOccurs="0" maxOccurs="unbounded">
+    <any namespace="##any" processContents="lax"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
+  <attribute name="Encoding" type="anyURI" use="optional"/>
+</complexType>
+
+<element name="Manifest" type="ds:ManifestType"/>
+<complexType name="ManifestType">
+  <sequence>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
+<complexType name="SignaturePropertiesType">
+  <sequence>
+    <element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+   <element name="SignatureProperty" type="ds:SignaturePropertyType"/>
+   <complexType name="SignaturePropertyType" mixed="true">
+     <choice maxOccurs="unbounded">
+       <any namespace="##other" processContents="lax"/>
+       <!-- (1,1) elements from (1,unbounded) namespaces -->
+     </choice>
+     <attribute name="Target" type="anyURI" use="required"/>
+     <attribute name="Id" type="ID" use="optional"/>
+   </complexType>
+
+<!-- End Object (Manifest, SignatureProperty) -->
+
+<!-- Start Algorithm Parameters -->
+
+<simpleType name="HMACOutputLengthType">
+  <restriction base="integer"/>
+</simpleType>
+
+<!-- Start KeyValue Element-types -->
+
+<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
+<complexType name="DSAKeyValueType">
+  <sequence>
+    <sequence minOccurs="0">
+      <element name="P" type="ds:CryptoBinary"/>
+      <element name="Q" type="ds:CryptoBinary"/>
+    </sequence>
+    <element name="G" type="ds:CryptoBinary" minOccurs="0"/>
+    <element name="Y" type="ds:CryptoBinary"/>
+    <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
+    <sequence minOccurs="0">
+      <element name="Seed" type="ds:CryptoBinary"/>
+      <element name="PgenCounter" type="ds:CryptoBinary"/>
+    </sequence>
+  </sequence>
+</complexType>
+
+<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
+<complexType name="RSAKeyValueType">
+  <sequence>
+    <element name="Modulus" type="ds:CryptoBinary"/>
+    <element name="Exponent" type="ds:CryptoBinary"/>
+  </sequence>
+</complexType>
+
+<!-- End KeyValue Element-types -->
+
+<!-- End Signature -->
+
+</schema>
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE schema
+  PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
+ [
+   <!ATTLIST schema
+     xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
+   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
+   <!ENTITY % p ''>
+   <!ENTITY % s ''>
+  ]>
+
+<!-- Schema for XML Signatures
+    http://www.w3.org/2000/09/xmldsig#
+    $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
+
+    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
+    of Technology, Institut National de Recherche en Informatique et en
+    Automatique, Keio University). All Rights Reserved.
+    http://www.w3.org/Consortium/Legal/
+
+    This document is governed by the W3C Software License [1] as described
+    in the FAQ [2].
+
+    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
+        targetNamespace="http://www.w3.org/2000/09/xmldsig#"
+        version="0.1" elementFormDefault="qualified">
+
+<!-- Basic Types Defined for Signatures -->
+
+<simpleType name="CryptoBinary">
+  <restriction base="base64Binary">
+  </restriction>
+</simpleType>
+
+<!-- Start Signature -->
+
+<element name="Signature" type="ds:SignatureType"/>
+<complexType name="SignatureType">
+  <sequence>
+    <element ref="ds:SignedInfo"/>
+    <element ref="ds:SignatureValue"/>
+    <element ref="ds:KeyInfo" minOccurs="0"/>
+    <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="SignatureValue" type="ds:SignatureValueType"/>
+  <complexType name="SignatureValueType">
+    <simpleContent>
+      <extension base="base64Binary">
+        <attribute name="Id" type="ID" use="optional"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+<!-- Start SignedInfo -->
+
+<element name="SignedInfo" type="ds:SignedInfoType"/>
+<complexType name="SignedInfoType">
+  <sequence>
+    <element ref="ds:CanonicalizationMethod"/>
+    <element ref="ds:SignatureMethod"/>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
+  <complexType name="CanonicalizationMethodType" mixed="true">
+    <sequence>
+      <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+  <element name="SignatureMethod" type="ds:SignatureMethodType"/>
+  <complexType name="SignatureMethodType" mixed="true">
+    <sequence>
+      <element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
+      <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) external namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- Start Reference -->
+
+<element name="Reference" type="ds:ReferenceType"/>
+<complexType name="ReferenceType">
+  <sequence>
+    <element ref="ds:Transforms" minOccurs="0"/>
+    <element ref="ds:DigestMethod"/>
+    <element ref="ds:DigestValue"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="URI" type="anyURI" use="optional"/>
+  <attribute name="Type" type="anyURI" use="optional"/>
+</complexType>
+
+  <element name="Transforms" type="ds:TransformsType"/>
+  <complexType name="TransformsType">
+    <sequence>
+      <element ref="ds:Transform" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+
+  <element name="Transform" type="ds:TransformType"/>
+  <complexType name="TransformType" mixed="true">
+    <choice minOccurs="0" maxOccurs="unbounded">
+      <any namespace="##other" processContents="lax"/>
+      <!-- (1,1) elements from (0,unbounded) namespaces -->
+      <element name="XPath" type="string"/>
+    </choice>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- End Reference -->
+
+<element name="DigestMethod" type="ds:DigestMethodType"/>
+<complexType name="DigestMethodType" mixed="true">
+  <sequence>
+    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Algorithm" type="anyURI" use="required"/>
+</complexType>
+
+<element name="DigestValue" type="ds:DigestValueType"/>
+<simpleType name="DigestValueType">
+  <restriction base="base64Binary"/>
+</simpleType>
+
+<!-- End SignedInfo -->
+
+<!-- Start KeyInfo -->
+
+<element name="KeyInfo" type="ds:KeyInfoType"/>
+<complexType name="KeyInfoType" mixed="true">
+  <choice maxOccurs="unbounded">
+    <element ref="ds:KeyName"/>
+    <element ref="ds:KeyValue"/>
+    <element ref="ds:RetrievalMethod"/>
+    <element ref="ds:X509Data"/>
+    <element ref="ds:PGPData"/>
+    <element ref="ds:SPKIData"/>
+    <element ref="ds:MgmtData"/>
+    <any processContents="lax" namespace="##other"/>
+    <!-- (1,1) elements from (0,unbounded) namespaces -->
+  </choice>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="KeyName" type="string"/>
+  <element name="MgmtData" type="string"/>
+
+  <element name="KeyValue" type="ds:KeyValueType"/>
+  <complexType name="KeyValueType" mixed="true">
+   <choice>
+     <element ref="ds:DSAKeyValue"/>
+     <element ref="ds:RSAKeyValue"/>
+     <any namespace="##other" processContents="lax"/>
+   </choice>
+  </complexType>
+
+  <element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
+  <complexType name="RetrievalMethodType">
+    <sequence>
+      <element ref="ds:Transforms" minOccurs="0"/>
+    </sequence>
+    <attribute name="URI" type="anyURI"/>
+    <attribute name="Type" type="anyURI" use="optional"/>
+  </complexType>
+
+<!-- Start X509Data -->
+
+<element name="X509Data" type="ds:X509DataType"/>
+<complexType name="X509DataType">
+  <sequence maxOccurs="unbounded">
+    <choice>
+      <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
+      <element name="X509SKI" type="base64Binary"/>
+      <element name="X509SubjectName" type="string"/>
+      <element name="X509Certificate" type="base64Binary"/>
+      <element name="X509CRL" type="base64Binary"/>
+      <any namespace="##other" processContents="lax"/>
+    </choice>
+  </sequence>
+</complexType>
+
+<complexType name="X509IssuerSerialType">
+  <sequence>
+    <element name="X509IssuerName" type="string"/>
+    <element name="X509SerialNumber" type="integer"/>
+  </sequence>
+</complexType>
+
+<!-- End X509Data -->
+
+<!-- Begin PGPData -->
+
+<element name="PGPData" type="ds:PGPDataType"/>
+<complexType name="PGPDataType">
+  <choice>
+    <sequence>
+      <element name="PGPKeyID" type="base64Binary"/>
+      <element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+    <sequence>
+      <element name="PGPKeyPacket" type="base64Binary"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+  </choice>
+</complexType>
+
+<!-- End PGPData -->
+
+<!-- Begin SPKIData -->
+
+<element name="SPKIData" type="ds:SPKIDataType"/>
+<complexType name="SPKIDataType">
+  <sequence maxOccurs="unbounded">
+    <element name="SPKISexp" type="base64Binary"/>
+    <any namespace="##other" processContents="lax" minOccurs="0"/>
+  </sequence>
+</complexType>
+
+<!-- End SPKIData -->
+
+<!-- End KeyInfo -->
+
+<!-- Start Object (Manifest, SignatureProperty) -->
+
+<element name="Object" type="ds:ObjectType"/>
+<complexType name="ObjectType" mixed="true">
+  <sequence minOccurs="0" maxOccurs="unbounded">
+    <any namespace="##any" processContents="lax"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
+  <attribute name="Encoding" type="anyURI" use="optional"/>
+</complexType>
+
+<element name="Manifest" type="ds:ManifestType"/>
+<complexType name="ManifestType">
+  <sequence>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
+<complexType name="SignaturePropertiesType">
+  <sequence>
+    <element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+   <element name="SignatureProperty" type="ds:SignaturePropertyType"/>
+   <complexType name="SignaturePropertyType" mixed="true">
+     <choice maxOccurs="unbounded">
+       <any namespace="##other" processContents="lax"/>
+       <!-- (1,1) elements from (1,unbounded) namespaces -->
+     </choice>
+     <attribute name="Target" type="anyURI" use="required"/>
+     <attribute name="Id" type="ID" use="optional"/>
+   </complexType>
+
+<!-- End Object (Manifest, SignatureProperty) -->
+
+<!-- Start Algorithm Parameters -->
+
+<simpleType name="HMACOutputLengthType">
+  <restriction base="integer"/>
+</simpleType>
+
+<!-- Start KeyValue Element-types -->
+
+<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
+<complexType name="DSAKeyValueType">
+  <sequence>
+    <sequence minOccurs="0">
+      <element name="P" type="ds:CryptoBinary"/>
+      <element name="Q" type="ds:CryptoBinary"/>
+    </sequence>
+    <element name="G" type="ds:CryptoBinary" minOccurs="0"/>
+    <element name="Y" type="ds:CryptoBinary"/>
+    <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
+    <sequence minOccurs="0">
+      <element name="Seed" type="ds:CryptoBinary"/>
+      <element name="PgenCounter" type="ds:CryptoBinary"/>
+    </sequence>
+  </sequence>
+</complexType>
+
+<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
+<complexType name="RSAKeyValueType">
+  <sequence>
+    <element name="Modulus" type="ds:CryptoBinary"/>
+    <element name="Exponent" type="ds:CryptoBinary"/>
+  </sequence>
+</complexType>
+
+<!-- End KeyValue Element-types -->
+
+<!-- End Signature -->
+
+</schema>
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE schema
+  PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
+ [
+   <!ATTLIST schema
+     xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
+   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
+   <!ENTITY % p ''>
+   <!ENTITY % s ''>
+  ]>
+
+<!-- Schema for XML Signatures
+    http://www.w3.org/2000/09/xmldsig#
+    $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
+
+    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
+    of Technology, Institut National de Recherche en Informatique et en
+    Automatique, Keio University). All Rights Reserved.
+    http://www.w3.org/Consortium/Legal/
+
+    This document is governed by the W3C Software License [1] as described
+    in the FAQ [2].
+
+    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
+        targetNamespace="http://www.w3.org/2000/09/xmldsig#"
+        version="0.1" elementFormDefault="qualified">
+
+<!-- Basic Types Defined for Signatures -->
+
+<simpleType name="CryptoBinary">
+  <restriction base="base64Binary">
+  </restriction>
+</simpleType>
+
+<!-- Start Signature -->
+
+<element name="Signature" type="ds:SignatureType"/>
+<complexType name="SignatureType">
+  <sequence>
+    <element ref="ds:SignedInfo"/>
+    <element ref="ds:SignatureValue"/>
+    <element ref="ds:KeyInfo" minOccurs="0"/>
+    <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="SignatureValue" type="ds:SignatureValueType"/>
+  <complexType name="SignatureValueType">
+    <simpleContent>
+      <extension base="base64Binary">
+        <attribute name="Id" type="ID" use="optional"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+<!-- Start SignedInfo -->
+
+<element name="SignedInfo" type="ds:SignedInfoType"/>
+<complexType name="SignedInfoType">
+  <sequence>
+    <element ref="ds:CanonicalizationMethod"/>
+    <element ref="ds:SignatureMethod"/>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
+  <complexType name="CanonicalizationMethodType" mixed="true">
+    <sequence>
+      <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+  <element name="SignatureMethod" type="ds:SignatureMethodType"/>
+  <complexType name="SignatureMethodType" mixed="true">
+    <sequence>
+      <element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
+      <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) external namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- Start Reference -->
+
+<element name="Reference" type="ds:ReferenceType"/>
+<complexType name="ReferenceType">
+  <sequence>
+    <element ref="ds:Transforms" minOccurs="0"/>
+    <element ref="ds:DigestMethod"/>
+    <element ref="ds:DigestValue"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="URI" type="anyURI" use="optional"/>
+  <attribute name="Type" type="anyURI" use="optional"/>
+</complexType>
+
+  <element name="Transforms" type="ds:TransformsType"/>
+  <complexType name="TransformsType">
+    <sequence>
+      <element ref="ds:Transform" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+
+  <element name="Transform" type="ds:TransformType"/>
+  <complexType name="TransformType" mixed="true">
+    <choice minOccurs="0" maxOccurs="unbounded">
+      <any namespace="##other" processContents="lax"/>
+      <!-- (1,1) elements from (0,unbounded) namespaces -->
+      <element name="XPath" type="string"/>
+    </choice>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- End Reference -->
+
+<element name="DigestMethod" type="ds:DigestMethodType"/>
+<complexType name="DigestMethodType" mixed="true">
+  <sequence>
+    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Algorithm" type="anyURI" use="required"/>
+</complexType>
+
+<element name="DigestValue" type="ds:DigestValueType"/>
+<simpleType name="DigestValueType">
+  <restriction base="base64Binary"/>
+</simpleType>
+
+<!-- End SignedInfo -->
+
+<!-- Start KeyInfo -->
+
+<element name="KeyInfo" type="ds:KeyInfoType"/>
+<complexType name="KeyInfoType" mixed="true">
+  <choice maxOccurs="unbounded">
+    <element ref="ds:KeyName"/>
+    <element ref="ds:KeyValue"/>
+    <element ref="ds:RetrievalMethod"/>
+    <element ref="ds:X509Data"/>
+    <element ref="ds:PGPData"/>
+    <element ref="ds:SPKIData"/>
+    <element ref="ds:MgmtData"/>
+    <any processContents="lax" namespace="##other"/>
+    <!-- (1,1) elements from (0,unbounded) namespaces -->
+  </choice>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="KeyName" type="string"/>
+  <element name="MgmtData" type="string"/>
+
+  <element name="KeyValue" type="ds:KeyValueType"/>
+  <complexType name="KeyValueType" mixed="true">
+   <choice>
+     <element ref="ds:DSAKeyValue"/>
+     <element ref="ds:RSAKeyValue"/>
+     <any namespace="##other" processContents="lax"/>
+   </choice>
+  </complexType>
+
+  <element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
+  <complexType name="RetrievalMethodType">
+    <sequence>
+      <element ref="ds:Transforms" minOccurs="0"/>
+    </sequence>
+    <attribute name="URI" type="anyURI"/>
+    <attribute name="Type" type="anyURI" use="optional"/>
+  </complexType>
+
+<!-- Start X509Data -->
+
+<element name="X509Data" type="ds:X509DataType"/>
+<complexType name="X509DataType">
+  <sequence maxOccurs="unbounded">
+    <choice>
+      <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
+      <element name="X509SKI" type="base64Binary"/>
+      <element name="X509SubjectName" type="string"/>
+      <element name="X509Certificate" type="base64Binary"/>
+      <element name="X509CRL" type="base64Binary"/>
+      <any namespace="##other" processContents="lax"/>
+    </choice>
+  </sequence>
+</complexType>
+
+<complexType name="X509IssuerSerialType">
+  <sequence>
+    <element name="X509IssuerName" type="string"/>
+    <element name="X509SerialNumber" type="integer"/>
+  </sequence>
+</complexType>
+
+<!-- End X509Data -->
+
+<!-- Begin PGPData -->
+
+<element name="PGPData" type="ds:PGPDataType"/>
+<complexType name="PGPDataType">
+  <choice>
+    <sequence>
+      <element name="PGPKeyID" type="base64Binary"/>
+      <element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+    <sequence>
+      <element name="PGPKeyPacket" type="base64Binary"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+  </choice>
+</complexType>
+
+<!-- End PGPData -->
+
+<!-- Begin SPKIData -->
+
+<element name="SPKIData" type="ds:SPKIDataType"/>
+<complexType name="SPKIDataType">
+  <sequence maxOccurs="unbounded">
+    <element name="SPKISexp" type="base64Binary"/>
+    <any namespace="##other" processContents="lax" minOccurs="0"/>
+  </sequence>
+</complexType>
+
+<!-- End SPKIData -->
+
+<!-- End KeyInfo -->
+
+<!-- Start Object (Manifest, SignatureProperty) -->
+
+<element name="Object" type="ds:ObjectType"/>
+<complexType name="ObjectType" mixed="true">
+  <sequence minOccurs="0" maxOccurs="unbounded">
+    <any namespace="##any" processContents="lax"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
+  <attribute name="Encoding" type="anyURI" use="optional"/>
+</complexType>
+
+<element name="Manifest" type="ds:ManifestType"/>
+<complexType name="ManifestType">
+  <sequence>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
+<complexType name="SignaturePropertiesType">
+  <sequence>
+    <element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+   <element name="SignatureProperty" type="ds:SignaturePropertyType"/>
+   <complexType name="SignaturePropertyType" mixed="true">
+     <choice maxOccurs="unbounded">
+       <any namespace="##other" processContents="lax"/>
+       <!-- (1,1) elements from (1,unbounded) namespaces -->
+     </choice>
+     <attribute name="Target" type="anyURI" use="required"/>
+     <attribute name="Id" type="ID" use="optional"/>
+   </complexType>
+
+<!-- End Object (Manifest, SignatureProperty) -->
+
+<!-- Start Algorithm Parameters -->
+
+<simpleType name="HMACOutputLengthType">
+  <restriction base="integer"/>
+</simpleType>
+
+<!-- Start KeyValue Element-types -->
+
+<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
+<complexType name="DSAKeyValueType">
+  <sequence>
+    <sequence minOccurs="0">
+      <element name="P" type="ds:CryptoBinary"/>
+      <element name="Q" type="ds:CryptoBinary"/>
+    </sequence>
+    <element name="G" type="ds:CryptoBinary" minOccurs="0"/>
+    <element name="Y" type="ds:CryptoBinary"/>
+    <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
+    <sequence minOccurs="0">
+      <element name="Seed" type="ds:CryptoBinary"/>
+      <element name="PgenCounter" type="ds:CryptoBinary"/>
+    </sequence>
+  </sequence>
+</complexType>
+
+<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
+<complexType name="RSAKeyValueType">
+  <sequence>
+    <element name="Modulus" type="ds:CryptoBinary"/>
+    <element name="Exponent" type="ds:CryptoBinary"/>
+  </sequence>
+</complexType>
+
+<!-- End KeyValue Element-types -->
+
+<!-- End Signature -->
+
+</schema>
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE schema
+  PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
+ [
+   <!ATTLIST schema
+     xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
+   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
+   <!ENTITY % p ''>
+   <!ENTITY % s ''>
+  ]>
+
+<!-- Schema for XML Signatures
+    http://www.w3.org/2000/09/xmldsig#
+    $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
+
+    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
+    of Technology, Institut National de Recherche en Informatique et en
+    Automatique, Keio University). All Rights Reserved.
+    http://www.w3.org/Consortium/Legal/
+
+    This document is governed by the W3C Software License [1] as described
+    in the FAQ [2].
+
+    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
+        targetNamespace="http://www.w3.org/2000/09/xmldsig#"
+        version="0.1" elementFormDefault="qualified">
+
+<!-- Basic Types Defined for Signatures -->
+
+<simpleType name="CryptoBinary">
+  <restriction base="base64Binary">
+  </restriction>
+</simpleType>
+
+<!-- Start Signature -->
+
+<element name="Signature" type="ds:SignatureType"/>
+<complexType name="SignatureType">
+  <sequence>
+    <element ref="ds:SignedInfo"/>
+    <element ref="ds:SignatureValue"/>
+    <element ref="ds:KeyInfo" minOccurs="0"/>
+    <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="SignatureValue" type="ds:SignatureValueType"/>
+  <complexType name="SignatureValueType">
+    <simpleContent>
+      <extension base="base64Binary">
+        <attribute name="Id" type="ID" use="optional"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+<!-- Start SignedInfo -->
+
+<element name="SignedInfo" type="ds:SignedInfoType"/>
+<complexType name="SignedInfoType">
+  <sequence>
+    <element ref="ds:CanonicalizationMethod"/>
+    <element ref="ds:SignatureMethod"/>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
+  <complexType name="CanonicalizationMethodType" mixed="true">
+    <sequence>
+      <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+  <element name="SignatureMethod" type="ds:SignatureMethodType"/>
+  <complexType name="SignatureMethodType" mixed="true">
+    <sequence>
+      <element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
+      <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) external namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- Start Reference -->
+
+<element name="Reference" type="ds:ReferenceType"/>
+<complexType name="ReferenceType">
+  <sequence>
+    <element ref="ds:Transforms" minOccurs="0"/>
+    <element ref="ds:DigestMethod"/>
+    <element ref="ds:DigestValue"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="URI" type="anyURI" use="optional"/>
+  <attribute name="Type" type="anyURI" use="optional"/>
+</complexType>
+
+  <element name="Transforms" type="ds:TransformsType"/>
+  <complexType name="TransformsType">
+    <sequence>
+      <element ref="ds:Transform" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+
+  <element name="Transform" type="ds:TransformType"/>
+  <complexType name="TransformType" mixed="true">
+    <choice minOccurs="0" maxOccurs="unbounded">
+      <any namespace="##other" processContents="lax"/>
+      <!-- (1,1) elements from (0,unbounded) namespaces -->
+      <element name="XPath" type="string"/>
+    </choice>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- End Reference -->
+
+<element name="DigestMethod" type="ds:DigestMethodType"/>
+<complexType name="DigestMethodType" mixed="true">
+  <sequence>
+    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Algorithm" type="anyURI" use="required"/>
+</complexType>
+
+<element name="DigestValue" type="ds:DigestValueType"/>
+<simpleType name="DigestValueType">
+  <restriction base="base64Binary"/>
+</simpleType>
+
+<!-- End SignedInfo -->
+
+<!-- Start KeyInfo -->
+
+<element name="KeyInfo" type="ds:KeyInfoType"/>
+<complexType name="KeyInfoType" mixed="true">
+  <choice maxOccurs="unbounded">
+    <element ref="ds:KeyName"/>
+    <element ref="ds:KeyValue"/>
+    <element ref="ds:RetrievalMethod"/>
+    <element ref="ds:X509Data"/>
+    <element ref="ds:PGPData"/>
+    <element ref="ds:SPKIData"/>
+    <element ref="ds:MgmtData"/>
+    <any processContents="lax" namespace="##other"/>
+    <!-- (1,1) elements from (0,unbounded) namespaces -->
+  </choice>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="KeyName" type="string"/>
+  <element name="MgmtData" type="string"/>
+
+  <element name="KeyValue" type="ds:KeyValueType"/>
+  <complexType name="KeyValueType" mixed="true">
+   <choice>
+     <element ref="ds:DSAKeyValue"/>
+     <element ref="ds:RSAKeyValue"/>
+     <any namespace="##other" processContents="lax"/>
+   </choice>
+  </complexType>
+
+  <element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
+  <complexType name="RetrievalMethodType">
+    <sequence>
+      <element ref="ds:Transforms" minOccurs="0"/>
+    </sequence>
+    <attribute name="URI" type="anyURI"/>
+    <attribute name="Type" type="anyURI" use="optional"/>
+  </complexType>
+
+<!-- Start X509Data -->
+
+<element name="X509Data" type="ds:X509DataType"/>
+<complexType name="X509DataType">
+  <sequence maxOccurs="unbounded">
+    <choice>
+      <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
+      <element name="X509SKI" type="base64Binary"/>
+      <element name="X509SubjectName" type="string"/>
+      <element name="X509Certificate" type="base64Binary"/>
+      <element name="X509CRL" type="base64Binary"/>
+      <any namespace="##other" processContents="lax"/>
+    </choice>
+  </sequence>
+</complexType>
+
+<complexType name="X509IssuerSerialType">
+  <sequence>
+    <element name="X509IssuerName" type="string"/>
+    <element name="X509SerialNumber" type="integer"/>
+  </sequence>
+</complexType>
+
+<!-- End X509Data -->
+
+<!-- Begin PGPData -->
+
+<element name="PGPData" type="ds:PGPDataType"/>
+<complexType name="PGPDataType">
+  <choice>
+    <sequence>
+      <element name="PGPKeyID" type="base64Binary"/>
+      <element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+    <sequence>
+      <element name="PGPKeyPacket" type="base64Binary"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+  </choice>
+</complexType>
+
+<!-- End PGPData -->
+
+<!-- Begin SPKIData -->
+
+<element name="SPKIData" type="ds:SPKIDataType"/>
+<complexType name="SPKIDataType">
+  <sequence maxOccurs="unbounded">
+    <element name="SPKISexp" type="base64Binary"/>
+    <any namespace="##other" processContents="lax" minOccurs="0"/>
+  </sequence>
+</complexType>
+
+<!-- End SPKIData -->
+
+<!-- End KeyInfo -->
+
+<!-- Start Object (Manifest, SignatureProperty) -->
+
+<element name="Object" type="ds:ObjectType"/>
+<complexType name="ObjectType" mixed="true">
+  <sequence minOccurs="0" maxOccurs="unbounded">
+    <any namespace="##any" processContents="lax"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
+  <attribute name="Encoding" type="anyURI" use="optional"/>
+</complexType>
+
+<element name="Manifest" type="ds:ManifestType"/>
+<complexType name="ManifestType">
+  <sequence>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
+<complexType name="SignaturePropertiesType">
+  <sequence>
+    <element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+   <element name="SignatureProperty" type="ds:SignaturePropertyType"/>
+   <complexType name="SignaturePropertyType" mixed="true">
+     <choice maxOccurs="unbounded">
+       <any namespace="##other" processContents="lax"/>
+       <!-- (1,1) elements from (1,unbounded) namespaces -->
+     </choice>
+     <attribute name="Target" type="anyURI" use="required"/>
+     <attribute name="Id" type="ID" use="optional"/>
+   </complexType>
+
+<!-- End Object (Manifest, SignatureProperty) -->
+
+<!-- Start Algorithm Parameters -->
+
+<simpleType name="HMACOutputLengthType">
+  <restriction base="integer"/>
+</simpleType>
+
+<!-- Start KeyValue Element-types -->
+
+<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
+<complexType name="DSAKeyValueType">
+  <sequence>
+    <sequence minOccurs="0">
+      <element name="P" type="ds:CryptoBinary"/>
+      <element name="Q" type="ds:CryptoBinary"/>
+    </sequence>
+    <element name="G" type="ds:CryptoBinary" minOccurs="0"/>
+    <element name="Y" type="ds:CryptoBinary"/>
+    <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
+    <sequence minOccurs="0">
+      <element name="Seed" type="ds:CryptoBinary"/>
+      <element name="PgenCounter" type="ds:CryptoBinary"/>
+    </sequence>
+  </sequence>
+</complexType>
+
+<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
+<complexType name="RSAKeyValueType">
+  <sequence>
+    <element name="Modulus" type="ds:CryptoBinary"/>
+    <element name="Exponent" type="ds:CryptoBinary"/>
+  </sequence>
+</complexType>
+
+<!-- End KeyValue Element-types -->
+
+
+
+
+
+
+
+
+<!-- End Signature -->
+
+</schema>
+
diff --git a/xml/tests/testData/psi/events/1.txt b/xml/tests/testData/psi/events/1.txt
new file mode 100644
index 0000000..b02964d
--- /dev/null
+++ b/xml/tests/testData/psi/events/1.txt
@@ -0,0 +1 @@
+(Attribute "a" for tag "a" set to "b")
diff --git a/xml/tests/testData/psi/events/2.txt b/xml/tests/testData/psi/events/2.txt
new file mode 100644
index 0000000..82453a8
--- /dev/null
+++ b/xml/tests/testData/psi/events/2.txt
@@ -0,0 +1 @@
+(text changed to 'aa' was: 'aaa'), (child added to a child: XmlText), (child added to a child: XmlTag:a)
\ No newline at end of file
diff --git a/xml/tests/testData/psi/events/3.txt b/xml/tests/testData/psi/events/3.txt
new file mode 100644
index 0000000..954dbaf
--- /dev/null
+++ b/xml/tests/testData/psi/events/3.txt
@@ -0,0 +1 @@
+(text changed to 'aabba' was: 'aaa')
diff --git a/xml/tests/testData/psi/events/4.txt b/xml/tests/testData/psi/events/4.txt
new file mode 100644
index 0000000..d0470d3
--- /dev/null
+++ b/xml/tests/testData/psi/events/4.txt
@@ -0,0 +1 @@
+(text changed to 'a a ' was: 'a ')
diff --git a/xml/tests/testData/psi/events/5.txt b/xml/tests/testData/psi/events/5.txt
new file mode 100644
index 0000000..ad835b5
--- /dev/null
+++ b/xml/tests/testData/psi/events/5.txt
@@ -0,0 +1 @@
+(Xml document changed)
diff --git a/xml/tests/testData/psi/events/BulkUpdate.txt b/xml/tests/testData/psi/events/BulkUpdate.txt
new file mode 100644
index 0000000..ad835b5
--- /dev/null
+++ b/xml/tests/testData/psi/events/BulkUpdate.txt
@@ -0,0 +1 @@
+(Xml document changed)
diff --git a/xml/tests/testData/psi/events/DocumentChange1.txt b/xml/tests/testData/psi/events/DocumentChange1.txt
new file mode 100644
index 0000000..ad835b5
--- /dev/null
+++ b/xml/tests/testData/psi/events/DocumentChange1.txt
@@ -0,0 +1 @@
+(Xml document changed)
diff --git a/xml/tests/testData/psi/events/DocumentChange2.txt b/xml/tests/testData/psi/events/DocumentChange2.txt
new file mode 100644
index 0000000..ad835b5
--- /dev/null
+++ b/xml/tests/testData/psi/events/DocumentChange2.txt
@@ -0,0 +1 @@
+(Xml document changed)
diff --git a/xml/tests/testData/psi/events/DocumentChange3.txt b/xml/tests/testData/psi/events/DocumentChange3.txt
new file mode 100644
index 0000000..f572e63
--- /dev/null
+++ b/xml/tests/testData/psi/events/DocumentChange3.txt
@@ -0,0 +1 @@
+(child changed in b child: XmlTag:a)
diff --git a/xml/tests/testData/psi/events/TagRemove.txt b/xml/tests/testData/psi/events/TagRemove.txt
new file mode 100644
index 0000000..9c54695
--- /dev/null
+++ b/xml/tests/testData/psi/events/TagRemove.txt
@@ -0,0 +1 @@
+(child changed in html child: XmlText), (child removed from html child: XmlTag:b), (child removed from html child: XmlText)
diff --git a/xml/tests/testData/psi/incrementalReparse41_after.xml b/xml/tests/testData/psi/incrementalReparse41_after.xml
new file mode 100644
index 0000000..d80e6ea
--- /dev/null
+++ b/xml/tests/testData/psi/incrementalReparse41_after.xml
@@ -0,0 +1,1594 @@
+
+<!-- ===================================================================
+
+   Build file for PRM - for use with the Jakarta Ant java build tool
+   Requires Ant 1.5 or greater
+
+Build Instructions:
+   To build, run
+     build.bat - optionally with a target arg as indicated below -
+                 in the directory where this file is located.
+
+   The batch/shell file sets up your classpath and calls java org.apache.tools.ant.Main
+
+Authors:
+  Tim Morrow <[email protected]>
+
+   $Id: build.xml,v 1.80.2.14 2004/01/17 00:43:54 tim Exp $
+
+==================================================================== -->
+
+<project name="prm" default="build">
+
+  <!-- Print Usage of this build file -->
+  <target name="usage">
+    <echo>
+build [target]
+
+Where target is one of the following:
+-------------------
+Compilation Targets
+-------------------
+  build               (default) compiles, builds and copies all files
+  compile             compiles java sources, jsp sources and pnet patch to
+                        output directories
+  compile-java        compiles java classes in the following packages:
+                        com, pnet, net.project
+  compile-jsp         compiles jsp sources only
+  compile-java-com    compiles java com.* classes only (including rmi classes)
+  compile-java-pnet   compiles java pnet.* classes only
+  compile-java-net    compiles java net.* classes only
+  compile-pnetpatch   compiles pnet patch and builds jar file
+  compile-version     compiles Version.java
+
+  javadoc             generates javadoc; for internal use only
+  resource            builds resources (images etc.) and copies to web root
+  xsl                 copies XSL files to output directories
+  etc                 copies application files (e.g. crypto/key.txt) to output
+                        directories
+  bin                 copies bin files (e.g. start_listeners.bat) to output
+                        directories
+
+  clean               purges the output tree
+
+------------------
+Deployment Targets
+------------------
+  deploy              Deploys application; executes build target then executes
+                        all of the following deploy targets:
+                        (Note: All targets perform incremental builds)
+  deploy-prm
+  deploy-xsl
+  deploy-etc
+  deploy-jars
+  deploy-bin
+  deploy-resource
+  deploy-database
+  deploy-docs
+
+  deploy-src          Deploys application; executes "deploy" target then
+                        executes these:
+  deploy-src-jsp
+  deploy-src-javadoc
+
+  deploy-clean        Purges the output and deployment tree; suitable for use
+                        before either "deploy" or "deploy-src"
+
+-----------------
+Packaging Targets
+-----------------
+  installer           Generates an installer; executes the "deploy" target and
+                        the "zip" target (incremental)
+  installer-clean     Purges the output and deployment tree then generates an
+                        installer (from clean)
+  installer-src       Generates an installer; executes the "deploy-src" target
+                        and the "zip-src" target
+  installer-src-clean Purges the output and deployment tree then generates an
+                        installer with source (from clean)
+  zip                 Creates a zip file in releases directory based on the
+                        current deployment (incremental)
+  zip-src             Creates a zip file in deployment directory, including
+                        the source (incremental)
+  create-escrow-source Creates a zip file containing escrow software
+
+-----------------
+Unit Test Targets
+-----------------
+   compile-unit-test    Compiles unit test stubs and all unit test classes
+   unit-test            Compiles and executes all unit tests
+   run-single-unit-test Runs a single unit test.  The unit test class to run
+                          is passed on the command line as follows:
+
+                          build run-single-unit-test
+                              -Dunittest.to.run=fullyqualifiedclassname
+
+                          where fullyqualifiedclassname is a unit test class
+
+-----------------
+Other Targets
+-----------------
+   run                Run an application server instance
+
+    </echo>
+  </target>
+
+
+  <!--
+       This target constructs the properties required for building the product.
+    -->
+  <target name="-init" depends="-init-base-directories, -init-directories, -init-classpath, -debug-on">
+
+      <!-- Set compilation properties -->
+      <property name="build.compiler" value="jikes"/>
+      <property name="build.rmic" value="sun"/>
+      <property name="deprecation" value="off"/>
+
+      <!-- Version Properties contains properties:
+               product.version
+	           product.version.codename
+	           autogenerate.warning
+      -->
+      <property file="${config.src.dir}/version.properties" />
+
+      <echo message="Compilation debug setting is ${debug}" />
+  </target>
+
+  <!-- Allows compilation debug info to be turned off via a dependency -->
+  <target name="-debug-off">
+      <property name="debug" value="off"/>
+  </target>
+
+  <!--
+        Allows compilation debug info to be turned on via a dependency.
+        This should be set ahead of the "init" target
+    -->
+  <target name="-debug-on">
+      <property name="debug" value="on"/>
+  </target>
+
+  <!-- Checks for presence of build.properties; sets build-properties-present -->
+  <target name="-check-build-properties">
+     <condition property="build-properties-present">
+          <available file="build.properties" />
+     </condition>
+  </target>
+
+  <!-- Copies build.properties.example to build.properties if build.properties
+       is not present -->
+  <target name="-ensure-build-properties" depends="-check-build-properties" unless="build-properties-present" >
+    <echo>No build.properties file found; creating default properties file</echo>
+    <copy file="build.properties.example" tofile="build.properties" />
+    <fail>Created build.properties.  Please review its contents before restarting build.</fail>
+  </target>
+
+  <!--
+       Setup base directories from properties file.
+       These include:
+           bluestone.dir - bluestone installation
+           website.dir - website root
+           output.dir  - prm directory in output
+           deploy.dir  - prm directory in deploy
+
+           source.dir  - prm directory in source
+           devroot.dir - parent of all module directories in source
+    -->
+  <target name="-init-base-directories" depends="-ensure-build-properties">
+
+      <!-- Set properties from build.properties file -->
+      <property file="build.properties"/>
+
+      <!-- Set a flag if required directories do not exist -->
+      <condition property="error.cannot-find-default-directories">
+        <not>
+          <and>
+            <available file="${bluestone.dir}"/>
+          </and>
+        </not>
+      </condition>
+
+      <!-- Fail if above condiition is true -->
+      <fail if="error.cannot-find-default-directories">
+One or more required properties was not set in build.properties.  Current
+values are:
+    bluestone.dir: ${bluestone.dir}
+    website.dir:   ${website.dir}
+      </fail>
+
+      <!-- Set the source directory which is really the base directory -->
+      <property name="source.dir" value="${basedir}" />
+
+      <!-- Set a development root property to the parent directory of the
+           base directory -->
+      <property name="devroot.dir" location="${basedir}/.." />
+
+  </target>
+
+  <!--
+       Set all properties that specify directories.
+    -->
+  <target name="-init-directories" depends="-init-base-directories">
+
+      <!-- Source directories -->
+      <property name="tools.dir" location="${devroot.dir}/tools" />
+      <property name="optional.dir" location="${devroot.dir}/optional" />
+      <property name="database.src.dir" location="${optional.dir}/database" />
+      <property name="config.src.dir" location="${source.dir}/Config" />
+      <property name="jdiff.src.dir" location="${config.src.dir}/JDiff" />
+      <property name="bin.src.dir" location="${source.dir}/bin" />
+      <property name="java.src.dir" location="${source.dir}/Java" />
+      <property name="jsp.packagename" value="pnet" />
+      <property name="jsp.src.dir" location="${source.dir}/Jsp" />
+      <property name="jsp.src.package.dir" location="${jsp.src.dir}/${jsp.packagename}" />
+      <property name="resource.src.dir" location="${source.dir}/Resources" />
+      <property name="docs.src.dir" location="${source.dir}/Docs/product" />
+      <property name="test.dir" location="${tools.dir}/test"/>
+
+      <!-- Output directories -->
+      <property name="resource.dest" location="${website.dir}" />
+      <property name="etc.dest" location="${output.dir}/etc"/>
+      <property name="bin.dest" location="${output.dir}/bin"/>
+      <property name="compile.dest" location="${output.dir}/java"/>
+      <property name="jars.dest" location="${output.dir}/jars"/>
+      <property name="javadoc.dest" location="${output.dir}/docs/api"/>
+      <property name="pnetpatch.dest" location="${output.dir}/pnetpatch"/>
+      <property name="rmic.dest" location="${output.dir}/rmic"/>
+
+      <!-- Deploy directories -->
+      <property name="etc.deploy.dest" location="${deploy.dir}/etc" />
+      <property name="lib.deploy.dest" location="${deploy.dir}/lib" />
+      <property name="bin.deploy.dest" location="${deploy.dir}/bin" />
+      <property name="classes.deploy.dest" location="${deploy.dir}/classes" />
+      <property name="xsl.deploy.dest" location="${deploy.dir}/app" />
+      <property name="resource.deploy.dest" location="${deploy.dir}/resource" />
+      <property name="database.deploy.dest" location="${deploy.dir}/database"/>
+      <property name="docs.deploy.dest" location="${deploy.dir}/docs" />
+      <property name="src.deploy.dest" location="${deploy.dir}/src" />
+      <property name="jdiff.deploy.dest" location="${src.deploy.dest}/apidiff"/>
+      <property name="javadoc.deploy.dest" location="${src.deploy.dest}/apiDocs" />
+
+  </target>
+
+  <!--
+       Sets all properties that specify classpaths
+    -->
+  <target name="-init-classpath" depends="-init-directories">
+
+      <!-- Grab the environment to get JAVA_HOME -->
+      <property environment="env" />
+
+      <condition property="error.missing-java-home">
+        <not>
+            <available file="${env.JAVA_HOME}" type="dir" />
+        </not>
+      </condition>
+
+      <!-- Fail if above condiition is true -->
+      <fail if="error.missing-java-home">
+The environment variable JAVA_HOME is not set or does not represent a valid
+directory.  JAVA_HOME is required to locate additional JAR files required
+for compilation with Jikes.
+Current value: ${env.JAVA_HOME}
+      </fail>
+
+      <!-- Constructs the base classpath -->
+      <path id="prm.classpath">
+          <pathelement location="${jars.dest}\pnetpatch.jar"/>
+          <pathelement location="${jars.dest}\activation.jar"/>
+          <pathelement location="${jars.dest}\mail.jar"/>
+          <pathelement location="${jars.dest}\jdom.jar"/>
+          <pathelement location="${jars.dest}\cos.jar"/>
+          <pathelement location="${jars.dest}\chart.jar"/>
+          <pathelement location="${jars.dest}\iTextXML.jar"/>
+          <pathelement location="${jars.dest}\itext.jar"/>
+          <pathelement location="${jars.dest}\commons-validator.jar"/>
+          <pathelement location="${jars.dest}\commons-collections.jar"/>
+          <pathelement location="${jars.dest}\jakarta-oro-2.0.6.jar"/>
+          <pathelement location="${jars.dest}\ojdbc14.jar"/>
+          <pathelement location="${jars.dest}\xerces.jar"/>
+          <pathelement location="${jars.dest}\Verisign.jar"/>
+          <pathelement location="${jars.dest}\log4j-1.2.8.jar"/>
+          <pathelement location="${bluestone.dir}\jars\ubs.jar"/>
+          <pathelement location="${bluestone.dir}\jars\jta-spec1_0_1.jar"/>
+          <pathelement location="${bluestone.dir}\jars\bullejb.jar"/>
+          <pathelement location="${compile.dest}"/>
+          <pathelement location="${env.JAVA_HOME}\jre\lib\jce.jar" />
+          <pathelement location="${env.JAVA_HOME}\jre\lib\jsse.jar" />
+      </path>
+
+      <!-- Constructs the runtime classpath -->
+      <path id="run.classpath">
+          <path refid="prm.classpath"/>
+      </path>
+
+      <!-- Constructs the compilation classpath -->
+      <path id="src.compile.classpath">
+          <pathelement location="c:\java"/>
+          <path refid="prm.classpath"/>
+          <pathelement location="${test.dir}\lib\junit.jar"/>
+      </path>
+
+      <path id="jdiff.classpath">
+          <path refid="src.compile.classpath"/>
+          <pathelement location="${java.src.dir}/jdiff/jdiff.jar"/>
+          <pathelement location="${java.src.dir}/jdiff/xerces.jar"/>
+      </path>
+
+      <path id="unittest.compile.classpath">
+          <pathelement location="c:\java"/>
+          <pathelement location="${test.dir}\mockobjects\output"/>
+          <path refid="prm.classpath"/>
+          <pathelement location="${test.dir}\lib\junit.jar"/>
+          <pathelement location="${test.dir}\lib\junit-addons-1.4.jar"/>
+      </path>
+
+      <!-- Constructs the JSP compilation classpath -->
+      <path id="jsp.src.compile.classpath">
+          <pathelement location="${tools.dir}\bluestone"/>
+          <path refid="src.compile.classpath"/>
+      </path>
+
+  </target>
+
+
+  <!-- =========================================================================
+
+		TARGET PREPARES
+
+		These targets simply prepare output directories for builds
+
+       ===================================================================== -->
+
+  <!-- ===================================================================
+       Prepares the output build directory
+       =================================================================== -->
+  <target name="-prepare" depends="-init">
+    <mkdir dir="${output.dir}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories for compile targets
+       =================================================================== -->
+  <target name="prepare-compile" depends="-prepare">
+    <mkdir dir="${compile.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories for application files
+       =================================================================== -->
+  <target name="prepare-etc" depends="-prepare">
+    <mkdir dir="${etc.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories bin fules
+       =================================================================== -->
+  <target name="prepare-bin" depends="-prepare">
+    <mkdir dir="${bin.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories for jars
+       =================================================================== -->
+  <target name="prepare-jars" depends="-prepare">
+    <mkdir dir="${jars.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories for pnet patch
+       =================================================================== -->
+  <target name="prepare-pnetpatch" depends="-prepare">
+    <mkdir dir="${pnetpatch.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories for com classes
+       =================================================================== -->
+  <target name="prepare-com" depends="prepare-compile">
+    <mkdir dir="${rmic.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories for javadoc targets
+       =================================================================== -->
+  <target name="prepare-javadoc" depends="-prepare">
+    <mkdir dir="${javadoc.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the resource directory
+       =================================================================== -->
+  <target name="prepare-resource" depends="-init">
+    <mkdir dir="${resource.dest}/styles"/>
+    <mkdir dir="${resource.dest}/src"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares for version stuff.
+       =================================================================== -->
+  <target name="prepare-update-version" depends="prepare-compile">
+	<property name="version.java.pre" value="net/project/util/Version.java.pre" />
+	<property name="version.java" value="net/project/util/Version.java" />
+
+        <!-- Set property if Version.java.pre exists -->
+	<available file="${java.src.dir}/${version.java.pre}" property="version.java.pre.present"/>
+
+	<!-- Determine whether translated java source is up to date: Source needs
+	     regenerated if version.properties of Version.java.pre file changes -->
+	<uptodate targetfile="${java.src.dir}/${version.java}" property="version.java.uptodate" >
+            <srcfiles dir="${config.src.dir}" includes="version.properties"/>
+            <srcfiles dir="${java.src.dir}" includes="${version.java.pre}"/>
+        </uptodate>
+  </target>
+
+
+  <!-- =========================================================================
+
+		TARGET BUILDS
+
+		These targets build, compile or copy files
+
+       ===================================================================== -->
+
+  <!-- ===================================================================
+       Compile any unit test stubs
+       =================================================================== -->
+  <target name="compile-unit-test-stubs" depends="-init">
+      <mkdir dir="${test.dir}/mockobjects/output"/>
+      <javac destdir="${test.dir}/mockobjects/output" debug="true" source="1.4">
+          <classpath refid="src.compile.classpath"/>
+          <src location="${test.dir}/mockobjects/src"/>
+      </javac>
+  </target>
+
+  <!-- ===================================================================
+       Compiles the PRM java source tree
+       =================================================================== -->
+  <target name="compile-java" depends="compile-java-com,compile-java-pnet,compile-java-net" description="Compile all non-JSP Java files."/>
+
+  <!-- ===================================================================
+       Compiles com classes
+	   =================================================================== -->
+  <target name="compile-java-com" depends="prepare-compile,jars">
+
+	<!-- Compile com sources -->
+	<javac srcdir="${java.src.dir}"
+	       destdir="${compile.dest}"
+		   debug="${debug}"
+           deprecation="${deprecation}"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+	  <include name="com/**" />
+	</javac>
+
+	<!-- RMI compile certain files -->
+	<rmic base="${compile.dest}">
+	  <include name="com/**/PublisherImpl.class" />
+	  <include name="com/**/MonitorConnectionImpl.class" />
+	  <include name="com/**/Logger.class" />
+      <classpath refid="src.compile.classpath"/>
+    </rmic>
+
+  </target>
+
+  <!-- ===================================================================
+       Compiles the pnet class
+       =================================================================== -->
+  <target name="compile-java-pnet" depends="prepare-compile,jars">
+    <javac srcdir="${java.src.dir}"
+           destdir="${compile.dest}"
+           debug="${debug}"
+           deprecation="${deprecation}"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+	  <include name="pnet/**" />
+	</javac>
+  </target>
+
+  <!-- ===================================================================
+       Compiles the net.project classes
+       =================================================================== -->
+  <target name="compile-java-net" depends="prepare-compile,jars">
+    <javac srcdir="${java.src.dir}"
+           destdir="${compile.dest}"
+           debug="${debug}"
+           deprecation="${deprecation}"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+	  <include name="net/project/**" />
+
+      <!-- Don't compile unit tests -->
+      <exclude name="**/*Test.java" />
+
+      <!-- Don't compile J2EE 1.3 sources (they are for Weblogic build only) -->
+      <exclude name="net/project/security/SessionAccessFilter.java" />
+      <exclude name="net/project/security/SecurityFilter.java" />
+	</javac>
+  </target>
+
+  <!-- ===================================================================
+       Compiles the jsp source tree
+       Process JSPs to Java level - note runs in separate fork to allow for
+       switching of directory and to avoid dying on System.exit() in processor.
+       Also, inserts tools/bluestone in front of Classpath to pick up
+       tweaked JSP compiler (which actually avoids compiling unchanged files)
+
+       IMPORTANT:
+         1)  The directory that is passed here is very specific.  It MUST be
+             the JSP package directory to make the modification checking work.
+             This is a quirk of the Bentley timestamp-compare hack.
+             If none of your JSPs are compiling, this is why.
+             E.g. c:/pnet/src/pnet-main/prm/jsp/prm  or
+                  c:/pnet/src/pnet-main/prm/jsp/pnet  would work
+       =================================================================== -->
+  <target name="compile-jsp-only" depends="prepare-compile" description="Compiles JSP files with no dependency checks">
+
+    <java classname="SaApi.servlet.jsp.SaJspProcessor"
+          dir="${jsp.src.package.dir}"
+          fork="yes"
+          failonerror="yes">
+      <classpath refid="jsp.src.compile.classpath"/>
+      <arg line="-app ${jsp.packagename}.class -level java -recurse -quiet -packageName ${jsp.packagename} -compilePath ${compile.dest} ${jsp.src.package.dir}" />
+    </java>
+
+    <!-- Now compile java versions of jsps (only those in JSP package directory and below -->
+    <javac srcdir="${compile.dest}"
+           destdir="${compile.dest}"
+           debug="${debug}"
+           deprecation="${deprecation}"
+           includes="${jsp.packagename}/**"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+    </javac>
+
+  </target>
+
+  <target name="compile-jsp" depends="compile-java-net,compile-pnetpatch,compile-jsp-only" description="Compiles JSP files" />
+
+  <target name="-check-jsp-specified" unless="jsp.to.compile">
+      <fail>
+          Please set the jsp.to.compile property before calling this target.
+      </fail>
+  </target>
+
+  <target name="compile-single-jsp" depends="-check-jsp-specified, prepare-compile" description="Compile a single JSP file without compiling everything else">
+      <echo message="Compiling file ${jsp.to.compile}"/>
+
+      <java classname="SaApi.servlet.jsp.SaJspProcessor"
+            dir="${jsp.src.package.dir}"
+            fork="yes"
+            failonerror="yes">
+        <classpath refid="jsp.src.compile.classpath"/>
+        <arg line="-app ${jsp.packagename}.class -level java -recurse -quiet -packageName ${jsp.packagename} -compilePath ${compile.dest} ${jsp.to.compile}" />
+      </java>
+
+      <!-- Now compile java versions of jsps (only those in JSP package directory and below -->
+      <javac srcdir="${compile.dest}"
+             destdir="${compile.dest}"
+             debug="${debug}"
+             deprecation="${deprecation}"
+             includes="${jsp.packagename}/**"
+             nowarn="on"
+             source="1.4">
+        <classpath refid="src.compile.classpath"/>
+      </javac>
+  </target>
+
+  <!-- ===================================================================
+       Unit Test Targets
+       =================================================================== -->
+
+    <target name="-test-format-plain">
+        <property name="test.format" value="plain" />
+    </target>
+
+    <target name="-test-format-xml">
+        <property name="test.format" value="xml" />
+    </target>
+
+    <!-- Compile unit test classes -->
+    <target name="compile-unit-test" depends="compile-unit-test-stubs, compile-java">
+        <javac srcdir="${java.src.dir}"
+               destdir="${compile.dest}"
+               debug="${debug}"
+               deprecation="${deprecation}"
+               nowarn="on"
+               source="1.4">
+          <classpath refid="unittest.compile.classpath"/>
+          <include name="net/project/**/*Test.java" />
+        </javac>
+    </target>
+
+    <!-- Run unit tests only; PLAIN format -->
+    <target name="run-unit-test" depends="-init, -test-format-plain, run-single-unit-test, run-all-unit-tests" description="Run unit tests without compiling first"/>
+
+    <target name="run-single-unit-test" if="unittest.to.run">
+        <junit printsummary="yes">
+            <classpath refid="unittest.compile.classpath"/>
+            <formatter type="${test.format}"/>
+            <sysproperty key="mockobject.properties.location" value="${test.dir}\mockobjects.properties"/>
+            <jvmarg value="-ea"/>
+            <!-- Even though the next line shows up as an error, it isn't.  The
+                 property is intended to be supplied on the command line in the
+                 form "make unit-test -Dunittest.to.run=net.project.schedule.TaskEndpointCalculationTest" -->
+            <test name="${unittest.to.run}" haltonfailure="false"/>
+        </junit>
+    </target>
+
+    <target name="run-all-unit-tests" unless="unittest.to.run">
+        <junit printsummary="yes">
+            <classpath refid="unittest.compile.classpath"/>
+            <formatter type="${test.format}"/>
+            <sysproperty key="mockobject.properties.location" value="${test.dir}\mockobjects.properties"/>
+            <!-- 05/06/2003 - Tim
+                 Enabling assertions when using batchtest appears to cause
+                 all assertions to fail.  Commenting it out for now. -->
+            <!--<jvmarg value="-ea"/>-->
+            <batchtest fork="yes">
+              <fileset dir="${java.src.dir}">
+                <include name="**/*Test.java"/>
+              </fileset>
+            </batchtest>
+        </junit>
+    </target>
+
+    <!-- Run unit test after compile; PLAIN format -->
+    <target name="unit-test" depends="compile-unit-test, -test-format-plain, run-unit-test" description="Run all unit tests" />
+
+    <!-- Run unit test after compile; XML format -->
+    <target name="unit-test-xml" depends="-test-format-xml, unit-test" />
+
+    <!-- Run unit test only; XML format -->
+    <target name="run-unit-test-xml" depends="-test-format-xml, run-unit-test" />
+
+
+  <!-- ===================================================================
+       Copies the xml files to output
+       =================================================================== -->
+  <target name="xsl" depends="prepare-compile">
+    <!-- Copy all XSL files from JSP src to output -->
+    <copy todir="${compile.dest}">
+        <fileset dir="${jsp.src.dir}" >
+			<exclude name="**/.#*" />
+            <include name="**/*.xsl" />
+        </fileset>
+    </copy>
+  </target>
+
+  <!-- ===================================================================
+       Version update
+       =================================================================== -->
+  <!-- Fail unless required files are present -->
+  <target name="-update-version-check" depends="prepare-update-version" unless="version.java.pre.present">
+	<fail message="Version check failed.  File: '${java.src.dir}/${version.java.pre}' not present." />
+  </target>
+
+  <!-- Regenerate Version.java unless up-to-date -->
+  <target name="update-version-regenerate" unless="version.java.uptodate" depends="-update-version-check">
+    <filter filtersfile="${config.src.dir}/version.properties" />
+	<copy file="${java.src.dir}/${version.java.pre}" tofile="${java.src.dir}/${version.java}"
+	      filtering="true" overwrite="true" />
+  </target>
+
+  <!-- Compile Version.java -->
+  <target name="compile-version" depends="-update-version-check, update-version-regenerate">
+    <javac srcdir="${java.src.dir}"
+           destdir="${compile.dest}"
+           debug="${debug}"
+           deprecation="${deprecation}"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+	  <include name="${version.java}" />
+	</javac>
+  </target>
+
+
+  <!-- ===================================================================
+       Makes the pnet patch
+       =================================================================== -->
+  <target name="compile-pnetpatch" depends="prepare-pnetpatch,jars,compile-java-com">
+
+    <!--
+
+		UBS_7 patch
+
+		Aplication server patches
+
+	-->
+
+    <!-- Copy class files which have no source to pnetpatch output dir -->
+	<copy todir="${pnetpatch.dest}">
+		<fileset dir="${config.src.dir}/Bluestone/patches/UBS_7">
+			<exclude name="**/.#*" />
+			<include name="**/*.class" />
+		</fileset>
+	</copy>
+
+	<!-- Compile java sources to pnetpatch output dir -->
+	<javac srcdir="${config.src.dir}/Bluestone/patches/UBS_7"
+	       destdir="${pnetpatch.dest}"
+		   debug="${debug}"
+           deprecation="${deprecation}"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+    </javac>
+
+    <!--
+
+		UBS_72GA patch
+
+		Character encoding patches
+
+	-->
+
+	<!-- Compile java sources to pnetpatch output dir -->
+	<javac srcdir="${config.src.dir}/Bluestone/patches/UBS_72GA"
+	       destdir="${pnetpatch.dest}"
+		   debug="${debug}"
+           deprecation="${deprecation}"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+    </javac>
+
+	<!-- Jar it up -->
+	<jar jarfile="${jars.dest}/pnetpatch.jar"
+	     basedir="${pnetpatch.dest}" />
+
+  </target>
+
+  <!-- ===================================================================
+       Copies jars to output
+       =================================================================== -->
+  <target name="jars" depends="prepare-jars">
+    <copy todir="${jars.dest}">
+        <fileset dir="${java.src.dir}/javax">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+        <fileset dir="${java.src.dir}/jars">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+        <fileset dir="${java.src.dir}/jars/jdbc">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+
+
+
+
+        <fileset dir="${java.src.dir}/jars/jdbc">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+        <fileset dir="${java.src.dir}/jars/jdbc">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+        <fileset dir="${java.src.dir}/jars/jdbc">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+        <fileset dir="${java.src.dir}/jars/jdbc">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+    </copy>
+  </target>
+
+  <!-- ===================================================================
+       Build javadoc
+       =================================================================== -->
+  <target name="javadoc" depends="prepare-javadoc" description="Generates JavaDoc for internal use">
+    <javadoc sourcepath="${java.src.dir}"
+              destdir="${javadoc.dest}"
+              packagenames="net.*"
+              windowtitle="Project.net PRMServer v${product.version} (${product.version.codename})"
+              maxmemory="256M"
+              verbose="false"
+              additionalparam="-source 1.4"
+              private="true">
+        <bottom>&lt;div align=&quot;center&quot;> &lt;a href=&quot;http://www.project.net/&quot; target=&quot;_top&quot;>&#169;2000-2003 Project.net, Inc.&lt;/a> All Rights Reserved.&lt;div></bottom>
+        <link href="http://java.sun.com/j2se/1.4.1/docs/api/"/>
+        <link href="http://java.sun.com/j2ee/sdk_1.2.1/techdocs/api/"/>
+        <link href="http://www.jdom.org/docs/apidocs/"/>
+        <link href="http://itext.sourceforge.net/docs/"/>
+    </javadoc>
+
+  </target>
+
+  <!-- ===================================================================
+       Build the resources
+       =================================================================== -->
+  <target name="resource" depends="prepare-resource">
+
+	<!-- Images -->
+    <copy todir="${resource.dest}/images">
+      <fileset dir="${resource.src.dir}/Images">
+		<exclude name="**/.#*" />
+		<exclude name="tabs/src/*" />
+		<exclude name="toolbar/src/*" />
+	  </fileset>
+    </copy>
+
+	<!-- Javascript Source -->
+    <copy todir="${resource.dest}/src">
+        <javadoc sourcepath="${java.src.dir}"
+                  destdir="${javadoc.dest}"
+                  packagenames="net.*"
+                  windowtitle="Project.net PRMServer v${product.version} (${product.version.codename})"
+                  maxmemory="256M"
+                  verbose="false"
+                  additionalparam="-source 1.4"
+                  private="true">
+            <bottom>&lt;div align=&quot;center&quot;> &lt;a href=&quot;http://www.project.net/&quot; target=&quot;_top&quot;>&#169;2000-2003 Project.net, Inc.&lt;/a> All Rights Reserved.&lt;div></bottom>
+            <link href="http://java.sun.com/j2se/1.4.1/docs/api/"/>
+            <link href="http://java.sun.com/j2ee/sdk_1.2.1/techdocs/api/"/>
+            <link href="http://www.jdom.org/docs/apidocs/"/>
+            <link href="http://itext.sourceforge.net/docs/"/>
+        </javadoc>
+
+      <fileset dir="${resource.src.dir}/src" excludes="**/.#*" />
+    </copy>
+
+	<!-- CSS -->
+    <copy todir="${resource.dest}/styles">
+
+      <fileset dir="${resource.src.dir}/styles" excludes="**/.#*" />
+    </copy>
+
+	<!-- HTML files and other resources -->
+    <copy todir="${resource.dest}">
+      <fileset dir="${resource.src.dir}">
+		<exclude name="**/.#*" />
+		<include name="**/*.html" />
+		<include name="**/*.htm" />
+		<include name="**/*.ico" />
+		<include name="hosted" />
+	  </fileset>
+    </copy>
+
+  </target>
+
+  <!-- ===================================================================
+       Builds etc files
+       =================================================================== -->
+  <target name="etc" depends="prepare-etc">
+
+	<copy todir="${etc.dest}">
+        <fileset dir="${config.src.dir}/crypto" excludes="**/.#*" />
+    </copy>
+
+    <!-- Project.net Scheduler files -->
+	<copy todir="${etc.dest}">
+        <fileset dir="${config.src.dir}/scheduler">
+			<exclude name="**/.#*" />
+			<include name="*.properties" />
+		</fileset>
+    </copy>
+
+	<!-- Bluestone config files -->
+	<copy todir="${etc.dest}/ubs/config">
+		<fileset dir="${config.src.dir}/Bluestone/ubs">
+			<exclude name="**/.#*" />
+		</fileset>
+	</copy>
+
+  	<!-- Bluestone lbb files -->
+	<copy todir="${etc.dest}/ubs/lbb">
+		<fileset dir="${config.src.dir}/Bluestone/lbb">
+			<exclude name="**/.#*" />
+		</fileset>
+	</copy>
+
+    <!-- Log4j configuration files -->
+	<copy todir="${etc.dest}">
+        <fileset dir="${config.src.dir}/log4j">
+			<exclude name="**/.#*" />
+			<include name="*.xml" />
+		</fileset>
+    </copy>
+
+  </target>
+
+  <!-- ===================================================================
+       Copies bin files to output
+       =================================================================== -->
+  <target name="bin" depends="prepare-bin">
+    <!-- Copy and fix Unix scripts -->
+    <fixcrlf srcdir="${bin.src.dir}"
+             destdir="${bin.dest}"
+             eol="lf"
+             eof="remove">
+        <exclude name="**/.#*" />
+    	<include name="*.sh" />
+    	<include name="pnet-init" />
+    </fixcrlf>
+
+    <!-- Copy and fix DOS scripts -->
+    <fixcrlf srcdir="${bin.src.dir}"
+             destdir="${bin.dest}"
+             eol="crlf"
+             eof="add">
+        <exclude name="**/.#*" />
+			<include name="*.bat" />
+    </fixcrlf>
+
+    <!-- Copy remaining bin items -->
+    <copy todir="${bin.dest}">
+        <fileset dir="${bin.src.dir}">
+			<exclude name="**/.#*" />
+			<include name="*.exe" />
+  		</fileset>
+    </copy>
+
+  </target>
+
+  <!-- ===================================================================
+       Compiles the ALL source
+       =================================================================== -->
+  <target name="compile" depends="compile-java,compile-pnetpatch,compile-jsp,xsl,compile-version,compile-unit-test" />
+
+  <!-- ===================================================================
+       Builds output
+       =================================================================== -->
+  <target name="build" depends="jars,compile,etc,bin,resource" description="Builds all of the files in the output directory"/>
+
+  <!-- Builds after updating from cvs -->
+  <target name="cvs-build" depends="cvs-update-source, build" />
+  <target name="cvs-build-clean" depends="cvs-update-source, clean, build" />
+  <target name="cvs-build-test" depends="cvs-build, unit-test-xml" />
+  <target name="cvs-build-clean-test" depends="cvs-build-clean, unit-test-xml" />
+
+
+  <!-- =========================================================================
+
+	   Deploys the application
+
+       ===================================================================== -->
+
+    <target name="prepare-deploy" depends="-prepare">
+	   <echo message="Preparing to deploy product: ${product.version.codename} (${product.version})" />
+       <mkdir dir="${deploy.dir}" />
+    </target>
+
+    <!-- Deletes deployment directory -->
+    <target name="prepare-deploy-clean" depends="-init">
+        <delete dir="${deploy.dir}" />
+    </target>
+
+	<target name="prepare-deploy-src" depends="prepare-deploy">
+        <mkdir dir="${src.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-prm" depends="prepare-deploy">
+        <mkdir dir="${lib.deploy.dest}" />
+        <mkdir dir="${classes.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-xsl" depends="prepare-deploy">
+        <mkdir dir="${xsl.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-etc" depends="prepare-deploy">
+        <mkdir dir="${etc.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-bin" depends="prepare-deploy">
+        <mkdir dir="${bin.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-resource" depends="prepare-deploy">
+        <mkdir dir="${resource.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-database" depends="prepare-deploy">
+        <mkdir dir="${database.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-docs" depends="prepare-deploy">
+        <mkdir dir="${docs.deploy.dest}" />
+    </target>
+
+	<target name="prepare-deploy-src-javadoc" depends="prepare-deploy-src">
+        <mkdir dir="${javadoc.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-api-diff" depends="prepare-deploy">
+        <mkdir dir="${jdiff.deploy.dest}"/>
+    </target>
+
+	<!--
+		Deploy targets
+	-->
+
+    <target name="deploy-prm" depends="build, prepare-deploy-prm">
+
+            <jar jarfile="${lib.deploy.dest}/prm.jar"
+                basedir="${compile.dest}">
+
+				<exclude name="**/.#*" />
+				<exclude name="**/*.java" />
+				<exclude name="**/*.xsl" />
+				<exclude name="**/xsl/**" />
+				<exclude name="**/*.jsp" />
+            </jar>
+    </target>
+
+	<!-- Deploy XSL files -->
+    <target name="deploy-xsl" depends="xsl, prepare-deploy-xsl">
+        <copy todir="${xsl.deploy.dest}">
+            <fileset dir="${compile.dest}" >
+			    <exclude name="**/.#*" />
+                <include name="**/*.xsl" />
+				<!-- Must specify possible empty directories here -->
+                <include name="**/include" />
+            </fileset>
+        </copy>
+    </target>
+
+
+  <!-- Deploy JAR files -->
+  <target name="deploy-jars" depends="jars, prepare-deploy-prm">
+    <copy todir="asdgjagsd" asdh="${lib.deploy.dest}" asgd="">
+        <fileset>
+            <and>
+                ajshdkjhaskjdh
+    <type description="sdad"/>
+            </and>
+        </fileset>
+        <fileset dir="${jars.dest}">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+   	</fileset>
+    </copy>
+  </target>
+
+    <!-- Deploy license.txt file -->
+    <target name="deploy-jars-license" depends="prepare-deploy-prm,prepare-deploy-docs,-init">
+        <copy todir="${lib.deploy.dest}">
+            <fileset dir="${java.src.dir}/jars">
+                <include name="License.txt"/>
+            </fileset>
+        </copy>
+
+        <copy todir="${docs.deploy.dest}">
+            <fileset dir="${java.src.dir}/jars">
+                <include name="License.txt"/>
+            </fileset>
+        </copy>
+    </target>
+
+
+    <!-- Updates source from cvs -->
+	<target name="cvs-update-source" depends="-init">
+        <exec dir="${devroot.dir}" executable="cvs">
+			<arg line="-q update -dP prm tools" />
+		</exec>
+	</target>
+
+	<!-- Deploy etc files
+         Note - These are deployed form the source directory, as the files
+         in the output directory have already had tokens replaced, etc.
+      -->
+    <target name="deploy-etc" depends="prepare-deploy-etc">
+
+		<copy todir="${etc.deploy.dest}">
+			<fileset dir="${config.src.dir}/crypto" excludes="**/.#*" />
+        </copy>
+
+        <!-- Project.net Scheduler files -->
+        <copy todir="${etc.deploy.dest}">
+            <fileset dir="${config.src.dir}/scheduler">
+			    <exclude name="**/.#*" />
+			    <include name="*.properties" />
+		    </fileset>
+        </copy>
+
+        <!-- UBS config files -->
+		<copy todir="${etc.deploy.dest}/ubs/config">
+			<fileset dir="${etc.dest}/ubs/config">
+			    <exclude name="**/.#*" />
+			</fileset>
+        </copy>
+
+        <!-- LBB Plugins -->
+		<copy todir="${etc.deploy.dest}/ubs/lbb">
+			<fileset dir="${etc.dest}/ubs/lbb">
+			    <exclude name="**/.#*" />
+			</fileset>
+        </copy>
+
+		<copy todir="${etc.deploy.dest}">
+			<fileset dir="${config.src.dir}/log4j" excludes="**/.#*" />
+        </copy>
+
+    </target>
+
+	<!-- Deploy bin files -->
+    <target name="deploy-bin" depends="prepare-deploy-bin, bin">
+        <copy todir="${bin.deploy.dest}">
+			<fileset dir="${bin.dest}" excludes="**/.#*" />
+        </copy>
+    </target>
+
+  <!-- Deploy web server resources -->
+  <target name="deploy-resource" depends="resource, prepare-deploy-resource">
+
+	<!-- Images -->
+    <copy todir="${resource.deploy.dest}/images">
+      <fileset dir="${resource.src.dir}/images">
+		<exclude name="**/.#*" />
+		<exclude name="tabs/src/*" />
+		<exclude name="toolbar/src/*" />
+	  </fileset>
+    </copy>
+
+	<!-- Javascript Source -->
+    <copy todir="${resource.deploy.dest}/src">
+      <fileset dir="${resource.src.dir}/src" excludes="**/.#*" />
+    </copy>
+
+	<!-- CSS -->
+    <copy todir="${resource.deploy.dest}/styles">
+      <fileset dir="${resource.src.dir}/styles" excludes="**/.#*" />
+    </copy>
+
+	<!-- HTML files and other resources -->
+    <copy todir="${resource.deploy.dest}">
+      <fileset dir="${resource.src.dir}">
+		<exclude name="**/.#*" />
+		<include name="**/*.html" />
+		<include name="**/*.htm" />
+		<include name="**/*.ico" />
+		<include name="hosted" />
+	  </fileset>
+        <fileset></fileset>
+    </copy>
+
+  </target>
+
+	<!-- Deploy database files -->
+    <target name="deploy-database" depends="prepare-deploy-database">
+        <copy todir="${database.deploy.dest}">
+			<fileset dir="${database.src.dir}">
+			  <exclude name="**/.#*" />
+			  <include name="CreateScripts/**" />
+			</fileset>
+        </copy>
+
+
+      <!-- Images -->
+      <copy todir="${resource.deploy.dest}/images">
+        <fileset dir="${resource.src.dir}/images">
+          <exclude name="**/.#*" />
+          <exclude name="tabs/src/*" />
+          <exclude name="toolbar/src/*" />
+        </fileset>
+      </copy>
+
+      <!-- Javascript Source -->
+      <copy todir="${resource.deploy.dest}/src">
+        <fileset dir="${resource.src.dir}/src" excludes="**/.#*" />
+      </copy>
+
+      <!-- CSS -->
+      <copy todir="${resource.deploy.dest}/styles">
+        <fileset dir="${resource.src.dir}/styles" excludes="**/.#*" />
+      </copy>
+
+      <!-- HTML files and other resources -->
+      <copy todir="${resource.deploy.dest}">
+        <fileset dir="${resource.src.dir}">
+          <exclude name="**/.#*" />
+          <include name="**/*.html" />
+          <include name="**/*.htm" />
+          <include name="**/*.ico" />
+          <include name="hosted" />
+        </fileset>
+          <fileset></fileset>
+      </copy>
+
+
+
+      <!-- Images -->
+      <copy todir="${resource.deploy.dest}/images">
+        <fileset dir="${resource.src.dir}/images">
+          <exclude name="**/.#*" />
+          <exclude name="tabs/src/*" />
+          <exclude name="toolbar/src/*" />
+        </fileset>
+      </copy>
+
+      <!-- Javascript Source -->
+      <copy todir="${resource.deploy.dest}/src">
+        <fileset dir="${resource.src.dir}/src" excludes="**/.#*" />
+      </copy>
+
+      <!-- CSS -->
+      <copy todir="${resource.deploy.dest}/styles">
+        <fileset dir="${resource.src.dir}/styles" excludes="**/.#*" />
+      </copy>
+
+      <!-- HTML files and other resources -->
+      <copy todir="${resource.deploy.dest}">
+        <fileset dir="${resource.src.dir}">
+          <exclude name="**/.#*" />
+          <include name="**/*.html" />
+          <include name="**/*.htm" />
+          <include name="**/*.ico" />
+          <include name="hosted" />
+        </fileset>
+          <fileset></fileset>
+      </copy>
+
+
+    </target>
+
+	<!-- Deploy docs -->
+    <target name="deploy-docs" depends="prepare-deploy-docs">
+
+		<!-- Copy all docs except for Word Documents to deployment area
+		     Assumes Word documents are created as PDF files -->
+		<copy todir="${docs.deploy.dest}">
+			<fileset dir="${docs.src.dir}">
+			    <exclude name="**/.#*" />
+				<exclude name="**/*.doc" />
+			</fileset>
+        </copy>
+
+    </target>
+
+  <!-- ===================================================================
+       Deployments for Source releases
+       =================================================================== -->
+
+	<!-- Deploy JSP files -->
+    <target name="deploy-src-jsp" depends="compile-jsp, prepare-deploy-src">
+        <copy todir="${src.deploy.dest}/jsp">
+            <fileset dir="${jsp.src.dir}" >
+			    <exclude name="**/.#*" />
+            </fileset>
+        </copy>
+    </target>
+
+	<!-- Deploy api docs -->
+	<!--packagenames="net.project.*"-->
+	<target name="deploy-src-javadoc" depends="prepare-deploy-src-javadoc">
+		<javadoc packagenames="net.*"
+                 sourcepath="${java.src.dir}"
+			     destdir="${src.deploy.dest}/apiDocs"
+			     author="false"
+			     public="true"
+                 maxmemory="256M"
+                 additionalparam="-source 1.4"
+                 defaultexcludes="yes"
+			     windowtitle="Project.net PRMServer v${product.version} (${product.version.codename})">
+            <bottom>&lt;div align=&quot;center&quot;> &lt;a href=&quot;http://www.project.net/&quot; target=&quot;_top&quot;>&#169;2000-2003 Project.net, Inc.&lt;/a> All Rights Reserved.&lt;div></bottom>
+            <link href="http://java.sun.com/j2se/1.4.1/docs/api/"/>
+            <link href="http://java.sun.com/j2ee/sdk_1.2.1/techdocs/api/"/>
+            <link href="http://www.jdom.org/docs/apidocs/"/>
+            <link href="http://itext.sourceforge.net/docs/"/>
+        </javadoc>
+	</target>
+
+    <target name="generate-new-api-diff" depends="-init">
+
+        <!-- The name of apis, used for naming files -->
+        <property name="newapiname" value="${product.version.codename}" />
+
+        <!-- Produce XML for this version's Javadoc -->
+		<javadoc packagenames="net.project.*"
+                 sourcepath="${java.src.dir}"
+			     destdir=""
+			     author="false"
+			     public="true"
+                 maxmemory="256M"
+                 defaultexcludes="yes"
+			     windowtitle="Project.net PRMServer v${product.version} (${product.version.codename})"
+                 additionalparam="-source 1.4">
+            <classpath refid="jdiff.classpath"/>
+            <doclet name="jdiff.JDiff" path="${java.src.dir}/jdiff/jdiff.jar:${java.src.dir}/diff/xerces.jar">
+                <param name="-apidir" value="${jdiff.src.dir}"/>
+                <param name="-apiname" value="${newapiname}"/>
+            </doclet>
+        </javadoc>
+    </target>
+
+    <!-- Produce a report which will outline the API differences between this
+         version and the previous one. -->
+	<target name="deploy-api-diff" depends="prepare-deploy-api-diff,generate-new-api-diff" description="Produce an API difference report between this version and the previous one." >
+
+        <!-- The name of apis, used for naming files -->
+        <property name="oldapiname" value="7_5_1_release" />
+        <property name="newapiname" value="${product.version.codename}" />
+
+        <!-- Produce the diff between this and last version's Javadoc -->
+		<javadoc packagenames="net.project.*"
+                 sourcepath="${java.src.dir}"
+			     destdir=""
+			     author="false"
+			     public="true"
+                 maxmemory="256m"
+                 additionalparam="-source 1.4"
+                 defaultexcludes="yes"
+			     windowtitle="Project.net PRMServer v${product.version} (${product.version.codename})">
+            <doclet name="jdiff.JDiff" path="${java.src.dir}/jdiff/jdiff.jar:${java.src.dir}/jdiff/xerces.jar">
+                <param name="-d" value="${jdiff.deploy.dest}"/>
+                <param name="-oldapi" value="${oldapiname}"/>
+                <param name="-oldapidir" value="${jdiff.src.dir}"/>
+                <param name="-newapi" value="${newapiname}"/>
+                <param name="-newapidir" value="${jdiff.src.dir}"/>
+                <param name="-javadocold" value="../../oldapiDocs/"/>
+                <param name="-javadocnew" value="../../apiDocs/"/>
+            </doclet>
+        </javadoc>
+
+        <!-- Delete some files that shouldn't be shipped to the user. -->
+        <delete file="${jdiff.deploy.dest}/missingSinces.txt"/>
+        <delete file="${jdiff.deploy.dest}/user_comments_for_${oldapiname}_to_${newapiname}.xml"/>
+    </target>
+
+    <!-- Makes a deployment; incrementally (does not clean first) -->
+    <target name="deploy" depends="-debug-off, prepare-deploy, deploy-prm, deploy-jars, deploy-jars-license, deploy-xsl, deploy-resource, deploy-etc, deploy-bin, deploy-docs, deploy-database" />
+
+    <!-- Makes a source deployment; incrementally (does not clean first) -->
+    <target name="deploy-src" depends="-debug-off, deploy, deploy-src-jsp, deploy-src-javadoc, deploy-api-diff" />
+
+    <!-- Makes a source deployment; incrementally (does not clean first) -->
+    <target name="deploy-src-no-javadoc" depends="-debug-off, deploy, deploy-src-jsp" />
+
+    <!-- Cleans pending a deployment -->
+    <target name="deploy-clean" depends="-debug-off, prepare-deploy-clean, clean" description="Deletes all of the files from the deploy directory" />
+
+  <!-- ===================================================================
+       Run the application
+       =================================================================== -->
+    <target name="copy-runtime-config-file" depends="-init" description="Customizes the sajava.ini file in the bluestone configuration directory based on your local runtime configuration.">
+        <filter filtersfile="./runtime.properties"/>
+        <copy todir="${bluestone.dir}/config" filtering="true" overwrite="true" >
+            <fileset dir="${config.src.dir}/Bluestone/ubs" includes="sajava.ini SaLBB.ini"/>
+        </copy>
+        <copy file="${config.src.dir}/Bluestone/ubs/apserver.txt.noproxy.example" tofile="${bluestone.dir}/config/apserver.txt" filtering="true" overwrite="true" />
+    </target>
+
+    <target name="run" depends="-init">
+        <java classname="SaApi.SaAppServController" fork="yes" classpathref="run.classpath">
+            <arg value="-port"/>
+            <arg value="20000"/>
+            <arg value="-debug"/>
+            <arg value="true"/>
+        </java>
+
+    </target>
+
+  <!-- ===================================================================
+       Escrow creation target
+       =================================================================== -->
+  <target name="create-escrow-source" depends="-init" description="Create full source zip for escrow account">
+      <zip zipfile="../prm_${product.version.codename}_full_src.zip">
+          <zipfileset dir="../prm" prefix="prm">
+              <exclude name="**/CVS"/>
+              <exclude name="**/CVS/*"/>
+          </zipfileset>
+          <zipfileset dir="../optional" prefix="optional">
+              <exclude name="**/CVS"/>
+              <exclude name="**/CVS/*"/>
+          </zipfileset>
+          <zipfileset dir="../tools" prefix="tools">
+              <exclude name="**/CVS"/>
+              <exclude name="**/CVS/*"/>
+          </zipfileset>
+      </zip>
+      <echo>
+          Now, manually add the contents of the \\lion\\Development\Development Documentation\
+          directory to the zip file.  The zip file creation will be complete then.
+      </echo>
+  </target>
+
+  <!-- ===================================================================
+       Installer
+       =================================================================== -->
+
+  <!-- Build Zip file -->
+  <target name="zip" depends="prepare-deploy">
+	<!-- Zip file placed in root of deployment directory -->
+	<zip zipfile="${deploy.dir}/../prm_${product.version.codename}.zip">
+      <zipfileset dir="${deploy.dir}" prefix="prm"
+	      excludes="src/**" />
+	</zip>
+  </target>
+
+  <!-- Build Zip file including source -->
+  <target name="zip-src" depends="prepare-deploy-src">
+	<!-- Zip file placed in deploy directory with product version -->
+	<zip zipfile="${deploy.dir}/../prm_${product.version.codename}-src.zip">
+      <zipfileset dir="${deploy.dir}" prefix="prm" />
+	</zip>
+  </target>
+
+  <!-- Builds the Installer (which is currently a Zip) -->
+  <target name="installer" depends="deploy, zip" />
+
+  <!-- Builds the Installer from clean (which is currently a Zip) -->
+  <target name="installer-clean" depends="deploy-clean, installer" description="Builds the entire product from scratch into an installer"/>
+
+  <!-- Builds the Installer from source (which is currently a Zip) -->
+  <target name="installer-src" depends="deploy-src, zip-src" />
+
+  <!-- Builds the Installer from clean (which is currently a Zip) -->
+  <target name="installer-src-clean" depends="deploy-clean, installer-src" description="Builds the entire product with sources from scratch into an installer"/>
+
+    <target name="-prepare-patch" depends="-init">
+        <property name="patch.output.dir" value="${output.dir}/../patch" />
+        <mkdir dir="${patch.output.dir}"/>
+    </target>
+
+    <!-- This patch has been delivered to: ST -->
+    <target name="create-7.6.3-patch-1" depends="-prepare-patch" description="Create Patch 1 for 7.6.3">
+        <property name="currentpatch.output.dir" value="${patch.output.dir}/patch1" />
+        <mkdir dir="${currentpatch.output.dir}"/>
+
+        <delete file="${currentpatch.output.dir}/763Patch1-classes.zip"/>
+        <zip zipfile="${currentpatch.output.dir}/763Patch1-classes.zip">
+            <zipfileset dir="${output.dir}/java/" prefix="classes">
+                <include name="pnet/schedule/fixoverallocations_sjsp.class"/>
+                <include name="net/project/schedule/ScheduleEntry.class"/>
+                <include name="net/project/schedule/ScheduleEntry$*.class"/>
+                <include name="net/project/schedule/TaskEndpointCalculation.class"/>
+                <include name="net/project/schedule/TaskEndpointCalculation$*.class"/>
+                <include name="net/project/schedule/Schedule.class"/>
+                <include name="net/project/schedule/Schedule$*.class"/>
+                <include name="net/project/space/SpaceFactory.class"/>
+                <include name="net/project/space/SpaceFactory$*.class"/>
+                <include name="net/project/base/finder/Finder.class"/>
+                <include name="net/project/base/finder/Finder$*.class"/>
+                <include name="net/project/schedule/TaskFinder.class"/>
+                <include name="net/project/schedule/TaskFinder$*.class"/>
+                <include name="net/project/persistence/PersistenceException.class"/>
+                <include name="net/project/persistence/PersistenceException$*.class"/>
+                <!--<include name=""/>-->
+            </zipfileset>
+        </zip>
+
+        <delete file="${currentpatch.output.dir}/763Patch1-database.zip"/>
+        <zip zipfile="${currentpatch.output.dir}/763Patch1-database.zip">
+            <zipfileset dir="${source.dir}/patch/">
+                <include name="patch1.sql"/>
+            </zipfileset>
+        </zip>
+
+        <copy file="${source.dir}/patch/7.6.3-Patch1-ReleaseNotes.txt"
+              todir="${currentpatch.output.dir}"/>
+    </target>
+
+    <!-- ENW Bugs -->
+    <target name="create-7.6.3-patch-2" depends="-prepare-patch" description="Create Patch 2 for 7.6.3">
+        <property name="currentpatch.output.dir" value="${patch.output.dir}/patch2" />
+        <mkdir dir="${currentpatch.output.dir}"/>
+
+        <delete file="${currentpatch.output.dir}/763Patch2-classes.zip"/>
+        <zip zipfile="${currentpatch.output.dir}/763Patch2-classes.zip">
+            <zipfileset dir="${output.dir}/java/" prefix="classes">
+                <include name="pnet/channel/customizechannels_sjsp.class"/>
+                <include name="pnet/document/documentaddlink_sjsp.class"/>
+                <include name="pnet/discussion/postnewprocessing_sjsp.class"/>
+                <include name="pnet/schedule/main_sjsp.class"/>
+                <include name="pnet/schedule/workingtime/edit_sjsp.class"/>
+                <include name="pnet/schedule/workingtime/list_sjsp.class"/>
+                <include name="net/project/discussion/DiscussionGroup.class"/>
+                <include name="net/project/discussion/DiscussionGroup$*.class"/>
+                <include name="net/project/discussion/Post.class"/>
+                <include name="net/project/discussion/Post$*.class"/>
+                <include name="net/project/notification/EventCodes.class"/>
+                <include name="net/project/notification/EventCodes$*.class"/>
+                <include name="net/project/resource/ResourceAllocationCalendar.class"/>
+                <include name="net/project/resource/ResourceAllocationCalendar$*.class"/>
+                <include name="net/project/schedule/mvc/ScheduleHandlerMapping.class"/>
+                <include name="net/project/schedule/mvc/ScheduleHandlerMapping$*.class"/>
+            </zipfileset>
+
+            <!-- BFD-1900
+                Java/net/project/news/News.java
+                Java/net/project/news/NewsManager.java
+                Java/net/project/util/XSLFormat.java
+                Java/net/project/util/XSLFormatTest.java
+                Jsp/pnet/news/include/NewsChannel.jsp
+                Jsp/pnet/news/xsl/news-channel.xsl
+            -->
+            <zipfileset dir="${output.dir}/java/" prefix="classes">
+                <include name="net/project/news/News.class"/>
+                <include name="net/project/news/News$*.class"/>
+                <include name="net/project/news/NewsManager.class"/>
+                <include name="net/project/news/NewsManager$*.class"/>
+                <include name="net/project/util/XSLFormat.class"/>
+                <include name="net/project/util/XSLFormat$*.class"/>
+                <include name="pnet/news/include/newschannel_sjsp.class"/>
+
+            </zipfileset>
+            <zipfileset dir="${output.dir}/java/" prefix="app">
+                <include name="pnet/news/xsl/news-channel.xsl"/>
+
+            </zipfileset>
+
+            <!-- BFD-1906
+                Jsp/pnet/schedule/MPXImportResult.jsp
+                Jsp/pnet/workflow/envelope/EnvelopeWizardPage2.jsp
+            -->
+            <zipfileset dir="${output.dir}/java/" prefix="classes">
+                <include name="pnet/schedule/mpximportresult_sjsp.class"/>
+                <include name="pnet/workflow/envelope/envelopewizardpage2_sjsp.class"/>
+            </zipfileset>
+            <!-- BFD-1907
+                Jsp/pnet/business/Setup.jsp
+                Jsp/pnet/methodology/Actions.jsp
+                Jsp/pnet/methodology/TemplifySpace.jsp
+            -->
+            <zipfileset dir="${output.dir}/java/" prefix="classes">
+                <include name="pnet/business/setup_sjsp.class"/>
+                <include name="pnet/methodology/actions_sjsp.class"/>
+                <include name="pnet/methodology/templifyspace_sjsp.class"/>
+            </zipfileset>
+        </zip>
+
+        <delete file="${currentpatch.output.dir}/763Patch2-database.zip"/>
+        <zip zipfile="${currentpatch.output.dir}/763Patch2-database.zip">
+            <zipfileset dir="${source.dir}/patch/">
+                <include name="Patch2.sql"/>
+            </zipfileset>
+        </zip>
+
+        <copy file="${source.dir}/patch/7.6.3-Patch2-ReleaseNotes.txt"
+              todir="${currentpatch.output.dir}"/>
+    </target>
+
+    <target name="create-7.6.3-patch-3" depends="-prepare-patch" description="Create Patch 3 for 7.6.3">
+        <property name="currentpatch.output.dir" value="${patch.output.dir}/patch3" />
+        <mkdir dir="${currentpatch.output.dir}"/>
+
+        <delete file="${currentpatch.output.dir}/763Patch3-classes.zip"/>
+        <zip zipfile="${currentpatch.output.dir}/763Patch3-classes.zip">
+            <zipfileset dir="${output.dir}/java/" prefix="classes">
+                <include name="pnet/document/documentaddlink_sjsp.class"/>
+                <include name="net/project/schedule/ScheduleEntry.class"/>
+                <include name="net/project/schedule/ScheduleEntry$*.class"/>
+                <!--<include name=""/>-->
+            </zipfileset>
+        </zip>
+
+        <delete file="${currentpatch.output.dir}/763Patch1-database.zip"/>
+        <zip zipfile="${currentpatch.output.dir}/763Patch1-database.zip">
+            <zipfileset dir="${source.dir}/patch/">
+                <include name="patch1.sql"/>
+            </zipfileset>
+        </zip>
+
+        <copy file="${source.dir}/patch/7.6.3-Patch3-ReleaseNotes.txt"
+              todir="${currentpatch.output.dir}"/>
+    </target>
+
+  <!-- ===================================================================
+       Cleans everything: build tree
+               - build tree
+       =================================================================== -->
+  <target name="clean" depends="-init" description="Delete all of the files from the resource and output directories">
+    <delete dir="${output.dir}" />
+	<delete dir="${resource.dest}" />
+  </target>
+
+
+</project>
diff --git a/xml/tests/testData/psi/incrementalReparse41_before.xml b/xml/tests/testData/psi/incrementalReparse41_before.xml
new file mode 100644
index 0000000..f4f3323
--- /dev/null
+++ b/xml/tests/testData/psi/incrementalReparse41_before.xml
@@ -0,0 +1,1594 @@
+
+<!-- ===================================================================
+
+   Build file for PRM - for use with the Jakarta Ant java build tool
+   Requires Ant 1.5 or greater
+
+Build Instructions:
+   To build, run
+     build.bat - optionally with a target arg as indicated below -
+                 in the directory where this file is located.
+
+   The batch/shell file sets up your classpath and calls java org.apache.tools.ant.Main
+
+Authors:
+  Tim Morrow <[email protected]>
+
+   $Id: build.xml,v 1.80.2.14 2004/01/17 00:43:54 tim Exp $
+
+==================================================================== -->
+
+<project name="prm" default="build">
+
+  <!-- Print Usage of this build file -->
+  <target name="usage">
+    <echo>
+build [target]
+
+Where target is one of the following:
+-------------------
+Compilation Targets
+-------------------
+  build               (default) compiles, builds and copies all files
+  compile             compiles java sources, jsp sources and pnet patch to
+                        output directories
+  compile-java        compiles java classes in the following packages:
+                        com, pnet, net.project
+  compile-jsp         compiles jsp sources only
+  compile-java-com    compiles java com.* classes only (including rmi classes)
+  compile-java-pnet   compiles java pnet.* classes only
+  compile-java-net    compiles java net.* classes only
+  compile-pnetpatch   compiles pnet patch and builds jar file
+  compile-version     compiles Version.java
+
+  javadoc             generates javadoc; for internal use only
+  resource            builds resources (images etc.) and copies to web root
+  xsl                 copies XSL files to output directories
+  etc                 copies application files (e.g. crypto/key.txt) to output
+                        directories
+  bin                 copies bin files (e.g. start_listeners.bat) to output
+                        directories
+
+  clean               purges the output tree
+
+------------------
+Deployment Targets
+------------------
+  deploy              Deploys application; executes build target then executes
+                        all of the following deploy targets:
+                        (Note: All targets perform incremental builds)
+  deploy-prm
+  deploy-xsl
+  deploy-etc
+  deploy-jars
+  deploy-bin
+  deploy-resource
+  deploy-database
+  deploy-docs
+
+  deploy-src          Deploys application; executes "deploy" target then
+                        executes these:
+  deploy-src-jsp
+  deploy-src-javadoc
+
+  deploy-clean        Purges the output and deployment tree; suitable for use
+                        before either "deploy" or "deploy-src"
+
+-----------------
+Packaging Targets
+-----------------
+  installer           Generates an installer; executes the "deploy" target and
+                        the "zip" target (incremental)
+  installer-clean     Purges the output and deployment tree then generates an
+                        installer (from clean)
+  installer-src       Generates an installer; executes the "deploy-src" target
+                        and the "zip-src" target
+  installer-src-clean Purges the output and deployment tree then generates an
+                        installer with source (from clean)
+  zip                 Creates a zip file in releases directory based on the
+                        current deployment (incremental)
+  zip-src             Creates a zip file in deployment directory, including
+                        the source (incremental)
+  create-escrow-source Creates a zip file containing escrow software
+
+-----------------
+Unit Test Targets
+-----------------
+   compile-unit-test    Compiles unit test stubs and all unit test classes
+   unit-test            Compiles and executes all unit tests
+   run-single-unit-test Runs a single unit test.  The unit test class to run
+                          is passed on the command line as follows:
+
+                          build run-single-unit-test
+                              -Dunittest.to.run=fullyqualifiedclassname
+
+                          where fullyqualifiedclassname is a unit test class
+
+-----------------
+Other Targets
+-----------------
+   run                Run an application server instance
+
+    </echo>
+  </target>
+
+
+  <!--
+       This target constructs the properties required for building the product.
+    -->
+  <target name="-init" depends="-init-base-directories, -init-directories, -init-classpath, -debug-on">
+
+      <!-- Set compilation properties -->
+      <property name="build.compiler" value="jikes"/>
+      <property name="build.rmic" value="sun"/>
+      <property name="deprecation" value="off"/>
+
+      <!-- Version Properties contains properties:
+               product.version
+	           product.version.codename
+	           autogenerate.warning
+      -->
+      <property file="${config.src.dir}/version.properties" />
+
+      <echo message="Compilation debug setting is ${debug}" />
+  </target>
+
+  <!-- Allows compilation debug info to be turned off via a dependency -->
+  <target name="-debug-off">
+      <property name="debug" value="off"/>
+  </target>
+
+  <!--
+        Allows compilation debug info to be turned on via a dependency.
+        This should be set ahead of the "init" target
+    -->
+  <target name="-debug-on">
+      <property name="debug" value="on"/>
+  </target>
+
+  <!-- Checks for presence of build.properties; sets build-properties-present -->
+  <target name="-check-build-properties">
+     <condition property="build-properties-present">
+          <available file="build.properties" />
+     </condition>
+  </target>
+
+  <!-- Copies build.properties.example to build.properties if build.properties
+       is not present -->
+  <target name="-ensure-build-properties" depends="-check-build-properties" unless="build-properties-present" >
+    <echo>No build.properties file found; creating default properties file</echo>
+    <copy file="build.properties.example" tofile="build.properties" />
+    <fail>Created build.properties.  Please review its contents before restarting build.</fail>
+  </target>
+
+  <!--
+       Setup base directories from properties file.
+       These include:
+           bluestone.dir - bluestone installation
+           website.dir - website root
+           output.dir  - prm directory in output
+           deploy.dir  - prm directory in deploy
+
+           source.dir  - prm directory in source
+           devroot.dir - parent of all module directories in source
+    -->
+  <target name="-init-base-directories" depends="-ensure-build-properties">
+
+      <!-- Set properties from build.properties file -->
+      <property file="build.properties"/>
+
+      <!-- Set a flag if required directories do not exist -->
+      <condition property="error.cannot-find-default-directories">
+        <not>
+          <and>
+            <available file="${bluestone.dir}"/>
+          </and>
+        </not>
+      </condition>
+
+      <!-- Fail if above condiition is true -->
+      <fail if="error.cannot-find-default-directories">
+One or more required properties was not set in build.properties.  Current
+values are:
+    bluestone.dir: ${bluestone.dir}
+    website.dir:   ${website.dir}
+      </fail>
+
+      <!-- Set the source directory which is really the base directory -->
+      <property name="source.dir" value="${basedir}" />
+
+      <!-- Set a development root property to the parent directory of the
+           base directory -->
+      <property name="devroot.dir" location="${basedir}/.." />
+
+  </target>
+
+  <!--
+       Set all properties that specify directories.
+    -->
+  <target name="-init-directories" depends="-init-base-directories">
+
+      <!-- Source directories -->
+      <property name="tools.dir" location="${devroot.dir}/tools" />
+      <property name="optional.dir" location="${devroot.dir}/optional" />
+      <property name="database.src.dir" location="${optional.dir}/database" />
+      <property name="config.src.dir" location="${source.dir}/Config" />
+      <property name="jdiff.src.dir" location="${config.src.dir}/JDiff" />
+      <property name="bin.src.dir" location="${source.dir}/bin" />
+      <property name="java.src.dir" location="${source.dir}/Java" />
+      <property name="jsp.packagename" value="pnet" />
+      <property name="jsp.src.dir" location="${source.dir}/Jsp" />
+      <property name="jsp.src.package.dir" location="${jsp.src.dir}/${jsp.packagename}" />
+      <property name="resource.src.dir" location="${source.dir}/Resources" />
+      <property name="docs.src.dir" location="${source.dir}/Docs/product" />
+      <property name="test.dir" location="${tools.dir}/test"/>
+
+      <!-- Output directories -->
+      <property name="resource.dest" location="${website.dir}" />
+      <property name="etc.dest" location="${output.dir}/etc"/>
+      <property name="bin.dest" location="${output.dir}/bin"/>
+      <property name="compile.dest" location="${output.dir}/java"/>
+      <property name="jars.dest" location="${output.dir}/jars"/>
+      <property name="javadoc.dest" location="${output.dir}/docs/api"/>
+      <property name="pnetpatch.dest" location="${output.dir}/pnetpatch"/>
+      <property name="rmic.dest" location="${output.dir}/rmic"/>
+
+      <!-- Deploy directories -->
+      <property name="etc.deploy.dest" location="${deploy.dir}/etc" />
+      <property name="lib.deploy.dest" location="${deploy.dir}/lib" />
+      <property name="bin.deploy.dest" location="${deploy.dir}/bin" />
+      <property name="classes.deploy.dest" location="${deploy.dir}/classes" />
+      <property name="xsl.deploy.dest" location="${deploy.dir}/app" />
+      <property name="resource.deploy.dest" location="${deploy.dir}/resource" />
+      <property name="database.deploy.dest" location="${deploy.dir}/database"/>
+      <property name="docs.deploy.dest" location="${deploy.dir}/docs" />
+      <property name="src.deploy.dest" location="${deploy.dir}/src" />
+      <property name="jdiff.deploy.dest" location="${src.deploy.dest}/apidiff"/>
+      <property name="javadoc.deploy.dest" location="${src.deploy.dest}/apiDocs" />
+
+  </target>
+
+  <!--
+       Sets all properties that specify classpaths
+    -->
+  <target name="-init-classpath" depends="-init-directories">
+
+      <!-- Grab the environment to get JAVA_HOME -->
+      <property environment="env" />
+
+      <condition property="error.missing-java-home">
+        <not>
+            <available file="${env.JAVA_HOME}" type="dir" />
+        </not>
+      </condition>
+
+      <!-- Fail if above condiition is true -->
+      <fail if="error.missing-java-home">
+The environment variable JAVA_HOME is not set or does not represent a valid
+directory.  JAVA_HOME is required to locate additional JAR files required
+for compilation with Jikes.
+Current value: ${env.JAVA_HOME}
+      </fail>
+
+      <!-- Constructs the base classpath -->
+      <path id="prm.classpath">
+          <pathelement location="${jars.dest}\pnetpatch.jar"/>
+          <pathelement location="${jars.dest}\activation.jar"/>
+          <pathelement location="${jars.dest}\mail.jar"/>
+          <pathelement location="${jars.dest}\jdom.jar"/>
+          <pathelement location="${jars.dest}\cos.jar"/>
+          <pathelement location="${jars.dest}\chart.jar"/>
+          <pathelement location="${jars.dest}\iTextXML.jar"/>
+          <pathelement location="${jars.dest}\itext.jar"/>
+          <pathelement location="${jars.dest}\commons-validator.jar"/>
+          <pathelement location="${jars.dest}\commons-collections.jar"/>
+          <pathelement location="${jars.dest}\jakarta-oro-2.0.6.jar"/>
+          <pathelement location="${jars.dest}\ojdbc14.jar"/>
+          <pathelement location="${jars.dest}\xerces.jar"/>
+          <pathelement location="${jars.dest}\Verisign.jar"/>
+          <pathelement location="${jars.dest}\log4j-1.2.8.jar"/>
+          <pathelement location="${bluestone.dir}\jars\ubs.jar"/>
+          <pathelement location="${bluestone.dir}\jars\jta-spec1_0_1.jar"/>
+          <pathelement location="${bluestone.dir}\jars\bullejb.jar"/>
+          <pathelement location="${compile.dest}"/>
+          <pathelement location="${env.JAVA_HOME}\jre\lib\jce.jar" />
+          <pathelement location="${env.JAVA_HOME}\jre\lib\jsse.jar" />
+      </path>
+
+      <!-- Constructs the runtime classpath -->
+      <path id="run.classpath">
+          <path refid="prm.classpath"/>
+      </path>
+
+      <!-- Constructs the compilation classpath -->
+      <path id="src.compile.classpath">
+          <pathelement location="c:\java"/>
+          <path refid="prm.classpath"/>
+          <pathelement location="${test.dir}\lib\junit.jar"/>
+      </path>
+
+      <path id="jdiff.classpath">
+          <path refid="src.compile.classpath"/>
+          <pathelement location="${java.src.dir}/jdiff/jdiff.jar"/>
+          <pathelement location="${java.src.dir}/jdiff/xerces.jar"/>
+      </path>
+
+      <path id="unittest.compile.classpath">
+          <pathelement location="c:\java"/>
+          <pathelement location="${test.dir}\mockobjects\output"/>
+          <path refid="prm.classpath"/>
+          <pathelement location="${test.dir}\lib\junit.jar"/>
+          <pathelement location="${test.dir}\lib\junit-addons-1.4.jar"/>
+      </path>
+
+      <!-- Constructs the JSP compilation classpath -->
+      <path id="jsp.src.compile.classpath">
+          <pathelement location="${tools.dir}\bluestone"/>
+          <path refid="src.compile.classpath"/>
+      </path>
+
+  </target>
+
+
+  <!-- =========================================================================
+
+		TARGET PREPARES
+
+		These targets simply prepare output directories for builds
+
+       ===================================================================== -->
+
+  <!-- ===================================================================
+       Prepares the output build directory
+       =================================================================== -->
+  <target name="-prepare" depends="-init">
+    <mkdir dir="${output.dir}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories for compile targets
+       =================================================================== -->
+  <target name="prepare-compile" depends="-prepare">
+    <mkdir dir="${compile.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories for application files
+       =================================================================== -->
+  <target name="prepare-etc" depends="-prepare">
+    <mkdir dir="${etc.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories bin fules
+       =================================================================== -->
+  <target name="prepare-bin" depends="-prepare">
+    <mkdir dir="${bin.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories for jars
+       =================================================================== -->
+  <target name="prepare-jars" depends="-prepare">
+    <mkdir dir="${jars.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories for pnet patch
+       =================================================================== -->
+  <target name="prepare-pnetpatch" depends="-prepare">
+    <mkdir dir="${pnetpatch.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories for com classes
+       =================================================================== -->
+  <target name="prepare-com" depends="prepare-compile">
+    <mkdir dir="${rmic.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the output directories for javadoc targets
+       =================================================================== -->
+  <target name="prepare-javadoc" depends="-prepare">
+    <mkdir dir="${javadoc.dest}"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares the resource directory
+       =================================================================== -->
+  <target name="prepare-resource" depends="-init">
+    <mkdir dir="${resource.dest}/styles"/>
+    <mkdir dir="${resource.dest}/src"/>
+  </target>
+
+  <!-- ===================================================================
+       Prepares for version stuff.
+       =================================================================== -->
+  <target name="prepare-update-version" depends="prepare-compile">
+	<property name="version.java.pre" value="net/project/util/Version.java.pre" />
+	<property name="version.java" value="net/project/util/Version.java" />
+
+        <!-- Set property if Version.java.pre exists -->
+	<available file="${java.src.dir}/${version.java.pre}" property="version.java.pre.present"/>
+
+	<!-- Determine whether translated java source is up to date: Source needs
+	     regenerated if version.properties of Version.java.pre file changes -->
+	<uptodate targetfile="${java.src.dir}/${version.java}" property="version.java.uptodate" >
+            <srcfiles dir="${config.src.dir}" includes="version.properties"/>
+            <srcfiles dir="${java.src.dir}" includes="${version.java.pre}"/>
+        </uptodate>
+  </target>
+
+
+  <!-- =========================================================================
+
+		TARGET BUILDS
+
+		These targets build, compile or copy files
+
+       ===================================================================== -->
+
+  <!-- ===================================================================
+       Compile any unit test stubs
+       =================================================================== -->
+  <target name="compile-unit-test-stubs" depends="-init">
+      <mkdir dir="${test.dir}/mockobjects/output"/>
+      <javac destdir="${test.dir}/mockobjects/output" debug="true" source="1.4">
+          <classpath refid="src.compile.classpath"/>
+          <src location="${test.dir}/mockobjects/src"/>
+      </javac>
+  </target>
+
+  <!-- ===================================================================
+       Compiles the PRM java source tree
+       =================================================================== -->
+  <target name="compile-java" depends="compile-java-com,compile-java-pnet,compile-java-net" description="Compile all non-JSP Java files."/>
+
+  <!-- ===================================================================
+       Compiles com classes
+	   =================================================================== -->
+  <target name="compile-java-com" depends="prepare-compile,jars">
+
+	<!-- Compile com sources -->
+	<javac srcdir="${java.src.dir}"
+	       destdir="${compile.dest}"
+		   debug="${debug}"
+           deprecation="${deprecation}"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+	  <include name="com/**" />
+	</javac>
+
+	<!-- RMI compile certain files -->
+	<rmic base="${compile.dest}">
+	  <include name="com/**/PublisherImpl.class" />
+	  <include name="com/**/MonitorConnectionImpl.class" />
+	  <include name="com/**/Logger.class" />
+      <classpath refid="src.compile.classpath"/>
+    </rmic>
+
+  </target>
+
+  <!-- ===================================================================
+       Compiles the pnet class
+       =================================================================== -->
+  <target name="compile-java-pnet" depends="prepare-compile,jars">
+    <javac srcdir="${java.src.dir}"
+           destdir="${compile.dest}"
+           debug="${debug}"
+           deprecation="${deprecation}"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+	  <include name="pnet/**" />
+	</javac>
+  </target>
+
+  <!-- ===================================================================
+       Compiles the net.project classes
+       =================================================================== -->
+  <target name="compile-java-net" depends="prepare-compile,jars">
+    <javac srcdir="${java.src.dir}"
+           destdir="${compile.dest}"
+           debug="${debug}"
+           deprecation="${deprecation}"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+	  <include name="net/project/**" />
+
+      <!-- Don't compile unit tests -->
+      <exclude name="**/*Test.java" />
+
+      <!-- Don't compile J2EE 1.3 sources (they are for Weblogic build only) -->
+      <exclude name="net/project/security/SessionAccessFilter.java" />
+      <exclude name="net/project/security/SecurityFilter.java" />
+	</javac>
+  </target>
+
+  <!-- ===================================================================
+       Compiles the jsp source tree
+       Process JSPs to Java level - note runs in separate fork to allow for
+       switching of directory and to avoid dying on System.exit() in processor.
+       Also, inserts tools/bluestone in front of Classpath to pick up
+       tweaked JSP compiler (which actually avoids compiling unchanged files)
+
+       IMPORTANT:
+         1)  The directory that is passed here is very specific.  It MUST be
+             the JSP package directory to make the modification checking work.
+             This is a quirk of the Bentley timestamp-compare hack.
+             If none of your JSPs are compiling, this is why.
+             E.g. c:/pnet/src/pnet-main/prm/jsp/prm  or
+                  c:/pnet/src/pnet-main/prm/jsp/pnet  would work
+       =================================================================== -->
+  <target name="compile-jsp-only" depends="prepare-compile" description="Compiles JSP files with no dependency checks">
+
+    <java classname="SaApi.servlet.jsp.SaJspProcessor"
+          dir="${jsp.src.package.dir}"
+          fork="yes"
+          failonerror="yes">
+      <classpath refid="jsp.src.compile.classpath"/>
+      <arg line="-app ${jsp.packagename}.class -level java -recurse -quiet -packageName ${jsp.packagename} -compilePath ${compile.dest} ${jsp.src.package.dir}" />
+    </java>
+
+    <!-- Now compile java versions of jsps (only those in JSP package directory and below -->
+    <javac srcdir="${compile.dest}"
+           destdir="${compile.dest}"
+           debug="${debug}"
+           deprecation="${deprecation}"
+           includes="${jsp.packagename}/**"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+    </javac>
+
+  </target>
+
+  <target name="compile-jsp" depends="compile-java-net,compile-pnetpatch,compile-jsp-only" description="Compiles JSP files" />
+
+  <target name="-check-jsp-specified" unless="jsp.to.compile">
+      <fail>
+          Please set the jsp.to.compile property before calling this target.
+      </fail>
+  </target>
+
+  <target name="compile-single-jsp" depends="-check-jsp-specified, prepare-compile" description="Compile a single JSP file without compiling everything else">
+      <echo message="Compiling file ${jsp.to.compile}"/>
+
+      <java classname="SaApi.servlet.jsp.SaJspProcessor"
+            dir="${jsp.src.package.dir}"
+            fork="yes"
+            failonerror="yes">
+        <classpath refid="jsp.src.compile.classpath"/>
+        <arg line="-app ${jsp.packagename}.class -level java -recurse -quiet -packageName ${jsp.packagename} -compilePath ${compile.dest} ${jsp.to.compile}" />
+      </java>
+
+      <!-- Now compile java versions of jsps (only those in JSP package directory and below -->
+      <javac srcdir="${compile.dest}"
+             destdir="${compile.dest}"
+             debug="${debug}"
+             deprecation="${deprecation}"
+             includes="${jsp.packagename}/**"
+             nowarn="on"
+             source="1.4>
+        <classpath refid="src.compile.classpath"/>
+      </javac>
+  </target>
+
+  <!-- ===================================================================
+       Unit Test Targets
+       =================================================================== -->
+
+    <target name="-test-format-plain">
+        <property name="test.format" value="plain" />
+    </target>
+
+    <target name="-test-format-xml">
+        <property name="test.format" value="xml" />
+    </target>
+
+    <!-- Compile unit test classes -->
+    <target name="compile-unit-test" depends="compile-unit-test-stubs, compile-java">
+        <javac srcdir="${java.src.dir}"
+               destdir="${compile.dest}"
+               debug="${debug}"
+               deprecation="${deprecation}"
+               nowarn="on"
+               source="1.4">
+          <classpath refid="unittest.compile.classpath"/>
+          <include name="net/project/**/*Test.java" />
+        </javac>
+    </target>
+
+    <!-- Run unit tests only; PLAIN format -->
+    <target name="run-unit-test" depends="-init, -test-format-plain, run-single-unit-test, run-all-unit-tests" description="Run unit tests without compiling first"/>
+
+    <target name="run-single-unit-test" if="unittest.to.run">
+        <junit printsummary="yes">
+            <classpath refid="unittest.compile.classpath"/>
+            <formatter type="${test.format}"/>
+            <sysproperty key="mockobject.properties.location" value="${test.dir}\mockobjects.properties"/>
+            <jvmarg value="-ea"/>
+            <!-- Even though the next line shows up as an error, it isn't.  The
+                 property is intended to be supplied on the command line in the
+                 form "make unit-test -Dunittest.to.run=net.project.schedule.TaskEndpointCalculationTest" -->
+            <test name="${unittest.to.run}" haltonfailure="false"/>
+        </junit>
+    </target>
+
+    <target name="run-all-unit-tests" unless="unittest.to.run">
+        <junit printsummary="yes">
+            <classpath refid="unittest.compile.classpath"/>
+            <formatter type="${test.format}"/>
+            <sysproperty key="mockobject.properties.location" value="${test.dir}\mockobjects.properties"/>
+            <!-- 05/06/2003 - Tim
+                 Enabling assertions when using batchtest appears to cause
+                 all assertions to fail.  Commenting it out for now. -->
+            <!--<jvmarg value="-ea"/>-->
+            <batchtest fork="yes">
+              <fileset dir="${java.src.dir}">
+                <include name="**/*Test.java"/>
+              </fileset>
+            </batchtest>
+        </junit>
+    </target>
+
+    <!-- Run unit test after compile; PLAIN format -->
+    <target name="unit-test" depends="compile-unit-test, -test-format-plain, run-unit-test" description="Run all unit tests" />
+
+    <!-- Run unit test after compile; XML format -->
+    <target name="unit-test-xml" depends="-test-format-xml, unit-test" />
+
+    <!-- Run unit test only; XML format -->
+    <target name="run-unit-test-xml" depends="-test-format-xml, run-unit-test" />
+
+
+  <!-- ===================================================================
+       Copies the xml files to output
+       =================================================================== -->
+  <target name="xsl" depends="prepare-compile">
+    <!-- Copy all XSL files from JSP src to output -->
+    <copy todir="${compile.dest}">
+        <fileset dir="${jsp.src.dir}" >
+			<exclude name="**/.#*" />
+            <include name="**/*.xsl" />
+        </fileset>
+    </copy>
+  </target>
+
+  <!-- ===================================================================
+       Version update
+       =================================================================== -->
+  <!-- Fail unless required files are present -->
+  <target name="-update-version-check" depends="prepare-update-version" unless="version.java.pre.present">
+	<fail message="Version check failed.  File: '${java.src.dir}/${version.java.pre}' not present." />
+  </target>
+
+  <!-- Regenerate Version.java unless up-to-date -->
+  <target name="update-version-regenerate" unless="version.java.uptodate" depends="-update-version-check">
+    <filter filtersfile="${config.src.dir}/version.properties" />
+	<copy file="${java.src.dir}/${version.java.pre}" tofile="${java.src.dir}/${version.java}"
+	      filtering="true" overwrite="true" />
+  </target>
+
+  <!-- Compile Version.java -->
+  <target name="compile-version" depends="-update-version-check, update-version-regenerate">
+    <javac srcdir="${java.src.dir}"
+           destdir="${compile.dest}"
+           debug="${debug}"
+           deprecation="${deprecation}"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+	  <include name="${version.java}" />
+	</javac>
+  </target>
+
+
+  <!-- ===================================================================
+       Makes the pnet patch
+       =================================================================== -->
+  <target name="compile-pnetpatch" depends="prepare-pnetpatch,jars,compile-java-com">
+
+    <!--
+
+		UBS_7 patch
+
+		Aplication server patches
+
+	-->
+
+    <!-- Copy class files which have no source to pnetpatch output dir -->
+	<copy todir="${pnetpatch.dest}">
+		<fileset dir="${config.src.dir}/Bluestone/patches/UBS_7">
+			<exclude name="**/.#*" />
+			<include name="**/*.class" />
+		</fileset>
+	</copy>
+
+	<!-- Compile java sources to pnetpatch output dir -->
+	<javac srcdir="${config.src.dir}/Bluestone/patches/UBS_7"
+	       destdir="${pnetpatch.dest}"
+		   debug="${debug}"
+           deprecation="${deprecation}"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+    </javac>
+
+    <!--
+
+		UBS_72GA patch
+
+		Character encoding patches
+
+	-->
+
+	<!-- Compile java sources to pnetpatch output dir -->
+	<javac srcdir="${config.src.dir}/Bluestone/patches/UBS_72GA"
+	       destdir="${pnetpatch.dest}"
+		   debug="${debug}"
+           deprecation="${deprecation}"
+           nowarn="on"
+           source="1.4">
+      <classpath refid="src.compile.classpath"/>
+    </javac>
+
+	<!-- Jar it up -->
+	<jar jarfile="${jars.dest}/pnetpatch.jar"
+	     basedir="${pnetpatch.dest}" />
+
+  </target>
+
+  <!-- ===================================================================
+       Copies jars to output
+       =================================================================== -->
+  <target name="jars" depends="prepare-jars">
+    <copy todir="${jars.dest}">
+        <fileset dir="${java.src.dir}/javax">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+        <fileset dir="${java.src.dir}/jars">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+        <fileset dir="${java.src.dir}/jars/jdbc">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+
+
+
+
+        <fileset dir="${java.src.dir}/jars/jdbc">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+        <fileset dir="${java.src.dir}/jars/jdbc">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+        <fileset dir="${java.src.dir}/jars/jdbc">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+        <fileset dir="${java.src.dir}/jars/jdbc">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+		</fileset>
+    </copy>
+  </target>
+
+  <!-- ===================================================================
+       Build javadoc
+       =================================================================== -->
+  <target name="javadoc" depends="prepare-javadoc" description="Generates JavaDoc for internal use">
+    <javadoc sourcepath="${java.src.dir}"
+              destdir="${javadoc.dest}"
+              packagenames="net.*"
+              windowtitle="Project.net PRMServer v${product.version} (${product.version.codename})"
+              maxmemory="256M"
+              verbose="false"
+              additionalparam="-source 1.4"
+              private="true">
+        <bottom>&lt;div align=&quot;center&quot;> &lt;a href=&quot;http://www.project.net/&quot; target=&quot;_top&quot;>&#169;2000-2003 Project.net, Inc.&lt;/a> All Rights Reserved.&lt;div></bottom>
+        <link href="http://java.sun.com/j2se/1.4.1/docs/api/"/>
+        <link href="http://java.sun.com/j2ee/sdk_1.2.1/techdocs/api/"/>
+        <link href="http://www.jdom.org/docs/apidocs/"/>
+        <link href="http://itext.sourceforge.net/docs/"/>
+    </javadoc>
+
+  </target>
+
+  <!-- ===================================================================
+       Build the resources
+       =================================================================== -->
+  <target name="resource" depends="prepare-resource">
+
+	<!-- Images -->
+    <copy todir="${resource.dest}/images">
+      <fileset dir="${resource.src.dir}/Images">
+		<exclude name="**/.#*" />
+		<exclude name="tabs/src/*" />
+		<exclude name="toolbar/src/*" />
+	  </fileset>
+    </copy>
+
+	<!-- Javascript Source -->
+    <copy todir="${resource.dest}/src">
+        <javadoc sourcepath="${java.src.dir}"
+                  destdir="${javadoc.dest}"
+                  packagenames="net.*"
+                  windowtitle="Project.net PRMServer v${product.version} (${product.version.codename})"
+                  maxmemory="256M"
+                  verbose="false"
+                  additionalparam="-source 1.4"
+                  private="true">
+            <bottom>&lt;div align=&quot;center&quot;> &lt;a href=&quot;http://www.project.net/&quot; target=&quot;_top&quot;>&#169;2000-2003 Project.net, Inc.&lt;/a> All Rights Reserved.&lt;div></bottom>
+            <link href="http://java.sun.com/j2se/1.4.1/docs/api/"/>
+            <link href="http://java.sun.com/j2ee/sdk_1.2.1/techdocs/api/"/>
+            <link href="http://www.jdom.org/docs/apidocs/"/>
+            <link href="http://itext.sourceforge.net/docs/"/>
+        </javadoc>
+
+      <fileset dir="${resource.src.dir}/src" excludes="**/.#*" />
+    </copy>
+
+	<!-- CSS -->
+    <copy todir="${resource.dest}/styles">
+
+      <fileset dir="${resource.src.dir}/styles" excludes="**/.#*" />
+    </copy>
+
+	<!-- HTML files and other resources -->
+    <copy todir="${resource.dest}">
+      <fileset dir="${resource.src.dir}">
+		<exclude name="**/.#*" />
+		<include name="**/*.html" />
+		<include name="**/*.htm" />
+		<include name="**/*.ico" />
+		<include name="hosted" />
+	  </fileset>
+    </copy>
+
+  </target>
+
+  <!-- ===================================================================
+       Builds etc files
+       =================================================================== -->
+  <target name="etc" depends="prepare-etc">
+
+	<copy todir="${etc.dest}">
+        <fileset dir="${config.src.dir}/crypto" excludes="**/.#*" />
+    </copy>
+
+    <!-- Project.net Scheduler files -->
+	<copy todir="${etc.dest}">
+        <fileset dir="${config.src.dir}/scheduler">
+			<exclude name="**/.#*" />
+			<include name="*.properties" />
+		</fileset>
+    </copy>
+
+	<!-- Bluestone config files -->
+	<copy todir="${etc.dest}/ubs/config">
+		<fileset dir="${config.src.dir}/Bluestone/ubs">
+			<exclude name="**/.#*" />
+		</fileset>
+	</copy>
+
+  	<!-- Bluestone lbb files -->
+	<copy todir="${etc.dest}/ubs/lbb">
+		<fileset dir="${config.src.dir}/Bluestone/lbb">
+			<exclude name="**/.#*" />
+		</fileset>
+	</copy>
+
+    <!-- Log4j configuration files -->
+	<copy todir="${etc.dest}">
+        <fileset dir="${config.src.dir}/log4j">
+			<exclude name="**/.#*" />
+			<include name="*.xml" />
+		</fileset>
+    </copy>
+
+  </target>
+
+  <!-- ===================================================================
+       Copies bin files to output
+       =================================================================== -->
+  <target name="bin" depends="prepare-bin">
+    <!-- Copy and fix Unix scripts -->
+    <fixcrlf srcdir="${bin.src.dir}"
+             destdir="${bin.dest}"
+             eol="lf"
+             eof="remove">
+        <exclude name="**/.#*" />
+    	<include name="*.sh" />
+    	<include name="pnet-init" />
+    </fixcrlf>
+
+    <!-- Copy and fix DOS scripts -->
+    <fixcrlf srcdir="${bin.src.dir}"
+             destdir="${bin.dest}"
+             eol="crlf"
+             eof="add">
+        <exclude name="**/.#*" />
+			<include name="*.bat" />
+    </fixcrlf>
+
+    <!-- Copy remaining bin items -->
+    <copy todir="${bin.dest}">
+        <fileset dir="${bin.src.dir}">
+			<exclude name="**/.#*" />
+			<include name="*.exe" />
+  		</fileset>
+    </copy>
+
+  </target>
+
+  <!-- ===================================================================
+       Compiles the ALL source
+       =================================================================== -->
+  <target name="compile" depends="compile-java,compile-pnetpatch,compile-jsp,xsl,compile-version,compile-unit-test" />
+
+  <!-- ===================================================================
+       Builds output
+       =================================================================== -->
+  <target name="build" depends="jars,compile,etc,bin,resource" description="Builds all of the files in the output directory"/>
+
+  <!-- Builds after updating from cvs -->
+  <target name="cvs-build" depends="cvs-update-source, build" />
+  <target name="cvs-build-clean" depends="cvs-update-source, clean, build" />
+  <target name="cvs-build-test" depends="cvs-build, unit-test-xml" />
+  <target name="cvs-build-clean-test" depends="cvs-build-clean, unit-test-xml" />
+
+
+  <!-- =========================================================================
+
+	   Deploys the application
+
+       ===================================================================== -->
+
+    <target name="prepare-deploy" depends="-prepare">
+	   <echo message="Preparing to deploy product: ${product.version.codename} (${product.version})" />
+       <mkdir dir="${deploy.dir}" />
+    </target>
+
+    <!-- Deletes deployment directory -->
+    <target name="prepare-deploy-clean" depends="-init">
+        <delete dir="${deploy.dir}" />
+    </target>
+
+	<target name="prepare-deploy-src" depends="prepare-deploy">
+        <mkdir dir="${src.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-prm" depends="prepare-deploy">
+        <mkdir dir="${lib.deploy.dest}" />
+        <mkdir dir="${classes.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-xsl" depends="prepare-deploy">
+        <mkdir dir="${xsl.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-etc" depends="prepare-deploy">
+        <mkdir dir="${etc.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-bin" depends="prepare-deploy">
+        <mkdir dir="${bin.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-resource" depends="prepare-deploy">
+        <mkdir dir="${resource.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-database" depends="prepare-deploy">
+        <mkdir dir="${database.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-docs" depends="prepare-deploy">
+        <mkdir dir="${docs.deploy.dest}" />
+    </target>
+
+	<target name="prepare-deploy-src-javadoc" depends="prepare-deploy-src">
+        <mkdir dir="${javadoc.deploy.dest}" />
+    </target>
+
+    <target name="prepare-deploy-api-diff" depends="prepare-deploy">
+        <mkdir dir="${jdiff.deploy.dest}"/>
+    </target>
+
+	<!--
+		Deploy targets
+	-->
+
+    <target name="deploy-prm" depends="build, prepare-deploy-prm">
+
+            <jar jarfile="${lib.deploy.dest}/prm.jar"
+                basedir="${compile.dest}">
+
+				<exclude name="**/.#*" />
+				<exclude name="**/*.java" />
+				<exclude name="**/*.xsl" />
+				<exclude name="**/xsl/**" />
+				<exclude name="**/*.jsp" />
+            </jar>
+    </target>
+
+	<!-- Deploy XSL files -->
+    <target name="deploy-xsl" depends="xsl, prepare-deploy-xsl">
+        <copy todir="${xsl.deploy.dest}">
+            <fileset dir="${compile.dest}" >
+			    <exclude name="**/.#*" />
+                <include name="**/*.xsl" />
+				<!-- Must specify possible empty directories here -->
+                <include name="**/include" />
+            </fileset>
+        </copy>
+    </target>
+
+
+  <!-- Deploy JAR files -->
+  <target name="deploy-jars" depends="jars, prepare-deploy-prm">
+    <copy todir="asdgjagsd" asdh="${lib.deploy.dest}" asgd="">
+        <fileset>
+            <and>
+                ajshdkjhaskjdh
+    <type description="sdad"/>
+            </and>
+        </fileset>
+        <fileset dir="${jars.dest}">
+			<exclude name="**/.#*" />
+			<include name="*.jar" />
+			<include name="*.zip" />
+   	</fileset>
+    </copy>
+  </target>
+
+    <!-- Deploy license.txt file -->
+    <target name="deploy-jars-license" depends="prepare-deploy-prm,prepare-deploy-docs,-init">
+        <copy todir="${lib.deploy.dest}">
+            <fileset dir="${java.src.dir}/jars">
+                <include name="License.txt"/>
+            </fileset>
+        </copy>
+
+        <copy todir="${docs.deploy.dest}">
+            <fileset dir="${java.src.dir}/jars">
+                <include name="License.txt"/>
+            </fileset>
+        </copy>
+    </target>
+
+
+    <!-- Updates source from cvs -->
+	<target name="cvs-update-source" depends="-init">
+        <exec dir="${devroot.dir}" executable="cvs">
+			<arg line="-q update -dP prm tools" />
+		</exec>
+	</target>
+
+	<!-- Deploy etc files
+         Note - These are deployed form the source directory, as the files
+         in the output directory have already had tokens replaced, etc.
+      -->
+    <target name="deploy-etc" depends="prepare-deploy-etc">
+
+		<copy todir="${etc.deploy.dest}">
+			<fileset dir="${config.src.dir}/crypto" excludes="**/.#*" />
+        </copy>
+
+        <!-- Project.net Scheduler files -->
+        <copy todir="${etc.deploy.dest}">
+            <fileset dir="${config.src.dir}/scheduler">
+			    <exclude name="**/.#*" />
+			    <include name="*.properties" />
+		    </fileset>
+        </copy>
+
+        <!-- UBS config files -->
+		<copy todir="${etc.deploy.dest}/ubs/config">
+			<fileset dir="${etc.dest}/ubs/config">
+			    <exclude name="**/.#*" />
+			</fileset>
+        </copy>
+
+        <!-- LBB Plugins -->
+		<copy todir="${etc.deploy.dest}/ubs/lbb">
+			<fileset dir="${etc.dest}/ubs/lbb">
+			    <exclude name="**/.#*" />
+			</fileset>
+        </copy>
+
+		<copy todir="${etc.deploy.dest}">
+			<fileset dir="${config.src.dir}/log4j" excludes="**/.#*" />
+        </copy>
+
+    </target>
+
+	<!-- Deploy bin files -->
+    <target name="deploy-bin" depends="prepare-deploy-bin, bin">
+        <copy todir="${bin.deploy.dest}">
+			<fileset dir="${bin.dest}" excludes="**/.#*" />
+        </copy>
+    </target>
+
+  <!-- Deploy web server resources -->
+  <target name="deploy-resource" depends="resource, prepare-deploy-resource">
+
+	<!-- Images -->
+    <copy todir="${resource.deploy.dest}/images">
+      <fileset dir="${resource.src.dir}/images">
+		<exclude name="**/.#*" />
+		<exclude name="tabs/src/*" />
+		<exclude name="toolbar/src/*" />
+	  </fileset>
+    </copy>
+
+	<!-- Javascript Source -->
+    <copy todir="${resource.deploy.dest}/src">
+      <fileset dir="${resource.src.dir}/src" excludes="**/.#*" />
+    </copy>
+
+	<!-- CSS -->
+    <copy todir="${resource.deploy.dest}/styles">
+      <fileset dir="${resource.src.dir}/styles" excludes="**/.#*" />
+    </copy>
+
+	<!-- HTML files and other resources -->
+    <copy todir="${resource.deploy.dest}">
+      <fileset dir="${resource.src.dir}">
+		<exclude name="**/.#*" />
+		<include name="**/*.html" />
+		<include name="**/*.htm" />
+		<include name="**/*.ico" />
+		<include name="hosted" />
+	  </fileset>
+        <fileset></fileset>
+    </copy>
+
+  </target>
+
+	<!-- Deploy database files -->
+    <target name="deploy-database" depends="prepare-deploy-database">
+        <copy todir="${database.deploy.dest}">
+			<fileset dir="${database.src.dir}">
+			  <exclude name="**/.#*" />
+			  <include name="CreateScripts/**" />
+			</fileset>
+        </copy>
+
+
+      <!-- Images -->
+      <copy todir="${resource.deploy.dest}/images">
+        <fileset dir="${resource.src.dir}/images">
+          <exclude name="**/.#*" />
+          <exclude name="tabs/src/*" />
+          <exclude name="toolbar/src/*" />
+        </fileset>
+      </copy>
+
+      <!-- Javascript Source -->
+      <copy todir="${resource.deploy.dest}/src">
+        <fileset dir="${resource.src.dir}/src" excludes="**/.#*" />
+      </copy>
+
+      <!-- CSS -->
+      <copy todir="${resource.deploy.dest}/styles">
+        <fileset dir="${resource.src.dir}/styles" excludes="**/.#*" />
+      </copy>
+
+      <!-- HTML files and other resources -->
+      <copy todir="${resource.deploy.dest}">
+        <fileset dir="${resource.src.dir}">
+          <exclude name="**/.#*" />
+          <include name="**/*.html" />
+          <include name="**/*.htm" />
+          <include name="**/*.ico" />
+          <include name="hosted" />
+        </fileset>
+          <fileset></fileset>
+      </copy>
+
+
+
+      <!-- Images -->
+      <copy todir="${resource.deploy.dest}/images">
+        <fileset dir="${resource.src.dir}/images">
+          <exclude name="**/.#*" />
+          <exclude name="tabs/src/*" />
+          <exclude name="toolbar/src/*" />
+        </fileset>
+      </copy>
+
+      <!-- Javascript Source -->
+      <copy todir="${resource.deploy.dest}/src">
+        <fileset dir="${resource.src.dir}/src" excludes="**/.#*" />
+      </copy>
+
+      <!-- CSS -->
+      <copy todir="${resource.deploy.dest}/styles">
+        <fileset dir="${resource.src.dir}/styles" excludes="**/.#*" />
+      </copy>
+
+      <!-- HTML files and other resources -->
+      <copy todir="${resource.deploy.dest}">
+        <fileset dir="${resource.src.dir}">
+          <exclude name="**/.#*" />
+          <include name="**/*.html" />
+          <include name="**/*.htm" />
+          <include name="**/*.ico" />
+          <include name="hosted" />
+        </fileset>
+          <fileset></fileset>
+      </copy>
+
+
+    </target>
+
+	<!-- Deploy docs -->
+    <target name="deploy-docs" depends="prepare-deploy-docs">
+
+		<!-- Copy all docs except for Word Documents to deployment area
+		     Assumes Word documents are created as PDF files -->
+		<copy todir="${docs.deploy.dest}">
+			<fileset dir="${docs.src.dir}">
+			    <exclude name="**/.#*" />
+				<exclude name="**/*.doc" />
+			</fileset>
+        </copy>
+
+    </target>
+
+  <!-- ===================================================================
+       Deployments for Source releases
+       =================================================================== -->
+
+	<!-- Deploy JSP files -->
+    <target name="deploy-src-jsp" depends="compile-jsp, prepare-deploy-src">
+        <copy todir="${src.deploy.dest}/jsp">
+            <fileset dir="${jsp.src.dir}" >
+			    <exclude name="**/.#*" />
+            </fileset>
+        </copy>
+    </target>
+
+	<!-- Deploy api docs -->
+	<!--packagenames="net.project.*"-->
+	<target name="deploy-src-javadoc" depends="prepare-deploy-src-javadoc">
+		<javadoc packagenames="net.*"
+                 sourcepath="${java.src.dir}"
+			     destdir="${src.deploy.dest}/apiDocs"
+			     author="false"
+			     public="true"
+                 maxmemory="256M"
+                 additionalparam="-source 1.4"
+                 defaultexcludes="yes"
+			     windowtitle="Project.net PRMServer v${product.version} (${product.version.codename})">
+            <bottom>&lt;div align=&quot;center&quot;> &lt;a href=&quot;http://www.project.net/&quot; target=&quot;_top&quot;>&#169;2000-2003 Project.net, Inc.&lt;/a> All Rights Reserved.&lt;div></bottom>
+            <link href="http://java.sun.com/j2se/1.4.1/docs/api/"/>
+            <link href="http://java.sun.com/j2ee/sdk_1.2.1/techdocs/api/"/>
+            <link href="http://www.jdom.org/docs/apidocs/"/>
+            <link href="http://itext.sourceforge.net/docs/"/>
+        </javadoc>
+	</target>
+
+    <target name="generate-new-api-diff" depends="-init">
+
+        <!-- The name of apis, used for naming files -->
+        <property name="newapiname" value="${product.version.codename}" />
+
+        <!-- Produce XML for this version's Javadoc -->
+		<javadoc packagenames="net.project.*"
+                 sourcepath="${java.src.dir}"
+			     destdir=""
+			     author="false"
+			     public="true"
+                 maxmemory="256M"
+                 defaultexcludes="yes"
+			     windowtitle="Project.net PRMServer v${product.version} (${product.version.codename})"
+                 additionalparam="-source 1.4">
+            <classpath refid="jdiff.classpath"/>
+            <doclet name="jdiff.JDiff" path="${java.src.dir}/jdiff/jdiff.jar:${java.src.dir}/diff/xerces.jar">
+                <param name="-apidir" value="${jdiff.src.dir}"/>
+                <param name="-apiname" value="${newapiname}"/>
+            </doclet>
+        </javadoc>
+    </target>
+
+    <!-- Produce a report which will outline the API differences between this
+         version and the previous one. -->
+	<target name="deploy-api-diff" depends="prepare-deploy-api-diff,generate-new-api-diff" description="Produce an API difference report between this version and the previous one." >
+
+        <!-- The name of apis, used for naming files -->
+        <property name="oldapiname" value="7_5_1_release" />
+        <property name="newapiname" value="${product.version.codename}" />
+
+        <!-- Produce the diff between this and last version's Javadoc -->
+		<javadoc packagenames="net.project.*"
+                 sourcepath="${java.src.dir}"
+			     destdir=""
+			     author="false"
+			     public="true"
+                 maxmemory="256m"
+                 additionalparam="-source 1.4"
+                 defaultexcludes="yes"
+			     windowtitle="Project.net PRMServer v${product.version} (${product.version.codename})">
+            <doclet name="jdiff.JDiff" path="${java.src.dir}/jdiff/jdiff.jar:${java.src.dir}/jdiff/xerces.jar">
+                <param name="-d" value="${jdiff.deploy.dest}"/>
+                <param name="-oldapi" value="${oldapiname}"/>
+                <param name="-oldapidir" value="${jdiff.src.dir}"/>
+                <param name="-newapi" value="${newapiname}"/>
+                <param name="-newapidir" value="${jdiff.src.dir}"/>
+                <param name="-javadocold" value="../../oldapiDocs/"/>
+                <param name="-javadocnew" value="../../apiDocs/"/>
+            </doclet>
+        </javadoc>
+
+        <!-- Delete some files that shouldn't be shipped to the user. -->
+        <delete file="${jdiff.deploy.dest}/missingSinces.txt"/>
+        <delete file="${jdiff.deploy.dest}/user_comments_for_${oldapiname}_to_${newapiname}.xml"/>
+    </target>
+
+    <!-- Makes a deployment; incrementally (does not clean first) -->
+    <target name="deploy" depends="-debug-off, prepare-deploy, deploy-prm, deploy-jars, deploy-jars-license, deploy-xsl, deploy-resource, deploy-etc, deploy-bin, deploy-docs, deploy-database" />
+
+    <!-- Makes a source deployment; incrementally (does not clean first) -->
+    <target name="deploy-src" depends="-debug-off, deploy, deploy-src-jsp, deploy-src-javadoc, deploy-api-diff" />
+
+    <!-- Makes a source deployment; incrementally (does not clean first) -->
+    <target name="deploy-src-no-javadoc" depends="-debug-off, deploy, deploy-src-jsp" />
+
+    <!-- Cleans pending a deployment -->
+    <target name="deploy-clean" depends="-debug-off, prepare-deploy-clean, clean" description="Deletes all of the files from the deploy directory" />
+
+  <!-- ===================================================================
+       Run the application
+       =================================================================== -->
+    <target name="copy-runtime-config-file" depends="-init" description="Customizes the sajava.ini file in the bluestone configuration directory based on your local runtime configuration.">
+        <filter filtersfile="./runtime.properties"/>
+        <copy todir="${bluestone.dir}/config" filtering="true" overwrite="true" >
+            <fileset dir="${config.src.dir}/Bluestone/ubs" includes="sajava.ini SaLBB.ini"/>
+        </copy>
+        <copy file="${config.src.dir}/Bluestone/ubs/apserver.txt.noproxy.example" tofile="${bluestone.dir}/config/apserver.txt" filtering="true" overwrite="true" />
+    </target>
+
+    <target name="run" depends="-init">
+        <java classname="SaApi.SaAppServController" fork="yes" classpathref="run.classpath">
+            <arg value="-port"/>
+            <arg value="20000"/>
+            <arg value="-debug"/>
+            <arg value="true"/>
+        </java>
+
+    </target>
+
+  <!-- ===================================================================
+       Escrow creation target
+       =================================================================== -->
+  <target name="create-escrow-source" depends="-init" description="Create full source zip for escrow account">
+      <zip zipfile="../prm_${product.version.codename}_full_src.zip">
+          <zipfileset dir="../prm" prefix="prm">
+              <exclude name="**/CVS"/>
+              <exclude name="**/CVS/*"/>
+          </zipfileset>
+          <zipfileset dir="../optional" prefix="optional">
+              <exclude name="**/CVS"/>
+              <exclude name="**/CVS/*"/>
+          </zipfileset>
+          <zipfileset dir="../tools" prefix="tools">
+              <exclude name="**/CVS"/>
+              <exclude name="**/CVS/*"/>
+          </zipfileset>
+      </zip>
+      <echo>
+          Now, manually add the contents of the \\lion\\Development\Development Documentation\
+          directory to the zip file.  The zip file creation will be complete then.
+      </echo>
+  </target>
+
+  <!-- ===================================================================
+       Installer
+       =================================================================== -->
+
+  <!-- Build Zip file -->
+  <target name="zip" depends="prepare-deploy">
+	<!-- Zip file placed in root of deployment directory -->
+	<zip zipfile="${deploy.dir}/../prm_${product.version.codename}.zip">
+      <zipfileset dir="${deploy.dir}" prefix="prm"
+	      excludes="src/**" />
+	</zip>
+  </target>
+
+  <!-- Build Zip file including source -->
+  <target name="zip-src" depends="prepare-deploy-src">
+	<!-- Zip file placed in deploy directory with product version -->
+	<zip zipfile="${deploy.dir}/../prm_${product.version.codename}-src.zip">
+      <zipfileset dir="${deploy.dir}" prefix="prm" />
+	</zip>
+  </target>
+
+  <!-- Builds the Installer (which is currently a Zip) -->
+  <target name="installer" depends="deploy, zip" />
+
+  <!-- Builds the Installer from clean (which is currently a Zip) -->
+  <target name="installer-clean" depends="deploy-clean, installer" description="Builds the entire product from scratch into an installer"/>
+
+  <!-- Builds the Installer from source (which is currently a Zip) -->
+  <target name="installer-src" depends="deploy-src, zip-src" />
+
+  <!-- Builds the Installer from clean (which is currently a Zip) -->
+  <target name="installer-src-clean" depends="deploy-clean, installer-src" description="Builds the entire product with sources from scratch into an installer"/>
+
+    <target name="-prepare-patch" depends="-init">
+        <property name="patch.output.dir" value="${output.dir}/../patch" />
+        <mkdir dir="${patch.output.dir}"/>
+    </target>
+
+    <!-- This patch has been delivered to: ST -->
+    <target name="create-7.6.3-patch-1" depends="-prepare-patch" description="Create Patch 1 for 7.6.3">
+        <property name="currentpatch.output.dir" value="${patch.output.dir}/patch1" />
+        <mkdir dir="${currentpatch.output.dir}"/>
+
+        <delete file="${currentpatch.output.dir}/763Patch1-classes.zip"/>
+        <zip zipfile="${currentpatch.output.dir}/763Patch1-classes.zip">
+            <zipfileset dir="${output.dir}/java/" prefix="classes">
+                <include name="pnet/schedule/fixoverallocations_sjsp.class"/>
+                <include name="net/project/schedule/ScheduleEntry.class"/>
+                <include name="net/project/schedule/ScheduleEntry$*.class"/>
+                <include name="net/project/schedule/TaskEndpointCalculation.class"/>
+                <include name="net/project/schedule/TaskEndpointCalculation$*.class"/>
+                <include name="net/project/schedule/Schedule.class"/>
+                <include name="net/project/schedule/Schedule$*.class"/>
+                <include name="net/project/space/SpaceFactory.class"/>
+                <include name="net/project/space/SpaceFactory$*.class"/>
+                <include name="net/project/base/finder/Finder.class"/>
+                <include name="net/project/base/finder/Finder$*.class"/>
+                <include name="net/project/schedule/TaskFinder.class"/>
+                <include name="net/project/schedule/TaskFinder$*.class"/>
+                <include name="net/project/persistence/PersistenceException.class"/>
+                <include name="net/project/persistence/PersistenceException$*.class"/>
+                <!--<include name=""/>-->
+            </zipfileset>
+        </zip>
+
+        <delete file="${currentpatch.output.dir}/763Patch1-database.zip"/>
+        <zip zipfile="${currentpatch.output.dir}/763Patch1-database.zip">
+            <zipfileset dir="${source.dir}/patch/">
+                <include name="patch1.sql"/>
+            </zipfileset>
+        </zip>
+
+        <copy file="${source.dir}/patch/7.6.3-Patch1-ReleaseNotes.txt"
+              todir="${currentpatch.output.dir}"/>
+    </target>
+
+    <!-- ENW Bugs -->
+    <target name="create-7.6.3-patch-2" depends="-prepare-patch" description="Create Patch 2 for 7.6.3">
+        <property name="currentpatch.output.dir" value="${patch.output.dir}/patch2" />
+        <mkdir dir="${currentpatch.output.dir}"/>
+
+        <delete file="${currentpatch.output.dir}/763Patch2-classes.zip"/>
+        <zip zipfile="${currentpatch.output.dir}/763Patch2-classes.zip">
+            <zipfileset dir="${output.dir}/java/" prefix="classes">
+                <include name="pnet/channel/customizechannels_sjsp.class"/>
+                <include name="pnet/document/documentaddlink_sjsp.class"/>
+                <include name="pnet/discussion/postnewprocessing_sjsp.class"/>
+                <include name="pnet/schedule/main_sjsp.class"/>
+                <include name="pnet/schedule/workingtime/edit_sjsp.class"/>
+                <include name="pnet/schedule/workingtime/list_sjsp.class"/>
+                <include name="net/project/discussion/DiscussionGroup.class"/>
+                <include name="net/project/discussion/DiscussionGroup$*.class"/>
+                <include name="net/project/discussion/Post.class"/>
+                <include name="net/project/discussion/Post$*.class"/>
+                <include name="net/project/notification/EventCodes.class"/>
+                <include name="net/project/notification/EventCodes$*.class"/>
+                <include name="net/project/resource/ResourceAllocationCalendar.class"/>
+                <include name="net/project/resource/ResourceAllocationCalendar$*.class"/>
+                <include name="net/project/schedule/mvc/ScheduleHandlerMapping.class"/>
+                <include name="net/project/schedule/mvc/ScheduleHandlerMapping$*.class"/>
+            </zipfileset>
+
+            <!-- BFD-1900
+                Java/net/project/news/News.java
+                Java/net/project/news/NewsManager.java
+                Java/net/project/util/XSLFormat.java
+                Java/net/project/util/XSLFormatTest.java
+                Jsp/pnet/news/include/NewsChannel.jsp
+                Jsp/pnet/news/xsl/news-channel.xsl
+            -->
+            <zipfileset dir="${output.dir}/java/" prefix="classes">
+                <include name="net/project/news/News.class"/>
+                <include name="net/project/news/News$*.class"/>
+                <include name="net/project/news/NewsManager.class"/>
+                <include name="net/project/news/NewsManager$*.class"/>
+                <include name="net/project/util/XSLFormat.class"/>
+                <include name="net/project/util/XSLFormat$*.class"/>
+                <include name="pnet/news/include/newschannel_sjsp.class"/>
+
+            </zipfileset>
+            <zipfileset dir="${output.dir}/java/" prefix="app">
+                <include name="pnet/news/xsl/news-channel.xsl"/>
+
+            </zipfileset>
+
+            <!-- BFD-1906
+                Jsp/pnet/schedule/MPXImportResult.jsp
+                Jsp/pnet/workflow/envelope/EnvelopeWizardPage2.jsp
+            -->
+            <zipfileset dir="${output.dir}/java/" prefix="classes">
+                <include name="pnet/schedule/mpximportresult_sjsp.class"/>
+                <include name="pnet/workflow/envelope/envelopewizardpage2_sjsp.class"/>
+            </zipfileset>
+            <!-- BFD-1907
+                Jsp/pnet/business/Setup.jsp
+                Jsp/pnet/methodology/Actions.jsp
+                Jsp/pnet/methodology/TemplifySpace.jsp
+            -->
+            <zipfileset dir="${output.dir}/java/" prefix="classes">
+                <include name="pnet/business/setup_sjsp.class"/>
+                <include name="pnet/methodology/actions_sjsp.class"/>
+                <include name="pnet/methodology/templifyspace_sjsp.class"/>
+            </zipfileset>
+        </zip>
+
+        <delete file="${currentpatch.output.dir}/763Patch2-database.zip"/>
+        <zip zipfile="${currentpatch.output.dir}/763Patch2-database.zip">
+            <zipfileset dir="${source.dir}/patch/">
+                <include name="Patch2.sql"/>
+            </zipfileset>
+        </zip>
+
+        <copy file="${source.dir}/patch/7.6.3-Patch2-ReleaseNotes.txt"
+              todir="${currentpatch.output.dir}"/>
+    </target>
+
+    <target name="create-7.6.3-patch-3" depends="-prepare-patch" description="Create Patch 3 for 7.6.3">
+        <property name="currentpatch.output.dir" value="${patch.output.dir}/patch3" />
+        <mkdir dir="${currentpatch.output.dir}"/>
+
+        <delete file="${currentpatch.output.dir}/763Patch3-classes.zip"/>
+        <zip zipfile="${currentpatch.output.dir}/763Patch3-classes.zip">
+            <zipfileset dir="${output.dir}/java/" prefix="classes">
+                <include name="pnet/document/documentaddlink_sjsp.class"/>
+                <include name="net/project/schedule/ScheduleEntry.class"/>
+                <include name="net/project/schedule/ScheduleEntry$*.class"/>
+                <!--<include name=""/>-->
+            </zipfileset>
+        </zip>
+
+        <delete file="${currentpatch.output.dir}/763Patch1-database.zip"/>
+        <zip zipfile="${currentpatch.output.dir}/763Patch1-database.zip">
+            <zipfileset dir="${source.dir}/patch/">
+                <include name="patch1.sql"/>
+            </zipfileset>
+        </zip>
+
+        <copy file="${source.dir}/patch/7.6.3-Patch3-ReleaseNotes.txt"
+              todir="${currentpatch.output.dir}"/>
+    </target>
+
+  <!-- ===================================================================
+       Cleans everything: build tree
+               - build tree
+       =================================================================== -->
+  <target name="clean" depends="-init" description="Delete all of the files from the resource and output directories">
+    <delete dir="${output.dir}" />
+	<delete dir="${resource.dest}" />
+  </target>
+
+
+</project>
diff --git a/xml/tests/testData/psi/incrementalReparse42_after.xml b/xml/tests/testData/psi/incrementalReparse42_after.xml
new file mode 100644
index 0000000..c40c0e2
--- /dev/null
+++ b/xml/tests/testData/psi/incrementalReparse42_after.xml
@@ -0,0 +1,10 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="namespace" >
+    <xsd:element name="tag" type="type"/>
+    <xsd:complexType name="type"/>
+    <xsd:simpleType name="type1">
+    </xsd:simpleType>
+</xsd:schema>
+
+
+<xsd:element name="IntellijIdeaRulezzz " type=""
\ No newline at end of file
diff --git a/xml/tests/testData/psi/incrementalReparse42_before.xml b/xml/tests/testData/psi/incrementalReparse42_before.xml
new file mode 100644
index 0000000..1cd3171
--- /dev/null
+++ b/xml/tests/testData/psi/incrementalReparse42_before.xml
@@ -0,0 +1,10 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="namespace" >
+    <xsd:element name="tag" type="type"/>
+    <xsd:complexType name="type"/>
+    <xsd:simpleType name="type1">
+    </xsd:simpleType>
+</xsd:schema>
+
+
+<xsd:element name="" type=""
\ No newline at end of file
diff --git a/xml/tests/testData/psi/incrementalReparse43_after.xml b/xml/tests/testData/psi/incrementalReparse43_after.xml
new file mode 100644
index 0000000..340bb72
--- /dev/null
+++ b/xml/tests/testData/psi/incrementalReparse43_after.xml
@@ -0,0 +1,100 @@
+
+<fb:context
+            xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
+            xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
+            path="/data/wrapper/context" >
+
+  <fb:context path="info">
+    <!-- the email value will not be saved because of the @direction="load" -->
+    <fb:value id="email" path="email" direction="load"/>
+
+    <!-- jxpath binds to nodes as well as to attributes -->
+    <fb:value id="number" path="number/@value">
+      <!-- for non-string datatypes, a convertor must be specified. These are
+      the same convertors as can be used in form definitions, but require an
+      extra datatype attribute. Here we use the default convertor for longs. -->
+      <fd:convertor datatype="integer"/>
+    </fb:value>
+
+    <fb:value id="choose" path="choose/@value">
+      <fd:convertor datatype="boolean"/>
+    </fb:value>
+
+    <!-- one entry field in the client maps through aggregate fields -->
+    <fb:aggregate id="phone" path="phone" >
+      <!-- to multiple fields in the XML file -->
+      <fb:value id="number" path="number" />
+      <fb:value id="zone" path="zone" />
+      <fb:value id="cntr" path="@cntr" />
+    </fb:aggregate>
+
+  </fb:context>
+
+
+  <fb:value id="ipaddress" path="ipaddress">
+    <fb:on-update>
+      <!-- if the value has changed, the attribute will be set -->
+      <fb:set-attribute name="changed" value="true"/>
+    </fb:on-update>
+  </fb:value>
+
+  <fb:value id="birthday" path="birthday">
+    <fd:convertor datatype="date" type="formatting">
+      <fd:patterns>
+        <fd:pattern>yyyy-MM-dd</fd:pattern>
+      </fd:patterns>
+    </fd:convertor>
+  </fb:value>
+
+  <fb:multi-value id="drinks" parent-path="drinks" row-path="drink"/>
+
+  <!--
+    - Repeater requires unique identification mechanism of the row-nodes.
+    - (it is of course possible to implement other binding strategies)
+    -
+    - Important NOTE: When adding rows, the row-path is used inside
+    - jxpath-createPath context, as a consequence it cannot have dependent
+    - children or predicates.
+    -->
+  <fb:repeater id="contacts"
+               parent-path="contacts"
+               row-path="contact">
+
+    <fb:identity>
+      <fb:value id="id" path="@id">
+        <!-- optional convertor to use for mapping the unique id -->
+        <fd:convertor datatype="long" />
+      </fb:value>
+    </fb:identity>
+
+    <fb:on-bind>
+        <!-- executed on updates AND right after the insert -->
+      <fb:value id="firstname" path="firstname" />
+      <fb:value id="lastname" path="lastname" />
+      <fb:value id="phone" path="phone/@nr" />
+      <fb:value id="email" path="email" />
+    </fb:on-bind>
+
+    <fb:on-delete-row>
+        <!-- chose on of these to test -->
+        <!--
+      <fb:set-attribute name="row-state" value="deleted" />
+      -->
+      <fb:delete-node />
+    </fb:on-delete-row>
+
+    <fb:on-insert-row>
+      <!-- The insert-node element contains a piece of template XML to be
+      inserted for new rows. Alternatively, you could also add a "src"
+      attribute on the insert-node element pointing to an external source
+      to retrieve the template from. -->
+      <fb:insert-node>
+        <!-- template inserted by the binding for new rows (mapping new nodes) -->
+        <contact id="" row-state="new">
+          <firstname/><lastname/><phone nr=""/><email/>
+        </contact>
+      </fb:insert-node>
+    </fb:on-insert-row>
+  </fb:repeater>
+
+</fb:context>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/incrementalReparse43_before.xml b/xml/tests/testData/psi/incrementalReparse43_before.xml
new file mode 100644
index 0000000..345dc04
--- /dev/null
+++ b/xml/tests/testData/psi/incrementalReparse43_before.xml
@@ -0,0 +1,99 @@
+<fb:context
+            xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
+            xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
+            path="/data/wrapper/context" >
+
+  <fb:context path="info">
+    <!-- the email value will not be saved because of the @direction="load" -->
+    <fb:value id="email" path="email" direction="load"/>
+
+    <!-- jxpath binds to nodes as well as to attributes -->
+    <fb:value id="number" path="number/@value">
+      <!-- for non-string datatypes, a convertor must be specified. These are
+      the same convertors as can be used in form definitions, but require an
+      extra datatype attribute. Here we use the default convertor for longs. -->
+      <fd:convertor datatype="integer"/>
+    </fb:value>
+
+    <fb:value id="choose" path="choose/@value">
+      <fd:convertor datatype="boolean"/>
+    </fb:value>
+
+    <!-- one entry field in the client maps through aggregate fields -->
+    <fb:aggregate id="phone" path="phone" >
+      <!-- to multiple fields in the XML file -->
+      <fb:value id="number" path="number" />
+      <fb:value id="zone" path="zone" />
+      <fb:value id="cntr" path="@cntr" />
+    </fb:aggregate>
+
+  </fb:context>
+
+
+  <fb:value id="ipaddress" path="ipaddress">
+    <fb:on-update>
+      <!-- if the value has changed, the attribute will be set -->
+      <fb:set-attribute name="changed" value="true"/>
+    </fb:on-update>
+  </fb:value>
+
+  <fb:value id="birthday" path="birthday">
+    <fd:convertor datatype="date" type="formatting">
+      <fd:patterns>
+        <fd:pattern>yyyy-MM-dd</fd:pattern>
+      </fd:patterns>
+    </fd:convertor>
+  </fb:value>
+
+  <fb:multi-value id="drinks" parent-path="drinks" row-path="drink"/>
+
+  <!--
+    - Repeater requires unique identification mechanism of the row-nodes.
+    - (it is of course possible to implement other binding strategies)
+    -
+    - Important NOTE: When adding rows, the row-path is used inside
+    - jxpath-createPath context, as a consequence it cannot have dependent
+    - children or predicates.
+    -->
+  <fb:repeater id="contacts"
+               parent-path="contacts"
+               row-path="contact">
+
+    <fb:identity>
+      <fb:value id="id" path="@id">
+        <!-- optional convertor to use for mapping the unique id -->
+        <fd:convertor datatype="long" />
+      </fb:value>
+    </fb:identity>
+
+    <fb:on-bind>
+        <!-- executed on updates AND right after the insert -->
+      <fb:value id="firstname" path="firstname" />
+      <fb:value id="lastname" path="lastname" />
+      <fb:value id="phone" path="phone/@nr" />
+      <fb:value id="email" path="email" />
+    </fb:on-bind>
+
+    <fb:on-delete-row>
+        <!-- chose on of these to test -->
+        <!--
+      <fb:set-attribute name="row-state" value="deleted" />
+      -->
+      <fb:delete-node />
+    </fb:on-delete-row>
+
+    <fb:on-insert-row>
+      <!-- The insert-node element contains a piece of template XML to be
+      inserted for new rows. Alternatively, you could also add a "src"
+      attribute on the insert-node element pointing to an external source
+      to retrieve the template from. -->
+      <fb:insert-node>
+        <!-- template inserted by the binding for new rows (mapping new nodes) -->
+        <contact id="" row-state="new">
+          <firstname/><lastname/><phone nr=""/><email/>
+        </contact>
+      </fb:insert-node>
+    </fb:on-insert-row>
+  </fb:repeater>
+
+</fb:context>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/incrementalReparse46_after.xml b/xml/tests/testData/psi/incrementalReparse46_after.xml
new file mode 100644
index 0000000..dfe39d1
--- /dev/null
+++ b/xml/tests/testData/psi/incrementalReparse46_after.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:view="http://schemas.niku.com/2002/view" exclude-result-prefixes="view">
+
+  <xsl:template match="view:view/view:group">
+    ${aaa aaa aaa
+    <table border="0" cellspacing="0" cellpadding="0" width="100%" width="100%">
+      <tr>
+        <xsl:for-each select="view:section">
+          <td valign="top">&space;</td>
+        </xsl:for-each>
+      </tr>
+    </table>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/incrementalReparse46_before.xml b/xml/tests/testData/psi/incrementalReparse46_before.xml
new file mode 100644
index 0000000..5d8f26d
--- /dev/null
+++ b/xml/tests/testData/psi/incrementalReparse46_before.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:view="http://schemas.niku.com/2002/view" exclude-result-prefixes="view">
+
+  <xsl:template match="view:view/view:group">
+    ${aaa aaa aaa}
+    <table border="0" cellspacing="0" cellpadding="0" width="100%" width="100%">
+      <tr>
+        <xsl:for-each select="view:section">
+          <td valign="top">&space;</td>
+        </xsl:for-each>
+      </tr>
+    </table>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/incrementalReparse47_after.xml b/xml/tests/testData/psi/incrementalReparse47_after.xml
new file mode 100644
index 0000000..c2696d8
--- /dev/null
+++ b/xml/tests/testData/psi/incrementalReparse47_after.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:view="http://schemas.niku.com/2002/view" exclude-result-prefixes="view">
+
+  <xsl:template match="view:view/view:group">
+    ${aaa aaa aaa}
+    <table border="0" cellspacing="0" cellpadding="0" width="100%" width="100%" width="100%">
+      <tr>
+        <xsl:for-each select="view:section">
+          <td valign="top">&space;</td>
+        </xsl:for-each>
+      </tr>
+    </table>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/incrementalReparse47_before.xml b/xml/tests/testData/psi/incrementalReparse47_before.xml
new file mode 100644
index 0000000..df5bb21
--- /dev/null
+++ b/xml/tests/testData/psi/incrementalReparse47_before.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:view="http://schemas.niku.com/2002/view" exclude-result-prefixes="view">
+
+  <xsl:template match="view:view/view:group">
+    ${aaa aaa aaa
+    <table border="0" cellspacing="0" cellpadding="0" width="100%" width="100%" width="100%">
+      <tr>
+        <xsl:for-each select="view:section">
+          <td valign="top">&space;</td>
+        </xsl:for-each>
+      </tr>
+    </table>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/manyErrors.xml b/xml/tests/testData/psi/manyErrors.xml
new file mode 100644
index 0000000..ff46edd
--- /dev/null
+++ b/xml/tests/testData/psi/manyErrors.xml
@@ -0,0 +1,258 @@
+<html>
+<HEAD>
+	<TITLE>AppletViewer Tags</TITLE>
+</HEAD>
+
+<BODY bgcolor="white">
+
+<TABLE BORDER="0" WIDTH="100%" summary="layout">
+<TR>
+<TD>
+   <IMG SRC="../images/javalogo52x88.gif" ALT="Java" BORDER=0 WIDTH=52 HEIGHT=88>
+</TD>
+
+<TD>
+<center>
+           <h1>AppletViewer Tags</h1>
+</center>
+</TD>
+
+<TD ALIGN=RIGHT VALIGN=TOP>
+<font size="-1"><a href="../index.html">Documentation Contents</a></font>
+</TD>
+</TR>
+</TABLE>
+
+
+<!-- ======================== Body text begins here ===================== -->
+The applet viewer makes it possible to run a Java applet without using
+a browser. AppletViewer ignores any HTML that is not immediately relevant
+to launching an applet. However, it recognizes a wide variety of applet-
+launching syntax. The HTML code that AppletViewer recognizes is shown
+below. All other HTML code is ignored.
+<p>
+<b>object</b><br>
+<blockquote>
+The <code>object</code> tag is the HTML 4.0 tag for embedding applets 
+and mult-media objects into an HTML page. It is also an Internet Explorer
+4.x extension to HTML 3.2 which allows IE to run a Java applet using the 
+latest Java plugin from Sun.
+<pre>
+&lt;object
+  width="<i>pixelWidth</i>"
+  height="<i>pixelHeight</i>"
+&gt;
+  &lt;param name="code" value="<i>yourClass.class</i>"&gt;
+  &lt;param name="object" value="<i>serializedObjectOrJavaBean</i>"&gt;
+  &lt;param name="codebase" value="<i>classFileDirectory</i>"&gt;
+   ...
+  <i>alternate-text</i>
+&lt;/object&gt;
+</pre>
+<b>Notes:</b><br><ul>
+<li>AppletViewer ignores the "classID" attribute, on the assumption
+    that it is pointing to the Java plugin, with the value:<br>
+    &nbsp;&nbsp;<code>
+      classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
+    </code>
+	 <p>
+<li>AppletViewer also ignores the "codebase" attribute that is usually included
+    as part of the object tag, assuming that it points to a Java plugin
+    in a network <b>cab</b> file with a value like:<br>
+    <code>&nbsp;&nbsp;
+      codebase="http://java.sun.com/products/plugin/1.1/jinstall-11-win32.cab#Version=1,1,0,0"
+    </code>
+	 <p>
+<li>The optional <code>codebase</code> param tag supplies a relative URL that
+    specifies the location of the applet class.
+	 <p>
+<li>Either <code>code</code> or <code>object</code> is specified, not both.
+	 <p>
+<li>The <code>type</code> param tag is not used by AppletViewer, but should be
+    present so that browsers load the plugin properly.<br>
+	 For an applet, the value should be something like:<br>
+    <code>&nbsp;&nbsp;
+      &lt;param name="type" value="application/x-java-applet;version=1.1"&gt;
+    </code><br>
+    or<br>
+    <code>&nbsp;&nbsp;
+      &lt;param name="type" value="application/x-java-applet"&gt;
+    </code><br><br>
+    For a serialized object or JavaBean, the <code>type</code> param 
+	 value should be something like:<br>
+    <code>&nbsp;&nbsp;
+      &lt;param name="type" value="application/x-java-bean;version=1.1"&gt;
+    </code><br>
+    or<br>
+    <code>&nbsp;&nbsp;
+      &lt;param name="type" value="application/x-java-bean"&gt;
+    </code>
+	 <p>
+<li>Other param tags are argument values supplied to the applet.
+	 <p>
+<li>The <code>object</code> tag recognized by IE4.x and the <code>embed</code> tag
+    recognized by Netscape 4.x can be combined so that an applet can
+    use the latest Java plugin from Sun, regardless of the browser that
+    downloads the applet.<br>
+	 For more information, see
+    <a href="http://java.sun.com/products/plugin/1.3/docs/tags.html">Java
+    PlugIn HTML Specification</a>
+	 <p>
+<li>AppletViewer does not recognize the <code>java_code</code>, <code>java_codebase</code>,
+    <code>java_object</code>, or <code>java_type</code> param tags. These tags
+    are only needed when the applet defines parameters with the names
+    code, codebase, object, or type, respectively. (In that situation, the
+    plugin recognizes and uses the <code>java_</code> version in preference to the
+    version that will be used by the applet.) If the applet requires a
+    parameter with one of these 4 names, it may not run in AppletViewer.
+</ul>
+</blockquote>
+<p>
+<b>embed</b><br>
+<blockquote>
+The <code>embed</code> tag is the Netscape extension to HTML 3.2 that allows 
+embedding an applet or a multimedia object in an HTML page. It allows a
+Netscape 4.x browser (which supports HTML 3.2) to run a Java applet using the 
+latest Java plugin from Sun.
+<pre>
+&lt;embed
+  code="<i>yourClass.class</i>"
+  object="<i>serializedObjectOrJavaBean</i>"
+  codebase="<i>classFileDirectory</i>"
+  width="<i>pixelWidth</i>"
+  height="<i>pixelHeight</i>"
+&gt;
+   ...
+&lt;/embed&gt;
+</pre>
+<b>Notes:</b><br>
+<ul>
+<li>The <code>object</code> and <code>embed</code> tags can be combined so that
+    an applet can use the latest Java plugin from Sun, regardless of
+    the browser that downloads the applet.<br>
+	 For more information, see the
+    <a href="http://java.sun.com/products/plugin/1.3/docs/tags.html">Java 
+    PlugIn HTML Specification</a>
+	 <p>
+<li>Unlike the <code>object</code> tag, all values specified in an <code>embed</code>
+    tag are attributes (part of the tag) rather than parameters (between the start
+	 tag and end tag, specified with a <code>param</code> tag.
+	 <p>
+<li>To supply argument values for applet parameters, you add additional
+    attributes to the <code>&lt;embed&gt;</code> tag.
+	 <p>
+<li>AppletViewer ignores the "src" attribute that is usually part of an 
+    <code>&lt;embed&gt;</code> tag.
+	 <p>
+<li>Either <code>code</code> or <code>object</code> is specified, not both.
+	 <p>
+<li>The optional <code>codebase</code> attribute supplies a relative URL that
+    specifies the location of the applet class.
+	 <p>
+<li>The <code>type</code> attribute is not used by AppletViewer, but should be
+    present so that browsers load the plugin properly.<br>
+	 For an applet, the value should be something like:<br>
+    <code>&nbsp;&nbsp;
+      &lt;type="application/x-java-applet;version=1.1"&gt;...
+    </code><br>
+    or<br>
+    <code>&nbsp;&nbsp;
+      &lt;type="application/x-java-applet"&gt;...
+    </code><br><br>
+    For a serialized object or JavaBean, the <code>type</code> param 
+	 value should be something like:<br>
+    <code>&nbsp;&nbsp;
+      &lt;type="application/x-java-bean;version=1.1"&gt;...
+    </code><br>
+    or<br>
+    <code>&nbsp;&nbsp;
+      &lt;type="application/x-java-bean"&gt;...
+    </code>
+	 <p>
+<li>The "pluginspage" attribute is not used by AppletViewer, but should be
+    present so that browsers load the plugin properly. It should point to a Java plugin
+    in a network <b>cab</b> file with a value like:<br>
+    <code>&nbsp;&nbsp;
+      pluginspage="http://java.sun.com/products/plugin/1.1/jinstall-11-win32.cab#Version=1,1,0,0"
+    </code>
+</ul>
+</blockquote>
+<p>
+<b>applet</b><br>
+<blockquote>
+The <code>applet</code> tag is the original HTML 3.2 tag for 
+embedding an applet in an HTML page. Applets loaded using the
+<code>applet</code> tag are run by the browser, which may not
+be using the latest version of the Java platform. To ensure that
+the applet runs with the latest version, use the <code>object</code>
+tag to load the Java plugin into the browser. The plugin will then
+run the applet.
+<pre>
+&lt;applet
+  code="<i>yourClass.class</i>"
+  object="<i>serializedObjectOrJavaBean</i>"
+  codebase="<i>classFileDirectory</i>"
+  width="<i>pixelWidth</i>"
+  height="<i>pixelHeight</i>"
+&gt;
+  &lt;param name="<i>...</i>" value="<i>...</i>"&gt;
+   ...
+  <i>alternate-text</i>
+&lt;/applet&gt;
+</pre>
+<b>Notes:</b><br>
+<ul>
+<li>Either <code>code</code> or <code>object</code> is specified, not both.
+	 <p>
+<li>The optional <code>codebase</code> attribute supplies a relative URL that
+    specifies the location of the applet class.
+	 <p>
+<li>Param tags supply argument values for applet parameters.
+</ul>
+</blockquote>
+<p>
+<b>app</b><br>
+<blockquote>
+The <code>app</code> tag was a short-lived abbreviation for 
+<code>applet</code> that is no longer supported. AppletViewer 
+translates the tag and prints out an equivalent tag that is supported.
+<pre>
+&lt;app
+  class="<i>classFileName</i>" (<i>without</i> a .class suffix)
+  src="<i>classFileDirectory</i>"
+  width="<i>pixelWidth</i>"
+  height="<i>pixelHeight</i>"
+&gt;
+&lt;param name="..." value="..."&gt;
+ ...
+&lt;/app&gt;
+</pre>
+</blockquote>
+
+For more information on the tags that AppletViewer supports and<br> 
+how to combine them, see the 
+<a href="http://java.sun.com/products/plugin/1.3/docs/tags.html">Java 
+PlugIn HTML Specification</a>.
+<P>
+<HR SIZE=3 NOSHADE>
+<TABLE BORDER="0" WIDTH="100%" summary="layout">
+<TR VALIGN=TOP>
+<TD>
+<P><FONT SIZE="-2">
+  <A HREF="../relnotes/SMICopyright.html">Copyright</A> &#169; 2001
+  <A HREF="http://www.sun.com">Sun Microsystems, Inc.</A>
+  All Rights Reserved.</FONT></P>
+</TD>
+<TD ALIGN=RIGHT>
+  <IMG SRC="../images/sunlogo64x30.gif" ALT="Sun" BORDER=0 WIDTH=64 HEIGHT=30>
+  <BR>
+  <FONT SIZE="+1">
+  <i>Java Software</i>
+  </FONT>
+</TD>
+</TR>
+</TABLE>
+<BR><BR><BR><BR><BR><BR><BR><BR>
+
+</body>
+</html>
diff --git a/xml/tests/testData/psi/pallada.xml b/xml/tests/testData/psi/pallada.xml
new file mode 100644
index 0000000..4f533e0
--- /dev/null
+++ b/xml/tests/testData/psi/pallada.xml
@@ -0,0 +1,2424 @@
+<project name="pallada" default="all">
+  
+  
+  <!-- Uncomment the following property if no tests compilation is needed -->
+  <!-- 
+  <property name="skip.tests" value="true"/>
+   -->
+  
+  <!-- The task requires the following libraries from IntelliJ IDEA distribution: -->
+  <!--   javac2.jar; jdom.jar; bcel.jar -->
+  <taskdef name="javac2" classname="com.intellij.ant.Javac2"/>
+  
+  <!-- Compiler options -->
+  
+  <property name="compiler.debug" value="on"/>
+  <property name="compiler.generate.no.warnings" value="off"/>
+  <property name="compiler.args" value=""/>
+  <property name="compiler.max.memory" value="256m"/>
+  <patternset id="compiler.excluded">
+    <exclude name="D:/work/Pallada/tools/parserGen/testSource/**"/>
+    <exclude name="D:/work/Pallada/tools/parserGen/source/com/intellij/parserGen/**"/>
+  </patternset>
+  <patternset id="compiler.resources">
+    <include name="**/?*.properties"/>
+    <include name="**/?*.gif"/>
+    <include name="**/?*.png"/>
+    <include name="**/?*.jpeg"/>
+    <include name="**/?*.jpg"/>
+    <include name="**/?*.xml"/>
+    <include name="**/?*.dtd"/>
+    <include name="**/?*.tld"/>
+    <include name="**/?*.xsd"/>
+    <include name="**/?*.ft"/>
+    <include name="**/?*.html"/>
+    <include name="**/?*.template"/>
+    <include name="**/primes.bin"/>
+    <include name="**/?*.ico"/>
+  </patternset>
+  <!-- JDK definitions -->
+  
+  <property name="jdk.home.idea_jdk" value="D:/java/j2sdk1.4.2_04"/>
+  <path id="jdk.classpath.idea_jdk">
+    <fileset dir="${jdk.home.idea_jdk}">
+      <include name="jre/lib/charsets.jar"/>
+      <include name="lib/tools.jar"/>
+      <include name="jre/lib/jce.jar"/>
+      <include name="jre/lib/jsse.jar"/>
+      <include name="jre/lib/plugin.jar"/>
+      <include name="jre/lib/rt.jar"/>
+      <include name="jre/lib/sunrsasign.jar"/>
+      <include name="jre/lib/tools.jar"/>
+      <include name="jre/lib/ext/dnsns.jar"/>
+      <include name="jre/lib/ext/ldapsec.jar"/>
+      <include name="jre/lib/ext/localedata.jar"/>
+      <include name="jre/lib/ext/sunjce_provider.jar"/>
+      <include name="lib/tools.jar"/>
+    </fileset>
+  </path>
+  
+  <property name="jdk.home.jdk_131" value="D:/java/jdk1.3.1_10"/>
+  <path id="jdk.classpath.jdk_131">
+    <fileset dir="${jdk.home.jdk_131}">
+      <include name="jre/lib/i18n.jar"/>
+      <include name="jre/lib/jaws.jar"/>
+      <include name="jre/lib/rt.jar"/>
+      <include name="jre/lib/sunrsasign.jar"/>
+      <include name="jre/lib/tools.jar"/>
+    </fileset>
+  </path>
+  
+  <property name="jdk.home.jdk_122" value="D:/java/jdk1.2.2"/>
+  <path id="jdk.classpath.jdk_122">
+    <fileset dir="${jdk.home.jdk_122}">
+      <include name="jre/lib/i18n.jar"/>
+      <include name="jre/lib/jaws.jar"/>
+      <include name="jre/lib/plugprov.jar"/>
+      <include name="jre/lib/rt.jar"/>
+      <include name="jre/lib/tools.jar"/>
+      <include name="jre/lib/ext/iiimp.jar"/>
+    </fileset>
+  </path>
+  
+  <property name="project.jdk.home" value="${jdk.home.idea_jdk}"/>
+  <property name="project.jdk.classpath" value="jdk.classpath.idea_jdk"/>
+  <!-- Project Libraries -->
+  
+  <path id="library.generic_collections.classpath">
+    <pathelement location="${basedir}/lib/generics/collect.jar"/>
+  </path>
+  
+  <path id="library.jdom.classpath">
+    <pathelement location="${basedir}/lib/jdom.jar"/>
+  </path>
+  
+  <path id="library.junit.classpath">
+    <pathelement location="${basedir}/lib/junit.jar"/>
+  </path>
+  
+  <path id="library.ant.classpath">
+    <pathelement location="${basedir}/lib/ant/lib/ant-jakarta-oro.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-apache-resolver.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-nodeps.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-xalan2.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-xalan1.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-vaj.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-antlr.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-jakarta-log4j.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-jmf.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/xml-apis.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-icontract.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-jakarta-regexp.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-javamail.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-netrexx.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-jdepend.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-commons-logging.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-swing.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-jai.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-xslp.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-junit.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-launcher.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-commons-net.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-weblogic.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-jakarta-bcel.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-stylebook.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-apache-bsf.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/xercesImpl.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-starteam.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-trax.jar"/>
+    <pathelement location="${basedir}/lib/ant/lib/ant-jsch.jar"/>
+  </path>
+  
+  <path id="library.mocks.classpath">
+    <pathelement location="${basedir}/lib/dev/easymock.jar"/>
+    <pathelement location="${basedir}/lib/dev/mockobjects-core-0.09.jar"/>
+  </path>
+  
+  <path id="library.velocity.classpath">
+    <pathelement location="${basedir}/lib/velocity.jar"/>
+  </path>
+  
+  <path id="library.jasper2.classpath">
+    <pathelement location="${basedir}/lib/rt/jasper2/commons-collections.jar"/>
+    <pathelement location="${basedir}/lib/rt/jasper2/commons-el.jar"/>
+    <pathelement location="${basedir}/lib/rt/jasper2/commons-logging-api.jar"/>
+    <pathelement location="${basedir}/lib/rt/jasper2/jasper-compiler.jar"/>
+    <pathelement location="${basedir}/lib/rt/jasper2/jasper-runtime.jar"/>
+    <pathelement location="${basedir}/lib/rt/jasper2/jsp-api.jar"/>
+    <pathelement location="${basedir}/lib/rt/jasper2/servlet-api.jar"/>
+  </path>
+  
+  <path id="library.bcel.classpath">
+    <pathelement location="${basedir}/lib/bcel.jar"/>
+  </path>
+  
+  <path id="library.log4j.classpath">
+    <pathelement location="${basedir}/lib/log4j.jar"/>
+  </path>
+  
+  <path id="library.mockweblogic.classpath">
+    <pathelement location="${basedir}/lib/dev/mockweblogic.jar"/>
+  </path>
+  
+  <path id="library.trove4j.classpath">
+    <pathelement location="${basedir}/lib/trove4j.jar"/>
+  </path>
+  
+  <path id="library.servlets.classpath">
+    <pathelement location="${basedir}/lib/servlet.jar"/>
+  </path>
+  <!-- Global Libraries -->
+  
+  
+  <dirname property="module.internalresources.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.internalresources" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.internalresources" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.internalresources" value="${compiler.args}"/>
+  
+  <property name="internalresources.output.dir" value="${module.internalresources.basedir}/internalResources/classes"/>
+  <property name="internalresources.testoutput.dir" value="${module.internalresources.basedir}/internalResources/classes"/>
+  
+  <path id="internalresources.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="internalresources.module.classpath">
+    <path refid="${module.jdk.classpath.internalresources}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.internalresources"/>
+  
+  <patternset id="excluded.from.compilation.internalresources">
+    <patternset refid="excluded.from.module.internalresources"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="internalresources.module.sourcepath">
+    <dirset dir="${module.internalresources.basedir}/internalResources">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.internalresources" depends="compile.module.internalresources.production,compile.module.internalresources.tests" description="compile module internalResources"/>
+  
+  <target name="compile.module.internalresources.production" description="compile module internalResources production classes">
+    <mkdir dir="${internalresources.output.dir}"/>
+    <javac2 destdir="${internalresources.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.internalresources}/bin/javac">
+      <compilerarg line="${compiler.args.internalresources}"/>
+      <bootclasspath refid="internalresources.module.bootclasspath"/>
+      <classpath refid="internalresources.module.classpath"/>
+      <src refid="internalresources.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.internalresources"/>
+    </javac2>
+    <copy todir="${internalresources.output.dir}">
+      <fileset dir="${module.internalresources.basedir}/internalResources/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.internalresources"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.internalresources.tests" depends="compile.module.internalresources.production" description="compile module internalResources test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.internalresources" description="cleanup module">
+    <delete dir="${internalresources.output.dir}"/>
+    <delete dir="${internalresources.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.forms_rt.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.forms_rt" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.forms_rt" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.forms_rt" value="${compiler.args}"/>
+  
+  <property name="forms_rt.output.dir" value="${module.forms_rt.basedir}/forms_rt/classes"/>
+  <property name="forms_rt.testoutput.dir" value="${module.forms_rt.basedir}/forms_rt/classes"/>
+  
+  <path id="forms_rt.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="forms_rt.module.classpath">
+    <path refid="${module.jdk.classpath.forms_rt}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.forms_rt"/>
+  
+  <patternset id="excluded.from.compilation.forms_rt">
+    <patternset refid="excluded.from.module.forms_rt"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="forms_rt.module.sourcepath">
+    <dirset dir="${module.forms_rt.basedir}/forms_rt">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.forms_rt" depends="compile.module.forms_rt.production,compile.module.forms_rt.tests" description="compile module forms_rt"/>
+  
+  <target name="compile.module.forms_rt.production" description="compile module forms_rt production classes">
+    <mkdir dir="${forms_rt.output.dir}"/>
+    <javac2 destdir="${forms_rt.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.forms_rt}/bin/javac">
+      <compilerarg line="${compiler.args.forms_rt}"/>
+      <bootclasspath refid="forms_rt.module.bootclasspath"/>
+      <classpath refid="forms_rt.module.classpath"/>
+      <src refid="forms_rt.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.forms_rt"/>
+    </javac2>
+    <copy todir="${forms_rt.output.dir}">
+      <fileset dir="${module.forms_rt.basedir}/forms_rt/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.forms_rt"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.forms_rt.tests" depends="compile.module.forms_rt.production" description="compile module forms_rt test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.forms_rt" description="cleanup module">
+    <delete dir="${forms_rt.output.dir}"/>
+    <delete dir="${forms_rt.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.uidesignercore.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.uidesignercore" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.uidesignercore" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.uidesignercore" value="${compiler.args}"/>
+  
+  <property name="uidesignercore.output.dir" value="${module.uidesignercore.basedir}/UIDesignerCore/classes"/>
+  <property name="uidesignercore.testoutput.dir" value="${module.uidesignercore.basedir}/UIDesignerCore/testClasses"/>
+  
+  <path id="uidesignercore.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="uidesignercore.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.uidesignercore}"/>
+    <path refid="library.junit.classpath"/>
+    <path refid="library.bcel.classpath"/>
+    <path refid="library.jdom.classpath"/>
+    <pathelement location="${forms_rt.output.dir}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.uidesignercore"/>
+  
+  <patternset id="excluded.from.compilation.uidesignercore">
+    <patternset refid="excluded.from.module.uidesignercore"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="uidesignercore.module.sourcepath">
+    <dirset dir="${module.uidesignercore.basedir}/UIDesignerCore">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  <path id="uidesignercore.module.test.sourcepath">
+    <dirset dir="${module.uidesignercore.basedir}/UIDesignerCore">
+      <include name="testSource"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.uidesignercore" depends="compile.module.uidesignercore.production,compile.module.uidesignercore.tests" description="compile module UIDesignerCore"/>
+  
+  <target name="compile.module.uidesignercore.production" depends="compile.module.forms_rt" description="compile module UIDesignerCore production classes">
+    <mkdir dir="${uidesignercore.output.dir}"/>
+    <javac2 destdir="${uidesignercore.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.uidesignercore}/bin/javac">
+      <compilerarg line="${compiler.args.uidesignercore}"/>
+      <bootclasspath refid="uidesignercore.module.bootclasspath"/>
+      <classpath refid="uidesignercore.module.classpath"/>
+      <src refid="uidesignercore.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.uidesignercore"/>
+    </javac2>
+    <copy todir="${uidesignercore.output.dir}">
+      <fileset dir="${module.uidesignercore.basedir}/UIDesignerCore/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.uidesignercore"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.uidesignercore.tests" depends="compile.module.uidesignercore.production" description="compile module UIDesignerCore test classes" unless="skip.tests">
+    <mkdir dir="${uidesignercore.testoutput.dir}"/>
+    <javac2 destdir="${uidesignercore.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.uidesignercore}/bin/javac">
+      <compilerarg line="${compiler.args.uidesignercore}"/>
+      <classpath refid="uidesignercore.module.classpath"/>
+      <classpath location="${uidesignercore.output.dir}"/>
+      <src refid="uidesignercore.module.test.sourcepath"/>
+      <patternset refid="excluded.from.compilation.uidesignercore"/>
+    </javac2>
+    <copy todir="${uidesignercore.testoutput.dir}">
+      <fileset dir="${module.uidesignercore.basedir}/UIDesignerCore/testSource">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.uidesignercore"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="clean.module.uidesignercore" description="cleanup module">
+    <delete dir="${uidesignercore.output.dir}"/>
+    <delete dir="${uidesignercore.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.javac2.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.javac2" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.javac2" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.javac2" value="${compiler.args}"/>
+  
+  <property name="javac2.output.dir" value="${module.javac2.basedir}/javac2/classes"/>
+  <property name="javac2.testoutput.dir" value="${module.javac2.basedir}/javac2/classes"/>
+  
+  <path id="javac2.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="javac2.module.classpath">
+    <path refid="${module.jdk.classpath.javac2}"/>
+    <path refid="library.ant.classpath"/>
+    <pathelement location="${uidesignercore.output.dir}"/>
+    <pathelement location="${uidesignercore.testoutput.dir}"/>
+    <path refid="library.bcel.classpath"/>
+    <pathelement location="${forms_rt.output.dir}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.javac2"/>
+  
+  <patternset id="excluded.from.compilation.javac2">
+    <patternset refid="excluded.from.module.javac2"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="javac2.module.sourcepath">
+    <dirset dir="${module.javac2.basedir}/javac2">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.javac2" depends="compile.module.javac2.production,compile.module.javac2.tests" description="compile module javac2"/>
+  
+  <target name="compile.module.javac2.production" depends="compile.module.uidesignercore,compile.module.forms_rt" description="compile module javac2 production classes">
+    <mkdir dir="${javac2.output.dir}"/>
+    <javac2 destdir="${javac2.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.javac2}/bin/javac">
+      <compilerarg line="${compiler.args.javac2}"/>
+      <bootclasspath refid="javac2.module.bootclasspath"/>
+      <classpath refid="javac2.module.classpath"/>
+      <src refid="javac2.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.javac2"/>
+    </javac2>
+    <copy todir="${javac2.output.dir}">
+      <fileset dir="${module.javac2.basedir}/javac2/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.javac2"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.javac2.tests" depends="compile.module.javac2.production" description="compile module javac2 test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.javac2" description="cleanup module">
+    <delete dir="${javac2.output.dir}"/>
+    <delete dir="${javac2.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.idea_rt.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.idea_rt" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.idea_rt" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.idea_rt" value="${compiler.args}"/>
+  
+  <property name="idea_rt.output.dir" value="${module.idea_rt.basedir}/classes/rt"/>
+  <property name="idea_rt.testoutput.dir" value="${module.idea_rt.basedir}/classes/rt"/>
+  
+  <path id="idea_rt.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="idea_rt.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.idea_rt}"/>
+    <path refid="library.junit.classpath"/>
+    <path refid="library.ant.classpath"/>
+    <path refid="library.jasper2.classpath"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.idea_rt"/>
+  
+  <patternset id="excluded.from.compilation.idea_rt">
+    <patternset refid="excluded.from.module.idea_rt"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="idea_rt.module.sourcepath">
+    <dirset dir="${module.idea_rt.basedir}">
+      <include name="runtimesource"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.idea_rt" depends="compile.module.idea_rt.production,compile.module.idea_rt.tests" description="compile module idea_rt"/>
+  
+  <target name="compile.module.idea_rt.production" description="compile module idea_rt production classes">
+    <mkdir dir="${idea_rt.output.dir}"/>
+    <javac2 destdir="${idea_rt.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.idea_rt}/bin/javac">
+      <compilerarg line="${compiler.args.idea_rt}"/>
+      <bootclasspath refid="idea_rt.module.bootclasspath"/>
+      <classpath refid="idea_rt.module.classpath"/>
+      <src refid="idea_rt.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.idea_rt"/>
+    </javac2>
+    <copy todir="${idea_rt.output.dir}">
+      <fileset dir="${module.idea_rt.basedir}/runtimesource">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.idea_rt"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.idea_rt.tests" depends="compile.module.idea_rt.production" description="compile module idea_rt test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.idea_rt" description="cleanup module">
+    <delete dir="${idea_rt.output.dir}"/>
+    <delete dir="${idea_rt.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.weblogicwrapper.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.weblogicwrapper" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.weblogicwrapper" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.weblogicwrapper" value="${compiler.args}"/>
+  
+  <property name="weblogicwrapper.output.dir" value="${module.weblogicwrapper.basedir}/plugins/weblogic/weblogicWrapper/classes"/>
+  <property name="weblogicwrapper.testoutput.dir" value="${module.weblogicwrapper.basedir}/plugins/weblogic/weblogicWrapper/classes"/>
+  
+  <path id="weblogicwrapper.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="weblogicwrapper.module.classpath">
+    <path refid="${module.jdk.classpath.weblogicwrapper}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.weblogicwrapper"/>
+  
+  <patternset id="excluded.from.compilation.weblogicwrapper">
+    <patternset refid="excluded.from.module.weblogicwrapper"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="weblogicwrapper.module.sourcepath">
+    <dirset dir="${module.weblogicwrapper.basedir}/plugins/weblogic/weblogicWrapper">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.weblogicwrapper" depends="compile.module.weblogicwrapper.production,compile.module.weblogicwrapper.tests" description="compile module weblogicWrapper"/>
+  
+  <target name="compile.module.weblogicwrapper.production" description="compile module weblogicWrapper production classes">
+    <mkdir dir="${weblogicwrapper.output.dir}"/>
+    <javac2 destdir="${weblogicwrapper.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.weblogicwrapper}/bin/javac">
+      <compilerarg line="${compiler.args.weblogicwrapper}"/>
+      <bootclasspath refid="weblogicwrapper.module.bootclasspath"/>
+      <classpath refid="weblogicwrapper.module.classpath"/>
+      <src refid="weblogicwrapper.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.weblogicwrapper"/>
+    </javac2>
+    <copy todir="${weblogicwrapper.output.dir}">
+      <fileset dir="${module.weblogicwrapper.basedir}/plugins/weblogic/weblogicWrapper/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.weblogicwrapper"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.weblogicwrapper.tests" depends="compile.module.weblogicwrapper.production" description="compile module weblogicWrapper test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.weblogicwrapper" description="cleanup module">
+    <delete dir="${weblogicwrapper.output.dir}"/>
+    <delete dir="${weblogicwrapper.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.weblogicwrapperimpl.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.weblogicwrapperimpl" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.weblogicwrapperimpl" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.weblogicwrapperimpl" value="${compiler.args}"/>
+  
+  <property name="weblogicwrapperimpl.output.dir" value="${module.weblogicwrapperimpl.basedir}/plugins/weblogic/weblogicLogin/classes"/>
+  <property name="weblogicwrapperimpl.testoutput.dir" value="${module.weblogicwrapperimpl.basedir}/plugins/weblogic/weblogicLogin/classes"/>
+  
+  <path id="weblogicwrapperimpl.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="weblogicwrapperimpl.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.weblogicwrapperimpl}"/>
+    <pathelement location="${weblogicwrapper.output.dir}"/>
+    <path refid="library.mockweblogic.classpath"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.weblogicwrapperimpl"/>
+  
+  <patternset id="excluded.from.compilation.weblogicwrapperimpl">
+    <patternset refid="excluded.from.module.weblogicwrapperimpl"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="weblogicwrapperimpl.module.sourcepath">
+    <dirset dir="${module.weblogicwrapperimpl.basedir}/plugins/weblogic/weblogicLogin">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.weblogicwrapperimpl" depends="compile.module.weblogicwrapperimpl.production,compile.module.weblogicwrapperimpl.tests" description="compile module weblogicWrapperImpl"/>
+  
+  <target name="compile.module.weblogicwrapperimpl.production" depends="compile.module.weblogicwrapper" description="compile module weblogicWrapperImpl production classes">
+    <mkdir dir="${weblogicwrapperimpl.output.dir}"/>
+    <javac2 destdir="${weblogicwrapperimpl.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.weblogicwrapperimpl}/bin/javac">
+      <compilerarg line="${compiler.args.weblogicwrapperimpl}"/>
+      <bootclasspath refid="weblogicwrapperimpl.module.bootclasspath"/>
+      <classpath refid="weblogicwrapperimpl.module.classpath"/>
+      <src refid="weblogicwrapperimpl.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.weblogicwrapperimpl"/>
+    </javac2>
+    <copy todir="${weblogicwrapperimpl.output.dir}">
+      <fileset dir="${module.weblogicwrapperimpl.basedir}/plugins/weblogic/weblogicLogin/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.weblogicwrapperimpl"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.weblogicwrapperimpl.tests" depends="compile.module.weblogicwrapperimpl.production" description="compile module weblogicWrapperImpl test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.weblogicwrapperimpl" description="cleanup module">
+    <delete dir="${weblogicwrapperimpl.output.dir}"/>
+    <delete dir="${weblogicwrapperimpl.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.resources.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.resources" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.resources" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.resources" value="${compiler.args}"/>
+  
+  <property name="resources.output.dir" value="${module.resources.basedir}/resources/classes"/>
+  <property name="resources.testoutput.dir" value="${module.resources.basedir}/resources/classes"/>
+  
+  <path id="resources.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="resources.module.classpath">
+    <path refid="${module.jdk.classpath.resources}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.resources"/>
+  
+  <patternset id="excluded.from.compilation.resources">
+    <patternset refid="excluded.from.module.resources"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="resources.module.sourcepath">
+    <dirset dir="${module.resources.basedir}/resources">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.resources" depends="compile.module.resources.production,compile.module.resources.tests" description="compile module resources"/>
+  
+  <target name="compile.module.resources.production" description="compile module resources production classes">
+    <mkdir dir="${resources.output.dir}"/>
+    <javac2 destdir="${resources.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.resources}/bin/javac">
+      <compilerarg line="${compiler.args.resources}"/>
+      <bootclasspath refid="resources.module.bootclasspath"/>
+      <classpath refid="resources.module.classpath"/>
+      <src refid="resources.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.resources"/>
+    </javac2>
+    <copy todir="${resources.output.dir}">
+      <fileset dir="${module.resources.basedir}/resources/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.resources"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.resources.tests" depends="compile.module.resources.production" description="compile module resources test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.resources" description="cleanup module">
+    <delete dir="${resources.output.dir}"/>
+    <delete dir="${resources.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.util.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.util" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.util" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.util" value="${compiler.args}"/>
+  
+  <property name="util.output.dir" value="${module.util.basedir}/util/classes"/>
+  <property name="util.testoutput.dir" value="${module.util.basedir}/util/classes"/>
+  
+  <path id="util.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="util.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.util}"/>
+    <path refid="library.bcel.classpath"/>
+    <path refid="library.jdom.classpath"/>
+    <path refid="library.junit.classpath"/>
+    <path refid="library.log4j.classpath"/>
+    <path refid="library.trove4j.classpath"/>
+    <pathelement location="${module.util.basedir}/lib/yjp-controller-api-redist.jar"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.util"/>
+  
+  <patternset id="excluded.from.compilation.util">
+    <patternset refid="excluded.from.module.util"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="util.module.sourcepath">
+    <dirset dir="${module.util.basedir}/util">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  <path id="util.module.test.sourcepath">
+    <dirset dir="${module.util.basedir}/util">
+      <include name="testSource"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.util" depends="compile.module.util.production,compile.module.util.tests" description="compile module util"/>
+  
+  <target name="compile.module.util.production" description="compile module util production classes">
+    <mkdir dir="${util.output.dir}"/>
+    <javac2 destdir="${util.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.util}/bin/javac">
+      <compilerarg line="${compiler.args.util}"/>
+      <bootclasspath refid="util.module.bootclasspath"/>
+      <classpath refid="util.module.classpath"/>
+      <src refid="util.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.util"/>
+    </javac2>
+    <copy todir="${util.output.dir}">
+      <fileset dir="${module.util.basedir}/util/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.util"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.util.tests" depends="compile.module.util.production" description="compile module util test classes" unless="skip.tests">
+    <mkdir dir="${util.testoutput.dir}"/>
+    <javac2 destdir="${util.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.util}/bin/javac">
+      <compilerarg line="${compiler.args.util}"/>
+      <classpath refid="util.module.classpath"/>
+      <classpath location="${util.output.dir}"/>
+      <src refid="util.module.test.sourcepath"/>
+      <patternset refid="excluded.from.compilation.util"/>
+    </javac2>
+    <copy todir="${util.testoutput.dir}">
+      <fileset dir="${module.util.basedir}/util/testSource">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.util"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="clean.module.util" description="cleanup module">
+    <delete dir="${util.output.dir}"/>
+    <delete dir="${util.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.parsergen.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.parsergen" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.parsergen" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.parsergen" value="${compiler.args}"/>
+  
+  <property name="parsergen.output.dir" value="${module.parsergen.basedir}/tools/parserGen/classes/main"/>
+  <property name="parsergen.testoutput.dir" value="${module.parsergen.basedir}/tools/parserGen/classes/test"/>
+  
+  <path id="parsergen.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="parsergen.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.parsergen}"/>
+    <pathelement location="${module.parsergen.basedir}/lib/xerces.jar"/>
+    <pathelement location="${module.parsergen.basedir}/tools/parserGen/lib/antlr-2.7.1.jar"/>
+    <path refid="library.junit.classpath"/>
+    <path refid="library.velocity.classpath"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.parsergen"/>
+  
+  <patternset id="excluded.from.compilation.parsergen">
+    <patternset refid="excluded.from.module.parsergen"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="parsergen.module.sourcepath">
+    <dirset dir="${module.parsergen.basedir}/tools/parserGen">
+      <include name="internalResources"/>
+      <include name="source"/>
+    </dirset>
+  </path>
+  
+  <path id="parsergen.module.test.sourcepath">
+    <dirset dir="${module.parsergen.basedir}/tools/parserGen">
+      <include name="testSource"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.parsergen" depends="compile.module.parsergen.production,compile.module.parsergen.tests" description="compile module parserGen"/>
+  
+  <target name="compile.module.parsergen.production" description="compile module parserGen production classes">
+    <mkdir dir="${parsergen.output.dir}"/>
+    <javac2 destdir="${parsergen.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.parsergen}/bin/javac">
+      <compilerarg line="${compiler.args.parsergen}"/>
+      <bootclasspath refid="parsergen.module.bootclasspath"/>
+      <classpath refid="parsergen.module.classpath"/>
+      <src refid="parsergen.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.parsergen"/>
+    </javac2>
+    <copy todir="${parsergen.output.dir}">
+      <fileset dir="${module.parsergen.basedir}/tools/parserGen/internalResources">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.parsergen"/>
+      </fileset>
+      <fileset dir="${module.parsergen.basedir}/tools/parserGen/source">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.parsergen"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.parsergen.tests" depends="compile.module.parsergen.production" description="compile module parserGen test classes" unless="skip.tests">
+    <mkdir dir="${parsergen.testoutput.dir}"/>
+    <javac2 destdir="${parsergen.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.parsergen}/bin/javac">
+      <compilerarg line="${compiler.args.parsergen}"/>
+      <classpath refid="parsergen.module.classpath"/>
+      <classpath location="${parsergen.output.dir}"/>
+      <src refid="parsergen.module.test.sourcepath"/>
+      <patternset refid="excluded.from.compilation.parsergen"/>
+    </javac2>
+    <copy todir="${parsergen.testoutput.dir}">
+      <fileset dir="${module.parsergen.basedir}/tools/parserGen/testSource">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.parsergen"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="clean.module.parsergen" description="cleanup module">
+    <delete dir="${parsergen.output.dir}"/>
+    <delete dir="${parsergen.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.openapi.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.openapi" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.openapi" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.openapi" value="${compiler.args}"/>
+  
+  <property name="openapi.output.dir" value="${module.openapi.basedir}/openapi/classes"/>
+  <property name="openapi.testoutput.dir" value="${module.openapi.basedir}/openapi/classes"/>
+  
+  <path id="openapi.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="openapi.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.openapi}"/>
+    <pathelement location="${util.output.dir}"/>
+    <pathelement location="${idea_rt.output.dir}"/>
+    <pathelement location="${parsergen.output.dir}"/>
+    <pathelement location="${parsergen.testoutput.dir}"/>
+    <path refid="library.junit.classpath"/>
+    <path refid="library.jdom.classpath"/>
+    <pathelement location="${forms_rt.output.dir}"/>
+    <path refid="library.trove4j.classpath"/>
+    <path refid="library.jasper2.classpath"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.openapi"/>
+  
+  <patternset id="excluded.from.compilation.openapi">
+    <patternset refid="excluded.from.module.openapi"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="openapi.module.sourcepath">
+    <dirset dir="${module.openapi.basedir}/openapi">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.openapi" depends="compile.module.openapi.production,compile.module.openapi.tests" description="compile module openapi"/>
+  
+  <target name="compile.module.openapi.production" depends="compile.module.util,compile.module.idea_rt,compile.module.parsergen,compile.module.forms_rt" description="compile module openapi production classes">
+    <mkdir dir="${openapi.output.dir}"/>
+    <javac2 destdir="${openapi.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.openapi}/bin/javac">
+      <compilerarg line="${compiler.args.openapi}"/>
+      <bootclasspath refid="openapi.module.bootclasspath"/>
+      <classpath refid="openapi.module.classpath"/>
+      <src refid="openapi.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.openapi"/>
+    </javac2>
+    <copy todir="${openapi.output.dir}">
+      <fileset dir="${module.openapi.basedir}/openapi/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.openapi"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.openapi.tests" depends="compile.module.openapi.production" description="compile module openapi test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.openapi" description="cleanup module">
+    <delete dir="${openapi.output.dir}"/>
+    <delete dir="${openapi.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.weblogic.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.weblogic" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.weblogic" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.weblogic" value="${compiler.args}"/>
+  
+  <property name="weblogic.output.dir" value="${module.weblogic.basedir}/plugins/weblogic/classes"/>
+  <property name="weblogic.testoutput.dir" value="${module.weblogic.basedir}/plugins/weblogic/classes"/>
+  
+  <path id="weblogic.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="weblogic.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.weblogic}"/>
+    <pathelement location="${idea_rt.output.dir}"/>
+    <pathelement location="${util.output.dir}"/>
+    <path refid="library.jdom.classpath"/>
+    <path refid="library.junit.classpath"/>
+    <pathelement location="${openapi.output.dir}"/>
+    <pathelement location="${forms_rt.output.dir}"/>
+    <pathelement location="${weblogicwrapper.output.dir}"/>
+    <pathelement location="${weblogicwrapperimpl.output.dir}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.weblogic"/>
+  
+  <patternset id="excluded.from.compilation.weblogic">
+    <patternset refid="excluded.from.module.weblogic"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="weblogic.module.sourcepath">
+    <dirset dir="${module.weblogic.basedir}/plugins/weblogic">
+      <include name="source"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.weblogic" depends="compile.module.weblogic.production,compile.module.weblogic.tests" description="compile module weblogic"/>
+  
+  <target name="compile.module.weblogic.production" depends="compile.module.idea_rt,compile.module.util,compile.module.openapi,compile.module.forms_rt,compile.module.weblogicwrapper,compile.module.weblogicwrapperimpl" description="compile module weblogic production classes">
+    <mkdir dir="${weblogic.output.dir}"/>
+    <javac2 destdir="${weblogic.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.weblogic}/bin/javac">
+      <compilerarg line="${compiler.args.weblogic}"/>
+      <bootclasspath refid="weblogic.module.bootclasspath"/>
+      <classpath refid="weblogic.module.classpath"/>
+      <src refid="weblogic.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.weblogic"/>
+    </javac2>
+    <copy todir="${weblogic.output.dir}">
+      <fileset dir="${module.weblogic.basedir}/plugins/weblogic/source">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.weblogic"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.weblogic.tests" depends="compile.module.weblogic.production" description="compile module weblogic test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.weblogic" description="cleanup module">
+    <delete dir="${weblogic.output.dir}"/>
+    <delete dir="${weblogic.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.jsr45debug.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.jsr45debug" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.jsr45debug" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.jsr45debug" value="${compiler.args}"/>
+  
+  <property name="jsr45debug.output.dir" value="${module.jsr45debug.basedir}/plugins/jsr45debug/classes"/>
+  <property name="jsr45debug.testoutput.dir" value="${module.jsr45debug.basedir}/plugins/jsr45debug/testClasses"/>
+  
+  <path id="jsr45debug.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="jsr45debug.module.classpath">
+    <path refid="${module.jdk.classpath.jsr45debug}"/>
+    <path refid="library.jdom.classpath"/>
+    <pathelement location="${util.output.dir}"/>
+    <pathelement location="${openapi.output.dir}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.jsr45debug"/>
+  
+  <patternset id="excluded.from.compilation.jsr45debug">
+    <patternset refid="excluded.from.module.jsr45debug"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="jsr45debug.module.sourcepath">
+    <dirset dir="${module.jsr45debug.basedir}/plugins/jsr45debug">
+      <include name="source"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.jsr45debug" depends="compile.module.jsr45debug.production,compile.module.jsr45debug.tests" description="compile module jsr45debug"/>
+  
+  <target name="compile.module.jsr45debug.production" depends="compile.module.util,compile.module.openapi" description="compile module jsr45debug production classes">
+    <mkdir dir="${jsr45debug.output.dir}"/>
+    <javac2 destdir="${jsr45debug.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.jsr45debug}/bin/javac">
+      <compilerarg line="${compiler.args.jsr45debug}"/>
+      <bootclasspath refid="jsr45debug.module.bootclasspath"/>
+      <classpath refid="jsr45debug.module.classpath"/>
+      <src refid="jsr45debug.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.jsr45debug"/>
+    </javac2>
+    <copy todir="${jsr45debug.output.dir}">
+      <fileset dir="${module.jsr45debug.basedir}/plugins/jsr45debug/source">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.jsr45debug"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.jsr45debug.tests" depends="compile.module.jsr45debug.production" description="compile module jsr45debug test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.jsr45debug" description="cleanup module">
+    <delete dir="${jsr45debug.output.dir}"/>
+    <delete dir="${jsr45debug.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.tomcatintegration.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.tomcatintegration" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.tomcatintegration" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.tomcatintegration" value="${compiler.args}"/>
+  
+  <property name="tomcatintegration.output.dir" value="${module.tomcatintegration.basedir}/plugins/tomcatIntegration/classes"/>
+  <property name="tomcatintegration.testoutput.dir" value="${module.tomcatintegration.basedir}/plugins/tomcatIntegration/testClasses"/>
+  
+  <path id="tomcatintegration.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="tomcatintegration.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.tomcatintegration}"/>
+    <path refid="library.jdom.classpath"/>
+    <pathelement location="${util.output.dir}"/>
+    <pathelement location="${openapi.output.dir}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.tomcatintegration"/>
+  
+  <patternset id="excluded.from.compilation.tomcatintegration">
+    <patternset refid="excluded.from.module.tomcatintegration"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="tomcatintegration.module.sourcepath">
+    <dirset dir="${module.tomcatintegration.basedir}/plugins/tomcatIntegration">
+      <include name="source"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.tomcatintegration" depends="compile.module.tomcatintegration.production,compile.module.tomcatintegration.tests" description="compile module tomcatIntegration"/>
+  
+  <target name="compile.module.tomcatintegration.production" depends="compile.module.util,compile.module.openapi" description="compile module tomcatIntegration production classes">
+    <mkdir dir="${tomcatintegration.output.dir}"/>
+    <javac2 destdir="${tomcatintegration.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.tomcatintegration}/bin/javac">
+      <compilerarg line="${compiler.args.tomcatintegration}"/>
+      <bootclasspath refid="tomcatintegration.module.bootclasspath"/>
+      <classpath refid="tomcatintegration.module.classpath"/>
+      <src refid="tomcatintegration.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.tomcatintegration"/>
+    </javac2>
+    <copy todir="${tomcatintegration.output.dir}">
+      <fileset dir="${module.tomcatintegration.basedir}/plugins/tomcatIntegration/source">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.tomcatintegration"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.tomcatintegration.tests" depends="compile.module.tomcatintegration.production" description="compile module tomcatIntegration test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.tomcatintegration" description="cleanup module">
+    <delete dir="${tomcatintegration.output.dir}"/>
+    <delete dir="${tomcatintegration.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.starteamintegration.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.starteamintegration" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.starteamintegration" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.starteamintegration" value="${compiler.args}"/>
+  
+  <property name="starteamintegration.output.dir" value="${module.starteamintegration.basedir}/plugins/starteam/classes"/>
+  <property name="starteamintegration.testoutput.dir" value="${module.starteamintegration.basedir}/plugins/starteam/classes"/>
+  
+  <path id="starteamintegration.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="starteamintegration.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.starteamintegration}"/>
+    <pathelement location="${module.starteamintegration.basedir}/plugins/starteam/lib/starteam-sdk.jar"/>
+    <pathelement location="${util.output.dir}"/>
+    <pathelement location="${openapi.output.dir}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.starteamintegration"/>
+  
+  <patternset id="excluded.from.compilation.starteamintegration">
+    <patternset refid="excluded.from.module.starteamintegration"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="starteamintegration.module.sourcepath">
+    <dirset dir="${module.starteamintegration.basedir}/plugins/starteam">
+      <include name="source"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.starteamintegration" depends="compile.module.starteamintegration.production,compile.module.starteamintegration.tests" description="compile module starteamIntegration"/>
+  
+  <target name="compile.module.starteamintegration.production" depends="compile.module.util,compile.module.openapi" description="compile module starteamIntegration production classes">
+    <mkdir dir="${starteamintegration.output.dir}"/>
+    <javac2 destdir="${starteamintegration.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.starteamintegration}/bin/javac">
+      <compilerarg line="${compiler.args.starteamintegration}"/>
+      <bootclasspath refid="starteamintegration.module.bootclasspath"/>
+      <classpath refid="starteamintegration.module.classpath"/>
+      <src refid="starteamintegration.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.starteamintegration"/>
+    </javac2>
+    <copy todir="${starteamintegration.output.dir}">
+      <fileset dir="${module.starteamintegration.basedir}/plugins/starteam/source">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.starteamintegration"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.starteamintegration.tests" depends="compile.module.starteamintegration.production" description="compile module starteamIntegration test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.starteamintegration" description="cleanup module">
+    <delete dir="${starteamintegration.output.dir}"/>
+    <delete dir="${starteamintegration.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.samples.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.samples" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.samples" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.samples" value="${compiler.args}"/>
+  
+  <property name="samples.output.dir" value="${module.samples.basedir}/doc/classes"/>
+  <property name="samples.testoutput.dir" value="${module.samples.basedir}/doc/classes"/>
+  
+  <path id="samples.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="samples.module.classpath">
+    <path refid="${module.jdk.classpath.samples}"/>
+    <pathelement location="${openapi.output.dir}"/>
+    <pathelement location="${util.output.dir}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.samples"/>
+  
+  <patternset id="excluded.from.compilation.samples">
+    <patternset refid="excluded.from.module.samples"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="samples.module.sourcepath">
+    <dirset dir="${module.samples.basedir}/doc">
+      <include name="openapi/examples/actions/src"/>
+      <include name="openapi/examples/plugin/src"/>
+      <include name="openapi/examples/toolWindow/src"/>
+      <include name="openapi/examples/vfs/src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.samples" depends="compile.module.samples.production,compile.module.samples.tests" description="compile module samples"/>
+  
+  <target name="compile.module.samples.production" depends="compile.module.openapi,compile.module.util" description="compile module samples production classes">
+    <mkdir dir="${samples.output.dir}"/>
+    <javac2 destdir="${samples.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.samples}/bin/javac">
+      <compilerarg line="${compiler.args.samples}"/>
+      <bootclasspath refid="samples.module.bootclasspath"/>
+      <classpath refid="samples.module.classpath"/>
+      <src refid="samples.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.samples"/>
+    </javac2>
+    <copy todir="${samples.output.dir}">
+      <fileset dir="${module.samples.basedir}/doc/openapi/examples/actions/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.samples"/>
+      </fileset>
+      <fileset dir="${module.samples.basedir}/doc/openapi/examples/plugin/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.samples"/>
+      </fileset>
+      <fileset dir="${module.samples.basedir}/doc/openapi/examples/toolWindow/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.samples"/>
+      </fileset>
+      <fileset dir="${module.samples.basedir}/doc/openapi/examples/vfs/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.samples"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.samples.tests" depends="compile.module.samples.production" description="compile module samples test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.samples" description="cleanup module">
+    <delete dir="${samples.output.dir}"/>
+    <delete dir="${samples.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.inspectiongadgetsplugin.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.inspectiongadgetsplugin" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.inspectiongadgetsplugin" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.inspectiongadgetsplugin" value="${compiler.args}"/>
+  
+  <property name="inspectiongadgetsplugin.output.dir" value="${module.inspectiongadgetsplugin.basedir}/plugins/InspectionGadgets/classes"/>
+  <property name="inspectiongadgetsplugin.testoutput.dir" value="${module.inspectiongadgetsplugin.basedir}/plugins/InspectionGadgets/classes"/>
+  
+  <path id="inspectiongadgetsplugin.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="inspectiongadgetsplugin.module.classpath">
+    <path refid="${module.jdk.classpath.inspectiongadgetsplugin}"/>
+    <path refid="library.jdom.classpath"/>
+    <path refid="library.junit.classpath"/>
+    <path refid="library.log4j.classpath"/>
+    <pathelement location="${openapi.output.dir}"/>
+    <pathelement location="${util.output.dir}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.inspectiongadgetsplugin"/>
+  
+  <patternset id="excluded.from.compilation.inspectiongadgetsplugin">
+    <patternset refid="excluded.from.module.inspectiongadgetsplugin"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="inspectiongadgetsplugin.module.sourcepath">
+    <dirset dir="${module.inspectiongadgetsplugin.basedir}/plugins/InspectionGadgets">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.inspectiongadgetsplugin" depends="compile.module.inspectiongadgetsplugin.production,compile.module.inspectiongadgetsplugin.tests" description="compile module InspectionGadgetsPlugin"/>
+  
+  <target name="compile.module.inspectiongadgetsplugin.production" depends="compile.module.openapi,compile.module.util" description="compile module InspectionGadgetsPlugin production classes">
+    <mkdir dir="${inspectiongadgetsplugin.output.dir}"/>
+    <javac2 destdir="${inspectiongadgetsplugin.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.inspectiongadgetsplugin}/bin/javac">
+      <compilerarg line="${compiler.args.inspectiongadgetsplugin}"/>
+      <bootclasspath refid="inspectiongadgetsplugin.module.bootclasspath"/>
+      <classpath refid="inspectiongadgetsplugin.module.classpath"/>
+      <src refid="inspectiongadgetsplugin.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.inspectiongadgetsplugin"/>
+    </javac2>
+    <copy todir="${inspectiongadgetsplugin.output.dir}">
+      <fileset dir="${module.inspectiongadgetsplugin.basedir}/plugins/InspectionGadgets/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.inspectiongadgetsplugin"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.inspectiongadgetsplugin.tests" depends="compile.module.inspectiongadgetsplugin.production" description="compile module InspectionGadgetsPlugin test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.inspectiongadgetsplugin" description="cleanup module">
+    <delete dir="${inspectiongadgetsplugin.output.dir}"/>
+    <delete dir="${inspectiongadgetsplugin.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.intentionpowerpackplugin.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.intentionpowerpackplugin" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.intentionpowerpackplugin" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.intentionpowerpackplugin" value="${compiler.args}"/>
+  
+  <property name="intentionpowerpackplugin.output.dir" value="${module.intentionpowerpackplugin.basedir}/plugins/IntentionPowerPak/classes"/>
+  <property name="intentionpowerpackplugin.testoutput.dir" value="${module.intentionpowerpackplugin.basedir}/plugins/IntentionPowerPak/classes"/>
+  
+  <path id="intentionpowerpackplugin.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="intentionpowerpackplugin.module.classpath">
+    <path refid="${module.jdk.classpath.intentionpowerpackplugin}"/>
+    <pathelement location="${openapi.output.dir}"/>
+    <pathelement location="${util.output.dir}"/>
+    <path refid="library.log4j.classpath"/>
+    <path refid="library.jdom.classpath"/>
+    <path refid="library.junit.classpath"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.intentionpowerpackplugin"/>
+  
+  <patternset id="excluded.from.compilation.intentionpowerpackplugin">
+    <patternset refid="excluded.from.module.intentionpowerpackplugin"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="intentionpowerpackplugin.module.sourcepath">
+    <dirset dir="${module.intentionpowerpackplugin.basedir}/plugins/IntentionPowerPak">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.intentionpowerpackplugin" depends="compile.module.intentionpowerpackplugin.production,compile.module.intentionpowerpackplugin.tests" description="compile module IntentionPowerPackPlugin"/>
+  
+  <target name="compile.module.intentionpowerpackplugin.production" depends="compile.module.openapi,compile.module.util" description="compile module IntentionPowerPackPlugin production classes">
+    <mkdir dir="${intentionpowerpackplugin.output.dir}"/>
+    <javac2 destdir="${intentionpowerpackplugin.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.intentionpowerpackplugin}/bin/javac">
+      <compilerarg line="${compiler.args.intentionpowerpackplugin}"/>
+      <bootclasspath refid="intentionpowerpackplugin.module.bootclasspath"/>
+      <classpath refid="intentionpowerpackplugin.module.classpath"/>
+      <src refid="intentionpowerpackplugin.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.intentionpowerpackplugin"/>
+    </javac2>
+    <copy todir="${intentionpowerpackplugin.output.dir}">
+      <fileset dir="${module.intentionpowerpackplugin.basedir}/plugins/IntentionPowerPak/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.intentionpowerpackplugin"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.intentionpowerpackplugin.tests" depends="compile.module.intentionpowerpackplugin.production" description="compile module IntentionPowerPackPlugin test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.intentionpowerpackplugin" description="cleanup module">
+    <delete dir="${intentionpowerpackplugin.output.dir}"/>
+    <delete dir="${intentionpowerpackplugin.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.icons.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.icons" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.icons" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.icons" value="${compiler.args}"/>
+  
+  <property name="icons.output.dir" value="${module.icons.basedir}/icons/classes"/>
+  <property name="icons.testoutput.dir" value="${module.icons.basedir}/icons/classes"/>
+  
+  <path id="icons.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="icons.module.classpath">
+    <path refid="${module.jdk.classpath.icons}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.icons"/>
+  
+  <patternset id="excluded.from.compilation.icons">
+    <patternset refid="excluded.from.module.icons"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="icons.module.sourcepath">
+    <dirset dir="${module.icons.basedir}/icons">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.icons" depends="compile.module.icons.production,compile.module.icons.tests" description="compile module icons"/>
+  
+  <target name="compile.module.icons.production" description="compile module icons production classes">
+    <mkdir dir="${icons.output.dir}"/>
+    <javac2 destdir="${icons.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.icons}/bin/javac">
+      <compilerarg line="${compiler.args.icons}"/>
+      <bootclasspath refid="icons.module.bootclasspath"/>
+      <classpath refid="icons.module.classpath"/>
+      <src refid="icons.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.icons"/>
+    </javac2>
+    <copy todir="${icons.output.dir}">
+      <fileset dir="${module.icons.basedir}/icons/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.icons"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.icons.tests" depends="compile.module.icons.production" description="compile module icons test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.icons" description="cleanup module">
+    <delete dir="${icons.output.dir}"/>
+    <delete dir="${icons.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.jasper2.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.jasper2" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.jasper2" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.jasper2" value="${compiler.args}"/>
+  
+  <property name="jasper2.output.dir" value="${module.jasper2.basedir}/jasper2/classes"/>
+  <property name="jasper2.testoutput.dir" value="${module.jasper2.basedir}/jasper2/classes"/>
+  
+  <path id="jasper2.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="jasper2.module.classpath">
+    <path refid="${module.jdk.classpath.jasper2}"/>
+    <path refid="library.jasper2.classpath"/>
+    <path refid="library.ant.classpath"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.jasper2"/>
+  
+  <patternset id="excluded.from.compilation.jasper2">
+    <patternset refid="excluded.from.module.jasper2"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="jasper2.module.sourcepath">
+    <dirset dir="${module.jasper2.basedir}/jasper2">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.jasper2" depends="compile.module.jasper2.production,compile.module.jasper2.tests" description="compile module jasper2"/>
+  
+  <target name="compile.module.jasper2.production" description="compile module jasper2 production classes">
+    <mkdir dir="${jasper2.output.dir}"/>
+    <javac2 destdir="${jasper2.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.jasper2}/bin/javac">
+      <compilerarg line="${compiler.args.jasper2}"/>
+      <bootclasspath refid="jasper2.module.bootclasspath"/>
+      <classpath refid="jasper2.module.classpath"/>
+      <src refid="jasper2.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.jasper2"/>
+    </javac2>
+    <copy todir="${jasper2.output.dir}">
+      <fileset dir="${module.jasper2.basedir}/jasper2/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.jasper2"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.jasper2.tests" depends="compile.module.jasper2.production" description="compile module jasper2 test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.jasper2" description="cleanup module">
+    <delete dir="${jasper2.output.dir}"/>
+    <delete dir="${jasper2.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.license_common.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.license_common" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.license_common" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.license_common" value="${compiler.args}"/>
+  
+  <property name="license_common.output.dir" value="${module.license_common.basedir}/licenseCommon/classes"/>
+  <property name="license_common.testoutput.dir" value="${module.license_common.basedir}/licenseCommon/testClasses"/>
+  
+  <path id="license_common.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="license_common.module.classpath">
+    <path refid="${module.jdk.classpath.license_common}"/>
+    <path refid="library.jdom.classpath"/>
+    <path refid="library.junit.classpath"/>
+    <path refid="library.mocks.classpath"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.license_common"/>
+  
+  <patternset id="excluded.from.compilation.license_common">
+    <patternset refid="excluded.from.module.license_common"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="license_common.module.sourcepath">
+    <dirset dir="${module.license_common.basedir}/licenseCommon">
+      <include name="source"/>
+    </dirset>
+  </path>
+  
+  <path id="license_common.module.test.sourcepath">
+    <dirset dir="${module.license_common.basedir}/licenseCommon">
+      <include name="testSource"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.license_common" depends="compile.module.license_common.production,compile.module.license_common.tests" description="compile module license_common"/>
+  
+  <target name="compile.module.license_common.production" description="compile module license_common production classes">
+    <mkdir dir="${license_common.output.dir}"/>
+    <javac2 destdir="${license_common.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.license_common}/bin/javac">
+      <compilerarg line="${compiler.args.license_common}"/>
+      <bootclasspath refid="license_common.module.bootclasspath"/>
+      <classpath refid="license_common.module.classpath"/>
+      <src refid="license_common.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.license_common"/>
+    </javac2>
+    <copy todir="${license_common.output.dir}">
+      <fileset dir="${module.license_common.basedir}/licenseCommon/source">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.license_common"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.license_common.tests" depends="compile.module.license_common.production" description="compile module license_common test classes" unless="skip.tests">
+    <mkdir dir="${license_common.testoutput.dir}"/>
+    <javac2 destdir="${license_common.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.license_common}/bin/javac">
+      <compilerarg line="${compiler.args.license_common}"/>
+      <classpath refid="license_common.module.classpath"/>
+      <classpath location="${license_common.output.dir}"/>
+      <src refid="license_common.module.test.sourcepath"/>
+      <patternset refid="excluded.from.compilation.license_common"/>
+    </javac2>
+    <copy todir="${license_common.testoutput.dir}">
+      <fileset dir="${module.license_common.basedir}/licenseCommon/testSource">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.license_common"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="clean.module.license_common" description="cleanup module">
+    <delete dir="${license_common.output.dir}"/>
+    <delete dir="${license_common.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.pallada.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.pallada" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.pallada" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.pallada" value="${compiler.args}"/>
+  
+  <property name="pallada.output.dir" value="${module.pallada.basedir}/classes/main"/>
+  <property name="pallada.testoutput.dir" value="${module.pallada.basedir}/classes/test"/>
+  
+  <path id="pallada.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="pallada.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.pallada}"/>
+    <pathelement location="${module.pallada.basedir}/lib/xerces.jar"/>
+    <pathelement location="${idea_rt.output.dir}"/>
+    <pathelement location="${module.pallada.basedir}/lib/GLUE.jar"/>
+    <pathelement location="${module.pallada.basedir}/lib/jh.jar"/>
+    <pathelement location="${module.pallada.basedir}/lib/JNIWrap.jar"/>
+    <pathelement location="${module.pallada.basedir}/lib/xmlrpc-1.1.jar"/>
+    <pathelement location="${parsergen.output.dir}"/>
+    <pathelement location="${parsergen.testoutput.dir}"/>
+    <pathelement location="${license_common.output.dir}"/>
+    <pathelement location="${license_common.testoutput.dir}"/>
+    <pathelement location="${module.pallada.basedir}/lib/ui.jar"/>
+    <pathelement location="${module.pallada.basedir}/lib/JLmgr.jar"/>
+    <path refid="library.jdom.classpath"/>
+    <path refid="library.junit.classpath"/>
+    <path refid="library.ant.classpath"/>
+    <path refid="library.mocks.classpath"/>
+    <path refid="library.velocity.classpath"/>
+    <pathelement location="${util.output.dir}"/>
+    <path refid="library.bcel.classpath"/>
+    <path refid="library.log4j.classpath"/>
+    <pathelement location="${uidesignercore.output.dir}"/>
+    <pathelement location="${uidesignercore.testoutput.dir}"/>
+    <pathelement location="${openapi.output.dir}"/>
+    <pathelement location="${jasper2.output.dir}"/>
+    <pathelement location="${forms_rt.output.dir}"/>
+    <path refid="library.trove4j.classpath"/>
+    <path refid="library.servlets.classpath"/>
+    <pathelement location="${module.pallada.basedir}/lib/yjp-controller-api-redist.jar"/>
+    <pathelement location="${internalresources.output.dir}"/>
+    <pathelement location="${icons.output.dir}"/>
+    <pathelement location="${resources.output.dir}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.pallada"/>
+  
+  <patternset id="excluded.from.compilation.pallada">
+    <patternset refid="excluded.from.module.pallada"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="pallada.module.sourcepath">
+    <dirset dir="${module.pallada.basedir}">
+      <include name="rtaspectsource"/>
+      <include name="source"/>
+    </dirset>
+  </path>
+  
+  <path id="pallada.module.test.sourcepath">
+    <dirset dir="${module.pallada.basedir}">
+      <include name="testSource"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.pallada" depends="compile.module.pallada.production,compile.module.pallada.tests" description="compile module pallada"/>
+  
+  <target name="compile.module.pallada.production" depends="compile.module.idea_rt,compile.module.parsergen,compile.module.license_common,compile.module.util,compile.module.uidesignercore,compile.module.openapi,compile.module.jasper2,compile.module.forms_rt,compile.module.internalresources,compile.module.icons,compile.module.resources" description="compile module pallada production classes">
+    <mkdir dir="${pallada.output.dir}"/>
+    <javac2 destdir="${pallada.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.pallada}/bin/javac">
+      <compilerarg line="${compiler.args.pallada}"/>
+      <bootclasspath refid="pallada.module.bootclasspath"/>
+      <classpath refid="pallada.module.classpath"/>
+      <src refid="pallada.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.pallada"/>
+    </javac2>
+    <copy todir="${pallada.output.dir}">
+      <fileset dir="${module.pallada.basedir}/rtaspectsource">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.pallada"/>
+      </fileset>
+      <fileset dir="${module.pallada.basedir}/source">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.pallada"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.pallada.tests" depends="compile.module.pallada.production" description="compile module pallada test classes" unless="skip.tests">
+    <mkdir dir="${pallada.testoutput.dir}"/>
+    <javac2 destdir="${pallada.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.pallada}/bin/javac">
+      <compilerarg line="${compiler.args.pallada}"/>
+      <classpath refid="pallada.module.classpath"/>
+      <classpath location="${pallada.output.dir}"/>
+      <src refid="pallada.module.test.sourcepath"/>
+      <patternset refid="excluded.from.compilation.pallada"/>
+    </javac2>
+    <copy todir="${pallada.testoutput.dir}">
+      <fileset dir="${module.pallada.basedir}/testSource">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.pallada"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="clean.module.pallada" description="cleanup module">
+    <delete dir="${pallada.output.dir}"/>
+    <delete dir="${pallada.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.weblogictests.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.weblogictests" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.weblogictests" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.weblogictests" value="${compiler.args}"/>
+  
+  <property name="weblogictests.output.dir" value="${module.weblogictests.basedir}/plugins/weblogic/classes/testClasses"/>
+  <property name="weblogictests.testoutput.dir" value="${module.weblogictests.basedir}/plugins/weblogic/classes/testClasses"/>
+  
+  <path id="weblogictests.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="weblogictests.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.weblogictests}"/>
+    <pathelement location="${pallada.output.dir}"/>
+    <pathelement location="${pallada.testoutput.dir}"/>
+    <pathelement location="${openapi.output.dir}"/>
+    <pathelement location="${util.output.dir}"/>
+    <pathelement location="${weblogic.output.dir}"/>
+    <pathelement location="${forms_rt.output.dir}"/>
+    <pathelement location="${idea_rt.output.dir}"/>
+    <path refid="library.junit.classpath"/>
+    <path refid="library.jdom.classpath"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.weblogictests"/>
+  
+  <patternset id="excluded.from.compilation.weblogictests">
+    <patternset refid="excluded.from.module.weblogictests"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="weblogictests.module.test.sourcepath">
+    <dirset dir="${module.weblogictests.basedir}/plugins/weblogic">
+      <include name="testSource"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.weblogictests" depends="compile.module.weblogictests.production,compile.module.weblogictests.tests" description="compile module weblogicTests"/>
+  
+  <target name="compile.module.weblogictests.production" depends="compile.module.pallada,compile.module.openapi,compile.module.util,compile.module.weblogic,compile.module.forms_rt,compile.module.idea_rt" description="compile module weblogicTests production classes"/>
+  
+  <target name="compile.module.weblogictests.tests" depends="compile.module.weblogictests.production" description="compile module weblogicTests test classes" unless="skip.tests">
+    <mkdir dir="${weblogictests.testoutput.dir}"/>
+    <javac2 destdir="${weblogictests.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.weblogictests}/bin/javac">
+      <compilerarg line="${compiler.args.weblogictests}"/>
+      <classpath refid="weblogictests.module.classpath"/>
+      <classpath location="${weblogictests.output.dir}"/>
+      <src refid="weblogictests.module.test.sourcepath"/>
+      <patternset refid="excluded.from.compilation.weblogictests"/>
+    </javac2>
+    <copy todir="${weblogictests.testoutput.dir}">
+      <fileset dir="${module.weblogictests.basedir}/plugins/weblogic/testSource">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.weblogictests"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="clean.module.weblogictests" description="cleanup module">
+    <delete dir="${weblogictests.output.dir}"/>
+    <delete dir="${weblogictests.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.internalplugins.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.internalplugins" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.internalplugins" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.internalplugins" value="${compiler.args}"/>
+  
+  <property name="internalplugins.output.dir" value="${module.internalplugins.basedir}/internalPlugins/classes"/>
+  <property name="internalplugins.testoutput.dir" value="${module.internalplugins.basedir}/internalPlugins/testClasses"/>
+  
+  <path id="internalplugins.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="internalplugins.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.internalplugins}"/>
+    <pathelement location="${openapi.output.dir}"/>
+    <pathelement location="${util.output.dir}"/>
+    <pathelement location="${pallada.output.dir}"/>
+    <pathelement location="${pallada.testoutput.dir}"/>
+    <path refid="library.junit.classpath"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.internalplugins"/>
+  
+  <patternset id="excluded.from.compilation.internalplugins">
+    <patternset refid="excluded.from.module.internalplugins"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="internalplugins.module.sourcepath">
+    <dirset dir="${module.internalplugins.basedir}/plugins/comparingReferences">
+      <include name="source"/>
+    </dirset>
+    <dirset dir="${module.internalplugins.basedir}/plugins/conditionalOperatorConvertor">
+      <include name="source"/>
+    </dirset>
+    <dirset dir="${module.internalplugins.basedir}/plugins/performance">
+      <include name="source"/>
+    </dirset>
+  </path>
+  
+  <path id="internalplugins.module.test.sourcepath">
+    <dirset dir="${module.internalplugins.basedir}/plugins/conditionalOperatorConvertor">
+      <include name="testSrc"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.internalplugins" depends="compile.module.internalplugins.production,compile.module.internalplugins.tests" description="compile module internalPlugins"/>
+  
+  <target name="compile.module.internalplugins.production" depends="compile.module.openapi,compile.module.util,compile.module.pallada" description="compile module internalPlugins production classes">
+    <mkdir dir="${internalplugins.output.dir}"/>
+    <javac2 destdir="${internalplugins.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.internalplugins}/bin/javac">
+      <compilerarg line="${compiler.args.internalplugins}"/>
+      <bootclasspath refid="internalplugins.module.bootclasspath"/>
+      <classpath refid="internalplugins.module.classpath"/>
+      <src refid="internalplugins.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.internalplugins"/>
+    </javac2>
+    <copy todir="${internalplugins.output.dir}">
+      <fileset dir="${module.internalplugins.basedir}/plugins/comparingReferences/source">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.internalplugins"/>
+      </fileset>
+      <fileset dir="${module.internalplugins.basedir}/plugins/conditionalOperatorConvertor/source">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.internalplugins"/>
+      </fileset>
+      <fileset dir="${module.internalplugins.basedir}/plugins/performance/source">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.internalplugins"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.internalplugins.tests" depends="compile.module.internalplugins.production" description="compile module internalPlugins test classes" unless="skip.tests">
+    <mkdir dir="${internalplugins.testoutput.dir}"/>
+    <javac2 destdir="${internalplugins.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.internalplugins}/bin/javac">
+      <compilerarg line="${compiler.args.internalplugins}"/>
+      <classpath refid="internalplugins.module.classpath"/>
+      <classpath location="${internalplugins.output.dir}"/>
+      <src refid="internalplugins.module.test.sourcepath"/>
+      <patternset refid="excluded.from.compilation.internalplugins"/>
+    </javac2>
+    <copy todir="${internalplugins.testoutput.dir}">
+      <fileset dir="${module.internalplugins.basedir}/plugins/conditionalOperatorConvertor/testSrc">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.internalplugins"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="clean.module.internalplugins" description="cleanup module">
+    <delete dir="${internalplugins.output.dir}"/>
+    <delete dir="${internalplugins.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.structuralsearch.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.structuralsearch" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.structuralsearch" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.structuralsearch" value="${compiler.args}"/>
+  
+  <property name="structuralsearch.output.dir" value="${module.structuralsearch.basedir}/plugins/structuralsearch/classes"/>
+  <property name="structuralsearch.testoutput.dir" value="${module.structuralsearch.basedir}/plugins/structuralsearch/testClasses"/>
+  
+  <path id="structuralsearch.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="structuralsearch.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.structuralsearch}"/>
+    <pathelement location="${pallada.output.dir}"/>
+    <pathelement location="${pallada.testoutput.dir}"/>
+    <path refid="library.junit.classpath"/>
+    <pathelement location="${util.output.dir}"/>
+    <path refid="library.jdom.classpath"/>
+    <pathelement location="${openapi.output.dir}"/>
+    <path refid="library.trove4j.classpath"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.structuralsearch"/>
+  
+  <patternset id="excluded.from.compilation.structuralsearch">
+    <patternset refid="excluded.from.module.structuralsearch"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="structuralsearch.module.sourcepath">
+    <dirset dir="${module.structuralsearch.basedir}/plugins/structuralsearch">
+      <include name="source"/>
+    </dirset>
+  </path>
+  
+  <path id="structuralsearch.module.test.sourcepath">
+    <dirset dir="${module.structuralsearch.basedir}/plugins/structuralsearch">
+      <include name="testSource"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.structuralsearch" depends="compile.module.structuralsearch.production,compile.module.structuralsearch.tests" description="compile module structuralsearch"/>
+  
+  <target name="compile.module.structuralsearch.production" depends="compile.module.pallada,compile.module.util,compile.module.openapi" description="compile module structuralsearch production classes">
+    <mkdir dir="${structuralsearch.output.dir}"/>
+    <javac2 destdir="${structuralsearch.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.structuralsearch}/bin/javac">
+      <compilerarg line="${compiler.args.structuralsearch}"/>
+      <bootclasspath refid="structuralsearch.module.bootclasspath"/>
+      <classpath refid="structuralsearch.module.classpath"/>
+      <src refid="structuralsearch.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.structuralsearch"/>
+    </javac2>
+    <copy todir="${structuralsearch.output.dir}">
+      <fileset dir="${module.structuralsearch.basedir}/plugins/structuralsearch/source">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.structuralsearch"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.structuralsearch.tests" depends="compile.module.structuralsearch.production" description="compile module structuralsearch test classes" unless="skip.tests">
+    <mkdir dir="${structuralsearch.testoutput.dir}"/>
+    <javac2 destdir="${structuralsearch.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.structuralsearch}/bin/javac">
+      <compilerarg line="${compiler.args.structuralsearch}"/>
+      <classpath refid="structuralsearch.module.classpath"/>
+      <classpath location="${structuralsearch.output.dir}"/>
+      <src refid="structuralsearch.module.test.sourcepath"/>
+      <patternset refid="excluded.from.compilation.structuralsearch"/>
+    </javac2>
+    <copy todir="${structuralsearch.testoutput.dir}">
+      <fileset dir="${module.structuralsearch.basedir}/plugins/structuralsearch/testSource">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.structuralsearch"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="clean.module.structuralsearch" description="cleanup module">
+    <delete dir="${structuralsearch.output.dir}"/>
+    <delete dir="${structuralsearch.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.cc_special.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.cc_special" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.cc_special" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.cc_special" value="${compiler.args}"/>
+  
+  <property name="cc_special.output.dir" value="${module.cc_special.basedir}/cc_special/classes"/>
+  <property name="cc_special.testoutput.dir" value="${module.cc_special.basedir}/cc_special/classes"/>
+  
+  <path id="cc_special.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="cc_special.module.classpath">
+    <path refid="${module.jdk.classpath.cc_special}"/>
+    <pathelement location="${util.output.dir}"/>
+    <path refid="library.junit.classpath"/>
+    <pathelement location="${module.cc_special.basedir}/lib/optional.jar"/>
+    <path refid="library.ant.classpath"/>
+    <pathelement location="${pallada.output.dir}"/>
+    <pathelement location="${pallada.testoutput.dir}"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.cc_special"/>
+  
+  <patternset id="excluded.from.compilation.cc_special">
+    <patternset refid="excluded.from.module.cc_special"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="cc_special.module.sourcepath">
+    <dirset dir="${module.cc_special.basedir}/cc_special">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.cc_special" depends="compile.module.cc_special.production,compile.module.cc_special.tests" description="compile module cc_special"/>
+  
+  <target name="compile.module.cc_special.production" depends="compile.module.util,compile.module.pallada" description="compile module cc_special production classes">
+    <mkdir dir="${cc_special.output.dir}"/>
+    <javac2 destdir="${cc_special.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.cc_special}/bin/javac">
+      <compilerarg line="${compiler.args.cc_special}"/>
+      <bootclasspath refid="cc_special.module.bootclasspath"/>
+      <classpath refid="cc_special.module.classpath"/>
+      <src refid="cc_special.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.cc_special"/>
+    </javac2>
+    <copy todir="${cc_special.output.dir}">
+      <fileset dir="${module.cc_special.basedir}/cc_special/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.cc_special"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.cc_special.tests" depends="compile.module.cc_special.production" description="compile module cc_special test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.cc_special" description="cleanup module">
+    <delete dir="${cc_special.output.dir}"/>
+    <delete dir="${cc_special.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.cvs_support.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.cvs_support" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.cvs_support" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.cvs_support" value="${compiler.args}"/>
+  
+  <property name="cvs_support.output.dir" value="${module.cvs_support.basedir}/plugins/cvs2/classes"/>
+  <property name="cvs_support.testoutput.dir" value="${module.cvs_support.basedir}/plugins/cvs2/testClasses"/>
+  
+  <path id="cvs_support.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="cvs_support.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.cvs_support}"/>
+    <pathelement location="${pallada.output.dir}"/>
+    <pathelement location="${pallada.testoutput.dir}"/>
+    <path refid="library.jdom.classpath"/>
+    <path refid="library.junit.classpath"/>
+    <pathelement location="${util.output.dir}"/>
+    <pathelement location="${openapi.output.dir}"/>
+    <pathelement location="${forms_rt.output.dir}"/>
+    <pathelement location="${module.cvs_support.basedir}/plugins/cvs2/lib/sshtools-zlib.jar"/>
+    <pathelement location="${module.cvs_support.basedir}/plugins/cvs2/lib/maverick-ssh1.jar"/>
+    <pathelement location="${module.cvs_support.basedir}/plugins/cvs2/lib/sshtools-ant.jar"/>
+    <pathelement location="${module.cvs_support.basedir}/plugins/cvs2/lib/maverick-ssh2.jar"/>
+    <pathelement location="${module.cvs_support.basedir}/plugins/cvs2/lib/maverick-sftp.jar"/>
+    <pathelement location="${module.cvs_support.basedir}/plugins/cvs2/lib/sshtools-net.jar"/>
+    <pathelement location="${module.cvs_support.basedir}/plugins/cvs2/lib/sshtools-cipher.jar"/>
+    <pathelement location="${module.cvs_support.basedir}/plugins/cvs2/lib/maverick.jar"/>
+    <pathelement location="${module.cvs_support.basedir}/plugins/cvs2/lib/sshtools-scp.jar"/>
+    <pathelement location="${module.cvs_support.basedir}/plugins/cvs2/lib/sshtools-sftp.jar"/>
+    <pathelement location="${module.cvs_support.basedir}/plugins/cvs2/lib/sshtools-util.jar"/>
+    <pathelement location="${module.cvs_support.basedir}/plugins/cvs2/lib/sshtools-publickey.jar"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.cvs_support"/>
+  
+  <patternset id="excluded.from.compilation.cvs_support">
+    <patternset refid="excluded.from.module.cvs_support"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="cvs_support.module.sourcepath">
+    <dirset dir="${module.cvs_support.basedir}/plugins/cvs2">
+      <include name="javacvs-src"/>
+      <include name="maverick/examples"/>
+      <include name="maverick_utils"/>
+      <include name="smartcvs-src"/>
+      <include name="source"/>
+    </dirset>
+  </path>
+  
+  <path id="cvs_support.module.test.sourcepath">
+    <dirset dir="${module.cvs_support.basedir}/plugins/cvs2">
+      <include name="testSource"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.cvs_support" depends="compile.module.cvs_support.production,compile.module.cvs_support.tests" description="compile module cvs_support"/>
+  
+  <target name="compile.module.cvs_support.production" depends="compile.module.pallada,compile.module.util,compile.module.openapi,compile.module.forms_rt" description="compile module cvs_support production classes">
+    <mkdir dir="${cvs_support.output.dir}"/>
+    <javac2 destdir="${cvs_support.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.cvs_support}/bin/javac">
+      <compilerarg line="${compiler.args.cvs_support}"/>
+      <bootclasspath refid="cvs_support.module.bootclasspath"/>
+      <classpath refid="cvs_support.module.classpath"/>
+      <src refid="cvs_support.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.cvs_support"/>
+    </javac2>
+    <copy todir="${cvs_support.output.dir}">
+      <fileset dir="${module.cvs_support.basedir}/plugins/cvs2/javacvs-src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.cvs_support"/>
+      </fileset>
+      <fileset dir="${module.cvs_support.basedir}/plugins/cvs2/maverick/examples">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.cvs_support"/>
+      </fileset>
+      <fileset dir="${module.cvs_support.basedir}/plugins/cvs2/maverick_utils">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.cvs_support"/>
+      </fileset>
+      <fileset dir="${module.cvs_support.basedir}/plugins/cvs2/smartcvs-src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.cvs_support"/>
+      </fileset>
+      <fileset dir="${module.cvs_support.basedir}/plugins/cvs2/source">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.cvs_support"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.cvs_support.tests" depends="compile.module.cvs_support.production" description="compile module cvs_support test classes" unless="skip.tests">
+    <mkdir dir="${cvs_support.testoutput.dir}"/>
+    <javac2 destdir="${cvs_support.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.cvs_support}/bin/javac">
+      <compilerarg line="${compiler.args.cvs_support}"/>
+      <classpath refid="cvs_support.module.classpath"/>
+      <classpath location="${cvs_support.output.dir}"/>
+      <src refid="cvs_support.module.test.sourcepath"/>
+      <patternset refid="excluded.from.compilation.cvs_support"/>
+    </javac2>
+    <copy todir="${cvs_support.testoutput.dir}">
+      <fileset dir="${module.cvs_support.basedir}/plugins/cvs2/testSource">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.cvs_support"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="clean.module.cvs_support" description="cleanup module">
+    <delete dir="${cvs_support.output.dir}"/>
+    <delete dir="${cvs_support.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.license_server.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.license_server" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.license_server" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.license_server" value="${compiler.args}"/>
+  
+  <property name="license_server.output.dir" value="${module.license_server.basedir}/licenseServer/classes"/>
+  <property name="license_server.testoutput.dir" value="${module.license_server.basedir}/licenseServer/testClasses"/>
+  
+  <path id="license_server.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="license_server.module.classpath">
+    <path refid="${module.jdk.classpath.license_server}"/>
+    <pathelement location="${license_common.output.dir}"/>
+    <pathelement location="${license_common.testoutput.dir}"/>
+    <path refid="library.jdom.classpath"/>
+    <path refid="library.junit.classpath"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.license_server"/>
+  
+  <patternset id="excluded.from.compilation.license_server">
+    <patternset refid="excluded.from.module.license_server"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  <path id="license_server.module.sourcepath">
+    <dirset dir="${module.license_server.basedir}/licenseServer">
+      <include name="source"/>
+    </dirset>
+  </path>
+  
+  <path id="license_server.module.test.sourcepath">
+    <dirset dir="${module.license_server.basedir}/licenseServer">
+      <include name="testSource"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.license_server" depends="compile.module.license_server.production,compile.module.license_server.tests" description="compile module license_server"/>
+  
+  <target name="compile.module.license_server.production" depends="compile.module.license_common" description="compile module license_server production classes">
+    <mkdir dir="${license_server.output.dir}"/>
+    <javac2 destdir="${license_server.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.license_server}/bin/javac">
+      <compilerarg line="${compiler.args.license_server}"/>
+      <bootclasspath refid="license_server.module.bootclasspath"/>
+      <classpath refid="license_server.module.classpath"/>
+      <src refid="license_server.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.license_server"/>
+    </javac2>
+    <copy todir="${license_server.output.dir}">
+      <fileset dir="${module.license_server.basedir}/licenseServer/source">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.license_server"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.license_server.tests" depends="compile.module.license_server.production" description="compile module license_server test classes" unless="skip.tests">
+    <mkdir dir="${license_server.testoutput.dir}"/>
+    <javac2 destdir="${license_server.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" fork="true" executable="${module.jdk.home.license_server}/bin/javac">
+      <compilerarg line="${compiler.args.license_server}"/>
+      <classpath refid="license_server.module.classpath"/>
+      <classpath location="${license_server.output.dir}"/>
+      <src refid="license_server.module.test.sourcepath"/>
+      <patternset refid="excluded.from.compilation.license_server"/>
+    </javac2>
+    <copy todir="${license_server.testoutput.dir}">
+      <fileset dir="${module.license_server.basedir}/licenseServer/testSource">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+        <patternset refid="excluded.from.compilation.license_server"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="clean.module.license_server" description="cleanup module">
+    <delete dir="${license_server.output.dir}"/>
+    <delete dir="${license_server.testoutput.dir}"/>
+  </target>
+  
+  
+  <dirname property="module.main.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.main" value="${project.jdk.home}"/>
+  <property name="module.jdk.classpath.main" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.main" value="${compiler.args}"/>
+  
+  <property name="main.output.dir" value="undefined"/>
+  <property name="main.testoutput.dir" value="undefined"/>
+  
+  <path id="main.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="main.module.classpath">
+    <path refid="library.generic_collections.classpath"/>
+    <path refid="${module.jdk.classpath.main}"/>
+    <pathelement location="${pallada.output.dir}"/>
+    <pathelement location="${pallada.testoutput.dir}"/>
+    <pathelement location="${cvs_support.output.dir}"/>
+    <pathelement location="${cvs_support.testoutput.dir}"/>
+    <pathelement location="${forms_rt.output.dir}"/>
+    <pathelement location="${idea_rt.output.dir}"/>
+    <pathelement location="${jasper2.output.dir}"/>
+    <pathelement location="${javac2.output.dir}"/>
+    <pathelement location="${jsr45debug.output.dir}"/>
+    <pathelement location="${jsr45debug.testoutput.dir}"/>
+    <pathelement location="${license_common.output.dir}"/>
+    <pathelement location="${license_common.testoutput.dir}"/>
+    <pathelement location="${license_server.output.dir}"/>
+    <pathelement location="${license_server.testoutput.dir}"/>
+    <pathelement location="${openapi.output.dir}"/>
+    <pathelement location="${parsergen.output.dir}"/>
+    <pathelement location="${parsergen.testoutput.dir}"/>
+    <pathelement location="${starteamintegration.output.dir}"/>
+    <pathelement location="${structuralsearch.output.dir}"/>
+    <pathelement location="${structuralsearch.testoutput.dir}"/>
+    <pathelement location="${tomcatintegration.output.dir}"/>
+    <pathelement location="${tomcatintegration.testoutput.dir}"/>
+    <pathelement location="${uidesignercore.output.dir}"/>
+    <pathelement location="${uidesignercore.testoutput.dir}"/>
+    <pathelement location="${util.output.dir}"/>
+    <pathelement location="${weblogic.output.dir}"/>
+    <pathelement location="${inspectiongadgetsplugin.output.dir}"/>
+    <pathelement location="${intentionpowerpackplugin.output.dir}"/>
+    <pathelement location="${icons.output.dir}"/>
+    <pathelement location="${internalplugins.output.dir}"/>
+    <pathelement location="${internalplugins.testoutput.dir}"/>
+    <pathelement location="${internalresources.output.dir}"/>
+    <pathelement location="${resources.output.dir}"/>
+    <pathelement location="${samples.output.dir}"/>
+    <pathelement location="${weblogicwrapper.output.dir}"/>
+    <pathelement location="${weblogicwrapperimpl.output.dir}"/>
+    <path refid="library.junit.classpath"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.main"/>
+  
+  <patternset id="excluded.from.compilation.main">
+    <patternset refid="excluded.from.module.main"/>
+    <patternset refid="compiler.excluded"/>
+  </patternset>
+  
+  
+  <target name="compile.module.main" depends="compile.module.main.production,compile.module.main.tests" description="compile module main"/>
+  
+  <target name="compile.module.main.production" depends="compile.module.pallada,compile.module.cvs_support,compile.module.forms_rt,compile.module.idea_rt,compile.module.jasper2,compile.module.javac2,compile.module.jsr45debug,compile.module.license_common,compile.module.license_server,compile.module.openapi,compile.module.parsergen,compile.module.starteamintegration,compile.module.structuralsearch,compile.module.tomcatintegration,compile.module.uidesignercore,compile.module.util,compile.module.weblogic,compile.module.inspectiongadgetsplugin,compile.module.intentionpowerpackplugin,compile.module.icons,compile.module.internalplugins,compile.module.internalresources,compile.module.resources,compile.module.samples,compile.module.weblogicwrapper,compile.module.weblogicwrapperimpl" description="compile module main production classes"/>
+  
+  <target name="compile.module.main.tests" depends="compile.module.main.production" description="compile module main test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.main" description="cleanup module">
+    <delete dir="${main.output.dir}"/>
+    <delete dir="${main.testoutput.dir}"/>
+  </target>
+  
+  <target name="init" description="Build initialization">
+    <!-- Perform any build initialization in this target -->
+  </target>
+  
+  <target name="clean" depends="clean.module.license_server, clean.module.cc_special, clean.module.openapi, clean.module.tomcatintegration, clean.module.jasper2, clean.module.cvs_support, clean.module.weblogic, clean.module.parsergen, clean.module.weblogicwrapperimpl, clean.module.icons, clean.module.jsr45debug, clean.module.intentionpowerpackplugin, clean.module.internalplugins, clean.module.starteamintegration, clean.module.license_common, clean.module.inspectiongadgetsplugin, clean.module.javac2, clean.module.forms_rt, clean.module.structuralsearch, clean.module.internalresources, clean.module.util, clean.module.samples, clean.module.weblogictests, clean.module.resources, clean.module.idea_rt, clean.module.uidesignercore, clean.module.pallada, clean.module.weblogicwrapper, clean.module.main" description="cleanup all"/>
+  
+  <target name="all" depends="init, clean, compile.module.internalresources, compile.module.forms_rt, compile.module.uidesignercore, compile.module.javac2, compile.module.idea_rt, compile.module.weblogicwrapper, compile.module.weblogicwrapperimpl, compile.module.resources, compile.module.util, compile.module.parsergen, compile.module.openapi, compile.module.weblogic, compile.module.jsr45debug, compile.module.tomcatintegration, compile.module.starteamintegration, compile.module.samples, compile.module.inspectiongadgetsplugin, compile.module.intentionpowerpackplugin, compile.module.icons, compile.module.jasper2, compile.module.license_common, compile.module.pallada, compile.module.weblogictests, compile.module.internalplugins, compile.module.structuralsearch, compile.module.cc_special, compile.module.cvs_support, compile.module.license_server, compile.module.main" description="build all"/>
+</project>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/performance2.xml b/xml/tests/testData/psi/performance2.xml
new file mode 100644
index 0000000..ce115f8
--- /dev/null
+++ b/xml/tests/testData/psi/performance2.xml
@@ -0,0 +1,7931 @@
+<root type="com.ubsw.eq.dm.mercury.app.MercurySpec">
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+    </entries>
+  </_xmlProperties>
+</root>
diff --git a/xml/tests/testData/psi/test1.xml b/xml/tests/testData/psi/test1.xml
new file mode 100644
index 0000000..9003851
--- /dev/null
+++ b/xml/tests/testData/psi/test1.xml
@@ -0,0 +1,145 @@
+<root type="com.ubsw.eq.dm.mercury.app.MercurySpec">
+  <_xmlProperties type="java.util.HashMap">
+    <entries type="com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]">
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">DSApplication</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Mercury</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">DSEnvironment</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Mercury/ExtIDCleanUp</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">DSLocation</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">london</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">DSLanguage</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Java</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">outputOperationList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">Objects_InTransaction</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">Commit</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">LogFolder</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReportFileDir</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludedInstrumentListPath</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeRefSymList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ExcludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">?:AUTO-NonMarking</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">IncludeMarkingRunList</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve"></value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InsertDataFromEDS</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">True</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">InstrumentType</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">com.swissbank.eq.foundation.instruments.Stock</value>
+        </value>
+      </element>
+
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">ReadDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+      <element>
+        <key type="java.lang.String">
+          <value type="string" xml:space="preserve">WriteDataSource</value>
+        </key>
+        <value type="java.lang.String">
+          <value type="string" xml:space="preserve">eq=syb/schi6083dsy.chi.swissbank.com/9997/grCBEuro_EnA/grAppUser/a1rf0rce</value>
+        </value>
+      </element>
+
+
+    </entries>
+  </_xmlProperties>
+</root>
diff --git a/xml/tests/testData/psi/testAttlist1.txt b/xml/tests/testData/psi/testAttlist1.txt
new file mode 100644
index 0000000..04ec4f6
--- /dev/null
+++ b/xml/tests/testData/psi/testAttlist1.txt
@@ -0,0 +1,23 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ATTLIST_DECL)
+      XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('termdef')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_DECL)
+        XmlToken:XML_NAME('id')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('ID')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_ATT_REQUIRED('#REQUIRED')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_DECL)
+        XmlToken:XML_NAME('name')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('CDATA')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_ATT_IMPLIED('#IMPLIED')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testAttlist2.txt b/xml/tests/testData/psi/testAttlist2.txt
new file mode 100644
index 0000000..10d0e28
--- /dev/null
+++ b/xml/tests/testData/psi/testAttlist2.txt
@@ -0,0 +1,26 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ATTLIST_DECL)
+      XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('termdef')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_DECL)
+        XmlToken:XML_NAME('type')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ENUMERATED_TYPE)
+          XmlToken:XML_LEFT_PAREN('(')
+          XmlToken:XML_NAME('bullets')
+          XmlToken:XML_BAR('|')
+          XmlToken:XML_NAME('ordered')
+          XmlToken:XML_BAR('|')
+          XmlToken:XML_NAME('glossary')
+          XmlToken:XML_RIGHT_PAREN(')')
+        PsiWhiteSpace('  ')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('ordered')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testAttlist3.txt b/xml/tests/testData/psi/testAttlist3.txt
new file mode 100644
index 0000000..a89d152
--- /dev/null
+++ b/xml/tests/testData/psi/testAttlist3.txt
@@ -0,0 +1,21 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ATTLIST_DECL)
+      XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('termdef')
+      PsiWhiteSpace('  ')
+      PsiElement(XML_ATTRIBUTE_DECL)
+        XmlToken:XML_NAME('method')
+        PsiWhiteSpace('  ')
+        XmlToken:XML_NAME('CDATA')
+        PsiWhiteSpace('   ')
+        XmlToken:XML_ATT_FIXED('#FIXED')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('POST')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testAttlist4.txt b/xml/tests/testData/psi/testAttlist4.txt
new file mode 100644
index 0000000..7aed212
--- /dev/null
+++ b/xml/tests/testData/psi/testAttlist4.txt
@@ -0,0 +1,20 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ATTLIST_DECL)
+      XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('termdef')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_DECL)
+        XmlToken:XML_NAME('default-charset')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ENTITY_REF)
+          XmlToken:XML_ENTITY_REF_TOKEN('%CHARSET;')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('iso-8859-1')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testAttributes1.txt b/xml/tests/testData/psi/testAttributes1.txt
new file mode 100644
index 0000000..eab9943
--- /dev/null
+++ b/xml/tests/testData/psi/testAttributes1.txt
@@ -0,0 +1,27 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('att1')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER(''')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('val1')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER(''')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('att2')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('val2')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testAttributes2.txt b/xml/tests/testData/psi/testAttributes2.txt
new file mode 100644
index 0000000..3d9e35c
--- /dev/null
+++ b/xml/tests/testData/psi/testAttributes2.txt
@@ -0,0 +1,30 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('c')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace(' ')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testAttributes3.txt b/xml/tests/testData/psi/testAttributes3.txt
new file mode 100644
index 0000000..7697a99
--- /dev/null
+++ b/xml/tests/testData/psi/testAttributes3.txt
@@ -0,0 +1,31 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('c')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('a, b, c')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace(' ')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testAttributes4.txt b/xml/tests/testData/psi/testAttributes4.txt
new file mode 100644
index 0000000..96095b9
--- /dev/null
+++ b/xml/tests/testData/psi/testAttributes4.txt
@@ -0,0 +1,31 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('c')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('a  b')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace(' ')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testAttributes5.txt b/xml/tests/testData/psi/testAttributes5.txt
new file mode 100644
index 0000000..0f477d6
--- /dev/null
+++ b/xml/tests/testData/psi/testAttributes5.txt
@@ -0,0 +1,37 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('c')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('a')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('d')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace(' ')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testCdata1.txt b/xml/tests/testData/psi/testCdata1.txt
new file mode 100644
index 0000000..cb1f5b7
--- /dev/null
+++ b/xml/tests/testData/psi/testCdata1.txt
@@ -0,0 +1,16 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiElement(XML_CDATA)
+          XmlToken:XML_CDATA_START('<![CDATA[')
+          XmlToken:XML_DATA_CHARACTERS('<greeting>Hello, world!</greeting>')
+          XmlToken:XML_CDATA_END(']]>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testCdata2.txt b/xml/tests/testData/psi/testCdata2.txt
new file mode 100644
index 0000000..ea41da7
--- /dev/null
+++ b/xml/tests/testData/psi/testCdata2.txt
@@ -0,0 +1,16 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiElement(XML_CDATA)
+          XmlToken:XML_CDATA_START('<![CDATA[')
+          XmlToken:XML_DATA_CHARACTERS('someData <!--</greeting>--> more data')
+          XmlToken:XML_CDATA_END(']]>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testCharRef1.txt b/xml/tests/testData/psi/testCharRef1.txt
new file mode 100644
index 0000000..7204f58
--- /dev/null
+++ b/xml/tests/testData/psi/testCharRef1.txt
@@ -0,0 +1,13 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        XmlToken:XML_CHAR_ENTITY_REF('&#123;')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testCharRef2.txt b/xml/tests/testData/psi/testCharRef2.txt
new file mode 100644
index 0000000..5844bc3
--- /dev/null
+++ b/xml/tests/testData/psi/testCharRef2.txt
@@ -0,0 +1,13 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        XmlToken:XML_CHAR_ENTITY_REF('&#x123;')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testCharRef3.txt b/xml/tests/testData/psi/testCharRef3.txt
new file mode 100644
index 0000000..b0bd39d
--- /dev/null
+++ b/xml/tests/testData/psi/testCharRef3.txt
@@ -0,0 +1,9 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiErrorElement:Top level element is not completed
+      XmlToken:XML_CHAR_ENTITY_REF('&#123;')
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testCharRef4.txt b/xml/tests/testData/psi/testCharRef4.txt
new file mode 100644
index 0000000..213207c
--- /dev/null
+++ b/xml/tests/testData/psi/testCharRef4.txt
@@ -0,0 +1,9 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiErrorElement:Top level element is not completed
+      XmlToken:XML_CHAR_ENTITY_REF('&#xaBcD123;')
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testCharRef5.txt b/xml/tests/testData/psi/testCharRef5.txt
new file mode 100644
index 0000000..0e10d13
--- /dev/null
+++ b/xml/tests/testData/psi/testCharRef5.txt
@@ -0,0 +1,17 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('attr')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('abc')
+          XmlToken:XML_CHAR_ENTITY_REF('&#123;')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_EMPTY_ELEMENT_END('/>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testCharacters1.txt b/xml/tests/testData/psi/testCharacters1.txt
new file mode 100644
index 0000000..f83325c
--- /dev/null
+++ b/xml/tests/testData/psi/testCharacters1.txt
@@ -0,0 +1,15 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        XmlToken:XML_DATA_CHARACTERS('someChar')
+        PsiWhiteSpace('\n')
+        XmlToken:XML_DATA_CHARACTERS('Data')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testComment1.txt b/xml/tests/testData/psi/testComment1.txt
new file mode 100644
index 0000000..c41382d
--- /dev/null
+++ b/xml/tests/testData/psi/testComment1.txt
@@ -0,0 +1,11 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_COMMENT)
+      XmlToken:XML_COMMENT_START('<!--')
+      XmlToken:XML_COMMENT_CHARACTERS(' declarations for <head> & <body> ')
+      XmlToken:XML_COMMENT_END('-->')
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testComment2.txt b/xml/tests/testData/psi/testComment2.txt
new file mode 100644
index 0000000..e44ec78
--- /dev/null
+++ b/xml/tests/testData/psi/testComment2.txt
@@ -0,0 +1,32 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('data-sources')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        PsiElement(XML_ELEMENT_CONTENT_GROUP)
+          XmlToken:XML_LEFT_PAREN('(')
+          XmlToken:XML_PCDATA('#PCDATA')
+          XmlToken:XML_RIGHT_PAREN(')')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace(' ')
+    PsiElement(XML_COMMENT)
+      XmlToken:XML_COMMENT_START('<!--')
+      XmlToken:XML_COMMENT_CHARACTERS(' abc ')
+      XmlToken:XML_COMMENT_END('-->')
+    PsiWhiteSpace(' ')
+    PsiElement(XML_ATTLIST_DECL)
+      XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('data-sources')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_DECL)
+        XmlToken:XML_NAME('path')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('CDATA')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_ATT_IMPLIED('#IMPLIED')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testComment3.txt b/xml/tests/testData/psi/testComment3.txt
new file mode 100644
index 0000000..774d308
--- /dev/null
+++ b/xml/tests/testData/psi/testComment3.txt
@@ -0,0 +1,15 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      PsiElement(XML_COMMENT)
+        XmlToken:XML_COMMENT_START('<!--')
+        XmlToken:XML_COMMENT_CHARACTERS('<b>')
+        XmlToken:XML_COMMENT_END('-->')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testConditionalSection1.txt b/xml/tests/testData/psi/testConditionalSection1.txt
new file mode 100644
index 0000000..3d53837
--- /dev/null
+++ b/xml/tests/testData/psi/testConditionalSection1.txt
@@ -0,0 +1,21 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_CONDITIONAL_SECTION)
+      XmlToken:XML_CONDITIONAL_SECTION_START('<![')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_CONDITIONAL_INCLUDE('INCLUDE')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_MARKUP_START('[')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_DECL)
+        XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('data-sources')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ELEMENT_CONTENT_SPEC)
+          XmlToken:XML_CONTENT_ANY('ANY')
+        XmlToken:XML_TAG_END('>')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_CONDITIONAL_SECTION_END(']]>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testConditionalSection2.txt b/xml/tests/testData/psi/testConditionalSection2.txt
new file mode 100644
index 0000000..ad6c661
--- /dev/null
+++ b/xml/tests/testData/psi/testConditionalSection2.txt
@@ -0,0 +1,33 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_CONDITIONAL_SECTION)
+      XmlToken:XML_CONDITIONAL_SECTION_START('<![')
+      PsiElement(XML_ENTITY_REF)
+        XmlToken:XML_ENTITY_REF_TOKEN('%sgml.features;')
+      XmlToken:XML_MARKUP_START('[')
+      PsiWhiteSpace('\n')
+      PsiElement(XML_CONDITIONAL_SECTION)
+        XmlToken:XML_CONDITIONAL_SECTION_START('<![')
+        XmlToken:XML_CONDITIONAL_IGNORE('IGNORE')
+        XmlToken:XML_MARKUP_START('[')
+        PsiWhiteSpace('\n')
+        PsiElement(XML_ENTITY_DECL)
+          XmlToken:XML_ENTITY_DECL_START('<!ENTITY')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_PERCENT('%')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_NAME('dbgenent')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DOCTYPE_SYSTEM('SYSTEM')
+          PsiWhiteSpace(' ')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('http://www.oasis-open.org/docbook/xml/configerror.txt')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+          XmlToken:XML_TAG_END('>')
+        PsiWhiteSpace('\n')
+        XmlToken:XML_CONDITIONAL_SECTION_END(']]>')
+      PsiWhiteSpace('\n')
+      XmlToken:XML_CONDITIONAL_SECTION_END(']]>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testConditionalSection3.txt b/xml/tests/testData/psi/testConditionalSection3.txt
new file mode 100644
index 0000000..73d3cab
--- /dev/null
+++ b/xml/tests/testData/psi/testConditionalSection3.txt
@@ -0,0 +1,49 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ENTITY_DECL)
+      XmlToken:XML_ENTITY_DECL_START('<!ENTITY')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_PERCENT('%')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('dbhier.module')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_VALUE)
+        XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('INCLUDE')
+        XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace('\n')
+    PsiElement(XML_CONDITIONAL_SECTION)
+      XmlToken:XML_CONDITIONAL_SECTION_START('<![')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ENTITY_REF)
+        XmlToken:XML_ENTITY_REF_TOKEN('%dbhier.module;')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_MARKUP_START('[')
+      PsiWhiteSpace('\n')
+      PsiElement(XML_ENTITY_DECL)
+        XmlToken:XML_ENTITY_DECL_START('<!ENTITY')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_PERCENT('%')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('dbhier')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DOCTYPE_PUBLIC('PUBLIC')
+        PsiWhiteSpace('\n')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('-//OASIS//ELEMENTS DocBook Document Hierarchy V4.4//EN')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace('\n')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('dbhierx.mod')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_TAG_END('>')
+      PsiWhiteSpace('\n')
+      PsiElement(XML_ENTITY_REF)
+        XmlToken:XML_ENTITY_REF_TOKEN('%dbhier;')
+      PsiWhiteSpace('\n')
+      XmlToken:XML_CONDITIONAL_SECTION_END(']]>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testContent1.txt b/xml/tests/testData/psi/testContent1.txt
new file mode 100644
index 0000000..af7e9d7
--- /dev/null
+++ b/xml/tests/testData/psi/testContent1.txt
@@ -0,0 +1,15 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('   \n')
+        XmlToken:XML_DATA_CHARACTERS('xxx')
+        PsiWhiteSpace('   \n')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testCustomMimeType.txt b/xml/tests/testData/psi/testCustomMimeType.txt
new file mode 100644
index 0000000..e4f4e61
--- /dev/null
+++ b/xml/tests/testData/psi/testCustomMimeType.txt
@@ -0,0 +1,21 @@
+HtmlFile:test.html
+  PsiElement(HTML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    HtmlTag:script
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('script')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('type')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('application/custom')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiElement(MyElementType)('Custom Script')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('script')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testDoctype1.txt b/xml/tests/testData/psi/testDoctype1.txt
new file mode 100644
index 0000000..4987170
--- /dev/null
+++ b/xml/tests/testData/psi/testDoctype1.txt
@@ -0,0 +1,15 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('greeting')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DOCTYPE_SYSTEM('SYSTEM')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('"hello.dtd"')
+        XmlToken:XML_DOCTYPE_END('>')
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testDoctype2.txt b/xml/tests/testData/psi/testDoctype2.txt
new file mode 100644
index 0000000..bede324
--- /dev/null
+++ b/xml/tests/testData/psi/testDoctype2.txt
@@ -0,0 +1,17 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('toc')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DOCTYPE_PUBLIC('PUBLIC')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('"-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 1.0//EN"')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('"http://java.sun.com/products/javahelp/toc_1_0.dtd"')
+        XmlToken:XML_DOCTYPE_END('>')
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testDoctype3.txt b/xml/tests/testData/psi/testDoctype3.txt
new file mode 100644
index 0000000..07484c6
--- /dev/null
+++ b/xml/tests/testData/psi/testDoctype3.txt
@@ -0,0 +1,26 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('greeting')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_MARKUP_DECL)
+          XmlToken:XML_MARKUP_START('[')
+          PsiElement(XML_ELEMENT_DECL)
+            XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_NAME('greeting')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ELEMENT_CONTENT_SPEC)
+              PsiElement(XML_ELEMENT_CONTENT_GROUP)
+                XmlToken:XML_LEFT_PAREN('(')
+                XmlToken:XML_PCDATA('#PCDATA')
+                XmlToken:XML_RIGHT_PAREN(')')
+            XmlToken:XML_TAG_END('>')
+          XmlToken:XML_MARKUP_END(']')
+        XmlToken:XML_DOCTYPE_END('>')
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testDoctype4.txt b/xml/tests/testData/psi/testDoctype4.txt
new file mode 100644
index 0000000..781699f
--- /dev/null
+++ b/xml/tests/testData/psi/testDoctype4.txt
@@ -0,0 +1,23 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('greeting')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_MARKUP_DECL)
+          XmlToken:XML_MARKUP_START('[')
+          PsiElement(XML_ELEMENT_DECL)
+            XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_NAME('br')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ELEMENT_CONTENT_SPEC)
+              XmlToken:XML_CONTENT_EMPTY('EMPTY')
+            XmlToken:XML_TAG_END('>')
+          XmlToken:XML_MARKUP_END(']')
+        XmlToken:XML_DOCTYPE_END('>')
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testDoctype5.txt b/xml/tests/testData/psi/testDoctype5.txt
new file mode 100644
index 0000000..5872e1c
--- /dev/null
+++ b/xml/tests/testData/psi/testDoctype5.txt
@@ -0,0 +1,37 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('greeting')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_MARKUP_DECL)
+          XmlToken:XML_MARKUP_START('[')
+          PsiElement(XML_ELEMENT_DECL)
+            XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_NAME('p')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ELEMENT_CONTENT_SPEC)
+              PsiElement(XML_ELEMENT_CONTENT_GROUP)
+                XmlToken:XML_LEFT_PAREN('(')
+                XmlToken:XML_PCDATA('#PCDATA')
+                XmlToken:XML_BAR('|')
+                XmlToken:XML_NAME('a')
+                XmlToken:XML_BAR('|')
+                XmlToken:XML_NAME('ul')
+                XmlToken:XML_BAR('|')
+                XmlToken:XML_NAME('b')
+                XmlToken:XML_BAR('|')
+                XmlToken:XML_NAME('i')
+                XmlToken:XML_BAR('|')
+                XmlToken:XML_NAME('em')
+                XmlToken:XML_RIGHT_PAREN(')')
+              XmlToken:XML_STAR('*')
+            XmlToken:XML_TAG_END('>')
+          XmlToken:XML_MARKUP_END(']')
+        XmlToken:XML_DOCTYPE_END('>')
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testDoctype6.txt b/xml/tests/testData/psi/testDoctype6.txt
new file mode 100644
index 0000000..faa8458
--- /dev/null
+++ b/xml/tests/testData/psi/testDoctype6.txt
@@ -0,0 +1,26 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('greeting')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_MARKUP_DECL)
+          XmlToken:XML_MARKUP_START('[')
+          PsiElement(XML_ELEMENT_DECL)
+            XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ENTITY_REF)
+              XmlToken:XML_ENTITY_REF_TOKEN('%name.para;')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ELEMENT_CONTENT_SPEC)
+              PsiElement(XML_ENTITY_REF)
+                XmlToken:XML_ENTITY_REF_TOKEN('%content.para;')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_TAG_END('>')
+          XmlToken:XML_MARKUP_END(']')
+        XmlToken:XML_DOCTYPE_END('>')
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testDoctype7.txt b/xml/tests/testData/psi/testDoctype7.txt
new file mode 100644
index 0000000..af96496
--- /dev/null
+++ b/xml/tests/testData/psi/testDoctype7.txt
@@ -0,0 +1,38 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_PROCESSING_INSTRUCTION)
+        XmlToken:XML_PI_START('<?')
+        XmlToken:XML_NAME('xml')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('version')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER(''')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('1.0')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER(''')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('encoding')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER(''')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('ISO-8859-1')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER(''')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_PI_END('?>')
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('toc')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DOCTYPE_SYSTEM('SYSTEM')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN(''dtds/ejb-jar_2_0.dtd'')
+        XmlToken:XML_DOCTYPE_END('>')
+    XmlTag:test
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('test')
+      XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('test')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testDtd1.txt b/xml/tests/testData/psi/testDtd1.txt
new file mode 100644
index 0000000..1506a7a
--- /dev/null
+++ b/xml/tests/testData/psi/testDtd1.txt
@@ -0,0 +1,28 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('data-sources')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        PsiElement(XML_ELEMENT_CONTENT_GROUP)
+          XmlToken:XML_LEFT_PAREN('(')
+          XmlToken:XML_PCDATA('#PCDATA')
+          XmlToken:XML_RIGHT_PAREN(')')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace(' ')
+    PsiElement(XML_ATTLIST_DECL)
+      XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('data-sources')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_DECL)
+        XmlToken:XML_NAME('path')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('CDATA')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_ATT_IMPLIED('#IMPLIED')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEditing1.txt b/xml/tests/testData/psi/testEditing1.txt
new file mode 100644
index 0000000..b59606a
--- /dev/null
+++ b/xml/tests/testData/psi/testEditing1.txt
@@ -0,0 +1,16 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:
+      XmlToken:XML_START_TAG_START('<')
+      PsiErrorElement:Tag name expected
+        <empty list>
+    XmlTag:a
+      PsiErrorElement:Multiple root tags
+        XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEditing2.txt b/xml/tests/testData/psi/testEditing2.txt
new file mode 100644
index 0000000..4515e58
--- /dev/null
+++ b/xml/tests/testData/psi/testEditing2.txt
@@ -0,0 +1,26 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_EMPTY_ELEMENT_END('/>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlTag:
+        XmlToken:XML_START_TAG_START('<')
+        PsiErrorElement:Tag name expected
+          <empty list>
+      PsiWhiteSpace(' ')
+      XmlTag:c
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('c')
+        XmlToken:XML_EMPTY_ELEMENT_END('/>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEditing3.txt b/xml/tests/testData/psi/testEditing3.txt
new file mode 100644
index 0000000..0a25d49
--- /dev/null
+++ b/xml/tests/testData/psi/testEditing3.txt
@@ -0,0 +1,21 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        PsiErrorElement:Tag start is not closed
+          <empty list>
+      PsiWhiteSpace(' ')
+      XmlTag:c
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('c')
+        XmlToken:XML_EMPTY_ELEMENT_END('/>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEditing4.txt b/xml/tests/testData/psi/testEditing4.txt
new file mode 100644
index 0000000..e52d634
--- /dev/null
+++ b/xml/tests/testData/psi/testEditing4.txt
@@ -0,0 +1,26 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element b is not closed
+          <empty list>
+      XmlTag:
+        XmlToken:XML_START_TAG_START('<')
+        PsiErrorElement:Tag name expected
+          <empty list>
+      PsiWhiteSpace(' ')
+      XmlTag:c
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('c')
+        XmlToken:XML_EMPTY_ELEMENT_END('/>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEditing5.txt b/xml/tests/testData/psi/testEditing5.txt
new file mode 100644
index 0000000..9201db8
--- /dev/null
+++ b/xml/tests/testData/psi/testEditing5.txt
@@ -0,0 +1,23 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        XmlToken:XML_END_TAG_START('</')
+        PsiErrorElement:Closing tag is not done
+          <empty list>
+      PsiWhiteSpace(' ')
+      XmlTag:c
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('c')
+        XmlToken:XML_EMPTY_ELEMENT_END('/>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEditing6.txt b/xml/tests/testData/psi/testEditing6.txt
new file mode 100644
index 0000000..18aeb59
--- /dev/null
+++ b/xml/tests/testData/psi/testEditing6.txt
@@ -0,0 +1,21 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:one
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('one')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('     ')
+      XmlTag:two
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('two')
+        PsiErrorElement:Tag start is not closed
+          <empty list>
+      PsiWhiteSpace(' ')
+      XmlText
+        XmlToken:XML_DATA_CHARACTERS(',b"/>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('one')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEditing7.txt b/xml/tests/testData/psi/testEditing7.txt
new file mode 100644
index 0000000..2854e06
--- /dev/null
+++ b/xml/tests/testData/psi/testEditing7.txt
@@ -0,0 +1,23 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:one
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('one')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('     ')
+      XmlTag:two
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('two')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('a')
+          PsiErrorElement:'=' expected
+            <empty list>
+      XmlText
+        XmlToken:XML_DATA_CHARACTERS(',b"/>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('one')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEditing8.txt b/xml/tests/testData/psi/testEditing8.txt
new file mode 100644
index 0000000..d554d30
--- /dev/null
+++ b/xml/tests/testData/psi/testEditing8.txt
@@ -0,0 +1,29 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:one
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('one')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('     ')
+      XmlTag:two
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('two')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('a')
+          PsiErrorElement:'=' expected
+            <empty list>
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('b')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_EMPTY_ELEMENT_END('/>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('one')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEditing9.txt b/xml/tests/testData/psi/testEditing9.txt
new file mode 100644
index 0000000..20b1016
--- /dev/null
+++ b/xml/tests/testData/psi/testEditing9.txt
@@ -0,0 +1,42 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:one
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('one')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlTag:two
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('two')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('a')
+          PsiErrorElement:'=' expected
+            <empty list>
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('b')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('ashdgjkasgd')
+          PsiWhiteSpace(' ')
+        XmlTag:aksjhdk
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('aksjhdk')
+          XmlToken:XML_TAG_END('>')
+          PsiErrorElement:Element aksjhdk is not closed
+            <empty list>
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('two')
+        XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('one')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testElementDecl1.txt b/xml/tests/testData/psi/testElementDecl1.txt
new file mode 100644
index 0000000..ad97140
--- /dev/null
+++ b/xml/tests/testData/psi/testElementDecl1.txt
@@ -0,0 +1,12 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('data-sources')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        XmlToken:XML_CONTENT_EMPTY('EMPTY')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testElementDecl2.txt b/xml/tests/testData/psi/testElementDecl2.txt
new file mode 100644
index 0000000..bdfc6b3
--- /dev/null
+++ b/xml/tests/testData/psi/testElementDecl2.txt
@@ -0,0 +1,12 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('data-sources')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        XmlToken:XML_CONTENT_ANY('ANY')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testElementDeclaration.txt b/xml/tests/testData/psi/testElementDeclaration.txt
new file mode 100644
index 0000000..f110738
--- /dev/null
+++ b/xml/tests/testData/psi/testElementDeclaration.txt
@@ -0,0 +1,61 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('xxx')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        XmlToken:XML_CONTENT_EMPTY('EMPTY')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace('\n')
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('xxx2')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        XmlToken:XML_CONTENT_ANY('ANY')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace('\n')
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ENTITY_REF)
+        XmlToken:XML_ENTITY_REF_TOKEN('%name.para;')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        PsiElement(XML_ENTITY_REF)
+          XmlToken:XML_ENTITY_REF_TOKEN('%content.para;')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace('\n')
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('xxx3')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        PsiElement(XML_ELEMENT_CONTENT_GROUP)
+          XmlToken:XML_LEFT_PAREN('(')
+          XmlToken:XML_PCDATA('#PCDATA')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_BAR('|')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_NAME('a')
+          XmlToken:XML_RIGHT_PAREN(')')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace('\n')
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('xxx4')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        <empty list>
+      PsiErrorElement:( or entity ref or EMPTY or ANY expected
+        <empty list>
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testElements1.txt b/xml/tests/testData/psi/testElements1.txt
new file mode 100644
index 0000000..dfa4b91
--- /dev/null
+++ b/xml/tests/testData/psi/testElements1.txt
@@ -0,0 +1,11 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testElements2.txt b/xml/tests/testData/psi/testElements2.txt
new file mode 100644
index 0000000..a079c6c
--- /dev/null
+++ b/xml/tests/testData/psi/testElements2.txt
@@ -0,0 +1,8 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_EMPTY_ELEMENT_END('/>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testElements3.txt b/xml/tests/testData/psi/testElements3.txt
new file mode 100644
index 0000000..3fe37e6
--- /dev/null
+++ b/xml/tests/testData/psi/testElements3.txt
@@ -0,0 +1,41 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        XmlTag:c
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('c')
+          XmlToken:XML_EMPTY_ELEMENT_END('/>')
+        XmlTag:d
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('d')
+          XmlToken:XML_EMPTY_ELEMENT_END('/>')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+      XmlTag:e
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('e')
+        XmlToken:XML_EMPTY_ELEMENT_END('/>')
+      XmlTag:f
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('f')
+        XmlToken:XML_TAG_END('>')
+        XmlTag:g
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('g')
+          XmlToken:XML_EMPTY_ELEMENT_END('/>')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('f')
+        XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testElements4.txt b/xml/tests/testData/psi/testElements4.txt
new file mode 100644
index 0000000..0847a11
--- /dev/null
+++ b/xml/tests/testData/psi/testElements4.txt
@@ -0,0 +1,43 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:project
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('project')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('name')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('IDEA_ZKM')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n')
+      PsiElement(XML_COMMENT)
+        XmlToken:XML_COMMENT_START('<!--')
+        XmlToken:XML_COMMENT_CHARACTERS(' set global properties for this build ')
+        XmlToken:XML_COMMENT_END('-->')
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:property
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('property')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('value')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('off')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_EMPTY_ELEMENT_END('/>')
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('project')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace('\n')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testElements5.txt b/xml/tests/testData/psi/testElements5.txt
new file mode 100644
index 0000000..5608e15
--- /dev/null
+++ b/xml/tests/testData/psi/testElements5.txt
@@ -0,0 +1,15 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:ns1:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('ns1:a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:ns2:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('ns2:b')
+        XmlToken:XML_EMPTY_ELEMENT_END('/>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('ns1:a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testElements6.txt b/xml/tests/testData/psi/testElements6.txt
new file mode 100644
index 0000000..50721a0
--- /dev/null
+++ b/xml/tests/testData/psi/testElements6.txt
@@ -0,0 +1,31 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('project')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_MARKUP_DECL)
+          XmlToken:XML_MARKUP_START('[')
+          PsiElement(XML_ENTITY_DECL)
+            XmlToken:XML_ENTITY_DECL_START('<!ENTITY')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_NAME('targets')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DOCTYPE_SYSTEM('SYSTEM')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE_VALUE)
+              XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+              XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('file:../myproject/targets.xml')
+              XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+          XmlToken:XML_MARKUP_END(']')
+        XmlToken:XML_DOCTYPE_END('>')
+    XmlTag:project
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('project')
+      XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('project')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEmptyCommentParsing.txt b/xml/tests/testData/psi/testEmptyCommentParsing.txt
new file mode 100644
index 0000000..3a009cc
--- /dev/null
+++ b/xml/tests/testData/psi/testEmptyCommentParsing.txt
@@ -0,0 +1,10 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_COMMENT)
+      XmlToken:XML_COMMENT_START('<!--')
+      XmlToken:XML_COMMENT_END('-->')
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEmptyElementsInDtd.txt b/xml/tests/testData/psi/testEmptyElementsInDtd.txt
new file mode 100644
index 0000000..98de113
--- /dev/null
+++ b/xml/tests/testData/psi/testEmptyElementsInDtd.txt
@@ -0,0 +1,69 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiErrorElement:xml name expected
+        <empty list>
+    PsiWhiteSpace(' ')
+    XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace('\n')
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('name')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        PsiElement(XML_ELEMENT_CONTENT_GROUP)
+          XmlToken:XML_LEFT_PAREN('(')
+          PsiErrorElement:Xml name or entity ref expected
+            <empty list>
+      XmlToken:XML_COMMA(',')
+      XmlToken:XML_RIGHT_PAREN(')')
+    PsiWhiteSpace('\n')
+    PsiElement(XML_ATTLIST_DECL)
+      XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+      PsiErrorElement:xml name expected
+        <empty list>
+    PsiWhiteSpace(' ')
+    XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace(' ')
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('zzz')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        PsiElement(XML_ELEMENT_CONTENT_GROUP)
+          XmlToken:XML_LEFT_PAREN('(')
+          XmlToken:XML_NAME('aa')
+          XmlToken:XML_QUESTION('?')
+          XmlToken:XML_COMMA(',')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_NAME('bb')
+          XmlToken:XML_RIGHT_PAREN(')')
+        XmlToken:XML_PLUS('+')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace(' ')
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('xxx')
+      PsiErrorElement:Whitespace expected
+        <empty list>
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        PsiElement(XML_ELEMENT_CONTENT_GROUP)
+          XmlToken:XML_LEFT_PAREN('(')
+          XmlToken:XML_NAME('aaa')
+          XmlToken:XML_COMMA(',')
+          PsiErrorElement:Xml name or entity ref expected
+            <empty list>
+          XmlToken:XML_RIGHT_PAREN(')')
+      XmlToken:XML_TAG_END('>')
+    PsiElement(XML_ATTLIST_DECL)
+      XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ENTITY_REF)
+        XmlToken:XML_ENTITY_REF_TOKEN('%aaa;')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityDecl1.txt b/xml/tests/testData/psi/testEntityDecl1.txt
new file mode 100644
index 0000000..f4550fd
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityDecl1.txt
@@ -0,0 +1,16 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ENTITY_DECL)
+      XmlToken:XML_ENTITY_DECL_START('<!ENTITY')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_PERCENT('%')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('types')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_VALUE)
+        XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('fileset | patternset mapper')
+        XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityDecl2.txt b/xml/tests/testData/psi/testEntityDecl2.txt
new file mode 100644
index 0000000..26c7ddd
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityDecl2.txt
@@ -0,0 +1,14 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ENTITY_DECL)
+      XmlToken:XML_ENTITY_DECL_START('<!ENTITY')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('types')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_VALUE)
+        XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('fileset | patternset mapper')
+        XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityDecl3.txt b/xml/tests/testData/psi/testEntityDecl3.txt
new file mode 100644
index 0000000..07ab5ee
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityDecl3.txt
@@ -0,0 +1,16 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ENTITY_DECL)
+      XmlToken:XML_ENTITY_DECL_START('<!ENTITY')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('build-common')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_DOCTYPE_SYSTEM('SYSTEM')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_VALUE)
+        XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('common.xml')
+        XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityDecl4.txt b/xml/tests/testData/psi/testEntityDecl4.txt
new file mode 100644
index 0000000..b006b65
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityDecl4.txt
@@ -0,0 +1,21 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ENTITY_DECL)
+      XmlToken:XML_ENTITY_DECL_START('<!ENTITY')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('open-hatch')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_DOCTYPE_PUBLIC('PUBLIC')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_VALUE)
+        XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('-//Textuality//TEXT Standard open-hatch boilerplate//EN')
+        XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_VALUE)
+        XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('http://www.textuality.com/boilerplate/OpenHatch.xml')
+        XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityDeclaration.txt b/xml/tests/testData/psi/testEntityDeclaration.txt
new file mode 100644
index 0000000..e8b81a6
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityDeclaration.txt
@@ -0,0 +1,19 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ENTITY_DECL)
+      XmlToken:XML_ENTITY_DECL_START('<!ENTITY')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('xxx')
+      PsiErrorElement:Literal, PUBLIC or SYSTEM expected
+        <empty list>
+      PsiWhiteSpace(' ')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace(' ')
+    PsiElement(XML_ENTITY_DECL)
+      XmlToken:XML_ENTITY_DECL_START('<!ENTITY')
+      PsiErrorElement:xml name expected
+        <empty list>
+    PsiWhiteSpace(' ')
+    XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityDeclaration2.txt b/xml/tests/testData/psi/testEntityDeclaration2.txt
new file mode 100644
index 0000000..906619e
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityDeclaration2.txt
@@ -0,0 +1,16 @@
+PsiElement(XML_ELEMENT_CONTENT_SPEC)
+  PsiElement(XML_ELEMENT_CONTENT_SPEC)
+    XmlToken:XML_BAR('|')
+    PsiWhiteSpace(' ')
+    PsiElement(XML_ENTITY_REF)
+      XmlToken:XML_ENTITY_REF_TOKEN('%pre.qname;')
+    PsiWhiteSpace(' ')
+    XmlToken:XML_BAR('|')
+    PsiWhiteSpace(' ')
+    PsiElement(XML_ENTITY_REF)
+      XmlToken:XML_ENTITY_REF_TOKEN('%blockquote.qname;')
+    PsiWhiteSpace(' ')
+    XmlToken:XML_BAR('|')
+    PsiWhiteSpace(' ')
+    PsiElement(XML_ENTITY_REF)
+      XmlToken:XML_ENTITY_REF_TOKEN('%address.qname;')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityInAttlistDeclaration.txt b/xml/tests/testData/psi/testEntityInAttlistDeclaration.txt
new file mode 100644
index 0000000..118ee01
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityInAttlistDeclaration.txt
@@ -0,0 +1,13 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ATTLIST_DECL)
+      XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ENTITY_REF)
+        XmlToken:XML_ENTITY_REF_TOKEN('%span.qname;')
+      PsiWhiteSpace('      ')
+      PsiElement(XML_ENTITY_REF)
+        XmlToken:XML_ENTITY_REF_TOKEN('%Common.attrib;')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityInAttr.txt b/xml/tests/testData/psi/testEntityInAttr.txt
new file mode 100644
index 0000000..41b4b54
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityInAttr.txt
@@ -0,0 +1,18 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('href')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          PsiErrorElement:Unescaped & or nonterminated character/entity reference
+            XmlToken:XML_BAD_CHARACTER('&')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('n')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_EMPTY_ELEMENT_END('/>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityInContent.txt b/xml/tests/testData/psi/testEntityInContent.txt
new file mode 100644
index 0000000..9ba0312
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityInContent.txt
@@ -0,0 +1,17 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+        PsiErrorElement:Unescaped & or nonterminated character/entity reference
+          XmlToken:XML_BAD_CHARACTER('&')
+        XmlToken:XML_DATA_CHARACTERS('n')
+        PsiWhiteSpace(' ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityRef1.txt b/xml/tests/testData/psi/testEntityRef1.txt
new file mode 100644
index 0000000..5b35eff
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityRef1.txt
@@ -0,0 +1,13 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        XmlToken:XML_DATA_CHARACTERS('%types;')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityRef3.txt b/xml/tests/testData/psi/testEntityRef3.txt
new file mode 100644
index 0000000..ae791ff
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityRef3.txt
@@ -0,0 +1,30 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('project')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        PsiElement(XML_ELEMENT_CONTENT_GROUP)
+          XmlToken:XML_LEFT_PAREN('(')
+          XmlToken:XML_NAME('target')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_BAR('|')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_NAME('taskdef')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_BAR('|')
+          PsiWhiteSpace(' ')
+          PsiElement(XML_ENTITY_REF)
+            XmlToken:XML_ENTITY_REF_TOKEN('%types;')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_BAR('|')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_NAME('property')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_RIGHT_PAREN(')')
+        XmlToken:XML_STAR('*')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityRef4.txt b/xml/tests/testData/psi/testEntityRef4.txt
new file mode 100644
index 0000000..6c2ee36
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityRef4.txt
@@ -0,0 +1,19 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('aa ')
+          XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN(' bb')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_EMPTY_ELEMENT_END('/>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityRef5.txt b/xml/tests/testData/psi/testEntityRef5.txt
new file mode 100644
index 0000000..25f5576
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityRef5.txt
@@ -0,0 +1,23 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ATTLIST_DECL)
+      XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('a')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ENTITY_REF)
+        XmlToken:XML_ENTITY_REF_TOKEN('%coreattrs;')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_DECL)
+        XmlToken:XML_NAME('version')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('CDATA')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_ATT_FIXED('#FIXED')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('1.0')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityRef6.txt b/xml/tests/testData/psi/testEntityRef6.txt
new file mode 100644
index 0000000..a7dbbfc
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityRef6.txt
@@ -0,0 +1,6 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ENTITY_REF)
+      XmlToken:XML_ENTITY_REF_TOKEN('&common;')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testEntityRef7.txt b/xml/tests/testData/psi/testEntityRef7.txt
new file mode 100644
index 0000000..ed26182
--- /dev/null
+++ b/xml/tests/testData/psi/testEntityRef7.txt
@@ -0,0 +1,31 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ATTLIST_DECL)
+      XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('foo')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_DECL)
+        XmlToken:XML_NAME('someBoolean')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ENUMERATED_TYPE)
+          XmlToken:XML_LEFT_PAREN('(')
+          PsiElement(XML_ENTITY_REF)
+            XmlToken:XML_ENTITY_REF_TOKEN('%boolean;')
+          XmlToken:XML_RIGHT_PAREN(')')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('true')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_DECL)
+        XmlToken:XML_NAME('someString')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('CDATA')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_ATT_IMPLIED('#IMPLIED')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testGtInTagContent.txt b/xml/tests/testData/psi/testGtInTagContent.txt
new file mode 100644
index 0000000..9d0c4c9
--- /dev/null
+++ b/xml/tests/testData/psi/testGtInTagContent.txt
@@ -0,0 +1,13 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        XmlToken:XML_DATA_CHARACTERS('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testManualEmptyAttributeParsing.txt b/xml/tests/testData/psi/testManualEmptyAttributeParsing.txt
new file mode 100644
index 0000000..870c2b3
--- /dev/null
+++ b/xml/tests/testData/psi/testManualEmptyAttributeParsing.txt
@@ -0,0 +1,25 @@
+PsiElement(XML_ELEMENT_DECL)
+  XmlTag:a
+    XmlToken:XML_START_TAG_START('<')
+    XmlToken:XML_NAME('a')
+    XmlToken:XML_TAG_END('>')
+    XmlTag:b
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('b')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('c')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_TAG_END('>')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('b')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace(' ')
+    XmlToken:XML_END_TAG_START('</')
+    XmlToken:XML_NAME('a')
+    XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testManyErrors.txt b/xml/tests/testData/psi/testManyErrors.txt
new file mode 100644
index 0000000..9f550bb
--- /dev/null
+++ b/xml/tests/testData/psi/testManyErrors.txt
@@ -0,0 +1,3709 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:html
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('html')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:HEAD
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('HEAD')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n\t')
+        XmlTag:TITLE
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('TITLE')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('AppletViewer')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('Tags')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('TITLE')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('HEAD')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n\n')
+      XmlTag:BODY
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('BODY')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('bgcolor')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('white')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element BODY is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace('\n\n')
+      XmlTag:TABLE
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('TABLE')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('BORDER')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('0')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('WIDTH')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('100%')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('summary')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('layout')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlTag:TR
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('TR')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:TD
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('TD')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n   ')
+            XmlTag:IMG
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('IMG')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('SRC')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('../images/javalogo52x88.gif')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('ALT')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('Java')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('BORDER')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  PsiErrorElement:Attribute value expected
+                    <empty list>
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('0')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('WIDTH=52')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('HEIGHT=88>')
+              PsiWhiteSpace('\n')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('TD')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n\n')
+          XmlTag:TD
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('TD')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n')
+            XmlTag:center
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('center')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                PsiWhiteSpace('\n           ')
+              XmlTag:h1
+                XmlToken:XML_START_TAG_START('<')
+                XmlToken:XML_NAME('h1')
+                XmlToken:XML_TAG_END('>')
+                XmlText
+                  XmlToken:XML_DATA_CHARACTERS('AppletViewer')
+                  PsiWhiteSpace(' ')
+                  XmlToken:XML_DATA_CHARACTERS('Tags')
+                XmlToken:XML_END_TAG_START('</')
+                XmlToken:XML_NAME('h1')
+                XmlToken:XML_TAG_END('>')
+              XmlText
+                PsiWhiteSpace('\n')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('center')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('TD')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n\n')
+          XmlTag:TD
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('TD')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('ALIGN')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                PsiErrorElement:Attribute value expected
+                  <empty list>
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('RIGHT')
+              PsiErrorElement:'=' expected
+                <empty list>
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('VALIGN')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                PsiErrorElement:Attribute value expected
+                  <empty list>
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('TOP')
+              PsiErrorElement:'=' expected
+                <empty list>
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n')
+            XmlTag:font
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('font')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('size')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('-1')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlTag:a
+                XmlToken:XML_START_TAG_START('<')
+                XmlToken:XML_NAME('a')
+                PsiWhiteSpace(' ')
+                PsiElement(XML_ATTRIBUTE)
+                  XmlToken:XML_NAME('href')
+                  XmlToken:XML_EQ('=')
+                  PsiElement(XML_ATTRIBUTE_VALUE)
+                    XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                    XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('../index.html')
+                    XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+                XmlToken:XML_TAG_END('>')
+                XmlText
+                  XmlToken:XML_DATA_CHARACTERS('Documentation')
+                  PsiWhiteSpace(' ')
+                  XmlToken:XML_DATA_CHARACTERS('Contents')
+                XmlToken:XML_END_TAG_START('</')
+                XmlToken:XML_NAME('a')
+                XmlToken:XML_TAG_END('>')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('font')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('TD')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('TR')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('TABLE')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n\n\n')
+      PsiElement(XML_COMMENT)
+        XmlToken:XML_COMMENT_START('<!--')
+        XmlToken:XML_COMMENT_CHARACTERS(' ======================== Body text begins here ===================== ')
+        XmlToken:XML_COMMENT_END('-->')
+      XmlText
+        PsiWhiteSpace('\n')
+        XmlToken:XML_DATA_CHARACTERS('The')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('applet')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('viewer')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('makes')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('it')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('possible')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('to')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('run')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('a')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('Java')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('applet')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('without')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('using')
+        PsiWhiteSpace('\n')
+        XmlToken:XML_DATA_CHARACTERS('a')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('browser.')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('AppletViewer')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('ignores')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('any')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('HTML')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('that')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('is')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('not')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('immediately')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('relevant')
+        PsiWhiteSpace('\n')
+        XmlToken:XML_DATA_CHARACTERS('to')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('launching')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('an')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('applet.')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('However,')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('it')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('recognizes')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('a')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('wide')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('variety')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('of')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('applet-')
+        PsiWhiteSpace('\n')
+        XmlToken:XML_DATA_CHARACTERS('launching')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('syntax.')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('The')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('HTML')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('code')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('that')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('AppletViewer')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('recognizes')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('is')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('shown')
+        PsiWhiteSpace('\n')
+        XmlToken:XML_DATA_CHARACTERS('below.')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('All')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('other')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('HTML')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('code')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('is')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('ignored.')
+        PsiWhiteSpace('\n')
+      XmlTag:p
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('p')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element p is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          XmlToken:XML_DATA_CHARACTERS('object')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+      XmlTag:br
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('br')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element br is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:blockquote
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('blockquote')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+          XmlToken:XML_DATA_CHARACTERS('The')
+          PsiWhiteSpace(' ')
+        XmlTag:code
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('object')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('tag')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('is')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('HTML')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('4.0')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('tag')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('for')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('embedding')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('applets')
+          PsiWhiteSpace(' \n')
+          XmlToken:XML_DATA_CHARACTERS('and')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('mult-media')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('objects')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('into')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('an')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('HTML')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('page.')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('It')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('is')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('also')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('an')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('Internet')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('Explorer')
+          PsiWhiteSpace('\n')
+          XmlToken:XML_DATA_CHARACTERS('4.x')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('extension')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('to')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('HTML')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('3.2')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('which')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('allows')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('IE')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('to')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('run')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('a')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('Java')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('applet')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('using')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' \n')
+          XmlToken:XML_DATA_CHARACTERS('latest')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('Java')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('plugin')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('from')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('Sun.')
+          PsiWhiteSpace('\n')
+        XmlTag:pre
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('pre')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+            XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+            XmlToken:XML_DATA_CHARACTERS('object')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('width="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('pixelWidth')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('height="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('pixelHeight')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n')
+            XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+            XmlToken:XML_DATA_CHARACTERS('param')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('name="code"')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('value="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('yourClass.class')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+            XmlToken:XML_DATA_CHARACTERS('param')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('name="object"')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('value="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('serializedObjectOrJavaBean')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+            XmlToken:XML_DATA_CHARACTERS('param')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('name="codebase"')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('value="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('classFileDirectory')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            PsiWhiteSpace('\n   ')
+            XmlToken:XML_DATA_CHARACTERS('...')
+            PsiWhiteSpace('\n  ')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('alternate-text')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+            XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+            XmlToken:XML_DATA_CHARACTERS('/object')
+            XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            PsiWhiteSpace('\n')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('pre')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlTag:b
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('b')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('Notes:')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('b')
+          XmlToken:XML_TAG_END('>')
+        XmlTag:br
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('br')
+          XmlToken:XML_TAG_END('>')
+          PsiErrorElement:Element br is not closed
+            <empty list>
+        XmlTag:ul
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('ul')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('AppletViewer')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('ignores')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('"classID"')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('attribute,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('on')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('assumption')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('it')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('is')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('pointing')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('to')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('Java')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('plugin,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('with')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('value:')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+            XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n      ')
+              XmlToken:XML_DATA_CHARACTERS('classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"')
+              PsiWhiteSpace('\n    ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('AppletViewer')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('also')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('ignores')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('"codebase"')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('attribute')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('is')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('usually')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('included')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('as')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('part')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('of')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('object')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tag,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('assuming')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('it')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('points')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('to')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('Java')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('plugin')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('in')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('network')
+            PsiWhiteSpace(' ')
+          XmlTag:b
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('b')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('cab')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('b')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('file')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('with')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('value')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('like:')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              PsiWhiteSpace('\n      ')
+              XmlToken:XML_DATA_CHARACTERS('codebase="http://java.sun.com/products/plugin/1.1/jinstall-11-win32.cab#Version=1,1,0,0"')
+              PsiWhiteSpace('\n    ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('The')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('optional')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('codebase')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('param')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tag')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('supplies')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('relative')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('URL')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('specifies')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('location')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('of')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('class.')
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('Either')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('code')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('or')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('object')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('is')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('specified,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('not')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('both.')
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('The')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('type')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('param')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tag')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('is')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('not')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('used')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('by')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('AppletViewer,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('but')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('should')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('be')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('present')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('so')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('browsers')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('load')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('plugin')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('properly.')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n\t ')
+            XmlToken:XML_DATA_CHARACTERS('For')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('an')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('value')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('should')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('be')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('something')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('like:')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              PsiWhiteSpace('\n      ')
+              XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+              XmlToken:XML_DATA_CHARACTERS('param')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('name="type"')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('value="application/x-java-applet;version=1.1"')
+              XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+              PsiWhiteSpace('\n    ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('or')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              PsiWhiteSpace('\n      ')
+              XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+              XmlToken:XML_DATA_CHARACTERS('param')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('name="type"')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('value="application/x-java-applet"')
+              XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+              PsiWhiteSpace('\n    ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('For')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('serialized')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('object')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('or')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('JavaBean,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('type')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('param')
+            PsiWhiteSpace(' \n\t ')
+            XmlToken:XML_DATA_CHARACTERS('value')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('should')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('be')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('something')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('like:')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              PsiWhiteSpace('\n      ')
+              XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+              XmlToken:XML_DATA_CHARACTERS('param')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('name="type"')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('value="application/x-java-bean;version=1.1"')
+              XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+              PsiWhiteSpace('\n    ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('or')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              PsiWhiteSpace('\n      ')
+              XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+              XmlToken:XML_DATA_CHARACTERS('param')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('name="type"')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('value="application/x-java-bean"')
+              XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+              PsiWhiteSpace('\n    ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('Other')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('param')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tags')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('are')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('argument')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('values')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('supplied')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('to')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet.')
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('The')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('object')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tag')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('recognized')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('by')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('IE4.x')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('and')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('embed')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tag')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('recognized')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('by')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('Netscape')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('4.x')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('can')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('be')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('combined')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('so')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('an')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('can')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('use')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('latest')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('Java')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('plugin')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('from')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('Sun,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('regardless')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('of')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('browser')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('downloads')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet.')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n\t ')
+            XmlToken:XML_DATA_CHARACTERS('For')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('more')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('information,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('see')
+            PsiWhiteSpace('\n    ')
+          XmlTag:a
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('a')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('href')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('http://java.sun.com/products/plugin/1.3/docs/tags.html')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('Java')
+              PsiWhiteSpace('\n    ')
+              XmlToken:XML_DATA_CHARACTERS('PlugIn')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('HTML')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('Specification')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('a')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('AppletViewer')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('does')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('not')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('recognize')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('java_code')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS(',')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('java_codebase')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS(',')
+            PsiWhiteSpace('\n    ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('java_object')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS(',')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('or')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('java_type')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('param')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tags.')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('These')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tags')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('are')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('only')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('needed')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('when')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('defines')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('parameters')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('with')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('names')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('code,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('codebase,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('object,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('or')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('type,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('respectively.')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('(In')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('situation,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('plugin')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('recognizes')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('and')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('uses')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('java_')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('version')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('in')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('preference')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('to')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('version')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('will')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('be')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('used')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('by')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet.)')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('If')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('requires')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('parameter')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('with')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('one')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('of')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('these')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('4')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('names,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('it')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('may')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('not')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('run')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('in')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('AppletViewer.')
+            PsiWhiteSpace('\n')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('ul')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('blockquote')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:p
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('p')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element p is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          XmlToken:XML_DATA_CHARACTERS('embed')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+      XmlTag:br
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('br')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element br is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:blockquote
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('blockquote')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+          XmlToken:XML_DATA_CHARACTERS('The')
+          PsiWhiteSpace(' ')
+        XmlTag:code
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('embed')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('tag')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('is')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('Netscape')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('extension')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('to')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('HTML')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('3.2')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('that')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('allows')
+          PsiWhiteSpace(' \n')
+          XmlToken:XML_DATA_CHARACTERS('embedding')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('an')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('applet')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('or')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('a')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('multimedia')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('object')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('in')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('an')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('HTML')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('page.')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('It')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('allows')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('a')
+          PsiWhiteSpace('\n')
+          XmlToken:XML_DATA_CHARACTERS('Netscape')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('4.x')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('browser')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('(which')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('supports')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('HTML')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('3.2)')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('to')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('run')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('a')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('Java')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('applet')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('using')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' \n')
+          XmlToken:XML_DATA_CHARACTERS('latest')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('Java')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('plugin')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('from')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('Sun.')
+          PsiWhiteSpace('\n')
+        XmlTag:pre
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('pre')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+            XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+            XmlToken:XML_DATA_CHARACTERS('embed')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('code="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('yourClass.class')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('object="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('serializedObjectOrJavaBean')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('codebase="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('classFileDirectory')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('width="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('pixelWidth')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('height="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('pixelHeight')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n')
+            XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            PsiWhiteSpace('\n   ')
+            XmlToken:XML_DATA_CHARACTERS('...')
+            PsiWhiteSpace('\n')
+            XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+            XmlToken:XML_DATA_CHARACTERS('/embed')
+            XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            PsiWhiteSpace('\n')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('pre')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlTag:b
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('b')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('Notes:')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('b')
+          XmlToken:XML_TAG_END('>')
+        XmlTag:br
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('br')
+          XmlToken:XML_TAG_END('>')
+          PsiErrorElement:Element br is not closed
+            <empty list>
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlTag:ul
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('ul')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('The')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('object')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('and')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('embed')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tags')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('can')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('be')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('combined')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('so')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('an')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('can')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('use')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('latest')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('Java')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('plugin')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('from')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('Sun,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('regardless')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('of')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('browser')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('downloads')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet.')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n\t ')
+            XmlToken:XML_DATA_CHARACTERS('For')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('more')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('information,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('see')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace('\n    ')
+          XmlTag:a
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('a')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('href')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('http://java.sun.com/products/plugin/1.3/docs/tags.html')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('Java')
+              PsiWhiteSpace(' \n    ')
+              XmlToken:XML_DATA_CHARACTERS('PlugIn')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('HTML')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('Specification')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('a')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('Unlike')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('object')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tag,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('all')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('values')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('specified')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('in')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('an')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('embed')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('tag')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('are')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('attributes')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('(part')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('of')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tag)')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('rather')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('than')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('parameters')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('(between')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('start')
+            PsiWhiteSpace('\n\t ')
+            XmlToken:XML_DATA_CHARACTERS('tag')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('and')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('end')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tag,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('specified')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('with')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('param')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tag.')
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('To')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('supply')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('argument')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('values')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('for')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('parameters,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('you')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('add')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('additional')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('attributes')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('to')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+              XmlToken:XML_DATA_CHARACTERS('embed')
+              XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tag.')
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('AppletViewer')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('ignores')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('"src"')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('attribute')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('is')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('usually')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('part')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('of')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('an')
+            PsiWhiteSpace(' \n    ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+              XmlToken:XML_DATA_CHARACTERS('embed')
+              XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tag.')
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('Either')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('code')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('or')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('object')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('is')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('specified,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('not')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('both.')
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('The')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('optional')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('codebase')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('attribute')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('supplies')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('relative')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('URL')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('specifies')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('location')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('of')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('class.')
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('The')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('type')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('attribute')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('is')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('not')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('used')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('by')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('AppletViewer,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('but')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('should')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('be')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('present')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('so')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('browsers')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('load')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('plugin')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('properly.')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n\t ')
+            XmlToken:XML_DATA_CHARACTERS('For')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('an')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('value')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('should')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('be')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('something')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('like:')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              PsiWhiteSpace('\n      ')
+              XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+              XmlToken:XML_DATA_CHARACTERS('type="application/x-java-applet;version=1.1"')
+              XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+              XmlToken:XML_DATA_CHARACTERS('...')
+              PsiWhiteSpace('\n    ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('or')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              PsiWhiteSpace('\n      ')
+              XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+              XmlToken:XML_DATA_CHARACTERS('type="application/x-java-applet"')
+              XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+              XmlToken:XML_DATA_CHARACTERS('...')
+              PsiWhiteSpace('\n    ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('For')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('serialized')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('object')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('or')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('JavaBean,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('type')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('param')
+            PsiWhiteSpace(' \n\t ')
+            XmlToken:XML_DATA_CHARACTERS('value')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('should')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('be')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('something')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('like:')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              PsiWhiteSpace('\n      ')
+              XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+              XmlToken:XML_DATA_CHARACTERS('type="application/x-java-bean;version=1.1"')
+              XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+              XmlToken:XML_DATA_CHARACTERS('...')
+              PsiWhiteSpace('\n    ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('or')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              PsiWhiteSpace('\n      ')
+              XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+              XmlToken:XML_DATA_CHARACTERS('type="application/x-java-bean"')
+              XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+              XmlToken:XML_DATA_CHARACTERS('...')
+              PsiWhiteSpace('\n    ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('The')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('"pluginspage"')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('attribute')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('is')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('not')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('used')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('by')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('AppletViewer,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('but')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('should')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('be')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('present')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('so')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('browsers')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('load')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('plugin')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('properly.')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('It')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('should')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('point')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('to')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('Java')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('plugin')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('in')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('network')
+            PsiWhiteSpace(' ')
+          XmlTag:b
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('b')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('cab')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('b')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('file')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('with')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('value')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('like:')
+          XmlTag:br
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('br')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element br is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n    ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              XmlToken:XML_CHAR_ENTITY_REF('&nbsp;')
+              PsiWhiteSpace('\n      ')
+              XmlToken:XML_DATA_CHARACTERS('pluginspage="http://java.sun.com/products/plugin/1.1/jinstall-11-win32.cab#Version=1,1,0,0"')
+              PsiWhiteSpace('\n    ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('ul')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('blockquote')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:p
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('p')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element p is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          XmlToken:XML_DATA_CHARACTERS('applet')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+      XmlTag:br
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('br')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element br is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:blockquote
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('blockquote')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+          XmlToken:XML_DATA_CHARACTERS('The')
+          PsiWhiteSpace(' ')
+        XmlTag:code
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('applet')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('tag')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('is')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('original')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('HTML')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('3.2')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('tag')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('for')
+          PsiWhiteSpace(' \n')
+          XmlToken:XML_DATA_CHARACTERS('embedding')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('an')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('applet')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('in')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('an')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('HTML')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('page.')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('Applets')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('loaded')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('using')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace('\n')
+        XmlTag:code
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('applet')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('tag')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('are')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('run')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('by')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('browser,')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('which')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('may')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('not')
+          PsiWhiteSpace('\n')
+          XmlToken:XML_DATA_CHARACTERS('be')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('using')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('latest')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('version')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('of')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('Java')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('platform.')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('To')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('ensure')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('that')
+          PsiWhiteSpace('\n')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('applet')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('runs')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('with')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('latest')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('version,')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('use')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' ')
+        XmlTag:code
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('object')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+          XmlToken:XML_DATA_CHARACTERS('tag')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('to')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('load')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('Java')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('plugin')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('into')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('browser.')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('The')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('plugin')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('will')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('then')
+          PsiWhiteSpace('\n')
+          XmlToken:XML_DATA_CHARACTERS('run')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('applet.')
+          PsiWhiteSpace('\n')
+        XmlTag:pre
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('pre')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+            XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+            XmlToken:XML_DATA_CHARACTERS('applet')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('code="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('yourClass.class')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('object="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('serializedObjectOrJavaBean')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('codebase="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('classFileDirectory')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('width="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('pixelWidth')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('height="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('pixelHeight')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n')
+            XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+            XmlToken:XML_DATA_CHARACTERS('param')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('name="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('...')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('value="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('...')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            PsiWhiteSpace('\n   ')
+            XmlToken:XML_DATA_CHARACTERS('...')
+            PsiWhiteSpace('\n  ')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('alternate-text')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+            XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+            XmlToken:XML_DATA_CHARACTERS('/applet')
+            XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            PsiWhiteSpace('\n')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('pre')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlTag:b
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('b')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('Notes:')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('b')
+          XmlToken:XML_TAG_END('>')
+        XmlTag:br
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('br')
+          XmlToken:XML_TAG_END('>')
+          PsiErrorElement:Element br is not closed
+            <empty list>
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlTag:ul
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('ul')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('Either')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('code')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('or')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('object')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('is')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('specified,')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('not')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('both.')
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('The')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('optional')
+            PsiWhiteSpace(' ')
+          XmlTag:code
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('codebase')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('code')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('attribute')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('supplies')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('relative')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('URL')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('that')
+            PsiWhiteSpace('\n    ')
+            XmlToken:XML_DATA_CHARACTERS('specifies')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('location')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('of')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('the')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('class.')
+            PsiWhiteSpace('\n\t ')
+          XmlTag:p
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('p')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element p is not closed
+              <empty list>
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:li
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('li')
+            XmlToken:XML_TAG_END('>')
+            PsiErrorElement:Element li is not closed
+              <empty list>
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('Param')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('tags')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('supply')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('argument')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('values')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('for')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('applet')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('parameters.')
+            PsiWhiteSpace('\n')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('ul')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('blockquote')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:p
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('p')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element p is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          XmlToken:XML_DATA_CHARACTERS('app')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+      XmlTag:br
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('br')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element br is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:blockquote
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('blockquote')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+          XmlToken:XML_DATA_CHARACTERS('The')
+          PsiWhiteSpace(' ')
+        XmlTag:code
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('app')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('tag')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('was')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('a')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('short-lived')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('abbreviation')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('for')
+          PsiWhiteSpace(' \n')
+        XmlTag:code
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('applet')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('code')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('that')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('is')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('no')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('longer')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('supported.')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('AppletViewer')
+          PsiWhiteSpace(' \n')
+          XmlToken:XML_DATA_CHARACTERS('translates')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('the')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('tag')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('and')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('prints')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('out')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('an')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('equivalent')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('tag')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('that')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('is')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('supported.')
+          PsiWhiteSpace('\n')
+        XmlTag:pre
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('pre')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+            XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+            XmlToken:XML_DATA_CHARACTERS('app')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('class="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('classFileName')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('(')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('without')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('a')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('.class')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('suffix)')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('src="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('classFileDirectory')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('width="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('pixelWidth')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n  ')
+            XmlToken:XML_DATA_CHARACTERS('height="')
+          XmlTag:i
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('pixelHeight')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('i')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            XmlToken:XML_DATA_CHARACTERS('"')
+            PsiWhiteSpace('\n')
+            XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            PsiWhiteSpace('\n')
+            XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+            XmlToken:XML_DATA_CHARACTERS('param')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('name="..."')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DATA_CHARACTERS('value="..."')
+            XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            PsiWhiteSpace('\n ')
+            XmlToken:XML_DATA_CHARACTERS('...')
+            PsiWhiteSpace('\n')
+            XmlToken:XML_CHAR_ENTITY_REF('&lt;')
+            XmlToken:XML_DATA_CHARACTERS('/app')
+            XmlToken:XML_CHAR_ENTITY_REF('&gt;')
+            PsiWhiteSpace('\n')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('pre')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('blockquote')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n\n')
+        XmlToken:XML_DATA_CHARACTERS('For')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('more')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('information')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('on')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('the')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('tags')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('that')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('AppletViewer')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('supports')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('and')
+      XmlTag:br
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('br')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element br is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace(' \n')
+        XmlToken:XML_DATA_CHARACTERS('how')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('to')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('combine')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('them,')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('see')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('the')
+        PsiWhiteSpace(' \n')
+      XmlTag:a
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('a')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('href')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('http://java.sun.com/products/plugin/1.3/docs/tags.html')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          XmlToken:XML_DATA_CHARACTERS('Java')
+          PsiWhiteSpace(' \n')
+          XmlToken:XML_DATA_CHARACTERS('PlugIn')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('HTML')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_DATA_CHARACTERS('Specification')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('a')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        XmlToken:XML_DATA_CHARACTERS('.')
+        PsiWhiteSpace('\n')
+      XmlTag:P
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('P')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element P is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:HR
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('HR')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('SIZE')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            PsiErrorElement:Attribute value expected
+              <empty list>
+      XmlText
+        XmlToken:XML_DATA_CHARACTERS('3')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DATA_CHARACTERS('NOSHADE>')
+        PsiWhiteSpace('\n')
+      XmlTag:TABLE
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('TABLE')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('BORDER')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('0')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('WIDTH')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('100%')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('summary')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('layout')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlTag:TR
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('TR')
+          PsiWhiteSpace(' ')
+          PsiElement(XML_ATTRIBUTE)
+            XmlToken:XML_NAME('VALIGN')
+            XmlToken:XML_EQ('=')
+            PsiElement(XML_ATTRIBUTE_VALUE)
+              PsiErrorElement:Attribute value expected
+                <empty list>
+          PsiElement(XML_ATTRIBUTE)
+            XmlToken:XML_NAME('TOP')
+            PsiErrorElement:'=' expected
+              <empty list>
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:TD
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('TD')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n')
+            XmlTag:P
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('P')
+              XmlToken:XML_TAG_END('>')
+              XmlTag:FONT
+                XmlToken:XML_START_TAG_START('<')
+                XmlToken:XML_NAME('FONT')
+                PsiWhiteSpace(' ')
+                PsiElement(XML_ATTRIBUTE)
+                  XmlToken:XML_NAME('SIZE')
+                  XmlToken:XML_EQ('=')
+                  PsiElement(XML_ATTRIBUTE_VALUE)
+                    XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                    XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('-2')
+                    XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+                XmlToken:XML_TAG_END('>')
+                XmlText
+                  PsiWhiteSpace('\n  ')
+                XmlTag:A
+                  XmlToken:XML_START_TAG_START('<')
+                  XmlToken:XML_NAME('A')
+                  PsiWhiteSpace(' ')
+                  PsiElement(XML_ATTRIBUTE)
+                    XmlToken:XML_NAME('HREF')
+                    XmlToken:XML_EQ('=')
+                    PsiElement(XML_ATTRIBUTE_VALUE)
+                      XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                      XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('../relnotes/SMICopyright.html')
+                      XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+                  XmlToken:XML_TAG_END('>')
+                  XmlText
+                    XmlToken:XML_DATA_CHARACTERS('Copyright')
+                  XmlToken:XML_END_TAG_START('</')
+                  XmlToken:XML_NAME('A')
+                  XmlToken:XML_TAG_END('>')
+                XmlText
+                  PsiWhiteSpace(' ')
+                  XmlToken:XML_CHAR_ENTITY_REF('&#169;')
+                  PsiWhiteSpace(' ')
+                  XmlToken:XML_DATA_CHARACTERS('2001')
+                  PsiWhiteSpace('\n  ')
+                XmlTag:A
+                  XmlToken:XML_START_TAG_START('<')
+                  XmlToken:XML_NAME('A')
+                  PsiWhiteSpace(' ')
+                  PsiElement(XML_ATTRIBUTE)
+                    XmlToken:XML_NAME('HREF')
+                    XmlToken:XML_EQ('=')
+                    PsiElement(XML_ATTRIBUTE_VALUE)
+                      XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                      XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('http://www.sun.com')
+                      XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+                  XmlToken:XML_TAG_END('>')
+                  XmlText
+                    XmlToken:XML_DATA_CHARACTERS('Sun')
+                    PsiWhiteSpace(' ')
+                    XmlToken:XML_DATA_CHARACTERS('Microsystems,')
+                    PsiWhiteSpace(' ')
+                    XmlToken:XML_DATA_CHARACTERS('Inc.')
+                  XmlToken:XML_END_TAG_START('</')
+                  XmlToken:XML_NAME('A')
+                  XmlToken:XML_TAG_END('>')
+                XmlText
+                  PsiWhiteSpace('\n  ')
+                  XmlToken:XML_DATA_CHARACTERS('All')
+                  PsiWhiteSpace(' ')
+                  XmlToken:XML_DATA_CHARACTERS('Rights')
+                  PsiWhiteSpace(' ')
+                  XmlToken:XML_DATA_CHARACTERS('Reserved.')
+                XmlToken:XML_END_TAG_START('</')
+                XmlToken:XML_NAME('FONT')
+                XmlToken:XML_TAG_END('>')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('P')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('TD')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlTag:TD
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('TD')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('ALIGN')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                PsiErrorElement:Attribute value expected
+                  <empty list>
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('RIGHT')
+              PsiErrorElement:'=' expected
+                <empty list>
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n  ')
+            XmlTag:IMG
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('IMG')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('SRC')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('../images/sunlogo64x30.gif')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('ALT')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('Sun')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('BORDER')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  PsiErrorElement:Attribute value expected
+                    <empty list>
+            XmlText
+              XmlToken:XML_DATA_CHARACTERS('0')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('WIDTH=64')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_DATA_CHARACTERS('HEIGHT=30>')
+              PsiWhiteSpace('\n  ')
+            XmlTag:BR
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('BR')
+              XmlToken:XML_TAG_END('>')
+              PsiErrorElement:Element BR is not closed
+                <empty list>
+            XmlText
+              PsiWhiteSpace('\n  ')
+            XmlTag:FONT
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('FONT')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('SIZE')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('+1')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                PsiWhiteSpace('\n  ')
+              XmlTag:i
+                XmlToken:XML_START_TAG_START('<')
+                XmlToken:XML_NAME('i')
+                XmlToken:XML_TAG_END('>')
+                XmlText
+                  XmlToken:XML_DATA_CHARACTERS('Java')
+                  PsiWhiteSpace(' ')
+                  XmlToken:XML_DATA_CHARACTERS('Software')
+                XmlToken:XML_END_TAG_START('</')
+                XmlToken:XML_NAME('i')
+                XmlToken:XML_TAG_END('>')
+              XmlText
+                PsiWhiteSpace('\n  ')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('FONT')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('TD')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('TR')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('TABLE')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlTag:BR
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('BR')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element BR is not closed
+          <empty list>
+      XmlTag:BR
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('BR')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element BR is not closed
+          <empty list>
+      XmlTag:BR
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('BR')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element BR is not closed
+          <empty list>
+      XmlTag:BR
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('BR')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element BR is not closed
+          <empty list>
+      XmlTag:BR
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('BR')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element BR is not closed
+          <empty list>
+      XmlTag:BR
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('BR')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element BR is not closed
+          <empty list>
+      XmlTag:BR
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('BR')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element BR is not closed
+          <empty list>
+      XmlTag:BR
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('BR')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n\n')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('body')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('html')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testMultyRoots.txt b/xml/tests/testData/psi/testMultyRoots.txt
new file mode 100644
index 0000000..75455e0
--- /dev/null
+++ b/xml/tests/testData/psi/testMultyRoots.txt
@@ -0,0 +1,21 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('href')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_EMPTY_ELEMENT_END('/>')
+    PsiWhiteSpace(' ')
+    XmlTag:b
+      PsiErrorElement:Multiple root tags
+        XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('b')
+      XmlToken:XML_EMPTY_ELEMENT_END('/>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testMultyRootsWithErrorsBetween.txt b/xml/tests/testData/psi/testMultyRootsWithErrorsBetween.txt
new file mode 100644
index 0000000..45d6022
--- /dev/null
+++ b/xml/tests/testData/psi/testMultyRootsWithErrorsBetween.txt
@@ -0,0 +1,25 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('href')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_EMPTY_ELEMENT_END('/>')
+    PsiWhiteSpace(' ')
+    PsiErrorElement:Unexpected tokens
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('ss')
+      XmlToken:XML_TAG_END('>')
+    XmlTag:b
+      PsiErrorElement:Multiple root tags
+        XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('b')
+      XmlToken:XML_EMPTY_ELEMENT_END('/>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing1.txt b/xml/tests/testData/psi/testNewParsing1.txt
new file mode 100644
index 0000000..dfa4b91
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing1.txt
@@ -0,0 +1,11 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing10.txt b/xml/tests/testData/psi/testNewParsing10.txt
new file mode 100644
index 0000000..f679b82
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing10.txt
@@ -0,0 +1,29 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('asd')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('asd')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlTag:s
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('s')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element s is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing11.txt b/xml/tests/testData/psi/testNewParsing11.txt
new file mode 100644
index 0000000..8a97f89
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing11.txt
@@ -0,0 +1,36 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_COMMENT)
+      XmlToken:XML_COMMENT_START('<!--')
+      XmlToken:XML_COMMENT_CHARACTERS(' <!')
+      PsiErrorElement:Bad character
+        XmlToken:XML_BAD_CHARACTER('-')
+      XmlToken:XML_COMMENT_CHARACTERS('- ')
+      XmlToken:XML_COMMENT_END('-->')
+    PsiElement(XML_PROLOG)
+      PsiWhiteSpace(' ')
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('asd')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('asd')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlTag:s
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('s')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element s is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing12.txt b/xml/tests/testData/psi/testNewParsing12.txt
new file mode 100644
index 0000000..361029d
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing12.txt
@@ -0,0 +1,26 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:a
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('a')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('ajsdg')
+          PsiErrorElement:'=' expected
+            <empty list>
+      XmlTag:a
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('a')
+        XmlToken:XML_TAG_END('>')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('a')
+        XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing13.txt b/xml/tests/testData/psi/testNewParsing13.txt
new file mode 100644
index 0000000..7e9417f
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing13.txt
@@ -0,0 +1,34 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        XmlTag:c
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('c')
+          XmlToken:XML_TAG_END('>')
+          PsiErrorElement:Element c is not closed
+            <empty list>
+        XmlText
+          PsiWhiteSpace('\n')
+          XmlToken:XML_DATA_CHARACTERS('xxx')
+          PsiWhiteSpace(' \n')
+          XmlToken:XML_DATA_CHARACTERS('xxxx')
+          PsiWhiteSpace('\n')
+        XmlTag:
+          XmlToken:XML_START_TAG_START('<')
+          PsiErrorElement:Tag name expected
+            <empty list>
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing14.txt b/xml/tests/testData/psi/testNewParsing14.txt
new file mode 100644
index 0000000..68db9c1
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing14.txt
@@ -0,0 +1,27 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:a
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('a')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('ajsdg')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_EQ('=')
+          PsiWhiteSpace(' ')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_TAG_END('>')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('a')
+        XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing15.txt b/xml/tests/testData/psi/testNewParsing15.txt
new file mode 100644
index 0000000..e7ca8b7
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing15.txt
@@ -0,0 +1,47 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('a')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_MARKUP_DECL)
+          XmlToken:XML_MARKUP_START('[')
+          PsiElement(XML_ELEMENT_DECL)
+            XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_NAME('a')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ELEMENT_CONTENT_SPEC)
+              PsiElement(XML_ELEMENT_CONTENT_GROUP)
+                XmlToken:XML_LEFT_PAREN('(')
+                XmlToken:XML_NAME('a')
+                XmlToken:XML_RIGHT_PAREN(')')
+            XmlToken:XML_TAG_END('>')
+          XmlToken:XML_MARKUP_END(']')
+        XmlToken:XML_DOCTYPE_END('>')
+      PsiWhiteSpace(' ')
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:a
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('a')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('ajsdg')
+          PsiWhiteSpace(' ')
+          XmlToken:XML_EQ('=')
+          PsiWhiteSpace(' ')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_TAG_END('>')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('a')
+        XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing16.txt b/xml/tests/testData/psi/testNewParsing16.txt
new file mode 100644
index 0000000..4ff3d9d
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing16.txt
@@ -0,0 +1,24 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element is not closed
+          <empty list>
+      XmlTag:s
+        XmlToken:XML_START_TAG_START('<')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('s')
+        PsiErrorElement:Element is not closed
+          <empty list>
+      XmlToken:XML_DATA_CHARACTERS('/b>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing17.txt b/xml/tests/testData/psi/testNewParsing17.txt
new file mode 100644
index 0000000..c6be853
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing17.txt
@@ -0,0 +1,334 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:project
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('project')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('default')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('make')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n ')
+      XmlTag:target
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('target')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('name')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('make')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('description')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('Create distributable ZIP file')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('depends')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('init,clean,obfuscate,jar')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_EMPTY_ELEMENT_END('/>')
+      XmlText
+        PsiWhiteSpace('\n ')
+      XmlTag:target
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('target')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('name')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('init')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:property
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('property')
+          PsiWhiteSpace(' ')
+          PsiElement(XML_ATTRIBUTE)
+            XmlToken:XML_NAME('name')
+            XmlToken:XML_EQ('=')
+            PsiElement(XML_ATTRIBUTE_VALUE)
+              XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+              XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('deploy')
+              XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+          PsiWhiteSpace(' ')
+          PsiElement(XML_ATTRIBUTE)
+            XmlToken:XML_NAME('value')
+            XmlToken:XML_EQ('=')
+            PsiElement(XML_ATTRIBUTE_VALUE)
+              XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+              XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('../deploy')
+              XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+          XmlToken:XML_EMPTY_ELEMENT_END('/>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:mkdir
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('mkdir')
+          PsiWhiteSpace(' ')
+          PsiElement(XML_ATTRIBUTE)
+            XmlToken:XML_NAME('dir')
+            XmlToken:XML_EQ('=')
+            PsiElement(XML_ATTRIBUTE_VALUE)
+              XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+              XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('${deploy}')
+              XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+          XmlToken:XML_EMPTY_ELEMENT_END('/>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('target')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n ')
+      XmlTag:target
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('target')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('name')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('clean')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:delete
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('delete')
+          PsiWhiteSpace(' ')
+          PsiElement(XML_ATTRIBUTE)
+            XmlToken:XML_NAME('includeemptydirs')
+            XmlToken:XML_EQ('=')
+            PsiElement(XML_ATTRIBUTE_VALUE)
+              XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+              XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('true')
+              XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:fileset
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('fileset')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('dir')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('${deploy}')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('includes')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('**/*')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_EMPTY_ELEMENT_END('/>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('delete')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('target')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n ')
+      XmlTag:target
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('target')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('name')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('obfuscate')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:exec
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('exec')
+          PsiWhiteSpace(' ')
+          PsiElement(XML_ATTRIBUTE)
+            XmlToken:XML_NAME('executable')
+            XmlToken:XML_EQ('=')
+            PsiElement(XML_ATTRIBUTE_VALUE)
+              XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+              XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('C:/java/zkm/zkm.bat')
+              XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+          PsiWhiteSpace(' ')
+          PsiElement(XML_ATTRIBUTE)
+            XmlToken:XML_NAME('dir')
+            XmlToken:XML_EQ('=')
+            PsiElement(XML_ATTRIBUTE_VALUE)
+              XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+              XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('${deploy}')
+              XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:arg
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('arg')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('../plugin/obfuscate.properties')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_EMPTY_ELEMENT_END('/>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('exec')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('target')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n ')
+      XmlTag:target
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('target')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('name')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('jar')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:jar
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('jar')
+          PsiWhiteSpace(' ')
+          PsiElement(XML_ATTRIBUTE)
+            XmlToken:XML_NAME('jarfile')
+            XmlToken:XML_EQ('=')
+            PsiElement(XML_ATTRIBUTE_VALUE)
+              XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+              XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('${deploy}/idea4-jprofiler.jar')
+              XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:metainf
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('metainf')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('dir')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('./META-INF')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('includes')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('plugin.xml')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_EMPTY_ELEMENT_END('/>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:fileset
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('fileset')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('dir')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('${deploy}')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:include
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('include')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('name')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('com/**')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_EMPTY_ELEMENT_END('/>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('fileset')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:fileset
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('fileset')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('dir')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('rsc')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_EMPTY_ELEMENT_END('/>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('jar')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('target')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('project')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing18.txt b/xml/tests/testData/psi/testNewParsing18.txt
new file mode 100644
index 0000000..b0a89d2
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing18.txt
@@ -0,0 +1,1372 @@
+PsiElement(XML_DOCUMENT)
+  PsiElement(XML_PROLOG)
+    <empty list>
+  XmlTag:root
+    XmlToken:XML_START_TAG_START('<')
+    XmlToken:XML_NAME('root')
+    PsiWhiteSpace(' ')
+    PsiElement(XML_ATTRIBUTE)
+      XmlToken:XML_NAME('type')
+      XmlToken:XML_EQ('=')
+      PsiElement(XML_ATTRIBUTE_VALUE)
+        XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('com.ubsw.eq.dm.mercury.app.MercurySpec')
+        XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+    XmlToken:XML_TAG_END('>')
+    XmlText
+      PsiWhiteSpace('\n ')
+    XmlTag:_xmlProperties
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('_xmlProperties')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('type')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.util.HashMap')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n ')
+      XmlTag:entries
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('entries')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ATTRIBUTE)
+          XmlToken:XML_NAME('type')
+          XmlToken:XML_EQ('=')
+          PsiElement(XML_ATTRIBUTE_VALUE)
+            XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+            XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('com.ubsw.common.serialization.delegates.MapDelegate$MapEntry[]')
+            XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:element
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:key
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('key')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('DSApplication')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('key')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:value
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('value')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('Mercury')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('value')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:element
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:key
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('key')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('DSEnvironment')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('key')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:value
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('value')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('Mercury/ExtIDCleanUp')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('value')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:element
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:key
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('key')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('DSLocation')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('key')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:value
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('value')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('london')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('value')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:element
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:key
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('key')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('DSLanguage')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('key')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:value
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('value')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('Java')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('value')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:element
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:key
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('key')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('outputOperationList')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('key')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:value
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('value')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('Commit')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('value')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:element
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:key
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('key')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('Objects_InTransaction')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('key')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:value
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('value')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('Commit')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('value')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:element
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:key
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('key')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('LogFolder')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('key')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:value
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('value')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('value')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:element
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:key
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('key')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('ReportFileDir')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('key')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:value
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('value')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/logs/')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('value')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:element
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:key
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('key')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('ExcludedInstrumentListPath')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('key')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:value
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('value')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('C:/Developer/view_local/sherrach_instr.ext.id_local_nt/EQ_INSTR_EXT_ID/config/excludedStocks.txt')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('value')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:element
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:key
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('key')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('ExcludeRefSymList')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('key')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:value
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('value')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('value')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:element
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:key
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('key')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('IncludeRefSymList')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('key')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:value
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('value')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                <empty list>
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('value')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:element
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:key
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('key')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('ExcludeMarkingRunList')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('key')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:value
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('value')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('?:AUTO-NonMarking')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('value')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlToken:XML_END_TAG_START('</')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace('\n ')
+        XmlTag:element
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('element')
+          XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:key
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('key')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                XmlToken:XML_DATA_CHARACTERS('IncludeMarkingRunList')
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('key')
+            XmlToken:XML_TAG_END('>')
+          XmlText
+            PsiWhiteSpace('\n ')
+          XmlTag:value
+            XmlToken:XML_START_TAG_START('<')
+            XmlToken:XML_NAME('value')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE)
+              XmlToken:XML_NAME('type')
+              XmlToken:XML_EQ('=')
+              PsiElement(XML_ATTRIBUTE_VALUE)
+                XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('java.lang.String')
+                XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlTag:value
+              XmlToken:XML_START_TAG_START('<')
+              XmlToken:XML_NAME('value')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('type')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('string')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              PsiWhiteSpace(' ')
+              PsiElement(XML_ATTRIBUTE)
+                XmlToken:XML_NAME('xml:space')
+                XmlToken:XML_EQ('=')
+                PsiElement(XML_ATTRIBUTE_VALUE)
+                  XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+                  XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('preserve')
+                  XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+              XmlToken:XML_TAG_END('>')
+              XmlText
+                <empty list>
+              XmlToken:XML_END_TAG_START('</')
+              XmlToken:XML_NAME('value')
+              XmlToken:XML_TAG_END('>')
+            XmlText
+              PsiWhiteSpace('\n ')
+            XmlToken:XML_END_TAG_START('</')
+            XmlToken:XML_NAME('value')
+            Xml
diff --git a/xml/tests/testData/psi/testNewParsing19.txt b/xml/tests/testData/psi/testNewParsing19.txt
new file mode 100644
index 0000000..de7eda2
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing19.txt
@@ -0,0 +1,68 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('aaa')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_MARKUP_DECL)
+          XmlToken:XML_MARKUP_START('[')
+          PsiElement(XML_ELEMENT_DECL)
+            XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_NAME('a')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ELEMENT_CONTENT_SPEC)
+              <empty list>
+            PsiErrorElement:( or entity ref or EMPTY or ANY expected
+              <empty list>
+            XmlToken:XML_BAD_CHARACTER('#')
+            XmlToken:XML_CONTENT_EMPTY('EMPTY')
+            XmlToken:XML_TAG_END('>')
+          PsiElement(XML_ATTLIST_DECL)
+            XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_NAME('a')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE_DECL)
+              XmlToken:XML_NAME('xx')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_NAME('CDATA')
+              PsiWhiteSpace(' ')
+              XmlToken:XML_ATT_IMPLIED('#IMPLIED')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE_DECL)
+              XmlToken:XML_NAME('yy')
+            PsiWhiteSpace('  ')
+            XmlToken:XML_ATT_IMPLIED('#IMPLIED')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_NAME('zz')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_NAME('CDATA')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_ATT_IMPLIED('#IMPLIED')
+            XmlToken:XML_TAG_END('>')
+          XmlToken:XML_MARKUP_END(']')
+        XmlToken:XML_DOCTYPE_END('>')
+      PsiWhiteSpace('\n')
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        XmlText
+          PsiWhiteSpace(' ')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing2.txt b/xml/tests/testData/psi/testNewParsing2.txt
new file mode 100644
index 0000000..10df473
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing2.txt
@@ -0,0 +1,13 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('   ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing20.txt b/xml/tests/testData/psi/testNewParsing20.txt
new file mode 100644
index 0000000..5dbd3a7
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing20.txt
@@ -0,0 +1,26 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('root')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_MARKUP_DECL)
+          XmlToken:XML_MARKUP_START('[')
+          PsiWhiteSpace('\n')
+          XmlToken:XML_BAD_CHARACTER('<')
+          XmlToken:XML_BAD_CHARACTER('!')
+          PsiWhiteSpace('\n')
+          XmlToken:XML_MARKUP_END(']')
+        XmlToken:XML_DOCTYPE_END('>')
+      PsiWhiteSpace('\n')
+    XmlTag:root
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('root')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace('\n\n')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('root')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing3.txt b/xml/tests/testData/psi/testNewParsing3.txt
new file mode 100644
index 0000000..a6b55ed
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing3.txt
@@ -0,0 +1,14 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      PsiErrorElement:Tag start is not closed
+        <empty list>
+    PsiWhiteSpace('   ')
+    PsiErrorElement:Top level element is not completed
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing4.txt b/xml/tests/testData/psi/testNewParsing4.txt
new file mode 100644
index 0000000..0f27ec9
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing4.txt
@@ -0,0 +1,21 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element b is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing5.txt b/xml/tests/testData/psi/testNewParsing5.txt
new file mode 100644
index 0000000..e67d46e
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing5.txt
@@ -0,0 +1,19 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_EMPTY_ELEMENT_END('/>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing6.txt b/xml/tests/testData/psi/testNewParsing6.txt
new file mode 100644
index 0000000..ee331e6
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing6.txt
@@ -0,0 +1,40 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('greeting')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DOCTYPE_SYSTEM('SYSTEM')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('"hello.dtd"')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_MARKUP_DECL)
+          XmlToken:XML_MARKUP_START('[')
+          PsiElement(XML_ELEMENT_DECL)
+            XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_NAME('greeting')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ELEMENT_CONTENT_SPEC)
+              XmlToken:XML_CONTENT_EMPTY('EMPTY')
+            XmlToken:XML_TAG_END('>')
+          XmlToken:XML_MARKUP_END(']')
+        XmlToken:XML_DOCTYPE_END('>')
+      PsiWhiteSpace(' ')
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_EMPTY_ELEMENT_END('/>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing7.txt b/xml/tests/testData/psi/testNewParsing7.txt
new file mode 100644
index 0000000..687ec67
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing7.txt
@@ -0,0 +1,37 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element b is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlTag:c
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('c')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element c is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlTag:d
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('d')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element d is not closed
+          <empty list>
+      XmlText
+        PsiWhiteSpace(' ')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing8.txt b/xml/tests/testData/psi/testNewParsing8.txt
new file mode 100644
index 0000000..bc7ca62
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing8.txt
@@ -0,0 +1,16 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('blah')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('blah')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_EMPTY_ELEMENT_END('/>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNewParsing9.txt b/xml/tests/testData/psi/testNewParsing9.txt
new file mode 100644
index 0000000..bbe29dd
--- /dev/null
+++ b/xml/tests/testData/psi/testNewParsing9.txt
@@ -0,0 +1,19 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE)
+        XmlToken:XML_NAME('asd')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('asd')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNotation1.txt b/xml/tests/testData/psi/testNotation1.txt
new file mode 100644
index 0000000..600a0fe
--- /dev/null
+++ b/xml/tests/testData/psi/testNotation1.txt
@@ -0,0 +1,16 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_NOTATION_DECL)
+      XmlToken:XML_NOTATION_DECL_START('<!NOTATION')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('data-sources')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_DOCTYPE_SYSTEM('SYSTEM')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ATTRIBUTE_VALUE)
+        XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('x3')
+        XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testNotation2.txt b/xml/tests/testData/psi/testNotation2.txt
new file mode 100644
index 0000000..71144f5
--- /dev/null
+++ b/xml/tests/testData/psi/testNotation2.txt
@@ -0,0 +1,27 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('x3')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_MARKUP_DECL)
+          XmlToken:XML_MARKUP_START('[')
+          PsiElement(XML_NOTATION_DECL)
+            XmlToken:XML_NOTATION_DECL_START('<!NOTATION')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_NAME('data-sources')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_DOCTYPE_SYSTEM('SYSTEM')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ATTRIBUTE_VALUE)
+              XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+              XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('x3')
+              XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+            XmlToken:XML_TAG_END('>')
+          XmlToken:XML_MARKUP_END(']')
+        XmlToken:XML_DOCTYPE_END('>')
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testProcessingInstruction1.txt b/xml/tests/testData/psi/testProcessingInstruction1.txt
new file mode 100644
index 0000000..5b95a61
--- /dev/null
+++ b/xml/tests/testData/psi/testProcessingInstruction1.txt
@@ -0,0 +1,12 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_PROCESSING_INSTRUCTION)
+        XmlToken:XML_PI_START('<?')
+        XmlToken:XML_NAME('This')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_TAG_CHARACTERS('is="PI"')
+        XmlToken:XML_PI_END('?>')
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testProcessingInstruction2.txt b/xml/tests/testData/psi/testProcessingInstruction2.txt
new file mode 100644
index 0000000..7bfd365
--- /dev/null
+++ b/xml/tests/testData/psi/testProcessingInstruction2.txt
@@ -0,0 +1,17 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      PsiElement(XML_PROCESSING_INSTRUCTION)
+        XmlToken:XML_PI_START('<?')
+        XmlToken:XML_NAME('This')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_TAG_CHARACTERS('is="PI"')
+        XmlToken:XML_PI_END('?>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testProcessingInstruction3.txt b/xml/tests/testData/psi/testProcessingInstruction3.txt
new file mode 100644
index 0000000..0bb1531
--- /dev/null
+++ b/xml/tests/testData/psi/testProcessingInstruction3.txt
@@ -0,0 +1,49 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_PROCESSING_INSTRUCTION)
+        XmlToken:XML_PI_START('<?')
+        XmlToken:XML_NAME('xml')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('version')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('1.0')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('encoding')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('UTF-8')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_PI_END('?>')
+      PsiElement(XML_PROCESSING_INSTRUCTION)
+        XmlToken:XML_PI_START('<?')
+        XmlToken:XML_NAME('xml-stylesheet')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_TAG_CHARACTERS('type="text/xsl"')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_TAG_CHARACTERS('href="document.xsl"')
+        XmlToken:XML_PI_END('?>')
+      PsiElement(XML_COMMENT)
+        XmlToken:XML_COMMENT_START('<!--')
+        XmlToken:XML_COMMENT_CHARACTERS(' @(#) $Id$ ')
+        XmlToken:XML_COMMENT_END('-->')
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('api')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_DOCTYPE_SYSTEM('SYSTEM')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('"document.dtd"')
+        XmlToken:XML_DOCTYPE_END('>')
+    XmlTag:api
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('api')
+      XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('api')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testPrologInDtd.txt b/xml/tests/testData/psi/testPrologInDtd.txt
new file mode 100644
index 0000000..3fabbb9
--- /dev/null
+++ b/xml/tests/testData/psi/testPrologInDtd.txt
@@ -0,0 +1,40 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DECL)
+        XmlToken:XML_DECL_START('<?xml ')
+        XmlToken:XML_NAME('version')
+        XmlToken:XML_EQ('=')
+        XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('1.0')
+        XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('encoding')
+        XmlToken:XML_EQ('=')
+        XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+        XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('ISO-8859-1')
+        XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        XmlToken:XML_DECL_END('?>')
+    PsiWhiteSpace('\n')
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('idea-plugin')
+      PsiErrorElement:Whitespace expected
+        <empty list>
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        <empty list>
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace('\n')
+    PsiElement(XML_ATTLIST_DECL)
+      XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('idea-plugin')
+      PsiWhiteSpace('\n    ')
+      PsiElement(XML_ATTRIBUTE_DECL)
+        XmlToken:XML_NAME('url')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('CDATA')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_ATT_IMPLIED('#IMPLIED')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testSGMLDtd.txt b/xml/tests/testData/psi/testSGMLDtd.txt
new file mode 100644
index 0000000..ef13209
--- /dev/null
+++ b/xml/tests/testData/psi/testSGMLDtd.txt
@@ -0,0 +1,100 @@
+XmlFile:test.dtd
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('name')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        XmlToken:XML_NAME('-')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('-')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ELEMENT_CONTENT_GROUP)
+          XmlToken:XML_LEFT_PAREN('(')
+          PsiElement(XML_ENTITY_REF)
+            XmlToken:XML_ENTITY_REF_TOKEN('%inline;')
+          XmlToken:XML_RIGHT_PAREN(')')
+        XmlToken:XML_STAR('*')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_PLUS('+')
+        PsiElement(XML_ELEMENT_CONTENT_GROUP)
+          XmlToken:XML_LEFT_PAREN('(')
+          XmlToken:XML_NAME('A')
+          XmlToken:XML_RIGHT_PAREN(')')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace(' ')
+    PsiElement(XML_ATTLIST_DECL)
+      XmlToken:XML_ATTLIST_DECL_START('<!ATTLIST')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_GROUP)
+        XmlToken:XML_LEFT_PAREN('(')
+        XmlToken:XML_NAME('A')
+        XmlToken:XML_BAR('|')
+        XmlToken:XML_NAME('B')
+        XmlToken:XML_RIGHT_PAREN(')')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace('\n')
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_GROUP)
+        XmlToken:XML_LEFT_PAREN('(')
+        XmlToken:XML_NAME('E')
+        XmlToken:XML_BAR('|')
+        XmlToken:XML_NAME('E2')
+        XmlToken:XML_RIGHT_PAREN(')')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        XmlToken:XML_NAME('-')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('O')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ELEMENT_CONTENT_GROUP)
+          XmlToken:XML_LEFT_PAREN('(')
+          PsiElement(XML_ENTITY_REF)
+            XmlToken:XML_ENTITY_REF_TOKEN('%flow;')
+          XmlToken:XML_RIGHT_PAREN(')')
+        XmlToken:XML_STAR('*')
+      PsiWhiteSpace('       ')
+      PsiElement(XML_COMMENT)
+        XmlToken:XML_COMMENT_START('--')
+        XmlToken:XML_COMMENT_CHARACTERS(' table header cell, table data cell')
+        XmlToken:XML_COMMENT_END('--')
+      XmlToken:XML_TAG_END('>')
+    PsiWhiteSpace('\n')
+    PsiElement(XML_ELEMENT_DECL)
+      XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+      PsiWhiteSpace(' ')
+      XmlToken:XML_NAME('BODY')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_ELEMENT_CONTENT_SPEC)
+        XmlToken:XML_NAME('O')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('O')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_ELEMENT_CONTENT_GROUP)
+          XmlToken:XML_LEFT_PAREN('(')
+          PsiElement(XML_ENTITY_REF)
+            XmlToken:XML_ENTITY_REF_TOKEN('%block;')
+          XmlToken:XML_BAR('|')
+          XmlToken:XML_NAME('SCRIPT')
+          XmlToken:XML_RIGHT_PAREN(')')
+        XmlToken:XML_PLUS('+')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_PLUS('+')
+        PsiElement(XML_ELEMENT_CONTENT_GROUP)
+          XmlToken:XML_LEFT_PAREN('(')
+          XmlToken:XML_NAME('INS')
+          XmlToken:XML_BAR('|')
+          XmlToken:XML_NAME('DEL')
+          XmlToken:XML_RIGHT_PAREN(')')
+      PsiWhiteSpace(' ')
+      PsiElement(XML_COMMENT)
+        XmlToken:XML_COMMENT_START('--')
+        XmlToken:XML_COMMENT_CHARACTERS(' document body ')
+        XmlToken:XML_COMMENT_END('--')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testUnbalanced1.txt b/xml/tests/testData/psi/testUnbalanced1.txt
new file mode 100644
index 0000000..bc219d9
--- /dev/null
+++ b/xml/tests/testData/psi/testUnbalanced1.txt
@@ -0,0 +1,17 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element b is not closed
+          <empty list>
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testUnbalanced2.txt b/xml/tests/testData/psi/testUnbalanced2.txt
new file mode 100644
index 0000000..9de3f4f
--- /dev/null
+++ b/xml/tests/testData/psi/testUnbalanced2.txt
@@ -0,0 +1,23 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element b is not closed
+          <empty list>
+      XmlTag:c
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('c')
+        XmlToken:XML_TAG_END('>')
+        PsiErrorElement:Element c is not closed
+          <empty list>
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testUnbalanced3.txt b/xml/tests/testData/psi/testUnbalanced3.txt
new file mode 100644
index 0000000..e0f721a
--- /dev/null
+++ b/xml/tests/testData/psi/testUnbalanced3.txt
@@ -0,0 +1,18 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('bb')
+        XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testUnbalanced4.txt b/xml/tests/testData/psi/testUnbalanced4.txt
new file mode 100644
index 0000000..85f4468
--- /dev/null
+++ b/xml/tests/testData/psi/testUnbalanced4.txt
@@ -0,0 +1,22 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlTag:b
+        XmlToken:XML_START_TAG_START('<')
+        XmlToken:XML_NAME('b')
+        XmlToken:XML_TAG_END('>')
+        XmlTag:b
+          XmlToken:XML_START_TAG_START('<')
+          XmlToken:XML_NAME('b')
+          XmlToken:XML_EMPTY_ELEMENT_END('/>')
+        XmlToken:XML_END_TAG_START('</')
+        XmlToken:XML_NAME('c')
+        XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testUnclosedTag.txt b/xml/tests/testData/psi/testUnclosedTag.txt
new file mode 100644
index 0000000..e128c3c
--- /dev/null
+++ b/xml/tests/testData/psi/testUnclosedTag.txt
@@ -0,0 +1,12 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      XmlToken:XML_TAG_END('>')
+      XmlText
+        XmlToken:XML_DATA_CHARACTERS('xxx')
+      PsiErrorElement:Unexpected end of file
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testUnclosedTag2.txt b/xml/tests/testData/psi/testUnclosedTag2.txt
new file mode 100644
index 0000000..414fedc
--- /dev/null
+++ b/xml/tests/testData/psi/testUnclosedTag2.txt
@@ -0,0 +1,9 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    XmlTag:a
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('a')
+      PsiErrorElement:Tag start is not closed
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testUnopenedTag1.txt b/xml/tests/testData/psi/testUnopenedTag1.txt
new file mode 100644
index 0000000..f20119b
--- /dev/null
+++ b/xml/tests/testData/psi/testUnopenedTag1.txt
@@ -0,0 +1,11 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      <empty list>
+    PsiErrorElement:Top level element is not completed
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('foo')
+      XmlToken:XML_TAG_END('>')
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testXmlDecl.txt b/xml/tests/testData/psi/testXmlDecl.txt
new file mode 100644
index 0000000..a014a77
--- /dev/null
+++ b/xml/tests/testData/psi/testXmlDecl.txt
@@ -0,0 +1,25 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_PROCESSING_INSTRUCTION)
+        XmlToken:XML_PI_START('<?')
+        XmlToken:XML_NAME('xml')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('version')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('1.0')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('encoding')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER(''')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('cp1251')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER(''')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_PI_END('?>')
+    XmlTag:
+      PsiErrorElement:Valid XML document must have a root tag
+        <empty list>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testXmlDecl2.txt b/xml/tests/testData/psi/testXmlDecl2.txt
new file mode 100644
index 0000000..d4c09ad
--- /dev/null
+++ b/xml/tests/testData/psi/testXmlDecl2.txt
@@ -0,0 +1,30 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_PROCESSING_INSTRUCTION)
+        XmlToken:XML_PI_START('<?')
+        XmlToken:XML_NAME('xml')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('version')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('1.0')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('encoding')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER(''')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('cp1251')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER(''')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_PI_END('?>')
+      PsiWhiteSpace(' ')
+    XmlTag:foo
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('foo')
+      XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('foo')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testXmlDecl3.txt b/xml/tests/testData/psi/testXmlDecl3.txt
new file mode 100644
index 0000000..d7d6245
--- /dev/null
+++ b/xml/tests/testData/psi/testXmlDecl3.txt
@@ -0,0 +1,33 @@
+XmlFile:test.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_PROCESSING_INSTRUCTION)
+        XmlToken:XML_PI_START('<?')
+        XmlToken:XML_NAME('xml')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('version')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER('"')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('1.0')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER('"')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('encoding')
+        XmlToken:XML_EQ('=')
+        PsiElement(XML_ATTRIBUTE_VALUE)
+          XmlToken:XML_ATTRIBUTE_VALUE_START_DELIMITER(''')
+          XmlToken:XML_ATTRIBUTE_VALUE_TOKEN('cp1251')
+          XmlToken:XML_ATTRIBUTE_VALUE_END_DELIMITER(''')
+        PsiErrorElement:Processing instruction not terminated
+          <empty list>
+    PsiWhiteSpace(' ')
+    PsiErrorElement:Unexpected tokens
+      XmlToken:XML_DATA_CHARACTERS('>')
+    PsiWhiteSpace(' ')
+    XmlTag:foo
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('foo')
+      XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('foo')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/testXmlDeclDtd.txt b/xml/tests/testData/psi/testXmlDeclDtd.txt
new file mode 100644
index 0000000..71f3417
--- /dev/null
+++ b/xml/tests/testData/psi/testXmlDeclDtd.txt
@@ -0,0 +1,52 @@
+XmlFile:x.xml
+  PsiElement(XML_DOCUMENT)
+    PsiElement(XML_PROLOG)
+      PsiElement(XML_DOCTYPE)
+        XmlToken:XML_DOCTYPE_START('<!DOCTYPE')
+        PsiWhiteSpace(' ')
+        XmlToken:XML_NAME('name')
+        PsiWhiteSpace(' ')
+        PsiElement(XML_MARKUP_DECL)
+          XmlToken:XML_MARKUP_START('[')
+          PsiWhiteSpace('\n  ')
+          PsiElement(XML_ELEMENT_DECL)
+            XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_NAME('name')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ELEMENT_CONTENT_SPEC)
+              PsiElement(XML_ELEMENT_CONTENT_GROUP)
+                XmlToken:XML_LEFT_PAREN('(')
+                XmlToken:XML_NAME('a')
+                PsiWhiteSpace(' ')
+                XmlToken:XML_NAME('b')
+                PsiWhiteSpace(' ')
+                XmlToken:XML_NAME('c')
+                PsiWhiteSpace(' ')
+                XmlToken:XML_NAME('d')
+                XmlToken:XML_RIGHT_PAREN(')')
+            XmlToken:XML_TAG_END('>')
+          PsiWhiteSpace('\n  ')
+          PsiElement(XML_ELEMENT_DECL)
+            XmlToken:XML_ELEMENT_DECL_START('<!ELEMENT')
+            PsiWhiteSpace(' ')
+            XmlToken:XML_NAME('name2')
+            PsiWhiteSpace(' ')
+            PsiElement(XML_ELEMENT_CONTENT_SPEC)
+              PsiElement(XML_ELEMENT_CONTENT_GROUP)
+                XmlToken:XML_LEFT_PAREN('(')
+                PsiElement(XML_ENTITY_REF)
+                  XmlToken:XML_ENTITY_REF_TOKEN('%entity;')
+                XmlToken:XML_RIGHT_PAREN(')')
+            XmlToken:XML_TAG_END('>')
+          PsiWhiteSpace('\n')
+          XmlToken:XML_MARKUP_END(']')
+        XmlToken:XML_DOCTYPE_END('>')
+      PsiWhiteSpace('\n')
+    XmlTag:name
+      XmlToken:XML_START_TAG_START('<')
+      XmlToken:XML_NAME('name')
+      XmlToken:XML_TAG_END('>')
+      XmlToken:XML_END_TAG_START('</')
+      XmlToken:XML_NAME('name')
+      XmlToken:XML_TAG_END('>')
\ No newline at end of file
diff --git a/xml/tests/testData/psi/xi/include1.xml b/xml/tests/testData/psi/xi/include1.xml
new file mode 100644
index 0000000..5c992d7
--- /dev/null
+++ b/xml/tests/testData/psi/xi/include1.xml
@@ -0,0 +1,9 @@
+<include1>
+  <foo attr1="val1">
+    <fooChild/>
+  </foo>
+
+  <bar>
+
+  </bar>
+</include1>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/xi/testBasicXi.xml b/xml/tests/testData/psi/xi/testBasicXi.xml
new file mode 100644
index 0000000..315f457
--- /dev/null
+++ b/xml/tests/testData/psi/xi/testBasicXi.xml
@@ -0,0 +1,5 @@
+<root xmlns:xi="http://www.w3.org/2001/XInclude">
+  <before/>
+  <xi:include href="include1.xml"/>
+  <after/>
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/psi/xi/testXpointerXi1.xml b/xml/tests/testData/psi/xi/testXpointerXi1.xml
new file mode 100644
index 0000000..76e9f56
--- /dev/null
+++ b/xml/tests/testData/psi/xi/testXpointerXi1.xml
@@ -0,0 +1,5 @@
+<root xmlns:xi="http://www.w3.org/2001/XInclude">
+  <before/>
+  <xi:include href="include1.xml" xpointer="xpointer(/include1/*)"/>
+  <after/>
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/1.dtd b/xml/tests/testData/quickFix/fetchExternalResources/1.dtd
new file mode 100644
index 0000000..f8b0436
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/1.dtd
@@ -0,0 +1,17 @@
+<!ENTITY % HTMLlat1 PUBLIC
+   "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+   "xhtml-lat1.ent">
+
+<!ENTITY % HTMLsymbol PUBLIC
+   "-//W3C//ENTITIES Symbols for XHTML//EN"
+   "xhtml-symbol.ent">
+
+<!ENTITY % HTMLspecial PUBLIC
+   "-//W3C//ENTITIES Special for XHTML//EN"
+   "xhtml-special.ent">
+
+<!ENTITY % HTMLspecial PUBLIC
+   "-//W3C//ENTITIES Special for XHTML//EN"
+   "xhtml-special.ent">
+
+<!ENTITY % ContentType "CDATA">
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/1.xsd b/xml/tests/testData/quickFix/fetchExternalResources/1.xsd
new file mode 100644
index 0000000..c6f8bb7
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/1.xsd
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+	    targetNamespace="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	    elementFormDefault="qualified"
+	    attributeFormDefault="unqualified"
+	    version="2.4">
+
+  <xsd:include schemaLocation="j2ee_1_4.xsd"/>
+  <include schemaLocation="jsp_2_0.xsd"/>
+
+</xsd:schema>
+
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/2.dtd b/xml/tests/testData/quickFix/fetchExternalResources/2.dtd
new file mode 100644
index 0000000..6a22e2c
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/2.dtd
@@ -0,0 +1,105 @@
+
+<!ENTITY % sgml.features "IGNORE">
+<![%sgml.features;[
+<!ENTITY % xml.features "IGNORE">
+]]>
+<!ENTITY % xml.features "INCLUDE">
+
+<![%sgml.features;[
+<![%xml.features;[
+
+<!-- ERROR: Exactly one of xml.features and sgml.features must be turned on! -->
+<!ENTITY % dbnotn SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+<!ENTITY % dbcent SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+<!ENTITY % dbpool SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+<!ENTITY % dbhier SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+<!ENTITY % dbgenent SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+
+]]>
+]]>
+
+<![%sgml.features;[
+<!ENTITY % ho "- O">
+<!ENTITY % hh "- -">
+]]>
+
+<![%xml.features;[
+<!ENTITY % ho "">
+<!ENTITY % hh "">
+]]>
+
+<!ENTITY % dbnotn.module "INCLUDE">
+<![%dbnotn.module;[
+<!ENTITY % dbnotn PUBLIC
+"-//OASIS//ENTITIES DocBook Notations V4.4//EN"
+"dbnotnx.mod">
+%dbnotn;
+]]>
+
+<!-- ...................................................................... -->
+<!-- ISO character entity sets ............................................ -->
+
+<!ENTITY % dbcent.module "INCLUDE">
+<![%dbcent.module;[
+
+<!ENTITY % dbcent.euro "INCLUDE">
+<![%dbcent.euro;[
+<![%sgml.features;[
+<!ENTITY euro SDATA "[euro  ]"><!-- euro sign -->
+]]>
+<![%xml.features;[
+<!ENTITY euro "&#x20AC;"><!-- euro sign, U+20AC NEW -->
+]]>
+]]>
+
+<!ENTITY % dbcent PUBLIC
+"-//OASIS//ENTITIES DocBook Character Entities V4.4//EN"
+"dbcentx.mod">
+%dbcent;
+]]>
+
+<!-- ...................................................................... -->
+<!-- DTD modules .......................................................... -->
+
+<!-- Information pool .............. -->
+
+<!ENTITY % dbpool.module "INCLUDE">
+<![ %dbpool.module; [
+<!ENTITY % dbpool PUBLIC
+"-//OASIS//ELEMENTS DocBook Information Pool V4.4//EN"
+"dbpoolx.mod">
+%dbpool;
+]]>
+
+<!-- Redeclaration placeholder ..... -->
+
+<!ENTITY % intermod.redecl.module "IGNORE">
+<![%intermod.redecl.module;[
+<!-- Defining rdbmods here makes some buggy XML parsers happy. -->
+<!ENTITY % rdbmods "">
+%rdbmods;
+<!--end of intermod.redecl.module-->]]>
+
+<!-- Document hierarchy ............ -->
+
+<!ENTITY % dbhier.module "INCLUDE">
+<![ %dbhier.module; [
+<!ENTITY % dbhier PUBLIC
+"-//OASIS//ELEMENTS DocBook Document Hierarchy V4.4//EN"
+"dbhierx.mod">
+%dbhier;
+]]>
+
+<!-- ...................................................................... -->
+<!-- Other general entities ............................................... -->
+
+<!ENTITY % dbgenent.module "INCLUDE">
+<![ %dbgenent.module; [
+<!ENTITY % dbgenent PUBLIC
+"-//OASIS//ENTITIES DocBook Additional General Entities V4.4//EN"
+"dbgenent.mod">
+%dbgenent;
+]]>
+
+<!-- End of DocBook XML DTD V4.4 .......................................... -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/2.mod b/xml/tests/testData/quickFix/fetchExternalResources/2.mod
new file mode 100644
index 0000000..d76d3dd
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/2.mod
@@ -0,0 +1,8355 @@
+<!-- ...................................................................... -->
+<!-- DocBook XML information pool module V4.4 ............................. -->
+<!-- File dbpoolx.mod ..................................................... -->
+
+<!-- Copyright 1992-2004 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     $Id: dbpoolx.mod,v 1.107 2005/01/27 13:52:00 nwalsh Exp $
+
+     Permission to use, copy, modify and distribute the DocBook XML DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook XML DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This module contains the definitions for the objects, inline
+     elements, and so on that are available to be used as the main
+     content of DocBook documents.  Some elements are useful for general
+     publishing, and others are useful specifically for computer
+     documentation.
+
+     This module has the following dependencies on other modules:
+
+     o It assumes that a %notation.class; entity is defined by the
+       driver file or other high-level module.  This entity is
+       referenced in the NOTATION attributes for the graphic-related and
+       ModeSpec elements.
+
+     o It assumes that an appropriately parameterized table module is
+       available for use with the table-related elements.
+
+     In DTD driver files referring to this module, please use an entity
+     declaration that uses the public identifier shown below:
+
+     <!ENTITY % dbpool PUBLIC
+     "-//OASIS//ELEMENTS DocBook XML Information Pool V4.4//EN"
+     "dbpoolx.mod">
+     %dbpool;
+
+     See the documentation for detailed information on the parameter
+     entity and module scheme used in DocBook, customizing DocBook and
+     planning for interchange, and changes made since the last release
+     of DocBook.
+-->
+
+<!-- ...................................................................... -->
+<!-- Forms entities ....................................................... -->
+<!-- These PEs provide the hook by which the forms module can be inserted   -->
+<!-- into the DTD. -->
+<!ENTITY % forminlines.hook "">
+<!ENTITY % forms.hook "">
+
+<!-- ...................................................................... -->
+<!-- General-purpose semantics entities ................................... -->
+
+<!ENTITY % yesorno.attvals	"CDATA">
+
+<!-- ...................................................................... -->
+<!-- Entities for module inclusions ....................................... -->
+
+<!ENTITY % dbpool.redecl.module "IGNORE">
+
+<!-- ...................................................................... -->
+<!-- Entities for element classes and mixtures ............................ -->
+
+<!-- "Ubiquitous" classes: ndxterm.class and beginpage -->
+
+<!ENTITY % local.ndxterm.class "">
+<!ENTITY % ndxterm.class
+		"indexterm %local.ndxterm.class;">
+
+<!-- Object-level classes ................................................. -->
+
+<!ENTITY % local.list.class "">
+<!ENTITY % list.class
+		"calloutlist|glosslist|bibliolist|itemizedlist|orderedlist|segmentedlist
+		|simplelist|variablelist %local.list.class;">
+
+<!ENTITY % local.admon.class "">
+<!ENTITY % admon.class
+		"caution|important|note|tip|warning %local.admon.class;">
+
+<!ENTITY % local.linespecific.class "">
+<!ENTITY % linespecific.class
+		"literallayout|programlisting|programlistingco|screen
+		|screenco|screenshot %local.linespecific.class;">
+
+<!ENTITY % local.method.synop.class "">
+<!ENTITY % method.synop.class
+		"constructorsynopsis
+                 |destructorsynopsis
+                 |methodsynopsis %local.method.synop.class;">
+
+<!ENTITY % local.synop.class "">
+<!ENTITY % synop.class
+		"synopsis|cmdsynopsis|funcsynopsis
+                 |classsynopsis|fieldsynopsis
+                 |%method.synop.class; %local.synop.class;">
+
+<!ENTITY % local.para.class "">
+<!ENTITY % para.class
+		"formalpara|para|simpara %local.para.class;">
+
+<!ENTITY % local.informal.class "">
+<!ENTITY % informal.class
+		"address|blockquote
+                |graphic|graphicco|mediaobject|mediaobjectco
+                |informalequation
+		|informalexample
+                |informalfigure
+                |informaltable %local.informal.class;">
+
+<!ENTITY % local.formal.class "">
+<!ENTITY % formal.class
+		"equation|example|figure|table %local.formal.class;">
+
+<!-- The DocBook TC may produce an official EBNF module for DocBook. -->
+<!-- This PE provides the hook by which it can be inserted into the DTD. -->
+<!ENTITY % ebnf.block.hook "">
+
+<!ENTITY % local.compound.class "">
+<!ENTITY % compound.class
+		"msgset|procedure|sidebar|qandaset|task
+                 %ebnf.block.hook;
+                 %local.compound.class;">
+
+<!ENTITY % local.genobj.class "">
+<!ENTITY % genobj.class
+		"anchor|bridgehead|remark|highlights
+		%local.genobj.class;">
+
+<!ENTITY % local.descobj.class "">
+<!ENTITY % descobj.class
+		"abstract|authorblurb|epigraph
+		%local.descobj.class;">
+
+<!-- Character-level classes .............................................. -->
+
+<!ENTITY % local.xref.char.class "">
+<!ENTITY % xref.char.class
+		"footnoteref|xref|biblioref %local.xref.char.class;">
+
+<!ENTITY % local.gen.char.class "">
+<!ENTITY % gen.char.class
+		"abbrev|acronym|citation|citerefentry|citetitle|emphasis
+		|firstterm|foreignphrase|glossterm|footnote|phrase|orgname
+		|quote|trademark|wordasword|personname %local.gen.char.class;">
+
+<!ENTITY % local.link.char.class "">
+<!ENTITY % link.char.class
+		"link|olink|ulink %local.link.char.class;">
+
+<!-- The DocBook TC may produce an official EBNF module for DocBook. -->
+<!-- This PE provides the hook by which it can be inserted into the DTD. -->
+<!ENTITY % ebnf.inline.hook "">
+
+<!ENTITY % local.tech.char.class "">
+<!ENTITY % tech.char.class
+		"action|application
+                |classname|methodname|interfacename|exceptionname
+                |ooclass|oointerface|ooexception
+                |package
+                |command|computeroutput
+		|database|email|envar|errorcode|errorname|errortype|errortext|filename
+		|function|guibutton|guiicon|guilabel|guimenu|guimenuitem
+		|guisubmenu|hardware|interface|keycap
+		|keycode|keycombo|keysym|literal|code|constant|markup|medialabel
+		|menuchoice|mousebutton|option|optional|parameter
+		|prompt|property|replaceable|returnvalue|sgmltag|structfield
+		|structname|symbol|systemitem|uri|token|type|userinput|varname
+                %ebnf.inline.hook;
+		%local.tech.char.class;">
+
+<!ENTITY % local.base.char.class "">
+<!ENTITY % base.char.class
+		"anchor %local.base.char.class;">
+
+<!ENTITY % local.docinfo.char.class "">
+<!ENTITY % docinfo.char.class
+		"author|authorinitials|corpauthor|corpcredit|modespec|othercredit
+		|productname|productnumber|revhistory
+		%local.docinfo.char.class;">
+
+<!ENTITY % local.other.char.class "">
+<!ENTITY % other.char.class
+		"remark|subscript|superscript %local.other.char.class;">
+
+<!ENTITY % local.inlineobj.char.class "">
+<!ENTITY % inlineobj.char.class
+		"inlinegraphic|inlinemediaobject|inlineequation %local.inlineobj.char.class;">
+
+<!-- ...................................................................... -->
+<!-- Entities for content models .......................................... -->
+
+<!ENTITY % formalobject.title.content "title, titleabbrev?">
+
+<!-- Redeclaration placeholder ............................................ -->
+
+<!-- For redeclaring entities that are declared after this point while
+     retaining their references to the entities that are declared before
+     this point -->
+
+<![%dbpool.redecl.module;[
+<!-- Defining rdbpool here makes some buggy XML parsers happy. -->
+<!ENTITY % rdbpool "">
+%rdbpool;
+<!--end of dbpool.redecl.module-->]]>
+
+<!-- Object-level mixtures ................................................ -->
+
+<!--
+                      list admn line synp para infm form cmpd gen  desc
+Component mixture       X    X    X    X    X    X    X    X    X    X
+Sidebar mixture         X    X    X    X    X    X    X    a    X
+Footnote mixture        X         X    X    X    X
+Example mixture         X         X    X    X    X
+Highlights mixture      X    X              X
+Paragraph mixture       X         X    X         X
+Admonition mixture      X         X    X    X    X    X    b    c
+Figure mixture                    X    X         X
+Table entry mixture     X    X    X         X    d
+Glossary def mixture    X         X    X    X    X         e
+Legal notice mixture    X    X    X         X    f
+
+a. Just Procedure; not Sidebar itself or MsgSet.
+b. No MsgSet.
+c. No Highlights.
+d. Just Graphic; no other informal objects.
+e. No Anchor, BridgeHead, or Highlights.
+f. Just BlockQuote; no other informal objects.
+-->
+
+<!ENTITY % local.component.mix "">
+<!ENTITY % component.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|%compound.class;
+		|%genobj.class;		|%descobj.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.component.mix;">
+
+<!ENTITY % local.sidebar.mix "">
+<!ENTITY % sidebar.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|procedure
+		|%genobj.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.sidebar.mix;">
+
+<!ENTITY % local.qandaset.mix "">
+<!ENTITY % qandaset.mix
+		"%list.class;           |%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|procedure
+		|%genobj.class;
+		|%ndxterm.class;
+		%forms.hook;
+                %local.qandaset.mix;">
+
+<!ENTITY % local.revdescription.mix "">
+<!ENTITY % revdescription.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|procedure
+		|%genobj.class;
+		|%ndxterm.class;
+		%local.revdescription.mix;">
+
+<!ENTITY % local.footnote.mix "">
+<!ENTITY % footnote.mix
+		"%list.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		%local.footnote.mix;">
+
+<!ENTITY % local.example.mix "">
+<!ENTITY % example.mix
+		"%list.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.example.mix;">
+
+<!ENTITY % local.highlights.mix "">
+<!ENTITY % highlights.mix
+		"%list.class;		|%admon.class;
+		|%para.class;
+		|%ndxterm.class;
+		%local.highlights.mix;">
+
+<!-- %formal.class; is explicitly excluded from many contexts in which
+     paragraphs are used -->
+<!ENTITY % local.para.mix "">
+<!ENTITY % para.mix
+		"%list.class;           |%admon.class;
+		|%linespecific.class;
+					|%informal.class;
+		|%formal.class;
+		%local.para.mix;">
+
+<!ENTITY % local.admon.mix "">
+<!ENTITY % admon.mix
+		"%list.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|procedure|sidebar
+		|anchor|bridgehead|remark
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.admon.mix;">
+
+<!ENTITY % local.figure.mix "">
+<!ENTITY % figure.mix
+		"%linespecific.class;	|%synop.class;
+					|%informal.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.figure.mix;">
+
+<!ENTITY % local.tabentry.mix "">
+<!ENTITY % tabentry.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;
+		|%para.class;		|graphic|mediaobject
+		%forms.hook;
+		%local.tabentry.mix;">
+
+<!ENTITY % local.glossdef.mix "">
+<!ENTITY % glossdef.mix
+		"%list.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;
+		|remark
+		|%ndxterm.class;        |beginpage
+		%local.glossdef.mix;">
+
+<!ENTITY % local.legalnotice.mix "">
+<!ENTITY % legalnotice.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;
+		|%para.class;		|blockquote
+		|%ndxterm.class;        |beginpage
+		%local.legalnotice.mix;">
+
+<!ENTITY % local.textobject.mix "">
+<!ENTITY % textobject.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;
+		|%para.class;		|blockquote
+		%local.textobject.mix;">
+
+<!ENTITY % local.mediaobject.mix "">
+<!ENTITY % mediaobject.mix
+		"videoobject|audioobject|imageobject|imageobjectco|textobject %local.mediaobject.mix;">
+
+<!ENTITY % local.listpreamble.mix "">
+<!ENTITY % listpreamble.mix
+		"                  	 %admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%genobj.class;		|%descobj.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.listpreamble.mix;">
+
+<!-- Character-level mixtures ............................................. -->
+
+<![%sgml.features;[
+<!ENTITY % local.ubiq.mix "">
+<!ENTITY % ubiq.mix "%ndxterm.class;|beginpage %local.ubiq.mix;">
+
+<!ENTITY % ubiq.exclusion "-(%ubiq.mix)">
+<!ENTITY % ubiq.inclusion "+(%ubiq.mix)">
+
+<!ENTITY % footnote.exclusion "-(footnote|%formal.class;)">
+<!ENTITY % highlights.exclusion "-(%ubiq.mix;|%formal.class;)">
+<!ENTITY % admon.exclusion "-(%admon.class;)">
+<!ENTITY % formal.exclusion "-(%formal.class;)">
+<!ENTITY % acronym.exclusion "-(acronym)">
+<!ENTITY % beginpage.exclusion "-(beginpage)">
+<!ENTITY % ndxterm.exclusion "-(%ndxterm.class;)">
+<!ENTITY % blockquote.exclusion "-(epigraph)">
+<!ENTITY % remark.exclusion "-(remark|%ubiq.mix;)">
+<!ENTITY % glossterm.exclusion "-(glossterm)">
+<!ENTITY % links.exclusion "-(link|olink|ulink|xref|biblioref)">
+]]><!-- sgml.features -->
+
+<!-- not [sgml.features[ -->
+<!ENTITY % local.ubiq.mix "">
+<!ENTITY % ubiq.mix "">
+
+<!ENTITY % ubiq.exclusion "">
+<!ENTITY % ubiq.inclusion "">
+
+<!ENTITY % footnote.exclusion "">
+<!ENTITY % highlights.exclusion "">
+<!ENTITY % admon.exclusion "">
+<!ENTITY % formal.exclusion "">
+<!ENTITY % acronym.exclusion "">
+<!ENTITY % beginpage.exclusion "">
+<!ENTITY % ndxterm.exclusion "">
+<!ENTITY % blockquote.exclusion "">
+<!ENTITY % remark.exclusion "">
+<!ENTITY % glossterm.exclusion "">
+<!ENTITY % links.exclusion "">
+<!-- ]] not sgml.features -->
+
+<!--
+                    #PCD xref word link cptr base dnfo othr inob (synop)
+para.char.mix         X    X    X    X    X    X    X    X    X
+title.char.mix        X    X    X    X    X    X    X    X    X
+ndxterm.char.mix      X    X    X    X    X    X    X    X    a
+cptr.char.mix         X              X    X    X         X    a
+smallcptr.char.mix    X                   b                   a
+word.char.mix         X         c    X         X         X    a
+docinfo.char.mix      X         d    X    b              X    a
+
+a. Just InlineGraphic; no InlineEquation.
+b. Just Replaceable; no other computer terms.
+c. Just Emphasis and Trademark; no other word elements.
+d. Just Acronym, Emphasis, and Trademark; no other word elements.
+-->
+
+<!ENTITY % local.para.char.mix "">
+<!ENTITY % para.char.mix
+		"#PCDATA
+		|%xref.char.class;	|%gen.char.class;
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;	|%docinfo.char.class;
+		|%other.char.class;	|%inlineobj.char.class;
+		|%synop.class;
+		|%ndxterm.class;        |beginpage
+                %forminlines.hook;
+		%local.para.char.mix;">
+
+<!ENTITY % local.title.char.mix "">
+<!ENTITY % title.char.mix
+		"#PCDATA
+		|%xref.char.class;	|%gen.char.class;
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;	|%docinfo.char.class;
+		|%other.char.class;	|%inlineobj.char.class;
+		|%ndxterm.class;
+		%local.title.char.mix;">
+
+<!ENTITY % local.ndxterm.char.mix "">
+<!ENTITY % ndxterm.char.mix
+		"#PCDATA
+		|%xref.char.class;	|%gen.char.class;
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;	|%docinfo.char.class;
+		|%other.char.class;	|inlinegraphic|inlinemediaobject
+		%local.ndxterm.char.mix;">
+
+<!ENTITY % local.cptr.char.mix "">
+<!ENTITY % cptr.char.mix
+		"#PCDATA
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;
+		|%other.char.class;	|inlinegraphic|inlinemediaobject
+		|%ndxterm.class;        |beginpage
+		%local.cptr.char.mix;">
+
+<!ENTITY % local.smallcptr.char.mix "">
+<!ENTITY % smallcptr.char.mix
+		"#PCDATA
+					|replaceable
+					|inlinegraphic|inlinemediaobject
+		|%ndxterm.class;        |beginpage
+		%local.smallcptr.char.mix;">
+
+<!ENTITY % local.word.char.mix "">
+<!ENTITY % word.char.mix
+		"#PCDATA
+					|acronym|emphasis|trademark
+		|%link.char.class;
+		|%base.char.class;
+		|%other.char.class;	|inlinegraphic|inlinemediaobject
+		|%ndxterm.class;        |beginpage
+		%local.word.char.mix;">
+
+<!ENTITY % local.docinfo.char.mix "">
+<!ENTITY % docinfo.char.mix
+		"#PCDATA
+		|%link.char.class;
+					|emphasis|trademark
+					|replaceable
+		|%other.char.class;	|inlinegraphic|inlinemediaobject
+		|%ndxterm.class;
+		%local.docinfo.char.mix;">
+<!--ENTITY % bibliocomponent.mix (see Bibliographic section, below)-->
+<!--ENTITY % person.ident.mix (see Bibliographic section, below)-->
+
+<!-- ...................................................................... -->
+<!-- Entities for attributes and attribute components ..................... -->
+
+<!-- Effectivity attributes ............................................... -->
+
+
+<!-- Arch: Computer or chip architecture to which element applies; no
+	default -->
+
+<!ENTITY % arch.attrib
+	"arch		CDATA		#IMPLIED">
+
+<!-- Condition: General-purpose effectivity attribute -->
+
+<!ENTITY % condition.attrib
+	"condition	CDATA		#IMPLIED">
+
+<!-- Conformance: Standards conformance characteristics -->
+
+<!ENTITY % conformance.attrib
+	"conformance	NMTOKENS	#IMPLIED">
+
+
+<!-- OS: Operating system to which element applies; no default -->
+
+<!ENTITY % os.attrib
+	"os		CDATA		#IMPLIED">
+
+
+<!-- Revision: Editorial revision to which element belongs; no default -->
+
+<!ENTITY % revision.attrib
+	"revision	CDATA		#IMPLIED">
+
+<!-- Security: Security classification; no default -->
+
+<!ENTITY % security.attrib
+	"security	CDATA		#IMPLIED">
+
+<!-- UserLevel: Level of user experience to which element applies; no
+	default -->
+
+<!ENTITY % userlevel.attrib
+	"userlevel	CDATA		#IMPLIED">
+
+<!-- Vendor: Computer vendor to which element applies; no default -->
+
+<!ENTITY % vendor.attrib
+	"vendor		CDATA		#IMPLIED">
+
+<!-- Wordsize: Computer word size (32 bit, 64 bit, etc.); no default -->
+
+<!ENTITY % wordsize.attrib
+	"wordsize	CDATA		#IMPLIED">
+
+<!ENTITY % local.effectivity.attrib "">
+<!ENTITY % effectivity.attrib
+	"%arch.attrib;
+        %condition.attrib;
+	%conformance.attrib;
+	%os.attrib;
+	%revision.attrib;
+        %security.attrib;
+	%userlevel.attrib;
+	%vendor.attrib;
+	%wordsize.attrib;
+	%local.effectivity.attrib;"
+>
+
+<!-- Common attributes .................................................... -->
+
+
+<!-- Id: Unique identifier of element; no default -->
+
+<!ENTITY % id.attrib
+	"id		ID		#IMPLIED">
+
+
+<!-- Id: Unique identifier of element; a value must be supplied; no
+	default -->
+
+<!ENTITY % idreq.attrib
+	"id		ID		#REQUIRED">
+
+
+<!-- Lang: Indicator of language in which element is written, for
+	translation, character set management, etc.; no default -->
+
+<!ENTITY % lang.attrib
+	"lang		CDATA		#IMPLIED">
+
+
+<!-- Remap: Previous role of element before conversion; no default -->
+
+<!ENTITY % remap.attrib
+	"remap		CDATA		#IMPLIED">
+
+
+<!-- Role: New role of element in local environment; no default -->
+
+<!ENTITY % role.attrib
+	"role		CDATA		#IMPLIED">
+
+
+<!-- XRefLabel: Alternate labeling string for XRef text generation;
+	default is usually title or other appropriate label text already
+	contained in element -->
+
+<!ENTITY % xreflabel.attrib
+	"xreflabel	CDATA		#IMPLIED">
+
+
+<!-- RevisionFlag: Revision status of element; default is that element
+	wasn't revised -->
+
+<!ENTITY % revisionflag.attrib
+	"revisionflag	(changed
+			|added
+			|deleted
+			|off)		#IMPLIED">
+
+<!ENTITY % local.common.attrib "">
+
+<!-- dir: Bidirectional override -->
+
+<!ENTITY % dir.attrib
+	"dir		(ltr
+			|rtl
+			|lro
+			|rlo)		#IMPLIED">
+
+<!-- xml:base: base URI -->
+
+<![%sgml.features;[
+<!ENTITY % xml-base.attrib "">
+]]>
+<!ENTITY % xml-base.attrib
+	"xml:base	CDATA		#IMPLIED">
+
+<!-- Role is included explicitly on each element -->
+
+<!ENTITY % common.attrib
+	"%id.attrib;
+	%lang.attrib;
+	%remap.attrib;
+	%xreflabel.attrib;
+	%revisionflag.attrib;
+	%effectivity.attrib;
+	%dir.attrib;
+	%xml-base.attrib;
+	%local.common.attrib;"
+>
+
+<!-- Role is included explicitly on each element -->
+
+<!ENTITY % idreq.common.attrib
+	"%idreq.attrib;
+	%lang.attrib;
+	%remap.attrib;
+	%xreflabel.attrib;
+	%revisionflag.attrib;
+	%effectivity.attrib;
+	%dir.attrib;
+	%xml-base.attrib;
+	%local.common.attrib;"
+>
+
+<!-- Semi-common attributes and other attribute entities .................. -->
+
+<!ENTITY % local.graphics.attrib "">
+
+<!-- EntityRef: Name of an external entity containing the content
+	of the graphic -->
+<!-- FileRef: Filename, qualified by a pathname if desired,
+	designating the file containing the content of the graphic -->
+<!-- Format: Notation of the element content, if any -->
+<!-- SrcCredit: Information about the source of the Graphic -->
+<!-- Width: Same as CALS reprowid (desired width) -->
+<!-- Depth: Same as CALS reprodep (desired depth) -->
+<!-- Align: Same as CALS hplace with 'none' removed; #IMPLIED means
+	application-specific -->
+<!-- Scale: Conflation of CALS hscale and vscale -->
+<!-- Scalefit: Same as CALS scalefit -->
+
+<!ENTITY % graphics.attrib
+	"
+	entityref	ENTITY		#IMPLIED
+	fileref 	CDATA		#IMPLIED
+	format		(%notation.class;) #IMPLIED
+	srccredit	CDATA		#IMPLIED
+	width		CDATA		#IMPLIED
+	contentwidth	CDATA		#IMPLIED
+	depth		CDATA		#IMPLIED
+	contentdepth	CDATA		#IMPLIED
+	align		(left
+			|right
+			|center)	#IMPLIED
+	valign		(top
+			|middle
+			|bottom)	#IMPLIED
+	scale		CDATA		#IMPLIED
+	scalefit	%yesorno.attvals;
+					#IMPLIED
+	%local.graphics.attrib;"
+>
+
+<!ENTITY % local.keyaction.attrib "">
+
+<!-- Action: Key combination type; default is unspecified if one
+	child element, Simul if there is more than one; if value is
+	Other, the OtherAction attribute must have a nonempty value -->
+<!-- OtherAction: User-defined key combination type -->
+
+<!ENTITY % keyaction.attrib
+	"
+	action		(click
+			|double-click
+			|press
+			|seq
+			|simul
+			|other)		#IMPLIED
+	otheraction	CDATA		#IMPLIED
+	%local.keyaction.attrib;"
+>
+
+
+<!-- Label: Identifying number or string; default is usually the
+	appropriate number or string autogenerated by a formatter -->
+
+<!ENTITY % label.attrib
+	"label		CDATA		#IMPLIED">
+
+
+<!-- xml:space: whitespace treatment -->
+
+<![%sgml.features;[
+<!ENTITY % xml-space.attrib "">
+]]>
+<!ENTITY % xml-space.attrib
+	"xml:space	(preserve)		#IMPLIED">
+
+<!-- Format: whether element is assumed to contain significant white
+	space -->
+
+<!ENTITY % linespecific.attrib
+	"format		NOTATION
+			(linespecific)	'linespecific'
+         %xml-space.attrib;
+         linenumbering	(numbered|unnumbered) 	#IMPLIED
+         continuation	(continues|restarts)	#IMPLIED
+         startinglinenumber	CDATA		#IMPLIED
+         language	CDATA			#IMPLIED">
+
+<!-- Linkend: link to related information; no default -->
+
+<!ENTITY % linkend.attrib
+	"linkend	IDREF		#IMPLIED">
+
+
+<!-- Linkend: required link to related information -->
+
+<!ENTITY % linkendreq.attrib
+	"linkend	IDREF		#REQUIRED">
+
+
+<!-- Linkends: link to one or more sets of related information; no
+	default -->
+
+<!ENTITY % linkends.attrib
+	"linkends	IDREFS		#IMPLIED">
+
+
+<!ENTITY % local.mark.attrib "">
+<!ENTITY % mark.attrib
+	"mark		CDATA		#IMPLIED
+	%local.mark.attrib;"
+>
+
+
+<!-- MoreInfo: whether element's content has an associated RefEntry -->
+
+<!ENTITY % moreinfo.attrib
+	"moreinfo	(refentry|none)	'none'">
+
+
+<!-- Pagenum: number of page on which element appears; no default -->
+
+<!ENTITY % pagenum.attrib
+	"pagenum	CDATA		#IMPLIED">
+
+<!ENTITY % local.status.attrib "">
+
+<!-- Status: Editorial or publication status of the element
+	it applies to, such as "in review" or "approved for distribution" -->
+
+<!ENTITY % status.attrib
+	"status		CDATA		#IMPLIED
+	%local.status.attrib;"
+>
+
+
+<!-- Width: width of the longest line in the element to which it
+	pertains, in number of characters -->
+
+<!ENTITY % width.attrib
+	"width		CDATA		#IMPLIED">
+
+<!-- ...................................................................... -->
+<!-- Title elements ....................................................... -->
+
+<!ENTITY % title.module "INCLUDE">
+<![%title.module;[
+<!ENTITY % local.title.attrib "">
+<!ENTITY % title.role.attrib "%role.attrib;">
+
+<!ENTITY % title.element "INCLUDE">
+<![%title.element;[
+<!ELEMENT title %ho; (%title.char.mix;)*>
+<!--end of title.element-->]]>
+
+<!ENTITY % title.attlist "INCLUDE">
+<![%title.attlist;[
+<!ATTLIST title
+		%pagenum.attrib;
+		%common.attrib;
+		%title.role.attrib;
+		%local.title.attrib;
+>
+<!--end of title.attlist-->]]>
+<!--end of title.module-->]]>
+
+<!ENTITY % titleabbrev.module "INCLUDE">
+<![%titleabbrev.module;[
+<!ENTITY % local.titleabbrev.attrib "">
+<!ENTITY % titleabbrev.role.attrib "%role.attrib;">
+
+<!ENTITY % titleabbrev.element "INCLUDE">
+<![%titleabbrev.element;[
+<!ELEMENT titleabbrev %ho; (%title.char.mix;)*>
+<!--end of titleabbrev.element-->]]>
+
+<!ENTITY % titleabbrev.attlist "INCLUDE">
+<![%titleabbrev.attlist;[
+<!ATTLIST titleabbrev
+		%common.attrib;
+		%titleabbrev.role.attrib;
+		%local.titleabbrev.attrib;
+>
+<!--end of titleabbrev.attlist-->]]>
+<!--end of titleabbrev.module-->]]>
+
+<!ENTITY % subtitle.module "INCLUDE">
+<![%subtitle.module;[
+<!ENTITY % local.subtitle.attrib "">
+<!ENTITY % subtitle.role.attrib "%role.attrib;">
+
+<!ENTITY % subtitle.element "INCLUDE">
+<![%subtitle.element;[
+<!ELEMENT subtitle %ho; (%title.char.mix;)*>
+<!--end of subtitle.element-->]]>
+
+<!ENTITY % subtitle.attlist "INCLUDE">
+<![%subtitle.attlist;[
+<!ATTLIST subtitle
+		%common.attrib;
+		%subtitle.role.attrib;
+		%local.subtitle.attrib;
+>
+<!--end of subtitle.attlist-->]]>
+<!--end of subtitle.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Bibliographic entities and elements .................................. -->
+
+<!-- The bibliographic elements are typically used in the document
+     hierarchy. They do not appear in content models of information
+     pool elements.  See also the document information elements,
+     below. -->
+
+<!ENTITY % local.person.ident.mix "">
+<!ENTITY % person.ident.mix
+		"honorific|firstname|surname|lineage|othername|affiliation
+		|authorblurb|contrib %local.person.ident.mix;">
+
+<!ENTITY % local.bibliocomponent.mix "">
+<!ENTITY % bibliocomponent.mix
+		"abbrev|abstract|address|artpagenums|author
+		|authorgroup|authorinitials|bibliomisc|biblioset
+		|collab|confgroup|contractnum|contractsponsor
+		|copyright|corpauthor|corpname|corpcredit|date|edition
+		|editor|invpartnumber|isbn|issn|issuenum|orgname
+		|biblioid|citebiblioid|bibliosource|bibliorelation|bibliocoverage
+		|othercredit|pagenums|printhistory|productname
+		|productnumber|pubdate|publisher|publishername
+		|pubsnumber|releaseinfo|revhistory|seriesvolnums
+		|subtitle|title|titleabbrev|volumenum|citetitle
+		|personname|%person.ident.mix;
+		|%ndxterm.class;
+		%local.bibliocomponent.mix;">
+
+<!-- I don't think this is well placed, but it needs to be here because of -->
+<!-- the reference to bibliocomponent.mix -->
+<!ENTITY % local.info.class "">
+<!ENTITY % info.class
+		"graphic | mediaobject | legalnotice | modespec
+		 | subjectset | keywordset | itermset | %bibliocomponent.mix;
+                 %local.info.class;">
+
+
+<!-- BiblioList ........................ -->
+
+<!ENTITY % bibliolist.module "INCLUDE">
+<![%bibliolist.module;[
+<!ENTITY % local.bibliolist.attrib "">
+<!ENTITY % bibliolist.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliolist.element "INCLUDE">
+<![%bibliolist.element;[
+<!ELEMENT bibliolist %ho; (blockinfo?, (%formalobject.title.content;)?,
+                           (biblioentry|bibliomixed)+)>
+<!--end of bibliolist.element-->]]>
+
+<!ENTITY % bibliolist.attlist "INCLUDE">
+<![%bibliolist.attlist;[
+<!ATTLIST bibliolist
+		%common.attrib;
+		%bibliolist.role.attrib;
+		%local.bibliolist.attrib;
+>
+<!--end of bibliolist.attlist-->]]>
+<!--end of bibliolist.module-->]]>
+
+<!ENTITY % biblioentry.module "INCLUDE">
+<![%biblioentry.module;[
+<!ENTITY % local.biblioentry.attrib "">
+<!ENTITY % biblioentry.role.attrib "%role.attrib;">
+
+<!ENTITY % biblioentry.element "INCLUDE">
+<![%biblioentry.element;[
+<!ELEMENT biblioentry %ho; ((articleinfo | (%bibliocomponent.mix;))+)
+                      %ubiq.exclusion;>
+<!--end of biblioentry.element-->]]>
+
+<!ENTITY % biblioentry.attlist "INCLUDE">
+<![%biblioentry.attlist;[
+<!ATTLIST biblioentry
+		%common.attrib;
+		%biblioentry.role.attrib;
+		%local.biblioentry.attrib;
+>
+<!--end of biblioentry.attlist-->]]>
+<!--end of biblioentry.module-->]]>
+
+<!ENTITY % bibliomixed.module "INCLUDE">
+<![%bibliomixed.module;[
+<!ENTITY % local.bibliomixed.attrib "">
+<!ENTITY % bibliomixed.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliomixed.element "INCLUDE">
+<![%bibliomixed.element;[
+<!ELEMENT bibliomixed %ho; (#PCDATA | %bibliocomponent.mix; | bibliomset)*
+                      %ubiq.exclusion;>
+<!--end of bibliomixed.element-->]]>
+
+<!ENTITY % bibliomixed.attlist "INCLUDE">
+<![%bibliomixed.attlist;[
+<!ATTLIST bibliomixed
+		%common.attrib;
+		%bibliomixed.role.attrib;
+		%local.bibliomixed.attrib;
+>
+<!--end of bibliomixed.attlist-->]]>
+<!--end of bibliomixed.module-->]]>
+
+<!ENTITY % articleinfo.module "INCLUDE">
+<![%articleinfo.module;[
+<!ENTITY % local.articleinfo.attrib "">
+<!ENTITY % articleinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % articleinfo.element "INCLUDE">
+<![%articleinfo.element;[
+<!ELEMENT articleinfo %ho; ((%info.class;)+)
+	%beginpage.exclusion;>
+<!--end of articleinfo.element-->]]>
+
+<!ENTITY % articleinfo.attlist "INCLUDE">
+<![%articleinfo.attlist;[
+<!ATTLIST articleinfo
+		%common.attrib;
+		%articleinfo.role.attrib;
+		%local.articleinfo.attrib;
+>
+<!--end of articleinfo.attlist-->]]>
+<!--end of articleinfo.module-->]]>
+
+<!ENTITY % biblioset.module "INCLUDE">
+<![%biblioset.module;[
+<!ENTITY % local.biblioset.attrib "">
+<!ENTITY % biblioset.role.attrib "%role.attrib;">
+
+<!ENTITY % biblioset.element "INCLUDE">
+<![%biblioset.element;[
+<!ELEMENT biblioset %ho; ((%bibliocomponent.mix;)+)
+                      %ubiq.exclusion;>
+<!--end of biblioset.element-->]]>
+
+<!-- Relation: Relationship of elements contained within BiblioSet -->
+
+
+<!ENTITY % biblioset.attlist "INCLUDE">
+<![%biblioset.attlist;[
+<!ATTLIST biblioset
+		relation	CDATA		#IMPLIED
+		%common.attrib;
+		%biblioset.role.attrib;
+		%local.biblioset.attrib;
+>
+<!--end of biblioset.attlist-->]]>
+<!--end of biblioset.module-->]]>
+
+<!ENTITY % bibliomset.module "INCLUDE">
+<![%bibliomset.module;[
+<!ENTITY % bibliomset.role.attrib "%role.attrib;">
+<!ENTITY % local.bibliomset.attrib "">
+
+<!ENTITY % bibliomset.element "INCLUDE">
+<![%bibliomset.element;[
+<!ELEMENT bibliomset %ho; (#PCDATA | %bibliocomponent.mix; | bibliomset)*
+                      %ubiq.exclusion;>
+<!--end of bibliomset.element-->]]>
+
+<!-- Relation: Relationship of elements contained within BiblioMSet -->
+
+
+<!ENTITY % bibliomset.attlist "INCLUDE">
+<![%bibliomset.attlist;[
+<!ATTLIST bibliomset
+		relation	CDATA		#IMPLIED
+		%common.attrib;
+		%bibliomset.role.attrib;
+		%local.bibliomset.attrib;
+>
+<!--end of bibliomset.attlist-->]]>
+<!--end of bibliomset.module-->]]>
+
+<!ENTITY % bibliomisc.module "INCLUDE">
+<![%bibliomisc.module;[
+<!ENTITY % local.bibliomisc.attrib "">
+<!ENTITY % bibliomisc.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliomisc.element "INCLUDE">
+<![%bibliomisc.element;[
+<!ELEMENT bibliomisc %ho; (%para.char.mix;)*>
+<!--end of bibliomisc.element-->]]>
+
+<!ENTITY % bibliomisc.attlist "INCLUDE">
+<![%bibliomisc.attlist;[
+<!ATTLIST bibliomisc
+		%common.attrib;
+		%bibliomisc.role.attrib;
+		%local.bibliomisc.attrib;
+>
+<!--end of bibliomisc.attlist-->]]>
+<!--end of bibliomisc.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Subject, Keyword, and ITermSet elements .............................. -->
+
+<!ENTITY % subjectset.content.module "INCLUDE">
+<![%subjectset.content.module;[
+<!ENTITY % subjectset.module "INCLUDE">
+<![%subjectset.module;[
+<!ENTITY % local.subjectset.attrib "">
+<!ENTITY % subjectset.role.attrib "%role.attrib;">
+
+<!ENTITY % subjectset.element "INCLUDE">
+<![%subjectset.element;[
+<!ELEMENT subjectset %ho; (subject+)>
+<!--end of subjectset.element-->]]>
+
+<!-- Scheme: Controlled vocabulary employed in SubjectTerms -->
+
+
+<!ENTITY % subjectset.attlist "INCLUDE">
+<![%subjectset.attlist;[
+<!ATTLIST subjectset
+		scheme		NMTOKEN		#IMPLIED
+		%common.attrib;
+		%subjectset.role.attrib;
+		%local.subjectset.attrib;
+>
+<!--end of subjectset.attlist-->]]>
+<!--end of subjectset.module-->]]>
+
+<!ENTITY % subject.module "INCLUDE">
+<![%subject.module;[
+<!ENTITY % local.subject.attrib "">
+<!ENTITY % subject.role.attrib "%role.attrib;">
+
+<!ENTITY % subject.element "INCLUDE">
+<![%subject.element;[
+<!ELEMENT subject %ho; (subjectterm+)>
+<!--end of subject.element-->]]>
+
+<!-- Weight: Ranking of this group of SubjectTerms relative
+		to others, 0 is low, no highest value specified -->
+
+
+<!ENTITY % subject.attlist "INCLUDE">
+<![%subject.attlist;[
+<!ATTLIST subject
+		weight		CDATA		#IMPLIED
+		%common.attrib;
+		%subject.role.attrib;
+		%local.subject.attrib;
+>
+<!--end of subject.attlist-->]]>
+<!--end of subject.module-->]]>
+
+<!ENTITY % subjectterm.module "INCLUDE">
+<![%subjectterm.module;[
+<!ENTITY % local.subjectterm.attrib "">
+<!ENTITY % subjectterm.role.attrib "%role.attrib;">
+
+<!ENTITY % subjectterm.element "INCLUDE">
+<![%subjectterm.element;[
+<!ELEMENT subjectterm %ho; (#PCDATA)>
+<!--end of subjectterm.element-->]]>
+
+<!ENTITY % subjectterm.attlist "INCLUDE">
+<![%subjectterm.attlist;[
+<!ATTLIST subjectterm
+		%common.attrib;
+		%subjectterm.role.attrib;
+		%local.subjectterm.attrib;
+>
+<!--end of subjectterm.attlist-->]]>
+<!--end of subjectterm.module-->]]>
+<!--end of subjectset.content.module-->]]>
+
+<!ENTITY % keywordset.content.module "INCLUDE">
+<![%keywordset.content.module;[
+<!ENTITY % keywordset.module "INCLUDE">
+<![%keywordset.module;[
+<!ENTITY % local.keywordset.attrib "">
+<!ENTITY % keywordset.role.attrib "%role.attrib;">
+
+<!ENTITY % keywordset.element "INCLUDE">
+<![%keywordset.element;[
+<!ELEMENT keywordset %ho; (keyword+)>
+<!--end of keywordset.element-->]]>
+
+<!ENTITY % keywordset.attlist "INCLUDE">
+<![%keywordset.attlist;[
+<!ATTLIST keywordset
+		%common.attrib;
+		%keywordset.role.attrib;
+		%local.keywordset.attrib;
+>
+<!--end of keywordset.attlist-->]]>
+<!--end of keywordset.module-->]]>
+
+<!ENTITY % keyword.module "INCLUDE">
+<![%keyword.module;[
+<!ENTITY % local.keyword.attrib "">
+<!ENTITY % keyword.role.attrib "%role.attrib;">
+
+<!ENTITY % keyword.element "INCLUDE">
+<![%keyword.element;[
+<!ELEMENT keyword %ho; (#PCDATA)>
+<!--end of keyword.element-->]]>
+
+<!ENTITY % keyword.attlist "INCLUDE">
+<![%keyword.attlist;[
+<!ATTLIST keyword
+		%common.attrib;
+		%keyword.role.attrib;
+		%local.keyword.attrib;
+>
+<!--end of keyword.attlist-->]]>
+<!--end of keyword.module-->]]>
+<!--end of keywordset.content.module-->]]>
+
+<!ENTITY % itermset.module "INCLUDE">
+<![%itermset.module;[
+<!ENTITY % local.itermset.attrib "">
+<!ENTITY % itermset.role.attrib "%role.attrib;">
+
+<!ENTITY % itermset.element "INCLUDE">
+<![%itermset.element;[
+<!ELEMENT itermset %ho; (indexterm+)>
+<!--end of itermset.element-->]]>
+
+<!ENTITY % itermset.attlist "INCLUDE">
+<![%itermset.attlist;[
+<!ATTLIST itermset
+		%common.attrib;
+		%itermset.role.attrib;
+		%local.itermset.attrib;
+>
+<!--end of itermset.attlist-->]]>
+<!--end of itermset.module-->]]>
+
+<!-- Bibliographic info for "blocks" -->
+
+<!ENTITY % blockinfo.module "INCLUDE">
+<![ %blockinfo.module; [
+<!ENTITY % local.blockinfo.attrib "">
+<!ENTITY % blockinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % blockinfo.element "INCLUDE">
+<![ %blockinfo.element; [
+<!ELEMENT blockinfo %ho; ((%info.class;)+)
+	%beginpage.exclusion;>
+<!--end of blockinfo.element-->]]>
+
+<!ENTITY % blockinfo.attlist "INCLUDE">
+<![ %blockinfo.attlist; [
+<!ATTLIST blockinfo
+		%common.attrib;
+		%blockinfo.role.attrib;
+		%local.blockinfo.attrib;
+>
+<!--end of blockinfo.attlist-->]]>
+<!--end of blockinfo.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Compound (section-ish) elements ...................................... -->
+
+<!-- Message set ...................... -->
+
+<!ENTITY % msgset.content.module "INCLUDE">
+<![%msgset.content.module;[
+<!ENTITY % msgset.module "INCLUDE">
+<![%msgset.module;[
+<!ENTITY % local.msgset.attrib "">
+<!ENTITY % msgset.role.attrib "%role.attrib;">
+
+<!ENTITY % msgset.element "INCLUDE">
+<![%msgset.element;[
+<!ELEMENT msgset %ho; (blockinfo?, (%formalobject.title.content;)?,
+                       (msgentry+|simplemsgentry+))>
+<!--end of msgset.element-->]]>
+
+<!ENTITY % msgset.attlist "INCLUDE">
+<![%msgset.attlist;[
+<!ATTLIST msgset
+		%common.attrib;
+		%msgset.role.attrib;
+		%local.msgset.attrib;
+>
+<!--end of msgset.attlist-->]]>
+<!--end of msgset.module-->]]>
+
+<!ENTITY % msgentry.module "INCLUDE">
+<![%msgentry.module;[
+<!ENTITY % local.msgentry.attrib "">
+<!ENTITY % msgentry.role.attrib "%role.attrib;">
+
+<!ENTITY % msgentry.element "INCLUDE">
+<![%msgentry.element;[
+<!ELEMENT msgentry %ho; (msg+, msginfo?, msgexplan*)>
+<!--end of msgentry.element-->]]>
+
+<!ENTITY % msgentry.attlist "INCLUDE">
+<![%msgentry.attlist;[
+<!ATTLIST msgentry
+		%common.attrib;
+		%msgentry.role.attrib;
+		%local.msgentry.attrib;
+>
+<!--end of msgentry.attlist-->]]>
+<!--end of msgentry.module-->]]>
+
+<!ENTITY % simplemsgentry.module "INCLUDE">
+<![ %simplemsgentry.module; [
+<!ENTITY % local.simplemsgentry.attrib "">
+<!ENTITY % simplemsgentry.role.attrib "%role.attrib;">
+
+<!ENTITY % simplemsgentry.element "INCLUDE">
+<![ %simplemsgentry.element; [
+<!ELEMENT simplemsgentry %ho; (msgtext, msgexplan+)>
+<!--end of simplemsgentry.element-->]]>
+
+<!ENTITY % simplemsgentry.attlist "INCLUDE">
+<![ %simplemsgentry.attlist; [
+<!ATTLIST simplemsgentry
+		audience	CDATA	#IMPLIED
+		level		CDATA	#IMPLIED
+		origin		CDATA	#IMPLIED
+		%common.attrib;
+		%simplemsgentry.role.attrib;
+		%local.simplemsgentry.attrib;
+>
+<!--end of simplemsgentry.attlist-->]]>
+<!--end of simplemsgentry.module-->]]>
+
+<!ENTITY % msg.module "INCLUDE">
+<![%msg.module;[
+<!ENTITY % local.msg.attrib "">
+<!ENTITY % msg.role.attrib "%role.attrib;">
+
+<!ENTITY % msg.element "INCLUDE">
+<![%msg.element;[
+<!ELEMENT msg %ho; (title?, msgmain, (msgsub | msgrel)*)>
+<!--end of msg.element-->]]>
+
+<!ENTITY % msg.attlist "INCLUDE">
+<![%msg.attlist;[
+<!ATTLIST msg
+		%common.attrib;
+		%msg.role.attrib;
+		%local.msg.attrib;
+>
+<!--end of msg.attlist-->]]>
+<!--end of msg.module-->]]>
+
+<!ENTITY % msgmain.module "INCLUDE">
+<![%msgmain.module;[
+<!ENTITY % local.msgmain.attrib "">
+<!ENTITY % msgmain.role.attrib "%role.attrib;">
+
+<!ENTITY % msgmain.element "INCLUDE">
+<![%msgmain.element;[
+<!ELEMENT msgmain %ho; (title?, msgtext)>
+<!--end of msgmain.element-->]]>
+
+<!ENTITY % msgmain.attlist "INCLUDE">
+<![%msgmain.attlist;[
+<!ATTLIST msgmain
+		%common.attrib;
+		%msgmain.role.attrib;
+		%local.msgmain.attrib;
+>
+<!--end of msgmain.attlist-->]]>
+<!--end of msgmain.module-->]]>
+
+<!ENTITY % msgsub.module "INCLUDE">
+<![%msgsub.module;[
+<!ENTITY % local.msgsub.attrib "">
+<!ENTITY % msgsub.role.attrib "%role.attrib;">
+
+<!ENTITY % msgsub.element "INCLUDE">
+<![%msgsub.element;[
+<!ELEMENT msgsub %ho; (title?, msgtext)>
+<!--end of msgsub.element-->]]>
+
+<!ENTITY % msgsub.attlist "INCLUDE">
+<![%msgsub.attlist;[
+<!ATTLIST msgsub
+		%common.attrib;
+		%msgsub.role.attrib;
+		%local.msgsub.attrib;
+>
+<!--end of msgsub.attlist-->]]>
+<!--end of msgsub.module-->]]>
+
+<!ENTITY % msgrel.module "INCLUDE">
+<![%msgrel.module;[
+<!ENTITY % local.msgrel.attrib "">
+<!ENTITY % msgrel.role.attrib "%role.attrib;">
+
+<!ENTITY % msgrel.element "INCLUDE">
+<![%msgrel.element;[
+<!ELEMENT msgrel %ho; (title?, msgtext)>
+<!--end of msgrel.element-->]]>
+
+<!ENTITY % msgrel.attlist "INCLUDE">
+<![%msgrel.attlist;[
+<!ATTLIST msgrel
+		%common.attrib;
+		%msgrel.role.attrib;
+		%local.msgrel.attrib;
+>
+<!--end of msgrel.attlist-->]]>
+<!--end of msgrel.module-->]]>
+
+<!-- MsgText (defined in the Inlines section, below)-->
+
+<!ENTITY % msginfo.module "INCLUDE">
+<![%msginfo.module;[
+<!ENTITY % local.msginfo.attrib "">
+<!ENTITY % msginfo.role.attrib "%role.attrib;">
+
+<!ENTITY % msginfo.element "INCLUDE">
+<![%msginfo.element;[
+<!ELEMENT msginfo %ho; ((msglevel | msgorig | msgaud)*)>
+<!--end of msginfo.element-->]]>
+
+<!ENTITY % msginfo.attlist "INCLUDE">
+<![%msginfo.attlist;[
+<!ATTLIST msginfo
+		%common.attrib;
+		%msginfo.role.attrib;
+		%local.msginfo.attrib;
+>
+<!--end of msginfo.attlist-->]]>
+<!--end of msginfo.module-->]]>
+
+<!ENTITY % msglevel.module "INCLUDE">
+<![%msglevel.module;[
+<!ENTITY % local.msglevel.attrib "">
+<!ENTITY % msglevel.role.attrib "%role.attrib;">
+
+<!ENTITY % msglevel.element "INCLUDE">
+<![%msglevel.element;[
+<!ELEMENT msglevel %ho; (%smallcptr.char.mix;)*>
+<!--end of msglevel.element-->]]>
+
+<!ENTITY % msglevel.attlist "INCLUDE">
+<![%msglevel.attlist;[
+<!ATTLIST msglevel
+		%common.attrib;
+		%msglevel.role.attrib;
+		%local.msglevel.attrib;
+>
+<!--end of msglevel.attlist-->]]>
+<!--end of msglevel.module-->]]>
+
+<!ENTITY % msgorig.module "INCLUDE">
+<![%msgorig.module;[
+<!ENTITY % local.msgorig.attrib "">
+<!ENTITY % msgorig.role.attrib "%role.attrib;">
+
+<!ENTITY % msgorig.element "INCLUDE">
+<![%msgorig.element;[
+<!ELEMENT msgorig %ho; (%smallcptr.char.mix;)*>
+<!--end of msgorig.element-->]]>
+
+<!ENTITY % msgorig.attlist "INCLUDE">
+<![%msgorig.attlist;[
+<!ATTLIST msgorig
+		%common.attrib;
+		%msgorig.role.attrib;
+		%local.msgorig.attrib;
+>
+<!--end of msgorig.attlist-->]]>
+<!--end of msgorig.module-->]]>
+
+<!ENTITY % msgaud.module "INCLUDE">
+<![%msgaud.module;[
+<!ENTITY % local.msgaud.attrib "">
+<!ENTITY % msgaud.role.attrib "%role.attrib;">
+
+<!ENTITY % msgaud.element "INCLUDE">
+<![%msgaud.element;[
+<!ELEMENT msgaud %ho; (%para.char.mix;)*>
+<!--end of msgaud.element-->]]>
+
+<!ENTITY % msgaud.attlist "INCLUDE">
+<![%msgaud.attlist;[
+<!ATTLIST msgaud
+		%common.attrib;
+		%msgaud.role.attrib;
+		%local.msgaud.attrib;
+>
+<!--end of msgaud.attlist-->]]>
+<!--end of msgaud.module-->]]>
+
+<!ENTITY % msgexplan.module "INCLUDE">
+<![%msgexplan.module;[
+<!ENTITY % local.msgexplan.attrib "">
+<!ENTITY % msgexplan.role.attrib "%role.attrib;">
+
+<!ENTITY % msgexplan.element "INCLUDE">
+<![%msgexplan.element;[
+<!ELEMENT msgexplan %ho; (title?, (%component.mix;)+)>
+<!--end of msgexplan.element-->]]>
+
+<!ENTITY % msgexplan.attlist "INCLUDE">
+<![%msgexplan.attlist;[
+<!ATTLIST msgexplan
+		%common.attrib;
+		%msgexplan.role.attrib;
+		%local.msgexplan.attrib;
+>
+<!--end of msgexplan.attlist-->]]>
+<!--end of msgexplan.module-->]]>
+<!--end of msgset.content.module-->]]>
+
+<!ENTITY % task.content.module "INCLUDE">
+<![%task.content.module;[
+<!ENTITY % task.module "INCLUDE">
+<![%task.module;[
+<!ENTITY % local.task.attrib "">
+<!ENTITY % task.role.attrib "%role.attrib;">
+
+<!ENTITY % task.element "INCLUDE">
+<![%task.element;[
+<!ELEMENT task %ho; (blockinfo?,(%ndxterm.class;)*,
+                     (%formalobject.title.content;),
+                     tasksummary?,
+                     taskprerequisites?,
+                     procedure,
+                     example*,
+                     taskrelated?)>
+<!--end of task.element-->]]>
+
+<!ENTITY % task.attlist "INCLUDE">
+<![%task.attlist;[
+<!ATTLIST task
+		%common.attrib;
+		%task.role.attrib;
+		%local.task.attrib;
+>
+<!--end of task.attlist-->]]>
+<!--end of task.module-->]]>
+
+<!ENTITY % tasksummary.module "INCLUDE">
+<![%tasksummary.module;[
+<!ENTITY % local.tasksummary.attrib "">
+<!ENTITY % tasksummary.role.attrib "%role.attrib;">
+
+<!ENTITY % tasksummary.element "INCLUDE">
+<![%tasksummary.element;[
+<!ELEMENT tasksummary %ho; (blockinfo?,
+                            (%formalobject.title.content;)?,
+                            (%component.mix;)+)>
+<!--end of tasksummary.element-->]]>
+
+<!ENTITY % tasksummary.attlist "INCLUDE">
+<![%tasksummary.attlist;[
+<!ATTLIST tasksummary
+		%common.attrib;
+		%tasksummary.role.attrib;
+		%local.tasksummary.attrib;
+>
+<!--end of tasksummary.attlist-->]]>
+<!--end of tasksummary.module-->]]>
+
+<!ENTITY % taskprerequisites.module "INCLUDE">
+<![%taskprerequisites.module;[
+<!ENTITY % local.taskprerequisites.attrib "">
+<!ENTITY % taskprerequisites.role.attrib "%role.attrib;">
+
+<!ENTITY % taskprerequisites.element "INCLUDE">
+<![%taskprerequisites.element;[
+<!ELEMENT taskprerequisites %ho; (blockinfo?,
+                                  (%formalobject.title.content;)?,
+                                  (%component.mix;)+)>
+<!--end of taskprerequisites.element-->]]>
+
+<!ENTITY % taskprerequisites.attlist "INCLUDE">
+<![%taskprerequisites.attlist;[
+<!ATTLIST taskprerequisites
+		%common.attrib;
+		%taskprerequisites.role.attrib;
+		%local.taskprerequisites.attrib;
+>
+<!--end of taskprerequisites.attlist-->]]>
+<!--end of taskprerequisites.module-->]]>
+
+<!ENTITY % taskrelated.module "INCLUDE">
+<![%taskrelated.module;[
+<!ENTITY % local.taskrelated.attrib "">
+<!ENTITY % taskrelated.role.attrib "%role.attrib;">
+
+<!ENTITY % taskrelated.element "INCLUDE">
+<![%taskrelated.element;[
+<!ELEMENT taskrelated %ho; (blockinfo?,
+                            (%formalobject.title.content;)?,
+                            (%component.mix;)+)>
+<!--end of taskrelated.element-->]]>
+
+<!ENTITY % taskrelated.attlist "INCLUDE">
+<![%taskrelated.attlist;[
+<!ATTLIST taskrelated
+		%common.attrib;
+		%taskrelated.role.attrib;
+		%local.taskrelated.attrib;
+>
+<!--end of taskrelated.attlist-->]]>
+<!--end of taskrelated.module-->]]>
+<!--end of task.content.module-->]]>
+
+<!-- QandASet ........................ -->
+<!ENTITY % qandaset.content.module "INCLUDE">
+<![ %qandaset.content.module; [
+<!ENTITY % qandaset.module "INCLUDE">
+<![ %qandaset.module; [
+<!ENTITY % local.qandaset.attrib "">
+<!ENTITY % qandaset.role.attrib "%role.attrib;">
+
+<!ENTITY % qandaset.element "INCLUDE">
+<![ %qandaset.element; [
+<!ELEMENT qandaset %ho; (blockinfo?, (%formalobject.title.content;)?,
+			(%qandaset.mix;)*,
+                        (qandadiv+|qandaentry+))>
+<!--end of qandaset.element-->]]>
+
+<!ENTITY % qandaset.attlist "INCLUDE">
+<![ %qandaset.attlist; [
+<!ATTLIST qandaset
+		defaultlabel	(qanda|number|none)       #IMPLIED
+		%common.attrib;
+		%qandaset.role.attrib;
+		%local.qandaset.attrib;>
+<!--end of qandaset.attlist-->]]>
+<!--end of qandaset.module-->]]>
+
+<!ENTITY % qandadiv.module "INCLUDE">
+<![ %qandadiv.module; [
+<!ENTITY % local.qandadiv.attrib "">
+<!ENTITY % qandadiv.role.attrib "%role.attrib;">
+
+<!ENTITY % qandadiv.element "INCLUDE">
+<![ %qandadiv.element; [
+<!ELEMENT qandadiv %ho; (blockinfo?, (%formalobject.title.content;)?,
+			(%qandaset.mix;)*,
+			(qandadiv+|qandaentry+))>
+<!--end of qandadiv.element-->]]>
+
+<!ENTITY % qandadiv.attlist "INCLUDE">
+<![ %qandadiv.attlist; [
+<!ATTLIST qandadiv
+		%common.attrib;
+		%qandadiv.role.attrib;
+		%local.qandadiv.attrib;>
+<!--end of qandadiv.attlist-->]]>
+<!--end of qandadiv.module-->]]>
+
+<!ENTITY % qandaentry.module "INCLUDE">
+<![ %qandaentry.module; [
+<!ENTITY % local.qandaentry.attrib "">
+<!ENTITY % qandaentry.role.attrib "%role.attrib;">
+
+<!ENTITY % qandaentry.element "INCLUDE">
+<![ %qandaentry.element; [
+<!ELEMENT qandaentry %ho; (blockinfo?, revhistory?, question, answer*)>
+<!--end of qandaentry.element-->]]>
+
+<!ENTITY % qandaentry.attlist "INCLUDE">
+<![ %qandaentry.attlist; [
+<!ATTLIST qandaentry
+		%common.attrib;
+		%qandaentry.role.attrib;
+		%local.qandaentry.attrib;>
+<!--end of qandaentry.attlist-->]]>
+<!--end of qandaentry.module-->]]>
+
+<!ENTITY % question.module "INCLUDE">
+<![ %question.module; [
+<!ENTITY % local.question.attrib "">
+<!ENTITY % question.role.attrib "%role.attrib;">
+
+<!ENTITY % question.element "INCLUDE">
+<![ %question.element; [
+<!ELEMENT question %ho; (label?, (%qandaset.mix;)+)>
+<!--end of question.element-->]]>
+
+<!ENTITY % question.attlist "INCLUDE">
+<![ %question.attlist; [
+<!ATTLIST question
+		%common.attrib;
+		%question.role.attrib;
+		%local.question.attrib;
+>
+<!--end of question.attlist-->]]>
+<!--end of question.module-->]]>
+
+<!ENTITY % answer.module "INCLUDE">
+<![ %answer.module; [
+<!ENTITY % local.answer.attrib "">
+<!ENTITY % answer.role.attrib "%role.attrib;">
+
+<!ENTITY % answer.element "INCLUDE">
+<![ %answer.element; [
+<!ELEMENT answer %ho; (label?, (%qandaset.mix;)*, qandaentry*)>
+<!--end of answer.element-->]]>
+
+<!ENTITY % answer.attlist "INCLUDE">
+<![ %answer.attlist; [
+<!ATTLIST answer
+		%common.attrib;
+		%answer.role.attrib;
+		%local.answer.attrib;
+>
+<!--end of answer.attlist-->]]>
+<!--end of answer.module-->]]>
+
+<!ENTITY % label.module "INCLUDE">
+<![ %label.module; [
+<!ENTITY % local.label.attrib "">
+<!ENTITY % label.role.attrib "%role.attrib;">
+
+<!ENTITY % label.element "INCLUDE">
+<![ %label.element; [
+<!ELEMENT label %ho; (%word.char.mix;)*>
+<!--end of label.element-->]]>
+
+<!ENTITY % label.attlist "INCLUDE">
+<![ %label.attlist; [
+<!ATTLIST label
+		%common.attrib;
+		%label.role.attrib;
+		%local.label.attrib;
+>
+<!--end of label.attlist-->]]>
+<!--end of label.module-->]]>
+<!--end of qandaset.content.module-->]]>
+
+<!-- Procedure ........................ -->
+
+<!ENTITY % procedure.content.module "INCLUDE">
+<![%procedure.content.module;[
+<!ENTITY % procedure.module "INCLUDE">
+<![%procedure.module;[
+<!ENTITY % local.procedure.attrib "">
+<!ENTITY % procedure.role.attrib "%role.attrib;">
+
+<!ENTITY % procedure.element "INCLUDE">
+<![%procedure.element;[
+<!ELEMENT procedure %ho; (blockinfo?, (%formalobject.title.content;)?,
+                          (%component.mix;)*, step+)>
+<!--end of procedure.element-->]]>
+
+<!ENTITY % procedure.attlist "INCLUDE">
+<![%procedure.attlist;[
+<!ATTLIST procedure
+		%common.attrib;
+		%procedure.role.attrib;
+		%local.procedure.attrib;
+>
+<!--end of procedure.attlist-->]]>
+<!--end of procedure.module-->]]>
+
+<!ENTITY % step.module "INCLUDE">
+<![%step.module;[
+<!ENTITY % local.step.attrib "">
+<!ENTITY % step.role.attrib "%role.attrib;">
+
+<!ENTITY % step.element "INCLUDE">
+<![%step.element;[
+<!ELEMENT step %ho; (title?, (((%component.mix;)+, ((substeps|stepalternatives), (%component.mix;)*)?)
+                    | ((substeps|stepalternatives), (%component.mix;)*)))>
+<!--end of step.element-->]]>
+
+<!-- Performance: Whether the Step must be performed -->
+<!-- not #REQUIRED! -->
+
+
+<!ENTITY % step.attlist "INCLUDE">
+<![%step.attlist;[
+<!ATTLIST step
+		performance	(optional
+				|required)	"required"
+		%common.attrib;
+		%step.role.attrib;
+		%local.step.attrib;
+>
+<!--end of step.attlist-->]]>
+<!--end of step.module-->]]>
+
+<!ENTITY % substeps.module "INCLUDE">
+<![%substeps.module;[
+<!ENTITY % local.substeps.attrib "">
+<!ENTITY % substeps.role.attrib "%role.attrib;">
+
+<!ENTITY % substeps.element "INCLUDE">
+<![%substeps.element;[
+<!ELEMENT substeps %ho; (step+)>
+<!--end of substeps.element-->]]>
+
+<!-- Performance: whether entire set of substeps must be performed -->
+<!-- not #REQUIRED! -->
+
+<!ENTITY % substeps.attlist "INCLUDE">
+<![%substeps.attlist;[
+<!ATTLIST substeps
+		performance	(optional
+				|required)	"required"
+		%common.attrib;
+		%substeps.role.attrib;
+		%local.substeps.attrib;
+>
+<!--end of substeps.attlist-->]]>
+<!--end of substeps.module-->]]>
+
+<!ENTITY % stepalternatives.module "INCLUDE">
+<![%stepalternatives.module;[
+<!ENTITY % local.stepalternatives.attrib "">
+<!ENTITY % stepalternatives.role.attrib "%role.attrib;">
+
+<!ENTITY % stepalternatives.element "INCLUDE">
+<![%stepalternatives.element;[
+<!ELEMENT stepalternatives %ho; (step+)>
+<!--end of stepalternatives.element-->]]>
+
+<!-- Performance: Whether (one of) the alternatives must be performed -->
+<!-- not #REQUIRED! -->
+
+<!ENTITY % stepalternatives.attlist "INCLUDE">
+<![%stepalternatives.attlist;[
+<!ATTLIST stepalternatives
+		performance	(optional
+				|required)	"required"
+		%common.attrib;
+		%stepalternatives.role.attrib;
+		%local.stepalternatives.attrib;
+>
+<!--end of stepalternatives.attlist-->]]>
+<!--end of stepalternatives.module-->]]>
+<!--end of procedure.content.module-->]]>
+
+<!-- Sidebar .......................... -->
+
+<!ENTITY % sidebar.content.model "INCLUDE">
+<![ %sidebar.content.model; [
+
+<!ENTITY % sidebarinfo.module "INCLUDE">
+<![ %sidebarinfo.module; [
+<!ENTITY % local.sidebarinfo.attrib "">
+<!ENTITY % sidebarinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % sidebarinfo.element "INCLUDE">
+<![ %sidebarinfo.element; [
+<!ELEMENT sidebarinfo %ho; ((%info.class;)+)
+	%beginpage.exclusion;>
+<!--end of sidebarinfo.element-->]]>
+
+<!ENTITY % sidebarinfo.attlist "INCLUDE">
+<![ %sidebarinfo.attlist; [
+<!ATTLIST sidebarinfo
+		%common.attrib;
+		%sidebarinfo.role.attrib;
+		%local.sidebarinfo.attrib;
+>
+<!--end of sidebarinfo.attlist-->]]>
+<!--end of sidebarinfo.module-->]]>
+
+<!ENTITY % sidebar.module "INCLUDE">
+<![%sidebar.module;[
+<!ENTITY % local.sidebar.attrib "">
+<!ENTITY % sidebar.role.attrib "%role.attrib;">
+
+<!ENTITY % sidebar.element "INCLUDE">
+<![%sidebar.element;[
+<!ELEMENT sidebar %ho; (sidebarinfo?,
+                   (%formalobject.title.content;)?,
+                   (%sidebar.mix;)+)>
+<!--end of sidebar.element-->]]>
+
+<!ENTITY % sidebar.attlist "INCLUDE">
+<![%sidebar.attlist;[
+<!ATTLIST sidebar
+		%common.attrib;
+		%sidebar.role.attrib;
+		%local.sidebar.attrib;
+>
+<!--end of sidebar.attlist-->]]>
+<!--end of sidebar.module-->]]>
+<!--end of sidebar.content.model-->]]>
+
+<!-- ...................................................................... -->
+<!-- Paragraph-related elements ........................................... -->
+
+<!ENTITY % abstract.module "INCLUDE">
+<![%abstract.module;[
+<!ENTITY % local.abstract.attrib "">
+<!ENTITY % abstract.role.attrib "%role.attrib;">
+
+<!ENTITY % abstract.element "INCLUDE">
+<![%abstract.element;[
+<!ELEMENT abstract %ho; (title?, (%para.class;)+)>
+<!--end of abstract.element-->]]>
+
+<!ENTITY % abstract.attlist "INCLUDE">
+<![%abstract.attlist;[
+<!ATTLIST abstract
+		%common.attrib;
+		%abstract.role.attrib;
+		%local.abstract.attrib;
+>
+<!--end of abstract.attlist-->]]>
+<!--end of abstract.module-->]]>
+
+<!ENTITY % authorblurb.module "INCLUDE">
+<![%authorblurb.module;[
+<!ENTITY % local.authorblurb.attrib "">
+<!ENTITY % authorblurb.role.attrib "%role.attrib;">
+
+<!ENTITY % authorblurb.element "INCLUDE">
+<![%authorblurb.element;[
+<!ELEMENT authorblurb %ho; (title?, (%para.class;)+)>
+<!--end of authorblurb.element-->]]>
+
+<!ENTITY % authorblurb.attlist "INCLUDE">
+<![%authorblurb.attlist;[
+<!ATTLIST authorblurb
+		%common.attrib;
+		%authorblurb.role.attrib;
+		%local.authorblurb.attrib;
+>
+<!--end of authorblurb.attlist-->]]>
+<!--end of authorblurb.module-->]]>
+
+<!ENTITY % personblurb.module "INCLUDE">
+<![%personblurb.module;[
+<!ENTITY % local.personblurb.attrib "">
+<!ENTITY % personblurb.role.attrib "%role.attrib;">
+
+<!ENTITY % personblurb.element "INCLUDE">
+<![%personblurb.element;[
+<!ELEMENT personblurb %ho; (title?, (%para.class;)+)>
+<!--end of personblurb.element-->]]>
+
+<!ENTITY % personblurb.attlist "INCLUDE">
+<![%personblurb.attlist;[
+<!ATTLIST personblurb
+		%common.attrib;
+		%personblurb.role.attrib;
+		%local.personblurb.attrib;
+>
+<!--end of personblurb.attlist-->]]>
+<!--end of personblurb.module-->]]>
+
+<!ENTITY % blockquote.module "INCLUDE">
+<![%blockquote.module;[
+
+<!ENTITY % local.blockquote.attrib "">
+<!ENTITY % blockquote.role.attrib "%role.attrib;">
+
+<!ENTITY % blockquote.element "INCLUDE">
+<![%blockquote.element;[
+<!ELEMENT blockquote %ho; (blockinfo?, title?, attribution?, (%component.mix;)+)
+                      %blockquote.exclusion;>
+<!--end of blockquote.element-->]]>
+
+<!ENTITY % blockquote.attlist "INCLUDE">
+<![%blockquote.attlist;[
+<!ATTLIST blockquote
+		%common.attrib;
+		%blockquote.role.attrib;
+		%local.blockquote.attrib;
+>
+<!--end of blockquote.attlist-->]]>
+<!--end of blockquote.module-->]]>
+
+<!ENTITY % attribution.module "INCLUDE">
+<![%attribution.module;[
+<!ENTITY % local.attribution.attrib "">
+<!ENTITY % attribution.role.attrib "%role.attrib;">
+
+<!ENTITY % attribution.element "INCLUDE">
+<![%attribution.element;[
+<!ELEMENT attribution %ho; (%para.char.mix;)*>
+<!--end of attribution.element-->]]>
+
+<!ENTITY % attribution.attlist "INCLUDE">
+<![%attribution.attlist;[
+<!ATTLIST attribution
+		%common.attrib;
+		%attribution.role.attrib;
+		%local.attribution.attrib;
+>
+<!--end of attribution.attlist-->]]>
+<!--end of attribution.module-->]]>
+
+<!ENTITY % bridgehead.module "INCLUDE">
+<![%bridgehead.module;[
+<!ENTITY % local.bridgehead.attrib "">
+<!ENTITY % bridgehead.role.attrib "%role.attrib;">
+
+<!ENTITY % bridgehead.element "INCLUDE">
+<![%bridgehead.element;[
+<!ELEMENT bridgehead %ho; (%title.char.mix;)*>
+<!--end of bridgehead.element-->]]>
+
+<!-- Renderas: Indicates the format in which the BridgeHead
+		should appear -->
+
+
+<!ENTITY % bridgehead.attlist "INCLUDE">
+<![%bridgehead.attlist;[
+<!ATTLIST bridgehead
+		renderas	(other
+				|sect1
+				|sect2
+				|sect3
+				|sect4
+				|sect5)		#IMPLIED
+		%common.attrib;
+		%bridgehead.role.attrib;
+		%local.bridgehead.attrib;
+>
+<!--end of bridgehead.attlist-->]]>
+<!--end of bridgehead.module-->]]>
+
+<!ENTITY % remark.module "INCLUDE">
+<![%remark.module;[
+<!ENTITY % local.remark.attrib "">
+<!ENTITY % remark.role.attrib "%role.attrib;">
+
+<!ENTITY % remark.element "INCLUDE">
+<![%remark.element;[
+<!ELEMENT remark %ho; (%para.char.mix;)*
+                      %remark.exclusion;>
+<!--end of remark.element-->]]>
+
+<!ENTITY % remark.attlist "INCLUDE">
+<![%remark.attlist;[
+<!ATTLIST remark
+		%common.attrib;
+		%remark.role.attrib;
+		%local.remark.attrib;
+>
+<!--end of remark.attlist-->]]>
+<!--end of remark.module-->]]>
+
+<!ENTITY % epigraph.module "INCLUDE">
+<![%epigraph.module;[
+<!ENTITY % local.epigraph.attrib "">
+<!ENTITY % epigraph.role.attrib "%role.attrib;">
+
+<!ENTITY % epigraph.element "INCLUDE">
+<![%epigraph.element;[
+<!ELEMENT epigraph %ho; (attribution?, ((%para.class;)|literallayout)+)>
+<!--end of epigraph.element-->]]>
+
+<!ENTITY % epigraph.attlist "INCLUDE">
+<![%epigraph.attlist;[
+<!ATTLIST epigraph
+		%common.attrib;
+		%epigraph.role.attrib;
+		%local.epigraph.attrib;
+>
+<!--end of epigraph.attlist-->]]>
+<!-- Attribution (defined above)-->
+<!--end of epigraph.module-->]]>
+
+<!ENTITY % footnote.module "INCLUDE">
+<![%footnote.module;[
+<!ENTITY % local.footnote.attrib "">
+<!ENTITY % footnote.role.attrib "%role.attrib;">
+
+<!ENTITY % footnote.element "INCLUDE">
+<![%footnote.element;[
+<!ELEMENT footnote %ho; ((%footnote.mix;)+)
+                      %footnote.exclusion;>
+<!--end of footnote.element-->]]>
+
+<!ENTITY % footnote.attlist "INCLUDE">
+<![%footnote.attlist;[
+<!ATTLIST footnote
+		%label.attrib;
+		%common.attrib;
+		%footnote.role.attrib;
+		%local.footnote.attrib;
+>
+<!--end of footnote.attlist-->]]>
+<!--end of footnote.module-->]]>
+
+<!ENTITY % highlights.module "INCLUDE">
+<![%highlights.module;[
+<!ENTITY % local.highlights.attrib "">
+<!ENTITY % highlights.role.attrib "%role.attrib;">
+
+<!ENTITY % highlights.element "INCLUDE">
+<![%highlights.element;[
+<!ELEMENT highlights %ho; ((%highlights.mix;)+)
+                      %highlights.exclusion;>
+<!--end of highlights.element-->]]>
+
+<!ENTITY % highlights.attlist "INCLUDE">
+<![%highlights.attlist;[
+<!ATTLIST highlights
+		%common.attrib;
+		%highlights.role.attrib;
+		%local.highlights.attrib;
+>
+<!--end of highlights.attlist-->]]>
+<!--end of highlights.module-->]]>
+
+<!ENTITY % formalpara.module "INCLUDE">
+<![%formalpara.module;[
+<!ENTITY % local.formalpara.attrib "">
+<!ENTITY % formalpara.role.attrib "%role.attrib;">
+
+<!ENTITY % formalpara.element "INCLUDE">
+<![%formalpara.element;[
+<!ELEMENT formalpara %ho; (title, (%ndxterm.class;)*, para)>
+<!--end of formalpara.element-->]]>
+
+<!ENTITY % formalpara.attlist "INCLUDE">
+<![%formalpara.attlist;[
+<!ATTLIST formalpara
+		%common.attrib;
+		%formalpara.role.attrib;
+		%local.formalpara.attrib;
+>
+<!--end of formalpara.attlist-->]]>
+<!--end of formalpara.module-->]]>
+
+<!ENTITY % para.module "INCLUDE">
+<![%para.module;[
+<!ENTITY % local.para.attrib "">
+<!ENTITY % para.role.attrib "%role.attrib;">
+
+<!ENTITY % para.element "INCLUDE">
+<![%para.element;[
+<!ELEMENT para %ho; (%para.char.mix; | %para.mix;)*>
+<!--end of para.element-->]]>
+
+<!ENTITY % para.attlist "INCLUDE">
+<![%para.attlist;[
+<!ATTLIST para
+		%common.attrib;
+		%para.role.attrib;
+		%local.para.attrib;
+>
+<!--end of para.attlist-->]]>
+<!--end of para.module-->]]>
+
+<!ENTITY % simpara.module "INCLUDE">
+<![%simpara.module;[
+<!ENTITY % local.simpara.attrib "">
+<!ENTITY % simpara.role.attrib "%role.attrib;">
+
+<!ENTITY % simpara.element "INCLUDE">
+<![%simpara.element;[
+<!ELEMENT simpara %ho; (%para.char.mix;)*>
+<!--end of simpara.element-->]]>
+
+<!ENTITY % simpara.attlist "INCLUDE">
+<![%simpara.attlist;[
+<!ATTLIST simpara
+		%common.attrib;
+		%simpara.role.attrib;
+		%local.simpara.attrib;
+>
+<!--end of simpara.attlist-->]]>
+<!--end of simpara.module-->]]>
+
+<!ENTITY % admon.module "INCLUDE">
+<![%admon.module;[
+<!ENTITY % local.admon.attrib "">
+<!ENTITY % admon.role.attrib "%role.attrib;">
+
+
+<!ENTITY % caution.element "INCLUDE">
+<![%caution.element;[
+<!ELEMENT caution %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of caution.element-->]]>
+
+<!ENTITY % caution.attlist "INCLUDE">
+<![%caution.attlist;[
+<!ATTLIST caution
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of caution.attlist-->]]>
+
+
+<!ENTITY % important.element "INCLUDE">
+<![%important.element;[
+<!ELEMENT important %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of important.element-->]]>
+
+<!ENTITY % important.attlist "INCLUDE">
+<![%important.attlist;[
+<!ATTLIST important
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of important.attlist-->]]>
+
+
+<!ENTITY % note.element "INCLUDE">
+<![%note.element;[
+<!ELEMENT note %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of note.element-->]]>
+
+<!ENTITY % note.attlist "INCLUDE">
+<![%note.attlist;[
+<!ATTLIST note
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of note.attlist-->]]>
+
+<!ENTITY % tip.element "INCLUDE">
+<![%tip.element;[
+<!ELEMENT tip %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of tip.element-->]]>
+
+<!ENTITY % tip.attlist "INCLUDE">
+<![%tip.attlist;[
+<!ATTLIST tip
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of tip.attlist-->]]>
+
+
+<!ENTITY % warning.element "INCLUDE">
+<![%warning.element;[
+<!ELEMENT warning %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of warning.element-->]]>
+
+<!ENTITY % warning.attlist "INCLUDE">
+<![%warning.attlist;[
+<!ATTLIST warning
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of warning.attlist-->]]>
+
+<!--end of admon.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Lists ................................................................ -->
+
+<!-- GlossList ........................ -->
+
+<!ENTITY % glosslist.module "INCLUDE">
+<![%glosslist.module;[
+<!ENTITY % local.glosslist.attrib "">
+<!ENTITY % glosslist.role.attrib "%role.attrib;">
+
+<!ENTITY % glosslist.element "INCLUDE">
+<![%glosslist.element;[
+<!ELEMENT glosslist %ho; (blockinfo?, (%formalobject.title.content;)?, glossentry+)>
+<!--end of glosslist.element-->]]>
+
+<!ENTITY % glosslist.attlist "INCLUDE">
+<![%glosslist.attlist;[
+<!ATTLIST glosslist
+		%common.attrib;
+		%glosslist.role.attrib;
+		%local.glosslist.attrib;
+>
+<!--end of glosslist.attlist-->]]>
+<!--end of glosslist.module-->]]>
+
+<!ENTITY % glossentry.content.module "INCLUDE">
+<![%glossentry.content.module;[
+<!ENTITY % glossentry.module "INCLUDE">
+<![%glossentry.module;[
+<!ENTITY % local.glossentry.attrib "">
+<!ENTITY % glossentry.role.attrib "%role.attrib;">
+
+<!ENTITY % glossentry.element "INCLUDE">
+<![%glossentry.element;[
+<!ELEMENT glossentry %ho; (glossterm, acronym?, abbrev?,
+                      (%ndxterm.class;)*,
+                      revhistory?, (glosssee|glossdef+))>
+<!--end of glossentry.element-->]]>
+
+<!-- SortAs: String by which the GlossEntry is to be sorted
+		(alphabetized) in lieu of its proper content -->
+
+
+<!ENTITY % glossentry.attlist "INCLUDE">
+<![%glossentry.attlist;[
+<!ATTLIST glossentry
+		sortas		CDATA		#IMPLIED
+		%common.attrib;
+		%glossentry.role.attrib;
+		%local.glossentry.attrib;
+>
+<!--end of glossentry.attlist-->]]>
+<!--end of glossentry.module-->]]>
+
+<!-- GlossTerm (defined in the Inlines section, below)-->
+<!ENTITY % glossdef.module "INCLUDE">
+<![%glossdef.module;[
+<!ENTITY % local.glossdef.attrib "">
+<!ENTITY % glossdef.role.attrib "%role.attrib;">
+
+<!ENTITY % glossdef.element "INCLUDE">
+<![%glossdef.element;[
+<!ELEMENT glossdef %ho; ((%glossdef.mix;)+, glossseealso*)>
+<!--end of glossdef.element-->]]>
+
+<!-- Subject: List of subjects; keywords for the definition -->
+
+
+<!ENTITY % glossdef.attlist "INCLUDE">
+<![%glossdef.attlist;[
+<!ATTLIST glossdef
+		subject		CDATA		#IMPLIED
+		%common.attrib;
+		%glossdef.role.attrib;
+		%local.glossdef.attrib;
+>
+<!--end of glossdef.attlist-->]]>
+<!--end of glossdef.module-->]]>
+
+<!ENTITY % glosssee.module "INCLUDE">
+<![%glosssee.module;[
+<!ENTITY % local.glosssee.attrib "">
+<!ENTITY % glosssee.role.attrib "%role.attrib;">
+
+<!ENTITY % glosssee.element "INCLUDE">
+<![%glosssee.element;[
+<!ELEMENT glosssee %ho; (%para.char.mix;)*>
+<!--end of glosssee.element-->]]>
+
+<!-- OtherTerm: Reference to the GlossEntry whose GlossTerm
+		should be displayed at the point of the GlossSee -->
+
+
+<!ENTITY % glosssee.attlist "INCLUDE">
+<![%glosssee.attlist;[
+<!ATTLIST glosssee
+		otherterm	IDREF		#IMPLIED
+		%common.attrib;
+		%glosssee.role.attrib;
+		%local.glosssee.attrib;
+>
+<!--end of glosssee.attlist-->]]>
+<!--end of glosssee.module-->]]>
+
+<!ENTITY % glossseealso.module "INCLUDE">
+<![%glossseealso.module;[
+<!ENTITY % local.glossseealso.attrib "">
+<!ENTITY % glossseealso.role.attrib "%role.attrib;">
+
+<!ENTITY % glossseealso.element "INCLUDE">
+<![%glossseealso.element;[
+<!ELEMENT glossseealso %ho; (%para.char.mix;)*>
+<!--end of glossseealso.element-->]]>
+
+<!-- OtherTerm: Reference to the GlossEntry whose GlossTerm
+		should be displayed at the point of the GlossSeeAlso -->
+
+
+<!ENTITY % glossseealso.attlist "INCLUDE">
+<![%glossseealso.attlist;[
+<!ATTLIST glossseealso
+		otherterm	IDREF		#IMPLIED
+		%common.attrib;
+		%glossseealso.role.attrib;
+		%local.glossseealso.attrib;
+>
+<!--end of glossseealso.attlist-->]]>
+<!--end of glossseealso.module-->]]>
+<!--end of glossentry.content.module-->]]>
+
+<!-- ItemizedList and OrderedList ..... -->
+
+<!ENTITY % itemizedlist.module "INCLUDE">
+<![%itemizedlist.module;[
+<!ENTITY % local.itemizedlist.attrib "">
+<!ENTITY % itemizedlist.role.attrib "%role.attrib;">
+
+<!ENTITY % itemizedlist.element "INCLUDE">
+<![%itemizedlist.element;[
+<!ELEMENT itemizedlist %ho; (blockinfo?, (%formalobject.title.content;)?,
+ 			    (%listpreamble.mix;)*, listitem+)>
+
+<!--end of itemizedlist.element-->]]>
+
+<!-- Spacing: Whether the vertical space in the list should be
+		compressed -->
+<!-- Mark: Keyword, e.g., bullet, dash, checkbox, none;
+		list of keywords and defaults are implementation specific -->
+
+
+<!ENTITY % itemizedlist.attlist "INCLUDE">
+<![%itemizedlist.attlist;[
+<!ATTLIST itemizedlist
+		spacing		(normal
+				|compact)	#IMPLIED
+		%mark.attrib;
+		%common.attrib;
+		%itemizedlist.role.attrib;
+		%local.itemizedlist.attrib;
+>
+<!--end of itemizedlist.attlist-->]]>
+<!--end of itemizedlist.module-->]]>
+
+<!ENTITY % orderedlist.module "INCLUDE">
+<![%orderedlist.module;[
+<!ENTITY % local.orderedlist.attrib "">
+<!ENTITY % orderedlist.role.attrib "%role.attrib;">
+
+<!ENTITY % orderedlist.element "INCLUDE">
+<![%orderedlist.element;[
+<!ELEMENT orderedlist %ho; (blockinfo?, (%formalobject.title.content;)?,
+ 			    (%listpreamble.mix;)*, listitem+)>
+
+<!--end of orderedlist.element-->]]>
+
+<!-- Numeration: Style of ListItem numbered; default is expected
+		to be Arabic -->
+<!-- InheritNum: Specifies for a nested list that the numbering
+		of ListItems should include the number of the item
+		within which they are nested (e.g., 1a and 1b within 1,
+		rather than a and b) -->
+<!-- Continuation: Where list numbering begins afresh (Restarts,
+		the default) or continues that of the immediately preceding
+		list (Continues) -->
+<!-- Spacing: Whether the vertical space in the list should be
+		compressed -->
+
+
+<!ENTITY % orderedlist.attlist "INCLUDE">
+<![%orderedlist.attlist;[
+<!ATTLIST orderedlist
+		numeration	(arabic
+				|upperalpha
+				|loweralpha
+				|upperroman
+				|lowerroman)	#IMPLIED
+		inheritnum	(inherit
+				|ignore)	"ignore"
+		continuation	(continues
+				|restarts)	"restarts"
+		spacing		(normal
+				|compact)	#IMPLIED
+		%common.attrib;
+		%orderedlist.role.attrib;
+		%local.orderedlist.attrib;
+>
+<!--end of orderedlist.attlist-->]]>
+<!--end of orderedlist.module-->]]>
+
+<!ENTITY % listitem.module "INCLUDE">
+<![%listitem.module;[
+<!ENTITY % local.listitem.attrib "">
+<!ENTITY % listitem.role.attrib "%role.attrib;">
+
+<!ENTITY % listitem.element "INCLUDE">
+<![%listitem.element;[
+<!ELEMENT listitem %ho; ((%component.mix;)+)>
+<!--end of listitem.element-->]]>
+
+<!-- Override: Indicates the mark to be used for this ListItem
+		instead of the default mark or the mark specified by
+		the Mark attribute on the enclosing ItemizedList -->
+
+
+<!ENTITY % listitem.attlist "INCLUDE">
+<![%listitem.attlist;[
+<!ATTLIST listitem
+		override	CDATA		#IMPLIED
+		%common.attrib;
+		%listitem.role.attrib;
+		%local.listitem.attrib;
+>
+<!--end of listitem.attlist-->]]>
+<!--end of listitem.module-->]]>
+
+<!-- SegmentedList .................... -->
+<!ENTITY % segmentedlist.content.module "INCLUDE">
+<![%segmentedlist.content.module;[
+<!ENTITY % segmentedlist.module "INCLUDE">
+<![%segmentedlist.module;[
+<!ENTITY % local.segmentedlist.attrib "">
+<!ENTITY % segmentedlist.role.attrib "%role.attrib;">
+
+<!ENTITY % segmentedlist.element "INCLUDE">
+<![%segmentedlist.element;[
+<!ELEMENT segmentedlist %ho; ((%formalobject.title.content;)?,
+                         segtitle+,
+                         seglistitem+)>
+<!--end of segmentedlist.element-->]]>
+
+<!ENTITY % segmentedlist.attlist "INCLUDE">
+<![%segmentedlist.attlist;[
+<!ATTLIST segmentedlist
+		%common.attrib;
+		%segmentedlist.role.attrib;
+		%local.segmentedlist.attrib;
+>
+<!--end of segmentedlist.attlist-->]]>
+<!--end of segmentedlist.module-->]]>
+
+<!ENTITY % segtitle.module "INCLUDE">
+<![%segtitle.module;[
+<!ENTITY % local.segtitle.attrib "">
+<!ENTITY % segtitle.role.attrib "%role.attrib;">
+
+<!ENTITY % segtitle.element "INCLUDE">
+<![%segtitle.element;[
+<!ELEMENT segtitle %ho; (%title.char.mix;)*>
+<!--end of segtitle.element-->]]>
+
+<!ENTITY % segtitle.attlist "INCLUDE">
+<![%segtitle.attlist;[
+<!ATTLIST segtitle
+		%common.attrib;
+		%segtitle.role.attrib;
+		%local.segtitle.attrib;
+>
+<!--end of segtitle.attlist-->]]>
+<!--end of segtitle.module-->]]>
+
+<!ENTITY % seglistitem.module "INCLUDE">
+<![%seglistitem.module;[
+<!ENTITY % local.seglistitem.attrib "">
+<!ENTITY % seglistitem.role.attrib "%role.attrib;">
+
+<!ENTITY % seglistitem.element "INCLUDE">
+<![%seglistitem.element;[
+<!ELEMENT seglistitem %ho; (seg+)>
+<!--end of seglistitem.element-->]]>
+
+<!ENTITY % seglistitem.attlist "INCLUDE">
+<![%seglistitem.attlist;[
+<!ATTLIST seglistitem
+		%common.attrib;
+		%seglistitem.role.attrib;
+		%local.seglistitem.attrib;
+>
+<!--end of seglistitem.attlist-->]]>
+<!--end of seglistitem.module-->]]>
+
+<!ENTITY % seg.module "INCLUDE">
+<![%seg.module;[
+<!ENTITY % local.seg.attrib "">
+<!ENTITY % seg.role.attrib "%role.attrib;">
+
+<!ENTITY % seg.element "INCLUDE">
+<![%seg.element;[
+<!ELEMENT seg %ho; (%para.char.mix;)*>
+<!--end of seg.element-->]]>
+
+<!ENTITY % seg.attlist "INCLUDE">
+<![%seg.attlist;[
+<!ATTLIST seg
+		%common.attrib;
+		%seg.role.attrib;
+		%local.seg.attrib;
+>
+<!--end of seg.attlist-->]]>
+<!--end of seg.module-->]]>
+<!--end of segmentedlist.content.module-->]]>
+
+<!-- SimpleList ....................... -->
+
+<!ENTITY % simplelist.content.module "INCLUDE">
+<![%simplelist.content.module;[
+<!ENTITY % simplelist.module "INCLUDE">
+<![%simplelist.module;[
+<!ENTITY % local.simplelist.attrib "">
+<!ENTITY % simplelist.role.attrib "%role.attrib;">
+
+<!ENTITY % simplelist.element "INCLUDE">
+<![%simplelist.element;[
+<!ELEMENT simplelist %ho; (member+)>
+<!--end of simplelist.element-->]]>
+
+<!-- Columns: The number of columns the array should contain -->
+<!-- Type: How the Members of the SimpleList should be
+		formatted: Inline (members separated with commas etc.
+		inline), Vert (top to bottom in n Columns), or Horiz (in
+		the direction of text flow) in n Columns.  If Column
+		is 1 or implied, Type=Vert and Type=Horiz give the same
+		results. -->
+
+
+<!ENTITY % simplelist.attlist "INCLUDE">
+<![%simplelist.attlist;[
+<!ATTLIST simplelist
+		columns		CDATA		#IMPLIED
+		type		(inline
+				|vert
+				|horiz)		"vert"
+		%common.attrib;
+		%simplelist.role.attrib;
+		%local.simplelist.attrib;
+>
+<!--end of simplelist.attlist-->]]>
+<!--end of simplelist.module-->]]>
+
+<!ENTITY % member.module "INCLUDE">
+<![%member.module;[
+<!ENTITY % local.member.attrib "">
+<!ENTITY % member.role.attrib "%role.attrib;">
+
+<!ENTITY % member.element "INCLUDE">
+<![%member.element;[
+<!ELEMENT member %ho; (%para.char.mix;)*>
+<!--end of member.element-->]]>
+
+<!ENTITY % member.attlist "INCLUDE">
+<![%member.attlist;[
+<!ATTLIST member
+		%common.attrib;
+		%member.role.attrib;
+		%local.member.attrib;
+>
+<!--end of member.attlist-->]]>
+<!--end of member.module-->]]>
+<!--end of simplelist.content.module-->]]>
+
+<!-- VariableList ..................... -->
+
+<!ENTITY % variablelist.content.module "INCLUDE">
+<![%variablelist.content.module;[
+<!ENTITY % variablelist.module "INCLUDE">
+<![%variablelist.module;[
+<!ENTITY % local.variablelist.attrib "">
+<!ENTITY % variablelist.role.attrib "%role.attrib;">
+
+<!ENTITY % variablelist.element "INCLUDE">
+<![%variablelist.element;[
+<!ELEMENT variablelist %ho; (blockinfo?, (%formalobject.title.content;)?,
+ 			    (%listpreamble.mix;)*, varlistentry+)>
+<!--end of variablelist.element-->]]>
+
+<!-- TermLength: Length beyond which the presentation engine
+		may consider the Term too long and select an alternate
+		presentation of the Term and, or, its associated ListItem. -->
+
+
+<!ENTITY % variablelist.attlist "INCLUDE">
+<![%variablelist.attlist;[
+<!ATTLIST variablelist
+		termlength	CDATA		#IMPLIED
+		spacing		(normal
+				|compact)	#IMPLIED
+		%common.attrib;
+		%variablelist.role.attrib;
+		%local.variablelist.attrib;
+>
+<!--end of variablelist.attlist-->]]>
+<!--end of variablelist.module-->]]>
+
+<!ENTITY % varlistentry.module "INCLUDE">
+<![%varlistentry.module;[
+<!ENTITY % local.varlistentry.attrib "">
+<!ENTITY % varlistentry.role.attrib "%role.attrib;">
+
+<!ENTITY % varlistentry.element "INCLUDE">
+<![%varlistentry.element;[
+<!ELEMENT varlistentry %ho; (term+, listitem)>
+<!--end of varlistentry.element-->]]>
+
+<!ENTITY % varlistentry.attlist "INCLUDE">
+<![%varlistentry.attlist;[
+<!ATTLIST varlistentry
+		%common.attrib;
+		%varlistentry.role.attrib;
+		%local.varlistentry.attrib;
+>
+<!--end of varlistentry.attlist-->]]>
+<!--end of varlistentry.module-->]]>
+
+<!ENTITY % term.module "INCLUDE">
+<![%term.module;[
+<!ENTITY % local.term.attrib "">
+<!ENTITY % term.role.attrib "%role.attrib;">
+
+<!ENTITY % term.element "INCLUDE">
+<![%term.element;[
+<!ELEMENT term %ho; (%para.char.mix;)*>
+<!--end of term.element-->]]>
+
+<!ENTITY % term.attlist "INCLUDE">
+<![%term.attlist;[
+<!ATTLIST term
+		%common.attrib;
+		%term.role.attrib;
+		%local.term.attrib;
+>
+<!--end of term.attlist-->]]>
+<!--end of term.module-->]]>
+
+<!-- ListItem (defined above)-->
+<!--end of variablelist.content.module-->]]>
+
+<!-- CalloutList ...................... -->
+
+<!ENTITY % calloutlist.content.module "INCLUDE">
+<![%calloutlist.content.module;[
+<!ENTITY % calloutlist.module "INCLUDE">
+<![%calloutlist.module;[
+<!ENTITY % local.calloutlist.attrib "">
+<!ENTITY % calloutlist.role.attrib "%role.attrib;">
+
+<!ENTITY % calloutlist.element "INCLUDE">
+<![%calloutlist.element;[
+<!ELEMENT calloutlist %ho; ((%formalobject.title.content;)?, callout+)>
+<!--end of calloutlist.element-->]]>
+
+<!ENTITY % calloutlist.attlist "INCLUDE">
+<![%calloutlist.attlist;[
+<!ATTLIST calloutlist
+		%common.attrib;
+		%calloutlist.role.attrib;
+		%local.calloutlist.attrib;
+>
+<!--end of calloutlist.attlist-->]]>
+<!--end of calloutlist.module-->]]>
+
+<!ENTITY % callout.module "INCLUDE">
+<![%callout.module;[
+<!ENTITY % local.callout.attrib "">
+<!ENTITY % callout.role.attrib "%role.attrib;">
+
+<!ENTITY % callout.element "INCLUDE">
+<![%callout.element;[
+<!ELEMENT callout %ho; ((%component.mix;)+)>
+<!--end of callout.element-->]]>
+
+<!-- AreaRefs: IDs of one or more Areas or AreaSets described
+		by this Callout -->
+
+
+<!ENTITY % callout.attlist "INCLUDE">
+<![%callout.attlist;[
+<!ATTLIST callout
+		arearefs	IDREFS		#REQUIRED
+		%common.attrib;
+		%callout.role.attrib;
+		%local.callout.attrib;
+>
+<!--end of callout.attlist-->]]>
+<!--end of callout.module-->]]>
+<!--end of calloutlist.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Objects .............................................................. -->
+
+<!-- Examples etc. .................... -->
+
+<!ENTITY % example.module "INCLUDE">
+<![%example.module;[
+<!ENTITY % local.example.attrib "">
+<!ENTITY % example.role.attrib "%role.attrib;">
+
+<!ENTITY % example.element "INCLUDE">
+<![%example.element;[
+<!ELEMENT example %ho; (blockinfo?, (%formalobject.title.content;), (%example.mix;)+)
+		%formal.exclusion;>
+<!--end of example.element-->]]>
+
+<!ENTITY % example.attlist "INCLUDE">
+<![%example.attlist;[
+<!ATTLIST example
+		floatstyle	CDATA			#IMPLIED
+		%label.attrib;
+		%width.attrib;
+		%common.attrib;
+		%example.role.attrib;
+		%local.example.attrib;
+>
+<!--end of example.attlist-->]]>
+<!--end of example.module-->]]>
+
+<!ENTITY % informalexample.module "INCLUDE">
+<![%informalexample.module;[
+<!ENTITY % local.informalexample.attrib "">
+<!ENTITY % informalexample.role.attrib "%role.attrib;">
+
+<!ENTITY % informalexample.element "INCLUDE">
+<![%informalexample.element;[
+<!ELEMENT informalexample %ho; (blockinfo?, (%example.mix;)+)>
+<!--end of informalexample.element-->]]>
+
+<!ENTITY % informalexample.attlist "INCLUDE">
+<![%informalexample.attlist;[
+<!ATTLIST informalexample
+		floatstyle	CDATA			#IMPLIED
+		%width.attrib;
+		%common.attrib;
+		%informalexample.role.attrib;
+		%local.informalexample.attrib;
+>
+<!--end of informalexample.attlist-->]]>
+<!--end of informalexample.module-->]]>
+
+<!ENTITY % programlistingco.module "INCLUDE">
+<![%programlistingco.module;[
+<!ENTITY % local.programlistingco.attrib "">
+<!ENTITY % programlistingco.role.attrib "%role.attrib;">
+
+<!ENTITY % programlistingco.element "INCLUDE">
+<![%programlistingco.element;[
+<!ELEMENT programlistingco %ho; (areaspec, programlisting, calloutlist*)>
+<!--end of programlistingco.element-->]]>
+
+<!ENTITY % programlistingco.attlist "INCLUDE">
+<![%programlistingco.attlist;[
+<!ATTLIST programlistingco
+		%common.attrib;
+		%programlistingco.role.attrib;
+		%local.programlistingco.attrib;
+>
+<!--end of programlistingco.attlist-->]]>
+<!-- CalloutList (defined above in Lists)-->
+<!--end of informalexample.module-->]]>
+
+<!ENTITY % areaspec.content.module "INCLUDE">
+<![%areaspec.content.module;[
+<!ENTITY % areaspec.module "INCLUDE">
+<![%areaspec.module;[
+<!ENTITY % local.areaspec.attrib "">
+<!ENTITY % areaspec.role.attrib "%role.attrib;">
+
+<!ENTITY % areaspec.element "INCLUDE">
+<![%areaspec.element;[
+<!ELEMENT areaspec %ho; ((area|areaset)+)>
+<!--end of areaspec.element-->]]>
+
+<!-- Units: global unit of measure in which coordinates in
+		this spec are expressed:
+
+		- CALSPair "x1,y1 x2,y2": lower-left and upper-right
+		coordinates in a rectangle describing repro area in which
+		graphic is placed, where X and Y dimensions are each some
+		number 0..10000 (taken from CALS graphic attributes)
+
+		- LineColumn "line column": line number and column number
+		at which to start callout text in "linespecific" content
+
+		- LineRange "startline endline": whole lines from startline
+		to endline in "linespecific" content
+
+		- LineColumnPair "line1 col1 line2 col2": starting and ending
+		points of area in "linespecific" content that starts at
+		first position and ends at second position (including the
+		beginnings of any intervening lines)
+
+		- Other: directive to look at value of OtherUnits attribute
+		to get implementation-specific keyword
+
+		The default is implementation-specific; usually dependent on
+		the parent element (GraphicCO gets CALSPair, ProgramListingCO
+		and ScreenCO get LineColumn) -->
+<!-- OtherUnits: User-defined units -->
+
+
+<!ENTITY % areaspec.attlist "INCLUDE">
+<![%areaspec.attlist;[
+<!ATTLIST areaspec
+		units		(calspair
+				|linecolumn
+				|linerange
+				|linecolumnpair
+				|other)		#IMPLIED
+		otherunits	NMTOKEN		#IMPLIED
+		%common.attrib;
+		%areaspec.role.attrib;
+		%local.areaspec.attrib;
+>
+<!--end of areaspec.attlist-->]]>
+<!--end of areaspec.module-->]]>
+
+<!ENTITY % area.module "INCLUDE">
+<![%area.module;[
+<!ENTITY % local.area.attrib "">
+<!ENTITY % area.role.attrib "%role.attrib;">
+
+<!ENTITY % area.element "INCLUDE">
+<![%area.element;[
+<!ELEMENT area %ho; EMPTY>
+<!--end of area.element-->]]>
+
+<!-- bug number/symbol override or initialization -->
+<!-- to any related information -->
+<!-- Units: unit of measure in which coordinates in this
+		area are expressed; inherits from AreaSet and AreaSpec -->
+<!-- OtherUnits: User-defined units -->
+
+
+<!ENTITY % area.attlist "INCLUDE">
+<![%area.attlist;[
+<!ATTLIST area
+		%label.attrib;
+		%linkends.attrib;
+		units		(calspair
+				|linecolumn
+				|linerange
+				|linecolumnpair
+				|other)		#IMPLIED
+		otherunits	NMTOKEN		#IMPLIED
+		coords		CDATA		#REQUIRED
+		%idreq.common.attrib;
+		%area.role.attrib;
+		%local.area.attrib;
+>
+<!--end of area.attlist-->]]>
+<!--end of area.module-->]]>
+
+<!ENTITY % areaset.module "INCLUDE">
+<![%areaset.module;[
+<!ENTITY % local.areaset.attrib "">
+<!ENTITY % areaset.role.attrib "%role.attrib;">
+
+<!ENTITY % areaset.element "INCLUDE">
+<![%areaset.element;[
+<!ELEMENT areaset %ho; (area+)>
+<!--end of areaset.element-->]]>
+
+<!-- bug number/symbol override or initialization -->
+<!-- Units: unit of measure in which coordinates in this
+		area are expressed; inherits from AreaSpec -->
+
+
+<!ENTITY % areaset.attlist "INCLUDE">
+<![%areaset.attlist;[
+<!ATTLIST areaset
+		%label.attrib;
+		units		(calspair
+				|linecolumn
+				|linerange
+				|linecolumnpair
+				|other)		#IMPLIED
+		otherunits	NMTOKEN		#IMPLIED
+		coords		CDATA		#REQUIRED
+		%idreq.common.attrib;
+		%areaset.role.attrib;
+		%local.areaset.attrib;
+>
+<!--end of areaset.attlist-->]]>
+<!--end of areaset.module-->]]>
+<!--end of areaspec.content.module-->]]>
+
+<!ENTITY % programlisting.module "INCLUDE">
+<![%programlisting.module;[
+<!ENTITY % local.programlisting.attrib "">
+<!ENTITY % programlisting.role.attrib "%role.attrib;">
+
+<!ENTITY % programlisting.element "INCLUDE">
+<![%programlisting.element;[
+<!ELEMENT programlisting %ho; (%para.char.mix;|co|coref|lineannotation|textobject)*>
+<!--end of programlisting.element-->]]>
+
+<!ENTITY % programlisting.attlist "INCLUDE">
+<![%programlisting.attlist;[
+<!ATTLIST programlisting
+		%width.attrib;
+		%linespecific.attrib;
+		%common.attrib;
+		%programlisting.role.attrib;
+		%local.programlisting.attrib;
+>
+<!--end of programlisting.attlist-->]]>
+<!--end of programlisting.module-->]]>
+
+<!ENTITY % literallayout.module "INCLUDE">
+<![%literallayout.module;[
+<!ENTITY % local.literallayout.attrib "">
+<!ENTITY % literallayout.role.attrib "%role.attrib;">
+
+<!ENTITY % literallayout.element "INCLUDE">
+<![%literallayout.element;[
+<!ELEMENT literallayout %ho; (%para.char.mix;|co|coref|textobject|lineannotation)*>
+<!--end of literallayout.element-->]]>
+
+<!ENTITY % literallayout.attlist "INCLUDE">
+<![%literallayout.attlist;[
+<!ATTLIST literallayout
+		%width.attrib;
+		%linespecific.attrib;
+		class	(monospaced|normal)	"normal"
+		%common.attrib;
+		%literallayout.role.attrib;
+		%local.literallayout.attrib;
+>
+<!--end of literallayout.attlist-->]]>
+<!-- LineAnnotation (defined in the Inlines section, below)-->
+<!--end of literallayout.module-->]]>
+
+<!ENTITY % screenco.module "INCLUDE">
+<![%screenco.module;[
+<!ENTITY % local.screenco.attrib "">
+<!ENTITY % screenco.role.attrib "%role.attrib;">
+
+<!ENTITY % screenco.element "INCLUDE">
+<![%screenco.element;[
+<!ELEMENT screenco %ho; (areaspec, screen, calloutlist*)>
+<!--end of screenco.element-->]]>
+
+<!ENTITY % screenco.attlist "INCLUDE">
+<![%screenco.attlist;[
+<!ATTLIST screenco
+		%common.attrib;
+		%screenco.role.attrib;
+		%local.screenco.attrib;
+>
+<!--end of screenco.attlist-->]]>
+<!-- AreaSpec (defined above)-->
+<!-- CalloutList (defined above in Lists)-->
+<!--end of screenco.module-->]]>
+
+<!ENTITY % screen.module "INCLUDE">
+<![%screen.module;[
+<!ENTITY % local.screen.attrib "">
+<!ENTITY % screen.role.attrib "%role.attrib;">
+
+<!ENTITY % screen.element "INCLUDE">
+<![%screen.element;[
+<!ELEMENT screen %ho; (%para.char.mix;|co|coref|textobject|lineannotation)*>
+<!--end of screen.element-->]]>
+
+<!ENTITY % screen.attlist "INCLUDE">
+<![%screen.attlist;[
+<!ATTLIST screen
+		%width.attrib;
+		%linespecific.attrib;
+		%common.attrib;
+		%screen.role.attrib;
+		%local.screen.attrib;
+>
+<!--end of screen.attlist-->]]>
+<!--end of screen.module-->]]>
+
+<!ENTITY % screenshot.content.module "INCLUDE">
+<![%screenshot.content.module;[
+<!ENTITY % screenshot.module "INCLUDE">
+<![%screenshot.module;[
+<!ENTITY % local.screenshot.attrib "">
+<!ENTITY % screenshot.role.attrib "%role.attrib;">
+
+<!ENTITY % screenshot.element "INCLUDE">
+<![%screenshot.element;[
+<!ELEMENT screenshot %ho; (screeninfo?,
+                      (graphic|graphicco
+                      |mediaobject|mediaobjectco))>
+<!--end of screenshot.element-->]]>
+
+<!ENTITY % screenshot.attlist "INCLUDE">
+<![%screenshot.attlist;[
+<!ATTLIST screenshot
+		%common.attrib;
+		%screenshot.role.attrib;
+		%local.screenshot.attrib;
+>
+<!--end of screenshot.attlist-->]]>
+<!--end of screenshot.module-->]]>
+
+<!ENTITY % screeninfo.module "INCLUDE">
+<![%screeninfo.module;[
+<!ENTITY % local.screeninfo.attrib "">
+<!ENTITY % screeninfo.role.attrib "%role.attrib;">
+
+<!ENTITY % screeninfo.element "INCLUDE">
+<![%screeninfo.element;[
+<!ELEMENT screeninfo %ho; (%para.char.mix;)*
+		%ubiq.exclusion;>
+<!--end of screeninfo.element-->]]>
+
+<!ENTITY % screeninfo.attlist "INCLUDE">
+<![%screeninfo.attlist;[
+<!ATTLIST screeninfo
+		%common.attrib;
+		%screeninfo.role.attrib;
+		%local.screeninfo.attrib;
+>
+<!--end of screeninfo.attlist-->]]>
+<!--end of screeninfo.module-->]]>
+<!--end of screenshot.content.module-->]]>
+
+<!-- Figures etc. ..................... -->
+
+<!ENTITY % figure.module "INCLUDE">
+<![%figure.module;[
+<!ENTITY % local.figure.attrib "">
+<!ENTITY % figure.role.attrib "%role.attrib;">
+
+<!ENTITY % figure.element "INCLUDE">
+<![%figure.element;[
+<!ELEMENT figure %ho; (blockinfo?, (%formalobject.title.content;),
+                       (%figure.mix; | %link.char.class;)+)>
+<!--end of figure.element-->]]>
+
+<!-- Float: Whether the Figure is supposed to be rendered
+		where convenient (yes (1) value) or at the place it occurs
+		in the text (no (0) value, the default) -->
+
+
+<!ENTITY % figure.attlist "INCLUDE">
+<![%figure.attlist;[
+<!ATTLIST figure
+		float		%yesorno.attvals;	'0'
+		floatstyle	CDATA			#IMPLIED
+		pgwide      	%yesorno.attvals;       #IMPLIED
+		%label.attrib;
+		%common.attrib;
+		%figure.role.attrib;
+		%local.figure.attrib;
+>
+<!--end of figure.attlist-->]]>
+<!--end of figure.module-->]]>
+
+<!ENTITY % informalfigure.module "INCLUDE">
+<![ %informalfigure.module; [
+<!ENTITY % local.informalfigure.attrib "">
+<!ENTITY % informalfigure.role.attrib "%role.attrib;">
+
+<!ENTITY % informalfigure.element "INCLUDE">
+<![ %informalfigure.element; [
+<!ELEMENT informalfigure %ho; (blockinfo?, (%figure.mix; | %link.char.class;)+)>
+<!--end of informalfigure.element-->]]>
+
+<!ENTITY % informalfigure.attlist "INCLUDE">
+<![ %informalfigure.attlist; [
+<!--
+Float: Whether the Figure is supposed to be rendered
+where convenient (yes (1) value) or at the place it occurs
+in the text (no (0) value, the default)
+-->
+<!ATTLIST informalfigure
+		float		%yesorno.attvals;	"0"
+		floatstyle	CDATA			#IMPLIED
+		pgwide      	%yesorno.attvals;       #IMPLIED
+		%label.attrib;
+		%common.attrib;
+		%informalfigure.role.attrib;
+		%local.informalfigure.attrib;
+>
+<!--end of informalfigure.attlist-->]]>
+<!--end of informalfigure.module-->]]>
+
+<!ENTITY % graphicco.module "INCLUDE">
+<![%graphicco.module;[
+<!ENTITY % local.graphicco.attrib "">
+<!ENTITY % graphicco.role.attrib "%role.attrib;">
+
+<!ENTITY % graphicco.element "INCLUDE">
+<![%graphicco.element;[
+<!ELEMENT graphicco %ho; (areaspec, graphic, calloutlist*)>
+<!--end of graphicco.element-->]]>
+
+<!ENTITY % graphicco.attlist "INCLUDE">
+<![%graphicco.attlist;[
+<!ATTLIST graphicco
+		%common.attrib;
+		%graphicco.role.attrib;
+		%local.graphicco.attrib;
+>
+<!--end of graphicco.attlist-->]]>
+<!-- AreaSpec (defined above in Examples)-->
+<!-- CalloutList (defined above in Lists)-->
+<!--end of graphicco.module-->]]>
+
+<!-- Graphical data can be the content of Graphic, or you can reference
+     an external file either as an entity (Entitref) or a filename
+     (Fileref). -->
+
+<!ENTITY % graphic.module "INCLUDE">
+<![%graphic.module;[
+<!ENTITY % local.graphic.attrib "">
+<!ENTITY % graphic.role.attrib "%role.attrib;">
+
+<!ENTITY % graphic.element "INCLUDE">
+<![%graphic.element;[
+<!ELEMENT graphic %ho; EMPTY>
+<!--end of graphic.element-->]]>
+
+<!ENTITY % graphic.attlist "INCLUDE">
+<![%graphic.attlist;[
+<!ATTLIST graphic
+		%graphics.attrib;
+		%common.attrib;
+		%graphic.role.attrib;
+		%local.graphic.attrib;
+>
+<!--end of graphic.attlist-->]]>
+<!--end of graphic.module-->]]>
+
+<!ENTITY % inlinegraphic.module "INCLUDE">
+<![%inlinegraphic.module;[
+<!ENTITY % local.inlinegraphic.attrib "">
+<!ENTITY % inlinegraphic.role.attrib "%role.attrib;">
+
+<!ENTITY % inlinegraphic.element "INCLUDE">
+<![%inlinegraphic.element;[
+<!ELEMENT inlinegraphic %ho; EMPTY>
+<!--end of inlinegraphic.element-->]]>
+
+<!ENTITY % inlinegraphic.attlist "INCLUDE">
+<![%inlinegraphic.attlist;[
+<!ATTLIST inlinegraphic
+		%graphics.attrib;
+		%common.attrib;
+		%inlinegraphic.role.attrib;
+		%local.inlinegraphic.attrib;
+>
+<!--end of inlinegraphic.attlist-->]]>
+<!--end of inlinegraphic.module-->]]>
+
+<!ENTITY % mediaobject.content.module "INCLUDE">
+<![ %mediaobject.content.module; [
+
+<!ENTITY % mediaobject.module "INCLUDE">
+<![ %mediaobject.module; [
+<!ENTITY % local.mediaobject.attrib "">
+<!ENTITY % mediaobject.role.attrib "%role.attrib;">
+
+<!ENTITY % mediaobject.element "INCLUDE">
+<![ %mediaobject.element; [
+<!ELEMENT mediaobject %ho; (objectinfo?,
+                           (%mediaobject.mix;)+,
+			   caption?)>
+<!--end of mediaobject.element-->]]>
+
+<!ENTITY % mediaobject.attlist "INCLUDE">
+<![ %mediaobject.attlist; [
+<!ATTLIST mediaobject
+		%common.attrib;
+		%mediaobject.role.attrib;
+		%local.mediaobject.attrib;
+>
+<!--end of mediaobject.attlist-->]]>
+<!--end of mediaobject.module-->]]>
+
+<!ENTITY % inlinemediaobject.module "INCLUDE">
+<![ %inlinemediaobject.module; [
+<!ENTITY % local.inlinemediaobject.attrib "">
+<!ENTITY % inlinemediaobject.role.attrib "%role.attrib;">
+
+<!ENTITY % inlinemediaobject.element "INCLUDE">
+<![ %inlinemediaobject.element; [
+<!ELEMENT inlinemediaobject %ho; (objectinfo?,
+                	         (%mediaobject.mix;)+)>
+<!--end of inlinemediaobject.element-->]]>
+
+<!ENTITY % inlinemediaobject.attlist "INCLUDE">
+<![ %inlinemediaobject.attlist; [
+<!ATTLIST inlinemediaobject
+		%common.attrib;
+		%inlinemediaobject.role.attrib;
+		%local.inlinemediaobject.attrib;
+>
+<!--end of inlinemediaobject.attlist-->]]>
+<!--end of inlinemediaobject.module-->]]>
+
+<!ENTITY % videoobject.module "INCLUDE">
+<![ %videoobject.module; [
+<!ENTITY % local.videoobject.attrib "">
+<!ENTITY % videoobject.role.attrib "%role.attrib;">
+
+<!ENTITY % videoobject.element "INCLUDE">
+<![ %videoobject.element; [
+<!ELEMENT videoobject %ho; (objectinfo?, videodata)>
+<!--end of videoobject.element-->]]>
+
+<!ENTITY % videoobject.attlist "INCLUDE">
+<![ %videoobject.attlist; [
+<!ATTLIST videoobject
+		%common.attrib;
+		%videoobject.role.attrib;
+		%local.videoobject.attrib;
+>
+<!--end of videoobject.attlist-->]]>
+<!--end of videoobject.module-->]]>
+
+<!ENTITY % audioobject.module "INCLUDE">
+<![ %audioobject.module; [
+<!ENTITY % local.audioobject.attrib "">
+<!ENTITY % audioobject.role.attrib "%role.attrib;">
+
+<!ENTITY % audioobject.element "INCLUDE">
+<![ %audioobject.element; [
+<!ELEMENT audioobject %ho; (objectinfo?, audiodata)>
+<!--end of audioobject.element-->]]>
+
+<!ENTITY % audioobject.attlist "INCLUDE">
+<![ %audioobject.attlist; [
+<!ATTLIST audioobject
+		%common.attrib;
+		%audioobject.role.attrib;
+		%local.audioobject.attrib;
+>
+<!--end of audioobject.attlist-->]]>
+<!--end of audioobject.module-->]]>
+
+<!ENTITY % imageobject.module "INCLUDE">
+<![ %imageobject.module; [
+<!ENTITY % local.imageobject.attrib "">
+<!ENTITY % imageobject.role.attrib "%role.attrib;">
+
+<!ENTITY % imageobject.element "INCLUDE">
+<![ %imageobject.element; [
+<!ELEMENT imageobject %ho; (objectinfo?, imagedata)>
+<!--end of imageobject.element-->]]>
+
+<!ENTITY % imageobject.attlist "INCLUDE">
+<![ %imageobject.attlist; [
+<!ATTLIST imageobject
+		%common.attrib;
+		%imageobject.role.attrib;
+		%local.imageobject.attrib;
+>
+<!--end of imageobject.attlist-->]]>
+<!--end of imageobject.module-->]]>
+
+<!ENTITY % textobject.module "INCLUDE">
+<![ %textobject.module; [
+<!ENTITY % local.textobject.attrib "">
+<!ENTITY % textobject.role.attrib "%role.attrib;">
+
+<!ENTITY % textobject.element "INCLUDE">
+<![ %textobject.element; [
+<!ELEMENT textobject %ho; (objectinfo?, (phrase|textdata|(%textobject.mix;)+))>
+<!--end of textobject.element-->]]>
+
+<!ENTITY % textobject.attlist "INCLUDE">
+<![ %textobject.attlist; [
+<!ATTLIST textobject
+		%common.attrib;
+		%textobject.role.attrib;
+		%local.textobject.attrib;
+>
+<!--end of textobject.attlist-->]]>
+<!--end of textobject.module-->]]>
+
+<!ENTITY % objectinfo.module "INCLUDE">
+<![ %objectinfo.module; [
+<!ENTITY % local.objectinfo.attrib "">
+<!ENTITY % objectinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % objectinfo.element "INCLUDE">
+<![ %objectinfo.element; [
+<!ELEMENT objectinfo %ho; ((%info.class;)+)
+	%beginpage.exclusion;>
+<!--end of objectinfo.element-->]]>
+
+<!ENTITY % objectinfo.attlist "INCLUDE">
+<![ %objectinfo.attlist; [
+<!ATTLIST objectinfo
+		%common.attrib;
+		%objectinfo.role.attrib;
+		%local.objectinfo.attrib;
+>
+<!--end of objectinfo.attlist-->]]>
+<!--end of objectinfo.module-->]]>
+
+<!--EntityRef: Name of an external entity containing the content
+	of the object data-->
+<!--FileRef: Filename, qualified by a pathname if desired,
+	designating the file containing the content of the object data-->
+<!--Format: Notation of the element content, if any-->
+<!--SrcCredit: Information about the source of the image-->
+<!ENTITY % local.objectdata.attrib "">
+<!ENTITY % objectdata.attrib
+	"
+	entityref	ENTITY		#IMPLIED
+	fileref 	CDATA		#IMPLIED
+	format		(%notation.class;)
+					#IMPLIED
+	srccredit	CDATA		#IMPLIED
+	%local.objectdata.attrib;"
+>
+
+<!ENTITY % videodata.module "INCLUDE">
+<![ %videodata.module; [
+<!ENTITY % local.videodata.attrib "">
+<!ENTITY % videodata.role.attrib "%role.attrib;">
+
+<!ENTITY % videodata.element "INCLUDE">
+<![ %videodata.element; [
+<!ELEMENT videodata %ho; EMPTY>
+<!--end of videodata.element-->]]>
+
+<!ENTITY % videodata.attlist "INCLUDE">
+<![ %videodata.attlist; [
+
+<!--Width: Same as CALS reprowid (desired width)-->
+<!--Depth: Same as CALS reprodep (desired depth)-->
+<!--Align: Same as CALS hplace with 'none' removed; #IMPLIED means
+	application-specific-->
+<!--Scale: Conflation of CALS hscale and vscale-->
+<!--Scalefit: Same as CALS scalefit-->
+<!ATTLIST videodata
+	width		CDATA		#IMPLIED
+	contentwidth	CDATA		#IMPLIED
+	depth		CDATA		#IMPLIED
+	contentdepth	CDATA		#IMPLIED
+	align		(left
+			|right
+			|center)	#IMPLIED
+	valign		(top
+			|middle
+			|bottom)	#IMPLIED
+	scale		CDATA		#IMPLIED
+	scalefit	%yesorno.attvals;
+					#IMPLIED
+		%objectdata.attrib;
+		%common.attrib;
+		%videodata.role.attrib;
+		%local.videodata.attrib;
+>
+<!--end of videodata.attlist-->]]>
+<!--end of videodata.module-->]]>
+
+<!ENTITY % audiodata.module "INCLUDE">
+<![ %audiodata.module; [
+<!ENTITY % local.audiodata.attrib "">
+<!ENTITY % audiodata.role.attrib "%role.attrib;">
+
+<!ENTITY % audiodata.element "INCLUDE">
+<![ %audiodata.element; [
+<!ELEMENT audiodata %ho; EMPTY>
+<!--end of audiodata.element-->]]>
+
+<!ENTITY % audiodata.attlist "INCLUDE">
+<![ %audiodata.attlist; [
+<!ATTLIST audiodata
+		%objectdata.attrib;
+		%common.attrib;
+		%audiodata.role.attrib;
+		%local.audiodata.attrib;
+>
+<!--end of audiodata.attlist-->]]>
+<!--end of audiodata.module-->]]>
+
+<!ENTITY % imagedata.module "INCLUDE">
+<![ %imagedata.module; [
+<!ENTITY % local.imagedata.attrib "">
+<!ENTITY % imagedata.role.attrib "%role.attrib;">
+
+<!ENTITY % imagedata.element "INCLUDE">
+<![ %imagedata.element; [
+<!ELEMENT imagedata %ho; EMPTY>
+<!--end of imagedata.element-->]]>
+
+<!ENTITY % imagedata.attlist "INCLUDE">
+<![ %imagedata.attlist; [
+
+<!--Width: Same as CALS reprowid (desired width)-->
+<!--Depth: Same as CALS reprodep (desired depth)-->
+<!--Align: Same as CALS hplace with 'none' removed; #IMPLIED means
+	application-specific-->
+<!--Scale: Conflation of CALS hscale and vscale-->
+<!--Scalefit: Same as CALS scalefit-->
+<!ATTLIST imagedata
+	width		CDATA		#IMPLIED
+	contentwidth	CDATA		#IMPLIED
+	depth		CDATA		#IMPLIED
+	contentdepth	CDATA		#IMPLIED
+	align		(left
+			|right
+			|center)	#IMPLIED
+	valign		(top
+			|middle
+			|bottom)	#IMPLIED
+	scale		CDATA		#IMPLIED
+	scalefit	%yesorno.attvals;
+					#IMPLIED
+		%objectdata.attrib;
+		%common.attrib;
+		%imagedata.role.attrib;
+		%local.imagedata.attrib;
+>
+<!--end of imagedata.attlist-->]]>
+<!--end of imagedata.module-->]]>
+
+<!ENTITY % textdata.module "INCLUDE">
+<![ %textdata.module; [
+<!ENTITY % local.textdata.attrib "">
+<!ENTITY % textdata.role.attrib "%role.attrib;">
+
+<!ENTITY % textdata.element "INCLUDE">
+<![ %textdata.element; [
+<!ELEMENT textdata %ho; EMPTY>
+<!--end of textdata.element-->]]>
+
+<!ENTITY % textdata.attlist "INCLUDE">
+<![ %textdata.attlist; [
+<!ATTLIST textdata
+		encoding	CDATA	#IMPLIED
+		%objectdata.attrib;
+		%common.attrib;
+		%textdata.role.attrib;
+		%local.textdata.attrib;
+>
+<!--end of textdata.attlist-->]]>
+<!--end of textdata.module-->]]>
+
+<!ENTITY % mediaobjectco.module "INCLUDE">
+<![ %mediaobjectco.module; [
+<!ENTITY % local.mediaobjectco.attrib "">
+<!ENTITY % mediaobjectco.role.attrib "%role.attrib;">
+
+<!ENTITY % mediaobjectco.element "INCLUDE">
+<![ %mediaobjectco.element; [
+<!ELEMENT mediaobjectco %ho; (objectinfo?, imageobjectco,
+			   (imageobjectco|textobject)*)>
+<!--end of mediaobjectco.element-->]]>
+
+<!ENTITY % mediaobjectco.attlist "INCLUDE">
+<![ %mediaobjectco.attlist; [
+<!ATTLIST mediaobjectco
+		%common.attrib;
+		%mediaobjectco.role.attrib;
+		%local.mediaobjectco.attrib;
+>
+<!--end of mediaobjectco.attlist-->]]>
+<!--end of mediaobjectco.module-->]]>
+
+<!ENTITY % imageobjectco.module "INCLUDE">
+<![ %imageobjectco.module; [
+<!ENTITY % local.imageobjectco.attrib "">
+<!ENTITY % imageobjectco.role.attrib "%role.attrib;">
+
+<!ENTITY % imageobjectco.element "INCLUDE">
+<![ %imageobjectco.element; [
+<!ELEMENT imageobjectco %ho; (areaspec, imageobject, calloutlist*)>
+<!--end of imageobjectco.element-->]]>
+
+<!ENTITY % imageobjectco.attlist "INCLUDE">
+<![ %imageobjectco.attlist; [
+<!ATTLIST imageobjectco
+		%common.attrib;
+		%imageobjectco.role.attrib;
+		%local.imageobjectco.attrib;
+>
+<!--end of imageobjectco.attlist-->]]>
+<!--end of imageobjectco.module-->]]>
+<!--end of mediaobject.content.module-->]]>
+
+<!-- Equations ........................ -->
+
+<!-- This PE provides a mechanism for replacing equation content, -->
+<!-- perhaps adding a new or different model (e.g., MathML) -->
+<!ENTITY % equation.content "(alt?, (graphic+|mediaobject+))">
+<!ENTITY % inlineequation.content "(alt?, (graphic+|inlinemediaobject+))">
+
+<!ENTITY % equation.module "INCLUDE">
+<![%equation.module;[
+<!ENTITY % local.equation.attrib "">
+<!ENTITY % equation.role.attrib "%role.attrib;">
+
+<!ENTITY % equation.element "INCLUDE">
+<![%equation.element;[
+<!ELEMENT equation %ho; (blockinfo?, (%formalobject.title.content;)?,
+                         (informalequation | %equation.content;))>
+<!--end of equation.element-->]]>
+
+<!ENTITY % equation.attlist "INCLUDE">
+<![%equation.attlist;[
+<!ATTLIST equation
+		floatstyle	CDATA			#IMPLIED
+		%label.attrib;
+	 	%common.attrib;
+		%equation.role.attrib;
+		%local.equation.attrib;
+>
+<!--end of equation.attlist-->]]>
+<!--end of equation.module-->]]>
+
+<!ENTITY % informalequation.module "INCLUDE">
+<![%informalequation.module;[
+<!ENTITY % local.informalequation.attrib "">
+<!ENTITY % informalequation.role.attrib "%role.attrib;">
+
+<!ENTITY % informalequation.element "INCLUDE">
+<![%informalequation.element;[
+<!ELEMENT informalequation %ho; (blockinfo?, %equation.content;) >
+<!--end of informalequation.element-->]]>
+
+<!ENTITY % informalequation.attlist "INCLUDE">
+<![%informalequation.attlist;[
+<!ATTLIST informalequation
+		floatstyle	CDATA			#IMPLIED
+		%common.attrib;
+		%informalequation.role.attrib;
+		%local.informalequation.attrib;
+>
+<!--end of informalequation.attlist-->]]>
+<!--end of informalequation.module-->]]>
+
+<!ENTITY % inlineequation.module "INCLUDE">
+<![%inlineequation.module;[
+<!ENTITY % local.inlineequation.attrib "">
+<!ENTITY % inlineequation.role.attrib "%role.attrib;">
+
+<!ENTITY % inlineequation.element "INCLUDE">
+<![%inlineequation.element;[
+<!ELEMENT inlineequation %ho; (%inlineequation.content;)>
+<!--end of inlineequation.element-->]]>
+
+<!ENTITY % inlineequation.attlist "INCLUDE">
+<![%inlineequation.attlist;[
+<!ATTLIST inlineequation
+		%common.attrib;
+		%inlineequation.role.attrib;
+		%local.inlineequation.attrib;
+>
+<!--end of inlineequation.attlist-->]]>
+<!--end of inlineequation.module-->]]>
+
+<!ENTITY % alt.module "INCLUDE">
+<![%alt.module;[
+<!ENTITY % local.alt.attrib "">
+<!ENTITY % alt.role.attrib "%role.attrib;">
+
+<!ENTITY % alt.element "INCLUDE">
+<![%alt.element;[
+<!ELEMENT alt %ho; (#PCDATA)>
+<!--end of alt.element-->]]>
+
+<!ENTITY % alt.attlist "INCLUDE">
+<![%alt.attlist;[
+<!ATTLIST alt
+		%common.attrib;
+		%alt.role.attrib;
+		%local.alt.attrib;
+>
+<!--end of alt.attlist-->]]>
+<!--end of alt.module-->]]>
+
+<!-- Tables ........................... -->
+
+<!ENTITY % table.module "INCLUDE">
+<![%table.module;[
+
+<!-- Choose a table model. CALS or OASIS XML Exchange -->
+
+<!ENTITY % cals.table.module "INCLUDE">
+<![%cals.table.module;[
+<!ENTITY % exchange.table.module "IGNORE">
+]]>
+<!ENTITY % exchange.table.module "INCLUDE">
+
+<!-- Do we allow the HTML table model as well? -->
+<!ENTITY % allow.html.tables "INCLUDE">
+<![%allow.html.tables;[
+  <!-- ====================================================== -->
+  <!--  xhtmltbl.mod defines HTML tables and sets parameter
+        entities so that, when the CALS table module is read,
+        we end up allowing any table to be CALS or HTML.
+        i.e. This include must come first!                    -->
+  <!-- ====================================================== -->
+
+<!ENTITY % htmltbl
+  PUBLIC "-//OASIS//ELEMENTS DocBook XML HTML Tables V4.4//EN"
+  "htmltblx.mod">
+%htmltbl;
+<!--end of allow.html.tables-->]]>
+
+<!ENTITY % tables.role.attrib "%role.attrib;">
+
+<![%cals.table.module;[
+<!-- Add label and role attributes to table and informaltable -->
+<!ENTITY % bodyatt "
+		floatstyle	CDATA			#IMPLIED
+		rowheader	(firstcol|norowheader)	#IMPLIED
+                %label.attrib;"
+>
+
+<!-- Add common attributes to Table, TGroup, TBody, THead, TFoot, Row,
+     EntryTbl, and Entry (and InformalTable element). -->
+<!ENTITY % secur
+	"%common.attrib;
+	%tables.role.attrib;">
+
+<!ENTITY % common.table.attribs
+	"%bodyatt;
+	%secur;">
+
+<!-- Content model for Table. -->
+<!ENTITY % tbl.table.mdl
+	"(blockinfo?, (%formalobject.title.content;), (%ndxterm.class;)*,
+	  textobject*,
+          (graphic+|mediaobject+|tgroup+))">
+
+<!-- Allow either objects or inlines; beware of REs between elements. -->
+<!ENTITY % tbl.entry.mdl "%para.char.mix; | %tabentry.mix;">
+
+<!-- Reference CALS Table Model -->
+<!ENTITY % tablemodel
+  PUBLIC "-//OASIS//DTD DocBook CALS Table Model V4.4//EN"
+  "calstblx.dtd">
+]]>
+
+<![%exchange.table.module;[
+<!-- Add common attributes and the Label attribute to Table and -->
+<!-- InformalTable.                                             -->
+<!ENTITY % bodyatt
+	"%common.attrib;
+	rowheader	(firstcol|norowheader)	#IMPLIED
+	%label.attrib;
+	%tables.role.attrib;">
+
+<!ENTITY % common.table.attribs
+	"%bodyatt;">
+
+<!-- Add common attributes to TGroup, ColSpec, TBody, THead, Row, Entry -->
+
+<!ENTITY % tbl.tgroup.att       "%common.attrib;">
+<!ENTITY % tbl.colspec.att      "%common.attrib;">
+<!ENTITY % tbl.tbody.att        "%common.attrib;">
+<!ENTITY % tbl.thead.att        "%common.attrib;">
+<!ENTITY % tbl.row.att          "%common.attrib;">
+<!ENTITY % tbl.entry.att        "%common.attrib;">
+
+<!-- Content model for Table. -->
+<!ENTITY % tbl.table.mdl
+	"(blockinfo?, (%formalobject.title.content;), (%ndxterm.class;)*,
+	  textobject*,
+          (graphic+|mediaobject+|tgroup+))">
+
+<!-- Allow either objects or inlines; beware of REs between elements. -->
+<!ENTITY % tbl.entry.mdl "(%para.char.mix; | %tabentry.mix;)*">
+
+<!-- Reference OASIS Exchange Table Model -->
+<!ENTITY % tablemodel
+  PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN"
+  "soextblx.dtd">
+]]>
+
+%tablemodel;
+
+<!--end of table.module-->]]>
+
+<!ENTITY % informaltable.module "INCLUDE">
+<![%informaltable.module;[
+
+<!-- Note that InformalTable is dependent on some of the entity
+     declarations that customize Table. -->
+
+<!ENTITY % local.informaltable.attrib "">
+
+<!-- the following entity may have been declared by the XHTML table module -->
+<!ENTITY % informal.tbl.table.mdl "textobject*, (graphic+|mediaobject+|tgroup+)">
+
+<!ENTITY % informaltable.element "INCLUDE">
+<![%informaltable.element;[
+<!ELEMENT informaltable %ho; (blockinfo?, (%informal.tbl.table.mdl;))>
+<!--end of informaltable.element-->]]>
+
+<!-- Frame, Colsep, and Rowsep must be repeated because
+		they are not in entities in the table module. -->
+<!-- includes TabStyle, ToCentry, ShortEntry,
+				Orient, PgWide -->
+<!-- includes Label -->
+<!-- includes common attributes -->
+
+<!ENTITY % informaltable.attlist "INCLUDE">
+<![%informaltable.attlist;[
+<!ATTLIST informaltable
+		frame		(%tbl.frame.attval;)	#IMPLIED
+		colsep		%yesorno.attvals;	#IMPLIED
+		rowsep		%yesorno.attvals;	#IMPLIED
+		%common.table.attribs;
+		%tbl.table.att;
+		%local.informaltable.attrib;
+>
+<!--end of informaltable.attlist-->]]>
+<!--end of informaltable.module-->]]>
+
+<!ENTITY % caption.module "INCLUDE">
+<![ %caption.module; [
+<!ENTITY % local.caption.attrib "">
+<!ENTITY % caption.role.attrib "%role.attrib;">
+
+<!ENTITY % caption.element "INCLUDE">
+<![ %caption.element; [
+<!ELEMENT caption %ho; (#PCDATA | %textobject.mix;)*>
+<!--end of caption.element-->]]>
+
+<!ENTITY % caption.attlist "INCLUDE">
+<![ %caption.attlist; [
+<!-- attrs comes from HTML tables ... -->
+
+<![ %allow.html.tables; [
+<!-- common.attrib, but without ID because ID is in attrs -->
+<!ENTITY % caption.attlist.content "
+	%lang.attrib;
+	%remap.attrib;
+	%xreflabel.attrib;
+	%revisionflag.attrib;
+	%effectivity.attrib;
+	%dir.attrib;
+	%xml-base.attrib;
+	%local.common.attrib;
+		%caption.role.attrib;
+		%attrs;
+		align	(top|bottom|left|right)	#IMPLIED
+		%local.caption.attrib;
+">
+]]>
+<!ENTITY % caption.attlist.content "
+		%common.attrib;
+		%caption.role.attrib;
+		%local.caption.attrib;
+">
+
+<!ATTLIST caption %caption.attlist.content;>
+
+<!--end of caption.attlist-->]]>
+<!--end of caption.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Synopses ............................................................. -->
+
+<!-- Synopsis ......................... -->
+
+<!ENTITY % synopsis.module "INCLUDE">
+<![%synopsis.module;[
+<!ENTITY % local.synopsis.attrib "">
+<!ENTITY % synopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % synopsis.element "INCLUDE">
+<![%synopsis.element;[
+<!ELEMENT synopsis %ho; (%para.char.mix;|graphic|mediaobject|co|coref|textobject|lineannotation)*>
+<!--end of synopsis.element-->]]>
+
+<!ENTITY % synopsis.attlist "INCLUDE">
+<![%synopsis.attlist;[
+<!ATTLIST synopsis
+		%label.attrib;
+		%linespecific.attrib;
+		%common.attrib;
+		%synopsis.role.attrib;
+		%local.synopsis.attrib;
+>
+<!--end of synopsis.attlist-->]]>
+
+<!-- LineAnnotation (defined in the Inlines section, below)-->
+<!--end of synopsis.module-->]]>
+
+<!-- CmdSynopsis ...................... -->
+
+<!ENTITY % cmdsynopsis.content.module "INCLUDE">
+<![%cmdsynopsis.content.module;[
+<!ENTITY % cmdsynopsis.module "INCLUDE">
+<![%cmdsynopsis.module;[
+<!ENTITY % local.cmdsynopsis.attrib "">
+<!ENTITY % cmdsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % cmdsynopsis.element "INCLUDE">
+<![%cmdsynopsis.element;[
+<!ELEMENT cmdsynopsis %ho; ((command | arg | group | sbr)+, synopfragment*)>
+<!--end of cmdsynopsis.element-->]]>
+
+<!-- Sepchar: Character that should separate command and all
+		top-level arguments; alternate value might be e.g., &Delta; -->
+
+
+<!ENTITY % cmdsynopsis.attlist "INCLUDE">
+<![%cmdsynopsis.attlist;[
+<!ATTLIST cmdsynopsis
+		%label.attrib;
+		sepchar		CDATA		" "
+		cmdlength	CDATA		#IMPLIED
+		%common.attrib;
+		%cmdsynopsis.role.attrib;
+		%local.cmdsynopsis.attrib;
+>
+<!--end of cmdsynopsis.attlist-->]]>
+<!--end of cmdsynopsis.module-->]]>
+
+<!ENTITY % arg.module "INCLUDE">
+<![%arg.module;[
+<!ENTITY % local.arg.attrib "">
+<!ENTITY % arg.role.attrib "%role.attrib;">
+
+<!ENTITY % arg.element "INCLUDE">
+<![%arg.element;[
+<!ELEMENT arg %ho; (#PCDATA
+		| arg
+		| group
+		| option
+		| synopfragmentref
+		| replaceable
+		| sbr)*>
+<!--end of arg.element-->]]>
+
+<!-- Choice: Whether Arg must be supplied: Opt (optional to
+		supply, e.g. [arg]; the default), Req (required to supply,
+		e.g. {arg}), or Plain (required to supply, e.g. arg) -->
+<!-- Rep: whether Arg is repeatable: Norepeat (e.g. arg without
+		ellipsis; the default), or Repeat (e.g. arg...) -->
+
+
+<!ENTITY % arg.attlist "INCLUDE">
+<![%arg.attlist;[
+<!ATTLIST arg
+		choice		(opt
+				|req
+				|plain)		'opt'
+		rep		(norepeat
+				|repeat)	'norepeat'
+		%common.attrib;
+		%arg.role.attrib;
+		%local.arg.attrib;
+>
+<!--end of arg.attlist-->]]>
+<!--end of arg.module-->]]>
+
+<!ENTITY % group.module "INCLUDE">
+<![%group.module;[
+
+<!ENTITY % local.group.attrib "">
+<!ENTITY % group.role.attrib "%role.attrib;">
+
+<!ENTITY % group.element "INCLUDE">
+<![%group.element;[
+<!ELEMENT group %ho; ((arg | group | option | synopfragmentref
+		| replaceable | sbr)+)>
+<!--end of group.element-->]]>
+
+<!-- Choice: Whether Group must be supplied: Opt (optional to
+		supply, e.g.  [g1|g2|g3]; the default), Req (required to
+		supply, e.g.  {g1|g2|g3}), Plain (required to supply,
+		e.g.  g1|g2|g3), OptMult (can supply zero or more, e.g.
+		[[g1|g2|g3]]), or ReqMult (must supply one or more, e.g.
+		{{g1|g2|g3}}) -->
+<!-- Rep: whether Group is repeatable: Norepeat (e.g. group
+		without ellipsis; the default), or Repeat (e.g. group...) -->
+
+
+<!ENTITY % group.attlist "INCLUDE">
+<![%group.attlist;[
+<!ATTLIST group
+		choice		(opt
+				|req
+				|plain)         'opt'
+		rep		(norepeat
+				|repeat)	'norepeat'
+		%common.attrib;
+		%group.role.attrib;
+		%local.group.attrib;
+>
+<!--end of group.attlist-->]]>
+<!--end of group.module-->]]>
+
+<!ENTITY % sbr.module "INCLUDE">
+<![%sbr.module;[
+<!ENTITY % local.sbr.attrib "">
+<!-- Synopsis break -->
+<!ENTITY % sbr.role.attrib "%role.attrib;">
+
+<!ENTITY % sbr.element "INCLUDE">
+<![%sbr.element;[
+<!ELEMENT sbr %ho; EMPTY>
+<!--end of sbr.element-->]]>
+
+<!ENTITY % sbr.attlist "INCLUDE">
+<![%sbr.attlist;[
+<!ATTLIST sbr
+		%common.attrib;
+		%sbr.role.attrib;
+		%local.sbr.attrib;
+>
+<!--end of sbr.attlist-->]]>
+<!--end of sbr.module-->]]>
+
+<!ENTITY % synopfragmentref.module "INCLUDE">
+<![%synopfragmentref.module;[
+<!ENTITY % local.synopfragmentref.attrib "">
+<!ENTITY % synopfragmentref.role.attrib "%role.attrib;">
+
+<!ENTITY % synopfragmentref.element "INCLUDE">
+<![%synopfragmentref.element;[
+<!ELEMENT synopfragmentref %ho; (#PCDATA)>
+<!--end of synopfragmentref.element-->]]>
+
+<!-- to SynopFragment of complex synopsis
+			material for separate referencing -->
+
+
+<!ENTITY % synopfragmentref.attlist "INCLUDE">
+<![%synopfragmentref.attlist;[
+<!ATTLIST synopfragmentref
+		%linkendreq.attrib;		%common.attrib;
+		%synopfragmentref.role.attrib;
+		%local.synopfragmentref.attrib;
+>
+<!--end of synopfragmentref.attlist-->]]>
+<!--end of synopfragmentref.module-->]]>
+
+<!ENTITY % synopfragment.module "INCLUDE">
+<![%synopfragment.module;[
+<!ENTITY % local.synopfragment.attrib "">
+<!ENTITY % synopfragment.role.attrib "%role.attrib;">
+
+<!ENTITY % synopfragment.element "INCLUDE">
+<![%synopfragment.element;[
+<!ELEMENT synopfragment %ho; ((arg | group)+)>
+<!--end of synopfragment.element-->]]>
+
+<!ENTITY % synopfragment.attlist "INCLUDE">
+<![%synopfragment.attlist;[
+<!ATTLIST synopfragment
+		%idreq.common.attrib;
+		%synopfragment.role.attrib;
+		%local.synopfragment.attrib;
+>
+<!--end of synopfragment.attlist-->]]>
+<!--end of synopfragment.module-->]]>
+
+<!-- Command (defined in the Inlines section, below)-->
+<!-- Option (defined in the Inlines section, below)-->
+<!-- Replaceable (defined in the Inlines section, below)-->
+<!--end of cmdsynopsis.content.module-->]]>
+
+<!-- FuncSynopsis ..................... -->
+
+<!ENTITY % funcsynopsis.content.module "INCLUDE">
+<![%funcsynopsis.content.module;[
+<!ENTITY % funcsynopsis.module "INCLUDE">
+<![%funcsynopsis.module;[
+
+<!ENTITY % local.funcsynopsis.attrib "">
+<!ENTITY % funcsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % funcsynopsis.element "INCLUDE">
+<![%funcsynopsis.element;[
+<!ELEMENT funcsynopsis %ho; ((funcsynopsisinfo | funcprototype)+)>
+<!--end of funcsynopsis.element-->]]>
+
+<!ENTITY % funcsynopsis.attlist "INCLUDE">
+<![%funcsynopsis.attlist;[
+<!ATTLIST funcsynopsis
+		%label.attrib;
+		%common.attrib;
+		%funcsynopsis.role.attrib;
+		%local.funcsynopsis.attrib;
+>
+<!--end of funcsynopsis.attlist-->]]>
+<!--end of funcsynopsis.module-->]]>
+
+<!ENTITY % funcsynopsisinfo.module "INCLUDE">
+<![%funcsynopsisinfo.module;[
+<!ENTITY % local.funcsynopsisinfo.attrib "">
+<!ENTITY % funcsynopsisinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % funcsynopsisinfo.element "INCLUDE">
+<![%funcsynopsisinfo.element;[
+<!ELEMENT funcsynopsisinfo %ho; (%cptr.char.mix;|textobject|lineannotation)*>
+<!--end of funcsynopsisinfo.element-->]]>
+
+<!ENTITY % funcsynopsisinfo.attlist "INCLUDE">
+<![%funcsynopsisinfo.attlist;[
+<!ATTLIST funcsynopsisinfo
+		%linespecific.attrib;
+		%common.attrib;
+		%funcsynopsisinfo.role.attrib;
+		%local.funcsynopsisinfo.attrib;
+>
+<!--end of funcsynopsisinfo.attlist-->]]>
+<!--end of funcsynopsisinfo.module-->]]>
+
+<!ENTITY % funcprototype.module "INCLUDE">
+<![%funcprototype.module;[
+<!ENTITY % local.funcprototype.attrib "">
+<!ENTITY % funcprototype.role.attrib "%role.attrib;">
+
+<!ENTITY % funcprototype.element "INCLUDE">
+<![%funcprototype.element;[
+<!ELEMENT funcprototype %ho; (modifier*,
+                              funcdef,
+                              (void|varargs|(paramdef+, varargs?)),
+                              modifier*)>
+
+<!--end of funcprototype.element-->]]>
+
+<!ENTITY % funcprototype.attlist "INCLUDE">
+<![%funcprototype.attlist;[
+<!ATTLIST funcprototype
+		%common.attrib;
+		%funcprototype.role.attrib;
+		%local.funcprototype.attrib;
+>
+<!--end of funcprototype.attlist-->]]>
+<!--end of funcprototype.module-->]]>
+
+<!ENTITY % funcdef.module "INCLUDE">
+<![%funcdef.module;[
+<!ENTITY % local.funcdef.attrib "">
+<!ENTITY % funcdef.role.attrib "%role.attrib;">
+
+<!ENTITY % funcdef.element "INCLUDE">
+<![%funcdef.element;[
+<!ELEMENT funcdef %ho; (#PCDATA
+		| type
+		| replaceable
+		| function)*>
+<!--end of funcdef.element-->]]>
+
+<!ENTITY % funcdef.attlist "INCLUDE">
+<![%funcdef.attlist;[
+<!ATTLIST funcdef
+		%common.attrib;
+		%funcdef.role.attrib;
+		%local.funcdef.attrib;
+>
+<!--end of funcdef.attlist-->]]>
+<!--end of funcdef.module-->]]>
+
+<!ENTITY % void.module "INCLUDE">
+<![%void.module;[
+<!ENTITY % local.void.attrib "">
+<!ENTITY % void.role.attrib "%role.attrib;">
+
+<!ENTITY % void.element "INCLUDE">
+<![%void.element;[
+<!ELEMENT void %ho; EMPTY>
+<!--end of void.element-->]]>
+
+<!ENTITY % void.attlist "INCLUDE">
+<![%void.attlist;[
+<!ATTLIST void
+		%common.attrib;
+		%void.role.attrib;
+		%local.void.attrib;
+>
+<!--end of void.attlist-->]]>
+<!--end of void.module-->]]>
+
+<!ENTITY % varargs.module "INCLUDE">
+<![%varargs.module;[
+<!ENTITY % local.varargs.attrib "">
+<!ENTITY % varargs.role.attrib "%role.attrib;">
+
+<!ENTITY % varargs.element "INCLUDE">
+<![%varargs.element;[
+<!ELEMENT varargs %ho; EMPTY>
+<!--end of varargs.element-->]]>
+
+<!ENTITY % varargs.attlist "INCLUDE">
+<![%varargs.attlist;[
+<!ATTLIST varargs
+		%common.attrib;
+		%varargs.role.attrib;
+		%local.varargs.attrib;
+>
+<!--end of varargs.attlist-->]]>
+<!--end of varargs.module-->]]>
+
+<!-- Processing assumes that only one Parameter will appear in a
+     ParamDef, and that FuncParams will be used at most once, for
+     providing information on the "inner parameters" for parameters that
+     are pointers to functions. -->
+
+<!ENTITY % paramdef.module "INCLUDE">
+<![%paramdef.module;[
+<!ENTITY % local.paramdef.attrib "">
+<!ENTITY % paramdef.role.attrib "%role.attrib;">
+
+<!ENTITY % paramdef.element "INCLUDE">
+<![%paramdef.element;[
+<!ELEMENT paramdef %ho; (#PCDATA
+                | initializer
+		| type
+		| replaceable
+		| parameter
+		| funcparams)*>
+<!--end of paramdef.element-->]]>
+
+<!ENTITY % paramdef.attlist "INCLUDE">
+<![%paramdef.attlist;[
+<!ATTLIST paramdef
+		choice		(opt
+				|req)	#IMPLIED
+		%common.attrib;
+		%paramdef.role.attrib;
+		%local.paramdef.attrib;
+>
+<!--end of paramdef.attlist-->]]>
+<!--end of paramdef.module-->]]>
+
+<!ENTITY % funcparams.module "INCLUDE">
+<![%funcparams.module;[
+<!ENTITY % local.funcparams.attrib "">
+<!ENTITY % funcparams.role.attrib "%role.attrib;">
+
+<!ENTITY % funcparams.element "INCLUDE">
+<![%funcparams.element;[
+<!ELEMENT funcparams %ho; (%cptr.char.mix;)*>
+<!--end of funcparams.element-->]]>
+
+<!ENTITY % funcparams.attlist "INCLUDE">
+<![%funcparams.attlist;[
+<!ATTLIST funcparams
+		%common.attrib;
+		%funcparams.role.attrib;
+		%local.funcparams.attrib;
+>
+<!--end of funcparams.attlist-->]]>
+<!--end of funcparams.module-->]]>
+
+<!-- LineAnnotation (defined in the Inlines section, below)-->
+<!-- Replaceable (defined in the Inlines section, below)-->
+<!-- Function (defined in the Inlines section, below)-->
+<!-- Parameter (defined in the Inlines section, below)-->
+<!--end of funcsynopsis.content.module-->]]>
+
+<!-- ClassSynopsis ..................... -->
+
+<!ENTITY % classsynopsis.content.module "INCLUDE">
+<![%classsynopsis.content.module;[
+
+<!ENTITY % classsynopsis.module "INCLUDE">
+<![%classsynopsis.module;[
+<!ENTITY % local.classsynopsis.attrib "">
+<!ENTITY % classsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % classsynopsis.element "INCLUDE">
+<![%classsynopsis.element;[
+<!ELEMENT classsynopsis %ho; ((ooclass|oointerface|ooexception)+,
+                         (classsynopsisinfo
+                          |fieldsynopsis|%method.synop.class;)*)>
+<!--end of classsynopsis.element-->]]>
+
+<!ENTITY % classsynopsis.attlist "INCLUDE">
+<![%classsynopsis.attlist;[
+<!ATTLIST classsynopsis
+	language	CDATA	#IMPLIED
+	class	(class|interface)	"class"
+	%common.attrib;
+	%classsynopsis.role.attrib;
+	%local.classsynopsis.attrib;
+>
+<!--end of classsynopsis.attlist-->]]>
+<!--end of classsynopsis.module-->]]>
+
+<!ENTITY % classsynopsisinfo.module "INCLUDE">
+<![ %classsynopsisinfo.module; [
+<!ENTITY % local.classsynopsisinfo.attrib "">
+<!ENTITY % classsynopsisinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % classsynopsisinfo.element "INCLUDE">
+<![ %classsynopsisinfo.element; [
+<!ELEMENT classsynopsisinfo %ho; (%cptr.char.mix;|textobject|lineannotation)*>
+<!--end of classsynopsisinfo.element-->]]>
+
+<!ENTITY % classsynopsisinfo.attlist "INCLUDE">
+<![ %classsynopsisinfo.attlist; [
+<!ATTLIST classsynopsisinfo
+		%linespecific.attrib;
+		%common.attrib;
+		%classsynopsisinfo.role.attrib;
+		%local.classsynopsisinfo.attrib;
+>
+<!--end of classsynopsisinfo.attlist-->]]>
+<!--end of classsynopsisinfo.module-->]]>
+
+<!ENTITY % ooclass.module "INCLUDE">
+<![%ooclass.module;[
+<!ENTITY % local.ooclass.attrib "">
+<!ENTITY % ooclass.role.attrib "%role.attrib;">
+
+<!ENTITY % ooclass.element "INCLUDE">
+<![%ooclass.element;[
+<!ELEMENT ooclass %ho; ((modifier|package)*, classname)>
+<!--end of ooclass.element-->]]>
+
+<!ENTITY % ooclass.attlist "INCLUDE">
+<![%ooclass.attlist;[
+<!ATTLIST ooclass
+	%common.attrib;
+	%ooclass.role.attrib;
+	%local.ooclass.attrib;
+>
+<!--end of ooclass.attlist-->]]>
+<!--end of ooclass.module-->]]>
+
+<!ENTITY % oointerface.module "INCLUDE">
+<![%oointerface.module;[
+<!ENTITY % local.oointerface.attrib "">
+<!ENTITY % oointerface.role.attrib "%role.attrib;">
+
+<!ENTITY % oointerface.element "INCLUDE">
+<![%oointerface.element;[
+<!ELEMENT oointerface %ho; ((modifier|package)*, interfacename)>
+<!--end of oointerface.element-->]]>
+
+<!ENTITY % oointerface.attlist "INCLUDE">
+<![%oointerface.attlist;[
+<!ATTLIST oointerface
+	%common.attrib;
+	%oointerface.role.attrib;
+	%local.oointerface.attrib;
+>
+<!--end of oointerface.attlist-->]]>
+<!--end of oointerface.module-->]]>
+
+<!ENTITY % ooexception.module "INCLUDE">
+<![%ooexception.module;[
+<!ENTITY % local.ooexception.attrib "">
+<!ENTITY % ooexception.role.attrib "%role.attrib;">
+
+<!ENTITY % ooexception.element "INCLUDE">
+<![%ooexception.element;[
+<!ELEMENT ooexception %ho; ((modifier|package)*, exceptionname)>
+<!--end of ooexception.element-->]]>
+
+<!ENTITY % ooexception.attlist "INCLUDE">
+<![%ooexception.attlist;[
+<!ATTLIST ooexception
+	%common.attrib;
+	%ooexception.role.attrib;
+	%local.ooexception.attrib;
+>
+<!--end of ooexception.attlist-->]]>
+<!--end of ooexception.module-->]]>
+
+<!ENTITY % modifier.module "INCLUDE">
+<![%modifier.module;[
+<!ENTITY % local.modifier.attrib "">
+<!ENTITY % modifier.role.attrib "%role.attrib;">
+
+<!ENTITY % modifier.element "INCLUDE">
+<![%modifier.element;[
+<!ELEMENT modifier %ho; (%smallcptr.char.mix;)*>
+<!--end of modifier.element-->]]>
+
+<!ENTITY % modifier.attlist "INCLUDE">
+<![%modifier.attlist;[
+<!ATTLIST modifier
+	%common.attrib;
+	%modifier.role.attrib;
+	%local.modifier.attrib;
+>
+<!--end of modifier.attlist-->]]>
+<!--end of modifier.module-->]]>
+
+<!ENTITY % interfacename.module "INCLUDE">
+<![%interfacename.module;[
+<!ENTITY % local.interfacename.attrib "">
+<!ENTITY % interfacename.role.attrib "%role.attrib;">
+
+<!ENTITY % interfacename.element "INCLUDE">
+<![%interfacename.element;[
+<!ELEMENT interfacename %ho; (%cptr.char.mix;)*>
+<!--end of interfacename.element-->]]>
+
+<!ENTITY % interfacename.attlist "INCLUDE">
+<![%interfacename.attlist;[
+<!ATTLIST interfacename
+	%common.attrib;
+	%interfacename.role.attrib;
+	%local.interfacename.attrib;
+>
+<!--end of interfacename.attlist-->]]>
+<!--end of interfacename.module-->]]>
+
+<!ENTITY % exceptionname.module "INCLUDE">
+<![%exceptionname.module;[
+<!ENTITY % local.exceptionname.attrib "">
+<!ENTITY % exceptionname.role.attrib "%role.attrib;">
+
+<!ENTITY % exceptionname.element "INCLUDE">
+<![%exceptionname.element;[
+<!ELEMENT exceptionname %ho; (%smallcptr.char.mix;)*>
+<!--end of exceptionname.element-->]]>
+
+<!ENTITY % exceptionname.attlist "INCLUDE">
+<![%exceptionname.attlist;[
+<!ATTLIST exceptionname
+	%common.attrib;
+	%exceptionname.role.attrib;
+	%local.exceptionname.attrib;
+>
+<!--end of exceptionname.attlist-->]]>
+<!--end of exceptionname.module-->]]>
+
+<!ENTITY % fieldsynopsis.module "INCLUDE">
+<![%fieldsynopsis.module;[
+<!ENTITY % local.fieldsynopsis.attrib "">
+<!ENTITY % fieldsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % fieldsynopsis.element "INCLUDE">
+<![%fieldsynopsis.element;[
+<!ELEMENT fieldsynopsis %ho; (modifier*, type?, varname, initializer?)>
+<!--end of fieldsynopsis.element-->]]>
+
+<!ENTITY % fieldsynopsis.attlist "INCLUDE">
+<![%fieldsynopsis.attlist;[
+<!ATTLIST fieldsynopsis
+	language	CDATA	#IMPLIED
+	%common.attrib;
+	%fieldsynopsis.role.attrib;
+	%local.fieldsynopsis.attrib;
+>
+<!--end of fieldsynopsis.attlist-->]]>
+<!--end of fieldsynopsis.module-->]]>
+
+<!ENTITY % initializer.module "INCLUDE">
+<![%initializer.module;[
+<!ENTITY % local.initializer.attrib "">
+<!ENTITY % initializer.role.attrib "%role.attrib;">
+
+<!ENTITY % initializer.element "INCLUDE">
+<![%initializer.element;[
+<!ELEMENT initializer %ho; (%smallcptr.char.mix;)*>
+<!--end of initializer.element-->]]>
+
+<!ENTITY % initializer.attlist "INCLUDE">
+<![%initializer.attlist;[
+<!ATTLIST initializer
+	%common.attrib;
+	%initializer.role.attrib;
+	%local.initializer.attrib;
+>
+<!--end of initializer.attlist-->]]>
+<!--end of initializer.module-->]]>
+
+<!ENTITY % constructorsynopsis.module "INCLUDE">
+<![%constructorsynopsis.module;[
+<!ENTITY % local.constructorsynopsis.attrib "">
+<!ENTITY % constructorsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % constructorsynopsis.element "INCLUDE">
+<![%constructorsynopsis.element;[
+<!ELEMENT constructorsynopsis %ho; (modifier*,
+                               methodname?,
+                               (methodparam+|void?),
+                               exceptionname*)>
+<!--end of constructorsynopsis.element-->]]>
+
+<!ENTITY % constructorsynopsis.attlist "INCLUDE">
+<![%constructorsynopsis.attlist;[
+<!ATTLIST constructorsynopsis
+	language	CDATA	#IMPLIED
+	%common.attrib;
+	%constructorsynopsis.role.attrib;
+	%local.constructorsynopsis.attrib;
+>
+<!--end of constructorsynopsis.attlist-->]]>
+<!--end of constructorsynopsis.module-->]]>
+
+<!ENTITY % destructorsynopsis.module "INCLUDE">
+<![%destructorsynopsis.module;[
+<!ENTITY % local.destructorsynopsis.attrib "">
+<!ENTITY % destructorsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % destructorsynopsis.element "INCLUDE">
+<![%destructorsynopsis.element;[
+<!ELEMENT destructorsynopsis %ho; (modifier*,
+                              methodname?,
+                              (methodparam+|void?),
+                              exceptionname*)>
+<!--end of destructorsynopsis.element-->]]>
+
+<!ENTITY % destructorsynopsis.attlist "INCLUDE">
+<![%destructorsynopsis.attlist;[
+<!ATTLIST destructorsynopsis
+	language	CDATA	#IMPLIED
+	%common.attrib;
+	%destructorsynopsis.role.attrib;
+	%local.destructorsynopsis.attrib;
+>
+<!--end of destructorsynopsis.attlist-->]]>
+<!--end of destructorsynopsis.module-->]]>
+
+<!ENTITY % methodsynopsis.module "INCLUDE">
+<![%methodsynopsis.module;[
+<!ENTITY % local.methodsynopsis.attrib "">
+<!ENTITY % methodsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % methodsynopsis.element "INCLUDE">
+<![%methodsynopsis.element;[
+<!ELEMENT methodsynopsis %ho; (modifier*,
+                          (type|void)?,
+                          methodname,
+                          (methodparam+|void?),
+                          exceptionname*,
+                          modifier*)>
+<!--end of methodsynopsis.element-->]]>
+
+<!ENTITY % methodsynopsis.attlist "INCLUDE">
+<![%methodsynopsis.attlist;[
+<!ATTLIST methodsynopsis
+	language	CDATA	#IMPLIED
+	%common.attrib;
+	%methodsynopsis.role.attrib;
+	%local.methodsynopsis.attrib;
+>
+<!--end of methodsynopsis.attlist-->]]>
+<!--end of methodsynopsis.module-->]]>
+
+<!ENTITY % methodname.module "INCLUDE">
+<![%methodname.module;[
+<!ENTITY % local.methodname.attrib "">
+<!ENTITY % methodname.role.attrib "%role.attrib;">
+
+<!ENTITY % methodname.element "INCLUDE">
+<![%methodname.element;[
+<!ELEMENT methodname %ho; (%smallcptr.char.mix;)*>
+<!--end of methodname.element-->]]>
+
+<!ENTITY % methodname.attlist "INCLUDE">
+<![%methodname.attlist;[
+<!ATTLIST methodname
+	%common.attrib;
+	%methodname.role.attrib;
+	%local.methodname.attrib;
+>
+<!--end of methodname.attlist-->]]>
+<!--end of methodname.module-->]]>
+
+<!ENTITY % methodparam.module "INCLUDE">
+<![%methodparam.module;[
+<!ENTITY % local.methodparam.attrib "">
+<!ENTITY % methodparam.role.attrib "%role.attrib;">
+
+<!ENTITY % methodparam.element "INCLUDE">
+<![%methodparam.element;[
+<!ELEMENT methodparam %ho; (modifier*,
+                       type?,
+                       ((parameter,initializer?)|funcparams),
+                       modifier*)>
+<!--end of methodparam.element-->]]>
+
+<!ENTITY % methodparam.attlist "INCLUDE">
+<![%methodparam.attlist;[
+<!ATTLIST methodparam
+	choice		(opt
+			|req
+			|plain)		"req"
+	rep		(norepeat
+			|repeat)	"norepeat"
+	%common.attrib;
+	%methodparam.role.attrib;
+	%local.methodparam.attrib;
+>
+<!--end of methodparam.attlist-->]]>
+<!--end of methodparam.module-->]]>
+<!--end of classsynopsis.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Document information entities and elements ........................... -->
+
+<!-- The document information elements include some elements that are
+     currently used only in the document hierarchy module. They are
+     defined here so that they will be available for use in customized
+     document hierarchies. -->
+
+<!-- .................................. -->
+
+<!ENTITY % docinfo.content.module "INCLUDE">
+<![%docinfo.content.module;[
+
+<!-- Ackno ............................ -->
+
+<!ENTITY % ackno.module "INCLUDE">
+<![%ackno.module;[
+<!ENTITY % local.ackno.attrib "">
+<!ENTITY % ackno.role.attrib "%role.attrib;">
+
+<!ENTITY % ackno.element "INCLUDE">
+<![%ackno.element;[
+<!ELEMENT ackno %ho; (%docinfo.char.mix;)*>
+<!--end of ackno.element-->]]>
+
+<!ENTITY % ackno.attlist "INCLUDE">
+<![%ackno.attlist;[
+<!ATTLIST ackno
+		%common.attrib;
+		%ackno.role.attrib;
+		%local.ackno.attrib;
+>
+<!--end of ackno.attlist-->]]>
+<!--end of ackno.module-->]]>
+
+<!-- Address .......................... -->
+
+<!ENTITY % address.content.module "INCLUDE">
+<![%address.content.module;[
+<!ENTITY % address.module "INCLUDE">
+<![%address.module;[
+<!ENTITY % local.address.attrib "">
+<!ENTITY % address.role.attrib "%role.attrib;">
+
+<!ENTITY % address.element "INCLUDE">
+<![%address.element;[
+<!ELEMENT address %ho; (#PCDATA|personname|%person.ident.mix;
+		|street|pob|postcode|city|state|country|phone
+		|fax|email|otheraddr)*>
+<!--end of address.element-->]]>
+
+<!ENTITY % address.attlist "INCLUDE">
+<![%address.attlist;[
+<!ATTLIST address
+		%linespecific.attrib;
+		%common.attrib;
+		%address.role.attrib;
+		%local.address.attrib;
+>
+<!--end of address.attlist-->]]>
+<!--end of address.module-->]]>
+
+  <!ENTITY % street.module "INCLUDE">
+  <![%street.module;[
+ <!ENTITY % local.street.attrib "">
+  <!ENTITY % street.role.attrib "%role.attrib;">
+
+<!ENTITY % street.element "INCLUDE">
+<![%street.element;[
+<!ELEMENT street %ho; (%docinfo.char.mix;)*>
+<!--end of street.element-->]]>
+
+<!ENTITY % street.attlist "INCLUDE">
+<![%street.attlist;[
+<!ATTLIST street
+		%common.attrib;
+		%street.role.attrib;
+		%local.street.attrib;
+>
+<!--end of street.attlist-->]]>
+  <!--end of street.module-->]]>
+
+  <!ENTITY % pob.module "INCLUDE">
+  <![%pob.module;[
+  <!ENTITY % local.pob.attrib "">
+  <!ENTITY % pob.role.attrib "%role.attrib;">
+
+<!ENTITY % pob.element "INCLUDE">
+<![%pob.element;[
+<!ELEMENT pob %ho; (%docinfo.char.mix;)*>
+<!--end of pob.element-->]]>
+
+<!ENTITY % pob.attlist "INCLUDE">
+<![%pob.attlist;[
+<!ATTLIST pob
+		%common.attrib;
+		%pob.role.attrib;
+		%local.pob.attrib;
+>
+<!--end of pob.attlist-->]]>
+  <!--end of pob.module-->]]>
+
+  <!ENTITY % postcode.module "INCLUDE">
+  <![%postcode.module;[
+  <!ENTITY % local.postcode.attrib "">
+  <!ENTITY % postcode.role.attrib "%role.attrib;">
+
+<!ENTITY % postcode.element "INCLUDE">
+<![%postcode.element;[
+<!ELEMENT postcode %ho; (%docinfo.char.mix;)*>
+<!--end of postcode.element-->]]>
+
+<!ENTITY % postcode.attlist "INCLUDE">
+<![%postcode.attlist;[
+<!ATTLIST postcode
+		%common.attrib;
+		%postcode.role.attrib;
+		%local.postcode.attrib;
+>
+<!--end of postcode.attlist-->]]>
+  <!--end of postcode.module-->]]>
+
+  <!ENTITY % city.module "INCLUDE">
+  <![%city.module;[
+  <!ENTITY % local.city.attrib "">
+  <!ENTITY % city.role.attrib "%role.attrib;">
+
+<!ENTITY % city.element "INCLUDE">
+<![%city.element;[
+<!ELEMENT city %ho; (%docinfo.char.mix;)*>
+<!--end of city.element-->]]>
+
+<!ENTITY % city.attlist "INCLUDE">
+<![%city.attlist;[
+<!ATTLIST city
+		%common.attrib;
+		%city.role.attrib;
+		%local.city.attrib;
+>
+<!--end of city.attlist-->]]>
+  <!--end of city.module-->]]>
+
+  <!ENTITY % state.module "INCLUDE">
+  <![%state.module;[
+  <!ENTITY % local.state.attrib "">
+  <!ENTITY % state.role.attrib "%role.attrib;">
+
+<!ENTITY % state.element "INCLUDE">
+<![%state.element;[
+<!ELEMENT state %ho; (%docinfo.char.mix;)*>
+<!--end of state.element-->]]>
+
+<!ENTITY % state.attlist "INCLUDE">
+<![%state.attlist;[
+<!ATTLIST state
+		%common.attrib;
+		%state.role.attrib;
+		%local.state.attrib;
+>
+<!--end of state.attlist-->]]>
+  <!--end of state.module-->]]>
+
+  <!ENTITY % country.module "INCLUDE">
+  <![%country.module;[
+  <!ENTITY % local.country.attrib "">
+  <!ENTITY % country.role.attrib "%role.attrib;">
+
+<!ENTITY % country.element "INCLUDE">
+<![%country.element;[
+<!ELEMENT country %ho; (%docinfo.char.mix;)*>
+<!--end of country.element-->]]>
+
+<!ENTITY % country.attlist "INCLUDE">
+<![%country.attlist;[
+<!ATTLIST country
+		%common.attrib;
+		%country.role.attrib;
+		%local.country.attrib;
+>
+<!--end of country.attlist-->]]>
+  <!--end of country.module-->]]>
+
+  <!ENTITY % phone.module "INCLUDE">
+  <![%phone.module;[
+  <!ENTITY % local.phone.attrib "">
+  <!ENTITY % phone.role.attrib "%role.attrib;">
+
+<!ENTITY % phone.element "INCLUDE">
+<![%phone.element;[
+<!ELEMENT phone %ho; (%docinfo.char.mix;)*>
+<!--end of phone.element-->]]>
+
+<!ENTITY % phone.attlist "INCLUDE">
+<![%phone.attlist;[
+<!ATTLIST phone
+		%common.attrib;
+		%phone.role.attrib;
+		%local.phone.attrib;
+>
+<!--end of phone.attlist-->]]>
+  <!--end of phone.module-->]]>
+
+  <!ENTITY % fax.module "INCLUDE">
+  <![%fax.module;[
+  <!ENTITY % local.fax.attrib "">
+  <!ENTITY % fax.role.attrib "%role.attrib;">
+
+<!ENTITY % fax.element "INCLUDE">
+<![%fax.element;[
+<!ELEMENT fax %ho; (%docinfo.char.mix;)*>
+<!--end of fax.element-->]]>
+
+<!ENTITY % fax.attlist "INCLUDE">
+<![%fax.attlist;[
+<!ATTLIST fax
+		%common.attrib;
+		%fax.role.attrib;
+		%local.fax.attrib;
+>
+<!--end of fax.attlist-->]]>
+  <!--end of fax.module-->]]>
+
+  <!-- Email (defined in the Inlines section, below)-->
+
+  <!ENTITY % otheraddr.module "INCLUDE">
+  <![%otheraddr.module;[
+  <!ENTITY % local.otheraddr.attrib "">
+  <!ENTITY % otheraddr.role.attrib "%role.attrib;">
+
+<!ENTITY % otheraddr.element "INCLUDE">
+<![%otheraddr.element;[
+<!ELEMENT otheraddr %ho; (%docinfo.char.mix;)*>
+<!--end of otheraddr.element-->]]>
+
+<!ENTITY % otheraddr.attlist "INCLUDE">
+<![%otheraddr.attlist;[
+<!ATTLIST otheraddr
+		%common.attrib;
+		%otheraddr.role.attrib;
+		%local.otheraddr.attrib;
+>
+<!--end of otheraddr.attlist-->]]>
+  <!--end of otheraddr.module-->]]>
+<!--end of address.content.module-->]]>
+
+<!-- Affiliation ...................... -->
+
+<!ENTITY % affiliation.content.module "INCLUDE">
+<![%affiliation.content.module;[
+<!ENTITY % affiliation.module "INCLUDE">
+<![%affiliation.module;[
+<!ENTITY % local.affiliation.attrib "">
+<!ENTITY % affiliation.role.attrib "%role.attrib;">
+
+<!ENTITY % affiliation.element "INCLUDE">
+<![%affiliation.element;[
+<!ELEMENT affiliation %ho; (shortaffil?, jobtitle*, orgname?, orgdiv*,
+		address*)>
+<!--end of affiliation.element-->]]>
+
+<!ENTITY % affiliation.attlist "INCLUDE">
+<![%affiliation.attlist;[
+<!ATTLIST affiliation
+		%common.attrib;
+		%affiliation.role.attrib;
+		%local.affiliation.attrib;
+>
+<!--end of affiliation.attlist-->]]>
+<!--end of affiliation.module-->]]>
+
+  <!ENTITY % shortaffil.module "INCLUDE">
+  <![%shortaffil.module;[
+  <!ENTITY % local.shortaffil.attrib "">
+  <!ENTITY % shortaffil.role.attrib "%role.attrib;">
+
+<!ENTITY % shortaffil.element "INCLUDE">
+<![%shortaffil.element;[
+<!ELEMENT shortaffil %ho; (%docinfo.char.mix;)*>
+<!--end of shortaffil.element-->]]>
+
+<!ENTITY % shortaffil.attlist "INCLUDE">
+<![%shortaffil.attlist;[
+<!ATTLIST shortaffil
+		%common.attrib;
+		%shortaffil.role.attrib;
+		%local.shortaffil.attrib;
+>
+<!--end of shortaffil.attlist-->]]>
+  <!--end of shortaffil.module-->]]>
+
+  <!ENTITY % jobtitle.module "INCLUDE">
+  <![%jobtitle.module;[
+  <!ENTITY % local.jobtitle.attrib "">
+  <!ENTITY % jobtitle.role.attrib "%role.attrib;">
+
+<!ENTITY % jobtitle.element "INCLUDE">
+<![%jobtitle.element;[
+<!ELEMENT jobtitle %ho; (%docinfo.char.mix;)*>
+<!--end of jobtitle.element-->]]>
+
+<!ENTITY % jobtitle.attlist "INCLUDE">
+<![%jobtitle.attlist;[
+<!ATTLIST jobtitle
+		%common.attrib;
+		%jobtitle.role.attrib;
+		%local.jobtitle.attrib;
+>
+<!--end of jobtitle.attlist-->]]>
+  <!--end of jobtitle.module-->]]>
+
+  <!-- OrgName (defined elsewhere in this section)-->
+
+  <!ENTITY % orgdiv.module "INCLUDE">
+  <![%orgdiv.module;[
+  <!ENTITY % local.orgdiv.attrib "">
+  <!ENTITY % orgdiv.role.attrib "%role.attrib;">
+
+<!ENTITY % orgdiv.element "INCLUDE">
+<![%orgdiv.element;[
+<!ELEMENT orgdiv %ho; (%docinfo.char.mix;)*>
+<!--end of orgdiv.element-->]]>
+
+<!ENTITY % orgdiv.attlist "INCLUDE">
+<![%orgdiv.attlist;[
+<!ATTLIST orgdiv
+		%common.attrib;
+		%orgdiv.role.attrib;
+		%local.orgdiv.attrib;
+>
+<!--end of orgdiv.attlist-->]]>
+  <!--end of orgdiv.module-->]]>
+
+  <!-- Address (defined elsewhere in this section)-->
+<!--end of affiliation.content.module-->]]>
+
+<!-- ArtPageNums ...................... -->
+
+<!ENTITY % artpagenums.module "INCLUDE">
+<![%artpagenums.module;[
+<!ENTITY % local.artpagenums.attrib "">
+<!ENTITY % artpagenums.role.attrib "%role.attrib;">
+
+<!ENTITY % artpagenums.element "INCLUDE">
+<![%artpagenums.element;[
+<!ELEMENT artpagenums %ho; (%docinfo.char.mix;)*>
+<!--end of artpagenums.element-->]]>
+
+<!ENTITY % artpagenums.attlist "INCLUDE">
+<![%artpagenums.attlist;[
+<!ATTLIST artpagenums
+		%common.attrib;
+		%artpagenums.role.attrib;
+		%local.artpagenums.attrib;
+>
+<!--end of artpagenums.attlist-->]]>
+<!--end of artpagenums.module-->]]>
+
+<!-- PersonName -->
+
+<!ENTITY % personname.module "INCLUDE">
+<![%personname.module;[
+<!ENTITY % local.personname.attrib "">
+<!ENTITY % personname.role.attrib "%role.attrib;">
+
+<!ENTITY % personname.element "INCLUDE">
+<![%personname.element;[
+<!ELEMENT personname %ho; ((honorific|firstname|surname|lineage|othername)+)>
+<!--end of personname.element-->]]>
+
+<!ENTITY % personname.attlist "INCLUDE">
+<![%personname.attlist;[
+<!ATTLIST personname
+		%common.attrib;
+		%personname.role.attrib;
+		%local.personname.attrib;
+>
+<!--end of personname.attlist-->]]>
+<!--end of personname.module-->]]>
+
+<!-- Author ........................... -->
+
+<!ENTITY % author.module "INCLUDE">
+<![%author.module;[
+<!ENTITY % local.author.attrib "">
+<!ENTITY % author.role.attrib "%role.attrib;">
+
+<!ENTITY % author.element "INCLUDE">
+<![%author.element;[
+<!ELEMENT author %ho; ((personname|(%person.ident.mix;)+),(personblurb|email|address)*)>
+<!--end of author.element-->]]>
+
+<!ENTITY % author.attlist "INCLUDE">
+<![%author.attlist;[
+<!ATTLIST author
+		%common.attrib;
+		%author.role.attrib;
+		%local.author.attrib;
+>
+<!--end of author.attlist-->]]>
+<!--(see "Personal identity elements" for %person.ident.mix;)-->
+<!--end of author.module-->]]>
+
+<!-- AuthorGroup ...................... -->
+
+<!ENTITY % authorgroup.content.module "INCLUDE">
+<![%authorgroup.content.module;[
+<!ENTITY % authorgroup.module "INCLUDE">
+<![%authorgroup.module;[
+<!ENTITY % local.authorgroup.attrib "">
+<!ENTITY % authorgroup.role.attrib "%role.attrib;">
+
+<!ENTITY % authorgroup.element "INCLUDE">
+<![%authorgroup.element;[
+<!ELEMENT authorgroup %ho; ((author|editor|collab|corpauthor|corpcredit|othercredit)+)>
+<!--end of authorgroup.element-->]]>
+
+<!ENTITY % authorgroup.attlist "INCLUDE">
+<![%authorgroup.attlist;[
+<!ATTLIST authorgroup
+		%common.attrib;
+		%authorgroup.role.attrib;
+		%local.authorgroup.attrib;
+>
+<!--end of authorgroup.attlist-->]]>
+<!--end of authorgroup.module-->]]>
+
+  <!-- Author (defined elsewhere in this section)-->
+  <!-- Editor (defined elsewhere in this section)-->
+
+  <!ENTITY % collab.content.module "INCLUDE">
+  <![%collab.content.module;[
+  <!ENTITY % collab.module "INCLUDE">
+  <![%collab.module;[
+  <!ENTITY % local.collab.attrib "">
+  <!ENTITY % collab.role.attrib "%role.attrib;">
+
+<!ENTITY % collab.element "INCLUDE">
+<![%collab.element;[
+<!ELEMENT collab %ho; (collabname, affiliation*)>
+<!--end of collab.element-->]]>
+
+<!ENTITY % collab.attlist "INCLUDE">
+<![%collab.attlist;[
+<!ATTLIST collab
+		%common.attrib;
+		%collab.role.attrib;
+		%local.collab.attrib;
+>
+<!--end of collab.attlist-->]]>
+  <!--end of collab.module-->]]>
+
+    <!ENTITY % collabname.module "INCLUDE">
+  <![%collabname.module;[
+  <!ENTITY % local.collabname.attrib "">
+  <!ENTITY % collabname.role.attrib "%role.attrib;">
+
+<!ENTITY % collabname.element "INCLUDE">
+<![%collabname.element;[
+<!ELEMENT collabname %ho; (%docinfo.char.mix;)*>
+<!--end of collabname.element-->]]>
+
+<!ENTITY % collabname.attlist "INCLUDE">
+<![%collabname.attlist;[
+<!ATTLIST collabname
+		%common.attrib;
+		%collabname.role.attrib;
+		%local.collabname.attrib;
+>
+<!--end of collabname.attlist-->]]>
+    <!--end of collabname.module-->]]>
+
+    <!-- Affiliation (defined elsewhere in this section)-->
+  <!--end of collab.content.module-->]]>
+
+  <!-- CorpAuthor (defined elsewhere in this section)-->
+  <!-- OtherCredit (defined elsewhere in this section)-->
+
+<!--end of authorgroup.content.module-->]]>
+
+<!-- AuthorInitials ................... -->
+
+<!ENTITY % authorinitials.module "INCLUDE">
+<![%authorinitials.module;[
+<!ENTITY % local.authorinitials.attrib "">
+<!ENTITY % authorinitials.role.attrib "%role.attrib;">
+
+<!ENTITY % authorinitials.element "INCLUDE">
+<![%authorinitials.element;[
+<!ELEMENT authorinitials %ho; (%docinfo.char.mix;)*>
+<!--end of authorinitials.element-->]]>
+
+<!ENTITY % authorinitials.attlist "INCLUDE">
+<![%authorinitials.attlist;[
+<!ATTLIST authorinitials
+		%common.attrib;
+		%authorinitials.role.attrib;
+		%local.authorinitials.attrib;
+>
+<!--end of authorinitials.attlist-->]]>
+<!--end of authorinitials.module-->]]>
+
+<!-- ConfGroup ........................ -->
+
+<!ENTITY % confgroup.content.module "INCLUDE">
+<![%confgroup.content.module;[
+<!ENTITY % confgroup.module "INCLUDE">
+<![%confgroup.module;[
+<!ENTITY % local.confgroup.attrib "">
+<!ENTITY % confgroup.role.attrib "%role.attrib;">
+
+<!ENTITY % confgroup.element "INCLUDE">
+<![%confgroup.element;[
+<!ELEMENT confgroup %ho; ((confdates|conftitle|confnum|address|confsponsor)*)>
+<!--end of confgroup.element-->]]>
+
+<!ENTITY % confgroup.attlist "INCLUDE">
+<![%confgroup.attlist;[
+<!ATTLIST confgroup
+		%common.attrib;
+		%confgroup.role.attrib;
+		%local.confgroup.attrib;
+>
+<!--end of confgroup.attlist-->]]>
+<!--end of confgroup.module-->]]>
+
+  <!ENTITY % confdates.module "INCLUDE">
+  <![%confdates.module;[
+  <!ENTITY % local.confdates.attrib "">
+  <!ENTITY % confdates.role.attrib "%role.attrib;">
+
+<!ENTITY % confdates.element "INCLUDE">
+<![%confdates.element;[
+<!ELEMENT confdates %ho; (%docinfo.char.mix;)*>
+<!--end of confdates.element-->]]>
+
+<!ENTITY % confdates.attlist "INCLUDE">
+<![%confdates.attlist;[
+<!ATTLIST confdates
+		%common.attrib;
+		%confdates.role.attrib;
+		%local.confdates.attrib;
+>
+<!--end of confdates.attlist-->]]>
+  <!--end of confdates.module-->]]>
+
+  <!ENTITY % conftitle.module "INCLUDE">
+  <![%conftitle.module;[
+  <!ENTITY % local.conftitle.attrib "">
+  <!ENTITY % conftitle.role.attrib "%role.attrib;">
+
+<!ENTITY % conftitle.element "INCLUDE">
+<![%conftitle.element;[
+<!ELEMENT conftitle %ho; (%docinfo.char.mix;)*>
+<!--end of conftitle.element-->]]>
+
+<!ENTITY % conftitle.attlist "INCLUDE">
+<![%conftitle.attlist;[
+<!ATTLIST conftitle
+		%common.attrib;
+		%conftitle.role.attrib;
+		%local.conftitle.attrib;
+>
+<!--end of conftitle.attlist-->]]>
+  <!--end of conftitle.module-->]]>
+
+  <!ENTITY % confnum.module "INCLUDE">
+  <![%confnum.module;[
+  <!ENTITY % local.confnum.attrib "">
+  <!ENTITY % confnum.role.attrib "%role.attrib;">
+
+<!ENTITY % confnum.element "INCLUDE">
+<![%confnum.element;[
+<!ELEMENT confnum %ho; (%docinfo.char.mix;)*>
+<!--end of confnum.element-->]]>
+
+<!ENTITY % confnum.attlist "INCLUDE">
+<![%confnum.attlist;[
+<!ATTLIST confnum
+		%common.attrib;
+		%confnum.role.attrib;
+		%local.confnum.attrib;
+>
+<!--end of confnum.attlist-->]]>
+  <!--end of confnum.module-->]]>
+
+  <!-- Address (defined elsewhere in this section)-->
+
+  <!ENTITY % confsponsor.module "INCLUDE">
+  <![%confsponsor.module;[
+  <!ENTITY % local.confsponsor.attrib "">
+  <!ENTITY % confsponsor.role.attrib "%role.attrib;">
+
+<!ENTITY % confsponsor.element "INCLUDE">
+<![%confsponsor.element;[
+<!ELEMENT confsponsor %ho; (%docinfo.char.mix;)*>
+<!--end of confsponsor.element-->]]>
+
+<!ENTITY % confsponsor.attlist "INCLUDE">
+<![%confsponsor.attlist;[
+<!ATTLIST confsponsor
+		%common.attrib;
+		%confsponsor.role.attrib;
+		%local.confsponsor.attrib;
+>
+<!--end of confsponsor.attlist-->]]>
+  <!--end of confsponsor.module-->]]>
+<!--end of confgroup.content.module-->]]>
+
+<!-- ContractNum ...................... -->
+
+<!ENTITY % contractnum.module "INCLUDE">
+<![%contractnum.module;[
+<!ENTITY % local.contractnum.attrib "">
+<!ENTITY % contractnum.role.attrib "%role.attrib;">
+
+<!ENTITY % contractnum.element "INCLUDE">
+<![%contractnum.element;[
+<!ELEMENT contractnum %ho; (%docinfo.char.mix;)*>
+<!--end of contractnum.element-->]]>
+
+<!ENTITY % contractnum.attlist "INCLUDE">
+<![%contractnum.attlist;[
+<!ATTLIST contractnum
+		%common.attrib;
+		%contractnum.role.attrib;
+		%local.contractnum.attrib;
+>
+<!--end of contractnum.attlist-->]]>
+<!--end of contractnum.module-->]]>
+
+<!-- ContractSponsor .................. -->
+
+<!ENTITY % contractsponsor.module "INCLUDE">
+<![%contractsponsor.module;[
+<!ENTITY % local.contractsponsor.attrib "">
+<!ENTITY % contractsponsor.role.attrib "%role.attrib;">
+
+<!ENTITY % contractsponsor.element "INCLUDE">
+<![%contractsponsor.element;[
+<!ELEMENT contractsponsor %ho; (%docinfo.char.mix;)*>
+<!--end of contractsponsor.element-->]]>
+
+<!ENTITY % contractsponsor.attlist "INCLUDE">
+<![%contractsponsor.attlist;[
+<!ATTLIST contractsponsor
+		%common.attrib;
+		%contractsponsor.role.attrib;
+		%local.contractsponsor.attrib;
+>
+<!--end of contractsponsor.attlist-->]]>
+<!--end of contractsponsor.module-->]]>
+
+<!-- Copyright ........................ -->
+
+<!ENTITY % copyright.content.module "INCLUDE">
+<![%copyright.content.module;[
+<!ENTITY % copyright.module "INCLUDE">
+<![%copyright.module;[
+<!ENTITY % local.copyright.attrib "">
+<!ENTITY % copyright.role.attrib "%role.attrib;">
+
+<!ENTITY % copyright.element "INCLUDE">
+<![%copyright.element;[
+<!ELEMENT copyright %ho; (year+, holder*)>
+<!--end of copyright.element-->]]>
+
+<!ENTITY % copyright.attlist "INCLUDE">
+<![%copyright.attlist;[
+<!ATTLIST copyright
+		%common.attrib;
+		%copyright.role.attrib;
+		%local.copyright.attrib;
+>
+<!--end of copyright.attlist-->]]>
+<!--end of copyright.module-->]]>
+
+  <!ENTITY % year.module "INCLUDE">
+  <![%year.module;[
+  <!ENTITY % local.year.attrib "">
+  <!ENTITY % year.role.attrib "%role.attrib;">
+
+<!ENTITY % year.element "INCLUDE">
+<![%year.element;[
+<!ELEMENT year %ho; (%docinfo.char.mix;)*>
+<!--end of year.element-->]]>
+
+<!ENTITY % year.attlist "INCLUDE">
+<![%year.attlist;[
+<!ATTLIST year
+		%common.attrib;
+		%year.role.attrib;
+		%local.year.attrib;
+>
+<!--end of year.attlist-->]]>
+  <!--end of year.module-->]]>
+
+  <!ENTITY % holder.module "INCLUDE">
+  <![%holder.module;[
+  <!ENTITY % local.holder.attrib "">
+  <!ENTITY % holder.role.attrib "%role.attrib;">
+
+<!ENTITY % holder.element "INCLUDE">
+<![%holder.element;[
+<!ELEMENT holder %ho; (%docinfo.char.mix;)*>
+<!--end of holder.element-->]]>
+
+<!ENTITY % holder.attlist "INCLUDE">
+<![%holder.attlist;[
+<!ATTLIST holder
+		%common.attrib;
+		%holder.role.attrib;
+		%local.holder.attrib;
+>
+<!--end of holder.attlist-->]]>
+  <!--end of holder.module-->]]>
+<!--end of copyright.content.module-->]]>
+
+<!-- CorpAuthor ....................... -->
+
+<!ENTITY % corpauthor.module "INCLUDE">
+<![%corpauthor.module;[
+<!ENTITY % local.corpauthor.attrib "">
+<!ENTITY % corpauthor.role.attrib "%role.attrib;">
+
+<!ENTITY % corpauthor.element "INCLUDE">
+<![%corpauthor.element;[
+<!ELEMENT corpauthor %ho; (%docinfo.char.mix;)*>
+<!--end of corpauthor.element-->]]>
+
+<!ENTITY % corpauthor.attlist "INCLUDE">
+<![%corpauthor.attlist;[
+<!ATTLIST corpauthor
+		%common.attrib;
+		%corpauthor.role.attrib;
+		%local.corpauthor.attrib;
+>
+<!--end of corpauthor.attlist-->]]>
+<!--end of corpauthor.module-->]]>
+
+<!-- CorpCredit ...................... -->
+
+<!ENTITY % corpcredit.module "INCLUDE">
+<![%corpcredit.module;[
+<!ENTITY % local.corpcredit.attrib "">
+<!ENTITY % corpcredit.role.attrib "%role.attrib;">
+
+<!ENTITY % corpcredit.element "INCLUDE">
+<![%corpcredit.element;[
+<!ELEMENT corpcredit %ho; (%docinfo.char.mix;)*>
+<!--end of corpcredit.element-->]]>
+
+<!ENTITY % corpcredit.attlist "INCLUDE">
+<![%corpcredit.attlist;[
+<!ATTLIST corpcredit
+		class	(graphicdesigner
+			|productioneditor
+			|copyeditor
+			|technicaleditor
+			|translator
+			|other)			#IMPLIED
+		%common.attrib;
+		%corpcredit.role.attrib;
+		%local.corpcredit.attrib;
+>
+<!--end of corpcredit.attlist-->]]>
+<!--end of corpcredit.module-->]]>
+
+<!-- CorpName ......................... -->
+
+<!ENTITY % corpname.module "INCLUDE">
+<![%corpname.module;[
+<!ENTITY % local.corpname.attrib "">
+
+<!ENTITY % corpname.element "INCLUDE">
+<![%corpname.element;[
+<!ELEMENT corpname %ho; (%docinfo.char.mix;)*>
+<!--end of corpname.element-->]]>
+<!ENTITY % corpname.role.attrib "%role.attrib;">
+
+<!ENTITY % corpname.attlist "INCLUDE">
+<![%corpname.attlist;[
+<!ATTLIST corpname
+		%common.attrib;
+		%corpname.role.attrib;
+		%local.corpname.attrib;
+>
+<!--end of corpname.attlist-->]]>
+<!--end of corpname.module-->]]>
+
+<!-- Date ............................. -->
+
+<!ENTITY % date.module "INCLUDE">
+<![%date.module;[
+<!ENTITY % local.date.attrib "">
+<!ENTITY % date.role.attrib "%role.attrib;">
+
+<!ENTITY % date.element "INCLUDE">
+<![%date.element;[
+<!ELEMENT date %ho; (%docinfo.char.mix;)*>
+<!--end of date.element-->]]>
+
+<!ENTITY % date.attlist "INCLUDE">
+<![%date.attlist;[
+<!ATTLIST date
+		%common.attrib;
+		%date.role.attrib;
+		%local.date.attrib;
+>
+<!--end of date.attlist-->]]>
+<!--end of date.module-->]]>
+
+<!-- Edition .......................... -->
+
+<!ENTITY % edition.module "INCLUDE">
+<![%edition.module;[
+<!ENTITY % local.edition.attrib "">
+<!ENTITY % edition.role.attrib "%role.attrib;">
+
+<!ENTITY % edition.element "INCLUDE">
+<![%edition.element;[
+<!ELEMENT edition %ho; (%docinfo.char.mix;)*>
+<!--end of edition.element-->]]>
+
+<!ENTITY % edition.attlist "INCLUDE">
+<![%edition.attlist;[
+<!ATTLIST edition
+		%common.attrib;
+		%edition.role.attrib;
+		%local.edition.attrib;
+>
+<!--end of edition.attlist-->]]>
+<!--end of edition.module-->]]>
+
+<!-- Editor ........................... -->
+
+<!ENTITY % editor.module "INCLUDE">
+<![%editor.module;[
+<!ENTITY % local.editor.attrib "">
+<!ENTITY % editor.role.attrib "%role.attrib;">
+
+<!ENTITY % editor.element "INCLUDE">
+<![%editor.element;[
+<!ELEMENT editor %ho; ((personname|(%person.ident.mix;)+),(personblurb|email|address)*)>
+<!--end of editor.element-->]]>
+
+<!ENTITY % editor.attlist "INCLUDE">
+<![%editor.attlist;[
+<!ATTLIST editor
+		%common.attrib;
+		%editor.role.attrib;
+		%local.editor.attrib;
+>
+<!--end of editor.attlist-->]]>
+  <!--(see "Personal identity elements" for %person.ident.mix;)-->
+<!--end of editor.module-->]]>
+
+<!-- ISBN ............................. -->
+
+<!ENTITY % isbn.module "INCLUDE">
+<![%isbn.module;[
+<!ENTITY % local.isbn.attrib "">
+<!ENTITY % isbn.role.attrib "%role.attrib;">
+
+<!ENTITY % isbn.element "INCLUDE">
+<![%isbn.element;[
+<!ELEMENT isbn %ho; (%docinfo.char.mix;)*>
+<!--end of isbn.element-->]]>
+
+<!ENTITY % isbn.attlist "INCLUDE">
+<![%isbn.attlist;[
+<!ATTLIST isbn
+		%common.attrib;
+		%isbn.role.attrib;
+		%local.isbn.attrib;
+>
+<!--end of isbn.attlist-->]]>
+<!--end of isbn.module-->]]>
+
+<!-- ISSN ............................. -->
+
+<!ENTITY % issn.module "INCLUDE">
+<![%issn.module;[
+<!ENTITY % local.issn.attrib "">
+<!ENTITY % issn.role.attrib "%role.attrib;">
+
+<!ENTITY % issn.element "INCLUDE">
+<![%issn.element;[
+<!ELEMENT issn %ho; (%docinfo.char.mix;)*>
+<!--end of issn.element-->]]>
+
+<!ENTITY % issn.attlist "INCLUDE">
+<![%issn.attlist;[
+<!ATTLIST issn
+		%common.attrib;
+		%issn.role.attrib;
+		%local.issn.attrib;
+>
+<!--end of issn.attlist-->]]>
+<!--end of issn.module-->]]>
+
+<!-- BiblioId ................. -->
+<!ENTITY % biblio.class.attrib
+		"class	(uri
+                         |doi
+                         |isbn
+                         |issn
+                         |libraryofcongress
+                         |pubnumber
+                         |other)	#IMPLIED
+		otherclass	CDATA	#IMPLIED"
+>
+
+<!ENTITY % biblioid.module "INCLUDE">
+<![%biblioid.module;[
+<!ENTITY % local.biblioid.attrib "">
+<!ENTITY % biblioid.role.attrib "%role.attrib;">
+
+<!ENTITY % biblioid.element "INCLUDE">
+<![%biblioid.element;[
+<!ELEMENT biblioid %ho; (%docinfo.char.mix;)*>
+<!--end of biblioid.element-->]]>
+
+<!ENTITY % biblioid.attlist "INCLUDE">
+<![%biblioid.attlist;[
+<!ATTLIST biblioid
+		%biblio.class.attrib;
+		%common.attrib;
+		%biblioid.role.attrib;
+		%local.biblioid.attrib;
+>
+<!--end of biblioid.attlist-->]]>
+<!--end of biblioid.module-->]]>
+
+<!-- CiteBiblioId ................. -->
+
+<!ENTITY % citebiblioid.module "INCLUDE">
+<![%citebiblioid.module;[
+<!ENTITY % local.citebiblioid.attrib "">
+<!ENTITY % citebiblioid.role.attrib "%role.attrib;">
+
+<!ENTITY % citebiblioid.element "INCLUDE">
+<![%citebiblioid.element;[
+<!ELEMENT citebiblioid %ho; (%docinfo.char.mix;)*>
+<!--end of citebiblioid.element-->]]>
+
+<!ENTITY % citebiblioid.attlist "INCLUDE">
+<![%citebiblioid.attlist;[
+<!ATTLIST citebiblioid
+		%biblio.class.attrib;
+		%common.attrib;
+		%citebiblioid.role.attrib;
+		%local.citebiblioid.attrib;
+>
+<!--end of citebiblioid.attlist-->]]>
+<!--end of citebiblioid.module-->]]>
+
+<!-- BiblioSource ................. -->
+
+<!ENTITY % bibliosource.module "INCLUDE">
+<![%bibliosource.module;[
+<!ENTITY % local.bibliosource.attrib "">
+<!ENTITY % bibliosource.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliosource.element "INCLUDE">
+<![%bibliosource.element;[
+<!ELEMENT bibliosource %ho; (%docinfo.char.mix;)*>
+<!--end of bibliosource.element-->]]>
+
+<!ENTITY % bibliosource.attlist "INCLUDE">
+<![%bibliosource.attlist;[
+<!ATTLIST bibliosource
+		%biblio.class.attrib;
+		%common.attrib;
+		%bibliosource.role.attrib;
+		%local.bibliosource.attrib;
+>
+<!--end of bibliosource.attlist-->]]>
+<!--end of bibliosource.module-->]]>
+
+<!-- BiblioRelation ................. -->
+
+<!ENTITY % bibliorelation.module "INCLUDE">
+<![%bibliorelation.module;[
+<!ENTITY % local.bibliorelation.attrib "">
+<!ENTITY % local.bibliorelation.types "">
+
+<!ENTITY % bibliorelation.type.attrib
+                "type    (isversionof
+                         |hasversion
+                         |isreplacedby
+                         |replaces
+                         |isrequiredby
+                         |requires
+                         |ispartof
+                         |haspart
+                         |isreferencedby
+                         |references
+                         |isformatof
+                         |hasformat
+                         |othertype
+                         %local.bibliorelation.types;)       #IMPLIED
+		othertype	CDATA	#IMPLIED
+">
+
+<!ENTITY % bibliorelation.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliorelation.element "INCLUDE">
+<![%bibliorelation.element;[
+<!ELEMENT bibliorelation %ho; (%docinfo.char.mix;)*>
+<!--end of bibliorelation.element-->]]>
+
+<!ENTITY % bibliorelation.attlist "INCLUDE">
+<![%bibliorelation.attlist;[
+<!ATTLIST bibliorelation
+		%biblio.class.attrib;
+		%bibliorelation.type.attrib;
+		%common.attrib;
+		%bibliorelation.role.attrib;
+		%local.bibliorelation.attrib;
+>
+<!--end of bibliorelation.attlist-->]]>
+<!--end of bibliorelation.module-->]]>
+
+<!-- BiblioCoverage ................. -->
+
+<!ENTITY % bibliocoverage.module "INCLUDE">
+<![%bibliocoverage.module;[
+<!ENTITY % local.bibliocoverage.attrib "">
+<!ENTITY % bibliocoverage.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliocoverage.element "INCLUDE">
+<![%bibliocoverage.element;[
+<!ELEMENT bibliocoverage %ho; (%docinfo.char.mix;)*>
+<!--end of bibliocoverage.element-->]]>
+
+<!ENTITY % bibliocoverage.attlist "INCLUDE">
+<![%bibliocoverage.attlist;[
+<!ATTLIST bibliocoverage
+		spatial	(dcmipoint|iso3166|dcmibox|tgn|otherspatial)	#IMPLIED
+		otherspatial	CDATA	#IMPLIED
+		temporal (dcmiperiod|w3c-dtf|othertemporal) #IMPLIED
+		othertemporal	CDATA	#IMPLIED
+		%common.attrib;
+		%bibliocoverage.role.attrib;
+		%local.bibliocoverage.attrib;
+>
+<!--end of bibliocoverage.attlist-->]]>
+<!--end of bibliocoverage.module-->]]>
+
+<!-- InvPartNumber .................... -->
+
+<!ENTITY % invpartnumber.module "INCLUDE">
+<![%invpartnumber.module;[
+<!ENTITY % local.invpartnumber.attrib "">
+<!ENTITY % invpartnumber.role.attrib "%role.attrib;">
+
+<!ENTITY % invpartnumber.element "INCLUDE">
+<![%invpartnumber.element;[
+<!ELEMENT invpartnumber %ho; (%docinfo.char.mix;)*>
+<!--end of invpartnumber.element-->]]>
+
+<!ENTITY % invpartnumber.attlist "INCLUDE">
+<![%invpartnumber.attlist;[
+<!ATTLIST invpartnumber
+		%common.attrib;
+		%invpartnumber.role.attrib;
+		%local.invpartnumber.attrib;
+>
+<!--end of invpartnumber.attlist-->]]>
+<!--end of invpartnumber.module-->]]>
+
+<!-- IssueNum ......................... -->
+
+<!ENTITY % issuenum.module "INCLUDE">
+<![%issuenum.module;[
+<!ENTITY % local.issuenum.attrib "">
+<!ENTITY % issuenum.role.attrib "%role.attrib;">
+
+<!ENTITY % issuenum.element "INCLUDE">
+<![%issuenum.element;[
+<!ELEMENT issuenum %ho; (%docinfo.char.mix;)*>
+<!--end of issuenum.element-->]]>
+
+<!ENTITY % issuenum.attlist "INCLUDE">
+<![%issuenum.attlist;[
+<!ATTLIST issuenum
+		%common.attrib;
+		%issuenum.role.attrib;
+		%local.issuenum.attrib;
+>
+<!--end of issuenum.attlist-->]]>
+<!--end of issuenum.module-->]]>
+
+<!-- LegalNotice ...................... -->
+
+<!ENTITY % legalnotice.module "INCLUDE">
+<![%legalnotice.module;[
+<!ENTITY % local.legalnotice.attrib "">
+<!ENTITY % legalnotice.role.attrib "%role.attrib;">
+
+<!ENTITY % legalnotice.element "INCLUDE">
+<![%legalnotice.element;[
+<!ELEMENT legalnotice %ho; (blockinfo?, title?, (%legalnotice.mix;)+)
+		%formal.exclusion;>
+<!--end of legalnotice.element-->]]>
+
+<!ENTITY % legalnotice.attlist "INCLUDE">
+<![%legalnotice.attlist;[
+<!ATTLIST legalnotice
+		%common.attrib;
+		%legalnotice.role.attrib;
+		%local.legalnotice.attrib;
+>
+<!--end of legalnotice.attlist-->]]>
+<!--end of legalnotice.module-->]]>
+
+<!-- ModeSpec ......................... -->
+
+<!ENTITY % modespec.module "INCLUDE">
+<![%modespec.module;[
+<!ENTITY % local.modespec.attrib "">
+<!ENTITY % modespec.role.attrib "%role.attrib;">
+
+<!ENTITY % modespec.element "INCLUDE">
+<![%modespec.element;[
+<!ELEMENT modespec %ho; (%docinfo.char.mix;)*
+		%ubiq.exclusion;>
+<!--end of modespec.element-->]]>
+
+<!-- Application: Type of action required for completion
+		of the links to which the ModeSpec is relevant (e.g.,
+		retrieval query) -->
+
+
+<!ENTITY % modespec.attlist "INCLUDE">
+<![%modespec.attlist;[
+<!ATTLIST modespec
+		application	NOTATION
+				(%notation.class;)	#IMPLIED
+		%common.attrib;
+		%modespec.role.attrib;
+		%local.modespec.attrib;
+>
+<!--end of modespec.attlist-->]]>
+<!--end of modespec.module-->]]>
+
+<!-- OrgName .......................... -->
+
+<!ENTITY % orgname.module "INCLUDE">
+<![%orgname.module;[
+<!ENTITY % local.orgname.attrib "">
+<!ENTITY % orgname.role.attrib "%role.attrib;">
+
+<!ENTITY % orgname.element "INCLUDE">
+<![%orgname.element;[
+<!ELEMENT orgname %ho; (%docinfo.char.mix;)*>
+<!--end of orgname.element-->]]>
+
+<!ENTITY % orgname.attlist "INCLUDE">
+<![%orgname.attlist;[
+<!ATTLIST orgname
+		%common.attrib;
+		class	(corporation|nonprofit|consortium|informal|other)	#IMPLIED
+		otherclass	CDATA			#IMPLIED
+		%orgname.role.attrib;
+		%local.orgname.attrib;
+>
+<!--end of orgname.attlist-->]]>
+<!--end of orgname.module-->]]>
+
+<!-- OtherCredit ...................... -->
+
+<!ENTITY % othercredit.module "INCLUDE">
+<![%othercredit.module;[
+<!ENTITY % local.othercredit.attrib "">
+<!ENTITY % othercredit.role.attrib "%role.attrib;">
+
+<!ENTITY % othercredit.element "INCLUDE">
+<![%othercredit.element;[
+<!ELEMENT othercredit %ho; ((personname|(%person.ident.mix;)+),
+                            (personblurb|email|address)*)>
+<!--end of othercredit.element-->]]>
+
+<!ENTITY % othercredit.attlist "INCLUDE">
+<![%othercredit.attlist;[
+<!ATTLIST othercredit
+		class	(graphicdesigner
+			|productioneditor
+			|copyeditor
+			|technicaleditor
+			|translator
+			|other)			#IMPLIED
+		%common.attrib;
+		%othercredit.role.attrib;
+		%local.othercredit.attrib;
+>
+<!--end of othercredit.attlist-->]]>
+  <!--(see "Personal identity elements" for %person.ident.mix;)-->
+<!--end of othercredit.module-->]]>
+
+<!-- PageNums ......................... -->
+
+<!ENTITY % pagenums.module "INCLUDE">
+<![%pagenums.module;[
+<!ENTITY % local.pagenums.attrib "">
+<!ENTITY % pagenums.role.attrib "%role.attrib;">
+
+<!ENTITY % pagenums.element "INCLUDE">
+<![%pagenums.element;[
+<!ELEMENT pagenums %ho; (%docinfo.char.mix;)*>
+<!--end of pagenums.element-->]]>
+
+<!ENTITY % pagenums.attlist "INCLUDE">
+<![%pagenums.attlist;[
+<!ATTLIST pagenums
+		%common.attrib;
+		%pagenums.role.attrib;
+		%local.pagenums.attrib;
+>
+<!--end of pagenums.attlist-->]]>
+<!--end of pagenums.module-->]]>
+
+<!-- Personal identity elements ....... -->
+
+<!-- These elements are used only within Author, Editor, and
+OtherCredit. -->
+
+<!ENTITY % person.ident.module "INCLUDE">
+<![%person.ident.module;[
+  <!ENTITY % contrib.module "INCLUDE">
+  <![%contrib.module;[
+  <!ENTITY % local.contrib.attrib "">
+  <!ENTITY % contrib.role.attrib "%role.attrib;">
+
+<!ENTITY % contrib.element "INCLUDE">
+<![%contrib.element;[
+<!ELEMENT contrib %ho; (%docinfo.char.mix;)*>
+<!--end of contrib.element-->]]>
+
+<!ENTITY % contrib.attlist "INCLUDE">
+<![%contrib.attlist;[
+<!ATTLIST contrib
+		%common.attrib;
+		%contrib.role.attrib;
+		%local.contrib.attrib;
+>
+<!--end of contrib.attlist-->]]>
+  <!--end of contrib.module-->]]>
+
+  <!ENTITY % firstname.module "INCLUDE">
+  <![%firstname.module;[
+  <!ENTITY % local.firstname.attrib "">
+  <!ENTITY % firstname.role.attrib "%role.attrib;">
+
+<!ENTITY % firstname.element "INCLUDE">
+<![%firstname.element;[
+<!ELEMENT firstname %ho; (%docinfo.char.mix;)*>
+<!--end of firstname.element-->]]>
+
+<!ENTITY % firstname.attlist "INCLUDE">
+<![%firstname.attlist;[
+<!ATTLIST firstname
+		%common.attrib;
+		%firstname.role.attrib;
+		%local.firstname.attrib;
+>
+<!--end of firstname.attlist-->]]>
+  <!--end of firstname.module-->]]>
+
+  <!ENTITY % honorific.module "INCLUDE">
+  <![%honorific.module;[
+  <!ENTITY % local.honorific.attrib "">
+  <!ENTITY % honorific.role.attrib "%role.attrib;">
+
+<!ENTITY % honorific.element "INCLUDE">
+<![%honorific.element;[
+<!ELEMENT honorific %ho; (%docinfo.char.mix;)*>
+<!--end of honorific.element-->]]>
+
+<!ENTITY % honorific.attlist "INCLUDE">
+<![%honorific.attlist;[
+<!ATTLIST honorific
+		%common.attrib;
+		%honorific.role.attrib;
+		%local.honorific.attrib;
+>
+<!--end of honorific.attlist-->]]>
+  <!--end of honorific.module-->]]>
+
+  <!ENTITY % lineage.module "INCLUDE">
+  <![%lineage.module;[
+  <!ENTITY % local.lineage.attrib "">
+  <!ENTITY % lineage.role.attrib "%role.attrib;">
+
+<!ENTITY % lineage.element "INCLUDE">
+<![%lineage.element;[
+<!ELEMENT lineage %ho; (%docinfo.char.mix;)*>
+<!--end of lineage.element-->]]>
+
+<!ENTITY % lineage.attlist "INCLUDE">
+<![%lineage.attlist;[
+<!ATTLIST lineage
+		%common.attrib;
+		%lineage.role.attrib;
+		%local.lineage.attrib;
+>
+<!--end of lineage.attlist-->]]>
+  <!--end of lineage.module-->]]>
+
+  <!ENTITY % othername.module "INCLUDE">
+  <![%othername.module;[
+  <!ENTITY % local.othername.attrib "">
+  <!ENTITY % othername.role.attrib "%role.attrib;">
+
+<!ENTITY % othername.element "INCLUDE">
+<![%othername.element;[
+<!ELEMENT othername %ho; (%docinfo.char.mix;)*>
+<!--end of othername.element-->]]>
+
+<!ENTITY % othername.attlist "INCLUDE">
+<![%othername.attlist;[
+<!ATTLIST othername
+		%common.attrib;
+		%othername.role.attrib;
+		%local.othername.attrib;
+>
+<!--end of othername.attlist-->]]>
+  <!--end of othername.module-->]]>
+
+  <!ENTITY % surname.module "INCLUDE">
+  <![%surname.module;[
+  <!ENTITY % local.surname.attrib "">
+  <!ENTITY % surname.role.attrib "%role.attrib;">
+
+<!ENTITY % surname.element "INCLUDE">
+<![%surname.element;[
+<!ELEMENT surname %ho; (%docinfo.char.mix;)*>
+<!--end of surname.element-->]]>
+
+<!ENTITY % surname.attlist "INCLUDE">
+<![%surname.attlist;[
+<!ATTLIST surname
+		%common.attrib;
+		%surname.role.attrib;
+		%local.surname.attrib;
+>
+<!--end of surname.attlist-->]]>
+  <!--end of surname.module-->]]>
+<!--end of person.ident.module-->]]>
+
+<!-- PrintHistory ..................... -->
+
+<!ENTITY % printhistory.module "INCLUDE">
+<![%printhistory.module;[
+<!ENTITY % local.printhistory.attrib "">
+<!ENTITY % printhistory.role.attrib "%role.attrib;">
+
+<!ENTITY % printhistory.element "INCLUDE">
+<![%printhistory.element;[
+<!ELEMENT printhistory %ho; ((%para.class;)+)>
+<!--end of printhistory.element-->]]>
+
+<!ENTITY % printhistory.attlist "INCLUDE">
+<![%printhistory.attlist;[
+<!ATTLIST printhistory
+		%common.attrib;
+		%printhistory.role.attrib;
+		%local.printhistory.attrib;
+>
+<!--end of printhistory.attlist-->]]>
+<!--end of printhistory.module-->]]>
+
+<!-- ProductName ...................... -->
+
+<!ENTITY % productname.module "INCLUDE">
+<![%productname.module;[
+<!ENTITY % local.productname.attrib "">
+<!ENTITY % productname.role.attrib "%role.attrib;">
+
+<!ENTITY % productname.element "INCLUDE">
+<![%productname.element;[
+<!ELEMENT productname %ho; (%para.char.mix;)*>
+<!--end of productname.element-->]]>
+
+<!-- Class: More precisely identifies the item the element names -->
+
+
+<!ENTITY % productname.attlist "INCLUDE">
+<![%productname.attlist;[
+<!ATTLIST productname
+		class		(service
+				|trade
+				|registered
+				|copyright)	'trade'
+		%common.attrib;
+		%productname.role.attrib;
+		%local.productname.attrib;
+>
+<!--end of productname.attlist-->]]>
+<!--end of productname.module-->]]>
+
+<!-- ProductNumber .................... -->
+
+<!ENTITY % productnumber.module "INCLUDE">
+<![%productnumber.module;[
+<!ENTITY % local.productnumber.attrib "">
+<!ENTITY % productnumber.role.attrib "%role.attrib;">
+
+<!ENTITY % productnumber.element "INCLUDE">
+<![%productnumber.element;[
+<!ELEMENT productnumber %ho; (%docinfo.char.mix;)*>
+<!--end of productnumber.element-->]]>
+
+<!ENTITY % productnumber.attlist "INCLUDE">
+<![%productnumber.attlist;[
+<!ATTLIST productnumber
+		%common.attrib;
+		%productnumber.role.attrib;
+		%local.productnumber.attrib;
+>
+<!--end of productnumber.attlist-->]]>
+<!--end of productnumber.module-->]]>
+
+<!-- PubDate .......................... -->
+
+<!ENTITY % pubdate.module "INCLUDE">
+<![%pubdate.module;[
+<!ENTITY % local.pubdate.attrib "">
+<!ENTITY % pubdate.role.attrib "%role.attrib;">
+
+<!ENTITY % pubdate.element "INCLUDE">
+<![%pubdate.element;[
+<!ELEMENT pubdate %ho; (%docinfo.char.mix;)*>
+<!--end of pubdate.element-->]]>
+
+<!ENTITY % pubdate.attlist "INCLUDE">
+<![%pubdate.attlist;[
+<!ATTLIST pubdate
+		%common.attrib;
+		%pubdate.role.attrib;
+		%local.pubdate.attrib;
+>
+<!--end of pubdate.attlist-->]]>
+<!--end of pubdate.module-->]]>
+
+<!-- Publisher ........................ -->
+
+<!ENTITY % publisher.content.module "INCLUDE">
+<![%publisher.content.module;[
+<!ENTITY % publisher.module "INCLUDE">
+<![%publisher.module;[
+<!ENTITY % local.publisher.attrib "">
+<!ENTITY % publisher.role.attrib "%role.attrib;">
+
+<!ENTITY % publisher.element "INCLUDE">
+<![%publisher.element;[
+<!ELEMENT publisher %ho; (publishername, address*)>
+<!--end of publisher.element-->]]>
+
+<!ENTITY % publisher.attlist "INCLUDE">
+<![%publisher.attlist;[
+<!ATTLIST publisher
+		%common.attrib;
+		%publisher.role.attrib;
+		%local.publisher.attrib;
+>
+<!--end of publisher.attlist-->]]>
+<!--end of publisher.module-->]]>
+
+  <!ENTITY % publishername.module "INCLUDE">
+  <![%publishername.module;[
+  <!ENTITY % local.publishername.attrib "">
+  <!ENTITY % publishername.role.attrib "%role.attrib;">
+
+<!ENTITY % publishername.element "INCLUDE">
+<![%publishername.element;[
+<!ELEMENT publishername %ho; (%docinfo.char.mix;)*>
+<!--end of publishername.element-->]]>
+
+<!ENTITY % publishername.attlist "INCLUDE">
+<![%publishername.attlist;[
+<!ATTLIST publishername
+		%common.attrib;
+		%publishername.role.attrib;
+		%local.publishername.attrib;
+>
+<!--end of publishername.attlist-->]]>
+  <!--end of publishername.module-->]]>
+
+  <!-- Address (defined elsewhere in this section)-->
+<!--end of publisher.content.module-->]]>
+
+<!-- PubsNumber ....................... -->
+
+<!ENTITY % pubsnumber.module "INCLUDE">
+<![%pubsnumber.module;[
+<!ENTITY % local.pubsnumber.attrib "">
+<!ENTITY % pubsnumber.role.attrib "%role.attrib;">
+
+<!ENTITY % pubsnumber.element "INCLUDE">
+<![%pubsnumber.element;[
+<!ELEMENT pubsnumber %ho; (%docinfo.char.mix;)*>
+<!--end of pubsnumber.element-->]]>
+
+<!ENTITY % pubsnumber.attlist "INCLUDE">
+<![%pubsnumber.attlist;[
+<!ATTLIST pubsnumber
+		%common.attrib;
+		%pubsnumber.role.attrib;
+		%local.pubsnumber.attrib;
+>
+<!--end of pubsnumber.attlist-->]]>
+<!--end of pubsnumber.module-->]]>
+
+<!-- ReleaseInfo ...................... -->
+
+<!ENTITY % releaseinfo.module "INCLUDE">
+<![%releaseinfo.module;[
+<!ENTITY % local.releaseinfo.attrib "">
+<!ENTITY % releaseinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % releaseinfo.element "INCLUDE">
+<![%releaseinfo.element;[
+<!ELEMENT releaseinfo %ho; (%docinfo.char.mix;)*>
+<!--end of releaseinfo.element-->]]>
+
+<!ENTITY % releaseinfo.attlist "INCLUDE">
+<![%releaseinfo.attlist;[
+<!ATTLIST releaseinfo
+		%common.attrib;
+		%releaseinfo.role.attrib;
+		%local.releaseinfo.attrib;
+>
+<!--end of releaseinfo.attlist-->]]>
+<!--end of releaseinfo.module-->]]>
+
+<!-- RevHistory ....................... -->
+
+<!ENTITY % revhistory.content.module "INCLUDE">
+<![%revhistory.content.module;[
+<!ENTITY % revhistory.module "INCLUDE">
+<![%revhistory.module;[
+<!ENTITY % local.revhistory.attrib "">
+<!ENTITY % revhistory.role.attrib "%role.attrib;">
+
+<!ENTITY % revhistory.element "INCLUDE">
+<![%revhistory.element;[
+<!ELEMENT revhistory %ho; (revision+)>
+<!--end of revhistory.element-->]]>
+
+<!ENTITY % revhistory.attlist "INCLUDE">
+<![%revhistory.attlist;[
+<!ATTLIST revhistory
+		%common.attrib;
+		%revhistory.role.attrib;
+		%local.revhistory.attrib;
+>
+<!--end of revhistory.attlist-->]]>
+<!--end of revhistory.module-->]]>
+
+<!ENTITY % revision.module "INCLUDE">
+<![%revision.module;[
+<!ENTITY % local.revision.attrib "">
+<!ENTITY % revision.role.attrib "%role.attrib;">
+
+<!ENTITY % revision.element "INCLUDE">
+<![%revision.element;[
+<!ELEMENT revision %ho; (revnumber, date, (author|authorinitials)*,
+                    (revremark|revdescription)?)>
+<!--end of revision.element-->]]>
+
+<!ENTITY % revision.attlist "INCLUDE">
+<![%revision.attlist;[
+<!ATTLIST revision
+		%common.attrib;
+		%revision.role.attrib;
+		%local.revision.attrib;
+>
+<!--end of revision.attlist-->]]>
+<!--end of revision.module-->]]>
+
+<!ENTITY % revnumber.module "INCLUDE">
+<![%revnumber.module;[
+<!ENTITY % local.revnumber.attrib "">
+<!ENTITY % revnumber.role.attrib "%role.attrib;">
+
+<!ENTITY % revnumber.element "INCLUDE">
+<![%revnumber.element;[
+<!ELEMENT revnumber %ho; (%docinfo.char.mix;)*>
+<!--end of revnumber.element-->]]>
+
+<!ENTITY % revnumber.attlist "INCLUDE">
+<![%revnumber.attlist;[
+<!ATTLIST revnumber
+		%common.attrib;
+		%revnumber.role.attrib;
+		%local.revnumber.attrib;
+>
+<!--end of revnumber.attlist-->]]>
+<!--end of revnumber.module-->]]>
+
+<!-- Date (defined elsewhere in this section)-->
+<!-- AuthorInitials (defined elsewhere in this section)-->
+
+<!ENTITY % revremark.module "INCLUDE">
+<![%revremark.module;[
+<!ENTITY % local.revremark.attrib "">
+<!ENTITY % revremark.role.attrib "%role.attrib;">
+
+<!ENTITY % revremark.element "INCLUDE">
+<![%revremark.element;[
+<!ELEMENT revremark %ho; (%docinfo.char.mix;)*>
+<!--end of revremark.element-->]]>
+
+<!ENTITY % revremark.attlist "INCLUDE">
+<![%revremark.attlist;[
+<!ATTLIST revremark
+		%common.attrib;
+		%revremark.role.attrib;
+		%local.revremark.attrib;
+>
+<!--end of revremark.attlist-->]]>
+<!--end of revremark.module-->]]>
+
+<!ENTITY % revdescription.module "INCLUDE">
+<![ %revdescription.module; [
+<!ENTITY % local.revdescription.attrib "">
+<!ENTITY % revdescription.role.attrib "%role.attrib;">
+
+<!ENTITY % revdescription.element "INCLUDE">
+<![ %revdescription.element; [
+<!ELEMENT revdescription %ho; ((%revdescription.mix;)+)>
+<!--end of revdescription.element-->]]>
+
+<!ENTITY % revdescription.attlist "INCLUDE">
+<![ %revdescription.attlist; [
+<!ATTLIST revdescription
+		%common.attrib;
+		%revdescription.role.attrib;
+		%local.revdescription.attrib;
+>
+<!--end of revdescription.attlist-->]]>
+<!--end of revdescription.module-->]]>
+<!--end of revhistory.content.module-->]]>
+
+<!-- SeriesVolNums .................... -->
+
+<!ENTITY % seriesvolnums.module "INCLUDE">
+<![%seriesvolnums.module;[
+<!ENTITY % local.seriesvolnums.attrib "">
+<!ENTITY % seriesvolnums.role.attrib "%role.attrib;">
+
+<!ENTITY % seriesvolnums.element "INCLUDE">
+<![%seriesvolnums.element;[
+<!ELEMENT seriesvolnums %ho; (%docinfo.char.mix;)*>
+<!--end of seriesvolnums.element-->]]>
+
+<!ENTITY % seriesvolnums.attlist "INCLUDE">
+<![%seriesvolnums.attlist;[
+<!ATTLIST seriesvolnums
+		%common.attrib;
+		%seriesvolnums.role.attrib;
+		%local.seriesvolnums.attrib;
+>
+<!--end of seriesvolnums.attlist-->]]>
+<!--end of seriesvolnums.module-->]]>
+
+<!-- VolumeNum ........................ -->
+
+<!ENTITY % volumenum.module "INCLUDE">
+<![%volumenum.module;[
+<!ENTITY % local.volumenum.attrib "">
+<!ENTITY % volumenum.role.attrib "%role.attrib;">
+
+<!ENTITY % volumenum.element "INCLUDE">
+<![%volumenum.element;[
+<!ELEMENT volumenum %ho; (%docinfo.char.mix;)*>
+<!--end of volumenum.element-->]]>
+
+<!ENTITY % volumenum.attlist "INCLUDE">
+<![%volumenum.attlist;[
+<!ATTLIST volumenum
+		%common.attrib;
+		%volumenum.role.attrib;
+		%local.volumenum.attrib;
+>
+<!--end of volumenum.attlist-->]]>
+<!--end of volumenum.module-->]]>
+
+<!-- .................................. -->
+
+<!--end of docinfo.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Inline, link, and ubiquitous elements ................................ -->
+
+<!-- Technical and computer terms ......................................... -->
+
+<!ENTITY % accel.module "INCLUDE">
+<![%accel.module;[
+<!ENTITY % local.accel.attrib "">
+<!ENTITY % accel.role.attrib "%role.attrib;">
+
+<!ENTITY % accel.element "INCLUDE">
+<![%accel.element;[
+<!ELEMENT accel %ho; (%smallcptr.char.mix;)*>
+<!--end of accel.element-->]]>
+
+<!ENTITY % accel.attlist "INCLUDE">
+<![%accel.attlist;[
+<!ATTLIST accel
+		%common.attrib;
+		%accel.role.attrib;
+		%local.accel.attrib;
+>
+<!--end of accel.attlist-->]]>
+<!--end of accel.module-->]]>
+
+<!ENTITY % action.module "INCLUDE">
+<![%action.module;[
+<!ENTITY % local.action.attrib "">
+<!ENTITY % action.role.attrib "%role.attrib;">
+
+<!ENTITY % action.element "INCLUDE">
+<![%action.element;[
+<!ELEMENT action %ho; (%cptr.char.mix;)*>
+<!--end of action.element-->]]>
+
+<!ENTITY % action.attlist "INCLUDE">
+<![%action.attlist;[
+<!ATTLIST action
+		%moreinfo.attrib;
+		%common.attrib;
+		%action.role.attrib;
+		%local.action.attrib;
+>
+<!--end of action.attlist-->]]>
+<!--end of action.module-->]]>
+
+<!ENTITY % application.module "INCLUDE">
+<![%application.module;[
+<!ENTITY % local.application.attrib "">
+<!ENTITY % application.role.attrib "%role.attrib;">
+
+<!ENTITY % application.element "INCLUDE">
+<![%application.element;[
+<!ELEMENT application %ho; (%para.char.mix;)*>
+<!--end of application.element-->]]>
+
+<!ENTITY % application.attlist "INCLUDE">
+<![%application.attlist;[
+<!ATTLIST application
+		class 		(hardware
+				|software)	#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%application.role.attrib;
+		%local.application.attrib;
+>
+<!--end of application.attlist-->]]>
+<!--end of application.module-->]]>
+
+<!ENTITY % classname.module "INCLUDE">
+<![%classname.module;[
+<!ENTITY % local.classname.attrib "">
+<!ENTITY % classname.role.attrib "%role.attrib;">
+
+<!ENTITY % classname.element "INCLUDE">
+<![%classname.element;[
+<!ELEMENT classname %ho; (%smallcptr.char.mix;)*>
+<!--end of classname.element-->]]>
+
+<!ENTITY % classname.attlist "INCLUDE">
+<![%classname.attlist;[
+<!ATTLIST classname
+		%common.attrib;
+		%classname.role.attrib;
+		%local.classname.attrib;
+>
+<!--end of classname.attlist-->]]>
+<!--end of classname.module-->]]>
+
+<!ENTITY % package.module "INCLUDE">
+<![%package.module;[
+<!ENTITY % local.package.attrib "">
+<!ENTITY % package.role.attrib "%role.attrib;">
+
+<!ENTITY % package.element "INCLUDE">
+<![%package.element;[
+<!ELEMENT package %ho; (%smallcptr.char.mix;)*>
+<!--end of package.element-->]]>
+
+<!ENTITY % package.attlist "INCLUDE">
+<![%package.attlist;[
+<!ATTLIST package
+		%common.attrib;
+		%package.role.attrib;
+		%local.package.attrib;
+>
+<!--end of package.attlist-->]]>
+<!--end of package.module-->]]>
+
+<!ENTITY % co.module "INCLUDE">
+<![%co.module;[
+<!ENTITY % local.co.attrib "">
+<!-- CO is a callout area of the LineColumn unit type (a single character
+     position); the position is directly indicated by the location of CO. -->
+<!ENTITY % co.role.attrib "%role.attrib;">
+
+<!ENTITY % co.element "INCLUDE">
+<![%co.element;[
+<!ELEMENT co %ho; EMPTY>
+<!--end of co.element-->]]>
+
+<!-- bug number/symbol override or initialization -->
+<!-- to any related information -->
+
+
+<!ENTITY % co.attlist "INCLUDE">
+<![%co.attlist;[
+<!ATTLIST co
+		%label.attrib;
+		%linkends.attrib;
+		%idreq.common.attrib;
+		%co.role.attrib;
+		%local.co.attrib;
+>
+<!--end of co.attlist-->]]>
+<!--end of co.module-->]]>
+
+<!ENTITY % coref.module "INCLUDE">
+<![%coref.module;[
+<!ENTITY % local.coref.attrib "">
+<!-- COREF is a reference to a CO -->
+<!ENTITY % coref.role.attrib "%role.attrib;">
+
+<!ENTITY % coref.element "INCLUDE">
+<![%coref.element;[
+<!ELEMENT coref %ho; EMPTY>
+<!--end of coref.element-->]]>
+
+<!-- bug number/symbol override or initialization -->
+<!-- to any related information -->
+
+<!ENTITY % coref.attlist "INCLUDE">
+<![%coref.attlist;[
+<!ATTLIST coref
+		%label.attrib;
+		%linkendreq.attrib;
+		%common.attrib;
+		%coref.role.attrib;
+		%local.coref.attrib;
+>
+<!--end of coref.attlist-->]]>
+<!--end of coref.module-->]]>
+
+<!ENTITY % command.module "INCLUDE">
+<![%command.module;[
+<!ENTITY % local.command.attrib "">
+<!ENTITY % command.role.attrib "%role.attrib;">
+
+<!ENTITY % command.element "INCLUDE">
+<![%command.element;[
+<!ELEMENT command %ho; (%cptr.char.mix;)*>
+<!--end of command.element-->]]>
+
+<!ENTITY % command.attlist "INCLUDE">
+<![%command.attlist;[
+<!ATTLIST command
+		%moreinfo.attrib;
+		%common.attrib;
+		%command.role.attrib;
+		%local.command.attrib;
+>
+<!--end of command.attlist-->]]>
+<!--end of command.module-->]]>
+
+<!ENTITY % computeroutput.module "INCLUDE">
+<![%computeroutput.module;[
+<!ENTITY % local.computeroutput.attrib "">
+<!ENTITY % computeroutput.role.attrib "%role.attrib;">
+
+<!ENTITY % computeroutput.element "INCLUDE">
+<![%computeroutput.element;[
+<!ELEMENT computeroutput %ho; (%cptr.char.mix;|co)*>
+<!--end of computeroutput.element-->]]>
+
+<!ENTITY % computeroutput.attlist "INCLUDE">
+<![%computeroutput.attlist;[
+<!ATTLIST computeroutput
+		%moreinfo.attrib;
+		%common.attrib;
+		%computeroutput.role.attrib;
+		%local.computeroutput.attrib;
+>
+<!--end of computeroutput.attlist-->]]>
+<!--end of computeroutput.module-->]]>
+
+<!ENTITY % database.module "INCLUDE">
+<![%database.module;[
+<!ENTITY % local.database.attrib "">
+<!ENTITY % database.role.attrib "%role.attrib;">
+
+<!ENTITY % database.element "INCLUDE">
+<![%database.element;[
+<!ELEMENT database %ho; (%cptr.char.mix;)*>
+<!--end of database.element-->]]>
+
+<!-- Class: Type of database the element names; no default -->
+
+
+<!ENTITY % database.attlist "INCLUDE">
+<![%database.attlist;[
+<!ATTLIST database
+		class 		(name
+				|table
+				|field
+				|key1
+				|key2
+				|record
+                                |index
+                                |view
+                                |primarykey
+                                |secondarykey
+                                |foreignkey
+                                |altkey
+                                |procedure
+                                |datatype
+                                |constraint
+                                |rule
+                                |user
+                                |group)	#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%database.role.attrib;
+		%local.database.attrib;
+>
+<!--end of database.attlist-->]]>
+<!--end of database.module-->]]>
+
+<!ENTITY % email.module "INCLUDE">
+<![%email.module;[
+<!ENTITY % local.email.attrib "">
+<!ENTITY % email.role.attrib "%role.attrib;">
+
+<!ENTITY % email.element "INCLUDE">
+<![%email.element;[
+<!ELEMENT email %ho; (%docinfo.char.mix;)*>
+<!--end of email.element-->]]>
+
+<!ENTITY % email.attlist "INCLUDE">
+<![%email.attlist;[
+<!ATTLIST email
+		%common.attrib;
+		%email.role.attrib;
+		%local.email.attrib;
+>
+<!--end of email.attlist-->]]>
+<!--end of email.module-->]]>
+
+<!ENTITY % envar.module "INCLUDE">
+<![%envar.module;[
+<!ENTITY % local.envar.attrib "">
+<!ENTITY % envar.role.attrib "%role.attrib;">
+
+<!ENTITY % envar.element "INCLUDE">
+<![%envar.element;[
+<!ELEMENT envar %ho; (%smallcptr.char.mix;)*>
+<!--end of envar.element-->]]>
+
+<!ENTITY % envar.attlist "INCLUDE">
+<![%envar.attlist;[
+<!ATTLIST envar
+		%common.attrib;
+		%envar.role.attrib;
+		%local.envar.attrib;
+>
+<!--end of envar.attlist-->]]>
+<!--end of envar.module-->]]>
+
+
+<!ENTITY % errorcode.module "INCLUDE">
+<![%errorcode.module;[
+<!ENTITY % local.errorcode.attrib "">
+<!ENTITY % errorcode.role.attrib "%role.attrib;">
+
+<!ENTITY % errorcode.element "INCLUDE">
+<![%errorcode.element;[
+<!ELEMENT errorcode %ho; (%smallcptr.char.mix;)*>
+<!--end of errorcode.element-->]]>
+
+<!ENTITY % errorcode.attlist "INCLUDE">
+<![%errorcode.attlist;[
+<!ATTLIST errorcode
+		%moreinfo.attrib;
+		%common.attrib;
+		%errorcode.role.attrib;
+		%local.errorcode.attrib;
+>
+<!--end of errorcode.attlist-->]]>
+<!--end of errorcode.module-->]]>
+
+<!ENTITY % errorname.module "INCLUDE">
+<![%errorname.module;[
+<!ENTITY % local.errorname.attrib "">
+<!ENTITY % errorname.role.attrib "%role.attrib;">
+
+<!ENTITY % errorname.element "INCLUDE">
+<![%errorname.element;[
+<!ELEMENT errorname %ho; (%smallcptr.char.mix;)*>
+<!--end of errorname.element-->]]>
+
+<!ENTITY % errorname.attlist "INCLUDE">
+<![%errorname.attlist;[
+<!ATTLIST errorname
+		%common.attrib;
+		%errorname.role.attrib;
+		%local.errorname.attrib;
+>
+<!--end of errorname.attlist-->]]>
+<!--end of errorname.module-->]]>
+
+<!ENTITY % errortext.module "INCLUDE">
+<![%errortext.module;[
+<!ENTITY % local.errortext.attrib "">
+<!ENTITY % errortext.role.attrib "%role.attrib;">
+
+<!ENTITY % errortext.element "INCLUDE">
+<![%errortext.element;[
+<!ELEMENT errortext %ho; (%smallcptr.char.mix;)*>
+<!--end of errortext.element-->]]>
+
+<!ENTITY % errortext.attlist "INCLUDE">
+<![%errortext.attlist;[
+<!ATTLIST errortext
+		%common.attrib;
+		%errortext.role.attrib;
+		%local.errortext.attrib;
+>
+<!--end of errortext.attlist-->]]>
+<!--end of errortext.module-->]]>
+
+<!ENTITY % errortype.module "INCLUDE">
+<![%errortype.module;[
+<!ENTITY % local.errortype.attrib "">
+<!ENTITY % errortype.role.attrib "%role.attrib;">
+
+<!ENTITY % errortype.element "INCLUDE">
+<![%errortype.element;[
+<!ELEMENT errortype %ho; (%smallcptr.char.mix;)*>
+<!--end of errortype.element-->]]>
+
+<!ENTITY % errortype.attlist "INCLUDE">
+<![%errortype.attlist;[
+<!ATTLIST errortype
+		%common.attrib;
+		%errortype.role.attrib;
+		%local.errortype.attrib;
+>
+<!--end of errortype.attlist-->]]>
+<!--end of errortype.module-->]]>
+
+<!ENTITY % filename.module "INCLUDE">
+<![%filename.module;[
+<!ENTITY % local.filename.attrib "">
+<!ENTITY % filename.role.attrib "%role.attrib;">
+
+<!ENTITY % filename.element "INCLUDE">
+<![%filename.element;[
+<!ELEMENT filename %ho; (%cptr.char.mix;)*>
+<!--end of filename.element-->]]>
+
+<!-- Class: Type of filename the element names; no default -->
+<!-- Path: Search path (possibly system-specific) in which
+		file can be found -->
+
+
+<!ENTITY % filename.attlist "INCLUDE">
+<![%filename.attlist;[
+<!ATTLIST filename
+		class		(headerfile
+                                |partition
+                                |devicefile
+                                |libraryfile
+                                |directory
+                                |extension
+				|symlink)       #IMPLIED
+		path		CDATA		#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%filename.role.attrib;
+		%local.filename.attrib;
+>
+<!--end of filename.attlist-->]]>
+<!--end of filename.module-->]]>
+
+<!ENTITY % function.module "INCLUDE">
+<![%function.module;[
+<!ENTITY % local.function.attrib "">
+<!ENTITY % function.role.attrib "%role.attrib;">
+
+<!ENTITY % function.element "INCLUDE">
+<![%function.element;[
+<!ELEMENT function %ho; (%cptr.char.mix;)*>
+<!--end of function.element-->]]>
+
+<!ENTITY % function.attlist "INCLUDE">
+<![%function.attlist;[
+<!ATTLIST function
+		%moreinfo.attrib;
+		%common.attrib;
+		%function.role.attrib;
+		%local.function.attrib;
+>
+<!--end of function.attlist-->]]>
+<!--end of function.module-->]]>
+
+<!ENTITY % guibutton.module "INCLUDE">
+<![%guibutton.module;[
+<!ENTITY % local.guibutton.attrib "">
+<!ENTITY % guibutton.role.attrib "%role.attrib;">
+
+<!ENTITY % guibutton.element "INCLUDE">
+<![%guibutton.element;[
+<!ELEMENT guibutton %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guibutton.element-->]]>
+
+<!ENTITY % guibutton.attlist "INCLUDE">
+<![%guibutton.attlist;[
+<!ATTLIST guibutton
+		%moreinfo.attrib;
+		%common.attrib;
+		%guibutton.role.attrib;
+		%local.guibutton.attrib;
+>
+<!--end of guibutton.attlist-->]]>
+<!--end of guibutton.module-->]]>
+
+<!ENTITY % guiicon.module "INCLUDE">
+<![%guiicon.module;[
+<!ENTITY % local.guiicon.attrib "">
+<!ENTITY % guiicon.role.attrib "%role.attrib;">
+
+<!ENTITY % guiicon.element "INCLUDE">
+<![%guiicon.element;[
+<!ELEMENT guiicon %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guiicon.element-->]]>
+
+<!ENTITY % guiicon.attlist "INCLUDE">
+<![%guiicon.attlist;[
+<!ATTLIST guiicon
+		%moreinfo.attrib;
+		%common.attrib;
+		%guiicon.role.attrib;
+		%local.guiicon.attrib;
+>
+<!--end of guiicon.attlist-->]]>
+<!--end of guiicon.module-->]]>
+
+<!ENTITY % guilabel.module "INCLUDE">
+<![%guilabel.module;[
+<!ENTITY % local.guilabel.attrib "">
+<!ENTITY % guilabel.role.attrib "%role.attrib;">
+
+<!ENTITY % guilabel.element "INCLUDE">
+<![%guilabel.element;[
+<!ELEMENT guilabel %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guilabel.element-->]]>
+
+<!ENTITY % guilabel.attlist "INCLUDE">
+<![%guilabel.attlist;[
+<!ATTLIST guilabel
+		%moreinfo.attrib;
+		%common.attrib;
+		%guilabel.role.attrib;
+		%local.guilabel.attrib;
+>
+<!--end of guilabel.attlist-->]]>
+<!--end of guilabel.module-->]]>
+
+<!ENTITY % guimenu.module "INCLUDE">
+<![%guimenu.module;[
+<!ENTITY % local.guimenu.attrib "">
+<!ENTITY % guimenu.role.attrib "%role.attrib;">
+
+<!ENTITY % guimenu.element "INCLUDE">
+<![%guimenu.element;[
+<!ELEMENT guimenu %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guimenu.element-->]]>
+
+<!ENTITY % guimenu.attlist "INCLUDE">
+<![%guimenu.attlist;[
+<!ATTLIST guimenu
+		%moreinfo.attrib;
+		%common.attrib;
+		%guimenu.role.attrib;
+		%local.guimenu.attrib;
+>
+<!--end of guimenu.attlist-->]]>
+<!--end of guimenu.module-->]]>
+
+<!ENTITY % guimenuitem.module "INCLUDE">
+<![%guimenuitem.module;[
+<!ENTITY % local.guimenuitem.attrib "">
+<!ENTITY % guimenuitem.role.attrib "%role.attrib;">
+
+<!ENTITY % guimenuitem.element "INCLUDE">
+<![%guimenuitem.element;[
+<!ELEMENT guimenuitem %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guimenuitem.element-->]]>
+
+<!ENTITY % guimenuitem.attlist "INCLUDE">
+<![%guimenuitem.attlist;[
+<!ATTLIST guimenuitem
+		%moreinfo.attrib;
+		%common.attrib;
+		%guimenuitem.role.attrib;
+		%local.guimenuitem.attrib;
+>
+<!--end of guimenuitem.attlist-->]]>
+<!--end of guimenuitem.module-->]]>
+
+<!ENTITY % guisubmenu.module "INCLUDE">
+<![%guisubmenu.module;[
+<!ENTITY % local.guisubmenu.attrib "">
+<!ENTITY % guisubmenu.role.attrib "%role.attrib;">
+
+<!ENTITY % guisubmenu.element "INCLUDE">
+<![%guisubmenu.element;[
+<!ELEMENT guisubmenu %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guisubmenu.element-->]]>
+
+<!ENTITY % guisubmenu.attlist "INCLUDE">
+<![%guisubmenu.attlist;[
+<!ATTLIST guisubmenu
+		%moreinfo.attrib;
+		%common.attrib;
+		%guisubmenu.role.attrib;
+		%local.guisubmenu.attrib;
+>
+<!--end of guisubmenu.attlist-->]]>
+<!--end of guisubmenu.module-->]]>
+
+<!ENTITY % hardware.module "INCLUDE">
+<![%hardware.module;[
+<!ENTITY % local.hardware.attrib "">
+<!ENTITY % hardware.role.attrib "%role.attrib;">
+
+<!ENTITY % hardware.element "INCLUDE">
+<![%hardware.element;[
+<!ELEMENT hardware %ho; (%cptr.char.mix;)*>
+<!--end of hardware.element-->]]>
+
+<!ENTITY % hardware.attlist "INCLUDE">
+<![%hardware.attlist;[
+<!ATTLIST hardware
+		%moreinfo.attrib;
+		%common.attrib;
+		%hardware.role.attrib;
+		%local.hardware.attrib;
+>
+<!--end of hardware.attlist-->]]>
+<!--end of hardware.module-->]]>
+
+<!ENTITY % interface.module "INCLUDE">
+<![%interface.module;[
+<!ENTITY % local.interface.attrib "">
+<!ENTITY % interface.role.attrib "%role.attrib;">
+
+<!ENTITY % interface.element "INCLUDE">
+<![%interface.element;[
+<!ELEMENT interface %ho; (%smallcptr.char.mix;|accel)*>
+<!--end of interface.element-->]]>
+
+<!-- Class: Type of the Interface item; no default -->
+
+
+<!ENTITY % interface.attlist "INCLUDE">
+<![%interface.attlist;[
+<!ATTLIST interface
+		%moreinfo.attrib;
+		%common.attrib;
+		%interface.role.attrib;
+		%local.interface.attrib;
+>
+<!--end of interface.attlist-->]]>
+<!--end of interface.module-->]]>
+
+<!ENTITY % keycap.module "INCLUDE">
+<![%keycap.module;[
+<!ENTITY % local.keycap.attrib "">
+<!ENTITY % keycap.role.attrib "%role.attrib;">
+
+<!ENTITY % keycap.element "INCLUDE">
+<![%keycap.element;[
+<!ELEMENT keycap %ho; (%cptr.char.mix;)*>
+<!--end of keycap.element-->]]>
+
+<!ENTITY % keycap.attlist "INCLUDE">
+<![%keycap.attlist;[
+<!ATTLIST keycap
+		function	(alt
+				|control
+				|shift
+				|meta
+				|escape
+				|enter
+				|tab
+				|backspace
+				|command
+				|option
+				|space
+				|delete
+				|insert
+				|up
+				|down
+				|left
+				|right
+				|home
+				|end
+				|pageup
+				|pagedown
+				|other)		#IMPLIED
+		otherfunction	CDATA		#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%keycap.role.attrib;
+		%local.keycap.attrib;
+>
+<!--end of keycap.attlist-->]]>
+<!--end of keycap.module-->]]>
+
+<!ENTITY % keycode.module "INCLUDE">
+<![%keycode.module;[
+<!ENTITY % local.keycode.attrib "">
+<!ENTITY % keycode.role.attrib "%role.attrib;">
+
+<!ENTITY % keycode.element "INCLUDE">
+<![%keycode.element;[
+<!ELEMENT keycode %ho; (%smallcptr.char.mix;)*>
+<!--end of keycode.element-->]]>
+
+<!ENTITY % keycode.attlist "INCLUDE">
+<![%keycode.attlist;[
+<!ATTLIST keycode
+		%common.attrib;
+		%keycode.role.attrib;
+		%local.keycode.attrib;
+>
+<!--end of keycode.attlist-->]]>
+<!--end of keycode.module-->]]>
+
+<!ENTITY % keycombo.module "INCLUDE">
+<![%keycombo.module;[
+<!ENTITY % local.keycombo.attrib "">
+<!ENTITY % keycombo.role.attrib "%role.attrib;">
+
+<!ENTITY % keycombo.element "INCLUDE">
+<![%keycombo.element;[
+<!ELEMENT keycombo %ho; ((keycap|keycombo|keysym|mousebutton)+)>
+<!--end of keycombo.element-->]]>
+
+<!ENTITY % keycombo.attlist "INCLUDE">
+<![%keycombo.attlist;[
+<!ATTLIST keycombo
+		%keyaction.attrib;
+		%moreinfo.attrib;
+		%common.attrib;
+		%keycombo.role.attrib;
+		%local.keycombo.attrib;
+>
+<!--end of keycombo.attlist-->]]>
+<!--end of keycombo.module-->]]>
+
+<!ENTITY % keysym.module "INCLUDE">
+<![%keysym.module;[
+<!ENTITY % local.keysym.attrib "">
+<!ENTITY % keysysm.role.attrib "%role.attrib;">
+
+<!ENTITY % keysym.element "INCLUDE">
+<![%keysym.element;[
+<!ELEMENT keysym %ho; (%smallcptr.char.mix;)*>
+<!--end of keysym.element-->]]>
+
+<!ENTITY % keysym.attlist "INCLUDE">
+<![%keysym.attlist;[
+<!ATTLIST keysym
+		%common.attrib;
+		%keysysm.role.attrib;
+		%local.keysym.attrib;
+>
+<!--end of keysym.attlist-->]]>
+<!--end of keysym.module-->]]>
+
+<!ENTITY % lineannotation.module "INCLUDE">
+<![%lineannotation.module;[
+<!ENTITY % local.lineannotation.attrib "">
+<!ENTITY % lineannotation.role.attrib "%role.attrib;">
+
+<!ENTITY % lineannotation.element "INCLUDE">
+<![%lineannotation.element;[
+<!ELEMENT lineannotation %ho; (%para.char.mix;)*>
+<!--end of lineannotation.element-->]]>
+
+<!ENTITY % lineannotation.attlist "INCLUDE">
+<![%lineannotation.attlist;[
+<!ATTLIST lineannotation
+		%common.attrib;
+		%lineannotation.role.attrib;
+		%local.lineannotation.attrib;
+>
+<!--end of lineannotation.attlist-->]]>
+<!--end of lineannotation.module-->]]>
+
+<!ENTITY % literal.module "INCLUDE">
+<![%literal.module;[
+<!ENTITY % local.literal.attrib "">
+<!ENTITY % literal.role.attrib "%role.attrib;">
+
+<!ENTITY % literal.element "INCLUDE">
+<![%literal.element;[
+<!ELEMENT literal %ho; (%cptr.char.mix;)*>
+<!--end of literal.element-->]]>
+
+<!ENTITY % literal.attlist "INCLUDE">
+<![%literal.attlist;[
+<!ATTLIST literal
+		%moreinfo.attrib;
+		%common.attrib;
+		%literal.role.attrib;
+		%local.literal.attrib;
+>
+<!--end of literal.attlist-->]]>
+<!--end of literal.module-->]]>
+
+<!ENTITY % code.module "INCLUDE">
+<![%code.module;[
+<!ENTITY % local.code.attrib "">
+<!ENTITY % code.role.attrib "%role.attrib;">
+
+<!ENTITY % code.element "INCLUDE">
+<![%code.element;[
+<!ELEMENT code %ho; (%cptr.char.mix;)*>
+<!--end of code.element-->]]>
+
+<!ENTITY % code.attlist "INCLUDE">
+<![%code.attlist;[
+<!ATTLIST code
+		language	CDATA	#IMPLIED
+		%common.attrib;
+		%code.role.attrib;
+		%local.code.attrib;
+>
+<!--end of code.attlist-->]]>
+<!--end of code.module-->]]>
+
+<!ENTITY % constant.module "INCLUDE">
+<![ %constant.module; [
+<!ENTITY % local.constant.attrib "">
+<!ENTITY % constant.role.attrib "%role.attrib;">
+
+<!ENTITY % constant.element "INCLUDE">
+<![ %constant.element; [
+<!ELEMENT constant %ho; (%smallcptr.char.mix;)*>
+<!--end of constant.element-->]]>
+
+<!ENTITY % constant.attlist "INCLUDE">
+<![ %constant.attlist; [
+<!ATTLIST constant
+		class	(limit)		#IMPLIED
+		%common.attrib;
+		%constant.role.attrib;
+		%local.constant.attrib;
+>
+<!--end of constant.attlist-->]]>
+<!--end of constant.module-->]]>
+
+<!ENTITY % varname.module "INCLUDE">
+<![ %varname.module; [
+<!ENTITY % local.varname.attrib "">
+<!ENTITY % varname.role.attrib "%role.attrib;">
+
+<!ENTITY % varname.element "INCLUDE">
+<![ %varname.element; [
+<!ELEMENT varname %ho; (%smallcptr.char.mix;)*>
+<!--end of varname.element-->]]>
+
+<!ENTITY % varname.attlist "INCLUDE">
+<![ %varname.attlist; [
+<!ATTLIST varname
+		%common.attrib;
+		%varname.role.attrib;
+		%local.varname.attrib;
+>
+<!--end of varname.attlist-->]]>
+<!--end of varname.module-->]]>
+
+<!ENTITY % markup.module "INCLUDE">
+<![%markup.module;[
+<!ENTITY % local.markup.attrib "">
+<!ENTITY % markup.role.attrib "%role.attrib;">
+
+<!ENTITY % markup.element "INCLUDE">
+<![%markup.element;[
+<!ELEMENT markup %ho; (%smallcptr.char.mix;)*>
+<!--end of markup.element-->]]>
+
+<!ENTITY % markup.attlist "INCLUDE">
+<![%markup.attlist;[
+<!ATTLIST markup
+		%common.attrib;
+		%markup.role.attrib;
+		%local.markup.attrib;
+>
+<!--end of markup.attlist-->]]>
+<!--end of markup.module-->]]>
+
+<!ENTITY % medialabel.module "INCLUDE">
+<![%medialabel.module;[
+<!ENTITY % local.medialabel.attrib "">
+<!ENTITY % medialabel.role.attrib "%role.attrib;">
+
+<!ENTITY % medialabel.element "INCLUDE">
+<![%medialabel.element;[
+<!ELEMENT medialabel %ho; (%smallcptr.char.mix;)*>
+<!--end of medialabel.element-->]]>
+
+<!-- Class: Type of medium named by the element; no default -->
+
+
+<!ENTITY % medialabel.attlist "INCLUDE">
+<![%medialabel.attlist;[
+<!ATTLIST medialabel
+		class 		(cartridge
+				|cdrom
+				|disk
+				|tape)		#IMPLIED
+		%common.attrib;
+		%medialabel.role.attrib;
+		%local.medialabel.attrib;
+>
+<!--end of medialabel.attlist-->]]>
+<!--end of medialabel.module-->]]>
+
+<!ENTITY % menuchoice.content.module "INCLUDE">
+<![%menuchoice.content.module;[
+<!ENTITY % menuchoice.module "INCLUDE">
+<![%menuchoice.module;[
+<!ENTITY % local.menuchoice.attrib "">
+<!ENTITY % menuchoice.role.attrib "%role.attrib;">
+
+<!ENTITY % menuchoice.element "INCLUDE">
+<![%menuchoice.element;[
+<!ELEMENT menuchoice %ho; (shortcut?, (guibutton|guiicon|guilabel
+		|guimenu|guimenuitem|guisubmenu|interface)+)>
+<!--end of menuchoice.element-->]]>
+
+<!ENTITY % menuchoice.attlist "INCLUDE">
+<![%menuchoice.attlist;[
+<!ATTLIST menuchoice
+		%moreinfo.attrib;
+		%common.attrib;
+		%menuchoice.role.attrib;
+		%local.menuchoice.attrib;
+>
+<!--end of menuchoice.attlist-->]]>
+<!--end of menuchoice.module-->]]>
+
+<!ENTITY % shortcut.module "INCLUDE">
+<![%shortcut.module;[
+<!-- See also KeyCombo -->
+<!ENTITY % local.shortcut.attrib "">
+<!ENTITY % shortcut.role.attrib "%role.attrib;">
+
+<!ENTITY % shortcut.element "INCLUDE">
+<![%shortcut.element;[
+<!ELEMENT shortcut %ho; ((keycap|keycombo|keysym|mousebutton)+)>
+<!--end of shortcut.element-->]]>
+
+<!ENTITY % shortcut.attlist "INCLUDE">
+<![%shortcut.attlist;[
+<!ATTLIST shortcut
+		%keyaction.attrib;
+		%moreinfo.attrib;
+		%common.attrib;
+		%shortcut.role.attrib;
+		%local.shortcut.attrib;
+>
+<!--end of shortcut.attlist-->]]>
+<!--end of shortcut.module-->]]>
+<!--end of menuchoice.content.module-->]]>
+
+<!ENTITY % mousebutton.module "INCLUDE">
+<![%mousebutton.module;[
+<!ENTITY % local.mousebutton.attrib "">
+<!ENTITY % mousebutton.role.attrib "%role.attrib;">
+
+<!ENTITY % mousebutton.element "INCLUDE">
+<![%mousebutton.element;[
+<!ELEMENT mousebutton %ho; (%smallcptr.char.mix;)*>
+<!--end of mousebutton.element-->]]>
+
+<!ENTITY % mousebutton.attlist "INCLUDE">
+<![%mousebutton.attlist;[
+<!ATTLIST mousebutton
+		%moreinfo.attrib;
+		%common.attrib;
+		%mousebutton.role.attrib;
+		%local.mousebutton.attrib;
+>
+<!--end of mousebutton.attlist-->]]>
+<!--end of mousebutton.module-->]]>
+
+<!ENTITY % msgtext.module "INCLUDE">
+<![%msgtext.module;[
+<!ENTITY % local.msgtext.attrib "">
+<!ENTITY % msgtext.role.attrib "%role.attrib;">
+
+<!ENTITY % msgtext.element "INCLUDE">
+<![%msgtext.element;[
+<!ELEMENT msgtext %ho; ((%component.mix;)+)>
+<!--end of msgtext.element-->]]>
+
+<!ENTITY % msgtext.attlist "INCLUDE">
+<![%msgtext.attlist;[
+<!ATTLIST msgtext
+		%common.attrib;
+		%msgtext.role.attrib;
+		%local.msgtext.attrib;
+>
+<!--end of msgtext.attlist-->]]>
+<!--end of msgtext.module-->]]>
+
+<!ENTITY % option.module "INCLUDE">
+<![%option.module;[
+<!ENTITY % local.option.attrib "">
+<!ENTITY % option.role.attrib "%role.attrib;">
+
+<!ENTITY % option.element "INCLUDE">
+<![%option.element;[
+<!ELEMENT option %ho; (%cptr.char.mix;)*>
+<!--end of option.element-->]]>
+
+<!ENTITY % option.attlist "INCLUDE">
+<![%option.attlist;[
+<!ATTLIST option
+		%common.attrib;
+		%option.role.attrib;
+		%local.option.attrib;
+>
+<!--end of option.attlist-->]]>
+<!--end of option.module-->]]>
+
+<!ENTITY % optional.module "INCLUDE">
+<![%optional.module;[
+<!ENTITY % local.optional.attrib "">
+<!ENTITY % optional.role.attrib "%role.attrib;">
+
+<!ENTITY % optional.element "INCLUDE">
+<![%optional.element;[
+<!ELEMENT optional %ho; (%cptr.char.mix;)*>
+<!--end of optional.element-->]]>
+
+<!ENTITY % optional.attlist "INCLUDE">
+<![%optional.attlist;[
+<!ATTLIST optional
+		%common.attrib;
+		%optional.role.attrib;
+		%local.optional.attrib;
+>
+<!--end of optional.attlist-->]]>
+<!--end of optional.module-->]]>
+
+<!ENTITY % parameter.module "INCLUDE">
+<![%parameter.module;[
+<!ENTITY % local.parameter.attrib "">
+<!ENTITY % parameter.role.attrib "%role.attrib;">
+
+<!ENTITY % parameter.element "INCLUDE">
+<![%parameter.element;[
+<!ELEMENT parameter %ho; (%cptr.char.mix;)*>
+<!--end of parameter.element-->]]>
+
+<!-- Class: Type of the Parameter; no default -->
+
+
+<!ENTITY % parameter.attlist "INCLUDE">
+<![%parameter.attlist;[
+<!ATTLIST parameter
+		class 		(command
+				|function
+				|option)	#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%parameter.role.attrib;
+		%local.parameter.attrib;
+>
+<!--end of parameter.attlist-->]]>
+<!--end of parameter.module-->]]>
+
+<!ENTITY % prompt.module "INCLUDE">
+<![%prompt.module;[
+<!ENTITY % local.prompt.attrib "">
+<!ENTITY % prompt.role.attrib "%role.attrib;">
+
+<!ENTITY % prompt.element "INCLUDE">
+<![%prompt.element;[
+<!ELEMENT prompt %ho; (%smallcptr.char.mix;|co)*>
+<!--end of prompt.element-->]]>
+
+<!ENTITY % prompt.attlist "INCLUDE">
+<![%prompt.attlist;[
+<!ATTLIST prompt
+		%moreinfo.attrib;
+		%common.attrib;
+		%prompt.role.attrib;
+		%local.prompt.attrib;
+>
+<!--end of prompt.attlist-->]]>
+<!--end of prompt.module-->]]>
+
+<!ENTITY % property.module "INCLUDE">
+<![%property.module;[
+<!ENTITY % local.property.attrib "">
+<!ENTITY % property.role.attrib "%role.attrib;">
+
+<!ENTITY % property.element "INCLUDE">
+<![%property.element;[
+<!ELEMENT property %ho; (%cptr.char.mix;)*>
+<!--end of property.element-->]]>
+
+<!ENTITY % property.attlist "INCLUDE">
+<![%property.attlist;[
+<!ATTLIST property
+		%moreinfo.attrib;
+		%common.attrib;
+		%property.role.attrib;
+		%local.property.attrib;
+>
+<!--end of property.attlist-->]]>
+<!--end of property.module-->]]>
+
+<!ENTITY % replaceable.module "INCLUDE">
+<![%replaceable.module;[
+<!ENTITY % local.replaceable.attrib "">
+<!ENTITY % replaceable.role.attrib "%role.attrib;">
+
+<!ENTITY % replaceable.element "INCLUDE">
+<![%replaceable.element;[
+<!ELEMENT replaceable %ho; (#PCDATA
+		| %link.char.class;
+		| optional
+		| %base.char.class;
+		| %other.char.class;
+		| inlinegraphic
+                | inlinemediaobject
+		| co)*>
+<!--end of replaceable.element-->]]>
+
+<!-- Class: Type of information the element represents; no
+		default -->
+
+
+<!ENTITY % replaceable.attlist "INCLUDE">
+<![%replaceable.attlist;[
+<!ATTLIST replaceable
+		class		(command
+				|function
+				|option
+				|parameter)	#IMPLIED
+		%common.attrib;
+		%replaceable.role.attrib;
+		%local.replaceable.attrib;
+>
+<!--end of replaceable.attlist-->]]>
+<!--end of replaceable.module-->]]>
+
+<!ENTITY % returnvalue.module "INCLUDE">
+<![%returnvalue.module;[
+<!ENTITY % local.returnvalue.attrib "">
+<!ENTITY % returnvalue.role.attrib "%role.attrib;">
+
+<!ENTITY % returnvalue.element "INCLUDE">
+<![%returnvalue.element;[
+<!ELEMENT returnvalue %ho; (%smallcptr.char.mix;)*>
+<!--end of returnvalue.element-->]]>
+
+<!ENTITY % returnvalue.attlist "INCLUDE">
+<![%returnvalue.attlist;[
+<!ATTLIST returnvalue
+		%common.attrib;
+		%returnvalue.role.attrib;
+		%local.returnvalue.attrib;
+>
+<!--end of returnvalue.attlist-->]]>
+<!--end of returnvalue.module-->]]>
+
+<!ENTITY % sgmltag.module "INCLUDE">
+<![%sgmltag.module;[
+<!ENTITY % local.sgmltag.attrib "">
+<!ENTITY % sgmltag.role.attrib "%role.attrib;">
+
+<!ENTITY % sgmltag.element "INCLUDE">
+<![%sgmltag.element;[
+<!ELEMENT sgmltag %ho; (%smallcptr.char.mix;)*>
+<!--end of sgmltag.element-->]]>
+
+<!-- Class: Type of SGML construct the element names; no default -->
+
+
+<!ENTITY % sgmltag.attlist "INCLUDE">
+<![%sgmltag.attlist;[
+<!ATTLIST sgmltag
+		class 		(attribute
+				|attvalue
+				|element
+				|endtag
+                                |emptytag
+				|genentity
+				|numcharref
+				|paramentity
+				|pi
+                                |xmlpi
+				|starttag
+				|sgmlcomment
+                                |prefix
+                                |namespace
+                                |localname)	#IMPLIED
+		namespace	CDATA		#IMPLIED
+		%common.attrib;
+		%sgmltag.role.attrib;
+		%local.sgmltag.attrib;
+>
+<!--end of sgmltag.attlist-->]]>
+<!--end of sgmltag.module-->]]>
+
+<!ENTITY % structfield.module "INCLUDE">
+<![%structfield.module;[
+<!ENTITY % local.structfield.attrib "">
+<!ENTITY % structfield.role.attrib "%role.attrib;">
+
+<!ENTITY % structfield.element "INCLUDE">
+<![%structfield.element;[
+<!ELEMENT structfield %ho; (%smallcptr.char.mix;)*>
+<!--end of structfield.element-->]]>
+
+<!ENTITY % structfield.attlist "INCLUDE">
+<![%structfield.attlist;[
+<!ATTLIST structfield
+		%common.attrib;
+		%structfield.role.attrib;
+		%local.structfield.attrib;
+>
+<!--end of structfield.attlist-->]]>
+<!--end of structfield.module-->]]>
+
+<!ENTITY % structname.module "INCLUDE">
+<![%structname.module;[
+<!ENTITY % local.structname.attrib "">
+<!ENTITY % structname.role.attrib "%role.attrib;">
+
+<!ENTITY % structname.element "INCLUDE">
+<![%structname.element;[
+<!ELEMENT structname %ho; (%smallcptr.char.mix;)*>
+<!--end of structname.element-->]]>
+
+<!ENTITY % structname.attlist "INCLUDE">
+<![%structname.attlist;[
+<!ATTLIST structname
+		%common.attrib;
+		%structname.role.attrib;
+		%local.structname.attrib;
+>
+<!--end of structname.attlist-->]]>
+<!--end of structname.module-->]]>
+
+<!ENTITY % symbol.module "INCLUDE">
+<![%symbol.module;[
+<!ENTITY % local.symbol.attrib "">
+<!ENTITY % symbol.role.attrib "%role.attrib;">
+
+<!ENTITY % symbol.element "INCLUDE">
+<![%symbol.element;[
+<!ELEMENT symbol %ho; (%smallcptr.char.mix;)*>
+<!--end of symbol.element-->]]>
+
+<!-- Class: Type of symbol; no default -->
+
+
+<!ENTITY % symbol.attlist "INCLUDE">
+<![%symbol.attlist;[
+<!ATTLIST symbol
+		class		(limit)		#IMPLIED
+		%common.attrib;
+		%symbol.role.attrib;
+		%local.symbol.attrib;
+>
+<!--end of symbol.attlist-->]]>
+<!--end of symbol.module-->]]>
+
+<!ENTITY % systemitem.module "INCLUDE">
+<![%systemitem.module;[
+<!ENTITY % local.systemitem.attrib "">
+<!ENTITY % systemitem.role.attrib "%role.attrib;">
+
+<!ENTITY % systemitem.element "INCLUDE">
+<![%systemitem.element;[
+<!ELEMENT systemitem %ho; (%cptr.char.mix; | acronym | co)*>
+<!--end of systemitem.element-->]]>
+
+<!-- Class: Type of system item the element names; no default -->
+
+<!ENTITY % systemitem.attlist "INCLUDE">
+<![%systemitem.attlist;[
+<!ATTLIST systemitem
+		class	(constant
+                        |daemon
+			|domainname
+			|etheraddress
+			|event
+			|eventhandler
+			|filesystem
+			|fqdomainname
+			|groupname
+			|ipaddress
+			|library
+			|macro
+			|netmask
+			|newsgroup
+			|osname
+                        |protocol
+			|resource
+			|systemname
+			|username
+                        |process
+                        |server
+                        |service)	#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%systemitem.role.attrib;
+		%local.systemitem.attrib;
+>
+<!--end of systemitem.attlist-->]]>
+<!--end of systemitem.module-->]]>
+
+<!ENTITY % uri.module "INCLUDE">
+<![%uri.module;[
+<!ENTITY % local.uri.attrib "">
+<!ENTITY % uri.role.attrib "%role.attrib;">
+
+<!ENTITY % uri.element "INCLUDE">
+<![%uri.element;[
+<!ELEMENT uri %ho; (%smallcptr.char.mix;)*>
+<!--end of uri.element-->]]>
+
+<!-- Type: Type of URI; no default -->
+
+<!ENTITY % uri.attlist "INCLUDE">
+<![%uri.attlist;[
+<!ATTLIST uri
+		type	CDATA	#IMPLIED
+		%common.attrib;
+		%uri.role.attrib;
+		%local.uri.attrib;
+>
+<!--end of uri.attlist-->]]>
+<!--end of uri.module-->]]>
+
+<!ENTITY % token.module "INCLUDE">
+<![%token.module;[
+<!ENTITY % local.token.attrib "">
+<!ENTITY % token.role.attrib "%role.attrib;">
+
+<!ENTITY % token.element "INCLUDE">
+<![%token.element;[
+<!ELEMENT token %ho; (%smallcptr.char.mix;)*>
+<!--end of token.element-->]]>
+
+<!ENTITY % token.attlist "INCLUDE">
+<![%token.attlist;[
+<!ATTLIST token
+		%common.attrib;
+		%token.role.attrib;
+		%local.token.attrib;
+>
+<!--end of token.attlist-->]]>
+<!--end of token.module-->]]>
+
+<!ENTITY % type.module "INCLUDE">
+<![%type.module;[
+<!ENTITY % local.type.attrib "">
+<!ENTITY % type.role.attrib "%role.attrib;">
+
+<!ENTITY % type.element "INCLUDE">
+<![%type.element;[
+<!ELEMENT type %ho; (%smallcptr.char.mix;)*>
+<!--end of type.element-->]]>
+
+<!ENTITY % type.attlist "INCLUDE">
+<![%type.attlist;[
+<!ATTLIST type
+		%common.attrib;
+		%type.role.attrib;
+		%local.type.attrib;
+>
+<!--end of type.attlist-->]]>
+<!--end of type.module-->]]>
+
+<!ENTITY % userinput.module "INCLUDE">
+<![%userinput.module;[
+<!ENTITY % local.userinput.attrib "">
+<!ENTITY % userinput.role.attrib "%role.attrib;">
+
+<!ENTITY % userinput.element "INCLUDE">
+<![%userinput.element;[
+<!ELEMENT userinput %ho; (%cptr.char.mix;|co)*>
+<!--end of userinput.element-->]]>
+
+<!ENTITY % userinput.attlist "INCLUDE">
+<![%userinput.attlist;[
+<!ATTLIST userinput
+		%moreinfo.attrib;
+		%common.attrib;
+		%userinput.role.attrib;
+		%local.userinput.attrib;
+>
+<!--end of userinput.attlist-->]]>
+<!--end of userinput.module-->]]>
+
+<!-- General words and phrases ............................................ -->
+
+<!ENTITY % abbrev.module "INCLUDE">
+<![%abbrev.module;[
+<!ENTITY % local.abbrev.attrib "">
+<!ENTITY % abbrev.role.attrib "%role.attrib;">
+
+<!ENTITY % abbrev.element "INCLUDE">
+<![%abbrev.element;[
+<!ELEMENT abbrev %ho; (%word.char.mix;)*>
+<!--end of abbrev.element-->]]>
+
+<!ENTITY % abbrev.attlist "INCLUDE">
+<![%abbrev.attlist;[
+<!ATTLIST abbrev
+		%common.attrib;
+		%abbrev.role.attrib;
+		%local.abbrev.attrib;
+>
+<!--end of abbrev.attlist-->]]>
+<!--end of abbrev.module-->]]>
+
+<!ENTITY % acronym.module "INCLUDE">
+<![%acronym.module;[
+<!ENTITY % local.acronym.attrib "">
+<!ENTITY % acronym.role.attrib "%role.attrib;">
+
+<!ENTITY % acronym.element "INCLUDE">
+<![%acronym.element;[
+<!ELEMENT acronym %ho; (%word.char.mix;)*
+		%acronym.exclusion;>
+<!--end of acronym.element-->]]>
+
+<!ENTITY % acronym.attlist "INCLUDE">
+<![%acronym.attlist;[
+<!ATTLIST acronym
+		%common.attrib;
+		%acronym.role.attrib;
+		%local.acronym.attrib;
+>
+<!--end of acronym.attlist-->]]>
+<!--end of acronym.module-->]]>
+
+<!ENTITY % citation.module "INCLUDE">
+<![%citation.module;[
+<!ENTITY % local.citation.attrib "">
+<!ENTITY % citation.role.attrib "%role.attrib;">
+
+<!ENTITY % citation.element "INCLUDE">
+<![%citation.element;[
+<!ELEMENT citation %ho; (%para.char.mix;)*>
+<!--end of citation.element-->]]>
+
+<!ENTITY % citation.attlist "INCLUDE">
+<![%citation.attlist;[
+<!ATTLIST citation
+		%common.attrib;
+		%citation.role.attrib;
+		%local.citation.attrib;
+>
+<!--end of citation.attlist-->]]>
+<!--end of citation.module-->]]>
+
+<!ENTITY % citerefentry.module "INCLUDE">
+<![%citerefentry.module;[
+<!ENTITY % local.citerefentry.attrib "">
+<!ENTITY % citerefentry.role.attrib "%role.attrib;">
+
+<!ENTITY % citerefentry.element "INCLUDE">
+<![%citerefentry.element;[
+<!ELEMENT citerefentry %ho; (refentrytitle, manvolnum?)>
+<!--end of citerefentry.element-->]]>
+
+<!ENTITY % citerefentry.attlist "INCLUDE">
+<![%citerefentry.attlist;[
+<!ATTLIST citerefentry
+		%common.attrib;
+		%citerefentry.role.attrib;
+		%local.citerefentry.attrib;
+>
+<!--end of citerefentry.attlist-->]]>
+<!--end of citerefentry.module-->]]>
+
+<!ENTITY % refentrytitle.module "INCLUDE">
+<![%refentrytitle.module;[
+<!ENTITY % local.refentrytitle.attrib "">
+<!ENTITY % refentrytitle.role.attrib "%role.attrib;">
+
+<!ENTITY % refentrytitle.element "INCLUDE">
+<![%refentrytitle.element;[
+<!ELEMENT refentrytitle %ho; (%para.char.mix;)*>
+<!--end of refentrytitle.element-->]]>
+
+<!ENTITY % refentrytitle.attlist "INCLUDE">
+<![%refentrytitle.attlist;[
+<!ATTLIST refentrytitle
+		%common.attrib;
+		%refentrytitle.role.attrib;
+		%local.refentrytitle.attrib;
+>
+<!--end of refentrytitle.attlist-->]]>
+<!--end of refentrytitle.module-->]]>
+
+<!ENTITY % manvolnum.module "INCLUDE">
+<![%manvolnum.module;[
+<!ENTITY % local.manvolnum.attrib "">
+<!ENTITY % namvolnum.role.attrib "%role.attrib;">
+
+<!ENTITY % manvolnum.element "INCLUDE">
+<![%manvolnum.element;[
+<!ELEMENT manvolnum %ho; (%word.char.mix;)*>
+<!--end of manvolnum.element-->]]>
+
+<!ENTITY % manvolnum.attlist "INCLUDE">
+<![%manvolnum.attlist;[
+<!ATTLIST manvolnum
+		%common.attrib;
+		%namvolnum.role.attrib;
+		%local.manvolnum.attrib;
+>
+<!--end of manvolnum.attlist-->]]>
+<!--end of manvolnum.module-->]]>
+
+<!ENTITY % citetitle.module "INCLUDE">
+<![%citetitle.module;[
+<!ENTITY % local.citetitle.attrib "">
+<!ENTITY % citetitle.role.attrib "%role.attrib;">
+
+<!ENTITY % citetitle.element "INCLUDE">
+<![%citetitle.element;[
+<!ELEMENT citetitle %ho; (%para.char.mix;)*>
+<!--end of citetitle.element-->]]>
+
+<!-- Pubwork: Genre of published work cited; no default -->
+
+
+<!ENTITY % citetitle.attlist "INCLUDE">
+<![%citetitle.attlist;[
+<!ATTLIST citetitle
+		pubwork		(article
+				|book
+				|chapter
+				|part
+				|refentry
+				|section
+				|journal
+				|series
+				|set
+				|manuscript
+				|cdrom
+				|dvd
+				|wiki
+				|gopher
+				|bbs
+                                |emailmessage
+                                |webpage
+                                |newsposting)	#IMPLIED
+		%common.attrib;
+		%citetitle.role.attrib;
+		%local.citetitle.attrib;
+>
+<!--end of citetitle.attlist-->]]>
+<!--end of citetitle.module-->]]>
+
+<!ENTITY % emphasis.module "INCLUDE">
+<![%emphasis.module;[
+<!ENTITY % local.emphasis.attrib "">
+<!ENTITY % emphasis.role.attrib "%role.attrib;">
+
+<!ENTITY % emphasis.element "INCLUDE">
+<![%emphasis.element;[
+<!ELEMENT emphasis %ho; (%para.char.mix;)*>
+<!--end of emphasis.element-->]]>
+
+<!ENTITY % emphasis.attlist "INCLUDE">
+<![%emphasis.attlist;[
+<!ATTLIST emphasis
+		%common.attrib;
+		%emphasis.role.attrib;
+		%local.emphasis.attrib;
+>
+<!--end of emphasis.attlist-->]]>
+<!--end of emphasis.module-->]]>
+
+<!ENTITY % foreignphrase.module "INCLUDE">
+<![%foreignphrase.module;[
+<!ENTITY % local.foreignphrase.attrib "">
+<!ENTITY % foreignphrase.role.attrib "%role.attrib;">
+
+<!ENTITY % foreignphrase.element "INCLUDE">
+<![%foreignphrase.element;[
+<!ELEMENT foreignphrase %ho; (%para.char.mix;)*>
+<!--end of foreignphrase.element-->]]>
+
+<!ENTITY % foreignphrase.attlist "INCLUDE">
+<![%foreignphrase.attlist;[
+<!ATTLIST foreignphrase
+		%common.attrib;
+		%foreignphrase.role.attrib;
+		%local.foreignphrase.attrib;
+>
+<!--end of foreignphrase.attlist-->]]>
+<!--end of foreignphrase.module-->]]>
+
+<!ENTITY % glossterm.module "INCLUDE">
+<![%glossterm.module;[
+<!ENTITY % local.glossterm.attrib "">
+<!ENTITY % glossterm.role.attrib "%role.attrib;">
+
+<!ENTITY % glossterm.element "INCLUDE">
+<![%glossterm.element;[
+<!ELEMENT glossterm %ho; (%para.char.mix;)*
+		%glossterm.exclusion;>
+<!--end of glossterm.element-->]]>
+
+<!-- to GlossEntry if Glossterm used in text -->
+<!-- BaseForm: Provides the form of GlossTerm to be used
+		for indexing -->
+
+<!ENTITY % glossterm.attlist "INCLUDE">
+<![%glossterm.attlist;[
+<!ATTLIST glossterm
+		baseform	CDATA		#IMPLIED
+		%linkend.attrib;
+		%common.attrib;
+		%glossterm.role.attrib;
+		%local.glossterm.attrib;
+>
+<!--end of glossterm.attlist-->]]>
+<!--end of glossterm.module-->]]>
+
+<!ENTITY % firstterm.module "INCLUDE">
+<![%firstterm.module;[
+<!ENTITY % local.firstterm.attrib "">
+<!ENTITY % firstterm.role.attrib "%role.attrib;">
+
+<!ENTITY % firstterm.element "INCLUDE">
+<![%firstterm.element;[
+<!ELEMENT firstterm %ho; (%para.char.mix;)*
+		%glossterm.exclusion;>
+<!--end of firstterm.element-->]]>
+
+<!-- to GlossEntry or other explanation -->
+
+
+<!ENTITY % firstterm.attlist "INCLUDE">
+<![%firstterm.attlist;[
+<!ATTLIST firstterm
+		baseform	CDATA		#IMPLIED
+		%linkend.attrib;
+		%common.attrib;
+		%firstterm.role.attrib;
+		%local.firstterm.attrib;
+>
+<!--end of firstterm.attlist-->]]>
+<!--end of firstterm.module-->]]>
+
+<!ENTITY % phrase.module "INCLUDE">
+<![%phrase.module;[
+<!ENTITY % local.phrase.attrib "">
+<!ENTITY % phrase.role.attrib "%role.attrib;">
+
+<!ENTITY % phrase.element "INCLUDE">
+<![%phrase.element;[
+<!ELEMENT phrase %ho; (%para.char.mix;)*>
+<!--end of phrase.element-->]]>
+
+<!ENTITY % phrase.attlist "INCLUDE">
+<![%phrase.attlist;[
+<!ATTLIST phrase
+		%common.attrib;
+		%phrase.role.attrib;
+		%local.phrase.attrib;
+>
+<!--end of phrase.attlist-->]]>
+<!--end of phrase.module-->]]>
+
+<!ENTITY % quote.module "INCLUDE">
+<![%quote.module;[
+<!ENTITY % local.quote.attrib "">
+<!ENTITY % quote.role.attrib "%role.attrib;">
+
+<!ENTITY % quote.element "INCLUDE">
+<![%quote.element;[
+<!ELEMENT quote %ho; (%para.char.mix;)*>
+<!--end of quote.element-->]]>
+
+<!ENTITY % quote.attlist "INCLUDE">
+<![%quote.attlist;[
+<!ATTLIST quote
+		%common.attrib;
+		%quote.role.attrib;
+		%local.quote.attrib;
+>
+<!--end of quote.attlist-->]]>
+<!--end of quote.module-->]]>
+
+<!ENTITY % ssscript.module "INCLUDE">
+<![%ssscript.module;[
+<!ENTITY % local.ssscript.attrib "">
+<!ENTITY % ssscript.role.attrib "%role.attrib;">
+
+<!ENTITY % subscript.element "INCLUDE">
+<![%subscript.element;[
+<!ELEMENT subscript %ho; (#PCDATA
+		| %link.char.class;
+		| emphasis
+		| replaceable
+		| symbol
+		| inlinegraphic
+                | inlinemediaobject
+		| %base.char.class;
+		| %other.char.class;)*
+		%ubiq.exclusion;>
+<!--end of subscript.element-->]]>
+
+<!ENTITY % subscript.attlist "INCLUDE">
+<![%subscript.attlist;[
+<!ATTLIST subscript
+		%common.attrib;
+		%ssscript.role.attrib;
+		%local.ssscript.attrib;
+>
+<!--end of subscript.attlist-->]]>
+
+<!ENTITY % superscript.element "INCLUDE">
+<![%superscript.element;[
+<!ELEMENT superscript %ho; (#PCDATA
+		| %link.char.class;
+		| emphasis
+		| replaceable
+		| symbol
+		| inlinegraphic
+                | inlinemediaobject
+		| %base.char.class;
+		| %other.char.class;)*
+		%ubiq.exclusion;>
+<!--end of superscript.element-->]]>
+
+<!ENTITY % superscript.attlist "INCLUDE">
+<![%superscript.attlist;[
+<!ATTLIST superscript
+		%common.attrib;
+		%ssscript.role.attrib;
+		%local.ssscript.attrib;
+>
+<!--end of superscript.attlist-->]]>
+<!--end of ssscript.module-->]]>
+
+<!ENTITY % trademark.module "INCLUDE">
+<![%trademark.module;[
+<!ENTITY % local.trademark.attrib "">
+<!ENTITY % trademark.role.attrib "%role.attrib;">
+
+<!ENTITY % trademark.element "INCLUDE">
+<![%trademark.element;[
+<!ELEMENT trademark %ho; (#PCDATA
+		| %link.char.class;
+		| %tech.char.class;
+		| %base.char.class;
+		| %other.char.class;
+		| inlinegraphic
+                | inlinemediaobject
+		| emphasis)*>
+<!--end of trademark.element-->]]>
+
+<!-- Class: More precisely identifies the item the element names -->
+
+
+<!ENTITY % trademark.attlist "INCLUDE">
+<![%trademark.attlist;[
+<!ATTLIST trademark
+		class		(service
+				|trade
+				|registered
+				|copyright)	'trade'
+		%common.attrib;
+		%trademark.role.attrib;
+		%local.trademark.attrib;
+>
+<!--end of trademark.attlist-->]]>
+<!--end of trademark.module-->]]>
+
+<!ENTITY % wordasword.module "INCLUDE">
+<![%wordasword.module;[
+<!ENTITY % local.wordasword.attrib "">
+<!ENTITY % wordasword.role.attrib "%role.attrib;">
+
+<!ENTITY % wordasword.element "INCLUDE">
+<![%wordasword.element;[
+<!ELEMENT wordasword %ho; (%word.char.mix;)*>
+<!--end of wordasword.element-->]]>
+
+<!ENTITY % wordasword.attlist "INCLUDE">
+<![%wordasword.attlist;[
+<!ATTLIST wordasword
+		%common.attrib;
+		%wordasword.role.attrib;
+		%local.wordasword.attrib;
+>
+<!--end of wordasword.attlist-->]]>
+<!--end of wordasword.module-->]]>
+
+<!-- Links and cross-references ........................................... -->
+
+<!ENTITY % link.module "INCLUDE">
+<![%link.module;[
+<!ENTITY % local.link.attrib "">
+<!ENTITY % link.role.attrib "%role.attrib;">
+
+<!ENTITY % link.element "INCLUDE">
+<![%link.element;[
+<!ELEMENT link %ho; (%para.char.mix;)*
+		%links.exclusion;>
+<!--end of link.element-->]]>
+
+<!-- Endterm: ID of element containing text that is to be
+		fetched from elsewhere in the document to appear as
+		the content of this element -->
+<!-- to linked-to object -->
+<!-- Type: Freely assignable parameter -->
+
+
+<!ENTITY % link.attlist "INCLUDE">
+<![%link.attlist;[
+<!ATTLIST link
+		endterm		IDREF		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		type		CDATA		#IMPLIED
+		%linkendreq.attrib;
+		%common.attrib;
+		%link.role.attrib;
+		%local.link.attrib;
+>
+<!--end of link.attlist-->]]>
+<!--end of link.module-->]]>
+
+<!ENTITY % olink.module "INCLUDE">
+<![%olink.module;[
+<!ENTITY % local.olink.attrib "">
+<!ENTITY % olink.role.attrib "%role.attrib;">
+
+<!ENTITY % olink.element "INCLUDE">
+<![%olink.element;[
+<!ELEMENT olink %ho; (%para.char.mix;)*
+		%links.exclusion;>
+<!--end of olink.element-->]]>
+
+<!-- TargetDocEnt: Name of an entity to be the target of the link -->
+<!-- LinkMode: ID of a ModeSpec containing instructions for
+		operating on the entity named by TargetDocEnt -->
+<!-- LocalInfo: Information that may be passed to ModeSpec -->
+<!-- Type: Freely assignable parameter -->
+
+
+<!ENTITY % olink.attlist "INCLUDE">
+<![%olink.attlist;[
+<!ATTLIST olink
+		targetdocent	ENTITY 		#IMPLIED
+		linkmode	IDREF		#IMPLIED
+		localinfo 	CDATA		#IMPLIED
+		type		CDATA		#IMPLIED
+		targetdoc	CDATA		#IMPLIED
+		targetptr	CDATA		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		%common.attrib;
+		%olink.role.attrib;
+		%local.olink.attrib;
+>
+<!--end of olink.attlist-->]]>
+<!--end of olink.module-->]]>
+
+<!ENTITY % ulink.module "INCLUDE">
+<![%ulink.module;[
+<!ENTITY % local.ulink.attrib "">
+<!ENTITY % ulink.role.attrib "%role.attrib;">
+
+<!ENTITY % ulink.element "INCLUDE">
+<![%ulink.element;[
+<!ELEMENT ulink %ho; (%para.char.mix;)*
+		%links.exclusion;>
+<!--end of ulink.element-->]]>
+
+<!-- URL: uniform resource locator; the target of the ULink -->
+<!-- Type: Freely assignable parameter -->
+
+
+<!ENTITY % ulink.attlist "INCLUDE">
+<![%ulink.attlist;[
+<!ATTLIST ulink
+		url		CDATA		#REQUIRED
+		type		CDATA		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		%common.attrib;
+		%ulink.role.attrib;
+		%local.ulink.attrib;
+>
+<!--end of ulink.attlist-->]]>
+<!--end of ulink.module-->]]>
+
+<!ENTITY % footnoteref.module "INCLUDE">
+<![%footnoteref.module;[
+<!ENTITY % local.footnoteref.attrib "">
+<!ENTITY % footnoteref.role.attrib "%role.attrib;">
+
+<!ENTITY % footnoteref.element "INCLUDE">
+<![%footnoteref.element;[
+<!ELEMENT footnoteref %ho; EMPTY>
+<!--end of footnoteref.element-->]]>
+
+<!-- to footnote content supplied elsewhere -->
+
+
+<!ENTITY % footnoteref.attlist "INCLUDE">
+<![%footnoteref.attlist;[
+<!ATTLIST footnoteref
+		%linkendreq.attrib;		%label.attrib;
+		%common.attrib;
+		%footnoteref.role.attrib;
+		%local.footnoteref.attrib;
+>
+<!--end of footnoteref.attlist-->]]>
+<!--end of footnoteref.module-->]]>
+
+<!ENTITY % xref.module "INCLUDE">
+<![%xref.module;[
+<!ENTITY % local.xref.attrib "">
+<!ENTITY % xref.role.attrib "%role.attrib;">
+
+<!ENTITY % xref.element "INCLUDE">
+<![%xref.element;[
+<!ELEMENT xref %ho; EMPTY>
+<!--end of xref.element-->]]>
+
+<!-- Endterm: ID of element containing text that is to be
+		fetched from elsewhere in the document to appear as
+		the content of this element -->
+<!-- to linked-to object -->
+
+
+<!ENTITY % xref.attlist "INCLUDE">
+<![%xref.attlist;[
+<!ATTLIST xref
+		endterm		IDREF		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		%common.attrib;
+		%linkendreq.attrib;
+		%xref.role.attrib;
+		%local.xref.attrib;
+>
+<!--end of xref.attlist-->]]>
+<!--end of xref.module-->]]>
+
+<!ENTITY % biblioref.module "INCLUDE">
+<![%biblioref.module;[
+<!ENTITY % local.biblioref.attrib "">
+<!ENTITY % biblioref.role.attrib "%role.attrib;">
+
+<!ENTITY % biblioref.element "INCLUDE">
+<![%biblioref.element;[
+<!ELEMENT biblioref %ho; EMPTY>
+<!--end of biblioref.element-->]]>
+
+<!ENTITY % biblioref.attlist "INCLUDE">
+<![%biblioref.attlist;[
+<!ATTLIST biblioref
+		endterm		IDREF		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		units		CDATA		#IMPLIED
+		begin		CDATA		#IMPLIED
+		end		CDATA		#IMPLIED
+		%common.attrib;
+		%linkendreq.attrib;
+		%biblioref.role.attrib;
+		%local.biblioref.attrib;
+>
+<!--end of biblioref.attlist-->]]>
+<!--end of biblioref.module-->]]>
+
+<!-- Ubiquitous elements .................................................. -->
+
+<!ENTITY % anchor.module "INCLUDE">
+<![%anchor.module;[
+<!ENTITY % local.anchor.attrib "">
+<!ENTITY % anchor.role.attrib "%role.attrib;">
+
+<!ENTITY % anchor.element "INCLUDE">
+<![%anchor.element;[
+<!ELEMENT anchor %ho; EMPTY>
+<!--end of anchor.element-->]]>
+
+<!-- required -->
+<!-- replaces Lang -->
+
+
+<!ENTITY % anchor.attlist "INCLUDE">
+<![%anchor.attlist;[
+<!ATTLIST anchor
+		%idreq.attrib;		%pagenum.attrib;		%remap.attrib;
+		%xreflabel.attrib;
+		%revisionflag.attrib;
+		%effectivity.attrib;
+		%anchor.role.attrib;
+		%local.anchor.attrib;
+>
+<!--end of anchor.attlist-->]]>
+<!--end of anchor.module-->]]>
+
+<!ENTITY % beginpage.module "INCLUDE">
+<![%beginpage.module;[
+<!ENTITY % local.beginpage.attrib "">
+<!ENTITY % beginpage.role.attrib "%role.attrib;">
+
+<!ENTITY % beginpage.element "INCLUDE">
+<![%beginpage.element;[
+<!ELEMENT beginpage %ho; EMPTY>
+<!--end of beginpage.element-->]]>
+
+<!-- PageNum: Number of page that begins at this point -->
+
+
+<!ENTITY % beginpage.attlist "INCLUDE">
+<![%beginpage.attlist;[
+<!ATTLIST beginpage
+		%pagenum.attrib;
+		%common.attrib;
+		%beginpage.role.attrib;
+		%local.beginpage.attrib;
+>
+<!--end of beginpage.attlist-->]]>
+<!--end of beginpage.module-->]]>
+
+<!-- IndexTerms appear in the text flow for generating or linking an
+     index. -->
+
+<!ENTITY % indexterm.content.module "INCLUDE">
+<![%indexterm.content.module;[
+<!ENTITY % indexterm.module "INCLUDE">
+<![%indexterm.module;[
+<!ENTITY % local.indexterm.attrib "">
+<!ENTITY % indexterm.role.attrib "%role.attrib;">
+
+<!ENTITY % indexterm.element "INCLUDE">
+<![%indexterm.element;[
+<!ELEMENT indexterm %ho; (primary?, ((secondary, ((tertiary, (see|seealso+)?)
+		| see | seealso+)?) | see | seealso+)?)
+			%ubiq.exclusion;>
+<!--end of indexterm.element-->]]>
+
+<!-- Scope: Indicates which generated indices the IndexTerm
+		should appear in: Global (whole document set), Local (this
+		document only), or All (both) -->
+<!-- Significance: Whether this IndexTerm is the most pertinent
+		of its series (Preferred) or not (Normal, the default) -->
+<!-- Class: Indicates type of IndexTerm; default is Singular,
+		or EndOfRange if StartRef is supplied; StartOfRange value
+		must be supplied explicitly on starts of ranges -->
+<!-- StartRef: ID of the IndexTerm that starts the indexing
+		range ended by this IndexTerm -->
+<!-- Zone: IDs of the elements to which the IndexTerm applies,
+		and indicates that the IndexTerm applies to those entire
+		elements rather than the point at which the IndexTerm
+		occurs -->
+
+
+<!ENTITY % indexterm.attlist "INCLUDE">
+<![%indexterm.attlist;[
+<!ATTLIST indexterm
+		%pagenum.attrib;
+		scope		(all
+				|global
+				|local)		#IMPLIED
+		significance	(preferred
+				|normal)	"normal"
+		class		(singular
+				|startofrange
+				|endofrange)	#IMPLIED
+		startref	IDREF		#IMPLIED
+		zone		IDREFS		#IMPLIED
+		type		CDATA		#IMPLIED
+		%common.attrib;
+		%indexterm.role.attrib;
+		%local.indexterm.attrib;
+>
+<!--end of indexterm.attlist-->]]>
+<!--end of indexterm.module-->]]>
+
+<!ENTITY % primsecter.module "INCLUDE">
+<![%primsecter.module;[
+<!ENTITY % local.primsecter.attrib "">
+<!ENTITY % primsecter.role.attrib "%role.attrib;">
+
+
+<!ENTITY % primary.element "INCLUDE">
+<![%primary.element;[
+<!ELEMENT primary %ho;   (%ndxterm.char.mix;)*>
+<!--end of primary.element-->]]>
+<!-- SortAs: Alternate sort string for index sorting, e.g.,
+		"fourteen" for an element containing "14" -->
+
+<!ENTITY % primary.attlist "INCLUDE">
+<![%primary.attlist;[
+<!ATTLIST primary
+		sortas		CDATA		#IMPLIED
+		%common.attrib;
+		%primsecter.role.attrib;
+		%local.primsecter.attrib;
+>
+<!--end of primary.attlist-->]]>
+
+
+<!ENTITY % secondary.element "INCLUDE">
+<![%secondary.element;[
+<!ELEMENT secondary %ho; (%ndxterm.char.mix;)*>
+<!--end of secondary.element-->]]>
+<!-- SortAs: Alternate sort string for index sorting, e.g.,
+		"fourteen" for an element containing "14" -->
+
+<!ENTITY % secondary.attlist "INCLUDE">
+<![%secondary.attlist;[
+<!ATTLIST secondary
+		sortas		CDATA		#IMPLIED
+		%common.attrib;
+		%primsecter.role.attrib;
+		%local.primsecter.attrib;
+>
+<!--end of secondary.attlist-->]]>
+
+
+<!ENTITY % tertiary.element "INCLUDE">
+<![%tertiary.element;[
+<!ELEMENT tertiary %ho;  (%ndxterm.char.mix;)*>
+<!--end of tertiary.element-->]]>
+<!-- SortAs: Alternate sort string for index sorting, e.g.,
+		"fourteen" for an element containing "14" -->
+
+<!ENTITY % tertiary.attlist "INCLUDE">
+<![%tertiary.attlist;[
+<!ATTLIST tertiary
+		sortas		CDATA		#IMPLIED
+		%common.attrib;
+		%primsecter.role.attrib;
+		%local.primsecter.attrib;
+>
+<!--end of tertiary.attlist-->]]>
+
+<!--end of primsecter.module-->]]>
+
+<!ENTITY % seeseealso.module "INCLUDE">
+<![%seeseealso.module;[
+<!ENTITY % local.seeseealso.attrib "">
+<!ENTITY % seeseealso.role.attrib "%role.attrib;">
+
+<!ENTITY % see.element "INCLUDE">
+<![%see.element;[
+<!ELEMENT see %ho; (%ndxterm.char.mix;)*>
+<!--end of see.element-->]]>
+
+<!ENTITY % see.attlist "INCLUDE">
+<![%see.attlist;[
+<!ATTLIST see
+		%common.attrib;
+		%seeseealso.role.attrib;
+		%local.seeseealso.attrib;
+>
+<!--end of see.attlist-->]]>
+
+<!ENTITY % seealso.element "INCLUDE">
+<![%seealso.element;[
+<!ELEMENT seealso %ho; (%ndxterm.char.mix;)*>
+<!--end of seealso.element-->]]>
+
+<!ENTITY % seealso.attlist "INCLUDE">
+<![%seealso.attlist;[
+<!ATTLIST seealso
+		%common.attrib;
+		%seeseealso.role.attrib;
+		%local.seeseealso.attrib;
+>
+<!--end of seealso.attlist-->]]>
+<!--end of seeseealso.module-->]]>
+<!--end of indexterm.content.module-->]]>
+
+<!-- End of DocBook XML information pool module V4.4 ...................... -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/3.dtd b/xml/tests/testData/quickFix/fetchExternalResources/3.dtd
new file mode 100644
index 0000000..da3c867
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/3.dtd
@@ -0,0 +1 @@
+<!ENTITY % MainModule SYSTEM "onix-international.elt">
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/3.xsd b/xml/tests/testData/quickFix/fetchExternalResources/3.xsd
new file mode 100644
index 0000000..6a4319e
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/3.xsd
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+	    targetNamespace="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	    elementFormDefault="qualified"
+	    attributeFormDefault="unqualified"
+	    version="2.4">
+
+  <xsd:import schemaLocation="j2ee_1_4.xsd"/>
+  <redefine schemaLocation="jsp_2_0.xsd"/>
+
+</xsd:schema>
+
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/4.xml b/xml/tests/testData/quickFix/fetchExternalResources/4.xml
new file mode 100644
index 0000000..6667c37
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/4.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:aop="http://www.springframework.org/schema/aop"
+xmlns:tx="http://www.springframework.org/schema/tx"
+xsi:schemaLocation="http://www.springframework.org/schema/beans
+http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/aop
+http://www.springframework.org/schema/aop/spring-aop.xsd
+http://www.springframework.org/schema/tx
+http://www.springframework.org/schema/tx/spring-tx.xsd">
+</beans>
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/5.xml b/xml/tests/testData/quickFix/fetchExternalResources/5.xml
new file mode 100644
index 0000000..6937441f
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/5.xml
@@ -0,0 +1,67 @@
+<!-- "Fetch External Resource" "true" -->
+
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2004-2005 The Apache Software Foundation
+
+    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.
+-->
+
+<xs:schema
+    xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-1.1"
+    targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/web-1.1"
+    xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1"
+    xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1"
+    xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified"
+    version="1.0">
+
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/naming-1.1" schemaLocation="geronimo-naming-1.1.xsd"/>
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/security-1.1" schemaLocation="geronimo-security-1.1.xsd"/>
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/deployment-1.1" schemaLocation="geronimo-module-1.1.xsd"/>
+
+    <xs:element name="web-app" type="web:web-appType"/>
+
+
+    <xs:complexType name="web-appType">
+        <xs:sequence>
+            <xs:element ref="sys:environment" minOccurs="0"/>
+
+            <xs:element name="context-root" type="xs:string" minOccurs="0"/>
+            <!--<xs:element name="context-priority-classloader" type="xs:boolean" minOccurs="0"/>-->
+            <xs:element ref="naming:web-container" minOccurs="0"/>
+            <xs:element name="container-config" type="web:container-configType" minOccurs="0"/>
+
+            <xs:group ref="naming:jndiEnvironmentRefsGroup"/>
+            <xs:element ref="naming:message-destination" minOccurs="0" maxOccurs="unbounded"/>
+
+            <xs:sequence minOccurs="0">
+                <xs:element name="security-realm-name" type="xs:string"/>
+                <xs:element ref="security:security" minOccurs="0"/>
+            </xs:sequence>
+
+            <xs:element ref="sys:gbean" minOccurs="0" maxOccurs="unbounded"/>
+
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="container-configType">
+        <xs:sequence>
+            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/6.xml b/xml/tests/testData/quickFix/fetchExternalResources/6.xml
new file mode 100644
index 0000000..b56b198
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/6.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+    targetNamespace="http://jboss.com/products/seam/mail"
+    xmlns:mail="http://jboss.com/products/seam/mail"
+    xmlns:components="http://jboss.com/products/seam/components" attributeFormDefault="unqualified">
+    <xs:import namespace="http://jboss.com/products/seam/components" schemaLocation="http://jboss.com/products/seam/components-1.2.xsd"/>
+    <xs:attributeGroup name="attlist.mailSession">
+        <xs:attribute name="username" type="xs:string"/>
+        <xs:attribute name="password" type="xs:string"/>
+        <xs:attribute name="host" type="xs:string"/>
+        <xs:attribute name="port" type="xs:string"/>
+        <xs:attribute name="debug" type="xs:string"/>
+        <xs:attribute name="ssl" type="xs:boolean"/>
+        <xs:attribute name="session-jndi-name" type="xs:string"/>
+    </xs:attributeGroup>
+
+    <xs:element name="mail-session">
+        <xs:complexType>
+            <xs:attributeGroup ref="components:attlist.component" />
+            <xs:attributeGroup ref="mail:attlist.mailSession" />
+        </xs:complexType>
+    </xs:element>
+</xs:schema>
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/after1.xml b/xml/tests/testData/quickFix/fetchExternalResources/after1.xml
new file mode 100644
index 0000000..b3a3d28
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/after1.xml
@@ -0,0 +1 @@
+<tag xmlns="http://nowhere.com<caret>" />
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/after2.xml b/xml/tests/testData/quickFix/fetchExternalResources/after2.xml
new file mode 100644
index 0000000..c15b81e
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/after2.xml
@@ -0,0 +1,3 @@
+<!DOCTYPE tag PUBLIC "x3" "http://my<caret>file">
+
+<tag />
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/after3.xml b/xml/tests/testData/quickFix/fetchExternalResources/after3.xml
new file mode 100644
index 0000000..effdf80
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/after3.xml
@@ -0,0 +1,5 @@
+<!-- "Fetch External Resource" "true" -->
+
+<rap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="myschema http://www.inversoft.com/sche<caret>mas/rap/rap-config-1.0.xsd">
+</rap>
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/after4.xml b/xml/tests/testData/quickFix/fetchExternalResources/after4.xml
new file mode 100644
index 0000000..30ce5fd
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/after4.xml
@@ -0,0 +1,5 @@
+<!-- "Fetch External Resource" "true" -->
+
+<rap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://www.inversoft.com/sche<caret>mas/rap/rap-config-1.0.xsd">
+</rap>
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/after6.xml b/xml/tests/testData/quickFix/fetchExternalResources/after6.xml
new file mode 100644
index 0000000..d3011505
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/after6.xml
@@ -0,0 +1,9 @@
+<!-- "Fetch External Resource" "true" -->
+
+<jsp:root version="2.0"
+xmlns="http://www.w3.org/1999/xhtml"
+xmlns:jsp="http://java.sun.com/JSP/Page"
+xmlns:a4j="https://ajax4<caret>jsf.dev.java.net/ajax"
+xmlns:f="http://java.sun.com/jsf/core"
+xmlns:h="http://java.sun.com/jsf/html"
+xmlns:t="http://myfaces.apache.org/tomahawk">
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/after7.xml b/xml/tests/testData/quickFix/fetchExternalResources/after7.xml
new file mode 100644
index 0000000..f885507
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/after7.xml
@@ -0,0 +1,11 @@
+<!-- "Fetch External Resource" "true" -->
+
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.inversoft.com/schemas/savant-2.0/project"
+    xmlns:project="http://www.inversoft.com/schemas/savant-2.0/project"
+    xmlns:base="http://www.inversoft.com/schemas/savant-2.0/base">
+
+  <xsd:import namespace="http://www.inversoft.com/schema<caret>s/savant-2.0/base" />
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/after9.xml b/xml/tests/testData/quickFix/fetchExternalResources/after9.xml
new file mode 100644
index 0000000..115128d
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/after9.xml
@@ -0,0 +1,3 @@
+<!-- "Fetch External Resource" "true" -->
+
+<project default="aaa" xmlns:z="http://nowhere.com2<caret>"/>
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/before1.xml b/xml/tests/testData/quickFix/fetchExternalResources/before1.xml
new file mode 100644
index 0000000..3af9a931
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/before1.xml
@@ -0,0 +1,3 @@
+<!-- "Fetch External Resource" "true" -->
+
+<tag xmlns="http://nowhere.com<caret>" />
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/before2.xml b/xml/tests/testData/quickFix/fetchExternalResources/before2.xml
new file mode 100644
index 0000000..65518ff
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/before2.xml
@@ -0,0 +1,5 @@
+<!-- "Fetch External Resource" "true" -->
+
+<!DOCTYPE tag PUBLIC "x3" "http://my<caret>file">
+
+<tag />
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/before3.xml b/xml/tests/testData/quickFix/fetchExternalResources/before3.xml
new file mode 100644
index 0000000..effdf80
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/before3.xml
@@ -0,0 +1,5 @@
+<!-- "Fetch External Resource" "true" -->
+
+<rap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="myschema http://www.inversoft.com/sche<caret>mas/rap/rap-config-1.0.xsd">
+</rap>
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/before4.xml b/xml/tests/testData/quickFix/fetchExternalResources/before4.xml
new file mode 100644
index 0000000..30ce5fd
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/before4.xml
@@ -0,0 +1,5 @@
+<!-- "Fetch External Resource" "true" -->
+
+<rap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://www.inversoft.com/sche<caret>mas/rap/rap-config-1.0.xsd">
+</rap>
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/before6.xml b/xml/tests/testData/quickFix/fetchExternalResources/before6.xml
new file mode 100644
index 0000000..d3011505
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/before6.xml
@@ -0,0 +1,9 @@
+<!-- "Fetch External Resource" "true" -->
+
+<jsp:root version="2.0"
+xmlns="http://www.w3.org/1999/xhtml"
+xmlns:jsp="http://java.sun.com/JSP/Page"
+xmlns:a4j="https://ajax4<caret>jsf.dev.java.net/ajax"
+xmlns:f="http://java.sun.com/jsf/core"
+xmlns:h="http://java.sun.com/jsf/html"
+xmlns:t="http://myfaces.apache.org/tomahawk">
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/before7.xml b/xml/tests/testData/quickFix/fetchExternalResources/before7.xml
new file mode 100644
index 0000000..f885507
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/before7.xml
@@ -0,0 +1,11 @@
+<!-- "Fetch External Resource" "true" -->
+
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.inversoft.com/schemas/savant-2.0/project"
+    xmlns:project="http://www.inversoft.com/schemas/savant-2.0/project"
+    xmlns:base="http://www.inversoft.com/schemas/savant-2.0/base">
+
+  <xsd:import namespace="http://www.inversoft.com/schema<caret>s/savant-2.0/base" />
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/fetchExternalResources/before9.xml b/xml/tests/testData/quickFix/fetchExternalResources/before9.xml
new file mode 100644
index 0000000..115128d
--- /dev/null
+++ b/xml/tests/testData/quickFix/fetchExternalResources/before9.xml
@@ -0,0 +1,3 @@
+<!-- "Fetch External Resource" "true" -->
+
+<project default="aaa" xmlns:z="http://nowhere.com2<caret>"/>
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/ignoreExternalResources/after1.xml b/xml/tests/testData/quickFix/ignoreExternalResources/after1.xml
new file mode 100644
index 0000000..01e14b8
--- /dev/null
+++ b/xml/tests/testData/quickFix/ignoreExternalResources/after1.xml
@@ -0,0 +1 @@
+<foo xmlns="urn:macromedia-extension" />
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/ignoreExternalResources/after2.xml b/xml/tests/testData/quickFix/ignoreExternalResources/after2.xml
new file mode 100644
index 0000000..ebd6a3c
--- /dev/null
+++ b/xml/tests/testData/quickFix/ignoreExternalResources/after2.xml
@@ -0,0 +1 @@
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/ignoreExternalResources/before1.xml b/xml/tests/testData/quickFix/ignoreExternalResources/before1.xml
new file mode 100644
index 0000000..42beb61c8
--- /dev/null
+++ b/xml/tests/testData/quickFix/ignoreExternalResources/before1.xml
@@ -0,0 +1,3 @@
+<!-- "Ignore External Resource" "true" -->
+
+<foo xmlns="urn:macro<caret>media-extension" />
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/ignoreExternalResources/before2.xml b/xml/tests/testData/quickFix/ignoreExternalResources/before2.xml
new file mode 100644
index 0000000..69532bd
--- /dev/null
+++ b/xml/tests/testData/quickFix/ignoreExternalResources/before2.xml
@@ -0,0 +1,3 @@
+<!-- "Ignore External Resource" "true" -->
+
+<!DOCTYPE log4j:configuration SYSTEM "log<caret>4j.dtd">
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/manuallySetupExternalResources/after1.xml b/xml/tests/testData/quickFix/manuallySetupExternalResources/after1.xml
new file mode 100644
index 0000000..498fbd0
--- /dev/null
+++ b/xml/tests/testData/quickFix/manuallySetupExternalResources/after1.xml
@@ -0,0 +1 @@
+<!DOCTYPE log4j:configuration SYSTEM "lo<caret>g4j.dtd">
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/manuallySetupExternalResources/after2.xml b/xml/tests/testData/quickFix/manuallySetupExternalResources/after2.xml
new file mode 100644
index 0000000..b005d41
--- /dev/null
+++ b/xml/tests/testData/quickFix/manuallySetupExternalResources/after2.xml
@@ -0,0 +1 @@
+<foo xmlns="urn:macro<caret>media-extension" />
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/manuallySetupExternalResources/before1.xml b/xml/tests/testData/quickFix/manuallySetupExternalResources/before1.xml
new file mode 100644
index 0000000..7e120b1
--- /dev/null
+++ b/xml/tests/testData/quickFix/manuallySetupExternalResources/before1.xml
@@ -0,0 +1,2 @@
+<!-- "Manually Setup External Resource" "true" -->
+<!DOCTYPE log4j:configuration SYSTEM "lo<caret>g4j.dtd">
\ No newline at end of file
diff --git a/xml/tests/testData/quickFix/manuallySetupExternalResources/before2.xml b/xml/tests/testData/quickFix/manuallySetupExternalResources/before2.xml
new file mode 100644
index 0000000..e798a6a
--- /dev/null
+++ b/xml/tests/testData/quickFix/manuallySetupExternalResources/before2.xml
@@ -0,0 +1,2 @@
+<!-- "Manually Setup External Resource" "true" -->
+<foo xmlns="urn:macro<caret>media-extension" />
\ No newline at end of file
diff --git a/xml/tests/testData/schemaPrefix/rename.xml b/xml/tests/testData/schemaPrefix/rename.xml
new file mode 100644
index 0000000..99ee91d
--- /dev/null
+++ b/xml/tests/testData/schemaPrefix/rename.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="http://mySchema"
+        xmlns:xs="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <xs:element name="myElement" type="my:TYPE"/>
+    <xs:simpleType name="TYPE" id="TYPE">
+        <xs:restriction base="x<caret>s:integer">
+            <xs:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="T" id="T">
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="0" id="id"/>
+        </xs:restriction>
+    </xs:simpleType>
+</xs:schema>
diff --git a/xml/tests/testData/schemaPrefix/rename1.xml b/xml/tests/testData/schemaPrefix/rename1.xml
new file mode 100644
index 0000000..08a03c3
--- /dev/null
+++ b/xml/tests/testData/schemaPrefix/rename1.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="http://mySchema"
+        xmlns:x<caret>s="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <xs:element name="myElement" type="my:TYPE"/>
+    <xs:simpleType name="TYPE" id="TYPE">
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="T" id="T">
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="0" id="id"/>
+        </xs:restriction>
+    </xs:simpleType>
+</xs:schema>
diff --git a/xml/tests/testData/schemaPrefix/rename1_after.xml b/xml/tests/testData/schemaPrefix/rename1_after.xml
new file mode 100644
index 0000000..e375267
--- /dev/null
+++ b/xml/tests/testData/schemaPrefix/rename1_after.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://mySchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <xsd:element name="myElement" type="my:TYPE"/>
+    <xsd:simpleType name="TYPE" id="TYPE">
+        <xsd:restriction base="xsd:integer">
+            <xsd:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="T" id="T">
+        <xsd:restriction base="xsd:integer">
+            <xsd:minInclusive value="0" id="id"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+</xsd:schema>
diff --git a/xml/tests/testData/schemaPrefix/rename2.xml b/xml/tests/testData/schemaPrefix/rename2.xml
new file mode 100644
index 0000000..220c831
--- /dev/null
+++ b/xml/tests/testData/schemaPrefix/rename2.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="http://mySchema"
+        xmlns:xs="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <xs:element name="myElement" type="my:TYPE"/>
+    <xs:simpleType name="TYPE" id="TYPE">
+        <x<caret>s:restriction base="xs:integer">
+            <xs:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="T" id="T">
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="0" id="id"/>
+        </xs:restriction>
+    </xs:simpleType>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/schemaPrefix/rename2_after.xml b/xml/tests/testData/schemaPrefix/rename2_after.xml
new file mode 100644
index 0000000..df27bea
--- /dev/null
+++ b/xml/tests/testData/schemaPrefix/rename2_after.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://mySchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <xsd:element name="myElement" type="my:TYPE"/>
+    <xsd:simpleType name="TYPE" id="TYPE">
+        <xsd:restriction base="xsd:integer">
+            <xsd:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="T" id="T">
+        <xsd:restriction base="xsd:integer">
+            <xsd:minInclusive value="0" id="id"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/schemaPrefix/renameFromClosingTag.xml b/xml/tests/testData/schemaPrefix/renameFromClosingTag.xml
new file mode 100644
index 0000000..5f6a6ec0
--- /dev/null
+++ b/xml/tests/testData/schemaPrefix/renameFromClosingTag.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="http://mySchema"
+        xmlns:xs="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <xs:element name="myElement" type="my:TYPE"/>
+    <xs:simpleType name="TYPE" id="TYPE">
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </x<caret>s:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="T" id="T">
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="0" id="id"/>
+        </xs:restriction>
+    </xs:simpleType>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/schemaPrefix/renameFromClosingTag_after.xml b/xml/tests/testData/schemaPrefix/renameFromClosingTag_after.xml
new file mode 100644
index 0000000..df27bea
--- /dev/null
+++ b/xml/tests/testData/schemaPrefix/renameFromClosingTag_after.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://mySchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <xsd:element name="myElement" type="my:TYPE"/>
+    <xsd:simpleType name="TYPE" id="TYPE">
+        <xsd:restriction base="xsd:integer">
+            <xsd:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="T" id="T">
+        <xsd:restriction base="xsd:integer">
+            <xsd:minInclusive value="0" id="id"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/schemaPrefix/rename_after.xml b/xml/tests/testData/schemaPrefix/rename_after.xml
new file mode 100644
index 0000000..e375267
--- /dev/null
+++ b/xml/tests/testData/schemaPrefix/rename_after.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://mySchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <xsd:element name="myElement" type="my:TYPE"/>
+    <xsd:simpleType name="TYPE" id="TYPE">
+        <xsd:restriction base="xsd:integer">
+            <xsd:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="T" id="T">
+        <xsd:restriction base="xsd:integer">
+            <xsd:minInclusive value="0" id="id"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+</xsd:schema>
diff --git a/xml/tests/testData/schemaPrefix/usages.xml b/xml/tests/testData/schemaPrefix/usages.xml
new file mode 100644
index 0000000..7d6cda75f
--- /dev/null
+++ b/xml/tests/testData/schemaPrefix/usages.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="http://mySchema"
+        xmlns:xs<caret>="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <xs:element name="myElement" type="my:TYPE"/>
+    <xs:simpleType name="TYPE" id="TYPE">
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="T" id="T">
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="0" id="id"/>
+        </xs:restriction>
+    </xs:simpleType>
+</xs:schema>
+
diff --git a/xml/tests/testData/schemaPrefix/usages1.xml b/xml/tests/testData/schemaPrefix/usages1.xml
new file mode 100644
index 0000000..240d92d
--- /dev/null
+++ b/xml/tests/testData/schemaPrefix/usages1.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="http://mySchema"
+        xmlns:xs="http://www.w3.org/2001/XMLSchema"
+        xmlns:my="http://mySchema">
+
+    <xs:element name="myElement" type="my:TYPE"/>
+    <xs:simpleType name="TYPE" id="TYPE">
+        <xs:restriction base="x<caret>s:integer">
+            <xs:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="T" id="T">
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="0" id="id"/>
+        </xs:restriction>
+    </xs:simpleType>
+</xs:schema>
+
diff --git a/xml/tests/testData/smartCompletion/Servlet.xml b/xml/tests/testData/smartCompletion/Servlet.xml
new file mode 100644
index 0000000..3be15ed
--- /dev/null
+++ b/xml/tests/testData/smartCompletion/Servlet.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+        "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
+<web-app>
+
+    <servlet>
+        <<caret>
+    </servlet>
+</web-app>
\ No newline at end of file
diff --git a/xml/tests/testData/smartCompletion/test.xsd b/xml/tests/testData/smartCompletion/test.xsd
new file mode 100644
index 0000000..64a520e
--- /dev/null
+++ b/xml/tests/testData/smartCompletion/test.xsd
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="unqualified"
+           elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:element name="a" type="aType"/>
+  <xs:complexType name="aType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="b"/>
+      <xs:element type="xs:string" name="c" minOccurs="1" maxOccurs="5"/>
+      <xs:element type="xs:string" name="d" minOccurs="z" maxOccurs="x"/>
+      <xs:element type="xs:string" name="e" maxOccurs="unbounded"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/smartCompletion/testCompletion.xml b/xml/tests/testData/smartCompletion/testCompletion.xml
new file mode 100644
index 0000000..3aa3ed0
--- /dev/null
+++ b/xml/tests/testData/smartCompletion/testCompletion.xml
@@ -0,0 +1,3 @@
+<a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd">
+  <<caret>
+</a>
diff --git a/xml/tests/testData/smartCompletion/testCompletion3.xml b/xml/tests/testData/smartCompletion/testCompletion3.xml
new file mode 100644
index 0000000..bb8ff68
--- /dev/null
+++ b/xml/tests/testData/smartCompletion/testCompletion3.xml
@@ -0,0 +1,5 @@
+<a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd">
+  <b/>
+  <c/>
+  <<caret>
+</a>
diff --git a/xml/tests/testData/smartCompletion/testCompletionNext.xml b/xml/tests/testData/smartCompletion/testCompletionNext.xml
new file mode 100644
index 0000000..cfb1b1a
--- /dev/null
+++ b/xml/tests/testData/smartCompletion/testCompletionNext.xml
@@ -0,0 +1,4 @@
+<a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd">
+  <b/>
+  <<caret>
+</a>
diff --git a/xml/tests/testData/smartCompletion/web-app_2_3.dtd b/xml/tests/testData/smartCompletion/web-app_2_3.dtd
new file mode 100644
index 0000000..5e3ab01
--- /dev/null
+++ b/xml/tests/testData/smartCompletion/web-app_2_3.dtd
@@ -0,0 +1,1063 @@
+<!--
+Copyright (c) 2000 Sun Microsystems, Inc.,
+901 San Antonio Road,
+Palo Alto, California 94303, U.S.A.
+All rights reserved.
+
+Sun Microsystems, Inc. has intellectual property rights relating to
+technology embodied in the product that is described in this document.
+In particular, and without limitation, these intellectual property
+rights may include one or more of the U.S. patents listed at
+http://www.sun.com/patents and one or more additional patents or
+pending patent applications in the U.S. and in other countries.
+
+This document and the product to which it pertains are distributed
+under licenses restricting their use, copying, distribution, and
+decompilation.  This document may be reproduced and distributed but may
+not be changed without prior written authorization of Sun and its
+licensors, if any.
+
+Third-party software, including font technology, is copyrighted and
+licensed from Sun suppliers.
+
+Sun,  Sun Microsystems,  the Sun logo,  Java,  JavaServer Pages,  Java
+Naming and Directory Interface,  JDBC,  JDK,  JavaMail and  and
+Enterprise JavaBeans are trademarks or registered trademarks of Sun
+Microsystems, Inc. in the U.S. and other countries.
+
+Federal Acquisitions: Commercial Software - Government Users Subject to
+Standard License Terms and Conditions.
+
+DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
+CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
+WARRANTY OF MERCHANTABILITY, FITNESS FOR FOR A PARTICULAR PURPOSE OR
+NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH
+DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
+
+
+_________________________________________________________________________
+
+Copyright (c) 2000 Sun Microsystems, Inc.,
+901 San Antonio Road,
+Palo Alto, California 94303, E'tats-Unis.
+Tous droits re'serve's.
+
+Sun Microsystems, Inc. a les droits de proprie'te' intellectuels
+relatants a` la technologie incorpore'e dans le produit qui est de'crit
+dans ce document. En particulier, et sans la limitation, ces droits de
+proprie'te' intellectuels peuvent inclure un ou plus des brevets
+ame'ricains e'nume're's a` http://www.sun.com/patents et un ou les
+brevets plus supple'mentaires ou les applications de brevet en attente
+dans les E'tats-Unis et dans les autres pays.
+
+Ce produit ou document est prote'ge' par un copyright et distribue'
+avec des licences qui en restreignent l'utilisation, la copie, la
+distribution, et la de'compilation.  Ce documention associe n peut
+e^tre reproduite et distribuer, par quelque moyen que ce soit, sans
+l'autorisation pre'alable et e'crite de Sun et de ses bailleurs de
+licence, le cas e'che'ant.
+
+Le logiciel de'tenu par des tiers, et qui comprend la technologie
+relative aux polices de caracte`res, est prote'ge' par un copyright et
+licencie' par des fournisseurs de Sun.
+
+Sun,  Sun Microsystems,  le logo Sun,  Java,  JavaServer Pages,  Java
+Naming and Directory Interface,  JDBC,  JDK,  JavaMail et  and
+Enterprise JavaBeans sont des marques de fabrique ou des marques
+de'pose'es de Sun Microsystems, Inc. aux E'tats-Unis et dans d'autres
+pays.
+
+LA DOCUMENTATION EST FOURNIE "EN L'E'TAT" ET TOUTES AUTRES CONDITIONS,
+DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT
+EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS
+NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A
+L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE
+CONTREFAC,ON.
+-->
+
+<!--
+This is the XML DTD for the Servlet 2.3 deployment descriptor.
+All Servlet 2.3 deployment descriptors must include a DOCTYPE
+of the following form:
+
+  <!DOCTYPE web-app PUBLIC
+	"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+	"http://java.sun.com/dtd/web-app_2_3.dtd">
+
+-->
+
+<!--
+The following conventions apply to all J2EE deployment descriptor
+elements unless indicated otherwise.
+
+- In elements that contain PCDATA, leading and trailing whitespace
+  in the data may be ignored.
+
+- In elements whose value is an "enumerated type", the value is
+  case sensitive.
+
+- In elements that specify a pathname to a file within the same
+  JAR file, relative filenames (i.e., those not starting with "/")
+  are considered relative to the root of the JAR file's namespace.
+  Absolute filenames (i.e., those starting with "/") also specify
+  names in the root of the JAR file's namespace.  In general, relative
+  names are preferred.  The exception is .war files where absolute
+  names are preferred for consistency with the servlet API.
+-->
+
+
+<!--
+The web-app element is the root of the deployment descriptor for
+a web application.
+-->
+<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
+context-param*, filter*, filter-mapping*, listener*, servlet*,
+servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
+error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,
+login-config?, security-role*, env-entry*, ejb-ref*,  ejb-local-ref*)>
+
+<!--
+The auth-constraint element indicates the user roles that should
+be permitted access to this resource collection. The role-name
+used here must either correspond to the role-name of one of the
+security-role elements defined for this web application, or be
+the specially reserved role-name "*" that is a compact syntax for
+indicating all roles in the web application. If both "*" and
+rolenames appear, the container interprets this as all roles.
+If no roles are defined, no user is allowed access to the portion of
+the web application described by the containing security-constraint.
+The container matches role names case sensitively when determining
+access.
+
+
+Used in: security-constraint
+-->
+<!ELEMENT auth-constraint (description?, role-name*)>
+
+<!--
+The auth-method element is used to configure the authentication
+mechanism for the web application. As a prerequisite to gaining access to any web resources which are protected by an authorization
+constraint, a user must have authenticated using the configured
+mechanism. Legal values for this element are "BASIC", "DIGEST",
+"FORM", or "CLIENT-CERT".
+
+Used in: login-config
+-->
+<!ELEMENT auth-method (#PCDATA)>
+
+<!--
+The context-param element contains the declaration of a web
+application's servlet context initialization parameters.
+
+Used in: web-app
+-->
+<!ELEMENT context-param (param-name, param-value, description?)>
+
+<!--
+The description element is used to provide text describing the parent
+element.  The description element should include any information that
+the web application war file producer wants to provide to the consumer of
+the web application war file (i.e., to the Deployer). Typically, the tools
+used by the web application war file consumer will display the description
+when processing the parent element that contains the description.
+
+Used in: auth-constraint, context-param, ejb-local-ref, ejb-ref,
+env-entry, filter, init-param, resource-env-ref, resource-ref, run-as,
+security-role, security-role-ref, servlet, user-data-constraint,
+web-app, web-resource-collection
+-->
+<!ELEMENT description (#PCDATA)>
+
+<!--
+The display-name element contains a short name that is intended to be
+displayed by tools.  The display name need not be unique.
+
+Used in: filter, security-constraint, servlet, web-app
+
+Example:
+
+<display-name>Employee Self Service</display-name>
+-->
+<!ELEMENT display-name (#PCDATA)>
+
+<!--
+The distributable element, by its presence in a web application
+deployment descriptor, indicates that this web application is
+programmed appropriately to be deployed into a distributed servlet
+container
+
+Used in: web-app
+-->
+<!ELEMENT distributable EMPTY>
+
+<!--
+The ejb-link element is used in the ejb-ref or ejb-local-ref
+elements to specify that an EJB reference is linked to an
+enterprise bean.
+
+The name in the ejb-link element is composed of a
+path name specifying the ejb-jar containing the referenced enterprise
+bean with the ejb-name of the target bean appended and separated from
+the path name by "#".  The path name is relative to the war file
+containing the web application that is referencing the enterprise bean.
+This allows multiple enterprise beans with the same ejb-name to be
+uniquely identified.
+
+Used in: ejb-local-ref, ejb-ref
+
+Examples:
+
+	<ejb-link>EmployeeRecord</ejb-link>
+
+	<ejb-link>../products/product.jar#ProductEJB</ejb-link>
+
+-->
+<!ELEMENT ejb-link (#PCDATA)>
+
+<!--
+The ejb-local-ref element is used for the declaration of a reference to
+an enterprise bean's local home. The declaration consists of:
+
+	- an optional description
+	- the EJB reference name used in the code of the web application
+	  that's referencing the enterprise bean
+	- the expected type of the referenced enterprise bean
+	- the expected local home and local interfaces of the referenced
+	  enterprise bean
+	- optional ejb-link information, used to specify the referenced
+	  enterprise bean
+
+Used in: web-app
+-->
+<!ELEMENT ejb-local-ref (description?, ejb-ref-name, ejb-ref-type,
+		local-home, local, ejb-link?)>
+
+<!--
+The ejb-ref element is used for the declaration of a reference to
+an enterprise bean's home. The declaration consists of:
+
+	- an optional description
+	- the EJB reference name used in the code of
+	  the web application that's referencing the enterprise bean
+	- the expected type of the referenced enterprise bean
+	- the expected home and remote interfaces of the referenced
+	  enterprise bean
+	- optional ejb-link information, used to specify the referenced
+	  enterprise bean
+
+Used in: web-app
+-->
+<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type,
+		home, remote, ejb-link?)>
+
+<!--
+The ejb-ref-name element contains the name of an EJB reference. The
+EJB reference is an entry in the web application's environment and is
+relative to the java:comp/env context.  The name must be unique
+within the web application.
+
+It is recommended that name is prefixed with "ejb/".
+
+Used in: ejb-local-ref, ejb-ref
+
+Example:
+
+<ejb-ref-name>ejb/Payroll</ejb-ref-name>
+-->
+<!ELEMENT ejb-ref-name (#PCDATA)>
+
+<!--
+The ejb-ref-type element contains the expected type of the
+referenced enterprise bean.
+
+The ejb-ref-type element must be one of the following:
+
+	<ejb-ref-type>Entity</ejb-ref-type>
+	<ejb-ref-type>Session</ejb-ref-type>
+
+Used in: ejb-local-ref, ejb-ref
+-->
+<!ELEMENT ejb-ref-type (#PCDATA)>
+
+<!--
+The env-entry element contains the declaration of a web application's
+environment entry. The declaration consists of an optional
+description, the name of the environment entry, and an optional
+value.  If a value is not specified, one must be supplied
+during deployment.
+-->
+<!ELEMENT env-entry (description?, env-entry-name, env-entry-value?,
+env-entry-type)>
+
+<!--
+The env-entry-name element contains the name of a web applications's
+environment entry.  The name is a JNDI name relative to the
+java:comp/env context.  The name must be unique within a web application.
+
+Example:
+
+<env-entry-name>minAmount</env-entry-name>
+
+Used in: env-entry
+-->
+<!ELEMENT env-entry-name (#PCDATA)>
+
+<!--
+The env-entry-type element contains the fully-qualified Java type of
+the environment entry value that is expected by the web application's
+code.
+
+The following are the legal values of env-entry-type:
+
+	java.lang.Boolean
+	java.lang.Byte
+	java.lang.Character
+	java.lang.String
+	java.lang.Short
+	java.lang.Integer
+	java.lang.Long
+	java.lang.Float
+	java.lang.Double
+
+Used in: env-entry
+-->
+<!ELEMENT env-entry-type (#PCDATA)>
+
+<!--
+The env-entry-value element contains the value of a web application's
+environment entry. The value must be a String that is valid for the
+constructor of the specified type that takes a single String
+parameter, or for java.lang.Character, a single character.
+
+Example:
+
+<env-entry-value>100.00</env-entry-value>
+
+Used in: env-entry
+-->
+<!ELEMENT env-entry-value (#PCDATA)>
+
+<!--
+The error-code contains an HTTP error code, ex: 404
+
+Used in: error-page
+-->
+<!ELEMENT error-code (#PCDATA)>
+
+<!--
+The error-page element contains a mapping between an error code
+or exception type to the path of a resource in the web application
+
+Used in: web-app
+-->
+<!ELEMENT error-page ((error-code | exception-type), location)>
+
+<!--
+The exception type contains a fully qualified class name of a
+Java exception type.
+
+Used in: error-page
+-->
+<!ELEMENT exception-type (#PCDATA)>
+
+<!--
+The extension element contains a string describing an
+extension. example: "txt"
+
+Used in: mime-mapping
+-->
+<!ELEMENT extension (#PCDATA)>
+
+<!--
+Declares a filter in the web application. The filter is mapped to
+either a servlet or a URL pattern in the filter-mapping element, using
+the filter-name value to reference. Filters can access the
+initialization parameters declared in the deployment descriptor at
+runtime via the FilterConfig interface.
+
+Used in: web-app
+-->
+<!ELEMENT filter (icon?, filter-name, display-name?, description?,
+filter-class, init-param*)>
+
+<!--
+The fully qualified classname of the filter.
+
+Used in: filter
+-->
+<!ELEMENT filter-class (#PCDATA)>
+
+<!--
+Declaration of the filter mappings in this web application. The
+container uses the filter-mapping declarations to decide which filters
+to apply to a request, and in what order. The container matches the
+request URI to a Servlet in the normal way. To determine which filters
+to apply it matches filter-mapping declarations either on servlet-name,
+or on url-pattern for each filter-mapping element, depending on which
+style is used. The order in which filters are invoked is the order in
+which filter-mapping declarations that match a request URI for a
+servlet appear in the list of filter-mapping elements.The filter-name
+value must be the value of the <filter-name> sub-elements of one of the
+<filter> declarations in the deployment descriptor.
+
+Used in: web-app
+-->
+<!ELEMENT filter-mapping (filter-name, (url-pattern | servlet-name))>
+
+<!--
+The logical name of the filter. This name is used to map the filter.
+Each filter name is unique within the web application.
+
+Used in: filter, filter-mapping
+-->
+<!ELEMENT filter-name (#PCDATA)>
+
+<!--
+The form-error-page element defines the location in the web app
+where the error page that is displayed when login is not successful
+can be found. The path begins with a leading / and is interpreted
+relative to the root of the WAR.
+
+Used in: form-login-config
+-->
+<!ELEMENT form-error-page (#PCDATA)>
+
+<!--
+The form-login-config element specifies the login and error pages
+that should be used in form based login. If form based authentication
+is not used, these elements are ignored.
+
+Used in: login-config
+-->
+<!ELEMENT form-login-config (form-login-page, form-error-page)>
+
+<!--
+The form-login-page element defines the location in the web app
+where the page that can be used for login can be found. The path
+begins with a leading / and is interpreted relative to the root of the WAR.
+
+Used in: form-login-config
+-->
+<!ELEMENT form-login-page (#PCDATA)>
+
+<!--
+The home element contains the fully-qualified name of the enterprise
+bean's home interface.
+
+Used in: ejb-ref
+
+Example:
+
+<home>com.aardvark.payroll.PayrollHome</home>
+-->
+<!ELEMENT home (#PCDATA)>
+
+<!--
+The http-method contains an HTTP method (GET | POST |...).
+
+Used in: web-resource-collection
+-->
+<!ELEMENT http-method (#PCDATA)>
+
+<!--
+The icon element contains small-icon and large-icon elements that
+specify the file names for small and a large GIF or JPEG icon images
+used to represent the parent element in a GUI tool.
+
+Used in: filter, servlet, web-app
+-->
+<!ELEMENT icon (small-icon?, large-icon?)>
+
+<!--
+The init-param element contains a name/value pair as an
+initialization param of the servlet
+
+Used in: filter, servlet
+-->
+<!ELEMENT init-param (param-name, param-value, description?)>
+
+<!--
+The jsp-file element contains the full path to a JSP file within
+the web application beginning with a `/'.
+
+Used in: servlet
+-->
+<!ELEMENT jsp-file (#PCDATA)>
+
+<!--
+The large-icon element contains the name of a file
+containing a large (32 x 32) icon image. The file
+name is a relative path within the web application's
+war file.
+
+The image may be either in the JPEG or GIF format.
+The icon can be used by tools.
+
+Used in: icon
+
+Example:
+
+<large-icon>employee-service-icon32x32.jpg</large-icon>
+-->
+<!ELEMENT large-icon (#PCDATA)>
+
+<!--
+The listener element indicates the deployment properties for a web
+application listener bean.
+
+Used in: web-app
+-->
+<!ELEMENT listener (listener-class)>
+
+<!--
+The listener-class element declares a class in the application must be
+registered as a web application listener bean. The value is the fully qualified classname of the listener class.
+
+
+Used in: listener
+-->
+<!ELEMENT listener-class (#PCDATA)>
+
+<!--
+The load-on-startup element indicates that this servlet should be
+loaded (instantiated and have its init() called) on the startup
+of the web application. The optional contents of
+these element must be an integer indicating the order in which
+the servlet should be loaded. If the value is a negative integer,
+or the element is not present, the container is free to load the
+servlet whenever it chooses. If the value is a positive integer
+or 0, the container must load and initialize the servlet as the
+application is deployed. The container must guarantee that
+servlets marked with lower integers are loaded before servlets
+marked with higher integers. The container may choose the order
+of loading of servlets with the same load-on-start-up value.
+
+Used in: servlet
+-->
+<!ELEMENT load-on-startup (#PCDATA)>
+
+<!--
+
+The local element contains the fully-qualified name of the
+enterprise bean's local interface.
+
+Used in: ejb-local-ref
+
+-->
+<!ELEMENT local (#PCDATA)>
+
+<!--
+
+The local-home element contains the fully-qualified name of the
+enterprise bean's local home interface.
+
+Used in: ejb-local-ref
+-->
+<!ELEMENT local-home (#PCDATA)>
+
+<!--
+The location element contains the location of the resource in the web
+application relative to the root of the web application. The value of
+the location must have a leading `/'.
+
+Used in: error-page
+-->
+<!ELEMENT location (#PCDATA)>
+
+<!--
+The login-config element is used to configure the authentication
+method that should be used, the realm name that should be used for
+this application, and the attributes that are needed by the form login
+mechanism.
+
+Used in: web-app
+-->
+<!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)>
+
+<!--
+The mime-mapping element defines a mapping between an extension
+and a mime type.
+
+Used in: web-app
+-->
+<!ELEMENT mime-mapping (extension, mime-type)>
+
+<!--
+The mime-type element contains a defined mime type. example:
+"text/plain"
+
+Used in: mime-mapping
+-->
+<!ELEMENT mime-type (#PCDATA)>
+
+<!--
+The param-name element contains the name of a parameter. Each parameter
+name must be unique in the web application.
+
+
+Used in: context-param, init-param
+-->
+<!ELEMENT param-name (#PCDATA)>
+
+<!--
+The param-value element contains the value of a parameter.
+
+Used in: context-param, init-param
+-->
+<!ELEMENT param-value (#PCDATA)>
+
+<!--
+The realm name element specifies the realm name to use in HTTP
+Basic authorization.
+
+Used in: login-config
+-->
+<!ELEMENT realm-name (#PCDATA)>
+
+<!--
+The remote element contains the fully-qualified name of the enterprise
+bean's remote interface.
+
+Used in: ejb-ref
+
+Example:
+
+<remote>com.wombat.empl.EmployeeService</remote>
+-->
+<!ELEMENT remote (#PCDATA)>
+
+<!--
+The res-auth element specifies whether the web application code signs
+on programmatically to the resource manager, or whether the Container
+will sign on to the resource manager on behalf of the web application. In the
+latter case, the Container uses information that is supplied by the
+Deployer.
+
+The value of this element must be one of the two following:
+
+	<res-auth>Application</res-auth>
+	<res-auth>Container</res-auth>
+
+Used in: resource-ref
+-->
+<!ELEMENT res-auth (#PCDATA)>
+
+<!--
+The res-ref-name element specifies the name of a resource manager
+connection factory reference.  The name is a JNDI name relative to the
+java:comp/env context.  The name must be unique within a web application.
+
+Used in: resource-ref
+-->
+<!ELEMENT res-ref-name (#PCDATA)>
+
+<!--
+The res-sharing-scope element specifies whether connections obtained
+through the given resource manager connection factory reference can be
+shared. The value of this element, if specified, must be one of the
+two following:
+
+	<res-sharing-scope>Shareable</res-sharing-scope>
+	<res-sharing-scope>Unshareable</res-sharing-scope>
+
+The default value is Shareable.
+
+Used in: resource-ref
+-->
+<!ELEMENT res-sharing-scope (#PCDATA)>
+
+<!--
+The res-type element specifies the type of the data source. The type
+is specified by the fully qualified Java language class or interface
+expected to be implemented by the data source.
+
+Used in: resource-ref
+-->
+<!ELEMENT res-type (#PCDATA)>
+
+<!--
+The resource-env-ref element contains a declaration of a web application's
+reference to an administered object associated with a resource
+in the web application's environment.  It consists of an optional
+description, the resource environment reference name, and an
+indication of the resource environment reference type expected by
+the web application code.
+
+Used in: web-app
+
+Example:
+
+<resource-env-ref>
+    <resource-env-ref-name>jms/StockQueue</resource-env-ref-name>
+    <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
+</resource-env-ref>
+-->
+<!ELEMENT resource-env-ref (description?, resource-env-ref-name,
+		resource-env-ref-type)>
+
+<!--
+The resource-env-ref-name element specifies the name of a resource
+environment reference; its value is the environment entry name used in
+the web application code.  The name is a JNDI name relative to the
+java:comp/env context and must be unique within a web application.
+
+Used in: resource-env-ref
+-->
+<!ELEMENT resource-env-ref-name (#PCDATA)>
+
+<!--
+The resource-env-ref-type element specifies the type of a resource
+environment reference.  It is the fully qualified name of a Java
+language class or interface.
+
+Used in: resource-env-ref
+-->
+<!ELEMENT resource-env-ref-type (#PCDATA)>
+
+<!--
+The resource-ref element contains a declaration of a web application's
+reference to an external resource. It consists of an optional
+description, the resource manager connection factory reference name,
+the indication of the resource manager connection factory type
+expected by the web application code, the type of authentication
+(Application or Container), and an optional specification of the
+shareability of connections obtained from the resource (Shareable or
+Unshareable).
+
+Used in: web-app
+
+Example:
+
+    <resource-ref>
+	<res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
+	<res-type>javax.sql.DataSource</res-type>
+	<res-auth>Container</res-auth>
+	<res-sharing-scope>Shareable</res-sharing-scope>
+    </resource-ref>
+-->
+<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth,
+		res-sharing-scope?)>
+
+<!--
+The role-link element is a reference to a defined security role. The
+role-link element must contain the name of one of the security roles
+defined in the security-role elements.
+
+Used in: security-role-ref
+-->
+<!ELEMENT role-link (#PCDATA)>
+
+<!--
+The role-name element contains the name of a security role.
+
+The name must conform to the lexical rules for an NMTOKEN.
+
+Used in: auth-constraint, run-as, security-role, security-role-ref
+-->
+<!ELEMENT role-name (#PCDATA)>
+
+<!--
+The run-as element specifies the run-as identity to be used for the
+execution of the web application. It contains an optional description, and
+the name of a security role.
+
+Used in: servlet
+-->
+<!ELEMENT run-as (description?, role-name)>
+
+<!--
+The security-constraint element is used to associate security
+constraints with one or more web resource collections
+
+Used in: web-app
+-->
+<!ELEMENT security-constraint (display-name?, web-resource-collection+,
+auth-constraint?, user-data-constraint?)>
+
+<!--
+The security-role element contains the definition of a security
+role. The definition consists of an optional description of the
+security role, and the security role name.
+
+Used in: web-app
+
+Example:
+
+    <security-role>
+	<description>
+	    This role includes all employees who are authorized
+	    to access the employee service application.
+	</description>
+	<role-name>employee</role-name>
+    </security-role>
+-->
+<!ELEMENT security-role (description?, role-name)>
+
+<!--
+The security-role-ref element contains the declaration of a security
+role reference in the web application's code. The declaration consists
+of an optional description, the security role name used in the code,
+and an optional link to a security role. If the security role is not
+specified, the Deployer must choose an appropriate security role.
+
+The value of the role-name element must be the String used as the
+parameter to the EJBContext.isCallerInRole(String roleName) method
+or the HttpServletRequest.isUserInRole(String role) method.
+
+Used in: servlet
+
+-->
+<!ELEMENT security-role-ref (description?, role-name, role-link?)>
+
+<!--
+The servlet element contains the declarative data of a
+servlet. If a jsp-file is specified and the load-on-startup element is
+present, then the JSP should be precompiled and loaded.
+
+Used in: web-app
+-->
+<!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
+(servlet-class|jsp-file), init-param*, load-on-startup?, run-as?, security-role-ref*)>
+
+<!--
+The servlet-class element contains the fully qualified class name
+of the servlet.
+
+Used in: servlet
+-->
+<!ELEMENT servlet-class (#PCDATA)>
+
+<!--
+The servlet-mapping element defines a mapping between a servlet
+and a url pattern
+
+Used in: web-app
+-->
+<!ELEMENT servlet-mapping (servlet-name, url-pattern)>
+
+<!--
+The servlet-name element contains the canonical name of the
+servlet. Each servlet name is unique within the web application.
+
+Used in: filter-mapping, servlet, servlet-mapping
+-->
+<!ELEMENT servlet-name (#PCDATA)>
+
+<!--
+The session-config element defines the session parameters for
+this web application.
+
+Used in: web-app
+-->
+<!ELEMENT session-config (session-timeout?)>
+
+<!--
+The session-timeout element defines the default session timeout
+interval for all sessions created in this web application. The
+specified timeout must be expressed in a whole number of minutes.
+If the timeout is 0 or less, the container ensures the default
+behaviour of sessions is never to time out.
+
+Used in: session-config
+-->
+<!ELEMENT session-timeout (#PCDATA)>
+
+<!--
+The small-icon element contains the name of a file
+containing a small (16 x 16) icon image. The file
+name is a relative path within the web application's
+war file.
+
+The image may be either in the JPEG or GIF format.
+The icon can be used by tools.
+
+Used in: icon
+
+Example:
+
+<small-icon>employee-service-icon16x16.jpg</small-icon>
+-->
+<!ELEMENT small-icon (#PCDATA)>
+
+<!--
+The taglib element is used to describe a JSP tag library.
+
+Used in: web-app
+-->
+<!ELEMENT taglib (taglib-uri, taglib-location)>
+
+<!--
+the taglib-location element contains the location (as a resource
+relative to the root of the web application) where to find the Tag
+Libary Description file for the tag library.
+
+Used in: taglib
+-->
+<!ELEMENT taglib-location (#PCDATA)>
+
+<!--
+The taglib-uri element describes a URI, relative to the location
+of the web.xml document, identifying a Tag Library used in the Web
+Application.
+
+Used in: taglib
+-->
+<!ELEMENT taglib-uri (#PCDATA)>
+
+<!--
+The transport-guarantee element specifies that the communication
+between client and server should be NONE, INTEGRAL, or
+CONFIDENTIAL. NONE means that the application does not require any
+transport guarantees. A value of INTEGRAL means that the application
+requires that the data sent between the client and server be sent in
+such a way that it can't be changed in transit. CONFIDENTIAL means
+that the application requires that the data be transmitted in a
+fashion that prevents other entities from observing the contents of
+the transmission. In most cases, the presence of the INTEGRAL or
+CONFIDENTIAL flag will indicate that the use of SSL is required.
+
+Used in: user-data-constraint
+-->
+<!ELEMENT transport-guarantee (#PCDATA)>
+
+<!--
+The url-pattern element contains the url pattern of the mapping. Must
+follow the rules specified in Section 11.2 of the Servlet API
+Specification.
+
+Used in: filter-mapping, servlet-mapping, web-resource-collection
+-->
+<!ELEMENT url-pattern (#PCDATA)>
+
+<!--
+The user-data-constraint element is used to indicate how data
+communicated between the client and container should be protected.
+
+Used in: security-constraint
+-->
+<!ELEMENT user-data-constraint (description?, transport-guarantee)>
+
+<!--
+The web-resource-collection element is used to identify a subset
+of the resources and HTTP methods on those resources within a web
+application to which a security constraint applies. If no HTTP methods
+are specified, then the security constraint applies to all HTTP
+methods.
+
+Used in: security-constraint
+-->
+<!ELEMENT web-resource-collection (web-resource-name, description?,
+url-pattern*, http-method*)>
+
+<!--
+The web-resource-name contains the name of this web resource
+collection.
+
+Used in: web-resource-collection
+-->
+<!ELEMENT web-resource-name (#PCDATA)>
+
+<!--
+The welcome-file element contains file name to use as a default
+welcome file, such as index.html
+
+Used in: welcome-file-list
+-->
+<!ELEMENT welcome-file (#PCDATA)>
+
+<!--
+The welcome-file-list contains an ordered list of welcome files
+elements.
+
+Used in: web-app
+-->
+<!ELEMENT welcome-file-list (welcome-file+)>
+
+<!--
+The ID mechanism is to allow tools that produce additional deployment
+information (i.e., information beyond the standard deployment
+descriptor information) to store the non-standard information in a
+separate file, and easily refer from these tool-specific files to the
+information in the standard deployment descriptor.
+
+Tools are not allowed to add the non-standard information into the
+standard deployment descriptor.
+-->
+
+<!ATTLIST auth-constraint id ID #IMPLIED>
+<!ATTLIST auth-method id ID #IMPLIED>
+<!ATTLIST context-param id ID #IMPLIED>
+<!ATTLIST description id ID #IMPLIED>
+<!ATTLIST display-name id ID #IMPLIED>
+<!ATTLIST distributable id ID #IMPLIED>
+<!ATTLIST ejb-link id ID #IMPLIED>
+<!ATTLIST ejb-local-ref id ID #IMPLIED>
+<!ATTLIST ejb-ref id ID #IMPLIED>
+<!ATTLIST ejb-ref-name id ID #IMPLIED>
+<!ATTLIST ejb-ref-type id ID #IMPLIED>
+<!ATTLIST env-entry id ID #IMPLIED>
+<!ATTLIST env-entry-name id ID #IMPLIED>
+<!ATTLIST env-entry-type id ID #IMPLIED>
+<!ATTLIST env-entry-value id ID #IMPLIED>
+<!ATTLIST error-code id ID #IMPLIED>
+<!ATTLIST error-page id ID #IMPLIED>
+<!ATTLIST exception-type id ID #IMPLIED>
+<!ATTLIST extension id ID #IMPLIED>
+<!ATTLIST filter id ID #IMPLIED>
+<!ATTLIST filter-class id ID #IMPLIED>
+<!ATTLIST filter-mapping id ID #IMPLIED>
+<!ATTLIST filter-name id ID #IMPLIED>
+<!ATTLIST form-error-page id ID #IMPLIED>
+<!ATTLIST form-login-config id ID #IMPLIED>
+<!ATTLIST form-login-page id ID #IMPLIED>
+<!ATTLIST home id ID #IMPLIED>
+<!ATTLIST http-method id ID #IMPLIED>
+<!ATTLIST icon id ID #IMPLIED>
+<!ATTLIST init-param id ID #IMPLIED>
+<!ATTLIST jsp-file id ID #IMPLIED>
+<!ATTLIST large-icon id ID #IMPLIED>
+<!ATTLIST listener id ID #IMPLIED>
+<!ATTLIST listener-class id ID #IMPLIED>
+<!ATTLIST load-on-startup id ID #IMPLIED>
+<!ATTLIST local id ID #IMPLIED>
+<!ATTLIST local-home id ID #IMPLIED>
+<!ATTLIST location id ID #IMPLIED>
+<!ATTLIST login-config id ID #IMPLIED>
+<!ATTLIST mime-mapping id ID #IMPLIED>
+<!ATTLIST mime-type id ID #IMPLIED>
+<!ATTLIST param-name id ID #IMPLIED>
+<!ATTLIST param-value id ID #IMPLIED>
+<!ATTLIST realm-name id ID #IMPLIED>
+<!ATTLIST remote id ID #IMPLIED>
+<!ATTLIST res-auth id ID #IMPLIED>
+<!ATTLIST res-ref-name id ID #IMPLIED>
+<!ATTLIST res-sharing-scope id ID #IMPLIED>
+<!ATTLIST res-type id ID #IMPLIED>
+<!ATTLIST resource-env-ref id ID #IMPLIED>
+<!ATTLIST resource-env-ref-name id ID #IMPLIED>
+<!ATTLIST resource-env-ref-type id ID #IMPLIED>
+<!ATTLIST resource-ref id ID #IMPLIED>
+<!ATTLIST role-link id ID #IMPLIED>
+<!ATTLIST role-name id ID #IMPLIED>
+<!ATTLIST run-as id ID #IMPLIED>
+<!ATTLIST security-constraint id ID #IMPLIED>
+<!ATTLIST security-role id ID #IMPLIED>
+<!ATTLIST security-role-ref id ID #IMPLIED>
+<!ATTLIST servlet id ID #IMPLIED>
+<!ATTLIST servlet-class id ID #IMPLIED>
+<!ATTLIST servlet-mapping id ID #IMPLIED>
+<!ATTLIST servlet-name id ID #IMPLIED>
+<!ATTLIST session-config id ID #IMPLIED>
+<!ATTLIST session-timeout id ID #IMPLIED>
+<!ATTLIST small-icon id ID #IMPLIED>
+<!ATTLIST taglib id ID #IMPLIED>
+<!ATTLIST taglib-location id ID #IMPLIED>
+<!ATTLIST taglib-uri id ID #IMPLIED>
+<!ATTLIST transport-guarantee id ID #IMPLIED>
+<!ATTLIST url-pattern id ID #IMPLIED>
+<!ATTLIST user-data-constraint id ID #IMPLIED>
+<!ATTLIST web-app id ID #IMPLIED>
+<!ATTLIST web-resource-collection id ID #IMPLIED>
+<!ATTLIST web-resource-name id ID #IMPLIED>
+<!ATTLIST welcome-file id ID #IMPLIED>
+<!ATTLIST welcome-file-list id ID #IMPLIED>
diff --git a/xml/tests/testData/smartEnter/CompleteMissingTag.xml b/xml/tests/testData/smartEnter/CompleteMissingTag.xml
new file mode 100644
index 0000000..d510c01
--- /dev/null
+++ b/xml/tests/testData/smartEnter/CompleteMissingTag.xml
@@ -0,0 +1,8 @@
+<html>
+    <head>
+        <title>My page</title>
+    </head>
+    <body>
+        <div><h1>Hello</h1></div>
+        <div><caret>
+          <b>Some text<i>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/CompleteMissingTag_after_1.xml b/xml/tests/testData/smartEnter/CompleteMissingTag_after_1.xml
new file mode 100644
index 0000000..2c670d3
--- /dev/null
+++ b/xml/tests/testData/smartEnter/CompleteMissingTag_after_1.xml
@@ -0,0 +1,12 @@
+<html>
+    <head>
+        <title>My page</title>
+    </head>
+    <body>
+        <div>
+            <h1>Hello</h1>
+        </div>
+        <div>
+            <b>Some text
+            <i><caret>
+        </div>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/CompleteMissingTag_after_2.xml b/xml/tests/testData/smartEnter/CompleteMissingTag_after_2.xml
new file mode 100644
index 0000000..0adc97e
--- /dev/null
+++ b/xml/tests/testData/smartEnter/CompleteMissingTag_after_2.xml
@@ -0,0 +1,13 @@
+<html>
+    <head>
+        <title>My page</title>
+    </head>
+    <body>
+        <div>
+            <h1>Hello</h1>
+        </div>
+        <div>
+            <b>Some text
+            <i>
+            <caret></i>
+        </div>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/CompleteMissingTag_after_3.xml b/xml/tests/testData/smartEnter/CompleteMissingTag_after_3.xml
new file mode 100644
index 0000000..56f891c
--- /dev/null
+++ b/xml/tests/testData/smartEnter/CompleteMissingTag_after_3.xml
@@ -0,0 +1,14 @@
+<html>
+    <head>
+        <title>My page</title>
+    </head>
+    <body>
+        <div>
+            <h1>Hello</h1>
+        </div>
+        <div>
+            <b>Some text
+                <i>
+                </i>
+            <caret></b>
+        </div>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/CompleteMissingTag_after_4.xml b/xml/tests/testData/smartEnter/CompleteMissingTag_after_4.xml
new file mode 100644
index 0000000..bb3b028
--- /dev/null
+++ b/xml/tests/testData/smartEnter/CompleteMissingTag_after_4.xml
@@ -0,0 +1,15 @@
+<html>
+    <head>
+        <title>My page</title>
+    </head>
+    <body>
+        <div>
+            <h1>Hello</h1>
+        </div>
+        <div>
+            <b>Some text
+                <i>
+                </i>
+            </b>
+        </div><caret>
+    </body>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/CompleteMissingTag_after_5.xml b/xml/tests/testData/smartEnter/CompleteMissingTag_after_5.xml
new file mode 100644
index 0000000..1963d3c
--- /dev/null
+++ b/xml/tests/testData/smartEnter/CompleteMissingTag_after_5.xml
@@ -0,0 +1,16 @@
+<html>
+    <head>
+        <title>My page</title>
+    </head>
+    <body>
+        <div>
+            <h1>Hello</h1>
+        </div>
+        <div>
+            <b>Some text
+                <i>
+                </i>
+            </b>
+        </div>
+    </body><caret>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/IDEADEV_29628.xml b/xml/tests/testData/smartEnter/IDEADEV_29628.xml
new file mode 100644
index 0000000..211a8f2
--- /dev/null
+++ b/xml/tests/testData/smartEnter/IDEADEV_29628.xml
@@ -0,0 +1 @@
+<label for="email<caret>"
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/IDEADEV_29628_after.xml b/xml/tests/testData/smartEnter/IDEADEV_29628_after.xml
new file mode 100644
index 0000000..7df4335
--- /dev/null
+++ b/xml/tests/testData/smartEnter/IDEADEV_29628_after.xml
@@ -0,0 +1 @@
+<label for="email"></label>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/OpenAttribute.xml b/xml/tests/testData/smartEnter/OpenAttribute.xml
new file mode 100644
index 0000000..0bfad0e
--- /dev/null
+++ b/xml/tests/testData/smartEnter/OpenAttribute.xml
@@ -0,0 +1 @@
+<label for="email<caret>text
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/OpenAttribute_after.xml b/xml/tests/testData/smartEnter/OpenAttribute_after.xml
new file mode 100644
index 0000000..f789f8e4
--- /dev/null
+++ b/xml/tests/testData/smartEnter/OpenAttribute_after.xml
@@ -0,0 +1 @@
+<label for="email">text<caret></label>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/SmartFinish1.xml b/xml/tests/testData/smartEnter/SmartFinish1.xml
new file mode 100644
index 0000000..06c57cd
--- /dev/null
+++ b/xml/tests/testData/smartEnter/SmartFinish1.xml
@@ -0,0 +1,4 @@
+<a>
+    <b>tttt</b>
+    <b<caret>test text
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/SmartFinish1_after.xml b/xml/tests/testData/smartEnter/SmartFinish1_after.xml
new file mode 100644
index 0000000..19493cd
--- /dev/null
+++ b/xml/tests/testData/smartEnter/SmartFinish1_after.xml
@@ -0,0 +1,4 @@
+<a>
+    <b>tttt</b>
+    <b>test text<caret></b>
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/SmartFinish2.xml b/xml/tests/testData/smartEnter/SmartFinish2.xml
new file mode 100644
index 0000000..338caad
--- /dev/null
+++ b/xml/tests/testData/smartEnter/SmartFinish2.xml
@@ -0,0 +1,4 @@
+<a>
+    <b><c>test</c></b>
+    <b<caret><c>test</c>
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/SmartFinish2_after.xml b/xml/tests/testData/smartEnter/SmartFinish2_after.xml
new file mode 100644
index 0000000..a44ea19
--- /dev/null
+++ b/xml/tests/testData/smartEnter/SmartFinish2_after.xml
@@ -0,0 +1,6 @@
+<a>
+    <b><c>test</c></b>
+    <b>
+        <c>test</c><caret>
+    </b>
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/SmartFinish3.xml b/xml/tests/testData/smartEnter/SmartFinish3.xml
new file mode 100644
index 0000000..02ac7e4
--- /dev/null
+++ b/xml/tests/testData/smartEnter/SmartFinish3.xml
@@ -0,0 +1,4 @@
+<a>
+    <b><c>test</c></b>
+    <b<caret> <c>test</c>
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/SmartFinish3_after.xml b/xml/tests/testData/smartEnter/SmartFinish3_after.xml
new file mode 100644
index 0000000..a44ea19
--- /dev/null
+++ b/xml/tests/testData/smartEnter/SmartFinish3_after.xml
@@ -0,0 +1,6 @@
+<a>
+    <b><c>test</c></b>
+    <b>
+        <c>test</c><caret>
+    </b>
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/Tag.xml b/xml/tests/testData/smartEnter/Tag.xml
new file mode 100644
index 0000000..a20556d
--- /dev/null
+++ b/xml/tests/testData/smartEnter/Tag.xml
@@ -0,0 +1 @@
+<div <caret>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/Tag_after.xml b/xml/tests/testData/smartEnter/Tag_after.xml
new file mode 100644
index 0000000..4a16c47d
--- /dev/null
+++ b/xml/tests/testData/smartEnter/Tag_after.xml
@@ -0,0 +1 @@
+<div/><caret>
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/WrongAttribute.xml b/xml/tests/testData/smartEnter/WrongAttribute.xml
new file mode 100644
index 0000000..164c128
--- /dev/null
+++ b/xml/tests/testData/smartEnter/WrongAttribute.xml
@@ -0,0 +1 @@
+<label for="email<caret>"wrong
\ No newline at end of file
diff --git a/xml/tests/testData/smartEnter/WrongAttribute_after.xml b/xml/tests/testData/smartEnter/WrongAttribute_after.xml
new file mode 100644
index 0000000..884801c
--- /dev/null
+++ b/xml/tests/testData/smartEnter/WrongAttribute_after.xml
@@ -0,0 +1 @@
+<label for="email">wrong<caret></label>
\ No newline at end of file
diff --git a/xml/tests/testData/unusedNs/moved.xml b/xml/tests/testData/unusedNs/moved.xml
new file mode 100644
index 0000000..c4b5e3c
--- /dev/null
+++ b/xml/tests/testData/unusedNs/moved.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root xmlns="nsx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="nsx trg/move-def.xsd">
+        String.
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/unusedNs/trg/move-def.xsd b/xml/tests/testData/unusedNs/trg/move-def.xsd
new file mode 100644
index 0000000..5055e94
--- /dev/null
+++ b/xml/tests/testData/unusedNs/trg/move-def.xsd
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                   targetNamespace="nsx"
+                   xmlns="nsx"
+                   elementFormDefault="qualified"
+                   attributeFormDefault="unqualified">
+
+        <xs:element name="root" type="xs:string"/>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/unusedNs/web-app_2_5.xsd b/xml/tests/testData/unusedNs/web-app_2_5.xsd
new file mode 100644
index 0000000..28e956f
--- /dev/null
+++ b/xml/tests/testData/unusedNs/web-app_2_5.xsd
@@ -0,0 +1,1290 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ The contents of this file are subject to the terms
+ of the Common Development and Distribution License
+ (the "License").  You may not use this file except
+ in compliance with the License.
+
+ You can obtain a copy of the license at
+ glassfish/bootstrap/legal/CDDLv1.0.txt or
+ https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ See the License for the specific language governing
+ permissions and limitations under the License.
+
+ When distributing Covered Code, include this CDDL
+ HEADER in each file and include the License file at
+ glassfish/bootstrap/legal/CDDLv1.0.txt.  If applicable,
+ add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your
+ own identifying information: Portions Copyright [yyyy]
+ [name of copyright owner]
+-->
+
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+	    targetNamespace="http://java.sun.com/xml/ns/javaee"
+	    xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	    elementFormDefault="qualified"
+	    attributeFormDefault="unqualified"
+	    version="2.5">
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)web-app_2_5.xsds	1.62 05/08/06
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      Copyright 2003-2005 Sun Microsystems, Inc.
+      4150 Network Circle
+      Santa Clara, California 95054
+      U.S.A
+      All rights reserved.
+
+      Sun Microsystems, Inc. has intellectual property rights
+      relating to technology described in this document. In
+      particular, and without limitation, these intellectual
+      property rights may include one or more of the U.S. patents
+      listed at http://www.sun.com/patents and one or more
+      additional patents or pending patent applications in the
+      U.S. and other countries.
+
+      This document and the technology which it describes are
+      distributed under licenses restricting their use, copying,
+      distribution, and decompilation. No part of this document
+      may be reproduced in any form by any means without prior
+      written authorization of Sun and its licensors, if any.
+
+      Third-party software, including font technology, is
+      copyrighted and licensed from Sun suppliers.
+
+      Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
+      JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+      Cup logo are trademarks or registered trademarks of Sun
+      Microsystems, Inc. in the U.S. and other countries.
+
+      Federal Acquisitions: Commercial Software - Government Users
+      Subject to Standard License Terms and Conditions.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[
+
+	This is the XML Schema for the Servlet 2.5 deployment descriptor.
+	The deployment descriptor must be named "WEB-INF/web.xml" in the
+	web application's war file.  All Servlet deployment descriptors
+	must indicate the web application schema by using the Java EE
+	namespace:
+
+	http://java.sun.com/xml/ns/javaee
+
+	and by indicating the version of the schema by
+	using the version element as shown below:
+
+	    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
+	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	      xsi:schemaLocation="..."
+	      version="2.5">
+	      ...
+	    </web-app>
+
+	The instance documents may indicate the published version of
+	the schema using the xsi:schemaLocation attribute for Java EE
+	namespace with the following location:
+
+	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
+
+	]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all Java EE
+      deployment descriptor elements unless indicated otherwise.
+
+      - In elements that specify a pathname to a file within the
+	same JAR file, relative filenames (i.e., those not
+	starting with "/") are considered relative to the root of
+	the JAR file's namespace.  Absolute filenames (i.e., those
+	starting with "/") also specify names in the root of the
+	JAR file's namespace.  In general, relative names are
+	preferred.  The exception is .war files where absolute
+	names are preferred for consistency with the Servlet API.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="javaee_5.xsd"/>
+  <xsd:include schemaLocation="jsp_2_1.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:element name="web-app" type="javaee:web-appType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The web-app element is the root of the deployment
+	descriptor for a web application.  Note that the sub-elements
+	of this element can be in the arbitrary order. Because of
+	that, the multiplicity of the elements of distributable,
+	session-config, welcome-file-list, jsp-config, login-config,
+	and locale-encoding-mapping-list was changed from "?" to "*"
+	in this schema.  However, the deployment descriptor instance
+	file must not contain multiple elements of session-config,
+	jsp-config, and login-config. When there are multiple elements of
+	welcome-file-list or locale-encoding-mapping-list, the container
+	must concatenate the element contents.  The multiple occurence
+	of the element distributable is redundant and the container
+	treats that case exactly in the same way when there is only
+	one distributable.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:unique name="web-app-servlet-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The servlet element contains the name of a servlet.
+	  The name must be unique within the web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:servlet"/>
+      <xsd:field    xpath="javaee:servlet-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-filter-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The filter element contains the name of a filter.
+	  The name must be unique within the web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:filter"/>
+      <xsd:field    xpath="javaee:filter-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-ejb-local-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The ejb-local-ref-name element contains the name of an EJB
+	  reference. The EJB reference is an entry in the web
+	  application's environment and is relative to the
+	  java:comp/env context.  The name must be unique within
+	  the web application.
+
+	  It is recommended that name is prefixed with "ejb/".
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:ejb-local-ref"/>
+      <xsd:field    xpath="javaee:ejb-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-ejb-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The ejb-ref-name element contains the name of an EJB
+	  reference. The EJB reference is an entry in the web
+	  application's environment and is relative to the
+	  java:comp/env context.  The name must be unique within
+	  the web application.
+
+	  It is recommended that name is prefixed with "ejb/".
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:ejb-ref"/>
+      <xsd:field    xpath="javaee:ejb-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-resource-env-ref-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The resource-env-ref-name element specifies the name of
+	  a resource environment reference; its value is the
+	  environment entry name used in the web application code.
+	  The name is a JNDI name relative to the java:comp/env
+	  context and must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-env-ref"/>
+      <xsd:field    xpath="javaee:resource-env-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-message-destination-ref-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The message-destination-ref-name element specifies the name of
+	  a message destination reference; its value is the
+	  environment entry name used in the web application code.
+	  The name is a JNDI name relative to the java:comp/env
+	  context and must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:message-destination-ref"/>
+      <xsd:field    xpath="javaee:message-destination-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-res-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The res-ref-name element specifies the name of a
+	  resource manager connection factory reference.  The name
+	  is a JNDI name relative to the java:comp/env context.
+	  The name must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-ref"/>
+      <xsd:field    xpath="javaee:res-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-env-entry-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The env-entry-name element contains the name of a web
+	  application's environment entry.  The name is a JNDI
+	  name relative to the java:comp/env context.  The name
+	  must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:selector xpath="javaee:env-entry"/>
+      <xsd:field    xpath="javaee:env-entry-name"/>
+    </xsd:unique>
+
+    <xsd:key name="web-app-role-name-key">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  A role-name-key is specified to allow the references
+	  from the security-role-refs.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:security-role"/>
+      <xsd:field    xpath="javaee:role-name"/>
+    </xsd:key>
+
+    <xsd:keyref name="web-app-role-name-references"
+		refer="javaee:web-app-role-name-key">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The keyref indicates the references from
+	  security-role-ref to a specified role-name.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:servlet/javaee:security-role-ref"/>
+      <xsd:field    xpath="javaee:role-link"/>
+    </xsd:keyref>
+  </xsd:element>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="auth-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The auth-constraintType indicates the user roles that
+	should be permitted access to this resource
+	collection. The role-name used here must either correspond
+	to the role-name of one of the security-role elements
+	defined for this web application, or be the specially
+	reserved role-name "*" that is a compact syntax for
+	indicating all roles in the web application. If both "*"
+	and rolenames appear, the container interprets this as all
+	roles.  If no roles are defined, no user is allowed access
+	to the portion of the web application described by the
+	containing security-constraint.  The container matches
+	role names case sensitively when determining access.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+		   type="javaee:role-nameType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="auth-methodType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The auth-methodType is used to configure the authentication
+	mechanism for the web application. As a prerequisite to
+	gaining access to any web resources which are protected by
+	an authorization constraint, a user must have authenticated
+	using the configured mechanism. Legal values are "BASIC",
+	"DIGEST", "FORM", "CLIENT-CERT", or a vendor-specific
+	authentication scheme.
+
+	Used in: login-config
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="dispatcherType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The dispatcher has four legal values: FORWARD, REQUEST, INCLUDE,
+	and ERROR. A value of FORWARD means the Filter will be applied
+	under RequestDispatcher.forward() calls.  A value of REQUEST
+	means the Filter will be applied under ordinary client calls to
+	the path or servlet. A value of INCLUDE means the Filter will be
+	applied under RequestDispatcher.include() calls.  A value of
+	ERROR means the Filter will be applied under the error page
+	mechanism.  The absence of any dispatcher elements in a
+	filter-mapping indicates a default of applying filters only under
+	ordinary client calls to the path or servlet.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="FORWARD"/>
+	<xsd:enumeration value="INCLUDE"/>
+	<xsd:enumeration value="REQUEST"/>
+	<xsd:enumeration value="ERROR"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="encodingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The encodingType defines IANA character sets.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="[^\s]+"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="error-codeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The error-code contains an HTTP error code, ex: 404
+
+	Used in: error-page
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:xsdPositiveIntegerType">
+	<xsd:pattern value="\d{3}"/>
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="error-pageType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The error-pageType contains a mapping between an error code
+	or exception type to the path of a resource in the web
+	application.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:choice>
+	<xsd:element name="error-code"
+		     type="javaee:error-codeType"/>
+
+	<xsd:element name="exception-type"
+		     type="javaee:fully-qualified-classType">
+	  <xsd:annotation>
+	    <xsd:documentation>
+
+	      The exception-type contains a fully qualified class
+	      name of a Java exception type.
+
+	    </xsd:documentation>
+	  </xsd:annotation>
+	</xsd:element>
+      </xsd:choice>
+
+      <xsd:element name="location"
+		   type="javaee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The location element contains the location of the
+	    resource in the web application relative to the root of
+	    the web application. The value of the location must have
+	    a leading `/'.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filter-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	Declaration of the filter mappings in this web
+	application is done by using filter-mappingType.
+	The container uses the filter-mapping
+	declarations to decide which filters to apply to a request,
+	and in what order. The container matches the request URI to
+	a Servlet in the normal way. To determine which filters to
+	apply it matches filter-mapping declarations either on
+	servlet-name, or on url-pattern for each filter-mapping
+	element, depending on which style is used. The order in
+	which filters are invoked is the order in which
+	filter-mapping declarations that match a request URI for a
+	servlet appear in the list of filter-mapping elements.The
+	filter-name value must be the value of the filter-name
+	sub-elements of one of the filter declarations in the
+	deployment descriptor.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="filter-name"
+		   type="javaee:filter-nameType"/>
+      <xsd:choice minOccurs="1" maxOccurs="unbounded">
+	<xsd:element name="url-pattern"
+		     type="javaee:url-patternType"/>
+	<xsd:element name="servlet-name"
+		     type="javaee:servlet-nameType"/>
+      </xsd:choice>
+      <xsd:element name="dispatcher"
+		   type="javaee:dispatcherType"
+		   minOccurs="0" maxOccurs="4"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filter-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The logical name of the filter is declare
+	by using filter-nameType. This name is used to map the
+	filter.  Each filter name is unique within the web
+	application.
+
+	Used in: filter, filter-mapping
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filterType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The filterType is used to declare a filter in the web
+	application. The filter is mapped to either a servlet or a
+	URL pattern in the filter-mapping element, using the
+	filter-name value to reference. Filters can access the
+	initialization parameters declared in the deployment
+	descriptor at runtime via the FilterConfig interface.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="filter-name"
+		   type="javaee:filter-nameType"/>
+      <xsd:element name="filter-class"
+		   type="javaee:fully-qualified-classType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The fully qualified classname of the filter.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="init-param"
+		   type="javaee:param-valueType"
+		   minOccurs="0" maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The init-param element contains a name/value pair as
+	    an initialization param of a servlet filter
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="form-login-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The form-login-configType specifies the login and error
+	pages that should be used in form based login. If form based
+	authentication is not used, these elements are ignored.
+
+	Used in: login-config
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+
+      <xsd:element name="form-login-page"
+		   type="javaee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The form-login-page element defines the location in the web
+	    app where the page that can be used for login can be
+	    found.  The path begins with a leading / and is interpreted
+	    relative to the root of the WAR.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="form-error-page"
+		   type="javaee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The form-error-page element defines the location in
+	    the web app where the error page that is displayed
+	    when login is not successful can be found.
+	    The path begins with a leading / and is interpreted
+	    relative to the root of the WAR.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="http-methodType">
+    <xsd:annotation>
+
+      <xsd:documentation>
+
+	A HTTP method type as defined in HTTP 1.1 section 2.2.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+     <xsd:restriction base="xsd:token">
+         <xsd:pattern value="[\p{L}-[\p{Cc}\p{Z}]]+"/>
+     </xsd:restriction>
+
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="load-on-startupType">
+    <xsd:union memberTypes="javaee:null-charType xsd:integer"/>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="locale-encoding-mapping-listType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The locale-encoding-mapping-list contains one or more
+	locale-encoding-mapping(s).
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="locale-encoding-mapping"
+		   type="javaee:locale-encoding-mappingType"
+		   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="locale-encoding-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The locale-encoding-mapping contains locale name and
+	encoding name. The locale name must be either "Language-code",
+	such as "ja", defined by ISO-639 or "Language-code_Country-code",
+	such as "ja_JP".  "Country code" is defined by ISO-3166.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="locale"
+		   type="javaee:localeType"/>
+      <xsd:element name="encoding"
+		   type="javaee:encodingType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="localeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The localeType defines valid locale defined by ISO-639-1
+	and ISO-3166.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="[a-z]{2}(_|-)?([\p{L}\-\p{Nd}]{2})?"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="login-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The login-configType is used to configure the authentication
+	method that should be used, the realm name that should be
+	used for this application, and the attributes that are
+	needed by the form login mechanism.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="auth-method"
+		   type="javaee:auth-methodType"
+		   minOccurs="0"/>
+      <xsd:element name="realm-name"
+		   type="javaee:string" minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The realm name element specifies the realm name to
+	    use in HTTP Basic authorization.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="form-login-config"
+		   type="javaee:form-login-configType"
+		   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mime-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The mime-mappingType defines a mapping between an extension
+	and a mime type.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The extension element contains a string describing an
+	  extension. example: "txt"
+
+	</xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:element name="extension"
+		   type="javaee:string"/>
+      <xsd:element name="mime-type"
+		   type="javaee:mime-typeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mime-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The mime-typeType is used to indicate a defined mime type.
+
+	Example:
+	"text/plain"
+
+	Used in: mime-mapping
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:pattern value="[^\p{Cc}^\s]+/[^\p{Cc}^\s]+"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="nonEmptyStringType">
+    <xsd:annotation>
+      <xsd:documentation>
+	This type defines a string which contains at least one
+	character.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:minLength value="1"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="null-charType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value=""/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The security-constraintType is used to associate
+	security constraints with one or more web resource
+	collections
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="display-name"
+		   type="javaee:display-nameType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="web-resource-collection"
+		   type="javaee:web-resource-collectionType"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="auth-constraint"
+		   type="javaee:auth-constraintType"
+		   minOccurs="0"/>
+      <xsd:element name="user-data-constraint"
+		   type="javaee:user-data-constraintType"
+		   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servlet-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servlet-mappingType defines a mapping between a
+	servlet and a url pattern.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="servlet-name"
+		   type="javaee:servlet-nameType"/>
+      <xsd:element name="url-pattern"
+		   type="javaee:url-patternType"
+           minOccurs="1" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servlet-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servlet-name element contains the canonical name of the
+	servlet. Each servlet name is unique within the web
+	application.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servletType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servletType is used to declare a servlet.
+	It contains the declarative data of a
+	servlet. If a jsp-file is specified and the load-on-startup
+	element is present, then the JSP should be precompiled and
+	loaded.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="servlet-name"
+		   type="javaee:servlet-nameType"/>
+      <xsd:choice>
+	<xsd:element name="servlet-class"
+		     type="javaee:fully-qualified-classType">
+	  <xsd:annotation>
+	    <xsd:documentation>
+
+	      The servlet-class element contains the fully
+	      qualified class name of the servlet.
+
+	    </xsd:documentation>
+	  </xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="jsp-file"
+		     type="javaee:jsp-fileType"/>
+
+      </xsd:choice>
+
+      <xsd:element name="init-param"
+		   type="javaee:param-valueType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="load-on-startup"
+		   type="javaee:load-on-startupType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The load-on-startup element indicates that this
+	    servlet should be loaded (instantiated and have
+	    its init() called) on the startup of the web
+	    application. The optional contents of these
+	    element must be an integer indicating the order in
+	    which the servlet should be loaded. If the value
+	    is a negative integer, or the element is not
+	    present, the container is free to load the servlet
+	    whenever it chooses. If the value is a positive
+	    integer or 0, the container must load and
+	    initialize the servlet as the application is
+	    deployed. The container must guarantee that
+	    servlets marked with lower integers are loaded
+	    before servlets marked with higher integers. The
+	    container may choose the order of loading of
+	    servlets with the same load-on-start-up value.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="run-as"
+		   type="javaee:run-asType"
+		   minOccurs="0"/>
+      <xsd:element name="security-role-ref"
+		   type="javaee:security-role-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="session-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The session-configType defines the session parameters
+	for this web application.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="session-timeout"
+		   type="javaee:xsdIntegerType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The session-timeout element defines the default
+	    session timeout interval for all sessions created
+	    in this web application. The specified timeout
+	    must be expressed in a whole number of minutes.
+	    If the timeout is 0 or less, the container ensures
+	    the default behaviour of sessions is never to time
+	    out. If this element is not specified, the container
+	    must set its default timeout period.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="transport-guaranteeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The transport-guaranteeType specifies that the communication
+	between client and server should be NONE, INTEGRAL, or
+	CONFIDENTIAL. NONE means that the application does not
+	require any transport guarantees. A value of INTEGRAL means
+	that the application requires that the data sent between the
+	client and server be sent in such a way that it can't be
+	changed in transit. CONFIDENTIAL means that the application
+	requires that the data be transmitted in a fashion that
+	prevents other entities from observing the contents of the
+	transmission. In most cases, the presence of the INTEGRAL or
+	CONFIDENTIAL flag will indicate that the use of SSL is
+	required.
+
+	Used in: user-data-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="NONE"/>
+	<xsd:enumeration value="INTEGRAL"/>
+	<xsd:enumeration value="CONFIDENTIAL"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="user-data-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The user-data-constraintType is used to indicate how
+	data communicated between the client and container should be
+	protected.
+
+	Used in: security-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="transport-guarantee"
+		   type="javaee:transport-guaranteeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="war-pathType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The elements that use this type designate a path starting
+	with a "/" and interpreted relative to the root of a WAR
+	file.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:pattern value="/.*"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="web-app-versionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type contains the recognized versions of
+	web-application supported. It is used to designate the
+	version of the web application.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="2.5"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="web-appType">
+
+    <xsd:choice minOccurs="0" maxOccurs="unbounded">
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="distributable"
+		   type="javaee:emptyType"/>
+      <xsd:element name="context-param"
+		   type="javaee:param-valueType">
+
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The context-param element contains the declaration
+	    of a web application's servlet context
+	    initialization parameters.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="filter"
+		   type="javaee:filterType"/>
+      <xsd:element name="filter-mapping"
+		   type="javaee:filter-mappingType"/>
+      <xsd:element name="listener"
+		   type="javaee:listenerType"/>
+      <xsd:element name="servlet"
+		   type="javaee:servletType"/>
+      <xsd:element name="servlet-mapping"
+		   type="javaee:servlet-mappingType"/>
+      <xsd:element name="session-config"
+		   type="javaee:session-configType"/>
+      <xsd:element name="mime-mapping"
+		   type="javaee:mime-mappingType"/>
+      <xsd:element name="welcome-file-list"
+		   type="javaee:welcome-file-listType"/>
+      <xsd:element name="error-page"
+		   type="javaee:error-pageType"/>
+      <xsd:element name="jsp-config"
+		   type="javaee:jsp-configType"/>
+      <xsd:element name="security-constraint"
+		   type="javaee:security-constraintType"/>
+      <xsd:element name="login-config"
+		   type="javaee:login-configType"/>
+      <xsd:element name="security-role"
+		   type="javaee:security-roleType"/>
+      <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
+      <xsd:element name="message-destination"
+		   type="javaee:message-destinationType"/>
+      <xsd:element name="locale-encoding-mapping-list"
+		   type="javaee:locale-encoding-mapping-listType"/>
+    </xsd:choice>
+
+    <xsd:attribute name="version"
+		   type="javaee:web-app-versionType"
+		   use="required"/>
+    <xsd:attribute name="id" type="xsd:ID"/>
+
+    <xsd:attribute name="metadata-complete" type="xsd:boolean">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The metadata-complete attribute defines whether this
+	  deployment descriptor and other related deployment
+	  descriptors for this module (e.g., web service
+	  descriptors) are complete, or whether the class
+	  files available to this module and packaged with
+	  this application should be examined for annotations
+	  that specify deployment information.
+
+	  If metadata-complete is set to "true", the deployment
+	  tool must ignore any annotations that specify deployment
+	  information, which might be present in the class files
+	  of the application.
+
+	  If metadata-complete is not specified or is set to
+	  "false", the deployment tool must examine the class
+	  files of the application for annotations, as
+	  specified by the specifications.
+
+	</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="web-resource-collectionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The web-resource-collectionType is used to identify a subset
+	of the resources and HTTP methods on those resources within
+	a web application to which a security constraint applies. If
+	no HTTP methods are specified, then the security constraint
+	applies to all HTTP methods.
+
+	Used in: security-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="web-resource-name"
+		   type="javaee:string">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The web-resource-name contains the name of this web
+	    resource collection.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="url-pattern"
+		   type="javaee:url-patternType"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="http-method"
+		   type="javaee:http-methodType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="welcome-file-listType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The welcome-file-list contains an ordered list of welcome
+	files elements.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="welcome-file"
+		   type="xsd:string"
+		   maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The welcome-file element contains file name to use
+	    as a default welcome file, such as index.html
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+</xsd:schema>
+
diff --git a/xml/tests/testData/unusedNs/wsdd.dtd b/xml/tests/testData/unusedNs/wsdd.dtd
new file mode 100644
index 0000000..6f42d2f
--- /dev/null
+++ b/xml/tests/testData/unusedNs/wsdd.dtd
@@ -0,0 +1,53 @@
+<!ELEMENT namespace (#PCDATA)>
+<!ELEMENT service (parameter|namespace|requestFlow|responseFlow|beanMapping|typeMapping|arrayMapping)*>
+<!ATTLIST service
+    name CDATA #REQUIRED
+    provider CDATA #REQUIRED
+    use CDATA #IMPLIED
+    style CDATA #IMPLIED>
+<!ELEMENT handler (parameter)*>
+<!ATTLIST handler
+    name CDATA #IMPLIED
+    type CDATA #REQUIRED>
+<!ELEMENT globalConfiguration (requestFlow?,responseFlow?,parameter*)>
+<!ELEMENT requestFlow (handler)*>
+<!ELEMENT responseFlow (handler)*>
+<!ELEMENT deployment (globalConfiguration|handler|service|transport|beanMapping|typeMapping|arrayMapping)*>
+<!ATTLIST deployment
+    name  CDATA
+    xmlns CDATA #REQUIRED
+    xmlns:java CDATA #REQUIRED>
+<!ELEMENT parameter (#PCDATA)>
+<!ATTLIST parameter
+    name CDATA #REQUIRED
+    value CDATA #REQUIRED>
+<!ELEMENT transport (requestFlow|parameter|responseFlow)*>
+<!ATTLIST transport
+    name  CDATA #REQUIRED
+    pivot CDATA>
+<!ELEMENT beanMapping (#PCDATA)>
+<!ATTLIST beanMapping
+    languageSpecificType CDATA #REQUIRED
+    qname CDATA #REQUIRED
+    xmlns:ns CDATA #IMPLIED
+    xmlns:ns1 CDATA #IMPLIED
+    xmlns:ns2 CDATA #IMPLIED>
+ <!ELEMENT typeMapping (#PCDATA)>
+ <!ATTLIST typeMapping
+     languageSpecificType CDATA #REQUIRED
+     qname CDATA #REQUIRED
+     serializer CDATA #REQUIRED
+     deserializer CDATA #REQUIRED
+     encodingStyle CDATA #REQUIRED
+     xmlns:ns CDATA #IMPLIED
+     xmlns:ns1 CDATA #IMPLIED
+     xmlns:ns2 CDATA #IMPLIED>
+ <!ELEMENT arrayMapping (#PCDATA)>
+ <!ATTLIST arrayMapping
+     qname CDATA #REQUIRED
+     type CDATA #REQUIRED
+     innerType CDATA #REQUIRED
+     encodingStyle CDATA #REQUIRED
+     xmlns:ns CDATA #IMPLIED
+     xmlns:ns1 CDATA #IMPLIED
+     xmlns:ns2 CDATA #IMPLIED>
\ No newline at end of file
diff --git a/xml/tests/testData/unusedNs/wsdd_provider_java.xsd b/xml/tests/testData/unusedNs/wsdd_provider_java.xsd
new file mode 100644
index 0000000..57519c1
--- /dev/null
+++ b/xml/tests/testData/unusedNs/wsdd_provider_java.xsd
@@ -0,0 +1 @@
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xml.apache.org/axis/wsdd/providers/java"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/AnyAttributesInAttrGroup.xml b/xml/tests/testData/xml/AnyAttributesInAttrGroup.xml
new file mode 100644
index 0000000..7f096fc
--- /dev/null
+++ b/xml/tests/testData/xml/AnyAttributesInAttrGroup.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<foo:foo xmlns:foo="http://www.foo.org/test"
+         xmlns:bar="http://www.bar.org/test">
+  <foo:child bar:bar="false" flag="false"/>
+</foo:foo>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/AnyAttributesInAttrGroup.xsd b/xml/tests/testData/xml/AnyAttributesInAttrGroup.xsd
new file mode 100644
index 0000000..0bb1bbb
--- /dev/null
+++ b/xml/tests/testData/xml/AnyAttributesInAttrGroup.xsd
@@ -0,0 +1,23 @@
+<xsd:schema xmlns="http://www.foo.org/test"
+         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+         targetNamespace="http://www.foo.org/test"
+         elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+  <xsd:attributeGroup name="myAttributes">
+    <xsd:attribute name="flag" type="xsd:boolean" use="required"/>
+    <xsd:anyAttribute namespace="##other" processContents="lax"/>
+  </xsd:attributeGroup>
+
+  <xsd:element name="foo">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element name="child">
+          <xsd:complexType>
+            <xsd:attributeGroup ref="myAttributes"/>
+          </xsd:complexType>
+        </xsd:element>
+      </xsd:sequence>
+    </xsd:complexType>
+  </xsd:element>
+
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/AnyAttributesInAttrGroup_2.xsd b/xml/tests/testData/xml/AnyAttributesInAttrGroup_2.xsd
new file mode 100644
index 0000000..5589f11
--- /dev/null
+++ b/xml/tests/testData/xml/AnyAttributesInAttrGroup_2.xsd
@@ -0,0 +1,8 @@
+<xsd:schema xmlns="http://www.bar.org/test"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	targetNamespace="http://www.bar.org/test"
+	elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+  <xsd:attribute name="bar" type="xsd:boolean"/>
+
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/BPMN20.xsd b/xml/tests/testData/xml/BPMN20.xsd
new file mode 100644
index 0000000..8f711a6
--- /dev/null
+++ b/xml/tests/testData/xml/BPMN20.xsd
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified"	
+	xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
+	targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL">
+
+	<xsd:import namespace="http://www.omg.org/spec/BPMN/20100524/DI" schemaLocation="BPMNDI.xsd"/>
+	 <xsd:include schemaLocation="Semantic.xsd"/>
+
+	<xsd:element name="definitions" type="tDefinitions"/>
+	<xsd:complexType name="tDefinitions">
+		<xsd:sequence>
+			<xsd:element ref="import" minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:element ref="rootElement" minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:element ref="bpmndi:BPMNDiagram" minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:element ref="relationship" minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:sequence>
+		<xsd:attribute name="id" type="xsd:ID" use="optional"/>
+		<xsd:attribute name="name" type="xsd:string"/>
+		<xsd:attribute name="targetNamespace" type="xsd:anyURI" use="required"/>
+		<xsd:attribute name="expressionLanguage" type="xsd:anyURI" use="optional" default="http://www.w3.org/1999/XPath"/>
+		<xsd:attribute name="typeLanguage" type="xsd:anyURI" use="optional" default="http://www.w3.org/2001/XMLSchema"/>
+		<xsd:attribute name="exporter" type="xsd:string"/>
+		<xsd:attribute name="exporterVersion" type="xsd:string"/>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:complexType>
+	
+	<xsd:element name="import" type="tImport"/>
+	<xsd:complexType name="tImport">
+		<xsd:attribute name="namespace" type="xsd:anyURI" use="required"/>
+		<xsd:attribute name="location" type="xsd:string" use="required"/>
+		<xsd:attribute name="importType" type="xsd:anyURI" use="required"/>
+	</xsd:complexType>
+
+
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ChangeRootElement.xml b/xml/tests/testData/xml/ChangeRootElement.xml
new file mode 100644
index 0000000..03aedc8
--- /dev/null
+++ b/xml/tests/testData/xml/ChangeRootElement.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE xxx [
+  <!ELEMENT xxx (zzz)*>
+  <!ELEMENT zzz (#PCDATA)>
+  ]>
+<<error>xxx<caret>2</error>>
+  <zzz/>
+</<error>xxx2</error>>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ChangeRootElement_after.xml b/xml/tests/testData/xml/ChangeRootElement_after.xml
new file mode 100644
index 0000000..80dded4
--- /dev/null
+++ b/xml/tests/testData/xml/ChangeRootElement_after.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE xxx [
+  <!ELEMENT xxx (zzz)*>
+  <!ELEMENT zzz (#PCDATA)>
+  ]>
+<xxx<caret>>
+  <zzz/>
+</xxx>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ClosedTag2.xml b/xml/tests/testData/xml/ClosedTag2.xml
new file mode 100644
index 0000000..6ab43a0
--- /dev/null
+++ b/xml/tests/testData/xml/ClosedTag2.xml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <<error>abc</error>>
+
+  </<error>abcdef</error>>
+
+  <<error>xyz</error>>
+
+  </<error>x</error>>aaa
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/CommentBeforeProlog.xml b/xml/tests/testData/xml/CommentBeforeProlog.xml
new file mode 100644
index 0000000..d020956
--- /dev/null
+++ b/xml/tests/testData/xml/CommentBeforeProlog.xml
@@ -0,0 +1,3 @@
+<error descr="Xml declaration should precede all document content"><!--Comment--></error>
+<?xml version="1.0"?>
+<foo />
\ No newline at end of file
diff --git a/xml/tests/testData/xml/CommentBeforeProlog_2.xml b/xml/tests/testData/xml/CommentBeforeProlog_2.xml
new file mode 100644
index 0000000..9f1e0f7
--- /dev/null
+++ b/xml/tests/testData/xml/CommentBeforeProlog_2.xml
@@ -0,0 +1,2 @@
+<!--Comment-->
+<foo />
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexDtdValidation.xml b/xml/tests/testData/xml/ComplexDtdValidation.xml
new file mode 100644
index 0000000..cc0a0d5
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexDtdValidation.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<!DOCTYPE page-specification PUBLIC
+  "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
+  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
+
+<page-specification class="org.sigpath.tapestry.pages.ViewUsersPage">
+    <property-specification name="users" type="java.util.Collection" persistent="yes"/>
+    <<error>bean</error> name="evenOdd" <error>type</error>="org.apache.tapestry.bean.EvenOdd"/>
+</page-specification>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexDtdValidation2.dtd b/xml/tests/testData/xml/ComplexDtdValidation2.dtd
new file mode 100644
index 0000000..94eb62d
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexDtdValidation2.dtd
@@ -0,0 +1,2 @@
+<!ELEMENT foo (bar)>
+<!ELEMENT bar (#PCDATA)>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexDtdValidation2.xml b/xml/tests/testData/xml/ComplexDtdValidation2.xml
new file mode 100644
index 0000000..76bc713
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexDtdValidation2.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE foo SYSTEM "ComplexDtdValidation2.dtd">
+<<error>foo</error>></<error>foo</error>>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexRedefine.xml b/xml/tests/testData/xml/ComplexRedefine.xml
new file mode 100644
index 0000000..75ab2f6
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<graph edgedefault="directed">
+</graph>
+</graphml>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexRedefine2.xml b/xml/tests/testData/xml/ComplexRedefine2.xml
new file mode 100644
index 0000000..81fbc83
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine2.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns/graphml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns/graphml http://www.yworks.com/xml/schema/graphml/1.0/ygraphml.xsd">
+<key id="d0" for="node" yfiles.type="nodegraphics"/>
+<key id="d1" for="edge" yfiles.type="edgegraphics"/>
+<graph id="G" edgedefault="directed">
+</graph>
+</graphml>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexRedefine2Schemas/graphml-attributes.xsd b/xml/tests/testData/xml/ComplexRedefine2Schemas/graphml-attributes.xsd
new file mode 100644
index 0000000..d57855f
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine2Schemas/graphml-attributes.xsd
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+
+<xs:schema
+             targetNamespace="http://graphml.graphdrawing.org/xmlns/graphml"
+
+             xmlns="http://graphml.graphdrawing.org/xmlns/graphml"
+             xmlns:xs="http://www.w3.org/2001/XMLSchema"
+
+             elementFormDefault="unqualified"
+             attributeFormDefault="unqualified"
+>
+
+<!--=============redefinition of the======================-->
+<!--=============key attributes===========================-->
+
+<xs:redefine schemaLocation="graphml-structure.xsd">
+
+  <xs:attributeGroup name="key.extra.attrib">
+    <xs:attributeGroup ref="key.extra.attrib"/>
+    <xs:attributeGroup ref="key.attributes.attrib"/>
+  </xs:attributeGroup>
+
+</xs:redefine>
+
+	<xs:simpleType name="key.name.type" final="#all">
+		<xs:restriction base="xs:NMTOKEN"/>
+	</xs:simpleType>
+
+<xs:simpleType name="key.type.type" final="#all">
+  <xs:restriction base="xs:NMTOKEN">  
+    <xs:enumeration value="boolean"/>
+    <xs:enumeration value="int"/>
+    <xs:enumeration value="long"/>
+    <xs:enumeration value="float"/>
+    <xs:enumeration value="double"/>
+    <xs:enumeration value="string"/>
+  </xs:restriction>
+</xs:simpleType>
+
+	<xs:attributeGroup name="key.attributes.attrib">
+		<xs:attribute name="attr.name" type="key.name.type" use="optional"/>
+		<xs:attribute name="attr.type" type="key.type.type" use="optional"/>
+	</xs:attributeGroup>
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexRedefine2Schemas/graphml-structure.xsd b/xml/tests/testData/xml/ComplexRedefine2Schemas/graphml-structure.xsd
new file mode 100644
index 0000000..f785136
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine2Schemas/graphml-structure.xsd
@@ -0,0 +1,430 @@
+<?xml version="1.0"?>
+
+<xs:schema
+             targetNamespace="http://graphml.graphdrawing.org/xmlns/graphml"
+
+             xmlns="http://graphml.graphdrawing.org/xmlns/graphml"
+             xmlns:g="http://graphml.graphdrawing.org/xmlns/graphml"
+             xmlns:xs="http://www.w3.org/2001/XMLSchema"
+             xmlns:xlink="http://www.w3.org/1999/xlink" 
+
+             elementFormDefault="unqualified"
+             attributeFormDefault="unqualified"
+>
+
+<xs:import namespace="http://www.w3.org/1999/xlink" 
+           schemaLocation="xlink.xsd"
+/>
+
+
+
+<!--======================================================-->
+<!--=========user-defined extra attributes================-->
+<!--======================================================-->
+
+<!--extra attributes common to all GraphML elements-->
+
+<xs:attributeGroup name="common.extra.attrib"/>
+
+<!--specific extra attributes-->
+
+<xs:attributeGroup name="graphml.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="data.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="key.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="default.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="graph.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="node.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="edge.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="port.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="hyperedge.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="endpoint.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="locator.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+
+
+
+<!--======================================================-->
+<!--=============element type definitions=================-->
+<!--======================================================-->
+
+<!--=============data type================================-->
+
+<!--extension mechanism for the content of data and default-->
+<xs:complexType name="data-extension.type"/>
+
+<xs:complexType name="data.type" final="#all">
+  <xs:complexContent mixed="true">
+    <xs:extension base="data-extension.type">
+      <xs:attribute name="key" type="xs:NMTOKEN" use="required"/>
+      <xs:attribute name="id" type="xs:NMTOKEN" use="optional"/>
+      <xs:attributeGroup ref="data.extra.attrib"/>
+    </xs:extension>
+  </xs:complexContent>
+</xs:complexType>
+
+
+<!--=============key type=================================-->
+<xs:simpleType name="key.for.type" final="#all">
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="all"/>
+    <xs:enumeration value="graph"/>
+    <xs:enumeration value="node"/>
+    <xs:enumeration value="edge"/>
+    <xs:enumeration value="hyperedge"/>
+    <xs:enumeration value="port"/>
+    <xs:enumeration value="endpoint"/>
+  </xs:restriction>
+</xs:simpleType>
+
+
+<xs:complexType name="key.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>    
+    <xs:element ref="default" minOccurs="0"/>
+  </xs:sequence>
+  <xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
+  <xs:attribute name="for" type="key.for.type" default="all"/>
+  <xs:attributeGroup ref="key.extra.attrib"/>
+</xs:complexType>
+
+<!--=============default type=============================-->
+<xs:complexType name="default.type" final="#all">
+  <xs:complexContent mixed="true">
+    <xs:extension base="data-extension.type">
+      <xs:attributeGroup ref="default.extra.attrib"/>
+    </xs:extension>
+  </xs:complexContent>
+</xs:complexType>
+
+
+<!--=============graphml type=============================-->
+
+<xs:complexType name="graphml.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>    
+    <xs:element ref="key" minOccurs="0" maxOccurs="unbounded"/>
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="graph"/>
+        <xs:element ref="data"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:sequence>
+  <xs:attributeGroup ref="graphml.extra.attrib"/>
+</xs:complexType>
+
+
+<!--=============graph type===============================-->
+
+<xs:simpleType name="graph.edgedefault.type" final="#all">
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="directed"/>
+    <xs:enumeration value="undirected"/>
+  </xs:restriction>
+</xs:simpleType>
+
+
+<xs:complexType name="graph.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>
+    <xs:choice>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="data"/>
+          <xs:element ref="node"/>
+          <xs:element ref="edge"/>
+          <xs:element ref="hyperedge"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:element ref="locator"/>
+    </xs:choice>
+  </xs:sequence>
+  <xs:attributeGroup ref="graph.extra.attrib"/>
+  <xs:attribute name="id" type="xs:NMTOKEN"  />
+  <xs:attribute name="edgedefault" 
+                type="graph.edgedefault.type" use="required"/>
+</xs:complexType>
+
+<!--=============node type================================-->
+
+<xs:complexType name="node.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>
+    <xs:choice>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="data"/>
+          <xs:element ref="port"/>
+        </xs:choice>
+        <xs:element ref="graph" minOccurs="0"/>
+      </xs:sequence>
+      <xs:element ref="locator"/>
+    </xs:choice>
+  </xs:sequence>
+  <xs:attributeGroup ref="node.extra.attrib"/>
+  <xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
+</xs:complexType>
+
+<!--=============port type================================-->
+
+<xs:complexType name="port.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0" />
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="data" />
+      <xs:element ref="port" />
+    </xs:choice>
+  </xs:sequence>
+  <xs:attributeGroup ref="port.extra.attrib"/> 
+  <xs:attribute name="name" type="xs:NMTOKEN" use="required"/>
+</xs:complexType>
+  
+<!--=============edge type================================-->
+
+<xs:complexType name="edge.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>
+    <xs:element ref="data" minOccurs="0" maxOccurs="unbounded"/>
+    <xs:element ref="graph" minOccurs="0"/>
+  </xs:sequence>
+  <xs:attributeGroup ref="edge.extra.attrib"/>
+  <xs:attribute name="id" type="xs:NMTOKEN" />
+  <xs:attribute name="directed" type="xs:boolean"/>
+  <xs:attribute name="source" type="xs:NMTOKEN" use="required"/>
+  <xs:attribute name="target" type="xs:NMTOKEN" use="required"/>
+  <xs:attribute name="sourceport" type="xs:NMTOKEN"/>
+  <xs:attribute name="targetport" type="xs:NMTOKEN"/>
+</xs:complexType>
+
+<!--=============hyperedge type===========================-->
+
+<xs:complexType name="hyperedge.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0" />
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="data" />
+      <xs:element ref="endpoint" />
+    </xs:choice>
+    <xs:element ref="graph" minOccurs="0" />
+  </xs:sequence>
+  <xs:attributeGroup ref="hyperedge.extra.attrib"/> 
+  <xs:attribute name="id" type="xs:NMTOKEN" />
+</xs:complexType>
+  
+<!--=============endpoint type============================-->
+
+<xs:simpleType name="endpoint.type.type" final="#all">
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="in"/>
+    <xs:enumeration value="out"/>
+    <xs:enumeration value="undir"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:complexType name="endpoint.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0" />
+  </xs:sequence>
+  <xs:attributeGroup ref="endpoint.extra.attrib"/> 
+  <xs:attribute name="id" type="xs:NMTOKEN"/>
+  <xs:attribute name="port" type="xs:NMTOKEN" />
+  <xs:attribute name="node" type="xs:NMTOKEN" use="required"/>
+  <xs:attribute name="type" type="endpoint.type.type" default="undir"/>
+</xs:complexType>
+
+<!--=============locator type=============================-->
+
+<xs:complexType name="locator.type" final="#all">
+  <xs:attributeGroup ref="locator.extra.attrib"/>
+  <xs:attribute ref="xlink:href" use="required"/>
+  <xs:attribute ref="xlink:type" fixed="simple"/>
+</xs:complexType>
+
+
+<!--======================================================-->
+<!--============element declarations======================-->
+<!--======================================================-->
+
+<!--=============element: desc============================-->
+<xs:element name="desc" type="xs:string" block="#all"/>
+
+<!--=============element: locator=========================-->
+<xs:element name="locator" type="locator.type" block="#all"/>
+
+<!--=============element: data============================-->
+<xs:element name="data" type="data.type" block="#all">
+
+  <xs:unique name="data_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+<!--=============element: key=============================-->
+<xs:element name="key" type="key.type" block="#all"/>
+
+<!--=============element: default=========================-->
+<xs:element name="default" type="default.type" block="#all"/>
+
+<!--=============element: graphml=========================-->
+<xs:element name="graphml" type="graphml.type" block="#all">
+
+  <xs:unique name="all_id_unique">
+    <xs:selector xpath=".//g:*"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:unique name="graphml_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+  <xs:key name="key_id_key"> 
+    <xs:selector xpath=".//g:key"/>
+    <xs:field xpath="@id"/>
+  </xs:key>
+
+  <xs:key name="node_id_key"> 
+    <xs:selector xpath=".//g:node"/>
+    <xs:field xpath="@id"/>
+  </xs:key>
+
+  <xs:unique name="edge_id_unique"> 
+    <xs:selector xpath=".//g:edge"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:unique name="hyperedge_id_unique"> 
+    <xs:selector xpath=".//g:hyperedge"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:unique name="endpoint_id_unique"> 
+    <xs:selector xpath=".//g:endpoint"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:unique name="graph_id_unique"> 
+    <xs:selector xpath=".//g:graph"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:keyref name="data_key_ref" refer="key_id_key">
+    <xs:selector xpath=".//g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:keyref> 
+
+  <xs:keyref name="edge_source_ref" refer="node_id_key">
+    <xs:selector xpath=".//g:edge"/>
+    <xs:field xpath="@source"/>
+  </xs:keyref> 
+
+  <xs:keyref name="edge_target_ref" refer="node_id_key">
+    <xs:selector xpath=".//g:edge"/>
+    <xs:field xpath="@target"/>
+  </xs:keyref>
+
+  <xs:keyref name="endpoint_node_ref" refer="node_id_key">
+    <xs:selector xpath=".//g:endpoint"/>
+    <xs:field xpath="@node"/>
+  </xs:keyref>
+
+</xs:element>
+
+
+<!--=============element: graph===========================-->
+<xs:element name="graph" type="graph.type" block="#all">
+
+  <xs:unique name="graph_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+<!--=============element: node============================-->
+<xs:element name="node" type="node.type" block="#all">
+
+  <xs:key name="port_name_key"> 
+    <xs:selector xpath=".//g:port"/>
+    <xs:field xpath="@name"/>
+  </xs:key>
+
+  <xs:unique name="node_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+<!--=============element: port============================-->
+<xs:element name="port" type="port.type" block="#all">
+
+  <xs:unique name="port_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+<!--=============element: edge============================-->
+<xs:element name="edge" type="edge.type" block="#all">
+
+  <xs:unique name="edge_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+<!--=============element: hyperedge=======================-->
+<xs:element name="hyperedge" type="hyperedge.type" block="#all">
+
+  <xs:unique name="hyperedge_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+<!--=============element: endpoint========================-->
+<xs:element name="endpoint" type="endpoint.type" block="#all"/>
+
+</xs:schema>
+
+<!--======================================================-->
+<!--      end of file: graphml-structure.xsd             -->
+<!--======================================================-->
diff --git a/xml/tests/testData/xml/ComplexRedefine2Schemas/graphml.xsd b/xml/tests/testData/xml/ComplexRedefine2Schemas/graphml.xsd
new file mode 100644
index 0000000..00e79f4
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine2Schemas/graphml.xsd
@@ -0,0 +1,345 @@
+<?xml version="1.0"?>
+
+<xs:schema   
+             targetNamespace="http://graphml.graphdrawing.org/xmlns"
+
+             xmlns="http://graphml.graphdrawing.org/xmlns"
+             xmlns:xs="http://www.w3.org/2001/XMLSchema"
+
+             elementFormDefault="qualified"
+             attributeFormDefault="unqualified"
+>
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+     This document defines the GraphML language including GraphML attributes and GraphML parseinfo.
+    </xs:documentation>
+  </xs:annotation>
+
+
+<xs:redefine schemaLocation="http://graphml.graphdrawing.org/xmlns/1.0/graphml-structure.xsd">
+
+  <!--redefinition as in graphml-attributes.xsd -->
+
+  <xs:attributeGroup name="key.extra.attrib">
+    <xs:attributeGroup ref="key.extra.attrib"/>
+    <xs:attributeGroup ref="key.attributes.attrib"/>
+  </xs:attributeGroup>
+
+  <!--redefinition as in graphml-parseinfo.xsd -->
+
+  <xs:attributeGroup name="graph.extra.attrib">
+    <xs:attributeGroup ref="graph.extra.attrib"/>
+    <xs:attributeGroup ref="graph.parseinfo.attrib"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="node.extra.attrib">
+    <xs:attributeGroup ref="node.extra.attrib"/>
+    <xs:attributeGroup ref="node.parseinfo.attrib"/>
+  </xs:attributeGroup>
+
+</xs:redefine>
+
+
+  <!--types as in graphml-attributes.xsd -->
+
+<xs:simpleType name="key.name.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/(Dokumentation der Attributes Erweiterung; entsprechende Stelle.html)"
+        xml:lang="en">
+      Simple type for the attr.name attribute of &lt;key>.
+      key.name.type is final, that is, it may not be extended
+                          or restricted.
+      key.name.type is a restriction of xs:NMTOKEN
+      Allowed values: (no restriction)
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:NMTOKEN"/>
+
+</xs:simpleType>
+
+
+
+<xs:simpleType name="key.type.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/(Dokumentation der Attributes Erweiterung; entsprechende Stelle.html)"
+        xml:lang="en">
+      Simple type for the attr.type attribute of &lt;key>.
+      key.type.type is final, that is, it may not be extended
+                          or restricted.
+      key.type.type is a restriction of xs:NMTOKEN
+      Allowed values: boolean, int, long, float, double, string.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:NMTOKEN">  
+    <xs:enumeration value="boolean"/>
+    <xs:enumeration value="int"/>
+    <xs:enumeration value="long"/>
+    <xs:enumeration value="float"/>
+    <xs:enumeration value="double"/>
+    <xs:enumeration value="string"/>
+  </xs:restriction>
+
+</xs:simpleType>
+
+
+<xs:attributeGroup name="key.attributes.attrib">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+     Definition of the attribute group key.attributes.attrib.
+     This group consists of the two optional attributes
+         - attr.name (gives the name for the data function)
+         - attr.type ((declares the range of values for the data function)
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attribute name="attr.name" type="key.name.type" use="optional"/>
+  <xs:attribute name="attr.type" type="key.type.type" use="optional"/>
+</xs:attributeGroup>
+
+  <!--types as in graphml-parseinfo.xsd -->
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+       Simple type definitions for the new graph attributes.
+    </xs:documentation>
+  </xs:annotation>
+
+<xs:simpleType name="graph.order.type"  final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.order attribute of &lt;graph>.
+      graph.order.type is final, that is, it may not be extended
+                          or restricted.
+      graph.order.type is a restriction of xs:NMTOKEN
+      Allowed values: free, nodesfirst, adjacencylist.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="free"/>
+    <xs:enumeration value="nodesfirst"/>
+    <xs:enumeration value="adjacencylist"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="graph.nodes.type"  final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.nodes attribute of &lt;graph>.
+      graph.nodes.type is final, that is, it may not be extended
+                          or restricted.
+      graph.nodes.type is a restriction of xs:nonNegativeInteger
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:nonNegativeInteger"/>  
+</xs:simpleType>
+
+<xs:simpleType name="graph.edges.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.edges attribute of &lt;graph>.
+      graph.edges.type is final, that is, it may not be extended
+                          or restricted.
+      graph.edges.type is a restriction of xs:nonNegativeInteger
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:nonNegativeInteger"/>  
+</xs:simpleType>
+
+<xs:simpleType name="graph.maxindegree.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.maxindegree attribute of &lt;graph>.
+      graph.maxindegree.type is final, that is, it may not be extended
+                          or restricted.
+      graph.maxindegree.type is a restriction of xs:nonNegativeInteger
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:nonNegativeInteger"/>  
+</xs:simpleType>
+
+<xs:simpleType name="graph.maxoutdegree.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.maxoutdegree attribute of &lt;graph>.
+      graph.maxoutdegree.type is final, that is, it may not be extended
+                          or restricted.
+      graph.maxoutdegree.type is a restriction of xs:nonNegativeInteger
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:nonNegativeInteger"/>  
+</xs:simpleType>
+
+<xs:simpleType name="graph.nodeids.type"  final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.nodeids attribute of &lt;graph>.
+      graph.nodeids.type is final, that is, it may not be extended
+                          or restricted.
+      graph.nodeids.type is a restriction of xs:string
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="canonical"/>
+    <xs:enumeration value="free"/>
+  </xs:restriction>  
+</xs:simpleType>
+
+<xs:simpleType name="graph.edgeids.type"  final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.edgeids attribute of &lt;graph>.
+      graph.edgeids.type is final, that is, it may not be extended
+                          or restricted.
+      graph.edgeids.type is a restriction of xs:string
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="canonical"/>
+    <xs:enumeration value="free"/>
+  </xs:restriction>  
+</xs:simpleType>
+
+<xs:attributeGroup name="graph.parseinfo.attrib">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+     Definition of the attribute group graph.parseinfo.attrib.
+     This group consists of the seven attributes
+     - parse.nodeids (fixed to 'canonical' meaning that the id attribute
+                      of &lt;node> follows the pattern 'n[number]),
+     - parse.edgeids (fixed to 'canonical' meaning that the id attribute
+                      of &lt;edge> follows the pattern 'e[number]),
+     - parse.order (required; one of the values 'nodesfirst', 
+                    'adjacencylist' or 'free'),
+     - parse.nodes (required; number of nodes in this graph), 
+     - parse.edges (required; number of edges in this graph), 
+     - parse.maxindegree (optional; maximal indegree of a node in this graph),
+     - parse.maxoutdegree (optional; maximal outdegree of a node in this graph)
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attribute name="parse.nodeids" type="graph.nodeids.type"/>
+  <xs:attribute name="parse.edgeids" type="graph.edgeids.type"/>
+  <xs:attribute name="parse.order" type="graph.order.type"/>
+  <xs:attribute name="parse.nodes" type="graph.nodes.type"/>
+  <xs:attribute name="parse.edges" type="graph.edges.type"/>
+  <xs:attribute name="parse.maxindegree" type="graph.maxindegree.type" use="optional"/>
+  <xs:attribute name="parse.maxoutdegree" type="graph.maxoutdegree.type" use="optional"/>
+</xs:attributeGroup>
+
+
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+       Simple type definitions for the new node attributes.
+    </xs:documentation>
+  </xs:annotation>
+
+<xs:simpleType name="node.indegree.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.indegree attribute of &lt;node>.
+      node.indegree.type is final, that is, it may not be extended
+                          or restricted.
+      node.indegree.type is a restriction of xs:nonNegativeInteger
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:nonNegativeInteger"/>  
+</xs:simpleType>
+
+<xs:simpleType name="node.outdegree.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.outdegree attribute of &lt;node>.
+      node.outdegree.type is final, that is, it may not be extended
+                          or restricted.
+      node.outdegree.type is a restriction of xs:nonNegativeInteger
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:nonNegativeInteger"/>  
+</xs:simpleType>
+
+<xs:attributeGroup name="node.parseinfo.attrib">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+     Definition of the attribute group node.parseinfo.attrib.
+     This group consists of two attributes
+     - parse.indegree (optional; indegree of this node),
+     - parse.outdegree (optional; outdegree of this node).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attribute name="parse.indegree" type="node.indegree.type" use="optional"/>
+  <xs:attribute name="parse.outdegree" type="node.outdegree.type" use="optional"/>
+</xs:attributeGroup>
+
+</xs:schema>
+
+<!--======================================================-->
+<!--      end of file: graphml-parseinfo.xsd             -->
+<!--======================================================-->
diff --git a/xml/tests/testData/xml/ComplexRedefine2Schemas/xlink.xsd b/xml/tests/testData/xml/ComplexRedefine2Schemas/xlink.xsd
new file mode 100644
index 0000000..0fa621b
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine2Schemas/xlink.xsd
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+
+<xs:schema 
+        targetNamespace="http://www.w3.org/1999/xlink" 
+
+        xmlns:xlink="http://www.w3.org/1999/xlink" 
+        xmlns:xs="http://www.w3.org/2001/XMLSchema"
+
+        elementFormDefault="qualified"
+        attributeFormDefault="unqualified"
+>
+
+<xs:attribute name="type" default="simple">
+  <xs:simpleType>
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="simple"/>
+      <xs:enumeration value="extended"/>
+      <xs:enumeration value="locator"/>
+      <xs:enumeration value="arc"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:attribute>
+
+<xs:attribute name="href" type="xs:anyURI" />
+
+<xs:attribute name="role" type="xs:string" />
+
+<xs:attribute name="arcrole" type="xs:string" />
+
+<xs:attribute name="title" type="xs:string" />
+
+<xs:attribute name="show" default="embed">
+  <xs:simpleType>
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="new"/>
+      <xs:enumeration value="replace"/>
+      <xs:enumeration value="embed"/>
+      <xs:enumeration value="other"/>
+      <xs:enumeration value="none"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:attribute>
+
+<xs:attribute name="actuate" default="onLoad">
+  <xs:simpleType>
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="onLoad"/>
+      <xs:enumeration value="onRequest"/>
+      <xs:enumeration value="other"/>
+      <xs:enumeration value="none"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:attribute>
+
+<xs:attribute name="from" type="xs:string" />
+
+<xs:attribute name="to" type="xs:string" />
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexRedefine2Schemas/yfeatures.xsd b/xml/tests/testData/xml/ComplexRedefine2Schemas/yfeatures.xsd
new file mode 100644
index 0000000..1b96acb
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine2Schemas/yfeatures.xsd
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema 
+  targetNamespace="http://www.yworks.com/xml/graphml" 
+  
+  xmlns="http://www.yworks.com/xml/graphml" 
+  xmlns:g="http://graphml.graphdrawing.org/xmlns/graphml" 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  xmlns:xlink="http://www.w3.org/1999/xlink" 
+  
+  elementFormDefault="qualified" 
+  attributeFormDefault="unqualified">
+  
+<xs:include schemaLocation="ygraphics.xsd"/>
+<xs:include schemaLocation="yprocessors.xsd"/>
+</xs:schema>
+
diff --git a/xml/tests/testData/xml/ComplexRedefine2Schemas/ygraphics.xsd b/xml/tests/testData/xml/ComplexRedefine2Schemas/ygraphics.xsd
new file mode 100644
index 0000000..68f6617
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine2Schemas/ygraphics.xsd
@@ -0,0 +1,550 @@
+<?xml version="1.0"?>
+
+<!-- Header -->
+<xs:schema 
+             targetNamespace="http://www.yworks.com/xml/graphml"
+
+             xmlns="http://www.yworks.com/xml/graphml"
+             xmlns:g="http://graphml.graphdrawing.org/xmlns/graphml"
+             xmlns:xs="http://www.w3.org/2001/XMLSchema"
+             xmlns:xlink="http://www.w3.org/1999/xlink"
+
+             elementFormDefault="qualified"
+             attributeFormDefault="unqualified"
+>
+
+<!--                             -->
+<!-- Enumeration Types --> 
+<!--                             -->
+
+
+<!-- LineType -->
+<xs:simpleType name="lineType.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="line"/>
+    	<xs:enumeration value="dashed"/>
+    	<xs:enumeration value="dotted"/>
+    </xs:restriction>
+</xs:simpleType>
+
+<!-- Font styles -->
+<xs:simpleType name="fontStyle.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="plain"/>
+    	<xs:enumeration value="bold"/>
+    	<xs:enumeration value="italic"/>
+    </xs:restriction>
+</xs:simpleType>
+
+<!-- Shape of Shape Nodes -->
+<xs:simpleType name="ShapeType.type">
+	<xs:restriction base="xs:NMTOKEN">
+        <xs:enumeration value="rectangle"/>
+        <xs:enumeration value="roundrectangle"/>
+        <xs:enumeration value="ellipse"/>
+        <xs:enumeration value="parallelogram"/>
+        <xs:enumeration value="hexagon"/>
+        <xs:enumeration value="octagon"/>
+        <xs:enumeration value="diamond"/>
+        <xs:enumeration value="triangle"/>
+        <xs:enumeration value="trapezoid"/>
+        <xs:enumeration value="trapezoid2"/>
+        <xs:enumeration value="rectangle3d"/>
+    </xs:restriction>
+</xs:simpleType>
+
+<!-- Arrow types -->
+<xs:simpleType name="arrowType.type">
+	<xs:restriction base="xs:NMTOKEN">
+        <xs:enumeration value="standard"/>
+        <xs:enumeration value="delta"/>
+        <xs:enumeration value="diamond"/>
+        <xs:enumeration value="white_diamond"/>
+        <xs:enumeration value="white_delta"/>
+        <xs:enumeration value="none"/>
+    </xs:restriction>
+</xs:simpleType>
+
+
+<!-- Alignment of Labels -->
+<xs:simpleType name="alignment.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="center"/>
+    	<xs:enumeration value="left"/>
+    	<xs:enumeration value="right"/>
+    </xs:restriction>
+</xs:simpleType>
+
+<!-- Node Label Models -->
+
+<xs:simpleType name="nodeLabelModel.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="free"/>
+		<xs:enumeration value="sides"/>
+		<xs:enumeration value="corners"/>
+		<xs:enumeration value="eight_pos"/>
+		<xs:enumeration value="sandwich"/>
+		<xs:enumeration value="internal"/>
+    </xs:restriction>
+</xs:simpleType>
+
+<!-- Node Label Positions -->
+
+<xs:simpleType name="nodeLabelPosition.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="n"/>
+		<xs:enumeration value="nw"/>
+		<xs:enumeration value="ne"/>
+		<xs:enumeration value="w"/>
+		<xs:enumeration value="e"/>
+		<xs:enumeration value="sw"/>
+		<xs:enumeration value="s"/>
+		<xs:enumeration value="se"/>
+		<xs:enumeration value="c"/>
+		<xs:enumeration value="tl"/>
+		<xs:enumeration value="t"/>
+		<xs:enumeration value="tr"/>
+		<xs:enumeration value="r"/>
+		<xs:enumeration value="l"/>
+		<xs:enumeration value="bl"/>
+		<xs:enumeration value="b"/>
+		<xs:enumeration value="br"/>
+		<xs:enumeration value="anywhere"/>
+    </xs:restriction>
+</xs:simpleType>
+
+<!-- AutoSizePolicy -->
+
+<xs:simpleType name="autoSizePolicy.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="node_width"/>
+		<xs:enumeration value="node_height"/>
+		<xs:enumeration value="content"/>
+    </xs:restriction>
+</xs:simpleType>
+
+<!-- Edge Label Models -->
+
+<xs:simpleType name="edgeLabelModel.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="centered"/>
+		<xs:enumeration value="center_slider"/>
+		<xs:enumeration value="side_slider"/>
+		<xs:enumeration value="free"/>
+		<xs:enumeration value="two_pos"/>
+		<xs:enumeration value="three_center"/>
+		<xs:enumeration value="six_pos"/>		
+    </xs:restriction>
+</xs:simpleType>
+
+<!-- Edge Label Positions -->
+
+<xs:simpleType name="edgeLabelPosition.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="center"/>
+		<xs:enumeration value="tcentr"/>
+		<xs:enumeration value="scentr"/>
+		<xs:enumeration value="anywhere"/>
+		<xs:enumeration value="stail"/>
+		<xs:enumeration value="ttail"/>
+		<xs:enumeration value="tail"/>
+		<xs:enumeration value="shead"/>
+		<xs:enumeration value="thead"/>
+		<xs:enumeration value="head"/>
+	</xs:restriction>
+</xs:simpleType>
+
+<!-- Preferred Edge Label Positions -->
+
+<xs:simpleType name="preferredPlacement.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="target_right"/>	
+		<xs:enumeration value="target"/>	
+		<xs:enumeration value="target_left"/>	
+		<xs:enumeration value="source_right"/>	
+		<xs:enumeration value="source"/>	
+		<xs:enumeration value="source_left"/>	
+		<xs:enumeration value="center_right"/>	
+		<xs:enumeration value="center"/>	
+		<xs:enumeration value="center_left"/>	
+		<xs:enumeration value="anywhere"/>	
+  </xs:restriction>
+</xs:simpleType>
+
+<!-- horizontalTextPosition value type for labels -->
+<xs:simpleType name="horizontalTextPosition.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="left"/>	
+		<xs:enumeration value="right"/>	
+		<xs:enumeration value="center"/>	
+		<xs:enumeration value="left_aligned"/>	
+		<xs:enumeration value="right_aligned"/>	
+  </xs:restriction>
+</xs:simpleType>
+
+<!-- verticalTextPosition value type for labels -->
+<xs:simpleType name="verticalTextPosition.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="top"/>	
+		<xs:enumeration value="bottom"/>	
+		<xs:enumeration value="center"/>	
+  </xs:restriction>
+</xs:simpleType>
+
+<!--                             -->
+<!--  Geometric types     -->
+<!--                             -->
+
+<!-- Location defined by x,y coordinates -->
+<xs:attributeGroup name="Location.group">
+		<xs:attribute name="x" type="xs:double" use="required"/>
+		<xs:attribute name="y" type="xs:double" use="required"/>
+</xs:attributeGroup>
+
+<!-- Location defined by x,y coordinates and width,height -->
+<xs:attributeGroup name="Rectangle.group">
+		<xs:attribute name="x" type="xs:double" use="required"/>
+		<xs:attribute name="y" type="xs:double" use="required"/>
+		<xs:attribute name="width" type="xs:double" use="required"/>
+		<xs:attribute name="height" type="xs:double" use="required"/>
+</xs:attributeGroup>
+
+<!-- type for required rectangles -->
+<xs:complexType name="Rectangle.type">
+		<xs:attributeGroup ref="Rectangle.group"/>
+</xs:complexType>
+
+<!-- type for optional rectangles -->
+<xs:attributeGroup name="OpRectangle.group">
+		<xs:attribute name="x" type="xs:double" use="optional"/>
+		<xs:attribute name="y" type="xs:double" use="optional"/>
+		<xs:attribute name="width" type="xs:double" use="optional"/>
+		<xs:attribute name="height" type="xs:double" use="optional"/>
+</xs:attributeGroup>
+
+<!-- type for a path -->
+<xs:complexType name="Path.type">
+		<xs:sequence>
+			<xs:element name="Point" minOccurs="0" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:attributeGroup ref="Location.group"/>
+				</xs:complexType>			
+			</xs:element>
+		</xs:sequence>	
+		<xs:attribute name="reversedPathRendering" type="xs:boolean" use="optional"/>
+		<xs:attribute name="sx" type="xs:double" use="optional"/>
+		<xs:attribute name="sy" type="xs:double" use="optional"/>
+		<xs:attribute name="tx" type="xs:double" use="optional"/>
+		<xs:attribute name="ty" type="xs:double" use="optional"/>
+</xs:complexType>
+
+
+<!--                             -->
+<!--     Misc Types       -->
+<!--                             -->
+
+<!-- color -->
+
+<xs:simpleType name="color.type">
+  <xs:restriction base="xs:string">
+    <xs:pattern value="#(([A-F]|[0-9]){2}){3,4}"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<!-- Style for a line -->
+
+<xs:complexType name="LineStyle.type">
+		<xs:attribute name="color"    type="color.type" use="optional"/>
+		<xs:attribute name="hasColor" type="xs:boolean" use="optional"/>
+		<xs:attribute name="type" type="lineType.type" use="optional"/>
+		<xs:attribute name="width" type="xs:double" use="optional"/>
+</xs:complexType>
+
+<!-- drop shadow style -->
+<xs:complexType name="DropShadow.type">
+		<xs:attribute name="color" type="color.type" use="optional"/>
+		<xs:attribute name="offsetX" type="xs:byte" use="optional"/>
+		<xs:attribute name="offsetY" type="xs:byte" use="optional"/>
+</xs:complexType>
+
+<!--                             -->
+<!--        Labels            -->
+<!--                             -->
+
+<!-- Basic properties of all kind of labels -->
+<xs:complexType name="Label.type">
+	<xs:simpleContent>
+		<xs:extension base="xs:string">
+		<xs:attributeGroup ref="OpRectangle.group"/>
+		<xs:attribute name="visible" type="xs:boolean" use="optional"/>
+		<xs:attribute name="alignment" type="alignment.type" use="optional"/>
+		<xs:attribute name="textColor" type="color.type" use="optional"/>	
+		<xs:attribute name="lineColor" type="color.type" use="optional"/>
+    <xs:attribute name="hasLineColor" type="xs:boolean" use="optional"/>
+    <xs:attribute name="backgroundColor" type="color.type" use="optional"/>
+    <xs:attribute name="hasBackgroundColor" type="xs:boolean" use="optional"/>
+		<xs:attribute name="fontFamily" type="xs:string" use="optional"/>
+		<xs:attribute name="fontSize" type="xs:unsignedByte" use="optional"/>	
+		<xs:attribute name="fontStyle" type="fontStyle.type" use="optional"/>	
+		<xs:attribute name="rotationAngle" type="xs:double" use="optional"/>
+		<xs:attribute name="icon" type="xs:anyURI" use="optional"/>	
+		<xs:attribute name="underlinedText" type="xs:boolean" use="optional"/>	
+		<xs:attribute name="horizontalTextPosition" type="horizontalTextPosition.type" use="optional"/>	
+		<xs:attribute name="verticalTextPosition" type="verticalTextPosition.type" use="optional"/>	
+		<xs:attribute name="iconTextGap" type="xs:byte" use="optional"/>	
+		</xs:extension>
+	</xs:simpleContent>
+</xs:complexType>
+
+<!-- Node Labels -->
+<xs:complexType name="NodeLabel.type">
+	<xs:simpleContent>
+		<xs:extension base="Label.type">
+			<xs:attribute name="modelName" type="nodeLabelModel.type" use="optional"/>	
+			<xs:attribute name="modelPosition" type="nodeLabelPosition.type" use="optional"/>	
+			<xs:attribute name="autoSizePolicy" type="autoSizePolicy.type" use="optional"/>	
+		</xs:extension>
+	</xs:simpleContent>
+</xs:complexType>
+
+<!-- Edge Labels -->
+<xs:complexType name="EdgeLabel.type">
+	<xs:simpleContent>
+		<xs:extension base="Label.type">
+			<xs:attribute name="modelName" type="edgeLabelModel.type" use="optional"/>	
+			<xs:attribute name="modelPosition" type="edgeLabelPosition.type" use="optional"/>	
+			<xs:attribute name="preferredPlacement" type="preferredPlacement.type" use="optional"/>	
+			<xs:attribute name="distance" type="xs:double" use="optional"/>
+			<xs:attribute name="ratio" type="xs:double" use="optional"/>
+		</xs:extension>
+	</xs:simpleContent>
+</xs:complexType>
+
+<xs:complexType name="Geometry.type">
+	<xs:attributeGroup ref="Rectangle.group"/>
+</xs:complexType>	
+<!--                             -->
+<!--      Nodes              -->
+<!--                             -->
+
+<!-- Generic attributes for all nodes --> 
+<xs:complexType name="Node.type">
+	<xs:sequence>
+		<xs:element name="Geometry" minOccurs="0" maxOccurs="1" type="Geometry.type"/>
+		<xs:element name="Fill" minOccurs="0" maxOccurs="1">
+			<xs:complexType>
+		 		<xs:attribute name="hasColor" type="xs:boolean" use="optional"/>
+		 		<xs:attribute name="color" type="xs:string" use="optional"/>
+		 		<xs:attribute name="color2" type="xs:string" use="optional"/>
+		 		<xs:attribute name="transparent" type="xs:boolean" use="optional"/>
+			</xs:complexType>
+		</xs:element>
+		<xs:element name="BorderStyle" type="LineStyle.type" minOccurs="0" maxOccurs="1"/>
+		<xs:element name="NodeLabel" type="NodeLabel.type" minOccurs="0" maxOccurs="1"/>		
+	</xs:sequence>
+  <xs:attribute name="selected" type="xs:boolean" use="optional"/>
+</xs:complexType>
+
+<!-- Shape Node --> 
+<xs:complexType name="ShapeNode.type">
+	<xs:complexContent>
+		<xs:extension base="Node.type">
+			<xs:sequence>
+				<xs:element name="Shape" minOccurs="0" maxOccurs="1">		
+					<xs:complexType>
+						<xs:attribute name="type" type="ShapeType.type" use="required"/>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="DropShadow" type="DropShadow.type" minOccurs="0" maxOccurs="1"/>
+			</xs:sequence>
+		</xs:extension>
+	</xs:complexContent>
+</xs:complexType>
+
+<!-- Image Node --> 
+<xs:complexType name="ImageNode.type">
+	<xs:complexContent>
+		<xs:extension base="Node.type">
+			<xs:sequence>
+				<xs:element name="Image">		
+					<xs:complexType>
+						<xs:attribute name="href" type="xs:anyURI" use="required"/>
+						<xs:attribute name="alphaImage" type="xs:boolean" use="optional"/>
+					</xs:complexType>
+				</xs:element>		
+			</xs:sequence>
+		</xs:extension>
+	</xs:complexContent>
+</xs:complexType>
+
+<!-- Group Node --> 
+<xs:complexType name="GroupNode.type">
+	<xs:complexContent>
+		<xs:extension base="Node.type">
+			<xs:sequence>
+				<xs:element name="State" minOccurs="0" maxOccurs="1">		
+					<xs:complexType>
+						<xs:attribute name="closed" type="xs:boolean" use="optional"/>
+						<xs:attribute name="innerGraphDisplayEnabled" type="xs:boolean" use="optional"/>
+					</xs:complexType>
+				</xs:element>		
+				<xs:element name="Insets" minOccurs="0" maxOccurs="1">		
+					<xs:complexType>
+						<xs:attribute name="top" type="xs:nonNegativeInteger" use="required"/>
+						<xs:attribute name="bottom" type="xs:nonNegativeInteger" use="required"/>
+						<xs:attribute name="left" type="xs:nonNegativeInteger" use="required"/>
+						<xs:attribute name="right" type="xs:nonNegativeInteger" use="required"/>
+					</xs:complexType>
+				</xs:element>		
+				<xs:element name="BorderInsets" minOccurs="0" maxOccurs="1">		
+					<xs:complexType>
+						<xs:attribute name="top" type="xs:nonNegativeInteger" use="required"/>
+						<xs:attribute name="bottom" type="xs:nonNegativeInteger" use="required"/>
+						<xs:attribute name="left" type="xs:nonNegativeInteger" use="required"/>
+						<xs:attribute name="right" type="xs:nonNegativeInteger" use="required"/>
+					</xs:complexType>
+				</xs:element>		
+			</xs:sequence>
+		</xs:extension>
+	</xs:complexContent>
+</xs:complexType>
+
+<!-- Proxy Shape Node --> 
+<xs:complexType name="ProxyShapeNode.type">
+		<xs:sequence>
+			<xs:element name="Realizers">
+					<xs:complexType>
+      					<xs:sequence>
+        					<xs:choice minOccurs="0" maxOccurs="unbounded">
+          						<xs:element ref="ShapeNode"/>
+          						<xs:element ref="ImageNode"/>
+          						<xs:element ref="GroupNode"/>
+        					</xs:choice>
+      					</xs:sequence>
+      					<xs:attribute name="active" type="xs:nonNegativeInteger" use="required"/>
+					</xs:complexType>
+      		</xs:element>
+		</xs:sequence>
+</xs:complexType>
+
+<!-- Generic Node --> 
+<xs:complexType name="GenericNode.type">
+	<xs:complexContent>
+		<xs:extension base="Node.type">
+			<xs:sequence>
+				<xs:element name="UserData">		
+					<xs:complexType>
+						<xs:attribute name="class" type="xs:string" use="required"/>
+						<xs:attribute name="value" type="xs:string" use="required"/>
+					</xs:complexType>
+				</xs:element>		
+			</xs:sequence>
+      <xs:attribute name="configuration" type="xs:string" use="required"/>
+		</xs:extension>
+	</xs:complexContent>
+</xs:complexType>
+
+<!-- Element Definitions for  Nodes --> 
+<xs:element name="ShapeNode" type="ShapeNode.type"/>
+<xs:element name="ImageNode" type="ImageNode.type"/>
+<xs:element name="GroupNode" type="GroupNode.type"/>
+<xs:element name="GenericNode" type="GenericNode.type"/>
+<xs:element name="ProxyShapeNode" type="ProxyShapeNode.type"/>
+<xs:element name="ProxyAutoBoundsNode" type="ProxyShapeNode.type"/>
+
+<!--                             -->
+<!--      Edges              -->
+<!--                             -->
+
+<!-- Generic attributes for all edges --> 
+<xs:complexType name="Edge.type">
+	<xs:sequence>
+		<xs:element name="Path" type="Path.type" minOccurs="0" maxOccurs="1"/>
+		<xs:element name="LineStyle" type="LineStyle.type" minOccurs="0" maxOccurs="1"/>
+		<xs:element name="Arrows" minOccurs="0" maxOccurs="1">
+			<xs:complexType>
+				<xs:attribute name="source" type="arrowType.type"/>
+				<xs:attribute name="target" type="arrowType.type"/>
+			</xs:complexType>
+		</xs:element>
+		<xs:element name="EdgeLabel" type="EdgeLabel.type" minOccurs="0" maxOccurs="unbounded"/>		
+	</xs:sequence>	
+	<xs:attribute name="selected" type="xs:boolean" use="optional"/>
+</xs:complexType>
+
+<!-- Polyline edges -->
+<xs:complexType name="PolyLineEdge.type">
+	<xs:complexContent>
+		<xs:extension base="Edge.type">
+			<xs:sequence>
+				<xs:element name="BendStyle">		
+					<xs:complexType>
+						<xs:attribute name="smoothed" type="xs:boolean" use="optional"/>
+					</xs:complexType>
+				</xs:element>		
+			</xs:sequence>
+		</xs:extension>
+	</xs:complexContent>
+</xs:complexType>
+
+
+<!-- Type of Arc edges -->
+<xs:simpleType name="arc.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="fixedHeight"/>
+  	<xs:enumeration value="fixedRatio"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<!-- Arc edges -->
+<xs:complexType name="ArcEdge.type">
+	<xs:complexContent>
+		<xs:extension base="Edge.type">
+			<xs:sequence>
+				<xs:element name="Arc">		
+					<xs:complexType>
+						<xs:attribute name="type" type="arc.type" use="optional"/>
+						<xs:attribute name="height" type="xs:double" use="optional"/>
+						<xs:attribute name="ratio" type="xs:double" use="optional"/>
+					</xs:complexType>
+				</xs:element>		
+			</xs:sequence>
+		</xs:extension>
+	</xs:complexContent>
+</xs:complexType>
+
+<!-- QuadCurve edges -->
+<xs:complexType name="QuadCurveEdge.type">
+	<xs:complexContent>
+		<xs:extension base="Edge.type">
+      <xs:attribute name="straightness" type="xs:double" use="optional"/>
+		</xs:extension>
+	</xs:complexContent>
+</xs:complexType>
+
+<!-- Generic edges -->
+<xs:complexType name="GenericEdge.type">
+	<xs:complexContent>
+		<xs:extension base="Edge.type">
+			<xs:sequence>
+				<xs:element name="UserData">		
+					<xs:complexType>
+						<xs:attribute name="class" type="xs:string" use="required"/>
+						<xs:attribute name="value" type="xs:string" use="required"/>
+					</xs:complexType>
+				</xs:element>		
+			</xs:sequence>
+      <xs:attribute name="configuration" type="xs:string" use="required"/>
+		</xs:extension>
+	</xs:complexContent>
+</xs:complexType>
+
+<!-- Element definitions for edges -->
+<xs:element name="PolyLineEdge"  type="PolyLineEdge.type"/>
+<xs:element name="ArcEdge"       type="ArcEdge.type"/>
+<xs:element name="BezierEdge"    type="Edge.type"/>
+<xs:element name="SplineEdge"    type="Edge.type"/>
+<xs:element name="QuadCurveEdge" type="QuadCurveEdge.type"/>
+<xs:element name="GenericEdge"   type="GenericEdge.type"/>
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexRedefine2Schemas/ygraphml.xsd b/xml/tests/testData/xml/ComplexRedefine2Schemas/ygraphml.xsd
new file mode 100644
index 0000000..d5d83ed
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine2Schemas/ygraphml.xsd
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+
+<!-- Header -->
+<xs:schema 
+             targetNamespace="http://graphml.graphdrawing.org/xmlns/graphml"
+
+             xmlns="http://graphml.graphdrawing.org/xmlns/graphml"
+             xmlns:g="http://graphml.graphdrawing.org/xmlns/graphml"
+             xmlns:y="http://www.yworks.com/xml/graphml"
+             xmlns:xs="http://www.w3.org/2001/XMLSchema"
+             xmlns:xlink="http://www.w3.org/1999/xlink"
+
+             elementFormDefault="qualified"
+             attributeFormDefault="unqualified"
+>
+
+<xs:import namespace="http://www.yworks.com/xml/graphml" schemaLocation="yfeatures.xsd"/>
+
+<!-- Redefinition of the elements in the graphml-structure schema -->
+<xs:redefine schemaLocation="graphml-attributes.xsd">
+
+	<xs:attributeGroup name="key.extra.attrib">
+		<xs:attributeGroup ref="key.extra.attrib"/>
+		<xs:attribute name="yfiles.type" type="xs:string" use="optional"/>
+	</xs:attributeGroup>
+	<!-- Definition of the different grouping types -->
+	<!-- The grouping type is stored as attribute at the node element -->
+	<xs:attributeGroup name="node.extra.attrib">
+		<xs:attributeGroup ref="node.extra.attrib"/>
+		<xs:attribute name="yfiles.foldertype" type="yfiles.foldertype.type" use="optional"/>
+	</xs:attributeGroup>
+	
+	<!-- Definition of the different node and edge types -->
+	<xs:complexType name="data-extension.type">
+	<xs:complexContent mixed="true">
+    <xs:extension base="data-extension.type">
+				<xs:choice minOccurs="0" maxOccurs="1">
+					<xs:element ref="y:ShapeNode"/>
+					<xs:element ref="y:ImageNode"/>
+					<xs:element ref="y:GroupNode"/>
+					<xs:element ref="y:GenericNode"/>
+					<xs:element ref="y:ProxyShapeNode"/>
+					<xs:element ref="y:ProxyAutoBoundsNode"/>
+					<xs:element ref="y:PolyLineEdge"/>
+					<xs:element ref="y:ArcEdge"/>
+					<xs:element ref="y:BezierEdge"/>
+					<xs:element ref="y:SplineEdge"/>
+					<xs:element ref="y:QuadCurveEdge"/>
+					<xs:element ref="y:GenericEdge"/>
+					<xs:element ref="y:Postprocessors"/>
+				</xs:choice>
+		</xs:extension>
+	</xs:complexContent>
+	</xs:complexType>
+</xs:redefine>		
+
+<!-- Type of Grouping -->
+<xs:simpleType name="yfiles.foldertype.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="folder"/>
+    	<xs:enumeration value="group"/>
+    	<xs:enumeration value="leaf"/>
+    </xs:restriction>
+</xs:simpleType>
+
+</xs:schema>
+
+
diff --git a/xml/tests/testData/xml/ComplexRedefine2Schemas/yprocessors.xsd b/xml/tests/testData/xml/ComplexRedefine2Schemas/yprocessors.xsd
new file mode 100644
index 0000000..60bfa4b
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine2Schemas/yprocessors.xsd
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+
+<!-- Header -->
+<xs:schema 
+             targetNamespace="http://www.yworks.com/xml/graphml"
+
+             xmlns="http://www.yworks.com/xml/graphml"
+             xmlns:g="http://graphml.graphdrawing.org/xmlns/graphml"
+             xmlns:xs="http://www.w3.org/2001/XMLSchema"
+             xmlns:xlink="http://www.w3.org/1999/xlink"
+
+             elementFormDefault="qualified"
+             attributeFormDefault="unqualified"
+>
+
+<!-- Processor -->
+<xs:complexType name="Processor.type">
+  <xs:sequence>
+    <xs:element name="Option" minOccurs="0" maxOccurs="unbounded">
+      <xs:complexType>
+        <xs:attribute name="name" type="xs:string" use="required"/>
+        <xs:attribute name="value" type="xs:string" use="required"/>
+      </xs:complexType>			
+    </xs:element>
+  </xs:sequence>	
+  <xs:attribute name="class" type="xs:string" use="required"/>
+</xs:complexType>
+
+<!-- Postprocessors --> 
+<xs:complexType name="Postprocessors.type">
+		<xs:sequence>
+			<xs:element name="Processor" type="Processor.type" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+</xs:complexType>
+
+<!-- Element Definition for  Postprocessors --> 
+<xs:element name="Postprocessors" type="Postprocessors.type"/>
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexRedefine3.xsd b/xml/tests/testData/xml/ComplexRedefine3.xsd
new file mode 100644
index 0000000..89e13d6
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine3.xsd
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+
+<!-- Header -->
+<xs:schema
+             targetNamespace="http://graphml.graphdrawing.org/xmlns/graphml"
+             xmlns="http://graphml.graphdrawing.org/xmlns/graphml"
+             xmlns:xs="http://www.w3.org/2001/XMLSchema"
+             elementFormDefault="qualified"
+             attributeFormDefault="unqualified"
+>
+
+<!-- Redefinition of the elements in the graphml-structure schema -->
+<xs:redefine schemaLocation="ComplexRedefine3_2.xsd">
+
+	<xs:attributeGroup name="key.extra.attrib">
+		<xs:attributeGroup ref="key.extra.attrib"/>
+		<xs:attribute name="yfiles.type" type="xs:string" use="optional"/>
+	</xs:attributeGroup>
+	<!-- Definition of the different grouping types -->
+	<!-- The grouping type is stored as attribute at the node element -->
+	<xs:attributeGroup name="node.extra.attrib">
+		<xs:attributeGroup ref="node.extra.attrib"/>
+		<xs:attribute name="yfiles.foldertype" type="yfiles.foldertype.type" use="optional"/>
+	</xs:attributeGroup>
+
+	<!-- Definition of the different node and edge types -->
+	<xs:complexType name="data-extension.type">
+	<xs:complexContent mixed="true">
+    <xs:extension base="data-extension.type">
+				<xs:choice minOccurs="0" maxOccurs="1"/>
+		</xs:extension>
+	</xs:complexContent>
+	</xs:complexType>
+</xs:redefine>
+
+<!-- Type of Grouping -->
+<xs:simpleType name="yfiles.foldertype.type">
+	<xs:restriction base="xs:NMTOKEN">
+		<xs:enumeration value="folder"/>
+    	<xs:enumeration value="group"/>
+    	<xs:enumeration value="leaf"/>
+    </xs:restriction>
+</xs:simpleType>
+
+</xs:schema>
+
+
diff --git a/xml/tests/testData/xml/ComplexRedefine3_2.xsd b/xml/tests/testData/xml/ComplexRedefine3_2.xsd
new file mode 100644
index 0000000..d25adda
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine3_2.xsd
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+
+<xs:schema
+             targetNamespace="http://graphml.graphdrawing.org/xmlns/graphml"
+
+             xmlns="http://graphml.graphdrawing.org/xmlns/graphml"
+             xmlns:xs="http://www.w3.org/2001/XMLSchema"
+
+             elementFormDefault="unqualified"
+             attributeFormDefault="unqualified"
+>
+
+<!--=============redefinition of the======================-->
+<!--=============key attributes===========================-->
+
+<xs:redefine schemaLocation="ComplexRedefine3_3.xsd">
+
+  <xs:attributeGroup name="key.extra.attrib">
+    <xs:attributeGroup ref="key.extra.attrib"/>
+    <xs:attributeGroup ref="key.attributes.attrib"/>
+  </xs:attributeGroup>
+
+</xs:redefine>
+
+	<xs:simpleType name="key.name.type" final="#all">
+		<xs:restriction base="xs:NMTOKEN"/>
+	</xs:simpleType>
+
+<xs:simpleType name="key.type.type" final="#all">
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="boolean"/>
+    <xs:enumeration value="int"/>
+    <xs:enumeration value="long"/>
+    <xs:enumeration value="float"/>
+    <xs:enumeration value="double"/>
+    <xs:enumeration value="string"/>
+  </xs:restriction>
+</xs:simpleType>
+
+	<xs:attributeGroup name="key.attributes.attrib">
+		<xs:attribute name="attr.name" type="key.name.type" use="optional"/>
+		<xs:attribute name="attr.type" type="key.type.type" use="optional"/>
+	</xs:attributeGroup>
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexRedefine3_3.xsd b/xml/tests/testData/xml/ComplexRedefine3_3.xsd
new file mode 100644
index 0000000..19b03d5
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine3_3.xsd
@@ -0,0 +1,430 @@
+<?xml version="1.0"?>
+
+<xs:schema
+             targetNamespace="http://graphml.graphdrawing.org/xmlns/graphml"
+
+             xmlns="http://graphml.graphdrawing.org/xmlns/graphml"
+             xmlns:g="http://graphml.graphdrawing.org/xmlns/graphml"
+             xmlns:xs="http://www.w3.org/2001/XMLSchema"
+             xmlns:xlink="http://www.w3.org/1999/xlink" 
+
+             elementFormDefault="unqualified"
+             attributeFormDefault="unqualified"
+>
+
+<xs:import namespace="http://www.w3.org/1999/xlink"
+           schemaLocation="xlink.xsd"
+/>
+
+
+
+<!--======================================================-->
+<!--=========user-defined extra attributes================-->
+<!--======================================================-->
+
+<!--extra attributes common to all GraphML elements-->
+
+<xs:attributeGroup name="common.extra.attrib"/>
+
+<!--specific extra attributes-->
+
+<xs:attributeGroup name="graphml.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="data.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="key.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="default.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="graph.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="node.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="edge.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="port.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="hyperedge.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="endpoint.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="locator.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+
+
+
+<!--======================================================-->
+<!--=============element type definitions=================-->
+<!--======================================================-->
+
+<!--=============data type================================-->
+
+<!--extension mechanism for the content of data and default-->
+<xs:complexType name="data-extension.type"/>
+
+<xs:complexType name="data.type" final="#all">
+  <xs:complexContent mixed="true">
+    <xs:extension base="data-extension.type">
+      <xs:attribute name="key" type="xs:NMTOKEN" use="required"/>
+      <xs:attribute name="id" type="xs:NMTOKEN" use="optional"/>
+      <xs:attributeGroup ref="data.extra.attrib"/>
+    </xs:extension>
+  </xs:complexContent>
+</xs:complexType>
+
+
+<!--=============key type=================================-->
+<xs:simpleType name="key.for.type" final="#all">
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="all"/>
+    <xs:enumeration value="graph"/>
+    <xs:enumeration value="node"/>
+    <xs:enumeration value="edge"/>
+    <xs:enumeration value="hyperedge"/>
+    <xs:enumeration value="port"/>
+    <xs:enumeration value="endpoint"/>
+  </xs:restriction>
+</xs:simpleType>
+
+
+<xs:complexType name="key.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>
+    <xs:element ref="default" minOccurs="0"/>
+  </xs:sequence>
+  <xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
+  <xs:attribute name="for" type="key.for.type" default="all"/>
+  <xs:attributeGroup ref="key.extra.attrib"/>
+</xs:complexType>
+
+<!--=============default type=============================-->
+<xs:complexType name="default.type" final="#all">
+  <xs:complexContent mixed="true">
+    <xs:extension base="data-extension.type">
+      <xs:attributeGroup ref="default.extra.attrib"/>
+    </xs:extension>
+  </xs:complexContent>
+</xs:complexType>
+
+
+<!--=============graphml type=============================-->
+
+<xs:complexType name="graphml.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>
+    <xs:element ref="key" minOccurs="0" maxOccurs="unbounded"/>
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="graph"/>
+        <xs:element ref="data"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:sequence>
+  <xs:attributeGroup ref="graphml.extra.attrib"/>
+</xs:complexType>
+
+
+<!--=============graph type===============================-->
+
+<xs:simpleType name="graph.edgedefault.type" final="#all">
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="directed"/>
+    <xs:enumeration value="undirected"/>
+  </xs:restriction>
+</xs:simpleType>
+
+
+<xs:complexType name="graph.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>
+    <xs:choice>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="data"/>
+          <xs:element ref="node"/>
+          <xs:element ref="edge"/>
+          <xs:element ref="hyperedge"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:element ref="locator"/>
+    </xs:choice>
+  </xs:sequence>
+  <xs:attributeGroup ref="graph.extra.attrib"/>
+  <xs:attribute name="id" type="xs:NMTOKEN"  />
+  <xs:attribute name="edgedefault"
+                type="graph.edgedefault.type" use="required"/>
+</xs:complexType>
+
+<!--=============node type================================-->
+
+<xs:complexType name="node.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>
+    <xs:choice>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="data"/>
+          <xs:element ref="port"/>
+        </xs:choice>
+        <xs:element ref="graph" minOccurs="0"/>
+      </xs:sequence>
+      <xs:element ref="locator"/>
+    </xs:choice>
+  </xs:sequence>
+  <xs:attributeGroup ref="node.extra.attrib"/>
+  <xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
+</xs:complexType>
+
+<!--=============port type================================-->
+
+<xs:complexType name="port.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0" />
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="data" />
+      <xs:element ref="port" />
+    </xs:choice>
+  </xs:sequence>
+  <xs:attributeGroup ref="port.extra.attrib"/>
+  <xs:attribute name="name" type="xs:NMTOKEN" use="required"/>
+</xs:complexType>
+
+<!--=============edge type================================-->
+
+<xs:complexType name="edge.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>
+    <xs:element ref="data" minOccurs="0" maxOccurs="unbounded"/>
+    <xs:element ref="graph" minOccurs="0"/>
+  </xs:sequence>
+  <xs:attributeGroup ref="edge.extra.attrib"/>
+  <xs:attribute name="id" type="xs:NMTOKEN" />
+  <xs:attribute name="directed" type="xs:boolean"/>
+  <xs:attribute name="source" type="xs:NMTOKEN" use="required"/>
+  <xs:attribute name="target" type="xs:NMTOKEN" use="required"/>
+  <xs:attribute name="sourceport" type="xs:NMTOKEN"/>
+  <xs:attribute name="targetport" type="xs:NMTOKEN"/>
+</xs:complexType>
+
+<!--=============hyperedge type===========================-->
+
+<xs:complexType name="hyperedge.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0" />
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="data" />
+      <xs:element ref="endpoint" />
+    </xs:choice>
+    <xs:element ref="graph" minOccurs="0" />
+  </xs:sequence>
+  <xs:attributeGroup ref="hyperedge.extra.attrib"/>
+  <xs:attribute name="id" type="xs:NMTOKEN" />
+</xs:complexType>
+
+<!--=============endpoint type============================-->
+
+<xs:simpleType name="endpoint.type.type" final="#all">
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="in"/>
+    <xs:enumeration value="out"/>
+    <xs:enumeration value="undir"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:complexType name="endpoint.type" final="#all">
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0" />
+  </xs:sequence>
+  <xs:attributeGroup ref="endpoint.extra.attrib"/>
+  <xs:attribute name="id" type="xs:NMTOKEN"/>
+  <xs:attribute name="port" type="xs:NMTOKEN" />
+  <xs:attribute name="node" type="xs:NMTOKEN" use="required"/>
+  <xs:attribute name="type" type="endpoint.type.type" default="undir"/>
+</xs:complexType>
+
+<!--=============locator type=============================-->
+
+<xs:complexType name="locator.type" final="#all">
+  <xs:attributeGroup ref="locator.extra.attrib"/>
+  <xs:attribute ref="xlink:href" use="required"/>
+  <xs:attribute ref="xlink:type" fixed="simple"/>
+</xs:complexType>
+
+
+<!--======================================================-->
+<!--============element declarations======================-->
+<!--======================================================-->
+
+<!--=============element: desc============================-->
+<xs:element name="desc" type="xs:string" block="#all"/>
+
+<!--=============element: locator=========================-->
+<xs:element name="locator" type="locator.type" block="#all"/>
+
+<!--=============element: data============================-->
+<xs:element name="data" type="data.type" block="#all">
+
+  <xs:unique name="data_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+<!--=============element: key=============================-->
+<xs:element name="key" type="key.type" block="#all"/>
+
+<!--=============element: default=========================-->
+<xs:element name="default" type="default.type" block="#all"/>
+
+<!--=============element: graphml=========================-->
+<xs:element name="graphml" type="graphml.type" block="#all">
+
+  <xs:unique name="all_id_unique">
+    <xs:selector xpath=".//g:*"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:unique name="graphml_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+  <xs:key name="key_id_key">
+    <xs:selector xpath=".//g:key"/>
+    <xs:field xpath="@id"/>
+  </xs:key>
+
+  <xs:key name="node_id_key">
+    <xs:selector xpath=".//g:node"/>
+    <xs:field xpath="@id"/>
+  </xs:key>
+
+  <xs:unique name="edge_id_unique">
+    <xs:selector xpath=".//g:edge"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:unique name="hyperedge_id_unique">
+    <xs:selector xpath=".//g:hyperedge"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:unique name="endpoint_id_unique">
+    <xs:selector xpath=".//g:endpoint"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:unique name="graph_id_unique">
+    <xs:selector xpath=".//g:graph"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:keyref name="data_key_ref" refer="key_id_key">
+    <xs:selector xpath=".//g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:keyref>
+
+  <xs:keyref name="edge_source_ref" refer="node_id_key">
+    <xs:selector xpath=".//g:edge"/>
+    <xs:field xpath="@source"/>
+  </xs:keyref>
+
+  <xs:keyref name="edge_target_ref" refer="node_id_key">
+    <xs:selector xpath=".//g:edge"/>
+    <xs:field xpath="@target"/>
+  </xs:keyref>
+
+  <xs:keyref name="endpoint_node_ref" refer="node_id_key">
+    <xs:selector xpath=".//g:endpoint"/>
+    <xs:field xpath="@node"/>
+  </xs:keyref>
+
+</xs:element>
+
+
+<!--=============element: graph===========================-->
+<xs:element name="graph" type="graph.type" block="#all">
+
+  <xs:unique name="graph_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+<!--=============element: node============================-->
+<xs:element name="node" type="node.type" block="#all">
+
+  <xs:key name="port_name_key">
+    <xs:selector xpath=".//g:port"/>
+    <xs:field xpath="@name"/>
+  </xs:key>
+
+  <xs:unique name="node_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+<!--=============element: port============================-->
+<xs:element name="port" type="port.type" block="#all">
+
+  <xs:unique name="port_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+<!--=============element: edge============================-->
+<xs:element name="edge" type="edge.type" block="#all">
+
+  <xs:unique name="edge_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+<!--=============element: hyperedge=======================-->
+<xs:element name="hyperedge" type="hyperedge.type" block="#all">
+
+  <xs:unique name="hyperedge_data_key_unique">
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+<!--=============element: endpoint========================-->
+<xs:element name="endpoint" type="endpoint.type" block="#all"/>
+
+</xs:schema>
+
+<!--======================================================-->
+<!--      end of file: graphml-structure.xsd             -->
+<!--======================================================-->
diff --git a/xml/tests/testData/xml/ComplexRedefine4.xml b/xml/tests/testData/xml/ComplexRedefine4.xml
new file mode 100644
index 0000000..9220227
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine4.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<outer xmlns="http://simple"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://simple ComplexRedefine4.xsd">
+    <inner attr="true" extended.attr="fail"/>
+</outer>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexRedefine4.xsd b/xml/tests/testData/xml/ComplexRedefine4.xsd
new file mode 100644
index 0000000..06ac3cc
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine4.xsd
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+
+<xs:schema targetNamespace="http://simple" xmlns="http://simple" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+  <xs:redefine schemaLocation="ComplexRedefine4_2.xsd">
+
+    <xs:attributeGroup name="innerAttributes">
+      <xs:attributeGroup ref="innerAttributes"/>
+      <xs:attribute name="extended.attr" type="xs:string" use="optional"/>
+    </xs:attributeGroup>
+
+  </xs:redefine>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexRedefine4_2.xsd b/xml/tests/testData/xml/ComplexRedefine4_2.xsd
new file mode 100644
index 0000000..58ca57f
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine4_2.xsd
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+
+<xs:schema targetNamespace="http://simple" xmlns="http://simple" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+    <xs:complexType name="outer.type">
+        <xs:sequence>
+            <xs:element ref="inner" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:attributeGroup name="innerAttributes">
+        <xs:attribute name="attr" type="xs:boolean" use="optional"/>
+    </xs:attributeGroup>
+
+    <xs:complexType name="inner.type">
+        <xs:attributeGroup ref="innerAttributes">
+        </xs:attributeGroup>
+    </xs:complexType>
+
+    <xs:element name="outer" type="outer.type">
+    </xs:element>
+
+    <xs:element name="inner" type="inner.type">
+    </xs:element>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexRedefine5.xml b/xml/tests/testData/xml/ComplexRedefine5.xml
new file mode 100644
index 0000000..30b47d4
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine5.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<outer xmlns="http://simple"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://simple http://extended">
+    <inner attr="true" extended.attr="fail">
+      <extended></extended>
+    </inner>
+</outer>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexRedefine5.xsd b/xml/tests/testData/xml/ComplexRedefine5.xsd
new file mode 100644
index 0000000..e24128c
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine5.xsd
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+
+<xs:schema targetNamespace="http://simple" xmlns="http://simple" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+    <xs:redefine schemaLocation="http://simple">
+
+        <xs:attributeGroup name="innerAttributes">
+            <xs:attributeGroup ref="innerAttributes"/>
+            <xs:attribute name="extended.attr" type="xs:string" use="optional"/>
+        </xs:attributeGroup>
+
+      <xs:complexType name="inner.type">
+          <xs:complexContent>
+              <xs:extension base="inner.type">
+                  <xs:sequence minOccurs="0">
+                      <xs:element name="extended"/>
+                  </xs:sequence>
+              </xs:extension>
+          </xs:complexContent>
+      </xs:complexType>
+
+    </xs:redefine>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexRedefine5_2.xsd b/xml/tests/testData/xml/ComplexRedefine5_2.xsd
new file mode 100644
index 0000000..58ca57f
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine5_2.xsd
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+
+<xs:schema targetNamespace="http://simple" xmlns="http://simple" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+    <xs:complexType name="outer.type">
+        <xs:sequence>
+            <xs:element ref="inner" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:attributeGroup name="innerAttributes">
+        <xs:attribute name="attr" type="xs:boolean" use="optional"/>
+    </xs:attributeGroup>
+
+    <xs:complexType name="inner.type">
+        <xs:attributeGroup ref="innerAttributes">
+        </xs:attributeGroup>
+    </xs:complexType>
+
+    <xs:element name="outer" type="outer.type">
+    </xs:element>
+
+    <xs:element name="inner" type="inner.type">
+    </xs:element>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexRedefine6.xml b/xml/tests/testData/xml/ComplexRedefine6.xml
new file mode 100644
index 0000000..30873ba
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine6.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+    <bean name="JBossThreadsMetaDataFactoryDeployer"
+          class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryDeployer">
+        <constructor>
+            <parameter>org.jboss.threads.metadata.ThreadsMetaData</parameter>
+        </constructor>
+    </bean>
+
+    <bean name="JBossThreadsMetaDataSchemaResolverDeployer"
+          class="org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer">
+        <constructor>
+            <parameter>org.jboss.threads.metadata.ThreadsMetaData</parameter>
+        </constructor>
+        <property name="name">jboss-threads.xml</property>
+        <property name="registerWithJBossXB">true</property>
+    </bean>
+</deployment>
diff --git a/xml/tests/testData/xml/ComplexRedefine6.xsd b/xml/tests/testData/xml/ComplexRedefine6.xsd
new file mode 100644
index 0000000..bac5179
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine6.xsd
@@ -0,0 +1,311 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A prototype xsd schema for the pojoserver xml deployer
+$Id: bean-deployer_2_0.xsd 76911 2008-08-11 12:42:15Z alesj $
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+   targetNamespace="urn:jboss:bean-deployer:2.0"
+   xmlns="urn:jboss:bean-deployer:2.0"
+   elementFormDefault="qualified"
+   attributeFormDefault="unqualified"
+   version="1.0">
+
+   <xsd:annotation>
+      <xsd:documentation>
+         <![CDATA[
+         The xml deployer schema. The deployment document instance
+         root element should reference the schema in the root
+         deployment element using something like:
+
+         <deployment xmlns="urn:jboss:bean-deployer:2.0">
+         ...
+         ]]>
+      </xsd:documentation>
+   </xsd:annotation>
+
+   <xsd:redefine schemaLocation="ComplexRedefine6_2.xsd">
+      <xsd:complexType name="beanType">
+         <xsd:complexContent>
+            <xsd:extension base="beanType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="classloaderType">
+         <xsd:complexContent>
+            <xsd:extension base="classloaderType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="abstractBeanfactoryType">
+         <xsd:complexContent>
+            <xsd:extension base="abstractBeanfactoryType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="beanfactoryType">
+         <xsd:complexContent>
+            <xsd:extension base="beanfactoryType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="lazyType">
+         <xsd:complexContent>
+            <xsd:extension base="lazyType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="constructorType">
+         <xsd:complexContent>
+            <xsd:extension base="constructorType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="lifecycleType">
+         <xsd:complexContent>
+            <xsd:extension base="lifecycleType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="installType">
+         <xsd:complexContent>
+            <xsd:extension base="installType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="uninstallCallbackType">
+         <xsd:complexContent>
+            <xsd:extension base="uninstallCallbackType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="installCallbackType">
+         <xsd:complexContent>
+            <xsd:extension base="installCallbackType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="dependencyType">
+         <xsd:complexContent>
+            <xsd:extension base="dependencyType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="injectionType">
+         <xsd:complexContent>
+            <xsd:extension base="injectionType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="searchType">
+         <xsd:complexContent>
+            <xsd:extension base="searchType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="valueFactoryType">
+         <xsd:complexContent>
+            <xsd:extension base="valueFactoryType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="factoryType">
+         <xsd:complexContent>
+            <xsd:extension base="factoryType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="aliasType">
+         <xsd:complexContent>
+            <xsd:extension base="aliasType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="namedAliasType">
+         <xsd:complexContent>
+            <xsd:extension base="namedAliasType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="parameterType">
+         <xsd:complexContent>
+            <xsd:extension base="parameterType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="propertyType">
+         <xsd:complexContent>
+            <xsd:extension base="propertyType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="relatedClassType">
+         <xsd:complexContent>
+            <xsd:extension base="relatedClassType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="annotationType">
+         <xsd:complexContent>
+            <xsd:extension base="annotationType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="interfaceType">
+         <xsd:complexContent>
+            <xsd:extension base="interfaceType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:simpleType name="classNameType">
+         <xsd:restriction base="classNameType"/>
+      </xsd:simpleType>
+      <xsd:complexType name="plainValueType">
+         <xsd:complexContent>
+            <xsd:extension base="plainValueType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="valueType">
+         <xsd:complexContent>
+            <xsd:extension base="valueType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="classLoaderValueType">
+         <xsd:complexContent>
+            <xsd:extension base="classLoaderValueType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="annotatedValueType">
+         <xsd:complexContent>
+            <xsd:extension base="annotatedValueType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="namedValueType">
+         <xsd:complexContent>
+            <xsd:extension base="namedValueType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="baseCollectionType">
+         <xsd:complexContent>
+            <xsd:extension base="baseCollectionType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="collectionType">
+         <xsd:complexContent>
+            <xsd:extension base="collectionType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="listType">
+         <xsd:complexContent>
+            <xsd:extension base="listType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="setType">
+         <xsd:complexContent>
+            <xsd:extension base="setType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="arrayType">
+         <xsd:complexContent>
+            <xsd:extension base="arrayType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="mapType">
+         <xsd:complexContent>
+            <xsd:extension base="mapType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="entryType">
+         <xsd:complexContent>
+            <xsd:extension base="entryType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="dependsType">
+         <xsd:complexContent>
+            <xsd:extension base="dependsType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="demandType">
+         <xsd:complexContent>
+            <xsd:extension base="demandType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="supplyType">
+         <xsd:complexContent>
+            <xsd:extension base="supplyType"/>
+         </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:simpleType name="controllerStateType">
+         <xsd:restriction base="controllerStateType"/>
+      </xsd:simpleType>
+      <xsd:simpleType name="controllerModeType">
+         <xsd:restriction base="controllerModeType"/>
+      </xsd:simpleType>
+      <xsd:simpleType name="autowireTypeType">
+         <xsd:restriction base="autowireTypeType"/>
+      </xsd:simpleType>
+      <xsd:simpleType name="accessModeType">
+         <xsd:restriction base="accessModeType"/>
+      </xsd:simpleType>
+      <xsd:simpleType name="optionType">
+         <xsd:restriction base="optionType"/>
+      </xsd:simpleType>
+      <xsd:simpleType name="contextType">
+         <xsd:restriction base="contextType"/>
+      </xsd:simpleType>
+   </xsd:redefine>
+
+   <xsd:element name="deployment" type="deploymentType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           The root of the xml deployer instance document
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+   </xsd:element>
+
+   <xsd:complexType name="deploymentType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           The deployment contains a number of beans and bean factories.
+
+           e.g.
+           <deployment ...>
+              <bean .../>
+              <bean .../>
+              <beanfactory .../>
+           </deployment>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:choice minOccurs="0" maxOccurs="unbounded">
+         <xsd:element name="annotation" type="annotationType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="classloader" type="classloaderType" minOccurs="0"/>
+         <xsd:element name="alias" type="namedAliasType" minOccurs="0"/>
+         <xsd:element name="create" type="lifecycleType" minOccurs="0"/>
+         <xsd:element name="start" type="lifecycleType" minOccurs="0"/>
+         <xsd:element name="stop" type="lifecycleType" minOccurs="0"/>
+         <xsd:element name="destroy" type="lifecycleType" minOccurs="0"/>
+         <xsd:element name="bean" type="beanType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="beanfactory" type="beanfactoryType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="lazy" type="lazyType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:any namespace="##other" processContents="strict" minOccurs="0">
+            <xsd:annotation>
+               <xsd:documentation>An extension value</xsd:documentation>
+            </xsd:annotation>
+         </xsd:any>
+      </xsd:choice>
+      <xsd:attribute name="name" type="xsd:string" use="optional"/>
+      <xsd:attribute name="scoped" type="xsd:boolean" use="optional"/>
+      <xsd:attribute name="mode" type="controllerModeType" use="optional"/>
+   </xsd:complexType>
+
+   <!--
+     WARN:
+     Do not use this in the bean deployer, it won't work!
+     FIXME:
+     The correct way to do this is to have two separate
+     schemas (one for deployments the other for beans)
+     then use schema imports.
+   -->
+   <xsd:element name="bean" type="beanType"/>
+
+   <!--
+     WARN:
+     Do not use this in the bean deployer, it won't work!
+     FIXME:
+     The correct way to do this is to have two separate
+     schemas (one for deployments the other for beans)
+     then use schema imports.
+   -->
+   <xsd:element name="beanfactory" type="beanfactoryType"/>
+
+   <!--
+     WARN:
+     Do not use this in the bean deployer, it won't work!
+     FIXME:
+     The correct way to do this is to have two separate
+     schemas (one for deployments the other for beans)
+     then use schema imports.
+   -->
+   <xsd:element name="lazy" type="lazyType"/>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexRedefine6_2.xsd b/xml/tests/testData/xml/ComplexRedefine6_2.xsd
new file mode 100644
index 0000000..bdbdaa6
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefine6_2.xsd
@@ -0,0 +1,1148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A prototype xsd schema for the pojoserver xml deployer
+$Id: bean-deployer_2_0.xsd 70437 2008-03-05 17:13:04Z alesj $
+ -->
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+   elementFormDefault="qualified"
+   attributeFormDefault="unqualified"
+   targetNamespace="urn:jboss:bean-deployer:2.0"
+   xmlns="urn:jboss:bean-deployer:2.0"
+   version="1.0">
+
+   <xsd:complexType name="beanType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           The bean is an instance of a pojo.
+
+           e.g.
+           <bean name="MyName" class="com.acme.POJO">
+              <classloader .../>
+              <constructor .../>
+              <property .../>
+              <property .../>
+              <depends .../>
+           </bean>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+         <xsd:element name="annotation" type="annotationType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="alias" type="aliasType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="related-class" type="relatedClassType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="classloader" type="classloaderType" minOccurs="0"/>
+         <xsd:element name="constructor" type="constructorType" minOccurs="0"/>
+         <xsd:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="create" type="lifecycleType" minOccurs="0"/>
+         <xsd:element name="start" type="lifecycleType" minOccurs="0"/>
+         <xsd:element name="stop" type="lifecycleType" minOccurs="0"/>
+         <xsd:element name="destroy" type="lifecycleType" minOccurs="0"/>
+         <xsd:element name="depends" type="dependsType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="demand" type="demandType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="supply" type="supplyType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="install" type="installType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="uninstall" type="installType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="incallback" type="installCallbackType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="uncallback" type="uninstallCallbackType" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="name" type="xsd:string" use="optional"/>
+      <xsd:attribute name="class" type="xsd:token" use="optional"/>
+      <xsd:attribute name="mode" type="controllerModeType" use="optional"/>
+      <xsd:attribute name="parent" type="xsd:string" use="optional"/>
+      <xsd:attribute name="abstract" type="xsd:boolean" use="optional"/>
+      <xsd:attribute name="autowire-type" type="autowireTypeType" use="optional"/>
+      <xsd:attribute name="autowire-candidate" type="xsd:boolean" use="optional"/>
+      <xsd:attribute name="access-mode" type="accessModeType" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="classloaderType" mixed="true">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           The classloader is to load the bean
+
+           e.g.
+           <bean ...>
+              <classloader><inject bean="Classloader"/></classloader>
+           </bean>
+
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:complexContent>
+         <xsd:extension base="classLoaderValueType"/>
+      </xsd:complexContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="abstractBeanfactoryType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           Base type for beanfatoryType.
+           ]]>
+
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+         <xsd:element name="alias" type="aliasType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="related-class" type="relatedClassType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="classloader" type="classloaderType" minOccurs="0"/>
+         <xsd:element name="constructor" type="constructorType" minOccurs="0"/>
+         <xsd:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="create" type="lifecycleType" minOccurs="0"/>
+         <xsd:element name="start" type="lifecycleType" minOccurs="0"/>
+         <xsd:element name="depends" type="dependsType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="demand" type="demandType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="supply" type="supplyType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="install" type="installType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="uninstall" type="installType" minOccurs="0" maxOccurs="unbounded"/>
+<!--
+         <xsd:element name="incallback" type="intallCallbackType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="uncallback" type="uninstallCallbackType" minOccurs="0" maxOccurs="unbounded"/>
+-->
+      </xsd:sequence>
+      <xsd:attribute name="name" type="xsd:string" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="beanfactoryType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           The beanfactory is a org.jboss.beans.metadata.plugins.factory.GenericBeanFactory deployment.
+           This gives you a factory such you can invoke createBean() multiple times with the guarantee
+           that the injected objects are "installed".
+
+           e.g.
+           <bean name="User" class="com.acme.User">
+              <property name="factory"><inject bean="Factory"/></property>
+           </bean>
+
+           <beanfactory name="Factory" class="com.acme.SomeBean">
+              <property name="someProperty"><inject bean="SomeOtherBean"/></property>
+           </beanFactory>
+
+           package com.acme.User;
+           public class User {
+              // factory has been configured at this point
+              public void setFactory(GenericBeanFactory factory) {
+                 SomeBean bean1 = factory.createBean();
+                 System.out.println(bean1.getSomeProperty()); // "SomeOtherBean"
+                 SomeBean bean2 = factory.createBean();
+                 System.out.println(bean2.getSomeProperty()); // "SomeOtherBean"
+              }
+           }
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:complexContent>
+         <xsd:extension base="abstractBeanfactoryType">
+            <xsd:attribute name="class" type="xsd:token" use="required"/>
+            <xsd:attribute name="access-mode" type="accessModeType" use="optional"/>
+            <xsd:attribute name="factoryClass" type="xsd:token" use="optional"/>
+         </xsd:extension>
+      </xsd:complexContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="lazyType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           Wrap the existing bean into lazy proxy.
+           Expose the full class or just interfaces.
+           Name is optional, and if no name is provided bean+'Proxy' will be used.
+
+           e.g.
+           <lazy name="UserProxy" bean="User">
+              <interface>org.acme.domain.IUser</interface>
+           </lazy>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+         <xsd:element name="interface" type="interfaceType" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="name" type="xsd:string" use="optional"/>
+      <xsd:attribute name="bean" type="xsd:string" use="required"/>
+      <xsd:attribute name="exposeClass" type="xsd:boolean" default="false" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="constructorType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           The constructor for this bean(factory) instance.
+
+           e.g. simple constructor - new POJO(new String("String value"));
+           <bean name="MyBean" class="com.acme.POJO">
+              <constructor>
+                 <parameter>String value</parameter>
+              </constructor>
+           </bean>
+
+           e.g. static factory - com.acme.Factory.newInstance(new String("String value"));
+           <bean name="MyBean" class="com.acme.POJO">
+              <constructor factoryClass="com.acme.Factory" factoryMethod="newInstance">
+                 <parameter>String value</parameter>
+              </constructor>
+           </bean>
+
+           e.g. instance factory - "SomeOtherBean".newInstance(new String("String value"));
+           <bean name="MyBean" class="com.acme.POJO">
+              <constructor factoryMethod="newInstance">
+                 <factory bean="SomeOtherBean"/>
+                 <parameter>String value</parameter>
+              </constructor>
+           </bean>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+         <xsd:element name="annotation" type="annotationType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:choice minOccurs="0">
+            <xsd:sequence>
+               <xsd:element name="factory" type="factoryType" minOccurs="0"/>
+               <xsd:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"/>
+            </xsd:sequence>
+            <xsd:element name="bean" type="beanType"/>
+            <xsd:element name="lazy" type="lazyType"/>
+            <xsd:element name="value" type="plainValueType"/>
+            <xsd:element name="collection" type="collectionType"/>
+            <xsd:element name="list" type="listType"/>
+            <xsd:element name="set" type="setType"/>
+            <xsd:element name="array" type="arrayType"/>
+            <xsd:element name="map" type="mapType"/>
+            <xsd:element name="inject" type="injectionType"/>
+            <xsd:element name="value-factory" type="valueFactoryType"/>
+            <xsd:any namespace="##other" processContents="strict">
+               <xsd:annotation>
+                  <xsd:documentation>An extension value</xsd:documentation>
+               </xsd:annotation>
+            </xsd:any>
+         </xsd:choice>
+      </xsd:sequence>
+      <xsd:attribute name="factoryClass" type="classNameType" use="optional"/>
+      <xsd:attribute name="factoryMethod" type="xsd:token" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="lifecycleType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           The lifecycle lets you override the method parameters passed to the
+           create, start, stop, destroy lifecycle callbacks.
+
+           e.g.
+           <bean>
+              <create method="initialize">
+                 <parameter>String value</parameter>
+              </create>
+           </bean>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+         <xsd:element name="annotation" type="annotationType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="method" type="xsd:token" use="optional"/>
+      <xsd:attribute name="ignored" type="xsd:boolean" use="optional" default="false"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="installType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           The install type you write your installation methods state operations.
+           The install operation is invoked after the start lifecycle.
+           The uninstall operation is invoked before the stop lifecycle.
+
+           e.g.
+           <bean>
+              <install bean="Repository" method="add">
+                 <parameter><this/></parameter>
+              </install>
+              <uninstall bean="Repository" method="remove">
+                 <parameter><this/></parameter>
+              </uninstall>
+           </bean>
+
+           If you don't include a bean attribute, the method is invoked on your bean
+
+           e.g.
+           <bean>
+              <install method="install"/>
+              <uninstall bean="method="uninstall"/>
+           </bean>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+         <xsd:element name="annotation" type="annotationType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="bean" type="xsd:string" use="optional"/>
+      <xsd:attribute name="method" type="xsd:token" use="required"/>
+      <xsd:attribute name="state" type="controllerStateType" use="optional"/>
+      <xsd:attribute name="whenRequired" type="controllerStateType" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="uninstallCallbackType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           Callback item description.
+           Define you methods for callback invocation.
+
+           e.g.
+           <bean>
+              <uncallback method="addSomething" />
+              <uncallback property="items" cardinality="2..n" />
+              <uncallback property="info" signature="org.jboss.test.Info"/>
+           </bean>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+         <xsd:element name="annotation" type="annotationType" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="method" type="xsd:token" use="optional"/>
+      <xsd:attribute name="property" type="xsd:token" use="optional"/>
+      <xsd:attribute name="cardinality" type="xsd:token" use="optional"/>
+      <xsd:attribute name="whenRequired" type="controllerStateType" use="optional"/>
+      <xsd:attribute name="state" type="controllerStateType" use="optional"/>
+      <xsd:attribute name="signature" type="xsd:token" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="installCallbackType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           Callback item description.
+           Define you methods for callback invocation.
+
+           e.g.
+           <bean>
+              <incallback method="addSomething" />
+              <incallback property="items" cardinality="2..n" />
+              <incallback property="info" signature="org.jboss.test.Info"/>
+           </bean>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+         <xsd:element name="annotation" type="annotationType" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="method" type="xsd:token" use="optional"/>
+      <xsd:attribute name="property" type="xsd:token" use="optional"/>
+      <xsd:attribute name="cardinality" type="xsd:token" use="optional"/>
+      <xsd:attribute name="whenRequired" type="controllerStateType" use="optional"/>
+      <xsd:attribute name="state" type="controllerStateType" use="optional"/>
+      <xsd:attribute name="signature" type="xsd:token" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="dependencyType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A dependency represents an injection into the bean.
+           They can be used anywhere a string value can appear.
+
+           e.g. Bean instance - "InjectedIntoMe".setSomeProperty("BeanInjected");
+           <bean name="InjectedIntoMe" ...>
+              <property name="someProperty"><inject bean="BeanInjected"/>
+           </bean>
+           <bean name="BeanInjected" .../>
+
+           e.g. Bean property - "InjectedIntoMe".setSomeProperty("BeanInjected".getOtherProperty());
+           <bean name="InjectedIntoMe" ...>
+              <property name="someProperty"><inject bean="BeanInjected" property="otherProperty"/>
+           </bean>
+           <bean name="BeanInjected" .../>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:attribute name="bean" type="xsd:string" use="required"/>
+      <xsd:attribute name="property" type="xsd:string" use="optional"/>
+      <xsd:attribute name="state" type="controllerStateType" use="optional"/>
+      <xsd:attribute name="whenRequired" type="controllerStateType" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="injectionType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A dependency represents an injection into the bean.
+           They can be used anywhere a string value can appear.
+
+           e.g. Bean instance - "InjectedIntoMe".setSomeProperty("BeanInjected");
+           <bean name="InjectedIntoMe" ...>
+              <property name="someProperty"><inject bean="BeanInjected"/>
+           </bean>
+           <bean name="BeanInjected" .../>
+
+           e.g. Bean property - "InjectedIntoMe".setSomeProperty("BeanInjected".getOtherProperty());
+           <bean name="InjectedIntoMe" ...>
+              <property name="someProperty"><inject bean="BeanInjected" property="otherProperty"/>
+           </bean>
+           <bean name="BeanInjected" .../>
+
+           e.g. Contextual injection - finding exactly one instance which matches property's class type
+           <bean name="InjectedIntoMe" ...>
+              <property name="transactionManager"><inject/></property>
+           </bean>
+
+           e.g. Contextual injection - finding exactly one instance which matches property's name
+           <bean name="InjectedIntoMe" ...>
+              <property name="transactionManager"><inject type="ByName"/></property>
+           </bean>
+
+           e.g. Contextual injection - set optional injection; execute callback if currently no matching context exists
+           <bean name="InjectedIntoMe" ...>
+              <property name="transactionManager"><inject option="Callback"/></property>
+           </bean>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:attribute name="bean" type="xsd:string" use="optional"/>
+      <xsd:attribute name="property" type="xsd:string" use="optional"/>
+      <xsd:attribute name="state" type="controllerStateType" use="optional"/>
+      <xsd:attribute name="whenRequired" type="controllerStateType" use="optional"/>
+      <xsd:attribute name="type" type="autowireTypeType" use="optional" default="ByClass"/>
+      <xsd:attribute name="option" type="optionType" use="optional" default="Strict"/>
+      <xsd:attribute name="fromContext" type="contextType" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="searchType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           e.g. Search injection - by scope.
+           <bean name="InjectedIntoMe" ...>
+              <property name="transactionManager"><search bean="someTMbean" type="top"/></property>
+           </bean>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:attribute name="bean" type="xsd:string" use="required"/>
+      <xsd:attribute name="property" type="xsd:string" use="optional"/>
+      <xsd:attribute name="state" type="controllerStateType" use="optional"/>
+      <xsd:attribute name="type" type="searchTypeType" use="required"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="valueFactoryType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A dependency represents an value injection into the bean.
+           They can be used anywhere a string value can appear.
+
+           e.g. Bean instance - "InjectedIntoMe".setSomeProperty("ValueFactory".getValue("foo.bar.prop", "mydefault"));
+           <bean name="InjectedIntoMe" ...>
+              <property name="someProperty">
+                  <value-factory bean="BeanInjected" method="getValue">
+                     <parameter>foo.bar.prop</parameter>
+                     <parameter>mydefault</parameter>
+                  </value-factory>
+              </property>
+           </bean>
+           <bean name="BeanInjected" .../>
+
+           e.g. Bean instance - "InjectedIntoMe".setSomeProperty("ValueFactory".getValue("foo.bar.prop"));
+           <bean name="InjectedIntoMe" ...>
+              <property name="someProperty">
+                  <value-factory bean="BeanInjected" method="getValue" parameter="foo.bar.prop" default="mydefault" />
+              </property>
+           </bean>
+           <bean name="BeanInjected" .../>
+
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+         <xsd:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="bean" type="xsd:string"/>
+      <xsd:attribute name="method" type="xsd:string"/>
+      <xsd:attribute name="state" type="controllerStateType" use="optional"/>
+      <xsd:attribute name="whenRequired" type="controllerStateType" use="optional"/>
+      <xsd:attribute name="parameter" type="xsd:string" use="optional"/>
+      <xsd:attribute name="default" type="xsd:string" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="factoryType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A factory represents another bean used to construct an object.
+
+           e.g. Bean instance - "InjectedIntoMe".setSomeProperty("BeanInjected");
+           <bean name="ConstructMe" ...>
+              <constructor factoryMethod="someMethod">
+                 <factory bean="Factory"/>
+              </constructor>
+           </bean>
+           <bean name="Factory" .../>
+
+           You can also inject a property of the bean bean
+           e.g.
+           <bean name="ConstructMe" ...>
+              <constructor factoryMethod="someMethod">
+                 <factory bean="Builder" property="getFactory"/>
+              </constructor>
+           </bean>
+
+           Or you can construct a factory in place using a different schema/namsapce
+           e.g.
+           <bean name="ConstructMe" ...>
+              <constructor factoryMethod="someMethod">
+                 <factory>
+                    <javabean xmlns="someOtherNamespace" class="com.acme.FactoryClass"/>
+                 </factory>
+              </constructor>
+           </bean>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:choice minOccurs="0">
+         <xsd:any namespace="##other" processContents="strict"/>
+      </xsd:choice>
+      <xsd:attribute name="bean" type="xsd:string" use="optional"/>
+      <xsd:attribute name="property" type="xsd:string" use="optional"/>
+      <xsd:attribute name="state" type="controllerStateType" use="optional"/>
+      <xsd:attribute name="whenRequired" type="controllerStateType" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="aliasType" mixed="true">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            Bean's aliases.
+
+            e.g.
+            <bean name="MyName" class="com.acme.POJO">
+               <alias>YourName</alias>
+               <alias><javabean xmlns="urn:jboss:javabean:2.0" class="whatevever"/></alias>
+            </bean>
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:choice minOccurs="0">
+         <xsd:any namespace="##other" processContents="strict"/>
+      </xsd:choice>
+   </xsd:complexType>
+
+   <xsd:complexType name="namedAliasType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           An alias that has a name attribute.
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:complexContent>
+         <xsd:extension base="aliasType">
+            <xsd:attribute name="name" type="xsd:string" use="required"/>
+         </xsd:extension>
+      </xsd:complexContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="relatedClassType" mixed="true">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           Related classes.
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:choice minOccurs="0" maxOccurs="unbounded">
+         <xsd:any namespace="##other" processContents="strict"/>
+      </xsd:choice>
+      <xsd:attribute name="name" type="xsd:string" use="required"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="parameterType" mixed="true">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A parameter is used to define the constructor, factory
+           and lifecycle method usage.
+
+           e.g. Using number of parameters when this is unique enough
+           <bean ...>
+              <constructor>
+                 <parameter>1st Parameter</parameter>
+                 <parameter>2nd Parameter</parameter>
+              </constructor>
+           </bean>
+
+           e.g. Explicitly stating the parameter type to resolve overloading
+           <bean ...>
+              <constructor>
+                 <parameter>1st Parameter</parameter>
+                 <parameter class="java.lang.String">2nd Parameter</parameter>
+              </constructor>
+           </bean>
+
+           e.g. To override the injected type use <value/>
+           <bean ...>
+              <constructor>
+                 <parameter>1st Parameter</parameter>
+                 <!-- Parameter is java.lang.Object, but we inject a String -->
+                 <parameter class="java.lang.Object">
+                    <value class="java.lang.String">2nd Parameter</value>
+                 </parameter>
+              </constructor>
+           </bean>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:complexContent>
+         <xsd:extension base="annotatedValueType"/>
+      </xsd:complexContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="propertyType" mixed="true">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A property defines values passed to the setters.
+
+           e.g. Using the type from the setter argument
+           <bean ...>
+              <property name="someProperty">Some value</property>
+           </bean>
+
+           e.g. Overridding the injected type
+           <bean ...>
+              <property name="someProperty" class="java.lang.String">Some value</property>
+           </bean>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:complexContent>
+         <xsd:extension base="namedValueType">
+            <xsd:attribute name="preinstantiate" type="xsd:boolean" use="optional" default="true"/>
+         </xsd:extension>
+      </xsd:complexContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="annotationType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           The annotation type represents a Java5 annotation on the particular join point.
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleContent>
+         <xsd:extension base="xsd:string">
+            <xsd:attribute name="replace" type="xsd:boolean"/>
+         </xsd:extension>
+      </xsd:simpleContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="interfaceType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           The interface type represents an interface class.
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleContent>
+         <xsd:extension base="xsd:string" />
+      </xsd:simpleContent>
+   </xsd:complexType>
+
+   <xsd:simpleType name="classNameType">
+      <xsd:annotation>
+         <xsd:documentation> The elements that use this type designate the name
+            of a Java class or interface. The name is in the form of a "binary
+            name", as defined in the JLS and as used in Class.forName().
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:restriction base="xsd:string">
+         <xsd:whiteSpace value="collapse"/>
+      </xsd:restriction>
+   </xsd:simpleType>
+
+   <xsd:group name="valueGroup">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           The value group represents the comment elements of the other configurations
+           <parameter/>, <property/> or collection components
+           e.g.
+
+           <property name="someProperty">
+              <list><value class="java.lang.String">Hello</value></list>
+           </property>
+
+           e.g. This also defines the null value
+           <property name="someProperty"><null/></property>
+           as opposed to the empty string
+           <property name="someProperty"></property>
+           or the string "null"
+           <property name="someProperty">null</property>
+
+           The this operation lets you pass yourself as a parameter.
+           e.g.
+           <install bean="SomeOtherBean> method="install">
+              <parameter><this/></parameter>
+           </install>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:choice>
+         <!--<xsd:element name="bean" type="beanType"/>-->
+         <!--<xsd:element name="lazy" type="lazyType"/>-->
+         <xsd:element name="value" type="plainValueType"/>
+         <xsd:element name="inject" type="injectionType"/>
+         <xsd:element name="value-factory" type="valueFactoryType"/>
+         <xsd:element name="collection" type="collectionType"/>
+         <xsd:element name="list" type="listType"/>
+         <xsd:element name="set" type="setType"/>
+         <xsd:element name="array" type="arrayType"/>
+         <xsd:element name="map" type="mapType"/>
+         <xsd:element name="null">
+            <xsd:complexType/>
+         </xsd:element>
+         <xsd:element name="this">
+            <xsd:complexType/>
+         </xsd:element>
+         <xsd:any namespace="##other" processContents="strict">
+            <xsd:annotation>
+               <xsd:documentation>An extension value</xsd:documentation>
+            </xsd:annotation>
+         </xsd:any>
+      </xsd:choice>
+   </xsd:group>
+
+   <xsd:complexType name="plainValueType" mixed="true">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A simple value, used in collections and to specify a type for parameters.
+
+           e.g.
+           <parameter><value class="com.acme.MyClass">xxx</value></parameter>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:attribute name="class" type="classNameType" use="optional"/>
+      <xsd:attribute name="replace" type="xsd:boolean" use="optional"/>
+      <xsd:attribute name="trim" type="xsd:boolean" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="valueType" mixed="true">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A value that can take other values, i.e. properties and parameters.
+
+           e.g.
+           <parameter><value class="com.acme.MyClass">xxx</value></parameter>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:complexContent>
+         <xsd:extension base="plainValueType">
+            <xsd:sequence>
+               <xsd:choice minOccurs="0">
+                  <xsd:group ref="valueGroup"/>
+               </xsd:choice>
+            </xsd:sequence>
+         </xsd:extension>
+      </xsd:complexContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="classLoaderValueType" mixed="true">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A value that represents a classloader.
+
+           e.g.
+           <classloader><inject bean="SomeClassLoader"/></parameter>
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:choice>
+         <xsd:element name="bean" type="beanType"/>
+         <xsd:element name="inject" type="dependencyType"/>
+         <xsd:element name="null">
+            <xsd:complexType/>
+         </xsd:element>
+         <xsd:any namespace="##other" processContents="strict">
+            <xsd:annotation>
+               <xsd:documentation>An extension value</xsd:documentation>
+            </xsd:annotation>
+         </xsd:any>
+      </xsd:choice>
+   </xsd:complexType>
+
+   <xsd:complexType name="annotatedValueType" mixed="true">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A value that can take annotations.
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:complexContent>
+         <xsd:extension base="valueType">
+            <xsd:sequence>
+               <xsd:element name="annotation" type="annotationType" minOccurs="0" maxOccurs="unbounded"/>
+            </xsd:sequence>
+         </xsd:extension>
+      </xsd:complexContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="namedValueType" mixed="true">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A value that has a name, currently only a property.
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:complexContent>
+         <xsd:extension base="annotatedValueType">
+            <xsd:attribute name="name" type="xsd:string" use="required"/>
+         </xsd:extension>
+      </xsd:complexContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="baseCollectionType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            A collection defines a java.util.Collection object.
+            It has two class definitions:
+            class: The implementation class of the collection
+            elementClass: The default implementation class of the elements
+            The default "class" is a java.util.ArrayList unless the point of injection
+            defines a concrete type, e.g. in the signature of the setter
+
+            example:
+            <property name="whatever" class="java.util.ArrayList" elementClass="java.net.URL">
+               <value>http://localhost</value> <!-- Creates a URL -->
+               <value class="java.lang.String">http://localhost</value> <!-- Creates a String -->
+            </property>
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:choice minOccurs="0" maxOccurs="unbounded">
+         <xsd:group ref="valueGroup"/>
+      </xsd:choice>
+      <xsd:attribute name="class" type="classNameType" use="optional"/>
+      <xsd:attribute name="elementClass" type="classNameType" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="collectionType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A collection, see baseCollectionType
+           the default collection is a java.util.ArrayList
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:complexContent>
+         <xsd:extension base="baseCollectionType"/>
+      </xsd:complexContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="listType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A list, see baseCollectionType
+           the default list is a java.util.ArrayList
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:complexContent>
+         <xsd:extension base="baseCollectionType"/>
+      </xsd:complexContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="setType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A set, see baseCollectionType
+           the default set is a java.util.HashSet
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:complexContent>
+         <xsd:extension base="baseCollectionType"/>
+      </xsd:complexContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="arrayType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           An array, see baseCollectionType
+           the default array is a java.lang.Object[]
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:complexContent>
+         <xsd:extension base="baseCollectionType"/>
+      </xsd:complexContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="mapType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            A map defines a java.util.Map object.
+            It has three class definitions:
+            class: The implementation class of the class
+            keyClass: The default implementation class of the keys
+            valueClass: The default implementation class of the values
+            The default "class" is a java.util.HashMap unless the point of injection
+            defines a concrete type, e.g. in the signature of the setter
+
+            e.g.:
+            <property name="whatever" class="java.util.HashMap" keyClass="java.lang.String" valueClas="java.net.URL">
+               <!-- map.put(new String("default"), new URL("http://localhost"));
+               <entry><key>default</key><value>http://localhost</value>
+               <!-- map.put(new String("default"), new String("http://localhost"));
+               <entry><key>default</key><value class="java.lang.String">http://localhost</value>
+            </property>
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+         <xsd:element name="entry" type="entryType" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="class" type="classNameType" use="optional"/>
+      <xsd:attribute name="keyClass" type="classNameType" use="optional"/>
+      <xsd:attribute name="valueClass" type="classNameType" use="optional"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="entryType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            An entry in map. These are made of key/value pairs
+
+            e.g.:
+            <entry><key>default</key><value>http://localhost</value>
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+         <xsd:element name="key" type="valueType" minOccurs="0"/>
+         <xsd:element name="value" type="valueType" minOccurs="0"/>
+      </xsd:sequence>
+   </xsd:complexType>
+
+   <xsd:complexType name="dependsType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            The depends element is used to define that one bean depends upon
+            another for the create/start/stop/destroy lifecycle
+
+            e.g.:
+            <bean name="IGoFirst" .../>
+            <bean name="IGoSecond" ...>
+               <depends>IGoFirst</depends>
+            </bean>
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleContent>
+         <xsd:extension base="xsd:string"/>
+      </xsd:simpleContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="demandType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            The demand is used to specify a dependency on a supply
+            and when the demand should be supplied
+
+            e.g.:
+            ISupply must be installed before IDemand is constructed
+
+            <bean name="IDemand">
+               <demand state="Instantiated">theSupply</demand>
+            </bean>
+            <bean name="ISupply" ...>
+               <supply>theSupply</supply>
+            </bean>
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleContent>
+         <xsd:extension base="xsd:string">
+            <xsd:attribute name="state" type="controllerStateType" use="optional"/>
+            <xsd:attribute name="transformer" type="xsd:token" use="optional"/>
+         </xsd:extension>
+      </xsd:simpleContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="supplyType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            The supply is used to specify that the bean supplies a demanded dependency
+
+            e.g.:
+            <bean name="IDemand" ...>
+               <demand>theSupply</demand>
+            </bean>
+            <bean name="ISupply" ...>
+               <supply>theSupply</supply>
+            </bean>
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleContent>
+         <xsd:extension base="xsd:string">
+            <xsd:attribute name="class" type="classNameType" use="optional"/>
+         </xsd:extension>
+      </xsd:simpleContent>
+   </xsd:complexType>
+
+   <xsd:simpleType name="controllerStateType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            The controller state is used to say when dependencies must be satisfied.
+            Valid values include:
+            Described
+            Instantiated
+            Configured
+            Create
+            Start
+            Installed
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:restriction base="xsd:string">
+         <xsd:whiteSpace value="collapse"/>
+      </xsd:restriction>
+   </xsd:simpleType>
+
+   <xsd:simpleType name="controllerModeType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            The controller mode, used to control how automatic the bean progresses
+            through the controller lifecyle (the states).
+            Valid values include:
+            Automatic (default) - the controller takes the bean to "Installed"
+            Manual - the user must tell the controller the required state
+            On Demand - the controller takes the bean to "Installed" when another bean depends on it
+            Disabled - the controller or user cannot change the state
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:restriction base="xsd:string">
+         <xsd:whiteSpace value="collapse"/>
+      </xsd:restriction>
+   </xsd:simpleType>
+
+   <xsd:simpleType name="accessModeType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            Access type, valid values include:
+            property (default)
+            field
+            public_member
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:restriction base="xsd:string">
+         <xsd:whiteSpace value="collapse"/>
+      </xsd:restriction>
+   </xsd:simpleType>
+
+   <xsd:simpleType name="autowireTypeType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            You can set the type of lookup requirement - class type (ByClass) or property name (ByName)
+            Valid values include:
+            None
+            ByClass (default)
+            ByName
+            Constructor
+            Auto
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:restriction base="xsd:string">
+         <xsd:whiteSpace value="collapse"/>
+      </xsd:restriction>
+   </xsd:simpleType>
+
+   <xsd:simpleType name="searchTypeType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            You can set the search lookup by type:
+            Valid values include:
+             DEFAULT,
+             LOCAL,
+             TOP,
+             PARENT_ONLY,
+             PARENT,
+             DEPTH,
+             LEAVES,
+             WIDTH,
+             CHILD_ONLY_DEPTH,
+             CHILD_ONLY_LEAVES,
+             CHILD_ONLY_WIDTH
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:restriction base="xsd:string">
+         <xsd:whiteSpace value="collapse"/>
+      </xsd:restriction>
+   </xsd:simpleType>
+
+   <xsd:simpleType name="optionType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            You can set the type of lookup option - Strict or Callback
+            Valid values include:
+            Strict (default)
+            Callback
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:restriction base="xsd:string">
+         <xsd:whiteSpace value="collapse"/>
+      </xsd:restriction>
+   </xsd:simpleType>
+
+   <xsd:simpleType name="contextType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            You can set the type of context property lookup
+            Valid values include:
+            name
+            metadata
+            scope
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:restriction base="xsd:string">
+         <xsd:whiteSpace value="collapse"/>
+      </xsd:restriction>
+   </xsd:simpleType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexRedefineFromJar.xml b/xml/tests/testData/xml/ComplexRedefineFromJar.xml
new file mode 100644
index 0000000..75ab2f6
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefineFromJar.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<graph edgedefault="directed">
+</graph>
+</graphml>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexRedefineSchemas/graphml-structure.xsd b/xml/tests/testData/xml/ComplexRedefineSchemas/graphml-structure.xsd
new file mode 100644
index 0000000..ca614d6
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefineSchemas/graphml-structure.xsd
@@ -0,0 +1,1114 @@
+<?xml version="1.0"?>
+
+<xs:schema   
+             targetNamespace="http://graphml.graphdrawing.org/xmlns"
+
+             xmlns="http://graphml.graphdrawing.org/xmlns"
+             xmlns:g="http://graphml.graphdrawing.org/xmlns"
+             xmlns:xs="http://www.w3.org/2001/XMLSchema"
+             xmlns:xlink="http://www.w3.org/1999/xlink" 
+
+             elementFormDefault="qualified"
+             attributeFormDefault="unqualified"
+>
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+     The schema corresponding to this document defines the structural
+     layer of the Graph Markup Language (GraphML).
+     Although a DTD is provided, this schema is, together with its extensions
+     http://graphml.graphdrawing.org/xmlns/1.0/graphml-attributes.xsd
+     and
+     http://graphml.graphdrawing.org/xmlns/1.0/graphml-parseinfo.xsd,
+     the only normative reference.
+    </xs:documentation>
+  </xs:annotation>
+
+<xs:import namespace="http://www.w3.org/1999/xlink" 
+           schemaLocation="http://graphml.graphdrawing.org/xmlns/1.0/xlink.xsd">
+  <xs:annotation>
+    <xs:documentation 
+        source="???"
+        xml:lang="en">
+       Get access to the xlink attribute groups for the attributes
+       xlink:href and xlink:type of locator.type.
+    </xs:documentation>
+  </xs:annotation>
+</xs:import>
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      The attribute groups &lt;element_name>.extra.attrib may be used
+      for adding user defined attributes to the elements
+      &lt;element_name>.
+      The attribute group common.extra.attrib may be used for adding
+      user defined attributes to all elements.
+    </xs:documentation>
+  </xs:annotation>
+
+
+<xs:attributeGroup name="common.extra.attrib"/>
+
+
+<xs:attributeGroup name="graphml.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="data.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="key.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="default.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="graph.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="node.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="edge.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="port.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="hyperedge.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="endpoint.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+<xs:attributeGroup name="locator.extra.attrib">
+  <xs:attributeGroup ref="common.extra.attrib"/>
+</xs:attributeGroup>
+
+
+
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Complex type definitions for the GraphML structural layer elements:
+      &lt;data>, &lt;default>, &lt;key>, &lt;graphml>, &lt;graph>, 
+      &lt;node>, &lt;port>, 
+      &lt;edge>, &lt;hyperedge>, &lt;endpoint> and &lt;locator>.
+      The names of the complex types are constructed corresponding
+      to the pattern element_name.type.
+      (The only remaining GraphML structural layer element
+      &lt;desc> is of simple type xs:string.)
+    </xs:documentation>
+  </xs:annotation>
+
+
+<xs:complexType name="data-extension.type" mixed="true">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Extension mechanism for the content of &lt;data> and &lt;default>.
+      The complex type data-extension.type is empty per default.
+      Users may redefine this type in order to add content to 
+      the complex types data.type and default.type which are 
+      extensions of data-extension.type.
+    </xs:documentation>
+  </xs:annotation>
+</xs:complexType>
+
+
+<xs:complexType name="data.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Complex type for the &lt;data> element.
+      data.type is mixed, that is, &lt;data> may contain #PCDATA.
+      Content type: extension of data-extension.type which is empty
+                    per default.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:complexContent mixed="true">
+    <xs:extension base="data-extension.type">
+      <xs:attribute name="key" type="xs:NMTOKEN" use="required">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">refers to the id attribute of a &lt;key>.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name="id" type="xs:NMTOKEN" use="optional">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">identifies this &lt;data>.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:attribute>
+      <xs:attributeGroup ref="data.extra.attrib">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                 user defined extra attributes for &lt;data> elements
+          </xs:documentation>
+        </xs:annotation>
+      </xs:attributeGroup>
+    </xs:extension>
+  </xs:complexContent>
+</xs:complexType>
+
+
+<xs:complexType name="default.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Complex type for the &lt;default> element.
+      default.type is mixed, that is, data may contain #PCDATA.
+      Content type: extension of data-extension.type which is empty
+                    per default.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:complexContent mixed="true">
+    <xs:extension base="data-extension.type">
+      <xs:attributeGroup ref="default.extra.attrib">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                 user defined extra attributes for &lt;default> elements
+          </xs:documentation>
+        </xs:annotation>
+      </xs:attributeGroup>
+    </xs:extension>
+  </xs:complexContent>
+</xs:complexType>
+
+
+
+<xs:simpleType name="key.for.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the for attribute of &lt;key>.
+      key.for.type is a restriction of xs:NMTOKEN
+      Allowed values: all, graph, node, edge, hyperedge, port and endpoint.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="all"/>
+    <xs:enumeration value="graph"/>
+    <xs:enumeration value="node"/>
+    <xs:enumeration value="edge"/>
+    <xs:enumeration value="hyperedge"/>
+    <xs:enumeration value="port"/>
+    <xs:enumeration value="endpoint"/>
+  </xs:restriction>
+</xs:simpleType>
+
+
+<xs:complexType name="key.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Complex type for the &lt;key> element.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>    
+    <xs:element ref="default" minOccurs="0"/>
+  </xs:sequence>
+  <xs:attribute name="id" type="xs:NMTOKEN" use="required">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">identifies this &lt;key>.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+  <xs:attribute name="for" type="key.for.type" default="all">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                 describes the domain of definition for 
+                 the corresponding graph attribute. 
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+  <xs:attributeGroup ref="key.extra.attrib">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                  user defined extra attributes for &lt;key> elements.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attributeGroup>
+</xs:complexType>
+
+
+<xs:complexType name="graphml.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Complex type for the &lt;graphml> element.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>    
+    <xs:element ref="key" minOccurs="0" maxOccurs="unbounded"/>
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="graph"/>
+        <xs:element ref="data"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:sequence>
+  <xs:attributeGroup ref="graphml.extra.attrib">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                user defined extra attributes for &lt;graphml> elements.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attributeGroup>
+</xs:complexType>
+
+
+<xs:simpleType name="graph.edgedefault.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the edgedefault attribute of &lt;graph>.
+      graph.edgedefault.type is a restriction of xs:NMTOKEN
+      Allowed values: directed, undirected.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="directed"/>
+    <xs:enumeration value="undirected"/>
+  </xs:restriction>
+</xs:simpleType>
+
+
+<xs:complexType name="graph.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Complex type for the &lt;graph> element.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>
+    <xs:choice>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="data"/>
+          <xs:element ref="node"/>
+          <xs:element ref="edge"/>
+          <xs:element ref="hyperedge"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:element ref="locator"/>
+    </xs:choice>
+  </xs:sequence>
+  <xs:attributeGroup ref="graph.extra.attrib">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                user defined extra attributes for &lt;graph> elements.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attributeGroup>
+  <xs:attribute name="id" type="xs:NMTOKEN"  >
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                  identifies this graph .
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+  <xs:attribute name="edgedefault" 
+                type="graph.edgedefault.type" use="required">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                        describes whether edges of this graph are considered
+                        as directed or undirected per default (unless 
+                        specified by the attribute directed of &lt;edge>).
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+</xs:complexType>
+
+
+
+<xs:complexType name="node.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Complex type for the &lt;node> element.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>
+    <xs:choice>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="data"/>
+          <xs:element ref="port"/>
+        </xs:choice>
+        <xs:element ref="graph" minOccurs="0"/>
+      </xs:sequence>
+      <xs:element ref="locator"/>
+    </xs:choice>
+  </xs:sequence>
+  <xs:attributeGroup ref="node.extra.attrib">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                user defined extra attributes for &lt;node elements.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attributeGroup>
+  <xs:attribute name="id" type="xs:NMTOKEN" use="required">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                 identifies this node.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+</xs:complexType>
+
+
+
+<xs:complexType name="port.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Complex type for the &lt;port> element.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0" />
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="data" />
+      <xs:element ref="port" />
+    </xs:choice>
+  </xs:sequence>
+  <xs:attributeGroup ref="port.extra.attrib"> 
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                 user defined extra attributes for &lt;port> elements.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attributeGroup>
+  <xs:attribute name="name" type="xs:NMTOKEN" use="required">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                   identifies this port, within the node it is contained in.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+</xs:complexType>
+  
+
+
+<xs:complexType name="edge.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Complex type for the &lt;edge> element.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0"/>
+    <xs:element ref="data" minOccurs="0" maxOccurs="unbounded"/>
+    <xs:element ref="graph" minOccurs="0"/>
+  </xs:sequence>
+  <xs:attributeGroup ref="edge.extra.attrib">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                 user defined extra attributes for &lt;edge> elements.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attributeGroup>
+  <xs:attribute name="id" type="xs:NMTOKEN" >
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                identifies this edge .
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+  <xs:attribute name="directed" type="xs:boolean">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                overwrites the edgedefault attribute of &lt;graph> .
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+  <xs:attribute name="source" type="xs:NMTOKEN" use="required">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                  points to the id attribute of the source &lt;node>.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+  <xs:attribute name="target" type="xs:NMTOKEN" use="required">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                   points to the id attribute of the target &lt;node>.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+  <xs:attribute name="sourceport" type="xs:NMTOKEN">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                 points to the name attribute of the source &lt;port>.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+  <xs:attribute name="targetport" type="xs:NMTOKEN">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                    points to the name attribute of the target &lt;port>.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+</xs:complexType>
+
+
+<xs:complexType name="hyperedge.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Complex type for the &lt;hyperedge> element.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0" />
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="data" />
+      <xs:element ref="endpoint" />
+    </xs:choice>
+    <xs:element ref="graph" minOccurs="0" />
+  </xs:sequence>
+  <xs:attributeGroup ref="hyperedge.extra.attrib"> 
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+               user defined extra attributes for &lt;hyperedge> elements.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attributeGroup>
+  <xs:attribute name="id" type="xs:NMTOKEN" >
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                  identifies this &lt;hyperedge> .
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+</xs:complexType>
+  
+
+<xs:simpleType name="endpoint.type.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the type attribute of &lt;endpoint>.
+      endpoint.type.type is a restriction of xs:NMTOKEN
+      Allowed values: in, out, undir.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="in"/>
+    <xs:enumeration value="out"/>
+    <xs:enumeration value="undir"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:complexType name="endpoint.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Complex type for the &lt;endpoint> element.
+    </xs:documentation>
+  </xs:annotation>
+  <xs:sequence>
+    <xs:element ref="desc" minOccurs="0" />
+  </xs:sequence>
+  <xs:attributeGroup ref="endpoint.extra.attrib"> 
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                 user defined extra attributes for &lt;endpoint> elements.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attributeGroup>
+  <xs:attribute name="id" type="xs:NMTOKEN">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                  identifies this &lt;endpoint> .
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+  <xs:attribute name="port" type="xs:NMTOKEN" >
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                points to the name of the port, to which this endpoint is 
+                 connected .
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+  <xs:attribute name="node" type="xs:NMTOKEN" use="required">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en"> 
+            points to the id of the node, to which this endpoint is connected. 
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+  <xs:attribute name="type" type="endpoint.type.type" default="undir">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+               defines the direction on this endpoint (undirected per default).
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+</xs:complexType>
+
+
+<xs:complexType name="locator.type" final="#all">
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Complex type for the &lt;locator> element.
+      Content type: (empty)
+    </xs:documentation>
+  </xs:annotation>
+  <xs:attributeGroup ref="locator.extra.attrib">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+               user defined extra attributes for &lt;locator> elements.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attributeGroup>
+  <xs:attribute ref="xlink:href" use="required">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+                points to the resource of this locator.
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+  <!-- xs:attribute ref="xlink:type" fixed="simple"-->
+  <xs:attribute ref="xlink:type">
+        <xs:annotation>
+          <xs:documentation 
+              source="http://graphml.graphdrawing.org/"
+              xml:lang="en">
+               type of the hyperlink (fixed as simple).
+          </xs:documentation>
+        </xs:annotation>
+  </xs:attribute>
+</xs:complexType>
+
+<!--========================================================-->
+
+<xs:element name="desc" type="xs:string" block="#all">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+           Description: Provides human-readable descriptions for the GraphML
+                        element containing this &lt;desc> as its first child.
+           Occurence:   &lt;key>, &lt;graphml>, &lt;graph>, 
+                        &lt;node>, &lt;port>, &lt;edge>, &lt;hyperedge>, and
+                        &lt;endpoint>. 
+      </xs:documentation>
+    </xs:annotation>
+</xs:element>
+
+
+<xs:element name="locator" type="locator.type" block="#all">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+           Description: Graphs and nodes are declared by the elements
+                        &lt;graph> and &lt;node>, respectively. The optional
+                        &lt;locator>-child of these elements point to 
+                        their definition. (If there is no &lt;locator>-child
+                        the graphs/nodes are defined by their content).
+           Occurence:   &lt;graph>, and &lt;node>. 
+      </xs:documentation>
+    </xs:annotation>
+</xs:element>
+
+<xs:element name="data" type="data.type" block="#all">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+           Description: In GraphML there may be data-functions attached
+                        to graphs, nodes, ports, edges, hyperedges and
+                        endpoint and to the whole collection of 
+                        graphs described by the content of &lt;graphml>. 
+                        These functions are declared by &lt;key> elements
+                        (children of &lt;graphml>) and defined by &lt;data>
+                        elements.
+           Occurence: &lt;graphml>, &lt;graph>, &lt;node>, &lt;port>, 
+                      &lt;edge>, &lt;hyperedge>, and &lt;endpoint>. 
+      </xs:documentation>
+    </xs:annotation>
+
+  <xs:unique name="data_data_key_unique">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">        
+        Ensures: uniqueness of the key attributes of &lt;data> children
+                 of this &lt;data> element.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+
+<xs:element name="key" type="key.type" block="#all">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+           Description: In GraphML there may be data-functions attached
+                        to graphs, nodes, ports, edges, hyperedges and
+                        endpoint and to the whole collection of 
+                        graphs described by the content of &lt;graphml>. 
+                        These functions are declared by &lt;key> elements
+                        (children of &lt;graphml>) and defined by &lt;data>
+                        elements.
+           Occurence: &lt;graphml>. 
+      </xs:documentation>
+    </xs:annotation>
+</xs:element>
+
+<xs:element name="default" type="default.type" block="#all">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+           Description: In GraphML there may be data-functions attached
+                        to graphs, nodes, ports, edges, hyperedges and
+                        endpoint and to the whole collection of 
+                        graphs described by the content of &lt;graphml>. 
+                        These functions are declared by &lt;key> elements
+                        (children of &lt;graphml>) and defined by &lt;data>
+                        elements.
+                        The (optional) &lt;default> child of &lt;key> gives 
+                        the default value for the corresponding function. 
+           Occurence: &lt;key>. 
+      </xs:documentation>
+    </xs:annotation>
+</xs:element>
+
+<xs:element name="graphml" type="graphml.type" block="#all">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+           Description: &lt;graphml> is the root element of each GraphML 
+                      document.
+           Occurence: root. 
+      </xs:documentation>
+    </xs:annotation>
+
+  <xs:unique name="graphml_data_key_unique">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: uniqueness of the key attributes of &lt;data> children
+                 of this &lt;graphml> element.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+  <xs:key name="key_id_key"> 
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: existence and uniqueness of the id attributes of 
+                 each &lt;key> element in this document.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath=".//g:key"/>
+    <xs:field xpath="@id"/>
+  </xs:key>
+
+
+  <xs:unique name="graph_id_unique"> 
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: uniqueness of the id attributes of 
+                 each &lt;graph> element in this document.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath=".//g:graph"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:keyref name="data_key_ref" refer="key_id_key">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: for the key attribute of each &lt;data> in this document, 
+                 the existence of an id attribute of 
+                 &lt;key> which matches the value of it. 
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath=".//g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:keyref> 
+
+</xs:element>
+
+
+
+<xs:element name="graph" type="graph.type" block="#all">
+
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+          Description: Describes one graph in this document.
+          Occurence: &lt;graphml>, &lt;node>, &lt;edge>, &lt;hyperedge>.
+      </xs:documentation>
+    </xs:annotation>
+
+  <xs:unique name="graph_data_key_unique">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: uniqueness of the key attributes of &lt;data> children
+                 of this &lt;graph> element.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+  <xs:key name="node_id_key"> 
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: existence and uniqueness of the id attributes of 
+                 each &lt;node> element in this graph.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath=".//g:node"/>
+    <xs:field xpath="@id"/>
+  </xs:key>
+
+  <xs:unique name="edge_id_unique"> 
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: uniqueness of the id attributes of 
+                 each &lt;edge> element in this graph.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath=".//g:edge"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:unique name="hyperedge_id_unique"> 
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: uniqueness of the id attributes of 
+                 each &lt;hyperedge> element in this graph.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath=".//g:hyperedge"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:unique name="endpoint_id_unique"> 
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: uniqueness of the id attributes of 
+                 each &lt;endpoint> element in this graph.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath=".//g:endpoint"/>
+    <xs:field xpath="@id"/>
+  </xs:unique>
+
+  <xs:keyref name="edge_source_ref" refer="node_id_key">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: for the source attribute of each &lt;edge> in this graph, 
+                 the existence of an id attribute of 
+                 &lt;node> which matches the value of it. 
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath=".//g:edge"/>
+    <xs:field xpath="@source"/>
+  </xs:keyref> 
+
+  <xs:keyref name="edge_target_ref" refer="node_id_key">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: for the target attribute of each &lt;edge> in this graph, 
+                 the existence of an id attribute of 
+                 &lt;node> which matches the value of it. 
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath=".//g:edge"/>
+    <xs:field xpath="@target"/>
+  </xs:keyref>
+
+  <xs:keyref name="endpoint_node_ref" refer="node_id_key">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: for the node attribute of each &lt;endpoint> in this graph,
+                 the existence of an id attribute of 
+                 &lt;node> which matches the value of it. 
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath=".//g:endpoint"/>
+    <xs:field xpath="@node"/>
+  </xs:keyref>
+
+</xs:element>
+
+
+<xs:element name="node" type="node.type" block="#all">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+           Description: Describes one node in the &lt;graph>
+                        containing this &lt;node>.
+           Occurence: &lt;graph>. 
+      </xs:documentation>
+    </xs:annotation>
+
+  <xs:key name="port_name_key"> 
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: existence and uniqueness of the name attributes of 
+                 each &lt;port> element within this &lt;node>.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath=".//g:port"/>
+    <xs:field xpath="@name"/>
+  </xs:key>
+
+  <xs:unique name="node_data_key_unique">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: uniqueness of the key attributes of &lt;data> children
+                 of this &lt;node> element.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+
+<xs:element name="port" type="port.type" block="#all">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+           Description: Nodes may be structured by ports; thus edges
+                        are not only attached to a node but to a certain
+                        port in this node.
+           Occurence: &lt;node>, &lt;port>. 
+      </xs:documentation>
+    </xs:annotation>
+
+  <xs:unique name="port_data_key_unique">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: uniqueness of the key attributes of &lt;data> children
+                 of this &lt;port> element.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+
+<xs:element name="edge" type="edge.type" block="#all">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+           Description: Describes an edge in the &lt;graph> which contains this
+                        &lt;edge>.
+           Occurence: &lt;graph>. 
+      </xs:documentation>
+    </xs:annotation>
+
+  <xs:unique name="edge_data_key_unique">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: uniqueness of the key attributes of &lt;data> children
+                 of this &lt;edge> element.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+
+<xs:element name="hyperedge" type="hyperedge.type" block="#all">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+           Description: While edges describe relations between two nodes, 
+                        a hyperedge describes a relation between an arbitrary
+                        number of nodes.
+           Occurence: &lt;graph>. 
+      </xs:documentation>
+    </xs:annotation>
+
+  <xs:unique name="hyperedge_data_key_unique">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+        Ensures: uniqueness of the key attributes of &lt;data> children
+                 of this &lt;hyperedge> element.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:selector xpath="./g:data"/>
+    <xs:field xpath="@key"/>
+  </xs:unique>
+
+</xs:element>
+
+
+<xs:element name="endpoint" type="endpoint.type" block="#all">
+    <xs:annotation>
+      <xs:documentation 
+          source="http://graphml.graphdrawing.org/"
+          xml:lang="en">
+           Description: The list of &lt;endpoints> within a hyperedge
+                        points to the nodes contained in this hyperedge.
+           Occurence: &lt;hyperedge>. 
+      </xs:documentation>
+    </xs:annotation>
+</xs:element>
+
+</xs:schema>
+
+<!--======================================================-->
+<!--      end of file: graphml-structure.xsd              -->
+<!--======================================================-->
diff --git a/xml/tests/testData/xml/ComplexRedefineSchemas/graphml.xsd b/xml/tests/testData/xml/ComplexRedefineSchemas/graphml.xsd
new file mode 100644
index 0000000..00e79f4
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefineSchemas/graphml.xsd
@@ -0,0 +1,345 @@
+<?xml version="1.0"?>
+
+<xs:schema   
+             targetNamespace="http://graphml.graphdrawing.org/xmlns"
+
+             xmlns="http://graphml.graphdrawing.org/xmlns"
+             xmlns:xs="http://www.w3.org/2001/XMLSchema"
+
+             elementFormDefault="qualified"
+             attributeFormDefault="unqualified"
+>
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+     This document defines the GraphML language including GraphML attributes and GraphML parseinfo.
+    </xs:documentation>
+  </xs:annotation>
+
+
+<xs:redefine schemaLocation="http://graphml.graphdrawing.org/xmlns/1.0/graphml-structure.xsd">
+
+  <!--redefinition as in graphml-attributes.xsd -->
+
+  <xs:attributeGroup name="key.extra.attrib">
+    <xs:attributeGroup ref="key.extra.attrib"/>
+    <xs:attributeGroup ref="key.attributes.attrib"/>
+  </xs:attributeGroup>
+
+  <!--redefinition as in graphml-parseinfo.xsd -->
+
+  <xs:attributeGroup name="graph.extra.attrib">
+    <xs:attributeGroup ref="graph.extra.attrib"/>
+    <xs:attributeGroup ref="graph.parseinfo.attrib"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="node.extra.attrib">
+    <xs:attributeGroup ref="node.extra.attrib"/>
+    <xs:attributeGroup ref="node.parseinfo.attrib"/>
+  </xs:attributeGroup>
+
+</xs:redefine>
+
+
+  <!--types as in graphml-attributes.xsd -->
+
+<xs:simpleType name="key.name.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/(Dokumentation der Attributes Erweiterung; entsprechende Stelle.html)"
+        xml:lang="en">
+      Simple type for the attr.name attribute of &lt;key>.
+      key.name.type is final, that is, it may not be extended
+                          or restricted.
+      key.name.type is a restriction of xs:NMTOKEN
+      Allowed values: (no restriction)
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:NMTOKEN"/>
+
+</xs:simpleType>
+
+
+
+<xs:simpleType name="key.type.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/(Dokumentation der Attributes Erweiterung; entsprechende Stelle.html)"
+        xml:lang="en">
+      Simple type for the attr.type attribute of &lt;key>.
+      key.type.type is final, that is, it may not be extended
+                          or restricted.
+      key.type.type is a restriction of xs:NMTOKEN
+      Allowed values: boolean, int, long, float, double, string.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:NMTOKEN">  
+    <xs:enumeration value="boolean"/>
+    <xs:enumeration value="int"/>
+    <xs:enumeration value="long"/>
+    <xs:enumeration value="float"/>
+    <xs:enumeration value="double"/>
+    <xs:enumeration value="string"/>
+  </xs:restriction>
+
+</xs:simpleType>
+
+
+<xs:attributeGroup name="key.attributes.attrib">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+     Definition of the attribute group key.attributes.attrib.
+     This group consists of the two optional attributes
+         - attr.name (gives the name for the data function)
+         - attr.type ((declares the range of values for the data function)
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attribute name="attr.name" type="key.name.type" use="optional"/>
+  <xs:attribute name="attr.type" type="key.type.type" use="optional"/>
+</xs:attributeGroup>
+
+  <!--types as in graphml-parseinfo.xsd -->
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+       Simple type definitions for the new graph attributes.
+    </xs:documentation>
+  </xs:annotation>
+
+<xs:simpleType name="graph.order.type"  final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.order attribute of &lt;graph>.
+      graph.order.type is final, that is, it may not be extended
+                          or restricted.
+      graph.order.type is a restriction of xs:NMTOKEN
+      Allowed values: free, nodesfirst, adjacencylist.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="free"/>
+    <xs:enumeration value="nodesfirst"/>
+    <xs:enumeration value="adjacencylist"/>
+  </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="graph.nodes.type"  final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.nodes attribute of &lt;graph>.
+      graph.nodes.type is final, that is, it may not be extended
+                          or restricted.
+      graph.nodes.type is a restriction of xs:nonNegativeInteger
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:nonNegativeInteger"/>  
+</xs:simpleType>
+
+<xs:simpleType name="graph.edges.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.edges attribute of &lt;graph>.
+      graph.edges.type is final, that is, it may not be extended
+                          or restricted.
+      graph.edges.type is a restriction of xs:nonNegativeInteger
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:nonNegativeInteger"/>  
+</xs:simpleType>
+
+<xs:simpleType name="graph.maxindegree.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.maxindegree attribute of &lt;graph>.
+      graph.maxindegree.type is final, that is, it may not be extended
+                          or restricted.
+      graph.maxindegree.type is a restriction of xs:nonNegativeInteger
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:nonNegativeInteger"/>  
+</xs:simpleType>
+
+<xs:simpleType name="graph.maxoutdegree.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.maxoutdegree attribute of &lt;graph>.
+      graph.maxoutdegree.type is final, that is, it may not be extended
+                          or restricted.
+      graph.maxoutdegree.type is a restriction of xs:nonNegativeInteger
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:nonNegativeInteger"/>  
+</xs:simpleType>
+
+<xs:simpleType name="graph.nodeids.type"  final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.nodeids attribute of &lt;graph>.
+      graph.nodeids.type is final, that is, it may not be extended
+                          or restricted.
+      graph.nodeids.type is a restriction of xs:string
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="canonical"/>
+    <xs:enumeration value="free"/>
+  </xs:restriction>  
+</xs:simpleType>
+
+<xs:simpleType name="graph.edgeids.type"  final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.edgeids attribute of &lt;graph>.
+      graph.edgeids.type is final, that is, it may not be extended
+                          or restricted.
+      graph.edgeids.type is a restriction of xs:string
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:NMTOKEN">
+    <xs:enumeration value="canonical"/>
+    <xs:enumeration value="free"/>
+  </xs:restriction>  
+</xs:simpleType>
+
+<xs:attributeGroup name="graph.parseinfo.attrib">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+     Definition of the attribute group graph.parseinfo.attrib.
+     This group consists of the seven attributes
+     - parse.nodeids (fixed to 'canonical' meaning that the id attribute
+                      of &lt;node> follows the pattern 'n[number]),
+     - parse.edgeids (fixed to 'canonical' meaning that the id attribute
+                      of &lt;edge> follows the pattern 'e[number]),
+     - parse.order (required; one of the values 'nodesfirst', 
+                    'adjacencylist' or 'free'),
+     - parse.nodes (required; number of nodes in this graph), 
+     - parse.edges (required; number of edges in this graph), 
+     - parse.maxindegree (optional; maximal indegree of a node in this graph),
+     - parse.maxoutdegree (optional; maximal outdegree of a node in this graph)
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attribute name="parse.nodeids" type="graph.nodeids.type"/>
+  <xs:attribute name="parse.edgeids" type="graph.edgeids.type"/>
+  <xs:attribute name="parse.order" type="graph.order.type"/>
+  <xs:attribute name="parse.nodes" type="graph.nodes.type"/>
+  <xs:attribute name="parse.edges" type="graph.edges.type"/>
+  <xs:attribute name="parse.maxindegree" type="graph.maxindegree.type" use="optional"/>
+  <xs:attribute name="parse.maxoutdegree" type="graph.maxoutdegree.type" use="optional"/>
+</xs:attributeGroup>
+
+
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+       Simple type definitions for the new node attributes.
+    </xs:documentation>
+  </xs:annotation>
+
+<xs:simpleType name="node.indegree.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.indegree attribute of &lt;node>.
+      node.indegree.type is final, that is, it may not be extended
+                          or restricted.
+      node.indegree.type is a restriction of xs:nonNegativeInteger
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:nonNegativeInteger"/>  
+</xs:simpleType>
+
+<xs:simpleType name="node.outdegree.type" final="#all">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+      Simple type for the parse.outdegree attribute of &lt;node>.
+      node.outdegree.type is final, that is, it may not be extended
+                          or restricted.
+      node.outdegree.type is a restriction of xs:nonNegativeInteger
+      Allowed values: (no restriction).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:restriction base="xs:nonNegativeInteger"/>  
+</xs:simpleType>
+
+<xs:attributeGroup name="node.parseinfo.attrib">
+
+  <xs:annotation>
+    <xs:documentation 
+        source="http://graphml.graphdrawing.org/"
+        xml:lang="en">
+     Definition of the attribute group node.parseinfo.attrib.
+     This group consists of two attributes
+     - parse.indegree (optional; indegree of this node),
+     - parse.outdegree (optional; outdegree of this node).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attribute name="parse.indegree" type="node.indegree.type" use="optional"/>
+  <xs:attribute name="parse.outdegree" type="node.outdegree.type" use="optional"/>
+</xs:attributeGroup>
+
+</xs:schema>
+
+<!--======================================================-->
+<!--      end of file: graphml-parseinfo.xsd             -->
+<!--======================================================-->
diff --git a/xml/tests/testData/xml/ComplexRedefineSchemas/xlink.xsd b/xml/tests/testData/xml/ComplexRedefineSchemas/xlink.xsd
new file mode 100644
index 0000000..0fa621b
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexRedefineSchemas/xlink.xsd
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+
+<xs:schema 
+        targetNamespace="http://www.w3.org/1999/xlink" 
+
+        xmlns:xlink="http://www.w3.org/1999/xlink" 
+        xmlns:xs="http://www.w3.org/2001/XMLSchema"
+
+        elementFormDefault="qualified"
+        attributeFormDefault="unqualified"
+>
+
+<xs:attribute name="type" default="simple">
+  <xs:simpleType>
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="simple"/>
+      <xs:enumeration value="extended"/>
+      <xs:enumeration value="locator"/>
+      <xs:enumeration value="arc"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:attribute>
+
+<xs:attribute name="href" type="xs:anyURI" />
+
+<xs:attribute name="role" type="xs:string" />
+
+<xs:attribute name="arcrole" type="xs:string" />
+
+<xs:attribute name="title" type="xs:string" />
+
+<xs:attribute name="show" default="embed">
+  <xs:simpleType>
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="new"/>
+      <xs:enumeration value="replace"/>
+      <xs:enumeration value="embed"/>
+      <xs:enumeration value="other"/>
+      <xs:enumeration value="none"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:attribute>
+
+<xs:attribute name="actuate" default="onLoad">
+  <xs:simpleType>
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="onLoad"/>
+      <xs:enumeration value="onRequest"/>
+      <xs:enumeration value="other"/>
+      <xs:enumeration value="none"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:attribute>
+
+<xs:attribute name="from" type="xs:string" />
+
+<xs:attribute name="to" type="xs:string" />
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation.xml b/xml/tests/testData/xml/ComplexSchemaValidation.xml
new file mode 100644
index 0000000..8ce0027
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"
+        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd"/>
+    <xsl:template match="/page">
+    <html xmlns="http://www.w3.org/1999/xhtml">
+        <head>
+            <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/>
+            <link title="Esquema de cores padr?o" rel="stylesheet" type="text/css" href="stylesheets/css/default.css"/>
+        </head>
+        <body id="_top">
+            <script src="scripts/toolbar.js" type="text/javascript">//</script>
+            <div id="page_banner">
+                <div id="page_title">
+                    <br/>
+                </div>
+            </div>
+        </body>
+    </html>
+    </xsl:template>
+</xsl:stylesheet>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation10.xsd b/xml/tests/testData/xml/ComplexSchemaValidation10.xsd
new file mode 100644
index 0000000..17d3ff4
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation10.xsd
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://www.w3.org/2001/vxml" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <xsd:redefine schemaLocation="ComplexSchemaValidation10_2.xsd">
+    <xsd:complexType name="say-as" mixed="true">
+      <xsd:complexContent>
+	<xsd:extension base="say-as">
+          <xsd:choice minOccurs="0" maxOccurs="unbounded">
+            <xsd:element ref="value"/>
+          </xsd:choice>
+        </xsd:extension>
+      </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:group name="said">
+      <xsd:sequence>
+        <xsd:element ref="value"/>
+        <xsd:group ref="said"/>
+      </xsd:sequence>
+    </xsd:group>
+  </xsd:redefine>
+  <xsd:redefine schemaLocation="<error>vxml-synthesis-restriction.xsd</error>"/>
+  <xsd:element name="value">
+    <xsd:complexType>
+      <xsd:attribute name="expr"/>
+    </xsd:complexType>
+  </xsd:element>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation10_2.xsd b/xml/tests/testData/xml/ComplexSchemaValidation10_2.xsd
new file mode 100644
index 0000000..e10f68e
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation10_2.xsd
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://www.w3.org/2001/vxml" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <xsd:complexType name="say-as" mixed="true">
+    <xsd:el></xsd:el>
+  </xsd:complexType>
+  <xsd:group name="said">
+    <xsd:sequence/>
+  </xsd:group>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation11.xml b/xml/tests/testData/xml/ComplexSchemaValidation11.xml
new file mode 100644
index 0000000..aac4672
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation11.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
+
+  <util:properties id="myProperties" location="classpath:org/springframework/beans/factory/config/util.properties"/>
+  <util:constant id="min" static-field="java.lang.Integer.MIN_VALUE"/>
+  <util:map id="myProps">
+    <entry key="bbb" value="aaa"/>
+  </util:map>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation11.xsd b/xml/tests/testData/xml/ComplexSchemaValidation11.xsd
new file mode 100644
index 0000000..4a91079
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation11.xsd
@@ -0,0 +1,360 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns="http://www.springframework.org/schema/beans" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://www.springframework.org/schema/beans">
+  <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+  <!-- base types -->
+  <xsd:complexType name="identifiedType" abstract="true">
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+  <!-- Top-level <beans> tag -->
+  <xsd:element name="beans">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element ref="description" minOccurs="0"/>
+        <xsd:choice minOccurs="0" maxOccurs="unbounded">
+          <xsd:element ref="import"/>
+          <xsd:element ref="alias"/>
+          <xsd:element ref="bean"/>
+          <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:choice>
+      </xsd:sequence>
+      <xsd:attribute name="default-lazy-init" default="false" type="xsd:boolean"/>
+      <xsd:attribute name="default-merge" default="false" type="xsd:boolean"/>
+      <xsd:attribute name="default-dependency-check" default="none">
+        <xsd:simpleType>
+          <xsd:restriction base="xsd:NMTOKEN">
+            <xsd:enumeration value="none"/>
+            <xsd:enumeration value="all"/>
+            <xsd:enumeration value="objects"/>
+            <xsd:enumeration value="simple"/>
+          </xsd:restriction>
+        </xsd:simpleType>
+      </xsd:attribute>
+      <xsd:attribute name="default-autowire" default="no">
+        <xsd:simpleType>
+          <xsd:restriction base="xsd:NMTOKEN">
+            <xsd:enumeration value="byType"/>
+            <xsd:enumeration value="byName"/>
+            <xsd:enumeration value="no"/>
+            <xsd:enumeration value="autodetect"/>
+            <xsd:enumeration value="constructor"/>
+          </xsd:restriction>
+        </xsd:simpleType>
+      </xsd:attribute>
+      <xsd:attribute name="default-init-method" type="xsd:string"/>
+      <xsd:attribute name="default-destroy-method" type="xsd:string"/>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:element name="description">
+    <xsd:complexType mixed="true">
+      <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:element name="import">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:restriction base="xsd:anyType">
+          <xsd:attribute name="resource" type="xsd:string" use="required"/>
+        </xsd:restriction>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:element name="alias">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:restriction base="xsd:anyType">
+          <xsd:attribute name="name" type="xsd:string" use="required"/>
+          <xsd:attribute name="alias" type="xsd:string" use="required"/>
+        </xsd:restriction>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:group name="beanElements">
+    <xsd:sequence>
+      <xsd:element ref="description" minOccurs="0"/>
+      <xsd:choice minOccurs="0" maxOccurs="unbounded">
+        <xsd:element ref="meta"/>
+        <xsd:element ref="constructor-arg"/>
+        <xsd:element ref="property"/>
+        <xsd:element ref="lookup-method"/>
+        <xsd:element ref="replaced-method"/>
+        <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:choice>
+    </xsd:sequence>
+  </xsd:group>
+
+  <!-- Attibutes for the <beans> tag -->
+  <xsd:attributeGroup name="beanAttributes">
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="class" type="xsd:string"/>
+    <xsd:attribute name="parent" type="xsd:string"/>
+    <xsd:attribute name="abstract" default="false" type="xsd:boolean"/>
+    <xsd:attribute name="singleton" default="true" type="xsd:boolean"/>
+    <xsd:attribute name="lazy-init" default="default" type="defaultable-boolean"/>
+    <xsd:attribute name="autowire" default="default">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:NMTOKEN">
+          <xsd:enumeration value="byType"/>
+          <xsd:enumeration value="byName"/>
+          <xsd:enumeration value="default"/>
+          <xsd:enumeration value="no"/>
+          <xsd:enumeration value="autodetect"/>
+          <xsd:enumeration value="constructor"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="dependency-check" default="default">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:NMTOKEN">
+          <xsd:enumeration value="default"/>
+          <xsd:enumeration value="none"/>
+          <xsd:enumeration value="all"/>
+          <xsd:enumeration value="objects"/>
+          <xsd:enumeration value="simple"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="depends-on" type="xsd:string"/>
+    <xsd:attribute name="init-method" type="xsd:string"/>
+    <xsd:attribute name="destroy-method" type="xsd:string"/>
+    <xsd:attribute name="factory-method" type="xsd:string"/>
+    <xsd:attribute name="factory-bean" type="xsd:string"/>
+    <xsd:attribute name="autowire-candidate" type="xsd:boolean" default="true"/>
+    <xsd:anyAttribute namespace="##other" processContents="strict"/>
+  </xsd:attributeGroup>
+
+  <!-- the <meta> element -->
+  <xsd:element name="meta" type="metaType"/>
+
+  <xsd:complexType name="metaType">
+    <xsd:attribute name="key" type="xsd:string" use="required"/>
+    <xsd:attribute name="value" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- the <bean> element -->
+  <xsd:element name="bean">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:extension base="identifiedType">
+          <xsd:group ref="beanElements"/>
+          <xsd:attributeGroup ref="beanAttributes"/>
+        </xsd:extension>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:element name="constructor-arg">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element ref="description" minOccurs="0"/>
+        <xsd:choice minOccurs="0">
+          <xsd:element ref="bean"/>
+          <xsd:element ref="ref"/>
+          <xsd:element ref="idref"/>
+          <xsd:element ref="value"/>
+          <xsd:element ref="null"/>
+          <xsd:element ref="list"/>
+          <xsd:element ref="set"/>
+          <xsd:element ref="map"/>
+          <xsd:element ref="props"/>
+        </xsd:choice>
+      </xsd:sequence>
+      <xsd:attribute name="index" type="xsd:string"/>
+      <xsd:attribute name="type" type="xsd:string"/>
+      <xsd:attribute name="ref" type="xsd:string"/>
+      <xsd:attribute name="value" type="xsd:string"/>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:element name="property" type="propertyType"/>
+  <xsd:element name="lookup-method">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:restriction base="xsd:anyType">
+          <xsd:attribute name="name" type="xsd:string"/>
+          <xsd:attribute name="bean" type="xsd:string"/>
+        </xsd:restriction>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:element name="replaced-method">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:choice minOccurs="0" maxOccurs="unbounded">
+          <xsd:element ref="arg-type"/>
+        </xsd:choice>
+      </xsd:sequence>
+      <xsd:attribute name="name" type="xsd:string"/>
+      <xsd:attribute name="replacer" type="xsd:string"/>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:element name="arg-type">
+    <xsd:complexType mixed="true">
+      <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:attribute name="match" type="xsd:string"/>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:element name="ref">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:restriction base="xsd:anyType">
+          <xsd:attribute name="bean" type="xsd:string"/>
+          <xsd:attribute name="local" type="xsd:IDREF"/>
+          <xsd:attribute name="parent" type="xsd:string"/>
+        </xsd:restriction>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:element name="idref">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:restriction base="xsd:anyType">
+          <xsd:attribute name="bean" type="xsd:string"/>
+          <xsd:attribute name="local" type="xsd:IDREF"/>
+        </xsd:restriction>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:element name="value">
+    <xsd:complexType mixed="true">
+      <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:attribute name="type" type="xsd:string"/>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:element name="null">
+    <xsd:complexType mixed="true">
+      <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- Collection Elements -->
+  <xsd:group name="collectionElements">
+    <xsd:sequence>
+      <xsd:choice minOccurs="0" maxOccurs="unbounded">
+        <xsd:element ref="bean"/>
+        <xsd:element ref="ref"/>
+        <xsd:element ref="idref"/>
+        <xsd:element ref="value"/>
+        <xsd:element ref="null"/>
+        <xsd:element ref="list"/>
+        <xsd:element ref="set"/>
+        <xsd:element ref="map"/>
+        <xsd:element ref="props"/>
+      </xsd:choice>
+    </xsd:sequence>
+  </xsd:group>
+
+  <xsd:element name="list" type="listOrSetType"/>
+  <xsd:element name="set" type="listOrSetType"/>
+  <xsd:element name="map" type="mapType"/>
+  <xsd:element name="entry" type="entryType"/>
+  <xsd:element name="props" type="propsType"/>
+
+  <xsd:element name="key">
+    <xsd:complexType>
+      <xsd:group ref="collectionElements"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <xsd:element name="prop">
+    <xsd:complexType mixed="true">
+      <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:attribute name="key" type="xsd:string" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- Property Type -->
+  <xsd:complexType name="propertyType">
+    <xsd:sequence>
+      <xsd:element ref="description" minOccurs="0"/>
+      <xsd:choice minOccurs="0">
+        <xsd:element ref="meta"/>
+        <xsd:element ref="bean"/>
+        <xsd:element ref="ref"/>
+        <xsd:element ref="idref"/>
+        <xsd:element ref="value"/>
+        <xsd:element ref="null"/>
+        <xsd:element ref="list"/>
+        <xsd:element ref="set"/>
+        <xsd:element ref="map"/>
+        <xsd:element ref="props"/>
+        <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:choice>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="ref" type="xsd:string"/>
+    <xsd:attribute name="value" type="xsd:string"/>
+  </xsd:complexType>
+
+
+  <!-- Collection Types -->
+
+  <!-- base collection type -->
+  <xsd:complexType name="baseCollectionType">
+    <xsd:attribute name="merge" type="defaultable-boolean"/>
+  </xsd:complexType>
+
+  <!-- base type for collections that have (possibly) typed nested values -->
+  <xsd:complexType name="typedCollectionType">
+    <xsd:complexContent>
+      <xsd:extension base="baseCollectionType">
+        <xsd:attribute name="value-type" type="xsd:string"/>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+
+  <!-- 'map' element type -->
+  <xsd:complexType name="mapType">
+    <xsd:complexContent>
+      <xsd:extension base="typedCollectionType">
+        <xsd:sequence>
+          <xsd:choice minOccurs="0" maxOccurs="unbounded">
+            <xsd:element ref="entry"/>
+          </xsd:choice>
+        </xsd:sequence>
+        <xsd:attribute name="key-type" type="xsd:string"/>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+
+  <!-- 'entry' element type -->
+  <xsd:complexType name="entryType">
+    <xsd:sequence>
+      <xsd:element ref="key" minOccurs="0"/>
+      <xsd:group ref="collectionElements"/>
+    </xsd:sequence>
+    <xsd:attribute name="key" type="xsd:string"/>
+    <xsd:attribute name="key-ref" type="xsd:string"/>
+    <xsd:attribute name="value" type="xsd:string"/>
+    <xsd:attribute name="value-ref" type="xsd:string"/>
+  </xsd:complexType>
+
+  <!-- 'list' and 'set' collection type -->
+  <xsd:complexType name="listOrSetType">
+    <xsd:complexContent>
+      <xsd:extension base="typedCollectionType">
+        <xsd:group ref="collectionElements"/>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+
+  <!-- 'props' collection type -->
+  <xsd:complexType name="propsType">
+    <xsd:complexContent>
+      <xsd:extension base="baseCollectionType">
+        <xsd:sequence>
+          <xsd:choice minOccurs="0" maxOccurs="unbounded">
+            <xsd:element ref="prop"/>
+          </xsd:choice>
+        </xsd:sequence>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+
+  <!-- simple internal types -->
+  <xsd:simpleType name="defaultable-boolean">
+    <xsd:restriction base="xsd:NMTOKEN">
+      <xsd:enumeration value="default"/>
+      <xsd:enumeration value="true"/>
+      <xsd:enumeration value="false"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation11_2.xsd b/xml/tests/testData/xml/ComplexSchemaValidation11_2.xsd
new file mode 100644
index 0000000..bc0f930
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation11_2.xsd
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/util"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:beans="http://www.springframework.org/schema/beans"
+            targetNamespace="http://www.springframework.org/schema/util"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+  <xsd:import namespace="http://www.springframework.org/schema/beans"/>
+
+  <xsd:element name="properties">
+    <xsd:complexType>
+      <xsd:attribute name="id" type="xsd:string"/>
+      <xsd:attribute name="location" type="xsd:string" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <xsd:element name="constant">
+    <xsd:annotation>
+      <xsd:documentation>
+        Reference a public, static field on a type and expose its value as
+        a bean. For example &lt;util:constant static-field=&quot;java.lang.Integer.MAX_VALUE&quot;/&gt;.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexType>
+      <xsd:attribute name="id" type="xsd:string"/>
+      <xsd:attribute name="static-field" type="xsd:string" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <xsd:element name="property-path">
+    <xsd:annotation>
+      <xsd:documentation>
+        Reference a property on a bean (or as a nested value) and expose its values as
+        a bean. For example &lt;util:property-path path=&quot;order.customer.name&quot;/&gt;.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexType>
+      <xsd:attribute name="id" type="xsd:string"/>
+      <xsd:attribute name="path" type="xsd:string" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <xsd:element name="map">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:extension base="beans:mapType">
+          <xsd:attribute name="id" type="xsd:string" use="required"/>
+          <xsd:attribute name="map-class" type="xsd:string">
+            <xsd:annotation>
+              <xsd:appinfo>
+                <expected-type class="java.util.Class"/>
+                <assignable-from class="java.util.Map"/>
+              </xsd:appinfo>
+            </xsd:annotation>
+          </xsd:attribute>
+        </xsd:extension>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+
+  <xsd:element name="list">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:extension base="beans:listOrSetType">
+          <xsd:attribute name="id" type="xsd:string" use="required"/>
+          <xsd:attribute name="list-class" type="xsd:string">
+            <xsd:annotation>
+              <xsd:appinfo>
+                <expected-type class="java.util.Class"/>
+                <assignable-from class="java.util.List"/>
+              </xsd:appinfo>
+            </xsd:annotation>
+          </xsd:attribute>
+        </xsd:extension>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+
+  <xsd:element name="set">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:extension base="beans:listOrSetType">
+          <xsd:attribute name="id" type="xsd:string" use="required"/>
+          <xsd:attribute name="set-class" type="xsd:string">
+            <xsd:annotation>
+              <xsd:appinfo>
+                <expected-type class="java.util.Class"/>
+                <assignable-from class="java.util.Set"/>
+              </xsd:appinfo>
+            </xsd:annotation>
+          </xsd:attribute>
+        </xsd:extension>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation12.xsd b/xml/tests/testData/xml/ComplexSchemaValidation12.xsd
new file mode 100644
index 0000000..345e223
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation12.xsd
@@ -0,0 +1,23 @@
+<?xml version="1.0" ?>
+<!--
+Test XML-schema
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:element name="TestXSD">
+	<xs:complexType>
+	    <xs:sequence>
+                <!--Type is not allowed with ref-->
+                <xs:element ref="TestElement" <error>type="xs:string"</error>/>
+	    </xs:sequence>
+	</xs:complexType>
+    </xs:element>
+
+
+    <xs:element name="TestElement">
+	<xs:complexType>
+	    <xs:sequence>
+	    	<xs:element name="Name" type="xs:string"/>
+	    </xs:sequence>
+	</xs:complexType>
+    </xs:element>
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation13.xsd b/xml/tests/testData/xml/ComplexSchemaValidation13.xsd
new file mode 100644
index 0000000..77f0935
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation13.xsd
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="urn:test" xmlns="urn:test" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified" attributeFormDefault="unqualified">
+   <xs:complexType name="TestType1">
+        <xs:sequence>
+            <xs:element name="Test2" type="TestType2" maxOccurs="unbounded">
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="TestType2">
+    </xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation13_2.xsd b/xml/tests/testData/xml/ComplexSchemaValidation13_2.xsd
new file mode 100644
index 0000000..57f4caa6
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation13_2.xsd
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="urn:test" xmlns="urn:test" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified" attributeFormDefault="unqualified">
+     <xs:complexType name="TestType3">
+        <xs:sequence>
+            <xs:element name="Test4" type="TestType4" maxOccurs="unbounded">
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="TestType4">
+    </xs:complexType>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation14.xml b/xml/tests/testData/xml/ComplexSchemaValidation14.xml
new file mode 100644
index 0000000..29fd3cec
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation14.xml
@@ -0,0 +1,3 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<p:Parent xmlns:p="parent" p:name="aaa"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation14.xsd b/xml/tests/testData/xml/ComplexSchemaValidation14.xsd
new file mode 100644
index 0000000..13c7e37
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation14.xsd
@@ -0,0 +1,12 @@
+<xs:schema targetNamespace="parent"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:p="parent"
+    elementFormDefault="qualified">
+
+   <xs:complexType name="ParentType">
+        <xs:attribute name="name" form="qualified" use="required"/>
+    </xs:complexType>
+
+    <xs:element name="Parent" type="p:ParentType"/>
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation14_2.xsd b/xml/tests/testData/xml/ComplexSchemaValidation14_2.xsd
new file mode 100644
index 0000000..c07193a
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation14_2.xsd
@@ -0,0 +1,13 @@
+<xs:schema targetNamespace="parent"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:p="parent"
+    xmlns:p2="p:myns"
+    elementFormDefault="qualified">
+   <xs:import namespace="p:myns" schemaLocation="<error>ComplexSchemaValidation14_2_2.xsd</error>"/>
+   <xs:complexType name="ParentType">
+        <xs:attribute name="name" form="qualified" use="required"/>
+    </xs:complexType>
+
+    <xs:element name="Parent" type="p:ParentType"/>
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation15.xml b/xml/tests/testData/xml/ComplexSchemaValidation15.xml
new file mode 100644
index 0000000..e5cd340
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation15.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:lin="http://www.linkedin.com/lispring">
+  <bean id="b4.1" class="java.lang.String">
+    <lin:config>
+      <property name="p1" value="v1"/>
+    </lin:config>
+  </bean>
+  <bean id="b4.2" class="java.lang.String">
+    <lin:config class="test.spring.TestSpring$Bean4$Config2">
+      <property name="p2" value="v2"/>
+    </lin:config>
+  </bean>
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation15.xsd b/xml/tests/testData/xml/ComplexSchemaValidation15.xsd
new file mode 100644
index 0000000..71b23c6
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation15.xsd
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.linkedin.com/lispring"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:beans="http://www.springframework.org/schema/beans"
+            targetNamespace="http://www.linkedin.com/lispring"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+  <xsd:import namespace="http://www.springframework.org/schema/beans"/>
+  <!-- **************************************************************************** -->
+  <!-- * <configtag                                                             * -->
+  <!-- **************************************************************************** -->
+  <xsd:element name="config">
+    <xsd:complexType>
+      <xsd:choice minOccurs="0" maxOccurs="unbounded">
+        <xsd:element ref="beans:property"/>
+      </xsd:choice>
+      <xsd:attribute name="class" type="xsd:string"/>
+    </xsd:complexType>
+  </xsd:element>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation15_2.xsd b/xml/tests/testData/xml/ComplexSchemaValidation15_2.xsd
new file mode 100644
index 0000000..1830fb6
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation15_2.xsd
@@ -0,0 +1,1077 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/beans"
+			xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+			targetNamespace="http://www.springframework.org/schema/beans">
+
+	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Spring XML Beans Schema, version 2.0
+	Authors: Rob Harrop, Juergen Hoeller
+
+	This defines a simple and consistent way of creating a namespace
+	of JavaBeans objects, managed by a Spring BeanFactory, read by
+	XmlBeanDefinitionReader (with DefaultBeanDefinitionDocumentReader).
+
+	This document type is used by most Spring functionality, including
+	web application contexts, which are based on bean factories.
+
+	Each "bean" element in this document defines a JavaBean.
+	Typically the bean class is specified, along with JavaBean properties
+	and/or constructor arguments.
+
+	A bean instance can be a "singleton" (shared instance) or a "prototype"
+	(independent instance). Further scopes can be provided by extended
+	bean factories, for example in a web environment.
+
+	References among beans are supported, that is, setting a JavaBean property
+	or a constructor argument to refer to another bean in the same factory
+	(or an ancestor factory).
+
+	As alternative to bean references, "inner bean definitions" can be used.
+	Singleton flags of such inner bean definitions are effectively ignored:
+	inner beans are typically anonymous prototypes.
+
+	There is also support for lists, sets, maps, and java.util.Properties
+	as bean property types or constructor argument types.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<!-- base types -->
+	<xsd:complexType name="identifiedType" abstract="true">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The unique identifier for a bean. The scope of the identifier
+	is the enclosing bean factory.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:attribute name="id" type="xsd:ID">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The unique identifier for a bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Top-level <beans> tag -->
+	<xsd:element name="beans">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The top level (typically root) element. Allows the definition
+	of default values for all nested bean definitions.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="import"/>
+					<xsd:element ref="alias"/>
+					<xsd:element ref="bean"/>
+					<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="default-lazy-init" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'lazy-init' value; see the documentation for the
+	'lazy-init' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-merge" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'merge' value; see the documentation for the
+	'merge' attribute of the various collection elements.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-dependency-check" default="none">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'dependency-check' value; see the documentation for the
+	'dependency-check' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="none"/>
+						<xsd:enumeration value="all"/>
+						<xsd:enumeration value="objects"/>
+						<xsd:enumeration value="simple"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-autowire" default="no">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'autowire' value; see the documentation for the
+	'autowire' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="byType"/>
+						<xsd:enumeration value="byName"/>
+						<xsd:enumeration value="no"/>
+						<xsd:enumeration value="autodetect"/>
+						<xsd:enumeration value="constructor"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-init-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'init-method' value; see the documentation for the
+	'init-method' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-destroy-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'destroy-method' value; see the documentation for the
+	'destroy-method' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="description">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains informative text describing the purpose of the enclosing
+	element.
+	Used primarily for user documentation of XML bean definition documents.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="import">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.core.io.Resource"><![CDATA[
+	Specifies an XML bean definition resource to import.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="resource" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The relative resource location of the XML (bean definition) file to import,
+	for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml".
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="alias">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines an alias for a bean (which can reside in a different definition
+	resource).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean to define an alias for.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="alias" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The alias name to define for the bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:group name="beanElements">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="constructor-arg"/>
+				<xsd:element ref="property"/>
+				<xsd:element ref="lookup-method"/>
+				<xsd:element ref="replaced-method"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:attributeGroup name="beanAttributes">
+		<xsd:attribute name="name" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Can be used to create one or more aliases illegal in an (XML) id.
+	Multiple aliases can be separated by any number of spaces, commas,
+	or semi-colons (or indeed any mixture of the three).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="class" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The fully qualified name of the bean's class, except if it pure serves as parent for child bean definitions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="parent" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the parent bean definition.
+
+	Will use the bean class of the parent if none is specified, but can
+	also override it. In the latter case, the child bean class must be
+	compatible with the parent, i.e. accept the parent's property values
+	and constructor argument values, if any.
+
+	A child bean definition will inherit constructor argument values,
+	property values and method overrides from the parent, with the option
+	to add new values. If init method, destroy method, factory bean and/or
+	factory method are specified, they will override the corresponding
+	parent settings.
+
+	The remaining settings will always be taken from the child definition:
+	depends on, autowire mode, dependency check, scope, lazy init.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="scope" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The scope of this bean: typically "singleton" (one shared instance,
+	which will be returned by all calls to getBean() with the id),
+	or "prototype" (independent instance resulting from each call to
+	getBean(). Default is "singleton".
+
+	Singletons are most commonly used, and are ideal for multi-threaded
+	service objects. Further scopes, such as "request" or "session",
+	might be supported by extended bean factories (for example, in a
+	web environment).
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+
+	Inner bean definitions inherit the singleton status of their containing
+	bean definition, unless explicitly specified: The inner bean will be a
+	singleton if the containing bean is a singleton, and a prototype if
+	the containing bean has any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="abstract" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Is this bean "abstract", that is, not meant to be instantiated itself
+	but rather just serving as parent for concrete child bean definitions?
+	The default is "false". Specify "true" to tell the bean factory to not
+	try to instantiate that particular bean in any case.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per abstract bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="lazy-init" default="default" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean is to be lazily initialized.
+	If false, it will be instantiated on startup by bean factories
+	that perform eager initialization of singletons. The default is
+	"false".
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether bean properties are "autowired".
+	This is an automagical process in which bean references don't need
+	to be coded explicitly in the XML bean definition file, but rather the
+	Spring container works out dependencies.
+
+	There are 5 modes:
+
+	1. "no"
+	The traditional Spring default. No automagical wiring. Bean references
+	must be defined in the XML file via the <ref/> element (or "ref"
+	attribute). We recommend this in most cases as it makes documentation
+	more explicit.
+
+	2. "byName"
+	Autowiring by property name. If a bean of class Cat exposes a dog
+	property, Spring will try to set this to the value of the bean "dog"
+	in the current container. If there is no matching bean by name, nothing
+	special happens; use dependency-check="objects" to raise an error in
+	that case.
+
+	3. "byType"
+	Autowiring if there is exactly one bean of the property type in the
+	container. If there is more than one, a fatal error is raised, and
+	you cannot use byType autowiring for that bean. If there is none,
+	nothing special happens; use dependency-check="objects" to raise an
+	error in that case.
+
+	4. "constructor"
+	Analogous to "byType" for constructor arguments. If there is not exactly
+	one bean of the constructor argument type in the bean factory, a fatal
+	error is raised.
+
+	5. "autodetect"
+	Chooses "constructor" or "byType" through introspection of the bean
+	class. If a default constructor is found, "byType" gets applied.
+
+	Note that explicit dependencies, i.e. "property" and "constructor-arg"
+	elements, always override autowiring. Autowire behavior can be combined
+	with dependency checking, which will be performed after all autowiring
+	has been completed.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="byType"/>
+					<xsd:enumeration value="byName"/>
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="no"/>
+					<xsd:enumeration value="autodetect"/>
+					<xsd:enumeration value="constructor"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="dependency-check" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether or not to check whether all of this
+	beans dependencies, expressed in its properties, are satisfied.
+	The default is to perform no dependency checking.
+
+	"simple" type dependency checking includes primitives and String
+	"object" includes collaborators (other beans in the factory)
+	"all" includes both types of dependency checking
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="none"/>
+					<xsd:enumeration value="all"/>
+					<xsd:enumeration value="objects"/>
+					<xsd:enumeration value="simple"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="depends-on" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The names of the beans that this bean depends on being initialized.
+	The bean factory will guarantee that these beans get initialized
+	before this bean.
+
+	Note that dependencies are normally expressed through bean properties
+	or constructor arguments. This property should just be necessary for
+	other kinds of dependencies like statics (*ugh*) or database preparation
+	on startup.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="init-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom initialization method to invoke after setting
+	bean properties. The method must have no arguments, but may throw any
+	exception.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="destroy-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom destroy method to invoke on bean factory
+	shutdown. The method must have no arguments, but may throw any
+	exception.
+
+	Note: Only invoked on beans whose lifecycle is under the full
+	control of the factory - which is always the case for singletons,
+	but not guaranteed for any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of a factory method to use to create this object. Use
+	constructor-arg elements to specify arguments to the factory method,
+	if it takes arguments. Autowiring does not apply to factory methods.
+
+	If the "class" attribute is present, the factory method will be a static
+	method on the class specified by the "class" attribute on this bean
+	definition. Often this will be the same class as that of the constructed
+	object - for example, when the factory method is used as an alternative
+	to a constructor. However, it may be on a different class. In that case,
+	the created object will *not* be of the class specified in the "class"
+	attribute. This is analogous to FactoryBean behavior.
+
+	If the "factory-bean" attribute is present, the "class" attribute is not
+	used, and the factory method will be an instance method on the object
+	returned from a getBean call with the specified bean name. The factory
+	bean may be defined as a singleton or a prototype.
+
+	The factory method can have any number of arguments. Autowiring is not
+	supported. Use indexed constructor-arg elements in conjunction with the
+	factory-method attribute.
+
+	Setter Injection can be used in conjunction with a factory method.
+	Method Injection cannot, as the factory method returns an instance,
+	which will be used when the container creates the bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-bean" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Alternative to class attribute for factory-method usage.
+	If this is specified, no class attribute should be used.
+	This must be set to the name of a bean in the current or
+	ancestor factories that contains the relevant factory method.
+	This allows the factory itself to be configured using Dependency
+	Injection, and an instance (rather than static) method to be used.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire-candidate" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean should be considered when looking
+	for candidates to satisfy another beans autowiring requirements.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:attributeGroup>
+
+	<xsd:element name="meta" type="metaType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Arbitrary metadata attached to a bean definition.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:complexType name="metaType">
+		<xsd:attribute name="key" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The key name of the metadata parameter being defined.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The value of the metadata parameter being defined (as a simple String).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<xsd:element name="bean">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.BeanDefinition"><![CDATA[
+	Defines a single (usually named) bean.
+
+	A bean definition may contain nested tags for constructor arguments,
+	property values, lookup methods, and replaced methods. Mixing constructor
+	injection and setter injection on the same bean is explicitly supported.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="identifiedType">
+					<xsd:group ref="beanElements"/>
+					<xsd:attributeGroup ref="beanAttributes"/>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="constructor-arg">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.ConstructorArgumentValues">
+				<![CDATA[
+	Bean definitions can specify zero or more constructor arguments.
+	This is an alternative to "autowire constructor".
+	Arguments correspond to either a specific index of the constructor
+	argument list or are supposed to be matched generically by type.
+
+	Note: A single generic argument value will just be used once, rather
+	than potentially matched multiple times (as of Spring 1.1).
+
+	constructor-arg elements are also used in conjunction with the
+	factory-method element to construct beans using static or instance
+	factory methods.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="1">
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+					<xsd:any namespace="##other" processContents="strict"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="index" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact index of thr argument in the constructor argument list.
+	Only needed to avoid ambiguities, e.g. in case of 2 arguments of
+	the exact same type.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type of the constructor argument. Only needed to avoid
+	ambiguities, e.g. in case of 2 single argument constructors
+	that can both be converted from a String.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="ref" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>" element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="value" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...<value/>"
+	element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="property" type="propertyType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Bean definitions can have zero or more properties.
+	Property elements correspond to JavaBean setter methods exposed
+	by the bean classes. Spring supports primitives, references to other
+	beans in the same or related factories, lists, maps and properties.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="lookup-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A lookup method causes the IoC container to override the given method
+	and return the bean with the name given in the bean attribute. This is
+	a form of Method Injection. It is particularly useful as an alternative
+	to implementing the BeanFactoryAware interface, in order to be able to
+	make getBean() calls for non-singleton instances at runtime. In this
+	case, Method Injection is a less invasive alternative.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the lookup method. This method must take no arguments.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean in the current or ancestor factories that
+	the lookup method should resolve to. Often this bean will be a
+	prototype, in which case the lookup method will return a distinct
+	instance on every invocation. This is useful for single-threaded objects.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="replaced-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Similar to the lookup method mechanism, the replaced-method element
+	is used to control IoC container method overriding: Method Injection.
+	This mechanism allows the overriding of a method with arbitrary code.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="arg-type"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="name" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The name of the method whose implementation must be replaced by the
+	IoC container. If this method is not overloaded, there is no need
+	to use arg-type subelements. If this method is overloaded, arg-type
+	subelements must be used for all override definitions for the method.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="replacer" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation source="java:org.springframework.beans.factory.support.MethodReplacer"><![CDATA[
+	Bean name of an implementation of the MethodReplacer interface in the
+	current or ancestor factories. This may be a singleton or prototype
+	bean. If it is a prototype, a new instance will be used for each
+	method replacement. Singleton usage is the norm.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="arg-type">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Identifies an argument for a replaced method in the event of
+	method overloading.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="match" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Specification of the type of an overloaded method argument as a String.
+	For convenience, this may be a substring of the FQN. E.g. all the
+	following would match "java.lang.String":
+	- java.lang.String
+	- String
+	- Str
+
+	As the number of arguments will be checked also, this convenience
+	can often be used to save typing.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="ref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines a reference to another bean in this factory or an external
+	factory (parent or included factory).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID,
+	and thus can be checked by the XML parser, thus should be preferred
+	for references within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="parent" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean *in a parent factory*.
+						]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="idref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The id of another bean in this factory or an external factory
+	(parent or included factory).
+	While a regular 'value' element could instead be used for the
+	same effect, using idref in this case allows validation of local
+	bean ids by the XML parser, and name completion by supporting tools.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID,
+	and thus can be checked by the XML parser, thus should be preferred
+	for references within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="value">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains a string representation of a property value.
+	The property may be a string, or may be converted to the required
+	type using the JavaBeans PropertyEditor machinery. This makes it
+	possible for application developers to write custom PropertyEditor
+	implementations that can convert strings to arbitrary target objects.
+
+	Note that this is recommended for simple objects only. Configure
+	more complex objects by populating JavaBean properties with
+	references to other beans.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type that the value should be converted to. Only needed
+	if the type of the target property or constructor argument is
+	too generic: for example, in case of a collection element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="null">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Denotes a Java null value. Necessary because an empty "value" tag
+	will resolve to an empty String, which will not be resolved to a
+	null value unless a special PropertyEditor does so.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<!-- Collection Elements -->
+	<xsd:group name="collectionElements">
+		<xsd:sequence>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:element name="list" type="listOrSetType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A list can contain multiple inner bean, ref, collection, or value
+	elements. Java lists are untyped, pending generics support in Java5,
+	although references will be strongly typed. A list can also map to
+	an array type. The necessary conversion is automatically performed
+	by the BeanFactory.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="set" type="listOrSetType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A set can contain multiple inner bean, ref, collection, or value
+	elements. Java sets are untyped, pending generics support in Java5,
+	although references will be strongly typed.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="map" type="mapType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A mapping from a key to an object. Maps may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="entry" type="entryType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A map entry can be an inner bean, ref, value, or collection.
+	The key of the entry is given by the "key" attribute or child element.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="props" type="propsType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Props elements differ from map elements in that values must be strings.
+	Props may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="key">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A key element can contain an inner bean, ref, value, or collection.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:group ref="collectionElements"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="prop">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The string value of the property. Note that whitespace is trimmed
+	off to avoid unwanted whitespace caused by typical XML formatting.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="key" type="xsd:string" use="required">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The key of the property entry.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="propertyType">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="1">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict"/>
+			</xsd:choice>
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the property, following JavaBean naming conventions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>"
+	element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Collection Types -->
+
+	<!-- base collection type -->
+	<xsd:complexType name="baseCollectionType">
+		<xsd:attribute name="merge" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- base type for collections that have (possibly) typed nested values -->
+	<xsd:complexType name="typedCollectionType">
+		<xsd:complexContent>
+			<xsd:extension base="baseCollectionType">
+				<xsd:attribute name="value-type" type="xsd:string">
+					<xsd:annotation>
+						<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested values. Must be a fully qualified
+	class name.
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:attribute>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'map' element type -->
+	<xsd:complexType name="mapType">
+		<xsd:complexContent>
+			<xsd:extension base="typedCollectionType">
+				<xsd:sequence>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="entry"/>
+					</xsd:choice>
+				</xsd:sequence>
+				<xsd:attribute name="key-type" type="xsd:string">
+					<xsd:annotation>
+						<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested entry keys. Must be a fully qualified
+	class name.
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:attribute>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'entry' element type -->
+	<xsd:complexType name="entryType">
+		<xsd:sequence>
+			<xsd:element ref="key" minOccurs="0"/>
+			<xsd:group ref="collectionElements"/>
+		</xsd:sequence>
+		<xsd:attribute name="key" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Each map element must specify its key as attribute or as child element.
+	A key attribute is always a String value.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="key-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a to a "key" element with a nested
+	"<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>"
+	element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- 'list' and 'set' collection type -->
+	<xsd:complexType name="listOrSetType">
+		<xsd:complexContent>
+			<xsd:extension base="typedCollectionType">
+				<xsd:group ref="collectionElements"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'props' collection type -->
+	<xsd:complexType name="propsType">
+		<xsd:complexContent>
+			<xsd:extension base="baseCollectionType">
+				<xsd:sequence>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="prop"/>
+					</xsd:choice>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- simple internal types -->
+	<xsd:simpleType name="defaultable-boolean">
+		<xsd:restriction base="xsd:NMTOKEN">
+			<xsd:enumeration value="default"/>
+			<xsd:enumeration value="true"/>
+			<xsd:enumeration value="false"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation16.xml b/xml/tests/testData/xml/ComplexSchemaValidation16.xml
new file mode 100644
index 0000000..403f720
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation16.xml
@@ -0,0 +1,53 @@
+<project xmlns="http://www.inversoft.com/schemas/savant-2.0/project"
+    name="slingshot"
+    group="texturemedia"
+    version="8.0-RC3">
+
+
+  <!-- import property file properties -->
+  <properties file="${user.home}/build.properties"/>
+
+  <!-- Compile properties -->
+  <property name="dir.src" value="src"/>
+  <property name="dir.src.java.main" value="${dir.src}/java/main"/>
+  <property name="dir.src.java.test" value="${dir.src}/java/test"/>
+  <property name="dir.target" value="target"/>
+  <property name="dir.target.jars" value="${dir.target}/jars"/>
+  <property name="dir.target.classes.main" value="${dir.target}/classes/main"/>
+  <property name="dir.target.classes.test" value="${dir.target}/classes/test"/>
+  <property name="compile.javac" value="${jdk1.6}/bin/javac"/>
+  <property name="run.java" value="${jdk1.6}/bin/java"/>
+  <property name="svn.host" value="http://192.168.1.212/svn/internal"/>
+  <property name="repos.url" value="${svn.host}/${project.name}"/>
+
+  <dependencies id="project.dependencies">
+    <artifactGroup type="run"/>
+    <artifactGroup type="compile">
+      <artifact group="apache" project="lucene" name="lucene" version="1.4.1" type="jar"/>
+      <artifact group="apache" project="poi" name="poi" version="2.5.1" type="jar"/>
+      <artifact group="jdom" project="jdom" name="jdom" version="1.0" type="jar"/>
+      <artifact group="oreilly" project="cos" name="cos" version="1.0" type="jar"/>
+      <artifact group="paypal" project="Verisign" name="Verisign" version="1.0" type="jar"/>
+      <artifact group="sun" project="servletapi" name="servletapi" version="2.4" type="jar"/>
+      <artifact group="sun" project="jspapi" name="jsp-api" version="2.0" type="jar"/>
+      <artifact group="sun" project="jaf" name="activation" version="1.1" type="jar"/>
+      <artifact group="sun" project="javamail" name="javamail" version="1.3.2" type="jar"/>
+    </artifactGroup>
+    <artifactGroup type="test-run"/>
+    <artifactGroup type="test-compile">
+      <artifact group="junit" project="junit" name="junit" version="3.8.1" type="jar"/>
+    </artifactGroup>
+  </dependencies>
+  <workflow id="workflow.texturemedia">
+    <fetchWorkflow>
+      <process type="localCacheFetchProcess"/>
+      <process type="mavenInternetFetchProcess" url="http://192.168.1.21/maven/"/>
+      <process type="savantInternetFetchProcess" url="http://192.168.1.212/savant/"/>
+      <process type="mavenInternetFetchProcess" url="http://www.apextechnology.com/maven/"/>
+      <process type="mavenInternetFetchProcess" url="http://mirrors.ibiblio.org/pub/mirrors/maven/"/>
+    </fetchWorkflow>
+    <publishWorkflow>
+      <process type="localCachePublishProcess"/>
+    </publishWorkflow>
+  </workflow>
+</project>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation16.xsd b/xml/tests/testData/xml/ComplexSchemaValidation16.xsd
new file mode 100644
index 0000000..d68ad9e
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation16.xsd
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.inversoft.com/schemas/savant-2.0/project"
+    xmlns:project="http://www.inversoft.com/schemas/savant-2.0/project"
+    xmlns:base="http://www.inversoft.com/schemas/savant-2.0/base">
+
+  <xsd:import namespace="http://www.inversoft.com/schemas/savant-2.0/base"/>
+
+  <xsd:complexType name="dialect">
+    <xsd:annotation>
+      <xsd:documentation>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="namespace" type="xsd:string" use="required"/>
+    <xsd:attribute name="version" type="xsd:string" use="required"/>
+    <xsd:attribute name="config" use="optional">
+      <xsd:simpleType>
+        <xsd:list itemType="xsd:string"/>
+      </xsd:simpleType>
+    </xsd:attribute>
+  </xsd:complexType>
+
+  <xsd:element name="project">
+    <xsd:annotation>
+      <xsd:documentation>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element name="properties" type="base:properties" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="property" type="base:property" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="dialect" type="project:dialect" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="dependencies" type="base:dependencies" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="workflow" type="base:workflow" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="publishWorkflow" type="base:publishWorkflow" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="name" type="xsd:string" use="required"/>
+      <xsd:attribute name="version" type="xsd:string" use="required"/>
+      <xsd:attribute name="group" type="xsd:string" use="required"/>
+      <xsd:attribute name="savantConfigVersion" type="xsd:string" use="optional"/>
+    </xsd:complexType>
+  </xsd:element>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation16_2.xsd b/xml/tests/testData/xml/ComplexSchemaValidation16_2.xsd
new file mode 100644
index 0000000..26e2f38
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation16_2.xsd
@@ -0,0 +1,115 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.inversoft.com/schemas/savant-2.0/base"
+    xmlns:base="http://www.inversoft.com/schemas/savant-2.0/base">
+
+  <xsd:complexType name="property">
+    <xsd:annotation>
+      <xsd:documentation>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="value" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <xsd:complexType name="properties">
+    <xsd:annotation>
+      <xsd:documentation>
+        Used to specify a properties file to load into the Savant runtime.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="file" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <xsd:complexType name="publishWorkflow">
+    <xsd:annotation>
+      <xsd:documentation>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="process" type="process" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+
+  <xsd:complexType name="process">
+    <xsd:annotation>
+      <xsd:documentation>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="type" type="xsd:string" use="required"/>
+    <xsd:anyAttribute processContents="skip"/>
+  </xsd:complexType>
+
+  <xsd:complexType name="fetchWorkflow">
+    <xsd:annotation>
+      <xsd:documentation>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="process" type="process" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <xsd:complexType name="workflow">
+    <xsd:annotation>
+      <xsd:documentation>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="fetchWorkflow" type="fetchWorkflow" minOccurs="1" maxOccurs="1"/>
+      <xsd:element name="publishWorkflow" type="publishWorkflow" minOccurs="1" maxOccurs="1"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+
+
+  <xsd:complexType name="artifact">
+    <xsd:annotation>
+      <xsd:documentation>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="project" type="xsd:string" use="required"/>
+    <xsd:attribute name="group" type="xsd:string" use="required"/>
+    <xsd:attribute name="type" type="xsd:string" use="required"/>
+    <xsd:attribute name="version" type="xsd:string" use="required"/>
+    <xsd:attribute name="compatType" type="xsd:string" use="optional"/>
+    <xsd:attribute name="expireMinutes" type="xsd:integer" use="optional"/>
+  </xsd:complexType>
+
+  <xsd:complexType name="artifactGroup">
+    <xsd:annotation>
+      <xsd:documentation>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="artifact" type="artifact" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="type" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <xsd:complexType name="localProject">
+    <xsd:annotation>
+      <xsd:documentation>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="group" type="xsd:string" use="required"/>
+    <xsd:attribute name="projectFile" type="xsd:string" use="optional"/>
+    <xsd:attribute name="target" type="xsd:string" use="optional"/>
+    <xsd:attribute name="type" type="xsd:string" use="required"/>
+    <xsd:attribute name="dir" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+
+  <xsd:complexType name="dependencies">
+    <xsd:annotation>
+      <xsd:documentation>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="localProject" type="localProject" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="artifactGroup" type="artifactGroup" minOccurs="1" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation17.xml b/xml/tests/testData/xml/ComplexSchemaValidation17.xml
new file mode 100644
index 0000000..6a971fd
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation17.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<utest:type1 xmlns:utest="urn:test"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:type="utest:TestType2"
+       >
+
+	<utest:int1>3</utest:int1>
+    <utest:int2>3</utest:int2>
+    <utest:int3>5</utest:int3>
+</utest:type1>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation17.xsd b/xml/tests/testData/xml/ComplexSchemaValidation17.xsd
new file mode 100644
index 0000000..c2c2fac
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation17.xsd
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="urn:test" xmlns:utest="urn:test" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified" attributeFormDefault="unqualified">
+    <xs:element name="type1" type="utest:TestType1"/>
+
+    <xs:complexType name="TestType1">
+        <xs:sequence>
+            <xs:element name="int1" type="xs:int"></xs:element>
+            <xs:element name="int2" type="xs:int"></xs:element>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="TestType2">
+        <xs:complexContent>
+            <xs:extension base="utest:TestType1">
+                <xs:sequence>
+                    <xs:element name="int3" type="xs:int" >
+                    </xs:element>
+                </xs:sequence>
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation18.xml b/xml/tests/testData/xml/ComplexSchemaValidation18.xml
new file mode 100644
index 0000000..6d5a899
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation18.xml
@@ -0,0 +1,16 @@
+<Application
+  xmlns="http://www.bindows.net/IVBindowsSchema"
+  xmlns:iv="http://www.infiview.net/infiview"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation=
+    "http://www.bindows.net/IVBindowsSchema ComplexSchemaValidation18.xsd
+     http://www.infiview.net/infiview ComplexSchemaValidation18_2.xsd"
+  autoNameMapping="true"
+  >
+
+  <Window caption="Network Topology Test" width="1024" height="728" >
+    <InfiView currentState="">
+      <iv:AbstractViewport/>
+    </InfiView>
+  </Window>
+</Application>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation18.xsd b/xml/tests/testData/xml/ComplexSchemaValidation18.xsd
new file mode 100644
index 0000000..dd5f97e
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation18.xsd
@@ -0,0 +1,14419 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns="http://www.bindows.net/IVBindowsSchema"
+           targetNamespace="http://www.bindows.net/IVBindowsSchema"
+           elementFormDefault="qualified"
+           xmlns:iv="http://www.infiview.net/infiview"
+  >
+
+  <xs:import namespace="http://www.infiview.net/infiview"
+             schemaLocation="ComplexSchemaValidation18_2.xsd"/>
+
+  <xs:element name="Application">
+    <xs:complexType>
+      <xs:choice minOccurs="1" maxOccurs="unbounded">
+        <xs:element name="SplashScreen" minOccurs="0" maxOccurs="1"/>
+        <xs:element ref="Theme" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element name="Window" minOccurs="1" maxOccurs="1">
+          <!--<xs:complexType>-->
+          <!--<xs:choice minOccurs="0" maxOccurs="unbounded">-->
+          <!--<xs:element ref="iv:InfiView" minOccurs="0" maxOccurs="unbounded"/>-->
+          <!--<xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>-->
+          <!--</xs:choice>-->
+          <!--<xs:attributeGroup ref="ApplicationWindowAttributes"/>-->
+          <!--</xs:complexType>-->
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+              <xs:element name="InfiView">
+                <xs:complexType>
+                  <xs:choice minOccurs="0" maxOccurs="unbounded">
+                    <xs:group ref="iv:InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+                    <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+                  </xs:choice>
+                  <xs:attributeGroup ref="ComponentAttributes"/>
+                  <xs:attributeGroup ref="iv:InfiViewAttributes"/>
+                </xs:complexType>
+              </xs:element>
+            </xs:choice>
+            <xs:attributeGroup ref="ApplicationWindowAttributes"/>
+          </xs:complexType>
+
+        </xs:element>
+
+        <xs:element name="Resources" minOccurs="0" maxOccurs="1">
+          <xs:complexType>
+            <xs:choice maxOccurs="unbounded" minOccurs="0">
+              <xs:element name="Script">
+                <xs:complexType mixed="true">
+                  <xs:attributeGroup ref="ScriptAttributes"/>
+                </xs:complexType>
+              </xs:element>
+
+              <xs:element name="Package">
+                <xs:complexType>
+                  <xs:annotation>
+                    <xs:documentation>A package which will be loaded before the rest of the ADF is parsed.</xs:documentation>
+                  </xs:annotation>
+                  <xs:attributeGroup ref="PackageAttributes"/>
+                </xs:complexType>
+              </xs:element>
+
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+      <xs:attributeGroup ref="ApplicationAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+
+  <xs:attributeGroup name="PackageAttributes">
+    <xs:annotation>
+      <xs:documentation>Loads a Bindows package or script before parsing the rest of the ADF (including &lt;Script&gt; tags).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>The location of the package script file (relative to Bindows)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="name" type="PackageTypes">
+      <xs:annotation>
+        <xs:documentation>The name of the package</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:simpleType name="PackageTypes">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="Loaders"/>
+      <xs:enumeration value="OlapGrid"/>
+      <xs:enumeration value="Charting"/>
+      <xs:enumeration value="WebService2"/>
+      <xs:enumeration value="Accessibility"/>
+      <xs:enumeration value="Animation"/>
+      <xs:enumeration value="Gauge2"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+
+  <xs:element name="AbstractChart">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for charts that are to be used with
+        BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractChart" substitutionGroup="AbstractChart"/>
+
+  <xs:attributeGroup name="AbstractChartAttributes">
+
+    <xs:attributeGroup ref="AbstractChartBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for charts that are to be used with
+        BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractChart2" substitutionGroup="AbstractChart2"/>
+
+  <xs:attributeGroup name="AbstractChart2Attributes">
+
+    <xs:attributeGroup ref="AbstractChartBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractChartBase">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for BiAbstractChart
+        and BiAbstractChart2. All the charts
+        in BiGraph and BiGraph2
+        extend either BiAbstractChart or
+        BiAbstractChart2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractChartBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractChartBase" substitutionGroup="AbstractChartBase"/>
+
+  <xs:attributeGroup name="AbstractChartBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractChartSection">
+    <xs:annotation>
+      <xs:documentation>
+        Used as base class for marker, column rect and pie chart section. These
+        are used to create the visual presentation for the data points of a chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractChartSectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractChartSection" substitutionGroup="AbstractChartSection"/>
+
+  <xs:attributeGroup name="AbstractChartSectionAttributes">
+
+    <xs:attributeGroup ref="AbstractChartSectionBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractChartSection2">
+    <xs:annotation>
+      <xs:documentation>
+        Used as base class for the column rectangles in BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractChartSection2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractChartSection2" substitutionGroup="AbstractChartSection2"/>
+
+  <xs:attributeGroup name="AbstractChartSection2Attributes">
+
+    <xs:attributeGroup ref="AbstractChartSectionBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractChartSectionBase">
+    <xs:annotation>
+      <xs:documentation>
+        Used as base class for marker, column rect and pie chart section. These
+        are used to create the visual presentation for the data points of a chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractChartSectionBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractChartSectionBase" substitutionGroup="AbstractChartSectionBase"/>
+
+  <xs:attributeGroup name="AbstractChartSectionBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="strokeOpacity">
+      <xs:annotation>
+        <xs:documentation>The stroke opacity for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="strokeColor">
+      <xs:annotation>
+        <xs:documentation>The stroke color for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillOpacity">
+      <xs:annotation>
+        <xs:documentation>The fill opacity for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor">
+      <xs:annotation>
+        <xs:documentation>The fill color for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor2">
+      <xs:annotation>
+        <xs:documentation>The alternate fill color used when fill type is gradient</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillType">
+      <xs:annotation>
+        <xs:documentation>The fill type used when painting the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillAngle">
+      <xs:annotation>
+        <xs:documentation>The fill angle used when painting the chart.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="markerType">
+      <xs:annotation>
+        <xs:documentation>The marker type for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="markerVisible">
+      <xs:annotation>
+        <xs:documentation>Whether markers are visible for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="explode">
+      <xs:annotation>
+        <xs:documentation>The amount to move the pie chart section from the center (percentage of radius)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2Border">
+    <xs:annotation>
+      <xs:documentation>BiAbstractGauge2Border is the base class of all gauge2 borders
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2BorderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2Border" substitutionGroup="AbstractGauge2Border"/>
+
+  <xs:attributeGroup name="AbstractGauge2BorderAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2Cap">
+    <xs:annotation>
+      <xs:documentation>This the base class of all caps
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2CapAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2Cap" substitutionGroup="AbstractGauge2Cap"/>
+
+  <xs:attributeGroup name="AbstractGauge2CapAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2Filler">
+    <xs:annotation>
+      <xs:documentation>This the base class of all fillers, fillers is used for coloring the background of gauge2 objects
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2FillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2Filler" substitutionGroup="AbstractGauge2Filler"/>
+
+  <xs:attributeGroup name="AbstractGauge2FillerAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2GradientFiller">
+    <xs:annotation>
+      <xs:documentation>This class is the base class of all gradient fillers.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2GradientFillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2GradientFiller" substitutionGroup="AbstractGauge2GradientFiller"/>
+
+  <xs:attributeGroup name="AbstractGauge2GradientFillerAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2FillerAttributes"/>
+
+    <xs:attribute name="color1" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The color1 that the filler is going to use.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="color2" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The color2 that the filler is going to use.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="opacity1" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The opacity1 that the filler is going to use for color1.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="opacity2" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The opacity2 that the filler is going to use for color2.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="xpos" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The the x position of the center of the radial filling.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ypos" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The the y position of the center of the radial filling.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="highLightCenter" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Center of the highlight of the ring in percent. 0 being at the inner radius, 100
+          at the outer radius.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="thickness" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Thickness of the "ring" in percent.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2Range">
+    <xs:annotation>
+      <xs:documentation>This class is the base class of all gauge2 ranges. A gauge2 range contains the "ticks" and "scales" and it can also
+        contain "borders".
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2RangeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2Range" substitutionGroup="AbstractGauge2Range"/>
+
+  <xs:attributeGroup name="AbstractGauge2RangeAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2Scale">
+    <xs:annotation>
+      <xs:documentation>This class is the base class of all scales
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2ScaleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2Scale" substitutionGroup="AbstractGauge2Scale"/>
+
+  <xs:attributeGroup name="AbstractGauge2ScaleAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+    <xs:attribute name="labelColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Color of the label printing the scale values</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="labelSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Size of the label printing the scale values</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="numValSteps" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Number of steps between values</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="startVal" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The start value</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endVal" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The end value</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="postString" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - String that is printed before values.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="preString" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - String that is printed after values.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2ScaleSection">
+    <xs:annotation>
+      <xs:documentation>This is the base class for all scale sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2ScaleSectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2ScaleSection" substitutionGroup="AbstractGauge2ScaleSection"/>
+
+  <xs:attributeGroup name="AbstractGauge2ScaleSectionAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+    <xs:attribute name="startVal" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The start value of the sacle section</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endVal" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The end value of the sacle section</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2Ticks">
+    <xs:annotation>
+      <xs:documentation>This class is the base class of all ticks classes
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2TicksAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2Ticks" substitutionGroup="AbstractGauge2Ticks"/>
+
+  <xs:attributeGroup name="AbstractGauge2TicksAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+    <xs:attribute name="tickLength" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The length of each tick.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="numTickSteps" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Number of steps between ticks i.e. 10 steps gives you 11 ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2ValueMarker">
+    <xs:annotation>
+      <xs:documentation>This is the base class of all value markers inBiGauge2 i.e.BiGauge2RadialNeedle
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2ValueMarkerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2ValueMarker" substitutionGroup="AbstractGauge2ValueMarker"/>
+
+  <xs:attributeGroup name="AbstractGauge2ValueMarkerAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGrid">
+    <xs:annotation>
+      <xs:documentation>The abstract base class for the grid and the
+        tree.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGridAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGrid" substitutionGroup="AbstractGrid"/>
+
+  <xs:attributeGroup name="AbstractGridAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="allowInlineFind" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When true, typing a word will select the first matching item.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showRowHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the row headers on the grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rowHeadersWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the row headers that can be shown when using a grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rowHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of each row in the grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnCount" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of columns to show in the grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnWidths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - An array containing the widths of the columns.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnOrders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - An array containing the orders of the columns. A value of
+          [2, 0, 1] means that the third column should be displayed left most
+          and the second column right most.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnAligns" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - An array containing the text aligns for the columns.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnNames" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - An array containing the names for
+          the columns. The names are used for the text on the column header.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnSortTypes" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - An array containg the sort types for the columns. Valid values can
+          be found in the documentation for the BiGridColumn
+          sortType.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="iconColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The column to show the icon on.
+          Setting this to -1 (or a value greater than the column count) removes
+          the icons.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fitColumnWidths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true the columns will be sized horizontally so that they fill the grid viewport
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="liveResize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is set to true the column size in the grid body is
+          updated as the user resizes the headers. If this is false the
+          column size in the body is only updated as the user finishes the
+          resize of the column header.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the headers on the grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="headersHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of the headers.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="multipleSelection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to allow multiple selection.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectionModel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiSelectionModel - This handles the selection of the rows in the grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onbeforesort" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the sort happens. Call
+          preventDefault
+          to prevent the sorting.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onsort" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires after the grid has been sorted.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGridRow">
+    <xs:annotation>
+      <xs:documentation>The base class for the rows and
+        nodes in a grid
+        or a tree.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGridRowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGridRow" substitutionGroup="AbstractGridRow"/>
+
+  <xs:attributeGroup name="AbstractGridRowAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="backColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The background color name</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="foreColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The foreground color name</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage /BiUri / String - The image to use as icon on the row. The icon supports bothBiImage (or
+          other objects with getIconHtml) as well as a string/uri for backwards compat
+          and more lightweight
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the grid row is selected or not.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractLoader">
+    <xs:annotation>
+      <xs:documentation>This abstract class defines the minimal interface for supporting loading
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractLoader" substitutionGroup="AbstractLoader"/>
+
+  <xs:attributeGroup name="AbstractLoaderAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="async" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to load the text file asynchronously</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="supportsSync" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the loader supports loading the file synchronously</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the file has been loaded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AccordionButton">
+    <xs:annotation>
+      <xs:documentation>This button component is a internal part of BiAccordionPage
+        and is used to expand the page.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AccordionButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAccordionButton" substitutionGroup="AccordionButton"/>
+
+  <xs:attributeGroup name="AccordionButtonAttributes">
+
+    <xs:attributeGroup ref="ButtonAttributes"/>
+
+    <xs:attribute name="checked" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Returns whether the parent BiAccordionPage is the
+          currently expanded page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AccordionPage">
+    <xs:annotation>
+      <xs:documentation>This class represents the pages inside a BiAccordionPane.
+        A accordion page has a BiAccordionButton placed directly
+        above its content, this button is used to set the page to be the only page in the parent
+        BiAccordionPane to be shown.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AccordionPageAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAccordionPage" substitutionGroup="AccordionPage"/>
+
+  <xs:attributeGroup name="AccordionPageAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text to show on the page button</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The icon to show on the page button</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="contentPane" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The content of the page</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AccordionPane">
+    <xs:annotation>
+      <xs:documentation>This class is used for creating accordion controls. A accordion control contains
+        one or more BiAccordionPage. Each accordion page also
+        has a BiAccordionButton that is shown above the
+        page and when the button is clicked the page is shown.
+        Pages are oriented vertically from top to bottom and can either be statically shown or animated.
+
+        The property animationSpeed (a) alters the speed (s) in proportion to the animated
+        page height (h), using the following formula h2 = h1 - h1 / a, every 0.05 s.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AccordionPaneAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAccordionPane" substitutionGroup="AccordionPane"/>
+
+  <xs:attributeGroup name="AccordionPaneAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="animated" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the pages are animated or not</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="animationSpeed" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Float - Animation speed (1 - infinite) where 1 is the same as setting animated to false.
+          Default value is 1.4
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiAccordionPage - The currently selected accordion button.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Adf">
+    <xs:annotation>
+      <xs:documentation>This class handles the loading and interpretation of the Application
+        Definition File (ADF).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AdfAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAdf" substitutionGroup="Adf"/>
+
+  <xs:attributeGroup name="AdfAttributes">
+
+    <xs:attributeGroup ref="XmlLoaderAttributes"/>
+
+    <xs:attribute name="caption" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The desired caption for the application window</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="autoNameMapping" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true any XML object that has an id attribute will create a
+          global reference to the object created from this XML element. This property
+          is mapped to the xmlResourceParser as well as the resource
+          loader used to load the resources.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AnimationRange">
+    <xs:annotation>
+      <xs:documentation>Defines a value range, used by BiComponentAnimation, when animating.
+        You specify a start and an end value that will be animated.
+        You also specify the duration/time, in ms, that it should take to animate the value range.
+        There are several different acceleration behaviors/types that you can choose from.
+        BiAnimationRange has the ability to progress (displace) the current value, within the animation range.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AnimationRangeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAnimationRange" substitutionGroup="AnimationRange"/>
+
+  <xs:attributeGroup name="AnimationRangeAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="startValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Lower boundry of the value range.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Upper boundry of the value range.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The acceleration type/behavior for this value range.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="time" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Desired duration of this value range, measured in milliseconds.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="curValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The current position/value inside the value range.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="ApplicationAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="progressStatus" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is the progress status text shown while loading</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accessibilityMode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - This property can be used to tell whether the application should be in an
+          accessibility mode. This does not really do anything and it is up to the
+          components and implementations to make sure of this.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accessibilityDescription" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This property can be used to popup an alert with a description about the
+          application when the application is in accessibility mode. This is useful
+          if the user needs to be informed about something to be able to use the
+          application.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="autoNameMapping" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true any XML object that has an id attribute will create a
+          global reference to the object created from this XML element. This property
+          is mapped to the xmlResourceParser as well as the resource
+          loader used to load the resources.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="focusOnLoad" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to try to focus the window when the application loads</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="inactivityTimeout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - When this is set the application will fire an event
+          called inactive. The value of this is the number of minutes before
+          the inactive is fired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="defaultPackages" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The default packages to load. This needs to be set before the loading
+          actually starts. To do this you can use an attribute in the Application tag
+          in your ADF or set this in the HTML file hosting your application.
+          If you just want to add a few packages then use a Package tag in your Resources
+          section of the ADF.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this wizard pane.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondispose" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires just before the application is disposed.
+          This allows you to clean up your main program
+          before closing the application window.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onprogressstatus" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the progress status has changed.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onresourcesready" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired after the Bindows markup has been
+          handled but before the main method is called.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when everything has been loaded
+          and initialized. This is called after the main
+          method has been called.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="ApplicationWindowAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="caption" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The title text on the application window</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="acceptButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiEventTarget - The button that acts as the default accept button. If this is set
+          then the action
+          event is dispatched from the accept button when the enter key
+          is pressed. This does not have to be a
+          BiButton, any
+          BiEventTarget will work.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cancelButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiEventTarget - The button that acts as the default cancel button. If this is set
+          then the action
+          event is dispatched from the cancel button. This does not have to
+          be aBiButton, anyBiEventTarget will work.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="glassPaneVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to hide or show the glass pane. The glass pane is shown automatically when using dialogs.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="globalCursor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Setting the global cursor will make the mouse pointer use the
+          given cursor for all the components and thus overriding the
+          cursor property of the component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="allowBrowserContextMenu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Decides whether the browser context menu should be shown by default.
+          If this is set to true you can still prevent the
+          browser context menu from being shown by calling preventDefault on the event object
+          used in the contextmenu
+          event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Area">
+    <xs:annotation>
+      <xs:documentation>This class represents an area with a given left, top, width and height
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AreaAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiArea" substitutionGroup="Area"/>
+
+  <xs:attributeGroup name="AreaAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="left" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The left position of the area</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="top" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The top position of the area</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="width" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the area</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="height" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of the area</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AreaCollection">
+    <xs:annotation>
+      <xs:documentation>This collection containsBiArea objects
+
+        This implements the same interface asBiSelectionItemCollection
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AreaCollectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAreaCollection" substitutionGroup="AreaCollection"/>
+
+  <xs:attributeGroup name="AreaCollectionAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AttachedComponentModel">
+    <xs:annotation>
+      <xs:documentation>This class is used to handleBiComponent objects insideBiTreeView andBiOlapGrid. An
+        attached component will be positioned at the same place as the cell it is
+        attached to and have the same size as that cell.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AttachedComponentModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAttachedComponentModel" substitutionGroup="AttachedComponentModel"/>
+
+  <xs:attributeGroup name="AttachedComponentModelAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="BarChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a bar chart for the given series.
+        This is used with BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BarChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiBarChart" substitutionGroup="BarChart"/>
+
+  <xs:attributeGroup name="BarChartAttributes">
+
+    <xs:attributeGroup ref="ColumnChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="BarChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a bar chart for the given series. This is used
+        with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BarChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiBarChart2" substitutionGroup="BarChart2"/>
+
+  <xs:attributeGroup name="BarChart2Attributes">
+
+    <xs:attributeGroup ref="ColumnChart2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Base64">
+    <xs:annotation>
+      <xs:documentation>This class is used to represent base 64 encoded data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Base64Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiBase64" substitutionGroup="Base64"/>
+
+  <xs:attributeGroup name="Base64Attributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="base64" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is the base 64 encoded data</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is the plain text data (the decoded base 64 data)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Border">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to describe a border for a component. The border
+        consists of three properties; width, style and color. Supported styles
+        are: none - No border is drawn, regardless of the width. dotted dashed solid double groove ridge inset outset
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BorderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiBorder" substitutionGroup="Border"/>
+
+  <xs:attributeGroup name="BorderAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="leftWidth">
+      <xs:annotation>
+        <xs:documentation>The left border width</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightWidth">
+      <xs:annotation>
+        <xs:documentation>The right border width</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="topWidth">
+      <xs:annotation>
+        <xs:documentation>The top border width</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bottomWidth">
+      <xs:annotation>
+        <xs:documentation>The bottom border width</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="leftStyle">
+      <xs:annotation>
+        <xs:documentation>The left border style</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightStyle">
+      <xs:annotation>
+        <xs:documentation>The right border style</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="topStyle">
+      <xs:annotation>
+        <xs:documentation>The top border style</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bottomStyle">
+      <xs:annotation>
+        <xs:documentation>The bottom border style</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="leftColor">
+      <xs:annotation>
+        <xs:documentation>The left border color</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightColor">
+      <xs:annotation>
+        <xs:documentation>The right border color</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="topColor">
+      <xs:annotation>
+        <xs:documentation>The top border color</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bottomColor">
+      <xs:annotation>
+        <xs:documentation>The bottom border color</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="width">
+      <xs:annotation>
+        <xs:documentation>The width (in pixels) of the border on all sides</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="style">
+      <xs:annotation>
+        <xs:documentation>The style of the border on all sides</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="color">
+      <xs:annotation>
+        <xs:documentation>The color of the border on all sides</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Box">
+    <xs:annotation>
+      <xs:documentation>This layout component places its children from left to right for the horizontal
+        box and from top to bottom for the vertical box. This is a fairly advanced
+        layout component that takes preferred, minimum and maximum size of the children
+        into account. It also takes margins into account and it uses margin collapsing
+        so that two adjacent children share the larger margin.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BoxAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiBox" substitutionGroup="Box"/>
+
+  <xs:attributeGroup name="BoxAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="orient" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The orientation to layout the children. Valid values are "horizontal" and
+          "vertical". When set to "horizontal", rightToLeft is taken into account.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The align property decides how to size and position the children. This
+          describes the size and position in the orthogonal direction of the
+          box orientation. For a
+          horizontal box this describes the height and top position and for a vertical
+          layout this describes the width and left position
+          Valid values are:
+          stretch
+          start
+          center
+          end
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="pack" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes how to layout the controls when there are no flexing children
+          and there is any remaining space.
+
+          Valid values are:
+          start
+          center
+          end
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="BrowserCheck">
+    <xs:annotation>
+      <xs:documentation>This class is used to identify the browser that the user is using.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BrowserCheckAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiBrowserCheck" substitutionGroup="BrowserCheck"/>
+
+  <xs:attributeGroup name="BrowserCheckAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Button">
+    <xs:annotation>
+      <xs:documentation>A button that can contain both text and an icon
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiButton" substitutionGroup="Button"/>
+
+  <xs:attributeGroup name="ButtonAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user presses the button (either
+          using the mouse or the keyboard)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Calendar">
+    <xs:annotation>
+      <xs:documentation>This class represents a calendar control
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CalendarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCalendar" substitutionGroup="Calendar"/>
+
+  <xs:attributeGroup name="CalendarAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - Getter for the maximum selectable date.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - Getter for the maximum selectable date.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showYearButtons" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the buttons that allow you to go to next or previous year
+          in the caption
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMonthButtons" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the buttons that allow you to go to next or previous month
+          in the caption
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showCaption" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the caption or not</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scaleFonts" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to resize the font in the day labels and days
+          when calendar is resized.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="currentDate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The date describing the currently shown month. To get the selected date(s)
+          use selectedDate(s)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dateFormatSymbols" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDateFormatSymbols - The object providing the date picker with the symbols needed to display
+          localized strings
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedDate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The selected date.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedDates" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date[] - These are the selected dates. In case multiple selection is used then use
+          this instead of selectedDate
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the selection changes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the user clicks on a day</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="CalendarSelectionModel">
+    <xs:annotation>
+      <xs:documentation>This selection model is used withBiCalendar and the items in the model
+        are Javascript date objects. Two dates are considered equal if they are
+        representing the same date (in other words the time of the day is ignored).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CalendarSelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCalendarSelectionModel" substitutionGroup="CalendarSelectionModel"/>
+
+  <xs:attributeGroup name="CalendarSelectionModelAttributes">
+
+    <xs:attributeGroup ref="SelectionModelAttributes"/>
+
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The minimum selectable date</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The maximum selectable date</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartArea">
+    <xs:annotation>
+      <xs:documentation>
+        This class represents the area where the charts inside a graph are displayed.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartAreaAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartArea" substitutionGroup="ChartArea"/>
+
+  <xs:attributeGroup name="ChartAreaAttributes">
+
+    <xs:attributeGroup ref="ChartAreaBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartArea2">
+    <xs:annotation>
+      <xs:documentation>
+        This is the chart area used with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartArea2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartArea2" substitutionGroup="ChartArea2"/>
+
+  <xs:attributeGroup name="ChartArea2Attributes">
+
+    <xs:attributeGroup ref="ChartAreaBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartAreaBase">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for BiChartArea
+        and BiChartArea2.
+        The chart area is the part of the graph that contains the charts.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartAreaBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartAreaBase" substitutionGroup="ChartAreaBase"/>
+
+  <xs:attributeGroup name="ChartAreaBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="fillColor">
+      <xs:annotation>
+        <xs:documentation>The background color of the
+          chart area
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor2">
+      <xs:annotation>
+        <xs:documentation>The alternate color of the
+          chart area (used when fill type is gradient)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillOpacity">
+      <xs:annotation>
+        <xs:documentation>The background color opacity of the
+          chart area
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillType">
+      <xs:annotation>
+        <xs:documentation>
+          The type of the fill. Valid values are:
+          solid
+          gradient
+          gradientradial
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillAngle">
+      <xs:annotation>
+        <xs:documentation>The angle of the gradient</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="strokeColor">
+      <xs:annotation>
+        <xs:documentation>The border color of the
+          chart area
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="strokeOpacity">
+      <xs:annotation>
+        <xs:documentation>The border opacity of the
+          chart area
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartCategory">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to describe the categories of the data for a
+        graph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartCategoryAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartCategory" substitutionGroup="ChartCategory"/>
+
+  <xs:attributeGroup name="ChartCategoryAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="title">
+      <xs:annotation>
+        <xs:documentation>The title of the category</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartCategoryAxis">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the drawing of the category axis for a
+        BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartCategoryAxisAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartCategoryAxis" substitutionGroup="ChartCategoryAxis"/>
+
+  <xs:attributeGroup name="ChartCategoryAxisAttributes">
+
+    <xs:attributeGroup ref="ChartCategoryAxisBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartCategoryAxis2">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the drawing of the category axis for a
+        BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartCategoryAxis2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartCategoryAxis2" substitutionGroup="ChartCategoryAxis2"/>
+
+  <xs:attributeGroup name="ChartCategoryAxis2Attributes">
+
+    <xs:attributeGroup ref="ChartCategoryAxisBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartCategoryAxisBase">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base calss for BiChartCategoryAxis
+        and BiChartCategoryAxis2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartCategoryAxisBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartCategoryAxisBase" substitutionGroup="ChartCategoryAxisBase"/>
+
+  <xs:attributeGroup name="ChartCategoryAxisBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="majorTickInterval">
+      <xs:annotation>
+        <xs:documentation>
+          The distance between the major ticks. Setting this to null makes
+          the tick interval automatic, which means that the tick interval is decided by
+          looking at the data of the charts.
+          This value needs to be an integer.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minorTickInterval">
+      <xs:annotation>
+        <xs:documentation>
+          The distance between the minor ticks. Setting this to null makes
+          the tick interval automatic, which means that the tick interval is decided by
+          looking at the data of the charts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMajorTicks">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMinorTicks">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showLabels">
+      <xs:annotation>
+        <xs:documentation>Whether to show the labels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="axisBetweenCategories">
+      <xs:annotation>
+        <xs:documentation>
+          When this is true the data points, the labels and the value axis are
+          placed between the major ticks. When false the data points, the labels
+          and the value axis are placed on the major ticks. The default is
+          true and therefore the first value will not be placed on
+          the value axis.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fontSize">
+      <xs:annotation>
+        <xs:documentation>
+          The font size (in pixels) for the labels of the axis.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartGridLines">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to display the grid lines for
+        BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartGridLinesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartGridLines" substitutionGroup="ChartGridLines"/>
+
+  <xs:attributeGroup name="ChartGridLinesAttributes">
+
+    <xs:attributeGroup ref="ChartGridLinesBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartGridLines2">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to display the grid lines for
+        BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartGridLines2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartGridLines2" substitutionGroup="ChartGridLines2"/>
+
+  <xs:attributeGroup name="ChartGridLines2Attributes">
+
+    <xs:attributeGroup ref="ChartGridLinesBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartGridLinesBase">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for BiChartGridLines
+        and BiChartGridLines2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartGridLinesBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartGridLinesBase" substitutionGroup="ChartGridLinesBase"/>
+
+  <xs:attributeGroup name="ChartGridLinesBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="showMajorValue">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major value grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMinorValue">
+      <xs:annotation>
+        <xs:documentation>Whether to show the minor value grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMajorCategory">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major category grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMinorCategory">
+      <xs:annotation>
+        <xs:documentation>Whether to show the minor category grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="majorValueStrokeColor">
+      <xs:annotation>
+        <xs:documentation>The color of the major value grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minorValueStrokeColor">
+      <xs:annotation>
+        <xs:documentation>The color of the minor value grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="majorCategoryStrokeColor">
+      <xs:annotation>
+        <xs:documentation>The color of the major category grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minorCategoryStrokeColor">
+      <xs:annotation>
+        <xs:documentation>The color of the minor category grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartLegend">
+    <xs:annotation>
+      <xs:documentation>
+        The legend component is used to show a list of the titles of the series
+        or categories depending on the chart type.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartLegendAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartLegend" substitutionGroup="ChartLegend"/>
+
+  <xs:attributeGroup name="ChartLegendAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="fontSize">
+      <xs:annotation>
+        <xs:documentation>
+          The font size (in pixels) of the labels inside the legend.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartLegendLabel">
+    <xs:annotation>
+      <xs:documentation>
+        A special lable used for the items in the chart
+        legend
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartLegendLabelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartLegendLabel" substitutionGroup="ChartLegendLabel"/>
+
+  <xs:attributeGroup name="ChartLegendLabelAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="legendFor">
+      <xs:annotation>
+        <xs:documentation>
+          The object used for the text and the icon for the label. This object
+          needs to have the methods getTitle() (See for example
+          title for BiAbstractChart)
+          and getIconHtml(oLabel) (See for example
+          getIconHtml for BiImage).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartMouseEvent">
+    <xs:annotation>
+      <xs:documentation>
+        This event is used for mouse events that are specific for a data point
+        inside a graph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartMouseEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartMouseEvent" substitutionGroup="ChartMouseEvent"/>
+
+  <xs:attributeGroup name="ChartMouseEventAttributes">
+
+    <xs:attributeGroup ref="MouseEventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartPoint">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to describe how to display a data point in the graph.
+        Each point is bound to a series and a category.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartPointAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartPoint" substitutionGroup="ChartPoint"/>
+
+  <xs:attributeGroup name="ChartPointAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="strokeOpacity">
+      <xs:annotation>
+        <xs:documentation>The stroke opacity for the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="strokeColor">
+      <xs:annotation>
+        <xs:documentation>The stroke color for the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillOpacity">
+      <xs:annotation>
+        <xs:documentation>The fill opacity for the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor">
+      <xs:annotation>
+        <xs:documentation>The fill color for the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor2">
+      <xs:annotation>
+        <xs:documentation>The alternate fill color used when fill type is gradient</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillType">
+      <xs:annotation>
+        <xs:documentation>The fill type used when painting the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillAngle">
+      <xs:annotation>
+        <xs:documentation>The fill angle used when painting the section of the chart this point descibes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="markerType">
+      <xs:annotation>
+        <xs:documentation>The marker type for the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="markerVisible">
+      <xs:annotation>
+        <xs:documentation>Whether markers are visible for the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="explode">
+      <xs:annotation>
+        <xs:documentation>The amount to move the pie chart section from the middle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartPresentation">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to define the presentation attributes for a chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartPresentationAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartPresentation" substitutionGroup="ChartPresentation"/>
+
+  <xs:attributeGroup name="ChartPresentationAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="strokeOpacity">
+      <xs:annotation>
+        <xs:documentation>The stroke opacity for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="strokeColor">
+      <xs:annotation>
+        <xs:documentation>The stroke color for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor">
+      <xs:annotation>
+        <xs:documentation>The fill color for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillOpacity">
+      <xs:annotation>
+        <xs:documentation>The fill opacity for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor2">
+      <xs:annotation>
+        <xs:documentation>The alternate fill color used when fill type is gradient</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillType">
+      <xs:annotation>
+        <xs:documentation>The fill type used when painting the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillAngle">
+      <xs:annotation>
+        <xs:documentation>The fill angle used when painting the chart.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="markerType">
+      <xs:annotation>
+        <xs:documentation>The marker type for the line chart. Valid values are
+          circle
+          square
+          trianle
+          diamond
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="markerVisible">
+      <xs:annotation>
+        <xs:documentation>Whether markers are visible for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="explode">
+      <xs:annotation>
+        <xs:documentation>The amount to move the pie chart sections from the middle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="barSpacing">
+      <xs:annotation>
+        <xs:documentation>
+          This is the relative distance between the bars or columns of different categories.
+          1 means that the distance is the same as the width/height of the column/bar.
+          0 means that there is no spacing.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartPresentationManager">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to find the properties for different visual aspects of
+        of the graph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartPresentationManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartPresentationManager" substitutionGroup="ChartPresentationManager"/>
+
+  <xs:attributeGroup name="ChartPresentationManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartSeries">
+    <xs:annotation>
+      <xs:documentation>
+        This describes a series of values that is used with the graph
+        control. Each series has a unique id and every value of the series
+        belongs to a certain category.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartSeriesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartSeries" substitutionGroup="ChartSeries"/>
+
+  <xs:attributeGroup name="ChartSeriesAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="title">
+      <xs:annotation>
+        <xs:documentation>The title of the series</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="values">
+      <xs:annotation>
+        <xs:documentation>
+          The values in the series. This is the same order as the order of
+          the categories. If a value for a certain category is missing the
+          value for that is null in the array.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartValueAxis">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the drawing of the value axis for a
+        graph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartValueAxisAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartValueAxis" substitutionGroup="ChartValueAxis"/>
+
+  <xs:attributeGroup name="ChartValueAxisAttributes">
+
+    <xs:attributeGroup ref="ChartValueAxisBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartValueAxis2">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the drawing of the value axis for a
+        BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartValueAxis2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartValueAxis2" substitutionGroup="ChartValueAxis2"/>
+
+  <xs:attributeGroup name="ChartValueAxis2Attributes">
+
+    <xs:attributeGroup ref="ChartValueAxisBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartValueAxisBase">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for BiChartValueAxis
+        and BiChartValueAxis2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartValueAxisBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartValueAxisBase" substitutionGroup="ChartValueAxisBase"/>
+
+  <xs:attributeGroup name="ChartValueAxisBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="showMajorTicks">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMinorTicks">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showLabels">
+      <xs:annotation>
+        <xs:documentation>Whether to show the labels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fontSize">
+      <xs:annotation>
+        <xs:documentation>
+          The font size (in pixels) for the labels of the axis.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="majorTickInterval">
+      <xs:annotation>
+        <xs:documentation>
+          The distance between the major ticks. Setting this to null makes
+          the tick interval automatic, which means that the tick interval is decided by
+          looking at the data of the charts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minorTickInterval">
+      <xs:annotation>
+        <xs:documentation>
+          The distance between the minor ticks. Setting this to null makes
+          the tick interval automatic, which means that the tick interval is decided by
+          looking at the data of the charts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum">
+      <xs:annotation>
+        <xs:documentation>
+          The max value of the value axis. Setting this to null makes
+          the max value automatic, which means that the max value is decided by
+          looking at the data of the charts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum">
+      <xs:annotation>
+        <xs:documentation>
+          The min value of the value axis. Setting this to null makes
+          the min value automatic, which means that the min value is decided by
+          looking at the data of the charts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="CheckBox">
+    <xs:annotation>
+      <xs:documentation>Represents a check box control
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CheckBoxAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCheckBox" substitutionGroup="CheckBox"/>
+
+  <xs:attributeGroup name="CheckBoxAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - A value associated with the check box</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="checked" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the check box is checked or not. When this is changed the
+          change event is fired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user presses the button (either
+          using the mouse or the keyboard)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the checked property is
+          changed
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="CheckBoxMenuItem">
+    <xs:annotation>
+      <xs:documentation>This class is used for a menu item that displays a check box to the left
+        of the text.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CheckBoxMenuItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCheckBoxMenuItem" substitutionGroup="CheckBoxMenuItem"/>
+
+  <xs:attributeGroup name="CheckBoxMenuItemAttributes">
+
+    <xs:attributeGroup ref="MenuItemAttributes"/>
+
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - A value associated with the item.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="checked" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the item is checked or not.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the checked property changes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Circle">
+    <xs:annotation>
+      <xs:documentation>This class represents the shape of a Circle.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CircleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCircle" substitutionGroup="Circle"/>
+
+  <xs:attributeGroup name="CircleAttributes">
+
+    <xs:attributeGroup ref="ShapeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ColorPicker">
+    <xs:annotation>
+      <xs:documentation>This dialog allows the user to select a predefined color or define his
+        own color.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ColorPickerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiColorPicker" substitutionGroup="ColorPicker"/>
+
+  <xs:attributeGroup name="ColorPickerAttributes">
+
+    <xs:attributeGroup ref="DialogAttributes"/>
+
+    <xs:attribute name="rgbString" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The rgb string ("rgb(255,255,255)") describing the selected color.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rgb" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The rgb triplet describing the selected color.
+          The rgb triplet is an object with r (0 - 255), g (0 - 255) and b (0 - 255) fields
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="hsl" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The hsl triplet describing the selected color.
+          The hsl triplet is an object with h (0 - 360), s (0 - 1) and l (0 - 1) fields
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this color picker. If this is set to null
+          then the static string bundle forBiColorPicker is used
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event fires continiously when the user changes the color.
+          If you want to know when the user closes the dialog use the
+          dialogresult
+          event inherited from the BiDialog.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ColumnChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a column chart for the given series
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ColumnChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiColumnChart" substitutionGroup="ColumnChart"/>
+
+  <xs:attributeGroup name="ColumnChartAttributes">
+
+    <xs:attributeGroup ref="AbstractChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ColumnChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a column chart for the given series
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ColumnChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiColumnChart2" substitutionGroup="ColumnChart2"/>
+
+  <xs:attributeGroup name="ColumnChart2Attributes">
+
+    <xs:attributeGroup ref="AbstractChart2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ColumnChartSection">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the components used to show the rectangles for a
+        column chart.
+        This is used with BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ColumnChartSectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiColumnChartSection" substitutionGroup="ColumnChartSection"/>
+
+  <xs:attributeGroup name="ColumnChartSectionAttributes">
+
+    <xs:attributeGroup ref="AbstractChartSectionAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ColumnChartSection2">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the components used to show the rectangles for a
+        column chart.
+        This is used with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ColumnChartSection2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiColumnChartSection2" substitutionGroup="ColumnChartSection2"/>
+
+  <xs:attributeGroup name="ColumnChartSection2Attributes">
+
+    <xs:attributeGroup ref="AbstractChartSection2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComboBox">
+    <xs:annotation>
+      <xs:documentation>This class represents a combo box.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComboBoxAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiComboBox" substitutionGroup="ComboBox"/>
+
+  <xs:attributeGroup name="ComboBoxAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="sortType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets built in sort method to use to sort the combobox items, this
+          property is only used in the absence of a custom sort method.
+          Valid settings are: (seeBiSort for more details)
+          string caseInsensitiveString number date - Uses the native JS Date type
+          To get better control over the sorting, set the sortFunction property
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortFunction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Function - Compare function used to sort combobox items. The function
+          takes two arguments and returns a number (just like the normal
+          comparison function used when sorting arrays in JavaScript).
+          If this property is not set, it uses the predefined
+          functions set by the sortType property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedItem" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComboBoxItem - The selected combo box item. If no item is selected this will be null.
+          When this changes the change event fires.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the currently selected item. -1 if none.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - This is the userValue of the selected combo box item.
+          If no item is selected then this returns null.
+          When setting this, the first item with the given user value will be selected.
+          If no item has this value the selection will not change.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - Deprecated. Use userValue instead.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="editable" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the text field can be edited</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dropDownVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the combo box is displaying its drop-down list.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dropDownWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The desired width of the drop-down list.
+          The width of the drop-down is always greater than or equal to the width of the combo box.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text shown in the combo box.
+          This can be used to find the text that the user is currently typing into the text field of the combo box.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="validator" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Function - A function that is used to validate the text</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="invalidMessage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - A string that can be used to describe why the input is invalid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataTextField" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the column to use as the data for the text property of the combo box items.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataUserValueField" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the column to use as the data for the userValue property of the combo box items.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onactivechanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the active item changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedItem changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondatabind" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Called after the component has been data bound</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ontextchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the text changes in the text field of the combo box. To get the new text use the text property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComboBoxItem">
+    <xs:annotation>
+      <xs:documentation>This class represents an item in theBiComboBox.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComboBoxItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiComboBoxItem" substitutionGroup="ComboBoxItem"/>
+
+  <xs:attributeGroup name="ComboBoxItemAttributes">
+
+    <xs:attributeGroup ref="ListItemAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Command">
+    <xs:annotation>
+      <xs:documentation>
+        Command objects can be used to make several user interface components
+        execute the command when they are invoked. Components that use the command
+        object will be synchronized with the properties of the command. For example,
+        if a button has a disabled command the button will also be disabled.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CommandAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCommand" substitutionGroup="Command"/>
+
+  <xs:attributeGroup name="CommandAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="enabled">
+      <xs:annotation>
+        <xs:documentation>
+          Whether the command is enabled or not
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="checked">
+      <xs:annotation>
+        <xs:documentation>
+          The checked state of the command. This is usually used to synchronize
+          the checked property of the components using this command (such as
+          BiRadioButton,
+          BiCheckBox and others).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userValue">
+      <xs:annotation>
+        <xs:documentation>
+          The user value of the command. This is usually used to synchronize
+          the user values of the components using this command (such as
+          BiRadioGroup and
+          BiComboBox).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="shortcut">
+      <xs:annotation>
+        <xs:documentation>
+          The keyboard shortcut used to execute the command. The format for
+          the shortcut is:
+          Ctrl+Shift+Alt+k
+          You can also use the static fields of BiKeyboardEvent
+          for describing the key codes:
+
+          Shift+Del
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="keyCode">
+      <xs:annotation>
+        <xs:documentation>
+          This gives a bit more detail than the shortcut property because
+          there are cases where there is no name for the key. Use shortcut
+          whenever possible and fall back on keyCode when needed. If keyCode
+          is provided only the modifiers from the shortcut is used.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onexecute" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This is fired when the command is executed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onenabledchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This is fired when the enabled property is changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncheckedchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This is fired when the checked property is changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onuservaluechanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This is fired when the userValue property is changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onshortcutchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This is fired when the shortcut property is changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Component">
+    <xs:annotation>
+      <xs:documentation>This is the core class for all visual components in Bindows.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:group ref="iv:ElementsAllowedExternally"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiComponent" substitutionGroup="Component"/>
+
+  <xs:attributeGroup name="ComponentAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="parent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - Returns the parent component. This is the component that the
+          current component was added to. If the current component has not
+          been added to any component this returns null. If the real
+          parent component is anonymous then this returns the first non anonymous
+          ancestor.
+          When setting this the component is added last to the new parent. If you set
+          this to null the component is removed from its current parent
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="children" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent[] - The components added to the current component. This does not include anonymous
+          children.
+          When setting this all the old children are first removed and disposed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="foreColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The foreground color name. The supported color names follows CSS2.1</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="backColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The background color name. The supported color names follows CSS2.1</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="zIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The z index of the component. A higher z index means that the component will
+          cover components with lower z index and therefore appear to be closer to
+          the user.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="visible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the component is visible or not. Note that all the ancestors must be
+          visible for the component to be actually shown. Use isVisible to
+          check that the component is shown.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cursor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the cursor to show when the mouse pointer is over the component.
+          This is any valid CSS2 cursor name.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="backgroundImage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The URI of the image file to use as background image.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="opacity" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the opacity for the component. Any child component inside the
+          component will also become transparent. The value should be a
+          number between 0 and 1 where 1 means totally opaque and 0 invisible.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="left" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The left position relative to the parent inner edge.
+          When using get the return value is always a number
+          representing the pixel value.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="right" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The right position relative to the parent inner edge. When using
+          right a width should also be set. When using get the
+          return value is always a number representing the pixel value.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="top" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The top position relative to the parent inner edge.
+          When using get the return value is always a number
+          representing the pixel value.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bottom" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The bottom position relative to the parent inner edge. When using
+          bottom a height should also be set. When using get the
+          return value is always a number representing the pixel value.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="width" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the component. When using get the return value is
+          always a number representing the pixel value.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="height" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of the component. When using get the return value is
+          always a number representing the pixel value.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="preferredWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Returns the desired width of the component. This is usually the
+          size of the content plus the borders.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="preferredHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Returns the desired height of the component. This is usually the
+          size of the content plus the borders.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimumWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Returns the desired minimum width of the component. This does not
+          limit the size but is used by some components as a layout hint.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximumWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Returns the desired maximum width of the component. This does not
+          limit the size but is used by some components as a layout hint.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimumHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Returns the desired minimum height of the component. This does not
+          limit the size but is used by some components as a layout hint.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximumHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Returns the desired maximum height of the component. This does not
+          limit the size but is used by some components as a layout hint.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="border" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiBorder - The border property describes how to paint the border on the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="marginLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The left margin for the component. Margins are used by some layout managers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="marginRight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The right margin for the component. Margins are used by some layout managers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="marginTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The top margin for the component. Margins are used by some layout managers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="marginBottom" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The bottom margin for the component. Margins are used by some layout managers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="clipLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is the clip left value. When this is set the shown region of the component
+          starts this many pixels from the left.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="clipTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is the clip top value. When this is set the shown region of the component
+          starts this many pixels from the top.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="clipWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is the width of the shown region when the component is clipped.
+          A value of null means the entire (remaining) width is shown.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="clipHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is the height of the shown region when the component is clipped.
+          A value of null means the entire (remaining) height is shown.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="overflow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Describes how to handle content that is too large to fit inside
+          the component. hidden - The content is clipped auto - Scroll bars are shown as needed scroll - Scroll bars are always shown. Even
+          if there
+          is enough room for the content inside the component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="overflowX" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes how to handle content that is too large to fit inside
+          the component. This only covers the horizontal overflow. hidden - The content is clipped auto - Scroll bars are shown as needed
+          scroll - Scroll bars are always shown. Even if there
+          is enough room for the content inside the component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="overflowY" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes how to handle content that is too large to fit inside
+          the component. This only covers the vertical overflow hidden - The content is clipped auto - Scroll bars are shown as needed
+          scroll - Scroll bars are always shown. Even if there
+          is enough room for the content inside the component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scrollLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position of the content relative to the view port of the component. This
+          is the distance the view port has scrolled horizontally.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scrollTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position of the content relative to the view port of the component. This
+          is the distance the view port has scrolled vertically.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="tabIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Setting this to less than 0 prevents the component from becoming
+          focusable. The tab index is used to tell in what order to focus
+          the components when naviagting between components using the tab key.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="hideFocus" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to hide the dotted outline that the OS usually draws around focused
+          components.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="focused" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If the component can be focused then this makes the component
+          focused (if set to true). If the component was focused
+          and this is set to false then the component is blurred.
+          Changing this fires the focus
+          and blur events (depending on the
+          previous state).
+          A disabled component cannot recieve focus.
+          To be able to recieve focus the tabIndex
+          must be greater or equal to 0.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="focusManager" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiFocusManager - The focus manager that handles focus inside the component. This is usually
+          null forBiComponent and the focus is usually handled by some
+          ancestor.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="canSelect" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether textual content is selectable</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="enabled" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the component is enabled or not. When this is changed the
+          component fires the enabledchanged event.
+          A disabled component cannot recieve focus.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="capture" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - This is true when the component is set to capture all mouse events even if
+          the mouse pointer is outside the component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accessKey" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The key, in combination with the Alt key, that will activate the component.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="contextMenu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiMenu - If set then this is the menu that will be shown
+          when the user right clicks (or uses some other UI mechanism) to bring up
+          a context menu. Set this to null when no contex menu
+          is desired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="name" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name does not have any real meaning except that it can be useful to
+          identify the component
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toolTip" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiToolTip - Sets the tool tip to show when the user hovers the component.
+          Setting this to null prevents a tooltip from beeing shown (unless
+          toolTipText is set.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toolTipText" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets the tool tip text to show when the user hovers the component.
+          This allows a simple plain text tool tip to be shown. This property
+          is preferred over the toolTip property when the extra
+          functionality provided by the BiToolTip
+          instance is not needed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightToLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Describes whether the component should be be layed out to support
+          locales using right-to-left fonts. If this is set to null
+          then the rightToLeft property for the parent component
+          is used.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="command" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiCommand - Commands are used to make more than one component trigger the
+          same action. Commands also synchronize different properties on
+          the components using the command.BiComponent only synchronizes
+          the enabled property with the command. Sub classes
+          that have a value property usually synchronizes that as well.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dropDataTypes" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The data type that are supported when dropping on the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cssClassName" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The CSS class name for the element representing the component.
+          This should be used with caution since in some cases this might give unrespected results.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="appearance" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets the appearance on the component. This allows a theme to do custom
+          styling of the component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onresize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a created component
+          changes its size.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onenabledchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the enabled
+          property is changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncreate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the component has been
+          created and inserted into the document. When it is
+          fired it is quaranteed that the component has been
+          inserted into a application
+          window and at that time it has a visual representation.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onlosecapture" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired if the component has taken
+          the capture but for some reason lost it.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onscroll" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When the user scrolls the component scroll
+          events are continuously fired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfocus" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the component becomes focused.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfocusin" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the component becomes focused.
+          This event is fired before the focus event
+          and unlike the focus event it bubbles up
+          to the parent component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfocusout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the component loses focus. This
+          event is fired before the blur event and
+          unlike the blur event it bubbles up to the
+          parent component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onblur" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired by a focused compinent when it loses focus.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onkeydown" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired by the component when it is focused
+          and the user presses down a key on the keyboard. This event
+          then bubbles up to ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onkeypress" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is continuously fired by the component when it
+          is focused and the user holds down a key on the keyboard.
+          This event then bubbles up to ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onkeyup" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired by the component when it is focused
+          and the user releases a key on the keyboard. This event
+          then bubbles up to ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onclick" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When the user clicks on a component it fires this event.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncontextmenu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the user wants to show the context
+          menu. This is usually done by right clicking on the component
+          but can be done in several different ways depending on the
+          users operating system. This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondblclick" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When the user double clicks on a component it fires this event.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmousedown" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the user presses down a mouse button on a
+          component. This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmousemove" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the user moves the mouse and the pointer
+          is over the current component. This event bubbles to the
+          ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmouseout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the mouse pointer leaves the component.
+          relatedTarget
+          can be used to find the component that was entered.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmouseover" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the mouse pointer enters a component.
+          relatedTarget
+          can be used to find the component that was left.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmouseup" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the user releases a mouse button on the
+          component. This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmousewheel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the user scrolls the mouse wheel over the
+          component. This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondragstart" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the user starts to drag a component.
+          Call startDrag
+          on the event object to initiate a drag'n drop session.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondragover" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When doing drag'n drop this is fired when the user drags over
+          the component. This is similar to mouseover except
+          that it only happens on valid drop targets during a drag'n drop
+          sessions. The relatedTarget points to the component
+          of the drag'n drop session that was left (if any).
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondragout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When doing drag'n drop this is fired when the mouse pointer
+          leaves the component. This is similar to mouseout
+          except that it only happens on valid drop targets during a
+          drag'n drop sessions. The relatedTarget points to the component
+          of the drag'n drop session that was entered (if any).
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondragmove" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When doing drag'n drop this is fired when the mouse pointer
+          moves over the component. This is similar to mousemove
+          except that it only happens on valid drop targets during a
+          drag'n drop sessions.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondragdrop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the user drops something on the component.
+          This is only fired by valid drop targets for the drag'n drop
+          session. The relatedTarget points to the source
+          of the drag'n drop session.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondragend" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired on the component that the user started the drag on
+          when the drag and drop session ends. If the drag'n drop was
+          successful then the relatedTarget is the component
+          where the drag'n drop started. If the drag'n drop failed the
+          relatedTarget
+          is null.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComponentAnimation">
+    <xs:annotation>
+      <xs:documentation>This class is the basis for all animations. Typically you don't work with this class directly, but
+        instead use one of it's subclasses. You will need to use some methods here, common to all animations.
+        Such as start and stop for example.
+        If you want to create a completely new type of animation, however you need to be aware of the specifics
+        of this class.BiComponentAnimation generates values in a specified range a certain number of times per second.
+        This is useded to drive the value of properties to create animation. It is possible to have several
+        different value ranges which each can have various properties like speed and acceleration behavior.
+        Predefined acceleration curves exist to simulate acceleration and deceleration.
+        To animate, you create aBiComponentAnimation object and setup parameters as needed. You then
+        registerBiComponents with it. When you start the animation, all registeredBiComponents will
+        be animated in the same way. If you need different animation behaviors for differentBiComponents
+        you will have to create differentBiComponentAnimation objects with different properties.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentAnimationAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiComponentAnimation" substitutionGroup="ComponentAnimation"/>
+
+  <xs:attributeGroup name="ComponentAnimationAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="frameRate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number : Current frame rate, Frames Per Second. - Current frame rate.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="looping" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Turns looping on.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="autoStart" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If animation should start automatically once the first component is added.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="generator" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiFpsGenerator - Accesses the frame generator that drives the animation.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onanimationend" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the animation has played through completely.
+          Once per loop iteration if looping is active.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onframeprogression" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired upon every new frame</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="CssLoader">
+    <xs:annotation>
+      <xs:documentation>This class loads and executes a CSS file
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CssLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCssLoader" substitutionGroup="CssLoader"/>
+
+  <xs:attributeGroup name="CssLoaderAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The URI (location) of the file to load. If this is set to a string a
+          new URI is created from that string relative to the
+          ADF path.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the file has been loaded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DataColumn">
+    <xs:annotation>
+      <xs:documentation>This class represents a data column of a data
+        table.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DataColumnAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDataColumn" substitutionGroup="DataColumn"/>
+
+  <xs:attributeGroup name="DataColumnAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="dataType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the type that values in this column has.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="defaultValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The default value for items in this column. This may be
+          used by the BiDataRow.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="DataRow">
+    <xs:annotation>
+      <xs:documentation>This class represents a row in aBiDataTable.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DataRowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDataRow" substitutionGroup="DataRow"/>
+
+  <xs:attributeGroup name="DataRowAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DataSet">
+    <xs:annotation>
+      <xs:documentation>This class represents a data set. A data set contains
+        tables, which
+        consists of columns and
+        rows.
+
+        @option
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DataSetAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDataSet" substitutionGroup="DataSet"/>
+
+  <xs:attributeGroup name="DataSetAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DataSetDataModel">
+    <xs:annotation>
+      <xs:documentation>This is a data model forBiTreeView that takes aBiDataSet as the data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DataSetDataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDataSetDataModel" substitutionGroup="DataSetDataModel"/>
+
+  <xs:attributeGroup name="DataSetDataModelAttributes">
+
+    <xs:attributeGroup ref="TreeViewDataModelAttributes"/>
+
+    <xs:attribute name="dataSet" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDataSet/BiDataSetTable - The data set to use as the data for the model</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondatastructurechanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired after a major
+          data structure change
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforedatastructurechanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event happens before
+          the data has actually changed. This
+          happens before datastructurechanged
+          event and the old data is still available.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DataTable">
+    <xs:annotation>
+      <xs:documentation>This class represents a data table inside a data set. A data table
+        consists of columns and
+        rows.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DataTableAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDataTable" substitutionGroup="DataTable"/>
+
+  <xs:attributeGroup name="DataTableAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DateFormat">
+    <xs:annotation>
+      <xs:documentation>This class is used to format and parse dates. It is based on the Java class
+        SimpleDateFormat.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DateFormatAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDateFormat" substitutionGroup="DateFormat"/>
+
+  <xs:attributeGroup name="DateFormatAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="dateFormatSymbols" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDateFormatSymbols - The date format symbols used to define how to parse and format strings and
+          dates
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="pattern" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The pattern to use when formatting and parsing</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="localizedPattern" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The pattern using localized pattern characters</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="lenient" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true parsing will try to parse the string even
+          though it does not correctly match the given pattern. For example it will
+          try to use the Javascript Date parse method.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="DateFormatSymbols">
+    <xs:annotation>
+      <xs:documentation>A class that provides locale specific date strings and date patterns. The
+        specific strings to use are provided by a staticBiStringBundle. This calss
+        is based on the Java class
+        DateFormatSymbols.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DateFormatSymbolsAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDateFormatSymbols" substitutionGroup="DateFormatSymbols"/>
+
+  <xs:attributeGroup name="DateFormatSymbolsAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="amPmStrings" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the am pm strings</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="eras" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing strings representing the eras berfore and after
+          year zero.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="localePatternChars" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is a string the localized pattern charaters. This allows the pattern
+          to use other characters than the default to identify the different parts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="months" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the full month names</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="shortMonths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the short month names</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="weekdays" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the weekday names</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="shortWeekdays" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the short weekday names</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="datePatterns" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the short and long date pattern</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="timePatterns" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the short and long time pattern</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dateTimePatterns" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the short and long date time pattern</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="firstWeekday" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The weekday that starts the week. 0 is Sunday and 6 is Saturday. Setting this
+          to 1 means that Monday starts the week just like in ISO.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="redWeekdays" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - The days of the week that are considered red. 0 is Sunday and 6 is Saturday. Setting this
+          to [0] means that Sundays will be considered red days.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightToLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Returns whether right to left should be used for this language</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="DatePicker">
+    <xs:annotation>
+      <xs:documentation>This component provides a text field where one can write a date and a popup
+        containing aBiCalendar that allows one to pick a date.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DatePickerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDatePicker" substitutionGroup="DatePicker"/>
+
+  <xs:attributeGroup name="DatePickerAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - Getter for the maximum selectable date.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - Getter for the minimum selectable date.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedDate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The selected date</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dateFormat" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDateFormat - The object describing how to parse and format dates</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dropDownVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the calendar part is visible or not</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text shown in the text field part of the date picker. Setting
+          this causes the text to be parsed and this might trigger a change
+          event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="validator" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Function - A function that is used to validate the text</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="invalidMessage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - A string that can be used to describe why the input is invalid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ontextchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the text in the text field
+          is changed
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the user clicks to select
+          a date or when the enter key is pressed
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the selecetd date changes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onshow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the calendar is shown.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onhide" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the calendar is hidden.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DesktopPane">
+    <xs:annotation>
+      <xs:documentation>A special container that can be used to add internal
+        windows to. The desktop pane has a
+        window manager that provides some
+        extra features for the windows inside the desktop pane.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DesktopPaneAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDesktopPane" substitutionGroup="DesktopPane"/>
+
+  <xs:attributeGroup name="DesktopPaneAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Dialog">
+    <xs:annotation>
+      <xs:documentation>This class is used for dialog windows. Dialog windows are internal windows
+        that require immediate attention. Dialog windows are modal to the application.
+        Example usage: var confirm = newBiDialog("Are you sure");
+        // add components to the dialog
+        confirm.addEventListener("dialogresult", this.doSomething, this);
+        confirm.setVisible(true);
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DialogAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDialog" substitutionGroup="Dialog"/>
+
+  <xs:attributeGroup name="DialogAttributes">
+
+    <xs:attributeGroup ref="WindowAttributes"/>
+
+    <xs:attribute name="dialogResult" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The value set by the dialog before it is closed. the dialogResult should be
+          set by the content of the dialog before it is closed
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="defaultFocusedComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - This allows you to set the component that should be focused when the dialog
+          is shown. If null then the acceptButton is used for this.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="centered" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - This property decides whether to automatically center the dialog when it
+          is shown
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondialogresult" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is called when the dialog is
+          closed (or hidden). This is the main event
+          to use with dialogs since it is fired when
+          the user closes it or selects a value in it.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DockPanel">
+    <xs:annotation>
+      <xs:documentation>This layout component position and sizes its children using docking guidelines.
+        The children are laid out from first child to last and after a child has
+        been docked to one edge the following child will be docked to remaining
+        available space. Once a child sets its docking hint to "fill", the following
+        will not be shown.
+        To define that side the child should be docked at a so called attached property
+        is used. This is a static method on theBiDockPanel. There exists a Bindows
+        markup shortcut for setting these properties
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DockPanelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDockPanel" substitutionGroup="DockPanel"/>
+
+  <xs:attributeGroup name="DockPanelAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DragAndDropManager">
+    <xs:annotation>
+      <xs:documentation>This class is used to manage the drag and drop system
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DragAndDropManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDragAndDropManager" substitutionGroup="DragAndDropManager"/>
+
+  <xs:attributeGroup name="DragAndDropManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="action" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The desired action to use for the drag and drop session</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dragIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:oComp :BiComponent The component to show - The component to use as the icon next to the cursor when doing
+          drag
+          and drop. When this is set to null images are shown that represents the
+          action
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="DragEvent">
+    <xs:annotation>
+      <xs:documentation>This event is used in drag and drop sesssions
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DragEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDragEvent" substitutionGroup="DragEvent"/>
+
+  <xs:attributeGroup name="DragEventAttributes">
+
+    <xs:attributeGroup ref="MouseEventAttributes"/>
+
+    <xs:attribute name="dragIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component to use as the icon next to the pointer</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="DrawAnchor">
+    <xs:annotation>
+      <xs:documentation>This class defines static properties that represent the anchoring locations for link lines.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DrawAnchorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDrawAnchor" substitutionGroup="DrawAnchor"/>
+
+  <xs:attributeGroup name="DrawAnchorAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <!--<xs:element name="DrawLine">-->
+  <!--<xs:annotation><xs:documentation>This class represents a link line.-->
+  <!--</xs:documentation></xs:annotation>-->
+  <!--<xs:complexType>-->
+  <!--<xs:choice>-->
+  <!--<xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>-->
+  <!--</xs:choice>-->
+  <!--<xs:attributeGroup ref="DrawLineAttributes" />-->
+  <!--</xs:complexType>-->
+  <!--</xs:element>-->
+  <!--<xs:element name="BiDrawLine" substitutionGroup="DrawLine"/>-->
+
+  <!--<xs:attributeGroup name="DrawLineAttributes">-->
+
+  <!--<xs:attribute name="foreColor" type="xs:string"><xs:annotation><xs:documentation>Type:String - The color of this line.</xs:documentation></xs:annotation></xs:attribute>-->
+  <!--<xs:attribute name="hoverColor" type="xs:string"><xs:annotation><xs:documentation>Type:String - The color of this line when the cursor is moved over it.</xs:documentation></xs:annotation></xs:attribute>-->
+  <!--<xs:attribute name="startArrowStyle" type="xs:string"><xs:annotation><xs:documentation>Type:String - The style of the start arrow for this line.-->
+  <!--Accepted values are:- circle, arrow, none</xs:documentation></xs:annotation></xs:attribute>-->
+  <!--<xs:attribute name="endArrowStyle" type="xs:string"><xs:annotation><xs:documentation>Type:String - The style of the end arrow for this line.-->
+  <!--Accepted values are:- circle, arrow, none</xs:documentation></xs:annotation></xs:attribute>-->
+  <!--<xs:attribute name="width" type="xs:string"><xs:annotation><xs:documentation>Type:Number - The width of this line.</xs:documentation></xs:annotation></xs:attribute>-->
+  <!--<xs:attribute name="type" type="xs:string"><xs:annotation><xs:documentation>Type:String - The type of this line.-->
+  <!--Accepted values are:- dotted, dashed, solid</xs:documentation></xs:annotation></xs:attribute>-->
+
+  <!--</xs:attributeGroup>-->
+
+  <xs:element name="Event">
+    <xs:annotation>
+      <xs:documentation>The event class is the core class describing the event objects passed
+        around in an event.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiEvent" substitutionGroup="Event"/>
+
+  <xs:attributeGroup name="EventAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="EventManager">
+    <xs:annotation>
+      <xs:documentation>This is the core class for the UI event system. Attach this to a browser
+        window object to forward browser events to the correct component.
+        There is usually no need to use this class. It is created as needed by the
+        core components
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EventManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiEventManager" substitutionGroup="EventManager"/>
+
+  <xs:attributeGroup name="EventManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="allowBrowserContextMenu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to allow the browser's default context menu</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="captureComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component that currently has the mouse capture. It is
+          better to call setCapture
+          on the component directly.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="EventTarget">
+    <xs:annotation>
+      <xs:documentation>This class provides the functionality to add and remove event listeners
+        as well as dispatch events. When an event is dispatched the listeners
+        are notified.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EventTargetAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiEventTarget" substitutionGroup="EventTarget"/>
+
+  <xs:attributeGroup name="EventTargetAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+  </xs:attributeGroup>
+
+  <xs:element name="FlowPanel">
+    <xs:annotation>
+      <xs:documentation>This layout component flows its children from left to right and wraps to
+        the next row when no more children can fit on the current row. This
+        layout component uses the preferred size and it also takes margins into
+        account and uses margin collapsing so that two adjacent children share the
+        larger margin.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FlowPanelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFlowPanel" substitutionGroup="FlowPanel"/>
+
+  <xs:attributeGroup name="FlowPanelAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The align property decides how to size and position the children. This
+          describes the size and position in the in the ortogonal direction of the
+          box orientation. For a
+          horizontal box this describes the height and top position and for a vertical
+          layout this describes the width and left position
+          Valid values are:
+          stretch
+          start
+          center
+          end
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="vAlign" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The vAlign property decides how to position the lines of children if there
+          is any remaining vertical space.
+          Valid values are:
+          start/top
+          center
+          end/bottom
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="baselineAlign" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The baseline align describes how to do the vertical align of the items on
+          a row. This can be set for individual children as well using the attached
+          property.
+          Valid values are:
+          start/top
+          center
+          end/bottom
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="wrap" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to wrap the children to a new line if there isn't enough space to
+          put them all on the same line.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="FocusElementWrapper">
+    <xs:annotation>
+      <xs:documentation>This class is used when tabbing between Bindows components and plain HTML
+        elements. It creates an interface that is a subset ofBiComponent with the
+        required method needed to work with theBiFocusManager
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FocusElementWrapperAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFocusElementWrapper" substitutionGroup="FocusElementWrapper"/>
+
+  <xs:attributeGroup name="FocusElementWrapperAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="focused" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If the component can be focused then this makes the component
+          focused (if set to true). If the component was focused
+          and this is set to false then the component is blurred.
+          Changing this fires the focus
+          and blur events (depending on the
+          previous state).
+          A disabled component cannot recieve focus.
+          To be able to recieve focus the tabIndex
+          must be greater or equal to 0.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="FocusEvent">
+    <xs:annotation>
+      <xs:documentation>This class describes event objects used in focus events.
+        The focusin and focusout events bubble by default,
+        focus and blur do not.
+        All mouse events bubble by default. This means that once all the
+        event listeners have been notified the event propagates to the parent
+        BiComponent. To prevent the event to
+        bubble to the parent call
+        stopPropagation() on the event object.
+        The currently supported events by BiComponent
+        are: focus blur focusin focusout
+        The order these events occur, when a focused component is left and another
+        focused component takes the focus, is the following: focusout focusin blur focus
+        This object should not be created by the user. It is created as needed by the event system.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FocusEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFocusEvent" substitutionGroup="FocusEvent"/>
+
+  <xs:attributeGroup name="FocusEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="FocusManager">
+    <xs:annotation>
+      <xs:documentation>This class handles the focus management in Bindows
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FocusManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFocusManager" substitutionGroup="FocusManager"/>
+
+  <xs:attributeGroup name="FocusManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Font">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used with BiLabel to provide
+        the font style information.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FontAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFont" substitutionGroup="Font"/>
+
+  <xs:attributeGroup name="FontAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="size">
+      <xs:annotation>
+        <xs:documentation>The font size (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bold">
+      <xs:annotation>
+        <xs:documentation>Whether to use bold</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="italic">
+      <xs:annotation>
+        <xs:documentation>Whether to use italic</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="underline">
+      <xs:annotation>
+        <xs:documentation>Whether to underline the text</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="strikeout">
+      <xs:annotation>
+        <xs:documentation>Whether to line through the text</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="name">
+      <xs:annotation>
+        <xs:documentation>The name of the font. A comma seprated list also works</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="FpsGenerator">
+    <xs:annotation>
+      <xs:documentation>Frame generation engine, used for animation.
+        Each animation can have it's ownBiFpsGenerator or it can use the globalBiFpsGenerator.
+        Different animations can share the global generator, which saves system resources.
+        Use the factory method, instead of the constructor, to get the global generator.
+        The frame generator generates FrameProgressionEvents a certain
+        number of times per second, as specified by the framerate.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FpsGeneratorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFpsGenerator" substitutionGroup="FpsGenerator"/>
+
+  <xs:attributeGroup name="FpsGeneratorAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="frameRate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the frame rate.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onframeprogression" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired upon every new frame</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="FrameProgressionEvent">
+    <xs:annotation>
+      <xs:documentation>Event that denotifies a new frame during animation.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FrameProgressionEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFrameProgressionEvent" substitutionGroup="FrameProgressionEvent"/>
+
+  <xs:attributeGroup name="FrameProgressionEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge">
+    <xs:annotation>
+      <xs:documentation>
+        This control displays a gauge.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge" substitutionGroup="Gauge"/>
+
+  <xs:attributeGroup name="GaugeAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="minimumAngle">
+      <xs:annotation>
+        <xs:documentation>The angle where the minimum value is located</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximumAngle">
+      <xs:annotation>
+        <xs:documentation>The angle where the minimum value is located</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="majorTickInterval">
+      <xs:annotation>
+        <xs:documentation>The distance between the major ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minorTickInterval">
+      <xs:annotation>
+        <xs:documentation>The distance between the minor ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="labelInterval">
+      <xs:annotation>
+        <xs:documentation>The difference between the labels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="warningValue">
+      <xs:annotation>
+        <xs:documentation>This shows a red section on the gauge between the warning value and the maximum value</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showLabels">
+      <xs:annotation>
+        <xs:documentation>Whether to show the text labels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMajorTicks">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMinorTicks">
+      <xs:annotation>
+        <xs:documentation>Whether to show the minor ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showWarningSection">
+      <xs:annotation>
+        <xs:documentation>Whether to show the red section between the warning value and the maximum value</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum">
+      <xs:annotation>
+        <xs:documentation>The maximum value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum">
+      <xs:annotation>
+        <xs:documentation>The minimum value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value">
+      <xs:annotation>
+        <xs:documentation>The value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="plate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiGaugePlate - The plate of the gauge</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minorTicks" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiGaugeMinorTicks - The minor ticks of the gauge</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="majorTicks" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiGaugeMajorTicks - The major ticks of the gauge</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="needle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiGaugeNeedle - The needle of the gauge</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="title" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiGaugeTitle - The title of the gauge</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="labels" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiGaugeLabels - The labels of the gauge</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2">
+    <xs:annotation>
+      <xs:documentation>The gauge2 class, encapsulating the gauge2 structure
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2" substitutionGroup="Gauge2"/>
+
+  <xs:attributeGroup name="Gauge2Attributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="coordWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Coord width is the inner coord vertical max value</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="coordHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Coord width is the inner coord horizontal max value</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2BasicCap">
+    <xs:annotation>
+      <xs:documentation>This class creates a basic round cap
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2BasicCapAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2BasicCap" substitutionGroup="Gauge2BasicCap"/>
+
+  <xs:attributeGroup name="Gauge2BasicCapAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2CapAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2CircularBorder">
+    <xs:annotation>
+      <xs:documentation>This class creates an circular border.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2CircularBorderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2CircularBorder" substitutionGroup="Gauge2CircularBorder"/>
+
+  <xs:attributeGroup name="Gauge2CircularBorderAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2BorderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2Component">
+    <xs:annotation>
+      <xs:documentation>This class is the base of all classes residing inside aBiGauge2Group
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2Component" substitutionGroup="Gauge2Component"/>
+
+  <xs:attributeGroup name="Gauge2ComponentAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2Group">
+    <xs:annotation>
+      <xs:documentation>BiGauge2Group representing the main gauge2 vector graphic group
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2GroupAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2Group" substitutionGroup="Gauge2Group"/>
+
+  <xs:attributeGroup name="Gauge2GroupAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2ImageBorder">
+    <xs:annotation>
+      <xs:documentation>This class creates an image border
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2ImageBorderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2ImageBorder" substitutionGroup="Gauge2ImageBorder"/>
+
+  <xs:attributeGroup name="Gauge2ImageBorderAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2BorderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2Label">
+    <xs:annotation>
+      <xs:documentation>This class is used for creating labels
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2LabelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2Label" substitutionGroup="Gauge2Label"/>
+
+  <xs:attributeGroup name="Gauge2LabelAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="centerX" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The centerX property represents the x coordinate of the center of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="centerY" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The centerY property represents the y coordinate of the center of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text shown on the label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="labelSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The label size</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2LinearGradientFiller">
+    <xs:annotation>
+      <xs:documentation>This class creates a radial linear fill of theBiGauge2Component.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2LinearGradientFillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2LinearGradientFiller" substitutionGroup="Gauge2LinearGradientFiller"/>
+
+  <xs:attributeGroup name="Gauge2LinearGradientFillerAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2GradientFillerAttributes"/>
+
+    <xs:attribute name="angle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The angle of the linear filler</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2LinearNeedle">
+    <xs:annotation>
+      <xs:documentation>This class creates a linear needle.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2LinearNeedleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2LinearNeedle" substitutionGroup="Gauge2LinearNeedle"/>
+
+  <xs:attributeGroup name="Gauge2LinearNeedleAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2ValueMarkerAttributes"/>
+
+    <xs:attribute name="angle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The angle of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="needlePosition" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="needleBase" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The base width of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="needleHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2LinearRange">
+    <xs:annotation>
+      <xs:documentation>This class creates a radial range. The child "ticks" and "scales" inherits the angle.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2LinearRangeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2LinearRange" substitutionGroup="Gauge2LinearRange"/>
+
+  <xs:attributeGroup name="Gauge2LinearRangeAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2RangeAttributes"/>
+
+    <xs:attribute name="angle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Angle of the lineear range.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2LinearScale">
+    <xs:annotation>
+      <xs:documentation>This class is used for creating linear scales
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2LinearScaleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2LinearScale" substitutionGroup="Gauge2LinearScale"/>
+
+  <xs:attributeGroup name="Gauge2LinearScaleAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2ScaleAttributes"/>
+
+    <xs:attribute name="labelSpace" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The space between labels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="labelPosition" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position of the labels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="angle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The angle of the scale</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2LinearTicks">
+    <xs:annotation>
+      <xs:documentation>This class layout it's ticks in radial manner depeding on radius, start angle and end angle
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2LinearTicksAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2LinearTicks" substitutionGroup="Gauge2LinearTicks"/>
+
+  <xs:attributeGroup name="Gauge2LinearTicksAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2TicksAttributes"/>
+
+    <xs:attribute name="angle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Angle of the line on wich the ticks will be placed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="tickSpace" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The space between ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2PlainColorFiller">
+    <xs:annotation>
+      <xs:documentation>This class creates a plain color filler
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2PlainColorFillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2PlainColorFiller" substitutionGroup="Gauge2PlainColorFiller"/>
+
+  <xs:attributeGroup name="Gauge2PlainColorFillerAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2FillerAttributes"/>
+
+    <xs:attribute name="color" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The color that the filler is going to use.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RadialGradientFiller">
+    <xs:annotation>
+      <xs:documentation>This class creates a radial gradient fill of theBiGauge2Component.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RadialGradientFillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RadialGradientFiller" substitutionGroup="Gauge2RadialGradientFiller"/>
+
+  <xs:attributeGroup name="Gauge2RadialGradientFillerAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2GradientFillerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RadialNeedle">
+    <xs:annotation>
+      <xs:documentation>This class creates a radial needle
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RadialNeedleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RadialNeedle" substitutionGroup="Gauge2RadialNeedle"/>
+
+  <xs:attributeGroup name="Gauge2RadialNeedleAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2ValueMarkerAttributes"/>
+
+    <xs:attribute name="outerRadius" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Outer radius of the needle.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="innerRadius" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Inner radius of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="innerWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:EDIT_THIS - The inner width of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="outerWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:EDIT_THIS - The outer width of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The value of the needle.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RadialRange">
+    <xs:annotation>
+      <xs:documentation>This class creates a radial range. The child "ticks" and "scales" inherits the start- and end angles.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RadialRangeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RadialRange" substitutionGroup="Gauge2RadialRange"/>
+
+  <xs:attributeGroup name="Gauge2RadialRangeAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2RangeAttributes"/>
+
+    <xs:attribute name="startAngle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The startAngle of the range, this angle is where the radial range starts.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endAngle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The endAngle of the range, this angle is where the radial range ends.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RadialScaleSection">
+    <xs:annotation>
+      <xs:documentation>This class creates a radius scale
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RadialScaleSectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RadialScaleSection" substitutionGroup="Gauge2RadialScaleSection"/>
+
+  <xs:attributeGroup name="Gauge2RadialScaleSectionAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2ScaleSectionAttributes"/>
+
+    <xs:attribute name="radius" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The radius</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RadialTicks">
+    <xs:annotation>
+      <xs:documentation>This class layout it's ticks in radial maner depeding on radius, start angle and end angle
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RadialTicksAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RadialTicks" substitutionGroup="Gauge2RadialTicks"/>
+
+  <xs:attributeGroup name="Gauge2RadialTicksAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2TicksAttributes"/>
+
+    <xs:attribute name="startAngle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The start angle of the ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endAngle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The end angle of the ticks.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="radius" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The radius of the circle on wich the ticks is placed.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RectangularBorder">
+    <xs:annotation>
+      <xs:documentation>This class creates a rectangular border
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RectangularBorderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RectangularBorder" substitutionGroup="Gauge2RectangularBorder"/>
+
+  <xs:attributeGroup name="Gauge2RectangularBorderAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2BorderAttributes"/>
+
+    <xs:attribute name="rotation" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The rotation angle of the rectangular border</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RingGradientFiller">
+    <xs:annotation>
+      <xs:documentation>This class creates a radial gradient fill of theBiGauge2Component.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RingGradientFillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RingGradientFiller" substitutionGroup="Gauge2RingGradientFiller"/>
+
+  <xs:attributeGroup name="Gauge2RingGradientFillerAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2GradientFillerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugeLabels">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show the labels (the tick labels) for a gauge
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeLabelsAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugeLabels" substitutionGroup="GaugeLabels"/>
+
+  <xs:attributeGroup name="GaugeLabelsAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugeMajorTicks">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show the major ticks for a gauge
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeMajorTicksAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugeMajorTicks" substitutionGroup="GaugeMajorTicks"/>
+
+  <xs:attributeGroup name="GaugeMajorTicksAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugeMinorTicks">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show the minor ticks for a gauge
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeMinorTicksAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugeMinorTicks" substitutionGroup="GaugeMinorTicks"/>
+
+  <xs:attributeGroup name="GaugeMinorTicksAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugeNeedle">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show the needle of a gauge
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeNeedleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugeNeedle" substitutionGroup="GaugeNeedle"/>
+
+  <xs:attributeGroup name="GaugeNeedleAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="strokeColor">
+      <xs:annotation>
+        <xs:documentation>The stroke color of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor">
+      <xs:annotation>
+        <xs:documentation>The fill color of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value">
+      <xs:annotation>
+        <xs:documentation>The value of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugePlate">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to the plate (the background circle) for a gauge
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugePlateAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugePlate" substitutionGroup="GaugePlate"/>
+
+  <xs:attributeGroup name="GaugePlateAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="strokeColor">
+      <xs:annotation>
+        <xs:documentation>The color of the stroke (edge) of the plate</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor">
+      <xs:annotation>
+        <xs:documentation>The fill color of the plate</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugeSection">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show a section for a gauge.
+        A guage can have several sections and these are usually used to split
+        the gaguge values into logical value ranges.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeSectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugeSection" substitutionGroup="GaugeSection"/>
+
+  <xs:attributeGroup name="GaugeSectionAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="startValue">
+      <xs:annotation>
+        <xs:documentation>
+          The start value of the section
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endValue">
+      <xs:annotation>
+        <xs:documentation>
+          The end value of the section
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="color">
+      <xs:annotation>
+        <xs:documentation>The color of the section</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugeTitle">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show the title for a gauge
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeTitleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugeTitle" substitutionGroup="GaugeTitle"/>
+
+  <xs:attributeGroup name="GaugeTitleAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Graph">
+    <xs:annotation>
+      <xs:documentation>
+        This is the container used with graphs. The graph component contains
+        other components for the axes, legend, charts and more.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GraphAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGraph" substitutionGroup="Graph"/>
+
+  <xs:attributeGroup name="GraphAttributes">
+
+    <xs:attributeGroup ref="GraphBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Graph2">
+    <xs:annotation>
+      <xs:documentation>
+        This is a simpler graph control than BiGraph.
+        BiGraph2 works in Mozilla but it is a bit
+        more limited. For example, BiGraph2 does
+        not support line charts nor pie charts. Gradient fills are ignored
+        by BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Graph2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGraph2" substitutionGroup="Graph2"/>
+
+  <xs:attributeGroup name="Graph2Attributes">
+
+    <xs:attributeGroup ref="GraphBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GraphBase">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for BiGraph
+        and BiGraph2. If Mozilla support is needed
+        use BiGraph2. If line chart and/or pie chart
+        is needed then use BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GraphBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGraphBase" substitutionGroup="GraphBase"/>
+
+  <xs:attributeGroup name="GraphBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="autoScale">
+      <xs:annotation>
+        <xs:documentation>
+          Allows you turn off the automatic scaling of the graph
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fontSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number -
+          Sets the font size for the legend and axes. If autoScale
+          is true then this does not apply.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="series" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiChartSeries[] - This is an array containing the series used for the data of the graph.
+          After this property is changed the graph component needs to be updated.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="categories" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiChartCategory[] - This is an array containing the categories used for the data of the graph.
+          After this property is changed the graph component needs to be updated.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="points" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiChartPoint[] - This is an array containing the points used for the data of the graph.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="chartType">
+      <xs:annotation>
+        <xs:documentation>
+          The type of the chart. Available types are:
+          bar
+          column
+          grid
+          line
+          pie
+          percentagestackedbar
+          percentagestackedcolum
+          stackedbar
+          stackedcolumn
+          grid
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onpointclick" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user clicks on a point in the graph</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointcontextmenu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user right clicks on a point</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointdblclick" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user double clicks on a point</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointmousedown" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user presses down the mouse button on a point</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointmousemove" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user moves the mouse over a point</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointmouseout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Fires when the mouse pointer leaves a point
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointmouseover" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Fires when the mouse pointer enters a point
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointmouseup" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the releases the mouse button on a point</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointmousewheel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the user scrolls the mouse wheel over a point</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GraphContentArea">
+    <xs:annotation>
+      <xs:documentation>This component is used as a container for the graph content
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GraphContentAreaAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGraphContentArea" substitutionGroup="GraphContentArea"/>
+
+  <xs:attributeGroup name="GraphContentAreaAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Grid">
+    <xs:annotation>
+      <xs:documentation>This component is used to display a grid (table, column list). A grid
+        can show headers for both the columns and the rows. A grid also supports
+        selection of whole rows as well as of individual cells.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGrid" substitutionGroup="Grid"/>
+
+  <xs:attributeGroup name="GridAttributes">
+
+    <xs:attributeGroup ref="AbstractGridAttributes"/>
+
+    <xs:attribute name="selectionMode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets the selection mode. Allowed values are "cell" and "row".</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataSource" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDataSet /BiDataTable - The object to use as the data source. This can be a either a
+          BiDataTable or aBiDataSet (in which case the first table is used).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="currentDataPage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the current data page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataPageSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The amount of rows to show at one time from the data source.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected row/cell changes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondatabind" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Called after the component has been data bound</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Grid2">
+    <xs:annotation>
+      <xs:documentation>This component is a special case ofBiTreeView which has an interface which
+        is similar toBiGrid
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Grid2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGrid2" substitutionGroup="Grid2"/>
+
+  <xs:attributeGroup name="Grid2Attributes">
+
+    <xs:attributeGroup ref="TreeViewAttributes"/>
+
+    <xs:attribute name="columnCount" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of columns in the grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnNames" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The text to show on the headers of the grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnWidths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The widths of the columns of the grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnOrders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - The order of the columns. This an array containing the indexes of the
+          columns.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the headers for the grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showRowHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the row headers for the grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showGridLines" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show grid lines between the cells in the grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Grid2Cell">
+    <xs:annotation>
+      <xs:documentation>This is used for the cells in aBiGrid2Row row
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Grid2CellAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGrid2Cell" substitutionGroup="Grid2Cell"/>
+
+  <xs:attributeGroup name="Grid2CellAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="data" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The data that is associated with the cell</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Grid2DataModel">
+    <xs:annotation>
+      <xs:documentation>This data model is to be used withBiGrid2. It uses theBiGrid2Row and
+        BiGrid2Cell to provide the data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Grid2DataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGrid2DataModel" substitutionGroup="Grid2DataModel"/>
+
+  <xs:attributeGroup name="Grid2DataModelAttributes">
+
+    <xs:attributeGroup ref="TreeViewDataModelAttributes"/>
+
+    <xs:attribute name="treeView" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiGrid2 - The tree view the data model is acting on</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onrowcountchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event happens after
+          the number of rows has changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Grid2Row">
+    <xs:annotation>
+      <xs:documentation>This class is used as the data for rows in theBiGrid2 component
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Grid2RowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGrid2Row" substitutionGroup="Grid2Row"/>
+
+  <xs:attributeGroup name="Grid2RowAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Grid2ViewManager">
+    <xs:annotation>
+      <xs:documentation>This class is a special view manager to be used withBiGrid2
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Grid2ViewManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGrid2ViewManager" substitutionGroup="Grid2ViewManager"/>
+
+  <xs:attributeGroup name="Grid2ViewManagerAttributes">
+
+    <xs:attributeGroup ref="TreeViewViewManagerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridCell">
+    <xs:annotation>
+      <xs:documentation>This class represents a cell in a grid row.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridCellAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridCell" substitutionGroup="GridCell"/>
+
+  <xs:attributeGroup name="GridCellAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="data" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The data associated with the cell</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="backColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The background color name</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="foreColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The foreground color name</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the cell is selected or not. This should not be set when
+          the selection mode for the grid is set to row selection.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridChart">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to display a grid containing the values in a graph.
+        Each series in the graph is shown as a row
+        in the grid and each point is shown as a cell.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridChart" substitutionGroup="GridChart"/>
+
+  <xs:attributeGroup name="GridChartAttributes">
+
+    <xs:attributeGroup ref="GridAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridChartCell">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to display a cell in a grid chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridChartCellAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridChartCell" substitutionGroup="GridChartCell"/>
+
+  <xs:attributeGroup name="GridChartCellAttributes">
+
+    <xs:attributeGroup ref="GridCellAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridChartRow">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to display a row in a grid chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridChartRowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridChartRow" substitutionGroup="GridChartRow"/>
+
+  <xs:attributeGroup name="GridChartRowAttributes">
+
+    <xs:attributeGroup ref="GridRowAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridColumn">
+    <xs:annotation>
+      <xs:documentation>This class is used to describe columns forBiGrid andBiTree.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridColumnAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridColumn" substitutionGroup="GridColumn"/>
+
+  <xs:attributeGroup name="GridColumnAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The alignment of the content inside the column.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="name" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the column. This is the same as the text shown on
+          the header.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="width" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the column.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="indentColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Whether the current column is the indent column in the grid.
+          This is ignored when using the columns for a non tree.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="iconColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Whether the current column is the icon column in the grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="visible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the column is visible or not.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The type of the data in the column. This is used to decide how
+          to sort the data in the column. Built in support for the following
+          types: string caseInsensitiveString number date - Uses the native JS Date type
+          To get better control over the sorting create a subclass that
+          overrides the sortFunction getter.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridDataModel">
+    <xs:annotation>
+      <xs:documentation>This data model takes an array of arrays containing the text for a grid. This data model is to be used
+        withBiTreeView
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridDataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridDataModel" substitutionGroup="GridDataModel"/>
+
+  <xs:attributeGroup name="GridDataModelAttributes">
+
+    <xs:attributeGroup ref="TreeViewDataModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridHeader">
+    <xs:annotation>
+      <xs:documentation>This represents a header cell for the
+        headers of a
+        grid or a tree.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridHeaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridHeader" substitutionGroup="GridHeader"/>
+
+  <xs:attributeGroup name="GridHeaderAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="resizable" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the user can resize the current header.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortable" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the user can click on the header to sort by that column.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="movable" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the user can move the current header.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ascending" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true a down arrow is shown as the icon
+          of the header. When false an up arrow and when
+          null no icon is shown.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ascendingIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage - The icon to use for the sort arrow when sorting ascendingly</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="descendingIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage - The icon to use for the sort arrow when sorting descendingly</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridHeaderCorner">
+    <xs:annotation>
+      <xs:documentation>This component is used to paint the upper left corner of the headers
+        in case both row headers and column headers are visible for a grid.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridHeaderCornerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridHeaderCorner" substitutionGroup="GridHeaderCorner"/>
+
+  <xs:attributeGroup name="GridHeaderCornerAttributes">
+
+    <xs:attributeGroup ref="GridHeaderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridHeaderFiller">
+    <xs:annotation>
+      <xs:documentation>This component is used to fill the headers
+        in case the widths of the header cells do not cover the entire width of
+        the headers.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridHeaderFillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridHeaderFiller" substitutionGroup="GridHeaderFiller"/>
+
+  <xs:attributeGroup name="GridHeaderFillerAttributes">
+
+    <xs:attributeGroup ref="GridHeaderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridHeaders">
+    <xs:annotation>
+      <xs:documentation>This class represents the headers for a grid
+        or a tree.
+        The headers contain several header cells.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridHeadersAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridHeaders" substitutionGroup="GridHeaders"/>
+
+  <xs:attributeGroup name="GridHeadersAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="fitColumnWidths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true the column widths are distributed so that the fill the
+          width of the grid
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnCount" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of columns in the header</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnWidths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - The widths of the cell headers in the headers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnOrders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - The order in which the cell headers should be displayed in. A
+          value of [2,0,1] means that the third cell comes first,
+          then comes the first cell and last the second.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the column that should show the sort arrow.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ascending" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If this is true then the sorting should be done
+          ascending, if false descending and if null
+          no sort. This is also reflected on the ascending property for the
+          header this applies to.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="oncolumnwidthschanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the column widths are changed. This happens when either
+          the user has finished resized a column or the column widths are
+          changed through script.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncolumnorderschanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the column orders are changed. This happens when either
+          the user has reordered the columns or the order is
+          changed through script.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onsortcolumnchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the sort column is changed. This happens when either
+          the user has clicks on a sortable column or the sort column is
+          changed through script.
+          Note that when the user clicks on the currently sorted column this
+          event is not fired. Instead the ascendingchanged event
+          is triggered because the sorting is changed from ascending to
+          descending or the other way around.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onascendingchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the ascending property changes. This happens when either
+          the user clicks on a column header cell that is already sorted or
+          this property is changed through script.
+          Note that if the ascending property changed due to
+          a change of the sortColumn this event is not fired.
+          This is by design to prevent preformance issues.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncolumnwidthschanging" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the column widths are changing. This happens when
+          the user is resizing a column.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridPanel">
+    <xs:annotation>
+      <xs:documentation>This layout component positions and sizes its children in a simple grid where
+        the columns and rows are decided using string patterns much
+        like the way the rows and cols attribute for HTML framesets decides the
+        size and position of the frames.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridPanelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridPanel" substitutionGroup="GridPanel"/>
+
+  <xs:attributeGroup name="GridPanelAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="hGap" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The horizontal gap between the columns</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="vGap" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The vertical gap between the rows</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cols" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is a string representing the column widths. It is a comma seperated
+          string of column sizes. See the remarks for more info.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rows" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is a string representing the row heights. It is a comma seperated
+          string of row sizes. See the remarks for more info.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridPanel2">
+    <xs:annotation>
+      <xs:documentation>BiGridPanel2 is a layout component based onBiGridPanel.
+        It works similair to a html table. A layout is created by
+        adding rows and cells to the Panel. Cells and rows can have
+        padding, colspan, rowspan, alignment etc. Defaults can also
+        be set on the grid panel itself.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridPanel2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridPanel2" substitutionGroup="GridPanel2"/>
+
+  <xs:attributeGroup name="GridPanel2Attributes">
+
+    <xs:attributeGroup ref="GridPanelAttributes"/>
+
+    <xs:attribute name="cellPadding" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Padding for cells in the grid. Individual rows and cells can override this.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Horizontal alignment for cells in the grid. Individual rows and cells can
+          override this.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="valign" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Vertical alignment for cells in the grid. Individual rows and cells can
+          override this.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridPanel2Cell">
+    <xs:annotation>
+      <xs:documentation>A cell in aBiGridPanel2Cell
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridPanel2CellAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridPanel2Cell" substitutionGroup="GridPanel2Cell"/>
+
+  <xs:attributeGroup name="GridPanel2CellAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="cellPadding" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Padding for a cell.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="contentComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - Component in the cell.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stretch" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:string - How the content component should be stretched.
+          Possible settings are:
+          none, both, horizontal, vertical
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="parent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiGridPanel2Row - The row this cell was added to.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="colSpan" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - ColSpan of the cell. The cell will span colspan number of columns horizontally.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rowSpan" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Rowspan of a cell. The cell spans rowspan number of rows vertically.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The horizontal alignment of the cell. Possible values are:
+          left
+          center
+          right
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="valign" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The vertical alignment of the cell. Possible values are:
+          top
+          center
+          middle
+          bottom
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="preferredWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The preferred width of the cell. Defaulted to the preferredWidth
+          of the content component, plus any padding it needs.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="preferredHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Preferred height of the cell. Defaults to preferredHieght of the
+          content component plus padding it needs.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridPanel2Row">
+    <xs:annotation>
+      <xs:documentation>A row of cells in aBiGridPanel2
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridPanel2RowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridPanel2Row" substitutionGroup="GridPanel2Row"/>
+
+  <xs:attributeGroup name="GridPanel2RowAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="cellPadding" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Padding for cells in the row. Individual cells can override this.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The horizontal alignment for cells in the row. Individual cells can
+          override this. SeeBiGridPanel2Cell for specific settings.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="valign" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The vertical alignment for cells in the row. Individual cells can
+          override this. SeeBiGridPanel2Cell for settings.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridRow">
+    <xs:annotation>
+      <xs:documentation>This class represents the rows inBiGrid. Each row contains
+        cells that contains the text to show for
+        the column.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridRowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridRow" substitutionGroup="GridRow"/>
+
+  <xs:attributeGroup name="GridRowAttributes">
+
+    <xs:attributeGroup ref="AbstractGridRowAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridRowHeaders">
+    <xs:annotation>
+      <xs:documentation>This component is used to paint the grid row headers for a grid.
+        The component asks the BiGridRow for the HTML
+        for each item by calling getRowHeaderHtml.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridRowHeadersAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridRowHeaders" substitutionGroup="GridRowHeaders"/>
+
+  <xs:attributeGroup name="GridRowHeadersAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridSelectionModel">
+    <xs:annotation>
+      <xs:documentation>This class handles the selection of rows
+        or cells in a grid.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridSelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridSelectionModel" substitutionGroup="GridSelectionModel"/>
+
+  <xs:attributeGroup name="GridSelectionModelAttributes">
+
+    <xs:attributeGroup ref="SelectionModelAttributes"/>
+
+    <xs:attribute name="selectionMode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The grid selection model supports both selection entire rows
+          and individual grid cells. Valid values are:
+          row
+          cell
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GroupBox">
+    <xs:annotation>
+      <xs:documentation>This class is used for creating group boxes. A group box is a container
+        with a border and possibly a title at the top.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GroupBoxAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGroupBox" substitutionGroup="GroupBox"/>
+
+  <xs:attributeGroup name="GroupBoxAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="groupBoxTitle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiGroupBoxTitle - This property points to theBiGroupBoxTitle component which handles the title
+          of the group box.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="titlePosition" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The position of the title. Valid values are: left center right</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets the text of the title. Setting this to null removes the title.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GroupBoxTitle">
+    <xs:annotation>
+      <xs:documentation>This component is used with theBiGroupBox to handle the title.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GroupBoxTitleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGroupBoxTitle" substitutionGroup="GroupBoxTitle"/>
+
+  <xs:attributeGroup name="GroupBoxTitleAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="titlePosition" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The position of the title. Valid values are: left center right</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="HashTable">
+    <xs:annotation>
+      <xs:documentation>This is a basci implementation of a hash table. It works around a known
+        bug in IE/JScript that causes IE to leak memory when using Objects as hashes
+        in javascript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="HashTableAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiHashTable" substitutionGroup="HashTable"/>
+
+  <xs:attributeGroup name="HashTableAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="HBox">
+    <xs:annotation>
+      <xs:documentation>This is a horizontalBiBox where components are laid out from left to right
+        (or right to left if rightToLeft
+        is true).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="HBoxAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiHBox" substitutionGroup="HBox"/>
+
+  <xs:attributeGroup name="HBoxAttributes">
+
+    <xs:attributeGroup ref="BoxAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Iframe">
+    <xs:annotation>
+      <xs:documentation>
+        This component allows usage of an HTML 4 iframe element. This allows
+        any document/file that is supported by the platform to be shown inside a
+        component.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="IframeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiIframe" substitutionGroup="Iframe"/>
+
+  <xs:attributeGroup name="IframeAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiUri -
+          The URI to the file to show inside the frame. If this is set to a string a
+          new URI is created from that string relative to the
+          ADF path.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Happens when the iframe is loaded. Note that this might fire more
+          often than one might expect so be sure to check that you really
+          want your code run when the event is fired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Image">
+    <xs:annotation>
+      <xs:documentation>This class is used for showing images.
+        Supported image types are GIF, JPEG and PNG (including support for 32-bit RGBA).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImageAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImage" substitutionGroup="Image"/>
+
+  <xs:attributeGroup name="ImageAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="alt" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The alternate text which is read out instead of the image when Bindows is
+          in accessibility mode.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The location of the image file. If this is set to a string a
+          new URI is created from that string relative to the
+          ADF path.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the image loads. Note that the image file may be
+          loaded before the constructor finishes and you should not only
+          rely on this event but also use loaded property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onerror" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the image failed to load.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImageLoader">
+    <xs:annotation>
+      <xs:documentation>This class loads an image file to memory
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImageLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImageLoader" substitutionGroup="ImageLoader"/>
+
+  <xs:attributeGroup name="ImageLoaderAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The URI (location) of the file to load. If this is set to a string a
+          new URI is created from that string relative to the
+          ADF path.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the file has been loaded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImageMap">
+    <xs:annotation>
+      <xs:documentation>This class emulates the classic image map found in HTML.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImageMapAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImageMap" substitutionGroup="ImageMap"/>
+
+  <xs:attributeGroup name="ImageMapAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImageMapArea">
+    <xs:annotation>
+      <xs:documentation>This class represents a particular area on an image map.
+
+        This class supports the following events:-
+        mousemove
+        mousedown
+        mouseover
+        mouseout
+        click
+        contextmenu
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImageMapAreaAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImageMapArea" substitutionGroup="ImageMapArea"/>
+
+  <xs:attributeGroup name="ImageMapAreaAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="cursor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The cursor to show when the mouse hovers over this area</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImageMapEvent">
+    <xs:annotation>
+      <xs:documentation>This type of event is fired when UI events (mousemove, mousedown, etc) are fired on
+        the image that is associated with an image map.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImageMapEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImageMapEvent" substitutionGroup="ImageMapEvent"/>
+
+  <xs:attributeGroup name="ImageMapEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImagePreloader">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles preloading of an image. There will never be more than
+        one instance of this class per image URI. So if there already exists a
+        preloader for the given URI that will be returned.
+        Since there might be other objects dependent on the current instance it
+        is not a good idea to call dispose on the instance object. Disposal is
+        handled by the system.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImagePreloaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImagePreloader" substitutionGroup="ImagePreloader"/>
+
+  <xs:attributeGroup name="ImagePreloaderAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the image file loads</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onerror" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires if the image file fails to load</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImagePreloaderManager">
+    <xs:annotation>
+      <xs:documentation>
+        A singleton class that handles the BiImagePreloader
+        instances
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImagePreloaderManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImagePreloaderManager" substitutionGroup="ImagePreloaderManager"/>
+
+  <xs:attributeGroup name="ImagePreloaderManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InlineComponent">
+    <xs:annotation>
+      <xs:documentation>This class is used to create components that can be used in the
+        inline flow of the HTML document hosting the application.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InlineComponentAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiInlineComponent" substitutionGroup="InlineComponent"/>
+
+  <xs:attributeGroup name="InlineComponentAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="inlineId" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is the id that the HTML element acting as the container is
+          having. Don't change this after the component has been added
+          to the application window.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="InlineEditModel">
+    <xs:annotation>
+      <xs:documentation>This class is used to handle inline editing in aBiTreeView and aBiOlapGrid.
+        This class provides editing by using one attached component at a time.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InlineEditModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiInlineEditModel" substitutionGroup="InlineEditModel"/>
+
+  <xs:attributeGroup name="InlineEditModelAttributes">
+
+    <xs:attributeGroup ref="AttachedComponentModelAttributes"/>
+
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The value of the currently editing cell</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onbeforeshow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is dispatched before the editing
+          component is added to theBiTreeView component
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the value of the
+          currently editing cell has changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforehide" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This happens before the editing component is
+          hidden. If the default action is prevented here
+          the component is not removed from the tree view
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onhide" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When the editing component has been removed/hidden.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="IpField">
+    <xs:annotation>
+      <xs:documentation>This component is used to enter an IPv4 address. The control consists of different text fields
+        for the different parts of the address.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="IpFieldAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiIpField" substitutionGroup="IpField"/>
+
+  <xs:attributeGroup name="IpFieldAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="ip" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The IP address that is shown in the IP field.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the enter key is pressed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the IP field is blurred
+          and the text has changed since the IP field got
+          focus.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfieldchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the active field of the
+          component changes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ontextchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the text has changed.
+          This happens when the user in some way changes
+          the text inside the IP field. This event
+          is fired continiously as the user types.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oninvalidinput" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired if an invalid character is typed or
+          invalid text is pasted into the IP field.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Json">
+    <xs:annotation>
+      <xs:documentation>This class is used to serialize and deserialize javascript objects from and
+        to a JSON string. JSON stands for JavaScript Notation Format and you can find
+        more information at http://json.org.
+        When serializing objects we check if the object has a serialize
+        method and if so we use that instead.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="JsonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiJson" substitutionGroup="Json"/>
+
+  <xs:attributeGroup name="JsonAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="JsonLoader">
+    <xs:annotation>
+      <xs:documentation>Loads a JSON file and returns the javascript object that the JSON file
+        describes.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="JsonLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiJsonLoader" substitutionGroup="JsonLoader"/>
+
+  <xs:attributeGroup name="JsonLoaderAttributes">
+
+    <xs:attributeGroup ref="TextLoaderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="KeyboardEvent">
+    <xs:annotation>
+      <xs:documentation>
+        This class describes event object used in keyboard events.
+        All keyboard events bubble by default. This means that once all the
+        event listeners have been notified the event propagates to the parent
+        BiComponent. To prevent the event to
+        bubble to the parent call
+        stopPropagation() on the event object.
+        The currently supported keyboard events by BiComponent
+        are: keydown keypress keyup
+        This object should not be created by the user. It is created as needed by the event system.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="KeyboardEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiKeyboardEvent" substitutionGroup="KeyboardEvent"/>
+
+  <xs:attributeGroup name="KeyboardEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="L10nLoader">
+    <xs:annotation>
+      <xs:documentation>This class handles the loading and interpretation of localization templates files.
+        This loader search for language specific template file i.e..
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="L10nLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiL10nLoader" substitutionGroup="L10nLoader"/>
+
+  <xs:attributeGroup name="L10nLoaderAttributes">
+
+    <xs:attributeGroup ref="XmlLoaderAttributes"/>
+
+    <xs:attribute name="language" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The desired language, otherwise the browser language is used.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="defaultLanguage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The desired default language. The default langugae will be used if no localization template file can
+          be found using the language property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="prefix" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Prefix of the localization template files, the loader will search for files named</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="L10nString">
+    <xs:annotation>
+      <xs:documentation>This class converts a localization template to a string.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="L10nStringAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiL10nString" substitutionGroup="L10nString"/>
+
+  <xs:attributeGroup name="L10nStringAttributes">
+
+    <xs:attribute name="name" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String : The localization template name - Sets the localization template name.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Label">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to show text
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LabelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLabel" substitutionGroup="Label"/>
+
+  <xs:attributeGroup name="LabelAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="text">
+      <xs:annotation>
+        <xs:documentation>The plain text shown on the label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="html">
+      <xs:annotation>
+        <xs:documentation>The HTML text shown on the label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="mnemonic">
+      <xs:annotation>
+        <xs:documentation>A character used to give UI hints about the access key for the label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="font" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiFont - This is used to describe how to paint the text on the label.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="labelFor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiComponent - If this is set then focusing on the current label moves the focus to another component
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="wrap">
+      <xs:annotation>
+        <xs:documentation>Whether to wrap the text if the label is not wide enough</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingLeft">
+      <xs:annotation>
+        <xs:documentation>The left padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingRight">
+      <xs:annotation>
+        <xs:documentation>The right padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingTop">
+      <xs:annotation>
+        <xs:documentation>The top padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingBottom">
+      <xs:annotation>
+        <xs:documentation>The bottom padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align">
+      <xs:annotation>
+        <xs:documentation>
+          The text alignment. Valid values are: left right center justify
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="verticalAlign">
+      <xs:annotation>
+        <xs:documentation>
+          NOT IMPLEMENTED
+          The vertical text alignment. Valid values are: top middle bottom
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiImage - The icon image to show on the label. Note that changing
+          the image object does not update the label icon. You'll have to
+          set the icon property to update the label icon.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="iconPosition">
+      <xs:annotation>
+        <xs:documentation>
+          The position of the icon relative to the text. Valid values are: left right top bottom
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="iconTextGap">
+      <xs:annotation>
+        <xs:documentation>The gap between the icon and the text (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Launcher">
+    <xs:annotation>
+      <xs:documentation>This class can be used to create a launcher for launching Bindows applications
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LauncherAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLauncher" substitutionGroup="Launcher"/>
+
+  <xs:attributeGroup name="LauncherAttributes">
+
+    <xs:attribute name="reuseWindow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to reuse a previously opened window. If you want to launch
+          the new application in the current window set newWindow to
+          false.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="newWindow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to launch the application in a new window</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rootPath" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The path where Bindows resides. This is usually the path where bimain.html
+          can be found.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="adfPath" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The path to the ADF file.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="adfName" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The ADF name is taken from the ADF path</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="arguments" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The arguments to pass to the main method of the ADF</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="target" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The target name of the window or frame to open the application in. If this is ""
+          or null the ADF name will be used instead. If reuseWindow
+          is false then this property will be ignored.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accessibilityMode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - This property can be used to tell whether the application should be in an
+          accessibility mode.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="focusOnLoad" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to try to focus the window when the application loads</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Line">
+    <xs:annotation>
+      <xs:documentation>ABiLine contains screen coordinates. It can be used to store eg. a line.
+        This class is used in animation.
+        Storage is implemented as a stack where you add points at the end.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LineAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLine" substitutionGroup="Line"/>
+
+  <xs:attributeGroup name="LineAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="LineChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a line chart for the given series
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LineChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLineChart" substitutionGroup="LineChart"/>
+
+  <xs:attributeGroup name="LineChartAttributes">
+
+    <xs:attributeGroup ref="AbstractChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="LineMarker">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the components used to show the markers for a
+        line chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LineMarkerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLineMarker" substitutionGroup="LineMarker"/>
+
+  <xs:attributeGroup name="LineMarkerAttributes">
+
+    <xs:attributeGroup ref="AbstractChartSectionAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Link">
+    <xs:annotation>
+      <xs:documentation>This class represents the relationship between two components that are to be linked by a link line.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LinkAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLink" substitutionGroup="Link"/>
+
+  <xs:attributeGroup name="LinkAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="startComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The first ("left") component that is part of this link.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The second ("right") component that is part of this link.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="line" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDrawLine - The line used to link the components.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="startAnchor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The anchor point on startComponent which line anchors to.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endAnchor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The anchor point on endComponent which line anchors to.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="direction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The direction of this link.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="LinkManager">
+    <xs:annotation>
+      <xs:documentation>This class is a component that holds linked components. It also manages the links involved with these components.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LinkManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLinkManager" substitutionGroup="LinkManager"/>
+
+  <xs:attributeGroup name="LinkManagerAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="List">
+    <xs:annotation>
+      <xs:documentation>This is a list component that can contain BiListItem
+        objects. It uses the normal object model and can therefore be extended and
+        used just like any other component. The only limitation is that the the direct
+        children should only be of type BiListItem
+        and the size and position of these should not be changed.
+        The list uses a BiListSelectionModel
+        that handles the selection.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ListAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiList" substitutionGroup="List"/>
+
+  <xs:attributeGroup name="ListAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="allowInlineFind" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When true, typing a word will select the first matching item.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Used to decide how to sort the list items. It is used when calling sort()
+          if the sortFunction property has not been set to a function.
+          If the list items has its userValue property set, it has precedence over its
+          text property in being the value that is compared
+          Built in support for the following
+          types: string (default) caseInsensitiveString number date - Uses the native JS Date type
+          To get better control over the sorting, define a function and set
+          the sortFunction property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortFunction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Function - Sets a property which is a function used to compare two listItems.
+          This function should take two arguments and return a
+          number (just like the normal comparison function used when sorting
+          arrays in JavaScript). If this property is not set, it uses the predefined
+          functions set by the sortType property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - This is the userValue of
+          the first selected list item.
+          If no item is selected then this returns null.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectionModel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiListSelectionModel - This handles the selection of the items in the list</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="multipleSelection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the list supports multiple selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataTextField" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the column to use as the data for the text property
+          of the BiListItems.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataUserValueField" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the column to use as the data for the userValue
+          property of the BiListItems.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataSource" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDataTable /BiDataSet - The object to use as the data source. This can be a either a
+          BiDataTable or a
+          BiDataSet (in which case the
+          first table is used).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataPageSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The amount of rows to show at one time from the data source.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="currentDataPage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the current data page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected items change</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondatabind" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Called after the component has been data bound</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ListItem">
+    <xs:annotation>
+      <xs:documentation>This class is used for the items in a list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ListItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiListItem" substitutionGroup="ListItem"/>
+
+  <xs:attributeGroup name="ListItemAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="visible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the item is visible or not. Note that all the ancestors must be
+          visible for the component to be actually shown. Use isVisible to
+          check that the item is shown.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the item is selected or not</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - A value associated with the list item. This is not the text on the item. To
+          change the text use the text
+          property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the item is double
+          clicked or when enter is pressed
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ListSelectionModel">
+    <xs:annotation>
+      <xs:documentation>This class handles the selection for lists
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ListSelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiListSelectionModel" substitutionGroup="ListSelectionModel"/>
+
+  <xs:attributeGroup name="ListSelectionModelAttributes">
+
+    <xs:attributeGroup ref="SelectionModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="LoadManager">
+    <xs:annotation>
+      <xs:documentation>This singleton class is used to keep track of loading of resources
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LoadManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLoadManager" substitutionGroup="LoadManager"/>
+
+  <xs:attributeGroup name="LoadManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="loadPerDomain" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is is the number of requests that can be loaded at the same time from
+          the same domain
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="LocationAnimator">
+    <xs:annotation>
+      <xs:documentation>Animates the location ofBiComponents to create movement.
+        This class has a repository of motion paths. A motion path is created by setting start and end
+        screen coordinates. Objects will be animated between these in a straight line.
+        Motion paths are stored in a stack where the first motion path, called the default motion path,
+        is created upon construction.
+        The default motion path can be changed and modified dynamically via getter/setter function,
+        whereas additional motion paths can only be either added or removed. For each motion path you have
+        independent control over speed and acceleration algorithms.
+        By pushing more motion paths onto the stack you can make the object animate around multiple
+        positions on the screen and create complex movement.
+        To animate a component, you create the animator object and add componen(s) to it, then start the animation.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LocationAnimatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLocationAnimator" substitutionGroup="LocationAnimator"/>
+
+  <xs:attributeGroup name="LocationAnimatorAttributes">
+
+    <xs:attributeGroup ref="ComponentAnimationAttributes"/>
+
+    <xs:attribute name="fromX" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Starting point's X position measured in pixels.
+          Modifies the default motion path, that components will be animated between.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromY" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Starting point's Y position measured in pixels.
+          Modifies the default motion path, that components will be animated between.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toX" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Ending point's X position measured in pixels.
+          Modifies the default motion path, that components will be animated between.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toY" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Ending point's Y position measured in pixels.
+          Modifies the default motion path, that components will be animated between.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Changes the acceleration type for the default motion path.
+          Use one of the acceleration constants defined inBiComponentAnimation
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="speed" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number/String - Changes the speed of the default motion path.
+          Time measured in milliseconds it should take to complete
+          the animation of the default motion path.
+          It Could also be a string with the following values:
+          slowest, slow, normal, fast, fastest
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="type" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets both the speed and the acceleration type for the animation.
+          Can be either: "normal" or "smooth"
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - Instead of using absolute window positions, you can position the animation relative
+          another components position. By setting the from-component you specify anotherBiComponent
+          whos location will be used for the animation's start state.
+          If the from-component's location or size is changed, the animation
+          will update dynamically. By default the top left corner of the from-component will be this
+          animation's start x/y.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - Instead of using absolute window positions, you can position the animation relative
+          another components position. By setting the to-component you specify anotherBiComponent
+          whos location will be used for the animation's target state.
+          If the to-component's location or size is changed, the animation
+          will update dynamically. By default the top left corner of the to-component will be this
+          animation's end x/y.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation start y position relative to either a from-component, if set. Otherwise
+          top relates to the browser's viewport. Setting top cancels bottom.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation end y position relative to either a to-component, if set. Otherwise
+          top relates to the browser's viewport. Setting top cancels bottom.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation start x position relative to either a from-component, if set. Otherwise
+          left relates to the browser's viewport. Setting left cancels right.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation end x position relative to either a to-component, if set. Otherwise
+          left relates to the browser's viewport. Setting left cancels right.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromBottom" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation start y position relative to either a from-component, if set. Otherwise
+          bottom relates to the browser's viewport. Setting bottom cancels top.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toBottom" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation end y position relative to either a to-component, if set. Otherwise
+          bottom relates to the browser's viewport. Setting bottom cancels top.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromRight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation start x position relative to either a from-component, if set. Otherwise
+          right relates to the browser's viewport. Setting right cancels left.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toRight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation end x position relative to either a to-component, if set. Otherwise
+          right relates to the browser's viewport. Setting right cancels left.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Math">
+    <xs:annotation>
+      <xs:documentation>Collection of static functions used in various math operations.
+        Used heavily in the animation library for example.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MathAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMath" substitutionGroup="Math"/>
+
+  <xs:attributeGroup name="MathAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Menu">
+    <xs:annotation>
+      <xs:documentation>This class represents a menu. Menus can be filled with menu items by
+        addingBiMenuItem objects.
+        The content model for the menu is very similiar to the content model for
+        BiComponent but there are slight differences.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MenuAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMenu" substitutionGroup="Menu"/>
+
+  <xs:attributeGroup name="MenuAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="visible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Shows or hides the menu</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="left" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets or gets the left position of the menu relative to the screen</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="top" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets or gets the top position of the menu relative to the screen</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="width" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the menu</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="height" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The heightof the menu</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightToLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Describes whether the component should be be layed out to support
+          locales using right-to-left fonts. If this is set to null
+          then the rightToLeft property for the parent component
+          is used.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onshow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the menu is shown</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforeshow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the menu is shown.
+          This is a good place to change the content of the menu to reflect the
+          component causing the menu to be shown
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onhide" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the menu is hidden</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MenuBar">
+    <xs:annotation>
+      <xs:documentation>This class is used to display a menu bar
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MenuBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMenuBar" substitutionGroup="MenuBar"/>
+
+  <xs:attributeGroup name="MenuBarAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MenuButton">
+    <xs:annotation>
+      <xs:documentation>This class is used for displaying the buttons of a menu bar.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MenuButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMenuButton" substitutionGroup="MenuButton"/>
+
+  <xs:attributeGroup name="MenuButtonAttributes">
+
+    <xs:attributeGroup ref="MenuItemAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MenuItem">
+    <xs:annotation>
+      <xs:documentation>Represents a menu item for a menu.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MenuItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMenuItem" substitutionGroup="MenuItem"/>
+
+  <xs:attributeGroup name="MenuItemAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The plain text to show on the menu item</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="html" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The html text to show on the menu item</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage - The icon image to show on the menu item. Note that changing
+          the image object does not update the label icon. You'll have to
+          set the icon property to update the label icon. The size of the icon
+          of the menu item is currently fixed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="mnemonic" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - A character used to give UI hints about the access key for the menu label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="subMenu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiMenu - The menu that should be opened as a sub menu when the current menu is selected.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="visible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Shows or hides the menu item</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="enabled" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the component is enabled or not. When this is changed the
+          component fires the enabledchanged event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="shortcutText" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The shortcut text is shown on the menu to give the user a hint about
+          keyboard shortcuts. Setting this on the menu just adds the text. It
+          does not set up the keyboard shortcut.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toolTipText" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text to show as a tool tip for the menu item.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the menu item is clicked or invoked using the keyboard</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onenabledchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the enabled property is changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MenuSeparator">
+    <xs:annotation>
+      <xs:documentation>This class is used to display a separator inside a menu
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MenuSeparatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMenuSeparator" substitutionGroup="MenuSeparator"/>
+
+  <xs:attributeGroup name="MenuSeparatorAttributes">
+
+    <xs:attributeGroup ref="MenuItemAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MouseEvent">
+    <xs:annotation>
+      <xs:documentation>This class describes event objects used in mouse events.
+        All mouse events bubble by default. This means that once all the
+        event listeners have been notified the event propagates to the parent
+        BiComponent. To prevent the event to
+        bubble to the parent call
+        stopPropagation() on the event object.
+        The currently supported events by BiComponent
+        are: mousedown mouseup click dblclick contextmenu - this one is a bit tricky since it might also be dispatched when the user presses
+        the context menu key on their keyboard mouseover mouseout mousemove mousewheel
+        When a user double clicks on a component the order of the mouse events is
+        the following: mousedown mouseup click mousedown mouseup click dblclick
+        This object should not be created by the user. It is created as needed by the event system.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MouseEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMouseEvent" substitutionGroup="MouseEvent"/>
+
+  <xs:attributeGroup name="MouseEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MoveHandle">
+    <xs:annotation>
+      <xs:documentation>This component can be used to allow another component to become movable
+        using the mouse. The component can be used as a move handle for the
+        component to move. It can also be used without adding it to another
+        component by manually calling startMove in a mouse down
+        event handler.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MoveHandleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMoveHandle" substitutionGroup="MoveHandle"/>
+
+  <xs:attributeGroup name="MoveHandleAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="continuousLayout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Indicates that the ghost must be used to be a visual indicator for the duration of the move
+          operation.
+          Once complete, the original component's location will be updated accordingly.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ghost" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component that should be visually updated if continuousLayout is set to false.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="handleFor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component that the handle should be a move handle for.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="moveDirection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The direction the component can be moved. Possible values are: vertical horizontal both.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onbeforemove" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires continually during the moving of the component. Call
+          preventDefault
+          on the event object to prevent the new location from being applied.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmove" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires continually during the moving of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmoveend" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the movement is ended.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmovestart" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired before the movement is started. To prevent this
+          from being moved call preventDefault
+          on the event object.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Object">
+    <xs:annotation>
+      <xs:documentation>This is the core class of all Bindows classes. This class provides
+        some useful methods over the standard Javascript Object.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ObjectAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiObject" substitutionGroup="Object"/>
+
+
+  <xs:attributeGroup name="ObjectAttributes">
+
+    <xs:attribute name="id" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - An identifier for the object. Be careful when changing this because
+          it might have undesired side effects.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userData" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - Allows custom data to be stored on the object. Although Javascript
+          allows custom fields to be added to any object this property makes
+          this a bit more consistent.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="properties" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - Allows you to set multiple properties at once. setProperties takes a hash
+          of name/value pairs as its argument and sets the properties using setProperty
+          sample: myObj.setProperties( { property1:'value1', property2:'value2' } )
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ObjectLoader">
+    <xs:annotation>
+      <xs:documentation>This class is used to encapsulate an object created from XML markup in a
+        loader object. The loader can be used to create several objects from the same
+        XML node. Each time the load() method is called a new object is created from
+        the node. The method getComponentById() will be added to the created objects and
+        can be used to obtain child components with. The last created object is stored
+        in the object property of the loader.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ObjectLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiObjectLoader" substitutionGroup="ObjectLoader"/>
+
+  <xs:attributeGroup name="ObjectLoaderAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="node" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:XMLElement - This is the XML element describing the object.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="autoNameMapping" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true any XML object that has an id attribute will create a
+          global reference to the object created from this XML element.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGrid">
+    <xs:annotation>
+      <xs:documentation>This class is used to display an OLAP Grid
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGrid" substitutionGroup="OlapGrid"/>
+
+  <xs:attributeGroup name="OlapGridAttributes">
+
+    <xs:attributeGroup ref="TreeViewBaseAttributes"/>
+
+    <xs:attribute name="allowHeaderSelection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiOlapGridSelectionModel - Whether clicking on a dimension header also selects the rows/column of the
+          header.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="canReorganizeDimensions" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true the user can reorganize the dimensions using drag and drop
+          TODO: Document what events are fired when the reorg should happen
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondimensiondrop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when a dimension
+          of the current grid is dropped
+          on another dimension. This can
+          only happen if canReorganizeDimensions
+          is true
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridCellInfo">
+    <xs:annotation>
+      <xs:documentation>This represents information about a cell in the OLAP grid. This information
+        describes if a cell is part of the header and more.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridCellInfoAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridCellInfo" substitutionGroup="OlapGridCellInfo"/>
+
+  <xs:attributeGroup name="OlapGridCellInfoAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="header" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the cell is part of the header</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="body" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the cell is part of the body</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="row" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - What row the cell is part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="column" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - What column the cell is part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dimension" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The dimension the axis header cell is part of. If the cell is part of the
+          body then this is null.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="axis" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The axis the cell is part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="axisPosition" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The axis position is the start position of the axis header cell</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="quadrant" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is used to tell what part of the OLAP grid the cell belongs to</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridDataModel">
+    <xs:annotation>
+      <xs:documentation>This defines the interface that is needed for a data model for aBiOlapGrid.
+        This actually implements a dummy data model. Extend this class to create
+        more useful data models. *
+        All methods in this data model can be safely overriden without calling the super
+        class since there are no side effects in any of the methods.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridDataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridDataModel" substitutionGroup="OlapGridDataModel"/>
+
+  <xs:attributeGroup name="OlapGridDataModelAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridDragEvent">
+    <xs:annotation>
+      <xs:documentation>This event is used for events related to some drag and drop inside the OLAP grid.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridDragEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridDragEvent" substitutionGroup="OlapGridDragEvent"/>
+
+  <xs:attributeGroup name="OlapGridDragEventAttributes">
+
+    <xs:attributeGroup ref="DragEventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridDropMarker">
+    <xs:annotation>
+      <xs:documentation>This component is used to draw a drop marker on top/inside an OLAP grid
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridDropMarkerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridDropMarker" substitutionGroup="OlapGridDropMarker"/>
+
+  <xs:attributeGroup name="OlapGridDropMarkerAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridResizeOutline">
+    <xs:annotation>
+      <xs:documentation>This component is used as an overlay above the column that is currently being
+        resized
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridResizeOutlineAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridResizeOutline" substitutionGroup="OlapGridResizeOutline"/>
+
+  <xs:attributeGroup name="OlapGridResizeOutlineAttributes">
+
+    <xs:attributeGroup ref="ResizeHandleAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridSelectionModel">
+    <xs:annotation>
+      <xs:documentation>Selection model forBiOlapGrid.
+
+        This selection model contains of selected areas (BiArea). An area consists
+        of a left, top, width and height propertty. Two selected areas may overlap
+        so be careful when trying to get all selected cells.
+
+        The selectedItems collection is aBiAreaCollection
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridSelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridSelectionModel" substitutionGroup="OlapGridSelectionModel"/>
+
+  <xs:attributeGroup name="OlapGridSelectionModelAttributes">
+
+    <xs:attributeGroup ref="SelectionModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridStateManager">
+    <xs:annotation>
+      <xs:documentation>A simple class that is used internally with theBiOlapGrid to keep track
+        of active and hover cell
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridStateManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridStateManager" substitutionGroup="OlapGridStateManager"/>
+
+  <xs:attributeGroup name="OlapGridStateManagerAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="active" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiOlapGridCellInfo - The active cell info</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onhoverchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When the user hovers over a different part
+          of the OLAP grid
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondropoverchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the user is doing drag and drop
+          and the cell that the user is over changes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridViewManager">
+    <xs:annotation>
+      <xs:documentation>This class handles the visual properties of aBiOlapGrid
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridViewManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridViewManager" substitutionGroup="OlapGridViewManager"/>
+
+  <xs:attributeGroup name="OlapGridViewManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="showGridLines" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show grid lines between the cells in the OLAP grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scrollLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the scroll left to the view manager so that the view manager can figure
+          out what column to start at
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scrollTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the scroll top to the view manager so that the view manager can figure
+          out what row to start at
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="axisOnTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is used to tell which axis is to be shown as the column headers and
+          which to be shown as the row headers. A value of 0 means that the first
+          axis should be shown at the top.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cellMinimumWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The minimum width a cell might have. This is used when the user resizes a
+          colum. Setting this does not update the exisiting columns.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cellMinimumHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The minimum height a cell might have. This is used when the user resizes a
+          row. Setting this does not update the exisiting rows.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapStateEvent">
+    <xs:annotation>
+      <xs:documentation>This class is used when the interactive state of the OLAP grid changes
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapStateEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapStateEvent" substitutionGroup="OlapStateEvent"/>
+
+  <xs:attributeGroup name="OlapStateEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OpacityAnimator">
+    <xs:annotation>
+      <xs:documentation>Animates the opacity ofBiComponents to create various visual effects.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OpacityAnimatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOpacityAnimator" substitutionGroup="OpacityAnimator"/>
+
+  <xs:attributeGroup name="OpacityAnimatorAttributes">
+
+    <xs:attributeGroup ref="ComponentAnimationAttributes"/>
+
+    <xs:attribute name="type" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Setups common values (speed, acceleration type and loop mode) for default opacity animations.
+          Possible values are: pulsate, blink, fadeIn, fadeOut
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minOpacity" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Float - Limits how transparent the animated objects are allowed to be.
+          0.0 completely transparent, 1.0 completely opaque
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="speed" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number/String - Sets the duration, in milliseconds, of one animation cycle (some animation types use two
+          cycles).
+          The following string constants are also allowed:
+          slowest, slow, normal, fast, fastest
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="OptionPane">
+    <xs:annotation>
+      <xs:documentation>This class is used to layout default dialog controls. Normally this class
+        is not used directly but one of the static methods are used to create
+        new dialogs.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OptionPaneAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOptionPane" substitutionGroup="OptionPane"/>
+
+  <xs:attributeGroup name="OptionPaneAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="initialValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - This is used to define which of the options that
+          should be treated as the default acceptButton.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="acceptButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiEventTarget - The button that acts as the default accept button. If this is set
+          then the action
+          event is dispatched from the accept button when the enter key
+          is pressed. This does not have to
+          be a BiButton, any
+          BiEventTarget will work.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cancelButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiEventTarget - The button that acts as the default cancel button. If this is set
+          then the action
+          event is dispatched from the cancel button. This does not have to
+          be a BiButton, any
+          BiEventTarget will work.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - Sets the value of the option pane. This is used as the
+          dialogResult
+          when the option pane is used with a dialog.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="inputComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - This allows an input component to be shown below the message
+          component. This is created when creating input dialogs.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this option pane. If this is set to null
+          then the static string bundle forBiOptionPane is used
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="OrderedIterator">
+    <xs:annotation>
+      <xs:documentation>This is an ordered iterator that allows you to add items ordered by an index.
+        The items are ordered based on the index and finding and removing an item
+        based on its index is done in constant time. Inserting an item is in worst
+        case O(n) (where n is the number of items in the iterator).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OrderedIteratorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOrderedIterator" substitutionGroup="OrderedIterator"/>
+
+  <xs:attributeGroup name="OrderedIteratorAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PasswordField">
+    <xs:annotation>
+      <xs:documentation>A text field where the entered text is masked.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PasswordFieldAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPasswordField" substitutionGroup="PasswordField"/>
+
+  <xs:attributeGroup name="PasswordFieldAttributes">
+
+    <xs:attributeGroup ref="TextFieldAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PercentageStackedBarChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a percentage stacked bar chart for the given series.
+        A percentage stacked bar chart stacks the columns from the different series next to each
+        other and the value of the columns is expressed in percentage so all values
+        from the same category add up to 100%.
+        This is used with BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PercentageStackedBarChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPercentageStackedBarChart" substitutionGroup="PercentageStackedBarChart"/>
+
+  <xs:attributeGroup name="PercentageStackedBarChartAttributes">
+
+    <xs:attributeGroup ref="PercentageStackedColumnChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PercentageStackedBarChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a percentage stacked bar chart for the given series.
+        A percentage stacked bar chart stacks the columns from the different series next to each
+        other and the value of the columns is expressed in percentage so all values
+        from the same category add up to 100%.
+        This is used with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PercentageStackedBarChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPercentageStackedBarChart2" substitutionGroup="PercentageStackedBarChart2"/>
+
+  <xs:attributeGroup name="PercentageStackedBarChart2Attributes">
+
+    <xs:attributeGroup ref="PercentageStackedColumnChart2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PercentageStackedColumnChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a percentage stacked column chart for the given series.
+        A percentage stacked column chart stacks the columns from the different series on top of each
+        other and the value of the columns is expressed in percentage so all values
+        from the same category add up to 100%.
+        This is used with BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PercentageStackedColumnChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPercentageStackedColumnChart" substitutionGroup="PercentageStackedColumnChart"/>
+
+  <xs:attributeGroup name="PercentageStackedColumnChartAttributes">
+
+    <xs:attributeGroup ref="ColumnChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PercentageStackedColumnChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a percentage stacked column chart for the given series.
+        A percentage stacked column chart stacks the columns from the different series on top of each
+        other and the value of the columns is expressed in percentage so all values
+        from the same category add up to 100%.
+        This is used with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PercentageStackedColumnChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPercentageStackedColumnChart2" substitutionGroup="PercentageStackedColumnChart2"/>
+
+  <xs:attributeGroup name="PercentageStackedColumnChart2Attributes">
+
+    <xs:attributeGroup ref="ColumnChart2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PieChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a pie chart for the given series
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PieChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPieChart" substitutionGroup="PieChart"/>
+
+  <xs:attributeGroup name="PieChartAttributes">
+
+    <xs:attributeGroup ref="AbstractChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PieChartSection">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the components used to show the rectangles for a
+        pie chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PieChartSectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPieChartSection" substitutionGroup="PieChartSection"/>
+
+  <xs:attributeGroup name="PieChartSectionAttributes">
+
+    <xs:attributeGroup ref="AbstractChartSectionAttributes"/>
+
+    <xs:attribute name="radius">
+      <xs:annotation>
+        <xs:documentation>The size of the radius (0-1)
+          where 1 means that it will take up the entire available size
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="explode">
+      <xs:annotation>
+        <xs:documentation>The distance to move the sectio from the
+          center (0-1, percentage of available size).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="startAngle">
+      <xs:annotation>
+        <xs:documentation>The angle given in radians
+          where the pie chart section starts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endAngle">
+      <xs:annotation>
+        <xs:documentation>The angle given in radians
+          where the pie chart section ends.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Point">
+    <xs:annotation>
+      <xs:documentation>Simple class that describes a location of Point on a plane.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PointAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPoint" substitutionGroup="Point"/>
+
+  <xs:attributeGroup name="PointAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Polygon">
+    <xs:annotation>
+      <xs:documentation>This class represents a convex polygon. In a convex polygon,
+        no two sides may intersect more than once (at their endpoints),
+        and no vertex may be the intersection point of more than two
+        sides.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PolygonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPolygon" substitutionGroup="Polygon"/>
+
+  <xs:attributeGroup name="PolygonAttributes">
+
+    <xs:attributeGroup ref="ShapeAttributes"/>
+
+    <xs:attribute name="vertices" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiPoint[] - The vertices of this polygon</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Popup">
+    <xs:annotation>
+      <xs:documentation>A popup is a component that is displayed on top of all other components
+        and is not limited by the parent components view port.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PopupAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPopup" substitutionGroup="Popup"/>
+
+  <xs:attributeGroup name="PopupAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="screenLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position relative to the screen. Note that this can be both set and get
+          for popups.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="screenTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position relative to the screen. Note that this can be both set and get
+          for popups.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="clientLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position relative to the browser client area. Note that this can be both
+          set and get for popups.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="clientTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position relative to the browser client area. Note that this can be both
+          set and get for popups.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="opaque" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to make the popup opaque. An opaque popup will not let plugins and
+          other windowed controls show through. However, there is a price to this. This
+          is achieved using an internal iframe and this makes the popup heavier and
+          slower.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="autoHide" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to let the system decide when to hide the popup. Setting this to
+          false gives you better control but it also requires you to
+          handle the closing of the popup.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="allowOffScreen" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to allow the popup to be positioned off screen</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onbeforeshow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the popup is shown. This is a good
+          place to change the content of the popup and
+          set the preferred size if the default preferred
+          size is not wanted
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onshow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the popup is shown</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onhide" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the popup is hidden</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PopupManager">
+    <xs:annotation>
+      <xs:documentation>This singleton class manages the BiPopup
+        objects.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PopupManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPopupManager" substitutionGroup="PopupManager"/>
+
+  <xs:attributeGroup name="PopupManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="useOpaquePopups" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to make popup opaque by default. An opaque popup will not let plugins
+          and other windowed controls show through. However, there is a price to this.
+          This is achieved using an internal iframe and this makes the popup heavier and
+          slower.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="PrintFrame">
+    <xs:annotation>
+      <xs:documentation>BiPrintFrame is a helper class for printing any data from within a Bindows
+        application. It takes a Uri to a template file and a object containing named
+        strings as arguments and parses the template before sending it to the printer.
+
+        A template is typically an HTML document containing customizable tags used as
+        placeholders for data. The parser function being used can be easily extended to
+        handle more complex data, e.g. tables etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PrintFrameAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPrintFrame" substitutionGroup="PrintFrame"/>
+
+  <xs:attributeGroup name="PrintFrameAttributes">
+
+    <xs:attributeGroup ref="IframeAttributes"/>
+
+    <xs:attribute name="textParser" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTextParser - The Parser used for generating parsed content.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ProgressBar">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show a progress bar.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ProgressBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiProgressBar" substitutionGroup="ProgressBar"/>
+
+  <xs:attributeGroup name="ProgressBarAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="maximum">
+      <xs:annotation>
+        <xs:documentation>The maximum value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum">
+      <xs:annotation>
+        <xs:documentation>The minimum value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value">
+      <xs:annotation>
+        <xs:documentation>The value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This event is fired when the maximum, minimum
+          or maximum properties are changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RadioButton">
+    <xs:annotation>
+      <xs:documentation>Represents a radio button control. A radio button control can have two
+        states; checked and unchecked. These are represented by the
+        checked property.
+        Once a radio button is checked clicking it again will not uncheck it. To
+        uncheck a radio button another radio button in the same
+        radio group must be checked.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RadioButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiRadioButton" substitutionGroup="RadioButton"/>
+
+  <xs:attributeGroup name="RadioButtonAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - A value associated with the radio button.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="checked" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the radio button is checked or not. When this is changed
+          the change event is fired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="group" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiRadioGroup - The group that the radio button should be part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user presses the button (either using
+          the mouse or the keyboard)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the checked is changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RadioButtonMenuItem">
+    <xs:annotation>
+      <xs:documentation>This class is used for a menu item that displays a radio button to the left
+        of the text. To group different radio button menu items into a radio group
+        use theBiRadioGroup class in the same way it would be used for normal
+        radio buttons.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RadioButtonMenuItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiRadioButtonMenuItem" substitutionGroup="RadioButtonMenuItem"/>
+
+  <xs:attributeGroup name="RadioButtonMenuItemAttributes">
+
+    <xs:attributeGroup ref="MenuItemAttributes"/>
+
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - A value associated with the item.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="checked" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the item is checked or not</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="group" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiRadioGroup - The group that the radio button menu item should be part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the checked change</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RadioGroup">
+    <xs:annotation>
+      <xs:documentation>This class is used in conjunction with radio
+        buttons to ensure only one buttons is checked.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RadioGroupAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiRadioGroup" substitutionGroup="RadioGroup"/>
+
+  <xs:attributeGroup name="RadioGroupAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiRadioButton - This is the radio button that is checked</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="enabled" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the radio group is enabled or not. Setting this also
+          sets the enabled property on the radio buttons.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - This is the user value of the checked radio button in this radio
+          group. Setting this checks the first item that has this value.
+          If no item has this value the setting will have no effect.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="command" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiCommand - When the radio group has a command the enabled and
+          userValue are synchronized with the command.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the selected radio button is changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RangeModel">
+    <xs:annotation>
+      <xs:documentation>This class represents a range model that has a minumum, maximum, value and
+        an extent. This class is used by theBiProgressBar,BiScrollBar,BiSlider and
+        BiSpinner classes.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RangeModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiRangeModel" substitutionGroup="RangeModel"/>
+
+  <xs:attributeGroup name="RangeModelAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The value for the range</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The maximum value for the range</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The minimum value for the range</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="extent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The extent for the range</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the maximum,
+          minimum, value or
+          extent properties are changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RepeatButton">
+    <xs:annotation>
+      <xs:documentation>This class is used for buttons that repeatedly fire action events
+        The first action event is fired firstInterval milliseconds
+        after the mouse is pressed down on the button. The following action events
+        are fired every interval millisecond until the mouse button is
+        released.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RepeatButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiRepeatButton" substitutionGroup="RepeatButton"/>
+
+  <xs:attributeGroup name="RepeatButtonAttributes">
+
+    <xs:attributeGroup ref="ButtonAttributes"/>
+
+    <xs:attribute name="interval" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The time in milliseconds between the repeating action events</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="firstInterval" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The time in milliseconds before the first action event is fired</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ResizeHandle">
+    <xs:annotation>
+      <xs:documentation>This component can be used to allow another component to be resizable
+        using the mouse. The component can be used as a resize handle for the
+        component to resize. It can also be used without adding it to another
+        component by manually calling startResize in a mouse down
+        event handler.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ResizeHandleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiResizeHandle" substitutionGroup="ResizeHandle"/>
+
+  <xs:attributeGroup name="ResizeHandleAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="continuousLayout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Indicates that the ghost must be used to be a visual indicator for the duration of the resize
+          operation.
+          Once complete, the original component's dimensions will be updated accordingly.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ghost" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component that should be visually updated if continuousLayout is set to false.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="handleFor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component that the handle should be a resize handle for.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="resizeDirection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The direction that the resizing should be done in. Valid
+          values are:
+          s - south
+          n - north
+          e - east
+          w - west
+          se - south east
+          sw - south west
+          ne - north east
+          nw - north west
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onresize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires continually during the resizing of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforeresize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires continually during the resizing of the component. Call
+          preventDefault
+          on the event object to prevent the new size from being applied.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onresizestart" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires once when the resizing begins. Call
+          preventDefault
+          on the event object to prevent the component from being resized.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onresizeend" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when resizing of the component ends.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ResourceLoader">
+    <xs:annotation>
+      <xs:documentation>This class is used to load different kinds of resources. There are basically
+        3 types of resources that this class can handle. The first 2 are script files
+        and a code string. The third one is a genereal object described by an XML
+        element and in this case an object is created using aBiXmlResourceParser.
+        When creating general objects a few special rules apply. If the created object
+        is an event target the resource loader will listen to load
+        and error events so that it can be notified by the object that
+        it is loaded. If the object has a load() method that will be
+        called if the object is not already loaded. To decide if the object is loaded
+        the resource loader will use getLoaded() if available and if that
+        isn't available it is assumed that the object is loaded (or does not require
+        loading).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ResourceLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiResourceLoader" substitutionGroup="ResourceLoader"/>
+
+  <xs:attributeGroup name="ResourceLoaderAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="autoNameMapping" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true any XML object that has an id attribute will create a
+          global reference to the object created from this XML element.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onprogress" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires every time one of the external resources have
+          been loaded. This is useful for providing visual feedback.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when all the resources have been loaded and executed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Resources">
+    <xs:annotation>
+      <xs:documentation>This class is used to load multiple resources
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ResourcesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiResources" substitutionGroup="Resources"/>
+
+  <xs:attributeGroup name="ResourcesAttributes">
+
+    <xs:attributeGroup ref="SerializedLoaderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RichEdit">
+    <xs:annotation>
+      <xs:documentation>
+        This control is used to to provide rich text editing of HTML documents
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RichEditAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiRichEdit" substitutionGroup="RichEdit"/>
+
+  <xs:attributeGroup name="RichEditAttributes">
+
+    <xs:attributeGroup ref="IframeAttributes"/>
+
+    <xs:attribute name="contentHtml">
+      <xs:annotation>
+        <xs:documentation>
+          The HTML code inside the rich editor frame. This does not include
+          the doctype nor any comments outside the root element.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Script">
+    <xs:annotation>
+      <xs:documentation>This class works much like the script element in HTML. You can set the uri
+        and it will fetch an external file that will be executed or you can use the
+        text property to execute some text.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ScriptAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiScript" substitutionGroup="Script"/>
+
+  <xs:attributeGroup name="ScriptAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The script text to evaluate</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The location of the script file</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="src" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - Alias to uri for backwards compatibility</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ScriptLoader">
+    <xs:annotation>
+      <xs:documentation>This class loads and executes a javascript file
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ScriptLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiScriptLoader" substitutionGroup="ScriptLoader"/>
+
+  <xs:attributeGroup name="ScriptLoaderAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The URI (location) of the file to load. If this is set to a string a
+          new URI is created from that string relative to the
+          ADF path.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the file has been loaded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ScriptLoaderQueue">
+    <xs:annotation>
+      <xs:documentation>Used to load multiple js files and once all are loaded they are executed
+        in the order they were added.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ScriptLoaderQueueAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiScriptLoaderQueue" substitutionGroup="ScriptLoaderQueue"/>
+
+  <xs:attributeGroup name="ScriptLoaderQueueAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="async" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If this is set to false then the loading will lock the UI thread
+          but the loading and execution will happen and finish when
+          load is called.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when all the scripts have been loaded and executed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onprogress" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires every time one of the external scripts have
+          been loaded. This is useful for providing visual feedback.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ScrollBar">
+    <xs:annotation>
+      <xs:documentation>This component is used to show a scroll bar.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ScrollBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiScrollBar" substitutionGroup="ScrollBar"/>
+
+  <xs:attributeGroup name="ScrollBarAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="extent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The extent for the scroll bar.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The maximum value for the scroll bar.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The minimum value for the scroll bar.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The value for the scroll bar.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minThumbSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The mimimum size of the thumb.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="unitIncrement" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The amount to change the scroll bar when pressing the buttons.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="blockIncrement" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The amount to change the scroll bar when the mouse is pressed on the scroll
+          bar (and not on the thumb or buttons).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="orientation" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The orientation of the scroll bar. Valid values are: horizontal vertical</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the extent,
+          value, minimum or
+          maximum properties are changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onscrollend" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the thumb is released
+          after scrolling.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SelectionItemCollection">
+    <xs:annotation>
+      <xs:documentation>This class is used internally insideBiSelectionModel to keep track of the
+        selected items. If you create a custom selection model you might need to also
+        create a custom selection model item collection. The type of the items is not
+        very important but the selection model needs to be able to work with this
+        type. You also need to override getItemHashCode if the items
+        are not instances ofBiObject.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SelectionItemCollectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSelectionItemCollection" substitutionGroup="SelectionItemCollection"/>
+
+  <xs:attributeGroup name="SelectionItemCollectionAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SelectionModel">
+    <xs:annotation>
+      <xs:documentation>This class provides a basic selection model
+        This treats children as
+        selectable items inside a component. The items can
+        be of any type but if they are not BiComponents you
+        will have to override the following methods and properties: first,
+        last, items, getNext, getPrevious,
+        scrollItemIntoView,
+        getItemLeft, getItemTop, getItemWidth
+        and getItemHeight.
+        To update the visuals (to show what is selected) override the following
+        methods: updateItemSelectionState, updateItemAnchorState
+        and updateItemLeadState.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSelectionModel" substitutionGroup="SelectionModel"/>
+
+  <xs:attributeGroup name="SelectionModelAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="owner" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - This is the owner component that is
+          containing the selectable objects. This should not be set after the
+          selection model has been used
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="multipleSelection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the selection model supports multiple selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="canDeselect" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the user can deselect items. If this is false you need to select something
+          else to deselect an item
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dragSelection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Drag selection is used to hold down the mouse to select mutliple items</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="anchorItem" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent/Object - This item is used when doing multiple selection with the shift key</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="leadItem" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent/Object - This item is used when doing multiple selection. This is the last item selected.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedItems" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent[]/Object[] - Returns an array containing the selected items</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected items are changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onleaditemchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the lead item is changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SerializedLoader">
+    <xs:annotation>
+      <xs:documentation>Used to start multiple loaders in the order they were added.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SerializedLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSerializedLoader" substitutionGroup="SerializedLoader"/>
+
+  <xs:attributeGroup name="SerializedLoaderAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when all the loaders have finished loading,
+          or if an error occurs.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onprogress" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires every time one of the loaders has finished.
+          This is useful for providing visual feedback.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Set">
+    <xs:annotation>
+      <xs:documentation>A simple class for storing a set of objects
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SetAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSet" substitutionGroup="Set"/>
+
+  <xs:attributeGroup name="SetAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Shape">
+    <xs:annotation>
+      <xs:documentation>This class is an abstract base class for describing
+        the shapes of Image areas. This is a very general
+        class and can be extended to mean a variety of things.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ShapeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiShape" substitutionGroup="Shape"/>
+
+  <xs:attributeGroup name="ShapeAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SingleTree">
+    <xs:annotation>
+      <xs:documentation>A Simple one column Tree.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SingleTreeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSingleTree" substitutionGroup="SingleTree"/>
+
+  <xs:attributeGroup name="SingleTreeAttributes">
+
+    <xs:attributeGroup ref="TreeViewAttributes"/>
+
+    <xs:attribute name="indentWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The amount to indent child nodes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showExpandIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the expand and collapse icons</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortFunction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:function - The sort function to use. The function is passed the two
+          nodes to compare as arguments, to compare the value (text)
+          of the node use getData() on the node. Defaults to case
+          sensitive string compare.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="SingleTreeDataModel">
+    <xs:annotation>
+      <xs:documentation>Data model forBiSingleTree
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SingleTreeDataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSingleTreeDataModel" substitutionGroup="SingleTreeDataModel"/>
+
+  <xs:attributeGroup name="SingleTreeDataModelAttributes">
+
+    <xs:attributeGroup ref="TreeDataModelAttributes"/>
+
+    <xs:attribute name="treeView" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTree2 - The tree view the data model is acting on</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="SingleTreeNode">
+    <xs:annotation>
+      <xs:documentation>This class is used as the data for rows in theBiTree2 component
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SingleTreeNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSingleTreeNode" substitutionGroup="SingleTreeNode"/>
+
+  <xs:attributeGroup name="SingleTreeNodeAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Uri of image icon. Used for collapsed/leaf nodes and expanded nodes
+          without expandedIcon set.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="expandedIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Icon to show for an expanded node</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="data" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - Data to display for the node</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="expanded" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the node is expanded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the node is selected</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="lead" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the node is the lead item</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="SingleTreeViewManager">
+    <xs:annotation>
+      <xs:documentation>This class handles the visual properties of aBiSingleTree
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SingleTreeViewManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSingleTreeViewManager" substitutionGroup="SingleTreeViewManager"/>
+
+  <xs:attributeGroup name="SingleTreeViewManagerAttributes">
+
+    <xs:attributeGroup ref="TreeViewViewManagerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SizeAnimator">
+    <xs:annotation>
+      <xs:documentation>This class is used to animate the size ofBiComponent(s) and can be used to create visual effects.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SizeAnimatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSizeAnimator" substitutionGroup="SizeAnimator"/>
+
+  <xs:attributeGroup name="SizeAnimatorAttributes">
+
+    <xs:attributeGroup ref="ComponentAnimationAttributes"/>
+
+    <xs:attribute name="type" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets speed and acceleration type to useful values.
+          Can be one of the following string values: normal, smooth
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Starting width of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Starting height of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Destination width of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Destination height of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets starting size for both width and height.
+          Note: The component will be square shaped.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets target size for both width and height.
+          Note: The component will be square shaped.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the acceleration type. Use constants fromBiComponentAnimation.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="speed" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number/String - Sets the duration of the animation.
+          Can be set in three different ways:
+          1.BiSizeAnimator.SPEEDx constants can be used.
+          2. One of the following strings: slowest, slow, normal, fast, fastest.
+          3. A number representing the length of the animation, measured in milliseconds.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - By setting the from-component you specify anotherBiComponent whos size will be used
+          for the animation's start state. If the from-component's size is changed, the animation
+          will update dynamically.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - By setting the to-component you specify anotherBiComponent whos size will be used
+          for the animation's target state. If the to-component's size is changed, the animation
+          will update dynamically.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Slider">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show a slider control.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SliderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSlider" substitutionGroup="Slider"/>
+
+  <xs:attributeGroup name="SliderAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="orientation">
+      <xs:annotation>
+        <xs:documentation>
+          The orientation of the slider. Valid values are: horizontal vertical
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="unitIncrement">
+      <xs:annotation>
+        <xs:documentation>
+          The amount to increase the slider when using the arrow keys and
+          the mouse wheel.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="blockIncrement">
+      <xs:annotation>
+        <xs:documentation>
+          The amount to increase the slider when using the page up and page
+          down keys as well as the amount to change the slider when the
+          mouse is pressed on the slider (and not on the handle).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum">
+      <xs:annotation>
+        <xs:documentation>The maximum value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum">
+      <xs:annotation>
+        <xs:documentation>The minimum value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value">
+      <xs:annotation>
+        <xs:documentation>The value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This event is fired when the maximum, minimum
+          or maximum properties are changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Sort">
+    <xs:annotation>
+      <xs:documentation>Collection of static functions used for sorting and comparing
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SortAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSort" substitutionGroup="Sort"/>
+
+  <xs:attributeGroup name="SortAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Spinner">
+    <xs:annotation>
+      <xs:documentation>A spinner is a text box that accepts a number. A spinner also has buttons
+        for increasing and decreasing the value.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SpinnerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSpinner" substitutionGroup="Spinner"/>
+
+  <xs:attributeGroup name="SpinnerAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The value for the spinner</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The maximum value for the spinner</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The minimum value for the spinner</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="font" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiFont - This is used to describe how to paint the text in the spinner.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text alignment. Valid values are: left right center</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the maximum,
+          minimum or maximum
+          properties are changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the enter key is pressed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oninvalidvalue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the value is change
+          becuase the value entered by the user was
+          not valid.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oninvalidcharacter" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired if an invalid character
+          is typed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SplitPane">
+    <xs:annotation>
+      <xs:documentation>A split pane is used to show two components with a splitter betwee them.
+        The splitter between the components can be dragged and in that way the
+        components are resized. If right to left the left and right component switch
+        palces.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SplitPaneAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSplitPane" substitutionGroup="SplitPane"/>
+
+  <xs:attributeGroup name="SplitPaneAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="orientation" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The orientation of the split pane. Valid values are horizontal
+          and vertical. If horizontal is used the components are placed to
+          the left and to the right of the splitter respectively. When vertical the
+          components are placed above and below. When using horizontal and right to
+          left the position of the left and right components are switched.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dividerLocation" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The location of the splitter from the left if horizontal orientation
+          and from the top if vertical orientation. If right to left is used this is
+          from the right instead of from the left.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dividerSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the divider (height if vertical orientation)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="leftComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component to the left (or top if vertical orientation) of the
+          splitter. This property is the same as topComponent.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component to the right (or bottom if vertical orientation) of the
+          splitter. This property is the same as bottomComponent.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="topComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component above (or to the left if horizontal orientation) of the
+          splitter. This property is the same as leftComponent.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bottomComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component below (or to the right if hoizontal orientation)
+          the splitter. This property is the same as rightComponent.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="leftVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the left component. If this is false
+          the right component will take up the entire space of the split pane
+          and the splitter will be hidden.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="topVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Sets whether to show the top component. If this is false
+          the bottom component will take up the entire space of the split pane
+          and the splitter will be hidden. This property is the same as
+          leftVisible.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the right component. If this is false
+          the left component will take up the entire space of the split pane
+          and the splitter will be hidden.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bottomVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Sets whether to show the bottom component. If this is false
+          the top component will take up the entire space of the split pane
+          and the splitter will be hidden. This property is the same as
+          rightVisible.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondividerlocationchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when then
+          dividerLocation is
+          changed
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StackedBarChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a stacked bar chart for the given series. A stacked
+        bar chart stacks the bars from the different series next to each
+        other.
+        This is used with BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StackedBarChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStackedBarChart" substitutionGroup="StackedBarChart"/>
+
+  <xs:attributeGroup name="StackedBarChartAttributes">
+
+    <xs:attributeGroup ref="StackedColumnChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StackedBarChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a stacked bar chart for the given series. A stacked
+        bar chart stacks the bars from the different series next to each
+        other.
+        This is used with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StackedBarChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStackedBarChart2" substitutionGroup="StackedBarChart2"/>
+
+  <xs:attributeGroup name="StackedBarChart2Attributes">
+
+    <xs:attributeGroup ref="StackedColumnChart2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StackedColumnChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a stacked column chart for the given series. A stacked
+        column chart stacks teh columns from the different series on top of each
+        other.
+        This is used with BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StackedColumnChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStackedColumnChart" substitutionGroup="StackedColumnChart"/>
+
+  <xs:attributeGroup name="StackedColumnChartAttributes">
+
+    <xs:attributeGroup ref="ColumnChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StackedColumnChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a stacked column chart for the given series. A stacked
+        column chart stacks teh columns from the different series on top of each
+        other.
+        This is used with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StackedColumnChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStackedColumnChart2" substitutionGroup="StackedColumnChart2"/>
+
+  <xs:attributeGroup name="StackedColumnChart2Attributes">
+
+    <xs:attributeGroup ref="ColumnChart2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StatusBar">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used for displaying status bars in Bindows
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StatusBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStatusBar" substitutionGroup="StatusBar"/>
+
+  <xs:attributeGroup name="StatusBarAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StatusBarPanel">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to display sections in a
+        status bar.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StatusBarPanelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStatusBarPanel" substitutionGroup="StatusBarPanel"/>
+
+  <xs:attributeGroup name="StatusBarPanelAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StringBuffer">
+    <xs:annotation>
+      <xs:documentation>Creates a StringBuffer object which handles string concatenation faster
+        than the String class.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StringBufferAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStringBuffer" substitutionGroup="StringBuffer"/>
+
+  <xs:attributeGroup name="StringBufferAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StringBundle">
+    <xs:annotation>
+      <xs:documentation>This class is used to make creating multilingual applications easier.
+        The string bundle is uses one hash table (objects in JavaScript) for
+        every language and falls back on English ("en") in case the
+        user language is not available.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StringBundleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStringBundle" substitutionGroup="StringBundle"/>
+
+  <xs:attributeGroup name="StringBundleAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="language" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The current language</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the current strings
+          changes in some way. This happens when the
+          language is changed or a new bundle is added
+          with the current language.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Style">
+    <xs:annotation>
+      <xs:documentation>This class works much like the script element in HTML. You can set the uri
+        and it will fetch an external file that will be executed or you can use the
+        text property to execute some text.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StyleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStyle" substitutionGroup="Style"/>
+
+  <xs:attributeGroup name="StyleAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The script text to evaluate</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The location of the script file</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="src" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - Alias to uri for backwards compatibility</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Subtree">
+    <xs:annotation>
+      <xs:documentation>Internal class for handling subtrees
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SubtreeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSubtree" substitutionGroup="Subtree"/>
+
+  <xs:attributeGroup name="SubtreeAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TabBar">
+    <xs:annotation>
+      <xs:documentation>This component is used as a container for tab
+        buttons. When using tab panes this
+        control is used internally.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TabBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTabBar" substitutionGroup="TabBar"/>
+
+  <xs:attributeGroup name="TabBarAttributes">
+
+    <xs:attributeGroup ref="ToolBarAttributes"/>
+
+    <xs:attribute name="alignment" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes how to draw the tab bar. Supported values are top and
+          bottom.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTabButton - The currently selected tab button.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the selected tab button.
+          If no button is selected this returns -1.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected tab
+          button changes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TabButton">
+    <xs:annotation>
+      <xs:documentation>This class is used to display tabs for aBiTabPane or aBiTabBar
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TabButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTabButton" substitutionGroup="TabButton"/>
+
+  <xs:attributeGroup name="TabButtonAttributes">
+
+    <xs:attributeGroup ref="ToolBarRadioButtonAttributes"/>
+
+    <xs:attribute name="alignment" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes whether the tab button should be drawn so that it looks like
+          it would be at the top of a tab pane or at the bottom of a tab pane.
+          Supported values are top and bottom.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TabPage">
+    <xs:annotation>
+      <xs:documentation>This class represents the pages inside a tab
+        pane. A tab page has a BiTabButton
+        that is used to display a button for the page when used with a tab pane.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TabPageAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTabPage" substitutionGroup="TabPage"/>
+
+  <xs:attributeGroup name="TabPageAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="alignment" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes whether the tab page should be drawn so that it appears like the
+          tabes are placed at the top of a tab pane or at the bottom of a tab pane.
+          Supported values are top and bottom.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="tabButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTabButton - The tab button used with the tab page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the page is selected</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text to show on the tab button</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage - The icon to show on the tab button</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected value changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TabPane">
+    <xs:annotation>
+      <xs:documentation>This class is used for creating tab controls. A tab control contains
+        one or more tab pages. Each tab page also
+        has a tab button that is shown above the
+        page and when the button is clicked the page is shown.
+        Bindows supports showing the tabs at the bottom or the top. Use the
+        alignmnet property to change this.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TabPaneAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTabPane" substitutionGroup="TabPane"/>
+
+  <xs:attributeGroup name="TabPaneAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="alignment" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes whether the tabs should be placed at the top of a tab pane or
+          at the bottom of a tab pane.
+          Supported values are top and bottom.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTabPage - The currently selected tab page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the selected tab page.
+          If no page is selected this returns -1.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected tab page changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TextArea">
+    <xs:annotation>
+      <xs:documentation>A multiline text input field
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TextAreaAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTextArea" substitutionGroup="TextArea"/>
+
+  <xs:attributeGroup name="TextAreaAttributes">
+
+    <xs:attributeGroup ref="TextFieldAttributes"/>
+
+    <xs:attribute name="wrap" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the text should wrap automatically as the user types.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TextField">
+    <xs:annotation>
+      <xs:documentation>This class is used to display a single line plain text input
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TextFieldAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTextField" substitutionGroup="TextField"/>
+
+  <xs:attributeGroup name="TextFieldAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text on the text field</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="font" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiFont - This is used to describe how to paint the text in the text field.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text alignment. Valid values are: left right center</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maxLength" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The maximum number of characters that the user can enter into the text field</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="readOnly" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the user can enter text in the text field</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="validator" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Function - This property is a function that is used to validate the text of
+          the text field. The function should take a string and return
+          true if the text is valid.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="invalidMessage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This property can be used to give information about why the value
+          might be invalid.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectionStart" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The starting point of the selection in the text field. If not selected this
+          returns -1.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectionLength" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The length (number of chracters) of the currently selected text in the text field</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectionText" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The currently selected text in the text field</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="allowTab" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether pressing the tab key should insert a tab character or move the focus from
+          the text field
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The left padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingRight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The right padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The top padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingBottom" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The bottom padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the enter key is pressed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ontextchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the text has changed.
+          This happens when the user in some way changes
+          the text inside the text field. This event
+          is fired continiously as the user types.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the text field is blurred
+          and the text has changed since the text field got
+          focus.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TextLoader">
+    <xs:annotation>
+      <xs:documentation>This class is used to load a plain text document from the server or the
+        file system (if the application is run locally).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TextLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTextLoader" substitutionGroup="TextLoader"/>
+
+  <xs:attributeGroup name="TextLoaderAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="method" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The HTTP method to use for the request</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The URI (location) of the file to load. If this is set to a string a
+          new URI is created from that string relative to the
+          ADF path.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="user" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The user name to use when authentication is needed to load the file</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="password" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The password to use when authentication is needed to load the file</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the file has been loaded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TextParser">
+    <xs:annotation>
+      <xs:documentation>BiTextParser is a helper class for parsing text within a Bindows
+        application.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TextParserAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTextParser" substitutionGroup="TextParser"/>
+
+  <xs:attributeGroup name="TextParserAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="replacePattern" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The pattern to match and replace.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="replaceFlags" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - RegExp flags</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="printStringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The Object containing the strings for replacing</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="parseFunction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Function - The function being used while parsing.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Theme">
+    <xs:annotation>
+      <xs:documentation>This class represents a theme which consists of a css file
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ThemeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTheme" substitutionGroup="Theme"/>
+
+  <xs:attributeGroup name="ThemeAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="default" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the theme is the default theme</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="menuCss" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is the string needed for the IE menus to work correctly</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ThemeManager">
+    <xs:annotation>
+      <xs:documentation>This singleton class is used for theme support in Bindows
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ThemeManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiThemeManager" substitutionGroup="ThemeManager"/>
+
+  <xs:attributeGroup name="ThemeManagerAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="defaultTheme" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTheme - The theme that is currently being used</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onthemechanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the default
+          theme changes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TimePicker">
+    <xs:annotation>
+      <xs:documentation>This component provides a spinner like component
+        that is used to enter a time. The control consists of different text fields
+        for the different parts of the time string. The string format is decided
+        using aBiDateFormat object.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TimePickerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTimePicker" substitutionGroup="TimePicker"/>
+
+  <xs:attributeGroup name="TimePickerAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The minimum selectable date</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The maximum selectable date</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="date" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - This is a date object that describes the currently entered time</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dateFormat" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDateFormat - This is theBiDateFormat that describes how to format the text inside
+          the time date picker.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the time is changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfieldchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the active field of the
+          component changes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oninvalidcharacter" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired if an invalid character
+          is typed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Timer">
+    <xs:annotation>
+      <xs:documentation>This class can be used to schedule events to occur later in time.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TimerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTimer" substitutionGroup="Timer"/>
+
+  <xs:attributeGroup name="TimerAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="enabled" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If this is false no tick events are fired.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="interval" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of milliseconds between the firing of the tick
+          events. Changing this also stops the timer.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ontick" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires every interval milliseconds for
+          an enabled and started timer.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TimerManager">
+    <xs:annotation>
+      <xs:documentation>This is a singleton class that handles the disposal of all
+        timers.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TimerManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTimerManager" substitutionGroup="TimerManager"/>
+
+  <xs:attributeGroup name="TimerManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBar">
+    <xs:annotation>
+      <xs:documentation>This class is used to create a tool bar.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBar" substitutionGroup="ToolBar"/>
+
+  <xs:attributeGroup name="ToolBarAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarButton">
+    <xs:annotation>
+      <xs:documentation>This is used to create buttons that are placed on a tool bar.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarButton" substitutionGroup="ToolBarButton"/>
+
+  <xs:attributeGroup name="ToolBarButtonAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the button is clicked</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarMenuButton">
+    <xs:annotation>
+      <xs:documentation>This class creates a tool bar button that shows a menu
+        when the button is pressed.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarMenuButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarMenuButton" substitutionGroup="ToolBarMenuButton"/>
+
+  <xs:attributeGroup name="ToolBarMenuButtonAttributes">
+
+    <xs:attributeGroup ref="ToolBarButtonAttributes"/>
+
+    <xs:attribute name="menu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiMenu - The menu to show when the button is pressed.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarRadioButton">
+    <xs:annotation>
+      <xs:documentation>This represents a radio button that can be placed on a tool bar.
+        To group different tool bar radio buttons into a radio group
+        use the BiRadioGroup class in the same
+        way it would be used for normal radio buttons.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarRadioButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarRadioButton" substitutionGroup="ToolBarRadioButton"/>
+
+  <xs:attributeGroup name="ToolBarRadioButtonAttributes">
+
+    <xs:attributeGroup ref="ToolBarToggleButtonAttributes"/>
+
+    <xs:attribute name="group" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiRadioGroup - The group that the radio button should be part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarSeparator">
+    <xs:annotation>
+      <xs:documentation>This class is used to display a separator on a tool bar.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarSeparatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarSeparator" substitutionGroup="ToolBarSeparator"/>
+
+  <xs:attributeGroup name="ToolBarSeparatorAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarSplitMenuButton">
+    <xs:annotation>
+      <xs:documentation>This compound widget consists of a toggle-button and a drop down menu.
+        The toggle-button can be plain text or have an icon or both.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarSplitMenuButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarSplitMenuButton" substitutionGroup="ToolBarSplitMenuButton"/>
+
+  <xs:attributeGroup name="ToolBarSplitMenuButtonAttributes">
+
+    <xs:attributeGroup ref="ToolBarButtonAttributes"/>
+
+    <xs:attribute name="menu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiMenu - Sets the menu on the control</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:: String The text to use on the button - Sets the label text on the button of the control.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarSplitToggleMenuButton">
+    <xs:annotation>
+      <xs:documentation>This compound widget consists of a button and a drop down menu.
+        The Button can be plain text or have an icon or both.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarSplitToggleMenuButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarSplitToggleMenuButton" substitutionGroup="ToolBarSplitToggleMenuButton"/>
+
+  <xs:attributeGroup name="ToolBarSplitToggleMenuButtonAttributes">
+
+    <xs:attributeGroup ref="ToolBarToggleButtonAttributes"/>
+
+    <xs:attribute name="menu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiMenu - Sets the menu on the control</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets the label text on the button of the control.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarToggleButton">
+    <xs:annotation>
+      <xs:documentation>This represents a toggle button (check box button) that can be placed on a tool bar.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarToggleButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarToggleButton" substitutionGroup="ToolBarToggleButton"/>
+
+  <xs:attributeGroup name="ToolBarToggleButtonAttributes">
+
+    <xs:attributeGroup ref="ToolBarButtonAttributes"/>
+
+    <xs:attribute name="checked" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the button is checked or not. When this is changed
+          the change event is fired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - A value associated with the button.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the checked is changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolTip">
+    <xs:annotation>
+      <xs:documentation>This class is used for showing generic tool tip controls. A tool tip
+        can contain other controls.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolTipAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolTip" substitutionGroup="ToolTip"/>
+
+  <xs:attributeGroup name="ToolTipAttributes">
+
+    <xs:attributeGroup ref="PopupAttributes"/>
+
+    <xs:attribute name="hideOnHover" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If this is true then the tool tip is hidden if the mouse pointer enters the
+          tool tip.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="mousePointerOffsetX" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position of the tool tip relative to the mouse pointer</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="mousePointerOffsetY" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position of the tool tip relative to the mouse pointer</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="hideInterval" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of milliseconds before hiding the tool tip</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showInterval" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of milliseconds before showing the tool tip</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolTipManager">
+    <xs:annotation>
+      <xs:documentation>A singleton class used by the system to manage tool
+        tips.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolTipManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolTipManager" substitutionGroup="ToolTipManager"/>
+
+  <xs:attributeGroup name="ToolTipManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="currentToolTip" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiToolTip - The currently shown (or about to show) tool tip</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tree">
+    <xs:annotation>
+      <xs:documentation>This class is used for showing a tree, a column list and a combined
+        tree with multiple columns. The control also provides headers that can
+        be used to resize the columns, reorder the columns or sort the data by
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTree" substitutionGroup="Tree"/>
+
+  <xs:attributeGroup name="TreeAttributes">
+
+    <xs:attributeGroup ref="AbstractGridAttributes"/>
+
+    <xs:attribute name="indentWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The amount to indent child nodes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showPlusMinus" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the expand and collapse icons</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showRootLines" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show lines on the top most level</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="indentColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The column to indent by.
+          Setting this to -1 (or a value greater than the column count) removes
+          the indentation.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showLines" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the lines in the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="expanded" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the node is expanded or not. The tree control is always
+          expanded so setting this to false has no effect.
+          This is provided so that the tree has the same interface as the
+          tree nodes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected row/cell changes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onexpandedchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the tree is expanded or
+          collapsed and the lead item is changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tree2">
+    <xs:annotation>
+      <xs:documentation>This component is a special case ofBiTreeView which has an interface which
+        is similar toBiTree
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Tree2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTree2" substitutionGroup="Tree2"/>
+
+  <xs:attributeGroup name="Tree2Attributes">
+
+    <xs:attributeGroup ref="TreeViewAttributes"/>
+
+    <xs:attribute name="columnCount" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of columns in the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnNames" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The text to show on the headers of the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnWidths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The widths of the columns of the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnOrders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - The order of the columns. This an array containing the indexes of the
+          columns.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the headers for the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showRowHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the row headers for the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showGridLines" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show grid lines between the cells in the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tree2Cell">
+    <xs:annotation>
+      <xs:documentation>This is used for the cells in aBiTree2Row row
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Tree2CellAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTree2Cell" substitutionGroup="Tree2Cell"/>
+
+  <xs:attributeGroup name="Tree2CellAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="data" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The data that is associated with the cell</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tree2DataModel">
+    <xs:annotation>
+      <xs:documentation>This data model is to be used withBiTree2. It uses theBiTree2Row and
+        BiTree2Cell to provide the data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Tree2DataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTree2DataModel" substitutionGroup="Tree2DataModel"/>
+
+  <xs:attributeGroup name="Tree2DataModelAttributes">
+
+    <xs:attributeGroup ref="TreeDataModelAttributes"/>
+
+    <xs:attribute name="treeView" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTree2 - The tree view the data model is acting on</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tree2Row">
+    <xs:annotation>
+      <xs:documentation>This class is used as the data for rows in theBiTree2 component
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Tree2RowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTree2Row" substitutionGroup="Tree2Row"/>
+
+  <xs:attributeGroup name="Tree2RowAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="expanded" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the row is expanded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tree2ViewManager">
+    <xs:annotation>
+      <xs:documentation>This class is a special view manager to be used withBiTree2
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Tree2ViewManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTree2ViewManager" substitutionGroup="Tree2ViewManager"/>
+
+  <xs:attributeGroup name="Tree2ViewManagerAttributes">
+
+    <xs:attributeGroup ref="TreeViewViewManagerAttributes"/>
+
+    <xs:attribute name="indentColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The column to indent</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeDataModel">
+    <xs:annotation>
+      <xs:documentation>This data model takes a a tree consisting ofBiTreeNode2 nodes and exposes
+        the interface needed by theBiTreeView. The internal tree does not have to
+        be aBiTreeNode2 as long as getNodeChildren, getNodeHashCode, getCellText and
+        getSortFunction (if sorting is needed) are overridden.
+        The default implementation assumes that the data in theBiTreeNode2 objects
+        are arrays containing the cell data.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeDataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeDataModel" substitutionGroup="TreeDataModel"/>
+
+  <xs:attributeGroup name="TreeDataModelAttributes">
+
+    <xs:attributeGroup ref="TreeViewDataModelAttributes"/>
+
+    <xs:attribute name="rootNode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTreeNode2 - The tree node that is the root of the data</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondatachanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the
+          data changes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onexpand" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a row has expanded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncollapse" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a row has collapsed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforeexpand" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired before a row is expanded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforecollapse" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired before a row is collapsed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onrowcountchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the row count changes.
+          The rowIndex and the rowCount properties on the
+          event object are available for this event
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeHelper">
+    <xs:annotation>
+      <xs:documentation>This class contains some static methods that are usufull when working
+        with trees.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeHelperAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeHelper" substitutionGroup="TreeHelper"/>
+
+  <xs:attributeGroup name="TreeHelperAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeIterator">
+    <xs:annotation>
+      <xs:documentation>This class is used for iterating over rows and subtrees in a tree
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeIteratorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeIterator" substitutionGroup="TreeIterator"/>
+
+  <xs:attributeGroup name="TreeIteratorAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="rowIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The row index that the iterator is currently at</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeIteratorStackItem">
+    <xs:annotation>
+      <xs:documentation>This class is used internally byBiTreeIterator to keep track of the path stack
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeIteratorStackItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeIteratorStackItem" substitutionGroup="TreeIteratorStackItem"/>
+
+  <xs:attributeGroup name="TreeIteratorStackItemAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeNode">
+    <xs:annotation>
+      <xs:documentation>This represents a tree node for a tree or a
+        row for a tree. A tree node is not a component
+        but it has some visual properties that are similar to a
+        component.
+        When working with trees and column list it is usually suitable to extend
+        this class instead of using it directly because this gives better control
+        over what data is bound to the node and what text to show on the row.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeNode" substitutionGroup="TreeNode"/>
+
+  <xs:attributeGroup name="TreeNodeAttributes">
+
+    <xs:attributeGroup ref="AbstractGridRowAttributes"/>
+
+    <xs:attribute name="expanded" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the node is expanded or not.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeNode2">
+    <xs:annotation>
+      <xs:documentation>This class is used to build up the tree for the tree model to use
+        with theBiTreeView andBiTreeDataModel
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeNode2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeNode2" substitutionGroup="TreeNode2"/>
+
+  <xs:attributeGroup name="TreeNode2Attributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="data" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object[] - The data that is associated to the node</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeSelectionModel">
+    <xs:annotation>
+      <xs:documentation>This class is used to handle the selection of the
+        nodes in a tree.
+        It extends the BiListSelectionModel
+        to be able to handle threaded data.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeSelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeSelectionModel" substitutionGroup="TreeSelectionModel"/>
+
+  <xs:attributeGroup name="TreeSelectionModelAttributes">
+
+    <xs:attributeGroup ref="SelectionModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeView">
+    <xs:annotation>
+      <xs:documentation>This class is the base forBiGrid2 andBiTree2. It can be used directly
+        with a data model.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeView" substitutionGroup="TreeView"/>
+
+  <xs:attributeGroup name="TreeViewAttributes">
+
+    <xs:attributeGroup ref="TreeViewBaseAttributes"/>
+
+    <xs:attribute name="showBrokenCellTextAsToolTip" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:boolean - If this is property is set to true, tooltip will show whenever a broken cell is hovered. Default
+          value is false.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewBase">
+    <xs:annotation>
+      <xs:documentation>This is the abstract base class forBiTreeView andBiOlapGrid. It contains
+        the shared methods and implementations of these 2 classes
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewBase" substitutionGroup="TreeViewBase"/>
+
+  <xs:attributeGroup name="TreeViewBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="useNativeScrollBars" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to use native or custom scroll bars. Custom scroll bars are needed/preferred
+          when the tree view/grid has an attached component model or inline edit model.
+          If you want to change this it is better to change it before the component has
+          been created.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectionModel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTreeViewSelectionModel/BiOlapGridSelectionModel - The selection model handling the selected rows and cells
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="viewManager" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTreeViewViewManager/BiOlapGridViewManager - The view manager handles visual aspects that are not directly
+          related to
+          the data model
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataModel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTreeViewDataModel/BiOlapGridDataModel - The data model describes the data to be shown in the tree view and
+          OLAP grid
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="inlineEditModel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiInlineEditModel - The inline edit model is used to handle editing of cells in the tree view.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="attachedComponentModel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiAttachedComponentModel - The attached component model is used to handle Bindows components inside the
+          cells of the tree view.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewCellInfo">
+    <xs:annotation>
+      <xs:documentation>This represents information about a cell in the tree view.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewCellInfoAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewCellInfo" substitutionGroup="TreeViewCellInfo"/>
+
+  <xs:attributeGroup name="TreeViewCellInfoAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="row" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - What row the cell is part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="column" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - What column the cell is part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewDataModel">
+    <xs:annotation>
+      <xs:documentation>This defines the interface that is needed for a data model for aBiTreeView.
+        This actually implements a dummy data model. Extend this class to create
+        more useful data models
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewDataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewDataModel" substitutionGroup="TreeViewDataModel"/>
+
+  <xs:attributeGroup name="TreeViewDataModelAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="allExpanded" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Sets all available rows expanded.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondatachanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the data
+          has changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewDataModelEvent">
+    <xs:annotation>
+      <xs:documentation>This event class is used withBiTreeViewDataModel instances so that tree view can be updated to reflect the changes
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewDataModelEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewDataModelEvent" substitutionGroup="TreeViewDataModelEvent"/>
+
+  <xs:attributeGroup name="TreeViewDataModelEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+    <xs:attribute name="preventUpdate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Prevent update flag.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewDragHeader">
+    <xs:annotation>
+      <xs:documentation>This component is used to show a header being dragged when the user is
+        reorganizing the headers for aBiTreeView
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewDragHeaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewDragHeader" substitutionGroup="TreeViewDragHeader"/>
+
+  <xs:attributeGroup name="TreeViewDragHeaderAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewDragHeaderMarker">
+    <xs:annotation>
+      <xs:documentation>This class is used withBiTreeView when the columns are being reorder to
+        give feedback where the column will be dropped
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewDragHeaderMarkerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewDragHeaderMarker" substitutionGroup="TreeViewDragHeaderMarker"/>
+
+  <xs:attributeGroup name="TreeViewDragHeaderMarkerAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewResizeOutline">
+    <xs:annotation>
+      <xs:documentation>This component is used as an overlay above the column that is currently being
+        resized
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewResizeOutlineAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewResizeOutline" substitutionGroup="TreeViewResizeOutline"/>
+
+  <xs:attributeGroup name="TreeViewResizeOutlineAttributes">
+
+    <xs:attributeGroup ref="ResizeHandleAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewSelectionModel">
+    <xs:annotation>
+      <xs:documentation>Selection model forBiTreeView.
+
+        The selection model can operate in 2 modes: cell or row.
+        The selected cells/rows are identified by the row index/column index in the
+        data model.
+
+        The items in the selectedItems hash are of typeBiTreeViewSelectionModelItem
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewSelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewSelectionModel" substitutionGroup="TreeViewSelectionModel"/>
+
+  <xs:attributeGroup name="TreeViewSelectionModelAttributes">
+
+    <xs:attributeGroup ref="SelectionModelAttributes"/>
+
+    <xs:attribute name="selectionMode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Whether to use row selection or cell selection. Valid values are "row"
+          and "cell"
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewSelectionModelItem">
+    <xs:annotation>
+      <xs:documentation>This class is used internally inBiTreeViewSelectionModel to keep track of
+        the selected rows
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewSelectionModelItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewSelectionModelItem" substitutionGroup="TreeViewSelectionModelItem"/>
+
+  <xs:attributeGroup name="TreeViewSelectionModelItemAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="row" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The row that this represents</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="column" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The column that this represents</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewStateManager">
+    <xs:annotation>
+      <xs:documentation>A simple class that is used internally with theBiTreeView to keep track
+        of active and hover cell
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewStateManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewStateManager" substitutionGroup="TreeViewStateManager"/>
+
+  <xs:attributeGroup name="TreeViewStateManagerAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewViewManager">
+    <xs:annotation>
+      <xs:documentation>This class handles the visual properties of aBiTreeView
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewViewManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewViewManager" substitutionGroup="TreeViewViewManager"/>
+
+  <xs:attributeGroup name="TreeViewViewManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="treeView" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTreeView - The tree view this view manager is to be used with</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showGridLines" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show grid lines between the cells in the tree view</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scrollLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the scroll left to the view manager so that the view manager can figure out what column to
+          start at
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scrollTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the scroll top to the view manager so that the view manager can figure out what row to start at
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="indentColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the column that should be indented. Use -1 to not show any
+          indention
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="highlightSortColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to highlight the background of the sorted column</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnOrders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - The order of the columns in the visual representation</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rowHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of a row in the tree view</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the headers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="headersHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of the column headers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ascendingIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The path to the arrow image to use for ascending sort</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="descendingIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The path to the arrow image to use for descending sort</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showRowHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the row headers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rowHeadersWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the row headers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="UndeterminedProgressBar">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show a progress bar that shows progress
+        of an undeterminable size. The progress bar is animated to show that it
+        is busy. Use start and stop to control the
+        animation. Changing the maximum
+        changes the number of steps the animation does.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="UndeterminedProgressBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiUndeterminedProgressBar" substitutionGroup="UndeterminedProgressBar"/>
+
+  <xs:attributeGroup name="UndeterminedProgressBarAttributes">
+
+    <xs:attributeGroup ref="ProgressBarAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Uri">
+    <xs:annotation>
+      <xs:documentation>This class is used to define a Universal Resource Identifier (URI). This
+        is sometimes also known as a Uniform Resource Locator (URL). A URI is
+        used to describe the location and source of external files. A URI is
+        only a representation of the string format describing the URI. It does
+        not know how to lookup the information the URI might point at.
+        A general URI has the following format. Below this is a list of what
+        part of the URI maps to what property. http://user:[email protected]:80/dir/file.html?param0=value=0;param1=value1#fragment
+        scheme - http userInfo - user:password host - www.domain.com port - 80 path - /dir/file.html dirPath - /dir/ query -
+        ?param0=value=0;param1=value1
+        fragment - #fragment getParam("param0") - value0 getParam("param1") - value1 href -
+        http://user:[email protected]:80/dir/file.html?param0=value=0;param1=value1#fragment
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="UriAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiUri" substitutionGroup="Uri"/>
+
+  <xs:attributeGroup name="UriAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="href" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is the complete string representation of the URI.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="VBox">
+    <xs:annotation>
+      <xs:documentation>This is a verticalBiBox where components are laid out from top to bottom.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="VBoxAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiVBox" substitutionGroup="VBox"/>
+
+  <xs:attributeGroup name="VBoxAttributes">
+
+    <xs:attributeGroup ref="BoxAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="WebService">
+    <xs:annotation>
+      <xs:documentation>This is a factory class to the
+        Microsoft
+        WebService Behavior. Creating aBiWebService actually creates and returns
+        an HTML element with the given behavior attached.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WebServiceAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWebService" substitutionGroup="WebService"/>
+
+  <xs:attributeGroup name="WebServiceAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="WebService2">
+    <xs:annotation>
+      <xs:documentation>Construct a web service client. A BiWebService2 object allows accessing web services through SOAP, based on a WSDL
+        describing the services' interfaces. To use BiWebService2, first construct an object of this class. Then, call the object's
+        useService method -- passing the URL to the WSDL describing the service and the service's name. Finally, call syncInvoke,
+        asyncInvoke and callMethod to invoke service operations synchronously or asynchronously.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WebService2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWebService2" substitutionGroup="WebService2"/>
+
+  <xs:attributeGroup name="WebService2Attributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="async" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - This property determines whether or not calls made by the web service using callMethod and service
+          loading using useService without specifying an async flag is done asynchronously.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onserviceloaded" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Notifies that loading the WSDL used to describe the service represented by this instance is complete. If the event
+          has an 'err' member, this describes an error which occurred during loading.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncallcomplete" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Notifies that an asynchronous web service operation invocation was completed, either succesfuly or with errors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Window">
+    <xs:annotation>
+      <xs:documentation>This class is used for internal windows inside the application window.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WindowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWindow" substitutionGroup="Window"/>
+
+  <xs:attributeGroup name="WindowAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="continuousLayout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether resizing/moving of the window should be continuously updated.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="contentPane" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - This returns the component representing the client area of the window.
+          All components should be added to this component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the icon on the caption.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMinimize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the minimize button on the caption.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMaximize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiWindow - Whether to show the maximize button on the caption</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showClose" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the close button on the caption.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="caption" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The title text of the window.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage - The icon image to show on the window caption. Note that changing
+          the image object does not update the window icon. You'll have to
+          set the icon property to update the icon. The size of the icon
+          is ignored and will always be 16 x 16 pixels.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="canMinimize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the window can be minimized by the user.
+          If the window cannot be minimized and the minimize button is shown the
+          button is disabled.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="hideChrome" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to hide the caption bar of the window.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="resizable" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the window can be resized by the user.
+          If the window cannot be resized and the maximize button is shown the
+          button is disabled.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="movable" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the window can be moved by the user.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="state" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The state of the window. Valid values are: normal maximized minimized</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="active" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the window should be the active window.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="acceptButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiEventTarget - The button that acts as the default accept button. If this is set
+          then the action
+          event is dispatched from the accept button when the enter key
+          is pressed. This does not have to
+          be a BiButton, any
+          BiEventTarget will work.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cancelButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiEventTarget - The button that acts as the default cancel button. If this is set
+          then the action
+          event is dispatched from the cancel button when the Esc key is pressed.
+          This does not have to be a BiButton, any
+          BiEventTarget will work.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="opaque" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to make the window opaque. An opaque window will not let plugins and
+          other windowed controls show through. However, there is a price to this. This
+          is achieved using an internal iframe and this makes the window heavier and
+          slower.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this window. If this is set to
+          null then the string bundle for
+          application is used.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onbeforeclose" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the window is closed. If the
+          default action is prevented the window is
+          not closed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onclose" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the window is closed.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncaptionchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the caption changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onstatechanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the window state changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oniconchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the icon changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onactivated" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the window becomes active.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondeactivated" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the window becomes inactive</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="WindowManager">
+    <xs:annotation>
+      <xs:documentation>This class can be used with internal windows
+        to provide more features.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WindowManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWindowManager" substitutionGroup="WindowManager"/>
+
+  <xs:attributeGroup name="WindowManagerAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="component" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component that the windows are added to</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="activeWindow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiWindow - The window that is currently active. This might be null
+          if no window is active.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this window manager. If this is set to
+          null then the string bundle for
+          application is used.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onactivation" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>The window manager has become activated. E.g. one of its windows is activated.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondeactivation" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>The window manager is deactivated. You have left it and can no longer
+          manipulate its windows via keyboard shortcuts etc..
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Wizard">
+    <xs:annotation>
+      <xs:documentation>This component creates a dialog that contains a BiWizardPane.
+        The wizard pane provides buttons for navigating back and forth and finishing
+        and canceling the wizard.
+        Any BiComponent may be used as a page.
+        Use addPage to add pages to the wizard. The pages dispatch
+        activated and deactivated when the active page
+        changes. You can also use the change event to get notifications
+        about when the user changes the active page.
+        Most of the methods and properties provided by the BiWizardPane
+        are also available on the wizard dialog.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WizardAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWizard" substitutionGroup="Wizard"/>
+
+  <xs:attributeGroup name="WizardAttributes">
+
+    <xs:attributeGroup ref="DialogAttributes"/>
+
+    <xs:attribute name="selectedIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the selected page. If no page is selected this
+          returns -1.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedPage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The currently selected page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="backdropImage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage - The image used as the backdrop on the left side of the wizard pane.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this wizard dialog. For keys to use in the string
+          bundle seeBiWizardPane.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onback" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedPage changes to the previous page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onnext" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedPage changes to the next page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedPage page changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforechange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the selectedPage page changes. Call
+          preventDefault
+          on the event object to prevent the wizard to change the page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforeback" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the selectedPage changes to the previous page. Call
+          preventDefault
+          on the event object to prevent the wizard to change the page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforenext" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the selectedPage changes to the next page. Call
+          preventDefault
+          on the event object to prevent the wizard to change the page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforefinish" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the the wizard's finish event is called. Calling
+          preventDefault
+          on the event object will prevent the wizard from dispatching the finish event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforecancel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the the wizard's cancel event is called. Calling
+          preventDefault
+          on the event object will prevent the wizard from dispatching the cancel event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfinish" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is dispatched when the user clicks
+          the finish button.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncancel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is dispatched when the user clicks
+          the cancel button.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="WizardPane">
+    <xs:annotation>
+      <xs:documentation>This component creates a wizard that can contain 1 or more pages. The
+        wizard pane provides buttons for navigating back and forth and finishing
+        and canceling the wizard.
+        Any BiComponent may be used as a page.
+        Use addPage to add pages to the wizard. The pages dispatch
+        activated and deactivated when the active page
+        changes. You can also use the change event to get notifications
+        about when the user changes the active page.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WizardPaneAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWizardPane" substitutionGroup="WizardPane"/>
+
+  <xs:attributeGroup name="WizardPaneAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="selectedIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the selected page. If no page is selected this
+          returns -1.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedPage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The currently selected page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this wizard pane. If this is set to
+          null then the string bundle for
+          application is used.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onback" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedPage changes to the previous page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onnext" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedPage changes to the next page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedPage page changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforechange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the selectedPage page changes. Call
+          preventDefault
+          on the event object to prevent the wizard pane to change the page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforeback" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the selectedPage changes to the previous page. Call
+          preventDefault
+          on the event object to prevent the wizard pane to change the page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforenext" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the selectedPage changes to the next page. Call
+          preventDefault
+          on the event object to prevent the wizard pane to change the page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforefinish" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the the wizard pane's finish event is called. Calling
+          preventDefault
+          on the event object will prevent the wizard pane from dispatching the finish event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforecancel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the the wizard pane's cancel event is called. Calling
+          preventDefault
+          on the event object will prevent the wizard pane from dispatching the cancel event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfinish" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is dispatched when the user clicks
+          the finish button.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncancel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is dispatched when the user clicks
+          the cancel button.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="VmlLabel">
+    <xs:annotation>
+      <xs:documentation>This class is used internally inside aBiGraph for labels.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="VmlLabelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiVmlLabel" substitutionGroup="VmlLabel"/>
+
+  <xs:attributeGroup name="VmlLabelAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text align of the the text on the label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text to show on the label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fontSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The font size in pixels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="WsCallCompleteEvent">
+    <xs:annotation>
+      <xs:documentation>BiWsCallCompleteEvent -- notifies of an asynchronous call completion.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WsCallCompleteEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWsCallCompleteEvent" substitutionGroup="WsCallCompleteEvent"/>
+
+  <xs:attributeGroup name="WsCallCompleteEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlDataColumn">
+    <xs:annotation>
+      <xs:documentation>This class is used for the columns in aBiXmlDataSet.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlDataColumnAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlDataColumn" substitutionGroup="XmlDataColumn"/>
+
+  <xs:attributeGroup name="XmlDataColumnAttributes">
+
+    <xs:attributeGroup ref="DataColumnAttributes"/>
+
+    <xs:attribute name="xsType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The XML Schema type used for the column</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlDataRow">
+    <xs:annotation>
+      <xs:documentation>This class is used for the rows in aBiXmlDataSet.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlDataRowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlDataRow" substitutionGroup="XmlDataRow"/>
+
+  <xs:attributeGroup name="XmlDataRowAttributes">
+
+    <xs:attributeGroup ref="DataRowAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlDataSet">
+    <xs:annotation>
+      <xs:documentation>This class maps an xml file outputted from an ADO.NET DataSet to aBiDataSet.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlDataSetAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlDataSet" substitutionGroup="XmlDataSet"/>
+
+  <xs:attributeGroup name="XmlDataSetAttributes">
+
+    <xs:attributeGroup ref="DataSetAttributes"/>
+
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - This property can be used to load an external XML document and use that as
+          the source for the XML data set
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rootNode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Node - The root XML node used to define the data set. This is either aBiXmlDocument
+          or an XML element.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondataready" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is dispatched when the data set uses external
+          data and the data has been loaded.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlDataTable">
+    <xs:annotation>
+      <xs:documentation>This class is used for the tables in aBiXmlDataSet.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlDataTableAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlDataTable" substitutionGroup="XmlDataTable"/>
+
+  <xs:attributeGroup name="XmlDataTableAttributes">
+
+    <xs:attributeGroup ref="DataTableAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlDocument">
+    <xs:annotation>
+      <xs:documentation>This is a factory class to the Microsoft
+        DOMDocument
+        object. Creating aBiXmlDocument actually creates and returns a DOMDocument.
+        For Mozilla this returns a new XMLDocument (as defined by the W3C DOM). For
+        Mozilla we also extend the DOM Node interfaces to make it more compatible
+        with MSXML.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlDocumentAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlDocument" substitutionGroup="XmlDocument"/>
+
+  <xs:attributeGroup name="XmlDocumentAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlHttp">
+    <xs:annotation>
+      <xs:documentation>This is a factory class to the Microsoft
+        IXMLHTTPRequest
+        object. Creating aBiXmlHttp actually creates and returns an IXMLHTTPRequest.
+        For Mozilla this creates XMLHttpRequest, which happen
+        to implement the IXMLHTTPRequest interface.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlHttpAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlHttp" substitutionGroup="XmlHttp"/>
+
+  <xs:attributeGroup name="XmlHttpAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlLoader">
+    <xs:annotation>
+      <xs:documentation>Loads an XML document from the server or the local file system. (The
+        local file system can only be accessed when using a local application.)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlLoader" substitutionGroup="XmlLoader"/>
+
+  <xs:attributeGroup name="XmlLoaderAttributes">
+
+    <xs:attributeGroup ref="TextLoaderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlResourceParser">
+    <xs:annotation>
+      <xs:documentation>This class deserializes an XML document to a Bindows object hierarchy.
+        This is mostly tailored for BiComponent
+        hierarchies but can be used for any class extending BiObject.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlResourceParserAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlResourceParser" substitutionGroup="XmlResourceParser"/>
+
+  <xs:attributeGroup name="XmlResourceParserAttributes">
+
+    <xs:attributeGroup ref="XmlLoaderAttributes"/>
+
+    <xs:attribute name="autoNameMapping" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true any XML object that has an id attribute will create a
+          global reference (with the same name as the id value) to the object created
+          from this XML element.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rootNode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Node - The XML element that describes the root of the object hierarchy.
+          Only set this before you actually use the parser.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlRpc">
+    <xs:annotation>
+      <xs:documentation>This is a class that implements an XML-RPC client. The XML-RPC
+        specifcation can be found at http://www.xmlrpc.com/spec.
+        For more info and XML-RPC server implementations see
+        http://www.xmlrpc.com/.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlRpcAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlRpc" substitutionGroup="XmlRpc"/>
+
+  <xs:attributeGroup name="XmlRpcAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The URI where to find the remote procedure</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="async" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to use asynchronous method call. If this is true then
+          the call to callMethod returns instantly. When using
+          asynchronous calling use the result event for the call back
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="user" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The user name to pass to the server when calling the remote procedure</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="password" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The password to pass to the server when calling the remote procedure</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a method call
+          response is received from the server.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncallcomplete" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when
+          a method call is complete.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlRpcCallCompleteEvent">
+    <xs:annotation>
+      <xs:documentation>This event is used when a call to an XML-RPC server is completed
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlRpcCallCompleteEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlRpcCallCompleteEvent" substitutionGroup="XmlRpcCallCompleteEvent"/>
+
+  <xs:attributeGroup name="XmlRpcCallCompleteEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlRpcDouble">
+    <xs:annotation>
+      <xs:documentation>This class is useful when working withBiXmlRpc whenever a double is required
+        but you don't know whether the number is an integer or not
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlRpcDoubleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlRpcDouble" substitutionGroup="XmlRpcDouble"/>
+
+  <xs:attributeGroup name="XmlRpcDoubleAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlRpcError">
+    <xs:annotation>
+      <xs:documentation>This class is used when an error happens either at the server or due to an
+        invalid response from the server. Errors of this type are thrown byBiXmlRpc
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlRpcErrorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlRpcError" substitutionGroup="XmlRpcError"/>
+
+  <xs:attributeGroup name="XmlRpcErrorAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlRpcInt">
+    <xs:annotation>
+      <xs:documentation>This class is useful when working withBiXmlRpc whenever an int is required
+        but you don't know whether the number is an integer or not
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlRpcIntAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlRpcInt" substitutionGroup="XmlRpcInt"/>
+
+  <xs:attributeGroup name="XmlRpcIntAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XsTypeConverter">
+    <xs:annotation>
+      <xs:documentation>This class contains static methods that converts XML Schema types to Javascript
+        types as well as converting strings formatted according to the XML Schema
+        to Javascript values.
+        The following type relations are used
+
+        XS type name - JS type name - JS class
+        "negativeInteger" - "number" - Number
+        "unsignedShort" - "number" - Number
+        "unsignedByte" - "number" - Number
+        "unsignedLong" - "number" - Number
+        "unsignedInt" - "number" - Number
+        "decimal" - "number" - Number
+        "boolean" - "number" - Number
+        "integer" - "number" - Number
+        "double" - "number" - Number
+        "float" - "number" - Number
+        "short" - "number" - Number
+        "byte" - "number" - Number
+        "long" - "number" - Number
+        "int" - "number" - Number
+        "QName" - "string" - String
+        "string" - "string" - String
+        "normalizedString" - "string" - String
+        "dateTime" - "date" - Date
+        "date" - "date" - Date
+        "time" - "date" - Date
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XsTypeConverterAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXsTypeConverter" substitutionGroup="XsTypeConverter"/>
+
+  <xs:attributeGroup name="XsTypeConverterAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+
+  <xs:group name="BindowsComponentsGroup">
+    <xs:choice>
+      <!--<xs:group ref="iv:InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>-->
+      <!--<xs:element ref="DrawLine" minOccurs="0" maxOccurs="unbounded"/>-->
+      <xs:element ref="GridRow" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridChartRow" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeNode" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="AnimationRange" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Area" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="AreaCollection" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Base64" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Border" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartCategory" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartPoint" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartPresentation" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartPresentationManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartSeries" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DataColumn" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlDataColumn" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DataRow" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlDataRow" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DataTable" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlDataTable" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DateFormat" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DateFormatSymbols" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DrawAnchor" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="CssLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ImageLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ObjectLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Script" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ScriptLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SerializedLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Style" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TextLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="JsonLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="L10nLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlResourceParser" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="AttachedComponentModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InlineEditModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Command" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Component" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ColumnChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="BarChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PercentageStackedColumnChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PercentageStackedBarChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StackedColumnChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StackedBarChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="LineChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PieChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ColumnChart2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="BarChart2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PercentageStackedColumnChart2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PercentageStackedBarChart2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StackedColumnChart2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StackedBarChart2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ColumnChartSection" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="LineMarker" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PieChartSection" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ColumnChartSection2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Grid" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Tree" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="AccordionPage" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="AccordionPane" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Box" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="HBox" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="VBox" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Calendar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartAreaBase" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartArea" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartArea2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartCategoryAxisBase" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartCategoryAxis" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartCategoryAxis2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartGridLinesBase" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartGridLines" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartGridLines2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartLegend" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartValueAxisBase" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartValueAxis" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartValueAxis2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ComboBox" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DatePicker" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DesktopPane" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DockPanel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="FlowPanel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2Component" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2CircularBorder" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2ImageBorder" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RectangularBorder" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2BasicCap" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2LinearGradientFiller" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RadialGradientFiller" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RingGradientFiller" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2PlainColorFiller" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2LinearRange" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RadialRange" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2LinearScale" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RadialScaleSection" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2LinearTicks" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RadialTicks" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2LinearNeedle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RadialNeedle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2Group" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugeLabels" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugeMajorTicks" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugeMinorTicks" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugeNeedle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugePlate" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugeSection" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GraphBase" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Graph" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Graph2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GraphContentArea" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridHeaders" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridPanel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridPanel2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridRowHeaders" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GroupBox" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Iframe" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PrintFrame" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="RichEdit" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Image" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InlineComponent" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="IpField" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Label" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Button" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="AccordionButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="RepeatButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartLegendLabel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="CheckBox" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2Label" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugeTitle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridHeader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridHeaderCorner" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridHeaderFiller" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GroupBoxTitle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ListItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ComboBoxItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Popup" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolTip" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="RadioButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StatusBarPanel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarMenuButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarSplitMenuButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarToggleButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarRadioButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TabButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarSplitToggleMenuButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewDragHeader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="LinkManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="List" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="MenuBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="MoveHandle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridDropMarker" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OptionPane" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ProgressBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="UndeterminedProgressBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ResizeHandle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridResizeOutline" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewResizeOutline" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ScrollBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Slider" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Spinner" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SplitPane" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StatusBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TabPage" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TabPane" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TextField" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PasswordField" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TextArea" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TimePicker" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TabBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarSeparator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewBase" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGrid" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeView" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Grid2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SingleTree" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Tree2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewDragHeaderMarker" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="VmlLabel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Window" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Dialog" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ColorPicker" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Wizard" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="WizardPane" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ComponentAnimation" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="LocationAnimator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OpacityAnimator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SizeAnimator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DataSet" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlDataSet" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="FpsGenerator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ImageMap" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ImageMapArea" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ImagePreloader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Link" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Menu" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="MenuItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="CheckBoxMenuItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="MenuButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="MenuSeparator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="RadioButtonMenuItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridDataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridStateManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="RadioGroup" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="RangeModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ResourceLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ScriptLoaderQueue" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="CalendarSelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridSelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ListSelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridSelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeSelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewSelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StringBundle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TextParser" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ThemeManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Timer" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewDataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DataSetDataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Grid2DataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridDataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeDataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SingleTreeDataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Tree2DataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewStateManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="WebService2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="WindowManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlRpc" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Font" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Grid2Cell" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Grid2Row" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridCell" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridChartCell" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridColumn" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridPanel2Cell" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridPanel2Row" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="HashTable" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Json" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Line" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="LoadManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Math" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridCellInfo" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridViewManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OrderedIterator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Point" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PopupManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SelectionItemCollection" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Set" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Shape" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Circle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Polygon" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SingleTreeNode" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Sort" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StringBuffer" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Subtree" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Theme" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TimerManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolTipManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Tree2Cell" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Tree2Row" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeHelper" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeIterator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeIteratorStackItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeNode2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewCellInfo" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewSelectionModelItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewViewManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Grid2ViewManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SingleTreeViewManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Tree2ViewManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Uri" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XsTypeConverter" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="WebService" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlDocument" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlHttp" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlRpcError" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlRpcDouble" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlRpcInt" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="L10nString" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:choice>
+  </xs:group>
+
+</xs:schema>
+
+
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation18_2.xsd b/xml/tests/testData/xml/ComplexSchemaValidation18_2.xsd
new file mode 100644
index 0000000..45de8b9
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation18_2.xsd
@@ -0,0 +1,1204 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           targetNamespace="http://www.infiview.net/infiview"
+           xmlns="http://www.infiview.net/infiview"
+           xmlns:bi="http://www.bindows.net/IVBindowsSchema"
+           elementFormDefault="qualified">
+
+  <xs:import namespace="http://www.bindows.net/IVBindowsSchema" schemaLocation="IVBindowsAdfSchema.xsd"/>
+
+  <!--<xs:element name="InfiView">-->
+  <!--<xs:annotation>-->
+  <!--<xs:documentation>This class is the main class of InfiView.-->
+  <!--It can configured for many different purposes using the InfiView Markup format.-->
+  <!--</xs:documentation>-->
+  <!--</xs:annotation>-->
+  <!--<xs:complexType>-->
+  <!--<xs:choice minOccurs="0" maxOccurs="unbounded">-->
+  <!--<xs:group ref="InfiViewComponentsGroup"/>-->
+  <!--</xs:choice>-->
+  <!--<xs:attributeGroup ref="InfiViewAttributes"/>-->
+  <!--</xs:complexType>-->
+  <!--</xs:element>-->
+
+  <!--<xs:element name="AbstractDataContainer">-->
+  <!--<xs:annotation>-->
+  <!--<xs:documentation>Abstract data container class-->
+  <!--</xs:documentation>-->
+  <!--</xs:annotation>-->
+  <!--<xs:complexType>-->
+  <!--<xs:choice>-->
+  <!--<xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>-->
+  <!--</xs:choice>-->
+  <!--<xs:attributeGroup ref="AbstractDataContainerAttributes"/>-->
+  <!--</xs:complexType>-->
+  <!--</xs:element>-->
+
+  <xs:attributeGroup name="AbstractDataContainerAttributes">
+
+    <xs:attributeGroup ref="ViewportRectangleAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractViewport">
+    <xs:annotation>
+      <xs:documentation>The abstract representation of the viewport collects methods giving
+        a consistent interface for building custom viewports. x
+
+        The viewport is a component which makes it possible to write
+        applications with practically infinite surfaces containing a
+        tremendous amount of information which should be swapped in and out
+        from either an internal lightweight information structure or server
+        side information.
+        <br/>
+
+        The abstract viewport adds a resize and a
+        mousewheel event listener in its constructor. The resize event is
+        coupled to the resizeVisibleArea method of the given data model and
+        the mousewheel event scrolls the viewport vertically by 50 pixels.
+        This behavior can be overriden by overriding the onMouseWheel method.
+        <br/>
+
+        The default render margin is zero in both directions.
+        <br/>
+
+        setScrollLeft and setScrollTop are overridden to empty functions to
+        avoid auto-scrolling problems when using drag-and-drop.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="AbstractViewportAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractViewportModel">
+    <xs:annotation>
+      <xs:documentation>This is the is the foundation for all viewport data models which are
+        used to manage the information on which infiview.AbstractViewport
+        descendants are dependent on. The data model should store either
+        lightweight information about components or manage communication
+        with information on a server.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="AbstractViewportModelAttributes">
+
+    <xs:attribute name="onzoomchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Dispatched when the zoom level changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncenterview" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Dispatched when the view is centered.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Actions">
+    <xs:annotation>
+      <xs:documentation>The class infiview.Actions is used by infiview.InfiView.
+
+        TODO: Explain the purpose of this class.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ActionsAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ActionsAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComponentDataConstructor">
+    <xs:annotation>
+      <xs:documentation>Data contructor holder
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentDataConstructorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ComponentDataConstructorAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComponentDataContainer">
+    <xs:annotation>
+      <xs:documentation>Wrapper class for objects inserted into a infiview.GraphViewportDatamodel
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentDataContainerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ComponentDataContainerAttributes">
+
+    <xs:attributeGroup ref="AbstractDataContainerAttributes"/>
+
+    <xs:attribute name="data" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - Set the data of this container.
+          The properties that are given in the "persistentDataMap" property are saved int the container.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComponentViewport">
+    <xs:annotation>
+      <xs:documentation>Implemented viewport for handling components. It is used together
+        with a infiview.ComponentViewportModel.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ComponentViewportAttributes">
+
+    <xs:attributeGroup ref="AbstractViewportAttributes"/>
+
+    <xs:attribute name="zoomFactorDependantData" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:EDIT_THIS - This property turns on or off the zoom factor dependant data.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComponentViewportModel">
+    <xs:annotation>
+      <xs:documentation>Data model intended for keeping externally added components.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ComponentViewportModelAttributes">
+
+    <xs:attributeGroup ref="ZoomableViewportModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DrawAnchor">
+    <xs:annotation>
+      <xs:documentation>This class defines static properties that represent the anchoring locations for edge
+        lines.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DrawAnchorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="DrawAnchorAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DynamicPreviewViewportNavigator">
+    <xs:annotation>
+      <xs:documentation>This class is specialized navigator that loads images as preview background.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DynamicPreviewViewportNavigatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="DynamicPreviewViewportNavigatorAttributes">
+
+    <xs:attributeGroup ref="ViewportNavigatorAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="EdgeType">
+    <xs:annotation>
+      <xs:documentation>The class infiview.PropertyForms is used by infiview.InfiView.
+        Container for edge type information.
+        Used as data holder when creating edges in InfiView graphs.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EdgeTypeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="EdgeTypeAttributes">
+
+    <xs:attributeGroup ref="InfiViewTypeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="EdgeTypes">
+    <xs:annotation>
+      <xs:documentation>The class infiview.EdgeTypes is used by infiview.InfiView.
+        It holds a list of EdgeType.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EdgeTypesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="EdgeTypesAttributes">
+
+    <xs:attributeGroup ref="TypeTableAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="EventListener">
+    <xs:annotation>
+      <xs:documentation>The class infiview.EventListener is used by infiview.InfiView.
+        This class is the holder of a event l├нstener. Used by property forms.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EventListenerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="EventListenerAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="EventListeners">
+    <xs:annotation>
+      <xs:documentation>The class infiview.EventListeners is used by infiview.InfiView.
+        Holder of a list of infiview.EventListener.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EventListenersAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="EventListenersAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GraphDataContainer">
+    <xs:annotation>
+      <xs:documentation>Wrapper class for objects inserted into a infiview.GraphViewportDatamodel
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GraphDataContainerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GraphDataContainerAttributes">
+
+    <xs:attributeGroup ref="ComponentDataContainerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GraphViewport">
+    <xs:annotation>
+      <xs:documentation>Viewport specialized for containing a edge manager to handle very
+        large graphs.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GraphViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GraphViewportAttributes">
+
+    <xs:attributeGroup ref="ComponentViewportAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GraphViewportModel">
+    <xs:annotation>
+      <xs:documentation>Specialized model for the infiview.GraphViewport which handles very
+        large graphs.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GraphViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GraphViewportModelAttributes">
+
+    <xs:attributeGroup ref="ComponentViewportModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+
+  <xs:attributeGroup name="InfiViewAttributes">
+    <xs:attribute name="currentState" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:EDIT_THIS - This method sets the current state, it loads the panel icons and
+          troolbar associated with the desired state
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="InfiViewComponentDataContainer">
+    <xs:annotation>
+      <xs:documentation>infiview.InfiViewComponentDataContainer is the light weight representation of an node
+        residing
+        in a InfiView.
+        This class can be inherit for adding och changing features of adding and dipsosing visual nodes in a
+        InfiView.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InfiViewComponentDataContainerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InfiViewComponentDataContainerAttributes">
+
+    <xs:attributeGroup ref="InteractiveGraphDataContainerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InfiViewType">
+    <xs:annotation>
+      <xs:documentation>Basic class for element and edge type classes.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InfiViewTypeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InfiViewTypeAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InfiViewViewport">
+    <xs:annotation>
+      <xs:documentation>Viewport specialized for representing different charts using the edge api
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InfiViewViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InfiViewViewportAttributes">
+
+    <xs:attributeGroup ref="InteractiveGraphViewportAttributes"/>
+
+    <xs:attribute name="infiView" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:EDIT_THIS - EDIT_THIS</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="InfiViewViewportModel">
+    <xs:annotation>
+      <xs:documentation>Specialized model for the infiview.GraphViewport which handles very
+        large graphs.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InfiViewViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InfiViewViewportModelAttributes">
+
+    <xs:attributeGroup ref="InteractiveGraphViewportModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InteractiveGraphDataContainer">
+    <xs:annotation>
+      <xs:documentation>Wrapper class for objects inserted into a infiview.GraphViewportDatamodel
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InteractiveGraphDataContainerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InteractiveGraphDataContainerAttributes">
+
+    <xs:attributeGroup ref="GraphDataContainerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InteractiveGraphViewport">
+    <xs:annotation>
+      <xs:documentation>Viewport specialized for representing different interactive charts.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InteractiveGraphViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InteractiveGraphViewportAttributes">
+
+    <xs:attributeGroup ref="GraphViewportAttributes"/>
+
+    <xs:attribute name="edgeMode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:boolean - Edge mode enabled / disabled</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="multiSelection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If this value is set to true it enables multipe selection of elements
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="InteractiveGraphViewportModel">
+    <xs:annotation>
+      <xs:documentation>Specialized model of the infiview.GraphViewport which adds additional features for
+        interactivity.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InteractiveGraphViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InteractiveGraphViewportModelAttributes">
+
+    <xs:attributeGroup ref="GraphViewportModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MarqueeSelector">
+    <xs:annotation>
+      <xs:documentation>This component can be used as a wireframe for selecting components on a drawing area. Add
+        this to the same area and
+        on the mousedown event call startSelection(e) passing the BiMouseEvent object from the mousedown event
+        handler as
+        the parameter e.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MarqueeSelectorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="MarqueeSelectorAttributes">
+
+    <xs:attribute name="onselectionprogress" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.SelectionEvent Fires continually during the resizing of the wireframe
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onselectionend" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.SelectionEvent This is fired when the user releases the mouse button to signal
+          that the selection is complete.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onselectionstart" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired before the selection is starts. To prevent the wireframe
+          from being displayed call
+          preventDefault
+          on the event object.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="NodeDefinition">
+    <xs:annotation>
+      <xs:documentation>This class represents a node definition.
+        A node type can contain 1-* node definitions.
+        The node definition keeps information about how a node should be created.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="NodeDefinitionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="NodeDefinitionAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="NodeDefinitionConstructor">
+    <xs:annotation>
+      <xs:documentation>Node constuctor holder for InfiViewComponentDataContainer.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="NodeDefinitionConstructorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="NodeDefinitionConstructorAttributes">
+
+    <xs:attributeGroup ref="ComponentDataConstructorAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="NodeType">
+    <xs:annotation>
+      <xs:documentation>The class infiview.NodeType is used by infiview.InfiView.
+        This class holds the information how to create a data container for
+        a specific node type.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="NodeTypeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="NodeTypeAttributes">
+
+    <xs:attributeGroup ref="InfiViewTypeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="NodeTypes">
+    <xs:annotation>
+      <xs:documentation>Container for node types.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="NodeTypesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="NodeTypesAttributes">
+
+    <xs:attributeGroup ref="TypeTableAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PreviewImage">
+    <xs:annotation>
+      <xs:documentation>This class is used for showing images.
+        Supported image types are GIF, JPEG and PNG (including support for 32-bit RGBA).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PreviewImageAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="PreviewImageAttributes">
+
+    <!--<xs:attribute name="onload" type="xs:string">-->
+    <!--<xs:annotation>-->
+    <!--<xs:documentation>Fires when the image loads. Note that the image file may be-->
+    <!--loaded before the constructor finishes and you should not only-->
+    <!--rely on this event but also use loaded property.-->
+    <!--</xs:documentation>-->
+    <!--</xs:annotation>-->
+    <!--</xs:attribute>-->
+
+    <xs:attribute name="onerror" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the image failed to load.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PropertyForm">
+    <xs:annotation>
+      <xs:documentation>The class infiview.PropertyForm is used by infiview.InfiView.
+        This class holds information for creating a property form
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PropertyFormAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="PropertyFormAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PropertyForms">
+    <xs:annotation>
+      <xs:documentation>The class infiview.PropertyForms is used by infiview.InfiView.
+        This class is a container holding PropertyForm objects.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PropertyFormsAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="PropertyFormsAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Resources">
+    <xs:annotation>
+      <xs:documentation>The class infiview.Resources is used by infiview.InfiView.
+        Container for the resources.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ResourcesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ResourcesAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RTree">
+    <xs:annotation>
+      <xs:documentation>R-Tree implementation. The R-tree is a tree designed to make fast
+        searches of rectangular areas.
+
+        Code is based on Guttman, A. "R-Trees: A Dynamic Index Structure for
+        Spatial Searching", ACM 1984.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RTreeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="RTreeAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Selection">
+    <xs:annotation>
+      <xs:documentation>Adds a selection wireframe around multiple nodes that can then be dragged with the mouse.
+        Nodes can be added to and removed from the selection as needed.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SelectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="SelectionAttributes">
+
+    <!--<xs:attributeGroup ref="AbstractSelectionAttributes"/>-->
+
+    <xs:attribute name="border" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiBorder - Sets the default appearance of the wireframe</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.Event Fired when nodes are added to and removed from the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmovestart" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.Event Fired when user starts dragging the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmoveend" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.Event Fired when user has finished dragging the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SelectionEvent">
+    <xs:annotation>
+      <xs:documentation>The event dispatched by infiview.MarqueeSelector.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SelectionEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="SelectionEventAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="State">
+    <xs:annotation>
+      <xs:documentation>The class infiview.State is used by infiview.InfiView.
+        This class represents a state.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StateAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="StateAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="States">
+    <xs:annotation>
+      <xs:documentation>The class infiview.States is used by infiview.InfiView.
+        Container of states.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StatesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="StatesAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolGroup">
+    <xs:annotation>
+      <xs:documentation>The class infiview.ToolGroup is used by infiview.InfiView.
+        Container for tools, when tools are layout every group will separated.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolGroupAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ToolGroupAttributes">
+
+    <xs:attribute name="upActions" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:infiview.InfiView - This method binds certains tool components events to infiview
+          actions.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tools">
+    <xs:annotation>
+      <xs:documentation>The class infiview.Tools is used by infiview.InfiView.
+
+        TODO: Describe the purpose of this class.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolsAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ToolsAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TypeTable">
+    <xs:annotation>
+      <xs:documentation>The class infiview.TypeTable is used by infiview.InfiView.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TypeTableAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="TypeTableAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ViewportMarqueeSelector">
+    <xs:annotation>
+      <xs:documentation>This component can be used as a wireframe for selecting components on a drawing area. Add
+        this to the same area and
+        on the mousedown event call startSelection(e) passing the infiview.MouseEvent object from the mousedown
+        event handler as
+        the parameter e.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ViewportMarqueeSelectorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ViewportMarqueeSelectorAttributes">
+
+    <xs:attributeGroup ref="MarqueeSelectorAttributes"/>
+
+    <!--<xs:attribute name="onselectionprogress" type="xs:string">-->
+    <!--<xs:annotation>-->
+    <!--<xs:documentation>.SelectionEvent Fires continually during the resizing of the wireframe-->
+    <!--</xs:documentation>-->
+    <!--</xs:annotation>-->
+    <!--</xs:attribute>-->
+
+    <!--<xs:attribute name="onselectionend" type="xs:string">-->
+    <!--<xs:annotation>-->
+    <!--<xs:documentation>.SelectionEvent This is fired when the user releases the mouse button to signal-->
+    <!--that the selection is complete.-->
+    <!--</xs:documentation>-->
+    <!--</xs:annotation>-->
+    <!--</xs:attribute>-->
+
+    <!--<xs:attribute name="onselectionstart" type="xs:string">-->
+    <!--<xs:annotation>-->
+    <!--<xs:documentation>.Event This is fired before the selection is starts. To prevent the wireframe-->
+    <!--from being displayed call-->
+    <!--preventDefault-->
+    <!--on the event object.-->
+    <!--</xs:documentation>-->
+    <!--</xs:annotation>-->
+    <!--</xs:attribute>-->
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ViewportNavigator">
+    <xs:annotation>
+      <xs:documentation>This class implements the basic viewport navigator.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ViewportNavigatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ViewportNavigatorAttributes">
+
+    <xs:attribute name="cursorColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets the color of the cursor.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ViewportNavigatorCursor">
+    <xs:annotation>
+      <xs:documentation>TODO: Document class.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ViewportNavigatorCursorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ViewportNavigatorCursorAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ViewportRectangle">
+    <xs:annotation>
+      <xs:documentation>Helping class for describing a bounding rectangle in viewports.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ViewportRectangleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ViewportRectangleAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ZoomableViewportModel">
+    <xs:annotation>
+      <xs:documentation>This is the is foundation for all viewport data models which are
+        used to manage the information on which infiview.ZoomableViewport
+        decendents are dependent on. The data model should either store
+        lightweight information about components or manage communication
+        with information on a server.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ZoomableViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ZoomableViewportModelAttributes">
+
+    <xs:attributeGroup ref="AbstractViewportModelAttributes"/>
+
+    <xs:attribute name="nearestZoomFactor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Set nearest available zoom factor</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="nearestLowerZoomFactor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Set nearest lower available zoom factor</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="zoomFactorModel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:infiview.ZoomFactorModel - Set the zoom factor model.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onzoomfactorchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Dispatched when the zoom level changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:group name="InfiViewComponentsGroup">
+    <xs:choice>
+      <!--<xs:group ref="bi:BindowsComponentsGroup"/>-->
+      <xs:element ref="AbstractViewport" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ComponentViewport" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GraphViewport" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InteractiveGraphViewport" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InfiViewViewport" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="AbstractViewportModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ZoomableViewportModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ComponentViewportModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GraphViewportModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InteractiveGraphViewportModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InfiViewViewportModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Actions" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ComponentDataConstructor" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="NodeDefinitionConstructor" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DrawAnchor" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="EventListener" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="EventListeners" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InfiViewType" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="EdgeType" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="NodeType" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="MarqueeSelector" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ViewportMarqueeSelector" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="NodeDefinition" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PreviewImage" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PropertyForm" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PropertyForms" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Resources" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="RTree" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Selection" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SelectionEvent" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="State" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="States" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolGroup" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Tools" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TypeTable" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="EdgeTypes" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="NodeTypes" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ViewportNavigator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DynamicPreviewViewportNavigator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ViewportNavigatorCursor" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ViewportRectangle" minOccurs="0" maxOccurs="unbounded"/>
+      <!--<xs:element ref="AbstractDataContainer" minOccurs="0" maxOccurs="unbounded"/>-->
+      <xs:element ref="ComponentDataContainer" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GraphDataContainer" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InteractiveGraphDataContainer" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InfiViewComponentDataContainer" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:choice>
+  </xs:group>
+
+  <!--These infiview specific elements are allowed inside normal Bindows component elements -->
+  <xs:group name="ElementsAllowedExternally">
+    <xs:choice>
+      <xs:element ref="ViewportNavigator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InfiViewViewport" minOccurs="0" maxOccurs="unbounded"/>
+
+    </xs:choice>
+  </xs:group>
+</xs:schema>
+
+
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation19.xml b/xml/tests/testData/xml/ComplexSchemaValidation19.xml
new file mode 100644
index 0000000..cab183c
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation19.xml
@@ -0,0 +1,18 @@
+<Application
+  xmlns="http://www.bindows.net/IVBindowsSchema"
+  xmlns:iv="http://www.infiview.net/infiview"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation=
+    "http://www.bindows.net/IVBindowsSchema ComplexSchemaValidation19.xsd
+                 http://www.infiview.net/infiview ComplexSchemaValidation19_2.xsd"
+  autoNameMapping="true"
+  >
+
+  <Window caption="Network Topology Test" width="1024" height="728">
+    <iv:InfiView id="aaa">
+      <iv:AbstractViewport/>
+    </iv:InfiView>
+
+  </Window>
+
+</Application>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation19.xsd b/xml/tests/testData/xml/ComplexSchemaValidation19.xsd
new file mode 100644
index 0000000..e37796f
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation19.xsd
@@ -0,0 +1,14453 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns="http://www.bindows.net/IVBindowsSchema"
+           targetNamespace="http://www.bindows.net/IVBindowsSchema"
+           elementFormDefault="qualified"
+           xmlns:iv="http://www.infiview.net/infiview"
+  >
+
+  <xs:import namespace="http://www.infiview.net/infiview"
+             schemaLocation="ComplexSchemaValidation19_2.xsd"/>
+
+  <xs:element name="Application">
+    <xs:complexType>
+      <xs:choice minOccurs="1" maxOccurs="unbounded">
+        <xs:element name="SplashScreen" minOccurs="0" maxOccurs="1"/>
+        <xs:element ref="Theme" minOccurs="0" maxOccurs="unbounded"/>
+
+        <xs:element name="Window" minOccurs="1" maxOccurs="1">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+              <xs:element ref="iv:InfiView" minOccurs="0" maxOccurs="1"/>
+              <!--<xs:element ref="iv:InfiView" minOccurs="0" maxOccurs="unbounded"/>-->
+              <!--<xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>-->
+            </xs:choice>
+            <xs:attributeGroup ref="ApplicationWindowAttributes"/>
+          </xs:complexType>
+          <!--<xs:complexType>-->
+          <!--<xs:choice minOccurs="0" maxOccurs="unbounded">-->
+          <!--<xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>-->
+          <!--<xs:element name="InfiView">-->
+          <!--<xs:complexType>-->
+          <!--<xs:choice minOccurs="0" maxOccurs="unbounded">-->
+          <!--<xs:group ref="iv:InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>-->
+          <!--<xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>-->
+          <!--</xs:choice>-->
+          <!--<xs:attributeGroup ref="ComponentAttributes"/>-->
+          <!--<xs:attributeGroup ref="iv:InfiViewAttributes"/>-->
+          <!--</xs:complexType>-->
+          <!--</xs:element>-->
+          <!--</xs:choice>-->
+          <!--<xs:attributeGroup ref="ApplicationWindowAttributes"/>-->
+          <!--</xs:complexType>-->
+
+        </xs:element>
+
+        <xs:element name="Resources" minOccurs="0" maxOccurs="1">
+          <xs:complexType>
+            <xs:choice maxOccurs="unbounded" minOccurs="0">
+              <xs:element name="Script">
+                <xs:complexType mixed="true">
+                  <xs:attributeGroup ref="ScriptAttributes"/>
+                </xs:complexType>
+              </xs:element>
+
+              <xs:element name="Package">
+                <xs:complexType>
+                  <xs:annotation>
+                    <xs:documentation>A package which will be loaded before the rest of the ADF is parsed.</xs:documentation>
+                  </xs:annotation>
+                  <xs:attributeGroup ref="PackageAttributes"/>
+                </xs:complexType>
+              </xs:element>
+
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+      <xs:attributeGroup ref="ApplicationAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+
+  <xs:attributeGroup name="PackageAttributes">
+    <xs:annotation>
+      <xs:documentation>Loads a Bindows package or script before parsing the rest of the ADF (including &lt;Script&gt; tags).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>The location of the package script file (relative to Bindows)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="name" type="PackageTypes">
+      <xs:annotation>
+        <xs:documentation>The name of the package</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:simpleType name="PackageTypes">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="Loaders"/>
+      <xs:enumeration value="OlapGrid"/>
+      <xs:enumeration value="Charting"/>
+      <xs:enumeration value="WebService2"/>
+      <xs:enumeration value="Accessibility"/>
+      <xs:enumeration value="Animation"/>
+      <xs:enumeration value="Gauge2"/>
+      <xs:enumeration value="InfiView"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+
+  <xs:element name="AbstractChart">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for charts that are to be used with
+        BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractChart" substitutionGroup="AbstractChart"/>
+
+  <xs:attributeGroup name="AbstractChartAttributes">
+
+    <xs:attributeGroup ref="AbstractChartBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for charts that are to be used with
+        BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractChart2" substitutionGroup="AbstractChart2"/>
+
+  <xs:attributeGroup name="AbstractChart2Attributes">
+
+    <xs:attributeGroup ref="AbstractChartBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractChartBase">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for BiAbstractChart
+        and BiAbstractChart2. All the charts
+        in BiGraph and BiGraph2
+        extend either BiAbstractChart or
+        BiAbstractChart2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractChartBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractChartBase" substitutionGroup="AbstractChartBase"/>
+
+  <xs:attributeGroup name="AbstractChartBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractChartSection">
+    <xs:annotation>
+      <xs:documentation>
+        Used as base class for marker, column rect and pie chart section. These
+        are used to create the visual presentation for the data points of a chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractChartSectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractChartSection" substitutionGroup="AbstractChartSection"/>
+
+  <xs:attributeGroup name="AbstractChartSectionAttributes">
+
+    <xs:attributeGroup ref="AbstractChartSectionBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractChartSection2">
+    <xs:annotation>
+      <xs:documentation>
+        Used as base class for the column rectangles in BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractChartSection2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractChartSection2" substitutionGroup="AbstractChartSection2"/>
+
+  <xs:attributeGroup name="AbstractChartSection2Attributes">
+
+    <xs:attributeGroup ref="AbstractChartSectionBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractChartSectionBase">
+    <xs:annotation>
+      <xs:documentation>
+        Used as base class for marker, column rect and pie chart section. These
+        are used to create the visual presentation for the data points of a chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractChartSectionBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractChartSectionBase" substitutionGroup="AbstractChartSectionBase"/>
+
+  <xs:attributeGroup name="AbstractChartSectionBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="strokeOpacity">
+      <xs:annotation>
+        <xs:documentation>The stroke opacity for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="strokeColor">
+      <xs:annotation>
+        <xs:documentation>The stroke color for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillOpacity">
+      <xs:annotation>
+        <xs:documentation>The fill opacity for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor">
+      <xs:annotation>
+        <xs:documentation>The fill color for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor2">
+      <xs:annotation>
+        <xs:documentation>The alternate fill color used when fill type is gradient</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillType">
+      <xs:annotation>
+        <xs:documentation>The fill type used when painting the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillAngle">
+      <xs:annotation>
+        <xs:documentation>The fill angle used when painting the chart.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="markerType">
+      <xs:annotation>
+        <xs:documentation>The marker type for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="markerVisible">
+      <xs:annotation>
+        <xs:documentation>Whether markers are visible for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="explode">
+      <xs:annotation>
+        <xs:documentation>The amount to move the pie chart section from the center (percentage of radius)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2Border">
+    <xs:annotation>
+      <xs:documentation>BiAbstractGauge2Border is the base class of all gauge2 borders
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2BorderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2Border" substitutionGroup="AbstractGauge2Border"/>
+
+  <xs:attributeGroup name="AbstractGauge2BorderAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2Cap">
+    <xs:annotation>
+      <xs:documentation>This the base class of all caps
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2CapAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2Cap" substitutionGroup="AbstractGauge2Cap"/>
+
+  <xs:attributeGroup name="AbstractGauge2CapAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2Filler">
+    <xs:annotation>
+      <xs:documentation>This the base class of all fillers, fillers is used for coloring the background of gauge2 objects
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2FillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2Filler" substitutionGroup="AbstractGauge2Filler"/>
+
+  <xs:attributeGroup name="AbstractGauge2FillerAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2GradientFiller">
+    <xs:annotation>
+      <xs:documentation>This class is the base class of all gradient fillers.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2GradientFillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2GradientFiller" substitutionGroup="AbstractGauge2GradientFiller"/>
+
+  <xs:attributeGroup name="AbstractGauge2GradientFillerAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2FillerAttributes"/>
+
+    <xs:attribute name="color1" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The color1 that the filler is going to use.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="color2" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The color2 that the filler is going to use.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="opacity1" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The opacity1 that the filler is going to use for color1.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="opacity2" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The opacity2 that the filler is going to use for color2.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="xpos" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The the x position of the center of the radial filling.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ypos" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The the y position of the center of the radial filling.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="highLightCenter" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Center of the highlight of the ring in percent. 0 being at the inner radius, 100
+          at the outer radius.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="thickness" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Thickness of the "ring" in percent.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2Range">
+    <xs:annotation>
+      <xs:documentation>This class is the base class of all gauge2 ranges. A gauge2 range contains the "ticks" and "scales" and it can also
+        contain "borders".
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2RangeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2Range" substitutionGroup="AbstractGauge2Range"/>
+
+  <xs:attributeGroup name="AbstractGauge2RangeAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2Scale">
+    <xs:annotation>
+      <xs:documentation>This class is the base class of all scales
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2ScaleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2Scale" substitutionGroup="AbstractGauge2Scale"/>
+
+  <xs:attributeGroup name="AbstractGauge2ScaleAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+    <xs:attribute name="labelColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Color of the label printing the scale values</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="labelSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Size of the label printing the scale values</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="numValSteps" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Number of steps between values</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="startVal" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The start value</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endVal" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The end value</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="postString" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - String that is printed before values.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="preString" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - String that is printed after values.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2ScaleSection">
+    <xs:annotation>
+      <xs:documentation>This is the base class for all scale sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2ScaleSectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2ScaleSection" substitutionGroup="AbstractGauge2ScaleSection"/>
+
+  <xs:attributeGroup name="AbstractGauge2ScaleSectionAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+    <xs:attribute name="startVal" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The start value of the sacle section</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endVal" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The end value of the sacle section</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2Ticks">
+    <xs:annotation>
+      <xs:documentation>This class is the base class of all ticks classes
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2TicksAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2Ticks" substitutionGroup="AbstractGauge2Ticks"/>
+
+  <xs:attributeGroup name="AbstractGauge2TicksAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+    <xs:attribute name="tickLength" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The length of each tick.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="numTickSteps" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Number of steps between ticks i.e. 10 steps gives you 11 ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGauge2ValueMarker">
+    <xs:annotation>
+      <xs:documentation>This is the base class of all value markers inBiGauge2 i.e.BiGauge2RadialNeedle
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGauge2ValueMarkerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGauge2ValueMarker" substitutionGroup="AbstractGauge2ValueMarker"/>
+
+  <xs:attributeGroup name="AbstractGauge2ValueMarkerAttributes">
+
+    <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGrid">
+    <xs:annotation>
+      <xs:documentation>The abstract base class for the grid and the
+        tree.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGridAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGrid" substitutionGroup="AbstractGrid"/>
+
+  <xs:attributeGroup name="AbstractGridAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="allowInlineFind" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When true, typing a word will select the first matching item.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showRowHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the row headers on the grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rowHeadersWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the row headers that can be shown when using a grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rowHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of each row in the grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnCount" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of columns to show in the grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnWidths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - An array containing the widths of the columns.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnOrders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - An array containing the orders of the columns. A value of
+          [2, 0, 1] means that the third column should be displayed left most
+          and the second column right most.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnAligns" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - An array containing the text aligns for the columns.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnNames" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - An array containing the names for
+          the columns. The names are used for the text on the column header.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnSortTypes" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - An array containg the sort types for the columns. Valid values can
+          be found in the documentation for the BiGridColumn
+          sortType.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="iconColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The column to show the icon on.
+          Setting this to -1 (or a value greater than the column count) removes
+          the icons.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fitColumnWidths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true the columns will be sized horizontally so that they fill the grid viewport
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="liveResize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is set to true the column size in the grid body is
+          updated as the user resizes the headers. If this is false the
+          column size in the body is only updated as the user finishes the
+          resize of the column header.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the headers on the grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="headersHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of the headers.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="multipleSelection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to allow multiple selection.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectionModel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiSelectionModel - This handles the selection of the rows in the grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onbeforesort" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the sort happens. Call
+          preventDefault
+          to prevent the sorting.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onsort" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires after the grid has been sorted.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGridRow">
+    <xs:annotation>
+      <xs:documentation>The base class for the rows and
+        nodes in a grid
+        or a tree.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGridRowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractGridRow" substitutionGroup="AbstractGridRow"/>
+
+  <xs:attributeGroup name="AbstractGridRowAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="backColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The background color name</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="foreColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The foreground color name</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage /BiUri / String - The image to use as icon on the row. The icon supports bothBiImage (or
+          other objects with getIconHtml) as well as a string/uri for backwards compat
+          and more lightweight
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the grid row is selected or not.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractLoader">
+    <xs:annotation>
+      <xs:documentation>This abstract class defines the minimal interface for supporting loading
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAbstractLoader" substitutionGroup="AbstractLoader"/>
+
+  <xs:attributeGroup name="AbstractLoaderAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="async" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to load the text file asynchronously</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="supportsSync" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the loader supports loading the file synchronously</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the file has been loaded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AccordionButton">
+    <xs:annotation>
+      <xs:documentation>This button component is a internal part of BiAccordionPage
+        and is used to expand the page.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AccordionButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAccordionButton" substitutionGroup="AccordionButton"/>
+
+  <xs:attributeGroup name="AccordionButtonAttributes">
+
+    <xs:attributeGroup ref="ButtonAttributes"/>
+
+    <xs:attribute name="checked" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Returns whether the parent BiAccordionPage is the
+          currently expanded page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AccordionPage">
+    <xs:annotation>
+      <xs:documentation>This class represents the pages inside a BiAccordionPane.
+        A accordion page has a BiAccordionButton placed directly
+        above its content, this button is used to set the page to be the only page in the parent
+        BiAccordionPane to be shown.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AccordionPageAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAccordionPage" substitutionGroup="AccordionPage"/>
+
+  <xs:attributeGroup name="AccordionPageAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text to show on the page button</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The icon to show on the page button</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="contentPane" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The content of the page</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AccordionPane">
+    <xs:annotation>
+      <xs:documentation>This class is used for creating accordion controls. A accordion control contains
+        one or more BiAccordionPage. Each accordion page also
+        has a BiAccordionButton that is shown above the
+        page and when the button is clicked the page is shown.
+        Pages are oriented vertically from top to bottom and can either be statically shown or animated.
+
+        The property animationSpeed (a) alters the speed (s) in proportion to the animated
+        page height (h), using the following formula h2 = h1 - h1 / a, every 0.05 s.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AccordionPaneAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAccordionPane" substitutionGroup="AccordionPane"/>
+
+  <xs:attributeGroup name="AccordionPaneAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="animated" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the pages are animated or not</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="animationSpeed" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Float - Animation speed (1 - infinite) where 1 is the same as setting animated to false.
+          Default value is 1.4
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiAccordionPage - The currently selected accordion button.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Adf">
+    <xs:annotation>
+      <xs:documentation>This class handles the loading and interpretation of the Application
+        Definition File (ADF).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AdfAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAdf" substitutionGroup="Adf"/>
+
+  <xs:attributeGroup name="AdfAttributes">
+
+    <xs:attributeGroup ref="XmlLoaderAttributes"/>
+
+    <xs:attribute name="caption" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The desired caption for the application window</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="autoNameMapping" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true any XML object that has an id attribute will create a
+          global reference to the object created from this XML element. This property
+          is mapped to the xmlResourceParser as well as the resource
+          loader used to load the resources.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AnimationRange">
+    <xs:annotation>
+      <xs:documentation>Defines a value range, used by BiComponentAnimation, when animating.
+        You specify a start and an end value that will be animated.
+        You also specify the duration/time, in ms, that it should take to animate the value range.
+        There are several different acceleration behaviors/types that you can choose from.
+        BiAnimationRange has the ability to progress (displace) the current value, within the animation range.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AnimationRangeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAnimationRange" substitutionGroup="AnimationRange"/>
+
+  <xs:attributeGroup name="AnimationRangeAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="startValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Lower boundry of the value range.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Upper boundry of the value range.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The acceleration type/behavior for this value range.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="time" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Desired duration of this value range, measured in milliseconds.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="curValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The current position/value inside the value range.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="ApplicationAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="progressStatus" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is the progress status text shown while loading</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accessibilityMode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - This property can be used to tell whether the application should be in an
+          accessibility mode. This does not really do anything and it is up to the
+          components and implementations to make sure of this.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accessibilityDescription" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This property can be used to popup an alert with a description about the
+          application when the application is in accessibility mode. This is useful
+          if the user needs to be informed about something to be able to use the
+          application.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="autoNameMapping" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true any XML object that has an id attribute will create a
+          global reference to the object created from this XML element. This property
+          is mapped to the xmlResourceParser as well as the resource
+          loader used to load the resources.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="focusOnLoad" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to try to focus the window when the application loads</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="inactivityTimeout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - When this is set the application will fire an event
+          called inactive. The value of this is the number of minutes before
+          the inactive is fired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="defaultPackages" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The default packages to load. This needs to be set before the loading
+          actually starts. To do this you can use an attribute in the Application tag
+          in your ADF or set this in the HTML file hosting your application.
+          If you just want to add a few packages then use a Package tag in your Resources
+          section of the ADF.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this wizard pane.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondispose" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires just before the application is disposed.
+          This allows you to clean up your main program
+          before closing the application window.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onprogressstatus" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the progress status has changed.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onresourcesready" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired after the Bindows markup has been
+          handled but before the main method is called.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when everything has been loaded
+          and initialized. This is called after the main
+          method has been called.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="ApplicationWindowAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="caption" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The title text on the application window</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="acceptButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiEventTarget - The button that acts as the default accept button. If this is set
+          then the action
+          event is dispatched from the accept button when the enter key
+          is pressed. This does not have to be a
+          BiButton, any
+          BiEventTarget will work.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cancelButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiEventTarget - The button that acts as the default cancel button. If this is set
+          then the action
+          event is dispatched from the cancel button. This does not have to
+          be aBiButton, anyBiEventTarget will work.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="glassPaneVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to hide or show the glass pane. The glass pane is shown automatically when using dialogs.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="globalCursor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Setting the global cursor will make the mouse pointer use the
+          given cursor for all the components and thus overriding the
+          cursor property of the component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="allowBrowserContextMenu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Decides whether the browser context menu should be shown by default.
+          If this is set to true you can still prevent the
+          browser context menu from being shown by calling preventDefault on the event object
+          used in the contextmenu
+          event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Area">
+    <xs:annotation>
+      <xs:documentation>This class represents an area with a given left, top, width and height
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AreaAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiArea" substitutionGroup="Area"/>
+
+  <xs:attributeGroup name="AreaAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="left" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The left position of the area</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="top" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The top position of the area</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="width" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the area</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="height" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of the area</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="AreaCollection">
+    <xs:annotation>
+      <xs:documentation>This collection containsBiArea objects
+
+        This implements the same interface asBiSelectionItemCollection
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AreaCollectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAreaCollection" substitutionGroup="AreaCollection"/>
+
+  <xs:attributeGroup name="AreaCollectionAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AttachedComponentModel">
+    <xs:annotation>
+      <xs:documentation>This class is used to handleBiComponent objects insideBiTreeView andBiOlapGrid. An
+        attached component will be positioned at the same place as the cell it is
+        attached to and have the same size as that cell.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AttachedComponentModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiAttachedComponentModel" substitutionGroup="AttachedComponentModel"/>
+
+  <xs:attributeGroup name="AttachedComponentModelAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="BarChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a bar chart for the given series.
+        This is used with BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BarChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiBarChart" substitutionGroup="BarChart"/>
+
+  <xs:attributeGroup name="BarChartAttributes">
+
+    <xs:attributeGroup ref="ColumnChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="BarChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a bar chart for the given series. This is used
+        with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BarChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiBarChart2" substitutionGroup="BarChart2"/>
+
+  <xs:attributeGroup name="BarChart2Attributes">
+
+    <xs:attributeGroup ref="ColumnChart2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Base64">
+    <xs:annotation>
+      <xs:documentation>This class is used to represent base 64 encoded data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Base64Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiBase64" substitutionGroup="Base64"/>
+
+  <xs:attributeGroup name="Base64Attributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="base64" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is the base 64 encoded data</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is the plain text data (the decoded base 64 data)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Border">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to describe a border for a component. The border
+        consists of three properties; width, style and color. Supported styles
+        are: none - No border is drawn, regardless of the width. dotted dashed solid double groove ridge inset outset
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BorderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiBorder" substitutionGroup="Border"/>
+
+  <xs:attributeGroup name="BorderAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="leftWidth">
+      <xs:annotation>
+        <xs:documentation>The left border width</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightWidth">
+      <xs:annotation>
+        <xs:documentation>The right border width</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="topWidth">
+      <xs:annotation>
+        <xs:documentation>The top border width</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bottomWidth">
+      <xs:annotation>
+        <xs:documentation>The bottom border width</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="leftStyle">
+      <xs:annotation>
+        <xs:documentation>The left border style</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightStyle">
+      <xs:annotation>
+        <xs:documentation>The right border style</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="topStyle">
+      <xs:annotation>
+        <xs:documentation>The top border style</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bottomStyle">
+      <xs:annotation>
+        <xs:documentation>The bottom border style</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="leftColor">
+      <xs:annotation>
+        <xs:documentation>The left border color</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightColor">
+      <xs:annotation>
+        <xs:documentation>The right border color</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="topColor">
+      <xs:annotation>
+        <xs:documentation>The top border color</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bottomColor">
+      <xs:annotation>
+        <xs:documentation>The bottom border color</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="width">
+      <xs:annotation>
+        <xs:documentation>The width (in pixels) of the border on all sides</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="style">
+      <xs:annotation>
+        <xs:documentation>The style of the border on all sides</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="color">
+      <xs:annotation>
+        <xs:documentation>The color of the border on all sides</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Box">
+    <xs:annotation>
+      <xs:documentation>This layout component places its children from left to right for the horizontal
+        box and from top to bottom for the vertical box. This is a fairly advanced
+        layout component that takes preferred, minimum and maximum size of the children
+        into account. It also takes margins into account and it uses margin collapsing
+        so that two adjacent children share the larger margin.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BoxAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiBox" substitutionGroup="Box"/>
+
+  <xs:attributeGroup name="BoxAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="orient" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The orientation to layout the children. Valid values are "horizontal" and
+          "vertical". When set to "horizontal", rightToLeft is taken into account.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The align property decides how to size and position the children. This
+          describes the size and position in the orthogonal direction of the
+          box orientation. For a
+          horizontal box this describes the height and top position and for a vertical
+          layout this describes the width and left position
+          Valid values are:
+          stretch
+          start
+          center
+          end
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="pack" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes how to layout the controls when there are no flexing children
+          and there is any remaining space.
+
+          Valid values are:
+          start
+          center
+          end
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="BrowserCheck">
+    <xs:annotation>
+      <xs:documentation>This class is used to identify the browser that the user is using.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BrowserCheckAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiBrowserCheck" substitutionGroup="BrowserCheck"/>
+
+  <xs:attributeGroup name="BrowserCheckAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Button">
+    <xs:annotation>
+      <xs:documentation>A button that can contain both text and an icon
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiButton" substitutionGroup="Button"/>
+
+  <xs:attributeGroup name="ButtonAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user presses the button (either
+          using the mouse or the keyboard)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Calendar">
+    <xs:annotation>
+      <xs:documentation>This class represents a calendar control
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CalendarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCalendar" substitutionGroup="Calendar"/>
+
+  <xs:attributeGroup name="CalendarAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - Getter for the maximum selectable date.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - Getter for the maximum selectable date.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showYearButtons" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the buttons that allow you to go to next or previous year
+          in the caption
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMonthButtons" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the buttons that allow you to go to next or previous month
+          in the caption
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showCaption" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the caption or not</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scaleFonts" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to resize the font in the day labels and days
+          when calendar is resized.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="currentDate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The date describing the currently shown month. To get the selected date(s)
+          use selectedDate(s)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dateFormatSymbols" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDateFormatSymbols - The object providing the date picker with the symbols needed to display
+          localized strings
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedDate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The selected date.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedDates" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date[] - These are the selected dates. In case multiple selection is used then use
+          this instead of selectedDate
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the selection changes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the user clicks on a day</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="CalendarSelectionModel">
+    <xs:annotation>
+      <xs:documentation>This selection model is used withBiCalendar and the items in the model
+        are Javascript date objects. Two dates are considered equal if they are
+        representing the same date (in other words the time of the day is ignored).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CalendarSelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCalendarSelectionModel" substitutionGroup="CalendarSelectionModel"/>
+
+  <xs:attributeGroup name="CalendarSelectionModelAttributes">
+
+    <xs:attributeGroup ref="SelectionModelAttributes"/>
+
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The minimum selectable date</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The maximum selectable date</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartArea">
+    <xs:annotation>
+      <xs:documentation>
+        This class represents the area where the charts inside a graph are displayed.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartAreaAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartArea" substitutionGroup="ChartArea"/>
+
+  <xs:attributeGroup name="ChartAreaAttributes">
+
+    <xs:attributeGroup ref="ChartAreaBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartArea2">
+    <xs:annotation>
+      <xs:documentation>
+        This is the chart area used with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartArea2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartArea2" substitutionGroup="ChartArea2"/>
+
+  <xs:attributeGroup name="ChartArea2Attributes">
+
+    <xs:attributeGroup ref="ChartAreaBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartAreaBase">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for BiChartArea
+        and BiChartArea2.
+        The chart area is the part of the graph that contains the charts.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartAreaBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartAreaBase" substitutionGroup="ChartAreaBase"/>
+
+  <xs:attributeGroup name="ChartAreaBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="fillColor">
+      <xs:annotation>
+        <xs:documentation>The background color of the
+          chart area
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor2">
+      <xs:annotation>
+        <xs:documentation>The alternate color of the
+          chart area (used when fill type is gradient)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillOpacity">
+      <xs:annotation>
+        <xs:documentation>The background color opacity of the
+          chart area
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillType">
+      <xs:annotation>
+        <xs:documentation>
+          The type of the fill. Valid values are:
+          solid
+          gradient
+          gradientradial
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillAngle">
+      <xs:annotation>
+        <xs:documentation>The angle of the gradient</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="strokeColor">
+      <xs:annotation>
+        <xs:documentation>The border color of the
+          chart area
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="strokeOpacity">
+      <xs:annotation>
+        <xs:documentation>The border opacity of the
+          chart area
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartCategory">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to describe the categories of the data for a
+        graph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartCategoryAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartCategory" substitutionGroup="ChartCategory"/>
+
+  <xs:attributeGroup name="ChartCategoryAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="title">
+      <xs:annotation>
+        <xs:documentation>The title of the category</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartCategoryAxis">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the drawing of the category axis for a
+        BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartCategoryAxisAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartCategoryAxis" substitutionGroup="ChartCategoryAxis"/>
+
+  <xs:attributeGroup name="ChartCategoryAxisAttributes">
+
+    <xs:attributeGroup ref="ChartCategoryAxisBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartCategoryAxis2">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the drawing of the category axis for a
+        BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartCategoryAxis2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartCategoryAxis2" substitutionGroup="ChartCategoryAxis2"/>
+
+  <xs:attributeGroup name="ChartCategoryAxis2Attributes">
+
+    <xs:attributeGroup ref="ChartCategoryAxisBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartCategoryAxisBase">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base calss for BiChartCategoryAxis
+        and BiChartCategoryAxis2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartCategoryAxisBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartCategoryAxisBase" substitutionGroup="ChartCategoryAxisBase"/>
+
+  <xs:attributeGroup name="ChartCategoryAxisBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="majorTickInterval">
+      <xs:annotation>
+        <xs:documentation>
+          The distance between the major ticks. Setting this to null makes
+          the tick interval automatic, which means that the tick interval is decided by
+          looking at the data of the charts.
+          This value needs to be an integer.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minorTickInterval">
+      <xs:annotation>
+        <xs:documentation>
+          The distance between the minor ticks. Setting this to null makes
+          the tick interval automatic, which means that the tick interval is decided by
+          looking at the data of the charts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMajorTicks">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMinorTicks">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showLabels">
+      <xs:annotation>
+        <xs:documentation>Whether to show the labels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="axisBetweenCategories">
+      <xs:annotation>
+        <xs:documentation>
+          When this is true the data points, the labels and the value axis are
+          placed between the major ticks. When false the data points, the labels
+          and the value axis are placed on the major ticks. The default is
+          true and therefore the first value will not be placed on
+          the value axis.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fontSize">
+      <xs:annotation>
+        <xs:documentation>
+          The font size (in pixels) for the labels of the axis.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartGridLines">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to display the grid lines for
+        BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartGridLinesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartGridLines" substitutionGroup="ChartGridLines"/>
+
+  <xs:attributeGroup name="ChartGridLinesAttributes">
+
+    <xs:attributeGroup ref="ChartGridLinesBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartGridLines2">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to display the grid lines for
+        BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartGridLines2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartGridLines2" substitutionGroup="ChartGridLines2"/>
+
+  <xs:attributeGroup name="ChartGridLines2Attributes">
+
+    <xs:attributeGroup ref="ChartGridLinesBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartGridLinesBase">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for BiChartGridLines
+        and BiChartGridLines2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartGridLinesBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartGridLinesBase" substitutionGroup="ChartGridLinesBase"/>
+
+  <xs:attributeGroup name="ChartGridLinesBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="showMajorValue">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major value grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMinorValue">
+      <xs:annotation>
+        <xs:documentation>Whether to show the minor value grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMajorCategory">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major category grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMinorCategory">
+      <xs:annotation>
+        <xs:documentation>Whether to show the minor category grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="majorValueStrokeColor">
+      <xs:annotation>
+        <xs:documentation>The color of the major value grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minorValueStrokeColor">
+      <xs:annotation>
+        <xs:documentation>The color of the minor value grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="majorCategoryStrokeColor">
+      <xs:annotation>
+        <xs:documentation>The color of the major category grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minorCategoryStrokeColor">
+      <xs:annotation>
+        <xs:documentation>The color of the minor category grid lines</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartLegend">
+    <xs:annotation>
+      <xs:documentation>
+        The legend component is used to show a list of the titles of the series
+        or categories depending on the chart type.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartLegendAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartLegend" substitutionGroup="ChartLegend"/>
+
+  <xs:attributeGroup name="ChartLegendAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="fontSize">
+      <xs:annotation>
+        <xs:documentation>
+          The font size (in pixels) of the labels inside the legend.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartLegendLabel">
+    <xs:annotation>
+      <xs:documentation>
+        A special lable used for the items in the chart
+        legend
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartLegendLabelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartLegendLabel" substitutionGroup="ChartLegendLabel"/>
+
+  <xs:attributeGroup name="ChartLegendLabelAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="legendFor">
+      <xs:annotation>
+        <xs:documentation>
+          The object used for the text and the icon for the label. This object
+          needs to have the methods getTitle() (See for example
+          title for BiAbstractChart)
+          and getIconHtml(oLabel) (See for example
+          getIconHtml for BiImage).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartMouseEvent">
+    <xs:annotation>
+      <xs:documentation>
+        This event is used for mouse events that are specific for a data point
+        inside a graph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartMouseEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartMouseEvent" substitutionGroup="ChartMouseEvent"/>
+
+  <xs:attributeGroup name="ChartMouseEventAttributes">
+
+    <xs:attributeGroup ref="MouseEventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartPoint">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to describe how to display a data point in the graph.
+        Each point is bound to a series and a category.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartPointAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartPoint" substitutionGroup="ChartPoint"/>
+
+  <xs:attributeGroup name="ChartPointAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="strokeOpacity">
+      <xs:annotation>
+        <xs:documentation>The stroke opacity for the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="strokeColor">
+      <xs:annotation>
+        <xs:documentation>The stroke color for the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillOpacity">
+      <xs:annotation>
+        <xs:documentation>The fill opacity for the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor">
+      <xs:annotation>
+        <xs:documentation>The fill color for the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor2">
+      <xs:annotation>
+        <xs:documentation>The alternate fill color used when fill type is gradient</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillType">
+      <xs:annotation>
+        <xs:documentation>The fill type used when painting the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillAngle">
+      <xs:annotation>
+        <xs:documentation>The fill angle used when painting the section of the chart this point descibes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="markerType">
+      <xs:annotation>
+        <xs:documentation>The marker type for the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="markerVisible">
+      <xs:annotation>
+        <xs:documentation>Whether markers are visible for the section of the chart this point descibes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="explode">
+      <xs:annotation>
+        <xs:documentation>The amount to move the pie chart section from the middle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartPresentation">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to define the presentation attributes for a chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartPresentationAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartPresentation" substitutionGroup="ChartPresentation"/>
+
+  <xs:attributeGroup name="ChartPresentationAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="strokeOpacity">
+      <xs:annotation>
+        <xs:documentation>The stroke opacity for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="strokeColor">
+      <xs:annotation>
+        <xs:documentation>The stroke color for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor">
+      <xs:annotation>
+        <xs:documentation>The fill color for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillOpacity">
+      <xs:annotation>
+        <xs:documentation>The fill opacity for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor2">
+      <xs:annotation>
+        <xs:documentation>The alternate fill color used when fill type is gradient</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillType">
+      <xs:annotation>
+        <xs:documentation>The fill type used when painting the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillAngle">
+      <xs:annotation>
+        <xs:documentation>The fill angle used when painting the chart.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="markerType">
+      <xs:annotation>
+        <xs:documentation>The marker type for the line chart. Valid values are
+          circle
+          square
+          trianle
+          diamond
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="markerVisible">
+      <xs:annotation>
+        <xs:documentation>Whether markers are visible for the chart</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="explode">
+      <xs:annotation>
+        <xs:documentation>The amount to move the pie chart sections from the middle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="barSpacing">
+      <xs:annotation>
+        <xs:documentation>
+          This is the relative distance between the bars or columns of different categories.
+          1 means that the distance is the same as the width/height of the column/bar.
+          0 means that there is no spacing.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartPresentationManager">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to find the properties for different visual aspects of
+        of the graph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartPresentationManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartPresentationManager" substitutionGroup="ChartPresentationManager"/>
+
+  <xs:attributeGroup name="ChartPresentationManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartSeries">
+    <xs:annotation>
+      <xs:documentation>
+        This describes a series of values that is used with the graph
+        control. Each series has a unique id and every value of the series
+        belongs to a certain category.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartSeriesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartSeries" substitutionGroup="ChartSeries"/>
+
+  <xs:attributeGroup name="ChartSeriesAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="title">
+      <xs:annotation>
+        <xs:documentation>The title of the series</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="values">
+      <xs:annotation>
+        <xs:documentation>
+          The values in the series. This is the same order as the order of
+          the categories. If a value for a certain category is missing the
+          value for that is null in the array.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartValueAxis">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the drawing of the value axis for a
+        graph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartValueAxisAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartValueAxis" substitutionGroup="ChartValueAxis"/>
+
+  <xs:attributeGroup name="ChartValueAxisAttributes">
+
+    <xs:attributeGroup ref="ChartValueAxisBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartValueAxis2">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the drawing of the value axis for a
+        BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartValueAxis2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartValueAxis2" substitutionGroup="ChartValueAxis2"/>
+
+  <xs:attributeGroup name="ChartValueAxis2Attributes">
+
+    <xs:attributeGroup ref="ChartValueAxisBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ChartValueAxisBase">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for BiChartValueAxis
+        and BiChartValueAxis2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ChartValueAxisBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiChartValueAxisBase" substitutionGroup="ChartValueAxisBase"/>
+
+  <xs:attributeGroup name="ChartValueAxisBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="showMajorTicks">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMinorTicks">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showLabels">
+      <xs:annotation>
+        <xs:documentation>Whether to show the labels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fontSize">
+      <xs:annotation>
+        <xs:documentation>
+          The font size (in pixels) for the labels of the axis.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="majorTickInterval">
+      <xs:annotation>
+        <xs:documentation>
+          The distance between the major ticks. Setting this to null makes
+          the tick interval automatic, which means that the tick interval is decided by
+          looking at the data of the charts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minorTickInterval">
+      <xs:annotation>
+        <xs:documentation>
+          The distance between the minor ticks. Setting this to null makes
+          the tick interval automatic, which means that the tick interval is decided by
+          looking at the data of the charts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum">
+      <xs:annotation>
+        <xs:documentation>
+          The max value of the value axis. Setting this to null makes
+          the max value automatic, which means that the max value is decided by
+          looking at the data of the charts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum">
+      <xs:annotation>
+        <xs:documentation>
+          The min value of the value axis. Setting this to null makes
+          the min value automatic, which means that the min value is decided by
+          looking at the data of the charts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="CheckBox">
+    <xs:annotation>
+      <xs:documentation>Represents a check box control
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CheckBoxAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCheckBox" substitutionGroup="CheckBox"/>
+
+  <xs:attributeGroup name="CheckBoxAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - A value associated with the check box</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="checked" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the check box is checked or not. When this is changed the
+          change event is fired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user presses the button (either
+          using the mouse or the keyboard)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the checked property is
+          changed
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="CheckBoxMenuItem">
+    <xs:annotation>
+      <xs:documentation>This class is used for a menu item that displays a check box to the left
+        of the text.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CheckBoxMenuItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCheckBoxMenuItem" substitutionGroup="CheckBoxMenuItem"/>
+
+  <xs:attributeGroup name="CheckBoxMenuItemAttributes">
+
+    <xs:attributeGroup ref="MenuItemAttributes"/>
+
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - A value associated with the item.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="checked" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the item is checked or not.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the checked property changes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Circle">
+    <xs:annotation>
+      <xs:documentation>This class represents the shape of a Circle.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CircleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCircle" substitutionGroup="Circle"/>
+
+  <xs:attributeGroup name="CircleAttributes">
+
+    <xs:attributeGroup ref="ShapeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ColorPicker">
+    <xs:annotation>
+      <xs:documentation>This dialog allows the user to select a predefined color or define his
+        own color.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ColorPickerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiColorPicker" substitutionGroup="ColorPicker"/>
+
+  <xs:attributeGroup name="ColorPickerAttributes">
+
+    <xs:attributeGroup ref="DialogAttributes"/>
+
+    <xs:attribute name="rgbString" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The rgb string ("rgb(255,255,255)") describing the selected color.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rgb" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The rgb triplet describing the selected color.
+          The rgb triplet is an object with r (0 - 255), g (0 - 255) and b (0 - 255) fields
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="hsl" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The hsl triplet describing the selected color.
+          The hsl triplet is an object with h (0 - 360), s (0 - 1) and l (0 - 1) fields
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this color picker. If this is set to null
+          then the static string bundle forBiColorPicker is used
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event fires continiously when the user changes the color.
+          If you want to know when the user closes the dialog use the
+          dialogresult
+          event inherited from the BiDialog.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ColumnChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a column chart for the given series
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ColumnChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiColumnChart" substitutionGroup="ColumnChart"/>
+
+  <xs:attributeGroup name="ColumnChartAttributes">
+
+    <xs:attributeGroup ref="AbstractChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ColumnChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a column chart for the given series
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ColumnChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiColumnChart2" substitutionGroup="ColumnChart2"/>
+
+  <xs:attributeGroup name="ColumnChart2Attributes">
+
+    <xs:attributeGroup ref="AbstractChart2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ColumnChartSection">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the components used to show the rectangles for a
+        column chart.
+        This is used with BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ColumnChartSectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiColumnChartSection" substitutionGroup="ColumnChartSection"/>
+
+  <xs:attributeGroup name="ColumnChartSectionAttributes">
+
+    <xs:attributeGroup ref="AbstractChartSectionAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ColumnChartSection2">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the components used to show the rectangles for a
+        column chart.
+        This is used with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ColumnChartSection2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiColumnChartSection2" substitutionGroup="ColumnChartSection2"/>
+
+  <xs:attributeGroup name="ColumnChartSection2Attributes">
+
+    <xs:attributeGroup ref="AbstractChartSection2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComboBox">
+    <xs:annotation>
+      <xs:documentation>This class represents a combo box.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComboBoxAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiComboBox" substitutionGroup="ComboBox"/>
+
+  <xs:attributeGroup name="ComboBoxAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="sortType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets built in sort method to use to sort the combobox items, this
+          property is only used in the absence of a custom sort method.
+          Valid settings are: (seeBiSort for more details)
+          string caseInsensitiveString number date - Uses the native JS Date type
+          To get better control over the sorting, set the sortFunction property
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortFunction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Function - Compare function used to sort combobox items. The function
+          takes two arguments and returns a number (just like the normal
+          comparison function used when sorting arrays in JavaScript).
+          If this property is not set, it uses the predefined
+          functions set by the sortType property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedItem" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComboBoxItem - The selected combo box item. If no item is selected this will be null.
+          When this changes the change event fires.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the currently selected item. -1 if none.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - This is the userValue of the selected combo box item.
+          If no item is selected then this returns null.
+          When setting this, the first item with the given user value will be selected.
+          If no item has this value the selection will not change.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - Deprecated. Use userValue instead.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="editable" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the text field can be edited</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dropDownVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the combo box is displaying its drop-down list.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dropDownWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The desired width of the drop-down list.
+          The width of the drop-down is always greater than or equal to the width of the combo box.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text shown in the combo box.
+          This can be used to find the text that the user is currently typing into the text field of the combo box.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="validator" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Function - A function that is used to validate the text</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="invalidMessage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - A string that can be used to describe why the input is invalid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataTextField" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the column to use as the data for the text property of the combo box items.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataUserValueField" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the column to use as the data for the userValue property of the combo box items.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onactivechanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the active item changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedItem changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondatabind" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Called after the component has been data bound</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ontextchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the text changes in the text field of the combo box. To get the new text use the text property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComboBoxItem">
+    <xs:annotation>
+      <xs:documentation>This class represents an item in theBiComboBox.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComboBoxItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiComboBoxItem" substitutionGroup="ComboBoxItem"/>
+
+  <xs:attributeGroup name="ComboBoxItemAttributes">
+
+    <xs:attributeGroup ref="ListItemAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Command">
+    <xs:annotation>
+      <xs:documentation>
+        Command objects can be used to make several user interface components
+        execute the command when they are invoked. Components that use the command
+        object will be synchronized with the properties of the command. For example,
+        if a button has a disabled command the button will also be disabled.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CommandAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCommand" substitutionGroup="Command"/>
+
+  <xs:attributeGroup name="CommandAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="enabled">
+      <xs:annotation>
+        <xs:documentation>
+          Whether the command is enabled or not
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="checked">
+      <xs:annotation>
+        <xs:documentation>
+          The checked state of the command. This is usually used to synchronize
+          the checked property of the components using this command (such as
+          BiRadioButton,
+          BiCheckBox and others).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userValue">
+      <xs:annotation>
+        <xs:documentation>
+          The user value of the command. This is usually used to synchronize
+          the user values of the components using this command (such as
+          BiRadioGroup and
+          BiComboBox).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="shortcut">
+      <xs:annotation>
+        <xs:documentation>
+          The keyboard shortcut used to execute the command. The format for
+          the shortcut is:
+          Ctrl+Shift+Alt+k
+          You can also use the static fields of BiKeyboardEvent
+          for describing the key codes:
+
+          Shift+Del
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="keyCode">
+      <xs:annotation>
+        <xs:documentation>
+          This gives a bit more detail than the shortcut property because
+          there are cases where there is no name for the key. Use shortcut
+          whenever possible and fall back on keyCode when needed. If keyCode
+          is provided only the modifiers from the shortcut is used.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onexecute" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This is fired when the command is executed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onenabledchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This is fired when the enabled property is changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncheckedchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This is fired when the checked property is changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onuservaluechanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This is fired when the userValue property is changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onshortcutchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This is fired when the shortcut property is changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Component">
+    <xs:annotation>
+      <xs:documentation>This is the core class for all visual components in Bindows.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+        <!--<xs:group ref="iv:ElementsAllowedExternally"/>-->
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiComponent" substitutionGroup="Component"/>
+
+  <xs:attributeGroup name="ComponentAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="parent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - Returns the parent component. This is the component that the
+          current component was added to. If the current component has not
+          been added to any component this returns null. If the real
+          parent component is anonymous then this returns the first non anonymous
+          ancestor.
+          When setting this the component is added last to the new parent. If you set
+          this to null the component is removed from its current parent
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="children" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent[] - The components added to the current component. This does not include anonymous
+          children.
+          When setting this all the old children are first removed and disposed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="foreColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The foreground color name. The supported color names follows CSS2.1</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="backColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The background color name. The supported color names follows CSS2.1</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="zIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The z index of the component. A higher z index means that the component will
+          cover components with lower z index and therefore appear to be closer to
+          the user.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="visible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the component is visible or not. Note that all the ancestors must be
+          visible for the component to be actually shown. Use isVisible to
+          check that the component is shown.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cursor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the cursor to show when the mouse pointer is over the component.
+          This is any valid CSS2 cursor name.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="backgroundImage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The URI of the image file to use as background image.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="opacity" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the opacity for the component. Any child component inside the
+          component will also become transparent. The value should be a
+          number between 0 and 1 where 1 means totally opaque and 0 invisible.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="left" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The left position relative to the parent inner edge.
+          When using get the return value is always a number
+          representing the pixel value.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="right" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The right position relative to the parent inner edge. When using
+          right a width should also be set. When using get the
+          return value is always a number representing the pixel value.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="top" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The top position relative to the parent inner edge.
+          When using get the return value is always a number
+          representing the pixel value.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bottom" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The bottom position relative to the parent inner edge. When using
+          bottom a height should also be set. When using get the
+          return value is always a number representing the pixel value.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="width" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the component. When using get the return value is
+          always a number representing the pixel value.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="height" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of the component. When using get the return value is
+          always a number representing the pixel value.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="preferredWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Returns the desired width of the component. This is usually the
+          size of the content plus the borders.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="preferredHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Returns the desired height of the component. This is usually the
+          size of the content plus the borders.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimumWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Returns the desired minimum width of the component. This does not
+          limit the size but is used by some components as a layout hint.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximumWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Returns the desired maximum width of the component. This does not
+          limit the size but is used by some components as a layout hint.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimumHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Returns the desired minimum height of the component. This does not
+          limit the size but is used by some components as a layout hint.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximumHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Returns the desired maximum height of the component. This does not
+          limit the size but is used by some components as a layout hint.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="border" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiBorder - The border property describes how to paint the border on the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="marginLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The left margin for the component. Margins are used by some layout managers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="marginRight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The right margin for the component. Margins are used by some layout managers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="marginTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The top margin for the component. Margins are used by some layout managers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="marginBottom" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The bottom margin for the component. Margins are used by some layout managers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="clipLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is the clip left value. When this is set the shown region of the component
+          starts this many pixels from the left.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="clipTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is the clip top value. When this is set the shown region of the component
+          starts this many pixels from the top.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="clipWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is the width of the shown region when the component is clipped.
+          A value of null means the entire (remaining) width is shown.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="clipHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is the height of the shown region when the component is clipped.
+          A value of null means the entire (remaining) height is shown.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="overflow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Describes how to handle content that is too large to fit inside
+          the component. hidden - The content is clipped auto - Scroll bars are shown as needed scroll - Scroll bars are always shown. Even
+          if there
+          is enough room for the content inside the component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="overflowX" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes how to handle content that is too large to fit inside
+          the component. This only covers the horizontal overflow. hidden - The content is clipped auto - Scroll bars are shown as needed
+          scroll - Scroll bars are always shown. Even if there
+          is enough room for the content inside the component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="overflowY" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes how to handle content that is too large to fit inside
+          the component. This only covers the vertical overflow hidden - The content is clipped auto - Scroll bars are shown as needed
+          scroll - Scroll bars are always shown. Even if there
+          is enough room for the content inside the component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scrollLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position of the content relative to the view port of the component. This
+          is the distance the view port has scrolled horizontally.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scrollTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position of the content relative to the view port of the component. This
+          is the distance the view port has scrolled vertically.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="tabIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Setting this to less than 0 prevents the component from becoming
+          focusable. The tab index is used to tell in what order to focus
+          the components when naviagting between components using the tab key.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="hideFocus" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to hide the dotted outline that the OS usually draws around focused
+          components.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="focused" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If the component can be focused then this makes the component
+          focused (if set to true). If the component was focused
+          and this is set to false then the component is blurred.
+          Changing this fires the focus
+          and blur events (depending on the
+          previous state).
+          A disabled component cannot recieve focus.
+          To be able to recieve focus the tabIndex
+          must be greater or equal to 0.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="focusManager" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiFocusManager - The focus manager that handles focus inside the component. This is usually
+          null forBiComponent and the focus is usually handled by some
+          ancestor.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="canSelect" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether textual content is selectable</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="enabled" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the component is enabled or not. When this is changed the
+          component fires the enabledchanged event.
+          A disabled component cannot recieve focus.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="capture" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - This is true when the component is set to capture all mouse events even if
+          the mouse pointer is outside the component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accessKey" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The key, in combination with the Alt key, that will activate the component.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="contextMenu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiMenu - If set then this is the menu that will be shown
+          when the user right clicks (or uses some other UI mechanism) to bring up
+          a context menu. Set this to null when no contex menu
+          is desired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="name" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name does not have any real meaning except that it can be useful to
+          identify the component
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toolTip" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiToolTip - Sets the tool tip to show when the user hovers the component.
+          Setting this to null prevents a tooltip from beeing shown (unless
+          toolTipText is set.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toolTipText" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets the tool tip text to show when the user hovers the component.
+          This allows a simple plain text tool tip to be shown. This property
+          is preferred over the toolTip property when the extra
+          functionality provided by the BiToolTip
+          instance is not needed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightToLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Describes whether the component should be be layed out to support
+          locales using right-to-left fonts. If this is set to null
+          then the rightToLeft property for the parent component
+          is used.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="command" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiCommand - Commands are used to make more than one component trigger the
+          same action. Commands also synchronize different properties on
+          the components using the command.BiComponent only synchronizes
+          the enabled property with the command. Sub classes
+          that have a value property usually synchronizes that as well.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dropDataTypes" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The data type that are supported when dropping on the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cssClassName" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The CSS class name for the element representing the component.
+          This should be used with caution since in some cases this might give unrespected results.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="appearance" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets the appearance on the component. This allows a theme to do custom
+          styling of the component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onresize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a created component
+          changes its size.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onenabledchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the enabled
+          property is changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncreate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the component has been
+          created and inserted into the document. When it is
+          fired it is quaranteed that the component has been
+          inserted into a application
+          window and at that time it has a visual representation.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onlosecapture" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired if the component has taken
+          the capture but for some reason lost it.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onscroll" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When the user scrolls the component scroll
+          events are continuously fired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfocus" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the component becomes focused.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfocusin" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the component becomes focused.
+          This event is fired before the focus event
+          and unlike the focus event it bubbles up
+          to the parent component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfocusout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the component loses focus. This
+          event is fired before the blur event and
+          unlike the blur event it bubbles up to the
+          parent component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onblur" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired by a focused compinent when it loses focus.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onkeydown" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired by the component when it is focused
+          and the user presses down a key on the keyboard. This event
+          then bubbles up to ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onkeypress" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is continuously fired by the component when it
+          is focused and the user holds down a key on the keyboard.
+          This event then bubbles up to ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onkeyup" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired by the component when it is focused
+          and the user releases a key on the keyboard. This event
+          then bubbles up to ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onclick" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When the user clicks on a component it fires this event.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncontextmenu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the user wants to show the context
+          menu. This is usually done by right clicking on the component
+          but can be done in several different ways depending on the
+          users operating system. This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondblclick" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When the user double clicks on a component it fires this event.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmousedown" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the user presses down a mouse button on a
+          component. This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmousemove" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the user moves the mouse and the pointer
+          is over the current component. This event bubbles to the
+          ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmouseout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the mouse pointer leaves the component.
+          relatedTarget
+          can be used to find the component that was entered.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmouseover" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the mouse pointer enters a component.
+          relatedTarget
+          can be used to find the component that was left.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmouseup" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the user releases a mouse button on the
+          component. This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmousewheel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the user scrolls the mouse wheel over the
+          component. This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondragstart" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the user starts to drag a component.
+          Call startDrag
+          on the event object to initiate a drag'n drop session.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondragover" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When doing drag'n drop this is fired when the user drags over
+          the component. This is similar to mouseover except
+          that it only happens on valid drop targets during a drag'n drop
+          sessions. The relatedTarget points to the component
+          of the drag'n drop session that was left (if any).
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondragout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When doing drag'n drop this is fired when the mouse pointer
+          leaves the component. This is similar to mouseout
+          except that it only happens on valid drop targets during a
+          drag'n drop sessions. The relatedTarget points to the component
+          of the drag'n drop session that was entered (if any).
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondragmove" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When doing drag'n drop this is fired when the mouse pointer
+          moves over the component. This is similar to mousemove
+          except that it only happens on valid drop targets during a
+          drag'n drop sessions.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondragdrop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the user drops something on the component.
+          This is only fired by valid drop targets for the drag'n drop
+          session. The relatedTarget points to the source
+          of the drag'n drop session.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondragend" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired on the component that the user started the drag on
+          when the drag and drop session ends. If the drag'n drop was
+          successful then the relatedTarget is the component
+          where the drag'n drop started. If the drag'n drop failed the
+          relatedTarget
+          is null.
+          This event bubbles to the ancestors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComponentAnimation">
+    <xs:annotation>
+      <xs:documentation>This class is the basis for all animations. Typically you don't work with this class directly, but
+        instead use one of it's subclasses. You will need to use some methods here, common to all animations.
+        Such as start and stop for example.
+        If you want to create a completely new type of animation, however you need to be aware of the specifics
+        of this class.BiComponentAnimation generates values in a specified range a certain number of times per second.
+        This is useded to drive the value of properties to create animation. It is possible to have several
+        different value ranges which each can have various properties like speed and acceleration behavior.
+        Predefined acceleration curves exist to simulate acceleration and deceleration.
+        To animate, you create aBiComponentAnimation object and setup parameters as needed. You then
+        registerBiComponents with it. When you start the animation, all registeredBiComponents will
+        be animated in the same way. If you need different animation behaviors for differentBiComponents
+        you will have to create differentBiComponentAnimation objects with different properties.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentAnimationAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiComponentAnimation" substitutionGroup="ComponentAnimation"/>
+
+  <xs:attributeGroup name="ComponentAnimationAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="frameRate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number : Current frame rate, Frames Per Second. - Current frame rate.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="looping" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Turns looping on.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="autoStart" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If animation should start automatically once the first component is added.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="generator" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiFpsGenerator - Accesses the frame generator that drives the animation.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onanimationend" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the animation has played through completely.
+          Once per loop iteration if looping is active.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onframeprogression" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired upon every new frame</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="CssLoader">
+    <xs:annotation>
+      <xs:documentation>This class loads and executes a CSS file
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CssLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiCssLoader" substitutionGroup="CssLoader"/>
+
+  <xs:attributeGroup name="CssLoaderAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The URI (location) of the file to load. If this is set to a string a
+          new URI is created from that string relative to the
+          ADF path.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the file has been loaded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DataColumn">
+    <xs:annotation>
+      <xs:documentation>This class represents a data column of a data
+        table.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DataColumnAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDataColumn" substitutionGroup="DataColumn"/>
+
+  <xs:attributeGroup name="DataColumnAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="dataType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the type that values in this column has.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="defaultValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The default value for items in this column. This may be
+          used by the BiDataRow.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="DataRow">
+    <xs:annotation>
+      <xs:documentation>This class represents a row in aBiDataTable.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DataRowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDataRow" substitutionGroup="DataRow"/>
+
+  <xs:attributeGroup name="DataRowAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DataSet">
+    <xs:annotation>
+      <xs:documentation>This class represents a data set. A data set contains
+        tables, which
+        consists of columns and
+        rows.
+
+        @option
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DataSetAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDataSet" substitutionGroup="DataSet"/>
+
+  <xs:attributeGroup name="DataSetAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DataSetDataModel">
+    <xs:annotation>
+      <xs:documentation>This is a data model forBiTreeView that takes aBiDataSet as the data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DataSetDataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDataSetDataModel" substitutionGroup="DataSetDataModel"/>
+
+  <xs:attributeGroup name="DataSetDataModelAttributes">
+
+    <xs:attributeGroup ref="TreeViewDataModelAttributes"/>
+
+    <xs:attribute name="dataSet" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDataSet/BiDataSetTable - The data set to use as the data for the model</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondatastructurechanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired after a major
+          data structure change
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforedatastructurechanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event happens before
+          the data has actually changed. This
+          happens before datastructurechanged
+          event and the old data is still available.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DataTable">
+    <xs:annotation>
+      <xs:documentation>This class represents a data table inside a data set. A data table
+        consists of columns and
+        rows.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DataTableAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDataTable" substitutionGroup="DataTable"/>
+
+  <xs:attributeGroup name="DataTableAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DateFormat">
+    <xs:annotation>
+      <xs:documentation>This class is used to format and parse dates. It is based on the Java class
+        SimpleDateFormat.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DateFormatAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDateFormat" substitutionGroup="DateFormat"/>
+
+  <xs:attributeGroup name="DateFormatAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="dateFormatSymbols" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDateFormatSymbols - The date format symbols used to define how to parse and format strings and
+          dates
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="pattern" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The pattern to use when formatting and parsing</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="localizedPattern" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The pattern using localized pattern characters</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="lenient" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true parsing will try to parse the string even
+          though it does not correctly match the given pattern. For example it will
+          try to use the Javascript Date parse method.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="DateFormatSymbols">
+    <xs:annotation>
+      <xs:documentation>A class that provides locale specific date strings and date patterns. The
+        specific strings to use are provided by a staticBiStringBundle. This calss
+        is based on the Java class
+        DateFormatSymbols.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DateFormatSymbolsAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDateFormatSymbols" substitutionGroup="DateFormatSymbols"/>
+
+  <xs:attributeGroup name="DateFormatSymbolsAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="amPmStrings" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the am pm strings</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="eras" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing strings representing the eras berfore and after
+          year zero.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="localePatternChars" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is a string the localized pattern charaters. This allows the pattern
+          to use other characters than the default to identify the different parts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="months" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the full month names</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="shortMonths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the short month names</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="weekdays" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the weekday names</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="shortWeekdays" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the short weekday names</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="datePatterns" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the short and long date pattern</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="timePatterns" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the short and long time pattern</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dateTimePatterns" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - This is an array containing the short and long date time pattern</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="firstWeekday" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The weekday that starts the week. 0 is Sunday and 6 is Saturday. Setting this
+          to 1 means that Monday starts the week just like in ISO.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="redWeekdays" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - The days of the week that are considered red. 0 is Sunday and 6 is Saturday. Setting this
+          to [0] means that Sundays will be considered red days.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightToLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Returns whether right to left should be used for this language</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="DatePicker">
+    <xs:annotation>
+      <xs:documentation>This component provides a text field where one can write a date and a popup
+        containing aBiCalendar that allows one to pick a date.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DatePickerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDatePicker" substitutionGroup="DatePicker"/>
+
+  <xs:attributeGroup name="DatePickerAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - Getter for the maximum selectable date.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - Getter for the minimum selectable date.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedDate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The selected date</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dateFormat" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDateFormat - The object describing how to parse and format dates</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dropDownVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the calendar part is visible or not</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text shown in the text field part of the date picker. Setting
+          this causes the text to be parsed and this might trigger a change
+          event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="validator" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Function - A function that is used to validate the text</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="invalidMessage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - A string that can be used to describe why the input is invalid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ontextchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the text in the text field
+          is changed
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the user clicks to select
+          a date or when the enter key is pressed
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the selecetd date changes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onshow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the calendar is shown.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onhide" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the calendar is hidden.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DesktopPane">
+    <xs:annotation>
+      <xs:documentation>A special container that can be used to add internal
+        windows to. The desktop pane has a
+        window manager that provides some
+        extra features for the windows inside the desktop pane.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DesktopPaneAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDesktopPane" substitutionGroup="DesktopPane"/>
+
+  <xs:attributeGroup name="DesktopPaneAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Dialog">
+    <xs:annotation>
+      <xs:documentation>This class is used for dialog windows. Dialog windows are internal windows
+        that require immediate attention. Dialog windows are modal to the application.
+        Example usage: var confirm = newBiDialog("Are you sure");
+        // add components to the dialog
+        confirm.addEventListener("dialogresult", this.doSomething, this);
+        confirm.setVisible(true);
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DialogAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDialog" substitutionGroup="Dialog"/>
+
+  <xs:attributeGroup name="DialogAttributes">
+
+    <xs:attributeGroup ref="WindowAttributes"/>
+
+    <xs:attribute name="dialogResult" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The value set by the dialog before it is closed. the dialogResult should be
+          set by the content of the dialog before it is closed
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="defaultFocusedComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - This allows you to set the component that should be focused when the dialog
+          is shown. If null then the acceptButton is used for this.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="centered" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - This property decides whether to automatically center the dialog when it
+          is shown
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondialogresult" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is called when the dialog is
+          closed (or hidden). This is the main event
+          to use with dialogs since it is fired when
+          the user closes it or selects a value in it.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DockPanel">
+    <xs:annotation>
+      <xs:documentation>This layout component position and sizes its children using docking guidelines.
+        The children are laid out from first child to last and after a child has
+        been docked to one edge the following child will be docked to remaining
+        available space. Once a child sets its docking hint to "fill", the following
+        will not be shown.
+        To define that side the child should be docked at a so called attached property
+        is used. This is a static method on theBiDockPanel. There exists a Bindows
+        markup shortcut for setting these properties
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DockPanelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDockPanel" substitutionGroup="DockPanel"/>
+
+  <xs:attributeGroup name="DockPanelAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DragAndDropManager">
+    <xs:annotation>
+      <xs:documentation>This class is used to manage the drag and drop system
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DragAndDropManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDragAndDropManager" substitutionGroup="DragAndDropManager"/>
+
+  <xs:attributeGroup name="DragAndDropManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="action" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The desired action to use for the drag and drop session</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dragIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:oComp :BiComponent The component to show - The component to use as the icon next to the cursor when doing
+          drag
+          and drop. When this is set to null images are shown that represents the
+          action
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="DragEvent">
+    <xs:annotation>
+      <xs:documentation>This event is used in drag and drop sesssions
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DragEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDragEvent" substitutionGroup="DragEvent"/>
+
+  <xs:attributeGroup name="DragEventAttributes">
+
+    <xs:attributeGroup ref="MouseEventAttributes"/>
+
+    <xs:attribute name="dragIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component to use as the icon next to the pointer</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="DrawAnchor">
+    <xs:annotation>
+      <xs:documentation>This class defines static properties that represent the anchoring locations for link lines.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DrawAnchorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDrawAnchor" substitutionGroup="DrawAnchor"/>
+
+  <xs:attributeGroup name="DrawAnchorAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DrawLine">
+    <xs:annotation>
+      <xs:documentation>This class represents a link line.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DrawLineAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiDrawLine" substitutionGroup="DrawLine"/>
+
+  <xs:attributeGroup name="DrawLineAttributes">
+
+    <xs:attribute name="foreColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The color of this line.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="hoverColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The color of this line when the cursor is moved over it.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="startArrowStyle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The style of the start arrow for this line.
+          Accepted values are:- circle, arrow, none
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endArrowStyle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The style of the end arrow for this line.
+          Accepted values are:- circle, arrow, none
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="width" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of this line.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="type" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The type of this line.
+          Accepted values are:- dotted, dashed, solid
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Event">
+    <xs:annotation>
+      <xs:documentation>The event class is the core class describing the event objects passed
+        around in an event.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiEvent" substitutionGroup="Event"/>
+
+  <xs:attributeGroup name="EventAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="EventManager">
+    <xs:annotation>
+      <xs:documentation>This is the core class for the UI event system. Attach this to a browser
+        window object to forward browser events to the correct component.
+        There is usually no need to use this class. It is created as needed by the
+        core components
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EventManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiEventManager" substitutionGroup="EventManager"/>
+
+  <xs:attributeGroup name="EventManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="allowBrowserContextMenu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to allow the browser's default context menu</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="captureComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component that currently has the mouse capture. It is
+          better to call setCapture
+          on the component directly.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="EventTarget">
+    <xs:annotation>
+      <xs:documentation>This class provides the functionality to add and remove event listeners
+        as well as dispatch events. When an event is dispatched the listeners
+        are notified.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EventTargetAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiEventTarget" substitutionGroup="EventTarget"/>
+
+  <xs:attributeGroup name="EventTargetAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+  </xs:attributeGroup>
+
+  <xs:element name="FlowPanel">
+    <xs:annotation>
+      <xs:documentation>This layout component flows its children from left to right and wraps to
+        the next row when no more children can fit on the current row. This
+        layout component uses the preferred size and it also takes margins into
+        account and uses margin collapsing so that two adjacent children share the
+        larger margin.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FlowPanelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFlowPanel" substitutionGroup="FlowPanel"/>
+
+  <xs:attributeGroup name="FlowPanelAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The align property decides how to size and position the children. This
+          describes the size and position in the in the ortogonal direction of the
+          box orientation. For a
+          horizontal box this describes the height and top position and for a vertical
+          layout this describes the width and left position
+          Valid values are:
+          stretch
+          start
+          center
+          end
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="vAlign" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The vAlign property decides how to position the lines of children if there
+          is any remaining vertical space.
+          Valid values are:
+          start/top
+          center
+          end/bottom
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="baselineAlign" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The baseline align describes how to do the vertical align of the items on
+          a row. This can be set for individual children as well using the attached
+          property.
+          Valid values are:
+          start/top
+          center
+          end/bottom
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="wrap" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to wrap the children to a new line if there isn't enough space to
+          put them all on the same line.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="FocusElementWrapper">
+    <xs:annotation>
+      <xs:documentation>This class is used when tabbing between Bindows components and plain HTML
+        elements. It creates an interface that is a subset ofBiComponent with the
+        required method needed to work with theBiFocusManager
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FocusElementWrapperAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFocusElementWrapper" substitutionGroup="FocusElementWrapper"/>
+
+  <xs:attributeGroup name="FocusElementWrapperAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="focused" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If the component can be focused then this makes the component
+          focused (if set to true). If the component was focused
+          and this is set to false then the component is blurred.
+          Changing this fires the focus
+          and blur events (depending on the
+          previous state).
+          A disabled component cannot recieve focus.
+          To be able to recieve focus the tabIndex
+          must be greater or equal to 0.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="FocusEvent">
+    <xs:annotation>
+      <xs:documentation>This class describes event objects used in focus events.
+        The focusin and focusout events bubble by default,
+        focus and blur do not.
+        All mouse events bubble by default. This means that once all the
+        event listeners have been notified the event propagates to the parent
+        BiComponent. To prevent the event to
+        bubble to the parent call
+        stopPropagation() on the event object.
+        The currently supported events by BiComponent
+        are: focus blur focusin focusout
+        The order these events occur, when a focused component is left and another
+        focused component takes the focus, is the following: focusout focusin blur focus
+        This object should not be created by the user. It is created as needed by the event system.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FocusEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFocusEvent" substitutionGroup="FocusEvent"/>
+
+  <xs:attributeGroup name="FocusEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="FocusManager">
+    <xs:annotation>
+      <xs:documentation>This class handles the focus management in Bindows
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FocusManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFocusManager" substitutionGroup="FocusManager"/>
+
+  <xs:attributeGroup name="FocusManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Font">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used with BiLabel to provide
+        the font style information.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FontAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFont" substitutionGroup="Font"/>
+
+  <xs:attributeGroup name="FontAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="size">
+      <xs:annotation>
+        <xs:documentation>The font size (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bold">
+      <xs:annotation>
+        <xs:documentation>Whether to use bold</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="italic">
+      <xs:annotation>
+        <xs:documentation>Whether to use italic</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="underline">
+      <xs:annotation>
+        <xs:documentation>Whether to underline the text</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="strikeout">
+      <xs:annotation>
+        <xs:documentation>Whether to line through the text</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="name">
+      <xs:annotation>
+        <xs:documentation>The name of the font. A comma seprated list also works</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="FpsGenerator">
+    <xs:annotation>
+      <xs:documentation>Frame generation engine, used for animation.
+        Each animation can have it's ownBiFpsGenerator or it can use the globalBiFpsGenerator.
+        Different animations can share the global generator, which saves system resources.
+        Use the factory method, instead of the constructor, to get the global generator.
+        The frame generator generates FrameProgressionEvents a certain
+        number of times per second, as specified by the framerate.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FpsGeneratorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFpsGenerator" substitutionGroup="FpsGenerator"/>
+
+  <xs:attributeGroup name="FpsGeneratorAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="frameRate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the frame rate.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onframeprogression" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired upon every new frame</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="FrameProgressionEvent">
+    <xs:annotation>
+      <xs:documentation>Event that denotifies a new frame during animation.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="FrameProgressionEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiFrameProgressionEvent" substitutionGroup="FrameProgressionEvent"/>
+
+  <xs:attributeGroup name="FrameProgressionEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge">
+    <xs:annotation>
+      <xs:documentation>
+        This control displays a gauge.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge" substitutionGroup="Gauge"/>
+
+  <xs:attributeGroup name="GaugeAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="minimumAngle">
+      <xs:annotation>
+        <xs:documentation>The angle where the minimum value is located</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximumAngle">
+      <xs:annotation>
+        <xs:documentation>The angle where the minimum value is located</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="majorTickInterval">
+      <xs:annotation>
+        <xs:documentation>The distance between the major ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minorTickInterval">
+      <xs:annotation>
+        <xs:documentation>The distance between the minor ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="labelInterval">
+      <xs:annotation>
+        <xs:documentation>The difference between the labels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="warningValue">
+      <xs:annotation>
+        <xs:documentation>This shows a red section on the gauge between the warning value and the maximum value</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showLabels">
+      <xs:annotation>
+        <xs:documentation>Whether to show the text labels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMajorTicks">
+      <xs:annotation>
+        <xs:documentation>Whether to show the major ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMinorTicks">
+      <xs:annotation>
+        <xs:documentation>Whether to show the minor ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showWarningSection">
+      <xs:annotation>
+        <xs:documentation>Whether to show the red section between the warning value and the maximum value</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum">
+      <xs:annotation>
+        <xs:documentation>The maximum value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum">
+      <xs:annotation>
+        <xs:documentation>The minimum value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value">
+      <xs:annotation>
+        <xs:documentation>The value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="plate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiGaugePlate - The plate of the gauge</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minorTicks" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiGaugeMinorTicks - The minor ticks of the gauge</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="majorTicks" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiGaugeMajorTicks - The major ticks of the gauge</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="needle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiGaugeNeedle - The needle of the gauge</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="title" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiGaugeTitle - The title of the gauge</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="labels" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiGaugeLabels - The labels of the gauge</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2">
+    <xs:annotation>
+      <xs:documentation>The gauge2 class, encapsulating the gauge2 structure
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2" substitutionGroup="Gauge2"/>
+
+  <xs:attributeGroup name="Gauge2Attributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="coordWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Coord width is the inner coord vertical max value</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="coordHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Coord width is the inner coord horizontal max value</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2BasicCap">
+    <xs:annotation>
+      <xs:documentation>This class creates a basic round cap
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2BasicCapAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2BasicCap" substitutionGroup="Gauge2BasicCap"/>
+
+  <xs:attributeGroup name="Gauge2BasicCapAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2CapAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2CircularBorder">
+    <xs:annotation>
+      <xs:documentation>This class creates an circular border.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2CircularBorderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2CircularBorder" substitutionGroup="Gauge2CircularBorder"/>
+
+  <xs:attributeGroup name="Gauge2CircularBorderAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2BorderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2Component">
+    <xs:annotation>
+      <xs:documentation>This class is the base of all classes residing inside aBiGauge2Group
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2ComponentAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2Component" substitutionGroup="Gauge2Component"/>
+
+  <xs:attributeGroup name="Gauge2ComponentAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2Group">
+    <xs:annotation>
+      <xs:documentation>BiGauge2Group representing the main gauge2 vector graphic group
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2GroupAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2Group" substitutionGroup="Gauge2Group"/>
+
+  <xs:attributeGroup name="Gauge2GroupAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2ImageBorder">
+    <xs:annotation>
+      <xs:documentation>This class creates an image border
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2ImageBorderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2ImageBorder" substitutionGroup="Gauge2ImageBorder"/>
+
+  <xs:attributeGroup name="Gauge2ImageBorderAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2BorderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2Label">
+    <xs:annotation>
+      <xs:documentation>This class is used for creating labels
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2LabelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2Label" substitutionGroup="Gauge2Label"/>
+
+  <xs:attributeGroup name="Gauge2LabelAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="centerX" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The centerX property represents the x coordinate of the center of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="centerY" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The centerY property represents the y coordinate of the center of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text shown on the label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="labelSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The label size</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2LinearGradientFiller">
+    <xs:annotation>
+      <xs:documentation>This class creates a radial linear fill of theBiGauge2Component.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2LinearGradientFillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2LinearGradientFiller" substitutionGroup="Gauge2LinearGradientFiller"/>
+
+  <xs:attributeGroup name="Gauge2LinearGradientFillerAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2GradientFillerAttributes"/>
+
+    <xs:attribute name="angle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The angle of the linear filler</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2LinearNeedle">
+    <xs:annotation>
+      <xs:documentation>This class creates a linear needle.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2LinearNeedleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2LinearNeedle" substitutionGroup="Gauge2LinearNeedle"/>
+
+  <xs:attributeGroup name="Gauge2LinearNeedleAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2ValueMarkerAttributes"/>
+
+    <xs:attribute name="angle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The angle of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="needlePosition" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="needleBase" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The base width of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="needleHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2LinearRange">
+    <xs:annotation>
+      <xs:documentation>This class creates a radial range. The child "ticks" and "scales" inherits the angle.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2LinearRangeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2LinearRange" substitutionGroup="Gauge2LinearRange"/>
+
+  <xs:attributeGroup name="Gauge2LinearRangeAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2RangeAttributes"/>
+
+    <xs:attribute name="angle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Angle of the lineear range.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2LinearScale">
+    <xs:annotation>
+      <xs:documentation>This class is used for creating linear scales
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2LinearScaleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2LinearScale" substitutionGroup="Gauge2LinearScale"/>
+
+  <xs:attributeGroup name="Gauge2LinearScaleAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2ScaleAttributes"/>
+
+    <xs:attribute name="labelSpace" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The space between labels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="labelPosition" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position of the labels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="angle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The angle of the scale</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2LinearTicks">
+    <xs:annotation>
+      <xs:documentation>This class layout it's ticks in radial manner depeding on radius, start angle and end angle
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2LinearTicksAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2LinearTicks" substitutionGroup="Gauge2LinearTicks"/>
+
+  <xs:attributeGroup name="Gauge2LinearTicksAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2TicksAttributes"/>
+
+    <xs:attribute name="angle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Angle of the line on wich the ticks will be placed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="tickSpace" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The space between ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2PlainColorFiller">
+    <xs:annotation>
+      <xs:documentation>This class creates a plain color filler
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2PlainColorFillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2PlainColorFiller" substitutionGroup="Gauge2PlainColorFiller"/>
+
+  <xs:attributeGroup name="Gauge2PlainColorFillerAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2FillerAttributes"/>
+
+    <xs:attribute name="color" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The color that the filler is going to use.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RadialGradientFiller">
+    <xs:annotation>
+      <xs:documentation>This class creates a radial gradient fill of theBiGauge2Component.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RadialGradientFillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RadialGradientFiller" substitutionGroup="Gauge2RadialGradientFiller"/>
+
+  <xs:attributeGroup name="Gauge2RadialGradientFillerAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2GradientFillerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RadialNeedle">
+    <xs:annotation>
+      <xs:documentation>This class creates a radial needle
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RadialNeedleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RadialNeedle" substitutionGroup="Gauge2RadialNeedle"/>
+
+  <xs:attributeGroup name="Gauge2RadialNeedleAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2ValueMarkerAttributes"/>
+
+    <xs:attribute name="outerRadius" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Outer radius of the needle.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="innerRadius" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Inner radius of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="innerWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:EDIT_THIS - The inner width of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="outerWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:EDIT_THIS - The outer width of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The value of the needle.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RadialRange">
+    <xs:annotation>
+      <xs:documentation>This class creates a radial range. The child "ticks" and "scales" inherits the start- and end angles.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RadialRangeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RadialRange" substitutionGroup="Gauge2RadialRange"/>
+
+  <xs:attributeGroup name="Gauge2RadialRangeAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2RangeAttributes"/>
+
+    <xs:attribute name="startAngle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The startAngle of the range, this angle is where the radial range starts.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endAngle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The endAngle of the range, this angle is where the radial range ends.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RadialScaleSection">
+    <xs:annotation>
+      <xs:documentation>This class creates a radius scale
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RadialScaleSectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RadialScaleSection" substitutionGroup="Gauge2RadialScaleSection"/>
+
+  <xs:attributeGroup name="Gauge2RadialScaleSectionAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2ScaleSectionAttributes"/>
+
+    <xs:attribute name="radius" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The radius</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RadialTicks">
+    <xs:annotation>
+      <xs:documentation>This class layout it's ticks in radial maner depeding on radius, start angle and end angle
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RadialTicksAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RadialTicks" substitutionGroup="Gauge2RadialTicks"/>
+
+  <xs:attributeGroup name="Gauge2RadialTicksAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2TicksAttributes"/>
+
+    <xs:attribute name="startAngle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The start angle of the ticks</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endAngle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The end angle of the ticks.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="radius" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The radius of the circle on wich the ticks is placed.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RectangularBorder">
+    <xs:annotation>
+      <xs:documentation>This class creates a rectangular border
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RectangularBorderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RectangularBorder" substitutionGroup="Gauge2RectangularBorder"/>
+
+  <xs:attributeGroup name="Gauge2RectangularBorderAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2BorderAttributes"/>
+
+    <xs:attribute name="rotation" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The rotation angle of the rectangular border</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Gauge2RingGradientFiller">
+    <xs:annotation>
+      <xs:documentation>This class creates a radial gradient fill of theBiGauge2Component.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Gauge2RingGradientFillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGauge2RingGradientFiller" substitutionGroup="Gauge2RingGradientFiller"/>
+
+  <xs:attributeGroup name="Gauge2RingGradientFillerAttributes">
+
+    <xs:attributeGroup ref="AbstractGauge2GradientFillerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugeLabels">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show the labels (the tick labels) for a gauge
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeLabelsAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugeLabels" substitutionGroup="GaugeLabels"/>
+
+  <xs:attributeGroup name="GaugeLabelsAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugeMajorTicks">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show the major ticks for a gauge
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeMajorTicksAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugeMajorTicks" substitutionGroup="GaugeMajorTicks"/>
+
+  <xs:attributeGroup name="GaugeMajorTicksAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugeMinorTicks">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show the minor ticks for a gauge
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeMinorTicksAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugeMinorTicks" substitutionGroup="GaugeMinorTicks"/>
+
+  <xs:attributeGroup name="GaugeMinorTicksAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugeNeedle">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show the needle of a gauge
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeNeedleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugeNeedle" substitutionGroup="GaugeNeedle"/>
+
+  <xs:attributeGroup name="GaugeNeedleAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="strokeColor">
+      <xs:annotation>
+        <xs:documentation>The stroke color of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor">
+      <xs:annotation>
+        <xs:documentation>The fill color of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value">
+      <xs:annotation>
+        <xs:documentation>The value of the needle</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugePlate">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to the plate (the background circle) for a gauge
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugePlateAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugePlate" substitutionGroup="GaugePlate"/>
+
+  <xs:attributeGroup name="GaugePlateAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="strokeColor">
+      <xs:annotation>
+        <xs:documentation>The color of the stroke (edge) of the plate</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fillColor">
+      <xs:annotation>
+        <xs:documentation>The fill color of the plate</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugeSection">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show a section for a gauge.
+        A guage can have several sections and these are usually used to split
+        the gaguge values into logical value ranges.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeSectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugeSection" substitutionGroup="GaugeSection"/>
+
+  <xs:attributeGroup name="GaugeSectionAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="startValue">
+      <xs:annotation>
+        <xs:documentation>
+          The start value of the section
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endValue">
+      <xs:annotation>
+        <xs:documentation>
+          The end value of the section
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="color">
+      <xs:annotation>
+        <xs:documentation>The color of the section</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GaugeTitle">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show the title for a gauge
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GaugeTitleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGaugeTitle" substitutionGroup="GaugeTitle"/>
+
+  <xs:attributeGroup name="GaugeTitleAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Graph">
+    <xs:annotation>
+      <xs:documentation>
+        This is the container used with graphs. The graph component contains
+        other components for the axes, legend, charts and more.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GraphAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGraph" substitutionGroup="Graph"/>
+
+  <xs:attributeGroup name="GraphAttributes">
+
+    <xs:attributeGroup ref="GraphBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Graph2">
+    <xs:annotation>
+      <xs:documentation>
+        This is a simpler graph control than BiGraph.
+        BiGraph2 works in Mozilla but it is a bit
+        more limited. For example, BiGraph2 does
+        not support line charts nor pie charts. Gradient fills are ignored
+        by BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Graph2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGraph2" substitutionGroup="Graph2"/>
+
+  <xs:attributeGroup name="Graph2Attributes">
+
+    <xs:attributeGroup ref="GraphBaseAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GraphBase">
+    <xs:annotation>
+      <xs:documentation>
+        This is the abstract base class for BiGraph
+        and BiGraph2. If Mozilla support is needed
+        use BiGraph2. If line chart and/or pie chart
+        is needed then use BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GraphBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGraphBase" substitutionGroup="GraphBase"/>
+
+  <xs:attributeGroup name="GraphBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="autoScale">
+      <xs:annotation>
+        <xs:documentation>
+          Allows you turn off the automatic scaling of the graph
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fontSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number -
+          Sets the font size for the legend and axes. If autoScale
+          is true then this does not apply.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="series" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiChartSeries[] - This is an array containing the series used for the data of the graph.
+          After this property is changed the graph component needs to be updated.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="categories" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiChartCategory[] - This is an array containing the categories used for the data of the graph.
+          After this property is changed the graph component needs to be updated.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="points" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiChartPoint[] - This is an array containing the points used for the data of the graph.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="chartType">
+      <xs:annotation>
+        <xs:documentation>
+          The type of the chart. Available types are:
+          bar
+          column
+          grid
+          line
+          pie
+          percentagestackedbar
+          percentagestackedcolum
+          stackedbar
+          stackedcolumn
+          grid
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onpointclick" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user clicks on a point in the graph</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointcontextmenu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user right clicks on a point</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointdblclick" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user double clicks on a point</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointmousedown" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user presses down the mouse button on a point</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointmousemove" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user moves the mouse over a point</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointmouseout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Fires when the mouse pointer leaves a point
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointmouseover" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Fires when the mouse pointer enters a point
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointmouseup" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the releases the mouse button on a point</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpointmousewheel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the user scrolls the mouse wheel over a point</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GraphContentArea">
+    <xs:annotation>
+      <xs:documentation>This component is used as a container for the graph content
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GraphContentAreaAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGraphContentArea" substitutionGroup="GraphContentArea"/>
+
+  <xs:attributeGroup name="GraphContentAreaAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Grid">
+    <xs:annotation>
+      <xs:documentation>This component is used to display a grid (table, column list). A grid
+        can show headers for both the columns and the rows. A grid also supports
+        selection of whole rows as well as of individual cells.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGrid" substitutionGroup="Grid"/>
+
+  <xs:attributeGroup name="GridAttributes">
+
+    <xs:attributeGroup ref="AbstractGridAttributes"/>
+
+    <xs:attribute name="selectionMode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets the selection mode. Allowed values are "cell" and "row".</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataSource" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDataSet /BiDataTable - The object to use as the data source. This can be a either a
+          BiDataTable or aBiDataSet (in which case the first table is used).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="currentDataPage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the current data page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataPageSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The amount of rows to show at one time from the data source.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected row/cell changes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondatabind" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Called after the component has been data bound</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Grid2">
+    <xs:annotation>
+      <xs:documentation>This component is a special case ofBiTreeView which has an interface which
+        is similar toBiGrid
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Grid2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGrid2" substitutionGroup="Grid2"/>
+
+  <xs:attributeGroup name="Grid2Attributes">
+
+    <xs:attributeGroup ref="TreeViewAttributes"/>
+
+    <xs:attribute name="columnCount" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of columns in the grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnNames" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The text to show on the headers of the grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnWidths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The widths of the columns of the grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnOrders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - The order of the columns. This an array containing the indexes of the
+          columns.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the headers for the grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showRowHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the row headers for the grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showGridLines" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show grid lines between the cells in the grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Grid2Cell">
+    <xs:annotation>
+      <xs:documentation>This is used for the cells in aBiGrid2Row row
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Grid2CellAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGrid2Cell" substitutionGroup="Grid2Cell"/>
+
+  <xs:attributeGroup name="Grid2CellAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="data" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The data that is associated with the cell</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Grid2DataModel">
+    <xs:annotation>
+      <xs:documentation>This data model is to be used withBiGrid2. It uses theBiGrid2Row and
+        BiGrid2Cell to provide the data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Grid2DataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGrid2DataModel" substitutionGroup="Grid2DataModel"/>
+
+  <xs:attributeGroup name="Grid2DataModelAttributes">
+
+    <xs:attributeGroup ref="TreeViewDataModelAttributes"/>
+
+    <xs:attribute name="treeView" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiGrid2 - The tree view the data model is acting on</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onrowcountchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event happens after
+          the number of rows has changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Grid2Row">
+    <xs:annotation>
+      <xs:documentation>This class is used as the data for rows in theBiGrid2 component
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Grid2RowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGrid2Row" substitutionGroup="Grid2Row"/>
+
+  <xs:attributeGroup name="Grid2RowAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Grid2ViewManager">
+    <xs:annotation>
+      <xs:documentation>This class is a special view manager to be used withBiGrid2
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Grid2ViewManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGrid2ViewManager" substitutionGroup="Grid2ViewManager"/>
+
+  <xs:attributeGroup name="Grid2ViewManagerAttributes">
+
+    <xs:attributeGroup ref="TreeViewViewManagerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridCell">
+    <xs:annotation>
+      <xs:documentation>This class represents a cell in a grid row.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridCellAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridCell" substitutionGroup="GridCell"/>
+
+  <xs:attributeGroup name="GridCellAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="data" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The data associated with the cell</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="backColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The background color name</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="foreColor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The foreground color name</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the cell is selected or not. This should not be set when
+          the selection mode for the grid is set to row selection.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridChart">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to display a grid containing the values in a graph.
+        Each series in the graph is shown as a row
+        in the grid and each point is shown as a cell.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridChart" substitutionGroup="GridChart"/>
+
+  <xs:attributeGroup name="GridChartAttributes">
+
+    <xs:attributeGroup ref="GridAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridChartCell">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to display a cell in a grid chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridChartCellAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridChartCell" substitutionGroup="GridChartCell"/>
+
+  <xs:attributeGroup name="GridChartCellAttributes">
+
+    <xs:attributeGroup ref="GridCellAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridChartRow">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to display a row in a grid chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridChartRowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridChartRow" substitutionGroup="GridChartRow"/>
+
+  <xs:attributeGroup name="GridChartRowAttributes">
+
+    <xs:attributeGroup ref="GridRowAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridColumn">
+    <xs:annotation>
+      <xs:documentation>This class is used to describe columns forBiGrid andBiTree.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridColumnAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridColumn" substitutionGroup="GridColumn"/>
+
+  <xs:attributeGroup name="GridColumnAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The alignment of the content inside the column.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="name" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the column. This is the same as the text shown on
+          the header.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="width" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the column.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="indentColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Whether the current column is the indent column in the grid.
+          This is ignored when using the columns for a non tree.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="iconColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Whether the current column is the icon column in the grid.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="visible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the column is visible or not.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The type of the data in the column. This is used to decide how
+          to sort the data in the column. Built in support for the following
+          types: string caseInsensitiveString number date - Uses the native JS Date type
+          To get better control over the sorting create a subclass that
+          overrides the sortFunction getter.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridDataModel">
+    <xs:annotation>
+      <xs:documentation>This data model takes an array of arrays containing the text for a grid. This data model is to be used
+        withBiTreeView
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridDataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridDataModel" substitutionGroup="GridDataModel"/>
+
+  <xs:attributeGroup name="GridDataModelAttributes">
+
+    <xs:attributeGroup ref="TreeViewDataModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridHeader">
+    <xs:annotation>
+      <xs:documentation>This represents a header cell for the
+        headers of a
+        grid or a tree.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridHeaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridHeader" substitutionGroup="GridHeader"/>
+
+  <xs:attributeGroup name="GridHeaderAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="resizable" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the user can resize the current header.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortable" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the user can click on the header to sort by that column.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="movable" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the user can move the current header.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ascending" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true a down arrow is shown as the icon
+          of the header. When false an up arrow and when
+          null no icon is shown.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ascendingIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage - The icon to use for the sort arrow when sorting ascendingly</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="descendingIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage - The icon to use for the sort arrow when sorting descendingly</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridHeaderCorner">
+    <xs:annotation>
+      <xs:documentation>This component is used to paint the upper left corner of the headers
+        in case both row headers and column headers are visible for a grid.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridHeaderCornerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridHeaderCorner" substitutionGroup="GridHeaderCorner"/>
+
+  <xs:attributeGroup name="GridHeaderCornerAttributes">
+
+    <xs:attributeGroup ref="GridHeaderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridHeaderFiller">
+    <xs:annotation>
+      <xs:documentation>This component is used to fill the headers
+        in case the widths of the header cells do not cover the entire width of
+        the headers.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridHeaderFillerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridHeaderFiller" substitutionGroup="GridHeaderFiller"/>
+
+  <xs:attributeGroup name="GridHeaderFillerAttributes">
+
+    <xs:attributeGroup ref="GridHeaderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridHeaders">
+    <xs:annotation>
+      <xs:documentation>This class represents the headers for a grid
+        or a tree.
+        The headers contain several header cells.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridHeadersAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridHeaders" substitutionGroup="GridHeaders"/>
+
+  <xs:attributeGroup name="GridHeadersAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="fitColumnWidths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true the column widths are distributed so that the fill the
+          width of the grid
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnCount" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of columns in the header</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnWidths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - The widths of the cell headers in the headers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnOrders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - The order in which the cell headers should be displayed in. A
+          value of [2,0,1] means that the third cell comes first,
+          then comes the first cell and last the second.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the column that should show the sort arrow.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ascending" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If this is true then the sorting should be done
+          ascending, if false descending and if null
+          no sort. This is also reflected on the ascending property for the
+          header this applies to.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="oncolumnwidthschanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the column widths are changed. This happens when either
+          the user has finished resized a column or the column widths are
+          changed through script.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncolumnorderschanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the column orders are changed. This happens when either
+          the user has reordered the columns or the order is
+          changed through script.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onsortcolumnchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the sort column is changed. This happens when either
+          the user has clicks on a sortable column or the sort column is
+          changed through script.
+          Note that when the user clicks on the currently sorted column this
+          event is not fired. Instead the ascendingchanged event
+          is triggered because the sorting is changed from ascending to
+          descending or the other way around.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onascendingchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the ascending property changes. This happens when either
+          the user clicks on a column header cell that is already sorted or
+          this property is changed through script.
+          Note that if the ascending property changed due to
+          a change of the sortColumn this event is not fired.
+          This is by design to prevent preformance issues.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncolumnwidthschanging" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the column widths are changing. This happens when
+          the user is resizing a column.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridPanel">
+    <xs:annotation>
+      <xs:documentation>This layout component positions and sizes its children in a simple grid where
+        the columns and rows are decided using string patterns much
+        like the way the rows and cols attribute for HTML framesets decides the
+        size and position of the frames.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridPanelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridPanel" substitutionGroup="GridPanel"/>
+
+  <xs:attributeGroup name="GridPanelAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="hGap" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The horizontal gap between the columns</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="vGap" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The vertical gap between the rows</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cols" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is a string representing the column widths. It is a comma seperated
+          string of column sizes. See the remarks for more info.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rows" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is a string representing the row heights. It is a comma seperated
+          string of row sizes. See the remarks for more info.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridPanel2">
+    <xs:annotation>
+      <xs:documentation>BiGridPanel2 is a layout component based onBiGridPanel.
+        It works similair to a html table. A layout is created by
+        adding rows and cells to the Panel. Cells and rows can have
+        padding, colspan, rowspan, alignment etc. Defaults can also
+        be set on the grid panel itself.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridPanel2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridPanel2" substitutionGroup="GridPanel2"/>
+
+  <xs:attributeGroup name="GridPanel2Attributes">
+
+    <xs:attributeGroup ref="GridPanelAttributes"/>
+
+    <xs:attribute name="cellPadding" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Padding for cells in the grid. Individual rows and cells can override this.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Horizontal alignment for cells in the grid. Individual rows and cells can
+          override this.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="valign" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Vertical alignment for cells in the grid. Individual rows and cells can
+          override this.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridPanel2Cell">
+    <xs:annotation>
+      <xs:documentation>A cell in aBiGridPanel2Cell
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridPanel2CellAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridPanel2Cell" substitutionGroup="GridPanel2Cell"/>
+
+  <xs:attributeGroup name="GridPanel2CellAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="cellPadding" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Padding for a cell.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="contentComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - Component in the cell.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stretch" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:string - How the content component should be stretched.
+          Possible settings are:
+          none, both, horizontal, vertical
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="parent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiGridPanel2Row - The row this cell was added to.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="colSpan" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - ColSpan of the cell. The cell will span colspan number of columns horizontally.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rowSpan" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Rowspan of a cell. The cell spans rowspan number of rows vertically.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The horizontal alignment of the cell. Possible values are:
+          left
+          center
+          right
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="valign" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The vertical alignment of the cell. Possible values are:
+          top
+          center
+          middle
+          bottom
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="preferredWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The preferred width of the cell. Defaulted to the preferredWidth
+          of the content component, plus any padding it needs.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="preferredHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Preferred height of the cell. Defaults to preferredHieght of the
+          content component plus padding it needs.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridPanel2Row">
+    <xs:annotation>
+      <xs:documentation>A row of cells in aBiGridPanel2
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridPanel2RowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridPanel2Row" substitutionGroup="GridPanel2Row"/>
+
+  <xs:attributeGroup name="GridPanel2RowAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="cellPadding" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Padding for cells in the row. Individual cells can override this.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The horizontal alignment for cells in the row. Individual cells can
+          override this. SeeBiGridPanel2Cell for specific settings.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="valign" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The vertical alignment for cells in the row. Individual cells can
+          override this. SeeBiGridPanel2Cell for settings.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridRow">
+    <xs:annotation>
+      <xs:documentation>This class represents the rows inBiGrid. Each row contains
+        cells that contains the text to show for
+        the column.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridRowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridRow" substitutionGroup="GridRow"/>
+
+  <xs:attributeGroup name="GridRowAttributes">
+
+    <xs:attributeGroup ref="AbstractGridRowAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridRowHeaders">
+    <xs:annotation>
+      <xs:documentation>This component is used to paint the grid row headers for a grid.
+        The component asks the BiGridRow for the HTML
+        for each item by calling getRowHeaderHtml.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridRowHeadersAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridRowHeaders" substitutionGroup="GridRowHeaders"/>
+
+  <xs:attributeGroup name="GridRowHeadersAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GridSelectionModel">
+    <xs:annotation>
+      <xs:documentation>This class handles the selection of rows
+        or cells in a grid.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridSelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGridSelectionModel" substitutionGroup="GridSelectionModel"/>
+
+  <xs:attributeGroup name="GridSelectionModelAttributes">
+
+    <xs:attributeGroup ref="SelectionModelAttributes"/>
+
+    <xs:attribute name="selectionMode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The grid selection model supports both selection entire rows
+          and individual grid cells. Valid values are:
+          row
+          cell
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GroupBox">
+    <xs:annotation>
+      <xs:documentation>This class is used for creating group boxes. A group box is a container
+        with a border and possibly a title at the top.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GroupBoxAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGroupBox" substitutionGroup="GroupBox"/>
+
+  <xs:attributeGroup name="GroupBoxAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="groupBoxTitle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiGroupBoxTitle - This property points to theBiGroupBoxTitle component which handles the title
+          of the group box.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="titlePosition" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The position of the title. Valid values are: left center right</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets the text of the title. Setting this to null removes the title.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="GroupBoxTitle">
+    <xs:annotation>
+      <xs:documentation>This component is used with theBiGroupBox to handle the title.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GroupBoxTitleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiGroupBoxTitle" substitutionGroup="GroupBoxTitle"/>
+
+  <xs:attributeGroup name="GroupBoxTitleAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="titlePosition" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The position of the title. Valid values are: left center right</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="HashTable">
+    <xs:annotation>
+      <xs:documentation>This is a basci implementation of a hash table. It works around a known
+        bug in IE/JScript that causes IE to leak memory when using Objects as hashes
+        in javascript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="HashTableAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiHashTable" substitutionGroup="HashTable"/>
+
+  <xs:attributeGroup name="HashTableAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="HBox">
+    <xs:annotation>
+      <xs:documentation>This is a horizontalBiBox where components are laid out from left to right
+        (or right to left if rightToLeft
+        is true).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="HBoxAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiHBox" substitutionGroup="HBox"/>
+
+  <xs:attributeGroup name="HBoxAttributes">
+
+    <xs:attributeGroup ref="BoxAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Iframe">
+    <xs:annotation>
+      <xs:documentation>
+        This component allows usage of an HTML 4 iframe element. This allows
+        any document/file that is supported by the platform to be shown inside a
+        component.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="IframeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiIframe" substitutionGroup="Iframe"/>
+
+  <xs:attributeGroup name="IframeAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiUri -
+          The URI to the file to show inside the frame. If this is set to a string a
+          new URI is created from that string relative to the
+          ADF path.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Happens when the iframe is loaded. Note that this might fire more
+          often than one might expect so be sure to check that you really
+          want your code run when the event is fired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Image">
+    <xs:annotation>
+      <xs:documentation>This class is used for showing images.
+        Supported image types are GIF, JPEG and PNG (including support for 32-bit RGBA).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImageAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImage" substitutionGroup="Image"/>
+
+  <xs:attributeGroup name="ImageAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="alt" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The alternate text which is read out instead of the image when Bindows is
+          in accessibility mode.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The location of the image file. If this is set to a string a
+          new URI is created from that string relative to the
+          ADF path.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the image loads. Note that the image file may be
+          loaded before the constructor finishes and you should not only
+          rely on this event but also use loaded property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onerror" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the image failed to load.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImageLoader">
+    <xs:annotation>
+      <xs:documentation>This class loads an image file to memory
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImageLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImageLoader" substitutionGroup="ImageLoader"/>
+
+  <xs:attributeGroup name="ImageLoaderAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The URI (location) of the file to load. If this is set to a string a
+          new URI is created from that string relative to the
+          ADF path.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the file has been loaded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImageMap">
+    <xs:annotation>
+      <xs:documentation>This class emulates the classic image map found in HTML.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImageMapAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImageMap" substitutionGroup="ImageMap"/>
+
+  <xs:attributeGroup name="ImageMapAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImageMapArea">
+    <xs:annotation>
+      <xs:documentation>This class represents a particular area on an image map.
+
+        This class supports the following events:-
+        mousemove
+        mousedown
+        mouseover
+        mouseout
+        click
+        contextmenu
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImageMapAreaAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImageMapArea" substitutionGroup="ImageMapArea"/>
+
+  <xs:attributeGroup name="ImageMapAreaAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="cursor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The cursor to show when the mouse hovers over this area</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImageMapEvent">
+    <xs:annotation>
+      <xs:documentation>This type of event is fired when UI events (mousemove, mousedown, etc) are fired on
+        the image that is associated with an image map.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImageMapEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImageMapEvent" substitutionGroup="ImageMapEvent"/>
+
+  <xs:attributeGroup name="ImageMapEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImagePreloader">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles preloading of an image. There will never be more than
+        one instance of this class per image URI. So if there already exists a
+        preloader for the given URI that will be returned.
+        Since there might be other objects dependent on the current instance it
+        is not a good idea to call dispose on the instance object. Disposal is
+        handled by the system.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImagePreloaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImagePreloader" substitutionGroup="ImagePreloader"/>
+
+  <xs:attributeGroup name="ImagePreloaderAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the image file loads</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onerror" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires if the image file fails to load</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImagePreloaderManager">
+    <xs:annotation>
+      <xs:documentation>
+        A singleton class that handles the BiImagePreloader
+        instances
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImagePreloaderManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiImagePreloaderManager" substitutionGroup="ImagePreloaderManager"/>
+
+  <xs:attributeGroup name="ImagePreloaderManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InlineComponent">
+    <xs:annotation>
+      <xs:documentation>This class is used to create components that can be used in the
+        inline flow of the HTML document hosting the application.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InlineComponentAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiInlineComponent" substitutionGroup="InlineComponent"/>
+
+  <xs:attributeGroup name="InlineComponentAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="inlineId" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is the id that the HTML element acting as the container is
+          having. Don't change this after the component has been added
+          to the application window.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="InlineEditModel">
+    <xs:annotation>
+      <xs:documentation>This class is used to handle inline editing in aBiTreeView and aBiOlapGrid.
+        This class provides editing by using one attached component at a time.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InlineEditModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiInlineEditModel" substitutionGroup="InlineEditModel"/>
+
+  <xs:attributeGroup name="InlineEditModelAttributes">
+
+    <xs:attributeGroup ref="AttachedComponentModelAttributes"/>
+
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The value of the currently editing cell</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onbeforeshow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is dispatched before the editing
+          component is added to theBiTreeView component
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the value of the
+          currently editing cell has changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforehide" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This happens before the editing component is
+          hidden. If the default action is prevented here
+          the component is not removed from the tree view
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onhide" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When the editing component has been removed/hidden.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="IpField">
+    <xs:annotation>
+      <xs:documentation>This component is used to enter an IPv4 address. The control consists of different text fields
+        for the different parts of the address.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="IpFieldAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiIpField" substitutionGroup="IpField"/>
+
+  <xs:attributeGroup name="IpFieldAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="ip" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The IP address that is shown in the IP field.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the enter key is pressed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the IP field is blurred
+          and the text has changed since the IP field got
+          focus.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfieldchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the active field of the
+          component changes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ontextchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the text has changed.
+          This happens when the user in some way changes
+          the text inside the IP field. This event
+          is fired continiously as the user types.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oninvalidinput" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired if an invalid character is typed or
+          invalid text is pasted into the IP field.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Json">
+    <xs:annotation>
+      <xs:documentation>This class is used to serialize and deserialize javascript objects from and
+        to a JSON string. JSON stands for JavaScript Notation Format and you can find
+        more information at http://json.org.
+        When serializing objects we check if the object has a serialize
+        method and if so we use that instead.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="JsonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiJson" substitutionGroup="Json"/>
+
+  <xs:attributeGroup name="JsonAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="JsonLoader">
+    <xs:annotation>
+      <xs:documentation>Loads a JSON file and returns the javascript object that the JSON file
+        describes.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="JsonLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiJsonLoader" substitutionGroup="JsonLoader"/>
+
+  <xs:attributeGroup name="JsonLoaderAttributes">
+
+    <xs:attributeGroup ref="TextLoaderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="KeyboardEvent">
+    <xs:annotation>
+      <xs:documentation>
+        This class describes event object used in keyboard events.
+        All keyboard events bubble by default. This means that once all the
+        event listeners have been notified the event propagates to the parent
+        BiComponent. To prevent the event to
+        bubble to the parent call
+        stopPropagation() on the event object.
+        The currently supported keyboard events by BiComponent
+        are: keydown keypress keyup
+        This object should not be created by the user. It is created as needed by the event system.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="KeyboardEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiKeyboardEvent" substitutionGroup="KeyboardEvent"/>
+
+  <xs:attributeGroup name="KeyboardEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="L10nLoader">
+    <xs:annotation>
+      <xs:documentation>This class handles the loading and interpretation of localization templates files.
+        This loader search for language specific template file i.e..
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="L10nLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiL10nLoader" substitutionGroup="L10nLoader"/>
+
+  <xs:attributeGroup name="L10nLoaderAttributes">
+
+    <xs:attributeGroup ref="XmlLoaderAttributes"/>
+
+    <xs:attribute name="language" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The desired language, otherwise the browser language is used.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="defaultLanguage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The desired default language. The default langugae will be used if no localization template file can
+          be found using the language property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="prefix" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Prefix of the localization template files, the loader will search for files named</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="L10nString">
+    <xs:annotation>
+      <xs:documentation>This class converts a localization template to a string.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="L10nStringAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiL10nString" substitutionGroup="L10nString"/>
+
+  <xs:attributeGroup name="L10nStringAttributes">
+
+    <xs:attribute name="name" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String : The localization template name - Sets the localization template name.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Label">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to show text
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LabelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLabel" substitutionGroup="Label"/>
+
+  <xs:attributeGroup name="LabelAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="text">
+      <xs:annotation>
+        <xs:documentation>The plain text shown on the label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="html">
+      <xs:annotation>
+        <xs:documentation>The HTML text shown on the label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="mnemonic">
+      <xs:annotation>
+        <xs:documentation>A character used to give UI hints about the access key for the label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="font" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiFont - This is used to describe how to paint the text on the label.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="labelFor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiComponent - If this is set then focusing on the current label moves the focus to another component
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="wrap">
+      <xs:annotation>
+        <xs:documentation>Whether to wrap the text if the label is not wide enough</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingLeft">
+      <xs:annotation>
+        <xs:documentation>The left padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingRight">
+      <xs:annotation>
+        <xs:documentation>The right padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingTop">
+      <xs:annotation>
+        <xs:documentation>The top padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingBottom">
+      <xs:annotation>
+        <xs:documentation>The bottom padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align">
+      <xs:annotation>
+        <xs:documentation>
+          The text alignment. Valid values are: left right center justify
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="verticalAlign">
+      <xs:annotation>
+        <xs:documentation>
+          NOT IMPLEMENTED
+          The vertical text alignment. Valid values are: top middle bottom
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:BiImage - The icon image to show on the label. Note that changing
+          the image object does not update the label icon. You'll have to
+          set the icon property to update the label icon.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="iconPosition">
+      <xs:annotation>
+        <xs:documentation>
+          The position of the icon relative to the text. Valid values are: left right top bottom
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="iconTextGap">
+      <xs:annotation>
+        <xs:documentation>The gap between the icon and the text (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Launcher">
+    <xs:annotation>
+      <xs:documentation>This class can be used to create a launcher for launching Bindows applications
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LauncherAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLauncher" substitutionGroup="Launcher"/>
+
+  <xs:attributeGroup name="LauncherAttributes">
+
+    <xs:attribute name="reuseWindow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to reuse a previously opened window. If you want to launch
+          the new application in the current window set newWindow to
+          false.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="newWindow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to launch the application in a new window</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rootPath" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The path where Bindows resides. This is usually the path where bimain.html
+          can be found.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="adfPath" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The path to the ADF file.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="adfName" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The ADF name is taken from the ADF path</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="arguments" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The arguments to pass to the main method of the ADF</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="target" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The target name of the window or frame to open the application in. If this is ""
+          or null the ADF name will be used instead. If reuseWindow
+          is false then this property will be ignored.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accessibilityMode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - This property can be used to tell whether the application should be in an
+          accessibility mode.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="focusOnLoad" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to try to focus the window when the application loads</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Line">
+    <xs:annotation>
+      <xs:documentation>ABiLine contains screen coordinates. It can be used to store eg. a line.
+        This class is used in animation.
+        Storage is implemented as a stack where you add points at the end.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LineAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLine" substitutionGroup="Line"/>
+
+  <xs:attributeGroup name="LineAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="LineChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a line chart for the given series
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LineChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLineChart" substitutionGroup="LineChart"/>
+
+  <xs:attributeGroup name="LineChartAttributes">
+
+    <xs:attributeGroup ref="AbstractChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="LineMarker">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the components used to show the markers for a
+        line chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LineMarkerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLineMarker" substitutionGroup="LineMarker"/>
+
+  <xs:attributeGroup name="LineMarkerAttributes">
+
+    <xs:attributeGroup ref="AbstractChartSectionAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Link">
+    <xs:annotation>
+      <xs:documentation>This class represents the relationship between two components that are to be linked by a link line.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LinkAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLink" substitutionGroup="Link"/>
+
+  <xs:attributeGroup name="LinkAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="startComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The first ("left") component that is part of this link.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The second ("right") component that is part of this link.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="line" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDrawLine - The line used to link the components.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="startAnchor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The anchor point on startComponent which line anchors to.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endAnchor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The anchor point on endComponent which line anchors to.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="direction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The direction of this link.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="LinkManager">
+    <xs:annotation>
+      <xs:documentation>This class is a component that holds linked components. It also manages the links involved with these components.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LinkManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLinkManager" substitutionGroup="LinkManager"/>
+
+  <xs:attributeGroup name="LinkManagerAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="List">
+    <xs:annotation>
+      <xs:documentation>This is a list component that can contain BiListItem
+        objects. It uses the normal object model and can therefore be extended and
+        used just like any other component. The only limitation is that the the direct
+        children should only be of type BiListItem
+        and the size and position of these should not be changed.
+        The list uses a BiListSelectionModel
+        that handles the selection.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ListAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiList" substitutionGroup="List"/>
+
+  <xs:attributeGroup name="ListAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="allowInlineFind" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When true, typing a word will select the first matching item.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Used to decide how to sort the list items. It is used when calling sort()
+          if the sortFunction property has not been set to a function.
+          If the list items has its userValue property set, it has precedence over its
+          text property in being the value that is compared
+          Built in support for the following
+          types: string (default) caseInsensitiveString number date - Uses the native JS Date type
+          To get better control over the sorting, define a function and set
+          the sortFunction property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortFunction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Function - Sets a property which is a function used to compare two listItems.
+          This function should take two arguments and return a
+          number (just like the normal comparison function used when sorting
+          arrays in JavaScript). If this property is not set, it uses the predefined
+          functions set by the sortType property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - This is the userValue of
+          the first selected list item.
+          If no item is selected then this returns null.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectionModel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiListSelectionModel - This handles the selection of the items in the list</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="multipleSelection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the list supports multiple selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataTextField" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the column to use as the data for the text property
+          of the BiListItems.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataUserValueField" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The name of the column to use as the data for the userValue
+          property of the BiListItems.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataSource" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDataTable /BiDataSet - The object to use as the data source. This can be a either a
+          BiDataTable or a
+          BiDataSet (in which case the
+          first table is used).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataPageSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The amount of rows to show at one time from the data source.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="currentDataPage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the current data page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected items change</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondatabind" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Called after the component has been data bound</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ListItem">
+    <xs:annotation>
+      <xs:documentation>This class is used for the items in a list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ListItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiListItem" substitutionGroup="ListItem"/>
+
+  <xs:attributeGroup name="ListItemAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="visible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the item is visible or not. Note that all the ancestors must be
+          visible for the component to be actually shown. Use isVisible to
+          check that the item is shown.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the item is selected or not</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - A value associated with the list item. This is not the text on the item. To
+          change the text use the text
+          property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the item is double
+          clicked or when enter is pressed
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ListSelectionModel">
+    <xs:annotation>
+      <xs:documentation>This class handles the selection for lists
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ListSelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiListSelectionModel" substitutionGroup="ListSelectionModel"/>
+
+  <xs:attributeGroup name="ListSelectionModelAttributes">
+
+    <xs:attributeGroup ref="SelectionModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="LoadManager">
+    <xs:annotation>
+      <xs:documentation>This singleton class is used to keep track of loading of resources
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LoadManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLoadManager" substitutionGroup="LoadManager"/>
+
+  <xs:attributeGroup name="LoadManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="loadPerDomain" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is is the number of requests that can be loaded at the same time from
+          the same domain
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="LocationAnimator">
+    <xs:annotation>
+      <xs:documentation>Animates the location ofBiComponents to create movement.
+        This class has a repository of motion paths. A motion path is created by setting start and end
+        screen coordinates. Objects will be animated between these in a straight line.
+        Motion paths are stored in a stack where the first motion path, called the default motion path,
+        is created upon construction.
+        The default motion path can be changed and modified dynamically via getter/setter function,
+        whereas additional motion paths can only be either added or removed. For each motion path you have
+        independent control over speed and acceleration algorithms.
+        By pushing more motion paths onto the stack you can make the object animate around multiple
+        positions on the screen and create complex movement.
+        To animate a component, you create the animator object and add componen(s) to it, then start the animation.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LocationAnimatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiLocationAnimator" substitutionGroup="LocationAnimator"/>
+
+  <xs:attributeGroup name="LocationAnimatorAttributes">
+
+    <xs:attributeGroup ref="ComponentAnimationAttributes"/>
+
+    <xs:attribute name="fromX" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Starting point's X position measured in pixels.
+          Modifies the default motion path, that components will be animated between.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromY" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Starting point's Y position measured in pixels.
+          Modifies the default motion path, that components will be animated between.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toX" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Ending point's X position measured in pixels.
+          Modifies the default motion path, that components will be animated between.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toY" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Ending point's Y position measured in pixels.
+          Modifies the default motion path, that components will be animated between.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Changes the acceleration type for the default motion path.
+          Use one of the acceleration constants defined inBiComponentAnimation
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="speed" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number/String - Changes the speed of the default motion path.
+          Time measured in milliseconds it should take to complete
+          the animation of the default motion path.
+          It Could also be a string with the following values:
+          slowest, slow, normal, fast, fastest
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="type" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets both the speed and the acceleration type for the animation.
+          Can be either: "normal" or "smooth"
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - Instead of using absolute window positions, you can position the animation relative
+          another components position. By setting the from-component you specify anotherBiComponent
+          whos location will be used for the animation's start state.
+          If the from-component's location or size is changed, the animation
+          will update dynamically. By default the top left corner of the from-component will be this
+          animation's start x/y.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - Instead of using absolute window positions, you can position the animation relative
+          another components position. By setting the to-component you specify anotherBiComponent
+          whos location will be used for the animation's target state.
+          If the to-component's location or size is changed, the animation
+          will update dynamically. By default the top left corner of the to-component will be this
+          animation's end x/y.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation start y position relative to either a from-component, if set. Otherwise
+          top relates to the browser's viewport. Setting top cancels bottom.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation end y position relative to either a to-component, if set. Otherwise
+          top relates to the browser's viewport. Setting top cancels bottom.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation start x position relative to either a from-component, if set. Otherwise
+          left relates to the browser's viewport. Setting left cancels right.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation end x position relative to either a to-component, if set. Otherwise
+          left relates to the browser's viewport. Setting left cancels right.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromBottom" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation start y position relative to either a from-component, if set. Otherwise
+          bottom relates to the browser's viewport. Setting bottom cancels top.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toBottom" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation end y position relative to either a to-component, if set. Otherwise
+          bottom relates to the browser's viewport. Setting bottom cancels top.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromRight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation start x position relative to either a from-component, if set. Otherwise
+          right relates to the browser's viewport. Setting right cancels left.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toRight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the animation end x position relative to either a to-component, if set. Otherwise
+          right relates to the browser's viewport. Setting right cancels left.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Math">
+    <xs:annotation>
+      <xs:documentation>Collection of static functions used in various math operations.
+        Used heavily in the animation library for example.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MathAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMath" substitutionGroup="Math"/>
+
+  <xs:attributeGroup name="MathAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Menu">
+    <xs:annotation>
+      <xs:documentation>This class represents a menu. Menus can be filled with menu items by
+        addingBiMenuItem objects.
+        The content model for the menu is very similiar to the content model for
+        BiComponent but there are slight differences.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MenuAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMenu" substitutionGroup="Menu"/>
+
+  <xs:attributeGroup name="MenuAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="visible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Shows or hides the menu</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="left" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets or gets the left position of the menu relative to the screen</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="top" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets or gets the top position of the menu relative to the screen</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="width" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the menu</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="height" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The heightof the menu</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightToLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Describes whether the component should be be layed out to support
+          locales using right-to-left fonts. If this is set to null
+          then the rightToLeft property for the parent component
+          is used.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onshow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the menu is shown</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforeshow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the menu is shown.
+          This is a good place to change the content of the menu to reflect the
+          component causing the menu to be shown
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onhide" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the menu is hidden</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MenuBar">
+    <xs:annotation>
+      <xs:documentation>This class is used to display a menu bar
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MenuBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMenuBar" substitutionGroup="MenuBar"/>
+
+  <xs:attributeGroup name="MenuBarAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MenuButton">
+    <xs:annotation>
+      <xs:documentation>This class is used for displaying the buttons of a menu bar.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MenuButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMenuButton" substitutionGroup="MenuButton"/>
+
+  <xs:attributeGroup name="MenuButtonAttributes">
+
+    <xs:attributeGroup ref="MenuItemAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MenuItem">
+    <xs:annotation>
+      <xs:documentation>Represents a menu item for a menu.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MenuItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMenuItem" substitutionGroup="MenuItem"/>
+
+  <xs:attributeGroup name="MenuItemAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The plain text to show on the menu item</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="html" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The html text to show on the menu item</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage - The icon image to show on the menu item. Note that changing
+          the image object does not update the label icon. You'll have to
+          set the icon property to update the label icon. The size of the icon
+          of the menu item is currently fixed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="mnemonic" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - A character used to give UI hints about the access key for the menu label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="subMenu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiMenu - The menu that should be opened as a sub menu when the current menu is selected.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="visible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Shows or hides the menu item</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="enabled" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the component is enabled or not. When this is changed the
+          component fires the enabledchanged event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="shortcutText" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The shortcut text is shown on the menu to give the user a hint about
+          keyboard shortcuts. Setting this on the menu just adds the text. It
+          does not set up the keyboard shortcut.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toolTipText" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text to show as a tool tip for the menu item.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when the menu item is clicked or invoked using the keyboard</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onenabledchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the enabled property is changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MenuSeparator">
+    <xs:annotation>
+      <xs:documentation>This class is used to display a separator inside a menu
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MenuSeparatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMenuSeparator" substitutionGroup="MenuSeparator"/>
+
+  <xs:attributeGroup name="MenuSeparatorAttributes">
+
+    <xs:attributeGroup ref="MenuItemAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MouseEvent">
+    <xs:annotation>
+      <xs:documentation>This class describes event objects used in mouse events.
+        All mouse events bubble by default. This means that once all the
+        event listeners have been notified the event propagates to the parent
+        BiComponent. To prevent the event to
+        bubble to the parent call
+        stopPropagation() on the event object.
+        The currently supported events by BiComponent
+        are: mousedown mouseup click dblclick contextmenu - this one is a bit tricky since it might also be dispatched when the user presses
+        the context menu key on their keyboard mouseover mouseout mousemove mousewheel
+        When a user double clicks on a component the order of the mouse events is
+        the following: mousedown mouseup click mousedown mouseup click dblclick
+        This object should not be created by the user. It is created as needed by the event system.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MouseEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMouseEvent" substitutionGroup="MouseEvent"/>
+
+  <xs:attributeGroup name="MouseEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MoveHandle">
+    <xs:annotation>
+      <xs:documentation>This component can be used to allow another component to become movable
+        using the mouse. The component can be used as a move handle for the
+        component to move. It can also be used without adding it to another
+        component by manually calling startMove in a mouse down
+        event handler.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MoveHandleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiMoveHandle" substitutionGroup="MoveHandle"/>
+
+  <xs:attributeGroup name="MoveHandleAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="continuousLayout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Indicates that the ghost must be used to be a visual indicator for the duration of the move
+          operation.
+          Once complete, the original component's location will be updated accordingly.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ghost" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component that should be visually updated if continuousLayout is set to false.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="handleFor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component that the handle should be a move handle for.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="moveDirection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The direction the component can be moved. Possible values are: vertical horizontal both.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onbeforemove" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires continually during the moving of the component. Call
+          preventDefault
+          on the event object to prevent the new location from being applied.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmove" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires continually during the moving of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmoveend" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the movement is ended.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmovestart" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired before the movement is started. To prevent this
+          from being moved call preventDefault
+          on the event object.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Object">
+    <xs:annotation>
+      <xs:documentation>This is the core class of all Bindows classes. This class provides
+        some useful methods over the standard Javascript Object.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ObjectAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiObject" substitutionGroup="Object"/>
+
+
+  <xs:attributeGroup name="ObjectAttributes">
+
+    <xs:attribute name="id" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - An identifier for the object. Be careful when changing this because
+          it might have undesired side effects.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userData" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - Allows custom data to be stored on the object. Although Javascript
+          allows custom fields to be added to any object this property makes
+          this a bit more consistent.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="properties" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - Allows you to set multiple properties at once. setProperties takes a hash
+          of name/value pairs as its argument and sets the properties using setProperty
+          sample: myObj.setProperties( { property1:'value1', property2:'value2' } )
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ObjectLoader">
+    <xs:annotation>
+      <xs:documentation>This class is used to encapsulate an object created from XML markup in a
+        loader object. The loader can be used to create several objects from the same
+        XML node. Each time the load() method is called a new object is created from
+        the node. The method getComponentById() will be added to the created objects and
+        can be used to obtain child components with. The last created object is stored
+        in the object property of the loader.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ObjectLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiObjectLoader" substitutionGroup="ObjectLoader"/>
+
+  <xs:attributeGroup name="ObjectLoaderAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="node" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:XMLElement - This is the XML element describing the object.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="autoNameMapping" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true any XML object that has an id attribute will create a
+          global reference to the object created from this XML element.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGrid">
+    <xs:annotation>
+      <xs:documentation>This class is used to display an OLAP Grid
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGrid" substitutionGroup="OlapGrid"/>
+
+  <xs:attributeGroup name="OlapGridAttributes">
+
+    <xs:attributeGroup ref="TreeViewBaseAttributes"/>
+
+    <xs:attribute name="allowHeaderSelection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiOlapGridSelectionModel - Whether clicking on a dimension header also selects the rows/column of the
+          header.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="canReorganizeDimensions" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true the user can reorganize the dimensions using drag and drop
+          TODO: Document what events are fired when the reorg should happen
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondimensiondrop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when a dimension
+          of the current grid is dropped
+          on another dimension. This can
+          only happen if canReorganizeDimensions
+          is true
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridCellInfo">
+    <xs:annotation>
+      <xs:documentation>This represents information about a cell in the OLAP grid. This information
+        describes if a cell is part of the header and more.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridCellInfoAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridCellInfo" substitutionGroup="OlapGridCellInfo"/>
+
+  <xs:attributeGroup name="OlapGridCellInfoAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="header" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the cell is part of the header</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="body" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the cell is part of the body</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="row" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - What row the cell is part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="column" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - What column the cell is part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dimension" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The dimension the axis header cell is part of. If the cell is part of the
+          body then this is null.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="axis" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The axis the cell is part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="axisPosition" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The axis position is the start position of the axis header cell</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="quadrant" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is used to tell what part of the OLAP grid the cell belongs to</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridDataModel">
+    <xs:annotation>
+      <xs:documentation>This defines the interface that is needed for a data model for aBiOlapGrid.
+        This actually implements a dummy data model. Extend this class to create
+        more useful data models. *
+        All methods in this data model can be safely overriden without calling the super
+        class since there are no side effects in any of the methods.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridDataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridDataModel" substitutionGroup="OlapGridDataModel"/>
+
+  <xs:attributeGroup name="OlapGridDataModelAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridDragEvent">
+    <xs:annotation>
+      <xs:documentation>This event is used for events related to some drag and drop inside the OLAP grid.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridDragEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridDragEvent" substitutionGroup="OlapGridDragEvent"/>
+
+  <xs:attributeGroup name="OlapGridDragEventAttributes">
+
+    <xs:attributeGroup ref="DragEventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridDropMarker">
+    <xs:annotation>
+      <xs:documentation>This component is used to draw a drop marker on top/inside an OLAP grid
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridDropMarkerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridDropMarker" substitutionGroup="OlapGridDropMarker"/>
+
+  <xs:attributeGroup name="OlapGridDropMarkerAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridResizeOutline">
+    <xs:annotation>
+      <xs:documentation>This component is used as an overlay above the column that is currently being
+        resized
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridResizeOutlineAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridResizeOutline" substitutionGroup="OlapGridResizeOutline"/>
+
+  <xs:attributeGroup name="OlapGridResizeOutlineAttributes">
+
+    <xs:attributeGroup ref="ResizeHandleAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridSelectionModel">
+    <xs:annotation>
+      <xs:documentation>Selection model forBiOlapGrid.
+
+        This selection model contains of selected areas (BiArea). An area consists
+        of a left, top, width and height propertty. Two selected areas may overlap
+        so be careful when trying to get all selected cells.
+
+        The selectedItems collection is aBiAreaCollection
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridSelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridSelectionModel" substitutionGroup="OlapGridSelectionModel"/>
+
+  <xs:attributeGroup name="OlapGridSelectionModelAttributes">
+
+    <xs:attributeGroup ref="SelectionModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridStateManager">
+    <xs:annotation>
+      <xs:documentation>A simple class that is used internally with theBiOlapGrid to keep track
+        of active and hover cell
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridStateManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridStateManager" substitutionGroup="OlapGridStateManager"/>
+
+  <xs:attributeGroup name="OlapGridStateManagerAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="active" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiOlapGridCellInfo - The active cell info</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onhoverchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>When the user hovers over a different part
+          of the OLAP grid
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondropoverchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the user is doing drag and drop
+          and the cell that the user is over changes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapGridViewManager">
+    <xs:annotation>
+      <xs:documentation>This class handles the visual properties of aBiOlapGrid
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapGridViewManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapGridViewManager" substitutionGroup="OlapGridViewManager"/>
+
+  <xs:attributeGroup name="OlapGridViewManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="showGridLines" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show grid lines between the cells in the OLAP grid</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scrollLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the scroll left to the view manager so that the view manager can figure
+          out what column to start at
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scrollTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the scroll top to the view manager so that the view manager can figure
+          out what row to start at
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="axisOnTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - This is used to tell which axis is to be shown as the column headers and
+          which to be shown as the row headers. A value of 0 means that the first
+          axis should be shown at the top.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cellMinimumWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The minimum width a cell might have. This is used when the user resizes a
+          colum. Setting this does not update the exisiting columns.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cellMinimumHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The minimum height a cell might have. This is used when the user resizes a
+          row. Setting this does not update the exisiting rows.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="OlapStateEvent">
+    <xs:annotation>
+      <xs:documentation>This class is used when the interactive state of the OLAP grid changes
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OlapStateEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOlapStateEvent" substitutionGroup="OlapStateEvent"/>
+
+  <xs:attributeGroup name="OlapStateEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="OpacityAnimator">
+    <xs:annotation>
+      <xs:documentation>Animates the opacity ofBiComponents to create various visual effects.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OpacityAnimatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOpacityAnimator" substitutionGroup="OpacityAnimator"/>
+
+  <xs:attributeGroup name="OpacityAnimatorAttributes">
+
+    <xs:attributeGroup ref="ComponentAnimationAttributes"/>
+
+    <xs:attribute name="type" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Setups common values (speed, acceleration type and loop mode) for default opacity animations.
+          Possible values are: pulsate, blink, fadeIn, fadeOut
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minOpacity" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Float - Limits how transparent the animated objects are allowed to be.
+          0.0 completely transparent, 1.0 completely opaque
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="speed" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number/String - Sets the duration, in milliseconds, of one animation cycle (some animation types use two
+          cycles).
+          The following string constants are also allowed:
+          slowest, slow, normal, fast, fastest
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="OptionPane">
+    <xs:annotation>
+      <xs:documentation>This class is used to layout default dialog controls. Normally this class
+        is not used directly but one of the static methods are used to create
+        new dialogs.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OptionPaneAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOptionPane" substitutionGroup="OptionPane"/>
+
+  <xs:attributeGroup name="OptionPaneAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="initialValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - This is used to define which of the options that
+          should be treated as the default acceptButton.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="acceptButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiEventTarget - The button that acts as the default accept button. If this is set
+          then the action
+          event is dispatched from the accept button when the enter key
+          is pressed. This does not have to
+          be a BiButton, any
+          BiEventTarget will work.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cancelButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiEventTarget - The button that acts as the default cancel button. If this is set
+          then the action
+          event is dispatched from the cancel button. This does not have to
+          be a BiButton, any
+          BiEventTarget will work.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - Sets the value of the option pane. This is used as the
+          dialogResult
+          when the option pane is used with a dialog.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="inputComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - This allows an input component to be shown below the message
+          component. This is created when creating input dialogs.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this option pane. If this is set to null
+          then the static string bundle forBiOptionPane is used
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="OrderedIterator">
+    <xs:annotation>
+      <xs:documentation>This is an ordered iterator that allows you to add items ordered by an index.
+        The items are ordered based on the index and finding and removing an item
+        based on its index is done in constant time. Inserting an item is in worst
+        case O(n) (where n is the number of items in the iterator).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="OrderedIteratorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiOrderedIterator" substitutionGroup="OrderedIterator"/>
+
+  <xs:attributeGroup name="OrderedIteratorAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PasswordField">
+    <xs:annotation>
+      <xs:documentation>A text field where the entered text is masked.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PasswordFieldAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPasswordField" substitutionGroup="PasswordField"/>
+
+  <xs:attributeGroup name="PasswordFieldAttributes">
+
+    <xs:attributeGroup ref="TextFieldAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PercentageStackedBarChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a percentage stacked bar chart for the given series.
+        A percentage stacked bar chart stacks the columns from the different series next to each
+        other and the value of the columns is expressed in percentage so all values
+        from the same category add up to 100%.
+        This is used with BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PercentageStackedBarChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPercentageStackedBarChart" substitutionGroup="PercentageStackedBarChart"/>
+
+  <xs:attributeGroup name="PercentageStackedBarChartAttributes">
+
+    <xs:attributeGroup ref="PercentageStackedColumnChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PercentageStackedBarChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a percentage stacked bar chart for the given series.
+        A percentage stacked bar chart stacks the columns from the different series next to each
+        other and the value of the columns is expressed in percentage so all values
+        from the same category add up to 100%.
+        This is used with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PercentageStackedBarChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPercentageStackedBarChart2" substitutionGroup="PercentageStackedBarChart2"/>
+
+  <xs:attributeGroup name="PercentageStackedBarChart2Attributes">
+
+    <xs:attributeGroup ref="PercentageStackedColumnChart2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PercentageStackedColumnChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a percentage stacked column chart for the given series.
+        A percentage stacked column chart stacks the columns from the different series on top of each
+        other and the value of the columns is expressed in percentage so all values
+        from the same category add up to 100%.
+        This is used with BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PercentageStackedColumnChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPercentageStackedColumnChart" substitutionGroup="PercentageStackedColumnChart"/>
+
+  <xs:attributeGroup name="PercentageStackedColumnChartAttributes">
+
+    <xs:attributeGroup ref="ColumnChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PercentageStackedColumnChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a percentage stacked column chart for the given series.
+        A percentage stacked column chart stacks the columns from the different series on top of each
+        other and the value of the columns is expressed in percentage so all values
+        from the same category add up to 100%.
+        This is used with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PercentageStackedColumnChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPercentageStackedColumnChart2" substitutionGroup="PercentageStackedColumnChart2"/>
+
+  <xs:attributeGroup name="PercentageStackedColumnChart2Attributes">
+
+    <xs:attributeGroup ref="ColumnChart2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PieChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a pie chart for the given series
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PieChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPieChart" substitutionGroup="PieChart"/>
+
+  <xs:attributeGroup name="PieChartAttributes">
+
+    <xs:attributeGroup ref="AbstractChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PieChartSection">
+    <xs:annotation>
+      <xs:documentation>
+        This class handles the components used to show the rectangles for a
+        pie chart.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PieChartSectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPieChartSection" substitutionGroup="PieChartSection"/>
+
+  <xs:attributeGroup name="PieChartSectionAttributes">
+
+    <xs:attributeGroup ref="AbstractChartSectionAttributes"/>
+
+    <xs:attribute name="radius">
+      <xs:annotation>
+        <xs:documentation>The size of the radius (0-1)
+          where 1 means that it will take up the entire available size
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="explode">
+      <xs:annotation>
+        <xs:documentation>The distance to move the sectio from the
+          center (0-1, percentage of available size).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="startAngle">
+      <xs:annotation>
+        <xs:documentation>The angle given in radians
+          where the pie chart section starts.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="endAngle">
+      <xs:annotation>
+        <xs:documentation>The angle given in radians
+          where the pie chart section ends.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Point">
+    <xs:annotation>
+      <xs:documentation>Simple class that describes a location of Point on a plane.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PointAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPoint" substitutionGroup="Point"/>
+
+  <xs:attributeGroup name="PointAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Polygon">
+    <xs:annotation>
+      <xs:documentation>This class represents a convex polygon. In a convex polygon,
+        no two sides may intersect more than once (at their endpoints),
+        and no vertex may be the intersection point of more than two
+        sides.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PolygonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPolygon" substitutionGroup="Polygon"/>
+
+  <xs:attributeGroup name="PolygonAttributes">
+
+    <xs:attributeGroup ref="ShapeAttributes"/>
+
+    <xs:attribute name="vertices" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiPoint[] - The vertices of this polygon</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Popup">
+    <xs:annotation>
+      <xs:documentation>A popup is a component that is displayed on top of all other components
+        and is not limited by the parent components view port.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PopupAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPopup" substitutionGroup="Popup"/>
+
+  <xs:attributeGroup name="PopupAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="screenLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position relative to the screen. Note that this can be both set and get
+          for popups.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="screenTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position relative to the screen. Note that this can be both set and get
+          for popups.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="clientLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position relative to the browser client area. Note that this can be both
+          set and get for popups.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="clientTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position relative to the browser client area. Note that this can be both
+          set and get for popups.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="opaque" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to make the popup opaque. An opaque popup will not let plugins and
+          other windowed controls show through. However, there is a price to this. This
+          is achieved using an internal iframe and this makes the popup heavier and
+          slower.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="autoHide" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to let the system decide when to hide the popup. Setting this to
+          false gives you better control but it also requires you to
+          handle the closing of the popup.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="allowOffScreen" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to allow the popup to be positioned off screen</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onbeforeshow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the popup is shown. This is a good
+          place to change the content of the popup and
+          set the preferred size if the default preferred
+          size is not wanted
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onshow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the popup is shown</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onhide" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the popup is hidden</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PopupManager">
+    <xs:annotation>
+      <xs:documentation>This singleton class manages the BiPopup
+        objects.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PopupManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPopupManager" substitutionGroup="PopupManager"/>
+
+  <xs:attributeGroup name="PopupManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="useOpaquePopups" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to make popup opaque by default. An opaque popup will not let plugins
+          and other windowed controls show through. However, there is a price to this.
+          This is achieved using an internal iframe and this makes the popup heavier and
+          slower.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="PrintFrame">
+    <xs:annotation>
+      <xs:documentation>BiPrintFrame is a helper class for printing any data from within a Bindows
+        application. It takes a Uri to a template file and a object containing named
+        strings as arguments and parses the template before sending it to the printer.
+
+        A template is typically an HTML document containing customizable tags used as
+        placeholders for data. The parser function being used can be easily extended to
+        handle more complex data, e.g. tables etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PrintFrameAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiPrintFrame" substitutionGroup="PrintFrame"/>
+
+  <xs:attributeGroup name="PrintFrameAttributes">
+
+    <xs:attributeGroup ref="IframeAttributes"/>
+
+    <xs:attribute name="textParser" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTextParser - The Parser used for generating parsed content.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ProgressBar">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show a progress bar.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ProgressBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiProgressBar" substitutionGroup="ProgressBar"/>
+
+  <xs:attributeGroup name="ProgressBarAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="maximum">
+      <xs:annotation>
+        <xs:documentation>The maximum value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum">
+      <xs:annotation>
+        <xs:documentation>The minimum value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value">
+      <xs:annotation>
+        <xs:documentation>The value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This event is fired when the maximum, minimum
+          or maximum properties are changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RadioButton">
+    <xs:annotation>
+      <xs:documentation>Represents a radio button control. A radio button control can have two
+        states; checked and unchecked. These are represented by the
+        checked property.
+        Once a radio button is checked clicking it again will not uncheck it. To
+        uncheck a radio button another radio button in the same
+        radio group must be checked.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RadioButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiRadioButton" substitutionGroup="RadioButton"/>
+
+  <xs:attributeGroup name="RadioButtonAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - A value associated with the radio button.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="checked" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the radio button is checked or not. When this is changed
+          the change event is fired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="group" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiRadioGroup - The group that the radio button should be part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the user presses the button (either using
+          the mouse or the keyboard)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the checked is changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RadioButtonMenuItem">
+    <xs:annotation>
+      <xs:documentation>This class is used for a menu item that displays a radio button to the left
+        of the text. To group different radio button menu items into a radio group
+        use theBiRadioGroup class in the same way it would be used for normal
+        radio buttons.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RadioButtonMenuItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiRadioButtonMenuItem" substitutionGroup="RadioButtonMenuItem"/>
+
+  <xs:attributeGroup name="RadioButtonMenuItemAttributes">
+
+    <xs:attributeGroup ref="MenuItemAttributes"/>
+
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - A value associated with the item.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="checked" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the item is checked or not</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="group" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiRadioGroup - The group that the radio button menu item should be part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the checked change</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RadioGroup">
+    <xs:annotation>
+      <xs:documentation>This class is used in conjunction with radio
+        buttons to ensure only one buttons is checked.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RadioGroupAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiRadioGroup" substitutionGroup="RadioGroup"/>
+
+  <xs:attributeGroup name="RadioGroupAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiRadioButton - This is the radio button that is checked</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="enabled" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the radio group is enabled or not. Setting this also
+          sets the enabled property on the radio buttons.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - This is the user value of the checked radio button in this radio
+          group. Setting this checks the first item that has this value.
+          If no item has this value the setting will have no effect.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="command" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiCommand - When the radio group has a command the enabled and
+          userValue are synchronized with the command.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the selected radio button is changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RangeModel">
+    <xs:annotation>
+      <xs:documentation>This class represents a range model that has a minumum, maximum, value and
+        an extent. This class is used by theBiProgressBar,BiScrollBar,BiSlider and
+        BiSpinner classes.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RangeModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiRangeModel" substitutionGroup="RangeModel"/>
+
+  <xs:attributeGroup name="RangeModelAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The value for the range</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The maximum value for the range</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The minimum value for the range</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="extent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The extent for the range</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the maximum,
+          minimum, value or
+          extent properties are changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RepeatButton">
+    <xs:annotation>
+      <xs:documentation>This class is used for buttons that repeatedly fire action events
+        The first action event is fired firstInterval milliseconds
+        after the mouse is pressed down on the button. The following action events
+        are fired every interval millisecond until the mouse button is
+        released.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RepeatButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiRepeatButton" substitutionGroup="RepeatButton"/>
+
+  <xs:attributeGroup name="RepeatButtonAttributes">
+
+    <xs:attributeGroup ref="ButtonAttributes"/>
+
+    <xs:attribute name="interval" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The time in milliseconds between the repeating action events</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="firstInterval" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The time in milliseconds before the first action event is fired</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ResizeHandle">
+    <xs:annotation>
+      <xs:documentation>This component can be used to allow another component to be resizable
+        using the mouse. The component can be used as a resize handle for the
+        component to resize. It can also be used without adding it to another
+        component by manually calling startResize in a mouse down
+        event handler.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ResizeHandleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiResizeHandle" substitutionGroup="ResizeHandle"/>
+
+  <xs:attributeGroup name="ResizeHandleAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="continuousLayout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Indicates that the ghost must be used to be a visual indicator for the duration of the resize
+          operation.
+          Once complete, the original component's dimensions will be updated accordingly.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ghost" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component that should be visually updated if continuousLayout is set to false.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="handleFor" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component that the handle should be a resize handle for.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="resizeDirection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The direction that the resizing should be done in. Valid
+          values are:
+          s - south
+          n - north
+          e - east
+          w - west
+          se - south east
+          sw - south west
+          ne - north east
+          nw - north west
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onresize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires continually during the resizing of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforeresize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires continually during the resizing of the component. Call
+          preventDefault
+          on the event object to prevent the new size from being applied.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onresizestart" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires once when the resizing begins. Call
+          preventDefault
+          on the event object to prevent the component from being resized.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onresizeend" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when resizing of the component ends.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ResourceLoader">
+    <xs:annotation>
+      <xs:documentation>This class is used to load different kinds of resources. There are basically
+        3 types of resources that this class can handle. The first 2 are script files
+        and a code string. The third one is a genereal object described by an XML
+        element and in this case an object is created using aBiXmlResourceParser.
+        When creating general objects a few special rules apply. If the created object
+        is an event target the resource loader will listen to load
+        and error events so that it can be notified by the object that
+        it is loaded. If the object has a load() method that will be
+        called if the object is not already loaded. To decide if the object is loaded
+        the resource loader will use getLoaded() if available and if that
+        isn't available it is assumed that the object is loaded (or does not require
+        loading).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ResourceLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiResourceLoader" substitutionGroup="ResourceLoader"/>
+
+  <xs:attributeGroup name="ResourceLoaderAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="autoNameMapping" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true any XML object that has an id attribute will create a
+          global reference to the object created from this XML element.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onprogress" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires every time one of the external resources have
+          been loaded. This is useful for providing visual feedback.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when all the resources have been loaded and executed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Resources">
+    <xs:annotation>
+      <xs:documentation>This class is used to load multiple resources
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ResourcesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiResources" substitutionGroup="Resources"/>
+
+  <xs:attributeGroup name="ResourcesAttributes">
+
+    <xs:attributeGroup ref="SerializedLoaderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RichEdit">
+    <xs:annotation>
+      <xs:documentation>
+        This control is used to to provide rich text editing of HTML documents
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RichEditAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiRichEdit" substitutionGroup="RichEdit"/>
+
+  <xs:attributeGroup name="RichEditAttributes">
+
+    <xs:attributeGroup ref="IframeAttributes"/>
+
+    <xs:attribute name="contentHtml">
+      <xs:annotation>
+        <xs:documentation>
+          The HTML code inside the rich editor frame. This does not include
+          the doctype nor any comments outside the root element.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Script">
+    <xs:annotation>
+      <xs:documentation>This class works much like the script element in HTML. You can set the uri
+        and it will fetch an external file that will be executed or you can use the
+        text property to execute some text.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ScriptAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiScript" substitutionGroup="Script"/>
+
+  <xs:attributeGroup name="ScriptAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The script text to evaluate</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The location of the script file</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="src" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - Alias to uri for backwards compatibility</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ScriptLoader">
+    <xs:annotation>
+      <xs:documentation>This class loads and executes a javascript file
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ScriptLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiScriptLoader" substitutionGroup="ScriptLoader"/>
+
+  <xs:attributeGroup name="ScriptLoaderAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The URI (location) of the file to load. If this is set to a string a
+          new URI is created from that string relative to the
+          ADF path.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the file has been loaded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ScriptLoaderQueue">
+    <xs:annotation>
+      <xs:documentation>Used to load multiple js files and once all are loaded they are executed
+        in the order they were added.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ScriptLoaderQueueAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiScriptLoaderQueue" substitutionGroup="ScriptLoaderQueue"/>
+
+  <xs:attributeGroup name="ScriptLoaderQueueAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="async" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If this is set to false then the loading will lock the UI thread
+          but the loading and execution will happen and finish when
+          load is called.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when all the scripts have been loaded and executed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onprogress" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires every time one of the external scripts have
+          been loaded. This is useful for providing visual feedback.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ScrollBar">
+    <xs:annotation>
+      <xs:documentation>This component is used to show a scroll bar.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ScrollBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiScrollBar" substitutionGroup="ScrollBar"/>
+
+  <xs:attributeGroup name="ScrollBarAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="extent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The extent for the scroll bar.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The maximum value for the scroll bar.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The minimum value for the scroll bar.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The value for the scroll bar.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minThumbSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The mimimum size of the thumb.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="unitIncrement" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The amount to change the scroll bar when pressing the buttons.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="blockIncrement" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The amount to change the scroll bar when the mouse is pressed on the scroll
+          bar (and not on the thumb or buttons).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="orientation" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The orientation of the scroll bar. Valid values are: horizontal vertical</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the extent,
+          value, minimum or
+          maximum properties are changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onscrollend" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the thumb is released
+          after scrolling.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SelectionItemCollection">
+    <xs:annotation>
+      <xs:documentation>This class is used internally insideBiSelectionModel to keep track of the
+        selected items. If you create a custom selection model you might need to also
+        create a custom selection model item collection. The type of the items is not
+        very important but the selection model needs to be able to work with this
+        type. You also need to override getItemHashCode if the items
+        are not instances ofBiObject.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SelectionItemCollectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSelectionItemCollection" substitutionGroup="SelectionItemCollection"/>
+
+  <xs:attributeGroup name="SelectionItemCollectionAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SelectionModel">
+    <xs:annotation>
+      <xs:documentation>This class provides a basic selection model
+        This treats children as
+        selectable items inside a component. The items can
+        be of any type but if they are not BiComponents you
+        will have to override the following methods and properties: first,
+        last, items, getNext, getPrevious,
+        scrollItemIntoView,
+        getItemLeft, getItemTop, getItemWidth
+        and getItemHeight.
+        To update the visuals (to show what is selected) override the following
+        methods: updateItemSelectionState, updateItemAnchorState
+        and updateItemLeadState.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSelectionModel" substitutionGroup="SelectionModel"/>
+
+  <xs:attributeGroup name="SelectionModelAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="owner" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - This is the owner component that is
+          containing the selectable objects. This should not be set after the
+          selection model has been used
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="multipleSelection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the selection model supports multiple selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="canDeselect" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the user can deselect items. If this is false you need to select something
+          else to deselect an item
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dragSelection" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Drag selection is used to hold down the mouse to select mutliple items</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="anchorItem" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent/Object - This item is used when doing multiple selection with the shift key</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="leadItem" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent/Object - This item is used when doing multiple selection. This is the last item selected.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedItems" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent[]/Object[] - Returns an array containing the selected items</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected items are changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onleaditemchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the lead item is changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SerializedLoader">
+    <xs:annotation>
+      <xs:documentation>Used to start multiple loaders in the order they were added.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SerializedLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSerializedLoader" substitutionGroup="SerializedLoader"/>
+
+  <xs:attributeGroup name="SerializedLoaderAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when all the loaders have finished loading,
+          or if an error occurs.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onprogress" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires every time one of the loaders has finished.
+          This is useful for providing visual feedback.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Set">
+    <xs:annotation>
+      <xs:documentation>A simple class for storing a set of objects
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SetAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSet" substitutionGroup="Set"/>
+
+  <xs:attributeGroup name="SetAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Shape">
+    <xs:annotation>
+      <xs:documentation>This class is an abstract base class for describing
+        the shapes of Image areas. This is a very general
+        class and can be extended to mean a variety of things.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ShapeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiShape" substitutionGroup="Shape"/>
+
+  <xs:attributeGroup name="ShapeAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SingleTree">
+    <xs:annotation>
+      <xs:documentation>A Simple one column Tree.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SingleTreeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSingleTree" substitutionGroup="SingleTree"/>
+
+  <xs:attributeGroup name="SingleTreeAttributes">
+
+    <xs:attributeGroup ref="TreeViewAttributes"/>
+
+    <xs:attribute name="indentWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The amount to indent child nodes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showExpandIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the expand and collapse icons</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="sortFunction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:function - The sort function to use. The function is passed the two
+          nodes to compare as arguments, to compare the value (text)
+          of the node use getData() on the node. Defaults to case
+          sensitive string compare.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="SingleTreeDataModel">
+    <xs:annotation>
+      <xs:documentation>Data model forBiSingleTree
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SingleTreeDataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSingleTreeDataModel" substitutionGroup="SingleTreeDataModel"/>
+
+  <xs:attributeGroup name="SingleTreeDataModelAttributes">
+
+    <xs:attributeGroup ref="TreeDataModelAttributes"/>
+
+    <xs:attribute name="treeView" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTree2 - The tree view the data model is acting on</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="SingleTreeNode">
+    <xs:annotation>
+      <xs:documentation>This class is used as the data for rows in theBiTree2 component
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SingleTreeNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSingleTreeNode" substitutionGroup="SingleTreeNode"/>
+
+  <xs:attributeGroup name="SingleTreeNodeAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Uri of image icon. Used for collapsed/leaf nodes and expanded nodes
+          without expandedIcon set.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="expandedIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Icon to show for an expanded node</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="data" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - Data to display for the node</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="expanded" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the node is expanded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the node is selected</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="lead" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the node is the lead item</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="SingleTreeViewManager">
+    <xs:annotation>
+      <xs:documentation>This class handles the visual properties of aBiSingleTree
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SingleTreeViewManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSingleTreeViewManager" substitutionGroup="SingleTreeViewManager"/>
+
+  <xs:attributeGroup name="SingleTreeViewManagerAttributes">
+
+    <xs:attributeGroup ref="TreeViewViewManagerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SizeAnimator">
+    <xs:annotation>
+      <xs:documentation>This class is used to animate the size ofBiComponent(s) and can be used to create visual effects.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SizeAnimatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSizeAnimator" substitutionGroup="SizeAnimator"/>
+
+  <xs:attributeGroup name="SizeAnimatorAttributes">
+
+    <xs:attributeGroup ref="ComponentAnimationAttributes"/>
+
+    <xs:attribute name="type" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets speed and acceleration type to useful values.
+          Can be one of the following string values: normal, smooth
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Starting width of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Starting height of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Destination width of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Destination height of the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets starting size for both width and height.
+          Note: The component will be square shaped.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets target size for both width and height.
+          Note: The component will be square shaped.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="accType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the acceleration type. Use constants fromBiComponentAnimation.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="speed" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number/String - Sets the duration of the animation.
+          Can be set in three different ways:
+          1.BiSizeAnimator.SPEEDx constants can be used.
+          2. One of the following strings: slowest, slow, normal, fast, fastest.
+          3. A number representing the length of the animation, measured in milliseconds.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fromComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - By setting the from-component you specify anotherBiComponent whos size will be used
+          for the animation's start state. If the from-component's size is changed, the animation
+          will update dynamically.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="toComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - By setting the to-component you specify anotherBiComponent whos size will be used
+          for the animation's target state. If the to-component's size is changed, the animation
+          will update dynamically.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Slider">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show a slider control.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SliderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSlider" substitutionGroup="Slider"/>
+
+  <xs:attributeGroup name="SliderAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="orientation">
+      <xs:annotation>
+        <xs:documentation>
+          The orientation of the slider. Valid values are: horizontal vertical
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="unitIncrement">
+      <xs:annotation>
+        <xs:documentation>
+          The amount to increase the slider when using the arrow keys and
+          the mouse wheel.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="blockIncrement">
+      <xs:annotation>
+        <xs:documentation>
+          The amount to increase the slider when using the page up and page
+          down keys as well as the amount to change the slider when the
+          mouse is pressed on the slider (and not on the handle).
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum">
+      <xs:annotation>
+        <xs:documentation>The maximum value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum">
+      <xs:annotation>
+        <xs:documentation>The minimum value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value">
+      <xs:annotation>
+        <xs:documentation>The value for the component</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          This event is fired when the maximum, minimum
+          or maximum properties are changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Sort">
+    <xs:annotation>
+      <xs:documentation>Collection of static functions used for sorting and comparing
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SortAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSort" substitutionGroup="Sort"/>
+
+  <xs:attributeGroup name="SortAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Spinner">
+    <xs:annotation>
+      <xs:documentation>A spinner is a text box that accepts a number. A spinner also has buttons
+        for increasing and decreasing the value.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SpinnerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSpinner" substitutionGroup="Spinner"/>
+
+  <xs:attributeGroup name="SpinnerAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="value" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The value for the spinner</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The maximum value for the spinner</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The minimum value for the spinner</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="font" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiFont - This is used to describe how to paint the text in the spinner.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text alignment. Valid values are: left right center</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the maximum,
+          minimum or maximum
+          properties are changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the enter key is pressed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oninvalidvalue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the value is change
+          becuase the value entered by the user was
+          not valid.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oninvalidcharacter" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired if an invalid character
+          is typed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SplitPane">
+    <xs:annotation>
+      <xs:documentation>A split pane is used to show two components with a splitter betwee them.
+        The splitter between the components can be dragged and in that way the
+        components are resized. If right to left the left and right component switch
+        palces.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SplitPaneAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSplitPane" substitutionGroup="SplitPane"/>
+
+  <xs:attributeGroup name="SplitPaneAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="orientation" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The orientation of the split pane. Valid values are horizontal
+          and vertical. If horizontal is used the components are placed to
+          the left and to the right of the splitter respectively. When vertical the
+          components are placed above and below. When using horizontal and right to
+          left the position of the left and right components are switched.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dividerLocation" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The location of the splitter from the left if horizontal orientation
+          and from the top if vertical orientation. If right to left is used this is
+          from the right instead of from the left.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dividerSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the divider (height if vertical orientation)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="leftComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component to the left (or top if vertical orientation) of the
+          splitter. This property is the same as topComponent.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component to the right (or bottom if vertical orientation) of the
+          splitter. This property is the same as bottomComponent.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="topComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component above (or to the left if horizontal orientation) of the
+          splitter. This property is the same as leftComponent.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bottomComponent" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component below (or to the right if hoizontal orientation)
+          the splitter. This property is the same as rightComponent.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="leftVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the left component. If this is false
+          the right component will take up the entire space of the split pane
+          and the splitter will be hidden.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="topVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Sets whether to show the top component. If this is false
+          the bottom component will take up the entire space of the split pane
+          and the splitter will be hidden. This property is the same as
+          leftVisible.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rightVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the right component. If this is false
+          the left component will take up the entire space of the split pane
+          and the splitter will be hidden.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="bottomVisible" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Sets whether to show the bottom component. If this is false
+          the top component will take up the entire space of the split pane
+          and the splitter will be hidden. This property is the same as
+          rightVisible.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondividerlocationchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when then
+          dividerLocation is
+          changed
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StackedBarChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a stacked bar chart for the given series. A stacked
+        bar chart stacks the bars from the different series next to each
+        other.
+        This is used with BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StackedBarChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStackedBarChart" substitutionGroup="StackedBarChart"/>
+
+  <xs:attributeGroup name="StackedBarChartAttributes">
+
+    <xs:attributeGroup ref="StackedColumnChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StackedBarChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a stacked bar chart for the given series. A stacked
+        bar chart stacks the bars from the different series next to each
+        other.
+        This is used with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StackedBarChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStackedBarChart2" substitutionGroup="StackedBarChart2"/>
+
+  <xs:attributeGroup name="StackedBarChart2Attributes">
+
+    <xs:attributeGroup ref="StackedColumnChart2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StackedColumnChart">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a stacked column chart for the given series. A stacked
+        column chart stacks teh columns from the different series on top of each
+        other.
+        This is used with BiGraph.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StackedColumnChartAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStackedColumnChart" substitutionGroup="StackedColumnChart"/>
+
+  <xs:attributeGroup name="StackedColumnChartAttributes">
+
+    <xs:attributeGroup ref="ColumnChartAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StackedColumnChart2">
+    <xs:annotation>
+      <xs:documentation>
+        This chart displays a stacked column chart for the given series. A stacked
+        column chart stacks teh columns from the different series on top of each
+        other.
+        This is used with BiGraph2.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StackedColumnChart2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStackedColumnChart2" substitutionGroup="StackedColumnChart2"/>
+
+  <xs:attributeGroup name="StackedColumnChart2Attributes">
+
+    <xs:attributeGroup ref="ColumnChart2Attributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StatusBar">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used for displaying status bars in Bindows
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StatusBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStatusBar" substitutionGroup="StatusBar"/>
+
+  <xs:attributeGroup name="StatusBarAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StatusBarPanel">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used to display sections in a
+        status bar.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StatusBarPanelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStatusBarPanel" substitutionGroup="StatusBarPanel"/>
+
+  <xs:attributeGroup name="StatusBarPanelAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StringBuffer">
+    <xs:annotation>
+      <xs:documentation>Creates a StringBuffer object which handles string concatenation faster
+        than the String class.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StringBufferAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStringBuffer" substitutionGroup="StringBuffer"/>
+
+  <xs:attributeGroup name="StringBufferAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="StringBundle">
+    <xs:annotation>
+      <xs:documentation>This class is used to make creating multilingual applications easier.
+        The string bundle is uses one hash table (objects in JavaScript) for
+        every language and falls back on English ("en") in case the
+        user language is not available.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StringBundleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStringBundle" substitutionGroup="StringBundle"/>
+
+  <xs:attributeGroup name="StringBundleAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="language" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The current language</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the current strings
+          changes in some way. This happens when the
+          language is changed or a new bundle is added
+          with the current language.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Style">
+    <xs:annotation>
+      <xs:documentation>This class works much like the script element in HTML. You can set the uri
+        and it will fetch an external file that will be executed or you can use the
+        text property to execute some text.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StyleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiStyle" substitutionGroup="Style"/>
+
+  <xs:attributeGroup name="StyleAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The script text to evaluate</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The location of the script file</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="src" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - Alias to uri for backwards compatibility</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Subtree">
+    <xs:annotation>
+      <xs:documentation>Internal class for handling subtrees
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SubtreeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiSubtree" substitutionGroup="Subtree"/>
+
+  <xs:attributeGroup name="SubtreeAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TabBar">
+    <xs:annotation>
+      <xs:documentation>This component is used as a container for tab
+        buttons. When using tab panes this
+        control is used internally.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TabBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTabBar" substitutionGroup="TabBar"/>
+
+  <xs:attributeGroup name="TabBarAttributes">
+
+    <xs:attributeGroup ref="ToolBarAttributes"/>
+
+    <xs:attribute name="alignment" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes how to draw the tab bar. Supported values are top and
+          bottom.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTabButton - The currently selected tab button.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the selected tab button.
+          If no button is selected this returns -1.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected tab
+          button changes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TabButton">
+    <xs:annotation>
+      <xs:documentation>This class is used to display tabs for aBiTabPane or aBiTabBar
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TabButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTabButton" substitutionGroup="TabButton"/>
+
+  <xs:attributeGroup name="TabButtonAttributes">
+
+    <xs:attributeGroup ref="ToolBarRadioButtonAttributes"/>
+
+    <xs:attribute name="alignment" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes whether the tab button should be drawn so that it looks like
+          it would be at the top of a tab pane or at the bottom of a tab pane.
+          Supported values are top and bottom.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TabPage">
+    <xs:annotation>
+      <xs:documentation>This class represents the pages inside a tab
+        pane. A tab page has a BiTabButton
+        that is used to display a button for the page when used with a tab pane.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TabPageAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTabPage" substitutionGroup="TabPage"/>
+
+  <xs:attributeGroup name="TabPageAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="alignment" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes whether the tab page should be drawn so that it appears like the
+          tabes are placed at the top of a tab pane or at the bottom of a tab pane.
+          Supported values are top and bottom.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="tabButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTabButton - The tab button used with the tab page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the page is selected</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text to show on the tab button</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage - The icon to show on the tab button</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected value changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TabPane">
+    <xs:annotation>
+      <xs:documentation>This class is used for creating tab controls. A tab control contains
+        one or more tab pages. Each tab page also
+        has a tab button that is shown above the
+        page and when the button is clicked the page is shown.
+        Bindows supports showing the tabs at the bottom or the top. Use the
+        alignmnet property to change this.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TabPaneAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTabPane" substitutionGroup="TabPane"/>
+
+  <xs:attributeGroup name="TabPaneAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="alignment" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This describes whether the tabs should be placed at the top of a tab pane or
+          at the bottom of a tab pane.
+          Supported values are top and bottom.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selected" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTabPage - The currently selected tab page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the selected tab page.
+          If no page is selected this returns -1.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected tab page changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TextArea">
+    <xs:annotation>
+      <xs:documentation>A multiline text input field
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TextAreaAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTextArea" substitutionGroup="TextArea"/>
+
+  <xs:attributeGroup name="TextAreaAttributes">
+
+    <xs:attributeGroup ref="TextFieldAttributes"/>
+
+    <xs:attribute name="wrap" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the text should wrap automatically as the user types.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TextField">
+    <xs:annotation>
+      <xs:documentation>This class is used to display a single line plain text input
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TextFieldAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTextField" substitutionGroup="TextField"/>
+
+  <xs:attributeGroup name="TextFieldAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text on the text field</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="font" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiFont - This is used to describe how to paint the text in the text field.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text alignment. Valid values are: left right center</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maxLength" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The maximum number of characters that the user can enter into the text field</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="readOnly" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the user can enter text in the text field</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="validator" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Function - This property is a function that is used to validate the text of
+          the text field. The function should take a string and return
+          true if the text is valid.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="invalidMessage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This property can be used to give information about why the value
+          might be invalid.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectionStart" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The starting point of the selection in the text field. If not selected this
+          returns -1.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectionLength" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The length (number of chracters) of the currently selected text in the text field</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectionText" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The currently selected text in the text field</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="allowTab" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether pressing the tab key should insert a tab character or move the focus from
+          the text field
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The left padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingRight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The right padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The top padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="paddingBottom" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The bottom padding (in pixels)</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the enter key is pressed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ontextchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the text has changed.
+          This happens when the user in some way changes
+          the text inside the text field. This event
+          is fired continiously as the user types.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the text field is blurred
+          and the text has changed since the text field got
+          focus.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TextLoader">
+    <xs:annotation>
+      <xs:documentation>This class is used to load a plain text document from the server or the
+        file system (if the application is run locally).
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TextLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTextLoader" substitutionGroup="TextLoader"/>
+
+  <xs:attributeGroup name="TextLoaderAttributes">
+
+    <xs:attributeGroup ref="AbstractLoaderAttributes"/>
+
+    <xs:attribute name="method" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The HTTP method to use for the request</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The URI (location) of the file to load. If this is set to a string a
+          new URI is created from that string relative to the
+          ADF path.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="user" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The user name to use when authentication is needed to load the file</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="password" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The password to use when authentication is needed to load the file</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the file has been loaded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TextParser">
+    <xs:annotation>
+      <xs:documentation>BiTextParser is a helper class for parsing text within a Bindows
+        application.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TextParserAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTextParser" substitutionGroup="TextParser"/>
+
+  <xs:attributeGroup name="TextParserAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="replacePattern" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The pattern to match and replace.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="replaceFlags" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - RegExp flags</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="printStringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The Object containing the strings for replacing</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="parseFunction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Function - The function being used while parsing.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Theme">
+    <xs:annotation>
+      <xs:documentation>This class represents a theme which consists of a css file
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ThemeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTheme" substitutionGroup="Theme"/>
+
+  <xs:attributeGroup name="ThemeAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="default" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the theme is the default theme</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="menuCss" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is the string needed for the IE menus to work correctly</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ThemeManager">
+    <xs:annotation>
+      <xs:documentation>This singleton class is used for theme support in Bindows
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ThemeManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiThemeManager" substitutionGroup="ThemeManager"/>
+
+  <xs:attributeGroup name="ThemeManagerAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="defaultTheme" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTheme - The theme that is currently being used</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onthemechanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the default
+          theme changes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TimePicker">
+    <xs:annotation>
+      <xs:documentation>This component provides a spinner like component
+        that is used to enter a time. The control consists of different text fields
+        for the different parts of the time string. The string format is decided
+        using aBiDateFormat object.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TimePickerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTimePicker" substitutionGroup="TimePicker"/>
+
+  <xs:attributeGroup name="TimePickerAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="minimum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The minimum selectable date</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="maximum" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - The maximum selectable date</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="date" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Date - This is a date object that describes the currently entered time</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dateFormat" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiDateFormat - This is theBiDateFormat that describes how to format the text inside
+          the time date picker.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the time is changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfieldchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired when the active field of the
+          component changes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oninvalidcharacter" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired if an invalid character
+          is typed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Timer">
+    <xs:annotation>
+      <xs:documentation>This class can be used to schedule events to occur later in time.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TimerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTimer" substitutionGroup="Timer"/>
+
+  <xs:attributeGroup name="TimerAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="enabled" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If this is false no tick events are fired.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="interval" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of milliseconds between the firing of the tick
+          events. Changing this also stops the timer.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ontick" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires every interval milliseconds for
+          an enabled and started timer.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TimerManager">
+    <xs:annotation>
+      <xs:documentation>This is a singleton class that handles the disposal of all
+        timers.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TimerManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTimerManager" substitutionGroup="TimerManager"/>
+
+  <xs:attributeGroup name="TimerManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBar">
+    <xs:annotation>
+      <xs:documentation>This class is used to create a tool bar.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBar" substitutionGroup="ToolBar"/>
+
+  <xs:attributeGroup name="ToolBarAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarButton">
+    <xs:annotation>
+      <xs:documentation>This is used to create buttons that are placed on a tool bar.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarButton" substitutionGroup="ToolBarButton"/>
+
+  <xs:attributeGroup name="ToolBarButtonAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+    <xs:attribute name="onaction" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the button is clicked</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarMenuButton">
+    <xs:annotation>
+      <xs:documentation>This class creates a tool bar button that shows a menu
+        when the button is pressed.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarMenuButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarMenuButton" substitutionGroup="ToolBarMenuButton"/>
+
+  <xs:attributeGroup name="ToolBarMenuButtonAttributes">
+
+    <xs:attributeGroup ref="ToolBarButtonAttributes"/>
+
+    <xs:attribute name="menu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiMenu - The menu to show when the button is pressed.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarRadioButton">
+    <xs:annotation>
+      <xs:documentation>This represents a radio button that can be placed on a tool bar.
+        To group different tool bar radio buttons into a radio group
+        use the BiRadioGroup class in the same
+        way it would be used for normal radio buttons.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarRadioButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarRadioButton" substitutionGroup="ToolBarRadioButton"/>
+
+  <xs:attributeGroup name="ToolBarRadioButtonAttributes">
+
+    <xs:attributeGroup ref="ToolBarToggleButtonAttributes"/>
+
+    <xs:attribute name="group" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiRadioGroup - The group that the radio button should be part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarSeparator">
+    <xs:annotation>
+      <xs:documentation>This class is used to display a separator on a tool bar.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarSeparatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarSeparator" substitutionGroup="ToolBarSeparator"/>
+
+  <xs:attributeGroup name="ToolBarSeparatorAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarSplitMenuButton">
+    <xs:annotation>
+      <xs:documentation>This compound widget consists of a toggle-button and a drop down menu.
+        The toggle-button can be plain text or have an icon or both.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarSplitMenuButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarSplitMenuButton" substitutionGroup="ToolBarSplitMenuButton"/>
+
+  <xs:attributeGroup name="ToolBarSplitMenuButtonAttributes">
+
+    <xs:attributeGroup ref="ToolBarButtonAttributes"/>
+
+    <xs:attribute name="menu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiMenu - Sets the menu on the control</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:: String The text to use on the button - Sets the label text on the button of the control.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarSplitToggleMenuButton">
+    <xs:annotation>
+      <xs:documentation>This compound widget consists of a button and a drop down menu.
+        The Button can be plain text or have an icon or both.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarSplitToggleMenuButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarSplitToggleMenuButton" substitutionGroup="ToolBarSplitToggleMenuButton"/>
+
+  <xs:attributeGroup name="ToolBarSplitToggleMenuButtonAttributes">
+
+    <xs:attributeGroup ref="ToolBarToggleButtonAttributes"/>
+
+    <xs:attribute name="menu" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiMenu - Sets the menu on the control</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Sets the label text on the button of the control.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolBarToggleButton">
+    <xs:annotation>
+      <xs:documentation>This represents a toggle button (check box button) that can be placed on a tool bar.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolBarToggleButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolBarToggleButton" substitutionGroup="ToolBarToggleButton"/>
+
+  <xs:attributeGroup name="ToolBarToggleButtonAttributes">
+
+    <xs:attributeGroup ref="ToolBarButtonAttributes"/>
+
+    <xs:attribute name="checked" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the button is checked or not. When this is changed
+          the change event is fired.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="userValue" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - A value associated with the button.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the checked is changed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolTip">
+    <xs:annotation>
+      <xs:documentation>This class is used for showing generic tool tip controls. A tool tip
+        can contain other controls.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolTipAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolTip" substitutionGroup="ToolTip"/>
+
+  <xs:attributeGroup name="ToolTipAttributes">
+
+    <xs:attributeGroup ref="PopupAttributes"/>
+
+    <xs:attribute name="hideOnHover" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - If this is true then the tool tip is hidden if the mouse pointer enters the
+          tool tip.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="mousePointerOffsetX" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position of the tool tip relative to the mouse pointer</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="mousePointerOffsetY" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The position of the tool tip relative to the mouse pointer</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="hideInterval" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of milliseconds before hiding the tool tip</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showInterval" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of milliseconds before showing the tool tip</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolTipManager">
+    <xs:annotation>
+      <xs:documentation>A singleton class used by the system to manage tool
+        tips.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolTipManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiToolTipManager" substitutionGroup="ToolTipManager"/>
+
+  <xs:attributeGroup name="ToolTipManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="currentToolTip" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiToolTip - The currently shown (or about to show) tool tip</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tree">
+    <xs:annotation>
+      <xs:documentation>This class is used for showing a tree, a column list and a combined
+        tree with multiple columns. The control also provides headers that can
+        be used to resize the columns, reorder the columns or sort the data by
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTree" substitutionGroup="Tree"/>
+
+  <xs:attributeGroup name="TreeAttributes">
+
+    <xs:attributeGroup ref="AbstractGridAttributes"/>
+
+    <xs:attribute name="indentWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The amount to indent child nodes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showPlusMinus" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the expand and collapse icons</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showRootLines" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show lines on the top most level</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="indentColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The column to indent by.
+          Setting this to -1 (or a value greater than the column count) removes
+          the indentation.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showLines" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the lines in the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="expanded" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the node is expanded or not. The tree control is always
+          expanded so setting this to false has no effect.
+          This is provided so that the tree has the same interface as the
+          tree nodes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selected row/cell changes</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onexpandedchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the tree is expanded or
+          collapsed and the lead item is changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tree2">
+    <xs:annotation>
+      <xs:documentation>This component is a special case ofBiTreeView which has an interface which
+        is similar toBiTree
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Tree2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTree2" substitutionGroup="Tree2"/>
+
+  <xs:attributeGroup name="Tree2Attributes">
+
+    <xs:attributeGroup ref="TreeViewAttributes"/>
+
+    <xs:attribute name="columnCount" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The number of columns in the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnNames" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The text to show on the headers of the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnWidths" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String[] - The widths of the columns of the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnOrders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - The order of the columns. This an array containing the indexes of the
+          columns.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the headers for the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showRowHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the row headers for the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showGridLines" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show grid lines between the cells in the tree</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tree2Cell">
+    <xs:annotation>
+      <xs:documentation>This is used for the cells in aBiTree2Row row
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Tree2CellAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTree2Cell" substitutionGroup="Tree2Cell"/>
+
+  <xs:attributeGroup name="Tree2CellAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="data" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object - The data that is associated with the cell</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tree2DataModel">
+    <xs:annotation>
+      <xs:documentation>This data model is to be used withBiTree2. It uses theBiTree2Row and
+        BiTree2Cell to provide the data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Tree2DataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTree2DataModel" substitutionGroup="Tree2DataModel"/>
+
+  <xs:attributeGroup name="Tree2DataModelAttributes">
+
+    <xs:attributeGroup ref="TreeDataModelAttributes"/>
+
+    <xs:attribute name="treeView" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTree2 - The tree view the data model is acting on</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tree2Row">
+    <xs:annotation>
+      <xs:documentation>This class is used as the data for rows in theBiTree2 component
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Tree2RowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTree2Row" substitutionGroup="Tree2Row"/>
+
+  <xs:attributeGroup name="Tree2RowAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="expanded" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the row is expanded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tree2ViewManager">
+    <xs:annotation>
+      <xs:documentation>This class is a special view manager to be used withBiTree2
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Tree2ViewManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTree2ViewManager" substitutionGroup="Tree2ViewManager"/>
+
+  <xs:attributeGroup name="Tree2ViewManagerAttributes">
+
+    <xs:attributeGroup ref="TreeViewViewManagerAttributes"/>
+
+    <xs:attribute name="indentColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The column to indent</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeDataModel">
+    <xs:annotation>
+      <xs:documentation>This data model takes a a tree consisting ofBiTreeNode2 nodes and exposes
+        the interface needed by theBiTreeView. The internal tree does not have to
+        be aBiTreeNode2 as long as getNodeChildren, getNodeHashCode, getCellText and
+        getSortFunction (if sorting is needed) are overridden.
+        The default implementation assumes that the data in theBiTreeNode2 objects
+        are arrays containing the cell data.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeDataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeDataModel" substitutionGroup="TreeDataModel"/>
+
+  <xs:attributeGroup name="TreeDataModelAttributes">
+
+    <xs:attributeGroup ref="TreeViewDataModelAttributes"/>
+
+    <xs:attribute name="rootNode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTreeNode2 - The tree node that is the root of the data</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondatachanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the
+          data changes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onexpand" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a row has expanded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncollapse" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a row has collapsed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforeexpand" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired before a row is expanded</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforecollapse" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired before a row is collapsed</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onrowcountchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the row count changes.
+          The rowIndex and the rowCount properties on the
+          event object are available for this event
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeHelper">
+    <xs:annotation>
+      <xs:documentation>This class contains some static methods that are usufull when working
+        with trees.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeHelperAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeHelper" substitutionGroup="TreeHelper"/>
+
+  <xs:attributeGroup name="TreeHelperAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeIterator">
+    <xs:annotation>
+      <xs:documentation>This class is used for iterating over rows and subtrees in a tree
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeIteratorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeIterator" substitutionGroup="TreeIterator"/>
+
+  <xs:attributeGroup name="TreeIteratorAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="rowIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The row index that the iterator is currently at</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeIteratorStackItem">
+    <xs:annotation>
+      <xs:documentation>This class is used internally byBiTreeIterator to keep track of the path stack
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeIteratorStackItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeIteratorStackItem" substitutionGroup="TreeIteratorStackItem"/>
+
+  <xs:attributeGroup name="TreeIteratorStackItemAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeNode">
+    <xs:annotation>
+      <xs:documentation>This represents a tree node for a tree or a
+        row for a tree. A tree node is not a component
+        but it has some visual properties that are similar to a
+        component.
+        When working with trees and column list it is usually suitable to extend
+        this class instead of using it directly because this gives better control
+        over what data is bound to the node and what text to show on the row.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeNode" substitutionGroup="TreeNode"/>
+
+  <xs:attributeGroup name="TreeNodeAttributes">
+
+    <xs:attributeGroup ref="AbstractGridRowAttributes"/>
+
+    <xs:attribute name="expanded" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the node is expanded or not.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeNode2">
+    <xs:annotation>
+      <xs:documentation>This class is used to build up the tree for the tree model to use
+        with theBiTreeView andBiTreeDataModel
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeNode2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeNode2" substitutionGroup="TreeNode2"/>
+
+  <xs:attributeGroup name="TreeNode2Attributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="data" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Object[] - The data that is associated to the node</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeSelectionModel">
+    <xs:annotation>
+      <xs:documentation>This class is used to handle the selection of the
+        nodes in a tree.
+        It extends the BiListSelectionModel
+        to be able to handle threaded data.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeSelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeSelectionModel" substitutionGroup="TreeSelectionModel"/>
+
+  <xs:attributeGroup name="TreeSelectionModelAttributes">
+
+    <xs:attributeGroup ref="SelectionModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeView">
+    <xs:annotation>
+      <xs:documentation>This class is the base forBiGrid2 andBiTree2. It can be used directly
+        with a data model.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeView" substitutionGroup="TreeView"/>
+
+  <xs:attributeGroup name="TreeViewAttributes">
+
+    <xs:attributeGroup ref="TreeViewBaseAttributes"/>
+
+    <xs:attribute name="showBrokenCellTextAsToolTip" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:boolean - If this is property is set to true, tooltip will show whenever a broken cell is hovered. Default
+          value is false.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewBase">
+    <xs:annotation>
+      <xs:documentation>This is the abstract base class forBiTreeView andBiOlapGrid. It contains
+        the shared methods and implementations of these 2 classes
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewBaseAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewBase" substitutionGroup="TreeViewBase"/>
+
+  <xs:attributeGroup name="TreeViewBaseAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="useNativeScrollBars" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to use native or custom scroll bars. Custom scroll bars are needed/preferred
+          when the tree view/grid has an attached component model or inline edit model.
+          If you want to change this it is better to change it before the component has
+          been created.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectionModel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTreeViewSelectionModel/BiOlapGridSelectionModel - The selection model handling the selected rows and cells
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="viewManager" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTreeViewViewManager/BiOlapGridViewManager - The view manager handles visual aspects that are not directly
+          related to
+          the data model
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="dataModel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTreeViewDataModel/BiOlapGridDataModel - The data model describes the data to be shown in the tree view and
+          OLAP grid
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="inlineEditModel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiInlineEditModel - The inline edit model is used to handle editing of cells in the tree view.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="attachedComponentModel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiAttachedComponentModel - The attached component model is used to handle Bindows components inside the
+          cells of the tree view.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewCellInfo">
+    <xs:annotation>
+      <xs:documentation>This represents information about a cell in the tree view.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewCellInfoAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewCellInfo" substitutionGroup="TreeViewCellInfo"/>
+
+  <xs:attributeGroup name="TreeViewCellInfoAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="row" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - What row the cell is part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="column" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - What column the cell is part of</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewDataModel">
+    <xs:annotation>
+      <xs:documentation>This defines the interface that is needed for a data model for aBiTreeView.
+        This actually implements a dummy data model. Extend this class to create
+        more useful data models
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewDataModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewDataModel" substitutionGroup="TreeViewDataModel"/>
+
+  <xs:attributeGroup name="TreeViewDataModelAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="allExpanded" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Sets all available rows expanded.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondatachanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the data
+          has changed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewDataModelEvent">
+    <xs:annotation>
+      <xs:documentation>This event class is used withBiTreeViewDataModel instances so that tree view can be updated to reflect the changes
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewDataModelEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewDataModelEvent" substitutionGroup="TreeViewDataModelEvent"/>
+
+  <xs:attributeGroup name="TreeViewDataModelEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+    <xs:attribute name="preventUpdate" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Prevent update flag.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewDragHeader">
+    <xs:annotation>
+      <xs:documentation>This component is used to show a header being dragged when the user is
+        reorganizing the headers for aBiTreeView
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewDragHeaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewDragHeader" substitutionGroup="TreeViewDragHeader"/>
+
+  <xs:attributeGroup name="TreeViewDragHeaderAttributes">
+
+    <xs:attributeGroup ref="LabelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewDragHeaderMarker">
+    <xs:annotation>
+      <xs:documentation>This class is used withBiTreeView when the columns are being reorder to
+        give feedback where the column will be dropped
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewDragHeaderMarkerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewDragHeaderMarker" substitutionGroup="TreeViewDragHeaderMarker"/>
+
+  <xs:attributeGroup name="TreeViewDragHeaderMarkerAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewResizeOutline">
+    <xs:annotation>
+      <xs:documentation>This component is used as an overlay above the column that is currently being
+        resized
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewResizeOutlineAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewResizeOutline" substitutionGroup="TreeViewResizeOutline"/>
+
+  <xs:attributeGroup name="TreeViewResizeOutlineAttributes">
+
+    <xs:attributeGroup ref="ResizeHandleAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewSelectionModel">
+    <xs:annotation>
+      <xs:documentation>Selection model forBiTreeView.
+
+        The selection model can operate in 2 modes: cell or row.
+        The selected cells/rows are identified by the row index/column index in the
+        data model.
+
+        The items in the selectedItems hash are of typeBiTreeViewSelectionModelItem
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewSelectionModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewSelectionModel" substitutionGroup="TreeViewSelectionModel"/>
+
+  <xs:attributeGroup name="TreeViewSelectionModelAttributes">
+
+    <xs:attributeGroup ref="SelectionModelAttributes"/>
+
+    <xs:attribute name="selectionMode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - Whether to use row selection or cell selection. Valid values are "row"
+          and "cell"
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewSelectionModelItem">
+    <xs:annotation>
+      <xs:documentation>This class is used internally inBiTreeViewSelectionModel to keep track of
+        the selected rows
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewSelectionModelItemAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewSelectionModelItem" substitutionGroup="TreeViewSelectionModelItem"/>
+
+  <xs:attributeGroup name="TreeViewSelectionModelItemAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="row" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The row that this represents</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="column" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The column that this represents</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewStateManager">
+    <xs:annotation>
+      <xs:documentation>A simple class that is used internally with theBiTreeView to keep track
+        of active and hover cell
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewStateManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewStateManager" substitutionGroup="TreeViewStateManager"/>
+
+  <xs:attributeGroup name="TreeViewStateManagerAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeViewViewManager">
+    <xs:annotation>
+      <xs:documentation>This class handles the visual properties of aBiTreeView
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeViewViewManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiTreeViewViewManager" substitutionGroup="TreeViewViewManager"/>
+
+  <xs:attributeGroup name="TreeViewViewManagerAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="treeView" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiTreeView - The tree view this view manager is to be used with</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showGridLines" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show grid lines between the cells in the tree view</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scrollLeft" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the scroll left to the view manager so that the view manager can figure out what column to
+          start at
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scrollTop" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - Sets the scroll top to the view manager so that the view manager can figure out what row to start at
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="indentColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the column that should be indented. Use -1 to not show any
+          indention
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="highlightSortColumn" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to highlight the background of the sorted column</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="columnOrders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number[] - The order of the columns in the visual representation</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rowHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of a row in the tree view</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the headers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="headersHeight" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The height of the column headers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ascendingIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The path to the arrow image to use for ascending sort</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="descendingIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The path to the arrow image to use for descending sort</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showRowHeaders" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the row headers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rowHeadersWidth" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The width of the row headers</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="UndeterminedProgressBar">
+    <xs:annotation>
+      <xs:documentation>
+        This component is used to show a progress bar that shows progress
+        of an undeterminable size. The progress bar is animated to show that it
+        is busy. Use start and stop to control the
+        animation. Changing the maximum
+        changes the number of steps the animation does.
+
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="UndeterminedProgressBarAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiUndeterminedProgressBar" substitutionGroup="UndeterminedProgressBar"/>
+
+  <xs:attributeGroup name="UndeterminedProgressBarAttributes">
+
+    <xs:attributeGroup ref="ProgressBarAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Uri">
+    <xs:annotation>
+      <xs:documentation>This class is used to define a Universal Resource Identifier (URI). This
+        is sometimes also known as a Uniform Resource Locator (URL). A URI is
+        used to describe the location and source of external files. A URI is
+        only a representation of the string format describing the URI. It does
+        not know how to lookup the information the URI might point at.
+        A general URI has the following format. Below this is a list of what
+        part of the URI maps to what property. http://user:[email protected]:80/dir/file.html?param0=value=0;param1=value1#fragment
+        scheme - http userInfo - user:password host - www.domain.com port - 80 path - /dir/file.html dirPath - /dir/ query -
+        ?param0=value=0;param1=value1
+        fragment - #fragment getParam("param0") - value0 getParam("param1") - value1 href -
+        http://user:[email protected]:80/dir/file.html?param0=value=0;param1=value1#fragment
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="UriAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiUri" substitutionGroup="Uri"/>
+
+  <xs:attributeGroup name="UriAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+    <xs:attribute name="href" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - This is the complete string representation of the URI.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="VBox">
+    <xs:annotation>
+      <xs:documentation>This is a verticalBiBox where components are laid out from top to bottom.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="VBoxAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiVBox" substitutionGroup="VBox"/>
+
+  <xs:attributeGroup name="VBoxAttributes">
+
+    <xs:attributeGroup ref="BoxAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="WebService">
+    <xs:annotation>
+      <xs:documentation>This is a factory class to the
+        Microsoft
+        WebService Behavior. Creating aBiWebService actually creates and returns
+        an HTML element with the given behavior attached.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WebServiceAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWebService" substitutionGroup="WebService"/>
+
+  <xs:attributeGroup name="WebServiceAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="WebService2">
+    <xs:annotation>
+      <xs:documentation>Construct a web service client. A BiWebService2 object allows accessing web services through SOAP, based on a WSDL
+        describing the services' interfaces. To use BiWebService2, first construct an object of this class. Then, call the object's
+        useService method -- passing the URL to the WSDL describing the service and the service's name. Finally, call syncInvoke,
+        asyncInvoke and callMethod to invoke service operations synchronously or asynchronously.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WebService2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWebService2" substitutionGroup="WebService2"/>
+
+  <xs:attributeGroup name="WebService2Attributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="async" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - This property determines whether or not calls made by the web service using callMethod and service
+          loading using useService without specifying an async flag is done asynchronously.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onserviceloaded" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Notifies that loading the WSDL used to describe the service represented by this instance is complete. If the event
+          has an 'err' member, this describes an error which occurred during loading.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncallcomplete" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Notifies that an asynchronous web service operation invocation was completed, either succesfuly or with errors.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Window">
+    <xs:annotation>
+      <xs:documentation>This class is used for internal windows inside the application window.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WindowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWindow" substitutionGroup="Window"/>
+
+  <xs:attributeGroup name="WindowAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="continuousLayout" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether resizing/moving of the window should be continuously updated.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="contentPane" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - This returns the component representing the client area of the window.
+          All components should be added to this component.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showIcon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the icon on the caption.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMinimize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the minimize button on the caption.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showMaximize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiWindow - Whether to show the maximize button on the caption</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="showClose" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to show the close button on the caption.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="caption" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The title text of the window.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="icon" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage - The icon image to show on the window caption. Note that changing
+          the image object does not update the window icon. You'll have to
+          set the icon property to update the icon. The size of the icon
+          is ignored and will always be 16 x 16 pixels.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="canMinimize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the window can be minimized by the user.
+          If the window cannot be minimized and the minimize button is shown the
+          button is disabled.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="hideChrome" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to hide the caption bar of the window.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="resizable" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the window can be resized by the user.
+          If the window cannot be resized and the maximize button is shown the
+          button is disabled.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="movable" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the window can be moved by the user.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="state" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The state of the window. Valid values are: normal maximized minimized</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="active" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether the window should be the active window.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="acceptButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiEventTarget - The button that acts as the default accept button. If this is set
+          then the action
+          event is dispatched from the accept button when the enter key
+          is pressed. This does not have to
+          be a BiButton, any
+          BiEventTarget will work.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="cancelButton" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiEventTarget - The button that acts as the default cancel button. If this is set
+          then the action
+          event is dispatched from the cancel button when the Esc key is pressed.
+          This does not have to be a BiButton, any
+          BiEventTarget will work.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="opaque" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to make the window opaque. An opaque window will not let plugins and
+          other windowed controls show through. However, there is a price to this. This
+          is achieved using an internal iframe and this makes the window heavier and
+          slower.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this window. If this is set to
+          null then the string bundle for
+          application is used.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onbeforeclose" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the window is closed. If the
+          default action is prevented the window is
+          not closed.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onclose" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the window is closed.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncaptionchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the caption changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onstatechanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the window state changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oniconchanged" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the icon changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onactivated" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the window becomes active.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondeactivated" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the window becomes inactive</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="WindowManager">
+    <xs:annotation>
+      <xs:documentation>This class can be used with internal windows
+        to provide more features.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WindowManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWindowManager" substitutionGroup="WindowManager"/>
+
+  <xs:attributeGroup name="WindowManagerAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="component" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The component that the windows are added to</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="activeWindow" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiWindow - The window that is currently active. This might be null
+          if no window is active.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this window manager. If this is set to
+          null then the string bundle for
+          application is used.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onactivation" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>The window manager has become activated. E.g. one of its windows is activated.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ondeactivation" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>The window manager is deactivated. You have left it and can no longer
+          manipulate its windows via keyboard shortcuts etc..
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Wizard">
+    <xs:annotation>
+      <xs:documentation>This component creates a dialog that contains a BiWizardPane.
+        The wizard pane provides buttons for navigating back and forth and finishing
+        and canceling the wizard.
+        Any BiComponent may be used as a page.
+        Use addPage to add pages to the wizard. The pages dispatch
+        activated and deactivated when the active page
+        changes. You can also use the change event to get notifications
+        about when the user changes the active page.
+        Most of the methods and properties provided by the BiWizardPane
+        are also available on the wizard dialog.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WizardAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWizard" substitutionGroup="Wizard"/>
+
+  <xs:attributeGroup name="WizardAttributes">
+
+    <xs:attributeGroup ref="DialogAttributes"/>
+
+    <xs:attribute name="selectedIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the selected page. If no page is selected this
+          returns -1.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedPage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The currently selected page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="backdropImage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiImage - The image used as the backdrop on the left side of the wizard pane.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this wizard dialog. For keys to use in the string
+          bundle seeBiWizardPane.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onback" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedPage changes to the previous page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onnext" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedPage changes to the next page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedPage page changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforechange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the selectedPage page changes. Call
+          preventDefault
+          on the event object to prevent the wizard to change the page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforeback" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the selectedPage changes to the previous page. Call
+          preventDefault
+          on the event object to prevent the wizard to change the page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforenext" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the selectedPage changes to the next page. Call
+          preventDefault
+          on the event object to prevent the wizard to change the page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforefinish" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the the wizard's finish event is called. Calling
+          preventDefault
+          on the event object will prevent the wizard from dispatching the finish event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforecancel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the the wizard's cancel event is called. Calling
+          preventDefault
+          on the event object will prevent the wizard from dispatching the cancel event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfinish" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is dispatched when the user clicks
+          the finish button.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncancel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is dispatched when the user clicks
+          the cancel button.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="WizardPane">
+    <xs:annotation>
+      <xs:documentation>This component creates a wizard that can contain 1 or more pages. The
+        wizard pane provides buttons for navigating back and forth and finishing
+        and canceling the wizard.
+        Any BiComponent may be used as a page.
+        Use addPage to add pages to the wizard. The pages dispatch
+        activated and deactivated when the active page
+        changes. You can also use the change event to get notifications
+        about when the user changes the active page.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WizardPaneAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWizardPane" substitutionGroup="WizardPane"/>
+
+  <xs:attributeGroup name="WizardPaneAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="selectedIndex" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The index of the selected page. If no page is selected this
+          returns -1.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="selectedPage" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiComponent - The currently selected page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="stringBundle" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiStringBundle - The string bundle to use for this wizard pane. If this is set to
+          null then the string bundle for
+          application is used.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onback" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedPage changes to the previous page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onnext" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedPage changes to the next page.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the selectedPage page changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforechange" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the selectedPage page changes. Call
+          preventDefault
+          on the event object to prevent the wizard pane to change the page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforeback" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the selectedPage changes to the previous page. Call
+          preventDefault
+          on the event object to prevent the wizard pane to change the page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforenext" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the selectedPage changes to the next page. Call
+          preventDefault
+          on the event object to prevent the wizard pane to change the page.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforefinish" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the the wizard pane's finish event is called. Calling
+          preventDefault
+          on the event object will prevent the wizard pane from dispatching the finish event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onbeforecancel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires before the the wizard pane's cancel event is called. Calling
+          preventDefault
+          on the event object will prevent the wizard pane from dispatching the cancel event.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onfinish" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is dispatched when the user clicks
+          the finish button.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncancel" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is dispatched when the user clicks
+          the cancel button.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="VmlLabel">
+    <xs:annotation>
+      <xs:documentation>This class is used internally inside aBiGraph for labels.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="VmlLabelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiVmlLabel" substitutionGroup="VmlLabel"/>
+
+  <xs:attributeGroup name="VmlLabelAttributes">
+
+    <xs:attributeGroup ref="ComponentAttributes"/>
+
+    <xs:attribute name="align" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text align of the the text on the label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="text" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The text to show on the label</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="fontSize" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Number - The font size in pixels</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="WsCallCompleteEvent">
+    <xs:annotation>
+      <xs:documentation>BiWsCallCompleteEvent -- notifies of an asynchronous call completion.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WsCallCompleteEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiWsCallCompleteEvent" substitutionGroup="WsCallCompleteEvent"/>
+
+  <xs:attributeGroup name="WsCallCompleteEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlDataColumn">
+    <xs:annotation>
+      <xs:documentation>This class is used for the columns in aBiXmlDataSet.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlDataColumnAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlDataColumn" substitutionGroup="XmlDataColumn"/>
+
+  <xs:attributeGroup name="XmlDataColumnAttributes">
+
+    <xs:attributeGroup ref="DataColumnAttributes"/>
+
+    <xs:attribute name="xsType" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The XML Schema type used for the column</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlDataRow">
+    <xs:annotation>
+      <xs:documentation>This class is used for the rows in aBiXmlDataSet.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlDataRowAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlDataRow" substitutionGroup="XmlDataRow"/>
+
+  <xs:attributeGroup name="XmlDataRowAttributes">
+
+    <xs:attributeGroup ref="DataRowAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlDataSet">
+    <xs:annotation>
+      <xs:documentation>This class maps an xml file outputted from an ADO.NET DataSet to aBiDataSet.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlDataSetAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlDataSet" substitutionGroup="XmlDataSet"/>
+
+  <xs:attributeGroup name="XmlDataSetAttributes">
+
+    <xs:attributeGroup ref="DataSetAttributes"/>
+
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - This property can be used to load an external XML document and use that as
+          the source for the XML data set
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rootNode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Node - The root XML node used to define the data set. This is either aBiXmlDocument
+          or an XML element.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="ondataready" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is dispatched when the data set uses external
+          data and the data has been loaded.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlDataTable">
+    <xs:annotation>
+      <xs:documentation>This class is used for the tables in aBiXmlDataSet.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlDataTableAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlDataTable" substitutionGroup="XmlDataTable"/>
+
+  <xs:attributeGroup name="XmlDataTableAttributes">
+
+    <xs:attributeGroup ref="DataTableAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlDocument">
+    <xs:annotation>
+      <xs:documentation>This is a factory class to the Microsoft
+        DOMDocument
+        object. Creating aBiXmlDocument actually creates and returns a DOMDocument.
+        For Mozilla this returns a new XMLDocument (as defined by the W3C DOM). For
+        Mozilla we also extend the DOM Node interfaces to make it more compatible
+        with MSXML.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlDocumentAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlDocument" substitutionGroup="XmlDocument"/>
+
+  <xs:attributeGroup name="XmlDocumentAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlHttp">
+    <xs:annotation>
+      <xs:documentation>This is a factory class to the Microsoft
+        IXMLHTTPRequest
+        object. Creating aBiXmlHttp actually creates and returns an IXMLHTTPRequest.
+        For Mozilla this creates XMLHttpRequest, which happen
+        to implement the IXMLHTTPRequest interface.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlHttpAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlHttp" substitutionGroup="XmlHttp"/>
+
+  <xs:attributeGroup name="XmlHttpAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlLoader">
+    <xs:annotation>
+      <xs:documentation>Loads an XML document from the server or the local file system. (The
+        local file system can only be accessed when using a local application.)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlLoaderAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlLoader" substitutionGroup="XmlLoader"/>
+
+  <xs:attributeGroup name="XmlLoaderAttributes">
+
+    <xs:attributeGroup ref="TextLoaderAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlResourceParser">
+    <xs:annotation>
+      <xs:documentation>This class deserializes an XML document to a Bindows object hierarchy.
+        This is mostly tailored for BiComponent
+        hierarchies but can be used for any class extending BiObject.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlResourceParserAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlResourceParser" substitutionGroup="XmlResourceParser"/>
+
+  <xs:attributeGroup name="XmlResourceParserAttributes">
+
+    <xs:attributeGroup ref="XmlLoaderAttributes"/>
+
+    <xs:attribute name="autoNameMapping" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - When this is true any XML object that has an id attribute will create a
+          global reference (with the same name as the id value) to the object created
+          from this XML element.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="rootNode" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Node - The XML element that describes the root of the object hierarchy.
+          Only set this before you actually use the parser.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlRpc">
+    <xs:annotation>
+      <xs:documentation>This is a class that implements an XML-RPC client. The XML-RPC
+        specifcation can be found at http://www.xmlrpc.com/spec.
+        For more info and XML-RPC server implementations see
+        http://www.xmlrpc.com/.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlRpcAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlRpc" substitutionGroup="XmlRpc"/>
+
+  <xs:attributeGroup name="XmlRpcAttributes">
+
+    <xs:attributeGroup ref="EventTargetAttributes"/>
+
+    <xs:attribute name="uri" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type: BiUri - The URI where to find the remote procedure</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="async" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:Boolean - Whether to use asynchronous method call. If this is true then
+          the call to callMethod returns instantly. When using
+          asynchronous calling use the result event for the call back
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="user" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The user name to pass to the server when calling the remote procedure</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="password" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Type:String - The password to pass to the server when calling the remote procedure</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onload" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a method call
+          response is received from the server.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncallcomplete" type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when
+          a method call is complete.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlRpcCallCompleteEvent">
+    <xs:annotation>
+      <xs:documentation>This event is used when a call to an XML-RPC server is completed
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlRpcCallCompleteEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlRpcCallCompleteEvent" substitutionGroup="XmlRpcCallCompleteEvent"/>
+
+  <xs:attributeGroup name="XmlRpcCallCompleteEventAttributes">
+
+    <xs:attributeGroup ref="EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlRpcDouble">
+    <xs:annotation>
+      <xs:documentation>This class is useful when working withBiXmlRpc whenever a double is required
+        but you don't know whether the number is an integer or not
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlRpcDoubleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlRpcDouble" substitutionGroup="XmlRpcDouble"/>
+
+  <xs:attributeGroup name="XmlRpcDoubleAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlRpcError">
+    <xs:annotation>
+      <xs:documentation>This class is used when an error happens either at the server or due to an
+        invalid response from the server. Errors of this type are thrown byBiXmlRpc
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlRpcErrorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlRpcError" substitutionGroup="XmlRpcError"/>
+
+  <xs:attributeGroup name="XmlRpcErrorAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XmlRpcInt">
+    <xs:annotation>
+      <xs:documentation>This class is useful when working withBiXmlRpc whenever an int is required
+        but you don't know whether the number is an integer or not
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XmlRpcIntAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXmlRpcInt" substitutionGroup="XmlRpcInt"/>
+
+  <xs:attributeGroup name="XmlRpcIntAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="XsTypeConverter">
+    <xs:annotation>
+      <xs:documentation>This class contains static methods that converts XML Schema types to Javascript
+        types as well as converting strings formatted according to the XML Schema
+        to Javascript values.
+        The following type relations are used
+
+        XS type name - JS type name - JS class
+        "negativeInteger" - "number" - Number
+        "unsignedShort" - "number" - Number
+        "unsignedByte" - "number" - Number
+        "unsignedLong" - "number" - Number
+        "unsignedInt" - "number" - Number
+        "decimal" - "number" - Number
+        "boolean" - "number" - Number
+        "integer" - "number" - Number
+        "double" - "number" - Number
+        "float" - "number" - Number
+        "short" - "number" - Number
+        "byte" - "number" - Number
+        "long" - "number" - Number
+        "int" - "number" - Number
+        "QName" - "string" - String
+        "string" - "string" - String
+        "normalizedString" - "string" - String
+        "dateTime" - "date" - Date
+        "date" - "date" - Date
+        "time" - "date" - Date
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="BindowsComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="XsTypeConverterAttributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="BiXsTypeConverter" substitutionGroup="XsTypeConverter"/>
+
+  <xs:attributeGroup name="XsTypeConverterAttributes">
+
+    <xs:attributeGroup ref="ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+
+  <xs:group name="BindowsComponentsGroup">
+    <xs:choice>
+      <!--<xs:group ref="iv:InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>-->
+      <xs:group ref="iv:ElementsAllowedExternally" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DrawLine" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridRow" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridChartRow" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeNode" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="AnimationRange" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Area" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="AreaCollection" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Base64" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Border" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartCategory" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartPoint" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartPresentation" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartPresentationManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartSeries" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DataColumn" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlDataColumn" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DataRow" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlDataRow" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DataTable" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlDataTable" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DateFormat" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DateFormatSymbols" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DrawAnchor" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="CssLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ImageLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ObjectLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Script" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ScriptLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SerializedLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Style" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TextLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="JsonLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="L10nLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlResourceParser" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="AttachedComponentModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InlineEditModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Command" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Component" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ColumnChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="BarChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PercentageStackedColumnChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PercentageStackedBarChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StackedColumnChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StackedBarChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="LineChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PieChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ColumnChart2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="BarChart2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PercentageStackedColumnChart2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PercentageStackedBarChart2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StackedColumnChart2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StackedBarChart2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ColumnChartSection" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="LineMarker" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PieChartSection" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ColumnChartSection2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Grid" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridChart" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Tree" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="AccordionPage" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="AccordionPane" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Box" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="HBox" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="VBox" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Calendar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartAreaBase" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartArea" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartArea2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartCategoryAxisBase" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartCategoryAxis" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartCategoryAxis2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartGridLinesBase" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartGridLines" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartGridLines2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartLegend" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartValueAxisBase" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartValueAxis" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartValueAxis2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ComboBox" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DatePicker" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DesktopPane" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DockPanel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="FlowPanel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2Component" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2CircularBorder" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2ImageBorder" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RectangularBorder" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2BasicCap" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2LinearGradientFiller" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RadialGradientFiller" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RingGradientFiller" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2PlainColorFiller" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2LinearRange" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RadialRange" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2LinearScale" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RadialScaleSection" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2LinearTicks" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RadialTicks" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2LinearNeedle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2RadialNeedle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2Group" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugeLabels" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugeMajorTicks" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugeMinorTicks" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugeNeedle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugePlate" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugeSection" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GraphBase" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Graph" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Graph2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GraphContentArea" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridHeaders" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridPanel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridPanel2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridRowHeaders" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GroupBox" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Iframe" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PrintFrame" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="RichEdit" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Image" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InlineComponent" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="IpField" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Label" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Button" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="AccordionButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="RepeatButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ChartLegendLabel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="CheckBox" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Gauge2Label" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GaugeTitle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridHeader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridHeaderCorner" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridHeaderFiller" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GroupBoxTitle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ListItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ComboBoxItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Popup" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolTip" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="RadioButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StatusBarPanel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarMenuButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarSplitMenuButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarToggleButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarRadioButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TabButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarSplitToggleMenuButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewDragHeader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="LinkManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="List" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="MenuBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="MoveHandle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridDropMarker" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OptionPane" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ProgressBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="UndeterminedProgressBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ResizeHandle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridResizeOutline" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewResizeOutline" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ScrollBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Slider" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Spinner" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SplitPane" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StatusBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TabPage" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TabPane" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TextField" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PasswordField" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TextArea" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TimePicker" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TabBar" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolBarSeparator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewBase" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGrid" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeView" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Grid2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SingleTree" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Tree2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewDragHeaderMarker" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="VmlLabel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Window" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Dialog" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ColorPicker" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Wizard" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="WizardPane" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ComponentAnimation" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="LocationAnimator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OpacityAnimator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SizeAnimator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DataSet" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlDataSet" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="FpsGenerator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ImageMap" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ImageMapArea" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ImagePreloader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Link" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Menu" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="MenuItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="CheckBoxMenuItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="MenuButton" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="MenuSeparator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="RadioButtonMenuItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridDataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridStateManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="RadioGroup" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="RangeModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ResourceLoader" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ScriptLoaderQueue" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="CalendarSelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridSelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ListSelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridSelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeSelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewSelectionModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StringBundle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TextParser" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ThemeManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Timer" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewDataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DataSetDataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Grid2DataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridDataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeDataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SingleTreeDataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Tree2DataModel" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewStateManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="WebService2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="WindowManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlRpc" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Font" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Grid2Cell" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Grid2Row" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridCell" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridChartCell" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridColumn" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridPanel2Cell" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GridPanel2Row" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="HashTable" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Json" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Line" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="LoadManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Math" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridCellInfo" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OlapGridViewManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="OrderedIterator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Point" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PopupManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SelectionItemCollection" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Set" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Shape" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Circle" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Polygon" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SingleTreeNode" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Sort" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="StringBuffer" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Subtree" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Theme" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TimerManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ToolTipManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Tree2Cell" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Tree2Row" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeHelper" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeIterator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeIteratorStackItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeNode2" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewCellInfo" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewSelectionModelItem" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="TreeViewViewManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Grid2ViewManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="SingleTreeViewManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Tree2ViewManager" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="Uri" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XsTypeConverter" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="WebService" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlDocument" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlHttp" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlRpcError" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlRpcDouble" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="XmlRpcInt" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="L10nString" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:choice>
+  </xs:group>
+
+</xs:schema>
+
+
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation19_2.xsd b/xml/tests/testData/xml/ComplexSchemaValidation19_2.xsd
new file mode 100644
index 0000000..b3fd4ea
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation19_2.xsd
@@ -0,0 +1,4368 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           targetNamespace="http://www.infiview.net/infiview"
+           xmlns="http://www.infiview.net/infiview"
+           xmlns:bi="http://www.bindows.net/IVBindowsSchema"
+           elementFormDefault="qualified">
+
+  <xs:import namespace="http://www.bindows.net/IVBindowsSchema"
+             schemaLocation="ComplexSchemaValidation19.xsd"/>
+
+  <xs:group name="ElementsAllowedExternally">
+    <xs:choice>
+      <xs:element ref="ViewportNavigator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="ComponentViewport" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="GraphViewport" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InteractiveGraphViewport" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="DynamicViewportNavigator" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="InfiViewViewport" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="LayerPane" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="PerspectiveTitle" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:attributeGroup name="VGComponentAttributes"></xs:attributeGroup>
+
+  <xs:element name="DefaultSelectionDefinition">
+    <xs:complexType>
+      <xs:choice>
+        <xs:element ref="Selection2"/>
+        <xs:element ref="Selection"/>
+        <xs:element ref="VGSelection"/>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="Layout">
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="AbstractDataContainer">
+    <xs:annotation>
+      <xs:documentation>
+        Abstract data container class
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractDataContainerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="AbstractDataContainerAttributes">
+
+    <xs:attributeGroup ref="ViewportRectangleAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGroupNode">
+    <xs:annotation>
+      <xs:documentation>
+        This class represent a special grouping data container.
+        The member area of the group is the area where members are placed.
+        Use the addMember method for adding data containers to a group.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGroupNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="AbstractGroupNodeAttributes">
+
+    <xs:attributeGroup ref="InfiViewNodeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractGroupNodeType">
+    <xs:annotation>
+      <xs:documentation>
+        infiview.AbstractGroupNodeType acts as a template for nodes that have grouping features.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractGroupNodeTypeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="AbstractGroupNodeTypeAttributes">
+
+    <xs:attributeGroup ref="NodeTypeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractNode">
+    <xs:annotation>
+      <xs:documentation>
+        Abstract data container class
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="AbstractNodeAttributes">
+
+    <xs:attributeGroup ref="ViewportRectangleAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractNodeRepAdapter">
+    <xs:annotation>
+      <xs:documentation>
+        The abstract node representation adapter.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractNodeRepAdapterAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="AbstractNodeRepAdapterAttributes">
+
+    <xs:attributeGroup ref="bi:EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractSelection">
+    <xs:annotation>
+      <xs:documentation>
+        Adds a selection wireframe around multiple nodes that can then be dragged with the mouse.
+        Nodes can be added to and removed from the selection as needed.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractSelectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="AbstractSelectionAttributes">
+
+    <xs:attributeGroup ref="bi:EventTargetAttributes"/>
+
+    <xs:attribute name="nodes"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          Array Nodes inside the selection
+          -
+          Nodes inside the selection.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="parent"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          BiComponent
+          -
+          Sets the surface area in which the selection is allowed to operate.
+          This method can be overidden if more than one component is used.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="moveDirection"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          String
+          -
+          Limits movement in various direction.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.Event Fired when nodes are added to and removed from the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmovestart"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.Event Fired when user starts dragging the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmoveend"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.Event Fired when user has finished dragging the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractUndoRedoCommand">
+    <xs:annotation>
+      <xs:documentation>
+        This is the base class of all undo redo commands.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractUndoRedoCommandAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="AbstractUndoRedoCommandAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractViewport">
+    <xs:annotation>
+      <xs:documentation>
+        The abstract representation of the viewport collects methods giving
+        a consistent interface for building custom viewports.
+
+        The viewport is a component which makes it possible to write
+        applications with practically infinite surfaces containing a
+        tremendous amount of information which should be swapped in and out
+        from either an internal lightweight information structure or server
+        side information.
+
+        The abstract viewport adds a resize and a
+        mousewheel event listener in its constructor. The resize event is
+        coupled to the resizeVisibleArea method of the given data model and
+        the mousewheel event scrolls the viewport vertically by 50 pixels.
+        This behavior can be overriden by overriding the onMouseWheel method.
+
+
+        The default render margin is zero in both directions.
+
+        setScrollLeft and setScrollTop are overridden to empty functions to
+        avoid auto-scrolling problems when using drag-and-drop.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="AbstractViewportAttributes">
+
+    <xs:attributeGroup ref="bi:ComponentAttributes"/>
+
+    <xs:attribute name="zoomable"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          boolean
+          -
+          Zoomable viewport or not
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AbstractViewportModel">
+    <xs:annotation>
+      <xs:documentation>
+        This is the is the foundation for all viewport data models which are
+        used to manage the information on which infiview.AbstractViewport
+        descendants are dependent on. The data model should store either
+        lightweight information about components or manage communication
+        with information on a server.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AbstractViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="AbstractViewportModelAttributes">
+
+    <xs:attributeGroup ref="bi:EventTargetAttributes"/>
+
+    <xs:attribute name="onzoomchange"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Dispatched when the zoom level changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="oncenterview"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Dispatched when the view is centered.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Actions">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.Actions acts as a manager for InfiView actions.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ActionsAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ActionsAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="AnchorPoints">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="AnchorPointsAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="AnchorPointsAttributes">
+
+    <xs:attributeGroup ref="bi:ComponentAttributes"/>
+
+    <xs:attribute name="anchors"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="colorMap"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="BalloonTreeLayout">
+    <xs:annotation>
+      <xs:documentation>
+        In this class a ballon tree layout algorithm is implemented
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BalloonTreeLayoutAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="BalloonTreeLayoutAttributes">
+
+    <xs:attributeGroup ref="bi:EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="BiconnectedComponentLayout">
+    <xs:annotation>
+      <xs:documentation>
+        A layout for general graphs that exhibits cluster structure. The
+        graph (which is assumed to be connected) is subdivided in its
+        bicomponents, and the vertices of each bicomponent are laid out on
+        a circle. The bicomponents (which together with the cutpoints form
+        a tree) are then laid out using the wedge tree layout algorithm.
+
+        With this layout it is easy to visually identify the clusters
+        (bicomponents) and cutpoints.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BiconnectedComponentLayoutAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="BiconnectedComponentLayoutAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="BiconnectedComponentLayout.BiconnectedComponent">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BiconnectedComponentLayout.BiconnectedComponentAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="BiconnectedComponentLayout.BiconnectedComponentAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="BiconnectedComponentLayout.BlockCutpointVertex">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BiconnectedComponentLayout.BlockCutpointVertexAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="BiconnectedComponentLayout.BlockCutpointVertexAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="BiconnectedComponentLayout.Cutpoint">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="BiconnectedComponentLayout.CutpointAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="BiconnectedComponentLayout.CutpointAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComponentConstructor">
+    <xs:annotation>
+      <xs:documentation>
+        NodeRepAdapter contructor holder
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentConstructorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ComponentConstructorAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComponentDataContainer">
+    <xs:annotation>
+      <xs:documentation>
+        Wrapper class for objects inserted into a infiview.GraphViewportDatamodel
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentDataContainerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ComponentDataContainerAttributes">
+
+    <xs:attributeGroup ref="AbstractDataContainerAttributes"/>
+
+    <xs:attribute name="visible"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="data"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          Object
+          -
+          Set the data of this container.
+          The properties that are given in the "persistentDataMap" property are saved int the container.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComponentNode">
+    <xs:annotation>
+      <xs:documentation>
+        The ComponentNode class represent a BiComponent based node.
+        Observe that an instance of this class could reside in other models than infiview.ComponentViewportModel
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ComponentNodeAttributes">
+
+    <xs:attributeGroup ref="AbstractNodeAttributes"/>
+
+    <xs:attribute name="componentConstructors"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          infiview.ComponentConstructor[]
+          -
+          Sets the array of constructors to use for this node.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="component"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          Set the component of this node, it will be wrapped by a ComponentNodeRepAdapter.
+          The properties that are given in the "persistentDataMap" property are saved int the container.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmove"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.MoveEvent When the node is moved.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onresize"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.MoveEvent When the node is resized.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComponentNodeRepAdapter">
+    <xs:annotation>
+      <xs:documentation>
+        infiview.ComponentNodeRepAdapter represents a NodeRepAdapter containing a zoomable and resizable component.
+        This class is used together with ComponentNode.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentNodeRepAdapterAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ComponentNodeRepAdapterAttributes">
+
+    <xs:attributeGroup ref="AbstractNodeRepAdapterAttributes"/>
+
+    <xs:attribute name="component"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComponentViewport">
+    <xs:annotation>
+      <xs:documentation>
+        Implemented viewport for handling components. It is used together
+        with a infiview.ComponentViewportModel.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ComponentViewportAttributes">
+
+    <xs:attributeGroup ref="ZoomableViewportAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ComponentViewportModel">
+    <xs:annotation>
+      <xs:documentation>
+        Model intended for keeping externally added components.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ComponentViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ComponentViewportModelAttributes">
+
+    <xs:attributeGroup ref="ZoomableViewportModelAttributes"/>
+
+    <xs:attribute name="rTreeEnabled"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          boolean
+          -
+          The rTree, see infiview.RTree for mor information.
+          @Type infiview.RTree
+
+
+          Whether the RTree is used for storing nodes. Storing nodes in an RTree
+          allows for finding nodes inside a certain area qucikly, while it slows down
+          insert and remove operations.
+
+          When inserting many nodes (>100) it is often faster to first disable
+          the rtree, then enable it again. This is because it is alot faster
+          to create an rtree out of many nodes than to insert nodes one by one.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ContextMenu">
+    <xs:annotation>
+      <xs:documentation>
+        This class represents an InfiView context menu.
+        It takes MenuItems as children.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ContextMenuAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ContextMenuAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+    <xs:attribute name="upActions"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          infiview.InfiView
+          -
+          Binds the menu items to infiview actions.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ContextMenus">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.ContextMenus represent a set of available context menus.
+
+        TODO: Explain the purpose of this class.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ContextMenusAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ContextMenusAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="CornerStitchArea">
+    <xs:annotation>
+      <xs:documentation>
+        TODO: Document class.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="CornerStitchAreaAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="CornerStitchAreaAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+    <xs:attribute name="solid"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DefaultSymbol">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DefaultSymbolAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="DefaultSymbolAttributes">
+
+    <xs:attributeGroup ref="VGSymbolAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DiamondSymbol">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DiamondSymbolAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="DiamondSymbolAttributes">
+
+    <xs:attributeGroup ref="DefaultSymbolAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DocSymbol">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DocSymbolAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="DocSymbolAttributes">
+
+    <xs:attributeGroup ref="DefaultSymbolAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DoubleZoomFactorModel">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DoubleZoomFactorModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="DoubleZoomFactorModelAttributes">
+
+    <xs:attributeGroup ref="ZoomFactorModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DrawAnchor">
+    <xs:annotation>
+      <xs:documentation>
+        This class defines static properties that represent the anchoring locations for edge lines.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DrawAnchorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="DrawAnchorAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DynamicPreviewViewportNavigator">
+    <xs:annotation>
+      <xs:documentation>
+        This class is specialized navigator that loads images as preview background.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DynamicPreviewViewportNavigatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="DynamicPreviewViewportNavigatorAttributes">
+
+    <xs:attributeGroup ref="ViewportNavigatorAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="DynamicViewportNavigator">
+    <xs:annotation>
+      <xs:documentation>
+        Dynamic Viewport Navigator updates when connected viewport is updated.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="DynamicViewportNavigatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="DynamicViewportNavigatorAttributes">
+
+    <xs:attributeGroup ref="ViewportNavigatorAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Edge">
+    <xs:annotation>
+      <xs:documentation>
+        This class represents the relationship between two components that are to be edgeed by a edge line.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EdgeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="EdgeAttributes">
+
+    <xs:attributeGroup ref="bi:EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="EdgeContainer">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EdgeContainerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="EdgeContainerAttributes">
+
+    <xs:attributeGroup ref="bi:EventTargetAttributes"/>
+
+    <xs:attribute name="labelNode"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          Sets a label node on the edge.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="edge"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="visible"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="EdgeManager">
+    <xs:annotation>
+      <xs:documentation>
+        This class is a component that holds edgeed components. It also manages the edges involved with these components.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EdgeManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="EdgeManagerAttributes">
+
+    <xs:attributeGroup ref="bi:ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="EdgeType">
+    <xs:annotation>
+      <xs:documentation>
+        infiview.EdgeType acts as a template for edges.
+        It holds properties usied by infiview.InfiView when creating an
+        edge of a specific edge type.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EdgeTypeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="EdgeTypeAttributes">
+
+    <xs:attributeGroup ref="InfiViewTypeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="EdgeTypes">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.EdgeTypes acts as a manager for the edge types.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EdgeTypesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="EdgeTypesAttributes">
+
+    <xs:attributeGroup ref="TypeTableAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="EllipseSymbol">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EllipseSymbolAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="EllipseSymbolAttributes">
+
+    <xs:attributeGroup ref="DefaultSymbolAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="EventListener">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.EventListener is used by infiview.InfiView.
+        This class is the holder of a event l├нstener. Used by property forms.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EventListenerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="EventListenerAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="EventListeners">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.EventListeners is used by infiview.InfiView.
+        Holder of a list of infiview.EventListener.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="EventListenersAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="EventListenersAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ExpandCollapseImage">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ExpandCollapseImageAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ExpandCollapseImageAttributes">
+
+    <xs:attributeGroup ref="VGImageAttributes"/>
+
+    <xs:attribute name="expandedUri"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="expanded"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GoogleMapsNode">
+    <xs:annotation>
+      <xs:documentation>
+        infiview.GoogleMapsNode is the light weight representation of an node residing
+        in a InfiView using infiview.GoogleMapsViewport.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GoogleMapsNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GoogleMapsNodeAttributes">
+
+    <xs:attributeGroup ref="InfiViewNodeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GoogleMapsNodeRepAdapter">
+    <xs:annotation>
+      <xs:documentation>
+        The holds the representation of a node residing inside a google maps based graph.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GoogleMapsNodeRepAdapterAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GoogleMapsNodeRepAdapterAttributes">
+
+    <xs:attributeGroup ref="InfiViewNodeRepAdapterAttributes"/>
+
+    <xs:attribute name="left"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="top"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GoogleMapsNodeType">
+    <xs:annotation>
+      <xs:documentation>
+        infiview.GoogleMapsNodeType acts as a template for nodes that are used together with the GoogleMapsViewport
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GoogleMapsNodeTypeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GoogleMapsNodeTypeAttributes">
+
+    <xs:attributeGroup ref="NodeTypeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GoogleMapsViewport">
+    <xs:annotation>
+      <xs:documentation>
+        This viewport is specilized for InfiView application that uses google maps.
+        The method is used setUpGoogleMaps for setting up the Google Maps API together with this viewport.
+        The GMap2 class is used internally.
+        To make sure that the viewport works correctly a "glass pane" must be placed in front of the container component.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GoogleMapsViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GoogleMapsViewportAttributes">
+
+    <xs:attributeGroup ref="InfiViewViewportAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GradientEdgeType">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GradientEdgeTypeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GradientEdgeTypeAttributes">
+
+    <xs:attributeGroup ref="EdgeTypeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GraphDataContainer">
+    <xs:annotation>
+      <xs:documentation>
+        Wrapper class for objects inserted into a infiview.GraphViewportDatamodel
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GraphDataContainerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GraphDataContainerAttributes">
+
+    <xs:attributeGroup ref="ComponentDataContainerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GraphNode">
+    <xs:annotation>
+      <xs:documentation>
+        Wrapper class for objects inserted into a infiview.GraphViewportDatamodel
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GraphNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GraphNodeAttributes">
+
+    <xs:attributeGroup ref="ComponentNodeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GraphViewport">
+    <xs:annotation>
+      <xs:documentation>
+        Viewport specialized for containing a edge manager to handle very
+        large graphs.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GraphViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GraphViewportAttributes">
+
+    <xs:attributeGroup ref="ComponentViewportAttributes"/>
+
+    <xs:attribute name="grid"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          infiview.VGGrid
+          -
+          The grid object.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GraphViewportModel">
+    <xs:annotation>
+      <xs:documentation>
+        Specialized model for the infiview.GraphViewport which handles very
+        large graphs.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GraphViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GraphViewportModelAttributes">
+
+    <xs:attributeGroup ref="ComponentViewportModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Grid">
+    <xs:annotation>
+      <xs:documentation>
+        Basic grid class, contains logic and grid related properties.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GridAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GridAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+    <xs:attribute name="color"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="xStep"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="yStep"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="startX"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="startY"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="visible"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          boolean
+          -
+          The component
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GroupNode">
+    <xs:annotation>
+      <xs:documentation>
+        This class represent a special grouping node.
+        The member area of the group is the area where members are placed.
+        Use the addMember method for adding nodes to a group.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GroupNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GroupNodeAttributes">
+
+    <xs:attributeGroup ref="AbstractGroupNodeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="GroupNodeType">
+    <xs:annotation>
+      <xs:documentation>
+        infiview.GroupNodeType acts as a template for nodes that have grouping features.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="GroupNodeTypeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="GroupNodeTypeAttributes">
+
+    <xs:attributeGroup ref="AbstractGroupNodeTypeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImageBasedNode">
+    <xs:annotation>
+      <xs:documentation>
+        Class for showing nodes composed by an images in an infiview viewport.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImageBasedNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ImageBasedNodeAttributes">
+
+    <xs:attributeGroup ref="VGSymbolAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ImageBasedNodeImage">
+    <xs:annotation>
+      <xs:documentation>
+        This class contains one zoomfactor specific image.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ImageBasedNodeImageAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ImageBasedNodeImageAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+    <xs:attribute name="uri"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          BiUri
+          -
+          The location of the image file. If this is set to a string a
+          new URI is created from that string relative to the
+          ADF path.
+          @Returns void
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InfiView">
+    <xs:annotation>
+      <xs:documentation>
+        The InfiView class extends the standard Bindows BiComponent wich means that it can be used in any Bindows ADF
+        and acts as a facade towards the inner InfiView object model, gathering events in form av actions and offering a set of
+        convenient operations for the InfiView programmer.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InfiViewAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InfiViewAttributes">
+
+    <xs:attributeGroup ref="bi:ComponentAttributes"/>
+
+    <xs:attribute name="undoBufferSize"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          Number
+          -
+          Size of the undo/redo buffer. Default is 0 which is the same as turned off.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="activePerspective"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          infiview.Perspective
+          -
+          The resources of this InfiView object.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="activeViewport"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          infiview.InfiViewViewport
+          -
+          An instance of an additional class that will be accessible in every action.
+          Typically the main application object.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="blockedActions"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          Object
+          -
+          Returns blocked actions as a hash (object) with
+          the keys being the name of the blocked actios.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onnewnode"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when the node representation is created for the first time.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onconnection"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a connection between nodes is issued by the user by carrying out a drag drop operation.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onviewportmarqueeselection"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a selection is issued by user by enclosing a set of node using marquee selector.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onnodemove"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a node is moved.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onnoderesize"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a node is resized.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onnodeclick"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a node is clicked.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onnodedoubleclick"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a node double clicked.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onedgeclick"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a edge is clicked</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onedgedoubleclick"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a edge is double clicked.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="ontoolaction"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a tool button is clicked.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onpropertyformlistener"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired when a event listener of a property form is dispatched.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onstart"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This event is fired after the entire InfiView object is loaded.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InfiViewBackEndViewport">
+    <xs:annotation>
+      <xs:documentation>
+        Viewport specialized for InfiView backend applications
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InfiViewBackEndViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InfiViewBackEndViewportAttributes">
+
+    <xs:attributeGroup ref="InfiViewViewportAttributes"/>
+
+    <xs:attribute name="requestHandler"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          infiview.AbstractViewport
+          -
+          The request handler to use for retrieving nodes from back end.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InfiViewBackEndViewportModel">
+    <xs:annotation>
+      <xs:documentation>
+        General back end model using the InfiViewGraph xml format for loading nodes
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InfiViewBackEndViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InfiViewBackEndViewportModelAttributes">
+
+    <xs:attributeGroup ref="InfiViewViewportModelAttributes"/>
+
+    <xs:attribute name="requestHandler"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          infiview.AbstractRequestHandler
+          -
+          The request handler this model is using for retreiving back end data.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="taskInterval"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          number
+          -
+          The interval the task timer should work. The task timer is responssible for adding and deleting nodes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InfiViewComponentDataContainer">
+    <xs:annotation>
+      <xs:documentation>
+        infiview.InfiViewComponentDataContainer is the light weight representation of an node residing
+        in a InfiView.
+        This class can be inherit for adding och changing features of adding and dipsosing visual nodes in a InfiView.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InfiViewComponentDataContainerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InfiViewComponentDataContainerAttributes">
+
+    <xs:attributeGroup ref="InteractiveGraphDataContainerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InfiViewNode">
+    <xs:annotation>
+      <xs:documentation>
+        infiview.InfiViewNode is the light weight representation of an node residing
+        in a InfiView.
+        This class can be inherit for adding och changing features of adding and dipsosing visual nodes in a InfiView.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InfiViewNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InfiViewNodeAttributes">
+
+    <xs:attributeGroup ref="InteractiveGraphNodeAttributes"/>
+
+    <xs:attribute name="decorator"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          The node type of this data node.
+          @Type infiview.NodeType
+
+
+          The node id of this data node.
+          @Type infiview.NodeType
+
+
+          If this node is a member of a group this is the group.
+          @Type infiview.AbstractGroupNode
+
+
+          The decorator of this object (see decorator pattern)
+          @Type infiview.InfiViewNode
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InfiViewNodeRepAdapter">
+    <xs:annotation>
+      <xs:documentation>
+        The InteractiveGraphNodeRepAdapter holds the rpresentation logic of a node residing inside a interactive graph.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InfiViewNodeRepAdapterAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InfiViewNodeRepAdapterAttributes">
+
+    <xs:attributeGroup ref="InteractiveGraphNodeRepAdapterAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InfiViewType">
+    <xs:annotation>
+      <xs:documentation>
+        Basic class for element and edge type classes.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InfiViewTypeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InfiViewTypeAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InfiViewViewport">
+    <xs:annotation>
+      <xs:documentation>
+        Viewport specialized for the InfiView facade.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InfiViewViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InfiViewViewportAttributes">
+
+    <xs:attributeGroup ref="InteractiveGraphViewportAttributes"/>
+
+    <xs:attribute name="infiView"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InfiViewViewportModel">
+    <xs:annotation>
+      <xs:documentation>
+        Specialized model for the infiview.GraphViewport which handles very
+        large graphs.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InfiViewViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InfiViewViewportModelAttributes">
+
+    <xs:attributeGroup ref="InteractiveGraphViewportModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InteractiveGraphDataContainer">
+    <xs:annotation>
+      <xs:documentation>
+        Wrapper class for objects inserted into a infiview.GraphViewportDatamodel
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InteractiveGraphDataContainerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InteractiveGraphDataContainerAttributes">
+
+    <xs:attributeGroup ref="GraphDataContainerAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InteractiveGraphNode">
+    <xs:annotation>
+      <xs:documentation>
+        Wrapper class for objects inserted into a infiview.GraphViewportDatamodel
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InteractiveGraphNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InteractiveGraphNodeAttributes">
+
+    <xs:attributeGroup ref="GraphNodeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InteractiveGraphNodeRepAdapter">
+    <xs:annotation>
+      <xs:documentation>
+        The InteractiveGraphNodeRepAdapter holds the representation logic of a node residing inside a interactive graph.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InteractiveGraphNodeRepAdapterAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InteractiveGraphNodeRepAdapterAttributes">
+
+    <xs:attributeGroup ref="ComponentNodeRepAdapterAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InteractiveGraphViewport">
+    <xs:annotation>
+      <xs:documentation>
+        Viewport specialized for representing different interactive charts.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InteractiveGraphViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InteractiveGraphViewportAttributes">
+
+    <xs:attributeGroup ref="GraphViewportAttributes"/>
+
+    <xs:attribute name="edgeMode"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          boolean
+          -
+          Edge mode enabled / disabled
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="multiSelection"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          Boolean
+
+
+          Turn of or on nultiple selection
+          -
+          If this value is set to true it enables multipe selection of elements
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="selection"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="InteractiveGraphViewportModel">
+    <xs:annotation>
+      <xs:documentation>
+        Specialized model of the infiview.GraphViewport which adds additional features for interactivity.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="InteractiveGraphViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="InteractiveGraphViewportModelAttributes">
+
+    <xs:attributeGroup ref="GraphViewportModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="LayerPane">
+    <xs:annotation>
+      <xs:documentation>
+        A pane with layers of viewports enabling the user to select or move a component on any layer.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LayerPaneAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="LayerPaneAttributes">
+
+    <xs:attributeGroup ref="bi:ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="LineRouterManager">
+    <xs:annotation>
+      <xs:documentation>
+        TODO: Document class.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="LineRouterManagerAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="LineRouterManagerAttributes">
+
+    <xs:attributeGroup ref="bi:ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ListZoomFactorModel">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ListZoomFactorModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ListZoomFactorModelAttributes">
+
+    <xs:attributeGroup ref="ZoomFactorModelAttributes"/>
+
+    <xs:attribute name="factorList"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="currentFactor"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MapViewport">
+    <xs:annotation>
+      <xs:documentation>
+        Viewport specialized for containing images in thr form of tiles.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MapViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="MapViewportAttributes">
+
+    <xs:attributeGroup ref="ZoomableViewportAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MapViewportModel">
+    <xs:annotation>
+      <xs:documentation>
+        This class is a specialized model for tile based map applications.
+        It's a low level implemntation using ComponentNode for representation BUT it doesn't use a RTree therefore
+        the tiles must be in same size for each zoom level.
+        infiview.MapZoomLevelDefinition is used for setting up zoom level logic.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MapViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="MapViewportModelAttributes">
+
+    <xs:attributeGroup ref="ZoomableViewportModelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MapZoomLevelDefinition">
+    <xs:annotation>
+      <xs:documentation>
+        An instance of this class keeps track of a certain zoom level in a InfiView map application.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MapZoomLevelDefinitionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="MapZoomLevelDefinitionAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MarqueeSelector">
+    <xs:annotation>
+      <xs:documentation>
+        This component can be used as a wireframe for selecting components on a drawing area. Add this to the same area and
+        on the mousedown event call startSelection(e) passing the BiMouseEvent object from the mousedown event handler as
+        the parameter e.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MarqueeSelectorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="MarqueeSelectorAttributes">
+
+    <xs:attributeGroup ref="bi:ComponentAttributes"/>
+
+    <xs:attribute name="onselectionprogress"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.SelectionEvent Fires continually during the resizing of the wireframe</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onselectionend"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.SelectionEvent This is fired when the user releases the mouse button to signal
+          that the selection is complete.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onselectionstart"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>This is fired before the selection is starts. To prevent the wireframe
+          from being displayed call
+          preventDefault
+          on the event object.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MinPriorityQueue">
+    <xs:annotation>
+      <xs:documentation>
+        TODO: Document class.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MinPriorityQueueAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="MinPriorityQueueAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="MoveEvent">
+    <xs:annotation>
+      <xs:documentation>
+        This event class is used in the infiview package for handling move events.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="MoveEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="MoveEventAttributes">
+
+    <xs:attributeGroup ref="bi:MoveEventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="NodeAnimation">
+    <xs:annotation>
+      <xs:documentation>
+        This class implements a general node item animation algorithm.
+        This class assumes that the node items are infiview nodes.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="NodeAnimationAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="NodeAnimationAttributes">
+
+    <xs:attributeGroup ref="bi:EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="NodeType">
+    <xs:annotation>
+      <xs:documentation>
+        infiview.NodeType acts as a template for nodes.
+        A infiview.NodeType instance supplies three different parts used for creating and represent a node of this node type - "symbol",
+        "viewport" and "node".
+        The "symbol" describes how this node type is suposed to be represented i.e. a panel.
+        The "viewport" describes how this node type should be represented in a viewport.
+        The "node" describes how a node of this node type should be created.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="NodeTypeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="NodeTypeAttributes">
+
+    <xs:attributeGroup ref="InfiViewTypeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="NodeTypes">
+    <xs:annotation>
+      <xs:documentation>
+        Container for node types.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="NodeTypesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="NodeTypesAttributes">
+
+    <xs:attributeGroup ref="TypeTableAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="NodeTypeViewport">
+    <xs:annotation>
+      <xs:documentation>
+        This class holds logic how to create the viewport representation of the a node type.
+        A node type can contain 1-* instances of this class.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="NodeTypeViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="NodeTypeViewportAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Perspective">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.Perspective is used by infiview.InfiView.
+        This class represents a Perspective.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PerspectiveAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="PerspectiveAttributes">
+
+    <xs:attributeGroup ref="bi:EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Perspectives">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.Perspectives is used by infiview.InfiView.
+        Container of perspectives.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PerspectivesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="PerspectivesAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PerspectiveTitle">
+    <xs:annotation>
+      <xs:documentation>
+        Label holding the perspective title
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PerspectiveTitleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="PerspectiveTitleAttributes">
+
+    <xs:attributeGroup ref="bi:ComponentAttributes"/>
+
+    <xs:attribute name="text"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          String
+          -
+          Sets the perspective title
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PreviewImage">
+    <xs:annotation>
+      <xs:documentation>
+        This class is used for showing images.
+        Supported image types are GIF, JPEG and PNG (including support for 32-bit RGBA).
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PreviewImageAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="PreviewImageAttributes">
+
+    <xs:attributeGroup ref="bi:ImageAttributes"/>
+
+    <xs:attribute name="onload"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the image loads. Note that the image file may be
+          loaded before the constructor finishes and you should not only
+          rely on this event but also use loaded property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onerror"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fires when the image failed to load.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PriorityQueue">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PriorityQueueAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="PriorityQueueAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PriorityQueueNode">
+    <xs:annotation>
+      <xs:documentation>
+        TODO: Document class.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PriorityQueueNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="PriorityQueueNodeAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PropertyForm">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.PropertyForm is used by infiview.InfiView.
+        This class holds information for creating a property form
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PropertyFormAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="PropertyFormAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="PropertyForms">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.PropertyForms is used by infiview.InfiView.
+        This class is a container holding PropertyForm objects.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="PropertyFormsAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="PropertyFormsAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RectSymbol">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RectSymbolAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="RectSymbolAttributes">
+
+    <xs:attributeGroup ref="DefaultSymbolAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ResizeEvent">
+    <xs:annotation>
+      <xs:documentation>
+        This event class is used in the infiview package for handling resize events.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ResizeEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ResizeEventAttributes">
+
+    <xs:attributeGroup ref="bi:ResizeEventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Resources">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.Resources acts as a manager for the resources used by infiview.InfiView
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ResourcesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ResourcesAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RoundRectImageSymbol">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RoundRectImageSymbolAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="RoundRectImageSymbolAttributes">
+
+    <xs:attributeGroup ref="VGSymbolAttributes"/>
+
+    <xs:attribute name="href"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RoundrectSymbol">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RoundrectSymbolAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="RoundrectSymbolAttributes">
+
+    <xs:attributeGroup ref="DefaultSymbolAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="RTree">
+    <xs:annotation>
+      <xs:documentation>
+        R-Tree implementation. The R-tree is a tree designed to make fast
+        searches of rectangular areas.
+
+        Code is based on Guttman, A. "R-Trees: A Dynamic Index Structure for
+        Spatial Searching", ACM 1984.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="RTreeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="RTreeAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Selection">
+    <xs:annotation>
+      <xs:documentation>
+        Adds a selection wireframe around multiple nodes that can then be dragged with the mouse.
+        Nodes can be added to and removed from the selection as needed.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SelectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="SelectionAttributes">
+
+    <xs:attributeGroup ref="AbstractSelectionAttributes"/>
+
+    <xs:attribute name="border"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          BiBorder
+          -
+          Sets the default appearance of the wireframe
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onchange"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.Event Fired when nodes are added to and removed from the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmovestart"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.Event Fired when user starts dragging the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmoveend"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.Event Fired when user has finished dragging the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Selection2">
+    <xs:annotation>
+      <xs:documentation>
+        Adds a selection wireframe around multiple nodes that can then be dragged with the mouse.
+        Nodes can be added to and removed from the selection as needed. This selection is created using
+        4 border components so the internal components can still be clicked.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="Selection2Attributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="Selection2Attributes">
+
+    <xs:attributeGroup ref="SelectionAttributes"/>
+
+    <xs:attribute name="onchange"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.Event Fired when nodes are added to and removed from the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmovestart"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.Event Fired when user starts dragging the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmoveend"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.Event Fired when user has finished dragging the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="SelectionEvent">
+    <xs:annotation>
+      <xs:documentation>
+        The event dispatched by infiview.MarqueeSelector.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="SelectionEventAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="SelectionEventAttributes">
+
+    <xs:attributeGroup ref="bi:EventAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="State">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.State is used by infiview.InfiView.
+        This class represents a state.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StateAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="StateAttributes">
+
+    <xs:attributeGroup ref="bi:EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="States">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.States is used by infiview.InfiView.
+        Container of states.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="StatesAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="StatesAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ToolGroup">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.ToolGroup is used by infiview.InfiView.
+        Container for tools, when tools are layout every group will separated.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolGroupAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ToolGroupAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+    <xs:attribute name="upActions"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          infiview.InfiView
+          -
+          This method binds certains tool components events to infiview actions.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="Tools">
+    <xs:annotation>
+      <xs:documentation>
+        This class is managing the tool groups.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ToolsAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ToolsAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TreeLayout">
+    <xs:annotation>
+      <xs:documentation>
+        Walker's layout algorithm for rooted trees, improved version with
+        linear run-time [1], [2]. The tree is drawn in a top-down,
+        hierarchical manner. The levels are placed on parallel lines with
+        the root at the highest level. Each vertex is positioned above the
+        midpoint of its children, and the children are placed in the
+        order specified in the input and separated by at least a specified
+        minimum distance. The algorithm minimizes the width of the drawing
+        (under the relevant constraints).
+
+        [1] Christoph Buchheim, Michael J├Г┬╝nger and Sebastian Leipert,
+        "Improving Walker's Algorithm to Run in Linear Time". Graph
+        Drawing: 10th International Symposium, Lecture Notes in Computer
+        Science 2528 (2002), pp. 347-364, Springer.
+
+        [2] Christoph Buchheim, Michael J├Г┬╝nger and Sebastian Leipert,
+        "Improving Walker's Algorithm to Run in Linear Time". Technical
+        Report zaik2002-431 (2002), ZAIK, Universit├Г┬дt zu K├Г┬╢ln.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TreeLayoutAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="TreeLayoutAttributes">
+
+    <xs:attributeGroup ref="bi:EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="TypeTable">
+    <xs:annotation>
+      <xs:documentation>
+        The class infiview.TypeTable is used by infiview.InfiView.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="TypeTableAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="TypeTableAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="UndoRedo">
+    <xs:annotation>
+      <xs:documentation>
+        This class is a help class for implementing undo redo mechanisms in an InfiView application.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="UndoRedoAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="UndoRedoAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="UndoRedoAddOrRemoveEdgeCommand">
+    <xs:annotation>
+      <xs:documentation>
+        This class implements undo redo mechanisms for edge adding and removing.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="UndoRedoAddOrRemoveEdgeCommandAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="UndoRedoAddOrRemoveEdgeCommandAttributes">
+
+    <xs:attributeGroup ref="AbstractUndoRedoCommandAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="UndoRedoAddOrRemoveNodeCommand">
+    <xs:annotation>
+      <xs:documentation>
+        This class implements undo redo mechanisms for node adding and removing.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="UndoRedoAddOrRemoveNodeCommandAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="UndoRedoAddOrRemoveNodeCommandAttributes">
+
+    <xs:attributeGroup ref="UndoRedoNodeCommandAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="UndoRedoChangeBoundsCommand">
+    <xs:annotation>
+      <xs:documentation>
+        The node id of the node related to the command.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="UndoRedoChangeBoundsCommandAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="UndoRedoChangeBoundsCommandAttributes">
+
+    <xs:attributeGroup ref="UndoRedoNodeCommandAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="UndoRedoNodeCommand">
+    <xs:annotation>
+      <xs:documentation>
+        This class is the base class for all node undo redo commands.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="UndoRedoNodeCommandAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="UndoRedoNodeCommandAttributes">
+
+    <xs:attributeGroup ref="AbstractUndoRedoCommandAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="WedgeTreeLayout">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="WedgeTreeLayoutAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="WedgeTreeLayoutAttributes">
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="VGGrid">
+    <xs:annotation>
+      <xs:documentation>
+        Vector Grafik based grid
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="VGGridAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="VGGridAttributes">
+
+    <xs:attributeGroup ref="VGComponentAttributes"/>
+
+    <xs:attribute name="color"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="VGGroup">
+    <xs:annotation>
+      <xs:documentation>
+        Vector grafic group object. Use this for composite symbols.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="VGGroupAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="VGGroupAttributes">
+
+    <xs:attributeGroup ref="VGComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="VGImage">
+    <xs:annotation>
+      <xs:documentation>
+        This class represents an Vector Graphic image.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="VGImageAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="VGImageAttributes">
+
+    <xs:attributeGroup ref="VGComponentAttributes"/>
+
+    <xs:attribute name="uri"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          String
+          -
+          Convienience method to set the image uri of this VGImage.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="VGSelection">
+    <xs:annotation>
+      <xs:documentation>
+        Adds a selection wireframe around multiple nodes that can then be dragged with the mouse.
+        Nodes can be added to and removed from the selection as needed.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="VGSelectionAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="VGSelectionAttributes">
+
+    <xs:attributeGroup ref="AbstractSelectionAttributes"/>
+
+    <xs:attribute name="onchange"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when nodes are added to and removed from the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmovestart"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when user starts dragging the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onmoveend"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Fired when user has finished dragging the selection</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="VGSymbol">
+    <xs:annotation>
+      <xs:documentation>
+        General base class for vector graphic symbols.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="VGSymbolAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="VGSymbolAttributes">
+
+    <xs:attributeGroup ref="VGComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ViewportComponentConstructor">
+    <xs:annotation>
+      <xs:documentation>
+        Node constructor holder for InfiViewNode.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ViewportComponentConstructorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ViewportComponentConstructorAttributes">
+
+    <xs:attributeGroup ref="ComponentConstructorAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ViewportMarqueeSelector">
+    <xs:annotation>
+      <xs:documentation>
+        This component can be used as a wireframe for selecting components
+        from a ViewportModel. Add this to the Viewport and on the mousedown
+        event call startSelection(e) passing the infiview.MouseEvent object
+        from the mousedown event handler as the parameter e.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ViewportMarqueeSelectorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ViewportMarqueeSelectorAttributes">
+
+    <xs:attributeGroup ref="MarqueeSelectorAttributes"/>
+
+    <xs:attribute name="onselectionprogress"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.SelectionEvent Fires continually during the resizing of the wireframe</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onselectionend"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.SelectionEvent This is fired when the user releases the mouse button to signal
+          that the selection is complete.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onselectionstart"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>.Event This is fired before the selection is starts. To prevent the
+          wireframe from being displayed call
+          preventDefault
+          on the event object.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ViewportNavigator">
+    <xs:annotation>
+      <xs:documentation>
+        This class implements the basic viewport navigator.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ViewportNavigatorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ViewportNavigatorAttributes">
+
+    <xs:attributeGroup ref="bi:ComponentAttributes"/>
+
+    <xs:attribute name="cursorColor"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          String
+          -
+          Sets the color of the cursor.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ViewportNavigatorCursor">
+    <xs:annotation>
+      <xs:documentation>
+        TODO: Document class.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ViewportNavigatorCursorAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ViewportNavigatorCursorAttributes">
+
+    <xs:attributeGroup ref="bi:ComponentAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ViewportRectangle">
+    <xs:annotation>
+      <xs:documentation>
+        Helping class for describing a bounding rectangle in viewports.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ViewportRectangleAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ViewportRectangleAttributes">
+
+    <xs:attributeGroup ref="bi:EventTargetAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ZoomableButton">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ZoomableButtonAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ZoomableButtonAttributes">
+
+    <xs:attributeGroup ref="bi:ButtonAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ZoomableImage">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ZoomableImageAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ZoomableImageAttributes">
+
+    <xs:attributeGroup ref="bi:ImageAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ZoomableLabel">
+    <xs:annotation>
+      <xs:documentation>
+        This class is a zoomable version of a BiLabel.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ZoomableLabelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ZoomableLabelAttributes">
+
+    <xs:attributeGroup ref="bi:LabelAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ZoomableViewport">
+    <xs:annotation>
+      <xs:documentation>
+        Implemented viewport for handling zoomable components.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ZoomableViewportAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ZoomableViewportAttributes">
+
+    <xs:attributeGroup ref="AbstractViewportAttributes"/>
+
+    <xs:attribute name="zoomFactorDependantNodeRep"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          EDIT_THIS
+          -
+          EDIT_THIS
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ZoomableViewportModel">
+    <xs:annotation>
+      <xs:documentation>
+        infiview.ZoomableViewport is an abstract class representing a model containing zoomable objects.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ZoomableViewportModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ZoomableViewportModelAttributes">
+
+    <xs:attributeGroup ref="AbstractViewportModelAttributes"/>
+
+    <xs:attribute name="nearestZoomFactor"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          Number
+          -
+          Set nearest available zoom factor
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="nearestLowerZoomFactor"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          Number
+          -
+          Set nearest lower available zoom factor
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="zoomFactorModel"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>
+          Type:
+          infiview.ZoomFactorModel
+          -
+          Set the zoom factor model.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onresetzoom"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Dispatched when zoom factor is set to 1.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+    <xs:attribute name="onzoomfactorchange"
+                  type="xs:string">
+      <xs:annotation>
+        <xs:documentation>Dispatched when the zoom level changes.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ZoomDependentGroupNode">
+    <xs:annotation>
+      <xs:documentation>
+        infiview.InfiViewNode is the light weight representation of an node residing
+        in a InfiView using infiview.InfiViewViewport.
+
+        This class can be inherit for adding och changing features of adding and dipsosing visual nodes in a InfiView.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ZoomDependentGroupNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ZoomDependentGroupNodeAttributes">
+
+    <xs:attributeGroup ref="InfiViewNodeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ZoomFactorModel">
+    <xs:annotation>
+      <xs:documentation>
+        EDIT_THIS
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ZoomFactorModelAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ZoomFactorModelAttributes">
+
+    <xs:attributeGroup ref="bi:ObjectAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ZoomGroupNode">
+    <xs:annotation>
+      <xs:documentation>
+        infiview.InfiViewNode is the light weight representation of an node residing
+        in a InfiView using infiview.InfiViewViewport.
+
+        This class can be inherit for adding och changing features of adding and dipsosing visual nodes in a InfiView.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ZoomGroupNodeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ZoomGroupNodeAttributes">
+
+    <xs:attributeGroup ref="AbstractGroupNodeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:element name="ZoomGroupNodeType">
+    <xs:annotation>
+      <xs:documentation>
+        infiview.ZoomGroupNodeType acts as a template for nodes that are zoom factor dependant groups.
+      </xs:documentation>
+    </xs:annotation>
+
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="InfiViewComponentsGroup" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:choice>
+      <xs:attributeGroup ref="ZoomGroupNodeTypeAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:attributeGroup name="ZoomGroupNodeTypeAttributes">
+
+    <xs:attributeGroup ref="AbstractGroupNodeTypeAttributes"/>
+
+
+  </xs:attributeGroup>
+
+  <xs:group name="InfiViewComponentsGroup">
+    <xs:choice>
+      <xs:group ref="bi:BindowsComponentsGroup"/>
+
+      <xs:element ref="AbstractNodeRepAdapter" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ComponentNodeRepAdapter" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="InteractiveGraphNodeRepAdapter" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="InfiViewNodeRepAdapter" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="GoogleMapsNodeRepAdapter" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="AbstractSelection" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="Selection" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="Selection2" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="VGSelection" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="AbstractUndoRedoCommand" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="UndoRedoAddOrRemoveEdgeCommand" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="UndoRedoNodeCommand" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="UndoRedoAddOrRemoveNodeCommand" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="UndoRedoChangeBoundsCommand" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="AbstractViewport" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ZoomableViewport" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ComponentViewport" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="GraphViewport" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="InteractiveGraphViewport" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="InfiViewViewport" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="GoogleMapsViewport" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="InfiViewBackEndViewport" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="MapViewport" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="AbstractViewportModel" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ZoomableViewportModel" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ComponentViewportModel" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="GraphViewportModel" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="InteractiveGraphViewportModel" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="InfiViewViewportModel" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="InfiViewBackEndViewportModel" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="MapViewportModel" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="Actions" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="AnchorPoints" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="BalloonTreeLayout" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="BiconnectedComponentLayout.BiconnectedComponent" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="BiconnectedComponentLayout.BlockCutpointVertex" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="BiconnectedComponentLayout.Cutpoint" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="BiconnectedComponentLayout" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ComponentConstructor" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ViewportComponentConstructor" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ContextMenu" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ContextMenus" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="CornerStitchArea" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="DrawAnchor" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="Edge" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="EdgeContainer" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="EdgeManager" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="EventListener" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="EventListeners" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="Grid" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ImageBasedNodeImage" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="InfiViewType" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="EdgeType" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="GradientEdgeType" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="NodeType" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="AbstractGroupNodeType" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="GroupNodeType" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ZoomGroupNodeType" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="GoogleMapsNodeType" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="LayerPane" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="LineRouterManager" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="MapZoomLevelDefinition" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="MarqueeSelector" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ViewportMarqueeSelector" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="MinPriorityQueue" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="MoveEvent" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="NodeAnimation" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="NodeTypeViewport" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="Perspective" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="Perspectives" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="PerspectiveTitle" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="PreviewImage" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="PriorityQueue" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="PriorityQueueNode" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="PropertyForm" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="PropertyForms" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ResizeEvent" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="Resources" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="RTree" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="SelectionEvent" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="State" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="States" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ToolGroup" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="Tools" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="TreeLayout" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="TypeTable" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="EdgeTypes" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="NodeTypes" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="UndoRedo" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="VGGrid" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="VGGroup" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="VGImage" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ExpandCollapseImage" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="VGSymbol" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="DefaultSymbol" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="DiamondSymbol" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="DocSymbol" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="EllipseSymbol" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="RectSymbol" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="RoundrectSymbol" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ImageBasedNode" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="RoundRectImageSymbol" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ViewportNavigator" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="DynamicPreviewViewportNavigator" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="DynamicViewportNavigator" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ViewportNavigatorCursor" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ViewportRectangle" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="AbstractDataContainer" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ComponentDataContainer" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="GraphDataContainer" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="InteractiveGraphDataContainer" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="InfiViewComponentDataContainer" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="AbstractNode" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ComponentNode" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="GraphNode" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="InteractiveGraphNode" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="InfiViewNode" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="AbstractGroupNode" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="GroupNode" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ZoomGroupNode" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="GoogleMapsNode" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ZoomDependentGroupNode" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="WedgeTreeLayout" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ZoomableButton" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ZoomableImage" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ZoomableLabel" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ZoomFactorModel" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="DoubleZoomFactorModel" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="ListZoomFactorModel" minOccurs="0"
+                  maxOccurs="unbounded"/>
+
+      <xs:element ref="DefaultSelectionDefinition" minOccurs="0" maxOccurs="unbounded"/>
+
+      <xs:element ref="Layout" minOccurs="0" maxOccurs="unbounded"/>
+
+    </xs:choice>
+  </xs:group>
+
+</xs:schema>
+
+
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation2.xml b/xml/tests/testData/xml/ComplexSchemaValidation2.xml
new file mode 100644
index 0000000..fb6989f
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation2.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="windows-1252"?>
+
+<jdo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="jdo_2_0.xsd">
+    <package name="foo">
+        <class name="foo">
+            <datastore-identity>
+                <column/>
+            </datastore-identity>
+            <inheritance strategy="foo">
+                <discriminator>
+                    <column/>
+                </discriminator>
+                <join>
+                    <column/>
+                </join>
+            </inheritance>
+            <version>
+                <column/>
+            </version>
+            <field name="foo">
+                <collection>
+                    <extension vendor-name="foo"/>
+                </collection>
+                <<error>map</error>>
+                    <extension vendor-name="foo"/>
+                </<error>map</error>>
+                <array/>
+                <column/>
+                <join>
+                    <column/>
+                </join>
+                <element>
+                    <column/>
+                </element>
+                <key>
+                    <column/>
+                </key>
+                <value>
+                    <column/>
+                </value>
+                <order>
+                    <column/>
+                </order>
+                <index/>
+                <foreign-key>
+                    <extension vendor-name="foo"/>
+                </foreign-key>
+                <extension vendor-name="foo"/>
+            </field>
+            <fetch-group name="foo"/>
+            <<error>query</error>/>
+            <extension vendor-name="foo"/>
+        </class>
+        <extension vendor-name="foo"/>
+    </package>
+</jdo>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation20.xml b/xml/tests/testData/xml/ComplexSchemaValidation20.xml
new file mode 100644
index 0000000..7a433b9
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation20.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<simple xmlns="http://test/xsd/test1/test1"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns:test2="http://test/xsd/test1/test2"
+        xsi:schemaLocation="http://test/xsd/test1/test1 ComplexSchemaValidation20.xsd
+                            http://test/xsd/test1/test2 ComplexSchemaValidation20_2.xsd">
+    <simple/>
+    <test2:alpha/>
+</simple>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation20.xsd b/xml/tests/testData/xml/ComplexSchemaValidation20.xsd
new file mode 100644
index 0000000..6e1eff8
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation20.xsd
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://test/xsd/test1/test1"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:test2="http://test/xsd/test1/test2"
+            targetNamespace="http://test/xsd/test1/test1"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+    <xsd:import namespace="http://test/xsd/test1/test2" schemaLocation="ComplexSchemaValidation20_2.xsd"/>
+
+    <xsd:element name="simple">
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="simpleType"/>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:complexType name="simpleType">
+        <xsd:complexContent>
+            <xsd:extension base="empty">
+                <xsd:sequence maxOccurs="unbounded">
+                    <xsd:choice>
+                        <!--<xsd:any namespace="##targetNamespace"/>-->
+                        <!--<xsd:group ref="localTypes"/>-->
+                        <xsd:group ref="test2:alphaGroup"/>
+                    </xsd:choice>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="empty" abstract="true"/>
+
+    <xsd:group name="localTypes">
+        <xsd:choice>
+            <xsd:element ref="simple"/>
+        </xsd:choice>
+    </xsd:group>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation20_2.xsd b/xml/tests/testData/xml/ComplexSchemaValidation20_2.xsd
new file mode 100644
index 0000000..629fe4f
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation20_2.xsd
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://test/xsd/test1/test2"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://test/xsd/test1/test2"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+    <xsd:group name="alphaGroup">
+        <xsd:sequence>
+            <xsd:choice>
+                <xsd:element ref="alpha"/>
+                <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:element name="alpha"/>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3.xml b/xml/tests/testData/xml/ComplexSchemaValidation3.xml
new file mode 100644
index 0000000..0bfd66a
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="http://schemas.niku.com/2002/web"
+        xmlns:sec="http://schemas.niku.com/2002/security"
+        xmlns:srv="http://schemas.niku.com/2002/service"
+        xmlns:xi="http://www.w3.org/2001/XInclude"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://schemas.niku.com/2002/web web-2002-02.xsd
+          http://www.w3.org/2001/XInclude xinclude.xsd
+          http://schemas.niku.com/2002/security security-2002-02.xsd
+          http://schemas.niku.com/2002/service service-2002-02.xsd
+          ">
+  <page id="calendar.actionitemProperties" space="calendar.organizerHome" template="union.appPage">
+    <<error descr="An 'include' failed, and no 'fallback' element was found.">xi:include</error> href="<error descr="Cannot resolve directory 'portlets'">portlets</error>/<error descr="Cannot resolve file 'actionitemTOC.xml'">actionitemTOC.xml</error>"/>
+    <portlet id="calendar.actionitemProperties" view="actionitem/actionitemProperties.xsl"/>
+    <pageAction id="calendar.actionitemProperties" policyId="">
+      <retrieveService type="xbl" componentId="calendar" description="actionitem/actionitemProperties.xbl" portletId="calendar.actionitemProperties"/>
+    </pageAction>
+    <processAction id="calendar.actionitemPropertyUpdate" policyId="" redirect="true" nextAction="calendar.actionitemList" errorAction="calendar.actionitemProperties">
+      <processService type="odfUpdate" componentId="calendar" description="actionitem" dynamicValidation="odf.actionitem.update"/>
+      <paramSet>
+        <param name="odf_pk" source="request" value="odf_pk"/>
+        <param name="odf_view" source="request" value="odf_view"/>
+      </paramSet>
+    </processAction>
+  </page>
+</module>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/WMD-2002-02.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/WMD-2002-02.xsd
new file mode 100644
index 0000000..c49df10
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/WMD-2002-02.xsd
@@ -0,0 +1,1384 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://schemas.niku.com/2002/web"
+    xmlns:srv="http://schemas.niku.com/2002/service"
+    xmlns:sec="http://schemas.niku.com/2002/security"
+    xmlns="http://schemas.niku.com/2002/web"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+    <!-- Import security policy schema -->
+    <xsd:import namespace="http://schemas.niku.com/2002/security"
+        schemaLocation="security-2002-02.xsd" />
+    <!-- Import service schema -->
+    <xsd:import namespace="http://schemas.niku.com/2002/service"
+        schemaLocation="service-2002-02.xsd" />
+    <xsd:simpleType name="PageTypes">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="template" />
+            <xsd:enumeration value="page" />
+            <xsd:enumeration value="layer" />
+            <xsd:enumeration value="container" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="SkinTypes">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="evolution1">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="en">
+                        Niku 6.1.x UI look and feel with 2001 view XML.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:enumeration>
+            <xsd:enumeration value="evolution2">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="en">
+                        Niku 6.1.x UI look and feel with 2002 view XML.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:enumeration>
+            <xsd:enumeration value="evolution3">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="en">
+                        Clarity 8.0 UI look and feel with 2002 view XML.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:enumeration>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="PortletTypes">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="header" />
+            <xsd:enumeration value="footer" />
+            <xsd:enumeration value="toc" />
+            <xsd:enumeration value="tabs" />
+            <xsd:enumeration value="body" />
+            <xsd:enumeration value="pageContext" />
+            <xsd:enumeration value="pageToolbar" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="ViewTypes">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="vxsl" />
+            <xsd:enumeration value="vxml" />
+            <xsd:enumeration value="html" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="ColTypes">
+        <xsd:restriction base="xsd:integer">
+            <xsd:enumeration value="0" />
+            <xsd:enumeration value="1" />
+            <xsd:enumeration value="2" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="StateTypes">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="normal" />
+            <xsd:enumeration value="minimized" />
+            <xsd:enumeration value="maximized" />
+            <xsd:enumeration value="hidden" />
+            <xsd:enumeration value="inactive" />
+            <xsd:enumeration value="fullscreen" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="ScopeTypes">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="request" />
+            <xsd:enumeration value="session" />
+            <xsd:enumeration value="application" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="ModeTypes">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="edit" />
+            <xsd:enumeration value="admin" />
+            <xsd:enumeration value="max" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="ImportTypes">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="js" />
+            <xsd:enumeration value="css" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:element name="module">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Web module is a collection of Web page elements that
+                define the component's Web site. Each application
+                component defines a set of web pages for the application
+                module in a separate WMD XML file located under the
+                src/META-INF/component/wmd directory. All web pages
+                should be grouped into separate WMD XML files or web
+                modules based on features. WMD XML files use embedded
+                XML elements from Security XML schema
+                (security-2002-02.xsd) for specifying security
+                restrictions, and XInclude element for XML InfoSet
+                reuse. In order to use elements from external XML
+                schemas, the appropriate XML namespaces (xmlns:sec and
+                xmlns:xi) should be specified for the root element of
+                the instance document to ensure that the structure of
+                WMD XML document can be properly validated. The WMD XML
+                schema location should also be specified in the instance
+                document. WMD XML instance documents located in union
+                should use the following WMD XML schema location
+                declaration:
+                xsi:schemaLocation="http://schemas.niku.com/2002/web
+                ../xsd/web-2002-02.xsd". All other components should use
+                the following WMD XML schema location declaration:
+                xsi:schemaLocation="http://schemas.niku.com/2002/web
+                ../../union/xsd/web-2002-02.xsd".
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:sequence id="ModuleSequence">
+                <xsd:element name="moduleRef" type="ModuleRefType"
+                    minOccurs="0" maxOccurs="unbounded" />
+                <xsd:element name="page" type="PageType"
+                    maxOccurs="unbounded" />
+                <xsd:element name="processAction"
+                    type="ProcessActionType" minOccurs="0"
+                    maxOccurs="unbounded" />
+                <xsd:element name="portlet" type="PortletType"
+                    minOccurs="0" maxOccurs="unbounded" />
+            </xsd:sequence>
+            <xsd:attribute name="schemaLocation" type="xsd:string"
+                use="optional" />
+            <xsd:attribute name="id" type="xsd:string" use="optional">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="en">
+                        Defines web module id to reference web modules
+                        from other modules via moduleRef element. Module
+                        id attribute value should be unique for the
+                        whole web application. This attribute must use
+                        component’s name prefix to avoid name
+                        collisions. Module id is used by the moduleRef
+                        element to importing all web modules for the
+                        component into one WMD XML file and registering
+                        it for the component in properties.xml
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:attribute>
+            <xsd:attribute name="feature" type="xsd:string"
+                use="optional">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="en">
+                        Defines a web module feature id to classify web
+                        modules and contained pages into application
+                        features. If page space attribute is not
+                        defined, module feature id will be used insted
+                        to relate a page to the corrsponding application
+                        feature. This attribute must use component’s
+                        name prefix to avoid name collisions, and
+                        normally defines a link to the entry page for
+                        the whole feature.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:attribute>
+        </xsd:complexType>
+    </xsd:element>
+    <xsd:complexType name="ModuleRefType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Complex type for referencing and including other web
+                modules via module id. This element is a part of the
+                future enhancements for WMD XML. Its purpose is to
+                replace component descriptor file and to allow
+                registering of a single WMD XML file for the component
+                in properties.xml. The registred WMD XML file will use
+                moduleRef to import all other WMD XML files for the
+                component. Similar solution could be achieved with
+                XInclude.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="id" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Unique module id for the whole Web application.
+                    Component namespace should be used for this
+                    identifier to avoid name collissions.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:complexType name="PageType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Page element contains all the information about a web
+                page required to retrieve or produce page content and
+                display the page. This includes page and process web
+                actions for the page, optional list of imported web
+                resources (e.g. CSS and JavaScript), portlets, security
+                restrictions, and services associated with the portlets
+                or the whole page, in case of process action and POST
+                requests.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence id="PageSequence">
+            <xsd:element name="import" type="ImportType" minOccurs="0"
+                maxOccurs="unbounded" />
+            <xsd:element ref="sec:policy" minOccurs="0"
+                maxOccurs="unbounded" />
+            <xsd:element ref="sec:condition" minOccurs="0"
+                maxOccurs="unbounded" />
+            <xsd:element ref="sec:acl" minOccurs="0"
+                maxOccurs="unbounded" />
+            <xsd:element name="portletRef" type="PortletRefType"
+                minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="portlet" type="PortletType" minOccurs="0"
+                maxOccurs="unbounded" />
+            <xsd:element name="pageAction" type="PageActionType"
+                minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="processActionRef"
+                type="ProcessActionRefType" minOccurs="0"
+                maxOccurs="unbounded" />
+            <xsd:element name="processAction" type="ProcessActionType"
+                minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="paramSet" type="ParamSetType"
+                minOccurs="0" />
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Page id attribute value should be unique for a
+                    component. This attribute must use component’s name
+                    prefix followed by a dot and the actual unique
+                    component page id to avoid name collisions. For
+                    example, union.testPage contains component’s name
+                    followed by unique page id for the component. Page
+                    id is used for caching web page metadata, and
+                    linking a web page to the corresponding
+                    context-sensitive help topic.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="title" type="xsd:string" use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Optional page title dynamically set for customized
+                    pages. This attribute should not be defined in
+                    static WMD XML files because this metadata is not
+                    localized! Runtime only page property.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="componentId" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Component id is an optional attribute that specifies
+                    id of the component to which a web page belongs. If
+                    not specified, the system will populate this value
+                    during initialization based on information specified
+                    in config/properties.xml file and the corresponding
+                    component descriptor XML file. Valid component id is
+                    a value of id attribute from one of the component
+                    elements specified in config/properties.xml.
+                    Component id is used to construct the file paths and
+                    navigate component directory structure for locating
+                    web resources (all component-specific XML files used
+                    by WMD).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="help" type="xsd:string" use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Help is an optional attribute to specify an
+                    alternative context-sensitive help topic for the web
+                    page. By default page id is used to locate the
+                    corresponding context-sensitive help topic. In cases
+                    when multiple Web pages use the same help topic,
+                    help attribute with the name of the help topic
+                    should be used instead. This attribute should also
+                    use component prefix to avoid name collisions.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="space" type="xsd:string" use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Identifies the space/module to which this web page
+                    belongs. When this attribute is specified and the
+                    header or left navigation used for the page contains
+                    an action element with actionId=space, the
+                    corresponding space will be highlighted when the
+                    page is displayed.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="authenticate" type="xsd:boolean"
+            default="true">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies whether or not user authentication is
+                    required prior to displaying this page. The default
+                    authenticate attribute value is true, meaning that
+                    authentication is required for all web pages by
+                    default. Therefore, there is no need to set
+                    authenticate=”true” explicitly. An attempt to
+                    navigate to such web page without proper login will
+                    always result in a redirect to the login web page.
+                    If the authenticate attribute is explicitly set to
+                    false, certain web pages can be exposed to external
+                    users bypassing the proper login procedure.
+                    Marketplace web pages fall into this category.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="personalize" type="xsd:boolean"
+            default="false">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Identifies personalizable Web pages. All portlets
+                    for a personalized Web page are processed by the
+                    PortletPersonalizer, and portlets are oredered and
+                    displayed based on the user preferrences.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="portal" type="xsd:boolean"
+            default="false">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Identifies portal pages.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="pageType" default="page"
+            type="PageTypes">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Pages are categorized into different types as
+                    specified by the type attribute. This information is
+                    used by the PortletController. Page templates are
+                    abstract pages that other pages reference via the
+                    template atribute for including standard portlets in
+                    a page, such as header, footer and left navigation.
+                    Page layers represent page tabs. All page layers
+                    must use the same page template, and include a
+                    reusable tabs portlet, but can use different page
+                    layouts.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="instanceType" type="xsd:string"
+            default="SYSTEM">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Pages may be of specific types, these are only set
+                    from the database
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="parent" type="xsd:string" use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Optional parent page reference attribute to specify
+                    the parent/container page for a page layer (tab).
+                    This attribute is required for all page layers, and
+                    ignored for other page types.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="pageBuilder" type="xsd:string"
+            use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies Web page builder class responsible for
+                    content preparation. Page builder produces final
+                    page content by: 1) storing portlet content in the
+                    content map if layout template is defined, and
+                    forwarding the request with the content map to the
+                    corresponding template, or 2) it can directly
+                    produce the final page content via aggregation of
+                    portlet content and other UI properties.There is no
+                    need to specify pageBuilder attribute for the page
+                    element explicitly because only one page builder
+                    (JSPPageBuilder) is available at this time for NDE.
+                    Moreover, not specifying it keeps the migration
+                    options open when client side XML transformations
+                    will be integrated into the application.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="serializer" type="xsd:string"
+            use="optional" default="html">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies the content output serializer for this
+                    request as defined in properties.xml.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="template" type="xsd:string" use="optional"
+            default="union.appPage">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Optional attribute to specify alternative page
+                    template for the Web page. Page template defines
+                    standard portlet collection to be used for page
+                    rendering. Standard page portlets are: header,
+                    footer and left navigation. The available page
+                    templates are: union.appPage, union.adminPage,
+                    union.popup . Each page template includes different
+                    header and/or left navigation for rendering a page.
+                    The default value references page template common
+                    for all application pages. Administration pages and
+                    popups need to explicitly specify the appropriate
+                    page template reference.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="layout" type="xsd:string" use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Optional attribute to specify alternative page
+                    layout template for the Web page.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="skin" use="optional" type="SkinTypes">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Optional attribute to assign an alternative skin or
+                    UI Look and Feel to be used for rendering content of
+                    the whole web page.
+                </xsd:documentation>
+            </xsd:annotation>
+
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:element name="portlet" type="PortletType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Global portlet element for defining reusable portlets in
+                separate WMD XML files and importing them with XInclude.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="PortletType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Defines a single portlet for the web page and represents
+                a visible section of the rendered page. Portlet can
+                contain security restrictions to evaluate for the view,
+                a list of import elements for including web resources,
+                and different attributes for personalization, content
+                aggregation, caching, and security.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence id="PortletSequence">
+            <xsd:element name="import" type="ImportType" minOccurs="0"
+                maxOccurs="unbounded" />
+            <xsd:element ref="sec:policy" minOccurs="0"
+                maxOccurs="unbounded" />
+            <xsd:element ref="sec:condition" minOccurs="0"
+                maxOccurs="unbounded" />
+            <xsd:element ref="sec:acl" minOccurs="0"
+                maxOccurs="unbounded" />
+            <xsd:element name="viewMode" type="ViewModeType"
+                minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="retrieveService"
+                type="RetrieveServiceType" minOccurs="0"
+                maxOccurs="unbounded" />
+        </xsd:sequence>
+        <xsd:attribute name="schemaLocation" type="xsd:string"
+            use="optional" />
+        <xsd:attribute name="id" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Portlet id is a unique portlet identifier for the
+                    whole web application. As with the page id,
+                    component namespace should be used for this
+                    identifier to avoid name collisions. Portlet id is
+                    used as part of the key to cache portlet content and
+                    associate portlets with retrieve services for each
+                    web page action.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="instanceId" type="xsd:string"
+            use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Portlet instance id used by page personalization
+                    features to display mulitple instances of the same
+                    portlet on a single page.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="instanceType" type="xsd:string"
+            default="SYSTEM">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Portlet instance type used by page personalization
+                    features.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="templateId" type="xsd:string"
+            use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Portlet template id defines portlet instance id of
+                    the system page portlet from which this portlet
+                    instance was created.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="componentId" type="xsd:string"
+            use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Component id is required for reusable portlets and
+                    specifies the component name in which the portlet is
+                    defined. It is used to construct the location path
+                    for view XSL file and rendering portlet content.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="title" type="xsd:string" use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Optional portlet title dynamically set for portlets
+                    included by a user for personalized pages. This
+                    attribute should not be defined in static WMD XML
+                    files because this metadata is not localized!
+                    Runtime only portlet property.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="collection" type="xsd:string"
+            use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Optional portlet collection name to specify for
+                    custom page templates and JSP tags to layout and
+                    agregate portlet content. For most pages and
+                    existing page templates porltetType, col, and row
+                    attributes should be used to classify portlets and
+                    define their position on the page. Portlet
+                    collections are only for the remaining 1% of the
+                    pages that require custom layout. All custom page
+                    templates should still be defined in
+                    webroot/WEB-INF/union/templates directory in union
+                    for easy maintenance.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="portletType" default="body"
+            type="PortletTypes">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Portlets are categorized into different types as
+                    specified by the type attribute. This information is
+                    used by the page layout manager during content
+                    aggregation and allows changing web page layout for
+                    the whole application by modifying only page layout
+                    template code (JSP or XSLT). Additional standard
+                    portlet types could be identified in the future and
+                    added to this list.
+                </xsd:documentation>
+            </xsd:annotation>
+
+        </xsd:attribute>
+        <xsd:attribute name="viewType" default="vxsl"
+            type="ViewTypes">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    The portlet may process data using a VXSL, or the
+                    data may be a VXML, or even straight HTML
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="view" type="xsd:string" use="optional"
+            default="">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Relative location of the view XML or XSLT template
+                    used to generate view XML from data XML received as
+                    a result of the service call for the portlet. View
+                    XML and XSL files are located under
+                    /src/META-INF/component/vxsl directory. Each portlet
+                    must use a separate view XSL template. Static
+                    portlets that don’t display dynamic data can
+                    reference view XML file directly via the view
+                    attribute. This allows bypassing the data XML
+                    transformation with view XSL when the content of a
+                    portlet contains only presentation elements.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="ui" type="xsd:string" default="view">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Optional name of the UI XSLT template to specify
+                    alternative UI XSLT used for transforming view XML
+                    content of the portlet into web agent specific
+                    markup format, such as XHTML or SVG. This attribute
+                    should be specified only in rare occasions when
+                    custom UI XSLT templates are used. The default and
+                    most common top-level UI XSLT template used for most
+                    of the portlets in NDE is called “view”. It includes
+                    other UI XSLT templates for rendering such common UI
+                    widgets as buttons, links, toolbars, tabs, list
+                    tables, attribute tables, and trees. View is the
+                    default UI XSL template and it does not need to be
+                    specified explicitly.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="col" default="1" type="ColTypes">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    The row and col attributes can be used to specify a
+                    position of the body type portlet content for a
+                    rendered web page. All layout managers use grid
+                    layout with rows and columns to position the content
+                    of body type portlets during content aggregation.
+                    The default values for row and col portlet
+                    attributes are 0 (first row) and 1(second column –
+                    center column). All portlets should be listed as
+                    children of a page in an increasing order of their
+                    assigned row and column. Portlets are layed out on
+                    the page in at most 3 columns, where each column
+                    represents a separate stack or a bucket. If no row
+                    is assigned, portlets are laid out in the order they
+                    are listed in web metadata and according to their
+                    column assignments. Column indexes start with 0,
+                    with 1 being the default wide center column. Web
+                    page layout template is responsible for spanning the
+                    content of portlets if the number of portlet columns
+                    is less than 3.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="row" type="xsd:integer" use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    The row and col attributes can be used to specify a
+                    position of the body type portlet content for a
+                    rendered web page. All layout managers use grid
+                    layout with rows and columns to position the content
+                    of body type portlets during content aggregation.
+                    The default values for row and col portlet
+                    attributes are 0 (first row) and 1(second column –
+                    center column). All portlets should be listed as
+                    children of a page in an increasing order of their
+                    assigned row and column. Portlets are layed out on
+                    the page in at most 3 columns, where each column
+                    represents a separate stack or a bucket. If no row
+                    is assigned, portlets are laid out in the order they
+                    are listed in web metadata and according to their
+                    column assignments. Column indexes start with 0,
+                    with 1 being the default wide center column. Web
+                    page layout template is responsible for spanning the
+                    content of portlets if the number of portlet columns
+                    is less than 3.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="narrow" type="xsd:boolean"
+            default="false">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Denotes wheter or not this portlet can be placed in
+                    the narrow (left or right) column of the Web page
+                    grid layout.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="span" type="xsd:boolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Denotes whether or not the content of the first
+                    portlet for the web page should span across the
+                    whole page horizontally, ignoring multiple column
+                    grid layout for the page.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="required" type="xsd:boolean"
+            default="false">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Denotes a required portlet for a Web page. The
+                    content of required portlet is always displayed
+                    independent of user preferences for a personalized
+                    page. This can be used for building personalized
+                    pages for companies that require their employees to
+                    read company news feeds.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="default" type="xsd:boolean"
+            default="false">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Denotes a default portlet for a Web page. The
+                    content of default portlet is displayed initially
+                    for a personalized web page, prior or until a user
+                    modifies personal settings. As such, this portlet
+                    will be displayed when a user first hits the
+                    personal page, but the portlet is not required and
+                    can be removed by changing personal settings for the
+                    page.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="pageEvents" type="xsd:boolean"
+            default="false">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Denotes a portlet that contains page level events
+                    defined in view XML. Such portlet view XML is
+                    queried with XPath to retrieve and transform
+                    declared page events. Page events, such as onLoad,
+                    are then passed to page template to be included in
+                    page body tag.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="pageToolbar" type="xsd:boolean"
+            default="false">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Denotes a portlet that contains page level toolbar
+                    defined in view XML. Such portlet view XML is
+                    queried with XPath to retrieve and transform
+                    declared page toolbar links. Rendered page toolbar
+                    that normally contains Personalize or Customize
+                    links will be included in the page title section of
+                    the rendered page.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="state" default="normal"
+            type="StateTypes">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Defines portlet state for the portlet window.
+                </xsd:documentation>
+            </xsd:annotation>
+
+        </xsd:attribute>
+        <xsd:attribute name="cacheable" type="xsd:boolean"
+            default="false">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Determines whether or not the portlet content can be
+                    cached.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="scope" default="request"
+            type="ScopeTypes">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Determines the scope for the portlet content caching
+                    mechanism. The available scopes are: application
+                    scope - portlet content with application scope is
+                    cached based on the user locale. The content is
+                    generated only once and doesn’t expire. Application
+                    level cache is cleared only upon application restart
+                    or refresh of the application settings. Session
+                    session – portlet content with the session scope is
+                    cached based on the user session id and locale. Any
+                    portlet content that requires user right checking in
+                    addition to locale sensitivity should use this
+                    setting. Session level cache is cleared whenever
+                    user session expires or when a user logs off.
+                    Request scope – portlet content with the request
+                    scope is cached based on the user locale and
+                    expiration time setting. This content is cached for
+                    a single request based on the action id and is used
+                    for all users with the same locale. Note that
+                    content with session or user specific information
+                    should not use request scope caching.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="expires" type="xsd:long" default="0">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Defines expiration time in seconds for the portlet
+                    content cached in request scope. The default value
+                    (0) identifies time sensitive content that can't be
+                    cached.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="policyId" type="xsd:string"
+            use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies security policy id to check user
+                    entitlement information for viewing the content of
+                    this portlet. This is a reference to one of the
+                    security restriction elements defined for a web
+                    page.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:complexType name="ViewModeType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Defines a portlet view mode. The supported portlet view
+                modes are: edit, max and admin. Other modes can be
+                defined. Portlet definition itself difines the default
+                display mode (normal). View modes define actions to use
+                for portlet management, such as portlet customization
+                and administration. The WMD processor looksup view modes
+                to generate proper links for portlet Edit and Customize
+                links in the portlet title bar.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="modeType" use="required"
+            type="ModeTypes">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies portlet view mode type: edit, admin, max
+                    etc.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="action" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies the link for the portlet view mode type
+                    for portlet management and customization.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:complexType name="ActionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Abstract type used for defining WebReadAction and
+                WebWriteAction.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="paramSet" type="ParamSetType"
+                minOccurs="0" />
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Unique action identifier that maps HTTP GET and POST
+                    actions via the predefined "action" parameter to
+                    this web action. It is used to locate and invoke a
+                    processAction or a pageAction, and render the web
+                    page and its content. The value for this attribute
+                    should use component namespace to avoid name
+                    collisions.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="authenticate" type="xsd:boolean"
+            use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies whether or not user authentication is
+                    required prior to invoking this action
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="alias" type="xsd:string" use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Unique action identifier alias that maps HTTP GET
+                    and POST actions via the predefined "action"
+                    parameter to this web action. It is used to locate
+                    and invoke a processAction or a pageAction, and
+                    render the web page and its content. The value for
+                    this attribute should use component namespace to
+                    avoid name collisions.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="componentId" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies id of the component for this action. If
+                    not specified, the system will populate this value
+                    during initialization based on information specified
+                    in properties.xml file and the corresponding
+                    component descriptor XML file. Valid component id is
+                    a value of id attribute from one of the component
+                    elements specified in properties.xml. Component id
+                    is used to construct the file paths and navigate
+                    component directory structure for locating web
+                    resources (all component-specific XML files used by
+                    WMD).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="active" type="xsd:boolean" use="optional"
+            default="true">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Active flag for marking enabled/disabled actions.
+                    Requesting a page or a process action with an action
+                    id whose active flag is set to false will result in
+                    an error page that notifies an end-user that the
+                    action or page has been temporarly disabled. The
+                    error page is Service Unavailable with the http
+                    error code 503.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="policyId" type="xsd:string"
+            use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies security policy id to check user
+                    entitlement information for invoking this web
+                    action. This is a reference to one of the security
+                    restriction elements defined for a web page.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="binding" type="xsd:string"
+            use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Optional location of the binding file for HTTP to
+                    XML marshalling. If not specified, the default
+                    generated binding file with that name that matches
+                    action id is used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="useSsl" type="xsd:boolean"
+            default="false">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Deprecated. Use ssl attribute instead.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="ssl" type="xsd:boolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Denotes wether or not to use SSL for the data
+                    transmission that is the result of this action.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="compress" type="xsd:boolean"
+            default="true">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Denotes wether to use gzip for the data transmission
+                    that is the result of this action.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="pageId" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Option attribute to give reference to the parent of
+                    the action id. This is loaded if it is not filled
+                    in.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="inheritParamSet" type="xsd:boolean"
+            use="optional" default="false">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies whether to inherit the paramset defined
+                    for the containing page.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:complexType name="PageActionType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Page action is used to trigger the display of a web
+                page. Normally, a page action is a result of HTTP GET
+                request that triggers multiple service calls, one per
+                each portlet, to retrieve content for each portlet. Each
+                web page must contain at least one page action that will
+                trigger loading of a web page. To request a page action
+                via HTTP GET request, its id attribute must match the
+                value of reserved HTTP parameter (“action”).
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="ActionType">
+                <xsd:sequence id="ActionSequence">
+                    <xsd:element name="portlet" type="PortletType"
+                        minOccurs="0" maxOccurs="unbounded" />
+                    <xsd:element name="retrieveService"
+                        type="RetrieveServiceType" minOccurs="0"
+                        maxOccurs="unbounded" />
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:complexType name="RetrieveServiceType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Specifies the service to call that will generate content
+                for a portlet when page action is triggered. Retrieve
+                service is linked to the corresponding portlet via
+                portlet id. Page action might have one or more retrieve
+                services.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="srv:retrieveService">
+                <xsd:attribute name="portletId" type="xsd:string"
+                    use="required">
+                    <xsd:annotation>
+                        <xsd:documentation xml:lang="en">
+                            Unique portlet identifier that links this
+                            service to one of the portlets defined for a
+                            web page.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:complexType name="ProcessActionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Defines a web action that submits page data to the
+                backend and modifies the underlying data store in any
+                way. Processing of a process action doesn't result in a
+                web page display, and is always followed by processing
+                of the next web page action. Process actions should be
+                used for all requests that perform insert, update, or
+                delete operations on the data store or modify the data
+                store in any other way. Process action element contains
+                additional attributes for performing such operations.
+                Next action attribute specifies the action id of the
+                next page action to process, to trigger loading of a
+                confirmation web page upon successful completion of the
+                update operation. Error action attribute specifies the
+                action id of the next page action to process, to trigger
+                loading of the appropriate error page if the operation
+                fails. Most of the time, this will be an action id of
+                the page action used to display a web page from which
+                the information is posted to perform an update. This
+                will trigger redisplay, or refresh of the page with the
+                error message displayed, and erroneous information
+                fields marked on the page.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="ActionType">
+                <xsd:sequence id="ProcessActionSequence">
+                    <xsd:element name="processService"
+                        type="ProcessServiceType" maxOccurs="unbounded" />
+                    <xsd:element name="redirectCondition"
+                        type="RedirectConditionType" minOccurs="0"
+                        maxOccurs="unbounded" />
+                </xsd:sequence>
+                <xsd:attribute name="nextAction" type="xsd:string"
+                    use="optional">
+                    <xsd:annotation>
+                        <xsd:documentation xml:lang="en">
+                            Next page action id to invoke that triggers
+                            rendering of the response web page.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="errorAction" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation xml:lang="en">
+                            Fallbackt error action id used if this
+                            request fails.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="redirect" type="xsd:boolean"
+                    default="false">
+                    <xsd:annotation>
+                        <xsd:documentation xml:lang="en">
+                            Determines whether or not a redirect is
+                            required after this web action has been
+                            processed. In case of redirect=true, the
+                            nextAction attribute value will be appended
+                            to the redirect url to specify what web
+                            action will be invoked next. If additional
+                            parameters are required for the redirect
+                            url, they can be specified via an optional
+                            webRedirect element and a list of webParams.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="dynamicErrorAction"
+                    type="xsd:string" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:complexType name="ProcessServiceType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Specifies the type and description of a service to call
+                that will process an update operation for a process
+                action and further request redirect or forward. The
+                resulting output is used as an input for the next or
+                error page action in case of request forwarding. When
+                redirect is used, additional redirect URL parameters can
+                be specified via paramSet element. The redirect
+                parameters can query the original HTTP request or the
+                output of the process service with XPath.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="srv:processService" />
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:complexType name="RedirectConditionType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Defines a redirect condition evaluated by action
+                controller prior to request forwarding or redirect.
+                Redirect conditions are optional and are evaluated only
+                when the process action redirect attribute is set to
+                true. If no redirect conditions are specified, depending
+                on the status of process action executaion, the request
+                will be redirected or forwarded to the next or error
+                action.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence id="RedirectConditionSequence">
+            <xsd:element name="paramSet" type="ParamSetType"
+                minOccurs="0" />
+        </xsd:sequence>
+        <xsd:attribute name="inheritParamSet" type="xsd:boolean"
+            use="optional" default="false">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies whether to inherit the paramset defined
+                    for the process action.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="source" type="sourceTypes" use="optional"
+            default="response">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies the source from which the expression
+                    matching parameter and destination URL is retreived.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="parameter" type="xsd:string"
+            use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies the parameter name to use for expression
+                    matching, if the source is other than the response
+                    data XML document.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="expression" type="xsd:string"
+            use="optional" default=".">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Regular expression or an XPath expression for
+                    redirect condition. The XPath expression is used to
+                    query process action data XML response document, if
+                    the source attribute is set to response. Otherwise,
+                    the reqular expression matching is used on the
+                    specified source parameter value to determine a
+                    match.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="action" type="xsd:string" use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Action id of the next action to execute if redirect
+                    condition is met. This is used as a fallback action
+                    if destination expresssion parsing fails.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="destination" type="xsd:string"
+            use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    XPath expression or parameter name for the redirect
+                    condition to retrieve redirect URL from data XML
+                    response document or other sources. This attribute
+                    overwrites static action specified for redirect.
+                    Mostly used by personalization engine and portal
+                    framework.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="destinationAction" type="xsd:string"
+            use="optional">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    XPath expression or parameter name for the redirect
+                    condition to retrieve redirect action from data XML
+                    response document or other sources. This attribute
+                    overwrites static action specified for redirect.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:simpleType name="sourceTypes">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Specifies the source from which the parameter value is
+                retreived: request - http request, or response - service
+                call response.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="constant" />
+            <xsd:enumeration value="request" />
+            <xsd:enumeration value="response" />
+            <xsd:enumeration value="xml" />
+            <xsd:enumeration value="session" />
+            <xsd:enumeration value="cookie" />
+            <xsd:enumeration value="header" />
+            <xsd:enumeration value="config" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:complexType name="ParamSetType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Defines a list parameters to be used for constructing a
+                redirect url query string when performing a redirect for
+                a web action to another web page.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="param" type="ParamType"
+                maxOccurs="unbounded" />
+        </xsd:sequence>
+    </xsd:complexType>
+    <xsd:complexType name="ParamType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Defines a single parameter for a redirect URL query
+                string. If source=”request”, the HTTP request parameter
+                name specified in the value attribute will be used to
+                retrieve the parameter value. If source=”response”, the
+                XPath expression specified in the value attribute will
+                be used to retrieve the parameter value from data XML
+                response of the process action service call.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="name" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies the parameter name.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="source" type="sourceTypes" use="optional"
+            default="constant">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies the source from which the parameter value
+                    is retreived.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="value" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Specifies how the value of the parameter is
+                    retrieved. If source=request, the name of the http
+                    parameter needs to be specified in the value
+                    attribute. If source=response, the value parameter
+                    will be an XPath expression to query the service
+                    response XML for the parameter value.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:complexType name="ImportType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Defines a web resource to include during content
+                aggregation. Different web pages depending on their
+                content and features require different web resources to
+                be included. Typically, web resources represent external
+                files that are used to render page content and provide
+                additional presentation styles and client-side dynamic
+                behavior for a page. Currently, such web resources
+                include CSS and JavaScript files from UI toolkit. Web
+                page builder or a page layout manager will generate a
+                proper reference to the imported web resource file from
+                UI toolkit based on the resource name as the specified
+                by the href attribute, its type attribute, and the UI
+                skin assigned to a web page.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="href" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    The name of the web resource to import.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="type" use="optional" default="js"
+            type="ImportTypes">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Identifies web resource type: js - JavaScript, css -
+                    CSS file.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <!-- Element Reference Types for reuse -->
+    <xsd:complexType name="PortletRefType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Complex type for referensing reusable portlets that are
+                standalone or defined in other web pages. This element
+                is part of the future enhancements for WMD and is not
+                supported yet. This solution will require less memory at
+                runtime when WMD XML files are loaded and cached for
+                request processing.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="id" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Unique portlet id for the whole Web application.
+                    Component namespace should be used for this
+                    identifier to avoid name collissions. Portlet id is
+                    used as part of the key to cache portlet content and
+                    to associate portlets with retreive services for
+                    each web page action.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:complexType name="ProcessActionRefType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+                Complex type for referensing reusable process actions
+                that are standalone or defined in other WMD XML files.
+                This element is part of the future enhancements for the
+                WMD and is not supported yet. Its purpose is to replace
+                existing XInclude solution. This solution will require
+                less memory at runtime when WMD XML files are loaded and
+                cached for request processing.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="id" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                    Unique process action id for the whole Web
+                    application. Component namespace should be used for
+                    this identifier to avoid name collissions.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/common-2003-09.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/common-2003-09.xsd
new file mode 100644
index 0000000..bd22ecc
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/common-2003-09.xsd
@@ -0,0 +1,420 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--W3C Schema generated by XML Spy v4.0 NT beta 2 build Jul 26 2001 (http://www.xmlspy.com)-->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xsd:complexType name="NlsType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">A generic type used to hold any name/description pair of localizable text</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="description" type="xsd:string"/>
+    <xsd:attribute name="languageCode" type="xsd:string" use="required"/>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="ImageType">
+    <xsd:annotation>
+      <xsd:documentation>Specifies an image type. An image is similar to an nls except it can have its own tool tip.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="nls" type="NlsType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="toolTip" type="NlsType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:simpleType name="MacroType">
+    <xsd:annotation>
+      <xsd:documentation>Macros that will be evaluated at runtime for their actual value. At present all these macros may be limited
+    to date datatype. In future we could additional ones if required.
+          </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="date_timestamp"/>
+      <xsd:enumeration value="date_today"/>
+      <xsd:enumeration value="date_yesterday"/>
+      <xsd:enumeration value="date_tomorrow"/>
+      <xsd:enumeration value="date_startofcurrentyear"/>
+      <xsd:enumeration value="date_startofcurrentquarter"/>
+      <xsd:enumeration value="date_startofcurrentmonth"/>
+      <xsd:enumeration value="date_startofcurrentweek"/>
+      <xsd:enumeration value="date_startofpreviousyear"/>
+      <xsd:enumeration value="date_startofpreviousquarter"/>
+      <xsd:enumeration value="date_startofpreviousmonth"/>
+      <xsd:enumeration value="date_startofpreviousweek"/>
+      <xsd:enumeration value="date_startofnextyear"/>
+      <xsd:enumeration value="date_startofnextquarter"/>
+      <xsd:enumeration value="date_startofnextmonth"/>
+      <xsd:enumeration value="date_startofnextweek"/>
+      <xsd:enumeration value="date_endofcurrentyear"/>
+      <xsd:enumeration value="date_endofcurrentquarter"/>
+      <xsd:enumeration value="date_endofcurrentmonth"/>
+      <xsd:enumeration value="date_endofcurrentweek"/>
+      <xsd:enumeration value="date_endofpreviousyear"/>
+      <xsd:enumeration value="date_endofpreviousquarter"/>
+      <xsd:enumeration value="date_endofpreviousmonth"/>
+      <xsd:enumeration value="date_endofpreviousweek"/>
+      <xsd:enumeration value="date_endofnextyear"/>
+      <xsd:enumeration value="date_endofnextquarter"/>
+      <xsd:enumeration value="date_endofnextmonth"/>
+      <xsd:enumeration value="date_endofnextweek"/>
+      <xsd:enumeration value="userId"/>
+      <xsd:enumeration value="language"/>
+      <xsd:enumeration value="locale"/>
+      <xsd:enumeration value="sessionId"/>
+      <xsd:enumeration value="userName"/>
+      <xsd:enumeration value="timestamp"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="ExtendedWidgetType">
+    <xsd:annotation>
+      <xsd:documentation>Specifies additional information to aid in rendering a display mapping field in a property and filter view. 
+    Property view will use icon, description, icondescription values to determine rendering of a field
+    as a text, text + icon, or text + icon + description or text + description.
+          Filter view will use colorlookup and mappinglookup values to determine which lookup type to be used
+          for rendering the pull-down.      
+          </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="icon"/>
+      <xsd:enumeration value="description"/>
+      <xsd:enumeration value="icondescription"/>
+      <xsd:enumeration value="mappinglookup"/>
+      <xsd:enumeration value="colorlookup"/>
+      <xsd:enumeration value="dependentLookup"/>
+      <xsd:enumeration value="url"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  
+  <xsd:complexType name="DocumentType">
+    <xsd:complexContent>
+      <xsd:extension base="DocumentBaseType">
+        <xsd:sequence>
+          <xsd:element name="Version" minOccurs="1" maxOccurs="unbounded">
+            <xsd:complexType>
+              <xsd:complexContent>
+                <xsd:extension base="DocumentVersionType">
+                  <xsd:attribute name="isLatest" type="xsd:boolean" use="required"/>
+                </xsd:extension>
+              </xsd:complexContent>
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:long" use="required"/>
+        <xsd:attribute name="mimeType" type="xsd:string"/>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <xsd:complexType name="DocumentBaseType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Base set of attributes for a document</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="description" type="xsd:string"/>
+    <xsd:attribute name="versioningEnabled" type="xsd:boolean" default="true"/>
+    <xsd:attribute name="numCheckoutDays" type="xsd:int" default="1"/>
+    <xsd:attribute name="hasAllParticipants" type="xsd:boolean" default="true"/>
+    <xsd:attribute name="allowNonParticipants" type="xsd:boolean"/>
+    <xsd:attribute name="language" type="xsd:string"/>
+    <xsd:attribute name="fileCreatedDate" type="xsd:dateTime"/>
+    <xsd:attribute name="status" type="xsd:string"/>
+  </xsd:complexType>
+  
+  <xsd:complexType name="DocumentVersionType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">The document version representation</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="id" type="xsd:long" use="required"/>
+    <xsd:attribute name="versionNumber" type="xsd:nonNegativeInteger" use="required"/>
+    <xsd:attribute name="checkInComment" type="xsd:string"/>
+    <xsd:attribute name="status" type="xsd:string"/>
+  </xsd:complexType>
+  
+  <xsd:simpleType name="DBVendorType">
+    <xsd:annotation>
+      <xsd:documentation>Identifies a particular db vendor.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="all"/>
+      <xsd:enumeration value="oracle"/>
+      <xsd:enumeration value="mssql"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:complexType name="AttributeType">
+    <xsd:annotation>
+      <xsd:documentation>This represents an attribute. Report, Jobs, Graph, Grids and Business Object - all have attributes. However each of these entities refer to attributes with a different name. Reports and Jobs have "parameters". Graphs, Grids and Browse pages have "filters" and "searchResultColumns". Parameters, Filters, SearchResultColumns - essentially they all share some common information. This commonality is captured by this type.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="nls" type="NlsType" maxOccurs="unbounded"/>
+      <xsd:element name="obsBrowseValue" type="ObsBrowseValueType" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>If a particular attribute is a OBS browse, then this element will capture the default values for this OBS browse.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="timeBrowseValue" type="TimeBrowseValueType" minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>If a particular attribute is a time browse, then this element will capture the default values for this time browse.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="code" type="xsd:string" use="required"/>
+    <xsd:attribute name="dataType" type="DataTypeType" use="optional"/>
+    <xsd:attribute name="widgetType" type="WidgetType" use="optional"/>
+    <xsd:attribute name="defaultValue" type="xsd:string" use="optional"/>
+    <xsd:attribute name="status" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="readOnly" type="xsd:boolean" use="optional" default="false"/>
+    <xsd:attribute name="required" type="xsd:boolean" use="optional" default="false"/>
+    <xsd:attribute name="system" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="lookupCode" type="xsd:string" use="optional"/>
+    <xsd:attribute name="lookupCardinality" type="xsd:int" use="optional"/>
+    <xsd:attribute name="order" type="xsd:int" use="optional"/>
+  </xsd:complexType>
+  <xsd:simpleType name="DataTypeType">
+    <xsd:annotation>
+      <xsd:documentation>Possible data types of an attribute.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="string"/>
+      <xsd:enumeration value="boolean"/>
+      <xsd:enumeration value="numeric"/>
+      <xsd:enumeration value="datetime"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="WidgetType">
+    <xsd:annotation>
+      <xsd:documentation>
+      List of UI widgets used in Niku 6 application.
+      
+      textexact - Used for NSQL parameters when there can only be one value.  So, the attribute cannot be multivalued and cannot have a wildcard.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="hidden"/>
+      <xsd:enumeration value="checkbox"/>
+      <xsd:enumeration value="select"/>
+      <xsd:enumeration value="text"/>
+      <xsd:enumeration value="textarea"/>
+      <xsd:enumeration value="datepicker"/>
+      <xsd:enumeration value="datetime"/>
+      <xsd:enumeration value="browse"/>
+      <xsd:enumeration value="daterange"/>
+      <xsd:enumeration value="numericrange"/>
+      <xsd:enumeration value="textexact"/>
+      <xsd:enumeration value="numeric"/>
+      <xsd:enumeration value="icon"/>
+      <xsd:enumeration value="stoplight"/>
+      <xsd:enumeration value="datetext"/>
+      <xsd:enumeration value="datetimetext"/>
+      <xsd:enumeration value="progressBar"/>
+      <xsd:enumeration value="attachment"/>
+      <xsd:enumeration value="clob"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:complexType name="ObsBrowseValueType">
+    <xsd:annotation>
+      <xsd:documentation>A complex type to represent the value of a OBS browse attribute.  This specifies the additional information (meta data) required to render and register this special type of attribute.
+addOption = For a Dimension OBS Browse, it could be any of the following:
+ - specific_units, subunits_of_specific_units, all_units_within_level.
+For Filter OBS browses it could be any of the following:
+- selected_unit_only, selected_unit_and_below, selected_unit_and_above.
+typeId = Obs Type Id
+levelId = Id of the selected OBS level
+depth = The depth of the unit or level
+    </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="unitId" type="xsd:long" use="optional"/>
+    <xsd:attribute name="unitName" type="xsd:string" use="optional"/>
+    <xsd:attribute name="addOption" type="ObsAddOptionType" use="required">
+      <xsd:annotation>
+        <xsd:documentation>For a Dimension OBS Browse, this can be any of the following:
+ - specific_units, subunits_of_specific_units, all_units_within_level.
+For Filter OBS browses this can be any of the following:
+- selected_unit_only, selected_unit_and_below, selected_unit_and_above.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="typeId" type="xsd:long" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>OBS Type Id</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="levelId" type="xsd:long" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>Id of the selected OBS level</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="typeName" type="xsd:string" use="optional"/>
+    <xsd:attribute name="depth" type="xsd:int" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="TimeBrowseValueType">
+    <xsd:annotation>
+      <xsd:documentation>A complex type to represent the value of a Time Browse attribute.  This specifies the additional information (meta data) required to render and register this special type of attribute.
+timeLevel = What kind of time level?
+setTimeBy = Indicates the style of the macro - specific date or a rolling window.
+closestFromDate = Date value; use this when the setTimeBy is set to closest_periods_specific_date_range.
+closestToDate = Date value; use this when the the setTimeBy is set to closest_periods_specific_date_range.
+rangeMacro  = Use this when setTimeBye is set to rolling_window.
+timePeriods = Number of time periods.
+offset = Time period offset.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="period" minOccurs="0" maxOccurs="unbounded">
+        <xsd:complexType>
+          <xsd:attribute name="key" type="xsd:string" use="optional"/>
+          <xsd:attribute name="label" type="xsd:string" use="optional"/>
+        </xsd:complexType>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="timeLevel" type="TimeLevelType" use="required">
+      <xsd:annotation>
+        <xsd:documentation>What kind of time level?</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="setTimeBy" type="SetTimeByType" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>Indicates the style of the macro - specific date or a rolling window</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="closestFromDate" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>Date value; use this when the setTimeBy is set to closest_periods_specific_date_range</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="closestToDate" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>Date value; use this when the the setTimeBy is set to closest_periods_specific_date_range</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="rangeMacro" type="TimeRangeType" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>Use this when setTimeBye is set to rolling_window</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="timePeriods" type="xsd:int" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>timePeriods = Number of time periods</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="offset" type="xsd:int" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>Time period offset</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="label" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+  <xsd:simpleType name="ObsAddOptionType">
+    <xsd:annotation>
+      <xsd:documentation>Different options that one can specify the association/filter for a OBS browse attribute.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="selected_unit_only"/>
+      <xsd:enumeration value="selected_unit_and_below"/>
+      <xsd:enumeration value="selected_unit_and_above"/>
+      <xsd:enumeration value="specific_units"/>
+      <xsd:enumeration value="subunits_of_specific_units"/>
+      <xsd:enumeration value="all_units_within_level"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="TimeLevelType">
+    <xsd:annotation>
+      <xsd:documentation>List of time levels.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="TL_YEAR"/>
+      <xsd:enumeration value="TL_QUARTER"/>
+      <xsd:enumeration value="TL_MONTH"/>
+      <xsd:enumeration value="TL_PERIOD"/>
+      <xsd:enumeration value="TL_WEEK"/>
+      <xsd:enumeration value="TL_DAY"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="SetTimeByType">
+    <xsd:annotation>
+      <xsd:documentation>Possible options for indicating the time period.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="closest_periods_to_daterange"/>
+      <xsd:enumeration value="rolling_window"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="DataProviderType">
+    <xsd:annotation>
+      <xsd:documentation>Possible data providers that could be used to get the Object metadata for list/filter/property views.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="nsql"/>
+      <xsd:enumeration value="object"/>
+      <xsd:enumeration value="system"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="TimeRangeType">
+    <xsd:annotation>
+      <xsd:documentation>List of time macros.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="TODAY"/>
+      <xsd:enumeration value="CURRENT_YEAR"/>
+      <xsd:enumeration value="CURRENT_QUARTER"/>
+      <xsd:enumeration value="CURRENT_MONTH"/>
+      <xsd:enumeration value="CURRENT_WEEK"/>
+      <xsd:enumeration value="CURRENT_PERIOD"/>
+      <xsd:enumeration value="NEXT_YEAR"/>
+      <xsd:enumeration value="NEXT_QUARTER"/>
+      <xsd:enumeration value="NEXT_MONTH"/>
+      <xsd:enumeration value="NEXT_WEEK"/>
+      <xsd:enumeration value="NEXT_PERIOD"/>
+      <xsd:enumeration value="PREVIOUS_YEAR"/>
+      <xsd:enumeration value="PREVIOUS_QUARTER"/>
+      <xsd:enumeration value="PREVIOUS_MONTH"/>
+      <xsd:enumeration value="PREVIOUS_WEEK"/>
+      <xsd:enumeration value="PREVIOUS_PERIOD"/>
+      <xsd:enumeration value="YEAR_TO_DATE"/>
+      <xsd:enumeration value="QUARTER_TO_DATE"/>
+      <xsd:enumeration value="MOMTH_TO_DATE"/>
+      <xsd:enumeration value="WEEK_TO_DATE"/>
+      <xsd:enumeration value="PERIOD_TO_DATE"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:complexType name="LinkParamType">
+    <xsd:sequence>
+      <xsd:element name="nls"       type="NlsType"  minOccurs="0"  maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="paramCode" type="xsd:string" use="required"/>
+    <xsd:attribute name="dataRef" type="xsd:string" use="required"/>
+    <xsd:attribute name="dataSource" type="LinkDataSourceType" use="required"/>
+  </xsd:complexType>
+  <xsd:simpleType name="LinkDataSourceType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Used to specify what source to use for resolving the dataRef attribute.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="data">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">dataRef specifes an attribute (in case of an ODF object) or a column (in case of NSQL) to use to resolve that value to pass</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="input">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">dataRef specifes an XPath in the input document to use for the value</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="static">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">dataRef is the actual value</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:complexType name="ExpressionType">
+    <xsd:annotation>
+      <xsd:documentation>
+        The expression for the filter or portfolio include if there is one.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="value" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+          The expression value
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="uiValue" type="xsd:string" use="optional"/>
+    <xsd:attribute name="whereClause" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/componentDescriptor-2002-02.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/componentDescriptor-2002-02.xsd
new file mode 100644
index 0000000..89f9532
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/componentDescriptor-2002-02.xsd
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns:srv="http://schemas.niku.com/2002/service" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xsd:import namespace="http://schemas.niku.com/2002/service" schemaLocation="service-2002-02.xsd"/>
+  <xsd:include schemaLocation="common-2003-09.xsd"/>
+  <xsd:complexType name="metaDataType">
+    <xsd:attribute name="fileName" type="xsd:string" use="required"/>
+    <xsd:attribute name="version" type="xsd:string" use="optional" default="old"/>
+  </xsd:complexType>
+  <xsd:element name="componentDescriptor">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element name="web" type="webType" minOccurs="0"/>
+        <xsd:element name="persistence" type="persistenceType" minOccurs="0"/>
+        <xsd:element name="objects" type="objectsType" minOccurs="0"/>
+        <xsd:element name="serverListener" type="serverListenerType" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="sessionInitializer" type="sessionInitializerType" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="sessionDestroyer" type="sessionDestroyerType" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="resourceBundle" type="resourceBundleType" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="dataProviders" type="dataProvidersType" minOccurs="0"/>
+        <xsd:element name="customViews" type="customViewsType" minOccurs="0"/>
+        <xsd:element name="events" type="eventsType" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation xml:lang="en">All the eventListeners file for the component</xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+      </xsd:sequence>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:complexType name="persistenceType">
+    <xsd:sequence>
+      <xsd:element name="metaData" type="metaDataType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="webType">
+    <xsd:sequence>
+      <xsd:element name="metaData" type="metaDataType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="serverListenerType">
+    <xsd:attribute name="id" type="xsd:string" use="required"/>
+    <xsd:attribute name="classname" type="xsd:string" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="sessionInitializerType">
+    <xsd:attribute name="id" type="xsd:string" use="required"/>
+    <xsd:attribute name="classname" type="xsd:string" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="sessionDestroyerType">
+    <xsd:attribute name="id" type="xsd:string" use="required"/>
+    <xsd:attribute name="classname" type="xsd:string" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="propertyType">
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="value" type="xsd:string" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="resourceBundleType">
+    <xsd:attribute name="id" type="xsd:string" use="required"/>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="objectsType">
+    <xsd:sequence>
+      <xsd:element name="object" type="objectType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="objectType">
+    <xsd:attribute name="code" use="required">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:maxLength value="20"/>
+          <xsd:pattern value="[a-z,A-Z,0-9,_]+"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="fileName" type="xsd:string" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="dataProvidersType">
+    <xsd:sequence>
+      <xsd:element name="dataProvider" minOccurs="0" maxOccurs="unbounded">
+        <xsd:complexType>
+          <xsd:complexContent>
+            <xsd:extension base="srv:retrieveService">
+              <xsd:attribute name="id" type="xsd:string" use="required">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">A unique identifier for the data provider.  This must be unique across all Niku components and must be preserved or migrated from Niku release to release as customers may create Studio portlets based on this id.</xsd:documentation>
+                </xsd:annotation>
+              </xsd:attribute>
+              <xsd:attribute name="isNewPortletProvider" type="xsd:boolean" default="true">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">When false, the data provider will not show up on the data provider browse popup window for creation of new portlets</xsd:documentation>
+                </xsd:annotation>
+              </xsd:attribute>
+            </xsd:extension>
+          </xsd:complexContent>
+        </xsd:complexType>
+      </xsd:element>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="viewType">
+    <xsd:sequence>
+      <xsd:element name="nls" type="NlsType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="code" type="xsd:string" use="required"/>
+    <xsd:attribute name="location" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="baseViewType">
+    <xsd:sequence>
+      <xsd:element name="view" type="viewType" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="objectCode" type="xsd:string" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="updateViewType">
+    <xsd:sequence>
+      <xsd:element name="view" type="viewType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="nls" type="NlsType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="allowSubPages" type="xsd:boolean" default="true" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="propertyViewSetType">
+    <xsd:sequence>
+      <xsd:element name="create" type="viewType" minOccurs="0"/>
+      <xsd:element name="update" type="updateViewType" minOccurs="0"/>
+      <xsd:element name="nls" type="NlsType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="objectCode" type="xsd:string" use="required"/>
+    <xsd:attribute name="partitionCode" type="xsd:string" use="optional" default="NIKU.ROOT">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The partitionCode of the view set.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="customViewsType">
+    <xsd:sequence>
+      <xsd:element name="listView" type="baseViewType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="propertyView" type="baseViewType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="propertySet" type="propertyViewSetType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="eventsType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">The type definition for a list of events the component "owns"</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="event" type="eventType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="eventType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">The type definition of a event</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="listener" type="srv:processService" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">A listener that is registered to receive the event when it occurs.  Listeners listed here will be invoked in document order.  Only xbl types are supported currently.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="code" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The unique identifier of the event.  Must be unique across all events in the application.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/contentPack-2005-01.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/contentPack-2005-01.xsd
new file mode 100644
index 0000000..2db1e15
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/contentPack-2005-01.xsd
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema
+  targetNamespace="http://schemas.niku.com/2005/contentPack"
+  xmlns="http://schemas.niku.com/2005/contentPack"
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  elementFormDefault="qualified">
+
+  <xsd:include schemaLocation="common-2003-09.xsd"/>
+
+  <xsd:element name="contentPack">
+    <xsd:annotation>
+      <xsd:documentation>
+       The definition of a registered content pack.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexType>
+      <xsd:choice maxOccurs="unbounded">
+        <xsd:element ref="nls"/>
+        <xsd:element ref="database"/>
+        <xsd:element ref="xogFile"/>
+        <xsd:element ref="demo"/>
+      </xsd:choice>
+      <xsd:attribute name="id" type="xsd:string" use="required">
+        <xsd:annotation>
+          <xsd:documentation>
+            The id for this content pack. 
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:attribute>
+      <xsd:attribute name="hasReports" type="xsd:boolean" use="optional">
+        <xsd:annotation>
+          <xsd:documentation>
+            Set if this content pack includes Actuate Reports. 
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:attribute>
+      <xsd:attribute name="hasObjects" type="xsd:boolean" use="optional">
+        <xsd:annotation>
+          <xsd:documentation>
+            Set if this content pack includes Studio Objects, either new or custom attributes. 
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:attribute>
+      <xsd:attribute name="revision" type="xsd:integer" default="100">
+        <xsd:annotation>
+          <xsd:documentation>
+            The current revision of this content pack.
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:attribute>
+    </xsd:complexType>
+  </xsd:element>
+
+  <xsd:element name="nls" type="NlsType"/>
+  <xsd:element name="database" type="PackDatabaseType"/>
+  <xsd:element name="xogFile" type="PackXogType"/>
+  <xsd:element name="demo" type="PackDemoType"/>
+
+  <xsd:complexType name="PackDatabaseType">
+    <xsd:annotation>
+      <xsd:documentation>
+      A registered content pack. Listed by id.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="schemaDir" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+          The folder used for the database schema files, this will usually be the same as the
+          pack id. 
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="driver" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+          The name of the driver file, this is usually driver.xml.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute> 
+  </xsd:complexType>
+
+  <xsd:complexType name="PackXogType">
+    <xsd:annotation>
+      <xsd:documentation>
+      A registered content pack. Listed by id.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="preGenerated" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          The XOG driver file for XOG data that must be imported prior to the generated sequence. 
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="driver" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          The XOG driver file for generated XOG dependencies, always xogDriver.xml if it exists.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="postGenerated" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          The XOG driver file for XOG data that must be imported after the generated sequence. 
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+
+  <xsd:complexType name="PackDemoType">
+    <xsd:annotation>
+      <xsd:documentation>
+        If the content pack has data to be used for demonstration purposes only then this element
+        specifies the location of the file describing this.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="fileName" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+          The definition file for the demo data for the content pack.  The file also uses this schema. 
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/cview-2003-09.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/cview-2003-09.xsd
new file mode 100644
index 0000000..41f4662
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/cview-2003-09.xsd
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xsd:include schemaLocation="cview-types-2003-09.xsd"/>
+  <xsd:element name="customView" type="CustomViewType"/>
+  <xsd:complexType name="CustomViewType">
+    <xsd:sequence>
+      <xsd:element name="property" type="PropertyViewType" minOccurs="0" maxOccurs="1"/>
+      <xsd:element name="filter" type="FilterViewType" minOccurs="0" maxOccurs="1"/>
+    </xsd:sequence>
+    <xsd:attribute name="customizable" type="xsd:boolean" default="true" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>If configurable is false, it means this view is static, and should not be editable, configurable, etc.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:element name="property" type="PropertyViewType">
+    <xsd:annotation>
+      <xsd:documentation>This element is present here so that we can generate the castor beans of this schema.</xsd:documentation>
+    </xsd:annotation>
+  </xsd:element>
+  <xsd:element name="filter" type="FilterViewType">
+    <xsd:annotation>
+      <xsd:documentation>This element is present here so that we can generate the castor beans of this schema.</xsd:documentation>
+    </xsd:annotation>
+  </xsd:element>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/cview-types-2003-09.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/cview-types-2003-09.xsd
new file mode 100644
index 0000000..6c90ebf
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/cview-types-2003-09.xsd
@@ -0,0 +1,922 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xsd:include schemaLocation="common-2003-09.xsd"/>
+  <xsd:simpleType name="SectionState">
+    <xsd:annotation>
+      <xsd:documentation>Specifies the current state of the section - it could be either collapsed or expanded. At present mainly
+               used by filter specific section.
+            </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="collapsed"/>
+      <xsd:enumeration value="expanded"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="LookupMode">
+    <xsd:annotation>
+      <xsd:documentation>
+        The mode to filter on.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="item_only"/>
+      <xsd:enumeration value="item_and_descendents"/>
+      <xsd:enumeration value="item_and_ancestors"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="AvailUnitType">
+    <xsd:annotation>
+      <xsd:documentation>
+        For the availablity browse value, the type of units.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="percent"/>
+      <xsd:enumeration value="hour"/>
+      <xsd:enumeration value="day"/>
+      <xsd:enumeration value="fte"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:complexType name="DataServiceType">
+    <xsd:annotation>
+      <xsd:documentation>Defines an optional DataService for a view</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="type" use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+               Specifies the type of data service for the view. Data services can be java classes or XBL files. In each case
+               the name must be fully qualified: classes prefixed by package, XBL files prefixed with component.
+            </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="java"/>
+          <xsd:enumeration value="xbl"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="ViewFieldDescriptorType">
+    <xsd:annotation>
+      <xsd:documentation>
+            An attribute that is displayed on a form. The attribute may map to a field in a database or it may be a calculated field.
+            The attribute contains the rendering information about the field including its name, type, special instructions to help the
+            user fill out the field, formatting information, and column location.
+         </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="nls" type="NlsType" maxOccurs="unbounded"/>
+      <xsd:element name="instruction" type="NlsType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="toolTip" type="NlsType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="select" type="SelectType" minOccurs="0"/>
+      <xsd:element name="link" type="ViewLinkType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="image" type="ImageType" minOccurs="0"/>
+      <xsd:element name="param" type="ParamType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="defaultValue" type="DefaultValueType" minOccurs="0"/>
+      <xsd:element name="obsBrowseValue" type="ObsBrowseValueType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="skillBrowseValue" type="SkillBrowseValueType" minOccurs="0"/>
+      <xsd:element name="availBrowseValue" type="AvailBrowseValueType" minOccurs="0"/>
+      <xsd:element name="timeBrowseValue" type="TimeBrowseValueType" minOccurs="0"/>
+      <xsd:element name="description" type="NlsType" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+            Used to hold display mapping description text for property pages.
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="attributeCode" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+               The internal name of the attribute. Must match the name of the attribute in the corresponding data document fragment to associate a value with
+               the attribute on the form.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="id" type="xsd:integer" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+               The id of this field in the database. Used by the admin pages to get and save individual fields.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="labelPkId" type="xsd:integer" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+               The label_pk_id of this field in the database. Used by the admin pages to get and save individual fields.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="widgetType" type="WidgetType" use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+               The type of the attribute. Different types use different controls during rendering.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="required" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+               Determines whether the form displays the required icon next to the attribute. Used to show visual cues to the
+               user that the attribute value must be provided upon submission.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="presenceRequired" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+               Determines whether the attribute must be present on all forms.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="width" type="xsd:integer">
+      <xsd:annotation>
+        <xsd:documentation>
+               Specifies how long to make the control. This does not limit the amount of data that can be entered in the
+               control, just how big to make the control on the form. Limitations on the amount of data are taken from the
+               data document fragment.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="unique" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+               Determines whether the form displays the unique icon next to the attribute. Used to show visual cues to the
+               user that the attribute value must be unique upon submission.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="virtual" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+               Specifies whether the attribute resides in the database or not. If set to true the attribute is a calculated
+               field.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="hidden" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+               Specifies that the attribute is hidden. Causes the attribute to be rendered with the "hidden" attribute.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="midnightDate" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+               Specifies whether the field (a date field) should be treated as a finish date for the purpose of rolling back the day
+               precision to the previous day when calculating durations.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="readOnly" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+               Specifies that the attribute is read only and that the control should be rendered disabled on the form.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="locked" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+          Specifies that the attribute is currently locked for editing for some reason. Most likely because a running process has locked it for a given instance.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="enterOnce" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+               Determines whether the form displays the enter once icon next to the attribute. Used to show visual cues to the
+               user that the attribute value must be entered only once upon submission.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="extType">
+      <xsd:annotation>
+        <xsd:documentation>
+               Allows for more granular specification of a type as well as providing formatting hints. An attribute of widgetType="datepicker" may
+               have an extType of timestamp to indicate the value should be formatted with time precision. Also, an attribute of widgetType="numeric"
+               may have an extType="percent" to indicate the value should be formatted as a percent.
+            </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="enum"/>
+          <xsd:enumeration value="timestamp"/>
+          <xsd:enumeration value="money"/>
+          <xsd:enumeration value="percent"/>
+          <xsd:enumeration value="boolean"/>
+          <xsd:enumeration value="double"/>
+          <xsd:enumeration value="skill_browse"/>
+          <xsd:enumeration value="avail_browse"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="decimals" type="xsd:integer">
+      <xsd:annotation>
+        <xsd:documentation>
+               Used for formatting doubles, percent, money fields. Specifies the number of decimal places to render.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="dataSize" type="xsd:integer">
+      <xsd:annotation>
+        <xsd:documentation>
+              The size of the database field to limit the amount of input a user can enter.
+           </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="maxValue" type="xsd:string" use="optional"/>
+    <xsd:attribute name="minValue" type="xsd:string" use="optional"/>
+    <xsd:attribute name="numRows" type="xsd:integer" use="optional"/>
+    <xsd:attribute name="numCols" type="xsd:integer" use="optional"/>
+    <xsd:attribute name="lookupType" type="xsd:string" use="optional"/>
+    <xsd:attribute name="multiValued" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="currencyAttribute" type="xsd:string" use="optional"/>
+    <xsd:attribute name="currencyConnected" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="fixedWidget" type="xsd:boolean" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+                     Specifies if the widget type of this attribute is fixed, ie not even the administrator
+                     can change it.  Its intended for use within the DefaultDisplayType element, and may have
+                     no effect inside a section element.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="extendedWidgetType" type="ExtendedWidgetType" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          Specifies additional information to aid in rendering. Used primarily for display mappings
+          to indicate if an attribute is to rendered as a text, text + icon, or text + icon + description or text + description.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="dependentEntry" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+               If the lookup is a dependent lookup, then this is the lookup type that the browse can not go above.  For example when
+               there is Country/State/City, if the dependentEntry was Country, then the browse would look over all the whole tree.
+
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="dependentExit" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+               If the lookup is a dependent lookup, then this is the lookup type that is returned  For example when
+               there is Country/State/City, if the dependentExit was Country, then the browse would return a City.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="dependentParentLookup" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+              If the lookup is a dependent lookup, then this is the optional parent node that is allowed to be searched over.  So in the
+              dependentEntry example below if you set the dependentParentLookup to USA you would only search over USA states
+              and cities.  NOTE:  The dependentParentLookup must be a parent lookup of the dependentEntry.  So, you could not pick
+              USA as the parentLookup and Country as the entry.  The entry must be state for USA.
+           </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="xpathExpression" type="xsd:string" use="optional"/>
+    <xsd:attribute name="notEqualXPath" type="xsd:boolean" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation>
+               Used with the xpath expression.  If this is set to true, then the query will build a not equals expression
+               against the value found in the xpath expression.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="aggregate" type="xsd:boolean" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation>
+           Used for NSQL parameters only.  This is when parameters are part of the @HAVING_FILTER@ NSQL
+           construct.  When the NSQL is converted to an object and a attribute is part of the HAVING_FILTER
+           then this flag is true.  This flag is used by the expression builder which will ignore these
+           types of attributes.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="forceLocalize" type="xsd:boolean" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation>
+          Used by developers to tell the view loaders that a virtual custom field defined
+          in the cview is subject to localization processing. This is not stored in the database
+          and is not subject to XOG.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="showValue" type="xsd:boolean" use="optional" default="true">
+      <xsd:annotation>
+        <xsd:documentation>
+          Used by to determine whether to show the value for a formula field or not. Customizable
+          in the admin UI using the Value checkbox.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="modeEnabledLookup" type="xsd:boolean" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation>
+          Used by to determine whether to show the lookupmode pulldown for filter panes.  This attribute
+          is populated from the lookup, so it is virtual.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="active" type="xsd:boolean" use="optional" default="true">
+      <xsd:annotation>
+        <xsd:documentation>
+          From the object attribute.  If the attribute is active or not.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="isMVLookup" type="xsd:boolean" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation>
+          Used by to determine whether to attribute is stored as a multi-valued lookup or not.  The isMultiValued above
+          determines if the Select Widget can handle multiple options, but it does not differentiate between a object attribute
+          types Lookup and MVLookup.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="ViewColumnType">
+    <xsd:annotation>
+      <xsd:documentation>
+         A property or filter view is broken up by columns or sections. The attributes are placed in a column
+         by their column number stored with the view attribute in the database.
+       </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="viewFieldDescriptor" type="ViewFieldDescriptorType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="sequence" type="xsd:integer" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          The order of the column in the section or view. Used during XOG to set the COLUMN field in ODF_VIEW_ATTRIUBTES.
+          If absent the order of the column elements in the XML document determines the sequence.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="DefaultDisplayType">
+    <xsd:annotation>
+      <xsd:documentation>
+         For the object this is the set of attributes for which the display type overrides the default.
+         This would be used in a list view, where there is a numeric attribute and it is to be displayed
+         as a stoplight.
+       </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="viewFieldDescriptor" type="ViewFieldDescriptorType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="sequence" type="xsd:integer" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          The order of the column in the section or view. Used during XOG to set the COLUMN field in ODF_VIEW_ATTRIUBTES.
+          If absent the order of the column elements in the XML document determines the sequence.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="ViewSectionType">
+    <xsd:annotation>
+      <xsd:documentation>
+            Specifies the section for the property view. A property view can be broken into sections, e.g., the General, Management, Financial, Opportunity, and Custom
+            sections for the project properties. Each section can have a list of attributes associated with it.
+         </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="ViewColumnType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="nls" type="NlsType" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+             Specifies the name of the section for display purposes.
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="sequence" type="xsd:integer" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+               The order the section displays on the page. Sections can be re-ordered in the administration UI.
+               Used by XOGs to set the DISPLAY_ORDER in the ODF_VIEW_SECTIONS table. If absent the order of the
+               section elements in the XML document determines the sequence.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="collapsed" type="xsd:boolean" use="optional" default="true"/>
+    <xsd:attribute name="filterByExpression" type="xsd:boolean" use="optional" default="true"/>
+    <xsd:attribute name="currentState" type="SectionState" use="optional" default="collapsed"/>
+    <xsd:attribute name="id" type="xsd:integer" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+               The id of this section in the database. Used by the admin pages to get and save individual sections.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="PropertyViewType">
+    <xsd:annotation>
+      <xsd:documentation>
+            The root element of an odf property view document fragment. The odf property view document describes the layout of
+            a property view of an odf object or odf property view that spans multiple odf objects.
+         </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="ViewColumnType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="section" type="ViewSectionType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="nls" type="NlsType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="defaultDisplay" type="DefaultDisplayType" minOccurs="0"/>
+      <xsd:element name="expression" type="ExpressionType" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:integer">
+      <xsd:annotation>
+        <xsd:documentation>
+                  The id of this view. This is used to save this view in the database.
+                </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="code" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+                  The name of this view. This is used to identify this view for administration purposes.
+                </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="type" use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+                    The type of this view. Property views can be of type:
+                        default (used as both an update and a create property page or default filter)
+                        update  (specialized update view)
+                        create  (specialized create view)
+                </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="default"/>
+          <xsd:enumeration value="update"/>
+          <xsd:enumeration value="create"/>
+          <xsd:enumeration value="filter"/>
+          <xsd:enumeration value="fieldList"/>
+          <xsd:enumeration value="master"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="objectCode" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+                    The associated object for this view. It is optional because it applies only to the simple case where the
+                    view can be associated with a single object, i.e., properties for Project. In a more complex case where
+                    the view may be associated with multiple objects a data service would be used to provide the object meta-data
+                    and this attribute would not be used.
+                </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="sequence" type="xsd:integer" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          The order of the view. For update properties pages this determines the order
+          of the sub pages.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="componentId" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          The component this view belongs to. Used by the administration pages to find objects, etc.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="partitionCode" type="xsd:string" default="NIKU.ROOT">
+      <xsd:annotation>
+        <xsd:documentation>
+          The partition this view is for.  The partition model of the object is used to determine
+          the unique partition.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="isSystem" type="xsd:boolean" default="true">
+      <xsd:annotation>
+        <xsd:documentation>
+          Indicates whether this view is a seeded (system) view.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="isCustomized" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation>
+          Indicates whether this view is customized.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="readOnly" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation>
+          Indicates whether this view is read only.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="linkCode" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          The link code that corresponds to this subpage, only used for update pages.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="isSecure" type="xsd:boolean" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          Indicates whether this view is subject to security NAVIGATE and EDIT
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="SelectType">
+    <xsd:annotation>
+      <xsd:documentation>
+            Groups the options displayed in a selection drop down for a widgetType="select" attribute.
+         </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:annotation>
+        <xsd:documentation>
+          List of options to display in the selection drop down.
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:element name="option" type="OptionType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="OptionType">
+    <xsd:annotation>
+      <xsd:documentation>
+        Describes the option values displayed in a selection drop down for a widgetType="select" attribute.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="value" type="xsd:string" use="required"/>
+    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+    <xsd:attribute name="defaultSelection" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+          Denotes the selection that should show as the default.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="ViewLinkType">
+    <xsd:annotation>
+      <xsd:documentation>
+            Specifies the attribute is an html link. Sub-elements of the link represent the parameter names and values for the link.
+         </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="param" type="ParamType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="code" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+           Specifies the code of the link. Used by XOG to store the link codes in odf_view_attributes.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="action" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation>
+               The action invoked when the link is clicked.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="ParamType">
+    <xsd:annotation>
+      <xsd:documentation>
+            Describes the parameter names and values for a link.
+         </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="ref" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+               The reference for the parameter - can be an attribute in the object, a static value, or a reference into the document.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="source" use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+               The determines where to get the parameters (can be static, input, or data).
+            </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="static"/>
+          <xsd:enumeration value="data"/>
+          <xsd:enumeration value="input"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="code" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+               The code of the parameter - usually corresponds to the name of the parameter,
+               however can be special values of ~target~ or ~actionSuffix~.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="name" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+               The name of the parameter - as used for progress bar, has values like stageName.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="LookupValueType">
+    <xsd:annotation>
+      <xsd:documentation>Filter value that contains one or more lookup values.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="code" type="xsd:string" use="optional"/>
+    <xsd:attribute name="value" type="xsd:string" use="optional"/>
+    <xsd:attribute name="lookupType" type="xsd:string" use="optional"/>
+    <xsd:attribute name="mode" type="LookupMode" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="FilterValueType">
+    <xsd:annotation>
+      <xsd:documentation>A filter value that is part of a saved filter set.
+
+If the filter is a display mapping field then it will have a child displayMappingValue element. This will specify the WHERE clause required to execute the query.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="obsBrowseValue" type="ObsBrowseValueType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="skillBrowseValue" type="SkillBrowseValueType" minOccurs="0"/>
+      <xsd:element name="availBrowseValue" type="AvailBrowseValueType" minOccurs="0"/>
+      <xsd:element name="timeBrowseValue" type="TimeBrowseValueType" minOccurs="0"/>
+      <xsd:element name="lookupValue" type="LookupValueType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="displayMappingValue" type="ExpressionType" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:int" use="optional"/>
+    <xsd:attribute name="code" type="xsd:string" use="optional"/>
+    <xsd:attribute name="value" type="xsd:string" use="optional"/>
+    <xsd:attribute name="pmdParamName" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="FilterValueSetType">
+    <xsd:annotation>
+      <xsd:documentation>A named, saved filter set. </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="filterValue" type="FilterValueType" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>A key-value pair. It gives the value for each attribute in a attribute set.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:int" use="optional"/>
+    <xsd:attribute name="userId" type="xsd:string" use="optional"/>
+    <xsd:attribute name="default" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="name" type="xsd:string" use="optional"/>
+    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+    <xsd:attribute name="objectId" type="xsd:int" use="optional"/>
+    <xsd:attribute name="objectInstanceId" type="xsd:int" use="optional"/>
+    <xsd:attribute name="system" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="sessionId" type="xsd:string" use="optional"/>
+    <xsd:attribute name="instanceId" type="xsd:int" use="optional"/>
+    <xsd:attribute name="selected" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="hasUserSubmitted" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation>true when a user has submitted a value set, i.e. clicked on the Filter or Show All button</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="objectCode" type="xsd:string" use="optional"/>
+    <xsd:attribute name="viewCode" type="xsd:string" use="optional"/>
+    <xsd:attribute name="portletInstanceCode" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="FilterViewType">
+    <xsd:annotation>
+      <xsd:documentation>Definition of a filter view. A filter view can contain zero or one section. It may not have a section - specifically when there are no filter fields are defined then there won't be any section.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="section" type="ViewSectionType" minOccurs="0"/>
+      <xsd:element name="filterValueSet" type="FilterValueSetType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="defaultDisplay" type="DefaultDisplayType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="expression" type="ExpressionType" minOccurs="0"/>
+      <xsd:element name="subObject" type="SubObjectType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="code" type="xsd:string" use="required"/>
+    <xsd:attribute name="objectCode" type="xsd:string" use="optional"/>
+    <xsd:attribute name="parentObjectCode" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          If there is an object associated with the view and it has a parent, this is the parent object code.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="componentCode" type="xsd:string" use="optional"/>
+    <xsd:attribute name="dataProviderType" type="DataProviderType" use="optional" default="object">
+      <xsd:annotation>
+        <xsd:documentation>
+               Specifies the type of data service for the view. Data services can be either object or system.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="dataProviderId" type="xsd:string" use="optional"/>
+    <xsd:attribute name="id" type="xsd:integer" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+                  The id of this view. This is used to save this view in the database.
+                </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="obsTableNameKey" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          Gets loaded from the object when the object is obs enabled.  The value of the obsTableNameKey is the
+          corresponding value in column TABLE_NAME from the PRJ_OBS_ASSOCIATIONS table.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="partitionCode" type="xsd:string" default="NIKU.ROOT">
+      <xsd:annotation>
+        <xsd:documentation>
+          The partition this view is for.  The partition model of the object is used to determine
+          the unique partition.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="isCustomized" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation>
+          Indicates if this view has been customized or not.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="DefaultValueType">
+    <xsd:annotation>
+      <xsd:documentation>Describes the default values for a viewFieldDescriptor.
+
+If it's a obs, time or a multi-select browse field then one can specify default values using the child elements.
+
+For all other simple fields (string,numeric, boolean and date) one will specify values using the value attribute of this element.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="obsBrowseValue" type="ObsBrowseValueType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="skillBrowseValue" type="SkillBrowseValueType" minOccurs="0"/>
+      <xsd:element name="availBrowseValue" type="AvailBrowseValueType" minOccurs="0"/>
+      <xsd:element name="timeBrowseValue" type="TimeBrowseValueType" minOccurs="0"/>
+      <xsd:element name="lookupValue" type="LookupValueType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="document" type="DocumentType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="value" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          The default value
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="replace" type="MacroType" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="SkillBrowseValueType">
+    <xsd:annotation>
+      <xsd:documentation>
+        A complex type to represent the value of a Skill browse attribute.
+        This specifies the additional information (meta data) required to render
+        and register this special type of attribute.
+        minimumMatch - The minimum percent of skills that that should be returned for filtering.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="skillValue" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+            Each skill that is selected
+          </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+          <xsd:attribute name="value" type="xsd:string" use="optional">
+            <xsd:annotation>
+              <xsd:documentation>
+                The complete value that is displayed in the browse box.  This is not stored in the database, but created in the service and returned to the vxsl.
+              </xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="skillId" type="xsd:long" use="required">
+            <xsd:annotation>
+              <xsd:documentation>
+                The primary key of the skill.
+              </xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="skillCode" type="xsd:string">
+            <xsd:annotation>
+              <xsd:documentation>
+                The skill code of the skill. Used only in XOG.
+              </xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="weight" type="xsd:long" use="required">
+            <xsd:annotation>
+              <xsd:documentation>
+                The weight of the skill.
+              </xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="proficiencyLevel" type="xsd:long" use="required">
+            <xsd:annotation>
+              <xsd:documentation>
+                The proficiency of the skill.
+              </xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="interestLevel" type="xsd:long" use="required">
+            <xsd:annotation>
+              <xsd:documentation>
+                The interest of the skill.
+              </xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+        </xsd:complexType>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="minimumMatch" type="xsd:integer" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          The minimum percent of skills that that should be returned for filtering.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="AvailBrowseValueType">
+    <xsd:annotation>
+      <xsd:documentation>
+        A complex type to represent the value of a availablity browse attribute.
+        This specifies the additional information (meta data) required to render
+        and register this special type of attribute.
+        minimumMatch - The minimum percent of availablity that that should be returned for filtering.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="availValue" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+            Each Availablity that is selected
+          </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+          <xsd:attribute name="value" type="xsd:string" use="optional">
+            <xsd:annotation>
+              <xsd:documentation>
+                The complete value that is displayed in the browse box.  This is not stored in the database, but created in the service and returned to the vxsl.
+              </xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="unitType" type="AvailUnitType" use="required">
+            <xsd:annotation>
+              <xsd:documentation>
+                The type of availablity needed.
+              </xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="quantity" type="xsd:double" use="required">
+            <xsd:annotation>
+              <xsd:documentation>
+                The amount availablity needed.
+              </xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="startDate" type="xsd:date" use="required">
+            <xsd:annotation>
+              <xsd:documentation>
+                The start of the availablity segment.
+              </xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="endDate" type="xsd:date" use="required">
+            <xsd:annotation>
+              <xsd:documentation>
+                The end of the availablity segment.
+              </xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+        </xsd:complexType>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="minimumMatch" type="xsd:integer" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>
+          The minimum percent of availablity that that should be returned for filtering.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="includeSoftBooking" type="xsd:boolean" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation>
+          Flag to determine if softbooking segments are okay or not.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="SubObjectType">
+    <xsd:attribute name="code" type="xsd:string" use="required"/>
+  </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/dataProvider-2003-09.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/dataProvider-2003-09.xsd
new file mode 100644
index 0000000..3ff7f37
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/dataProvider-2003-09.xsd
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://schemas.niku.com/2003/dataProvider" xmlns="http://schemas.niku.com/2003/dataProvider" xmlns:srv="http://schemas.niku.com/2002/service" xmlns:object="http://schemas.niku.com/2002/objectTypes" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+  <xsd:import namespace="http://schemas.niku.com/2002/service" schemaLocation="service-2002-02.xsd"/>
+  <xsd:import namespace="http://schemas.niku.com/2002/objectTypes" schemaLocation="object-types-2003-09.xsd"/>
+  <xsd:element name="dataProvider" type="DataProviderType">
+    <xsd:annotation>
+      <xsd:documentation>The root element of a data provider.  This metadata follows the structure of a multi-dimensional OLAP cube.</xsd:documentation>
+    </xsd:annotation>
+  </xsd:element>
+  <xsd:complexType name="DataProviderType">
+    <xsd:annotation>
+      <xsd:documentation>A complex type that describes the structural metadata of a data provider.  This structure follows the model of a OLAP cube.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="retrieveService" type="srv:retrieveService" minOccurs="0"/>
+      <xsd:element name="dimension" type="DimensionType" maxOccurs="unbounded"/>
+      <xsd:element name="metric" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="parameter" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="links" type="object:LinksType" minOccurs="0"/>
+      <xsd:element name="object" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>An object used by the data provider.  If an data provider aggregates or "wraps" an object, this element "publishes" such objects as being used by the provider.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+          <xsd:attribute name="code" type="xsd:string" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The object code</xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="id" type="xsd:integer" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The object code</xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+        </xsd:complexType>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="code" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation>The internal code</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="name" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation>The UI displayable name</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="obsTableNameKey" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="DimensionType">
+    <xsd:annotation>
+      <xsd:documentation>A dimension of the cube.  Dimensions are a structural attribute of a cube which are organized into a hierarchical set of categories that describe metrics from a fact table.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="nls" type="object:NlsType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="property" type="PropertyType" maxOccurs="unbounded"/>
+      <xsd:element name="level" minOccurs="0" maxOccurs="unbounded">
+        <xsd:complexType>
+          <xsd:annotation>
+            <xsd:documentation>A level within a dimension</xsd:documentation>
+          </xsd:annotation>
+          <xsd:attribute name="name" type="xsd:string" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The name of the level</xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="key" type="xsd:string" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The name of the property that is the key of the level</xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+        </xsd:complexType>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="code" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation>The internal code</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="name" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation>The ui displayable name</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="location" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>When the data provider returns the data in XML form, this attribute specifies the XPath location of the root node of the dimension.  For lists, this node can repeat.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="PropertyType">
+    <xsd:annotation>
+      <xsd:documentation>A complex type that describes a Property (aka Field or Attribute)</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="nls" type="object:NlsType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="readExpression" type="object:AugmentSQLType" minOccurs="0" maxOccurs="2"/>
+      <xsd:element name="displayMapping" type="object:DisplayMappingType" minOccurs="0"/>
+      <xsd:element name="uomConversion" minOccurs="0" maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>A unit of measure conversion supported by the data provider.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+          <xsd:attribute name="code" type="xsd:string" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The unit of measure conversion code</xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+        </xsd:complexType>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="code" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation>The internal code</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="name" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation>The name of the property for the UI</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="key" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation>The name of the property that is the key of the level</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="custom" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+             Indicates that the field is a custom field. Used during submission to save data to the satellite
+             tables for custom data.
+          </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="dataType" type="object:DataType">
+      <xsd:annotation>
+        <xsd:documentation>
+             The data type of the property
+          </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="extDataType" type="object:ExtendedType">
+      <xsd:annotation>
+        <xsd:documentation>
+             The extended data type of the property
+          </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="scale" type="xsd:int">
+      <xsd:annotation>
+        <xsd:documentation>
+             The scale of the property, i.e. number of decimal places
+          </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="timeScalable" type="object:TimeScaleType">
+      <xsd:annotation>
+        <xsd:documentation>
+             Determines the time scalable capabilities of the property
+          </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="length" type="xsd:integer">
+      <xsd:annotation>
+        <xsd:documentation>
+            The size of the data. Used by the view engines to limit input on forms.
+          </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="sortable" type="xsd:boolean" default="true">
+      <xsd:annotation>
+        <xsd:documentation>When true, this property can be sorted on.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="required" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+            Indicates that the field is required when updating the object to the persistence layer.
+          </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="unique" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+            Indicates that the field must be unique when updating the object to the persistence layer.
+          </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="readonly" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+            Indicates that the field cannot be updated during submission of the object to the persistence layer.
+          </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="enterOnce" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+            Indicates that the field cannot be updated more than once when the object is updated to the persistence layer.
+          </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="virtual" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+            Indicates that the field is calculated and doesn't reside in the database.
+          </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="active" type="xsd:boolean" default="true"/>
+    <xsd:attribute name="private" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+            Indicates that the field is generated by the system.
+          </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="lookupType" type="xsd:string"/>
+    <xsd:attribute name="multiValued" type="xsd:boolean"/>
+    <xsd:attribute name="currencyAttribute" type="xsd:string"/>
+    <xsd:attribute name="currencyConnected" type="xsd:boolean"/>
+    <xsd:attribute name="dependentEntry" type="xsd:string"/>
+    <xsd:attribute name="dependentExit" type="xsd:string"/>
+    <xsd:attribute name="dependentParentLookup" type="xsd:string"/>
+    <xsd:attribute name="exact" type="xsd:boolean" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation>
+               Used for NSQL parameters when there can only be one value.  So, the attribute cannot be multivalued and cannot
+               have a wildcard.  This does value does not need to be persisted to the database because it is only for NSQL.  The
+               reason it is in the schema is because the NSQL gets converted to and Object for ODF.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="gridEditable" type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+            Indicates that the field is editable within a grid.
+          </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/dataValidation-2002-02.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/dataValidation-2002-02.xsd
new file mode 100644
index 0000000..9f00e03
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/dataValidation-2002-02.xsd
@@ -0,0 +1,964 @@
+<?xml version="1.0"?>
+<xsd:schema targetNamespace="http://schemas.niku.com/2002/dvml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.niku.com/2002/dvml" elementFormDefault="qualified">
+  <xsd:annotation>
+    <xsd:documentation>
+      This schema defines a set of complex validation rules against a single attribute within an data XML file or several attributes such as attributes
+      containing begin and end dates.
+    </xsd:documentation>
+  </xsd:annotation>
+  <xsd:simpleType name="operatorType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">
+        The operator to check the count of the fields against
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="equals"/>
+      <xsd:enumeration value="notEquals"/>
+      <xsd:enumeration value="greaterThan"/>
+      <xsd:enumeration value="lessThan"/>
+      <xsd:enumeration value="greaterEquals"/>
+      <xsd:enumeration value="lessEquals"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="typeType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="integer"/>
+      <xsd:enumeration value="double"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:element name="dataValidation">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element name="singleField" minOccurs="0" maxOccurs="unbounded">
+          <xsd:annotation>
+            <xsd:documentation/>
+          </xsd:annotation>
+          <xsd:complexType>
+            <xsd:sequence>
+              <xsd:element name="checkRequired" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    The input field specified must be present and not null.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkSoftRequired" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    The input field specified must be not-null if present. This is different than checkRequired in that if the attribute wasn't submitted at all it's not raised as an exception. This will be used in the case where there are multple views of an object and the valdation is generated for the entire object. In this case the absense of the attribute just means that it wasn't present on the age in the first place.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkDateFormat" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en"/>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="formatErrorCode" type="xsd:string" use="optional" default="validation.dateNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="pmMinDateErrorCode" type="xsd:string" use="optional" default="validation.finishDateLessThanMinimum">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="minDateErrorCode" type="xsd:string" use="optional" default="validation.startDateLessThanMinimum">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="pmMaxDateErrorCode" type="xsd:string" use="optional" default="validation.finishDateExceedsMaximum">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="maxDateErrorCode" type="xsd:string" use="optional" default="validation.startDateExceedsMaximum">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="pm" type="xsd:boolean" use="optional" default="false">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkTimeFormat" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en"/>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.timeNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkDateTimeFormat" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en"/>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.dateTimeNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkNumberFormat" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks that the field is a number
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.numberNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="type" type="typeType" use="optional" default="double">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="decimalPlaces" type="xsd:integer">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkCurrencyFormat" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks that the field is a number
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.currencyNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="type" type="typeType" use="optional" default="double">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="decimalPlaces" type="xsd:integer">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkNumberRange" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks a number is within the (hard coded) range specified.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="start" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="end" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="type" type="typeType" use="optional" default="double">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Valid types are integer or double (default)
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="decimalPlaces" type="xsd:integer">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="rangeErrorCode" type="xsd:string" use="optional" default="validation.numberNotWithinRange">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="formatErrorCode" type="xsd:string" use="optional" default="validation.numberNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkPercentRange" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks a number is within the (hard coded) range specified.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="start" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="end" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="type" type="typeType" use="optional" default="double">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Valid types are int or double (default)
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="rangeErrorCode" type="xsd:string" use="optional" default="validation.numberNotWithinRange">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="formatErrorCode" type="xsd:string" use="optional" default="validation.numberNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkCurrencyRange" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks a number is within the (hard coded) range specified.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="start" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="end" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="rangeErrorCode" type="xsd:string" use="optional" default="validation.numberNotWithinRange">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="formatErrorCode" type="xsd:string" use="optional" default="validation.numberNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="decimalPlaces" type="xsd:integer">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkDateValueRange" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks a date is within the (hard coded) range specified. Not to be confused with the multi-field checkDateRange.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="start" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="end" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="minute" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="hour" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="rangeErrorCode" type="xsd:string" use="optional" default="validation.numberNotWithinRange">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="formatErrorCode" type="xsd:string" use="optional" default="validation.numberNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="rangeFormatErrorCode" type="xsd:string" use="optional" default="validation.rangeFormatNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkPositive" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks if a number is positive.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="includeZero" type="xsd:boolean" use="optional" default="false">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Allows you to specify whether to include 0 as a positive value for greater than or equal to 0 comparisions.
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="type" type="typeType" use="optional" default="double">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Valid types are int or double (default)
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="positiveErrorCode" type="xsd:string" use="optional" default="validation.numberNotGreaterThan">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="formatErrorCode" type="xsd:string" use="optional" default="validation.numberNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkNegative" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks if a number is negative.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="includeZero" type="xsd:boolean" use="optional" default="false">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Allows you to specify whether to include 0 as a positive value for less than or equal to 0 comparisions.
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="type" type="typeType" use="optional" default="double">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Valid types are int or double (default)
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="negativeErrorCode" type="xsd:string" use="optional" default="validation.numberNotGreaterThan">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="formatErrorCode" type="xsd:string" use="optional" default="validation.numberNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkGreaterThan" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks a number is greater than the (hard coded) compare to value specified.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="compareTo" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="type" type="typeType" use="optional" default="double">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Valid types are int or double (default)
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="greaterThanErrorCode" type="xsd:string" use="optional" default="validation.numberNotGreaterThan">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="formatErrorCode" type="xsd:string" use="optional" default="validation.numberNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkLessThan" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks a number is less than the (hard coded) compare to value specified.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="compareTo" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="type" type="typeType" use="optional" default="double">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Valid types are int or double (default)
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="lessThanErrorCode" type="xsd:string" use="optional" default="validation.numberNotLessThan">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="formatErrorCode" type="xsd:string" use="optional" default="validation.numberNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkPercentFormat" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks the field is a percent format
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="decimalPlaces" type="xsd:integer">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="type" type="typeType" use="optional" default="double">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.percentNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkDataSize" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                     Checks the size of the data in a field
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:sequence>
+                    <xsd:element name="errorInfo" minOccurs="0">
+                      <xsd:complexType>
+                        <xsd:sequence>
+                          <xsd:element name="param" maxOccurs="unbounded">
+                            <xsd:complexType>
+                              <xsd:attribute name="key" type="xsd:string" use="optional">
+                                <xsd:annotation>
+                                  <xsd:documentation xml:lang="en"/>
+                                </xsd:annotation>
+                              </xsd:attribute>
+                              <xsd:attribute name="value" type="xsd:string" use="optional">
+                                <xsd:annotation>
+                                  <xsd:documentation xml:lang="en"/>
+                                </xsd:annotation>
+                              </xsd:attribute>
+                            </xsd:complexType>
+                          </xsd:element>
+                        </xsd:sequence>
+                        <xsd:attribute name="bundle" type="xsd:string" use="optional">
+                          <xsd:annotation>
+                            <xsd:documentation xml:lang="en"/>
+                          </xsd:annotation>
+                        </xsd:attribute>
+                      </xsd:complexType>
+                    </xsd:element>
+                  </xsd:sequence>
+                  <xsd:attribute name="minSize" type="xsd:integer" use="optional" default="0">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="maxSize" type="xsd:integer" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="minSizeErrorCode" type="xsd:string" use="optional" default="validation.dataNotMinSize">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="maxSizeErrorCode" type="xsd:string" use="optional" default="validation.dataNotMaxSize">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkNotAllowed" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    The input field specified must NOT be present or be null.  If a compareValue is specified.  This will
+                    check to make sure the value isn't the same as the one specified.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.notAllowed">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="compareValue" type="xsd:string" use="optional">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        If the compareValue is specified, then the value is not allowed to match the compareValue.
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkRegExp" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    The input field specified must match a Reg Exp format.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.regexp">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="expression" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        The regular expression that is being used to compare the value to.
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="matches" type="xsd:boolean" use="optional" default="true">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Flag to determine if you want an error if there is a match (matches=true),
+                        or if you want an error if thre is NOT a match (matches=false).
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="case" use="optional" default="mixed">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        What case to do the match in, can be set to lower, upper or mixed (ie don't change).
+                      </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                      <xsd:restriction base="xsd:string">
+                        <xsd:enumeration value="lower"/>
+                        <xsd:enumeration value="upper"/>
+                        <xsd:enumeration value="mixed"/>
+                      </xsd:restriction>
+                    </xsd:simpleType>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkXPathExp" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    The input field specified will be flagged as error if the XPath does not evaluate to true.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="expression" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        The XPath expression that needs to evaluate to true.
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkAlphaNumeric" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    Checks for alphanumericness
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.alphanumeric">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkDateTime" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks a datetime ODF attribute is correct for date, hour and minute.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="minute" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        The attribute in the input document containing the minute value
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="hour" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        The attribute in the input document containing the hour value
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="formatErrorCode" type="xsd:string" use="optional" default="validation.numberNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+            </xsd:sequence>
+            <xsd:attribute name="name" type="xsd:string" use="required">
+              <xsd:annotation>
+                <xsd:documentation xml:lang="en">
+                  XPath to the attribute to be validated
+                </xsd:documentation>
+              </xsd:annotation>
+            </xsd:attribute>
+          </xsd:complexType>
+        </xsd:element>
+        <xsd:element name="multiField" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation/>
+          </xsd:annotation>
+          <xsd:complexType>
+            <xsd:sequence>
+              <xsd:element name="checkRequiredOr" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks that at least one of the values is present
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:sequence>
+                    <xsd:element name="requiredField" minOccurs="0" maxOccurs="unbounded">
+                      <xsd:complexType>
+                        <xsd:attribute name="field" type="xsd:string" use="required">
+                          <xsd:annotation>
+                            <xsd:documentation xml:lang="en">
+                              XPath to the field
+                            </xsd:documentation>
+                          </xsd:annotation>
+                        </xsd:attribute>
+                      </xsd:complexType>
+                    </xsd:element>
+                  </xsd:sequence>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.atLeastOneRequiredField">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="exclusiveErrorCode" type="xsd:string" use="optional" default="validation.onlyOneRequiredField">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="exclusive" type="xsd:boolean" use="optional" default="false">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        If exclusive is set to true then only one can be filled in.  Otherwise both is okay.
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkRequiredAllOrNone" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                     Checks that all fields are present.  Or that none of the fields are present.
+                     This is valuable if you have an editable grid and you want to make sure people fill out a complete
+                     row of the grid, but they can leave other rows empty.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:sequence>
+                    <xsd:element name="requiredField" minOccurs="0" maxOccurs="unbounded">
+                      <xsd:complexType>
+                        <xsd:attribute name="field" type="xsd:string" use="required">
+                          <xsd:annotation>
+                            <xsd:documentation xml:lang="en">
+                              XPath to the field
+                            </xsd:documentation>
+                          </xsd:annotation>
+                        </xsd:attribute>
+                      </xsd:complexType>
+                    </xsd:element>
+                  </xsd:sequence>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.allOrNoneRequiredField">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkUniqueValue" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks that the two values specified are unique
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="first" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        XPath to first value
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="second" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        XPath to second value
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.valueNotUnique">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkNotSameValue" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks that the two values specified are the same.  Used to confirm values.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="first" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        XPath to first value
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="second" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        XPath to second value
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.valueNotSame">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkCount" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks that there is a certain number of elements passed.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="field" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        XPath to field value
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="count" type="xsd:int" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        The count that is being checked against
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="operator" type="operatorType" use="optional" default="equals"/>
+                  <xsd:attribute name="errorCode" type="xsd:string" use="optional" default="validation.invalidCount">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkDateRange" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    The dates are checked that the start is less than the end, unless the cannotBeEqual
+                    is set to true in which case they can be equal.
+                    The fields need to have been checked as valid dates prior to this
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="start" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Xpath to start value for range check
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="end" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        XPath to end value for range check
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="cannotEqual" type="xsd:boolean" use="optional" default="false">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Set if the two dates cannot be equal
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="cannotEqualErrorCode" type="xsd:string" use="optional" default="validation.datesCannotBeEqual">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="notInRangeErrorCode" type="xsd:string" use="optional" default="validation.datesNotInRange">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="formatErrorCode" type="xsd:string" use="optional" default="validation.dateNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkShift" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    The times are checked that the start is less than the end, unless the cannotBeEqual
+                    is set to false in which case they can be equal.
+                    The fields need to have been checked as valid times prior to this.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="start" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Xpath to start value for range check
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="startAMPM" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Xpath to start AM/PM indicator for range check
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="end" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        XPath to end value for range check
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="endAMPM" type="xsd:string" use="required">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        XPath to end AM/PM indicator for range check
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="cannotEqual" type="xsd:boolean" use="optional" default="false">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en">
+                        Set if the two times cannot be equal
+                      </xsd:documentation>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="cannotEqualErrorCode" type="xsd:string" use="optional" default="validation.datesCannotBeEqual">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="notInRangeErrorCode" type="xsd:string" use="optional" default="validation.datesNotInRange">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                  <xsd:attribute name="formatErrorCode" type="xsd:string" use="optional" default="validation.dateNotCorrectFormat">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+              <xsd:element name="checkCalendarRequest" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation xml:lang="en">
+                    Checks that a resource calendar edit request contains the required parameters.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:attribute name="calendarErrorCode" type="xsd:string" use="optional" default="validation.calendarRequestMissingParameters">
+                    <xsd:annotation>
+                      <xsd:documentation xml:lang="en"/>
+                    </xsd:annotation>
+                  </xsd:attribute>
+                </xsd:complexType>
+              </xsd:element>
+            </xsd:sequence>
+          </xsd:complexType>
+        </xsd:element>
+      </xsd:sequence>
+    </xsd:complexType>
+  </xsd:element>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/dataXml-2002-02.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/dataXml-2002-02.xsd
new file mode 100644
index 0000000..149d518
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/dataXml-2002-02.xsd
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="http://schemas.niku.com/2002/data" xmlns="http://schemas.niku.com/2002/data" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xs:element name="data">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="header" type="headerType"/>
+        <xs:any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:complexType name="headerType">
+    <xs:sequence>
+      <xs:element name="security" type="securityType" minOccurs="0"/>
+      <xs:element name="userSession" type="userSessionType" minOccurs="0"/>
+      <xs:element name="sortInfo" type="sortInfoType" minOccurs="0"/>
+      <xs:element name="pagination" type="paginationType" minOccurs="0"/>
+      <xs:element name="messages" type="messagesType" minOccurs="0"/>
+      <xs:element name="action" minOccurs="0">
+        <xs:complexType>
+          <xs:attribute name="id" type="xs:string" use="required"/>
+          <xs:attribute name="pageId" type="xs:string" use="required"/>
+          <xs:attribute name="url" type="xs:string" use="required"/>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="securityType">
+    <xs:sequence>
+      <xs:element name="authorization" type="authorizationType" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="sessionId" type="xs:string" use="required"/>
+  </xs:complexType>
+  <xs:complexType name="userSessionType">
+    <xs:annotation>
+      <xs:documentation>
+       Contains information of the user who is currently logged in.  Info comes from
+       the SecurityIdentifier.  
+       formattingLocale - The locale that is used for date formatting or sorting for the user.
+       languageLocale - The locale that is used for language (i.e. resource bundles) of the user.
+       timezone - The timezone of the user.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="formattingLocale" type="xs:string" use="optional"/>
+    <xs:attribute name="languageLocale" type="xs:string" use="optional"/>
+    <xs:attribute name="timezone" type="xs:string" use="optional"/>
+  </xs:complexType>
+  <xs:complexType name="authorizationType">
+    <xs:attribute name="id" type="xs:string" use="required"/>
+    <xs:attribute name="value" type="xs:boolean" use="required"/>
+  </xs:complexType>
+  <xs:complexType name="sortInfoType">
+    <xs:attribute name="sortColumn" type="xs:string" use="required"/>
+    <xs:attribute name="sortDirection" type="SortDirectionType" default="asc"/>
+  </xs:complexType>
+  <xs:simpleType name="SortDirectionType">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="asc"/>
+      <xs:enumeration value="desc"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:complexType name="paginationType">
+    <xs:sequence>
+      <xs:element name="sliceInfo" type="sliceInfoType" maxOccurs="unbounded"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="sliceInfoType">
+    <xs:attribute name="collection" type="xs:string" use="required"/>
+    <xs:attribute name="totalNumRows" type="xs:short" use="required"/>
+    <xs:attribute name="slice" type="xs:byte" use="required"/>
+    <xs:attribute name="sliceSize" type="xs:byte" use="required"/>
+  </xs:complexType>
+  <xs:complexType name="messagesType">
+    <xs:sequence>
+      <xs:element name="message" type="messageType" maxOccurs="unbounded"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="messageType">
+    <xs:attribute name="id" type="xs:string" use="required">
+      <xs:annotation>
+        <xs:documentation>Resource bundle Id</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:NMTOKEN">
+          <xs:enumeration value="fatalError"/>
+          <xs:enumeration value="error"/>
+          <xs:enumeration value="warning"/>
+          <xs:enumeration value="info"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="location" type="xs:string" use="required"/>
+    <xs:attribute name="value" type="xs:string"/>
+  </xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/httpBinding-2002-02.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/httpBinding-2002-02.xsd
new file mode 100644
index 0000000..1eeb20b
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/httpBinding-2002-02.xsd
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://schemas.niku.com/2002/httpBinding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bd="http://schemas.niku.com/2002/httpBinding" elementFormDefault="qualified">
+  <xsd:element name="requestBinding" type="bd:requestBindingType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">requestBinding is a collection of binding elements that describe a binding from HTTP name/value pairs to a XML document</xsd:documentation>
+    </xsd:annotation>
+  </xsd:element>
+  <xsd:complexType name="requestBindingType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">A complex type that specifies bindings for HTTP name-value pairs into XML</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="binding" type="bd:bindingType" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- We only update one grid at time right now -->
+      <xsd:element name="gridBinding" type="bd:gridBindingType" minOccurs="0" maxOccurs="1"/>
+      <xsd:element name="selector" type="bd:selectorType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="bindAllParams" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">When true, all HTTP parameters will be marshalled regardless if a binding exists for them.  If no binding is found, the "canonical" marshalling algorithm will be used to append the parameter node to the end of the document</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="gridBindingType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">
+        Grid bindings create a special format of the document in order marshal all the updated
+        fields of an editable grid. Since grids may contain more than one object type with multiple fields
+        of the object being updated the gridBinding instructs the HttpMarshaller to create elements in the document
+        of the form:
+        <objects>
+          <object code="object_code">
+            <parameter_name value="parameter_value" original_value="original_parameter_value"/>
+            ...
+          </object>
+          <object code="object_code">
+            <parameter_name value="parameter_value"/>
+          </object>
+        </objects>
+
+        Ex.)
+        An updatable grid based on the investment data provider that updates the Budgeted Cost field
+        on three rows, two of which are project objects and one which is the application object would
+        create a document fragment that looks like:
+        <objects>
+          <object code="project">
+            <budget_cost_total value="5000000" original_value="4000000"/>
+            <odf_pk value="5000001"/>
+          </object>
+          <object code="project">
+            <budget_cost_total value="6000000" original_value="5000000"/>
+            <odf_pk value="5000002"/>
+          </object>
+          <object code="application">
+            <budget_cost_total value="3000000" original_value="3200000"/>
+            <odf_pk value="5000003"/>
+          </object>
+        </objects>
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="bindingType">
+      <!--
+        Bindings are stored in a binding cache (ActionBindingCache). The bindings are
+        placed in a HashMap called a BindingMap and then the BindingMap is stored in the ActionBindingCache.
+        The keys to the BindingMap are built from the binding 'from' element using the from 'id' and the from 'source' attributes.
+        Since gridBindings don't have a 'from' element we need another way to key the grid binding in the
+        BindingMap. The 'id' attribute on the gridBinding element is the mechanism to key the grid binding
+        into the BindingMap.
+      -->
+        <xsd:attribute name="id" type="xsd:string" use="required"/>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  <xsd:complexType name="bindingType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">A binding consists of one from entity containing the name of the HTTP parameter and at least one to entity containg the destination location in the XML.  Multiple to elements can be used to bind the parameter to more than one destination in the XML.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="from" type="bd:fromType"/>
+      <xsd:element name="to" type="bd:toType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="selectorType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">A selector defines a group of bindings that are logically related by a selector widget.  Selector widgets are typically used in a list table and allow the user to select one or more rows from the table for processing.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="binding" type="bd:bindingType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The id/name of the selector widget as it will appear in the HTTP request.  It must be unique for the entire requestBinding.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="fromType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">The from element specifies the name/id of the HTTP parameter. The default atribute can define an optional default value for group of radio buttons or single check boxes.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="id" type="xsd:string" use="required"/>
+    <xsd:attribute name="source" use="optional" default="request">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies the source from which the parameter value is retreived.</xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType name="sourceTypes">
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="request"/>
+          <xsd:enumeration value="session"/>
+          <xsd:enumeration value="cookie"/>
+          <xsd:enumeration value="header"/>
+          <xsd:enumeration value="config"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="parameterType" use="optional" default="httpParameterValue">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies the type of parameter. Most parameters are http parameters and are retreived from the incoming set of HTTP parameters. Some parameters however, need to come from other sources like the server name, server protocol, and server port, which come from the HttpServletRequest.</xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType name="parameterTypes">
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="httpParameterValue"/>
+          <xsd:enumeration value="servletRequestValue"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="toType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">The to element specifies the destination of the parameter value in the XML</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="destination" use="optional" default="request">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies the destination source into which the parameter value is placed.</xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType name="destinationTypes">
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="request"/>
+          <xsd:enumeration value="session"/>
+          <xsd:enumeration value="cookie"/>
+          <xsd:enumeration value="header"/>
+          <xsd:enumeration value="config"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="location" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The location attribute is destination of the parameter value in the XML in the form of an absolute XPath location path expression</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="repeatingLocation" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The repeatingLocation attribute is used for repeating a binding of one name into multiple destinations in the XML.
+        It is also in the form of an absolute XPath location expression that must be equivalent to or an ancestor of the location attribute.  The last name step of this expression
+        will be repeated in the resulting XML document for each matching name in the HTTP request.  It will never be an attribute, always an element.  This is typcially found in "list" HTML tables where each
+        column of the table has the same name but repeated over numerous rows of data.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="defaultValue" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The default value of the binding.  Will be used when the parameter is not present in the HTTP request.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="selector" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The id/name of the selector widget as it will appear in the HTTP request.  It must be unique for the entire requestBinding.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/object-2003-09.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/object-2003-09.xsd
new file mode 100644
index 0000000..71a6606
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/object-2003-09.xsd
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://schemas.niku.com/2002/objectTypes" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:objectTypes="http://schemas.niku.com/2002/objectTypes" elementFormDefault="qualified" attributeFormDefault="unqualified">
+  <xsd:include schemaLocation="object-types-2003-09.xsd"/>
+	<xsd:element name="object" type="objectTypes:ObjectType"/>
+</xsd:schema>
+
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/object-base-types-2003-09.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/object-base-types-2003-09.xsd
new file mode 100644
index 0000000..9f67bab
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/object-base-types-2003-09.xsd
@@ -0,0 +1,245 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xsd:include schemaLocation="common-2003-09.xsd"/>
+  <xsd:complexType name="ObjectAttributeType">
+    <xsd:sequence>
+      <xsd:element name="nls" type="NlsType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="default" type="DefaultType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="readExpression" type="AugmentSQLType" minOccurs="0" maxOccurs="2"/>
+      <xsd:element name="displayMapping" type="DisplayMappingType" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="code" type="xsd:string" use="required"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+    <xsd:attribute name="partitionCode" type="xsd:string" use="optional" default="NIKU.ROOT"/>
+    <xsd:attribute name="partitionMode" type="PartitionModeType" use="optional" default="PARTITION_AND_ANSTRS_DESDNTS"/>
+    <xsd:attribute name="column" type="xsd:string"/>
+    <xsd:attribute name="dataType" type="DataType" use="required"/>
+    <xsd:attribute name="extendedType" type="ExtendedType"/>
+    <xsd:attribute name="dataSize" type="xsd:int"/>
+    <xsd:attribute name="scale" type="xsd:int"/>
+    <xsd:attribute name="minValue" type="xsd:string"/>
+    <xsd:attribute name="maxValue" type="xsd:string"/>
+    <xsd:attribute name="lookupType" type="xsd:string"/>
+    <xsd:attribute name="currencyAttribute" type="xsd:string"/>
+    <xsd:attribute name="currencyConnected" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="constant" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="required" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="presenceRequired" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="unique" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="editable" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="virtual" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="custom" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="active" type="xsd:boolean" default="true"/>
+    <xsd:attribute name="private" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="multiValued" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="gridEditable" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="timeScalable" type="TimeScaleType">
+      <xsd:annotation>
+        <xsd:documentation>
+            Defines the minimum time scale supported. Must support all higher time scales.
+            E.g. The month time scale must support quarter and year
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="clientFieldVersion" type="xsd:int" default="10">
+      <xsd:annotation>
+        <xsd:documentation>
+               ---- For schedulers use only ----
+               Let's the schedulers code know when a field came into being to aid in  backward compatibility
+                   10 - Field was available to pre 7.0 clients
+                   20 - Field new to 7.0
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="clientFlags" type="xsd:long" default="0">
+      <xsd:annotation>
+        <xsd:documentation>
+               ---- For schedulers use only ----
+               Use by the schedulers code to fine tune the attrbutes for client applications
+                  0x0001 - systemGenerated - Tells schedulers that the field isn't directly editable by the user but the should be sent back to the server
+                  0x0002 - clientReadonly  - User should not be able to edit the field - If true it can override the "editable" attribute
+                  0x0004 - clientHidden - User cannot see the field - If true can override the "private" attribute
+                  0x0008 - lookupReference - Field might be defined as a Lookup for Clarity but client should treat it as a referenced record ID
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="dependentEntry" type="xsd:string"/>
+    <xsd:attribute name="dependentExit" type="xsd:string"/>
+    <xsd:attribute name="dependentParentLookup" type="xsd:string"/>
+    <xsd:attribute name="id" type="xsd:int"/>
+    <xsd:attribute name="exact" type="xsd:boolean" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation>
+               Used for NSQL parameters when there can only be one value.  So, the attribute cannot be multivalued and cannot
+               have a wildcard.  This does value does not need to be persisted to the database because it is only for NSQL.  The
+               reason it is in the schema is because the NSQL gets converted to and Object for ODF.
+            </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="aggregate" type="xsd:boolean" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation>
+           Used for NSQL parameters only.  This is when parameters are part of the @HAVING_FILTER@ NSQL
+           construct.  When the NSQL is converted to an object and a attribute is part of the HAVING_FILTER
+           then this flag is true.  This flag is used by the expression builder which will ignore these
+           types of attributes.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="derivedThrough" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>Specified if this attribute represents a derived attribute. If so this is the attribute through which it is derived. I.e. the values for this attribute must represent instances of some object. For now only the parent reference is supported. I.e. the only possible value is the same value specified for parentReferenceAttribute at the object element and consequently refers to instances of the object with code specified by parentCode.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="derivedReference" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>If derivedThrough is specified, this is the attribute that is referenced. It is an error if value specified does not match an attribute of the referenced object type.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="allowDefaultValueOverrides" type="xsd:boolean" default="true">
+      <xsd:annotation>
+        <xsd:documentation>If true, the Object admin UI will allow default values to be changed for this attribute even though it may be a stock attribute with a default value specified by a developer. If false, default values cannot be changed by a customer.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="DefaultType">
+    <xsd:sequence>
+      <xsd:element name="document" type="DocumentType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="replace" type="MacroType" use="optional"/>
+    <xsd:attribute name="value" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="AugmentSQLType">
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:string">
+        <xsd:attribute name="dbVendor" type="DatabaseVendorType" default="all"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+  <xsd:complexType name="DisplayMappingType">
+    <xsd:sequence>
+      <xsd:element name="mapping" type="MappingType" maxOccurs="10"/>
+    </xsd:sequence>
+    <xsd:attribute name="defaultTypeCode" type="xsd:string"/>
+    <xsd:attribute name="type" use="required">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="color"/>
+          <xsd:enumeration value="image"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="objectCode" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Allows system data providers to specify which object the display mapping belongs to and thus reuse that objects lookups.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="attributeCode" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Used by XOG to import modified display mappings on stock attributes.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="MappingType">
+    <xsd:sequence>
+      <xsd:element name="nls" type="NlsType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:long"/>
+    <xsd:attribute name="mappingCode" type="xsd:string" use="required"/>
+    <xsd:attribute name="typeCode" type="xsd:string" use="required"/>
+    <xsd:attribute name="lo" type="xsd:double">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The low value of the mapping range.  Always inclusive.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="hi" type="xsd:double">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The high value of a mapping range.  Always exclusive except when the high and low values are equivalent, e.g. 4 to 4, and when the high value is the max of all high values in the display mapping </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="value" type="xsd:string"/>
+  </xsd:complexType>
+  <xsd:complexType name="LinksType">
+    <xsd:sequence>
+      <xsd:element name="link" type="LinkType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="LinkType">
+    <xsd:sequence>
+      <xsd:element name="nls" type="NlsType" maxOccurs="unbounded"/>
+      <xsd:element name="linkParam" type="LinkParamType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:int" use="optional"/>
+    <xsd:attribute name="code" type="xsd:string" use="required"/>
+    <xsd:attribute name="action" type="xsd:string" use="required"/>
+    <xsd:attribute name="objectPropertiesLink" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="system" type="xsd:boolean" default="true"/>
+    <xsd:attribute name="partitionCode" type="xsd:string" use="optional" default="NIKU.ROOT"/>
+    <xsd:attribute name="partitionMode" type="PartitionModeType" use="optional" default="PARTITION_AND_ANSTRS_DESDNTS"/>
+  </xsd:complexType>
+  <xsd:simpleType name="DatabaseVendorType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="mssql"/>
+      <xsd:enumeration value="oracle"/>
+      <xsd:enumeration value="all"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="DirectionType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="IN"/>
+      <xsd:enumeration value="OUT"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="DataType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="string"/>
+      <xsd:enumeration value="number"/>
+      <xsd:enumeration value="date"/>
+      <xsd:enumeration value="binary"/>
+      <xsd:enumeration value="attachment"/>
+      <xsd:enumeration value="clob"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="ExtendedType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="lookup"/>
+      <xsd:enumeration value="boolean"/>
+      <xsd:enumeration value="double"/>
+      <xsd:enumeration value="percent"/>
+      <xsd:enumeration value="money"/>
+      <xsd:enumeration value="timestamp"/>
+      <xsd:enumeration value="midnight_date"/>
+      <xsd:enumeration value="url"/>
+      <xsd:enumeration value="formula"/>
+      <xsd:enumeration value="skill_browse"/>
+      <xsd:enumeration value="avail_browse"/>
+      <xsd:enumeration value="attachment"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="ProcessType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="processObjectId"/>
+      <xsd:enumeration value="processTemplateId"/>
+      <xsd:enumeration value="processInitiatedBy"/>
+      <xsd:enumeration value="processFromPeriodIndx"/>
+      <xsd:enumeration value="processToPeriodIndx"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="TimeScaleType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="year"/>
+      <xsd:enumeration value="quarter"/>
+      <xsd:enumeration value="month"/>
+      <xsd:enumeration value="week"/>
+      <xsd:enumeration value="day"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="PartitionModeType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="PARTITION_ONLY"/>
+      <xsd:enumeration value="PARTITION_AND_ANCESTORS"/>
+      <xsd:enumeration value="PARTITION_AND_DESCENDANTS"/>
+      <xsd:enumeration value="PARTITION_AND_ANSTRS_DESDNTS"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/object-types-2003-09.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/object-types-2003-09.xsd
new file mode 100644
index 0000000..23b948f
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/object-types-2003-09.xsd
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://schemas.niku.com/2002/objectTypes" xmlns:srv="http://schemas.niku.com/2002/service" xmlns:sec="http://schemas.niku.com/2002/security" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.niku.com/2002/objectTypes" elementFormDefault="qualified">
+  <xsd:import namespace="http://schemas.niku.com/2002/service" schemaLocation="service-2002-02.xsd"/>
+  <xsd:import namespace="http://schemas.niku.com/2002/security" schemaLocation="security-2002-02.xsd"/>
+  <xsd:include schemaLocation="object-base-types-2003-09.xsd"/>
+  <xsd:include schemaLocation="common-2003-09.xsd"/>
+  <xsd:complexType name="AttributesType">
+    <xsd:sequence>
+      <xsd:element name="attribute" type="ObjectAttributeType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="ObjectType">
+    <xsd:sequence>
+      <xsd:element name="nls" type="NlsType" maxOccurs="unbounded"/>
+      <xsd:element name="attributes" type="AttributesType"/>
+      <xsd:element name="tables" type="TablesType" minOccurs="0"/>
+      <xsd:element name="instanceService" type="srv:retrieveService" minOccurs="0"/>
+      <xsd:element name="listService" minOccurs="0">
+        <xsd:complexType>
+          <xsd:attribute name="id" type="xsd:string" use="required">
+            <xsd:annotation>
+              <xsd:documentation xml:lang="en">The id of the system data provider to use as the objects list service</xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+        </xsd:complexType>
+      </xsd:element>
+      <xsd:element name="insertService" type="srv:processService" minOccurs="0"/>
+      <xsd:element name="updateService" type="srv:processService" minOccurs="0"/>
+      <xsd:element name="deleteService" type="srv:processService" minOccurs="0"/>
+      <xsd:element name="propertyViewService" type="srv:processService" minOccurs="0"/>
+      <xsd:element name="operations" type="OperationsType" minOccurs="0"/>
+      <xsd:element name="events" type="EventsType" minOccurs="0"/>
+      <xsd:element name="links" type="LinksType" minOccurs="0"/>
+      <xsd:element name="changeListeners" type="ChangeListenersType" minOccurs="0"/>
+      <xsd:element name="security" type="SecurityType" minOccurs="0"/>
+      <xsd:element name="subObject" type="SubObjectType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="component" type="xsd:string" use="optional"/>
+    <xsd:attribute name="code" type="xsd:string" use="required"/>
+    <xsd:attribute name="source" type="xsd:string" use="optional" default="customer"/>
+    <xsd:attribute name="parentCode" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The code of the master object in a master sub relationship</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="topParentCode" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">If parentCode is specified, this attribute specifies the code of the top-most object in the hierarchy. If it is a simple parent-child relationship parentCode and topParentCode will be the same. If parentCode is not specified, topParentCode will also not be specified.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="parentReferenceAttribute" type="xsd:string" use="optional" default="odf_parent_id">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">If parentCode is specified, this attribute specifies the attribute of this object that points to the parent instance. This attribute means nothing if parentCode is not specified</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="topParentReferenceAttribute" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">If parentCode is specified, this attribute specifies a peudo "attribute" that can be used as a filter to filter based on the top most object in an object hierarchy. It is constructed by concatenating (separated by the "-" character) the parentReferenceAttribute values while traversing the tree to the top. In the trivial case (one level) the value will be the same as parentReferenceAttribute. This attribute means nothing if parentCode is not specified</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="customizable" type="xsd:boolean" use="optional" default="false"/>
+    <xsd:attribute name="processEnabled" type="xsd:boolean" use="optional" default="true"/>
+    <xsd:attribute name="raiseEvents" type="xsd:boolean" use="optional" default="true"/>
+    <xsd:attribute name="rightsEnabled" type="xsd:boolean" use="optional" default="false"/>
+    <xsd:attribute name="rightCode" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">If specified means that this Object is instance rights-enabled.
+          This is the right_type from cmn_sec_groups.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="obsEnabled" type="xsd:boolean" use="optional" default="false"/>
+    <xsd:attribute name="obsTableNameKey" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">If specified means that this Object is OBS-enabled and the key provided matches entries in the PRJ_OBS_* tables.
+          This is the obs_code in odf_objects.  Eventually this should go away in favor of using the object code directly.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="partitionModelCode" type="xsd:string" use="optional"/>
+    <xsd:attribute name="custom" type="xsd:boolean" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">True if the object is custom. I.e. it is not shipped with the application. As such this flag must not be used in an OMD object registration file. Objects registered that way are by definition not custom which is the default setting for the flag.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="id" type="xsd:integer" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">For internal use only.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="contextAttribute" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The code of the attribute used for displaying the context of instances (think property page context).</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="idAttribute" type="xsd:string" default="code">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The code of the attribute that is the unique ID of instances, ie the unique_name for project or the company_id for comany.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="exportEnabled" type="xsd:boolean" use="optional" default="false"/>
+    <xsd:attribute name="copyEnabled" type="xsd:boolean" use="optional" default="false"/>
+    <xsd:attribute name="viewAllEnabled" type="xsd:boolean" use="optional" default="false"/>
+  </xsd:complexType>
+  <xsd:complexType name="FromSQLType">
+    <xsd:simpleContent>
+      <xsd:extension base="AugmentSQLType">
+        <xsd:attribute name="complete" type="xsd:boolean" default="false"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+  <xsd:complexType name="SelectSQLType">
+    <xsd:simpleContent>
+      <xsd:extension base="AugmentSQLType">
+        <xsd:attribute name="oracleHint" type="xsd:string"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+  <xsd:complexType name="TableType">
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="isPrimary" type="xsd:boolean"/>
+    <xsd:attribute name="pkColumn" type="xsd:string" use="required"/>
+    <xsd:attribute name="secondaryPkColumn" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">For a non-primary table we allow a secondary column as part of the primary key. The secondaryPkColumn must be referenced in an attribute definition with a constant value. This is to support the principal_id, principal_type use case for a secondary base table (e.g. srm_contacts).</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="TablesType">
+    <xsd:sequence>
+      <xsd:element name="table" type="TableType" maxOccurs="unbounded"/>
+      <xsd:element name="select" type="SelectSQLType" minOccurs="0" maxOccurs="2"/>
+      <xsd:element name="from" type="FromSQLType" minOccurs="0" maxOccurs="2"/>
+      <xsd:element name="where" type="AugmentSQLType" minOccurs="0" maxOccurs="2"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="ListenerType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">The fully qualified class name of a class implementing com.niku.union.odf.ObjectChangeListener interface. This class will be called when the Object changes in any way. E.g. a new custom attribute is added, a display mapping is changed...</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="className" type="xsd:string" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="ChangeListenersType">
+    <xsd:sequence>
+      <xsd:element name="listener" type="ListenerType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="SecurityType">
+    <xsd:sequence>
+      <xsd:element name="viewAll" type="ViewRightType" minOccurs="0"/>
+      <xsd:element name="viewInstance" type="ViewRightType" minOccurs="0"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="SubObjectType">
+    <xsd:attribute name="code" type="xsd:string" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="ViewRightType">
+    <xsd:choice>
+      <xsd:element name="policy" type="sec:PolicyBaseType"/>
+      <xsd:element name="query" type="AugmentSQLType" minOccurs="0" maxOccurs="2"/>
+    </xsd:choice>
+  </xsd:complexType>
+  <xsd:complexType name="OperationsType">
+    <xsd:sequence>
+      <xsd:element name="operation" maxOccurs="unbounded">
+        <xsd:complexType>
+          <xsd:complexContent>
+            <xsd:extension base="OperationType"/>
+          </xsd:complexContent>
+        </xsd:complexType>
+      </xsd:element>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="OperationType">
+    <xsd:sequence>
+      <xsd:element name="nls" type="NlsType"/>
+      <xsd:element name="service" type="srv:processService"/>
+      <xsd:element name="param" type="OperationParamType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="code" type="xsd:string" use="required"/>
+    <xsd:attribute name="isInstance" type="xsd:boolean" default="true"/>
+    <xsd:attribute name="isSystem" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="isTemplate" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="isProcessable" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Flag that determines if the operation can be used to build a Process Engine condition.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="OperationParamType">
+    <xsd:sequence>
+      <xsd:element name="nls" type="NlsType"/>
+    </xsd:sequence>
+    <xsd:attribute name="code" type="xsd:string" use="required"/>
+    <xsd:attribute name="dataType" type="DataType" use="required"/>
+    <xsd:attribute name="extendedType" type="ExtendedType"/>
+    <xsd:attribute name="processType" type="ProcessType"/>
+    <xsd:attribute name="lookupType" type="xsd:string"/>
+    <xsd:attribute name="required" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="multiValued" type="xsd:boolean" default="false"/>
+    <xsd:attribute name="direction" type="DirectionType" default="IN"/>
+    <xsd:attribute name="dataLocation" type="xsd:string"/>
+  </xsd:complexType>
+  <xsd:complexType name="EventsType">
+    <xsd:sequence>
+      <xsd:element name="event" maxOccurs="unbounded">
+        <xsd:complexType>
+          <xsd:complexContent>
+            <xsd:extension base="EventType"/>
+          </xsd:complexContent>
+        </xsd:complexType>
+      </xsd:element>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="EventType">
+    <xsd:sequence>
+      <xsd:element name="nls" type="NlsType"/>
+    </xsd:sequence>
+    <xsd:attribute name="code" type="xsd:string" use="required"/>
+  </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/pageView-2002-02.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/pageView-2002-02.xsd
new file mode 100644
index 0000000..043a648
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/pageView-2002-02.xsd
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://schemas.niku.com/2002/pageView" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.niku.com/2002/pageView" xmlns:view="http://schemas.niku.com/2002/view">
+	<xsd:import namespace="http://schemas.niku.com/2002/view" schemaLocation="view-2002-02.xsd"/>
+	<!--Import the view schema.-->
+	<xsd:element name="page">
+		<xsd:annotation>
+			<xsd:documentation xml:lang="en">Root element for the pageView XML file. Page View XML is a result of merging view XML for all the web fragments with some of the view specific information from WMD XML for the page. Pave View XML is generate by the XMLPageBuilder and is used by the XSLT page layout templates for client-side or server-side XML transformations of fragmnet View XML and content aggregation.</xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType name="PageView">
+			<xsd:sequence>
+				<xsd:element name="import" type="ImportType" minOccurs="0" maxOccurs="unbounded"/>
+				<xsd:element name="portlet" type="PortletType" maxOccurs="unbounded"/>
+			</xsd:sequence>
+			<xsd:attribute name="id" type="xsd:string" use="required">
+				<xsd:annotation>
+					<xsd:documentation xml:lang="en">Unique web page id used for linking a web page to a help topic.</xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="space" type="xsd:string" use="required">
+				<xsd:annotation>
+					<xsd:documentation xml:lang="en">Identifies the space/module to which the content of this web page belongs. When this attribute is specified and the header that this page uses contains an action element with actionId=space, the corresponding space should be highlighted when this page is displayed. </xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="template" type="xsd:string" use="optional" default="default.xsl">
+				<xsd:annotation>
+					<xsd:documentation xml:lang="en">Specifies the location of the XSLT page layout template that defines content layout and performs fragment content transformation and agregation. </xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="skin" type="xsd:string" default="default">
+				<xsd:annotation>
+					<xsd:documentation xml:lang="en">Defines the relative location of the UI skin directory.</xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="sessionId" type="xsd:string" use="optional">
+				<xsd:annotation>
+					<xsd:documentation xml:lang="en">User sessionId used to generate links for applet-based applications, or web clients that don't support cookies. In the later case, session id can be appended to all the links as an extra HTTP parameter (jsession).</xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="appPath" type="xsd:string" default="app">
+				<xsd:annotation>
+					<xsd:documentation xml:lang="en">Defines default application path or the mapping of the main application servlet.</xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:complexType name="PortletType">
+		<xsd:annotation>
+			<xsd:documentation xml:lang="en">Defines a single fragment for a page with view specific information form WMD XML and embedded view XML that describes the fragment content. </xsd:documentation>
+		</xsd:annotation>
+		<xsd:sequence>
+			<xsd:element ref="view:view"/>
+		</xsd:sequence>
+		<xsd:attribute name="id" type="xsd:string" use="optional">
+			<xsd:annotation>
+				<xsd:documentation xml:lang="en">Unique fragment id for the whole application.</xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="type" default="body">
+			<xsd:annotation>
+				<xsd:documentation xml:lang="en">Specifies the fragment type for standard fragments such as header, footer and leftNav. This information is used by the XSLT page layout template to apply appropriate transformation to each web fragment's view XML InfoSet.</xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:string">
+					<xsd:enumeration value="header"/>
+					<xsd:enumeration value="footer"/>
+					<xsd:enumeration value="toc"/>
+					<xsd:enumeration value="body"/>
+					<xsd:enumeration value="pageContext"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="col" default="1">
+			<xsd:annotation>
+				<xsd:documentation xml:lang="en">Defines column index for assigning location of the fragment in the web page grid layout. Fragments are layed out on the page in at most 3 columns, where each column represents a separate stack or a  bucket.  If no row is assigned, fragments are layed out in the order they are listed in web metadata and according to their column assignments. Note that all fragments are listed in ascending order of their column assignments. Column indexes start with 0, with 1 being the default wide center column. XSLT page layout template is responsible for spanning the content of web fragments if the number of web fragment columns is less than 3.</xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:integer">
+					<xsd:enumeration value="0"/>
+					<xsd:enumeration value="1"/>
+					<xsd:enumeration value="2"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="row" type="xsd:integer" use="optional">
+			<xsd:annotation>
+				<xsd:documentation xml:lang="en">Defines row index for assigning location of the fragment in the web page grid layout. Fragments are layed out on the page in at most 3 columns, where each column represents a separate stack or bucket. If no row is assigned, fragments are layed out in the order they are listed in web metadata and according to their column assignments. Note that all fragments are always  listed in ascending order of their column assignments. Column indexes start with 0, with 1 being the default wide center column. XSLT layout manager template is responsible for spanning the content of web fragments if the number of web fragment columns is less than 3.</xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="narrow" type="xsd:boolean" default="false">
+			<xsd:annotation>
+				<xsd:documentation xml:lang="en">Denotes wheter or not the fragment can be placed in the narrow (left or right) column of the Web page grid layout.</xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="span" type="xsd:boolean" default="false">
+			<xsd:annotation>
+				<xsd:documentation xml:lang="en">Denotes whether or not the content of the first web fragment for the web page should span across the whole page horizontally, ignoring multiple column grid layout for the page.</xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+	<xsd:complexType name="ImportType">
+		<xsd:annotation>
+			<xsd:documentation xml:lang="en">Defines a web resource to include during content aggregation. Specifically, include is used for including references to such web resources as JavaScript and CSS files into the XHTML header of the final page.</xsd:documentation>
+		</xsd:annotation>
+		<xsd:attribute name="href" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation xml:lang="en">Specifies the location of the web resource relative to the UI skin directory.</xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="type" use="required">
+			<xsd:annotation>
+				<xsd:documentation xml:lang="en">Identifies web resource type: js - JavaScript, css - CSS file.</xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:string">
+					<xsd:enumeration value="js"/>
+					<xsd:enumeration value="css"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+	</xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/pmd-2002-02.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/pmd-2002-02.xsd
new file mode 100644
index 0000000..632f679
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/pmd-2002-02.xsd
@@ -0,0 +1,682 @@
+<?xml version="1.0"?>
+<!--http://www.w3.org/2001/XMLSchema-->
+<xsd:schema targetNamespace="http://schemas.niku.com/2002/pmd" xmlns="http://schemas.niku.com/2002/pmd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xsd:include schemaLocation="common-2003-09.xsd"/>
+  <xsd:element name="persistMetaData" type="PersistMetaDataType"/>
+  <xsd:complexType name="PersistMetaDataType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Elements of type persistMetaData represents interactions with persistence mechanisms such as database servers and tries to solve two competing goals. 1. Use all the vendor specific capabilities of a given database vendor within the SQL text. 2. Appear to be portable to the application. Vendor specific functionality such as stored procedures, views and resultsets are allowed. Database portability is also facilitated by several notions. E.g. The ability to have different SQL texts per statement per database server vendor and the ability to have different SQL error codes per exception per database server vendor.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:choice maxOccurs="unbounded">
+      <xsd:element name="statementSet" type="StatementSetType"/>
+      <xsd:element name="statement" type="StatementType"/>
+      <xsd:element name="sql" type="SqlType"/>
+    </xsd:choice>
+    <xsd:attribute name="schemaLocation" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="StatementSetType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">A statementSet describes a logical grouping of database statements. The sub statementRef elements serve as pointers to the statements in question and provides an indirection so that statements can be reused in different contexts and potetnially with different input sources and locations.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:choice maxOccurs="unbounded">
+      <xsd:element name="statementRef" type="StatementRefType"/>
+      <xsd:element name="statement" type="StatementType"/>
+    </xsd:choice>
+    <xsd:attribute name="location" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">For internal use only.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="id" type="IdType" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The id of the statementSet. Must be unique within the component in which it is specified and must be of the form &lt;component&gt;.ID.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="rootElementName" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">In case the statements defined in this statementSet returns data (e.g. one or more queries) and the client requested XML as output the output will be enclosed in an element specified with the rootElementName. If none is specified the output will not have this root element.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="databaseId" type="xsd:string" use="optional" default="Niku">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The databaseId refers to the specific database instance as defined in the properties.xml file to use.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="requiresLinguisticSort" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">If set to true, at least one statement expects to sort something in a linguistic manner. In Oracle this translates to setting the NLS_SORT variable to a value consistent with a users chosen Locale. (NOTE: This will probably change in the next version of the Persistence Implementation to handel both Oracle and SQL Server)</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="SqlRefType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">A sqlref is a reference to a sql element identified by it's id. There has to be one and only one sql element with the id of the sqlRef for a given database vendor.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="condition" type="ConditionType" minOccurs="0" maxOccurs="1"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="IdType" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">This is the reference to the sql element to be included.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="StatementRefType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">A statementRef is a reference to a statement element identified by it's id. There has to be one and only one statement with the id of the statementRef. There may be more than one statementRef pointing to a statement however.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="staticMap" type="StaticMapType" minOccurs="0"/>
+      <xsd:element name="secondaryInput" type="SecondaryInputType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="outputMapping" type="OutputMappingType" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="IdType" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">This is the reference to the statement to be executed.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="defaultSortColumn" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">This value specifies the default sort column if none is passed in the data header.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="defaultSortDirection" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">This value specifies the default sort direction if none is passed in the data header.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attributeGroup ref="InputAttributeGroup">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Determines the so-called driving input to the statement. Sometimes a statement requires no input in which case you specify "none" as the input source and the statement will be executed exactly once. Sometimes, e.g. in a simple query, you have input necessary to form the where-clause (e.g. an id) and the driving input will contain one node (in case of "xml" input) or one Map (in case of "map" input). While in the case of batch updates you will have more than one row of driving input and the statement will be executed once for every.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attributeGroup>
+    <xsd:attributeGroup ref="SharedStatementAttributeGroup"/>
+  </xsd:complexType>
+  <xsd:attributeGroup name="SharedStatementAttributeGroup">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Specifies attributes shared between elements of type StatementRefType and StatementType when they appear inline.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="sortColumnPath" type="xsd:string" default="/data/header/sortInfo/@sortColumn">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">This XPath value specifies the location of the column to sort on. Defaults to the Data XML defined position of the sort column.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="sortDirectionPath" type="xsd:string" default="/data/header/sortInfo/@sortDirection">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">This XPath value specifies the location of the sort direction. Defaults to the Data XML defined position of the sort direction.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="slicePath" type="xsd:string" default="/data/header/pagination/sliceInfo/@slice">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">This XPath value specifies the location of the slice (aka. page) to get. Defaults to the Data XML defined position of the slice.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="sliceSizePath" type="xsd:string" default="/data/header/pagination/sliceInfo/@sliceSize">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">This XPath value specifies the location of the slice size (aka. rows per page) to use. Defaults to the Data XML defined position of the slice size.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="defaultSliceSize" type="xsd:integer" default="20">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">This integer value specifies the default slice size (aka. rows per page) to use. Defaults to 20.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="ignoreIfError" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">If the call to the persistence layer is done in error mode and this attribute is set to "true" on execution of the statementSet this particular statement will be ignored.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="hideResultSets" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">If true, the potential result sets from this statement are only visible within the enclosing statement set. I.e. to be used as input (using inputSource="responseMap") but will not affect the number of result sets returned from executing the complete statement set.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:attributeGroup>
+  <xsd:attributeGroup name="InputAttributeGroup">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Specifies information needed to identify a subset of input as either driving or secondary input.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="inputSource" type="InputSourceType" default="none">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The source of input.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="inputLocation" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">XPath specifying a node set which serves as input. Required if inputSource="xml".</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="inputMapIndex" type="xsd:integer" default="0">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The index of the array of Maps which serves as input. Required if inputSource="map" or inputSource="responseMap".</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:attributeGroup>
+  <xsd:simpleType name="InputSourceType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">A call to a PMD statementSet can be issued with no input or one of three input sources. If "none" is specified the statement will be executed exactly once. If "xml" is specified an input document is expected and if "map" input is expected is the form of one or more arrays of maps. If "staticMap" is specified a subelement of type StaticMapType is expected to be provided as input. If "responseMap" is specified input is taken from the potentially partial result created by a statement preceding this statement in the current statementSet.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="none"/>
+      <xsd:enumeration value="xml"/>
+      <xsd:enumeration value="map"/>
+      <xsd:enumeration value="staticMap"/>
+      <xsd:enumeration value="responseMap"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:complexType name="StaticMapType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Defines a static map specified in a PMD file. I.e. one or more entry elements which map a name to a value.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="entry" type="StaticMapEntryType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="StaticMapEntryType">
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="value" type="xsd:string" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="SecondaryInputType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">A statement can require input both from the driving input and from some other source. An example could be a master-detail update. One statement would be the master update which would use input from one part of the total set of input data. This update would then be followed by the detail update which would use inout from both the detail (driving) input as well as the master (secondary) input (e.g. the primary key of the master record).</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="staticMap" type="StaticMapType" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="IdType" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">This id identifies the secondary input and must be unique within the statementRef. See also the secondaryInputId attribute of ParamType.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="mirrorDrivingInputRows" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Input from secondary input will be taken from the first row only unless this attribute is set to "true". If set to "true", the secondary input is assumed to have the same number of rows as the driving input and when row N from the driving input is processed secondary input will be taken from row N of the secondary input.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attributeGroup ref="InputAttributeGroup">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">If the secondary input contains more than one row data will always be taken from the first.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attributeGroup>
+  </xsd:complexType>
+  <xsd:simpleType name="DatabaseVendorType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">The persistence implementation currently supports SQL Server 2000 (mssql) and Oracle 8.1.7 (oracle). If the construct specified is identical for both these databases specify "all".</xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="mssql"/>
+      <xsd:enumeration value="oracle"/>
+      <xsd:enumeration value="all"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="DataType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="string">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">Specifies Unicode strings of any length.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="searchString">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">Specifies Unicode strings that will be preprocessed to implement our search string functionality used in a SQL "like" clause. For example, a '*' will be replaced by a '%' and a '%' will be replaced by "\%". This means that all special characters are escaped by a '\' so in a statement the "like" clause will have to contain "ESCAPE '\'" to tell the database that '\' is the escape character.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="int">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">Signed integer with 9 digit precision.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="long">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">Signed integer with 18 digit precision.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="double">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">Signed floating point value with 15 digit precision.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="bigDecimal">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">Signed numeric value with aribitrary precision. Note that both SQL Server and Oracle supports at most 38 digits of precision.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="date">
+        <xsd:annotation>
+          <xsd:documentation>Date value including a time component.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="dateNoTime">
+        <xsd:annotation>
+          <xsd:documentation>Date value with no time component.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="blob">
+        <xsd:annotation>
+          <xsd:documentation>Binary large object of arbitrary size.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="clob">
+        <xsd:annotation>
+          <xsd:documentation>Character large object of arbitrary size.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="resultSet">
+        <xsd:annotation>
+          <xsd:documentation>ResultSet (Cursor). Only used for Oracle Stored Procs OUT parameter.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="nullIndicator">
+        <xsd:annotation>
+          <xsd:documentation>An integer value that will evaluate to 1 if the data specified is NULL or 0 otherwise.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="valueIndicator">
+        <xsd:annotation>
+          <xsd:documentation>An integer value that will evaluate to 0 if the data specified is NULL but present (e.g. an empty attribute in "xml" input), 1 if the data specified is present and not NULL and 2 otherwise (i.e. it was not present in the input at all).</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="ReplaceType">
+    <xsd:restriction base="MacroType">
+      <xsd:enumeration value="normalized_timestamp">
+        <xsd:annotation>
+          <xsd:documentation>Will evaluate to the current date and time at runtime and use the normalizeDate method on it.  This allows us to get the full day.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="users_timestamp">
+        <xsd:annotation>
+          <xsd:documentation>Will evaluate to the current date and time at runtime in the users timezone.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="rowNum">
+        <xsd:annotation>
+          <xsd:documentation>Will evaluate to the current row number (0-based).</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="dbVendor">
+        <xsd:annotation>
+          <xsd:documentation>Will evaluate to the vendor string of the current statementSet.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="sessionId">
+        <xsd:annotation>
+          <xsd:documentation>Session Id from the SecurityIdentifier. Same as CMN_SESSION.ID</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="resourceId">
+        <xsd:annotation>
+          <xsd:documentation>Resource Id. Same as SRM_RESOURCES.ID</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="resourceCode">
+        <xsd:annotation>
+          <xsd:documentation>Resource Code. Same as SRM_RESOURCES.UNIQUE_NAME</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="DirectionType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="IN">
+        <xsd:annotation>
+          <xsd:documentation>Represents an IN parameter.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="INOUT">
+        <xsd:annotation>
+          <xsd:documentation>Deprecated! Do not use!.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="OUT">
+        <xsd:annotation>
+          <xsd:documentation>Represents an OUT parameter.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:complexType name="VariationType">
+    <xsd:annotation>
+      <xsd:documentation>Used to dynamically change the text of a statement base on input.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="includeIfNull" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation>Determines whether it's the NULLness or the non-NULLness that determines whether to include the variation text.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="includeIfPresent" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation>Determines if the presence of the input (rather than the NULLness) that determines whether to include the variation text.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="text" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation>If the variation condition is evaluated to true this text will be appended to the current text of the statement.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:simpleType name="SequenceTypeType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="currentValue"/>
+      <xsd:enumeration value="nextValue"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:attributeGroup name="SequenceGroup">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Used to mimic the behavior of Oracle Sequences. The attributes of the SequenceGroup will be passed to the CMN_ID_SP stored procedure for generation of new IDs. If inTransaction=true, the call to CMN_ID_SP will be part of the transaction in question (i.e. no new "System" conection will be used) and only one value will be grabbed. If inTransaction=false (default) CMN_ID_SP is not necessarily called at all since IDs will be cached and when it is called, it will be called outside the transaction of the actual statement (probably an insert statement...). Setting this flag to "true" can help solve some blocks on SQL Server.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="sequenceName" type="xsd:string"/>
+    <xsd:attribute name="tableName" type="xsd:string"/>
+    <xsd:attribute name="sequenceType" type="SequenceTypeType"/>
+    <xsd:attribute name="inTransaction" type="xsd:boolean" default="false"/>
+  </xsd:attributeGroup>
+  <xsd:attributeGroup name="LookupGroup">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Used to improve usablity and performance of statements by removing need to join with lookup tables.  Instead only need to use the know lookup type and code to get the lookup id.  Also helps developers not hard code ids in their SQL.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="lookupCode" type="xsd:string"/>
+    <xsd:attribute name="lookupType" type="xsd:string"/>
+  </xsd:attributeGroup>
+  <xsd:attributeGroup name="SecurityObjectGroup">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Used to improve usablity and performance of statements by removing need to join with CMN_SEC_OBJECT table.  Instead only need to use the know object type, object code, and component to get the object id.  Also helps developers not hard code ids in their SQL.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="objectCode" type="xsd:string"/>
+    <xsd:attribute name="objectType" type="xsd:string"/>
+    <xsd:attribute name="componentCode" type="xsd:string"/>
+  </xsd:attributeGroup>
+  <xsd:complexType name="ParamType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Used to specify a bind variable in the statement. The param elements match the bind variables by sequence. I.e. the first '?' must be matched by the first param element.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="variation" type="VariationType" minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">The value specified by this parameter will determine if the statement text will be altered by this variation.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">This is the key of the value in the input (driving or secondary) map. Will not be used in case of "xml" input.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="path" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">This is the relative XPath expression of the value in the input (driving or secondary) node set. Will not be used in case of "map" input.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="secondaryInputId" type="IdType">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">If specified, must match a secondaryInput element of the statementRef and then the value specified by name/path will be used in this secondary input instead of the driving input.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="type" type="DataType">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The type of the bind variable. Required unless the the replace attribute or the SequenceGroup attributes or the LookupGroup attributes are specified.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="replace" type="ReplaceType">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">One of the possible replacements will be used to bind the variable.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="direction" type="DirectionType" default="IN">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Determines the direction of the bind variable.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="defaultValue" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies a value to use in case the value otherwise specified turns out to be NULL (or not exist).</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="defaultReplace" type="ReplaceType">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies a replacement macro to use in case the value otherwise specified turns out to be NULL (or not exist).</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="useDefaultIfNullButPresent" type="xsd:boolean" default="true">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Set to true if the defaultValue/defaultReplace should be used even if the value was passed but null. If set to false the defaultValue/defaultReplace will only be used if that value is not present in the input at all</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="constantValue" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies a constant value to use irrespective of the value otherwise specified.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="constantNull" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies that the value should be bound to NULL irrespective of the value otherwise specified.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attributeGroup ref="SequenceGroup"/>
+    <xsd:attributeGroup ref="LookupGroup"/>
+    <xsd:attributeGroup ref="SecurityObjectGroup"/>
+    <xsd:attribute name="scale" type="xsd:integer" default="-1">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">In case of a non-integer numeric value this specifies the scale expected.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="sessionId" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">If specified a value corresponding to it will be looked up in the current session and use to bind the variable.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="dynamicReplacement" type="ReplacementStringType">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">If specified corresponds to a replacement of dynamic SQL. This parameter will be expanded to (or collapsed) based on the parameters passed with the dynamic SQL text passed with the given string.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="expressionListTag" type="ReplacementStringType">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">If specified the parameter is assumed to be an expression list to be used in a SQL in clause. Normal bind variables cannot be used for an expression list so an explicit string replacement will be used at runtime and the value of this attribute is the unique tag in the SQL text where the string replacement will happen. The elements of the list are expected to be of the data type specified. The list of can be passed as a java.lang.String (elements delimited by @expressionListDelimiter), an array of Objects (i.e. Object[]) or a java.util.Collection of Objects. The elements are not expected to be formatted for the list even if passed a string. I.e. string elements should not be enclosed in single quotes and no parentheses should be present. At runtime a proper SQL expression list will be constructed based on the input and the data type specified. Note that much like in the case with Variations only the first row in the driving input will be used to manipulate the SQL with the expression list.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="expressionListDelimiter" type="xsd:string" default=",">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en"/>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="arrayType" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies the type of the array parameter passed. This type must be a VARRAY or a nested table type. Array parameters are only supported for Oracle at this time.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="SqlBaseType">
+    <xsd:annotation>
+      <xsd:documentation>Specifies the structure of the actual SQL statement.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="text" type="xsd:string" minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>The base text of a segment of the actual SQL statement. This text can be altered by variations.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="param" type="ParamType" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>The parmeters to use for this segment's bind variables.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="SqlType">
+    <xsd:annotation>
+      <xsd:documentation>Specifies the structure of the actual SQL statement.</xsd:documentation>
+    </xsd:annotation>
+		<xsd:complexContent>
+			<xsd:extension base="SqlBaseType">
+        <xsd:sequence>
+          <xsd:element name="condition" type="ConditionType" minOccurs="0" maxOccurs="1"/>
+          <xsd:element name="dynamicDefault" type="DynamicDefaultType" minOccurs="0" maxOccurs="unbounded">
+            <xsd:annotation>
+              <xsd:documentation>Default for dynamic replace parameters.</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="location" type="xsd:string" use="optional">
+          <xsd:annotation>
+            <xsd:documentation xml:lang="en">For internal use only.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="id" type="IdType" use="optional">
+          <xsd:annotation>
+            <xsd:documentation xml:lang="en">The id of the sql element. Must be unique within the component in which it is specified and must be of the form &lt;component&gt;.ID. This is used to reference a sql element in a sqlRef.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="dbVendor" type="DatabaseVendorType" default="all">
+          <xsd:annotation>
+            <xsd:documentation>If the SQL specified is vendor specific specify the corresponding vendor here.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="dbVersion" type="xsd:string" use="optional">
+          <xsd:annotation>
+            <xsd:documentation>If the SQL specified is vendor version specific specify the corresponding version here.
+            Can specify multiple versions using a comma-delimited list, and each version may be prefixed with a
+            traditional operator: !, &gt;, &lt;, &gt;=, or &lt;=.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="xpathCondition" type="xsd:string">
+          <xsd:annotation>
+            <xsd:documentation>An XPath expression that when applied to an input document is used to determine whether to include the SQL snippet or not. I.e. when the result is non-empty, the snippet will be included other it is not.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+			</xsd:extension>
+		</xsd:complexContent>
+  </xsd:complexType>
+  <xsd:complexType name="DbErrorType">
+    <xsd:attribute name="dbCode" type="xsd:integer" use="required">
+      <xsd:annotation>
+        <xsd:documentation>The database specific error code (e.g. Oracle unique key violation has an error code of 1) or the code returned from a user supplied excpetion raised in a stored procdure.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="dbVendor" type="DatabaseVendorType" use="required">
+      <xsd:annotation>
+        <xsd:documentation>The vendor for which this native error code is valid.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="ErrorMappingType">
+    <xsd:annotation>
+      <xsd:documentation>Elements of type errorMapping maps DB specific error codes to Application specific error codes. E.g. Oracle signals a unique key violation with an error code equal to 1 while SQL Server reports the same error with code 2601. To be able to give these errors context you specify mappings between these DB specific codes to something that makes sense in the application.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="dbError" type="DbErrorType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="applicationCode" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation>The code you want to be passed to upper layers when the dbCode is returned from the DB of type dbVendor in one of the dbError elements. If the output of the PMD is XML then this application code will be returned in the header element. If the output is of Object type then a PersistenceApplicationException will be thrown with the appropriate information.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="StatementType">
+    <xsd:annotation>
+      <xsd:documentation>A statement element contains the actual SQL text. Statements can be reused across multiple statementSets.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="secondaryInput" type="SecondaryInputType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="errorMapping" type="ErrorMappingType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:choice maxOccurs="unbounded">
+        <xsd:element name="sql" type="SqlType"/>
+        <xsd:element name="sqlRef" type="SqlRefType"/>
+      </xsd:choice>
+      <xsd:element name="outputMapping" type="OutputMappingType" minOccurs="0"/>
+      <xsd:element name="expectedResults" type="ExpectedResultsType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="location" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">For internal use only.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="id" type="IdType">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The id of the statement. Must be unique within the component in which it is specified and must be of the form &lt;component&gt;.ID.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="subjectToSorting" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation>Set to true if this query is subject to sorting. I.e. an order by will be appended to it at runtime based on an input parameter (sortColum). Note that there must not be an order by clause in the sql text or this will fail.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="subjectToSlicing" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation>Set to true if one of the result sets in this statement is subject to slicing. I.e. a slice of a result set should be returned instead of all rows. If set to true the result set to be sliced is specified by the slicedResultSetIndex attribute.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="slicedResultSetIndex" type="xsd:integer" default="0">
+      <xsd:annotation>
+        <xsd:documentation>Specifies the index (0-based) of the result set that should be sliced. Note that only one result set in a statement can be sliced.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="batchable" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation>Set to true if this statement can be executed in batch mode. This should include inserts, updates and calls to stored procedures without OUT parameters. Queries can never be batched.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attributeGroup ref="SharedStatementAttributeGroup"/>
+    <xsd:attributeGroup ref="InputAttributeGroup"/>
+    <xsd:attribute name="rowNumColumn" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation>If the statement is supposed to be sliced and the analytic functions row_number() over (order by x) and count(*) over() are used this attribute specifies the alias of the row number column.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="totalRowsColumn" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation>If the statement is supposed to be sliced and the analytic functions row_number() over (order by x) and count(*) over() are used this attribute specifies the alias of the total number of rows column (count(*)).</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="dynamicOrderByTag" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation>If the statement is supposed to be sliced and the analytic functions row_number() over (order by x) and count(*) over() are used this attribute specifies the dynamic SQL tag specifying the location of the order by clause for row_number() column.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="OutputMappingType">
+    <xsd:annotation>
+      <xsd:documentation>The outputMapping specifies how to structure or name the result set from the database.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="resultSetMap" type="ResultSetMapType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="collectionElementName" type="xsd:string"/>
+    <xsd:attribute name="rowElementName" type="xsd:string"/>
+  </xsd:complexType>
+  <xsd:complexType name="ResultSetMapType">
+    <xsd:attribute name="resultSetId" type="xsd:integer" default="-1"/>
+    <xsd:attribute name="collectionElementName" type="xsd:string"/>
+    <xsd:attribute name="rowElementName" type="xsd:string"/>
+  </xsd:complexType>
+  <xsd:complexType name="ExpectedResultsType">
+    <xsd:attribute name="count" type="xsd:integer" default="1"/>
+    <xsd:attribute name="resultSetIndex" type="xsd:integer" default="0"/>
+    <xsd:attribute name="errorCode" type="xsd:string" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="ConditionType">
+    <xsd:attributeGroup ref="InputAttributeGroup"/>
+    <xsd:attribute name="not" type="xsd:boolean" use="optional" default="false"/>
+    <xsd:attribute name="count" type="xsd:integer" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="DynamicDefaultType">
+    <xsd:complexContent>
+      <xsd:extension base="SqlBaseType">
+        <xsd:sequence>
+          <xsd:element name="condition" type="ConditionType" minOccurs="0" maxOccurs="1"/>
+        </xsd:sequence>
+        <xsd:attribute name="tag" type="xsd:string" use="required"/>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  <xsd:simpleType name="ReplacementStringType">
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="@[a-z,A-Z,0-9,_]+@"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="IdType">
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="[a-z,A-Z,0-9,_,\.,-]+"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/security-2002-02.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/security-2002-02.xsd
new file mode 100644
index 0000000..5aa359e
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/security-2002-02.xsd
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XML Spy v3.0.7 NT (http://www.xmlspy.com) by Jake Throgmorton (NIKU) -->
+<xsd:schema targetNamespace="http://schemas.niku.com/2002/security" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.niku.com/2002/security" elementFormDefault="qualified" attributeFormDefault="unqualified">
+  <xsd:simpleType name="featureType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="NONE"/>
+      <xsd:enumeration value="base"/>
+      <xsd:enumeration value="project"/>
+      <xsd:enumeration value="resource"/>
+      <xsd:enumeration value="financial"/>
+      <xsd:enumeration value="opportunity"/>
+      <xsd:enumeration value="extranet"/>
+      <xsd:enumeration value="studio"/>
+      <xsd:enumeration value="portfolio"/>
+      <xsd:enumeration value="investment"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="componentType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="NONE"/>
+      <xsd:enumeration value="BPM"/>
+      <xsd:enumeration value="SRM"/>
+      <xsd:enumeration value="PAC"/>
+      <xsd:enumeration value="CMN"/>
+      <xsd:enumeration value="WKF"/>
+      <xsd:enumeration value="CLB"/>
+      <xsd:enumeration value="MKT"/>
+      <xsd:enumeration value="BIZ"/>
+      <xsd:enumeration value="RSM"/>
+      <xsd:enumeration value="PRJ"/>
+      <xsd:enumeration value="XDM"/>
+      <xsd:enumeration value="CAL"/>
+      <xsd:enumeration value="NTD"/>
+      <xsd:enumeration value="REQ"/>
+      <xsd:enumeration value="RPT"/>
+      <xsd:enumeration value="XOG"/>
+      <xsd:enumeration value="ADM"/>
+      <xsd:enumeration value="PMA"/>
+      <xsd:enumeration value="TMS"/>
+      <xsd:enumeration value="INV"/>
+      <xsd:enumeration value="IDA"/>
+      <xsd:enumeration value="RIM"/>
+      <xsd:enumeration value="ITL"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="operatorType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="or"/>
+      <xsd:enumeration value="and"/>
+      <xsd:enumeration value="not"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:element name="acl">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Access control list root element for defining multiple policies in an external file for WMD and other XML file types.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element ref="policy" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element ref="condition" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="schemaLocation" type="xsd:string" use="optional"/>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:complexType name="PolicyBaseType">
+    <xsd:attribute name="access" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The group or right that is associated with the object and users.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="objectType" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">
+        	The type of object (e.g. PAGE, FILE, LINK, etc.), if the string is surrounded by {} then it refers
+        	to an HTTP parameter, rather than being hard coded.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="permission" type="xsd:string" default="READ">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">the permission (e.g. READ, WRITE, DELETE, etc.)</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="component" type="componentType" default="NONE">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">the component the policy belongs to</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="PolicyType">
+    <xsd:attribute name="access" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The group or right that is associated with the object and users.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="objectType" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">
+        	The type of object (e.g. PAGE, FILE, LINK, etc.), if the string is surrounded by {} then it refers
+        	to an HTTP parameter, rather than being hard coded.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="permission" type="xsd:string" default="READ">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">the permission (e.g. READ, WRITE, DELETE, etc.)</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="component" type="componentType" default="NONE">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">the component the policy belongs to</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="id" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">identifier for the policy</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="objectId" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">the object instance id (e.g. an instance of a FILE)</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="feature" type="featureType" default="NONE">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">the feature the policy belongs to</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:element name="policy" type="PolicyType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Defines user policy (permission,object,right/group) for a WMD element. Examples of WMD elements  that  might have a policy defined are: web page, action, and portlet.</xsd:documentation>
+    </xsd:annotation>
+  </xsd:element>
+  <xsd:element name="condition">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">The condition is a container for policies that are linked together to make a  complex boolean relationship.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element ref="policy" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element ref="condition" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:string" use="required">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">identifier for the complex policy</xsd:documentation>
+        </xsd:annotation>
+      </xsd:attribute>
+      <xsd:attribute name="operator" type="operatorType" use="required">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">Used to link contained policies.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:attribute>
+    </xsd:complexType>
+  </xsd:element>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/service-2002-02.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/service-2002-02.xsd
new file mode 100644
index 0000000..06794e8
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/service-2002-02.xsd
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://schemas.niku.com/2002/service" xmlns="http://schemas.niku.com/2002/service" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <xsd:simpleType name="typeType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="xbl"/>
+      <xsd:enumeration value="pmd"/>
+      <xsd:enumeration value="wsil"/>
+      <xsd:enumeration value="xmlFile"/>
+      <xsd:enumeration value="java"/>
+      <xsd:enumeration value="data"/>
+      <xsd:enumeration value="xsl"/>
+      <xsd:enumeration value="rss"/>
+      <xsd:enumeration value="htmlData"/>
+      <xsd:enumeration value="nsql"/>
+      <xsd:enumeration value="odf"/>
+      <xsd:enumeration value="odfUpdate"/>
+      <xsd:enumeration value="odfDelete"/>
+      <xsd:enumeration value="jbl"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="stateType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="init"/>
+      <xsd:enumeration value="put"/>
+      <xsd:enumeration value="get"/>
+      <xsd:enumeration value="getMergePut"/>
+      <xsd:enumeration value="merge"/>
+      <xsd:enumeration value="clear"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="transactionType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="none"/>
+      <xsd:enumeration value="dbTransaction"/>
+      <xsd:enumeration value="userTransaction"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:complexType name="XSDType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en"/>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:any minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="type" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="service" abstract="true">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en"/>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="bindings" type="BindingsType" minOccurs="0"/>
+      <xsd:element name="caches" type="CachesType" minOccurs="0"/>
+      <xsd:element name="sessionHandler" type="SessionHandlerType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="request" type="XSDType" minOccurs="0" maxOccurs="1"/>
+      <xsd:element name="response" type="XSDType" minOccurs="0" maxOccurs="1"/>
+    </xsd:sequence>
+    <xsd:attribute name="xsd" type="xsd:string" use="optional"/>
+    <xsd:attribute name="type" type="typeType" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">
+          Identifies the type of namespace being used for this description, e.g.
+          xbl - Niku's XBL files
+          pmd - Niku's PMD files
+          wsil - W3C's WSIL files
+          xmlFile - xml file located on the harddrive
+          java - java class supporting ServiceControlBinding interface
+          data - take the input XML, validate it and then return it to the client.
+          xsl - transform the input XML via  the supplied XSL
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="componentId" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">ComponentId of the service.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>    
+    <xsd:attribute name="description" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Location of the description XML file.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>   
+    <xsd:attribute name="validation" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Location of the Data Validation XML file used for complex field validation.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="dynamicValidation" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en"/>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="resource" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Location of any resource bundles that should be used by the service.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="sessionKey" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Unique session identifier used to retreive the state information for the service.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="sessionId" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Deprecated.  Use sessionKey.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="state" type="stateType" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">
+          Specifies the session state for the services that require state information to persist across multiple service calls.
+          init - is the default state and has no interaction with the cache whatsoever.
+          put - Places the input document within the cache prior to any service processing.
+          get - Retrieves the cached document from the cache and merges it (the body section only, NOT the header section ) into the input document.  Again prior to any service processing.
+          getMergePut - Retrieves the cached document from the cache and merges it (the body section only, NOT the header section ) into the input document and then places the new version
+          of the document back into the cache.  Again prior to any service processing.
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="retrieveService">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">
+        This is used for services that retrieve XML.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="service">
+        <xsd:attribute name="transaction" type="transactionType" use="optional" default="none">
+          <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+              Specifies the transaction state for the services that require transactions.
+              none - no transaction is required.
+              dbTransaction - database transaction is required, e.g. set autoCommit = false on a JDBC connection.
+              userTransaction - JTA/JTS UserTransaction is required.
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  <xsd:complexType name="processService">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">
+        This is used for services that process XML.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="service">
+        <xsd:attribute name="transaction" type="transactionType" use="optional" default="dbTransaction">
+          <xsd:annotation>
+            <xsd:documentation xml:lang="en">
+              Specifies the transaction state for the services that require transactions.
+              none - no transaction is required.
+              dbTransaction - database transaction is required, e.g. set autoCommit = false on a JDBC connection.
+              userTransaction - JTA/JTS UserTransaction is required.
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  <xsd:complexType name="BindingsType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Defines a list of service bindings.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="binding" type="BindingType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="BindingType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Defines a reference to the service binding.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="location" type="xsd:string"/>
+    <xsd:attribute name="componentId" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The component in which the binding file is located.  If not specified, it will default to the componentId of the service</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="CachesType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Defines a list of caches that should be cleared after the service has been executed.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="cache" type="CacheType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="CacheType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Specifies a cache or a specific element in a cache to be cleared. If netiher cacheKey nor cacheKeyLocation is specified all caches will be cleared. The location attributes are XPath expressions that point to a Node Set in the output document of the service call.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="cacheKey" type="xsd:string" use="optional"/>
+    <xsd:attribute name="cacheKeyLocation" type="xsd:string" use="optional"/>
+    <xsd:attribute name="key" type="xsd:string" use="optional"/>
+    <xsd:attribute name="keyLocation" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="SessionHandlerType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en"></xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="state" type="stateType" use="required"/>
+    <xsd:attribute name="select" type="xsd:string" use="optional"/>
+    <xsd:attribute name="test" type="xsd:string" use="optional"/>
+    <xsd:attribute name="default" type="xsd:boolean" use="optional"/>
+  </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/trait-2005-06.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/trait-2005-06.xsd
new file mode 100644
index 0000000..a9015db
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/trait-2005-06.xsd
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://schemas.niku.com/2005/trait" 
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+        xmlns="http://schemas.niku.com/2005/trait"
+        elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+  <xsd:include schemaLocation="./trait-types-2005-06.xsd"/>
+  
+  <xsd:element name="traits" type="TraitsType"/>
+  
+</xsd:schema>
+
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/view-2002-02.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/view-2002-02.xsd
new file mode 100644
index 0000000..0fd0829
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/view-2002-02.xsd
@@ -0,0 +1,1287 @@
+<?xml version="1.0"?>
+<xsd:schema
+  targetNamespace="http://schemas.niku.com/2002/view"
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns="http://schemas.niku.com/2002/view"
+  elementFormDefault="qualified"
+  attributeFormDefault="unqualified">
+  <xsd:include schemaLocation="./commonUI-2005-06.xsd"/>
+  <xsd:annotation>
+    <xsd:documentation>XML schema for defining abstract application data views. This schema contains high-level, GUI-independant, but application UI specific view structures. A valid instance document would use different combinations of elements defined in this schema to describe the content or a view, and is called a view XML document. Regular XSLT stylesheet with proper namespace declarations should be used to generate view XML from a data XML document which serves as a data model for the view. The UI XSL layer transforms view XML instances into final presentation markup for a client agent to display the content of a page or a portlet. Various UI XSL libraries produce different presentation markup for the final page or portlet content, such as HTML, SVG, WML, or any other presentation markup depending on the client agent.     
+    </xsd:documentation>
+  </xsd:annotation>
+  <xsd:element name="view">
+    <xsd:annotation>
+      <xsd:documentation>An abstraction of the user interface consisting of high-level UI structures and metadata to assist in rendering.
+Attributes:
+@id - The value of the html FORM name for the portlet.
+@type - Used to specify alternate processing of the view fragment when a separate portlet is specified for a portion of the page. 
+@disableEnter - When "true"; disables the form submission when user presses the "Enter" key.
+@form - Overrides the default creation of html FORM start and end pair. 
+        "false" - for portlets that do not need a form.
+        "begin" - creates a FORM start tag only. 
+        "end" - creates FORM end tag only.
+@style - applies a css class and/or special formatting of the view
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element name="events" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Global view events. These events are extracted by the layout manager and appended to the page onLoad event list to be called when the page is loading. Typically these events are used for page/portlet view initialization or page redirect and require portlet pageEvent attribute to be set to true for the page processor to detect, extract, and append such events to the page onLoad event list.</xsd:documentation>
+          </xsd:annotation>
+          <xsd:complexType>
+            <xsd:sequence>
+              <xsd:element name="event" type="Event" minOccurs="0" maxOccurs="unbounded"/>
+            </xsd:sequence>
+          </xsd:complexType>
+        </xsd:element>
+        <xsd:element name="title" type="Text" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Page Title  used to label the contents of a page. Appears once per page and as the HTML (browser) title.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="pageToolbar" type="ActionGroup" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Page toolbar contains a list of actions for defining navigation links that need to be displayed in the page personalization toolbar area (on the right-hand side of the page title panel). For page toolbars to be detected and extracted by the layout manager, each portlet containing such a toolbar definition in its view should also set its pageToolbar attribute to true.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="pageContext" type="CellGroup" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Page context contains a list of actions for defining page context information, such as properties of the object for displayed attributes page, and contextual information for naviagiting to this object/attributes page.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="titlebar" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Titlebar defines a portlet title bar with a portlet title, and optional list of portlet actions for different view modes and personalization.</xsd:documentation>
+          </xsd:annotation>
+          <xsd:complexType>
+            <xsd:sequence>
+              <xsd:element name="title" type="Text" minOccurs="0"/>
+              <xsd:element name="action" type="Action" minOccurs="0" maxOccurs="unbounded"/>
+            </xsd:sequence>
+          </xsd:complexType>
+        </xsd:element>
+        <xsd:element name="header" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Page header.</xsd:documentation>
+          </xsd:annotation>
+          <xsd:complexType>
+            <xsd:complexContent>
+              <xsd:extension base="ActionGroup">
+                <xsd:sequence>
+                  <xsd:element name="cell" type="Cell" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+              </xsd:extension>
+            </xsd:complexContent>
+          </xsd:complexType>
+        </xsd:element>
+        <xsd:element name="navigation" type="ActionGroup" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Navigation within a feature; appears within the content portion of the page.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="message" type="Message" minOccurs="0" maxOccurs="unbounded">
+          <xsd:annotation>
+            <xsd:documentation>Error, Alert and message information.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="tabs" type="ActionGroup" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Text Tabs help to organize large areas of functionality into smaller, more manageable units. Always placed at the top of the page, the first item in the Content Header Region, and they may be used in combination with SubTabs and Page Titles. </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="subtabs" type="ActionGroup" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Sub Tabs further organize information into sub-categories below a higher level set of tabs (Icon Tabs or Text Tabs). Sub Tabs can only be used below either Icon Tabs or Text Tabs. Sub Tabs can either be followed by a Tool Bar, Look Here Alert, Action Bar-Page, Secondary Breadcrumb, or Section header.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="toolbar" type="Toolbar" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Toolbars allow for general functionality, associated with a Page or Page Section, which is not well suited to Action Bars or Button Bars. Toolbar buttons are not used for adding, deleting or performing actions on selected list objects.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="buttonbar" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Button Bar offers a set of actions and links which act in some way upon the entire page. Actions appear as buttons, and links are rendered in the standard in-line link style.</xsd:documentation>
+          </xsd:annotation>
+          <xsd:complexType>
+            <xsd:complexContent>
+              <xsd:extension base="ActionGroup">
+                <xsd:attribute name="position" use="optional" default="bottom">
+                  <xsd:simpleType>
+                    <xsd:restriction base="xsd:string">
+                      <xsd:enumeration value="top"/>
+                      <xsd:enumeration value="bottom"/>
+                      <xsd:enumeration value="top-bottom"/>
+                    </xsd:restriction>
+                  </xsd:simpleType>
+                </xsd:attribute>
+              </xsd:extension>
+            </xsd:complexContent>
+          </xsd:complexType>
+        </xsd:element>
+        <xsd:choice minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Choice of having content navigation or wizard.</xsd:documentation>
+          </xsd:annotation>
+          <xsd:element name="contentNav" type="ActionGroup">
+            <xsd:annotation>
+              <xsd:documentation>Specialized navigation for a sequence of pages. Links can be marked current, available (with and without data), unavailable and finished. </xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="wizard" type="ActionGroup">
+            <xsd:annotation>
+              <xsd:documentation>Specialized navigation for a sequence of pages. Links can be marked current, available (with and without data), unavailable and finished. </xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+        </xsd:choice>
+        <xsd:choice minOccurs="0" maxOccurs="unbounded">
+          <xsd:annotation>
+            <xsd:documentation>Choice of having a section or  a group of sections.</xsd:documentation>
+          </xsd:annotation>
+          <xsd:element name="section" type="Section">
+            <xsd:annotation>
+              <xsd:documentation>A major unit of the page that can contain a title, actions, rows and cells. Can be a attributes (form) table,  list, hierarchy, calendar.</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="group" type="SectionGroup">
+            <xsd:annotation>
+              <xsd:documentation>Used to horizontally group sections. Sections contained in a group will stack horizontally rather than vertically.</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+        </xsd:choice>
+        <xsd:element name="legends" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Container for view level custom legend, mirroing the section level custom legend</xsd:documentation>
+          </xsd:annotation>
+          <xsd:complexType>
+            <xsd:sequence>
+              <xsd:element name="legend" type="Text" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>Custom legend element for view level legends.</xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+            </xsd:sequence>
+          </xsd:complexType>
+        </xsd:element>
+        <xsd:element name="footer" type="ActionGroup" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Page footer.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:string" use="required"/>
+      <xsd:attribute name="style" type="xsd:string" use="optional"/>
+      <xsd:attribute name="type" use="required">
+        <xsd:simpleType>
+          <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="content"/>
+            <xsd:enumeration value="header"/>
+            <xsd:enumeration value="footer"/>
+            <xsd:enumeration value="navigation"/>
+            <xsd:enumeration value="footerLaunch"/>
+            <xsd:enumeration value="footerLogin"/>
+            <xsd:enumeration value="wizard"/>
+            <xsd:enumeration value="breadcrumbs"/>
+          </xsd:restriction>
+        </xsd:simpleType>
+      </xsd:attribute>
+      <xsd:attribute name="disableEnter" type="xsd:boolean" use="optional" default="false"/>
+      <xsd:attribute name="pageType" use="optional">
+        <xsd:simpleType>
+          <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="property"/>
+            <xsd:enumeration value="filter"/>
+          </xsd:restriction>
+        </xsd:simpleType>
+      </xsd:attribute>
+      <xsd:attribute name="form" use="optional">
+        <xsd:simpleType>
+          <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="false"/>
+            <xsd:enumeration value="begin"/>
+            <xsd:enumeration value="end"/>
+          </xsd:restriction>
+        </xsd:simpleType>
+      </xsd:attribute>
+    </xsd:complexType>
+  </xsd:element>
+  <!-- end of view element -->
+
+  <xsd:complexType name="Text">
+    <xsd:complexContent>
+      <xsd:extension base="Label">
+        <xsd:sequence>
+          <xsd:element name="sectionContext" type="CellGroup" minOccurs="0">
+            <xsd:annotation>
+              <xsd:documentation>
+                Allows there to be context in the section title.
+              </xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+        </xsd:sequence>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+
+  <xsd:complexType name="Cell">
+    <xsd:annotation>
+      <xsd:documentation>This is the most atomic element in a section.
+Attributes:
+@id - unique identifier for cell. required when the cell represents an HTML form element
+@type - Each type maps to a(n) XSLT template(s) for rendering the related toolkit pattern.
+             indent - used to indent groups of cells
+             hidden - equivalent to html input type="hidden", no display
+              checkbox - equivalent to html input type="checkbox"
+             listbox - equivalent to html select with size > 1          
+             password - equivalent to html input type="password" obscures typed text
+             radio - equivalent to html input type="radio"
+             select - equivalent to html select 
+             text - equivalent to html input type="text"
+             textarea - equivalent to html textarea
+             file - equivalent to html input type="file"
+             vgroup - vertical grouping of cells
+             hgroup - horizontal grouping of cells
+             ptrnDatePicker - pattern for date picker
+             ptrnListBoxSrtRmv - pattern for list box with a sort up/down and remove button
+             ptrnListBoxSrt - pattern for list box with a sort up/down 
+             ptrnPmpy - pattern for Push Me Pull You list boxes (left and right list boxes with arrow buttons to move items from one to the other)
+             ptrnPmpySrt - pattern for sortable Push Me Pull You list boxes (left and right list boxes with arrow buttons to move items from one to the other plus up/down)
+             ptrnRecurring - pattern for recurring date
+             rowHeader - pattern for the start of a row in a grid.  Used in calendar
+             selected - pattern for a selected special cell. Used in calendar.
+             blank - pattern for a blank cells. Used in calendar.
+             selectedBlank - pattern for a selected  blank cells. Used in calendar.
+             gap - used in the priority list pattern
+             overBudget - used in the priority list pattern
+@width - text, password - size attribute of correspondind html element, textarea - # cols, select and listbox - pixel override of width in a style
+@height - select and listbox - the number of options to display, textarea - number of rows 
+@disabled - "true" will render form elements as static value (no form widget, just its current value(s))
+@readOnly - "true" will render form elements as greyed out and uneditable
+@required -  "true" will display the required icon next to a form element
+@unique - "true" will display the unique icon next to a form element
+@enterOnce - "true" will display the enter once icon next to a form element
+@locked - "true" will display the locked icon next to a form element
+@maxDataSize - specifies the maxlength attribute of a text or password form element
+@style - applies a css class and/or special formatting of the cell
+@align - specifies the horizontal alingment of the cell contents
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="label" type="Text" minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>For attributes, the label that appears to the left of the attribute table cell.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="hint" type="Text" minOccurs="0"/>
+      <xsd:element name="tip" type="Text" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>Provides additional instructions to user about the item. Localized. Can be used for context sensitive help.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="event" type="Event" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>Defines an event handler to map a handler function to an event that a client can trigger. (e.g. onFocus)</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="data" type="Data" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>Dynamic data from Data XML.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="image" type="Image" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>Represents a gif or jpg.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="xhtml" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>allows you to add xhtml to the page</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="action" type="Action" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>Navigation or event triggering.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="toolbar" type="Toolbar" minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>Cell editing toolbar.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="message" type="Message" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="error" type="Message" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>Message indicating a processing problem related to the form attribute.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="cell" type="Cell" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>Group cells into logical patterns. (e.g. Push-me Pull-you)</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:string" use="optional"/>
+    <xsd:attribute name="type" use="optional" default="text">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="indent"/>
+          <xsd:enumeration value="hidden"/>
+          <xsd:enumeration value="checkbox"/>
+          <xsd:enumeration value="listbox"/>
+          <xsd:enumeration value="comboBox"/>
+          <xsd:enumeration value="password"/>
+          <xsd:enumeration value="radio"/>
+          <xsd:enumeration value="select"/>
+          <xsd:enumeration value="text"/>
+          <xsd:enumeration value="textarea"/>
+          <xsd:enumeration value="file"/>
+          <xsd:enumeration value="task"/>
+          <xsd:enumeration value="progress"/>
+          <xsd:enumeration value="vgroup"/>
+          <xsd:enumeration value="hgroup"/>
+          <xsd:enumeration value="selected"/>
+          <xsd:enumeration value="blank"/>
+          <xsd:enumeration value="ptrnDatePicker"/>
+          <xsd:enumeration value="ptrnListBoxSrtRmv"/>
+          <xsd:enumeration value="ptrnListBoxSrt"/>
+          <xsd:enumeration value="ptrnPmpy"/>
+          <xsd:enumeration value="ptrnPmpySrt"/>
+          <xsd:enumeration value="ptrnRecurring"/>
+          <xsd:enumeration value="rowHeader"/>
+          <xsd:enumeration value="selectedBlank"/>
+          <xsd:enumeration value="htmlText"/>
+          <xsd:enumeration value="preText"/>
+          <xsd:enumeration value="gap"/>
+          <xsd:enumeration value="overBudget"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="width" type="xsd:string" use="optional"/>
+    <xsd:attribute name="height" type="xsd:string" use="optional"/>
+    <xsd:attribute name="disabled" type="xsd:boolean" use="optional" default="true"/>
+    <xsd:attribute name="readOnly" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="required" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="unique" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="exact" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="enterOnce" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="locked" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="maxDataSize" type="xsd:integer" use="optional"/>
+    <xsd:attribute name="style" type="xsd:string" use="optional"/>
+    <xsd:attribute name="align" use="optional" default="left">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="left"/>
+          <xsd:enumeration value="center"/>
+          <xsd:enumeration value="right"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="textOnly" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="nowrap" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="noDynHeight" type="xsd:duration" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="Col">
+    <xsd:annotation>
+      <xsd:documentation>Used to define columns in a list table.
+Attributes:
+@id - unique identifier for a column !VERY IMPORTANT! passed as a parameter for currently sorted column
+@actionId - the action that will be followed when a sortable column hyperlink is clicked
+@type - sort - column label will be a hyperlink that navigates with the sort params, noSort - static label, checkAll - Select All icon and javascript, selected - in calendar means is highlighted specially  
+@width - sets the with attribute of the TD for the column header, can be pixels or percentage
+@align - sets the horizontal alignment of the column header (left, center, right)
+@required - displays the Required icon next to the column header label, triggers the display of the legend
+@span - sets the colspan attribute of the TD for the colmn header
+@style - CSS class - alternative action object presentation style
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="label" type="Text" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>For attributes, the label that appears to the left of the attribute cell.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="event" type="Event" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>Defines an event handler to map a handler function to an event that a client can trigger. (e.g. onFocus)</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="data" type="Data" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>Defines an event handler to map a handler function to an event that a client can trigger. (e.g. onFocus)</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:string" use="required"/>
+    <xsd:attribute name="actionId" type="xsd:string" use="optional"/>
+    <xsd:attribute name="type" use="required">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="sort"/>
+          <xsd:enumeration value="noSort"/>
+          <xsd:enumeration value="checkAll"/>
+          <xsd:enumeration value="selected"/>
+          <xsd:enumeration value="staticSortAsc"/>
+          <xsd:enumeration value="staticSortDesc"/>
+          <xsd:enumeration value="timePeriod"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="width" type="xsd:string" use="optional"/>
+    <xsd:attribute name="align" use="optional" default="left">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="left"/>
+          <xsd:enumeration value="center"/>
+          <xsd:enumeration value="right"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="required" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="span" type="xsd:string" use="optional"/>
+    <xsd:attribute name="style" type="xsd:string" use="optional"/>
+    <xsd:attribute name="nowrap" type="xsd:boolean" use="optional" default="true"/>
+  </xsd:complexType>
+  <xsd:complexType name="Data">
+    <xsd:annotation>
+      <xsd:documentation>Can represent either placeholders for dynamic data or paramters for JavaScript functions.
+Attributes or Option values in a Select:
+label subElement - When is a option in a select
+event subElement - When using a jumpmenu.
+@id - when specifying JavaScript parameters. 
+  paired with @value to produce javascript:myFunction('idValue=valueValue'); QUOTED
+  @id alone represents a javascript variable or html object (e.g. a form element object), produces javascript:myFunction(_helpID); NO QUOTES
+@value - when contained by a cell it represents a placeholder for dynamic data
+            when specifying JavaScript parmaters.
+            paired with @id attribute to produce javascript:myFunction('idValue=valueValue'); QUOTED
+            @value alone represents a string value, produces javascript:myFunction('valueValue'); QUOTED
+@selected - sets the selected attribute on select and radio form elements and checked on checkbox form elements
+@type - data type, can assist formatting
+          </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="label" type="Text" minOccurs="0"/>
+      <xsd:element name="event" type="Event" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:string" use="optional"/>
+    <xsd:attribute name="value" type="xsd:string" use="optional"/>
+    <xsd:attribute name="selected" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="type" use="optional">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="currency"/>
+          <xsd:enumeration value="id"/>
+          <xsd:enumeration value="int"/>
+          <xsd:enumeration value="string"/>
+          <xsd:enumeration value="boolean"/>
+          <xsd:enumeration value="double"/>
+          <xsd:enumeration value="float"/>
+          <xsd:enumeration value="percentage"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:anyAttribute processContents="skip"/>
+  </xsd:complexType>
+  <xsd:complexType name="Image">
+    <xsd:annotation>
+      <xsd:documentation>displays a gif or jpg
+Attributes:
+@url - overrides the @src attribute. specifies an absolute path to an image.
+@width - width in pixels
+@height - height in pixels
+@align - alignment
+@src - image name without the extension
+@type - image extension (gif, jpg)
+@highlight - indicates whether or not the image has mouseover behavior
+@selected - display as selected state
+          </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="tip" type="Text" minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>Image tool tip and alt text</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="url" type="xsd:string" use="optional"/>
+    <xsd:attribute name="width" type="xsd:string" use="optional"/>
+    <xsd:attribute name="height" type="xsd:string" use="optional"/>
+    <xsd:attribute name="align" type="xsd:string" use="optional"/>
+    <xsd:attribute name="src" type="xsd:string" use="required"/>
+    <xsd:attribute name="type" use="required">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="gif"/>
+          <xsd:enumeration value="jpg"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="highlight" type="xsd:boolean" use="optional"/>
+    <xsd:attribute name="selected" type="xsd:boolean" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="Event">
+    <xsd:annotation>
+      <xsd:documentation>Defines an event handler to map a handler function to an event that a client can trigger.
+Attributes:
+@id - the id of this event that maps directly to the JavaScript or WMLScript function name or other handler depending on the client.
+@type - the type of the event. If no type is specified the event behaves as an onClick event.
+        </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="data" type="Data" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:string" use="required"/>
+    <xsd:attribute name="type" use="required">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="onAbort"/>
+          <xsd:enumeration value="onBlur"/>
+          <xsd:enumeration value="onChange"/>
+          <xsd:enumeration value="onClick"/>
+          <xsd:enumeration value="onDblClick"/>
+          <xsd:enumeration value="onDragDrop"/>
+          <xsd:enumeration value="onError"/>
+          <xsd:enumeration value="onFocus"/>
+          <xsd:enumeration value="onKeyDown"/>
+          <xsd:enumeration value="onKeyPress"/>
+          <xsd:enumeration value="onKeyUp"/>
+          <xsd:enumeration value="onLoad"/>
+          <xsd:enumeration value="onMouseDown"/>
+          <xsd:enumeration value="onMouseMove"/>
+          <xsd:enumeration value="onMouseOut"/>
+          <xsd:enumeration value="onMouseOver"/>
+          <xsd:enumeration value="onMouseUp"/>
+          <xsd:enumeration value="onMove"/>
+          <xsd:enumeration value="onReset"/>
+          <xsd:enumeration value="onResize"/>
+          <xsd:enumeration value="onSelect"/>
+          <xsd:enumeration value="onSubmit"/>
+          <xsd:enumeration value="onUnload"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+  </xsd:complexType>
+
+  <xsd:complexType name="Action">
+    <xsd:complexContent>
+      <xsd:extension base="ActionType">
+        <xsd:sequence>
+          <xsd:annotation>
+            <xsd:documentation>Action can have either a label or image</xsd:documentation>
+          </xsd:annotation>
+          <xsd:element name="label" type="Text" minOccurs="0" maxOccurs="unbounded">
+            <xsd:annotation>
+              <xsd:documentation>Link label</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="image" type="Image">
+            <xsd:annotation>
+              <xsd:documentation>Link image</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="tip" type="Text" minOccurs="0">
+            <xsd:annotation>
+              <xsd:documentation>Link tip, this overrides the image tip</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="data" type="Data" minOccurs="0" maxOccurs="unbounded">
+            <xsd:annotation>
+              <xsd:documentation>Parameters for the JavaScript of the action</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="event" type="Event" minOccurs="0" maxOccurs="unbounded">
+            <xsd:annotation>
+              <xsd:documentation>Used to call custom JS events</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="action" type="Action" minOccurs="0" maxOccurs="unbounded">
+            <xsd:annotation>
+              <xsd:documentation>Nested action used to group actions under a parent action.</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+        </xsd:sequence>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+
+  <xsd:complexType name="TextGroup">
+    <xsd:annotation>
+      <xsd:documentation>Used as a container to group cell elements</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="label" type="Text" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="style" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="CellGroup">
+    <xsd:annotation>
+      <xsd:documentation>Used as a container to group cell elements</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="cell" type="Cell" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="style" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="ColGroup">
+    <xsd:annotation>
+      <xsd:documentation>Used as a container to group column elements</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="label" type="Text" minOccurs="0"/>
+      <xsd:element name="col" type="Col" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="Row">
+    <xsd:annotation>
+      <xsd:documentation>Rows are used for modeling collections and hierarchical structures for list and tree list tables. The optional action element is for overriding tree list row element nodes with an alternative expand/collapse and leaf node actions.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="CellGroup">
+        <xsd:sequence>
+          <xsd:element name="title" type="Text" minOccurs="0">
+            <xsd:annotation>
+              <xsd:documentation>The title for a row</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="action" type="Action" minOccurs="0"/>
+          <xsd:element name="row" type="Row" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="state" use="optional">
+          <xsd:simpleType>
+            <xsd:restriction base="xsd:string">
+              <xsd:enumeration value="collapsed"/>
+              <xsd:enumeration value="expanded"/>
+              <xsd:enumeration value="leaf"/>
+            </xsd:restriction>
+          </xsd:simpleType>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  <xsd:complexType name="ActionGroup">
+    <xsd:annotation>
+      <xsd:documentation>Defines a multiple set of actions that can be represented by a menu bar, table of contents, a toolbar, etc.  
+Attributes:
+@id - type of the collection.
+@selected - id for the selected action (e.g. the currently selected tab should be disabled and highlighted)
+          </xsd:documentation>
+    </xsd:annotation>
+    <xsd:choice minOccurs="0" maxOccurs="unbounded">
+      <xsd:element name="action" type="Action"/>
+      <xsd:element name="separator" type="Separator"/>
+    </xsd:choice>
+    <xsd:attribute name="id" type="xsd:string" use="optional"/>
+    <xsd:attribute name="selected" type="xsd:string" use="optional"/>
+  </xsd:complexType>
+  <xsd:complexType name="Separator">
+    <xsd:annotation>
+      <xsd:documentation>Definies a separator for various navigation widgets and actions.</xsd:documentation>
+    </xsd:annotation>
+  </xsd:complexType>
+  <xsd:complexType name="Toolbar">
+    <xsd:annotation>
+      <xsd:documentation>Same as ActionGroup with the addition of optional cells.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence minOccurs="0">
+      <xsd:element name="cell" type="Cell" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="action" type="Action" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="SectionGroup">
+    <xsd:annotation>
+      <xsd:documentation>Used as a container to group section elements</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="section" type="Section" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="Message">
+    <xsd:annotation>
+      <xsd:documentation>Messages are used to convey important information to the user. 
+Attributes:
+@id - unique identifier of message
+@value - message text
+@type - the type of message 
+  error - indicate page processing errors (e.g. incorrect date format)
+  warning - system level waring
+  info - "Look Here"; draws attention to a section of the page (e.g. "Bill has the file checked out")
+  alert - indicate important information (e.g. user successfully added)
+  instruction - "Look Here"; draws attention to a section of the page (e.g. "Bill has the file checked out")
+  fatalError- system critical message (e.g. "No license found")
+xsd:anyAttribute - allows xml:lang attribute on the text element. 
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+      <xsd:element name="cell" type="Cell" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>Used when the message is dynamically generated</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="action" type="Action" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:string" use="optional"/>
+    <xsd:attribute name="value" type="xsd:string" use="optional"/>
+    <xsd:attribute name="type" use="optional" default="error">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="error"/>
+          <xsd:enumeration value="warning"/>
+          <xsd:enumeration value="info"/>
+          <xsd:enumeration value="alert"/>
+          <xsd:enumeration value="fatalError"/>
+          <xsd:enumeration value="instruction"/>
+          <xsd:enumeration value="noResults"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:anyAttribute processContents="skip"/>
+  </xsd:complexType>
+  <xsd:complexType name="Pagination">
+    <xsd:annotation>
+      <xsd:documentation>Provides the attributes necessary to render the pagination based upon the sliced data
+Attributes:
+@totalNumRows - the number of records in the complete set of data resulting from a query
+@slice - the current subset of the sliced data (0 based index)
+@sliceSize - the number of records contained in each subset of sliced data
+@actionId - the action to follow when a pagination link is clicked      
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+      <xsd:element name="label" type="Text" maxOccurs="unbounded"/>
+      <xsd:element name="action" type="Action" minOccurs="0"/>
+      <xsd:element name="data" type="Data" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="totalNumRows" type="xsd:string" use="required"/>
+    <xsd:attribute name="slice" type="xsd:string" use="required"/>
+    <xsd:attribute name="sliceSize" type="xsd:string" use="required"/>
+    <xsd:attribute name="actionId" type="xsd:string" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="Section">
+    <xsd:annotation>
+      <xsd:documentation>Subdivision of a page.
+Attributes:
+@id - unique identifier of a section
+@type - specifies the XSLT template to transform the section
+  attributes - properties section with pairs of labels and form widgets
+  list - list section with column headings and rows of cells
+  treeList - tree list section
+  collapsedTreeList - collapsed tree list section 
+   image - image section
+   pie - SVG graph
+  funnel - SVG graph
+  bubble - SVG graph
+  bar - SVG graph
+  column - SVG graph
+  line - SVG graph
+  dot - SVG graph
+@style - overrides the CSS class of the section
+@sortColumn - should match the @id attribute of the currently sorted column
+@sortDirection - direction of the sort (asc = ascending A-Z, desc = descending Z-A)
+@mode - Optional qualifier to UI rendering.  Used in attributes section rendering to specify whether label column is present.  Options are 'single' or 'multi' (default).
+          </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="message" type="Message" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>Instructional text that appears at the top of the section.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="image" type="Image" minOccurs="0" maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>Image element for sections that only hold images.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:choice minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>Choice, of either having title or text tabs</xsd:documentation>
+        </xsd:annotation>
+        <xsd:element name="title" type="Text">
+          <xsd:annotation>
+            <xsd:documentation>Text and optional image contained by a single row table. Sections titles divide pages into useful groupings of information and aide the user to quickly identify relevant areas.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:sequence>
+          <xsd:element name="texttabs" type="ActionGroup">
+            <xsd:annotation>
+              <xsd:documentation>Tab navigation widget. The selected tab appears highlighted andnon-clickable</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="subtabs" type="ActionGroup" minOccurs="0">
+            <xsd:annotation>
+              <xsd:documentation>Used to provide further granularity below higher-level tabs.</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:element name="toolbar" type="Toolbar" minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>Similar to page-toolbar, but the actions are relevant to the containing section. Offer added navigation and functionality to the information grouped below.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="buttonbar" type="ActionGroup" minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>Contains form buttons and/or navigation links. The buttons are specific to the containing section.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="breadcrumbs" type="ActionGroup" minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>Sub-navigation related to the section. (e.g. a trail of resource names browsed)</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:choice>
+        <xsd:choice minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Attributes</xsd:documentation>
+          </xsd:annotation>
+          <xsd:element name="cell" type="Cell" maxOccurs="unbounded">
+            <xsd:annotation>
+              <xsd:documentation>Represent form elements or containers for labels, images and hyperlinks</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="group" maxOccurs="unbounded">
+            <xsd:annotation>
+              <xsd:documentation>Group attributes horizontally. Every group will create a new column of attributes.</xsd:documentation>
+            </xsd:annotation>
+            <xsd:complexType>
+              <xsd:complexContent>
+                <xsd:extension base="CellGroup">
+                  <xsd:attribute name="width" type="xsd:string"/>
+                </xsd:extension>
+              </xsd:complexContent>
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+        <xsd:sequence minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>List</xsd:documentation>
+          </xsd:annotation>
+          <xsd:element name="headerRow" type="ColGroup" minOccurs="0" maxOccurs="unbounded">
+            <xsd:annotation>
+              <xsd:documentation>Groups of Colums in a list. The number of cells in each row should a match the total number of cols.</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="col" type="Col" minOccurs="0" maxOccurs="unbounded">
+            <xsd:annotation>
+              <xsd:documentation>Colums in a list. The number of cells in each row should a match the total number of cols.</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="row" type="Row" minOccurs="0" maxOccurs="unbounded">
+            <xsd:annotation>
+              <xsd:documentation>row reperesents each row in a list, a row contains cells</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+        </xsd:sequence>
+        <xsd:sequence minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>Calendar</xsd:documentation>
+          </xsd:annotation>
+          <xsd:element name="col" type="Col" minOccurs="0" maxOccurs="unbounded">
+            <xsd:annotation>
+              <xsd:documentation>Colums in a list. The number of cells in each row should a match the total number of cols.</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="cell" type="Cell" maxOccurs="unbounded">
+            <xsd:annotation>
+              <xsd:documentation>Represent days or hours or events</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+          <xsd:element name="group" type="CellGroup" maxOccurs="unbounded">
+            <xsd:annotation>
+              <xsd:documentation>Groupings of days or hours.  Represents weeks or hour of events.</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:element name="pagination" type="Pagination" minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>Pagination related to the list of data.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="graphInfo" type="GraphInfo" minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>If the type attribute=graph, then graphInfo must be present.  This element contains all the metadata the SVG XSL needs to render a graph</xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="legends" minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>Container for section level custom legend, mirroing the view level custom legend</xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+          <xsd:sequence>
+            <xsd:element name="legend" type="Text" maxOccurs="unbounded">
+              <xsd:annotation>
+                <xsd:documentation>Custom legend element for section level legends</xsd:documentation>
+              </xsd:annotation>
+            </xsd:element>
+          </xsd:sequence>
+        </xsd:complexType>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:string" use="optional"/>
+    <xsd:attribute name="type" use="required">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="hidden"/>
+          <xsd:enumeration value="attributes"/>
+          <xsd:enumeration value="list"/>
+          <xsd:enumeration value="treeList"/>
+          <xsd:enumeration value="collapsedTreeList"/>
+          <xsd:enumeration value="image"/>
+          <xsd:enumeration value="nugget"/>
+          <xsd:enumeration value="graph"/>
+          <xsd:enumeration value="hierarchy"/>
+          <xsd:enumeration value="flatHierarchy"/>
+          <xsd:enumeration value="day"/>
+          <xsd:enumeration value="week"/>
+          <xsd:enumeration value="month"/>
+          <xsd:enumeration value="nuggetDay"/>
+          <xsd:enumeration value="nuggetWeek"/>
+          <xsd:enumeration value="nuggetMonth"/>
+          <xsd:enumeration value="availability"/>
+          <xsd:enumeration value="priorityListChart"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="style" use="optional">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="highlight"/>
+          <xsd:enumeration value="noHighlight"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="size" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>If a graph section, this is the default size of the graph</xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="small"/>
+          <xsd:enumeration value="medium"/>
+          <xsd:enumeration value="large"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="sortColumn" type="xsd:string" use="optional"/>
+    <xsd:attribute name="sortDirection" use="optional" default="asc">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="asc"/>
+          <xsd:enumeration value="desc"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="mode" use="optional" default="multi">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="single"/>
+          <xsd:enumeration value="multi"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="columns" type="xsd:integer">
+      <xsd:annotation>
+        <xsd:documentation>For use in attributes sections to provide automatic flow layout of cells into columns</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="GraphInfo">
+    <xsd:annotation>
+      <xsd:documentation>A complex type for all the graph metatdata</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="dataSeries" maxOccurs="unbounded">
+        <xsd:complexType>
+          <xsd:attribute name="numDataPoints" type="xsd:integer" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The number of data points in the series</xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="numValuesPerDataPoint" type="xsd:integer" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The number of values per datapoint in the series</xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+        </xsd:complexType>
+      </xsd:element>
+      <xsd:element name="axis" minOccurs="0" maxOccurs="2">
+        <xsd:complexType>
+          <xsd:annotation>
+            <xsd:documentation>A axis of the graph</xsd:documentation>
+          </xsd:annotation>
+          <xsd:sequence>
+            <xsd:element name="label" type="Text">
+              <xsd:annotation>
+                <xsd:documentation>The axis label</xsd:documentation>
+              </xsd:annotation>
+            </xsd:element>
+          </xsd:sequence>
+          <xsd:attribute name="name" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The name of the axis</xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+              <xsd:restriction base="xsd:string">
+                <xsd:enumeration value="x"/>
+                <xsd:enumeration value="y"/>
+              </xsd:restriction>
+            </xsd:simpleType>
+          </xsd:attribute>
+          <xsd:attribute name="isCategory" use="required">
+            <xsd:annotation>
+              <xsd:documentation>True if the axis is a category axis</xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+              <xsd:restriction base="xsd:string">
+                <xsd:enumeration value="true"/>
+                <xsd:enumeration value="false"/>
+              </xsd:restriction>
+            </xsd:simpleType>
+          </xsd:attribute>
+          <xsd:attribute name="minValue" type="xsd:double" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The minimum value of the axis</xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="maxValue" type="xsd:double" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The maximum value of the axis</xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="majorUnit" type="xsd:double" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The value of the major incremental unit</xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="minorUnit" type="xsd:double" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The value of the minor incremental unit</xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="crossesAt" type="xsd:double" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The value on the opposite axis that determines where this axis crosses the opposite axis</xsd:documentation>
+            </xsd:annotation>
+          </xsd:attribute>
+          <xsd:attribute name="labelAngle" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The angle of rotation for the tick labels</xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+              <xsd:restriction base="xsd:integer">
+                <xsd:maxInclusive value="90"/>
+                <xsd:minExclusive value="-90"/>
+              </xsd:restriction>
+            </xsd:simpleType>
+          </xsd:attribute>
+          <xsd:attribute name="numDigitsAfterDec" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The value on the opposite axis that determines where this axis crosses the opposite axis</xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+              <xsd:restriction base="xsd:integer">
+                <xsd:minExclusive value="0"/>
+              </xsd:restriction>
+            </xsd:simpleType>
+          </xsd:attribute>
+          <xsd:attribute name="isLabelGrouped" use="required">
+            <xsd:annotation>
+              <xsd:documentation>True if grouping should be used when rendering tick labels</xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+              <xsd:restriction base="xsd:string">
+                <xsd:enumeration value="true"/>
+                <xsd:enumeration value="false"/>
+              </xsd:restriction>
+            </xsd:simpleType>
+          </xsd:attribute>
+          <xsd:attribute name="majorTick" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The code for the type of major ticks to render</xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+              <xsd:restriction base="xsd:string">
+                <xsd:enumeration value="none"/>
+                <xsd:enumeration value="cross"/>
+                <xsd:enumeration value="inside"/>
+                <xsd:enumeration value="outside"/>
+              </xsd:restriction>
+            </xsd:simpleType>
+          </xsd:attribute>
+          <xsd:attribute name="minorTick" use="required">
+            <xsd:annotation>
+              <xsd:documentation>The code for the type of minor ticks to render</xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+              <xsd:restriction base="xsd:string">
+                <xsd:enumeration value="none"/>
+                <xsd:enumeration value="cross"/>
+                <xsd:enumeration value="inside"/>
+                <xsd:enumeration value="outside"/>
+              </xsd:restriction>
+            </xsd:simpleType>
+          </xsd:attribute>
+          <xsd:attribute name="showAxis" use="required">
+            <xsd:annotation>
+              <xsd:documentation>True if the axis, ticks, and labels should be rendered</xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+              <xsd:restriction base="xsd:string">
+                <xsd:enumeration value="true"/>
+                <xsd:enumeration value="false"/>
+              </xsd:restriction>
+            </xsd:simpleType>
+          </xsd:attribute>
+          <xsd:attribute name="showTickLabels" use="required">
+            <xsd:annotation>
+              <xsd:documentation>True if the tick labels should be rendered</xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+              <xsd:restriction base="xsd:string">
+                <xsd:enumeration value="true"/>
+                <xsd:enumeration value="false"/>
+              </xsd:restriction>
+            </xsd:simpleType>
+          </xsd:attribute>
+          <xsd:attribute name="showMajorLines" use="required">
+            <xsd:annotation>
+              <xsd:documentation>True if the major grid lines should be rendered</xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+              <xsd:restriction base="xsd:string">
+                <xsd:enumeration value="true"/>
+                <xsd:enumeration value="false"/>
+              </xsd:restriction>
+            </xsd:simpleType>
+          </xsd:attribute>
+          <xsd:attribute name="showMinorLines" use="required">
+            <xsd:annotation>
+              <xsd:documentation>True if the minor grid lines should be rendered</xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+              <xsd:restriction base="xsd:string">
+                <xsd:enumeration value="true"/>
+                <xsd:enumeration value="false"/>
+              </xsd:restriction>
+            </xsd:simpleType>
+          </xsd:attribute>
+        </xsd:complexType>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="type" use="required">
+      <xsd:annotation>
+        <xsd:documentation>The graph type</xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="bar"/>
+          <xsd:enumeration value="column"/>
+          <xsd:enumeration value="funnel"/>
+          <xsd:enumeration value="line"/>
+          <xsd:enumeration value="pie"/>
+          <xsd:enumeration value="bubble"/>
+          <xsd:enumeration value="scatterplot"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="actionId" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation>When the graph is rendered as SVG content in the browser, this is the actionId the SVG plugin should use to retrieve the SVG content</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="showLegend" use="required">
+      <xsd:annotation>
+        <xsd:documentation>Show or hide the legend</xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="true"/>
+          <xsd:enumeration value="false"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="showTitle" use="required">
+      <xsd:annotation>
+        <xsd:documentation>Show or hide the title</xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="true"/>
+          <xsd:enumeration value="false"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="showLines" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation>Show or hide the lines of a line graph</xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="true"/>
+          <xsd:enumeration value="false"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="showLineMarkers" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation>Show or hide the datapoint markers on the lines of a line graph</xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="true"/>
+          <xsd:enumeration value="false"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="isStacked" use="required">
+      <xsd:annotation>
+        <xsd:documentation>Bar and column graphs can be stacked.  Should be false for all other graph types</xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="true"/>
+          <xsd:enumeration value="false"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="dataLabels" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>The code for the displayed value of the datapoint labels</xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="none"/>
+          <xsd:enumeration value="value"/>
+          <xsd:enumeration value="percent"/>
+          <xsd:enumeration value="label"/>
+          <xsd:enumeration value="labelpercent"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="tooltipLabels" use="optional">
+      <xsd:annotation>
+        <xsd:documentation>The code for the displayed value of the mouseover labels</xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="none"/>
+          <xsd:enumeration value="value"/>
+          <xsd:enumeration value="percent"/>
+          <xsd:enumeration value="label"/>
+          <xsd:enumeration value="labelpercent"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
+    <xsd:attribute name="maxCategoryItemChars" type="xsd:integer" use="required">
+      <xsd:annotation>
+        <xsd:documentation>The number of characters in the category item with the most characters.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="maxSeriesItemChars" type="xsd:integer" use="required">
+      <xsd:annotation>
+        <xsd:documentation>The number of characters in the series item with the most characters.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/viewL10nConfig-2002-07.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/viewL10nConfig-2002-07.xsd
new file mode 100644
index 0000000..b906bfa
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/viewL10nConfig-2002-07.xsd
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://schemas.niku.com/2002/viewL10nConfig" xmlns="http://schemas.niku.com/2002/viewL10nConfig" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xsd:element name="viewL10nConfig" type="viewL10nConfigType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">The root element for the configuration data</xsd:documentation>
+    </xsd:annotation>
+  </xsd:element>
+  <xsd:complexType name="viewL10nConfigType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">The type definition for the root element of the configuration data</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="namespace" type="namespaceType" maxOccurs="unbounded"/>
+      <xsd:element name="element" type="elementType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="defaultLocation" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies the default location of the value to localize for any non-standard element.  Usually the name of an attribute.  The special value, #content, signifies the element content.  If the defaultLocation is a name of an attribute and that attribute is not found, the element content will be localized.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="namespaceType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">The type definition of a XML namespace for the configuration of the l10n tools.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="id" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The id of the namespace.  Must be unique within a instance document of this schema.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="uri" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The URI that uniquely identifies the namespace.  Must exactly match the URI of the namespace of the element in a VXSL file.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="elementType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">The type definition for an element for the configuration of the l10n tools.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The name of the element.  Must exactly match the local name of the element in the VXSL.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="namespace" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The id of the namespace the element belongs to.  Must exactly match the id of a previously defined namespace in this configuration file.   See the namespaceType</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="location" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The location of the localizable value.  Usually this is a name of a attribute of the element that contains the localizable value.  The special value, #content, can be used to signify the element content.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/web-2002-02.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/web-2002-02.xsd
new file mode 100644
index 0000000..c8613fd
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/web-2002-02.xsd
@@ -0,0 +1,881 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://schemas.niku.com/2002/web" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns="http://schemas.niku.com/2002/web" xmlns:sec="http://schemas.niku.com/2002/security"
+            xmlns:srv="http://schemas.niku.com/2002/service" xmlns:xi="http://www.w3.org/2001/XInclude"
+            elementFormDefault="qualified">
+  <!-- import XInclude schema -->
+  <xsd:import namespace="http://www.w3.org/2001/XInclude" schemaLocation="xinclude.xsd"/>
+  <!-- Import security policy schema -->
+  <xsd:import namespace="http://schemas.niku.com/2002/security" schemaLocation="security-2002-02.xsd"/>
+  <!-- Import service schema -->
+  <xsd:import namespace="http://schemas.niku.com/2002/service" schemaLocation="service-2002-02.xsd"/>
+  <xsd:element name="module" type="moduleType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Web module is a collection of Web page elements that define the component's Web
+        site. Each application component defines a set of web pages for the application module in a separate WMD XML
+        file located under the src/META-INF/component/wmd directory. All web pages should be grouped into separate WMD
+        XML files or web modules based on features. WMD XML files use embedded XML elements from Security XML schema
+        (security-2002-02.xsd) for specifying security restrictions, and XInclude element for XML InfoSet reuse. In
+        order to use elements from external XML schemas, the appropriate XML namespaces (xmlns:sec and xmlns:xi) should
+        be specified for the root element of the instance document to ensure that the structure of WMD XML document can
+        be properly validated. The WMD XML schema location should also be specified in the instance document. WMD XML
+        instance documents located in union should use the following WMD XML schema location declaration:
+        xsi:schemaLocation="http://schemas.niku.com/2002/web ../xsd/web-2002-02.xsd". All other components should use
+        the following WMD XML schema location declaration: xsi:schemaLocation="http://schemas.niku.com/2002/web
+        ../../union/xsd/web-2002-02.xsd".</xsd:documentation>
+    </xsd:annotation>
+  </xsd:element>
+  <xsd:complexType name="moduleType">
+    <xsd:choice maxOccurs="unbounded">
+      <xsd:element ref="xi:include" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="moduleRef" type="ModuleRefType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="page" type="PageType" maxOccurs="unbounded"/>
+      <xsd:element name="processAction" type="ProcessActionType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="portlet" type="PortletType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:choice>
+    <xsd:attribute name="schemaLocation" type="xsd:string" use="optional"/>
+    <xsd:attribute name="id" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Defines web module id to reference web modules from other modules via moduleRef
+          element. Module id attribute value should be unique for the whole web application. This attribute must use
+          component’s name prefix to avoid name collisions. Module id is used by the moduleRef element to importing all
+          web modules for the component into one WMD XML file and registering it for the component in
+          properties.xml</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="feature" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Defines a web module feature id to classify web modules and contained pages
+          into application features. If page space attribute is not defined, module feature id will be used insted to
+          relate a page to the corrsponding application feature. This attribute must use component’s name prefix to
+          avoid name collisions, and normally defines a link to the entry page for the whole
+          feature.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="ModuleRefType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Complex type for referencing and including other web modules via module id. This
+        element is a part of the future enhancements for WMD XML. Its purpose is to replace component descriptor file
+        and to allow registering of a single WMD XML file for the component in properties.xml. The registred WMD XML
+        file will use moduleRef to import all other WMD XML files for the component. Similar solution could be achieved
+        with XInclude.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="id" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Unique module id for the whole Web application. Component namespace should be
+          used for this identifier to avoid name collissions.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="PageType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Page element contains all the information about a web page required to retrieve
+        or produce page content and display the page. This includes page and process web actions for the page, optional
+        list of imported web resources (e.g. CSS and JavaScript), portlets, security restrictions, and services
+        associated with the portlets or the whole page, in case of process action and POST requests.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence id="PageSequence">
+      <xsd:choice id="IncludeChoice" minOccurs="0" maxOccurs="unbounded">
+        <xsd:element ref="xi:include" minOccurs="0"/>
+        <xsd:element name="import" type="ImportType" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:choice>
+      <xsd:choice id="PagePolicyChoice" minOccurs="0" maxOccurs="unbounded">
+        <xsd:element ref="xi:include" minOccurs="0"/>
+        <xsd:element ref="sec:policy" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element ref="sec:condition" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element ref="sec:acl" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:choice>
+      <xsd:choice id="PortletChoice" maxOccurs="unbounded">
+        <xsd:element ref="xi:include" minOccurs="0"/>
+        <xsd:element name="portletRef" type="PortletRefType" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="portlet" type="PortletType" maxOccurs="unbounded"/>
+      </xsd:choice>
+      <xsd:element name="pageAction" type="PageActionType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:choice id="ProcessActionChoice" minOccurs="0" maxOccurs="unbounded">
+        <xsd:element ref="xi:include" minOccurs="0"/>
+        <xsd:element name="processActionRef" type="ProcessActionRefType" minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="processAction" type="ProcessActionType" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:choice>
+      <xsd:element name="paramSet" type="ParamSetType" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Page id attribute value should be unique for a component. This attribute must
+          use component’s name prefix followed by a dot and the actual unique component page id to avoid name
+          collisions. For example, union.testPage contains component’s name followed by unique page id for the
+          component. Page id is used for caching web page metadata, and linking a web page to the corresponding
+          context-sensitive help topic.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="title" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Optional page title dynamically set for customized pages. This attribute should
+          not be defined in static WMD XML files because this metadata is not localized! Runtime only page
+          property.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="componentId" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Component id is an optional attribute that specifies id of the component to
+          which a web page belongs. If not specified, the system will populate this value during initialization based on
+          information specified in config/properties.xml file and the corresponding component descriptor XML file. Valid
+          component id is a value of id attribute from one of the component elements specified in config/properties.xml.
+          Component id is used to construct the file paths and navigate component directory structure for locating web
+          resources (all component-specific XML files used by WMD).</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="help" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Help is an optional attribute to specify an alternative context-sensitive help
+          topic for the web page. By default page id is used to locate the corresponding context-sensitive help topic.
+          In cases when multiple Web pages use the same help topic, help attribute with the name of the help topic
+          should be used instead. This attribute should also use component prefix to avoid name
+          collisions.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="space" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Identifies the space/module to which this web page belongs. When this attribute
+          is specified and the header or left navigation used for the page contains an action element with
+          actionId=space, the corresponding space will be highlighted when the page is displayed.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="authenticate" type="xsd:boolean" default="true">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies whether or not user authentication is required prior to displaying
+          this page. The default authenticate attribute value is true, meaning that authentication is required for all
+          web pages by default. Therefore, there is no need to set authenticate=”true” explicitly. An attempt to
+          navigate to such web page without proper login will always result in a redirect to the login web page.
+          If the authenticate attribute is explicitly set to false, certain web pages can be exposed to external users
+          bypassing the proper login procedure. Marketplace web pages fall into this category.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="personalize" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Identifies whether or not a Web page is personalizable. All portlets for a
+          personalized Web page are processed by the PortletPersonalizer, and portlets are oredered and displayed based
+          on the user preferrences.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="pageType" default="page" type="pageTypes">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Pages are categorized into different types as specified by the type attribute.
+          This information is used by the PortletController. Page templates are abstract pages that other pages
+          reference via the template atribute for including standard portlets in a page, such as header, footer and left
+          navigation. Page layers represent page tabs. All page layers must use the same page template, and include a
+          reusable tabs portlet, but can use different page layouts.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="instanceType" type="xsd:string" default="SYSTEM">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Pages may be of specific types, these are only set from the
+          database</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="parent" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Optional parent page reference attribute to specify the parent/container page
+          for a page layer (tab). This attribute is required for all page layers, and ignored for other page
+          types.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="pageBuilder" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies Web page builder class responsible for content preparation. Page
+          builder produces final page content by: 1) storing portlet content in the content map if layout template is
+          defined, and forwarding the request with the content map to the corresponding template, or 2) it can directly
+          produce the final page content via aggregation of portlet content and other UI properties.There is no need to
+          specify pageBuilder attribute for the page element explicitly because only one page builder (JSPPageBuilder)
+          is available at this time for NDE. Moreover, not specifying it keeps the migration options open when client
+          side XML transformations will be integrated into the application.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="serializer" type="xsd:string" use="optional" default="html">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies the content output serializer for this request as defined in
+          properties.xml.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="template" type="xsd:string" use="optional" default="union.appPage">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Optional attribute to specify alternative page template for the Web page. Page
+          template defines standard portlet collection to be used for page rendering. Standard page portlets are:
+          header, footer and left navigation. The available page templates are: union.appPage, union.adminPage,
+          union.popup . Each page template includes different header and/or left navigation for rendering a page. The
+          default value references page template common for all application pages. Administration pages and popups need
+          to explicitly specify the appropriate page template reference.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="layout" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Optional attribute to specify alternative page layout template for the Web
+          page.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="skin" use="optional" type="skinTypes">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Optional attribute to assign an alternative skin or UI Look and Feel to be used
+          for rendering content of the whole web page.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:element name="portlet" type="PortletType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Global portlet element for defining reusable portlets in separate WMD XML files
+        and importing them with XInclude.</xsd:documentation>
+    </xsd:annotation>
+  </xsd:element>
+  <xsd:complexType name="PortletType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Defines a single portlet for the web page and represents a visible section of the
+        rendered page. Portlet can contain security restrictions to evaluate for the view, a list of import elements for
+        including web resources, and different attributes for personalization, content aggregation, caching, and
+        security.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence id="PortletSequence">
+      <xsd:element name="import" type="ImportType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:choice id="PortletPolicyChoice" minOccurs="0" maxOccurs="unbounded">
+        <xsd:element ref="xi:include" minOccurs="0"/>
+        <xsd:element ref="sec:acl" minOccurs="0"/>
+        <xsd:element ref="sec:condition" minOccurs="0"/>
+        <xsd:element ref="sec:policy" minOccurs="0"/>
+        <xsd:element name="viewMode" type="ViewModeTypes" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:choice>
+      <xsd:element name="retrieveService" type="RetrieveServiceType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="schemaLocation" type="xsd:string" use="optional"/>
+    <xsd:attribute name="id" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Portlet id is a unique portlet identifier for the whole web application. As
+          with the page id, component namespace should be used for this identifier to avoid name collisions. Portlet id
+          is used as part of the key to cache portlet content and associate portlets with retrieve services for each web
+          page action.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="instanceId" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Portlet instance id used by page personalization features to display mulitple
+          instances of the same portlet on a single page.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="instanceType" type="xsd:string" default="SYSTEM">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Portlet instance type used by page personalization
+          features.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="templateId" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Portlet template id defines portlet instance id of the system page portlet from
+          which this portlet instance was created.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="componentId" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Component id is required for reusable portlets and specifies the component name
+          in which the portlet is defined. It is used to construct the location path for view XSL file and rendering
+          portlet content.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="title" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Optional portlet title dynamically set for portlets included by a user for
+          personalized pages. This attribute should not be defined in static WMD XML files because this metadata is not
+          localized! Runtime only portlet property.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="collection" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Optional portlet collection name to specify for custom page templates and JSP
+          tags to layout and agregate portlet content. For most pages and existing page templates porltetType, col, and
+          row attributes should be used to classify portlets and define their position on the page. Portlet collections
+          are only for the remaining 1% of the pages that require custom layout. All custom page templates should still
+          be defined in webroot/WEB-INF/union/templates directory in union for easy maintenance.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="portletType" default="body" type="portletTypes">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Portlets are categorized into different types as specified by the type
+          attribute. This information is used by the page layout manager during content aggregation and allows changing
+          web page layout for the whole application by modifying only page layout template code (JSP or XSLT).
+          Additional standard portlet types could be identified in the future and added to this
+          list.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="viewType" default="vxsl" type="viewTypes">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The portlet may process data using a VXSL, or the data may be a VXML, or even
+          straight HTML</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="view" type="xsd:string" use="optional" default="">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Relative location of the view XML or XSLT template used to generate view XML
+          from data XML received as a result of the service call for the portlet. View XML and XSL files are located
+          under /src/META-INF/component/vxsl directory. Each portlet must use a separate view XSL template. Static
+          portlets that don’t display dynamic data can reference view XML file directly via the view attribute. This
+          allows bypassing the data XML transformation with view XSL when the content of a portlet contains only
+          presentation elements.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="ui" type="xsd:string" default="view">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Optional name of the UI XSLT template to specify alternative UI XSLT used for
+          transforming view XML content of the portlet into web agent specific markup format, such as XHTML or SVG. This
+          attribute should be specified only in rare occasions when custom UI XSLT templates are used. The default and
+          most common top-level UI XSLT template used for most of the portlets in NDE is called “view”. It includes
+          other UI XSLT templates for rendering such common UI widgets as buttons, links, toolbars, tabs, list tables,
+          attribute tables, and trees. View is the default UI XSL template and it does not need to be specified
+          explicitly.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="col" default="1" type="colTypes">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The row and col attributes can be used to specify a position of the body type
+          portlet content for a rendered web page. All layout managers use grid layout with rows and columns to position
+          the content of body type portlets during content aggregation. The default values for row and col portlet
+          attributes are 0 (first row) and 1(second column – center column). All portlets should be listed as children
+          of a page in an increasing order of their assigned row and column. Portlets are layed out on the page in at
+          most 3 columns, where each column represents a separate stack or a bucket. If no row is assigned, portlets are
+          laid out in the order they are listed in web metadata and according to their column assignments. Column
+          indexes start with 0, with 1 being the default wide center column. Web page layout template is responsible for
+          spanning the content of portlets if the number of portlet columns is less than 3.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="row" type="xsd:integer" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The row and col attributes can be used to specify a position of the body type
+          portlet content for a rendered web page. All layout managers use grid layout with rows and columns to position
+          the content of body type portlets during content aggregation. The default values for row and col portlet
+          attributes are 0 (first row) and 1(second column – center column). All portlets should be listed as children
+          of a page in an increasing order of their assigned row and column. Portlets are layed out on the page in at
+          most 3 columns, where each column represents a separate stack or a bucket. If no row is assigned, portlets are
+          laid out in the order they are listed in web metadata and according to their column assignments. Column
+          indexes start with 0, with 1 being the default wide center column. Web page layout template is responsible for
+          spanning the content of portlets if the number of portlet columns is less than 3.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="narrow" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Denotes wheter or not this portlet can be placed in the narrow (left or right)
+          column of the Web page grid layout.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="span" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Denotes whether or not the content of the first portlet for the web page should
+          span across the whole page horizontally, ignoring multiple column grid layout for the
+          page.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="required" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Denotes a required portlet for a Web page. The content of required portlet is
+          always displayed independent of user preferences for a personalized page. This can be used for building
+          personalized pages for companies that require their employees to read company news feeds.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="default" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Denotes a default portlet for a Web page. The content of default portlet is
+          displayed initially for a personalized web page, prior or until a user modifies personal settings. As such,
+          this portlet will be displayed when a user first hits the personal page, but the portlet is not required and
+          can be removed by changing personal settings for the page.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="pageEvents" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Denotes a portlet that contains page level events defined in view XML. Such
+          portlet view XML is queried with XPath to retrieve and transform declared page events. Page events, such as
+          onLoad, are then passed to page template to be included in page body tag.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="pageToolbar" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Denotes a portlet that contains page level toolbar defined in view XML. Such
+          portlet view XML is queried with XPath to retrieve and transform declared page toolbar links. Rendered page
+          toolbar that normally contains Personalize or Customize links will be included in the page title section of
+          the rendered page.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="state" default="normal" type="stateTypes">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Defines portlet state for the portlet window.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="cacheable" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Determines whether or not the portlet content can be
+          cached.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="scope" default="request" type="scopeTypes">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Determines the scope for the portlet content caching mechanism. The available
+          scopes are: application scope - portlet content with application scope is cached based on the user locale. The
+          content is generated only once and doesn’t expire. Application level cache is cleared only upon application
+          restart or refresh of the application settings. Session session – portlet content with the session scope is
+          cached based on the user session id and locale. Any portlet content that requires user right checking in
+          addition to locale sensitivity should use this setting. Session level cache is cleared whenever user session
+          expires or when a user logs off. Request scope – portlet content with the request scope is cached based on the
+          user locale and expiration time setting. This content is cached for a single request based on the action id
+          and is used for all users with the same locale. Note that content with session or user specific information
+          should not use request scope caching.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="expires" type="xsd:long" default="0">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Defines expiration time in seconds for the portlet content cached in request
+          scope. The default value (0) identifies time sensitive content that can't be cached.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="policyId" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies security policy id to check user entitlement information for viewing
+          the content of this portlet. This is a reference to one of the security restriction elements defined for a web
+          page.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="ViewModeTypes">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Defines a portlet view mode. The supported portlet view modes are: edit, max and
+        admin. Other modes can be defined. Portlet definition itself difines the default display mode (normal). View
+        modes define actions to use for portlet management, such as portlet customization and administration. The WMD
+        processor looksup view modes to generate proper links for portlet Edit and Customize links in the portlet title
+        bar.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="modeType" use="required" type="modeTypes">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies portlet view mode type: edit, admin, max etc.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="action" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies the link for the portlet view mode type for portlet management and
+          customization.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="ActionType">
+    <xsd:annotation>
+      <xsd:documentation>Abstract type used for defining PageAction and ProcessAction.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="id" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Unique action identifier that maps HTTP GET and POST actions via the predefined
+          "action" parameter to this web action. It is used to locate and invoke a processAction or a pageAction, and
+          render the web page and its content. The value for this attribute should use component namespace to avoid name
+          collisions.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="authenticate" type="xsd:boolean" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies whether or not user authentication is required to invoke this
+          action.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="alias" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Unique action identifier alias that maps HTTP GET and POST actions via the
+          predefined "action" parameter to this web action. It is used to locate and invoke a processAction or a
+          pageAction, and render the web page and its content. The value for this attribute should use component
+          namespace to avoid name collisions.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="componentId" type="xsd:string">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies id of the component for this action. If not specified, the system
+          will populate this value during initialization based on information specified in properties.xml file and the
+          corresponding component descriptor XML file. Valid component id is a value of id attribute from one of the
+          component elements specified in properties.xml. Component id is used to construct the file paths and navigate
+          component directory structure for locating web resources (all component-specific XML files used by
+          WMD).</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="active" type="xsd:boolean" use="optional" default="true">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Active flag for marking enabled/disabled actions. Requesting a page or a
+          process action with an action id whose active flag is set to false will result in an error page that notifies
+          an end-user that the action or page has been temporarly disabled. The error page is Service Unavailable with
+          the http error code 503.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="policyId" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies security policy id to check user entitlement information for invoking
+          this web action. This is a reference to one of the web security restriction elements defined for a web
+          page.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="binding" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Optional location of the binding file for HTTP to XML marshalling. If not
+          specified, the default generated binding file with that name that matches action id is used. Binding files are
+          located under /src/META-INF/component/bind directory.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="useSsl" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Deprecated. Use ssl attribute instead.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="ssl" type="xsd:boolean" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Denotes wether or not to use SSL for the data transmission that is the result
+          of this action.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="compress" type="xsd:boolean" default="true">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Denotes wether to use gzip for the data transmission that is the result of this
+          action.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="inheritParamSet" type="xsd:boolean" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies whether to inherit the paramset defined for the process
+          action.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="PageActionType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Page action is used to trigger the display of a web page. Normally, a page action
+        is a result of HTTP GET request that triggers multiple service calls, one per each portlet, to retrieve content
+        for each portlet. Each web page must contain at least one page action that will trigger loading of a web page.
+        To request a page action via HTTP GET request, its id attribute must match the value of reserved HTTP parameter
+        (“action”).</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="ActionType">
+        <xsd:sequence id="ActionSequence">
+          <xsd:element name="portlet" type="PortletType" minOccurs="0" maxOccurs="unbounded"/>
+          <xsd:element name="retrieveService" type="RetrieveServiceType" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  <xsd:complexType name="RetrieveServiceType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Specifies the service to call that will generate content for a portlet when page
+        action is triggered. Retrieve service is linked to the corresponding portlet via portlet id. Page action might
+        have one or more retrieve services.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="srv:retrieveService">
+        <xsd:attribute name="portletId" type="xsd:string" use="required">
+          <xsd:annotation>
+            <xsd:documentation xml:lang="en">Unique portlet identifier that links this service to one of the portlets
+              defined for a web page.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  <xsd:complexType name="ProcessActionType">
+    <xsd:annotation>
+      <xsd:documentation>Defines a web action that submits page data to the backend and modifies the underlying data
+        store in any way. Processing of a process action doesn't result in a web page display, and is always followed by
+        processing of the next web page action. Process actions should be used for all requests that perform insert,
+        update, or delete operations on the data store or modify the data store in any other way. Process action element
+        contains additional attributes for performing such operations. Next action attribute specifies the action id of
+        the next page action to process, to trigger loading of a confirmation web page upon successful completion of the
+        update operation. Error action attribute specifies the action id of the next page action to process, to trigger
+        loading of the appropriate error page if the operation fails. Most of the time, this will be an action id of the
+        page action used to display a web page from which the information is posted to perform an update. This will
+        trigger redisplay, or refresh of the page with the error message displayed, and erroneous information fields
+        marked on the page.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="ActionType">
+        <xsd:sequence id="ProcessActionSequence">
+          <xsd:element name="processService" type="ProcessServiceType"/>
+          <xsd:element name="redirectCondition" type="RedirectConditionType" minOccurs="0" maxOccurs="unbounded"/>
+          <xsd:element name="paramSet" type="ParamSetType" minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:attribute name="nextAction" type="xsd:string" use="optional">
+          <xsd:annotation>
+            <xsd:documentation xml:lang="en">Next page action id to invoke that triggers rendering of the response web
+              page.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="errorAction" type="xsd:string">
+          <xsd:annotation>
+            <xsd:documentation xml:lang="en">Fallback error action id used if the request processing
+              fails.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="redirect" type="xsd:boolean" default="false">
+          <xsd:annotation>
+            <xsd:documentation xml:lang="en">Determines whether or not a redirect is required after this web action has
+              been processed. In case of redirect=true, the nextAction attribute value will be appended to the redirect
+              url to specify what web action will be invoked next. If additional parameters are required for the
+              redirect url, they can be specified via an optional paramSet element and a list of
+              params.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="dynamicErrorAction" type="xsd:string"/>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  <xsd:complexType name="ProcessServiceType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Specifies the type and description of a service to call that will process an
+        update operation for a process action and further request redirect or forward. The resulting output is used as
+        an input for the next or error page action in case of request forwarding. When redirect is used, additional
+        redirect URL parameters can be specified via paramSet element. The redirect parameters can query the original
+        HTTP request or the output of the process service with XPath.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="srv:processService"/>
+    </xsd:complexContent>
+  </xsd:complexType>
+  <xsd:complexType name="RedirectConditionType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Defines a redirect condition evaluated by action controller prior to request
+        forwarding or redirect. Redirect conditions are optional and are evaluated only when the process action redirect
+        attribute is set to true. If no redirect conditions are specified, depending on the status of process action
+        executaion, the request will be redirected or forwarded to the next or error action.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence id="RedirectConditionSequence">
+      <xsd:element name="paramSet" type="ParamSetType" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="inheritParamSet" type="xsd:boolean" use="optional" default="false">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies whether to inherit the paramset defined for the process
+          action.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="source" type="sourceTypes" use="optional" default="response">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies the source from which the expression matching parameter and
+          destination URL is retreived.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="parameter" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies the parameter name to use for expression matching, if the source is
+          other than the response data XML document.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="expression" type="xsd:string" use="optional" default=".">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Regular expression or an XPath expression for redirect condition. The XPath
+          expression is used to query process action data XML response document, if the source attribute is set to
+          response. Otherwise, the reqular expression matching is used on the specified source parameter value to
+          determine a match.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="action" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Action id of the next action to execute if the redirect condition is met. This
+          is used as a fallback action if destination expresssion parsing fails.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="destination" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">XPath expression or parameter name for the redirect condition to retrieve
+          dynamic redirect URL from data XML response document or other sources. This attribute overwrites static action
+          specified for redirect.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="destinationAction" type="xsd:string" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">XPath expression or parameter name for the redirect condition to retrieve
+          redirect action from data XML response document or other sources. This attribute overwrites static action
+          specified for redirect.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:simpleType name="sourceTypes">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Specifies the source from which the parameter value is retreived: request - http
+        request, or response - service call response.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="constant"/>
+      <xsd:enumeration value="request"/>
+      <xsd:enumeration value="response"/>
+      <xsd:enumeration value="xml"/>
+      <xsd:enumeration value="session"/>
+      <xsd:enumeration value="cookie"/>
+      <xsd:enumeration value="header"/>
+      <xsd:enumeration value="config"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:complexType name="ParamSetType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Defines a list parameters to be used for constructing a redirect url query string
+        when performing a redirect for a web action to another web page.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="param" type="ParamType" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+  <xsd:complexType name="ParamType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Defines a single parameter for a redirect URL query string. If source=”request”,
+        the HTTP request parameter name specified in the value attribute will be used to retrieve the parameter value.
+        If source=”response”, the XPath expression specified in the value attribute will be used to retrieve the
+        parameter value from data XML response of the process action service call.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies the parameter name.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="source" type="sourceTypes" use="optional">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies the source from which the parameter value is
+          retreived.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="value" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Specifies how the value of the parameter is retrieved. If source=request, the
+          name of the http parameter needs to be specified in the value attribute. If source=response, the value
+          parameter will be an XPath expression to query the service response XML for the parameter
+          value.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="ImportType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Defines a web resource to include during content aggregation. Different web pages
+        depending on their content and features require different web resources to be included. Typically, web resources
+        represent external files that are used to render page content and provide additional presentation styles and
+        client-side dynamic behavior for a page. Currently, such web resources include CSS and JavaScript files from UI
+        toolkit. Web page builder or a page layout manager will generate a proper reference to the imported web resource
+        file from UI toolkit based on the resource name as the specified by the href attribute, its type attribute, and
+        the UI skin assigned to a web page.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="href" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">The name of the web resource to import.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="type" use="optional" default="js" type="importTypes">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Identifies web resource type: js - JavaScript, css - CSS
+          file.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <!-- Element Reference Types for reuse -->
+  <xsd:complexType name="PortletRefType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Complex type for referensing reusable portlets that are standalone or defined in
+        other web pages. This element is part of the future enhancements for WMD and is not supported yet. This solution
+        will require less memory at runtime when WMD XML files are loaded and cached for request
+        processing.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="id" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Unique portlet id for the whole Web application. Component namespace should be
+          used for this identifier to avoid name collissions. Portlet id is used as part of the key to cache portlet
+          content and to associate portlets with retreive services for each web page action.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+  <xsd:complexType name="ProcessActionRefType">
+    <xsd:annotation>
+      <xsd:documentation xml:lang="en">Complex type for referensing reusable process actions that are standalone or
+        defined in other WMD XML files. This element is part of the future enhancements for the WMD and is not supported
+        yet. Its purpose is to replace existing XInclude solution. This solution will require less memory at runtime
+        when WMD XML files are loaded and cached for request processing.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="id" type="xsd:string" use="required">
+      <xsd:annotation>
+        <xsd:documentation xml:lang="en">Unique process action id for the whole Web application. Component namespace
+          should be used for this identifier to avoid name collissions.</xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:complexType>
+
+  <xsd:simpleType name="pageTypes">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="template"/>
+      <xsd:enumeration value="page"/>
+      <xsd:enumeration value="layer"/>
+      <xsd:enumeration value="container"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="skinTypes">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="evolution1">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">Niku 6.1.x UI look and feel with 2001 view XML.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+      <xsd:enumeration value="evolution2">
+        <xsd:annotation>
+          <xsd:documentation xml:lang="en">Niku 6.1.x UI look and feel with 2002 view XML.</xsd:documentation>
+        </xsd:annotation>
+      </xsd:enumeration>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="portletTypes">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="header"/>
+      <xsd:enumeration value="footer"/>
+      <xsd:enumeration value="toc"/>
+      <xsd:enumeration value="tabs"/>
+      <xsd:enumeration value="body"/>
+      <xsd:enumeration value="pageContext"/>
+      <xsd:enumeration value="pageToolbar"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="viewTypes">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="vxsl"/>
+      <xsd:enumeration value="vxml"/>
+      <xsd:enumeration value="html"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="colTypes">
+    <xsd:restriction base="xsd:integer">
+      <xsd:enumeration value="0"/>
+      <xsd:enumeration value="1"/>
+      <xsd:enumeration value="2"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="stateTypes">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="normal"/>
+      <xsd:enumeration value="minimized"/>
+      <xsd:enumeration value="maximized"/>
+      <xsd:enumeration value="hidden"/>
+      <xsd:enumeration value="inactive"/>
+      <xsd:enumeration value="fullscreen"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="scopeTypes">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="request"/>
+      <xsd:enumeration value="session"/>
+      <xsd:enumeration value="application"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="modeTypes">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="edit"/>
+      <xsd:enumeration value="admin"/>
+      <xsd:enumeration value="max"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="importTypes">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="js"/>
+      <xsd:enumeration value="css"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/xbl-2003-02.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/xbl-2003-02.xsd
new file mode 100644
index 0000000..1bde37e
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/xbl-2003-02.xsd
@@ -0,0 +1,410 @@
+<?xml version="1.0"?>
+<!--
+
+This is the Niku XBL schema. This version complies with the
+current W3C XML Schema recommendation. To use this schema,
+start your XBL document with:
+
+    <xbl:template xmlns:xbl="http://schemas.niku.com/xbl"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="http://schemas.niku.com/xbl ../../union/xsd/xbl-2003-02.xsd">
+-->
+<schema targetNamespace="http://schemas.niku.com/xbl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xpath="http://www.w3.org/TR/2001/WD-xptr-20010108/" xmlns:xbl="http://schemas.niku.com/xbl" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" blockDefault="#all" xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd">
+  <import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+  <import namespace="http://www.w3.org/2001/XMLSchema"/>
+  <!-- 	There are three ways that you can construct a
+      schema for XSLT stylesheets that create instances of a
+      particular result structure
+
+      (a)	Declare all your result elements as a member of
+        xbl:result-element substitution group
+
+      (b) Redefine model group xbl:result-element to accomodate
+        the desired structure
+
+      (c)	Do nothing. This schema is designed to allow any element node
+        or nodes if they have any namespace other than the XSLT
+        namespace or not namespace qualified
+
+      I recommend (a) or (b)
+
+      In addition, I added a an attributeGroup util, 'result-element'
+      for your convenience
+  -->
+  <element name="result-element" type="anyType" abstract="true"/>
+  <attributeGroup name="result-element">
+    <anyAttribute namespace="##other" processContents="skip"/>
+  </attributeGroup>
+  <group name="result-element">
+    <choice>
+      <element ref="xbl:result-element"/>
+      <any namespace="##other" processContents="skip"/>
+    </choice>
+  </group>
+  <!-- *** Style Sheet Elements *** -->
+  <!-- *** 					  *** -->
+  <element name="template" type="xbl:wrapper"/>
+  <complexType name="wrapper">
+    <complexContent>
+      <extension base="xbl:anyType">
+        <sequence>
+          <choice minOccurs="0" maxOccurs="unbounded">
+            <element ref="xbl:top-level-element"/>
+            <element ref="xbl:top-level-element-and-char-instruction"/>
+            <element ref="xbl:variable"/>
+            <element ref="xbl:instruction"/>
+            <group ref="xbl:result-element"/>
+            <any namespace="##other" processContents="skip"/>
+            <!-- weaker than XSLT 1.0 -->
+          </choice>
+        </sequence>
+        <attribute ref="xml:space"/>
+      </extension>
+    </complexContent>
+  </complexType>
+  <!-- *** top level elements *** -->
+  <!-- ***					*** -->
+  <element name="top-level-element" type="xbl:anyType" abstract="true"/>
+  <element name="top-level-element-and-char-instruction" type="xbl:anyType" abstract="true"/>
+  <!-- *** top level elements and char instructions *** -->
+  <!-- ***										  *** -->
+  <element name="variable" type="xbl:variable" substitutionGroup="xbl:char-instruction"/>
+  <element name="instruction" type="xbl:anyType" abstract="true"/>
+  <element name="char-instruction" type="xbl:anyType" abstract="true" substitutionGroup="xbl:instruction"/>
+  <element name="attribute" substitutionGroup="xbl:instruction">
+    <complexType>
+      <attribute name="name" type="string" use="required"/>
+      <attribute name="value" type="string" use="optional"/>
+    </complexType>
+  </element>
+  <element name="include" substitutionGroup="xbl:instruction">
+    <complexType>
+      <complexContent>
+        <extension base="xbl:anyType">
+          <attribute name="href" type="anyURI" use="required"/>
+          <attribute name="componentId" type="xbl:expression" use="optional"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="call" substitutionGroup="xbl:char-instruction">
+    <complexType>
+      <complexContent>
+        <extension base="xbl:anyType">
+          <sequence minOccurs="0" maxOccurs="unbounded">
+            <element ref="xbl:call-param"/>
+          </sequence>
+          <attribute name="href" type="anyURI" use="required"/>
+          <attribute name="componentId" type="xbl:expression" use="optional"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="parameter">
+    <complexType mixed="true">
+      <complexContent mixed="true">
+        <extension base="xbl:anyType">
+          <group ref="xbl:template" minOccurs="0" maxOccurs="unbounded"/>
+          <attribute name="name" type="xbl:QName" use="required"/>
+          <attribute name="type" type="string"/>
+          <attribute name="value" type="string"/>
+          <attribute name="position" type="string"/>
+          <attribute name="dynamicSql" type="string"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="execute" substitutionGroup="xbl:char-instruction">
+    <complexType>
+      <complexContent>
+        <extension base="xbl:anyType">
+          <sequence minOccurs="0" maxOccurs="unbounded">
+            <element ref="xbl:parameter"/>
+          </sequence>
+          <attribute name="name" type="xbl:QName" use="optional"/>
+          <attribute name="source" type="string" use="required"/>
+          <attribute name="value" type="string" use="required"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="query" substitutionGroup="xbl:char-instruction">
+    <complexType>
+      <complexContent>
+        <extension base="xbl:anyType">
+          <sequence minOccurs="0" maxOccurs="unbounded">
+            <element ref="xbl:parameter"/>
+          </sequence>
+          <attribute name="name" type="xbl:QName" use="required"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="custom" substitutionGroup="xbl:char-instruction">
+    <complexType>
+      <attribute name="name" type="string" use="required"/>
+      <attribute name="class" type="string" use="required"/>
+    </complexType>
+  </element>
+  <element name="function" substitutionGroup="xbl:char-instruction">
+    <complexType>
+      <attribute name="name" type="string" use="required"/>
+      <attribute name="class" type="string" use="required"/>
+    </complexType>
+  </element>
+  <element name="invoke" substitutionGroup="xbl:char-instruction">
+    <complexType mixed="true">
+      <complexContent mixed="true">
+        <extension base="xbl:anyType">
+          <sequence>
+            <choice minOccurs="0" maxOccurs="unbounded">
+              <element ref="xbl:top-level-element-and-char-instruction"/>
+              <element ref="xbl:instruction"/>
+              <group ref="xbl:result-element"/>
+            </choice>
+          </sequence>
+          <attribute name="name" type="string" use="required"/>
+          <attribute name="class" type="string" use="optional"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="attributes" substitutionGroup="xbl:char-instruction">
+    <complexType>
+      <attribute name="select" type="xbl:expression" use="optional"/>
+    </complexType>
+  </element>
+  <element name="pagination" substitutionGroup="xbl:char-instruction">
+    <complexType>
+      <attribute name="objectSet" type="xbl:expression" use="optional"/>
+      <attribute name="page" type="xbl:expression" use="optional"/>
+      <attribute name="count" type="xbl:expression" use="optional"/>
+      <attribute name="pageSize" type="xbl:expression" use="optional"/>
+      <attribute name="pageSize" type="xbl:expression" use="optional"/>
+    </complexType>
+  </element>
+  <element name="choose" substitutionGroup="xbl:char-instruction">
+    <complexType>
+      <complexContent>
+        <extension base="xbl:anyType">
+          <sequence>
+            <element ref="xbl:when" maxOccurs="unbounded"/>
+            <element ref="xbl:otherwise" minOccurs="0"/>
+          </sequence>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="match" substitutionGroup="xbl:char-instruction">
+    <complexType mixed="true">
+      <complexContent mixed="true">
+        <extension base="xbl:anyType">
+          <sequence>
+            <choice minOccurs="0" maxOccurs="unbounded">
+              <element ref="xbl:top-level-element-and-char-instruction"/>
+              <element ref="xbl:instruction"/>
+              <group ref="xbl:result-element"/>
+            </choice>
+            <element ref="xbl:else" minOccurs="0"/>
+          </sequence>
+          <attribute name="select" type="xbl:expression" use="required"/>
+          <attribute name="filter" type="string" use="optional"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="for-each" substitutionGroup="xbl:char-instruction">
+    <complexType mixed="true">
+      <complexContent mixed="true">
+        <extension base="xbl:anyType">
+          <sequence>
+            <element ref="xbl:sort" minOccurs="0" maxOccurs="unbounded"/>
+            <choice minOccurs="0" maxOccurs="unbounded">
+              <element ref="xbl:top-level-element-and-char-instruction"/>
+              <element ref="xbl:instruction"/>
+              <group ref="xbl:result-element"/>
+            </choice>
+          </sequence>
+          <attribute name="select" type="xbl:expression" use="required"/>
+          <attribute name="filter" type="string" use="optional"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="if" substitutionGroup="xbl:char-instruction">
+    <complexType mixed="true">
+      <complexContent mixed="true">
+        <extension base="xbl:anyType">
+          <sequence>
+            <choice minOccurs="0" maxOccurs="unbounded">
+              <element ref="xbl:top-level-element-and-char-instruction"/>
+              <element ref="xbl:instruction"/>
+              <group ref="xbl:result-element"/>
+            </choice>
+            <element ref="xbl:else" minOccurs="0"/>
+          </sequence>
+          <attribute name="test" type="xbl:expression" use="required"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="try" substitutionGroup="xbl:char-instruction">
+    <complexType mixed="true">
+      <complexContent mixed="true">
+        <extension base="xbl:anyType">
+          <sequence>
+            <choice minOccurs="0" maxOccurs="unbounded">
+              <element ref="xbl:top-level-element-and-char-instruction"/>
+              <element ref="xbl:instruction"/>
+              <group ref="xbl:result-element"/>
+            </choice>
+            <element ref="xbl:catch" maxOccurs="unbounded"/>
+          </sequence>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="throw" substitutionGroup="xbl:char-instruction">
+    <complexType>
+      <sequence>
+        <element ref="xbl:message"/>
+      </sequence>
+    </complexType>
+  </element>
+  <element name="sort" substitutionGroup="xbl:instruction">
+    <complexType>
+      <attribute name="select" type="xbl:expression" use="optional"/>
+      <attribute name="field" type="xbl:expression" use="optional"/>
+      <attribute name="ascending" type="xbl:boolean" use="optional" default="false"/>
+      <attribute name="descending" type="xbl:boolean" use="optional" default="true"/>
+    </complexType>
+  </element>
+  <element name="message" substitutionGroup="xbl:instruction">
+    <complexType>
+      <attribute name="id" type="string" use="required"/>
+      <attribute name="type" type="string" use="optional"/>
+      <attribute name="location" type="string" use="optional"/>
+    </complexType>
+  </element>
+  <element name="log" substitutionGroup="xbl:char-instruction">
+    <complexType mixed="true">
+      <complexContent mixed="true">
+        <extension base="xbl:anyType">
+          <attribute name="value" type="string" use="optional"/>
+          <attribute name="level" type="string" use="optional"/>
+          <attribute name="exception" type="string" use="optional"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <!-- *** orphans *** -->
+  <!-- *** 		 *** -->
+  <element name="otherwise">
+    <complexType mixed="true">
+      <complexContent mixed="true">
+        <extension base="xbl:anyType">
+          <group ref="xbl:template" minOccurs="0" maxOccurs="unbounded"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="else">
+    <complexType mixed="true">
+      <complexContent mixed="true">
+        <extension base="xbl:anyType">
+          <group ref="xbl:template" minOccurs="0" maxOccurs="unbounded"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="catch">
+    <complexType mixed="true">
+      <complexContent mixed="true">
+        <extension base="xbl:anyType">
+          <group ref="xbl:template" minOccurs="0" maxOccurs="unbounded"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="when">
+    <complexType mixed="true">
+      <complexContent mixed="true">
+        <extension base="xbl:anyType">
+          <group ref="xbl:template" minOccurs="0" maxOccurs="unbounded"/>
+          <attribute name="test" type="xbl:expression" use="required"/>
+          <attribute ref="xml:space"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <element name="call-param">
+    <complexType mixed="true">
+      <complexContent mixed="true">
+        <extension base="xbl:variable">
+          <attribute name="type" type="string"/>
+        </extension>
+      </complexContent>
+    </complexType>
+  </element>
+  <!-- *** utils - internal types and groups *** -->
+  <!-- *** not for public use                *** -->
+  <simpleType name="boolean">
+    <restriction base="string">
+      <enumeration value="true"/>
+      <enumeration value="false"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="QNames">
+    <list itemType="xbl:QName"/>
+  </simpleType>
+  <group name="template">
+    <choice>
+      <element ref="xbl:top-level-element-and-char-instruction"/>
+      <element ref="xbl:instruction"/>
+      <group ref="xbl:result-element"/>
+    </choice>
+  </group>
+  <simpleType name="QName">
+    <union memberTypes="NCName QName"/>
+  </simpleType>
+  <simpleType name="element-names">
+    <list>
+      <simpleType>
+        <union memberTypes="QName">
+          <simpleType>
+            <restriction base="string">
+              <pattern value="\*"/>
+              <pattern value="\i\c*:\*"/>
+            </restriction>
+          </simpleType>
+        </union>
+      </simpleType>
+    </list>
+  </simpleType>
+  <complexType name="variable" mixed="true">
+    <complexContent mixed="true">
+      <extension base="xbl:anyType">
+        <group ref="xbl:template" minOccurs="0" maxOccurs="unbounded"/>
+        <attribute name="name" type="xbl:QName" use="required"/>
+        <attribute name="value" type="xbl:expression"/>
+      </extension>
+    </complexContent>
+  </complexType>
+  <simpleType name="expr-avt">
+    <restriction base="string"/>
+  </simpleType>
+  <simpleType name="expression">
+    <restriction base="string"/>
+  </simpleType>
+  <complexType name="anyType">
+    <anyAttribute namespace="##other" processContents="skip"/>
+  </complexType>
+</schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/xinclude.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/xinclude.xsd
new file mode 100644
index 0000000..9b79b97
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/xinclude.xsd
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="http://www.w3.org/2001/XInclude" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+	<xs:element name="include">
+		<xs:complexType mixed="true">
+			<xs:attribute name="href" type="xs:anyURI" use="required"/>
+			<xs:attribute name="parse">
+				<xs:simpleType>
+					<xs:restriction base="xs:string">
+						<xs:enumeration value="xml"/>
+						<xs:enumeration value="text"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="encoding" type="xs:string"/>
+			<xs:anyAttribute/>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/xlink.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/xlink.xsd
new file mode 100644
index 0000000..764df93
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/xlink.xsd
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.w3.org/1999/xlink" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2001/XMLSchema">
+	<annotation>
+		<documentation xml:lang="en">This schema provides the XLink attributes for general use.  Obtained from http://www.cs.rpi.edu/~puninj/XGMML/xlinks-2001.xsd which is a updated version of http://www.opengis.net/namespaces/gml/core/xlinks.xsd</documentation>
+	</annotation>
+	<attribute name="href" type="anyURI"/>
+	<attribute name="role" type="anyURI"/>
+	<attribute name="arcrole" type="anyURI"/>
+	<attribute name="title" type="string"/>
+	<attribute name="show">
+		<annotation>
+			<documentation>
+        The 'show' attribute is used to communicate the desired presentation 
+        of the ending resource on traversal from the starting resource; it's 
+        value should be treated as follows: 
+        new - load ending resource in a new window, frame, pane, or other 
+              presentation context
+        replace - load the resource in the same window, frame, pane, or 
+                  other presentation context
+        embed - load ending resource in place of the presentation of the 
+                starting resource
+        other - behavior is unconstrained; examine other markup in the 
+                link for hints 
+        none - behavior is unconstrained 
+               </documentation>
+		</annotation>
+		<simpleType>
+			<restriction base="string">
+				<enumeration value="new"/>
+				<enumeration value="replace"/>
+				<enumeration value="embed"/>
+				<enumeration value="other"/>
+				<enumeration value="none"/>
+			</restriction>
+		</simpleType>
+	</attribute>
+	<attribute name="actuate">
+		<annotation>
+			<documentation>
+        The 'actuate' attribute is used to communicate the desired timing 
+        of traversal from the starting resource to the ending resource; 
+        it's value should be treated as follows:
+        onLoad - traverse to the ending resource immediately on loading 
+                 the starting resource 
+        onRequest - traverse from the starting resource to the ending 
+                    resource only on a post-loading event triggered for 
+                    this purpose 
+        other - behavior is unconstrained; examine other markup in link 
+                for hints 
+        none - behavior is unconstrained
+      </documentation>
+		</annotation>
+		<simpleType>
+			<restriction base="string">
+				<enumeration value="onLoad"/>
+				<enumeration value="onRequest"/>
+				<enumeration value="other"/>
+				<enumeration value="none"/>
+			</restriction>
+		</simpleType>
+	</attribute>
+	<attribute name="label" type="string"/>
+	<attribute name="from" type="string"/>
+	<attribute name="to" type="string"/>
+	<!-- ==============================================================
+       Attributes grouped by XLink type, as specified in the W3C 
+       Recommendation (dated 2000-06-27)
+  =================================================================== -->
+	<attributeGroup name="simpleLink">
+		<attribute name="type" type="string" fixed="simple" form="qualified"/>
+		<attribute ref="xlink:href" use="optional"/>
+		<attribute ref="xlink:role" use="optional"/>
+		<attribute ref="xlink:arcrole" use="optional"/>
+		<attribute ref="xlink:title" use="optional"/>
+		<attribute ref="xlink:show" use="optional"/>
+		<attribute ref="xlink:actuate" use="optional"/>
+	</attributeGroup>
+	<attributeGroup name="extendedLink">
+		<attribute name="type" type="string" fixed="extended" form="qualified"/>
+		<attribute ref="xlink:role" use="optional"/>
+		<attribute ref="xlink:title" use="optional"/>
+	</attributeGroup>
+	<attributeGroup name="locatorLink">
+		<attribute name="type" type="string" fixed="locator" form="qualified"/>
+		<attribute ref="xlink:href" use="required"/>
+		<attribute ref="xlink:role" use="optional"/>
+		<attribute ref="xlink:title" use="optional"/>
+		<attribute ref="xlink:label" use="optional"/>
+	</attributeGroup>
+	<attributeGroup name="arcLink">
+		<attribute name="type" type="string" fixed="arc" form="qualified"/>
+		<attribute ref="xlink:arcrole" use="optional"/>
+		<attribute ref="xlink:title" use="optional"/>
+		<attribute ref="xlink:show" use="optional"/>
+		<attribute ref="xlink:actuate" use="optional"/>
+		<attribute ref="xlink:from" use="optional"/>
+		<attribute ref="xlink:to" use="optional"/>
+	</attributeGroup>
+	<attributeGroup name="resourceLink">
+		<attribute name="type" type="string" fixed="resource" form="qualified"/>
+		<attribute ref="xlink:role" use="optional"/>
+		<attribute ref="xlink:title" use="optional"/>
+		<attribute ref="xlink:label" use="optional"/>
+	</attributeGroup>
+	<attributeGroup name="titleLink">
+		<attribute name="type" type="string" fixed="title" form="qualified"/>
+	</attributeGroup>
+	<attributeGroup name="emptyLink">
+		<attribute name="type" type="string" fixed="none" form="qualified"/>
+	</attributeGroup>
+</schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/xsl-1.0-1999.xsd b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/xsl-1.0-1999.xsd
new file mode 100644
index 0000000..3ab1c56
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation3Schemas/xsl-1.0-1999.xsd
@@ -0,0 +1,2323 @@
+<?xml version="1.0" ?>
+
+
+
+<!--
+
+
+
+
+
+
+
+This free of charge Software is provided on an "AS IS" basis, without
+
+warranty of any kind. The entire risk as to the quality and performance of
+
+the software is borne by you. Should the software prove defective, you and
+
+only you assume the entire cost of any service and repair.
+
+
+
+WEBMETHODS DOES NOT MAKE ANY EXPRESS OR IMPLIED WARRANTIES OF ANY KIND
+
+INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF TITLE, MERCHANTABILITY OR
+
+FITNESS FOR A PARTICULAR PURPOSE, OR WARRANTIES ARISING BY STATUTE, COURSE
+
+OF DEALING, CUSTOM OR USAGE, TRADE PRACTICE OR OTHERWISE.
+
+
+
+IN NO EVENT WILL WEBMETHODS BE LIABLE FOR ANY LOST REVENUES, PROFITS,
+
+BUSINESS OR INTERRUPTION OF BUSINESS OR OTHER SPECIAL, INDIRECT, INCIDENTAL
+
+OR CONSEQUENTIAL DAMAGES, EVEN IF WEBMETHODS HAS BEEN ADVISED OF THE
+
+POSSIBILITY OF SUCH DAMAGES, AND NOTWITHSTANDING ANY FAILURE OF ESSENTIAL
+
+PURPOSE OF ANY LIMITED REMEDY OF ANY KIND, HOWEVER CAUSED AND UNDER ANY
+
+THEORY OF LIABILITY.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Schema for XSLT 1.0 Recommendation, http://www.w3.org/TR/1999/REC-xslt-19991116
+
+Using XML Schema CR Drafts, 
+
+
+
+- Part 1, http://www.w3.org/TR/2000/CR-xmlschema-1-20001024/
+
+- Part 2, http://www.w3.org/TR/2000/CR-xmlschema-2-20001024/
+
+	
+
+Author: Asir S Vedamuthu
+
+Member, XML Schema WG representing webMethods, Inc.
+
+Member, XML Schema Processor design and implementation team at webMethods
+
+
+
+webMethods, Inc.
+
+3930 Pender Drive
+
+Fairfax VA 22030
+
+
+
+(703) 450-2500
+
+
+
+Date - February 28th, 2001
+
+Version - 0.4
+
+
+
+This work is a product of the W3C XML Schema WG Task Force for authoring schema 
+
+for W3C Recommendations as an illustration of the XML Schema Language. This schema
+
+is illustrative and non-normative. Internal names created by this schema follows the
+
+same convention used by XSLT 1.0 specification.
+
+
+
+Comments were stolen from the XSLT 1.0 specification, 
+
+	http://www.w3.org/TR/1999/REC-xslt-19991116#element-syntax-summary
+
+
+
+Asir intends to update this schema as the XML Schema drafts advance from CR to 
+
+PR and then REC. Expected changes are,
+
+
+
+[1] XML Schema Namespace URI
+
+[2] Change attribute declaration syntax
+
+
+
+
+
+KNOWN ISSUES,
+
+
+
+(a) XML Schema Definition Language cannot capture a unique wild card expression in XSLT: "In addition, the xsl:stylesheet element may contain any element not from the XSLT namespace, provided that the expanded-name of the element has a non-null namespace URI" - http://www.w3.org/TR/1999/REC-xslt-19991116#stylesheet-element (This will not be an issue as per XML Schema PR)
+
+
+
+
+
+Revision History
+
+
+
+0.1 - Created
+
+0.2 - Fixed minor typos
+
+0.3 - Implemented suggestions and added fragments from James Clark
+
+0.4 - Fixed a minor typo
+
+
+
+Acknowledgement
+
+
+
+The following have contributed material to this draft:
+
+
+
+- James Clark, [email protected]
+
+
+
+
+
+Please send your comments and suggestions to [email protected]
+
+
+
+
+
+-->
+
+
+
+
+
+<schema xmlns="http://www.w3.org/2000/10/XMLSchema"
+
+        targetNamespace="http://www.w3.org/1999/XSL/Transform"
+
+        elementFormDefault="qualified"
+
+        
+
+        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+
+        xmlns:xpath="http://www.w3.org/TR/2001/WD-xptr-20010108/" blockDefault="#all">
+
+        
+
+        
+
+        <import namespace="http://www.w3.org/XML/1998/namespace" 
+
+        	schemaLocation="http://www.w3.org/2000/10/xml.xsd"/>
+
+        
+
+        
+
+        
+
+       	<!-- *** import schema for xpath
+
+       		authored by C. M. Sperberg-McQueen [[email protected]]
+
+       		Chair, XML Schema WG   		
+
+       	  	
+
+        <import namespace="http://www.w3.org/TR/2001/WD-xptr-20010108/" 
+
+        	schemaLocation="xpath.xsd"/>
+
+		--> 
+
+	
+
+	
+
+		<!-- *** result elements *** -->
+
+		<!-- *** 				 *** -->
+
+
+
+		<!-- 	There are three ways that you can construct a 
+
+				schema for XSLT stylesheets that create instances of a 
+
+				particular result structure
+
+
+
+				(a)	Declare all your result elements as a member of 
+
+					xsl:result-element substitution group
+
+
+
+				(b) Redefine model group xsl:result-element to accomodate
+
+					the desired structure
+
+
+
+				(c)	Do nothing. This schema is designed to allow any element node
+
+					or nodes if they have any namespace other than the XSLT 
+
+					namespace or not namespace qualified
+
+
+
+				I recommend (a) or (b)
+
+
+
+				In addition, I added a an attributeGroup util, 'result-element' 
+
+				for your convenience
+
+
+
+		-->
+
+
+
+		<element name="result-element" abstract="true" type="anyType"/>
+
+
+
+
+
+		<attributeGroup name="result-element">
+
+			<attribute name="extension-element-prefixes" form="qualified" type="string"/>
+
+			<attribute name="exclude-result-prefixes" form="qualified" type="string"/>
+
+			<attribute name="use-attribute-sets" form="qualified" type="xsl:QNames"/>
+
+			<attribute name="version" form="qualified" type="NMTOKEN"/>
+
+			<anyAttribute namespace="##other" processContents="skip"/>
+
+		</attributeGroup>
+
+
+
+
+
+		<group name="result-element">
+
+			<choice>
+
+				<element ref="xsl:result-element"/>
+
+				<any namespace="##other" processContents="skip"/>
+
+			</choice>
+
+        </group>
+
+	
+
+	
+
+	
+
+	
+
+	
+
+		<!-- *** Style Sheet Elements *** -->
+
+		<!-- *** 					  *** -->
+
+		
+
+		
+
+		<element name="stylesheet" type="xsl:wrapper"/>
+
+		<element name="transform" type="xsl:wrapper"/>
+
+	
+
+		<complexType name="wrapper">
+
+			<complexContent>
+
+				<extension base="xsl:anyType">
+
+					<sequence>
+
+						<element ref="xsl:import" minOccurs="0" maxOccurs="unbounded"/>
+
+						<choice  minOccurs="0" maxOccurs="unbounded">
+
+							<element ref="xsl:top-level-element"/>
+
+							<element ref="xsl:variable"/>
+
+							<any namespace="##other" processContents="skip"/> <!-- weaker than XSLT 1.0 -->
+
+						</choice>
+
+					</sequence>
+
+					<attribute name="id" type="ID"/>
+
+					<attribute name="extension-element-prefixes" type="xsl:tokens"/>
+
+					<attribute name="exclude-result-prefixes" type="xsl:tokens"/>
+
+					<attribute name="version" type="decimal" use="required"/>
+
+					<attribute ref="xml:space"/>
+
+				</extension>
+
+			</complexContent>
+
+		</complexType>
+
+		
+
+		
+
+		
+
+		
+
+		
+
+		
+
+		<!-- *** top level elements *** -->
+
+		<!-- ***					*** -->
+
+		
+
+		
+
+		<element name="top-level-element" type="xsl:anyType" abstract="true"/>
+
+		<element name="top-level-element-and-char-instruction" type="xsl:anyType" abstract="true"/>
+
+        
+
+        <element name="attribute-set" substitutionGroup="xsl:top-level-element">
+
+				        
+
+			<!-- ***
+
+
+
+			<xsl:attribute-set 
+
+			  name = qname 
+
+			  use-attribute-sets = qnames>
+
+			  Content: xsl:attribute* 
+
+			</xsl:attribute-set> 
+
+
+
+			-->
+
+
+
+			<complexType>
+
+				<complexContent>
+
+					<extension base="xsl:anyType">
+
+						<sequence minOccurs="0" maxOccurs="unbounded">
+
+							<element ref="xsl:attribute"/>
+
+						</sequence>
+
+						<attributeGroup ref="xsl:name"/>
+
+						<attributeGroup ref="xsl:use-attribute-sets"/>
+
+						<attribute ref="xml:space"/>
+
+					</extension>
+
+				</complexContent>
+
+			</complexType>
+
+				        	
+
+        </element>
+
+        
+
+        
+
+        <element name="decimal-format" substitutionGroup="xsl:top-level-element">
+
+        
+
+        	<!-- ***
+
+        	
+
+        	<xsl:decimal-format 
+
+			  name = qname 
+
+			  decimal-separator = char 
+
+			  grouping-separator = char 
+
+			  infinity = string 
+
+			  minus-sign = char 
+
+			  NaN = string 
+
+			  percent = char 
+
+			  per-mille = char 
+
+			  zero-digit = char 
+
+			  digit = char 
+
+			  pattern-separator = char /> 
+
+ 
+
+ 			-->
+
+ 			
+
+ 			<complexType>
+
+ 				<complexContent>
+
+ 					<extension base="xsl:anyType">
+
+						<attribute name="name" type="xsl:QName"/>
+
+						<attribute name="decimal-separator" type="string" use="default" value="."/>
+
+						<attribute name="grouping-separator" type="string" use="default" value=","/>
+
+						<attribute name="infinity" type="string" use="default" value="Infinity"/>
+
+						<attribute name="minus-sign" type="string" use="default" value="-"/>
+
+						<attribute name="NaN" type="string" use="default" value="NaN"/>
+
+						<attribute name="percent" type="string" use="default" value="%"/>
+
+						<attribute name="per-mille" type="string" use="default" value="&#x2030;"/>
+
+						<attribute name="zero-digit" type="string" use="default" value="0"/>
+
+						<attribute name="digit" type="string" use="default" value="#"/>
+
+						<attribute name="pattern-separator" type="string" use="default" value=";"/>
+
+					</extension>
+
+				</complexContent>
+
+ 			</complexType>
+
+ 			
+
+        </element>
+
+        
+
+        
+
+        <element name="include" substitutionGroup="xsl:top-level-element" type="xsl:combine-stylesheets">
+
+        
+
+        	<!-- ***
+
+        	
+
+        		<xsl:include 
+
+  				href = uri-reference />
+
+  				
+
+        	-->
+
+        	
+
+        </element>
+
+        
+
+        
+
+        <element name="key" substitutionGroup="xsl:top-level-element">
+
+        
+
+        	<!-- ***
+
+        	
+
+        		<xsl:key 
+
+				  name = qname 
+
+				  match = pattern 
+
+  				  use = expression />
+
+        		
+
+        	-->
+
+        	
+
+        	<complexType>
+
+        		<complexContent>
+
+        			<extension base="xsl:anyType">
+
+						<attributeGroup ref="xsl:name"/>
+
+						<attribute name="match" type="xsl:pattern" use="required"/>
+
+						<attribute name="use" type="xsl:expression" use="required"/>
+
+					</extension>
+
+				</complexContent>
+
+        	</complexType>
+
+        
+
+        </element>
+
+        
+
+        
+
+        <element name="namespace-alias" substitutionGroup="xsl:top-level-element">
+
+        
+
+        	<!-- ***
+
+        	
+
+        	-->
+
+        	
+
+        	<complexType>
+
+        		<complexContent>
+
+        			<extension base="xsl:anyType">
+
+						<attribute name="stylesheet-prefix" type="xsl:prefix" use="required"/>
+
+						<attribute name="result-prefix" type="xsl:prefix" use="required"/>
+
+					</extension>
+
+				</complexContent>
+
+        	</complexType>
+
+        	
+
+        </element>
+
+        
+
+        
+
+        <element name="output" substitutionGroup="xsl:top-level-element">
+
+        
+
+        	<!-- ***
+
+        	  		
+
+        		<xsl:output
+
+				  method = "xml" | "html" | "text" | qname-but-not-ncname 
+
+				  version = nmtoken 
+
+				  encoding = string 
+
+				  omit-xml-declaration = "yes" | "no"
+
+				  standalone = "yes" | "no"
+
+				  doctype-public = string 
+
+				  doctype-system = string 
+
+				  cdata-section-elements = qnames 
+
+				  indent = "yes" | "no"
+
+				  media-type = string /> 
+
+
+
+        	-->
+
+        	
+
+        	<complexType>
+
+        		
+
+        		<complexContent>
+
+        			<extension base="xsl:anyType">
+
+						<attribute name="method">
+
+							<simpleType>
+
+								<union>
+
+									<simpleType>
+
+										<restriction base="string">
+
+											<enumeration value="xml"/>
+
+											<enumeration value="html"/>
+
+											<enumeration value="text"/>
+
+										</restriction>
+
+									</simpleType>
+
+									<simpleType>
+
+										<restriction base="xsl:QName">
+
+											<pattern value="\c*:\c*"/>
+
+										</restriction>
+
+									</simpleType>
+
+								</union>
+
+							</simpleType>
+
+						</attribute>
+
+
+
+						<attribute name="version" type="NMTOKEN"/>
+
+						<attribute name="encoding" type="string"/>
+
+						<attribute name="omit-xml-declaration" type="xsl:YesOrNo"/>
+
+						<attribute name="standalone" type="xsl:YesOrNo"/>
+
+						<attribute name="doctype-public" type="string"/>
+
+						<attribute name="doctype-system" type="string"/>
+
+						<attribute name="cdata-section-elements" type="xsl:QNames"/>
+
+						<attribute name="indent" type="xsl:YesOrNo"/>
+
+						<attribute name="media-type" type="string"/>
+
+					</extension>
+
+				</complexContent>
+
+				
+
+        	</complexType>
+
+        
+
+        </element>
+
+
+
+		
+
+		<element name="param" substitutionGroup="xsl:top-level-element" type="xsl:variable">
+
+		
+
+			<!-- ***
+
+			
+
+				<xsl:param
+
+				  name = qname 
+
+				  select = expression>
+
+				  Content: template
+
+				</xsl:param> 
+
+				
+
+			-->
+
+        	
+
+		</element>
+
+		
+
+		
+
+        <element name="preserve-space" substitutionGroup="xsl:top-level-element">
+
+        
+
+        	<!-- ***
+
+        	
+
+        		<xsl:preserve-space
+
+				  elements = tokens /> 
+
+        	
+
+        	-->
+
+        
+
+        	<complexType>
+
+        		<complexContent>
+
+        			<extension base="xsl:anyType">
+
+        				<attribute name="elements" type="xsl:element-names" use="required"/>
+
+        			</extension>
+
+        		</complexContent>
+
+        	</complexType>
+
+        	
+
+        </element>
+
+        
+
+        <element name="strip-space" substitutionGroup="xsl:preserve-space"/>
+
+        
+
+        
+
+        <element name="template" substitutionGroup="xsl:top-level-element">
+
+        
+
+        	<!-- ***
+
+        		
+
+        		<xsl:template
+
+				  match = pattern 
+
+				  name = qname 
+
+				  priority = number 
+
+				  mode = qname>
+
+				  Content: (xsl:param*, template)
+
+				</xsl:template> 
+
+
+
+        	-->
+
+        	
+
+        	<complexType mixed="true">
+
+        	
+
+        		<complexContent>
+
+        			<extension base="xsl:anyType">
+
+        				<sequence>
+
+        					<element ref="xsl:param" minOccurs="0" maxOccurs="unbounded"/>
+
+							<choice minOccurs="0" maxOccurs="unbounded">
+
+								<element ref="xsl:top-level-element-and-char-instruction"/>
+
+								<element ref="xsl:instruction"/>
+
+								<group ref="xsl:result-element"/>
+
+							</choice>
+
+						</sequence>
+
+						<attribute name="match" type="xsl:pattern"/>
+
+						<attribute name="name" type="xsl:QName"/>
+
+						<attribute name="priority" type="decimal"/>
+
+						<attribute name="mode" type="xsl:QName"/>
+
+						<attribute ref="xml:space"/>
+
+					</extension>
+
+				</complexContent>
+
+				
+
+        	</complexType>
+
+        	
+
+        </element>
+
+        
+
+        
+
+        <!-- *** top level elements and char instructions *** -->
+
+        <!-- ***										  *** -->
+
+        
+
+        
+
+        <element name="variable" type="xsl:variable" substitutionGroup="xsl:char-instruction">
+
+        
+
+        	<!-- ***
+
+        	
+
+        		<xsl:variable
+
+				  name = qname 
+
+				  select = expression>
+
+				  Content: template
+
+				</xsl:variable>
+
+				
+
+        	-->
+
+        
+
+        </element>
+
+        
+
+        
+
+        
+
+        
+
+        <!-- *** instructions *** -->
+
+        <!-- *** 			  *** -->
+
+        
+
+              
+
+        <element name="instruction" type="xsl:anyType" abstract="true"/>
+
+        
+
+        <element name="char-instruction" type="xsl:anyType" abstract="true"
+
+        	substitutionGroup="xsl:instruction"/>
+
+        
+
+        <element name="apply-imports" type="xsl:anyType" substitutionGroup="xsl:char-instruction">
+
+        
+
+        	<!-- ***
+
+        	
+
+        		<xsl:apply-imports />
+
+        	
+
+        	-->
+
+			
+
+		</element>
+
+        
+
+        
+
+        <element name="apply-templates" substitutionGroup="xsl:char-instruction">
+
+        	
+
+        	
+
+        	<!-- ***
+
+
+
+        	<xsl:apply-templates
+
+			  select = node-set-expression 
+
+			  mode = qname>
+
+			  Content: (xsl:sort | xsl:with-param)*
+
+			</xsl:apply-templates> 
+
+
+
+        	-->
+
+        	
+
+        	<complexType>
+
+        	
+
+        		<complexContent>
+
+        			<extension base="xsl:anyType">
+
+						<choice minOccurs="0" maxOccurs="unbounded">
+
+							<element ref="xsl:sort"/>
+
+							<element ref="xsl:with-param"/>
+
+						</choice>
+
+						<attribute name="select" type="xsl:expression" use="default" value="node()"/>
+
+						<attribute name="mode" type="xsl:QName"/>
+
+					</extension>
+
+				</complexContent>
+
+				
+
+        	</complexType>
+
+        
+
+        </element>
+
+        
+
+        
+
+        <element name="attribute" type="xsl:attribute-type" substitutionGroup="xsl:instruction"/>
+
+        
+
+        
+
+        <element name="call-template" substitutionGroup="xsl:char-instruction">
+
+        	
+
+        	<!-- ***
+
+        	
+
+        	<xsl:call-template
+
+			  name = qname>
+
+			  Content: xsl:with-param*
+
+			</xsl:call-template> 
+
+			
+
+			-->
+
+        	
+
+        	<complexType>
+
+        		<complexContent>
+
+        			<extension base="xsl:anyType">
+
+						<sequence minOccurs="0" maxOccurs="unbounded">
+
+							<element ref="xsl:with-param"/>
+
+						</sequence>
+
+						<attributeGroup ref="xsl:name"/>
+
+					</extension>
+
+				</complexContent>
+
+        	</complexType>
+
+        	
+
+        </element>
+
+        
+
+        
+
+        <element name="choose" substitutionGroup="xsl:char-instruction">
+
+        
+
+        	
+
+        	<!-- ***
+
+        	
+
+        		<xsl:choose>
+
+				  Content: (xsl:when+, xsl:otherwise?) 
+
+				</xsl:choose> 
+
+
+
+        	-->
+
+        	
+
+        	<complexType>
+
+        		<complexContent>
+
+        			<extension base="xsl:anyType">
+
+						<sequence>
+
+							<element ref="xsl:when" minOccurs="1" maxOccurs="unbounded"/>
+
+							<element ref="xsl:otherwise" minOccurs="0"/>
+
+						</sequence>
+
+						<attribute ref="xml:space"/>
+
+					</extension>
+
+				</complexContent>
+
+        	</complexType>
+
+        	
+
+        </element>
+
+        
+
+        <element name="comment" substitutionGroup="xsl:instruction">
+
+        	
+
+        	<!-- ***
+
+        		
+
+        		<xsl:comment>
+
+				  Content: template
+
+				</xsl:comment> 
+
+
+
+        	-->
+
+        	
+
+        	<complexType mixed="true">
+
+        		<complexContent>
+
+        			<extension base="xsl:anyType">
+
+						<choice minOccurs="0" maxOccurs="unbounded">
+
+							<element ref="xsl:char-instruction"/>
+
+							<element ref="xsl:top-level-element-and-char-instruction"/>
+
+						</choice>
+
+						<attribute ref="xml:space"/>
+
+					</extension>
+
+				</complexContent>
+
+        	</complexType>
+
+        	
+
+        </element>
+
+        
+
+        
+
+        <element name="copy" substitutionGroup="xsl:char-instruction">
+
+        
+
+        	<!-- ***
+
+        	
+
+        	<xsl:copy
+
+			  use-attribute-sets = qnames>
+
+			  Content: template
+
+			</xsl:copy> 
+
+			
+
+			-->
+
+        	
+
+        	<complexType mixed="true">
+
+        		<complexContent>
+
+        			<extension base="xsl:anyType">
+
+						<group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+
+						<attribute ref="xml:space"/>
+
+						<attributeGroup ref="xsl:use-attribute-sets"/>
+
+					</extension>
+
+				</complexContent>
+
+        	</complexType>
+
+        
+
+        </element>
+
+        
+
+        
+
+        <element name="copy-of" substitutionGroup="xsl:char-instruction">
+
+        
+
+        	<!-- ***
+
+        	
+
+        		<xsl:copy-of
+
+				  select = expression /> 
+
+
+
+        	-->
+
+        	
+
+        	<complexType mixed="true">
+
+        		<complexContent>
+
+        			<extension base="xsl:anyType">
+
+						<attributeGroup ref="xsl:select-required"/>
+
+					</extension>
+
+				</complexContent>
+
+        	</complexType>
+
+        
+
+        </element>
+
+        
+
+        
+
+        <element name="element" substitutionGroup="xsl:instruction">
+
+        
+
+        	<!-- ***
+
+        	
+
+        		<xsl:element 
+
+				  name = { qname }
+
+				  namespace = { uri-reference }
+
+				  use-attribute-sets = qnames>
+
+				  Content: template
+
+				</xsl:element>
+
+			-->
+
+			
+
+			<complexType mixed="true">
+
+				<complexContent>
+
+					<extension base="xsl:anyType">
+
+						<group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+
+						<attributeGroup ref="xsl:name-avt"/>
+
+						<attribute name="namespace" type="xsl:expr-avt"/>
+
+						<attributeGroup ref="xsl:use-attribute-sets"/>
+
+						<attribute ref="xml:space"/>
+
+					</extension>
+
+				</complexContent>
+
+			</complexType>
+
+			
+
+        </element>
+
+        
+
+        
+
+        <element name="fallback" substitutionGroup="xsl:char-instruction">
+
+        
+
+        	<!-- ***
+
+        		
+
+        		<xsl:fallback>
+
+				  Content: template
+
+				</xsl:fallback>
+
+				
+
+			-->
+
+			
+
+			<complexType mixed="true">
+
+				<complexContent>
+
+					<extension base="xsl:anyType">
+
+						<group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+
+						<attribute ref="xml:space"/>
+
+					</extension>
+
+				</complexContent>
+
+			</complexType>
+
+		
+
+		</element>
+
+        
+
+        
+
+        <element name="for-each" substitutionGroup="xsl:char-instruction">
+
+        
+
+        	<!-- ***
+
+        	
+
+        		<xsl:for-each 
+
+				  select = node-set-expression>
+
+				  Content: (xsl:sort*, template)
+
+				</xsl:for-each> 
+
+
+
+			-->
+
+		
+
+			<complexType mixed="true">
+
+				<complexContent>
+
+					<extension base="xsl:anyType">
+
+						<sequence>
+
+							<element ref="xsl:sort" minOccurs="0" maxOccurs="unbounded"/>
+
+							<choice minOccurs="0" maxOccurs="unbounded">
+
+								<element ref="xsl:top-level-element-and-char-instruction"/>
+
+								<element ref="xsl:instruction"/>
+
+								<group ref="xsl:result-element"/>
+
+							</choice>
+
+						</sequence>
+
+						<attributeGroup ref="xsl:select-required"/>
+
+						<attribute ref="xml:space"/>
+
+					</extension>
+
+				</complexContent>
+
+			</complexType>
+
+			
+
+		</element>
+
+		
+
+		<element name="if" substitutionGroup="xsl:char-instruction">
+
+			
+
+			<!-- ***
+
+			
+
+				<xsl:if 
+
+				  test = boolean-expression>
+
+				  Content: template
+
+				</xsl:if> 
+
+
+
+			-->
+
+			
+
+			<complexType mixed="true">
+
+				<complexContent>
+
+					<extension base="xsl:anyType">
+
+						<group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+
+						<attribute name="test" type="xsl:expression" use="required"/>
+
+						<attribute ref="xml:space"/>
+
+					</extension>
+
+				</complexContent>
+
+			</complexType>
+
+			
+
+		</element>
+
+		
+
+		
+
+		<element name="message" substitutionGroup="xsl:char-instruction">
+
+			
+
+			<!-- ***
+
+			
+
+				<xsl:message 
+
+				  terminate = "yes" | "no">
+
+				  Content: template
+
+				</xsl:message> 
+
+			
+
+			-->
+
+		
+
+			<complexType mixed="true">
+
+				
+
+				<complexContent>
+
+					<extension base="xsl:anyType">
+
+						<group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+
+						<attribute ref="xml:space"/>
+
+						<attribute name="terminate" use="default" value="no" type="xsl:YesOrNo"/>
+
+					</extension>
+
+				</complexContent>
+
+			</complexType>
+
+			
+
+		</element>
+
+		
+
+		
+
+		<element name="number" substitutionGroup="xsl:char-instruction">
+
+		
+
+			<!-- ***
+
+			
+
+				<xsl:number 
+
+				  level = "single" | "multiple" | "any"
+
+				  count = pattern 
+
+				  from = pattern 
+
+				  value = number-expression 
+
+				  format = { string }
+
+				  lang = { nmtoken }
+
+				  letter-value = { "alphabetic" | "traditional" }
+
+				  grouping-separator = { char }
+
+  				  grouping-size = { number } />
+
+			
+
+			-->
+
+			
+
+			<complexType>
+
+				
+
+				<complexContent>
+
+					<extension base="xsl:anyType">
+
+						<attribute name="level" use="default" value="single">
+
+							<simpleType>
+
+								<restriction base="NMTOKEN">
+
+									<enumeration value="single"/>
+
+									<enumeration value="multiple"/>
+
+									<enumeration value="any"/>
+
+								</restriction>
+
+							</simpleType>
+
+						</attribute>
+
+
+
+						<attribute name="count" type="xsl:pattern"/>
+
+						<attribute name="from" type="xsl:pattern"/>
+
+						<attribute name="value" type="xsl:expression"/>
+
+						<attribute name="format" type="xsl:expr-avt" use="default" value="1"/>
+
+						<attribute name="lang" type="xsl:expr-avt"/>
+
+						<attribute name="letter-value" type="xsl:expr-avt"/>
+
+						<attribute name="grouping-separator" type="xsl:expr-avt"/>
+
+						<attribute name="grouping-size" type="xsl:expr-avt"/>
+
+					</extension>
+
+				</complexContent>
+
+				
+
+			</complexType>
+
+		
+
+		</element>
+
+		
+
+		
+
+		<element name="processing-instruction" substitutionGroup="xsl:instruction">
+
+		
+
+			<!-- ***
+
+			
+
+				<xsl:processing-instruction
+
+				  name = { ncname }>
+
+				  Content: template
+
+				</xsl:processing-instruction>
+
+				
+
+			-->
+
+		
+
+			<complexType mixed="true">
+
+		
+
+				<complexContent>
+
+					<extension base="xsl:anyType">
+
+						<choice minOccurs="0" maxOccurs="unbounded">
+
+							<element ref="xsl:char-instruction"/>
+
+							<element ref="xsl:top-level-element-and-char-instruction"/>
+
+						</choice>
+
+						<attributeGroup ref="xsl:name-avt"/>
+
+						<attribute ref="xml:space"/>
+
+					</extension>
+
+				</complexContent>
+
+			</complexType>
+
+		
+
+		</element>
+
+		
+
+		
+
+		<element name="text" substitutionGroup="xsl:char-instruction">
+
+		
+
+			<!-- ***
+
+			
+
+				<xsl:text
+
+				  disable-output-escaping = "yes" | "no">
+
+				  Content: #PCDATA
+
+				</xsl:text> 
+
+			
+
+			-->
+
+			
+
+			<complexType mixed="true">
+
+				<complexContent>
+
+					<extension base="xsl:anyType">
+
+						<attributeGroup ref="xsl:disable-output-escaping"/>
+
+						<attribute ref="xml:lang"/>
+
+						<attribute ref="xml:space"/>
+
+					</extension>
+
+				</complexContent>
+
+			</complexType>
+
+		
+
+		</element>
+
+		
+
+		
+
+		<element name="value-of" substitutionGroup="xsl:char-instruction">
+
+		
+
+			<!-- ***
+
+			
+
+				<xsl:value-of
+
+				  select = string-expression 
+
+				  disable-output-escaping = "yes" | "no" /> 
+
+			
+
+			-->
+
+			
+
+			<complexType>
+
+				<complexContent>
+
+					<extension base="xsl:anyType">
+
+						<attributeGroup ref="xsl:select-required"/>
+
+						<attributeGroup ref="xsl:disable-output-escaping"/>
+
+					</extension>
+
+				</complexContent>
+
+			</complexType>
+
+			
+
+		</element>
+
+		
+
+		
+
+		
+
+		<!-- *** orphans *** -->
+
+		<!-- *** 		 *** -->
+
+		
+
+		<element name="import" type="xsl:combine-stylesheets">
+
+			
+
+			<!-- ***
+
+			
+
+				<xsl:import
+
+  					href = uri-reference /> 
+
+  			-->
+
+			
+
+		</element>
+
+		
+
+		
+
+		<element name="otherwise">
+
+		
+
+			<!-- ***
+
+			
+
+				<xsl:otherwise>
+
+				  Content: template 
+
+				</xsl:otherwise>
+
+			
+
+			-->
+
+			
+
+				<complexType mixed="true">
+
+					<complexContent>
+
+						<extension base="xsl:anyType">
+
+							<group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+
+							<attribute ref="xml:space"/>
+
+						</extension>
+
+					</complexContent>
+
+				</complexType>
+
+		
+
+		</element>
+
+		
+
+		
+
+		<element name="sort">
+
+		
+
+			<!-- ***
+
+			
+
+				xsl:sort
+
+				  select = string-expression 
+
+				  lang = { nmtoken }
+
+				  data-type = { "text" | "number" | qname-but-not-ncname }
+
+				  order = { "ascending" | "descending" }
+
+				  case-order = { "upper-first" | "lower-first" } /> 
+
+
+
+			-->
+
+			
+
+			<complexType>
+
+				<complexContent>
+
+					<extension base="xsl:anyType">
+
+						<attribute name="select" type="xsl:expression" use="default" value="."/>	
+
+						<attribute name="lang" type="xsl:expr-avt"/>				
+
+						<attribute name="data-type" type="xsl:expr-avt" use="default" value="text"/>				
+
+						<attribute name="order" type="xsl:expr-avt" use="default" value="ascending"/>				
+
+						<attribute name="case-order" type="xsl:expr-avt"/>
+
+					</extension>
+
+				</complexContent>
+
+			</complexType>
+
+		
+
+		</element>
+
+		
+
+		
+
+		<element name="when">
+
+		
+
+			<!-- ***
+
+				<xsl:when
+
+				  test = boolean-expression>
+
+				  Content: template
+
+				</xsl:when>
+
+			-->
+
+			
+
+			<complexType mixed="true">
+
+				<complexContent>
+
+					<extension base="xsl:anyType">
+
+						<group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+
+						<attribute name="test" type="xsl:expression" use="required"/>
+
+						<attribute ref="xml:space"/>
+
+					</extension>
+
+				</complexContent>
+
+			</complexType>
+
+			
+
+		</element>
+
+		
+
+		
+
+		<element name="with-param" type="xsl:variable">
+
+		
+
+			<!-- ***
+
+			
+
+				<xsl:with-param
+
+				  name = qname 
+
+				  select = expression>
+
+				  Content: template
+
+				</xsl:with-param> 
+
+			-->
+
+			
+
+		</element>
+
+		
+
+		
+
+		
+
+		
+
+		
+
+		
+
+        <!-- *** utils - internal types and groups *** -->
+
+		<!-- *** not for public use                *** -->
+
+        <!-- ***								   *** -->
+
+        
+
+        <complexType name="attribute-type" mixed="true">
+
+        
+
+        	<!-- ***
+
+        	
+
+			 <xsl:attribute
+
+			   name = { qname }
+
+			   namespace = { uri-reference }>
+
+			   Content: template
+
+			 </xsl:attribute> 
+
+
+
+        	-->
+
+        	<complexContent>
+
+        		<extension base="xsl:anyType">
+
+					<choice minOccurs="0" maxOccurs="unbounded">
+
+						<element ref="xsl:char-instruction"/>
+
+						<element ref="xsl:top-level-element-and-char-instruction"/>
+
+					</choice>
+
+
+
+					<attributeGroup ref="xsl:name-avt"/>
+
+					<attribute name="namespace" type="xsl:expr-avt"/>
+
+					<attribute ref="xml:space"/>
+
+				</extension>
+
+			</complexContent>
+
+			
+
+        </complexType>
+
+        
+
+        
+
+        <simpleType name="tokens">
+
+        	<list itemType="token"/>
+
+        </simpleType>
+
+        
+
+        <simpleType name="QNames">
+
+        	<list itemType="xsl:QName"/>
+
+        </simpleType>
+
+        
+
+        <attributeGroup name="name">
+
+        	<attribute name="name" type="xsl:QName" use="required"/>
+
+        </attributeGroup>
+
+        
+
+        <attributeGroup name="name-avt">
+
+        	<attribute name="name" type="xsl:expr-avt" use="required"/>
+
+        </attributeGroup>
+
+        
+
+        <attributeGroup name="select-optional">
+
+        	<attribute name="select" type="xsl:expression"/>
+
+        </attributeGroup>
+
+        
+
+        <attributeGroup name="select-required">
+
+		    <attribute name="select" type="xsl:expression" use="required"/>
+
+        </attributeGroup>
+
+        
+
+        <attributeGroup name="use-attribute-sets">
+
+        	<attribute name="use-attribute-sets" type="xsl:QNames"/>
+
+        </attributeGroup>
+
+        
+
+        
+
+        
+
+        
+
+        <group name="template">
+
+			<choice>
+
+				<element ref="xsl:top-level-element-and-char-instruction"/>
+
+				<element ref="xsl:instruction"/>
+
+				<group ref="xsl:result-element"/>
+
+			</choice>
+
+        </group>
+
+        
+
+        <complexType name="combine-stylesheets">
+
+        	<complexContent>
+
+        		<extension base="xsl:anyType">
+
+        			<attribute name="href" type="uriReference" use="required"/>
+
+        		</extension>
+
+        	</complexContent>
+
+        </complexType>
+
+        
+
+		<simpleType name="YesOrNo">
+
+			<restriction base="string">
+
+				<enumeration value="yes"/>
+
+				<enumeration value="no"/>
+
+			</restriction>
+
+		</simpleType>
+
+		
+
+		<simpleType name="QName">
+
+			<union memberTypes="NCName QName"/>
+
+		</simpleType>
+
+		
+
+		<simpleType name="element-names">
+
+			<list>
+
+				<simpleType>
+
+					<union memberTypes="QName">
+
+						<simpleType>
+
+							<restriction base="CDATA">
+
+								<pattern value="\*"/>
+
+								<pattern value="\i\c*:\*"/>
+
+							</restriction>
+
+						</simpleType>
+
+					</union>
+
+				</simpleType>
+
+			</list>
+
+		</simpleType>
+
+		
+
+		<attributeGroup name="disable-output-escaping">
+
+			<attribute name="disable-output-escaping" type="xsl:YesOrNo"
+
+							use="default" value="no"/>
+
+		</attributeGroup>
+
+		
+
+		<complexType name="variable" mixed="true">
+
+			<complexContent>
+
+				<extension base="xsl:anyType">
+
+					<group ref="xsl:template" minOccurs="0" maxOccurs="unbounded"/>
+
+					<attributeGroup ref="xsl:name"/>
+
+					<attributeGroup ref="xsl:select-optional"/>
+
+				</extension>
+
+			</complexContent>
+
+		</complexType>
+
+		
+
+		
+
+		<simpleType name="expr-avt">
+
+		   <restriction base="string">
+
+		      <!-- <pattern
+
+		value="([^\{\}]|\{\{|\}\})*\{([^&quot;'\{\}]|&quot;[^&quot;]*&quot;|'[^']*')+\}([^\{\}]|\{\{|\}\}|\{([^&quot;'\{\}]|&quot;[^&quot;]*&quot;|'[^']*')+\})*"/> -->
+
+		   </restriction>
+
+		</simpleType>
+
+		
+
+		<simpleType name="expression">
+
+			<restriction base="string">
+
+				<!-- ****
+
+				
+
+					patterns go here 
+
+					
+
+					-->
+
+			</restriction>
+
+		</simpleType>
+
+		
+
+		<simpleType name="pattern">
+
+			<restriction base="string">
+
+				<!-- ***
+
+				
+
+					patterns go here
+
+					
+
+					-->
+
+			</restriction>
+
+		</simpleType>
+
+		
+
+		<simpleType name="prefix">
+
+			<union memberTypes="NCName">
+
+				<simpleType>
+
+					<restriction base="string">
+
+						<enumeration value="#default"/>
+
+					</restriction>
+
+				</simpleType>
+
+			</union>
+
+		</simpleType>
+
+		
+
+		
+
+		<complexType name="anyType">
+
+			<anyAttribute namespace="##other" processContents="skip"/>
+
+		</complexType>
+
+</schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation4.xml b/xml/tests/testData/xml/ComplexSchemaValidation4.xml
new file mode 100644
index 0000000..aacc3341
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation4.xml
@@ -0,0 +1,410 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<DeclareSalary
+        xmlns="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclarationServiceTypes"
+        xmlns:ct="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclarationContainer"
+        xmlns:sd="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclaration"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+
+    <!--
+    status: propsal20050???
+    business-view  = OK    (20050830;ero+ab)
+    technical-view = workaround: namespace 'st' in 'DeclareSalary' - Axis Error    (20050727;ifl)
+    -->    
+    <ct:RequestContext>
+        <ct:UserAgent>
+            <ct:Producer>itServe AG</ct:Producer>
+            <ct:Name>Test</ct:Name>
+            <ct:Version>0.1</ct:Version>
+            <ct:Certificate>None</ct:Certificate>
+        </ct:UserAgent>
+        <ct:CompanyName>
+            <sd:HR-RC-Name>String</sd:HR-RC-Name>
+        </ct:CompanyName>
+        <ct:TransmissionDate>2001-12-17T09:30:47.0Z</ct:TransmissionDate>
+        <ct:RequestID>reqId</ct:RequestID>
+        <ct:LanguageCode>de</ct:LanguageCode>
+        <ct:MonitoringID>tester</ct:MonitoringID>
+    </ct:RequestContext>
+    <ct:Job>
+        <ct:Addressees>
+            <ct:AHV-AVS>
+                <ct:ProcessByDistributor>false</ct:ProcessByDistributor>
+            </ct:AHV-AVS>
+            <ct:UVG-LAA InstitutionIDRef="#Suva">
+                <ct:ProcessByDistributor>true</ct:ProcessByDistributor>
+            </ct:UVG-LAA>
+            <ct:UVGZ-LAAC InstitutionIDRef="#Backwork">
+                <ct:ProcessByDistributor>true</ct:ProcessByDistributor>
+            </ct:UVGZ-LAAC>
+            <ct:KTG-AMC InstitutionIDRef="#Backwork">
+                <ct:ProcessByDistributor>true</ct:ProcessByDistributor>
+                <ct:CCAddressee>
+                    <ct:Name>Broker und Treuhang AG</ct:Name>
+                    <ct:Street>Kopie-Strasse</ct:Street>
+                    <ct:ZIP-Code>3000</ct:ZIP-Code>
+                    <ct:City>Bern</ct:City>
+                </ct:CCAddressee>
+            </ct:KTG-AMC>
+            <ct:BVG-LPP InstitutionIDRef="#Oldsoft">
+                <ct:ProcessByDistributor>true</ct:ProcessByDistributor>
+            </ct:BVG-LPP>
+            <ct:FAK-CAF InstitutionIDRef="#005.000">
+                <ct:ProcessByDistributor>false</ct:ProcessByDistributor>
+            </ct:FAK-CAF>
+            <ct:CantonalTaxAdministration>
+                <ct:ProcessByDistributor>true</ct:ProcessByDistributor>
+            </ct:CantonalTaxAdministration>
+            <ct:SwissFederalStatisticalOffice>
+                <ct:ProcessByDistributor>true</ct:ProcessByDistributor>
+            </ct:SwissFederalStatisticalOffice>
+        </ct:Addressees>
+    </ct:Job>
+    <ct:SalaryDeclaration schemaVersion="0.0"
+                          xmlns="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclaration"
+                          xmlns:ct="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclarationContainer">
+        <!--
+            not direct necessary in version 2
+            xmlns:iso3166="http://www.unece.org/etrades/unedocs/repository/codelists/xml/CountryCode.xsd">
+        -->
+        <Company>
+            <CompanyDescription>
+                <Name>
+                    <HR-RC-Name>ICHAG</HR-RC-Name>
+                </Name>
+                <Address>
+                    <Street>Länggassstrasse 26</Street>
+                    <Postbox>690</Postbox>
+                    <ZIP-Code>3000</ZIP-Code>
+                    <City>Bern 9</City>
+                </Address>
+                <BUR-REE-Number>123435</BUR-REE-Number>
+            </CompanyDescription>
+            <!-- ===================================== -->
+            <!-- staffs -->
+            <!-- ===================================== -->
+            <Staff>
+                <Person>
+                    <Particulars>
+                        <Social-InsuranceIdentification>
+                            <AHV-AVS-Number>123.45.178.128</AHV-AVS-Number>
+                        </Social-InsuranceIdentification>
+                        <EmployeeNumber>0100</EmployeeNumber>
+                        <Lastname>Balmer</Lastname>
+                        <Firstname>Fredi</Firstname>
+                        <Sex>M</Sex>
+                        <DateOfBirth>1945-03-16</DateOfBirth>
+                        <Nationality>
+                            <ISOCode>CH</ISOCode>
+                        </Nationality>
+                        <CivilStatus>married</CivilStatus>
+                        <!-- new tax -->
+                        <Address>
+                            <Street>Länggassstrasse 26</Street>
+                            <Postbox>690</Postbox>
+                            <ZIP-Code>3000</ZIP-Code>
+                            <City>Bern 9</City>
+                        </Address>
+                        <ResidenceCanton>ZG</ResidenceCanton>
+                    </Particulars>
+                    <Work>
+                        <ActivityRate>99</ActivityRate>
+                        <WorkplaceCanton>BE</WorkplaceCanton>
+                    </Work>
+                    <AHV-AVS-Salaries>
+                        <AHV-AVS-Salary>
+                            <AccountingTime>
+                                <from>2004-01-01</from>
+                                <until>2004-12-31</until>
+                            </AccountingTime>
+                            <AHV-AVS-Income>65000.00</AHV-AVS-Income>
+                            <AHV-AVS-Open>0.00</AHV-AVS-Open>
+                            <ALV-AC-Income>65000.00</ALV-AC-Income>
+                            <ALVZ-ACS-Income>0.00</ALVZ-ACS-Income>
+                            <ALV-AC-Open>0.00</ALV-AC-Open>
+                        </AHV-AVS-Salary>
+                    </AHV-AVS-Salaries>
+                    <UVG-LAA-Salaries>
+                        <UVG-LAA-Salary InstitutionIDRef="#Suva">
+                            <AccountingTime>
+                                <from>2004-01-01</from>
+                                <until>2004-12-31</until>
+                            </AccountingTime>
+                            <UVG-LAA-Code>A1</UVG-LAA-Code>
+                            <UVG-LAA-GrossSalary>71960.00</UVG-LAA-GrossSalary>
+                            <UVG-LAA-BaseSalary>65000.00</UVG-LAA-BaseSalary>
+                            <UVG-LAA-ContributorySalary>65000.00</UVG-LAA-ContributorySalary>
+                        </UVG-LAA-Salary>
+                    </UVG-LAA-Salaries>
+                    <UVGZ-LAAC-Salaries>
+                        <UVGZ-LAAC-Salary InstitutionIDRef="#Backwork">
+                            <AccountingTime>
+                                <from>2004-01-01</from>
+                                <until>2004-12-31</until>
+                            </AccountingTime>
+                            <UVGZ-LAAC-Code>9Z</UVGZ-LAAC-Code>
+                            <UVGZ-LAAC-BaseSalary>65000.00</UVGZ-LAAC-BaseSalary>
+                            <UVGZ-LAAC-ContributorySalary>65000.00</UVGZ-LAAC-ContributorySalary>
+                        </UVGZ-LAAC-Salary>
+                    </UVGZ-LAAC-Salaries>
+                    <KTG-AMC-Salaries>
+                        <KTG-AMC-Salary InstitutionIDRef="#Backwork">
+                            <AccountingTime>
+                                <from>2004-01-01</from>
+                                <until>2004-12-31</until>
+                            </AccountingTime>
+                            <KTG-AMC-Code>X7</KTG-AMC-Code>
+                            <Reference-AHV-AVS-Salary>65000.00</Reference-AHV-AVS-Salary>
+                            <KTG-AMC-ContributorySalary>65000.00</KTG-AMC-ContributorySalary>
+                        </KTG-AMC-Salary>
+                    </KTG-AMC-Salaries>
+                    <BVG-LPP-Salaries>
+                        <BVG-LPP-Salary InstitutionIDRef="#Oldsoft">
+                            <AccountingTime>
+                                <from>2004-01-01</from>
+                                <until>2004-12-31</until>
+                            </AccountingTime>
+                            <BVG-LPP-Code>MM</BVG-LPP-Code>
+                            <BVG-LPP-AHV-AVS-Salary>65000.00</BVG-LPP-AHV-AVS-Salary>
+                        </BVG-LPP-Salary>
+                    </BVG-LPP-Salaries>
+                    <FAK-CAF-Salaries>
+                        <FAK-CAF-Salary>
+                            <FAK-CAF-Period>
+                                <from>2004-01-01</from>
+                                <until>2004-12-31</until>
+                            </FAK-CAF-Period>
+                            <FAK-CAF-ContributorySalary>65000.00</FAK-CAF-ContributorySalary>
+                            <FAK-CAF-FamilyIncomeSupplement>1800.00</FAK-CAF-FamilyIncomeSupplement>
+                            <FAK-CAF-WorkplaceCanton>BE</FAK-CAF-WorkplaceCanton>
+                        </FAK-CAF-Salary>
+                    </FAK-CAF-Salaries>
+                    <TaxSalaries>
+                        <TaxSalary>
+                            <Period>
+                                <from>2004-01-01</from>
+                                <until>2004-12-31</until>
+                            </Period>
+                            <FreeTransport/>
+                            <CanteenLunchCheck/>
+                            <Income>48118.70</Income>
+                            <FringeBenefits>
+                                <FoodLodging>1000.00</FoodLodging>
+                                <CompanyCar>5160.00</CompanyCar>
+                                <Other>
+                                    <Text>Verbilligung Mietwohnung, Geldwerter Vorteil</Text>
+                                    <Sum>2400.00</Sum>
+                                </Other>
+                            </FringeBenefits>
+                            <SporadicBenefits>
+                                <Text>Gratifikation, Gewinnbeteiligung</Text>
+                                <Sum>5000.00</Sum>
+                            </SporadicBenefits>
+                            <CapitalPayment>
+                                <Text>Abgangsentschädigung</Text>
+                                <Sum>3000.00</Sum>
+                            </CapitalPayment>
+                            <OwnershipRight>300.00</OwnershipRight>
+                            <BoardOfDirectorsRemuneration>2000.00</BoardOfDirectorsRemuneration>
+                            <OtherBenefits>
+                                <Text>Arbeitgeberanteil AHV/IV/EO/ALV</Text>
+                                <Sum>1021.30</Sum>
+                            </OtherBenefits>
+                            <GrossIncome>68000.00</GrossIncome>
+                            <AHV-ALV-NBUV-AVS-AC-AANP-Contribution>3657.00</AHV-ALV-NBUV-AVS-AC-AANP-Contribution>
+                            <BVG-LPP-Contribution>
+                                <Regular>6500.00</Regular>
+                                <Purchase>1500.00</Purchase>
+                            </BVG-LPP-Contribution>
+                            <NetIncome>56343.00</NetIncome>
+                            <DeductionAtSource>3647.55</DeductionAtSource>
+                            <ChargesRule>
+                                <WithRegulation>
+                                    <Allowed>2004-01-01</Allowed>
+                                    <Canton>BE</Canton>
+                                </WithRegulation>
+                            </ChargesRule>
+                            <Charges>
+                                <Effective>
+                                    <Other>
+                                        <!-- variante mit Spesenreglement und ohne Betrag -->
+                                        <Text>effektive Spesen Expatriate</Text>
+                                        <!-- <Sum>7500.00</Sum> -->
+                                    </Other>
+                                </Effective>
+                                <LumpSum>
+                                    <Representation>3000.00</Representation>
+                                    <Car>500.00</Car>
+                                    <Other>
+                                        <Text>Übrige Pauschalspesen</Text>
+                                        <Sum>1500.00</Sum>
+                                    </Other>
+                                </LumpSum>
+                                <Education>12001.00</Education>
+                            </Charges>
+                            <OtherFringeBenefits>Übermässige Vergünstigung auf
+                                Versicherungsprämien</OtherFringeBenefits>
+                            <StandardRemark>
+                                <StaffShareThirdCompany>IKEA und H+M</StaffShareThirdCompany>
+                                <ChildAllowancePerAHV-AVS/>
+                                <RelocationCosts>5000.00</RelocationCosts>
+                                <StaffShareMarketValue>
+                                    <Allowed>2004-01-01</Allowed>
+                                    <Canton>ZG</Canton>
+                                </StaffShareMarketValue>
+                                <StaffShareWithoutTaxableIncome>diverse Gründe!!</StaffShareWithoutTaxableIncome>
+                            </StandardRemark>
+                            <Remark>
+                                Ein erster Testfall (noch kontrollieren)!!
+                            </Remark>
+                        </TaxSalary>
+                    </TaxSalaries>
+                    <StatisticSalaries>
+                        <StatisticSalary>
+                            <Period>
+                                <from>2004-01-01</from>
+                                <until>2004-12-31</until>
+                            </Period>
+                            <TotalHoursOfWork>42.00</TotalHoursOfWork>
+                            <GrossEarnings>48160.00</GrossEarnings>
+                            <SocialContributions>11657.00</SocialContributions>
+                            <Allowances>2850.00</Allowances>
+                            <Overtime>2368.70</Overtime>
+                            <Earnings13th>3300.00</Earnings13th>
+                            <SpecialPayments>5000.00</SpecialPayments>
+                            <PaymentsByThird>2160.00</PaymentsByThird>
+                            <LaborCost>4800.00</LaborCost>
+                            <ExtendedBenefits>1321.30</ExtendedBenefits>
+                            <Education>enterpriseEducation</Education>
+                            <Skill>qualified</Skill>
+                            <Position>highestCadre</Position>
+                            <Activity>21</Activity>
+                            <WageForm>timeWages</WageForm>
+                        </StatisticSalary>
+                    </StatisticSalaries>
+                </Person>
+            </Staff>
+            <!-- ===================================== -->
+            <!-- Insurances -->
+            <!-- ===================================== -->
+            <Insurances>
+                <AHV-AVS>
+                    <AK-CC-BranchNumber>003.000</AK-CC-BranchNumber>
+                    <AK-CC-CustomerNumber>100-9976.9</AK-CC-CustomerNumber>
+                    <SalaryDeclarationIsComplete>true</SalaryDeclarationIsComplete>
+                </AHV-AVS>
+                <UVG-LAA>
+                    <Suva InstitutionID="#Suva">
+                        <SuvaCustomerNumber>302-15096.6</SuvaCustomerNumber>
+                        <SuvaSubNumber>01</SuvaSubNumber>
+                        <SalaryDeclarationIsComplete>true</SalaryDeclarationIsComplete>
+                    </Suva>
+                </UVG-LAA>
+                <UVGZ-LAAC InstitutionID="#Backwork">
+                    <InsuranceID>2345.88 1</InsuranceID>
+                    <InsuranceCompanyName>Backwork Versicherungen</InsuranceCompanyName>
+                    <CustomerIdentity>7651-873.1</CustomerIdentity>
+                    <ContractIdentity>4566-4</ContractIdentity>
+                    <SalaryDeclarationIsComplete>true</SalaryDeclarationIsComplete>
+                </UVGZ-LAAC>
+                <KTG-AMC InstitutionID="#Backwork">
+                    <InsuranceID>2345.88 1</InsuranceID>
+                    <InsuranceCompanyName>Backwork Versicherungen</InsuranceCompanyName>
+                    <CustomerIdentity>7651-873.1</CustomerIdentity>
+                    <ContractIdentity>4567-4</ContractIdentity>
+                    <SalaryDeclarationIsComplete>true</SalaryDeclarationIsComplete>
+                </KTG-AMC>
+                <BVG-LPP InstitutionID="#Oldsoft">
+                    <InsuranceID>2600.88 1</InsuranceID>
+                    <InsuranceCompanyName>Pensionskasse Oldsoft</InsuranceCompanyName>
+                    <CustomerIdentity>1099-8777.1</CustomerIdentity>
+                    <ContractIdentity>4500-0</ContractIdentity>
+                    <SalaryDeclarationIsComplete>true</SalaryDeclarationIsComplete>
+                </BVG-LPP>
+                <FAK-CAF InstitutionID="#005.000">
+                    <FAK-CAF-BranchNumber>005.000</FAK-CAF-BranchNumber>
+                    <FAK-CAF-CustomerNumber>100-9934.8</FAK-CAF-CustomerNumber>
+                    <SalaryDeclarationIsComplete>true</SalaryDeclarationIsComplete>
+                </FAK-CAF>
+            </Insurances>
+            <!-- ===================================== -->
+            <!-- SalaryTotals -->
+            <!-- ===================================== -->
+            <SalaryTotals>
+                <AHV-AVS-Totals>
+                    <Total-AHV-AVS-Incomes>65000.00</Total-AHV-AVS-Incomes>
+                    <Total-AHV-AVS-Open>0.00</Total-AHV-AVS-Open>
+                    <Total-ALV-AC-Incomes>65000.00</Total-ALV-AC-Incomes>
+                    <Total-ALVZ-ACS-Incomes>0.00</Total-ALVZ-ACS-Incomes>
+                    <Total-ALV-AC-Open>0.00</Total-ALV-AC-Open>
+                </AHV-AVS-Totals>
+                <UVG-LAA-Totals InstitutionIDRef="#Suva">
+                    <UVG-LAA-BranchTotals>
+                        <UVG-LAA-BranchTotal>
+                            <BranchIdentifier>A</BranchIdentifier>
+                            <NBU-BU-ANP-AP-Total>65000.00</NBU-BU-ANP-AP-Total>
+                            <BU-AP-Total>0.00</BU-AP-Total>
+                        </UVG-LAA-BranchTotal>
+                    </UVG-LAA-BranchTotals>
+                    <UVG-LAA-MasterTotal>65000.00</UVG-LAA-MasterTotal>
+                    <NumberOfFemalePersons>0</NumberOfFemalePersons>
+                    <NumberOfMalePersons>1</NumberOfMalePersons>
+                </UVG-LAA-Totals>
+                <UVGZ-LAAC-Totals InstitutionIDRef="#Backwork">
+                    <UVGZ-LAAC-CategoryTotals>
+                        <UVGZ-LAAC-CategoryTotal>
+                            <CategoryCode>01</CategoryCode>
+                            <Female-Total>0.00</Female-Total>
+                            <Male-Total>65000.00</Male-Total>
+                        </UVGZ-LAAC-CategoryTotal>
+                    </UVGZ-LAAC-CategoryTotals>
+                    <UVGZ-LAAC-MasterTotal>65000.00</UVGZ-LAAC-MasterTotal>
+                </UVGZ-LAAC-Totals>
+                <KTG-AMC-Totals InstitutionIDRef="#Backwork">
+                    <KTG-AMC-CategoryTotals>
+                        <KTG-AMC-CategoryTotal>
+                            <CategoryCode>02</CategoryCode>
+                            <Female-Total>0.00</Female-Total>
+                            <Male-Total>65000.00</Male-Total>
+                        </KTG-AMC-CategoryTotal>
+                    </KTG-AMC-CategoryTotals>
+                    <KTG-AMC-MasterTotal>65000.00</KTG-AMC-MasterTotal>
+                </KTG-AMC-Totals>
+                <FAK-CAF-FLG-LFA-Totals>
+                    <Total-FAK-CAF-IncomesPerCanton>
+                        <Total-FAK-CAF-Incomes>65000.00</Total-FAK-CAF-Incomes>
+                        <Canton>BE</Canton>
+                    </Total-FAK-CAF-IncomesPerCanton>
+                </FAK-CAF-FLG-LFA-Totals>
+            </SalaryTotals>
+            <SalaryCounters>
+                <NumberOf-AHV-AVS-Salary-Tags>1</NumberOf-AHV-AVS-Salary-Tags>
+                <NumberOf-UVG-LAA-Salary-Tags>1</NumberOf-UVG-LAA-Salary-Tags>
+                <NumberOf-UVGZ-LAAC-Salary-Tags>1</NumberOf-UVGZ-LAAC-Salary-Tags>
+                <NumberOf-KTG-AMC-Salary-Tags>1</NumberOf-KTG-AMC-Salary-Tags>
+                <NumberOf-BVG-LPP-Salary-Tags>1</NumberOf-BVG-LPP-Salary-Tags>
+                <NumberOf-FAK-CAF-Salary-Tags>1</NumberOf-FAK-CAF-Salary-Tags>
+                <NumberOf-TaxAnnuity-Tags>0</NumberOf-TaxAnnuity-Tags>
+                <NumberOf-TaxSalary-Tags>1</NumberOf-TaxSalary-Tags>
+                <NumberOf-StatisticSalaries-Tags>1</NumberOf-StatisticSalaries-Tags>
+            </SalaryCounters>
+            <Statistic>
+                <CompanyWorkingTime>
+                    <WeeklyHours>42.00</WeeklyHours>
+                </CompanyWorkingTime>
+                <PayAgreement>individualContract</PayAgreement>
+            </Statistic>
+        </Company>
+        <GeneralSalaryDeclarationDescription>
+            <CreationDate>2004-09-04T14:14:00</CreationDate>
+            <AccountingPeriod>2004</AccountingPeriod>
+            <ContactPerson>
+                <Name>Marcel René Müller</Name>
+                <EmailAddress>[email protected]</EmailAddress>
+                <PhoneNumber>031 345 23 87</PhoneNumber>
+            </ContactPerson>
+            <Comments>Bitte senden Sie eine Suva-Apotheke an hôtel-garçon in genève
+            </Comments>
+        </GeneralSalaryDeclarationDescription>
+    </ct:SalaryDeclaration>
+</DeclareSalary>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation4Schemas/CountryCode.xsd b/xml/tests/testData/xml/ComplexSchemaValidation4Schemas/CountryCode.xsd
new file mode 100644
index 0000000..318d308
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation4Schemas/CountryCode.xsd
@@ -0,0 +1,283 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- File: CountryCode.xsd  -->
+<!-- File Structure Version: 0.3 -->
+<!-- Code List Version: UN/CCCodes R02-1.0 Database Location:http://www.unece.org/cefact/download/downmain.htm#country  -->
+<!-- Copyright: www.UNeDocs.org United Nations ECE -->
+<!-- Copyright Note and disclaimers: http://www.unece.org/etrades/uncopyright.htm -->
+<!-- Comment: This file contains  ISO 3166-1 ISO 2 digit country codes and names, UN Recommendation 3 -->
+<!-- Author: [email protected] -->
+
+<schema
+	targetNamespace="http://www.unece.org/etrades/unedocs/repository/codelists/xml/CountryCode.xsd"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns="http://www.w3.org/2001/XMLSchema"
+	xmlns:un.ece.unedocs.cl.iso3166="http://www.unece.org/etrades/unedocs/repository/codelists/xml/CountryCode.xsd"
+	elementFormDefault="unqualified"
+	attributeFormDefault="unqualified">
+	<complexType name="CountryCodeType"><!-- based on UBL Naming Convention TBA -->
+ 		<annotation>
+ 		 <documentation>
+			CountryCodeType - Type declaration to be used by other schema's
+		 </documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="un.ece.unedocs.cl.iso3166:CountryCoded">
+				<attributeGroup ref="un.ece.unedocs.cl.iso3166:Identity"/>
+			</extension>
+		</simpleContent>
+	</complexType>
+	<simpleType name="CountryCoded"><!-- based on UNeDocs Naming Convention -->
+		<restriction base="xs:token">
+		  <enumeration value="AF" /> 
+		  <enumeration value="AL" /> 
+		  <enumeration value="DZ" /> 
+		  <enumeration value="AS" /> 
+		  <enumeration value="AD" /> 
+		  <enumeration value="AO" /> 
+		  <enumeration value="AI" /> 
+		  <enumeration value="AQ" /> 
+		  <enumeration value="AG" /> 
+		  <enumeration value="AR" /> 
+		  <enumeration value="AM" /> 
+		  <enumeration value="AW" /> 
+		  <enumeration value="AU" /> 
+		  <enumeration value="AT" /> 
+		  <enumeration value="AZ" /> 
+		  <enumeration value="BS" /> 
+		  <enumeration value="BH" /> 
+		  <enumeration value="BD" /> 
+		  <enumeration value="BB" /> 
+		  <enumeration value="BY" /> 
+		  <enumeration value="BE" /> 
+		  <enumeration value="BZ" /> 
+		  <enumeration value="BJ" /> 
+		  <enumeration value="BM" /> 
+		  <enumeration value="BT" /> 
+		  <enumeration value="BO" /> 
+		  <enumeration value="BA" /> 
+		  <enumeration value="BW" /> 
+		  <enumeration value="BV" /> 
+		  <enumeration value="BR" /> 
+		  <enumeration value="IO" /> 
+		  <enumeration value="BN" /> 
+		  <enumeration value="BG" /> 
+		  <enumeration value="BF" /> 
+		  <enumeration value="BI" /> 
+		  <enumeration value="KH" /> 
+		  <enumeration value="CM" /> 
+		  <enumeration value="CA" /> 
+		  <enumeration value="CV" /> 
+		  <enumeration value="KY" /> 
+		  <enumeration value="CF" /> 
+		  <enumeration value="TD" /> 
+		  <enumeration value="CL" /> 
+		  <enumeration value="CN" /> 
+		  <enumeration value="CX" /> 
+		  <enumeration value="CC" /> 
+		  <enumeration value="CO" /> 
+		  <enumeration value="KM" /> 
+		  <enumeration value="CG" /> 
+		  <enumeration value="CD" /> 
+		  <enumeration value="CK" /> 
+		  <enumeration value="CR" /> 
+		  <enumeration value="CI" /> 
+		  <enumeration value="HR" /> 
+		  <enumeration value="CU" /> 
+		  <enumeration value="CY" /> 
+		  <enumeration value="CZ" /> 
+		  <enumeration value="DK" /> 
+		  <enumeration value="DJ" /> 
+		  <enumeration value="DM" /> 
+		  <enumeration value="DO" /> 
+		  <enumeration value="TP" /> 
+		  <enumeration value="EC" /> 
+		  <enumeration value="EG" /> 
+		  <enumeration value="SV" /> 
+		  <enumeration value="GQ" /> 
+		  <enumeration value="ER" /> 
+		  <enumeration value="EE" /> 
+		  <enumeration value="ET" /> 
+		  <enumeration value="FK" /> 
+		  <enumeration value="FO" /> 
+		  <enumeration value="FJ" /> 
+		  <enumeration value="FI" /> 
+		  <enumeration value="FR" /> 
+		  <enumeration value="GF" /> 
+		  <enumeration value="PF" /> 
+		  <enumeration value="TF" /> 
+		  <enumeration value="GA" /> 
+		  <enumeration value="GM" /> 
+		  <enumeration value="GE" /> 
+		  <enumeration value="DE" /> 
+		  <enumeration value="GH" /> 
+		  <enumeration value="GI" /> 
+		  <enumeration value="GR" /> 
+		  <enumeration value="GL" /> 
+		  <enumeration value="GD" /> 
+		  <enumeration value="GP" /> 
+		  <enumeration value="GU" /> 
+		  <enumeration value="GT" /> 
+		  <enumeration value="GN" /> 
+		  <enumeration value="GW" /> 
+		  <enumeration value="GY" /> 
+		  <enumeration value="HT" /> 
+		  <enumeration value="HM" /> 
+		  <enumeration value="VA" /> 
+		  <enumeration value="HN" /> 
+		  <enumeration value="HK" /> 
+		  <enumeration value="HU" /> 
+		  <enumeration value="IS" /> 
+		  <enumeration value="IN" /> 
+		  <enumeration value="ID" /> 
+		  <enumeration value="IR" /> 
+		  <enumeration value="IQ" /> 
+		  <enumeration value="IE" /> 
+		  <enumeration value="IL" /> 
+		  <enumeration value="IT" /> 
+		  <enumeration value="JM" /> 
+		  <enumeration value="JP" /> 
+		  <enumeration value="JO" /> 
+		  <enumeration value="KZ" /> 
+		  <enumeration value="KE" /> 
+		  <enumeration value="KI" /> 
+		  <enumeration value="KP" /> 
+		  <enumeration value="KR" /> 
+		  <enumeration value="KW" /> 
+		  <enumeration value="KG" /> 
+		  <enumeration value="LA" /> 
+		  <enumeration value="LV" /> 
+		  <enumeration value="LB" /> 
+		  <enumeration value="LS" /> 
+		  <enumeration value="LR" /> 
+		  <enumeration value="LY" /> 
+		  <enumeration value="LI" /> 
+		  <enumeration value="LT" /> 
+		  <enumeration value="LU" /> 
+		  <enumeration value="MO" /> 
+		  <enumeration value="MK" /> 
+		  <enumeration value="MG" /> 
+		  <enumeration value="MW" /> 
+		  <enumeration value="MY" /> 
+		  <enumeration value="MV" /> 
+		  <enumeration value="ML" /> 
+		  <enumeration value="MT" /> 
+		  <enumeration value="MH" /> 
+		  <enumeration value="MQ" /> 
+		  <enumeration value="MR" /> 
+		  <enumeration value="MU" /> 
+		  <enumeration value="YT" /> 
+		  <enumeration value="MX" /> 
+		  <enumeration value="FM" /> 
+		  <enumeration value="MD" /> 
+		  <enumeration value="MC" /> 
+		  <enumeration value="MN" /> 
+		  <enumeration value="MS" /> 
+		  <enumeration value="MA" /> 
+		  <enumeration value="MZ" /> 
+		  <enumeration value="MM" /> 
+		  <enumeration value="NA" /> 
+		  <enumeration value="NR" /> 
+		  <enumeration value="NP" /> 
+		  <enumeration value="NL" /> 
+		  <enumeration value="AN" /> 
+		  <enumeration value="NC" /> 
+		  <enumeration value="NZ" /> 
+		  <enumeration value="NI" /> 
+		  <enumeration value="NE" /> 
+		  <enumeration value="NG" /> 
+		  <enumeration value="NU" /> 
+		  <enumeration value="NF" /> 
+		  <enumeration value="MP" /> 
+		  <enumeration value="NO" /> 
+		  <enumeration value="OM" /> 
+		  <enumeration value="PK" /> 
+		  <enumeration value="PW" /> 
+		  <enumeration value="PS" /> 
+		  <enumeration value="PA" /> 
+		  <enumeration value="PG" /> 
+		  <enumeration value="PY" /> 
+		  <enumeration value="PE" /> 
+		  <enumeration value="PH" /> 
+		  <enumeration value="PN" /> 
+		  <enumeration value="PL" /> 
+		  <enumeration value="PT" /> 
+		  <enumeration value="PR" /> 
+		  <enumeration value="QA" /> 
+		  <enumeration value="RE" /> 
+		  <enumeration value="RO" /> 
+		  <enumeration value="RU" /> 
+		  <enumeration value="RW" /> 
+		  <enumeration value="SH" /> 
+		  <enumeration value="KN" /> 
+		  <enumeration value="LC" /> 
+		  <enumeration value="PM" /> 
+		  <enumeration value="VC" /> 
+		  <enumeration value="WS" /> 
+		  <enumeration value="SM" /> 
+		  <enumeration value="ST" /> 
+		  <enumeration value="SA" /> 
+		  <enumeration value="SN" /> 
+		  <enumeration value="SC" /> 
+		  <enumeration value="SL" /> 
+		  <enumeration value="SG" /> 
+		  <enumeration value="SK" /> 
+		  <enumeration value="SI" /> 
+		  <enumeration value="SB" /> 
+		  <enumeration value="SO" /> 
+		  <enumeration value="ZA" /> 
+		  <enumeration value="GS" /> 
+		  <enumeration value="ES" /> 
+		  <enumeration value="LK" /> 
+		  <enumeration value="SD" /> 
+		  <enumeration value="SR" /> 
+		  <enumeration value="SJ" /> 
+		  <enumeration value="SZ" /> 
+		  <enumeration value="SE" /> 
+		  <enumeration value="CH" /> 
+		  <enumeration value="SY" /> 
+		  <enumeration value="TW" /> 
+		  <enumeration value="TJ" /> 
+		  <enumeration value="TZ" /> 
+		  <enumeration value="TH" /> 
+		  <enumeration value="TG" /> 
+		  <enumeration value="TK" /> 
+		  <enumeration value="TO" /> 
+		  <enumeration value="TT" /> 
+		  <enumeration value="TN" /> 
+		  <enumeration value="TR" /> 
+		  <enumeration value="TM" /> 
+		  <enumeration value="TC" /> 
+		  <enumeration value="TV" /> 
+		  <enumeration value="UG" /> 
+		  <enumeration value="UA" /> 
+		  <enumeration value="AE" /> 
+		  <enumeration value="GB" /> 
+		  <enumeration value="US" /> 
+		  <enumeration value="UM" /> 
+		  <enumeration value="UY" /> 
+		  <enumeration value="UZ" /> 
+		  <enumeration value="VU" /> 
+		  <enumeration value="VE" /> 
+		  <enumeration value="VN" /> 
+		  <enumeration value="VG" /> 
+		  <enumeration value="VI" /> 
+		  <enumeration value="WF" /> 
+		  <enumeration value="EH" /> 
+		  <enumeration value="YE" /> 
+		  <enumeration value="YU" /> 
+		  <enumeration value="ZM" /> 
+		  <enumeration value="ZW" /> 
+		</restriction>
+	</simpleType>
+	<attributeGroup name="Identity">
+		<attribute name="ID" type="xs:token" fixed="ISO 3166" >
+		<annotation><documentation>Code List Identifier - ISO 3166</documentation></annotation>
+		</attribute>
+		<attribute name="agencyID" type="xs:token" fixed="6">
+		<annotation><documentation>Code List Agency UN/ECE</documentation></annotation>
+		</attribute>
+		<attribute name="versionID" type="xs:string" fixed="0.3">
+		<annotation><documentation>Code List Version - 0.3</documentation></annotation>
+		</attribute>
+	</attributeGroup>
+</schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation4Schemas/SalaryDeclaration.xsd b/xml/tests/testData/xml/ComplexSchemaValidation4Schemas/SalaryDeclaration.xsd
new file mode 100644
index 0000000..15e63ee
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation4Schemas/SalaryDeclaration.xsd
@@ -0,0 +1,4143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema
+        targetNamespace="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclaration"
+        xmlns:tns="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclaration"
+        xmlns:xs="http://www.w3.org/2001/XMLSchema"
+        xmlns:un.ece.unedocs.cl.iso3166="http://www.unece.org/etrades/unedocs/repository/codelists/xml/CountryCode.xsd"
+        elementFormDefault="qualified"
+        attributeFormDefault="unqualified"
+        version="0.0">
+
+    <!-- state of standardisation: draft20050404 (AHV, UVG, Stv und BfS) -->
+    <!-- last modified $Date: 2005/09/15 15:36:10 $Author: boehm $ -->
+
+
+    <!--
+    Status 2005.09.15
+        -   fuer alle domaenen IO (AHV, UVG, UVGZ, KTG, BVG, FAK, Tax und Statistic)
+    -->
+
+    <!-- imports -->
+    <xs:import
+            namespace="http://www.unece.org/etrades/unedocs/repository/codelists/xml/CountryCode.xsd"
+            schemaLocation="CountryCode.xsd"/>
+
+    <!-- elements -->
+    <xs:complexType name="SalaryDeclarationType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Lohnmeldung</translation>
+                <description>
+                    <short>
+                        Die Lohnmeldung enthält sämtliche Daten für eine Deklaration einer Unternehmung.
+                        (ELM = einheitliches Lohnmeldeverfahren / Fachinhalt)
+                    </short>
+                    <domain>
+                        Die Lohmeldung enthält sämtliche Informationen und Löhne in folgenden Domänen
+                        1) AHV/ALV
+                        2) UVG
+                        3) UVGZ
+                        4) KTG
+                        5) BVG
+                        6) FAK
+                        7) Tax, Lohnausweis für die Steuerverwaltungen
+                        8) Statistic, Lohnstrukturerhebung (LSE) für das BfS
+                        In den Domänen 2)UVG bis 6)FAK können einzelne Institutionen wie z.B. Suva mit Attributen
+                        verknüpft werden
+                    </domain>
+                    <technical>
+                        In derLohnmeldung können nur noch die Daten eines Unternehmens abgebildet werden.
+                        Ein Unternehmen kann in mehrere "Lohnbereiche" bzw. Mandanten aufgeteilt sein. In diesem Fall
+                        muss pro Lohnbereich eine seperate Meldung erzeugt und übermittelt werden. Die Aufteilung
+                        muss mit den entsprechenden Empfängern (Institutionen) abgesprochen sein, d.h.
+                        organisatorische Lösung mit seperaten Kundennummern pro Mandant und für alle Domänen
+                        muss die gleiche Aufteilung gelten.
+                        Die Verknüpfung von einer oder mehreren Institutionen innerhalb der Domänen 2)UVG bis 6)FAK
+                        muss mittels Attribute "verlinkt" werden:
+                        SalaryDeclarationContainer Job/Addressee und JobState
+                        SalaryDeclaration Person/Salaries/Salary, SalaryTotals und Insurances/[Domäne]
+                    </technical>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="Company" type="tns:CompanyType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Unternehmen</translation>
+                        <description>
+                            <short>
+                                Das Unternehmen (Firma, Betrieb) welches die Daten erstellt.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+                <xs:key name="UVG-LAA-ID-Key">
+                    <xs:selector xpath="tns:Insurances/tns:UVG-LAA/tns:Suva|tns:Insurances/tns:UVG-LAA/tns:Other"/>
+                    <xs:field xpath="@InstitutionID"/>
+                </xs:key>
+                <xs:keyref name="UVG-LAA-ID-Ref" refer="tns:UVG-LAA-ID-Key">
+                    <xs:selector
+                            xpath="tns:Staff/tns:Person/tns:UVG-LAA-Salaries/tns:UVG-LAA-Salary|tns:SalaryTotals/tns:UVG-LAA-Totals"/>
+                    <xs:field xpath="@InstitutionIDRef"/>
+                </xs:keyref>
+                <xs:key name="UVGZ-LAAC-ID-Key">
+                    <xs:selector xpath="tns:Insurances/tns:UVGZ-LAAC"/>
+                    <xs:field xpath="@InstitutionID"/>
+                </xs:key>
+                <xs:keyref name="UVGZ-LAAC-ID-Ref" refer="tns:UVGZ-LAAC-ID-Key">
+                    <xs:selector
+                            xpath="tns:Staff/tns:Person/tns:UVGZ-LAAC-Salaries/tns:UVGZ-LAAC-Salary|tns:SalaryTotals/tns:UVGZ-LAAC-Totals"/>
+                    <xs:field xpath="@InstitutionIDRef"/>
+                </xs:keyref>
+                <xs:key name="KTG-AMC-ID-Key">
+                    <xs:selector xpath="tns:Insurances/tns:KTG-AMC"/>
+                    <xs:field xpath="@InstitutionID"/>
+                </xs:key>
+                <xs:keyref name="KTG-AMC-ID-Ref" refer="tns:KTG-AMC-ID-Key">
+                    <xs:selector
+                            xpath="tns:Staff/tns:Person/tns:KTG-AMC-Salaries/tns:KTG-AMC-Salary|tns:SalaryTotals/tns:KTG-AMC-Totals"/>
+                    <xs:field xpath="@InstitutionIDRef"/>
+                </xs:keyref>
+                <xs:key name="BVG-LPP-ID-Key">
+                    <xs:selector xpath="tns:Insurances/tns:BVG-LPP"/>
+                    <xs:field xpath="@InstitutionID"/>
+                </xs:key>
+                <xs:keyref name="BVG-LPP-ID-Ref" refer="tns:BVG-LPP-ID-Key">
+                    <xs:selector
+                            xpath="tns:Staff/tns:Person/tns:BVG-LPP-Salaries/tns:BVG-LPP-Salary|tns:SalaryTotals/tns:BVG-LPP-Totals"/>
+                    <xs:field xpath="@InstitutionIDRef"/>
+                </xs:keyref>
+            </xs:element>
+            <xs:element name="GeneralSalaryDeclarationDescription" type="tns:GeneralSalaryDeclarationDescriptionType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Allgemeine Beschreibung der Meldung</translation>
+                        <description>
+                            <short>
+                                Hier befinden sich Informationen, welche bei der Erstellung der Meldung durch den
+                                Ersteller bzw. Absender ergänzt werden.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="schemaVersion" type="tns:SupportedMinorSchemaVersionAttributeType" use="required">
+            <xs:annotation>
+                <xs:documentation xml:lang="de">
+                    <translation>Schemaversion</translation>
+                    <description>
+                        <short>
+                            Die XML Schema Instanz muss mit dem "schemaVersion" Attribut angeben mit welcher
+                            Schemaversion sie konform ist.
+                        </short>
+                    </description>
+                </xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <!-- attribute-character from SalaryDeclarationType  -->
+    <xs:complexType name="ContactPersonType">
+        <xs:sequence>
+            <xs:element name="Name" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Name</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="EmailAddress" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>EmailAdresse</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="PhoneNumber" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Telefonnummer</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="GeneralSalaryDeclarationDescriptionType">
+        <xs:sequence>
+            <xs:element name="CreationDate" type="xs:dateTime">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Erstellungsdatum</translation>
+                        <description>
+                            <short>
+                                Datum und Zeit, der Meldungserstellung bei dem Unternehmen.
+                            </short>
+                            <domain>
+                                Dieses Datum kann für die Berechnung von Verzugszinsen NICHT verwendet werden.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="AccountingPeriod" type="xs:gYear">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Abrechnungsperiode</translation>
+                        <description>
+                            <short>
+                                Abrechnungsperiode der Meldung
+                            </short>
+                            <domain>
+                                Die Abrechnungsperiode umfasst das Kalenderjahr für welches die Beiträge oder Prämien
+                                aufgrund der Lohnmeldung ermittelt werden sollen.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ContactPerson" type="tns:ContactPersonType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Kontaktperson</translation>
+                        <description>
+                            <short>
+                                Kontaktperson für Rückfragen zur Meldung
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Comments" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Bemerkungen</translation>
+                        <description>
+                            <short>
+                                Bemerkungen von der Kontaktperson zur Meldung
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <!--
+
+        kernel: Company
+    -->
+    <xs:complexType name="CompanyType">
+        <xs:sequence>
+            <xs:element name="CompanyDescription" type="tns:CompanyDescriptionType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Unternehmensbeschreibung</translation>
+                        <description>
+                            <short>
+                                Diverse Angaben zum Unternehmen
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Staff" type="tns:PersonsType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Beschäftigte</translation>
+                        <description>
+                            <short>
+                                Beschäftigte (Mitarbeiter) des Unternehmens
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Insurances" type="tns:CustomerIdentificationType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Versicherungen</translation>
+                        <description>
+                            <short>
+                                Enthält alle Beziehungen zu den Versicherungen des Unternehmens, an welche
+                                die Meldung gerichtet ist
+                            </short>
+                            <domain>
+                                Das Element "Versicherungen" beinhaltet die Beziehung des Unternehmens
+                                zu allen Versicherungen an welche die Lohnmeldung gerichtet ist.
+                                Dabei werden folgende Domänen beschrieben:
+                                1) AHV/ALV
+                                2) UVG
+                                3) UVGZ
+                                4) KTG
+                                5) BVG
+                                6) FAK
+                                In den Domänen 2)UVG bis 6)FAK können einzelne Institutionen wie z.B. Suva mit
+                                Attributen
+                                verknüpft werden
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="SalaryTotals" type="tns:SalaryTotalsType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Lohnmeldungstotale</translation>
+                        <description>
+                            <short>
+                                Diese Betrags-Totale sind redundant und können jederzeit aus den Einzeldaten gerechnet
+                                werden.
+                                Dabei werden folgende Domänen beschrieben:
+                                1) AHV/ALV
+                                2) UVG
+                                3) UVGZ
+                                4) KTG
+                                5) BVG
+                                6) FAK
+                                In den Domänen 2)UVG bis 6)FAK können einzelne Institutionen wie z.B. Suva mit
+                                Attributen
+                                verknüpft werden
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+                <xs:unique name="UVG-LAA-Totals-Ctrl">
+                    <xs:selector xpath="tns:UVG-LAA-Totals"/>
+                    <xs:field xpath="@IDRef"/>
+                </xs:unique>
+            </xs:element>
+            <xs:element name="SalaryCounters" type="tns:SalaryCountersType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>LohnZähler</translation>
+                        <description>
+                            <short>
+                                Diese LohnZähler enthalten die Anzahl der Tags von Löhnen/Zulagen pro Domäne.
+                            </short>
+                            <domain>
+                                Diese LohnZähler enthalten die Anzahl der Tags von Löhnen/Zulagen.
+                                Dabei werden für die folgenden Domänen die Tags gezählt:
+                                1) AHV/ALV
+                                2) UVG
+                                3) UVGZ
+                                4) KTG
+                                5) BVG
+                                6) FAK
+                                Die Attribute der Institutionen werden dabei nicht berücksichtigt.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Statistic" type="tns:StatisticType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Unternehmensweite Statistikangaben</translation>
+                        <description>
+                            <short>
+                                Unternehmensweite Statistikangaben
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="CompanyDescriptionType">
+        <xs:sequence>
+            <xs:element name="Name" type="tns:CompanyNameType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Name</translation>
+                        <description>
+                            <short>
+                                Name des Unternehmens
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Owner" type="tns:CompanyOwnerType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Inhaber</translation>
+                        <description>
+                            <short>
+                                Inhaber des Unternehmens
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Address" type="tns:AddressType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Adresse</translation>
+                        <description>
+                            <short>
+                                Vollständige und exakte Anschrift des Geschäftsdomizils.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UID-EHRA" type="tns:UID-EHRAType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Unternehmensidentifikation</translation>
+                        <description>
+                            <short>
+                                Unternehmensidentifikation nach Eidgenössischem Amt für das Handelsregister (EHRA)
+                            </short>
+                            <domain>
+                                Schweizweite eindeutige Unternehmensnummer nach Eidgenössischem Amt für das
+                                Handelsregister (EHRA)
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="BUR-REE-Number" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>BUR-Nummer</translation>
+                        <description>
+                            <short>
+                                Betriebs- und Unternehmensregisternummer der Unternehmen
+                            </short>
+                            <domain>
+                                Betriebs- und Unternehmensregisternummer des Bundes. Kann bei der Verarbeitung
+                                von CO2-Abgaben etc. durch Ausgleichskassen wichtig werden.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+
+    <!-- attribute-character: CompanyType  -->
+    <xs:complexType name="CompanyOwnerType">
+        <xs:sequence>
+            <xs:element name="Firstname" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Vorname</translation>
+                        <description>
+                            <short>
+                                Vorname des Inhabers
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Lastname" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Nachname</translation>
+                        <description>
+                            <short>
+                                Nachname des Inhabers
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="CompanyNameType">
+        <xs:sequence>
+            <xs:element name="HR-RC-Name" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Name im Handelsregister</translation>
+                        <description>
+                            <short>
+                                Im Handelsregister eingetragener Name des Unternehmens
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ComplementaryLine" type="xs:string" minOccurs="0" maxOccurs="2">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Zusatzzeile</translation>
+                        <description>
+                            <short>
+                                Zusatzzeilen für Abteilungsnamen, Filialbezeichnungen usw.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <!-- statistic -->
+    <xs:complexType name="StatisticType">
+        <xs:sequence>
+            <xs:element name="CompanyWorkingTime" type="tns:CompanyWorkingTimeType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Arbeitszeit</translation>
+                        <description>
+                            <short>
+                                Betriebsübliche wöchentliche Arbeitszeit
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="PayAgreement" type="tns:PayAgreementType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Lohnvereinbarung</translation>
+                        <description>
+                            <short>
+                                Lohnvereinbarung im Unternehmen
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="CompanyWorkingTimeType">
+        <xs:choice>
+            <xs:element name="WeeklyHours" type="tns:WeeklyHoursType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Wöchentliche Arbeitszeit</translation>
+                        <description>
+                            <short>Betriebsübliche wöchentliche Arbeitszeit</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="WeeklyLessons" type="tns:WeeklyLessonsType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Wöchentliche Arbeitslektionen</translation>
+                        <description>
+                            <short>Betriebsübliche wöchentliche Arbeitslektioenen</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="WeeklyHoursAndLessons" type="tns:WeeklyHoursAndLessonsType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Wöchentliche Arbeits Stunden/Lektionen</translation>
+                        <description>
+                            <short>Betriebsübliche wöchentliche Arbeitslektioenen</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:choice>
+    </xs:complexType>
+    <xs:complexType name="WeeklyHoursAndLessonsType">
+        <xs:sequence>
+            <xs:element name="WeeklyHours" type="tns:WeeklyHoursType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Wöchentliche Arbeitszeit</translation>
+                        <description>
+                            <short>Betriebsübliche wöchentliche Arbeitszeit</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="WeeklyLessons" type="tns:WeeklyLessonsType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Wöchentliche Arbeitslektionen</translation>
+                        <description>
+                            <short>Betriebsübliche wöchentliche Arbeitslektioenen</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <!--
+
+        kernel: Person
+    -->
+    <xs:complexType name="PersonsType">
+        <xs:sequence>
+            <xs:element name="Person" type="tns:PersonType" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Person</translation>
+                        <description>
+                            <short>
+                                Die versicherten Personen, welche im Unternehmen beschäftigt werden.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="PersonType">
+        <xs:sequence>
+            <xs:element name="Particulars" type="tns:ParticularsType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Personalien</translation>
+                        <description>
+                            <short>
+                                Personalien der Person
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Work" type="tns:WorkType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Arbeitsdaten</translation>
+                        <description>
+                            <short>
+                                Arbeitsplatz Informationen
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="AHV-AVS-Salaries" type="tns:AHV-AVS-SalariesType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>AHV-Löhne</translation>
+                        <description>
+                            <short>AHV-Löhne der Person</short>
+                            <domain>
+                                Bei mehreren Beitragsdauern während eines Jahres, sind die dazugehörenden Einkommen
+                                aufzuschlüsseln.
+                                Für Versicherte, die während der Abrechnungsperiode das Rentenalter erreichen und
+                                weiterarbeiten, ist das Einkommen vor und nach dem Erreichen des Rentenalters auf die
+                                entsprechende Beitragsdauer zuzuordnen.
+                                Periodenfremde Einkommen:
+                                Bei Einkommen, welche für eine Vorjahresperiode bestimmt sind, ist die Beitragsdauer
+                                der Bestimmungsperiode anzugeben
+                                z.B. Nachzahlung Bonus oder Versicherungsleistungen für eine Person, welche im
+                                Vorjahr ausgetreten ist (kein aktiver Mitarbeiter im Meldungsjahr)
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVG-LAA-Salaries" type="tns:UVG-LAA-SalariesType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVG-Löhne</translation>
+                        <description>
+                            <short>UVG-Löhne der Person</short>
+                            <domain>
+                                Beitragspflichtiger Lohn, der aufgrund der UVG-Basis für die versicherten Personen unter
+                                der Berücksichtigung des Höchstlohnes berechnet wird. Bei mehreren Beitragsdauern
+                                (Einritt/Austritt oder UVG-Code-Wechsel) während eines Jahres, sind die dazugehörenden
+                                Einkommen aufzuschlüsseln
+                                Periodenfremde Einkommen:
+                                Bei Einkommen, welche für eine Vorjahresperiode bestimmt sind, ist die Beitragsdauer
+                                der Bestimmungsperiode anzugeben
+                                z.B. Nachzahlung Bonus oder Versicherungsleistungen für eine Person, welche im
+                                Vorjahr ausgetreten ist (kein aktiver Mitarbeiter im Meldungsjahr)
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVGZ-LAAC-Salaries" type="tns:UVGZ-LAAC-SalariesType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVGZ-Löhne</translation>
+                        <description>
+                            <short>UVGZ-Löhne der Person</short>
+                            <domain>
+                                Beitragspflichtiger Lohn, der aufgrund der UVGZ-Basis für die versicherten Personen
+                                unter der Berücksichtigung der Versicherungskategorie berechnet wird. Bei mehreren
+                                Beitragsdauern (Einritt/Austritt oder UVGZ-Kategorie-Code-Wechsel) während eines Jahres,
+                                sind die dazugehörenden Einkommen aufzuschlüsseln.
+                                Periodenfremde Einkommen:
+                                Bei Einkommen, welche für eine Vorjahresperiode bestimmt sind, ist die Beitragsdauer
+                                der Bestimmungsperiode anzugeben
+                                z.B. Nachzahlung Bonus oder Versicherungsleistungen für eine Person, welche im
+                                Vorjahr ausgetreten ist (kein aktiver Mitarbeiter im Meldungsjahr)
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="KTG-AMC-Salaries" type="tns:KTG-AMC-SalariesType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>KTG-Löhne</translation>
+                        <description>
+                            <short>KTG-Löhne der Person</short>
+                            <domain>
+                                Beitragspflichtiger Lohn, der aufgrund der KTG-Basis für die versicherten Personen unter
+                                der Berücksichtigung der Versicherungskategorie berechnet wird. Bei mehreren
+                                Beitragsdauern
+                                (Einritt/Austritt oder KTG-Kategorie-Code-Wechsel) während eines Jahres, sind die
+                                dazugehörenden Einkommen aufzuschlüsseln
+                                Periodenfremde Einkommen:
+                                Bei Einkommen, welche für eine Vorjahresperiode bestimmt sind, ist die Beitragsdauer
+                                der Bestimmungsperiode anzugeben
+                                z.B. Nachzahlung Bonus oder Versicherungsleistungen für eine Person, welche im
+                                Vorjahr ausgetreten ist (kein aktiver Mitarbeiter im Meldungsjahr)
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="BVG-LPP-Salaries" type="tns:BVG-LPP-SalariesType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>BVG-Löhne</translation>
+                        <description>
+                            <short>BVG-Löhne der Person</short>
+                            <domain>
+                                Beitragspflichtiger Lohn, der aufgrund des AHV-Lohnes für die versicherten Personen
+                                unter der Berücksichtigung der Versicherungskategorie berechnet wird. Bei mehreren
+                                Beitragsdauern
+                                (Einritt/Austritt oder BVG-Kategorie-Code-Wechsel) während eines Jahres, sind die
+                                dazugehörenden Einkommen aufzuschlüsseln
+                                Periodenfremde Einkommen:
+                                Bei Einkommen, welche für eine Vorjahresperiode bestimmt sind, ist die Beitragsdauer
+                                der Bestimmungsperiode anzugeben
+                                z.B. Nachzahlung Bonus oder Versicherungsleistungen für eine Person, welche im
+                                Vorjahr ausgetreten ist (kein aktiver Mitarbeiter im Meldungsjahr)
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+
+            <xs:element name="FAK-CAF-Salaries" type="tns:FAK-CAF-SalariesType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>FAK-Löhne</translation>
+                        <description>
+                            <short>FAK-Löhne der Person</short>
+                            <domain>
+                                Es sind alle FAK-relevanten Summen pro Versicherten auszuweisen.
+                                Periodenfremde Einkommen:
+                                Bei Einkommen, welche für eine Vorjahresperiode bestimmt sind, ist die Beitragsdauer
+                                der Bestimmungsperiode anzugeben
+                                z.B. Nachzahlung Bonus oder Versicherungsleistungen für eine Person, welche im
+                                Vorjahr ausgetreten ist (kein aktiver Mitarbeiter im Meldungsjahr)
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="TaxSalaries" type="tns:TaxSalariesType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Steuer-Löhne</translation>
+                        <description>
+                            <short>Steuer-Löhne der Person</short>
+                            <domain>
+                                Informatioinen und Löhne gemäss Lohnausweis der Steuerverwaltungen
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="StatisticSalaries" type="tns:StatisticSalariesType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Statistik Lohndaten</translation>
+                        <description>
+                            <short>LSE Informationen und Lohndaten</short>
+                            <domain>
+                                Informationen und Lohndaten für die Lohnstrukturerhebung (LSE) des BfS
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ParticularsType">
+        <xs:sequence>
+            <xs:element name="Social-InsuranceIdentification" type="tns:Social-InsuranceIdentificationType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Sozialversicherungsidentifikation</translation>
+                        <description>
+                            <short>
+                                Von der Sozialversicherung zugeteilte Soziallversicherungsidentifikation (eindeutige
+                                Indentifikation von Versicherten).
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="EmployeeNumber" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Personalnummer</translation>
+                        <description>
+                            <short>
+                                Personalnummer der Person (frei nach den Bedürfnissen des Unternehmens)
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Lastname" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Nachname</translation>
+                        <description>
+                            <short>
+                                Vollständiger Familienname der Person
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Firstname" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Vorname</translation>
+                        <description>
+                            <short>
+                                Vorname(n) der Person
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Sex" type="tns:SexType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Geschlecht</translation>
+                        <description>
+                            <short>
+                                Geschlecht der Person
+                            </short>
+                            <domain>
+                                Die Unterscheidung zwischen männlichen und weiblichen Mitarbeitern ist notwendig, weil
+                                das
+                                unterschiedliche AHV-Rentenalter Einfluss auf die Berechnung des AHV-Freibetrages hat.
+                                Ausserdem werden vom Arbeitgeber statistische Angaben über die Anzahl Männer und Frauen
+                                verlangt.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="DateOfBirth" type="xs:date">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Geburtsdatum</translation>
+                        <description>
+                            <short>
+                                Geburtsdatum der Person
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <!-- todo -->
+            <xs:element name="Nationality" type="tns:NationalityType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Nationalität</translation>
+                        <description>
+                            <short>
+                                Nationalität 2-stellig nach ISO 3166 Erweitert
+                            </short>
+                            <technical>
+                                Erweiterung
+                                11= unbekannt
+                                22= staatenlos
+                                In der Qualitätsstufe Plausibilität wird gegen die ISO 31666 Codes geprüft und
+                                evtl. eine Warninig angezeigt
+                                http://www.unece.org/etrades/unedocs/repository/codelists/xml/CountryCode.xsd
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="CivilStatus" type="tns:CivilStatusType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Zivilstand</translation>
+                        <description>
+                            <short>
+                                Zivilstand der Person
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="SingleParent" type="tns:SimpleBooleanType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Alleinerziehend</translation>
+                        <description>
+                            <short>
+                                Bezeichnung von alleinerziehenden Versicherten
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Address" type="tns:AddressType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Adresse</translation>
+                        <description>
+                            <short>
+                                Vollständige und exakte Anschrift der Person.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ResidenceCanton" type="tns:CantonType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Wohnkanton</translation>
+                        <description>
+                            <short>Wohnkanton</short>
+                            <domain>
+                                Wohnkanton am Stichtag 31.12 oder beim Austritt. Dieser ist massgebend
+                                für den Lohnausweis.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ResidenceCategory" type="tns:ResidenceCategoryType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Aufenthaltskategorien</translation>
+                        <description>
+                            <short>Aufenthaltskategorien</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="DegreeOfRelationship" type="tns:DegreeOfRelationshipType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Verwandtschaftsgrad</translation>
+                        <description>
+                            <short>Verwandtschaftsgrad zum Inhaber</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="WorkType">
+        <xs:sequence>
+            <xs:element name="WorkingTime" type="tns:WorkingTimeType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Arbeitszeit</translation>
+                        <description>
+                            <short>Individuelle Arbeitszeit</short>
+                            <domain>
+                                Individuell vereinbarte wöchentliche Arbeitszeit
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ActivityRate" type="tns:ActivityRateType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Beschäftigungsgrad</translation>
+                        <description>
+                            <short>Beschäftigungsgrad in Prozent</short>
+                            <domain>
+                                Bezeichnung des Beschäftigungsgrades pro Beitragsdauer in Prozent bei regelmässiger
+                                (Teilzeit) Arbeit (von 1 bis 100 Prozent).
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="YearsOfService" type="tns:YearsOfServiceType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Dienstjahre</translation>
+                        <description>
+                            <short>Dienstjahre</short>
+                            <domain>
+                                Hier wird die Dauer der Unternehmenszugehörigkeit in Jahre verlangt
+                                Wenn diese weniger als ein Jahr beträgt, ist eine 0 einzutragen
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="WithdrawalDate" type="xs:date" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Austrittsdatum</translation>
+                        <description>
+                            <short>
+                                Genaues Datum des Austrittes bei Beendigung des Arbeitsverhältnisses
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="WorkplaceCanton" type="tns:CantonType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Arbeitsplatzkanton</translation>
+                        <description>
+                            <short>Arbeitsplatzkanton</short>
+                            <domain>
+                                Der Arbeitsplatzkanton dient als Grundlage für die Zuteilung zur
+                                Familienausgleichskasse.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="AgriculturalEmployee" type="tns:EmptyType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Landwirtschaftlicher Angestellter</translation>
+                        <description>
+                            <short>
+                                Bezeichnung von Beschäftigten in landwirtschaftlichen Betrieben (Unterstellung FLG)
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Apprentice" type="tns:EmptyType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Lehrling</translation>
+                        <description>
+                            <short>
+                                Kennzeichnung eines Lehrlings
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="Social-InsuranceIdentificationType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Sozialversicherungsidentifikations-Typ</translation>
+                <description>
+                    <short>
+                        Die Sozialversicherungen verwenden eine Sozialversicherungsidentifikation zur eindeutigen
+                        Indentifikation von Personen (Versicherten).
+                    </short>
+                    <domain>
+                        Für Personen die sowohl SV-Nummer als auch AHV-Nummer besitzen, müssen beide Nummern angegeben
+                        werden (nicht alle Sozialwerke werden gleichzeitig auf die SV-Nummer umstellen und sind
+                        deshalb auf die "alte" AHV-Nummer angewiesen).
+                        Für Personen die entweder AHV- oder SV-Nummer besitzen muss die vorhandene Nummer angegeben
+                        werden.
+                        Für Personen die keine AHV- und SV-Nummer besitzen (noch nicht zugeteilt) wird das Element
+                        "unbekannt" verwendet.
+                    </domain>
+                    <technical>
+                        Für das Inhaltsmodell muss der Fall mit beiden Nummern speziell definiert werden (SV-AS-Number
+                        und AHV-AVS-Number), damit keine Probleme mit der UPA (unique praticle attribution rule)
+                        entstehen
+                    </technical>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:choice>
+            <xs:element name="SV-AS-AHV-AVS-Number" type="tns:SV-AS-AHV-AVS-NumberType"/>
+            <xs:element name="AHV-AVS-Number" type="tns:AHV-AVS-NumberType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>AHV-Nummer</translation>
+                        <description>
+                            <short>
+                                AHV-Nummer der Person
+                            </short>
+                            <domain>
+                                Es ist die 11-stellige AHV-Nummer des Mitarbeiters vollständig abzubilden. Diese ist
+                                hier zu erfassen bis zur Einführung der Sozialversicherungsnummer.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="SV-AS-Number" type="tns:SV-AS-NumberType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Sozialversicherungsnummer</translation>
+                        <description>
+                            <short>
+                                Von der Zentrale-Ausgleichsstelle (ZAS) zugeteilte Sozialversicherungsnummer
+                            </short>
+                            <domain>
+                                Ab Einführung ist die 13-stellige Sozialversicherungsnummer zu erfassen.
+                                Diese wird von der Zentralen Ausgleichsstelle zugeteilt.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="unknown" type="tns:EmptyType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>unbekannt</translation>
+                        <description>
+                            <short>
+                                Die AHV-Nummer und die Sozialversicherungsnummer sind unbekannt.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:choice>
+    </xs:complexType>
+    <xs:complexType name="SV-AS-AHV-AVS-NumberType">
+        <xs:sequence>
+            <xs:element name="SV-AS-Number" type="tns:SV-AS-NumberType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Sozialversicherungsnummer</translation>
+                        <description>
+                            <short>
+                                Von der Zentrale-Ausgleichsstelle (ZAS) zugeteilte Sozialversicherungsnummer
+                            </short>
+                            <domain>
+                                Ab Einführung ist die 13-stellige Sozialversicherungsnummer zusätzlich zur AHV-Nummer
+                                (falls vorhanden) zu erfassen.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="AHV-AVS-Number" type="tns:AHV-AVS-NumberType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>AHV-Nummer</translation>
+                        <description>
+                            <short>
+                                AHV-Nummer der Person
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="WorkingTimeType">
+        <xs:choice>
+            <xs:element name="WeeklyHours" type="tns:WeeklyHoursType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Wöchentliche Arbeitszeit</translation>
+                        <description>
+                            <short>Wöchentliche Arbeitszeit</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="WeeklyLessons" type="tns:WeeklyLessonsType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Wöchentliche Arbeitslektionen</translation>
+                        <description>
+                            <short>Wöchentliche Arbeitslektionen</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:choice>
+    </xs:complexType>
+    <!--
+
+        kernel: Person-Salary
+    -->
+    <xs:complexType name="AHV-AVS-SalariesType">
+        <xs:sequence>
+            <xs:element name="AHV-AVS-Salary" type="tns:AHV-AVS-SalaryType" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>AHV-Lohn</translation>
+                        <description>
+                            <short>Der massgebende Lohn für die AHV</short>
+                            <domain>
+                                Bei mehreren Beitragsdauern (Einritt/Austritt oder Wechsel in der AHV-Pflicht)
+                                während eines Jahres, sind die dazugehörenden Einkommen periodengerecht aufzuschlüsseln.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="AHV-AVS-SalaryType">
+        <xs:sequence>
+            <xs:element name="AccountingTime" type="tns:TimePeriodType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Beitragsdauer</translation>
+                        <description>
+                            <short>Die Beitragsdauer des Versicherten</short>
+                            <domain>
+                                Genaues Datum, an dem die Beitragsdauer für den Versicherten begonnen hat (1. Arbeitstag
+                                im Kalenderjahr für unterjährigen Arbeitsbeginn, bzw. 1. Januar für ganzjährig
+                                Beschäftigte).
+                                Genaues Datum, an dem die Beitragsdauer für den Versicherten aufgehört hat (letzter
+                                Arbeitstag im Kalenderjahr für unterjährigen Austritt des Mitarbeitenden, bzw. 31.
+                                Dezember für ganzjährig Beschäftigte).
+                                Lohn ausserhalb der Abrechnungsperiode:
+                                Wenn der beitragspflichtige Lohn für eine andere Periode als das Kalenderjahr
+                                (GeneralSalaryDeclarationDescriptionType/AccountingPeriod) gilt, dann muss die
+                                Beitragsadauer für das Bestimmungsjahr angegeben werden.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="AHV-AVS-Income" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>AHV-Einkommen</translation>
+                        <description>
+                            <short>Das AHV-Einkommen der Beitragsdauer</short>
+                            <domain>
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="AHV-AVS-Open" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>AHV-frei</translation>
+                        <description>
+                            <short>Das AHV-frei Einkommen der Beitragsdauer</short>
+                            <domain>
+                                Nicht Versicherte oder nicht beitragspflichtige Personen und Lohnsummen
+                                (Jugendliche mit nichtvollendetem 17 Altersjahr, Altersrentner und Sonderfälle)
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ALV-AC-Income" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>ALV-Einkommen</translation>
+                        <description>
+                            <short>Das ALV-Einkommen der Beitragsdauer</short>
+                            <domain>
+                                Als massgebendes Einkommen für ALV gilt das Einkommen bis zum Grenzbetrag (Höchstlohn)
+                                pro Jahr.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ALVZ-ACS-Income" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>ALVZ-Einkommen</translation>
+                        <description>
+                            <short>Das ALVZ-Einkommen der Beitragsdauer</short>
+                            <domain>
+                                Ab 2004 ist ALVZ nicht mehr in Kraft, kann jedoch jederzeit wieder eingeführt werden.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ALV-AC-Open" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>ALV frei</translation>
+                        <description>
+                            <short>Das ALV freie Einkommen der Beitragsdauer</short>
+                            <domain>
+                                Als massgebendes Einkommen für ALV frei gilt das den oberen Grenzbetrag pro Jahr
+                                übersteigende Entgelt.
+                                Zusätzlich wird das ALV freie Einkommen von nicht versicherten Personen (z.B.
+                                Jugendliche, Rentner, mitarbeitende Familienmitglieder in der Landwirtschaft)
+                                ausgewiesen.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="UVG-LAA-SalariesType">
+        <xs:sequence>
+            <xs:element name="UVG-LAA-Salary" type="tns:UVG-LAA-SalaryType" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVG-Lohn</translation>
+                        <description>
+                            <short>UVG-Lohn der Person</short>
+                            <domain>
+                                Bei mehreren Beitragsdauern (Einritt/Austritt oder Code-Wechsel)
+                                während eines Jahres, sind die dazugehörenden Einkommen periodengerecht aufzuschlüsseln.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="UVG-LAA-SalaryType">
+        <xs:sequence>
+            <xs:element name="AccountingTime" type="tns:TimePeriodType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Beitragsdauer</translation>
+                        <description>
+                            <short>Die Beitragsdauer des Versicherten</short>
+                            <domain>
+                                Genaues Datum, an dem die Beitragsdauer für den Versicherten begonnen hat (1. Arbeitstag
+                                im Kalenderjahr für unterjährigen Arbeitsbeginn, bzw. 1. Januar für ganzjährig
+                                Beschäftigte).
+                                Genaues Datum, an dem die Beitragsdauer für den Versicherten aufgehört hat (letzter
+                                Arbeitstag im Kalenderjahr für unterjährigen Austritt des Mitarbeitenden, bzw. 31.
+                                Dezember für ganzjährig Beschäftigte).
+                                Lohn ausserhalb der Abrechnungsperiode:
+                                Wenn der beitragspflichtige Lohn für eine andere Periode als das Kalenderjahr
+                                (GeneralSalaryDeclarationDescriptionType/AccountingPeriod) gilt, dann muss die
+                                Beitragsadauer für das Bestimmungsjahr angegeben werden.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVG-LAA-Code" type="tns:UVG-LAA-CodeType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVG-Code</translation>
+                        <description>
+                            <short>UVG-Code</short>
+                            <domain>
+                                Mit dem zweistelligen UVG-Code (alphanumerisch) wird angegeben, in welchem
+                                Betriebsteil der Mitarbeiter beschäftigt ist. Er weist auf die Art der Versicherung hin.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVG-LAA-GrossSalary" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVG-Bruttolohn</translation>
+                        <description>
+                            <short>Der UVG-Bruttolohn ist die Summe aller aufbauenden Lohnarten</short>
+                            <domain>
+                                Der Bruttolohn ist in der Regel die Summe aller aufbauenden Lohnarten sowie allfälliger
+                                Korrekturen.
+                                Die Grösse ist bei der Revision für den Summenvergleich notwendig.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVG-LAA-BaseSalary" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVG-Basislohn</translation>
+                        <description>
+                            <short>Die UVG-Basis enthält die Summe aller UVG-pflichtigen Lohnarten</short>
+                            <domain>
+                                Enthält die Summe aller UVG-pflichtigen Lohnarten, ohne Rücksicht auf den versicherten
+                                Höchstlohn und den UVG-Code.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVG-LAA-ContributorySalary" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Beitragspflichtiger UVG Lohn</translation>
+                        <description>
+                            <short>Der beitragspflichtige UVG Lohn aufgrund der UVG-Basis</short>
+                            <domain>
+                                Beitragspflichtiger Lohn, der aufgrund der UVG-Basis für die versicherten Personen unter
+                                der Berücksichtigung des Höchstlohnes berechnet wird.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="InstitutionIDRef" type="tns:InstitutionIDType" use="required">
+            <xs:annotation>
+                <xs:documentation xml:lang="de">
+                    <translation>InstitutionIDReferenz</translation>
+                    <description>
+                        <short>
+                            Hier wird die Referenz auf die entsprechende Institution innerhalb einer Domäne angegeben.
+                        </short>
+                    </description>
+                </xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <xs:complexType name="UVGZ-LAAC-SalariesType">
+        <xs:sequence>
+            <xs:element name="UVGZ-LAAC-Salary" type="tns:UVGZ-LAAC-SalaryType" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVGZ-Lohn</translation>
+                        <description>
+                            <short>UVGZ-Lohn der Person</short>
+                            <domain>
+                                Bei mehreren Beitragsdauern (Einritt/Austritt oder Code-Wechsel)
+                                während eines Jahres, sind die dazugehörenden Einkommen periodengerecht aufzuschlüsseln.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="UVGZ-LAAC-SalaryType">
+        <xs:sequence>
+            <xs:element name="AccountingTime" type="tns:TimePeriodType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Beitragsdauer</translation>
+                        <description>
+                            <short>Die Beitragsdauer des Versicherten</short>
+                            <domain>
+                                Genaues Datum, an dem die Beitragsdauer für den Versicherten begonnen hat (1. Arbeitstag
+                                im Kalenderjahr für unterjährigen Arbeitsbeginn, bzw. 1. Januar für ganzjährig
+                                Beschäftigte).
+                                Genaues Datum, an dem die Beitragsdauer für den Versicherten aufgehört hat (letzter
+                                Arbeitstag im Kalenderjahr für unterjährigen Austritt des Mitarbeitenden, bzw. 31.
+                                Dezember für ganzjährig Beschäftigte).
+                                Lohn ausserhalb der Abrechnungsperiode:
+                                Wenn der beitragspflichtige Lohn für eine andere Periode als das Kalenderjahr
+                                (GeneralSalaryDeclarationDescriptionType/AccountingPeriod) gilt, dann muss die
+                                Beitragsadauer für das Bestimmungsjahr angegeben werden.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVGZ-LAAC-Code" type="tns:AssuranceCategoryCodeType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVGZ-Code</translation>
+                        <description>
+                            <short>UVGZ-Code</short>
+                            <domain>
+                                Mit dem UVGZ-Code wird angegeben, welcher Versicherungskategorie
+                                der Mitarbeiter zugeteilt wurde. Er weist auf die Art der Versicherungslösung hin.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVGZ-LAAC-BaseSalary" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVGZ-Basislohn</translation>
+                        <description>
+                            <short>Die UVGZ-Basis enthält die Summe aller UVGZ-pflichtigen Lohnarten</short>
+                            <domain>
+                                Enthält die Summe aller UVGZ-pflichtigen Lohnarten, ohne Rücksicht auf den versicherten
+                                Höchstlohn und den UVGZ-Code.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVGZ-LAAC-ContributorySalary" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Beitragspflichtiger UVGZ Lohn</translation>
+                        <description>
+                            <short>Der beitragspflichtige UVGZ Lohn aufgrund der UVGZ-Basis</short>
+                            <domain>
+                                Beitragspflichtiger Lohn, der aufgrund der UVGZ-Basis für die versicherten Personen
+                                unter der Berücksichtigung des Höchstlohnes berechnet wird.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="InstitutionIDRef" type="tns:InstitutionIDType" use="required">
+            <xs:annotation>
+                <xs:documentation xml:lang="de">
+                    <translation>InstitutionIDReferenz</translation>
+                    <description>
+                        <short>
+                            Hier wird die Referenz auf die entsprechende Institution innerhalb einer Domäne angegeben.
+                        </short>
+                    </description>
+                </xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <xs:complexType name="KTG-AMC-SalariesType">
+        <xs:sequence>
+            <xs:element name="KTG-AMC-Salary" type="tns:KTG-AMC-SalaryType" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>KTG-Lohn</translation>
+                        <description>
+                            <short>KTG-Lohn der Person</short>
+                            <domain>
+                                Bei mehreren Beitragsdauern (Einritt/Austritt oder Code-Wechsel)
+                                während eines Jahres, sind die dazugehörenden Einkommen periodengerecht aufzuschlüsseln.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="KTG-AMC-SalaryType">
+        <xs:sequence>
+            <xs:element name="AccountingTime" type="tns:TimePeriodType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Beitragsdauer</translation>
+                        <description>
+                            <short>Die Beitragsdauer des Versicherten</short>
+                            <domain>
+                                Genaues Datum, an dem die Beitragsdauer für den Versicherten begonnen hat (1. Arbeitstag
+                                im Kalenderjahr für unterjährigen Arbeitsbeginn, bzw. 1. Januar für ganzjährig
+                                Beschäftigte).
+                                Genaues Datum, an dem die Beitragsdauer für den Versicherten aufgehört hat (letzter
+                                Arbeitstag im Kalenderjahr für unterjährigen Austritt des Mitarbeitenden, bzw. 31.
+                                Dezember für ganzjährig Beschäftigte).
+                                Lohn ausserhalb der Abrechnungsperiode:
+                                Wenn der beitragspflichtige Lohn für eine andere Periode als das Kalenderjahr
+                                (GeneralSalaryDeclarationDescriptionType/AccountingPeriod) gilt, dann muss die
+                                Beitragsadauer für das Bestimmungsjahr angegeben werden.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="KTG-AMC-Code" type="tns:AssuranceCategoryCodeType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>KTG-Code</translation>
+                        <description>
+                            <short>KTG-Code</short>
+                            <domain>
+                                Mit dem KTG-Code wird angegeben, welcher Versicherungskategorie
+                                der Mitarbeiter zugeteilt wurde. Er weist auf die Art der Versicherungslösung hin.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Reference-AHV-AVS-Salary" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Referenz AHV-Lohn</translation>
+                        <description>
+                            <short>Referenz zum AHV-Lohn</short>
+                            <domain>
+                                Enthält den AHV-Lohn.
+                                Bei den meisten Krankentaggeld-Lösungen entspricht der AHV-Lohn auch dem KTG pflichtigen
+                                Lohn.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="KTG-AMC-ContributorySalary" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Beitragspflichtiger KTG Lohn</translation>
+                        <description>
+                            <short>Der beitragspflichtige KTG Lohn aufgrund der KTG-Basis</short>
+                            <domain>
+                                Beitragspflichtiger Lohn, der aufgrund der KTG-Basis für die versicherten Personen unter
+                                der Berücksichtigung des Höchstlohnes berechnet wird.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="InstitutionIDRef" type="tns:InstitutionIDType" use="required">
+            <xs:annotation>
+                <xs:documentation xml:lang="de">
+                    <translation>InstitutionIDReferenz</translation>
+                    <description>
+                        <short>
+                            Hier wird die Referenz auf die entsprechende Institution innerhalb einer Domäne angegeben.
+                        </short>
+                    </description>
+                </xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <xs:complexType name="BVG-LPP-SalariesType">
+        <xs:sequence>
+            <xs:element name="BVG-LPP-Salary" type="tns:BVG-LPP-SalaryType" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>BVG-Lohn</translation>
+                        <description>
+                            <short>BVG-Lohn der Person</short>
+                            <domain>
+                                Bei mehreren Beitragsdauern (Einritt/Austritt oder Code-Wechsel)
+                                während eines Jahres, sind die dazugehörenden Einkommen periodengerecht aufzuschlüsseln.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="BVG-LPP-SalaryType">
+        <xs:sequence>
+            <xs:element name="AccountingTime" type="tns:TimePeriodType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Beitragsdauer</translation>
+                        <description>
+                            <short>Die Beitragsdauer des Versicherten</short>
+                            <domain>
+                                Genaues Datum, an dem die Beitragsdauer für den Versicherten begonnen hat (1. Arbeitstag
+                                im Kalenderjahr für unterjährigen Arbeitsbeginn, bzw. 1. Januar für ganzjährig
+                                Beschäftigte).
+                                Genaues Datum, an dem die Beitragsdauer für den Versicherten aufgehört hat (letzter
+                                Arbeitstag im Kalenderjahr für unterjährigen Austritt des Mitarbeitenden, bzw. 31.
+                                Dezember für ganzjährig Beschäftigte).
+                                Lohn ausserhalb der Abrechnungsperiode:
+                                Wenn der beitragspflichtige Lohn für eine andere Periode als das Kalenderjahr
+                                (GeneralSalaryDeclarationDescriptionType/AccountingPeriod) gilt, dann muss die
+                                Beitragsadauer für das Bestimmungsjahr angegeben werden.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="BVG-LPP-Code" type="tns:AssuranceCategoryCodeType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>BVG-Code</translation>
+                        <description>
+                            <short>BVG-Code</short>
+                            <domain>
+                                Mit dem BVG-Code wird angegeben, welcher Versicherungskategorie
+                                der Mitarbeiter zugeteilt wurde. Er weist auf die Art der Versicherungslösung hin.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="BVG-LPP-AHV-AVS-Salary" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>BVG-AHV-Lohn</translation>
+                        <description>
+                            <short>BVG pflichtiger AHV-Lohn</short>
+                            <domain>
+                                Enthält den BVG pflichtigen AHV-Lohn.
+                                Aufgrund des BVG pflichtigen AHV-Lohnes ermittelt die Vorsorgeeinrichtung unter
+                                Berücksichtigung des maximalen Lohnes und dem Koordinationsabzug den BVG
+                                versicherten Lohn.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="InstitutionIDRef" type="tns:InstitutionIDType" use="required">
+            <xs:annotation>
+                <xs:documentation xml:lang="de">
+                    <translation>InstitutionIDReferenz</translation>
+                    <description>
+                        <short>
+                            Hier wird die Referenz auf die entsprechende Institution innerhalb einer Domäne angegeben.
+                        </short>
+                    </description>
+                </xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <xs:complexType name="FAK-CAF-SalariesType">
+        <xs:sequence>
+            <xs:element name="FAK-CAF-Salary" type="tns:FAK-CAF-SalaryType" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>FAK-Zulage pro Person (Angestellter) und Periode</translation>
+                        <description>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="FAK-CAF-SalaryType">
+        <xs:sequence>
+            <xs:element name="FAK-CAF-Period" type="tns:TimePeriodType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>FAK-Periode</translation>
+                        <description>
+                            <short>
+                                FAK-Periode
+                            </short>
+                            <domain>
+                                Beginn des Zulagenanspruches. Bei ganzjährig 01.01.JJJJ und sonst das Geburtsdatum bei
+                                unterjährigem Beginn.
+                                Ende des Zulagenanspruches. Bei ganzjährig 31.12.JJJJ und sonst das Datum
+                                des unterjährigen Endes.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="FAK-CAF-ContributorySalary" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>FAK-Lohn</translation>
+                        <description>
+                            <short>
+                                FAK-pflichtiger Lohn pro Versicherte
+                            </short>
+                            <domain>
+                                Normalerweise entspricht der FAK-pflichtige Lohn dem AHV-pflichtigen Einkommen
+                                Bei mehreren Beitragsdauern (Einritt/Austritt oder Wechsel des Arbeitsplatz-Kantones)
+                                während eines Jahres, sind die dazugehörenden Einkommen periodengerecht aufzuschlüsseln.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="FAK-CAF-FamilyIncomeSupplement" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>FAK-Familienzulagen</translation>
+                        <description>
+                            <short>
+                                Summe der ausbezahlten Familienzulagen pro Versicherte
+                            </short>
+                            <domain>
+                                Es ist die Summe der ausbezahlten Familienzulagen (ohne Geburtszulagen
+                                und ohne Nachzahlungen für andere Jahre) pro Versicherter (pro Person) auszuweisen,
+                                welche von einer Familienausgleichskasse an die Unternehmen verrechnet wurde.
+                                An die Angestellten ausbezahlten Beträge werden hier positiv dargestellt.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="FAK-CAF-WorkplaceCanton" type="tns:CantonType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>FAK-Kanton</translation>
+                        <description>
+                            <short>FAK-Kanton der Betriebsstätte des Versicherten</short>
+                            <domain>
+                                Zu übermitteln ist der Domizilkanton der Betriebsstätte, in welcher der Versicherte
+                                tätig ist.
+                                Bei allfälligen Ausnahmebewilligungen ist der vereinbarte Kanton und bei FAK-Befreiung
+                                oder anerkannter eigener FAK-Kasse entsprechend zu melden.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <!-- tax -->
+    <xs:complexType name="TaxSalariesType">
+        <!-- choice xor ?? -->
+        <xs:sequence>
+            <xs:element name="TaxAnnuity" type="tns:TaxAnnuityType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Steuerbare Rente (B)</translation>
+                        <description>
+                            <short>Rente gemäss Rentenbescheinigung</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="TaxSalary" type="tns:TaxSalaryType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Steuerbares Einkommen (A)</translation>
+                        <description>
+                            <short>Einkommen gemäss Lohnausweis</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <!-- statistic -->
+    <xs:complexType name="StatisticSalariesType">
+        <xs:sequence>
+            <xs:element name="StatisticSalary" type="tns:StatisticSalaryType" minOccurs="1" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Statistik Lohn</translation>
+                        <description>
+                            <short>Statistik Lohn</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <!-- attribute-character: Person-Salary  -->
+    <!-- tax -->
+    <xs:complexType name="TaxAnnuityType">
+        <xs:sequence>
+            <xs:element name="Period" type="tns:TimePeriodType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Rentenperiode (E)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Income" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Rente (z1)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="GrossIncome" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Bruttolohn STV (z8)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="NetIncome" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Nettolohn STV (z11)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="TaxSalaryType">
+        <xs:sequence>
+            <xs:element name="Period" type="tns:TimePeriodType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Lohnperiode (E)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="FreeTransport" type="tns:EmptyType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Unentgeltliche Beförderung (F)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="CanteenLunchCheck" type="tns:EmptyType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Kantinenverpflegung / Lunch-Checks (G)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Income" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Lohn (z1)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="FringeBenefits" type="tns:FringeBenefitsType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Gehaltsnebenleistungen (z2)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="SporadicBenefits" type="tns:SortSumType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Unregelmässige Leistungen (z3)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="CapitalPayment" type="tns:SortSumType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Kapitalleistungen (z4)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="OwnershipRight" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Beteiligungsrechte (z5)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="BoardOfDirectorsRemuneration" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Verwaltungsratsentschädigungen (z6)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="OtherBenefits" type="tns:SortSumType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Andere Leistungen (z7)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="GrossIncome" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Bruttolohn STV (z8)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="AHV-ALV-NBUV-AVS-AC-AANP-Contribution" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>AHV-IV-EO-ALV-NBUV Beiträge (z9)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="BVG-LPP-Contribution" type="tns:BVG-LPP-ContributionType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Berufliche Vorsorge (z10)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="NetIncome" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Nettolohn STV (z11)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="DeductionAtSource" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Quellensteuerabzug (z12)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ChargesRule" type="tns:ChargesRuleType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Spesenregelung</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Charges" type="tns:ChargesType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Spesenvergütung (z13)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="OtherFringeBenefits" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Weitere Gehaltsnebenleistungen (z14)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="StandardRemark" type="tns:StandardRemarkType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Standard Bemerkungen (z15)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Remark" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Bemerkungen (z15)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="FringeBenefitsType">
+        <xs:sequence>
+            <xs:element name="FoodLodging" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Verpflegung Unterkunft (z2.1)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="CompanyCar" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Privatanteil Geschäftswagen (z2.2)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Other" type="tns:SortSumType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Andere (z2.3)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="BVG-LPP-ContributionType">
+        <xs:sequence>
+            <xs:element name="Regular" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Ordentliche Beiträge (z10.1)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Purchase" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Beiträge für den Einkauf (z10.2)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ChargesRuleType">
+        <xs:choice>
+            <xs:element name="WithRegulation" type="tns:GrantType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Spesenreglement(z15/rz55,56,65)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Guidance" type="tns:EmptyType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Kreuz Spesenregelung gemäss (z13.1.1-X/rz52,56)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:choice>
+    </xs:complexType>
+    <xs:complexType name="ChargesType">
+        <xs:sequence>
+            <xs:element name="Effective" type="tns:EffectiveType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Effektive Spesen (z13.1)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="LumpSum" type="tns:LumpSumType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Pauschalspesen (z13.2)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Education" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Beiträge an Weiterbildung (z13.3)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="EffectiveType">
+        <xs:sequence>
+            <xs:element name="TravelFoodAccommodation" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Reise, Verpflegung, Übernachtung (z13.1.1)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Other" type="tns:SortSumOptinalType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Andere (z13.1.2)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="LumpSumType">
+        <xs:sequence>
+            <xs:element name="Representation" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Repräsentation (z13.2.1)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Car" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Auto (z13.2.2)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Other" type="tns:SortSumType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Übrige (z13.2.3)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="SortSumType">
+        <xs:sequence>
+            <xs:element name="Text" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Text (,-separiert)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Sum" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Summe</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="SortSumOptinalType">
+        <xs:sequence>
+            <xs:element name="Text" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Text (,-separiert)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Sum" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Summe</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="StandardRemarkType">
+        <xs:sequence>
+            <xs:element name="StaffShareThirdCompany" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Mitarbeiterbeteiligung durch Drittgesellschaft (z15/rz70)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ChildAllowancePerAHV-AVS" type="tns:EmptyType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Kinderzulagen durch die Ausgleichkasse bezahlt (z15/rz15)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="RelocationCosts" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Umzugskosten durch Arbeitgeber(z15/rz71)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="StaffShareMarketValue" type="tns:GrantType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Mitarbeiterbeteilgung-Verkehrswert (rz68)</translation>
+                        <description>
+                            <short>
+                                Ein genehmigter Verkehrswert der Mitarbeiterbeteiligung
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="StaffShareWithoutTaxableIncome" type="tns:ReasonType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Mitarbeiterbeteilgung ohne steuerbares Einkommen (rz69)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="PrivatePartCompanyCar" type="tns:GrantType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Privatanteil Geschäftswagen (rz21)</translation>
+                        <description>
+                            <short>
+                                Ein genehmigter Privatanteil für den Geschäftswagen
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="CompanyCarClarify" type="tns:EmptyType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Auto priv.anteil im Veranlagungsverfahren abklären (rz22)</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="GrantType">
+        <xs:sequence>
+            <xs:element name="Allowed" type="xs:date">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Genehmigt-Datum</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Canton" type="tns:CantonType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Genehmigungs-Kanton</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <!-- statistic -->
+    <xs:complexType name="StatisticSalaryType">
+        <xs:sequence>
+            <xs:element name="Period" type="tns:TimePeriodType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Dauer</translation>
+                        <description>
+                            <short>Dauer der Beschäftigung Statistik</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="TotalHoursOfWork" type="tns:TotalHoursOfWorkType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Total Stunden</translation>
+                        <description>
+                            <short>Total der Stunden Statistik (STD)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="TotalLessonsOfWork" type="tns:TotalLessonsOfWorkType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Total Lektionen</translation>
+                        <description>
+                            <short>Total der Lektionen Statistik (LEK)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="GrossEarnings" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Bruttolohn</translation>
+                        <description>
+                            <short>Bruttolohn Statistik (BS)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="SocialContributions" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Sozialabgaben</translation>
+                        <description>
+                            <short>Sozialabgaben Statistik (SA)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Allowances" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Zulagen</translation>
+                        <description>
+                            <short>Zulagen Statistik (ZU)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Overtime" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Überstunden</translation>
+                        <description>
+                            <short>Überstunden Statistik (US)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Earnings13th" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>13ter Monatslohn</translation>
+                        <description>
+                            <short>13ter Monatslohn Statistik (ZML)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="SpecialPayments" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Sonderzulagen</translation>
+                        <description>
+                            <short>Sonderzulagen Statistik (SO)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="PaymentsByThird" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Drittleistungen</translation>
+                        <description>
+                            <short>Drittleistungen Statistik (DL)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="LaborCost" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Arbeitskosten</translation>
+                        <description>
+                            <short>Arbeitskosten Statistik (AK)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ExtendedBenefits" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Zusatzleistungen</translation>
+                        <description>
+                            <short>Zusatzleistungen Statistik (ZL)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Education" type="tns:EducationType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Ausbildung</translation>
+                        <description>
+                            <short>Ausbildung</short>
+                            <domain>
+                                Ausbildung des Arbeitnehmers
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Skill" type="tns:SkillType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Anforderungsniveau</translation>
+                        <description>
+                            <short>Anforderungsniveau</short>
+                            <domain>
+                                Anforderungsniveau des Arbeitsplatzes
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Position" type="tns:PositionType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Berufliche Stellung</translation>
+                        <description>
+                            <short>Berufliche Stellung</short>
+                            <domain>
+                                Berufliche Stellung des Arbeitnehmers
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Activity" type="tns:ActivityType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Tätigkeit</translation>
+                        <description>
+                            <short>Tätigkeit</short>
+                            <domain>
+                                effektive Tätigkeit des Arbeitnehmers
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="WageForm" type="tns:WageFormType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Lohnform</translation>
+                        <description>
+                            <short>Lohnform</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <!--
+
+        kernel: Social-Insurance
+    -->
+    <xs:complexType name="CustomerIdentificationType">
+        <xs:sequence>
+            <xs:element name="AHV-AVS" type="tns:AHV-AVS-CustomerIdentificationType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>AHV Kunden Identifikation</translation>
+                        <description>
+                            <short>
+                                Enthält AHV Kunden Identifikation aus Sicht der Ausgleichskasse
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVG-LAA" type="tns:UVG-LAA-CustomerIdentificationType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVG Kunden Identifikation</translation>
+                        <description>
+                            <short>
+                                Enthält UVG Kunden Identifikation aus Sicht der Versicherung
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVGZ-LAAC" type="tns:GenericCustomerIdentificationMultiType" minOccurs="0"
+                        maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVGZ Kunden Identifikation</translation>
+                        <description>
+                            <short>
+                                Enthält UVGZ Kunden Identifikation
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="KTG-AMC" type="tns:GenericCustomerIdentificationMultiType" minOccurs="0"
+                        maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>KTG Kunden Identifikation</translation>
+                        <description>
+                            <short>
+                                Enthält KTG Kunden Identifikation
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="BVG-LPP" type="tns:GenericCustomerIdentificationMultiType" minOccurs="0"
+                        maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>BVG Kunden Identifikation</translation>
+                        <description>
+                            <short>
+                                Enthält BVG Kunden Identifikation
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="FAK-CAF" type="tns:FAK-CAF-CustomerIdentificationType" minOccurs="0"
+                        maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>FAK Kunden Identifikation</translation>
+                        <description>
+                            <short>
+                                Enthält FAK Kunden Identifikation aus Sicht der Familien Ausgleichskasse
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="AHV-AVS-CustomerIdentificationType">
+        <xs:sequence>
+            <xs:element name="AK-CC-BranchNumber" type="tns:AK-CC-NumberType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>AK-Nummer</translation>
+                        <description>
+                            <short>
+                                Nummer der Ausgleichskasse, bei der das Mitglied (die Unternehmen)
+                                angeschlossen ist
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="AK-CC-CustomerNumber" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>AK-Mitgliednummer</translation>
+                        <description>
+                            <short>
+                                Von der Ausgleichskasse zugeteilte Mitglied- oder Abrechnungsnummer, die zur eindeutigen
+                                Identifikation des Mitgliedes (der Unternehmen) dient.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="AK-CC-SubNumber" type="tns:SubNumberType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>AK-SubNummer</translation>
+                        <description>
+                            <short>
+                                Ein Kunde kann in der Kundennummer mehrere Subnummern für separate Abrechnungen
+                                wünschen.
+                                Diese werden z.B. für Tochtergesellschaften, Kaderlöhne usw. verwendet
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="SalaryDeclarationIsComplete" type="tns:SimpleBooleanType">
+                <xs:annotation>
+                    <xs:documentation>Lohndeklaration ist vollständig</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="UVG-LAA-CustomerIdentificationType">
+        <xs:sequence>
+            <xs:element name="Suva" type="tns:SuvaCustomerIdentityType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Suva Kunden Identifikation</translation>
+                        <description>
+                            <short>
+                                Enthält Kunden Identifikation aus Sicht der Suva
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Other" type="tns:GenericCustomerIdentificationMultiType" minOccurs="0"
+                        maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Andere Kunden Identifikation</translation>
+                        <description>
+                            <short>
+                                Enthält Kunden Identifikation aus Sicht einer Versicherung
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="FAK-CAF-CustomerIdentificationType">
+        <xs:sequence>
+            <xs:element name="FAK-CAF-BranchNumber" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>FAK-Nummer</translation>
+                        <description>
+                            <short>
+                                Nummer der Familienausgleichskasse, bei der das Mitglied (die Unternehmen)
+                                angeschlossen ist.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="FAK-CAF-CustomerNumber" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>FAK-Mitgliednummer</translation>
+                        <description>
+                            <short>
+                                Von der Familienausgleichskasse zugeteilte Mitglied- oder Abrechnungsnummer, die zur
+                                eindeutigen
+                                Identifikation des Mitgliedes (der Unternehmen) dient.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="FAK-CAF-SubNumber" type="tns:SubNumberType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>FAK-SubNummer</translation>
+                        <description>
+                            <short>
+                                Ein Kunde kann in der Kundennummer mehrere Subnummern für separate Abrechnungen
+                                wünschen.
+                                Diese werden z.B. für Tochtergesellschaften, Kaderlöhne usw. verwendet
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="SalaryDeclarationIsComplete" type="tns:SimpleBooleanType">
+                <xs:annotation>
+                    <xs:documentation>Lohndeklaration ist vollständig</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="InstitutionID" type="tns:InstitutionIDType" use="required">
+            <xs:annotation>
+                <xs:documentation xml:lang="de">
+                    <translation>InstitutionIDReferenz</translation>
+                    <description>
+                        <short>
+                            Hier wird die ID der Institution innerhalb einer Domäne angegeben.
+                        </short>
+                    </description>
+                </xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <!-- attribute-character: Social-Insurance  -->
+    <xs:complexType name="SuvaCustomerIdentityType">
+        <xs:sequence>
+            <xs:element name="SuvaCustomerNumber" type="tns:SuvaCustomerNumberType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Suva Kundennummer</translation>
+                        <description>
+                            <short>
+                                Von der Suva zugeteilte Kunden-Nummer, die zur eindeutigen Identifikation des Betriebes
+                                (der Unternehmen) dient.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="SuvaSubNumber" type="tns:SubNumberType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Suva Subnummer</translation>
+                        <description>
+                            <short>
+                                Ein Kunde kann in der Kundennummer mehrere Subnummern für separate Abrechnungen
+                                wünschen.
+                                Diese werden z.B. für Tochtergesellschaften, Kaderlöhne usw. verwendet
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="SalaryDeclarationIsComplete" type="tns:SimpleBooleanType">
+                <xs:annotation>
+                    <xs:documentation>Lohndeklaration ist vollständig</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="InstitutionID" type="tns:InstitutionIDType" use="required">
+            <xs:annotation>
+                <xs:documentation xml:lang="de">
+                    <translation>InstitutionIDReferenz</translation>
+                    <description>
+                        <short>
+                            Hier wird die Referenz auf die entsprechende Institution innerhalb einer Domäne angegeben.
+                        </short>
+                    </description>
+                </xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <xs:complexType name="GenericCustomerIdentificationMultiType">
+        <xs:sequence>
+            <xs:element name="InsuranceID" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Versicherungsidentifikation</translation>
+                        <description>
+                            <short>Versicherungsidentifikation gemäss seperater Liste</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="InsuranceCompanyName" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Versicherungsname</translation>
+                        <description>
+                            <short>
+                                Name der Sozialversicherung
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="CustomerIdentity" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Versicherungs Kunden Identifikation</translation>
+                        <description>
+                            <short>
+                                Von der Versicherung zugeteilte Kunden-Identifikation, die zur eindeutigen
+                                Identifikation des Betriebes
+                                (der Unternehmen) dient.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ContractIdentity" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Vertragsidentifikation</translation>
+                        <description>
+                            <short>
+                                Von der Versicherung zugeteilte Vertrags-Identifikation.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="SalaryDeclarationIsComplete" type="tns:SimpleBooleanType">
+                <xs:annotation>
+                    <xs:documentation>Lohndeklaration ist vollständig</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="InstitutionID" type="tns:InstitutionIDType" use="required">
+            <xs:annotation>
+                <xs:documentation xml:lang="de">
+                    <translation>InstitutionIDReferenz</translation>
+                    <description>
+                        <short>
+                            Hier wird die Referenz auf die entsprechende Institution innerhalb einer Domäne angegeben.
+                        </short>
+                    </description>
+                </xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <!--
+
+        kernel: SalaryTotals
+    -->
+    <xs:complexType name="SalaryTotalsType">
+        <xs:sequence>
+            <xs:element name="AHV-AVS-Totals" type="tns:AHV-AVS-TotalsType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>AHV Lohntotale</translation>
+                        <description>
+                            <short>
+                                Alle AHV Lohntotale
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVG-LAA-Totals" type="tns:UVG-LAA-TotalsType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVG Lohntotale</translation>
+                        <description>
+                            <short>
+                                Alle UVG Lohntotale
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVGZ-LAAC-Totals" type="tns:UVGZ-LAAC-TotalsType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVGZ Lohntotale</translation>
+                        <description>
+                            <short>Alle UVGZ Lohntotale</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="KTG-AMC-Totals" type="tns:KTG-AMC-TotalsType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>KTG Lohntotale</translation>
+                        <description>
+                            <short>Alle KTG Lohntotale</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="FAK-CAF-FLG-LFA-Totals" type="tns:FAK-CAF-FLG-LFA-TotalsType" minOccurs="0"
+                        maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>FAK FLG Lohntotale</translation>
+                        <description>
+                            <short>Alle FAK und FLG Lohntotale</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="AHV-AVS-TotalsType">
+        <xs:sequence>
+            <xs:element name="Total-AHV-AVS-Incomes" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Total AHV-Löhne</translation>
+                        <description>
+                            <short>Summe aller AHV-Löhne</short>
+                            <domain>
+                                Es sind die massgebenden Einkommen der gesamten Unternehmen
+                                für AHV/IV/EO zu addieren und auszuweisen.
+                            </domain>
+                            <technical>
+                                Redundante Information
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Total-AHV-AVS-Open" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Total AHV-freien Löhne</translation>
+                        <description>
+                            <short>Summe aller AHV-freien Löhne</short>
+                            <domain>
+                                Es sind die AHV-freien Beträge zu addieren und auszuweisen.
+                            </domain>
+                            <technical>
+                                Redundante Information
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Total-ALV-AC-Incomes" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Total ALV-Löhne</translation>
+                        <description>
+                            <short>Summe aller ALV-Löhne</short>
+                            <domain>
+                                Es sind die massgebenden Einkommen für ALV zu addieren und auszuweisen.
+                            </domain>
+                            <technical>
+                                Redundante Information
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Total-ALVZ-ACS-Incomes" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Total ALVZ-Löhne</translation>
+                        <description>
+                            <short>Summe aller ALVZ-Löhne</short>
+                            <domain>
+                                Ab 2004 ist ALVZ nicht mehr in Kraft, kann jedoch jederzeit wieder eingeführt werden.
+                            </domain>
+                            <technical>
+                                Redundante Information
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Total-ALV-AC-Open" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Total ALV-freien Löhne</translation>
+                        <description>
+                            <short>Summe aller ALV-freien Löhne</short>
+                            <domain>
+                                Es sind die ALV-freien Beträge zu addieren und auszuweisen.
+                            </domain>
+                            <technical>
+                                Redundante Information
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="UVG-LAA-TotalsType">
+        <xs:sequence>
+            <xs:element name="UVG-LAA-BranchTotals" type="tns:UVG-LAA-BranchTotalsType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVG Betriebsteil-Totale</translation>
+                        <description>
+                            <short>
+                                Totale pro Betriebsteil einer Unternehmen
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVG-LAA-MasterTotal" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVG Gesamttotal</translation>
+                        <description>
+                            <short>
+                                Es sind die massgebenden Einkommen für UVG zu addieren und auszuweisen.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="NumberOfFemalePersons" type="xs:nonNegativeInteger">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Anzahl weiblicher Personen</translation>
+                        <description>
+                            <short>
+                                Anzahl weiblicher Personen (Versicherte) per 30.9. des Jahres
+                            </short>
+                            <domain>
+                                Es ist die Anzahl der voll und teilzeit beschäftigten, versicherten weiblichen Personen
+                                per 30.9. des Jahres auszuweisen.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="NumberOfMalePersons" type="xs:nonNegativeInteger">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Anzahl männlicher Personen</translation>
+                        <description>
+                            <short>
+                                Anzahl männlicher Personen (Versicherte) per 30.9. des Jahres
+                            </short>
+                            <domain>
+                                Es ist die Anzahl der voll und teilzeit beschäftigten, versicherten männlichen Personen
+                                per 30.9. des Jahres auszuweisen.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="InstitutionIDRef" type="tns:InstitutionIDType" use="required">
+            <xs:annotation>
+                <xs:documentation xml:lang="de">
+                    <translation>InstitutionIDReferenz</translation>
+                    <description>
+                        <short>
+                            Hier wird die Referenz auf die entsprechende Institution innerhalb einer Domäne angegeben.
+                        </short>
+                    </description>
+                </xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <xs:complexType name="UVGZ-LAAC-TotalsType">
+        <xs:sequence>
+            <xs:element name="UVGZ-LAAC-CategoryTotals" type="tns:UVGZ-LAAC-CategoryTotalsType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVGZ Kategory-Totale</translation>
+                        <description>
+                            <short>
+                                Totale pro Versicherungskategorie einer Unternehmen
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVGZ-LAAC-MasterTotal" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVGZ Gesamttotal</translation>
+                        <description>
+                            <short>
+                                Es sind die massgebenden Einkommen für UVGZ zu addieren und auszuweisen.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="InstitutionIDRef" type="tns:InstitutionIDType" use="required">
+            <xs:annotation>
+                <xs:documentation xml:lang="de">
+                    <translation>InstitutionIDReferenz</translation>
+                    <description>
+                        <short>
+                            Hier wird die Referenz auf die entsprechende Institution innerhalb einer Domäne angegeben.
+                        </short>
+                    </description>
+                </xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <xs:complexType name="KTG-AMC-TotalsType">
+        <xs:sequence>
+            <xs:element name="KTG-AMC-CategoryTotals" type="tns:KTG-AMC-CategoryTotalsType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>KTG Kategory-Totale</translation>
+                        <description>
+                            <short>
+                                Totale pro Versicherungskategorie einer Unternehmen
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="KTG-AMC-MasterTotal" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>KTG Gesamttotal</translation>
+                        <description>
+                            <short>
+                                Es sind die massgebenden Einkommen für KTG zu addieren und auszuweisen.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="InstitutionIDRef" type="tns:InstitutionIDType" use="required">
+            <xs:annotation>
+                <xs:documentation xml:lang="de">
+                    <translation>InstitutionIDReferenz</translation>
+                    <description>
+                        <short>
+                            Hier wird die Referenz auf die entsprechende Institution innerhalb einer Domäne angegeben.
+                        </short>
+                    </description>
+                </xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <xs:complexType name="FAK-CAF-FLG-LFA-TotalsType">
+        <xs:sequence>
+            <xs:element name="Total-FAK-CAF-IncomesPerCanton" type="tns:Total-FAK-CAF-IncomesPerCantonType"
+                        minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Total FAK-Löhne pro Kanton</translation>
+                        <description>
+                            <short>Summe aller FAK-Löhne pro Kanton</short>
+                            <domain>
+                                Es sind die massgebenden Einkommen der gesamten Unternehmen
+                                für die FAK pro Kanton zu addieren und auszuweisen.
+                                Normalerweise entspricht der FAK-pflichtige Lohn dem AHV-pflichtigen Einkommen
+                            </domain>
+                            <technical>
+                                Redundante Information
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Total-FLG-LFA-Incomes" type="tns:SalaryAmountType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Total FLG-Löhne</translation>
+                        <description>
+                            <short>Summe aller FLG Löhne</short>
+                            <domain>
+                                Es sind die massgebenden Löhne für FLG von allen Versicherten zu addieren und
+                                auszuweisen.
+                                Für FLG massgebend sind ausschliesslich in der Landwirtschaft generierte Löhne.
+                            </domain>
+                            <technical>
+                                NICHT redundante Information
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <!-- attribute-character: UVG-SalaryTotals  -->
+    <xs:complexType name="UVG-LAA-BranchTotalsType">
+        <xs:sequence>
+            <xs:element name="UVG-LAA-BranchTotal" type="tns:UVG-LAA-BranchTotalType" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVG Betriebsteil Lohntotal</translation>
+                        <description>
+                            <short>
+                                Das UVG Lohntotal eines Betriebsteils
+                            </short>
+                            <domain>
+                                Enthält die UVG Lohntotale eines Betriebsteils einer Unternehmen. Die Lohnmeldung muss
+                                für jeden in der Lohnmeldung enthaltenen Betriebsteil (siehe UVG-LohnType) die Totale
+                                enthalten.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="UVG-LAA-BranchTotalType">
+        <xs:sequence>
+            <xs:element name="BranchIdentifier" type="tns:BranchIdentifierType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Betriebsteil Identifikation</translation>
+                        <description>
+                            <short>
+                                Name des Betriebsteils. Dieser Wert ist identisch mit der 1. Stelle des UVG-Codes.
+                            </short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="NBU-BU-ANP-AP-Total" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>NBU-BU Lohntotal</translation>
+                        <description>
+                            <short>
+                                Das NBU-BU Lohntotal eines Betriebsteils.
+                            </short>
+                            <domain>
+                                Summe der BUV und NBUV versicherten Löhne (alle Löhne mit UVG-Codes die mit 1 oder 2
+                                enden)
+                                eines Betriebsteils
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="BU-AP-Total" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>BU Lohntotal</translation>
+                        <description>
+                            <short>
+                                Das BU Lohntotal eines Betriebsteils.
+                            </short>
+                            <domain>
+                                Summe der BUV versicherten Löhne (alle Löhne mit UVG-Codes die mit 3 enden)
+                                eines Betriebsteils
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="UVGZ-LAAC-CategoryTotalsType">
+        <xs:sequence>
+            <xs:element name="UVGZ-LAAC-CategoryTotal" type="tns:GenericCategoryTotalType" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>UVGZ Kategorie Lohntotal</translation>
+                        <description>
+                            <short>Das UVGZ Lohntotal einer Versicherungskategorie</short>
+                            <domain>
+                                Enthält die UVGZ Lohntotale einer Versicherungskategorie der Unternehmen.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="KTG-AMC-CategoryTotalsType">
+        <xs:sequence>
+            <xs:element name="KTG-AMC-CategoryTotal" type="tns:GenericCategoryTotalType" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>KTG Kategorie Lohntotal</translation>
+                        <description>
+                            <short>Das KTG Lohntotal einer Versicherungskategorie</short>
+                            <domain>
+                                Enthält die KTG Lohntotale einer Versicherungskategorie der Unternehmen.
+                            </domain>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="GenericCategoryTotalType">
+        <xs:sequence>
+            <xs:element name="CategoryCode" type="tns:AssuranceCategoryCodeType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Kategorie-Code</translation>
+                        <description>
+                            <short>Versicherungskategorie Code.</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Female-Total" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Weibliches Lohntotal</translation>
+                        <description>
+                            <short>Das Lohntotal einer Kategorie aller Frauen.</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Male-Total" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Männliches Lohntotal</translation>
+                        <description>
+                            <short>Das Lohntotal einer Kategorie aller Männer.</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <!-- attribute-character: FAK-SalaryTotals  -->
+    <xs:complexType name="Total-FAK-CAF-IncomesPerCantonType">
+        <xs:sequence>
+            <xs:element name="Total-FAK-CAF-Incomes" type="tns:SalaryAmountType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Total FAK-Löhne</translation>
+                        <description>
+                            <short>Summe aller FAK-Löhne pro Kanton</short>
+                            <domain>
+                                Es sind die massgebenden Einkommen der gesamten Unternehmen
+                                für die FAK pro Kanton zu addieren und auszuweisen.
+                                Normalerweise entspricht der FAK-pflichtige Lohn dem AHV-pflichtigen Einkommen
+                            </domain>
+                            <technical>
+                                Redundante Information
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Canton" type="tns:CantonType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Kanton</translation>
+                        <description>
+                            <short>Kanton für die Summe</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <!--
+
+        kernel: SalaryCounters
+    -->
+    <xs:complexType name="SalaryCountersType">
+        <xs:sequence>
+            <xs:element name="NumberOf-AHV-AVS-Salary-Tags" type="xs:unsignedInt" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Anzahl AHV-Löhne Tags</translation>
+                        <description>
+                            <short>Anzahl deklarierter AHV-Löhne Tags</short>
+                            <technical>
+                                Anzahl deklarierter AHV-Löhne aller Personen einer Lohnerklärung entspricht
+                                der Anzahl "AHV-Lohn" (AHV-AVS-Salary) Tags innerhalb eines "SalaryDeclaration" Elements
+                                im XML Instanz Dokument.
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="NumberOf-UVG-LAA-Salary-Tags" type="xs:unsignedInt" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Anzahl UVG-Löhne Tags</translation>
+                        <description>
+                            <short>Anzahl deklarierter UVG-Löhne Tags</short>
+                            <technical>
+                                Anzahl deklarierter UVG-Löhne aller Personen einer Lohnerklärung entspricht
+                                der Anzahl "UVG-Lohn" (UVG-LAA-Salary) Tags innerhalb eines "SalaryDeclaration" Elements
+                                im XML Instanz Dokument.
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="NumberOf-UVGZ-LAAC-Salary-Tags" type="xs:unsignedInt" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Anzahl UVGZ-Löhne Tags</translation>
+                        <description>
+                            <short>Anzahl deklarierter UVGZ-Löhne Tags</short>
+                            <technical>
+                                Anzahl deklarierter UVGZ-Löhne aller Personen einer Lohnmeldung entspricht
+                                der Anzahl "UVGZ-Lohn" (UVGZ-LAAC-Salary) Tags innerhalb eines "SalaryDeclaration"
+                                Elements
+                                im XML Instanz Dokument.
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="NumberOf-KTG-AMC-Salary-Tags" type="xs:unsignedInt" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Anzahl KTG-Löhne Tags</translation>
+                        <description>
+                            <short>Anzahl deklarierter KTG-Löhne Tags</short>
+                            <technical>
+                                Anzahl deklarierter KTG-Löhne aller Personen einer Lohnmeldung entspricht
+                                der Anzahl "KTG-Lohn" (KTG-AMC-Salary) Tags innerhalb eines "SalaryDeclaration" Elements
+                                im XML Instanz Dokument.
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="NumberOf-BVG-LPP-Salary-Tags" type="xs:unsignedInt" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Anzahl BVG-Löhne Tags</translation>
+                        <description>
+                            <short>Anzahl deklarierter BVG-Löhne Tags</short>
+                            <technical>
+                                Anzahl deklarierter BVG-Löhne aller Personen einer Lohnmeldung entspricht
+                                der Anzahl "BVG-Lohn" (BVG-LPP-Salary) Tags innerhalb eines "SalaryDeclaration" Elements
+                                im XML Instanz Dokument.
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="NumberOf-FAK-CAF-Salary-Tags" type="xs:unsignedInt" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Anzahl FAK-Löhne Tags</translation>
+                        <description>
+                            <short>Anzahl deklarierter FAK-Löhne Tags</short>
+                            <technical>
+                                Anzahl deklarierter FAK-Löhne aller Personen einer Lohnmeldung entspricht
+                                der Anzahl "FAK-Lohn" (FAK-CAF-Salary) Tags innerhalb eines "SalaryDeclaration" Elements
+                                im XML Instanz Dokument.
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="NumberOf-TaxAnnuity-Tags" type="xs:unsignedInt" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Anzahl Rentenbescheinigung Tags</translation>
+                        <description>
+                            <short>Anzahl deklarierter steuerbare Renten Tags</short>
+                            <technical>
+                                Anzahl Rentenbescheinigung-Löhne aller Personen. Entspricht
+                                der Anzahl aller "Rentenbescheinigung Lohn" (TaxAnnuity) Tags innerhalb der gesamten
+                                Lohnmeldung "SalaryDeclaration" im XML Instanz Dokument.
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="NumberOf-TaxSalary-Tags" type="xs:unsignedInt" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Anzahl Lohnausweis Tags</translation>
+                        <description>
+                            <short>Anzahl deklarierter steuerbare Einkommen Tags</short>
+                            <technical>
+                                Anzahl Lohnausweis-Löhne aller Personen. Entspricht
+                                der Anzahl aller "Lohnausweis Lohn" (TaxSalary) Tags innerhalb der gesamten
+                                Lohnmeldung "SalaryDeclaration" im XML Instanz Dokument.
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="NumberOf-StatisticSalaries-Tags" type="xs:unsignedInt" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Anzahl Statistik Lohn Tags</translation>
+                        <description>
+                            <short>Anzahl Statistik Lohn der LSE Tags</short>
+                            <technical>
+                                Anzahl Statistik-Löhne aller Personen einer Lohnstrukturerhebung (LSE). Entspricht
+                                der Anzahl aller "Statistik Lohn" (StatisticSalary) Tags innerhalb der gesamten
+                                Lohnmeldung "SalaryDeclaration" im XML Instanz Dokument.
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <!--
+
+        shared-character
+    -->
+    <xs:complexType name="AddressType">
+        <xs:sequence>
+            <xs:element name="ComplementaryLine" type="xs:string" minOccurs="0" maxOccurs="1">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Zusatzzeile</translation>
+                        <description>
+                            <short>Zusatzzeile für Postadresse (2. Zeile)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Street" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Strasse</translation>
+                        <description>
+                            <short>Strasse und Hausnummer (3. Zeile)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Postbox" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Postfach</translation>
+                        <description>
+                            <short>Postfach (4. Zeile)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <!-- Postaddressee line 5 -->
+            <xs:element name="ZIP-Code" type="tns:ZIP-CodeType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Postleitzahl (PLZ)</translation>
+                        <description>
+                            <short>Postleitzahl (5. Zeile)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="City" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Ort</translation>
+                        <description>
+                            <short>Ort (5. Zeile)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <!-- Postaddressee line 6 -->
+            <xs:element name="Country" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Land</translation>
+                        <description>
+                            <short>Land für Postversand (6. Zeile)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="EmptyType"/>
+    <xs:complexType name="NationalityType">
+        <xs:sequence>
+            <!--
+            <xs:element name="ISOCode" type="un.ece.unedocs.cl.iso3166:CountryCodeType">
+            -->
+            <xs:element name="ISOCode">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Nationalität</translation>
+                        <description>
+                            <short>
+                                Nationalität 2-stellig nach ISO 3166 Erweitert
+                            </short>
+                            <technical>
+                                Erweiterung
+                                11= unbekannt
+                                22= staatenlos
+                                In der Qualitätsstufe Plausibilität wird gegen die ISO 31666 Codes geprüft und
+                                evtl. eine Warninig angezeigt
+                                http://www.unece.org/etrades/unedocs/repository/codelists/xml/CountryCode.xsd
+                            </technical>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+                <xs:simpleType>
+                    <xs:restriction base="xs:string">
+                        <xs:pattern value="[A-Z][A-Z]|11|22"/>
+                    </xs:restriction>
+                </xs:simpleType>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="TimePeriodType">
+        <xs:sequence>
+            <xs:element name="from" type="xs:date">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>von</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="until" type="xs:date">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>bis</translation>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <!--
+
+        simpleTypes (arranged alphabetically)
+    -->
+    <xs:simpleType name="ActivityRateType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>BeschäftigungsgradTyp</translation>
+                <description>
+                    <short>BeschäftigungsgradTyp in %</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="1"/>
+            <xs:maxInclusive value="100"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="ActivityType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Tätigkeit</translation>
+                <description>
+                    <short>Tätigkeit</short>
+                    <domain>
+                        Mögliche Werte:
+                        sep. Liste !!!
+                    </domain>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="10"/>
+            <xs:maxInclusive value="99"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="AHV-AVS-NumberType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>AHV-Nummer Typ</translation>
+                <description>
+                    <short>AHV-Nummer Typ</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:pattern value="[1-9][0-9]{2}\.[0-9]{2}\.[1-8][0-9]{2}\.[0-9]{3}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="AK-CC-NumberType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>AK-Nummer Typ</translation>
+                <description>
+                    <short>Ausgleichskasse Nummer Typ</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:pattern value="[0-9]{3}|[0-9]{3}\.[0-9]{3}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="BranchIdentifierType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Betriebsteil-Identifikations Typ</translation>
+                <description>
+                    <short>Betriebsteil-Identifikations Typ</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:pattern value="[A-Z]"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="CantonType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>KantonsTyp</translation>
+                <description>
+                    <short>KantonsTyp der Schweiz</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="AG"/>
+            <xs:enumeration value="AI"/>
+            <xs:enumeration value="AR"/>
+            <xs:enumeration value="BE"/>
+            <xs:enumeration value="BL"/>
+            <xs:enumeration value="BS"/>
+            <xs:enumeration value="FR"/>
+            <xs:enumeration value="GE"/>
+            <xs:enumeration value="GL"/>
+            <xs:enumeration value="GR"/>
+            <xs:enumeration value="JU"/>
+            <xs:enumeration value="LU"/>
+            <xs:enumeration value="NE"/>
+            <xs:enumeration value="NW"/>
+            <xs:enumeration value="OW"/>
+            <xs:enumeration value="SG"/>
+            <xs:enumeration value="SH"/>
+            <xs:enumeration value="SO"/>
+            <xs:enumeration value="SZ"/>
+            <xs:enumeration value="TG"/>
+            <xs:enumeration value="TI"/>
+            <xs:enumeration value="UR"/>
+            <xs:enumeration value="VD"/>
+            <xs:enumeration value="VS"/>
+            <xs:enumeration value="ZG"/>
+            <xs:enumeration value="ZH"/>
+            <!-- Expatriates d.h. in keinem Kanton -->
+            <xs:enumeration value="EX"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="AssuranceCategoryCodeType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Versicherungskategorie-Code Typ</translation>
+                <description>
+                    <short>Versicherungskategorie-Code Typ</short>
+                    <domain>
+                        Für jede Versicherungslösung wird vom Versicherer eine Versicherungskategorie codiert.
+                    </domain>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:pattern value="[A-Z0-9]{1,2}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="CivilStatusType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>ZivilstandsTyp</translation>
+                <description>
+                    <short>ZivilstandsTyp</short>
+                    <domain>
+                        Mögliche Werte:
+                        unknown = unbekannt;
+                        single = ledig;
+                        married = verheiratet;
+                        widowed = verwitwet;
+                        divorced = geschieden;
+                        separated = getrennt;
+                    </domain>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="unknown"/>
+            <xs:enumeration value="single"/>
+            <xs:enumeration value="married"/>
+            <xs:enumeration value="widowed"/>
+            <xs:enumeration value="divorced"/>
+            <xs:enumeration value="separated"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="DegreeOfRelationshipType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Verwandtschaftsgrad</translation>
+                <description>
+                    <short>Verwandtschaftsgrad zum Inhaber</short>
+                    <domain>
+                        Kennzeichnung von mitarbeitenden Familienmitgliedern, die in folgendem Verwandtschaftsgrad
+                        zum Firmeninhaber (nur Personengesellschaften) stehen:
+                        Ehefrau des Inhabers, Ehemann des Inhabers, Blutsverwandte in auf- und absteigender Linie
+                        des Betriebsinhabers (oder dessen Ehepartner) sowie deren Ehepartnerinnen und
+                        Ehepartner, Geschwister des Betriebsinhabers, Adoptivkinder des Inhabers, Pflegekinder des
+                        Inhabers.
+                        Mögliche Werte:
+                        unknown = unbekannt ;
+                        unrelated = nichtVerwandt;
+                        OwnerWife = InhaberEhefrau;
+                        OwnerHusband = InhaberEhemann;
+                        OwnerBloodRelation = InhaberBlutsverwandter
+                        OwnerSiblings = InhaberGeschwister;
+                        OwnerAdoptedChild = InhaberAdaptivkind;
+                        OwnerFosterChild = InhaberPflegekind;
+                        (Hinweis für die verarbeitenden SVU: alle Abrechnungen mit mitarbeitenden Familienmitgliedern
+                        sollten auf eine Nachbearbeitungsliste ausgesondert werden, damit die Fragen bezüglich
+                        Globallohn etc. richtig geklärt werden können).
+                    </domain>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="unknown"/>
+            <xs:enumeration value="unrelated"/>
+            <xs:enumeration value="OwnerWife"/>
+            <xs:enumeration value="OwnerHusband"/>
+            <xs:enumeration value="OwnerBloodRelation"/>
+            <xs:enumeration value="OwnerSiblings"/>
+            <xs:enumeration value="OwnerAdoptedChild"/>
+            <xs:enumeration value="OwnerFosterChild"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="EducationType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Ausbildung</translation>
+                <description>
+                    <short>Ausbildungsart</short>
+                    <domain>
+                        Mögliche Werte:
+                        university = Uni/ETH ;
+                        higherEducation = Fachhochschule ;
+                        higherVocEducation = Höhere Berufsbildung ;
+                        teacherCertificate = Lehrerpatent ;
+                        universityEntranceCertificate = Matura ;
+                        vocEducationCompl = Abgeschlossene Berufsausbildung ;
+                        enterpriseEducation = nur unternehmensinterne Berufsausbildung ;
+                        mandatorySchoolOnly = nur obligatorische Schule ;
+                        other = andere Ausbildung ;
+                    </domain>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="university"/>
+            <xs:enumeration value="higherEducation"/>
+            <xs:enumeration value="higherVocEducation"/>
+            <xs:enumeration value="teacherCertificate"/>
+            <xs:enumeration value="universityEntranceCertificate"/>
+            <xs:enumeration value="vocEducationCompl"/>
+            <xs:enumeration value="enterpriseEducation"/>
+            <xs:enumeration value="mandatorySchoolOnly"/>
+            <xs:enumeration value="other"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="PositionType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Berufliche Stellung</translation>
+                <description>
+                    <short>Berufliche Stellung</short>
+                    <domain>
+                        Mögliche Werte:
+                        highestCadre = Oberstes Kader ;
+                        middleCadre = Mittleres Kader ;
+                        lowerCadre = Unteres Kader ;
+                        lowestCadre = Unterstes Kader ;
+                        noCadre = ohne Kaderfunktion ;
+                    </domain>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="highestCadre"/>
+            <xs:enumeration value="middleCadre"/>
+            <xs:enumeration value="lowerCadre"/>
+            <xs:enumeration value="lowestCadre"/>
+            <xs:enumeration value="noCadre"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="PayAgreementType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Lohnvereinbarungsarten</translation>
+                <description>
+                    <short>Lohnvereinbarungsarten</short>
+                    <domain>
+                        Mögliche Werte:
+                        collectivePayAgreementAssociation = Verbandsvertrag ;
+                        collectivePayAgreementEnterprise = Firmen- oder Hausvertrag ;
+                        agreementUnderPublicLaw = Regelung im öffentlich-rechtlichen Bereich ;
+                        individualContract = Einzelarbeitsvertrag ;
+                    </domain>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="collectivePayAgreementAssociation"/>
+            <xs:enumeration value="collectivePayAgreementEnterprise"/>
+            <xs:enumeration value="agreementUnderPublicLaw"/>
+            <xs:enumeration value="individualContract"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="ReasonType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Gründe</translation>
+                <description>
+                    <short>Gründe</short>
+                    <domain>
+                    </domain>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:string">
+            <xs:minLength value="3"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="ResidenceCategoryType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Aufenthaltskategorien</translation>
+                <description>
+                    <short>Aufenthaltskategorien für Ausländer</short>
+                    <domain>
+                        Mögliche Werte:
+                        shortTerm = Kurzaufenthalter (L) ;
+                        annual = Jahresaufenthalter (B) ;
+                        settled = Niedergelassene (C) ;
+                        crossBorder = Grenzgänger (G) ;
+                        othersNotSwiss = Andere ;
+                    </domain>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="shortTerm"/>
+            <xs:enumeration value="annual"/>
+            <xs:enumeration value="settled"/>
+            <xs:enumeration value="crossBorder"/>
+            <xs:enumeration value="othersNotSwiss"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="SalaryAmountType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>LohnbetragsTyp</translation>
+                <description>
+                    <short>LohnbetragsTyp</short>
+                    <technical></technical>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:decimal">
+            <xs:fractionDigits value="2"/>
+            <xs:pattern value="[\-]?[0-9]+\.[0-9]{2}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="SexType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Geschlechts Typ</translation>
+                <description>
+                    <short>F weiblich; M männlich</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="F"/>
+            <xs:enumeration value="M"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="SimpleBooleanType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>SimpleBoolean</translation>
+                <description>
+                    <short>Boolean</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:boolean">
+            <xs:pattern value="true"/>
+            <xs:pattern value="false"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="SkillType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Anforderungsniveau</translation>
+                <description>
+                    <short>Anforderungsniveau</short>
+                    <domain>
+                        Mögliche Werte:
+                        mostDemanding = höchst anspruchsvoll ;
+                        qualified = selbständiges u. qualifiziertes Arbeiten bedingt ;
+                        specialized = Berufs- und Fachkentinisse bedingt ;
+                        simple = einfach, repetitiv ;
+                    </domain>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="mostDemanding"/>
+            <xs:enumeration value="qualified"/>
+            <xs:enumeration value="specialized"/>
+            <xs:enumeration value="simple"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="SubNumberType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>SubNummer Typ</translation>
+                <description>
+                    <short>SubNummer Typ für separate Abrechnungen</short>
+                    <domain>
+                        Ein Suva Kunde kann in der Kundennummer mehrere Subnummern für separate
+                        Abrechnungen wünschen. Diese werden z.B. für Tochtergesellschaften, Kaderlöhne usw.
+                        verwendet
+                    </domain>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:pattern value="[0-9]{2}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="SuvaCustomerNumberType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>SuvaKundenNummer Typ</translation>
+                <description>
+                    <short>Suva Kunden Nummer Typ</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:pattern value="[0-9]{1,4}\-[0-9]{1,5}\.[0-9]"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="SV-AS-NumberType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>SV-Nummer Typ</translation>
+                <description>
+                    <short>Sozialversicherungs Nummer Typ</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <!--
+                pattern not defined
+            <xs:pattern value="[0-9]{3}\.[0-9]{4}\.[0-9]{4}\.[0-9]{1,2}"/>
+            -->
+            <xs:maxLength value="16"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="TotalHoursOfWorkType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Total Stunden Typ</translation>
+                <description>max: 8760 = 24 x 365
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:decimal">
+            <xs:minInclusive value="1.00"/>
+            <xs:maxInclusive value="8760.00"/>
+            <xs:fractionDigits value="2"/>
+            <xs:pattern value="[0-9]+\.[0-9]{2}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="TotalLessonsOfWorkType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Total Lektionen Typ</translation>
+                <description>max: 8760 = 24 x 365
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="1"/>
+            <xs:maxInclusive value="8760"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="UID-EHRAType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Unternehmensidentifikation Typ</translation>
+                <description>
+                    <short>Unternehmensidentifikation Typ</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:pattern value="CH[0-9]{11}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="UVG-LAA-CodeType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>UVG-Code Typ</translation>
+                <description>
+                    <short>UVG-Code Typ zur Betriebsteilbezeichnung</short>
+                    <domain>
+                        Die erste Stelle (A bis Z) des UVG Codes (ehemals Suva Code) ist die Betriebsteilbezeichnung.
+                        Damit wird
+                        angegeben in Betriebsteil (welcher Risikogruppe) der Mitarbeiter
+                        beschäftigt ist.
+                        Die zweite Stelle gibt die Art der Versicherung an (nicht Suva versichert,
+                        BUV, NBUV)
+                    </domain>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:pattern value="[A-Z][0-3]"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="WageFormType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Lohnform</translation>
+                <description>
+                    <short>Lohnformarten</short>
+                    <domain>
+                        Mögliche Werte:
+                        timeWages = Zeitlohn ;
+                        premiumWage = Prämienlohn ;
+                        wagesCommission = Lohn mit Provsionsanteil ;
+                        pieceWorkWage = Akkordlohn ;
+                    </domain>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="timeWages"/>
+            <xs:enumeration value="premiumWage"/>
+            <xs:enumeration value="wagesCommission"/>
+            <xs:enumeration value="pieceWorkWage"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="WeeklyHoursType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Wöchentliche Beschäftigungszeit Typ</translation>
+                <description>
+                    <short>Wöchentliche Beschäftigungszeit</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:decimal">
+            <xs:minInclusive value="1.00"/>
+            <xs:maxInclusive value="99.00"/>
+            <xs:fractionDigits value="2"/>
+            <xs:pattern value="[0-9]+\.[0-9]{2}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="WeeklyLessonsType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Wöchentliche Beschäftigungslektionen Typ</translation>
+                <description>
+                    <short>Wöchentliche Beschäftigungslektionen</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="1"/>
+            <xs:maxInclusive value="99"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="YearsOfServiceType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Dienstjahre Typ</translation>
+                <description>
+                    <short>Anzahle der vollen Dienstjahre</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:integer">
+            <xs:minInclusive value="0"/>
+            <xs:maxInclusive value="99"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="ZIP-CodeType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>PLZ Typ</translation>
+                <description>
+                    <short>Postleitzahl</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:minLength value="4"/>
+            <xs:maxLength value="6"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <!--
+
+        supported minor version (only to validate)
+        attribute schemaVersion
+    -->
+    <xs:simpleType name="SupportedMinorSchemaVersionAttributeType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>Unterstützte Minor Schema Versionen</translation>
+                <description>
+                    <short>Hier werden die kompatiblen Minor Versionen aufgeliestet</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:decimal">
+            <xs:enumeration value="0.0"/>
+            <!-- sample           -->
+            <!-- <xs:enumeration value="0.1"/> -->
+        </xs:restriction>
+    </xs:simpleType>
+
+    <xs:simpleType name="InstitutionIDType">
+        <xs:annotation>
+            <xs:documentation>Institution ID</xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:string">
+            <xs:pattern value="#.*"/>
+        </xs:restriction>
+    </xs:simpleType>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation4Schemas/SalaryDeclarationContainer.xsd b/xml/tests/testData/xml/ComplexSchemaValidation4Schemas/SalaryDeclarationContainer.xsd
new file mode 100644
index 0000000..927e234
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation4Schemas/SalaryDeclarationContainer.xsd
@@ -0,0 +1,717 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema
+    targetNamespace="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclarationContainer"
+    xmlns:tns="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclarationContainer"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:sd="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclaration"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified"
+    version="0.0">
+
+    <!-- state of standardisation: draft20050404 (AHV, UVG, Stv und BfS) -->
+    <!-- last modified $Date: 2005/09/15 13:03:25 $Author: boehm $ -->
+
+    <!--
+    Status 2005.08.23
+        -   uvgz, ktg und bvg neu integriert
+
+    -->
+
+    <!-- imports -->
+    <xs:import namespace="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclaration" schemaLocation="SalaryDeclaration.xsd"/>
+
+    <!-- complex types -->
+    <!-- request
+    -->
+    <xs:complexType name="RequestContextType">
+        <xs:sequence>
+            <!-- UserAgent: contains information about the transmitter application -->
+            <xs:element name="UserAgent" type="tns:UserAgentType"/>
+            <!-- LanguageCode -->
+            <xs:element name="CompanyName" type="sd:CompanyNameType"/>
+            <xs:element name="TransmissionDate" type="xs:dateTime">
+                <xs:annotation>
+                    <xs:documentation>Übertragungszeitpunkt</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="RequestID" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>RequestID</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="LanguageCode" type="tns:LanguageCodeType"/>
+            <!-- Company: same structure and content as the element
+SalaryDeclarations/SalaryDeclaration/Company in SalaryDeclaration.xsd -->
+            <!-- date and time of transmission -->
+            <!-- MonitoringID: acts as identyfier for writing and accessing
+monitoring informations in/from a reference application
+(related to testing and certification) -->
+            <xs:element name="TestCase" type="tns:EmptyType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>Testfall</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="MonitoringID" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>MonitoringID</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Comments" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>Bemerkungen</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="SalaryDeclarationRequestType">
+        <xs:sequence>
+            <xs:element name="RequestContext" type="tns:RequestContextType">
+                <xs:annotation>
+                    <xs:documentation>Basisdaten</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Job" type="tns:JobType">
+                <xs:annotation>
+                    <xs:documentation>Auftrag</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <!-- Comments: notes related to transmission-->
+            <!--
+TransmissionMode: contains information about a repeated declaration
+(reason: only substitution in case of acceptence )
+            -->
+            <xs:element name="Substitution" type="tns:SubstitutionType" minOccurs="0"/>
+            <!-- Test: marks a test case without processing by the receiver.
+The response contains a special info -->
+            <!-- SalaryDeclarations: defines the core data structure of a salary
+declartion (without transmission information)-->
+            <xs:element name="SalaryDeclaration" type="sd:SalaryDeclarationType">
+                <xs:annotation>
+                    <xs:documentation>Lohnmeldung</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <!-- the concatination of UserAgent, RequestID und Company are used as unique key -->
+    </xs:complexType>
+    <xs:complexType name="GetStatusFromDeferredDeclarationType">
+        <xs:sequence>
+            <!-- UserAgent: contains information about the transmitter application -->
+            <xs:element name="RequestContext" type="tns:RequestContextType">
+                <xs:annotation>
+                    <xs:documentation>Basisdaten</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="JobKey" type="tns:JobKeyType">
+                <xs:annotation>
+                    <xs:documentation>Eindeutiger Bezeichner für den Job</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="JobType">
+        <xs:annotation>
+            <xs:documentation>Aufgabearten</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="Addressees" type="tns:AddresseeType">
+                <xs:unique name="UVG-LAA-Ctrl">
+                    <xs:selector xpath="tns:UVG-LAA"/>
+                    <xs:field xpath="@InstitutionIDRef"/>
+                </xs:unique>
+            </xs:element>
+            <xs:element name="EndUserNotification" type="tns:UserNotificationType" minOccurs="0"/>
+            <xs:element name="Comments" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>Bemerkungen</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="AddresseeType">
+        <xs:annotation>
+            <xs:documentation>bekannte Empfängerdaten</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="AHV-AVS" type="tns:ControlsType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>AHV-AVS</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVG-LAA" type="tns:ControlsMultiType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>UVG-LAA</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVGZ-LAAC" type="tns:ControlsMultiType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>UVGZ-LAAC</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="KTG-AMC" type="tns:ControlsMultiType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>KTG-AMC</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="BVG-LPP" type="tns:ControlsMultiType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>BVG-LPP</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="FAK-CAF" type="tns:ControlsMultiType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>FAK-CAF</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="CantonalTaxAdministration" type="tns:ControlsType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>Kantonale Steuerverwaltung</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="SwissFederalStatisticalOffice" type="tns:ControlsType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>BfS</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ControlsType">
+        <xs:sequence>
+            <xs:element name="ProcessByDistributor" type="sd:SimpleBooleanType">
+                <xs:annotation>
+                    <xs:documentation>Verarbeitung durch Distributor</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="CCAddressee" type="tns:CarbonCopyAddresseeType" minOccurs="0" maxOccurs="unbounded"  >
+                <xs:annotation>
+                    <xs:documentation>Verarbeitung durch Distributor</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ControlsMultiType">
+        <xs:complexContent>
+            <xs:extension base="tns:ControlsType">
+                <xs:attribute name="InstitutionIDRef" type="sd:InstitutionIDType" use="required"/>
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+    <xs:complexType name="UserNotificationType">
+        <xs:annotation>
+            <xs:documentation>EndBenutzer Benachrichtigung</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="Name" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>Name</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="EmailAddress" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>EmailAdresse</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="PhoneNumber" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>Telefonnummer</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="SubstitutionType">
+        <xs:annotation>
+            <xs:documentation>Ersatzlieferung</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <!-- replaces prior salary declaration transmission -->
+            <xs:element name="PredecessorRequestID" type="xs:string"/>
+            <xs:element name="PredecessorResponseIDWithAcceptedState" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="CarbonCopyAddresseeType">
+        <xs:sequence>
+            <xs:element name="PartnerID" type="xs:string" minOccurs="0" >
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Partneridentifikation</translation>
+                        <description>
+                            <short>Partneridentifikation gemäss seperater Liste</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Name" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Name</translation>
+                        <description>
+                            <short>Name (1. Zeile)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ComplementaryLine" type="xs:string" minOccurs="0" maxOccurs="1">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Zusatzzeile</translation>
+                        <description>
+                            <short>Zusatzzeile für Postadresse (2. Zeile)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Street" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Strasse</translation>
+                        <description>
+                            <short>Strasse und Hausnummer (3. Zeile)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Postbox" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Postfach</translation>
+                        <description>
+                            <short>Postfach (4. Zeile)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="ZIP-Code" type="tns:ZIP-CodeType">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Postleitzahl (PLZ)</translation>
+                        <description>
+                            <short>Postleitzahl (5. Zeile)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="City" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Ort</translation>
+                        <description>
+                            <short>Ort (5. Zeile)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Country" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation xml:lang="de">
+                        <translation>Land</translation>
+                        <description>
+                            <short>Land für Postversand (6. Zeile)</short>
+                        </description>
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:simpleType name="ZIP-CodeType">
+        <xs:annotation>
+            <xs:documentation xml:lang="de">
+                <translation>PLZ Typ</translation>
+                <description>
+                    <short>Postleitzahl</short>
+                </description>
+            </xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:minLength value="4"/>
+            <xs:maxLength value="6"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <!-- response
+    -->
+    <xs:complexType name="ResponseContextType">
+        <xs:sequence>
+            <!-- UserAgent: contains information about the receiver application -->
+            <xs:element name="UserAgent" type="tns:UserAgentType"/>
+            <!-- Social-Insurance-Name: human readable name of the receiving social insurance entity -->
+            <xs:element name="InstitutionName" type="xs:string"/>
+            <!-- date and time of transmission -->
+            <xs:element name="TransmissionDate" type="xs:dateTime"/>
+            <!-- ResponseID: a unique case number associated with a response (generated by receiver) -->
+            <xs:element name="ResponseID" type="xs:string"/>
+            <!-- RequestID: a unique case number associated with a request (generated by transmitter) -->
+            <xs:element name="RequestID" type="xs:string"/>
+            <!-- Completion: contains access information needed to lookup detailled process-information -->
+            <xs:element name="Information" type="tns:AccessInformationType" minOccurs="0"/>
+            <!-- Test: marks a test case without processing by the receiver the response contains a special info -->
+            <xs:element name="TestCase" type="tns:EmptyType" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="AddresseeContextType">
+        <xs:sequence>
+            <!-- UserAgent: contains information about the receiver application -->
+            <xs:element name="UserAgent" type="tns:UserAgentType"/>
+            <!-- Social-Insurance-Name: human readable name of the receiving social insurance entity -->
+            <xs:element name="InstitutionName" type="xs:string"/>
+            <!-- date and time of transmission -->
+            <xs:element name="TransmissionDate" type="xs:dateTime"/>
+            <!-- ResponseID: a unique case number associated with a response (generated by receiver) -->
+            <xs:element name="ResponseID" type="xs:string"/>
+            <!-- RequestID: a unique case number associated with a request (generated by transmitter) -->
+            <xs:element name="RequestID" type="xs:string"/>
+            <!-- Completion: contains access information needed to complete or edit a transmitted salary declaration -->
+            <xs:element name="Completion" type="tns:AccessInformationType" minOccurs="0"/>
+            <!-- Test: marks a test case without processing by the receiver the response contains a special info -->
+            <xs:element name="TestCase" type="tns:EmptyType" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="FaultContextType">
+        <xs:sequence>
+            <!-- UserAgent: contains information about the receiver application -->
+            <xs:element name="UserAgent" type="tns:UserAgentType"/>
+            <!-- Social-Insurance-Name: human readable name of the receiving social insurance entity -->
+            <xs:element name="InstitutionName" type="xs:string"/>
+            <!-- date and time of transmission -->
+            <xs:element name="TransmissionDate" type="xs:dateTime"/>
+            <!-- ResponseID: a unique case number associated with a response (generated by receiver) -->
+            <xs:element name="ResponseID" type="xs:string"/>
+            <!-- RequestID: a unique case number associated with a request (generated by transmitter) -->
+            <xs:element name="RequestID" type="xs:string"/>
+            <!-- Test: marks a test case without processing by the receiver the response contains a special info -->
+            <xs:element name="TestCase" type="tns:EmptyType" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="SalaryDeclarationFaultType">
+        <xs:sequence>
+            <xs:element name="FaultContext" type="tns:FaultContextType"/>
+            <xs:element name="FaultState" type="tns:FaultStateType"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="DeclareSalaryDeferredResponseType">
+        <xs:sequence>
+            <xs:element name="ResponseContext" type="tns:ResponseContextType"/>
+            <xs:element name="JobKey" type="tns:JobKeyType">
+                <xs:annotation>
+                    <xs:documentation>Eindeutiger Bezeichner für den Job</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="SalaryDeclarationStatusResponseType">
+        <xs:sequence>
+            <xs:element name="ResponseContext" type="tns:ResponseContextType"/>
+            <xs:element name="PlausibilityState" type="tns:PlausibilityStateType"/>
+            <xs:element name="JobFinished" type="sd:SimpleBooleanType"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="JobStateType">
+        <xs:annotation>
+            <xs:documentation>Empfängerantworten</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="AHV-AVS" type="tns:WorkingStateType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>AK-Nummer</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVG-LAA" type="tns:WorkingStateMultiType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>UVG-LAA</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="UVGZ-LAAC" type="tns:WorkingStateMultiType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>UVGZ-LAAC</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="KTG-AMC" type="tns:WorkingStateMultiType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>KTG-AMC</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="BVG-LPP" type="tns:WorkingStateMultiType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>BVG-LPP</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="FAK-CAF" type="tns:WorkingStateMultiType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>FAK-CAF</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="CantonalTaxAdministration" type="tns:WorkingStateType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>Kantonale Steuerverwaltung</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="SwissFederalStatisticalOffice" type="tns:WorkingStateType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>BfS</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="WorkingStateType">
+        <xs:annotation>
+            <xs:documentation>Arbeitszustandsdetail</xs:documentation>
+        </xs:annotation>
+        <xs:choice>
+            <xs:element name="Processing" type="tns:EmptyType">
+                <xs:annotation>
+                    <xs:documentation>in verarbeitung</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Delayed" type="tns:DelayedResponseType">
+                <xs:annotation>
+                    <xs:documentation>verarbeitung momentan nicht möglich</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Success" type="tns:SuccessResponseType">
+                <xs:annotation>
+                    <xs:documentation>verbeitung erfolgreich beendet</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Ignored" type="tns:EmptyType">
+                <xs:annotation>
+                    <xs:documentation>Adresse ignoriert</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Error" type="tns:ErrorResponseType">
+                <xs:annotation>
+                    <xs:documentation>verarbeitung ist fehlgeschlagen da empfänger einen fehler gemeldet hat</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:choice>
+    </xs:complexType>
+    <xs:complexType name="WorkingStateMultiType">
+        <xs:annotation>
+            <xs:documentation>Arbeitszustandsdetail</xs:documentation>
+        </xs:annotation>
+        <xs:complexContent>
+            <xs:extension base="tns:WorkingStateType">
+                <xs:attribute name="InstitutionIDRef" type="sd:InstitutionIDType" use="required"/>
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+
+    <xs:complexType name="ErrorResponseType">
+        <xs:annotation>
+            <xs:documentation>Info</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="EndUserInformation" type="xs:string"/>
+            <xs:element name="DetailInformation" type="xs:string" minOccurs="0"/>
+            <xs:element name="FaultInformation" type="tns:SalaryDeclarationFaultType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>Fehlermeldung des Endempfängers</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="DelayedResponseType">
+        <xs:annotation>
+            <xs:documentation>Info</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="EndUserInformation" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="SuccessResponseType">
+        <xs:annotation>
+            <xs:documentation>Allgemeine Antwort</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="AddresseeContext" type="tns:AddresseeContextType"/>
+            <xs:element name="ResponseState" type="tns:ResponseStateType"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ResponseStateType">
+        <xs:annotation>
+            <xs:documentation>Status</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <!-- Code: quality rating code related to a transmitted salary declaration-->
+            <xs:element name="Code" type="tns:ResponseCodeType"/>
+            <!-- Warning: defines the data structure to notify warning messages -->
+            <xs:element name="Warning" type="tns:NotificationsType" minOccurs="0"/>
+            <!-- Info: defines the data structure to notify general messages -->
+            <xs:element name="Info" type="tns:NotificationsType" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="FaultStateType">
+        <xs:annotation>
+            <xs:documentation>Status</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <!-- Code: quality rating code related to a transmitted salary declaration-->
+            <xs:element name="Code" type="tns:FaultCodeType"/>
+            <!-- Error: defines the data structure to notify error messages -->
+            <xs:element name="Error" type="tns:NotificationsType" minOccurs="0"/>
+            <!-- Warning: defines the data structure to notify warning messages -->
+            <xs:element name="Warning" type="tns:NotificationsType" minOccurs="0"/>
+            <!-- Info: defines the data structure to notify general messages -->
+            <xs:element name="Info" type="tns:NotificationsType" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="AccessInformationType">
+        <xs:annotation>
+            <xs:documentation>Zugangsinformationen</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <!-- Url: access url -->
+            <xs:element name="Url" type="xs:string"/>
+            <!-- Key: authentication key -->
+            <xs:element name="Key" type="xs:string"/>
+            <!-- Password: authentication password -->
+            <xs:element name="Password" type="xs:string"/>
+            <!-- ExpiryDate: expiry date of access information -->
+            <xs:element name="ExpiryDate" type="xs:dateTime"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="NotificationsType">
+        <xs:annotation>
+            <xs:documentation>Hinweise</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <!-- Notification: data structure to define messages as
+errors, warnings or general information -->
+            <xs:element name="Notification" type="tns:NotificationType" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="NotificationType">
+        <xs:annotation>
+            <xs:documentation>Hinweise</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <!-- QualityLevel: used to relate a notification to quality levels
+as validation, plausibilisation or acceptance -->
+            <xs:element name="QualityLevel" type="tns:QualityLevelType"/>
+            <!-- DescriptionCode: numerical code related to declared types of
+notifications (errors, warnings, infos) -->
+            <xs:element name="DescriptionCode" type="tns:DescriptionCodeType"/>
+            <!-- Description: human readable content of the notification -->
+            <xs:element name="Description" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+    <!-- response distributor-part -->
+    <xs:complexType name="PlausibilityStateType">
+        <xs:annotation>
+            <xs:documentation>Ditributorzustand</xs:documentation>
+        </xs:annotation>
+        <xs:choice>
+            <xs:element name="ValidityPlausibilityChecking" type="tns:EmptyType">
+                <xs:annotation>
+                    <xs:documentation>Der Distributorhat die Validitäts- und Plausibilitätsprüfung noch nicht abgeschlossen</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="Plausible" type="tns:PlausibleNotificationsType">
+                <xs:annotation>
+                    <xs:documentation>Das übertragene Dokument ist plausibel</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:choice>
+    </xs:complexType>
+    <xs:complexType name="PlausibleNotificationsType">
+        <xs:sequence>
+            <!-- Warning: defines the data structure to notify warning messages -->
+            <xs:element name="Warning" type="tns:NotificationsType" minOccurs="0"/>
+            <!-- Info: defines the data structure to notify general messages -->
+            <xs:element name="Info" type="tns:NotificationsType" minOccurs="0"/>
+            <xs:element name="JobState" type="tns:JobStateType"/>
+        </xs:sequence>
+    </xs:complexType>
+    <!-- shared types -->
+    <xs:complexType name="UserAgentType">
+        <xs:annotation>
+            <xs:documentation>Benutzeragent</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <!-- Producer:  manufacturer of the used application (transmitter or receiver) -->
+            <xs:element name="Producer" type="xs:string"/>
+            <!-- Name: name of the used application -->
+            <xs:element name="Name" type="xs:string"/>
+            <!-- Version: version of the used application -->
+            <xs:element name="Version" type="xs:string"/>
+            <!-- Certificate: certificate of the used application -->
+            <xs:element name="Certificate" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="EmptyType"/>
+    <!-- simple types -->
+    <xs:simpleType name="QualityLevelType">
+        <xs:annotation>
+            <xs:documentation>Gütestufen</xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="Validity"/>
+            <xs:enumeration value="Plausibility"/>
+            <xs:enumeration value="Acceptance"/>
+            <!-- Validity:      first level check -->
+            <!-- Plausibility:  second level check -->
+            <!-- Acceptance:    third level check -->
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="ResponseCodeType">
+        <xs:annotation>
+            <xs:documentation>Antwortcode</xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="accepted"/>
+            <xs:enumeration value="acceptedWithWarning"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="FaultCodeType">
+        <xs:annotation>
+            <xs:documentation>Fehlercode</xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="NOT_accepted"/>
+            <xs:enumeration value="NOT_plausible"/>
+            <xs:enumeration value="NOT_valid"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="DescriptionCodeType">
+        <xs:annotation>
+            <xs:documentation>Beschreibungscode</xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:nonNegativeInteger">
+            <xs:totalDigits value="7"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="LanguageCodeType">
+        <xs:annotation>
+            <xs:documentation>Sprachcode</xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="de"/>
+            <xs:enumeration value="fr"/>
+            <xs:enumeration value="it"/>
+            <xs:enumeration value="en"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="UVG-LAANameType">
+        <xs:annotation>
+            <xs:documentation>UVG Versicherungsname</xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="Suva"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="GovernmentNameType">
+        <xs:annotation>
+            <xs:documentation>Name der Verwaltung</xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="CantonalTaxAdministration"/>
+            <xs:enumeration value="SwissFederalStatisticalOffice"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="JobKeyType">
+        <xs:annotation>
+            <xs:documentation>Eindeutiger Bezeichner für den Job</xs:documentation>
+        </xs:annotation>
+        <xs:restriction base="xs:string">
+            <xs:minLength value="10"/>
+        </xs:restriction>
+    </xs:simpleType>
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation4Schemas/SalaryDeclarationServiceTypes.xsd b/xml/tests/testData/xml/ComplexSchemaValidation4Schemas/SalaryDeclarationServiceTypes.xsd
new file mode 100644
index 0000000..a0853e8
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation4Schemas/SalaryDeclarationServiceTypes.xsd
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified"
+    targetNamespace="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclarationServiceTypes"
+    xmlns:tns="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclarationServiceTypes"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:sd="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclaration"
+    xmlns:ct="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclarationContainer">
+
+    <!-- last modified $Date: 2005/09/05 14:15:30 $Author: boehm $ -->
+    
+    <!-- imports -->
+    <xs:import
+        namespace="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclaration"
+        schemaLocation="SalaryDeclaration.xsd"/>
+
+    <xs:import
+        namespace="http://www.swissdec.ch/schema/sd/20050902/SalaryDeclarationContainer"
+        schemaLocation="SalaryDeclarationContainer.xsd"/>
+
+    <!-- definitions Ping -->
+
+    <xs:element name="Ping" type="tns:PingType"/>
+    <xs:element name="PingResponse" type="tns:PingType"/>
+
+    <xs:complexType name="PingType">
+        <xs:sequence>
+            <xs:element name="Echo" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <!-- definitions CheckInteroperability -->
+    <xs:element name="CheckInteroperability" type="tns:CheckInteroperabilityType"/>
+    <xs:element name="CheckInteroperabilityResponse" type="tns:CheckInteroperabilityResponseType"/>
+
+    <xs:complexType name="CheckInteroperabilityType">
+        <xs:sequence>
+            <!-- use following UmlautString: ÄËÖÜÁÉÓÚÀÈÒÙÂÊÔÛ -->
+            <xs:element name="UmlautString" type="xs:string"/>
+            <!-- use following value for the FirstOperand: 999000000000.00 (999 milliards)-->
+            <!-- verwende folgenden Wert als FirstOperand: 999000000000.00 (999 Milliarden)-->
+            <xs:element name="FirstOperand" type="sd:SalaryAmountType"/>
+            <xs:element name="SecondOperand" type="sd:SalaryAmountType"/>
+            <xs:element name="SystemDateTime" type="xs:dateTime"/>
+            <!-- MonitoringID: acts as identyfier for writing and accessing
+            monitoring informations in/from a reference application
+            (related to testing and certification) -->
+            <xs:element name="MonitoringID" type="xs:string" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="CheckInteroperabilityResponseType">
+        <xs:sequence>
+            <!-- we expect following string as value of UmlautString: äëöüáéóúàèòùâêôû -->
+            <xs:element name="UmlautStringIsCorrect" type="sd:SimpleBooleanType"/>
+            <!-- expected are 999000000000.00 (999 billions) -->
+            <!-- erwartet werden 999000000000.00 (999 Milliarden) -->
+            <xs:element name="FirstOperandIsCorrect" type="sd:SimpleBooleanType"/>
+            <xs:element name="UmlautString" type="xs:string"/>
+            <xs:element name="AdditionResult" type="sd:SalaryAmountType"/>
+            <xs:element name="SubtractionResult" type="sd:SalaryAmountType"/>
+            <xs:element name="SystemDateTime" type="xs:dateTime"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <!-- definitions DeclareSalary -->
+    <xs:element name="DeclareSalary" type="ct:SalaryDeclarationRequestType">
+        <xs:annotation>
+            <xs:documentation>SalaryDeclarationRequest</xs:documentation>
+        </xs:annotation>
+        <xs:unique name="UVG-LAA-ID-Key2">
+            <xs:selector xpath="ct:SalaryDeclaration/sd:Company/sd:Insurances/sd:UVG-LAA/sd:Suva | ct:SalaryDeclaration/sd:Company/sd:Insurances/sd:UVG-LAA/sd:Other"/>
+            <xs:field xpath="@InstitutionID"/>
+        </xs:unique>
+        <xs:keyref name="UVG-LAA-ID-Ref2" refer="tns:UVG-LAA-ID-Key2">
+            <xs:selector xpath="ct:Job/ct:Addressees/ct:UVG-LAA"/>
+            <xs:field xpath="@InstitutionIDRef"/>
+        </xs:keyref>
+        <xs:unique name="UVGZ-LAAC-ID-Key2">
+            <xs:selector xpath="ct:SalaryDeclaration/sd:Company/sd:Insurances/sd:UVGZ-LAAC"/>
+            <xs:field xpath="@InstitutionID"/>
+        </xs:unique>
+        <xs:keyref name="UVGZ-LAAC-ID-Ref2" refer="tns:UVGZ-LAAC-ID-Key2">
+            <xs:selector xpath="ct:Job/ct:Addressees/ct:UVGZ-LAAC"/>
+            <xs:field xpath="@InstitutionIDRef"/>
+        </xs:keyref>
+        <xs:unique name="KTG-AMC-ID-Key2">
+            <xs:selector xpath="ct:SalaryDeclaration/sd:Company/sd:Insurances/sd:KTG-AMC"/>
+            <xs:field xpath="@InstitutionID"/>
+        </xs:unique>
+        <xs:keyref name="KTG-AMC-ID-Ref2" refer="tns:KTG-AMC-ID-Key2">
+            <xs:selector xpath="ct:Job/ct:Addressees/ct:KTG-AMC"/>
+            <xs:field xpath="@InstitutionIDRef"/>
+        </xs:keyref>
+        <xs:unique name="BVG-LPP-ID-Key2">
+            <xs:selector xpath="ct:SalaryDeclaration/sd:Company/sd:Insurances/sd:BVG-LPP"/>
+            <xs:field xpath="@InstitutionID"/>
+        </xs:unique>
+        <xs:keyref name="BVG-LPP-ID-Ref2" refer="tns:BVG-LPP-ID-Key2">
+            <xs:selector xpath="ct:Job/ct:Addressees/ct:BVG-LPP"/>
+            <xs:field xpath="@InstitutionIDRef"/>
+        </xs:keyref>
+        <xs:unique name="FAK-CAF-ID-Key2">
+            <xs:selector xpath="ct:SalaryDeclaration/sd:Company/sd:Insurances/sd:FAK-CAF"/>
+            <xs:field xpath="@InstitutionID"/>
+        </xs:unique>
+        <xs:keyref name="FAK-CAF-ID-Ref2" refer="tns:FAK-CAF-ID-Key2">
+            <xs:selector xpath="ct:Job/ct:Addressees/ct:FAK-CAF"/>
+            <xs:field xpath="@InstitutionIDRef"/>
+        </xs:keyref>
+    </xs:element>
+    <xs:element name="DeclareSalaryResponse" type="ct:SalaryDeclarationStatusResponseType">
+        <xs:annotation>
+            <xs:documentation>GetSalaryDeclarationResponse</xs:documentation>
+        </xs:annotation>
+    </xs:element>
+
+    <!-- definitions DeclareSalaryDeferred -->
+    <xs:element name="DeclareSalaryDeferred" type="ct:SalaryDeclarationRequestType">
+        <xs:annotation>
+            <xs:documentation>SalaryDeclarationRequest</xs:documentation>
+        </xs:annotation>
+        <xs:unique name="UVG-LAA-ID-Key3">
+            <xs:selector xpath="ct:SalaryDeclaration/sd:Company/sd:Insurances/sd:UVG-LAA/sd:Suva | ct:SalaryDeclaration/sd:Company/sd:Insurances/sd:UVG-LAA/sd:Other"/>
+            <xs:field xpath="@InstitutionID"/>
+        </xs:unique>
+        <xs:keyref name="UVG-LAA-ID-Ref3" refer="tns:UVG-LAA-ID-Key3">
+            <xs:selector xpath="ct:Job/ct:Addressees/ct:UVG-LAA"/>
+            <xs:field xpath="@InstitutionIDRef"/>
+        </xs:keyref>
+        <xs:unique name="UVGZ-LAAC-ID-Key3">
+            <xs:selector xpath="ct:SalaryDeclaration/sd:Company/sd:Insurances/sd:UVGZ-LAAC"/>
+            <xs:field xpath="@InstitutionID"/>
+        </xs:unique>
+        <xs:keyref name="UVGZ-LAAC-ID-Ref3" refer="tns:UVGZ-LAAC-ID-Key3">
+            <xs:selector xpath="ct:Job/ct:Addressees/ct:UVGZ-LAAC"/>
+            <xs:field xpath="@InstitutionIDRef"/>
+        </xs:keyref>
+        <xs:unique name="KTG-AMC-ID-Key3">
+            <xs:selector xpath="ct:SalaryDeclaration/sd:Company/sd:Insurances/sd:KTG-AMC"/>
+            <xs:field xpath="@InstitutionID"/>
+        </xs:unique>
+        <xs:keyref name="KTG-AMC-ID-Ref3" refer="tns:KTG-AMC-ID-Key3">
+            <xs:selector xpath="ct:Job/ct:Addressees/ct:KTG-AMC"/>
+            <xs:field xpath="@InstitutionIDRef"/>
+        </xs:keyref>
+        <xs:unique name="BVG-LPP-ID-Key3">
+            <xs:selector xpath="ct:SalaryDeclaration/sd:Company/sd:Insurances/sd:BVG-LPP"/>
+            <xs:field xpath="@InstitutionID"/>
+        </xs:unique>
+        <xs:keyref name="BVG-LPP-ID-Ref3" refer="tns:BVG-LPP-ID-Key3">
+            <xs:selector xpath="ct:Job/ct:Addressees/ct:BVG-LPP"/>
+            <xs:field xpath="@InstitutionIDRef"/>
+        </xs:keyref>
+        <xs:unique name="FAK-CAF-ID-Key3">
+            <xs:selector xpath="ct:SalaryDeclaration/sd:Company/sd:Insurances/sd:FAK-CAF"/>
+            <xs:field xpath="@InstitutionID"/>
+        </xs:unique>
+        <xs:keyref name="FAK-CAF-ID-Ref3" refer="tns:FAK-CAF-ID-Key3">
+            <xs:selector xpath="ct:Job/ct:Addressees/ct:FAK-CAF"/>
+            <xs:field xpath="@InstitutionIDRef"/>
+        </xs:keyref>
+    </xs:element>
+    <xs:element name="DeclareSalaryDeferredResponse" type="ct:DeclareSalaryDeferredResponseType">
+        <xs:annotation>
+            <xs:documentation>SalaryDeclarationResponse</xs:documentation>
+        </xs:annotation>
+    </xs:element>
+
+    <!-- definitions GetStatusFromDeferredDeclaration -->
+    <xs:element name="GetStatusFromDeferredDeclaration" type="ct:GetStatusFromDeferredDeclarationType">
+        <xs:annotation>
+            <xs:documentation>GetSalaryDeclarationRequest</xs:documentation>
+        </xs:annotation>
+    </xs:element>
+    <xs:element name="GetStatusFromDeferredDeclarationResponse" type="ct:SalaryDeclarationStatusResponseType">
+        <xs:annotation>
+            <xs:documentation>GetSalaryDeclarationResponse</xs:documentation>
+        </xs:annotation>
+    </xs:element>
+
+    <!-- definition SalaryDeclarationFault -->
+    <xs:element name="SalaryDeclarationFault" type="ct:SalaryDeclarationFaultType">
+        <xs:annotation>
+            <xs:documentation>SalaryDeclarationFault</xs:documentation>
+        </xs:annotation>
+    </xs:element>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation5.xml b/xml/tests/testData/xml/ComplexSchemaValidation5.xml
new file mode 100644
index 0000000..bd3c5ed
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation5.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<test:Test
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xmlns:test="http://www.etas.com/TELEGY/Test"
+	xsi:schemaLocation="http://www.etas.com/TELEGY/Test ComplexSchemaValidation5.xsd">
+	<FilePropertySet>
+		<FileProperties fpId="200">
+			<FileExtn>.his</FileExtn> 
+		</FileProperties>
+	</FilePropertySet>
+</test:Test>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation5.xsd b/xml/tests/testData/xml/ComplexSchemaValidation5.xsd
new file mode 100644
index 0000000..5e7ed18
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation5.xsd
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+            xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:test="http://www.etas.com/TELEGY/Test"
+            targetNamespace="http://www.etas.com/TELEGY/Test"
+            elementFormDefault="unqualified" attributeFormDefault="unqualified">
+  <!-- Defn for the file properties to be used by the Data config object-->
+  <xsd:complexType name="FileProperties">
+    <xsd:sequence>
+      <xsd:element name="FileExtn">
+        <xsd:simpleType>
+          <xsd:restriction base="xsd:string">
+            <xsd:pattern value="\.{1}[a-zA-Z0-9]{3}"/>
+          </xsd:restriction>
+        </xsd:simpleType>
+      </xsd:element>
+      <!-- Things like close rules, size restrictions could be put here -->
+    </xsd:sequence>
+    <xsd:attribute name="fpId" type="xsd:positiveInteger" use="required"/>
+  </xsd:complexType>
+  <xsd:complexType name="FilePropertySet">
+    <xsd:sequence>
+      <xsd:element name="FileProperties" type="test:FileProperties"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <xsd:element name="Test">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element name="FilePropertySet" type="test:FilePropertySet"/>
+      </xsd:sequence>
+    </xsd:complexType>
+  </xsd:element>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation6.xml b/xml/tests/testData/xml/ComplexSchemaValidation6.xml
new file mode 100644
index 0000000..c671e8d
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation6.xml
@@ -0,0 +1 @@
+<pg:table xmlns:pg="http://abcde/pg.html" pg:name="aaa" />
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation6.xsd b/xml/tests/testData/xml/ComplexSchemaValidation6.xsd
new file mode 100644
index 0000000..82903b3
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation6.xsd
@@ -0,0 +1,12 @@
+<xsd:schema
+    xmlns:pg="http://abcde/pg.html"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://abcde/pg.html"
+    elementFormDefault="qualified"
+    attributeFormDefault="qualified"
+    >
+   <xsd:complexType name="tableType">
+        <xsd:attribute name="name" type="xsd:string" use="required"/>
+    </xsd:complexType>
+   <xsd:element name="table" type="pg:tableType"/>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation7.xml b/xml/tests/testData/xml/ComplexSchemaValidation7.xml
new file mode 100644
index 0000000..3cea3d3
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation7.xml
@@ -0,0 +1,413 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions  xmlns:tns="http://tempuri.org/"
+  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+  xmlns="http://schemas.xmlsoap.org/wsdl/"
+  targetNamespace="http://tempuri.org/">
+ <types>
+  <xsd:schema    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:stns="java:com.bea.medrec.webservices"
+    elementFormDefault="qualified"
+    attributeFormDefault="qualified"
+    targetNamespace="java:com.bea.medrec.webservices">
+   <xsd:import     namespace="http://schemas.xmlsoap.org/soap/encoding/">
+   </xsd:import>
+   <xsd:complexType     name="AddressWS">
+    <xsd:sequence>
+     <xsd:element       type="xsd:string"
+       name="city"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:complexType     name="ArrayOfPatientWS">
+    <xsd:complexContent>
+     <xsd:restriction       xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+       base="soapenc:Array">
+      <xsd:attribute        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        ref="soapenc:arrayType"
+        wsdl:arrayType="stns:PatientWS[]">
+      </xsd:attribute>
+     </xsd:restriction>
+    </xsd:complexContent>
+   </xsd:complexType>
+   <xsd:complexType     name="ArrayOfPrescriptionWS">
+    <xsd:complexContent>
+     <xsd:restriction       xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+       base="soapenc:Array">
+      <xsd:attribute        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        ref="soapenc:arrayType"
+        wsdl:arrayType="stns:PrescriptionWS[]">
+      </xsd:attribute>
+     </xsd:restriction>
+    </xsd:complexContent>
+   </xsd:complexType>
+   <xsd:complexType     name="ArrayOfRecordWS">
+    <xsd:complexContent>
+     <xsd:restriction       xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+       base="soapenc:Array">
+      <xsd:attribute        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        ref="soapenc:arrayType"
+        wsdl:arrayType="stns:RecordWS[]">
+      </xsd:attribute>
+     </xsd:restriction>
+    </xsd:complexContent>
+   </xsd:complexType>
+   <xsd:complexType     name="PatientWS">
+    <xsd:sequence>
+     <xsd:element       type="stns:AddressWS"
+       name="addressWS"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+     <xsd:element       type="xsd:string"
+       name="dateOfBirth"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+     <xsd:element       type="xsd:string"
+       name="email"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+     <xsd:element       type="xsd:string"
+       name="firstName"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+     <xsd:element       type="xsd:string"
+       name="gender"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+     <xsd:element       type="xsd:int"
+       name="id"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+     <xsd:element       type="xsd:string"
+       name="lastName"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+     <xsd:element       type="xsd:string"
+       name="middleName"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+     <xsd:element       type="xsd:string"
+       name="phone"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+     <xsd:element       type="xsd:string"
+       name="ssn"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:complexType     name="PrescriptionWS">
+    <xsd:sequence>
+     <xsd:element       type="xsd:string"
+       name="datePrescribed"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:complexType     name="RecordWS">
+    <xsd:sequence>
+     <xsd:element       type="xsd:string"
+       name="date"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+
+     <xsd:element       type="stns:ArrayOfPrescriptionWS"
+       name="prescriptions"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+     <xsd:element       type="stns:VitalSignsWS"
+       name="vitalSigns"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:complexType     name="RecordsSummaryWS">
+    <xsd:sequence>
+     <xsd:element       type="stns:ArrayOfPrescriptionWS"
+       name="prescriptions"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+     <xsd:element       type="stns:ArrayOfRecordWS"
+       name="records"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:complexType     name="VitalSignsWS">
+    <xsd:sequence>
+     <xsd:element       type="xsd:string"
+       name="bloodPressure"
+       minOccurs="1"
+       nillable="true"
+       maxOccurs="1">
+     </xsd:element>
+    </xsd:sequence>
+   </xsd:complexType>
+  </xsd:schema>
+ </types>
+ <message   name="addRecord">
+  <part    xmlns:partns="java:com.bea.medrec.webservices"
+    type="partns:RecordWS"
+    name="record">
+  </part>
+ </message>
+ <message   name="addRecordResponse">
+ </message>
+ <message   name="getRecord">
+  <part    xmlns:partns="http://www.w3.org/2001/XMLSchema"
+    type="partns:int"
+    name="id">
+  </part>
+ </message>
+ <message   name="getRecordResponse">
+  <part    xmlns:partns="java:com.bea.medrec.webservices"
+    type="partns:RecordWS"
+    name="result">
+  </part>
+ </message>
+ <message   name="getRecordsSummary">
+  <part    xmlns:partns="http://www.w3.org/2001/XMLSchema"
+    type="partns:int"
+    name="id">
+  </part>
+ </message>
+ <message   name="getRecordsSummaryResponse">
+  <part    xmlns:partns="java:com.bea.medrec.webservices"
+    type="partns:RecordsSummaryWS"
+    name="result">
+  </part>
+ </message>
+ <message   name="findPatientByLastNameWild">
+  <part    xmlns:partns="http://www.w3.org/2001/XMLSchema"
+    type="partns:string"
+    name="lastName">
+  </part>
+ </message>
+ <message   name="findPatientByLastNameWildResponse">
+  <part    xmlns:partns="java:com.bea.medrec.webservices"
+    type="partns:ArrayOfPatientWS"
+    name="result">
+  </part>
+ </message>
+ <message   name="findPatientBySsn">
+  <part    xmlns:partns="http://www.w3.org/2001/XMLSchema"
+    type="partns:string"
+    name="id">
+  </part>
+ </message>
+ <message   name="findPatientBySsnResponse">
+  <part    xmlns:partns="java:com.bea.medrec.webservices"
+    type="partns:PatientWS"
+    name="result">
+  </part>
+ </message>
+ <message   name="registerPatient">
+  <part    xmlns:partns="java:com.bea.medrec.webservices"
+    type="partns:PatientWS"
+    name="patient">
+  </part>
+  <part    xmlns:partns="http://www.w3.org/2001/XMLSchema"
+    type="partns:string"
+    name="password">
+  </part>
+ </message>
+ <message   name="registerPatientResponse">
+ </message>
+ <message   name="updatePatient">
+  <part    xmlns:partns="java:com.bea.medrec.webservices"
+    type="partns:PatientWS"
+    name="patient">
+  </part>
+ </message>
+ <message   name="updatePatientResponse">
+ </message>
+ <portType   name="MedRecWebServicesPort">
+  <operation    name="addRecord">
+   <input     message="tns:addRecord">
+   </input>
+   <output     message="tns:addRecordResponse">
+   </output>
+  </operation>
+  <operation    name="getRecord">
+   <input     message="tns:getRecord">
+   </input>
+   <output     message="tns:getRecordResponse">
+   </output>
+  </operation>
+  <operation    name="getRecordsSummary">
+   <input     message="tns:getRecordsSummary">
+   </input>
+   <output     message="tns:getRecordsSummaryResponse">
+   </output>
+  </operation>
+  <operation    name="findPatientByLastNameWild">
+   <input     message="tns:findPatientByLastNameWild">
+   </input>
+   <output     message="tns:findPatientByLastNameWildResponse">
+   </output>
+  </operation>
+  <operation    name="findPatientBySsn">
+   <input     message="tns:findPatientBySsn">
+   </input>
+   <output     message="tns:findPatientBySsnResponse">
+   </output>
+  </operation>
+  <operation    name="registerPatient">
+   <input     message="tns:registerPatient">
+   </input>
+   <output     message="tns:registerPatientResponse">
+   </output>
+  </operation>
+  <operation    name="updatePatient">
+   <input     message="tns:updatePatient">
+   </input>
+   <output     message="tns:updatePatientResponse">
+   </output>
+  </operation>
+ </portType>
+ <binding   type="tns:MedRecWebServicesPort"
+   name="MedRecWebServicesPort">
+  <soap:binding    style="rpc"
+    transport="http://schemas.xmlsoap.org/soap/http"/>
+  <operation    name="addRecord">
+   <soap:operation     style="rpc"
+     soapAction=""/>
+   <input>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </input>
+   <output>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </output>
+  </operation>
+  <operation    name="getRecord">
+   <soap:operation     style="rpc"
+     soapAction=""/>
+   <input>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </input>
+   <output>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </output>
+  </operation>
+  <operation    name="getRecordsSummary">
+   <soap:operation     style="rpc"
+     soapAction=""/>
+   <input>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </input>
+   <output>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </output>
+  </operation>
+  <operation    name="findPatientByLastNameWild">
+   <soap:operation     style="rpc"
+     soapAction=""/>
+   <input>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </input>
+   <output>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </output>
+  </operation>
+  <operation    name="findPatientBySsn">
+   <soap:operation     style="rpc"
+     soapAction=""/>
+   <input>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </input>
+   <output>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </output>
+  </operation>
+  <operation    name="registerPatient">
+   <soap:operation     style="rpc"
+     soapAction=""/>
+   <input>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </input>
+   <output>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </output>
+  </operation>
+  <operation    name="updatePatient">
+   <soap:operation     style="rpc"
+     soapAction=""/>
+   <input>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </input>
+   <output>
+    <soap:body      namespace="http://tempuri.org/"
+      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+      use="encoded"/>
+   </output>
+  </operation>
+ </binding>
+ <service   name="MedRecWebServices">
+  <port    name="MedRecWebServicesPort"
+    binding="tns:MedRecWebServicesPort">
+   <soap:address     location="http://pls.set.the.end.point.address/"/>
+  </port>
+ </service>
+</definitions>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/encoding.xsd b/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/encoding.xsd
new file mode 100644
index 0000000..7f12da6
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/encoding.xsd
@@ -0,0 +1,536 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!-- Schema for the SOAP/1.1 encoding
+
+Portions � 2001 DevelopMentor.
+� 2001 W3C (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.
+
+This document is governed by the W3C Software License [1] as described in the FAQ [2].
+[1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions:
+
+Permission to use, copy, modify, and distribute this software and its documentation, with or without modification,  for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications, that you make:
+
+1.  The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+
+2.  Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, a short notice of the following form (hypertext is preferred, text is permitted) should be used within the body of any redistributed or derivative code: "Copyright � 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/"
+
+3.  Notice of any changes or modifications to the W3C files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+
+Original W3C files; http://www.w3.org/2001/06/soap-encoding
+Changes made:
+     - reverted namespace to http://schemas.xmlsoap.org/soap/encoding/
+     - reverted root to only allow 0 and 1 as lexical values
+	 - removed default value from root attribute declaration
+
+THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
+           targetNamespace="http://schemas.xmlsoap.org/soap/encoding/" >
+
+ <xs:attribute name="root" >
+   <xs:annotation>
+     <xs:documentation>
+	   'root' can be used to distinguish serialization roots from other
+       elements that are present in a serialization but are not roots of
+       a serialized value graph
+	 </xs:documentation>
+   </xs:annotation>
+   <xs:simpleType>
+     <xs:restriction base='xs:boolean'>
+	   <xs:pattern value='0|1' />
+	 </xs:restriction>
+   </xs:simpleType>
+ </xs:attribute>
+
+  <xs:attributeGroup name="commonAttributes" >
+    <xs:annotation>
+	  <xs:documentation>
+	    Attributes common to all elements that function as accessors or
+        represent independent (multi-ref) values.  The href attribute is
+        intended to be used in a manner like CONREF.  That is, the element
+        content should be empty iff the href attribute appears
+	  </xs:documentation>
+	</xs:annotation>
+    <xs:attribute name="id" type="xs:ID" />
+    <xs:attribute name="href" type="xs:anyURI" />
+    <xs:anyAttribute namespace="##other" processContents="lax" />
+  </xs:attributeGroup>
+
+  <!-- Global Attributes.  The following attributes are intended to be usable via qualified attribute names on any complex type referencing them. -->
+
+  <!-- Array attributes. Needed to give the type and dimensions of an array's contents, and the offset for partially-transmitted arrays. -->
+
+  <xs:simpleType name="arrayCoordinate" >
+    <xs:restriction base="xs:string" />
+  </xs:simpleType>
+
+  <xs:attribute name="arrayType" type="xs:string" />
+  <xs:attribute name="offset" type="tns:arrayCoordinate" />
+
+  <xs:attributeGroup name="arrayAttributes" >
+    <xs:attribute ref="tns:arrayType" />
+    <xs:attribute ref="tns:offset" />
+  </xs:attributeGroup>
+
+  <xs:attribute name="position" type="tns:arrayCoordinate" />
+
+  <xs:attributeGroup name="arrayMemberAttributes" >
+    <xs:attribute ref="tns:position" />
+  </xs:attributeGroup>
+
+  <xs:group name="Array" >
+    <xs:sequence>
+      <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
+	</xs:sequence>
+  </xs:group>
+
+  <xs:element name="Array" type="tns:Array" />
+  <xs:complexType name="Array" >
+    <xs:annotation>
+	  <xs:documentation>
+	   'Array' is a complex type for accessors identified by position
+	  </xs:documentation>
+	</xs:annotation>
+    <xs:group ref="tns:Array" minOccurs="0" />
+    <xs:attributeGroup ref="tns:arrayAttributes" />
+    <xs:attributeGroup ref="tns:commonAttributes" />
+  </xs:complexType>
+
+  <!-- 'Struct' is a complex type for accessors identified by name.
+       Constraint: No element may be have the same name as any other,
+       nor may any element have a maxOccurs > 1. -->
+
+  <xs:element name="Struct" type="tns:Struct" />
+
+  <xs:group name="Struct" >
+    <xs:sequence>
+      <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
+	</xs:sequence>
+  </xs:group>
+
+  <xs:complexType name="Struct" >
+    <xs:group ref="tns:Struct" minOccurs="0" />
+    <xs:attributeGroup ref="tns:commonAttributes"/>
+  </xs:complexType>
+
+  <!-- 'Base64' can be used to serialize binary data using base64 encoding
+       as defined in RFC2045 but without the MIME line length limitation. -->
+
+  <xs:simpleType name="base64" >
+    <xs:restriction base="xs:base64Binary" />
+  </xs:simpleType>
+
+ <!-- Element declarations corresponding to each of the simple types in the
+      XML Schemas Specification. -->
+
+  <xs:element name="duration" type="tns:duration" />
+  <xs:complexType name="duration" >
+    <xs:simpleContent>
+      <xs:extension base="xs:duration" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="dateTime" type="tns:dateTime" />
+  <xs:complexType name="dateTime" >
+    <xs:simpleContent>
+      <xs:extension base="xs:dateTime" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+
+
+  <xs:element name="NOTATION" type="tns:NOTATION" />
+  <xs:complexType name="NOTATION" >
+    <xs:simpleContent>
+      <xs:extension base="xs:QName" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+
+  <xs:element name="time" type="tns:time" />
+  <xs:complexType name="time" >
+    <xs:simpleContent>
+      <xs:extension base="xs:time" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="date" type="tns:date" />
+  <xs:complexType name="date" >
+    <xs:simpleContent>
+      <xs:extension base="xs:date" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="gYearMonth" type="tns:gYearMonth" />
+  <xs:complexType name="gYearMonth" >
+    <xs:simpleContent>
+      <xs:extension base="xs:gYearMonth" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="gYear" type="tns:gYear" />
+  <xs:complexType name="gYear" >
+    <xs:simpleContent>
+      <xs:extension base="xs:gYear" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="gMonthDay" type="tns:gMonthDay" />
+  <xs:complexType name="gMonthDay" >
+    <xs:simpleContent>
+      <xs:extension base="xs:gMonthDay" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="gDay" type="tns:gDay" />
+  <xs:complexType name="gDay" >
+    <xs:simpleContent>
+      <xs:extension base="xs:gDay" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="gMonth" type="tns:gMonth" />
+  <xs:complexType name="gMonth" >
+    <xs:simpleContent>
+      <xs:extension base="xs:gMonth" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="boolean" type="tns:boolean" />
+  <xs:complexType name="boolean" >
+    <xs:simpleContent>
+      <xs:extension base="xs:boolean" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="base64Binary" type="tns:base64Binary" />
+  <xs:complexType name="base64Binary" >
+    <xs:simpleContent>
+      <xs:extension base="xs:base64Binary" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="hexBinary" type="tns:hexBinary" />
+  <xs:complexType name="hexBinary" >
+    <xs:simpleContent>
+     <xs:extension base="xs:hexBinary" >
+       <xs:attributeGroup ref="tns:commonAttributes" />
+     </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="float" type="tns:float" />
+  <xs:complexType name="float" >
+    <xs:simpleContent>
+      <xs:extension base="xs:float" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="double" type="tns:double" />
+  <xs:complexType name="double" >
+    <xs:simpleContent>
+      <xs:extension base="xs:double" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="anyURI" type="tns:anyURI" />
+  <xs:complexType name="anyURI" >
+    <xs:simpleContent>
+      <xs:extension base="xs:anyURI" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="QName" type="tns:QName" />
+  <xs:complexType name="QName" >
+    <xs:simpleContent>
+      <xs:extension base="xs:QName" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+
+  <xs:element name="string" type="tns:string" />
+  <xs:complexType name="string" >
+    <xs:simpleContent>
+      <xs:extension base="xs:string" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="normalizedString" type="tns:normalizedString" />
+  <xs:complexType name="normalizedString" >
+    <xs:simpleContent>
+      <xs:extension base="xs:normalizedString" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="token" type="tns:token" />
+  <xs:complexType name="token" >
+    <xs:simpleContent>
+      <xs:extension base="xs:token" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="language" type="tns:language" />
+  <xs:complexType name="language" >
+    <xs:simpleContent>
+      <xs:extension base="xs:language" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="Name" type="tns:Name" />
+  <xs:complexType name="Name" >
+    <xs:simpleContent>
+      <xs:extension base="xs:Name" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="NMTOKEN" type="tns:NMTOKEN" />
+  <xs:complexType name="NMTOKEN" >
+    <xs:simpleContent>
+      <xs:extension base="xs:NMTOKEN" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="NCName" type="tns:NCName" />
+  <xs:complexType name="NCName" >
+    <xs:simpleContent>
+      <xs:extension base="xs:NCName" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="NMTOKENS" type="tns:NMTOKENS" />
+  <xs:complexType name="NMTOKENS" >
+    <xs:simpleContent>
+      <xs:extension base="xs:NMTOKENS" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="ID" type="tns:ID" />
+  <xs:complexType name="ID" >
+    <xs:simpleContent>
+      <xs:extension base="xs:ID" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="IDREF" type="tns:IDREF" />
+  <xs:complexType name="IDREF" >
+    <xs:simpleContent>
+      <xs:extension base="xs:IDREF" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="ENTITY" type="tns:ENTITY" />
+  <xs:complexType name="ENTITY" >
+    <xs:simpleContent>
+      <xs:extension base="xs:ENTITY" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="IDREFS" type="tns:IDREFS" />
+  <xs:complexType name="IDREFS" >
+    <xs:simpleContent>
+      <xs:extension base="xs:IDREFS" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="ENTITIES" type="tns:ENTITIES" />
+  <xs:complexType name="ENTITIES" >
+    <xs:simpleContent>
+      <xs:extension base="xs:ENTITIES" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="decimal" type="tns:decimal" />
+  <xs:complexType name="decimal" >
+    <xs:simpleContent>
+      <xs:extension base="xs:decimal" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="integer" type="tns:integer" />
+  <xs:complexType name="integer" >
+    <xs:simpleContent>
+      <xs:extension base="xs:integer" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="nonPositiveInteger" type="tns:nonPositiveInteger" />
+  <xs:complexType name="nonPositiveInteger" >
+    <xs:simpleContent>
+      <xs:extension base="xs:nonPositiveInteger" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="negativeInteger" type="tns:negativeInteger" />
+  <xs:complexType name="negativeInteger" >
+    <xs:simpleContent>
+      <xs:extension base="xs:negativeInteger" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="long" type="tns:long" />
+  <xs:complexType name="long" >
+    <xs:simpleContent>
+      <xs:extension base="xs:long" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="int" type="tns:int" />
+  <xs:complexType name="int" >
+    <xs:simpleContent>
+      <xs:extension base="xs:int" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="short" type="tns:short" />
+  <xs:complexType name="short" >
+    <xs:simpleContent>
+      <xs:extension base="xs:short" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="byte" type="tns:byte" />
+  <xs:complexType name="byte" >
+    <xs:simpleContent>
+      <xs:extension base="xs:byte" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="nonNegativeInteger" type="tns:nonNegativeInteger" />
+  <xs:complexType name="nonNegativeInteger" >
+    <xs:simpleContent>
+      <xs:extension base="xs:nonNegativeInteger" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="unsignedLong" type="tns:unsignedLong" />
+  <xs:complexType name="unsignedLong" >
+    <xs:simpleContent>
+      <xs:extension base="xs:unsignedLong" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="unsignedInt" type="tns:unsignedInt" />
+  <xs:complexType name="unsignedInt" >
+    <xs:simpleContent>
+      <xs:extension base="xs:unsignedInt" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="unsignedShort" type="tns:unsignedShort" />
+  <xs:complexType name="unsignedShort" >
+    <xs:simpleContent>
+      <xs:extension base="xs:unsignedShort" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="unsignedByte" type="tns:unsignedByte" />
+  <xs:complexType name="unsignedByte" >
+    <xs:simpleContent>
+      <xs:extension base="xs:unsignedByte" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="positiveInteger" type="tns:positiveInteger" />
+  <xs:complexType name="positiveInteger" >
+    <xs:simpleContent>
+      <xs:extension base="xs:positiveInteger" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="anyType" />
+</xs:schema>
+
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/http.xsd b/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/http.xsd
new file mode 100644
index 0000000..702f76d
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/http.xsd
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
+Copyright 2001 - 2005, International Business Machines Corporation and Microsoft Corporation
+All Rights Reserved
+
+License for WSDL Schema Files
+
+The Authors grant permission to copy and distribute the WSDL Schema
+Files in any medium without fee or royalty as long as this notice and
+license are distributed with them.  The originals of these files can
+be located at:
+
+http://schemas.xmlsoap.org/wsdl/http/wsdl-http.xsd
+
+THESE SCHEMA FILES ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS
+OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THESE FILES, INCLUDING, BUT NOT
+LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE.  THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT,
+INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR
+RELATING TO ANY USE OR DISTRIBUTION OF THESE FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner,
+including advertising or publicity pertaining to these files or any program
+or service that uses these files, written prior permission.  Title to copyright
+in these files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+
+
+  -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        targetNamespace="http://schemas.xmlsoap.org/wsdl/http/">
+
+	<import namespace = "http://schemas.xmlsoap.org/wsdl/"/>
+
+   	<element name="address" type="http:addressType"/>
+
+   	<complexType name="addressType">
+		<complexContent>
+		<extension base="wsdl:tExtensibilityElement">
+			<sequence/>
+   			<attribute name="location" type="anyURI" use="required"/>
+		</extension>
+		</complexContent>
+   	</complexType>
+
+   	<element name="binding" type="http:bindingType"/>
+   	<complexType name="bindingType">
+		<complexContent>
+		<extension base="wsdl:tExtensibilityElement">
+			<sequence/>
+	      		<attribute name="verb" type="NMTOKEN" use="required"/>
+		</extension>
+		</complexContent>
+   	</complexType>
+
+   	<element name="operation" type="http:operationType"/>
+   	<complexType name="operationType">
+		<complexContent>
+		<extension base="wsdl:tExtensibilityElement">
+			<sequence/>
+	      		<attribute name="location" type="anyURI" use="required"/>
+		</extension>
+		</complexContent>
+	</complexType>
+
+   	<element name="urlEncoded">
+      		<complexType/>
+   	</element>
+   	<element name="urlReplacement">
+      		<complexType/>
+     	</element>
+</schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/mime.xsd b/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/mime.xsd
new file mode 100644
index 0000000..18bbd152
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/mime.xsd
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
+Copyright 2001-2005, International Business Machines Corporation and Microsoft Corporation
+All Rights Reserved
+
+License for WSDL Schema Files
+
+The Authors grant permission to copy and distribute the WSDL Schema
+Files in any medium without fee or royalty as long as this notice and
+license are distributed with them.  The originals of these files can
+be located at:
+
+http://schemas.xmlsoap.org/wsdl/mime/2002-01-29.xsd
+
+THESE SCHEMA FILES ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS
+OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THESE FILES, INCLUDING, BUT NOT
+LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE.  THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT,
+INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR
+RELATING TO ANY USE OR DISTRIBUTION OF THESE FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner,
+including advertising or publicity pertaining to these files or any program
+or service that uses these files, written prior permission.  Title to copyright
+in these files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+
+  -->
+<schema  targetNamespace="http://schemas.xmlsoap.org/wsdl/mime/"
+         xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+	 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+         xmlns="http://www.w3.org/2001/XMLSchema">
+
+	<import namespace = "http://schemas.xmlsoap.org/wsdl/"/>
+   	<element name="content" type="mime:contentType"/>
+   	<complexType name="contentType">
+		<complexContent>
+		<extension base="wsdl:tExtensibilityElement">
+			<sequence/>
+      			<attribute name="type" type="string" use="optional"/>
+	      		<attribute name="part" type="NMTOKEN" use="optional"/>
+		</extension>
+		</complexContent>
+   	</complexType>
+   	<element name="multipartRelated" type="mime:multipartRelatedType"/>
+   	<complexType name="multipartRelatedType">
+		<complexContent>
+		<extension base="wsdl:tExtensibilityElement">
+			<sequence>
+		      		<element name = "part" type = "mime:tPart" minOccurs="0" maxOccurs="unbounded"/>
+			</sequence>
+		</extension>
+		</complexContent>
+   	</complexType>
+      	<complexType name="tPart">
+		<sequence>
+	      		<any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+        	<attribute name="name" type="NMTOKEN" use="required"/>
+   	</complexType>
+   	<element name="mimeXml" type = "mime:tMimeXml"/>
+   	<complexType name="tMimeXml">
+		<complexContent>
+		<extension base="wsdl:tExtensibilityElement">
+			<sequence/>
+			<attribute name="part" type="NMTOKEN" use="optional"/>
+		</extension>
+		</complexContent>
+   	</complexType>
+</schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/soap.xsd b/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/soap.xsd
new file mode 100644
index 0000000..da303eb
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/soap.xsd
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
+Copyright 2001 - 2005, International Business Machines Corporation and Microsoft Corporation
+All Rights Reserved
+
+License for WSDL Schema Files
+
+The Authors grant permission to copy and distribute the WSDL Schema
+Files in any medium without fee or royalty as long as this notice and
+license are distributed with them.  The originals of these files can
+be located at:
+
+http://schemas.xmlsoap.org/wsdl/soap/2003-02-11.xsd
+
+THESE SCHEMA FILES ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS
+OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THESE FILES, INCLUDING, BUT NOT
+LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE.  THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT,
+INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR
+RELATING TO ANY USE OR DISTRIBUTION OF THESE FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner,
+including advertising or publicity pertaining to these files or any program
+or service that uses these files, written prior permission.  Title to copyright
+in these files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+           xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+           targetNamespace="http://schemas.xmlsoap.org/wsdl/soap/" >
+
+  <xs:import namespace = "http://schemas.xmlsoap.org/wsdl/" />
+
+  <xs:simpleType name="encodingStyle" >
+    <xs:annotation>
+      <xs:documentation>
+      "encodingStyle" indicates any canonicalization conventions followed in the contents of the containing element.  For example, the value "http://schemas.xmlsoap.org/soap/encoding/" indicates the pattern described in SOAP specification
+      </xs:documentation>
+    </xs:annotation>
+    <xs:list itemType="xs:anyURI" />
+  </xs:simpleType>
+
+  <xs:element name="binding" type="soap:tBinding" />
+  <xs:complexType name="tBinding" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibilityElement" >
+        <xs:attribute name="transport" type="xs:anyURI" use="required" />
+        <xs:attribute name="style" type="soap:tStyleChoice" use="optional" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:simpleType name="tStyleChoice" >
+    <xs:restriction base="xs:string" >
+      <xs:enumeration value="rpc" />
+      <xs:enumeration value="document" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="operation" type="soap:tOperation" />
+  <xs:complexType name="tOperation" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibilityElement" >
+        <xs:attribute name="soapAction" type="xs:anyURI" use="optional" />
+        <xs:attribute name="style" type="soap:tStyleChoice" use="optional" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:element name="body" type="soap:tBody" />
+  <xs:attributeGroup name="tBodyAttributes" >
+    <xs:attribute name="encodingStyle" type="soap:encodingStyle" use="optional" />
+    <xs:attribute name="use" type="soap:useChoice" use="optional" />
+    <xs:attribute name="namespace" type="xs:anyURI" use="optional" />
+  </xs:attributeGroup>
+  <xs:complexType name="tBody" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibilityElement" >
+        <xs:attribute name="parts" type="xs:NMTOKENS" use="optional" />
+        <xs:attributeGroup ref = "soap:tBodyAttributes" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:simpleType name="useChoice" >
+    <xs:restriction base="xs:string" >
+      <xs:enumeration value="literal" />
+      <xs:enumeration value="encoded" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="fault" type="soap:tFault" />
+  <xs:complexType name="tFaultRes" abstract="true" >
+    <xs:complexContent>
+      <xs:restriction base="soap:tBody" >
+	    <xs:attribute ref="wsdl:required" use="optional" />
+        <xs:attribute name="parts" type="xs:NMTOKENS" use="prohibited" />
+		<xs:attributeGroup ref="soap:tBodyAttributes" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:complexType name="tFault" >
+    <xs:complexContent>
+      <xs:extension base="soap:tFaultRes">
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+
+  <xs:element name="header" type="soap:tHeader" />
+  <xs:attributeGroup name="tHeaderAttributes" >
+    <xs:attribute name="message" type="xs:QName" use="required" />
+    <xs:attribute name="part" type="xs:NMTOKEN" use="required" />
+    <xs:attribute name="use" type="soap:useChoice" use="required" />
+    <xs:attribute name="encodingStyle" type="soap:encodingStyle" use="optional" />
+    <xs:attribute name="namespace" type="xs:anyURI" use="optional" />
+  </xs:attributeGroup>
+  <xs:complexType name="tHeader" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibilityElement" >
+        <xs:sequence>
+          <xs:element ref="soap:headerfault" minOccurs="0" maxOccurs="unbounded" />
+        </xs:sequence>
+		<xs:attributeGroup ref="soap:tHeaderAttributes" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:element name="headerfault" type="soap:tHeaderFault" />
+  <xs:complexType name="tHeaderFault" >
+	<xs:attributeGroup ref="soap:tHeaderAttributes" />
+  </xs:complexType>
+
+  <xs:element name="address" type="soap:tAddress" />
+  <xs:complexType name="tAddress" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibilityElement" >
+        <xs:attribute name="location" type="xs:anyURI" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/wsdl.xsd b/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/wsdl.xsd
new file mode 100644
index 0000000..5d6593d
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation7Schemas/wsdl.xsd
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
+Copyright 2001 - 2005, International Business Machines Corporation and Microsoft Corporation
+All Rights Reserved
+
+License for WSDL Schema Files
+
+The Authors grant permission to copy and distribute the WSDL Schema
+Files in any medium without fee or royalty as long as this notice and
+license are distributed with them.  The originals of these files can
+be located at:
+
+http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd
+
+THESE SCHEMA FILES ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS
+OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THESE FILES, INCLUDING, BUT NOT
+LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE.  THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT,
+INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR
+RELATING TO ANY USE OR DISTRIBUTION OF THESE FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner,
+including advertising or publicity pertaining to these files or any program
+or service that uses these files, written prior permission.  Title to copyright
+in these files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+           targetNamespace="http://schemas.xmlsoap.org/wsdl/"
+           elementFormDefault="qualified" >
+
+  <xs:complexType mixed="true" name="tDocumentation" >
+    <xs:sequence>
+      <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="tDocumented" >
+    <xs:annotation>
+      <xs:documentation>
+      This type is extended by  component types to allow them to be documented
+      </xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="documentation" type="wsdl:tDocumentation" minOccurs="0" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="tExtensibleAttributesDocumented" abstract="true" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tDocumented" >
+        <xs:annotation>
+          <xs:documentation>
+          This type is extended by component types to allow attributes from other namespaces to be added.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:anyAttribute namespace="##other" processContents="lax" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tExtensibleDocumented" abstract="true" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tDocumented" >
+        <xs:annotation>
+          <xs:documentation>
+          This type is extended by component types to allow elements from other namespaces to be added.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+          <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
+        </xs:sequence>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:element name="definitions" type="wsdl:tDefinitions" >
+    <xs:key name="message" >
+      <xs:selector xpath="wsdl:message" />
+      <xs:field xpath="@name" />
+    </xs:key>
+    <xs:key name="portType" >
+      <xs:selector xpath="wsdl:portType" />
+      <xs:field xpath="@name" />
+    </xs:key>
+    <xs:key name="binding" >
+      <xs:selector xpath="wsdl:binding" />
+      <xs:field xpath="@name" />
+    </xs:key>
+    <xs:key name="service" >
+      <xs:selector xpath="wsdl:service" />
+      <xs:field xpath="@name" />
+    </xs:key>
+    <xs:key name="import" >
+      <xs:selector xpath="wsdl:import" />
+      <xs:field xpath="@namespace" />
+    </xs:key>
+  </xs:element>
+
+  <xs:group name="anyTopLevelOptionalElement" >
+    <xs:annotation>
+      <xs:documentation>
+      Any top level optional element allowed to appear more then once - any child of definitions element except wsdl:types. Any extensibility element is allowed in any place.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:element name="import" type="wsdl:tImport" />
+      <xs:element name="types" type="wsdl:tTypes" />
+      <xs:element name="message"  type="wsdl:tMessage" >
+        <xs:unique name="part" >
+          <xs:selector xpath="wsdl:part" />
+          <xs:field xpath="@name" />
+        </xs:unique>
+      </xs:element>
+      <xs:element name="portType" type="wsdl:tPortType" />
+      <xs:element name="binding"  type="wsdl:tBinding" />
+      <xs:element name="service"  type="wsdl:tService" >
+        <xs:unique name="port" >
+          <xs:selector xpath="wsdl:port" />
+          <xs:field xpath="@name" />
+        </xs:unique>
+	  </xs:element>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="tDefinitions" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:sequence>
+          <xs:group ref="wsdl:anyTopLevelOptionalElement"  minOccurs="0"   maxOccurs="unbounded" />
+        </xs:sequence>
+        <xs:attribute name="targetNamespace" type="xs:anyURI" use="optional" />
+        <xs:attribute name="name" type="xs:NCName" use="optional" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tImport" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
+        <xs:attribute name="namespace" type="xs:anyURI" use="required" />
+        <xs:attribute name="location" type="xs:anyURI" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tTypes" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" />
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tMessage" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:sequence>
+          <xs:element name="part" type="wsdl:tPart" minOccurs="0" maxOccurs="unbounded" />
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tPart" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+        <xs:attribute name="element" type="xs:QName" use="optional" />
+        <xs:attribute name="type" type="xs:QName" use="optional" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tPortType" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
+        <xs:sequence>
+          <xs:element name="operation" type="wsdl:tOperation" minOccurs="0" maxOccurs="unbounded" />
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tOperation" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+	    <xs:sequence>
+          <xs:choice>
+            <xs:group ref="wsdl:request-response-or-one-way-operation" />
+            <xs:group ref="wsdl:solicit-response-or-notification-operation" />
+          </xs:choice>
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+        <xs:attribute name="parameterOrder" type="xs:NMTOKENS" use="optional" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:group name="request-response-or-one-way-operation" >
+    <xs:sequence>
+      <xs:element name="input" type="wsdl:tParam" />
+	  <xs:sequence minOccurs='0' >
+	    <xs:element name="output" type="wsdl:tParam" />
+		<xs:element name="fault" type="wsdl:tFault" minOccurs="0" maxOccurs="unbounded" />
+      </xs:sequence>
+    </xs:sequence>
+  </xs:group>
+
+  <xs:group name="solicit-response-or-notification-operation" >
+    <xs:sequence>
+      <xs:element name="output" type="wsdl:tParam" />
+	  <xs:sequence minOccurs='0' >
+	    <xs:element name="input" type="wsdl:tParam" />
+		<xs:element name="fault" type="wsdl:tFault" minOccurs="0" maxOccurs="unbounded" />
+	  </xs:sequence>
+    </xs:sequence>
+  </xs:group>
+
+  <xs:complexType name="tParam" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
+        <xs:attribute name="name" type="xs:NCName" use="optional" />
+        <xs:attribute name="message" type="xs:QName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tFault" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
+        <xs:attribute name="name" type="xs:NCName"  use="required" />
+        <xs:attribute name="message" type="xs:QName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tBinding" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:sequence>
+          <xs:element name="operation" type="wsdl:tBindingOperation" minOccurs="0" maxOccurs="unbounded" />
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+        <xs:attribute name="type" type="xs:QName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tBindingOperationMessage" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:attribute name="name" type="xs:NCName" use="optional" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tBindingOperationFault" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tBindingOperation" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:sequence>
+          <xs:element name="input" type="wsdl:tBindingOperationMessage" minOccurs="0" />
+          <xs:element name="output" type="wsdl:tBindingOperationMessage" minOccurs="0" />
+          <xs:element name="fault" type="wsdl:tBindingOperationFault" minOccurs="0" maxOccurs="unbounded" />
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tService" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:sequence>
+          <xs:element name="port" type="wsdl:tPort" minOccurs="0" maxOccurs="unbounded" />
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tPort" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+        <xs:attribute name="binding" type="xs:QName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:attribute name="arrayType" type="xs:string" />
+  <xs:attribute name="required" type="xs:boolean" />
+  <xs:complexType name="tExtensibilityElement" abstract="true" >
+    <xs:attribute ref="wsdl:required" use="optional" />
+  </xs:complexType>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation7_.xml b/xml/tests/testData/xml/ComplexSchemaValidation7_.xml
new file mode 100644
index 0000000..65ac258
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation7_.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://any.company.com/bsaiptv"
+                  xmlns:tns="http://any.company.com/bsaiptv"
+                  xmlns:aia="http://any.company.com/adapter"
+                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+                  xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                  xsi:schemaLocation="http://any.company.com/adapter ComplexSchemaValidation7_.xsd">
+
+    <wsdl:import namespace="http://any.company.com/adapter" location="ComplexSchemaValidation7_.xsd"/>
+
+    <!-- execute -->
+    <wsdl:message name="executeServicesRequest">
+        <wsdl:part element="aia:executeServicesRequest" name="parameters"/>
+    </wsdl:message>
+    <wsdl:message name="executeServicesResponse">
+        <wsdl:part element="aia:executeServicesResponse" name="parameters"/>
+    </wsdl:message>
+    <wsdl:message name="executeServicesException">
+        <wsdl:part element="aia:executeServicesException" name="parameters"/>
+    </wsdl:message>
+
+    <wsdl:portType name="BsaIpTvPortType">
+        <!-- execute -->
+        <wsdl:operation name="executeServices" parameterOrder="executeServicesRequest">
+            <wsdl:input message="tns:executeServicesRequest" name="executeServicesRequest"/>
+            <wsdl:output message="tns:executeServicesResponse" name="executeServicesResponse"/>
+            <wsdl:fault message="tns:executeServicesException" name="executeServicesException"/>
+        </wsdl:operation>
+    </wsdl:portType>
+
+
+    <wsdl:binding name="BsaIpTvBinding" type="tns:BsaIpTvPortType">
+
+        <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+        <!-- execute -->
+        <wsdl:operation name="executeServices">
+            <wsdlsoap:operation soapAction=""/>
+            <wsdl:input name="executeServicesRequest">
+                <wsdlsoap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="executeServicesResponse">
+                <wsdlsoap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="executeServicesException">
+                <wsdlsoap:fault name="executeServicesException" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+
+    <wsdl:service name="BsaIpTvService">
+        <wsdl:port binding="tns:BsaIpTvBinding" name="BsaIpTvPortType">
+            <wsdlsoap:address location="http://localhost:8080/bsa-iptv/services/BsaIpTvService"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation7_.xsd b/xml/tests/testData/xml/ComplexSchemaValidation7_.xsd
new file mode 100644
index 0000000..c580858
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation7_.xsd
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:aia="http://any.company.com/adapter"
+        targetNamespace="http://any.company.com/adapter"
+        elementFormDefault="qualified"
+        version="v1-0">
+
+    <element name="executeServicesRequest">
+        <complexType>
+            <sequence>
+                <element name="description" type="string" nillable="true" minOccurs="0"/>
+                <element name="command" type="string" nillable="true"/>
+                <element name="refId" type="string" nillable="true"/>
+            </sequence>
+        </complexType>
+    </element>
+    <element name="executeServicesResponse">
+        <complexType>
+            <sequence/>
+        </complexType>
+    </element>
+    <element name="executeServicesException">
+        <complexType>
+            <choice>
+                <element name="executeException" type="aia:ExecuteException"/>
+            </choice>
+        </complexType>
+    </element>
+    <complexType name="ExecuteException">
+        <sequence>
+            <element name="message" type="string">
+            </element>
+        </sequence>
+    </complexType>
+</schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation7_2.xml b/xml/tests/testData/xml/ComplexSchemaValidation7_2.xml
new file mode 100644
index 0000000..3063863
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation7_2.xml
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions
+	xmlns:tns="http://www.themindelectric.com/wsdl/Country/"
+	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+	xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+	xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+	xmlns:mxsmisc="http://www.themindelectric.com/package/com.marketxs.soap.misc/"
+	xmlns:mxsutil="http://www.themindelectric.com/package/com.marketxs.soap.util/"
+	name="Country" targetNamespace="http://www.themindelectric.com/wsdl/Country/">
+    <wsdl:documentation>
+        The Country service provides access to all countries and regions. Each country is connected to one region.
+    </wsdl:documentation>
+  <wsdl:types>
+    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.themindelectric.com/package/com.marketxs.soap.util/">
+      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+      <xsd:complexType name="DataWrapper" abstract="true">
+        <xsd:sequence/>
+      </xsd:complexType>
+    </xsd:schema>
+    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.themindelectric.com/package/com.marketxs.soap.misc/">
+      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+      <xsd:import namespace="http://www.themindelectric.com/package/com.marketxs.soap.util/"/>
+        <xsd:complexType name="RegionData">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Data object representing a region, such as a continent.
+                </xsd:documentation>
+            </xsd:annotation>
+          <xsd:complexContent>
+            <xsd:extension base="mxsutil:DataWrapper">
+              <xsd:sequence>
+                <xsd:element name="regionId" type="xsd:long"/>
+                <xsd:element name="regionName" nillable="true" type="xsd:string"/>
+              </xsd:sequence>
+            </xsd:extension>
+          </xsd:complexContent>
+        </xsd:complexType>
+      <xsd:complexType name="CountryData">
+          <xsd:annotation>
+              <xsd:documentation>
+                  Data object representing a country.
+              </xsd:documentation>
+          </xsd:annotation>
+        <xsd:complexContent>
+          <xsd:extension base="mxsmisc:RegionData">
+            <xsd:sequence>
+              <xsd:element name="currencyId" type="xsd:long"/>
+              <xsd:element name="countryId" type="xsd:long"/>
+              <xsd:element name="countryName" nillable="true" type="xsd:string"/>
+              <xsd:element name="isoCode" nillable="true" type="xsd:string"/>
+            </xsd:sequence>
+          </xsd:extension>
+        </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="ArrayOfCountryData">
+        <xsd:complexContent>
+          <xsd:restriction base="soapenc:Array">
+            <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="mxsmisc:CountryData[]"/>
+          </xsd:restriction>
+        </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="ArrayOfRegionData">
+        <xsd:complexContent>
+          <xsd:restriction base="soapenc:Array">
+            <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="mxsmisc:RegionData[]"/>
+          </xsd:restriction>
+        </xsd:complexContent>
+      </xsd:complexType>
+      <xsd:complexType name="CountryException">
+          <xsd:sequence>
+              <xsd:element name="message" nillable="true" type="xsd:string"/>
+          </xsd:sequence>
+      </xsd:complexType>
+    </xsd:schema>
+  </wsdl:types>
+    <wsdl:message name="CountryException">
+        <wsdl:part name="fault" type="mxsmisc:CountryException"/>
+    </wsdl:message>
+  <wsdl:message name="getCountry0In">
+      <wsdl:documentation>org0 countryId the country's primary key.</wsdl:documentation>
+    <wsdl:part name="arg0" type="xsd:long"/>
+  </wsdl:message>
+  <wsdl:message name="getCountry0Out">
+    <wsdl:part name="Result" type="mxsmisc:CountryData"/>
+  </wsdl:message>
+  <wsdl:message name="getCountries1In"/>
+  <wsdl:message name="getCountries1Out">
+    <wsdl:part name="Result" type="mxsmisc:ArrayOfCountryData"/>
+  </wsdl:message>
+  <wsdl:message name="getRegion2In">
+      <wsdl:documentation>arg0 regionId the region's primary key.</wsdl:documentation>
+    <wsdl:part name="arg0" type="xsd:long"/>
+  </wsdl:message>
+  <wsdl:message name="getRegion2Out">
+    <wsdl:part name="Result" type="mxsmisc:RegionData"/>
+  </wsdl:message>
+  <wsdl:message name="getRegions3In"/>
+  <wsdl:message name="getRegions3Out">
+    <wsdl:part name="Result" type="mxsmisc:ArrayOfRegionData"/>
+  </wsdl:message>
+  <wsdl:portType name="Country">
+    <wsdl:operation name="getCountry" parameterOrder="arg0">
+        <wsdl:documentation>Get a country by its primary key.</wsdl:documentation>
+      <wsdl:input name="getCountry0In" message="tns:getCountry0In"/>
+      <wsdl:output name="getCountry0Out" message="tns:getCountry0Out"/>
+        <wsdl:fault name="CountryException" message="tns:CountryException"/>
+    </wsdl:operation>
+    <wsdl:operation name="getCountries" parameterOrder="argv0">
+        <wsdl:documentation>Get all available countries.</wsdl:documentation>
+      <wsdl:input name="getCountries1In" message="tns:getCountries1In"/>
+      <wsdl:output name="getCountries1Out" message="tns:getCountries1Out"/>
+        <wsdl:fault name="CountryException" message="tns:CountryException"/>
+    </wsdl:operation>
+    <wsdl:operation name="getRegion" parameterOrder="arg0">
+        <wsdl:documentation>Get a region by its primary key.</wsdl:documentation>
+      <wsdl:input name="getRegion2In" message="tns:getRegion2In"/>
+      <wsdl:output name="getRegion2Out" message="tns:getRegion2Out"/>
+        <wsdl:fault name="CountryException" message="tns:CountryException"/>
+    </wsdl:operation>
+    <wsdl:operation name="getRegions" parameterOrder="argv0">
+        <wsdl:documentation>Get all available regions.</wsdl:documentation>
+      <wsdl:input name="getRegions3In" message="tns:getRegions3In"/>
+      <wsdl:output name="getRegions3Out" message="tns:getRegions3Out"/>
+        <wsdl:fault name="CountryException" message="tns:CountryException"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="Country" type="tns:Country">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="getCountry">
+      <soap:operation soapAction="getCountry" style="rpc"/>
+      <wsdl:input name="getCountry0In">
+        <soap:body use="encoded" namespace="http://tempuri.org/com.marketxs.soap.misc.CountryImpl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+      </wsdl:input>
+      <wsdl:output name="getCountry0Out">
+        <soap:body use="encoded" namespace="http://tempuri.org/com.marketxs.soap.misc.CountryImpl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+      </wsdl:output>
+        <wsdl:fault name="CountryException">
+            <soap:fault name="CountryException" use="encoded" namespace="http://tempuri.org/com.marketxs.soap.misc.CountryImpl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+        </wsdl:fault>
+    </wsdl:operation>
+    <wsdl:operation name="getCountries">
+      <soap:operation soapAction="getCountries" style="rpc"/>
+      <wsdl:input name="getCountries1In">
+        <soap:body use="encoded" namespace="http://tempuri.org/com.marketxs.soap.misc.CountryImpl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+      </wsdl:input>
+      <wsdl:output name="getCountries1Out">
+        <soap:body use="encoded" namespace="http://tempuri.org/com.marketxs.soap.misc.CountryImpl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+      </wsdl:output>
+        <wsdl:fault name="CountryException">
+            <soap:fault name="CountryException" use="encoded" namespace="http://tempuri.org/com.marketxs.soap.misc.CountryImpl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+        </wsdl:fault>
+    </wsdl:operation>
+    <wsdl:operation name="getRegion">
+      <soap:operation soapAction="getRegion" style="rpc"/>
+      <wsdl:input name="getRegion2In">
+        <soap:body use="encoded" namespace="http://tempuri.org/com.marketxs.soap.misc.CountryImpl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+      </wsdl:input>
+      <wsdl:output name="getRegion2Out">
+        <soap:body use="encoded" namespace="http://tempuri.org/com.marketxs.soap.misc.CountryImpl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+      </wsdl:output>
+        <wsdl:fault name="CountryException">
+            <soap:fault name="CountryException" use="encoded" namespace="http://tempuri.org/com.marketxs.soap.misc.CountryImpl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+        </wsdl:fault>
+    </wsdl:operation>
+    <wsdl:operation name="getRegions">
+      <soap:operation soapAction="getRegions" style="rpc"/>
+      <wsdl:input name="getRegions3In">
+        <soap:body use="encoded" namespace="http://tempuri.org/com.marketxs.soap.misc.CountryImpl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+      </wsdl:input>
+      <wsdl:output name="getRegions3Out">
+        <soap:body use="encoded" namespace="http://tempuri.org/com.marketxs.soap.misc.CountryImpl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+      </wsdl:output>
+        <wsdl:fault name="CountryException">
+            <soap:fault name="CountryException" use="encoded" namespace="http://tempuri.org/com.marketxs.soap.misc.CountryImpl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+        </wsdl:fault>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="Country">
+    <wsdl:documentation>Country service</wsdl:documentation>
+    <wsdl:port name="Country" binding="tns:Country">
+      <soap:address location="http://@soap.cluster@/Country"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation8.xml b/xml/tests/testData/xml/ComplexSchemaValidation8.xml
new file mode 100644
index 0000000..a7422fe
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation8.xml
@@ -0,0 +1,32 @@
+<rule-set name="Resource Authorization Ruleset"
+    xmlns="http://drools.org/rules"
+    xmlns:g="http://drools.org/semantics/groovy">
+
+    <import>com.safenetinc.policyengine.model.*</import>
+    <import>test.*</import>
+
+    <rule name="Create authorized resource set">
+        <parameter identifier="loginAuthorizationEvent">
+            <class>com.safenetinc.policyengine.model.LoginAuthorizationEvent</class>
+        </parameter>
+        <g:consequence>
+            drools.assertObject(new AuthorizedResourceList(loginAuthorizationEvent.user))
+        </g:consequence>
+    </rule>
+
+    <rule name="Add authorized resources">
+        <parameter identifier="authorizedResources">
+            <class>com.safenetinc.policyengine.model.AuthorizedResourceList</class>
+        </parameter>
+        <parameter identifier="group">
+            <class>com.safenetinc.policyengine.model.Group</class>
+        </parameter>
+        <parameter identifier="resource">
+            <class>com.safenetinc.policyengine.model.Resource</class>
+        </parameter>
+        <g:condition>authorizedResources.user.groups.contains(group)</g:condition>
+        <g:condition>group.assignedResources.contains(resource)</g:condition>
+        <g:consequence>authorizedResources.authorizedResources.add(resource)</g:consequence>
+    </rule>
+
+</rule-set>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation8.xsd b/xml/tests/testData/xml/ComplexSchemaValidation8.xsd
new file mode 100644
index 0000000..ba9a591
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation8.xsd
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:rules="http://drools.org/rules" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+           targetNamespace="http://drools.org/rules">
+
+  <xs:element name="rule-set">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" minOccurs="0" ref="rules:abstractImport"/>
+
+        <xs:element maxOccurs="unbounded" minOccurs="0" ref="rules:application-data"/>
+
+        <xs:element maxOccurs="unbounded" minOccurs="0" ref="rules:abstractFunctions"/>
+
+        <xs:element maxOccurs="unbounded" minOccurs="0" ref="rules:rule"/>
+      </xs:sequence>
+
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="description" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="rule">
+    <xs:complexType>
+      <xs:sequence>
+
+        <xs:element maxOccurs="unbounded" minOccurs="0" name="parameter">
+          <xs:complexType>
+            <xs:choice>
+              <xs:element ref="rules:abstractClass"/>
+              <xs:element ref="rules:class-field"/>
+              <xs:element ref="rules:semaphore"/>
+            </xs:choice>
+            <xs:attribute name="identifier" type="xs:string" use="required"/>
+          </xs:complexType>
+        </xs:element>
+
+        <xs:element maxOccurs="unbounded" minOccurs="0" ref="rules:abstractCondition"/>
+
+        <xs:element minOccurs="0" name="duration">
+          <xs:complexType>
+            <xs:attribute name="days" type="xs:nonNegativeInteger"/>
+            <xs:attribute name="hours" type="xs:nonNegativeInteger"/>
+            <xs:attribute name="minutes" type="xs:nonNegativeInteger"/>
+            <xs:attribute name="seconds" type="xs:nonNegativeInteger"/>
+          </xs:complexType>
+        </xs:element>
+
+      <xs:element ref="rules:abstractConsequence"/>
+
+      </xs:sequence>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="salience" type="xs:integer"/>
+      <xs:attribute name="no-loop" type="xs:boolean"/>
+      <xs:attribute name="xor-group" type="xs:string"/>
+      <xs:attribute name="description" type="xs:string"/>
+    </xs:complexType>
+
+    <!-- All rules must have unique names -->
+    <xs:key name="ruleName">
+      <xs:selector xpath="rules:rule"/>
+      <xs:field xpath="@name"/>
+    </xs:key>
+  </xs:element>
+
+  <xs:element name="class" substitutionGroup="rules:abstractClass" type="xs:string"/>
+
+  <xs:element name="class-field">
+    <xs:complexType>
+      <xs:simpleContent>
+        <xs:extension base="xs:string">
+          <xs:attribute name="field" type="xs:string" use="required"/>
+          <xs:attribute name="value" type="xs:string" use="required"/>
+        </xs:extension>
+      </xs:simpleContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="import" substitutionGroup="rules:abstractImport" type="xs:string"/>
+
+
+  <xs:element name="semaphore">
+    <xs:complexType>
+          <xs:attribute name="type" use="required">
+			<xs:simpleType>
+			  <xs:restriction base="xs:string">
+			    <xs:enumeration value="String"/>
+			    <xs:enumeration value="Integer"/>
+			    <xs:enumeration value="Long"/>
+			    <xs:enumeration value="Boolean"/>
+			    <xs:enumeration value="Char"/>
+			    <xs:enumeration value="Short"/>
+			    <xs:enumeration value="Float"/>
+			    <xs:enumeration value="Double"/>
+                <xs:enumeration value="List"/>
+                <xs:enumeration value="Map"/>
+                <xs:enumeration value="Set"/>
+			  </xs:restriction>
+			</xs:simpleType>
+          </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="application-data">
+    <xs:complexType>
+      <xs:simpleContent>
+        <xs:extension base="xs:string">
+          <xs:attribute name="identifier" type="xs:string" use="required"/>
+        </xs:extension>
+      </xs:simpleContent>
+    </xs:complexType>
+  </xs:element>
+
+  <!-- Abstract Definitions for sementic to create concrete implementations -->
+
+  <xs:element abstract="true" name="abstractImport" type="xs:anyType"/>
+
+  <xs:element abstract="true" name="abstractFunctions" type="xs:anyType"/>
+
+  <xs:element abstract="true" name="abstractClass" type="xs:anyType"/>
+
+  <xs:element abstract="true" name="abstractClassField" type="xs:anyType"/>
+
+  <xs:element abstract="true" name="abstractCondition" type="xs:anyType"/>
+
+  <xs:element abstract="true" name="abstractConsequence" type="xs:anyType"/>
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation8_2.xsd b/xml/tests/testData/xml/ComplexSchemaValidation8_2.xsd
new file mode 100644
index 0000000..ae8823f
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation8_2.xsd
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           targetNamespace="http://drools.org/semantics/groovy"
+           elementFormDefault="qualified"
+           xmlns:groovy="http://drools.org/semantics/groovy"
+           xmlns:rules="http://drools.org/rules">
+
+  <xs:import namespace="http://drools.org/rules" schemaLocation="ComplexSchemaValidation8.xsd"/>
+
+  <xs:element name="import"      type="xs:string" substitutionGroup="rules:abstractImport"/>
+
+  <xs:element name="functions"   type="xs:string" substitutionGroup="rules:abstractFunctions"/>
+
+  <xs:element name="class"       type="xs:string" substitutionGroup="rules:abstractClass"/>
+
+  <xs:element name="condition"   type="xs:string" substitutionGroup="rules:abstractCondition"/>
+
+  <xs:element name="consequence" type="xs:string" substitutionGroup="rules:abstractConsequence"/>
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation9.xml b/xml/tests/testData/xml/ComplexSchemaValidation9.xml
new file mode 100644
index 0000000..fe57829e
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation9.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ComplexSchemaValidation9.xsd">
+  <aValidTag/>
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ComplexSchemaValidation9.xsd b/xml/tests/testData/xml/ComplexSchemaValidation9.xsd
new file mode 100644
index 0000000..eb9e71d
--- /dev/null
+++ b/xml/tests/testData/xml/ComplexSchemaValidation9.xsd
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+  <xs:element name="root">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/CorrectGeneratedDtdUpdate.xml b/xml/tests/testData/xml/CorrectGeneratedDtdUpdate.xml
new file mode 100644
index 0000000..9bfe1be
--- /dev/null
+++ b/xml/tests/testData/xml/CorrectGeneratedDtdUpdate.xml
@@ -0,0 +1,367 @@
+<ideaplugin version="2" use-idea-classloader="true">
+  <name>HTML Designer</name>
+  <id>com.intellij.htmlDesigner</id>
+  <version>1.0</version>
+  <vendor>JetBrains</vendor>
+  <idea-version min="5.0" max="5.0"/>
+
+  <selection><</selection>extensionPoints>
+    <extensionPoint name="editorDnDHandler" beanClass="com.intellij.designer.editor.dnd.EditorDnDHandlerConfiguration"/>
+    <extensionPoint name="beanCreateInfo" beanClass="com.intellij.openapi.designer.beans.BeanCreateInfo"/>
+  </extensionPoints>
+
+  <extensions xmlns="com.intellij">
+    <errorHandler implementation="com.intellij.diagnostic.ITNReporter"/>
+  </extensions>
+
+  <extensions xmlns="com.intellij.htmlDesigner">
+
+    <editorDnDHandler activeStates="DESIGN">
+       <newInstance>com.intellij.designer.editor.dnd.TagDnDHandler</newInstance>
+       <types>
+         <type>com.intellij.psi.xml.XmlTag</type>
+       </types>
+     </editorDnDHandler>
+
+    <editorDnDHandler>
+      <newInstance>com.intellij.designer.impl.palette.BeanCreateInfoDnDHandler</newInstance>
+      <types>
+        <type>com.intellij.designer.impl.palette.BeanCreateInfoDnDObject</type>
+      </types>
+    </editorDnDHandler>
+
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.ABeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.DivBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.DdBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.DlBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.DtBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.HrBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.ImgBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.LiBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.OlBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.SpanBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.TableBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.TdBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.TrBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.html.UlBeanInfo"/>
+
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlCommandButtonBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlDataTableBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlInputTextBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlOutputTextBeanInfo"/>
+
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlSelectBooleanCheckboxBeanInfo"/>
+
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlCommandLinkBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlInputHiddenBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlInputSecretBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlInputTextareaBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlMessageBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlMessagesBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlOutputFormatBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlOutputLabelBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlOutputLinkBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlSelectManyCheckboxBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlSelectManyListboxBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlSelectManyMenuBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlSelectOneListboxBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlSelectOneMenuBeanInfo"/>
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.HtmlSelectOneRadioBeanInfo"/>
+
+    <beanCreateInfo implementation="com.intellij.designer.dt.jsf.UIColumnBeanInfo"/>
+
+  </extensions>
+
+  <project-components>
+    <component>
+      <implementation-class>com.intellij.designer.impl.dt.DesignBeanManager</implementation-class>
+    </component>
+  </project-components>
+
+  <application-components>
+    <component>
+      <implementation-class>com.intellij.designer.impl.HtmlEditorProvider</implementation-class>
+    </component>
+    <component>
+      <implementation-class>com.intellij.designer.impl.dt.EditorsRegistrar</implementation-class>
+    </component>
+    <component>
+      <implementation-class>com.intellij.designer.impl.dt.JbdtDataManager</implementation-class>
+    </component>
+  </application-components>
+
+  <module-components>
+    <component>
+      <interface-class>com.intellij.designer.impl.palette.BeanCreateInfoManager</interface-class>
+      <implementation-class>com.intellij.designer.impl.palette.BeanCreateInfoManagerImpl</implementation-class>
+    </component>
+    <component>
+      <implementation-class>com.intellij.designer.impl.dt.JbdtDataManager</implementation-class>
+    </component>
+  </module-components>
+  <actions>
+    <!-- Designer actions -->
+    <group id="DesignerActions" text="Designer Actions">
+
+      <action id="Designer.QuickEdit" class="com.intellij.designer.editor.impl.action.action.QuickEditAction" text="Quick Edit">
+        <keyboard-shortcut first-keystroke="alt control T" keymap="$default"/>
+      </action>
+      <action id="Designer.InsertTable" class="com.intellij.designer.editor.impl.action.action.InsertTableAction"
+              text="Insert Table"/>
+      <!--<action id="Designer.InsertImage" class="com.intellij.designer.editor.impl.action.action.InsertImageAction" text="Insert Image"/>-->
+      <action id="Designer.ViewNormal" class="com.intellij.designer.editor.impl.action.action.ViewNormalAction" text="View Normal"/>
+      <action id="Designer.ViewTags" class="com.intellij.designer.editor.impl.action.action.ViewTagsAction" text="View Tags"/>
+      <action id="Designer.ReplaceTagWithContent" class="com.intellij.designer.editor.impl.action.action.ReplaceTagWithContentAction"
+              text="Replace Tag With Content"/>
+
+      <action id="Designer.Delete" class="com.intellij.designer.editor.impl.action.action.DeleteAction" text="Delete"
+              use-shortcut-of="EditorDelete"/>
+      <action id="Designer.Backspace" class="com.intellij.designer.editor.impl.action.action.BackspaceAction" text="Backspace"
+              use-shortcut-of="EditorBackSpace"/>
+      <action id="Designer.Enter" class="com.intellij.designer.editor.impl.action.action.EnterAction" text="Enter"
+              use-shortcut-of="EditorEnter"/>
+      <action id="Designer.Left" class="com.intellij.designer.editor.impl.action.action.navigation.LeftAction" text="Left"
+              use-shortcut-of="EditorLeft"/>
+      <action id="Designer.Right" class="com.intellij.designer.editor.impl.action.action.navigation.RightAction" text="Right"
+              use-shortcut-of="EditorRight"/>
+      <action id="Designer.Up" class="com.intellij.designer.editor.impl.action.action.navigation.UpAction" text="Up"
+              use-shortcut-of="EditorUp"/>
+      <action id="Designer.Down" class="com.intellij.designer.editor.impl.action.action.navigation.DownAction" text="Down"
+              use-shortcut-of="EditorDown"/>
+      <action id="Designer.Home" class="com.intellij.designer.editor.impl.action.action.navigation.HomeAction" text="Home"
+              use-shortcut-of="EditorLineStart"/>
+      <action id="Designer.End" class="com.intellij.designer.editor.impl.action.action.navigation.EndAction" text="End"
+              use-shortcut-of="EditorLineEnd"/>
+      <action id="Designer.PageUp" class="com.intellij.designer.editor.impl.action.action.navigation.PageUpAction" text="Page Up"
+              use-shortcut-of="EditorPageUp"/>
+      <action id="Designer.PageDown" class="com.intellij.designer.editor.impl.action.action.navigation.PageDownAction"
+              text="Page Down" use-shortcut-of="EditorPageDown"/>
+      <action id="Designer.Tab" class="com.intellij.designer.editor.impl.action.action.TabAction" text="Tab"
+              use-shortcut-of="EditorTab"/>
+      <action id="Designer.Escape" class="com.intellij.designer.editor.impl.action.action.EscapeAction" text="Escape"
+              use-shortcut-of="EditorEscape"/>
+      <action id="Designer.ShiftEnter" class="com.intellij.designer.editor.impl.action.action.ShiftEnterAction" text="New Line"
+              use-shortcut-of="EditorStartNewLine"/>
+      <action id="Designer.ShiftLeft" class="com.intellij.designer.editor.impl.action.action.navigation.ShiftLeftAction"
+              text="ShiftLeft" use-shortcut-of="EditorLeftWithSelection"/>
+      <action id="Designer.ShiftRight" class="com.intellij.designer.editor.impl.action.action.navigation.ShiftRightAction"
+              text="ShiftRight" use-shortcut-of="EditorRightWithSelection"/>
+      <action id="Designer.ShiftUp" class="com.intellij.designer.editor.impl.action.action.navigation.ShiftUpAction" text="ShiftUp"
+              use-shortcut-of="EditorUpWithSelection"/>
+      <action id="Designer.ShiftDown" class="com.intellij.designer.editor.impl.action.action.navigation.ShiftDownAction"
+              text="ShiftDown" use-shortcut-of="EditorDownWithSelection"/>
+      <action id="Designer.ShiftHome" class="com.intellij.designer.editor.impl.action.action.navigation.ShiftHomeAction"
+              text="ShiftHome" use-shortcut-of="EditorLineStartWithSelection"/>
+      <action id="Designer.ShiftEnd" class="com.intellij.designer.editor.impl.action.action.navigation.ShiftEndAction" text="ShiftEnd"
+              use-shortcut-of="EditorLineEndWithSelection"/>
+      <action id="Designer.CtrlHome" class="com.intellij.designer.editor.impl.action.action.navigation.CtrlHomeAction" text="CtrlHome"
+              use-shortcut-of="EditorTextStart"/>
+      <action id="Designer.CtrlEnd" class="com.intellij.designer.editor.impl.action.action.navigation.CtrlEndAction" text="CtrlEnd"
+              use-shortcut-of="EditorTextEnd"/>
+      <action id="Designer.SelectAll" class="com.intellij.designer.editor.impl.action.action.navigation.SelectAllAction"
+              text="Select All" use-shortcut-of="$SelectAll"/>
+      <action id="Designer.CtrlLeft" class="com.intellij.designer.editor.impl.action.action.navigation.CtrlLeftAction"
+              text="Word Left" use-shortcut-of="EditorPreviousWord"/>
+      <action id="Designer.CtrlRight" class="com.intellij.designer.editor.impl.action.action.navigation.CtrlRightAction"
+              text="Word Right" use-shortcut-of="EditorNextWord"/>
+      <action id="Designer.SelectBlockTag" class="com.intellij.designer.editor.impl.action.action.navigation.SelectBlockTagAction"
+              text="Select Tag">
+        <keyboard-shortcut first-keystroke="control alt T" keymap="$default"/>
+      </action>
+      <!--<action id="Designer.Undo" class="com.intellij.designer.editor.impl.action.action.XhtmlUndoAction" text="Undo"/>-->
+      <action id="Designer.CtrlShiftHome" class="com.intellij.designer.editor.impl.action.action.navigation.CtrlShiftHomeAction"
+              text="CtrlShiftHome" use-shortcut-of="EditorTextStartWithSelection"/>
+      <action id="Designer.CtrlShiftEnd" class="com.intellij.designer.editor.impl.action.action.navigation.CtrlShiftEndAction"
+              text="CtrlShiftEnd" use-shortcut-of="EditorTextEndWithSelection"/>
+      <action id="Designer.CtrlShiftLeft" class="com.intellij.designer.editor.impl.action.action.navigation.CtrlShiftLeftAction"
+              text="CtrlShiftLeft" use-shortcut-of="EditorPreviousWordWithSelection"/>
+      <action id="Designer.CtrlShiftRight" class="com.intellij.designer.editor.impl.action.action.navigation.CtrlShiftRightAction"
+              text="CtrlShiftRight" use-shortcut-of="EditorNextWordWithSelection"/>
+      <action id="Designer.ClearWidth" class="com.intellij.designer.editor.impl.action.action.ClearWidthAction" text="Clear Width"/>
+      <action id="Designer.ClearHeight" class="com.intellij.designer.editor.impl.action.action.ClearHeightAction"
+              text="Clear Height"/>
+      <action id="Designer.CopyAttributes" class="com.intellij.designer.editor.impl.action.action.CopyAttributesAction"
+              text="Copy Attributes"/>
+      <action id="Designer.PasteAttributes" class="com.intellij.designer.editor.impl.action.action.PasteAttributesAction"
+              text="Paste Attributes"/>
+      <action id="Designer.MakeStatic" class="com.intellij.designer.editor.impl.action.action.MakeStaticAction" text="Make Static"/>
+      <action id="Designer.MakeAbsolute" class="com.intellij.designer.editor.impl.action.action.MakeAbsoluteAction"
+              text="Make Absolute"/>
+      <action id="Designer.MakeRelative" class="com.intellij.designer.editor.impl.action.action.MakeRelativeAction"
+              text="Make Relative"/>
+      <action id="Designer.MakeFloatLeft" class="com.intellij.designer.editor.impl.action.action.MakeFloatLeftAction"
+              text="Make Float Left"/>
+      <action id="Designer.MakeFloatRight" class="com.intellij.designer.editor.impl.action.action.MakeFloatRightAction"
+              text="Make Float Right"/>
+      <action id="Designer.MakeFloatNone" class="com.intellij.designer.editor.impl.action.action.MakeFloatNoneAction"
+              text="Remove Float"/>
+      <action id="Designer.Settings" class="com.intellij.designer.editor.impl.action.action.SettingsAction" text="Settings..."/>
+
+      <!-- Table related actions -->
+      <group id="Designer.TableActions" text="Table" popup="true">
+        <action id="Designer.SelectTable" class="com.intellij.designer.editor.impl.action.action.table.SelectTableAction"
+                text="Select Table"/>
+        <separator/>
+        <action id="Designer.InsertRow" class="com.intellij.designer.editor.impl.action.action.table.InsertRowAction"
+                text="Insert Row">
+          <keyboard-shortcut first-keystroke="control M" keymap="$default"/>
+        </action>
+        <action id="Designer.InsertColumn" class="com.intellij.designer.editor.impl.action.action.table.InsertColumnAction"
+                text="Insert Column">
+          <keyboard-shortcut first-keystroke="control shift A" keymap="$default"/>
+        </action>
+        <separator/>
+        <action id="Designer.DeleteRow" class="com.intellij.designer.editor.impl.action.action.table.DeleteTableRowAction"
+                text="Delete Row">
+          <keyboard-shortcut first-keystroke="control shift M" keymap="$default"/>
+        </action>
+        <action id="Designer.DeleteColumn" class="com.intellij.designer.editor.impl.action.action.table.DeleteTableColumnAction"
+                text="Delete Column" >
+          <keyboard-shortcut first-keystroke="control shift MINUS" keymap="$default"/>
+        </action>
+        <separator/>
+        <action id="Designer.MergeTableCells" class="com.intellij.designer.editor.impl.action.action.table.MergeCellsAction"
+                text="Merge Selected Cells"/>
+        <action id="Designer.IncreaseRowSpan" class="com.intellij.designer.editor.impl.action.action.table.IncreaseRowSpanAction"
+                text="Increase Row Span"/>
+        <action id="Designer.IncreaseColumnSpan"
+                class="com.intellij.designer.editor.impl.action.action.table.IncreaseColumnSpanAction" text="Increase Column Span">
+          <keyboard-shortcut first-keystroke="control shift CLOSE_BRACKET" keymap="$default"/>
+        </action>
+        <action id="Designer.DecreaseRowSpan" class="com.intellij.designer.editor.impl.action.action.table.DecreaseRowSpanAction"
+                text="Decrease Row Span"/>
+        <action id="Designer.DecreaseColumnSpan"
+                class="com.intellij.designer.editor.impl.action.action.table.DecreaseColumnSpanAction" text="Decrease Column Span">
+          <keyboard-shortcut first-keystroke="control shift OPEN_BRACKET" keymap="$default"/>
+        </action>
+        <action id="Designer.SplitCellHorizontally"
+                class="com.intellij.designer.editor.impl.action.action.table.SplitCellHorizontallyAction" text="Split Cell Horizontally">
+        </action>
+        <action id="Designer.SplitCellVertically"
+                class="com.intellij.designer.editor.impl.action.action.table.SplitCellVerticallyAction" text="Split Cell Vertically">
+        </action>
+      </group>
+
+      <group id="Designer.VisualAids">
+
+        <action id="Designer.ShowGrid" class="com.intellij.designer.editor.impl.action.action.grid.ShowGridAction" text="Show Grid">
+          <keyboard-shortcut first-keystroke="control alt G" keymap="$default"/>
+        </action>
+        <action id="Designer.SnapToGrid" class="com.intellij.designer.editor.impl.action.action.grid.SnapToGridAction"
+                text="Snap To Grid">
+          <keyboard-shortcut first-keystroke="control alt shift G" keymap="$default"/>
+        </action>
+        <action id="Designer.ViewRulers" class="com.intellij.designer.impl.actions.ViewRulersAction" text="Show Rulers"/>
+        <separator/>
+        <reference ref="Designer.ViewTags"/>
+        <reference ref="Designer.ViewNormal"/>
+        <separator/>
+        <action id="Designer.HighlightTagBounds" class="com.intellij.designer.impl.actions.HighlightTagBoundsAction" text="Hightlight Tag Bounds"/>
+        <separator/>
+        <action id="Designer.ShowHiddenFields" class="com.intellij.designer.impl.actions.RenderHiddenFieldsAction" text="Show Hidden Fields"/>
+        <separator/>
+        <action id="Designer.GridSettings" class="com.intellij.designer.editor.impl.action.action.grid.GridSettingsAction"
+                text="Grid Settings..."/>
+      </group>
+
+      <group id="Designer.Outlines">
+        <action id="Designer.OutlineBlockElements" class="com.intellij.designer.impl.actions.OutlineBlockElementsAction" text="Outline Block Elements"/>
+        <action id="Designer.OutlineTables" class="com.intellij.designer.impl.actions.OutlineTablesAction" text="Outline Tables"/>
+        <action id="Designer.OutlineTableCells" class="com.intellij.designer.impl.actions.OutlineTableCellsAction" text="Outline Table Cells"/>
+      </group>
+
+      <group id="Designer.DefaultPopup">
+        <action id="Designer.DumpFrame" class="com.intellij.designer.impl.actions.DumpFrameAction" text="Dump"/>
+        <separator/>
+        <reference ref="CutCopyPasteGroup"/>
+        <separator/>
+          <group id="Designer.Facets" class="com.intellij.designer.jsf.impl.actions.FacetsActionGroup" popup="true" text="Facets"/>
+        <separator/>
+        <group popup="true" text="Insert">
+          <reference ref="Designer.InsertTable"/>
+        </group>
+        <reference ref="Designer.QuickEdit"/>
+        <separator/>
+      </group>
+    </group>
+
+    <group id="InspectorActions" text="InspectorActions">
+      <group id="PropertyInspector.CommonActions">
+        <action id="PropertyInspector.AddProperty" class="com.intellij.designer.inspector.impl.actions.AddPropertyAction" text="Add Property" use-shortcut-of="Generate"/>
+        <action id="PropertyInspector.RemoveProperty" class="com.intellij.designer.inspector.impl.actions.RemovePropertyAction" text="Remove Property" use-shortcut-of="EditorDelete"/>
+      </group>
+
+      <action id="PropertyInspector.EditValue" class="com.intellij.designer.inspector.impl.actions.EditPropertyAction" text="Edit Property">
+        <keyboard-shortcut first-keystroke="ENTER" keymap="$default"/>
+      </action>
+    </group>
+
+    <group id="CssInspectorActions" text="CssInspectorActions">
+      <action id="CssInspector.Go2Decalaration" class="com.intellij.designer.cssInspector.actions.Navigate2SourceAction" text="Navigate To Source" use-shortcut-of="EditSource"/>
+    </group>
+
+    <group id="InstantAction" text="InstantActions">
+      <group id="InstantAction.TextSelection" text="TextSelectionActions">
+        <group id="FirstRow" text="FirstRow">
+          <action id="TextSelection.WrapInSpan" class="com.intellij.designer.editor.impl.action.action.text.WrapInSpanAction" text="Wrap in SPAN"
+            />
+          <action id="TextSelection.WrapInDiv" class="com.intellij.designer.editor.impl.action.action.text.WrapInDivAction" text="Wrap in DIV"
+            />
+          <action id="TextSelection.MakeLink" class="com.intellij.designer.editor.impl.action.action.text.MakeLinkAction" text="Make Link"
+            />
+        </group>
+        <group id="SecondRow" text="FirstRow">
+        </group>
+      </group>
+
+      <group id="InstantAction.InlineTagSelection" text="InlineTagSelection">
+        <action id="Designer.QuickEdit1" class="com.intellij.designer.editor.impl.action.action.text.InlineQuickEditAction" text="Quick Edit"
+           />
+      </group>
+
+      <group id="InstantActionGroup.default">
+        <group id="1FirstRow">
+          <group id="Position">
+            <action id="1Designer.MakeStatic" class="com.intellij.designer.editor.impl.action.action.MakeStaticAction" text="Make Static"
+                    />
+            <action id="1Designer.MakeAbsolute" class="com.intellij.designer.editor.impl.action.action.MakeAbsoluteAction"
+                    text="Make Absolute" />
+            <action id="1Designer.MakeRelative" class="com.intellij.designer.editor.impl.action.action.MakeRelativeAction"
+                    text="Make Relative"  />
+          </group>
+          <group id="Float">
+            <action id="1Designer.MakeFloatLeft" class="com.intellij.designer.editor.impl.action.action.MakeFloatLeftAction"
+                    text="Make Float Left"  />
+            <action id="1Designer.MakeFloatRight" class="com.intellij.designer.editor.impl.action.action.MakeFloatRightAction"
+                    text="Make Float Right" />
+            <action id="1Designer.MakeFloatNone" class="com.intellij.designer.editor.impl.action.action.MakeFloatNoneAction"
+                    text="Remove Float"  />
+          </group>
+        </group>
+        <group id="2SecondRow">
+          <group id="Clear">
+            <action id="1Designer.ClearWidth" class="com.intellij.designer.editor.impl.action.action.ClearWidthAction" text="Clear Width"
+                    />
+            <action id="1Designer.ClearHeight" class="com.intellij.designer.editor.impl.action.action.ClearHeightAction"
+                    text="Clear Height" />
+          </group>
+          <group id="1QuickEdit">
+            <action id="1Designer.QuickEdit" class="com.intellij.designer.editor.impl.action.action.QuickEditAction" text="Quick Edit"
+                    >
+              <keyboard-shortcut first-keystroke="alt control T" keymap="$default"/>
+            </action>
+          </group>
+          <group id="1ReplaceTag">
+            <action id="1Designer.ReplaceTagWithContent" class="com.intellij.designer.editor.impl.action.action.ReplaceTagWithContentAction"
+                    text="Replace Tag With Content"/>
+          </group>
+        </group>
+
+      </group>
+
+    </group>
+
+  </actions>
+
+
+</ideaplugin>
diff --git a/xml/tests/testData/xml/DefaultAndFixedInSchema.xsd b/xml/tests/testData/xml/DefaultAndFixedInSchema.xsd
new file mode 100644
index 0000000..263864e
--- /dev/null
+++ b/xml/tests/testData/xml/DefaultAndFixedInSchema.xsd
@@ -0,0 +1,10 @@
+<xsd:schema xmlns="http://www.foo.org/test"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://www.foo.org/test"
+            elementFormDefault="qualified" attributeFormDefault="unqualified">
+  <<error>xsd:element</error>>
+    <xsd:complexType>
+      <<error>xsd:attribute</error> <error>default="aaa"</error> <error>fixed="bbb"</error> />
+    </xsd:complexType>
+  </<error>xsd:element</error>>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/DocBook5.xml b/xml/tests/testData/xml/DocBook5.xml
new file mode 100644
index 0000000..d00d146
--- /dev/null
+++ b/xml/tests/testData/xml/DocBook5.xml
@@ -0,0 +1,13 @@
+<book lang="de"
+      xmlns="http://docbook.org/ns/docbook"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns:xlink="http://www.w3.org/1999/xlink"
+      xsi:schemaLocation="http://docbook.org/ns/docbook http://www.docbook.org/xml/5.0/xsd/docbook.xsd
+                          http://www.w3.org/1999/xlink http://www.w3.org/1999/xlink.xsd">
+
+    <title>
+        <link xlink:href="http://www.web.de">linklabel</link>
+
+    </title>
+
+</book>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/DocBookHighlighting.xml b/xml/tests/testData/xml/DocBookHighlighting.xml
new file mode 100644
index 0000000..641d143
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting.xml
@@ -0,0 +1,1627 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+
+<chapter id="chUserGuide">
+	<title>User Guide</title>
+
+	<?dbhtml filename="userguide.html"?>
+ 	<para>The User Guide provides an in-depth guide to working with Polarion. This "book" is mainly oriented to the tasks and operations that you perform while using Polarion.
+     The first section introduces the major components of the user interface. This is followed by a section that covers the most common things most people need to do when
+     working with projects. Later you will find "specialized" sections oriented toward the common tasks of specific types of users: Project Managers and Developers, for
+     example. You can browse through the Table of Contents to see the organization of the various topics covered in the guide.</para>
+
+    <sect1 id="ug_tour">
+        <title>Quick Tour</title>
+        <?dbhtml filename="ug_quicktour.html"?>
+        <para>This section of the User Guide provides a quick overview of the Polarion user interface.</para>
+        <figure id="gs-ui_project_dashbd">
+			<title>Polarion User Interface</title>
+			<screenshot>
+				<mediaobject>
+					<imageobject>
+						<imagedata fileref="help_home/screenshots/ui_projects_dashboard.png" format="PNG"/>
+					</imageobject>
+					<textobject>
+						<phrase>The Polarion application (running in MS Internet Explorer)</phrase>
+					</textobject>
+					<caption>
+						<para>Polarion User Interface (Projects perspective, Dashboard topic)</para>
+					</caption>
+				</mediaobject>
+			</screenshot>
+		</figure>
+		<para>Please refer to the above figure for the following sections.</para>
+
+        <sect2 id="ug_tour_main_navpanel">
+            <title>Main Navigation Panel</title>
+            <para>This panel occupies the left side of the Polarion application. It provides the first
+			level of navigation of the Polarion system. The panel has main types of components:</para>
+			<itemizedlist mark="bullet">
+				<listitem>
+					<para><emphasis role="bold">Navigation Portlets</emphasis>: Subsections of a panel or screen, portlets prevent some formatted view of data or information.
+					In the case of the Main Navigation Panel, navigation portlets provide clickable links that help you access specific information in the system.
+					The actual portlets that appear in the panel vary according to which perspective is current.</para>
+				</listitem>
+				<listitem>
+					<para><emphasis role="bold">Perspective Selectors</emphasis>: Polarion uses the concept of <emphasis>perspectives</emphasis>,
+					similar to Microsoft Outlook. One or more perspectives are visible to you depending on permissions granted by the system administrator. For
+					example, if you do not have Administrator rights (either global or project level), there will be no selector for the <guilabel>Administration</guilabel>
+					perspective and that perspective will not be accessible for you.</para>
+				</listitem>
+			</itemizedlist>
+        </sect2>
+
+        <sect2 id="ug_tour_work_area">
+            <title>The Working Area</title>
+            <para>As the name implies, this is the area where you will do most of your work in Polarion. The
+			content of this area depends of a number of factors, including current perspective and selections in the
+			<link linkend="ug_tour_main_navpanel">Main Navigation Panel</link> such as Project and Topic, and the view tab selection.</para>
+
+            <sect3 id="ug_tour_work_area_views">
+				<title>View tabs</title>
+				<para>The Working Area provides several Views which are accessed by clicking one of the tabs that appear at the top.</para>
+				<figure id="ug_tour_work_area_views_shot1">
+					<title>View Tabs</title>
+					<screenshot>
+						<mediaobject>
+							<imageobject>
+								<imagedata fileref="help_home/screenshots/getstart/wi_view_tabs.png" format="PNG"/>
+							</imageobject>
+							<textobject>
+								<phrase>Shows the selector tabs for Working Area Views</phrase>
+							</textobject>
+							<caption>
+								<para>Working Area View tabs</para>
+							</caption>
+						</mediaobject>
+					</screenshot>
+				</figure>
+			</sect3>
+			<sect3 id="ug_tour_work_area_views_search">
+				<title>Search Bar</title>
+				<para>What you see in the Working Area is the result of some system query, whether predefined and automated, or manually
+				defined and executed by you. Each of the View tabs displays the Search bar (see figure above). This bar displays the search query criteria
+				that provide the view you are currently seeing. There are controls in the bar for changing the various criteria and executing
+					the revised query, thus obtaining different information in the View.</para>
+				<para>Depending on the View that is current, the Search Bar may contain other controls such as a button or action list.</para>
+			</sect3>
+			<sect3 id="ug_tour_work_area_views_sel_det">
+				<title>Work Item Selection and Detail panes</title>
+				<para>Please refer to the following figure for the next sections:</para>
+				<figure id="ug_tour_work_area_views_sel_det_shot1">
+					<title>Work Item Selections</title>
+					<screenshot>
+						<mediaobject>
+							<imageobject>
+								<imagedata fileref="help_home/screenshots/getstart/wi_sel_detail.png" format="PNG"/>
+							</imageobject>
+							<textobject>
+								<phrase>Shows the Work Item selection pane and the Work Item detail pane of the Working Area.</phrase>
+							</textobject>
+							<caption>
+								<para>Work Item Selection and Detail panes in the Working Area of the Polarion application</para>
+							</caption>
+						</mediaobject>
+					</screenshot>
+				</figure>
+				<sect4 id="ug_tour_work_area_views_sel_det_wisel">
+					<title>Work Item Selection pane</title>
+					<para>This pane enables you to select a Work Item for reading, editing or some other applicable operation (Print, for example).
+					Depending on the current View, you may be able to select multiple Work Items (as in Bulk Edit, for example). The
+					layout of this area (Table, Tree, <inlinegraphic fileref="help_home/images/enterprise_sm.gif" format="GIF" valign="middle" width="17"/> Matrix, ect.)	varies according to the current View tab. </para>
+				</sect4>
+				<sect4 id="ug_tour_work_area_views_sel_det_widet">
+					<title>Work Item Detail pane</title>
+					<para>Here you have access to all information about the selected Work Item(s). You need to scroll the pane to browse all
+					available information. The pane provides a summary of the Work Item at the top. Scrolling down reveals a number of portlets
+					that provide specific kinds of information and data.</para>
+					<para>The toolbar for this pane provides buttons for a number of common operations you can perform on the selected item(s)
+					Edit or Watch, for example. Other buttons provide quick jumps to commonly needed detail portlets such as Comments, Links,
+					and Attachments.</para>
+					<note>
+						<title>A note about editing</title>
+						<para>The Detail pane is where you can edit the selected item. (<inlinegraphic fileref="help_home/images/enterprise_sm.gif" format="GIF" valign="middle" width="17"/>
+						In Polarion Enterprise Edition you can edit multiple items in Multi-edit view). Your ability to edit Work Items depends
+						on the role and access rights assigned you by the system administrator. If you do not have write access privileges, the buttons
+						and links that trigger edit mode do not appear, or are disabled in the interface.</para>
+					</note>
+				</sect4>
+			</sect3>
+        </sect2>
+    </sect1>
+
+    <sect1 id="ug_getstart_projects">
+        <title>Getting Started with Projects</title> <!-- TODO Check for redundancy with Admin Guide. Maybe move content and just link from here. -->
+        <?dbhtml filename="ug_getstart_projects.html"?>
+        <para>This section will give you the basics about creating and accessing Projects in Polarion.</para>
+
+        <sect2 id="ug_gsproject_creating">
+            <title>Creating Projects</title>
+            <para>To create a new project you must have global Administrator rights. The information in this section assumes that you already have
+				a Subversion repository in which you can create a new folder for the new Project.</para>
+			<para>There are 2 basic scenarios for creating a Project:</para>
+			<itemizedlist mark="bullet">
+				<listitem>
+					<para>Create a new empty Project from a Project Template. This creates a new folder in your repository.</para>
+				</listitem>
+				<listitem>
+					<para>Mark an existing repository folder as a Project. </para>
+				</listitem>
+			</itemizedlist>
+			<sect3 id="ug_gsproject_creating_new_empty">
+				<title>Creating a new Project from a template</title>
+				<para>Polarion comes with a default Project Template <systemitem>Empty Project</systemitem>. You can
+				create copies of this template and customize them to create new projects templates, but for now let's concentrate on the
+				default a new project based on the <systemitem>Empty Project</systemitem> template.	<!-- NEED THE LOCATION OF XML FILE --></para>
+				<para><emphasis>To create a new Empty Project:</emphasis></para>
+				<orderedlist spacing="compact">
+					<listitem>
+						<para>Log into Polarion and click <guilabel>Administration</guilabel> in the perspective selector (bottom of
+							the left navigation).</para>
+					</listitem>
+					<listitem>
+						<para>In the <guilabel>Projects</guilabel> portlet, click <guilabel>Repository</guilabel>.</para>
+					</listitem>
+					<listitem>
+						<para>In the <guilabel>Topics</guilabel> portlet, expand the <guilabel>Projects</guilabel> node and click the
+						<guilabel>Projects</guilabel>sub-node. A table of currently defined Projects loads in the Working Area.</para>
+					</listitem>
+					<listitem>
+						<para>Go to the <guilabel>Projects</guilabel> table displayed in the	Working Area and click the <guibutton>Create New Project</guibutton> button.</para>
+						<para>The following controls appear in the Working Area:</para>
+
+						<figure id="ug_gsproject_creating_new_empty_shot1">
+							<title>New Project</title>
+							<screenshot>
+								<mediaobject>
+									<imageobject>
+										<imagedata fileref="help_home/screenshots/getstart/new_project_spec.png" format="PNG"/>
+									</imageobject>
+									<textobject>
+										<phrase>View of the new project wizard screen for a new empty project</phrase>
+									</textobject>
+									<caption>
+										<para>New empty project specification</para>
+									</caption>
+								</mediaobject>
+							</screenshot>
+						</figure>
+					</listitem>
+					<listitem>
+						<para>Fill in the fields as follows:</para>
+						<itemizedlist mark="bullet">
+							<listitem>
+								<para><guilabel>Project ID</guilabel>: Enter a unique identifier for the project. This value identifies the new Project
+								in the Polarion project database. <!-- TO DO: acceptable characters --></para>
+							</listitem>
+							<listitem>
+								<para><guilabel>Template</guilabel>: Select the desired template in the drop-down list. By default, there will be only
+									the <guilabel>Empty Project</guilabel> template available. If your administrator has added other project templates
+								to the system, these will appear in the drop-down list.</para>
+							</listitem>
+							<listitem>
+								<para><guilabel>Path</guilabel>: Enter a name for the root folder of the new project. <!-- TODO: What means project ID will be attached? --></para>
+							</listitem>
+						</itemizedlist>
+					</listitem>
+					<listitem>
+						<para>Click the <guibutton>Next</guibutton> button. The following appears in the Working Area:</para>
+						<figure id="ug_gsproject_creating_new_empty_shot2">
+							<title>New Project</title>
+							<screenshot>
+								<mediaobject>
+									<imageobject>
+										<imagedata fileref="help_home/screenshots/getstart/new_project_go.png" format="PNG"/>
+									</imageobject>
+									<textobject>
+										<phrase>View of the new project wizard screen for a new empty project</phrase>
+									</textobject>
+									<caption>
+										<para>Final project creation step</para>
+									</caption>
+								</mediaobject>
+							</screenshot>
+						</figure>
+					</listitem>
+					<listitem>
+						<para>In the <guilabel>Project Name</guilabel> field, enter a name for the new Project. This is the name that will appear
+						in the list of projects in the <guilabel>Projects</guilabel></para>
+					</listitem>
+					<listitem>
+						<para>Click the <guibutton>Create</guibutton> button to finish the operation and create the new Project and empty project folder in the repository.</para>
+					</listitem>
+				</orderedlist>
+			</sect3>
+
+			<sect3 id="ug_gsproject_creating_new_mark">
+				<title>Creating a new project by marking an existing repository folder</title>
+				<para>You many not always want to create a new Project in Polarion &quot;from scratch&quot;.
+				For example, you may have an existing folder structure in your Subversion repository that you want to start managing
+				with Polarion. In this case, you need to specify the root folder and tell Polarion
+				to &quot;mark&quot; it as a project folder.</para>
+
+				<para><emphasis>To create a new Project from an existing repository folder tree:</emphasis></para>
+				<orderedlist spacing="compact">
+					<listitem>
+						<para>Log into Polarion and click <guilabel>Administration</guilabel> in the perspective selector (bottom of
+						the left navigation. Recall that you must have global Administrator rights to access the Administration perspective.)</para>
+					</listitem>
+					<listitem>
+						<para>In the <guilabel>Projects</guilabel> portlet, click <guilabel>Repository</guilabel>.</para>
+					</listitem>
+					<listitem>
+						<para>In the <guilabel>Topics</guilabel> portlet, expand the <guilabel>Projects</guilabel> node and click the
+							<guilabel>Projects</guilabel>sub-node. A table of currently defined Projects loads in the Working Area.</para>
+					</listitem>
+					<listitem>
+						<para>Go to the <guilabel>Projects</guilabel> table displayed in the	Working Area and click the <guibutton>Mark Folder as Project</guibutton> button.</para>
+						<para>The following controls appear in the Working Area:</para>
+
+						<figure id="ug_gsproject_creating_new_mark_shot1">
+							<title>New Project</title>
+							<screenshot>
+								<mediaobject>
+									<imageobject>
+										<imagedata fileref="help_home/screenshots/getstart/new_project_mark.png" format="PNG"/>
+									</imageobject>
+									<textobject>
+										<phrase>View of the new project wizard screen for a new project based on an existing folder</phrase>
+									</textobject>
+									<caption>
+										<para>New project specification: specify the existing folder to mark as Project</para>
+									</caption>
+								</mediaobject>
+							</screenshot>
+						</figure>
+						</listitem>
+					<listitem>
+						<para>The repository root path appears to the left of an edit box. In the edit box, type the repository path to the folder you want to
+						mark as being a Project folder. Use forward slashes (/) to separate subfolders.</para>
+						<example>
+							<title>Repository Root Path</title>
+							<para>Given a repository root path of <filename>http://ourdomain.com/repos/</filename>, and an existing subfolder
+							<filename>projects/java/someproject</filename>, your entry would look something like:</para>
+							<para><literal>http://ourdomain.com/repos/</literal>[<userinput>projects/java/someproject</userinput>].</para>
+						</example>
+					</listitem>
+					<listitem>
+						<para>Click the <guibutton>Mark</guibutton> button to create the project based on the specified root folder.</para>
+					</listitem>
+				</orderedlist>
+			</sect3>
+        </sect2>
+
+        <sect2 id="ug_gsproject_accessing">
+            <title>Accessing Projects</title>
+            <para>All users have read access to Projects in Polarion. You may have write (change) as
+			well depending on your role on your team.</para>
+
+            <para><emphasis>To access a Project</emphasis></para>
+
+            <orderedlist numeration="arabic">
+				<listitem>
+					<para>Log in to Polarion.</para>
+				</listitem>
+				<listitem>
+					<para>If you are not already in the <guilabel>Projects</guilabel> perspective, click the <guimenuitem>Projects</guimenuitem>
+					perspective selector.</para>
+				</listitem>
+				<listitem>
+					<para>Select the Project you want to access in the <guilabel>Projects</guilabel> portlet.</para>
+				</listitem>
+			</orderedlist>
+
+            <para>If you have just logged in, you will be taken to the <guilabel>Dashboard</guilabel> Topic and the Project's Dashboards will load
+				in the Working Area. If you change Projects, the newly selected Project opens with the same Topic (e.g. Dashboard). </para>
+
+            <sect3 id="ug_gsproject_accessing_docs">
+				<title>Accessing Project documents</title>
+				<para>To access documents of the current project, expand the relevant Project node in the <guilabel>Projects</guilabel>
+				portlet and select the <guilabel>documents</guilabel> folder. The repository URL to the documents folder appears in the
+				Working Area. You can use this URL with the SVN command line or a SVN client to checkout the documents folder. If
+				documents exist in the <guilabel>documents</guilabel> folder, a table listing them appears beneath the URL in the
+				Working Area.</para>
+				<figure id="shot_project_docs">
+					<title>Documents Overview</title>
+					<screenshot>
+						<mediaobject>
+							<imageobject>
+								<imagedata fileref="help_home/screenshots/proj_documents_oview.png" format="PNG"/>
+							</imageobject>
+							<textobject>
+								<phrase>Project documents overview</phrase>
+							</textobject>
+							<caption>
+								<para>Project documents overview</para>
+							</caption>
+						</mediaobject>
+					</screenshot>
+				</figure>
+				<note>
+					<title>Enterprise Edition Note</title>
+					<para><inlinegraphic fileref="help_home/images/enterprise_sm.gif" format="GIF" valign="middle" width="17"/> While you can store documents in the project
+					repository in all Polarion editions, you can only edit them "live" in Polarion Enterprise Edition. For more information see
+					<link linkend="ug_reqmgmt_inception_livedocs">Working with Live Documents</link>.</para>
+				</note>
+			</sect3>
+
+            <sect3 id="ug_gsproject_accessing_wis">
+				<title>Accessing Project Work Items</title>
+				<para>"Work Item" is a general term applied to anything that needs to be worked on. Work Items include Requirements, Tasks,
+				Change Requests, Tests, and Defects.</para>
+				<para>For basic access to Work Items, click the <guilabel>Work Items</guilabel> topic in the <guilabel>Topics</guilabel> portlet
+				when the relevant Project is selected in the <guibutton>Projects</guibutton> portlet.</para>
+
+					<sect4 id="ug_gsproject_accessing-wis_views">
+					<title>Work Item Views</title>
+					<para>The Working Area presents several views on Work Items. These appear as a tab set:</para>
+					<figure id="gs-projects-access-wi_views_shot1">
+						<title>Work Items</title>
+						<screenshot>
+							<mediaobject>
+								<imageobject>
+									<imagedata fileref="help_home/screenshots/getstart/wi_view_tabs.png" format="PNG"/>
+								</imageobject>
+								<textobject>
+									<phrase>Shows the Work Item view tabs in the Working Area</phrase>
+								</textobject>
+								<caption>
+									<para>Work Item view tabs in the Working Area</para>
+								</caption>
+							</mediaobject>
+						</screenshot>
+					</figure>
+					<para>The names of the tabs describe the format or functionality of the views.</para>
+					<itemizedlist mark="bullet">
+						<listitem>
+							<para><emphasis role="bold">Table</emphasis>: Displays a table of Work Items accessed by the current navigation selection and/pr query.</para>
+						</listitem>
+						<listitem>
+							<para><emphasis role="bold">Tree</emphasis>: Displays a table of Work Items accessed by the current navigation selection and/or Search query in a tree
+							structure that shows related Work Items up to 10 levels deep.</para>
+						</listitem>
+						<listitem>
+							<para><emphasis role="bold">Live Plan</emphasis>: Presents a Live Plan of just the Work Items accessed by the current navigation selection and/or search query.
+							You can select a Work Item in the chart and edit it in the detail area.</para>
+						</listitem>
+						<listitem>
+							<para><emphasis role="bold">Road Map</emphasis>: Presents a table of Work Items selected by the current navigation and/or search query. You can
+							further filter the selection according to Time Point.</para>
+						</listitem>
+						<listitem>
+							<para><inlinegraphic fileref="help_home/images/enterprise_sm.gif" format="GIF" valign="middle" width="17"/> <emphasis role="bold">Matrix</emphasis>: Enables you to trace links between Work Items. You create two system queries:
+							one for Rows and one for Columns of the matrix. With the search results you can specify the relationship you want to see
+							in the results: dependency, duplication, relativity, etc.</para>
+						</listitem>
+						<listitem>
+							<para><emphasis role="bold">Multi Edit</emphasis>: Places all Work Items in the current navigation or query selection into edit mode in which
+							the main data fields can be edited.</para> <!-- TO DO: Link -->
+						</listitem>
+						<listitem>
+							<para><emphasis role="bold">Bulk Edit</emphasis>: Presents a single editor pane in which you can edit Work Item fields and apply your changes
+							to all the work items currently selected by the current navigation or search query.</para>
+						</listitem>
+					</itemizedlist>
+				</sect4>
+
+				<sect4 id="ug_gsproject_accessing_wis_filter">
+					<title>Using queries and shortcuts</title>
+					<para>You can use queries and Shortcuts to filter the list of Work Items.</para>
+					<itemizedlist mark="bullet">
+						<listitem>
+							<para>You can filter the Work Item view for a particular type of Work Item by clicking on the one of the sub-topics
+							of the <guilabel>Work Items</guilabel> topic ( in the <guilabel>Topics</guilabel> portlet).</para>
+						</listitem>
+						<listitem>
+							<para>You can use certain Shortcuts in the <guilabel>Shortcuts</guilabel> portlet to filter the list of Work Items. For
+							example, the <guilabel>My Work Items</guilabel> shortcut limits the display to only Work Items assigned to you.</para>
+						</listitem>
+						<listitem>
+							<para>You can further refine any view with a query. The parameters of the current query are always shown beneath the
+							view tabs. You can use any of the controls to customize the current query to further filter the Work Items shown.</para>
+						</listitem>
+					</itemizedlist>
+					<tip>
+						<para>You can save the results of any query and the current state of a view as a Shortcut by clicking the <guiicon>Save As Shortcut</guiicon>
+						icon in the Search bar of the Working Area.</para>
+						<para>Saving a shortct stores the selected view tab, all query parts, table columns, and table sorting.</para>
+						<para>You can customize existing shortcuts with the <guiicon>Customize</guiicon> icon located on the title bar of the
+						<guilabel>Shortcuts</guilabel> portlet.</para>
+					</tip>
+				</sect4>
+			</sect3>
+        </sect2>
+
+        <sect2 id="ug_gsproject_export">
+            <title>Exporting to MS Project</title>
+            <para><inlinegraphic fileref="help_home/images/enterprise_sm.gif" format="GIF" valign="middle" width="17"/> Microsoft Project Export is a feature of Polarion Enterprise Edition only.</para>
+			<para>You can export an entire Project, or any subset of the Work Items comprising it, to various Microsoft formats, including
+			MS Office Word, MS Office Excel, and Microsoft Project.</para>
+			<figure id="ug_gsproject_export_shot1">
+				<title>Export</title>
+				<screenshot>
+					<mediaobject>
+						<imageobject>
+							<imagedata fileref="help_home/screenshots/getstart/ms_project_export.png" format="PNG"/>
+						</imageobject>
+						<textobject>
+							<phrase>Shows the interaction and result of export to MS Project.</phrase>
+						</textobject>
+						<caption>
+							<para>Exporting a Project to Microsoft Project</para>
+						</caption>
+					</mediaobject>
+				</screenshot>
+			</figure>
+			<para><emphasis>To export a Project:</emphasis></para>
+			<orderedlist numeration="arabic">
+				<listitem>
+					<para>Be sure you are working in the Project you want to export it should be selected in the <guilabel>Projects</guilabel> portlet
+					in the left Main Navigation panel.</para>
+				</listitem>
+				<listitem>
+					<para>If you want to export the entire Project, select the <guilabel>Work Items</guilabel> node in the <guilabel>Topics</guilabel> portlet.
+					If you want to export a subset of the Project, select an appropriate Shortcut in the <guilabel>Topics</guilabel> portlet or execute an appropriate
+					saved query or custom query built with the Query Builder (accessed in the Working Area's Search bar).</para>
+				</listitem>
+				<listitem>
+					<para>Click the <guibutton>Operations</guibutton> action button and select <guimenuitem>Export</guimenuitem> in the action menu.
+					A browser popup window appears.</para>
+				</listitem>
+				<listitem>
+					<para>Select the desired target format, character set, and use the checkboxes in the data columnns list to choose which data you want to export.</para>
+				</listitem>
+				<listitem>
+					<para>Click the <guibutton>Download</guibutton> button and choose the location to save the data file on your local system.
+					The selected data is saved in an appropriate XML format which you can subsequently open in the relevant Microsoft application.</para>
+				</listitem>
+			</orderedlist>
+			<sect3 id="ug_gsproject_export_opening_exported">
+				<title>Opening the exported file in MS Project</title>
+				<para>The xml file that is created as a result of the <guimenuitem>Export to MS Project</guimenuitem> action should <emphasis role="bold">not</emphasis> be renamed
+				with a .mpp extension before opening it in MS Project.</para>
+				<para>There are 2 ways to open the exported file in MS Project:</para>
+				<itemizedlist mark="bullet">
+					<listitem>
+						<para>Using Windows Explorer context menu</para>
+					</listitem>
+					<listitem>
+						<para>Using MS Project File menu</para>
+					</listitem>
+					<listitem>
+						<para></para>
+					</listitem>
+				</itemizedlist>
+				<para><emphasis>To open the exported file using Windows Explorer:</emphasis></para>
+				<orderedlist numeration="arabic">
+					<listitem>
+						<para>Selecting the exported file in Windows Explorer</para>
+					</listitem>
+					<listitem>
+						<para>Right-click on the file and choose <guimenuitem>Open in</guimenuitem> on the context menu, followed by <guimenuitem>MS Project</guimenuitem> on the submenu;</para>
+					</listitem>
+				</orderedlist>
+				<para>To open the exported file from MS Project:</para>
+				<orderedlist numeration="arabic">
+					<listitem>
+						<para>Open MS Project.</para>
+					</listitem>
+					<listitem>
+						<para>Open the Open File dialog.</para>
+					</listitem>
+					<listitem>
+						<para>Choose <guimenuitem>xml format</guimenuitem>, select the xml file, and click <guibutton>Open</guibutton>.</para>
+					</listitem>
+					<listitem>
+						<para>Choose the <guilabel>As new project</guilabel> option.</para>
+					</listitem>
+				</orderedlist>
+			</sect3>
+        </sect2>
+    </sect1>
+
+    <!--
+            WORK ITEMS TOPICS:
+    -->
+
+    <sect1 id="ug_wi_basics">
+        <title>Work Item Basics</title>
+        <?dbhtml filename="ug_workitem_basics.html"?>
+        <para>This section provides and introduction to the basics of handling Work Items in Polarion.</para>
+
+        <sect2 id="ug_wibasics_witypes">
+            <title>Work Item Types</title>
+            <para>A Work Item is the Polarion term for an artifact of the development process that is waiting to be implemented, is
+                in progress, or has been implemented.
+                The default types of Work Items are:</para>
+            <itemizedlist mark="bullet">
+                <listitem>
+                    <para>Requirement</para>
+                </listitem>
+                <listitem>
+                    <para>Task</para>
+                </listitem>
+                <listitem>
+                    <para>Change Request</para>
+                </listitem>
+                <listitem>
+                    <para>Defect</para>
+                </listitem>
+            </itemizedlist>
+
+            <para>Work Item types are user defined. The default types can be changed and/or new types can be defined by an Administrator.
+                For more information, see Configuring Enumerations in the
+                Administrator's Guide.</para>
+
+            <para>Using the respective data fields for the purpose, a Work Item can be assigned to someone, and incorporated into Project planning and tracking..</para>
+        </sect2>
+
+        <sect2 id="ug_wibasics_browse_search">
+            <title>Browsing and Searching Work Items</title>
+            <para>Every Work Item is part of a Project, and is planned and tracked with the Project. If a Work Item has dependencies with another project, it is possible
+			to show this using the Link feature.</para>
+			<para>You can browse the Work Items in any project in different Views (tabs) in the Working Area: Table, Tree, Live Plan, <inlinegraphic fileref="help_home/images/enterprise_sm.gif" format="GIF" valign="middle" width="17"/> Matrix, etc.
+			Some Views are mainly just listings while others show relationships to time (Live Plan) or other items (Tree, <inlinegraphic fileref="help_home/images/enterprise_sm.gif" format="GIF" valign="middle" width="17"/> Matrix).</para>
+			<para>To browse Work Items, select the Project in the <guilabel>Projects</guilabel> list of the <guilabel>Projects</guilabel>
+			perspective, the select the tab for the desired view in the Working Area.</para>
+			<para>When you select a Work Item, its detail appears in the lower half of the Working Area and different portlets in that
+			pane display information about the Work Item such as priority, status, who it's assigned to, when it is (or was) started, when it will be (or was)
+			completed, etc.</para>
+			<sect3 id="ug_wibasics_browse_search_searching">
+				<title>Searching</title>
+                <para>Polarion provides robust query-based searching. Every View and every data display is actually the result of some
+				underlying query. There are a number of predefined queries that you can use to quickly locate and isolate a subset of all the Work Items in a
+				Project. These are saved as <link linkend="ug_gsproject_accessing_wis_filter"><emphasis>Shortcuts</emphasis></link>, which appear in the <guilabel>Shortcuts</guilabel>
+				portlet (main Navigation panel). Shortcuts are unique in that they are a combination of a View and a query. For example, a Shortcut
+				might access a set up Work Items and show them in the Tree view. You can create your own Search queries and
+				<link linkend="ug_gsproject_accessing_wis_filter">save them as Shortcuts</link>.</para>
+
+				<para>Each View tab in the Working displays a <guilabel>Search</guilabel> bar that you can use to create Search queries to locate the
+				Work Items you want to see. An example is shown in the following figure:</para>
+				<figure id="ug_wibasics_browse_search_shot1">
+					<title>Search Bar</title>
+					<screenshot>
+						<mediaobject>
+							<imageobject>
+								<imagedata fileref="help_home/screenshots/getstart/wi_view_tabs.png" format="PNG"/>
+							</imageobject>
+							<textobject>
+								<phrase>Shows the Search bar in the Tree view of the Working Area.</phrase>
+							</textobject>
+							<caption>
+								<para>Search bar (as it appears in the Tree view)</para>
+							</caption>
+						</mediaobject>
+					</screenshot>
+				</figure>
+				<sect4 id="ug_wibasics_browse_search_querybuilder">
+					<title>Using the Query Builder</title>
+					<para>Search queries can range from simple to complex depending on what subset of Work Items you want to find. If you
+					need something that is not provided by the default Views and Shortcuts, you can create a custom Search query using the Query Builder
+					feature which enables you to build complex queries visually.</para><!-- TO DO Section on Query Builder + screenshot -->
+					<para>You can access the Query Builder from the <guilabel>and</guilabel> field of the Search bar. Drop down the list and select
+					the <guimenuitem>Query Builder</guimenuitem> item in the list.</para>
+					<figure id="ug_wibasics_browse_search_querybuilder_shot1">
+						<title>Query Builder</title>
+						<screenshot>
+							<mediaobject>
+								<imageobject>
+									<imagedata fileref="help_home/screenshots/getstart/query_builder_access.png" format="PNG"/>
+								</imageobject>
+								<textobject>
+									<phrase>Shows how to access the Query Builder.</phrase>
+								</textobject>
+								<caption>
+									<para>How to access the Query Builder</para>
+								</caption>
+							</mediaobject>
+						</screenshot>
+					</figure>
+				</sect4>
+			</sect3>
+            <sect3 id="gs-workitems_ops_stored_queries">
+				<title>Stored and shared queries</title>
+				<para>Queries are what fetches the Work Items that display in the Work Item tables and other views. Useful queries can be saved
+				and reused in several ways. As mentioned in <link linkend="ug_gsproject_accessing_wis_filter">Shortcuts</link>, your
+				most commonly reused queries can be saved as Shortcuts to make them accessible from the <guilabel>Shortcuts</guilabel>
+				portlet. But you can store and share other queries which are accessible from the Search bar's <guilabel>and</guilabel> field.
+				Queries can be global in scope or limited to the scope of one Project or even just yourself as a user.</para>
+				<sect4 id="gs-workitems_ops_stored_queries_access">
+					<title>Accessing stored/shared queries</title>
+					<para>The drop-down list in the Search bar's <guilabel>and</guilabel> field provides access to all currently saved/shared queries.</para>
+					<figure id="gs-workitems-stored-queries_ss">
+						<title>Stored Queeries</title>
+						<screenshot>
+							<mediaobject>
+								<imageobject>
+									<imagedata fileref="help_home/screenshots/getstart/queries_saved_shared.png" format="PNG"/>
+								</imageobject>
+								<textobject>
+									<phrase>Shows the access to stored/shared queries for all scopes.</phrase>
+								</textobject>
+								<caption>
+									<para>Accessing stored/shared queries</para>
+								</caption>
+							</mediaobject>
+						</screenshot>
+					</figure>
+				</sect4>
+            </sect3>
+        </sect2>
+
+        <sect2 id="ug_wibasics_create_edit">
+            <title>Creating and Editing Work Items</title>
+            <para>This section provides a quick overview on how to create a new Work Item and how to edit an existing Work Item.</para>
+			<sect3 id="ug_wibasics_create_edit_creating">
+				<title>Creating New Work Items</title>
+				<para>Work Items can be created in the system in two ways:</para>
+				<itemizedlist mark="bullet">
+					<listitem>
+						<para>Manually</para>
+					</listitem>
+					<listitem>
+						<para>Using Live Documents</para>
+					</listitem>
+				</itemizedlist>
+				<para>This section discusses manual creation. For information about Live Documents see <link linkend="ug_reqmgmt_inception_livedoc_new">Working with Live Documents</link>.</para>
+				<para><emphasis>To create a new Work Item</emphasis></para>
+				<orderedlist numeration="arabic">
+					<listitem>
+						<para>Make sure you are working in the <guilabel>Projects</guilabel> perspective, and have selected the Project the new Work Item
+						should belong to in the <guilabel>Projects</guilabel> portlet.</para>
+					</listitem>
+					<listitem>
+						<para>In the <guilabel>Topics</guilabel> portlet, click the <userinput>Work Items</userinput> node.</para>
+					</listitem>
+					<listitem>
+						<para>In the Working Area, select the <guilabel>Table</guilabel> view. A table of the currently existing Work Items in this Project
+						appears in the upper half of the Working Area.</para>
+					</listitem>
+					<listitem>
+						<para>In the Working Area, click the <guilabel>Create</guilabel> action button, and select the type of Work Item you want to create from
+						the drop-down menu. <!-- TO DO: Check this interaction for accuracy --></para>
+					</listitem>
+					<listitem>
+						<para>Follow the next sequence of screens (similar to a "wizard") to create the new Work Item.</para>
+					</listitem>
+				</orderedlist>
+			</sect3>
+			<sect3 id="ug_wibasics_create_edit_editing">
+				<title>Editing Work Items</title>
+				<para>You can edit existing Work Items either singly or several at a time (Bulk Edit). The latter is useful for such tasks as assigning
+				multiple Work Items to the same person, or setting the same status, priority, or start/end date for several items. </para>
+				<sect4 id="ug_wibasics_create_edit_editing_bulk">
+					<title>Editing multiple Work Items at once</title>
+					<para>The <guilabel>Bulk Edit</guilabel>	view tab in the Working Area enables you to select multiple Work Items and
+					edit them as a unit. When you save the changes, the  field values are applied to all selected Work Items.</para>
+					<para>The Work Items that appear in the Bulk Edit view vary according to the current system query. You can use Shortcuts,
+					saved or custom Search queries to isolate or narrow the subset of Work Items you want to edit all at once.</para>
+					<para><emphasis>To selected and edit multiple Work Items:</emphasis></para>
+					<orderedlist numeration="arabic">
+						<listitem>
+							<para>Make sure you are working in the correct Project, and in the <guilabel>Work Items</guilabel> topic in that project.</para>
+						</listitem>
+						<listitem>
+							<para>Select the <guilabel>Bulk Edit</guilabel> view tab in the Work Area. A table of Work Items appears in the upper pane. The list
+							of Work Items Depends on the current system query.</para>
+						</listitem>
+						<listitem>
+							<para>Use shortcuts or the Search feature (including the Query Builder if needed) so that the results contain all the Work Items you
+							want to edit.</para>
+						</listitem>
+						<listitem>
+							<para>The leftmost columnn of Work Items table now contains a checkbox. Check this box for
+							each Work Item you want to edit.</para>
+							<tip>
+								<para>You can select or deselect all the items in the table by checking or clearing the checkbox in the header
+								of this columnn.</para>
+							</tip>
+						</listitem>
+						<listitem>
+							<para>Go to the Work Item detail pane (lower half of the Working Area). Check the box next to each field you
+							want to edit, then change the field value as desired. If the field is not available for Bulk Edit, the checkbox next
+							to the field is disabled and you will not be able to change the field value.</para>
+						</listitem>
+						<listitem>
+							<para>Click the <guibutton>Submit</guibutton> button to save your changes and apply them to all the selected Work Items.</para>
+						</listitem>
+					</orderedlist>
+					<figure id="ug_wibasics_create_edit_editing_bulk_shot1">
+						<title>Bulk Edit</title>
+						<screenshot>
+							<mediaobject>
+								<imageobject>
+									<imagedata fileref="help_home/screenshots/getstart/wi_bulk_edit.png" format="PNG"/>
+								</imageobject>
+								<textobject>
+									<phrase>Shows the Work Item selection for Bulk Edit, and the single editor for all selected items.</phrase>
+								</textobject>
+								<caption>
+									<para>Bulk Editing multiple Work Items</para>
+								</caption>
+							</mediaobject>
+						</screenshot>
+					</figure>
+					<note>
+						<para>Linked Work Items do not appear in the list of items in Bulk Edit, but you still can use Bulk Edit to remove linked
+						Work Items by entering the ID of a linked Work Item in the input field of the <guilabel>Linked Work Items</guilabel> portlet
+						and clicking on the <guiicon>-</guiicon> (minus) icon. You can use the "Workitem Picker" (by pressing [select]) to find the
+						Work Item if you don't remember its ID.</para>
+					</note>
+				</sect4>
+				<sect4 id="gs-workitems_editing_multiedit">
+					<title>Using Multi Edit View</title>
+					<para>The <guilabel>Multi Edit</guilabel> view also enable you to edit multiple work items, but it differs from <guilabel>Bulk Edit</guilabel>.
+					With <guilabel>Bulk Edit</guilabel>, you have a single editor pane and changes are applied to multiple Work Items. With Multi Edit,
+					all Work Items accessed by the current system query are editable in a single editor space in the Work Area. You edit a single Work Item at
+					a time, but all items are editable and changes to multiple items can be saved all at once. You can edit the
+					main data fields in this view, but not everything. For example, you can't create links or edit watchers.</para>
+                    <para><inlinegraphic fileref="help_home/images/enterprise_sm.gif" format="GIF" valign="middle" width="17"/> Multi Edit is a feature of
+                     Polarion for Subversion Enterprise Edition.</para>
+                </sect4>
+			</sect3>
+        </sect2>
+
+        <sect2 id="ug_wibasics_common_ops">
+            <title>Common Operations with Work Items</title>
+            <para>This section covers several common things that people need to do with Work Items.</para>
+
+            <sect3 id="ug_wibasics_commonops_assign">
+                <title>Assigning a Work Item</title>
+                <para>You assign a Work Item to a person using the <guilabel>Assignee</guilabel> field in the Work Item detail. This field
+				presents a drop-down list of all Polarion users. You assign the selected Work Item (or Items, if
+				working in Bulk Edit view) by selecting the user's name from the list. Note that the assignee must have an account on your
+				Polarion system in order to appear in the <guilabel>Assignee</guilabel> list. (It can be easy to omit setting up accounts
+                for e.g. a domain expert who is not on the engineering team but who needs to be assigned a Requirement.)</para>
+            </sect3>
+
+            <sect3 id="ug_wibasics_commonops_status">
+                <title>Changing a Work Item's status</title>
+                <para>You can initiate a change of status for a selected Work Item directly in the detail pane without entering Edit mode. The
+				<guilabel>Status</guilabel> field has a drop-down list that displays a choice of <systemitem>Workflow Actions</systemitem>.
+				These are configured by the Polarion administrator and are what actually changes the status value of the item according to the
+                configured status and status transition definitions. (See Administrator's Guide: Workflow)
+                for	more information.</para>
+
+				<para>Selecting a new Workflow Action (<guimenuitem>Resolve and Close</guimenuitem>, for example), triggers Edit mode, where you
+				can add a comment, set a value for <guilabel>Resolution</guilabel>, edit linked Work Items, etc. When you click the
+				<guibutton>Update</guibutton>, the Workflow Action sets the appropriate status value which subsequently appears in the user interface. </para>
+            </sect3>
+
+            <sect3 id="ug_wibasics_commonops_commenting">
+                <title>Adding Comments to a Work Item</title>
+                <para>[PLACEHOLDER]</para>
+            </sect3>
+
+            <sect3 id="ug_wibasics_commonops_attach">
+                <title>Attaching files to a Work Item</title>
+                <para>[PLACEHOLDER]</para>
+            </sect3>
+
+            <sect3 id="ug_wibasics_commonops_vote">
+                <title>Voting</title>
+                <para>[PLACEHOLDER]</para>
+            </sect3>
+
+            <!-- PLANNING CONSTRAINTS -->
+            <!-- TODO Check if this is OK here or needs to move to Project Manager section -->
+            <!--  This appears at this point in 2.0 docs that's why it's here for now. -->
+            <sect3 id="ug_wibasics_commonops_plan_constraints">
+                <title>Setting Planning Constraints</title>
+                <para>The <guilabel>Planning constraint</guilabel> field enables you to fix the planned start or end date for a Work Item. The
+					date you specify is reflected in the Live Plan.</para> <!-- TODO Check if need a link to Live Plan info -->
+				<figure id="ug_wibasics_commonops_plan_constraints_shot1">
+					<title>Setting Planning Constraints</title>
+					<screenshot>
+						<mediaobject>
+							<imageobject>
+								<imagedata fileref="help_home/screenshots/getstart/wi_planning_const.png" format="PNG"/>
+							</imageobject>
+							<textobject>
+								<phrase>Shows the Planning Constraint field and popup date picker</phrase>
+							</textobject>
+							<caption>
+								<para>Planning constraint field and popup date picker</para>
+							</caption>
+						</mediaobject>
+					</screenshot>
+				</figure>
+				<important>
+					<para>You will not see relevant planning results for unassigned and unestimated Work Items.</para>
+				</important>
+				<sect4 id="ug_wibasics_commonops_plan_constraints_liveplan">
+					<title>Planned items in the Live Plan</title>
+					<para>When the <guilabel role="label">Planning Constraint</guilabel> and <guilabel role="label">Due Date</guilabel> fields are
+					set, the Work Item spans the defined time period in the Live Plan view. The popup detail (when you click on the Work Item in the
+					Live Plan view) includes Planned Start Date and Planned End Date and Remaining Information.</para>
+				</sect4>
+            </sect3>
+
+            <!--  PRINTING -->
+            <sect3 id="ug_wibasics_commonops_printing">
+                <title>Printing a Work Item</title>
+                <para>You can print one or multiple selected Work Items to any printer to which your computer has access.  You can select a single Work Item
+					for printing in the Table, Tree, Live Plan, or Road Map views. You can select multiple Work Items for print in the Bulk Edit view.</para>
+				<para><emphasis>To print Work Items:</emphasis></para>
+				<orderedlist numeration="arabic">
+					<listitem>
+						<para>Select the Work Item(s) you want to print in the appropriate view.</para>
+					</listitem>
+					<listitem>
+						<para>Locate the action button labeled <guilabel>Operations</guilabel> and click it to drop down a menu of actions.</para>
+					</listitem>
+					<listitem>
+						<para>Choose <guimenuitem>Print</guimenuitem> in the <guilabel>Operations</guilabel> action list.</para>
+					</listitem>
+					<listitem>
+						<para>Your system print dialog appears. Choose the target printer in this dialog, set desired print job properties if your
+						print dialog provides this functionality, and launch the print job.</para>
+					</listitem>
+				</orderedlist>
+            </sect3>
+        </sect2>
+
+        <!-- LINKING -->
+        <sect2 id="ug_wibasics_linking">
+            <title>Linking Work Items</title>
+            <para>Linking Work Items is the key to being able to take advantage of <inlinegraphic fileref="help_home/images/enterprise_sm.gif" format="GIF" valign="middle" width="17"/>
+            Polarion Enterprise Edition's  Traceability 	and Impact Analysis features. Your team should plan and follow a process of linking Work Items from the outset.</para>
+            <para>Generally speaking, you want to create links from Requirements to the Tasks and/or Change Requests that fulfill them,
+            and also links from Tasks/Change Requests to the repository revision in which they are implemented. By doing this, your
+            team will have several key advantages with Polarion:</para>
+            <itemizedlist mark="bullet">
+                <listitem>
+                    <para>Possibility to trace from Requirements to the Work Items and code that fulfill them</para>
+                </listitem>
+                <listitem>
+                    <para>Possibility to backtrace from e.g. defective code (in a repository revision) to the Tasks/Change Requests that implemented
+                    the defective code, and from those to the Requirement that called for the functionality.</para>
+                </listitem>
+                <listitem>
+                    <para>Possibility to assess the impact (and by extension, the cost) of a changed Requirement by seeing all the artifacts
+                    that would be affected by the change.</para>
+                </listitem>
+                <listitem>
+                    <para>Possibility to view and analyze various relationships between Work Items such as dependency, relatedness, parent-child,
+                        duplication, and follow-up.</para>
+                </listitem>
+            </itemizedlist>
+            <para>This section describes the basic techniques for creating Links. There are basically 3 ways to do it:</para>
+            <orderedlist numeration="arabic" spacing="compact">
+                <listitem>
+                    <para>Create links while editing an <link linkend="gs-workitems_linking_indiv">individual Work Item</link>.</para>
+                </listitem>
+                <listitem>
+                    <para>Create links for <link linkend="gs-workitems_linking_bulk">multiple Work Items</link> at once using Bulk Edit.</para>
+                </listitem>
+                <listitem>
+                    <para>Create links using the <inlinegraphic fileref="help_home/images/enterprise_sm.gif" format="GIF" valign="middle" width="17"/> <link linkend="gs-workitems_linking_matrix">Matrix View</link>.</para>
+                </listitem>
+            </orderedlist>
+			<sect3 id="gs-workitems_linking_indiv">
+                <title>Linking individual Work Items</title>
+                <para>In the Work Item detail pane you can click the <guibutton>Links</guibutton> button to auto-scroll the view to the
+                link portlets: <guilabel>Linked Repository Revisions</guilabel> and <guilabel>Linked Work Items</guilabel>. Use the
+                small <guibutton>Add</guibutton> in either or these portlets to open the link editor in which you can select the revision
+                or Work Item you want to link to the current Work Item.</para>
+                <figure id="shot1">
+                    <title>Link Portlets</title>
+                    <screenshot>
+                        <mediaobject>
+                            <imageobject>
+                                <imagedata fileref="help_home/screenshots/getstart/wi_link_create.png" format="PNG"/>
+                            </imageobject>
+                            <textobject>
+                                <phrase>Shows the portlets for link creation in read and edit modes</phrase>
+                            </textobject>
+                            <caption>
+                                <para>Link portlets in read mode and edit mode.</para>
+                            </caption>
+                        </mediaobject>
+                    </screenshot>
+                </figure>
+            </sect3>
+            <sect3 id="gs-workitems_linking_bulk">
+                <title>Linking multiple Work Items at once</title>
+                <para>The technique in Bulk Edit is the same as for single Work Items (see previous screenshot). The same portlets exist in the
+                bulk editor. The difference is that you can create the same link(s) to multiple selected Work Items in a single operation.</para>
+            </sect3>
+            <sect3 id="gs-workitems_linking_matrix">
+                <title>Using the Matrix view to create and browse links</title>
+                <para><inlinegraphic fileref="help_home/images/enterprise_sm.gif" format="GIF" valign="middle" width="17"/> Traceability Analysis is a feature of Polarion Enterprise Edition only.</para>
+                <para>The Matrix view provides a robust way to both create and browse links. The matrix is populated with 2 subsets of
+                Work Items, one for matrix rows, and one for columnns. Each subset is built with a query in the special dual version of
+                the Search bar. Each query can access either Work Items or repository revisions, so the matrix can show links between
+                Work Items only, or between Work Items and repository revisions. Work Item queries can also filter for link Role-
+                "depends on" or "related to", for example.</para>
+                <para>When the matrix has been populated, the intersection of each row and columnn shows if there is an existing link
+                between the items in that row/column, and provides the possibility to create one if none currently exists. Existing
+                links show and arrow in the intersection indicating the direction of the link. Clicking on the intersection pops up
+                details about the link.</para>
+
+                <figure id="gs-workitems_linking_matrix_shot1">
+                    <title>Matrix View Search</title>
+                    <screenshot>
+                        <mediaobject>
+                            <imageobject>
+                                <imagedata fileref="help_home/screenshots/matrix_queries_link_details.png" format="PNG"/>
+                            </imageobject>
+                            <textobject>
+                                <phrase>Shows the Matrix view with dual Search queries and link details.</phrase>
+                            </textobject>
+                            <caption>
+                                <para>Matrix view showing dual Search queries and popup link details</para>
+                            </caption>
+                        </mediaobject>
+                    </screenshot>
+                </figure>
+
+				<para>Refer to the screenshot below when following the procedure to create a link using the Matrix view:</para>
+				<figure id="gs-workitems_linking_matrix_shot2">
+					<title>Matrix View Toolbar</title>
+					<screenshot>
+						<mediaobject>
+							<imageobject>
+								<imagedata fileref="help_home/screenshots/matrix_create_link.png" format="PNG"/>
+							</imageobject>
+							<textobject>
+								<phrase>Shows the toolbar and matrix in mode for link creation</phrase>
+							</textobject>
+							<caption>
+								<para>Matrix toolbar in link creation mode</para>
+							</caption>
+						</mediaobject>
+					</screenshot>
+				</figure>
+				<para><emphasis>To create a link in the Matrix view:</emphasis></para>
+				<orderedlist numeration="arabic">
+					<listitem>
+						<para>Populate the rows and columnns of the matrix by building queries that will display the source and target Work Items
+						(or Work Items and repository revisions) in the matrix rows and columnns.</para>
+					</listitem>
+					<listitem>
+						<para>Toggle Link mode by clicking the Link Mode button in the toolbar (see screenshot).</para>
+					</listitem>
+					<listitem>
+						<para>In the <guilabel>Role</guilabel> combobox, select a role for the link.</para>
+					</listitem>
+					<listitem>
+						<para>Select the directionality of the link using the <guilabel>Direction</guilabel> buttons.</para>
+						<tip>
+							<para>You can do this step either before or after creating the link in the matrix (see next step).</para>
+						</tip>
+					</listitem>
+					<listitem>
+						<para>Locate the intersection of the Work Items you want to link (or the Work Item and the repository revision you want to
+							link, and click on that cell. A green arrow appears in the cell showing the directionality of the link. The actual link is not yet created.</para>
+					</listitem>
+					<listitem>
+						<para>Click the <guibutton>Submit</guibutton> to create the link. The green arrow in the cell changes to black.</para>
+					</listitem>
+				</orderedlist>
+            </sect3>
+
+            <sect3 id="wi_planning_links">
+                <title>How Links are handled in Live Plan</title>
+                <para>There are 2 kinds of links recognized by the Live Plan feature: <systemitem>depends</systemitem> and <systemitem>parent</systemitem>. The <filename>planning.xml</filename>
+                file in Administration assigns existing Work Item link roles to these two categories. (Links with roles which are of neither the <systemitem>depends</systemitem> nor the
+                <systemitem>parent</systemitem> kind are ignored by Live Plan).</para>
+                <sect4 id="wi_planning_depend">
+                    <title>Dependencies</title>
+                    <para>The dependent Work Item always links to the one it depends on. For example, if A depends on B, then A holds the link: B &lt;-- A. This kind of link ensures
+                    that A does not start before B ends. However, this does not influence the planning of B. Consider the situation when High priority task A depends on Low priority task B.
+                    Task A will be planned after task B.</para>
+                </sect4>
+                <sect4 id="wi_planning_parent">
+                    <title>Parents</title>
+                    <para>Children always link to the parent.  Therefore the 'contains' link role should not be used; the 'parent' role with the opposite direction should be used instead.
+                    The Live Plan always shows only the leaf nodes of the containment hierarchy. for example, if Requirement has child Tasks, then just the Tasks are shown, not the
+                    Requirement. The parent's planned start/end are calculated as the minimum/maximum of its children's planned starts/ends values. The Remaining/Initial Estimate value
+                    of the parent are not taken into account in this case.</para>
+               </sect4>
+            </sect3>
+        </sect2>
+
+        <sect2 id="ug_wibasics_export">
+				<title>Exporting Work Items</title>
+				<para>You can export one or multiple selected Work Items to an office document (MS Word or MS Excel).  You can select a single Work Item
+				for export in the Table, Tree, Live Plan, or Road Map views. You can select multiple Work Items for export in the Bulk Edit view.</para>
+				<para><emphasis>To export Work Items to a document:</emphasis></para>
+				<orderedlist numeration="arabic">
+					<listitem>
+						<para>Select the Work Item(s) you want to export in the appropriate view.</para>
+					</listitem>
+					<listitem>
+						<para>Locate the action button labeled <guilabel>Operations</guilabel> and click it to drop down a menu of actions.</para>
+					</listitem>
+					<listitem>
+						<para>Choose <guimenuitem>Export</guimenuitem> in the <guilabel>Operations</guilabel> action list.</para>
+					</listitem>
+					<listitem>
+						<para>Specify the type of document and the local path for saving it</para>
+					</listitem>
+				</orderedlist>
+				<note>
+					<title>Note about exported documents</title>
+					<para>Documents created by export are not <link linkend="ug_reqmgmt_inception_livedocs">Live Documents</link>, nor are they automatically added to
+					the repository- they are just documents stored on your local system. You cannot edit exported documents in Polarion
+					or track and manage them in Polarion unless you explicitly add them to a Subversion repository managed with Polarion.</para>
+				</note>
+			</sect2>
+    </sect1>
+
+    <sect1 id="ug_reqts_mgmt">
+        <title>Managing Requirements</title>
+        <?dbhtml filename="ug_reqts_mgmt.html"?>
+        <para>This chapter covers Polarion's Requirements Management features and functionality, including the exclusive
+        <emphasis>Live Documents</emphasis> feature.</para>
+
+        <sect2 id="ug_reqts_mgmt_overview">
+            <title>Overview of Capabilities</title>
+            <para>Polarion supports the 3 typical phases of the Requirements engineering process:</para>
+            <itemizedlist mark="bullet">
+                <listitem>
+                    <para>Inception</para>
+                </listitem>
+                <listitem>
+                    <para>Discussion/revision</para>
+                </listitem>
+                <listitem>
+                    <para>Approval</para>
+                </listitem>
+            </itemizedlist>
+            <para>Typically, managers and domain experts who define requirements prefer to work from the basis of office documents
+            such as <trademark>Microsoft Word</trademark> documents or <trademark>Microsoft Excel</trademark> worksheets. However,
+            the Engineering side needs a database-driven solution to be able to manage the complexity of their work. Traditionally,
+            one or the other, or both of these equally essential team components were forced to compromise for a less-than-optional
+            solution. Either domain experts were forced to learn an unfamiliar software system which did not support their mental
+            model in order to write up Requirements, or engineers were forced to deal with document-based requirements and the
+            resulting inefficiencies (for them).</para>
+
+            <para>Polarion provides a workable compromise for both sets of stakeholders through its
+            unique <emphasis>Live Document</emphasis> technology. Managers and other domain experts can, at their option, work
+            with familiar office documents to author requirements. Using special Live Document templates provided with
+            Polarion, authors' Requirements are automatically recognized by Polarion,
+            and relevant Work Items are created in the system. The Engineering side can use all the features of Polarion
+            to track and manage the Work Items. Any changes made to the Work Items are automatically reflected in the relevant
+            Live Document. This facilitates the review/approval process, as the Requirements authors, managers, domain experts, etc.
+            can review the Live Document (which they can download and read locally). If they in turn make changes to the Requirements,
+            by checking the Live Document in to Polarion, new Work Items are created, and existing Work
+            Items are updated automatically. In this way, all stakeholders in the Requirements Engineering and Management process
+            can work with the tools and in the environments that make them most productive.</para>
+        </sect2>
+
+        <sect2 id="ug_reqtsmgmt_inception">
+            <title>Inception Phase</title>
+            <para>This phase will typically involve 2 main activities:</para>
+            <itemizedlist mark="bullet">
+                <listitem>
+                    <para>Creating a new Requirement in the system</para>
+                </listitem>
+                <listitem>
+                    <para>Creating and editing Live Documents</para>
+                </listitem>
+            </itemizedlist>
+
+            <sect3 id="ug_reqmgmt_inception_newReq">
+                <title>Creating a New Requirement in the System</title>
+                <para>The starting point of the Requirement process is to create a new Requirement in the relevant Project of
+                  your Polarion syste. Once defines, you can creae Work Items either manually in the system, or by updloading
+                  a Live Document based on a Live Document template.</para>
+
+                <para>To create and edit Requirements, you need to be working in the <guilabel>Projects</guilabel> perspective.
+                    Select the relevant Project in the <guilabel>Projects</guilabel> portlet. </para>
+
+                <para><emphasis>To create a new Requirement:</emphasis></para>
+
+
+                <orderedlist numeration="arabic" spacing="normal">
+                    <listitem>
+                        <para>If necessary, select the tab for the <guilabel>Table</guilabel> view in the work area.</para>
+                    </listitem>
+                    <listitem>
+                        <para>Click the <guibutton>Create</guibutton> and select <guimenuitem>Requirement</guimenuitem> in the
+                        drop-down menu.</para> <!-- SCREENSHOT -->
+                        <para>The work item editor opens in the lower part of the work area with the fields for a new Requirement.</para>
+                    </listitem>
+                    <listitem>
+                        <para>Enter relevant information in the fields. Note that only <guilabel>Title</guilabel>,
+                            <guilabel>Priority</guilabel>, and <guilabel>Severity</guilabel> are required. <guilabel>Description</guilabel>
+                            is recommended for clarity.</para>
+                            <tip><para>Your system configuration may have other required fields. Required fields are marked with a
+                            red asterisk (*) next to the field label.
+                            </para></tip>
+                    </listitem>
+                    <listitem>
+                        <para>In the work item editor Toolbar, click the <guibutton>Create</guibutton> button to </para> <!-- SCREENSHOT -->
+                    </listitem>
+                </orderedlist>
+
+                <sect4 id="ug_reqmgmt_inception_newReq_wis">
+                    <title>Creating Work Items for a New Requirement</title>
+                    <para>After creating a new Requirement, there are 2 ways to create Work Items that relate to it.</para>
+
+                    <itemizedlist mark="bullet">
+				        <listitem>
+					    <para>Work Items can be created individually in the Polarion system. Link new Work Items to the relevant Requirement either singly,
+                            or all at once using the Bulk Edit feature.</para> <!-- TODO: Link to Bulk Edit -->
+				        </listitem>
+				        <listitem>
+					        <para>Work Items can be created automatically from a Live Document attached to the Requirement. Working with Live Documents is covered in the next section.</para>
+				        </listitem>
+			        </itemizedlist>
+			    </sect4>
+            </sect3>
+
+            <sect3 id="ug_reqmgmt_inception_livedocs">
+                <title>Working with Live Documents</title>
+                <para><inlinegraphic fileref="help_home/images/enterprise_sm.gif" format="GIF" valign="middle" width="17"/> Live Document is a feature of
+                    Polarion Enterprise Edition only.</para>
+
+                <para><productname>Polarion's</productname> <emphasis>Live Document</emphasis> technology enables those team members
+                who prefer to work with office documents to define requirements using <productname>MS Word</productname> and/or
+                <productname>MS Excel</productname> with special Live Document templates provided with Polarion.
+                When attached to a Requirement in the Polarion system, Work Items are automatically
+                created from the Live Document(s). Revisions to Work Items automatically propagate back to the relevant Live
+                Document, and revisions to a Live Document automatically create new Work Items or update existing ones.</para>
+
+                <para>Live Document templates are provided in the Polarion system installation on
+                the server. There is one template for MS Word and one for MS Excel. This section explains the basic process for
+                creating, editing, and saving Live Documents built with Live Document templates.</para>
+
+                <note>
+                    <title>Required Version of Microsoft Office</title>
+                    <para>The Live Documents feature works only with Microsoft Office 2003 <emphasis>Professional</emphasis>.
+                    Earlier versions of Microsoft Office, and MS Office 2003 <emphasis>Basic</emphasis> do NOT work with
+                    <productname>Polarion's</productname> Live Documents feature.</para>
+                </note>
+
+                <sect4 id="ug_reqmgmt_inception_livedoc_new">
+                    <title>Creating a New Live Document</title>
+                    <para>In order to create a Live Document, a folder named <guilabel>documents</guilabel> must exist in the Project.
+                    This folder should be created by the user who has administration permissions for creating Projects. Once you
+                    have a Project containing the <guilabel>documents</guilabel> folder, it is simple to create a new Live Document.</para>
+                    <para><emphasis>To create a new Live Document:</emphasis></para>
+                    <orderedlist numeration="arabic" spacing="normal">
+                        <listitem>
+                            <para>Select the <guilabel>documents</guilabel> folder in the <guilabel>Projects</guilabel> portlet. The
+                            work area displays the repository URL of the folder and a list of existing documents, if any.</para>
+                        </listitem>
+                        <listitem>
+                            <para>Click the <guibutton>New Document</guibutton> button in the work area. The work area displays headers
+                            for two options:</para>
+                            <itemizedlist mark="bullet">
+                                <listitem>
+                                    <para><guilabel>Create new document from template</guilabel></para>
+                                </listitem>
+                                <listitem>
+                                    <para><guilabel>Or upload new document</guilabel></para>
+                                </listitem>
+                            </itemizedlist>
+                        </listitem>
+                        <listitem>
+                            <para>To create a new document from a template, enter a name in the <guilabel>Document Name</guilabel> field,
+                            and choose a template in the <guilabel>Template</guilabel> list.</para>
+                        </listitem>
+                        <listitem>
+                            <para>Click the <guibutton>Submit</guibutton> button to create the new document. in the system (i.e.
+                            <emphasis>not</emphasis> locally.</para>
+                        </listitem>
+                    </orderedlist>
+                </sect4>
+
+                <sect4 id="ug_reqmgmt_inception_livedoc_view">
+                    <title>Viewing the New Live Document</title>
+                    <para>After creating a new Live Document, you can select it in the <guilabel>documents</guilabel> folder. (Click
+				    the Refresh icon in the <guilabel>Projects</guilabel> portlet's title bar if you don't immediately see the
+				    new Live Document.)</para>
+
+                    <para>When selected, two topics in the <guilabel>Topics</guilabel> portlet: <guilabel>Overview</guilabel>, and
+			        <guilabel>Work Items</guilabel>. The <guilabel>Overview</guilabel> topic is selected automatically by default.</para>
+			        <!-- TODO SCREENSHOT ?? -->
+                </sect4>
+
+                <sect4 id="ug_reqmgmt_inception_livedoc_edit">
+                    <title>Opening a New Live Document for Editing</title>
+                    <para>You can either edit the new Live Document directly from the repository, or download a copy to your local
+			        repository and edit locally. If you are constantly connected, the direct method is simplest.</para>
+                    <para><emphasis>To open and edit a Live Document directly:</emphasis></para>
+                    <orderedlist numeration="arabic" spacing="normal">
+                        <listitem>
+                            <para>Select the document in the <guilabel>documents</guilabel> folder.</para>
+                        </listitem>
+                        <listitem>
+                            <para>Select the <guilabel>Overview</guilabel> topic in the <guilabel>Topics</guilabel> portlet.</para>
+                        </listitem>
+                        <listitem>
+                            <para>In the work area, click the <guibutton>Edit in Word</guibutton> or <guibutton>Edit in Excel</guibutton>
+                            button, depending on which type of document the selected Live Document is. You will be prompted for your
+                            login details to authorize opening of the document.</para>
+                        </listitem>
+                    </orderedlist>
+
+                    <para>The Live Document opens in the relevant MS Office application in a new instance of your browser. You can
+                    edit the document and save changes just as if you were editing a local copy. Changes will be reflected in the
+                    Polarion system after you close the document.</para>
+
+                    <para><emphasis>To edit a New Live document locally:</emphasis></para>
+                    <orderedlist numeration="arabic" spacing="normal">
+                        <listitem>
+                            <para>Select the document in the <guilabel>documents</guilabel> folder.</para>
+                        </listitem>
+                        <listitem>
+                            <para>Select the <guilabel>Overview</guilabel> topic in the <guilabel>Topics</guilabel> portlet.</para>
+                        </listitem>
+                        <listitem>
+                            <para>In the work area, the document's repository URL displays in the <guilabel>URL</guilabel> field.</para>
+                        </listitem>
+                        <listitem>
+                            <para>Use your Subversion client program, or the Subversion command line interface to checkout the document
+                            at the displayed URL. This will obtain a local copy of the document.</para>
+                        </listitem>
+                        <listitem>
+                            <para>Open the local copy in the relevant MS Office application and edit as you would any document.</para>
+                        </listitem>
+                    </orderedlist>
+                </sect4>
+            </sect3>
+        </sect2>
+
+        <sect2 id="ug_reqtsmgmt_revision">
+            <title>Revision Phase</title>
+            <para>Once Requirements have been defined and relevant Work Items created initially, there is typically a phase of
+		    review, discussion, and revision of Requirements with stakeholders from both domain experts and engineering involved.
+		    Polarion supports this process with its Live Document technology. As in the initial definition
+		    phase, stakeholders can modify requirements in their preferred environment: an office document, or the Polarion
+		    repository. This section explains how to modify existing Requirements in both ways.</para>
+
+            <sect3 id="ug_reqmgmt_revision_revise_livedocs">
+                <title>Revising requirements using Live Documents</title>
+                <para>To modify Requirements using an office document, it is necessary to locate the relevant Live Document in
+			    the Polarion system, check it out of the repository, change the document, and
+			    check the changed document in to the repository. On check-in, any new Work Items defined in the document are
+			    automatically created in Polarion, and existing Work Items are updated with any
+			    changes in the document.</para>
+
+                <sect4 id="ug_reqmgmt_revision_livedoc_locating">
+                    <title>Locating the Live Document</title>
+                    <para><emphasis>To locate a Live Document to be modified:</emphasis></para>
+
+                    <orderedlist numeration="arabic" spacing="normal">
+                    <listitem>
+                        <para>In the Polarion web interface, make sure you are working in the
+                        <guilabel>Projects</guilabel> perspective. Switch to this perspective if necessary.</para>
+                    </listitem>
+                    <listitem>
+                        <para>Using the <guilabel>Projects</guilabel> portlet, locate the Project for which the desired Live
+                            Document contains Requirements.</para>
+                    </listitem>
+                    <listitem>
+                        <para>Expand the Project node (click <guilabel>[+]</guilabel> and select the <guilabel>documents</guilabel> folder.
+                            A list of documents for this Project loads in the work area. The list should contain the Live Document
+                            with the Requirements you want to modify. Nodes for each document appear as children of the
+                            <guilabel>documents</guilabel> folder in the <guilabel>Projects</guilabel> portlet.</para>
+                    </listitem>
+                        <listitem>
+                            <para>In the <guilabel>Projects</guilabel> portlet, select the Live Document you want to modify. Details
+                            for the document appear in the work area.</para>
+                        </listitem>
+                   </orderedlist>
+
+                    <tip>
+                        <para>You can compare document versions by clicking on the Revisions table in the document Overview page.</para>
+                   </tip>
+                </sect4>
+
+                <sect4 id="ug_reqmgmt_revision_livedoc_checkout">
+                    <title>Checking out a Live Document for Editing</title>
+                    <para>If you are working on line, the checkout process is as simple as clicking the <guibutton>Edit in Word</guibutton>
+				    or the <guibutton>Edit in Excel</guibutton> button in the work area above the details of the selected Live
+				    Document. Polarion Polarion automatically handles the repository checkout process
+				    and displays the document in the relevant office application running in a new instance of your web browser.
+			        You can work on the document normally.</para>
+				    <important>
+					    <para>In order for this feature to work, you must set your <productname>Internet Explorer</productname> browser
+					    settings to initialize and	script ActiveX controls	not marked as safe (more below).</para>
+					    <para><emphasis>To set this option in Internet Explorer:</emphasis></para>
+                        <orderedlist>
+                            <listitem>
+                                <para>On the Internet Explorer main menu, choose <guimenuitem>Tools</guimenuitem> | <guimenuitem>Internet Options</guimenuitem>. </para>
+                            </listitem>
+                            <listitem>
+                                <para>Click the <guilabel>Security</guilabel> tab.</para>
+                            </listitem>
+                            <listitem>
+                                <para>Click the <guiicon>Trusted Sites</guiicon> icon. The <guibutton>Sites</guibutton> button is enabled.</para>
+                            </listitem>
+                            <listitem>
+                                <para>Click the <guibutton>Sites</guibutton> button. In the field <guilabel>Add this Web site to the Zone</guilabel>,
+                                enter the URL of the root of your Polarion system. For example, the root of the Polarion
+                                    hosted version is: <ulink url="http://powerversion.com/polarion/portal">http://powerversion.com/polarion/portal</ulink>.
+                                </para>
+                            </listitem>
+                            <listitem>
+                                <para>Click the <guibutton>Add</guibutton> to add the URL to the list of Trusted Sites.</para>
+                            </listitem>
+                            <listitem>
+                                <para>If you do not access your Polarion system with <code>https:</code> protocol,
+                                and if the checkbox <option>Require server verification (https:) for all sites in this zone</option> is checked,
+                                uncheck it. If you have other sites in this zone and you want to require https: for all sites, click <guibutton>Cancel</guibutton>,
+                                skip the rest of these steps and see the Note below.</para>
+                            </listitem>
+                            <listitem>
+                                <para>Click <guibutton>OK</guibutton> to close the <guibutton>Trusted Sites dialog.</guibutton></para>
+                            </listitem>
+                            <listitem>
+                                <para>In the <guilabel>Internet Options</guilabel> dialog, click <guibutton>Custom Level</guibutton>.</para>
+                            </listitem>
+                            <listitem>
+                                <para>Scroll down the list of options until you locate <option>Initialize and script ActiveX controls not marked as safe</option>.</para>
+                            </listitem>
+                            <listitem>
+                                <para>If you are setting this option for the Trusted Sites zone, you can choose the <option>Enable</option> option if you
+                                don't want to be prompted whenever you edit a Live Document, or the <option>Prompt</option> option if you prefer a prompt. </para>
+                            </listitem>
+                            <listitem>
+                                <para>Click <guibutton>OK</guibutton> to close the <guilabel>Security Settings</guilabel> dialog, and again in
+                                the <guilabel>Internet Options</guilabel> dialog.</para>
+                            </listitem>
+                        </orderedlist>
+				    </important>
+				    <note>
+                        <title>If you require https: in your Trusted Zone</title>
+                        <para>If you require https: for all sites in your Trusted Zone, and you do not access your Polarion
+                        system via the internet using https: protocol, then you can locate the option in the <guilabel>Security Settings</guilabel>
+                        dialog and choose the <option>Prompt</option> option. You will then get a prompt whenever you edit Live Documents from the
+                        Polarion web interface, in which case you should allow the initialization and scripting of the ActiveX.</para>
+				    </note>
+                    <para>If you need to work on the document off line, you need to checkout the document from the Subversion
+                    repository. Use a Subversion client such as TortoiseSVN, or the Subversion command line interface according
+                    to your preference or your organization's established procedure. The URL of the Live Document is shown in the
+                    work area in the <guilabel>URL</guilabel> field when the Live Document is selected in the <guilabel>documents</guilabel>
+                    folder.</para>
+                </sect4>
+
+                <sect4 id="ug_reqmgmt_revision_livedoc_checkin">
+                    <title>Checking In an Edited Live Document</title>
+                   <para>If editing the document on line in the office application running in your browser, simply save your
+				   changes and close the document. <!-- TODO VERIFY! --> Polarion takes care of the repository
+				   checkin process.</para>
+                    <para>If you have edited a checked out local copy of the Live Document, use your Subversion client or the
+				    Subversion command line interface to check the document in to the repository.</para>
+				    <para>In both cases, Polarion will create Work Items in the system if the checked in
+				    document defines new Requirements, and it will update existing Work Items if the relevant Requirement has been
+					modified in the Live Document.</para>
+				    <note>
+					    <para>if you change only one Work Item in a Live Document, all Work Items from that document will have their
+					    Last Update field changed to the date of the update of the single item.</para>
+				    </note>
+				<!-- TODO What else is needed to mention? Creating IDs or smth like that? -->
+                </sect4>
+            </sect3>
+        </sect2>
+
+        <sect2 id="ug_reqtsmgmt_approval">
+            <title>Approval Phase</title>
+            <para>Polarion supports a process of approval for Requirements. Work Itemspertaining to Requirements are approved/disapproved using Polarion (i.e. not in
+			a Live Document). Each Work Item can be marked as Awaiting Approval, Approved, or Disapproved (either singly, or in aggregate using the Bulk Edit feature),
+            and assigned one or more "approver(s)" - user(s) having	responsibility for reviewing and approving or disapproving the Work Item(s). Approvers can quickly
+            access all the Work Items assigned to them for approval using a special pre-defined filter named <emphasis>Awaiting my approval</emphasis>.</para>
+
+			<tip>
+                <para>Project managers should make sure that approvers who may not have user accounts in the Polarion system as a result of the Requirements
+                definition/modification process are set up with accounts for the approval phase so they can access the Work Items they must review.</para>
+            </tip>
+
+            <sect3 id="ug_reqtsmgmt_approval_assign">
+                <title>Assigning Approver(s) to Work Items</title>
+                <para>One or more approvers can be assigned to each Work Item of a Requirement any time after the Work Item is
+				created in the Polarion system. Be sure that everyone in the organization who must review/approve requirements
+                has a user account before assigning approvers to Work Items.</para>
+
+                <para><emphasis>To assign approver(s) to a Work Item:</emphasis></para>
+
+                <orderedlist numeration="arabic" spacing="normal">
+					<listitem>
+						<para>Select a Work Item in the Work Items table in the upper part of the work area. The Work Item detail
+						editor loads in the lower part of the work area.</para>
+					</listitem>
+					<listitem>
+						<para>Scroll the detail pane until you locate the <guilabel>Approvers</guilabel> section. Initially there
+						is one approver line present in the section which has no assignment attributes set.</para>
+					</listitem>
+					<listitem>
+						<para>In the first <guilabel>Approvers</guilabel> line, select <guimenuitem>Awaiting Approval</guimenuitem>
+						in the <guilabel>Status</guilabel> drop-down list. This marks the start of the approval process for this
+						Work Item.</para>
+					</listitem>
+					<listitem>
+						<para>Assign the item to an approver by selecting a user name from the <guimenuitem>User</guimenuitem>
+						drop-down list.</para>
+					</listitem>
+					<listitem>
+						<para>If you wish to assign another approver to this Work Item, click the green plus sign at the right side
+						of the current line. Another line is added to the <guilabel>Approvers</guilabel> section below the
+						previous line.</para>
+					</listitem>
+					<listitem>
+						<para>Repeat the foregoing steps for this and any more approvers you want to assign to the current Work Item.</para>
+					</listitem>
+				</orderedlist>
+
+                <tip>
+                    <para>Use the Bulk Edit feature to assign the same approver(s) to multiple Work Items at once. The steps
+				    are essentially the same as just described, only the edit is applied to all selected Work Items.</para>
+                </tip>
+            </sect3>
+
+            <sect3 id="ug_reqtsmgmt_approval_marking">
+                <title>Approving or Disapproving Work Items</title>
+                <para>If you are assigned review/approval responsibility for Requirements, you need to use the Polarion
+				system to mark Work Items as approved or disapproved. You can review the Work Items in a
+				<link linkend="ug_reqmgmt_inception_livedoc_new">Live Document</link> but you need to use Polarion to
+				mark Work Items as approved or disapproved.</para>
+
+                <sect4 id="ug_reqtsmgmt_approval_marking_locate">
+                    <title>Locating the Work Items You Must Review</title>
+                    <para>Locating the Work Items for which you are assigned as an approver is quick and easy. There is a
+					pre-defined filter named <guilabel>Awaiting my approval</guilabel> that will aggregate all the relevant
+					Work Items for a selected Requirement.</para>
+
+                    <para><emphasis>To locate Work Items awaiting your approval:</emphasis></para>
+
+                    <orderedlist numeration="arabic" spacing="normal">
+						<listitem>
+							<para>Navigate to the Requirement item or document in the relevant Project and select it. A list of
+							all pertinent Work Items appears in the Work Items table at the top of the work area.</para>
+						</listitem>
+						<listitem>
+							<para>Select the Tree view (tab in the top part of the work area)</para>
+						</listitem>
+						<listitem>
+							<para>In the Search bar set the selection criteria as follows:</para>
+							<para><guilabel>Search</guilabel> <userinput>Open</userinput> <guilabel>and</guilabel> <userinput>Awaiting my Approval</userinput> <guilabel>in</guilabel> <userinput>Project</userinput></para>
+						</listitem>
+					</orderedlist>
+
+                    <para>The list of Work Items updates to contain only those Work Items assigned to you for approval.</para>
+                </sect4>
+
+                <sect4 id="ug_reqtsmgmt_approval_marking_markit">
+                    <title>Marking a Work Item as Approved or Disapproved</title>
+                    <para>When a Work Item is selected in the Work Items table, the detail appears in the lower part
+					of the work area. Click the <guibutton>Edit</guibutton> button to enter Edit mode. You can now edit all fields in the Work Item detail.</para>
+
+                    <para>Scroll the detail area until you find the <guilabel>Approvers</guilabel> section, which should contain at least one line displaying your
+					Polarion user name.</para>
+
+                    <para>To mark this Work Item as approved or disapproved, select the relevant value in the <guilabel>Status</guilabel>
+					drop-down list. If there are multiple lines for different approvers, be sure you set the status on the
+					line containing your user name.</para>
+
+                    <tip>
+						<para><inlinegraphic fileref="help_home/images/enterprise_sm.gif" format="GIF" valign="middle" width="17"/> With Polarion Enterprise Edition you
+						can use the Multi Edit view to set the same status value for multiple Work Items assigned to a selected user all at the same time.</para>
+					</tip> <!-- TODO This maybe needs to be more detailed -->
+                </sect4>
+            </sect3>
+        </sect2>
+
+        <sect2 id="ug_reqtsmgmt_livedoc_templates">
+            <title>About Live Document Templates</title>
+            <para>Polarion comes with one pre-defined Requirements template for MS Word and one
+			for MS Excel. It is possible to customize these templates, or, probably better, create customized copies of the
+			original templates provided with by installation.</para>
+
+            <para> Templates are stored in the Subversion repository folder: <code>/.polarion/tracker/document_templates</code>.</para>
+			<para>To modify or create copies of the templates, you should checkout the repository folder to your local system.
+			Edit template files using the relevant MS Office application and commit new/changed files to the repository.
+			Any new templates will appear in the <guilabel>Template</guilabel> list during the process of
+			<link linkend="ug_reqmgmt_inception_livedoc_new">creating a new Live Document</link>.</para>
+
+            <sect3 id="ug_reqtsmgmt_livedoc_templates_localfiles">
+                <title>Working with Local Files</title>
+                <para>It is possible to save local copies of Requirements templates and create new local Requirements documents
+			  	off line that are based on a local template file. Then, when <link linkend="ug_reqmgmt_inception_livedoc_new">creating a new Live Document</link>	in Polarion,
+                instead of choosing the option to create a new live document from a template,you choose instead the option to upload a file. Use the
+                <guibutton>Browse</guibutton> button to locate the local file to be uploaded into the Polarion system. After uploading a new document created locally,
+                you will need to use the button <guibutton>Assign IDs</guibutton> to cause the Work Items in the document to be assigned system IDs in Polarion so that
+                they will be searchable, etc. in the system.</para>
+
+                <para>You can save documents either with the office application's file extension (<filename>.doc</filename> or <filename>.xls</filename>,
+                or the extension <filename>.xml</filename>.</para>
+
+                <para>As with documents created using the on line interface, Work Items are created from the document content after
+			  	upload. (In the case of modified documents, existing Work Items are updated.)</para>
+            </sect3>
+        </sect2>
+    </sect1>
+
+    <sect1 id="ug_project_mgmt">
+        <title>Polarion for Project Managers</title>
+        <?dbhtml filename="ug_project_mgmt.html"?>
+        <para>[PLACEHOLDER]</para>
+
+        <sect2 id="ug_projectmgmt_planning">
+            <title>Project Planning</title>
+            <para>[PLACEHOLDER]</para>
+        </sect2>
+
+        <sect2 id="ug_projectmgmt_dashboards">
+            <title>Using Project Dashboards</title>
+            <para>[PLACEHOLDER]</para>
+        </sect2>
+
+        <sect2 id="ug_projectmgmt_metrics">
+            <title>Reviewing Project Metrics</title>
+            <para>[PLACEHOLDER]</para>
+        </sect2>
+
+        <sect2 id="ug_projectmgmt_reports">
+            <title>Generating Reports</title>
+            <para>[PLACEHOLDER]</para>
+        </sect2>
+    </sect1>
+
+    <sect1 id="ug_developers">
+        <title>Polarion for Developers</title>
+        <?dbhtml filename="ug_developer_guidet.html"?>
+        <para>[PLACEHOLDER]</para>
+
+        <sect2 id="ug_devguide_proj_access">
+            <title>Accessing Projects</title>
+            <para>[PLACEHOLDER]</para>
+        </sect2>
+
+        <sect2 id="ug_devguide_find_wi">
+            <title>Locating your Work Items</title>
+            <para>[PLACEHOLDER]</para>
+        </sect2>
+
+        <sect2 id="ug_devguide_common_ops">
+            <title>Common Tasks and Operations</title>
+            <para>[PLACEHOLDER]</para>
+
+            <sect3 id="ug_devguide_ops_editing">
+                <title>Viewing and Editing a Work Item</title>
+                <para>[PLACEHOLDER]</para>
+            </sect3>
+
+           <sect3 id="ug_devguide_ops_estimate">
+                <title>Estimating Work Item Time</title>
+                <para>[PLACEHOLDER]</para>
+            </sect3>
+
+            <sect3 id="ug_devguide_ops_comments">
+                <title>Work Item Discussion and Comments</title>
+                <para>[PLACEHOLDER]</para>
+            </sect3>
+
+            <sect3 id="ug_devguide_ops_resolving">
+                <title>Resolving or Closing a Work Item</title>
+                <para>[PLACEHOLDER]</para>
+
+                <sect4 id="ug_devguide_ops_resolving_reposlnk">
+                    <title>Linking a Resolved Item to a Repository Revision</title>
+                    <para>[PLACEHOLDER]</para>
+                </sect4>
+            </sect3>
+
+           <sect3 id="ug_devguide_builds">
+                <title>Working with Builds</title>
+                <para>[PLACEHOLDER]</para>
+           </sect3>
+
+            <sect3 id="ug_devguide_tests">
+                <title>Working with Tests</title>
+                <para>[PLACEHOLDER]</para>
+            </sect3>
+
+            <sect3 id="ug_devguide_javadoc">
+                <title>Accessing documentation</title>
+                <para>[PLACEHOLDER]</para>
+            </sect3>
+        </sect2>
+    </sect1>
+</chapter>
diff --git a/xml/tests/testData/xml/DocBookHighlighting/calstblx.dtd b/xml/tests/testData/xml/DocBookHighlighting/calstblx.dtd
new file mode 100644
index 0000000..aa36428
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting/calstblx.dtd
@@ -0,0 +1,205 @@
+<!-- ...................................................................... -->
+<!-- DocBook CALS Table Model V4.4 ........................................ -->
+<!-- File calstblx.mod .................................................... -->
+
+<!-- Copyright 1992-2002 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     This DTD is based on the CALS Table Model
+     PUBLIC "-//USA-DOD//DTD Table Model 951010//EN"
+
+     $Id: calstblx.dtd,v 1.27 2005/01/27 13:52:00 nwalsh Exp $
+
+     Permission to use, copy, modify and distribute the DocBook DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This module contains the definitions for the CALS Table Model
+     converted to XML. It has been modified slightly for use in the
+     combined HTML/CALS models supported by DocBook V4.4.
+-->
+
+<!-- These definitions are not directly related to the table model, but are
+     used in the default CALS table model and are usually defined elsewhere
+     (and prior to the inclusion of this table module) in a CALS DTD. -->
+
+<!ENTITY % bodyatt "">
+<!ENTITY % secur "">
+
+<!-- no if zero(s),
+                                yes if any other digits value -->
+
+<!ENTITY % yesorno 'CDATA'>
+<!ENTITY % titles  'title?'>
+
+<!-- default for use in entry content -->
+
+<!ENTITY % paracon '#PCDATA'>
+
+<!--
+The parameter entities as defined below provide the CALS table model
+as published (as part of the Example DTD) in MIL-HDBK-28001.
+
+These following declarations provide the CALS-compliant default definitions
+for these entities.  However, these entities can and should be redefined
+(by giving the appropriate parameter entity declaration(s) prior to the
+reference to this Table Model declaration set entity) to fit the needs
+of the current application.
+-->
+
+<!ENTITY % tbl.table.name       "(table|chart)">
+<!ENTITY % tbl.table-titles.mdl "%titles;,">
+<!ENTITY % tbl.table-main.mdl   "(tgroup+|graphic+)">
+<!ENTITY % tbl.table.mdl        "%tbl.table-titles.mdl; %tbl.table-main.mdl;">
+<!ENTITY % tbl.table.att        '
+    tabstyle    CDATA           #IMPLIED
+    tocentry    %yesorno;       #IMPLIED
+    shortentry  %yesorno;       #IMPLIED
+    orient      (port|land)     #IMPLIED
+    pgwide      %yesorno;       #IMPLIED '>
+<!ENTITY % tbl.tgroup.mdl       "colspec*,spanspec*,thead?,tfoot?,tbody">
+<!ENTITY % tbl.tgroup.att       '
+    tgroupstyle CDATA           #IMPLIED '>
+<!ENTITY % tbl.hdft.mdl         "colspec*,row+">
+<!ENTITY % tbl.row.mdl          "(entry|entrytbl)+">
+<!ENTITY % tbl.entrytbl.mdl     "colspec*,spanspec*,thead?,tbody">
+<!ENTITY % tbl.entry.mdl        "(para|warning|caution|note|legend|%paracon;)*">
+
+<!ENTITY % tbl.frame.attval     "top|bottom|topbot|all|sides|none">
+<!ENTITY % tbl.tbody.mdl        "row+">
+
+<!-- =====  Element and attribute declarations follow. =====  -->
+
+<!ELEMENT table %ho; (%tbl.table.mdl;)>
+
+<!ATTLIST table
+        frame           (%tbl.frame.attval;)                    #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        %tbl.table.att;
+        %bodyatt;
+        %secur;
+>
+
+<!ELEMENT tgroup %ho; (%tbl.tgroup.mdl;) >
+
+<!ATTLIST tgroup
+        cols            CDATA                                   #REQUIRED
+        %tbl.tgroup.att;
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         CDATA                                   #IMPLIED
+        %secur;
+>
+
+<!ELEMENT colspec %ho; EMPTY >
+
+<!ATTLIST colspec
+        colnum          CDATA                                   #IMPLIED
+        colname         CDATA                                   #IMPLIED
+        colwidth        CDATA                                   #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         CDATA                                   #IMPLIED
+>
+
+<!ELEMENT spanspec %ho; EMPTY >
+
+<!ATTLIST spanspec
+        namest          CDATA                                   #REQUIRED
+        nameend         CDATA                                   #REQUIRED
+        spanname        CDATA                                   #REQUIRED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         CDATA                                   #IMPLIED
+>
+
+<!ELEMENT thead %ho; (%tbl.hdft.mdl;)>
+<!ATTLIST thead
+        valign          (top|middle|bottom)                     #IMPLIED
+        %secur;
+>
+
+<!ELEMENT tfoot %ho; (%tbl.hdft.mdl;)>
+<!ATTLIST tfoot
+        valign          (top|middle|bottom)                     #IMPLIED
+        %secur;
+>
+
+<!ELEMENT tbody %ho; (%tbl.tbody.mdl;)>
+
+<!ATTLIST tbody
+        valign          (top|middle|bottom)                     #IMPLIED
+        %secur;
+>
+
+<!ELEMENT row %ho; (%tbl.row.mdl;)>
+
+<!ATTLIST row
+        rowsep          %yesorno;                               #IMPLIED
+        valign          (top|middle|bottom)                     #IMPLIED
+        %secur;
+>
+
+<!ELEMENT entrytbl %ho; (%tbl.entrytbl.mdl;)>
+
+<!ATTLIST entrytbl
+        cols            CDATA                                   #REQUIRED
+        %tbl.tgroup.att;
+        colname         CDATA                                   #IMPLIED
+        spanname        CDATA                                   #IMPLIED
+        namest          CDATA                                   #IMPLIED
+        nameend         CDATA                                   #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         CDATA                                   #IMPLIED
+        %secur;
+>
+
+<!ELEMENT entry %ho; (%tbl.entry.mdl;)*>
+
+<!ATTLIST entry
+        colname         CDATA                                   #IMPLIED
+        namest          CDATA                                   #IMPLIED
+        nameend         CDATA                                   #IMPLIED
+        spanname        CDATA                                   #IMPLIED
+        morerows        CDATA                                   #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         CDATA                                   #IMPLIED
+        rotate          %yesorno;                               #IMPLIED
+        valign          (top|middle|bottom)                     #IMPLIED
+        %secur;
+>
+
+<!-- End of DocBook CALS Table Model V4.4 ................................. -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting/dbcentx.mod b/xml/tests/testData/xml/DocBookHighlighting/dbcentx.mod
new file mode 100644
index 0000000..0e61540
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting/dbcentx.mod
@@ -0,0 +1,384 @@
+<!-- ...................................................................... -->
+<!-- DocBook character entities module V4.4 ............................... -->
+<!-- File dbcentx.mod ..................................................... -->
+
+<!-- Copyright 1992-2004 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     $Id: dbcentx.mod,v 1.28 2005/01/27 13:52:00 nwalsh Exp $
+
+     Permission to use, copy, modify and distribute the DocBook DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This module contains the entity declarations for the standard ISO
+     entity sets used by DocBook.
+
+     In DTD driver files referring to this module, please use an entity
+     declaration that uses the public identifier shown below:
+
+     <!ENTITY % dbcent PUBLIC
+     "-//OASIS//ENTITIES DocBook Character Entities V4.4//EN"
+     "dbcentx.mod">
+     %dbcent;
+
+     See the documentation for detailed information on the parameter
+     entity and module scheme used in DocBook, customizing DocBook and
+     planning for interchange, and changes made since the last release
+     of DocBook.
+-->
+
+<!-- ...................................................................... -->
+
+<![%sgml.features;[
+
+<!ENTITY % ISOamsa.module "INCLUDE">
+<![ %ISOamsa.module; [
+<!ENTITY % ISOamsa PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN">
+<!--end of ISOamsa.module-->]]>
+
+<!ENTITY % ISOamsb.module "INCLUDE">
+<![ %ISOamsb.module; [
+<!ENTITY % ISOamsb PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN">
+<!--end of ISOamsb.module-->]]>
+
+<!ENTITY % ISOamsc.module "INCLUDE">
+<![ %ISOamsc.module; [
+<!ENTITY % ISOamsc PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN">
+<!--end of ISOamsc.module-->]]>
+
+<!ENTITY % ISOamsn.module "INCLUDE">
+<![ %ISOamsn.module; [
+<!ENTITY % ISOamsn PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN">
+<!--end of ISOamsn.module-->]]>
+
+<!ENTITY % ISOamso.module "INCLUDE">
+<![ %ISOamso.module; [
+<!ENTITY % ISOamso PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN">
+<!--end of ISOamso.module-->]]>
+
+<!ENTITY % ISOamsr.module "INCLUDE">
+<![ %ISOamsr.module; [
+<!ENTITY % ISOamsr PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN">
+<!--end of ISOamsr.module-->]]>
+
+<!ENTITY % ISObox.module "INCLUDE">
+<![ %ISObox.module; [
+<!ENTITY % ISObox PUBLIC
+"ISO 8879:1986//ENTITIES Box and Line Drawing//EN">
+<!--end of ISObox.module-->]]>
+
+<!ENTITY % ISOcyr1.module "INCLUDE">
+<![ %ISOcyr1.module; [
+<!ENTITY % ISOcyr1 PUBLIC
+"ISO 8879:1986//ENTITIES Russian Cyrillic//EN">
+<!--end of ISOcyr1.module-->]]>
+
+<!ENTITY % ISOcyr2.module "INCLUDE">
+<![ %ISOcyr2.module; [
+<!ENTITY % ISOcyr2 PUBLIC
+"ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN">
+<!--end of ISOcyr2.module-->]]>
+
+<!ENTITY % ISOdia.module "INCLUDE">
+<![ %ISOdia.module; [
+<!ENTITY % ISOdia PUBLIC
+"ISO 8879:1986//ENTITIES Diacritical Marks//EN">
+<!--end of ISOdia.module-->]]>
+
+<!ENTITY % ISOgrk1.module "INCLUDE">
+<![ %ISOgrk1.module; [
+<!ENTITY % ISOgrk1 PUBLIC
+"ISO 8879:1986//ENTITIES Greek Letters//EN">
+<!--end of ISOgrk1.module-->]]>
+
+<!ENTITY % ISOgrk2.module "INCLUDE">
+<![ %ISOgrk2.module; [
+<!ENTITY % ISOgrk2 PUBLIC
+"ISO 8879:1986//ENTITIES Monotoniko Greek//EN">
+<!--end of ISOgrk2.module-->]]>
+
+<!ENTITY % ISOgrk3.module "INCLUDE">
+<![ %ISOgrk3.module; [
+<!ENTITY % ISOgrk3 PUBLIC
+"ISO 8879:1986//ENTITIES Greek Symbols//EN">
+<!--end of ISOgrk3.module-->]]>
+
+<!ENTITY % ISOgrk4.module "INCLUDE">
+<![ %ISOgrk4.module; [
+<!ENTITY % ISOgrk4 PUBLIC
+"ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN">
+<!--end of ISOgrk4.module-->]]>
+
+<!ENTITY % ISOlat1.module "INCLUDE">
+<![ %ISOlat1.module; [
+<!ENTITY % ISOlat1 PUBLIC
+"ISO 8879:1986//ENTITIES Added Latin 1//EN">
+<!--end of ISOlat1.module-->]]>
+
+<!ENTITY % ISOlat2.module "INCLUDE">
+<![ %ISOlat2.module; [
+<!ENTITY % ISOlat2 PUBLIC
+"ISO 8879:1986//ENTITIES Added Latin 2//EN">
+<!--end of ISOlat2.module-->]]>
+
+<!ENTITY % ISOnum.module "INCLUDE">
+<![ %ISOnum.module; [
+<!ENTITY % ISOnum PUBLIC
+"ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN">
+<!--end of ISOnum.module-->]]>
+
+<!ENTITY % ISOpub.module "INCLUDE">
+<![ %ISOpub.module; [
+<!ENTITY % ISOpub PUBLIC
+"ISO 8879:1986//ENTITIES Publishing//EN">
+<!--end of ISOpub.module-->]]>
+
+<!ENTITY % ISOtech.module "INCLUDE">
+<![ %ISOtech.module; [
+<!ENTITY % ISOtech PUBLIC
+"ISO 8879:1986//ENTITIES General Technical//EN">
+<!--end of ISOtech.module-->]]>
+
+<!--end of sgml.features-->]]>
+
+<![%xml.features;[
+
+<!ENTITY % ISOamsa.module "INCLUDE">
+<![%ISOamsa.module;[
+<!ENTITY % ISOamsa PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+"ent/isoamsa.ent">
+<!--end of ISOamsa.module-->]]>
+
+<!ENTITY % ISOamsb.module "INCLUDE">
+<![%ISOamsb.module;[
+<!ENTITY % ISOamsb PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+"ent/isoamsb.ent">
+<!--end of ISOamsb.module-->]]>
+
+<!ENTITY % ISOamsc.module "INCLUDE">
+<![%ISOamsc.module;[
+<!ENTITY % ISOamsc PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+"ent/isoamsc.ent">
+<!--end of ISOamsc.module-->]]>
+
+<!ENTITY % ISOamsn.module "INCLUDE">
+<![%ISOamsn.module;[
+<!ENTITY % ISOamsn PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+"ent/isoamsn.ent">
+<!--end of ISOamsn.module-->]]>
+
+<!ENTITY % ISOamso.module "INCLUDE">
+<![%ISOamso.module;[
+<!ENTITY % ISOamso PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+"ent/isoamso.ent">
+<!--end of ISOamso.module-->]]>
+
+<!ENTITY % ISOamsr.module "INCLUDE">
+<![%ISOamsr.module;[
+<!ENTITY % ISOamsr PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+"ent/isoamsr.ent">
+<!--end of ISOamsr.module-->]]>
+
+<!ENTITY % ISObox.module "INCLUDE">
+<![%ISObox.module;[
+<!ENTITY % ISObox PUBLIC
+"ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+"ent/isobox.ent">
+<!--end of ISObox.module-->]]>
+
+<!ENTITY % ISOcyr1.module "INCLUDE">
+<![%ISOcyr1.module;[
+<!ENTITY % ISOcyr1 PUBLIC
+"ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+"ent/isocyr1.ent">
+<!--end of ISOcyr1.module-->]]>
+
+<!ENTITY % ISOcyr2.module "INCLUDE">
+<![%ISOcyr2.module;[
+<!ENTITY % ISOcyr2 PUBLIC
+"ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+"ent/isocyr2.ent">
+<!--end of ISOcyr2.module-->]]>
+
+<!ENTITY % ISOdia.module "INCLUDE">
+<![%ISOdia.module;[
+<!ENTITY % ISOdia PUBLIC
+"ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+"ent/isodia.ent">
+<!--end of ISOdia.module-->]]>
+
+<!ENTITY % ISOgrk1.module "INCLUDE">
+<![%ISOgrk1.module;[
+<!ENTITY % ISOgrk1 PUBLIC
+"ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+"ent/isogrk1.ent">
+<!--end of ISOgrk1.module-->]]>
+
+<!ENTITY % ISOgrk2.module "INCLUDE">
+<![%ISOgrk2.module;[
+<!ENTITY % ISOgrk2 PUBLIC
+"ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+"ent/isogrk2.ent">
+<!--end of ISOgrk2.module-->]]>
+
+<!ENTITY % ISOgrk3.module "INCLUDE">
+<![%ISOgrk3.module;[
+<!ENTITY % ISOgrk3 PUBLIC
+"ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+"ent/isogrk3.ent">
+<!--end of ISOgrk3.module-->]]>
+
+<!ENTITY % ISOgrk4.module "INCLUDE">
+<![%ISOgrk4.module;[
+<!ENTITY % ISOgrk4 PUBLIC
+"ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+"ent/isogrk4.ent">
+<!--end of ISOgrk4.module-->]]>
+
+<!ENTITY % ISOlat1.module "INCLUDE">
+<![%ISOlat1.module;[
+<!ENTITY % ISOlat1 PUBLIC
+"ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+"ent/isolat1.ent">
+<!--end of ISOlat1.module-->]]>
+
+<!ENTITY % ISOlat2.module "INCLUDE">
+<![%ISOlat2.module;[
+<!ENTITY % ISOlat2 PUBLIC
+"ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+"ent/isolat2.ent">
+<!--end of ISOlat2.module-->]]>
+
+<!ENTITY % ISOnum.module "INCLUDE">
+<![%ISOnum.module;[
+<!ENTITY % ISOnum PUBLIC
+"ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+"ent/isonum.ent">
+<!--end of ISOnum.module-->]]>
+
+<!ENTITY % ISOpub.module "INCLUDE">
+<![%ISOpub.module;[
+<!ENTITY % ISOpub PUBLIC
+"ISO 8879:1986//ENTITIES Publishing//EN//XML"
+"ent/isopub.ent">
+<!--end of ISOpub.module-->]]>
+
+<!ENTITY % ISOtech.module "INCLUDE">
+<![%ISOtech.module;[
+<!ENTITY % ISOtech PUBLIC
+"ISO 8879:1986//ENTITIES General Technical//EN//XML"
+"ent/isotech.ent">
+<!--end of ISOtech.module-->]]>
+
+<!--end of xml.features-->]]>
+
+<![ %ISOamsa.module; [
+%ISOamsa;
+]]>
+
+<![ %ISOamsb.module; [
+%ISOamsb;
+]]>
+
+<![ %ISOamsc.module; [
+%ISOamsc;
+]]>
+
+<![ %ISOamsn.module; [
+%ISOamsn;
+]]>
+
+<![ %ISOamso.module; [
+%ISOamso;
+]]>
+
+<![ %ISOamsr.module; [
+%ISOamsr;
+]]>
+
+<![ %ISObox.module; [
+%ISObox;
+]]>
+
+<![ %ISOcyr1.module; [
+%ISOcyr1;
+]]>
+
+<![ %ISOcyr2.module; [
+%ISOcyr2;
+]]>
+
+<![ %ISOdia.module; [
+%ISOdia;
+]]>
+
+<![ %ISOgrk1.module; [
+%ISOgrk1;
+]]>
+
+<![ %ISOgrk2.module; [
+%ISOgrk2;
+]]>
+
+<![ %ISOgrk3.module; [
+%ISOgrk3;
+]]>
+
+<![ %ISOgrk4.module; [
+%ISOgrk4;
+]]>
+
+<![ %ISOlat1.module; [
+%ISOlat1;
+]]>
+
+<![ %ISOlat2.module; [
+%ISOlat2;
+]]>
+
+<![ %ISOnum.module; [
+%ISOnum;
+]]>
+
+<![ %ISOpub.module; [
+%ISOpub;
+]]>
+
+<![ %ISOtech.module; [
+%ISOtech;
+]]>
+
+<!-- End of DocBook character entity sets module V4.4 ..................... -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting/dbgenent.mod b/xml/tests/testData/xml/DocBookHighlighting/dbgenent.mod
new file mode 100644
index 0000000..20f717a
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting/dbgenent.mod
@@ -0,0 +1,41 @@
+<!-- ...................................................................... -->
+<!-- DocBook additional general entities V4.4 ............................. -->
+
+<!-- Copyright 1992-2004 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     In DTD driver files referring to this module, please use an entity
+     declaration that uses the public identifier shown below:
+
+     <!ENTITY % dbgenent PUBLIC
+     "-//OASIS//ENTITIES DocBook Additional General Entities V4.4//EN"
+     "dbgenent.mod">
+     %dbgenent;
+-->
+
+<!-- File dbgenent.mod .................................................... -->
+
+<!-- You can edit this file to add the following:
+
+     o General entity declarations of any kind.  For example:
+
+       <!ENTITY productname "WinWidget">          (small boilerplate)
+       <!ENTITY legal-notice SYSTEM "notice.sgm"> (large boilerplate)
+
+     o Notation declarations.  For example:
+
+       <!NOTATION chicken-scratch SYSTEM>
+
+     o Declarations for and references to external parameter entities
+       containing collections of any of the above.  For example:
+
+       <!ENTITY % all-titles PUBLIC "-//DocTools//ELEMENTS Book Titles//EN"
+           "booktitles.ent">
+       %all-titles;
+-->
+
+<!-- End of DocBook additional general entities V4.4 ...................... -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting/dbhierx.mod b/xml/tests/testData/xml/DocBookHighlighting/dbhierx.mod
new file mode 100644
index 0000000..7be307a
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting/dbhierx.mod
@@ -0,0 +1,2113 @@
+<!-- ...................................................................... -->
+<!-- DocBook document hierarchy module V4.4 ............................... -->
+<!-- File dbhierx.mod ..................................................... -->
+
+<!-- Copyright 1992-2004 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     $Id: dbhierx.mod,v 1.38 2005/01/27 13:52:00 nwalsh Exp $
+
+     Permission to use, copy, modify and distribute the DocBook DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This module contains the definitions for the overall document
+     hierarchies of DocBook documents.  It covers computer documentation
+     manuals and manual fragments, as well as reference entries (such as
+     man pages) and technical journals or anthologies containing
+     articles.
+
+     This module depends on the DocBook information pool module.  All
+     elements and entities referenced but not defined here are assumed
+     to be defined in the information pool module.
+
+     In DTD driver files referring to this module, please use an entity
+     declaration that uses the public identifier shown below:
+
+     <!ENTITY % dbhier PUBLIC
+     "-//OASIS//ELEMENTS DocBook Document Hierarchy V4.4//EN"
+     "dbhierx.mod">
+     %dbhier;
+
+     See the documentation for detailed information on the parameter
+     entity and module scheme used in DocBook, customizing DocBook and
+     planning for interchange, and changes made since the last release
+     of DocBook.
+-->
+
+<!-- ...................................................................... -->
+<!-- Entities for module inclusions ....................................... -->
+
+<!ENTITY % dbhier.redecl.module		"IGNORE">
+<!ENTITY % dbhier.redecl2.module	"IGNORE">
+
+<!-- ...................................................................... -->
+<!-- Entities for element classes ......................................... -->
+
+<!ENTITY % local.appendix.class "">
+<!ENTITY % appendix.class	"appendix %local.appendix.class;">
+
+<!ENTITY % local.article.class "">
+<!ENTITY % article.class	"article %local.article.class;">
+
+<!ENTITY % local.book.class "">
+<!ENTITY % book.class		"book %local.book.class;">
+
+<!ENTITY % local.chapter.class "">
+<!ENTITY % chapter.class	"chapter %local.chapter.class;">
+
+<!ENTITY % local.index.class "">
+<!ENTITY % index.class		"index|setindex %local.index.class;">
+
+<!ENTITY % local.refentry.class "">
+<!ENTITY % refentry.class	"refentry %local.refentry.class;">
+
+<!ENTITY % local.section.class "">
+<!ENTITY % section.class	"section %local.section.class;">
+
+<!ENTITY % local.nav.class "">
+<!ENTITY % nav.class		"toc|lot|index|glossary|bibliography
+				%local.nav.class;">
+
+<!-- Redeclaration placeholder ............................................ -->
+
+<!-- For redeclaring entities that are declared after this point while
+     retaining their references to the entities that are declared before
+     this point -->
+
+<![%dbhier.redecl.module;[
+<!-- Defining rdbhier here makes some buggy XML parsers happy. -->
+<!ENTITY % rdbhier "">
+%rdbhier;
+<!--end of dbhier.redecl.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Entities for element mixtures ........................................ -->
+
+<!ENTITY % local.divcomponent.mix "">
+<!ENTITY % divcomponent.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|%compound.class;
+		|%genobj.class;		|%descobj.class;
+		|%ndxterm.class;        |beginpage
+                %forms.hook;
+		%local.divcomponent.mix;">
+
+<!ENTITY % local.refcomponent.mix "">
+<!ENTITY % refcomponent.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|%compound.class;
+		|%genobj.class;		|%descobj.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.refcomponent.mix;">
+
+<!ENTITY % local.indexdivcomponent.mix "">
+<!ENTITY % indexdivcomponent.mix
+		"itemizedlist|orderedlist|variablelist|simplelist
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|anchor|remark
+		|%link.char.class;
+ 		                        |beginpage
+		%local.indexdivcomponent.mix;">
+
+<!ENTITY % local.refname.char.mix "">
+<!ENTITY % refname.char.mix
+		"#PCDATA
+		|%tech.char.class;
+		%local.refname.char.mix;">
+
+<!ENTITY % local.partcontent.mix "">
+<!ENTITY % partcontent.mix
+		"%appendix.class;|%chapter.class;|%nav.class;|%article.class;
+		|preface|%refentry.class;|reference %local.partcontent.mix;">
+
+<!ENTITY % local.refinline.char.mix "">
+<!ENTITY % refinline.char.mix
+		"#PCDATA
+		|%xref.char.class;	|%gen.char.class;
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;	|%docinfo.char.class;
+		|%other.char.class;
+		|%ndxterm.class;        |beginpage
+		%local.refinline.char.mix;">
+
+<!ENTITY % local.refclass.char.mix "">
+<!ENTITY % refclass.char.mix
+		"#PCDATA
+		|application
+		%local.refclass.char.mix;">
+
+<!-- Redeclaration placeholder 2 .......................................... -->
+
+<!-- For redeclaring entities that are declared after this point while
+     retaining their references to the entities that are declared before
+     this point -->
+
+<![%dbhier.redecl2.module;[
+<!-- Defining rdbhier2 here makes some buggy XML parsers happy. -->
+<!ENTITY % rdbhier2 "">
+%rdbhier2;
+<!--end of dbhier.redecl2.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Entities for content models .......................................... -->
+
+<!ENTITY % div.title.content
+	"title, subtitle?, titleabbrev?">
+
+<!ENTITY % bookcomponent.title.content
+	"title, subtitle?, titleabbrev?">
+
+<!ENTITY % sect.title.content
+	"title, subtitle?, titleabbrev?">
+
+<!ENTITY % refsect.title.content
+	"title, subtitle?, titleabbrev?">
+
+<!ENTITY % bookcomponent.content
+	"((%divcomponent.mix;)+,
+	(sect1*|(%refentry.class;)*|simplesect*|(%section.class;)*))
+	| (sect1+|(%refentry.class;)+|simplesect+|(%section.class;)+)">
+
+<!-- ...................................................................... -->
+<!-- Set and SetInfo ...................................................... -->
+
+<!ENTITY % set.content.module "INCLUDE">
+<![%set.content.module;[
+<!ENTITY % set.module "INCLUDE">
+<![%set.module;[
+<!ENTITY % local.set.attrib "">
+<!ENTITY % set.role.attrib "%role.attrib;">
+
+<!ENTITY % set.element "INCLUDE">
+<![%set.element;[
+<!ELEMENT set %ho; ((%div.title.content;)?, setinfo?, toc?, (set|%book.class;)+,
+		setindex?)
+		%ubiq.inclusion;>
+<!--end of set.element-->]]>
+
+<!-- FPI: SGML formal public identifier -->
+
+
+<!ENTITY % set.attlist "INCLUDE">
+<![%set.attlist;[
+<!ATTLIST set
+		fpi		CDATA		#IMPLIED
+		%status.attrib;
+		%common.attrib;
+		%set.role.attrib;
+		%local.set.attrib;
+>
+<!--end of set.attlist-->]]>
+<!--end of set.module-->]]>
+
+<!ENTITY % setinfo.module "INCLUDE">
+<![%setinfo.module;[
+<!ENTITY % local.setinfo.attrib "">
+<!ENTITY % setinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % setinfo.element "INCLUDE">
+<![%setinfo.element;[
+<!ELEMENT setinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of setinfo.element-->]]>
+
+<!-- Contents: IDs of the ToC, Books, and SetIndex that comprise
+		the set, in the order of their appearance -->
+
+
+<!ENTITY % setinfo.attlist "INCLUDE">
+<![%setinfo.attlist;[
+<!ATTLIST setinfo
+		contents	IDREFS		#IMPLIED
+		%common.attrib;
+		%setinfo.role.attrib;
+		%local.setinfo.attrib;
+>
+<!--end of setinfo.attlist-->]]>
+<!--end of setinfo.module-->]]>
+<!--end of set.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Book and BookInfo .................................................... -->
+
+<!ENTITY % book.content.module "INCLUDE">
+<![%book.content.module;[
+<!ENTITY % book.module "INCLUDE">
+<![%book.module;[
+
+<!ENTITY % local.book.attrib "">
+<!ENTITY % book.role.attrib "%role.attrib;">
+
+<!ENTITY % book.element "INCLUDE">
+<![%book.element;[
+<!ELEMENT book %ho; ((%div.title.content;)?, bookinfo?,
+ 		(dedication | toc | lot
+ 		| glossary | bibliography | preface
+		| %chapter.class; | reference | part
+		| %article.class;
+ 		| %appendix.class;
+		| %index.class;
+		| colophon)*)
+		%ubiq.inclusion;>
+<!--end of book.element-->]]>
+
+<!-- FPI: SGML formal public identifier -->
+
+
+<!ENTITY % book.attlist "INCLUDE">
+<![%book.attlist;[
+<!ATTLIST book		fpi		CDATA		#IMPLIED
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%book.role.attrib;
+		%local.book.attrib;
+>
+<!--end of book.attlist-->]]>
+<!--end of book.module-->]]>
+
+<!ENTITY % bookinfo.module "INCLUDE">
+<![%bookinfo.module;[
+<!ENTITY % local.bookinfo.attrib "">
+<!ENTITY % bookinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % bookinfo.element "INCLUDE">
+<![%bookinfo.element;[
+<!ELEMENT bookinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of bookinfo.element-->]]>
+
+<!-- Contents: IDs of the ToC, LoTs, Prefaces, Parts, Chapters,
+		Appendixes, References, GLossary, Bibliography, and indexes
+		comprising the Book, in the order of their appearance -->
+
+
+<!ENTITY % bookinfo.attlist "INCLUDE">
+<![%bookinfo.attlist;[
+<!ATTLIST bookinfo
+		contents	IDREFS		#IMPLIED
+		%common.attrib;
+		%bookinfo.role.attrib;
+		%local.bookinfo.attrib;
+>
+<!--end of bookinfo.attlist-->]]>
+<!--end of bookinfo.module-->]]>
+<!--end of book.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Dedication, ToC, and LoT ............................................. -->
+
+<!ENTITY % dedication.module "INCLUDE">
+<![%dedication.module;[
+<!ENTITY % local.dedication.attrib "">
+<!ENTITY % dedication.role.attrib "%role.attrib;">
+
+<!ENTITY % dedication.element "INCLUDE">
+<![%dedication.element;[
+<!ELEMENT dedication %ho; ((%sect.title.content;)?, (%legalnotice.mix;)+)>
+<!--end of dedication.element-->]]>
+
+<!ENTITY % dedication.attlist "INCLUDE">
+<![%dedication.attlist;[
+<!ATTLIST dedication
+		%status.attrib;
+		%common.attrib;
+		%dedication.role.attrib;
+		%local.dedication.attrib;
+>
+<!--end of dedication.attlist-->]]>
+<!--end of dedication.module-->]]>
+
+<!ENTITY % colophon.module "INCLUDE">
+<![ %colophon.module; [
+<!ENTITY % local.colophon.attrib "">
+<!ENTITY % colophon.role.attrib "%role.attrib;">
+
+<!ENTITY % colophon.element "INCLUDE">
+<![ %colophon.element; [
+<!ELEMENT colophon %ho; ((%sect.title.content;)?, (%textobject.mix;)+)>
+<!--end of colophon.element-->]]>
+
+<!ENTITY % colophon.attlist "INCLUDE">
+<![ %colophon.attlist; [
+<!ATTLIST colophon
+		%status.attrib;
+		%common.attrib;
+		%colophon.role.attrib;
+		%local.colophon.attrib;>
+<!--end of colophon.attlist-->]]>
+<!--end of colophon.module-->]]>
+
+<!ENTITY % toc.content.module "INCLUDE">
+<![%toc.content.module;[
+<!ENTITY % toc.module "INCLUDE">
+<![%toc.module;[
+<!ENTITY % local.toc.attrib "">
+<!ENTITY % toc.role.attrib "%role.attrib;">
+
+<!ENTITY % toc.element "INCLUDE">
+<![%toc.element;[
+<!ELEMENT toc %ho; (beginpage?,
+		(%bookcomponent.title.content;)?,
+		tocfront*,
+		(tocpart | tocchap)*, tocback*)>
+<!--end of toc.element-->]]>
+
+<!ENTITY % toc.attlist "INCLUDE">
+<![%toc.attlist;[
+<!ATTLIST toc
+		%pagenum.attrib;
+		%common.attrib;
+		%toc.role.attrib;
+		%local.toc.attrib;
+>
+<!--end of toc.attlist-->]]>
+<!--end of toc.module-->]]>
+
+<!ENTITY % tocfront.module "INCLUDE">
+<![%tocfront.module;[
+<!ENTITY % local.tocfront.attrib "">
+<!ENTITY % tocfront.role.attrib "%role.attrib;">
+
+<!ENTITY % tocfront.element "INCLUDE">
+<![%tocfront.element;[
+<!ELEMENT tocfront %ho; (%para.char.mix;)*>
+<!--end of tocfront.element-->]]>
+
+<!-- to element that this entry represents -->
+
+
+<!ENTITY % tocfront.attlist "INCLUDE">
+<![%tocfront.attlist;[
+<!ATTLIST tocfront
+		%label.attrib;
+		%linkend.attrib;		%pagenum.attrib;
+		%common.attrib;
+		%tocfront.role.attrib;
+		%local.tocfront.attrib;
+>
+<!--end of tocfront.attlist-->]]>
+<!--end of tocfront.module-->]]>
+
+<!ENTITY % tocentry.module "INCLUDE">
+<![%tocentry.module;[
+<!ENTITY % local.tocentry.attrib "">
+<!ENTITY % tocentry.role.attrib "%role.attrib;">
+
+<!ENTITY % tocentry.element "INCLUDE">
+<![%tocentry.element;[
+<!ELEMENT tocentry %ho; (%para.char.mix;)*>
+<!--end of tocentry.element-->]]>
+
+<!-- to element that this entry represents -->
+
+
+<!ENTITY % tocentry.attlist "INCLUDE">
+<![%tocentry.attlist;[
+<!ATTLIST tocentry
+		%linkend.attrib;		%pagenum.attrib;
+		%common.attrib;
+		%tocentry.role.attrib;
+		%local.tocentry.attrib;
+>
+<!--end of tocentry.attlist-->]]>
+<!--end of tocentry.module-->]]>
+
+<!ENTITY % tocpart.module "INCLUDE">
+<![%tocpart.module;[
+<!ENTITY % local.tocpart.attrib "">
+<!ENTITY % tocpart.role.attrib "%role.attrib;">
+
+<!ENTITY % tocpart.element "INCLUDE">
+<![%tocpart.element;[
+<!ELEMENT tocpart %ho; (tocentry+, tocchap*)>
+<!--end of tocpart.element-->]]>
+
+<!ENTITY % tocpart.attlist "INCLUDE">
+<![%tocpart.attlist;[
+<!ATTLIST tocpart
+		%common.attrib;
+		%tocpart.role.attrib;
+		%local.tocpart.attrib;
+>
+<!--end of tocpart.attlist-->]]>
+<!--end of tocpart.module-->]]>
+
+<!ENTITY % tocchap.module "INCLUDE">
+<![%tocchap.module;[
+<!ENTITY % local.tocchap.attrib "">
+<!ENTITY % tocchap.role.attrib "%role.attrib;">
+
+<!ENTITY % tocchap.element "INCLUDE">
+<![%tocchap.element;[
+<!ELEMENT tocchap %ho; (tocentry+, toclevel1*)>
+<!--end of tocchap.element-->]]>
+
+<!ENTITY % tocchap.attlist "INCLUDE">
+<![%tocchap.attlist;[
+<!ATTLIST tocchap
+		%label.attrib;
+		%common.attrib;
+		%tocchap.role.attrib;
+		%local.tocchap.attrib;
+>
+<!--end of tocchap.attlist-->]]>
+<!--end of tocchap.module-->]]>
+
+<!ENTITY % toclevel1.module "INCLUDE">
+<![%toclevel1.module;[
+<!ENTITY % local.toclevel1.attrib "">
+<!ENTITY % toclevel1.role.attrib "%role.attrib;">
+
+<!ENTITY % toclevel1.element "INCLUDE">
+<![%toclevel1.element;[
+<!ELEMENT toclevel1 %ho; (tocentry+, toclevel2*)>
+<!--end of toclevel1.element-->]]>
+
+<!ENTITY % toclevel1.attlist "INCLUDE">
+<![%toclevel1.attlist;[
+<!ATTLIST toclevel1
+		%common.attrib;
+		%toclevel1.role.attrib;
+		%local.toclevel1.attrib;
+>
+<!--end of toclevel1.attlist-->]]>
+<!--end of toclevel1.module-->]]>
+
+<!ENTITY % toclevel2.module "INCLUDE">
+<![%toclevel2.module;[
+<!ENTITY % local.toclevel2.attrib "">
+<!ENTITY % toclevel2.role.attrib "%role.attrib;">
+
+<!ENTITY % toclevel2.element "INCLUDE">
+<![%toclevel2.element;[
+<!ELEMENT toclevel2 %ho; (tocentry+, toclevel3*)>
+<!--end of toclevel2.element-->]]>
+
+<!ENTITY % toclevel2.attlist "INCLUDE">
+<![%toclevel2.attlist;[
+<!ATTLIST toclevel2
+		%common.attrib;
+		%toclevel2.role.attrib;
+		%local.toclevel2.attrib;
+>
+<!--end of toclevel2.attlist-->]]>
+<!--end of toclevel2.module-->]]>
+
+<!ENTITY % toclevel3.module "INCLUDE">
+<![%toclevel3.module;[
+<!ENTITY % local.toclevel3.attrib "">
+<!ENTITY % toclevel3.role.attrib "%role.attrib;">
+
+<!ENTITY % toclevel3.element "INCLUDE">
+<![%toclevel3.element;[
+<!ELEMENT toclevel3 %ho; (tocentry+, toclevel4*)>
+<!--end of toclevel3.element-->]]>
+
+<!ENTITY % toclevel3.attlist "INCLUDE">
+<![%toclevel3.attlist;[
+<!ATTLIST toclevel3
+		%common.attrib;
+		%toclevel3.role.attrib;
+		%local.toclevel3.attrib;
+>
+<!--end of toclevel3.attlist-->]]>
+<!--end of toclevel3.module-->]]>
+
+<!ENTITY % toclevel4.module "INCLUDE">
+<![%toclevel4.module;[
+<!ENTITY % local.toclevel4.attrib "">
+<!ENTITY % toclevel4.role.attrib "%role.attrib;">
+
+<!ENTITY % toclevel4.element "INCLUDE">
+<![%toclevel4.element;[
+<!ELEMENT toclevel4 %ho; (tocentry+, toclevel5*)>
+<!--end of toclevel4.element-->]]>
+
+<!ENTITY % toclevel4.attlist "INCLUDE">
+<![%toclevel4.attlist;[
+<!ATTLIST toclevel4
+		%common.attrib;
+		%toclevel4.role.attrib;
+		%local.toclevel4.attrib;
+>
+<!--end of toclevel4.attlist-->]]>
+<!--end of toclevel4.module-->]]>
+
+<!ENTITY % toclevel5.module "INCLUDE">
+<![%toclevel5.module;[
+<!ENTITY % local.toclevel5.attrib "">
+<!ENTITY % toclevel5.role.attrib "%role.attrib;">
+
+<!ENTITY % toclevel5.element "INCLUDE">
+<![%toclevel5.element;[
+<!ELEMENT toclevel5 %ho; (tocentry+)>
+<!--end of toclevel5.element-->]]>
+
+<!ENTITY % toclevel5.attlist "INCLUDE">
+<![%toclevel5.attlist;[
+<!ATTLIST toclevel5
+		%common.attrib;
+		%toclevel5.role.attrib;
+		%local.toclevel5.attrib;
+>
+<!--end of toclevel5.attlist-->]]>
+<!--end of toclevel5.module-->]]>
+
+<!ENTITY % tocback.module "INCLUDE">
+<![%tocback.module;[
+<!ENTITY % local.tocback.attrib "">
+<!ENTITY % tocback.role.attrib "%role.attrib;">
+
+<!ENTITY % tocback.element "INCLUDE">
+<![%tocback.element;[
+<!ELEMENT tocback %ho; (%para.char.mix;)*>
+<!--end of tocback.element-->]]>
+
+<!-- to element that this entry represents -->
+
+
+<!ENTITY % tocback.attlist "INCLUDE">
+<![%tocback.attlist;[
+<!ATTLIST tocback
+		%label.attrib;
+		%linkend.attrib;		%pagenum.attrib;
+		%common.attrib;
+		%tocback.role.attrib;
+		%local.tocback.attrib;
+>
+<!--end of tocback.attlist-->]]>
+<!--end of tocback.module-->]]>
+<!--end of toc.content.module-->]]>
+
+<!ENTITY % lot.content.module "INCLUDE">
+<![%lot.content.module;[
+<!ENTITY % lot.module "INCLUDE">
+<![%lot.module;[
+<!ENTITY % local.lot.attrib "">
+<!ENTITY % lot.role.attrib "%role.attrib;">
+
+<!ENTITY % lot.element "INCLUDE">
+<![%lot.element;[
+<!ELEMENT lot %ho; (beginpage?, (%bookcomponent.title.content;)?, lotentry*)>
+<!--end of lot.element-->]]>
+
+<!ENTITY % lot.attlist "INCLUDE">
+<![%lot.attlist;[
+<!ATTLIST lot
+		%label.attrib;
+		%common.attrib;
+		%lot.role.attrib;
+		%local.lot.attrib;
+>
+<!--end of lot.attlist-->]]>
+<!--end of lot.module-->]]>
+
+<!ENTITY % lotentry.module "INCLUDE">
+<![%lotentry.module;[
+<!ENTITY % local.lotentry.attrib "">
+<!ENTITY % lotentry.role.attrib "%role.attrib;">
+
+<!ENTITY % lotentry.element "INCLUDE">
+<![%lotentry.element;[
+<!ELEMENT lotentry %ho; (%para.char.mix;)*>
+<!--end of lotentry.element-->]]>
+
+<!-- SrcCredit: Information about the source of the entry,
+		as for a list of illustrations -->
+<!-- linkend: to element that this entry represents-->
+<!ENTITY % lotentry.attlist "INCLUDE">
+<![%lotentry.attlist;[
+<!ATTLIST lotentry
+		%linkend.attrib;
+		%pagenum.attrib;
+		srccredit	CDATA		#IMPLIED
+		%common.attrib;
+		%lotentry.role.attrib;
+		%local.lotentry.attrib;
+>
+<!--end of lotentry.attlist-->]]>
+<!--end of lotentry.module-->]]>
+<!--end of lot.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Appendix, Chapter, Part, Preface, Reference, PartIntro ............... -->
+
+<!ENTITY % appendix.module "INCLUDE">
+<![%appendix.module;[
+<!ENTITY % local.appendix.attrib "">
+<!ENTITY % appendix.role.attrib "%role.attrib;">
+
+<!ENTITY % appendix.element "INCLUDE">
+<![%appendix.element;[
+<!ELEMENT appendix %ho; (beginpage?,
+                     appendixinfo?,
+                     (%bookcomponent.title.content;),
+                     (%nav.class;)*,
+                     tocchap?,
+                     (%bookcomponent.content;),
+                     (%nav.class;)*)
+		%ubiq.inclusion;>
+<!--end of appendix.element-->]]>
+
+<!ENTITY % appendix.attlist "INCLUDE">
+<![%appendix.attlist;[
+<!ATTLIST appendix
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%appendix.role.attrib;
+		%local.appendix.attrib;
+>
+<!--end of appendix.attlist-->]]>
+<!--end of appendix.module-->]]>
+
+<!ENTITY % chapter.module "INCLUDE">
+<![%chapter.module;[
+<!ENTITY % local.chapter.attrib "">
+<!ENTITY % chapter.role.attrib "%role.attrib;">
+
+<!ENTITY % chapter.element "INCLUDE">
+<![%chapter.element;[
+<!ELEMENT chapter %ho; (beginpage?,
+                    chapterinfo?,
+                    (%bookcomponent.title.content;),
+                    (%nav.class;)*,
+                    tocchap?,
+                    (%bookcomponent.content;),
+                    (%nav.class;)*)
+		%ubiq.inclusion;>
+<!--end of chapter.element-->]]>
+
+<!ENTITY % chapter.attlist "INCLUDE">
+<![%chapter.attlist;[
+<!ATTLIST chapter
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%chapter.role.attrib;
+		%local.chapter.attrib;
+>
+<!--end of chapter.attlist-->]]>
+<!--end of chapter.module-->]]>
+
+<!ENTITY % part.module "INCLUDE">
+<![%part.module;[
+
+<!-- Note that Part was to have its content model reduced in V4.4.  This
+change will not be made after all. -->
+
+<!ENTITY % local.part.attrib "">
+<!ENTITY % part.role.attrib "%role.attrib;">
+
+<!ENTITY % part.element "INCLUDE">
+<![%part.element;[
+<!ELEMENT part %ho; (beginpage?,
+                partinfo?, (%bookcomponent.title.content;), partintro?,
+		(%partcontent.mix;)+)
+		%ubiq.inclusion;>
+<!--end of part.element-->]]>
+
+<!ENTITY % part.attlist "INCLUDE">
+<![%part.attlist;[
+<!ATTLIST part
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%part.role.attrib;
+		%local.part.attrib;
+>
+<!--end of part.attlist-->]]>
+<!--ELEMENT PartIntro (defined below)-->
+<!--end of part.module-->]]>
+
+<!ENTITY % preface.module "INCLUDE">
+<![%preface.module;[
+<!ENTITY % local.preface.attrib "">
+<!ENTITY % preface.role.attrib "%role.attrib;">
+
+<!ENTITY % preface.element "INCLUDE">
+<![%preface.element;[
+<!ELEMENT preface %ho; (beginpage?,
+                    prefaceinfo?,
+                    (%bookcomponent.title.content;),
+                    (%nav.class;)*,
+                    tocchap?,
+                    (%bookcomponent.content;),
+                    (%nav.class;)*)
+		%ubiq.inclusion;>
+<!--end of preface.element-->]]>
+
+<!ENTITY % preface.attlist "INCLUDE">
+<![%preface.attlist;[
+<!ATTLIST preface
+		%status.attrib;
+		%common.attrib;
+		%preface.role.attrib;
+		%local.preface.attrib;
+>
+<!--end of preface.attlist-->]]>
+<!--end of preface.module-->]]>
+
+<!ENTITY % reference.module "INCLUDE">
+<![%reference.module;[
+<!ENTITY % local.reference.attrib "">
+<!ENTITY % reference.role.attrib "%role.attrib;">
+
+<!ENTITY % reference.element "INCLUDE">
+<![%reference.element;[
+<!ELEMENT reference %ho; (beginpage?,
+                     referenceinfo?,
+                     (%bookcomponent.title.content;), partintro?,
+                     (%refentry.class;)+)
+		%ubiq.inclusion;>
+<!--end of reference.element-->]]>
+
+<!ENTITY % reference.attlist "INCLUDE">
+<![%reference.attlist;[
+<!ATTLIST reference
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%reference.role.attrib;
+		%local.reference.attrib;
+>
+<!--end of reference.attlist-->]]>
+<!--ELEMENT PartIntro (defined below)-->
+<!--end of reference.module-->]]>
+
+<!ENTITY % partintro.module "INCLUDE">
+<![%partintro.module;[
+<!ENTITY % local.partintro.attrib "">
+<!ENTITY % partintro.role.attrib "%role.attrib;">
+
+<!ENTITY % partintro.element "INCLUDE">
+<![%partintro.element;[
+<!ELEMENT partintro %ho; ((%div.title.content;)?, (%bookcomponent.content;))
+		%ubiq.inclusion;>
+<!--end of partintro.element-->]]>
+
+<!ENTITY % partintro.attlist "INCLUDE">
+<![%partintro.attlist;[
+<!ATTLIST partintro
+		%label.attrib;
+		%common.attrib;
+		%partintro.role.attrib;
+		%local.partintro.attrib;
+>
+<!--end of partintro.attlist-->]]>
+<!--end of partintro.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Other Info elements .................................................. -->
+
+<!ENTITY % appendixinfo.module "INCLUDE">
+<![ %appendixinfo.module; [
+<!ENTITY % local.appendixinfo.attrib "">
+<!ENTITY % appendixinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % appendixinfo.element "INCLUDE">
+<![ %appendixinfo.element; [
+<!ELEMENT appendixinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of appendixinfo.element-->]]>
+
+<!ENTITY % appendixinfo.attlist "INCLUDE">
+<![ %appendixinfo.attlist; [
+<!ATTLIST appendixinfo
+		%common.attrib;
+		%appendixinfo.role.attrib;
+		%local.appendixinfo.attrib;
+>
+<!--end of appendixinfo.attlist-->]]>
+<!--end of appendixinfo.module-->]]>
+
+<!ENTITY % bibliographyinfo.module "INCLUDE">
+<![ %bibliographyinfo.module; [
+<!ENTITY % local.bibliographyinfo.attrib "">
+<!ENTITY % bibliographyinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliographyinfo.element "INCLUDE">
+<![ %bibliographyinfo.element; [
+<!ELEMENT bibliographyinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of bibliographyinfo.element-->]]>
+
+<!ENTITY % bibliographyinfo.attlist "INCLUDE">
+<![ %bibliographyinfo.attlist; [
+<!ATTLIST bibliographyinfo
+		%common.attrib;
+		%bibliographyinfo.role.attrib;
+		%local.bibliographyinfo.attrib;
+>
+<!--end of bibliographyinfo.attlist-->]]>
+<!--end of bibliographyinfo.module-->]]>
+
+<!ENTITY % chapterinfo.module "INCLUDE">
+<![ %chapterinfo.module; [
+<!ENTITY % local.chapterinfo.attrib "">
+<!ENTITY % chapterinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % chapterinfo.element "INCLUDE">
+<![ %chapterinfo.element; [
+<!ELEMENT chapterinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of chapterinfo.element-->]]>
+
+<!ENTITY % chapterinfo.attlist "INCLUDE">
+<![ %chapterinfo.attlist; [
+<!ATTLIST chapterinfo
+		%common.attrib;
+		%chapterinfo.role.attrib;
+		%local.chapterinfo.attrib;
+>
+<!--end of chapterinfo.attlist-->]]>
+<!--end of chapterinfo.module-->]]>
+
+<!ENTITY % glossaryinfo.module "INCLUDE">
+<![ %glossaryinfo.module; [
+<!ENTITY % local.glossaryinfo.attrib "">
+<!ENTITY % glossaryinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % glossaryinfo.element "INCLUDE">
+<![ %glossaryinfo.element; [
+<!ELEMENT glossaryinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of glossaryinfo.element-->]]>
+
+<!ENTITY % glossaryinfo.attlist "INCLUDE">
+<![ %glossaryinfo.attlist; [
+<!ATTLIST glossaryinfo
+		%common.attrib;
+		%glossaryinfo.role.attrib;
+		%local.glossaryinfo.attrib;
+>
+<!--end of glossaryinfo.attlist-->]]>
+<!--end of glossaryinfo.module-->]]>
+
+<!ENTITY % indexinfo.module "INCLUDE">
+<![ %indexinfo.module; [
+<!ENTITY % local.indexinfo.attrib "">
+<!ENTITY % indexinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % indexinfo.element "INCLUDE">
+<![ %indexinfo.element; [
+<!ELEMENT indexinfo %ho; ((%info.class;)+)>
+<!--end of indexinfo.element-->]]>
+
+<!ENTITY % indexinfo.attlist "INCLUDE">
+<![ %indexinfo.attlist; [
+<!ATTLIST indexinfo
+		%common.attrib;
+		%indexinfo.role.attrib;
+		%local.indexinfo.attrib;
+>
+<!--end of indexinfo.attlist-->]]>
+<!--end of indexinfo.module-->]]>
+
+<!ENTITY % setindexinfo.module "INCLUDE">
+<![ %setindexinfo.module; [
+<!ENTITY % local.setindexinfo.attrib "">
+<!ENTITY % setindexinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % setindexinfo.element "INCLUDE">
+<![ %setindexinfo.element; [
+<!ELEMENT setindexinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of setindexinfo.element-->]]>
+
+<!ENTITY % setindexinfo.attlist "INCLUDE">
+<![ %setindexinfo.attlist; [
+<!ATTLIST setindexinfo
+		%common.attrib;
+		%setindexinfo.role.attrib;
+		%local.setindexinfo.attrib;
+>
+<!--end of setindexinfo.attlist-->]]>
+<!--end of setindexinfo.module-->]]>
+
+<!ENTITY % partinfo.module "INCLUDE">
+<![ %partinfo.module; [
+<!ENTITY % local.partinfo.attrib "">
+<!ENTITY % partinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % partinfo.element "INCLUDE">
+<![ %partinfo.element; [
+<!ELEMENT partinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of partinfo.element-->]]>
+
+<!ENTITY % partinfo.attlist "INCLUDE">
+<![ %partinfo.attlist; [
+<!ATTLIST partinfo
+		%common.attrib;
+		%partinfo.role.attrib;
+		%local.partinfo.attrib;
+>
+<!--end of partinfo.attlist-->]]>
+<!--end of partinfo.module-->]]>
+
+<!ENTITY % prefaceinfo.module "INCLUDE">
+<![ %prefaceinfo.module; [
+<!ENTITY % local.prefaceinfo.attrib "">
+<!ENTITY % prefaceinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % prefaceinfo.element "INCLUDE">
+<![ %prefaceinfo.element; [
+<!ELEMENT prefaceinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of prefaceinfo.element-->]]>
+
+<!ENTITY % prefaceinfo.attlist "INCLUDE">
+<![ %prefaceinfo.attlist; [
+<!ATTLIST prefaceinfo
+		%common.attrib;
+		%prefaceinfo.role.attrib;
+		%local.prefaceinfo.attrib;
+>
+<!--end of prefaceinfo.attlist-->]]>
+<!--end of prefaceinfo.module-->]]>
+
+<!ENTITY % refentryinfo.module "INCLUDE">
+<![ %refentryinfo.module; [
+<!ENTITY % local.refentryinfo.attrib "">
+<!ENTITY % refentryinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % refentryinfo.element "INCLUDE">
+<![ %refentryinfo.element; [
+<!ELEMENT refentryinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of refentryinfo.element-->]]>
+
+<!ENTITY % refentryinfo.attlist "INCLUDE">
+<![ %refentryinfo.attlist; [
+<!ATTLIST refentryinfo
+		%common.attrib;
+		%refentryinfo.role.attrib;
+		%local.refentryinfo.attrib;
+>
+<!--end of refentryinfo.attlist-->]]>
+<!--end of refentryinfo.module-->]]>
+
+<!ENTITY % refsectioninfo.module "INCLUDE">
+<![ %refsectioninfo.module; [
+<!ENTITY % local.refsectioninfo.attrib "">
+<!ENTITY % refsectioninfo.role.attrib "%role.attrib;">
+
+<!ENTITY % refsectioninfo.element "INCLUDE">
+<![ %refsectioninfo.element; [
+<!ELEMENT refsectioninfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of refsectioninfo.element-->]]>
+
+<!ENTITY % refsectioninfo.attlist "INCLUDE">
+<![ %refsectioninfo.attlist; [
+<!ATTLIST refsectioninfo
+		%common.attrib;
+		%refsectioninfo.role.attrib;
+		%local.refsectioninfo.attrib;
+>
+<!--end of refsectioninfo.attlist-->]]>
+<!--end of refsectioninfo.module-->]]>
+
+<!ENTITY % refsect1info.module "INCLUDE">
+<![ %refsect1info.module; [
+<!ENTITY % local.refsect1info.attrib "">
+<!ENTITY % refsect1info.role.attrib "%role.attrib;">
+
+<!ENTITY % refsect1info.element "INCLUDE">
+<![ %refsect1info.element; [
+<!ELEMENT refsect1info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of refsect1info.element-->]]>
+
+<!ENTITY % refsect1info.attlist "INCLUDE">
+<![ %refsect1info.attlist; [
+<!ATTLIST refsect1info
+		%common.attrib;
+		%refsect1info.role.attrib;
+		%local.refsect1info.attrib;
+>
+<!--end of refsect1info.attlist-->]]>
+<!--end of refsect1info.module-->]]>
+
+<!ENTITY % refsect2info.module "INCLUDE">
+<![ %refsect2info.module; [
+<!ENTITY % local.refsect2info.attrib "">
+<!ENTITY % refsect2info.role.attrib "%role.attrib;">
+
+<!ENTITY % refsect2info.element "INCLUDE">
+<![ %refsect2info.element; [
+<!ELEMENT refsect2info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of refsect2info.element-->]]>
+
+<!ENTITY % refsect2info.attlist "INCLUDE">
+<![ %refsect2info.attlist; [
+<!ATTLIST refsect2info
+		%common.attrib;
+		%refsect2info.role.attrib;
+		%local.refsect2info.attrib;
+>
+<!--end of refsect2info.attlist-->]]>
+<!--end of refsect2info.module-->]]>
+
+<!ENTITY % refsect3info.module "INCLUDE">
+<![ %refsect3info.module; [
+<!ENTITY % local.refsect3info.attrib "">
+<!ENTITY % refsect3info.role.attrib "%role.attrib;">
+
+<!ENTITY % refsect3info.element "INCLUDE">
+<![ %refsect3info.element; [
+<!ELEMENT refsect3info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of refsect3info.element-->]]>
+
+<!ENTITY % refsect3info.attlist "INCLUDE">
+<![ %refsect3info.attlist; [
+<!ATTLIST refsect3info
+		%common.attrib;
+		%refsect3info.role.attrib;
+		%local.refsect3info.attrib;
+>
+<!--end of refsect3info.attlist-->]]>
+<!--end of refsect3info.module-->]]>
+
+<!ENTITY % refsynopsisdivinfo.module "INCLUDE">
+<![ %refsynopsisdivinfo.module; [
+<!ENTITY % local.refsynopsisdivinfo.attrib "">
+<!ENTITY % refsynopsisdivinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % refsynopsisdivinfo.element "INCLUDE">
+<![ %refsynopsisdivinfo.element; [
+<!ELEMENT refsynopsisdivinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of refsynopsisdivinfo.element-->]]>
+
+<!ENTITY % refsynopsisdivinfo.attlist "INCLUDE">
+<![ %refsynopsisdivinfo.attlist; [
+<!ATTLIST refsynopsisdivinfo
+		%common.attrib;
+		%refsynopsisdivinfo.role.attrib;
+		%local.refsynopsisdivinfo.attrib;
+>
+<!--end of refsynopsisdivinfo.attlist-->]]>
+<!--end of refsynopsisdivinfo.module-->]]>
+
+<!ENTITY % referenceinfo.module "INCLUDE">
+<![ %referenceinfo.module; [
+<!ENTITY % local.referenceinfo.attrib "">
+<!ENTITY % referenceinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % referenceinfo.element "INCLUDE">
+<![ %referenceinfo.element; [
+<!ELEMENT referenceinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of referenceinfo.element-->]]>
+
+<!ENTITY % referenceinfo.attlist "INCLUDE">
+<![ %referenceinfo.attlist; [
+<!ATTLIST referenceinfo
+		%common.attrib;
+		%referenceinfo.role.attrib;
+		%local.referenceinfo.attrib;
+>
+<!--end of referenceinfo.attlist-->]]>
+<!--end of referenceinfo.module-->]]>
+
+<!ENTITY % local.sect1info.attrib "">
+<!ENTITY % sect1info.role.attrib "%role.attrib;">
+
+<!ENTITY % sect1info.element "INCLUDE">
+<![%sect1info.element;[
+<!ELEMENT sect1info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of sect1info.element-->]]>
+
+<!ENTITY % sect1info.attlist "INCLUDE">
+<![%sect1info.attlist;[
+<!ATTLIST sect1info
+		%common.attrib;
+		%sect1info.role.attrib;
+		%local.sect1info.attrib;
+>
+<!--end of sect1info.attlist-->]]>
+
+<!ENTITY % local.sect2info.attrib "">
+<!ENTITY % sect2info.role.attrib "%role.attrib;">
+
+<!ENTITY % sect2info.element "INCLUDE">
+<![%sect2info.element;[
+<!ELEMENT sect2info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of sect2info.element-->]]>
+
+<!ENTITY % sect2info.attlist "INCLUDE">
+<![%sect2info.attlist;[
+<!ATTLIST sect2info
+		%common.attrib;
+		%sect2info.role.attrib;
+		%local.sect2info.attrib;
+>
+<!--end of sect2info.attlist-->]]>
+
+<!ENTITY % local.sect3info.attrib "">
+<!ENTITY % sect3info.role.attrib "%role.attrib;">
+
+<!ENTITY % sect3info.element "INCLUDE">
+<![%sect3info.element;[
+<!ELEMENT sect3info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of sect3info.element-->]]>
+
+<!ENTITY % sect3info.attlist "INCLUDE">
+<![%sect3info.attlist;[
+<!ATTLIST sect3info
+		%common.attrib;
+		%sect3info.role.attrib;
+		%local.sect3info.attrib;
+>
+<!--end of sect3info.attlist-->]]>
+
+<!ENTITY % local.sect4info.attrib "">
+<!ENTITY % sect4info.role.attrib "%role.attrib;">
+
+<!ENTITY % sect4info.element "INCLUDE">
+<![%sect4info.element;[
+<!ELEMENT sect4info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of sect4info.element-->]]>
+
+<!ENTITY % sect4info.attlist "INCLUDE">
+<![%sect4info.attlist;[
+<!ATTLIST sect4info
+		%common.attrib;
+		%sect4info.role.attrib;
+		%local.sect4info.attrib;
+>
+<!--end of sect4info.attlist-->]]>
+
+<!ENTITY % local.sect5info.attrib "">
+<!ENTITY % sect5info.role.attrib "%role.attrib;">
+
+<!ENTITY % sect5info.element "INCLUDE">
+<![%sect5info.element;[
+<!ELEMENT sect5info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of sect5info.element-->]]>
+
+<!ENTITY % sect5info.attlist "INCLUDE">
+<![%sect5info.attlist;[
+<!ATTLIST sect5info
+		%common.attrib;
+		%sect5info.role.attrib;
+		%local.sect5info.attrib;
+>
+<!--end of sect5info.attlist-->]]>
+
+<!-- ...................................................................... -->
+<!-- Section (parallel to Sect*) ......................................... -->
+
+<!ENTITY % section.content.module "INCLUDE">
+<![ %section.content.module; [
+<!ENTITY % section.module "INCLUDE">
+<![ %section.module; [
+<!ENTITY % local.section.attrib "">
+<!ENTITY % section.role.attrib "%role.attrib;">
+
+<!ENTITY % section.element "INCLUDE">
+<![ %section.element; [
+<!ELEMENT section %ho; (sectioninfo?,
+			(%sect.title.content;),
+			(%nav.class;)*,
+			(((%divcomponent.mix;)+,
+ 			  ((%refentry.class;)*|(%section.class;)*|simplesect*))
+			 | (%refentry.class;)+|(%section.class;)+|simplesect+),
+			(%nav.class;)*)
+		%ubiq.inclusion;>
+<!--end of section.element-->]]>
+
+<!ENTITY % section.attlist "INCLUDE">
+<![ %section.attlist; [
+<!ATTLIST section
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%section.role.attrib;
+		%local.section.attrib;
+>
+<!--end of section.attlist-->]]>
+<!--end of section.module-->]]>
+
+<!ENTITY % sectioninfo.module "INCLUDE">
+<![ %sectioninfo.module; [
+<!ENTITY % sectioninfo.role.attrib "%role.attrib;">
+<!ENTITY % local.sectioninfo.attrib "">
+
+<!ENTITY % sectioninfo.element "INCLUDE">
+<![ %sectioninfo.element; [
+<!ELEMENT sectioninfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of sectioninfo.element-->]]>
+
+<!ENTITY % sectioninfo.attlist "INCLUDE">
+<![ %sectioninfo.attlist; [
+<!ATTLIST sectioninfo
+		%common.attrib;
+		%sectioninfo.role.attrib;
+		%local.sectioninfo.attrib;
+>
+<!--end of sectioninfo.attlist-->]]>
+<!--end of sectioninfo.module-->]]>
+<!--end of section.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Sect1, Sect2, Sect3, Sect4, Sect5 .................................... -->
+
+<!ENTITY % sect1.module "INCLUDE">
+<![%sect1.module;[
+<!ENTITY % local.sect1.attrib "">
+<!ENTITY % sect1.role.attrib "%role.attrib;">
+
+<!ENTITY % sect1.element "INCLUDE">
+<![%sect1.element;[
+<!ELEMENT sect1 %ho; (sect1info?, (%sect.title.content;), (%nav.class;)*,
+		(((%divcomponent.mix;)+,
+		((%refentry.class;)* | sect2* | simplesect*))
+		| (%refentry.class;)+ | sect2+ | simplesect+), (%nav.class;)*)
+		%ubiq.inclusion;>
+<!--end of sect1.element-->]]>
+
+<!-- Renderas: Indicates the format in which the heading should
+		appear -->
+
+
+<!ENTITY % sect1.attlist "INCLUDE">
+<![%sect1.attlist;[
+<!ATTLIST sect1
+		renderas	(sect2
+				|sect3
+				|sect4
+				|sect5)		#IMPLIED
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%sect1.role.attrib;
+		%local.sect1.attrib;
+>
+<!--end of sect1.attlist-->]]>
+<!--end of sect1.module-->]]>
+
+<!ENTITY % sect2.module "INCLUDE">
+<![%sect2.module;[
+<!ENTITY % local.sect2.attrib "">
+<!ENTITY % sect2.role.attrib "%role.attrib;">
+
+<!ENTITY % sect2.element "INCLUDE">
+<![%sect2.element;[
+<!ELEMENT sect2 %ho; (sect2info?, (%sect.title.content;), (%nav.class;)*,
+		(((%divcomponent.mix;)+,
+		((%refentry.class;)* | sect3* | simplesect*))
+		| (%refentry.class;)+ | sect3+ | simplesect+), (%nav.class;)*)>
+<!--end of sect2.element-->]]>
+
+<!-- Renderas: Indicates the format in which the heading should
+		appear -->
+
+
+<!ENTITY % sect2.attlist "INCLUDE">
+<![%sect2.attlist;[
+<!ATTLIST sect2
+		renderas	(sect1
+				|sect3
+				|sect4
+				|sect5)		#IMPLIED
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%sect2.role.attrib;
+		%local.sect2.attrib;
+>
+<!--end of sect2.attlist-->]]>
+<!--end of sect2.module-->]]>
+
+<!ENTITY % sect3.module "INCLUDE">
+<![%sect3.module;[
+<!ENTITY % local.sect3.attrib "">
+<!ENTITY % sect3.role.attrib "%role.attrib;">
+
+<!ENTITY % sect3.element "INCLUDE">
+<![%sect3.element;[
+<!ELEMENT sect3 %ho; (sect3info?, (%sect.title.content;), (%nav.class;)*,
+		(((%divcomponent.mix;)+,
+		((%refentry.class;)* | sect4* | simplesect*))
+		| (%refentry.class;)+ | sect4+ | simplesect+), (%nav.class;)*)>
+<!--end of sect3.element-->]]>
+
+<!-- Renderas: Indicates the format in which the heading should
+		appear -->
+
+
+<!ENTITY % sect3.attlist "INCLUDE">
+<![%sect3.attlist;[
+<!ATTLIST sect3
+		renderas	(sect1
+				|sect2
+				|sect4
+				|sect5)		#IMPLIED
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%sect3.role.attrib;
+		%local.sect3.attrib;
+>
+<!--end of sect3.attlist-->]]>
+<!--end of sect3.module-->]]>
+
+<!ENTITY % sect4.module "INCLUDE">
+<![%sect4.module;[
+<!ENTITY % local.sect4.attrib "">
+<!ENTITY % sect4.role.attrib "%role.attrib;">
+
+<!ENTITY % sect4.element "INCLUDE">
+<![%sect4.element;[
+<!ELEMENT sect4 %ho; (sect4info?, (%sect.title.content;), (%nav.class;)*,
+		(((%divcomponent.mix;)+,
+		((%refentry.class;)* | sect5* | simplesect*))
+		| (%refentry.class;)+ | sect5+ | simplesect+), (%nav.class;)*)>
+<!--end of sect4.element-->]]>
+
+<!-- Renderas: Indicates the format in which the heading should
+		appear -->
+
+
+<!ENTITY % sect4.attlist "INCLUDE">
+<![%sect4.attlist;[
+<!ATTLIST sect4
+		renderas	(sect1
+				|sect2
+				|sect3
+				|sect5)		#IMPLIED
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%sect4.role.attrib;
+		%local.sect4.attrib;
+>
+<!--end of sect4.attlist-->]]>
+<!--end of sect4.module-->]]>
+
+<!ENTITY % sect5.module "INCLUDE">
+<![%sect5.module;[
+<!ENTITY % local.sect5.attrib "">
+<!ENTITY % sect5.role.attrib "%role.attrib;">
+
+<!ENTITY % sect5.element "INCLUDE">
+<![%sect5.element;[
+<!ELEMENT sect5 %ho; (sect5info?, (%sect.title.content;), (%nav.class;)*,
+		(((%divcomponent.mix;)+, ((%refentry.class;)* | simplesect*))
+		| (%refentry.class;)+ | simplesect+), (%nav.class;)*)>
+<!--end of sect5.element-->]]>
+
+<!-- Renderas: Indicates the format in which the heading should
+		appear -->
+
+
+<!ENTITY % sect5.attlist "INCLUDE">
+<![%sect5.attlist;[
+<!ATTLIST sect5
+		renderas	(sect1
+				|sect2
+				|sect3
+				|sect4)		#IMPLIED
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%sect5.role.attrib;
+		%local.sect5.attrib;
+>
+<!--end of sect5.attlist-->]]>
+<!--end of sect5.module-->]]>
+
+<!ENTITY % simplesect.module "INCLUDE">
+<![%simplesect.module;[
+<!ENTITY % local.simplesect.attrib "">
+<!ENTITY % simplesect.role.attrib "%role.attrib;">
+
+<!ENTITY % simplesect.element "INCLUDE">
+<![%simplesect.element;[
+<!ELEMENT simplesect %ho; ((%sect.title.content;), (%divcomponent.mix;)+)
+		%ubiq.inclusion;>
+<!--end of simplesect.element-->]]>
+
+<!ENTITY % simplesect.attlist "INCLUDE">
+<![%simplesect.attlist;[
+<!ATTLIST simplesect
+		%common.attrib;
+		%simplesect.role.attrib;
+		%local.simplesect.attrib;
+>
+<!--end of simplesect.attlist-->]]>
+<!--end of simplesect.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Bibliography ......................................................... -->
+
+<!ENTITY % bibliography.content.module "INCLUDE">
+<![%bibliography.content.module;[
+<!ENTITY % bibliography.module "INCLUDE">
+<![%bibliography.module;[
+<!ENTITY % local.bibliography.attrib "">
+<!ENTITY % bibliography.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliography.element "INCLUDE">
+<![%bibliography.element;[
+<!ELEMENT bibliography %ho; (bibliographyinfo?,
+                        (%bookcomponent.title.content;)?,
+                        (%component.mix;)*,
+                        (bibliodiv+ | (biblioentry|bibliomixed)+))>
+<!--end of bibliography.element-->]]>
+
+<!ENTITY % bibliography.attlist "INCLUDE">
+<![%bibliography.attlist;[
+<!ATTLIST bibliography
+		%status.attrib;
+		%common.attrib;
+		%bibliography.role.attrib;
+		%local.bibliography.attrib;
+>
+<!--end of bibliography.attlist-->]]>
+<!--end of bibliography.module-->]]>
+
+<!ENTITY % bibliodiv.module "INCLUDE">
+<![%bibliodiv.module;[
+<!ENTITY % local.bibliodiv.attrib "">
+<!ENTITY % bibliodiv.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliodiv.element "INCLUDE">
+<![%bibliodiv.element;[
+<!ELEMENT bibliodiv %ho; ((%sect.title.content;)?, (%component.mix;)*,
+		(biblioentry|bibliomixed)+)>
+<!--end of bibliodiv.element-->]]>
+
+<!ENTITY % bibliodiv.attlist "INCLUDE">
+<![%bibliodiv.attlist;[
+<!ATTLIST bibliodiv
+		%status.attrib;
+		%common.attrib;
+		%bibliodiv.role.attrib;
+		%local.bibliodiv.attrib;
+>
+<!--end of bibliodiv.attlist-->]]>
+<!--end of bibliodiv.module-->]]>
+<!--end of bibliography.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Glossary ............................................................. -->
+
+<!ENTITY % glossary.content.module "INCLUDE">
+<![%glossary.content.module;[
+<!ENTITY % glossary.module "INCLUDE">
+<![%glossary.module;[
+<!ENTITY % local.glossary.attrib "">
+<!ENTITY % glossary.role.attrib "%role.attrib;">
+
+<!ENTITY % glossary.element "INCLUDE">
+<![%glossary.element;[
+<!ELEMENT glossary %ho; (glossaryinfo?,
+                    (%bookcomponent.title.content;)?,
+                    (%component.mix;)*,
+                    (glossdiv+ | glossentry+), bibliography?)>
+<!--end of glossary.element-->]]>
+
+<!ENTITY % glossary.attlist "INCLUDE">
+<![%glossary.attlist;[
+<!ATTLIST glossary
+		%status.attrib;
+		%common.attrib;
+		%glossary.role.attrib;
+		%local.glossary.attrib;
+>
+<!--end of glossary.attlist-->]]>
+<!--end of glossary.module-->]]>
+
+<!ENTITY % glossdiv.module "INCLUDE">
+<![%glossdiv.module;[
+<!ENTITY % local.glossdiv.attrib "">
+<!ENTITY % glossdiv.role.attrib "%role.attrib;">
+
+<!ENTITY % glossdiv.element "INCLUDE">
+<![%glossdiv.element;[
+<!ELEMENT glossdiv %ho; ((%sect.title.content;), (%component.mix;)*,
+		glossentry+)>
+<!--end of glossdiv.element-->]]>
+
+<!ENTITY % glossdiv.attlist "INCLUDE">
+<![%glossdiv.attlist;[
+<!ATTLIST glossdiv
+		%status.attrib;
+		%common.attrib;
+		%glossdiv.role.attrib;
+		%local.glossdiv.attrib;
+>
+<!--end of glossdiv.attlist-->]]>
+<!--end of glossdiv.module-->]]>
+<!--end of glossary.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Index and SetIndex ................................................... -->
+
+<!ENTITY % index.content.module "INCLUDE">
+<![%index.content.module;[
+<!ENTITY % indexes.module "INCLUDE">
+<![%indexes.module;[
+<!ENTITY % local.indexes.attrib "">
+<!ENTITY % indexes.role.attrib "%role.attrib;">
+
+<!ENTITY % index.element "INCLUDE">
+<![%index.element;[
+<!ELEMENT index %ho; (indexinfo?,
+                 (%bookcomponent.title.content;)?,
+                 (%component.mix;)*,
+                 (indexdiv* | indexentry*))
+		%ndxterm.exclusion;>
+<!--end of index.element-->]]>
+
+<!ENTITY % index.attlist "INCLUDE">
+<![%index.attlist;[
+<!ATTLIST index
+		type		CDATA		#IMPLIED
+		%common.attrib;
+		%indexes.role.attrib;
+		%local.indexes.attrib;
+>
+<!--end of index.attlist-->]]>
+
+<!ENTITY % setindex.element "INCLUDE">
+<![%setindex.element;[
+<!ELEMENT setindex %ho; (setindexinfo?,
+                    (%bookcomponent.title.content;)?,
+                    (%component.mix;)*,
+                    (indexdiv* | indexentry*))
+		%ndxterm.exclusion;>
+<!--end of setindex.element-->]]>
+
+<!ENTITY % setindex.attlist "INCLUDE">
+<![%setindex.attlist;[
+<!ATTLIST setindex
+		%common.attrib;
+		%indexes.role.attrib;
+		%local.indexes.attrib;
+>
+<!--end of setindex.attlist-->]]>
+<!--end of indexes.module-->]]>
+
+<!ENTITY % indexdiv.module "INCLUDE">
+<![%indexdiv.module;[
+
+<!-- SegmentedList in this content is useful for marking up permuted
+     indices. -->
+
+<!ENTITY % local.indexdiv.attrib "">
+<!ENTITY % indexdiv.role.attrib "%role.attrib;">
+
+<!ENTITY % indexdiv.element "INCLUDE">
+<![%indexdiv.element;[
+<!ELEMENT indexdiv %ho; ((%sect.title.content;)?, ((%indexdivcomponent.mix;)*,
+		(indexentry+ | segmentedlist)))>
+<!--end of indexdiv.element-->]]>
+
+<!ENTITY % indexdiv.attlist "INCLUDE">
+<![%indexdiv.attlist;[
+<!ATTLIST indexdiv
+		%common.attrib;
+		%indexdiv.role.attrib;
+		%local.indexdiv.attrib;
+>
+<!--end of indexdiv.attlist-->]]>
+<!--end of indexdiv.module-->]]>
+
+<!ENTITY % indexentry.module "INCLUDE">
+<![%indexentry.module;[
+<!-- Index entries appear in the index, not the text. -->
+
+<!ENTITY % local.indexentry.attrib "">
+<!ENTITY % indexentry.role.attrib "%role.attrib;">
+
+<!ENTITY % indexentry.element "INCLUDE">
+<![%indexentry.element;[
+<!ELEMENT indexentry %ho; (primaryie, (seeie|seealsoie)*,
+		(secondaryie, (seeie|seealsoie|tertiaryie)*)*)>
+<!--end of indexentry.element-->]]>
+
+<!ENTITY % indexentry.attlist "INCLUDE">
+<![%indexentry.attlist;[
+<!ATTLIST indexentry
+		%common.attrib;
+		%indexentry.role.attrib;
+		%local.indexentry.attrib;
+>
+<!--end of indexentry.attlist-->]]>
+<!--end of indexentry.module-->]]>
+
+<!ENTITY % primsecterie.module "INCLUDE">
+<![%primsecterie.module;[
+<!ENTITY % local.primsecterie.attrib "">
+<!ENTITY % primsecterie.role.attrib "%role.attrib;">
+
+<!ENTITY % primaryie.element "INCLUDE">
+<![%primaryie.element;[
+<!ELEMENT primaryie %ho; (%ndxterm.char.mix;)*>
+<!--end of primaryie.element-->]]>
+
+<!-- to IndexTerms that these entries represent -->
+
+<!ENTITY % primaryie.attlist "INCLUDE">
+<![%primaryie.attlist;[
+<!ATTLIST primaryie
+		%linkends.attrib;		%common.attrib;
+		%primsecterie.role.attrib;
+		%local.primsecterie.attrib;
+>
+<!--end of primaryie.attlist-->]]>
+
+<!ENTITY % secondaryie.element "INCLUDE">
+<![%secondaryie.element;[
+<!ELEMENT secondaryie %ho; (%ndxterm.char.mix;)*>
+<!--end of secondaryie.element-->]]>
+
+<!-- to IndexTerms that these entries represent -->
+
+<!ENTITY % secondaryie.attlist "INCLUDE">
+<![%secondaryie.attlist;[
+<!ATTLIST secondaryie
+		%linkends.attrib;		%common.attrib;
+		%primsecterie.role.attrib;
+		%local.primsecterie.attrib;
+>
+<!--end of secondaryie.attlist-->]]>
+
+<!ENTITY % tertiaryie.element "INCLUDE">
+<![%tertiaryie.element;[
+<!ELEMENT tertiaryie %ho; (%ndxterm.char.mix;)*>
+<!--end of tertiaryie.element-->]]>
+
+<!-- to IndexTerms that these entries represent -->
+
+<!ENTITY % tertiaryie.attlist "INCLUDE">
+<![%tertiaryie.attlist;[
+<!ATTLIST tertiaryie
+		%linkends.attrib;		%common.attrib;
+		%primsecterie.role.attrib;
+		%local.primsecterie.attrib;
+>
+<!--end of tertiaryie.attlist-->]]>
+
+<!--end of primsecterie.module-->]]>
+
+<!ENTITY % seeie.module "INCLUDE">
+<![%seeie.module;[
+<!ENTITY % local.seeie.attrib "">
+<!ENTITY % seeie.role.attrib "%role.attrib;">
+
+<!ENTITY % seeie.element "INCLUDE">
+<![%seeie.element;[
+<!ELEMENT seeie %ho; (%ndxterm.char.mix;)*>
+<!--end of seeie.element-->]]>
+
+<!-- to IndexEntry to look up -->
+
+
+<!ENTITY % seeie.attlist "INCLUDE">
+<![%seeie.attlist;[
+<!ATTLIST seeie
+		%linkend.attrib;		%common.attrib;
+		%seeie.role.attrib;
+		%local.seeie.attrib;
+>
+<!--end of seeie.attlist-->]]>
+<!--end of seeie.module-->]]>
+
+<!ENTITY % seealsoie.module "INCLUDE">
+<![%seealsoie.module;[
+<!ENTITY % local.seealsoie.attrib "">
+<!ENTITY % seealsoie.role.attrib "%role.attrib;">
+
+<!ENTITY % seealsoie.element "INCLUDE">
+<![%seealsoie.element;[
+<!ELEMENT seealsoie %ho; (%ndxterm.char.mix;)*>
+<!--end of seealsoie.element-->]]>
+
+<!-- to related IndexEntries -->
+
+
+<!ENTITY % seealsoie.attlist "INCLUDE">
+<![%seealsoie.attlist;[
+<!ATTLIST seealsoie
+		%linkends.attrib;		%common.attrib;
+		%seealsoie.role.attrib;
+		%local.seealsoie.attrib;
+>
+<!--end of seealsoie.attlist-->]]>
+<!--end of seealsoie.module-->]]>
+<!--end of index.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- RefEntry ............................................................. -->
+
+<!ENTITY % refentry.content.module "INCLUDE">
+<![%refentry.content.module;[
+<!ENTITY % refentry.module "INCLUDE">
+<![%refentry.module;[
+<!ENTITY % local.refentry.attrib "">
+<!ENTITY % refentry.role.attrib "%role.attrib;">
+
+<!ENTITY % refentry.element "INCLUDE">
+<![%refentry.element;[
+<!ELEMENT refentry %ho; (beginpage?,
+                    (%ndxterm.class;)*,
+                    refentryinfo?, refmeta?, (remark|%link.char.class;)*,
+                    refnamediv+, refsynopsisdiv?, (refsect1+|refsection+))
+		%ubiq.inclusion;>
+<!--end of refentry.element-->]]>
+
+<!ENTITY % refentry.attlist "INCLUDE">
+<![%refentry.attlist;[
+<!ATTLIST refentry
+		%status.attrib;
+		%common.attrib;
+		%refentry.role.attrib;
+		%local.refentry.attrib;
+>
+<!--end of refentry.attlist-->]]>
+<!--end of refentry.module-->]]>
+
+<!ENTITY % refmeta.module "INCLUDE">
+<![%refmeta.module;[
+<!ENTITY % local.refmeta.attrib "">
+<!ENTITY % refmeta.role.attrib "%role.attrib;">
+
+<!ENTITY % refmeta.element "INCLUDE">
+<![%refmeta.element;[
+<!ELEMENT refmeta %ho; ((%ndxterm.class;)*,
+                   refentrytitle, manvolnum?, refmiscinfo*,
+                   (%ndxterm.class;)*)
+		%beginpage.exclusion;>
+<!--end of refmeta.element-->]]>
+
+<!ENTITY % refmeta.attlist "INCLUDE">
+<![%refmeta.attlist;[
+<!ATTLIST refmeta
+		%common.attrib;
+		%refmeta.role.attrib;
+		%local.refmeta.attrib;
+>
+<!--end of refmeta.attlist-->]]>
+<!--end of refmeta.module-->]]>
+
+<!ENTITY % refmiscinfo.module "INCLUDE">
+<![%refmiscinfo.module;[
+<!ENTITY % local.refmiscinfo.attrib "">
+<!ENTITY % refmiscinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % refmiscinfo.element "INCLUDE">
+<![%refmiscinfo.element;[
+<!ELEMENT refmiscinfo %ho; (%docinfo.char.mix;)*>
+<!--end of refmiscinfo.element-->]]>
+
+<!-- Class: Freely assignable parameter; no default -->
+
+
+<!ENTITY % refmiscinfo.attlist "INCLUDE">
+<![%refmiscinfo.attlist;[
+<!ATTLIST refmiscinfo
+		class		CDATA		#IMPLIED
+		%common.attrib;
+		%refmiscinfo.role.attrib;
+		%local.refmiscinfo.attrib;
+>
+<!--end of refmiscinfo.attlist-->]]>
+<!--end of refmiscinfo.module-->]]>
+
+<!ENTITY % refnamediv.module "INCLUDE">
+<![%refnamediv.module;[
+<!ENTITY % local.refnamediv.attrib "">
+<!ENTITY % refnamediv.role.attrib "%role.attrib;">
+
+<!ENTITY % refnamediv.element "INCLUDE">
+<![%refnamediv.element;[
+<!ELEMENT refnamediv %ho; (refdescriptor?, refname+, refpurpose, refclass*,
+		(remark|%link.char.class;)*)>
+<!--end of refnamediv.element-->]]>
+
+<!ENTITY % refnamediv.attlist "INCLUDE">
+<![%refnamediv.attlist;[
+<!ATTLIST refnamediv
+		%common.attrib;
+		%refnamediv.role.attrib;
+		%local.refnamediv.attrib;
+>
+<!--end of refnamediv.attlist-->]]>
+<!--end of refnamediv.module-->]]>
+
+<!ENTITY % refdescriptor.module "INCLUDE">
+<![%refdescriptor.module;[
+<!ENTITY % local.refdescriptor.attrib "">
+<!ENTITY % refdescriptor.role.attrib "%role.attrib;">
+
+<!ENTITY % refdescriptor.element "INCLUDE">
+<![%refdescriptor.element;[
+<!ELEMENT refdescriptor %ho; (%refname.char.mix;)*>
+<!--end of refdescriptor.element-->]]>
+
+<!ENTITY % refdescriptor.attlist "INCLUDE">
+<![%refdescriptor.attlist;[
+<!ATTLIST refdescriptor
+		%common.attrib;
+		%refdescriptor.role.attrib;
+		%local.refdescriptor.attrib;
+>
+<!--end of refdescriptor.attlist-->]]>
+<!--end of refdescriptor.module-->]]>
+
+<!ENTITY % refname.module "INCLUDE">
+<![%refname.module;[
+<!ENTITY % local.refname.attrib "">
+<!ENTITY % refname.role.attrib "%role.attrib;">
+
+<!ENTITY % refname.element "INCLUDE">
+<![%refname.element;[
+<!ELEMENT refname %ho; (%refname.char.mix;)*>
+<!--end of refname.element-->]]>
+
+<!ENTITY % refname.attlist "INCLUDE">
+<![%refname.attlist;[
+<!ATTLIST refname
+		%common.attrib;
+		%refname.role.attrib;
+		%local.refname.attrib;
+>
+<!--end of refname.attlist-->]]>
+<!--end of refname.module-->]]>
+
+<!ENTITY % refpurpose.module "INCLUDE">
+<![%refpurpose.module;[
+<!ENTITY % local.refpurpose.attrib "">
+<!ENTITY % refpurpose.role.attrib "%role.attrib;">
+
+<!ENTITY % refpurpose.element "INCLUDE">
+<![%refpurpose.element;[
+<!ELEMENT refpurpose %ho; (%refinline.char.mix;)*>
+<!--end of refpurpose.element-->]]>
+
+<!ENTITY % refpurpose.attlist "INCLUDE">
+<![%refpurpose.attlist;[
+<!ATTLIST refpurpose
+		%common.attrib;
+		%refpurpose.role.attrib;
+		%local.refpurpose.attrib;
+>
+<!--end of refpurpose.attlist-->]]>
+<!--end of refpurpose.module-->]]>
+
+<!ENTITY % refclass.module "INCLUDE">
+<![%refclass.module;[
+<!ENTITY % local.refclass.attrib "">
+<!ENTITY % refclass.role.attrib "%role.attrib;">
+
+<!ENTITY % refclass.element "INCLUDE">
+<![%refclass.element;[
+<!ELEMENT refclass %ho; (%refclass.char.mix;)*>
+<!--end of refclass.element-->]]>
+
+<!ENTITY % refclass.attlist "INCLUDE">
+<![%refclass.attlist;[
+<!ATTLIST refclass
+		%common.attrib;
+		%refclass.role.attrib;
+		%local.refclass.attrib;
+>
+<!--end of refclass.attlist-->]]>
+<!--end of refclass.module-->]]>
+
+<!ENTITY % refsynopsisdiv.module "INCLUDE">
+<![%refsynopsisdiv.module;[
+<!ENTITY % local.refsynopsisdiv.attrib "">
+<!ENTITY % refsynopsisdiv.role.attrib "%role.attrib;">
+
+<!ENTITY % refsynopsisdiv.element "INCLUDE">
+<![%refsynopsisdiv.element;[
+<!ELEMENT refsynopsisdiv %ho; (refsynopsisdivinfo?, (%refsect.title.content;)?,
+		(((%refcomponent.mix;)+, refsect2*) | (refsect2+)))>
+<!--end of refsynopsisdiv.element-->]]>
+
+<!ENTITY % refsynopsisdiv.attlist "INCLUDE">
+<![%refsynopsisdiv.attlist;[
+<!ATTLIST refsynopsisdiv
+		%common.attrib;
+		%refsynopsisdiv.role.attrib;
+		%local.refsynopsisdiv.attrib;
+>
+<!--end of refsynopsisdiv.attlist-->]]>
+<!--end of refsynopsisdiv.module-->]]>
+
+<!ENTITY % refsection.module "INCLUDE">
+<![%refsection.module;[
+<!ENTITY % local.refsection.attrib "">
+<!ENTITY % refsection.role.attrib "%role.attrib;">
+
+<!ENTITY % refsection.element "INCLUDE">
+<![%refsection.element;[
+<!ELEMENT refsection %ho; (refsectioninfo?, (%refsect.title.content;),
+		(((%refcomponent.mix;)+, refsection*) | refsection+))>
+<!--end of refsection.element-->]]>
+
+<!ENTITY % refsection.attlist "INCLUDE">
+<![%refsection.attlist;[
+<!ATTLIST refsection
+		%status.attrib;
+		%common.attrib;
+		%refsection.role.attrib;
+		%local.refsection.attrib;
+>
+<!--end of refsection.attlist-->]]>
+<!--end of refsection.module-->]]>
+
+<!ENTITY % refsect1.module "INCLUDE">
+<![%refsect1.module;[
+<!ENTITY % local.refsect1.attrib "">
+<!ENTITY % refsect1.role.attrib "%role.attrib;">
+
+<!ENTITY % refsect1.element "INCLUDE">
+<![%refsect1.element;[
+<!ELEMENT refsect1 %ho; (refsect1info?, (%refsect.title.content;),
+		(((%refcomponent.mix;)+, refsect2*) | refsect2+))>
+<!--end of refsect1.element-->]]>
+
+<!ENTITY % refsect1.attlist "INCLUDE">
+<![%refsect1.attlist;[
+<!ATTLIST refsect1
+		%status.attrib;
+		%common.attrib;
+		%refsect1.role.attrib;
+		%local.refsect1.attrib;
+>
+<!--end of refsect1.attlist-->]]>
+<!--end of refsect1.module-->]]>
+
+<!ENTITY % refsect2.module "INCLUDE">
+<![%refsect2.module;[
+<!ENTITY % local.refsect2.attrib "">
+<!ENTITY % refsect2.role.attrib "%role.attrib;">
+
+<!ENTITY % refsect2.element "INCLUDE">
+<![%refsect2.element;[
+<!ELEMENT refsect2 %ho; (refsect2info?, (%refsect.title.content;),
+	(((%refcomponent.mix;)+, refsect3*) | refsect3+))>
+<!--end of refsect2.element-->]]>
+
+<!ENTITY % refsect2.attlist "INCLUDE">
+<![%refsect2.attlist;[
+<!ATTLIST refsect2
+		%status.attrib;
+		%common.attrib;
+		%refsect2.role.attrib;
+		%local.refsect2.attrib;
+>
+<!--end of refsect2.attlist-->]]>
+<!--end of refsect2.module-->]]>
+
+<!ENTITY % refsect3.module "INCLUDE">
+<![%refsect3.module;[
+<!ENTITY % local.refsect3.attrib "">
+<!ENTITY % refsect3.role.attrib "%role.attrib;">
+
+<!ENTITY % refsect3.element "INCLUDE">
+<![%refsect3.element;[
+<!ELEMENT refsect3 %ho; (refsect3info?, (%refsect.title.content;),
+	(%refcomponent.mix;)+)>
+<!--end of refsect3.element-->]]>
+
+<!ENTITY % refsect3.attlist "INCLUDE">
+<![%refsect3.attlist;[
+<!ATTLIST refsect3
+		%status.attrib;
+		%common.attrib;
+		%refsect3.role.attrib;
+		%local.refsect3.attrib;
+>
+<!--end of refsect3.attlist-->]]>
+<!--end of refsect3.module-->]]>
+<!--end of refentry.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Article .............................................................. -->
+
+<!ENTITY % article.module "INCLUDE">
+<![%article.module;[
+<!-- An Article is a chapter-level, stand-alone document that is often,
+     but need not be, collected into a Book. -->
+
+<!ENTITY % local.article.attrib "">
+<!ENTITY % article.role.attrib "%role.attrib;">
+
+<!ENTITY % article.element "INCLUDE">
+<![%article.element;[
+<!ELEMENT article %ho; ((%div.title.content;)?, articleinfo?, tocchap?, lot*,
+			(%bookcomponent.content;),
+			((%nav.class;) | (%appendix.class;) | ackno)*)
+		%ubiq.inclusion;>
+<!--end of article.element-->]]>
+
+<!-- Class: Indicates the type of a particular article;
+		all articles have the same structure and general purpose.
+		No default. -->
+<!-- ParentBook: ID of the enclosing Book -->
+
+
+<!ENTITY % article.attlist "INCLUDE">
+<![%article.attlist;[
+<!ATTLIST article
+		class		(journalarticle
+				|productsheet
+				|whitepaper
+				|techreport
+                                |specification
+				|faq)		#IMPLIED
+		parentbook	IDREF		#IMPLIED
+		%status.attrib;
+		%common.attrib;
+		%article.role.attrib;
+		%local.article.attrib;
+>
+<!--end of article.attlist-->]]>
+<!--end of article.module-->]]>
+
+<!-- End of DocBook document hierarchy module V4.4 ........................ -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting/dbnotnx.mod b/xml/tests/testData/xml/DocBookHighlighting/dbnotnx.mod
new file mode 100644
index 0000000..f771fac
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting/dbnotnx.mod
@@ -0,0 +1,101 @@
+<!-- ...................................................................... -->
+<!-- DocBook notations module V4.4 ........................................ -->
+<!-- File dbnotnx.mod ..................................................... -->
+
+<!-- Copyright 1992-2004 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     $Id: dbnotnx.mod,v 1.31 2005/01/27 13:52:00 nwalsh Exp $
+
+     Permission to use, copy, modify and distribute the DocBook DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This module contains the notation declarations used by DocBook.
+
+     In DTD driver files referring to this module, please use an entity
+     declaration that uses the public identifier shown below:
+
+     <!ENTITY % dbnotn PUBLIC
+     "-//OASIS//ENTITIES DocBook Notations V4.4//EN"
+     "dbnotnx.mod">
+     %dbnotn;
+
+     See the documentation for detailed information on the parameter
+     entity and module scheme used in DocBook, customizing DocBook and
+     planning for interchange, and changes made since the last release
+     of DocBook.
+-->
+
+<!ENTITY % local.notation.class "">
+<!ENTITY % notation.class
+		"BMP| CGM-CHAR | CGM-BINARY | CGM-CLEAR | DITROFF | DVI
+		| EPS | EQN | FAX | GIF | GIF87a | GIF89a
+		| JPG | JPEG | IGES | PCX
+		| PIC | PNG | PS | SGML | TBL | TEX | TIFF | WMF | WPG
+                | SVG | PDF | SWF
+		| linespecific
+		%local.notation.class;">
+
+<!NOTATION BMP		PUBLIC
+"+//ISBN 0-7923-94.2-1::Graphic Notation//NOTATION Microsoft Windows bitmap//EN">
+<!NOTATION CGM-CHAR	PUBLIC "ISO 8632/2//NOTATION Character encoding//EN">
+<!NOTATION CGM-BINARY	PUBLIC "ISO 8632/3//NOTATION Binary encoding//EN">
+<!NOTATION CGM-CLEAR	PUBLIC "ISO 8632/4//NOTATION Clear text encoding//EN">
+<!NOTATION DITROFF	SYSTEM "DITROFF">
+<!NOTATION DVI		SYSTEM "DVI">
+<!NOTATION EPS		PUBLIC
+"+//ISBN 0-201-18127-4::Adobe//NOTATION PostScript Language Ref. Manual//EN">
+<!NOTATION EQN		SYSTEM "EQN">
+<!NOTATION FAX		PUBLIC
+"-//USA-DOD//NOTATION CCITT Group 4 Facsimile Type 1 Untiled Raster//EN">
+<!NOTATION GIF		SYSTEM "GIF">
+<!NOTATION GIF87a               PUBLIC
+"-//CompuServe//NOTATION Graphics Interchange Format 87a//EN">
+
+<!NOTATION GIF89a               PUBLIC
+"-//CompuServe//NOTATION Graphics Interchange Format 89a//EN">
+<!NOTATION JPG		SYSTEM "JPG">
+<!NOTATION JPEG		SYSTEM "JPG">
+<!NOTATION IGES		PUBLIC
+"-//USA-DOD//NOTATION (ASME/ANSI Y14.26M-1987) Initial Graphics Exchange Specification//EN">
+<!NOTATION PCX		PUBLIC
+"+//ISBN 0-7923-94.2-1::Graphic Notation//NOTATION ZSoft PCX bitmap//EN">
+<!NOTATION PIC		SYSTEM "PIC">
+<!NOTATION PNG          SYSTEM "http://www.w3.org/TR/REC-png">
+<!NOTATION PS		SYSTEM "PS">
+<!NOTATION SGML		PUBLIC
+"ISO 8879:1986//NOTATION Standard Generalized Markup Language//EN">
+<!NOTATION TBL		SYSTEM "TBL">
+<!NOTATION TEX		PUBLIC
+"+//ISBN 0-201-13448-9::Knuth//NOTATION The TeXbook//EN">
+<!NOTATION TIFF		SYSTEM "TIFF">
+<!NOTATION WMF		PUBLIC
+"+//ISBN 0-7923-94.2-1::Graphic Notation//NOTATION Microsoft Windows Metafile//EN">
+<!NOTATION WPG		SYSTEM "WPG"> <!--WordPerfect Graphic format-->
+<!NOTATION SVG		SYSTEM "http://www.w3.org/TR/SVG/">
+<!NOTATION PDF		SYSTEM "http://www.adobe.com/products/acrobat/adobepdf.html">
+<!NOTATION SWF          SYSTEM "http://www.macromedia.com/software/flash">
+<!NOTATION linespecific	SYSTEM "linespecific">
+
+<!-- End of DocBook notations module V4.4 ................................. -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting/dbpoolx.mod b/xml/tests/testData/xml/DocBookHighlighting/dbpoolx.mod
new file mode 100644
index 0000000..d76d3dd
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting/dbpoolx.mod
@@ -0,0 +1,8355 @@
+<!-- ...................................................................... -->
+<!-- DocBook XML information pool module V4.4 ............................. -->
+<!-- File dbpoolx.mod ..................................................... -->
+
+<!-- Copyright 1992-2004 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     $Id: dbpoolx.mod,v 1.107 2005/01/27 13:52:00 nwalsh Exp $
+
+     Permission to use, copy, modify and distribute the DocBook XML DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook XML DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This module contains the definitions for the objects, inline
+     elements, and so on that are available to be used as the main
+     content of DocBook documents.  Some elements are useful for general
+     publishing, and others are useful specifically for computer
+     documentation.
+
+     This module has the following dependencies on other modules:
+
+     o It assumes that a %notation.class; entity is defined by the
+       driver file or other high-level module.  This entity is
+       referenced in the NOTATION attributes for the graphic-related and
+       ModeSpec elements.
+
+     o It assumes that an appropriately parameterized table module is
+       available for use with the table-related elements.
+
+     In DTD driver files referring to this module, please use an entity
+     declaration that uses the public identifier shown below:
+
+     <!ENTITY % dbpool PUBLIC
+     "-//OASIS//ELEMENTS DocBook XML Information Pool V4.4//EN"
+     "dbpoolx.mod">
+     %dbpool;
+
+     See the documentation for detailed information on the parameter
+     entity and module scheme used in DocBook, customizing DocBook and
+     planning for interchange, and changes made since the last release
+     of DocBook.
+-->
+
+<!-- ...................................................................... -->
+<!-- Forms entities ....................................................... -->
+<!-- These PEs provide the hook by which the forms module can be inserted   -->
+<!-- into the DTD. -->
+<!ENTITY % forminlines.hook "">
+<!ENTITY % forms.hook "">
+
+<!-- ...................................................................... -->
+<!-- General-purpose semantics entities ................................... -->
+
+<!ENTITY % yesorno.attvals	"CDATA">
+
+<!-- ...................................................................... -->
+<!-- Entities for module inclusions ....................................... -->
+
+<!ENTITY % dbpool.redecl.module "IGNORE">
+
+<!-- ...................................................................... -->
+<!-- Entities for element classes and mixtures ............................ -->
+
+<!-- "Ubiquitous" classes: ndxterm.class and beginpage -->
+
+<!ENTITY % local.ndxterm.class "">
+<!ENTITY % ndxterm.class
+		"indexterm %local.ndxterm.class;">
+
+<!-- Object-level classes ................................................. -->
+
+<!ENTITY % local.list.class "">
+<!ENTITY % list.class
+		"calloutlist|glosslist|bibliolist|itemizedlist|orderedlist|segmentedlist
+		|simplelist|variablelist %local.list.class;">
+
+<!ENTITY % local.admon.class "">
+<!ENTITY % admon.class
+		"caution|important|note|tip|warning %local.admon.class;">
+
+<!ENTITY % local.linespecific.class "">
+<!ENTITY % linespecific.class
+		"literallayout|programlisting|programlistingco|screen
+		|screenco|screenshot %local.linespecific.class;">
+
+<!ENTITY % local.method.synop.class "">
+<!ENTITY % method.synop.class
+		"constructorsynopsis
+                 |destructorsynopsis
+                 |methodsynopsis %local.method.synop.class;">
+
+<!ENTITY % local.synop.class "">
+<!ENTITY % synop.class
+		"synopsis|cmdsynopsis|funcsynopsis
+                 |classsynopsis|fieldsynopsis
+                 |%method.synop.class; %local.synop.class;">
+
+<!ENTITY % local.para.class "">
+<!ENTITY % para.class
+		"formalpara|para|simpara %local.para.class;">
+
+<!ENTITY % local.informal.class "">
+<!ENTITY % informal.class
+		"address|blockquote
+                |graphic|graphicco|mediaobject|mediaobjectco
+                |informalequation
+		|informalexample
+                |informalfigure
+                |informaltable %local.informal.class;">
+
+<!ENTITY % local.formal.class "">
+<!ENTITY % formal.class
+		"equation|example|figure|table %local.formal.class;">
+
+<!-- The DocBook TC may produce an official EBNF module for DocBook. -->
+<!-- This PE provides the hook by which it can be inserted into the DTD. -->
+<!ENTITY % ebnf.block.hook "">
+
+<!ENTITY % local.compound.class "">
+<!ENTITY % compound.class
+		"msgset|procedure|sidebar|qandaset|task
+                 %ebnf.block.hook;
+                 %local.compound.class;">
+
+<!ENTITY % local.genobj.class "">
+<!ENTITY % genobj.class
+		"anchor|bridgehead|remark|highlights
+		%local.genobj.class;">
+
+<!ENTITY % local.descobj.class "">
+<!ENTITY % descobj.class
+		"abstract|authorblurb|epigraph
+		%local.descobj.class;">
+
+<!-- Character-level classes .............................................. -->
+
+<!ENTITY % local.xref.char.class "">
+<!ENTITY % xref.char.class
+		"footnoteref|xref|biblioref %local.xref.char.class;">
+
+<!ENTITY % local.gen.char.class "">
+<!ENTITY % gen.char.class
+		"abbrev|acronym|citation|citerefentry|citetitle|emphasis
+		|firstterm|foreignphrase|glossterm|footnote|phrase|orgname
+		|quote|trademark|wordasword|personname %local.gen.char.class;">
+
+<!ENTITY % local.link.char.class "">
+<!ENTITY % link.char.class
+		"link|olink|ulink %local.link.char.class;">
+
+<!-- The DocBook TC may produce an official EBNF module for DocBook. -->
+<!-- This PE provides the hook by which it can be inserted into the DTD. -->
+<!ENTITY % ebnf.inline.hook "">
+
+<!ENTITY % local.tech.char.class "">
+<!ENTITY % tech.char.class
+		"action|application
+                |classname|methodname|interfacename|exceptionname
+                |ooclass|oointerface|ooexception
+                |package
+                |command|computeroutput
+		|database|email|envar|errorcode|errorname|errortype|errortext|filename
+		|function|guibutton|guiicon|guilabel|guimenu|guimenuitem
+		|guisubmenu|hardware|interface|keycap
+		|keycode|keycombo|keysym|literal|code|constant|markup|medialabel
+		|menuchoice|mousebutton|option|optional|parameter
+		|prompt|property|replaceable|returnvalue|sgmltag|structfield
+		|structname|symbol|systemitem|uri|token|type|userinput|varname
+                %ebnf.inline.hook;
+		%local.tech.char.class;">
+
+<!ENTITY % local.base.char.class "">
+<!ENTITY % base.char.class
+		"anchor %local.base.char.class;">
+
+<!ENTITY % local.docinfo.char.class "">
+<!ENTITY % docinfo.char.class
+		"author|authorinitials|corpauthor|corpcredit|modespec|othercredit
+		|productname|productnumber|revhistory
+		%local.docinfo.char.class;">
+
+<!ENTITY % local.other.char.class "">
+<!ENTITY % other.char.class
+		"remark|subscript|superscript %local.other.char.class;">
+
+<!ENTITY % local.inlineobj.char.class "">
+<!ENTITY % inlineobj.char.class
+		"inlinegraphic|inlinemediaobject|inlineequation %local.inlineobj.char.class;">
+
+<!-- ...................................................................... -->
+<!-- Entities for content models .......................................... -->
+
+<!ENTITY % formalobject.title.content "title, titleabbrev?">
+
+<!-- Redeclaration placeholder ............................................ -->
+
+<!-- For redeclaring entities that are declared after this point while
+     retaining their references to the entities that are declared before
+     this point -->
+
+<![%dbpool.redecl.module;[
+<!-- Defining rdbpool here makes some buggy XML parsers happy. -->
+<!ENTITY % rdbpool "">
+%rdbpool;
+<!--end of dbpool.redecl.module-->]]>
+
+<!-- Object-level mixtures ................................................ -->
+
+<!--
+                      list admn line synp para infm form cmpd gen  desc
+Component mixture       X    X    X    X    X    X    X    X    X    X
+Sidebar mixture         X    X    X    X    X    X    X    a    X
+Footnote mixture        X         X    X    X    X
+Example mixture         X         X    X    X    X
+Highlights mixture      X    X              X
+Paragraph mixture       X         X    X         X
+Admonition mixture      X         X    X    X    X    X    b    c
+Figure mixture                    X    X         X
+Table entry mixture     X    X    X         X    d
+Glossary def mixture    X         X    X    X    X         e
+Legal notice mixture    X    X    X         X    f
+
+a. Just Procedure; not Sidebar itself or MsgSet.
+b. No MsgSet.
+c. No Highlights.
+d. Just Graphic; no other informal objects.
+e. No Anchor, BridgeHead, or Highlights.
+f. Just BlockQuote; no other informal objects.
+-->
+
+<!ENTITY % local.component.mix "">
+<!ENTITY % component.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|%compound.class;
+		|%genobj.class;		|%descobj.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.component.mix;">
+
+<!ENTITY % local.sidebar.mix "">
+<!ENTITY % sidebar.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|procedure
+		|%genobj.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.sidebar.mix;">
+
+<!ENTITY % local.qandaset.mix "">
+<!ENTITY % qandaset.mix
+		"%list.class;           |%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|procedure
+		|%genobj.class;
+		|%ndxterm.class;
+		%forms.hook;
+                %local.qandaset.mix;">
+
+<!ENTITY % local.revdescription.mix "">
+<!ENTITY % revdescription.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|procedure
+		|%genobj.class;
+		|%ndxterm.class;
+		%local.revdescription.mix;">
+
+<!ENTITY % local.footnote.mix "">
+<!ENTITY % footnote.mix
+		"%list.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		%local.footnote.mix;">
+
+<!ENTITY % local.example.mix "">
+<!ENTITY % example.mix
+		"%list.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.example.mix;">
+
+<!ENTITY % local.highlights.mix "">
+<!ENTITY % highlights.mix
+		"%list.class;		|%admon.class;
+		|%para.class;
+		|%ndxterm.class;
+		%local.highlights.mix;">
+
+<!-- %formal.class; is explicitly excluded from many contexts in which
+     paragraphs are used -->
+<!ENTITY % local.para.mix "">
+<!ENTITY % para.mix
+		"%list.class;           |%admon.class;
+		|%linespecific.class;
+					|%informal.class;
+		|%formal.class;
+		%local.para.mix;">
+
+<!ENTITY % local.admon.mix "">
+<!ENTITY % admon.mix
+		"%list.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|procedure|sidebar
+		|anchor|bridgehead|remark
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.admon.mix;">
+
+<!ENTITY % local.figure.mix "">
+<!ENTITY % figure.mix
+		"%linespecific.class;	|%synop.class;
+					|%informal.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.figure.mix;">
+
+<!ENTITY % local.tabentry.mix "">
+<!ENTITY % tabentry.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;
+		|%para.class;		|graphic|mediaobject
+		%forms.hook;
+		%local.tabentry.mix;">
+
+<!ENTITY % local.glossdef.mix "">
+<!ENTITY % glossdef.mix
+		"%list.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;
+		|remark
+		|%ndxterm.class;        |beginpage
+		%local.glossdef.mix;">
+
+<!ENTITY % local.legalnotice.mix "">
+<!ENTITY % legalnotice.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;
+		|%para.class;		|blockquote
+		|%ndxterm.class;        |beginpage
+		%local.legalnotice.mix;">
+
+<!ENTITY % local.textobject.mix "">
+<!ENTITY % textobject.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;
+		|%para.class;		|blockquote
+		%local.textobject.mix;">
+
+<!ENTITY % local.mediaobject.mix "">
+<!ENTITY % mediaobject.mix
+		"videoobject|audioobject|imageobject|imageobjectco|textobject %local.mediaobject.mix;">
+
+<!ENTITY % local.listpreamble.mix "">
+<!ENTITY % listpreamble.mix
+		"                  	 %admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%genobj.class;		|%descobj.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.listpreamble.mix;">
+
+<!-- Character-level mixtures ............................................. -->
+
+<![%sgml.features;[
+<!ENTITY % local.ubiq.mix "">
+<!ENTITY % ubiq.mix "%ndxterm.class;|beginpage %local.ubiq.mix;">
+
+<!ENTITY % ubiq.exclusion "-(%ubiq.mix)">
+<!ENTITY % ubiq.inclusion "+(%ubiq.mix)">
+
+<!ENTITY % footnote.exclusion "-(footnote|%formal.class;)">
+<!ENTITY % highlights.exclusion "-(%ubiq.mix;|%formal.class;)">
+<!ENTITY % admon.exclusion "-(%admon.class;)">
+<!ENTITY % formal.exclusion "-(%formal.class;)">
+<!ENTITY % acronym.exclusion "-(acronym)">
+<!ENTITY % beginpage.exclusion "-(beginpage)">
+<!ENTITY % ndxterm.exclusion "-(%ndxterm.class;)">
+<!ENTITY % blockquote.exclusion "-(epigraph)">
+<!ENTITY % remark.exclusion "-(remark|%ubiq.mix;)">
+<!ENTITY % glossterm.exclusion "-(glossterm)">
+<!ENTITY % links.exclusion "-(link|olink|ulink|xref|biblioref)">
+]]><!-- sgml.features -->
+
+<!-- not [sgml.features[ -->
+<!ENTITY % local.ubiq.mix "">
+<!ENTITY % ubiq.mix "">
+
+<!ENTITY % ubiq.exclusion "">
+<!ENTITY % ubiq.inclusion "">
+
+<!ENTITY % footnote.exclusion "">
+<!ENTITY % highlights.exclusion "">
+<!ENTITY % admon.exclusion "">
+<!ENTITY % formal.exclusion "">
+<!ENTITY % acronym.exclusion "">
+<!ENTITY % beginpage.exclusion "">
+<!ENTITY % ndxterm.exclusion "">
+<!ENTITY % blockquote.exclusion "">
+<!ENTITY % remark.exclusion "">
+<!ENTITY % glossterm.exclusion "">
+<!ENTITY % links.exclusion "">
+<!-- ]] not sgml.features -->
+
+<!--
+                    #PCD xref word link cptr base dnfo othr inob (synop)
+para.char.mix         X    X    X    X    X    X    X    X    X
+title.char.mix        X    X    X    X    X    X    X    X    X
+ndxterm.char.mix      X    X    X    X    X    X    X    X    a
+cptr.char.mix         X              X    X    X         X    a
+smallcptr.char.mix    X                   b                   a
+word.char.mix         X         c    X         X         X    a
+docinfo.char.mix      X         d    X    b              X    a
+
+a. Just InlineGraphic; no InlineEquation.
+b. Just Replaceable; no other computer terms.
+c. Just Emphasis and Trademark; no other word elements.
+d. Just Acronym, Emphasis, and Trademark; no other word elements.
+-->
+
+<!ENTITY % local.para.char.mix "">
+<!ENTITY % para.char.mix
+		"#PCDATA
+		|%xref.char.class;	|%gen.char.class;
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;	|%docinfo.char.class;
+		|%other.char.class;	|%inlineobj.char.class;
+		|%synop.class;
+		|%ndxterm.class;        |beginpage
+                %forminlines.hook;
+		%local.para.char.mix;">
+
+<!ENTITY % local.title.char.mix "">
+<!ENTITY % title.char.mix
+		"#PCDATA
+		|%xref.char.class;	|%gen.char.class;
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;	|%docinfo.char.class;
+		|%other.char.class;	|%inlineobj.char.class;
+		|%ndxterm.class;
+		%local.title.char.mix;">
+
+<!ENTITY % local.ndxterm.char.mix "">
+<!ENTITY % ndxterm.char.mix
+		"#PCDATA
+		|%xref.char.class;	|%gen.char.class;
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;	|%docinfo.char.class;
+		|%other.char.class;	|inlinegraphic|inlinemediaobject
+		%local.ndxterm.char.mix;">
+
+<!ENTITY % local.cptr.char.mix "">
+<!ENTITY % cptr.char.mix
+		"#PCDATA
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;
+		|%other.char.class;	|inlinegraphic|inlinemediaobject
+		|%ndxterm.class;        |beginpage
+		%local.cptr.char.mix;">
+
+<!ENTITY % local.smallcptr.char.mix "">
+<!ENTITY % smallcptr.char.mix
+		"#PCDATA
+					|replaceable
+					|inlinegraphic|inlinemediaobject
+		|%ndxterm.class;        |beginpage
+		%local.smallcptr.char.mix;">
+
+<!ENTITY % local.word.char.mix "">
+<!ENTITY % word.char.mix
+		"#PCDATA
+					|acronym|emphasis|trademark
+		|%link.char.class;
+		|%base.char.class;
+		|%other.char.class;	|inlinegraphic|inlinemediaobject
+		|%ndxterm.class;        |beginpage
+		%local.word.char.mix;">
+
+<!ENTITY % local.docinfo.char.mix "">
+<!ENTITY % docinfo.char.mix
+		"#PCDATA
+		|%link.char.class;
+					|emphasis|trademark
+					|replaceable
+		|%other.char.class;	|inlinegraphic|inlinemediaobject
+		|%ndxterm.class;
+		%local.docinfo.char.mix;">
+<!--ENTITY % bibliocomponent.mix (see Bibliographic section, below)-->
+<!--ENTITY % person.ident.mix (see Bibliographic section, below)-->
+
+<!-- ...................................................................... -->
+<!-- Entities for attributes and attribute components ..................... -->
+
+<!-- Effectivity attributes ............................................... -->
+
+
+<!-- Arch: Computer or chip architecture to which element applies; no
+	default -->
+
+<!ENTITY % arch.attrib
+	"arch		CDATA		#IMPLIED">
+
+<!-- Condition: General-purpose effectivity attribute -->
+
+<!ENTITY % condition.attrib
+	"condition	CDATA		#IMPLIED">
+
+<!-- Conformance: Standards conformance characteristics -->
+
+<!ENTITY % conformance.attrib
+	"conformance	NMTOKENS	#IMPLIED">
+
+
+<!-- OS: Operating system to which element applies; no default -->
+
+<!ENTITY % os.attrib
+	"os		CDATA		#IMPLIED">
+
+
+<!-- Revision: Editorial revision to which element belongs; no default -->
+
+<!ENTITY % revision.attrib
+	"revision	CDATA		#IMPLIED">
+
+<!-- Security: Security classification; no default -->
+
+<!ENTITY % security.attrib
+	"security	CDATA		#IMPLIED">
+
+<!-- UserLevel: Level of user experience to which element applies; no
+	default -->
+
+<!ENTITY % userlevel.attrib
+	"userlevel	CDATA		#IMPLIED">
+
+<!-- Vendor: Computer vendor to which element applies; no default -->
+
+<!ENTITY % vendor.attrib
+	"vendor		CDATA		#IMPLIED">
+
+<!-- Wordsize: Computer word size (32 bit, 64 bit, etc.); no default -->
+
+<!ENTITY % wordsize.attrib
+	"wordsize	CDATA		#IMPLIED">
+
+<!ENTITY % local.effectivity.attrib "">
+<!ENTITY % effectivity.attrib
+	"%arch.attrib;
+        %condition.attrib;
+	%conformance.attrib;
+	%os.attrib;
+	%revision.attrib;
+        %security.attrib;
+	%userlevel.attrib;
+	%vendor.attrib;
+	%wordsize.attrib;
+	%local.effectivity.attrib;"
+>
+
+<!-- Common attributes .................................................... -->
+
+
+<!-- Id: Unique identifier of element; no default -->
+
+<!ENTITY % id.attrib
+	"id		ID		#IMPLIED">
+
+
+<!-- Id: Unique identifier of element; a value must be supplied; no
+	default -->
+
+<!ENTITY % idreq.attrib
+	"id		ID		#REQUIRED">
+
+
+<!-- Lang: Indicator of language in which element is written, for
+	translation, character set management, etc.; no default -->
+
+<!ENTITY % lang.attrib
+	"lang		CDATA		#IMPLIED">
+
+
+<!-- Remap: Previous role of element before conversion; no default -->
+
+<!ENTITY % remap.attrib
+	"remap		CDATA		#IMPLIED">
+
+
+<!-- Role: New role of element in local environment; no default -->
+
+<!ENTITY % role.attrib
+	"role		CDATA		#IMPLIED">
+
+
+<!-- XRefLabel: Alternate labeling string for XRef text generation;
+	default is usually title or other appropriate label text already
+	contained in element -->
+
+<!ENTITY % xreflabel.attrib
+	"xreflabel	CDATA		#IMPLIED">
+
+
+<!-- RevisionFlag: Revision status of element; default is that element
+	wasn't revised -->
+
+<!ENTITY % revisionflag.attrib
+	"revisionflag	(changed
+			|added
+			|deleted
+			|off)		#IMPLIED">
+
+<!ENTITY % local.common.attrib "">
+
+<!-- dir: Bidirectional override -->
+
+<!ENTITY % dir.attrib
+	"dir		(ltr
+			|rtl
+			|lro
+			|rlo)		#IMPLIED">
+
+<!-- xml:base: base URI -->
+
+<![%sgml.features;[
+<!ENTITY % xml-base.attrib "">
+]]>
+<!ENTITY % xml-base.attrib
+	"xml:base	CDATA		#IMPLIED">
+
+<!-- Role is included explicitly on each element -->
+
+<!ENTITY % common.attrib
+	"%id.attrib;
+	%lang.attrib;
+	%remap.attrib;
+	%xreflabel.attrib;
+	%revisionflag.attrib;
+	%effectivity.attrib;
+	%dir.attrib;
+	%xml-base.attrib;
+	%local.common.attrib;"
+>
+
+<!-- Role is included explicitly on each element -->
+
+<!ENTITY % idreq.common.attrib
+	"%idreq.attrib;
+	%lang.attrib;
+	%remap.attrib;
+	%xreflabel.attrib;
+	%revisionflag.attrib;
+	%effectivity.attrib;
+	%dir.attrib;
+	%xml-base.attrib;
+	%local.common.attrib;"
+>
+
+<!-- Semi-common attributes and other attribute entities .................. -->
+
+<!ENTITY % local.graphics.attrib "">
+
+<!-- EntityRef: Name of an external entity containing the content
+	of the graphic -->
+<!-- FileRef: Filename, qualified by a pathname if desired,
+	designating the file containing the content of the graphic -->
+<!-- Format: Notation of the element content, if any -->
+<!-- SrcCredit: Information about the source of the Graphic -->
+<!-- Width: Same as CALS reprowid (desired width) -->
+<!-- Depth: Same as CALS reprodep (desired depth) -->
+<!-- Align: Same as CALS hplace with 'none' removed; #IMPLIED means
+	application-specific -->
+<!-- Scale: Conflation of CALS hscale and vscale -->
+<!-- Scalefit: Same as CALS scalefit -->
+
+<!ENTITY % graphics.attrib
+	"
+	entityref	ENTITY		#IMPLIED
+	fileref 	CDATA		#IMPLIED
+	format		(%notation.class;) #IMPLIED
+	srccredit	CDATA		#IMPLIED
+	width		CDATA		#IMPLIED
+	contentwidth	CDATA		#IMPLIED
+	depth		CDATA		#IMPLIED
+	contentdepth	CDATA		#IMPLIED
+	align		(left
+			|right
+			|center)	#IMPLIED
+	valign		(top
+			|middle
+			|bottom)	#IMPLIED
+	scale		CDATA		#IMPLIED
+	scalefit	%yesorno.attvals;
+					#IMPLIED
+	%local.graphics.attrib;"
+>
+
+<!ENTITY % local.keyaction.attrib "">
+
+<!-- Action: Key combination type; default is unspecified if one
+	child element, Simul if there is more than one; if value is
+	Other, the OtherAction attribute must have a nonempty value -->
+<!-- OtherAction: User-defined key combination type -->
+
+<!ENTITY % keyaction.attrib
+	"
+	action		(click
+			|double-click
+			|press
+			|seq
+			|simul
+			|other)		#IMPLIED
+	otheraction	CDATA		#IMPLIED
+	%local.keyaction.attrib;"
+>
+
+
+<!-- Label: Identifying number or string; default is usually the
+	appropriate number or string autogenerated by a formatter -->
+
+<!ENTITY % label.attrib
+	"label		CDATA		#IMPLIED">
+
+
+<!-- xml:space: whitespace treatment -->
+
+<![%sgml.features;[
+<!ENTITY % xml-space.attrib "">
+]]>
+<!ENTITY % xml-space.attrib
+	"xml:space	(preserve)		#IMPLIED">
+
+<!-- Format: whether element is assumed to contain significant white
+	space -->
+
+<!ENTITY % linespecific.attrib
+	"format		NOTATION
+			(linespecific)	'linespecific'
+         %xml-space.attrib;
+         linenumbering	(numbered|unnumbered) 	#IMPLIED
+         continuation	(continues|restarts)	#IMPLIED
+         startinglinenumber	CDATA		#IMPLIED
+         language	CDATA			#IMPLIED">
+
+<!-- Linkend: link to related information; no default -->
+
+<!ENTITY % linkend.attrib
+	"linkend	IDREF		#IMPLIED">
+
+
+<!-- Linkend: required link to related information -->
+
+<!ENTITY % linkendreq.attrib
+	"linkend	IDREF		#REQUIRED">
+
+
+<!-- Linkends: link to one or more sets of related information; no
+	default -->
+
+<!ENTITY % linkends.attrib
+	"linkends	IDREFS		#IMPLIED">
+
+
+<!ENTITY % local.mark.attrib "">
+<!ENTITY % mark.attrib
+	"mark		CDATA		#IMPLIED
+	%local.mark.attrib;"
+>
+
+
+<!-- MoreInfo: whether element's content has an associated RefEntry -->
+
+<!ENTITY % moreinfo.attrib
+	"moreinfo	(refentry|none)	'none'">
+
+
+<!-- Pagenum: number of page on which element appears; no default -->
+
+<!ENTITY % pagenum.attrib
+	"pagenum	CDATA		#IMPLIED">
+
+<!ENTITY % local.status.attrib "">
+
+<!-- Status: Editorial or publication status of the element
+	it applies to, such as "in review" or "approved for distribution" -->
+
+<!ENTITY % status.attrib
+	"status		CDATA		#IMPLIED
+	%local.status.attrib;"
+>
+
+
+<!-- Width: width of the longest line in the element to which it
+	pertains, in number of characters -->
+
+<!ENTITY % width.attrib
+	"width		CDATA		#IMPLIED">
+
+<!-- ...................................................................... -->
+<!-- Title elements ....................................................... -->
+
+<!ENTITY % title.module "INCLUDE">
+<![%title.module;[
+<!ENTITY % local.title.attrib "">
+<!ENTITY % title.role.attrib "%role.attrib;">
+
+<!ENTITY % title.element "INCLUDE">
+<![%title.element;[
+<!ELEMENT title %ho; (%title.char.mix;)*>
+<!--end of title.element-->]]>
+
+<!ENTITY % title.attlist "INCLUDE">
+<![%title.attlist;[
+<!ATTLIST title
+		%pagenum.attrib;
+		%common.attrib;
+		%title.role.attrib;
+		%local.title.attrib;
+>
+<!--end of title.attlist-->]]>
+<!--end of title.module-->]]>
+
+<!ENTITY % titleabbrev.module "INCLUDE">
+<![%titleabbrev.module;[
+<!ENTITY % local.titleabbrev.attrib "">
+<!ENTITY % titleabbrev.role.attrib "%role.attrib;">
+
+<!ENTITY % titleabbrev.element "INCLUDE">
+<![%titleabbrev.element;[
+<!ELEMENT titleabbrev %ho; (%title.char.mix;)*>
+<!--end of titleabbrev.element-->]]>
+
+<!ENTITY % titleabbrev.attlist "INCLUDE">
+<![%titleabbrev.attlist;[
+<!ATTLIST titleabbrev
+		%common.attrib;
+		%titleabbrev.role.attrib;
+		%local.titleabbrev.attrib;
+>
+<!--end of titleabbrev.attlist-->]]>
+<!--end of titleabbrev.module-->]]>
+
+<!ENTITY % subtitle.module "INCLUDE">
+<![%subtitle.module;[
+<!ENTITY % local.subtitle.attrib "">
+<!ENTITY % subtitle.role.attrib "%role.attrib;">
+
+<!ENTITY % subtitle.element "INCLUDE">
+<![%subtitle.element;[
+<!ELEMENT subtitle %ho; (%title.char.mix;)*>
+<!--end of subtitle.element-->]]>
+
+<!ENTITY % subtitle.attlist "INCLUDE">
+<![%subtitle.attlist;[
+<!ATTLIST subtitle
+		%common.attrib;
+		%subtitle.role.attrib;
+		%local.subtitle.attrib;
+>
+<!--end of subtitle.attlist-->]]>
+<!--end of subtitle.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Bibliographic entities and elements .................................. -->
+
+<!-- The bibliographic elements are typically used in the document
+     hierarchy. They do not appear in content models of information
+     pool elements.  See also the document information elements,
+     below. -->
+
+<!ENTITY % local.person.ident.mix "">
+<!ENTITY % person.ident.mix
+		"honorific|firstname|surname|lineage|othername|affiliation
+		|authorblurb|contrib %local.person.ident.mix;">
+
+<!ENTITY % local.bibliocomponent.mix "">
+<!ENTITY % bibliocomponent.mix
+		"abbrev|abstract|address|artpagenums|author
+		|authorgroup|authorinitials|bibliomisc|biblioset
+		|collab|confgroup|contractnum|contractsponsor
+		|copyright|corpauthor|corpname|corpcredit|date|edition
+		|editor|invpartnumber|isbn|issn|issuenum|orgname
+		|biblioid|citebiblioid|bibliosource|bibliorelation|bibliocoverage
+		|othercredit|pagenums|printhistory|productname
+		|productnumber|pubdate|publisher|publishername
+		|pubsnumber|releaseinfo|revhistory|seriesvolnums
+		|subtitle|title|titleabbrev|volumenum|citetitle
+		|personname|%person.ident.mix;
+		|%ndxterm.class;
+		%local.bibliocomponent.mix;">
+
+<!-- I don't think this is well placed, but it needs to be here because of -->
+<!-- the reference to bibliocomponent.mix -->
+<!ENTITY % local.info.class "">
+<!ENTITY % info.class
+		"graphic | mediaobject | legalnotice | modespec
+		 | subjectset | keywordset | itermset | %bibliocomponent.mix;
+                 %local.info.class;">
+
+
+<!-- BiblioList ........................ -->
+
+<!ENTITY % bibliolist.module "INCLUDE">
+<![%bibliolist.module;[
+<!ENTITY % local.bibliolist.attrib "">
+<!ENTITY % bibliolist.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliolist.element "INCLUDE">
+<![%bibliolist.element;[
+<!ELEMENT bibliolist %ho; (blockinfo?, (%formalobject.title.content;)?,
+                           (biblioentry|bibliomixed)+)>
+<!--end of bibliolist.element-->]]>
+
+<!ENTITY % bibliolist.attlist "INCLUDE">
+<![%bibliolist.attlist;[
+<!ATTLIST bibliolist
+		%common.attrib;
+		%bibliolist.role.attrib;
+		%local.bibliolist.attrib;
+>
+<!--end of bibliolist.attlist-->]]>
+<!--end of bibliolist.module-->]]>
+
+<!ENTITY % biblioentry.module "INCLUDE">
+<![%biblioentry.module;[
+<!ENTITY % local.biblioentry.attrib "">
+<!ENTITY % biblioentry.role.attrib "%role.attrib;">
+
+<!ENTITY % biblioentry.element "INCLUDE">
+<![%biblioentry.element;[
+<!ELEMENT biblioentry %ho; ((articleinfo | (%bibliocomponent.mix;))+)
+                      %ubiq.exclusion;>
+<!--end of biblioentry.element-->]]>
+
+<!ENTITY % biblioentry.attlist "INCLUDE">
+<![%biblioentry.attlist;[
+<!ATTLIST biblioentry
+		%common.attrib;
+		%biblioentry.role.attrib;
+		%local.biblioentry.attrib;
+>
+<!--end of biblioentry.attlist-->]]>
+<!--end of biblioentry.module-->]]>
+
+<!ENTITY % bibliomixed.module "INCLUDE">
+<![%bibliomixed.module;[
+<!ENTITY % local.bibliomixed.attrib "">
+<!ENTITY % bibliomixed.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliomixed.element "INCLUDE">
+<![%bibliomixed.element;[
+<!ELEMENT bibliomixed %ho; (#PCDATA | %bibliocomponent.mix; | bibliomset)*
+                      %ubiq.exclusion;>
+<!--end of bibliomixed.element-->]]>
+
+<!ENTITY % bibliomixed.attlist "INCLUDE">
+<![%bibliomixed.attlist;[
+<!ATTLIST bibliomixed
+		%common.attrib;
+		%bibliomixed.role.attrib;
+		%local.bibliomixed.attrib;
+>
+<!--end of bibliomixed.attlist-->]]>
+<!--end of bibliomixed.module-->]]>
+
+<!ENTITY % articleinfo.module "INCLUDE">
+<![%articleinfo.module;[
+<!ENTITY % local.articleinfo.attrib "">
+<!ENTITY % articleinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % articleinfo.element "INCLUDE">
+<![%articleinfo.element;[
+<!ELEMENT articleinfo %ho; ((%info.class;)+)
+	%beginpage.exclusion;>
+<!--end of articleinfo.element-->]]>
+
+<!ENTITY % articleinfo.attlist "INCLUDE">
+<![%articleinfo.attlist;[
+<!ATTLIST articleinfo
+		%common.attrib;
+		%articleinfo.role.attrib;
+		%local.articleinfo.attrib;
+>
+<!--end of articleinfo.attlist-->]]>
+<!--end of articleinfo.module-->]]>
+
+<!ENTITY % biblioset.module "INCLUDE">
+<![%biblioset.module;[
+<!ENTITY % local.biblioset.attrib "">
+<!ENTITY % biblioset.role.attrib "%role.attrib;">
+
+<!ENTITY % biblioset.element "INCLUDE">
+<![%biblioset.element;[
+<!ELEMENT biblioset %ho; ((%bibliocomponent.mix;)+)
+                      %ubiq.exclusion;>
+<!--end of biblioset.element-->]]>
+
+<!-- Relation: Relationship of elements contained within BiblioSet -->
+
+
+<!ENTITY % biblioset.attlist "INCLUDE">
+<![%biblioset.attlist;[
+<!ATTLIST biblioset
+		relation	CDATA		#IMPLIED
+		%common.attrib;
+		%biblioset.role.attrib;
+		%local.biblioset.attrib;
+>
+<!--end of biblioset.attlist-->]]>
+<!--end of biblioset.module-->]]>
+
+<!ENTITY % bibliomset.module "INCLUDE">
+<![%bibliomset.module;[
+<!ENTITY % bibliomset.role.attrib "%role.attrib;">
+<!ENTITY % local.bibliomset.attrib "">
+
+<!ENTITY % bibliomset.element "INCLUDE">
+<![%bibliomset.element;[
+<!ELEMENT bibliomset %ho; (#PCDATA | %bibliocomponent.mix; | bibliomset)*
+                      %ubiq.exclusion;>
+<!--end of bibliomset.element-->]]>
+
+<!-- Relation: Relationship of elements contained within BiblioMSet -->
+
+
+<!ENTITY % bibliomset.attlist "INCLUDE">
+<![%bibliomset.attlist;[
+<!ATTLIST bibliomset
+		relation	CDATA		#IMPLIED
+		%common.attrib;
+		%bibliomset.role.attrib;
+		%local.bibliomset.attrib;
+>
+<!--end of bibliomset.attlist-->]]>
+<!--end of bibliomset.module-->]]>
+
+<!ENTITY % bibliomisc.module "INCLUDE">
+<![%bibliomisc.module;[
+<!ENTITY % local.bibliomisc.attrib "">
+<!ENTITY % bibliomisc.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliomisc.element "INCLUDE">
+<![%bibliomisc.element;[
+<!ELEMENT bibliomisc %ho; (%para.char.mix;)*>
+<!--end of bibliomisc.element-->]]>
+
+<!ENTITY % bibliomisc.attlist "INCLUDE">
+<![%bibliomisc.attlist;[
+<!ATTLIST bibliomisc
+		%common.attrib;
+		%bibliomisc.role.attrib;
+		%local.bibliomisc.attrib;
+>
+<!--end of bibliomisc.attlist-->]]>
+<!--end of bibliomisc.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Subject, Keyword, and ITermSet elements .............................. -->
+
+<!ENTITY % subjectset.content.module "INCLUDE">
+<![%subjectset.content.module;[
+<!ENTITY % subjectset.module "INCLUDE">
+<![%subjectset.module;[
+<!ENTITY % local.subjectset.attrib "">
+<!ENTITY % subjectset.role.attrib "%role.attrib;">
+
+<!ENTITY % subjectset.element "INCLUDE">
+<![%subjectset.element;[
+<!ELEMENT subjectset %ho; (subject+)>
+<!--end of subjectset.element-->]]>
+
+<!-- Scheme: Controlled vocabulary employed in SubjectTerms -->
+
+
+<!ENTITY % subjectset.attlist "INCLUDE">
+<![%subjectset.attlist;[
+<!ATTLIST subjectset
+		scheme		NMTOKEN		#IMPLIED
+		%common.attrib;
+		%subjectset.role.attrib;
+		%local.subjectset.attrib;
+>
+<!--end of subjectset.attlist-->]]>
+<!--end of subjectset.module-->]]>
+
+<!ENTITY % subject.module "INCLUDE">
+<![%subject.module;[
+<!ENTITY % local.subject.attrib "">
+<!ENTITY % subject.role.attrib "%role.attrib;">
+
+<!ENTITY % subject.element "INCLUDE">
+<![%subject.element;[
+<!ELEMENT subject %ho; (subjectterm+)>
+<!--end of subject.element-->]]>
+
+<!-- Weight: Ranking of this group of SubjectTerms relative
+		to others, 0 is low, no highest value specified -->
+
+
+<!ENTITY % subject.attlist "INCLUDE">
+<![%subject.attlist;[
+<!ATTLIST subject
+		weight		CDATA		#IMPLIED
+		%common.attrib;
+		%subject.role.attrib;
+		%local.subject.attrib;
+>
+<!--end of subject.attlist-->]]>
+<!--end of subject.module-->]]>
+
+<!ENTITY % subjectterm.module "INCLUDE">
+<![%subjectterm.module;[
+<!ENTITY % local.subjectterm.attrib "">
+<!ENTITY % subjectterm.role.attrib "%role.attrib;">
+
+<!ENTITY % subjectterm.element "INCLUDE">
+<![%subjectterm.element;[
+<!ELEMENT subjectterm %ho; (#PCDATA)>
+<!--end of subjectterm.element-->]]>
+
+<!ENTITY % subjectterm.attlist "INCLUDE">
+<![%subjectterm.attlist;[
+<!ATTLIST subjectterm
+		%common.attrib;
+		%subjectterm.role.attrib;
+		%local.subjectterm.attrib;
+>
+<!--end of subjectterm.attlist-->]]>
+<!--end of subjectterm.module-->]]>
+<!--end of subjectset.content.module-->]]>
+
+<!ENTITY % keywordset.content.module "INCLUDE">
+<![%keywordset.content.module;[
+<!ENTITY % keywordset.module "INCLUDE">
+<![%keywordset.module;[
+<!ENTITY % local.keywordset.attrib "">
+<!ENTITY % keywordset.role.attrib "%role.attrib;">
+
+<!ENTITY % keywordset.element "INCLUDE">
+<![%keywordset.element;[
+<!ELEMENT keywordset %ho; (keyword+)>
+<!--end of keywordset.element-->]]>
+
+<!ENTITY % keywordset.attlist "INCLUDE">
+<![%keywordset.attlist;[
+<!ATTLIST keywordset
+		%common.attrib;
+		%keywordset.role.attrib;
+		%local.keywordset.attrib;
+>
+<!--end of keywordset.attlist-->]]>
+<!--end of keywordset.module-->]]>
+
+<!ENTITY % keyword.module "INCLUDE">
+<![%keyword.module;[
+<!ENTITY % local.keyword.attrib "">
+<!ENTITY % keyword.role.attrib "%role.attrib;">
+
+<!ENTITY % keyword.element "INCLUDE">
+<![%keyword.element;[
+<!ELEMENT keyword %ho; (#PCDATA)>
+<!--end of keyword.element-->]]>
+
+<!ENTITY % keyword.attlist "INCLUDE">
+<![%keyword.attlist;[
+<!ATTLIST keyword
+		%common.attrib;
+		%keyword.role.attrib;
+		%local.keyword.attrib;
+>
+<!--end of keyword.attlist-->]]>
+<!--end of keyword.module-->]]>
+<!--end of keywordset.content.module-->]]>
+
+<!ENTITY % itermset.module "INCLUDE">
+<![%itermset.module;[
+<!ENTITY % local.itermset.attrib "">
+<!ENTITY % itermset.role.attrib "%role.attrib;">
+
+<!ENTITY % itermset.element "INCLUDE">
+<![%itermset.element;[
+<!ELEMENT itermset %ho; (indexterm+)>
+<!--end of itermset.element-->]]>
+
+<!ENTITY % itermset.attlist "INCLUDE">
+<![%itermset.attlist;[
+<!ATTLIST itermset
+		%common.attrib;
+		%itermset.role.attrib;
+		%local.itermset.attrib;
+>
+<!--end of itermset.attlist-->]]>
+<!--end of itermset.module-->]]>
+
+<!-- Bibliographic info for "blocks" -->
+
+<!ENTITY % blockinfo.module "INCLUDE">
+<![ %blockinfo.module; [
+<!ENTITY % local.blockinfo.attrib "">
+<!ENTITY % blockinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % blockinfo.element "INCLUDE">
+<![ %blockinfo.element; [
+<!ELEMENT blockinfo %ho; ((%info.class;)+)
+	%beginpage.exclusion;>
+<!--end of blockinfo.element-->]]>
+
+<!ENTITY % blockinfo.attlist "INCLUDE">
+<![ %blockinfo.attlist; [
+<!ATTLIST blockinfo
+		%common.attrib;
+		%blockinfo.role.attrib;
+		%local.blockinfo.attrib;
+>
+<!--end of blockinfo.attlist-->]]>
+<!--end of blockinfo.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Compound (section-ish) elements ...................................... -->
+
+<!-- Message set ...................... -->
+
+<!ENTITY % msgset.content.module "INCLUDE">
+<![%msgset.content.module;[
+<!ENTITY % msgset.module "INCLUDE">
+<![%msgset.module;[
+<!ENTITY % local.msgset.attrib "">
+<!ENTITY % msgset.role.attrib "%role.attrib;">
+
+<!ENTITY % msgset.element "INCLUDE">
+<![%msgset.element;[
+<!ELEMENT msgset %ho; (blockinfo?, (%formalobject.title.content;)?,
+                       (msgentry+|simplemsgentry+))>
+<!--end of msgset.element-->]]>
+
+<!ENTITY % msgset.attlist "INCLUDE">
+<![%msgset.attlist;[
+<!ATTLIST msgset
+		%common.attrib;
+		%msgset.role.attrib;
+		%local.msgset.attrib;
+>
+<!--end of msgset.attlist-->]]>
+<!--end of msgset.module-->]]>
+
+<!ENTITY % msgentry.module "INCLUDE">
+<![%msgentry.module;[
+<!ENTITY % local.msgentry.attrib "">
+<!ENTITY % msgentry.role.attrib "%role.attrib;">
+
+<!ENTITY % msgentry.element "INCLUDE">
+<![%msgentry.element;[
+<!ELEMENT msgentry %ho; (msg+, msginfo?, msgexplan*)>
+<!--end of msgentry.element-->]]>
+
+<!ENTITY % msgentry.attlist "INCLUDE">
+<![%msgentry.attlist;[
+<!ATTLIST msgentry
+		%common.attrib;
+		%msgentry.role.attrib;
+		%local.msgentry.attrib;
+>
+<!--end of msgentry.attlist-->]]>
+<!--end of msgentry.module-->]]>
+
+<!ENTITY % simplemsgentry.module "INCLUDE">
+<![ %simplemsgentry.module; [
+<!ENTITY % local.simplemsgentry.attrib "">
+<!ENTITY % simplemsgentry.role.attrib "%role.attrib;">
+
+<!ENTITY % simplemsgentry.element "INCLUDE">
+<![ %simplemsgentry.element; [
+<!ELEMENT simplemsgentry %ho; (msgtext, msgexplan+)>
+<!--end of simplemsgentry.element-->]]>
+
+<!ENTITY % simplemsgentry.attlist "INCLUDE">
+<![ %simplemsgentry.attlist; [
+<!ATTLIST simplemsgentry
+		audience	CDATA	#IMPLIED
+		level		CDATA	#IMPLIED
+		origin		CDATA	#IMPLIED
+		%common.attrib;
+		%simplemsgentry.role.attrib;
+		%local.simplemsgentry.attrib;
+>
+<!--end of simplemsgentry.attlist-->]]>
+<!--end of simplemsgentry.module-->]]>
+
+<!ENTITY % msg.module "INCLUDE">
+<![%msg.module;[
+<!ENTITY % local.msg.attrib "">
+<!ENTITY % msg.role.attrib "%role.attrib;">
+
+<!ENTITY % msg.element "INCLUDE">
+<![%msg.element;[
+<!ELEMENT msg %ho; (title?, msgmain, (msgsub | msgrel)*)>
+<!--end of msg.element-->]]>
+
+<!ENTITY % msg.attlist "INCLUDE">
+<![%msg.attlist;[
+<!ATTLIST msg
+		%common.attrib;
+		%msg.role.attrib;
+		%local.msg.attrib;
+>
+<!--end of msg.attlist-->]]>
+<!--end of msg.module-->]]>
+
+<!ENTITY % msgmain.module "INCLUDE">
+<![%msgmain.module;[
+<!ENTITY % local.msgmain.attrib "">
+<!ENTITY % msgmain.role.attrib "%role.attrib;">
+
+<!ENTITY % msgmain.element "INCLUDE">
+<![%msgmain.element;[
+<!ELEMENT msgmain %ho; (title?, msgtext)>
+<!--end of msgmain.element-->]]>
+
+<!ENTITY % msgmain.attlist "INCLUDE">
+<![%msgmain.attlist;[
+<!ATTLIST msgmain
+		%common.attrib;
+		%msgmain.role.attrib;
+		%local.msgmain.attrib;
+>
+<!--end of msgmain.attlist-->]]>
+<!--end of msgmain.module-->]]>
+
+<!ENTITY % msgsub.module "INCLUDE">
+<![%msgsub.module;[
+<!ENTITY % local.msgsub.attrib "">
+<!ENTITY % msgsub.role.attrib "%role.attrib;">
+
+<!ENTITY % msgsub.element "INCLUDE">
+<![%msgsub.element;[
+<!ELEMENT msgsub %ho; (title?, msgtext)>
+<!--end of msgsub.element-->]]>
+
+<!ENTITY % msgsub.attlist "INCLUDE">
+<![%msgsub.attlist;[
+<!ATTLIST msgsub
+		%common.attrib;
+		%msgsub.role.attrib;
+		%local.msgsub.attrib;
+>
+<!--end of msgsub.attlist-->]]>
+<!--end of msgsub.module-->]]>
+
+<!ENTITY % msgrel.module "INCLUDE">
+<![%msgrel.module;[
+<!ENTITY % local.msgrel.attrib "">
+<!ENTITY % msgrel.role.attrib "%role.attrib;">
+
+<!ENTITY % msgrel.element "INCLUDE">
+<![%msgrel.element;[
+<!ELEMENT msgrel %ho; (title?, msgtext)>
+<!--end of msgrel.element-->]]>
+
+<!ENTITY % msgrel.attlist "INCLUDE">
+<![%msgrel.attlist;[
+<!ATTLIST msgrel
+		%common.attrib;
+		%msgrel.role.attrib;
+		%local.msgrel.attrib;
+>
+<!--end of msgrel.attlist-->]]>
+<!--end of msgrel.module-->]]>
+
+<!-- MsgText (defined in the Inlines section, below)-->
+
+<!ENTITY % msginfo.module "INCLUDE">
+<![%msginfo.module;[
+<!ENTITY % local.msginfo.attrib "">
+<!ENTITY % msginfo.role.attrib "%role.attrib;">
+
+<!ENTITY % msginfo.element "INCLUDE">
+<![%msginfo.element;[
+<!ELEMENT msginfo %ho; ((msglevel | msgorig | msgaud)*)>
+<!--end of msginfo.element-->]]>
+
+<!ENTITY % msginfo.attlist "INCLUDE">
+<![%msginfo.attlist;[
+<!ATTLIST msginfo
+		%common.attrib;
+		%msginfo.role.attrib;
+		%local.msginfo.attrib;
+>
+<!--end of msginfo.attlist-->]]>
+<!--end of msginfo.module-->]]>
+
+<!ENTITY % msglevel.module "INCLUDE">
+<![%msglevel.module;[
+<!ENTITY % local.msglevel.attrib "">
+<!ENTITY % msglevel.role.attrib "%role.attrib;">
+
+<!ENTITY % msglevel.element "INCLUDE">
+<![%msglevel.element;[
+<!ELEMENT msglevel %ho; (%smallcptr.char.mix;)*>
+<!--end of msglevel.element-->]]>
+
+<!ENTITY % msglevel.attlist "INCLUDE">
+<![%msglevel.attlist;[
+<!ATTLIST msglevel
+		%common.attrib;
+		%msglevel.role.attrib;
+		%local.msglevel.attrib;
+>
+<!--end of msglevel.attlist-->]]>
+<!--end of msglevel.module-->]]>
+
+<!ENTITY % msgorig.module "INCLUDE">
+<![%msgorig.module;[
+<!ENTITY % local.msgorig.attrib "">
+<!ENTITY % msgorig.role.attrib "%role.attrib;">
+
+<!ENTITY % msgorig.element "INCLUDE">
+<![%msgorig.element;[
+<!ELEMENT msgorig %ho; (%smallcptr.char.mix;)*>
+<!--end of msgorig.element-->]]>
+
+<!ENTITY % msgorig.attlist "INCLUDE">
+<![%msgorig.attlist;[
+<!ATTLIST msgorig
+		%common.attrib;
+		%msgorig.role.attrib;
+		%local.msgorig.attrib;
+>
+<!--end of msgorig.attlist-->]]>
+<!--end of msgorig.module-->]]>
+
+<!ENTITY % msgaud.module "INCLUDE">
+<![%msgaud.module;[
+<!ENTITY % local.msgaud.attrib "">
+<!ENTITY % msgaud.role.attrib "%role.attrib;">
+
+<!ENTITY % msgaud.element "INCLUDE">
+<![%msgaud.element;[
+<!ELEMENT msgaud %ho; (%para.char.mix;)*>
+<!--end of msgaud.element-->]]>
+
+<!ENTITY % msgaud.attlist "INCLUDE">
+<![%msgaud.attlist;[
+<!ATTLIST msgaud
+		%common.attrib;
+		%msgaud.role.attrib;
+		%local.msgaud.attrib;
+>
+<!--end of msgaud.attlist-->]]>
+<!--end of msgaud.module-->]]>
+
+<!ENTITY % msgexplan.module "INCLUDE">
+<![%msgexplan.module;[
+<!ENTITY % local.msgexplan.attrib "">
+<!ENTITY % msgexplan.role.attrib "%role.attrib;">
+
+<!ENTITY % msgexplan.element "INCLUDE">
+<![%msgexplan.element;[
+<!ELEMENT msgexplan %ho; (title?, (%component.mix;)+)>
+<!--end of msgexplan.element-->]]>
+
+<!ENTITY % msgexplan.attlist "INCLUDE">
+<![%msgexplan.attlist;[
+<!ATTLIST msgexplan
+		%common.attrib;
+		%msgexplan.role.attrib;
+		%local.msgexplan.attrib;
+>
+<!--end of msgexplan.attlist-->]]>
+<!--end of msgexplan.module-->]]>
+<!--end of msgset.content.module-->]]>
+
+<!ENTITY % task.content.module "INCLUDE">
+<![%task.content.module;[
+<!ENTITY % task.module "INCLUDE">
+<![%task.module;[
+<!ENTITY % local.task.attrib "">
+<!ENTITY % task.role.attrib "%role.attrib;">
+
+<!ENTITY % task.element "INCLUDE">
+<![%task.element;[
+<!ELEMENT task %ho; (blockinfo?,(%ndxterm.class;)*,
+                     (%formalobject.title.content;),
+                     tasksummary?,
+                     taskprerequisites?,
+                     procedure,
+                     example*,
+                     taskrelated?)>
+<!--end of task.element-->]]>
+
+<!ENTITY % task.attlist "INCLUDE">
+<![%task.attlist;[
+<!ATTLIST task
+		%common.attrib;
+		%task.role.attrib;
+		%local.task.attrib;
+>
+<!--end of task.attlist-->]]>
+<!--end of task.module-->]]>
+
+<!ENTITY % tasksummary.module "INCLUDE">
+<![%tasksummary.module;[
+<!ENTITY % local.tasksummary.attrib "">
+<!ENTITY % tasksummary.role.attrib "%role.attrib;">
+
+<!ENTITY % tasksummary.element "INCLUDE">
+<![%tasksummary.element;[
+<!ELEMENT tasksummary %ho; (blockinfo?,
+                            (%formalobject.title.content;)?,
+                            (%component.mix;)+)>
+<!--end of tasksummary.element-->]]>
+
+<!ENTITY % tasksummary.attlist "INCLUDE">
+<![%tasksummary.attlist;[
+<!ATTLIST tasksummary
+		%common.attrib;
+		%tasksummary.role.attrib;
+		%local.tasksummary.attrib;
+>
+<!--end of tasksummary.attlist-->]]>
+<!--end of tasksummary.module-->]]>
+
+<!ENTITY % taskprerequisites.module "INCLUDE">
+<![%taskprerequisites.module;[
+<!ENTITY % local.taskprerequisites.attrib "">
+<!ENTITY % taskprerequisites.role.attrib "%role.attrib;">
+
+<!ENTITY % taskprerequisites.element "INCLUDE">
+<![%taskprerequisites.element;[
+<!ELEMENT taskprerequisites %ho; (blockinfo?,
+                                  (%formalobject.title.content;)?,
+                                  (%component.mix;)+)>
+<!--end of taskprerequisites.element-->]]>
+
+<!ENTITY % taskprerequisites.attlist "INCLUDE">
+<![%taskprerequisites.attlist;[
+<!ATTLIST taskprerequisites
+		%common.attrib;
+		%taskprerequisites.role.attrib;
+		%local.taskprerequisites.attrib;
+>
+<!--end of taskprerequisites.attlist-->]]>
+<!--end of taskprerequisites.module-->]]>
+
+<!ENTITY % taskrelated.module "INCLUDE">
+<![%taskrelated.module;[
+<!ENTITY % local.taskrelated.attrib "">
+<!ENTITY % taskrelated.role.attrib "%role.attrib;">
+
+<!ENTITY % taskrelated.element "INCLUDE">
+<![%taskrelated.element;[
+<!ELEMENT taskrelated %ho; (blockinfo?,
+                            (%formalobject.title.content;)?,
+                            (%component.mix;)+)>
+<!--end of taskrelated.element-->]]>
+
+<!ENTITY % taskrelated.attlist "INCLUDE">
+<![%taskrelated.attlist;[
+<!ATTLIST taskrelated
+		%common.attrib;
+		%taskrelated.role.attrib;
+		%local.taskrelated.attrib;
+>
+<!--end of taskrelated.attlist-->]]>
+<!--end of taskrelated.module-->]]>
+<!--end of task.content.module-->]]>
+
+<!-- QandASet ........................ -->
+<!ENTITY % qandaset.content.module "INCLUDE">
+<![ %qandaset.content.module; [
+<!ENTITY % qandaset.module "INCLUDE">
+<![ %qandaset.module; [
+<!ENTITY % local.qandaset.attrib "">
+<!ENTITY % qandaset.role.attrib "%role.attrib;">
+
+<!ENTITY % qandaset.element "INCLUDE">
+<![ %qandaset.element; [
+<!ELEMENT qandaset %ho; (blockinfo?, (%formalobject.title.content;)?,
+			(%qandaset.mix;)*,
+                        (qandadiv+|qandaentry+))>
+<!--end of qandaset.element-->]]>
+
+<!ENTITY % qandaset.attlist "INCLUDE">
+<![ %qandaset.attlist; [
+<!ATTLIST qandaset
+		defaultlabel	(qanda|number|none)       #IMPLIED
+		%common.attrib;
+		%qandaset.role.attrib;
+		%local.qandaset.attrib;>
+<!--end of qandaset.attlist-->]]>
+<!--end of qandaset.module-->]]>
+
+<!ENTITY % qandadiv.module "INCLUDE">
+<![ %qandadiv.module; [
+<!ENTITY % local.qandadiv.attrib "">
+<!ENTITY % qandadiv.role.attrib "%role.attrib;">
+
+<!ENTITY % qandadiv.element "INCLUDE">
+<![ %qandadiv.element; [
+<!ELEMENT qandadiv %ho; (blockinfo?, (%formalobject.title.content;)?,
+			(%qandaset.mix;)*,
+			(qandadiv+|qandaentry+))>
+<!--end of qandadiv.element-->]]>
+
+<!ENTITY % qandadiv.attlist "INCLUDE">
+<![ %qandadiv.attlist; [
+<!ATTLIST qandadiv
+		%common.attrib;
+		%qandadiv.role.attrib;
+		%local.qandadiv.attrib;>
+<!--end of qandadiv.attlist-->]]>
+<!--end of qandadiv.module-->]]>
+
+<!ENTITY % qandaentry.module "INCLUDE">
+<![ %qandaentry.module; [
+<!ENTITY % local.qandaentry.attrib "">
+<!ENTITY % qandaentry.role.attrib "%role.attrib;">
+
+<!ENTITY % qandaentry.element "INCLUDE">
+<![ %qandaentry.element; [
+<!ELEMENT qandaentry %ho; (blockinfo?, revhistory?, question, answer*)>
+<!--end of qandaentry.element-->]]>
+
+<!ENTITY % qandaentry.attlist "INCLUDE">
+<![ %qandaentry.attlist; [
+<!ATTLIST qandaentry
+		%common.attrib;
+		%qandaentry.role.attrib;
+		%local.qandaentry.attrib;>
+<!--end of qandaentry.attlist-->]]>
+<!--end of qandaentry.module-->]]>
+
+<!ENTITY % question.module "INCLUDE">
+<![ %question.module; [
+<!ENTITY % local.question.attrib "">
+<!ENTITY % question.role.attrib "%role.attrib;">
+
+<!ENTITY % question.element "INCLUDE">
+<![ %question.element; [
+<!ELEMENT question %ho; (label?, (%qandaset.mix;)+)>
+<!--end of question.element-->]]>
+
+<!ENTITY % question.attlist "INCLUDE">
+<![ %question.attlist; [
+<!ATTLIST question
+		%common.attrib;
+		%question.role.attrib;
+		%local.question.attrib;
+>
+<!--end of question.attlist-->]]>
+<!--end of question.module-->]]>
+
+<!ENTITY % answer.module "INCLUDE">
+<![ %answer.module; [
+<!ENTITY % local.answer.attrib "">
+<!ENTITY % answer.role.attrib "%role.attrib;">
+
+<!ENTITY % answer.element "INCLUDE">
+<![ %answer.element; [
+<!ELEMENT answer %ho; (label?, (%qandaset.mix;)*, qandaentry*)>
+<!--end of answer.element-->]]>
+
+<!ENTITY % answer.attlist "INCLUDE">
+<![ %answer.attlist; [
+<!ATTLIST answer
+		%common.attrib;
+		%answer.role.attrib;
+		%local.answer.attrib;
+>
+<!--end of answer.attlist-->]]>
+<!--end of answer.module-->]]>
+
+<!ENTITY % label.module "INCLUDE">
+<![ %label.module; [
+<!ENTITY % local.label.attrib "">
+<!ENTITY % label.role.attrib "%role.attrib;">
+
+<!ENTITY % label.element "INCLUDE">
+<![ %label.element; [
+<!ELEMENT label %ho; (%word.char.mix;)*>
+<!--end of label.element-->]]>
+
+<!ENTITY % label.attlist "INCLUDE">
+<![ %label.attlist; [
+<!ATTLIST label
+		%common.attrib;
+		%label.role.attrib;
+		%local.label.attrib;
+>
+<!--end of label.attlist-->]]>
+<!--end of label.module-->]]>
+<!--end of qandaset.content.module-->]]>
+
+<!-- Procedure ........................ -->
+
+<!ENTITY % procedure.content.module "INCLUDE">
+<![%procedure.content.module;[
+<!ENTITY % procedure.module "INCLUDE">
+<![%procedure.module;[
+<!ENTITY % local.procedure.attrib "">
+<!ENTITY % procedure.role.attrib "%role.attrib;">
+
+<!ENTITY % procedure.element "INCLUDE">
+<![%procedure.element;[
+<!ELEMENT procedure %ho; (blockinfo?, (%formalobject.title.content;)?,
+                          (%component.mix;)*, step+)>
+<!--end of procedure.element-->]]>
+
+<!ENTITY % procedure.attlist "INCLUDE">
+<![%procedure.attlist;[
+<!ATTLIST procedure
+		%common.attrib;
+		%procedure.role.attrib;
+		%local.procedure.attrib;
+>
+<!--end of procedure.attlist-->]]>
+<!--end of procedure.module-->]]>
+
+<!ENTITY % step.module "INCLUDE">
+<![%step.module;[
+<!ENTITY % local.step.attrib "">
+<!ENTITY % step.role.attrib "%role.attrib;">
+
+<!ENTITY % step.element "INCLUDE">
+<![%step.element;[
+<!ELEMENT step %ho; (title?, (((%component.mix;)+, ((substeps|stepalternatives), (%component.mix;)*)?)
+                    | ((substeps|stepalternatives), (%component.mix;)*)))>
+<!--end of step.element-->]]>
+
+<!-- Performance: Whether the Step must be performed -->
+<!-- not #REQUIRED! -->
+
+
+<!ENTITY % step.attlist "INCLUDE">
+<![%step.attlist;[
+<!ATTLIST step
+		performance	(optional
+				|required)	"required"
+		%common.attrib;
+		%step.role.attrib;
+		%local.step.attrib;
+>
+<!--end of step.attlist-->]]>
+<!--end of step.module-->]]>
+
+<!ENTITY % substeps.module "INCLUDE">
+<![%substeps.module;[
+<!ENTITY % local.substeps.attrib "">
+<!ENTITY % substeps.role.attrib "%role.attrib;">
+
+<!ENTITY % substeps.element "INCLUDE">
+<![%substeps.element;[
+<!ELEMENT substeps %ho; (step+)>
+<!--end of substeps.element-->]]>
+
+<!-- Performance: whether entire set of substeps must be performed -->
+<!-- not #REQUIRED! -->
+
+<!ENTITY % substeps.attlist "INCLUDE">
+<![%substeps.attlist;[
+<!ATTLIST substeps
+		performance	(optional
+				|required)	"required"
+		%common.attrib;
+		%substeps.role.attrib;
+		%local.substeps.attrib;
+>
+<!--end of substeps.attlist-->]]>
+<!--end of substeps.module-->]]>
+
+<!ENTITY % stepalternatives.module "INCLUDE">
+<![%stepalternatives.module;[
+<!ENTITY % local.stepalternatives.attrib "">
+<!ENTITY % stepalternatives.role.attrib "%role.attrib;">
+
+<!ENTITY % stepalternatives.element "INCLUDE">
+<![%stepalternatives.element;[
+<!ELEMENT stepalternatives %ho; (step+)>
+<!--end of stepalternatives.element-->]]>
+
+<!-- Performance: Whether (one of) the alternatives must be performed -->
+<!-- not #REQUIRED! -->
+
+<!ENTITY % stepalternatives.attlist "INCLUDE">
+<![%stepalternatives.attlist;[
+<!ATTLIST stepalternatives
+		performance	(optional
+				|required)	"required"
+		%common.attrib;
+		%stepalternatives.role.attrib;
+		%local.stepalternatives.attrib;
+>
+<!--end of stepalternatives.attlist-->]]>
+<!--end of stepalternatives.module-->]]>
+<!--end of procedure.content.module-->]]>
+
+<!-- Sidebar .......................... -->
+
+<!ENTITY % sidebar.content.model "INCLUDE">
+<![ %sidebar.content.model; [
+
+<!ENTITY % sidebarinfo.module "INCLUDE">
+<![ %sidebarinfo.module; [
+<!ENTITY % local.sidebarinfo.attrib "">
+<!ENTITY % sidebarinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % sidebarinfo.element "INCLUDE">
+<![ %sidebarinfo.element; [
+<!ELEMENT sidebarinfo %ho; ((%info.class;)+)
+	%beginpage.exclusion;>
+<!--end of sidebarinfo.element-->]]>
+
+<!ENTITY % sidebarinfo.attlist "INCLUDE">
+<![ %sidebarinfo.attlist; [
+<!ATTLIST sidebarinfo
+		%common.attrib;
+		%sidebarinfo.role.attrib;
+		%local.sidebarinfo.attrib;
+>
+<!--end of sidebarinfo.attlist-->]]>
+<!--end of sidebarinfo.module-->]]>
+
+<!ENTITY % sidebar.module "INCLUDE">
+<![%sidebar.module;[
+<!ENTITY % local.sidebar.attrib "">
+<!ENTITY % sidebar.role.attrib "%role.attrib;">
+
+<!ENTITY % sidebar.element "INCLUDE">
+<![%sidebar.element;[
+<!ELEMENT sidebar %ho; (sidebarinfo?,
+                   (%formalobject.title.content;)?,
+                   (%sidebar.mix;)+)>
+<!--end of sidebar.element-->]]>
+
+<!ENTITY % sidebar.attlist "INCLUDE">
+<![%sidebar.attlist;[
+<!ATTLIST sidebar
+		%common.attrib;
+		%sidebar.role.attrib;
+		%local.sidebar.attrib;
+>
+<!--end of sidebar.attlist-->]]>
+<!--end of sidebar.module-->]]>
+<!--end of sidebar.content.model-->]]>
+
+<!-- ...................................................................... -->
+<!-- Paragraph-related elements ........................................... -->
+
+<!ENTITY % abstract.module "INCLUDE">
+<![%abstract.module;[
+<!ENTITY % local.abstract.attrib "">
+<!ENTITY % abstract.role.attrib "%role.attrib;">
+
+<!ENTITY % abstract.element "INCLUDE">
+<![%abstract.element;[
+<!ELEMENT abstract %ho; (title?, (%para.class;)+)>
+<!--end of abstract.element-->]]>
+
+<!ENTITY % abstract.attlist "INCLUDE">
+<![%abstract.attlist;[
+<!ATTLIST abstract
+		%common.attrib;
+		%abstract.role.attrib;
+		%local.abstract.attrib;
+>
+<!--end of abstract.attlist-->]]>
+<!--end of abstract.module-->]]>
+
+<!ENTITY % authorblurb.module "INCLUDE">
+<![%authorblurb.module;[
+<!ENTITY % local.authorblurb.attrib "">
+<!ENTITY % authorblurb.role.attrib "%role.attrib;">
+
+<!ENTITY % authorblurb.element "INCLUDE">
+<![%authorblurb.element;[
+<!ELEMENT authorblurb %ho; (title?, (%para.class;)+)>
+<!--end of authorblurb.element-->]]>
+
+<!ENTITY % authorblurb.attlist "INCLUDE">
+<![%authorblurb.attlist;[
+<!ATTLIST authorblurb
+		%common.attrib;
+		%authorblurb.role.attrib;
+		%local.authorblurb.attrib;
+>
+<!--end of authorblurb.attlist-->]]>
+<!--end of authorblurb.module-->]]>
+
+<!ENTITY % personblurb.module "INCLUDE">
+<![%personblurb.module;[
+<!ENTITY % local.personblurb.attrib "">
+<!ENTITY % personblurb.role.attrib "%role.attrib;">
+
+<!ENTITY % personblurb.element "INCLUDE">
+<![%personblurb.element;[
+<!ELEMENT personblurb %ho; (title?, (%para.class;)+)>
+<!--end of personblurb.element-->]]>
+
+<!ENTITY % personblurb.attlist "INCLUDE">
+<![%personblurb.attlist;[
+<!ATTLIST personblurb
+		%common.attrib;
+		%personblurb.role.attrib;
+		%local.personblurb.attrib;
+>
+<!--end of personblurb.attlist-->]]>
+<!--end of personblurb.module-->]]>
+
+<!ENTITY % blockquote.module "INCLUDE">
+<![%blockquote.module;[
+
+<!ENTITY % local.blockquote.attrib "">
+<!ENTITY % blockquote.role.attrib "%role.attrib;">
+
+<!ENTITY % blockquote.element "INCLUDE">
+<![%blockquote.element;[
+<!ELEMENT blockquote %ho; (blockinfo?, title?, attribution?, (%component.mix;)+)
+                      %blockquote.exclusion;>
+<!--end of blockquote.element-->]]>
+
+<!ENTITY % blockquote.attlist "INCLUDE">
+<![%blockquote.attlist;[
+<!ATTLIST blockquote
+		%common.attrib;
+		%blockquote.role.attrib;
+		%local.blockquote.attrib;
+>
+<!--end of blockquote.attlist-->]]>
+<!--end of blockquote.module-->]]>
+
+<!ENTITY % attribution.module "INCLUDE">
+<![%attribution.module;[
+<!ENTITY % local.attribution.attrib "">
+<!ENTITY % attribution.role.attrib "%role.attrib;">
+
+<!ENTITY % attribution.element "INCLUDE">
+<![%attribution.element;[
+<!ELEMENT attribution %ho; (%para.char.mix;)*>
+<!--end of attribution.element-->]]>
+
+<!ENTITY % attribution.attlist "INCLUDE">
+<![%attribution.attlist;[
+<!ATTLIST attribution
+		%common.attrib;
+		%attribution.role.attrib;
+		%local.attribution.attrib;
+>
+<!--end of attribution.attlist-->]]>
+<!--end of attribution.module-->]]>
+
+<!ENTITY % bridgehead.module "INCLUDE">
+<![%bridgehead.module;[
+<!ENTITY % local.bridgehead.attrib "">
+<!ENTITY % bridgehead.role.attrib "%role.attrib;">
+
+<!ENTITY % bridgehead.element "INCLUDE">
+<![%bridgehead.element;[
+<!ELEMENT bridgehead %ho; (%title.char.mix;)*>
+<!--end of bridgehead.element-->]]>
+
+<!-- Renderas: Indicates the format in which the BridgeHead
+		should appear -->
+
+
+<!ENTITY % bridgehead.attlist "INCLUDE">
+<![%bridgehead.attlist;[
+<!ATTLIST bridgehead
+		renderas	(other
+				|sect1
+				|sect2
+				|sect3
+				|sect4
+				|sect5)		#IMPLIED
+		%common.attrib;
+		%bridgehead.role.attrib;
+		%local.bridgehead.attrib;
+>
+<!--end of bridgehead.attlist-->]]>
+<!--end of bridgehead.module-->]]>
+
+<!ENTITY % remark.module "INCLUDE">
+<![%remark.module;[
+<!ENTITY % local.remark.attrib "">
+<!ENTITY % remark.role.attrib "%role.attrib;">
+
+<!ENTITY % remark.element "INCLUDE">
+<![%remark.element;[
+<!ELEMENT remark %ho; (%para.char.mix;)*
+                      %remark.exclusion;>
+<!--end of remark.element-->]]>
+
+<!ENTITY % remark.attlist "INCLUDE">
+<![%remark.attlist;[
+<!ATTLIST remark
+		%common.attrib;
+		%remark.role.attrib;
+		%local.remark.attrib;
+>
+<!--end of remark.attlist-->]]>
+<!--end of remark.module-->]]>
+
+<!ENTITY % epigraph.module "INCLUDE">
+<![%epigraph.module;[
+<!ENTITY % local.epigraph.attrib "">
+<!ENTITY % epigraph.role.attrib "%role.attrib;">
+
+<!ENTITY % epigraph.element "INCLUDE">
+<![%epigraph.element;[
+<!ELEMENT epigraph %ho; (attribution?, ((%para.class;)|literallayout)+)>
+<!--end of epigraph.element-->]]>
+
+<!ENTITY % epigraph.attlist "INCLUDE">
+<![%epigraph.attlist;[
+<!ATTLIST epigraph
+		%common.attrib;
+		%epigraph.role.attrib;
+		%local.epigraph.attrib;
+>
+<!--end of epigraph.attlist-->]]>
+<!-- Attribution (defined above)-->
+<!--end of epigraph.module-->]]>
+
+<!ENTITY % footnote.module "INCLUDE">
+<![%footnote.module;[
+<!ENTITY % local.footnote.attrib "">
+<!ENTITY % footnote.role.attrib "%role.attrib;">
+
+<!ENTITY % footnote.element "INCLUDE">
+<![%footnote.element;[
+<!ELEMENT footnote %ho; ((%footnote.mix;)+)
+                      %footnote.exclusion;>
+<!--end of footnote.element-->]]>
+
+<!ENTITY % footnote.attlist "INCLUDE">
+<![%footnote.attlist;[
+<!ATTLIST footnote
+		%label.attrib;
+		%common.attrib;
+		%footnote.role.attrib;
+		%local.footnote.attrib;
+>
+<!--end of footnote.attlist-->]]>
+<!--end of footnote.module-->]]>
+
+<!ENTITY % highlights.module "INCLUDE">
+<![%highlights.module;[
+<!ENTITY % local.highlights.attrib "">
+<!ENTITY % highlights.role.attrib "%role.attrib;">
+
+<!ENTITY % highlights.element "INCLUDE">
+<![%highlights.element;[
+<!ELEMENT highlights %ho; ((%highlights.mix;)+)
+                      %highlights.exclusion;>
+<!--end of highlights.element-->]]>
+
+<!ENTITY % highlights.attlist "INCLUDE">
+<![%highlights.attlist;[
+<!ATTLIST highlights
+		%common.attrib;
+		%highlights.role.attrib;
+		%local.highlights.attrib;
+>
+<!--end of highlights.attlist-->]]>
+<!--end of highlights.module-->]]>
+
+<!ENTITY % formalpara.module "INCLUDE">
+<![%formalpara.module;[
+<!ENTITY % local.formalpara.attrib "">
+<!ENTITY % formalpara.role.attrib "%role.attrib;">
+
+<!ENTITY % formalpara.element "INCLUDE">
+<![%formalpara.element;[
+<!ELEMENT formalpara %ho; (title, (%ndxterm.class;)*, para)>
+<!--end of formalpara.element-->]]>
+
+<!ENTITY % formalpara.attlist "INCLUDE">
+<![%formalpara.attlist;[
+<!ATTLIST formalpara
+		%common.attrib;
+		%formalpara.role.attrib;
+		%local.formalpara.attrib;
+>
+<!--end of formalpara.attlist-->]]>
+<!--end of formalpara.module-->]]>
+
+<!ENTITY % para.module "INCLUDE">
+<![%para.module;[
+<!ENTITY % local.para.attrib "">
+<!ENTITY % para.role.attrib "%role.attrib;">
+
+<!ENTITY % para.element "INCLUDE">
+<![%para.element;[
+<!ELEMENT para %ho; (%para.char.mix; | %para.mix;)*>
+<!--end of para.element-->]]>
+
+<!ENTITY % para.attlist "INCLUDE">
+<![%para.attlist;[
+<!ATTLIST para
+		%common.attrib;
+		%para.role.attrib;
+		%local.para.attrib;
+>
+<!--end of para.attlist-->]]>
+<!--end of para.module-->]]>
+
+<!ENTITY % simpara.module "INCLUDE">
+<![%simpara.module;[
+<!ENTITY % local.simpara.attrib "">
+<!ENTITY % simpara.role.attrib "%role.attrib;">
+
+<!ENTITY % simpara.element "INCLUDE">
+<![%simpara.element;[
+<!ELEMENT simpara %ho; (%para.char.mix;)*>
+<!--end of simpara.element-->]]>
+
+<!ENTITY % simpara.attlist "INCLUDE">
+<![%simpara.attlist;[
+<!ATTLIST simpara
+		%common.attrib;
+		%simpara.role.attrib;
+		%local.simpara.attrib;
+>
+<!--end of simpara.attlist-->]]>
+<!--end of simpara.module-->]]>
+
+<!ENTITY % admon.module "INCLUDE">
+<![%admon.module;[
+<!ENTITY % local.admon.attrib "">
+<!ENTITY % admon.role.attrib "%role.attrib;">
+
+
+<!ENTITY % caution.element "INCLUDE">
+<![%caution.element;[
+<!ELEMENT caution %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of caution.element-->]]>
+
+<!ENTITY % caution.attlist "INCLUDE">
+<![%caution.attlist;[
+<!ATTLIST caution
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of caution.attlist-->]]>
+
+
+<!ENTITY % important.element "INCLUDE">
+<![%important.element;[
+<!ELEMENT important %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of important.element-->]]>
+
+<!ENTITY % important.attlist "INCLUDE">
+<![%important.attlist;[
+<!ATTLIST important
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of important.attlist-->]]>
+
+
+<!ENTITY % note.element "INCLUDE">
+<![%note.element;[
+<!ELEMENT note %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of note.element-->]]>
+
+<!ENTITY % note.attlist "INCLUDE">
+<![%note.attlist;[
+<!ATTLIST note
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of note.attlist-->]]>
+
+<!ENTITY % tip.element "INCLUDE">
+<![%tip.element;[
+<!ELEMENT tip %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of tip.element-->]]>
+
+<!ENTITY % tip.attlist "INCLUDE">
+<![%tip.attlist;[
+<!ATTLIST tip
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of tip.attlist-->]]>
+
+
+<!ENTITY % warning.element "INCLUDE">
+<![%warning.element;[
+<!ELEMENT warning %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of warning.element-->]]>
+
+<!ENTITY % warning.attlist "INCLUDE">
+<![%warning.attlist;[
+<!ATTLIST warning
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of warning.attlist-->]]>
+
+<!--end of admon.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Lists ................................................................ -->
+
+<!-- GlossList ........................ -->
+
+<!ENTITY % glosslist.module "INCLUDE">
+<![%glosslist.module;[
+<!ENTITY % local.glosslist.attrib "">
+<!ENTITY % glosslist.role.attrib "%role.attrib;">
+
+<!ENTITY % glosslist.element "INCLUDE">
+<![%glosslist.element;[
+<!ELEMENT glosslist %ho; (blockinfo?, (%formalobject.title.content;)?, glossentry+)>
+<!--end of glosslist.element-->]]>
+
+<!ENTITY % glosslist.attlist "INCLUDE">
+<![%glosslist.attlist;[
+<!ATTLIST glosslist
+		%common.attrib;
+		%glosslist.role.attrib;
+		%local.glosslist.attrib;
+>
+<!--end of glosslist.attlist-->]]>
+<!--end of glosslist.module-->]]>
+
+<!ENTITY % glossentry.content.module "INCLUDE">
+<![%glossentry.content.module;[
+<!ENTITY % glossentry.module "INCLUDE">
+<![%glossentry.module;[
+<!ENTITY % local.glossentry.attrib "">
+<!ENTITY % glossentry.role.attrib "%role.attrib;">
+
+<!ENTITY % glossentry.element "INCLUDE">
+<![%glossentry.element;[
+<!ELEMENT glossentry %ho; (glossterm, acronym?, abbrev?,
+                      (%ndxterm.class;)*,
+                      revhistory?, (glosssee|glossdef+))>
+<!--end of glossentry.element-->]]>
+
+<!-- SortAs: String by which the GlossEntry is to be sorted
+		(alphabetized) in lieu of its proper content -->
+
+
+<!ENTITY % glossentry.attlist "INCLUDE">
+<![%glossentry.attlist;[
+<!ATTLIST glossentry
+		sortas		CDATA		#IMPLIED
+		%common.attrib;
+		%glossentry.role.attrib;
+		%local.glossentry.attrib;
+>
+<!--end of glossentry.attlist-->]]>
+<!--end of glossentry.module-->]]>
+
+<!-- GlossTerm (defined in the Inlines section, below)-->
+<!ENTITY % glossdef.module "INCLUDE">
+<![%glossdef.module;[
+<!ENTITY % local.glossdef.attrib "">
+<!ENTITY % glossdef.role.attrib "%role.attrib;">
+
+<!ENTITY % glossdef.element "INCLUDE">
+<![%glossdef.element;[
+<!ELEMENT glossdef %ho; ((%glossdef.mix;)+, glossseealso*)>
+<!--end of glossdef.element-->]]>
+
+<!-- Subject: List of subjects; keywords for the definition -->
+
+
+<!ENTITY % glossdef.attlist "INCLUDE">
+<![%glossdef.attlist;[
+<!ATTLIST glossdef
+		subject		CDATA		#IMPLIED
+		%common.attrib;
+		%glossdef.role.attrib;
+		%local.glossdef.attrib;
+>
+<!--end of glossdef.attlist-->]]>
+<!--end of glossdef.module-->]]>
+
+<!ENTITY % glosssee.module "INCLUDE">
+<![%glosssee.module;[
+<!ENTITY % local.glosssee.attrib "">
+<!ENTITY % glosssee.role.attrib "%role.attrib;">
+
+<!ENTITY % glosssee.element "INCLUDE">
+<![%glosssee.element;[
+<!ELEMENT glosssee %ho; (%para.char.mix;)*>
+<!--end of glosssee.element-->]]>
+
+<!-- OtherTerm: Reference to the GlossEntry whose GlossTerm
+		should be displayed at the point of the GlossSee -->
+
+
+<!ENTITY % glosssee.attlist "INCLUDE">
+<![%glosssee.attlist;[
+<!ATTLIST glosssee
+		otherterm	IDREF		#IMPLIED
+		%common.attrib;
+		%glosssee.role.attrib;
+		%local.glosssee.attrib;
+>
+<!--end of glosssee.attlist-->]]>
+<!--end of glosssee.module-->]]>
+
+<!ENTITY % glossseealso.module "INCLUDE">
+<![%glossseealso.module;[
+<!ENTITY % local.glossseealso.attrib "">
+<!ENTITY % glossseealso.role.attrib "%role.attrib;">
+
+<!ENTITY % glossseealso.element "INCLUDE">
+<![%glossseealso.element;[
+<!ELEMENT glossseealso %ho; (%para.char.mix;)*>
+<!--end of glossseealso.element-->]]>
+
+<!-- OtherTerm: Reference to the GlossEntry whose GlossTerm
+		should be displayed at the point of the GlossSeeAlso -->
+
+
+<!ENTITY % glossseealso.attlist "INCLUDE">
+<![%glossseealso.attlist;[
+<!ATTLIST glossseealso
+		otherterm	IDREF		#IMPLIED
+		%common.attrib;
+		%glossseealso.role.attrib;
+		%local.glossseealso.attrib;
+>
+<!--end of glossseealso.attlist-->]]>
+<!--end of glossseealso.module-->]]>
+<!--end of glossentry.content.module-->]]>
+
+<!-- ItemizedList and OrderedList ..... -->
+
+<!ENTITY % itemizedlist.module "INCLUDE">
+<![%itemizedlist.module;[
+<!ENTITY % local.itemizedlist.attrib "">
+<!ENTITY % itemizedlist.role.attrib "%role.attrib;">
+
+<!ENTITY % itemizedlist.element "INCLUDE">
+<![%itemizedlist.element;[
+<!ELEMENT itemizedlist %ho; (blockinfo?, (%formalobject.title.content;)?,
+ 			    (%listpreamble.mix;)*, listitem+)>
+
+<!--end of itemizedlist.element-->]]>
+
+<!-- Spacing: Whether the vertical space in the list should be
+		compressed -->
+<!-- Mark: Keyword, e.g., bullet, dash, checkbox, none;
+		list of keywords and defaults are implementation specific -->
+
+
+<!ENTITY % itemizedlist.attlist "INCLUDE">
+<![%itemizedlist.attlist;[
+<!ATTLIST itemizedlist
+		spacing		(normal
+				|compact)	#IMPLIED
+		%mark.attrib;
+		%common.attrib;
+		%itemizedlist.role.attrib;
+		%local.itemizedlist.attrib;
+>
+<!--end of itemizedlist.attlist-->]]>
+<!--end of itemizedlist.module-->]]>
+
+<!ENTITY % orderedlist.module "INCLUDE">
+<![%orderedlist.module;[
+<!ENTITY % local.orderedlist.attrib "">
+<!ENTITY % orderedlist.role.attrib "%role.attrib;">
+
+<!ENTITY % orderedlist.element "INCLUDE">
+<![%orderedlist.element;[
+<!ELEMENT orderedlist %ho; (blockinfo?, (%formalobject.title.content;)?,
+ 			    (%listpreamble.mix;)*, listitem+)>
+
+<!--end of orderedlist.element-->]]>
+
+<!-- Numeration: Style of ListItem numbered; default is expected
+		to be Arabic -->
+<!-- InheritNum: Specifies for a nested list that the numbering
+		of ListItems should include the number of the item
+		within which they are nested (e.g., 1a and 1b within 1,
+		rather than a and b) -->
+<!-- Continuation: Where list numbering begins afresh (Restarts,
+		the default) or continues that of the immediately preceding
+		list (Continues) -->
+<!-- Spacing: Whether the vertical space in the list should be
+		compressed -->
+
+
+<!ENTITY % orderedlist.attlist "INCLUDE">
+<![%orderedlist.attlist;[
+<!ATTLIST orderedlist
+		numeration	(arabic
+				|upperalpha
+				|loweralpha
+				|upperroman
+				|lowerroman)	#IMPLIED
+		inheritnum	(inherit
+				|ignore)	"ignore"
+		continuation	(continues
+				|restarts)	"restarts"
+		spacing		(normal
+				|compact)	#IMPLIED
+		%common.attrib;
+		%orderedlist.role.attrib;
+		%local.orderedlist.attrib;
+>
+<!--end of orderedlist.attlist-->]]>
+<!--end of orderedlist.module-->]]>
+
+<!ENTITY % listitem.module "INCLUDE">
+<![%listitem.module;[
+<!ENTITY % local.listitem.attrib "">
+<!ENTITY % listitem.role.attrib "%role.attrib;">
+
+<!ENTITY % listitem.element "INCLUDE">
+<![%listitem.element;[
+<!ELEMENT listitem %ho; ((%component.mix;)+)>
+<!--end of listitem.element-->]]>
+
+<!-- Override: Indicates the mark to be used for this ListItem
+		instead of the default mark or the mark specified by
+		the Mark attribute on the enclosing ItemizedList -->
+
+
+<!ENTITY % listitem.attlist "INCLUDE">
+<![%listitem.attlist;[
+<!ATTLIST listitem
+		override	CDATA		#IMPLIED
+		%common.attrib;
+		%listitem.role.attrib;
+		%local.listitem.attrib;
+>
+<!--end of listitem.attlist-->]]>
+<!--end of listitem.module-->]]>
+
+<!-- SegmentedList .................... -->
+<!ENTITY % segmentedlist.content.module "INCLUDE">
+<![%segmentedlist.content.module;[
+<!ENTITY % segmentedlist.module "INCLUDE">
+<![%segmentedlist.module;[
+<!ENTITY % local.segmentedlist.attrib "">
+<!ENTITY % segmentedlist.role.attrib "%role.attrib;">
+
+<!ENTITY % segmentedlist.element "INCLUDE">
+<![%segmentedlist.element;[
+<!ELEMENT segmentedlist %ho; ((%formalobject.title.content;)?,
+                         segtitle+,
+                         seglistitem+)>
+<!--end of segmentedlist.element-->]]>
+
+<!ENTITY % segmentedlist.attlist "INCLUDE">
+<![%segmentedlist.attlist;[
+<!ATTLIST segmentedlist
+		%common.attrib;
+		%segmentedlist.role.attrib;
+		%local.segmentedlist.attrib;
+>
+<!--end of segmentedlist.attlist-->]]>
+<!--end of segmentedlist.module-->]]>
+
+<!ENTITY % segtitle.module "INCLUDE">
+<![%segtitle.module;[
+<!ENTITY % local.segtitle.attrib "">
+<!ENTITY % segtitle.role.attrib "%role.attrib;">
+
+<!ENTITY % segtitle.element "INCLUDE">
+<![%segtitle.element;[
+<!ELEMENT segtitle %ho; (%title.char.mix;)*>
+<!--end of segtitle.element-->]]>
+
+<!ENTITY % segtitle.attlist "INCLUDE">
+<![%segtitle.attlist;[
+<!ATTLIST segtitle
+		%common.attrib;
+		%segtitle.role.attrib;
+		%local.segtitle.attrib;
+>
+<!--end of segtitle.attlist-->]]>
+<!--end of segtitle.module-->]]>
+
+<!ENTITY % seglistitem.module "INCLUDE">
+<![%seglistitem.module;[
+<!ENTITY % local.seglistitem.attrib "">
+<!ENTITY % seglistitem.role.attrib "%role.attrib;">
+
+<!ENTITY % seglistitem.element "INCLUDE">
+<![%seglistitem.element;[
+<!ELEMENT seglistitem %ho; (seg+)>
+<!--end of seglistitem.element-->]]>
+
+<!ENTITY % seglistitem.attlist "INCLUDE">
+<![%seglistitem.attlist;[
+<!ATTLIST seglistitem
+		%common.attrib;
+		%seglistitem.role.attrib;
+		%local.seglistitem.attrib;
+>
+<!--end of seglistitem.attlist-->]]>
+<!--end of seglistitem.module-->]]>
+
+<!ENTITY % seg.module "INCLUDE">
+<![%seg.module;[
+<!ENTITY % local.seg.attrib "">
+<!ENTITY % seg.role.attrib "%role.attrib;">
+
+<!ENTITY % seg.element "INCLUDE">
+<![%seg.element;[
+<!ELEMENT seg %ho; (%para.char.mix;)*>
+<!--end of seg.element-->]]>
+
+<!ENTITY % seg.attlist "INCLUDE">
+<![%seg.attlist;[
+<!ATTLIST seg
+		%common.attrib;
+		%seg.role.attrib;
+		%local.seg.attrib;
+>
+<!--end of seg.attlist-->]]>
+<!--end of seg.module-->]]>
+<!--end of segmentedlist.content.module-->]]>
+
+<!-- SimpleList ....................... -->
+
+<!ENTITY % simplelist.content.module "INCLUDE">
+<![%simplelist.content.module;[
+<!ENTITY % simplelist.module "INCLUDE">
+<![%simplelist.module;[
+<!ENTITY % local.simplelist.attrib "">
+<!ENTITY % simplelist.role.attrib "%role.attrib;">
+
+<!ENTITY % simplelist.element "INCLUDE">
+<![%simplelist.element;[
+<!ELEMENT simplelist %ho; (member+)>
+<!--end of simplelist.element-->]]>
+
+<!-- Columns: The number of columns the array should contain -->
+<!-- Type: How the Members of the SimpleList should be
+		formatted: Inline (members separated with commas etc.
+		inline), Vert (top to bottom in n Columns), or Horiz (in
+		the direction of text flow) in n Columns.  If Column
+		is 1 or implied, Type=Vert and Type=Horiz give the same
+		results. -->
+
+
+<!ENTITY % simplelist.attlist "INCLUDE">
+<![%simplelist.attlist;[
+<!ATTLIST simplelist
+		columns		CDATA		#IMPLIED
+		type		(inline
+				|vert
+				|horiz)		"vert"
+		%common.attrib;
+		%simplelist.role.attrib;
+		%local.simplelist.attrib;
+>
+<!--end of simplelist.attlist-->]]>
+<!--end of simplelist.module-->]]>
+
+<!ENTITY % member.module "INCLUDE">
+<![%member.module;[
+<!ENTITY % local.member.attrib "">
+<!ENTITY % member.role.attrib "%role.attrib;">
+
+<!ENTITY % member.element "INCLUDE">
+<![%member.element;[
+<!ELEMENT member %ho; (%para.char.mix;)*>
+<!--end of member.element-->]]>
+
+<!ENTITY % member.attlist "INCLUDE">
+<![%member.attlist;[
+<!ATTLIST member
+		%common.attrib;
+		%member.role.attrib;
+		%local.member.attrib;
+>
+<!--end of member.attlist-->]]>
+<!--end of member.module-->]]>
+<!--end of simplelist.content.module-->]]>
+
+<!-- VariableList ..................... -->
+
+<!ENTITY % variablelist.content.module "INCLUDE">
+<![%variablelist.content.module;[
+<!ENTITY % variablelist.module "INCLUDE">
+<![%variablelist.module;[
+<!ENTITY % local.variablelist.attrib "">
+<!ENTITY % variablelist.role.attrib "%role.attrib;">
+
+<!ENTITY % variablelist.element "INCLUDE">
+<![%variablelist.element;[
+<!ELEMENT variablelist %ho; (blockinfo?, (%formalobject.title.content;)?,
+ 			    (%listpreamble.mix;)*, varlistentry+)>
+<!--end of variablelist.element-->]]>
+
+<!-- TermLength: Length beyond which the presentation engine
+		may consider the Term too long and select an alternate
+		presentation of the Term and, or, its associated ListItem. -->
+
+
+<!ENTITY % variablelist.attlist "INCLUDE">
+<![%variablelist.attlist;[
+<!ATTLIST variablelist
+		termlength	CDATA		#IMPLIED
+		spacing		(normal
+				|compact)	#IMPLIED
+		%common.attrib;
+		%variablelist.role.attrib;
+		%local.variablelist.attrib;
+>
+<!--end of variablelist.attlist-->]]>
+<!--end of variablelist.module-->]]>
+
+<!ENTITY % varlistentry.module "INCLUDE">
+<![%varlistentry.module;[
+<!ENTITY % local.varlistentry.attrib "">
+<!ENTITY % varlistentry.role.attrib "%role.attrib;">
+
+<!ENTITY % varlistentry.element "INCLUDE">
+<![%varlistentry.element;[
+<!ELEMENT varlistentry %ho; (term+, listitem)>
+<!--end of varlistentry.element-->]]>
+
+<!ENTITY % varlistentry.attlist "INCLUDE">
+<![%varlistentry.attlist;[
+<!ATTLIST varlistentry
+		%common.attrib;
+		%varlistentry.role.attrib;
+		%local.varlistentry.attrib;
+>
+<!--end of varlistentry.attlist-->]]>
+<!--end of varlistentry.module-->]]>
+
+<!ENTITY % term.module "INCLUDE">
+<![%term.module;[
+<!ENTITY % local.term.attrib "">
+<!ENTITY % term.role.attrib "%role.attrib;">
+
+<!ENTITY % term.element "INCLUDE">
+<![%term.element;[
+<!ELEMENT term %ho; (%para.char.mix;)*>
+<!--end of term.element-->]]>
+
+<!ENTITY % term.attlist "INCLUDE">
+<![%term.attlist;[
+<!ATTLIST term
+		%common.attrib;
+		%term.role.attrib;
+		%local.term.attrib;
+>
+<!--end of term.attlist-->]]>
+<!--end of term.module-->]]>
+
+<!-- ListItem (defined above)-->
+<!--end of variablelist.content.module-->]]>
+
+<!-- CalloutList ...................... -->
+
+<!ENTITY % calloutlist.content.module "INCLUDE">
+<![%calloutlist.content.module;[
+<!ENTITY % calloutlist.module "INCLUDE">
+<![%calloutlist.module;[
+<!ENTITY % local.calloutlist.attrib "">
+<!ENTITY % calloutlist.role.attrib "%role.attrib;">
+
+<!ENTITY % calloutlist.element "INCLUDE">
+<![%calloutlist.element;[
+<!ELEMENT calloutlist %ho; ((%formalobject.title.content;)?, callout+)>
+<!--end of calloutlist.element-->]]>
+
+<!ENTITY % calloutlist.attlist "INCLUDE">
+<![%calloutlist.attlist;[
+<!ATTLIST calloutlist
+		%common.attrib;
+		%calloutlist.role.attrib;
+		%local.calloutlist.attrib;
+>
+<!--end of calloutlist.attlist-->]]>
+<!--end of calloutlist.module-->]]>
+
+<!ENTITY % callout.module "INCLUDE">
+<![%callout.module;[
+<!ENTITY % local.callout.attrib "">
+<!ENTITY % callout.role.attrib "%role.attrib;">
+
+<!ENTITY % callout.element "INCLUDE">
+<![%callout.element;[
+<!ELEMENT callout %ho; ((%component.mix;)+)>
+<!--end of callout.element-->]]>
+
+<!-- AreaRefs: IDs of one or more Areas or AreaSets described
+		by this Callout -->
+
+
+<!ENTITY % callout.attlist "INCLUDE">
+<![%callout.attlist;[
+<!ATTLIST callout
+		arearefs	IDREFS		#REQUIRED
+		%common.attrib;
+		%callout.role.attrib;
+		%local.callout.attrib;
+>
+<!--end of callout.attlist-->]]>
+<!--end of callout.module-->]]>
+<!--end of calloutlist.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Objects .............................................................. -->
+
+<!-- Examples etc. .................... -->
+
+<!ENTITY % example.module "INCLUDE">
+<![%example.module;[
+<!ENTITY % local.example.attrib "">
+<!ENTITY % example.role.attrib "%role.attrib;">
+
+<!ENTITY % example.element "INCLUDE">
+<![%example.element;[
+<!ELEMENT example %ho; (blockinfo?, (%formalobject.title.content;), (%example.mix;)+)
+		%formal.exclusion;>
+<!--end of example.element-->]]>
+
+<!ENTITY % example.attlist "INCLUDE">
+<![%example.attlist;[
+<!ATTLIST example
+		floatstyle	CDATA			#IMPLIED
+		%label.attrib;
+		%width.attrib;
+		%common.attrib;
+		%example.role.attrib;
+		%local.example.attrib;
+>
+<!--end of example.attlist-->]]>
+<!--end of example.module-->]]>
+
+<!ENTITY % informalexample.module "INCLUDE">
+<![%informalexample.module;[
+<!ENTITY % local.informalexample.attrib "">
+<!ENTITY % informalexample.role.attrib "%role.attrib;">
+
+<!ENTITY % informalexample.element "INCLUDE">
+<![%informalexample.element;[
+<!ELEMENT informalexample %ho; (blockinfo?, (%example.mix;)+)>
+<!--end of informalexample.element-->]]>
+
+<!ENTITY % informalexample.attlist "INCLUDE">
+<![%informalexample.attlist;[
+<!ATTLIST informalexample
+		floatstyle	CDATA			#IMPLIED
+		%width.attrib;
+		%common.attrib;
+		%informalexample.role.attrib;
+		%local.informalexample.attrib;
+>
+<!--end of informalexample.attlist-->]]>
+<!--end of informalexample.module-->]]>
+
+<!ENTITY % programlistingco.module "INCLUDE">
+<![%programlistingco.module;[
+<!ENTITY % local.programlistingco.attrib "">
+<!ENTITY % programlistingco.role.attrib "%role.attrib;">
+
+<!ENTITY % programlistingco.element "INCLUDE">
+<![%programlistingco.element;[
+<!ELEMENT programlistingco %ho; (areaspec, programlisting, calloutlist*)>
+<!--end of programlistingco.element-->]]>
+
+<!ENTITY % programlistingco.attlist "INCLUDE">
+<![%programlistingco.attlist;[
+<!ATTLIST programlistingco
+		%common.attrib;
+		%programlistingco.role.attrib;
+		%local.programlistingco.attrib;
+>
+<!--end of programlistingco.attlist-->]]>
+<!-- CalloutList (defined above in Lists)-->
+<!--end of informalexample.module-->]]>
+
+<!ENTITY % areaspec.content.module "INCLUDE">
+<![%areaspec.content.module;[
+<!ENTITY % areaspec.module "INCLUDE">
+<![%areaspec.module;[
+<!ENTITY % local.areaspec.attrib "">
+<!ENTITY % areaspec.role.attrib "%role.attrib;">
+
+<!ENTITY % areaspec.element "INCLUDE">
+<![%areaspec.element;[
+<!ELEMENT areaspec %ho; ((area|areaset)+)>
+<!--end of areaspec.element-->]]>
+
+<!-- Units: global unit of measure in which coordinates in
+		this spec are expressed:
+
+		- CALSPair "x1,y1 x2,y2": lower-left and upper-right
+		coordinates in a rectangle describing repro area in which
+		graphic is placed, where X and Y dimensions are each some
+		number 0..10000 (taken from CALS graphic attributes)
+
+		- LineColumn "line column": line number and column number
+		at which to start callout text in "linespecific" content
+
+		- LineRange "startline endline": whole lines from startline
+		to endline in "linespecific" content
+
+		- LineColumnPair "line1 col1 line2 col2": starting and ending
+		points of area in "linespecific" content that starts at
+		first position and ends at second position (including the
+		beginnings of any intervening lines)
+
+		- Other: directive to look at value of OtherUnits attribute
+		to get implementation-specific keyword
+
+		The default is implementation-specific; usually dependent on
+		the parent element (GraphicCO gets CALSPair, ProgramListingCO
+		and ScreenCO get LineColumn) -->
+<!-- OtherUnits: User-defined units -->
+
+
+<!ENTITY % areaspec.attlist "INCLUDE">
+<![%areaspec.attlist;[
+<!ATTLIST areaspec
+		units		(calspair
+				|linecolumn
+				|linerange
+				|linecolumnpair
+				|other)		#IMPLIED
+		otherunits	NMTOKEN		#IMPLIED
+		%common.attrib;
+		%areaspec.role.attrib;
+		%local.areaspec.attrib;
+>
+<!--end of areaspec.attlist-->]]>
+<!--end of areaspec.module-->]]>
+
+<!ENTITY % area.module "INCLUDE">
+<![%area.module;[
+<!ENTITY % local.area.attrib "">
+<!ENTITY % area.role.attrib "%role.attrib;">
+
+<!ENTITY % area.element "INCLUDE">
+<![%area.element;[
+<!ELEMENT area %ho; EMPTY>
+<!--end of area.element-->]]>
+
+<!-- bug number/symbol override or initialization -->
+<!-- to any related information -->
+<!-- Units: unit of measure in which coordinates in this
+		area are expressed; inherits from AreaSet and AreaSpec -->
+<!-- OtherUnits: User-defined units -->
+
+
+<!ENTITY % area.attlist "INCLUDE">
+<![%area.attlist;[
+<!ATTLIST area
+		%label.attrib;
+		%linkends.attrib;
+		units		(calspair
+				|linecolumn
+				|linerange
+				|linecolumnpair
+				|other)		#IMPLIED
+		otherunits	NMTOKEN		#IMPLIED
+		coords		CDATA		#REQUIRED
+		%idreq.common.attrib;
+		%area.role.attrib;
+		%local.area.attrib;
+>
+<!--end of area.attlist-->]]>
+<!--end of area.module-->]]>
+
+<!ENTITY % areaset.module "INCLUDE">
+<![%areaset.module;[
+<!ENTITY % local.areaset.attrib "">
+<!ENTITY % areaset.role.attrib "%role.attrib;">
+
+<!ENTITY % areaset.element "INCLUDE">
+<![%areaset.element;[
+<!ELEMENT areaset %ho; (area+)>
+<!--end of areaset.element-->]]>
+
+<!-- bug number/symbol override or initialization -->
+<!-- Units: unit of measure in which coordinates in this
+		area are expressed; inherits from AreaSpec -->
+
+
+<!ENTITY % areaset.attlist "INCLUDE">
+<![%areaset.attlist;[
+<!ATTLIST areaset
+		%label.attrib;
+		units		(calspair
+				|linecolumn
+				|linerange
+				|linecolumnpair
+				|other)		#IMPLIED
+		otherunits	NMTOKEN		#IMPLIED
+		coords		CDATA		#REQUIRED
+		%idreq.common.attrib;
+		%areaset.role.attrib;
+		%local.areaset.attrib;
+>
+<!--end of areaset.attlist-->]]>
+<!--end of areaset.module-->]]>
+<!--end of areaspec.content.module-->]]>
+
+<!ENTITY % programlisting.module "INCLUDE">
+<![%programlisting.module;[
+<!ENTITY % local.programlisting.attrib "">
+<!ENTITY % programlisting.role.attrib "%role.attrib;">
+
+<!ENTITY % programlisting.element "INCLUDE">
+<![%programlisting.element;[
+<!ELEMENT programlisting %ho; (%para.char.mix;|co|coref|lineannotation|textobject)*>
+<!--end of programlisting.element-->]]>
+
+<!ENTITY % programlisting.attlist "INCLUDE">
+<![%programlisting.attlist;[
+<!ATTLIST programlisting
+		%width.attrib;
+		%linespecific.attrib;
+		%common.attrib;
+		%programlisting.role.attrib;
+		%local.programlisting.attrib;
+>
+<!--end of programlisting.attlist-->]]>
+<!--end of programlisting.module-->]]>
+
+<!ENTITY % literallayout.module "INCLUDE">
+<![%literallayout.module;[
+<!ENTITY % local.literallayout.attrib "">
+<!ENTITY % literallayout.role.attrib "%role.attrib;">
+
+<!ENTITY % literallayout.element "INCLUDE">
+<![%literallayout.element;[
+<!ELEMENT literallayout %ho; (%para.char.mix;|co|coref|textobject|lineannotation)*>
+<!--end of literallayout.element-->]]>
+
+<!ENTITY % literallayout.attlist "INCLUDE">
+<![%literallayout.attlist;[
+<!ATTLIST literallayout
+		%width.attrib;
+		%linespecific.attrib;
+		class	(monospaced|normal)	"normal"
+		%common.attrib;
+		%literallayout.role.attrib;
+		%local.literallayout.attrib;
+>
+<!--end of literallayout.attlist-->]]>
+<!-- LineAnnotation (defined in the Inlines section, below)-->
+<!--end of literallayout.module-->]]>
+
+<!ENTITY % screenco.module "INCLUDE">
+<![%screenco.module;[
+<!ENTITY % local.screenco.attrib "">
+<!ENTITY % screenco.role.attrib "%role.attrib;">
+
+<!ENTITY % screenco.element "INCLUDE">
+<![%screenco.element;[
+<!ELEMENT screenco %ho; (areaspec, screen, calloutlist*)>
+<!--end of screenco.element-->]]>
+
+<!ENTITY % screenco.attlist "INCLUDE">
+<![%screenco.attlist;[
+<!ATTLIST screenco
+		%common.attrib;
+		%screenco.role.attrib;
+		%local.screenco.attrib;
+>
+<!--end of screenco.attlist-->]]>
+<!-- AreaSpec (defined above)-->
+<!-- CalloutList (defined above in Lists)-->
+<!--end of screenco.module-->]]>
+
+<!ENTITY % screen.module "INCLUDE">
+<![%screen.module;[
+<!ENTITY % local.screen.attrib "">
+<!ENTITY % screen.role.attrib "%role.attrib;">
+
+<!ENTITY % screen.element "INCLUDE">
+<![%screen.element;[
+<!ELEMENT screen %ho; (%para.char.mix;|co|coref|textobject|lineannotation)*>
+<!--end of screen.element-->]]>
+
+<!ENTITY % screen.attlist "INCLUDE">
+<![%screen.attlist;[
+<!ATTLIST screen
+		%width.attrib;
+		%linespecific.attrib;
+		%common.attrib;
+		%screen.role.attrib;
+		%local.screen.attrib;
+>
+<!--end of screen.attlist-->]]>
+<!--end of screen.module-->]]>
+
+<!ENTITY % screenshot.content.module "INCLUDE">
+<![%screenshot.content.module;[
+<!ENTITY % screenshot.module "INCLUDE">
+<![%screenshot.module;[
+<!ENTITY % local.screenshot.attrib "">
+<!ENTITY % screenshot.role.attrib "%role.attrib;">
+
+<!ENTITY % screenshot.element "INCLUDE">
+<![%screenshot.element;[
+<!ELEMENT screenshot %ho; (screeninfo?,
+                      (graphic|graphicco
+                      |mediaobject|mediaobjectco))>
+<!--end of screenshot.element-->]]>
+
+<!ENTITY % screenshot.attlist "INCLUDE">
+<![%screenshot.attlist;[
+<!ATTLIST screenshot
+		%common.attrib;
+		%screenshot.role.attrib;
+		%local.screenshot.attrib;
+>
+<!--end of screenshot.attlist-->]]>
+<!--end of screenshot.module-->]]>
+
+<!ENTITY % screeninfo.module "INCLUDE">
+<![%screeninfo.module;[
+<!ENTITY % local.screeninfo.attrib "">
+<!ENTITY % screeninfo.role.attrib "%role.attrib;">
+
+<!ENTITY % screeninfo.element "INCLUDE">
+<![%screeninfo.element;[
+<!ELEMENT screeninfo %ho; (%para.char.mix;)*
+		%ubiq.exclusion;>
+<!--end of screeninfo.element-->]]>
+
+<!ENTITY % screeninfo.attlist "INCLUDE">
+<![%screeninfo.attlist;[
+<!ATTLIST screeninfo
+		%common.attrib;
+		%screeninfo.role.attrib;
+		%local.screeninfo.attrib;
+>
+<!--end of screeninfo.attlist-->]]>
+<!--end of screeninfo.module-->]]>
+<!--end of screenshot.content.module-->]]>
+
+<!-- Figures etc. ..................... -->
+
+<!ENTITY % figure.module "INCLUDE">
+<![%figure.module;[
+<!ENTITY % local.figure.attrib "">
+<!ENTITY % figure.role.attrib "%role.attrib;">
+
+<!ENTITY % figure.element "INCLUDE">
+<![%figure.element;[
+<!ELEMENT figure %ho; (blockinfo?, (%formalobject.title.content;),
+                       (%figure.mix; | %link.char.class;)+)>
+<!--end of figure.element-->]]>
+
+<!-- Float: Whether the Figure is supposed to be rendered
+		where convenient (yes (1) value) or at the place it occurs
+		in the text (no (0) value, the default) -->
+
+
+<!ENTITY % figure.attlist "INCLUDE">
+<![%figure.attlist;[
+<!ATTLIST figure
+		float		%yesorno.attvals;	'0'
+		floatstyle	CDATA			#IMPLIED
+		pgwide      	%yesorno.attvals;       #IMPLIED
+		%label.attrib;
+		%common.attrib;
+		%figure.role.attrib;
+		%local.figure.attrib;
+>
+<!--end of figure.attlist-->]]>
+<!--end of figure.module-->]]>
+
+<!ENTITY % informalfigure.module "INCLUDE">
+<![ %informalfigure.module; [
+<!ENTITY % local.informalfigure.attrib "">
+<!ENTITY % informalfigure.role.attrib "%role.attrib;">
+
+<!ENTITY % informalfigure.element "INCLUDE">
+<![ %informalfigure.element; [
+<!ELEMENT informalfigure %ho; (blockinfo?, (%figure.mix; | %link.char.class;)+)>
+<!--end of informalfigure.element-->]]>
+
+<!ENTITY % informalfigure.attlist "INCLUDE">
+<![ %informalfigure.attlist; [
+<!--
+Float: Whether the Figure is supposed to be rendered
+where convenient (yes (1) value) or at the place it occurs
+in the text (no (0) value, the default)
+-->
+<!ATTLIST informalfigure
+		float		%yesorno.attvals;	"0"
+		floatstyle	CDATA			#IMPLIED
+		pgwide      	%yesorno.attvals;       #IMPLIED
+		%label.attrib;
+		%common.attrib;
+		%informalfigure.role.attrib;
+		%local.informalfigure.attrib;
+>
+<!--end of informalfigure.attlist-->]]>
+<!--end of informalfigure.module-->]]>
+
+<!ENTITY % graphicco.module "INCLUDE">
+<![%graphicco.module;[
+<!ENTITY % local.graphicco.attrib "">
+<!ENTITY % graphicco.role.attrib "%role.attrib;">
+
+<!ENTITY % graphicco.element "INCLUDE">
+<![%graphicco.element;[
+<!ELEMENT graphicco %ho; (areaspec, graphic, calloutlist*)>
+<!--end of graphicco.element-->]]>
+
+<!ENTITY % graphicco.attlist "INCLUDE">
+<![%graphicco.attlist;[
+<!ATTLIST graphicco
+		%common.attrib;
+		%graphicco.role.attrib;
+		%local.graphicco.attrib;
+>
+<!--end of graphicco.attlist-->]]>
+<!-- AreaSpec (defined above in Examples)-->
+<!-- CalloutList (defined above in Lists)-->
+<!--end of graphicco.module-->]]>
+
+<!-- Graphical data can be the content of Graphic, or you can reference
+     an external file either as an entity (Entitref) or a filename
+     (Fileref). -->
+
+<!ENTITY % graphic.module "INCLUDE">
+<![%graphic.module;[
+<!ENTITY % local.graphic.attrib "">
+<!ENTITY % graphic.role.attrib "%role.attrib;">
+
+<!ENTITY % graphic.element "INCLUDE">
+<![%graphic.element;[
+<!ELEMENT graphic %ho; EMPTY>
+<!--end of graphic.element-->]]>
+
+<!ENTITY % graphic.attlist "INCLUDE">
+<![%graphic.attlist;[
+<!ATTLIST graphic
+		%graphics.attrib;
+		%common.attrib;
+		%graphic.role.attrib;
+		%local.graphic.attrib;
+>
+<!--end of graphic.attlist-->]]>
+<!--end of graphic.module-->]]>
+
+<!ENTITY % inlinegraphic.module "INCLUDE">
+<![%inlinegraphic.module;[
+<!ENTITY % local.inlinegraphic.attrib "">
+<!ENTITY % inlinegraphic.role.attrib "%role.attrib;">
+
+<!ENTITY % inlinegraphic.element "INCLUDE">
+<![%inlinegraphic.element;[
+<!ELEMENT inlinegraphic %ho; EMPTY>
+<!--end of inlinegraphic.element-->]]>
+
+<!ENTITY % inlinegraphic.attlist "INCLUDE">
+<![%inlinegraphic.attlist;[
+<!ATTLIST inlinegraphic
+		%graphics.attrib;
+		%common.attrib;
+		%inlinegraphic.role.attrib;
+		%local.inlinegraphic.attrib;
+>
+<!--end of inlinegraphic.attlist-->]]>
+<!--end of inlinegraphic.module-->]]>
+
+<!ENTITY % mediaobject.content.module "INCLUDE">
+<![ %mediaobject.content.module; [
+
+<!ENTITY % mediaobject.module "INCLUDE">
+<![ %mediaobject.module; [
+<!ENTITY % local.mediaobject.attrib "">
+<!ENTITY % mediaobject.role.attrib "%role.attrib;">
+
+<!ENTITY % mediaobject.element "INCLUDE">
+<![ %mediaobject.element; [
+<!ELEMENT mediaobject %ho; (objectinfo?,
+                           (%mediaobject.mix;)+,
+			   caption?)>
+<!--end of mediaobject.element-->]]>
+
+<!ENTITY % mediaobject.attlist "INCLUDE">
+<![ %mediaobject.attlist; [
+<!ATTLIST mediaobject
+		%common.attrib;
+		%mediaobject.role.attrib;
+		%local.mediaobject.attrib;
+>
+<!--end of mediaobject.attlist-->]]>
+<!--end of mediaobject.module-->]]>
+
+<!ENTITY % inlinemediaobject.module "INCLUDE">
+<![ %inlinemediaobject.module; [
+<!ENTITY % local.inlinemediaobject.attrib "">
+<!ENTITY % inlinemediaobject.role.attrib "%role.attrib;">
+
+<!ENTITY % inlinemediaobject.element "INCLUDE">
+<![ %inlinemediaobject.element; [
+<!ELEMENT inlinemediaobject %ho; (objectinfo?,
+                	         (%mediaobject.mix;)+)>
+<!--end of inlinemediaobject.element-->]]>
+
+<!ENTITY % inlinemediaobject.attlist "INCLUDE">
+<![ %inlinemediaobject.attlist; [
+<!ATTLIST inlinemediaobject
+		%common.attrib;
+		%inlinemediaobject.role.attrib;
+		%local.inlinemediaobject.attrib;
+>
+<!--end of inlinemediaobject.attlist-->]]>
+<!--end of inlinemediaobject.module-->]]>
+
+<!ENTITY % videoobject.module "INCLUDE">
+<![ %videoobject.module; [
+<!ENTITY % local.videoobject.attrib "">
+<!ENTITY % videoobject.role.attrib "%role.attrib;">
+
+<!ENTITY % videoobject.element "INCLUDE">
+<![ %videoobject.element; [
+<!ELEMENT videoobject %ho; (objectinfo?, videodata)>
+<!--end of videoobject.element-->]]>
+
+<!ENTITY % videoobject.attlist "INCLUDE">
+<![ %videoobject.attlist; [
+<!ATTLIST videoobject
+		%common.attrib;
+		%videoobject.role.attrib;
+		%local.videoobject.attrib;
+>
+<!--end of videoobject.attlist-->]]>
+<!--end of videoobject.module-->]]>
+
+<!ENTITY % audioobject.module "INCLUDE">
+<![ %audioobject.module; [
+<!ENTITY % local.audioobject.attrib "">
+<!ENTITY % audioobject.role.attrib "%role.attrib;">
+
+<!ENTITY % audioobject.element "INCLUDE">
+<![ %audioobject.element; [
+<!ELEMENT audioobject %ho; (objectinfo?, audiodata)>
+<!--end of audioobject.element-->]]>
+
+<!ENTITY % audioobject.attlist "INCLUDE">
+<![ %audioobject.attlist; [
+<!ATTLIST audioobject
+		%common.attrib;
+		%audioobject.role.attrib;
+		%local.audioobject.attrib;
+>
+<!--end of audioobject.attlist-->]]>
+<!--end of audioobject.module-->]]>
+
+<!ENTITY % imageobject.module "INCLUDE">
+<![ %imageobject.module; [
+<!ENTITY % local.imageobject.attrib "">
+<!ENTITY % imageobject.role.attrib "%role.attrib;">
+
+<!ENTITY % imageobject.element "INCLUDE">
+<![ %imageobject.element; [
+<!ELEMENT imageobject %ho; (objectinfo?, imagedata)>
+<!--end of imageobject.element-->]]>
+
+<!ENTITY % imageobject.attlist "INCLUDE">
+<![ %imageobject.attlist; [
+<!ATTLIST imageobject
+		%common.attrib;
+		%imageobject.role.attrib;
+		%local.imageobject.attrib;
+>
+<!--end of imageobject.attlist-->]]>
+<!--end of imageobject.module-->]]>
+
+<!ENTITY % textobject.module "INCLUDE">
+<![ %textobject.module; [
+<!ENTITY % local.textobject.attrib "">
+<!ENTITY % textobject.role.attrib "%role.attrib;">
+
+<!ENTITY % textobject.element "INCLUDE">
+<![ %textobject.element; [
+<!ELEMENT textobject %ho; (objectinfo?, (phrase|textdata|(%textobject.mix;)+))>
+<!--end of textobject.element-->]]>
+
+<!ENTITY % textobject.attlist "INCLUDE">
+<![ %textobject.attlist; [
+<!ATTLIST textobject
+		%common.attrib;
+		%textobject.role.attrib;
+		%local.textobject.attrib;
+>
+<!--end of textobject.attlist-->]]>
+<!--end of textobject.module-->]]>
+
+<!ENTITY % objectinfo.module "INCLUDE">
+<![ %objectinfo.module; [
+<!ENTITY % local.objectinfo.attrib "">
+<!ENTITY % objectinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % objectinfo.element "INCLUDE">
+<![ %objectinfo.element; [
+<!ELEMENT objectinfo %ho; ((%info.class;)+)
+	%beginpage.exclusion;>
+<!--end of objectinfo.element-->]]>
+
+<!ENTITY % objectinfo.attlist "INCLUDE">
+<![ %objectinfo.attlist; [
+<!ATTLIST objectinfo
+		%common.attrib;
+		%objectinfo.role.attrib;
+		%local.objectinfo.attrib;
+>
+<!--end of objectinfo.attlist-->]]>
+<!--end of objectinfo.module-->]]>
+
+<!--EntityRef: Name of an external entity containing the content
+	of the object data-->
+<!--FileRef: Filename, qualified by a pathname if desired,
+	designating the file containing the content of the object data-->
+<!--Format: Notation of the element content, if any-->
+<!--SrcCredit: Information about the source of the image-->
+<!ENTITY % local.objectdata.attrib "">
+<!ENTITY % objectdata.attrib
+	"
+	entityref	ENTITY		#IMPLIED
+	fileref 	CDATA		#IMPLIED
+	format		(%notation.class;)
+					#IMPLIED
+	srccredit	CDATA		#IMPLIED
+	%local.objectdata.attrib;"
+>
+
+<!ENTITY % videodata.module "INCLUDE">
+<![ %videodata.module; [
+<!ENTITY % local.videodata.attrib "">
+<!ENTITY % videodata.role.attrib "%role.attrib;">
+
+<!ENTITY % videodata.element "INCLUDE">
+<![ %videodata.element; [
+<!ELEMENT videodata %ho; EMPTY>
+<!--end of videodata.element-->]]>
+
+<!ENTITY % videodata.attlist "INCLUDE">
+<![ %videodata.attlist; [
+
+<!--Width: Same as CALS reprowid (desired width)-->
+<!--Depth: Same as CALS reprodep (desired depth)-->
+<!--Align: Same as CALS hplace with 'none' removed; #IMPLIED means
+	application-specific-->
+<!--Scale: Conflation of CALS hscale and vscale-->
+<!--Scalefit: Same as CALS scalefit-->
+<!ATTLIST videodata
+	width		CDATA		#IMPLIED
+	contentwidth	CDATA		#IMPLIED
+	depth		CDATA		#IMPLIED
+	contentdepth	CDATA		#IMPLIED
+	align		(left
+			|right
+			|center)	#IMPLIED
+	valign		(top
+			|middle
+			|bottom)	#IMPLIED
+	scale		CDATA		#IMPLIED
+	scalefit	%yesorno.attvals;
+					#IMPLIED
+		%objectdata.attrib;
+		%common.attrib;
+		%videodata.role.attrib;
+		%local.videodata.attrib;
+>
+<!--end of videodata.attlist-->]]>
+<!--end of videodata.module-->]]>
+
+<!ENTITY % audiodata.module "INCLUDE">
+<![ %audiodata.module; [
+<!ENTITY % local.audiodata.attrib "">
+<!ENTITY % audiodata.role.attrib "%role.attrib;">
+
+<!ENTITY % audiodata.element "INCLUDE">
+<![ %audiodata.element; [
+<!ELEMENT audiodata %ho; EMPTY>
+<!--end of audiodata.element-->]]>
+
+<!ENTITY % audiodata.attlist "INCLUDE">
+<![ %audiodata.attlist; [
+<!ATTLIST audiodata
+		%objectdata.attrib;
+		%common.attrib;
+		%audiodata.role.attrib;
+		%local.audiodata.attrib;
+>
+<!--end of audiodata.attlist-->]]>
+<!--end of audiodata.module-->]]>
+
+<!ENTITY % imagedata.module "INCLUDE">
+<![ %imagedata.module; [
+<!ENTITY % local.imagedata.attrib "">
+<!ENTITY % imagedata.role.attrib "%role.attrib;">
+
+<!ENTITY % imagedata.element "INCLUDE">
+<![ %imagedata.element; [
+<!ELEMENT imagedata %ho; EMPTY>
+<!--end of imagedata.element-->]]>
+
+<!ENTITY % imagedata.attlist "INCLUDE">
+<![ %imagedata.attlist; [
+
+<!--Width: Same as CALS reprowid (desired width)-->
+<!--Depth: Same as CALS reprodep (desired depth)-->
+<!--Align: Same as CALS hplace with 'none' removed; #IMPLIED means
+	application-specific-->
+<!--Scale: Conflation of CALS hscale and vscale-->
+<!--Scalefit: Same as CALS scalefit-->
+<!ATTLIST imagedata
+	width		CDATA		#IMPLIED
+	contentwidth	CDATA		#IMPLIED
+	depth		CDATA		#IMPLIED
+	contentdepth	CDATA		#IMPLIED
+	align		(left
+			|right
+			|center)	#IMPLIED
+	valign		(top
+			|middle
+			|bottom)	#IMPLIED
+	scale		CDATA		#IMPLIED
+	scalefit	%yesorno.attvals;
+					#IMPLIED
+		%objectdata.attrib;
+		%common.attrib;
+		%imagedata.role.attrib;
+		%local.imagedata.attrib;
+>
+<!--end of imagedata.attlist-->]]>
+<!--end of imagedata.module-->]]>
+
+<!ENTITY % textdata.module "INCLUDE">
+<![ %textdata.module; [
+<!ENTITY % local.textdata.attrib "">
+<!ENTITY % textdata.role.attrib "%role.attrib;">
+
+<!ENTITY % textdata.element "INCLUDE">
+<![ %textdata.element; [
+<!ELEMENT textdata %ho; EMPTY>
+<!--end of textdata.element-->]]>
+
+<!ENTITY % textdata.attlist "INCLUDE">
+<![ %textdata.attlist; [
+<!ATTLIST textdata
+		encoding	CDATA	#IMPLIED
+		%objectdata.attrib;
+		%common.attrib;
+		%textdata.role.attrib;
+		%local.textdata.attrib;
+>
+<!--end of textdata.attlist-->]]>
+<!--end of textdata.module-->]]>
+
+<!ENTITY % mediaobjectco.module "INCLUDE">
+<![ %mediaobjectco.module; [
+<!ENTITY % local.mediaobjectco.attrib "">
+<!ENTITY % mediaobjectco.role.attrib "%role.attrib;">
+
+<!ENTITY % mediaobjectco.element "INCLUDE">
+<![ %mediaobjectco.element; [
+<!ELEMENT mediaobjectco %ho; (objectinfo?, imageobjectco,
+			   (imageobjectco|textobject)*)>
+<!--end of mediaobjectco.element-->]]>
+
+<!ENTITY % mediaobjectco.attlist "INCLUDE">
+<![ %mediaobjectco.attlist; [
+<!ATTLIST mediaobjectco
+		%common.attrib;
+		%mediaobjectco.role.attrib;
+		%local.mediaobjectco.attrib;
+>
+<!--end of mediaobjectco.attlist-->]]>
+<!--end of mediaobjectco.module-->]]>
+
+<!ENTITY % imageobjectco.module "INCLUDE">
+<![ %imageobjectco.module; [
+<!ENTITY % local.imageobjectco.attrib "">
+<!ENTITY % imageobjectco.role.attrib "%role.attrib;">
+
+<!ENTITY % imageobjectco.element "INCLUDE">
+<![ %imageobjectco.element; [
+<!ELEMENT imageobjectco %ho; (areaspec, imageobject, calloutlist*)>
+<!--end of imageobjectco.element-->]]>
+
+<!ENTITY % imageobjectco.attlist "INCLUDE">
+<![ %imageobjectco.attlist; [
+<!ATTLIST imageobjectco
+		%common.attrib;
+		%imageobjectco.role.attrib;
+		%local.imageobjectco.attrib;
+>
+<!--end of imageobjectco.attlist-->]]>
+<!--end of imageobjectco.module-->]]>
+<!--end of mediaobject.content.module-->]]>
+
+<!-- Equations ........................ -->
+
+<!-- This PE provides a mechanism for replacing equation content, -->
+<!-- perhaps adding a new or different model (e.g., MathML) -->
+<!ENTITY % equation.content "(alt?, (graphic+|mediaobject+))">
+<!ENTITY % inlineequation.content "(alt?, (graphic+|inlinemediaobject+))">
+
+<!ENTITY % equation.module "INCLUDE">
+<![%equation.module;[
+<!ENTITY % local.equation.attrib "">
+<!ENTITY % equation.role.attrib "%role.attrib;">
+
+<!ENTITY % equation.element "INCLUDE">
+<![%equation.element;[
+<!ELEMENT equation %ho; (blockinfo?, (%formalobject.title.content;)?,
+                         (informalequation | %equation.content;))>
+<!--end of equation.element-->]]>
+
+<!ENTITY % equation.attlist "INCLUDE">
+<![%equation.attlist;[
+<!ATTLIST equation
+		floatstyle	CDATA			#IMPLIED
+		%label.attrib;
+	 	%common.attrib;
+		%equation.role.attrib;
+		%local.equation.attrib;
+>
+<!--end of equation.attlist-->]]>
+<!--end of equation.module-->]]>
+
+<!ENTITY % informalequation.module "INCLUDE">
+<![%informalequation.module;[
+<!ENTITY % local.informalequation.attrib "">
+<!ENTITY % informalequation.role.attrib "%role.attrib;">
+
+<!ENTITY % informalequation.element "INCLUDE">
+<![%informalequation.element;[
+<!ELEMENT informalequation %ho; (blockinfo?, %equation.content;) >
+<!--end of informalequation.element-->]]>
+
+<!ENTITY % informalequation.attlist "INCLUDE">
+<![%informalequation.attlist;[
+<!ATTLIST informalequation
+		floatstyle	CDATA			#IMPLIED
+		%common.attrib;
+		%informalequation.role.attrib;
+		%local.informalequation.attrib;
+>
+<!--end of informalequation.attlist-->]]>
+<!--end of informalequation.module-->]]>
+
+<!ENTITY % inlineequation.module "INCLUDE">
+<![%inlineequation.module;[
+<!ENTITY % local.inlineequation.attrib "">
+<!ENTITY % inlineequation.role.attrib "%role.attrib;">
+
+<!ENTITY % inlineequation.element "INCLUDE">
+<![%inlineequation.element;[
+<!ELEMENT inlineequation %ho; (%inlineequation.content;)>
+<!--end of inlineequation.element-->]]>
+
+<!ENTITY % inlineequation.attlist "INCLUDE">
+<![%inlineequation.attlist;[
+<!ATTLIST inlineequation
+		%common.attrib;
+		%inlineequation.role.attrib;
+		%local.inlineequation.attrib;
+>
+<!--end of inlineequation.attlist-->]]>
+<!--end of inlineequation.module-->]]>
+
+<!ENTITY % alt.module "INCLUDE">
+<![%alt.module;[
+<!ENTITY % local.alt.attrib "">
+<!ENTITY % alt.role.attrib "%role.attrib;">
+
+<!ENTITY % alt.element "INCLUDE">
+<![%alt.element;[
+<!ELEMENT alt %ho; (#PCDATA)>
+<!--end of alt.element-->]]>
+
+<!ENTITY % alt.attlist "INCLUDE">
+<![%alt.attlist;[
+<!ATTLIST alt
+		%common.attrib;
+		%alt.role.attrib;
+		%local.alt.attrib;
+>
+<!--end of alt.attlist-->]]>
+<!--end of alt.module-->]]>
+
+<!-- Tables ........................... -->
+
+<!ENTITY % table.module "INCLUDE">
+<![%table.module;[
+
+<!-- Choose a table model. CALS or OASIS XML Exchange -->
+
+<!ENTITY % cals.table.module "INCLUDE">
+<![%cals.table.module;[
+<!ENTITY % exchange.table.module "IGNORE">
+]]>
+<!ENTITY % exchange.table.module "INCLUDE">
+
+<!-- Do we allow the HTML table model as well? -->
+<!ENTITY % allow.html.tables "INCLUDE">
+<![%allow.html.tables;[
+  <!-- ====================================================== -->
+  <!--  xhtmltbl.mod defines HTML tables and sets parameter
+        entities so that, when the CALS table module is read,
+        we end up allowing any table to be CALS or HTML.
+        i.e. This include must come first!                    -->
+  <!-- ====================================================== -->
+
+<!ENTITY % htmltbl
+  PUBLIC "-//OASIS//ELEMENTS DocBook XML HTML Tables V4.4//EN"
+  "htmltblx.mod">
+%htmltbl;
+<!--end of allow.html.tables-->]]>
+
+<!ENTITY % tables.role.attrib "%role.attrib;">
+
+<![%cals.table.module;[
+<!-- Add label and role attributes to table and informaltable -->
+<!ENTITY % bodyatt "
+		floatstyle	CDATA			#IMPLIED
+		rowheader	(firstcol|norowheader)	#IMPLIED
+                %label.attrib;"
+>
+
+<!-- Add common attributes to Table, TGroup, TBody, THead, TFoot, Row,
+     EntryTbl, and Entry (and InformalTable element). -->
+<!ENTITY % secur
+	"%common.attrib;
+	%tables.role.attrib;">
+
+<!ENTITY % common.table.attribs
+	"%bodyatt;
+	%secur;">
+
+<!-- Content model for Table. -->
+<!ENTITY % tbl.table.mdl
+	"(blockinfo?, (%formalobject.title.content;), (%ndxterm.class;)*,
+	  textobject*,
+          (graphic+|mediaobject+|tgroup+))">
+
+<!-- Allow either objects or inlines; beware of REs between elements. -->
+<!ENTITY % tbl.entry.mdl "%para.char.mix; | %tabentry.mix;">
+
+<!-- Reference CALS Table Model -->
+<!ENTITY % tablemodel
+  PUBLIC "-//OASIS//DTD DocBook CALS Table Model V4.4//EN"
+  "calstblx.dtd">
+]]>
+
+<![%exchange.table.module;[
+<!-- Add common attributes and the Label attribute to Table and -->
+<!-- InformalTable.                                             -->
+<!ENTITY % bodyatt
+	"%common.attrib;
+	rowheader	(firstcol|norowheader)	#IMPLIED
+	%label.attrib;
+	%tables.role.attrib;">
+
+<!ENTITY % common.table.attribs
+	"%bodyatt;">
+
+<!-- Add common attributes to TGroup, ColSpec, TBody, THead, Row, Entry -->
+
+<!ENTITY % tbl.tgroup.att       "%common.attrib;">
+<!ENTITY % tbl.colspec.att      "%common.attrib;">
+<!ENTITY % tbl.tbody.att        "%common.attrib;">
+<!ENTITY % tbl.thead.att        "%common.attrib;">
+<!ENTITY % tbl.row.att          "%common.attrib;">
+<!ENTITY % tbl.entry.att        "%common.attrib;">
+
+<!-- Content model for Table. -->
+<!ENTITY % tbl.table.mdl
+	"(blockinfo?, (%formalobject.title.content;), (%ndxterm.class;)*,
+	  textobject*,
+          (graphic+|mediaobject+|tgroup+))">
+
+<!-- Allow either objects or inlines; beware of REs between elements. -->
+<!ENTITY % tbl.entry.mdl "(%para.char.mix; | %tabentry.mix;)*">
+
+<!-- Reference OASIS Exchange Table Model -->
+<!ENTITY % tablemodel
+  PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN"
+  "soextblx.dtd">
+]]>
+
+%tablemodel;
+
+<!--end of table.module-->]]>
+
+<!ENTITY % informaltable.module "INCLUDE">
+<![%informaltable.module;[
+
+<!-- Note that InformalTable is dependent on some of the entity
+     declarations that customize Table. -->
+
+<!ENTITY % local.informaltable.attrib "">
+
+<!-- the following entity may have been declared by the XHTML table module -->
+<!ENTITY % informal.tbl.table.mdl "textobject*, (graphic+|mediaobject+|tgroup+)">
+
+<!ENTITY % informaltable.element "INCLUDE">
+<![%informaltable.element;[
+<!ELEMENT informaltable %ho; (blockinfo?, (%informal.tbl.table.mdl;))>
+<!--end of informaltable.element-->]]>
+
+<!-- Frame, Colsep, and Rowsep must be repeated because
+		they are not in entities in the table module. -->
+<!-- includes TabStyle, ToCentry, ShortEntry,
+				Orient, PgWide -->
+<!-- includes Label -->
+<!-- includes common attributes -->
+
+<!ENTITY % informaltable.attlist "INCLUDE">
+<![%informaltable.attlist;[
+<!ATTLIST informaltable
+		frame		(%tbl.frame.attval;)	#IMPLIED
+		colsep		%yesorno.attvals;	#IMPLIED
+		rowsep		%yesorno.attvals;	#IMPLIED
+		%common.table.attribs;
+		%tbl.table.att;
+		%local.informaltable.attrib;
+>
+<!--end of informaltable.attlist-->]]>
+<!--end of informaltable.module-->]]>
+
+<!ENTITY % caption.module "INCLUDE">
+<![ %caption.module; [
+<!ENTITY % local.caption.attrib "">
+<!ENTITY % caption.role.attrib "%role.attrib;">
+
+<!ENTITY % caption.element "INCLUDE">
+<![ %caption.element; [
+<!ELEMENT caption %ho; (#PCDATA | %textobject.mix;)*>
+<!--end of caption.element-->]]>
+
+<!ENTITY % caption.attlist "INCLUDE">
+<![ %caption.attlist; [
+<!-- attrs comes from HTML tables ... -->
+
+<![ %allow.html.tables; [
+<!-- common.attrib, but without ID because ID is in attrs -->
+<!ENTITY % caption.attlist.content "
+	%lang.attrib;
+	%remap.attrib;
+	%xreflabel.attrib;
+	%revisionflag.attrib;
+	%effectivity.attrib;
+	%dir.attrib;
+	%xml-base.attrib;
+	%local.common.attrib;
+		%caption.role.attrib;
+		%attrs;
+		align	(top|bottom|left|right)	#IMPLIED
+		%local.caption.attrib;
+">
+]]>
+<!ENTITY % caption.attlist.content "
+		%common.attrib;
+		%caption.role.attrib;
+		%local.caption.attrib;
+">
+
+<!ATTLIST caption %caption.attlist.content;>
+
+<!--end of caption.attlist-->]]>
+<!--end of caption.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Synopses ............................................................. -->
+
+<!-- Synopsis ......................... -->
+
+<!ENTITY % synopsis.module "INCLUDE">
+<![%synopsis.module;[
+<!ENTITY % local.synopsis.attrib "">
+<!ENTITY % synopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % synopsis.element "INCLUDE">
+<![%synopsis.element;[
+<!ELEMENT synopsis %ho; (%para.char.mix;|graphic|mediaobject|co|coref|textobject|lineannotation)*>
+<!--end of synopsis.element-->]]>
+
+<!ENTITY % synopsis.attlist "INCLUDE">
+<![%synopsis.attlist;[
+<!ATTLIST synopsis
+		%label.attrib;
+		%linespecific.attrib;
+		%common.attrib;
+		%synopsis.role.attrib;
+		%local.synopsis.attrib;
+>
+<!--end of synopsis.attlist-->]]>
+
+<!-- LineAnnotation (defined in the Inlines section, below)-->
+<!--end of synopsis.module-->]]>
+
+<!-- CmdSynopsis ...................... -->
+
+<!ENTITY % cmdsynopsis.content.module "INCLUDE">
+<![%cmdsynopsis.content.module;[
+<!ENTITY % cmdsynopsis.module "INCLUDE">
+<![%cmdsynopsis.module;[
+<!ENTITY % local.cmdsynopsis.attrib "">
+<!ENTITY % cmdsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % cmdsynopsis.element "INCLUDE">
+<![%cmdsynopsis.element;[
+<!ELEMENT cmdsynopsis %ho; ((command | arg | group | sbr)+, synopfragment*)>
+<!--end of cmdsynopsis.element-->]]>
+
+<!-- Sepchar: Character that should separate command and all
+		top-level arguments; alternate value might be e.g., &Delta; -->
+
+
+<!ENTITY % cmdsynopsis.attlist "INCLUDE">
+<![%cmdsynopsis.attlist;[
+<!ATTLIST cmdsynopsis
+		%label.attrib;
+		sepchar		CDATA		" "
+		cmdlength	CDATA		#IMPLIED
+		%common.attrib;
+		%cmdsynopsis.role.attrib;
+		%local.cmdsynopsis.attrib;
+>
+<!--end of cmdsynopsis.attlist-->]]>
+<!--end of cmdsynopsis.module-->]]>
+
+<!ENTITY % arg.module "INCLUDE">
+<![%arg.module;[
+<!ENTITY % local.arg.attrib "">
+<!ENTITY % arg.role.attrib "%role.attrib;">
+
+<!ENTITY % arg.element "INCLUDE">
+<![%arg.element;[
+<!ELEMENT arg %ho; (#PCDATA
+		| arg
+		| group
+		| option
+		| synopfragmentref
+		| replaceable
+		| sbr)*>
+<!--end of arg.element-->]]>
+
+<!-- Choice: Whether Arg must be supplied: Opt (optional to
+		supply, e.g. [arg]; the default), Req (required to supply,
+		e.g. {arg}), or Plain (required to supply, e.g. arg) -->
+<!-- Rep: whether Arg is repeatable: Norepeat (e.g. arg without
+		ellipsis; the default), or Repeat (e.g. arg...) -->
+
+
+<!ENTITY % arg.attlist "INCLUDE">
+<![%arg.attlist;[
+<!ATTLIST arg
+		choice		(opt
+				|req
+				|plain)		'opt'
+		rep		(norepeat
+				|repeat)	'norepeat'
+		%common.attrib;
+		%arg.role.attrib;
+		%local.arg.attrib;
+>
+<!--end of arg.attlist-->]]>
+<!--end of arg.module-->]]>
+
+<!ENTITY % group.module "INCLUDE">
+<![%group.module;[
+
+<!ENTITY % local.group.attrib "">
+<!ENTITY % group.role.attrib "%role.attrib;">
+
+<!ENTITY % group.element "INCLUDE">
+<![%group.element;[
+<!ELEMENT group %ho; ((arg | group | option | synopfragmentref
+		| replaceable | sbr)+)>
+<!--end of group.element-->]]>
+
+<!-- Choice: Whether Group must be supplied: Opt (optional to
+		supply, e.g.  [g1|g2|g3]; the default), Req (required to
+		supply, e.g.  {g1|g2|g3}), Plain (required to supply,
+		e.g.  g1|g2|g3), OptMult (can supply zero or more, e.g.
+		[[g1|g2|g3]]), or ReqMult (must supply one or more, e.g.
+		{{g1|g2|g3}}) -->
+<!-- Rep: whether Group is repeatable: Norepeat (e.g. group
+		without ellipsis; the default), or Repeat (e.g. group...) -->
+
+
+<!ENTITY % group.attlist "INCLUDE">
+<![%group.attlist;[
+<!ATTLIST group
+		choice		(opt
+				|req
+				|plain)         'opt'
+		rep		(norepeat
+				|repeat)	'norepeat'
+		%common.attrib;
+		%group.role.attrib;
+		%local.group.attrib;
+>
+<!--end of group.attlist-->]]>
+<!--end of group.module-->]]>
+
+<!ENTITY % sbr.module "INCLUDE">
+<![%sbr.module;[
+<!ENTITY % local.sbr.attrib "">
+<!-- Synopsis break -->
+<!ENTITY % sbr.role.attrib "%role.attrib;">
+
+<!ENTITY % sbr.element "INCLUDE">
+<![%sbr.element;[
+<!ELEMENT sbr %ho; EMPTY>
+<!--end of sbr.element-->]]>
+
+<!ENTITY % sbr.attlist "INCLUDE">
+<![%sbr.attlist;[
+<!ATTLIST sbr
+		%common.attrib;
+		%sbr.role.attrib;
+		%local.sbr.attrib;
+>
+<!--end of sbr.attlist-->]]>
+<!--end of sbr.module-->]]>
+
+<!ENTITY % synopfragmentref.module "INCLUDE">
+<![%synopfragmentref.module;[
+<!ENTITY % local.synopfragmentref.attrib "">
+<!ENTITY % synopfragmentref.role.attrib "%role.attrib;">
+
+<!ENTITY % synopfragmentref.element "INCLUDE">
+<![%synopfragmentref.element;[
+<!ELEMENT synopfragmentref %ho; (#PCDATA)>
+<!--end of synopfragmentref.element-->]]>
+
+<!-- to SynopFragment of complex synopsis
+			material for separate referencing -->
+
+
+<!ENTITY % synopfragmentref.attlist "INCLUDE">
+<![%synopfragmentref.attlist;[
+<!ATTLIST synopfragmentref
+		%linkendreq.attrib;		%common.attrib;
+		%synopfragmentref.role.attrib;
+		%local.synopfragmentref.attrib;
+>
+<!--end of synopfragmentref.attlist-->]]>
+<!--end of synopfragmentref.module-->]]>
+
+<!ENTITY % synopfragment.module "INCLUDE">
+<![%synopfragment.module;[
+<!ENTITY % local.synopfragment.attrib "">
+<!ENTITY % synopfragment.role.attrib "%role.attrib;">
+
+<!ENTITY % synopfragment.element "INCLUDE">
+<![%synopfragment.element;[
+<!ELEMENT synopfragment %ho; ((arg | group)+)>
+<!--end of synopfragment.element-->]]>
+
+<!ENTITY % synopfragment.attlist "INCLUDE">
+<![%synopfragment.attlist;[
+<!ATTLIST synopfragment
+		%idreq.common.attrib;
+		%synopfragment.role.attrib;
+		%local.synopfragment.attrib;
+>
+<!--end of synopfragment.attlist-->]]>
+<!--end of synopfragment.module-->]]>
+
+<!-- Command (defined in the Inlines section, below)-->
+<!-- Option (defined in the Inlines section, below)-->
+<!-- Replaceable (defined in the Inlines section, below)-->
+<!--end of cmdsynopsis.content.module-->]]>
+
+<!-- FuncSynopsis ..................... -->
+
+<!ENTITY % funcsynopsis.content.module "INCLUDE">
+<![%funcsynopsis.content.module;[
+<!ENTITY % funcsynopsis.module "INCLUDE">
+<![%funcsynopsis.module;[
+
+<!ENTITY % local.funcsynopsis.attrib "">
+<!ENTITY % funcsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % funcsynopsis.element "INCLUDE">
+<![%funcsynopsis.element;[
+<!ELEMENT funcsynopsis %ho; ((funcsynopsisinfo | funcprototype)+)>
+<!--end of funcsynopsis.element-->]]>
+
+<!ENTITY % funcsynopsis.attlist "INCLUDE">
+<![%funcsynopsis.attlist;[
+<!ATTLIST funcsynopsis
+		%label.attrib;
+		%common.attrib;
+		%funcsynopsis.role.attrib;
+		%local.funcsynopsis.attrib;
+>
+<!--end of funcsynopsis.attlist-->]]>
+<!--end of funcsynopsis.module-->]]>
+
+<!ENTITY % funcsynopsisinfo.module "INCLUDE">
+<![%funcsynopsisinfo.module;[
+<!ENTITY % local.funcsynopsisinfo.attrib "">
+<!ENTITY % funcsynopsisinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % funcsynopsisinfo.element "INCLUDE">
+<![%funcsynopsisinfo.element;[
+<!ELEMENT funcsynopsisinfo %ho; (%cptr.char.mix;|textobject|lineannotation)*>
+<!--end of funcsynopsisinfo.element-->]]>
+
+<!ENTITY % funcsynopsisinfo.attlist "INCLUDE">
+<![%funcsynopsisinfo.attlist;[
+<!ATTLIST funcsynopsisinfo
+		%linespecific.attrib;
+		%common.attrib;
+		%funcsynopsisinfo.role.attrib;
+		%local.funcsynopsisinfo.attrib;
+>
+<!--end of funcsynopsisinfo.attlist-->]]>
+<!--end of funcsynopsisinfo.module-->]]>
+
+<!ENTITY % funcprototype.module "INCLUDE">
+<![%funcprototype.module;[
+<!ENTITY % local.funcprototype.attrib "">
+<!ENTITY % funcprototype.role.attrib "%role.attrib;">
+
+<!ENTITY % funcprototype.element "INCLUDE">
+<![%funcprototype.element;[
+<!ELEMENT funcprototype %ho; (modifier*,
+                              funcdef,
+                              (void|varargs|(paramdef+, varargs?)),
+                              modifier*)>
+
+<!--end of funcprototype.element-->]]>
+
+<!ENTITY % funcprototype.attlist "INCLUDE">
+<![%funcprototype.attlist;[
+<!ATTLIST funcprototype
+		%common.attrib;
+		%funcprototype.role.attrib;
+		%local.funcprototype.attrib;
+>
+<!--end of funcprototype.attlist-->]]>
+<!--end of funcprototype.module-->]]>
+
+<!ENTITY % funcdef.module "INCLUDE">
+<![%funcdef.module;[
+<!ENTITY % local.funcdef.attrib "">
+<!ENTITY % funcdef.role.attrib "%role.attrib;">
+
+<!ENTITY % funcdef.element "INCLUDE">
+<![%funcdef.element;[
+<!ELEMENT funcdef %ho; (#PCDATA
+		| type
+		| replaceable
+		| function)*>
+<!--end of funcdef.element-->]]>
+
+<!ENTITY % funcdef.attlist "INCLUDE">
+<![%funcdef.attlist;[
+<!ATTLIST funcdef
+		%common.attrib;
+		%funcdef.role.attrib;
+		%local.funcdef.attrib;
+>
+<!--end of funcdef.attlist-->]]>
+<!--end of funcdef.module-->]]>
+
+<!ENTITY % void.module "INCLUDE">
+<![%void.module;[
+<!ENTITY % local.void.attrib "">
+<!ENTITY % void.role.attrib "%role.attrib;">
+
+<!ENTITY % void.element "INCLUDE">
+<![%void.element;[
+<!ELEMENT void %ho; EMPTY>
+<!--end of void.element-->]]>
+
+<!ENTITY % void.attlist "INCLUDE">
+<![%void.attlist;[
+<!ATTLIST void
+		%common.attrib;
+		%void.role.attrib;
+		%local.void.attrib;
+>
+<!--end of void.attlist-->]]>
+<!--end of void.module-->]]>
+
+<!ENTITY % varargs.module "INCLUDE">
+<![%varargs.module;[
+<!ENTITY % local.varargs.attrib "">
+<!ENTITY % varargs.role.attrib "%role.attrib;">
+
+<!ENTITY % varargs.element "INCLUDE">
+<![%varargs.element;[
+<!ELEMENT varargs %ho; EMPTY>
+<!--end of varargs.element-->]]>
+
+<!ENTITY % varargs.attlist "INCLUDE">
+<![%varargs.attlist;[
+<!ATTLIST varargs
+		%common.attrib;
+		%varargs.role.attrib;
+		%local.varargs.attrib;
+>
+<!--end of varargs.attlist-->]]>
+<!--end of varargs.module-->]]>
+
+<!-- Processing assumes that only one Parameter will appear in a
+     ParamDef, and that FuncParams will be used at most once, for
+     providing information on the "inner parameters" for parameters that
+     are pointers to functions. -->
+
+<!ENTITY % paramdef.module "INCLUDE">
+<![%paramdef.module;[
+<!ENTITY % local.paramdef.attrib "">
+<!ENTITY % paramdef.role.attrib "%role.attrib;">
+
+<!ENTITY % paramdef.element "INCLUDE">
+<![%paramdef.element;[
+<!ELEMENT paramdef %ho; (#PCDATA
+                | initializer
+		| type
+		| replaceable
+		| parameter
+		| funcparams)*>
+<!--end of paramdef.element-->]]>
+
+<!ENTITY % paramdef.attlist "INCLUDE">
+<![%paramdef.attlist;[
+<!ATTLIST paramdef
+		choice		(opt
+				|req)	#IMPLIED
+		%common.attrib;
+		%paramdef.role.attrib;
+		%local.paramdef.attrib;
+>
+<!--end of paramdef.attlist-->]]>
+<!--end of paramdef.module-->]]>
+
+<!ENTITY % funcparams.module "INCLUDE">
+<![%funcparams.module;[
+<!ENTITY % local.funcparams.attrib "">
+<!ENTITY % funcparams.role.attrib "%role.attrib;">
+
+<!ENTITY % funcparams.element "INCLUDE">
+<![%funcparams.element;[
+<!ELEMENT funcparams %ho; (%cptr.char.mix;)*>
+<!--end of funcparams.element-->]]>
+
+<!ENTITY % funcparams.attlist "INCLUDE">
+<![%funcparams.attlist;[
+<!ATTLIST funcparams
+		%common.attrib;
+		%funcparams.role.attrib;
+		%local.funcparams.attrib;
+>
+<!--end of funcparams.attlist-->]]>
+<!--end of funcparams.module-->]]>
+
+<!-- LineAnnotation (defined in the Inlines section, below)-->
+<!-- Replaceable (defined in the Inlines section, below)-->
+<!-- Function (defined in the Inlines section, below)-->
+<!-- Parameter (defined in the Inlines section, below)-->
+<!--end of funcsynopsis.content.module-->]]>
+
+<!-- ClassSynopsis ..................... -->
+
+<!ENTITY % classsynopsis.content.module "INCLUDE">
+<![%classsynopsis.content.module;[
+
+<!ENTITY % classsynopsis.module "INCLUDE">
+<![%classsynopsis.module;[
+<!ENTITY % local.classsynopsis.attrib "">
+<!ENTITY % classsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % classsynopsis.element "INCLUDE">
+<![%classsynopsis.element;[
+<!ELEMENT classsynopsis %ho; ((ooclass|oointerface|ooexception)+,
+                         (classsynopsisinfo
+                          |fieldsynopsis|%method.synop.class;)*)>
+<!--end of classsynopsis.element-->]]>
+
+<!ENTITY % classsynopsis.attlist "INCLUDE">
+<![%classsynopsis.attlist;[
+<!ATTLIST classsynopsis
+	language	CDATA	#IMPLIED
+	class	(class|interface)	"class"
+	%common.attrib;
+	%classsynopsis.role.attrib;
+	%local.classsynopsis.attrib;
+>
+<!--end of classsynopsis.attlist-->]]>
+<!--end of classsynopsis.module-->]]>
+
+<!ENTITY % classsynopsisinfo.module "INCLUDE">
+<![ %classsynopsisinfo.module; [
+<!ENTITY % local.classsynopsisinfo.attrib "">
+<!ENTITY % classsynopsisinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % classsynopsisinfo.element "INCLUDE">
+<![ %classsynopsisinfo.element; [
+<!ELEMENT classsynopsisinfo %ho; (%cptr.char.mix;|textobject|lineannotation)*>
+<!--end of classsynopsisinfo.element-->]]>
+
+<!ENTITY % classsynopsisinfo.attlist "INCLUDE">
+<![ %classsynopsisinfo.attlist; [
+<!ATTLIST classsynopsisinfo
+		%linespecific.attrib;
+		%common.attrib;
+		%classsynopsisinfo.role.attrib;
+		%local.classsynopsisinfo.attrib;
+>
+<!--end of classsynopsisinfo.attlist-->]]>
+<!--end of classsynopsisinfo.module-->]]>
+
+<!ENTITY % ooclass.module "INCLUDE">
+<![%ooclass.module;[
+<!ENTITY % local.ooclass.attrib "">
+<!ENTITY % ooclass.role.attrib "%role.attrib;">
+
+<!ENTITY % ooclass.element "INCLUDE">
+<![%ooclass.element;[
+<!ELEMENT ooclass %ho; ((modifier|package)*, classname)>
+<!--end of ooclass.element-->]]>
+
+<!ENTITY % ooclass.attlist "INCLUDE">
+<![%ooclass.attlist;[
+<!ATTLIST ooclass
+	%common.attrib;
+	%ooclass.role.attrib;
+	%local.ooclass.attrib;
+>
+<!--end of ooclass.attlist-->]]>
+<!--end of ooclass.module-->]]>
+
+<!ENTITY % oointerface.module "INCLUDE">
+<![%oointerface.module;[
+<!ENTITY % local.oointerface.attrib "">
+<!ENTITY % oointerface.role.attrib "%role.attrib;">
+
+<!ENTITY % oointerface.element "INCLUDE">
+<![%oointerface.element;[
+<!ELEMENT oointerface %ho; ((modifier|package)*, interfacename)>
+<!--end of oointerface.element-->]]>
+
+<!ENTITY % oointerface.attlist "INCLUDE">
+<![%oointerface.attlist;[
+<!ATTLIST oointerface
+	%common.attrib;
+	%oointerface.role.attrib;
+	%local.oointerface.attrib;
+>
+<!--end of oointerface.attlist-->]]>
+<!--end of oointerface.module-->]]>
+
+<!ENTITY % ooexception.module "INCLUDE">
+<![%ooexception.module;[
+<!ENTITY % local.ooexception.attrib "">
+<!ENTITY % ooexception.role.attrib "%role.attrib;">
+
+<!ENTITY % ooexception.element "INCLUDE">
+<![%ooexception.element;[
+<!ELEMENT ooexception %ho; ((modifier|package)*, exceptionname)>
+<!--end of ooexception.element-->]]>
+
+<!ENTITY % ooexception.attlist "INCLUDE">
+<![%ooexception.attlist;[
+<!ATTLIST ooexception
+	%common.attrib;
+	%ooexception.role.attrib;
+	%local.ooexception.attrib;
+>
+<!--end of ooexception.attlist-->]]>
+<!--end of ooexception.module-->]]>
+
+<!ENTITY % modifier.module "INCLUDE">
+<![%modifier.module;[
+<!ENTITY % local.modifier.attrib "">
+<!ENTITY % modifier.role.attrib "%role.attrib;">
+
+<!ENTITY % modifier.element "INCLUDE">
+<![%modifier.element;[
+<!ELEMENT modifier %ho; (%smallcptr.char.mix;)*>
+<!--end of modifier.element-->]]>
+
+<!ENTITY % modifier.attlist "INCLUDE">
+<![%modifier.attlist;[
+<!ATTLIST modifier
+	%common.attrib;
+	%modifier.role.attrib;
+	%local.modifier.attrib;
+>
+<!--end of modifier.attlist-->]]>
+<!--end of modifier.module-->]]>
+
+<!ENTITY % interfacename.module "INCLUDE">
+<![%interfacename.module;[
+<!ENTITY % local.interfacename.attrib "">
+<!ENTITY % interfacename.role.attrib "%role.attrib;">
+
+<!ENTITY % interfacename.element "INCLUDE">
+<![%interfacename.element;[
+<!ELEMENT interfacename %ho; (%cptr.char.mix;)*>
+<!--end of interfacename.element-->]]>
+
+<!ENTITY % interfacename.attlist "INCLUDE">
+<![%interfacename.attlist;[
+<!ATTLIST interfacename
+	%common.attrib;
+	%interfacename.role.attrib;
+	%local.interfacename.attrib;
+>
+<!--end of interfacename.attlist-->]]>
+<!--end of interfacename.module-->]]>
+
+<!ENTITY % exceptionname.module "INCLUDE">
+<![%exceptionname.module;[
+<!ENTITY % local.exceptionname.attrib "">
+<!ENTITY % exceptionname.role.attrib "%role.attrib;">
+
+<!ENTITY % exceptionname.element "INCLUDE">
+<![%exceptionname.element;[
+<!ELEMENT exceptionname %ho; (%smallcptr.char.mix;)*>
+<!--end of exceptionname.element-->]]>
+
+<!ENTITY % exceptionname.attlist "INCLUDE">
+<![%exceptionname.attlist;[
+<!ATTLIST exceptionname
+	%common.attrib;
+	%exceptionname.role.attrib;
+	%local.exceptionname.attrib;
+>
+<!--end of exceptionname.attlist-->]]>
+<!--end of exceptionname.module-->]]>
+
+<!ENTITY % fieldsynopsis.module "INCLUDE">
+<![%fieldsynopsis.module;[
+<!ENTITY % local.fieldsynopsis.attrib "">
+<!ENTITY % fieldsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % fieldsynopsis.element "INCLUDE">
+<![%fieldsynopsis.element;[
+<!ELEMENT fieldsynopsis %ho; (modifier*, type?, varname, initializer?)>
+<!--end of fieldsynopsis.element-->]]>
+
+<!ENTITY % fieldsynopsis.attlist "INCLUDE">
+<![%fieldsynopsis.attlist;[
+<!ATTLIST fieldsynopsis
+	language	CDATA	#IMPLIED
+	%common.attrib;
+	%fieldsynopsis.role.attrib;
+	%local.fieldsynopsis.attrib;
+>
+<!--end of fieldsynopsis.attlist-->]]>
+<!--end of fieldsynopsis.module-->]]>
+
+<!ENTITY % initializer.module "INCLUDE">
+<![%initializer.module;[
+<!ENTITY % local.initializer.attrib "">
+<!ENTITY % initializer.role.attrib "%role.attrib;">
+
+<!ENTITY % initializer.element "INCLUDE">
+<![%initializer.element;[
+<!ELEMENT initializer %ho; (%smallcptr.char.mix;)*>
+<!--end of initializer.element-->]]>
+
+<!ENTITY % initializer.attlist "INCLUDE">
+<![%initializer.attlist;[
+<!ATTLIST initializer
+	%common.attrib;
+	%initializer.role.attrib;
+	%local.initializer.attrib;
+>
+<!--end of initializer.attlist-->]]>
+<!--end of initializer.module-->]]>
+
+<!ENTITY % constructorsynopsis.module "INCLUDE">
+<![%constructorsynopsis.module;[
+<!ENTITY % local.constructorsynopsis.attrib "">
+<!ENTITY % constructorsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % constructorsynopsis.element "INCLUDE">
+<![%constructorsynopsis.element;[
+<!ELEMENT constructorsynopsis %ho; (modifier*,
+                               methodname?,
+                               (methodparam+|void?),
+                               exceptionname*)>
+<!--end of constructorsynopsis.element-->]]>
+
+<!ENTITY % constructorsynopsis.attlist "INCLUDE">
+<![%constructorsynopsis.attlist;[
+<!ATTLIST constructorsynopsis
+	language	CDATA	#IMPLIED
+	%common.attrib;
+	%constructorsynopsis.role.attrib;
+	%local.constructorsynopsis.attrib;
+>
+<!--end of constructorsynopsis.attlist-->]]>
+<!--end of constructorsynopsis.module-->]]>
+
+<!ENTITY % destructorsynopsis.module "INCLUDE">
+<![%destructorsynopsis.module;[
+<!ENTITY % local.destructorsynopsis.attrib "">
+<!ENTITY % destructorsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % destructorsynopsis.element "INCLUDE">
+<![%destructorsynopsis.element;[
+<!ELEMENT destructorsynopsis %ho; (modifier*,
+                              methodname?,
+                              (methodparam+|void?),
+                              exceptionname*)>
+<!--end of destructorsynopsis.element-->]]>
+
+<!ENTITY % destructorsynopsis.attlist "INCLUDE">
+<![%destructorsynopsis.attlist;[
+<!ATTLIST destructorsynopsis
+	language	CDATA	#IMPLIED
+	%common.attrib;
+	%destructorsynopsis.role.attrib;
+	%local.destructorsynopsis.attrib;
+>
+<!--end of destructorsynopsis.attlist-->]]>
+<!--end of destructorsynopsis.module-->]]>
+
+<!ENTITY % methodsynopsis.module "INCLUDE">
+<![%methodsynopsis.module;[
+<!ENTITY % local.methodsynopsis.attrib "">
+<!ENTITY % methodsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % methodsynopsis.element "INCLUDE">
+<![%methodsynopsis.element;[
+<!ELEMENT methodsynopsis %ho; (modifier*,
+                          (type|void)?,
+                          methodname,
+                          (methodparam+|void?),
+                          exceptionname*,
+                          modifier*)>
+<!--end of methodsynopsis.element-->]]>
+
+<!ENTITY % methodsynopsis.attlist "INCLUDE">
+<![%methodsynopsis.attlist;[
+<!ATTLIST methodsynopsis
+	language	CDATA	#IMPLIED
+	%common.attrib;
+	%methodsynopsis.role.attrib;
+	%local.methodsynopsis.attrib;
+>
+<!--end of methodsynopsis.attlist-->]]>
+<!--end of methodsynopsis.module-->]]>
+
+<!ENTITY % methodname.module "INCLUDE">
+<![%methodname.module;[
+<!ENTITY % local.methodname.attrib "">
+<!ENTITY % methodname.role.attrib "%role.attrib;">
+
+<!ENTITY % methodname.element "INCLUDE">
+<![%methodname.element;[
+<!ELEMENT methodname %ho; (%smallcptr.char.mix;)*>
+<!--end of methodname.element-->]]>
+
+<!ENTITY % methodname.attlist "INCLUDE">
+<![%methodname.attlist;[
+<!ATTLIST methodname
+	%common.attrib;
+	%methodname.role.attrib;
+	%local.methodname.attrib;
+>
+<!--end of methodname.attlist-->]]>
+<!--end of methodname.module-->]]>
+
+<!ENTITY % methodparam.module "INCLUDE">
+<![%methodparam.module;[
+<!ENTITY % local.methodparam.attrib "">
+<!ENTITY % methodparam.role.attrib "%role.attrib;">
+
+<!ENTITY % methodparam.element "INCLUDE">
+<![%methodparam.element;[
+<!ELEMENT methodparam %ho; (modifier*,
+                       type?,
+                       ((parameter,initializer?)|funcparams),
+                       modifier*)>
+<!--end of methodparam.element-->]]>
+
+<!ENTITY % methodparam.attlist "INCLUDE">
+<![%methodparam.attlist;[
+<!ATTLIST methodparam
+	choice		(opt
+			|req
+			|plain)		"req"
+	rep		(norepeat
+			|repeat)	"norepeat"
+	%common.attrib;
+	%methodparam.role.attrib;
+	%local.methodparam.attrib;
+>
+<!--end of methodparam.attlist-->]]>
+<!--end of methodparam.module-->]]>
+<!--end of classsynopsis.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Document information entities and elements ........................... -->
+
+<!-- The document information elements include some elements that are
+     currently used only in the document hierarchy module. They are
+     defined here so that they will be available for use in customized
+     document hierarchies. -->
+
+<!-- .................................. -->
+
+<!ENTITY % docinfo.content.module "INCLUDE">
+<![%docinfo.content.module;[
+
+<!-- Ackno ............................ -->
+
+<!ENTITY % ackno.module "INCLUDE">
+<![%ackno.module;[
+<!ENTITY % local.ackno.attrib "">
+<!ENTITY % ackno.role.attrib "%role.attrib;">
+
+<!ENTITY % ackno.element "INCLUDE">
+<![%ackno.element;[
+<!ELEMENT ackno %ho; (%docinfo.char.mix;)*>
+<!--end of ackno.element-->]]>
+
+<!ENTITY % ackno.attlist "INCLUDE">
+<![%ackno.attlist;[
+<!ATTLIST ackno
+		%common.attrib;
+		%ackno.role.attrib;
+		%local.ackno.attrib;
+>
+<!--end of ackno.attlist-->]]>
+<!--end of ackno.module-->]]>
+
+<!-- Address .......................... -->
+
+<!ENTITY % address.content.module "INCLUDE">
+<![%address.content.module;[
+<!ENTITY % address.module "INCLUDE">
+<![%address.module;[
+<!ENTITY % local.address.attrib "">
+<!ENTITY % address.role.attrib "%role.attrib;">
+
+<!ENTITY % address.element "INCLUDE">
+<![%address.element;[
+<!ELEMENT address %ho; (#PCDATA|personname|%person.ident.mix;
+		|street|pob|postcode|city|state|country|phone
+		|fax|email|otheraddr)*>
+<!--end of address.element-->]]>
+
+<!ENTITY % address.attlist "INCLUDE">
+<![%address.attlist;[
+<!ATTLIST address
+		%linespecific.attrib;
+		%common.attrib;
+		%address.role.attrib;
+		%local.address.attrib;
+>
+<!--end of address.attlist-->]]>
+<!--end of address.module-->]]>
+
+  <!ENTITY % street.module "INCLUDE">
+  <![%street.module;[
+ <!ENTITY % local.street.attrib "">
+  <!ENTITY % street.role.attrib "%role.attrib;">
+
+<!ENTITY % street.element "INCLUDE">
+<![%street.element;[
+<!ELEMENT street %ho; (%docinfo.char.mix;)*>
+<!--end of street.element-->]]>
+
+<!ENTITY % street.attlist "INCLUDE">
+<![%street.attlist;[
+<!ATTLIST street
+		%common.attrib;
+		%street.role.attrib;
+		%local.street.attrib;
+>
+<!--end of street.attlist-->]]>
+  <!--end of street.module-->]]>
+
+  <!ENTITY % pob.module "INCLUDE">
+  <![%pob.module;[
+  <!ENTITY % local.pob.attrib "">
+  <!ENTITY % pob.role.attrib "%role.attrib;">
+
+<!ENTITY % pob.element "INCLUDE">
+<![%pob.element;[
+<!ELEMENT pob %ho; (%docinfo.char.mix;)*>
+<!--end of pob.element-->]]>
+
+<!ENTITY % pob.attlist "INCLUDE">
+<![%pob.attlist;[
+<!ATTLIST pob
+		%common.attrib;
+		%pob.role.attrib;
+		%local.pob.attrib;
+>
+<!--end of pob.attlist-->]]>
+  <!--end of pob.module-->]]>
+
+  <!ENTITY % postcode.module "INCLUDE">
+  <![%postcode.module;[
+  <!ENTITY % local.postcode.attrib "">
+  <!ENTITY % postcode.role.attrib "%role.attrib;">
+
+<!ENTITY % postcode.element "INCLUDE">
+<![%postcode.element;[
+<!ELEMENT postcode %ho; (%docinfo.char.mix;)*>
+<!--end of postcode.element-->]]>
+
+<!ENTITY % postcode.attlist "INCLUDE">
+<![%postcode.attlist;[
+<!ATTLIST postcode
+		%common.attrib;
+		%postcode.role.attrib;
+		%local.postcode.attrib;
+>
+<!--end of postcode.attlist-->]]>
+  <!--end of postcode.module-->]]>
+
+  <!ENTITY % city.module "INCLUDE">
+  <![%city.module;[
+  <!ENTITY % local.city.attrib "">
+  <!ENTITY % city.role.attrib "%role.attrib;">
+
+<!ENTITY % city.element "INCLUDE">
+<![%city.element;[
+<!ELEMENT city %ho; (%docinfo.char.mix;)*>
+<!--end of city.element-->]]>
+
+<!ENTITY % city.attlist "INCLUDE">
+<![%city.attlist;[
+<!ATTLIST city
+		%common.attrib;
+		%city.role.attrib;
+		%local.city.attrib;
+>
+<!--end of city.attlist-->]]>
+  <!--end of city.module-->]]>
+
+  <!ENTITY % state.module "INCLUDE">
+  <![%state.module;[
+  <!ENTITY % local.state.attrib "">
+  <!ENTITY % state.role.attrib "%role.attrib;">
+
+<!ENTITY % state.element "INCLUDE">
+<![%state.element;[
+<!ELEMENT state %ho; (%docinfo.char.mix;)*>
+<!--end of state.element-->]]>
+
+<!ENTITY % state.attlist "INCLUDE">
+<![%state.attlist;[
+<!ATTLIST state
+		%common.attrib;
+		%state.role.attrib;
+		%local.state.attrib;
+>
+<!--end of state.attlist-->]]>
+  <!--end of state.module-->]]>
+
+  <!ENTITY % country.module "INCLUDE">
+  <![%country.module;[
+  <!ENTITY % local.country.attrib "">
+  <!ENTITY % country.role.attrib "%role.attrib;">
+
+<!ENTITY % country.element "INCLUDE">
+<![%country.element;[
+<!ELEMENT country %ho; (%docinfo.char.mix;)*>
+<!--end of country.element-->]]>
+
+<!ENTITY % country.attlist "INCLUDE">
+<![%country.attlist;[
+<!ATTLIST country
+		%common.attrib;
+		%country.role.attrib;
+		%local.country.attrib;
+>
+<!--end of country.attlist-->]]>
+  <!--end of country.module-->]]>
+
+  <!ENTITY % phone.module "INCLUDE">
+  <![%phone.module;[
+  <!ENTITY % local.phone.attrib "">
+  <!ENTITY % phone.role.attrib "%role.attrib;">
+
+<!ENTITY % phone.element "INCLUDE">
+<![%phone.element;[
+<!ELEMENT phone %ho; (%docinfo.char.mix;)*>
+<!--end of phone.element-->]]>
+
+<!ENTITY % phone.attlist "INCLUDE">
+<![%phone.attlist;[
+<!ATTLIST phone
+		%common.attrib;
+		%phone.role.attrib;
+		%local.phone.attrib;
+>
+<!--end of phone.attlist-->]]>
+  <!--end of phone.module-->]]>
+
+  <!ENTITY % fax.module "INCLUDE">
+  <![%fax.module;[
+  <!ENTITY % local.fax.attrib "">
+  <!ENTITY % fax.role.attrib "%role.attrib;">
+
+<!ENTITY % fax.element "INCLUDE">
+<![%fax.element;[
+<!ELEMENT fax %ho; (%docinfo.char.mix;)*>
+<!--end of fax.element-->]]>
+
+<!ENTITY % fax.attlist "INCLUDE">
+<![%fax.attlist;[
+<!ATTLIST fax
+		%common.attrib;
+		%fax.role.attrib;
+		%local.fax.attrib;
+>
+<!--end of fax.attlist-->]]>
+  <!--end of fax.module-->]]>
+
+  <!-- Email (defined in the Inlines section, below)-->
+
+  <!ENTITY % otheraddr.module "INCLUDE">
+  <![%otheraddr.module;[
+  <!ENTITY % local.otheraddr.attrib "">
+  <!ENTITY % otheraddr.role.attrib "%role.attrib;">
+
+<!ENTITY % otheraddr.element "INCLUDE">
+<![%otheraddr.element;[
+<!ELEMENT otheraddr %ho; (%docinfo.char.mix;)*>
+<!--end of otheraddr.element-->]]>
+
+<!ENTITY % otheraddr.attlist "INCLUDE">
+<![%otheraddr.attlist;[
+<!ATTLIST otheraddr
+		%common.attrib;
+		%otheraddr.role.attrib;
+		%local.otheraddr.attrib;
+>
+<!--end of otheraddr.attlist-->]]>
+  <!--end of otheraddr.module-->]]>
+<!--end of address.content.module-->]]>
+
+<!-- Affiliation ...................... -->
+
+<!ENTITY % affiliation.content.module "INCLUDE">
+<![%affiliation.content.module;[
+<!ENTITY % affiliation.module "INCLUDE">
+<![%affiliation.module;[
+<!ENTITY % local.affiliation.attrib "">
+<!ENTITY % affiliation.role.attrib "%role.attrib;">
+
+<!ENTITY % affiliation.element "INCLUDE">
+<![%affiliation.element;[
+<!ELEMENT affiliation %ho; (shortaffil?, jobtitle*, orgname?, orgdiv*,
+		address*)>
+<!--end of affiliation.element-->]]>
+
+<!ENTITY % affiliation.attlist "INCLUDE">
+<![%affiliation.attlist;[
+<!ATTLIST affiliation
+		%common.attrib;
+		%affiliation.role.attrib;
+		%local.affiliation.attrib;
+>
+<!--end of affiliation.attlist-->]]>
+<!--end of affiliation.module-->]]>
+
+  <!ENTITY % shortaffil.module "INCLUDE">
+  <![%shortaffil.module;[
+  <!ENTITY % local.shortaffil.attrib "">
+  <!ENTITY % shortaffil.role.attrib "%role.attrib;">
+
+<!ENTITY % shortaffil.element "INCLUDE">
+<![%shortaffil.element;[
+<!ELEMENT shortaffil %ho; (%docinfo.char.mix;)*>
+<!--end of shortaffil.element-->]]>
+
+<!ENTITY % shortaffil.attlist "INCLUDE">
+<![%shortaffil.attlist;[
+<!ATTLIST shortaffil
+		%common.attrib;
+		%shortaffil.role.attrib;
+		%local.shortaffil.attrib;
+>
+<!--end of shortaffil.attlist-->]]>
+  <!--end of shortaffil.module-->]]>
+
+  <!ENTITY % jobtitle.module "INCLUDE">
+  <![%jobtitle.module;[
+  <!ENTITY % local.jobtitle.attrib "">
+  <!ENTITY % jobtitle.role.attrib "%role.attrib;">
+
+<!ENTITY % jobtitle.element "INCLUDE">
+<![%jobtitle.element;[
+<!ELEMENT jobtitle %ho; (%docinfo.char.mix;)*>
+<!--end of jobtitle.element-->]]>
+
+<!ENTITY % jobtitle.attlist "INCLUDE">
+<![%jobtitle.attlist;[
+<!ATTLIST jobtitle
+		%common.attrib;
+		%jobtitle.role.attrib;
+		%local.jobtitle.attrib;
+>
+<!--end of jobtitle.attlist-->]]>
+  <!--end of jobtitle.module-->]]>
+
+  <!-- OrgName (defined elsewhere in this section)-->
+
+  <!ENTITY % orgdiv.module "INCLUDE">
+  <![%orgdiv.module;[
+  <!ENTITY % local.orgdiv.attrib "">
+  <!ENTITY % orgdiv.role.attrib "%role.attrib;">
+
+<!ENTITY % orgdiv.element "INCLUDE">
+<![%orgdiv.element;[
+<!ELEMENT orgdiv %ho; (%docinfo.char.mix;)*>
+<!--end of orgdiv.element-->]]>
+
+<!ENTITY % orgdiv.attlist "INCLUDE">
+<![%orgdiv.attlist;[
+<!ATTLIST orgdiv
+		%common.attrib;
+		%orgdiv.role.attrib;
+		%local.orgdiv.attrib;
+>
+<!--end of orgdiv.attlist-->]]>
+  <!--end of orgdiv.module-->]]>
+
+  <!-- Address (defined elsewhere in this section)-->
+<!--end of affiliation.content.module-->]]>
+
+<!-- ArtPageNums ...................... -->
+
+<!ENTITY % artpagenums.module "INCLUDE">
+<![%artpagenums.module;[
+<!ENTITY % local.artpagenums.attrib "">
+<!ENTITY % artpagenums.role.attrib "%role.attrib;">
+
+<!ENTITY % artpagenums.element "INCLUDE">
+<![%artpagenums.element;[
+<!ELEMENT artpagenums %ho; (%docinfo.char.mix;)*>
+<!--end of artpagenums.element-->]]>
+
+<!ENTITY % artpagenums.attlist "INCLUDE">
+<![%artpagenums.attlist;[
+<!ATTLIST artpagenums
+		%common.attrib;
+		%artpagenums.role.attrib;
+		%local.artpagenums.attrib;
+>
+<!--end of artpagenums.attlist-->]]>
+<!--end of artpagenums.module-->]]>
+
+<!-- PersonName -->
+
+<!ENTITY % personname.module "INCLUDE">
+<![%personname.module;[
+<!ENTITY % local.personname.attrib "">
+<!ENTITY % personname.role.attrib "%role.attrib;">
+
+<!ENTITY % personname.element "INCLUDE">
+<![%personname.element;[
+<!ELEMENT personname %ho; ((honorific|firstname|surname|lineage|othername)+)>
+<!--end of personname.element-->]]>
+
+<!ENTITY % personname.attlist "INCLUDE">
+<![%personname.attlist;[
+<!ATTLIST personname
+		%common.attrib;
+		%personname.role.attrib;
+		%local.personname.attrib;
+>
+<!--end of personname.attlist-->]]>
+<!--end of personname.module-->]]>
+
+<!-- Author ........................... -->
+
+<!ENTITY % author.module "INCLUDE">
+<![%author.module;[
+<!ENTITY % local.author.attrib "">
+<!ENTITY % author.role.attrib "%role.attrib;">
+
+<!ENTITY % author.element "INCLUDE">
+<![%author.element;[
+<!ELEMENT author %ho; ((personname|(%person.ident.mix;)+),(personblurb|email|address)*)>
+<!--end of author.element-->]]>
+
+<!ENTITY % author.attlist "INCLUDE">
+<![%author.attlist;[
+<!ATTLIST author
+		%common.attrib;
+		%author.role.attrib;
+		%local.author.attrib;
+>
+<!--end of author.attlist-->]]>
+<!--(see "Personal identity elements" for %person.ident.mix;)-->
+<!--end of author.module-->]]>
+
+<!-- AuthorGroup ...................... -->
+
+<!ENTITY % authorgroup.content.module "INCLUDE">
+<![%authorgroup.content.module;[
+<!ENTITY % authorgroup.module "INCLUDE">
+<![%authorgroup.module;[
+<!ENTITY % local.authorgroup.attrib "">
+<!ENTITY % authorgroup.role.attrib "%role.attrib;">
+
+<!ENTITY % authorgroup.element "INCLUDE">
+<![%authorgroup.element;[
+<!ELEMENT authorgroup %ho; ((author|editor|collab|corpauthor|corpcredit|othercredit)+)>
+<!--end of authorgroup.element-->]]>
+
+<!ENTITY % authorgroup.attlist "INCLUDE">
+<![%authorgroup.attlist;[
+<!ATTLIST authorgroup
+		%common.attrib;
+		%authorgroup.role.attrib;
+		%local.authorgroup.attrib;
+>
+<!--end of authorgroup.attlist-->]]>
+<!--end of authorgroup.module-->]]>
+
+  <!-- Author (defined elsewhere in this section)-->
+  <!-- Editor (defined elsewhere in this section)-->
+
+  <!ENTITY % collab.content.module "INCLUDE">
+  <![%collab.content.module;[
+  <!ENTITY % collab.module "INCLUDE">
+  <![%collab.module;[
+  <!ENTITY % local.collab.attrib "">
+  <!ENTITY % collab.role.attrib "%role.attrib;">
+
+<!ENTITY % collab.element "INCLUDE">
+<![%collab.element;[
+<!ELEMENT collab %ho; (collabname, affiliation*)>
+<!--end of collab.element-->]]>
+
+<!ENTITY % collab.attlist "INCLUDE">
+<![%collab.attlist;[
+<!ATTLIST collab
+		%common.attrib;
+		%collab.role.attrib;
+		%local.collab.attrib;
+>
+<!--end of collab.attlist-->]]>
+  <!--end of collab.module-->]]>
+
+    <!ENTITY % collabname.module "INCLUDE">
+  <![%collabname.module;[
+  <!ENTITY % local.collabname.attrib "">
+  <!ENTITY % collabname.role.attrib "%role.attrib;">
+
+<!ENTITY % collabname.element "INCLUDE">
+<![%collabname.element;[
+<!ELEMENT collabname %ho; (%docinfo.char.mix;)*>
+<!--end of collabname.element-->]]>
+
+<!ENTITY % collabname.attlist "INCLUDE">
+<![%collabname.attlist;[
+<!ATTLIST collabname
+		%common.attrib;
+		%collabname.role.attrib;
+		%local.collabname.attrib;
+>
+<!--end of collabname.attlist-->]]>
+    <!--end of collabname.module-->]]>
+
+    <!-- Affiliation (defined elsewhere in this section)-->
+  <!--end of collab.content.module-->]]>
+
+  <!-- CorpAuthor (defined elsewhere in this section)-->
+  <!-- OtherCredit (defined elsewhere in this section)-->
+
+<!--end of authorgroup.content.module-->]]>
+
+<!-- AuthorInitials ................... -->
+
+<!ENTITY % authorinitials.module "INCLUDE">
+<![%authorinitials.module;[
+<!ENTITY % local.authorinitials.attrib "">
+<!ENTITY % authorinitials.role.attrib "%role.attrib;">
+
+<!ENTITY % authorinitials.element "INCLUDE">
+<![%authorinitials.element;[
+<!ELEMENT authorinitials %ho; (%docinfo.char.mix;)*>
+<!--end of authorinitials.element-->]]>
+
+<!ENTITY % authorinitials.attlist "INCLUDE">
+<![%authorinitials.attlist;[
+<!ATTLIST authorinitials
+		%common.attrib;
+		%authorinitials.role.attrib;
+		%local.authorinitials.attrib;
+>
+<!--end of authorinitials.attlist-->]]>
+<!--end of authorinitials.module-->]]>
+
+<!-- ConfGroup ........................ -->
+
+<!ENTITY % confgroup.content.module "INCLUDE">
+<![%confgroup.content.module;[
+<!ENTITY % confgroup.module "INCLUDE">
+<![%confgroup.module;[
+<!ENTITY % local.confgroup.attrib "">
+<!ENTITY % confgroup.role.attrib "%role.attrib;">
+
+<!ENTITY % confgroup.element "INCLUDE">
+<![%confgroup.element;[
+<!ELEMENT confgroup %ho; ((confdates|conftitle|confnum|address|confsponsor)*)>
+<!--end of confgroup.element-->]]>
+
+<!ENTITY % confgroup.attlist "INCLUDE">
+<![%confgroup.attlist;[
+<!ATTLIST confgroup
+		%common.attrib;
+		%confgroup.role.attrib;
+		%local.confgroup.attrib;
+>
+<!--end of confgroup.attlist-->]]>
+<!--end of confgroup.module-->]]>
+
+  <!ENTITY % confdates.module "INCLUDE">
+  <![%confdates.module;[
+  <!ENTITY % local.confdates.attrib "">
+  <!ENTITY % confdates.role.attrib "%role.attrib;">
+
+<!ENTITY % confdates.element "INCLUDE">
+<![%confdates.element;[
+<!ELEMENT confdates %ho; (%docinfo.char.mix;)*>
+<!--end of confdates.element-->]]>
+
+<!ENTITY % confdates.attlist "INCLUDE">
+<![%confdates.attlist;[
+<!ATTLIST confdates
+		%common.attrib;
+		%confdates.role.attrib;
+		%local.confdates.attrib;
+>
+<!--end of confdates.attlist-->]]>
+  <!--end of confdates.module-->]]>
+
+  <!ENTITY % conftitle.module "INCLUDE">
+  <![%conftitle.module;[
+  <!ENTITY % local.conftitle.attrib "">
+  <!ENTITY % conftitle.role.attrib "%role.attrib;">
+
+<!ENTITY % conftitle.element "INCLUDE">
+<![%conftitle.element;[
+<!ELEMENT conftitle %ho; (%docinfo.char.mix;)*>
+<!--end of conftitle.element-->]]>
+
+<!ENTITY % conftitle.attlist "INCLUDE">
+<![%conftitle.attlist;[
+<!ATTLIST conftitle
+		%common.attrib;
+		%conftitle.role.attrib;
+		%local.conftitle.attrib;
+>
+<!--end of conftitle.attlist-->]]>
+  <!--end of conftitle.module-->]]>
+
+  <!ENTITY % confnum.module "INCLUDE">
+  <![%confnum.module;[
+  <!ENTITY % local.confnum.attrib "">
+  <!ENTITY % confnum.role.attrib "%role.attrib;">
+
+<!ENTITY % confnum.element "INCLUDE">
+<![%confnum.element;[
+<!ELEMENT confnum %ho; (%docinfo.char.mix;)*>
+<!--end of confnum.element-->]]>
+
+<!ENTITY % confnum.attlist "INCLUDE">
+<![%confnum.attlist;[
+<!ATTLIST confnum
+		%common.attrib;
+		%confnum.role.attrib;
+		%local.confnum.attrib;
+>
+<!--end of confnum.attlist-->]]>
+  <!--end of confnum.module-->]]>
+
+  <!-- Address (defined elsewhere in this section)-->
+
+  <!ENTITY % confsponsor.module "INCLUDE">
+  <![%confsponsor.module;[
+  <!ENTITY % local.confsponsor.attrib "">
+  <!ENTITY % confsponsor.role.attrib "%role.attrib;">
+
+<!ENTITY % confsponsor.element "INCLUDE">
+<![%confsponsor.element;[
+<!ELEMENT confsponsor %ho; (%docinfo.char.mix;)*>
+<!--end of confsponsor.element-->]]>
+
+<!ENTITY % confsponsor.attlist "INCLUDE">
+<![%confsponsor.attlist;[
+<!ATTLIST confsponsor
+		%common.attrib;
+		%confsponsor.role.attrib;
+		%local.confsponsor.attrib;
+>
+<!--end of confsponsor.attlist-->]]>
+  <!--end of confsponsor.module-->]]>
+<!--end of confgroup.content.module-->]]>
+
+<!-- ContractNum ...................... -->
+
+<!ENTITY % contractnum.module "INCLUDE">
+<![%contractnum.module;[
+<!ENTITY % local.contractnum.attrib "">
+<!ENTITY % contractnum.role.attrib "%role.attrib;">
+
+<!ENTITY % contractnum.element "INCLUDE">
+<![%contractnum.element;[
+<!ELEMENT contractnum %ho; (%docinfo.char.mix;)*>
+<!--end of contractnum.element-->]]>
+
+<!ENTITY % contractnum.attlist "INCLUDE">
+<![%contractnum.attlist;[
+<!ATTLIST contractnum
+		%common.attrib;
+		%contractnum.role.attrib;
+		%local.contractnum.attrib;
+>
+<!--end of contractnum.attlist-->]]>
+<!--end of contractnum.module-->]]>
+
+<!-- ContractSponsor .................. -->
+
+<!ENTITY % contractsponsor.module "INCLUDE">
+<![%contractsponsor.module;[
+<!ENTITY % local.contractsponsor.attrib "">
+<!ENTITY % contractsponsor.role.attrib "%role.attrib;">
+
+<!ENTITY % contractsponsor.element "INCLUDE">
+<![%contractsponsor.element;[
+<!ELEMENT contractsponsor %ho; (%docinfo.char.mix;)*>
+<!--end of contractsponsor.element-->]]>
+
+<!ENTITY % contractsponsor.attlist "INCLUDE">
+<![%contractsponsor.attlist;[
+<!ATTLIST contractsponsor
+		%common.attrib;
+		%contractsponsor.role.attrib;
+		%local.contractsponsor.attrib;
+>
+<!--end of contractsponsor.attlist-->]]>
+<!--end of contractsponsor.module-->]]>
+
+<!-- Copyright ........................ -->
+
+<!ENTITY % copyright.content.module "INCLUDE">
+<![%copyright.content.module;[
+<!ENTITY % copyright.module "INCLUDE">
+<![%copyright.module;[
+<!ENTITY % local.copyright.attrib "">
+<!ENTITY % copyright.role.attrib "%role.attrib;">
+
+<!ENTITY % copyright.element "INCLUDE">
+<![%copyright.element;[
+<!ELEMENT copyright %ho; (year+, holder*)>
+<!--end of copyright.element-->]]>
+
+<!ENTITY % copyright.attlist "INCLUDE">
+<![%copyright.attlist;[
+<!ATTLIST copyright
+		%common.attrib;
+		%copyright.role.attrib;
+		%local.copyright.attrib;
+>
+<!--end of copyright.attlist-->]]>
+<!--end of copyright.module-->]]>
+
+  <!ENTITY % year.module "INCLUDE">
+  <![%year.module;[
+  <!ENTITY % local.year.attrib "">
+  <!ENTITY % year.role.attrib "%role.attrib;">
+
+<!ENTITY % year.element "INCLUDE">
+<![%year.element;[
+<!ELEMENT year %ho; (%docinfo.char.mix;)*>
+<!--end of year.element-->]]>
+
+<!ENTITY % year.attlist "INCLUDE">
+<![%year.attlist;[
+<!ATTLIST year
+		%common.attrib;
+		%year.role.attrib;
+		%local.year.attrib;
+>
+<!--end of year.attlist-->]]>
+  <!--end of year.module-->]]>
+
+  <!ENTITY % holder.module "INCLUDE">
+  <![%holder.module;[
+  <!ENTITY % local.holder.attrib "">
+  <!ENTITY % holder.role.attrib "%role.attrib;">
+
+<!ENTITY % holder.element "INCLUDE">
+<![%holder.element;[
+<!ELEMENT holder %ho; (%docinfo.char.mix;)*>
+<!--end of holder.element-->]]>
+
+<!ENTITY % holder.attlist "INCLUDE">
+<![%holder.attlist;[
+<!ATTLIST holder
+		%common.attrib;
+		%holder.role.attrib;
+		%local.holder.attrib;
+>
+<!--end of holder.attlist-->]]>
+  <!--end of holder.module-->]]>
+<!--end of copyright.content.module-->]]>
+
+<!-- CorpAuthor ....................... -->
+
+<!ENTITY % corpauthor.module "INCLUDE">
+<![%corpauthor.module;[
+<!ENTITY % local.corpauthor.attrib "">
+<!ENTITY % corpauthor.role.attrib "%role.attrib;">
+
+<!ENTITY % corpauthor.element "INCLUDE">
+<![%corpauthor.element;[
+<!ELEMENT corpauthor %ho; (%docinfo.char.mix;)*>
+<!--end of corpauthor.element-->]]>
+
+<!ENTITY % corpauthor.attlist "INCLUDE">
+<![%corpauthor.attlist;[
+<!ATTLIST corpauthor
+		%common.attrib;
+		%corpauthor.role.attrib;
+		%local.corpauthor.attrib;
+>
+<!--end of corpauthor.attlist-->]]>
+<!--end of corpauthor.module-->]]>
+
+<!-- CorpCredit ...................... -->
+
+<!ENTITY % corpcredit.module "INCLUDE">
+<![%corpcredit.module;[
+<!ENTITY % local.corpcredit.attrib "">
+<!ENTITY % corpcredit.role.attrib "%role.attrib;">
+
+<!ENTITY % corpcredit.element "INCLUDE">
+<![%corpcredit.element;[
+<!ELEMENT corpcredit %ho; (%docinfo.char.mix;)*>
+<!--end of corpcredit.element-->]]>
+
+<!ENTITY % corpcredit.attlist "INCLUDE">
+<![%corpcredit.attlist;[
+<!ATTLIST corpcredit
+		class	(graphicdesigner
+			|productioneditor
+			|copyeditor
+			|technicaleditor
+			|translator
+			|other)			#IMPLIED
+		%common.attrib;
+		%corpcredit.role.attrib;
+		%local.corpcredit.attrib;
+>
+<!--end of corpcredit.attlist-->]]>
+<!--end of corpcredit.module-->]]>
+
+<!-- CorpName ......................... -->
+
+<!ENTITY % corpname.module "INCLUDE">
+<![%corpname.module;[
+<!ENTITY % local.corpname.attrib "">
+
+<!ENTITY % corpname.element "INCLUDE">
+<![%corpname.element;[
+<!ELEMENT corpname %ho; (%docinfo.char.mix;)*>
+<!--end of corpname.element-->]]>
+<!ENTITY % corpname.role.attrib "%role.attrib;">
+
+<!ENTITY % corpname.attlist "INCLUDE">
+<![%corpname.attlist;[
+<!ATTLIST corpname
+		%common.attrib;
+		%corpname.role.attrib;
+		%local.corpname.attrib;
+>
+<!--end of corpname.attlist-->]]>
+<!--end of corpname.module-->]]>
+
+<!-- Date ............................. -->
+
+<!ENTITY % date.module "INCLUDE">
+<![%date.module;[
+<!ENTITY % local.date.attrib "">
+<!ENTITY % date.role.attrib "%role.attrib;">
+
+<!ENTITY % date.element "INCLUDE">
+<![%date.element;[
+<!ELEMENT date %ho; (%docinfo.char.mix;)*>
+<!--end of date.element-->]]>
+
+<!ENTITY % date.attlist "INCLUDE">
+<![%date.attlist;[
+<!ATTLIST date
+		%common.attrib;
+		%date.role.attrib;
+		%local.date.attrib;
+>
+<!--end of date.attlist-->]]>
+<!--end of date.module-->]]>
+
+<!-- Edition .......................... -->
+
+<!ENTITY % edition.module "INCLUDE">
+<![%edition.module;[
+<!ENTITY % local.edition.attrib "">
+<!ENTITY % edition.role.attrib "%role.attrib;">
+
+<!ENTITY % edition.element "INCLUDE">
+<![%edition.element;[
+<!ELEMENT edition %ho; (%docinfo.char.mix;)*>
+<!--end of edition.element-->]]>
+
+<!ENTITY % edition.attlist "INCLUDE">
+<![%edition.attlist;[
+<!ATTLIST edition
+		%common.attrib;
+		%edition.role.attrib;
+		%local.edition.attrib;
+>
+<!--end of edition.attlist-->]]>
+<!--end of edition.module-->]]>
+
+<!-- Editor ........................... -->
+
+<!ENTITY % editor.module "INCLUDE">
+<![%editor.module;[
+<!ENTITY % local.editor.attrib "">
+<!ENTITY % editor.role.attrib "%role.attrib;">
+
+<!ENTITY % editor.element "INCLUDE">
+<![%editor.element;[
+<!ELEMENT editor %ho; ((personname|(%person.ident.mix;)+),(personblurb|email|address)*)>
+<!--end of editor.element-->]]>
+
+<!ENTITY % editor.attlist "INCLUDE">
+<![%editor.attlist;[
+<!ATTLIST editor
+		%common.attrib;
+		%editor.role.attrib;
+		%local.editor.attrib;
+>
+<!--end of editor.attlist-->]]>
+  <!--(see "Personal identity elements" for %person.ident.mix;)-->
+<!--end of editor.module-->]]>
+
+<!-- ISBN ............................. -->
+
+<!ENTITY % isbn.module "INCLUDE">
+<![%isbn.module;[
+<!ENTITY % local.isbn.attrib "">
+<!ENTITY % isbn.role.attrib "%role.attrib;">
+
+<!ENTITY % isbn.element "INCLUDE">
+<![%isbn.element;[
+<!ELEMENT isbn %ho; (%docinfo.char.mix;)*>
+<!--end of isbn.element-->]]>
+
+<!ENTITY % isbn.attlist "INCLUDE">
+<![%isbn.attlist;[
+<!ATTLIST isbn
+		%common.attrib;
+		%isbn.role.attrib;
+		%local.isbn.attrib;
+>
+<!--end of isbn.attlist-->]]>
+<!--end of isbn.module-->]]>
+
+<!-- ISSN ............................. -->
+
+<!ENTITY % issn.module "INCLUDE">
+<![%issn.module;[
+<!ENTITY % local.issn.attrib "">
+<!ENTITY % issn.role.attrib "%role.attrib;">
+
+<!ENTITY % issn.element "INCLUDE">
+<![%issn.element;[
+<!ELEMENT issn %ho; (%docinfo.char.mix;)*>
+<!--end of issn.element-->]]>
+
+<!ENTITY % issn.attlist "INCLUDE">
+<![%issn.attlist;[
+<!ATTLIST issn
+		%common.attrib;
+		%issn.role.attrib;
+		%local.issn.attrib;
+>
+<!--end of issn.attlist-->]]>
+<!--end of issn.module-->]]>
+
+<!-- BiblioId ................. -->
+<!ENTITY % biblio.class.attrib
+		"class	(uri
+                         |doi
+                         |isbn
+                         |issn
+                         |libraryofcongress
+                         |pubnumber
+                         |other)	#IMPLIED
+		otherclass	CDATA	#IMPLIED"
+>
+
+<!ENTITY % biblioid.module "INCLUDE">
+<![%biblioid.module;[
+<!ENTITY % local.biblioid.attrib "">
+<!ENTITY % biblioid.role.attrib "%role.attrib;">
+
+<!ENTITY % biblioid.element "INCLUDE">
+<![%biblioid.element;[
+<!ELEMENT biblioid %ho; (%docinfo.char.mix;)*>
+<!--end of biblioid.element-->]]>
+
+<!ENTITY % biblioid.attlist "INCLUDE">
+<![%biblioid.attlist;[
+<!ATTLIST biblioid
+		%biblio.class.attrib;
+		%common.attrib;
+		%biblioid.role.attrib;
+		%local.biblioid.attrib;
+>
+<!--end of biblioid.attlist-->]]>
+<!--end of biblioid.module-->]]>
+
+<!-- CiteBiblioId ................. -->
+
+<!ENTITY % citebiblioid.module "INCLUDE">
+<![%citebiblioid.module;[
+<!ENTITY % local.citebiblioid.attrib "">
+<!ENTITY % citebiblioid.role.attrib "%role.attrib;">
+
+<!ENTITY % citebiblioid.element "INCLUDE">
+<![%citebiblioid.element;[
+<!ELEMENT citebiblioid %ho; (%docinfo.char.mix;)*>
+<!--end of citebiblioid.element-->]]>
+
+<!ENTITY % citebiblioid.attlist "INCLUDE">
+<![%citebiblioid.attlist;[
+<!ATTLIST citebiblioid
+		%biblio.class.attrib;
+		%common.attrib;
+		%citebiblioid.role.attrib;
+		%local.citebiblioid.attrib;
+>
+<!--end of citebiblioid.attlist-->]]>
+<!--end of citebiblioid.module-->]]>
+
+<!-- BiblioSource ................. -->
+
+<!ENTITY % bibliosource.module "INCLUDE">
+<![%bibliosource.module;[
+<!ENTITY % local.bibliosource.attrib "">
+<!ENTITY % bibliosource.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliosource.element "INCLUDE">
+<![%bibliosource.element;[
+<!ELEMENT bibliosource %ho; (%docinfo.char.mix;)*>
+<!--end of bibliosource.element-->]]>
+
+<!ENTITY % bibliosource.attlist "INCLUDE">
+<![%bibliosource.attlist;[
+<!ATTLIST bibliosource
+		%biblio.class.attrib;
+		%common.attrib;
+		%bibliosource.role.attrib;
+		%local.bibliosource.attrib;
+>
+<!--end of bibliosource.attlist-->]]>
+<!--end of bibliosource.module-->]]>
+
+<!-- BiblioRelation ................. -->
+
+<!ENTITY % bibliorelation.module "INCLUDE">
+<![%bibliorelation.module;[
+<!ENTITY % local.bibliorelation.attrib "">
+<!ENTITY % local.bibliorelation.types "">
+
+<!ENTITY % bibliorelation.type.attrib
+                "type    (isversionof
+                         |hasversion
+                         |isreplacedby
+                         |replaces
+                         |isrequiredby
+                         |requires
+                         |ispartof
+                         |haspart
+                         |isreferencedby
+                         |references
+                         |isformatof
+                         |hasformat
+                         |othertype
+                         %local.bibliorelation.types;)       #IMPLIED
+		othertype	CDATA	#IMPLIED
+">
+
+<!ENTITY % bibliorelation.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliorelation.element "INCLUDE">
+<![%bibliorelation.element;[
+<!ELEMENT bibliorelation %ho; (%docinfo.char.mix;)*>
+<!--end of bibliorelation.element-->]]>
+
+<!ENTITY % bibliorelation.attlist "INCLUDE">
+<![%bibliorelation.attlist;[
+<!ATTLIST bibliorelation
+		%biblio.class.attrib;
+		%bibliorelation.type.attrib;
+		%common.attrib;
+		%bibliorelation.role.attrib;
+		%local.bibliorelation.attrib;
+>
+<!--end of bibliorelation.attlist-->]]>
+<!--end of bibliorelation.module-->]]>
+
+<!-- BiblioCoverage ................. -->
+
+<!ENTITY % bibliocoverage.module "INCLUDE">
+<![%bibliocoverage.module;[
+<!ENTITY % local.bibliocoverage.attrib "">
+<!ENTITY % bibliocoverage.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliocoverage.element "INCLUDE">
+<![%bibliocoverage.element;[
+<!ELEMENT bibliocoverage %ho; (%docinfo.char.mix;)*>
+<!--end of bibliocoverage.element-->]]>
+
+<!ENTITY % bibliocoverage.attlist "INCLUDE">
+<![%bibliocoverage.attlist;[
+<!ATTLIST bibliocoverage
+		spatial	(dcmipoint|iso3166|dcmibox|tgn|otherspatial)	#IMPLIED
+		otherspatial	CDATA	#IMPLIED
+		temporal (dcmiperiod|w3c-dtf|othertemporal) #IMPLIED
+		othertemporal	CDATA	#IMPLIED
+		%common.attrib;
+		%bibliocoverage.role.attrib;
+		%local.bibliocoverage.attrib;
+>
+<!--end of bibliocoverage.attlist-->]]>
+<!--end of bibliocoverage.module-->]]>
+
+<!-- InvPartNumber .................... -->
+
+<!ENTITY % invpartnumber.module "INCLUDE">
+<![%invpartnumber.module;[
+<!ENTITY % local.invpartnumber.attrib "">
+<!ENTITY % invpartnumber.role.attrib "%role.attrib;">
+
+<!ENTITY % invpartnumber.element "INCLUDE">
+<![%invpartnumber.element;[
+<!ELEMENT invpartnumber %ho; (%docinfo.char.mix;)*>
+<!--end of invpartnumber.element-->]]>
+
+<!ENTITY % invpartnumber.attlist "INCLUDE">
+<![%invpartnumber.attlist;[
+<!ATTLIST invpartnumber
+		%common.attrib;
+		%invpartnumber.role.attrib;
+		%local.invpartnumber.attrib;
+>
+<!--end of invpartnumber.attlist-->]]>
+<!--end of invpartnumber.module-->]]>
+
+<!-- IssueNum ......................... -->
+
+<!ENTITY % issuenum.module "INCLUDE">
+<![%issuenum.module;[
+<!ENTITY % local.issuenum.attrib "">
+<!ENTITY % issuenum.role.attrib "%role.attrib;">
+
+<!ENTITY % issuenum.element "INCLUDE">
+<![%issuenum.element;[
+<!ELEMENT issuenum %ho; (%docinfo.char.mix;)*>
+<!--end of issuenum.element-->]]>
+
+<!ENTITY % issuenum.attlist "INCLUDE">
+<![%issuenum.attlist;[
+<!ATTLIST issuenum
+		%common.attrib;
+		%issuenum.role.attrib;
+		%local.issuenum.attrib;
+>
+<!--end of issuenum.attlist-->]]>
+<!--end of issuenum.module-->]]>
+
+<!-- LegalNotice ...................... -->
+
+<!ENTITY % legalnotice.module "INCLUDE">
+<![%legalnotice.module;[
+<!ENTITY % local.legalnotice.attrib "">
+<!ENTITY % legalnotice.role.attrib "%role.attrib;">
+
+<!ENTITY % legalnotice.element "INCLUDE">
+<![%legalnotice.element;[
+<!ELEMENT legalnotice %ho; (blockinfo?, title?, (%legalnotice.mix;)+)
+		%formal.exclusion;>
+<!--end of legalnotice.element-->]]>
+
+<!ENTITY % legalnotice.attlist "INCLUDE">
+<![%legalnotice.attlist;[
+<!ATTLIST legalnotice
+		%common.attrib;
+		%legalnotice.role.attrib;
+		%local.legalnotice.attrib;
+>
+<!--end of legalnotice.attlist-->]]>
+<!--end of legalnotice.module-->]]>
+
+<!-- ModeSpec ......................... -->
+
+<!ENTITY % modespec.module "INCLUDE">
+<![%modespec.module;[
+<!ENTITY % local.modespec.attrib "">
+<!ENTITY % modespec.role.attrib "%role.attrib;">
+
+<!ENTITY % modespec.element "INCLUDE">
+<![%modespec.element;[
+<!ELEMENT modespec %ho; (%docinfo.char.mix;)*
+		%ubiq.exclusion;>
+<!--end of modespec.element-->]]>
+
+<!-- Application: Type of action required for completion
+		of the links to which the ModeSpec is relevant (e.g.,
+		retrieval query) -->
+
+
+<!ENTITY % modespec.attlist "INCLUDE">
+<![%modespec.attlist;[
+<!ATTLIST modespec
+		application	NOTATION
+				(%notation.class;)	#IMPLIED
+		%common.attrib;
+		%modespec.role.attrib;
+		%local.modespec.attrib;
+>
+<!--end of modespec.attlist-->]]>
+<!--end of modespec.module-->]]>
+
+<!-- OrgName .......................... -->
+
+<!ENTITY % orgname.module "INCLUDE">
+<![%orgname.module;[
+<!ENTITY % local.orgname.attrib "">
+<!ENTITY % orgname.role.attrib "%role.attrib;">
+
+<!ENTITY % orgname.element "INCLUDE">
+<![%orgname.element;[
+<!ELEMENT orgname %ho; (%docinfo.char.mix;)*>
+<!--end of orgname.element-->]]>
+
+<!ENTITY % orgname.attlist "INCLUDE">
+<![%orgname.attlist;[
+<!ATTLIST orgname
+		%common.attrib;
+		class	(corporation|nonprofit|consortium|informal|other)	#IMPLIED
+		otherclass	CDATA			#IMPLIED
+		%orgname.role.attrib;
+		%local.orgname.attrib;
+>
+<!--end of orgname.attlist-->]]>
+<!--end of orgname.module-->]]>
+
+<!-- OtherCredit ...................... -->
+
+<!ENTITY % othercredit.module "INCLUDE">
+<![%othercredit.module;[
+<!ENTITY % local.othercredit.attrib "">
+<!ENTITY % othercredit.role.attrib "%role.attrib;">
+
+<!ENTITY % othercredit.element "INCLUDE">
+<![%othercredit.element;[
+<!ELEMENT othercredit %ho; ((personname|(%person.ident.mix;)+),
+                            (personblurb|email|address)*)>
+<!--end of othercredit.element-->]]>
+
+<!ENTITY % othercredit.attlist "INCLUDE">
+<![%othercredit.attlist;[
+<!ATTLIST othercredit
+		class	(graphicdesigner
+			|productioneditor
+			|copyeditor
+			|technicaleditor
+			|translator
+			|other)			#IMPLIED
+		%common.attrib;
+		%othercredit.role.attrib;
+		%local.othercredit.attrib;
+>
+<!--end of othercredit.attlist-->]]>
+  <!--(see "Personal identity elements" for %person.ident.mix;)-->
+<!--end of othercredit.module-->]]>
+
+<!-- PageNums ......................... -->
+
+<!ENTITY % pagenums.module "INCLUDE">
+<![%pagenums.module;[
+<!ENTITY % local.pagenums.attrib "">
+<!ENTITY % pagenums.role.attrib "%role.attrib;">
+
+<!ENTITY % pagenums.element "INCLUDE">
+<![%pagenums.element;[
+<!ELEMENT pagenums %ho; (%docinfo.char.mix;)*>
+<!--end of pagenums.element-->]]>
+
+<!ENTITY % pagenums.attlist "INCLUDE">
+<![%pagenums.attlist;[
+<!ATTLIST pagenums
+		%common.attrib;
+		%pagenums.role.attrib;
+		%local.pagenums.attrib;
+>
+<!--end of pagenums.attlist-->]]>
+<!--end of pagenums.module-->]]>
+
+<!-- Personal identity elements ....... -->
+
+<!-- These elements are used only within Author, Editor, and
+OtherCredit. -->
+
+<!ENTITY % person.ident.module "INCLUDE">
+<![%person.ident.module;[
+  <!ENTITY % contrib.module "INCLUDE">
+  <![%contrib.module;[
+  <!ENTITY % local.contrib.attrib "">
+  <!ENTITY % contrib.role.attrib "%role.attrib;">
+
+<!ENTITY % contrib.element "INCLUDE">
+<![%contrib.element;[
+<!ELEMENT contrib %ho; (%docinfo.char.mix;)*>
+<!--end of contrib.element-->]]>
+
+<!ENTITY % contrib.attlist "INCLUDE">
+<![%contrib.attlist;[
+<!ATTLIST contrib
+		%common.attrib;
+		%contrib.role.attrib;
+		%local.contrib.attrib;
+>
+<!--end of contrib.attlist-->]]>
+  <!--end of contrib.module-->]]>
+
+  <!ENTITY % firstname.module "INCLUDE">
+  <![%firstname.module;[
+  <!ENTITY % local.firstname.attrib "">
+  <!ENTITY % firstname.role.attrib "%role.attrib;">
+
+<!ENTITY % firstname.element "INCLUDE">
+<![%firstname.element;[
+<!ELEMENT firstname %ho; (%docinfo.char.mix;)*>
+<!--end of firstname.element-->]]>
+
+<!ENTITY % firstname.attlist "INCLUDE">
+<![%firstname.attlist;[
+<!ATTLIST firstname
+		%common.attrib;
+		%firstname.role.attrib;
+		%local.firstname.attrib;
+>
+<!--end of firstname.attlist-->]]>
+  <!--end of firstname.module-->]]>
+
+  <!ENTITY % honorific.module "INCLUDE">
+  <![%honorific.module;[
+  <!ENTITY % local.honorific.attrib "">
+  <!ENTITY % honorific.role.attrib "%role.attrib;">
+
+<!ENTITY % honorific.element "INCLUDE">
+<![%honorific.element;[
+<!ELEMENT honorific %ho; (%docinfo.char.mix;)*>
+<!--end of honorific.element-->]]>
+
+<!ENTITY % honorific.attlist "INCLUDE">
+<![%honorific.attlist;[
+<!ATTLIST honorific
+		%common.attrib;
+		%honorific.role.attrib;
+		%local.honorific.attrib;
+>
+<!--end of honorific.attlist-->]]>
+  <!--end of honorific.module-->]]>
+
+  <!ENTITY % lineage.module "INCLUDE">
+  <![%lineage.module;[
+  <!ENTITY % local.lineage.attrib "">
+  <!ENTITY % lineage.role.attrib "%role.attrib;">
+
+<!ENTITY % lineage.element "INCLUDE">
+<![%lineage.element;[
+<!ELEMENT lineage %ho; (%docinfo.char.mix;)*>
+<!--end of lineage.element-->]]>
+
+<!ENTITY % lineage.attlist "INCLUDE">
+<![%lineage.attlist;[
+<!ATTLIST lineage
+		%common.attrib;
+		%lineage.role.attrib;
+		%local.lineage.attrib;
+>
+<!--end of lineage.attlist-->]]>
+  <!--end of lineage.module-->]]>
+
+  <!ENTITY % othername.module "INCLUDE">
+  <![%othername.module;[
+  <!ENTITY % local.othername.attrib "">
+  <!ENTITY % othername.role.attrib "%role.attrib;">
+
+<!ENTITY % othername.element "INCLUDE">
+<![%othername.element;[
+<!ELEMENT othername %ho; (%docinfo.char.mix;)*>
+<!--end of othername.element-->]]>
+
+<!ENTITY % othername.attlist "INCLUDE">
+<![%othername.attlist;[
+<!ATTLIST othername
+		%common.attrib;
+		%othername.role.attrib;
+		%local.othername.attrib;
+>
+<!--end of othername.attlist-->]]>
+  <!--end of othername.module-->]]>
+
+  <!ENTITY % surname.module "INCLUDE">
+  <![%surname.module;[
+  <!ENTITY % local.surname.attrib "">
+  <!ENTITY % surname.role.attrib "%role.attrib;">
+
+<!ENTITY % surname.element "INCLUDE">
+<![%surname.element;[
+<!ELEMENT surname %ho; (%docinfo.char.mix;)*>
+<!--end of surname.element-->]]>
+
+<!ENTITY % surname.attlist "INCLUDE">
+<![%surname.attlist;[
+<!ATTLIST surname
+		%common.attrib;
+		%surname.role.attrib;
+		%local.surname.attrib;
+>
+<!--end of surname.attlist-->]]>
+  <!--end of surname.module-->]]>
+<!--end of person.ident.module-->]]>
+
+<!-- PrintHistory ..................... -->
+
+<!ENTITY % printhistory.module "INCLUDE">
+<![%printhistory.module;[
+<!ENTITY % local.printhistory.attrib "">
+<!ENTITY % printhistory.role.attrib "%role.attrib;">
+
+<!ENTITY % printhistory.element "INCLUDE">
+<![%printhistory.element;[
+<!ELEMENT printhistory %ho; ((%para.class;)+)>
+<!--end of printhistory.element-->]]>
+
+<!ENTITY % printhistory.attlist "INCLUDE">
+<![%printhistory.attlist;[
+<!ATTLIST printhistory
+		%common.attrib;
+		%printhistory.role.attrib;
+		%local.printhistory.attrib;
+>
+<!--end of printhistory.attlist-->]]>
+<!--end of printhistory.module-->]]>
+
+<!-- ProductName ...................... -->
+
+<!ENTITY % productname.module "INCLUDE">
+<![%productname.module;[
+<!ENTITY % local.productname.attrib "">
+<!ENTITY % productname.role.attrib "%role.attrib;">
+
+<!ENTITY % productname.element "INCLUDE">
+<![%productname.element;[
+<!ELEMENT productname %ho; (%para.char.mix;)*>
+<!--end of productname.element-->]]>
+
+<!-- Class: More precisely identifies the item the element names -->
+
+
+<!ENTITY % productname.attlist "INCLUDE">
+<![%productname.attlist;[
+<!ATTLIST productname
+		class		(service
+				|trade
+				|registered
+				|copyright)	'trade'
+		%common.attrib;
+		%productname.role.attrib;
+		%local.productname.attrib;
+>
+<!--end of productname.attlist-->]]>
+<!--end of productname.module-->]]>
+
+<!-- ProductNumber .................... -->
+
+<!ENTITY % productnumber.module "INCLUDE">
+<![%productnumber.module;[
+<!ENTITY % local.productnumber.attrib "">
+<!ENTITY % productnumber.role.attrib "%role.attrib;">
+
+<!ENTITY % productnumber.element "INCLUDE">
+<![%productnumber.element;[
+<!ELEMENT productnumber %ho; (%docinfo.char.mix;)*>
+<!--end of productnumber.element-->]]>
+
+<!ENTITY % productnumber.attlist "INCLUDE">
+<![%productnumber.attlist;[
+<!ATTLIST productnumber
+		%common.attrib;
+		%productnumber.role.attrib;
+		%local.productnumber.attrib;
+>
+<!--end of productnumber.attlist-->]]>
+<!--end of productnumber.module-->]]>
+
+<!-- PubDate .......................... -->
+
+<!ENTITY % pubdate.module "INCLUDE">
+<![%pubdate.module;[
+<!ENTITY % local.pubdate.attrib "">
+<!ENTITY % pubdate.role.attrib "%role.attrib;">
+
+<!ENTITY % pubdate.element "INCLUDE">
+<![%pubdate.element;[
+<!ELEMENT pubdate %ho; (%docinfo.char.mix;)*>
+<!--end of pubdate.element-->]]>
+
+<!ENTITY % pubdate.attlist "INCLUDE">
+<![%pubdate.attlist;[
+<!ATTLIST pubdate
+		%common.attrib;
+		%pubdate.role.attrib;
+		%local.pubdate.attrib;
+>
+<!--end of pubdate.attlist-->]]>
+<!--end of pubdate.module-->]]>
+
+<!-- Publisher ........................ -->
+
+<!ENTITY % publisher.content.module "INCLUDE">
+<![%publisher.content.module;[
+<!ENTITY % publisher.module "INCLUDE">
+<![%publisher.module;[
+<!ENTITY % local.publisher.attrib "">
+<!ENTITY % publisher.role.attrib "%role.attrib;">
+
+<!ENTITY % publisher.element "INCLUDE">
+<![%publisher.element;[
+<!ELEMENT publisher %ho; (publishername, address*)>
+<!--end of publisher.element-->]]>
+
+<!ENTITY % publisher.attlist "INCLUDE">
+<![%publisher.attlist;[
+<!ATTLIST publisher
+		%common.attrib;
+		%publisher.role.attrib;
+		%local.publisher.attrib;
+>
+<!--end of publisher.attlist-->]]>
+<!--end of publisher.module-->]]>
+
+  <!ENTITY % publishername.module "INCLUDE">
+  <![%publishername.module;[
+  <!ENTITY % local.publishername.attrib "">
+  <!ENTITY % publishername.role.attrib "%role.attrib;">
+
+<!ENTITY % publishername.element "INCLUDE">
+<![%publishername.element;[
+<!ELEMENT publishername %ho; (%docinfo.char.mix;)*>
+<!--end of publishername.element-->]]>
+
+<!ENTITY % publishername.attlist "INCLUDE">
+<![%publishername.attlist;[
+<!ATTLIST publishername
+		%common.attrib;
+		%publishername.role.attrib;
+		%local.publishername.attrib;
+>
+<!--end of publishername.attlist-->]]>
+  <!--end of publishername.module-->]]>
+
+  <!-- Address (defined elsewhere in this section)-->
+<!--end of publisher.content.module-->]]>
+
+<!-- PubsNumber ....................... -->
+
+<!ENTITY % pubsnumber.module "INCLUDE">
+<![%pubsnumber.module;[
+<!ENTITY % local.pubsnumber.attrib "">
+<!ENTITY % pubsnumber.role.attrib "%role.attrib;">
+
+<!ENTITY % pubsnumber.element "INCLUDE">
+<![%pubsnumber.element;[
+<!ELEMENT pubsnumber %ho; (%docinfo.char.mix;)*>
+<!--end of pubsnumber.element-->]]>
+
+<!ENTITY % pubsnumber.attlist "INCLUDE">
+<![%pubsnumber.attlist;[
+<!ATTLIST pubsnumber
+		%common.attrib;
+		%pubsnumber.role.attrib;
+		%local.pubsnumber.attrib;
+>
+<!--end of pubsnumber.attlist-->]]>
+<!--end of pubsnumber.module-->]]>
+
+<!-- ReleaseInfo ...................... -->
+
+<!ENTITY % releaseinfo.module "INCLUDE">
+<![%releaseinfo.module;[
+<!ENTITY % local.releaseinfo.attrib "">
+<!ENTITY % releaseinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % releaseinfo.element "INCLUDE">
+<![%releaseinfo.element;[
+<!ELEMENT releaseinfo %ho; (%docinfo.char.mix;)*>
+<!--end of releaseinfo.element-->]]>
+
+<!ENTITY % releaseinfo.attlist "INCLUDE">
+<![%releaseinfo.attlist;[
+<!ATTLIST releaseinfo
+		%common.attrib;
+		%releaseinfo.role.attrib;
+		%local.releaseinfo.attrib;
+>
+<!--end of releaseinfo.attlist-->]]>
+<!--end of releaseinfo.module-->]]>
+
+<!-- RevHistory ....................... -->
+
+<!ENTITY % revhistory.content.module "INCLUDE">
+<![%revhistory.content.module;[
+<!ENTITY % revhistory.module "INCLUDE">
+<![%revhistory.module;[
+<!ENTITY % local.revhistory.attrib "">
+<!ENTITY % revhistory.role.attrib "%role.attrib;">
+
+<!ENTITY % revhistory.element "INCLUDE">
+<![%revhistory.element;[
+<!ELEMENT revhistory %ho; (revision+)>
+<!--end of revhistory.element-->]]>
+
+<!ENTITY % revhistory.attlist "INCLUDE">
+<![%revhistory.attlist;[
+<!ATTLIST revhistory
+		%common.attrib;
+		%revhistory.role.attrib;
+		%local.revhistory.attrib;
+>
+<!--end of revhistory.attlist-->]]>
+<!--end of revhistory.module-->]]>
+
+<!ENTITY % revision.module "INCLUDE">
+<![%revision.module;[
+<!ENTITY % local.revision.attrib "">
+<!ENTITY % revision.role.attrib "%role.attrib;">
+
+<!ENTITY % revision.element "INCLUDE">
+<![%revision.element;[
+<!ELEMENT revision %ho; (revnumber, date, (author|authorinitials)*,
+                    (revremark|revdescription)?)>
+<!--end of revision.element-->]]>
+
+<!ENTITY % revision.attlist "INCLUDE">
+<![%revision.attlist;[
+<!ATTLIST revision
+		%common.attrib;
+		%revision.role.attrib;
+		%local.revision.attrib;
+>
+<!--end of revision.attlist-->]]>
+<!--end of revision.module-->]]>
+
+<!ENTITY % revnumber.module "INCLUDE">
+<![%revnumber.module;[
+<!ENTITY % local.revnumber.attrib "">
+<!ENTITY % revnumber.role.attrib "%role.attrib;">
+
+<!ENTITY % revnumber.element "INCLUDE">
+<![%revnumber.element;[
+<!ELEMENT revnumber %ho; (%docinfo.char.mix;)*>
+<!--end of revnumber.element-->]]>
+
+<!ENTITY % revnumber.attlist "INCLUDE">
+<![%revnumber.attlist;[
+<!ATTLIST revnumber
+		%common.attrib;
+		%revnumber.role.attrib;
+		%local.revnumber.attrib;
+>
+<!--end of revnumber.attlist-->]]>
+<!--end of revnumber.module-->]]>
+
+<!-- Date (defined elsewhere in this section)-->
+<!-- AuthorInitials (defined elsewhere in this section)-->
+
+<!ENTITY % revremark.module "INCLUDE">
+<![%revremark.module;[
+<!ENTITY % local.revremark.attrib "">
+<!ENTITY % revremark.role.attrib "%role.attrib;">
+
+<!ENTITY % revremark.element "INCLUDE">
+<![%revremark.element;[
+<!ELEMENT revremark %ho; (%docinfo.char.mix;)*>
+<!--end of revremark.element-->]]>
+
+<!ENTITY % revremark.attlist "INCLUDE">
+<![%revremark.attlist;[
+<!ATTLIST revremark
+		%common.attrib;
+		%revremark.role.attrib;
+		%local.revremark.attrib;
+>
+<!--end of revremark.attlist-->]]>
+<!--end of revremark.module-->]]>
+
+<!ENTITY % revdescription.module "INCLUDE">
+<![ %revdescription.module; [
+<!ENTITY % local.revdescription.attrib "">
+<!ENTITY % revdescription.role.attrib "%role.attrib;">
+
+<!ENTITY % revdescription.element "INCLUDE">
+<![ %revdescription.element; [
+<!ELEMENT revdescription %ho; ((%revdescription.mix;)+)>
+<!--end of revdescription.element-->]]>
+
+<!ENTITY % revdescription.attlist "INCLUDE">
+<![ %revdescription.attlist; [
+<!ATTLIST revdescription
+		%common.attrib;
+		%revdescription.role.attrib;
+		%local.revdescription.attrib;
+>
+<!--end of revdescription.attlist-->]]>
+<!--end of revdescription.module-->]]>
+<!--end of revhistory.content.module-->]]>
+
+<!-- SeriesVolNums .................... -->
+
+<!ENTITY % seriesvolnums.module "INCLUDE">
+<![%seriesvolnums.module;[
+<!ENTITY % local.seriesvolnums.attrib "">
+<!ENTITY % seriesvolnums.role.attrib "%role.attrib;">
+
+<!ENTITY % seriesvolnums.element "INCLUDE">
+<![%seriesvolnums.element;[
+<!ELEMENT seriesvolnums %ho; (%docinfo.char.mix;)*>
+<!--end of seriesvolnums.element-->]]>
+
+<!ENTITY % seriesvolnums.attlist "INCLUDE">
+<![%seriesvolnums.attlist;[
+<!ATTLIST seriesvolnums
+		%common.attrib;
+		%seriesvolnums.role.attrib;
+		%local.seriesvolnums.attrib;
+>
+<!--end of seriesvolnums.attlist-->]]>
+<!--end of seriesvolnums.module-->]]>
+
+<!-- VolumeNum ........................ -->
+
+<!ENTITY % volumenum.module "INCLUDE">
+<![%volumenum.module;[
+<!ENTITY % local.volumenum.attrib "">
+<!ENTITY % volumenum.role.attrib "%role.attrib;">
+
+<!ENTITY % volumenum.element "INCLUDE">
+<![%volumenum.element;[
+<!ELEMENT volumenum %ho; (%docinfo.char.mix;)*>
+<!--end of volumenum.element-->]]>
+
+<!ENTITY % volumenum.attlist "INCLUDE">
+<![%volumenum.attlist;[
+<!ATTLIST volumenum
+		%common.attrib;
+		%volumenum.role.attrib;
+		%local.volumenum.attrib;
+>
+<!--end of volumenum.attlist-->]]>
+<!--end of volumenum.module-->]]>
+
+<!-- .................................. -->
+
+<!--end of docinfo.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Inline, link, and ubiquitous elements ................................ -->
+
+<!-- Technical and computer terms ......................................... -->
+
+<!ENTITY % accel.module "INCLUDE">
+<![%accel.module;[
+<!ENTITY % local.accel.attrib "">
+<!ENTITY % accel.role.attrib "%role.attrib;">
+
+<!ENTITY % accel.element "INCLUDE">
+<![%accel.element;[
+<!ELEMENT accel %ho; (%smallcptr.char.mix;)*>
+<!--end of accel.element-->]]>
+
+<!ENTITY % accel.attlist "INCLUDE">
+<![%accel.attlist;[
+<!ATTLIST accel
+		%common.attrib;
+		%accel.role.attrib;
+		%local.accel.attrib;
+>
+<!--end of accel.attlist-->]]>
+<!--end of accel.module-->]]>
+
+<!ENTITY % action.module "INCLUDE">
+<![%action.module;[
+<!ENTITY % local.action.attrib "">
+<!ENTITY % action.role.attrib "%role.attrib;">
+
+<!ENTITY % action.element "INCLUDE">
+<![%action.element;[
+<!ELEMENT action %ho; (%cptr.char.mix;)*>
+<!--end of action.element-->]]>
+
+<!ENTITY % action.attlist "INCLUDE">
+<![%action.attlist;[
+<!ATTLIST action
+		%moreinfo.attrib;
+		%common.attrib;
+		%action.role.attrib;
+		%local.action.attrib;
+>
+<!--end of action.attlist-->]]>
+<!--end of action.module-->]]>
+
+<!ENTITY % application.module "INCLUDE">
+<![%application.module;[
+<!ENTITY % local.application.attrib "">
+<!ENTITY % application.role.attrib "%role.attrib;">
+
+<!ENTITY % application.element "INCLUDE">
+<![%application.element;[
+<!ELEMENT application %ho; (%para.char.mix;)*>
+<!--end of application.element-->]]>
+
+<!ENTITY % application.attlist "INCLUDE">
+<![%application.attlist;[
+<!ATTLIST application
+		class 		(hardware
+				|software)	#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%application.role.attrib;
+		%local.application.attrib;
+>
+<!--end of application.attlist-->]]>
+<!--end of application.module-->]]>
+
+<!ENTITY % classname.module "INCLUDE">
+<![%classname.module;[
+<!ENTITY % local.classname.attrib "">
+<!ENTITY % classname.role.attrib "%role.attrib;">
+
+<!ENTITY % classname.element "INCLUDE">
+<![%classname.element;[
+<!ELEMENT classname %ho; (%smallcptr.char.mix;)*>
+<!--end of classname.element-->]]>
+
+<!ENTITY % classname.attlist "INCLUDE">
+<![%classname.attlist;[
+<!ATTLIST classname
+		%common.attrib;
+		%classname.role.attrib;
+		%local.classname.attrib;
+>
+<!--end of classname.attlist-->]]>
+<!--end of classname.module-->]]>
+
+<!ENTITY % package.module "INCLUDE">
+<![%package.module;[
+<!ENTITY % local.package.attrib "">
+<!ENTITY % package.role.attrib "%role.attrib;">
+
+<!ENTITY % package.element "INCLUDE">
+<![%package.element;[
+<!ELEMENT package %ho; (%smallcptr.char.mix;)*>
+<!--end of package.element-->]]>
+
+<!ENTITY % package.attlist "INCLUDE">
+<![%package.attlist;[
+<!ATTLIST package
+		%common.attrib;
+		%package.role.attrib;
+		%local.package.attrib;
+>
+<!--end of package.attlist-->]]>
+<!--end of package.module-->]]>
+
+<!ENTITY % co.module "INCLUDE">
+<![%co.module;[
+<!ENTITY % local.co.attrib "">
+<!-- CO is a callout area of the LineColumn unit type (a single character
+     position); the position is directly indicated by the location of CO. -->
+<!ENTITY % co.role.attrib "%role.attrib;">
+
+<!ENTITY % co.element "INCLUDE">
+<![%co.element;[
+<!ELEMENT co %ho; EMPTY>
+<!--end of co.element-->]]>
+
+<!-- bug number/symbol override or initialization -->
+<!-- to any related information -->
+
+
+<!ENTITY % co.attlist "INCLUDE">
+<![%co.attlist;[
+<!ATTLIST co
+		%label.attrib;
+		%linkends.attrib;
+		%idreq.common.attrib;
+		%co.role.attrib;
+		%local.co.attrib;
+>
+<!--end of co.attlist-->]]>
+<!--end of co.module-->]]>
+
+<!ENTITY % coref.module "INCLUDE">
+<![%coref.module;[
+<!ENTITY % local.coref.attrib "">
+<!-- COREF is a reference to a CO -->
+<!ENTITY % coref.role.attrib "%role.attrib;">
+
+<!ENTITY % coref.element "INCLUDE">
+<![%coref.element;[
+<!ELEMENT coref %ho; EMPTY>
+<!--end of coref.element-->]]>
+
+<!-- bug number/symbol override or initialization -->
+<!-- to any related information -->
+
+<!ENTITY % coref.attlist "INCLUDE">
+<![%coref.attlist;[
+<!ATTLIST coref
+		%label.attrib;
+		%linkendreq.attrib;
+		%common.attrib;
+		%coref.role.attrib;
+		%local.coref.attrib;
+>
+<!--end of coref.attlist-->]]>
+<!--end of coref.module-->]]>
+
+<!ENTITY % command.module "INCLUDE">
+<![%command.module;[
+<!ENTITY % local.command.attrib "">
+<!ENTITY % command.role.attrib "%role.attrib;">
+
+<!ENTITY % command.element "INCLUDE">
+<![%command.element;[
+<!ELEMENT command %ho; (%cptr.char.mix;)*>
+<!--end of command.element-->]]>
+
+<!ENTITY % command.attlist "INCLUDE">
+<![%command.attlist;[
+<!ATTLIST command
+		%moreinfo.attrib;
+		%common.attrib;
+		%command.role.attrib;
+		%local.command.attrib;
+>
+<!--end of command.attlist-->]]>
+<!--end of command.module-->]]>
+
+<!ENTITY % computeroutput.module "INCLUDE">
+<![%computeroutput.module;[
+<!ENTITY % local.computeroutput.attrib "">
+<!ENTITY % computeroutput.role.attrib "%role.attrib;">
+
+<!ENTITY % computeroutput.element "INCLUDE">
+<![%computeroutput.element;[
+<!ELEMENT computeroutput %ho; (%cptr.char.mix;|co)*>
+<!--end of computeroutput.element-->]]>
+
+<!ENTITY % computeroutput.attlist "INCLUDE">
+<![%computeroutput.attlist;[
+<!ATTLIST computeroutput
+		%moreinfo.attrib;
+		%common.attrib;
+		%computeroutput.role.attrib;
+		%local.computeroutput.attrib;
+>
+<!--end of computeroutput.attlist-->]]>
+<!--end of computeroutput.module-->]]>
+
+<!ENTITY % database.module "INCLUDE">
+<![%database.module;[
+<!ENTITY % local.database.attrib "">
+<!ENTITY % database.role.attrib "%role.attrib;">
+
+<!ENTITY % database.element "INCLUDE">
+<![%database.element;[
+<!ELEMENT database %ho; (%cptr.char.mix;)*>
+<!--end of database.element-->]]>
+
+<!-- Class: Type of database the element names; no default -->
+
+
+<!ENTITY % database.attlist "INCLUDE">
+<![%database.attlist;[
+<!ATTLIST database
+		class 		(name
+				|table
+				|field
+				|key1
+				|key2
+				|record
+                                |index
+                                |view
+                                |primarykey
+                                |secondarykey
+                                |foreignkey
+                                |altkey
+                                |procedure
+                                |datatype
+                                |constraint
+                                |rule
+                                |user
+                                |group)	#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%database.role.attrib;
+		%local.database.attrib;
+>
+<!--end of database.attlist-->]]>
+<!--end of database.module-->]]>
+
+<!ENTITY % email.module "INCLUDE">
+<![%email.module;[
+<!ENTITY % local.email.attrib "">
+<!ENTITY % email.role.attrib "%role.attrib;">
+
+<!ENTITY % email.element "INCLUDE">
+<![%email.element;[
+<!ELEMENT email %ho; (%docinfo.char.mix;)*>
+<!--end of email.element-->]]>
+
+<!ENTITY % email.attlist "INCLUDE">
+<![%email.attlist;[
+<!ATTLIST email
+		%common.attrib;
+		%email.role.attrib;
+		%local.email.attrib;
+>
+<!--end of email.attlist-->]]>
+<!--end of email.module-->]]>
+
+<!ENTITY % envar.module "INCLUDE">
+<![%envar.module;[
+<!ENTITY % local.envar.attrib "">
+<!ENTITY % envar.role.attrib "%role.attrib;">
+
+<!ENTITY % envar.element "INCLUDE">
+<![%envar.element;[
+<!ELEMENT envar %ho; (%smallcptr.char.mix;)*>
+<!--end of envar.element-->]]>
+
+<!ENTITY % envar.attlist "INCLUDE">
+<![%envar.attlist;[
+<!ATTLIST envar
+		%common.attrib;
+		%envar.role.attrib;
+		%local.envar.attrib;
+>
+<!--end of envar.attlist-->]]>
+<!--end of envar.module-->]]>
+
+
+<!ENTITY % errorcode.module "INCLUDE">
+<![%errorcode.module;[
+<!ENTITY % local.errorcode.attrib "">
+<!ENTITY % errorcode.role.attrib "%role.attrib;">
+
+<!ENTITY % errorcode.element "INCLUDE">
+<![%errorcode.element;[
+<!ELEMENT errorcode %ho; (%smallcptr.char.mix;)*>
+<!--end of errorcode.element-->]]>
+
+<!ENTITY % errorcode.attlist "INCLUDE">
+<![%errorcode.attlist;[
+<!ATTLIST errorcode
+		%moreinfo.attrib;
+		%common.attrib;
+		%errorcode.role.attrib;
+		%local.errorcode.attrib;
+>
+<!--end of errorcode.attlist-->]]>
+<!--end of errorcode.module-->]]>
+
+<!ENTITY % errorname.module "INCLUDE">
+<![%errorname.module;[
+<!ENTITY % local.errorname.attrib "">
+<!ENTITY % errorname.role.attrib "%role.attrib;">
+
+<!ENTITY % errorname.element "INCLUDE">
+<![%errorname.element;[
+<!ELEMENT errorname %ho; (%smallcptr.char.mix;)*>
+<!--end of errorname.element-->]]>
+
+<!ENTITY % errorname.attlist "INCLUDE">
+<![%errorname.attlist;[
+<!ATTLIST errorname
+		%common.attrib;
+		%errorname.role.attrib;
+		%local.errorname.attrib;
+>
+<!--end of errorname.attlist-->]]>
+<!--end of errorname.module-->]]>
+
+<!ENTITY % errortext.module "INCLUDE">
+<![%errortext.module;[
+<!ENTITY % local.errortext.attrib "">
+<!ENTITY % errortext.role.attrib "%role.attrib;">
+
+<!ENTITY % errortext.element "INCLUDE">
+<![%errortext.element;[
+<!ELEMENT errortext %ho; (%smallcptr.char.mix;)*>
+<!--end of errortext.element-->]]>
+
+<!ENTITY % errortext.attlist "INCLUDE">
+<![%errortext.attlist;[
+<!ATTLIST errortext
+		%common.attrib;
+		%errortext.role.attrib;
+		%local.errortext.attrib;
+>
+<!--end of errortext.attlist-->]]>
+<!--end of errortext.module-->]]>
+
+<!ENTITY % errortype.module "INCLUDE">
+<![%errortype.module;[
+<!ENTITY % local.errortype.attrib "">
+<!ENTITY % errortype.role.attrib "%role.attrib;">
+
+<!ENTITY % errortype.element "INCLUDE">
+<![%errortype.element;[
+<!ELEMENT errortype %ho; (%smallcptr.char.mix;)*>
+<!--end of errortype.element-->]]>
+
+<!ENTITY % errortype.attlist "INCLUDE">
+<![%errortype.attlist;[
+<!ATTLIST errortype
+		%common.attrib;
+		%errortype.role.attrib;
+		%local.errortype.attrib;
+>
+<!--end of errortype.attlist-->]]>
+<!--end of errortype.module-->]]>
+
+<!ENTITY % filename.module "INCLUDE">
+<![%filename.module;[
+<!ENTITY % local.filename.attrib "">
+<!ENTITY % filename.role.attrib "%role.attrib;">
+
+<!ENTITY % filename.element "INCLUDE">
+<![%filename.element;[
+<!ELEMENT filename %ho; (%cptr.char.mix;)*>
+<!--end of filename.element-->]]>
+
+<!-- Class: Type of filename the element names; no default -->
+<!-- Path: Search path (possibly system-specific) in which
+		file can be found -->
+
+
+<!ENTITY % filename.attlist "INCLUDE">
+<![%filename.attlist;[
+<!ATTLIST filename
+		class		(headerfile
+                                |partition
+                                |devicefile
+                                |libraryfile
+                                |directory
+                                |extension
+				|symlink)       #IMPLIED
+		path		CDATA		#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%filename.role.attrib;
+		%local.filename.attrib;
+>
+<!--end of filename.attlist-->]]>
+<!--end of filename.module-->]]>
+
+<!ENTITY % function.module "INCLUDE">
+<![%function.module;[
+<!ENTITY % local.function.attrib "">
+<!ENTITY % function.role.attrib "%role.attrib;">
+
+<!ENTITY % function.element "INCLUDE">
+<![%function.element;[
+<!ELEMENT function %ho; (%cptr.char.mix;)*>
+<!--end of function.element-->]]>
+
+<!ENTITY % function.attlist "INCLUDE">
+<![%function.attlist;[
+<!ATTLIST function
+		%moreinfo.attrib;
+		%common.attrib;
+		%function.role.attrib;
+		%local.function.attrib;
+>
+<!--end of function.attlist-->]]>
+<!--end of function.module-->]]>
+
+<!ENTITY % guibutton.module "INCLUDE">
+<![%guibutton.module;[
+<!ENTITY % local.guibutton.attrib "">
+<!ENTITY % guibutton.role.attrib "%role.attrib;">
+
+<!ENTITY % guibutton.element "INCLUDE">
+<![%guibutton.element;[
+<!ELEMENT guibutton %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guibutton.element-->]]>
+
+<!ENTITY % guibutton.attlist "INCLUDE">
+<![%guibutton.attlist;[
+<!ATTLIST guibutton
+		%moreinfo.attrib;
+		%common.attrib;
+		%guibutton.role.attrib;
+		%local.guibutton.attrib;
+>
+<!--end of guibutton.attlist-->]]>
+<!--end of guibutton.module-->]]>
+
+<!ENTITY % guiicon.module "INCLUDE">
+<![%guiicon.module;[
+<!ENTITY % local.guiicon.attrib "">
+<!ENTITY % guiicon.role.attrib "%role.attrib;">
+
+<!ENTITY % guiicon.element "INCLUDE">
+<![%guiicon.element;[
+<!ELEMENT guiicon %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guiicon.element-->]]>
+
+<!ENTITY % guiicon.attlist "INCLUDE">
+<![%guiicon.attlist;[
+<!ATTLIST guiicon
+		%moreinfo.attrib;
+		%common.attrib;
+		%guiicon.role.attrib;
+		%local.guiicon.attrib;
+>
+<!--end of guiicon.attlist-->]]>
+<!--end of guiicon.module-->]]>
+
+<!ENTITY % guilabel.module "INCLUDE">
+<![%guilabel.module;[
+<!ENTITY % local.guilabel.attrib "">
+<!ENTITY % guilabel.role.attrib "%role.attrib;">
+
+<!ENTITY % guilabel.element "INCLUDE">
+<![%guilabel.element;[
+<!ELEMENT guilabel %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guilabel.element-->]]>
+
+<!ENTITY % guilabel.attlist "INCLUDE">
+<![%guilabel.attlist;[
+<!ATTLIST guilabel
+		%moreinfo.attrib;
+		%common.attrib;
+		%guilabel.role.attrib;
+		%local.guilabel.attrib;
+>
+<!--end of guilabel.attlist-->]]>
+<!--end of guilabel.module-->]]>
+
+<!ENTITY % guimenu.module "INCLUDE">
+<![%guimenu.module;[
+<!ENTITY % local.guimenu.attrib "">
+<!ENTITY % guimenu.role.attrib "%role.attrib;">
+
+<!ENTITY % guimenu.element "INCLUDE">
+<![%guimenu.element;[
+<!ELEMENT guimenu %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guimenu.element-->]]>
+
+<!ENTITY % guimenu.attlist "INCLUDE">
+<![%guimenu.attlist;[
+<!ATTLIST guimenu
+		%moreinfo.attrib;
+		%common.attrib;
+		%guimenu.role.attrib;
+		%local.guimenu.attrib;
+>
+<!--end of guimenu.attlist-->]]>
+<!--end of guimenu.module-->]]>
+
+<!ENTITY % guimenuitem.module "INCLUDE">
+<![%guimenuitem.module;[
+<!ENTITY % local.guimenuitem.attrib "">
+<!ENTITY % guimenuitem.role.attrib "%role.attrib;">
+
+<!ENTITY % guimenuitem.element "INCLUDE">
+<![%guimenuitem.element;[
+<!ELEMENT guimenuitem %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guimenuitem.element-->]]>
+
+<!ENTITY % guimenuitem.attlist "INCLUDE">
+<![%guimenuitem.attlist;[
+<!ATTLIST guimenuitem
+		%moreinfo.attrib;
+		%common.attrib;
+		%guimenuitem.role.attrib;
+		%local.guimenuitem.attrib;
+>
+<!--end of guimenuitem.attlist-->]]>
+<!--end of guimenuitem.module-->]]>
+
+<!ENTITY % guisubmenu.module "INCLUDE">
+<![%guisubmenu.module;[
+<!ENTITY % local.guisubmenu.attrib "">
+<!ENTITY % guisubmenu.role.attrib "%role.attrib;">
+
+<!ENTITY % guisubmenu.element "INCLUDE">
+<![%guisubmenu.element;[
+<!ELEMENT guisubmenu %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guisubmenu.element-->]]>
+
+<!ENTITY % guisubmenu.attlist "INCLUDE">
+<![%guisubmenu.attlist;[
+<!ATTLIST guisubmenu
+		%moreinfo.attrib;
+		%common.attrib;
+		%guisubmenu.role.attrib;
+		%local.guisubmenu.attrib;
+>
+<!--end of guisubmenu.attlist-->]]>
+<!--end of guisubmenu.module-->]]>
+
+<!ENTITY % hardware.module "INCLUDE">
+<![%hardware.module;[
+<!ENTITY % local.hardware.attrib "">
+<!ENTITY % hardware.role.attrib "%role.attrib;">
+
+<!ENTITY % hardware.element "INCLUDE">
+<![%hardware.element;[
+<!ELEMENT hardware %ho; (%cptr.char.mix;)*>
+<!--end of hardware.element-->]]>
+
+<!ENTITY % hardware.attlist "INCLUDE">
+<![%hardware.attlist;[
+<!ATTLIST hardware
+		%moreinfo.attrib;
+		%common.attrib;
+		%hardware.role.attrib;
+		%local.hardware.attrib;
+>
+<!--end of hardware.attlist-->]]>
+<!--end of hardware.module-->]]>
+
+<!ENTITY % interface.module "INCLUDE">
+<![%interface.module;[
+<!ENTITY % local.interface.attrib "">
+<!ENTITY % interface.role.attrib "%role.attrib;">
+
+<!ENTITY % interface.element "INCLUDE">
+<![%interface.element;[
+<!ELEMENT interface %ho; (%smallcptr.char.mix;|accel)*>
+<!--end of interface.element-->]]>
+
+<!-- Class: Type of the Interface item; no default -->
+
+
+<!ENTITY % interface.attlist "INCLUDE">
+<![%interface.attlist;[
+<!ATTLIST interface
+		%moreinfo.attrib;
+		%common.attrib;
+		%interface.role.attrib;
+		%local.interface.attrib;
+>
+<!--end of interface.attlist-->]]>
+<!--end of interface.module-->]]>
+
+<!ENTITY % keycap.module "INCLUDE">
+<![%keycap.module;[
+<!ENTITY % local.keycap.attrib "">
+<!ENTITY % keycap.role.attrib "%role.attrib;">
+
+<!ENTITY % keycap.element "INCLUDE">
+<![%keycap.element;[
+<!ELEMENT keycap %ho; (%cptr.char.mix;)*>
+<!--end of keycap.element-->]]>
+
+<!ENTITY % keycap.attlist "INCLUDE">
+<![%keycap.attlist;[
+<!ATTLIST keycap
+		function	(alt
+				|control
+				|shift
+				|meta
+				|escape
+				|enter
+				|tab
+				|backspace
+				|command
+				|option
+				|space
+				|delete
+				|insert
+				|up
+				|down
+				|left
+				|right
+				|home
+				|end
+				|pageup
+				|pagedown
+				|other)		#IMPLIED
+		otherfunction	CDATA		#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%keycap.role.attrib;
+		%local.keycap.attrib;
+>
+<!--end of keycap.attlist-->]]>
+<!--end of keycap.module-->]]>
+
+<!ENTITY % keycode.module "INCLUDE">
+<![%keycode.module;[
+<!ENTITY % local.keycode.attrib "">
+<!ENTITY % keycode.role.attrib "%role.attrib;">
+
+<!ENTITY % keycode.element "INCLUDE">
+<![%keycode.element;[
+<!ELEMENT keycode %ho; (%smallcptr.char.mix;)*>
+<!--end of keycode.element-->]]>
+
+<!ENTITY % keycode.attlist "INCLUDE">
+<![%keycode.attlist;[
+<!ATTLIST keycode
+		%common.attrib;
+		%keycode.role.attrib;
+		%local.keycode.attrib;
+>
+<!--end of keycode.attlist-->]]>
+<!--end of keycode.module-->]]>
+
+<!ENTITY % keycombo.module "INCLUDE">
+<![%keycombo.module;[
+<!ENTITY % local.keycombo.attrib "">
+<!ENTITY % keycombo.role.attrib "%role.attrib;">
+
+<!ENTITY % keycombo.element "INCLUDE">
+<![%keycombo.element;[
+<!ELEMENT keycombo %ho; ((keycap|keycombo|keysym|mousebutton)+)>
+<!--end of keycombo.element-->]]>
+
+<!ENTITY % keycombo.attlist "INCLUDE">
+<![%keycombo.attlist;[
+<!ATTLIST keycombo
+		%keyaction.attrib;
+		%moreinfo.attrib;
+		%common.attrib;
+		%keycombo.role.attrib;
+		%local.keycombo.attrib;
+>
+<!--end of keycombo.attlist-->]]>
+<!--end of keycombo.module-->]]>
+
+<!ENTITY % keysym.module "INCLUDE">
+<![%keysym.module;[
+<!ENTITY % local.keysym.attrib "">
+<!ENTITY % keysysm.role.attrib "%role.attrib;">
+
+<!ENTITY % keysym.element "INCLUDE">
+<![%keysym.element;[
+<!ELEMENT keysym %ho; (%smallcptr.char.mix;)*>
+<!--end of keysym.element-->]]>
+
+<!ENTITY % keysym.attlist "INCLUDE">
+<![%keysym.attlist;[
+<!ATTLIST keysym
+		%common.attrib;
+		%keysysm.role.attrib;
+		%local.keysym.attrib;
+>
+<!--end of keysym.attlist-->]]>
+<!--end of keysym.module-->]]>
+
+<!ENTITY % lineannotation.module "INCLUDE">
+<![%lineannotation.module;[
+<!ENTITY % local.lineannotation.attrib "">
+<!ENTITY % lineannotation.role.attrib "%role.attrib;">
+
+<!ENTITY % lineannotation.element "INCLUDE">
+<![%lineannotation.element;[
+<!ELEMENT lineannotation %ho; (%para.char.mix;)*>
+<!--end of lineannotation.element-->]]>
+
+<!ENTITY % lineannotation.attlist "INCLUDE">
+<![%lineannotation.attlist;[
+<!ATTLIST lineannotation
+		%common.attrib;
+		%lineannotation.role.attrib;
+		%local.lineannotation.attrib;
+>
+<!--end of lineannotation.attlist-->]]>
+<!--end of lineannotation.module-->]]>
+
+<!ENTITY % literal.module "INCLUDE">
+<![%literal.module;[
+<!ENTITY % local.literal.attrib "">
+<!ENTITY % literal.role.attrib "%role.attrib;">
+
+<!ENTITY % literal.element "INCLUDE">
+<![%literal.element;[
+<!ELEMENT literal %ho; (%cptr.char.mix;)*>
+<!--end of literal.element-->]]>
+
+<!ENTITY % literal.attlist "INCLUDE">
+<![%literal.attlist;[
+<!ATTLIST literal
+		%moreinfo.attrib;
+		%common.attrib;
+		%literal.role.attrib;
+		%local.literal.attrib;
+>
+<!--end of literal.attlist-->]]>
+<!--end of literal.module-->]]>
+
+<!ENTITY % code.module "INCLUDE">
+<![%code.module;[
+<!ENTITY % local.code.attrib "">
+<!ENTITY % code.role.attrib "%role.attrib;">
+
+<!ENTITY % code.element "INCLUDE">
+<![%code.element;[
+<!ELEMENT code %ho; (%cptr.char.mix;)*>
+<!--end of code.element-->]]>
+
+<!ENTITY % code.attlist "INCLUDE">
+<![%code.attlist;[
+<!ATTLIST code
+		language	CDATA	#IMPLIED
+		%common.attrib;
+		%code.role.attrib;
+		%local.code.attrib;
+>
+<!--end of code.attlist-->]]>
+<!--end of code.module-->]]>
+
+<!ENTITY % constant.module "INCLUDE">
+<![ %constant.module; [
+<!ENTITY % local.constant.attrib "">
+<!ENTITY % constant.role.attrib "%role.attrib;">
+
+<!ENTITY % constant.element "INCLUDE">
+<![ %constant.element; [
+<!ELEMENT constant %ho; (%smallcptr.char.mix;)*>
+<!--end of constant.element-->]]>
+
+<!ENTITY % constant.attlist "INCLUDE">
+<![ %constant.attlist; [
+<!ATTLIST constant
+		class	(limit)		#IMPLIED
+		%common.attrib;
+		%constant.role.attrib;
+		%local.constant.attrib;
+>
+<!--end of constant.attlist-->]]>
+<!--end of constant.module-->]]>
+
+<!ENTITY % varname.module "INCLUDE">
+<![ %varname.module; [
+<!ENTITY % local.varname.attrib "">
+<!ENTITY % varname.role.attrib "%role.attrib;">
+
+<!ENTITY % varname.element "INCLUDE">
+<![ %varname.element; [
+<!ELEMENT varname %ho; (%smallcptr.char.mix;)*>
+<!--end of varname.element-->]]>
+
+<!ENTITY % varname.attlist "INCLUDE">
+<![ %varname.attlist; [
+<!ATTLIST varname
+		%common.attrib;
+		%varname.role.attrib;
+		%local.varname.attrib;
+>
+<!--end of varname.attlist-->]]>
+<!--end of varname.module-->]]>
+
+<!ENTITY % markup.module "INCLUDE">
+<![%markup.module;[
+<!ENTITY % local.markup.attrib "">
+<!ENTITY % markup.role.attrib "%role.attrib;">
+
+<!ENTITY % markup.element "INCLUDE">
+<![%markup.element;[
+<!ELEMENT markup %ho; (%smallcptr.char.mix;)*>
+<!--end of markup.element-->]]>
+
+<!ENTITY % markup.attlist "INCLUDE">
+<![%markup.attlist;[
+<!ATTLIST markup
+		%common.attrib;
+		%markup.role.attrib;
+		%local.markup.attrib;
+>
+<!--end of markup.attlist-->]]>
+<!--end of markup.module-->]]>
+
+<!ENTITY % medialabel.module "INCLUDE">
+<![%medialabel.module;[
+<!ENTITY % local.medialabel.attrib "">
+<!ENTITY % medialabel.role.attrib "%role.attrib;">
+
+<!ENTITY % medialabel.element "INCLUDE">
+<![%medialabel.element;[
+<!ELEMENT medialabel %ho; (%smallcptr.char.mix;)*>
+<!--end of medialabel.element-->]]>
+
+<!-- Class: Type of medium named by the element; no default -->
+
+
+<!ENTITY % medialabel.attlist "INCLUDE">
+<![%medialabel.attlist;[
+<!ATTLIST medialabel
+		class 		(cartridge
+				|cdrom
+				|disk
+				|tape)		#IMPLIED
+		%common.attrib;
+		%medialabel.role.attrib;
+		%local.medialabel.attrib;
+>
+<!--end of medialabel.attlist-->]]>
+<!--end of medialabel.module-->]]>
+
+<!ENTITY % menuchoice.content.module "INCLUDE">
+<![%menuchoice.content.module;[
+<!ENTITY % menuchoice.module "INCLUDE">
+<![%menuchoice.module;[
+<!ENTITY % local.menuchoice.attrib "">
+<!ENTITY % menuchoice.role.attrib "%role.attrib;">
+
+<!ENTITY % menuchoice.element "INCLUDE">
+<![%menuchoice.element;[
+<!ELEMENT menuchoice %ho; (shortcut?, (guibutton|guiicon|guilabel
+		|guimenu|guimenuitem|guisubmenu|interface)+)>
+<!--end of menuchoice.element-->]]>
+
+<!ENTITY % menuchoice.attlist "INCLUDE">
+<![%menuchoice.attlist;[
+<!ATTLIST menuchoice
+		%moreinfo.attrib;
+		%common.attrib;
+		%menuchoice.role.attrib;
+		%local.menuchoice.attrib;
+>
+<!--end of menuchoice.attlist-->]]>
+<!--end of menuchoice.module-->]]>
+
+<!ENTITY % shortcut.module "INCLUDE">
+<![%shortcut.module;[
+<!-- See also KeyCombo -->
+<!ENTITY % local.shortcut.attrib "">
+<!ENTITY % shortcut.role.attrib "%role.attrib;">
+
+<!ENTITY % shortcut.element "INCLUDE">
+<![%shortcut.element;[
+<!ELEMENT shortcut %ho; ((keycap|keycombo|keysym|mousebutton)+)>
+<!--end of shortcut.element-->]]>
+
+<!ENTITY % shortcut.attlist "INCLUDE">
+<![%shortcut.attlist;[
+<!ATTLIST shortcut
+		%keyaction.attrib;
+		%moreinfo.attrib;
+		%common.attrib;
+		%shortcut.role.attrib;
+		%local.shortcut.attrib;
+>
+<!--end of shortcut.attlist-->]]>
+<!--end of shortcut.module-->]]>
+<!--end of menuchoice.content.module-->]]>
+
+<!ENTITY % mousebutton.module "INCLUDE">
+<![%mousebutton.module;[
+<!ENTITY % local.mousebutton.attrib "">
+<!ENTITY % mousebutton.role.attrib "%role.attrib;">
+
+<!ENTITY % mousebutton.element "INCLUDE">
+<![%mousebutton.element;[
+<!ELEMENT mousebutton %ho; (%smallcptr.char.mix;)*>
+<!--end of mousebutton.element-->]]>
+
+<!ENTITY % mousebutton.attlist "INCLUDE">
+<![%mousebutton.attlist;[
+<!ATTLIST mousebutton
+		%moreinfo.attrib;
+		%common.attrib;
+		%mousebutton.role.attrib;
+		%local.mousebutton.attrib;
+>
+<!--end of mousebutton.attlist-->]]>
+<!--end of mousebutton.module-->]]>
+
+<!ENTITY % msgtext.module "INCLUDE">
+<![%msgtext.module;[
+<!ENTITY % local.msgtext.attrib "">
+<!ENTITY % msgtext.role.attrib "%role.attrib;">
+
+<!ENTITY % msgtext.element "INCLUDE">
+<![%msgtext.element;[
+<!ELEMENT msgtext %ho; ((%component.mix;)+)>
+<!--end of msgtext.element-->]]>
+
+<!ENTITY % msgtext.attlist "INCLUDE">
+<![%msgtext.attlist;[
+<!ATTLIST msgtext
+		%common.attrib;
+		%msgtext.role.attrib;
+		%local.msgtext.attrib;
+>
+<!--end of msgtext.attlist-->]]>
+<!--end of msgtext.module-->]]>
+
+<!ENTITY % option.module "INCLUDE">
+<![%option.module;[
+<!ENTITY % local.option.attrib "">
+<!ENTITY % option.role.attrib "%role.attrib;">
+
+<!ENTITY % option.element "INCLUDE">
+<![%option.element;[
+<!ELEMENT option %ho; (%cptr.char.mix;)*>
+<!--end of option.element-->]]>
+
+<!ENTITY % option.attlist "INCLUDE">
+<![%option.attlist;[
+<!ATTLIST option
+		%common.attrib;
+		%option.role.attrib;
+		%local.option.attrib;
+>
+<!--end of option.attlist-->]]>
+<!--end of option.module-->]]>
+
+<!ENTITY % optional.module "INCLUDE">
+<![%optional.module;[
+<!ENTITY % local.optional.attrib "">
+<!ENTITY % optional.role.attrib "%role.attrib;">
+
+<!ENTITY % optional.element "INCLUDE">
+<![%optional.element;[
+<!ELEMENT optional %ho; (%cptr.char.mix;)*>
+<!--end of optional.element-->]]>
+
+<!ENTITY % optional.attlist "INCLUDE">
+<![%optional.attlist;[
+<!ATTLIST optional
+		%common.attrib;
+		%optional.role.attrib;
+		%local.optional.attrib;
+>
+<!--end of optional.attlist-->]]>
+<!--end of optional.module-->]]>
+
+<!ENTITY % parameter.module "INCLUDE">
+<![%parameter.module;[
+<!ENTITY % local.parameter.attrib "">
+<!ENTITY % parameter.role.attrib "%role.attrib;">
+
+<!ENTITY % parameter.element "INCLUDE">
+<![%parameter.element;[
+<!ELEMENT parameter %ho; (%cptr.char.mix;)*>
+<!--end of parameter.element-->]]>
+
+<!-- Class: Type of the Parameter; no default -->
+
+
+<!ENTITY % parameter.attlist "INCLUDE">
+<![%parameter.attlist;[
+<!ATTLIST parameter
+		class 		(command
+				|function
+				|option)	#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%parameter.role.attrib;
+		%local.parameter.attrib;
+>
+<!--end of parameter.attlist-->]]>
+<!--end of parameter.module-->]]>
+
+<!ENTITY % prompt.module "INCLUDE">
+<![%prompt.module;[
+<!ENTITY % local.prompt.attrib "">
+<!ENTITY % prompt.role.attrib "%role.attrib;">
+
+<!ENTITY % prompt.element "INCLUDE">
+<![%prompt.element;[
+<!ELEMENT prompt %ho; (%smallcptr.char.mix;|co)*>
+<!--end of prompt.element-->]]>
+
+<!ENTITY % prompt.attlist "INCLUDE">
+<![%prompt.attlist;[
+<!ATTLIST prompt
+		%moreinfo.attrib;
+		%common.attrib;
+		%prompt.role.attrib;
+		%local.prompt.attrib;
+>
+<!--end of prompt.attlist-->]]>
+<!--end of prompt.module-->]]>
+
+<!ENTITY % property.module "INCLUDE">
+<![%property.module;[
+<!ENTITY % local.property.attrib "">
+<!ENTITY % property.role.attrib "%role.attrib;">
+
+<!ENTITY % property.element "INCLUDE">
+<![%property.element;[
+<!ELEMENT property %ho; (%cptr.char.mix;)*>
+<!--end of property.element-->]]>
+
+<!ENTITY % property.attlist "INCLUDE">
+<![%property.attlist;[
+<!ATTLIST property
+		%moreinfo.attrib;
+		%common.attrib;
+		%property.role.attrib;
+		%local.property.attrib;
+>
+<!--end of property.attlist-->]]>
+<!--end of property.module-->]]>
+
+<!ENTITY % replaceable.module "INCLUDE">
+<![%replaceable.module;[
+<!ENTITY % local.replaceable.attrib "">
+<!ENTITY % replaceable.role.attrib "%role.attrib;">
+
+<!ENTITY % replaceable.element "INCLUDE">
+<![%replaceable.element;[
+<!ELEMENT replaceable %ho; (#PCDATA
+		| %link.char.class;
+		| optional
+		| %base.char.class;
+		| %other.char.class;
+		| inlinegraphic
+                | inlinemediaobject
+		| co)*>
+<!--end of replaceable.element-->]]>
+
+<!-- Class: Type of information the element represents; no
+		default -->
+
+
+<!ENTITY % replaceable.attlist "INCLUDE">
+<![%replaceable.attlist;[
+<!ATTLIST replaceable
+		class		(command
+				|function
+				|option
+				|parameter)	#IMPLIED
+		%common.attrib;
+		%replaceable.role.attrib;
+		%local.replaceable.attrib;
+>
+<!--end of replaceable.attlist-->]]>
+<!--end of replaceable.module-->]]>
+
+<!ENTITY % returnvalue.module "INCLUDE">
+<![%returnvalue.module;[
+<!ENTITY % local.returnvalue.attrib "">
+<!ENTITY % returnvalue.role.attrib "%role.attrib;">
+
+<!ENTITY % returnvalue.element "INCLUDE">
+<![%returnvalue.element;[
+<!ELEMENT returnvalue %ho; (%smallcptr.char.mix;)*>
+<!--end of returnvalue.element-->]]>
+
+<!ENTITY % returnvalue.attlist "INCLUDE">
+<![%returnvalue.attlist;[
+<!ATTLIST returnvalue
+		%common.attrib;
+		%returnvalue.role.attrib;
+		%local.returnvalue.attrib;
+>
+<!--end of returnvalue.attlist-->]]>
+<!--end of returnvalue.module-->]]>
+
+<!ENTITY % sgmltag.module "INCLUDE">
+<![%sgmltag.module;[
+<!ENTITY % local.sgmltag.attrib "">
+<!ENTITY % sgmltag.role.attrib "%role.attrib;">
+
+<!ENTITY % sgmltag.element "INCLUDE">
+<![%sgmltag.element;[
+<!ELEMENT sgmltag %ho; (%smallcptr.char.mix;)*>
+<!--end of sgmltag.element-->]]>
+
+<!-- Class: Type of SGML construct the element names; no default -->
+
+
+<!ENTITY % sgmltag.attlist "INCLUDE">
+<![%sgmltag.attlist;[
+<!ATTLIST sgmltag
+		class 		(attribute
+				|attvalue
+				|element
+				|endtag
+                                |emptytag
+				|genentity
+				|numcharref
+				|paramentity
+				|pi
+                                |xmlpi
+				|starttag
+				|sgmlcomment
+                                |prefix
+                                |namespace
+                                |localname)	#IMPLIED
+		namespace	CDATA		#IMPLIED
+		%common.attrib;
+		%sgmltag.role.attrib;
+		%local.sgmltag.attrib;
+>
+<!--end of sgmltag.attlist-->]]>
+<!--end of sgmltag.module-->]]>
+
+<!ENTITY % structfield.module "INCLUDE">
+<![%structfield.module;[
+<!ENTITY % local.structfield.attrib "">
+<!ENTITY % structfield.role.attrib "%role.attrib;">
+
+<!ENTITY % structfield.element "INCLUDE">
+<![%structfield.element;[
+<!ELEMENT structfield %ho; (%smallcptr.char.mix;)*>
+<!--end of structfield.element-->]]>
+
+<!ENTITY % structfield.attlist "INCLUDE">
+<![%structfield.attlist;[
+<!ATTLIST structfield
+		%common.attrib;
+		%structfield.role.attrib;
+		%local.structfield.attrib;
+>
+<!--end of structfield.attlist-->]]>
+<!--end of structfield.module-->]]>
+
+<!ENTITY % structname.module "INCLUDE">
+<![%structname.module;[
+<!ENTITY % local.structname.attrib "">
+<!ENTITY % structname.role.attrib "%role.attrib;">
+
+<!ENTITY % structname.element "INCLUDE">
+<![%structname.element;[
+<!ELEMENT structname %ho; (%smallcptr.char.mix;)*>
+<!--end of structname.element-->]]>
+
+<!ENTITY % structname.attlist "INCLUDE">
+<![%structname.attlist;[
+<!ATTLIST structname
+		%common.attrib;
+		%structname.role.attrib;
+		%local.structname.attrib;
+>
+<!--end of structname.attlist-->]]>
+<!--end of structname.module-->]]>
+
+<!ENTITY % symbol.module "INCLUDE">
+<![%symbol.module;[
+<!ENTITY % local.symbol.attrib "">
+<!ENTITY % symbol.role.attrib "%role.attrib;">
+
+<!ENTITY % symbol.element "INCLUDE">
+<![%symbol.element;[
+<!ELEMENT symbol %ho; (%smallcptr.char.mix;)*>
+<!--end of symbol.element-->]]>
+
+<!-- Class: Type of symbol; no default -->
+
+
+<!ENTITY % symbol.attlist "INCLUDE">
+<![%symbol.attlist;[
+<!ATTLIST symbol
+		class		(limit)		#IMPLIED
+		%common.attrib;
+		%symbol.role.attrib;
+		%local.symbol.attrib;
+>
+<!--end of symbol.attlist-->]]>
+<!--end of symbol.module-->]]>
+
+<!ENTITY % systemitem.module "INCLUDE">
+<![%systemitem.module;[
+<!ENTITY % local.systemitem.attrib "">
+<!ENTITY % systemitem.role.attrib "%role.attrib;">
+
+<!ENTITY % systemitem.element "INCLUDE">
+<![%systemitem.element;[
+<!ELEMENT systemitem %ho; (%cptr.char.mix; | acronym | co)*>
+<!--end of systemitem.element-->]]>
+
+<!-- Class: Type of system item the element names; no default -->
+
+<!ENTITY % systemitem.attlist "INCLUDE">
+<![%systemitem.attlist;[
+<!ATTLIST systemitem
+		class	(constant
+                        |daemon
+			|domainname
+			|etheraddress
+			|event
+			|eventhandler
+			|filesystem
+			|fqdomainname
+			|groupname
+			|ipaddress
+			|library
+			|macro
+			|netmask
+			|newsgroup
+			|osname
+                        |protocol
+			|resource
+			|systemname
+			|username
+                        |process
+                        |server
+                        |service)	#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%systemitem.role.attrib;
+		%local.systemitem.attrib;
+>
+<!--end of systemitem.attlist-->]]>
+<!--end of systemitem.module-->]]>
+
+<!ENTITY % uri.module "INCLUDE">
+<![%uri.module;[
+<!ENTITY % local.uri.attrib "">
+<!ENTITY % uri.role.attrib "%role.attrib;">
+
+<!ENTITY % uri.element "INCLUDE">
+<![%uri.element;[
+<!ELEMENT uri %ho; (%smallcptr.char.mix;)*>
+<!--end of uri.element-->]]>
+
+<!-- Type: Type of URI; no default -->
+
+<!ENTITY % uri.attlist "INCLUDE">
+<![%uri.attlist;[
+<!ATTLIST uri
+		type	CDATA	#IMPLIED
+		%common.attrib;
+		%uri.role.attrib;
+		%local.uri.attrib;
+>
+<!--end of uri.attlist-->]]>
+<!--end of uri.module-->]]>
+
+<!ENTITY % token.module "INCLUDE">
+<![%token.module;[
+<!ENTITY % local.token.attrib "">
+<!ENTITY % token.role.attrib "%role.attrib;">
+
+<!ENTITY % token.element "INCLUDE">
+<![%token.element;[
+<!ELEMENT token %ho; (%smallcptr.char.mix;)*>
+<!--end of token.element-->]]>
+
+<!ENTITY % token.attlist "INCLUDE">
+<![%token.attlist;[
+<!ATTLIST token
+		%common.attrib;
+		%token.role.attrib;
+		%local.token.attrib;
+>
+<!--end of token.attlist-->]]>
+<!--end of token.module-->]]>
+
+<!ENTITY % type.module "INCLUDE">
+<![%type.module;[
+<!ENTITY % local.type.attrib "">
+<!ENTITY % type.role.attrib "%role.attrib;">
+
+<!ENTITY % type.element "INCLUDE">
+<![%type.element;[
+<!ELEMENT type %ho; (%smallcptr.char.mix;)*>
+<!--end of type.element-->]]>
+
+<!ENTITY % type.attlist "INCLUDE">
+<![%type.attlist;[
+<!ATTLIST type
+		%common.attrib;
+		%type.role.attrib;
+		%local.type.attrib;
+>
+<!--end of type.attlist-->]]>
+<!--end of type.module-->]]>
+
+<!ENTITY % userinput.module "INCLUDE">
+<![%userinput.module;[
+<!ENTITY % local.userinput.attrib "">
+<!ENTITY % userinput.role.attrib "%role.attrib;">
+
+<!ENTITY % userinput.element "INCLUDE">
+<![%userinput.element;[
+<!ELEMENT userinput %ho; (%cptr.char.mix;|co)*>
+<!--end of userinput.element-->]]>
+
+<!ENTITY % userinput.attlist "INCLUDE">
+<![%userinput.attlist;[
+<!ATTLIST userinput
+		%moreinfo.attrib;
+		%common.attrib;
+		%userinput.role.attrib;
+		%local.userinput.attrib;
+>
+<!--end of userinput.attlist-->]]>
+<!--end of userinput.module-->]]>
+
+<!-- General words and phrases ............................................ -->
+
+<!ENTITY % abbrev.module "INCLUDE">
+<![%abbrev.module;[
+<!ENTITY % local.abbrev.attrib "">
+<!ENTITY % abbrev.role.attrib "%role.attrib;">
+
+<!ENTITY % abbrev.element "INCLUDE">
+<![%abbrev.element;[
+<!ELEMENT abbrev %ho; (%word.char.mix;)*>
+<!--end of abbrev.element-->]]>
+
+<!ENTITY % abbrev.attlist "INCLUDE">
+<![%abbrev.attlist;[
+<!ATTLIST abbrev
+		%common.attrib;
+		%abbrev.role.attrib;
+		%local.abbrev.attrib;
+>
+<!--end of abbrev.attlist-->]]>
+<!--end of abbrev.module-->]]>
+
+<!ENTITY % acronym.module "INCLUDE">
+<![%acronym.module;[
+<!ENTITY % local.acronym.attrib "">
+<!ENTITY % acronym.role.attrib "%role.attrib;">
+
+<!ENTITY % acronym.element "INCLUDE">
+<![%acronym.element;[
+<!ELEMENT acronym %ho; (%word.char.mix;)*
+		%acronym.exclusion;>
+<!--end of acronym.element-->]]>
+
+<!ENTITY % acronym.attlist "INCLUDE">
+<![%acronym.attlist;[
+<!ATTLIST acronym
+		%common.attrib;
+		%acronym.role.attrib;
+		%local.acronym.attrib;
+>
+<!--end of acronym.attlist-->]]>
+<!--end of acronym.module-->]]>
+
+<!ENTITY % citation.module "INCLUDE">
+<![%citation.module;[
+<!ENTITY % local.citation.attrib "">
+<!ENTITY % citation.role.attrib "%role.attrib;">
+
+<!ENTITY % citation.element "INCLUDE">
+<![%citation.element;[
+<!ELEMENT citation %ho; (%para.char.mix;)*>
+<!--end of citation.element-->]]>
+
+<!ENTITY % citation.attlist "INCLUDE">
+<![%citation.attlist;[
+<!ATTLIST citation
+		%common.attrib;
+		%citation.role.attrib;
+		%local.citation.attrib;
+>
+<!--end of citation.attlist-->]]>
+<!--end of citation.module-->]]>
+
+<!ENTITY % citerefentry.module "INCLUDE">
+<![%citerefentry.module;[
+<!ENTITY % local.citerefentry.attrib "">
+<!ENTITY % citerefentry.role.attrib "%role.attrib;">
+
+<!ENTITY % citerefentry.element "INCLUDE">
+<![%citerefentry.element;[
+<!ELEMENT citerefentry %ho; (refentrytitle, manvolnum?)>
+<!--end of citerefentry.element-->]]>
+
+<!ENTITY % citerefentry.attlist "INCLUDE">
+<![%citerefentry.attlist;[
+<!ATTLIST citerefentry
+		%common.attrib;
+		%citerefentry.role.attrib;
+		%local.citerefentry.attrib;
+>
+<!--end of citerefentry.attlist-->]]>
+<!--end of citerefentry.module-->]]>
+
+<!ENTITY % refentrytitle.module "INCLUDE">
+<![%refentrytitle.module;[
+<!ENTITY % local.refentrytitle.attrib "">
+<!ENTITY % refentrytitle.role.attrib "%role.attrib;">
+
+<!ENTITY % refentrytitle.element "INCLUDE">
+<![%refentrytitle.element;[
+<!ELEMENT refentrytitle %ho; (%para.char.mix;)*>
+<!--end of refentrytitle.element-->]]>
+
+<!ENTITY % refentrytitle.attlist "INCLUDE">
+<![%refentrytitle.attlist;[
+<!ATTLIST refentrytitle
+		%common.attrib;
+		%refentrytitle.role.attrib;
+		%local.refentrytitle.attrib;
+>
+<!--end of refentrytitle.attlist-->]]>
+<!--end of refentrytitle.module-->]]>
+
+<!ENTITY % manvolnum.module "INCLUDE">
+<![%manvolnum.module;[
+<!ENTITY % local.manvolnum.attrib "">
+<!ENTITY % namvolnum.role.attrib "%role.attrib;">
+
+<!ENTITY % manvolnum.element "INCLUDE">
+<![%manvolnum.element;[
+<!ELEMENT manvolnum %ho; (%word.char.mix;)*>
+<!--end of manvolnum.element-->]]>
+
+<!ENTITY % manvolnum.attlist "INCLUDE">
+<![%manvolnum.attlist;[
+<!ATTLIST manvolnum
+		%common.attrib;
+		%namvolnum.role.attrib;
+		%local.manvolnum.attrib;
+>
+<!--end of manvolnum.attlist-->]]>
+<!--end of manvolnum.module-->]]>
+
+<!ENTITY % citetitle.module "INCLUDE">
+<![%citetitle.module;[
+<!ENTITY % local.citetitle.attrib "">
+<!ENTITY % citetitle.role.attrib "%role.attrib;">
+
+<!ENTITY % citetitle.element "INCLUDE">
+<![%citetitle.element;[
+<!ELEMENT citetitle %ho; (%para.char.mix;)*>
+<!--end of citetitle.element-->]]>
+
+<!-- Pubwork: Genre of published work cited; no default -->
+
+
+<!ENTITY % citetitle.attlist "INCLUDE">
+<![%citetitle.attlist;[
+<!ATTLIST citetitle
+		pubwork		(article
+				|book
+				|chapter
+				|part
+				|refentry
+				|section
+				|journal
+				|series
+				|set
+				|manuscript
+				|cdrom
+				|dvd
+				|wiki
+				|gopher
+				|bbs
+                                |emailmessage
+                                |webpage
+                                |newsposting)	#IMPLIED
+		%common.attrib;
+		%citetitle.role.attrib;
+		%local.citetitle.attrib;
+>
+<!--end of citetitle.attlist-->]]>
+<!--end of citetitle.module-->]]>
+
+<!ENTITY % emphasis.module "INCLUDE">
+<![%emphasis.module;[
+<!ENTITY % local.emphasis.attrib "">
+<!ENTITY % emphasis.role.attrib "%role.attrib;">
+
+<!ENTITY % emphasis.element "INCLUDE">
+<![%emphasis.element;[
+<!ELEMENT emphasis %ho; (%para.char.mix;)*>
+<!--end of emphasis.element-->]]>
+
+<!ENTITY % emphasis.attlist "INCLUDE">
+<![%emphasis.attlist;[
+<!ATTLIST emphasis
+		%common.attrib;
+		%emphasis.role.attrib;
+		%local.emphasis.attrib;
+>
+<!--end of emphasis.attlist-->]]>
+<!--end of emphasis.module-->]]>
+
+<!ENTITY % foreignphrase.module "INCLUDE">
+<![%foreignphrase.module;[
+<!ENTITY % local.foreignphrase.attrib "">
+<!ENTITY % foreignphrase.role.attrib "%role.attrib;">
+
+<!ENTITY % foreignphrase.element "INCLUDE">
+<![%foreignphrase.element;[
+<!ELEMENT foreignphrase %ho; (%para.char.mix;)*>
+<!--end of foreignphrase.element-->]]>
+
+<!ENTITY % foreignphrase.attlist "INCLUDE">
+<![%foreignphrase.attlist;[
+<!ATTLIST foreignphrase
+		%common.attrib;
+		%foreignphrase.role.attrib;
+		%local.foreignphrase.attrib;
+>
+<!--end of foreignphrase.attlist-->]]>
+<!--end of foreignphrase.module-->]]>
+
+<!ENTITY % glossterm.module "INCLUDE">
+<![%glossterm.module;[
+<!ENTITY % local.glossterm.attrib "">
+<!ENTITY % glossterm.role.attrib "%role.attrib;">
+
+<!ENTITY % glossterm.element "INCLUDE">
+<![%glossterm.element;[
+<!ELEMENT glossterm %ho; (%para.char.mix;)*
+		%glossterm.exclusion;>
+<!--end of glossterm.element-->]]>
+
+<!-- to GlossEntry if Glossterm used in text -->
+<!-- BaseForm: Provides the form of GlossTerm to be used
+		for indexing -->
+
+<!ENTITY % glossterm.attlist "INCLUDE">
+<![%glossterm.attlist;[
+<!ATTLIST glossterm
+		baseform	CDATA		#IMPLIED
+		%linkend.attrib;
+		%common.attrib;
+		%glossterm.role.attrib;
+		%local.glossterm.attrib;
+>
+<!--end of glossterm.attlist-->]]>
+<!--end of glossterm.module-->]]>
+
+<!ENTITY % firstterm.module "INCLUDE">
+<![%firstterm.module;[
+<!ENTITY % local.firstterm.attrib "">
+<!ENTITY % firstterm.role.attrib "%role.attrib;">
+
+<!ENTITY % firstterm.element "INCLUDE">
+<![%firstterm.element;[
+<!ELEMENT firstterm %ho; (%para.char.mix;)*
+		%glossterm.exclusion;>
+<!--end of firstterm.element-->]]>
+
+<!-- to GlossEntry or other explanation -->
+
+
+<!ENTITY % firstterm.attlist "INCLUDE">
+<![%firstterm.attlist;[
+<!ATTLIST firstterm
+		baseform	CDATA		#IMPLIED
+		%linkend.attrib;
+		%common.attrib;
+		%firstterm.role.attrib;
+		%local.firstterm.attrib;
+>
+<!--end of firstterm.attlist-->]]>
+<!--end of firstterm.module-->]]>
+
+<!ENTITY % phrase.module "INCLUDE">
+<![%phrase.module;[
+<!ENTITY % local.phrase.attrib "">
+<!ENTITY % phrase.role.attrib "%role.attrib;">
+
+<!ENTITY % phrase.element "INCLUDE">
+<![%phrase.element;[
+<!ELEMENT phrase %ho; (%para.char.mix;)*>
+<!--end of phrase.element-->]]>
+
+<!ENTITY % phrase.attlist "INCLUDE">
+<![%phrase.attlist;[
+<!ATTLIST phrase
+		%common.attrib;
+		%phrase.role.attrib;
+		%local.phrase.attrib;
+>
+<!--end of phrase.attlist-->]]>
+<!--end of phrase.module-->]]>
+
+<!ENTITY % quote.module "INCLUDE">
+<![%quote.module;[
+<!ENTITY % local.quote.attrib "">
+<!ENTITY % quote.role.attrib "%role.attrib;">
+
+<!ENTITY % quote.element "INCLUDE">
+<![%quote.element;[
+<!ELEMENT quote %ho; (%para.char.mix;)*>
+<!--end of quote.element-->]]>
+
+<!ENTITY % quote.attlist "INCLUDE">
+<![%quote.attlist;[
+<!ATTLIST quote
+		%common.attrib;
+		%quote.role.attrib;
+		%local.quote.attrib;
+>
+<!--end of quote.attlist-->]]>
+<!--end of quote.module-->]]>
+
+<!ENTITY % ssscript.module "INCLUDE">
+<![%ssscript.module;[
+<!ENTITY % local.ssscript.attrib "">
+<!ENTITY % ssscript.role.attrib "%role.attrib;">
+
+<!ENTITY % subscript.element "INCLUDE">
+<![%subscript.element;[
+<!ELEMENT subscript %ho; (#PCDATA
+		| %link.char.class;
+		| emphasis
+		| replaceable
+		| symbol
+		| inlinegraphic
+                | inlinemediaobject
+		| %base.char.class;
+		| %other.char.class;)*
+		%ubiq.exclusion;>
+<!--end of subscript.element-->]]>
+
+<!ENTITY % subscript.attlist "INCLUDE">
+<![%subscript.attlist;[
+<!ATTLIST subscript
+		%common.attrib;
+		%ssscript.role.attrib;
+		%local.ssscript.attrib;
+>
+<!--end of subscript.attlist-->]]>
+
+<!ENTITY % superscript.element "INCLUDE">
+<![%superscript.element;[
+<!ELEMENT superscript %ho; (#PCDATA
+		| %link.char.class;
+		| emphasis
+		| replaceable
+		| symbol
+		| inlinegraphic
+                | inlinemediaobject
+		| %base.char.class;
+		| %other.char.class;)*
+		%ubiq.exclusion;>
+<!--end of superscript.element-->]]>
+
+<!ENTITY % superscript.attlist "INCLUDE">
+<![%superscript.attlist;[
+<!ATTLIST superscript
+		%common.attrib;
+		%ssscript.role.attrib;
+		%local.ssscript.attrib;
+>
+<!--end of superscript.attlist-->]]>
+<!--end of ssscript.module-->]]>
+
+<!ENTITY % trademark.module "INCLUDE">
+<![%trademark.module;[
+<!ENTITY % local.trademark.attrib "">
+<!ENTITY % trademark.role.attrib "%role.attrib;">
+
+<!ENTITY % trademark.element "INCLUDE">
+<![%trademark.element;[
+<!ELEMENT trademark %ho; (#PCDATA
+		| %link.char.class;
+		| %tech.char.class;
+		| %base.char.class;
+		| %other.char.class;
+		| inlinegraphic
+                | inlinemediaobject
+		| emphasis)*>
+<!--end of trademark.element-->]]>
+
+<!-- Class: More precisely identifies the item the element names -->
+
+
+<!ENTITY % trademark.attlist "INCLUDE">
+<![%trademark.attlist;[
+<!ATTLIST trademark
+		class		(service
+				|trade
+				|registered
+				|copyright)	'trade'
+		%common.attrib;
+		%trademark.role.attrib;
+		%local.trademark.attrib;
+>
+<!--end of trademark.attlist-->]]>
+<!--end of trademark.module-->]]>
+
+<!ENTITY % wordasword.module "INCLUDE">
+<![%wordasword.module;[
+<!ENTITY % local.wordasword.attrib "">
+<!ENTITY % wordasword.role.attrib "%role.attrib;">
+
+<!ENTITY % wordasword.element "INCLUDE">
+<![%wordasword.element;[
+<!ELEMENT wordasword %ho; (%word.char.mix;)*>
+<!--end of wordasword.element-->]]>
+
+<!ENTITY % wordasword.attlist "INCLUDE">
+<![%wordasword.attlist;[
+<!ATTLIST wordasword
+		%common.attrib;
+		%wordasword.role.attrib;
+		%local.wordasword.attrib;
+>
+<!--end of wordasword.attlist-->]]>
+<!--end of wordasword.module-->]]>
+
+<!-- Links and cross-references ........................................... -->
+
+<!ENTITY % link.module "INCLUDE">
+<![%link.module;[
+<!ENTITY % local.link.attrib "">
+<!ENTITY % link.role.attrib "%role.attrib;">
+
+<!ENTITY % link.element "INCLUDE">
+<![%link.element;[
+<!ELEMENT link %ho; (%para.char.mix;)*
+		%links.exclusion;>
+<!--end of link.element-->]]>
+
+<!-- Endterm: ID of element containing text that is to be
+		fetched from elsewhere in the document to appear as
+		the content of this element -->
+<!-- to linked-to object -->
+<!-- Type: Freely assignable parameter -->
+
+
+<!ENTITY % link.attlist "INCLUDE">
+<![%link.attlist;[
+<!ATTLIST link
+		endterm		IDREF		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		type		CDATA		#IMPLIED
+		%linkendreq.attrib;
+		%common.attrib;
+		%link.role.attrib;
+		%local.link.attrib;
+>
+<!--end of link.attlist-->]]>
+<!--end of link.module-->]]>
+
+<!ENTITY % olink.module "INCLUDE">
+<![%olink.module;[
+<!ENTITY % local.olink.attrib "">
+<!ENTITY % olink.role.attrib "%role.attrib;">
+
+<!ENTITY % olink.element "INCLUDE">
+<![%olink.element;[
+<!ELEMENT olink %ho; (%para.char.mix;)*
+		%links.exclusion;>
+<!--end of olink.element-->]]>
+
+<!-- TargetDocEnt: Name of an entity to be the target of the link -->
+<!-- LinkMode: ID of a ModeSpec containing instructions for
+		operating on the entity named by TargetDocEnt -->
+<!-- LocalInfo: Information that may be passed to ModeSpec -->
+<!-- Type: Freely assignable parameter -->
+
+
+<!ENTITY % olink.attlist "INCLUDE">
+<![%olink.attlist;[
+<!ATTLIST olink
+		targetdocent	ENTITY 		#IMPLIED
+		linkmode	IDREF		#IMPLIED
+		localinfo 	CDATA		#IMPLIED
+		type		CDATA		#IMPLIED
+		targetdoc	CDATA		#IMPLIED
+		targetptr	CDATA		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		%common.attrib;
+		%olink.role.attrib;
+		%local.olink.attrib;
+>
+<!--end of olink.attlist-->]]>
+<!--end of olink.module-->]]>
+
+<!ENTITY % ulink.module "INCLUDE">
+<![%ulink.module;[
+<!ENTITY % local.ulink.attrib "">
+<!ENTITY % ulink.role.attrib "%role.attrib;">
+
+<!ENTITY % ulink.element "INCLUDE">
+<![%ulink.element;[
+<!ELEMENT ulink %ho; (%para.char.mix;)*
+		%links.exclusion;>
+<!--end of ulink.element-->]]>
+
+<!-- URL: uniform resource locator; the target of the ULink -->
+<!-- Type: Freely assignable parameter -->
+
+
+<!ENTITY % ulink.attlist "INCLUDE">
+<![%ulink.attlist;[
+<!ATTLIST ulink
+		url		CDATA		#REQUIRED
+		type		CDATA		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		%common.attrib;
+		%ulink.role.attrib;
+		%local.ulink.attrib;
+>
+<!--end of ulink.attlist-->]]>
+<!--end of ulink.module-->]]>
+
+<!ENTITY % footnoteref.module "INCLUDE">
+<![%footnoteref.module;[
+<!ENTITY % local.footnoteref.attrib "">
+<!ENTITY % footnoteref.role.attrib "%role.attrib;">
+
+<!ENTITY % footnoteref.element "INCLUDE">
+<![%footnoteref.element;[
+<!ELEMENT footnoteref %ho; EMPTY>
+<!--end of footnoteref.element-->]]>
+
+<!-- to footnote content supplied elsewhere -->
+
+
+<!ENTITY % footnoteref.attlist "INCLUDE">
+<![%footnoteref.attlist;[
+<!ATTLIST footnoteref
+		%linkendreq.attrib;		%label.attrib;
+		%common.attrib;
+		%footnoteref.role.attrib;
+		%local.footnoteref.attrib;
+>
+<!--end of footnoteref.attlist-->]]>
+<!--end of footnoteref.module-->]]>
+
+<!ENTITY % xref.module "INCLUDE">
+<![%xref.module;[
+<!ENTITY % local.xref.attrib "">
+<!ENTITY % xref.role.attrib "%role.attrib;">
+
+<!ENTITY % xref.element "INCLUDE">
+<![%xref.element;[
+<!ELEMENT xref %ho; EMPTY>
+<!--end of xref.element-->]]>
+
+<!-- Endterm: ID of element containing text that is to be
+		fetched from elsewhere in the document to appear as
+		the content of this element -->
+<!-- to linked-to object -->
+
+
+<!ENTITY % xref.attlist "INCLUDE">
+<![%xref.attlist;[
+<!ATTLIST xref
+		endterm		IDREF		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		%common.attrib;
+		%linkendreq.attrib;
+		%xref.role.attrib;
+		%local.xref.attrib;
+>
+<!--end of xref.attlist-->]]>
+<!--end of xref.module-->]]>
+
+<!ENTITY % biblioref.module "INCLUDE">
+<![%biblioref.module;[
+<!ENTITY % local.biblioref.attrib "">
+<!ENTITY % biblioref.role.attrib "%role.attrib;">
+
+<!ENTITY % biblioref.element "INCLUDE">
+<![%biblioref.element;[
+<!ELEMENT biblioref %ho; EMPTY>
+<!--end of biblioref.element-->]]>
+
+<!ENTITY % biblioref.attlist "INCLUDE">
+<![%biblioref.attlist;[
+<!ATTLIST biblioref
+		endterm		IDREF		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		units		CDATA		#IMPLIED
+		begin		CDATA		#IMPLIED
+		end		CDATA		#IMPLIED
+		%common.attrib;
+		%linkendreq.attrib;
+		%biblioref.role.attrib;
+		%local.biblioref.attrib;
+>
+<!--end of biblioref.attlist-->]]>
+<!--end of biblioref.module-->]]>
+
+<!-- Ubiquitous elements .................................................. -->
+
+<!ENTITY % anchor.module "INCLUDE">
+<![%anchor.module;[
+<!ENTITY % local.anchor.attrib "">
+<!ENTITY % anchor.role.attrib "%role.attrib;">
+
+<!ENTITY % anchor.element "INCLUDE">
+<![%anchor.element;[
+<!ELEMENT anchor %ho; EMPTY>
+<!--end of anchor.element-->]]>
+
+<!-- required -->
+<!-- replaces Lang -->
+
+
+<!ENTITY % anchor.attlist "INCLUDE">
+<![%anchor.attlist;[
+<!ATTLIST anchor
+		%idreq.attrib;		%pagenum.attrib;		%remap.attrib;
+		%xreflabel.attrib;
+		%revisionflag.attrib;
+		%effectivity.attrib;
+		%anchor.role.attrib;
+		%local.anchor.attrib;
+>
+<!--end of anchor.attlist-->]]>
+<!--end of anchor.module-->]]>
+
+<!ENTITY % beginpage.module "INCLUDE">
+<![%beginpage.module;[
+<!ENTITY % local.beginpage.attrib "">
+<!ENTITY % beginpage.role.attrib "%role.attrib;">
+
+<!ENTITY % beginpage.element "INCLUDE">
+<![%beginpage.element;[
+<!ELEMENT beginpage %ho; EMPTY>
+<!--end of beginpage.element-->]]>
+
+<!-- PageNum: Number of page that begins at this point -->
+
+
+<!ENTITY % beginpage.attlist "INCLUDE">
+<![%beginpage.attlist;[
+<!ATTLIST beginpage
+		%pagenum.attrib;
+		%common.attrib;
+		%beginpage.role.attrib;
+		%local.beginpage.attrib;
+>
+<!--end of beginpage.attlist-->]]>
+<!--end of beginpage.module-->]]>
+
+<!-- IndexTerms appear in the text flow for generating or linking an
+     index. -->
+
+<!ENTITY % indexterm.content.module "INCLUDE">
+<![%indexterm.content.module;[
+<!ENTITY % indexterm.module "INCLUDE">
+<![%indexterm.module;[
+<!ENTITY % local.indexterm.attrib "">
+<!ENTITY % indexterm.role.attrib "%role.attrib;">
+
+<!ENTITY % indexterm.element "INCLUDE">
+<![%indexterm.element;[
+<!ELEMENT indexterm %ho; (primary?, ((secondary, ((tertiary, (see|seealso+)?)
+		| see | seealso+)?) | see | seealso+)?)
+			%ubiq.exclusion;>
+<!--end of indexterm.element-->]]>
+
+<!-- Scope: Indicates which generated indices the IndexTerm
+		should appear in: Global (whole document set), Local (this
+		document only), or All (both) -->
+<!-- Significance: Whether this IndexTerm is the most pertinent
+		of its series (Preferred) or not (Normal, the default) -->
+<!-- Class: Indicates type of IndexTerm; default is Singular,
+		or EndOfRange if StartRef is supplied; StartOfRange value
+		must be supplied explicitly on starts of ranges -->
+<!-- StartRef: ID of the IndexTerm that starts the indexing
+		range ended by this IndexTerm -->
+<!-- Zone: IDs of the elements to which the IndexTerm applies,
+		and indicates that the IndexTerm applies to those entire
+		elements rather than the point at which the IndexTerm
+		occurs -->
+
+
+<!ENTITY % indexterm.attlist "INCLUDE">
+<![%indexterm.attlist;[
+<!ATTLIST indexterm
+		%pagenum.attrib;
+		scope		(all
+				|global
+				|local)		#IMPLIED
+		significance	(preferred
+				|normal)	"normal"
+		class		(singular
+				|startofrange
+				|endofrange)	#IMPLIED
+		startref	IDREF		#IMPLIED
+		zone		IDREFS		#IMPLIED
+		type		CDATA		#IMPLIED
+		%common.attrib;
+		%indexterm.role.attrib;
+		%local.indexterm.attrib;
+>
+<!--end of indexterm.attlist-->]]>
+<!--end of indexterm.module-->]]>
+
+<!ENTITY % primsecter.module "INCLUDE">
+<![%primsecter.module;[
+<!ENTITY % local.primsecter.attrib "">
+<!ENTITY % primsecter.role.attrib "%role.attrib;">
+
+
+<!ENTITY % primary.element "INCLUDE">
+<![%primary.element;[
+<!ELEMENT primary %ho;   (%ndxterm.char.mix;)*>
+<!--end of primary.element-->]]>
+<!-- SortAs: Alternate sort string for index sorting, e.g.,
+		"fourteen" for an element containing "14" -->
+
+<!ENTITY % primary.attlist "INCLUDE">
+<![%primary.attlist;[
+<!ATTLIST primary
+		sortas		CDATA		#IMPLIED
+		%common.attrib;
+		%primsecter.role.attrib;
+		%local.primsecter.attrib;
+>
+<!--end of primary.attlist-->]]>
+
+
+<!ENTITY % secondary.element "INCLUDE">
+<![%secondary.element;[
+<!ELEMENT secondary %ho; (%ndxterm.char.mix;)*>
+<!--end of secondary.element-->]]>
+<!-- SortAs: Alternate sort string for index sorting, e.g.,
+		"fourteen" for an element containing "14" -->
+
+<!ENTITY % secondary.attlist "INCLUDE">
+<![%secondary.attlist;[
+<!ATTLIST secondary
+		sortas		CDATA		#IMPLIED
+		%common.attrib;
+		%primsecter.role.attrib;
+		%local.primsecter.attrib;
+>
+<!--end of secondary.attlist-->]]>
+
+
+<!ENTITY % tertiary.element "INCLUDE">
+<![%tertiary.element;[
+<!ELEMENT tertiary %ho;  (%ndxterm.char.mix;)*>
+<!--end of tertiary.element-->]]>
+<!-- SortAs: Alternate sort string for index sorting, e.g.,
+		"fourteen" for an element containing "14" -->
+
+<!ENTITY % tertiary.attlist "INCLUDE">
+<![%tertiary.attlist;[
+<!ATTLIST tertiary
+		sortas		CDATA		#IMPLIED
+		%common.attrib;
+		%primsecter.role.attrib;
+		%local.primsecter.attrib;
+>
+<!--end of tertiary.attlist-->]]>
+
+<!--end of primsecter.module-->]]>
+
+<!ENTITY % seeseealso.module "INCLUDE">
+<![%seeseealso.module;[
+<!ENTITY % local.seeseealso.attrib "">
+<!ENTITY % seeseealso.role.attrib "%role.attrib;">
+
+<!ENTITY % see.element "INCLUDE">
+<![%see.element;[
+<!ELEMENT see %ho; (%ndxterm.char.mix;)*>
+<!--end of see.element-->]]>
+
+<!ENTITY % see.attlist "INCLUDE">
+<![%see.attlist;[
+<!ATTLIST see
+		%common.attrib;
+		%seeseealso.role.attrib;
+		%local.seeseealso.attrib;
+>
+<!--end of see.attlist-->]]>
+
+<!ENTITY % seealso.element "INCLUDE">
+<![%seealso.element;[
+<!ELEMENT seealso %ho; (%ndxterm.char.mix;)*>
+<!--end of seealso.element-->]]>
+
+<!ENTITY % seealso.attlist "INCLUDE">
+<![%seealso.attlist;[
+<!ATTLIST seealso
+		%common.attrib;
+		%seeseealso.role.attrib;
+		%local.seeseealso.attrib;
+>
+<!--end of seealso.attlist-->]]>
+<!--end of seeseealso.module-->]]>
+<!--end of indexterm.content.module-->]]>
+
+<!-- End of DocBook XML information pool module V4.4 ...................... -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting/docbookx.dtd b/xml/tests/testData/xml/DocBookHighlighting/docbookx.dtd
new file mode 100644
index 0000000..e93b6018
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting/docbookx.dtd
@@ -0,0 +1,170 @@
+<!-- ...................................................................... -->
+<!-- DocBook XML DTD V4.4 ................................................. -->
+<!-- File docbookx.dtd .................................................... -->
+
+<!-- Copyright 1992-2004 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     See also http://docbook.org/specs/
+
+     $Id: docbookx.dtd,v 1.31 2005/01/27 13:52:36 nwalsh Exp $
+
+     Permission to use, copy, modify and distribute the DocBook XML DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This is the driver file for V4.4 of the DocBook DTD.
+     Please use the following formal public identifier to identify it:
+
+     "-//OASIS//DTD DocBook XML V4.4//EN"
+
+     For example, if your document's top-level element is Book, and
+     you are using DocBook directly, use the FPI in the DOCTYPE
+     declaration:
+
+     <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+                    "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
+                    [...]>
+
+     Or, if you have a higher-level driver file that customizes DocBook,
+     use the FPI in the parameter entity declaration:
+
+     <!ENTITY % DocBookDTD PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+                "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+     %DocBookDTD;
+
+     See the documentation for detailed information on the parameter
+     entity and module scheme used in DocBook, customizing DocBook and
+     planning for interchange, and changes made since the last release
+     of DocBook.
+-->
+
+<!-- ...................................................................... -->
+<!-- Enable SGML features ................................................. -->
+
+<!ENTITY % sgml.features "IGNORE">
+<![%sgml.features;[
+<!ENTITY % xml.features "IGNORE">
+]]>
+<!ENTITY % xml.features "INCLUDE">
+
+<![%sgml.features;[
+<![%xml.features;[
+
+<!-- ERROR: Exactly one of xml.features and sgml.features must be turned on! -->
+<!ENTITY % dbnotn SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+<!ENTITY % dbcent SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+<!ENTITY % dbpool SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+<!ENTITY % dbhier SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+<!ENTITY % dbgenent SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+
+]]>
+]]>
+
+<![%sgml.features;[
+<!ENTITY % ho "- O">
+<!ENTITY % hh "- -">
+]]>
+
+<![%xml.features;[
+<!ENTITY % ho "">
+<!ENTITY % hh "">
+]]>
+
+<!-- ...................................................................... -->
+<!-- Notation declarations ................................................ -->
+
+<!ENTITY % dbnotn.module "INCLUDE">
+<![%dbnotn.module;[
+<!ENTITY % dbnotn PUBLIC
+"-//OASIS//ENTITIES DocBook Notations V4.4//EN"
+"dbnotnx.mod">
+%dbnotn;
+]]>
+
+<!-- ...................................................................... -->
+<!-- ISO character entity sets ............................................ -->
+
+<!ENTITY % dbcent.module "INCLUDE">
+<![%dbcent.module;[
+
+<!ENTITY % dbcent.euro "INCLUDE">
+<![%dbcent.euro;[
+<![%sgml.features;[
+<!ENTITY euro SDATA "[euro  ]"><!-- euro sign -->
+]]>
+<![%xml.features;[
+<!ENTITY euro "&#x20AC;"><!-- euro sign, U+20AC NEW -->
+]]>
+]]>
+
+<!ENTITY % dbcent PUBLIC
+"-//OASIS//ENTITIES DocBook Character Entities V4.4//EN"
+"dbcentx.mod">
+%dbcent;
+]]>
+
+<!-- ...................................................................... -->
+<!-- DTD modules .......................................................... -->
+
+<!-- Information pool .............. -->
+
+<!ENTITY % dbpool.module "INCLUDE">
+<![ %dbpool.module; [
+<!ENTITY % dbpool PUBLIC
+"-//OASIS//ELEMENTS DocBook Information Pool V4.4//EN"
+"dbpoolx.mod">
+%dbpool;
+]]>
+
+<!-- Redeclaration placeholder ..... -->
+
+<!ENTITY % intermod.redecl.module "IGNORE">
+<![%intermod.redecl.module;[
+<!-- Defining rdbmods here makes some buggy XML parsers happy. -->
+<!ENTITY % rdbmods "">
+%rdbmods;
+<!--end of intermod.redecl.module-->]]>
+
+<!-- Document hierarchy ............ -->
+
+<!ENTITY % dbhier.module "INCLUDE">
+<![ %dbhier.module; [
+<!ENTITY % dbhier PUBLIC
+"-//OASIS//ELEMENTS DocBook Document Hierarchy V4.4//EN"
+"dbhierx.mod">
+%dbhier;
+]]>
+
+<!-- ...................................................................... -->
+<!-- Other general entities ............................................... -->
+
+<!ENTITY % dbgenent.module "INCLUDE">
+<![ %dbgenent.module; [
+<!ENTITY % dbgenent PUBLIC
+"-//OASIS//ENTITIES DocBook Additional General Entities V4.4//EN"
+"dbgenent.mod">
+%dbgenent;
+]]>
+
+<!-- End of DocBook XML DTD V4.4 .......................................... -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting/htmltblx.mod b/xml/tests/testData/xml/DocBookHighlighting/htmltblx.mod
new file mode 100644
index 0000000..7805a9f
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting/htmltblx.mod
@@ -0,0 +1,237 @@
+<!-- ...................................................................... -->
+<!-- DocBook XML HTML Table Module V4.4 ................................... -->
+<!-- File htmltblx.mod .................................................... -->
+
+<!-- Copyright 2003, 2004 ArborText, Inc., Norman Walsh, Sun Microsystems,
+     Inc., and the Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     $Id: htmltblx.mod,v 1.23 2005/01/27 13:52:00 nwalsh Exp $
+
+     Permission to use, copy, modify and distribute the DocBook XML DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook XML DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This module contains the definitions for elements that are
+     isomorphic to the HTML elements. One could argue we should
+     instead have based ourselves on the XHTML Table Module, but the
+     HTML one is more like what browsers are likely to accept today
+     and users are likely to use.
+
+     This module has been developed for use with the DocBook V4.4
+     "union table model" in which elements and attlists common to both
+     models are defined (as the union) in the CALS table module by
+     setting various parameter entities appropriately in this file.
+
+     In DTD driver files referring to this module, please use an entity
+     declaration that uses the public identifier shown below:
+
+     <!ENTITY % htmltbl PUBLIC
+     "-//OASIS//ELEMENTS DocBook XML HTML Tables V4.4//EN"
+     "htmltblx.mod">
+     %htmltbl;
+
+     See the documentation for detailed information on the parameter
+     entity and module scheme used in DocBook, customizing DocBook and
+     planning for interchange, and changes made since the last release
+     of DocBook.
+-->
+
+<!--======================= XHTML Tables =======================================-->
+
+<!ENTITY % html.coreattrs
+ "id          ID             #IMPLIED
+  class       CDATA          #IMPLIED
+  style       CDATA          #IMPLIED
+  title       CDATA         #IMPLIED"
+  >
+
+<!-- Does not contain lang or dir because they are in %common.attribs -->
+<!ENTITY % i18n
+ "xml:lang    NMTOKEN        #IMPLIED"
+  >
+
+<!ENTITY % events
+ "onclick     CDATA       #IMPLIED
+  ondblclick  CDATA       #IMPLIED
+  onmousedown CDATA       #IMPLIED
+  onmouseup   CDATA       #IMPLIED
+  onmouseover CDATA       #IMPLIED
+  onmousemove CDATA       #IMPLIED
+  onmouseout  CDATA       #IMPLIED
+  onkeypress  CDATA       #IMPLIED
+  onkeydown   CDATA       #IMPLIED
+  onkeyup     CDATA       #IMPLIED"
+  >
+
+<!ENTITY % attrs "%html.coreattrs; %i18n; %events;">
+
+<!ENTITY % cellhalign
+  "align      (left|center|right|justify|char) #IMPLIED
+   char       CDATA    #IMPLIED
+   charoff    CDATA       #IMPLIED"
+  >
+
+<!ENTITY % cellvalign
+  "valign     (top|middle|bottom|baseline) #IMPLIED"
+  >
+
+<!ELEMENT colgroup (col)*>
+<!ELEMENT col      EMPTY>
+<!ELEMENT tr       (th|td)+>
+<!ELEMENT th       (%para.char.mix; | %tabentry.mix; | table | informaltable)*>
+<!ELEMENT td       (%para.char.mix; | %tabentry.mix; | table | informaltable)*>
+
+<!ATTLIST colgroup
+  %attrs;
+  span        CDATA       "1"
+  width       CDATA  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST col
+  %attrs;
+  span        CDATA       "1"
+  width       CDATA  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tr
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  bgcolor     CDATA        #IMPLIED
+  >
+
+<!ATTLIST th
+  %attrs;
+  abbr        CDATA         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       (row|col|rowgroup|colgroup)   #IMPLIED
+  rowspan     CDATA       "1"
+  colspan     CDATA       "1"
+  %cellhalign;
+  %cellvalign;
+  nowrap      (nowrap)       #IMPLIED
+  bgcolor     CDATA         #IMPLIED
+  width       CDATA       #IMPLIED
+  height      CDATA       #IMPLIED
+  >
+
+<!ATTLIST td
+  %attrs;
+  abbr        CDATA         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       (row|col|rowgroup|colgroup)   #IMPLIED
+  rowspan     CDATA       "1"
+  colspan     CDATA       "1"
+  %cellhalign;
+  %cellvalign;
+  nowrap      (nowrap)       #IMPLIED
+  bgcolor     CDATA         #IMPLIED
+  width       CDATA       #IMPLIED
+  height      CDATA       #IMPLIED
+  >
+
+<!-- ====================================================== -->
+<!--        Set up to read in the CALS model configured to
+            merge with the XHTML table model                -->
+<!-- ====================================================== -->
+
+<!ENTITY % tables.role.attrib "%role.attrib;">
+
+<!-- Add label and role attributes to table and informaltable -->
+<!ENTITY % bodyatt "
+		floatstyle	CDATA			#IMPLIED
+		rowheader	(firstcol|norowheader)	#IMPLIED
+                %label.attrib;"
+>
+
+<!-- Add common attributes to Table, TGroup, TBody, THead, TFoot, Row,
+     EntryTbl, and Entry (and InformalTable element). -->
+
+<!ENTITY % secur "
+	%common.attrib;
+	class       CDATA          #IMPLIED
+	style       CDATA          #IMPLIED
+	title       CDATA         #IMPLIED
+	%i18n;
+	%events;
+	%tables.role.attrib;">
+
+<!ENTITY % common.table.attribs
+	"%bodyatt;
+	%secur;">
+
+<!-- Content model for Table (that also allows HTML tables) -->
+<!ENTITY % tbl.table.mdl
+	"((blockinfo?,
+           (%formalobject.title.content;),
+           (%ndxterm.class;)*,
+           textobject*,
+           (graphic+|mediaobject+|tgroup+))
+         |(caption, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+)))">
+
+<!ENTITY % informal.tbl.table.mdl
+	"(textobject*,
+          (graphic+|mediaobject+|tgroup+))
+         | ((col*|colgroup*), thead?, tfoot?, (tbody+|tr+))">
+
+<!-- Attributes for Table (including HTML ones) -->
+
+<!-- N.B. rules = (none | groups | rows | cols | all) but it can't be spec'd -->
+<!-- that way because 'all' already occurs in a different enumeration in -->
+<!-- CALS tables (frame). -->
+
+<!ENTITY % tbl.table.att        '
+    tabstyle    CDATA           #IMPLIED
+    tocentry    %yesorno.attvals;       #IMPLIED
+    shortentry  %yesorno.attvals;       #IMPLIED
+    orient      (port|land)     #IMPLIED
+    pgwide      %yesorno.attvals;       #IMPLIED
+    summary     CDATA          #IMPLIED
+    width       CDATA        #IMPLIED
+    border      CDATA        #IMPLIED
+    rules       CDATA		#IMPLIED
+    cellspacing CDATA        #IMPLIED
+    cellpadding CDATA        #IMPLIED
+    align       (left|center|right)   #IMPLIED
+    bgcolor     CDATA         #IMPLIED
+'>
+
+<!ENTITY % tbl.frame.attval "void|above|below|hsides|lhs|rhs|vsides|box|border|
+top|bottom|topbot|all|sides|none">
+
+<!-- Allow either objects or inlines; beware of REs between elements. -->
+<!ENTITY % tbl.entry.mdl "%para.char.mix; | %tabentry.mix;">
+
+<!-- thead, tfoot, and tbody are defined in both table models,
+     so we set up parameter entities to define union models for them
+ -->
+
+<!ENTITY % tbl.hdft.mdl        "(tr+|(colspec*,row+))">
+<!ENTITY % tbl.tbody.mdl       "(tr+|row+)">
+<!ENTITY % tbl.valign.attval   "top|middle|bottom|baseline">
+
+<!-- End of DocBook XML HTML Table Module V4.4 ............................ -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting/soextblx.dtd b/xml/tests/testData/xml/DocBookHighlighting/soextblx.dtd
new file mode 100644
index 0000000..f51e4d7
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting/soextblx.dtd
@@ -0,0 +1,314 @@
+<!-- XML EXCHANGE TABLE MODEL DECLARATION MODULE -->
+
+<!-- This set of declarations defines the XML version of the Exchange
+     Table Model as of the date shown in the Formal Public Identifier
+     (FPI) for this entity.
+
+     This set of declarations may be referred to using a public external
+     entity declaration and reference as shown in the following three
+     lines:
+
+     <!ENTITY % calstblx
+       PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN">
+       %calstblx;
+
+     If various parameter entities used within this set of declarations
+     are to be given non-default values, the appropriate declarations
+     should be given before calling in this package (i.e., before the
+     "%calstblx;" reference).
+-->
+
+<!-- The motivation for this XML version of the Exchange Table Model
+     is simply to create an XML version of the SGML Exchange Table
+     Model. By design, no effort has been made to "improve" the model.
+
+     This XML version incorporates the logical bare minimum changes
+     necessary to make the Exchange Table Model a valid XML DTD.
+
+     It has been modified slightly for use in the combined HTML/CALS models
+     supported by DocBook V4.3 and later.
+-->
+
+<!-- The XML version of the Exchange Table Model differs from
+     the SGML version in the following ways:
+
+     The following parameter entities have been removed:
+
+       - tbl.table.excep, tbl.hdft.excep, tbl.row.excep, tbl.entry.excep
+         There are no exceptions in XML. The following normative statement
+         is made in lieu of exceptions: the exchange table model explicitly
+         forbids a table from occurring within another table. If the
+         content model of an entry includes a table element, then this
+         cannot be enforced by the DTD, but it is a deviation from the
+         exchange table model to include a table within a table.
+
+       - tbl.hdft.name, tbl.hdft.mdl, tbl.hdft.excep, tbl.hdft.att
+         The motivation for these elements was to change the table
+         header/footer elements. Since XML does not allow element declarations
+         to contain name groups, and the exchange table model does not
+         allow a table to contain footers, the continued presence of these
+         attributes seems unnecessary.
+
+     The following parameter entity has been added:
+
+       - tbl.thead.att
+         This entity parameterizes the attributes on thead. It replaces
+         the tbl.hdft.att parameter entity.
+
+     Other miscellaneous changes:
+
+       - Tag ommission indicators have been removed
+       - Comments have been removed from declarations
+       - NUMBER attributes have been changed to NMTOKEN
+       - NUTOKEN attributes have been to changed to NMTOKEN
+       - Removed the grouping characters around the content model
+         parameter entry for the 'entry' element. This is necessary
+         so that an entry can contain #PCDATA and be defined as an
+         optional, repeatable OR group beginning with #PCDATA.
+-->
+
+<!-- This entity includes a set of element and attribute declarations
+     that partially defines the Exchange table model.  However, the model
+     is not well-defined without the accompanying natural language
+     description of the semantics (meanings) of these various elements,
+     attributes, and attribute values.  The semantic writeup, also available
+     from SGML Open, should be used in conjunction with this entity.
+-->
+
+<!-- In order to use the Exchange table model, various parameter entity
+     declarations are required.  A brief description is as follows:
+
+     ENTITY NAME      WHERE USED              WHAT IT IS
+
+     %yesorno         In ATTLIST of:          An attribute declared value
+                      almost all elements     for a "boolean" attribute
+
+     %paracon         In content model of:    The "text" (logical content)
+                      <entry>                 of the model group for <entry>
+
+     %titles          In content model of:    The "title" part of the model
+                      table element           group for the table element
+
+     %tbl.table.name  In declaration of:      The name of the "table"
+                      table element           element
+
+     %tbl.table-titles.mdl In content model of: The model group for the title
+                      table elements          part of the content model for
+                                              table element
+
+     %tbl.table.mdl   In content model of:    The model group for the content
+                      table elements          model for table element,
+                                              often (and by default) defined
+                                              in terms of %tbl.table-titles.mdl
+                                              and tgroup
+
+     %tbl.table.att   In ATTLIST of:          Additional attributes on the
+                      table element           table element
+
+     %bodyatt         In ATTLIST of:          Additional attributes on the
+                      table element           table element (for backward
+                                              compatibility with the SGML
+                                              model)
+
+     %tbl.tgroup.mdl  In content model of:    The model group for the content
+                      <tgroup>                model for <tgroup>
+
+     %tbl.tgroup.att  In ATTLIST of:          Additional attributes on the
+                      <tgroup>                <tgroup> element
+
+     %tbl.thead.att   In ATTLIST of:          Additional attributes on the
+                      <thead>                 <thead> element
+
+     %tbl.tbody.att   In ATTLIST of:          Additional attributes on the
+                      <tbody>                 <tbody> element
+
+     %tbl.colspec.att In ATTLIST of:          Additional attributes on the
+                      <colspec>               <colspec> element
+
+     %tbl.row.mdl     In content model of:    The model group for the content
+                      <row>                   model for <row>
+
+     %tbl.row.att     In ATTLIST of:          Additional attributes on the
+                      <row>                   <row> element
+
+     %tbl.entry.mdl   In content model of:    The model group for the content
+                      <entry>                 model for <entry>
+
+     %tbl.entry.att   In ATTLIST of:          Additional attributes on the
+                      <entry>                 <entry> element
+
+     This set of declarations will use the default definitions shown below
+     for any of these parameter entities that are not declared before this
+     set of declarations is referenced.
+-->
+
+<!-- These definitions are not directly related to the table model, but are
+     used in the default CALS table model and may be defined elsewhere (and
+     prior to the inclusion of this table module) in the referencing DTD. -->
+
+<!ENTITY % yesorno 'NMTOKEN'> <!-- no if zero(s), yes if any other value -->
+<!ENTITY % titles  'title?'>
+<!ENTITY % pcd "#PCDATA">
+<!ENTITY % paracon '%pcd;'> <!-- default for use in entry content -->
+
+<!--
+The parameter entities as defined below change and simplify the CALS table
+model as published (as part of the Example DTD) in MIL-HDBK-28001.  The
+resulting simplified DTD has support from the SGML Open vendors and is
+therefore more interoperable among different systems.
+
+These following declarations provide the Exchange default definitions
+for these entities.  However, these entities can be redefined (by giving
+the appropriate parameter entity declaration(s) prior to the reference
+to this Table Model declaration set entity) to fit the needs of the
+current application.
+
+Note, however, that changes may have significant effect on the ability to
+interchange table information.  These changes may manifest themselves
+in useability, presentation, and possible structure information degradation.
+-->
+
+<!ENTITY % tbl.table.name       "table">
+<!ENTITY % tbl.table-titles.mdl "%titles;,">
+<!ENTITY % tbl.table-main.mdl   "tgroup+">
+<!ENTITY % tbl.table.mdl        "%tbl.table-titles.mdl; %tbl.table-main.mdl;">
+<!ENTITY % tbl.table.att        "
+    pgwide      %yesorno;       #IMPLIED ">
+<!ENTITY % bodyatt              "">
+<!ENTITY % tbl.tgroup.mdl       "colspec*,thead?,tbody">
+<!ENTITY % tbl.tgroup.att       "">
+<!ENTITY % tbl.thead.att        "">
+<!ENTITY % tbl.tbody.att        "">
+<!ENTITY % tbl.colspec.att      "">
+<!ENTITY % tbl.row.mdl          "entry+">
+<!ENTITY % tbl.row.att          "">
+<!ENTITY % tbl.entry.mdl        "(%paracon;)*">
+<!ENTITY % tbl.entry.att        "">
+
+<!ENTITY % tbl.frame.attval     "top|bottom|topbot|all|sides|none">
+<!ENTITY % tbl.tbody.mdl        "row+">
+
+<!-- =====  Element and attribute declarations follow. =====  -->
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.table.name       "table"
+     ENTITY % tbl.table-titles.mdl "%titles;,"
+     ENTITY % tbl.table.mdl        "%tbl.table-titles; tgroup+"
+     ENTITY % tbl.table.att        "
+                        pgwide          %yesorno;       #IMPLIED "
+-->
+
+<!ELEMENT %tbl.table.name; (%tbl.table.mdl;)>
+
+<!ATTLIST %tbl.table.name;
+        frame           (%tbl.frame.attval;)                    #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        %tbl.table.att;
+        %bodyatt;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.tgroup.mdl    "colspec*,thead?,tbody"
+     ENTITY % tbl.tgroup.att    ""
+-->
+
+<!ELEMENT tgroup (%tbl.tgroup.mdl;) >
+
+<!ATTLIST tgroup
+        cols            NMTOKEN                                 #REQUIRED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        %tbl.tgroup.att;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.colspec.att   ""
+-->
+
+<!ELEMENT colspec EMPTY >
+
+<!ATTLIST colspec
+        colnum          NMTOKEN                                 #IMPLIED
+        colname         NMTOKEN                                 #IMPLIED
+        colwidth        CDATA                                   #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         NMTOKEN                                 #IMPLIED
+        %tbl.colspec.att;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.thead.att      ""
+-->
+
+<!ELEMENT thead (row+)>
+
+<!ATTLIST thead
+        valign          (top|middle|bottom)                     #IMPLIED
+        %tbl.thead.att;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.tbody.att     ""
+-->
+
+<!ELEMENT tbody (%tbl.tbody.mdl;)>
+
+<!ATTLIST tbody
+        valign          (top|middle|bottom)                     #IMPLIED
+        %tbl.tbody.att;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.row.mdl       "entry+"
+     ENTITY % tbl.row.att       ""
+-->
+
+<!ELEMENT row (%tbl.row.mdl;)>
+
+<!ATTLIST row
+        rowsep          %yesorno;                               #IMPLIED
+        valign          (top|middle|bottom)                     #IMPLIED
+        %tbl.row.att;
+>
+
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % paracon           "#PCDATA"
+     ENTITY % tbl.entry.mdl     "(%paracon;)*"
+     ENTITY % tbl.entry.att     ""
+-->
+
+<!ELEMENT entry (%tbl.entry.mdl;)*>
+
+<!ATTLIST entry
+        colname         NMTOKEN                                 #IMPLIED
+        namest          NMTOKEN                                 #IMPLIED
+        nameend         NMTOKEN                                 #IMPLIED
+        morerows        NMTOKEN                                 #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         NMTOKEN                                 #IMPLIED
+        valign          (top|middle|bottom)                     #IMPLIED
+        %tbl.entry.att;
+>
diff --git a/xml/tests/testData/xml/DocBookHighlighting2.xml b/xml/tests/testData/xml/DocBookHighlighting2.xml
new file mode 100644
index 0000000..8040f30
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2.xml
@@ -0,0 +1,43 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+        "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
+
+        [<!ENTITY etc "etc."><!ENTITY ie  "i.e."><!ENTITY eg  "e.g.">]>
+<book>
+    <bookinfo>
+        <title>Taming Text</title>
+        <subtitle>Find, Organize and Manipulate Content</subtitle>
+
+        <author>
+            <firstname>Grant</firstname>
+            <surname>Ingersoll</surname>
+        </author>
+
+        <date>
+
+        </date>
+
+    </bookinfo>
+    <chapter><title>Test</title>
+        <section><title>Bad Table</title>
+            <para><table>
+                <title>Really Bad Table</title>
+                        <tgroup cols="2">
+                            <thead>
+                                <row>
+                                    <entry>Foo</entry>
+                                    <entry>Bar</entry>
+                                </row>
+                            </thead>
+                            <tbody>
+
+                                <row>
+                                    <entry>Hi</entry>
+                                    <entry>Entry
+                                    </entry>
+                                </row>
+                            </tbody>
+                        </tgroup>
+            </table></para>
+        </section>
+    </chapter>
+</book>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/calstblx.dtd b/xml/tests/testData/xml/DocBookHighlighting2/calstblx.dtd
new file mode 100644
index 0000000..fac58d7
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/calstblx.dtd
@@ -0,0 +1,215 @@
+<!-- ...................................................................... -->
+<!-- DocBook CALS Table Model V4.5 ........................................ -->
+<!-- File calstblx.mod .................................................... -->
+
+<!-- Copyright 1992-2002 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     This DTD is based on the CALS Table Model
+     PUBLIC "-//USA-DOD//DTD Table Model 951010//EN"
+
+     $Id: calstblx.dtd 6340 2006-10-03 13:23:24Z nwalsh $
+
+     Permission to use, copy, modify and distribute the DocBook DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This module contains the definitions for the CALS Table Model
+     converted to XML. It has been modified slightly for use in the
+     combined HTML/CALS models supported by DocBook V4.5.
+-->
+
+<!-- These definitions are not directly related to the table model, but are
+     used in the default CALS table model and are usually defined elsewhere
+     (and prior to the inclusion of this table module) in a CALS DTD. -->
+
+<!ENTITY % bodyatt "">
+<!ENTITY % secur "">
+
+<!-- no if zero(s),
+                                yes if any other digits value -->
+
+<!ENTITY % yesorno 'CDATA'>
+<!ENTITY % titles  'title?'>
+
+<!-- default for use in entry content -->
+
+<!ENTITY % paracon '#PCDATA'>
+
+<!--
+The parameter entities as defined below provide the CALS table model
+as published (as part of the Example DTD) in MIL-HDBK-28001.
+
+These following declarations provide the CALS-compliant default definitions
+for these entities.  However, these entities can and should be redefined
+(by giving the appropriate parameter entity declaration(s) prior to the
+reference to this Table Model declaration set entity) to fit the needs
+of the current application.
+-->
+
+<!ENTITY % tbl.table.name       "(table|chart)">
+<!ENTITY % tbl.table-titles.mdl "%titles;,">
+<!ENTITY % tbl.table-main.mdl   "(tgroup+|graphic+)">
+<!ENTITY % tbl.table.mdl        "%tbl.table-titles.mdl; %tbl.table-main.mdl;">
+<!ENTITY % tbl.table.att        '
+    tabstyle    CDATA           #IMPLIED
+    tocentry    %yesorno;       #IMPLIED
+    shortentry  %yesorno;       #IMPLIED
+    orient      (port|land)     #IMPLIED
+    pgwide      %yesorno;       #IMPLIED '>
+<!ENTITY % tbl.tgroup.mdl       "colspec*,spanspec*,thead?,tfoot?,tbody">
+<!ENTITY % tbl.tgroup.att       '
+    tgroupstyle CDATA           #IMPLIED '>
+<!ENTITY % tbl.hdft.mdl         "colspec*,row+">
+<!ENTITY % tbl.row.mdl          "(entry|entrytbl)+">
+<!ENTITY % tbl.entrytbl.mdl     "colspec*,spanspec*,thead?,tbody">
+<!ENTITY % tbl.entry.mdl        "(para|warning|caution|note|legend|%paracon;)*">
+
+<!ENTITY % tbl.frame.attval     "top|bottom|topbot|all|sides|none">
+<!ENTITY % tbl.tbody.mdl        "row+">
+
+<!-- =====  Element and attribute declarations follow. =====  -->
+
+<!--doc:A formal table in a document.-->
+<!ELEMENT table %ho; (%tbl.table.mdl;)>
+
+<!ATTLIST table
+        frame           (%tbl.frame.attval;)                    #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        %tbl.table.att;
+        %bodyatt;
+        %secur;
+>
+
+<!--doc:A wrapper for the main content of a table, or part of a table.-->
+<!ELEMENT tgroup %ho; (%tbl.tgroup.mdl;) >
+
+<!ATTLIST tgroup
+        cols            CDATA                                   #REQUIRED
+        %tbl.tgroup.att;
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         CDATA                                   #IMPLIED
+        %secur;
+>
+
+<!--doc:Specifications for a column in a table.-->
+<!ELEMENT colspec %ho; EMPTY >
+
+<!ATTLIST colspec
+        colnum          CDATA                                   #IMPLIED
+        colname         CDATA                                   #IMPLIED
+        colwidth        CDATA                                   #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         CDATA                                   #IMPLIED
+>
+
+<!--doc:Formatting information for a spanned column in a table.-->
+<!ELEMENT spanspec %ho; EMPTY >
+
+<!ATTLIST spanspec
+        namest          CDATA                                   #REQUIRED
+        nameend         CDATA                                   #REQUIRED
+        spanname        CDATA                                   #REQUIRED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         CDATA                                   #IMPLIED
+>
+
+<!--doc:A table header consisting of one or more rows.-->
+<!ELEMENT thead %ho; (%tbl.hdft.mdl;)>
+<!ATTLIST thead
+        valign          (top|middle|bottom)                     #IMPLIED
+        %secur;
+>
+
+<!--doc:A table footer consisting of one or more rows.-->
+<!ELEMENT tfoot %ho; (%tbl.hdft.mdl;)>
+<!ATTLIST tfoot
+        valign          (top|middle|bottom)                     #IMPLIED
+        %secur;
+>
+
+<!--doc:A wrapper for the rows of a table or informal table.-->
+<!ELEMENT tbody %ho; (%tbl.tbody.mdl;)>
+
+<!ATTLIST tbody
+        valign          (top|middle|bottom)                     #IMPLIED
+        %secur;
+>
+
+<!--doc:A row in a table.-->
+<!ELEMENT row %ho; (%tbl.row.mdl;)>
+
+<!ATTLIST row
+        rowsep          %yesorno;                               #IMPLIED
+        valign          (top|middle|bottom)                     #IMPLIED
+        %secur;
+>
+
+<!--doc:A subtable appearing in place of an Entry in a table.-->
+<!ELEMENT entrytbl %ho; (%tbl.entrytbl.mdl;)>
+
+<!ATTLIST entrytbl
+        cols            CDATA                                   #REQUIRED
+        %tbl.tgroup.att;
+        colname         CDATA                                   #IMPLIED
+        spanname        CDATA                                   #IMPLIED
+        namest          CDATA                                   #IMPLIED
+        nameend         CDATA                                   #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         CDATA                                   #IMPLIED
+        %secur;
+>
+
+<!--doc:A cell in a table.-->
+<!ELEMENT entry %ho; (%tbl.entry.mdl;)*>
+
+<!ATTLIST entry
+        colname         CDATA                                   #IMPLIED
+        namest          CDATA                                   #IMPLIED
+        nameend         CDATA                                   #IMPLIED
+        spanname        CDATA                                   #IMPLIED
+        morerows        CDATA                                   #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         CDATA                                   #IMPLIED
+        rotate          %yesorno;                               #IMPLIED
+        valign          (top|middle|bottom)                     #IMPLIED
+        %secur;
+>
+
+<!-- End of DocBook CALS Table Model V4.5 ................................. -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/dbcentx.mod b/xml/tests/testData/xml/DocBookHighlighting2/dbcentx.mod
new file mode 100644
index 0000000..60de99f8
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/dbcentx.mod
@@ -0,0 +1,384 @@
+<!-- ...................................................................... -->
+<!-- DocBook character entities module V4.5 ............................... -->
+<!-- File dbcentx.mod ..................................................... -->
+
+<!-- Copyright 1992-2004 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     $Id: dbcentx.mod 6340 2006-10-03 13:23:24Z nwalsh $
+
+     Permission to use, copy, modify and distribute the DocBook DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This module contains the entity declarations for the standard ISO
+     entity sets used by DocBook.
+
+     In DTD driver files referring to this module, please use an entity
+     declaration that uses the public identifier shown below:
+
+     <!ENTITY % dbcent PUBLIC
+     "-//OASIS//ENTITIES DocBook Character Entities V4.5//EN"
+     "dbcentx.mod">
+     %dbcent;
+
+     See the documentation for detailed information on the parameter
+     entity and module scheme used in DocBook, customizing DocBook and
+     planning for interchange, and changes made since the last release
+     of DocBook.
+-->
+
+<!-- ...................................................................... -->
+
+<![%sgml.features;[
+
+<!ENTITY % ISOamsa.module "INCLUDE">
+<![ %ISOamsa.module; [
+<!ENTITY % ISOamsa PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN">
+<!--end of ISOamsa.module-->]]>
+
+<!ENTITY % ISOamsb.module "INCLUDE">
+<![ %ISOamsb.module; [
+<!ENTITY % ISOamsb PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN">
+<!--end of ISOamsb.module-->]]>
+
+<!ENTITY % ISOamsc.module "INCLUDE">
+<![ %ISOamsc.module; [
+<!ENTITY % ISOamsc PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN">
+<!--end of ISOamsc.module-->]]>
+
+<!ENTITY % ISOamsn.module "INCLUDE">
+<![ %ISOamsn.module; [
+<!ENTITY % ISOamsn PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN">
+<!--end of ISOamsn.module-->]]>
+
+<!ENTITY % ISOamso.module "INCLUDE">
+<![ %ISOamso.module; [
+<!ENTITY % ISOamso PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN">
+<!--end of ISOamso.module-->]]>
+
+<!ENTITY % ISOamsr.module "INCLUDE">
+<![ %ISOamsr.module; [
+<!ENTITY % ISOamsr PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN">
+<!--end of ISOamsr.module-->]]>
+
+<!ENTITY % ISObox.module "INCLUDE">
+<![ %ISObox.module; [
+<!ENTITY % ISObox PUBLIC
+"ISO 8879:1986//ENTITIES Box and Line Drawing//EN">
+<!--end of ISObox.module-->]]>
+
+<!ENTITY % ISOcyr1.module "INCLUDE">
+<![ %ISOcyr1.module; [
+<!ENTITY % ISOcyr1 PUBLIC
+"ISO 8879:1986//ENTITIES Russian Cyrillic//EN">
+<!--end of ISOcyr1.module-->]]>
+
+<!ENTITY % ISOcyr2.module "INCLUDE">
+<![ %ISOcyr2.module; [
+<!ENTITY % ISOcyr2 PUBLIC
+"ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN">
+<!--end of ISOcyr2.module-->]]>
+
+<!ENTITY % ISOdia.module "INCLUDE">
+<![ %ISOdia.module; [
+<!ENTITY % ISOdia PUBLIC
+"ISO 8879:1986//ENTITIES Diacritical Marks//EN">
+<!--end of ISOdia.module-->]]>
+
+<!ENTITY % ISOgrk1.module "INCLUDE">
+<![ %ISOgrk1.module; [
+<!ENTITY % ISOgrk1 PUBLIC
+"ISO 8879:1986//ENTITIES Greek Letters//EN">
+<!--end of ISOgrk1.module-->]]>
+
+<!ENTITY % ISOgrk2.module "INCLUDE">
+<![ %ISOgrk2.module; [
+<!ENTITY % ISOgrk2 PUBLIC
+"ISO 8879:1986//ENTITIES Monotoniko Greek//EN">
+<!--end of ISOgrk2.module-->]]>
+
+<!ENTITY % ISOgrk3.module "INCLUDE">
+<![ %ISOgrk3.module; [
+<!ENTITY % ISOgrk3 PUBLIC
+"ISO 8879:1986//ENTITIES Greek Symbols//EN">
+<!--end of ISOgrk3.module-->]]>
+
+<!ENTITY % ISOgrk4.module "INCLUDE">
+<![ %ISOgrk4.module; [
+<!ENTITY % ISOgrk4 PUBLIC
+"ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN">
+<!--end of ISOgrk4.module-->]]>
+
+<!ENTITY % ISOlat1.module "INCLUDE">
+<![ %ISOlat1.module; [
+<!ENTITY % ISOlat1 PUBLIC
+"ISO 8879:1986//ENTITIES Added Latin 1//EN">
+<!--end of ISOlat1.module-->]]>
+
+<!ENTITY % ISOlat2.module "INCLUDE">
+<![ %ISOlat2.module; [
+<!ENTITY % ISOlat2 PUBLIC
+"ISO 8879:1986//ENTITIES Added Latin 2//EN">
+<!--end of ISOlat2.module-->]]>
+
+<!ENTITY % ISOnum.module "INCLUDE">
+<![ %ISOnum.module; [
+<!ENTITY % ISOnum PUBLIC
+"ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN">
+<!--end of ISOnum.module-->]]>
+
+<!ENTITY % ISOpub.module "INCLUDE">
+<![ %ISOpub.module; [
+<!ENTITY % ISOpub PUBLIC
+"ISO 8879:1986//ENTITIES Publishing//EN">
+<!--end of ISOpub.module-->]]>
+
+<!ENTITY % ISOtech.module "INCLUDE">
+<![ %ISOtech.module; [
+<!ENTITY % ISOtech PUBLIC
+"ISO 8879:1986//ENTITIES General Technical//EN">
+<!--end of ISOtech.module-->]]>
+
+<!--end of sgml.features-->]]>
+
+<![%xml.features;[
+
+<!ENTITY % ISOamsa.module "INCLUDE">
+<![%ISOamsa.module;[
+<!ENTITY % ISOamsa PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+"ent/isoamsa.ent">
+<!--end of ISOamsa.module-->]]>
+
+<!ENTITY % ISOamsb.module "INCLUDE">
+<![%ISOamsb.module;[
+<!ENTITY % ISOamsb PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+"ent/isoamsb.ent">
+<!--end of ISOamsb.module-->]]>
+
+<!ENTITY % ISOamsc.module "INCLUDE">
+<![%ISOamsc.module;[
+<!ENTITY % ISOamsc PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+"ent/isoamsc.ent">
+<!--end of ISOamsc.module-->]]>
+
+<!ENTITY % ISOamsn.module "INCLUDE">
+<![%ISOamsn.module;[
+<!ENTITY % ISOamsn PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+"ent/isoamsn.ent">
+<!--end of ISOamsn.module-->]]>
+
+<!ENTITY % ISOamso.module "INCLUDE">
+<![%ISOamso.module;[
+<!ENTITY % ISOamso PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+"ent/isoamso.ent">
+<!--end of ISOamso.module-->]]>
+
+<!ENTITY % ISOamsr.module "INCLUDE">
+<![%ISOamsr.module;[
+<!ENTITY % ISOamsr PUBLIC
+"ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+"ent/isoamsr.ent">
+<!--end of ISOamsr.module-->]]>
+
+<!ENTITY % ISObox.module "INCLUDE">
+<![%ISObox.module;[
+<!ENTITY % ISObox PUBLIC
+"ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+"ent/isobox.ent">
+<!--end of ISObox.module-->]]>
+
+<!ENTITY % ISOcyr1.module "INCLUDE">
+<![%ISOcyr1.module;[
+<!ENTITY % ISOcyr1 PUBLIC
+"ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+"ent/isocyr1.ent">
+<!--end of ISOcyr1.module-->]]>
+
+<!ENTITY % ISOcyr2.module "INCLUDE">
+<![%ISOcyr2.module;[
+<!ENTITY % ISOcyr2 PUBLIC
+"ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+"ent/isocyr2.ent">
+<!--end of ISOcyr2.module-->]]>
+
+<!ENTITY % ISOdia.module "INCLUDE">
+<![%ISOdia.module;[
+<!ENTITY % ISOdia PUBLIC
+"ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+"ent/isodia.ent">
+<!--end of ISOdia.module-->]]>
+
+<!ENTITY % ISOgrk1.module "INCLUDE">
+<![%ISOgrk1.module;[
+<!ENTITY % ISOgrk1 PUBLIC
+"ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+"ent/isogrk1.ent">
+<!--end of ISOgrk1.module-->]]>
+
+<!ENTITY % ISOgrk2.module "INCLUDE">
+<![%ISOgrk2.module;[
+<!ENTITY % ISOgrk2 PUBLIC
+"ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+"ent/isogrk2.ent">
+<!--end of ISOgrk2.module-->]]>
+
+<!ENTITY % ISOgrk3.module "INCLUDE">
+<![%ISOgrk3.module;[
+<!ENTITY % ISOgrk3 PUBLIC
+"ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+"ent/isogrk3.ent">
+<!--end of ISOgrk3.module-->]]>
+
+<!ENTITY % ISOgrk4.module "INCLUDE">
+<![%ISOgrk4.module;[
+<!ENTITY % ISOgrk4 PUBLIC
+"ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+"ent/isogrk4.ent">
+<!--end of ISOgrk4.module-->]]>
+
+<!ENTITY % ISOlat1.module "INCLUDE">
+<![%ISOlat1.module;[
+<!ENTITY % ISOlat1 PUBLIC
+"ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+"ent/isolat1.ent">
+<!--end of ISOlat1.module-->]]>
+
+<!ENTITY % ISOlat2.module "INCLUDE">
+<![%ISOlat2.module;[
+<!ENTITY % ISOlat2 PUBLIC
+"ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+"ent/isolat2.ent">
+<!--end of ISOlat2.module-->]]>
+
+<!ENTITY % ISOnum.module "INCLUDE">
+<![%ISOnum.module;[
+<!ENTITY % ISOnum PUBLIC
+"ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+"ent/isonum.ent">
+<!--end of ISOnum.module-->]]>
+
+<!ENTITY % ISOpub.module "INCLUDE">
+<![%ISOpub.module;[
+<!ENTITY % ISOpub PUBLIC
+"ISO 8879:1986//ENTITIES Publishing//EN//XML"
+"ent/isopub.ent">
+<!--end of ISOpub.module-->]]>
+
+<!ENTITY % ISOtech.module "INCLUDE">
+<![%ISOtech.module;[
+<!ENTITY % ISOtech PUBLIC
+"ISO 8879:1986//ENTITIES General Technical//EN//XML"
+"ent/isotech.ent">
+<!--end of ISOtech.module-->]]>
+
+<!--end of xml.features-->]]>
+
+<![ %ISOamsa.module; [
+%ISOamsa;
+]]>
+
+<![ %ISOamsb.module; [
+%ISOamsb;
+]]>
+
+<![ %ISOamsc.module; [
+%ISOamsc;
+]]>
+
+<![ %ISOamsn.module; [
+%ISOamsn;
+]]>
+
+<![ %ISOamso.module; [
+%ISOamso;
+]]>
+
+<![ %ISOamsr.module; [
+%ISOamsr;
+]]>
+
+<![ %ISObox.module; [
+%ISObox;
+]]>
+
+<![ %ISOcyr1.module; [
+%ISOcyr1;
+]]>
+
+<![ %ISOcyr2.module; [
+%ISOcyr2;
+]]>
+
+<![ %ISOdia.module; [
+%ISOdia;
+]]>
+
+<![ %ISOgrk1.module; [
+%ISOgrk1;
+]]>
+
+<![ %ISOgrk2.module; [
+%ISOgrk2;
+]]>
+
+<![ %ISOgrk3.module; [
+%ISOgrk3;
+]]>
+
+<![ %ISOgrk4.module; [
+%ISOgrk4;
+]]>
+
+<![ %ISOlat1.module; [
+%ISOlat1;
+]]>
+
+<![ %ISOlat2.module; [
+%ISOlat2;
+]]>
+
+<![ %ISOnum.module; [
+%ISOnum;
+]]>
+
+<![ %ISOpub.module; [
+%ISOpub;
+]]>
+
+<![ %ISOtech.module; [
+%ISOtech;
+]]>
+
+<!-- End of DocBook character entity sets module V4.5 ..................... -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/dbgenent.mod b/xml/tests/testData/xml/DocBookHighlighting2/dbgenent.mod
new file mode 100644
index 0000000..ff5ba90
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/dbgenent.mod
@@ -0,0 +1,41 @@
+<!-- ...................................................................... -->
+<!-- DocBook additional general entities V4.5 ............................. -->
+
+<!-- Copyright 1992-2004 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     In DTD driver files referring to this module, please use an entity
+     declaration that uses the public identifier shown below:
+
+     <!ENTITY % dbgenent PUBLIC
+     "-//OASIS//ENTITIES DocBook Additional General Entities V4.5//EN"
+     "dbgenent.mod">
+     %dbgenent;
+-->
+
+<!-- File dbgenent.mod .................................................... -->
+
+<!-- You can edit this file to add the following:
+
+     o General entity declarations of any kind.  For example:
+
+       <!ENTITY productname "WinWidget">          (small boilerplate)
+       <!ENTITY legal-notice SYSTEM "notice.sgm"> (large boilerplate)
+
+     o Notation declarations.  For example:
+
+       <!NOTATION chicken-scratch SYSTEM>
+
+     o Declarations for and references to external parameter entities
+       containing collections of any of the above.  For example:
+
+       <!ENTITY % all-titles PUBLIC "-//DocTools//ELEMENTS Book Titles//EN"
+           "booktitles.ent">
+       %all-titles;
+-->
+
+<!-- End of DocBook additional general entities V4.5 ...................... -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/dbhierx.mod b/xml/tests/testData/xml/DocBookHighlighting2/dbhierx.mod
new file mode 100644
index 0000000..5f839f5
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/dbhierx.mod
@@ -0,0 +1,2193 @@
+<!-- ...................................................................... -->
+<!-- DocBook document hierarchy module V4.5 ............................... -->
+<!-- File dbhierx.mod ..................................................... -->
+
+<!-- Copyright 1992-2004 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     $Id: dbhierx.mod 6340 2006-10-03 13:23:24Z nwalsh $
+
+     Permission to use, copy, modify and distribute the DocBook DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This module contains the definitions for the overall document
+     hierarchies of DocBook documents.  It covers computer documentation
+     manuals and manual fragments, as well as reference entries (such as
+     man pages) and technical journals or anthologies containing
+     articles.
+
+     This module depends on the DocBook information pool module.  All
+     elements and entities referenced but not defined here are assumed
+     to be defined in the information pool module.
+
+     In DTD driver files referring to this module, please use an entity
+     declaration that uses the public identifier shown below:
+
+     <!ENTITY % dbhier PUBLIC
+     "-//OASIS//ELEMENTS DocBook Document Hierarchy V4.5//EN"
+     "dbhierx.mod">
+     %dbhier;
+
+     See the documentation for detailed information on the parameter
+     entity and module scheme used in DocBook, customizing DocBook and
+     planning for interchange, and changes made since the last release
+     of DocBook.
+-->
+
+<!-- ...................................................................... -->
+<!-- Entities for module inclusions ....................................... -->
+
+<!ENTITY % dbhier.redecl.module		"IGNORE">
+<!ENTITY % dbhier.redecl2.module	"IGNORE">
+
+<!-- ...................................................................... -->
+<!-- Entities for element classes ......................................... -->
+
+<!ENTITY % local.appendix.class "">
+<!ENTITY % appendix.class	"appendix %local.appendix.class;">
+
+<!ENTITY % local.article.class "">
+<!ENTITY % article.class	"article %local.article.class;">
+
+<!ENTITY % local.book.class "">
+<!ENTITY % book.class		"book %local.book.class;">
+
+<!ENTITY % local.chapter.class "">
+<!ENTITY % chapter.class	"chapter %local.chapter.class;">
+
+<!ENTITY % local.index.class "">
+<!ENTITY % index.class		"index|setindex %local.index.class;">
+
+<!ENTITY % local.refentry.class "">
+<!ENTITY % refentry.class	"refentry %local.refentry.class;">
+
+<!ENTITY % local.section.class "">
+<!ENTITY % section.class	"section %local.section.class;">
+
+<!ENTITY % local.nav.class "">
+<!ENTITY % nav.class		"toc|lot|index|glossary|bibliography
+				%local.nav.class;">
+
+<!-- Redeclaration placeholder ............................................ -->
+
+<!-- For redeclaring entities that are declared after this point while
+     retaining their references to the entities that are declared before
+     this point -->
+
+<![%dbhier.redecl.module;[
+<!-- Defining rdbhier here makes some buggy XML parsers happy. -->
+<!ENTITY % rdbhier "">
+%rdbhier;
+<!--end of dbhier.redecl.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Entities for element mixtures ........................................ -->
+
+<!ENTITY % local.divcomponent.mix "">
+<!ENTITY % divcomponent.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|%compound.class;
+		|%genobj.class;		|%descobj.class;
+		|%ndxterm.class;        |beginpage
+                %forms.hook;
+		%local.divcomponent.mix;">
+
+<!ENTITY % local.refcomponent.mix "">
+<!ENTITY % refcomponent.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|%compound.class;
+		|%genobj.class;		|%descobj.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.refcomponent.mix;">
+
+<!ENTITY % local.indexdivcomponent.mix "">
+<!ENTITY % indexdivcomponent.mix
+		"itemizedlist|orderedlist|variablelist|simplelist
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|anchor|remark
+		|%link.char.class;
+ 		                        |beginpage
+		%local.indexdivcomponent.mix;">
+
+<!ENTITY % local.refname.char.mix "">
+<!ENTITY % refname.char.mix
+		"#PCDATA
+		|%tech.char.class;
+		%local.refname.char.mix;">
+
+<!ENTITY % local.partcontent.mix "">
+<!ENTITY % partcontent.mix
+		"%appendix.class;|%chapter.class;|%nav.class;|%article.class;
+		|preface|%refentry.class;|reference %local.partcontent.mix;">
+
+<!ENTITY % local.refinline.char.mix "">
+<!ENTITY % refinline.char.mix
+		"#PCDATA
+		|%xref.char.class;	|%gen.char.class;
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;	|%docinfo.char.class;
+		|%other.char.class;
+		|%ndxterm.class;        |beginpage
+		%local.refinline.char.mix;">
+
+<!ENTITY % local.refclass.char.mix "">
+<!ENTITY % refclass.char.mix
+		"#PCDATA
+		|application
+		%local.refclass.char.mix;">
+
+<!-- Redeclaration placeholder 2 .......................................... -->
+
+<!-- For redeclaring entities that are declared after this point while
+     retaining their references to the entities that are declared before
+     this point -->
+
+<![%dbhier.redecl2.module;[
+<!-- Defining rdbhier2 here makes some buggy XML parsers happy. -->
+<!ENTITY % rdbhier2 "">
+%rdbhier2;
+<!--end of dbhier.redecl2.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Entities for content models .......................................... -->
+
+<!ENTITY % div.title.content
+	"title, subtitle?, titleabbrev?">
+
+<!ENTITY % bookcomponent.title.content
+	"title, subtitle?, titleabbrev?">
+
+<!ENTITY % sect.title.content
+	"title, subtitle?, titleabbrev?">
+
+<!ENTITY % refsect.title.content
+	"title, subtitle?, titleabbrev?">
+
+<!ENTITY % bookcomponent.content
+	"((%divcomponent.mix;)+,
+	(sect1*|(%refentry.class;)*|simplesect*|(%section.class;)*))
+	| (sect1+|(%refentry.class;)+|simplesect+|(%section.class;)+)">
+
+<!-- ...................................................................... -->
+<!-- Set and SetInfo ...................................................... -->
+
+<!ENTITY % set.content.module "INCLUDE">
+<![%set.content.module;[
+<!ENTITY % set.module "INCLUDE">
+<![%set.module;[
+<!ENTITY % local.set.attrib "">
+<!ENTITY % set.role.attrib "%role.attrib;">
+
+<!ENTITY % set.element "INCLUDE">
+<![%set.element;[
+<!--doc:A collection of books.-->
+<!ELEMENT set %ho; ((%div.title.content;)?, setinfo?, toc?, (set|%book.class;)+,
+		setindex?)
+		%ubiq.inclusion;>
+<!--end of set.element-->]]>
+
+<!-- FPI: SGML formal public identifier -->
+
+
+<!ENTITY % set.attlist "INCLUDE">
+<![%set.attlist;[
+<!ATTLIST set
+		fpi		CDATA		#IMPLIED
+		%status.attrib;
+		%common.attrib;
+		%set.role.attrib;
+		%local.set.attrib;
+>
+<!--end of set.attlist-->]]>
+<!--end of set.module-->]]>
+
+<!ENTITY % setinfo.module "INCLUDE">
+<![%setinfo.module;[
+<!ENTITY % local.setinfo.attrib "">
+<!ENTITY % setinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % setinfo.element "INCLUDE">
+<![%setinfo.element;[
+<!--doc:Meta-information for a Set.-->
+<!ELEMENT setinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of setinfo.element-->]]>
+
+<!-- Contents: IDs of the ToC, Books, and SetIndex that comprise
+		the set, in the order of their appearance -->
+
+
+<!ENTITY % setinfo.attlist "INCLUDE">
+<![%setinfo.attlist;[
+<!ATTLIST setinfo
+		contents	IDREFS		#IMPLIED
+		%common.attrib;
+		%setinfo.role.attrib;
+		%local.setinfo.attrib;
+>
+<!--end of setinfo.attlist-->]]>
+<!--end of setinfo.module-->]]>
+<!--end of set.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Book and BookInfo .................................................... -->
+
+<!ENTITY % book.content.module "INCLUDE">
+<![%book.content.module;[
+<!ENTITY % book.module "INCLUDE">
+<![%book.module;[
+
+<!ENTITY % local.book.attrib "">
+<!ENTITY % book.role.attrib "%role.attrib;">
+
+<!ENTITY % book.element "INCLUDE">
+<![%book.element;[
+<!--doc:A book.-->
+<!ELEMENT book %ho; ((%div.title.content;)?, bookinfo?,
+ 		(dedication | toc | lot
+ 		| glossary | bibliography | preface
+		| %chapter.class; | reference | part
+		| %article.class;
+ 		| %appendix.class;
+		| %index.class;
+		| colophon)*)
+		%ubiq.inclusion;>
+<!--end of book.element-->]]>
+
+<!-- FPI: SGML formal public identifier -->
+
+
+<!ENTITY % book.attlist "INCLUDE">
+<![%book.attlist;[
+<!ATTLIST book		fpi		CDATA		#IMPLIED
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%book.role.attrib;
+		%local.book.attrib;
+>
+<!--end of book.attlist-->]]>
+<!--end of book.module-->]]>
+
+<!ENTITY % bookinfo.module "INCLUDE">
+<![%bookinfo.module;[
+<!ENTITY % local.bookinfo.attrib "">
+<!ENTITY % bookinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % bookinfo.element "INCLUDE">
+<![%bookinfo.element;[
+<!--doc:Meta-information for a Book.-->
+<!ELEMENT bookinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of bookinfo.element-->]]>
+
+<!-- Contents: IDs of the ToC, LoTs, Prefaces, Parts, Chapters,
+		Appendixes, References, GLossary, Bibliography, and indexes
+		comprising the Book, in the order of their appearance -->
+
+
+<!ENTITY % bookinfo.attlist "INCLUDE">
+<![%bookinfo.attlist;[
+<!ATTLIST bookinfo
+		contents	IDREFS		#IMPLIED
+		%common.attrib;
+		%bookinfo.role.attrib;
+		%local.bookinfo.attrib;
+>
+<!--end of bookinfo.attlist-->]]>
+<!--end of bookinfo.module-->]]>
+<!--end of book.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Dedication, ToC, and LoT ............................................. -->
+
+<!ENTITY % dedication.module "INCLUDE">
+<![%dedication.module;[
+<!ENTITY % local.dedication.attrib "">
+<!ENTITY % dedication.role.attrib "%role.attrib;">
+
+<!ENTITY % dedication.element "INCLUDE">
+<![%dedication.element;[
+<!--doc:A wrapper for the dedication section of a book.-->
+<!ELEMENT dedication %ho; ((%sect.title.content;)?, (%legalnotice.mix;)+)>
+<!--end of dedication.element-->]]>
+
+<!ENTITY % dedication.attlist "INCLUDE">
+<![%dedication.attlist;[
+<!ATTLIST dedication
+		%status.attrib;
+		%common.attrib;
+		%dedication.role.attrib;
+		%local.dedication.attrib;
+>
+<!--end of dedication.attlist-->]]>
+<!--end of dedication.module-->]]>
+
+<!ENTITY % colophon.module "INCLUDE">
+<![ %colophon.module; [
+<!ENTITY % local.colophon.attrib "">
+<!ENTITY % colophon.role.attrib "%role.attrib;">
+
+<!ENTITY % colophon.element "INCLUDE">
+<![ %colophon.element; [
+<!--doc:Text at the back of a book describing facts about its production.-->
+<!ELEMENT colophon %ho; ((%sect.title.content;)?, (%textobject.mix;)+)>
+<!--end of colophon.element-->]]>
+
+<!ENTITY % colophon.attlist "INCLUDE">
+<![ %colophon.attlist; [
+<!ATTLIST colophon
+		%status.attrib;
+		%common.attrib;
+		%colophon.role.attrib;
+		%local.colophon.attrib;>
+<!--end of colophon.attlist-->]]>
+<!--end of colophon.module-->]]>
+
+<!ENTITY % toc.content.module "INCLUDE">
+<![%toc.content.module;[
+<!ENTITY % toc.module "INCLUDE">
+<![%toc.module;[
+<!ENTITY % local.toc.attrib "">
+<!ENTITY % toc.role.attrib "%role.attrib;">
+
+<!ENTITY % toc.element "INCLUDE">
+<![%toc.element;[
+<!--doc:A table of contents.-->
+<!ELEMENT toc %ho; (beginpage?,
+		(%bookcomponent.title.content;)?,
+		tocfront*,
+		(tocpart | tocchap)*, tocback*)>
+<!--end of toc.element-->]]>
+
+<!ENTITY % toc.attlist "INCLUDE">
+<![%toc.attlist;[
+<!ATTLIST toc
+		%pagenum.attrib;
+		%common.attrib;
+		%toc.role.attrib;
+		%local.toc.attrib;
+>
+<!--end of toc.attlist-->]]>
+<!--end of toc.module-->]]>
+
+<!ENTITY % tocfront.module "INCLUDE">
+<![%tocfront.module;[
+<!ENTITY % local.tocfront.attrib "">
+<!ENTITY % tocfront.role.attrib "%role.attrib;">
+
+<!ENTITY % tocfront.element "INCLUDE">
+<![%tocfront.element;[
+<!--doc:An entry in a table of contents for a front matter component.-->
+<!ELEMENT tocfront %ho; (%para.char.mix;)*>
+<!--end of tocfront.element-->]]>
+
+<!-- to element that this entry represents -->
+
+
+<!ENTITY % tocfront.attlist "INCLUDE">
+<![%tocfront.attlist;[
+<!ATTLIST tocfront
+		%label.attrib;
+		%linkend.attrib;		%pagenum.attrib;
+		%common.attrib;
+		%tocfront.role.attrib;
+		%local.tocfront.attrib;
+>
+<!--end of tocfront.attlist-->]]>
+<!--end of tocfront.module-->]]>
+
+<!ENTITY % tocentry.module "INCLUDE">
+<![%tocentry.module;[
+<!ENTITY % local.tocentry.attrib "">
+<!ENTITY % tocentry.role.attrib "%role.attrib;">
+
+<!ENTITY % tocentry.element "INCLUDE">
+<![%tocentry.element;[
+<!--doc:A component title in a table of contents.-->
+<!ELEMENT tocentry %ho; (%para.char.mix;)*>
+<!--end of tocentry.element-->]]>
+
+<!-- to element that this entry represents -->
+
+
+<!ENTITY % tocentry.attlist "INCLUDE">
+<![%tocentry.attlist;[
+<!ATTLIST tocentry
+		%linkend.attrib;		%pagenum.attrib;
+		%common.attrib;
+		%tocentry.role.attrib;
+		%local.tocentry.attrib;
+>
+<!--end of tocentry.attlist-->]]>
+<!--end of tocentry.module-->]]>
+
+<!ENTITY % tocpart.module "INCLUDE">
+<![%tocpart.module;[
+<!ENTITY % local.tocpart.attrib "">
+<!ENTITY % tocpart.role.attrib "%role.attrib;">
+
+<!ENTITY % tocpart.element "INCLUDE">
+<![%tocpart.element;[
+<!--doc:An entry in a table of contents for a part of a book.-->
+<!ELEMENT tocpart %ho; (tocentry+, tocchap*)>
+<!--end of tocpart.element-->]]>
+
+<!ENTITY % tocpart.attlist "INCLUDE">
+<![%tocpart.attlist;[
+<!ATTLIST tocpart
+		%common.attrib;
+		%tocpart.role.attrib;
+		%local.tocpart.attrib;
+>
+<!--end of tocpart.attlist-->]]>
+<!--end of tocpart.module-->]]>
+
+<!ENTITY % tocchap.module "INCLUDE">
+<![%tocchap.module;[
+<!ENTITY % local.tocchap.attrib "">
+<!ENTITY % tocchap.role.attrib "%role.attrib;">
+
+<!ENTITY % tocchap.element "INCLUDE">
+<![%tocchap.element;[
+<!--doc:An entry in a table of contents for a component in the body of a document.-->
+<!ELEMENT tocchap %ho; (tocentry+, toclevel1*)>
+<!--end of tocchap.element-->]]>
+
+<!ENTITY % tocchap.attlist "INCLUDE">
+<![%tocchap.attlist;[
+<!ATTLIST tocchap
+		%label.attrib;
+		%common.attrib;
+		%tocchap.role.attrib;
+		%local.tocchap.attrib;
+>
+<!--end of tocchap.attlist-->]]>
+<!--end of tocchap.module-->]]>
+
+<!ENTITY % toclevel1.module "INCLUDE">
+<![%toclevel1.module;[
+<!ENTITY % local.toclevel1.attrib "">
+<!ENTITY % toclevel1.role.attrib "%role.attrib;">
+
+<!ENTITY % toclevel1.element "INCLUDE">
+<![%toclevel1.element;[
+<!--doc:A top-level entry within a table of contents entry for a chapter-like component.-->
+<!ELEMENT toclevel1 %ho; (tocentry+, toclevel2*)>
+<!--end of toclevel1.element-->]]>
+
+<!ENTITY % toclevel1.attlist "INCLUDE">
+<![%toclevel1.attlist;[
+<!ATTLIST toclevel1
+		%common.attrib;
+		%toclevel1.role.attrib;
+		%local.toclevel1.attrib;
+>
+<!--end of toclevel1.attlist-->]]>
+<!--end of toclevel1.module-->]]>
+
+<!ENTITY % toclevel2.module "INCLUDE">
+<![%toclevel2.module;[
+<!ENTITY % local.toclevel2.attrib "">
+<!ENTITY % toclevel2.role.attrib "%role.attrib;">
+
+<!ENTITY % toclevel2.element "INCLUDE">
+<![%toclevel2.element;[
+<!--doc:A second-level entry within a table of contents entry for a chapter-like component.-->
+<!ELEMENT toclevel2 %ho; (tocentry+, toclevel3*)>
+<!--end of toclevel2.element-->]]>
+
+<!ENTITY % toclevel2.attlist "INCLUDE">
+<![%toclevel2.attlist;[
+<!ATTLIST toclevel2
+		%common.attrib;
+		%toclevel2.role.attrib;
+		%local.toclevel2.attrib;
+>
+<!--end of toclevel2.attlist-->]]>
+<!--end of toclevel2.module-->]]>
+
+<!ENTITY % toclevel3.module "INCLUDE">
+<![%toclevel3.module;[
+<!ENTITY % local.toclevel3.attrib "">
+<!ENTITY % toclevel3.role.attrib "%role.attrib;">
+
+<!ENTITY % toclevel3.element "INCLUDE">
+<![%toclevel3.element;[
+<!--doc:A third-level entry within a table of contents entry for a chapter-like component.-->
+<!ELEMENT toclevel3 %ho; (tocentry+, toclevel4*)>
+<!--end of toclevel3.element-->]]>
+
+<!ENTITY % toclevel3.attlist "INCLUDE">
+<![%toclevel3.attlist;[
+<!ATTLIST toclevel3
+		%common.attrib;
+		%toclevel3.role.attrib;
+		%local.toclevel3.attrib;
+>
+<!--end of toclevel3.attlist-->]]>
+<!--end of toclevel3.module-->]]>
+
+<!ENTITY % toclevel4.module "INCLUDE">
+<![%toclevel4.module;[
+<!ENTITY % local.toclevel4.attrib "">
+<!ENTITY % toclevel4.role.attrib "%role.attrib;">
+
+<!ENTITY % toclevel4.element "INCLUDE">
+<![%toclevel4.element;[
+<!--doc:A fourth-level entry within a table of contents entry for a chapter-like component.-->
+<!ELEMENT toclevel4 %ho; (tocentry+, toclevel5*)>
+<!--end of toclevel4.element-->]]>
+
+<!ENTITY % toclevel4.attlist "INCLUDE">
+<![%toclevel4.attlist;[
+<!ATTLIST toclevel4
+		%common.attrib;
+		%toclevel4.role.attrib;
+		%local.toclevel4.attrib;
+>
+<!--end of toclevel4.attlist-->]]>
+<!--end of toclevel4.module-->]]>
+
+<!ENTITY % toclevel5.module "INCLUDE">
+<![%toclevel5.module;[
+<!ENTITY % local.toclevel5.attrib "">
+<!ENTITY % toclevel5.role.attrib "%role.attrib;">
+
+<!ENTITY % toclevel5.element "INCLUDE">
+<![%toclevel5.element;[
+<!--doc:A fifth-level entry within a table of contents entry for a chapter-like component.-->
+<!ELEMENT toclevel5 %ho; (tocentry+)>
+<!--end of toclevel5.element-->]]>
+
+<!ENTITY % toclevel5.attlist "INCLUDE">
+<![%toclevel5.attlist;[
+<!ATTLIST toclevel5
+		%common.attrib;
+		%toclevel5.role.attrib;
+		%local.toclevel5.attrib;
+>
+<!--end of toclevel5.attlist-->]]>
+<!--end of toclevel5.module-->]]>
+
+<!ENTITY % tocback.module "INCLUDE">
+<![%tocback.module;[
+<!ENTITY % local.tocback.attrib "">
+<!ENTITY % tocback.role.attrib "%role.attrib;">
+
+<!ENTITY % tocback.element "INCLUDE">
+<![%tocback.element;[
+<!--doc:An entry in a table of contents for a back matter component.-->
+<!ELEMENT tocback %ho; (%para.char.mix;)*>
+<!--end of tocback.element-->]]>
+
+<!-- to element that this entry represents -->
+
+
+<!ENTITY % tocback.attlist "INCLUDE">
+<![%tocback.attlist;[
+<!ATTLIST tocback
+		%label.attrib;
+		%linkend.attrib;		%pagenum.attrib;
+		%common.attrib;
+		%tocback.role.attrib;
+		%local.tocback.attrib;
+>
+<!--end of tocback.attlist-->]]>
+<!--end of tocback.module-->]]>
+<!--end of toc.content.module-->]]>
+
+<!ENTITY % lot.content.module "INCLUDE">
+<![%lot.content.module;[
+<!ENTITY % lot.module "INCLUDE">
+<![%lot.module;[
+<!ENTITY % local.lot.attrib "">
+<!ENTITY % lot.role.attrib "%role.attrib;">
+
+<!ENTITY % lot.element "INCLUDE">
+<![%lot.element;[
+<!--doc:A list of the titles of formal objects (as tables or figures) in a document.-->
+<!ELEMENT lot %ho; (beginpage?, (%bookcomponent.title.content;)?, lotentry*)>
+<!--end of lot.element-->]]>
+
+<!ENTITY % lot.attlist "INCLUDE">
+<![%lot.attlist;[
+<!ATTLIST lot
+		%label.attrib;
+		%common.attrib;
+		%lot.role.attrib;
+		%local.lot.attrib;
+>
+<!--end of lot.attlist-->]]>
+<!--end of lot.module-->]]>
+
+<!ENTITY % lotentry.module "INCLUDE">
+<![%lotentry.module;[
+<!ENTITY % local.lotentry.attrib "">
+<!ENTITY % lotentry.role.attrib "%role.attrib;">
+
+<!ENTITY % lotentry.element "INCLUDE">
+<![%lotentry.element;[
+<!--doc:An entry in a list of titles.-->
+<!ELEMENT lotentry %ho; (%para.char.mix;)*>
+<!--end of lotentry.element-->]]>
+
+<!-- SrcCredit: Information about the source of the entry,
+		as for a list of illustrations -->
+<!-- linkend: to element that this entry represents-->
+<!ENTITY % lotentry.attlist "INCLUDE">
+<![%lotentry.attlist;[
+<!ATTLIST lotentry
+		%linkend.attrib;
+		%pagenum.attrib;
+		srccredit	CDATA		#IMPLIED
+		%common.attrib;
+		%lotentry.role.attrib;
+		%local.lotentry.attrib;
+>
+<!--end of lotentry.attlist-->]]>
+<!--end of lotentry.module-->]]>
+<!--end of lot.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Appendix, Chapter, Part, Preface, Reference, PartIntro ............... -->
+
+<!ENTITY % appendix.module "INCLUDE">
+<![%appendix.module;[
+<!ENTITY % local.appendix.attrib "">
+<!ENTITY % appendix.role.attrib "%role.attrib;">
+
+<!ENTITY % appendix.element "INCLUDE">
+<![%appendix.element;[
+<!--doc:An appendix in a Book or Article.-->
+<!ELEMENT appendix %ho; (beginpage?,
+                     appendixinfo?,
+                     (%bookcomponent.title.content;),
+                     (%nav.class;)*,
+                     tocchap?,
+                     (%bookcomponent.content;),
+                     (%nav.class;)*)
+		%ubiq.inclusion;>
+<!--end of appendix.element-->]]>
+
+<!ENTITY % appendix.attlist "INCLUDE">
+<![%appendix.attlist;[
+<!ATTLIST appendix
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%appendix.role.attrib;
+		%local.appendix.attrib;
+>
+<!--end of appendix.attlist-->]]>
+<!--end of appendix.module-->]]>
+
+<!ENTITY % chapter.module "INCLUDE">
+<![%chapter.module;[
+<!ENTITY % local.chapter.attrib "">
+<!ENTITY % chapter.role.attrib "%role.attrib;">
+
+<!ENTITY % chapter.element "INCLUDE">
+<![%chapter.element;[
+<!--doc:A chapter, as of a book.-->
+<!ELEMENT chapter %ho; (beginpage?,
+                    chapterinfo?,
+                    (%bookcomponent.title.content;),
+                    (%nav.class;)*,
+                    tocchap?,
+                    (%bookcomponent.content;),
+                    (%nav.class;)*)
+		%ubiq.inclusion;>
+<!--end of chapter.element-->]]>
+
+<!ENTITY % chapter.attlist "INCLUDE">
+<![%chapter.attlist;[
+<!ATTLIST chapter
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%chapter.role.attrib;
+		%local.chapter.attrib;
+>
+<!--end of chapter.attlist-->]]>
+<!--end of chapter.module-->]]>
+
+<!ENTITY % part.module "INCLUDE">
+<![%part.module;[
+
+<!-- Note that Part was to have its content model reduced in V4.5.  This
+change will not be made after all. -->
+
+<!ENTITY % local.part.attrib "">
+<!ENTITY % part.role.attrib "%role.attrib;">
+
+<!ENTITY % part.element "INCLUDE">
+<![%part.element;[
+<!--doc:A division in a book.-->
+<!ELEMENT part %ho; (beginpage?,
+                partinfo?, (%bookcomponent.title.content;), partintro?,
+		(%partcontent.mix;)+)
+		%ubiq.inclusion;>
+<!--end of part.element-->]]>
+
+<!ENTITY % part.attlist "INCLUDE">
+<![%part.attlist;[
+<!ATTLIST part
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%part.role.attrib;
+		%local.part.attrib;
+>
+<!--end of part.attlist-->]]>
+<!--ELEMENT PartIntro (defined below)-->
+<!--end of part.module-->]]>
+
+<!ENTITY % preface.module "INCLUDE">
+<![%preface.module;[
+<!ENTITY % local.preface.attrib "">
+<!ENTITY % preface.role.attrib "%role.attrib;">
+
+<!ENTITY % preface.element "INCLUDE">
+<![%preface.element;[
+<!--doc:Introductory matter preceding the first chapter of a book.-->
+<!ELEMENT preface %ho; (beginpage?,
+                    prefaceinfo?,
+                    (%bookcomponent.title.content;),
+                    (%nav.class;)*,
+                    tocchap?,
+                    (%bookcomponent.content;),
+                    (%nav.class;)*)
+		%ubiq.inclusion;>
+<!--end of preface.element-->]]>
+
+<!ENTITY % preface.attlist "INCLUDE">
+<![%preface.attlist;[
+<!ATTLIST preface
+		%status.attrib;
+		%common.attrib;
+		%preface.role.attrib;
+		%local.preface.attrib;
+>
+<!--end of preface.attlist-->]]>
+<!--end of preface.module-->]]>
+
+<!ENTITY % reference.module "INCLUDE">
+<![%reference.module;[
+<!ENTITY % local.reference.attrib "">
+<!ENTITY % reference.role.attrib "%role.attrib;">
+
+<!ENTITY % reference.element "INCLUDE">
+<![%reference.element;[
+<!--doc:A collection of reference entries.-->
+<!ELEMENT reference %ho; (beginpage?,
+                     referenceinfo?,
+                     (%bookcomponent.title.content;), partintro?,
+                     (%refentry.class;)+)
+		%ubiq.inclusion;>
+<!--end of reference.element-->]]>
+
+<!ENTITY % reference.attlist "INCLUDE">
+<![%reference.attlist;[
+<!ATTLIST reference
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%reference.role.attrib;
+		%local.reference.attrib;
+>
+<!--end of reference.attlist-->]]>
+<!--ELEMENT PartIntro (defined below)-->
+<!--end of reference.module-->]]>
+
+<!ENTITY % partintro.module "INCLUDE">
+<![%partintro.module;[
+<!ENTITY % local.partintro.attrib "">
+<!ENTITY % partintro.role.attrib "%role.attrib;">
+
+<!ENTITY % partintro.element "INCLUDE">
+<![%partintro.element;[
+<!--doc:An introduction to the contents of a part.-->
+<!ELEMENT partintro %ho; ((%div.title.content;)?, (%bookcomponent.content;))
+		%ubiq.inclusion;>
+<!--end of partintro.element-->]]>
+
+<!ENTITY % partintro.attlist "INCLUDE">
+<![%partintro.attlist;[
+<!ATTLIST partintro
+		%label.attrib;
+		%common.attrib;
+		%partintro.role.attrib;
+		%local.partintro.attrib;
+>
+<!--end of partintro.attlist-->]]>
+<!--end of partintro.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Other Info elements .................................................. -->
+
+<!ENTITY % appendixinfo.module "INCLUDE">
+<![ %appendixinfo.module; [
+<!ENTITY % local.appendixinfo.attrib "">
+<!ENTITY % appendixinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % appendixinfo.element "INCLUDE">
+<![ %appendixinfo.element; [
+<!--doc:Meta-information for an Appendix.-->
+<!ELEMENT appendixinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of appendixinfo.element-->]]>
+
+<!ENTITY % appendixinfo.attlist "INCLUDE">
+<![ %appendixinfo.attlist; [
+<!ATTLIST appendixinfo
+		%common.attrib;
+		%appendixinfo.role.attrib;
+		%local.appendixinfo.attrib;
+>
+<!--end of appendixinfo.attlist-->]]>
+<!--end of appendixinfo.module-->]]>
+
+<!ENTITY % bibliographyinfo.module "INCLUDE">
+<![ %bibliographyinfo.module; [
+<!ENTITY % local.bibliographyinfo.attrib "">
+<!ENTITY % bibliographyinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliographyinfo.element "INCLUDE">
+<![ %bibliographyinfo.element; [
+<!--doc:Meta-information for a Bibliography.-->
+<!ELEMENT bibliographyinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of bibliographyinfo.element-->]]>
+
+<!ENTITY % bibliographyinfo.attlist "INCLUDE">
+<![ %bibliographyinfo.attlist; [
+<!ATTLIST bibliographyinfo
+		%common.attrib;
+		%bibliographyinfo.role.attrib;
+		%local.bibliographyinfo.attrib;
+>
+<!--end of bibliographyinfo.attlist-->]]>
+<!--end of bibliographyinfo.module-->]]>
+
+<!ENTITY % chapterinfo.module "INCLUDE">
+<![ %chapterinfo.module; [
+<!ENTITY % local.chapterinfo.attrib "">
+<!ENTITY % chapterinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % chapterinfo.element "INCLUDE">
+<![ %chapterinfo.element; [
+<!--doc:Meta-information for a Chapter.-->
+<!ELEMENT chapterinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of chapterinfo.element-->]]>
+
+<!ENTITY % chapterinfo.attlist "INCLUDE">
+<![ %chapterinfo.attlist; [
+<!ATTLIST chapterinfo
+		%common.attrib;
+		%chapterinfo.role.attrib;
+		%local.chapterinfo.attrib;
+>
+<!--end of chapterinfo.attlist-->]]>
+<!--end of chapterinfo.module-->]]>
+
+<!ENTITY % glossaryinfo.module "INCLUDE">
+<![ %glossaryinfo.module; [
+<!ENTITY % local.glossaryinfo.attrib "">
+<!ENTITY % glossaryinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % glossaryinfo.element "INCLUDE">
+<![ %glossaryinfo.element; [
+<!--doc:Meta-information for a Glossary.-->
+<!ELEMENT glossaryinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of glossaryinfo.element-->]]>
+
+<!ENTITY % glossaryinfo.attlist "INCLUDE">
+<![ %glossaryinfo.attlist; [
+<!ATTLIST glossaryinfo
+		%common.attrib;
+		%glossaryinfo.role.attrib;
+		%local.glossaryinfo.attrib;
+>
+<!--end of glossaryinfo.attlist-->]]>
+<!--end of glossaryinfo.module-->]]>
+
+<!ENTITY % indexinfo.module "INCLUDE">
+<![ %indexinfo.module; [
+<!ENTITY % local.indexinfo.attrib "">
+<!ENTITY % indexinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % indexinfo.element "INCLUDE">
+<![ %indexinfo.element; [
+<!--doc:Meta-information for an Index.-->
+<!ELEMENT indexinfo %ho; ((%info.class;)+)>
+<!--end of indexinfo.element-->]]>
+
+<!ENTITY % indexinfo.attlist "INCLUDE">
+<![ %indexinfo.attlist; [
+<!ATTLIST indexinfo
+		%common.attrib;
+		%indexinfo.role.attrib;
+		%local.indexinfo.attrib;
+>
+<!--end of indexinfo.attlist-->]]>
+<!--end of indexinfo.module-->]]>
+
+<!ENTITY % setindexinfo.module "INCLUDE">
+<![ %setindexinfo.module; [
+<!ENTITY % local.setindexinfo.attrib "">
+<!ENTITY % setindexinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % setindexinfo.element "INCLUDE">
+<![ %setindexinfo.element; [
+<!--doc:Meta-information for a SetIndex.-->
+<!ELEMENT setindexinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of setindexinfo.element-->]]>
+
+<!ENTITY % setindexinfo.attlist "INCLUDE">
+<![ %setindexinfo.attlist; [
+<!ATTLIST setindexinfo
+		%common.attrib;
+		%setindexinfo.role.attrib;
+		%local.setindexinfo.attrib;
+>
+<!--end of setindexinfo.attlist-->]]>
+<!--end of setindexinfo.module-->]]>
+
+<!ENTITY % partinfo.module "INCLUDE">
+<![ %partinfo.module; [
+<!ENTITY % local.partinfo.attrib "">
+<!ENTITY % partinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % partinfo.element "INCLUDE">
+<![ %partinfo.element; [
+<!--doc:Meta-information for a Part.-->
+<!ELEMENT partinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of partinfo.element-->]]>
+
+<!ENTITY % partinfo.attlist "INCLUDE">
+<![ %partinfo.attlist; [
+<!ATTLIST partinfo
+		%common.attrib;
+		%partinfo.role.attrib;
+		%local.partinfo.attrib;
+>
+<!--end of partinfo.attlist-->]]>
+<!--end of partinfo.module-->]]>
+
+<!ENTITY % prefaceinfo.module "INCLUDE">
+<![ %prefaceinfo.module; [
+<!ENTITY % local.prefaceinfo.attrib "">
+<!ENTITY % prefaceinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % prefaceinfo.element "INCLUDE">
+<![ %prefaceinfo.element; [
+<!--doc:Meta-information for a Preface.-->
+<!ELEMENT prefaceinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of prefaceinfo.element-->]]>
+
+<!ENTITY % prefaceinfo.attlist "INCLUDE">
+<![ %prefaceinfo.attlist; [
+<!ATTLIST prefaceinfo
+		%common.attrib;
+		%prefaceinfo.role.attrib;
+		%local.prefaceinfo.attrib;
+>
+<!--end of prefaceinfo.attlist-->]]>
+<!--end of prefaceinfo.module-->]]>
+
+<!ENTITY % refentryinfo.module "INCLUDE">
+<![ %refentryinfo.module; [
+<!ENTITY % local.refentryinfo.attrib "">
+<!ENTITY % refentryinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % refentryinfo.element "INCLUDE">
+<![ %refentryinfo.element; [
+<!--doc:Meta-information for a Refentry.-->
+<!ELEMENT refentryinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of refentryinfo.element-->]]>
+
+<!ENTITY % refentryinfo.attlist "INCLUDE">
+<![ %refentryinfo.attlist; [
+<!ATTLIST refentryinfo
+		%common.attrib;
+		%refentryinfo.role.attrib;
+		%local.refentryinfo.attrib;
+>
+<!--end of refentryinfo.attlist-->]]>
+<!--end of refentryinfo.module-->]]>
+
+<!ENTITY % refsectioninfo.module "INCLUDE">
+<![ %refsectioninfo.module; [
+<!ENTITY % local.refsectioninfo.attrib "">
+<!ENTITY % refsectioninfo.role.attrib "%role.attrib;">
+
+<!ENTITY % refsectioninfo.element "INCLUDE">
+<![ %refsectioninfo.element; [
+<!--doc:Meta-information for a refsection.-->
+<!ELEMENT refsectioninfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of refsectioninfo.element-->]]>
+
+<!ENTITY % refsectioninfo.attlist "INCLUDE">
+<![ %refsectioninfo.attlist; [
+<!ATTLIST refsectioninfo
+		%common.attrib;
+		%refsectioninfo.role.attrib;
+		%local.refsectioninfo.attrib;
+>
+<!--end of refsectioninfo.attlist-->]]>
+<!--end of refsectioninfo.module-->]]>
+
+<!ENTITY % refsect1info.module "INCLUDE">
+<![ %refsect1info.module; [
+<!ENTITY % local.refsect1info.attrib "">
+<!ENTITY % refsect1info.role.attrib "%role.attrib;">
+
+<!ENTITY % refsect1info.element "INCLUDE">
+<![ %refsect1info.element; [
+<!--doc:Meta-information for a RefSect1.-->
+<!ELEMENT refsect1info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of refsect1info.element-->]]>
+
+<!ENTITY % refsect1info.attlist "INCLUDE">
+<![ %refsect1info.attlist; [
+<!ATTLIST refsect1info
+		%common.attrib;
+		%refsect1info.role.attrib;
+		%local.refsect1info.attrib;
+>
+<!--end of refsect1info.attlist-->]]>
+<!--end of refsect1info.module-->]]>
+
+<!ENTITY % refsect2info.module "INCLUDE">
+<![ %refsect2info.module; [
+<!ENTITY % local.refsect2info.attrib "">
+<!ENTITY % refsect2info.role.attrib "%role.attrib;">
+
+<!ENTITY % refsect2info.element "INCLUDE">
+<![ %refsect2info.element; [
+<!--doc:Meta-information for a RefSect2.-->
+<!ELEMENT refsect2info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of refsect2info.element-->]]>
+
+<!ENTITY % refsect2info.attlist "INCLUDE">
+<![ %refsect2info.attlist; [
+<!ATTLIST refsect2info
+		%common.attrib;
+		%refsect2info.role.attrib;
+		%local.refsect2info.attrib;
+>
+<!--end of refsect2info.attlist-->]]>
+<!--end of refsect2info.module-->]]>
+
+<!ENTITY % refsect3info.module "INCLUDE">
+<![ %refsect3info.module; [
+<!ENTITY % local.refsect3info.attrib "">
+<!ENTITY % refsect3info.role.attrib "%role.attrib;">
+
+<!ENTITY % refsect3info.element "INCLUDE">
+<![ %refsect3info.element; [
+<!--doc:Meta-information for a RefSect3.-->
+<!ELEMENT refsect3info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of refsect3info.element-->]]>
+
+<!ENTITY % refsect3info.attlist "INCLUDE">
+<![ %refsect3info.attlist; [
+<!ATTLIST refsect3info
+		%common.attrib;
+		%refsect3info.role.attrib;
+		%local.refsect3info.attrib;
+>
+<!--end of refsect3info.attlist-->]]>
+<!--end of refsect3info.module-->]]>
+
+<!ENTITY % refsynopsisdivinfo.module "INCLUDE">
+<![ %refsynopsisdivinfo.module; [
+<!ENTITY % local.refsynopsisdivinfo.attrib "">
+<!ENTITY % refsynopsisdivinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % refsynopsisdivinfo.element "INCLUDE">
+<![ %refsynopsisdivinfo.element; [
+<!--doc:Meta-information for a RefSynopsisDiv.-->
+<!ELEMENT refsynopsisdivinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of refsynopsisdivinfo.element-->]]>
+
+<!ENTITY % refsynopsisdivinfo.attlist "INCLUDE">
+<![ %refsynopsisdivinfo.attlist; [
+<!ATTLIST refsynopsisdivinfo
+		%common.attrib;
+		%refsynopsisdivinfo.role.attrib;
+		%local.refsynopsisdivinfo.attrib;
+>
+<!--end of refsynopsisdivinfo.attlist-->]]>
+<!--end of refsynopsisdivinfo.module-->]]>
+
+<!ENTITY % referenceinfo.module "INCLUDE">
+<![ %referenceinfo.module; [
+<!ENTITY % local.referenceinfo.attrib "">
+<!ENTITY % referenceinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % referenceinfo.element "INCLUDE">
+<![ %referenceinfo.element; [
+<!--doc:Meta-information for a Reference.-->
+<!ELEMENT referenceinfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of referenceinfo.element-->]]>
+
+<!ENTITY % referenceinfo.attlist "INCLUDE">
+<![ %referenceinfo.attlist; [
+<!ATTLIST referenceinfo
+		%common.attrib;
+		%referenceinfo.role.attrib;
+		%local.referenceinfo.attrib;
+>
+<!--end of referenceinfo.attlist-->]]>
+<!--end of referenceinfo.module-->]]>
+
+<!ENTITY % local.sect1info.attrib "">
+<!ENTITY % sect1info.role.attrib "%role.attrib;">
+
+<!ENTITY % sect1info.element "INCLUDE">
+<![%sect1info.element;[
+<!--doc:Meta-information for a Sect1.-->
+<!ELEMENT sect1info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of sect1info.element-->]]>
+
+<!ENTITY % sect1info.attlist "INCLUDE">
+<![%sect1info.attlist;[
+<!ATTLIST sect1info
+		%common.attrib;
+		%sect1info.role.attrib;
+		%local.sect1info.attrib;
+>
+<!--end of sect1info.attlist-->]]>
+
+<!ENTITY % local.sect2info.attrib "">
+<!ENTITY % sect2info.role.attrib "%role.attrib;">
+
+<!ENTITY % sect2info.element "INCLUDE">
+<![%sect2info.element;[
+<!--doc:Meta-information for a Sect2.-->
+<!ELEMENT sect2info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of sect2info.element-->]]>
+
+<!ENTITY % sect2info.attlist "INCLUDE">
+<![%sect2info.attlist;[
+<!ATTLIST sect2info
+		%common.attrib;
+		%sect2info.role.attrib;
+		%local.sect2info.attrib;
+>
+<!--end of sect2info.attlist-->]]>
+
+<!ENTITY % local.sect3info.attrib "">
+<!ENTITY % sect3info.role.attrib "%role.attrib;">
+
+<!ENTITY % sect3info.element "INCLUDE">
+<![%sect3info.element;[
+<!--doc:Meta-information for a Sect3.-->
+<!ELEMENT sect3info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of sect3info.element-->]]>
+
+<!ENTITY % sect3info.attlist "INCLUDE">
+<![%sect3info.attlist;[
+<!ATTLIST sect3info
+		%common.attrib;
+		%sect3info.role.attrib;
+		%local.sect3info.attrib;
+>
+<!--end of sect3info.attlist-->]]>
+
+<!ENTITY % local.sect4info.attrib "">
+<!ENTITY % sect4info.role.attrib "%role.attrib;">
+
+<!ENTITY % sect4info.element "INCLUDE">
+<![%sect4info.element;[
+<!--doc:Meta-information for a Sect4.-->
+<!ELEMENT sect4info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of sect4info.element-->]]>
+
+<!ENTITY % sect4info.attlist "INCLUDE">
+<![%sect4info.attlist;[
+<!ATTLIST sect4info
+		%common.attrib;
+		%sect4info.role.attrib;
+		%local.sect4info.attrib;
+>
+<!--end of sect4info.attlist-->]]>
+
+<!ENTITY % local.sect5info.attrib "">
+<!ENTITY % sect5info.role.attrib "%role.attrib;">
+
+<!ENTITY % sect5info.element "INCLUDE">
+<![%sect5info.element;[
+<!--doc:Meta-information for a Sect5.-->
+<!ELEMENT sect5info %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of sect5info.element-->]]>
+
+<!ENTITY % sect5info.attlist "INCLUDE">
+<![%sect5info.attlist;[
+<!ATTLIST sect5info
+		%common.attrib;
+		%sect5info.role.attrib;
+		%local.sect5info.attrib;
+>
+<!--end of sect5info.attlist-->]]>
+
+<!-- ...................................................................... -->
+<!-- Section (parallel to Sect*) ......................................... -->
+
+<!ENTITY % section.content.module "INCLUDE">
+<![ %section.content.module; [
+<!ENTITY % section.module "INCLUDE">
+<![ %section.module; [
+<!ENTITY % local.section.attrib "">
+<!ENTITY % section.role.attrib "%role.attrib;">
+
+<!ENTITY % section.element "INCLUDE">
+<![ %section.element; [
+<!--doc:A recursive section.-->
+<!ELEMENT section %ho; (sectioninfo?,
+			(%sect.title.content;),
+			(%nav.class;)*,
+			(((%divcomponent.mix;)+,
+ 			  ((%refentry.class;)*|(%section.class;)*|simplesect*))
+			 | (%refentry.class;)+|(%section.class;)+|simplesect+),
+			(%nav.class;)*)
+		%ubiq.inclusion;>
+<!--end of section.element-->]]>
+
+<!ENTITY % section.attlist "INCLUDE">
+<![ %section.attlist; [
+<!ATTLIST section
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%section.role.attrib;
+		%local.section.attrib;
+>
+<!--end of section.attlist-->]]>
+<!--end of section.module-->]]>
+
+<!ENTITY % sectioninfo.module "INCLUDE">
+<![ %sectioninfo.module; [
+<!ENTITY % sectioninfo.role.attrib "%role.attrib;">
+<!ENTITY % local.sectioninfo.attrib "">
+
+<!ENTITY % sectioninfo.element "INCLUDE">
+<![ %sectioninfo.element; [
+<!--doc:Meta-information for a recursive section.-->
+<!ELEMENT sectioninfo %ho; ((%info.class;)+)
+		%beginpage.exclusion;>
+<!--end of sectioninfo.element-->]]>
+
+<!ENTITY % sectioninfo.attlist "INCLUDE">
+<![ %sectioninfo.attlist; [
+<!ATTLIST sectioninfo
+		%common.attrib;
+		%sectioninfo.role.attrib;
+		%local.sectioninfo.attrib;
+>
+<!--end of sectioninfo.attlist-->]]>
+<!--end of sectioninfo.module-->]]>
+<!--end of section.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Sect1, Sect2, Sect3, Sect4, Sect5 .................................... -->
+
+<!ENTITY % sect1.module "INCLUDE">
+<![%sect1.module;[
+<!ENTITY % local.sect1.attrib "">
+<!ENTITY % sect1.role.attrib "%role.attrib;">
+
+<!ENTITY % sect1.element "INCLUDE">
+<![%sect1.element;[
+<!--doc:A top-level section of document.-->
+<!ELEMENT sect1 %ho; (sect1info?, (%sect.title.content;), (%nav.class;)*,
+		(((%divcomponent.mix;)+,
+		((%refentry.class;)* | sect2* | simplesect*))
+		| (%refentry.class;)+ | sect2+ | simplesect+), (%nav.class;)*)
+		%ubiq.inclusion;>
+<!--end of sect1.element-->]]>
+
+<!-- Renderas: Indicates the format in which the heading should
+		appear -->
+
+
+<!ENTITY % sect1.attlist "INCLUDE">
+<![%sect1.attlist;[
+<!ATTLIST sect1
+		renderas	(sect2
+				|sect3
+				|sect4
+				|sect5)		#IMPLIED
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%sect1.role.attrib;
+		%local.sect1.attrib;
+>
+<!--end of sect1.attlist-->]]>
+<!--end of sect1.module-->]]>
+
+<!ENTITY % sect2.module "INCLUDE">
+<![%sect2.module;[
+<!ENTITY % local.sect2.attrib "">
+<!ENTITY % sect2.role.attrib "%role.attrib;">
+
+<!ENTITY % sect2.element "INCLUDE">
+<![%sect2.element;[
+<!--doc:A subsection within a Sect1.-->
+<!ELEMENT sect2 %ho; (sect2info?, (%sect.title.content;), (%nav.class;)*,
+		(((%divcomponent.mix;)+,
+		((%refentry.class;)* | sect3* | simplesect*))
+		| (%refentry.class;)+ | sect3+ | simplesect+), (%nav.class;)*)>
+<!--end of sect2.element-->]]>
+
+<!-- Renderas: Indicates the format in which the heading should
+		appear -->
+
+
+<!ENTITY % sect2.attlist "INCLUDE">
+<![%sect2.attlist;[
+<!ATTLIST sect2
+		renderas	(sect1
+				|sect3
+				|sect4
+				|sect5)		#IMPLIED
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%sect2.role.attrib;
+		%local.sect2.attrib;
+>
+<!--end of sect2.attlist-->]]>
+<!--end of sect2.module-->]]>
+
+<!ENTITY % sect3.module "INCLUDE">
+<![%sect3.module;[
+<!ENTITY % local.sect3.attrib "">
+<!ENTITY % sect3.role.attrib "%role.attrib;">
+
+<!ENTITY % sect3.element "INCLUDE">
+<![%sect3.element;[
+<!--doc:A subsection within a Sect2.-->
+<!ELEMENT sect3 %ho; (sect3info?, (%sect.title.content;), (%nav.class;)*,
+		(((%divcomponent.mix;)+,
+		((%refentry.class;)* | sect4* | simplesect*))
+		| (%refentry.class;)+ | sect4+ | simplesect+), (%nav.class;)*)>
+<!--end of sect3.element-->]]>
+
+<!-- Renderas: Indicates the format in which the heading should
+		appear -->
+
+
+<!ENTITY % sect3.attlist "INCLUDE">
+<![%sect3.attlist;[
+<!ATTLIST sect3
+		renderas	(sect1
+				|sect2
+				|sect4
+				|sect5)		#IMPLIED
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%sect3.role.attrib;
+		%local.sect3.attrib;
+>
+<!--end of sect3.attlist-->]]>
+<!--end of sect3.module-->]]>
+
+<!ENTITY % sect4.module "INCLUDE">
+<![%sect4.module;[
+<!ENTITY % local.sect4.attrib "">
+<!ENTITY % sect4.role.attrib "%role.attrib;">
+
+<!ENTITY % sect4.element "INCLUDE">
+<![%sect4.element;[
+<!--doc:A subsection within a Sect3.-->
+<!ELEMENT sect4 %ho; (sect4info?, (%sect.title.content;), (%nav.class;)*,
+		(((%divcomponent.mix;)+,
+		((%refentry.class;)* | sect5* | simplesect*))
+		| (%refentry.class;)+ | sect5+ | simplesect+), (%nav.class;)*)>
+<!--end of sect4.element-->]]>
+
+<!-- Renderas: Indicates the format in which the heading should
+		appear -->
+
+
+<!ENTITY % sect4.attlist "INCLUDE">
+<![%sect4.attlist;[
+<!ATTLIST sect4
+		renderas	(sect1
+				|sect2
+				|sect3
+				|sect5)		#IMPLIED
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%sect4.role.attrib;
+		%local.sect4.attrib;
+>
+<!--end of sect4.attlist-->]]>
+<!--end of sect4.module-->]]>
+
+<!ENTITY % sect5.module "INCLUDE">
+<![%sect5.module;[
+<!ENTITY % local.sect5.attrib "">
+<!ENTITY % sect5.role.attrib "%role.attrib;">
+
+<!ENTITY % sect5.element "INCLUDE">
+<![%sect5.element;[
+<!--doc:A subsection within a Sect4.-->
+<!ELEMENT sect5 %ho; (sect5info?, (%sect.title.content;), (%nav.class;)*,
+		(((%divcomponent.mix;)+, ((%refentry.class;)* | simplesect*))
+		| (%refentry.class;)+ | simplesect+), (%nav.class;)*)>
+<!--end of sect5.element-->]]>
+
+<!-- Renderas: Indicates the format in which the heading should
+		appear -->
+
+
+<!ENTITY % sect5.attlist "INCLUDE">
+<![%sect5.attlist;[
+<!ATTLIST sect5
+		renderas	(sect1
+				|sect2
+				|sect3
+				|sect4)		#IMPLIED
+		%label.attrib;
+		%status.attrib;
+		%common.attrib;
+		%sect5.role.attrib;
+		%local.sect5.attrib;
+>
+<!--end of sect5.attlist-->]]>
+<!--end of sect5.module-->]]>
+
+<!ENTITY % simplesect.module "INCLUDE">
+<![%simplesect.module;[
+<!ENTITY % local.simplesect.attrib "">
+<!ENTITY % simplesect.role.attrib "%role.attrib;">
+
+<!ENTITY % simplesect.element "INCLUDE">
+<![%simplesect.element;[
+<!--doc:A section of a document with no subdivisions.-->
+<!ELEMENT simplesect %ho; ((%sect.title.content;), (%divcomponent.mix;)+)
+		%ubiq.inclusion;>
+<!--end of simplesect.element-->]]>
+
+<!ENTITY % simplesect.attlist "INCLUDE">
+<![%simplesect.attlist;[
+<!ATTLIST simplesect
+		%common.attrib;
+		%simplesect.role.attrib;
+		%local.simplesect.attrib;
+>
+<!--end of simplesect.attlist-->]]>
+<!--end of simplesect.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Bibliography ......................................................... -->
+
+<!ENTITY % bibliography.content.module "INCLUDE">
+<![%bibliography.content.module;[
+<!ENTITY % bibliography.module "INCLUDE">
+<![%bibliography.module;[
+<!ENTITY % local.bibliography.attrib "">
+<!ENTITY % bibliography.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliography.element "INCLUDE">
+<![%bibliography.element;[
+<!--doc:A bibliography.-->
+<!ELEMENT bibliography %ho; (bibliographyinfo?,
+                        (%bookcomponent.title.content;)?,
+                        (%component.mix;)*,
+                        (bibliodiv+ | (biblioentry|bibliomixed)+))>
+<!--end of bibliography.element-->]]>
+
+<!ENTITY % bibliography.attlist "INCLUDE">
+<![%bibliography.attlist;[
+<!ATTLIST bibliography
+		%status.attrib;
+		%common.attrib;
+		%bibliography.role.attrib;
+		%local.bibliography.attrib;
+>
+<!--end of bibliography.attlist-->]]>
+<!--end of bibliography.module-->]]>
+
+<!ENTITY % bibliodiv.module "INCLUDE">
+<![%bibliodiv.module;[
+<!ENTITY % local.bibliodiv.attrib "">
+<!ENTITY % bibliodiv.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliodiv.element "INCLUDE">
+<![%bibliodiv.element;[
+<!--doc:A section of a Bibliography.-->
+<!ELEMENT bibliodiv %ho; ((%sect.title.content;)?, (%component.mix;)*,
+		(biblioentry|bibliomixed)+)>
+<!--end of bibliodiv.element-->]]>
+
+<!ENTITY % bibliodiv.attlist "INCLUDE">
+<![%bibliodiv.attlist;[
+<!ATTLIST bibliodiv
+		%status.attrib;
+		%common.attrib;
+		%bibliodiv.role.attrib;
+		%local.bibliodiv.attrib;
+>
+<!--end of bibliodiv.attlist-->]]>
+<!--end of bibliodiv.module-->]]>
+<!--end of bibliography.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Glossary ............................................................. -->
+
+<!ENTITY % glossary.content.module "INCLUDE">
+<![%glossary.content.module;[
+<!ENTITY % glossary.module "INCLUDE">
+<![%glossary.module;[
+<!ENTITY % local.glossary.attrib "">
+<!ENTITY % glossary.role.attrib "%role.attrib;">
+
+<!ENTITY % glossary.element "INCLUDE">
+<![%glossary.element;[
+<!--doc:A glossary.-->
+<!ELEMENT glossary %ho; (glossaryinfo?,
+                    (%bookcomponent.title.content;)?,
+                    (%component.mix;)*,
+                    (glossdiv+ | glossentry+), bibliography?)>
+<!--end of glossary.element-->]]>
+
+<!ENTITY % glossary.attlist "INCLUDE">
+<![%glossary.attlist;[
+<!ATTLIST glossary
+		%status.attrib;
+		%common.attrib;
+		%glossary.role.attrib;
+		%local.glossary.attrib;
+>
+<!--end of glossary.attlist-->]]>
+<!--end of glossary.module-->]]>
+
+<!ENTITY % glossdiv.module "INCLUDE">
+<![%glossdiv.module;[
+<!ENTITY % local.glossdiv.attrib "">
+<!ENTITY % glossdiv.role.attrib "%role.attrib;">
+
+<!ENTITY % glossdiv.element "INCLUDE">
+<![%glossdiv.element;[
+<!--doc:A division in a Glossary.-->
+<!ELEMENT glossdiv %ho; ((%sect.title.content;), (%component.mix;)*,
+		glossentry+)>
+<!--end of glossdiv.element-->]]>
+
+<!ENTITY % glossdiv.attlist "INCLUDE">
+<![%glossdiv.attlist;[
+<!ATTLIST glossdiv
+		%status.attrib;
+		%common.attrib;
+		%glossdiv.role.attrib;
+		%local.glossdiv.attrib;
+>
+<!--end of glossdiv.attlist-->]]>
+<!--end of glossdiv.module-->]]>
+<!--end of glossary.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Index and SetIndex ................................................... -->
+
+<!ENTITY % index.content.module "INCLUDE">
+<![%index.content.module;[
+<!ENTITY % indexes.module "INCLUDE">
+<![%indexes.module;[
+<!ENTITY % local.indexes.attrib "">
+<!ENTITY % indexes.role.attrib "%role.attrib;">
+
+<!ENTITY % index.element "INCLUDE">
+<![%index.element;[
+<!--doc:An index.-->
+<!ELEMENT index %ho; (indexinfo?,
+                 (%bookcomponent.title.content;)?,
+                 (%component.mix;)*,
+                 (indexdiv* | indexentry*))
+		%ndxterm.exclusion;>
+<!--end of index.element-->]]>
+
+<!ENTITY % index.attlist "INCLUDE">
+<![%index.attlist;[
+<!ATTLIST index
+		type		CDATA		#IMPLIED
+		%common.attrib;
+		%indexes.role.attrib;
+		%local.indexes.attrib;
+>
+<!--end of index.attlist-->]]>
+
+<!ENTITY % setindex.element "INCLUDE">
+<![%setindex.element;[
+<!--doc:An index to a set of books.-->
+<!ELEMENT setindex %ho; (setindexinfo?,
+                    (%bookcomponent.title.content;)?,
+                    (%component.mix;)*,
+                    (indexdiv* | indexentry*))
+		%ndxterm.exclusion;>
+<!--end of setindex.element-->]]>
+
+<!ENTITY % setindex.attlist "INCLUDE">
+<![%setindex.attlist;[
+<!ATTLIST setindex
+		%common.attrib;
+		%indexes.role.attrib;
+		%local.indexes.attrib;
+>
+<!--end of setindex.attlist-->]]>
+<!--end of indexes.module-->]]>
+
+<!ENTITY % indexdiv.module "INCLUDE">
+<![%indexdiv.module;[
+
+<!-- SegmentedList in this content is useful for marking up permuted
+     indices. -->
+
+<!ENTITY % local.indexdiv.attrib "">
+<!ENTITY % indexdiv.role.attrib "%role.attrib;">
+
+<!ENTITY % indexdiv.element "INCLUDE">
+<![%indexdiv.element;[
+<!--doc:A division in an index.-->
+<!ELEMENT indexdiv %ho; ((%sect.title.content;)?, ((%indexdivcomponent.mix;)*,
+		(indexentry+ | segmentedlist)))>
+<!--end of indexdiv.element-->]]>
+
+<!ENTITY % indexdiv.attlist "INCLUDE">
+<![%indexdiv.attlist;[
+<!ATTLIST indexdiv
+		%common.attrib;
+		%indexdiv.role.attrib;
+		%local.indexdiv.attrib;
+>
+<!--end of indexdiv.attlist-->]]>
+<!--end of indexdiv.module-->]]>
+
+<!ENTITY % indexentry.module "INCLUDE">
+<![%indexentry.module;[
+<!-- Index entries appear in the index, not the text. -->
+
+<!ENTITY % local.indexentry.attrib "">
+<!ENTITY % indexentry.role.attrib "%role.attrib;">
+
+<!ENTITY % indexentry.element "INCLUDE">
+<![%indexentry.element;[
+<!--doc:An entry in an index.-->
+<!ELEMENT indexentry %ho; (primaryie, (seeie|seealsoie)*,
+		(secondaryie, (seeie|seealsoie|tertiaryie)*)*)>
+<!--end of indexentry.element-->]]>
+
+<!ENTITY % indexentry.attlist "INCLUDE">
+<![%indexentry.attlist;[
+<!ATTLIST indexentry
+		%common.attrib;
+		%indexentry.role.attrib;
+		%local.indexentry.attrib;
+>
+<!--end of indexentry.attlist-->]]>
+<!--end of indexentry.module-->]]>
+
+<!ENTITY % primsecterie.module "INCLUDE">
+<![%primsecterie.module;[
+<!ENTITY % local.primsecterie.attrib "">
+<!ENTITY % primsecterie.role.attrib "%role.attrib;">
+
+<!ENTITY % primaryie.element "INCLUDE">
+<![%primaryie.element;[
+<!--doc:A primary term in an index entry, not in the text.-->
+<!ELEMENT primaryie %ho; (%ndxterm.char.mix;)*>
+<!--end of primaryie.element-->]]>
+
+<!-- to IndexTerms that these entries represent -->
+
+<!ENTITY % primaryie.attlist "INCLUDE">
+<![%primaryie.attlist;[
+<!ATTLIST primaryie
+		%linkends.attrib;		%common.attrib;
+		%primsecterie.role.attrib;
+		%local.primsecterie.attrib;
+>
+<!--end of primaryie.attlist-->]]>
+
+<!ENTITY % secondaryie.element "INCLUDE">
+<![%secondaryie.element;[
+<!--doc:A secondary term in an index entry, rather than in the text.-->
+<!ELEMENT secondaryie %ho; (%ndxterm.char.mix;)*>
+<!--end of secondaryie.element-->]]>
+
+<!-- to IndexTerms that these entries represent -->
+
+<!ENTITY % secondaryie.attlist "INCLUDE">
+<![%secondaryie.attlist;[
+<!ATTLIST secondaryie
+		%linkends.attrib;		%common.attrib;
+		%primsecterie.role.attrib;
+		%local.primsecterie.attrib;
+>
+<!--end of secondaryie.attlist-->]]>
+
+<!ENTITY % tertiaryie.element "INCLUDE">
+<![%tertiaryie.element;[
+<!--doc:A tertiary term in an index entry, rather than in the text.-->
+<!ELEMENT tertiaryie %ho; (%ndxterm.char.mix;)*>
+<!--end of tertiaryie.element-->]]>
+
+<!-- to IndexTerms that these entries represent -->
+
+<!ENTITY % tertiaryie.attlist "INCLUDE">
+<![%tertiaryie.attlist;[
+<!ATTLIST tertiaryie
+		%linkends.attrib;		%common.attrib;
+		%primsecterie.role.attrib;
+		%local.primsecterie.attrib;
+>
+<!--end of tertiaryie.attlist-->]]>
+
+<!--end of primsecterie.module-->]]>
+
+<!ENTITY % seeie.module "INCLUDE">
+<![%seeie.module;[
+<!ENTITY % local.seeie.attrib "">
+<!ENTITY % seeie.role.attrib "%role.attrib;">
+
+<!ENTITY % seeie.element "INCLUDE">
+<![%seeie.element;[
+<!--doc:A See entry in an index, rather than in the text.-->
+<!ELEMENT seeie %ho; (%ndxterm.char.mix;)*>
+<!--end of seeie.element-->]]>
+
+<!-- to IndexEntry to look up -->
+
+
+<!ENTITY % seeie.attlist "INCLUDE">
+<![%seeie.attlist;[
+<!ATTLIST seeie
+		%linkend.attrib;		%common.attrib;
+		%seeie.role.attrib;
+		%local.seeie.attrib;
+>
+<!--end of seeie.attlist-->]]>
+<!--end of seeie.module-->]]>
+
+<!ENTITY % seealsoie.module "INCLUDE">
+<![%seealsoie.module;[
+<!ENTITY % local.seealsoie.attrib "">
+<!ENTITY % seealsoie.role.attrib "%role.attrib;">
+
+<!ENTITY % seealsoie.element "INCLUDE">
+<![%seealsoie.element;[
+<!--doc:A See also entry in an index, rather than in the text.-->
+<!ELEMENT seealsoie %ho; (%ndxterm.char.mix;)*>
+<!--end of seealsoie.element-->]]>
+
+<!-- to related IndexEntries -->
+
+
+<!ENTITY % seealsoie.attlist "INCLUDE">
+<![%seealsoie.attlist;[
+<!ATTLIST seealsoie
+		%linkends.attrib;		%common.attrib;
+		%seealsoie.role.attrib;
+		%local.seealsoie.attrib;
+>
+<!--end of seealsoie.attlist-->]]>
+<!--end of seealsoie.module-->]]>
+<!--end of index.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- RefEntry ............................................................. -->
+
+<!ENTITY % refentry.content.module "INCLUDE">
+<![%refentry.content.module;[
+<!ENTITY % refentry.module "INCLUDE">
+<![%refentry.module;[
+<!ENTITY % local.refentry.attrib "">
+<!ENTITY % refentry.role.attrib "%role.attrib;">
+
+<!ENTITY % refentry.element "INCLUDE">
+<![%refentry.element;[
+<!--doc:A reference page (originally a UNIX man-style reference page).-->
+<!ELEMENT refentry %ho; (beginpage?,
+                    (%ndxterm.class;)*,
+                    refentryinfo?, refmeta?, (remark|%link.char.class;)*,
+                    refnamediv+, refsynopsisdiv?, (refsect1+|refsection+))
+		%ubiq.inclusion;>
+<!--end of refentry.element-->]]>
+
+<!ENTITY % refentry.attlist "INCLUDE">
+<![%refentry.attlist;[
+<!ATTLIST refentry
+		%status.attrib;
+		%common.attrib;
+		%refentry.role.attrib;
+		%local.refentry.attrib;
+>
+<!--end of refentry.attlist-->]]>
+<!--end of refentry.module-->]]>
+
+<!ENTITY % refmeta.module "INCLUDE">
+<![%refmeta.module;[
+<!ENTITY % local.refmeta.attrib "">
+<!ENTITY % refmeta.role.attrib "%role.attrib;">
+
+<!ENTITY % refmeta.element "INCLUDE">
+<![%refmeta.element;[
+<!--doc:Meta-information for a reference entry.-->
+<!ELEMENT refmeta %ho; ((%ndxterm.class;)*,
+                   refentrytitle, manvolnum?, refmiscinfo*,
+                   (%ndxterm.class;)*)
+		%beginpage.exclusion;>
+<!--end of refmeta.element-->]]>
+
+<!ENTITY % refmeta.attlist "INCLUDE">
+<![%refmeta.attlist;[
+<!ATTLIST refmeta
+		%common.attrib;
+		%refmeta.role.attrib;
+		%local.refmeta.attrib;
+>
+<!--end of refmeta.attlist-->]]>
+<!--end of refmeta.module-->]]>
+
+<!ENTITY % refmiscinfo.module "INCLUDE">
+<![%refmiscinfo.module;[
+<!ENTITY % local.refmiscinfo.attrib "">
+<!ENTITY % refmiscinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % refmiscinfo.element "INCLUDE">
+<![%refmiscinfo.element;[
+<!--doc:Meta-information for a reference entry other than the title and volume number.-->
+<!ELEMENT refmiscinfo %ho; (%docinfo.char.mix;)*>
+<!--end of refmiscinfo.element-->]]>
+
+<!-- Class: Freely assignable parameter; no default -->
+
+
+<!ENTITY % refmiscinfo.attlist "INCLUDE">
+<![%refmiscinfo.attlist;[
+<!ATTLIST refmiscinfo
+		class		CDATA		#IMPLIED
+		%common.attrib;
+		%refmiscinfo.role.attrib;
+		%local.refmiscinfo.attrib;
+>
+<!--end of refmiscinfo.attlist-->]]>
+<!--end of refmiscinfo.module-->]]>
+
+<!ENTITY % refnamediv.module "INCLUDE">
+<![%refnamediv.module;[
+<!ENTITY % local.refnamediv.attrib "">
+<!ENTITY % refnamediv.role.attrib "%role.attrib;">
+
+<!ENTITY % refnamediv.element "INCLUDE">
+<![%refnamediv.element;[
+<!--doc:The name, purpose, and classification of a reference page.-->
+<!ELEMENT refnamediv %ho; (refdescriptor?, refname+, refpurpose, refclass*,
+		(remark|%link.char.class;)*)>
+<!--end of refnamediv.element-->]]>
+
+<!ENTITY % refnamediv.attlist "INCLUDE">
+<![%refnamediv.attlist;[
+<!ATTLIST refnamediv
+		%common.attrib;
+		%refnamediv.role.attrib;
+		%local.refnamediv.attrib;
+>
+<!--end of refnamediv.attlist-->]]>
+<!--end of refnamediv.module-->]]>
+
+<!ENTITY % refdescriptor.module "INCLUDE">
+<![%refdescriptor.module;[
+<!ENTITY % local.refdescriptor.attrib "">
+<!ENTITY % refdescriptor.role.attrib "%role.attrib;">
+
+<!ENTITY % refdescriptor.element "INCLUDE">
+<![%refdescriptor.element;[
+<!--doc:A description of the topic of a reference page.-->
+<!ELEMENT refdescriptor %ho; (%refname.char.mix;)*>
+<!--end of refdescriptor.element-->]]>
+
+<!ENTITY % refdescriptor.attlist "INCLUDE">
+<![%refdescriptor.attlist;[
+<!ATTLIST refdescriptor
+		%common.attrib;
+		%refdescriptor.role.attrib;
+		%local.refdescriptor.attrib;
+>
+<!--end of refdescriptor.attlist-->]]>
+<!--end of refdescriptor.module-->]]>
+
+<!ENTITY % refname.module "INCLUDE">
+<![%refname.module;[
+<!ENTITY % local.refname.attrib "">
+<!ENTITY % refname.role.attrib "%role.attrib;">
+
+<!ENTITY % refname.element "INCLUDE">
+<![%refname.element;[
+<!--doc:The name of (one of) the subject(s) of a reference page.-->
+<!ELEMENT refname %ho; (%refname.char.mix;)*>
+<!--end of refname.element-->]]>
+
+<!ENTITY % refname.attlist "INCLUDE">
+<![%refname.attlist;[
+<!ATTLIST refname
+		%common.attrib;
+		%refname.role.attrib;
+		%local.refname.attrib;
+>
+<!--end of refname.attlist-->]]>
+<!--end of refname.module-->]]>
+
+<!ENTITY % refpurpose.module "INCLUDE">
+<![%refpurpose.module;[
+<!ENTITY % local.refpurpose.attrib "">
+<!ENTITY % refpurpose.role.attrib "%role.attrib;">
+
+<!ENTITY % refpurpose.element "INCLUDE">
+<![%refpurpose.element;[
+<!--doc:A short (one sentence) synopsis of the topic of a reference page.-->
+<!ELEMENT refpurpose %ho; (%refinline.char.mix;)*>
+<!--end of refpurpose.element-->]]>
+
+<!ENTITY % refpurpose.attlist "INCLUDE">
+<![%refpurpose.attlist;[
+<!ATTLIST refpurpose
+		%common.attrib;
+		%refpurpose.role.attrib;
+		%local.refpurpose.attrib;
+>
+<!--end of refpurpose.attlist-->]]>
+<!--end of refpurpose.module-->]]>
+
+<!ENTITY % refclass.module "INCLUDE">
+<![%refclass.module;[
+<!ENTITY % local.refclass.attrib "">
+<!ENTITY % refclass.role.attrib "%role.attrib;">
+
+<!ENTITY % refclass.element "INCLUDE">
+<![%refclass.element;[
+<!--doc:The scope or other indication of applicability of a reference entry.-->
+<!ELEMENT refclass %ho; (%refclass.char.mix;)*>
+<!--end of refclass.element-->]]>
+
+<!ENTITY % refclass.attlist "INCLUDE">
+<![%refclass.attlist;[
+<!ATTLIST refclass
+		%common.attrib;
+		%refclass.role.attrib;
+		%local.refclass.attrib;
+>
+<!--end of refclass.attlist-->]]>
+<!--end of refclass.module-->]]>
+
+<!ENTITY % refsynopsisdiv.module "INCLUDE">
+<![%refsynopsisdiv.module;[
+<!ENTITY % local.refsynopsisdiv.attrib "">
+<!ENTITY % refsynopsisdiv.role.attrib "%role.attrib;">
+
+<!ENTITY % refsynopsisdiv.element "INCLUDE">
+<![%refsynopsisdiv.element;[
+<!--doc:A syntactic synopsis of the subject of the reference page.-->
+<!ELEMENT refsynopsisdiv %ho; (refsynopsisdivinfo?, (%refsect.title.content;)?,
+		(((%refcomponent.mix;)+, refsect2*) | (refsect2+)))>
+<!--end of refsynopsisdiv.element-->]]>
+
+<!ENTITY % refsynopsisdiv.attlist "INCLUDE">
+<![%refsynopsisdiv.attlist;[
+<!ATTLIST refsynopsisdiv
+		%common.attrib;
+		%refsynopsisdiv.role.attrib;
+		%local.refsynopsisdiv.attrib;
+>
+<!--end of refsynopsisdiv.attlist-->]]>
+<!--end of refsynopsisdiv.module-->]]>
+
+<!ENTITY % refsection.module "INCLUDE">
+<![%refsection.module;[
+<!ENTITY % local.refsection.attrib "">
+<!ENTITY % refsection.role.attrib "%role.attrib;">
+
+<!ENTITY % refsection.element "INCLUDE">
+<![%refsection.element;[
+<!--doc:A recursive section in a refentry.-->
+<!ELEMENT refsection %ho; (refsectioninfo?, (%refsect.title.content;),
+		(((%refcomponent.mix;)+, refsection*) | refsection+))>
+<!--end of refsection.element-->]]>
+
+<!ENTITY % refsection.attlist "INCLUDE">
+<![%refsection.attlist;[
+<!ATTLIST refsection
+		%status.attrib;
+		%common.attrib;
+		%refsection.role.attrib;
+		%local.refsection.attrib;
+>
+<!--end of refsection.attlist-->]]>
+<!--end of refsection.module-->]]>
+
+<!ENTITY % refsect1.module "INCLUDE">
+<![%refsect1.module;[
+<!ENTITY % local.refsect1.attrib "">
+<!ENTITY % refsect1.role.attrib "%role.attrib;">
+
+<!ENTITY % refsect1.element "INCLUDE">
+<![%refsect1.element;[
+<!--doc:A major subsection of a reference entry.-->
+<!ELEMENT refsect1 %ho; (refsect1info?, (%refsect.title.content;),
+		(((%refcomponent.mix;)+, refsect2*) | refsect2+))>
+<!--end of refsect1.element-->]]>
+
+<!ENTITY % refsect1.attlist "INCLUDE">
+<![%refsect1.attlist;[
+<!ATTLIST refsect1
+		%status.attrib;
+		%common.attrib;
+		%refsect1.role.attrib;
+		%local.refsect1.attrib;
+>
+<!--end of refsect1.attlist-->]]>
+<!--end of refsect1.module-->]]>
+
+<!ENTITY % refsect2.module "INCLUDE">
+<![%refsect2.module;[
+<!ENTITY % local.refsect2.attrib "">
+<!ENTITY % refsect2.role.attrib "%role.attrib;">
+
+<!ENTITY % refsect2.element "INCLUDE">
+<![%refsect2.element;[
+<!--doc:A subsection of a RefSect1.-->
+<!ELEMENT refsect2 %ho; (refsect2info?, (%refsect.title.content;),
+	(((%refcomponent.mix;)+, refsect3*) | refsect3+))>
+<!--end of refsect2.element-->]]>
+
+<!ENTITY % refsect2.attlist "INCLUDE">
+<![%refsect2.attlist;[
+<!ATTLIST refsect2
+		%status.attrib;
+		%common.attrib;
+		%refsect2.role.attrib;
+		%local.refsect2.attrib;
+>
+<!--end of refsect2.attlist-->]]>
+<!--end of refsect2.module-->]]>
+
+<!ENTITY % refsect3.module "INCLUDE">
+<![%refsect3.module;[
+<!ENTITY % local.refsect3.attrib "">
+<!ENTITY % refsect3.role.attrib "%role.attrib;">
+
+<!ENTITY % refsect3.element "INCLUDE">
+<![%refsect3.element;[
+<!--doc:A subsection of a RefSect2.-->
+<!ELEMENT refsect3 %ho; (refsect3info?, (%refsect.title.content;),
+	(%refcomponent.mix;)+)>
+<!--end of refsect3.element-->]]>
+
+<!ENTITY % refsect3.attlist "INCLUDE">
+<![%refsect3.attlist;[
+<!ATTLIST refsect3
+		%status.attrib;
+		%common.attrib;
+		%refsect3.role.attrib;
+		%local.refsect3.attrib;
+>
+<!--end of refsect3.attlist-->]]>
+<!--end of refsect3.module-->]]>
+<!--end of refentry.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Article .............................................................. -->
+
+<!ENTITY % article.module "INCLUDE">
+<![%article.module;[
+<!-- An Article is a chapter-level, stand-alone document that is often,
+     but need not be, collected into a Book. -->
+
+<!ENTITY % local.article.attrib "">
+<!ENTITY % article.role.attrib "%role.attrib;">
+
+<!ENTITY % article.element "INCLUDE">
+<![%article.element;[
+<!--doc:An article.-->
+<!ELEMENT article %ho; ((%div.title.content;)?, articleinfo?, tocchap?, lot*,
+			(%bookcomponent.content;),
+			(%nav.class;|%appendix.class;|colophon|ackno)*)
+		%ubiq.inclusion;>
+<!--end of article.element-->]]>
+
+<!-- Class: Indicates the type of a particular article;
+		all articles have the same structure and general purpose.
+		No default. -->
+<!-- ParentBook: ID of the enclosing Book -->
+
+
+<!ENTITY % article.attlist "INCLUDE">
+<![%article.attlist;[
+<!ATTLIST article
+		class		(journalarticle
+				|productsheet
+				|whitepaper
+				|techreport
+                                |specification
+				|faq)		#IMPLIED
+		parentbook	IDREF		#IMPLIED
+		%status.attrib;
+		%common.attrib;
+		%article.role.attrib;
+		%local.article.attrib;
+>
+<!--end of article.attlist-->]]>
+<!--end of article.module-->]]>
+
+<!-- End of DocBook document hierarchy module V4.5 ........................ -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/dbnotnx.mod b/xml/tests/testData/xml/DocBookHighlighting2/dbnotnx.mod
new file mode 100644
index 0000000..2416049b
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/dbnotnx.mod
@@ -0,0 +1,101 @@
+<!-- ...................................................................... -->
+<!-- DocBook notations module V4.5 ........................................ -->
+<!-- File dbnotnx.mod ..................................................... -->
+
+<!-- Copyright 1992-2004 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     $Id: dbnotnx.mod 6340 2006-10-03 13:23:24Z nwalsh $
+
+     Permission to use, copy, modify and distribute the DocBook DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This module contains the notation declarations used by DocBook.
+
+     In DTD driver files referring to this module, please use an entity
+     declaration that uses the public identifier shown below:
+
+     <!ENTITY % dbnotn PUBLIC
+     "-//OASIS//ENTITIES DocBook Notations V4.5//EN"
+     "dbnotnx.mod">
+     %dbnotn;
+
+     See the documentation for detailed information on the parameter
+     entity and module scheme used in DocBook, customizing DocBook and
+     planning for interchange, and changes made since the last release
+     of DocBook.
+-->
+
+<!ENTITY % local.notation.class "">
+<!ENTITY % notation.class
+		"BMP| CGM-CHAR | CGM-BINARY | CGM-CLEAR | DITROFF | DVI
+		| EPS | EQN | FAX | GIF | GIF87a | GIF89a
+		| JPG | JPEG | IGES | PCX
+		| PIC | PNG | PS | SGML | TBL | TEX | TIFF | WMF | WPG
+                | SVG | PDF | SWF
+		| linespecific
+		%local.notation.class;">
+
+<!NOTATION BMP		PUBLIC
+"+//ISBN 0-7923-94.2-1::Graphic Notation//NOTATION Microsoft Windows bitmap//EN">
+<!NOTATION CGM-CHAR	PUBLIC "ISO 8632/2//NOTATION Character encoding//EN">
+<!NOTATION CGM-BINARY	PUBLIC "ISO 8632/3//NOTATION Binary encoding//EN">
+<!NOTATION CGM-CLEAR	PUBLIC "ISO 8632/4//NOTATION Clear text encoding//EN">
+<!NOTATION DITROFF	SYSTEM "DITROFF">
+<!NOTATION DVI		SYSTEM "DVI">
+<!NOTATION EPS		PUBLIC
+"+//ISBN 0-201-18127-4::Adobe//NOTATION PostScript Language Ref. Manual//EN">
+<!NOTATION EQN		SYSTEM "EQN">
+<!NOTATION FAX		PUBLIC
+"-//USA-DOD//NOTATION CCITT Group 4 Facsimile Type 1 Untiled Raster//EN">
+<!NOTATION GIF		SYSTEM "GIF">
+<!NOTATION GIF87a               PUBLIC
+"-//CompuServe//NOTATION Graphics Interchange Format 87a//EN">
+
+<!NOTATION GIF89a               PUBLIC
+"-//CompuServe//NOTATION Graphics Interchange Format 89a//EN">
+<!NOTATION JPG		SYSTEM "JPG">
+<!NOTATION JPEG		SYSTEM "JPG">
+<!NOTATION IGES		PUBLIC
+"-//USA-DOD//NOTATION (ASME/ANSI Y14.26M-1987) Initial Graphics Exchange Specification//EN">
+<!NOTATION PCX		PUBLIC
+"+//ISBN 0-7923-94.2-1::Graphic Notation//NOTATION ZSoft PCX bitmap//EN">
+<!NOTATION PIC		SYSTEM "PIC">
+<!NOTATION PNG          SYSTEM "http://www.w3.org/TR/REC-png">
+<!NOTATION PS		SYSTEM "PS">
+<!NOTATION SGML		PUBLIC
+"ISO 8879:1986//NOTATION Standard Generalized Markup Language//EN">
+<!NOTATION TBL		SYSTEM "TBL">
+<!NOTATION TEX		PUBLIC
+"+//ISBN 0-201-13448-9::Knuth//NOTATION The TeXbook//EN">
+<!NOTATION TIFF		SYSTEM "TIFF">
+<!NOTATION WMF		PUBLIC
+"+//ISBN 0-7923-94.2-1::Graphic Notation//NOTATION Microsoft Windows Metafile//EN">
+<!NOTATION WPG		SYSTEM "WPG"> <!--WordPerfect Graphic format-->
+<!NOTATION SVG		SYSTEM "http://www.w3.org/TR/SVG/">
+<!NOTATION PDF		SYSTEM "http://www.adobe.com/products/acrobat/adobepdf.html">
+<!NOTATION SWF          SYSTEM "http://www.macromedia.com/software/flash">
+<!NOTATION linespecific	SYSTEM "linespecific">
+
+<!-- End of DocBook notations module V4.5 ................................. -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/dbpoolx.mod b/xml/tests/testData/xml/DocBookHighlighting2/dbpoolx.mod
new file mode 100644
index 0000000..53b0704
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/dbpoolx.mod
@@ -0,0 +1,8701 @@
+<!-- ...................................................................... -->
+<!-- DocBook XML information pool module V4.5 ............................. -->
+<!-- File dbpoolx.mod ..................................................... -->
+
+<!-- Copyright 1992-2004 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     $Id: dbpoolx.mod 6340 2006-10-03 13:23:24Z nwalsh $
+
+     Permission to use, copy, modify and distribute the DocBook XML DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook XML DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This module contains the definitions for the objects, inline
+     elements, and so on that are available to be used as the main
+     content of DocBook documents.  Some elements are useful for general
+     publishing, and others are useful specifically for computer
+     documentation.
+
+     This module has the following dependencies on other modules:
+
+     o It assumes that a %notation.class; entity is defined by the
+       driver file or other high-level module.  This entity is
+       referenced in the NOTATION attributes for the graphic-related and
+       ModeSpec elements.
+
+     o It assumes that an appropriately parameterized table module is
+       available for use with the table-related elements.
+
+     In DTD driver files referring to this module, please use an entity
+     declaration that uses the public identifier shown below:
+
+     <!ENTITY % dbpool PUBLIC
+     "-//OASIS//ELEMENTS DocBook XML Information Pool V4.5//EN"
+     "dbpoolx.mod">
+     %dbpool;
+
+     See the documentation for detailed information on the parameter
+     entity and module scheme used in DocBook, customizing DocBook and
+     planning for interchange, and changes made since the last release
+     of DocBook.
+-->
+
+<!-- ...................................................................... -->
+<!-- Forms entities ....................................................... -->
+<!-- These PEs provide the hook by which the forms module can be inserted   -->
+<!-- into the DTD. -->
+<!ENTITY % forminlines.hook "">
+<!ENTITY % forms.hook "">
+
+<!-- ...................................................................... -->
+<!-- General-purpose semantics entities ................................... -->
+
+<!ENTITY % yesorno.attvals	"CDATA">
+
+<!-- ...................................................................... -->
+<!-- Entities for module inclusions ....................................... -->
+
+<!ENTITY % dbpool.redecl.module "IGNORE">
+
+<!-- ...................................................................... -->
+<!-- Entities for element classes and mixtures ............................ -->
+
+<!-- "Ubiquitous" classes: ndxterm.class and beginpage -->
+
+<!ENTITY % local.ndxterm.class "">
+<!ENTITY % ndxterm.class
+		"indexterm %local.ndxterm.class;">
+
+<!-- Object-level classes ................................................. -->
+
+<!ENTITY % local.list.class "">
+<!ENTITY % list.class
+		"calloutlist|glosslist|bibliolist|itemizedlist|orderedlist|segmentedlist
+		|simplelist|variablelist %local.list.class;">
+
+<!ENTITY % local.admon.class "">
+<!ENTITY % admon.class
+		"caution|important|note|tip|warning %local.admon.class;">
+
+<!ENTITY % local.linespecific.class "">
+<!ENTITY % linespecific.class
+		"literallayout|programlisting|programlistingco|screen
+		|screenco|screenshot %local.linespecific.class;">
+
+<!ENTITY % local.method.synop.class "">
+<!ENTITY % method.synop.class
+		"constructorsynopsis
+                 |destructorsynopsis
+                 |methodsynopsis %local.method.synop.class;">
+
+<!ENTITY % local.synop.class "">
+<!ENTITY % synop.class
+		"synopsis|cmdsynopsis|funcsynopsis
+                 |classsynopsis|fieldsynopsis
+                 |%method.synop.class; %local.synop.class;">
+
+<!ENTITY % local.para.class "">
+<!ENTITY % para.class
+		"formalpara|para|simpara %local.para.class;">
+
+<!ENTITY % local.informal.class "">
+<!ENTITY % informal.class
+		"address|blockquote
+                |graphic|graphicco|mediaobject|mediaobjectco
+                |informalequation
+		|informalexample
+                |informalfigure
+                |informaltable %local.informal.class;">
+
+<!ENTITY % local.formal.class "">
+<!ENTITY % formal.class
+		"equation|example|figure|table %local.formal.class;">
+
+<!-- The DocBook TC may produce an official EBNF module for DocBook. -->
+<!-- This PE provides the hook by which it can be inserted into the DTD. -->
+<!ENTITY % ebnf.block.hook "">
+
+<!ENTITY % local.compound.class "">
+<!ENTITY % compound.class
+		"msgset|procedure|sidebar|qandaset|task
+                 %ebnf.block.hook;
+                 %local.compound.class;">
+
+<!ENTITY % local.genobj.class "">
+<!ENTITY % genobj.class
+		"anchor|bridgehead|remark|highlights
+		%local.genobj.class;">
+
+<!ENTITY % local.descobj.class "">
+<!ENTITY % descobj.class
+		"abstract|authorblurb|epigraph
+		%local.descobj.class;">
+
+<!-- Character-level classes .............................................. -->
+
+<!ENTITY % local.xref.char.class "">
+<!ENTITY % xref.char.class
+		"footnoteref|xref|biblioref %local.xref.char.class;">
+
+<!ENTITY % local.gen.char.class "">
+<!ENTITY % gen.char.class
+		"abbrev|acronym|citation|citerefentry|citetitle|citebiblioid|emphasis
+		|firstterm|foreignphrase|glossterm|termdef|footnote|phrase
+		|orgname|quote|trademark|wordasword
+		|personname %local.gen.char.class;">
+
+<!ENTITY % local.link.char.class "">
+<!ENTITY % link.char.class
+		"link|olink|ulink %local.link.char.class;">
+
+<!-- The DocBook TC may produce an official EBNF module for DocBook. -->
+<!-- This PE provides the hook by which it can be inserted into the DTD. -->
+<!ENTITY % ebnf.inline.hook "">
+
+<!ENTITY % local.tech.char.class "">
+<!ENTITY % tech.char.class
+		"action|application
+                |classname|methodname|interfacename|exceptionname
+                |ooclass|oointerface|ooexception
+                |package
+                |command|computeroutput
+		|database|email|envar|errorcode|errorname|errortype|errortext|filename
+		|function|guibutton|guiicon|guilabel|guimenu|guimenuitem
+		|guisubmenu|hardware|interface|keycap
+		|keycode|keycombo|keysym|literal|code|constant|markup|medialabel
+		|menuchoice|mousebutton|option|optional|parameter
+		|prompt|property|replaceable|returnvalue|sgmltag|structfield
+		|structname|symbol|systemitem|uri|token|type|userinput|varname
+                %ebnf.inline.hook;
+		%local.tech.char.class;">
+
+<!ENTITY % local.base.char.class "">
+<!ENTITY % base.char.class
+		"anchor %local.base.char.class;">
+
+<!ENTITY % local.docinfo.char.class "">
+<!ENTITY % docinfo.char.class
+		"author|authorinitials|corpauthor|corpcredit|modespec|othercredit
+		|productname|productnumber|revhistory
+		%local.docinfo.char.class;">
+
+<!ENTITY % local.other.char.class "">
+<!ENTITY % other.char.class
+		"remark|subscript|superscript %local.other.char.class;">
+
+<!ENTITY % local.inlineobj.char.class "">
+<!ENTITY % inlineobj.char.class
+		"inlinegraphic|inlinemediaobject|inlineequation %local.inlineobj.char.class;">
+
+<!-- ...................................................................... -->
+<!-- Entities for content models .......................................... -->
+
+<!ENTITY % formalobject.title.content "title, titleabbrev?">
+
+<!-- Redeclaration placeholder ............................................ -->
+
+<!-- For redeclaring entities that are declared after this point while
+     retaining their references to the entities that are declared before
+     this point -->
+
+<![%dbpool.redecl.module;[
+<!-- Defining rdbpool here makes some buggy XML parsers happy. -->
+<!ENTITY % rdbpool "">
+%rdbpool;
+<!--end of dbpool.redecl.module-->]]>
+
+<!-- Object-level mixtures ................................................ -->
+
+<!--
+                      list admn line synp para infm form cmpd gen  desc
+Component mixture       X    X    X    X    X    X    X    X    X    X
+Sidebar mixture         X    X    X    X    X    X    X    a    X
+Footnote mixture        X         X    X    X    X
+Example mixture         X         X    X    X    X
+Highlights mixture      X    X              X
+Paragraph mixture       X         X    X         X
+Admonition mixture      X         X    X    X    X    X    b    c
+Figure mixture                    X    X         X
+Table entry mixture     X    X    X         X    d
+Glossary def mixture    X         X    X    X    X         e
+Legal notice mixture    X    X    X         X    f
+
+a. Just Procedure; not Sidebar itself or MsgSet.
+b. No MsgSet.
+c. No Highlights.
+d. Just Graphic; no other informal objects.
+e. No Anchor, BridgeHead, or Highlights.
+f. Just BlockQuote; no other informal objects.
+-->
+
+<!ENTITY % local.component.mix "">
+<!ENTITY % component.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|%compound.class;
+		|%genobj.class;		|%descobj.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.component.mix;">
+
+<!ENTITY % local.sidebar.mix "">
+<!ENTITY % sidebar.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|procedure
+		|%genobj.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.sidebar.mix;">
+
+<!ENTITY % local.qandaset.mix "">
+<!ENTITY % qandaset.mix
+		"%list.class;           |%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|procedure
+		|%genobj.class;
+		|%ndxterm.class;
+		%forms.hook;
+                %local.qandaset.mix;">
+
+<!ENTITY % local.revdescription.mix "">
+<!ENTITY % revdescription.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|procedure
+		|%genobj.class;
+		|%ndxterm.class;
+		%local.revdescription.mix;">
+
+<!ENTITY % local.footnote.mix "">
+<!ENTITY % footnote.mix
+		"%list.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		%local.footnote.mix;">
+
+<!ENTITY % local.example.mix "">
+<!ENTITY % example.mix
+		"%list.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%ndxterm.class;        |beginpage
+		|procedure
+		%forms.hook;
+                %local.example.mix;">
+
+<!ENTITY % local.highlights.mix "">
+<!ENTITY % highlights.mix
+		"%list.class;		|%admon.class;
+		|%para.class;
+		|%ndxterm.class;
+		%local.highlights.mix;">
+
+<!-- %formal.class; is explicitly excluded from many contexts in which
+     paragraphs are used -->
+<!ENTITY % local.para.mix "">
+<!ENTITY % para.mix
+		"%list.class;           |%admon.class;
+		|%linespecific.class;
+					|%informal.class;
+		|%formal.class;
+		%local.para.mix;">
+
+<!ENTITY % local.admon.mix "">
+<!ENTITY % admon.mix
+		"%list.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;		|procedure|sidebar
+		|anchor|bridgehead|remark
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.admon.mix;">
+
+<!ENTITY % local.figure.mix "">
+<!ENTITY % figure.mix
+		"%linespecific.class;	|%synop.class;
+					|%informal.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.figure.mix;">
+
+<!ENTITY % local.tabentry.mix "">
+<!ENTITY % tabentry.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;
+		|%para.class;		|graphic|mediaobject
+		%forms.hook;
+		%local.tabentry.mix;">
+
+<!ENTITY % local.glossdef.mix "">
+<!ENTITY % glossdef.mix
+		"%list.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%formal.class;
+		|remark
+		|%ndxterm.class;        |beginpage
+		%local.glossdef.mix;">
+
+<!ENTITY % local.legalnotice.mix "">
+<!ENTITY % legalnotice.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;
+		|%para.class;		|blockquote
+		|%ndxterm.class;        |beginpage
+		%local.legalnotice.mix;">
+
+<!ENTITY % local.textobject.mix "">
+<!ENTITY % textobject.mix
+		"%list.class;		|%admon.class;
+		|%linespecific.class;
+		|%para.class;		|blockquote
+		%local.textobject.mix;">
+
+<!ENTITY % local.mediaobject.mix "">
+<!ENTITY % mediaobject.mix
+		"videoobject|audioobject|imageobject|imageobjectco|textobject %local.mediaobject.mix;">
+
+<!ENTITY % local.listpreamble.mix "">
+<!ENTITY % listpreamble.mix
+		"                  	 %admon.class;
+		|%linespecific.class;	|%synop.class;
+		|%para.class;		|%informal.class;
+		|%genobj.class;		|%descobj.class;
+		|%ndxterm.class;        |beginpage
+		%forms.hook;
+                %local.listpreamble.mix;">
+
+<!-- Character-level mixtures ............................................. -->
+
+<![%sgml.features;[
+<!ENTITY % local.ubiq.mix "">
+<!ENTITY % ubiq.mix "%ndxterm.class;|beginpage %local.ubiq.mix;">
+
+<!ENTITY % ubiq.exclusion "-(%ubiq.mix)">
+<!ENTITY % ubiq.inclusion "+(%ubiq.mix)">
+
+<!ENTITY % footnote.exclusion "-(footnote|%formal.class;)">
+<!ENTITY % highlights.exclusion "-(%ubiq.mix;|%formal.class;)">
+<!ENTITY % admon.exclusion "-(%admon.class;)">
+<!ENTITY % formal.exclusion "-(%formal.class;)">
+<!ENTITY % acronym.exclusion "-(acronym)">
+<!ENTITY % beginpage.exclusion "-(beginpage)">
+<!ENTITY % ndxterm.exclusion "-(%ndxterm.class;)">
+<!ENTITY % blockquote.exclusion "-(epigraph)">
+<!ENTITY % remark.exclusion "-(remark|%ubiq.mix;)">
+<!ENTITY % glossterm.exclusion "-(glossterm)">
+<!ENTITY % links.exclusion "-(link|olink|ulink|xref|biblioref)">
+]]><!-- sgml.features -->
+
+<!-- not [sgml.features[ -->
+<!ENTITY % local.ubiq.mix "">
+<!ENTITY % ubiq.mix "">
+
+<!ENTITY % ubiq.exclusion "">
+<!ENTITY % ubiq.inclusion "">
+
+<!ENTITY % footnote.exclusion "">
+<!ENTITY % highlights.exclusion "">
+<!ENTITY % admon.exclusion "">
+<!ENTITY % formal.exclusion "">
+<!ENTITY % acronym.exclusion "">
+<!ENTITY % beginpage.exclusion "">
+<!ENTITY % ndxterm.exclusion "">
+<!ENTITY % blockquote.exclusion "">
+<!ENTITY % remark.exclusion "">
+<!ENTITY % glossterm.exclusion "">
+<!ENTITY % links.exclusion "">
+<!-- ]] not sgml.features -->
+
+<!--
+                    #PCD xref word link cptr base dnfo othr inob (synop)
+para.char.mix         X    X    X    X    X    X    X    X    X
+title.char.mix        X    X    X    X    X    X    X    X    X
+ndxterm.char.mix      X    X    X    X    X    X    X    X    a
+cptr.char.mix         X              X    X    X         X    a
+smallcptr.char.mix    X                   b                   a
+word.char.mix         X         c    X         X         X    a
+docinfo.char.mix      X         d    X    b              X    a
+
+a. Just InlineGraphic; no InlineEquation.
+b. Just Replaceable; no other computer terms.
+c. Just Emphasis and Trademark; no other word elements.
+d. Just Acronym, Emphasis, and Trademark; no other word elements.
+-->
+
+<!ENTITY % local.para.char.mix "">
+<!ENTITY % para.char.mix
+		"#PCDATA
+		|%xref.char.class;	|%gen.char.class;
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;	|%docinfo.char.class;
+		|%other.char.class;	|%inlineobj.char.class;
+		|%synop.class;
+		|%ndxterm.class;        |beginpage
+                %forminlines.hook;
+		%local.para.char.mix;">
+
+<!ENTITY % local.title.char.mix "">
+<!ENTITY % title.char.mix
+		"#PCDATA
+		|%xref.char.class;	|%gen.char.class;
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;	|%docinfo.char.class;
+		|%other.char.class;	|%inlineobj.char.class;
+		|%ndxterm.class;
+		%local.title.char.mix;">
+
+<!ENTITY % local.ndxterm.char.mix "">
+<!ENTITY % ndxterm.char.mix
+		"#PCDATA
+		|%xref.char.class;	|%gen.char.class;
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;	|%docinfo.char.class;
+		|%other.char.class;	|inlinegraphic|inlinemediaobject
+		%local.ndxterm.char.mix;">
+
+<!ENTITY % local.cptr.char.mix "">
+<!ENTITY % cptr.char.mix
+		"#PCDATA
+		|%link.char.class;	|%tech.char.class;
+		|%base.char.class;
+		|%other.char.class;	|inlinegraphic|inlinemediaobject
+		|%ndxterm.class;        |beginpage
+		%local.cptr.char.mix;">
+
+<!ENTITY % local.smallcptr.char.mix "">
+<!ENTITY % smallcptr.char.mix
+		"#PCDATA
+					|replaceable
+					|inlinegraphic|inlinemediaobject
+		|%ndxterm.class;        |beginpage
+		%local.smallcptr.char.mix;">
+
+<!ENTITY % local.word.char.mix "">
+<!ENTITY % word.char.mix
+		"#PCDATA
+					|acronym|emphasis|trademark
+		|%link.char.class;
+		|%base.char.class;
+		|%other.char.class;	|inlinegraphic|inlinemediaobject
+		|%ndxterm.class;        |beginpage
+		%local.word.char.mix;">
+
+<!ENTITY % local.docinfo.char.mix "">
+<!ENTITY % docinfo.char.mix
+		"#PCDATA
+		|%link.char.class;
+					|emphasis|trademark
+					|replaceable
+		|%other.char.class;	|inlinegraphic|inlinemediaobject
+		|%ndxterm.class;
+		%local.docinfo.char.mix;">
+<!--ENTITY % bibliocomponent.mix (see Bibliographic section, below)-->
+<!--ENTITY % person.ident.mix (see Bibliographic section, below)-->
+
+<!-- ...................................................................... -->
+<!-- Entities for attributes and attribute components ..................... -->
+
+<!-- Effectivity attributes ............................................... -->
+
+
+<!-- Arch: Computer or chip architecture to which element applies; no
+	default -->
+
+<!ENTITY % arch.attrib
+	"arch		CDATA		#IMPLIED">
+
+<!-- Condition: General-purpose effectivity attribute -->
+
+<!ENTITY % condition.attrib
+	"condition	CDATA		#IMPLIED">
+
+<!-- Conformance: Standards conformance characteristics -->
+
+<!ENTITY % conformance.attrib
+	"conformance	NMTOKENS	#IMPLIED">
+
+
+<!-- OS: Operating system to which element applies; no default -->
+
+<!ENTITY % os.attrib
+	"os		CDATA		#IMPLIED">
+
+
+<!-- Revision: Editorial revision to which element belongs; no default -->
+
+<!ENTITY % revision.attrib
+	"revision	CDATA		#IMPLIED">
+
+<!-- Security: Security classification; no default -->
+
+<!ENTITY % security.attrib
+	"security	CDATA		#IMPLIED">
+
+<!-- UserLevel: Level of user experience to which element applies; no
+	default -->
+
+<!ENTITY % userlevel.attrib
+	"userlevel	CDATA		#IMPLIED">
+
+<!-- Vendor: Computer vendor to which element applies; no default -->
+
+<!ENTITY % vendor.attrib
+	"vendor		CDATA		#IMPLIED">
+
+<!-- Wordsize: Computer word size (32 bit, 64 bit, etc.); no default -->
+
+<!ENTITY % wordsize.attrib
+	"wordsize	CDATA		#IMPLIED">
+
+<!ENTITY % local.effectivity.attrib "">
+<!ENTITY % effectivity.attrib
+	"%arch.attrib;
+        %condition.attrib;
+	%conformance.attrib;
+	%os.attrib;
+	%revision.attrib;
+        %security.attrib;
+	%userlevel.attrib;
+	%vendor.attrib;
+	%wordsize.attrib;
+	%local.effectivity.attrib;"
+>
+
+<!-- Common attributes .................................................... -->
+
+
+<!-- Id: Unique identifier of element; no default -->
+
+<!ENTITY % id.attrib
+	"id		ID		#IMPLIED">
+
+
+<!-- Id: Unique identifier of element; a value must be supplied; no
+	default -->
+
+<!ENTITY % idreq.attrib
+	"id		ID		#REQUIRED">
+
+
+<!-- Lang: Indicator of language in which element is written, for
+	translation, character set management, etc.; no default -->
+
+<!ENTITY % lang.attrib
+	"lang		CDATA		#IMPLIED">
+
+
+<!-- Remap: Previous role of element before conversion; no default -->
+
+<!ENTITY % remap.attrib
+	"remap		CDATA		#IMPLIED">
+
+
+<!-- Role: New role of element in local environment; no default -->
+
+<!ENTITY % role.attrib
+	"role		CDATA		#IMPLIED">
+
+
+<!-- XRefLabel: Alternate labeling string for XRef text generation;
+	default is usually title or other appropriate label text already
+	contained in element -->
+
+<!ENTITY % xreflabel.attrib
+	"xreflabel	CDATA		#IMPLIED">
+
+
+<!-- RevisionFlag: Revision status of element; default is that element
+	wasn't revised -->
+
+<!ENTITY % revisionflag.attrib
+	"revisionflag	(changed
+			|added
+			|deleted
+			|off)		#IMPLIED">
+
+<!ENTITY % local.common.attrib "">
+
+<!-- dir: Bidirectional override -->
+
+<!ENTITY % dir.attrib
+	"dir		(ltr
+			|rtl
+			|lro
+			|rlo)		#IMPLIED">
+
+<!-- xml:base: base URI -->
+
+<![%sgml.features;[
+<!ENTITY % xml-base.attrib "">
+]]>
+<!ENTITY % xml-base.attrib
+	"xml:base	CDATA		#IMPLIED">
+
+<!-- Role is included explicitly on each element -->
+
+<!ENTITY % common.attrib
+	"%id.attrib;
+	%lang.attrib;
+	%remap.attrib;
+	%xreflabel.attrib;
+	%revisionflag.attrib;
+	%effectivity.attrib;
+	%dir.attrib;
+	%xml-base.attrib;
+	%local.common.attrib;"
+>
+
+<!-- Role is included explicitly on each element -->
+
+<!ENTITY % idreq.common.attrib
+	"%idreq.attrib;
+	%lang.attrib;
+	%remap.attrib;
+	%xreflabel.attrib;
+	%revisionflag.attrib;
+	%effectivity.attrib;
+	%dir.attrib;
+	%xml-base.attrib;
+	%local.common.attrib;"
+>
+
+<!-- Semi-common attributes and other attribute entities .................. -->
+
+<!ENTITY % local.graphics.attrib "">
+
+<!-- EntityRef: Name of an external entity containing the content
+	of the graphic -->
+<!-- FileRef: Filename, qualified by a pathname if desired,
+	designating the file containing the content of the graphic -->
+<!-- Format: Notation of the element content, if any -->
+<!-- SrcCredit: Information about the source of the Graphic -->
+<!-- Width: Same as CALS reprowid (desired width) -->
+<!-- Depth: Same as CALS reprodep (desired depth) -->
+<!-- Align: Same as CALS hplace with 'none' removed; #IMPLIED means
+	application-specific -->
+<!-- Scale: Conflation of CALS hscale and vscale -->
+<!-- Scalefit: Same as CALS scalefit -->
+
+<!ENTITY % graphics.attrib
+	"
+	entityref	ENTITY		#IMPLIED
+	fileref 	CDATA		#IMPLIED
+	format		(%notation.class;) #IMPLIED
+	srccredit	CDATA		#IMPLIED
+	width		CDATA		#IMPLIED
+	contentwidth	CDATA		#IMPLIED
+	depth		CDATA		#IMPLIED
+	contentdepth	CDATA		#IMPLIED
+	align		(left
+			|right
+			|center)	#IMPLIED
+	valign		(top
+			|middle
+			|bottom)	#IMPLIED
+	scale		CDATA		#IMPLIED
+	scalefit	%yesorno.attvals;
+					#IMPLIED
+	%local.graphics.attrib;"
+>
+
+<!ENTITY % local.keyaction.attrib "">
+
+<!-- Action: Key combination type; default is unspecified if one
+	child element, Simul if there is more than one; if value is
+	Other, the OtherAction attribute must have a nonempty value -->
+<!-- OtherAction: User-defined key combination type -->
+
+<!ENTITY % keyaction.attrib
+	"
+	action		(click
+			|double-click
+			|press
+			|seq
+			|simul
+			|other)		#IMPLIED
+	otheraction	CDATA		#IMPLIED
+	%local.keyaction.attrib;"
+>
+
+
+<!-- Label: Identifying number or string; default is usually the
+	appropriate number or string autogenerated by a formatter -->
+
+<!ENTITY % label.attrib
+	"label		CDATA		#IMPLIED">
+
+
+<!-- xml:space: whitespace treatment -->
+
+<![%sgml.features;[
+<!ENTITY % xml-space.attrib "">
+]]>
+<!ENTITY % xml-space.attrib
+	"xml:space	(preserve)		#IMPLIED">
+
+<!-- Format: whether element is assumed to contain significant white
+	space -->
+
+<!ENTITY % linespecific.attrib
+	"format		NOTATION
+			(linespecific)	'linespecific'
+         %xml-space.attrib;
+         linenumbering	(numbered|unnumbered) 	#IMPLIED
+         continuation	(continues|restarts)	#IMPLIED
+         startinglinenumber	CDATA		#IMPLIED
+         language	CDATA			#IMPLIED">
+
+<!-- Linkend: link to related information; no default -->
+
+<!ENTITY % linkend.attrib
+	"linkend	IDREF		#IMPLIED">
+
+
+<!-- Linkend: required link to related information -->
+
+<!ENTITY % linkendreq.attrib
+	"linkend	IDREF		#REQUIRED">
+
+
+<!-- Linkends: link to one or more sets of related information; no
+	default -->
+
+<!ENTITY % linkends.attrib
+	"linkends	IDREFS		#IMPLIED">
+
+
+<!ENTITY % local.mark.attrib "">
+<!ENTITY % mark.attrib
+	"mark		CDATA		#IMPLIED
+	%local.mark.attrib;"
+>
+
+
+<!-- MoreInfo: whether element's content has an associated RefEntry -->
+
+<!ENTITY % moreinfo.attrib
+	"moreinfo	(refentry|none)	'none'">
+
+
+<!-- Pagenum: number of page on which element appears; no default -->
+
+<!ENTITY % pagenum.attrib
+	"pagenum	CDATA		#IMPLIED">
+
+<!ENTITY % local.status.attrib "">
+
+<!-- Status: Editorial or publication status of the element
+	it applies to, such as "in review" or "approved for distribution" -->
+
+<!ENTITY % status.attrib
+	"status		CDATA		#IMPLIED
+	%local.status.attrib;"
+>
+
+
+<!-- Width: width of the longest line in the element to which it
+	pertains, in number of characters -->
+
+<!ENTITY % width.attrib
+	"width		CDATA		#IMPLIED">
+
+<!-- ...................................................................... -->
+<!-- Title elements ....................................................... -->
+
+<!ENTITY % title.module "INCLUDE">
+<![%title.module;[
+<!ENTITY % local.title.attrib "">
+<!ENTITY % title.role.attrib "%role.attrib;">
+
+<!ENTITY % title.element "INCLUDE">
+<![%title.element;[
+<!--doc:The text of the title of a section of a document or of a formal block-level element.-->
+<!ELEMENT title %ho; (%title.char.mix;)*>
+<!--end of title.element-->]]>
+
+<!ENTITY % title.attlist "INCLUDE">
+<![%title.attlist;[
+<!ATTLIST title
+		%pagenum.attrib;
+		%common.attrib;
+		%title.role.attrib;
+		%local.title.attrib;
+>
+<!--end of title.attlist-->]]>
+<!--end of title.module-->]]>
+
+<!ENTITY % titleabbrev.module "INCLUDE">
+<![%titleabbrev.module;[
+<!ENTITY % local.titleabbrev.attrib "">
+<!ENTITY % titleabbrev.role.attrib "%role.attrib;">
+
+<!ENTITY % titleabbrev.element "INCLUDE">
+<![%titleabbrev.element;[
+<!--doc:The abbreviation of a Title.-->
+<!ELEMENT titleabbrev %ho; (%title.char.mix;)*>
+<!--end of titleabbrev.element-->]]>
+
+<!ENTITY % titleabbrev.attlist "INCLUDE">
+<![%titleabbrev.attlist;[
+<!ATTLIST titleabbrev
+		%common.attrib;
+		%titleabbrev.role.attrib;
+		%local.titleabbrev.attrib;
+>
+<!--end of titleabbrev.attlist-->]]>
+<!--end of titleabbrev.module-->]]>
+
+<!ENTITY % subtitle.module "INCLUDE">
+<![%subtitle.module;[
+<!ENTITY % local.subtitle.attrib "">
+<!ENTITY % subtitle.role.attrib "%role.attrib;">
+
+<!ENTITY % subtitle.element "INCLUDE">
+<![%subtitle.element;[
+<!--doc:The subtitle of a document.-->
+<!ELEMENT subtitle %ho; (%title.char.mix;)*>
+<!--end of subtitle.element-->]]>
+
+<!ENTITY % subtitle.attlist "INCLUDE">
+<![%subtitle.attlist;[
+<!ATTLIST subtitle
+		%common.attrib;
+		%subtitle.role.attrib;
+		%local.subtitle.attrib;
+>
+<!--end of subtitle.attlist-->]]>
+<!--end of subtitle.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Bibliographic entities and elements .................................. -->
+
+<!-- The bibliographic elements are typically used in the document
+     hierarchy. They do not appear in content models of information
+     pool elements.  See also the document information elements,
+     below. -->
+
+<!ENTITY % local.person.ident.mix "">
+<!ENTITY % person.ident.mix
+		"honorific|firstname|surname|lineage|othername|affiliation
+		|authorblurb|contrib %local.person.ident.mix;">
+
+<!ENTITY % local.bibliocomponent.mix "">
+<!ENTITY % bibliocomponent.mix
+		"abbrev|abstract|address|artpagenums|author
+		|authorgroup|authorinitials|bibliomisc|biblioset
+		|collab|confgroup|contractnum|contractsponsor
+		|copyright|corpauthor|corpname|corpcredit|date|edition
+		|editor|invpartnumber|isbn|issn|issuenum|orgname
+		|biblioid|citebiblioid|bibliosource|bibliorelation|bibliocoverage
+		|othercredit|pagenums|printhistory|productname
+		|productnumber|pubdate|publisher|publishername
+		|pubsnumber|releaseinfo|revhistory|seriesvolnums
+		|subtitle|title|titleabbrev|volumenum|citetitle
+		|personname|%person.ident.mix;
+		|%ndxterm.class;
+		%local.bibliocomponent.mix;">
+
+<!-- I don't think this is well placed, but it needs to be here because of -->
+<!-- the reference to bibliocomponent.mix -->
+<!ENTITY % local.info.class "">
+<!ENTITY % info.class
+		"graphic | mediaobject | legalnotice | modespec
+		 | subjectset | keywordset | itermset | %bibliocomponent.mix;
+                 %local.info.class;">
+
+
+<!-- BiblioList ........................ -->
+
+<!ENTITY % bibliolist.module "INCLUDE">
+<![%bibliolist.module;[
+<!ENTITY % local.bibliolist.attrib "">
+<!ENTITY % bibliolist.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliolist.element "INCLUDE">
+<![%bibliolist.element;[
+<!--doc:A wrapper for a set of bibliography entries.-->
+<!ELEMENT bibliolist %ho; (blockinfo?, (%formalobject.title.content;)?,
+                           (biblioentry|bibliomixed)+)>
+<!--end of bibliolist.element-->]]>
+
+<!ENTITY % bibliolist.attlist "INCLUDE">
+<![%bibliolist.attlist;[
+<!ATTLIST bibliolist
+		%common.attrib;
+		%bibliolist.role.attrib;
+		%local.bibliolist.attrib;
+>
+<!--end of bibliolist.attlist-->]]>
+<!--end of bibliolist.module-->]]>
+
+<!ENTITY % biblioentry.module "INCLUDE">
+<![%biblioentry.module;[
+<!ENTITY % local.biblioentry.attrib "">
+<!ENTITY % biblioentry.role.attrib "%role.attrib;">
+
+<!ENTITY % biblioentry.element "INCLUDE">
+<![%biblioentry.element;[
+<!--doc:An entry in a Bibliography.-->
+<!ELEMENT biblioentry %ho; ((articleinfo | (%bibliocomponent.mix;))+)
+                      %ubiq.exclusion;>
+<!--end of biblioentry.element-->]]>
+
+<!ENTITY % biblioentry.attlist "INCLUDE">
+<![%biblioentry.attlist;[
+<!ATTLIST biblioentry
+		%common.attrib;
+		%biblioentry.role.attrib;
+		%local.biblioentry.attrib;
+>
+<!--end of biblioentry.attlist-->]]>
+<!--end of biblioentry.module-->]]>
+
+<!ENTITY % bibliomixed.module "INCLUDE">
+<![%bibliomixed.module;[
+<!ENTITY % local.bibliomixed.attrib "">
+<!ENTITY % bibliomixed.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliomixed.element "INCLUDE">
+<![%bibliomixed.element;[
+<!--doc:An entry in a Bibliography.-->
+<!ELEMENT bibliomixed %ho; (#PCDATA | %bibliocomponent.mix; | bibliomset)*
+                      %ubiq.exclusion;>
+<!--end of bibliomixed.element-->]]>
+
+<!ENTITY % bibliomixed.attlist "INCLUDE">
+<![%bibliomixed.attlist;[
+<!ATTLIST bibliomixed
+		%common.attrib;
+		%bibliomixed.role.attrib;
+		%local.bibliomixed.attrib;
+>
+<!--end of bibliomixed.attlist-->]]>
+<!--end of bibliomixed.module-->]]>
+
+<!ENTITY % articleinfo.module "INCLUDE">
+<![%articleinfo.module;[
+<!ENTITY % local.articleinfo.attrib "">
+<!ENTITY % articleinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % articleinfo.element "INCLUDE">
+<![%articleinfo.element;[
+<!--doc:Meta-information for an Article.-->
+<!ELEMENT articleinfo %ho; ((%info.class;)+)
+	%beginpage.exclusion;>
+<!--end of articleinfo.element-->]]>
+
+<!ENTITY % articleinfo.attlist "INCLUDE">
+<![%articleinfo.attlist;[
+<!ATTLIST articleinfo
+		%common.attrib;
+		%articleinfo.role.attrib;
+		%local.articleinfo.attrib;
+>
+<!--end of articleinfo.attlist-->]]>
+<!--end of articleinfo.module-->]]>
+
+<!ENTITY % biblioset.module "INCLUDE">
+<![%biblioset.module;[
+<!ENTITY % local.biblioset.attrib "">
+<!ENTITY % biblioset.role.attrib "%role.attrib;">
+
+<!ENTITY % biblioset.element "INCLUDE">
+<![%biblioset.element;[
+<!--doc:A "raw" container for related bibliographic information.-->
+<!ELEMENT biblioset %ho; ((%bibliocomponent.mix;)+)
+                      %ubiq.exclusion;>
+<!--end of biblioset.element-->]]>
+
+<!-- Relation: Relationship of elements contained within BiblioSet -->
+
+
+<!ENTITY % biblioset.attlist "INCLUDE">
+<![%biblioset.attlist;[
+<!ATTLIST biblioset
+		relation	CDATA		#IMPLIED
+		%common.attrib;
+		%biblioset.role.attrib;
+		%local.biblioset.attrib;
+>
+<!--end of biblioset.attlist-->]]>
+<!--end of biblioset.module-->]]>
+
+<!ENTITY % bibliomset.module "INCLUDE">
+<![%bibliomset.module;[
+<!ENTITY % bibliomset.role.attrib "%role.attrib;">
+<!ENTITY % local.bibliomset.attrib "">
+
+<!ENTITY % bibliomset.element "INCLUDE">
+<![%bibliomset.element;[
+<!--doc:A "cooked" container for related bibliographic information.-->
+<!ELEMENT bibliomset %ho; (#PCDATA | %bibliocomponent.mix; | bibliomset)*
+                      %ubiq.exclusion;>
+<!--end of bibliomset.element-->]]>
+
+<!-- Relation: Relationship of elements contained within BiblioMSet -->
+
+
+<!ENTITY % bibliomset.attlist "INCLUDE">
+<![%bibliomset.attlist;[
+<!ATTLIST bibliomset
+		relation	CDATA		#IMPLIED
+		%common.attrib;
+		%bibliomset.role.attrib;
+		%local.bibliomset.attrib;
+>
+<!--end of bibliomset.attlist-->]]>
+<!--end of bibliomset.module-->]]>
+
+<!ENTITY % bibliomisc.module "INCLUDE">
+<![%bibliomisc.module;[
+<!ENTITY % local.bibliomisc.attrib "">
+<!ENTITY % bibliomisc.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliomisc.element "INCLUDE">
+<![%bibliomisc.element;[
+<!--doc:Untyped bibliographic information.-->
+<!ELEMENT bibliomisc %ho; (%para.char.mix;)*>
+<!--end of bibliomisc.element-->]]>
+
+<!ENTITY % bibliomisc.attlist "INCLUDE">
+<![%bibliomisc.attlist;[
+<!ATTLIST bibliomisc
+		%common.attrib;
+		%bibliomisc.role.attrib;
+		%local.bibliomisc.attrib;
+>
+<!--end of bibliomisc.attlist-->]]>
+<!--end of bibliomisc.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Subject, Keyword, and ITermSet elements .............................. -->
+
+<!ENTITY % subjectset.content.module "INCLUDE">
+<![%subjectset.content.module;[
+<!ENTITY % subjectset.module "INCLUDE">
+<![%subjectset.module;[
+<!ENTITY % local.subjectset.attrib "">
+<!ENTITY % subjectset.role.attrib "%role.attrib;">
+
+<!ENTITY % subjectset.element "INCLUDE">
+<![%subjectset.element;[
+<!--doc:A set of terms describing the subject matter of a document.-->
+<!ELEMENT subjectset %ho; (subject+)>
+<!--end of subjectset.element-->]]>
+
+<!-- Scheme: Controlled vocabulary employed in SubjectTerms -->
+
+
+<!ENTITY % subjectset.attlist "INCLUDE">
+<![%subjectset.attlist;[
+<!ATTLIST subjectset
+		scheme		NMTOKEN		#IMPLIED
+		%common.attrib;
+		%subjectset.role.attrib;
+		%local.subjectset.attrib;
+>
+<!--end of subjectset.attlist-->]]>
+<!--end of subjectset.module-->]]>
+
+<!ENTITY % subject.module "INCLUDE">
+<![%subject.module;[
+<!ENTITY % local.subject.attrib "">
+<!ENTITY % subject.role.attrib "%role.attrib;">
+
+<!ENTITY % subject.element "INCLUDE">
+<![%subject.element;[
+<!--doc:One of a group of terms describing the subject matter of a document.-->
+<!ELEMENT subject %ho; (subjectterm+)>
+<!--end of subject.element-->]]>
+
+<!-- Weight: Ranking of this group of SubjectTerms relative
+		to others, 0 is low, no highest value specified -->
+
+
+<!ENTITY % subject.attlist "INCLUDE">
+<![%subject.attlist;[
+<!ATTLIST subject
+		weight		CDATA		#IMPLIED
+		%common.attrib;
+		%subject.role.attrib;
+		%local.subject.attrib;
+>
+<!--end of subject.attlist-->]]>
+<!--end of subject.module-->]]>
+
+<!ENTITY % subjectterm.module "INCLUDE">
+<![%subjectterm.module;[
+<!ENTITY % local.subjectterm.attrib "">
+<!ENTITY % subjectterm.role.attrib "%role.attrib;">
+
+<!ENTITY % subjectterm.element "INCLUDE">
+<![%subjectterm.element;[
+<!--doc:A term in a group of terms describing the subject matter of a document.-->
+<!ELEMENT subjectterm %ho; (#PCDATA)>
+<!--end of subjectterm.element-->]]>
+
+<!ENTITY % subjectterm.attlist "INCLUDE">
+<![%subjectterm.attlist;[
+<!ATTLIST subjectterm
+		%common.attrib;
+		%subjectterm.role.attrib;
+		%local.subjectterm.attrib;
+>
+<!--end of subjectterm.attlist-->]]>
+<!--end of subjectterm.module-->]]>
+<!--end of subjectset.content.module-->]]>
+
+<!ENTITY % keywordset.content.module "INCLUDE">
+<![%keywordset.content.module;[
+<!ENTITY % keywordset.module "INCLUDE">
+<![%keywordset.module;[
+<!ENTITY % local.keywordset.attrib "">
+<!ENTITY % keywordset.role.attrib "%role.attrib;">
+
+<!ENTITY % keywordset.element "INCLUDE">
+<![%keywordset.element;[
+<!--doc:A set of keywords describing the content of a document.-->
+<!ELEMENT keywordset %ho; (keyword+)>
+<!--end of keywordset.element-->]]>
+
+<!ENTITY % keywordset.attlist "INCLUDE">
+<![%keywordset.attlist;[
+<!ATTLIST keywordset
+		%common.attrib;
+		%keywordset.role.attrib;
+		%local.keywordset.attrib;
+>
+<!--end of keywordset.attlist-->]]>
+<!--end of keywordset.module-->]]>
+
+<!ENTITY % keyword.module "INCLUDE">
+<![%keyword.module;[
+<!ENTITY % local.keyword.attrib "">
+<!ENTITY % keyword.role.attrib "%role.attrib;">
+
+<!ENTITY % keyword.element "INCLUDE">
+<![%keyword.element;[
+<!--doc:One of a set of keywords describing the content of a document.-->
+<!ELEMENT keyword %ho; (#PCDATA)>
+<!--end of keyword.element-->]]>
+
+<!ENTITY % keyword.attlist "INCLUDE">
+<![%keyword.attlist;[
+<!ATTLIST keyword
+		%common.attrib;
+		%keyword.role.attrib;
+		%local.keyword.attrib;
+>
+<!--end of keyword.attlist-->]]>
+<!--end of keyword.module-->]]>
+<!--end of keywordset.content.module-->]]>
+
+<!ENTITY % itermset.module "INCLUDE">
+<![%itermset.module;[
+<!ENTITY % local.itermset.attrib "">
+<!ENTITY % itermset.role.attrib "%role.attrib;">
+
+<!ENTITY % itermset.element "INCLUDE">
+<![%itermset.element;[
+<!--doc:A set of index terms in the meta-information of a document.-->
+<!ELEMENT itermset %ho; (indexterm+)>
+<!--end of itermset.element-->]]>
+
+<!ENTITY % itermset.attlist "INCLUDE">
+<![%itermset.attlist;[
+<!ATTLIST itermset
+		%common.attrib;
+		%itermset.role.attrib;
+		%local.itermset.attrib;
+>
+<!--end of itermset.attlist-->]]>
+<!--end of itermset.module-->]]>
+
+<!-- Bibliographic info for "blocks" -->
+
+<!ENTITY % blockinfo.module "INCLUDE">
+<![ %blockinfo.module; [
+<!ENTITY % local.blockinfo.attrib "">
+<!ENTITY % blockinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % blockinfo.element "INCLUDE">
+<![ %blockinfo.element; [
+<!--doc:Meta-information for a block element.-->
+<!ELEMENT blockinfo %ho; ((%info.class;)+)
+	%beginpage.exclusion;>
+<!--end of blockinfo.element-->]]>
+
+<!ENTITY % blockinfo.attlist "INCLUDE">
+<![ %blockinfo.attlist; [
+<!ATTLIST blockinfo
+		%common.attrib;
+		%blockinfo.role.attrib;
+		%local.blockinfo.attrib;
+>
+<!--end of blockinfo.attlist-->]]>
+<!--end of blockinfo.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Compound (section-ish) elements ...................................... -->
+
+<!-- Message set ...................... -->
+
+<!ENTITY % msgset.content.module "INCLUDE">
+<![%msgset.content.module;[
+<!ENTITY % msgset.module "INCLUDE">
+<![%msgset.module;[
+<!ENTITY % local.msgset.attrib "">
+<!ENTITY % msgset.role.attrib "%role.attrib;">
+
+<!ENTITY % msgset.element "INCLUDE">
+<![%msgset.element;[
+<!--doc:A detailed set of messages, usually error messages.-->
+<!ELEMENT msgset %ho; (blockinfo?, (%formalobject.title.content;)?,
+                       (msgentry+|simplemsgentry+))>
+<!--end of msgset.element-->]]>
+
+<!ENTITY % msgset.attlist "INCLUDE">
+<![%msgset.attlist;[
+<!ATTLIST msgset
+		%common.attrib;
+		%msgset.role.attrib;
+		%local.msgset.attrib;
+>
+<!--end of msgset.attlist-->]]>
+<!--end of msgset.module-->]]>
+
+<!ENTITY % msgentry.module "INCLUDE">
+<![%msgentry.module;[
+<!ENTITY % local.msgentry.attrib "">
+<!ENTITY % msgentry.role.attrib "%role.attrib;">
+
+<!ENTITY % msgentry.element "INCLUDE">
+<![%msgentry.element;[
+<!--doc:A wrapper for an entry in a message set.-->
+<!ELEMENT msgentry %ho; (msg+, msginfo?, msgexplan*)>
+<!--end of msgentry.element-->]]>
+
+<!ENTITY % msgentry.attlist "INCLUDE">
+<![%msgentry.attlist;[
+<!ATTLIST msgentry
+		%common.attrib;
+		%msgentry.role.attrib;
+		%local.msgentry.attrib;
+>
+<!--end of msgentry.attlist-->]]>
+<!--end of msgentry.module-->]]>
+
+<!ENTITY % simplemsgentry.module "INCLUDE">
+<![ %simplemsgentry.module; [
+<!ENTITY % local.simplemsgentry.attrib "">
+<!ENTITY % simplemsgentry.role.attrib "%role.attrib;">
+
+<!ENTITY % simplemsgentry.element "INCLUDE">
+<![ %simplemsgentry.element; [
+<!--doc:A wrapper for a simpler entry in a message set.-->
+<!ELEMENT simplemsgentry %ho; (msgtext, msgexplan+)>
+<!--end of simplemsgentry.element-->]]>
+
+<!ENTITY % simplemsgentry.attlist "INCLUDE">
+<![ %simplemsgentry.attlist; [
+<!ATTLIST simplemsgentry
+		audience	CDATA	#IMPLIED
+		level		CDATA	#IMPLIED
+		origin		CDATA	#IMPLIED
+		%common.attrib;
+		%simplemsgentry.role.attrib;
+		%local.simplemsgentry.attrib;
+>
+<!--end of simplemsgentry.attlist-->]]>
+<!--end of simplemsgentry.module-->]]>
+
+<!ENTITY % msg.module "INCLUDE">
+<![%msg.module;[
+<!ENTITY % local.msg.attrib "">
+<!ENTITY % msg.role.attrib "%role.attrib;">
+
+<!ENTITY % msg.element "INCLUDE">
+<![%msg.element;[
+<!--doc:A message in a message set.-->
+<!ELEMENT msg %ho; (title?, msgmain, (msgsub | msgrel)*)>
+<!--end of msg.element-->]]>
+
+<!ENTITY % msg.attlist "INCLUDE">
+<![%msg.attlist;[
+<!ATTLIST msg
+		%common.attrib;
+		%msg.role.attrib;
+		%local.msg.attrib;
+>
+<!--end of msg.attlist-->]]>
+<!--end of msg.module-->]]>
+
+<!ENTITY % msgmain.module "INCLUDE">
+<![%msgmain.module;[
+<!ENTITY % local.msgmain.attrib "">
+<!ENTITY % msgmain.role.attrib "%role.attrib;">
+
+<!ENTITY % msgmain.element "INCLUDE">
+<![%msgmain.element;[
+<!--doc:The primary component of a message in a message set.-->
+<!ELEMENT msgmain %ho; (title?, msgtext)>
+<!--end of msgmain.element-->]]>
+
+<!ENTITY % msgmain.attlist "INCLUDE">
+<![%msgmain.attlist;[
+<!ATTLIST msgmain
+		%common.attrib;
+		%msgmain.role.attrib;
+		%local.msgmain.attrib;
+>
+<!--end of msgmain.attlist-->]]>
+<!--end of msgmain.module-->]]>
+
+<!ENTITY % msgsub.module "INCLUDE">
+<![%msgsub.module;[
+<!ENTITY % local.msgsub.attrib "">
+<!ENTITY % msgsub.role.attrib "%role.attrib;">
+
+<!ENTITY % msgsub.element "INCLUDE">
+<![%msgsub.element;[
+<!--doc:A subcomponent of a message in a message set.-->
+<!ELEMENT msgsub %ho; (title?, msgtext)>
+<!--end of msgsub.element-->]]>
+
+<!ENTITY % msgsub.attlist "INCLUDE">
+<![%msgsub.attlist;[
+<!ATTLIST msgsub
+		%common.attrib;
+		%msgsub.role.attrib;
+		%local.msgsub.attrib;
+>
+<!--end of msgsub.attlist-->]]>
+<!--end of msgsub.module-->]]>
+
+<!ENTITY % msgrel.module "INCLUDE">
+<![%msgrel.module;[
+<!ENTITY % local.msgrel.attrib "">
+<!ENTITY % msgrel.role.attrib "%role.attrib;">
+
+<!ENTITY % msgrel.element "INCLUDE">
+<![%msgrel.element;[
+<!--doc:A related component of a message in a message set.-->
+<!ELEMENT msgrel %ho; (title?, msgtext)>
+<!--end of msgrel.element-->]]>
+
+<!ENTITY % msgrel.attlist "INCLUDE">
+<![%msgrel.attlist;[
+<!ATTLIST msgrel
+		%common.attrib;
+		%msgrel.role.attrib;
+		%local.msgrel.attrib;
+>
+<!--end of msgrel.attlist-->]]>
+<!--end of msgrel.module-->]]>
+
+<!-- MsgText (defined in the Inlines section, below)-->
+
+<!ENTITY % msginfo.module "INCLUDE">
+<![%msginfo.module;[
+<!ENTITY % local.msginfo.attrib "">
+<!ENTITY % msginfo.role.attrib "%role.attrib;">
+
+<!ENTITY % msginfo.element "INCLUDE">
+<![%msginfo.element;[
+<!--doc:Information about a message in a message set.-->
+<!ELEMENT msginfo %ho; ((msglevel | msgorig | msgaud)*)>
+<!--end of msginfo.element-->]]>
+
+<!ENTITY % msginfo.attlist "INCLUDE">
+<![%msginfo.attlist;[
+<!ATTLIST msginfo
+		%common.attrib;
+		%msginfo.role.attrib;
+		%local.msginfo.attrib;
+>
+<!--end of msginfo.attlist-->]]>
+<!--end of msginfo.module-->]]>
+
+<!ENTITY % msglevel.module "INCLUDE">
+<![%msglevel.module;[
+<!ENTITY % local.msglevel.attrib "">
+<!ENTITY % msglevel.role.attrib "%role.attrib;">
+
+<!ENTITY % msglevel.element "INCLUDE">
+<![%msglevel.element;[
+<!--doc:The level of importance or severity of a message in a message set.-->
+<!ELEMENT msglevel %ho; (%smallcptr.char.mix;)*>
+<!--end of msglevel.element-->]]>
+
+<!ENTITY % msglevel.attlist "INCLUDE">
+<![%msglevel.attlist;[
+<!ATTLIST msglevel
+		%common.attrib;
+		%msglevel.role.attrib;
+		%local.msglevel.attrib;
+>
+<!--end of msglevel.attlist-->]]>
+<!--end of msglevel.module-->]]>
+
+<!ENTITY % msgorig.module "INCLUDE">
+<![%msgorig.module;[
+<!ENTITY % local.msgorig.attrib "">
+<!ENTITY % msgorig.role.attrib "%role.attrib;">
+
+<!ENTITY % msgorig.element "INCLUDE">
+<![%msgorig.element;[
+<!--doc:The origin of a message in a message set.-->
+<!ELEMENT msgorig %ho; (%smallcptr.char.mix;)*>
+<!--end of msgorig.element-->]]>
+
+<!ENTITY % msgorig.attlist "INCLUDE">
+<![%msgorig.attlist;[
+<!ATTLIST msgorig
+		%common.attrib;
+		%msgorig.role.attrib;
+		%local.msgorig.attrib;
+>
+<!--end of msgorig.attlist-->]]>
+<!--end of msgorig.module-->]]>
+
+<!ENTITY % msgaud.module "INCLUDE">
+<![%msgaud.module;[
+<!ENTITY % local.msgaud.attrib "">
+<!ENTITY % msgaud.role.attrib "%role.attrib;">
+
+<!ENTITY % msgaud.element "INCLUDE">
+<![%msgaud.element;[
+<!--doc:The audience to which a message in a message set is relevant.-->
+<!ELEMENT msgaud %ho; (%para.char.mix;)*>
+<!--end of msgaud.element-->]]>
+
+<!ENTITY % msgaud.attlist "INCLUDE">
+<![%msgaud.attlist;[
+<!ATTLIST msgaud
+		%common.attrib;
+		%msgaud.role.attrib;
+		%local.msgaud.attrib;
+>
+<!--end of msgaud.attlist-->]]>
+<!--end of msgaud.module-->]]>
+
+<!ENTITY % msgexplan.module "INCLUDE">
+<![%msgexplan.module;[
+<!ENTITY % local.msgexplan.attrib "">
+<!ENTITY % msgexplan.role.attrib "%role.attrib;">
+
+<!ENTITY % msgexplan.element "INCLUDE">
+<![%msgexplan.element;[
+<!--doc:Explanatory material relating to a message in a message set.-->
+<!ELEMENT msgexplan %ho; (title?, (%component.mix;)+)>
+<!--end of msgexplan.element-->]]>
+
+<!ENTITY % msgexplan.attlist "INCLUDE">
+<![%msgexplan.attlist;[
+<!ATTLIST msgexplan
+		%common.attrib;
+		%msgexplan.role.attrib;
+		%local.msgexplan.attrib;
+>
+<!--end of msgexplan.attlist-->]]>
+<!--end of msgexplan.module-->]]>
+<!--end of msgset.content.module-->]]>
+
+<!ENTITY % task.content.module "INCLUDE">
+<![%task.content.module;[
+<!ENTITY % task.module "INCLUDE">
+<![%task.module;[
+<!ENTITY % local.task.attrib "">
+<!ENTITY % task.role.attrib "%role.attrib;">
+
+<!ENTITY % task.element "INCLUDE">
+<![%task.element;[
+<!--doc:A task to be completed.-->
+<!ELEMENT task %ho; (blockinfo?,(%ndxterm.class;)*,
+                     (%formalobject.title.content;),
+                     tasksummary?,
+                     taskprerequisites?,
+                     procedure,
+                     example*,
+                     taskrelated?)>
+<!--end of task.element-->]]>
+
+<!ENTITY % task.attlist "INCLUDE">
+<![%task.attlist;[
+<!ATTLIST task
+		%common.attrib;
+		%task.role.attrib;
+		%local.task.attrib;
+>
+<!--end of task.attlist-->]]>
+<!--end of task.module-->]]>
+
+<!ENTITY % tasksummary.module "INCLUDE">
+<![%tasksummary.module;[
+<!ENTITY % local.tasksummary.attrib "">
+<!ENTITY % tasksummary.role.attrib "%role.attrib;">
+
+<!ENTITY % tasksummary.element "INCLUDE">
+<![%tasksummary.element;[
+<!--doc:A summary of a task.-->
+<!ELEMENT tasksummary %ho; (blockinfo?,
+                            (%formalobject.title.content;)?,
+                            (%component.mix;)+)>
+<!--end of tasksummary.element-->]]>
+
+<!ENTITY % tasksummary.attlist "INCLUDE">
+<![%tasksummary.attlist;[
+<!ATTLIST tasksummary
+		%common.attrib;
+		%tasksummary.role.attrib;
+		%local.tasksummary.attrib;
+>
+<!--end of tasksummary.attlist-->]]>
+<!--end of tasksummary.module-->]]>
+
+<!ENTITY % taskprerequisites.module "INCLUDE">
+<![%taskprerequisites.module;[
+<!ENTITY % local.taskprerequisites.attrib "">
+<!ENTITY % taskprerequisites.role.attrib "%role.attrib;">
+
+<!ENTITY % taskprerequisites.element "INCLUDE">
+<![%taskprerequisites.element;[
+<!--doc:The prerequisites for a task.-->
+<!ELEMENT taskprerequisites %ho; (blockinfo?,
+                                  (%formalobject.title.content;)?,
+                                  (%component.mix;)+)>
+<!--end of taskprerequisites.element-->]]>
+
+<!ENTITY % taskprerequisites.attlist "INCLUDE">
+<![%taskprerequisites.attlist;[
+<!ATTLIST taskprerequisites
+		%common.attrib;
+		%taskprerequisites.role.attrib;
+		%local.taskprerequisites.attrib;
+>
+<!--end of taskprerequisites.attlist-->]]>
+<!--end of taskprerequisites.module-->]]>
+
+<!ENTITY % taskrelated.module "INCLUDE">
+<![%taskrelated.module;[
+<!ENTITY % local.taskrelated.attrib "">
+<!ENTITY % taskrelated.role.attrib "%role.attrib;">
+
+<!ENTITY % taskrelated.element "INCLUDE">
+<![%taskrelated.element;[
+<!--doc:Information related to a task.-->
+<!ELEMENT taskrelated %ho; (blockinfo?,
+                            (%formalobject.title.content;)?,
+                            (%component.mix;)+)>
+<!--end of taskrelated.element-->]]>
+
+<!ENTITY % taskrelated.attlist "INCLUDE">
+<![%taskrelated.attlist;[
+<!ATTLIST taskrelated
+		%common.attrib;
+		%taskrelated.role.attrib;
+		%local.taskrelated.attrib;
+>
+<!--end of taskrelated.attlist-->]]>
+<!--end of taskrelated.module-->]]>
+<!--end of task.content.module-->]]>
+
+<!-- QandASet ........................ -->
+<!ENTITY % qandaset.content.module "INCLUDE">
+<![ %qandaset.content.module; [
+<!ENTITY % qandaset.module "INCLUDE">
+<![ %qandaset.module; [
+<!ENTITY % local.qandaset.attrib "">
+<!ENTITY % qandaset.role.attrib "%role.attrib;">
+
+<!ENTITY % qandaset.element "INCLUDE">
+<![ %qandaset.element; [
+<!--doc:A question-and-answer set.-->
+<!ELEMENT qandaset %ho; (blockinfo?, (%formalobject.title.content;)?,
+			(%qandaset.mix;)*,
+                        (qandadiv+|qandaentry+))>
+<!--end of qandaset.element-->]]>
+
+<!ENTITY % qandaset.attlist "INCLUDE">
+<![ %qandaset.attlist; [
+<!ATTLIST qandaset
+		defaultlabel	(qanda|number|none)       #IMPLIED
+		%common.attrib;
+		%qandaset.role.attrib;
+		%local.qandaset.attrib;>
+<!--end of qandaset.attlist-->]]>
+<!--end of qandaset.module-->]]>
+
+<!ENTITY % qandadiv.module "INCLUDE">
+<![ %qandadiv.module; [
+<!ENTITY % local.qandadiv.attrib "">
+<!ENTITY % qandadiv.role.attrib "%role.attrib;">
+
+<!ENTITY % qandadiv.element "INCLUDE">
+<![ %qandadiv.element; [
+<!--doc:A titled division in a QandASet.-->
+<!ELEMENT qandadiv %ho; (blockinfo?, (%formalobject.title.content;)?,
+			(%qandaset.mix;)*,
+			(qandadiv+|qandaentry+))>
+<!--end of qandadiv.element-->]]>
+
+<!ENTITY % qandadiv.attlist "INCLUDE">
+<![ %qandadiv.attlist; [
+<!ATTLIST qandadiv
+		%common.attrib;
+		%qandadiv.role.attrib;
+		%local.qandadiv.attrib;>
+<!--end of qandadiv.attlist-->]]>
+<!--end of qandadiv.module-->]]>
+
+<!ENTITY % qandaentry.module "INCLUDE">
+<![ %qandaentry.module; [
+<!ENTITY % local.qandaentry.attrib "">
+<!ENTITY % qandaentry.role.attrib "%role.attrib;">
+
+<!ENTITY % qandaentry.element "INCLUDE">
+<![ %qandaentry.element; [
+<!--doc:A question/answer set within a QandASet.-->
+<!ELEMENT qandaentry %ho; (blockinfo?, revhistory?, question, answer*)>
+<!--end of qandaentry.element-->]]>
+
+<!ENTITY % qandaentry.attlist "INCLUDE">
+<![ %qandaentry.attlist; [
+<!ATTLIST qandaentry
+		%common.attrib;
+		%qandaentry.role.attrib;
+		%local.qandaentry.attrib;>
+<!--end of qandaentry.attlist-->]]>
+<!--end of qandaentry.module-->]]>
+
+<!ENTITY % question.module "INCLUDE">
+<![ %question.module; [
+<!ENTITY % local.question.attrib "">
+<!ENTITY % question.role.attrib "%role.attrib;">
+
+<!ENTITY % question.element "INCLUDE">
+<![ %question.element; [
+<!--doc:A question in a QandASet.-->
+<!ELEMENT question %ho; (label?, (%qandaset.mix;)+)>
+<!--end of question.element-->]]>
+
+<!ENTITY % question.attlist "INCLUDE">
+<![ %question.attlist; [
+<!ATTLIST question
+		%common.attrib;
+		%question.role.attrib;
+		%local.question.attrib;
+>
+<!--end of question.attlist-->]]>
+<!--end of question.module-->]]>
+
+<!ENTITY % answer.module "INCLUDE">
+<![ %answer.module; [
+<!ENTITY % local.answer.attrib "">
+<!ENTITY % answer.role.attrib "%role.attrib;">
+
+<!ENTITY % answer.element "INCLUDE">
+<![ %answer.element; [
+<!--doc:An answer to a question posed in a QandASet.-->
+<!ELEMENT answer %ho; (label?, (%qandaset.mix;)*, qandaentry*)>
+<!--end of answer.element-->]]>
+
+<!ENTITY % answer.attlist "INCLUDE">
+<![ %answer.attlist; [
+<!ATTLIST answer
+		%common.attrib;
+		%answer.role.attrib;
+		%local.answer.attrib;
+>
+<!--end of answer.attlist-->]]>
+<!--end of answer.module-->]]>
+
+<!ENTITY % label.module "INCLUDE">
+<![ %label.module; [
+<!ENTITY % local.label.attrib "">
+<!ENTITY % label.role.attrib "%role.attrib;">
+
+<!ENTITY % label.element "INCLUDE">
+<![ %label.element; [
+<!--doc:A label on a Question or Answer.-->
+<!ELEMENT label %ho; (%word.char.mix;)*>
+<!--end of label.element-->]]>
+
+<!ENTITY % label.attlist "INCLUDE">
+<![ %label.attlist; [
+<!ATTLIST label
+		%common.attrib;
+		%label.role.attrib;
+		%local.label.attrib;
+>
+<!--end of label.attlist-->]]>
+<!--end of label.module-->]]>
+<!--end of qandaset.content.module-->]]>
+
+<!-- Procedure ........................ -->
+
+<!ENTITY % procedure.content.module "INCLUDE">
+<![%procedure.content.module;[
+<!ENTITY % procedure.module "INCLUDE">
+<![%procedure.module;[
+<!ENTITY % local.procedure.attrib "">
+<!ENTITY % procedure.role.attrib "%role.attrib;">
+
+<!ENTITY % procedure.element "INCLUDE">
+<![%procedure.element;[
+<!--doc:A list of operations to be performed in a well-defined sequence.-->
+<!ELEMENT procedure %ho; (blockinfo?, (%formalobject.title.content;)?,
+                          (%component.mix;)*, step+)>
+<!--end of procedure.element-->]]>
+
+<!ENTITY % procedure.attlist "INCLUDE">
+<![%procedure.attlist;[
+<!ATTLIST procedure
+		%common.attrib;
+		%procedure.role.attrib;
+		%local.procedure.attrib;
+>
+<!--end of procedure.attlist-->]]>
+<!--end of procedure.module-->]]>
+
+<!ENTITY % step.module "INCLUDE">
+<![%step.module;[
+<!ENTITY % local.step.attrib "">
+<!ENTITY % step.role.attrib "%role.attrib;">
+
+<!ENTITY % step.element "INCLUDE">
+<![%step.element;[
+<!--doc:A unit of action in a procedure.-->
+<!ELEMENT step %ho; (title?, (((%component.mix;)+, ((substeps|stepalternatives), (%component.mix;)*)?)
+                    | ((substeps|stepalternatives), (%component.mix;)*)))>
+<!--end of step.element-->]]>
+
+<!-- Performance: Whether the Step must be performed -->
+<!-- not #REQUIRED! -->
+
+
+<!ENTITY % step.attlist "INCLUDE">
+<![%step.attlist;[
+<!ATTLIST step
+		performance	(optional
+				|required)	"required"
+		%common.attrib;
+		%step.role.attrib;
+		%local.step.attrib;
+>
+<!--end of step.attlist-->]]>
+<!--end of step.module-->]]>
+
+<!ENTITY % substeps.module "INCLUDE">
+<![%substeps.module;[
+<!ENTITY % local.substeps.attrib "">
+<!ENTITY % substeps.role.attrib "%role.attrib;">
+
+<!ENTITY % substeps.element "INCLUDE">
+<![%substeps.element;[
+<!--doc:A wrapper for steps that occur within steps in a procedure.-->
+<!ELEMENT substeps %ho; (step+)>
+<!--end of substeps.element-->]]>
+
+<!-- Performance: whether entire set of substeps must be performed -->
+<!-- not #REQUIRED! -->
+
+<!ENTITY % substeps.attlist "INCLUDE">
+<![%substeps.attlist;[
+<!ATTLIST substeps
+		performance	(optional
+				|required)	"required"
+		%common.attrib;
+		%substeps.role.attrib;
+		%local.substeps.attrib;
+>
+<!--end of substeps.attlist-->]]>
+<!--end of substeps.module-->]]>
+
+<!ENTITY % stepalternatives.module "INCLUDE">
+<![%stepalternatives.module;[
+<!ENTITY % local.stepalternatives.attrib "">
+<!ENTITY % stepalternatives.role.attrib "%role.attrib;">
+
+<!ENTITY % stepalternatives.element "INCLUDE">
+<![%stepalternatives.element;[
+<!--doc:Alternative steps in a procedure.-->
+<!ELEMENT stepalternatives %ho; (step+)>
+<!--end of stepalternatives.element-->]]>
+
+<!-- Performance: Whether (one of) the alternatives must be performed -->
+<!-- not #REQUIRED! -->
+
+<!ENTITY % stepalternatives.attlist "INCLUDE">
+<![%stepalternatives.attlist;[
+<!ATTLIST stepalternatives
+		performance	(optional
+				|required)	"required"
+		%common.attrib;
+		%stepalternatives.role.attrib;
+		%local.stepalternatives.attrib;
+>
+<!--end of stepalternatives.attlist-->]]>
+<!--end of stepalternatives.module-->]]>
+<!--end of procedure.content.module-->]]>
+
+<!-- Sidebar .......................... -->
+
+<!ENTITY % sidebar.content.model "INCLUDE">
+<![ %sidebar.content.model; [
+
+<!ENTITY % sidebarinfo.module "INCLUDE">
+<![ %sidebarinfo.module; [
+<!ENTITY % local.sidebarinfo.attrib "">
+<!ENTITY % sidebarinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % sidebarinfo.element "INCLUDE">
+<![ %sidebarinfo.element; [
+<!--doc:Meta-information for a Sidebar.-->
+<!ELEMENT sidebarinfo %ho; ((%info.class;)+)
+	%beginpage.exclusion;>
+<!--end of sidebarinfo.element-->]]>
+
+<!ENTITY % sidebarinfo.attlist "INCLUDE">
+<![ %sidebarinfo.attlist; [
+<!ATTLIST sidebarinfo
+		%common.attrib;
+		%sidebarinfo.role.attrib;
+		%local.sidebarinfo.attrib;
+>
+<!--end of sidebarinfo.attlist-->]]>
+<!--end of sidebarinfo.module-->]]>
+
+<!ENTITY % sidebar.module "INCLUDE">
+<![%sidebar.module;[
+<!ENTITY % local.sidebar.attrib "">
+<!ENTITY % sidebar.role.attrib "%role.attrib;">
+
+<!ENTITY % sidebar.element "INCLUDE">
+<![%sidebar.element;[
+<!--doc:A portion of a document that is isolated from the main narrative flow.-->
+<!ELEMENT sidebar %ho; (sidebarinfo?,
+                   (%formalobject.title.content;)?,
+                   (%sidebar.mix;)+)>
+<!--end of sidebar.element-->]]>
+
+<!ENTITY % sidebar.attlist "INCLUDE">
+<![%sidebar.attlist;[
+<!ATTLIST sidebar
+		%common.attrib;
+		%sidebar.role.attrib;
+		%local.sidebar.attrib;
+>
+<!--end of sidebar.attlist-->]]>
+<!--end of sidebar.module-->]]>
+<!--end of sidebar.content.model-->]]>
+
+<!-- ...................................................................... -->
+<!-- Paragraph-related elements ........................................... -->
+
+<!ENTITY % abstract.module "INCLUDE">
+<![%abstract.module;[
+<!ENTITY % local.abstract.attrib "">
+<!ENTITY % abstract.role.attrib "%role.attrib;">
+
+<!ENTITY % abstract.element "INCLUDE">
+<![%abstract.element;[
+<!--doc:A summary.-->
+<!ELEMENT abstract %ho; (title?, (%para.class;)+)>
+<!--end of abstract.element-->]]>
+
+<!ENTITY % abstract.attlist "INCLUDE">
+<![%abstract.attlist;[
+<!ATTLIST abstract
+		%common.attrib;
+		%abstract.role.attrib;
+		%local.abstract.attrib;
+>
+<!--end of abstract.attlist-->]]>
+<!--end of abstract.module-->]]>
+
+<!ENTITY % authorblurb.module "INCLUDE">
+<![%authorblurb.module;[
+<!ENTITY % local.authorblurb.attrib "">
+<!ENTITY % authorblurb.role.attrib "%role.attrib;">
+
+<!ENTITY % authorblurb.element "INCLUDE">
+<![%authorblurb.element;[
+<!--doc:A short description or note about an author.-->
+<!ELEMENT authorblurb %ho; (title?, (%para.class;)+)>
+<!--end of authorblurb.element-->]]>
+
+<!ENTITY % authorblurb.attlist "INCLUDE">
+<![%authorblurb.attlist;[
+<!ATTLIST authorblurb
+		%common.attrib;
+		%authorblurb.role.attrib;
+		%local.authorblurb.attrib;
+>
+<!--end of authorblurb.attlist-->]]>
+<!--end of authorblurb.module-->]]>
+
+<!ENTITY % personblurb.module "INCLUDE">
+<![%personblurb.module;[
+<!ENTITY % local.personblurb.attrib "">
+<!ENTITY % personblurb.role.attrib "%role.attrib;">
+
+<!ENTITY % personblurb.element "INCLUDE">
+<![%personblurb.element;[
+<!--doc:A short description or note about a person.-->
+<!ELEMENT personblurb %ho; (title?, (%para.class;)+)>
+<!--end of personblurb.element-->]]>
+
+<!ENTITY % personblurb.attlist "INCLUDE">
+<![%personblurb.attlist;[
+<!ATTLIST personblurb
+		%common.attrib;
+		%personblurb.role.attrib;
+		%local.personblurb.attrib;
+>
+<!--end of personblurb.attlist-->]]>
+<!--end of personblurb.module-->]]>
+
+<!ENTITY % blockquote.module "INCLUDE">
+<![%blockquote.module;[
+
+<!ENTITY % local.blockquote.attrib "">
+<!ENTITY % blockquote.role.attrib "%role.attrib;">
+
+<!ENTITY % blockquote.element "INCLUDE">
+<![%blockquote.element;[
+<!--doc:A quotation set off from the main text.-->
+<!ELEMENT blockquote %ho; (blockinfo?, title?, attribution?, (%component.mix;)+)
+                      %blockquote.exclusion;>
+<!--end of blockquote.element-->]]>
+
+<!ENTITY % blockquote.attlist "INCLUDE">
+<![%blockquote.attlist;[
+<!ATTLIST blockquote
+		%common.attrib;
+		%blockquote.role.attrib;
+		%local.blockquote.attrib;
+>
+<!--end of blockquote.attlist-->]]>
+<!--end of blockquote.module-->]]>
+
+<!ENTITY % attribution.module "INCLUDE">
+<![%attribution.module;[
+<!ENTITY % local.attribution.attrib "">
+<!ENTITY % attribution.role.attrib "%role.attrib;">
+
+<!ENTITY % attribution.element "INCLUDE">
+<![%attribution.element;[
+<!--doc:The source of a block quote or epigraph.-->
+<!ELEMENT attribution %ho; (%para.char.mix;)*>
+<!--end of attribution.element-->]]>
+
+<!ENTITY % attribution.attlist "INCLUDE">
+<![%attribution.attlist;[
+<!ATTLIST attribution
+		%common.attrib;
+		%attribution.role.attrib;
+		%local.attribution.attrib;
+>
+<!--end of attribution.attlist-->]]>
+<!--end of attribution.module-->]]>
+
+<!ENTITY % bridgehead.module "INCLUDE">
+<![%bridgehead.module;[
+<!ENTITY % local.bridgehead.attrib "">
+<!ENTITY % bridgehead.role.attrib "%role.attrib;">
+
+<!ENTITY % bridgehead.element "INCLUDE">
+<![%bridgehead.element;[
+<!--doc:A free-floating heading.-->
+<!ELEMENT bridgehead %ho; (%title.char.mix;)*>
+<!--end of bridgehead.element-->]]>
+
+<!-- Renderas: Indicates the format in which the BridgeHead
+		should appear -->
+
+
+<!ENTITY % bridgehead.attlist "INCLUDE">
+<![%bridgehead.attlist;[
+<!ATTLIST bridgehead
+		renderas	(other
+				|sect1
+				|sect2
+				|sect3
+				|sect4
+				|sect5)		#IMPLIED
+		%common.attrib;
+		%bridgehead.role.attrib;
+		%local.bridgehead.attrib;
+>
+<!--end of bridgehead.attlist-->]]>
+<!--end of bridgehead.module-->]]>
+
+<!ENTITY % remark.module "INCLUDE">
+<![%remark.module;[
+<!ENTITY % local.remark.attrib "">
+<!ENTITY % remark.role.attrib "%role.attrib;">
+
+<!ENTITY % remark.element "INCLUDE">
+<![%remark.element;[
+<!--doc:A remark (or comment) intended for presentation in a draft manuscript.-->
+<!ELEMENT remark %ho; (%para.char.mix;)*
+                      %remark.exclusion;>
+<!--end of remark.element-->]]>
+
+<!ENTITY % remark.attlist "INCLUDE">
+<![%remark.attlist;[
+<!ATTLIST remark
+		%common.attrib;
+		%remark.role.attrib;
+		%local.remark.attrib;
+>
+<!--end of remark.attlist-->]]>
+<!--end of remark.module-->]]>
+
+<!ENTITY % epigraph.module "INCLUDE">
+<![%epigraph.module;[
+<!ENTITY % local.epigraph.attrib "">
+<!ENTITY % epigraph.role.attrib "%role.attrib;">
+
+<!ENTITY % epigraph.element "INCLUDE">
+<![%epigraph.element;[
+<!--doc:A short inscription at the beginning of a document or component.-->
+<!ELEMENT epigraph %ho; (attribution?, ((%para.class;)|literallayout)+)>
+<!--end of epigraph.element-->]]>
+
+<!ENTITY % epigraph.attlist "INCLUDE">
+<![%epigraph.attlist;[
+<!ATTLIST epigraph
+		%common.attrib;
+		%epigraph.role.attrib;
+		%local.epigraph.attrib;
+>
+<!--end of epigraph.attlist-->]]>
+<!-- Attribution (defined above)-->
+<!--end of epigraph.module-->]]>
+
+<!ENTITY % footnote.module "INCLUDE">
+<![%footnote.module;[
+<!ENTITY % local.footnote.attrib "">
+<!ENTITY % footnote.role.attrib "%role.attrib;">
+
+<!ENTITY % footnote.element "INCLUDE">
+<![%footnote.element;[
+<!--doc:A footnote.-->
+<!ELEMENT footnote %ho; ((%footnote.mix;)+)
+                      %footnote.exclusion;>
+<!--end of footnote.element-->]]>
+
+<!ENTITY % footnote.attlist "INCLUDE">
+<![%footnote.attlist;[
+<!ATTLIST footnote
+		%label.attrib;
+		%common.attrib;
+		%footnote.role.attrib;
+		%local.footnote.attrib;
+>
+<!--end of footnote.attlist-->]]>
+<!--end of footnote.module-->]]>
+
+<!ENTITY % highlights.module "INCLUDE">
+<![%highlights.module;[
+<!ENTITY % local.highlights.attrib "">
+<!ENTITY % highlights.role.attrib "%role.attrib;">
+
+<!ENTITY % highlights.element "INCLUDE">
+<![%highlights.element;[
+<!--doc:A summary of the main points of the discussed component.-->
+<!ELEMENT highlights %ho; ((%highlights.mix;)+)
+                      %highlights.exclusion;>
+<!--end of highlights.element-->]]>
+
+<!ENTITY % highlights.attlist "INCLUDE">
+<![%highlights.attlist;[
+<!ATTLIST highlights
+		%common.attrib;
+		%highlights.role.attrib;
+		%local.highlights.attrib;
+>
+<!--end of highlights.attlist-->]]>
+<!--end of highlights.module-->]]>
+
+<!ENTITY % formalpara.module "INCLUDE">
+<![%formalpara.module;[
+<!ENTITY % local.formalpara.attrib "">
+<!ENTITY % formalpara.role.attrib "%role.attrib;">
+
+<!ENTITY % formalpara.element "INCLUDE">
+<![%formalpara.element;[
+<!--doc:A paragraph with a title.-->
+<!ELEMENT formalpara %ho; (title, (%ndxterm.class;)*, para)>
+<!--end of formalpara.element-->]]>
+
+<!ENTITY % formalpara.attlist "INCLUDE">
+<![%formalpara.attlist;[
+<!ATTLIST formalpara
+		%common.attrib;
+		%formalpara.role.attrib;
+		%local.formalpara.attrib;
+>
+<!--end of formalpara.attlist-->]]>
+<!--end of formalpara.module-->]]>
+
+<!ENTITY % para.module "INCLUDE">
+<![%para.module;[
+<!ENTITY % local.para.attrib "">
+<!ENTITY % para.role.attrib "%role.attrib;">
+
+<!ENTITY % para.element "INCLUDE">
+<![%para.element;[
+<!--doc:A paragraph.-->
+<!ELEMENT para %ho; (%para.char.mix; | %para.mix;)*>
+<!--end of para.element-->]]>
+
+<!ENTITY % para.attlist "INCLUDE">
+<![%para.attlist;[
+<!ATTLIST para
+		%common.attrib;
+		%para.role.attrib;
+		%local.para.attrib;
+>
+<!--end of para.attlist-->]]>
+<!--end of para.module-->]]>
+
+<!ENTITY % simpara.module "INCLUDE">
+<![%simpara.module;[
+<!ENTITY % local.simpara.attrib "">
+<!ENTITY % simpara.role.attrib "%role.attrib;">
+
+<!ENTITY % simpara.element "INCLUDE">
+<![%simpara.element;[
+<!--doc:A paragraph that contains only text and inline markup, no block elements.-->
+<!ELEMENT simpara %ho; (%para.char.mix;)*>
+<!--end of simpara.element-->]]>
+
+<!ENTITY % simpara.attlist "INCLUDE">
+<![%simpara.attlist;[
+<!ATTLIST simpara
+		%common.attrib;
+		%simpara.role.attrib;
+		%local.simpara.attrib;
+>
+<!--end of simpara.attlist-->]]>
+<!--end of simpara.module-->]]>
+
+<!ENTITY % admon.module "INCLUDE">
+<![%admon.module;[
+<!ENTITY % local.admon.attrib "">
+<!ENTITY % admon.role.attrib "%role.attrib;">
+
+
+<!ENTITY % caution.element "INCLUDE">
+<![%caution.element;[
+<!--doc:A note of caution.-->
+<!ELEMENT caution %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of caution.element-->]]>
+
+<!ENTITY % caution.attlist "INCLUDE">
+<![%caution.attlist;[
+<!ATTLIST caution
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of caution.attlist-->]]>
+
+
+<!ENTITY % important.element "INCLUDE">
+<![%important.element;[
+<!--doc:An admonition set off from the text.-->
+<!ELEMENT important %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of important.element-->]]>
+
+<!ENTITY % important.attlist "INCLUDE">
+<![%important.attlist;[
+<!ATTLIST important
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of important.attlist-->]]>
+
+
+<!ENTITY % note.element "INCLUDE">
+<![%note.element;[
+<!--doc:A message set off from the text.-->
+<!ELEMENT note %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of note.element-->]]>
+
+<!ENTITY % note.attlist "INCLUDE">
+<![%note.attlist;[
+<!ATTLIST note
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of note.attlist-->]]>
+
+<!ENTITY % tip.element "INCLUDE">
+<![%tip.element;[
+<!--doc:A suggestion to the user, set off from the text.-->
+<!ELEMENT tip %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of tip.element-->]]>
+
+<!ENTITY % tip.attlist "INCLUDE">
+<![%tip.attlist;[
+<!ATTLIST tip
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of tip.attlist-->]]>
+
+
+<!ENTITY % warning.element "INCLUDE">
+<![%warning.element;[
+<!--doc:An admonition set off from the text.-->
+<!ELEMENT warning %ho; (title?, (%admon.mix;)+)
+                      %admon.exclusion;>
+<!--end of warning.element-->]]>
+
+<!ENTITY % warning.attlist "INCLUDE">
+<![%warning.attlist;[
+<!ATTLIST warning
+		%common.attrib;
+		%admon.role.attrib;
+		%local.admon.attrib;
+>
+<!--end of warning.attlist-->]]>
+
+<!--end of admon.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Lists ................................................................ -->
+
+<!-- GlossList ........................ -->
+
+<!ENTITY % glosslist.module "INCLUDE">
+<![%glosslist.module;[
+<!ENTITY % local.glosslist.attrib "">
+<!ENTITY % glosslist.role.attrib "%role.attrib;">
+
+<!ENTITY % glosslist.element "INCLUDE">
+<![%glosslist.element;[
+<!--doc:A wrapper for a set of GlossEntrys.-->
+<!ELEMENT glosslist %ho; (blockinfo?, (%formalobject.title.content;)?, glossentry+)>
+<!--end of glosslist.element-->]]>
+
+<!ENTITY % glosslist.attlist "INCLUDE">
+<![%glosslist.attlist;[
+<!ATTLIST glosslist
+		%common.attrib;
+		%glosslist.role.attrib;
+		%local.glosslist.attrib;
+>
+<!--end of glosslist.attlist-->]]>
+<!--end of glosslist.module-->]]>
+
+<!ENTITY % glossentry.content.module "INCLUDE">
+<![%glossentry.content.module;[
+<!ENTITY % glossentry.module "INCLUDE">
+<![%glossentry.module;[
+<!ENTITY % local.glossentry.attrib "">
+<!ENTITY % glossentry.role.attrib "%role.attrib;">
+
+<!ENTITY % glossentry.element "INCLUDE">
+<![%glossentry.element;[
+<!--doc:An entry in a Glossary or GlossList.-->
+<!ELEMENT glossentry %ho; (glossterm, acronym?, abbrev?,
+                      (%ndxterm.class;)*,
+                      revhistory?, (glosssee|glossdef+))>
+<!--end of glossentry.element-->]]>
+
+<!-- SortAs: String by which the GlossEntry is to be sorted
+		(alphabetized) in lieu of its proper content -->
+
+
+<!ENTITY % glossentry.attlist "INCLUDE">
+<![%glossentry.attlist;[
+<!ATTLIST glossentry
+		sortas		CDATA		#IMPLIED
+		%common.attrib;
+		%glossentry.role.attrib;
+		%local.glossentry.attrib;
+>
+<!--end of glossentry.attlist-->]]>
+<!--end of glossentry.module-->]]>
+
+<!-- GlossTerm (defined in the Inlines section, below)-->
+<!ENTITY % glossdef.module "INCLUDE">
+<![%glossdef.module;[
+<!ENTITY % local.glossdef.attrib "">
+<!ENTITY % glossdef.role.attrib "%role.attrib;">
+
+<!ENTITY % glossdef.element "INCLUDE">
+<![%glossdef.element;[
+<!--doc:A definition in a GlossEntry.-->
+<!ELEMENT glossdef %ho; ((%glossdef.mix;)+, glossseealso*)>
+<!--end of glossdef.element-->]]>
+
+<!-- Subject: List of subjects; keywords for the definition -->
+
+
+<!ENTITY % glossdef.attlist "INCLUDE">
+<![%glossdef.attlist;[
+<!ATTLIST glossdef
+		subject		CDATA		#IMPLIED
+		%common.attrib;
+		%glossdef.role.attrib;
+		%local.glossdef.attrib;
+>
+<!--end of glossdef.attlist-->]]>
+<!--end of glossdef.module-->]]>
+
+<!ENTITY % glosssee.module "INCLUDE">
+<![%glosssee.module;[
+<!ENTITY % local.glosssee.attrib "">
+<!ENTITY % glosssee.role.attrib "%role.attrib;">
+
+<!ENTITY % glosssee.element "INCLUDE">
+<![%glosssee.element;[
+<!--doc:A cross-reference from one GlossEntry to another.-->
+<!ELEMENT glosssee %ho; (%para.char.mix;)*>
+<!--end of glosssee.element-->]]>
+
+<!-- OtherTerm: Reference to the GlossEntry whose GlossTerm
+		should be displayed at the point of the GlossSee -->
+
+
+<!ENTITY % glosssee.attlist "INCLUDE">
+<![%glosssee.attlist;[
+<!ATTLIST glosssee
+		otherterm	IDREF		#IMPLIED
+		%common.attrib;
+		%glosssee.role.attrib;
+		%local.glosssee.attrib;
+>
+<!--end of glosssee.attlist-->]]>
+<!--end of glosssee.module-->]]>
+
+<!ENTITY % glossseealso.module "INCLUDE">
+<![%glossseealso.module;[
+<!ENTITY % local.glossseealso.attrib "">
+<!ENTITY % glossseealso.role.attrib "%role.attrib;">
+
+<!ENTITY % glossseealso.element "INCLUDE">
+<![%glossseealso.element;[
+<!--doc:A cross-reference from one GlossEntry to another.-->
+<!ELEMENT glossseealso %ho; (%para.char.mix;)*>
+<!--end of glossseealso.element-->]]>
+
+<!-- OtherTerm: Reference to the GlossEntry whose GlossTerm
+		should be displayed at the point of the GlossSeeAlso -->
+
+
+<!ENTITY % glossseealso.attlist "INCLUDE">
+<![%glossseealso.attlist;[
+<!ATTLIST glossseealso
+		otherterm	IDREF		#IMPLIED
+		%common.attrib;
+		%glossseealso.role.attrib;
+		%local.glossseealso.attrib;
+>
+<!--end of glossseealso.attlist-->]]>
+<!--end of glossseealso.module-->]]>
+<!--end of glossentry.content.module-->]]>
+
+<!-- ItemizedList and OrderedList ..... -->
+
+<!ENTITY % itemizedlist.module "INCLUDE">
+<![%itemizedlist.module;[
+<!ENTITY % local.itemizedlist.attrib "">
+<!ENTITY % itemizedlist.role.attrib "%role.attrib;">
+
+<!ENTITY % itemizedlist.element "INCLUDE">
+<![%itemizedlist.element;[
+<!--doc:A list in which each entry is marked with a bullet or other dingbat.-->
+<!ELEMENT itemizedlist %ho; (blockinfo?, (%formalobject.title.content;)?,
+ 			    (%listpreamble.mix;)*, listitem+)>
+
+<!--end of itemizedlist.element-->]]>
+
+<!-- Spacing: Whether the vertical space in the list should be
+		compressed -->
+<!-- Mark: Keyword, e.g., bullet, dash, checkbox, none;
+		list of keywords and defaults are implementation specific -->
+
+
+<!ENTITY % itemizedlist.attlist "INCLUDE">
+<![%itemizedlist.attlist;[
+<!ATTLIST itemizedlist
+		spacing		(normal
+				|compact)	#IMPLIED
+		%mark.attrib;
+		%common.attrib;
+		%itemizedlist.role.attrib;
+		%local.itemizedlist.attrib;
+>
+<!--end of itemizedlist.attlist-->]]>
+<!--end of itemizedlist.module-->]]>
+
+<!ENTITY % orderedlist.module "INCLUDE">
+<![%orderedlist.module;[
+<!ENTITY % local.orderedlist.attrib "">
+<!ENTITY % orderedlist.role.attrib "%role.attrib;">
+
+<!ENTITY % orderedlist.element "INCLUDE">
+<![%orderedlist.element;[
+<!--doc:A list in which each entry is marked with a sequentially incremented label.-->
+<!ELEMENT orderedlist %ho; (blockinfo?, (%formalobject.title.content;)?,
+ 			    (%listpreamble.mix;)*, listitem+)>
+
+<!--end of orderedlist.element-->]]>
+
+<!-- Numeration: Style of ListItem numbered; default is expected
+		to be Arabic -->
+<!-- InheritNum: Specifies for a nested list that the numbering
+		of ListItems should include the number of the item
+		within which they are nested (e.g., 1a and 1b within 1,
+		rather than a and b) -->
+<!-- Continuation: Where list numbering begins afresh (Restarts,
+		the default) or continues that of the immediately preceding
+		list (Continues) -->
+<!-- Spacing: Whether the vertical space in the list should be
+		compressed -->
+
+
+<!ENTITY % orderedlist.attlist "INCLUDE">
+<![%orderedlist.attlist;[
+<!ATTLIST orderedlist
+		numeration	(arabic
+				|upperalpha
+				|loweralpha
+				|upperroman
+				|lowerroman)	#IMPLIED
+		inheritnum	(inherit
+				|ignore)	"ignore"
+		continuation	(continues
+				|restarts)	"restarts"
+		spacing		(normal
+				|compact)	#IMPLIED
+		%common.attrib;
+		%orderedlist.role.attrib;
+		%local.orderedlist.attrib;
+>
+<!--end of orderedlist.attlist-->]]>
+<!--end of orderedlist.module-->]]>
+
+<!ENTITY % listitem.module "INCLUDE">
+<![%listitem.module;[
+<!ENTITY % local.listitem.attrib "">
+<!ENTITY % listitem.role.attrib "%role.attrib;">
+
+<!ENTITY % listitem.element "INCLUDE">
+<![%listitem.element;[
+<!--doc:A wrapper for the elements of a list item.-->
+<!ELEMENT listitem %ho; ((%component.mix;)+)>
+<!--end of listitem.element-->]]>
+
+<!-- Override: Indicates the mark to be used for this ListItem
+		instead of the default mark or the mark specified by
+		the Mark attribute on the enclosing ItemizedList -->
+
+
+<!ENTITY % listitem.attlist "INCLUDE">
+<![%listitem.attlist;[
+<!ATTLIST listitem
+		override	CDATA		#IMPLIED
+		%common.attrib;
+		%listitem.role.attrib;
+		%local.listitem.attrib;
+>
+<!--end of listitem.attlist-->]]>
+<!--end of listitem.module-->]]>
+
+<!-- SegmentedList .................... -->
+<!ENTITY % segmentedlist.content.module "INCLUDE">
+<![%segmentedlist.content.module;[
+<!ENTITY % segmentedlist.module "INCLUDE">
+<![%segmentedlist.module;[
+<!ENTITY % local.segmentedlist.attrib "">
+<!ENTITY % segmentedlist.role.attrib "%role.attrib;">
+
+<!ENTITY % segmentedlist.element "INCLUDE">
+<![%segmentedlist.element;[
+<!--doc:A segmented list, a list of sets of elements.-->
+<!ELEMENT segmentedlist %ho; ((%formalobject.title.content;)?,
+                         segtitle+,
+                         seglistitem+)>
+<!--end of segmentedlist.element-->]]>
+
+<!ENTITY % segmentedlist.attlist "INCLUDE">
+<![%segmentedlist.attlist;[
+<!ATTLIST segmentedlist
+		%common.attrib;
+		%segmentedlist.role.attrib;
+		%local.segmentedlist.attrib;
+>
+<!--end of segmentedlist.attlist-->]]>
+<!--end of segmentedlist.module-->]]>
+
+<!ENTITY % segtitle.module "INCLUDE">
+<![%segtitle.module;[
+<!ENTITY % local.segtitle.attrib "">
+<!ENTITY % segtitle.role.attrib "%role.attrib;">
+
+<!ENTITY % segtitle.element "INCLUDE">
+<![%segtitle.element;[
+<!--doc:The title of an element of a list item in a segmented list.-->
+<!ELEMENT segtitle %ho; (%title.char.mix;)*>
+<!--end of segtitle.element-->]]>
+
+<!ENTITY % segtitle.attlist "INCLUDE">
+<![%segtitle.attlist;[
+<!ATTLIST segtitle
+		%common.attrib;
+		%segtitle.role.attrib;
+		%local.segtitle.attrib;
+>
+<!--end of segtitle.attlist-->]]>
+<!--end of segtitle.module-->]]>
+
+<!ENTITY % seglistitem.module "INCLUDE">
+<![%seglistitem.module;[
+<!ENTITY % local.seglistitem.attrib "">
+<!ENTITY % seglistitem.role.attrib "%role.attrib;">
+
+<!ENTITY % seglistitem.element "INCLUDE">
+<![%seglistitem.element;[
+<!--doc:A list item in a segmented list.-->
+<!ELEMENT seglistitem %ho; (seg+)>
+<!--end of seglistitem.element-->]]>
+
+<!ENTITY % seglistitem.attlist "INCLUDE">
+<![%seglistitem.attlist;[
+<!ATTLIST seglistitem
+		%common.attrib;
+		%seglistitem.role.attrib;
+		%local.seglistitem.attrib;
+>
+<!--end of seglistitem.attlist-->]]>
+<!--end of seglistitem.module-->]]>
+
+<!ENTITY % seg.module "INCLUDE">
+<![%seg.module;[
+<!ENTITY % local.seg.attrib "">
+<!ENTITY % seg.role.attrib "%role.attrib;">
+
+<!ENTITY % seg.element "INCLUDE">
+<![%seg.element;[
+<!--doc:An element of a list item in a segmented list.-->
+<!ELEMENT seg %ho; (%para.char.mix;)*>
+<!--end of seg.element-->]]>
+
+<!ENTITY % seg.attlist "INCLUDE">
+<![%seg.attlist;[
+<!ATTLIST seg
+		%common.attrib;
+		%seg.role.attrib;
+		%local.seg.attrib;
+>
+<!--end of seg.attlist-->]]>
+<!--end of seg.module-->]]>
+<!--end of segmentedlist.content.module-->]]>
+
+<!-- SimpleList ....................... -->
+
+<!ENTITY % simplelist.content.module "INCLUDE">
+<![%simplelist.content.module;[
+<!ENTITY % simplelist.module "INCLUDE">
+<![%simplelist.module;[
+<!ENTITY % local.simplelist.attrib "">
+<!ENTITY % simplelist.role.attrib "%role.attrib;">
+
+<!ENTITY % simplelist.element "INCLUDE">
+<![%simplelist.element;[
+<!--doc:An undecorated list of single words or short phrases.-->
+<!ELEMENT simplelist %ho; (member+)>
+<!--end of simplelist.element-->]]>
+
+<!-- Columns: The number of columns the array should contain -->
+<!-- Type: How the Members of the SimpleList should be
+		formatted: Inline (members separated with commas etc.
+		inline), Vert (top to bottom in n Columns), or Horiz (in
+		the direction of text flow) in n Columns.  If Column
+		is 1 or implied, Type=Vert and Type=Horiz give the same
+		results. -->
+
+
+<!ENTITY % simplelist.attlist "INCLUDE">
+<![%simplelist.attlist;[
+<!ATTLIST simplelist
+		columns		CDATA		#IMPLIED
+		type		(inline
+				|vert
+				|horiz)		"vert"
+		%common.attrib;
+		%simplelist.role.attrib;
+		%local.simplelist.attrib;
+>
+<!--end of simplelist.attlist-->]]>
+<!--end of simplelist.module-->]]>
+
+<!ENTITY % member.module "INCLUDE">
+<![%member.module;[
+<!ENTITY % local.member.attrib "">
+<!ENTITY % member.role.attrib "%role.attrib;">
+
+<!ENTITY % member.element "INCLUDE">
+<![%member.element;[
+<!--doc:An element of a simple list.-->
+<!ELEMENT member %ho; (%para.char.mix;)*>
+<!--end of member.element-->]]>
+
+<!ENTITY % member.attlist "INCLUDE">
+<![%member.attlist;[
+<!ATTLIST member
+		%common.attrib;
+		%member.role.attrib;
+		%local.member.attrib;
+>
+<!--end of member.attlist-->]]>
+<!--end of member.module-->]]>
+<!--end of simplelist.content.module-->]]>
+
+<!-- VariableList ..................... -->
+
+<!ENTITY % variablelist.content.module "INCLUDE">
+<![%variablelist.content.module;[
+<!ENTITY % variablelist.module "INCLUDE">
+<![%variablelist.module;[
+<!ENTITY % local.variablelist.attrib "">
+<!ENTITY % variablelist.role.attrib "%role.attrib;">
+
+<!ENTITY % variablelist.element "INCLUDE">
+<![%variablelist.element;[
+<!--doc:A list in which each entry is composed of a set of one or more terms and an associated description.-->
+<!ELEMENT variablelist %ho; (blockinfo?, (%formalobject.title.content;)?,
+ 			    (%listpreamble.mix;)*, varlistentry+)>
+<!--end of variablelist.element-->]]>
+
+<!-- TermLength: Length beyond which the presentation engine
+		may consider the Term too long and select an alternate
+		presentation of the Term and, or, its associated ListItem. -->
+
+
+<!ENTITY % variablelist.attlist "INCLUDE">
+<![%variablelist.attlist;[
+<!ATTLIST variablelist
+		termlength	CDATA		#IMPLIED
+		spacing		(normal
+				|compact)	#IMPLIED
+		%common.attrib;
+		%variablelist.role.attrib;
+		%local.variablelist.attrib;
+>
+<!--end of variablelist.attlist-->]]>
+<!--end of variablelist.module-->]]>
+
+<!ENTITY % varlistentry.module "INCLUDE">
+<![%varlistentry.module;[
+<!ENTITY % local.varlistentry.attrib "">
+<!ENTITY % varlistentry.role.attrib "%role.attrib;">
+
+<!ENTITY % varlistentry.element "INCLUDE">
+<![%varlistentry.element;[
+<!--doc:A wrapper for a set of terms and the associated description in a variable list.-->
+<!ELEMENT varlistentry %ho; (term+, listitem)>
+<!--end of varlistentry.element-->]]>
+
+<!ENTITY % varlistentry.attlist "INCLUDE">
+<![%varlistentry.attlist;[
+<!ATTLIST varlistentry
+		%common.attrib;
+		%varlistentry.role.attrib;
+		%local.varlistentry.attrib;
+>
+<!--end of varlistentry.attlist-->]]>
+<!--end of varlistentry.module-->]]>
+
+<!ENTITY % term.module "INCLUDE">
+<![%term.module;[
+<!ENTITY % local.term.attrib "">
+<!ENTITY % term.role.attrib "%role.attrib;">
+
+<!ENTITY % term.element "INCLUDE">
+<![%term.element;[
+<!--doc:The word or phrase being defined or described in a variable list.-->
+<!ELEMENT term %ho; (%para.char.mix;)*>
+<!--end of term.element-->]]>
+
+<!ENTITY % term.attlist "INCLUDE">
+<![%term.attlist;[
+<!ATTLIST term
+		%common.attrib;
+		%term.role.attrib;
+		%local.term.attrib;
+>
+<!--end of term.attlist-->]]>
+<!--end of term.module-->]]>
+
+<!-- ListItem (defined above)-->
+<!--end of variablelist.content.module-->]]>
+
+<!-- CalloutList ...................... -->
+
+<!ENTITY % calloutlist.content.module "INCLUDE">
+<![%calloutlist.content.module;[
+<!ENTITY % calloutlist.module "INCLUDE">
+<![%calloutlist.module;[
+<!ENTITY % local.calloutlist.attrib "">
+<!ENTITY % calloutlist.role.attrib "%role.attrib;">
+
+<!ENTITY % calloutlist.element "INCLUDE">
+<![%calloutlist.element;[
+<!--doc:A list of Callouts.-->
+<!ELEMENT calloutlist %ho; ((%formalobject.title.content;)?, callout+)>
+<!--end of calloutlist.element-->]]>
+
+<!ENTITY % calloutlist.attlist "INCLUDE">
+<![%calloutlist.attlist;[
+<!ATTLIST calloutlist
+		%common.attrib;
+		%calloutlist.role.attrib;
+		%local.calloutlist.attrib;
+>
+<!--end of calloutlist.attlist-->]]>
+<!--end of calloutlist.module-->]]>
+
+<!ENTITY % callout.module "INCLUDE">
+<![%callout.module;[
+<!ENTITY % local.callout.attrib "">
+<!ENTITY % callout.role.attrib "%role.attrib;">
+
+<!ENTITY % callout.element "INCLUDE">
+<![%callout.element;[
+<!--doc:A &ldquo;called out&rdquo; description of a marked Area.-->
+<!ELEMENT callout %ho; ((%component.mix;)+)>
+<!--end of callout.element-->]]>
+
+<!-- AreaRefs: IDs of one or more Areas or AreaSets described
+		by this Callout -->
+
+
+<!ENTITY % callout.attlist "INCLUDE">
+<![%callout.attlist;[
+<!ATTLIST callout
+		arearefs	IDREFS		#REQUIRED
+		%common.attrib;
+		%callout.role.attrib;
+		%local.callout.attrib;
+>
+<!--end of callout.attlist-->]]>
+<!--end of callout.module-->]]>
+<!--end of calloutlist.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Objects .............................................................. -->
+
+<!-- Examples etc. .................... -->
+
+<!ENTITY % example.module "INCLUDE">
+<![%example.module;[
+<!ENTITY % local.example.attrib "">
+<!ENTITY % example.role.attrib "%role.attrib;">
+
+<!ENTITY % example.element "INCLUDE">
+<![%example.element;[
+<!--doc:A formal example, with a title.-->
+<!ELEMENT example %ho; (blockinfo?, (%formalobject.title.content;), (%example.mix;)+)
+		%formal.exclusion;>
+<!--end of example.element-->]]>
+
+<!ENTITY % example.attlist "INCLUDE">
+<![%example.attlist;[
+<!ATTLIST example
+		floatstyle	CDATA			#IMPLIED
+		%label.attrib;
+		%width.attrib;
+		%common.attrib;
+		%example.role.attrib;
+		%local.example.attrib;
+>
+<!--end of example.attlist-->]]>
+<!--end of example.module-->]]>
+
+<!ENTITY % informalexample.module "INCLUDE">
+<![%informalexample.module;[
+<!ENTITY % local.informalexample.attrib "">
+<!ENTITY % informalexample.role.attrib "%role.attrib;">
+
+<!ENTITY % informalexample.element "INCLUDE">
+<![%informalexample.element;[
+<!--doc:A displayed example without a title.-->
+<!ELEMENT informalexample %ho; (blockinfo?, (%example.mix;)+)>
+<!--end of informalexample.element-->]]>
+
+<!ENTITY % informalexample.attlist "INCLUDE">
+<![%informalexample.attlist;[
+<!ATTLIST informalexample
+		floatstyle	CDATA			#IMPLIED
+		%width.attrib;
+		%common.attrib;
+		%informalexample.role.attrib;
+		%local.informalexample.attrib;
+>
+<!--end of informalexample.attlist-->]]>
+<!--end of informalexample.module-->]]>
+
+<!ENTITY % programlistingco.module "INCLUDE">
+<![%programlistingco.module;[
+<!ENTITY % local.programlistingco.attrib "">
+<!ENTITY % programlistingco.role.attrib "%role.attrib;">
+
+<!ENTITY % programlistingco.element "INCLUDE">
+<![%programlistingco.element;[
+<!--doc:A program listing with associated areas used in callouts.-->
+<!ELEMENT programlistingco %ho; (areaspec, programlisting, calloutlist*)>
+<!--end of programlistingco.element-->]]>
+
+<!ENTITY % programlistingco.attlist "INCLUDE">
+<![%programlistingco.attlist;[
+<!ATTLIST programlistingco
+		%common.attrib;
+		%programlistingco.role.attrib;
+		%local.programlistingco.attrib;
+>
+<!--end of programlistingco.attlist-->]]>
+<!-- CalloutList (defined above in Lists)-->
+<!--end of informalexample.module-->]]>
+
+<!ENTITY % areaspec.content.module "INCLUDE">
+<![%areaspec.content.module;[
+<!ENTITY % areaspec.module "INCLUDE">
+<![%areaspec.module;[
+<!ENTITY % local.areaspec.attrib "">
+<!ENTITY % areaspec.role.attrib "%role.attrib;">
+
+<!ENTITY % areaspec.element "INCLUDE">
+<![%areaspec.element;[
+<!--doc:A collection of regions in a graphic or code example.-->
+<!ELEMENT areaspec %ho; ((area|areaset)+)>
+<!--end of areaspec.element-->]]>
+
+<!-- Units: global unit of measure in which coordinates in
+		this spec are expressed:
+
+		- CALSPair "x1,y1 x2,y2": lower-left and upper-right
+		coordinates in a rectangle describing repro area in which
+		graphic is placed, where X and Y dimensions are each some
+		number 0..10000 (taken from CALS graphic attributes)
+
+		- LineColumn "line column": line number and column number
+		at which to start callout text in "linespecific" content
+
+		- LineRange "startline endline": whole lines from startline
+		to endline in "linespecific" content
+
+		- LineColumnPair "line1 col1 line2 col2": starting and ending
+		points of area in "linespecific" content that starts at
+		first position and ends at second position (including the
+		beginnings of any intervening lines)
+
+		- Other: directive to look at value of OtherUnits attribute
+		to get implementation-specific keyword
+
+		The default is implementation-specific; usually dependent on
+		the parent element (GraphicCO gets CALSPair, ProgramListingCO
+		and ScreenCO get LineColumn) -->
+<!-- OtherUnits: User-defined units -->
+
+
+<!ENTITY % areaspec.attlist "INCLUDE">
+<![%areaspec.attlist;[
+<!ATTLIST areaspec
+		units		(calspair
+				|linecolumn
+				|linerange
+				|linecolumnpair
+				|other)		#IMPLIED
+		otherunits	NMTOKEN		#IMPLIED
+		%common.attrib;
+		%areaspec.role.attrib;
+		%local.areaspec.attrib;
+>
+<!--end of areaspec.attlist-->]]>
+<!--end of areaspec.module-->]]>
+
+<!ENTITY % area.module "INCLUDE">
+<![%area.module;[
+<!ENTITY % local.area.attrib "">
+<!ENTITY % area.role.attrib "%role.attrib;">
+
+<!ENTITY % area.element "INCLUDE">
+<![%area.element;[
+<!--doc:A region defined for a Callout in a graphic or code example.-->
+<!ELEMENT area %ho; EMPTY>
+<!--end of area.element-->]]>
+
+<!-- bug number/symbol override or initialization -->
+<!-- to any related information -->
+<!-- Units: unit of measure in which coordinates in this
+		area are expressed; inherits from AreaSet and AreaSpec -->
+<!-- OtherUnits: User-defined units -->
+
+
+<!ENTITY % area.attlist "INCLUDE">
+<![%area.attlist;[
+<!ATTLIST area
+		%label.attrib;
+		%linkends.attrib;
+		units		(calspair
+				|linecolumn
+				|linerange
+				|linecolumnpair
+				|other)		#IMPLIED
+		otherunits	NMTOKEN		#IMPLIED
+		coords		CDATA		#REQUIRED
+		%idreq.common.attrib;
+		%area.role.attrib;
+		%local.area.attrib;
+>
+<!--end of area.attlist-->]]>
+<!--end of area.module-->]]>
+
+<!ENTITY % areaset.module "INCLUDE">
+<![%areaset.module;[
+<!ENTITY % local.areaset.attrib "">
+<!ENTITY % areaset.role.attrib "%role.attrib;">
+
+<!ENTITY % areaset.element "INCLUDE">
+<![%areaset.element;[
+<!--doc:A set of related areas in a graphic or code example.-->
+<!ELEMENT areaset %ho; (area+)>
+<!--end of areaset.element-->]]>
+
+<!-- bug number/symbol override or initialization -->
+<!-- Units: unit of measure in which coordinates in this
+		area are expressed; inherits from AreaSpec -->
+
+
+<!ENTITY % areaset.attlist "INCLUDE">
+<![%areaset.attlist;[
+<!ATTLIST areaset
+		%label.attrib;
+		units		(calspair
+				|linecolumn
+				|linerange
+				|linecolumnpair
+				|other)		#IMPLIED
+		otherunits	NMTOKEN		#IMPLIED
+		coords		CDATA		#REQUIRED
+		%idreq.common.attrib;
+		%areaset.role.attrib;
+		%local.areaset.attrib;
+>
+<!--end of areaset.attlist-->]]>
+<!--end of areaset.module-->]]>
+<!--end of areaspec.content.module-->]]>
+
+<!ENTITY % programlisting.module "INCLUDE">
+<![%programlisting.module;[
+<!ENTITY % local.programlisting.attrib "">
+<!ENTITY % programlisting.role.attrib "%role.attrib;">
+
+<!ENTITY % programlisting.element "INCLUDE">
+<![%programlisting.element;[
+<!--doc:A literal listing of all or part of a program.-->
+<!ELEMENT programlisting %ho; (%para.char.mix;|co|coref|lineannotation|textobject)*>
+<!--end of programlisting.element-->]]>
+
+<!ENTITY % programlisting.attlist "INCLUDE">
+<![%programlisting.attlist;[
+<!ATTLIST programlisting
+		%width.attrib;
+		%linespecific.attrib;
+		%common.attrib;
+		%programlisting.role.attrib;
+		%local.programlisting.attrib;
+>
+<!--end of programlisting.attlist-->]]>
+<!--end of programlisting.module-->]]>
+
+<!ENTITY % literallayout.module "INCLUDE">
+<![%literallayout.module;[
+<!ENTITY % local.literallayout.attrib "">
+<!ENTITY % literallayout.role.attrib "%role.attrib;">
+
+<!ENTITY % literallayout.element "INCLUDE">
+<![%literallayout.element;[
+<!--doc:A block of text in which line breaks and white space are to be reproduced faithfully.-->
+<!ELEMENT literallayout %ho; (%para.char.mix;|co|coref|textobject|lineannotation)*>
+<!--end of literallayout.element-->]]>
+
+<!ENTITY % literallayout.attlist "INCLUDE">
+<![%literallayout.attlist;[
+<!ATTLIST literallayout
+		%width.attrib;
+		%linespecific.attrib;
+		class	(monospaced|normal)	"normal"
+		%common.attrib;
+		%literallayout.role.attrib;
+		%local.literallayout.attrib;
+>
+<!--end of literallayout.attlist-->]]>
+<!-- LineAnnotation (defined in the Inlines section, below)-->
+<!--end of literallayout.module-->]]>
+
+<!ENTITY % screenco.module "INCLUDE">
+<![%screenco.module;[
+<!ENTITY % local.screenco.attrib "">
+<!ENTITY % screenco.role.attrib "%role.attrib;">
+
+<!ENTITY % screenco.element "INCLUDE">
+<![%screenco.element;[
+<!--doc:A screen with associated areas used in callouts.-->
+<!ELEMENT screenco %ho; (areaspec, screen, calloutlist*)>
+<!--end of screenco.element-->]]>
+
+<!ENTITY % screenco.attlist "INCLUDE">
+<![%screenco.attlist;[
+<!ATTLIST screenco
+		%common.attrib;
+		%screenco.role.attrib;
+		%local.screenco.attrib;
+>
+<!--end of screenco.attlist-->]]>
+<!-- AreaSpec (defined above)-->
+<!-- CalloutList (defined above in Lists)-->
+<!--end of screenco.module-->]]>
+
+<!ENTITY % screen.module "INCLUDE">
+<![%screen.module;[
+<!ENTITY % local.screen.attrib "">
+<!ENTITY % screen.role.attrib "%role.attrib;">
+
+<!ENTITY % screen.element "INCLUDE">
+<![%screen.element;[
+<!--doc:Text that a user sees or might see on a computer screen.-->
+<!ELEMENT screen %ho; (%para.char.mix;|co|coref|textobject|lineannotation)*>
+<!--end of screen.element-->]]>
+
+<!ENTITY % screen.attlist "INCLUDE">
+<![%screen.attlist;[
+<!ATTLIST screen
+		%width.attrib;
+		%linespecific.attrib;
+		%common.attrib;
+		%screen.role.attrib;
+		%local.screen.attrib;
+>
+<!--end of screen.attlist-->]]>
+<!--end of screen.module-->]]>
+
+<!ENTITY % screenshot.content.module "INCLUDE">
+<![%screenshot.content.module;[
+<!ENTITY % screenshot.module "INCLUDE">
+<![%screenshot.module;[
+<!ENTITY % local.screenshot.attrib "">
+<!ENTITY % screenshot.role.attrib "%role.attrib;">
+
+<!ENTITY % screenshot.element "INCLUDE">
+<![%screenshot.element;[
+<!--doc:A representation of what the user sees or might see on a computer screen.-->
+<!ELEMENT screenshot %ho; (screeninfo?,
+                      (graphic|graphicco
+                      |mediaobject|mediaobjectco))>
+<!--end of screenshot.element-->]]>
+
+<!ENTITY % screenshot.attlist "INCLUDE">
+<![%screenshot.attlist;[
+<!ATTLIST screenshot
+		%common.attrib;
+		%screenshot.role.attrib;
+		%local.screenshot.attrib;
+>
+<!--end of screenshot.attlist-->]]>
+<!--end of screenshot.module-->]]>
+
+<!ENTITY % screeninfo.module "INCLUDE">
+<![%screeninfo.module;[
+<!ENTITY % local.screeninfo.attrib "">
+<!ENTITY % screeninfo.role.attrib "%role.attrib;">
+
+<!ENTITY % screeninfo.element "INCLUDE">
+<![%screeninfo.element;[
+<!--doc:Information about how a screen shot was produced.-->
+<!ELEMENT screeninfo %ho; (%para.char.mix;)*
+		%ubiq.exclusion;>
+<!--end of screeninfo.element-->]]>
+
+<!ENTITY % screeninfo.attlist "INCLUDE">
+<![%screeninfo.attlist;[
+<!ATTLIST screeninfo
+		%common.attrib;
+		%screeninfo.role.attrib;
+		%local.screeninfo.attrib;
+>
+<!--end of screeninfo.attlist-->]]>
+<!--end of screeninfo.module-->]]>
+<!--end of screenshot.content.module-->]]>
+
+<!-- Figures etc. ..................... -->
+
+<!ENTITY % figure.module "INCLUDE">
+<![%figure.module;[
+<!ENTITY % local.figure.attrib "">
+<!ENTITY % figure.role.attrib "%role.attrib;">
+
+<!ENTITY % figure.element "INCLUDE">
+<![%figure.element;[
+<!--doc:A formal figure, generally an illustration, with a title.-->
+<!ELEMENT figure %ho; (blockinfo?, (%formalobject.title.content;),
+                       (%figure.mix; | %link.char.class;)+)>
+<!--end of figure.element-->]]>
+
+<!-- Float: Whether the Figure is supposed to be rendered
+		where convenient (yes (1) value) or at the place it occurs
+		in the text (no (0) value, the default) -->
+
+
+<!ENTITY % figure.attlist "INCLUDE">
+<![%figure.attlist;[
+<!ATTLIST figure
+		float		%yesorno.attvals;	'0'
+		floatstyle	CDATA			#IMPLIED
+		pgwide      	%yesorno.attvals;       #IMPLIED
+		%label.attrib;
+		%common.attrib;
+		%figure.role.attrib;
+		%local.figure.attrib;
+>
+<!--end of figure.attlist-->]]>
+<!--end of figure.module-->]]>
+
+<!ENTITY % informalfigure.module "INCLUDE">
+<![ %informalfigure.module; [
+<!ENTITY % local.informalfigure.attrib "">
+<!ENTITY % informalfigure.role.attrib "%role.attrib;">
+
+<!ENTITY % informalfigure.element "INCLUDE">
+<![ %informalfigure.element; [
+<!--doc:A untitled figure.-->
+<!ELEMENT informalfigure %ho; (blockinfo?, (%figure.mix; | %link.char.class;)+)>
+<!--end of informalfigure.element-->]]>
+
+<!ENTITY % informalfigure.attlist "INCLUDE">
+<![ %informalfigure.attlist; [
+<!--
+Float: Whether the Figure is supposed to be rendered
+where convenient (yes (1) value) or at the place it occurs
+in the text (no (0) value, the default)
+-->
+<!ATTLIST informalfigure
+		float		%yesorno.attvals;	"0"
+		floatstyle	CDATA			#IMPLIED
+		pgwide      	%yesorno.attvals;       #IMPLIED
+		%label.attrib;
+		%common.attrib;
+		%informalfigure.role.attrib;
+		%local.informalfigure.attrib;
+>
+<!--end of informalfigure.attlist-->]]>
+<!--end of informalfigure.module-->]]>
+
+<!ENTITY % graphicco.module "INCLUDE">
+<![%graphicco.module;[
+<!ENTITY % local.graphicco.attrib "">
+<!ENTITY % graphicco.role.attrib "%role.attrib;">
+
+<!ENTITY % graphicco.element "INCLUDE">
+<![%graphicco.element;[
+<!--doc:A graphic that contains callout areas.-->
+<!ELEMENT graphicco %ho; (areaspec, graphic, calloutlist*)>
+<!--end of graphicco.element-->]]>
+
+<!ENTITY % graphicco.attlist "INCLUDE">
+<![%graphicco.attlist;[
+<!ATTLIST graphicco
+		%common.attrib;
+		%graphicco.role.attrib;
+		%local.graphicco.attrib;
+>
+<!--end of graphicco.attlist-->]]>
+<!-- AreaSpec (defined above in Examples)-->
+<!-- CalloutList (defined above in Lists)-->
+<!--end of graphicco.module-->]]>
+
+<!-- Graphical data can be the content of Graphic, or you can reference
+     an external file either as an entity (Entitref) or a filename
+     (Fileref). -->
+
+<!ENTITY % graphic.module "INCLUDE">
+<![%graphic.module;[
+<!ENTITY % local.graphic.attrib "">
+<!ENTITY % graphic.role.attrib "%role.attrib;">
+
+<!ENTITY % graphic.element "INCLUDE">
+<![%graphic.element;[
+<!--doc:A displayed graphical object (not an inline).-->
+<!ELEMENT graphic %ho; EMPTY>
+<!--end of graphic.element-->]]>
+
+<!ENTITY % graphic.attlist "INCLUDE">
+<![%graphic.attlist;[
+<!ATTLIST graphic
+		%graphics.attrib;
+		%common.attrib;
+		%graphic.role.attrib;
+		%local.graphic.attrib;
+>
+<!--end of graphic.attlist-->]]>
+<!--end of graphic.module-->]]>
+
+<!ENTITY % inlinegraphic.module "INCLUDE">
+<![%inlinegraphic.module;[
+<!ENTITY % local.inlinegraphic.attrib "">
+<!ENTITY % inlinegraphic.role.attrib "%role.attrib;">
+
+<!ENTITY % inlinegraphic.element "INCLUDE">
+<![%inlinegraphic.element;[
+<!--doc:An object containing or pointing to graphical data that will be rendered inline.-->
+<!ELEMENT inlinegraphic %ho; EMPTY>
+<!--end of inlinegraphic.element-->]]>
+
+<!ENTITY % inlinegraphic.attlist "INCLUDE">
+<![%inlinegraphic.attlist;[
+<!ATTLIST inlinegraphic
+		%graphics.attrib;
+		%common.attrib;
+		%inlinegraphic.role.attrib;
+		%local.inlinegraphic.attrib;
+>
+<!--end of inlinegraphic.attlist-->]]>
+<!--end of inlinegraphic.module-->]]>
+
+<!ENTITY % mediaobject.content.module "INCLUDE">
+<![ %mediaobject.content.module; [
+
+<!ENTITY % mediaobject.module "INCLUDE">
+<![ %mediaobject.module; [
+<!ENTITY % local.mediaobject.attrib "">
+<!ENTITY % mediaobject.role.attrib "%role.attrib;">
+
+<!ENTITY % mediaobject.element "INCLUDE">
+<![ %mediaobject.element; [
+<!--doc:A displayed media object (video, audio, image, etc.).-->
+<!ELEMENT mediaobject %ho; (objectinfo?,
+                           (%mediaobject.mix;)+,
+			   caption?)>
+<!--end of mediaobject.element-->]]>
+
+<!ENTITY % mediaobject.attlist "INCLUDE">
+<![ %mediaobject.attlist; [
+<!ATTLIST mediaobject
+		%common.attrib;
+		%mediaobject.role.attrib;
+		%local.mediaobject.attrib;
+>
+<!--end of mediaobject.attlist-->]]>
+<!--end of mediaobject.module-->]]>
+
+<!ENTITY % inlinemediaobject.module "INCLUDE">
+<![ %inlinemediaobject.module; [
+<!ENTITY % local.inlinemediaobject.attrib "">
+<!ENTITY % inlinemediaobject.role.attrib "%role.attrib;">
+
+<!ENTITY % inlinemediaobject.element "INCLUDE">
+<![ %inlinemediaobject.element; [
+<!--doc:An inline media object (video, audio, image, and so on).-->
+<!ELEMENT inlinemediaobject %ho; (objectinfo?,
+                	         (%mediaobject.mix;)+)>
+<!--end of inlinemediaobject.element-->]]>
+
+<!ENTITY % inlinemediaobject.attlist "INCLUDE">
+<![ %inlinemediaobject.attlist; [
+<!ATTLIST inlinemediaobject
+		%common.attrib;
+		%inlinemediaobject.role.attrib;
+		%local.inlinemediaobject.attrib;
+>
+<!--end of inlinemediaobject.attlist-->]]>
+<!--end of inlinemediaobject.module-->]]>
+
+<!ENTITY % videoobject.module "INCLUDE">
+<![ %videoobject.module; [
+<!ENTITY % local.videoobject.attrib "">
+<!ENTITY % videoobject.role.attrib "%role.attrib;">
+
+<!ENTITY % videoobject.element "INCLUDE">
+<![ %videoobject.element; [
+<!--doc:A wrapper for video data and its associated meta-information.-->
+<!ELEMENT videoobject %ho; (objectinfo?, videodata)>
+<!--end of videoobject.element-->]]>
+
+<!ENTITY % videoobject.attlist "INCLUDE">
+<![ %videoobject.attlist; [
+<!ATTLIST videoobject
+		%common.attrib;
+		%videoobject.role.attrib;
+		%local.videoobject.attrib;
+>
+<!--end of videoobject.attlist-->]]>
+<!--end of videoobject.module-->]]>
+
+<!ENTITY % audioobject.module "INCLUDE">
+<![ %audioobject.module; [
+<!ENTITY % local.audioobject.attrib "">
+<!ENTITY % audioobject.role.attrib "%role.attrib;">
+
+<!ENTITY % audioobject.element "INCLUDE">
+<![ %audioobject.element; [
+<!--doc:A wrapper for audio data and its associated meta-information.-->
+<!ELEMENT audioobject %ho; (objectinfo?, audiodata)>
+<!--end of audioobject.element-->]]>
+
+<!ENTITY % audioobject.attlist "INCLUDE">
+<![ %audioobject.attlist; [
+<!ATTLIST audioobject
+		%common.attrib;
+		%audioobject.role.attrib;
+		%local.audioobject.attrib;
+>
+<!--end of audioobject.attlist-->]]>
+<!--end of audioobject.module-->]]>
+
+<!ENTITY % imageobject.module "INCLUDE">
+<![ %imageobject.module; [
+<!ENTITY % local.imageobject.attrib "">
+<!ENTITY % imageobject.role.attrib "%role.attrib;">
+
+<!ENTITY % imageobject.element "INCLUDE">
+<![ %imageobject.element; [
+<!--doc:A wrapper for image data and its associated meta-information.-->
+<!ELEMENT imageobject %ho; (objectinfo?, imagedata)>
+<!--end of imageobject.element-->]]>
+
+<!ENTITY % imageobject.attlist "INCLUDE">
+<![ %imageobject.attlist; [
+<!ATTLIST imageobject
+		%common.attrib;
+		%imageobject.role.attrib;
+		%local.imageobject.attrib;
+>
+<!--end of imageobject.attlist-->]]>
+<!--end of imageobject.module-->]]>
+
+<!ENTITY % textobject.module "INCLUDE">
+<![ %textobject.module; [
+<!ENTITY % local.textobject.attrib "">
+<!ENTITY % textobject.role.attrib "%role.attrib;">
+
+<!ENTITY % textobject.element "INCLUDE">
+<![ %textobject.element; [
+<!--doc:A wrapper for a text description of an object and its associated meta-information.-->
+<!ELEMENT textobject %ho; (objectinfo?, (phrase|textdata|(%textobject.mix;)+))>
+<!--end of textobject.element-->]]>
+
+<!ENTITY % textobject.attlist "INCLUDE">
+<![ %textobject.attlist; [
+<!ATTLIST textobject
+		%common.attrib;
+		%textobject.role.attrib;
+		%local.textobject.attrib;
+>
+<!--end of textobject.attlist-->]]>
+<!--end of textobject.module-->]]>
+
+<!ENTITY % objectinfo.module "INCLUDE">
+<![ %objectinfo.module; [
+<!ENTITY % local.objectinfo.attrib "">
+<!ENTITY % objectinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % objectinfo.element "INCLUDE">
+<![ %objectinfo.element; [
+<!--doc:Meta-information for an object.-->
+<!ELEMENT objectinfo %ho; ((%info.class;)+)
+	%beginpage.exclusion;>
+<!--end of objectinfo.element-->]]>
+
+<!ENTITY % objectinfo.attlist "INCLUDE">
+<![ %objectinfo.attlist; [
+<!ATTLIST objectinfo
+		%common.attrib;
+		%objectinfo.role.attrib;
+		%local.objectinfo.attrib;
+>
+<!--end of objectinfo.attlist-->]]>
+<!--end of objectinfo.module-->]]>
+
+<!--EntityRef: Name of an external entity containing the content
+	of the object data-->
+<!--FileRef: Filename, qualified by a pathname if desired,
+	designating the file containing the content of the object data-->
+<!--Format: Notation of the element content, if any-->
+<!--SrcCredit: Information about the source of the image-->
+<!ENTITY % local.objectdata.attrib "">
+<!ENTITY % objectdata.attrib
+	"
+	entityref	ENTITY		#IMPLIED
+	fileref 	CDATA		#IMPLIED
+	format		(%notation.class;)
+					#IMPLIED
+	srccredit	CDATA		#IMPLIED
+	%local.objectdata.attrib;"
+>
+
+<!ENTITY % videodata.module "INCLUDE">
+<![ %videodata.module; [
+<!ENTITY % local.videodata.attrib "">
+<!ENTITY % videodata.role.attrib "%role.attrib;">
+
+<!ENTITY % videodata.element "INCLUDE">
+<![ %videodata.element; [
+<!--doc:Pointer to external video data.-->
+<!ELEMENT videodata %ho; EMPTY>
+<!--end of videodata.element-->]]>
+
+<!ENTITY % videodata.attlist "INCLUDE">
+<![ %videodata.attlist; [
+
+<!--Width: Same as CALS reprowid (desired width)-->
+<!--Depth: Same as CALS reprodep (desired depth)-->
+<!--Align: Same as CALS hplace with 'none' removed; #IMPLIED means
+	application-specific-->
+<!--Scale: Conflation of CALS hscale and vscale-->
+<!--Scalefit: Same as CALS scalefit-->
+<!ATTLIST videodata
+	width		CDATA		#IMPLIED
+	contentwidth	CDATA		#IMPLIED
+	depth		CDATA		#IMPLIED
+	contentdepth	CDATA		#IMPLIED
+	align		(left
+			|right
+			|center)	#IMPLIED
+	valign		(top
+			|middle
+			|bottom)	#IMPLIED
+	scale		CDATA		#IMPLIED
+	scalefit	%yesorno.attvals;
+					#IMPLIED
+		%objectdata.attrib;
+		%common.attrib;
+		%videodata.role.attrib;
+		%local.videodata.attrib;
+>
+<!--end of videodata.attlist-->]]>
+<!--end of videodata.module-->]]>
+
+<!ENTITY % audiodata.module "INCLUDE">
+<![ %audiodata.module; [
+<!ENTITY % local.audiodata.attrib "">
+<!ENTITY % audiodata.role.attrib "%role.attrib;">
+
+<!ENTITY % audiodata.element "INCLUDE">
+<![ %audiodata.element; [
+<!--doc:Pointer to external audio data.-->
+<!ELEMENT audiodata %ho; EMPTY>
+<!--end of audiodata.element-->]]>
+
+<!ENTITY % audiodata.attlist "INCLUDE">
+<![ %audiodata.attlist; [
+<!ATTLIST audiodata
+		%objectdata.attrib;
+		%common.attrib;
+		%audiodata.role.attrib;
+		%local.audiodata.attrib;
+>
+<!--end of audiodata.attlist-->]]>
+<!--end of audiodata.module-->]]>
+
+<!ENTITY % imagedata.module "INCLUDE">
+<![ %imagedata.module; [
+<!ENTITY % local.imagedata.attrib "">
+<!ENTITY % imagedata.role.attrib "%role.attrib;">
+
+<!ENTITY % imagedata.element "INCLUDE">
+<![ %imagedata.element; [
+<!--doc:Pointer to external image data.-->
+<!ELEMENT imagedata %ho; EMPTY>
+<!--end of imagedata.element-->]]>
+
+<!ENTITY % imagedata.attlist "INCLUDE">
+<![ %imagedata.attlist; [
+
+<!--Width: Same as CALS reprowid (desired width)-->
+<!--Depth: Same as CALS reprodep (desired depth)-->
+<!--Align: Same as CALS hplace with 'none' removed; #IMPLIED means
+	application-specific-->
+<!--Scale: Conflation of CALS hscale and vscale-->
+<!--Scalefit: Same as CALS scalefit-->
+<!ATTLIST imagedata
+	width		CDATA		#IMPLIED
+	contentwidth	CDATA		#IMPLIED
+	depth		CDATA		#IMPLIED
+	contentdepth	CDATA		#IMPLIED
+	align		(left
+			|right
+			|center)	#IMPLIED
+	valign		(top
+			|middle
+			|bottom)	#IMPLIED
+	scale		CDATA		#IMPLIED
+	scalefit	%yesorno.attvals;
+					#IMPLIED
+		%objectdata.attrib;
+		%common.attrib;
+		%imagedata.role.attrib;
+		%local.imagedata.attrib;
+>
+<!--end of imagedata.attlist-->]]>
+<!--end of imagedata.module-->]]>
+
+<!ENTITY % textdata.module "INCLUDE">
+<![ %textdata.module; [
+<!ENTITY % local.textdata.attrib "">
+<!ENTITY % textdata.role.attrib "%role.attrib;">
+
+<!ENTITY % textdata.element "INCLUDE">
+<![ %textdata.element; [
+<!--doc:Pointer to external text data.-->
+<!ELEMENT textdata %ho; EMPTY>
+<!--end of textdata.element-->]]>
+
+<!ENTITY % textdata.attlist "INCLUDE">
+<![ %textdata.attlist; [
+<!ATTLIST textdata
+		encoding	CDATA	#IMPLIED
+		%objectdata.attrib;
+		%common.attrib;
+		%textdata.role.attrib;
+		%local.textdata.attrib;
+>
+<!--end of textdata.attlist-->]]>
+<!--end of textdata.module-->]]>
+
+<!ENTITY % mediaobjectco.module "INCLUDE">
+<![ %mediaobjectco.module; [
+<!ENTITY % local.mediaobjectco.attrib "">
+<!ENTITY % mediaobjectco.role.attrib "%role.attrib;">
+
+<!ENTITY % mediaobjectco.element "INCLUDE">
+<![ %mediaobjectco.element; [
+<!--doc:A media object that contains callouts.-->
+<!ELEMENT mediaobjectco %ho; (objectinfo?, imageobjectco,
+			   (imageobjectco|textobject)*)>
+<!--end of mediaobjectco.element-->]]>
+
+<!ENTITY % mediaobjectco.attlist "INCLUDE">
+<![ %mediaobjectco.attlist; [
+<!ATTLIST mediaobjectco
+		%common.attrib;
+		%mediaobjectco.role.attrib;
+		%local.mediaobjectco.attrib;
+>
+<!--end of mediaobjectco.attlist-->]]>
+<!--end of mediaobjectco.module-->]]>
+
+<!ENTITY % imageobjectco.module "INCLUDE">
+<![ %imageobjectco.module; [
+<!ENTITY % local.imageobjectco.attrib "">
+<!ENTITY % imageobjectco.role.attrib "%role.attrib;">
+
+<!ENTITY % imageobjectco.element "INCLUDE">
+<![ %imageobjectco.element; [
+<!--doc:A wrapper for an image object with callouts.-->
+<!ELEMENT imageobjectco %ho; (areaspec, imageobject, calloutlist*)>
+<!--end of imageobjectco.element-->]]>
+
+<!ENTITY % imageobjectco.attlist "INCLUDE">
+<![ %imageobjectco.attlist; [
+<!ATTLIST imageobjectco
+		%common.attrib;
+		%imageobjectco.role.attrib;
+		%local.imageobjectco.attrib;
+>
+<!--end of imageobjectco.attlist-->]]>
+<!--end of imageobjectco.module-->]]>
+<!--end of mediaobject.content.module-->]]>
+
+<!-- Equations ........................ -->
+
+<!-- This PE provides a mechanism for replacing equation content, -->
+<!-- perhaps adding a new or different model (e.g., MathML) -->
+<!ENTITY % equation.content "(alt?, (graphic+|mediaobject+|mathphrase+))">
+<!ENTITY % inlineequation.content "(alt?, (graphic+|inlinemediaobject+|mathphrase+))">
+
+<!ENTITY % equation.module "INCLUDE">
+<![%equation.module;[
+<!ENTITY % local.equation.attrib "">
+<!ENTITY % equation.role.attrib "%role.attrib;">
+
+<!ENTITY % equation.element "INCLUDE">
+<![%equation.element;[
+<!--doc:A displayed mathematical equation.-->
+<!ELEMENT equation %ho; (blockinfo?, (%formalobject.title.content;)?,
+                         (informalequation | %equation.content;))>
+<!--end of equation.element-->]]>
+
+<!ENTITY % equation.attlist "INCLUDE">
+<![%equation.attlist;[
+<!ATTLIST equation
+		floatstyle	CDATA			#IMPLIED
+		%label.attrib;
+	 	%common.attrib;
+		%equation.role.attrib;
+		%local.equation.attrib;
+>
+<!--end of equation.attlist-->]]>
+<!--end of equation.module-->]]>
+
+<!ENTITY % informalequation.module "INCLUDE">
+<![%informalequation.module;[
+<!ENTITY % local.informalequation.attrib "">
+<!ENTITY % informalequation.role.attrib "%role.attrib;">
+
+<!ENTITY % informalequation.element "INCLUDE">
+<![%informalequation.element;[
+<!--doc:A displayed mathematical equation without a title.-->
+<!ELEMENT informalequation %ho; (blockinfo?, %equation.content;) >
+<!--end of informalequation.element-->]]>
+
+<!ENTITY % informalequation.attlist "INCLUDE">
+<![%informalequation.attlist;[
+<!ATTLIST informalequation
+		floatstyle	CDATA			#IMPLIED
+		%common.attrib;
+		%informalequation.role.attrib;
+		%local.informalequation.attrib;
+>
+<!--end of informalequation.attlist-->]]>
+<!--end of informalequation.module-->]]>
+
+<!ENTITY % inlineequation.module "INCLUDE">
+<![%inlineequation.module;[
+<!ENTITY % local.inlineequation.attrib "">
+<!ENTITY % inlineequation.role.attrib "%role.attrib;">
+
+<!ENTITY % inlineequation.element "INCLUDE">
+<![%inlineequation.element;[
+<!--doc:A mathematical equation or expression occurring inline.-->
+<!ELEMENT inlineequation %ho; (%inlineequation.content;)>
+<!--end of inlineequation.element-->]]>
+
+<!ENTITY % inlineequation.attlist "INCLUDE">
+<![%inlineequation.attlist;[
+<!ATTLIST inlineequation
+		%common.attrib;
+		%inlineequation.role.attrib;
+		%local.inlineequation.attrib;
+>
+<!--end of inlineequation.attlist-->]]>
+<!--end of inlineequation.module-->]]>
+
+<!ENTITY % alt.module "INCLUDE">
+<![%alt.module;[
+<!ENTITY % local.alt.attrib "">
+<!ENTITY % alt.role.attrib "%role.attrib;">
+
+<!ENTITY % alt.element "INCLUDE">
+<![%alt.element;[
+<!--doc:Text representation for a graphical element.-->
+<!ELEMENT alt %ho; (#PCDATA)>
+<!--end of alt.element-->]]>
+
+<!ENTITY % alt.attlist "INCLUDE">
+<![%alt.attlist;[
+<!ATTLIST alt
+		%common.attrib;
+		%alt.role.attrib;
+		%local.alt.attrib;
+>
+<!--end of alt.attlist-->]]>
+<!--end of alt.module-->]]>
+
+<!ENTITY % mathphrase.module "INCLUDE">
+<![%mathphrase.module;[
+<!ENTITY % local.mathphrase.attrib "">
+<!ENTITY % mathphrase.role.attrib "%role.attrib;">
+
+<!ENTITY % mathphrase.element "INCLUDE">
+<![%mathphrase.element;[
+<!--doc:A mathematical phrase, an expression that can be represented with ordinary text and a small amount of markup.-->
+<!ELEMENT mathphrase %ho; (#PCDATA|subscript|superscript|emphasis)*>
+<!--end of mathphrase.element-->]]>
+
+<!ENTITY % mathphrase.attlist "INCLUDE">
+<![%mathphrase.attlist;[
+<!ATTLIST mathphrase
+		%common.attrib;
+		%mathphrase.role.attrib;
+		%local.mathphrase.attrib;
+>
+<!--end of mathphrase.attlist-->]]>
+<!--end of mathphrase.module-->]]>
+
+<!-- Tables ........................... -->
+
+<!ENTITY % table.module "INCLUDE">
+<![%table.module;[
+
+<!-- Choose a table model. CALS or OASIS XML Exchange -->
+
+<!ENTITY % cals.table.module "INCLUDE">
+<![%cals.table.module;[
+<!ENTITY % exchange.table.module "IGNORE">
+]]>
+<!ENTITY % exchange.table.module "INCLUDE">
+
+<!-- Do we allow the HTML table model as well? -->
+<!ENTITY % allow.html.tables "INCLUDE">
+<![%allow.html.tables;[
+  <!-- ====================================================== -->
+  <!--  xhtmltbl.mod defines HTML tables and sets parameter
+        entities so that, when the CALS table module is read,
+        we end up allowing any table to be CALS or HTML.
+        i.e. This include must come first!                    -->
+  <!-- ====================================================== -->
+
+<!ENTITY % htmltbl
+  PUBLIC "-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN"
+  "htmltblx.mod">
+%htmltbl;
+<!--end of allow.html.tables-->]]>
+
+<!ENTITY % tables.role.attrib "%role.attrib;">
+
+<![%cals.table.module;[
+<!-- Add label and role attributes to table and informaltable -->
+<!ENTITY % bodyatt "
+		floatstyle	CDATA			#IMPLIED
+		rowheader	(firstcol|norowheader)	#IMPLIED
+                %label.attrib;"
+>
+
+<!-- Add common attributes to Table, TGroup, TBody, THead, TFoot, Row,
+     EntryTbl, and Entry (and InformalTable element). -->
+<!ENTITY % secur
+	"%common.attrib;
+	%tables.role.attrib;">
+
+<!ENTITY % common.table.attribs
+	"%bodyatt;
+	%secur;">
+
+<!-- Content model for Table. -->
+<!ENTITY % tbl.table.mdl
+	"(blockinfo?, (%formalobject.title.content;), (%ndxterm.class;)*,
+	  textobject*,
+          (graphic+|mediaobject+|tgroup+))">
+
+<!-- Allow either objects or inlines; beware of REs between elements. -->
+<!ENTITY % tbl.entry.mdl "%para.char.mix; | %tabentry.mix;">
+
+<!-- Reference CALS Table Model -->
+<!ENTITY % tablemodel
+  PUBLIC "-//OASIS//DTD DocBook CALS Table Model V4.5//EN"
+  "calstblx.dtd">
+]]>
+
+<![%exchange.table.module;[
+<!-- Add common attributes and the Label attribute to Table and -->
+<!-- InformalTable.                                             -->
+<!ENTITY % bodyatt
+	"%common.attrib;
+	rowheader	(firstcol|norowheader)	#IMPLIED
+	%label.attrib;
+	%tables.role.attrib;">
+
+<!ENTITY % common.table.attribs
+	"%bodyatt;">
+
+<!-- Add common attributes to TGroup, ColSpec, TBody, THead, Row, Entry -->
+
+<!ENTITY % tbl.tgroup.att       "%common.attrib;">
+<!ENTITY % tbl.colspec.att      "%common.attrib;">
+<!ENTITY % tbl.tbody.att        "%common.attrib;">
+<!ENTITY % tbl.thead.att        "%common.attrib;">
+<!ENTITY % tbl.row.att          "%common.attrib;">
+<!ENTITY % tbl.entry.att        "%common.attrib;">
+
+<!-- Content model for Table. -->
+<!ENTITY % tbl.table.mdl
+	"(blockinfo?, (%formalobject.title.content;), (%ndxterm.class;)*,
+	  textobject*,
+          (graphic+|mediaobject+|tgroup+))">
+
+<!-- Allow either objects or inlines; beware of REs between elements. -->
+<!ENTITY % tbl.entry.mdl "(%para.char.mix; | %tabentry.mix;)*">
+
+<!-- Reference OASIS Exchange Table Model -->
+<!ENTITY % tablemodel
+  PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN"
+  "soextblx.dtd">
+]]>
+
+%tablemodel;
+
+<!--end of table.module-->]]>
+
+<!ENTITY % informaltable.module "INCLUDE">
+<![%informaltable.module;[
+
+<!-- Note that InformalTable is dependent on some of the entity
+     declarations that customize Table. -->
+
+<!ENTITY % local.informaltable.attrib "">
+
+<!-- the following entity may have been declared by the XHTML table module -->
+<!ENTITY % informal.tbl.table.mdl "textobject*, (graphic+|mediaobject+|tgroup+)">
+
+<!ENTITY % informaltable.element "INCLUDE">
+<![%informaltable.element;[
+<!--doc:A table without a title.-->
+<!ELEMENT informaltable %ho; (blockinfo?, (%informal.tbl.table.mdl;))>
+<!--end of informaltable.element-->]]>
+
+<!-- Frame, Colsep, and Rowsep must be repeated because
+		they are not in entities in the table module. -->
+<!-- includes TabStyle, ToCentry, ShortEntry,
+				Orient, PgWide -->
+<!-- includes Label -->
+<!-- includes common attributes -->
+
+<!ENTITY % informaltable.attlist "INCLUDE">
+<![%informaltable.attlist;[
+<!ATTLIST informaltable
+		frame		(%tbl.frame.attval;)	#IMPLIED
+		colsep		%yesorno.attvals;	#IMPLIED
+		rowsep		%yesorno.attvals;	#IMPLIED
+		%common.table.attribs;
+		%tbl.table.att;
+		%local.informaltable.attrib;
+>
+<!--end of informaltable.attlist-->]]>
+<!--end of informaltable.module-->]]>
+
+<!ENTITY % caption.module "INCLUDE">
+<![ %caption.module; [
+<!ENTITY % local.caption.attrib "">
+<!ENTITY % caption.role.attrib "%role.attrib;">
+
+<!ENTITY % caption.element "INCLUDE">
+<![ %caption.element; [
+<!--doc:A caption.-->
+<!ELEMENT caption %ho; (#PCDATA | %textobject.mix;)*>
+<!--end of caption.element-->]]>
+
+<!ENTITY % caption.attlist "INCLUDE">
+<![ %caption.attlist; [
+<!-- attrs comes from HTML tables ... -->
+
+<![ %allow.html.tables; [
+<!-- common.attrib, but without ID because ID is in attrs -->
+<!ENTITY % caption.attlist.content "
+		%caption.role.attrib;
+		%attrs;
+		align	(top|bottom|left|right)	#IMPLIED
+		%local.caption.attrib;
+">
+]]>
+<!ENTITY % caption.attlist.content "
+		%common.attrib;
+		%caption.role.attrib;
+		%local.caption.attrib;
+">
+
+<!ATTLIST caption %caption.attlist.content;>
+
+<!--end of caption.attlist-->]]>
+<!--end of caption.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Synopses ............................................................. -->
+
+<!-- Synopsis ......................... -->
+
+<!ENTITY % synopsis.module "INCLUDE">
+<![%synopsis.module;[
+<!ENTITY % local.synopsis.attrib "">
+<!ENTITY % synopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % synopsis.element "INCLUDE">
+<![%synopsis.element;[
+<!--doc:A general-purpose element for representing the syntax of commands or functions.-->
+<!ELEMENT synopsis %ho; (%para.char.mix;|graphic|mediaobject|co|coref|textobject|lineannotation)*>
+<!--end of synopsis.element-->]]>
+
+<!ENTITY % synopsis.attlist "INCLUDE">
+<![%synopsis.attlist;[
+<!ATTLIST synopsis
+		%label.attrib;
+		%linespecific.attrib;
+		%common.attrib;
+		%synopsis.role.attrib;
+		%local.synopsis.attrib;
+>
+<!--end of synopsis.attlist-->]]>
+
+<!-- LineAnnotation (defined in the Inlines section, below)-->
+<!--end of synopsis.module-->]]>
+
+<!-- CmdSynopsis ...................... -->
+
+<!ENTITY % cmdsynopsis.content.module "INCLUDE">
+<![%cmdsynopsis.content.module;[
+<!ENTITY % cmdsynopsis.module "INCLUDE">
+<![%cmdsynopsis.module;[
+<!ENTITY % local.cmdsynopsis.attrib "">
+<!ENTITY % cmdsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % cmdsynopsis.element "INCLUDE">
+<![%cmdsynopsis.element;[
+<!--doc:A syntax summary for a software command.-->
+<!ELEMENT cmdsynopsis %ho; ((command | arg | group | sbr)+, synopfragment*)>
+<!--end of cmdsynopsis.element-->]]>
+
+<!-- Sepchar: Character that should separate command and all
+		top-level arguments; alternate value might be e.g., &Delta; -->
+
+
+<!ENTITY % cmdsynopsis.attlist "INCLUDE">
+<![%cmdsynopsis.attlist;[
+<!ATTLIST cmdsynopsis
+		%label.attrib;
+		sepchar		CDATA		" "
+		cmdlength	CDATA		#IMPLIED
+		%common.attrib;
+		%cmdsynopsis.role.attrib;
+		%local.cmdsynopsis.attrib;
+>
+<!--end of cmdsynopsis.attlist-->]]>
+<!--end of cmdsynopsis.module-->]]>
+
+<!ENTITY % arg.module "INCLUDE">
+<![%arg.module;[
+<!ENTITY % local.arg.attrib "">
+<!ENTITY % arg.role.attrib "%role.attrib;">
+
+<!ENTITY % arg.element "INCLUDE">
+<![%arg.element;[
+<!--doc:An argument in a CmdSynopsis.-->
+<!ELEMENT arg %ho; (#PCDATA
+		| arg
+		| group
+		| option
+		| synopfragmentref
+		| replaceable
+		| sbr)*>
+<!--end of arg.element-->]]>
+
+<!-- Choice: Whether Arg must be supplied: Opt (optional to
+		supply, e.g. [arg]; the default), Req (required to supply,
+		e.g. {arg}), or Plain (required to supply, e.g. arg) -->
+<!-- Rep: whether Arg is repeatable: Norepeat (e.g. arg without
+		ellipsis; the default), or Repeat (e.g. arg...) -->
+
+
+<!ENTITY % arg.attlist "INCLUDE">
+<![%arg.attlist;[
+<!ATTLIST arg
+		choice		(opt
+				|req
+				|plain)		'opt'
+		rep		(norepeat
+				|repeat)	'norepeat'
+		%common.attrib;
+		%arg.role.attrib;
+		%local.arg.attrib;
+>
+<!--end of arg.attlist-->]]>
+<!--end of arg.module-->]]>
+
+<!ENTITY % group.module "INCLUDE">
+<![%group.module;[
+
+<!ENTITY % local.group.attrib "">
+<!ENTITY % group.role.attrib "%role.attrib;">
+
+<!ENTITY % group.element "INCLUDE">
+<![%group.element;[
+<!--doc:A group of elements in a CmdSynopsis.-->
+<!ELEMENT group %ho; ((arg | group | option | synopfragmentref
+		| replaceable | sbr)+)>
+<!--end of group.element-->]]>
+
+<!-- Choice: Whether Group must be supplied: Opt (optional to
+		supply, e.g.  [g1|g2|g3]; the default), Req (required to
+		supply, e.g.  {g1|g2|g3}), Plain (required to supply,
+		e.g.  g1|g2|g3), OptMult (can supply zero or more, e.g.
+		[[g1|g2|g3]]), or ReqMult (must supply one or more, e.g.
+		{{g1|g2|g3}}) -->
+<!-- Rep: whether Group is repeatable: Norepeat (e.g. group
+		without ellipsis; the default), or Repeat (e.g. group...) -->
+
+
+<!ENTITY % group.attlist "INCLUDE">
+<![%group.attlist;[
+<!ATTLIST group
+		choice		(opt
+				|req
+				|plain)         'opt'
+		rep		(norepeat
+				|repeat)	'norepeat'
+		%common.attrib;
+		%group.role.attrib;
+		%local.group.attrib;
+>
+<!--end of group.attlist-->]]>
+<!--end of group.module-->]]>
+
+<!ENTITY % sbr.module "INCLUDE">
+<![%sbr.module;[
+<!ENTITY % local.sbr.attrib "">
+<!-- Synopsis break -->
+<!ENTITY % sbr.role.attrib "%role.attrib;">
+
+<!ENTITY % sbr.element "INCLUDE">
+<![%sbr.element;[
+<!--doc:An explicit line break in a command synopsis.-->
+<!ELEMENT sbr %ho; EMPTY>
+<!--end of sbr.element-->]]>
+
+<!ENTITY % sbr.attlist "INCLUDE">
+<![%sbr.attlist;[
+<!ATTLIST sbr
+		%common.attrib;
+		%sbr.role.attrib;
+		%local.sbr.attrib;
+>
+<!--end of sbr.attlist-->]]>
+<!--end of sbr.module-->]]>
+
+<!ENTITY % synopfragmentref.module "INCLUDE">
+<![%synopfragmentref.module;[
+<!ENTITY % local.synopfragmentref.attrib "">
+<!ENTITY % synopfragmentref.role.attrib "%role.attrib;">
+
+<!ENTITY % synopfragmentref.element "INCLUDE">
+<![%synopfragmentref.element;[
+<!--doc:A reference to a fragment of a command synopsis.-->
+<!ELEMENT synopfragmentref %ho; (#PCDATA)>
+<!--end of synopfragmentref.element-->]]>
+
+<!-- to SynopFragment of complex synopsis
+			material for separate referencing -->
+
+
+<!ENTITY % synopfragmentref.attlist "INCLUDE">
+<![%synopfragmentref.attlist;[
+<!ATTLIST synopfragmentref
+		%linkendreq.attrib;		%common.attrib;
+		%synopfragmentref.role.attrib;
+		%local.synopfragmentref.attrib;
+>
+<!--end of synopfragmentref.attlist-->]]>
+<!--end of synopfragmentref.module-->]]>
+
+<!ENTITY % synopfragment.module "INCLUDE">
+<![%synopfragment.module;[
+<!ENTITY % local.synopfragment.attrib "">
+<!ENTITY % synopfragment.role.attrib "%role.attrib;">
+
+<!ENTITY % synopfragment.element "INCLUDE">
+<![%synopfragment.element;[
+<!--doc:A portion of a CmdSynopsis broken out from the main body of the synopsis.-->
+<!ELEMENT synopfragment %ho; ((arg | group)+)>
+<!--end of synopfragment.element-->]]>
+
+<!ENTITY % synopfragment.attlist "INCLUDE">
+<![%synopfragment.attlist;[
+<!ATTLIST synopfragment
+		%idreq.common.attrib;
+		%synopfragment.role.attrib;
+		%local.synopfragment.attrib;
+>
+<!--end of synopfragment.attlist-->]]>
+<!--end of synopfragment.module-->]]>
+
+<!-- Command (defined in the Inlines section, below)-->
+<!-- Option (defined in the Inlines section, below)-->
+<!-- Replaceable (defined in the Inlines section, below)-->
+<!--end of cmdsynopsis.content.module-->]]>
+
+<!-- FuncSynopsis ..................... -->
+
+<!ENTITY % funcsynopsis.content.module "INCLUDE">
+<![%funcsynopsis.content.module;[
+<!ENTITY % funcsynopsis.module "INCLUDE">
+<![%funcsynopsis.module;[
+
+<!ENTITY % local.funcsynopsis.attrib "">
+<!ENTITY % funcsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % funcsynopsis.element "INCLUDE">
+<![%funcsynopsis.element;[
+<!--doc:The syntax summary for a function definition.-->
+<!ELEMENT funcsynopsis %ho; ((funcsynopsisinfo | funcprototype)+)>
+<!--end of funcsynopsis.element-->]]>
+
+<!ENTITY % funcsynopsis.attlist "INCLUDE">
+<![%funcsynopsis.attlist;[
+<!ATTLIST funcsynopsis
+		%label.attrib;
+		%common.attrib;
+		%funcsynopsis.role.attrib;
+		%local.funcsynopsis.attrib;
+>
+<!--end of funcsynopsis.attlist-->]]>
+<!--end of funcsynopsis.module-->]]>
+
+<!ENTITY % funcsynopsisinfo.module "INCLUDE">
+<![%funcsynopsisinfo.module;[
+<!ENTITY % local.funcsynopsisinfo.attrib "">
+<!ENTITY % funcsynopsisinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % funcsynopsisinfo.element "INCLUDE">
+<![%funcsynopsisinfo.element;[
+<!--doc:Information supplementing the FuncDefs of a FuncSynopsis.-->
+<!ELEMENT funcsynopsisinfo %ho; (%cptr.char.mix;|textobject|lineannotation)*>
+<!--end of funcsynopsisinfo.element-->]]>
+
+<!ENTITY % funcsynopsisinfo.attlist "INCLUDE">
+<![%funcsynopsisinfo.attlist;[
+<!ATTLIST funcsynopsisinfo
+		%linespecific.attrib;
+		%common.attrib;
+		%funcsynopsisinfo.role.attrib;
+		%local.funcsynopsisinfo.attrib;
+>
+<!--end of funcsynopsisinfo.attlist-->]]>
+<!--end of funcsynopsisinfo.module-->]]>
+
+<!ENTITY % funcprototype.module "INCLUDE">
+<![%funcprototype.module;[
+<!ENTITY % local.funcprototype.attrib "">
+<!ENTITY % funcprototype.role.attrib "%role.attrib;">
+
+<!ENTITY % funcprototype.element "INCLUDE">
+<![%funcprototype.element;[
+<!--doc:The prototype of a function.-->
+<!ELEMENT funcprototype %ho; (modifier*,
+                              funcdef,
+                              (void|varargs|(paramdef+, varargs?)),
+                              modifier*)>
+
+<!--end of funcprototype.element-->]]>
+
+<!ENTITY % funcprototype.attlist "INCLUDE">
+<![%funcprototype.attlist;[
+<!ATTLIST funcprototype
+		%common.attrib;
+		%funcprototype.role.attrib;
+		%local.funcprototype.attrib;
+>
+<!--end of funcprototype.attlist-->]]>
+<!--end of funcprototype.module-->]]>
+
+<!ENTITY % funcdef.module "INCLUDE">
+<![%funcdef.module;[
+<!ENTITY % local.funcdef.attrib "">
+<!ENTITY % funcdef.role.attrib "%role.attrib;">
+
+<!ENTITY % funcdef.element "INCLUDE">
+<![%funcdef.element;[
+<!--doc:A function (subroutine) name and its return type.-->
+<!ELEMENT funcdef %ho; (#PCDATA
+		| type
+		| replaceable
+		| function)*>
+<!--end of funcdef.element-->]]>
+
+<!ENTITY % funcdef.attlist "INCLUDE">
+<![%funcdef.attlist;[
+<!ATTLIST funcdef
+		%common.attrib;
+		%funcdef.role.attrib;
+		%local.funcdef.attrib;
+>
+<!--end of funcdef.attlist-->]]>
+<!--end of funcdef.module-->]]>
+
+<!ENTITY % void.module "INCLUDE">
+<![%void.module;[
+<!ENTITY % local.void.attrib "">
+<!ENTITY % void.role.attrib "%role.attrib;">
+
+<!ENTITY % void.element "INCLUDE">
+<![%void.element;[
+<!--doc:An empty element in a function synopsis indicating that the function in question takes no arguments.-->
+<!ELEMENT void %ho; EMPTY>
+<!--end of void.element-->]]>
+
+<!ENTITY % void.attlist "INCLUDE">
+<![%void.attlist;[
+<!ATTLIST void
+		%common.attrib;
+		%void.role.attrib;
+		%local.void.attrib;
+>
+<!--end of void.attlist-->]]>
+<!--end of void.module-->]]>
+
+<!ENTITY % varargs.module "INCLUDE">
+<![%varargs.module;[
+<!ENTITY % local.varargs.attrib "">
+<!ENTITY % varargs.role.attrib "%role.attrib;">
+
+<!ENTITY % varargs.element "INCLUDE">
+<![%varargs.element;[
+<!--doc:An empty element in a function synopsis indicating a variable number of arguments.-->
+<!ELEMENT varargs %ho; EMPTY>
+<!--end of varargs.element-->]]>
+
+<!ENTITY % varargs.attlist "INCLUDE">
+<![%varargs.attlist;[
+<!ATTLIST varargs
+		%common.attrib;
+		%varargs.role.attrib;
+		%local.varargs.attrib;
+>
+<!--end of varargs.attlist-->]]>
+<!--end of varargs.module-->]]>
+
+<!-- Processing assumes that only one Parameter will appear in a
+     ParamDef, and that FuncParams will be used at most once, for
+     providing information on the "inner parameters" for parameters that
+     are pointers to functions. -->
+
+<!ENTITY % paramdef.module "INCLUDE">
+<![%paramdef.module;[
+<!ENTITY % local.paramdef.attrib "">
+<!ENTITY % paramdef.role.attrib "%role.attrib;">
+
+<!ENTITY % paramdef.element "INCLUDE">
+<![%paramdef.element;[
+<!--doc:Information about a function parameter in a programming language.-->
+<!ELEMENT paramdef %ho; (#PCDATA
+                | initializer
+		| type
+		| replaceable
+		| parameter
+		| funcparams)*>
+<!--end of paramdef.element-->]]>
+
+<!ENTITY % paramdef.attlist "INCLUDE">
+<![%paramdef.attlist;[
+<!ATTLIST paramdef
+		choice		(opt
+				|req)	#IMPLIED
+		%common.attrib;
+		%paramdef.role.attrib;
+		%local.paramdef.attrib;
+>
+<!--end of paramdef.attlist-->]]>
+<!--end of paramdef.module-->]]>
+
+<!ENTITY % funcparams.module "INCLUDE">
+<![%funcparams.module;[
+<!ENTITY % local.funcparams.attrib "">
+<!ENTITY % funcparams.role.attrib "%role.attrib;">
+
+<!ENTITY % funcparams.element "INCLUDE">
+<![%funcparams.element;[
+<!--doc:Parameters for a function referenced through a function pointer in a synopsis.-->
+<!ELEMENT funcparams %ho; (%cptr.char.mix;)*>
+<!--end of funcparams.element-->]]>
+
+<!ENTITY % funcparams.attlist "INCLUDE">
+<![%funcparams.attlist;[
+<!ATTLIST funcparams
+		%common.attrib;
+		%funcparams.role.attrib;
+		%local.funcparams.attrib;
+>
+<!--end of funcparams.attlist-->]]>
+<!--end of funcparams.module-->]]>
+
+<!-- LineAnnotation (defined in the Inlines section, below)-->
+<!-- Replaceable (defined in the Inlines section, below)-->
+<!-- Function (defined in the Inlines section, below)-->
+<!-- Parameter (defined in the Inlines section, below)-->
+<!--end of funcsynopsis.content.module-->]]>
+
+<!-- ClassSynopsis ..................... -->
+
+<!ENTITY % classsynopsis.content.module "INCLUDE">
+<![%classsynopsis.content.module;[
+
+<!ENTITY % classsynopsis.module "INCLUDE">
+<![%classsynopsis.module;[
+<!ENTITY % local.classsynopsis.attrib "">
+<!ENTITY % classsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % classsynopsis.element "INCLUDE">
+<![%classsynopsis.element;[
+<!--doc:The syntax summary for a class definition.-->
+<!ELEMENT classsynopsis %ho; ((ooclass|oointerface|ooexception)+,
+                         (classsynopsisinfo
+                          |fieldsynopsis|%method.synop.class;)*)>
+<!--end of classsynopsis.element-->]]>
+
+<!ENTITY % classsynopsis.attlist "INCLUDE">
+<![%classsynopsis.attlist;[
+<!ATTLIST classsynopsis
+	language	CDATA	#IMPLIED
+	class	(class|interface)	"class"
+	%common.attrib;
+	%classsynopsis.role.attrib;
+	%local.classsynopsis.attrib;
+>
+<!--end of classsynopsis.attlist-->]]>
+<!--end of classsynopsis.module-->]]>
+
+<!ENTITY % classsynopsisinfo.module "INCLUDE">
+<![ %classsynopsisinfo.module; [
+<!ENTITY % local.classsynopsisinfo.attrib "">
+<!ENTITY % classsynopsisinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % classsynopsisinfo.element "INCLUDE">
+<![ %classsynopsisinfo.element; [
+<!--doc:Information supplementing the contents of a ClassSynopsis.-->
+<!ELEMENT classsynopsisinfo %ho; (%cptr.char.mix;|textobject|lineannotation)*>
+<!--end of classsynopsisinfo.element-->]]>
+
+<!ENTITY % classsynopsisinfo.attlist "INCLUDE">
+<![ %classsynopsisinfo.attlist; [
+<!ATTLIST classsynopsisinfo
+		%linespecific.attrib;
+		%common.attrib;
+		%classsynopsisinfo.role.attrib;
+		%local.classsynopsisinfo.attrib;
+>
+<!--end of classsynopsisinfo.attlist-->]]>
+<!--end of classsynopsisinfo.module-->]]>
+
+<!ENTITY % ooclass.module "INCLUDE">
+<![%ooclass.module;[
+<!ENTITY % local.ooclass.attrib "">
+<!ENTITY % ooclass.role.attrib "%role.attrib;">
+
+<!ENTITY % ooclass.element "INCLUDE">
+<![%ooclass.element;[
+<!--doc:A class in an object-oriented programming language.-->
+<!ELEMENT ooclass %ho; ((modifier|package)*, classname)>
+<!--end of ooclass.element-->]]>
+
+<!ENTITY % ooclass.attlist "INCLUDE">
+<![%ooclass.attlist;[
+<!ATTLIST ooclass
+	%common.attrib;
+	%ooclass.role.attrib;
+	%local.ooclass.attrib;
+>
+<!--end of ooclass.attlist-->]]>
+<!--end of ooclass.module-->]]>
+
+<!ENTITY % oointerface.module "INCLUDE">
+<![%oointerface.module;[
+<!ENTITY % local.oointerface.attrib "">
+<!ENTITY % oointerface.role.attrib "%role.attrib;">
+
+<!ENTITY % oointerface.element "INCLUDE">
+<![%oointerface.element;[
+<!--doc:An interface in an object-oriented programming language.-->
+<!ELEMENT oointerface %ho; ((modifier|package)*, interfacename)>
+<!--end of oointerface.element-->]]>
+
+<!ENTITY % oointerface.attlist "INCLUDE">
+<![%oointerface.attlist;[
+<!ATTLIST oointerface
+	%common.attrib;
+	%oointerface.role.attrib;
+	%local.oointerface.attrib;
+>
+<!--end of oointerface.attlist-->]]>
+<!--end of oointerface.module-->]]>
+
+<!ENTITY % ooexception.module "INCLUDE">
+<![%ooexception.module;[
+<!ENTITY % local.ooexception.attrib "">
+<!ENTITY % ooexception.role.attrib "%role.attrib;">
+
+<!ENTITY % ooexception.element "INCLUDE">
+<![%ooexception.element;[
+<!--doc:An exception in an object-oriented programming language.-->
+<!ELEMENT ooexception %ho; ((modifier|package)*, exceptionname)>
+<!--end of ooexception.element-->]]>
+
+<!ENTITY % ooexception.attlist "INCLUDE">
+<![%ooexception.attlist;[
+<!ATTLIST ooexception
+	%common.attrib;
+	%ooexception.role.attrib;
+	%local.ooexception.attrib;
+>
+<!--end of ooexception.attlist-->]]>
+<!--end of ooexception.module-->]]>
+
+<!ENTITY % modifier.module "INCLUDE">
+<![%modifier.module;[
+<!ENTITY % local.modifier.attrib "">
+<!ENTITY % modifier.role.attrib "%role.attrib;">
+
+<!ENTITY % modifier.element "INCLUDE">
+<![%modifier.element;[
+<!--doc:Modifiers in a synopsis.-->
+<!ELEMENT modifier %ho; (%smallcptr.char.mix;)*>
+<!--end of modifier.element-->]]>
+
+<!ENTITY % modifier.attlist "INCLUDE">
+<![%modifier.attlist;[
+<!ATTLIST modifier
+	%common.attrib;
+	%modifier.role.attrib;
+	%local.modifier.attrib;
+>
+<!--end of modifier.attlist-->]]>
+<!--end of modifier.module-->]]>
+
+<!ENTITY % interfacename.module "INCLUDE">
+<![%interfacename.module;[
+<!ENTITY % local.interfacename.attrib "">
+<!ENTITY % interfacename.role.attrib "%role.attrib;">
+
+<!ENTITY % interfacename.element "INCLUDE">
+<![%interfacename.element;[
+<!--doc:The name of an interface.-->
+<!ELEMENT interfacename %ho; (%cptr.char.mix;)*>
+<!--end of interfacename.element-->]]>
+
+<!ENTITY % interfacename.attlist "INCLUDE">
+<![%interfacename.attlist;[
+<!ATTLIST interfacename
+	%common.attrib;
+	%interfacename.role.attrib;
+	%local.interfacename.attrib;
+>
+<!--end of interfacename.attlist-->]]>
+<!--end of interfacename.module-->]]>
+
+<!ENTITY % exceptionname.module "INCLUDE">
+<![%exceptionname.module;[
+<!ENTITY % local.exceptionname.attrib "">
+<!ENTITY % exceptionname.role.attrib "%role.attrib;">
+
+<!ENTITY % exceptionname.element "INCLUDE">
+<![%exceptionname.element;[
+<!--doc:The name of an exception.-->
+<!ELEMENT exceptionname %ho; (%smallcptr.char.mix;)*>
+<!--end of exceptionname.element-->]]>
+
+<!ENTITY % exceptionname.attlist "INCLUDE">
+<![%exceptionname.attlist;[
+<!ATTLIST exceptionname
+	%common.attrib;
+	%exceptionname.role.attrib;
+	%local.exceptionname.attrib;
+>
+<!--end of exceptionname.attlist-->]]>
+<!--end of exceptionname.module-->]]>
+
+<!ENTITY % fieldsynopsis.module "INCLUDE">
+<![%fieldsynopsis.module;[
+<!ENTITY % local.fieldsynopsis.attrib "">
+<!ENTITY % fieldsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % fieldsynopsis.element "INCLUDE">
+<![%fieldsynopsis.element;[
+<!--doc:The name of a field in a class definition.-->
+<!ELEMENT fieldsynopsis %ho; (modifier*, type?, varname, initializer?)>
+<!--end of fieldsynopsis.element-->]]>
+
+<!ENTITY % fieldsynopsis.attlist "INCLUDE">
+<![%fieldsynopsis.attlist;[
+<!ATTLIST fieldsynopsis
+	language	CDATA	#IMPLIED
+	%common.attrib;
+	%fieldsynopsis.role.attrib;
+	%local.fieldsynopsis.attrib;
+>
+<!--end of fieldsynopsis.attlist-->]]>
+<!--end of fieldsynopsis.module-->]]>
+
+<!ENTITY % initializer.module "INCLUDE">
+<![%initializer.module;[
+<!ENTITY % local.initializer.attrib "">
+<!ENTITY % initializer.role.attrib "%role.attrib;">
+
+<!ENTITY % initializer.element "INCLUDE">
+<![%initializer.element;[
+<!--doc:The initializer for a FieldSynopsis.-->
+<!ELEMENT initializer %ho; (%smallcptr.char.mix;)*>
+<!--end of initializer.element-->]]>
+
+<!ENTITY % initializer.attlist "INCLUDE">
+<![%initializer.attlist;[
+<!ATTLIST initializer
+	%common.attrib;
+	%initializer.role.attrib;
+	%local.initializer.attrib;
+>
+<!--end of initializer.attlist-->]]>
+<!--end of initializer.module-->]]>
+
+<!ENTITY % constructorsynopsis.module "INCLUDE">
+<![%constructorsynopsis.module;[
+<!ENTITY % local.constructorsynopsis.attrib "">
+<!ENTITY % constructorsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % constructorsynopsis.element "INCLUDE">
+<![%constructorsynopsis.element;[
+<!--doc:A syntax summary for a constructor.-->
+<!ELEMENT constructorsynopsis %ho; (modifier*,
+                               methodname?,
+                               (methodparam+|void?),
+                               exceptionname*)>
+<!--end of constructorsynopsis.element-->]]>
+
+<!ENTITY % constructorsynopsis.attlist "INCLUDE">
+<![%constructorsynopsis.attlist;[
+<!ATTLIST constructorsynopsis
+	language	CDATA	#IMPLIED
+	%common.attrib;
+	%constructorsynopsis.role.attrib;
+	%local.constructorsynopsis.attrib;
+>
+<!--end of constructorsynopsis.attlist-->]]>
+<!--end of constructorsynopsis.module-->]]>
+
+<!ENTITY % destructorsynopsis.module "INCLUDE">
+<![%destructorsynopsis.module;[
+<!ENTITY % local.destructorsynopsis.attrib "">
+<!ENTITY % destructorsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % destructorsynopsis.element "INCLUDE">
+<![%destructorsynopsis.element;[
+<!--doc:A syntax summary for a destructor.-->
+<!ELEMENT destructorsynopsis %ho; (modifier*,
+                              methodname?,
+                              (methodparam+|void?),
+                              exceptionname*)>
+<!--end of destructorsynopsis.element-->]]>
+
+<!ENTITY % destructorsynopsis.attlist "INCLUDE">
+<![%destructorsynopsis.attlist;[
+<!ATTLIST destructorsynopsis
+	language	CDATA	#IMPLIED
+	%common.attrib;
+	%destructorsynopsis.role.attrib;
+	%local.destructorsynopsis.attrib;
+>
+<!--end of destructorsynopsis.attlist-->]]>
+<!--end of destructorsynopsis.module-->]]>
+
+<!ENTITY % methodsynopsis.module "INCLUDE">
+<![%methodsynopsis.module;[
+<!ENTITY % local.methodsynopsis.attrib "">
+<!ENTITY % methodsynopsis.role.attrib "%role.attrib;">
+
+<!ENTITY % methodsynopsis.element "INCLUDE">
+<![%methodsynopsis.element;[
+<!--doc:A syntax summary for a method.-->
+<!ELEMENT methodsynopsis %ho; (modifier*,
+                          (type|void)?,
+                          methodname,
+                          (methodparam+|void?),
+                          exceptionname*,
+                          modifier*)>
+<!--end of methodsynopsis.element-->]]>
+
+<!ENTITY % methodsynopsis.attlist "INCLUDE">
+<![%methodsynopsis.attlist;[
+<!ATTLIST methodsynopsis
+	language	CDATA	#IMPLIED
+	%common.attrib;
+	%methodsynopsis.role.attrib;
+	%local.methodsynopsis.attrib;
+>
+<!--end of methodsynopsis.attlist-->]]>
+<!--end of methodsynopsis.module-->]]>
+
+<!ENTITY % methodname.module "INCLUDE">
+<![%methodname.module;[
+<!ENTITY % local.methodname.attrib "">
+<!ENTITY % methodname.role.attrib "%role.attrib;">
+
+<!ENTITY % methodname.element "INCLUDE">
+<![%methodname.element;[
+<!--doc:The name of a method.-->
+<!ELEMENT methodname %ho; (%smallcptr.char.mix;)*>
+<!--end of methodname.element-->]]>
+
+<!ENTITY % methodname.attlist "INCLUDE">
+<![%methodname.attlist;[
+<!ATTLIST methodname
+	%common.attrib;
+	%methodname.role.attrib;
+	%local.methodname.attrib;
+>
+<!--end of methodname.attlist-->]]>
+<!--end of methodname.module-->]]>
+
+<!ENTITY % methodparam.module "INCLUDE">
+<![%methodparam.module;[
+<!ENTITY % local.methodparam.attrib "">
+<!ENTITY % methodparam.role.attrib "%role.attrib;">
+
+<!ENTITY % methodparam.element "INCLUDE">
+<![%methodparam.element;[
+<!--doc:Parameters to a method.-->
+<!ELEMENT methodparam %ho; (modifier*,
+                       type?,
+                       ((parameter,initializer?)|funcparams),
+                       modifier*)>
+<!--end of methodparam.element-->]]>
+
+<!ENTITY % methodparam.attlist "INCLUDE">
+<![%methodparam.attlist;[
+<!ATTLIST methodparam
+	choice		(opt
+			|req
+			|plain)		"req"
+	rep		(norepeat
+			|repeat)	"norepeat"
+	%common.attrib;
+	%methodparam.role.attrib;
+	%local.methodparam.attrib;
+>
+<!--end of methodparam.attlist-->]]>
+<!--end of methodparam.module-->]]>
+<!--end of classsynopsis.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Document information entities and elements ........................... -->
+
+<!-- The document information elements include some elements that are
+     currently used only in the document hierarchy module. They are
+     defined here so that they will be available for use in customized
+     document hierarchies. -->
+
+<!-- .................................. -->
+
+<!ENTITY % docinfo.content.module "INCLUDE">
+<![%docinfo.content.module;[
+
+<!-- Ackno ............................ -->
+
+<!ENTITY % ackno.module "INCLUDE">
+<![%ackno.module;[
+<!ENTITY % local.ackno.attrib "">
+<!ENTITY % ackno.role.attrib "%role.attrib;">
+
+<!ENTITY % ackno.element "INCLUDE">
+<![%ackno.element;[
+<!--doc:Acknowledgements in an Article.-->
+<!ELEMENT ackno %ho; (%docinfo.char.mix;)*>
+<!--end of ackno.element-->]]>
+
+<!ENTITY % ackno.attlist "INCLUDE">
+<![%ackno.attlist;[
+<!ATTLIST ackno
+		%common.attrib;
+		%ackno.role.attrib;
+		%local.ackno.attrib;
+>
+<!--end of ackno.attlist-->]]>
+<!--end of ackno.module-->]]>
+
+<!-- Address .......................... -->
+
+<!ENTITY % address.content.module "INCLUDE">
+<![%address.content.module;[
+<!ENTITY % address.module "INCLUDE">
+<![%address.module;[
+<!ENTITY % local.address.attrib "">
+<!ENTITY % address.role.attrib "%role.attrib;">
+
+<!ENTITY % address.element "INCLUDE">
+<![%address.element;[
+<!--doc:A real-world address, generally a postal address.-->
+<!ELEMENT address %ho; (#PCDATA|personname|%person.ident.mix;
+		|street|pob|postcode|city|state|country|phone
+		|fax|email|otheraddr)*>
+<!--end of address.element-->]]>
+
+<!ENTITY % address.attlist "INCLUDE">
+<![%address.attlist;[
+<!ATTLIST address
+		%linespecific.attrib;
+		%common.attrib;
+		%address.role.attrib;
+		%local.address.attrib;
+>
+<!--end of address.attlist-->]]>
+<!--end of address.module-->]]>
+
+  <!ENTITY % street.module "INCLUDE">
+  <![%street.module;[
+ <!ENTITY % local.street.attrib "">
+  <!ENTITY % street.role.attrib "%role.attrib;">
+
+<!ENTITY % street.element "INCLUDE">
+<![%street.element;[
+<!--doc:A street address in an address.-->
+<!ELEMENT street %ho; (%docinfo.char.mix;)*>
+<!--end of street.element-->]]>
+
+<!ENTITY % street.attlist "INCLUDE">
+<![%street.attlist;[
+<!ATTLIST street
+		%common.attrib;
+		%street.role.attrib;
+		%local.street.attrib;
+>
+<!--end of street.attlist-->]]>
+  <!--end of street.module-->]]>
+
+  <!ENTITY % pob.module "INCLUDE">
+  <![%pob.module;[
+  <!ENTITY % local.pob.attrib "">
+  <!ENTITY % pob.role.attrib "%role.attrib;">
+
+<!ENTITY % pob.element "INCLUDE">
+<![%pob.element;[
+<!--doc:A post office box in an address.-->
+<!ELEMENT pob %ho; (%docinfo.char.mix;)*>
+<!--end of pob.element-->]]>
+
+<!ENTITY % pob.attlist "INCLUDE">
+<![%pob.attlist;[
+<!ATTLIST pob
+		%common.attrib;
+		%pob.role.attrib;
+		%local.pob.attrib;
+>
+<!--end of pob.attlist-->]]>
+  <!--end of pob.module-->]]>
+
+  <!ENTITY % postcode.module "INCLUDE">
+  <![%postcode.module;[
+  <!ENTITY % local.postcode.attrib "">
+  <!ENTITY % postcode.role.attrib "%role.attrib;">
+
+<!ENTITY % postcode.element "INCLUDE">
+<![%postcode.element;[
+<!--doc:A postal code in an address.-->
+<!ELEMENT postcode %ho; (%docinfo.char.mix;)*>
+<!--end of postcode.element-->]]>
+
+<!ENTITY % postcode.attlist "INCLUDE">
+<![%postcode.attlist;[
+<!ATTLIST postcode
+		%common.attrib;
+		%postcode.role.attrib;
+		%local.postcode.attrib;
+>
+<!--end of postcode.attlist-->]]>
+  <!--end of postcode.module-->]]>
+
+  <!ENTITY % city.module "INCLUDE">
+  <![%city.module;[
+  <!ENTITY % local.city.attrib "">
+  <!ENTITY % city.role.attrib "%role.attrib;">
+
+<!ENTITY % city.element "INCLUDE">
+<![%city.element;[
+<!--doc:The name of a city in an address.-->
+<!ELEMENT city %ho; (%docinfo.char.mix;)*>
+<!--end of city.element-->]]>
+
+<!ENTITY % city.attlist "INCLUDE">
+<![%city.attlist;[
+<!ATTLIST city
+		%common.attrib;
+		%city.role.attrib;
+		%local.city.attrib;
+>
+<!--end of city.attlist-->]]>
+  <!--end of city.module-->]]>
+
+  <!ENTITY % state.module "INCLUDE">
+  <![%state.module;[
+  <!ENTITY % local.state.attrib "">
+  <!ENTITY % state.role.attrib "%role.attrib;">
+
+<!ENTITY % state.element "INCLUDE">
+<![%state.element;[
+<!--doc:A state or province in an address.-->
+<!ELEMENT state %ho; (%docinfo.char.mix;)*>
+<!--end of state.element-->]]>
+
+<!ENTITY % state.attlist "INCLUDE">
+<![%state.attlist;[
+<!ATTLIST state
+		%common.attrib;
+		%state.role.attrib;
+		%local.state.attrib;
+>
+<!--end of state.attlist-->]]>
+  <!--end of state.module-->]]>
+
+  <!ENTITY % country.module "INCLUDE">
+  <![%country.module;[
+  <!ENTITY % local.country.attrib "">
+  <!ENTITY % country.role.attrib "%role.attrib;">
+
+<!ENTITY % country.element "INCLUDE">
+<![%country.element;[
+<!--doc:The name of a country.-->
+<!ELEMENT country %ho; (%docinfo.char.mix;)*>
+<!--end of country.element-->]]>
+
+<!ENTITY % country.attlist "INCLUDE">
+<![%country.attlist;[
+<!ATTLIST country
+		%common.attrib;
+		%country.role.attrib;
+		%local.country.attrib;
+>
+<!--end of country.attlist-->]]>
+  <!--end of country.module-->]]>
+
+  <!ENTITY % phone.module "INCLUDE">
+  <![%phone.module;[
+  <!ENTITY % local.phone.attrib "">
+  <!ENTITY % phone.role.attrib "%role.attrib;">
+
+<!ENTITY % phone.element "INCLUDE">
+<![%phone.element;[
+<!--doc:A telephone number.-->
+<!ELEMENT phone %ho; (%docinfo.char.mix;)*>
+<!--end of phone.element-->]]>
+
+<!ENTITY % phone.attlist "INCLUDE">
+<![%phone.attlist;[
+<!ATTLIST phone
+		%common.attrib;
+		%phone.role.attrib;
+		%local.phone.attrib;
+>
+<!--end of phone.attlist-->]]>
+  <!--end of phone.module-->]]>
+
+  <!ENTITY % fax.module "INCLUDE">
+  <![%fax.module;[
+  <!ENTITY % local.fax.attrib "">
+  <!ENTITY % fax.role.attrib "%role.attrib;">
+
+<!ENTITY % fax.element "INCLUDE">
+<![%fax.element;[
+<!--doc:A fax number.-->
+<!ELEMENT fax %ho; (%docinfo.char.mix;)*>
+<!--end of fax.element-->]]>
+
+<!ENTITY % fax.attlist "INCLUDE">
+<![%fax.attlist;[
+<!ATTLIST fax
+		%common.attrib;
+		%fax.role.attrib;
+		%local.fax.attrib;
+>
+<!--end of fax.attlist-->]]>
+  <!--end of fax.module-->]]>
+
+  <!-- Email (defined in the Inlines section, below)-->
+
+  <!ENTITY % otheraddr.module "INCLUDE">
+  <![%otheraddr.module;[
+  <!ENTITY % local.otheraddr.attrib "">
+  <!ENTITY % otheraddr.role.attrib "%role.attrib;">
+
+<!ENTITY % otheraddr.element "INCLUDE">
+<![%otheraddr.element;[
+<!--doc:Uncategorized information in address.-->
+<!ELEMENT otheraddr %ho; (%docinfo.char.mix;)*>
+<!--end of otheraddr.element-->]]>
+
+<!ENTITY % otheraddr.attlist "INCLUDE">
+<![%otheraddr.attlist;[
+<!ATTLIST otheraddr
+		%common.attrib;
+		%otheraddr.role.attrib;
+		%local.otheraddr.attrib;
+>
+<!--end of otheraddr.attlist-->]]>
+  <!--end of otheraddr.module-->]]>
+<!--end of address.content.module-->]]>
+
+<!-- Affiliation ...................... -->
+
+<!ENTITY % affiliation.content.module "INCLUDE">
+<![%affiliation.content.module;[
+<!ENTITY % affiliation.module "INCLUDE">
+<![%affiliation.module;[
+<!ENTITY % local.affiliation.attrib "">
+<!ENTITY % affiliation.role.attrib "%role.attrib;">
+
+<!ENTITY % affiliation.element "INCLUDE">
+<![%affiliation.element;[
+<!--doc:The institutional affiliation of an individual.-->
+<!ELEMENT affiliation %ho; (shortaffil?, jobtitle*, orgname?, orgdiv*,
+		address*)>
+<!--end of affiliation.element-->]]>
+
+<!ENTITY % affiliation.attlist "INCLUDE">
+<![%affiliation.attlist;[
+<!ATTLIST affiliation
+		%common.attrib;
+		%affiliation.role.attrib;
+		%local.affiliation.attrib;
+>
+<!--end of affiliation.attlist-->]]>
+<!--end of affiliation.module-->]]>
+
+  <!ENTITY % shortaffil.module "INCLUDE">
+  <![%shortaffil.module;[
+  <!ENTITY % local.shortaffil.attrib "">
+  <!ENTITY % shortaffil.role.attrib "%role.attrib;">
+
+<!ENTITY % shortaffil.element "INCLUDE">
+<![%shortaffil.element;[
+<!--doc:A brief description of an affiliation.-->
+<!ELEMENT shortaffil %ho; (%docinfo.char.mix;)*>
+<!--end of shortaffil.element-->]]>
+
+<!ENTITY % shortaffil.attlist "INCLUDE">
+<![%shortaffil.attlist;[
+<!ATTLIST shortaffil
+		%common.attrib;
+		%shortaffil.role.attrib;
+		%local.shortaffil.attrib;
+>
+<!--end of shortaffil.attlist-->]]>
+  <!--end of shortaffil.module-->]]>
+
+  <!ENTITY % jobtitle.module "INCLUDE">
+  <![%jobtitle.module;[
+  <!ENTITY % local.jobtitle.attrib "">
+  <!ENTITY % jobtitle.role.attrib "%role.attrib;">
+
+<!ENTITY % jobtitle.element "INCLUDE">
+<![%jobtitle.element;[
+<!--doc:The title of an individual in an organization.-->
+<!ELEMENT jobtitle %ho; (%docinfo.char.mix;)*>
+<!--end of jobtitle.element-->]]>
+
+<!ENTITY % jobtitle.attlist "INCLUDE">
+<![%jobtitle.attlist;[
+<!ATTLIST jobtitle
+		%common.attrib;
+		%jobtitle.role.attrib;
+		%local.jobtitle.attrib;
+>
+<!--end of jobtitle.attlist-->]]>
+  <!--end of jobtitle.module-->]]>
+
+  <!-- OrgName (defined elsewhere in this section)-->
+
+  <!ENTITY % orgdiv.module "INCLUDE">
+  <![%orgdiv.module;[
+  <!ENTITY % local.orgdiv.attrib "">
+  <!ENTITY % orgdiv.role.attrib "%role.attrib;">
+
+<!ENTITY % orgdiv.element "INCLUDE">
+<![%orgdiv.element;[
+<!--doc:A division of an organization.-->
+<!ELEMENT orgdiv %ho; (%docinfo.char.mix;)*>
+<!--end of orgdiv.element-->]]>
+
+<!ENTITY % orgdiv.attlist "INCLUDE">
+<![%orgdiv.attlist;[
+<!ATTLIST orgdiv
+		%common.attrib;
+		%orgdiv.role.attrib;
+		%local.orgdiv.attrib;
+>
+<!--end of orgdiv.attlist-->]]>
+  <!--end of orgdiv.module-->]]>
+
+  <!-- Address (defined elsewhere in this section)-->
+<!--end of affiliation.content.module-->]]>
+
+<!-- ArtPageNums ...................... -->
+
+<!ENTITY % artpagenums.module "INCLUDE">
+<![%artpagenums.module;[
+<!ENTITY % local.artpagenums.attrib "">
+<!ENTITY % artpagenums.role.attrib "%role.attrib;">
+
+<!ENTITY % artpagenums.element "INCLUDE">
+<![%artpagenums.element;[
+<!--doc:The page numbers of an article as published.-->
+<!ELEMENT artpagenums %ho; (%docinfo.char.mix;)*>
+<!--end of artpagenums.element-->]]>
+
+<!ENTITY % artpagenums.attlist "INCLUDE">
+<![%artpagenums.attlist;[
+<!ATTLIST artpagenums
+		%common.attrib;
+		%artpagenums.role.attrib;
+		%local.artpagenums.attrib;
+>
+<!--end of artpagenums.attlist-->]]>
+<!--end of artpagenums.module-->]]>
+
+<!-- PersonName -->
+
+<!ENTITY % personname.module "INCLUDE">
+<![%personname.module;[
+<!ENTITY % local.personname.attrib "">
+<!ENTITY % personname.role.attrib "%role.attrib;">
+
+<!ENTITY % personname.element "INCLUDE">
+<![%personname.element;[
+<!--doc:The personal name of an individual.-->
+<!ELEMENT personname %ho; ((honorific|firstname|surname|lineage|othername)+)>
+<!--end of personname.element-->]]>
+
+<!ENTITY % personname.attlist "INCLUDE">
+<![%personname.attlist;[
+<!ATTLIST personname
+		%common.attrib;
+		%personname.role.attrib;
+		%local.personname.attrib;
+>
+<!--end of personname.attlist-->]]>
+<!--end of personname.module-->]]>
+
+<!-- Author ........................... -->
+
+<!ENTITY % author.module "INCLUDE">
+<![%author.module;[
+<!ENTITY % local.author.attrib "">
+<!ENTITY % author.role.attrib "%role.attrib;">
+
+<!ENTITY % author.element "INCLUDE">
+<![%author.element;[
+<!--doc:The name of an individual author.-->
+<!ELEMENT author %ho; ((personname|(%person.ident.mix;)+),(personblurb|email|address)*)>
+<!--end of author.element-->]]>
+
+<!ENTITY % author.attlist "INCLUDE">
+<![%author.attlist;[
+<!ATTLIST author
+		%common.attrib;
+		%author.role.attrib;
+		%local.author.attrib;
+>
+<!--end of author.attlist-->]]>
+<!--(see "Personal identity elements" for %person.ident.mix;)-->
+<!--end of author.module-->]]>
+
+<!-- AuthorGroup ...................... -->
+
+<!ENTITY % authorgroup.content.module "INCLUDE">
+<![%authorgroup.content.module;[
+<!ENTITY % authorgroup.module "INCLUDE">
+<![%authorgroup.module;[
+<!ENTITY % local.authorgroup.attrib "">
+<!ENTITY % authorgroup.role.attrib "%role.attrib;">
+
+<!ENTITY % authorgroup.element "INCLUDE">
+<![%authorgroup.element;[
+<!--doc:Wrapper for author information when a document has multiple authors or collabarators.-->
+<!ELEMENT authorgroup %ho; ((author|editor|collab|corpauthor|corpcredit|othercredit)+)>
+<!--end of authorgroup.element-->]]>
+
+<!ENTITY % authorgroup.attlist "INCLUDE">
+<![%authorgroup.attlist;[
+<!ATTLIST authorgroup
+		%common.attrib;
+		%authorgroup.role.attrib;
+		%local.authorgroup.attrib;
+>
+<!--end of authorgroup.attlist-->]]>
+<!--end of authorgroup.module-->]]>
+
+  <!-- Author (defined elsewhere in this section)-->
+  <!-- Editor (defined elsewhere in this section)-->
+
+  <!ENTITY % collab.content.module "INCLUDE">
+  <![%collab.content.module;[
+  <!ENTITY % collab.module "INCLUDE">
+  <![%collab.module;[
+  <!ENTITY % local.collab.attrib "">
+  <!ENTITY % collab.role.attrib "%role.attrib;">
+
+<!ENTITY % collab.element "INCLUDE">
+<![%collab.element;[
+<!--doc:Identifies a collaborator.-->
+<!ELEMENT collab %ho; (collabname, affiliation*)>
+<!--end of collab.element-->]]>
+
+<!ENTITY % collab.attlist "INCLUDE">
+<![%collab.attlist;[
+<!ATTLIST collab
+		%common.attrib;
+		%collab.role.attrib;
+		%local.collab.attrib;
+>
+<!--end of collab.attlist-->]]>
+  <!--end of collab.module-->]]>
+
+    <!ENTITY % collabname.module "INCLUDE">
+  <![%collabname.module;[
+  <!ENTITY % local.collabname.attrib "">
+  <!ENTITY % collabname.role.attrib "%role.attrib;">
+
+<!ENTITY % collabname.element "INCLUDE">
+<![%collabname.element;[
+<!--doc:The name of a collaborator.-->
+<!ELEMENT collabname %ho; (%docinfo.char.mix;)*>
+<!--end of collabname.element-->]]>
+
+<!ENTITY % collabname.attlist "INCLUDE">
+<![%collabname.attlist;[
+<!ATTLIST collabname
+		%common.attrib;
+		%collabname.role.attrib;
+		%local.collabname.attrib;
+>
+<!--end of collabname.attlist-->]]>
+    <!--end of collabname.module-->]]>
+
+    <!-- Affiliation (defined elsewhere in this section)-->
+  <!--end of collab.content.module-->]]>
+
+  <!-- CorpAuthor (defined elsewhere in this section)-->
+  <!-- OtherCredit (defined elsewhere in this section)-->
+
+<!--end of authorgroup.content.module-->]]>
+
+<!-- AuthorInitials ................... -->
+
+<!ENTITY % authorinitials.module "INCLUDE">
+<![%authorinitials.module;[
+<!ENTITY % local.authorinitials.attrib "">
+<!ENTITY % authorinitials.role.attrib "%role.attrib;">
+
+<!ENTITY % authorinitials.element "INCLUDE">
+<![%authorinitials.element;[
+<!--doc:The initials or other short identifier for an author.-->
+<!ELEMENT authorinitials %ho; (%docinfo.char.mix;)*>
+<!--end of authorinitials.element-->]]>
+
+<!ENTITY % authorinitials.attlist "INCLUDE">
+<![%authorinitials.attlist;[
+<!ATTLIST authorinitials
+		%common.attrib;
+		%authorinitials.role.attrib;
+		%local.authorinitials.attrib;
+>
+<!--end of authorinitials.attlist-->]]>
+<!--end of authorinitials.module-->]]>
+
+<!-- ConfGroup ........................ -->
+
+<!ENTITY % confgroup.content.module "INCLUDE">
+<![%confgroup.content.module;[
+<!ENTITY % confgroup.module "INCLUDE">
+<![%confgroup.module;[
+<!ENTITY % local.confgroup.attrib "">
+<!ENTITY % confgroup.role.attrib "%role.attrib;">
+
+<!ENTITY % confgroup.element "INCLUDE">
+<![%confgroup.element;[
+<!--doc:A wrapper for document meta-information about a conference.-->
+<!ELEMENT confgroup %ho; ((confdates|conftitle|confnum|address|confsponsor)*)>
+<!--end of confgroup.element-->]]>
+
+<!ENTITY % confgroup.attlist "INCLUDE">
+<![%confgroup.attlist;[
+<!ATTLIST confgroup
+		%common.attrib;
+		%confgroup.role.attrib;
+		%local.confgroup.attrib;
+>
+<!--end of confgroup.attlist-->]]>
+<!--end of confgroup.module-->]]>
+
+  <!ENTITY % confdates.module "INCLUDE">
+  <![%confdates.module;[
+  <!ENTITY % local.confdates.attrib "">
+  <!ENTITY % confdates.role.attrib "%role.attrib;">
+
+<!ENTITY % confdates.element "INCLUDE">
+<![%confdates.element;[
+<!--doc:The dates of a conference for which a document was written.-->
+<!ELEMENT confdates %ho; (%docinfo.char.mix;)*>
+<!--end of confdates.element-->]]>
+
+<!ENTITY % confdates.attlist "INCLUDE">
+<![%confdates.attlist;[
+<!ATTLIST confdates
+		%common.attrib;
+		%confdates.role.attrib;
+		%local.confdates.attrib;
+>
+<!--end of confdates.attlist-->]]>
+  <!--end of confdates.module-->]]>
+
+  <!ENTITY % conftitle.module "INCLUDE">
+  <![%conftitle.module;[
+  <!ENTITY % local.conftitle.attrib "">
+  <!ENTITY % conftitle.role.attrib "%role.attrib;">
+
+<!ENTITY % conftitle.element "INCLUDE">
+<![%conftitle.element;[
+<!--doc:The title of a conference for which a document was written.-->
+<!ELEMENT conftitle %ho; (%docinfo.char.mix;)*>
+<!--end of conftitle.element-->]]>
+
+<!ENTITY % conftitle.attlist "INCLUDE">
+<![%conftitle.attlist;[
+<!ATTLIST conftitle
+		%common.attrib;
+		%conftitle.role.attrib;
+		%local.conftitle.attrib;
+>
+<!--end of conftitle.attlist-->]]>
+  <!--end of conftitle.module-->]]>
+
+  <!ENTITY % confnum.module "INCLUDE">
+  <![%confnum.module;[
+  <!ENTITY % local.confnum.attrib "">
+  <!ENTITY % confnum.role.attrib "%role.attrib;">
+
+<!ENTITY % confnum.element "INCLUDE">
+<![%confnum.element;[
+<!--doc:An identifier, frequently numerical, associated with a conference for which a document was written.-->
+<!ELEMENT confnum %ho; (%docinfo.char.mix;)*>
+<!--end of confnum.element-->]]>
+
+<!ENTITY % confnum.attlist "INCLUDE">
+<![%confnum.attlist;[
+<!ATTLIST confnum
+		%common.attrib;
+		%confnum.role.attrib;
+		%local.confnum.attrib;
+>
+<!--end of confnum.attlist-->]]>
+  <!--end of confnum.module-->]]>
+
+  <!-- Address (defined elsewhere in this section)-->
+
+  <!ENTITY % confsponsor.module "INCLUDE">
+  <![%confsponsor.module;[
+  <!ENTITY % local.confsponsor.attrib "">
+  <!ENTITY % confsponsor.role.attrib "%role.attrib;">
+
+<!ENTITY % confsponsor.element "INCLUDE">
+<![%confsponsor.element;[
+<!--doc:The sponsor of a conference for which a document was written.-->
+<!ELEMENT confsponsor %ho; (%docinfo.char.mix;)*>
+<!--end of confsponsor.element-->]]>
+
+<!ENTITY % confsponsor.attlist "INCLUDE">
+<![%confsponsor.attlist;[
+<!ATTLIST confsponsor
+		%common.attrib;
+		%confsponsor.role.attrib;
+		%local.confsponsor.attrib;
+>
+<!--end of confsponsor.attlist-->]]>
+  <!--end of confsponsor.module-->]]>
+<!--end of confgroup.content.module-->]]>
+
+<!-- ContractNum ...................... -->
+
+<!ENTITY % contractnum.module "INCLUDE">
+<![%contractnum.module;[
+<!ENTITY % local.contractnum.attrib "">
+<!ENTITY % contractnum.role.attrib "%role.attrib;">
+
+<!ENTITY % contractnum.element "INCLUDE">
+<![%contractnum.element;[
+<!--doc:The contract number of a document.-->
+<!ELEMENT contractnum %ho; (%docinfo.char.mix;)*>
+<!--end of contractnum.element-->]]>
+
+<!ENTITY % contractnum.attlist "INCLUDE">
+<![%contractnum.attlist;[
+<!ATTLIST contractnum
+		%common.attrib;
+		%contractnum.role.attrib;
+		%local.contractnum.attrib;
+>
+<!--end of contractnum.attlist-->]]>
+<!--end of contractnum.module-->]]>
+
+<!-- ContractSponsor .................. -->
+
+<!ENTITY % contractsponsor.module "INCLUDE">
+<![%contractsponsor.module;[
+<!ENTITY % local.contractsponsor.attrib "">
+<!ENTITY % contractsponsor.role.attrib "%role.attrib;">
+
+<!ENTITY % contractsponsor.element "INCLUDE">
+<![%contractsponsor.element;[
+<!--doc:The sponsor of a contract.-->
+<!ELEMENT contractsponsor %ho; (%docinfo.char.mix;)*>
+<!--end of contractsponsor.element-->]]>
+
+<!ENTITY % contractsponsor.attlist "INCLUDE">
+<![%contractsponsor.attlist;[
+<!ATTLIST contractsponsor
+		%common.attrib;
+		%contractsponsor.role.attrib;
+		%local.contractsponsor.attrib;
+>
+<!--end of contractsponsor.attlist-->]]>
+<!--end of contractsponsor.module-->]]>
+
+<!-- Copyright ........................ -->
+
+<!ENTITY % copyright.content.module "INCLUDE">
+<![%copyright.content.module;[
+<!ENTITY % copyright.module "INCLUDE">
+<![%copyright.module;[
+<!ENTITY % local.copyright.attrib "">
+<!ENTITY % copyright.role.attrib "%role.attrib;">
+
+<!ENTITY % copyright.element "INCLUDE">
+<![%copyright.element;[
+<!--doc:Copyright information about a document.-->
+<!ELEMENT copyright %ho; (year+, holder*)>
+<!--end of copyright.element-->]]>
+
+<!ENTITY % copyright.attlist "INCLUDE">
+<![%copyright.attlist;[
+<!ATTLIST copyright
+		%common.attrib;
+		%copyright.role.attrib;
+		%local.copyright.attrib;
+>
+<!--end of copyright.attlist-->]]>
+<!--end of copyright.module-->]]>
+
+  <!ENTITY % year.module "INCLUDE">
+  <![%year.module;[
+  <!ENTITY % local.year.attrib "">
+  <!ENTITY % year.role.attrib "%role.attrib;">
+
+<!ENTITY % year.element "INCLUDE">
+<![%year.element;[
+<!--doc:The year of publication of a document.-->
+<!ELEMENT year %ho; (%docinfo.char.mix;)*>
+<!--end of year.element-->]]>
+
+<!ENTITY % year.attlist "INCLUDE">
+<![%year.attlist;[
+<!ATTLIST year
+		%common.attrib;
+		%year.role.attrib;
+		%local.year.attrib;
+>
+<!--end of year.attlist-->]]>
+  <!--end of year.module-->]]>
+
+  <!ENTITY % holder.module "INCLUDE">
+  <![%holder.module;[
+  <!ENTITY % local.holder.attrib "">
+  <!ENTITY % holder.role.attrib "%role.attrib;">
+
+<!ENTITY % holder.element "INCLUDE">
+<![%holder.element;[
+<!--doc:The name of the individual or organization that holds a copyright.-->
+<!ELEMENT holder %ho; (%docinfo.char.mix;)*>
+<!--end of holder.element-->]]>
+
+<!ENTITY % holder.attlist "INCLUDE">
+<![%holder.attlist;[
+<!ATTLIST holder
+		%common.attrib;
+		%holder.role.attrib;
+		%local.holder.attrib;
+>
+<!--end of holder.attlist-->]]>
+  <!--end of holder.module-->]]>
+<!--end of copyright.content.module-->]]>
+
+<!-- CorpAuthor ....................... -->
+
+<!ENTITY % corpauthor.module "INCLUDE">
+<![%corpauthor.module;[
+<!ENTITY % local.corpauthor.attrib "">
+<!ENTITY % corpauthor.role.attrib "%role.attrib;">
+
+<!ENTITY % corpauthor.element "INCLUDE">
+<![%corpauthor.element;[
+<!--doc:A corporate author, as opposed to an individual.-->
+<!ELEMENT corpauthor %ho; (%docinfo.char.mix;)*>
+<!--end of corpauthor.element-->]]>
+
+<!ENTITY % corpauthor.attlist "INCLUDE">
+<![%corpauthor.attlist;[
+<!ATTLIST corpauthor
+		%common.attrib;
+		%corpauthor.role.attrib;
+		%local.corpauthor.attrib;
+>
+<!--end of corpauthor.attlist-->]]>
+<!--end of corpauthor.module-->]]>
+
+<!-- CorpCredit ...................... -->
+
+<!ENTITY % corpcredit.module "INCLUDE">
+<![%corpcredit.module;[
+<!ENTITY % local.corpcredit.attrib "">
+<!ENTITY % corpcredit.role.attrib "%role.attrib;">
+
+<!ENTITY % corpcredit.element "INCLUDE">
+<![%corpcredit.element;[
+<!--doc:A corporation or organization credited in a document.-->
+<!ELEMENT corpcredit %ho; (%docinfo.char.mix;)*>
+<!--end of corpcredit.element-->]]>
+
+<!ENTITY % corpcredit.attlist "INCLUDE">
+<![%corpcredit.attlist;[
+<!ATTLIST corpcredit
+		class	(graphicdesigner
+			|productioneditor
+			|copyeditor
+			|technicaleditor
+			|translator
+			|other)			#IMPLIED
+		%common.attrib;
+		%corpcredit.role.attrib;
+		%local.corpcredit.attrib;
+>
+<!--end of corpcredit.attlist-->]]>
+<!--end of corpcredit.module-->]]>
+
+<!-- CorpName ......................... -->
+
+<!ENTITY % corpname.module "INCLUDE">
+<![%corpname.module;[
+<!ENTITY % local.corpname.attrib "">
+
+<!ENTITY % corpname.element "INCLUDE">
+<![%corpname.element;[
+<!--doc:The name of a corporation.-->
+<!ELEMENT corpname %ho; (%docinfo.char.mix;)*>
+<!--end of corpname.element-->]]>
+<!ENTITY % corpname.role.attrib "%role.attrib;">
+
+<!ENTITY % corpname.attlist "INCLUDE">
+<![%corpname.attlist;[
+<!ATTLIST corpname
+		%common.attrib;
+		%corpname.role.attrib;
+		%local.corpname.attrib;
+>
+<!--end of corpname.attlist-->]]>
+<!--end of corpname.module-->]]>
+
+<!-- Date ............................. -->
+
+<!ENTITY % date.module "INCLUDE">
+<![%date.module;[
+<!ENTITY % local.date.attrib "">
+<!ENTITY % date.role.attrib "%role.attrib;">
+
+<!ENTITY % date.element "INCLUDE">
+<![%date.element;[
+<!--doc:The date of publication or revision of a document.-->
+<!ELEMENT date %ho; (%docinfo.char.mix;)*>
+<!--end of date.element-->]]>
+
+<!ENTITY % date.attlist "INCLUDE">
+<![%date.attlist;[
+<!ATTLIST date
+		%common.attrib;
+		%date.role.attrib;
+		%local.date.attrib;
+>
+<!--end of date.attlist-->]]>
+<!--end of date.module-->]]>
+
+<!-- Edition .......................... -->
+
+<!ENTITY % edition.module "INCLUDE">
+<![%edition.module;[
+<!ENTITY % local.edition.attrib "">
+<!ENTITY % edition.role.attrib "%role.attrib;">
+
+<!ENTITY % edition.element "INCLUDE">
+<![%edition.element;[
+<!--doc:The name or number of an edition of a document.-->
+<!ELEMENT edition %ho; (%docinfo.char.mix;)*>
+<!--end of edition.element-->]]>
+
+<!ENTITY % edition.attlist "INCLUDE">
+<![%edition.attlist;[
+<!ATTLIST edition
+		%common.attrib;
+		%edition.role.attrib;
+		%local.edition.attrib;
+>
+<!--end of edition.attlist-->]]>
+<!--end of edition.module-->]]>
+
+<!-- Editor ........................... -->
+
+<!ENTITY % editor.module "INCLUDE">
+<![%editor.module;[
+<!ENTITY % local.editor.attrib "">
+<!ENTITY % editor.role.attrib "%role.attrib;">
+
+<!ENTITY % editor.element "INCLUDE">
+<![%editor.element;[
+<!--doc:The name of the editor of a document.-->
+<!ELEMENT editor %ho; ((personname|(%person.ident.mix;)+),(personblurb|email|address)*)>
+<!--end of editor.element-->]]>
+
+<!ENTITY % editor.attlist "INCLUDE">
+<![%editor.attlist;[
+<!ATTLIST editor
+		%common.attrib;
+		%editor.role.attrib;
+		%local.editor.attrib;
+>
+<!--end of editor.attlist-->]]>
+  <!--(see "Personal identity elements" for %person.ident.mix;)-->
+<!--end of editor.module-->]]>
+
+<!-- ISBN ............................. -->
+
+<!ENTITY % isbn.module "INCLUDE">
+<![%isbn.module;[
+<!ENTITY % local.isbn.attrib "">
+<!ENTITY % isbn.role.attrib "%role.attrib;">
+
+<!ENTITY % isbn.element "INCLUDE">
+<![%isbn.element;[
+<!--doc:The International Standard Book Number of a document.-->
+<!ELEMENT isbn %ho; (%docinfo.char.mix;)*>
+<!--end of isbn.element-->]]>
+
+<!ENTITY % isbn.attlist "INCLUDE">
+<![%isbn.attlist;[
+<!ATTLIST isbn
+		%common.attrib;
+		%isbn.role.attrib;
+		%local.isbn.attrib;
+>
+<!--end of isbn.attlist-->]]>
+<!--end of isbn.module-->]]>
+
+<!-- ISSN ............................. -->
+
+<!ENTITY % issn.module "INCLUDE">
+<![%issn.module;[
+<!ENTITY % local.issn.attrib "">
+<!ENTITY % issn.role.attrib "%role.attrib;">
+
+<!ENTITY % issn.element "INCLUDE">
+<![%issn.element;[
+<!--doc:The International Standard Serial Number of a periodical.-->
+<!ELEMENT issn %ho; (%docinfo.char.mix;)*>
+<!--end of issn.element-->]]>
+
+<!ENTITY % issn.attlist "INCLUDE">
+<![%issn.attlist;[
+<!ATTLIST issn
+		%common.attrib;
+		%issn.role.attrib;
+		%local.issn.attrib;
+>
+<!--end of issn.attlist-->]]>
+<!--end of issn.module-->]]>
+
+<!-- BiblioId ................. -->
+<!ENTITY % biblio.class.attrib
+		"class	(uri
+                         |doi
+                         |isbn
+			 |isrn
+                         |issn
+                         |libraryofcongress
+                         |pubnumber
+                         |other)	#IMPLIED
+		otherclass	CDATA	#IMPLIED"
+>
+
+<!ENTITY % biblioid.module "INCLUDE">
+<![%biblioid.module;[
+<!ENTITY % local.biblioid.attrib "">
+<!ENTITY % biblioid.role.attrib "%role.attrib;">
+
+<!ENTITY % biblioid.element "INCLUDE">
+<![%biblioid.element;[
+<!--doc:An identifier for a document.-->
+<!ELEMENT biblioid %ho; (%docinfo.char.mix;)*>
+<!--end of biblioid.element-->]]>
+
+<!ENTITY % biblioid.attlist "INCLUDE">
+<![%biblioid.attlist;[
+<!ATTLIST biblioid
+		%biblio.class.attrib;
+		%common.attrib;
+		%biblioid.role.attrib;
+		%local.biblioid.attrib;
+>
+<!--end of biblioid.attlist-->]]>
+<!--end of biblioid.module-->]]>
+
+<!-- CiteBiblioId ................. -->
+
+<!ENTITY % citebiblioid.module "INCLUDE">
+<![%citebiblioid.module;[
+<!ENTITY % local.citebiblioid.attrib "">
+<!ENTITY % citebiblioid.role.attrib "%role.attrib;">
+
+<!ENTITY % citebiblioid.element "INCLUDE">
+<![%citebiblioid.element;[
+<!--doc:A citation of a bibliographic identifier.-->
+<!ELEMENT citebiblioid %ho; (%docinfo.char.mix;)*>
+<!--end of citebiblioid.element-->]]>
+
+<!ENTITY % citebiblioid.attlist "INCLUDE">
+<![%citebiblioid.attlist;[
+<!ATTLIST citebiblioid
+		%biblio.class.attrib;
+		%common.attrib;
+		%citebiblioid.role.attrib;
+		%local.citebiblioid.attrib;
+>
+<!--end of citebiblioid.attlist-->]]>
+<!--end of citebiblioid.module-->]]>
+
+<!-- BiblioSource ................. -->
+
+<!ENTITY % bibliosource.module "INCLUDE">
+<![%bibliosource.module;[
+<!ENTITY % local.bibliosource.attrib "">
+<!ENTITY % bibliosource.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliosource.element "INCLUDE">
+<![%bibliosource.element;[
+<!--doc:The source of a document.-->
+<!ELEMENT bibliosource %ho; (%docinfo.char.mix;)*>
+<!--end of bibliosource.element-->]]>
+
+<!ENTITY % bibliosource.attlist "INCLUDE">
+<![%bibliosource.attlist;[
+<!ATTLIST bibliosource
+		%biblio.class.attrib;
+		%common.attrib;
+		%bibliosource.role.attrib;
+		%local.bibliosource.attrib;
+>
+<!--end of bibliosource.attlist-->]]>
+<!--end of bibliosource.module-->]]>
+
+<!-- BiblioRelation ................. -->
+
+<!ENTITY % bibliorelation.module "INCLUDE">
+<![%bibliorelation.module;[
+<!ENTITY % local.bibliorelation.attrib "">
+<!ENTITY % local.bibliorelation.types "">
+
+<!ENTITY % bibliorelation.type.attrib
+                "type    (isversionof
+                         |hasversion
+                         |isreplacedby
+                         |replaces
+                         |isrequiredby
+                         |requires
+                         |ispartof
+                         |haspart
+                         |isreferencedby
+                         |references
+                         |isformatof
+                         |hasformat
+                         |othertype
+                         %local.bibliorelation.types;)       #IMPLIED
+		othertype	CDATA	#IMPLIED
+">
+
+<!ENTITY % bibliorelation.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliorelation.element "INCLUDE">
+<![%bibliorelation.element;[
+<!--doc:The relationship of a document to another.-->
+<!ELEMENT bibliorelation %ho; (%docinfo.char.mix;)*>
+<!--end of bibliorelation.element-->]]>
+
+<!ENTITY % bibliorelation.attlist "INCLUDE">
+<![%bibliorelation.attlist;[
+<!ATTLIST bibliorelation
+		%biblio.class.attrib;
+		%bibliorelation.type.attrib;
+		%common.attrib;
+		%bibliorelation.role.attrib;
+		%local.bibliorelation.attrib;
+>
+<!--end of bibliorelation.attlist-->]]>
+<!--end of bibliorelation.module-->]]>
+
+<!-- BiblioCoverage ................. -->
+
+<!ENTITY % bibliocoverage.module "INCLUDE">
+<![%bibliocoverage.module;[
+<!ENTITY % local.bibliocoverage.attrib "">
+<!ENTITY % bibliocoverage.role.attrib "%role.attrib;">
+
+<!ENTITY % bibliocoverage.element "INCLUDE">
+<![%bibliocoverage.element;[
+<!--doc:The spatial or temporal coverage of a document.-->
+<!ELEMENT bibliocoverage %ho; (%docinfo.char.mix;)*>
+<!--end of bibliocoverage.element-->]]>
+
+<!ENTITY % bibliocoverage.attlist "INCLUDE">
+<![%bibliocoverage.attlist;[
+<!ATTLIST bibliocoverage
+		spatial	(dcmipoint|iso3166|dcmibox|tgn|otherspatial)	#IMPLIED
+		otherspatial	CDATA	#IMPLIED
+		temporal (dcmiperiod|w3c-dtf|othertemporal) #IMPLIED
+		othertemporal	CDATA	#IMPLIED
+		%common.attrib;
+		%bibliocoverage.role.attrib;
+		%local.bibliocoverage.attrib;
+>
+<!--end of bibliocoverage.attlist-->]]>
+<!--end of bibliocoverage.module-->]]>
+
+<!-- InvPartNumber .................... -->
+
+<!ENTITY % invpartnumber.module "INCLUDE">
+<![%invpartnumber.module;[
+<!ENTITY % local.invpartnumber.attrib "">
+<!ENTITY % invpartnumber.role.attrib "%role.attrib;">
+
+<!ENTITY % invpartnumber.element "INCLUDE">
+<![%invpartnumber.element;[
+<!--doc:An inventory part number.-->
+<!ELEMENT invpartnumber %ho; (%docinfo.char.mix;)*>
+<!--end of invpartnumber.element-->]]>
+
+<!ENTITY % invpartnumber.attlist "INCLUDE">
+<![%invpartnumber.attlist;[
+<!ATTLIST invpartnumber
+		%common.attrib;
+		%invpartnumber.role.attrib;
+		%local.invpartnumber.attrib;
+>
+<!--end of invpartnumber.attlist-->]]>
+<!--end of invpartnumber.module-->]]>
+
+<!-- IssueNum ......................... -->
+
+<!ENTITY % issuenum.module "INCLUDE">
+<![%issuenum.module;[
+<!ENTITY % local.issuenum.attrib "">
+<!ENTITY % issuenum.role.attrib "%role.attrib;">
+
+<!ENTITY % issuenum.element "INCLUDE">
+<![%issuenum.element;[
+<!--doc:The number of an issue of a journal.-->
+<!ELEMENT issuenum %ho; (%docinfo.char.mix;)*>
+<!--end of issuenum.element-->]]>
+
+<!ENTITY % issuenum.attlist "INCLUDE">
+<![%issuenum.attlist;[
+<!ATTLIST issuenum
+		%common.attrib;
+		%issuenum.role.attrib;
+		%local.issuenum.attrib;
+>
+<!--end of issuenum.attlist-->]]>
+<!--end of issuenum.module-->]]>
+
+<!-- LegalNotice ...................... -->
+
+<!ENTITY % legalnotice.module "INCLUDE">
+<![%legalnotice.module;[
+<!ENTITY % local.legalnotice.attrib "">
+<!ENTITY % legalnotice.role.attrib "%role.attrib;">
+
+<!ENTITY % legalnotice.element "INCLUDE">
+<![%legalnotice.element;[
+<!--doc:A statement of legal obligations or requirements.-->
+<!ELEMENT legalnotice %ho; (blockinfo?, title?, (%legalnotice.mix;)+)
+		%formal.exclusion;>
+<!--end of legalnotice.element-->]]>
+
+<!ENTITY % legalnotice.attlist "INCLUDE">
+<![%legalnotice.attlist;[
+<!ATTLIST legalnotice
+		%common.attrib;
+		%legalnotice.role.attrib;
+		%local.legalnotice.attrib;
+>
+<!--end of legalnotice.attlist-->]]>
+<!--end of legalnotice.module-->]]>
+
+<!-- ModeSpec ......................... -->
+
+<!ENTITY % modespec.module "INCLUDE">
+<![%modespec.module;[
+<!ENTITY % local.modespec.attrib "">
+<!ENTITY % modespec.role.attrib "%role.attrib;">
+
+<!ENTITY % modespec.element "INCLUDE">
+<![%modespec.element;[
+<!--doc:Application-specific information necessary for the completion of an OLink.-->
+<!ELEMENT modespec %ho; (%docinfo.char.mix;)*
+		%ubiq.exclusion;>
+<!--end of modespec.element-->]]>
+
+<!-- Application: Type of action required for completion
+		of the links to which the ModeSpec is relevant (e.g.,
+		retrieval query) -->
+
+
+<!ENTITY % modespec.attlist "INCLUDE">
+<![%modespec.attlist;[
+<!ATTLIST modespec
+		application	NOTATION
+				(%notation.class;)	#IMPLIED
+		%common.attrib;
+		%modespec.role.attrib;
+		%local.modespec.attrib;
+>
+<!--end of modespec.attlist-->]]>
+<!--end of modespec.module-->]]>
+
+<!-- OrgName .......................... -->
+
+<!ENTITY % orgname.module "INCLUDE">
+<![%orgname.module;[
+<!ENTITY % local.orgname.attrib "">
+<!ENTITY % orgname.role.attrib "%role.attrib;">
+
+<!ENTITY % orgname.element "INCLUDE">
+<![%orgname.element;[
+<!--doc:The name of an organization other than a corporation.-->
+<!ELEMENT orgname %ho; (%docinfo.char.mix;)*>
+<!--end of orgname.element-->]]>
+
+<!ENTITY % orgname.attlist "INCLUDE">
+<![%orgname.attlist;[
+<!ATTLIST orgname
+		%common.attrib;
+		class	(corporation|nonprofit|consortium|informal|other)	#IMPLIED
+		otherclass	CDATA			#IMPLIED
+		%orgname.role.attrib;
+		%local.orgname.attrib;
+>
+<!--end of orgname.attlist-->]]>
+<!--end of orgname.module-->]]>
+
+<!-- OtherCredit ...................... -->
+
+<!ENTITY % othercredit.module "INCLUDE">
+<![%othercredit.module;[
+<!ENTITY % local.othercredit.attrib "">
+<!ENTITY % othercredit.role.attrib "%role.attrib;">
+
+<!ENTITY % othercredit.element "INCLUDE">
+<![%othercredit.element;[
+<!--doc:A person or entity, other than an author or editor, credited in a document.-->
+<!ELEMENT othercredit %ho; ((personname|(%person.ident.mix;)+),
+                            (personblurb|email|address)*)>
+<!--end of othercredit.element-->]]>
+
+<!ENTITY % othercredit.attlist "INCLUDE">
+<![%othercredit.attlist;[
+<!ATTLIST othercredit
+		class	(graphicdesigner
+			|productioneditor
+			|copyeditor
+			|technicaleditor
+			|translator
+			|other)			#IMPLIED
+		%common.attrib;
+		%othercredit.role.attrib;
+		%local.othercredit.attrib;
+>
+<!--end of othercredit.attlist-->]]>
+  <!--(see "Personal identity elements" for %person.ident.mix;)-->
+<!--end of othercredit.module-->]]>
+
+<!-- PageNums ......................... -->
+
+<!ENTITY % pagenums.module "INCLUDE">
+<![%pagenums.module;[
+<!ENTITY % local.pagenums.attrib "">
+<!ENTITY % pagenums.role.attrib "%role.attrib;">
+
+<!ENTITY % pagenums.element "INCLUDE">
+<![%pagenums.element;[
+<!--doc:The numbers of the pages in a book, for use in a bibliographic entry.-->
+<!ELEMENT pagenums %ho; (%docinfo.char.mix;)*>
+<!--end of pagenums.element-->]]>
+
+<!ENTITY % pagenums.attlist "INCLUDE">
+<![%pagenums.attlist;[
+<!ATTLIST pagenums
+		%common.attrib;
+		%pagenums.role.attrib;
+		%local.pagenums.attrib;
+>
+<!--end of pagenums.attlist-->]]>
+<!--end of pagenums.module-->]]>
+
+<!-- Personal identity elements ....... -->
+
+<!-- These elements are used only within Author, Editor, and
+OtherCredit. -->
+
+<!ENTITY % person.ident.module "INCLUDE">
+<![%person.ident.module;[
+  <!ENTITY % contrib.module "INCLUDE">
+  <![%contrib.module;[
+  <!ENTITY % local.contrib.attrib "">
+  <!ENTITY % contrib.role.attrib "%role.attrib;">
+
+<!ENTITY % contrib.element "INCLUDE">
+<![%contrib.element;[
+<!--doc:A summary of the contributions made to a document by a credited source.-->
+<!ELEMENT contrib %ho; (%docinfo.char.mix;)*>
+<!--end of contrib.element-->]]>
+
+<!ENTITY % contrib.attlist "INCLUDE">
+<![%contrib.attlist;[
+<!ATTLIST contrib
+		%common.attrib;
+		%contrib.role.attrib;
+		%local.contrib.attrib;
+>
+<!--end of contrib.attlist-->]]>
+  <!--end of contrib.module-->]]>
+
+  <!ENTITY % firstname.module "INCLUDE">
+  <![%firstname.module;[
+  <!ENTITY % local.firstname.attrib "">
+  <!ENTITY % firstname.role.attrib "%role.attrib;">
+
+<!ENTITY % firstname.element "INCLUDE">
+<![%firstname.element;[
+<!--doc:The first name of a person.-->
+<!ELEMENT firstname %ho; (%docinfo.char.mix;)*>
+<!--end of firstname.element-->]]>
+
+<!ENTITY % firstname.attlist "INCLUDE">
+<![%firstname.attlist;[
+<!ATTLIST firstname
+		%common.attrib;
+		%firstname.role.attrib;
+		%local.firstname.attrib;
+>
+<!--end of firstname.attlist-->]]>
+  <!--end of firstname.module-->]]>
+
+  <!ENTITY % honorific.module "INCLUDE">
+  <![%honorific.module;[
+  <!ENTITY % local.honorific.attrib "">
+  <!ENTITY % honorific.role.attrib "%role.attrib;">
+
+<!ENTITY % honorific.element "INCLUDE">
+<![%honorific.element;[
+<!--doc:The title of a person.-->
+<!ELEMENT honorific %ho; (%docinfo.char.mix;)*>
+<!--end of honorific.element-->]]>
+
+<!ENTITY % honorific.attlist "INCLUDE">
+<![%honorific.attlist;[
+<!ATTLIST honorific
+		%common.attrib;
+		%honorific.role.attrib;
+		%local.honorific.attrib;
+>
+<!--end of honorific.attlist-->]]>
+  <!--end of honorific.module-->]]>
+
+  <!ENTITY % lineage.module "INCLUDE">
+  <![%lineage.module;[
+  <!ENTITY % local.lineage.attrib "">
+  <!ENTITY % lineage.role.attrib "%role.attrib;">
+
+<!ENTITY % lineage.element "INCLUDE">
+<![%lineage.element;[
+<!--doc:The portion of a person's name indicating a relationship to ancestors.-->
+<!ELEMENT lineage %ho; (%docinfo.char.mix;)*>
+<!--end of lineage.element-->]]>
+
+<!ENTITY % lineage.attlist "INCLUDE">
+<![%lineage.attlist;[
+<!ATTLIST lineage
+		%common.attrib;
+		%lineage.role.attrib;
+		%local.lineage.attrib;
+>
+<!--end of lineage.attlist-->]]>
+  <!--end of lineage.module-->]]>
+
+  <!ENTITY % othername.module "INCLUDE">
+  <![%othername.module;[
+  <!ENTITY % local.othername.attrib "">
+  <!ENTITY % othername.role.attrib "%role.attrib;">
+
+<!ENTITY % othername.element "INCLUDE">
+<![%othername.element;[
+<!--doc:A component of a persons name that is not a first name, surname, or lineage.-->
+<!ELEMENT othername %ho; (%docinfo.char.mix;)*>
+<!--end of othername.element-->]]>
+
+<!ENTITY % othername.attlist "INCLUDE">
+<![%othername.attlist;[
+<!ATTLIST othername
+		%common.attrib;
+		%othername.role.attrib;
+		%local.othername.attrib;
+>
+<!--end of othername.attlist-->]]>
+  <!--end of othername.module-->]]>
+
+  <!ENTITY % surname.module "INCLUDE">
+  <![%surname.module;[
+  <!ENTITY % local.surname.attrib "">
+  <!ENTITY % surname.role.attrib "%role.attrib;">
+
+<!ENTITY % surname.element "INCLUDE">
+<![%surname.element;[
+<!--doc:A family name; in western cultures the last name.-->
+<!ELEMENT surname %ho; (%docinfo.char.mix;)*>
+<!--end of surname.element-->]]>
+
+<!ENTITY % surname.attlist "INCLUDE">
+<![%surname.attlist;[
+<!ATTLIST surname
+		%common.attrib;
+		%surname.role.attrib;
+		%local.surname.attrib;
+>
+<!--end of surname.attlist-->]]>
+  <!--end of surname.module-->]]>
+<!--end of person.ident.module-->]]>
+
+<!-- PrintHistory ..................... -->
+
+<!ENTITY % printhistory.module "INCLUDE">
+<![%printhistory.module;[
+<!ENTITY % local.printhistory.attrib "">
+<!ENTITY % printhistory.role.attrib "%role.attrib;">
+
+<!ENTITY % printhistory.element "INCLUDE">
+<![%printhistory.element;[
+<!--doc:The printing history of a document.-->
+<!ELEMENT printhistory %ho; ((%para.class;)+)>
+<!--end of printhistory.element-->]]>
+
+<!ENTITY % printhistory.attlist "INCLUDE">
+<![%printhistory.attlist;[
+<!ATTLIST printhistory
+		%common.attrib;
+		%printhistory.role.attrib;
+		%local.printhistory.attrib;
+>
+<!--end of printhistory.attlist-->]]>
+<!--end of printhistory.module-->]]>
+
+<!-- ProductName ...................... -->
+
+<!ENTITY % productname.module "INCLUDE">
+<![%productname.module;[
+<!ENTITY % local.productname.attrib "">
+<!ENTITY % productname.role.attrib "%role.attrib;">
+
+<!ENTITY % productname.element "INCLUDE">
+<![%productname.element;[
+<!--doc:The formal name of a product.-->
+<!ELEMENT productname %ho; (%para.char.mix;)*>
+<!--end of productname.element-->]]>
+
+<!-- Class: More precisely identifies the item the element names -->
+
+
+<!ENTITY % productname.attlist "INCLUDE">
+<![%productname.attlist;[
+<!ATTLIST productname
+		class		(service
+				|trade
+				|registered
+				|copyright)	'trade'
+		%common.attrib;
+		%productname.role.attrib;
+		%local.productname.attrib;
+>
+<!--end of productname.attlist-->]]>
+<!--end of productname.module-->]]>
+
+<!-- ProductNumber .................... -->
+
+<!ENTITY % productnumber.module "INCLUDE">
+<![%productnumber.module;[
+<!ENTITY % local.productnumber.attrib "">
+<!ENTITY % productnumber.role.attrib "%role.attrib;">
+
+<!ENTITY % productnumber.element "INCLUDE">
+<![%productnumber.element;[
+<!--doc:A number assigned to a product.-->
+<!ELEMENT productnumber %ho; (%docinfo.char.mix;)*>
+<!--end of productnumber.element-->]]>
+
+<!ENTITY % productnumber.attlist "INCLUDE">
+<![%productnumber.attlist;[
+<!ATTLIST productnumber
+		%common.attrib;
+		%productnumber.role.attrib;
+		%local.productnumber.attrib;
+>
+<!--end of productnumber.attlist-->]]>
+<!--end of productnumber.module-->]]>
+
+<!-- PubDate .......................... -->
+
+<!ENTITY % pubdate.module "INCLUDE">
+<![%pubdate.module;[
+<!ENTITY % local.pubdate.attrib "">
+<!ENTITY % pubdate.role.attrib "%role.attrib;">
+
+<!ENTITY % pubdate.element "INCLUDE">
+<![%pubdate.element;[
+<!--doc:The date of publication of a document.-->
+<!ELEMENT pubdate %ho; (%docinfo.char.mix;)*>
+<!--end of pubdate.element-->]]>
+
+<!ENTITY % pubdate.attlist "INCLUDE">
+<![%pubdate.attlist;[
+<!ATTLIST pubdate
+		%common.attrib;
+		%pubdate.role.attrib;
+		%local.pubdate.attrib;
+>
+<!--end of pubdate.attlist-->]]>
+<!--end of pubdate.module-->]]>
+
+<!-- Publisher ........................ -->
+
+<!ENTITY % publisher.content.module "INCLUDE">
+<![%publisher.content.module;[
+<!ENTITY % publisher.module "INCLUDE">
+<![%publisher.module;[
+<!ENTITY % local.publisher.attrib "">
+<!ENTITY % publisher.role.attrib "%role.attrib;">
+
+<!ENTITY % publisher.element "INCLUDE">
+<![%publisher.element;[
+<!--doc:The publisher of a document.-->
+<!ELEMENT publisher %ho; (publishername, address*)>
+<!--end of publisher.element-->]]>
+
+<!ENTITY % publisher.attlist "INCLUDE">
+<![%publisher.attlist;[
+<!ATTLIST publisher
+		%common.attrib;
+		%publisher.role.attrib;
+		%local.publisher.attrib;
+>
+<!--end of publisher.attlist-->]]>
+<!--end of publisher.module-->]]>
+
+  <!ENTITY % publishername.module "INCLUDE">
+  <![%publishername.module;[
+  <!ENTITY % local.publishername.attrib "">
+  <!ENTITY % publishername.role.attrib "%role.attrib;">
+
+<!ENTITY % publishername.element "INCLUDE">
+<![%publishername.element;[
+<!--doc:The name of the publisher of a document.-->
+<!ELEMENT publishername %ho; (%docinfo.char.mix;)*>
+<!--end of publishername.element-->]]>
+
+<!ENTITY % publishername.attlist "INCLUDE">
+<![%publishername.attlist;[
+<!ATTLIST publishername
+		%common.attrib;
+		%publishername.role.attrib;
+		%local.publishername.attrib;
+>
+<!--end of publishername.attlist-->]]>
+  <!--end of publishername.module-->]]>
+
+  <!-- Address (defined elsewhere in this section)-->
+<!--end of publisher.content.module-->]]>
+
+<!-- PubsNumber ....................... -->
+
+<!ENTITY % pubsnumber.module "INCLUDE">
+<![%pubsnumber.module;[
+<!ENTITY % local.pubsnumber.attrib "">
+<!ENTITY % pubsnumber.role.attrib "%role.attrib;">
+
+<!ENTITY % pubsnumber.element "INCLUDE">
+<![%pubsnumber.element;[
+<!--doc:A number assigned to a publication other than an ISBN or ISSN or inventory part number.-->
+<!ELEMENT pubsnumber %ho; (%docinfo.char.mix;)*>
+<!--end of pubsnumber.element-->]]>
+
+<!ENTITY % pubsnumber.attlist "INCLUDE">
+<![%pubsnumber.attlist;[
+<!ATTLIST pubsnumber
+		%common.attrib;
+		%pubsnumber.role.attrib;
+		%local.pubsnumber.attrib;
+>
+<!--end of pubsnumber.attlist-->]]>
+<!--end of pubsnumber.module-->]]>
+
+<!-- ReleaseInfo ...................... -->
+
+<!ENTITY % releaseinfo.module "INCLUDE">
+<![%releaseinfo.module;[
+<!ENTITY % local.releaseinfo.attrib "">
+<!ENTITY % releaseinfo.role.attrib "%role.attrib;">
+
+<!ENTITY % releaseinfo.element "INCLUDE">
+<![%releaseinfo.element;[
+<!--doc:Information about a particular release of a document.-->
+<!ELEMENT releaseinfo %ho; (%docinfo.char.mix;)*>
+<!--end of releaseinfo.element-->]]>
+
+<!ENTITY % releaseinfo.attlist "INCLUDE">
+<![%releaseinfo.attlist;[
+<!ATTLIST releaseinfo
+		%common.attrib;
+		%releaseinfo.role.attrib;
+		%local.releaseinfo.attrib;
+>
+<!--end of releaseinfo.attlist-->]]>
+<!--end of releaseinfo.module-->]]>
+
+<!-- RevHistory ....................... -->
+
+<!ENTITY % revhistory.content.module "INCLUDE">
+<![%revhistory.content.module;[
+<!ENTITY % revhistory.module "INCLUDE">
+<![%revhistory.module;[
+<!ENTITY % local.revhistory.attrib "">
+<!ENTITY % revhistory.role.attrib "%role.attrib;">
+
+<!ENTITY % revhistory.element "INCLUDE">
+<![%revhistory.element;[
+<!--doc:A history of the revisions to a document.-->
+<!ELEMENT revhistory %ho; (revision+)>
+<!--end of revhistory.element-->]]>
+
+<!ENTITY % revhistory.attlist "INCLUDE">
+<![%revhistory.attlist;[
+<!ATTLIST revhistory
+		%common.attrib;
+		%revhistory.role.attrib;
+		%local.revhistory.attrib;
+>
+<!--end of revhistory.attlist-->]]>
+<!--end of revhistory.module-->]]>
+
+<!ENTITY % revision.module "INCLUDE">
+<![%revision.module;[
+<!ENTITY % local.revision.attrib "">
+<!ENTITY % revision.role.attrib "%role.attrib;">
+
+<!ENTITY % revision.element "INCLUDE">
+<![%revision.element;[
+<!--doc:An entry describing a single revision in the history of the revisions to a document.-->
+<!ELEMENT revision %ho; (revnumber?, date, (author|authorinitials)*,
+                    (revremark|revdescription)?)>
+<!--end of revision.element-->]]>
+
+<!ENTITY % revision.attlist "INCLUDE">
+<![%revision.attlist;[
+<!ATTLIST revision
+		%common.attrib;
+		%revision.role.attrib;
+		%local.revision.attrib;
+>
+<!--end of revision.attlist-->]]>
+<!--end of revision.module-->]]>
+
+<!ENTITY % revnumber.module "INCLUDE">
+<![%revnumber.module;[
+<!ENTITY % local.revnumber.attrib "">
+<!ENTITY % revnumber.role.attrib "%role.attrib;">
+
+<!ENTITY % revnumber.element "INCLUDE">
+<![%revnumber.element;[
+<!--doc:A document revision number.-->
+<!ELEMENT revnumber %ho; (%docinfo.char.mix;)*>
+<!--end of revnumber.element-->]]>
+
+<!ENTITY % revnumber.attlist "INCLUDE">
+<![%revnumber.attlist;[
+<!ATTLIST revnumber
+		%common.attrib;
+		%revnumber.role.attrib;
+		%local.revnumber.attrib;
+>
+<!--end of revnumber.attlist-->]]>
+<!--end of revnumber.module-->]]>
+
+<!-- Date (defined elsewhere in this section)-->
+<!-- AuthorInitials (defined elsewhere in this section)-->
+
+<!ENTITY % revremark.module "INCLUDE">
+<![%revremark.module;[
+<!ENTITY % local.revremark.attrib "">
+<!ENTITY % revremark.role.attrib "%role.attrib;">
+
+<!ENTITY % revremark.element "INCLUDE">
+<![%revremark.element;[
+<!--doc:A description of a revision to a document.-->
+<!ELEMENT revremark %ho; (%docinfo.char.mix;)*>
+<!--end of revremark.element-->]]>
+
+<!ENTITY % revremark.attlist "INCLUDE">
+<![%revremark.attlist;[
+<!ATTLIST revremark
+		%common.attrib;
+		%revremark.role.attrib;
+		%local.revremark.attrib;
+>
+<!--end of revremark.attlist-->]]>
+<!--end of revremark.module-->]]>
+
+<!ENTITY % revdescription.module "INCLUDE">
+<![ %revdescription.module; [
+<!ENTITY % local.revdescription.attrib "">
+<!ENTITY % revdescription.role.attrib "%role.attrib;">
+
+<!ENTITY % revdescription.element "INCLUDE">
+<![ %revdescription.element; [
+<!--doc:A extended description of a revision to a document.-->
+<!ELEMENT revdescription %ho; ((%revdescription.mix;)+)>
+<!--end of revdescription.element-->]]>
+
+<!ENTITY % revdescription.attlist "INCLUDE">
+<![ %revdescription.attlist; [
+<!ATTLIST revdescription
+		%common.attrib;
+		%revdescription.role.attrib;
+		%local.revdescription.attrib;
+>
+<!--end of revdescription.attlist-->]]>
+<!--end of revdescription.module-->]]>
+<!--end of revhistory.content.module-->]]>
+
+<!-- SeriesVolNums .................... -->
+
+<!ENTITY % seriesvolnums.module "INCLUDE">
+<![%seriesvolnums.module;[
+<!ENTITY % local.seriesvolnums.attrib "">
+<!ENTITY % seriesvolnums.role.attrib "%role.attrib;">
+
+<!ENTITY % seriesvolnums.element "INCLUDE">
+<![%seriesvolnums.element;[
+<!--doc:Numbers of the volumes in a series of books.-->
+<!ELEMENT seriesvolnums %ho; (%docinfo.char.mix;)*>
+<!--end of seriesvolnums.element-->]]>
+
+<!ENTITY % seriesvolnums.attlist "INCLUDE">
+<![%seriesvolnums.attlist;[
+<!ATTLIST seriesvolnums
+		%common.attrib;
+		%seriesvolnums.role.attrib;
+		%local.seriesvolnums.attrib;
+>
+<!--end of seriesvolnums.attlist-->]]>
+<!--end of seriesvolnums.module-->]]>
+
+<!-- VolumeNum ........................ -->
+
+<!ENTITY % volumenum.module "INCLUDE">
+<![%volumenum.module;[
+<!ENTITY % local.volumenum.attrib "">
+<!ENTITY % volumenum.role.attrib "%role.attrib;">
+
+<!ENTITY % volumenum.element "INCLUDE">
+<![%volumenum.element;[
+<!--doc:The volume number of a document in a set (as of books in a set or articles in a journal).-->
+<!ELEMENT volumenum %ho; (%docinfo.char.mix;)*>
+<!--end of volumenum.element-->]]>
+
+<!ENTITY % volumenum.attlist "INCLUDE">
+<![%volumenum.attlist;[
+<!ATTLIST volumenum
+		%common.attrib;
+		%volumenum.role.attrib;
+		%local.volumenum.attrib;
+>
+<!--end of volumenum.attlist-->]]>
+<!--end of volumenum.module-->]]>
+
+<!-- .................................. -->
+
+<!--end of docinfo.content.module-->]]>
+
+<!-- ...................................................................... -->
+<!-- Inline, link, and ubiquitous elements ................................ -->
+
+<!-- Technical and computer terms ......................................... -->
+
+<!ENTITY % accel.module "INCLUDE">
+<![%accel.module;[
+<!ENTITY % local.accel.attrib "">
+<!ENTITY % accel.role.attrib "%role.attrib;">
+
+<!ENTITY % accel.element "INCLUDE">
+<![%accel.element;[
+<!--doc:A graphical user interface (GUI) keyboard shortcut.-->
+<!ELEMENT accel %ho; (%smallcptr.char.mix;)*>
+<!--end of accel.element-->]]>
+
+<!ENTITY % accel.attlist "INCLUDE">
+<![%accel.attlist;[
+<!ATTLIST accel
+		%common.attrib;
+		%accel.role.attrib;
+		%local.accel.attrib;
+>
+<!--end of accel.attlist-->]]>
+<!--end of accel.module-->]]>
+
+<!ENTITY % action.module "INCLUDE">
+<![%action.module;[
+<!ENTITY % local.action.attrib "">
+<!ENTITY % action.role.attrib "%role.attrib;">
+
+<!ENTITY % action.element "INCLUDE">
+<![%action.element;[
+<!--doc:A response to a user event.-->
+<!ELEMENT action %ho; (%cptr.char.mix;)*>
+<!--end of action.element-->]]>
+
+<!ENTITY % action.attlist "INCLUDE">
+<![%action.attlist;[
+<!ATTLIST action
+		%moreinfo.attrib;
+		%common.attrib;
+		%action.role.attrib;
+		%local.action.attrib;
+>
+<!--end of action.attlist-->]]>
+<!--end of action.module-->]]>
+
+<!ENTITY % application.module "INCLUDE">
+<![%application.module;[
+<!ENTITY % local.application.attrib "">
+<!ENTITY % application.role.attrib "%role.attrib;">
+
+<!ENTITY % application.element "INCLUDE">
+<![%application.element;[
+<!--doc:The name of a software program.-->
+<!ELEMENT application %ho; (%para.char.mix;)*>
+<!--end of application.element-->]]>
+
+<!ENTITY % application.attlist "INCLUDE">
+<![%application.attlist;[
+<!ATTLIST application
+		class 		(hardware
+				|software)	#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%application.role.attrib;
+		%local.application.attrib;
+>
+<!--end of application.attlist-->]]>
+<!--end of application.module-->]]>
+
+<!ENTITY % classname.module "INCLUDE">
+<![%classname.module;[
+<!ENTITY % local.classname.attrib "">
+<!ENTITY % classname.role.attrib "%role.attrib;">
+
+<!ENTITY % classname.element "INCLUDE">
+<![%classname.element;[
+<!--doc:The name of a class, in the object-oriented programming sense.-->
+<!ELEMENT classname %ho; (%smallcptr.char.mix;)*>
+<!--end of classname.element-->]]>
+
+<!ENTITY % classname.attlist "INCLUDE">
+<![%classname.attlist;[
+<!ATTLIST classname
+		%common.attrib;
+		%classname.role.attrib;
+		%local.classname.attrib;
+>
+<!--end of classname.attlist-->]]>
+<!--end of classname.module-->]]>
+
+<!ENTITY % package.module "INCLUDE">
+<![%package.module;[
+<!ENTITY % local.package.attrib "">
+<!ENTITY % package.role.attrib "%role.attrib;">
+
+<!ENTITY % package.element "INCLUDE">
+<![%package.element;[
+<!--doc:A package.-->
+<!ELEMENT package %ho; (%smallcptr.char.mix;)*>
+<!--end of package.element-->]]>
+
+<!ENTITY % package.attlist "INCLUDE">
+<![%package.attlist;[
+<!ATTLIST package
+		%common.attrib;
+		%package.role.attrib;
+		%local.package.attrib;
+>
+<!--end of package.attlist-->]]>
+<!--end of package.module-->]]>
+
+<!ENTITY % co.module "INCLUDE">
+<![%co.module;[
+<!ENTITY % local.co.attrib "">
+<!-- CO is a callout area of the LineColumn unit type (a single character
+     position); the position is directly indicated by the location of CO. -->
+<!ENTITY % co.role.attrib "%role.attrib;">
+
+<!ENTITY % co.element "INCLUDE">
+<![%co.element;[
+<!--doc:The location of a callout embedded in text.-->
+<!ELEMENT co %ho; EMPTY>
+<!--end of co.element-->]]>
+
+<!-- bug number/symbol override or initialization -->
+<!-- to any related information -->
+
+
+<!ENTITY % co.attlist "INCLUDE">
+<![%co.attlist;[
+<!ATTLIST co
+		%label.attrib;
+		%linkends.attrib;
+		%idreq.common.attrib;
+		%co.role.attrib;
+		%local.co.attrib;
+>
+<!--end of co.attlist-->]]>
+<!--end of co.module-->]]>
+
+<!ENTITY % coref.module "INCLUDE">
+<![%coref.module;[
+<!ENTITY % local.coref.attrib "">
+<!-- COREF is a reference to a CO -->
+<!ENTITY % coref.role.attrib "%role.attrib;">
+
+<!ENTITY % coref.element "INCLUDE">
+<![%coref.element;[
+<!--doc:A cross reference to a co.-->
+<!ELEMENT coref %ho; EMPTY>
+<!--end of coref.element-->]]>
+
+<!-- bug number/symbol override or initialization -->
+<!-- to any related information -->
+
+<!ENTITY % coref.attlist "INCLUDE">
+<![%coref.attlist;[
+<!ATTLIST coref
+		%label.attrib;
+		%linkendreq.attrib;
+		%common.attrib;
+		%coref.role.attrib;
+		%local.coref.attrib;
+>
+<!--end of coref.attlist-->]]>
+<!--end of coref.module-->]]>
+
+<!ENTITY % command.module "INCLUDE">
+<![%command.module;[
+<!ENTITY % local.command.attrib "">
+<!ENTITY % command.role.attrib "%role.attrib;">
+
+<!ENTITY % command.element "INCLUDE">
+<![%command.element;[
+<!--doc:The name of an executable program or other software command.-->
+<!ELEMENT command %ho; (%cptr.char.mix;)*>
+<!--end of command.element-->]]>
+
+<!ENTITY % command.attlist "INCLUDE">
+<![%command.attlist;[
+<!ATTLIST command
+		%moreinfo.attrib;
+		%common.attrib;
+		%command.role.attrib;
+		%local.command.attrib;
+>
+<!--end of command.attlist-->]]>
+<!--end of command.module-->]]>
+
+<!ENTITY % computeroutput.module "INCLUDE">
+<![%computeroutput.module;[
+<!ENTITY % local.computeroutput.attrib "">
+<!ENTITY % computeroutput.role.attrib "%role.attrib;">
+
+<!ENTITY % computeroutput.element "INCLUDE">
+<![%computeroutput.element;[
+<!--doc:Data, generally text, displayed or presented by a computer.-->
+<!ELEMENT computeroutput %ho; (%cptr.char.mix;|co)*>
+<!--end of computeroutput.element-->]]>
+
+<!ENTITY % computeroutput.attlist "INCLUDE">
+<![%computeroutput.attlist;[
+<!ATTLIST computeroutput
+		%moreinfo.attrib;
+		%common.attrib;
+		%computeroutput.role.attrib;
+		%local.computeroutput.attrib;
+>
+<!--end of computeroutput.attlist-->]]>
+<!--end of computeroutput.module-->]]>
+
+<!ENTITY % database.module "INCLUDE">
+<![%database.module;[
+<!ENTITY % local.database.attrib "">
+<!ENTITY % database.role.attrib "%role.attrib;">
+
+<!ENTITY % database.element "INCLUDE">
+<![%database.element;[
+<!--doc:The name of a database, or part of a database.-->
+<!ELEMENT database %ho; (%cptr.char.mix;)*>
+<!--end of database.element-->]]>
+
+<!-- Class: Type of database the element names; no default -->
+
+
+<!ENTITY % database.attlist "INCLUDE">
+<![%database.attlist;[
+<!ATTLIST database
+		class 		(name
+				|table
+				|field
+				|key1
+				|key2
+				|record
+                                |index
+                                |view
+                                |primarykey
+                                |secondarykey
+                                |foreignkey
+                                |altkey
+                                |procedure
+                                |datatype
+                                |constraint
+                                |rule
+                                |user
+                                |group)	#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%database.role.attrib;
+		%local.database.attrib;
+>
+<!--end of database.attlist-->]]>
+<!--end of database.module-->]]>
+
+<!ENTITY % email.module "INCLUDE">
+<![%email.module;[
+<!ENTITY % local.email.attrib "">
+<!ENTITY % email.role.attrib "%role.attrib;">
+
+<!ENTITY % email.element "INCLUDE">
+<![%email.element;[
+<!--doc:An email address.-->
+<!ELEMENT email %ho; (%docinfo.char.mix;)*>
+<!--end of email.element-->]]>
+
+<!ENTITY % email.attlist "INCLUDE">
+<![%email.attlist;[
+<!ATTLIST email
+		%common.attrib;
+		%email.role.attrib;
+		%local.email.attrib;
+>
+<!--end of email.attlist-->]]>
+<!--end of email.module-->]]>
+
+<!ENTITY % envar.module "INCLUDE">
+<![%envar.module;[
+<!ENTITY % local.envar.attrib "">
+<!ENTITY % envar.role.attrib "%role.attrib;">
+
+<!ENTITY % envar.element "INCLUDE">
+<![%envar.element;[
+<!--doc:A software environment variable.-->
+<!ELEMENT envar %ho; (%smallcptr.char.mix;)*>
+<!--end of envar.element-->]]>
+
+<!ENTITY % envar.attlist "INCLUDE">
+<![%envar.attlist;[
+<!ATTLIST envar
+		%common.attrib;
+		%envar.role.attrib;
+		%local.envar.attrib;
+>
+<!--end of envar.attlist-->]]>
+<!--end of envar.module-->]]>
+
+
+<!ENTITY % errorcode.module "INCLUDE">
+<![%errorcode.module;[
+<!ENTITY % local.errorcode.attrib "">
+<!ENTITY % errorcode.role.attrib "%role.attrib;">
+
+<!ENTITY % errorcode.element "INCLUDE">
+<![%errorcode.element;[
+<!--doc:An error code.-->
+<!ELEMENT errorcode %ho; (%smallcptr.char.mix;)*>
+<!--end of errorcode.element-->]]>
+
+<!ENTITY % errorcode.attlist "INCLUDE">
+<![%errorcode.attlist;[
+<!ATTLIST errorcode
+		%moreinfo.attrib;
+		%common.attrib;
+		%errorcode.role.attrib;
+		%local.errorcode.attrib;
+>
+<!--end of errorcode.attlist-->]]>
+<!--end of errorcode.module-->]]>
+
+<!ENTITY % errorname.module "INCLUDE">
+<![%errorname.module;[
+<!ENTITY % local.errorname.attrib "">
+<!ENTITY % errorname.role.attrib "%role.attrib;">
+
+<!ENTITY % errorname.element "INCLUDE">
+<![%errorname.element;[
+<!--doc:An error name.-->
+<!ELEMENT errorname %ho; (%smallcptr.char.mix;)*>
+<!--end of errorname.element-->]]>
+
+<!ENTITY % errorname.attlist "INCLUDE">
+<![%errorname.attlist;[
+<!ATTLIST errorname
+		%common.attrib;
+		%errorname.role.attrib;
+		%local.errorname.attrib;
+>
+<!--end of errorname.attlist-->]]>
+<!--end of errorname.module-->]]>
+
+<!ENTITY % errortext.module "INCLUDE">
+<![%errortext.module;[
+<!ENTITY % local.errortext.attrib "">
+<!ENTITY % errortext.role.attrib "%role.attrib;">
+
+<!ENTITY % errortext.element "INCLUDE">
+<![%errortext.element;[
+<!--doc:An error message..-->
+<!ELEMENT errortext %ho; (%smallcptr.char.mix;)*>
+<!--end of errortext.element-->]]>
+
+<!ENTITY % errortext.attlist "INCLUDE">
+<![%errortext.attlist;[
+<!ATTLIST errortext
+		%common.attrib;
+		%errortext.role.attrib;
+		%local.errortext.attrib;
+>
+<!--end of errortext.attlist-->]]>
+<!--end of errortext.module-->]]>
+
+<!ENTITY % errortype.module "INCLUDE">
+<![%errortype.module;[
+<!ENTITY % local.errortype.attrib "">
+<!ENTITY % errortype.role.attrib "%role.attrib;">
+
+<!ENTITY % errortype.element "INCLUDE">
+<![%errortype.element;[
+<!--doc:The classification of an error message.-->
+<!ELEMENT errortype %ho; (%smallcptr.char.mix;)*>
+<!--end of errortype.element-->]]>
+
+<!ENTITY % errortype.attlist "INCLUDE">
+<![%errortype.attlist;[
+<!ATTLIST errortype
+		%common.attrib;
+		%errortype.role.attrib;
+		%local.errortype.attrib;
+>
+<!--end of errortype.attlist-->]]>
+<!--end of errortype.module-->]]>
+
+<!ENTITY % filename.module "INCLUDE">
+<![%filename.module;[
+<!ENTITY % local.filename.attrib "">
+<!ENTITY % filename.role.attrib "%role.attrib;">
+
+<!ENTITY % filename.element "INCLUDE">
+<![%filename.element;[
+<!--doc:The name of a file.-->
+<!ELEMENT filename %ho; (%cptr.char.mix;)*>
+<!--end of filename.element-->]]>
+
+<!-- Class: Type of filename the element names; no default -->
+<!-- Path: Search path (possibly system-specific) in which
+		file can be found -->
+
+
+<!ENTITY % filename.attlist "INCLUDE">
+<![%filename.attlist;[
+<!ATTLIST filename
+		class		(headerfile
+                                |partition
+                                |devicefile
+                                |libraryfile
+                                |directory
+                                |extension
+				|symlink)       #IMPLIED
+		path		CDATA		#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%filename.role.attrib;
+		%local.filename.attrib;
+>
+<!--end of filename.attlist-->]]>
+<!--end of filename.module-->]]>
+
+<!ENTITY % function.module "INCLUDE">
+<![%function.module;[
+<!ENTITY % local.function.attrib "">
+<!ENTITY % function.role.attrib "%role.attrib;">
+
+<!ENTITY % function.element "INCLUDE">
+<![%function.element;[
+<!--doc:The name of a function or subroutine, as in a programming language.-->
+<!ELEMENT function %ho; (%cptr.char.mix;)*>
+<!--end of function.element-->]]>
+
+<!ENTITY % function.attlist "INCLUDE">
+<![%function.attlist;[
+<!ATTLIST function
+		%moreinfo.attrib;
+		%common.attrib;
+		%function.role.attrib;
+		%local.function.attrib;
+>
+<!--end of function.attlist-->]]>
+<!--end of function.module-->]]>
+
+<!ENTITY % guibutton.module "INCLUDE">
+<![%guibutton.module;[
+<!ENTITY % local.guibutton.attrib "">
+<!ENTITY % guibutton.role.attrib "%role.attrib;">
+
+<!ENTITY % guibutton.element "INCLUDE">
+<![%guibutton.element;[
+<!--doc:The text on a button in a GUI.-->
+<!ELEMENT guibutton %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guibutton.element-->]]>
+
+<!ENTITY % guibutton.attlist "INCLUDE">
+<![%guibutton.attlist;[
+<!ATTLIST guibutton
+		%moreinfo.attrib;
+		%common.attrib;
+		%guibutton.role.attrib;
+		%local.guibutton.attrib;
+>
+<!--end of guibutton.attlist-->]]>
+<!--end of guibutton.module-->]]>
+
+<!ENTITY % guiicon.module "INCLUDE">
+<![%guiicon.module;[
+<!ENTITY % local.guiicon.attrib "">
+<!ENTITY % guiicon.role.attrib "%role.attrib;">
+
+<!ENTITY % guiicon.element "INCLUDE">
+<![%guiicon.element;[
+<!--doc:Graphic and/or text appearing as a icon in a GUI.-->
+<!ELEMENT guiicon %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guiicon.element-->]]>
+
+<!ENTITY % guiicon.attlist "INCLUDE">
+<![%guiicon.attlist;[
+<!ATTLIST guiicon
+		%moreinfo.attrib;
+		%common.attrib;
+		%guiicon.role.attrib;
+		%local.guiicon.attrib;
+>
+<!--end of guiicon.attlist-->]]>
+<!--end of guiicon.module-->]]>
+
+<!ENTITY % guilabel.module "INCLUDE">
+<![%guilabel.module;[
+<!ENTITY % local.guilabel.attrib "">
+<!ENTITY % guilabel.role.attrib "%role.attrib;">
+
+<!ENTITY % guilabel.element "INCLUDE">
+<![%guilabel.element;[
+<!--doc:The text of a label in a GUI.-->
+<!ELEMENT guilabel %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guilabel.element-->]]>
+
+<!ENTITY % guilabel.attlist "INCLUDE">
+<![%guilabel.attlist;[
+<!ATTLIST guilabel
+		%moreinfo.attrib;
+		%common.attrib;
+		%guilabel.role.attrib;
+		%local.guilabel.attrib;
+>
+<!--end of guilabel.attlist-->]]>
+<!--end of guilabel.module-->]]>
+
+<!ENTITY % guimenu.module "INCLUDE">
+<![%guimenu.module;[
+<!ENTITY % local.guimenu.attrib "">
+<!ENTITY % guimenu.role.attrib "%role.attrib;">
+
+<!ENTITY % guimenu.element "INCLUDE">
+<![%guimenu.element;[
+<!--doc:The name of a menu in a GUI.-->
+<!ELEMENT guimenu %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guimenu.element-->]]>
+
+<!ENTITY % guimenu.attlist "INCLUDE">
+<![%guimenu.attlist;[
+<!ATTLIST guimenu
+		%moreinfo.attrib;
+		%common.attrib;
+		%guimenu.role.attrib;
+		%local.guimenu.attrib;
+>
+<!--end of guimenu.attlist-->]]>
+<!--end of guimenu.module-->]]>
+
+<!ENTITY % guimenuitem.module "INCLUDE">
+<![%guimenuitem.module;[
+<!ENTITY % local.guimenuitem.attrib "">
+<!ENTITY % guimenuitem.role.attrib "%role.attrib;">
+
+<!ENTITY % guimenuitem.element "INCLUDE">
+<![%guimenuitem.element;[
+<!--doc:The name of a terminal menu item in a GUI.-->
+<!ELEMENT guimenuitem %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guimenuitem.element-->]]>
+
+<!ENTITY % guimenuitem.attlist "INCLUDE">
+<![%guimenuitem.attlist;[
+<!ATTLIST guimenuitem
+		%moreinfo.attrib;
+		%common.attrib;
+		%guimenuitem.role.attrib;
+		%local.guimenuitem.attrib;
+>
+<!--end of guimenuitem.attlist-->]]>
+<!--end of guimenuitem.module-->]]>
+
+<!ENTITY % guisubmenu.module "INCLUDE">
+<![%guisubmenu.module;[
+<!ENTITY % local.guisubmenu.attrib "">
+<!ENTITY % guisubmenu.role.attrib "%role.attrib;">
+
+<!ENTITY % guisubmenu.element "INCLUDE">
+<![%guisubmenu.element;[
+<!--doc:The name of a submenu in a GUI.-->
+<!ELEMENT guisubmenu %ho; (%smallcptr.char.mix;|accel|superscript|subscript)*>
+<!--end of guisubmenu.element-->]]>
+
+<!ENTITY % guisubmenu.attlist "INCLUDE">
+<![%guisubmenu.attlist;[
+<!ATTLIST guisubmenu
+		%moreinfo.attrib;
+		%common.attrib;
+		%guisubmenu.role.attrib;
+		%local.guisubmenu.attrib;
+>
+<!--end of guisubmenu.attlist-->]]>
+<!--end of guisubmenu.module-->]]>
+
+<!ENTITY % hardware.module "INCLUDE">
+<![%hardware.module;[
+<!ENTITY % local.hardware.attrib "">
+<!ENTITY % hardware.role.attrib "%role.attrib;">
+
+<!ENTITY % hardware.element "INCLUDE">
+<![%hardware.element;[
+<!--doc:A physical part of a computer system.-->
+<!ELEMENT hardware %ho; (%cptr.char.mix;)*>
+<!--end of hardware.element-->]]>
+
+<!ENTITY % hardware.attlist "INCLUDE">
+<![%hardware.attlist;[
+<!ATTLIST hardware
+		%moreinfo.attrib;
+		%common.attrib;
+		%hardware.role.attrib;
+		%local.hardware.attrib;
+>
+<!--end of hardware.attlist-->]]>
+<!--end of hardware.module-->]]>
+
+<!ENTITY % interface.module "INCLUDE">
+<![%interface.module;[
+<!ENTITY % local.interface.attrib "">
+<!ENTITY % interface.role.attrib "%role.attrib;">
+
+<!ENTITY % interface.element "INCLUDE">
+<![%interface.element;[
+<!--doc:An element of a GUI.-->
+<!ELEMENT interface %ho; (%smallcptr.char.mix;|accel)*>
+<!--end of interface.element-->]]>
+
+<!-- Class: Type of the Interface item; no default -->
+
+
+<!ENTITY % interface.attlist "INCLUDE">
+<![%interface.attlist;[
+<!ATTLIST interface
+		%moreinfo.attrib;
+		%common.attrib;
+		%interface.role.attrib;
+		%local.interface.attrib;
+>
+<!--end of interface.attlist-->]]>
+<!--end of interface.module-->]]>
+
+<!ENTITY % keycap.module "INCLUDE">
+<![%keycap.module;[
+<!ENTITY % local.keycap.attrib "">
+<!ENTITY % keycap.role.attrib "%role.attrib;">
+
+<!ENTITY % keycap.element "INCLUDE">
+<![%keycap.element;[
+<!--doc:The text printed on a key on a keyboard.-->
+<!ELEMENT keycap %ho; (%cptr.char.mix;)*>
+<!--end of keycap.element-->]]>
+
+<!ENTITY % keycap.attlist "INCLUDE">
+<![%keycap.attlist;[
+<!ATTLIST keycap
+		function	(alt
+				|control
+				|shift
+				|meta
+				|escape
+				|enter
+				|tab
+				|backspace
+				|command
+				|option
+				|space
+				|delete
+				|insert
+				|up
+				|down
+				|left
+				|right
+				|home
+				|end
+				|pageup
+				|pagedown
+				|other)		#IMPLIED
+		otherfunction	CDATA		#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%keycap.role.attrib;
+		%local.keycap.attrib;
+>
+<!--end of keycap.attlist-->]]>
+<!--end of keycap.module-->]]>
+
+<!ENTITY % keycode.module "INCLUDE">
+<![%keycode.module;[
+<!ENTITY % local.keycode.attrib "">
+<!ENTITY % keycode.role.attrib "%role.attrib;">
+
+<!ENTITY % keycode.element "INCLUDE">
+<![%keycode.element;[
+<!--doc:The internal, frequently numeric, identifier for a key on a keyboard.-->
+<!ELEMENT keycode %ho; (%smallcptr.char.mix;)*>
+<!--end of keycode.element-->]]>
+
+<!ENTITY % keycode.attlist "INCLUDE">
+<![%keycode.attlist;[
+<!ATTLIST keycode
+		%common.attrib;
+		%keycode.role.attrib;
+		%local.keycode.attrib;
+>
+<!--end of keycode.attlist-->]]>
+<!--end of keycode.module-->]]>
+
+<!ENTITY % keycombo.module "INCLUDE">
+<![%keycombo.module;[
+<!ENTITY % local.keycombo.attrib "">
+<!ENTITY % keycombo.role.attrib "%role.attrib;">
+
+<!ENTITY % keycombo.element "INCLUDE">
+<![%keycombo.element;[
+<!--doc:A combination of input actions.-->
+<!ELEMENT keycombo %ho; ((keycap|keycombo|keysym|mousebutton)+)>
+<!--end of keycombo.element-->]]>
+
+<!ENTITY % keycombo.attlist "INCLUDE">
+<![%keycombo.attlist;[
+<!ATTLIST keycombo
+		%keyaction.attrib;
+		%moreinfo.attrib;
+		%common.attrib;
+		%keycombo.role.attrib;
+		%local.keycombo.attrib;
+>
+<!--end of keycombo.attlist-->]]>
+<!--end of keycombo.module-->]]>
+
+<!ENTITY % keysym.module "INCLUDE">
+<![%keysym.module;[
+<!ENTITY % local.keysym.attrib "">
+<!ENTITY % keysysm.role.attrib "%role.attrib;">
+
+<!ENTITY % keysym.element "INCLUDE">
+<![%keysym.element;[
+<!--doc:The symbolic name of a key on a keyboard.-->
+<!ELEMENT keysym %ho; (%smallcptr.char.mix;)*>
+<!--end of keysym.element-->]]>
+
+<!ENTITY % keysym.attlist "INCLUDE">
+<![%keysym.attlist;[
+<!ATTLIST keysym
+		%common.attrib;
+		%keysysm.role.attrib;
+		%local.keysym.attrib;
+>
+<!--end of keysym.attlist-->]]>
+<!--end of keysym.module-->]]>
+
+<!ENTITY % lineannotation.module "INCLUDE">
+<![%lineannotation.module;[
+<!ENTITY % local.lineannotation.attrib "">
+<!ENTITY % lineannotation.role.attrib "%role.attrib;">
+
+<!ENTITY % lineannotation.element "INCLUDE">
+<![%lineannotation.element;[
+<!--doc:A comment on a line in a verbatim listing.-->
+<!ELEMENT lineannotation %ho; (%para.char.mix;)*>
+<!--end of lineannotation.element-->]]>
+
+<!ENTITY % lineannotation.attlist "INCLUDE">
+<![%lineannotation.attlist;[
+<!ATTLIST lineannotation
+		%common.attrib;
+		%lineannotation.role.attrib;
+		%local.lineannotation.attrib;
+>
+<!--end of lineannotation.attlist-->]]>
+<!--end of lineannotation.module-->]]>
+
+<!ENTITY % literal.module "INCLUDE">
+<![%literal.module;[
+<!ENTITY % local.literal.attrib "">
+<!ENTITY % literal.role.attrib "%role.attrib;">
+
+<!ENTITY % literal.element "INCLUDE">
+<![%literal.element;[
+<!--doc:Inline text that is some literal value.-->
+<!ELEMENT literal %ho; (%cptr.char.mix;)*>
+<!--end of literal.element-->]]>
+
+<!ENTITY % literal.attlist "INCLUDE">
+<![%literal.attlist;[
+<!ATTLIST literal
+		%moreinfo.attrib;
+		%common.attrib;
+		%literal.role.attrib;
+		%local.literal.attrib;
+>
+<!--end of literal.attlist-->]]>
+<!--end of literal.module-->]]>
+
+<!ENTITY % code.module "INCLUDE">
+<![%code.module;[
+<!ENTITY % local.code.attrib "">
+<!ENTITY % code.role.attrib "%role.attrib;">
+
+<!ENTITY % code.element "INCLUDE">
+<![%code.element;[
+<!--doc:An inline code fragment.-->
+<!ELEMENT code %ho; (%cptr.char.mix;)*>
+<!--end of code.element-->]]>
+
+<!ENTITY % code.attlist "INCLUDE">
+<![%code.attlist;[
+<!ATTLIST code
+		language	CDATA	#IMPLIED
+		%common.attrib;
+		%code.role.attrib;
+		%local.code.attrib;
+>
+<!--end of code.attlist-->]]>
+<!--end of code.module-->]]>
+
+<!ENTITY % constant.module "INCLUDE">
+<![ %constant.module; [
+<!ENTITY % local.constant.attrib "">
+<!ENTITY % constant.role.attrib "%role.attrib;">
+
+<!ENTITY % constant.element "INCLUDE">
+<![ %constant.element; [
+<!--doc:A programming or system constant.-->
+<!ELEMENT constant %ho; (%smallcptr.char.mix;)*>
+<!--end of constant.element-->]]>
+
+<!ENTITY % constant.attlist "INCLUDE">
+<![ %constant.attlist; [
+<!ATTLIST constant
+		class	(limit)		#IMPLIED
+		%common.attrib;
+		%constant.role.attrib;
+		%local.constant.attrib;
+>
+<!--end of constant.attlist-->]]>
+<!--end of constant.module-->]]>
+
+<!ENTITY % varname.module "INCLUDE">
+<![ %varname.module; [
+<!ENTITY % local.varname.attrib "">
+<!ENTITY % varname.role.attrib "%role.attrib;">
+
+<!ENTITY % varname.element "INCLUDE">
+<![ %varname.element; [
+<!--doc:The name of a variable.-->
+<!ELEMENT varname %ho; (%smallcptr.char.mix;)*>
+<!--end of varname.element-->]]>
+
+<!ENTITY % varname.attlist "INCLUDE">
+<![ %varname.attlist; [
+<!ATTLIST varname
+		%common.attrib;
+		%varname.role.attrib;
+		%local.varname.attrib;
+>
+<!--end of varname.attlist-->]]>
+<!--end of varname.module-->]]>
+
+<!ENTITY % markup.module "INCLUDE">
+<![%markup.module;[
+<!ENTITY % local.markup.attrib "">
+<!ENTITY % markup.role.attrib "%role.attrib;">
+
+<!ENTITY % markup.element "INCLUDE">
+<![%markup.element;[
+<!--doc:A string of formatting markup in text that is to be represented literally.-->
+<!ELEMENT markup %ho; (%smallcptr.char.mix;)*>
+<!--end of markup.element-->]]>
+
+<!ENTITY % markup.attlist "INCLUDE">
+<![%markup.attlist;[
+<!ATTLIST markup
+		%common.attrib;
+		%markup.role.attrib;
+		%local.markup.attrib;
+>
+<!--end of markup.attlist-->]]>
+<!--end of markup.module-->]]>
+
+<!ENTITY % medialabel.module "INCLUDE">
+<![%medialabel.module;[
+<!ENTITY % local.medialabel.attrib "">
+<!ENTITY % medialabel.role.attrib "%role.attrib;">
+
+<!ENTITY % medialabel.element "INCLUDE">
+<![%medialabel.element;[
+<!--doc:A name that identifies the physical medium on which some information resides.-->
+<!ELEMENT medialabel %ho; (%smallcptr.char.mix;)*>
+<!--end of medialabel.element-->]]>
+
+<!-- Class: Type of medium named by the element; no default -->
+
+
+<!ENTITY % medialabel.attlist "INCLUDE">
+<![%medialabel.attlist;[
+<!ATTLIST medialabel
+		class 		(cartridge
+				|cdrom
+				|disk
+				|tape)		#IMPLIED
+		%common.attrib;
+		%medialabel.role.attrib;
+		%local.medialabel.attrib;
+>
+<!--end of medialabel.attlist-->]]>
+<!--end of medialabel.module-->]]>
+
+<!ENTITY % menuchoice.content.module "INCLUDE">
+<![%menuchoice.content.module;[
+<!ENTITY % menuchoice.module "INCLUDE">
+<![%menuchoice.module;[
+<!ENTITY % local.menuchoice.attrib "">
+<!ENTITY % menuchoice.role.attrib "%role.attrib;">
+
+<!ENTITY % menuchoice.element "INCLUDE">
+<![%menuchoice.element;[
+<!--doc:A selection or series of selections from a menu.-->
+<!ELEMENT menuchoice %ho; (shortcut?, (guibutton|guiicon|guilabel
+		|guimenu|guimenuitem|guisubmenu|interface)+)>
+<!--end of menuchoice.element-->]]>
+
+<!ENTITY % menuchoice.attlist "INCLUDE">
+<![%menuchoice.attlist;[
+<!ATTLIST menuchoice
+		%moreinfo.attrib;
+		%common.attrib;
+		%menuchoice.role.attrib;
+		%local.menuchoice.attrib;
+>
+<!--end of menuchoice.attlist-->]]>
+<!--end of menuchoice.module-->]]>
+
+<!ENTITY % shortcut.module "INCLUDE">
+<![%shortcut.module;[
+<!-- See also KeyCombo -->
+<!ENTITY % local.shortcut.attrib "">
+<!ENTITY % shortcut.role.attrib "%role.attrib;">
+
+<!ENTITY % shortcut.element "INCLUDE">
+<![%shortcut.element;[
+<!--doc:A key combination for an action that is also accessible through a menu.-->
+<!ELEMENT shortcut %ho; ((keycap|keycombo|keysym|mousebutton)+)>
+<!--end of shortcut.element-->]]>
+
+<!ENTITY % shortcut.attlist "INCLUDE">
+<![%shortcut.attlist;[
+<!ATTLIST shortcut
+		%keyaction.attrib;
+		%moreinfo.attrib;
+		%common.attrib;
+		%shortcut.role.attrib;
+		%local.shortcut.attrib;
+>
+<!--end of shortcut.attlist-->]]>
+<!--end of shortcut.module-->]]>
+<!--end of menuchoice.content.module-->]]>
+
+<!ENTITY % mousebutton.module "INCLUDE">
+<![%mousebutton.module;[
+<!ENTITY % local.mousebutton.attrib "">
+<!ENTITY % mousebutton.role.attrib "%role.attrib;">
+
+<!ENTITY % mousebutton.element "INCLUDE">
+<![%mousebutton.element;[
+<!--doc:The conventional name of a mouse button.-->
+<!ELEMENT mousebutton %ho; (%smallcptr.char.mix;)*>
+<!--end of mousebutton.element-->]]>
+
+<!ENTITY % mousebutton.attlist "INCLUDE">
+<![%mousebutton.attlist;[
+<!ATTLIST mousebutton
+		%moreinfo.attrib;
+		%common.attrib;
+		%mousebutton.role.attrib;
+		%local.mousebutton.attrib;
+>
+<!--end of mousebutton.attlist-->]]>
+<!--end of mousebutton.module-->]]>
+
+<!ENTITY % msgtext.module "INCLUDE">
+<![%msgtext.module;[
+<!ENTITY % local.msgtext.attrib "">
+<!ENTITY % msgtext.role.attrib "%role.attrib;">
+
+<!ENTITY % msgtext.element "INCLUDE">
+<![%msgtext.element;[
+<!--doc:The actual text of a message component in a message set.-->
+<!ELEMENT msgtext %ho; ((%component.mix;)+)>
+<!--end of msgtext.element-->]]>
+
+<!ENTITY % msgtext.attlist "INCLUDE">
+<![%msgtext.attlist;[
+<!ATTLIST msgtext
+		%common.attrib;
+		%msgtext.role.attrib;
+		%local.msgtext.attrib;
+>
+<!--end of msgtext.attlist-->]]>
+<!--end of msgtext.module-->]]>
+
+<!ENTITY % option.module "INCLUDE">
+<![%option.module;[
+<!ENTITY % local.option.attrib "">
+<!ENTITY % option.role.attrib "%role.attrib;">
+
+<!ENTITY % option.element "INCLUDE">
+<![%option.element;[
+<!--doc:An option for a software command.-->
+<!ELEMENT option %ho; (%cptr.char.mix;)*>
+<!--end of option.element-->]]>
+
+<!ENTITY % option.attlist "INCLUDE">
+<![%option.attlist;[
+<!ATTLIST option
+		%common.attrib;
+		%option.role.attrib;
+		%local.option.attrib;
+>
+<!--end of option.attlist-->]]>
+<!--end of option.module-->]]>
+
+<!ENTITY % optional.module "INCLUDE">
+<![%optional.module;[
+<!ENTITY % local.optional.attrib "">
+<!ENTITY % optional.role.attrib "%role.attrib;">
+
+<!ENTITY % optional.element "INCLUDE">
+<![%optional.element;[
+<!--doc:Optional information.-->
+<!ELEMENT optional %ho; (%cptr.char.mix;)*>
+<!--end of optional.element-->]]>
+
+<!ENTITY % optional.attlist "INCLUDE">
+<![%optional.attlist;[
+<!ATTLIST optional
+		%common.attrib;
+		%optional.role.attrib;
+		%local.optional.attrib;
+>
+<!--end of optional.attlist-->]]>
+<!--end of optional.module-->]]>
+
+<!ENTITY % parameter.module "INCLUDE">
+<![%parameter.module;[
+<!ENTITY % local.parameter.attrib "">
+<!ENTITY % parameter.role.attrib "%role.attrib;">
+
+<!ENTITY % parameter.element "INCLUDE">
+<![%parameter.element;[
+<!--doc:A value or a symbolic reference to a value.-->
+<!ELEMENT parameter %ho; (%cptr.char.mix;)*>
+<!--end of parameter.element-->]]>
+
+<!-- Class: Type of the Parameter; no default -->
+
+
+<!ENTITY % parameter.attlist "INCLUDE">
+<![%parameter.attlist;[
+<!ATTLIST parameter
+		class 		(command
+				|function
+				|option)	#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%parameter.role.attrib;
+		%local.parameter.attrib;
+>
+<!--end of parameter.attlist-->]]>
+<!--end of parameter.module-->]]>
+
+<!ENTITY % prompt.module "INCLUDE">
+<![%prompt.module;[
+<!ENTITY % local.prompt.attrib "">
+<!ENTITY % prompt.role.attrib "%role.attrib;">
+
+<!ENTITY % prompt.element "INCLUDE">
+<![%prompt.element;[
+<!--doc:A character or string indicating the start of an input field in a  computer display.-->
+<!ELEMENT prompt %ho; (%smallcptr.char.mix;|co)*>
+<!--end of prompt.element-->]]>
+
+<!ENTITY % prompt.attlist "INCLUDE">
+<![%prompt.attlist;[
+<!ATTLIST prompt
+		%moreinfo.attrib;
+		%common.attrib;
+		%prompt.role.attrib;
+		%local.prompt.attrib;
+>
+<!--end of prompt.attlist-->]]>
+<!--end of prompt.module-->]]>
+
+<!ENTITY % property.module "INCLUDE">
+<![%property.module;[
+<!ENTITY % local.property.attrib "">
+<!ENTITY % property.role.attrib "%role.attrib;">
+
+<!ENTITY % property.element "INCLUDE">
+<![%property.element;[
+<!--doc:A unit of data associated with some part of a computer system.-->
+<!ELEMENT property %ho; (%cptr.char.mix;)*>
+<!--end of property.element-->]]>
+
+<!ENTITY % property.attlist "INCLUDE">
+<![%property.attlist;[
+<!ATTLIST property
+		%moreinfo.attrib;
+		%common.attrib;
+		%property.role.attrib;
+		%local.property.attrib;
+>
+<!--end of property.attlist-->]]>
+<!--end of property.module-->]]>
+
+<!ENTITY % replaceable.module "INCLUDE">
+<![%replaceable.module;[
+<!ENTITY % local.replaceable.attrib "">
+<!ENTITY % replaceable.role.attrib "%role.attrib;">
+
+<!ENTITY % replaceable.element "INCLUDE">
+<![%replaceable.element;[
+<!--doc:Content that may or must be replaced by the user.-->
+<!ELEMENT replaceable %ho; (#PCDATA
+		| %link.char.class;
+		| optional
+		| %base.char.class;
+		| %other.char.class;
+		| inlinegraphic
+                | inlinemediaobject
+		| co)*>
+<!--end of replaceable.element-->]]>
+
+<!-- Class: Type of information the element represents; no
+		default -->
+
+
+<!ENTITY % replaceable.attlist "INCLUDE">
+<![%replaceable.attlist;[
+<!ATTLIST replaceable
+		class		(command
+				|function
+				|option
+				|parameter)	#IMPLIED
+		%common.attrib;
+		%replaceable.role.attrib;
+		%local.replaceable.attrib;
+>
+<!--end of replaceable.attlist-->]]>
+<!--end of replaceable.module-->]]>
+
+<!ENTITY % returnvalue.module "INCLUDE">
+<![%returnvalue.module;[
+<!ENTITY % local.returnvalue.attrib "">
+<!ENTITY % returnvalue.role.attrib "%role.attrib;">
+
+<!ENTITY % returnvalue.element "INCLUDE">
+<![%returnvalue.element;[
+<!--doc:The value returned by a function.-->
+<!ELEMENT returnvalue %ho; (%smallcptr.char.mix;)*>
+<!--end of returnvalue.element-->]]>
+
+<!ENTITY % returnvalue.attlist "INCLUDE">
+<![%returnvalue.attlist;[
+<!ATTLIST returnvalue
+		%common.attrib;
+		%returnvalue.role.attrib;
+		%local.returnvalue.attrib;
+>
+<!--end of returnvalue.attlist-->]]>
+<!--end of returnvalue.module-->]]>
+
+<!ENTITY % sgmltag.module "INCLUDE">
+<![%sgmltag.module;[
+<!ENTITY % local.sgmltag.attrib "">
+<!ENTITY % sgmltag.role.attrib "%role.attrib;">
+
+<!ENTITY % sgmltag.element "INCLUDE">
+<![%sgmltag.element;[
+<!--doc:A component of SGML markup.-->
+<!ELEMENT sgmltag %ho; (%smallcptr.char.mix;)*>
+<!--end of sgmltag.element-->]]>
+
+<!-- Class: Type of SGML construct the element names; no default -->
+
+
+<!ENTITY % sgmltag.attlist "INCLUDE">
+<![%sgmltag.attlist;[
+<!ATTLIST sgmltag
+		class 		(attribute
+				|attvalue
+				|element
+				|endtag
+                                |emptytag
+				|genentity
+				|numcharref
+				|paramentity
+				|pi
+                                |xmlpi
+				|starttag
+				|sgmlcomment
+                                |prefix
+                                |namespace
+                                |localname)	#IMPLIED
+		namespace	CDATA		#IMPLIED
+		%common.attrib;
+		%sgmltag.role.attrib;
+		%local.sgmltag.attrib;
+>
+<!--end of sgmltag.attlist-->]]>
+<!--end of sgmltag.module-->]]>
+
+<!ENTITY % structfield.module "INCLUDE">
+<![%structfield.module;[
+<!ENTITY % local.structfield.attrib "">
+<!ENTITY % structfield.role.attrib "%role.attrib;">
+
+<!ENTITY % structfield.element "INCLUDE">
+<![%structfield.element;[
+<!--doc:A field in a structure (in the programming language sense).-->
+<!ELEMENT structfield %ho; (%smallcptr.char.mix;)*>
+<!--end of structfield.element-->]]>
+
+<!ENTITY % structfield.attlist "INCLUDE">
+<![%structfield.attlist;[
+<!ATTLIST structfield
+		%common.attrib;
+		%structfield.role.attrib;
+		%local.structfield.attrib;
+>
+<!--end of structfield.attlist-->]]>
+<!--end of structfield.module-->]]>
+
+<!ENTITY % structname.module "INCLUDE">
+<![%structname.module;[
+<!ENTITY % local.structname.attrib "">
+<!ENTITY % structname.role.attrib "%role.attrib;">
+
+<!ENTITY % structname.element "INCLUDE">
+<![%structname.element;[
+<!--doc:The name of a structure (in the programming language sense).-->
+<!ELEMENT structname %ho; (%smallcptr.char.mix;)*>
+<!--end of structname.element-->]]>
+
+<!ENTITY % structname.attlist "INCLUDE">
+<![%structname.attlist;[
+<!ATTLIST structname
+		%common.attrib;
+		%structname.role.attrib;
+		%local.structname.attrib;
+>
+<!--end of structname.attlist-->]]>
+<!--end of structname.module-->]]>
+
+<!ENTITY % symbol.module "INCLUDE">
+<![%symbol.module;[
+<!ENTITY % local.symbol.attrib "">
+<!ENTITY % symbol.role.attrib "%role.attrib;">
+
+<!ENTITY % symbol.element "INCLUDE">
+<![%symbol.element;[
+<!--doc:A name that is replaced by a value before processing.-->
+<!ELEMENT symbol %ho; (%smallcptr.char.mix;)*>
+<!--end of symbol.element-->]]>
+
+<!-- Class: Type of symbol; no default -->
+
+
+<!ENTITY % symbol.attlist "INCLUDE">
+<![%symbol.attlist;[
+<!ATTLIST symbol
+		class		(limit)		#IMPLIED
+		%common.attrib;
+		%symbol.role.attrib;
+		%local.symbol.attrib;
+>
+<!--end of symbol.attlist-->]]>
+<!--end of symbol.module-->]]>
+
+<!ENTITY % systemitem.module "INCLUDE">
+<![%systemitem.module;[
+<!ENTITY % local.systemitem.attrib "">
+<!ENTITY % systemitem.role.attrib "%role.attrib;">
+
+<!ENTITY % systemitem.element "INCLUDE">
+<![%systemitem.element;[
+<!--doc:A system-related item or term.-->
+<!ELEMENT systemitem %ho; (%cptr.char.mix; | acronym | co)*>
+<!--end of systemitem.element-->]]>
+
+<!-- Class: Type of system item the element names; no default -->
+
+<!ENTITY % systemitem.attlist "INCLUDE">
+<![%systemitem.attlist;[
+<!ATTLIST systemitem
+		class	(constant
+                        |daemon
+			|domainname
+			|etheraddress
+			|event
+			|eventhandler
+			|filesystem
+			|fqdomainname
+			|groupname
+			|ipaddress
+			|library
+			|macro
+			|netmask
+			|newsgroup
+			|osname
+                        |protocol
+			|resource
+			|systemname
+			|username
+                        |process
+                        |server
+                        |service)	#IMPLIED
+		%moreinfo.attrib;
+		%common.attrib;
+		%systemitem.role.attrib;
+		%local.systemitem.attrib;
+>
+<!--end of systemitem.attlist-->]]>
+<!--end of systemitem.module-->]]>
+
+<!ENTITY % uri.module "INCLUDE">
+<![%uri.module;[
+<!ENTITY % local.uri.attrib "">
+<!ENTITY % uri.role.attrib "%role.attrib;">
+
+<!ENTITY % uri.element "INCLUDE">
+<![%uri.element;[
+<!--doc:A Uniform Resource Identifier.-->
+<!ELEMENT uri %ho; (%smallcptr.char.mix;)*>
+<!--end of uri.element-->]]>
+
+<!-- Type: Type of URI; no default -->
+
+<!ENTITY % uri.attlist "INCLUDE">
+<![%uri.attlist;[
+<!ATTLIST uri
+		type	CDATA	#IMPLIED
+		%common.attrib;
+		%uri.role.attrib;
+		%local.uri.attrib;
+>
+<!--end of uri.attlist-->]]>
+<!--end of uri.module-->]]>
+
+<!ENTITY % token.module "INCLUDE">
+<![%token.module;[
+<!ENTITY % local.token.attrib "">
+<!ENTITY % token.role.attrib "%role.attrib;">
+
+<!ENTITY % token.element "INCLUDE">
+<![%token.element;[
+<!--doc:A unit of information.-->
+<!ELEMENT token %ho; (%smallcptr.char.mix;)*>
+<!--end of token.element-->]]>
+
+<!ENTITY % token.attlist "INCLUDE">
+<![%token.attlist;[
+<!ATTLIST token
+		%common.attrib;
+		%token.role.attrib;
+		%local.token.attrib;
+>
+<!--end of token.attlist-->]]>
+<!--end of token.module-->]]>
+
+<!ENTITY % type.module "INCLUDE">
+<![%type.module;[
+<!ENTITY % local.type.attrib "">
+<!ENTITY % type.role.attrib "%role.attrib;">
+
+<!ENTITY % type.element "INCLUDE">
+<![%type.element;[
+<!--doc:The classification of a value.-->
+<!ELEMENT type %ho; (%smallcptr.char.mix;)*>
+<!--end of type.element-->]]>
+
+<!ENTITY % type.attlist "INCLUDE">
+<![%type.attlist;[
+<!ATTLIST type
+		%common.attrib;
+		%type.role.attrib;
+		%local.type.attrib;
+>
+<!--end of type.attlist-->]]>
+<!--end of type.module-->]]>
+
+<!ENTITY % userinput.module "INCLUDE">
+<![%userinput.module;[
+<!ENTITY % local.userinput.attrib "">
+<!ENTITY % userinput.role.attrib "%role.attrib;">
+
+<!ENTITY % userinput.element "INCLUDE">
+<![%userinput.element;[
+<!--doc:Data entered by the user.-->
+<!ELEMENT userinput %ho; (%cptr.char.mix;|co)*>
+<!--end of userinput.element-->]]>
+
+<!ENTITY % userinput.attlist "INCLUDE">
+<![%userinput.attlist;[
+<!ATTLIST userinput
+		%moreinfo.attrib;
+		%common.attrib;
+		%userinput.role.attrib;
+		%local.userinput.attrib;
+>
+<!--end of userinput.attlist-->]]>
+<!--end of userinput.module-->]]>
+
+<!ENTITY % termdef.module "INCLUDE">
+<![%termdef.module;[
+<!ENTITY % local.termdef.attrib "">
+<!ENTITY % termdef.role.attrib "%role.attrib;">
+
+<!ENTITY % termdef.element "INCLUDE">
+<![%termdef.element;[
+<!--doc:An inline definition of a term.-->
+<!ELEMENT termdef %ho; (%para.char.mix;)*>
+<!--end of termdef.element-->]]>
+
+<!ENTITY % termdef.attlist "INCLUDE">
+<![%termdef.attlist;[
+<!ATTLIST termdef
+		%common.attrib;
+		%termdef.role.attrib;
+		%local.termdef.attrib;
+>
+<!--end of termdef.attlist-->]]>
+<!--end of termdef.module-->]]>
+
+<!-- General words and phrases ............................................ -->
+
+<!ENTITY % abbrev.module "INCLUDE">
+<![%abbrev.module;[
+<!ENTITY % local.abbrev.attrib "">
+<!ENTITY % abbrev.role.attrib "%role.attrib;">
+
+<!ENTITY % abbrev.element "INCLUDE">
+<![%abbrev.element;[
+<!--doc:An abbreviation, especially one followed by a period.-->
+<!ELEMENT abbrev %ho; (%word.char.mix;)*>
+<!--end of abbrev.element-->]]>
+
+<!ENTITY % abbrev.attlist "INCLUDE">
+<![%abbrev.attlist;[
+<!ATTLIST abbrev
+		%common.attrib;
+		%abbrev.role.attrib;
+		%local.abbrev.attrib;
+>
+<!--end of abbrev.attlist-->]]>
+<!--end of abbrev.module-->]]>
+
+<!ENTITY % acronym.module "INCLUDE">
+<![%acronym.module;[
+<!ENTITY % local.acronym.attrib "">
+<!ENTITY % acronym.role.attrib "%role.attrib;">
+
+<!ENTITY % acronym.element "INCLUDE">
+<![%acronym.element;[
+<!--doc:An often pronounceable word made from the initial (or selected) letters of a name or phrase.-->
+<!ELEMENT acronym %ho; (%word.char.mix;)*
+		%acronym.exclusion;>
+<!--end of acronym.element-->]]>
+
+<!ENTITY % acronym.attlist "INCLUDE">
+<![%acronym.attlist;[
+<!ATTLIST acronym
+		%common.attrib;
+		%acronym.role.attrib;
+		%local.acronym.attrib;
+>
+<!--end of acronym.attlist-->]]>
+<!--end of acronym.module-->]]>
+
+<!ENTITY % citation.module "INCLUDE">
+<![%citation.module;[
+<!ENTITY % local.citation.attrib "">
+<!ENTITY % citation.role.attrib "%role.attrib;">
+
+<!ENTITY % citation.element "INCLUDE">
+<![%citation.element;[
+<!--doc:An inline bibliographic reference to another published work.-->
+<!ELEMENT citation %ho; (%para.char.mix;)*>
+<!--end of citation.element-->]]>
+
+<!ENTITY % citation.attlist "INCLUDE">
+<![%citation.attlist;[
+<!ATTLIST citation
+		%common.attrib;
+		%citation.role.attrib;
+		%local.citation.attrib;
+>
+<!--end of citation.attlist-->]]>
+<!--end of citation.module-->]]>
+
+<!ENTITY % citerefentry.module "INCLUDE">
+<![%citerefentry.module;[
+<!ENTITY % local.citerefentry.attrib "">
+<!ENTITY % citerefentry.role.attrib "%role.attrib;">
+
+<!ENTITY % citerefentry.element "INCLUDE">
+<![%citerefentry.element;[
+<!--doc:A citation to a reference page.-->
+<!ELEMENT citerefentry %ho; (refentrytitle, manvolnum?)>
+<!--end of citerefentry.element-->]]>
+
+<!ENTITY % citerefentry.attlist "INCLUDE">
+<![%citerefentry.attlist;[
+<!ATTLIST citerefentry
+		%common.attrib;
+		%citerefentry.role.attrib;
+		%local.citerefentry.attrib;
+>
+<!--end of citerefentry.attlist-->]]>
+<!--end of citerefentry.module-->]]>
+
+<!ENTITY % refentrytitle.module "INCLUDE">
+<![%refentrytitle.module;[
+<!ENTITY % local.refentrytitle.attrib "">
+<!ENTITY % refentrytitle.role.attrib "%role.attrib;">
+
+<!ENTITY % refentrytitle.element "INCLUDE">
+<![%refentrytitle.element;[
+<!--doc:The title of a reference page.-->
+<!ELEMENT refentrytitle %ho; (%para.char.mix;)*>
+<!--end of refentrytitle.element-->]]>
+
+<!ENTITY % refentrytitle.attlist "INCLUDE">
+<![%refentrytitle.attlist;[
+<!ATTLIST refentrytitle
+		%common.attrib;
+		%refentrytitle.role.attrib;
+		%local.refentrytitle.attrib;
+>
+<!--end of refentrytitle.attlist-->]]>
+<!--end of refentrytitle.module-->]]>
+
+<!ENTITY % manvolnum.module "INCLUDE">
+<![%manvolnum.module;[
+<!ENTITY % local.manvolnum.attrib "">
+<!ENTITY % namvolnum.role.attrib "%role.attrib;">
+
+<!ENTITY % manvolnum.element "INCLUDE">
+<![%manvolnum.element;[
+<!--doc:A reference volume number.-->
+<!ELEMENT manvolnum %ho; (%word.char.mix;)*>
+<!--end of manvolnum.element-->]]>
+
+<!ENTITY % manvolnum.attlist "INCLUDE">
+<![%manvolnum.attlist;[
+<!ATTLIST manvolnum
+		%common.attrib;
+		%namvolnum.role.attrib;
+		%local.manvolnum.attrib;
+>
+<!--end of manvolnum.attlist-->]]>
+<!--end of manvolnum.module-->]]>
+
+<!ENTITY % citetitle.module "INCLUDE">
+<![%citetitle.module;[
+<!ENTITY % local.citetitle.attrib "">
+<!ENTITY % citetitle.role.attrib "%role.attrib;">
+
+<!ENTITY % citetitle.element "INCLUDE">
+<![%citetitle.element;[
+<!--doc:The title of a cited work.-->
+<!ELEMENT citetitle %ho; (%para.char.mix;)*>
+<!--end of citetitle.element-->]]>
+
+<!-- Pubwork: Genre of published work cited; no default -->
+
+
+<!ENTITY % citetitle.attlist "INCLUDE">
+<![%citetitle.attlist;[
+<!ATTLIST citetitle
+		pubwork		(article
+				|book
+				|chapter
+				|part
+				|refentry
+				|section
+				|journal
+				|series
+				|set
+				|manuscript
+				|cdrom
+				|dvd
+				|wiki
+				|gopher
+				|bbs
+                                |emailmessage
+                                |webpage
+                                |newsposting)	#IMPLIED
+		%common.attrib;
+		%citetitle.role.attrib;
+		%local.citetitle.attrib;
+>
+<!--end of citetitle.attlist-->]]>
+<!--end of citetitle.module-->]]>
+
+<!ENTITY % emphasis.module "INCLUDE">
+<![%emphasis.module;[
+<!ENTITY % local.emphasis.attrib "">
+<!ENTITY % emphasis.role.attrib "%role.attrib;">
+
+<!ENTITY % emphasis.element "INCLUDE">
+<![%emphasis.element;[
+<!--doc:Emphasized text.-->
+<!ELEMENT emphasis %ho; (%para.char.mix;)*>
+<!--end of emphasis.element-->]]>
+
+<!ENTITY % emphasis.attlist "INCLUDE">
+<![%emphasis.attlist;[
+<!ATTLIST emphasis
+		%common.attrib;
+		%emphasis.role.attrib;
+		%local.emphasis.attrib;
+>
+<!--end of emphasis.attlist-->]]>
+<!--end of emphasis.module-->]]>
+
+<!ENTITY % foreignphrase.module "INCLUDE">
+<![%foreignphrase.module;[
+<!ENTITY % local.foreignphrase.attrib "">
+<!ENTITY % foreignphrase.role.attrib "%role.attrib;">
+
+<!ENTITY % foreignphrase.element "INCLUDE">
+<![%foreignphrase.element;[
+<!--doc:A word or phrase in a language other than the primary language of the document.-->
+<!ELEMENT foreignphrase %ho; (%para.char.mix;)*>
+<!--end of foreignphrase.element-->]]>
+
+<!ENTITY % foreignphrase.attlist "INCLUDE">
+<![%foreignphrase.attlist;[
+<!ATTLIST foreignphrase
+		%common.attrib;
+		%foreignphrase.role.attrib;
+		%local.foreignphrase.attrib;
+>
+<!--end of foreignphrase.attlist-->]]>
+<!--end of foreignphrase.module-->]]>
+
+<!ENTITY % glossterm.module "INCLUDE">
+<![%glossterm.module;[
+<!ENTITY % local.glossterm.attrib "">
+<!ENTITY % glossterm.role.attrib "%role.attrib;">
+
+<!ENTITY % glossterm.element "INCLUDE">
+<![%glossterm.element;[
+<!--doc:A glossary term.-->
+<!ELEMENT glossterm %ho; (%para.char.mix;)*
+		%glossterm.exclusion;>
+<!--end of glossterm.element-->]]>
+
+<!-- to GlossEntry if Glossterm used in text -->
+<!-- BaseForm: Provides the form of GlossTerm to be used
+		for indexing -->
+
+<!ENTITY % glossterm.attlist "INCLUDE">
+<![%glossterm.attlist;[
+<!ATTLIST glossterm
+		baseform	CDATA		#IMPLIED
+		%linkend.attrib;
+		%common.attrib;
+		%glossterm.role.attrib;
+		%local.glossterm.attrib;
+>
+<!--end of glossterm.attlist-->]]>
+<!--end of glossterm.module-->]]>
+
+<!ENTITY % firstterm.module "INCLUDE">
+<![%firstterm.module;[
+<!ENTITY % local.firstterm.attrib "">
+<!ENTITY % firstterm.role.attrib "%role.attrib;">
+
+<!ENTITY % firstterm.element "INCLUDE">
+<![%firstterm.element;[
+<!--doc:The first occurrence of a term.-->
+<!ELEMENT firstterm %ho; (%para.char.mix;)*
+		%glossterm.exclusion;>
+<!--end of firstterm.element-->]]>
+
+<!-- to GlossEntry or other explanation -->
+
+
+<!ENTITY % firstterm.attlist "INCLUDE">
+<![%firstterm.attlist;[
+<!ATTLIST firstterm
+		baseform	CDATA		#IMPLIED
+		%linkend.attrib;
+		%common.attrib;
+		%firstterm.role.attrib;
+		%local.firstterm.attrib;
+>
+<!--end of firstterm.attlist-->]]>
+<!--end of firstterm.module-->]]>
+
+<!ENTITY % phrase.module "INCLUDE">
+<![%phrase.module;[
+<!ENTITY % local.phrase.attrib "">
+<!ENTITY % phrase.role.attrib "%role.attrib;">
+
+<!ENTITY % phrase.element "INCLUDE">
+<![%phrase.element;[
+<!--doc:A span of text.-->
+<!ELEMENT phrase %ho; (%para.char.mix;)*>
+<!--end of phrase.element-->]]>
+
+<!ENTITY % phrase.attlist "INCLUDE">
+<![%phrase.attlist;[
+<!ATTLIST phrase
+		%common.attrib;
+		%phrase.role.attrib;
+		%local.phrase.attrib;
+>
+<!--end of phrase.attlist-->]]>
+<!--end of phrase.module-->]]>
+
+<!ENTITY % quote.module "INCLUDE">
+<![%quote.module;[
+<!ENTITY % local.quote.attrib "">
+<!ENTITY % quote.role.attrib "%role.attrib;">
+
+<!ENTITY % quote.element "INCLUDE">
+<![%quote.element;[
+<!--doc:An inline quotation.-->
+<!ELEMENT quote %ho; (%para.char.mix;)*>
+<!--end of quote.element-->]]>
+
+<!ENTITY % quote.attlist "INCLUDE">
+<![%quote.attlist;[
+<!ATTLIST quote
+		%common.attrib;
+		%quote.role.attrib;
+		%local.quote.attrib;
+>
+<!--end of quote.attlist-->]]>
+<!--end of quote.module-->]]>
+
+<!ENTITY % ssscript.module "INCLUDE">
+<![%ssscript.module;[
+<!ENTITY % local.ssscript.attrib "">
+<!ENTITY % ssscript.role.attrib "%role.attrib;">
+
+<!ENTITY % subscript.element "INCLUDE">
+<![%subscript.element;[
+<!--doc:A subscript (as in H{^2}O, the molecular formula for water).-->
+<!ELEMENT subscript %ho; (#PCDATA
+		| %link.char.class;
+		| emphasis
+		| replaceable
+		| symbol
+		| inlinegraphic
+                | inlinemediaobject
+		| %base.char.class;
+		| %other.char.class;)*
+		%ubiq.exclusion;>
+<!--end of subscript.element-->]]>
+
+<!ENTITY % subscript.attlist "INCLUDE">
+<![%subscript.attlist;[
+<!ATTLIST subscript
+		%common.attrib;
+		%ssscript.role.attrib;
+		%local.ssscript.attrib;
+>
+<!--end of subscript.attlist-->]]>
+
+<!ENTITY % superscript.element "INCLUDE">
+<![%superscript.element;[
+<!--doc:A superscript (as in x^2, the mathematical notation for x multiplied by itself).-->
+<!ELEMENT superscript %ho; (#PCDATA
+		| %link.char.class;
+		| emphasis
+		| replaceable
+		| symbol
+		| inlinegraphic
+                | inlinemediaobject
+		| %base.char.class;
+		| %other.char.class;)*
+		%ubiq.exclusion;>
+<!--end of superscript.element-->]]>
+
+<!ENTITY % superscript.attlist "INCLUDE">
+<![%superscript.attlist;[
+<!ATTLIST superscript
+		%common.attrib;
+		%ssscript.role.attrib;
+		%local.ssscript.attrib;
+>
+<!--end of superscript.attlist-->]]>
+<!--end of ssscript.module-->]]>
+
+<!ENTITY % trademark.module "INCLUDE">
+<![%trademark.module;[
+<!ENTITY % local.trademark.attrib "">
+<!ENTITY % trademark.role.attrib "%role.attrib;">
+
+<!ENTITY % trademark.element "INCLUDE">
+<![%trademark.element;[
+<!--doc:A trademark.-->
+<!ELEMENT trademark %ho; (#PCDATA
+		| %link.char.class;
+		| %tech.char.class;
+		| %base.char.class;
+		| %other.char.class;
+		| inlinegraphic
+                | inlinemediaobject
+		| emphasis)*>
+<!--end of trademark.element-->]]>
+
+<!-- Class: More precisely identifies the item the element names -->
+
+
+<!ENTITY % trademark.attlist "INCLUDE">
+<![%trademark.attlist;[
+<!ATTLIST trademark
+		class		(service
+				|trade
+				|registered
+				|copyright)	'trade'
+		%common.attrib;
+		%trademark.role.attrib;
+		%local.trademark.attrib;
+>
+<!--end of trademark.attlist-->]]>
+<!--end of trademark.module-->]]>
+
+<!ENTITY % wordasword.module "INCLUDE">
+<![%wordasword.module;[
+<!ENTITY % local.wordasword.attrib "">
+<!ENTITY % wordasword.role.attrib "%role.attrib;">
+
+<!ENTITY % wordasword.element "INCLUDE">
+<![%wordasword.element;[
+<!--doc:A word meant specifically as a word and not representing anything else.-->
+<!ELEMENT wordasword %ho; (%word.char.mix;)*>
+<!--end of wordasword.element-->]]>
+
+<!ENTITY % wordasword.attlist "INCLUDE">
+<![%wordasword.attlist;[
+<!ATTLIST wordasword
+		%common.attrib;
+		%wordasword.role.attrib;
+		%local.wordasword.attrib;
+>
+<!--end of wordasword.attlist-->]]>
+<!--end of wordasword.module-->]]>
+
+<!-- Links and cross-references ........................................... -->
+
+<!ENTITY % link.module "INCLUDE">
+<![%link.module;[
+<!ENTITY % local.link.attrib "">
+<!ENTITY % link.role.attrib "%role.attrib;">
+
+<!ENTITY % link.element "INCLUDE">
+<![%link.element;[
+<!--doc:A hypertext link.-->
+<!ELEMENT link %ho; (%para.char.mix;)*
+		%links.exclusion;>
+<!--end of link.element-->]]>
+
+<!-- Endterm: ID of element containing text that is to be
+		fetched from elsewhere in the document to appear as
+		the content of this element -->
+<!-- to linked-to object -->
+<!-- Type: Freely assignable parameter -->
+
+
+<!ENTITY % link.attlist "INCLUDE">
+<![%link.attlist;[
+<!ATTLIST link
+		endterm		IDREF		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		type		CDATA		#IMPLIED
+		%linkendreq.attrib;
+		%common.attrib;
+		%link.role.attrib;
+		%local.link.attrib;
+>
+<!--end of link.attlist-->]]>
+<!--end of link.module-->]]>
+
+<!ENTITY % olink.module "INCLUDE">
+<![%olink.module;[
+<!ENTITY % local.olink.attrib "">
+<!ENTITY % olink.role.attrib "%role.attrib;">
+
+<!ENTITY % olink.element "INCLUDE">
+<![%olink.element;[
+<!--doc:A link that addresses its target indirectly, through an entity.-->
+<!ELEMENT olink %ho; (%para.char.mix;)*
+		%links.exclusion;>
+<!--end of olink.element-->]]>
+
+<!-- TargetDocEnt: Name of an entity to be the target of the link -->
+<!-- LinkMode: ID of a ModeSpec containing instructions for
+		operating on the entity named by TargetDocEnt -->
+<!-- LocalInfo: Information that may be passed to ModeSpec -->
+<!-- Type: Freely assignable parameter -->
+
+
+<!ENTITY % olink.attlist "INCLUDE">
+<![%olink.attlist;[
+<!ATTLIST olink
+		targetdocent	ENTITY 		#IMPLIED
+		linkmode	IDREF		#IMPLIED
+		localinfo 	CDATA		#IMPLIED
+		type		CDATA		#IMPLIED
+		targetdoc	CDATA		#IMPLIED
+		targetptr	CDATA		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		%common.attrib;
+		%olink.role.attrib;
+		%local.olink.attrib;
+>
+<!--end of olink.attlist-->]]>
+<!--end of olink.module-->]]>
+
+<!ENTITY % ulink.module "INCLUDE">
+<![%ulink.module;[
+<!ENTITY % local.ulink.attrib "">
+<!ENTITY % ulink.role.attrib "%role.attrib;">
+
+<!ENTITY % ulink.element "INCLUDE">
+<![%ulink.element;[
+<!--doc:A link that addresses its target by means of a URL (Uniform Resource Locator).-->
+<!ELEMENT ulink %ho; (%para.char.mix;)*
+		%links.exclusion;>
+<!--end of ulink.element-->]]>
+
+<!-- URL: uniform resource locator; the target of the ULink -->
+<!-- Type: Freely assignable parameter -->
+
+
+<!ENTITY % ulink.attlist "INCLUDE">
+<![%ulink.attlist;[
+<!ATTLIST ulink
+		url		CDATA		#REQUIRED
+		type		CDATA		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		%common.attrib;
+		%ulink.role.attrib;
+		%local.ulink.attrib;
+>
+<!--end of ulink.attlist-->]]>
+<!--end of ulink.module-->]]>
+
+<!ENTITY % footnoteref.module "INCLUDE">
+<![%footnoteref.module;[
+<!ENTITY % local.footnoteref.attrib "">
+<!ENTITY % footnoteref.role.attrib "%role.attrib;">
+
+<!ENTITY % footnoteref.element "INCLUDE">
+<![%footnoteref.element;[
+<!--doc:A cross reference to a footnote (a footnote mark).-->
+<!ELEMENT footnoteref %ho; EMPTY>
+<!--end of footnoteref.element-->]]>
+
+<!-- to footnote content supplied elsewhere -->
+
+
+<!ENTITY % footnoteref.attlist "INCLUDE">
+<![%footnoteref.attlist;[
+<!ATTLIST footnoteref
+		%linkendreq.attrib;		%label.attrib;
+		%common.attrib;
+		%footnoteref.role.attrib;
+		%local.footnoteref.attrib;
+>
+<!--end of footnoteref.attlist-->]]>
+<!--end of footnoteref.module-->]]>
+
+<!ENTITY % xref.module "INCLUDE">
+<![%xref.module;[
+<!ENTITY % local.xref.attrib "">
+<!ENTITY % xref.role.attrib "%role.attrib;">
+
+<!ENTITY % xref.element "INCLUDE">
+<![%xref.element;[
+<!--doc:A cross reference to another part of the document.-->
+<!ELEMENT xref %ho; EMPTY>
+<!--end of xref.element-->]]>
+
+<!-- Endterm: ID of element containing text that is to be
+		fetched from elsewhere in the document to appear as
+		the content of this element -->
+<!-- to linked-to object -->
+
+
+<!ENTITY % xref.attlist "INCLUDE">
+<![%xref.attlist;[
+<!ATTLIST xref
+		endterm		IDREF		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		%common.attrib;
+		%linkendreq.attrib;
+		%xref.role.attrib;
+		%local.xref.attrib;
+>
+<!--end of xref.attlist-->]]>
+<!--end of xref.module-->]]>
+
+<!ENTITY % biblioref.module "INCLUDE">
+<![%biblioref.module;[
+<!ENTITY % local.biblioref.attrib "">
+<!ENTITY % biblioref.role.attrib "%role.attrib;">
+
+<!ENTITY % biblioref.element "INCLUDE">
+<![%biblioref.element;[
+<!--doc:A cross reference to a bibliographic entry.-->
+<!ELEMENT biblioref %ho; EMPTY>
+<!--end of biblioref.element-->]]>
+
+<!ENTITY % biblioref.attlist "INCLUDE">
+<![%biblioref.attlist;[
+<!ATTLIST biblioref
+		endterm		IDREF		#IMPLIED
+		xrefstyle	CDATA		#IMPLIED
+		units		CDATA		#IMPLIED
+		begin		CDATA		#IMPLIED
+		end		CDATA		#IMPLIED
+		%common.attrib;
+		%linkendreq.attrib;
+		%biblioref.role.attrib;
+		%local.biblioref.attrib;
+>
+<!--end of biblioref.attlist-->]]>
+<!--end of biblioref.module-->]]>
+
+<!-- Ubiquitous elements .................................................. -->
+
+<!ENTITY % anchor.module "INCLUDE">
+<![%anchor.module;[
+<!ENTITY % local.anchor.attrib "">
+<!ENTITY % anchor.role.attrib "%role.attrib;">
+
+<!ENTITY % anchor.element "INCLUDE">
+<![%anchor.element;[
+<!--doc:A spot in the document.-->
+<!ELEMENT anchor %ho; EMPTY>
+<!--end of anchor.element-->]]>
+
+<!-- required -->
+<!-- replaces Lang -->
+
+
+<!ENTITY % anchor.attlist "INCLUDE">
+<![%anchor.attlist;[
+<!ATTLIST anchor
+		%idreq.attrib;		%pagenum.attrib;		%remap.attrib;
+		%xreflabel.attrib;
+		%revisionflag.attrib;
+		%effectivity.attrib;
+		%anchor.role.attrib;
+		%local.anchor.attrib;
+>
+<!--end of anchor.attlist-->]]>
+<!--end of anchor.module-->]]>
+
+<!ENTITY % beginpage.module "INCLUDE">
+<![%beginpage.module;[
+<!ENTITY % local.beginpage.attrib "">
+<!ENTITY % beginpage.role.attrib "%role.attrib;">
+
+<!ENTITY % beginpage.element "INCLUDE">
+<![%beginpage.element;[
+<!--doc:The location of a page break in a print version of the document.-->
+<!ELEMENT beginpage %ho; EMPTY>
+<!--end of beginpage.element-->]]>
+
+<!-- PageNum: Number of page that begins at this point -->
+
+
+<!ENTITY % beginpage.attlist "INCLUDE">
+<![%beginpage.attlist;[
+<!ATTLIST beginpage
+		%pagenum.attrib;
+		%common.attrib;
+		%beginpage.role.attrib;
+		%local.beginpage.attrib;
+>
+<!--end of beginpage.attlist-->]]>
+<!--end of beginpage.module-->]]>
+
+<!-- IndexTerms appear in the text flow for generating or linking an
+     index. -->
+
+<!ENTITY % indexterm.content.module "INCLUDE">
+<![%indexterm.content.module;[
+<!ENTITY % indexterm.module "INCLUDE">
+<![%indexterm.module;[
+<!ENTITY % local.indexterm.attrib "">
+<!ENTITY % indexterm.role.attrib "%role.attrib;">
+
+<!ENTITY % indexterm.element "INCLUDE">
+<![%indexterm.element;[
+<!--doc:A wrapper for terms to be indexed.-->
+<!ELEMENT indexterm %ho; (primary?, ((secondary, ((tertiary, (see|seealso+)?)
+		| see | seealso+)?) | see | seealso+)?)
+			%ubiq.exclusion;>
+<!--end of indexterm.element-->]]>
+
+<!-- Scope: Indicates which generated indices the IndexTerm
+		should appear in: Global (whole document set), Local (this
+		document only), or All (both) -->
+<!-- Significance: Whether this IndexTerm is the most pertinent
+		of its series (Preferred) or not (Normal, the default) -->
+<!-- Class: Indicates type of IndexTerm; default is Singular,
+		or EndOfRange if StartRef is supplied; StartOfRange value
+		must be supplied explicitly on starts of ranges -->
+<!-- StartRef: ID of the IndexTerm that starts the indexing
+		range ended by this IndexTerm -->
+<!-- Zone: IDs of the elements to which the IndexTerm applies,
+		and indicates that the IndexTerm applies to those entire
+		elements rather than the point at which the IndexTerm
+		occurs -->
+
+
+<!ENTITY % indexterm.attlist "INCLUDE">
+<![%indexterm.attlist;[
+<!ATTLIST indexterm
+		%pagenum.attrib;
+		scope		(all
+				|global
+				|local)		#IMPLIED
+		significance	(preferred
+				|normal)	"normal"
+		class		(singular
+				|startofrange
+				|endofrange)	#IMPLIED
+		startref	IDREF		#IMPLIED
+		zone		IDREFS		#IMPLIED
+		type		CDATA		#IMPLIED
+		%common.attrib;
+		%indexterm.role.attrib;
+		%local.indexterm.attrib;
+>
+<!--end of indexterm.attlist-->]]>
+<!--end of indexterm.module-->]]>
+
+<!ENTITY % primsecter.module "INCLUDE">
+<![%primsecter.module;[
+<!ENTITY % local.primsecter.attrib "">
+<!ENTITY % primsecter.role.attrib "%role.attrib;">
+
+
+<!ENTITY % primary.element "INCLUDE">
+<![%primary.element;[
+<!--doc:The primary word or phrase under which an index term should be sorted.-->
+<!ELEMENT primary %ho;   (%ndxterm.char.mix;)*>
+<!--end of primary.element-->]]>
+<!-- SortAs: Alternate sort string for index sorting, e.g.,
+		"fourteen" for an element containing "14" -->
+
+<!ENTITY % primary.attlist "INCLUDE">
+<![%primary.attlist;[
+<!ATTLIST primary
+		sortas		CDATA		#IMPLIED
+		%common.attrib;
+		%primsecter.role.attrib;
+		%local.primsecter.attrib;
+>
+<!--end of primary.attlist-->]]>
+
+
+<!ENTITY % secondary.element "INCLUDE">
+<![%secondary.element;[
+<!--doc:A secondary word or phrase in an index term.-->
+<!ELEMENT secondary %ho; (%ndxterm.char.mix;)*>
+<!--end of secondary.element-->]]>
+<!-- SortAs: Alternate sort string for index sorting, e.g.,
+		"fourteen" for an element containing "14" -->
+
+<!ENTITY % secondary.attlist "INCLUDE">
+<![%secondary.attlist;[
+<!ATTLIST secondary
+		sortas		CDATA		#IMPLIED
+		%common.attrib;
+		%primsecter.role.attrib;
+		%local.primsecter.attrib;
+>
+<!--end of secondary.attlist-->]]>
+
+
+<!ENTITY % tertiary.element "INCLUDE">
+<![%tertiary.element;[
+<!--doc:A tertiary word or phrase in an index term.-->
+<!ELEMENT tertiary %ho;  (%ndxterm.char.mix;)*>
+<!--end of tertiary.element-->]]>
+<!-- SortAs: Alternate sort string for index sorting, e.g.,
+		"fourteen" for an element containing "14" -->
+
+<!ENTITY % tertiary.attlist "INCLUDE">
+<![%tertiary.attlist;[
+<!ATTLIST tertiary
+		sortas		CDATA		#IMPLIED
+		%common.attrib;
+		%primsecter.role.attrib;
+		%local.primsecter.attrib;
+>
+<!--end of tertiary.attlist-->]]>
+
+<!--end of primsecter.module-->]]>
+
+<!ENTITY % seeseealso.module "INCLUDE">
+<![%seeseealso.module;[
+<!ENTITY % local.seeseealso.attrib "">
+<!ENTITY % seeseealso.role.attrib "%role.attrib;">
+
+<!ENTITY % see.element "INCLUDE">
+<![%see.element;[
+<!--doc:Part of an index term directing the reader instead to another entry in the index.-->
+<!ELEMENT see %ho; (%ndxterm.char.mix;)*>
+<!--end of see.element-->]]>
+
+<!ENTITY % see.attlist "INCLUDE">
+<![%see.attlist;[
+<!ATTLIST see
+		%common.attrib;
+		%seeseealso.role.attrib;
+		%local.seeseealso.attrib;
+>
+<!--end of see.attlist-->]]>
+
+<!ENTITY % seealso.element "INCLUDE">
+<![%seealso.element;[
+<!--doc:Part of an index term directing the reader also to another entry in the index.-->
+<!ELEMENT seealso %ho; (%ndxterm.char.mix;)*>
+<!--end of seealso.element-->]]>
+
+<!ENTITY % seealso.attlist "INCLUDE">
+<![%seealso.attlist;[
+<!ATTLIST seealso
+		%common.attrib;
+		%seeseealso.role.attrib;
+		%local.seeseealso.attrib;
+>
+<!--end of seealso.attlist-->]]>
+<!--end of seeseealso.module-->]]>
+<!--end of indexterm.content.module-->]]>
+
+<!-- End of DocBook XML information pool module V4.5 ...................... -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/docbookx.dtd b/xml/tests/testData/xml/DocBookHighlighting2/docbookx.dtd
new file mode 100644
index 0000000..8b43c59
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/docbookx.dtd
@@ -0,0 +1,170 @@
+<!-- ...................................................................... -->
+<!-- DocBook XML DTD V4.5 ................................................. -->
+<!-- File docbookx.dtd .................................................... -->
+
+<!-- Copyright 1992-2006 HaL Computer Systems, Inc.,
+     O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
+     Corporation, Norman Walsh, Sun Microsystems, Inc., and the
+     Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     See also http://docbook.org/specs/
+
+     $Id: docbookx.dtd 6340 2006-10-03 13:23:24Z nwalsh $
+
+     Permission to use, copy, modify and distribute the DocBook XML DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This is the driver file for V4.5 of the DocBook DTD.
+     Please use the following formal public identifier to identify it:
+
+     "-//OASIS//DTD DocBook XML V4.5//EN"
+
+     For example, if your document's top-level element is Book, and
+     you are using DocBook directly, use the FPI in the DOCTYPE
+     declaration:
+
+     <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+                    "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
+                    [...]>
+
+     Or, if you have a higher-level driver file that customizes DocBook,
+     use the FPI in the parameter entity declaration:
+
+     <!ENTITY % DocBookDTD PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+                "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+     %DocBookDTD;
+
+     See the documentation for detailed information on the parameter
+     entity and module scheme used in DocBook, customizing DocBook and
+     planning for interchange, and changes made since the last release
+     of DocBook.
+-->
+
+<!-- ...................................................................... -->
+<!-- Enable SGML features ................................................. -->
+
+<!ENTITY % sgml.features "IGNORE">
+<![%sgml.features;[
+<!ENTITY % xml.features "IGNORE">
+]]>
+<!ENTITY % xml.features "INCLUDE">
+
+<![%sgml.features;[
+<![%xml.features;[
+
+<!-- ERROR: Exactly one of xml.features and sgml.features must be turned on! -->
+<!ENTITY % dbnotn SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+<!ENTITY % dbcent SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+<!ENTITY % dbpool SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+<!ENTITY % dbhier SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+<!ENTITY % dbgenent SYSTEM "http://www.oasis-open.org/docbook/xml/configerror.txt">
+
+]]>
+]]>
+
+<![%sgml.features;[
+<!ENTITY % ho "- O">
+<!ENTITY % hh "- -">
+]]>
+
+<![%xml.features;[
+<!ENTITY % ho "">
+<!ENTITY % hh "">
+]]>
+
+<!-- ...................................................................... -->
+<!-- Notation declarations ................................................ -->
+
+<!ENTITY % dbnotn.module "INCLUDE">
+<![%dbnotn.module;[
+<!ENTITY % dbnotn PUBLIC
+"-//OASIS//ENTITIES DocBook Notations V4.5//EN"
+"dbnotnx.mod">
+%dbnotn;
+]]>
+
+<!-- ...................................................................... -->
+<!-- ISO character entity sets ............................................ -->
+
+<!ENTITY % dbcent.module "INCLUDE">
+<![%dbcent.module;[
+
+<!ENTITY % dbcent.euro "INCLUDE">
+<![%dbcent.euro;[
+<![%sgml.features;[
+<!ENTITY euro SDATA "[euro  ]"><!-- euro sign -->
+]]>
+<![%xml.features;[
+<!ENTITY euro "&#x20AC;"><!-- euro sign, U+20AC NEW -->
+]]>
+]]>
+
+<!ENTITY % dbcent PUBLIC
+"-//OASIS//ENTITIES DocBook Character Entities V4.5//EN"
+"dbcentx.mod">
+%dbcent;
+]]>
+
+<!-- ...................................................................... -->
+<!-- DTD modules .......................................................... -->
+
+<!-- Information pool .............. -->
+
+<!ENTITY % dbpool.module "INCLUDE">
+<![ %dbpool.module; [
+<!ENTITY % dbpool PUBLIC
+"-//OASIS//ELEMENTS DocBook Information Pool V4.5//EN"
+"dbpoolx.mod">
+%dbpool;
+]]>
+
+<!-- Redeclaration placeholder ..... -->
+
+<!ENTITY % intermod.redecl.module "IGNORE">
+<![%intermod.redecl.module;[
+<!-- Defining rdbmods here makes some buggy XML parsers happy. -->
+<!ENTITY % rdbmods "">
+%rdbmods;
+<!--end of intermod.redecl.module-->]]>
+
+<!-- Document hierarchy ............ -->
+
+<!ENTITY % dbhier.module "INCLUDE">
+<![ %dbhier.module; [
+<!ENTITY % dbhier PUBLIC
+"-//OASIS//ELEMENTS DocBook Document Hierarchy V4.5//EN"
+"dbhierx.mod">
+%dbhier;
+]]>
+
+<!-- ...................................................................... -->
+<!-- Other general entities ............................................... -->
+
+<!ENTITY % dbgenent.module "INCLUDE">
+<![ %dbgenent.module; [
+<!ENTITY % dbgenent PUBLIC
+"-//OASIS//ENTITIES DocBook Additional General Entities V4.5//EN"
+"dbgenent.mod">
+%dbgenent;
+]]>
+
+<!-- End of DocBook XML DTD V4.5 .......................................... -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/htmltblx.mod b/xml/tests/testData/xml/DocBookHighlighting2/htmltblx.mod
new file mode 100644
index 0000000..cdaefed
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/htmltblx.mod
@@ -0,0 +1,245 @@
+<!-- ...................................................................... -->
+<!-- DocBook XML HTML Table Module V4.5 ................................... -->
+<!-- File htmltblx.mod .................................................... -->
+
+<!-- Copyright 2003-2006 ArborText, Inc., Norman Walsh, Sun Microsystems,
+     Inc., and the Organization for the Advancement of Structured Information
+     Standards (OASIS).
+
+     $Id: htmltblx.mod 6340 2006-10-03 13:23:24Z nwalsh $
+
+     Permission to use, copy, modify and distribute the DocBook XML DTD
+     and its accompanying documentation for any purpose and without fee
+     is hereby granted in perpetuity, provided that the above copyright
+     notice and this paragraph appear in all copies.  The copyright
+     holders make no representation about the suitability of the DTD for
+     any purpose.  It is provided "as is" without expressed or implied
+     warranty.
+
+     If you modify the DocBook XML DTD in any way, except for declaring and
+     referencing additional sets of general entities and declaring
+     additional notations, label your DTD as a variant of DocBook.  See
+     the maintenance documentation for more information.
+
+     Please direct all questions, bug reports, or suggestions for
+     changes to the [email protected] mailing list. For more
+     information, see http://www.oasis-open.org/docbook/.
+-->
+
+<!-- ...................................................................... -->
+
+<!-- This module contains the definitions for elements that are
+     isomorphic to the HTML elements. One could argue we should
+     instead have based ourselves on the XHTML Table Module, but the
+     HTML one is more like what browsers are likely to accept today
+     and users are likely to use.
+
+     This module has been developed for use with the DocBook V4.5
+     "union table model" in which elements and attlists common to both
+     models are defined (as the union) in the CALS table module by
+     setting various parameter entities appropriately in this file.
+
+     In DTD driver files referring to this module, please use an entity
+     declaration that uses the public identifier shown below:
+
+     <!ENTITY % htmltbl PUBLIC
+     "-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN"
+     "htmltblx.mod">
+     %htmltbl;
+
+     See the documentation for detailed information on the parameter
+     entity and module scheme used in DocBook, customizing DocBook and
+     planning for interchange, and changes made since the last release
+     of DocBook.
+-->
+
+<!--======================= XHTML Tables =======================================-->
+
+<!ENTITY % html.coreattrs
+ "%common.attrib;
+  class       CDATA          #IMPLIED
+  style       CDATA          #IMPLIED
+  title       CDATA         #IMPLIED"
+  >
+
+<!-- Does not contain lang or dir because they are in %common.attribs -->
+<![%sgml.features;[
+<!ENTITY % i18n "">
+]]>
+<!ENTITY % i18n
+ "xml:lang    NMTOKEN        #IMPLIED"
+  >
+
+<!ENTITY % events
+ "onclick     CDATA       #IMPLIED
+  ondblclick  CDATA       #IMPLIED
+  onmousedown CDATA       #IMPLIED
+  onmouseup   CDATA       #IMPLIED
+  onmouseover CDATA       #IMPLIED
+  onmousemove CDATA       #IMPLIED
+  onmouseout  CDATA       #IMPLIED
+  onkeypress  CDATA       #IMPLIED
+  onkeydown   CDATA       #IMPLIED
+  onkeyup     CDATA       #IMPLIED"
+  >
+
+<!ENTITY % attrs "%html.coreattrs; %i18n; %events;">
+
+<!ENTITY % cellhalign
+  "align      (left|center|right|justify|char) #IMPLIED
+   char       CDATA    #IMPLIED
+   charoff    CDATA       #IMPLIED"
+  >
+
+<!ENTITY % cellvalign
+  "valign     (top|middle|bottom|baseline) #IMPLIED"
+  >
+
+<!--doc:A group of columns in an HTML table.-->
+<!ELEMENT colgroup %ho; (col)*>
+<!--doc:Specifications for a column in an HTML table.-->
+<!ELEMENT col %ho; EMPTY>
+<!--doc:A row in an HTML table.-->
+<!ELEMENT tr %ho;  (th|td)+>
+<!--doc:A table header entry in an HTML table.-->
+<!ELEMENT th %ho;  (%para.char.mix; | %tabentry.mix; | table | informaltable)*>
+<!--doc:A table ntry in an HTML table.-->
+<!ELEMENT td %ho;  (%para.char.mix; | %tabentry.mix; | table | informaltable)*>
+
+<!ATTLIST colgroup
+  %attrs;
+  span        CDATA       "1"
+  width       CDATA  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST col
+  %attrs;
+  span        CDATA       "1"
+  width       CDATA  #IMPLIED
+  %cellhalign;
+  %cellvalign;
+  >
+
+<!ATTLIST tr
+  %attrs;
+  %cellhalign;
+  %cellvalign;
+  bgcolor     CDATA        #IMPLIED
+  >
+
+<!ATTLIST th
+  %attrs;
+  abbr        CDATA         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       (row|col|rowgroup|colgroup)   #IMPLIED
+  rowspan     CDATA       "1"
+  colspan     CDATA       "1"
+  %cellhalign;
+  %cellvalign;
+  nowrap      (nowrap)       #IMPLIED
+  bgcolor     CDATA         #IMPLIED
+  width       CDATA       #IMPLIED
+  height      CDATA       #IMPLIED
+  >
+
+<!ATTLIST td
+  %attrs;
+  abbr        CDATA         #IMPLIED
+  axis        CDATA          #IMPLIED
+  headers     IDREFS         #IMPLIED
+  scope       (row|col|rowgroup|colgroup)   #IMPLIED
+  rowspan     CDATA       "1"
+  colspan     CDATA       "1"
+  %cellhalign;
+  %cellvalign;
+  nowrap      (nowrap)       #IMPLIED
+  bgcolor     CDATA         #IMPLIED
+  width       CDATA       #IMPLIED
+  height      CDATA       #IMPLIED
+  >
+
+<!-- ====================================================== -->
+<!--        Set up to read in the CALS model configured to
+            merge with the XHTML table model                -->
+<!-- ====================================================== -->
+
+<!ENTITY % tables.role.attrib "%role.attrib;">
+
+<!-- Add label and role attributes to table and informaltable -->
+<!ENTITY % bodyatt "
+		floatstyle	CDATA			#IMPLIED
+		rowheader	(firstcol|norowheader)	#IMPLIED
+                %label.attrib;"
+>
+
+<!-- Add common attributes to Table, TGroup, TBody, THead, TFoot, Row, 
+     EntryTbl, and Entry (and InformalTable element). -->
+
+<!ENTITY % secur "
+	%common.attrib;
+	class       CDATA          #IMPLIED
+	style       CDATA          #IMPLIED
+	title       CDATA         #IMPLIED
+	%i18n;
+	%events;
+	%tables.role.attrib;">
+
+<!ENTITY % common.table.attribs
+	"%bodyatt;
+	%secur;">
+
+<!-- Content model for Table (that also allows HTML tables) -->
+<!ENTITY % tbl.table.mdl
+	"((blockinfo?,
+           (%formalobject.title.content;),
+           (%ndxterm.class;)*,
+           textobject*,
+           (graphic+|mediaobject+|tgroup+))
+         |(caption, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+)))">
+
+<!ENTITY % informal.tbl.table.mdl
+	"(textobject*,
+          (graphic+|mediaobject+|tgroup+))
+         | ((col*|colgroup*), thead?, tfoot?, (tbody+|tr+))">
+
+<!-- Attributes for Table (including HTML ones) -->
+
+<!-- N.B. rules = (none | groups | rows | cols | all) but it can't be spec'd -->
+<!-- that way because 'all' already occurs in a different enumeration in -->
+<!-- CALS tables (frame). -->
+
+<!ENTITY % tbl.table.att        '
+    tabstyle    CDATA           #IMPLIED
+    tocentry    %yesorno.attvals;       #IMPLIED
+    shortentry  %yesorno.attvals;       #IMPLIED
+    orient      (port|land)     #IMPLIED
+    pgwide      %yesorno.attvals;       #IMPLIED 
+    summary     CDATA          #IMPLIED
+    width       CDATA        #IMPLIED
+    border      CDATA        #IMPLIED
+    rules       CDATA		#IMPLIED
+    cellspacing CDATA        #IMPLIED
+    cellpadding CDATA        #IMPLIED
+    align       (left|center|right)   #IMPLIED
+    bgcolor     CDATA         #IMPLIED
+'>
+
+<!ENTITY % tbl.frame.attval "void|above|below|hsides|lhs|rhs|vsides|box|border|
+top|bottom|topbot|all|sides|none">
+
+<!-- Allow either objects or inlines; beware of REs between elements. -->
+<!ENTITY % tbl.entry.mdl "%para.char.mix; | %tabentry.mix;">
+
+<!-- thead, tfoot, and tbody are defined in both table models,
+     so we set up parameter entities to define union models for them
+ -->
+
+<!ENTITY % tbl.hdft.mdl        "(tr+|(colspec*,row+))">
+<!ENTITY % tbl.tbody.mdl       "(tr+|row+)">
+<!ENTITY % tbl.valign.attval   "top|middle|bottom|baseline">
+
+<!-- End of DocBook XML HTML Table Module V4.5 ............................ -->
+<!-- ...................................................................... -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isoamsa.ent b/xml/tests/testData/xml/DocBookHighlighting2/isoamsa.ent
new file mode 100644
index 0000000..dac3e62
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isoamsa.ent
@@ -0,0 +1,97 @@
+
+<!--
+     File isoamsa.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isoamsa.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isoamsa.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isoamsa PUBLIC
+         "ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isoamsa.ent"
+       >
+       %isoamsa;
+
+-->
+
+<!ENTITY cularr           "&#x021B6;" ><!--ANTICLOCKWISE TOP SEMICIRCLE ARROW -->
+<!ENTITY curarr           "&#x021B7;" ><!--CLOCKWISE TOP SEMICIRCLE ARROW -->
+<!ENTITY dArr             "&#x021D3;" ><!--DOWNWARDS DOUBLE ARROW -->
+<!ENTITY darr2            "&#x021CA;" ><!--DOWNWARDS PAIRED ARROWS -->
+<!ENTITY dharl            "&#x021C3;" ><!--DOWNWARDS HARPOON WITH BARB LEFTWARDS -->
+<!ENTITY dharr            "&#x021C2;" ><!--DOWNWARDS HARPOON WITH BARB RIGHTWARDS -->
+<!ENTITY dlarr            "&#x02199;" ><!--SOUTH WEST ARROW -->
+<!ENTITY drarr            "&#x02198;" ><!--SOUTH EAST ARROW -->
+<!ENTITY hArr             "&#x021D4;" ><!--LEFT RIGHT DOUBLE ARROW -->
+<!ENTITY harr             "&#x02194;" ><!--LEFT RIGHT ARROW -->
+<!ENTITY harrw            "&#x021AD;" ><!--LEFT RIGHT WAVE ARROW -->
+<!ENTITY lAarr            "&#x021DA;" ><!--LEFTWARDS TRIPLE ARROW -->
+<!ENTITY Larr             "&#x0219E;" ><!--LEFTWARDS TWO HEADED ARROW -->
+<!ENTITY larr2            "&#x021C7;" ><!--LEFTWARDS PAIRED ARROWS -->
+<!ENTITY larrhk           "&#x021A9;" ><!--LEFTWARDS ARROW WITH HOOK -->
+<!ENTITY larrlp           "&#x021AB;" ><!--LEFTWARDS ARROW WITH LOOP -->
+<!ENTITY larrtl           "&#x021A2;" ><!--LEFTWARDS ARROW WITH TAIL -->
+<!ENTITY lhard            "&#x021BD;" ><!--LEFTWARDS HARPOON WITH BARB DOWNWARDS -->
+<!ENTITY lharu            "&#x021BC;" ><!--LEFTWARDS HARPOON WITH BARB UPWARDS -->
+<!ENTITY lrarr2           "&#x021C6;" ><!--LEFTWARDS ARROW OVER RIGHTWARDS ARROW -->
+<!ENTITY lrhar2           "&#x021CB;" ><!--LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON -->
+<!ENTITY lsh              "&#x021B0;" ><!--UPWARDS ARROW WITH TIP LEFTWARDS -->
+<!ENTITY map              "&#x021A6;" ><!--RIGHTWARDS ARROW FROM BAR -->
+<!ENTITY mumap            "&#x022B8;" ><!--MULTIMAP -->
+<!ENTITY nearr            "&#x02197;" ><!--NORTH EAST ARROW -->
+<!ENTITY nhArr            "&#x021CE;" ><!--LEFT RIGHT DOUBLE ARROW WITH STROKE -->
+<!ENTITY nharr            "&#x021AE;" ><!--LEFT RIGHT ARROW WITH STROKE -->
+<!ENTITY nlArr            "&#x021CD;" ><!--LEFTWARDS DOUBLE ARROW WITH STROKE -->
+<!ENTITY nlarr            "&#x0219A;" ><!--LEFTWARDS ARROW WITH STROKE -->
+<!ENTITY nrArr            "&#x021CF;" ><!--RIGHTWARDS DOUBLE ARROW WITH STROKE -->
+<!ENTITY nrarr            "&#x0219B;" ><!--RIGHTWARDS ARROW WITH STROKE -->
+<!ENTITY nwarr            "&#x02196;" ><!--NORTH WEST ARROW -->
+<!ENTITY olarr            "&#x021BA;" ><!--ANTICLOCKWISE OPEN CIRCLE ARROW -->
+<!ENTITY orarr            "&#x021BB;" ><!--CLOCKWISE OPEN CIRCLE ARROW -->
+<!ENTITY rAarr            "&#x021DB;" ><!--RIGHTWARDS TRIPLE ARROW -->
+<!ENTITY Rarr             "&#x021A0;" ><!--RIGHTWARDS TWO HEADED ARROW -->
+<!ENTITY rarr2            "&#x021C9;" ><!--RIGHTWARDS PAIRED ARROWS -->
+<!ENTITY rarrhk           "&#x021AA;" ><!--RIGHTWARDS ARROW WITH HOOK -->
+<!ENTITY rarrlp           "&#x021AC;" ><!--RIGHTWARDS ARROW WITH LOOP -->
+<!ENTITY rarrtl           "&#x021A3;" ><!--RIGHTWARDS ARROW WITH TAIL -->
+<!ENTITY rarrw            "&#x0219D;" ><!--RIGHTWARDS WAVE ARROW -->
+<!ENTITY rhard            "&#x021C1;" ><!--RIGHTWARDS HARPOON WITH BARB DOWNWARDS -->
+<!ENTITY rharu            "&#x021C0;" ><!--RIGHTWARDS HARPOON WITH BARB UPWARDS -->
+<!ENTITY rlarr2           "&#x021C4;" ><!--RIGHTWARDS ARROW OVER LEFTWARDS ARROW -->
+<!ENTITY rlhar2           "&#x021CC;" ><!--RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON -->
+<!ENTITY rsh              "&#x021B1;" ><!--UPWARDS ARROW WITH TIP RIGHTWARDS -->
+<!ENTITY uArr             "&#x021D1;" ><!--UPWARDS DOUBLE ARROW -->
+<!ENTITY uarr2            "&#x021C8;" ><!--UPWARDS PAIRED ARROWS -->
+<!ENTITY uharl            "&#x021BF;" ><!--UPWARDS HARPOON WITH BARB LEFTWARDS -->
+<!ENTITY uharr            "&#x021BE;" ><!--UPWARDS HARPOON WITH BARB RIGHTWARDS -->
+<!ENTITY vArr             "&#x021D5;" ><!--UP DOWN DOUBLE ARROW -->
+<!ENTITY varr             "&#x02195;" ><!--UP DOWN ARROW -->
+<!ENTITY xhArr            "&#x027FA;" ><!--LONG LEFT RIGHT DOUBLE ARROW -->
+<!ENTITY xharr            "&#x027F7;" ><!--LONG LEFT RIGHT ARROW -->
+<!ENTITY xlArr            "&#x027F8;" ><!--LONG LEFTWARDS DOUBLE ARROW -->
+<!ENTITY xrArr            "&#x027F9;" ><!--LONG RIGHTWARDS DOUBLE ARROW -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isoamsb.ent b/xml/tests/testData/xml/DocBookHighlighting2/isoamsb.ent
new file mode 100644
index 0000000..4065b66c
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isoamsb.ent
@@ -0,0 +1,83 @@
+
+<!--
+     File isoamsb.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isoamsb.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isoamsb.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isoamsb PUBLIC
+         "ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isoamsb.ent"
+       >
+       %isoamsb;
+
+-->
+
+<!ENTITY amalg            "&#x02A3F;" ><!--AMALGAMATION OR COPRODUCT -->
+<!ENTITY Barwed           "&#x02306;" ><!--PERSPECTIVE -->
+<!ENTITY barwed           "&#x02305;" ><!--PROJECTIVE -->
+<!ENTITY Cap              "&#x022D2;" ><!--DOUBLE INTERSECTION -->
+<!ENTITY coprod           "&#x02210;" ><!--N-ARY COPRODUCT -->
+<!ENTITY Cup              "&#x022D3;" ><!--DOUBLE UNION -->
+<!ENTITY cuvee            "&#x022CE;" ><!--CURLY LOGICAL OR -->
+<!ENTITY cuwed            "&#x022CF;" ><!--CURLY LOGICAL AND -->
+<!ENTITY diam             "&#x022C4;" ><!--DIAMOND OPERATOR -->
+<!ENTITY divonx           "&#x022C7;" ><!--DIVISION TIMES -->
+<!ENTITY intcal           "&#x022BA;" ><!--INTERCALATE -->
+<!ENTITY lthree           "&#x022CB;" ><!--LEFT SEMIDIRECT PRODUCT -->
+<!ENTITY ltimes           "&#x022C9;" ><!--LEFT NORMAL FACTOR SEMIDIRECT PRODUCT -->
+<!ENTITY minusb           "&#x0229F;" ><!--SQUARED MINUS -->
+<!ENTITY oast             "&#x0229B;" ><!--CIRCLED ASTERISK OPERATOR -->
+<!ENTITY ocir             "&#x0229A;" ><!--CIRCLED RING OPERATOR -->
+<!ENTITY odash            "&#x0229D;" ><!--CIRCLED DASH -->
+<!ENTITY odot             "&#x02299;" ><!--CIRCLED DOT OPERATOR -->
+<!ENTITY ominus           "&#x02296;" ><!--CIRCLED MINUS -->
+<!ENTITY oplus            "&#x02295;" ><!--CIRCLED PLUS -->
+<!ENTITY osol             "&#x02298;" ><!--CIRCLED DIVISION SLASH -->
+<!ENTITY otimes           "&#x02297;" ><!--CIRCLED TIMES -->
+<!ENTITY plusb            "&#x0229E;" ><!--SQUARED PLUS -->
+<!ENTITY plusdo           "&#x02214;" ><!--DOT PLUS -->
+<!ENTITY prod             "&#x0220F;" ><!--N-ARY PRODUCT -->
+<!ENTITY rthree           "&#x022CC;" ><!--RIGHT SEMIDIRECT PRODUCT -->
+<!ENTITY rtimes           "&#x022CA;" ><!--RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT -->
+<!ENTITY sdot             "&#x022C5;" ><!--DOT OPERATOR -->
+<!ENTITY sdotb            "&#x022A1;" ><!--SQUARED DOT OPERATOR -->
+<!ENTITY setmn            "&#x02216;" ><!--SET MINUS -->
+<!ENTITY sqcap            "&#x02293;" ><!--SQUARE CAP -->
+<!ENTITY sqcup            "&#x02294;" ><!--SQUARE CUP -->
+<!ENTITY ssetmn           "&#x02216;" ><!--SET MINUS -->
+<!ENTITY sstarf           "&#x022C6;" ><!--STAR OPERATOR -->
+<!ENTITY sum              "&#x02211;" ><!--N-ARY SUMMATION -->
+<!ENTITY timesb           "&#x022A0;" ><!--SQUARED TIMES -->
+<!ENTITY top              "&#x022A4;" ><!--DOWN TACK -->
+<!ENTITY uplus            "&#x0228E;" ><!--MULTISET UNION -->
+<!ENTITY wreath           "&#x02240;" ><!--WREATH PRODUCT -->
+<!ENTITY xcirc            "&#x025EF;" ><!--LARGE CIRCLE -->
+<!ENTITY xdtri            "&#x025BD;" ><!--WHITE DOWN-POINTING TRIANGLE -->
+<!ENTITY xutri            "&#x025B3;" ><!--WHITE UP-POINTING TRIANGLE -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isoamsc.ent b/xml/tests/testData/xml/DocBookHighlighting2/isoamsc.ent
new file mode 100644
index 0000000..2fad417
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isoamsc.ent
@@ -0,0 +1,51 @@
+
+<!--
+     File isoamsc.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isoamsc.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isoamsc.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isoamsc PUBLIC
+         "ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isoamsc.ent"
+       >
+       %isoamsc;
+
+-->
+
+<!ENTITY dlcorn           "&#x0231E;" ><!--BOTTOM LEFT CORNER -->
+<!ENTITY drcorn           "&#x0231F;" ><!--BOTTOM RIGHT CORNER -->
+<!ENTITY lceil            "&#x02308;" ><!--LEFT CEILING -->
+<!ENTITY lfloor           "&#x0230A;" ><!--LEFT FLOOR -->
+<!ENTITY lpargt           "&#x029A0;" ><!--SPHERICAL ANGLE OPENING LEFT -->
+<!ENTITY rceil            "&#x02309;" ><!--RIGHT CEILING -->
+<!ENTITY rfloor           "&#x0230B;" ><!--RIGHT FLOOR -->
+<!ENTITY rpargt           "&#x02994;" ><!--RIGHT ARC GREATER-THAN BRACKET -->
+<!ENTITY ulcorn           "&#x0231C;" ><!--TOP LEFT CORNER -->
+<!ENTITY urcorn           "&#x0231D;" ><!--TOP RIGHT CORNER -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isoamsn.ent b/xml/tests/testData/xml/DocBookHighlighting2/isoamsn.ent
new file mode 100644
index 0000000..ddca8d1
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isoamsn.ent
@@ -0,0 +1,103 @@
+
+<!--
+     File isoamsn.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     References to the VARIANT SELECTOR 1 character (&#x0FE00;)
+     should match the uses listed in Unicode Technical Report 25.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isoamsn.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isoamsn.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isoamsn PUBLIC
+         "ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isoamsn.ent"
+       >
+       %isoamsn;
+
+-->
+
+<!ENTITY gnap             "&#x02A8A;" ><!--GREATER-THAN AND NOT APPROXIMATE -->
+<!ENTITY gnE              "&#x02269;" ><!--GREATER-THAN BUT NOT EQUAL TO -->
+<!ENTITY gne              "&#x02A88;" ><!--GREATER-THAN AND SINGLE-LINE NOT EQUAL TO -->
+<!ENTITY gnsim            "&#x022E7;" ><!--GREATER-THAN BUT NOT EQUIVALENT TO -->
+<!ENTITY gvnE             "&#x02269;&#x0FE00;" ><!--GREATER-THAN BUT NOT EQUAL TO - with vertical stroke -->
+<!ENTITY lnap             "&#x02A89;" ><!--LESS-THAN AND NOT APPROXIMATE -->
+<!ENTITY lnE              "&#x02268;" ><!--LESS-THAN BUT NOT EQUAL TO -->
+<!ENTITY lne              "&#x02A87;" ><!--LESS-THAN AND SINGLE-LINE NOT EQUAL TO -->
+<!ENTITY lnsim            "&#x022E6;" ><!--LESS-THAN BUT NOT EQUIVALENT TO -->
+<!ENTITY lvnE             "&#x02268;&#x0FE00;" ><!--LESS-THAN BUT NOT EQUAL TO - with vertical stroke -->
+<!ENTITY nap              "&#x02249;" ><!--NOT ALMOST EQUAL TO -->
+<!ENTITY ncong            "&#x02247;" ><!--NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO -->
+<!ENTITY nequiv           "&#x02262;" ><!--NOT IDENTICAL TO -->
+<!ENTITY ngE              "&#x02267;&#x00338;" ><!--GREATER-THAN OVER EQUAL TO with slash -->
+<!ENTITY nge              "&#x02271;" ><!--NEITHER GREATER-THAN NOR EQUAL TO -->
+<!ENTITY nges             "&#x02A7E;&#x00338;" ><!--GREATER-THAN OR SLANTED EQUAL TO with slash -->
+<!ENTITY ngt              "&#x0226F;" ><!--NOT GREATER-THAN -->
+<!ENTITY nlE              "&#x02266;&#x00338;" ><!--LESS-THAN OVER EQUAL TO with slash -->
+<!ENTITY nle              "&#x02270;" ><!--NEITHER LESS-THAN NOR EQUAL TO -->
+<!ENTITY nles             "&#x02A7D;&#x00338;" ><!--LESS-THAN OR SLANTED EQUAL TO with slash -->
+<!ENTITY nlt              "&#x0226E;" ><!--NOT LESS-THAN -->
+<!ENTITY nltri            "&#x022EA;" ><!--NOT NORMAL SUBGROUP OF -->
+<!ENTITY nltrie           "&#x022EC;" ><!--NOT NORMAL SUBGROUP OF OR EQUAL TO -->
+<!ENTITY nmid             "&#x02224;" ><!--DOES NOT DIVIDE -->
+<!ENTITY npar             "&#x02226;" ><!--NOT PARALLEL TO -->
+<!ENTITY npr              "&#x02280;" ><!--DOES NOT PRECEDE -->
+<!ENTITY npre             "&#x02AAF;&#x00338;" ><!--PRECEDES ABOVE SINGLE-LINE EQUALS SIGN with slash -->
+<!ENTITY nrtri            "&#x022EB;" ><!--DOES NOT CONTAIN AS NORMAL SUBGROUP -->
+<!ENTITY nrtrie           "&#x022ED;" ><!--DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL -->
+<!ENTITY nsc              "&#x02281;" ><!--DOES NOT SUCCEED -->
+<!ENTITY nsce             "&#x02AB0;&#x00338;" ><!--SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN with slash -->
+<!ENTITY nsim             "&#x02241;" ><!--NOT TILDE -->
+<!ENTITY nsime            "&#x02244;" ><!--NOT ASYMPTOTICALLY EQUAL TO -->
+<!ENTITY nsmid            "&#x02224;" ><!--DOES NOT DIVIDE -->
+<!ENTITY nspar            "&#x02226;" ><!--NOT PARALLEL TO -->
+<!ENTITY nsub             "&#x02284;" ><!--NOT A SUBSET OF -->
+<!ENTITY nsubE            "&#x02AC5;&#x00338;" ><!--SUBSET OF ABOVE EQUALS SIGN with slash -->
+<!ENTITY nsube            "&#x02288;" ><!--NEITHER A SUBSET OF NOR EQUAL TO -->
+<!ENTITY nsup             "&#x02285;" ><!--NOT A SUPERSET OF -->
+<!ENTITY nsupE            "&#x02AC6;&#x00338;" ><!--SUPERSET OF ABOVE EQUALS SIGN with slash -->
+<!ENTITY nsupe            "&#x02289;" ><!--NEITHER A SUPERSET OF NOR EQUAL TO -->
+<!ENTITY nVDash           "&#x022AF;" ><!--NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE -->
+<!ENTITY nVdash           "&#x022AE;" ><!--DOES NOT FORCE -->
+<!ENTITY nvDash           "&#x022AD;" ><!--NOT TRUE -->
+<!ENTITY nvdash           "&#x022AC;" ><!--DOES NOT PROVE -->
+<!ENTITY prnap            "&#x02AB9;" ><!--PRECEDES ABOVE NOT ALMOST EQUAL TO -->
+<!ENTITY prnE             "&#x02AB5;" ><!--PRECEDES ABOVE NOT EQUAL TO -->
+<!ENTITY prnsim           "&#x022E8;" ><!--PRECEDES BUT NOT EQUIVALENT TO -->
+<!ENTITY scnap            "&#x02ABA;" ><!--SUCCEEDS ABOVE NOT ALMOST EQUAL TO -->
+<!ENTITY scnE             "&#x02AB6;" ><!--SUCCEEDS ABOVE NOT EQUAL TO -->
+<!ENTITY scnsim           "&#x022E9;" ><!--SUCCEEDS BUT NOT EQUIVALENT TO -->
+<!ENTITY subnE            "&#x02ACB;" ><!--SUBSET OF ABOVE NOT EQUAL TO -->
+<!ENTITY subne            "&#x0228A;" ><!--SUBSET OF WITH NOT EQUAL TO -->
+<!ENTITY supnE            "&#x02ACC;" ><!--SUPERSET OF ABOVE NOT EQUAL TO -->
+<!ENTITY supne            "&#x0228B;" ><!--SUPERSET OF WITH NOT EQUAL TO -->
+<!ENTITY vsubnE           "&#x02ACB;&#x0FE00;" ><!--SUBSET OF ABOVE NOT EQUAL TO - variant with stroke through bottom members -->
+<!ENTITY vsubne           "&#x0228A;&#x0FE00;" ><!--SUBSET OF WITH NOT EQUAL TO - variant with stroke through bottom members -->
+<!ENTITY vsupnE           "&#x02ACC;&#x0FE00;" ><!--SUPERSET OF ABOVE NOT EQUAL TO - variant with stroke through bottom members -->
+<!ENTITY vsupne           "&#x0228B;&#x0FE00;" ><!--SUPERSET OF WITH NOT EQUAL TO - variant with stroke through bottom members -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isoamso.ent b/xml/tests/testData/xml/DocBookHighlighting2/isoamso.ent
new file mode 100644
index 0000000..278e4b4
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isoamso.ent
@@ -0,0 +1,59 @@
+
+<!--
+     File isoamso.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isoamso.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isoamso.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isoamso PUBLIC
+         "ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isoamso.ent"
+       >
+       %isoamso;
+
+-->
+
+<!ENTITY ang              "&#x02220;" ><!--ANGLE -->
+<!ENTITY angmsd           "&#x02221;" ><!--MEASURED ANGLE -->
+<!ENTITY beth             "&#x02136;" ><!--BET SYMBOL -->
+<!ENTITY bprime           "&#x02035;" ><!--REVERSED PRIME -->
+<!ENTITY comp             "&#x02201;" ><!--COMPLEMENT -->
+<!ENTITY daleth           "&#x02138;" ><!--DALET SYMBOL -->
+<!ENTITY ell              "&#x02113;" ><!--SCRIPT SMALL L -->
+<!ENTITY empty            "&#x02205;" ><!--EMPTY SET -->
+<!ENTITY gimel            "&#x02137;" ><!--GIMEL SYMBOL -->
+<!ENTITY inodot           "&#x00131;" ><!--LATIN SMALL LETTER DOTLESS I -->
+<!ENTITY jnodot           "&#x0006A;" ><!--LATIN SMALL LETTER J -->
+<!ENTITY nexist           "&#x02204;" ><!--THERE DOES NOT EXIST -->
+<!ENTITY oS               "&#x024C8;" ><!--CIRCLED LATIN CAPITAL LETTER S -->
+<!ENTITY planck           "&#x0210F;" ><!--PLANCK CONSTANT OVER TWO PI -->
+<!ENTITY real             "&#x0211C;" ><!--BLACK-LETTER CAPITAL R -->
+<!ENTITY sbsol            "&#x0FE68;" ><!--SMALL REVERSE SOLIDUS -->
+<!ENTITY vprime           "&#x02032;" ><!--PRIME -->
+<!ENTITY weierp           "&#x02118;" ><!--SCRIPT CAPITAL P -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isoamsr.ent b/xml/tests/testData/xml/DocBookHighlighting2/isoamsr.ent
new file mode 100644
index 0000000..18e64bf
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isoamsr.ent
@@ -0,0 +1,125 @@
+
+<!--
+     File isoamsr.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isoamsr.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isoamsr.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isoamsr PUBLIC
+         "ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isoamsr.ent"
+       >
+       %isoamsr;
+
+-->
+
+<!ENTITY ape              "&#x0224A;" ><!--ALMOST EQUAL OR EQUAL TO -->
+<!ENTITY asymp            "&#x02248;" ><!--ALMOST EQUAL TO -->
+<!ENTITY bcong            "&#x0224C;" ><!--ALL EQUAL TO -->
+<!ENTITY bepsi            "&#x003F6;" ><!--GREEK REVERSED LUNATE EPSILON SYMBOL -->
+<!ENTITY bowtie           "&#x022C8;" ><!--BOWTIE -->
+<!ENTITY bsim             "&#x0223D;" ><!--REVERSED TILDE -->
+<!ENTITY bsime            "&#x022CD;" ><!--REVERSED TILDE EQUALS -->
+<!ENTITY bump             "&#x0224E;" ><!--GEOMETRICALLY EQUIVALENT TO -->
+<!ENTITY bumpe            "&#x0224F;" ><!--DIFFERENCE BETWEEN -->
+<!ENTITY cire             "&#x02257;" ><!--RING EQUAL TO -->
+<!ENTITY colone           "&#x02254;" ><!--COLON EQUALS -->
+<!ENTITY cuepr            "&#x022DE;" ><!--EQUAL TO OR PRECEDES -->
+<!ENTITY cuesc            "&#x022DF;" ><!--EQUAL TO OR SUCCEEDS -->
+<!ENTITY cupre            "&#x0227C;" ><!--PRECEDES OR EQUAL TO -->
+<!ENTITY dashv            "&#x022A3;" ><!--LEFT TACK -->
+<!ENTITY ecir             "&#x02256;" ><!--RING IN EQUAL TO -->
+<!ENTITY ecolon           "&#x02255;" ><!--EQUALS COLON -->
+<!ENTITY eDot             "&#x02251;" ><!--GEOMETRICALLY EQUAL TO -->
+<!ENTITY efDot            "&#x02252;" ><!--APPROXIMATELY EQUAL TO OR THE IMAGE OF -->
+<!ENTITY egs              "&#x02A96;" ><!--SLANTED EQUAL TO OR GREATER-THAN -->
+<!ENTITY els              "&#x02A95;" ><!--SLANTED EQUAL TO OR LESS-THAN -->
+<!ENTITY erDot            "&#x02253;" ><!--IMAGE OF OR APPROXIMATELY EQUAL TO -->
+<!ENTITY esdot            "&#x02250;" ><!--APPROACHES THE LIMIT -->
+<!ENTITY fork             "&#x022D4;" ><!--PITCHFORK -->
+<!ENTITY frown            "&#x02322;" ><!--FROWN -->
+<!ENTITY gap              "&#x02A86;" ><!--GREATER-THAN OR APPROXIMATE -->
+<!ENTITY gE               "&#x02267;" ><!--GREATER-THAN OVER EQUAL TO -->
+<!ENTITY gEl              "&#x02A8C;" ><!--GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN -->
+<!ENTITY gel              "&#x022DB;" ><!--GREATER-THAN EQUAL TO OR LESS-THAN -->
+<!ENTITY ges              "&#x02A7E;" ><!--GREATER-THAN OR SLANTED EQUAL TO -->
+<!ENTITY Gg               "&#x022D9;" ><!--VERY MUCH GREATER-THAN -->
+<!ENTITY gl               "&#x02277;" ><!--GREATER-THAN OR LESS-THAN -->
+<!ENTITY gsdot            "&#x022D7;" ><!--GREATER-THAN WITH DOT -->
+<!ENTITY gsim             "&#x02273;" ><!--GREATER-THAN OR EQUIVALENT TO -->
+<!ENTITY Gt               "&#x0226B;" ><!--MUCH GREATER-THAN -->
+<!ENTITY lap              "&#x02A85;" ><!--LESS-THAN OR APPROXIMATE -->
+<!ENTITY ldot             "&#x022D6;" ><!--LESS-THAN WITH DOT -->
+<!ENTITY lE               "&#x02266;" ><!--LESS-THAN OVER EQUAL TO -->
+<!ENTITY lEg              "&#x02A8B;" ><!--LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN -->
+<!ENTITY leg              "&#x022DA;" ><!--LESS-THAN EQUAL TO OR GREATER-THAN -->
+<!ENTITY les              "&#x02A7D;" ><!--LESS-THAN OR SLANTED EQUAL TO -->
+<!ENTITY lg               "&#x02276;" ><!--LESS-THAN OR GREATER-THAN -->
+<!ENTITY Ll               "&#x022D8;" ><!--VERY MUCH LESS-THAN -->
+<!ENTITY lsim             "&#x02272;" ><!--LESS-THAN OR EQUIVALENT TO -->
+<!ENTITY Lt               "&#x0226A;" ><!--MUCH LESS-THAN -->
+<!ENTITY ltrie            "&#x022B4;" ><!--NORMAL SUBGROUP OF OR EQUAL TO -->
+<!ENTITY mid              "&#x02223;" ><!--DIVIDES -->
+<!ENTITY models           "&#x022A7;" ><!--MODELS -->
+<!ENTITY pr               "&#x0227A;" ><!--PRECEDES -->
+<!ENTITY prap             "&#x02AB7;" ><!--PRECEDES ABOVE ALMOST EQUAL TO -->
+<!ENTITY pre              "&#x02AAF;" ><!--PRECEDES ABOVE SINGLE-LINE EQUALS SIGN -->
+<!ENTITY prsim            "&#x0227E;" ><!--PRECEDES OR EQUIVALENT TO -->
+<!ENTITY rtrie            "&#x022B5;" ><!--CONTAINS AS NORMAL SUBGROUP OR EQUAL TO -->
+<!ENTITY samalg           "&#x02210;" ><!--N-ARY COPRODUCT -->
+<!ENTITY sc               "&#x0227B;" ><!--SUCCEEDS -->
+<!ENTITY scap             "&#x02AB8;" ><!--SUCCEEDS ABOVE ALMOST EQUAL TO -->
+<!ENTITY sccue            "&#x0227D;" ><!--SUCCEEDS OR EQUAL TO -->
+<!ENTITY sce              "&#x02AB0;" ><!--SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN -->
+<!ENTITY scsim            "&#x0227F;" ><!--SUCCEEDS OR EQUIVALENT TO -->
+<!ENTITY sfrown           "&#x02322;" ><!--FROWN -->
+<!ENTITY smid             "&#x02223;" ><!--DIVIDES -->
+<!ENTITY smile            "&#x02323;" ><!--SMILE -->
+<!ENTITY spar             "&#x02225;" ><!--PARALLEL TO -->
+<!ENTITY sqsub            "&#x0228F;" ><!--SQUARE IMAGE OF -->
+<!ENTITY sqsube           "&#x02291;" ><!--SQUARE IMAGE OF OR EQUAL TO -->
+<!ENTITY sqsup            "&#x02290;" ><!--SQUARE ORIGINAL OF -->
+<!ENTITY sqsupe           "&#x02292;" ><!--SQUARE ORIGINAL OF OR EQUAL TO -->
+<!ENTITY ssmile           "&#x02323;" ><!--SMILE -->
+<!ENTITY Sub              "&#x022D0;" ><!--DOUBLE SUBSET -->
+<!ENTITY subE             "&#x02AC5;" ><!--SUBSET OF ABOVE EQUALS SIGN -->
+<!ENTITY Sup              "&#x022D1;" ><!--DOUBLE SUPERSET -->
+<!ENTITY supE             "&#x02AC6;" ><!--SUPERSET OF ABOVE EQUALS SIGN -->
+<!ENTITY thkap            "&#x02248;" ><!--ALMOST EQUAL TO -->
+<!ENTITY thksim           "&#x0223C;" ><!--TILDE OPERATOR -->
+<!ENTITY trie             "&#x0225C;" ><!--DELTA EQUAL TO -->
+<!ENTITY twixt            "&#x0226C;" ><!--BETWEEN -->
+<!ENTITY Vdash            "&#x022A9;" ><!--FORCES -->
+<!ENTITY vDash            "&#x022A8;" ><!--TRUE -->
+<!ENTITY vdash            "&#x022A2;" ><!--RIGHT TACK -->
+<!ENTITY veebar           "&#x022BB;" ><!--XOR -->
+<!ENTITY vltri            "&#x022B2;" ><!--NORMAL SUBGROUP OF -->
+<!ENTITY vprop            "&#x0221D;" ><!--PROPORTIONAL TO -->
+<!ENTITY vrtri            "&#x022B3;" ><!--CONTAINS AS NORMAL SUBGROUP -->
+<!ENTITY Vvdash           "&#x022AA;" ><!--TRIPLE VERTICAL BAR RIGHT TURNSTILE -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isobox.ent b/xml/tests/testData/xml/DocBookHighlighting2/isobox.ent
new file mode 100644
index 0000000..9ae27d4
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isobox.ent
@@ -0,0 +1,81 @@
+
+<!--
+     File isobox.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isobox.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isobox.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isobox PUBLIC
+         "ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isobox.ent"
+       >
+       %isobox;
+
+-->
+
+<!ENTITY boxDL            "&#x02557;" ><!--BOX DRAWINGS DOUBLE DOWN AND LEFT -->
+<!ENTITY boxDl            "&#x02556;" ><!--BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE -->
+<!ENTITY boxdL            "&#x02555;" ><!--BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE -->
+<!ENTITY boxdl            "&#x02510;" ><!--BOX DRAWINGS LIGHT DOWN AND LEFT -->
+<!ENTITY boxDR            "&#x02554;" ><!--BOX DRAWINGS DOUBLE DOWN AND RIGHT -->
+<!ENTITY boxDr            "&#x02553;" ><!--BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE -->
+<!ENTITY boxdR            "&#x02552;" ><!--BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE -->
+<!ENTITY boxdr            "&#x0250C;" ><!--BOX DRAWINGS LIGHT DOWN AND RIGHT -->
+<!ENTITY boxH             "&#x02550;" ><!--BOX DRAWINGS DOUBLE HORIZONTAL -->
+<!ENTITY boxh             "&#x02500;" ><!--BOX DRAWINGS LIGHT HORIZONTAL -->
+<!ENTITY boxHD            "&#x02566;" ><!--BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL -->
+<!ENTITY boxHd            "&#x02564;" ><!--BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE -->
+<!ENTITY boxhD            "&#x02565;" ><!--BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE -->
+<!ENTITY boxhd            "&#x0252C;" ><!--BOX DRAWINGS LIGHT DOWN AND HORIZONTAL -->
+<!ENTITY boxHU            "&#x02569;" ><!--BOX DRAWINGS DOUBLE UP AND HORIZONTAL -->
+<!ENTITY boxHu            "&#x02567;" ><!--BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE -->
+<!ENTITY boxhU            "&#x02568;" ><!--BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE -->
+<!ENTITY boxhu            "&#x02534;" ><!--BOX DRAWINGS LIGHT UP AND HORIZONTAL -->
+<!ENTITY boxUL            "&#x0255D;" ><!--BOX DRAWINGS DOUBLE UP AND LEFT -->
+<!ENTITY boxUl            "&#x0255C;" ><!--BOX DRAWINGS UP DOUBLE AND LEFT SINGLE -->
+<!ENTITY boxuL            "&#x0255B;" ><!--BOX DRAWINGS UP SINGLE AND LEFT DOUBLE -->
+<!ENTITY boxul            "&#x02518;" ><!--BOX DRAWINGS LIGHT UP AND LEFT -->
+<!ENTITY boxUR            "&#x0255A;" ><!--BOX DRAWINGS DOUBLE UP AND RIGHT -->
+<!ENTITY boxUr            "&#x02559;" ><!--BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE -->
+<!ENTITY boxuR            "&#x02558;" ><!--BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE -->
+<!ENTITY boxur            "&#x02514;" ><!--BOX DRAWINGS LIGHT UP AND RIGHT -->
+<!ENTITY boxV             "&#x02551;" ><!--BOX DRAWINGS DOUBLE VERTICAL -->
+<!ENTITY boxv             "&#x02502;" ><!--BOX DRAWINGS LIGHT VERTICAL -->
+<!ENTITY boxVH            "&#x0256C;" ><!--BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL -->
+<!ENTITY boxVh            "&#x0256B;" ><!--BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE -->
+<!ENTITY boxvH            "&#x0256A;" ><!--BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE -->
+<!ENTITY boxvh            "&#x0253C;" ><!--BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL -->
+<!ENTITY boxVL            "&#x02563;" ><!--BOX DRAWINGS DOUBLE VERTICAL AND LEFT -->
+<!ENTITY boxVl            "&#x02562;" ><!--BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE -->
+<!ENTITY boxvL            "&#x02561;" ><!--BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE -->
+<!ENTITY boxvl            "&#x02524;" ><!--BOX DRAWINGS LIGHT VERTICAL AND LEFT -->
+<!ENTITY boxVR            "&#x02560;" ><!--BOX DRAWINGS DOUBLE VERTICAL AND RIGHT -->
+<!ENTITY boxVr            "&#x0255F;" ><!--BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE -->
+<!ENTITY boxvR            "&#x0255E;" ><!--BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE -->
+<!ENTITY boxvr            "&#x0251C;" ><!--BOX DRAWINGS LIGHT VERTICAL AND RIGHT -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isocyr1.ent b/xml/tests/testData/xml/DocBookHighlighting2/isocyr1.ent
new file mode 100644
index 0000000..364b6d8
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isocyr1.ent
@@ -0,0 +1,108 @@
+
+<!--
+     File isocyr1.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isocyr1.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isocyr1.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isocyr1 PUBLIC
+         "ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isocyr1.ent"
+       >
+       %isocyr1;
+
+-->
+
+<!ENTITY Acy              "&#x00410;" ><!--CYRILLIC CAPITAL LETTER A -->
+<!ENTITY acy              "&#x00430;" ><!--CYRILLIC SMALL LETTER A -->
+<!ENTITY Bcy              "&#x00411;" ><!--CYRILLIC CAPITAL LETTER BE -->
+<!ENTITY bcy              "&#x00431;" ><!--CYRILLIC SMALL LETTER BE -->
+<!ENTITY CHcy             "&#x00427;" ><!--CYRILLIC CAPITAL LETTER CHE -->
+<!ENTITY chcy             "&#x00447;" ><!--CYRILLIC SMALL LETTER CHE -->
+<!ENTITY Dcy              "&#x00414;" ><!--CYRILLIC CAPITAL LETTER DE -->
+<!ENTITY dcy              "&#x00434;" ><!--CYRILLIC SMALL LETTER DE -->
+<!ENTITY Ecy              "&#x0042D;" ><!--CYRILLIC CAPITAL LETTER E -->
+<!ENTITY ecy              "&#x0044D;" ><!--CYRILLIC SMALL LETTER E -->
+<!ENTITY Fcy              "&#x00424;" ><!--CYRILLIC CAPITAL LETTER EF -->
+<!ENTITY fcy              "&#x00444;" ><!--CYRILLIC SMALL LETTER EF -->
+<!ENTITY Gcy              "&#x00413;" ><!--CYRILLIC CAPITAL LETTER GHE -->
+<!ENTITY gcy              "&#x00433;" ><!--CYRILLIC SMALL LETTER GHE -->
+<!ENTITY HARDcy           "&#x0042A;" ><!--CYRILLIC CAPITAL LETTER HARD SIGN -->
+<!ENTITY hardcy           "&#x0044A;" ><!--CYRILLIC SMALL LETTER HARD SIGN -->
+<!ENTITY Icy              "&#x00418;" ><!--CYRILLIC CAPITAL LETTER I -->
+<!ENTITY icy              "&#x00438;" ><!--CYRILLIC SMALL LETTER I -->
+<!ENTITY IEcy             "&#x00415;" ><!--CYRILLIC CAPITAL LETTER IE -->
+<!ENTITY iecy             "&#x00435;" ><!--CYRILLIC SMALL LETTER IE -->
+<!ENTITY IOcy             "&#x00401;" ><!--CYRILLIC CAPITAL LETTER IO -->
+<!ENTITY iocy             "&#x00451;" ><!--CYRILLIC SMALL LETTER IO -->
+<!ENTITY Jcy              "&#x00419;" ><!--CYRILLIC CAPITAL LETTER SHORT I -->
+<!ENTITY jcy              "&#x00439;" ><!--CYRILLIC SMALL LETTER SHORT I -->
+<!ENTITY Kcy              "&#x0041A;" ><!--CYRILLIC CAPITAL LETTER KA -->
+<!ENTITY kcy              "&#x0043A;" ><!--CYRILLIC SMALL LETTER KA -->
+<!ENTITY KHcy             "&#x00425;" ><!--CYRILLIC CAPITAL LETTER HA -->
+<!ENTITY khcy             "&#x00445;" ><!--CYRILLIC SMALL LETTER HA -->
+<!ENTITY Lcy              "&#x0041B;" ><!--CYRILLIC CAPITAL LETTER EL -->
+<!ENTITY lcy              "&#x0043B;" ><!--CYRILLIC SMALL LETTER EL -->
+<!ENTITY Mcy              "&#x0041C;" ><!--CYRILLIC CAPITAL LETTER EM -->
+<!ENTITY mcy              "&#x0043C;" ><!--CYRILLIC SMALL LETTER EM -->
+<!ENTITY Ncy              "&#x0041D;" ><!--CYRILLIC CAPITAL LETTER EN -->
+<!ENTITY ncy              "&#x0043D;" ><!--CYRILLIC SMALL LETTER EN -->
+<!ENTITY numero           "&#x02116;" ><!--NUMERO SIGN -->
+<!ENTITY Ocy              "&#x0041E;" ><!--CYRILLIC CAPITAL LETTER O -->
+<!ENTITY ocy              "&#x0043E;" ><!--CYRILLIC SMALL LETTER O -->
+<!ENTITY Pcy              "&#x0041F;" ><!--CYRILLIC CAPITAL LETTER PE -->
+<!ENTITY pcy              "&#x0043F;" ><!--CYRILLIC SMALL LETTER PE -->
+<!ENTITY Rcy              "&#x00420;" ><!--CYRILLIC CAPITAL LETTER ER -->
+<!ENTITY rcy              "&#x00440;" ><!--CYRILLIC SMALL LETTER ER -->
+<!ENTITY Scy              "&#x00421;" ><!--CYRILLIC CAPITAL LETTER ES -->
+<!ENTITY scy              "&#x00441;" ><!--CYRILLIC SMALL LETTER ES -->
+<!ENTITY SHCHcy           "&#x00429;" ><!--CYRILLIC CAPITAL LETTER SHCHA -->
+<!ENTITY shchcy           "&#x00449;" ><!--CYRILLIC SMALL LETTER SHCHA -->
+<!ENTITY SHcy             "&#x00428;" ><!--CYRILLIC CAPITAL LETTER SHA -->
+<!ENTITY shcy             "&#x00448;" ><!--CYRILLIC SMALL LETTER SHA -->
+<!ENTITY SOFTcy           "&#x0042C;" ><!--CYRILLIC CAPITAL LETTER SOFT SIGN -->
+<!ENTITY softcy           "&#x0044C;" ><!--CYRILLIC SMALL LETTER SOFT SIGN -->
+<!ENTITY Tcy              "&#x00422;" ><!--CYRILLIC CAPITAL LETTER TE -->
+<!ENTITY tcy              "&#x00442;" ><!--CYRILLIC SMALL LETTER TE -->
+<!ENTITY TScy             "&#x00426;" ><!--CYRILLIC CAPITAL LETTER TSE -->
+<!ENTITY tscy             "&#x00446;" ><!--CYRILLIC SMALL LETTER TSE -->
+<!ENTITY Ucy              "&#x00423;" ><!--CYRILLIC CAPITAL LETTER U -->
+<!ENTITY ucy              "&#x00443;" ><!--CYRILLIC SMALL LETTER U -->
+<!ENTITY Vcy              "&#x00412;" ><!--CYRILLIC CAPITAL LETTER VE -->
+<!ENTITY vcy              "&#x00432;" ><!--CYRILLIC SMALL LETTER VE -->
+<!ENTITY YAcy             "&#x0042F;" ><!--CYRILLIC CAPITAL LETTER YA -->
+<!ENTITY yacy             "&#x0044F;" ><!--CYRILLIC SMALL LETTER YA -->
+<!ENTITY Ycy              "&#x0042B;" ><!--CYRILLIC CAPITAL LETTER YERU -->
+<!ENTITY ycy              "&#x0044B;" ><!--CYRILLIC SMALL LETTER YERU -->
+<!ENTITY YUcy             "&#x0042E;" ><!--CYRILLIC CAPITAL LETTER YU -->
+<!ENTITY yucy             "&#x0044E;" ><!--CYRILLIC SMALL LETTER YU -->
+<!ENTITY Zcy              "&#x00417;" ><!--CYRILLIC CAPITAL LETTER ZE -->
+<!ENTITY zcy              "&#x00437;" ><!--CYRILLIC SMALL LETTER ZE -->
+<!ENTITY ZHcy             "&#x00416;" ><!--CYRILLIC CAPITAL LETTER ZHE -->
+<!ENTITY zhcy             "&#x00436;" ><!--CYRILLIC SMALL LETTER ZHE -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isocyr2.ent b/xml/tests/testData/xml/DocBookHighlighting2/isocyr2.ent
new file mode 100644
index 0000000..6432d74c
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isocyr2.ent
@@ -0,0 +1,67 @@
+
+<!--
+     File isocyr2.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isocyr2.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isocyr2.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isocyr2 PUBLIC
+         "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isocyr2.ent"
+       >
+       %isocyr2;
+
+-->
+
+<!ENTITY DJcy             "&#x00402;" ><!--CYRILLIC CAPITAL LETTER DJE -->
+<!ENTITY djcy             "&#x00452;" ><!--CYRILLIC SMALL LETTER DJE -->
+<!ENTITY DScy             "&#x00405;" ><!--CYRILLIC CAPITAL LETTER DZE -->
+<!ENTITY dscy             "&#x00455;" ><!--CYRILLIC SMALL LETTER DZE -->
+<!ENTITY DZcy             "&#x0040F;" ><!--CYRILLIC CAPITAL LETTER DZHE -->
+<!ENTITY dzcy             "&#x0045F;" ><!--CYRILLIC SMALL LETTER DZHE -->
+<!ENTITY GJcy             "&#x00403;" ><!--CYRILLIC CAPITAL LETTER GJE -->
+<!ENTITY gjcy             "&#x00453;" ><!--CYRILLIC SMALL LETTER GJE -->
+<!ENTITY Iukcy            "&#x00406;" ><!--CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I -->
+<!ENTITY iukcy            "&#x00456;" ><!--CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I -->
+<!ENTITY Jsercy           "&#x00408;" ><!--CYRILLIC CAPITAL LETTER JE -->
+<!ENTITY jsercy           "&#x00458;" ><!--CYRILLIC SMALL LETTER JE -->
+<!ENTITY Jukcy            "&#x00404;" ><!--CYRILLIC CAPITAL LETTER UKRAINIAN IE -->
+<!ENTITY jukcy            "&#x00454;" ><!--CYRILLIC SMALL LETTER UKRAINIAN IE -->
+<!ENTITY KJcy             "&#x0040C;" ><!--CYRILLIC CAPITAL LETTER KJE -->
+<!ENTITY kjcy             "&#x0045C;" ><!--CYRILLIC SMALL LETTER KJE -->
+<!ENTITY LJcy             "&#x00409;" ><!--CYRILLIC CAPITAL LETTER LJE -->
+<!ENTITY ljcy             "&#x00459;" ><!--CYRILLIC SMALL LETTER LJE -->
+<!ENTITY NJcy             "&#x0040A;" ><!--CYRILLIC CAPITAL LETTER NJE -->
+<!ENTITY njcy             "&#x0045A;" ><!--CYRILLIC SMALL LETTER NJE -->
+<!ENTITY TSHcy            "&#x0040B;" ><!--CYRILLIC CAPITAL LETTER TSHE -->
+<!ENTITY tshcy            "&#x0045B;" ><!--CYRILLIC SMALL LETTER TSHE -->
+<!ENTITY Ubrcy            "&#x0040E;" ><!--CYRILLIC CAPITAL LETTER SHORT U -->
+<!ENTITY ubrcy            "&#x0045E;" ><!--CYRILLIC SMALL LETTER SHORT U -->
+<!ENTITY YIcy             "&#x00407;" ><!--CYRILLIC CAPITAL LETTER YI -->
+<!ENTITY yicy             "&#x00457;" ><!--CYRILLIC SMALL LETTER YI -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isodia.ent b/xml/tests/testData/xml/DocBookHighlighting2/isodia.ent
new file mode 100644
index 0000000..b49c309
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isodia.ent
@@ -0,0 +1,55 @@
+
+<!--
+     File isodia.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isodia.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isodia.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isodia PUBLIC
+         "ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isodia.ent"
+       >
+       %isodia;
+
+-->
+
+<!ENTITY acute            "&#x000B4;" ><!--ACUTE ACCENT -->
+<!ENTITY breve            "&#x002D8;" ><!--BREVE -->
+<!ENTITY caron            "&#x002C7;" ><!--CARON -->
+<!ENTITY cedil            "&#x000B8;" ><!--CEDILLA -->
+<!ENTITY circ             "&#x002C6;" ><!--MODIFIER LETTER CIRCUMFLEX ACCENT -->
+<!ENTITY dblac            "&#x002DD;" ><!--DOUBLE ACUTE ACCENT -->
+<!ENTITY die              "&#x000A8;" ><!--DIAERESIS -->
+<!ENTITY dot              "&#x002D9;" ><!--DOT ABOVE -->
+<!ENTITY grave            "&#x00060;" ><!--GRAVE ACCENT -->
+<!ENTITY macr             "&#x000AF;" ><!--MACRON -->
+<!ENTITY ogon             "&#x002DB;" ><!--OGONEK -->
+<!ENTITY ring             "&#x002DA;" ><!--RING ABOVE -->
+<!ENTITY tilde            "&#x002DC;" ><!--SMALL TILDE -->
+<!ENTITY uml              "&#x000A8;" ><!--DIAERESIS -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isogrk1.ent b/xml/tests/testData/xml/DocBookHighlighting2/isogrk1.ent
new file mode 100644
index 0000000..7826f81
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isogrk1.ent
@@ -0,0 +1,90 @@
+
+<!--
+     File isogrk1.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isogrk1.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Greek Letters//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isogrk1.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isogrk1 PUBLIC
+         "ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isogrk1.ent"
+       >
+       %isogrk1;
+
+-->
+
+<!ENTITY Agr              "&#x00391;" ><!--GREEK CAPITAL LETTER ALPHA -->
+<!ENTITY agr              "&#x003B1;" ><!--GREEK SMALL LETTER ALPHA -->
+<!ENTITY Bgr              "&#x00392;" ><!--GREEK CAPITAL LETTER BETA -->
+<!ENTITY bgr              "&#x003B2;" ><!--GREEK SMALL LETTER BETA -->
+<!ENTITY Dgr              "&#x00394;" ><!--GREEK CAPITAL LETTER DELTA -->
+<!ENTITY dgr              "&#x003B4;" ><!--GREEK SMALL LETTER DELTA -->
+<!ENTITY EEgr             "&#x00397;" ><!--GREEK CAPITAL LETTER ETA -->
+<!ENTITY eegr             "&#x003B7;" ><!--GREEK SMALL LETTER ETA -->
+<!ENTITY Egr              "&#x00395;" ><!--GREEK CAPITAL LETTER EPSILON -->
+<!ENTITY egr              "&#x003B5;" ><!--GREEK SMALL LETTER EPSILON -->
+<!ENTITY Ggr              "&#x00393;" ><!--GREEK CAPITAL LETTER GAMMA -->
+<!ENTITY ggr              "&#x003B3;" ><!--GREEK SMALL LETTER GAMMA -->
+<!ENTITY Igr              "&#x00399;" ><!--GREEK CAPITAL LETTER IOTA -->
+<!ENTITY igr              "&#x003B9;" ><!--GREEK SMALL LETTER IOTA -->
+<!ENTITY Kgr              "&#x0039A;" ><!--GREEK CAPITAL LETTER KAPPA -->
+<!ENTITY kgr              "&#x003BA;" ><!--GREEK SMALL LETTER KAPPA -->
+<!ENTITY KHgr             "&#x003A7;" ><!--GREEK CAPITAL LETTER CHI -->
+<!ENTITY khgr             "&#x003C7;" ><!--GREEK SMALL LETTER CHI -->
+<!ENTITY Lgr              "&#x0039B;" ><!--GREEK CAPITAL LETTER LAMDA -->
+<!ENTITY lgr              "&#x003BB;" ><!--GREEK SMALL LETTER LAMDA -->
+<!ENTITY Mgr              "&#x0039C;" ><!--GREEK CAPITAL LETTER MU -->
+<!ENTITY mgr              "&#x003BC;" ><!--GREEK SMALL LETTER MU -->
+<!ENTITY Ngr              "&#x0039D;" ><!--GREEK CAPITAL LETTER NU -->
+<!ENTITY ngr              "&#x003BD;" ><!--GREEK SMALL LETTER NU -->
+<!ENTITY Ogr              "&#x0039F;" ><!--GREEK CAPITAL LETTER OMICRON -->
+<!ENTITY ogr              "&#x003BF;" ><!--GREEK SMALL LETTER OMICRON -->
+<!ENTITY OHgr             "&#x003A9;" ><!--GREEK CAPITAL LETTER OMEGA -->
+<!ENTITY ohgr             "&#x003C9;" ><!--GREEK SMALL LETTER OMEGA -->
+<!ENTITY Pgr              "&#x003A0;" ><!--GREEK CAPITAL LETTER PI -->
+<!ENTITY pgr              "&#x003C0;" ><!--GREEK SMALL LETTER PI -->
+<!ENTITY PHgr             "&#x003A6;" ><!--GREEK CAPITAL LETTER PHI -->
+<!ENTITY phgr             "&#x003C6;" ><!--GREEK SMALL LETTER PHI -->
+<!ENTITY PSgr             "&#x003A8;" ><!--GREEK CAPITAL LETTER PSI -->
+<!ENTITY psgr             "&#x003C8;" ><!--GREEK SMALL LETTER PSI -->
+<!ENTITY Rgr              "&#x003A1;" ><!--GREEK CAPITAL LETTER RHO -->
+<!ENTITY rgr              "&#x003C1;" ><!--GREEK SMALL LETTER RHO -->
+<!ENTITY sfgr             "&#x003C2;" ><!--GREEK SMALL LETTER FINAL SIGMA -->
+<!ENTITY Sgr              "&#x003A3;" ><!--GREEK CAPITAL LETTER SIGMA -->
+<!ENTITY sgr              "&#x003C3;" ><!--GREEK SMALL LETTER SIGMA -->
+<!ENTITY Tgr              "&#x003A4;" ><!--GREEK CAPITAL LETTER TAU -->
+<!ENTITY tgr              "&#x003C4;" ><!--GREEK SMALL LETTER TAU -->
+<!ENTITY THgr             "&#x00398;" ><!--GREEK CAPITAL LETTER THETA -->
+<!ENTITY thgr             "&#x003B8;" ><!--GREEK SMALL LETTER THETA -->
+<!ENTITY Ugr              "&#x003A5;" ><!--GREEK CAPITAL LETTER UPSILON -->
+<!ENTITY ugr              "&#x003C5;" ><!--GREEK SMALL LETTER UPSILON -->
+<!ENTITY Xgr              "&#x0039E;" ><!--GREEK CAPITAL LETTER XI -->
+<!ENTITY xgr              "&#x003BE;" ><!--GREEK SMALL LETTER XI -->
+<!ENTITY Zgr              "&#x00396;" ><!--GREEK CAPITAL LETTER ZETA -->
+<!ENTITY zgr              "&#x003B6;" ><!--GREEK SMALL LETTER ZETA -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isogrk2.ent b/xml/tests/testData/xml/DocBookHighlighting2/isogrk2.ent
new file mode 100644
index 0000000..726b7dd
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isogrk2.ent
@@ -0,0 +1,61 @@
+
+<!--
+     File isogrk2.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isogrk2.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isogrk2.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isogrk2 PUBLIC
+         "ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isogrk2.ent"
+       >
+       %isogrk2;
+
+-->
+
+<!ENTITY Aacgr            "&#x00386;" ><!--GREEK CAPITAL LETTER ALPHA WITH TONOS -->
+<!ENTITY aacgr            "&#x003AC;" ><!--GREEK SMALL LETTER ALPHA WITH TONOS -->
+<!ENTITY Eacgr            "&#x00388;" ><!--GREEK CAPITAL LETTER EPSILON WITH TONOS -->
+<!ENTITY eacgr            "&#x003AD;" ><!--GREEK SMALL LETTER EPSILON WITH TONOS -->
+<!ENTITY EEacgr           "&#x00389;" ><!--GREEK CAPITAL LETTER ETA WITH TONOS -->
+<!ENTITY eeacgr           "&#x003AE;" ><!--GREEK SMALL LETTER ETA WITH TONOS -->
+<!ENTITY Iacgr            "&#x0038A;" ><!--GREEK CAPITAL LETTER IOTA WITH TONOS -->
+<!ENTITY iacgr            "&#x003AF;" ><!--GREEK SMALL LETTER IOTA WITH TONOS -->
+<!ENTITY idiagr           "&#x00390;" ><!--GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS -->
+<!ENTITY Idigr            "&#x003AA;" ><!--GREEK CAPITAL LETTER IOTA WITH DIALYTIKA -->
+<!ENTITY idigr            "&#x003CA;" ><!--GREEK SMALL LETTER IOTA WITH DIALYTIKA -->
+<!ENTITY Oacgr            "&#x0038C;" ><!--GREEK CAPITAL LETTER OMICRON WITH TONOS -->
+<!ENTITY oacgr            "&#x003CC;" ><!--GREEK SMALL LETTER OMICRON WITH TONOS -->
+<!ENTITY OHacgr           "&#x0038F;" ><!--GREEK CAPITAL LETTER OMEGA WITH TONOS -->
+<!ENTITY ohacgr           "&#x003CE;" ><!--GREEK SMALL LETTER OMEGA WITH TONOS -->
+<!ENTITY Uacgr            "&#x0038E;" ><!--GREEK CAPITAL LETTER UPSILON WITH TONOS -->
+<!ENTITY uacgr            "&#x003CD;" ><!--GREEK SMALL LETTER UPSILON WITH TONOS -->
+<!ENTITY udiagr           "&#x003B0;" ><!--GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS -->
+<!ENTITY Udigr            "&#x003AB;" ><!--GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA -->
+<!ENTITY udigr            "&#x003CB;" ><!--GREEK SMALL LETTER UPSILON WITH DIALYTIKA -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isogrk3.ent b/xml/tests/testData/xml/DocBookHighlighting2/isogrk3.ent
new file mode 100644
index 0000000..28b5c27
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isogrk3.ent
@@ -0,0 +1,84 @@
+
+<!--
+     File isogrk3.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isogrk3.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Greek Symbols//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isogrk3.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isogrk3 PUBLIC
+         "ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isogrk3.ent"
+       >
+       %isogrk3;
+
+-->
+
+<!ENTITY alpha            "&#x003B1;" ><!--GREEK SMALL LETTER ALPHA -->
+<!ENTITY beta             "&#x003B2;" ><!--GREEK SMALL LETTER BETA -->
+<!ENTITY chi              "&#x003C7;" ><!--GREEK SMALL LETTER CHI -->
+<!ENTITY Delta            "&#x00394;" ><!--GREEK CAPITAL LETTER DELTA -->
+<!ENTITY delta            "&#x003B4;" ><!--GREEK SMALL LETTER DELTA -->
+<!ENTITY epsi             "&#x003F5;" ><!--GREEK LUNATE EPSILON SYMBOL -->
+<!ENTITY epsis            "&#x003F5;" ><!--GREEK LUNATE EPSILON SYMBOL -->
+<!ENTITY epsiv            "&#x003B5;" ><!--GREEK SMALL LETTER EPSILON -->
+<!ENTITY eta              "&#x003B7;" ><!--GREEK SMALL LETTER ETA -->
+<!ENTITY Gamma            "&#x00393;" ><!--GREEK CAPITAL LETTER GAMMA -->
+<!ENTITY gamma            "&#x003B3;" ><!--GREEK SMALL LETTER GAMMA -->
+<!ENTITY gammad           "&#x003DD;" ><!--GREEK SMALL LETTER DIGAMMA -->
+<!ENTITY iota             "&#x003B9;" ><!--GREEK SMALL LETTER IOTA -->
+<!ENTITY kappa            "&#x003BA;" ><!--GREEK SMALL LETTER KAPPA -->
+<!ENTITY kappav           "&#x003F0;" ><!--GREEK KAPPA SYMBOL -->
+<!ENTITY Lambda           "&#x0039B;" ><!--GREEK CAPITAL LETTER LAMDA -->
+<!ENTITY lambda           "&#x003BB;" ><!--GREEK SMALL LETTER LAMDA -->
+<!ENTITY mu               "&#x003BC;" ><!--GREEK SMALL LETTER MU -->
+<!ENTITY nu               "&#x003BD;" ><!--GREEK SMALL LETTER NU -->
+<!ENTITY Omega            "&#x003A9;" ><!--GREEK CAPITAL LETTER OMEGA -->
+<!ENTITY omega            "&#x003C9;" ><!--GREEK SMALL LETTER OMEGA -->
+<!ENTITY Phi              "&#x003A6;" ><!--GREEK CAPITAL LETTER PHI -->
+<!ENTITY phis             "&#x003D5;" ><!--GREEK PHI SYMBOL -->
+<!ENTITY phiv             "&#x003C6;" ><!--GREEK SMALL LETTER PHI -->
+<!ENTITY Pi               "&#x003A0;" ><!--GREEK CAPITAL LETTER PI -->
+<!ENTITY pi               "&#x003C0;" ><!--GREEK SMALL LETTER PI -->
+<!ENTITY piv              "&#x003D6;" ><!--GREEK PI SYMBOL -->
+<!ENTITY Psi              "&#x003A8;" ><!--GREEK CAPITAL LETTER PSI -->
+<!ENTITY psi              "&#x003C8;" ><!--GREEK SMALL LETTER PSI -->
+<!ENTITY rho              "&#x003C1;" ><!--GREEK SMALL LETTER RHO -->
+<!ENTITY rhov             "&#x003F1;" ><!--GREEK RHO SYMBOL -->
+<!ENTITY Sigma            "&#x003A3;" ><!--GREEK CAPITAL LETTER SIGMA -->
+<!ENTITY sigma            "&#x003C3;" ><!--GREEK SMALL LETTER SIGMA -->
+<!ENTITY sigmav           "&#x003C2;" ><!--GREEK SMALL LETTER FINAL SIGMA -->
+<!ENTITY tau              "&#x003C4;" ><!--GREEK SMALL LETTER TAU -->
+<!ENTITY Theta            "&#x00398;" ><!--GREEK CAPITAL LETTER THETA -->
+<!ENTITY thetas           "&#x003B8;" ><!--GREEK SMALL LETTER THETA -->
+<!ENTITY thetav           "&#x003D1;" ><!--GREEK THETA SYMBOL -->
+<!ENTITY Upsi             "&#x003D2;" ><!--GREEK UPSILON WITH HOOK SYMBOL -->
+<!ENTITY upsi             "&#x003C5;" ><!--GREEK SMALL LETTER UPSILON -->
+<!ENTITY Xi               "&#x0039E;" ><!--GREEK CAPITAL LETTER XI -->
+<!ENTITY xi               "&#x003BE;" ><!--GREEK SMALL LETTER XI -->
+<!ENTITY zeta             "&#x003B6;" ><!--GREEK SMALL LETTER ZETA -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isogrk4.ent b/xml/tests/testData/xml/DocBookHighlighting2/isogrk4.ent
new file mode 100644
index 0000000..27c6a51
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isogrk4.ent
@@ -0,0 +1,84 @@
+
+<!--
+     File isogrk4.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isogrk4.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isogrk4.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isogrk4 PUBLIC
+         "ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isogrk4.ent"
+       >
+       %isogrk4;
+
+-->
+
+<!ENTITY b.alpha          "&#x1D6C2;" ><!--MATHEMATICAL BOLD SMALL ALPHA -->
+<!ENTITY b.beta           "&#x1D6C3;" ><!--MATHEMATICAL BOLD SMALL BETA -->
+<!ENTITY b.chi            "&#x1D6D8;" ><!--MATHEMATICAL BOLD SMALL CHI -->
+<!ENTITY b.Delta          "&#x1D6AB;" ><!--MATHEMATICAL BOLD CAPITAL DELTA -->
+<!ENTITY b.delta          "&#x1D6C5;" ><!--MATHEMATICAL BOLD SMALL DELTA -->
+<!ENTITY b.epsi           "&#x1D6C6;" ><!--MATHEMATICAL BOLD SMALL EPSILON -->
+<!ENTITY b.epsiv          "&#x1D6DC;" ><!--MATHEMATICAL BOLD EPSILON SYMBOL -->
+<!ENTITY b.eta            "&#x1D6C8;" ><!--MATHEMATICAL BOLD SMALL ETA -->
+<!ENTITY b.Gamma          "&#x1D6AA;" ><!--MATHEMATICAL BOLD CAPITAL GAMMA -->
+<!ENTITY b.gamma          "&#x1D6C4;" ><!--MATHEMATICAL BOLD SMALL GAMMA -->
+<!ENTITY b.Gammad         "&#x003DC;" ><!--GREEK LETTER DIGAMMA -->
+<!ENTITY b.gammad         "&#x003DD;" ><!--GREEK SMALL LETTER DIGAMMA -->
+<!ENTITY b.iota           "&#x1D6CA;" ><!--MATHEMATICAL BOLD SMALL IOTA -->
+<!ENTITY b.kappa          "&#x1D6CB;" ><!--MATHEMATICAL BOLD SMALL KAPPA -->
+<!ENTITY b.kappav         "&#x1D6DE;" ><!--MATHEMATICAL BOLD KAPPA SYMBOL -->
+<!ENTITY b.Lambda         "&#x1D6B2;" ><!--MATHEMATICAL BOLD CAPITAL LAMDA -->
+<!ENTITY b.lambda         "&#x1D6CC;" ><!--MATHEMATICAL BOLD SMALL LAMDA -->
+<!ENTITY b.mu             "&#x1D6CD;" ><!--MATHEMATICAL BOLD SMALL MU -->
+<!ENTITY b.nu             "&#x1D6CE;" ><!--MATHEMATICAL BOLD SMALL NU -->
+<!ENTITY b.Omega          "&#x1D6C0;" ><!--MATHEMATICAL BOLD CAPITAL OMEGA -->
+<!ENTITY b.omega          "&#x1D6DA;" ><!--MATHEMATICAL BOLD SMALL OMEGA -->
+<!ENTITY b.Phi            "&#x1D6BD;" ><!--MATHEMATICAL BOLD CAPITAL PHI -->
+<!ENTITY b.phi            "&#x1D6D7;" ><!--MATHEMATICAL BOLD SMALL PHI -->
+<!ENTITY b.phiv           "&#x1D6DF;" ><!--MATHEMATICAL BOLD PHI SYMBOL -->
+<!ENTITY b.Pi             "&#x1D6B7;" ><!--MATHEMATICAL BOLD CAPITAL PI -->
+<!ENTITY b.pi             "&#x1D6D1;" ><!--MATHEMATICAL BOLD SMALL PI -->
+<!ENTITY b.piv            "&#x1D6E1;" ><!--MATHEMATICAL BOLD PI SYMBOL -->
+<!ENTITY b.Psi            "&#x1D6BF;" ><!--MATHEMATICAL BOLD CAPITAL PSI -->
+<!ENTITY b.psi            "&#x1D6D9;" ><!--MATHEMATICAL BOLD SMALL PSI -->
+<!ENTITY b.rho            "&#x1D6D2;" ><!--MATHEMATICAL BOLD SMALL RHO -->
+<!ENTITY b.rhov           "&#x1D6E0;" ><!--MATHEMATICAL BOLD RHO SYMBOL -->
+<!ENTITY b.Sigma          "&#x1D6BA;" ><!--MATHEMATICAL BOLD CAPITAL SIGMA -->
+<!ENTITY b.sigma          "&#x1D6D4;" ><!--MATHEMATICAL BOLD SMALL SIGMA -->
+<!ENTITY b.sigmav         "&#x1D6D3;" ><!--MATHEMATICAL BOLD SMALL FINAL SIGMA -->
+<!ENTITY b.tau            "&#x1D6D5;" ><!--MATHEMATICAL BOLD SMALL TAU -->
+<!ENTITY b.Theta          "&#x1D6AF;" ><!--MATHEMATICAL BOLD CAPITAL THETA -->
+<!ENTITY b.thetas         "&#x1D6C9;" ><!--MATHEMATICAL BOLD SMALL THETA -->
+<!ENTITY b.thetav         "&#x1D6DD;" ><!--MATHEMATICAL BOLD THETA SYMBOL -->
+<!ENTITY b.Upsi           "&#x1D6BC;" ><!--MATHEMATICAL BOLD CAPITAL UPSILON -->
+<!ENTITY b.upsi           "&#x1D6D6;" ><!--MATHEMATICAL BOLD SMALL UPSILON -->
+<!ENTITY b.Xi             "&#x1D6B5;" ><!--MATHEMATICAL BOLD CAPITAL XI -->
+<!ENTITY b.xi             "&#x1D6CF;" ><!--MATHEMATICAL BOLD SMALL XI -->
+<!ENTITY b.zeta           "&#x1D6C7;" ><!--MATHEMATICAL BOLD SMALL ZETA -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isolat1.ent b/xml/tests/testData/xml/DocBookHighlighting2/isolat1.ent
new file mode 100644
index 0000000..381bd09
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isolat1.ent
@@ -0,0 +1,103 @@
+
+<!--
+     File isolat1.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isolat1.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Added Latin 1//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isolat1.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isolat1 PUBLIC
+         "ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isolat1.ent"
+       >
+       %isolat1;
+
+-->
+
+<!ENTITY Aacute           "&#x000C1;" ><!--LATIN CAPITAL LETTER A WITH ACUTE -->
+<!ENTITY aacute           "&#x000E1;" ><!--LATIN SMALL LETTER A WITH ACUTE -->
+<!ENTITY Acirc            "&#x000C2;" ><!--LATIN CAPITAL LETTER A WITH CIRCUMFLEX -->
+<!ENTITY acirc            "&#x000E2;" ><!--LATIN SMALL LETTER A WITH CIRCUMFLEX -->
+<!ENTITY AElig            "&#x000C6;" ><!--LATIN CAPITAL LETTER AE -->
+<!ENTITY aelig            "&#x000E6;" ><!--LATIN SMALL LETTER AE -->
+<!ENTITY Agrave           "&#x000C0;" ><!--LATIN CAPITAL LETTER A WITH GRAVE -->
+<!ENTITY agrave           "&#x000E0;" ><!--LATIN SMALL LETTER A WITH GRAVE -->
+<!ENTITY Aring            "&#x000C5;" ><!--LATIN CAPITAL LETTER A WITH RING ABOVE -->
+<!ENTITY aring            "&#x000E5;" ><!--LATIN SMALL LETTER A WITH RING ABOVE -->
+<!ENTITY Atilde           "&#x000C3;" ><!--LATIN CAPITAL LETTER A WITH TILDE -->
+<!ENTITY atilde           "&#x000E3;" ><!--LATIN SMALL LETTER A WITH TILDE -->
+<!ENTITY Auml             "&#x000C4;" ><!--LATIN CAPITAL LETTER A WITH DIAERESIS -->
+<!ENTITY auml             "&#x000E4;" ><!--LATIN SMALL LETTER A WITH DIAERESIS -->
+<!ENTITY Ccedil           "&#x000C7;" ><!--LATIN CAPITAL LETTER C WITH CEDILLA -->
+<!ENTITY ccedil           "&#x000E7;" ><!--LATIN SMALL LETTER C WITH CEDILLA -->
+<!ENTITY Eacute           "&#x000C9;" ><!--LATIN CAPITAL LETTER E WITH ACUTE -->
+<!ENTITY eacute           "&#x000E9;" ><!--LATIN SMALL LETTER E WITH ACUTE -->
+<!ENTITY Ecirc            "&#x000CA;" ><!--LATIN CAPITAL LETTER E WITH CIRCUMFLEX -->
+<!ENTITY ecirc            "&#x000EA;" ><!--LATIN SMALL LETTER E WITH CIRCUMFLEX -->
+<!ENTITY Egrave           "&#x000C8;" ><!--LATIN CAPITAL LETTER E WITH GRAVE -->
+<!ENTITY egrave           "&#x000E8;" ><!--LATIN SMALL LETTER E WITH GRAVE -->
+<!ENTITY ETH              "&#x000D0;" ><!--LATIN CAPITAL LETTER ETH -->
+<!ENTITY eth              "&#x000F0;" ><!--LATIN SMALL LETTER ETH -->
+<!ENTITY Euml             "&#x000CB;" ><!--LATIN CAPITAL LETTER E WITH DIAERESIS -->
+<!ENTITY euml             "&#x000EB;" ><!--LATIN SMALL LETTER E WITH DIAERESIS -->
+<!ENTITY Iacute           "&#x000CD;" ><!--LATIN CAPITAL LETTER I WITH ACUTE -->
+<!ENTITY iacute           "&#x000ED;" ><!--LATIN SMALL LETTER I WITH ACUTE -->
+<!ENTITY Icirc            "&#x000CE;" ><!--LATIN CAPITAL LETTER I WITH CIRCUMFLEX -->
+<!ENTITY icirc            "&#x000EE;" ><!--LATIN SMALL LETTER I WITH CIRCUMFLEX -->
+<!ENTITY Igrave           "&#x000CC;" ><!--LATIN CAPITAL LETTER I WITH GRAVE -->
+<!ENTITY igrave           "&#x000EC;" ><!--LATIN SMALL LETTER I WITH GRAVE -->
+<!ENTITY Iuml             "&#x000CF;" ><!--LATIN CAPITAL LETTER I WITH DIAERESIS -->
+<!ENTITY iuml             "&#x000EF;" ><!--LATIN SMALL LETTER I WITH DIAERESIS -->
+<!ENTITY Ntilde           "&#x000D1;" ><!--LATIN CAPITAL LETTER N WITH TILDE -->
+<!ENTITY ntilde           "&#x000F1;" ><!--LATIN SMALL LETTER N WITH TILDE -->
+<!ENTITY Oacute           "&#x000D3;" ><!--LATIN CAPITAL LETTER O WITH ACUTE -->
+<!ENTITY oacute           "&#x000F3;" ><!--LATIN SMALL LETTER O WITH ACUTE -->
+<!ENTITY Ocirc            "&#x000D4;" ><!--LATIN CAPITAL LETTER O WITH CIRCUMFLEX -->
+<!ENTITY ocirc            "&#x000F4;" ><!--LATIN SMALL LETTER O WITH CIRCUMFLEX -->
+<!ENTITY Ograve           "&#x000D2;" ><!--LATIN CAPITAL LETTER O WITH GRAVE -->
+<!ENTITY ograve           "&#x000F2;" ><!--LATIN SMALL LETTER O WITH GRAVE -->
+<!ENTITY Oslash           "&#x000D8;" ><!--LATIN CAPITAL LETTER O WITH STROKE -->
+<!ENTITY oslash           "&#x000F8;" ><!--LATIN SMALL LETTER O WITH STROKE -->
+<!ENTITY Otilde           "&#x000D5;" ><!--LATIN CAPITAL LETTER O WITH TILDE -->
+<!ENTITY otilde           "&#x000F5;" ><!--LATIN SMALL LETTER O WITH TILDE -->
+<!ENTITY Ouml             "&#x000D6;" ><!--LATIN CAPITAL LETTER O WITH DIAERESIS -->
+<!ENTITY ouml             "&#x000F6;" ><!--LATIN SMALL LETTER O WITH DIAERESIS -->
+<!ENTITY szlig            "&#x000DF;" ><!--LATIN SMALL LETTER SHARP S -->
+<!ENTITY THORN            "&#x000DE;" ><!--LATIN CAPITAL LETTER THORN -->
+<!ENTITY thorn            "&#x000FE;" ><!--LATIN SMALL LETTER THORN -->
+<!ENTITY Uacute           "&#x000DA;" ><!--LATIN CAPITAL LETTER U WITH ACUTE -->
+<!ENTITY uacute           "&#x000FA;" ><!--LATIN SMALL LETTER U WITH ACUTE -->
+<!ENTITY Ucirc            "&#x000DB;" ><!--LATIN CAPITAL LETTER U WITH CIRCUMFLEX -->
+<!ENTITY ucirc            "&#x000FB;" ><!--LATIN SMALL LETTER U WITH CIRCUMFLEX -->
+<!ENTITY Ugrave           "&#x000D9;" ><!--LATIN CAPITAL LETTER U WITH GRAVE -->
+<!ENTITY ugrave           "&#x000F9;" ><!--LATIN SMALL LETTER U WITH GRAVE -->
+<!ENTITY Uuml             "&#x000DC;" ><!--LATIN CAPITAL LETTER U WITH DIAERESIS -->
+<!ENTITY uuml             "&#x000FC;" ><!--LATIN SMALL LETTER U WITH DIAERESIS -->
+<!ENTITY Yacute           "&#x000DD;" ><!--LATIN CAPITAL LETTER Y WITH ACUTE -->
+<!ENTITY yacute           "&#x000FD;" ><!--LATIN SMALL LETTER Y WITH ACUTE -->
+<!ENTITY yuml             "&#x000FF;" ><!--LATIN SMALL LETTER Y WITH DIAERESIS -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isolat2.ent b/xml/tests/testData/xml/DocBookHighlighting2/isolat2.ent
new file mode 100644
index 0000000..e91ffdb
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isolat2.ent
@@ -0,0 +1,162 @@
+
+<!--
+     File isolat2.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isolat2.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Added Latin 2//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isolat2.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isolat2 PUBLIC
+         "ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isolat2.ent"
+       >
+       %isolat2;
+
+-->
+
+<!ENTITY Abreve           "&#x00102;" ><!--LATIN CAPITAL LETTER A WITH BREVE -->
+<!ENTITY abreve           "&#x00103;" ><!--LATIN SMALL LETTER A WITH BREVE -->
+<!ENTITY Amacr            "&#x00100;" ><!--LATIN CAPITAL LETTER A WITH MACRON -->
+<!ENTITY amacr            "&#x00101;" ><!--LATIN SMALL LETTER A WITH MACRON -->
+<!ENTITY Aogon            "&#x00104;" ><!--LATIN CAPITAL LETTER A WITH OGONEK -->
+<!ENTITY aogon            "&#x00105;" ><!--LATIN SMALL LETTER A WITH OGONEK -->
+<!ENTITY Cacute           "&#x00106;" ><!--LATIN CAPITAL LETTER C WITH ACUTE -->
+<!ENTITY cacute           "&#x00107;" ><!--LATIN SMALL LETTER C WITH ACUTE -->
+<!ENTITY Ccaron           "&#x0010C;" ><!--LATIN CAPITAL LETTER C WITH CARON -->
+<!ENTITY ccaron           "&#x0010D;" ><!--LATIN SMALL LETTER C WITH CARON -->
+<!ENTITY Ccirc            "&#x00108;" ><!--LATIN CAPITAL LETTER C WITH CIRCUMFLEX -->
+<!ENTITY ccirc            "&#x00109;" ><!--LATIN SMALL LETTER C WITH CIRCUMFLEX -->
+<!ENTITY Cdot             "&#x0010A;" ><!--LATIN CAPITAL LETTER C WITH DOT ABOVE -->
+<!ENTITY cdot             "&#x0010B;" ><!--LATIN SMALL LETTER C WITH DOT ABOVE -->
+<!ENTITY Dcaron           "&#x0010E;" ><!--LATIN CAPITAL LETTER D WITH CARON -->
+<!ENTITY dcaron           "&#x0010F;" ><!--LATIN SMALL LETTER D WITH CARON -->
+<!ENTITY Dstrok           "&#x00110;" ><!--LATIN CAPITAL LETTER D WITH STROKE -->
+<!ENTITY dstrok           "&#x00111;" ><!--LATIN SMALL LETTER D WITH STROKE -->
+<!ENTITY Ecaron           "&#x0011A;" ><!--LATIN CAPITAL LETTER E WITH CARON -->
+<!ENTITY ecaron           "&#x0011B;" ><!--LATIN SMALL LETTER E WITH CARON -->
+<!ENTITY Edot             "&#x00116;" ><!--LATIN CAPITAL LETTER E WITH DOT ABOVE -->
+<!ENTITY edot             "&#x00117;" ><!--LATIN SMALL LETTER E WITH DOT ABOVE -->
+<!ENTITY Emacr            "&#x00112;" ><!--LATIN CAPITAL LETTER E WITH MACRON -->
+<!ENTITY emacr            "&#x00113;" ><!--LATIN SMALL LETTER E WITH MACRON -->
+<!ENTITY ENG              "&#x0014A;" ><!--LATIN CAPITAL LETTER ENG -->
+<!ENTITY eng              "&#x0014B;" ><!--LATIN SMALL LETTER ENG -->
+<!ENTITY Eogon            "&#x00118;" ><!--LATIN CAPITAL LETTER E WITH OGONEK -->
+<!ENTITY eogon            "&#x00119;" ><!--LATIN SMALL LETTER E WITH OGONEK -->
+<!ENTITY gacute           "&#x001F5;" ><!--LATIN SMALL LETTER G WITH ACUTE -->
+<!ENTITY Gbreve           "&#x0011E;" ><!--LATIN CAPITAL LETTER G WITH BREVE -->
+<!ENTITY gbreve           "&#x0011F;" ><!--LATIN SMALL LETTER G WITH BREVE -->
+<!ENTITY Gcedil           "&#x00122;" ><!--LATIN CAPITAL LETTER G WITH CEDILLA -->
+<!ENTITY Gcirc            "&#x0011C;" ><!--LATIN CAPITAL LETTER G WITH CIRCUMFLEX -->
+<!ENTITY gcirc            "&#x0011D;" ><!--LATIN SMALL LETTER G WITH CIRCUMFLEX -->
+<!ENTITY Gdot             "&#x00120;" ><!--LATIN CAPITAL LETTER G WITH DOT ABOVE -->
+<!ENTITY gdot             "&#x00121;" ><!--LATIN SMALL LETTER G WITH DOT ABOVE -->
+<!ENTITY Hcirc            "&#x00124;" ><!--LATIN CAPITAL LETTER H WITH CIRCUMFLEX -->
+<!ENTITY hcirc            "&#x00125;" ><!--LATIN SMALL LETTER H WITH CIRCUMFLEX -->
+<!ENTITY Hstrok           "&#x00126;" ><!--LATIN CAPITAL LETTER H WITH STROKE -->
+<!ENTITY hstrok           "&#x00127;" ><!--LATIN SMALL LETTER H WITH STROKE -->
+<!ENTITY Idot             "&#x00130;" ><!--LATIN CAPITAL LETTER I WITH DOT ABOVE -->
+<!ENTITY IJlig            "&#x00132;" ><!--LATIN CAPITAL LIGATURE IJ -->
+<!ENTITY ijlig            "&#x00133;" ><!--LATIN SMALL LIGATURE IJ -->
+<!ENTITY Imacr            "&#x0012A;" ><!--LATIN CAPITAL LETTER I WITH MACRON -->
+<!ENTITY imacr            "&#x0012B;" ><!--LATIN SMALL LETTER I WITH MACRON -->
+<!ENTITY inodot           "&#x00131;" ><!--LATIN SMALL LETTER DOTLESS I -->
+<!ENTITY Iogon            "&#x0012E;" ><!--LATIN CAPITAL LETTER I WITH OGONEK -->
+<!ENTITY iogon            "&#x0012F;" ><!--LATIN SMALL LETTER I WITH OGONEK -->
+<!ENTITY Itilde           "&#x00128;" ><!--LATIN CAPITAL LETTER I WITH TILDE -->
+<!ENTITY itilde           "&#x00129;" ><!--LATIN SMALL LETTER I WITH TILDE -->
+<!ENTITY Jcirc            "&#x00134;" ><!--LATIN CAPITAL LETTER J WITH CIRCUMFLEX -->
+<!ENTITY jcirc            "&#x00135;" ><!--LATIN SMALL LETTER J WITH CIRCUMFLEX -->
+<!ENTITY Kcedil           "&#x00136;" ><!--LATIN CAPITAL LETTER K WITH CEDILLA -->
+<!ENTITY kcedil           "&#x00137;" ><!--LATIN SMALL LETTER K WITH CEDILLA -->
+<!ENTITY kgreen           "&#x00138;" ><!--LATIN SMALL LETTER KRA -->
+<!ENTITY Lacute           "&#x00139;" ><!--LATIN CAPITAL LETTER L WITH ACUTE -->
+<!ENTITY lacute           "&#x0013A;" ><!--LATIN SMALL LETTER L WITH ACUTE -->
+<!ENTITY Lcaron           "&#x0013D;" ><!--LATIN CAPITAL LETTER L WITH CARON -->
+<!ENTITY lcaron           "&#x0013E;" ><!--LATIN SMALL LETTER L WITH CARON -->
+<!ENTITY Lcedil           "&#x0013B;" ><!--LATIN CAPITAL LETTER L WITH CEDILLA -->
+<!ENTITY lcedil           "&#x0013C;" ><!--LATIN SMALL LETTER L WITH CEDILLA -->
+<!ENTITY Lmidot           "&#x0013F;" ><!--LATIN CAPITAL LETTER L WITH MIDDLE DOT -->
+<!ENTITY lmidot           "&#x00140;" ><!--LATIN SMALL LETTER L WITH MIDDLE DOT -->
+<!ENTITY Lstrok           "&#x00141;" ><!--LATIN CAPITAL LETTER L WITH STROKE -->
+<!ENTITY lstrok           "&#x00142;" ><!--LATIN SMALL LETTER L WITH STROKE -->
+<!ENTITY Nacute           "&#x00143;" ><!--LATIN CAPITAL LETTER N WITH ACUTE -->
+<!ENTITY nacute           "&#x00144;" ><!--LATIN SMALL LETTER N WITH ACUTE -->
+<!ENTITY napos            "&#x00149;" ><!--LATIN SMALL LETTER N PRECEDED BY APOSTROPHE -->
+<!ENTITY Ncaron           "&#x00147;" ><!--LATIN CAPITAL LETTER N WITH CARON -->
+<!ENTITY ncaron           "&#x00148;" ><!--LATIN SMALL LETTER N WITH CARON -->
+<!ENTITY Ncedil           "&#x00145;" ><!--LATIN CAPITAL LETTER N WITH CEDILLA -->
+<!ENTITY ncedil           "&#x00146;" ><!--LATIN SMALL LETTER N WITH CEDILLA -->
+<!ENTITY Odblac           "&#x00150;" ><!--LATIN CAPITAL LETTER O WITH DOUBLE ACUTE -->
+<!ENTITY odblac           "&#x00151;" ><!--LATIN SMALL LETTER O WITH DOUBLE ACUTE -->
+<!ENTITY OElig            "&#x00152;" ><!--LATIN CAPITAL LIGATURE OE -->
+<!ENTITY oelig            "&#x00153;" ><!--LATIN SMALL LIGATURE OE -->
+<!ENTITY Omacr            "&#x0014C;" ><!--LATIN CAPITAL LETTER O WITH MACRON -->
+<!ENTITY omacr            "&#x0014D;" ><!--LATIN SMALL LETTER O WITH MACRON -->
+<!ENTITY Racute           "&#x00154;" ><!--LATIN CAPITAL LETTER R WITH ACUTE -->
+<!ENTITY racute           "&#x00155;" ><!--LATIN SMALL LETTER R WITH ACUTE -->
+<!ENTITY Rcaron           "&#x00158;" ><!--LATIN CAPITAL LETTER R WITH CARON -->
+<!ENTITY rcaron           "&#x00159;" ><!--LATIN SMALL LETTER R WITH CARON -->
+<!ENTITY Rcedil           "&#x00156;" ><!--LATIN CAPITAL LETTER R WITH CEDILLA -->
+<!ENTITY rcedil           "&#x00157;" ><!--LATIN SMALL LETTER R WITH CEDILLA -->
+<!ENTITY Sacute           "&#x0015A;" ><!--LATIN CAPITAL LETTER S WITH ACUTE -->
+<!ENTITY sacute           "&#x0015B;" ><!--LATIN SMALL LETTER S WITH ACUTE -->
+<!ENTITY Scaron           "&#x00160;" ><!--LATIN CAPITAL LETTER S WITH CARON -->
+<!ENTITY scaron           "&#x00161;" ><!--LATIN SMALL LETTER S WITH CARON -->
+<!ENTITY Scedil           "&#x0015E;" ><!--LATIN CAPITAL LETTER S WITH CEDILLA -->
+<!ENTITY scedil           "&#x0015F;" ><!--LATIN SMALL LETTER S WITH CEDILLA -->
+<!ENTITY Scirc            "&#x0015C;" ><!--LATIN CAPITAL LETTER S WITH CIRCUMFLEX -->
+<!ENTITY scirc            "&#x0015D;" ><!--LATIN SMALL LETTER S WITH CIRCUMFLEX -->
+<!ENTITY Tcaron           "&#x00164;" ><!--LATIN CAPITAL LETTER T WITH CARON -->
+<!ENTITY tcaron           "&#x00165;" ><!--LATIN SMALL LETTER T WITH CARON -->
+<!ENTITY Tcedil           "&#x00162;" ><!--LATIN CAPITAL LETTER T WITH CEDILLA -->
+<!ENTITY tcedil           "&#x00163;" ><!--LATIN SMALL LETTER T WITH CEDILLA -->
+<!ENTITY Tstrok           "&#x00166;" ><!--LATIN CAPITAL LETTER T WITH STROKE -->
+<!ENTITY tstrok           "&#x00167;" ><!--LATIN SMALL LETTER T WITH STROKE -->
+<!ENTITY Ubreve           "&#x0016C;" ><!--LATIN CAPITAL LETTER U WITH BREVE -->
+<!ENTITY ubreve           "&#x0016D;" ><!--LATIN SMALL LETTER U WITH BREVE -->
+<!ENTITY Udblac           "&#x00170;" ><!--LATIN CAPITAL LETTER U WITH DOUBLE ACUTE -->
+<!ENTITY udblac           "&#x00171;" ><!--LATIN SMALL LETTER U WITH DOUBLE ACUTE -->
+<!ENTITY Umacr            "&#x0016A;" ><!--LATIN CAPITAL LETTER U WITH MACRON -->
+<!ENTITY umacr            "&#x0016B;" ><!--LATIN SMALL LETTER U WITH MACRON -->
+<!ENTITY Uogon            "&#x00172;" ><!--LATIN CAPITAL LETTER U WITH OGONEK -->
+<!ENTITY uogon            "&#x00173;" ><!--LATIN SMALL LETTER U WITH OGONEK -->
+<!ENTITY Uring            "&#x0016E;" ><!--LATIN CAPITAL LETTER U WITH RING ABOVE -->
+<!ENTITY uring            "&#x0016F;" ><!--LATIN SMALL LETTER U WITH RING ABOVE -->
+<!ENTITY Utilde           "&#x00168;" ><!--LATIN CAPITAL LETTER U WITH TILDE -->
+<!ENTITY utilde           "&#x00169;" ><!--LATIN SMALL LETTER U WITH TILDE -->
+<!ENTITY Wcirc            "&#x00174;" ><!--LATIN CAPITAL LETTER W WITH CIRCUMFLEX -->
+<!ENTITY wcirc            "&#x00175;" ><!--LATIN SMALL LETTER W WITH CIRCUMFLEX -->
+<!ENTITY Ycirc            "&#x00176;" ><!--LATIN CAPITAL LETTER Y WITH CIRCUMFLEX -->
+<!ENTITY ycirc            "&#x00177;" ><!--LATIN SMALL LETTER Y WITH CIRCUMFLEX -->
+<!ENTITY Yuml             "&#x00178;" ><!--LATIN CAPITAL LETTER Y WITH DIAERESIS -->
+<!ENTITY Zacute           "&#x00179;" ><!--LATIN CAPITAL LETTER Z WITH ACUTE -->
+<!ENTITY zacute           "&#x0017A;" ><!--LATIN SMALL LETTER Z WITH ACUTE -->
+<!ENTITY Zcaron           "&#x0017D;" ><!--LATIN CAPITAL LETTER Z WITH CARON -->
+<!ENTITY zcaron           "&#x0017E;" ><!--LATIN SMALL LETTER Z WITH CARON -->
+<!ENTITY Zdot             "&#x0017B;" ><!--LATIN CAPITAL LETTER Z WITH DOT ABOVE -->
+<!ENTITY zdot             "&#x0017C;" ><!--LATIN SMALL LETTER Z WITH DOT ABOVE -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isonum.ent b/xml/tests/testData/xml/DocBookHighlighting2/isonum.ent
new file mode 100644
index 0000000..884c0c4
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isonum.ent
@@ -0,0 +1,117 @@
+
+<!--
+     File isonum.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isonum.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isonum.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isonum PUBLIC
+         "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isonum.ent"
+       >
+       %isonum;
+
+-->
+
+<!ENTITY amp              "&#38;#38;" ><!--AMPERSAND -->
+<!ENTITY apos             "&#x00027;" ><!--APOSTROPHE -->
+<!ENTITY ast              "&#x0002A;" ><!--ASTERISK -->
+<!ENTITY brvbar           "&#x000A6;" ><!--BROKEN BAR -->
+<!ENTITY bsol             "&#x0005C;" ><!--REVERSE SOLIDUS -->
+<!ENTITY cent             "&#x000A2;" ><!--CENT SIGN -->
+<!ENTITY colon            "&#x0003A;" ><!--COLON -->
+<!ENTITY comma            "&#x0002C;" ><!--COMMA -->
+<!ENTITY commat           "&#x00040;" ><!--COMMERCIAL AT -->
+<!ENTITY copy             "&#x000A9;" ><!--COPYRIGHT SIGN -->
+<!ENTITY curren           "&#x000A4;" ><!--CURRENCY SIGN -->
+<!ENTITY darr             "&#x02193;" ><!--DOWNWARDS ARROW -->
+<!ENTITY deg              "&#x000B0;" ><!--DEGREE SIGN -->
+<!ENTITY divide           "&#x000F7;" ><!--DIVISION SIGN -->
+<!ENTITY dollar           "&#x00024;" ><!--DOLLAR SIGN -->
+<!ENTITY equals           "&#x0003D;" ><!--EQUALS SIGN -->
+<!ENTITY excl             "&#x00021;" ><!--EXCLAMATION MARK -->
+<!ENTITY frac12           "&#x000BD;" ><!--VULGAR FRACTION ONE HALF -->
+<!ENTITY frac14           "&#x000BC;" ><!--VULGAR FRACTION ONE QUARTER -->
+<!ENTITY frac18           "&#x0215B;" ><!--VULGAR FRACTION ONE EIGHTH -->
+<!ENTITY frac34           "&#x000BE;" ><!--VULGAR FRACTION THREE QUARTERS -->
+<!ENTITY frac38           "&#x0215C;" ><!--VULGAR FRACTION THREE EIGHTHS -->
+<!ENTITY frac58           "&#x0215D;" ><!--VULGAR FRACTION FIVE EIGHTHS -->
+<!ENTITY frac78           "&#x0215E;" ><!--VULGAR FRACTION SEVEN EIGHTHS -->
+<!ENTITY gt               "&#x0003E;" ><!--GREATER-THAN SIGN -->
+<!ENTITY half             "&#x000BD;" ><!--VULGAR FRACTION ONE HALF -->
+<!ENTITY horbar           "&#x02015;" ><!--HORIZONTAL BAR -->
+<!ENTITY hyphen           "&#x02010;" ><!--HYPHEN -->
+<!ENTITY iexcl            "&#x000A1;" ><!--INVERTED EXCLAMATION MARK -->
+<!ENTITY iquest           "&#x000BF;" ><!--INVERTED QUESTION MARK -->
+<!ENTITY laquo            "&#x000AB;" ><!--LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -->
+<!ENTITY larr             "&#x02190;" ><!--LEFTWARDS ARROW -->
+<!ENTITY lcub             "&#x0007B;" ><!--LEFT CURLY BRACKET -->
+<!ENTITY ldquo            "&#x0201C;" ><!--LEFT DOUBLE QUOTATION MARK -->
+<!ENTITY lowbar           "&#x0005F;" ><!--LOW LINE -->
+<!ENTITY lpar             "&#x00028;" ><!--LEFT PARENTHESIS -->
+<!ENTITY lsqb             "&#x0005B;" ><!--LEFT SQUARE BRACKET -->
+<!ENTITY lsquo            "&#x02018;" ><!--LEFT SINGLE QUOTATION MARK -->
+<!ENTITY lt               "&#38;#60;" ><!--LESS-THAN SIGN -->
+<!ENTITY micro            "&#x000B5;" ><!--MICRO SIGN -->
+<!ENTITY middot           "&#x000B7;" ><!--MIDDLE DOT -->
+<!ENTITY nbsp             "&#x000A0;" ><!--NO-BREAK SPACE -->
+<!ENTITY not              "&#x000AC;" ><!--NOT SIGN -->
+<!ENTITY num              "&#x00023;" ><!--NUMBER SIGN -->
+<!ENTITY ohm              "&#x02126;" ><!--OHM SIGN -->
+<!ENTITY ordf             "&#x000AA;" ><!--FEMININE ORDINAL INDICATOR -->
+<!ENTITY ordm             "&#x000BA;" ><!--MASCULINE ORDINAL INDICATOR -->
+<!ENTITY para             "&#x000B6;" ><!--PILCROW SIGN -->
+<!ENTITY percnt           "&#x00025;" ><!--PERCENT SIGN -->
+<!ENTITY period           "&#x0002E;" ><!--FULL STOP -->
+<!ENTITY plus             "&#x0002B;" ><!--PLUS SIGN -->
+<!ENTITY plusmn           "&#x000B1;" ><!--PLUS-MINUS SIGN -->
+<!ENTITY pound            "&#x000A3;" ><!--POUND SIGN -->
+<!ENTITY quest            "&#x0003F;" ><!--QUESTION MARK -->
+<!ENTITY quot             "&#x00022;" ><!--QUOTATION MARK -->
+<!ENTITY raquo            "&#x000BB;" ><!--RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -->
+<!ENTITY rarr             "&#x02192;" ><!--RIGHTWARDS ARROW -->
+<!ENTITY rcub             "&#x0007D;" ><!--RIGHT CURLY BRACKET -->
+<!ENTITY rdquo            "&#x0201D;" ><!--RIGHT DOUBLE QUOTATION MARK -->
+<!ENTITY reg              "&#x000AE;" ><!--REGISTERED SIGN -->
+<!ENTITY rpar             "&#x00029;" ><!--RIGHT PARENTHESIS -->
+<!ENTITY rsqb             "&#x0005D;" ><!--RIGHT SQUARE BRACKET -->
+<!ENTITY rsquo            "&#x02019;" ><!--RIGHT SINGLE QUOTATION MARK -->
+<!ENTITY sect             "&#x000A7;" ><!--SECTION SIGN -->
+<!ENTITY semi             "&#x0003B;" ><!--SEMICOLON -->
+<!ENTITY shy              "&#x000AD;" ><!--SOFT HYPHEN -->
+<!ENTITY sol              "&#x0002F;" ><!--SOLIDUS -->
+<!ENTITY sung             "&#x0266A;" ><!--EIGHTH NOTE -->
+<!ENTITY sup1             "&#x000B9;" ><!--SUPERSCRIPT ONE -->
+<!ENTITY sup2             "&#x000B2;" ><!--SUPERSCRIPT TWO -->
+<!ENTITY sup3             "&#x000B3;" ><!--SUPERSCRIPT THREE -->
+<!ENTITY times            "&#x000D7;" ><!--MULTIPLICATION SIGN -->
+<!ENTITY trade            "&#x02122;" ><!--TRADE MARK SIGN -->
+<!ENTITY uarr             "&#x02191;" ><!--UPWARDS ARROW -->
+<!ENTITY verbar           "&#x0007C;" ><!--VERTICAL LINE -->
+<!ENTITY yen              "&#x000A5;" ><!--YEN SIGN -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isopub.ent b/xml/tests/testData/xml/DocBookHighlighting2/isopub.ent
new file mode 100644
index 0000000..a117878
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isopub.ent
@@ -0,0 +1,125 @@
+
+<!--
+     File isopub.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isopub.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES Publishing//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isopub.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isopub PUBLIC
+         "ISO 8879:1986//ENTITIES Publishing//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isopub.ent"
+       >
+       %isopub;
+
+-->
+
+<!ENTITY blank            "&#x02423;" ><!--OPEN BOX -->
+<!ENTITY blk12            "&#x02592;" ><!--MEDIUM SHADE -->
+<!ENTITY blk14            "&#x02591;" ><!--LIGHT SHADE -->
+<!ENTITY blk34            "&#x02593;" ><!--DARK SHADE -->
+<!ENTITY block            "&#x02588;" ><!--FULL BLOCK -->
+<!ENTITY bull             "&#x02022;" ><!--BULLET -->
+<!ENTITY caret            "&#x02041;" ><!--CARET INSERTION POINT -->
+<!ENTITY check            "&#x02713;" ><!--CHECK MARK -->
+<!ENTITY cir              "&#x025CB;" ><!--WHITE CIRCLE -->
+<!ENTITY clubs            "&#x02663;" ><!--BLACK CLUB SUIT -->
+<!ENTITY copysr           "&#x02117;" ><!--SOUND RECORDING COPYRIGHT -->
+<!ENTITY cross            "&#x02717;" ><!--BALLOT X -->
+<!ENTITY Dagger           "&#x02021;" ><!--DOUBLE DAGGER -->
+<!ENTITY dagger           "&#x02020;" ><!--DAGGER -->
+<!ENTITY dash             "&#x02010;" ><!--HYPHEN -->
+<!ENTITY diams            "&#x02666;" ><!--BLACK DIAMOND SUIT -->
+<!ENTITY dlcrop           "&#x0230D;" ><!--BOTTOM LEFT CROP -->
+<!ENTITY drcrop           "&#x0230C;" ><!--BOTTOM RIGHT CROP -->
+<!ENTITY dtri             "&#x025BF;" ><!--WHITE DOWN-POINTING SMALL TRIANGLE -->
+<!ENTITY dtrif            "&#x025BE;" ><!--BLACK DOWN-POINTING SMALL TRIANGLE -->
+<!ENTITY emsp             "&#x02003;" ><!--EM SPACE -->
+<!ENTITY emsp13           "&#x02004;" ><!--THREE-PER-EM SPACE -->
+<!ENTITY emsp14           "&#x02005;" ><!--FOUR-PER-EM SPACE -->
+<!ENTITY ensp             "&#x02002;" ><!--EN SPACE -->
+<!ENTITY female           "&#x02640;" ><!--FEMALE SIGN -->
+<!ENTITY ffilig           "&#x0FB03;" ><!--LATIN SMALL LIGATURE FFI -->
+<!ENTITY fflig            "&#x0FB00;" ><!--LATIN SMALL LIGATURE FF -->
+<!ENTITY ffllig           "&#x0FB04;" ><!--LATIN SMALL LIGATURE FFL -->
+<!ENTITY filig            "&#x0FB01;" ><!--LATIN SMALL LIGATURE FI -->
+<!ENTITY flat             "&#x0266D;" ><!--MUSIC FLAT SIGN -->
+<!ENTITY fllig            "&#x0FB02;" ><!--LATIN SMALL LIGATURE FL -->
+<!ENTITY frac13           "&#x02153;" ><!--VULGAR FRACTION ONE THIRD -->
+<!ENTITY frac15           "&#x02155;" ><!--VULGAR FRACTION ONE FIFTH -->
+<!ENTITY frac16           "&#x02159;" ><!--VULGAR FRACTION ONE SIXTH -->
+<!ENTITY frac23           "&#x02154;" ><!--VULGAR FRACTION TWO THIRDS -->
+<!ENTITY frac25           "&#x02156;" ><!--VULGAR FRACTION TWO FIFTHS -->
+<!ENTITY frac35           "&#x02157;" ><!--VULGAR FRACTION THREE FIFTHS -->
+<!ENTITY frac45           "&#x02158;" ><!--VULGAR FRACTION FOUR FIFTHS -->
+<!ENTITY frac56           "&#x0215A;" ><!--VULGAR FRACTION FIVE SIXTHS -->
+<!ENTITY hairsp           "&#x0200A;" ><!--HAIR SPACE -->
+<!ENTITY hearts           "&#x02665;" ><!--BLACK HEART SUIT -->
+<!ENTITY hellip           "&#x02026;" ><!--HORIZONTAL ELLIPSIS -->
+<!ENTITY hybull           "&#x02043;" ><!--HYPHEN BULLET -->
+<!ENTITY incare           "&#x02105;" ><!--CARE OF -->
+<!ENTITY ldquor           "&#x0201E;" ><!--DOUBLE LOW-9 QUOTATION MARK -->
+<!ENTITY lhblk            "&#x02584;" ><!--LOWER HALF BLOCK -->
+<!ENTITY loz              "&#x025CA;" ><!--LOZENGE -->
+<!ENTITY lozf             "&#x029EB;" ><!--BLACK LOZENGE -->
+<!ENTITY lsquor           "&#x0201A;" ><!--SINGLE LOW-9 QUOTATION MARK -->
+<!ENTITY ltri             "&#x025C3;" ><!--WHITE LEFT-POINTING SMALL TRIANGLE -->
+<!ENTITY ltrif            "&#x025C2;" ><!--BLACK LEFT-POINTING SMALL TRIANGLE -->
+<!ENTITY male             "&#x02642;" ><!--MALE SIGN -->
+<!ENTITY malt             "&#x02720;" ><!--MALTESE CROSS -->
+<!ENTITY marker           "&#x025AE;" ><!--BLACK VERTICAL RECTANGLE -->
+<!ENTITY mdash            "&#x02014;" ><!--EM DASH -->
+<!ENTITY mldr             "&#x02026;" ><!--HORIZONTAL ELLIPSIS -->
+<!ENTITY natur            "&#x0266E;" ><!--MUSIC NATURAL SIGN -->
+<!ENTITY ndash            "&#x02013;" ><!--EN DASH -->
+<!ENTITY nldr             "&#x02025;" ><!--TWO DOT LEADER -->
+<!ENTITY numsp            "&#x02007;" ><!--FIGURE SPACE -->
+<!ENTITY phone            "&#x0260E;" ><!--BLACK TELEPHONE -->
+<!ENTITY puncsp           "&#x02008;" ><!--PUNCTUATION SPACE -->
+<!ENTITY rdquor           "&#x0201D;" ><!--RIGHT DOUBLE QUOTATION MARK -->
+<!ENTITY rect             "&#x025AD;" ><!--WHITE RECTANGLE -->
+<!ENTITY rsquor           "&#x02019;" ><!--RIGHT SINGLE QUOTATION MARK -->
+<!ENTITY rtri             "&#x025B9;" ><!--WHITE RIGHT-POINTING SMALL TRIANGLE -->
+<!ENTITY rtrif            "&#x025B8;" ><!--BLACK RIGHT-POINTING SMALL TRIANGLE -->
+<!ENTITY rx               "&#x0211E;" ><!--PRESCRIPTION TAKE -->
+<!ENTITY sext             "&#x02736;" ><!--SIX POINTED BLACK STAR -->
+<!ENTITY sharp            "&#x0266F;" ><!--MUSIC SHARP SIGN -->
+<!ENTITY spades           "&#x02660;" ><!--BLACK SPADE SUIT -->
+<!ENTITY squ              "&#x025A1;" ><!--WHITE SQUARE -->
+<!ENTITY squf             "&#x025AA;" ><!--BLACK SMALL SQUARE -->
+<!ENTITY star             "&#x02606;" ><!--WHITE STAR -->
+<!ENTITY starf            "&#x02605;" ><!--BLACK STAR -->
+<!ENTITY target           "&#x02316;" ><!--POSITION INDICATOR -->
+<!ENTITY telrec           "&#x02315;" ><!--TELEPHONE RECORDER -->
+<!ENTITY thinsp           "&#x02009;" ><!--THIN SPACE -->
+<!ENTITY uhblk            "&#x02580;" ><!--UPPER HALF BLOCK -->
+<!ENTITY ulcrop           "&#x0230F;" ><!--TOP LEFT CROP -->
+<!ENTITY urcrop           "&#x0230E;" ><!--TOP RIGHT CROP -->
+<!ENTITY utri             "&#x025B5;" ><!--WHITE UP-POINTING SMALL TRIANGLE -->
+<!ENTITY utrif            "&#x025B4;" ><!--BLACK UP-POINTING SMALL TRIANGLE -->
+<!ENTITY vellip           "&#x022EE;" ><!--VERTICAL ELLIPSIS -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/isotech.ent b/xml/tests/testData/xml/DocBookHighlighting2/isotech.ent
new file mode 100644
index 0000000..07e8100
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/isotech.ent
@@ -0,0 +1,103 @@
+
+<!--
+     File isotech.ent produced by the XSL script entities.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to David Carlisle
+     via the public W3C list [email protected].
+
+     The numeric character values assigned to each entity
+     (should) match the Unicode assignments in Unicode 4.0.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+
+<!-- 
+     Version: $Id: isotech.ent,v 1.2 2003/12/08 15:14:43 davidc Exp $
+
+       Public identifier: ISO 8879:1986//ENTITIES General Technical//EN//XML
+       System identifier: http://www.w3.org/2003/entities/iso8879/isotech.ent
+
+     The public identifier should always be used verbatim.
+     The system identifier may be changed to suit local requirements.
+
+     Typical invocation:
+
+       <!ENTITY % isotech PUBLIC
+         "ISO 8879:1986//ENTITIES General Technical//EN//XML"
+         "http://www.w3.org/2003/entities/iso8879/isotech.ent"
+       >
+       %isotech;
+
+-->
+
+<!ENTITY aleph            "&#x02135;" ><!--ALEF SYMBOL -->
+<!ENTITY and              "&#x02227;" ><!--LOGICAL AND -->
+<!ENTITY ang90            "&#x0221F;" ><!--RIGHT ANGLE -->
+<!ENTITY angsph           "&#x02222;" ><!--SPHERICAL ANGLE -->
+<!ENTITY angst            "&#x0212B;" ><!--ANGSTROM SIGN -->
+<!ENTITY ap               "&#x02248;" ><!--ALMOST EQUAL TO -->
+<!ENTITY becaus           "&#x02235;" ><!--BECAUSE -->
+<!ENTITY bernou           "&#x0212C;" ><!--SCRIPT CAPITAL B -->
+<!ENTITY bottom           "&#x022A5;" ><!--UP TACK -->
+<!ENTITY cap              "&#x02229;" ><!--INTERSECTION -->
+<!ENTITY compfn           "&#x02218;" ><!--RING OPERATOR -->
+<!ENTITY cong             "&#x02245;" ><!--APPROXIMATELY EQUAL TO -->
+<!ENTITY conint           "&#x0222E;" ><!--CONTOUR INTEGRAL -->
+<!ENTITY cup              "&#x0222A;" ><!--UNION -->
+<!ENTITY Dot              "&#x000A8;" ><!--DIAERESIS -->
+<!ENTITY DotDot           " &#x020DC;" ><!--COMBINING FOUR DOTS ABOVE -->
+<!ENTITY equiv            "&#x02261;" ><!--IDENTICAL TO -->
+<!ENTITY exist            "&#x02203;" ><!--THERE EXISTS -->
+<!ENTITY fnof             "&#x00192;" ><!--LATIN SMALL LETTER F WITH HOOK -->
+<!ENTITY forall           "&#x02200;" ><!--FOR ALL -->
+<!ENTITY ge               "&#x02265;" ><!--GREATER-THAN OR EQUAL TO -->
+<!ENTITY hamilt           "&#x0210B;" ><!--SCRIPT CAPITAL H -->
+<!ENTITY iff              "&#x021D4;" ><!--LEFT RIGHT DOUBLE ARROW -->
+<!ENTITY infin            "&#x0221E;" ><!--INFINITY -->
+<!ENTITY int              "&#x0222B;" ><!--INTEGRAL -->
+<!ENTITY isin             "&#x02208;" ><!--ELEMENT OF -->
+<!ENTITY lagran           "&#x02112;" ><!--SCRIPT CAPITAL L -->
+<!ENTITY lang             "&#x02329;" ><!--LEFT-POINTING ANGLE BRACKET -->
+<!ENTITY lArr             "&#x021D0;" ><!--LEFTWARDS DOUBLE ARROW -->
+<!ENTITY le               "&#x02264;" ><!--LESS-THAN OR EQUAL TO -->
+<!ENTITY lowast           "&#x02217;" ><!--ASTERISK OPERATOR -->
+<!ENTITY minus            "&#x02212;" ><!--MINUS SIGN -->
+<!ENTITY mnplus           "&#x02213;" ><!--MINUS-OR-PLUS SIGN -->
+<!ENTITY nabla            "&#x02207;" ><!--NABLA -->
+<!ENTITY ne               "&#x02260;" ><!--NOT EQUAL TO -->
+<!ENTITY ni               "&#x0220B;" ><!--CONTAINS AS MEMBER -->
+<!ENTITY notin            "&#x02209;" ><!--NOT AN ELEMENT OF -->
+<!ENTITY or               "&#x02228;" ><!--LOGICAL OR -->
+<!ENTITY order            "&#x02134;" ><!--SCRIPT SMALL O -->
+<!ENTITY par              "&#x02225;" ><!--PARALLEL TO -->
+<!ENTITY part             "&#x02202;" ><!--PARTIAL DIFFERENTIAL -->
+<!ENTITY permil           "&#x02030;" ><!--PER MILLE SIGN -->
+<!ENTITY perp             "&#x022A5;" ><!--UP TACK -->
+<!ENTITY phmmat           "&#x02133;" ><!--SCRIPT CAPITAL M -->
+<!ENTITY Prime            "&#x02033;" ><!--DOUBLE PRIME -->
+<!ENTITY prime            "&#x02032;" ><!--PRIME -->
+<!ENTITY prop             "&#x0221D;" ><!--PROPORTIONAL TO -->
+<!ENTITY radic            "&#x0221A;" ><!--SQUARE ROOT -->
+<!ENTITY rang             "&#x0232A;" ><!--RIGHT-POINTING ANGLE BRACKET -->
+<!ENTITY rArr             "&#x021D2;" ><!--RIGHTWARDS DOUBLE ARROW -->
+<!ENTITY sim              "&#x0223C;" ><!--TILDE OPERATOR -->
+<!ENTITY sime             "&#x02243;" ><!--ASYMPTOTICALLY EQUAL TO -->
+<!ENTITY square           "&#x025A1;" ><!--WHITE SQUARE -->
+<!ENTITY sub              "&#x02282;" ><!--SUBSET OF -->
+<!ENTITY sube             "&#x02286;" ><!--SUBSET OF OR EQUAL TO -->
+<!ENTITY sup              "&#x02283;" ><!--SUPERSET OF -->
+<!ENTITY supe             "&#x02287;" ><!--SUPERSET OF OR EQUAL TO -->
+<!ENTITY tdot             " &#x020DB;" ><!--COMBINING THREE DOTS ABOVE -->
+<!ENTITY there4           "&#x02234;" ><!--THEREFORE -->
+<!ENTITY tprime           "&#x02034;" ><!--TRIPLE PRIME -->
+<!ENTITY Verbar           "&#x02016;" ><!--DOUBLE VERTICAL LINE -->
+<!ENTITY wedgeq           "&#x02259;" ><!--ESTIMATES -->
diff --git a/xml/tests/testData/xml/DocBookHighlighting2/soextblx.dtd b/xml/tests/testData/xml/DocBookHighlighting2/soextblx.dtd
new file mode 100644
index 0000000..4a92e11
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookHighlighting2/soextblx.dtd
@@ -0,0 +1,321 @@
+<!-- XML EXCHANGE TABLE MODEL DECLARATION MODULE -->
+
+<!-- This set of declarations defines the XML version of the Exchange
+     Table Model as of the date shown in the Formal Public Identifier
+     (FPI) for this entity.
+
+     This set of declarations may be referred to using a public external
+     entity declaration and reference as shown in the following three
+     lines:
+
+     <!ENTITY % calstblx
+       PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN">
+       %calstblx;
+
+     If various parameter entities used within this set of declarations
+     are to be given non-default values, the appropriate declarations
+     should be given before calling in this package (i.e., before the
+     "%calstblx;" reference).
+-->
+
+<!-- The motivation for this XML version of the Exchange Table Model
+     is simply to create an XML version of the SGML Exchange Table
+     Model. By design, no effort has been made to "improve" the model.
+
+     This XML version incorporates the logical bare minimum changes
+     necessary to make the Exchange Table Model a valid XML DTD.
+
+     It has been modified slightly for use in the combined HTML/CALS models
+     supported by DocBook V4.3 and later.
+-->
+
+<!-- The XML version of the Exchange Table Model differs from
+     the SGML version in the following ways:
+
+     The following parameter entities have been removed:
+
+       - tbl.table.excep, tbl.hdft.excep, tbl.row.excep, tbl.entry.excep
+         There are no exceptions in XML. The following normative statement
+         is made in lieu of exceptions: the exchange table model explicitly
+         forbids a table from occurring within another table. If the
+         content model of an entry includes a table element, then this
+         cannot be enforced by the DTD, but it is a deviation from the
+         exchange table model to include a table within a table.
+
+       - tbl.hdft.name, tbl.hdft.mdl, tbl.hdft.excep, tbl.hdft.att
+         The motivation for these elements was to change the table
+         header/footer elements. Since XML does not allow element declarations
+         to contain name groups, and the exchange table model does not
+         allow a table to contain footers, the continued presence of these
+         attributes seems unnecessary.
+
+     The following parameter entity has been added:
+
+       - tbl.thead.att
+         This entity parameterizes the attributes on thead. It replaces
+         the tbl.hdft.att parameter entity.
+
+     Other miscellaneous changes:
+
+       - Tag ommission indicators have been removed
+       - Comments have been removed from declarations
+       - NUMBER attributes have been changed to NMTOKEN
+       - NUTOKEN attributes have been to changed to NMTOKEN
+       - Removed the grouping characters around the content model
+         parameter entry for the 'entry' element. This is necessary
+         so that an entry can contain #PCDATA and be defined as an
+         optional, repeatable OR group beginning with #PCDATA.
+-->
+
+<!-- This entity includes a set of element and attribute declarations
+     that partially defines the Exchange table model.  However, the model
+     is not well-defined without the accompanying natural language
+     description of the semantics (meanings) of these various elements,
+     attributes, and attribute values.  The semantic writeup, also available
+     from SGML Open, should be used in conjunction with this entity.
+-->
+
+<!-- In order to use the Exchange table model, various parameter entity
+     declarations are required.  A brief description is as follows:
+
+     ENTITY NAME      WHERE USED              WHAT IT IS
+
+     %yesorno         In ATTLIST of:          An attribute declared value
+                      almost all elements     for a "boolean" attribute
+
+     %paracon         In content model of:    The "text" (logical content)
+                      <entry>                 of the model group for <entry>
+
+     %titles          In content model of:    The "title" part of the model
+                      table element           group for the table element
+
+     %tbl.table.name  In declaration of:      The name of the "table"
+                      table element           element
+
+     %tbl.table-titles.mdl In content model of: The model group for the title
+                      table elements          part of the content model for
+                                              table element
+
+     %tbl.table.mdl   In content model of:    The model group for the content
+                      table elements          model for table element,
+                                              often (and by default) defined
+                                              in terms of %tbl.table-titles.mdl
+                                              and tgroup
+
+     %tbl.table.att   In ATTLIST of:          Additional attributes on the
+                      table element           table element
+
+     %bodyatt         In ATTLIST of:          Additional attributes on the
+                      table element           table element (for backward
+                                              compatibility with the SGML
+                                              model)
+
+     %tbl.tgroup.mdl  In content model of:    The model group for the content
+                      <tgroup>                model for <tgroup>
+
+     %tbl.tgroup.att  In ATTLIST of:          Additional attributes on the
+                      <tgroup>                <tgroup> element
+
+     %tbl.thead.att   In ATTLIST of:          Additional attributes on the
+                      <thead>                 <thead> element
+
+     %tbl.tbody.att   In ATTLIST of:          Additional attributes on the
+                      <tbody>                 <tbody> element
+
+     %tbl.colspec.att In ATTLIST of:          Additional attributes on the
+                      <colspec>               <colspec> element
+
+     %tbl.row.mdl     In content model of:    The model group for the content
+                      <row>                   model for <row>
+
+     %tbl.row.att     In ATTLIST of:          Additional attributes on the
+                      <row>                   <row> element
+
+     %tbl.entry.mdl   In content model of:    The model group for the content
+                      <entry>                 model for <entry>
+
+     %tbl.entry.att   In ATTLIST of:          Additional attributes on the
+                      <entry>                 <entry> element
+
+     This set of declarations will use the default definitions shown below
+     for any of these parameter entities that are not declared before this
+     set of declarations is referenced.
+-->
+
+<!-- These definitions are not directly related to the table model, but are
+     used in the default CALS table model and may be defined elsewhere (and
+     prior to the inclusion of this table module) in the referencing DTD. -->
+
+<!ENTITY % yesorno 'NMTOKEN'> <!-- no if zero(s), yes if any other value -->
+<!ENTITY % titles  'title?'>
+<!ENTITY % pcd "#PCDATA">
+<!ENTITY % paracon '%pcd;'> <!-- default for use in entry content -->
+
+<!--
+The parameter entities as defined below change and simplify the CALS table
+model as published (as part of the Example DTD) in MIL-HDBK-28001.  The
+resulting simplified DTD has support from the SGML Open vendors and is
+therefore more interoperable among different systems.
+
+These following declarations provide the Exchange default definitions
+for these entities.  However, these entities can be redefined (by giving
+the appropriate parameter entity declaration(s) prior to the reference
+to this Table Model declaration set entity) to fit the needs of the
+current application.
+
+Note, however, that changes may have significant effect on the ability to
+interchange table information.  These changes may manifest themselves
+in useability, presentation, and possible structure information degradation.
+-->
+
+<!ENTITY % tbl.table.name       "table">
+<!ENTITY % tbl.table-titles.mdl "%titles;,">
+<!ENTITY % tbl.table-main.mdl   "tgroup+">
+<!ENTITY % tbl.table.mdl        "%tbl.table-titles.mdl; %tbl.table-main.mdl;">
+<!ENTITY % tbl.table.att        "
+    pgwide      %yesorno;       #IMPLIED ">
+<!ENTITY % bodyatt              "">
+<!ENTITY % tbl.tgroup.mdl       "colspec*,thead?,tbody">
+<!ENTITY % tbl.tgroup.att       "">
+<!ENTITY % tbl.thead.att        "">
+<!ENTITY % tbl.tbody.att        "">
+<!ENTITY % tbl.colspec.att      "">
+<!ENTITY % tbl.row.mdl          "entry+">
+<!ENTITY % tbl.row.att          "">
+<!ENTITY % tbl.entry.mdl        "(%paracon;)*">
+<!ENTITY % tbl.entry.att        "">
+
+<!ENTITY % tbl.frame.attval     "top|bottom|topbot|all|sides|none">
+<!ENTITY % tbl.tbody.mdl        "row+">
+
+<!-- =====  Element and attribute declarations follow. =====  -->
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.table.name       "table"
+     ENTITY % tbl.table-titles.mdl "%titles;,"
+     ENTITY % tbl.table.mdl        "%tbl.table-titles; tgroup+"
+     ENTITY % tbl.table.att        "
+                        pgwide          %yesorno;       #IMPLIED "
+-->
+
+<!--doc:???-->
+<!ELEMENT %tbl.table.name; (%tbl.table.mdl;)>
+
+<!ATTLIST %tbl.table.name;
+        frame           (%tbl.frame.attval;)                    #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        %tbl.table.att;
+        %bodyatt;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.tgroup.mdl    "colspec*,thead?,tbody"
+     ENTITY % tbl.tgroup.att    ""
+-->
+
+<!--doc:A wrapper for the main content of a table, or part of a table.-->
+<!ELEMENT tgroup (%tbl.tgroup.mdl;) >
+
+<!ATTLIST tgroup
+        cols            NMTOKEN                                 #REQUIRED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        %tbl.tgroup.att;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.colspec.att   ""
+-->
+
+<!--doc:Specifications for a column in a table.-->
+<!ELEMENT colspec EMPTY >
+
+<!ATTLIST colspec
+        colnum          NMTOKEN                                 #IMPLIED
+        colname         NMTOKEN                                 #IMPLIED
+        colwidth        CDATA                                   #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         NMTOKEN                                 #IMPLIED
+        %tbl.colspec.att;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.thead.att      ""
+-->
+
+<!--doc:A table header consisting of one or more rows.-->
+<!ELEMENT thead (row+)>
+
+<!ATTLIST thead
+        valign          (top|middle|bottom)                     #IMPLIED
+        %tbl.thead.att;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.tbody.att     ""
+-->
+
+<!--doc:A wrapper for the rows of a table or informal table.-->
+<!ELEMENT tbody (%tbl.tbody.mdl;)>
+
+<!ATTLIST tbody
+        valign          (top|middle|bottom)                     #IMPLIED
+        %tbl.tbody.att;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.row.mdl       "entry+"
+     ENTITY % tbl.row.att       ""
+-->
+
+<!--doc:A row in a table.-->
+<!ELEMENT row (%tbl.row.mdl;)>
+
+<!ATTLIST row
+        rowsep          %yesorno;                               #IMPLIED
+        valign          (top|middle|bottom)                     #IMPLIED
+        %tbl.row.att;
+>
+
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % paracon           "#PCDATA"
+     ENTITY % tbl.entry.mdl     "(%paracon;)*"
+     ENTITY % tbl.entry.att     ""
+-->
+
+<!--doc:A cell in a table.-->
+<!ELEMENT entry (%tbl.entry.mdl;)*>
+
+<!ATTLIST entry
+        colname         NMTOKEN                                 #IMPLIED
+        namest          NMTOKEN                                 #IMPLIED
+        nameend         NMTOKEN                                 #IMPLIED
+        morerows        NMTOKEN                                 #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         NMTOKEN                                 #IMPLIED
+        valign          (top|middle|bottom)                     #IMPLIED
+        %tbl.entry.att;
+>
diff --git a/xml/tests/testData/xml/DocBookV5.xml b/xml/tests/testData/xml/DocBookV5.xml
new file mode 100644
index 0000000..1153e4e
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookV5.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="<error descr="Unknown encoding: 'Foo'">Foo</error>"?>
+ <x/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/DocBookV5.xsd b/xml/tests/testData/xml/DocBookV5.xsd
new file mode 100644
index 0000000..659bfbb
--- /dev/null
+++ b/xml/tests/testData/xml/DocBookV5.xsd
@@ -0,0 +1,17430 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+           xmlns:docbook="http://docbook.org/ns/docbook">
+
+  <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/>
+  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
+  <xs:attributeGroup name="db.common.attributes">
+    <xs:attribute ref="xml:id"/>
+    <xs:attribute name="version"/>
+    <xs:attribute ref="xml:lang"/>
+    <xs:attribute ref="xml:base"/>
+    <xs:attribute name="remap"/>
+    <xs:attribute name="xreflabel"/>
+    <xs:attribute name="revisionflag">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="changed"/>
+          <xs:enumeration value="added"/>
+          <xs:enumeration value="deleted"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="dir">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="ltr"/>
+          <xs:enumeration value="rtl"/>
+          <xs:enumeration value="lro"/>
+          <xs:enumeration value="rlo"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="arch"/>
+    <xs:attribute name="audience"/>
+    <xs:attribute name="condition"/>
+    <xs:attribute name="conformance"/>
+    <xs:attribute name="os"/>
+    <xs:attribute name="revision"/>
+    <xs:attribute name="security"/>
+    <xs:attribute name="userlevel"/>
+    <xs:attribute name="vendor"/>
+    <xs:attribute name="wordsize"/>
+    <xs:attribute name="annotations"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="db.common.linking.attributes">
+    <xs:attribute name="linkend" type="xs:IDREF"/>
+    <xs:attribute ref="xlink:href"/>
+    <xs:attribute ref="xlink:type"/>
+    <xs:attribute ref="xlink:role"/>
+    <xs:attribute ref="xlink:arcrole"/>
+    <xs:attribute ref="xlink:title"/>
+    <xs:attribute ref="xlink:show"/>
+    <xs:attribute ref="xlink:actuate"/>
+  </xs:attributeGroup>
+  <xs:element name="title">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="titleabbrev">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="subtitle">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="info">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:title"/>
+          <xs:element ref="docbook:titleabbrev"/>
+          <xs:element ref="docbook:subtitle"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:abstract"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:artpagenums"/>
+          <xs:element ref="docbook:author"/>
+          <xs:element ref="docbook:authorgroup"/>
+          <xs:element ref="docbook:authorinitials"/>
+          <xs:element ref="docbook:bibliocoverage"/>
+          <xs:element ref="docbook:biblioid"/>
+          <xs:element ref="docbook:bibliosource"/>
+          <xs:element ref="docbook:collab"/>
+          <xs:element ref="docbook:confgroup"/>
+          <xs:element ref="docbook:contractsponsor"/>
+          <xs:element ref="docbook:contractnum"/>
+          <xs:element ref="docbook:copyright"/>
+          <xs:element ref="docbook:cover"/>
+          <xs:element ref="docbook:date"/>
+          <xs:element ref="docbook:edition"/>
+          <xs:element ref="docbook:editor"/>
+          <xs:element ref="docbook:issuenum"/>
+          <xs:element ref="docbook:keywordset"/>
+          <xs:element ref="docbook:legalnotice"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:org"/>
+          <xs:element ref="docbook:orgname"/>
+          <xs:element ref="docbook:othercredit"/>
+          <xs:element ref="docbook:pagenums"/>
+          <xs:element ref="docbook:printhistory"/>
+          <xs:element ref="docbook:productname"/>
+          <xs:element ref="docbook:productnumber"/>
+          <xs:element ref="docbook:pubdate"/>
+          <xs:element ref="docbook:publisher"/>
+          <xs:element ref="docbook:publishername"/>
+          <xs:element ref="docbook:releaseinfo"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:seriesvolnums"/>
+          <xs:element ref="docbook:subjectset"/>
+          <xs:element ref="docbook:volumenum"/>
+          <xs:element ref="docbook:annotation"/>
+          <xs:element ref="docbook:extendedlink"/>
+          <xs:element ref="docbook:bibliomisc"/>
+          <xs:element ref="docbook:bibliomset"/>
+          <xs:element ref="docbook:bibliorelation"/>
+          <xs:element ref="docbook:biblioset"/>
+          <xs:element ref="docbook:itermset"/>
+        </xs:choice>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="subjectset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:subject"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="scheme" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="subject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:subjectterm"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="weight"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="subjectterm">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="keywordset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:keyword"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="keyword">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="procedure">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:step"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="step">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:sequence minOccurs="0">
+              <xs:choice>
+                <xs:element ref="docbook:substeps"/>
+                <xs:element ref="docbook:stepalternatives"/>
+              </xs:choice>
+              <xs:choice minOccurs="0" maxOccurs="unbounded">
+                <xs:element ref="docbook:itemizedlist"/>
+                <xs:element ref="docbook:orderedlist"/>
+                <xs:element ref="docbook:procedure"/>
+                <xs:element ref="docbook:simplelist"/>
+                <xs:element ref="docbook:variablelist"/>
+                <xs:element ref="docbook:segmentedlist"/>
+                <xs:element ref="docbook:glosslist"/>
+                <xs:element ref="docbook:bibliolist"/>
+                <xs:element ref="docbook:calloutlist"/>
+                <xs:element ref="docbook:qandaset"/>
+                <xs:element ref="docbook:caution"/>
+                <xs:element ref="docbook:important"/>
+                <xs:element ref="docbook:note"/>
+                <xs:element ref="docbook:tip"/>
+                <xs:element ref="docbook:warning"/>
+                <xs:element ref="docbook:example"/>
+                <xs:element ref="docbook:figure"/>
+                <xs:element ref="docbook:table"/>
+                <xs:element ref="docbook:informalexample"/>
+                <xs:element ref="docbook:informalfigure"/>
+                <xs:element ref="docbook:informaltable"/>
+                <xs:element ref="docbook:sidebar"/>
+                <xs:element ref="docbook:blockquote"/>
+                <xs:element ref="docbook:address"/>
+                <xs:element ref="docbook:epigraph"/>
+                <xs:element ref="docbook:mediaobject"/>
+                <xs:element ref="docbook:screenshot"/>
+                <xs:element ref="docbook:task"/>
+                <xs:element ref="docbook:productionset"/>
+                <xs:element ref="docbook:constraintdef"/>
+                <xs:element ref="docbook:msgset"/>
+                <xs:element ref="docbook:programlisting"/>
+                <xs:element ref="docbook:screen"/>
+                <xs:element ref="docbook:literallayout"/>
+                <xs:element ref="docbook:synopsis"/>
+                <xs:element ref="docbook:programlistingco"/>
+                <xs:element ref="docbook:screenco"/>
+                <xs:element ref="docbook:cmdsynopsis"/>
+                <xs:element ref="docbook:funcsynopsis"/>
+                <xs:element ref="docbook:classsynopsis"/>
+                <xs:element ref="docbook:methodsynopsis"/>
+                <xs:element ref="docbook:constructorsynopsis"/>
+                <xs:element ref="docbook:destructorsynopsis"/>
+                <xs:element ref="docbook:fieldsynopsis"/>
+                <xs:element ref="docbook:bridgehead"/>
+                <xs:element ref="docbook:remark"/>
+                <xs:element ref="docbook:revhistory"/>
+                <xs:element ref="docbook:indexterm"/>
+                <xs:element ref="docbook:equation"/>
+                <xs:element ref="docbook:informalequation"/>
+                <xs:element ref="docbook:anchor"/>
+                <xs:element ref="docbook:para"/>
+                <xs:element ref="docbook:formalpara"/>
+                <xs:element ref="docbook:simpara"/>
+                <xs:element ref="docbook:annotation"/>
+              </xs:choice>
+            </xs:sequence>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:choice>
+              <xs:element ref="docbook:substeps"/>
+              <xs:element ref="docbook:stepalternatives"/>
+            </xs:choice>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+          </xs:sequence>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="performance">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="optional"/>
+            <xs:enumeration value="required"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="stepalternatives">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:step"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="performance">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="optional"/>
+            <xs:enumeration value="required"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="substeps">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:step"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="performance">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="optional"/>
+            <xs:enumeration value="required"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sidebar">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="abstract">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="personblurb">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="blockquote">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:attribution"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="attribution">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bridgehead">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="renderas">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="sect1"/>
+            <xs:enumeration value="sect2"/>
+            <xs:enumeration value="sect3"/>
+            <xs:enumeration value="sect4"/>
+            <xs:enumeration value="sect5"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherrenderas" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="remark">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="epigraph">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element minOccurs="0" ref="docbook:attribution"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:literallayout"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="footnote">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:annotation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="formalpara">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexterm"/>
+        <xs:element ref="docbook:para"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="para">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="simpara">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="caution">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="important">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="note">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tip">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="warning">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="itemizedlist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:listitem"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="spacing">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+            <xs:enumeration value="normal"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="mark" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="orderedlist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:listitem"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="spacing">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+            <xs:enumeration value="normal"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startingnumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="inheritnum">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="ignore"/>
+            <xs:enumeration value="inherit"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="numeration">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="arabic"/>
+            <xs:enumeration value="upperalpha"/>
+            <xs:enumeration value="loweralpha"/>
+            <xs:enumeration value="upperroman"/>
+            <xs:enumeration value="lowerroman"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="listitem">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:annotation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="override" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="segmentedlist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:segtitle"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:seglistitem"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="segtitle">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="seglistitem">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:seg"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="seg">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="simplelist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:member"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="type" default="vert">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="horiz"/>
+            <xs:enumeration value="vert"/>
+            <xs:enumeration value="inline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="columns" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="member">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="variablelist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:varlistentry"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="spacing">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+            <xs:enumeration value="normal"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="termlength"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="varlistentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:term"/>
+        <xs:element ref="docbook:listitem"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="term">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="example">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="floatstyle"/>
+      <xs:attribute name="width" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="informalexample">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="floatstyle"/>
+      <xs:attribute name="width" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="programlisting">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:textobject"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+      <xs:attribute name="width" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="literallayout">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:textobject"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="monospaced"/>
+            <xs:enumeration value="normal"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="screen">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:textobject"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+      <xs:attribute name="width" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="screenshot">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element ref="docbook:mediaobject"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="figure">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="pgwide">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="floatstyle"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="informalfigure">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="pgwide">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="floatstyle"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="mediaobject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element minOccurs="0" ref="docbook:alt"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:videoobject"/>
+          <xs:element ref="docbook:audioobject"/>
+          <xs:element ref="docbook:imageobject"/>
+          <xs:element ref="docbook:textobject"/>
+          <xs:element ref="docbook:imageobjectco"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="inlinemediaobject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element minOccurs="0" ref="docbook:alt"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:videoobject"/>
+          <xs:element ref="docbook:audioobject"/>
+          <xs:element ref="docbook:imageobject"/>
+          <xs:element ref="docbook:textobject"/>
+          <xs:element ref="docbook:imageobjectco"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="videoobject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element ref="docbook:videodata"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="audioobject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element ref="docbook:audiodata"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="imageobject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element ref="docbook:imagedata"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="textobject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:choice>
+          <xs:element ref="docbook:phrase"/>
+          <xs:element ref="docbook:textdata"/>
+          <xs:choice maxOccurs="unbounded">
+            <xs:element ref="docbook:itemizedlist"/>
+            <xs:element ref="docbook:orderedlist"/>
+            <xs:element ref="docbook:procedure"/>
+            <xs:element ref="docbook:simplelist"/>
+            <xs:element ref="docbook:variablelist"/>
+            <xs:element ref="docbook:segmentedlist"/>
+            <xs:element ref="docbook:glosslist"/>
+            <xs:element ref="docbook:bibliolist"/>
+            <xs:element ref="docbook:calloutlist"/>
+            <xs:element ref="docbook:qandaset"/>
+            <xs:element ref="docbook:caution"/>
+            <xs:element ref="docbook:important"/>
+            <xs:element ref="docbook:note"/>
+            <xs:element ref="docbook:tip"/>
+            <xs:element ref="docbook:warning"/>
+            <xs:element ref="docbook:example"/>
+            <xs:element ref="docbook:figure"/>
+            <xs:element ref="docbook:table"/>
+            <xs:element ref="docbook:informalexample"/>
+            <xs:element ref="docbook:informalfigure"/>
+            <xs:element ref="docbook:informaltable"/>
+            <xs:element ref="docbook:sidebar"/>
+            <xs:element ref="docbook:blockquote"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:epigraph"/>
+            <xs:element ref="docbook:mediaobject"/>
+            <xs:element ref="docbook:screenshot"/>
+            <xs:element ref="docbook:task"/>
+            <xs:element ref="docbook:productionset"/>
+            <xs:element ref="docbook:constraintdef"/>
+            <xs:element ref="docbook:msgset"/>
+            <xs:element ref="docbook:programlisting"/>
+            <xs:element ref="docbook:screen"/>
+            <xs:element ref="docbook:literallayout"/>
+            <xs:element ref="docbook:synopsis"/>
+            <xs:element ref="docbook:programlistingco"/>
+            <xs:element ref="docbook:screenco"/>
+            <xs:element ref="docbook:cmdsynopsis"/>
+            <xs:element ref="docbook:funcsynopsis"/>
+            <xs:element ref="docbook:classsynopsis"/>
+            <xs:element ref="docbook:methodsynopsis"/>
+            <xs:element ref="docbook:constructorsynopsis"/>
+            <xs:element ref="docbook:destructorsynopsis"/>
+            <xs:element ref="docbook:fieldsynopsis"/>
+            <xs:element ref="docbook:bridgehead"/>
+            <xs:element ref="docbook:remark"/>
+            <xs:element ref="docbook:revhistory"/>
+            <xs:element ref="docbook:indexterm"/>
+            <xs:element ref="docbook:equation"/>
+            <xs:element ref="docbook:informalequation"/>
+            <xs:element ref="docbook:anchor"/>
+            <xs:element ref="docbook:para"/>
+            <xs:element ref="docbook:formalpara"/>
+            <xs:element ref="docbook:simpara"/>
+            <xs:element ref="docbook:annotation"/>
+          </xs:choice>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="videodata">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="format"/>
+      <xs:attribute name="fileref"/>
+      <xs:attribute name="entityref" type="xs:ENTITY"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="width"/>
+      <xs:attribute name="contentwidth"/>
+      <xs:attribute name="scalefit">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="scale" type="xs:NMTOKEN"/>
+      <xs:attribute name="depth"/>
+      <xs:attribute name="contentdepth"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="audiodata">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="format"/>
+      <xs:attribute name="fileref"/>
+      <xs:attribute name="entityref" type="xs:ENTITY"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="imagedata">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="format"/>
+      <xs:attribute name="fileref"/>
+      <xs:attribute name="entityref" type="xs:ENTITY"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="width"/>
+      <xs:attribute name="contentwidth"/>
+      <xs:attribute name="scalefit">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="scale" type="xs:NMTOKEN"/>
+      <xs:attribute name="depth"/>
+      <xs:attribute name="contentdepth"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="textdata">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="format"/>
+      <xs:attribute name="fileref"/>
+      <xs:attribute name="entityref" type="xs:ENTITY"/>
+      <xs:attribute name="encoding"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="caption">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:annotation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="synopsis">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:textobject"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="cmdsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:command"/>
+          <xs:element ref="docbook:arg"/>
+          <xs:element ref="docbook:group"/>
+          <xs:element ref="docbook:sbr"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:synopfragment"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="sepchar"/>
+      <xs:attribute name="cmdlength"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="arg">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:arg"/>
+        <xs:element ref="docbook:group"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:synopfragmentref"/>
+        <xs:element ref="docbook:sbr"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="rep" default="norepeat">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="norepeat"/>
+            <xs:enumeration value="repeat"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="choice" default="opt">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="opt"/>
+            <xs:enumeration value="plain"/>
+            <xs:enumeration value="req"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="group">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:arg"/>
+        <xs:element ref="docbook:group"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:synopfragmentref"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:sbr"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="rep" default="norepeat">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="norepeat"/>
+            <xs:enumeration value="repeat"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="choice" default="opt">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="opt"/>
+            <xs:enumeration value="plain"/>
+            <xs:enumeration value="req"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sbr">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="synopfragment">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:arg"/>
+        <xs:element ref="docbook:group"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="synopfragmentref">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="funcsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:funcsynopsisinfo"/>
+          <xs:element ref="docbook:funcprototype"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="funcsynopsisinfo">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:textobject"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="funcprototype">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+        <xs:element ref="docbook:funcdef"/>
+        <xs:choice>
+          <xs:element ref="docbook:void"/>
+          <xs:element ref="docbook:varargs"/>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:paramdef"/>
+            <xs:element minOccurs="0" ref="docbook:varargs"/>
+          </xs:sequence>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="funcdef">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:function"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="void">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="varargs">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="paramdef">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:funcparams"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="choice" default="opt">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="opt"/>
+            <xs:enumeration value="req"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="funcparams">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="classsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:ooclass"/>
+          <xs:element ref="docbook:ooexception"/>
+          <xs:element ref="docbook:oointerface"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:classsynopsisinfo"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="class"/>
+            <xs:enumeration value="interface"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="classsynopsisinfo">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:textobject"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="ooclass">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:package"/>
+          <xs:element ref="docbook:modifier"/>
+        </xs:choice>
+        <xs:element ref="docbook:classname"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="oointerface">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:package"/>
+          <xs:element ref="docbook:modifier"/>
+        </xs:choice>
+        <xs:element ref="docbook:interfacename"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="ooexception">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:package"/>
+          <xs:element ref="docbook:modifier"/>
+        </xs:choice>
+        <xs:element ref="docbook:exceptionname"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="modifier">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute ref="xml:space"/>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="interfacename">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="exceptionname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="fieldsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+        <xs:element minOccurs="0" ref="docbook:type"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element minOccurs="0" ref="docbook:initializer"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="initializer">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="constructorsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+        <xs:element minOccurs="0" ref="docbook:methodname"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:methodparam"/>
+          <xs:element minOccurs="0" ref="docbook:void"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:exceptionname"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="destructorsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+        <xs:element minOccurs="0" ref="docbook:methodname"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:methodparam"/>
+          <xs:element minOccurs="0" ref="docbook:void"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:exceptionname"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="methodsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+        <xs:choice minOccurs="0">
+          <xs:element ref="docbook:type"/>
+          <xs:element ref="docbook:void"/>
+        </xs:choice>
+        <xs:element ref="docbook:methodname"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:methodparam"/>
+          <xs:element ref="docbook:void"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:exceptionname"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="methodname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="methodparam">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:modifier"/>
+          <xs:element ref="docbook:type"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:sequence>
+            <xs:element ref="docbook:parameter"/>
+            <xs:element minOccurs="0" ref="docbook:initializer"/>
+          </xs:sequence>
+          <xs:element ref="docbook:funcparams"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="rep" default="norepeat">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="norepeat"/>
+            <xs:enumeration value="repeat"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="choice" default="req">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="opt"/>
+            <xs:enumeration value="plain"/>
+            <xs:enumeration value="req"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="address">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:pob"/>
+        <xs:element ref="docbook:street"/>
+        <xs:element ref="docbook:city"/>
+        <xs:element ref="docbook:state"/>
+        <xs:element ref="docbook:postcode"/>
+        <xs:element ref="docbook:country"/>
+        <xs:element ref="docbook:phone"/>
+        <xs:element ref="docbook:fax"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:otheraddr"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="street">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="pob">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="postcode">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="city">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="state">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="country">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="phone">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="fax">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="otheraddr">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="affiliation">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:shortaffil"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:jobtitle"/>
+        <xs:choice>
+          <xs:element minOccurs="0" ref="docbook:org"/>
+          <xs:sequence>
+            <xs:element minOccurs="0" ref="docbook:orgname"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:orgdiv"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:address"/>
+          </xs:sequence>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="shortaffil">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="jobtitle">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="orgname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="consortium"/>
+            <xs:enumeration value="corporation"/>
+            <xs:enumeration value="informal"/>
+            <xs:enumeration value="nonprofit"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="orgdiv">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="artpagenums">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="personname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:honorific"/>
+        <xs:element ref="docbook:firstname"/>
+        <xs:element ref="docbook:surname"/>
+        <xs:element ref="docbook:lineage"/>
+        <xs:element ref="docbook:othername"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="author">
+    <xs:complexType>
+      <xs:choice>
+        <xs:sequence>
+          <xs:element ref="docbook:personname"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:personblurb"/>
+            <xs:element ref="docbook:affiliation"/>
+            <xs:element ref="docbook:email"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:contrib"/>
+          </xs:choice>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:element ref="docbook:orgname"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:orgdiv"/>
+            <xs:element ref="docbook:affiliation"/>
+            <xs:element ref="docbook:email"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:contrib"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="authorgroup">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:othercredit"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="collab">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:person"/>
+          <xs:element ref="docbook:personname"/>
+          <xs:element ref="docbook:org"/>
+          <xs:element ref="docbook:orgname"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:affiliation"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="authorinitials">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="person">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:personname"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:affiliation"/>
+          <xs:element ref="docbook:email"/>
+          <xs:element ref="docbook:personblurb"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="org">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:orgname"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:affiliation"/>
+          <xs:element ref="docbook:email"/>
+          <xs:element ref="docbook:orgdiv"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="confgroup">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:confdates"/>
+        <xs:element ref="docbook:conftitle"/>
+        <xs:element ref="docbook:confnum"/>
+        <xs:element ref="docbook:confsponsor"/>
+        <xs:element ref="docbook:address"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="confdates">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="conftitle">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="confnum">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="confsponsor">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="contractnum">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="contractsponsor">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="copyright">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:year"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:holder"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="year">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="holder">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="cover">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="date">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="edition">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="editor">
+    <xs:complexType>
+      <xs:choice>
+        <xs:sequence>
+          <xs:element ref="docbook:personname"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:personblurb"/>
+            <xs:element ref="docbook:affiliation"/>
+            <xs:element ref="docbook:email"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:contrib"/>
+          </xs:choice>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:element ref="docbook:orgname"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:orgdiv"/>
+            <xs:element ref="docbook:affiliation"/>
+            <xs:element ref="docbook:email"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:contrib"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="biblioid">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="doi"/>
+            <xs:enumeration value="isbn"/>
+            <xs:enumeration value="isrn"/>
+            <xs:enumeration value="issn"/>
+            <xs:enumeration value="libraryofcongress"/>
+            <xs:enumeration value="pubsnumber"/>
+            <xs:enumeration value="uri"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="citebiblioid">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="doi"/>
+            <xs:enumeration value="isbn"/>
+            <xs:enumeration value="isrn"/>
+            <xs:enumeration value="issn"/>
+            <xs:enumeration value="libraryofcongress"/>
+            <xs:enumeration value="pubsnumber"/>
+            <xs:enumeration value="uri"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliosource">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="doi"/>
+            <xs:enumeration value="isbn"/>
+            <xs:enumeration value="isrn"/>
+            <xs:enumeration value="issn"/>
+            <xs:enumeration value="libraryofcongress"/>
+            <xs:enumeration value="pubsnumber"/>
+            <xs:enumeration value="uri"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliorelation">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="doi"/>
+            <xs:enumeration value="isbn"/>
+            <xs:enumeration value="isrn"/>
+            <xs:enumeration value="issn"/>
+            <xs:enumeration value="libraryofcongress"/>
+            <xs:enumeration value="pubsnumber"/>
+            <xs:enumeration value="uri"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass" type="xs:NMTOKEN"/>
+      <xs:attribute name="type">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="hasformat"/>
+            <xs:enumeration value="haspart"/>
+            <xs:enumeration value="hasversion"/>
+            <xs:enumeration value="isformatof"/>
+            <xs:enumeration value="ispartof"/>
+            <xs:enumeration value="isreferencedby"/>
+            <xs:enumeration value="isreplacedby"/>
+            <xs:enumeration value="isrequiredby"/>
+            <xs:enumeration value="isversionof"/>
+            <xs:enumeration value="references"/>
+            <xs:enumeration value="replaces"/>
+            <xs:enumeration value="requires"/>
+            <xs:enumeration value="othertype"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="othertype" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliocoverage">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="spatial">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="dcmipoint"/>
+            <xs:enumeration value="iso3166"/>
+            <xs:enumeration value="dcmibox"/>
+            <xs:enumeration value="tgn"/>
+            <xs:enumeration value="otherspatial"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherspatial" type="xs:NMTOKEN"/>
+      <xs:attribute name="temporal">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="dcmiperiod"/>
+            <xs:enumeration value="w3c-dtf"/>
+            <xs:enumeration value="othertemporal"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="othertemporal" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="legalnotice">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="othercredit">
+    <xs:complexType>
+      <xs:choice>
+        <xs:sequence>
+          <xs:element ref="docbook:personname"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:personblurb"/>
+            <xs:element ref="docbook:affiliation"/>
+            <xs:element ref="docbook:email"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:contrib"/>
+          </xs:choice>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:element ref="docbook:orgname"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:orgdiv"/>
+            <xs:element ref="docbook:affiliation"/>
+            <xs:element ref="docbook:email"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:contrib"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="copyeditor"/>
+            <xs:enumeration value="graphicdesigner"/>
+            <xs:enumeration value="other"/>
+            <xs:enumeration value="productioneditor"/>
+            <xs:enumeration value="technicaleditor"/>
+            <xs:enumeration value="translator"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="pagenums">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="contrib">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="honorific">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="firstname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="surname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="lineage">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="othername">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="printhistory">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="productname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="copyright"/>
+            <xs:enumeration value="registered"/>
+            <xs:enumeration value="service"/>
+            <xs:enumeration value="trade"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="productnumber">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="pubdate">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="publisher">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:publishername"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:address"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="publishername">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="releaseinfo">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="revhistory">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:revision"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="revision">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:revnumber"/>
+        <xs:element ref="docbook:date"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:authorinitials"/>
+          <xs:element ref="docbook:author"/>
+        </xs:choice>
+        <xs:choice minOccurs="0">
+          <xs:element ref="docbook:revremark"/>
+          <xs:element ref="docbook:revdescription"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="revnumber">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="revremark">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="revdescription">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:annotation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="seriesvolnums">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="volumenum">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="issuenum">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="accel">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="application">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="hardware"/>
+            <xs:enumeration value="software"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="package">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="classname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="command">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="computeroutput">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="database">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="altkey"/>
+            <xs:enumeration value="constraint"/>
+            <xs:enumeration value="datatype"/>
+            <xs:enumeration value="field"/>
+            <xs:enumeration value="foreignkey"/>
+            <xs:enumeration value="group"/>
+            <xs:enumeration value="index"/>
+            <xs:enumeration value="key1"/>
+            <xs:enumeration value="key2"/>
+            <xs:enumeration value="name"/>
+            <xs:enumeration value="primarykey"/>
+            <xs:enumeration value="procedure"/>
+            <xs:enumeration value="record"/>
+            <xs:enumeration value="rule"/>
+            <xs:enumeration value="secondarykey"/>
+            <xs:enumeration value="table"/>
+            <xs:enumeration value="user"/>
+            <xs:enumeration value="view"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="email">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="envar">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="errorcode">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="errorname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="errortext">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="errortype">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="filename">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="path"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="devicefile"/>
+            <xs:enumeration value="directory"/>
+            <xs:enumeration value="extension"/>
+            <xs:enumeration value="headerfile"/>
+            <xs:enumeration value="libraryfile"/>
+            <xs:enumeration value="partition"/>
+            <xs:enumeration value="symlink"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="function">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="guibutton">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:accel"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="guiicon">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:accel"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="guilabel">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:accel"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="guimenu">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:accel"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="guimenuitem">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:accel"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="guisubmenu">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:accel"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="hardware">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="keycap">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="function">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="alt"/>
+            <xs:enumeration value="backspace"/>
+            <xs:enumeration value="command"/>
+            <xs:enumeration value="control"/>
+            <xs:enumeration value="delete"/>
+            <xs:enumeration value="down"/>
+            <xs:enumeration value="end"/>
+            <xs:enumeration value="enter"/>
+            <xs:enumeration value="escape"/>
+            <xs:enumeration value="home"/>
+            <xs:enumeration value="insert"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="meta"/>
+            <xs:enumeration value="option"/>
+            <xs:enumeration value="pagedown"/>
+            <xs:enumeration value="pageup"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="shift"/>
+            <xs:enumeration value="space"/>
+            <xs:enumeration value="tab"/>
+            <xs:enumeration value="up"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherfunction"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="keycode">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="keycombo">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:mousebutton"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="action">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="click"/>
+            <xs:enumeration value="double-click"/>
+            <xs:enumeration value="press"/>
+            <xs:enumeration value="seq"/>
+            <xs:enumeration value="simul"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otheraction"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="keysym">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="lineannotation">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="literal">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="code">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="constant">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="limit"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="varname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="markup">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="menuchoice">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:shortcut"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:guibutton"/>
+          <xs:element ref="docbook:guiicon"/>
+          <xs:element ref="docbook:guilabel"/>
+          <xs:element ref="docbook:guimenu"/>
+          <xs:element ref="docbook:guimenuitem"/>
+          <xs:element ref="docbook:guisubmenu"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="shortcut">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:mousebutton"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="action">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="click"/>
+            <xs:enumeration value="double-click"/>
+            <xs:enumeration value="press"/>
+            <xs:enumeration value="seq"/>
+            <xs:enumeration value="simul"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otheraction"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="mousebutton">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="option">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="optional">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="property">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="parameter">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="command"/>
+            <xs:enumeration value="function"/>
+            <xs:enumeration value="option"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="prompt">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="replaceable">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="command"/>
+            <xs:enumeration value="function"/>
+            <xs:enumeration value="option"/>
+            <xs:enumeration value="parameter"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="returnvalue">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tag">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="attribute"/>
+            <xs:enumeration value="attvalue"/>
+            <xs:enumeration value="element"/>
+            <xs:enumeration value="emptytag"/>
+            <xs:enumeration value="endtag"/>
+            <xs:enumeration value="genentity"/>
+            <xs:enumeration value="localname"/>
+            <xs:enumeration value="namespace"/>
+            <xs:enumeration value="numcharref"/>
+            <xs:enumeration value="paramentity"/>
+            <xs:enumeration value="pi"/>
+            <xs:enumeration value="prefix"/>
+            <xs:enumeration value="comment"/>
+            <xs:enumeration value="starttag"/>
+            <xs:enumeration value="xmlpi"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="namespace"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="symbol">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="limit"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="systemitem">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="daemon"/>
+            <xs:enumeration value="domainname"/>
+            <xs:enumeration value="etheraddress"/>
+            <xs:enumeration value="event"/>
+            <xs:enumeration value="eventhandler"/>
+            <xs:enumeration value="filesystem"/>
+            <xs:enumeration value="fqdomainname"/>
+            <xs:enumeration value="groupname"/>
+            <xs:enumeration value="ipaddress"/>
+            <xs:enumeration value="library"/>
+            <xs:enumeration value="macro"/>
+            <xs:enumeration value="netmask"/>
+            <xs:enumeration value="newsgroup"/>
+            <xs:enumeration value="osname"/>
+            <xs:enumeration value="process"/>
+            <xs:enumeration value="protocol"/>
+            <xs:enumeration value="resource"/>
+            <xs:enumeration value="server"/>
+            <xs:enumeration value="service"/>
+            <xs:enumeration value="systemname"/>
+            <xs:enumeration value="username"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="uri">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="type"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="token">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="type">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="userinput">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="abbrev">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:trademark"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="acronym">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:trademark"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="citation">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="citerefentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:refentrytitle"/>
+        <xs:element minOccurs="0" ref="docbook:manvolnum"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refentrytitle">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="manvolnum">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="citetitle">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="pubwork">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="article"/>
+            <xs:enumeration value="bbs"/>
+            <xs:enumeration value="book"/>
+            <xs:enumeration value="cdrom"/>
+            <xs:enumeration value="chapter"/>
+            <xs:enumeration value="dvd"/>
+            <xs:enumeration value="emailmessage"/>
+            <xs:enumeration value="gopher"/>
+            <xs:enumeration value="journal"/>
+            <xs:enumeration value="manuscript"/>
+            <xs:enumeration value="newsposting"/>
+            <xs:enumeration value="part"/>
+            <xs:enumeration value="refentry"/>
+            <xs:enumeration value="section"/>
+            <xs:enumeration value="series"/>
+            <xs:enumeration value="set"/>
+            <xs:enumeration value="webpage"/>
+            <xs:enumeration value="wiki"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="emphasis">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="foreignphrase">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="phrase">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="quote">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="subscript">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="superscript">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="trademark">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="copyright"/>
+            <xs:enumeration value="registered"/>
+            <xs:enumeration value="service"/>
+            <xs:enumeration value="trade"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="wordasword">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="footnoteref">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="xref">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="xrefstyle"/>
+      <xs:attribute name="endterm" type="xs:IDREF"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="link">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="xrefstyle"/>
+      <xs:attribute name="endterm" type="xs:IDREF"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="olink">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="targetdoc"/>
+      <xs:attribute name="role"/>
+      <xs:attribute name="xrefstyle"/>
+      <xs:attribute name="localinfo"/>
+      <xs:attribute name="targetptr"/>
+      <xs:attribute name="type"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="anchor">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="alt">
+    <xs:complexType mixed="true">
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:inlinemediaobject"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="annotation">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attribute name="annotates"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="extendedlink">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:locator"/>
+        <xs:element ref="docbook:arc"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="locator">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute ref="xlink:label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="arc">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute ref="xlink:from"/>
+      <xs:attribute ref="xlink:to"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="set">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:toc"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:set"/>
+          <xs:element ref="docbook:book"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:setindex"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="book">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+          <xs:element ref="docbook:dedication"/>
+          <xs:element ref="docbook:preface"/>
+          <xs:element ref="docbook:chapter"/>
+          <xs:element ref="docbook:appendix"/>
+          <xs:element ref="docbook:article"/>
+          <xs:element ref="docbook:colophon"/>
+          <xs:element ref="docbook:part"/>
+          <xs:element ref="docbook:reference"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="dedication">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="colophon">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="appendix">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:glossary"/>
+            <xs:element ref="docbook:bibliography"/>
+            <xs:element ref="docbook:index"/>
+            <xs:element ref="docbook:toc"/>
+          </xs:choice>
+          <xs:choice>
+            <xs:sequence>
+              <xs:choice maxOccurs="unbounded">
+                <xs:element ref="docbook:itemizedlist"/>
+                <xs:element ref="docbook:orderedlist"/>
+                <xs:element ref="docbook:procedure"/>
+                <xs:element ref="docbook:simplelist"/>
+                <xs:element ref="docbook:variablelist"/>
+                <xs:element ref="docbook:segmentedlist"/>
+                <xs:element ref="docbook:glosslist"/>
+                <xs:element ref="docbook:bibliolist"/>
+                <xs:element ref="docbook:calloutlist"/>
+                <xs:element ref="docbook:qandaset"/>
+                <xs:element ref="docbook:caution"/>
+                <xs:element ref="docbook:important"/>
+                <xs:element ref="docbook:note"/>
+                <xs:element ref="docbook:tip"/>
+                <xs:element ref="docbook:warning"/>
+                <xs:element ref="docbook:example"/>
+                <xs:element ref="docbook:figure"/>
+                <xs:element ref="docbook:table"/>
+                <xs:element ref="docbook:informalexample"/>
+                <xs:element ref="docbook:informalfigure"/>
+                <xs:element ref="docbook:informaltable"/>
+                <xs:element ref="docbook:sidebar"/>
+                <xs:element ref="docbook:blockquote"/>
+                <xs:element ref="docbook:address"/>
+                <xs:element ref="docbook:epigraph"/>
+                <xs:element ref="docbook:mediaobject"/>
+                <xs:element ref="docbook:screenshot"/>
+                <xs:element ref="docbook:task"/>
+                <xs:element ref="docbook:productionset"/>
+                <xs:element ref="docbook:constraintdef"/>
+                <xs:element ref="docbook:msgset"/>
+                <xs:element ref="docbook:programlisting"/>
+                <xs:element ref="docbook:screen"/>
+                <xs:element ref="docbook:literallayout"/>
+                <xs:element ref="docbook:synopsis"/>
+                <xs:element ref="docbook:programlistingco"/>
+                <xs:element ref="docbook:screenco"/>
+                <xs:element ref="docbook:cmdsynopsis"/>
+                <xs:element ref="docbook:funcsynopsis"/>
+                <xs:element ref="docbook:classsynopsis"/>
+                <xs:element ref="docbook:methodsynopsis"/>
+                <xs:element ref="docbook:constructorsynopsis"/>
+                <xs:element ref="docbook:destructorsynopsis"/>
+                <xs:element ref="docbook:fieldsynopsis"/>
+                <xs:element ref="docbook:bridgehead"/>
+                <xs:element ref="docbook:remark"/>
+                <xs:element ref="docbook:revhistory"/>
+                <xs:element ref="docbook:indexterm"/>
+                <xs:element ref="docbook:equation"/>
+                <xs:element ref="docbook:informalequation"/>
+                <xs:element ref="docbook:anchor"/>
+                <xs:element ref="docbook:para"/>
+                <xs:element ref="docbook:formalpara"/>
+                <xs:element ref="docbook:simpara"/>
+                <xs:element ref="docbook:annotation"/>
+              </xs:choice>
+              <xs:choice minOccurs="0">
+                <xs:sequence>
+                  <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+                  <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+                </xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+                <xs:sequence>
+                  <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+                  <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+                </xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+              </xs:choice>
+            </xs:sequence>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+          </xs:choice>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:glossary"/>
+            <xs:element ref="docbook:bibliography"/>
+            <xs:element ref="docbook:index"/>
+            <xs:element ref="docbook:toc"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="chapter">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:glossary"/>
+            <xs:element ref="docbook:bibliography"/>
+            <xs:element ref="docbook:index"/>
+            <xs:element ref="docbook:toc"/>
+          </xs:choice>
+          <xs:choice>
+            <xs:sequence>
+              <xs:choice maxOccurs="unbounded">
+                <xs:element ref="docbook:itemizedlist"/>
+                <xs:element ref="docbook:orderedlist"/>
+                <xs:element ref="docbook:procedure"/>
+                <xs:element ref="docbook:simplelist"/>
+                <xs:element ref="docbook:variablelist"/>
+                <xs:element ref="docbook:segmentedlist"/>
+                <xs:element ref="docbook:glosslist"/>
+                <xs:element ref="docbook:bibliolist"/>
+                <xs:element ref="docbook:calloutlist"/>
+                <xs:element ref="docbook:qandaset"/>
+                <xs:element ref="docbook:caution"/>
+                <xs:element ref="docbook:important"/>
+                <xs:element ref="docbook:note"/>
+                <xs:element ref="docbook:tip"/>
+                <xs:element ref="docbook:warning"/>
+                <xs:element ref="docbook:example"/>
+                <xs:element ref="docbook:figure"/>
+                <xs:element ref="docbook:table"/>
+                <xs:element ref="docbook:informalexample"/>
+                <xs:element ref="docbook:informalfigure"/>
+                <xs:element ref="docbook:informaltable"/>
+                <xs:element ref="docbook:sidebar"/>
+                <xs:element ref="docbook:blockquote"/>
+                <xs:element ref="docbook:address"/>
+                <xs:element ref="docbook:epigraph"/>
+                <xs:element ref="docbook:mediaobject"/>
+                <xs:element ref="docbook:screenshot"/>
+                <xs:element ref="docbook:task"/>
+                <xs:element ref="docbook:productionset"/>
+                <xs:element ref="docbook:constraintdef"/>
+                <xs:element ref="docbook:msgset"/>
+                <xs:element ref="docbook:programlisting"/>
+                <xs:element ref="docbook:screen"/>
+                <xs:element ref="docbook:literallayout"/>
+                <xs:element ref="docbook:synopsis"/>
+                <xs:element ref="docbook:programlistingco"/>
+                <xs:element ref="docbook:screenco"/>
+                <xs:element ref="docbook:cmdsynopsis"/>
+                <xs:element ref="docbook:funcsynopsis"/>
+                <xs:element ref="docbook:classsynopsis"/>
+                <xs:element ref="docbook:methodsynopsis"/>
+                <xs:element ref="docbook:constructorsynopsis"/>
+                <xs:element ref="docbook:destructorsynopsis"/>
+                <xs:element ref="docbook:fieldsynopsis"/>
+                <xs:element ref="docbook:bridgehead"/>
+                <xs:element ref="docbook:remark"/>
+                <xs:element ref="docbook:revhistory"/>
+                <xs:element ref="docbook:indexterm"/>
+                <xs:element ref="docbook:equation"/>
+                <xs:element ref="docbook:informalequation"/>
+                <xs:element ref="docbook:anchor"/>
+                <xs:element ref="docbook:para"/>
+                <xs:element ref="docbook:formalpara"/>
+                <xs:element ref="docbook:simpara"/>
+                <xs:element ref="docbook:annotation"/>
+              </xs:choice>
+              <xs:choice minOccurs="0">
+                <xs:sequence>
+                  <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+                  <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+                </xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+                <xs:sequence>
+                  <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+                  <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+                </xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+              </xs:choice>
+            </xs:sequence>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+          </xs:choice>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:glossary"/>
+            <xs:element ref="docbook:bibliography"/>
+            <xs:element ref="docbook:index"/>
+            <xs:element ref="docbook:toc"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="part">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:partintro"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+          <xs:element ref="docbook:dedication"/>
+          <xs:element ref="docbook:preface"/>
+          <xs:element ref="docbook:chapter"/>
+          <xs:element ref="docbook:appendix"/>
+          <xs:element ref="docbook:article"/>
+          <xs:element ref="docbook:colophon"/>
+          <xs:element ref="docbook:refentry"/>
+          <xs:element ref="docbook:reference"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="preface">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:glossary"/>
+            <xs:element ref="docbook:bibliography"/>
+            <xs:element ref="docbook:index"/>
+            <xs:element ref="docbook:toc"/>
+          </xs:choice>
+          <xs:choice>
+            <xs:sequence>
+              <xs:choice maxOccurs="unbounded">
+                <xs:element ref="docbook:itemizedlist"/>
+                <xs:element ref="docbook:orderedlist"/>
+                <xs:element ref="docbook:procedure"/>
+                <xs:element ref="docbook:simplelist"/>
+                <xs:element ref="docbook:variablelist"/>
+                <xs:element ref="docbook:segmentedlist"/>
+                <xs:element ref="docbook:glosslist"/>
+                <xs:element ref="docbook:bibliolist"/>
+                <xs:element ref="docbook:calloutlist"/>
+                <xs:element ref="docbook:qandaset"/>
+                <xs:element ref="docbook:caution"/>
+                <xs:element ref="docbook:important"/>
+                <xs:element ref="docbook:note"/>
+                <xs:element ref="docbook:tip"/>
+                <xs:element ref="docbook:warning"/>
+                <xs:element ref="docbook:example"/>
+                <xs:element ref="docbook:figure"/>
+                <xs:element ref="docbook:table"/>
+                <xs:element ref="docbook:informalexample"/>
+                <xs:element ref="docbook:informalfigure"/>
+                <xs:element ref="docbook:informaltable"/>
+                <xs:element ref="docbook:sidebar"/>
+                <xs:element ref="docbook:blockquote"/>
+                <xs:element ref="docbook:address"/>
+                <xs:element ref="docbook:epigraph"/>
+                <xs:element ref="docbook:mediaobject"/>
+                <xs:element ref="docbook:screenshot"/>
+                <xs:element ref="docbook:task"/>
+                <xs:element ref="docbook:productionset"/>
+                <xs:element ref="docbook:constraintdef"/>
+                <xs:element ref="docbook:msgset"/>
+                <xs:element ref="docbook:programlisting"/>
+                <xs:element ref="docbook:screen"/>
+                <xs:element ref="docbook:literallayout"/>
+                <xs:element ref="docbook:synopsis"/>
+                <xs:element ref="docbook:programlistingco"/>
+                <xs:element ref="docbook:screenco"/>
+                <xs:element ref="docbook:cmdsynopsis"/>
+                <xs:element ref="docbook:funcsynopsis"/>
+                <xs:element ref="docbook:classsynopsis"/>
+                <xs:element ref="docbook:methodsynopsis"/>
+                <xs:element ref="docbook:constructorsynopsis"/>
+                <xs:element ref="docbook:destructorsynopsis"/>
+                <xs:element ref="docbook:fieldsynopsis"/>
+                <xs:element ref="docbook:bridgehead"/>
+                <xs:element ref="docbook:remark"/>
+                <xs:element ref="docbook:revhistory"/>
+                <xs:element ref="docbook:indexterm"/>
+                <xs:element ref="docbook:equation"/>
+                <xs:element ref="docbook:informalequation"/>
+                <xs:element ref="docbook:anchor"/>
+                <xs:element ref="docbook:para"/>
+                <xs:element ref="docbook:formalpara"/>
+                <xs:element ref="docbook:simpara"/>
+                <xs:element ref="docbook:annotation"/>
+              </xs:choice>
+              <xs:choice minOccurs="0">
+                <xs:sequence>
+                  <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+                  <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+                </xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+                <xs:sequence>
+                  <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+                  <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+                </xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+              </xs:choice>
+            </xs:sequence>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+          </xs:choice>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:glossary"/>
+            <xs:element ref="docbook:bibliography"/>
+            <xs:element ref="docbook:index"/>
+            <xs:element ref="docbook:toc"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="partintro">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="section">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+              <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="simplesect">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="ackno">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="article">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:appendix"/>
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+          <xs:element ref="docbook:ackno"/>
+          <xs:element ref="docbook:colophon"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="faq"/>
+            <xs:enumeration value="journalarticle"/>
+            <xs:enumeration value="productsheet"/>
+            <xs:enumeration value="specification"/>
+            <xs:enumeration value="techreport"/>
+            <xs:enumeration value="whitepaper"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sect1">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:sect2"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:sect2"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sect2">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:sect3"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:sect3"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sect3">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:sect4"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:sect4"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sect4">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:sect5"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:sect5"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sect5">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="reference">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:partintro"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="status"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexterm"/>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element minOccurs="0" ref="docbook:refmeta"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:refnamediv"/>
+        <xs:element minOccurs="0" ref="docbook:refsynopsisdiv"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsection"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsect1"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="status"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refmeta">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexterm"/>
+        <xs:element ref="docbook:refentrytitle"/>
+        <xs:element minOccurs="0" ref="docbook:manvolnum"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:refmiscinfo"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexterm"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refmiscinfo">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="source"/>
+            <xs:enumeration value="version"/>
+            <xs:enumeration value="manual"/>
+            <xs:enumeration value="sectdesc"/>
+            <xs:enumeration value="software"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refnamediv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:refdescriptor"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:refname"/>
+        <xs:element ref="docbook:refpurpose"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:refclass"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refdescriptor">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refpurpose">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refclass">
+    <xs:complexType mixed="true">
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:application"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refsynopsisdiv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:element maxOccurs="unbounded" ref="docbook:refsection"/>
+              <xs:element maxOccurs="unbounded" ref="docbook:refsect2"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsection"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsect2"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refsection">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:refsection"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsection"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="status"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refsect1">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:element maxOccurs="unbounded" ref="docbook:refsect2"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsect2"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refsect2">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:element maxOccurs="unbounded" ref="docbook:refsect3"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsect3"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refsect3">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glosslist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence minOccurs="0">
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:glossentry"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glossentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element minOccurs="0" ref="docbook:acronym"/>
+        <xs:element minOccurs="0" ref="docbook:abbrev"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexterm"/>
+        <xs:choice>
+          <xs:element ref="docbook:glosssee"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:glossdef"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="sortas"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glossdef">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:glossseealso"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="subject"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glosssee">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="otherterm" type="xs:IDREF"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glossseealso">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="otherterm" type="xs:IDREF"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="firstterm">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="baseform"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glossterm">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="baseform"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glossary">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:glossdiv"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:glossentry"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:bibliography"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glossdiv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:glossentry"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="termdef">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="baseform"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="biblioentry">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:abstract"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:artpagenums"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:authorgroup"/>
+        <xs:element ref="docbook:authorinitials"/>
+        <xs:element ref="docbook:bibliocoverage"/>
+        <xs:element ref="docbook:biblioid"/>
+        <xs:element ref="docbook:bibliosource"/>
+        <xs:element ref="docbook:collab"/>
+        <xs:element ref="docbook:confgroup"/>
+        <xs:element ref="docbook:contractsponsor"/>
+        <xs:element ref="docbook:contractnum"/>
+        <xs:element ref="docbook:copyright"/>
+        <xs:element ref="docbook:cover"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:edition"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:issuenum"/>
+        <xs:element ref="docbook:keywordset"/>
+        <xs:element ref="docbook:legalnotice"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:othercredit"/>
+        <xs:element ref="docbook:pagenums"/>
+        <xs:element ref="docbook:printhistory"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:pubdate"/>
+        <xs:element ref="docbook:publisher"/>
+        <xs:element ref="docbook:publishername"/>
+        <xs:element ref="docbook:releaseinfo"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:seriesvolnums"/>
+        <xs:element ref="docbook:subjectset"/>
+        <xs:element ref="docbook:volumenum"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:extendedlink"/>
+        <xs:element ref="docbook:bibliomisc"/>
+        <xs:element ref="docbook:bibliomset"/>
+        <xs:element ref="docbook:bibliorelation"/>
+        <xs:element ref="docbook:biblioset"/>
+        <xs:element ref="docbook:itermset"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:subtitle"/>
+        <xs:element ref="docbook:title"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliomixed">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:abstract"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:artpagenums"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:authorgroup"/>
+        <xs:element ref="docbook:authorinitials"/>
+        <xs:element ref="docbook:bibliocoverage"/>
+        <xs:element ref="docbook:biblioid"/>
+        <xs:element ref="docbook:bibliosource"/>
+        <xs:element ref="docbook:collab"/>
+        <xs:element ref="docbook:confgroup"/>
+        <xs:element ref="docbook:contractsponsor"/>
+        <xs:element ref="docbook:contractnum"/>
+        <xs:element ref="docbook:copyright"/>
+        <xs:element ref="docbook:cover"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:edition"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:issuenum"/>
+        <xs:element ref="docbook:keywordset"/>
+        <xs:element ref="docbook:legalnotice"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:othercredit"/>
+        <xs:element ref="docbook:pagenums"/>
+        <xs:element ref="docbook:printhistory"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:pubdate"/>
+        <xs:element ref="docbook:publisher"/>
+        <xs:element ref="docbook:publishername"/>
+        <xs:element ref="docbook:releaseinfo"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:seriesvolnums"/>
+        <xs:element ref="docbook:subjectset"/>
+        <xs:element ref="docbook:volumenum"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:extendedlink"/>
+        <xs:element ref="docbook:bibliomisc"/>
+        <xs:element ref="docbook:bibliomset"/>
+        <xs:element ref="docbook:bibliorelation"/>
+        <xs:element ref="docbook:biblioset"/>
+        <xs:element ref="docbook:itermset"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:subtitle"/>
+        <xs:element ref="docbook:title"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="biblioset">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:abstract"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:artpagenums"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:authorgroup"/>
+        <xs:element ref="docbook:authorinitials"/>
+        <xs:element ref="docbook:bibliocoverage"/>
+        <xs:element ref="docbook:biblioid"/>
+        <xs:element ref="docbook:bibliosource"/>
+        <xs:element ref="docbook:collab"/>
+        <xs:element ref="docbook:confgroup"/>
+        <xs:element ref="docbook:contractsponsor"/>
+        <xs:element ref="docbook:contractnum"/>
+        <xs:element ref="docbook:copyright"/>
+        <xs:element ref="docbook:cover"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:edition"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:issuenum"/>
+        <xs:element ref="docbook:keywordset"/>
+        <xs:element ref="docbook:legalnotice"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:othercredit"/>
+        <xs:element ref="docbook:pagenums"/>
+        <xs:element ref="docbook:printhistory"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:pubdate"/>
+        <xs:element ref="docbook:publisher"/>
+        <xs:element ref="docbook:publishername"/>
+        <xs:element ref="docbook:releaseinfo"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:seriesvolnums"/>
+        <xs:element ref="docbook:subjectset"/>
+        <xs:element ref="docbook:volumenum"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:extendedlink"/>
+        <xs:element ref="docbook:bibliomisc"/>
+        <xs:element ref="docbook:bibliomset"/>
+        <xs:element ref="docbook:bibliorelation"/>
+        <xs:element ref="docbook:biblioset"/>
+        <xs:element ref="docbook:itermset"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:subtitle"/>
+        <xs:element ref="docbook:title"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="relation"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliomset">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:abstract"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:artpagenums"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:authorgroup"/>
+        <xs:element ref="docbook:authorinitials"/>
+        <xs:element ref="docbook:bibliocoverage"/>
+        <xs:element ref="docbook:biblioid"/>
+        <xs:element ref="docbook:bibliosource"/>
+        <xs:element ref="docbook:collab"/>
+        <xs:element ref="docbook:confgroup"/>
+        <xs:element ref="docbook:contractsponsor"/>
+        <xs:element ref="docbook:contractnum"/>
+        <xs:element ref="docbook:copyright"/>
+        <xs:element ref="docbook:cover"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:edition"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:issuenum"/>
+        <xs:element ref="docbook:keywordset"/>
+        <xs:element ref="docbook:legalnotice"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:othercredit"/>
+        <xs:element ref="docbook:pagenums"/>
+        <xs:element ref="docbook:printhistory"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:pubdate"/>
+        <xs:element ref="docbook:publisher"/>
+        <xs:element ref="docbook:publishername"/>
+        <xs:element ref="docbook:releaseinfo"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:seriesvolnums"/>
+        <xs:element ref="docbook:subjectset"/>
+        <xs:element ref="docbook:volumenum"/>
+        <xs:element ref="docbook:extendedlink"/>
+        <xs:element ref="docbook:bibliomisc"/>
+        <xs:element ref="docbook:bibliomset"/>
+        <xs:element ref="docbook:bibliorelation"/>
+        <xs:element ref="docbook:biblioset"/>
+        <xs:element ref="docbook:itermset"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:subtitle"/>
+        <xs:element ref="docbook:title"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="relation"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliomisc">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliography">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:bibliodiv"/>
+          <xs:choice maxOccurs="unbounded">
+            <xs:element ref="docbook:biblioentry"/>
+            <xs:element ref="docbook:bibliomixed"/>
+          </xs:choice>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliodiv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:biblioentry"/>
+          <xs:element ref="docbook:bibliomixed"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliolist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence minOccurs="0">
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:biblioentry"/>
+          <xs:element ref="docbook:bibliomixed"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="biblioref">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="xrefstyle"/>
+      <xs:attribute name="endterm" type="xs:IDREF"/>
+      <xs:attribute name="units" type="xs:NMTOKEN"/>
+      <xs:attribute name="begin" type="xs:NMTOKEN"/>
+      <xs:attribute name="end" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="itermset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:indexterm"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="indexterm">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:primary"/>
+        <xs:choice minOccurs="0">
+          <xs:sequence>
+            <xs:element ref="docbook:secondary"/>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element ref="docbook:tertiary"/>
+                <xs:choice minOccurs="0">
+                  <xs:element ref="docbook:see"/>
+                  <xs:element maxOccurs="unbounded" ref="docbook:seealso"/>
+                </xs:choice>
+              </xs:sequence>
+              <xs:element ref="docbook:see"/>
+              <xs:element maxOccurs="unbounded" ref="docbook:seealso"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:element ref="docbook:see"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:seealso"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="significance">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="normal"/>
+            <xs:enumeration value="preferred"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startref" type="xs:IDREF"/>
+      <xs:attribute name="zone" type="xs:IDREFS"/>
+      <xs:attribute name="pagenum"/>
+      <xs:attribute name="scope">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="all"/>
+            <xs:enumeration value="global"/>
+            <xs:enumeration value="local"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="type"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="singular"/>
+            <xs:enumeration value="startofrange"/>
+            <xs:enumeration value="endofrange"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="primary">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="sortas"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="secondary">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="sortas"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tertiary">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="sortas"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="see">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="seealso">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="index">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexdiv"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexentry"/>
+          <xs:element ref="docbook:segmentedlist"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+      <xs:attribute name="type"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="setindex">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexdiv"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+      <xs:attribute name="type"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="indexdiv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:indexentry"/>
+          <xs:element ref="docbook:segmentedlist"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="indexentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:primaryie"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:seeie"/>
+          <xs:element ref="docbook:seealsoie"/>
+        </xs:choice>
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:secondaryie"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:seeie"/>
+            <xs:element ref="docbook:seealsoie"/>
+            <xs:element ref="docbook:tertiaryie"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="primaryie">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="secondaryie">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tertiaryie">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="seeie">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="seealsoie">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="toc">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:tocdiv"/>
+          <xs:element ref="docbook:tocentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tocdiv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:tocdiv"/>
+          <xs:element ref="docbook:tocentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="pagenum"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tocentry">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="pagenum"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="task">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:tasksummary"/>
+        <xs:element minOccurs="0" ref="docbook:taskprerequisites"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:example"/>
+        <xs:element minOccurs="0" ref="docbook:taskrelated"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tasksummary">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="taskprerequisites">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="taskrelated">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="calloutlist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:callout"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="callout">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:annotation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="arearefs" use="required" type="xs:IDREFS"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="programlistingco">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element ref="docbook:areaspec"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:calloutlist"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="areaspec">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:area"/>
+        <xs:element ref="docbook:areaset"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="units">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="calspair"/>
+            <xs:enumeration value="linecolumn"/>
+            <xs:enumeration value="linecolumnpair"/>
+            <xs:enumeration value="linerange"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherunits" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="area">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:alt"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="units">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="calspair"/>
+            <xs:enumeration value="linecolumn"/>
+            <xs:enumeration value="linecolumnpair"/>
+            <xs:enumeration value="linerange"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherunits" type="xs:NMTOKEN"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="coords" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="areaset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:area"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="units">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="calspair"/>
+            <xs:enumeration value="linecolumn"/>
+            <xs:enumeration value="linecolumnpair"/>
+            <xs:enumeration value="linerange"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherunits" type="xs:NMTOKEN"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="screenco">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element ref="docbook:areaspec"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:calloutlist"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="imageobjectco">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element ref="docbook:areaspec"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:imageobject"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:calloutlist"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="co">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="coref">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="productionset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:production"/>
+          <xs:element ref="docbook:productionrecap"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="production">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:lhs"/>
+        <xs:element ref="docbook:rhs"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:constraint"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="lhs">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="rhs">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:sbr"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="nonterminal">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="def" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="constraint">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="productionrecap">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="constraintdef">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tgroup">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:colspec"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:spanspec"/>
+        <xs:element minOccurs="0" ref="docbook:thead"/>
+        <xs:element minOccurs="0" ref="docbook:tfoot"/>
+        <xs:element ref="docbook:tbody"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="tgroupstyle"/>
+      <xs:attribute name="cols" use="required" type="xs:NMTOKEN"/>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="colspec">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="colnum" type="xs:NMTOKEN"/>
+      <xs:attribute name="char"/>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="colwidth"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="colname"/>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="spanspec">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="spanname" use="required"/>
+      <xs:attribute name="namest" use="required"/>
+      <xs:attribute name="nameend" use="required"/>
+      <xs:attribute name="char"/>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="thead">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:colspec"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:row"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:tr"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tfoot">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:colspec"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:row"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:tr"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tbody">
+    <xs:complexType>
+      <xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:row"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:tr"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="row">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:entry"/>
+        <xs:element ref="docbook:entrytbl"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="entry">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="morerows" type="xs:NMTOKEN"/>
+      <xs:attribute name="colname"/>
+      <xs:attribute name="namest"/>
+      <xs:attribute name="spanname"/>
+      <xs:attribute name="nameend"/>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rotate">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="entrytbl">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:colspec"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:spanspec"/>
+        <xs:element minOccurs="0" ref="docbook:thead"/>
+        <xs:element ref="docbook:tbody"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="colname"/>
+      <xs:attribute name="namest"/>
+      <xs:attribute name="spanname"/>
+      <xs:attribute name="nameend"/>
+      <xs:attribute name="tgroupstyle"/>
+      <xs:attribute name="cols" type="xs:NMTOKEN"/>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="table">
+    <xs:complexType>
+      <xs:choice>
+        <xs:sequence>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+          <xs:sequence>
+            <xs:element ref="docbook:title"/>
+            <xs:element minOccurs="0" ref="docbook:titleabbrev"/>
+          </xs:sequence>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexterm"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:textobject"/>
+          <xs:choice>
+            <xs:element maxOccurs="unbounded" ref="docbook:mediaobject"/>
+            <xs:element maxOccurs="unbounded" ref="docbook:tgroup"/>
+          </xs:choice>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:element ref="docbook:caption"/>
+          <xs:choice>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:col"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:colgroup"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:thead"/>
+          <xs:element minOccurs="0" ref="docbook:tfoot"/>
+          <xs:choice>
+            <xs:element maxOccurs="unbounded" ref="docbook:tbody"/>
+            <xs:element maxOccurs="unbounded" ref="docbook:tr"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="tabstyle"/>
+      <xs:attribute name="floatstyle"/>
+      <xs:attribute name="orient">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="land"/>
+            <xs:enumeration value="port"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="frame">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="all"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="none"/>
+            <xs:enumeration value="sides"/>
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="topbot"/>
+            <xs:enumeration value="void"/>
+            <xs:enumeration value="above"/>
+            <xs:enumeration value="below"/>
+            <xs:enumeration value="hsides"/>
+            <xs:enumeration value="lhs"/>
+            <xs:enumeration value="rhs"/>
+            <xs:enumeration value="vsides"/>
+            <xs:enumeration value="box"/>
+            <xs:enumeration value="border"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="pgwide">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="shortentry">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="tocentry">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowheader">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="firstcol"/>
+            <xs:enumeration value="norowheader"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="summary"/>
+      <xs:attribute name="width"/>
+      <xs:attribute name="border" type="xs:NMTOKEN"/>
+      <xs:attribute name="rules">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="none"/>
+            <xs:enumeration value="groups"/>
+            <xs:enumeration value="rows"/>
+            <xs:enumeration value="cols"/>
+            <xs:enumeration value="all"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="cellspacing"/>
+      <xs:attribute name="cellpadding"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="informaltable">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:choice>
+          <xs:sequence>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:textobject"/>
+            <xs:choice>
+              <xs:element maxOccurs="unbounded" ref="docbook:mediaobject"/>
+              <xs:element maxOccurs="unbounded" ref="docbook:tgroup"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:choice>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:col"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:colgroup"/>
+            </xs:choice>
+            <xs:element minOccurs="0" ref="docbook:thead"/>
+            <xs:element minOccurs="0" ref="docbook:tfoot"/>
+            <xs:choice>
+              <xs:element maxOccurs="unbounded" ref="docbook:tbody"/>
+              <xs:element maxOccurs="unbounded" ref="docbook:tr"/>
+            </xs:choice>
+          </xs:sequence>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="tabstyle"/>
+      <xs:attribute name="floatstyle"/>
+      <xs:attribute name="orient">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="land"/>
+            <xs:enumeration value="port"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="frame">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="all"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="none"/>
+            <xs:enumeration value="sides"/>
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="topbot"/>
+            <xs:enumeration value="void"/>
+            <xs:enumeration value="above"/>
+            <xs:enumeration value="below"/>
+            <xs:enumeration value="hsides"/>
+            <xs:enumeration value="lhs"/>
+            <xs:enumeration value="rhs"/>
+            <xs:enumeration value="vsides"/>
+            <xs:enumeration value="box"/>
+            <xs:enumeration value="border"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="pgwide">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowheader">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="firstcol"/>
+            <xs:enumeration value="norowheader"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="summary"/>
+      <xs:attribute name="width"/>
+      <xs:attribute name="border" type="xs:NMTOKEN"/>
+      <xs:attribute name="rules">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="none"/>
+            <xs:enumeration value="groups"/>
+            <xs:enumeration value="rows"/>
+            <xs:enumeration value="cols"/>
+            <xs:enumeration value="all"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="cellspacing"/>
+      <xs:attribute name="cellpadding"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="col">
+    <xs:complexType>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="span" type="xs:NMTOKEN"/>
+      <xs:attribute name="width"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="colgroup">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:col"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="span" type="xs:NMTOKEN"/>
+      <xs:attribute name="width"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tr">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:th"/>
+        <xs:element ref="docbook:td"/>
+      </xs:choice>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="th">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+      </xs:choice>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="abbr"/>
+      <xs:attribute name="axis"/>
+      <xs:attribute name="headers"/>
+      <xs:attribute name="scope">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="row"/>
+            <xs:enumeration value="col"/>
+            <xs:enumeration value="rowgroup"/>
+            <xs:enumeration value="colgroup"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowspan" type="xs:NMTOKEN"/>
+      <xs:attribute name="colspan" type="xs:NMTOKEN"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="td">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+      </xs:choice>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="abbr"/>
+      <xs:attribute name="axis"/>
+      <xs:attribute name="headers"/>
+      <xs:attribute name="scope">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="row"/>
+            <xs:enumeration value="col"/>
+            <xs:enumeration value="rowgroup"/>
+            <xs:enumeration value="colgroup"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowspan" type="xs:NMTOKEN"/>
+      <xs:attribute name="colspan" type="xs:NMTOKEN"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:msgentry"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplemsgentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:msg"/>
+        <xs:element minOccurs="0" ref="docbook:msginfo"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:msgexplan"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="simplemsgentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:msgtext"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:msgexplan"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="msgaud"/>
+      <xs:attribute name="msgorig"/>
+      <xs:attribute name="msglevel"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msg">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element ref="docbook:msgmain"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:msgsub"/>
+          <xs:element ref="docbook:msgrel"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgmain">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element ref="docbook:msgtext"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgsub">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element ref="docbook:msgtext"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgrel">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element ref="docbook:msgtext"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgtext">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:annotation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msginfo">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:msglevel"/>
+        <xs:element ref="docbook:msgorig"/>
+        <xs:element ref="docbook:msgaud"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msglevel">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgorig">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgaud">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgexplan">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="qandaset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:qandadiv"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:qandaentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="defaultlabel">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="none"/>
+            <xs:enumeration value="number"/>
+            <xs:enumeration value="qanda"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="qandadiv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:qandadiv"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:qandaentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="qandaentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element ref="docbook:question"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:answer"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="question">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:label"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="answer">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:label"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="label">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="equation">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:alt"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:mediaobject"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:mathphrase"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="pgwide">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="floatstyle"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="informalequation">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element minOccurs="0" ref="docbook:alt"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:mediaobject"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:mathphrase"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="inlineequation">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:alt"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:inlinemediaobject"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:mathphrase"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="mathphrase">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:emphasis"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
diff --git a/xml/tests/testData/xml/DoctypeWithoutSchema.ent b/xml/tests/testData/xml/DoctypeWithoutSchema.ent
new file mode 100644
index 0000000..70d898b
--- /dev/null
+++ b/xml/tests/testData/xml/DoctypeWithoutSchema.ent
@@ -0,0 +1,19 @@
+<!ENTITY ORGS.ACCOUNTABILITY_ROLE "ACCOUNTABILITY_ROLE">
+<!ENTITY ORGS.ADDRESS_TYPE "ADDRESS_TYPE">
+<!ENTITY ORGS.JDO_CLASS "JDO_CLASS">
+<!ENTITY ORGS.MEMBER "MEMBER">
+<!ENTITY ORGS.MEMBER_INFO "MEMBER_INFO">
+<!ENTITY ORGS.ORG_UNIT "ORG_UNIT">
+<!ENTITY ORGS.ORG_UNIT_LINK "ORG_UNIT_LINK">
+<!ENTITY ORGS.ORG_UNIT_LINK_TYPE "ORG_UNIT_LINK_TYPE">
+<!ENTITY ORGS.ORG_UNIT_TYPE "ORG_UNIT_TYPE">
+<!ENTITY ORGS.ORG_UNIT_TYPE_ROLE "ORG_UNIT_TYPE_ROLE">
+<!ENTITY ORGS.POLITICAL_PARTY "POLITICAL_PARTY">
+<!ENTITY ORGS.POSITION "POSITION">
+<!ENTITY ORGS.POSITION_ACCOUNTABILITY "POSITION_ACCOUNTABILITY">
+<!ENTITY ORGS.POSITION_ADDRESS "POSITION_ADDRESS">
+<!ENTITY ORGS.POSITION_COMPATIBILITY_GROUP "POSITION_COMPATIBILITY_GROUP">
+<!ENTITY ORGS.POST "POST">
+<!ENTITY ORGS.POST_ACCOUNTABILITY "POST_ACCOUNTABILITY">
+<!ENTITY ORGS.ROLE "ROLE">
+<!ENTITY ORGS.ROLE_GROUP "ROLE_GROUP">
\ No newline at end of file
diff --git a/xml/tests/testData/xml/DoctypeWithoutSchema.xml b/xml/tests/testData/xml/DoctypeWithoutSchema.xml
new file mode 100644
index 0000000..20b349e3
--- /dev/null
+++ b/xml/tests/testData/xml/DoctypeWithoutSchema.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapping [
+  <!ENTITY % package.tables SYSTEM  "DoctypeWithoutSchema.ent">
+  %package.tables;
+]>
+
+<mapping>
+  <package name="com.peacetech.orgs.jdo">
+    <class name="AccountabilityRoleImpl">
+      <jdbc-class-map type="base" table="&ORGS.ACCOUNTABILITY_ROLE;"/>
+    </class>
+   </package>
+</mapping>
diff --git a/xml/tests/testData/xml/DtdElementRefs.xml b/xml/tests/testData/xml/DtdElementRefs.xml
new file mode 100644
index 0000000..e506c38
--- /dev/null
+++ b/xml/tests/testData/xml/DtdElementRefs.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<!DOCTYPE persistence [
+  <!ELEMENT persistence (xi:include)*>
+  <!ELEMENT persistence (<error>xi:include2</error>)*>
+  <!ATTLIST persistence
+    xmlns CDATA #REQUIRED
+    xmlns:xsi CDATA #REQUIRED
+    xmlns:xi CDATA #REQUIRED
+    xsi:schemaLocation CDATA #REQUIRED>
+  <!ELEMENT xi:include (#PCDATA)>
+  <!ATTLIST xi:include
+    href CDATA #REQUIRED>
+  ]>
+<persistence xmlns="http://example.com/persistence"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xmlns:xi="http://www.w3.org/2001/XInclude"
+             xsi:schemaLocation="http://example.com/persistence XIncludeTestSchema.xsd
+             http://www.w3.org/2001/XInclude http://www.w3.org/2001/XInclude.xsd">
+  <xi:include href="<error>sample-inc.xml</error>"/>
+</persistence>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/DtdHighlighting.dtd b/xml/tests/testData/xml/DtdHighlighting.dtd
new file mode 100644
index 0000000..ab9d48e
--- /dev/null
+++ b/xml/tests/testData/xml/DtdHighlighting.dtd
@@ -0,0 +1,4 @@
+<!ENTITY % xhtml-inlstyle.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Inline Style 1.0//EN"
+            "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlstyle-1.mod" >
+%xhtml-inlstyle.mod;
\ No newline at end of file
diff --git a/xml/tests/testData/xml/DtdHighlighting.mod b/xml/tests/testData/xml/DtdHighlighting.mod
new file mode 100644
index 0000000..b57c942
--- /dev/null
+++ b/xml/tests/testData/xml/DtdHighlighting.mod
@@ -0,0 +1 @@
+<!ENTITY % XHTML.profile  "" >
\ No newline at end of file
diff --git a/xml/tests/testData/xml/DuplicateIdAttribute.xml b/xml/tests/testData/xml/DuplicateIdAttribute.xml
new file mode 100644
index 0000000..32eec98
--- /dev/null
+++ b/xml/tests/testData/xml/DuplicateIdAttribute.xml
@@ -0,0 +1,10 @@
+<!DOCTYPE a [
+<!ELEMENT a (b)*>
+<!ELEMENT b (#PCDATA)>
+<!ATTLIST b
+    id ID #REQUIRED>
+]><a>
+ <b id=<error>"1"</error>/>
+ <b id=<error>"1"</error>/>
+ <b id="2"/>
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/DuplicateIdAttribute2.xml b/xml/tests/testData/xml/DuplicateIdAttribute2.xml
new file mode 100644
index 0000000..e77984c7
--- /dev/null
+++ b/xml/tests/testData/xml/DuplicateIdAttribute2.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:idx="<error>http://www.intellij.com/schema/css/indexer</error>"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+http://www.intellij.com/schema/css/indexer <error>http://www.intellij.com/schema/css/indexer/resource.xsd</error>">
+
+  <bean id="searchEngine" class="java.lang.StringBuffer">
+    <property name="length">
+      <idx:resource class="java.lang.String">
+        <idx:field name="author" expr="author"/>
+      </idx:resource>
+    </property>
+
+  </bean>
+
+  <bean id="author" class="java.lang.String"/>
+</beans>
diff --git a/xml/tests/testData/xml/DuplicateNameAttribute.xml b/xml/tests/testData/xml/DuplicateNameAttribute.xml
new file mode 100644
index 0000000..3bad1d0
--- /dev/null
+++ b/xml/tests/testData/xml/DuplicateNameAttribute.xml
@@ -0,0 +1,18 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:beans="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+            http://www.springframework.org/schema/beans
+            http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+    <bean id="someInstance" class="java.util.Date">
+        <beans:property name="date" value="0"/>
+    </bean>
+
+    <bean id="someInstance2" class="java.util.Date">
+        <beans:property name="date" value="0"/>
+    </bean>
+
+    <bean id="date" class="java.util.Date" scope="singleton"/>
+
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/DuplicateNameAttributeSchemas/spring-beans-2.5.xsd b/xml/tests/testData/xml/DuplicateNameAttributeSchemas/spring-beans-2.5.xsd
new file mode 100644
index 0000000..769830c
--- /dev/null
+++ b/xml/tests/testData/xml/DuplicateNameAttributeSchemas/spring-beans-2.5.xsd
@@ -0,0 +1,1164 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/beans"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		targetNamespace="http://www.springframework.org/schema/beans">
+
+	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Spring XML Beans Schema, version 2.5
+	Authors: Rob Harrop, Juergen Hoeller, Mark Fisher
+
+	This defines a simple and consistent way of creating a namespace
+	of JavaBeans objects, managed by a Spring BeanFactory, read by
+	XmlBeanDefinitionReader (with DefaultBeanDefinitionDocumentReader).
+
+	This document type is used by most Spring functionality, including
+	web application contexts, which are based on bean factories.
+
+	Each "bean" element in this document defines a JavaBean.
+	Typically the bean class is specified, along with JavaBean properties
+	and/or constructor arguments.
+
+	A bean instance can be a "singleton" (shared instance) or a "prototype"
+	(independent instance). Further scopes can be provided by extended
+	bean factories, for example in a web environment.
+
+	References among beans are supported, that is, setting a JavaBean property
+	or a constructor argument to refer to another bean in the same factory
+	(or an ancestor factory).
+
+	As alternative to bean references, "inner bean definitions" can be used.
+	Singleton flags of such inner bean definitions are effectively ignored:
+	inner beans are typically anonymous prototypes.
+
+	There is also support for lists, sets, maps, and java.util.Properties
+	as bean property types or constructor argument types.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<!-- base types -->
+	<xsd:complexType name="identifiedType" abstract="true">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The unique identifier for a bean. The scope of the identifier
+	is the enclosing bean factory.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:attribute name="id" type="xsd:ID">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The unique identifier for a bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Top-level <beans> tag -->
+	<xsd:element name="beans">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The top level (typically root) element. Allows the definition
+	of default values for all nested bean definitions.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="import"/>
+					<xsd:element ref="alias"/>
+					<xsd:element ref="bean"/>
+					<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="default-lazy-init" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'lazy-init' value; see the documentation for the
+	'lazy-init' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-merge" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'merge' value; see the documentation for the
+	'merge' attribute of the various collection elements.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-autowire" default="no">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'autowire' value; see the documentation for the
+	'autowire' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="no"/>
+						<xsd:enumeration value="byName"/>
+						<xsd:enumeration value="byType"/>
+						<xsd:enumeration value="constructor"/>
+						<xsd:enumeration value="autodetect"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-dependency-check" default="none">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'dependency-check' value; see the documentation for the
+	'dependency-check' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="none"/>
+						<xsd:enumeration value="simple"/>
+						<xsd:enumeration value="objects"/>
+						<xsd:enumeration value="all"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-autowire-candidates" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A default bean name pattern for identifying autowire candidates:
+	e.g. "*Service", "data*", "*Service*", "data*Service".
+	Also accepts a comma-separated list of patterns: e.g. "*Service,*Dao".
+	See the documentation for the 'autowire-candidate' attribute of the
+	'<bean/>' element for the semantic details of autowire candidate beans.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-init-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'init-method' value; see the documentation for the
+	'init-method' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-destroy-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'destroy-method' value; see the documentation for the
+	'destroy-method' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:anyAttribute namespace="##other" processContents="lax"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="description">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains informative text describing the purpose of the enclosing element.
+	Used primarily for user documentation of XML bean definition documents.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="import">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.core.io.Resource"><![CDATA[
+	Specifies an XML bean definition resource to import.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="resource" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The relative resource location of the XML (bean definition) file to import,
+	for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml".
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="alias">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines an alias for a bean (which can reside in a different definition
+	resource).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean to define an alias for.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="alias" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The alias name to define for the bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:group name="beanElements">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="constructor-arg"/>
+				<xsd:element ref="property"/>
+				<xsd:element ref="qualifier"/>
+				<xsd:element ref="lookup-method"/>
+				<xsd:element ref="replaced-method"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:attributeGroup name="beanAttributes">
+		<xsd:attribute name="name" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Can be used to create one or more aliases illegal in an (XML) id.
+	Multiple aliases can be separated by any number of spaces, commas,
+	or semi-colons (or indeed any mixture of the three).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="class" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The fully qualified name of the bean's class, except if it serves only
+	as a parent definition for child bean definitions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="parent" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the parent bean definition.
+
+	Will use the bean class of the parent if none is specified, but can
+	also override it. In the latter case, the child bean class must be
+	compatible with the parent, i.e. accept the parent's property values
+	and constructor argument values, if any.
+
+	A child bean definition will inherit constructor argument values,
+	property values and method overrides from the parent, with the option
+	to add new values. If init method, destroy method, factory bean and/or
+	factory method are specified, they will override the corresponding
+	parent settings.
+
+	The remaining settings will always be taken from the child definition:
+	depends on, autowire mode, dependency check, scope, lazy init.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="scope" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The scope of this bean: typically "singleton" (one shared instance,
+	which will be returned by all calls to getBean with the given id), or
+	"prototype" (independent instance resulting from each call to getBean).
+	Default is "singleton".
+
+	Singletons are most commonly used, and are ideal for multi-threaded
+	service objects. Further scopes, such as "request" or "session", might
+	be supported by extended bean factories (e.g. in a web environment).
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+
+	Inner bean definitions inherit the singleton status of their containing
+	bean definition, unless explicitly specified: The inner bean will be a
+	singleton if the containing bean is a singleton, and a prototype if
+	the containing bean has any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="abstract" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Is this bean "abstract", that is, not meant to be instantiated itself
+	but rather just serving as parent for concrete child bean definitions?
+	The default is "false". Specify "true" to tell the bean factory to not
+	try to instantiate that particular bean in any case.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per abstract bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="lazy-init" default="default" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean is to be lazily initialized.
+	If false, it will be instantiated on startup by bean factories
+	that perform eager initialization of singletons. The default is
+	"false".
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether bean properties are "autowired".
+	This is an automagical process in which bean references don't need
+	to be coded explicitly in the XML bean definition file, but rather the
+	Spring container works out dependencies.
+
+	There are 5 modes:
+
+	1. "no"
+	The traditional Spring default. No automagical wiring. Bean references
+	must be defined in the XML file via the <ref/> element (or "ref"
+	attribute). We recommend this in most cases as it makes documentation
+	more explicit.
+
+	2. "byName"
+	Autowiring by property name. If a bean of class Cat exposes a dog
+	property, Spring will try to set this to the value of the bean "dog"
+	in the current container. If there is no matching bean by name, nothing
+	special happens; use dependency-check="objects" to raise an error in
+	that case.
+
+	3. "byType"
+	Autowiring if there is exactly one bean of the property type in the
+	container. If there is more than one, a fatal error is raised, and
+	you cannot use byType autowiring for that bean. If there is none,
+	nothing special happens; use dependency-check="objects" to raise an
+	error in that case.
+
+	4. "constructor"
+	Analogous to "byType" for constructor arguments. If there is not exactly
+	one bean of the constructor argument type in the bean factory, a fatal
+	error is raised.
+
+	5. "autodetect"
+	Chooses "constructor" or "byType" through introspection of the bean
+	class. If a default constructor is found, "byType" gets applied.
+
+	Note that explicit dependencies, i.e. "property" and "constructor-arg"
+	elements, always override autowiring. Autowire behavior can be combined
+	with dependency checking, which will be performed after all autowiring
+	has been completed.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="no"/>
+					<xsd:enumeration value="byName"/>
+					<xsd:enumeration value="byType"/>
+					<xsd:enumeration value="constructor"/>
+					<xsd:enumeration value="autodetect"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="dependency-check" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether or not to check whether all of this
+	bean's dependencies, expressed in its properties, are satisfied.
+	The default is to perform no dependency checking.
+
+	"simple" type dependency checking includes primitives and String;
+	"objects" includes collaborators (other beans in the factory);
+	"all" includes both types of dependency checking.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="none"/>
+					<xsd:enumeration value="simple"/>
+					<xsd:enumeration value="objects"/>
+					<xsd:enumeration value="all"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="depends-on" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The names of the beans that this bean depends on being initialized.
+	The bean factory will guarantee that these beans get initialized
+	before this bean.
+
+	Note that dependencies are normally expressed through bean properties
+	or constructor arguments. This property should just be necessary for
+	other kinds of dependencies like statics (*ugh*) or database preparation
+	on startup.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire-candidate" default="default" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean should be considered when looking
+	for matching candidates to satisfy another bean's autowiring requirements.
+	Note that this does not affect explicit references by name, which will get
+	resolved even if the specified bean is not marked as an autowire candidate.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="primary" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Specifies that this bean should be given preference when multiple
+	candidates are qualified to autowire a single-valued dependency.
+	If exactly one 'primary' bean exists among the candidates, it
+	will be the autowired value.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="init-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom initialization method to invoke after setting
+	bean properties. The method must have no arguments, but may throw any
+	exception.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="destroy-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom destroy method to invoke on bean factory
+	shutdown. The method must have no arguments, but may throw any
+	exception.
+
+	Note: Only invoked on beans whose lifecycle is under the full
+	control of the factory - which is always the case for singletons,
+	but not guaranteed for any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of a factory method to use to create this object. Use
+	constructor-arg elements to specify arguments to the factory method,
+	if it takes arguments. Autowiring does not apply to factory methods.
+
+	If the "class" attribute is present, the factory method will be a static
+	method on the class specified by the "class" attribute on this bean
+	definition. Often this will be the same class as that of the constructed
+	object - for example, when the factory method is used as an alternative
+	to a constructor. However, it may be on a different class. In that case,
+	the created object will *not* be of the class specified in the "class"
+	attribute. This is analogous to FactoryBean behavior.
+
+	If the "factory-bean" attribute is present, the "class" attribute is not
+	used, and the factory method will be an instance method on the object
+	returned from a getBean call with the specified bean name. The factory
+	bean may be defined as a singleton or a prototype.
+
+	The factory method can have any number of arguments. Autowiring is not
+	supported. Use indexed constructor-arg elements in conjunction with the
+	factory-method attribute.
+
+	Setter Injection can be used in conjunction with a factory method.
+	Method Injection cannot, as the factory method returns an instance,
+	which will be used when the container creates the bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-bean" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Alternative to class attribute for factory-method usage.
+	If this is specified, no class attribute should be used.
+	This must be set to the name of a bean in the current or
+	ancestor factories that contains the relevant factory method.
+	This allows the factory itself to be configured using Dependency
+	Injection, and an instance (rather than static) method to be used.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:attributeGroup>
+
+	<xsd:element name="meta" type="metaType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Arbitrary metadata attached to a bean definition.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:complexType name="metaType">
+		<xsd:attribute name="key" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The key name of the metadata attribute being defined.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The value of the metadata attribute being defined (as a simple String).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<xsd:element name="bean">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.BeanDefinition"><![CDATA[
+	Defines a single (usually named) bean.
+
+	A bean definition may contain nested tags for constructor arguments,
+	property values, lookup methods, and replaced methods. Mixing constructor
+	injection and setter injection on the same bean is explicitly supported.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="identifiedType">
+					<xsd:group ref="beanElements"/>
+					<xsd:attributeGroup ref="beanAttributes"/>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="constructor-arg">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.ConstructorArgumentValues">
+				<![CDATA[
+	Bean definitions can specify zero or more constructor arguments.
+	This is an alternative to "autowire constructor".
+	Arguments correspond to either a specific index of the constructor
+	argument list or are supposed to be matched generically by type.
+
+	Note: A single generic argument value will just be used once, rather
+	than potentially matched multiple times (as of Spring 1.1).
+
+	constructor-arg elements are also used in conjunction with the
+	factory-method element to construct beans using static or instance
+	factory methods.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="1">
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+					<xsd:any namespace="##other" processContents="strict"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="index" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact index of the argument in the constructor argument list.
+	Only needed to avoid ambiguities, e.g. in case of 2 arguments of
+	the exact same type.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type of the constructor argument. Only needed to avoid
+	ambiguities, e.g. in case of 2 single argument constructors
+	that can both be converted from a String.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="ref" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>" element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="value" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...<value/>" element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="property" type="propertyType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Bean definitions can have zero or more properties.
+	Property elements correspond to JavaBean setter methods exposed
+	by the bean classes. Spring supports primitives, references to other
+	beans in the same or related factories, lists, maps and properties.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="qualifier">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Bean definitions can provide qualifiers to match against annotations
+	on a field or parameter for fine-grained autowire candidate resolution.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="attribute" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:sequence>
+			<xsd:attribute name="type" type="xsd:string" default="org.springframework.beans.factory.annotation.Qualifier"/>
+			<xsd:attribute name="value" type="xsd:string"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="attribute" type="metaType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A qualifier element may contain attribute child elements as key-value
+	pairs. These will be available for matching against attributes of a
+	qualifier annotation on an autowired field or parameter if present.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="lookup-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A lookup method causes the IoC container to override the given method
+	and return the bean with the name given in the bean attribute. This is
+	a form of Method Injection. It is particularly useful as an alternative
+	to implementing the BeanFactoryAware interface, in order to be able to
+	make getBean() calls for non-singleton instances at runtime. In this
+	case, Method Injection is a less invasive alternative.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the lookup method. This method must take no arguments.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean in the current or ancestor factories that
+	the lookup method should resolve to. Often this bean will be a
+	prototype, in which case the lookup method will return a distinct
+	instance on every invocation. This is useful for single-threaded objects.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="replaced-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Similar to the lookup method mechanism, the replaced-method element
+	is used to control IoC container method overriding: Method Injection.
+	This mechanism allows the overriding of a method with arbitrary code.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="arg-type"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="name" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The name of the method whose implementation must be replaced by the
+	IoC container. If this method is not overloaded, there is no need
+	to use arg-type subelements. If this method is overloaded, arg-type
+	subelements must be used for all override definitions for the method.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="replacer" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation source="java:org.springframework.beans.factory.support.MethodReplacer"><![CDATA[
+	Bean name of an implementation of the MethodReplacer interface in the
+	current or ancestor factories. This may be a singleton or prototype
+	bean. If it is a prototype, a new instance will be used for each
+	method replacement. Singleton usage is the norm.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="arg-type">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Identifies an argument for a replaced method in the event of
+	method overloading.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="match" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Specification of the type of an overloaded method argument as a String.
+	For convenience, this may be a substring of the FQN. E.g. all the
+	following would match "java.lang.String":
+	- java.lang.String
+	- String
+	- Str
+
+	As the number of arguments will be checked also, this convenience
+	can often be used to save typing.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="ref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines a reference to another bean in this factory or an external
+	factory (parent or included factory).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID and thus can 
+	be checked by the XML parser. This is therefore the preferred technique 
+	for referencing beans within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="parent" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean in a parent factory.
+						]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="idref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The id of another bean in this factory or an external factory
+	(parent or included factory).
+	While a regular 'value' element could instead be used for the
+	same effect, using idref in this case allows validation of local
+	bean ids by the XML parser, and name completion by supporting tools.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID and thus can 
+	be checked by the XML parser. This is therefore the preferred technique 
+	for referencing beans within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="value">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains a string representation of a property value.
+	The property may be a string, or may be converted to the required
+	type using the JavaBeans PropertyEditor machinery. This makes it
+	possible for application developers to write custom PropertyEditor
+	implementations that can convert strings to arbitrary target objects.
+
+	Note that this is recommended for simple objects only. Configure
+	more complex objects by populating JavaBean properties with
+	references to other beans.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type that the value should be converted to. Only needed
+	if the type of the target property or constructor argument is
+	too generic: for example, in case of a collection element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="null">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Denotes a Java null value. Necessary because an empty "value" tag
+	will resolve to an empty String, which will not be resolved to a
+	null value unless a special PropertyEditor does so.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<!-- Collection Elements -->
+	<xsd:group name="collectionElements">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:element name="list">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A list can contain multiple inner bean, ref, collection, or value elements.
+	A list can also map to an array type; the necessary conversion is performed
+	automatically.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="listOrSetType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="set">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A set can contain multiple inner bean, ref, collection, or value elements.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="listOrSetType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="map">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A mapping from a key to an object. Maps may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="mapType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="entry" type="entryType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A map entry can be an inner bean, ref, value, or collection.
+	The key of the entry is given by the "key" attribute or child element.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="props">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Props elements differ from map elements in that values must be strings.
+	Props may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="propsType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="key">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A key element can contain an inner bean, ref, value, or collection.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:group ref="collectionElements"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="prop">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The string value of the property. Note that whitespace is trimmed
+	off to avoid unwanted whitespace caused by typical XML formatting.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="key" type="xsd:string" use="required">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The key of the property entry.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="propertyType">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="1">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict"/>
+			</xsd:choice>
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the property, following JavaBean naming conventions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>" element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Collection Types -->
+
+	<!-- base type for collections that have (possibly) typed nested values -->
+	<xsd:complexType name="collectionType">
+		<xsd:attribute name="value-type" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested values. Must be a fully qualified
+	class name.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- 'list' and 'set' collection type -->
+	<xsd:complexType name="listOrSetType">
+		<xsd:complexContent>
+			<xsd:extension base="collectionType">
+				<xsd:group ref="collectionElements"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'map' element type -->
+	<xsd:complexType name="mapType">
+		<xsd:complexContent>
+			<xsd:extension base="collectionType">
+				<xsd:sequence>
+					<xsd:element ref="description" minOccurs="0"/>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="entry"/>
+					</xsd:choice>
+				</xsd:sequence>
+				<xsd:attribute name="key-type" type="xsd:string">
+					<xsd:annotation>
+						<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested entry keys. Must be a fully qualified
+	class name.
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:attribute>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'entry' element type -->
+	<xsd:complexType name="entryType">
+		<xsd:sequence>
+			<xsd:element ref="key" minOccurs="0"/>
+			<xsd:group ref="collectionElements"/>
+		</xsd:sequence>
+		<xsd:attribute name="key" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Each map element must specify its key as attribute or as child element.
+	A key attribute is always a String value.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="key-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a to a "key" element with a nested
+	"<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>"
+	element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- 'props' collection type -->
+	<xsd:complexType name="propsType">
+		<xsd:complexContent>
+			<xsd:extension base="collectionType">
+				<xsd:sequence>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="prop"/>
+					</xsd:choice>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- simple internal types -->
+	<xsd:simpleType name="defaultable-boolean">
+		<xsd:restriction base="xsd:NMTOKEN">
+			<xsd:enumeration value="default"/>
+			<xsd:enumeration value="true"/>
+			<xsd:enumeration value="false"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/Duplicates.dtd b/xml/tests/testData/xml/Duplicates.dtd
new file mode 100644
index 0000000..7eb246a
--- /dev/null
+++ b/xml/tests/testData/xml/Duplicates.dtd
@@ -0,0 +1,3 @@
+<!ELEMENT document EMPTY>
+<!ELEMENT <error>document2</error> EMPTY>
+<!ELEMENT <error>document2</error> EMPTY>
diff --git a/xml/tests/testData/xml/Duplicates.xml b/xml/tests/testData/xml/Duplicates.xml
new file mode 100644
index 0000000..dbd785f
--- /dev/null
+++ b/xml/tests/testData/xml/Duplicates.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE document [
+  <!ELEMENT document (#PCDATA)>
+  <error><!ELEMENT document (#PCDATA)></error>
+  ]>
+<document>
+
+</document>
diff --git a/xml/tests/testData/xml/Duplicates.xsd b/xml/tests/testData/xml/Duplicates.xsd
new file mode 100644
index 0000000..49a7f28
--- /dev/null
+++ b/xml/tests/testData/xml/Duplicates.xsd
@@ -0,0 +1,16 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="zzz" xmlns="zzz">
+  <xsd:element name=<error>"e"</error> type="xsd:string"/>
+  <xsd:element name=<error>"e"</error> type="xsd:decimal"/>
+  <xsd:attribute name=<error>"a"</error> type="xsd:decimal"/>
+  <xsd:attribute name=<error>"a"</error> type="xsd:string"/>
+
+  <xsd:complexType name="aaa">
+    <xsd:sequence>
+      <xsd:element name=<error>"e2"</error> type="xsd:string"/>
+      <xsd:element name=<error>"e2"</error> type="xsd:decimal"/>
+    </xsd:sequence>
+    <xsd:attribute name=<error>"a2"</error> type="xsd:decimal"/>
+    <xsd:attribute name=<error>"a2"</error> type="xsd:string"/>
+  </xsd:complexType>
+  <xsd:element name="aaa" type="aaa"/>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/EmptyNSRef.xml b/xml/tests/testData/xml/EmptyNSRef.xml
new file mode 100644
index 0000000..28b7fe6
--- /dev/null
+++ b/xml/tests/testData/xml/EmptyNSRef.xml
@@ -0,0 +1,7 @@
+<section xmlns='<error>urn:com:books-r-us</error>'>
+   <title>Book-Signing Event</title>
+   <signing xmlns=''>
+     <author title="Mr" name="Vikram Seth" />
+     <book title="A Suitable Boy" price="$22.95" />
+   </signing>
+</section>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/Encoding.xml b/xml/tests/testData/xml/Encoding.xml
new file mode 100644
index 0000000..1153e4e
--- /dev/null
+++ b/xml/tests/testData/xml/Encoding.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="<error descr="Unknown encoding: 'Foo'">Foo</error>"?>
+ <x/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/EntityHighlighting.xml b/xml/tests/testData/xml/EntityHighlighting.xml
new file mode 100644
index 0000000..b8c7a16
--- /dev/null
+++ b/xml/tests/testData/xml/EntityHighlighting.xml
@@ -0,0 +1,8 @@
+<!DOCTYPE a [
+<!ELEMENT a (#PCDATA)>
+<!ENTITY nbsp2 "!!!" >  
+]>
+<a>
+  &<error>nbsp1</error>;
+  &nbsp2;
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/EntityHighlighting2.xml b/xml/tests/testData/xml/EntityHighlighting2.xml
new file mode 100644
index 0000000..1de07ff
--- /dev/null
+++ b/xml/tests/testData/xml/EntityHighlighting2.xml
@@ -0,0 +1,19 @@
+<!DOCTYPE a [
+<!ELEMENT a (#PCDATA)>
+<!ENTITY nbsp SYSTEM "EntityHighlighting2.xml" >
+<!ENTITY nbsp2 SYSTEM "file:./EntityHighlighting2.xml" >
+<!ENTITY nbsp3 SYSTEM "<error>!!!</error>" > 
+<!ENTITY nbsp4 PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+   SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">  
+<!ENTITY nbsp5 PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+   "<error>_EntityHighlighting.xml</error>">
+  <!ENTITY nbsp6 PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+   "EntityHighlighting2.xml">
+  <!ENTITY nbsp7 PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+  <!ENTITY nbsp7 PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+   "<error>urn:myurn</error>">
+]>
+<a>
+  &nbsp2;
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/EntityRefBadFormat.xml b/xml/tests/testData/xml/EntityRefBadFormat.xml
new file mode 100644
index 0000000..54d8e4f
--- /dev/null
+++ b/xml/tests/testData/xml/EntityRefBadFormat.xml
@@ -0,0 +1,5 @@
+<root>
+
+    <a>&#xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;</a>
+
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/EntityRefWithEmptyDtd.xml b/xml/tests/testData/xml/EntityRefWithEmptyDtd.xml
new file mode 100644
index 0000000..5db0649
--- /dev/null
+++ b/xml/tests/testData/xml/EntityRefWithEmptyDtd.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE tag [
+   <!ENTITY our2 SYSTEM "EntityRefWithEmptyDtd.xml">
+   %<error>our</error>;
+]>
+<tag id="&<error>our</error>;">
+  &<error>our</error>;
+</tag>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/EntityRefWithNoDtd.xml b/xml/tests/testData/xml/EntityRefWithNoDtd.xml
new file mode 100644
index 0000000..01e587b
--- /dev/null
+++ b/xml/tests/testData/xml/EntityRefWithNoDtd.xml
@@ -0,0 +1,3 @@
+<aaa>
+  &<error>xxx</error>;
+</aaa>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/EnumeratedAttributesValidation.xsd b/xml/tests/testData/xml/EnumeratedAttributesValidation.xsd
new file mode 100644
index 0000000..55e4e51
--- /dev/null
+++ b/xml/tests/testData/xml/EnumeratedAttributesValidation.xsd
@@ -0,0 +1,13 @@
+<xsd:schema
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    elementFormDefault="qualified">
+
+<xsd:element name = "plugin">
+    <xsd:complexType> <!-- content only! -->
+      <xsd:sequence>
+        <xsd:element ref = "<error>params</error>" minOccurs = "0" maxOccurs = "1"/>
+      </xsd:sequence>
+    </xsd:complexType>
+  </xsd:element>
+  
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ErrorInDtd.xml b/xml/tests/testData/xml/ErrorInDtd.xml
new file mode 100644
index 0000000..85fd23b
--- /dev/null
+++ b/xml/tests/testData/xml/ErrorInDtd.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+    <xsl:template match="/">
+    </xsl:template>
+    <xsl:template match="/">
+    </xsl:template>
+    <xsl:template match="/">
+    </xsl:template>
+    <xsl:template match="/">
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ExternalValidatorOnValidXmlWithNamespacesNotSetup.xml b/xml/tests/testData/xml/ExternalValidatorOnValidXmlWithNamespacesNotSetup.xml
new file mode 100644
index 0000000..a9e37eb
--- /dev/null
+++ b/xml/tests/testData/xml/ExternalValidatorOnValidXmlWithNamespacesNotSetup.xml
@@ -0,0 +1,10 @@
+<deployment xmlns="http://xml.apache.org/axis/wsdd2/"
+xmlns:java="http://xml.apache.org/axis/wsdd2/providers/java">
+    <service name="AuthService" provider="java:RPC">
+    <parameter name="className" value="com.td.atp.auth.ws.Authenticator"/>
+    <parameter name="allowedMethods" value="*"/>
+    </service>
+
+  <beanMapping xmlns:ns="http://soapinterop.org/xsd2" qname="ns:AuthRequest" languageSpecificType="java:com.td.atp.auth.ws.AuthRequest"/>
+  <beanMapping xmlns:ns="http://soapinterop.org/xsd2" qname="ns:AuthResponse" languageSpecificType="java:com.td.atp.auth.ws.AuthResponse"/>
+</deployment>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ExternalValidatorOnValidXmlWithNamespacesNotSetup2.xml b/xml/tests/testData/xml/ExternalValidatorOnValidXmlWithNamespacesNotSetup2.xml
new file mode 100644
index 0000000..9f40898
--- /dev/null
+++ b/xml/tests/testData/xml/ExternalValidatorOnValidXmlWithNamespacesNotSetup2.xml
@@ -0,0 +1,9 @@
+<deployment xmlns:xxx="">
+    <service name="AuthService" provider="java:RPC">
+    <parameter name="className" value="com.td.atp.auth.ws.Authenticator"/>
+    <parameter name="allowedMethods" value="*"/>
+    </service>
+
+  <beanMapping qname="ns:AuthRequest" languageSpecificType="java:com.td.atp.auth.ws.AuthRequest"/>
+  <beanMapping qname="ns:AuthResponse" languageSpecificType="java:com.td.atp.auth.ws.AuthResponse"/>
+</deployment>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/FinancialReportProcess.bpmn20.xml b/xml/tests/testData/xml/FinancialReportProcess.bpmn20.xml
new file mode 100644
index 0000000..8d7e271
--- /dev/null
+++ b/xml/tests/testData/xml/FinancialReportProcess.bpmn20.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<definitions id="definitions"
+	targetNamespace="http://activiti.org/bpmn20" 
+        xmlns:activiti="<error descr="URI is not registered (Settings | Project Settings | Schemas and DTDs)">http://activiti.org/bpmn</error>"
+	xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
+	
+   <process id="financialReport" name="Monthly financial report process">
+	
+		<startEvent id="theStart" />
+		
+		<sequenceFlow id="flow1" sourceRef="theStart" targetRef="writeReportTask" />
+		
+		<userTask id="writeReportTask" name="Write monthly financial report" >
+		  <documentation>
+        Write monthly financial report for publication to shareholders.
+      </documentation>
+      <potentialOwner>
+        <resourceAssignmentExpression>
+          <formalExpression>accountancy</formalExpression>
+        </resourceAssignmentExpression>
+      </potentialOwner>
+		</userTask>
+		
+		<sequenceFlow id="flow2" sourceRef="writeReportTask" targetRef="verifyReportTask" />
+			
+		<userTask id="verifyReportTask" name="Verify monthly financial report" >
+		  <documentation>
+        Verify monthly financial report composed by the accountancy department.
+        This financial report is going to be sent to all the company shareholders.  
+      </documentation>
+      <potentialOwner>
+        <resourceAssignmentExpression>
+          <formalExpression>management</formalExpression>
+        </resourceAssignmentExpression>
+      </potentialOwner>
+		</userTask>
+		
+		<sequenceFlow id="flow3" sourceRef="verifyReportTask" targetRef="theEnd" />
+			
+		<endEvent id="theEnd" />
+			
+	</process>
+	
+</definitions>
diff --git a/xml/tests/testData/xml/Forms.xsd b/xml/tests/testData/xml/Forms.xsd
new file mode 100644
index 0000000..f42d02c
--- /dev/null
+++ b/xml/tests/testData/xml/Forms.xsd
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:element name="forms" type="xs:string"/>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/HighlightWhenNoNsSchemaLocation.xml b/xml/tests/testData/xml/HighlightWhenNoNsSchemaLocation.xml
new file mode 100644
index 0000000..c9f2474
--- /dev/null
+++ b/xml/tests/testData/xml/HighlightWhenNoNsSchemaLocation.xml
@@ -0,0 +1,4 @@
+<build number="1" xsi:noNamespaceSchemaLocation="HighlightWhenNoNsSchemaLocation.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<statusInfo status="SUCCESS"/>
+<statusInfo status=<error>"SUCCESS2"</error>/>
+</build>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/HighlightWhenNoNsSchemaLocation.xsd b/xml/tests/testData/xml/HighlightWhenNoNsSchemaLocation.xsd
new file mode 100644
index 0000000..da7cefa
--- /dev/null
+++ b/xml/tests/testData/xml/HighlightWhenNoNsSchemaLocation.xsd
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema version="1.0"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+  >
+  <xsd:element name="build" type="buildType" />
+
+  <xsd:complexType name="buildType" mixed="true">
+    <xsd:sequence>
+      <xsd:element name="statusInfo" type="statusInfoType" minOccurs="0" />
+      <xsd:element name="statsValue" type="statsValueType" maxOccurs="unbounded" minOccurs="0" />
+    </xsd:sequence>
+    <xsd:attribute name="number" type="xsd:string" />
+  </xsd:complexType>
+
+  <xsd:complexType name="statsValueType">
+    <xsd:attribute name="key" type="xsd:string" />
+    <xsd:attribute name="value" type="xsd:decimal" />
+  </xsd:complexType>
+
+  <xsd:complexType name="statusInfoType">
+    <xsd:sequence>
+      <xsd:element name="text" type="statusInfoTextType" maxOccurs="unbounded" minOccurs="0" />
+    </xsd:sequence>
+    <xsd:attribute name="status" type="statusType"/>
+  </xsd:complexType>
+
+  <xsd:complexType name="statusInfoTextType" mixed="true">
+    <xsd:attribute name="action" type="actionType" />
+  </xsd:complexType>
+
+  <xsd:simpleType name="actionType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="prepend"/>
+      <xsd:enumeration value="append"/>
+      <xsd:enumeration value="replace"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <xsd:simpleType name="statusType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="SUCCESS"/>
+      <xsd:enumeration value="NORMAL"/>
+      <xsd:enumeration value="FAILURE"/>
+      <xsd:enumeration value="ERROR"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/HighlightingWithConditionalSectionsInDtd.dtd b/xml/tests/testData/xml/HighlightingWithConditionalSectionsInDtd.dtd
new file mode 100644
index 0000000..6cfeb16
--- /dev/null
+++ b/xml/tests/testData/xml/HighlightingWithConditionalSectionsInDtd.dtd
@@ -0,0 +1,12 @@
+<![%draft;[
+<!ELEMENT book (comments*, title, body, supplements?)>
+<!ELEMENT comments EMPTY>
+]]>
+<![%final;[
+<!ELEMENT book (price,title, body, supplements?)>
+<!ELEMENT price EMPTY>
+]]>
+
+<!ELEMENT title EMPTY>
+<!ELEMENT body EMPTY>
+<!ELEMENT supplements EMPTY>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/HighlightingWithConditionalSectionsInDtd.xml b/xml/tests/testData/xml/HighlightingWithConditionalSectionsInDtd.xml
new file mode 100644
index 0000000..4690ebc
--- /dev/null
+++ b/xml/tests/testData/xml/HighlightingWithConditionalSectionsInDtd.xml
@@ -0,0 +1,13 @@
+<!DOCTYPE book [
+  <!ENTITY % draft 'INCLUDE' >
+  <!ENTITY % final 'IGNORE' >
+  <!ENTITY MY SYSTEM 'HighlightingWithConditionalSectionsInDtd.dtd'>
+  %MY;
+]>
+<book>
+  <comments> aaa </comments>
+  <<error>price</error>> aaa </<error>price</error>>
+  <title> bbb </title>
+  <body> bbb </body>
+  <supplements> bbb </supplements>
+</book>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/HighlightingWithConditionalSectionsInDtd2.xml b/xml/tests/testData/xml/HighlightingWithConditionalSectionsInDtd2.xml
new file mode 100644
index 0000000..f9f84b5
--- /dev/null
+++ b/xml/tests/testData/xml/HighlightingWithConditionalSectionsInDtd2.xml
@@ -0,0 +1,12 @@
+<!DOCTYPE book [
+  <!ENTITY % draft 'IGNORE' >
+  <!ENTITY % final 'INCLUDE' >
+  <!ENTITY MY SYSTEM 'HighlightingWithConditionalSectionsInDtd.dtd'>
+  %MY;
+]>
+<book>
+  <<error>comments</error>> aaa </<error>comments</error>>
+  <title> bbb </title>
+  <body> bbb </body>
+  <supplements> bbb </supplements>
+</book>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/IgnoredNamespaceHighlighting.xml b/xml/tests/testData/xml/IgnoredNamespaceHighlighting.xml
new file mode 100644
index 0000000..a0d84e1
--- /dev/null
+++ b/xml/tests/testData/xml/IgnoredNamespaceHighlighting.xml
@@ -0,0 +1,7 @@
+<mine:template xmlns="http://www.w3.org/1999/xhtml" xmlns:mine="http://ignored/uri">
+     <div>
+         <mine:tag type="">
+             <div />
+         </mine:tag>
+     </div>
+</mine:template>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ImportProblems.xsd b/xml/tests/testData/xml/ImportProblems.xsd
new file mode 100644
index 0000000..d9e3708
--- /dev/null
+++ b/xml/tests/testData/xml/ImportProblems.xsd
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.ivtest/iv" xmlns:iv="http://www.ivtest/iv">
+  <xs:import schemaLocation="ImportProblems2.xsd"/>
+  <xs:element name="InfiView">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Component"/>
+        <xs:element ref="iv:viewport"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="viewport">
+    <xs:complexType/>
+  </xs:element>
+</xs:schema>
diff --git a/xml/tests/testData/xml/ImportProblems2.xsd b/xml/tests/testData/xml/ImportProblems2.xsd
new file mode 100644
index 0000000..38de9a8
--- /dev/null
+++ b/xml/tests/testData/xml/ImportProblems2.xsd
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:iv="http://www.ivtest/iv">
+  <xs:import namespace="http://www.ivtest/iv" schemaLocation="ImportProblems.xsd"/>
+  <xs:element name="Application">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Window"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Window">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Component"/>
+        <xs:element ref="Label"/>
+        <xs:element ref="iv:InfiView"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Label">
+    <xs:complexType/>
+  </xs:element>
+  <xs:element name="Component">
+    <xs:complexType/>
+  </xs:element>
+</xs:schema>
diff --git a/xml/tests/testData/xml/InvalidIdRefAttribute.xml b/xml/tests/testData/xml/InvalidIdRefAttribute.xml
new file mode 100644
index 0000000..4a9c399
--- /dev/null
+++ b/xml/tests/testData/xml/InvalidIdRefAttribute.xml
@@ -0,0 +1,8 @@
+<!DOCTYPE tv [ <!ELEMENT tv (date)*> <!ELEMENT date (#PCDATA)> <!ATTLIST date idref IDREF #IMPLIED id ID #IMPLIED>]>
+
+<tv>
+  <date idref=<error>"aaa"</error> id="bbb"/>
+  <date idref="bbb"/>
+  <date idref="ccc"/>
+  <date id="ccc"/>
+</tv>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/InvalidIdRefInXsl.xml b/xml/tests/testData/xml/InvalidIdRefInXsl.xml
new file mode 100644
index 0000000..5520ca8
--- /dev/null
+++ b/xml/tests/testData/xml/InvalidIdRefInXsl.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns="http://www.w3.org/1999/xhtml"
+    >
+    <xsl:output method="xml"/>
+    <xsl:template match="a">
+        <div id="{@id}"></div>
+        <input type="{@type}" />
+    </xsl:template>
+
+    <xsl:template match="b">
+        <div id="{@id}"></div>
+    </xsl:template>
+</xsl:stylesheet>
diff --git a/xml/tests/testData/xml/ManyRootTags.xml b/xml/tests/testData/xml/ManyRootTags.xml
new file mode 100644
index 0000000..cc3fb75
--- /dev/null
+++ b/xml/tests/testData/xml/ManyRootTags.xml
@@ -0,0 +1,2 @@
+<child attrib="whatever"/>
+<error><</error>child/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/MappedSchemaLocation.xml b/xml/tests/testData/xml/MappedSchemaLocation.xml
new file mode 100644
index 0000000..556b857
--- /dev/null
+++ b/xml/tests/testData/xml/MappedSchemaLocation.xml
@@ -0,0 +1,8 @@
+<forms
+
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
+        xsi:noNamespaceSchemaLocation="schemas/Forms.xsd">
+
+
+</forms>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/MavenValidation.xml b/xml/tests/testData/xml/MavenValidation.xml
new file mode 100644
index 0000000..6fda86a
--- /dev/null
+++ b/xml/tests/testData/xml/MavenValidation.xml
@@ -0,0 +1,310 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>dk.pfa</groupId>
+  <artifactId>OtherApps</artifactId>
+  <packaging>war</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>Maven Quick Start Archetype</name>
+  <url>http://maven.apache.org</url>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+      <plugin>
+
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <configuration>
+              <tasks>
+
+                <property name="maven.compile.classpath"
+                          value="${maven.compile.classpath};C:/bea/weblogic91/server/lib/weblogic.jar"/>
+                <property name="maven.runtime.classpath"
+                          value="${maven.runtime.classpath};C:/bea/weblogic91/server/lib/weblogic.jar"/>
+                <!--
+                <classpath>
+                    <pathelement path="${classpath}"/>
+                    <pathelement path="C:/bea/weblogic91/server/lib/weblogic.jar"/>
+                </classpath>
+                -->
+                <property name="cp5" refid="maven.compile.classpath"/>
+                <echo message="maven.plugin.classpath is ${cp5}"/>
+                <echo message=""/>
+
+                <property name="wls.username" value="weblogic"/>
+                <property name="wls.password" value="weblogic"/>
+                <property name="wls.hostname" value="10.131.20.56"/>
+                <property name="wls.port" value="7001"/>
+                <property name="wls.server.name" value="myserver"/>
+
+                <property name="ear.deployed.name" value="upgradePOJOEar"/>
+                <property name="example-output" value="output"/>
+                <property name="ear-dir" value="${example-output}/upgradePOJOEar"/>
+
+                <taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask"
+                         classpathref="maven.compile.classpath"/>
+                <taskdef name="wldeploy" classname="weblogic.ant.taskdefs.management.WLDeploy"
+                         classpathref="maven.compile.classpath"/>
+                <wldeploy action="deploy" name="OtherApps"
+                          source="target/OtherApps-1.0-SNAPSHOT.war" user="weblogic"
+                          password="weblogic" verbose="true"
+                          adminurl="t3://localhost:7001"
+                          targets="AdminServer"/>
+              </tasks>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+
+  <repositories>
+    <repository>
+      <id>LocalPFArep333</id>
+      <name>Local PFA rep</name>
+      <url>http://tp-VPC4890.pfae3.csc.dk:9999/repository</url>
+      <releases>
+        <checksumPolicy>false</checksumPolicy>
+        <updatePolicy>never</updatePolicy>
+      </releases>
+    </repository>
+    <repository>
+      <id>Ibiblo</id>
+      <name>Ibiblo rep</name>
+      <url>http://www.ibiblio.org/maven2</url>
+      <releases>
+        <checksumPolicy>false</checksumPolicy>
+        <updatePolicy>never</updatePolicy>
+      </releases>
+    </repository>
+  </repositories>
+  <pluginRepositories>
+    <pluginRepository>
+      <releases>
+        <updatePolicy>never</updatePolicy>
+      </releases>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+      <id>ibib</id>
+      <name>ibib</name>
+      <url>http://www.ibiblio.org/maven2</url>
+    </pluginRepository>
+  </pluginRepositories>
+
+
+  <dependencies>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.0</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.easymock</groupId>
+      <artifactId>easymock</artifactId>
+      <version>2.2</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>weblogic</groupId>
+      <artifactId>weblogic</artifactId>
+      <version>9.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>otherapps</groupId>
+      <artifactId>otherapps-siGeneratedXmlbeans</artifactId>
+      <version>1.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache</groupId>
+      <artifactId>xmlbeans</artifactId>
+      <version>2.1.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>oracle</groupId>
+      <artifactId>oracle-jdbc</artifactId>
+      <version>10.1.0.2.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.9</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring</artifactId>
+      <version>1.2.7</version>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.transaction</groupId>
+      <artifactId>jta</artifactId>
+      <version>1.0.1B</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <version>2.1.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>xml-apis</groupId>
+      <artifactId>xml-apis</artifactId>
+      <version>1.0.b2</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>1.0-b1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>ehcache</groupId>
+      <artifactId>ehcache</artifactId>
+      <version>1.1</version>
+    </dependency>
+
+
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0.4</version>
+    </dependency>
+
+    <dependency>
+      <groupId>cglib</groupId>
+      <artifactId>cglib</artifactId>
+      <version>2.1_3</version>
+    </dependency>
+
+    <dependency>
+      <groupId>asm</groupId>
+      <artifactId>asm</artifactId>
+      <version>1.5.3</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <version>2.1.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>antlr</groupId>
+      <artifactId>antlr</artifactId>
+      <version>2.7.6rc1</version>
+    </dependency>
+
+
+    <dependency>
+      <groupId>lucene</groupId>
+      <artifactId>lucene</artifactId>
+      <version>1.4.3</version>
+      <optional>true</optional>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.persistence</groupId>
+      <artifactId>ejb</artifactId>
+      <version>3.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate</artifactId>
+      <version>3.2</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate-annotations</artifactId>
+      <version>3.1beta9</version>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.sql</groupId>
+      <artifactId>jdbc-stdext</artifactId>
+      <version>2.0</version>
+    </dependency>
+
+
+    <dependency>
+      <groupId>dom4j</groupId>
+      <artifactId>dom4j</artifactId>
+      <version>1.6</version>
+      <exclusions>
+        <exclusion>
+          <groupId>jaxme</groupId>
+          <artifactId>jaxme-api</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>jaxen</groupId>
+          <artifactId>jaxen</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>msv</groupId>
+          <artifactId>xsdlib</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>msv</groupId>
+          <artifactId>relaxngDatatype</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>pull-parser</groupId>
+          <artifactId>pull-parser</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>xpp3</groupId>
+          <artifactId>xpp3</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>stax</groupId>
+          <artifactId>stax-api</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>xml-apis</groupId>
+          <artifactId>xml-apis</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>junitperf</groupId>
+          <artifactId>junitperf</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>stax</groupId>
+          <artifactId>stax-ri</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>xalan</groupId>
+          <artifactId>xalan</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
+
+  </dependencies>
+</project>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/MinMaxOccursInSchema.xsd b/xml/tests/testData/xml/MinMaxOccursInSchema.xsd
new file mode 100644
index 0000000..0122c5c
--- /dev/null
+++ b/xml/tests/testData/xml/MinMaxOccursInSchema.xsd
@@ -0,0 +1,7 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="zzz" xmlns="zzz">
+  <xsd:complexType name="xxx">
+    <xsd:sequence>
+      <xsd:element name="e" type="xsd:string" minOccurs="1" maxOccurs=<error>"0"</error>/>
+    </xsd:sequence>
+  </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/MobileHtml.html b/xml/tests/testData/xml/MobileHtml.html
new file mode 100644
index 0000000..d5dce2f
--- /dev/null
+++ b/xml/tests/testData/xml/MobileHtml.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
+        "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
+
+<html>
+<body>
+<div></div>
+<p></p>
+<<warning descr="Unknown html tag unknown">unknown</warning>></<warning descr="Unknown html tag unknown">unknown</warning>>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/MuleConfigHighlighting.xml b/xml/tests/testData/xml/MuleConfigHighlighting.xml
new file mode 100644
index 0000000..cc64506
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigHighlighting.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mule xmlns="http://www.mulesource.org/schema/mule/core/2.0"
+      xmlns:management="http://www.mulesource.org/schema/mule/management/2.0"
+      xmlns:spring="http://www.springframework.org/schema/beans"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
+      xsi:schemaLocation="http://www.mulesource.org/schema/mule/core/2.0 mule.xsd
+        http://www.mulesource.org/schema/mule/management/2.0 mule-management.xsd
+        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+    <management:jmx-server createServer="true"/>
+</mule>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/MuleConfigHighlighting2.xml b/xml/tests/testData/xml/MuleConfigHighlighting2.xml
new file mode 100644
index 0000000..d3413d4
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigHighlighting2.xml
@@ -0,0 +1,19 @@
+<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:spring="http://www.springframework.org/schema/beans"
+xmlns:cxf="http://www.mulesource.org/schema/mule/cxf/2.2"
+xsi:schemaLocation="http://www.springframework.org/schema/beans
+http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+http://www.mulesource.org/schema/mule/core/2.2
+mule2_2.xsd
+http://www.mulesource.org/schema/mule/cxf/2.2
+mule2_2-cxf.xsd">
+<model name="CxfExample">
+  <service name="helloService">
+    <inbound>
+      <cxf:inbound-endpoint serviceName=""
+address="http://localhost:${mule.webservice.port}/${mule.wsdl.endpoint}"
+wsdlLocation="FooSvc.wsdl"/>
+    </inbound>
+</service>
+</model>
+</mule>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/MuleConfigHighlighting2/cxf-beans.xsd b/xml/tests/testData/xml/MuleConfigHighlighting2/cxf-beans.xsd
new file mode 100644
index 0000000..83cc543
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigHighlighting2/cxf-beans.xsd
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you 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.
+-->
+
+<xsd:schema
+    targetNamespace="http://cxf.apache.org/configuration/beans"
+    xmlns:tns="http://cxf.apache.org/configuration/beans"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified">
+
+
+    <xsd:attributeGroup name="beanAttributes">
+	<xsd:attribute name="name" type="xsd:string">
+	    <xsd:annotation>
+	        <xsd:documentation>
+	            A unique identifier for the bean. This can also be a list of identifiers.
+                    See documentation for attribute name in attribute group beanAttributes
+                    in http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="abstract" type="xsd:boolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Specifies if the bean is an abstract bean. Abstract beans act as parents for
+                    concrete bean definitions and are not instantiated. The default is "false".
+                    Setting this to "true" instructs the bean factory not to instantiate the bean.
+                    See documentation for attribute abstract in attribute group beanAttributes
+                    in http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="depends-on" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A list of beans that the bean depends on being instantiated before it
+                    can be instantiated.
+                    See documentation for attribute depends-on in attribute group beanAttributes
+                    in http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="createdFromAPI" type="xsd:boolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Specifies that the user created that bean using CXF APIs like
+                    Endpoint.publish or Service.getPort.
+                    The default is "false".
+                    Setting this to "true" does the following: Changes the internal name of the
+                    bean by appending either ".jaxws-client" or ".jaxws-endpoint" to the bean's
+                    id. Makes the bean abstract.
+                    See documentation for attribute abstract in attribute group beanAttributes
+                    in http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:complexType name="ClassOrBeanType">
+       <xsd:attribute name="class" type="xsd:string"/>
+       <xsd:attribute name="bean"  type="xsd:string"/>
+    </xsd:complexType>
+
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/MuleConfigHighlighting2/cxf_core.xsd b/xml/tests/testData/xml/MuleConfigHighlighting2/cxf_core.xsd
new file mode 100644
index 0000000..045a0f3
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigHighlighting2/cxf_core.xsd
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you 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.
+-->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:beans="http://www.springframework.org/schema/beans"
+  xmlns:cxf-beans="http://cxf.apache.org/configuration/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  targetNamespace="http://cxf.apache.org/core"
+  elementFormDefault="qualified"
+  attributeFormDefault="unqualified"  >
+
+  <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans.xsd"/>
+  <xsd:import namespace="http://cxf.apache.org/configuration/beans" schemaLocation="cxf-beans.xsd"/>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      This schema defines beans representing the CXF bus and its core features.
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:element name="logging">
+    <xsd:annotation>
+      <xsd:documentation>
+        The logging feature enables you to log the content of inbound and outbound messages and faults.
+        The content is logged by all log handlers configured in your java.util.logging configuration file,
+        provided the log level for classes org.apache.cxf.interceptor.LoggingInInterceptor and
+        org.apache.cxf.interceptor.LoggingOutInterceptor is at least INFO.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexType>
+      <xsd:sequence />
+      <xsd:attribute name="limit" type="xsd:int" use="optional" default="102400"/>
+      <xsd:attribute name="id" type="xsd:string" use="optional"/>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:element name="fastinfoset">
+    <xsd:annotation>
+      <xsd:documentation>
+        The fastinfoset feature enables you to turn on using fastinfoset encoding of
+        xml payloads.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexType>
+      <xsd:sequence />
+      <xsd:attribute name="force" type="xsd:boolean" use="optional" default="false"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <xsd:element name="bus">
+    <xsd:complexType>
+      <xsd:all>
+        <xsd:element name="features" type="xsd:anyType" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>
+                The list of features that are applied to the bus.
+                Child elements of this element must be beans whose bean class extends
+                org.apache.cxf.AbstractFeature, or references to such beans.
+            </xsd:documentation>
+        </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>
+                The list of interceptors that the bus contributes to all inbound message interceptor chains.
+                Child elements of this element must be beans whose bean class implements
+                org.apache.cxf.Interceptor, or references to such beans.
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="inFaultInterceptors" type="xsd:anyType" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>
+                The list of interceptors that the bus contributes to all inbound fault interceptor chains.
+                Child elements of this element must be beans whose bean class implements
+                org.apache.cxf.Interceptor, or references to such beans.
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="outInterceptors" type="xsd:anyType" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>
+                The list of interceptors that the bus contributes to all outbound message interceptor chains.
+                Child elements of this element must be beans whose bean class implements
+                org.apache.cxf.Interceptor, or references to such beans.
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="outFaultInterceptors" type="xsd:anyType" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>
+                The list of interceptors that the bus contributes to all outbound fault interceptor chains.
+                Child elements of this element must be beans whose bean class implements
+                org.apache.cxf.Interceptor, or references to such beans.
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="properties" type="beans:mapType" minOccurs="0">
+            <xsd:annotation>
+                <xsd:documentation>Specifies a map of properties that are passed to the bus.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:element>
+      </xsd:all>
+      <xsd:attributeGroup ref="cxf-beans:beanAttributes"/>
+    </xsd:complexType>
+  </xsd:element>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/MuleConfigHighlighting2/mule2_2-cxf.xsd b/xml/tests/testData/xml/MuleConfigHighlighting2/mule2_2-cxf.xsd
new file mode 100644
index 0000000..65ee6f4
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigHighlighting2/mule2_2-cxf.xsd
@@ -0,0 +1,414 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/cxf/2.2"
+            xmlns:cxf="http://cxf.apache.org/core"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:mule="http://www.mulesource.org/schema/mule/core/2.2"
+            xmlns:schemadoc="http://www.mulesource.org/schema/mule/schemadoc/2.2"
+            xmlns:beans="http://www.springframework.org/schema/beans"
+            targetNamespace="http://www.mulesource.org/schema/mule/cxf/2.2"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+    <xsd:import namespace="http://www.springframework.org/schema/beans"
+                schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"/>
+    <xsd:import namespace="http://www.mulesource.org/schema/mule/core/2.2"
+                schemaLocation="mule2_2.xsd"/>
+    <xsd:import namespace="http://cxf.apache.org/core"
+                schemaLocation="cxf_core.xsd"/>
+    <xsd:import namespace = "http://www.mulesource.org/schema/mule/schemadoc/2.2"
+                schemaLocation = "mule2_2-schemadoc.xsd"/>
+
+    <xsd:annotation>
+        <xsd:documentation>
+            Apache CXF is an open source services framework. CXF helps you build and develop services using frontend programming APIs, like JAX-WS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a variety of transports such as HTTP, JMS or JBI. The Mule CXF Transport is an evolution of Mule's XFire transport, which provided support for the use of web service integration via Apache CXF. The Mule CXF connector also provides support for WS-Security, WS-Addressing, and WS-Reliable-Messaging.
+        </xsd:documentation>
+
+        <xsd:appinfo>
+            <schemadoc:short-name>CXF</schemadoc:short-name>
+            <schemadoc:page-title>CXF Transport</schemadoc:page-title>
+
+            <schemadoc:transport-features receiveEvents="true" dispatchEvents="true" responseEvents="true"
+                                          requestEvents="true"
+                                          transactions="false" streaming="true">
+                <schemadoc:inboundMEPs in-only="true" in-out="true" in-optional-out="true"/>
+                <schemadoc:outboundMEPs out-only="true" out-in="true" out-optional-in="true"/>
+            </schemadoc:transport-features>
+        </xsd:appinfo>
+    </xsd:annotation>
+
+    <xsd:element name="connector" type="cxfConnectorType" substitutionGroup="mule:abstract-connector"/>
+    <xsd:complexType name="cxfConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:connectorType">
+                <xsd:attribute name="defaultFrontend" type="xsd:string" default="jaxws">
+                   <xsd:annotation>
+                        <xsd:documentation>
+                            The CXF frontend that is used to build an internal service representation from your Java classes. The default is "jaxws". The "simple" frontend is also supported.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="configurationLocation" type="xsd:string">
+                    <xsd:annotation>
+                         <xsd:documentation>
+                             The location of a CXF configuration file, if any needs to be supplied.
+                         </xsd:documentation>
+                     </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="initializeStaticBusInstance" type="mule:substitutableBoolean" default="true">
+                    <xsd:annotation>
+                         <xsd:documentation>
+                             Initialize the static CXF Bus with a Bus configured to use Mule for all transports. This will affect any CXF generated clients that you run standalone. Defaults to true.
+                         </xsd:documentation>
+                     </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="inbound-endpoint" type="inboundEndpointType" substitutionGroup="mule:abstract-inbound-endpoint"/>
+    <xsd:complexType name="inboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:inboundEndpointType">
+                <xsd:group ref="endpointElements"/>
+                <xsd:attributeGroup ref="inboundEndpointAttributes"/>
+                <xsd:attributeGroup ref="commonEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="outbound-endpoint" type="outboundEndpointType"
+                 substitutionGroup="mule:abstract-outbound-endpoint"/>
+
+    <xsd:complexType name="outboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:outboundEndpointType">
+                <xsd:group ref="endpointElements"/>
+                <xsd:attributeGroup ref="outboundEndpointAttributes"/>
+                <xsd:attributeGroup ref="commonEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="endpoint" type="globalEndpointType" substitutionGroup="mule:abstract-global-endpoint"/>
+
+    <xsd:complexType name="globalEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:globalEndpointType">
+                <xsd:group ref="endpointElements"/>
+                <xsd:attributeGroup ref="inboundEndpointAttributes"/>
+                <xsd:attributeGroup ref="outboundEndpointAttributes"/>
+                <xsd:attributeGroup ref="commonEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:attributeGroup name="commonEndpointAttributes">
+        <xsd:attribute name="proxy" type="mule:substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Whether or not this outbound endpoint is acting as a web service proxy. If so, it will expect raw xml as the input parameter and return an XML stream as the output.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="payload">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Whether the whole SOAP Envelope, or just the body contents should be sent when in proxy mode.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+               <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="envelope"/>
+                    <xsd:enumeration value="body"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="mtomEnabled" type="mule:substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Whether or not MTOM (attachment support) is enabled for this endpoint.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="wsdlLocation" type="xsd:string" >
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location of the WSDL for your service. If this is a server side endpoint it will served to your users.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="protocolConnector" type="xsd:string" >
+            <xsd:annotation>
+                <xsd:documentation>
+                            The name of the connector that you wish to use to send/receive messages on with CXF. (As of 2.1)
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="applyTransformersToProtocol" type="mule:substitutableBoolean" default="true">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Whether to apply the transformers to the protocol endpoint. Defaults to true for Mule 2.2+ and false for 2.1 and previous versions.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="enableMuleSoapHeaders" type="mule:substitutableBoolean" default="true">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Whether or not this endpoint should write Mule SOAP headers which pass along the correlation and ReplyTo information. This is true by default, but the Mule SOAP headers are only triggered in situations where there is an existing correlation ID and the ReplyTo header is set. (As of 2.2.1)
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:attributeGroup name="inboundEndpointAttributes">
+        <xsd:attribute name="frontend">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The CXF frontend that is used to build an internal service representation from your Java classes. The default is "jaxws". The "simple" frontend is also supported.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+               <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="jaxws"/>
+                    <xsd:enumeration value="simple"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="bindingUri" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The binding that should be used for this service. It defaults to the SOAP binding by default.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="endpointName" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The WSDL endpoint name of your service.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="namespace" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The service namespace. (As of 2.2.1)
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="serviceClass" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class CXF should use to construct its service model. This is optional, and by default it will use the implementation class of your component.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="serviceName" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The WSDL service name of your service.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="applyFiltersToProtocol" type="mule:substitutableBoolean" default="true">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Whether to apply the filters to the protocol endpoint. Defaults to true for Mule 2.2+ and false for 2.1 and previous versions.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="applySecurityToProtocol" type="mule:substitutableBoolean" default="true">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Whether to apply the security filter to the protocol endpoint. Defaults to true for Mule 2.2+ and false for 2.1 and previous versions.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:group name="endpointElements">
+        <xsd:sequence>
+            <xsd:element name="databinding" type="databindingType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The databinding implementation that should be used. By default, this is JAXB for the JAX-WS frontend and Aegis for the simple frontend. This should be specified in the form of a Spring bean.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="features" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Any CXF features you want to apply to the client/server. See the CXF documentation for more information on features.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="inInterceptors" type="interceptors" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Additional incoming interceptors for this service.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="inFaultInterceptors" type="interceptors" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Additional incoming fault interceptors.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="outInterceptors" type="interceptors" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Additional outgoing interceptors.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="outFaultInterceptors" type="interceptors" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Additional outgoing fault interceptors.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:attributeGroup name="outboundEndpointAttributes">
+        <xsd:attribute name="wsdlPort" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The WSDL port you want to use to communicate with the service.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="clientClass" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the client class that CXF generated using CXF's wsdl2java tool. You must use wsdl2java if you do not have both the client and the server in the same JVM. Otherwise, this can be optional if the endpoint address is the same in both cases.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="operation" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The operation you want to invoke on the outbound endpoint.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:complexType name="databindingType">
+        <xsd:sequence>
+            <xsd:any minOccurs="0" maxOccurs="1" namespace="##any" processContents="lax"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="schemasType">
+        <xsd:sequence>
+            <xsd:element name="schemaLocation" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The location of any additional schema to be included inside the WSDL.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="features">
+        <xsd:complexType>
+            <xsd:sequence>
+                <xsd:any minOccurs="0" maxOccurs="unbounded"/>
+            </xsd:sequence>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:complexType name="interceptors">
+        <xsd:sequence>
+            <xsd:any minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="propertiesType">
+        <xsd:sequence>
+            <xsd:element ref="beans:entry" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="wrapper-component" type="wrapperComponentType" substitutionGroup="mule:abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                The WebServiceWrapperComponent class allows you to send the result of a web service call to another endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="wrapperComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractComponentType">
+                <xsd:attribute name="address" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The URL of the web service.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="addressFromMessage" type="mule:substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Specifies that the URL of the web service will be obtained from the message itself.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="wsdlPort" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The WSDL port you want to use to communicate to the service.
+                         </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="operation" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The operation you want to invoke on the outbound endpoint.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="stax">
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="beans:identifiedType">
+                    <xsd:attribute name="xmlInputFactory" type="xsd:string" />
+                    <xsd:attribute name="xmlOutputFactory" type="xsd:string" />
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="security-manager-callback">
+        <xsd:annotation>
+            <xsd:documentation>
+                A WSS4J Password callback which verifies username/password combinations
+                against the Mule security manager.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="beans:identifiedType">
+                    <xsd:attribute name="securityManager-ref">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The security manager instance to use for the password callback. (Optional)
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/MuleConfigHighlighting2/mule2_2-schemadoc.xsd b/xml/tests/testData/xml/MuleConfigHighlighting2/mule2_2-schemadoc.xsd
new file mode 100644
index 0000000..d9ddeba
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigHighlighting2/mule2_2-schemadoc.xsd
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/schemadoc/2.2"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://www.mulesource.org/schema/mule/schemadoc/2.2"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+    <xsd:annotation>
+        <xsd:documentation>This schema provides a schema doc extentions that can be embedded in Mule schemas. These
+            elements will be used to render additional wiki content associated with the element being annotated.
+            Elements within this schema should be embedded under 'xsd:element/xsd:annotation/xsd:appinfo'.
+            To stick to convention and to ensure that XSLs will work this schema should be included in other mule
+            schemas using the 'schemadoc' prefix namespace.
+        </xsd:documentation>
+        <xsd:appinfo>
+            <page-title>SchemaDoc Reference</page-title>
+        </xsd:appinfo>
+    </xsd:annotation>
+
+    <xsd:element name="snippet" type="snippetType">
+        <xsd:annotation>
+            <xsd:documentation>The snippet allows for code snippets to be associated with an element in a schema. This
+                is useful for surfacing documentation on the wiki. When the schema reference is generated for the wiki,
+                the code snippets will also be rendered when using the 'single-element-wike.xsl'.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="page-title" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>The page title to use when rendering this schema.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="short-name" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>The short name of the module or transport, i.e. 'xml' or 'tcp'.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="additional-documentation" type="additionalDocumentationType">
+        <xsd:annotation>
+            <xsd:documentation>Additional documentation that can be rendered with the schema. Note that this element can
+                only be used in {{/xsd:schema/xsd:annotation/xsd:appinfo}}, it will be ignorred if used anywhere else.
+                Enter
+                the documentation in the body of this element.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="additionalDocumentationType" mixed="true">
+        <xsd:attribute name="where" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The point at which the documentation is rendered.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="before-common-elements">
+                        <xsd:annotation>
+                            <xsd:documentation>The documentation will appear after any title text but before any of the
+                                common elements are rendered.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="after-common-elements">
+                        <xsd:annotation>
+                            <xsd:documentation>The documentation will appear right after common elements are rendered.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="before-specific-elements">
+                        <xsd:annotation>
+                            <xsd:documentation>The documentation will appear right before the elements specific to the
+                                schema are rendered.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="after-specific-elements">
+                        <xsd:annotation>
+                            <xsd:documentation>The documentation will appear right after the elements specific to the
+                                schema are rendered.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="before-single-element">
+                        <xsd:annotation>
+                            <xsd:documentation>If a specific element was named, this documentation will appear directly
+                                before the element. The mode is less useful but supported for completeness.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="after-single-element">
+                        <xsd:annotation>
+                            <xsd:documentation>If a specific element was named, this documentation will appear directly
+                                after the element. The mode is less useful but supported for completeness.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="snippetType" mixed="true">
+        <xsd:attribute name="id" type="xsd:NMTOKEN" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The ID of the snippet to embed in the wiki page. This ID is embedded in the source
+                    file using a START SNIPPET xxx comment.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="lang">
+            <xsd:annotation>
+                <xsd:documentation>The language format to use when rendering the content of the snippet on the wiki.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="xml"/>
+                    <xsd:enumeration value="java"/>
+                    <xsd:enumeration value="javadoc"/>
+                    <xsd:enumeration value="bash"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="sourcePath" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>This is the path to the source file. Note this should be relative to the project root
+                    directory i.e. transport/jms/src/main/resources/etc...
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="transport-features" type="transportFeaturesType">
+        <xsd:annotation>
+            <xsd:documentation>Defines meta information about transports such as whether they can send or receive events
+                and if they supprt transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="transportFeaturesType">
+        <xsd:sequence>
+            <xsd:element name="inboundMEPs" type="inboundMEPsType" minOccurs="1">
+                <xsd:annotation>
+                    <xsd:documentation>The Inbound MEPs that are supported by this Transport.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="outboundMEPs" type="outboundMEPsType" minOccurs="1">
+                <xsd:annotation>
+                    <xsd:documentation>The Outbound MEPs that are supported by this Transport.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="receiveEvents" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether the transport can receive events and thus can be used for an inbound
+                    endpoint.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="dispatchEvents" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Ehether the transport can be used to dispatch events and thus is supported as an
+                    outbound endpoint.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="requestEvents" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether the transport can be used to request events directly from the source.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="responseEvents" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether the transport can be used in request/response style messaging. This means
+                    that the transport provides a back-channel to the callee.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="transactions" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether transactions are supported by the transports. Transports that support (/)A
+                    transactions can be configured in a distributed 2 Phase Commit (Distributed) transaction.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="transactionTypes" type="xsd:string" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>A comma separated list of transaction types, i.e. local, XA</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="streaming" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether the transport supports streaming of the data is provides or publishes.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:complexType name="inboundMEPsType">
+        <xsd:attribute name="none" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="in-only" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="in-out" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="in-optional-out" type="xsd:boolean"></xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="outboundMEPsType">
+        <xsd:attribute name="none" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="out-only" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="out-in" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="out-optional-in" type="xsd:boolean"></xsd:attribute>
+    </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/MuleConfigHighlighting2/mule2_2.xsd b/xml/tests/testData/xml/MuleConfigHighlighting2/mule2_2.xsd
new file mode 100644
index 0000000..c8ab0b7
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigHighlighting2/mule2_2.xsd
@@ -0,0 +1,4533 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/core/2.2"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:spring="http://www.springframework.org/schema/beans"
+            xmlns:spring-context="http://www.springframework.org/schema/context"
+            targetNamespace="http://www.mulesource.org/schema/mule/core/2.2"
+            attributeFormDefault="unqualified"
+            elementFormDefault="qualified">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+    <xsd:import namespace="http://www.springframework.org/schema/beans"
+                schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"/>
+    <xsd:import namespace="http://www.springframework.org/schema/context"
+                schemaLocation="http://www.springframework.org/schema/context/spring-context-2.5.xsd"/>
+
+    <!--==============================================================-->
+    <!--   Structure                                                  -->
+    <!--==============================================================-->
+
+    <!-- This defines the structure in abstract terms (except for a few simple/unique things like
+         global properties).  We then provide some implementations below.  Other modules
+         can provide other implementations. -->
+
+    <xsd:element name="mule" type="muleType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Either the root element of a Mule configuration, or a "top-level" element in a Spring configuration that contains further Mule elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="muleType">
+        <xsd:sequence>
+            <xsd:element name="description" type="descriptionType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Holds any kind of documentation that accompanies this configuration file. It is intended to be "human readable" only and is not used by the system.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="springRootElements"/>
+                <xsd:group ref="muleRootElements"/>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:group name="springRootElements">
+        <xsd:choice>
+            <xsd:element ref="spring:beans">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Allows the embedding of any Spring elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="spring:bean">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Allows Spring beans to be defined alongside Mule elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="spring-context:property-placeholder">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Allows Spring property placeholders to be configured directly in the Mule configuration file.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:group name="muleRootElements">
+        <xsd:choice>
+            <xsd:element name="global-property" type="globalPropertyType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        A global property is a named string. It can be inserted in most attribute values using standard (ant-style) Spring placeholders.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="configuration" type="configurationType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Specifies defaults and general settings for the Mule instance.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="notifications" type="notificationManagerType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Registers listeners for notifications and associates interfaces with particular events.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-extension"/>
+            <xsd:element ref="abstract-security-manager"/>
+            <xsd:element ref="abstract-transaction-manager"/>
+            <xsd:element ref="abstract-connector"/>
+            <xsd:element ref="abstract-global-endpoint"/>
+            <xsd:element ref="abstract-transformer"/>
+            <xsd:element ref="abstract-filter"/>
+            <xsd:element ref="abstract-model"/>
+            <xsd:element ref="abstract-interceptor-stack"/>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:complexType name="descriptionType">
+        <xsd:complexContent mixed="true">
+            <xsd:extension base="xsd:anyType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-extension" abstract="true" type="abstractExtensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for arbitrary extensions as children of the 'mule' element. Other transports and modules can extend this if they need to add global elements to the configuration (but consider the more specific elements like abstract-connector first).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractExtensionType"/>
+
+    <xsd:element name="abstract-connector" abstract="true" type="abstractConnectorType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for connector elements. Connector elements allow properties to be configured across all endpoints that use the same transport. If multiple connectors are defined for the same transport, each endpoint must name which connector is being used.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractConnectorType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the connector so that other elements can reference it.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-global-endpoint" abstract="true" type="abstractGlobalEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for global endpoint elements. Global endpoints are named templates that allow you to define an endpoint once and refer to it in several places. The same template can be used for both inbound and outbound endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractGlobalEndpointType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the endpoint so that other elements can reference it. This name can also be referenced in the MuleClient.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-inbound-endpoint" abstract="true" type="abstractInboundEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for inbound endpoint elements. Inbound endpoints receive messages from the underlying transport. The message payload is then delivered to the component for processing.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInboundEndpointType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the endpoint in the registry. There is no need to set the 'name' attribute on inbound or outbound endpoints, only on global endpoints.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-outbound-endpoint" abstract="true" type="abstractOutboundEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for outbound endpoint elements. Outbound endpoints dispatch messages to the underlying transport.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractOutboundEndpointType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the endpoint in the registry. There is not need to set the 'name' attribute on inbound or outbound endpoints, only on global endpoints.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-transformer" abstract="true" type="abstractTransformerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transformer elements. Transformers convert message payloads.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransformerType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the transformer so that other elements can reference it. Required if the transformer is defined at the global level.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="returnClass" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class of the message generated by the transformer. This is used if transformers are auto-selected and to validate that the transformer returns the correct type.  Note that if you need to specify an array type you need postfix the class name with '[]'. For example, if you want return a an Orange[], you set the return class to 'org.mule.tck.testmodels.fruit.Orange[]'.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="ignoreBadInput" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Many transformers only accept certain classes. Such transformers are never called with inappropriate input (whatever the value of this attribute). If a transformer forms part of a chain and cannot accept the current message class, this flag controls whether the remaining part of the chain is evaluated. If true, the next transformer is called. If false the chain ends, keeping the result generated up to that point.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="globalPropertyType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the property. This is used inside Spring placeholders.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="value" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The value of the property. This replaces each occurence of a Spring placeholder.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- seemed pointless making these simple container types abstract -->
+    <xsd:complexType name="inboundCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-inbound-router" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-catch-all-strategy" minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:attribute name="matchAll" type="substitutableBoolean" default="true">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, the input message will be passed to all inbound routers. Otherwise, only the first matching router is used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-catch-all-strategy" abstract="true" type="abstractCatchAllStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for catch-all strategy elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractCatchAllStrategyType"/>
+
+    <xsd:element name="abstract-inbound-router" abstract="true" type="abstractInboundRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for inbound router elements, which control how incoming messages are handled.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInboundRouterType"/>
+
+    <xsd:element name="abstract-filter" abstract="true" type="abstractFilterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for filter elements, which control which messages are handled.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractFilterType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the filter so that other elements can reference it. Required if the filter is defined at the global level.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="not" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Inverts the filter condition.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="outboundCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-outbound-router" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-catch-all-strategy" minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:attribute name="matchAll" type="substitutableBoolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, the output message will be sent to all routers. Otherwise, only the first matching router is used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-outbound-router" abstract="true" type="abstractOutboundRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for outbound router elements, which control how outgoing messages are delivered to the outbound endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractOutboundRouterType"/>
+
+    <xsd:element name="abstract-transaction-manager" abstract="true" type="abstractTransactionManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transaction manager elements, which are used to coordinate transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransactionManagerType"/>
+
+    <xsd:complexType name="configurationType">
+        <xsd:sequence>
+            <xsd:element name="default-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default threading profile, used by components and by endpoints for dispatching and receiving if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-dispatcher-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default dispatching threading profile, which modifies the default-threading-profile values and is used by endpoints for dispatching messages. This can also be configured on connectors, in which case the connector configuration is used instead of this default.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-receiver-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default receiving threading profile, which modifies the default-threading-profile values and is used by endpoints for receiving messages. This can also be configured on connectors, in which case the connector configuration is used instead of this default.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-service-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default service threading profile, which modifies the default-threading-profile and is used by services for processing messages. This can also be configured on models or services, in which case these configurations will be used instead of this default.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-retry-policy" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default retry policy, used by connectors and endpoints. This can also be configured on connectors, in which case the connector configuration is used instead of this default.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="defaultSynchronousEndpoints" type="substitutableBoolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, all requests to endpoints will wait for a response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="defaultResponseTimeout" type="xsd:string" default="10000">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The default period (ms) to wait for a synchronous response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="defaultTransactionTimeout" type="xsd:string" default="30000">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The default timeout (ms) for transactions. This can also be configured on transactions, in which case the transaction configuration is used instead of this default.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="shutdownTimeout" type="substitutableInt" default="5000">
+            <xsd:annotation>
+                <xsd:documentation>
+                    (As of Mule 2.2.2) The time in milliseconds to wait for any in-progress messages to finish processing before Mule shuts down. After this threshold has been reached, Mule starts interrupting threads, and messages can be lost. If you have a very large number of services in the same Mule instance, if you have components that take more than a couple seconds to process, or if you are using large payloads and/or slower transports, you should increase this value to allow more time for graceful shutdown. The value you specify is applied to services and separately to dispatchers, so the default value of 5000 milliseconds specifies that Mule has ten seconds to process and dispatch messages gracefully after shutdown is initiated.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="notificationManagerType">
+        <xsd:sequence>
+            <xsd:element name="notification" type="defineNotificationType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Associates an event with an interface. Listeners that implement the interface will receive instances of the event.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="disable-notification" type="disableNotificationType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Blocks the association of an event with a particular interface. This filters events after the association with a particular interface (and so takes precedence).
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="notification-listener" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Registers a bean as a listener with the notification system. Events are dispatched by reflection - the listener will receive all events associated with any interfaces it implements. The relationship between interfaces and events is configured by the notification and disable-notification elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                    <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The bean that will receive notifications.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="subscription" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                An optional string that is compared with the event resource identifier. Only events with matching identifiers will be sent. If no value is given, all events are sent.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="dynamic" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If the notification manager is dynamic, listeners can be registered dynamically at runtime via the MuleContext, and the configured notification can be changed. Otherwise, some parts of Mule will cache notification configuration for efficiency and will not generate events for newly enabled notifications or listeners. The default value is false.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="defineNotificationType">
+        <xsd:attribute name="event-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class associated with a notification event that will be delivered to the interface. This can be used instead of the 'event' attribute to specify a custom class.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="event" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The notification event to deliver.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface (class name) that will receive the notification event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface that will receive the notification event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="disableNotificationType">
+        <xsd:attribute name="event-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class associated with an event that will no longer be delivered to any interface. This can be used instead of the 'event' attribute to specify a custom class.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="event" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The event you no longer want to deliver.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface (class name) that will no longer receive the event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface that will no longer receive the event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+
+    <xsd:simpleType name="notificationTypes">
+        <xsd:restriction base="xsd:NMTOKEN">
+            <xsd:enumeration value="CONTEXT"/>
+            <xsd:enumeration value="MODEL"/>
+            <xsd:enumeration value="SERVICE"/>
+            <xsd:enumeration value="SECURITY"/>
+            <xsd:enumeration value="ENDPOINT-MESSAGE"/>
+            <xsd:enumeration value="COMPONENT-MESSAGE"/>
+            <xsd:enumeration value="MANAGEMENT"/>
+            <xsd:enumeration value="CONNECTION"/>
+            <xsd:enumeration value="REGISTRY"/>
+            <xsd:enumeration value="CUSTOM"/>
+            <xsd:enumeration value="EXCEPTION"/>
+            <xsd:enumeration value="TRANSACTION"/>
+            <xsd:enumeration value="ROUTING"/>
+            <!-- DEPRECATED -->
+            <xsd:enumeration value="MESSAGE"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <!--==============================================================-->
+    <!-- Models                                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-model" abstract="true" type="abstractModelType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for model elements. A model provides basic settings and processing for all the services it contains.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractModelType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-exception-strategy" minOccurs="0"/>
+            <xsd:group ref="entryPointResolvers"/>
+            <xsd:element ref="abstract-service" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="name" type="nonBlankString">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name used to identify this model.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="seda-model" type="sedaModelType" substitutionGroup="abstract-model">
+        <xsd:annotation>
+            <xsd:documentation>
+                A staged event-driven architecture (SEDA) model has separate threads and queues for each service.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="sedaModelType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractModelType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-queue-profile" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="inherit" type="xsd:boolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If true, this model element is an extension of a previous model element with the same name.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="model" type="defaultModelType" substitutionGroup="abstract-model">
+        <xsd:annotation>
+            <xsd:documentation>
+                The container for a set of services, providing basic settings and processing for all the services it contains.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="defaultModelType">
+        <xsd:complexContent>
+            <xsd:extension base="sedaModelType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Model elements -->
+
+    <xsd:element name="abstract-queue-profile" abstract="true" type="abstractQueueProfileType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a queue profile, which controls how messages are queued.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractQueueProfileType"/>
+
+    <!-- to give a cleaner config we allow either a set or an individual entry (but not both).-->
+    <xsd:group name="entryPointResolvers">
+        <xsd:choice>
+            <xsd:element ref="abstract-entry-point-resolver-set" minOccurs="0"/>
+            <!-- we could allow many of these, but it looks ugly -->
+            <xsd:element ref="abstract-entry-point-resolver" minOccurs="0"/>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:element name="abstract-entry-point-resolver-set" abstract="true" type="abstractEntryPointResolverSetType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for entry point resolver set elements. These combine a group of entry point resolvers, trying them in turn until one succeeds.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractEntryPointResolverSetType"/>
+
+    <xsd:element name="legacy-entry-point-resolver-set" type="extensibleEntryPointResolverSet"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                An extensible set of entry point resolvers (which determine how a message is passed to a component in Java) that already contains resolvers to implement the standard logic. This is already provided by default and is only needed explicitly if it will be extended with other entry point resolvers. This element can be set on the model or component; the model value provides a default that individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="entry-point-resolver-set" type="extensibleEntryPointResolverSet"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                An extensible set of entry point resolvers. These determine how a message is passed to a component in Java. Each entry point resolver is tried in turn until one succeeds in delivering the message to the component. This element can be set on the model or component; the model value provides a default that individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="extensibleEntryPointResolverSet">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverSetType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-entry-point-resolver" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-entry-point-resolver-set" type="customEntryPointResolverSetType"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom entry point resolver set. This allows user-supplied code to determine how a message is passed to a component in Java. This element can be set on the model or component; the model value provides a default that individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customEntryPointResolverSetType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverSetType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the EntryPointResolverSet interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-entry-point-resolver" abstract="true" type="abstractEntryPointResolverType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an entry point resolver element. Entry point resolvers define how payloads are delivered to Java code by choosing the method to call.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="callable-entry-point-resolver" type="abstractEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                An entry point resolver for components that implement the Callable interface. This passes a MuleEventContext to the component. This element can be set on the model or component; the model value provides a default that individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractEntryPointResolverType"/>
+
+    <xsd:element name="custom-entry-point-resolver" type="customEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom entry point resolver. This allows user-supplied code to determine how a message is passed to a component in Java. This element can be set on the model or component; the model value provides a default that individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the EntryPointResolver interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverType">
+                <xsd:attribute name="transformFirst" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether the message should be transformed before being delivered to the component. By default, messages are transformed.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="acceptVoidMethods" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether the resolver should call void methods. By default, void methods are not considered as possible candidates for message delivery.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="property-entry-point-resolver" type="propertyEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Uses a message property to select the component method to be called. This element can be set on the model or component; the model value provides a default that individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="propertyEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:attribute name="property" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the message property used to select a method on the component.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="method-entry-point-resolver" type="methodEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Delivers the message to a named method. This element can be set on the model or component; the model value provides a default that individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="methodEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="include-entry-point" minOccurs="1" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="reflection-entry-point-resolver" type="reflectionEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Generates a list of candidate methods from the component via reflections. This element can be set on the model or component; the model value provides a default that individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="reflectionEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element name="exclude-object-methods" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                If specified, methods in the Java Object interface are not included in the list of possible methods that can receive the message.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="exclude-entry-point" type="methodType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Explicitly excludes a named method from receiving the message.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="array-entry-point-resolver" type="complexEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Delivers the message to a method that takes a single array as argument. This element can be set on the model or component; the model value provides a default that individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="no-arguments-entry-point-resolver" type="complexEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Calls a method without arguments (the message is not passed to the component).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="complexEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="reflectionEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="include-entry-point" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="enableDiscovery" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If no method names are configured, attempts to discover the method to invoke based on the inbound message type.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="include-entry-point" type="methodType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A possible method for delivery.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="methodType">
+        <xsd:attribute name="method" type="nonBlankString">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the method.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--  Services                                                    -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-service" abstract="true" type="abstractServiceType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a service element. Services combine message routing with a component (typically a POJO).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractServiceType">
+        <xsd:attribute name="name" type="nonBlankString" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name used to identify this service.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseServiceType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Base support for a model-based wrapper around the POJO service (SEDA, Streaming, etc.)
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractServiceType">
+                <xsd:sequence>
+                    <xsd:element name="description" type="descriptionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                This can hold any kind of documentation related to the service. It is intended to be "human readable" only and is not used by the system.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="inbound" type="inboundCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within 'inbound' describe how a service receives messages.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <!-- minOccurs="0" to allow for <forwarding-router/> and/or default component -->
+                    <xsd:element ref="abstract-component" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The service component that is invoked when incoming messages are received. If this element is not present, the service simply bridges the inbound and outbound using a pass-through component.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="outbound" type="outboundCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within 'outbound' describe how a service sends or dispatches messages.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="async-reply" type="asyncReplyCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within 'async-reply' describe how asynchronous replies are handled.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element ref="abstract-exception-strategy" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="initialState" default="started">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The initial state of the service. Usually a service is started automatically ("started"), but this attribute can be used to disable initial startup ("stopped") or start the service in a paused state ("paused").
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="started"/>
+                            <xsd:enumeration value="stopped"/>
+                            <xsd:enumeration value="paused"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-exception-strategy" abstract="true" type="abstractExceptionStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an exception strategy element. Exception strategies define how Mule should react to errors.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="abstractExceptionStrategyType">
+        <xsd:sequence>
+            <xsd:element name="commit-transaction" type="exceptionPatternType" maxOccurs="1" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Defines when a current transaction gets committed based on the name of the exception caught. You can set a comma-separated list of wildcard patterns that will be matched against the fully qualified classname of the current exception. Patterns defined for this element will leave the current transaction (if any) untouched and allow it to be committed.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="rollback-transaction" type="exceptionPatternType" maxOccurs="1" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Defines when a current transaction gets rolled back based on the name of the exception caught. You can set a comma-separated list of wildcard patterns that will be matched against the fully qualified classname of the current exception. Patterns defined for this element will roll back the current transaction (if any).
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="enableNotifications" type="xsd:boolean">
+            <xsd:annotation>
+                <xsd:documentation>Determines whether ExceptionNotifications will be fired from this strategy when an exception occurs.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="exceptionPatternType">
+        <xsd:attribute name="exception-pattern" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>A comma-separated list of wildcard expressions that will be matched against the fully qualified classname of the current exception received by the ExceptionStrategy.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-retry-policy" abstract="true" type="abstractRetryPolicyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a retry policy element. Retry policies define how Mule should retry a failed message send/dispatch/request.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractRetryPolicyType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-retry-notifier" minOccurs="0" maxOccurs="1"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-retry-notifier" abstract="true" type="abstractRetryNotifierType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a retry notifier element. The RetryNotifier interface is a callback that allows actions to be performed after each retry. For example, when retrying connections, Mule will fire server notification events on success or failure.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractRetryNotifierType"/>
+
+    <xsd:complexType name="asyncReplyCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-inbound-endpoint" minOccurs="1" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-async-reply-router" minOccurs="0" maxOccurs="1"/>
+            <!-- TODO leaving this commented here, but I do not think there should be a transformer here -->
+            <!--<xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>-->
+        </xsd:sequence>
+        <xsd:attribute name="timeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The timeout (ms) to wait for a reply.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="failOnTimeout" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If the router times out before all expected events have been received, specifies whether an exception should be thrown (true) or the current events should be returned for processing (false). The default is false.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-async-reply-router" abstract="true" type="abstractAsyncReplyRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an async reply router element. Asynchronous replies are handled via this router.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractAsyncReplyRouterType"/>
+
+    <xsd:element name="service" type="sedaServiceType" substitutionGroup="abstract-service">
+        <xsd:annotation>
+            <xsd:documentation>
+                Describes how to receive messages, deliver them to a component, and handle the results (if any).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="sedaServiceType">
+        <xsd:complexContent>
+            <xsd:extension base="baseServiceType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-service-threading-profile" minOccurs="0"/>
+                    <xsd:element ref="abstract-queue-profile" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="queueTimeout" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The timeout used when taking messages from the service queue.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-service" type="customServiceType" substitutionGroup="abstract-service">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented service (typically used only in testing).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customServiceType">
+        <xsd:complexContent>
+            <xsd:extension base="baseServiceType">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The class to use for the service.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-service-threading-profile" abstract="true"
+                 type="abstractServiceThreadingProfileType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for the service threading profile element. Threading profiles define how thread pools are used by a service.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractServiceThreadingProfileType"/>
+
+    <!--==============================================================-->
+    <!-- Components                                              -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-component" abstract="true" type="abstractComponentType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a component element. A component is invoked when inbound messages are received by the service.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractComponentType">
+        <xsd:group ref="interceptorGroup" minOccurs="0">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Interceptors that can be used to intercept component invocation.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:group>
+    </xsd:complexType>
+
+    <xsd:element name="component" type="defaultJavaComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                A simple POJO (Plain Old Java Object) component that will be invoked by Mule when a message is received. The class or object instance to be used can be specified using a child object factory element, or via the 'class' attribute.  If the 'class' attribute is used, an object factory cannot be configured as well. Using the 'class' attribute is equivilant to using the propotype object factory ('prototype-object' child element).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="defaultJavaComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractComponentType">
+                <xsd:sequence>
+                    <xsd:group ref="entryPointResolvers">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Entry point resolvers that are used to determine how a message is passed to a component.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:group>
+                    <xsd:element ref="abstract-object-factory" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Object factory used to obtain the object instance that will be used for the component implementation. The object factory is responsible for object creation and may implement different patterns, such as singleton or prototype, or look up an instance from other object containers.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element ref="abstract-lifecycle-adapter-factory" minOccurs="0"/>
+                    <xsd:element name="binding" type="pojoBindingType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                A binding associates a Mule endpoint with an injected Java interface. This is like using Spring to inject a bean, but instead of calling a method on the bean, a message is sent to an endpoint.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Specifies a component class. This is a shortcut that is equivalent to providing a 'prototype-object' element.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="pooled-component" type="pooledJavaComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                A pooled POJO (Plain Old Java Object) component that will be invoked by Mule when a message is received. The instance can be specified via a factory or a class.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="pooledJavaComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="defaultJavaComponentType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-pooling-profile" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Characteristics of the object pool.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <xsd:complexType name="pojoBindingType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-outbound-endpoint" minOccurs="1" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="interface" use="required" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface to be injected. A proxy will be created that implements this interface by calling out to the endpoint.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="method" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The method on the interface that should be used. This can be omitted if the interface has a single method.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="defaultComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractComponentType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="bridge-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                Transfers a message from inbound to outbound endpoints. This element is provided for backward compatibility - it is equivalent to not specifying any component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!-- don't expose this, it's not needed -->
+    <!-- xsd:element name="pass-through-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default, "do nothing" component.
+                The message is simply transferred from inbound to outbound endpoints.
+                This is the default and need not be specified.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element -->
+
+    <xsd:element name="echo-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                Logs the message and returns the payload as the result.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="log-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                Logs the message content (or content length if it is a large message).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="null-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                Throws an exception if it receives a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+
+    <!--==============================================================-->
+    <!--   Transactions                                               -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-transaction" abstract="true" type="abstractTransactionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transaction elements. Transactions allow a series of operations to be grouped together.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="abstract-xa-transaction" abstract="true" type="abstractTransactionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for XA transaction elements. XA transactions allow a series of operations to be grouped together spanning different transports, such as JMS and JDBC.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="abstract-multi-transaction" abstract="true" type="abstractTransactionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for multi-transaction elements.
+                Multi-transactions allow a series of operations to be grouped together spanning different
+                transports, e.g. JMS and JDBC, but without the overhead of XA. The trade-off is that XA
+                reliability guarantees aren't available, and services must be ready to handle duplicates.
+                This is very similar to a 1.5 PC concept. EE-only feature.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransactionType">
+        <xsd:attribute name="action" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The type of action the transaction should take, one of the following:
+                    NONE - Never participate in a transaction.
+                    ALWAYS_BEGIN - Always start a new transaction when receiving a message. An exception will be thrown if a transaction already exists.
+                    BEGIN_OR_JOIN - If a transaction is already in progress when a message is received, join the transaction if possible. Otherwise, start a new transaction.
+                    ALWAYS_JOIN - Always expects a transaction to be in progress when a message is received. If there is no transaction, an exception is thrown.
+                    JOIN_IF_POSSIBLE - Join the current transaction if one is available. Otherwise, no transaction is created.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="NONE"/>
+                    <xsd:enumeration value="ALWAYS_BEGIN"/>
+                    <xsd:enumeration value="BEGIN_OR_JOIN"/>
+                    <xsd:enumeration value="ALWAYS_JOIN"/>
+                    <xsd:enumeration value="JOIN_IF_POSSIBLE"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="timeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Timeout for the transaction (ms).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseTransactionType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-transaction" type="customTransactionType" substitutionGroup="abstract-transaction">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-defined or otherwise unsupported third-party transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransactionType">
+        <xsd:complexContent>
+            <xsd:extension base="baseTransactionType">
+                <xsd:attribute name="factory-class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the TransactionFactory interface that will be instantiated and used to generate a transaction. This attribute and the 'factory-ref' attribute are mutually exclusive; one of the two is required.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="factory-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A bean that implements the TransactionFactory interface that will be used to generate a transaction. This attribute and the 'factory-class' attribute are mutually exclusive; one of the two is required.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="xa-transaction" type="xaTransactionType" substitutionGroup="abstract-transaction">
+        <xsd:annotation>
+            <xsd:documentation>
+                An XA transaction.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="xaTransactionType">
+        <xsd:complexContent>
+            <xsd:extension base="baseTransactionType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="transactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionManagerType">
+                <xsd:attribute name="name" type="substitutableName" default="transactionManager" use="optional">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An optional name for the transaction manager. The default value is "transactionManager".
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="websphere-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The WebSphere transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="jboss-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The JBoss transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="jndiTransactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionManagerType">
+                <xsd:sequence>
+                    <xsd:element name="environment" type="mapType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The JNDI environment.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="weblogic-transaction-manager" type="jndiTransactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The WebLogic transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="jrun-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The JRun transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="resin-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The Resin transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="jndi-transaction-manager" substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                Retrieves a named transaction manager factory from JNDI.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="jndiTransactionManagerType">
+                    <xsd:attribute name="jndiName" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The name of the manager factory to retrieve (such as java:/TransactionManager).
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="custom-transaction-manager" type="customTransactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="jndiTransactionManagerType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The class to instantiate to create a transaction manager.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--   Endpoint elements                                          -->
+    <!--==============================================================-->
+
+    <xsd:element name="endpoint" type="globalEndpointType" substitutionGroup="abstract-global-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                A global endpoint, which acts as a template that can be used to construct an inbound or outbound endpoint elsewhere in the configuration by referencing the global endpoint name. Each transport implements its own endpoint element, with a more friendly syntax, but this generic element can be used with any transport by supplying the correct address URI. For example, "vm://foo" describes a VM transport endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="globalEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractGlobalEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- extend this type for endpoints that support XA transactions -->
+    <xsd:complexType name="globalEndpointWithXaType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractGlobalEndpointType">
+                <xsd:group ref="defaultXaEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="inbound-endpoint" type="inboundEndpointType" substitutionGroup="abstract-inbound-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An inbound endpoint receives messages via the associated transport. As with global endpoints, each transport implements its own inbound endpoint element.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="inboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInboundEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- extend this type for endpoints that support XA transactions -->
+    <xsd:complexType name="inboundEndpointWithXaType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInboundEndpointType">
+                <xsd:group ref="defaultXaEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="outbound-endpoint" type="outboundEndpointType" substitutionGroup="abstract-outbound-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An outbound endpoint sends messages via the associated transport. As with global endpoints, each transport implements its own outbound endpoint element.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="outboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:complexType name="outboundEndpointWithXaType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundEndpointType">
+                <xsd:group ref="defaultXaEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- these include option/repeats - should be embedded once -->
+    <xsd:group name="defaultEndpointElements">
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="endpointTransformers"/>
+                <xsd:element ref="abstract-transaction" minOccurs="0"/>
+                <xsd:element ref="abstract-filter" minOccurs="0"/>
+                <xsd:element ref="abstract-security-filter" minOccurs="0"/>
+                <xsd:element ref="abstract-retry-policy" minOccurs="0"/>
+                <xsd:element ref="abstract-multi-transaction" minOccurs="0"/>
+                <xsd:group ref="propertiesGroup"/>
+            </xsd:sequence>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:group name="defaultXaEndpointElements">
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="endpointTransformers"/>
+                <xsd:element ref="abstract-transaction" minOccurs="0"/>
+                <xsd:element ref="abstract-xa-transaction" minOccurs="0"/>
+                <xsd:element ref="abstract-filter" minOccurs="0"/>
+                <xsd:element ref="abstract-security-filter" minOccurs="0"/>
+                <xsd:group ref="propertiesGroup"/>
+            </xsd:sequence>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:element name="abstract-security-filter" abstract="true" type="abstractSecurityFilterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for security filter elements, which control access to the system.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractSecurityFilterType"/>
+
+    <xsd:attributeGroup name="defaultEndpointAttributes">
+        <xsd:attributeGroup ref="restrictedEndpointAttributes"/>
+        <!-- these next two attributes are mutually exclusive and one is required.
+             but there is no way to define this in a schema... -->
+        <!-- endpoint references - dynamically checked to make sure not top level -->
+        <xsd:attribute name="ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A reference to a global endpoint, which is used as a template to construct this endpoint. A template fixes the address (protocol, path, host, etc.), and may specify initial values for various properties, but further properties can be defined locally (as long as they do not change the address in any way).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <!-- explicit or global endpoints -->
+        <xsd:attribute name="address" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The generic address for this endpoint. If this attribute is used, the protocol must be specified as part of the URI. Alternatively, most transports provide their own attributes for specifying the address (path, host, etc.). Note that the address attribute cannot be combined with 'ref' or with the transport-provided alternative attributes.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:attributeGroup name="restrictedEndpointAttributes">
+        <xsd:attribute name="synchronous" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, the result from the component processing the incoming message will be returned as a response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+
+        <xsd:attribute name="responseTimeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The timeout for a response if making a synchronous endpoint call
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="encoding" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    String encoding used for messages.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="connector-ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the connector associated with this endpoint. This must be specified if more than one connector is defined for this transport.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A list of the transformers that will be applied (in order) to the message before it is delivered to the component.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="responseTransformer-refs" type="xsd:NMTOKENS">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A list of the transformers that will be applied (in order) to the synchronous response before it is returned via the transport.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:complexType name="endpointRefType">
+        <xsd:attribute name="address" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The destination address for a reply message.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The reference name of a global endpoint to use. If this EndpointRef will be associated to a message such as a Reply-To address, this endpoint ref has to be available on the remote Mule instance that reads the Reply-To address.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:group name="endpointTransformers">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows the user to specify either a simple list of normal transformers or separate bracketed lists of normal and response transformers.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:choice>
+            <xsd:group ref="transformersList"/>
+            <xsd:sequence>
+                <xsd:element name="transformers" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A list of transformer elements that will be applied to the message before it is delivered to the component. Note that a list of transformers can also be specified directly (without the 'transformers' element), but then it is not possible to also specify response transformers (using the 'response-transformers' element).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:complexType>
+                        <xsd:group ref="transformersList"/>
+                    </xsd:complexType>
+                </xsd:element>
+                <xsd:element name="response-transformers" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A list of transformer elements that will be applied to the response message returned from the component.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:complexType>
+                        <xsd:group ref="transformersList"/>
+                    </xsd:complexType>
+                </xsd:element>
+            </xsd:sequence>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:group name="transformersList">
+        <xsd:annotation>
+            <xsd:documentation>
+                A list of transformers - normal or response, depending on context.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!--==============================================================-->
+    <!--   Filter elements                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="filter" type="refFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that is defined elsewhere (at the global level, or as a Spring bean).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="refFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the filter to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="not-filter" type="unitaryFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Inverts the enclosed filter. For example, if the filter would normally return true for a specific message, it will now return false, and vice versa.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="unitaryFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="and-filter" type="collectionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Returns true only if all the enclosed filters return true.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="or-filter" type="collectionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Returns true if any of the enclosed filters returns true.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="collectionFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter" minOccurs="2" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="wildcard-filter" type="wildcardFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches string messages against wildcards. It performs matches with "*", for example, "jms.events.*" would catch "jms.events.customer" and "jms.events.receipts". This filter accepts a comma-separated list of patterns, so more than one filter pattern can be matched for a given argument: "jms.events.*, jms.actions.*" will match "jms.events.system" and "jms.actions" but not "jms.queue".
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="wildcardFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="caseSensitivePatternFilterType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="expression-filter" type="expressionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that can evaluate a range of expressions. It supports some base expression types such as header, payload (payload type), regex, and wildcard.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="expressionFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="evaluator" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>The expression evaluator to use. The expression filter supports some types such as header, payload, exception, wildcard, and regex, that are built-in filters not registered with the ExpressionEvaluatorManager. All others are registered with the ExpressionEvaluatorManager. Where XPath, bean, and ONGL are used, the expression should be a boolean expression.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="substitutableName">
+                            <xsd:enumeration value="header"/>
+                            <xsd:enumeration value="payload-type"/>
+                            <xsd:enumeration value="exception-type"/>
+                            <xsd:enumeration value="wildcard"/>
+                            <xsd:enumeration value="regex"/>
+                            <xsd:enumeration value="ognl"/>
+                            <xsd:enumeration value="xpath"/>
+                            <xsd:enumeration value="jxpath"/>
+                            <xsd:enumeration value="groovy"/>
+                            <xsd:enumeration value="bean"/>
+                            <xsd:enumeration value="custom"/>
+                            <xsd:enumeration value="registry"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="expression" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>The expression that will be evaluated. This should always be a boolean expression. The syntax of the expression will be determined by the expression language being used.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="customEvaluator" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>Must be set if the evaluator is set to custom. The custom evaluator must be registered with the ExpressionEvaluatorManager if it is to be used here.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="nullReturnsTrue" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>Whether the filter should return true if the specified expression returns null.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <xsd:element name="regex-filter" type="patternFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches string messages against a regular expression. The Java regular expression engine (java.util.regex.Pattern) is used.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="patternFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="pattern" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The property name and optionally a value to use when matching. If the expression is just a property name, the filter will check that the property exists. Users can also use '=' and '!=' to determine a specific value for a property.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-property-filter" type="caseSensitivePatternFilterType"
+                 substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches properties on a message. This can be very useful, as the message properties represent all the meta information about the message from the underlying transport, so for a message received over HTTP, you can check for HTTP headers and so forth. The pattern should be expressed as a key/value pair, such as "propertyName=value". If you want to compare more than one property, you can use the logic filters for And, Or, and Not expressions. By default, the comparison is case sensitive, which you can override with the 'caseSensitive' property.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="caseSensitivePatternFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="patternFilterType">
+                <xsd:attribute name="caseSensitive" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If false, the comparison ignores case.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="exception-type-filter" type="typeFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches the type of an exception.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="payload-type-filter" type="typeFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches the type of the payload.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="typeFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="expectedType" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The expected class used in the comparison.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-filter" type="customFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented filter.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the Filter interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   Interceptor elements                                       -->
+    <!--==============================================================-->
+    <xsd:element name="abstract-interceptor-stack" abstract="true" type="abstractInterceptorStackType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for interceptor stack elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInterceptorStackType">
+        <xsd:sequence maxOccurs="unbounded">
+            <xsd:element ref="abstract-interceptor"/>
+        </xsd:sequence>
+        <xsd:attribute name="name" type="nonBlankString" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name used to identify this interceptor stack.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:element name="interceptor-stack" type="abstractInterceptorStackType" substitutionGroup="abstract-interceptor-stack"/>
+
+
+    <xsd:element name="abstract-interceptor" abstract="true" type="abstractInterceptorType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an interceptor element.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInterceptorType"/>
+
+    <xsd:group name="interceptorGroup">
+        <xsd:sequence>
+            <xsd:choice maxOccurs="unbounded">
+                <xsd:element ref="abstract-interceptor"/>
+                <xsd:element name="interceptor-stack" type="refInterceptorStackType">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A reference to a stack of intereceptors defined globally.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:complexType name="refInterceptorStackType">
+        <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the interceptor stack to use.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="timer-interceptor" type="abstractInterceptorType" substitutionGroup="abstract-interceptor">
+        <xsd:annotation>
+            <xsd:documentation>
+                The timer interceptor (ported from 1.x).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="logging-interceptor" type="abstractInterceptorType" substitutionGroup="abstract-interceptor">
+        <xsd:annotation>
+            <xsd:documentation>
+                The logging interceptor (ported from 1.x).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="custom-interceptor" type="customInterceptorType" substitutionGroup="abstract-interceptor">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented interceptor.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customInterceptorType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInterceptorType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the Interceptor interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- security filters -->
+
+    <xsd:element name="encryption-security-filter" type="encryptionSecurityFilterType"
+                 substitutionGroup="abstract-security-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that provides password-based encyption.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="encryptionSecurityFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractSecurityFilterType">
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the encryption strategy to use. This should be configured using the 'password-encryption-strategy' element, inside a 'security-manager' element at the top level.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--   Transformer elements                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="transformer" type="refTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A reference to a transformer defined elsewhere.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="refTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the transformer to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="auto-transformer" type="abstractTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that uses the transform discovery mechanism to convert the message payload. This transformer works much better when transforming custom object types rather than Java types, because there is less chance for ambiguity.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="custom-transformer" type="customTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented transformer.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the Transformer interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-properties-transformer" type="messagePropertiesTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that can add or delete message properties.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="messagePropertiesTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:choice minOccurs="1" maxOccurs="unbounded">
+                    <xsd:element name="delete-message-property" type="keyType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Delete a message property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="add-message-property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Add a message property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="rename-message-property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Rename a message property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="add-message-properties" type="mapType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Add a set of message properties.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:choice>
+                <xsd:attribute name="overwrite" type="substitutableBoolean" use="optional" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If false, a property is not added if the message already contains a property with that name.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="no-action-transformer" type="abstractTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that has no effect.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="base64-encoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that base64 encodes a string or byte array message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="base64-decoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that base64 decodes a message to give an array of bytes.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="xml-entity-encoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that encodes a string using XML entities.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="xml-entity-decoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that decodes a string containing XML entities.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="gzip-compress-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that compresses a byte array using gzip.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="gzip-uncompress-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that uncompresses a byte array using gzip.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-hex-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to a string of hexadecimal digits.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="hex-string-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a string of hexadecimal digits to a byte array.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-object-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to an object (either deserializing or converting to a string).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="object-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that serializes all objects except strings (which are converted using getBytes()).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="object-to-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that gives a human-readable description of various types (useful for debugging).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-serializable-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to an object (deserializing the object).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="serializable-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts an object to a byte array (serializing the object).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to a string.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="string-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a string to a byte array.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="append-string-transformer" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that appends a string to a string payload.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="abstractTransformerType">
+                    <xsd:attribute name="message" type="xsd:string" use="required">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The string to append.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="encrypt-transformer" type="encryptionTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that encrypts a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="decrypt-transformer" type="encryptionTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that decrypts a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="encryptionTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the encryption strategy to use. This should be configured using the password-encryption-strategy element, inside a security-manager element at the top level.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="bean-builder-transformer" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that uses expressions to configure a simple bean object.  The user can specify a bean class or factory to create and one or more expressions that are used to configure properties on the bean.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="abstractTransformerType">
+                    <xsd:sequence minOccurs="1" maxOccurs="unbounded">
+                        <xsd:element name="bean-property">
+                            <xsd:complexType>
+                                <xsd:attribute name="name" type="xsd:NMTOKEN" use="required">
+                                    <xsd:annotation>
+                                        <xsd:documentation>
+                                            The name of the bean property
+                                        </xsd:documentation>
+                                    </xsd:annotation>
+                                </xsd:attribute>
+                                <xsd:attributeGroup ref="expressionAttributes"/>
+                                <xsd:attribute name="optional" type="substitutableBoolean" use="optional">
+                                    <xsd:annotation>
+                                        <xsd:documentation>If the expression evaluates to null, whether to continue to the next expression without error.
+                                        </xsd:documentation>
+                                    </xsd:annotation>
+                                </xsd:attribute>
+                            </xsd:complexType>
+                        </xsd:element>
+                    </xsd:sequence>
+                    <xsd:attribute name="beanClass" type="xsd:NMTOKEN">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The bean class to create
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="beanFactory-ref" type="xsd:NMTOKEN">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                A Bean factory to use when creating the bean object.  The factory must implement {{org.mule.api.object.ObjectFactory}}.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="expression-transformer" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that evaluates one or more expressions on the current message. Each expression equates to a parameter in the return message. The return message for two or more expressions will be an Object[].
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="abstractTransformerType">
+                    <xsd:sequence minOccurs="1" maxOccurs="unbounded">
+                        <xsd:element name="return-argument">
+                            <xsd:annotation>
+                                <xsd:documentation>
+                                    A list of expressions, each of which is evaluated and equates to an element in the result message. If just one 'return-argument' is configured, the result will be the evaluation of that expression rather than an object array.
+                                </xsd:documentation>
+                            </xsd:annotation>
+                            <xsd:complexType>
+                                <xsd:attributeGroup ref="expressionAttributes"/>
+                                <xsd:attribute name="optional" type="substitutableBoolean" use="optional">
+                                    <xsd:annotation>
+                                        <xsd:documentation>If the expression evaluates to null, specifies whether to continue to the next expression without error.
+                                        </xsd:documentation>
+                                    </xsd:annotation>
+                                </xsd:attribute>
+                            </xsd:complexType>
+                        </xsd:element>
+                    </xsd:sequence>
+                    <xsd:attribute name="returnSourceIfNull" type="xsd:boolean" use="optional">
+                        <xsd:annotation>
+                            <xsd:documentation>If all expressions return null on this transformer, this flag will cause the source payload to be returned without modification.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:attributeGroup name="expressionAttributes">
+        <xsd:attribute name="evaluator" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The expression evaluator to use. Expression evaluators must be registered with the ExpressionEvaluatorManager before they can be used. Using the custom evaluator allows you to define your own evaluator with the 'custom-evaluator' attribute. Note that some evaluators such as xpath, groovy, and bean are loaded from other Mule modules (XML and Scripting, respectively). These modules must be on your classpath before the evaluator can be used.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="substitutableName">
+                    <xsd:enumeration value="groovy"/>
+                    <xsd:enumeration value="header"/>
+                    <xsd:enumeration value="headers"/>
+                    <xsd:enumeration value="headers-list"/>
+                    <xsd:enumeration value="attachment"/>
+                    <xsd:enumeration value="attachments"/>
+                    <xsd:enumeration value="attachments-list"/>
+                    <xsd:enumeration value="message"/>
+                    <xsd:enumeration value="string"/>
+                    <xsd:enumeration value="map-payload"/>
+                    <xsd:enumeration value="payload"/>
+                    <xsd:enumeration value="mule"/>
+                    <xsd:enumeration value="xpath"/>
+                    <xsd:enumeration value="jxpath"/>
+                    <xsd:enumeration value="bean"/>
+                    <xsd:enumeration value="ognl"/>
+                    <xsd:enumeration value="function">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Foo Bar
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="custom"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="expression" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The expression to evaluate. The syntax of this attribute changes depending on the evaluator being used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="custom-evaluator" type="substitutableName" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>The name of the custom evaluator to use. This attribute is only used when the 'evaluator' attribute is set to "custom". You can plug in your own expression evaluators by registering them with the ExpressionEvaluatorManager.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <!--==============================================================-->
+    <!--   Shared elements                                             -->
+    <!--==============================================================-->
+
+    <xsd:element name="queue-profile" type="queueProfileType" substitutionGroup="abstract-queue-profile">
+        <xsd:annotation>
+            <xsd:documentation>
+                Specifies the properties of an internal Mule queue. Internal queues are used to queue messages for each component managed by Mule.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="queueProfileType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractQueueProfileType">
+                <xsd:attribute name="maxOutstandingMessages" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Defines the maximum number of messages that can be queued.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="persistent" type="substitutableBoolean" default="false">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether Mule messages are persisted to a store. Primarily, this is used for persisting queued messages to disk so that the internal state of the server is mirrored on disk in case the server fails and needs to be restarted. Default is false.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-security-manager" type="abstractSecurityManagerType" abstract="true">
+        <xsd:annotation>
+            <xsd:documentation>
+                A security manager is a container for security providers. More than one security manager may be configured; each contains providers from a particular module and has that module type. This element is abstract - a security-related module or transport will provide a suitable implementation.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="abstractSecurityManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                An empty holder that can be extended by modules that want to provide security managers. Typically it will contain elements called 'module:type-security-provider', which extend securityProviderType where "module" might be "acegi" and "type" might de "delegate", for example. It can also contain encryption strategies, which should follow a similar scheme and extend encryptionStrategyType.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="id" fixed="_muleSecurityManager"/>
+        <xsd:attribute name="name" fixed="_muleSecurityManager"/>
+    </xsd:complexType>
+
+    <xsd:element name="security-manager" type="securityManagerType" substitutionGroup="abstract-security-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default security manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="securityManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default security manager (type 'mule:defaultSecurityManagerType') provides basic support for security functions. Other modules (Acegi, JAAS, PGP) provide more advanced functionality.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractSecurityManagerType">
+                <xsd:sequence>
+                    <xsd:element name="custom-security-provider" type="customSecurityProviderType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                A custom implementation of SecurityProvider.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="custom-encryption-strategy" type="customEncryptionStrategyType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                A custom implementation of EncryptionStrategy.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="secret-key-encryption-strategy" type="secretKeyEncryptionStrategyType"
+                                 minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Provides secret key-based encryption using JCE.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="password-encryption-strategy" type="passwordEncryptionStrategyType"
+                                 minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Provides password-based encryption using JCE. Users must specify a password and optionally a salt and iteration count as well. The default algorithm is PBEWithMD5AndDES, but users can specify any valid algorithm supported by JCE.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="securityProviderType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A security provider is a source of specific security-related functionality.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="name" type="substitutableName" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="encryptionStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                An encryption strategy provides support for a specific encryption algorithm.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="name" type="substitutableName" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="customSecurityProviderType">
+        <xsd:complexContent>
+            <xsd:extension base="securityProviderType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="provider-ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the security provider to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="customEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A reference to the encryption strategy (which may be a Spring bean that implements the EncryptionStrategy interface).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="passwordEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:attribute name="password" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The password to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="salt" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The salt to use (this helps prevent dictionary attacks).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="iterationCount" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The number of iterations to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="secretKeyEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:attribute name="key" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The key to use. This and the 'keyFactory-ref' attribute are mutually exclusive.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="keyFactory-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the key factory to use. This should implement the ObjectFactory interface and return a byte array. This and the 'key' attribute are mutually exclusive.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="threading-profile" type="threadingProfileType"
+                 substitutionGroup="abstract-service-threading-profile">
+        <xsd:annotation>
+            <xsd:documentation>
+                The threading profile to use for the service.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <!-- this is a general threading type used by various elements here -->
+    <xsd:complexType name="threadingProfileType">
+        <xsd:complexContent>
+            <!-- this is a hack that allows us to use this general threading profile as a component threading profile
+                 without retyping everything -->
+            <xsd:extension base="abstractServiceThreadingProfileType">
+                <xsd:attribute name="maxThreadsActive" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The maximum number of threads that will be used.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="maxThreadsIdle" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The maximum number of idle or inactive threads that can be in the pool before they are destroyed.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="threadTTL" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Determines how long an inactive thread is kept in the pool before being discarded.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="poolExhaustedAction">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            When the maximum pool size or queue size is bounded, this value determines how to handle incoming tasks. Possible values are: WAIT (wait until a thread becomes available; don't use this value if the minimum number of threads is zero, in which case a thread may never become available), DISCARD (throw away the current request and return), DISCARD_OLDEST (throw away the oldest request and return), ABORT (throw a RuntimeException), and RUN (the default; the thread making the execute request runs the task itself, which helps guard against lockup).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="WAIT"/>
+                            <xsd:enumeration value="DISCARD"/>
+                            <xsd:enumeration value="DISCARD_OLDEST"/>
+                            <xsd:enumeration value="ABORT"/>
+                            <xsd:enumeration value="RUN"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="threadWaitTimeout" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            How long to wait in milliseconds when the pool exhausted action is WAIT. If the value is negative, it will wait indefinitely.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="doThreading" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether threading should be used (default is true).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="maxBufferSize" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Determines how many requests are queued when the pool is at maximum usage capacity and the pool exhausted action is WAIT. The buffer is used as an overflow.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   Exception strategies                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="default-service-exception-strategy" type="endpointExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Provide default exception handling for a service via an endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="default-connector-exception-strategy" type="endpointExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Provide default exception handling for a connector via an endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="endpointExceptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractExceptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-exception-strategy" type="customExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-defined exception strategy.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customExceptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="endpointExceptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the ExceptionListener interface. In addition, if an 'outbound-endpoint' element is specified, it is set as an "endpoint" bean property.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Custom connector element -->
+
+    <xsd:element name="custom-connector" type="customConnectorType" substitutionGroup="abstract-connector">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-defined connector.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="connectorType">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the Connector interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--  Object stores                                                     -->
+    <!--==============================================================-->
+
+
+    <xsd:complexType name="abstractObjectStoreType"/>
+
+        <xsd:element name="abstract-object-store" abstract="true" type="abstractObjectStoreType">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A placeholder for an object store that can be used by routers to maintain state.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:element>
+
+        <xsd:element name="in-memory-store" type="abstractMonitoredObjectStoreType"
+                     substitutionGroup="abstract-object-store">
+            <xsd:annotation>
+                <xsd:documentation>
+                    An optionally bounded in-memory store for message IDs with periodic expiry of old entries. The bounded size is a soft limit and is only enforced periodically by the expiry process. This means that the store may temporarily exceed its maximum size between expiry runs but will eventually shrink to its configured size.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:element>
+
+        <xsd:element name="simple-text-file-store" type="textFileObjectStoreType" substitutionGroup="abstract-object-store">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A simple object store that stores String objects by key to a text file. This store is only suitable for storing simple key value pair strings. This store is backed by an in-memory store and supports the ability to expire and apply TTL to objects in the store.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:element>
+
+        <xsd:complexType name="textFileObjectStoreType">
+            <xsd:complexContent>
+                <xsd:extension base="abstractMonitoredObjectStoreType">
+                    <xsd:attribute name="directory" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The file location (directory) where the object store will be saved. If this value is not set, Mule defaults to using 'mule.working.dir/objectstore'.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+
+        <xsd:complexType name="abstractMonitoredObjectStoreType">
+            <xsd:complexContent>
+                <xsd:extension base="abstractObjectStoreType">
+                    <xsd:attribute name="name" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                An ID for this store that can be used for logging and identification purposes.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="maxEntries" type="substitutableInt">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The maximum number of entries that this store keeps around. Specify '-1' if the store is supposed to be "unbounded".
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="entryTTL" type="substitutableInt">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The time-to-live for each message ID, specified in seconds, or '-1' for entries that should never expire. DO NOT combine this with an unbounded store!
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="expirationInterval" type="substitutableInt">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The interval for periodic bounded size enforcement and entry expiration, specified in seconds. Arbitrary positive values between one second and several hours or days are possible, but should be chosen carefully according to the expected message rate to prevent OutOfMemory conditions.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--  Routers                                                     -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-message-info-mapping" abstract="true" type="abstractMessageInfoMappingType">
+        <xsd:annotation>
+            <xsd:documentation>Maps the attributes of the current message to known message elements in Mule, namely Message ID and CorrrelationID.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractMessageInfoMappingType"/>
+
+    <!-- Inbound Router implementations -->
+
+    <xsd:complexType name="filteredInboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter" minOccurs="0"/>
+                    <!-- TODO this does not make sense here, need to re-visit <xsd:element ref="abstract-message-info-mapping" minOccurs="0"/>-->
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="idempotent-receiver-router" type="idempotentReceiverType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Ensures that only unique messages are received by a service by checking the unique ID of the incoming message. Note that the ID used can be generated from the message using an expression defined in the 'idExpression' attribute. By default, the expression used is '#[message:id]', which means the underlying endpoint must support unique message IDs for this to work. Otherwise, a UniqueIdNotSupportedException is thrown.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="idempotent-secure-hash-receiver-router" type="idempotentSecureHashReceiverType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Ensures that only unique messages are received by a service by calculating the hash of the message itself using a message digest algorithm. This provides a value with an infinitesimally small chance of a collision. This can be used to filter message duplicates. Keep in mind that the hash is calculated over the entire byte array representing the message, so any leading or trailing spaces or extraneous bytes (like padding) can produce different hash values for the same semantic message content. Care should be taken to ensure that messages do not contain extraneous bytes. This class is useful when the message does not support unique identifiers.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="idempotentReceiverType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-object-store" maxOccurs="1" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="idExpression" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Defines one or more expressions to use when extracting the ID from the message. For example, it would be possible to combine to headers as the ID of the message to provide idempotency: '#[headers:foo,bar]'. Or, you could combine the message ID with a header: '#[message:id]-#[header:foo]'. If this property is not set, '#[message:id]' will be used by default.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="idempotentSecureHashReceiverType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-object-store" maxOccurs="1" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="messageDigestAlgorithm" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The secure hashing algorithm to use. If not set, the default is SHA-256.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <xsd:element name="wire-tap-router" type="wireTapRouterType" substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                The WireTap inbound router allows you to route certain messages to a different endpoint as well as to the component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="wireTapRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="1" maxOccurs="1"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="forwarding-router" type="selectiveConsumerRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows messages to be forwarded to the outbound routers without first being processed by a component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="selective-consumer-router" type="selectiveConsumerRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Applies one or more filters to the incoming message. If the filters match, the message is forwarded to the component. Otherwise, the message is forwarded to the catch-all strategy on the router. If no catch-all strategy is configured, the message is ignored and a warning is logged.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="correlation-resequencer-router" type="baseAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Holds back a group of messages and resequences them using each message's correlation sequence property.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="selectiveConsumerRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="transformFirst" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Specifies whether transformations are applied before filtering occurs. The default is true.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-chunking-aggregator-router" type="messageChunkingAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Combines two or more messages into a single message by matching messages with a given Correlation ID. Correlation IDs are set on messages when they are dispatched by certain outbound routers, such as the Recipient List and Message Splitter routers. These messages can be aggregated back together again using this router.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="messageChunkingAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="baseAggregatorRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-message-info-mapping" minOccurs="0"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-correlation-aggregator-router" type="customCorrelationAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a custom message aggregator. Mule provides an abstract implementation that has a template method that performs the message aggregation. A common use of the aggregator router is to combine the results of multiple requests such as "ask this set of vendors for the best price of X".
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customCorrelationAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="messageChunkingAggregatorRouterType">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Fully qualified class name of the custom correlation aggregator router to be used.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="collection-aggregator-router" type="baseAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a Collection Response Router. This will return a MuleMessageCollection message type that will contain all messages received for a each correlation group.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="custom-inbound-router" type="customInboundRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows for custom inbound routers to be configured.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="customInboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Spring-style property elements so that custom configuration can be configured on the custom router.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of InboundRouter (fully qualified Java class name)
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:attribute name="timeout" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Defines a timeout in Milliseconds to wait for events to be aggregated. By default the router will throw an exeception if the router is waiting for a correlation group and times out before all group enties are received.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="failOnTimeout" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            When false, incomplete aggregation groups will be forwarded to a component on timeout as a java.util.List. When true (default), a CorrelationTimeoutException is thrown and RoutingNotification.CORRELATION_TIMEOUT is fired. The component doesn't receive any messages in this case.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- ResponseRouters -->
+
+    <xsd:element name="single-async-reply-router" type="asyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a Single Response Router. This will return the first message it receives on a reply endpoint and will discard the rest.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="collection-async-reply-router" type="asyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a Collection Response Router. This will return a MuleMessageCollection message type that will contain all messages received for the current correlation.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="asyncReplyRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractAsyncReplyRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The endpoint used to receive the response(s) on.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element ref="abstract-message-info-mapping" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The message info mapper used to extract key bits of the message information, such as Message ID or Correlation ID.  these properties are used by some routers and this mapping information tells Mule where to get the information from in the current message.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-async-reply-router" type="customAsyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router"/>
+    <xsd:complexType name="customAsyncReplyRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="asyncReplyRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Spring-style property elements so that custom configuration can be configured on the custom router.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A fully qualified Java class name of the router to use. The router should either extend {{org.mule.routing.response.AbstractResponseRouter}} or {{org.mule.routing.response.AbstractResponseAggregator}}.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- Outbound Router implementations -->
+
+    <!-- Outbound router element and attribute groups -->
+
+    <xsd:group name="defaultOutboundRouterElements">
+        <xsd:sequence>
+            <xsd:element name="reply-to" type="endpointRefType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Defines where the message should be routed after the recipient of the message to which this service dispatches has finished with it.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-transaction" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Defines an overall transaction that will be used for all endpoints on this router.  This is only useful when you want to define an outbound only transaction that will commit all of the transactions defined on the outbound endpoints for this router.  Note that you must still define a transaction on each of the endpoints that should take part in the transaction.  These transactions should always be configured to JOIN the existing transaction.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-message-info-mapping" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The message info mapper used to extract key bits of the message information, such as Message ID or Correlation ID.  these properties are used by some routers and this mapping information tells Mule where to get the information from in the current message.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:group name="defaultFilteredOutboundRouterElements">
+        <xsd:sequence>
+            <xsd:group ref="defaultOutboundRouterElements" />
+            <xsd:element ref="abstract-filter" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Filters the messages to be processed by this router.
+                        @Deprecated since 2.2.  Configure the filter on the endpoint instead of the router.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Filters are applied before message transformations. A transformer can be configured here to transform messages before they are filtered.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:attributeGroup name="defaultOutboundRouterAttributes">
+        <xsd:attribute name="enableCorrelation" default="IF_NOT_SET">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Specifies whether Mule should give outgoing messages a correlation ID. The default behavior is to give messages a correlation ID only if they don't already have one, so that existing correlation IDs are maintained.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="ALWAYS" />
+                    <xsd:enumeration value="NEVER" />
+                    <xsd:enumeration value="IF_NOT_SET" />
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:attributeGroup name="defaultFilteredOutboundRouterAttributes">
+        <xsd:attributeGroup ref="defaultOutboundRouterAttributes"/>
+        <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A list of the transformers that will be applied to the message in order before it is delivered to the component.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <!-- Default Outbound Router Types -->
+    <xsd:complexType name="outboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint"/>
+                    <xsd:group ref="defaultOutboundRouterElements"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultOutboundRouterAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="filteringOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint"/>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+     <xsd:complexType name="multipleEndpointFilteringOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" maxOccurs="unbounded"/>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="singleEndpointFilteringOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" maxOccurs="1"/>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--  Concrete Outbound Routers -->
+
+    <xsd:element name="pass-through-router" type="outboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                This router always matches and simply sends or dispatches message via the endpoint that is configured.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!--  FilteringOutboundRouter only uses a single endpoint. For now this needs to support multiple endpoints for MessageBuilderComponent usage only. -->
+    <xsd:element name="filtering-router" type="singleEndpointFilteringOutboundRouterType" substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Uses filters to determine whether the message matches a particular criteria and if so will route the message to the endpoint configured on the router.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="template-endpoint-router" type="filteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows endpoints to be altered at runtime based on properties set on the current message or fallback values set on the endpoint properties. Templated values are expressed using square braces around a property name.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="chaining-router" type="multipleEndpointFilteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends the message through multiple endpoints using the result of the first invocation as the input for the next.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="exception-based-router" type="multipleEndpointFilteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends a message over an endpoint by selecting the first endpoint that can connect to the transport.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="multicasting-router" type="multipleEndpointFilteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends the same message over multiple endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="endpoint-selector-router" type="endpointSelectorRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Selects the outgoing endpoint based on an expression evaluator ("header:endpoint" by default). It will first try to match the endpoint by name and then by address. The endpoints to use can be set on the router itself or be global endpoint definitions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="endpointSelectorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="multipleEndpointFilteringOutboundRouterType">
+                <xsd:attributeGroup ref="expressionAttributes"/>
+                <xsd:attribute name="default" type="xsd:NMTOKEN" use="optional">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the default endpoint to use if the expression returns null. This can be used as an 'else' condition to route messages that don't contain the expected routing information.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Splitter routers -->
+
+    <!-- Extends AbstractMessageSplitter-->
+    <xsd:complexType name="messageSplitterOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="multipleEndpointFilteringOutboundRouterType">
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Extends AbstractRoundRobinMessageSplitter -->
+    <xsd:complexType name="roundRobinSplitterType">
+        <xsd:complexContent>
+            <xsd:extension base="messageSplitterOutboundRouterType">
+                <xsd:attribute name="deterministic" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If 'disableRoundRobin' is false and this option is true (the default) then the first message part will be routed to the first endpoint, the second part to the second endpoint, etc, with the nth part going to the (n modulo number of endpoints) endpoint. If false then the messages will be distributed equally amongst all endpoints.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="disableRoundRobin" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If filters are being used on endpoints then round robin behaviour is probably not desirable. This flag switches round robin behaviour off, it is on by default.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="failIfNoMatch" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If 'disableRoundRobin' is true, there may be situations where the current split message does not match any endpoints.  this flag controls whether an exception should be thrown when a match is not found.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="list-message-splitter-router" type="roundRobinSplitterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                The Filtering List Message Splitter accepts a list of objects that is split each object being routed to different endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="expression-splitter-router" type="expressionSplitterOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Splits the message based on an expression. The expression must return one or more message parts in order to be effective.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+
+    <xsd:complexType name="expressionSplitterOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="roundRobinSplitterType">
+                <xsd:attributeGroup ref="expressionAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Messgae chunking routers -->
+    <xsd:element name="message-chunking-router" type="chunkingRouterType" substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows you to split a single message into a number of fixed-length messages that will all be routed to the same endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="chunkingRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="multipleEndpointFilteringOutboundRouterType">
+                <xsd:attribute name="messageSize" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The message chunk size (in bytes) that the current message will be split into. Note that this is mutually exclusive to the 'numberOfMessages' property.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="numberOfMessages" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The number of message peices to break the current message into.  This property is less useful than the 'message' size property since, usually messages are constricted by size. Note that this is mutually exclusive to the 'messageSize' property.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- recipient List routers -->
+    <xsd:element name="static-recipient-list-router" type="staticRecipientListRouterType" substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends the same message to multiple endpoints over the same endpoint, or implements routing-slip behavior where the next destination for the message is determined from message properties or the payload. It uses a static list of recipient endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="staticRecipientListRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                    <xsd:element name="recipients" type="listOrSetType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Static list of recipients that the outgoing message is sent to. The default delimiter is ','.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+                <xsd:attribute name="recipientsProperty" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Defines a property name on the current message where a list of endpoint names (or URIs) can be obtained. This property can return a {{java.util.List}} of values or a delimited {{java.lang.String}}. If the 'recipientsProperty' returns a string then the 'recipientsDelimiter' property is used to split the string.
+                            If the entries in the String or List define endpoint names, these will be looked up at runtime. If the entries define endpoint URIs these endpoints will be created at runtime.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="recipientsDelimiter" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The delimiter to use when splitting a String list of recipients.  the default is ','. This property is only used with the 'recipientsProperty'.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="synchronous" type="xsd:boolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            This flag controls whether the message will be sent to the recipients synchronously. Unlike other routers th recipient list router doesn't have pre-configured endpoints so the synchronicity of the endpoint cannot be honoured.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="expression-recipient-list-router" type="expressionRecipientListRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends the same message to multiple endpoints over the same endpoint, or implements routing-slip behavior where the next destination for the message is determined from message properties or the payload. The recipients can be extracted from the message using an expression, or you can specify a static list of recipient endpoints. (As of version 2.1)
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="expressionRecipientListRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                    <xsd:element name="recipients" type="listOrSetType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                A static list of endpoint names or URIs that will be used as recipients of the current message. If the expression on this router returns a list of endpoint names, the endpoints here will be checked as well as any global endpoints.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+                <xsd:attributeGroup ref="expressionAttributes"/>
+                <xsd:attribute name="synchronous" type="xsd:boolean">
+                    <xsd:annotation>
+                        <xsd:documentation>This flag controls whether the message will be sent to the recipients synchronously. Unlike other routers th recipient list router doesn't have pre-configured endpoints so the synchronicity of the endpoint cannot be honoured.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- custom router -->
+    <xsd:element name="custom-outbound-router" type="customOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows you to configure a custom outbound router by specifying the custom router class and by using Spring properties.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Spring-style property elements so that custom configuration can be configured on the
+                                custom router.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of OutboundRouter (fully qualified Java class name)
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- Catch all strategy implementations -->
+    <xsd:element name="logging-catch-all-strategy" type="loggingCatchAllStrategyType" substitutionGroup="abstract-catch-all-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Does nothing with the message but simply logs (using the WARN log level) the fact that the message was not dispatched because no routing path was defined.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="loggingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-catch-all-strategy" type="customCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="customCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Fully qualified class name of the custom catch-all strategy to be used.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="forwarding-catch-all-strategy" type="forwardingCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Forwards the message to the specified endpoint if no outbound routers match.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="forwardingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-forwarding-catch-all-strategy" type="customForwardingCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="customForwardingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="forwardingCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Fully qualified class name of the custom forwarding catch-all strategy to be used.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Message Info Mappers -->
+
+    <xsd:element name="expression-message-info-mapping" type="expressionMessageInfoMappingType"
+                 substitutionGroup="abstract-message-info-mapping">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows expressions to be configured to extract the message information.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="expressionMessageInfoMappingType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractMessageInfoMappingType">
+                <xsd:attribute name="messageIdExpression" type="xsd:string" use="required"/>
+                <xsd:attribute name="correlationIdExpression" type="xsd:string" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-message-info-mapping" type="customMessageInfoMappingType"
+                 substitutionGroup="abstract-message-info-mapping">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows configuraton of a custom implementation of MessageInfoMapping.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customMessageInfoMappingType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractMessageInfoMappingType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the MessageInfoMapping interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!--==============================================================-->
+    <!--  Lifecycle Adapters                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-lifecycle-adapter-factory" abstract="true" type="abstractLifecycleAdapterFactory"/>
+    <xsd:complexType name="abstractLifecycleAdapterFactory">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows a lifecycle adaptor factory to be implemented, which allows an alternative custom lifecycle adaptor to be used if required instead of the default implementation that propagates the Mule lifecycle to component implementations.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:complexType>
+    <xsd:complexType name="customLifecycleAdapterFactory">
+        <xsd:complexContent>
+            <xsd:extension base="abstractLifecycleAdapterFactory">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the LifecycleAdapter interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:element name="custom-lifecycle-adapter-factory" type="customLifecycleAdapterFactory"
+                 substitutionGroup="abstract-lifecycle-adapter-factory">
+        <xsd:annotation>
+            <xsd:documentation>
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!--==============================================================-->
+    <!--  Object Factories                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-object-factory" abstract="true" type="abstractObjectFactoryType"/>
+    <xsd:complexType name="abstractObjectFactoryType">
+        <xsd:annotation>
+            <xsd:documentation>
+                An object factory is used to obtain object instances. The object factory is responsible for object creation and can implement different patterns, such a singleton or prototype, or lookup an instance from other object containers.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="propertiesGroup">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Properties to be set on the created object.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:group>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="genericObjectFactoryType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-object-factory"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="spring-object" type="springBeanLookupType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="springBeanLookupType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Object factory used to obtain Spring bean instances. This object factory does not create any instances but rather looks them up from Spring.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="bean" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>Name of Spring bean to look up.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="singleton-object" type="singletonObjectFactoryType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="singletonObjectFactoryType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Object factory that creates and always returns a singleton object instance.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>Class name</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="prototype-object" type="prototypeObjectFactoryType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="prototypeObjectFactoryType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Object factory that creates and returns a new 'prototype' object instance every time it is called.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>Class name</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-pooling-profile" abstract="true" type="abstractPoolingProfileType"/>
+    <xsd:complexType name="abstractPoolingProfileType"/>
+
+    <xsd:element name="pooling-profile" type="poolingProfileType" substitutionGroup="abstract-pooling-profile"/>
+    <xsd:complexType name="poolingProfileType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A pooling profile is used to configure the pooling behaviour of Mule components. Each component can have its own pooling profile.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractPoolingProfileType">
+                <xsd:attribute name="maxActive" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>Controls the maximum number of Mule components that can be borrowed from a session at one time. When set to a negative value, there is no limit to the number of components that may be active at one time. When maxActive is exceeded, the pool is said to be exhausted.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="maxIdle" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>Controls the maximum number of Mule components that can sit idle in the pool at any time. When set to a negative value, there is no limit to the number of Mule components that may be idle at one time.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="initialisationPolicy" default="INITIALISE_ONE">
+                    <xsd:annotation>
+                        <xsd:documentation>Determines how components in a pool should be initialized. The possible values are: INITIALISE_NONE (will not load any components into the pool on startup), INITIALISE_ONE (will load one initial component into the pool on startup), or INITIALISE_ALL (will load all components in the pool on startup)</xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="INITIALISE_NONE"/>
+                            <xsd:enumeration value="INITIALISE_ONE"/>
+                            <xsd:enumeration value="INITIALISE_ALL"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="exhaustedAction" default="WHEN_EXHAUSTED_GROW">
+                    <xsd:annotation>
+                        <xsd:documentation>Specifies the behavior of the Mule component pool when the pool is exhausted. Possible values are: "WHEN_EXHAUSTED_FAIL", which will throw a NoSuchElementException, "WHEN_EXHAUSTED_WAIT", which will block by invoking Object.wait(long) until a new or idle object is available, or WHEN_EXHAUSTED_GROW, which will create a new Mule instance and return it, essentially making maxActive meaningless. If a positive maxWait value is supplied, it will block for at most that many milliseconds, after which a NoSuchElementException will be thrown. If maxThreadWait is a negative value, it will block indefinitely.</xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="WHEN_EXHAUSTED_GROW"/>
+                            <xsd:enumeration value="WHEN_EXHAUSTED_WAIT"/>
+                            <xsd:enumeration value="WHEN_EXHAUSTED_FAIL"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="maxWait" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>Specifies the number of milliseconds to wait for a pooled component to become available when the pool is exhausted and the exhaustedAction is set to WHEN_EXHAUSTED_BLOCK.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <!-- <xsd:attribute name="factory" type="xsd:string" default="org.mule.config.pool.CommonsPoolFactory"/> -->
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--  Utils / Standard Types                                      -->
+    <!--==============================================================-->
+
+
+    <xsd:complexType name="abstractAgentType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for agents. Not used in core, but common to several modules.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractExtensionType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsIndirectKeyStore, named as tls-client in transport namespace -->
+    <xsd:complexType name="tlsClientKeyStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configure client key stores. TLS/SSL connections are made on behalf of an entity, which can be anonymous or identified by a certificate. This interface specifies how a keystore can be used to provide the certificates (and associated private keys) necessary for identification. This is also used as the trust store if no other trust store is specified and the explicitTrustStoreOnly parameter in the server trust store configuration is false. WARNING - due to restrictions in library implementations the values specified here typically apply to all connectors using this transport.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if possible) of the keystore that contains public certificates and private keys for identification.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the keystore.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The type of keystore used (a Java class name).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsDirectKeyStore, named as tls-key-store in transport namespace -->
+    <xsd:complexType name="tlsKeyStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures key stores. TLS/SSL connections are made on behalf of an entity, which can be anonymous or identified by a certificate. This interface specifies how a keystore can be used to provide the certificates (and associated private keys) necessary for identification.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if possible) of the keystore that contains public certificates and private keys for identification.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The type of keystore used (a Java class name).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="keyPassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the private key.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the keystore.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="algorithm" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The algorithm used by the key store.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsIndirectTrustStore, named as tls-trust-store in transport namespace -->
+    <xsd:complexType name="tlsTrustStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a trust store. TLS/SSL connections are made to trusted systems. The public certificates of trusted systems are stored in a keystore (called a trust store) and used to verify that the connection made to a remote system is the expected identity.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if possible) of the keystore that contains public certificates of trusted servers.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the trust store.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsDirectTrustStore, named as tls-server in transport namespace
+         note that this extends tlsTrustStoreType, so only one of the two is needed -->
+    <xsd:complexType name="tlsServerTrustStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a direct trust store. TLS/SSL connections are made to trusted systems. The public certificates of trusted systems are stored in a keystore (called a trust store) and used to verify that the connection made to a remote system is the expected identity.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="tlsTrustStoreType">
+                <xsd:attribute name="class" type="substitutableClass"/>
+                <xsd:attribute name="algorithm" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The algorithm used by the trust store.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <!-- should be of type TrustManagerFactory -->
+                <xsd:attribute name="factory-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Reference to a TrustManagerFactory configured as a Spring bean.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="explicitOnly" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Specifies whether the key store data should not be used when a trust store is otherwise undefined.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="requireClientAuthentication" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If a server socket is constructed directly, this attribute is used to determine whether client authentication is required. This does not apply to client connections.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsProtocolHandler, named as tls-protocol-handler -->
+    <xsd:complexType name="tlsProtocolHandler">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures the global Java protocol handler. WARNING - Untested.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="property" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Sets the java.protocol.handler.pkgs system property.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:simpleType name="propertyPlaceholderType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A type that defines a Mule-style property placeholder.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:string">
+            <xsd:pattern value="(\#\[[^\]]+\]|\$\{[^\}]+\})"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableClass">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:NMTOKEN-like type that also allows for Ant-style property placeholders and a leading "[".
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:string">
+                    <xsd:pattern value="\[?[A-Za-z0-9_\.$]+"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="nonBlankString">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:string-like type that cannot be empty.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:string">
+                    <xsd:pattern value=".*[^ ]+.*"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableName">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:NMTOKEN type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutablePortNumber">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:int type that also allows for Ant-style property placeholders and restricts the int value to a valid port number.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:int">
+                    <xsd:minInclusive value="0"/>
+                    <xsd:maxInclusive value="65536"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableInt">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:int type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:int"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableLong">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:long type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:long"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableBoolean">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:boolean type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:boolean"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <!-- i found this a bit confusing, so here is some background...
+         this type is typically called from something like
+           <xsd:element name="properties" type="mapType/>
+         and the "properties" element generates a ChildMapDefinitionParser that
+         can "receive" the map entries generated by the embedded spring <entry..>
+         elements and which is then set via "setProperties" on the parent.
+         in other words, it's a map, and despite the name "properties" has
+         nothing to do with the spring <property ...> element.
+         spring elements like <entry...> are handled by
+         MuleHierarchicalBeanDefinitionParserDelegate which punts them to
+         the spring handler -->
+    <xsd:element name="properties" type="mapType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A map of Mule properties.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="mapType">
+        <xsd:complexContent>
+            <xsd:extension base="spring:mapType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:group name="propertiesGroup">
+        <xsd:sequence>
+            <xsd:element name="property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Sets a Mule property. This is a name/value pair that can be set on components, services, etc., and which provide a generic way of configuring the system. Typically, you shouldn't need to use a generic property like this, since almost all functionality is exposed via dedicated elements. However, it can be useful in configuring obscure or overlooked options and in configuring transports from the generic endpoint elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="properties" minOccurs="0"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:complexType name="listOrSetType">
+        <xsd:complexContent>
+            <xsd:extension base="spring:listOrSetType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="referenceType">
+        <xsd:attribute name="ref" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="keyType">
+        <xsd:attribute name="key" type="xsd:string"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="valueType">
+        <xsd:attribute name="value" type="xsd:string"/>
+        <xsd:attribute name="value-ref" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="keyValueType">
+        <xsd:complexContent>
+            <xsd:extension base="keyType">
+                <xsd:attribute name="value" type="xsd:string"/>
+                <xsd:attribute name="value-ref" type="xsd:NMTOKEN"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   Connector support                                          -->
+    <!--==============================================================-->
+
+    <xsd:complexType name="connectorType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractConnectorType">
+                <xsd:sequence>
+                    <!-- for normal connectors, this is for emergency use only, but it is
+                         critical for custom connector -->
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element name="receiver-threading-profile" type="threadingProfileType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The threading profile to use when a connector receives messages.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="dispatcher-threading-profile" type="threadingProfileType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The threading profile to use when a connector dispatches messages.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element ref="abstract-exception-strategy" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The exception strategy to use when errors occur in the connector.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element ref="abstract-retry-policy" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Retry policy that defines how Mule should retry if a receive/request/dispatch operation fails.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="service-overrides" type="serviceOverridesType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Service overrides allow the connector to be further configured/customized by allowing parts of the transport implementation to be overridden, for example, the message receiver or dispatcher implementation, or the message adaptor that is used.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="createMultipleTransactedReceivers" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether to create multiple concurrent receivers for this connector. This property is used by transports that support transactions, specifically receivers that extend the TransactedPollingMessageReceiver, and provides better throughput.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="numberOfConcurrentTransactedReceivers" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If createMultipleTransactedReceivers is set to true, the number of concurrent receivers that will be launched.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="dynamicNotification" type="substitutableBoolean" default="false">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Enables dynamic notifications for notifications fired by this connector. This allows listeners to be registered dynamically at runtime via the MuleContext, and the configured notification can be changed. This overrides the default value defined in the 'configuration' element.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="validateConnections" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Causes Mule to validate connections before use. Note that this is only a configuration hint,
+                            transport implementations may or may not make an extra effort to validate the connection. Default is true.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="serviceOverridesType">
+        <xsd:attribute name="messageReceiver" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="transactedMessageReceiver" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="xaTransactedMessageReceiver" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="dispatcherFactory" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="inboundTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="outboundTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="responseTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="endpointBuilder" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="messageAdapter" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="streamMessageAdapter" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="serviceFinder" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="sessionHandler" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   JNDI support                                               -->
+    <!--==============================================================-->
+
+    <xsd:complexType name="jndiConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="connectorType">
+                <xsd:sequence>
+                    <xsd:element name="jndi-provider-property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Direct setting of a JNDI property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="jndi-provider-properties" type="mapType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Direct setting of JNDI properties (allows access to the full Spring map entry).
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="jndiContext-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Set the complete context directly, via a bean reference.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiInitialFactory" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The initial context factory to use. The value of the property should be the fully qualified class name of the factory class that will create an initial context.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiProviderUrl" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The service provider to use. The value of the property should contain a URL string (such as "ldap://somehost:389").
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiUrlPkgPrefixes" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The list of package prefixes to use when loading in URL context factories. The value of the property should be a colon-separated list of package prefixes for the class name of the factory class that will create a URL context factory.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="dataReferenceType" mixed="true">
+        <xsd:attribute name="file" type="xsd:string"/>
+        <xsd:attribute name="ref" type="xsd:string"/>
+        <!--I don't like this flag, may be we could use content-type mappings... -->
+        <xsd:attribute name="binary" type="substitutableBoolean"/>
+    </xsd:complexType>
+
+    <!-- these cannot be references (unless we use qualified attribute names, which are ugly),
+         but serve as templates to cut+paste in individual transports
+
+    <xsd:attribute name="path" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A file location.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="user" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A username.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="password" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A password.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="host" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                An IP address (eg www.mulesource.com, localhost, 127.0.0.1).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="port" type="substitutablePortNumber">
+        <xsd:annotation>
+            <xsd:documentation>
+                A port number.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    -->
+
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/MuleConfigValidation.xml b/xml/tests/testData/xml/MuleConfigValidation.xml
new file mode 100644
index 0000000..2c38922
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigValidation.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns:spring="http://www.springframework.org/schema/beans"
+      xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.2"
+      xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
+http://www.mulesource.org/schema/mule/stdio/2.2 http://www.mulesource.org/schema/mule/stdio/2.2/mule-stdio.xsd">
+
+    <model name="Test">
+
+        <service name="SimpleBridge">
+            <inbound>
+                <stdio:inbound-endpoint system="IN"/>
+            </inbound>
+
+            <outbound>
+                <pass-through-router>
+                    <stdio:outbound-endpoint system="OUT"/>
+                </pass-through-router>
+            </outbound>
+        </service>
+
+    </model>
+
+</mule>
diff --git a/xml/tests/testData/xml/MuleConfigValidationSchemas/mule-schemadoc.xsd b/xml/tests/testData/xml/MuleConfigValidationSchemas/mule-schemadoc.xsd
new file mode 100644
index 0000000..d9ddeba
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigValidationSchemas/mule-schemadoc.xsd
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/schemadoc/2.2"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://www.mulesource.org/schema/mule/schemadoc/2.2"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+    <xsd:annotation>
+        <xsd:documentation>This schema provides a schema doc extentions that can be embedded in Mule schemas. These
+            elements will be used to render additional wiki content associated with the element being annotated.
+            Elements within this schema should be embedded under 'xsd:element/xsd:annotation/xsd:appinfo'.
+            To stick to convention and to ensure that XSLs will work this schema should be included in other mule
+            schemas using the 'schemadoc' prefix namespace.
+        </xsd:documentation>
+        <xsd:appinfo>
+            <page-title>SchemaDoc Reference</page-title>
+        </xsd:appinfo>
+    </xsd:annotation>
+
+    <xsd:element name="snippet" type="snippetType">
+        <xsd:annotation>
+            <xsd:documentation>The snippet allows for code snippets to be associated with an element in a schema. This
+                is useful for surfacing documentation on the wiki. When the schema reference is generated for the wiki,
+                the code snippets will also be rendered when using the 'single-element-wike.xsl'.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="page-title" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>The page title to use when rendering this schema.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="short-name" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>The short name of the module or transport, i.e. 'xml' or 'tcp'.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="additional-documentation" type="additionalDocumentationType">
+        <xsd:annotation>
+            <xsd:documentation>Additional documentation that can be rendered with the schema. Note that this element can
+                only be used in {{/xsd:schema/xsd:annotation/xsd:appinfo}}, it will be ignorred if used anywhere else.
+                Enter
+                the documentation in the body of this element.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="additionalDocumentationType" mixed="true">
+        <xsd:attribute name="where" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The point at which the documentation is rendered.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="before-common-elements">
+                        <xsd:annotation>
+                            <xsd:documentation>The documentation will appear after any title text but before any of the
+                                common elements are rendered.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="after-common-elements">
+                        <xsd:annotation>
+                            <xsd:documentation>The documentation will appear right after common elements are rendered.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="before-specific-elements">
+                        <xsd:annotation>
+                            <xsd:documentation>The documentation will appear right before the elements specific to the
+                                schema are rendered.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="after-specific-elements">
+                        <xsd:annotation>
+                            <xsd:documentation>The documentation will appear right after the elements specific to the
+                                schema are rendered.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="before-single-element">
+                        <xsd:annotation>
+                            <xsd:documentation>If a specific element was named, this documentation will appear directly
+                                before the element. The mode is less useful but supported for completeness.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="after-single-element">
+                        <xsd:annotation>
+                            <xsd:documentation>If a specific element was named, this documentation will appear directly
+                                after the element. The mode is less useful but supported for completeness.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="snippetType" mixed="true">
+        <xsd:attribute name="id" type="xsd:NMTOKEN" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The ID of the snippet to embed in the wiki page. This ID is embedded in the source
+                    file using a START SNIPPET xxx comment.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="lang">
+            <xsd:annotation>
+                <xsd:documentation>The language format to use when rendering the content of the snippet on the wiki.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="xml"/>
+                    <xsd:enumeration value="java"/>
+                    <xsd:enumeration value="javadoc"/>
+                    <xsd:enumeration value="bash"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="sourcePath" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>This is the path to the source file. Note this should be relative to the project root
+                    directory i.e. transport/jms/src/main/resources/etc...
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="transport-features" type="transportFeaturesType">
+        <xsd:annotation>
+            <xsd:documentation>Defines meta information about transports such as whether they can send or receive events
+                and if they supprt transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="transportFeaturesType">
+        <xsd:sequence>
+            <xsd:element name="inboundMEPs" type="inboundMEPsType" minOccurs="1">
+                <xsd:annotation>
+                    <xsd:documentation>The Inbound MEPs that are supported by this Transport.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="outboundMEPs" type="outboundMEPsType" minOccurs="1">
+                <xsd:annotation>
+                    <xsd:documentation>The Outbound MEPs that are supported by this Transport.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="receiveEvents" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether the transport can receive events and thus can be used for an inbound
+                    endpoint.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="dispatchEvents" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Ehether the transport can be used to dispatch events and thus is supported as an
+                    outbound endpoint.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="requestEvents" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether the transport can be used to request events directly from the source.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="responseEvents" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether the transport can be used in request/response style messaging. This means
+                    that the transport provides a back-channel to the callee.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="transactions" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether transactions are supported by the transports. Transports that support (/)A
+                    transactions can be configured in a distributed 2 Phase Commit (Distributed) transaction.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="transactionTypes" type="xsd:string" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>A comma separated list of transaction types, i.e. local, XA</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="streaming" type="xsd:boolean" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Whether the transport supports streaming of the data is provides or publishes.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:complexType name="inboundMEPsType">
+        <xsd:attribute name="none" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="in-only" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="in-out" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="in-optional-out" type="xsd:boolean"></xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="outboundMEPsType">
+        <xsd:attribute name="none" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="out-only" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="out-in" type="xsd:boolean"></xsd:attribute>
+        <xsd:attribute name="out-optional-in" type="xsd:boolean"></xsd:attribute>
+    </xsd:complexType>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/MuleConfigValidationSchemas/mule-stdio.xsd b/xml/tests/testData/xml/MuleConfigValidationSchemas/mule-stdio.xsd
new file mode 100644
index 0000000..ca5379f
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigValidationSchemas/mule-stdio.xsd
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/stdio/2.2"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:mule="http://www.mulesource.org/schema/mule/core/2.2"
+            xmlns:schemadoc="http://www.mulesource.org/schema/mule/schemadoc/2.2" 
+            targetNamespace="http://www.mulesource.org/schema/mule/stdio/2.2"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+    <xsd:import namespace="http://www.mulesource.org/schema/mule/core/2.2" 
+                schemaLocation="http://www.mulesource.org/schema/mule/core/2.2/mule.xsd" />
+    <xsd:import namespace = "http://www.mulesource.org/schema/mule/schemadoc/2.2"
+                schemaLocation = "http://www.mulesource.org/schema/mule/schemadoc/2.2/mule-schemadoc.xsd"/>
+
+    <xsd:annotation>
+        <xsd:documentation>
+            The STDIO transport The STDIO Transport allows the reading and writing of streaming data to Java's System.out and System.in objects for debugging.
+        </xsd:documentation>
+        <xsd:appinfo>
+            <schemadoc:short-name>STDIO</schemadoc:short-name>
+            <schemadoc:page-title>STDIO Transport</schemadoc:page-title>
+            <schemadoc:transport-features receiveEvents="true" dispatchEvents="true" responseEvents="false"
+                                          requestEvents="true"
+                                          transactions="false" streaming="true">
+                <schemadoc:inboundMEPs in-only="true"/>
+                <schemadoc:outboundMEPs out-only="true"/>
+            </schemadoc:transport-features>
+        </xsd:appinfo>
+    </xsd:annotation>
+    <xsd:element name="connector" type="stdioConnectorType" substitutionGroup="mule:abstract-connector"/>
+
+    <xsd:complexType name="stdioConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:connectorType">
+                <xsd:attribute name="messageDelayTime" type="mule:substitutableLong">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Delay in milliseconds before printing the prompt to stdout.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="outputMessage" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Text printed to stdout when a message is sent.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="promptMessage" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Text printed to stdout when waiting for input.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="promptMessageCode" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Code used to retrieve prompt message from resource bundle.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="outputMessageCode" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Code used to retrieve output message from resource bundle.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="resourceBundle" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Resource bundle to provide prompt with promptMessageCode.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="inbound-endpoint" type="inboundEndpointType" substitutionGroup="mule:abstract-inbound-endpoint"/>
+    <xsd:complexType name="inboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:inboundEndpointType">
+                <xsd:attributeGroup ref="addressAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="outbound-endpoint" type="outboundEndpointType" substitutionGroup="mule:abstract-outbound-endpoint"/>
+    <xsd:complexType name="outboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:outboundEndpointType">
+                <xsd:attributeGroup ref="addressAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="endpoint" type="globalEndpointType" substitutionGroup="mule:abstract-global-endpoint"/>
+    <xsd:complexType name="globalEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:globalEndpointType">
+                <xsd:attributeGroup ref="addressAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:attributeGroup name="addressAttributes">
+        <xsd:attribute name="system">
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="IN"/>
+                    <xsd:enumeration value="OUT"/>
+                    <xsd:enumeration value="ERR"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/MuleConfigValidationSchemas/mule.xsd b/xml/tests/testData/xml/MuleConfigValidationSchemas/mule.xsd
new file mode 100644
index 0000000..8db4311
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigValidationSchemas/mule.xsd
@@ -0,0 +1,4533 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/core/2.2"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:spring="http://www.springframework.org/schema/beans"
+            xmlns:spring-context="http://www.springframework.org/schema/context"
+            targetNamespace="http://www.mulesource.org/schema/mule/core/2.2"
+            attributeFormDefault="unqualified"
+            elementFormDefault="qualified">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+    <xsd:import namespace="http://www.springframework.org/schema/beans"
+                schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"/>
+    <xsd:import namespace="http://www.springframework.org/schema/context"
+                schemaLocation="http://www.springframework.org/schema/context/spring-context-2.5.xsd"/>
+
+    <!--==============================================================-->
+    <!--   Structure                                                  -->
+    <!--==============================================================-->
+
+    <!-- This defines the structure in abstract terms (except for a few simple/unique things like
+         global properties).  We then provide some implementations below.  Other modules
+         can provide other implementations. -->
+
+    <xsd:element name="mule" type="muleType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Either the root element of a Mule configuration, or a "top-level" element in a Spring configuration that contains further Mule elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="muleType">
+        <xsd:sequence>
+            <xsd:element name="description" type="descriptionType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Holds any kind of documentation that accompanies this configuration file. It is intended to be "human readable" only and is not used by the system.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="springRootElements"/>
+                <xsd:group ref="muleRootElements"/>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:group name="springRootElements">
+        <xsd:choice>
+            <xsd:element ref="spring:beans">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Allows the embedding of any Spring elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="spring:bean">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Allows Spring beans to be defined alongside Mule elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="spring-context:property-placeholder">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Allows Spring property placeholders to be configured directly in the Mule configuration file.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:group name="muleRootElements">
+        <xsd:choice>
+            <xsd:element name="global-property" type="globalPropertyType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        A global property is a named string. It can be inserted in most attribute values using standard (ant-style) Spring placeholders.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="configuration" type="configurationType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Specifies defaults and general settings for the Mule instance.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="notifications" type="notificationManagerType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Registers listeners for notifications and associates interfaces with particular events.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-extension"/>
+            <xsd:element ref="abstract-security-manager"/>
+            <xsd:element ref="abstract-transaction-manager"/>
+            <xsd:element ref="abstract-connector"/>
+            <xsd:element ref="abstract-global-endpoint"/>
+            <xsd:element ref="abstract-transformer"/>
+            <xsd:element ref="abstract-filter"/>
+            <xsd:element ref="abstract-model"/>
+            <xsd:element ref="abstract-interceptor-stack"/>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:complexType name="descriptionType">
+        <xsd:complexContent mixed="true">
+            <xsd:extension base="xsd:anyType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-extension" abstract="true" type="abstractExtensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for arbitrary extensions as children of the 'mule' element. Other transports and modules can extend this if they need to add global elements to the configuration (but consider the more specific elements like abstract-connector first).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractExtensionType"/>
+
+    <xsd:element name="abstract-connector" abstract="true" type="abstractConnectorType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for connector elements. Connector elements allow properties to be configured across all endpoints that use the same transport. If multiple connectors are defined for the same transport, each endpoint must name which connector is being used.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractConnectorType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the connector so that other elements can reference it.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-global-endpoint" abstract="true" type="abstractGlobalEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for global endpoint elements. Global endpoints are named templates that allow you to define an endpoint once and refer to it in several places. The same template can be used for both inbound and outbound endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractGlobalEndpointType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the endpoint so that other elements can reference it. This name can also be referenced in the MuleClient.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-inbound-endpoint" abstract="true" type="abstractInboundEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for inbound endpoint elements. Inbound endpoints receive messages from the underlying transport. The message payload is then delivered to the component for processing.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInboundEndpointType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the endpoint in the registry. There is no need to set the 'name' attribute on inbound or outbound endpoints, only on global endpoints. 
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-outbound-endpoint" abstract="true" type="abstractOutboundEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for outbound endpoint elements. Outbound endpoints dispatch messages to the underlying transport.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractOutboundEndpointType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the endpoint in the registry. There is not need to set the 'name' attribute on inbound or outbound endpoints, only on global endpoints.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-transformer" abstract="true" type="abstractTransformerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transformer elements. Transformers convert message payloads.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransformerType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the transformer so that other elements can reference it. Required if the transformer is defined at the global level.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="returnClass" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class of the message generated by the transformer. This is used if transformers are auto-selected and to validate that the transformer returns the correct type.  Note that if you need to specify an array type you need postfix the class name with '[]'. For example, if you want return a an Orange[], you set the return class to 'org.mule.tck.testmodels.fruit.Orange[]'.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="ignoreBadInput" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Many transformers only accept certain classes. Such transformers are never called with inappropriate input (whatever the value of this attribute). If a transformer forms part of a chain and cannot accept the current message class, this flag controls whether the remaining part of the chain is evaluated. If true, the next transformer is called. If false the chain ends, keeping the result generated up to that point.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="globalPropertyType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the property. This is used inside Spring placeholders.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="value" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The value of the property. This replaces each occurence of a Spring placeholder.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- seemed pointless making these simple container types abstract -->
+    <xsd:complexType name="inboundCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-inbound-router" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-catch-all-strategy" minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:attribute name="matchAll" type="substitutableBoolean" default="true">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, the input message will be passed to all inbound routers. Otherwise, only the first matching router is used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-catch-all-strategy" abstract="true" type="abstractCatchAllStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for catch-all strategy elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractCatchAllStrategyType"/>
+
+    <xsd:element name="abstract-inbound-router" abstract="true" type="abstractInboundRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for inbound router elements, which control how incoming messages are handled.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInboundRouterType"/>
+
+    <xsd:element name="abstract-filter" abstract="true" type="abstractFilterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for filter elements, which control which messages are handled. 
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractFilterType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the filter so that other elements can reference it. Required if the filter is defined at the global level.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="not" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Inverts the filter condition.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="outboundCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-outbound-router" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-catch-all-strategy" minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:attribute name="matchAll" type="substitutableBoolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, the output message will be sent to all routers. Otherwise, only the first matching router is used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-outbound-router" abstract="true" type="abstractOutboundRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for outbound router elements, which control how outgoing messages are delivered to the outbound endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractOutboundRouterType"/>
+
+    <xsd:element name="abstract-transaction-manager" abstract="true" type="abstractTransactionManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transaction manager elements, which are used to coordinate transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransactionManagerType"/>
+
+    <xsd:complexType name="configurationType">
+        <xsd:sequence>
+            <xsd:element name="default-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default threading profile, used by components and by endpoints for dispatching and receiving if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-dispatcher-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default dispatching threading profile, which modifies the default-threading-profile values and is used by endpoints for dispatching messages. This can also be configured on connectors, in which case the connector configuration is used instead of this default.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-receiver-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default receiving threading profile, which modifies the default-threading-profile values and is used by endpoints for receiving messages. This can also be configured on connectors, in which case the connector configuration is used instead of this default.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-service-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default service threading profile, which modifies the default-threading-profile and is used by services for processing messages. This can also be configured on models or services, in which case these configurations will be used instead of this default.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-retry-policy" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default retry policy, used by connectors and endpoints. This can also be configured on connectors, in which case the connector configuration is used instead of this default.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="defaultSynchronousEndpoints" type="substitutableBoolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, all requests to endpoints will wait for a response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="defaultResponseTimeout" type="xsd:string" default="10000">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The default period (ms) to wait for a synchronous response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="defaultTransactionTimeout" type="xsd:string" default="30000">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The default timeout (ms) for transactions. This can also be configured on transactions, in which case the transaction configuration is used instead of this default.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="shutdownTimeout" type="substitutableInt" default="5000">
+            <xsd:annotation>
+                <xsd:documentation>
+                    (As of Mule 2.2.2) The time in milliseconds to wait for any in-progress messages to finish processing before Mule shuts down. After this threshold has been reached, Mule starts interrupting threads, and messages can be lost. If you have a very large number of services in the same Mule instance, if you have components that take more than a couple seconds to process, or if you are using large payloads and/or slower transports, you should increase this value to allow more time for graceful shutdown. The value you specify is applied to services and separately to dispatchers, so the default value of 5000 milliseconds specifies that Mule has ten seconds to process and dispatch messages gracefully after shutdown is initiated. 
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="notificationManagerType">
+        <xsd:sequence>
+            <xsd:element name="notification" type="defineNotificationType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Associates an event with an interface. Listeners that implement the interface will receive instances of the event.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="disable-notification" type="disableNotificationType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Blocks the association of an event with a particular interface. This filters events after the association with a particular interface (and so takes precedence).
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="notification-listener" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Registers a bean as a listener with the notification system. Events are dispatched by reflection - the listener will receive all events associated with any interfaces it implements. The relationship between interfaces and events is configured by the notification and disable-notification elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                    <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The bean that will receive notifications.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="subscription" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                An optional string that is compared with the event resource identifier. Only events with matching identifiers will be sent. If no value is given, all events are sent.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="dynamic" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If the notification manager is dynamic, listeners can be registered dynamically at runtime via the MuleContext, and the configured notification can be changed. Otherwise, some parts of Mule will cache notification configuration for efficiency and will not generate events for newly enabled notifications or listeners. The default value is false.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="defineNotificationType">
+        <xsd:attribute name="event-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class associated with a notification event that will be delivered to the interface. This can be used instead of the 'event' attribute to specify a custom class.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="event" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The notification event to deliver.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface (class name) that will receive the notification event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface that will receive the notification event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="disableNotificationType">
+        <xsd:attribute name="event-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class associated with an event that will no longer be delivered to any interface. This can be used instead of the 'event' attribute to specify a custom class.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="event" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The event you no longer want to deliver.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface (class name) that will no longer receive the event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface that will no longer receive the event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+
+    <xsd:simpleType name="notificationTypes">
+        <xsd:restriction base="xsd:NMTOKEN">
+            <xsd:enumeration value="CONTEXT"/>
+            <xsd:enumeration value="MODEL"/>
+            <xsd:enumeration value="SERVICE"/>
+            <xsd:enumeration value="SECURITY"/>
+            <xsd:enumeration value="ENDPOINT-MESSAGE"/>
+            <xsd:enumeration value="COMPONENT-MESSAGE"/>
+            <xsd:enumeration value="MANAGEMENT"/>
+            <xsd:enumeration value="CONNECTION"/>
+            <xsd:enumeration value="REGISTRY"/>
+            <xsd:enumeration value="CUSTOM"/>
+            <xsd:enumeration value="EXCEPTION"/>
+            <xsd:enumeration value="TRANSACTION"/>
+            <xsd:enumeration value="ROUTING"/>
+            <!-- DEPRECATED -->
+            <xsd:enumeration value="MESSAGE"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <!--==============================================================-->
+    <!-- Models                                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-model" abstract="true" type="abstractModelType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for model elements. A model provides basic settings and processing for all the services it contains.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractModelType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-exception-strategy" minOccurs="0"/>
+            <xsd:group ref="entryPointResolvers"/>
+            <xsd:element ref="abstract-service" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="name" type="nonBlankString">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name used to identify this model.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="seda-model" type="sedaModelType" substitutionGroup="abstract-model">
+        <xsd:annotation>
+            <xsd:documentation>
+                A staged event-driven architecture (SEDA) model has separate threads and queues for each service.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="sedaModelType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractModelType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-queue-profile" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="inherit" type="xsd:boolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If true, this model element is an extension of a previous model element with the same name.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="model" type="defaultModelType" substitutionGroup="abstract-model">
+        <xsd:annotation>
+            <xsd:documentation>
+                The container for a set of services, providing basic settings and processing for all the services it contains.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="defaultModelType">
+        <xsd:complexContent>
+            <xsd:extension base="sedaModelType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Model elements -->
+
+    <xsd:element name="abstract-queue-profile" abstract="true" type="abstractQueueProfileType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a queue profile, which controls how messages are queued.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractQueueProfileType"/>
+
+    <!-- to give a cleaner config we allow either a set or an individual entry (but not both).-->
+    <xsd:group name="entryPointResolvers">
+        <xsd:choice>
+            <xsd:element ref="abstract-entry-point-resolver-set" minOccurs="0"/>
+            <!-- we could allow many of these, but it looks ugly -->
+            <xsd:element ref="abstract-entry-point-resolver" minOccurs="0"/>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:element name="abstract-entry-point-resolver-set" abstract="true" type="abstractEntryPointResolverSetType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for entry point resolver set elements. These combine a group of entry point resolvers, trying them in turn until one succeeds.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractEntryPointResolverSetType"/>
+
+    <xsd:element name="legacy-entry-point-resolver-set" type="extensibleEntryPointResolverSet"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                An extensible set of entry point resolvers (which determine how a message is passed to a component in Java) that already contains resolvers to implement the standard logic. This is already provided by default and is only needed explicitly if it will be extended with other entry point resolvers. This element can be set on the model or component; the model value provides a default that individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="entry-point-resolver-set" type="extensibleEntryPointResolverSet"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                An extensible set of entry point resolvers. These determine how a message is passed to a component in Java. Each entry point resolver is tried in turn until one succeeds in delivering the message to the component. This element can be set on the model or component; the model value provides a default that individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="extensibleEntryPointResolverSet">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverSetType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-entry-point-resolver" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-entry-point-resolver-set" type="customEntryPointResolverSetType"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom entry point resolver set. This allows user-supplied code to determine how a message is passed to a component in Java. This element can be set on the model or component; the model value provides a default that individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customEntryPointResolverSetType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverSetType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the EntryPointResolverSet interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-entry-point-resolver" abstract="true" type="abstractEntryPointResolverType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an entry point resolver element. Entry point resolvers define how payloads are delivered to Java code by choosing the method to call.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="callable-entry-point-resolver" type="abstractEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                An entry point resolver for components that implement the Callable interface. This passes a MuleEventContext to the component. This element can be set on the model or component; the model value provides a default that individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractEntryPointResolverType"/>
+
+    <xsd:element name="custom-entry-point-resolver" type="customEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom entry point resolver. This allows user-supplied code to determine how a message is passed to a component in Java. This element can be set on the model or component; the model value provides a default that individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the EntryPointResolver interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverType">
+                <xsd:attribute name="transformFirst" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether the message should be transformed before being delivered to the component. By default, messages are transformed.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="acceptVoidMethods" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether the resolver should call void methods. By default, void methods are not considered as possible candidates for message delivery.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="property-entry-point-resolver" type="propertyEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Uses a message property to select the component method to be called. This element can be set on the model or component; the model value provides a default that individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="propertyEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:attribute name="property" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the message property used to select a method on the component.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="method-entry-point-resolver" type="methodEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Delivers the message to a named method. This element can be set on the model or component; the model value provides a default that individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="methodEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="include-entry-point" minOccurs="1" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="reflection-entry-point-resolver" type="reflectionEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Generates a list of candidate methods from the component via reflections. This element can be set on the model or component; the model value provides a default that individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="reflectionEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element name="exclude-object-methods" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                If specified, methods in the Java Object interface are not included in the list of possible methods that can receive the message.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="exclude-entry-point" type="methodType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Explicitly excludes a named method from receiving the message.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="array-entry-point-resolver" type="complexEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Delivers the message to a method that takes a single array as argument. This element can be set on the model or component; the model value provides a default that individual component values can override. This element can also be used directly or as part of a set of resolvers; the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="no-arguments-entry-point-resolver" type="complexEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Calls a method without arguments (the message is not passed to the component).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="complexEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="reflectionEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="include-entry-point" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="enableDiscovery" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If no method names are configured, attempts to discover the method to invoke based on the inbound message type.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="include-entry-point" type="methodType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A possible method for delivery.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="methodType">
+        <xsd:attribute name="method" type="nonBlankString">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the method.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--  Services                                                    -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-service" abstract="true" type="abstractServiceType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a service element. Services combine message routing with a component (typically a POJO).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractServiceType">
+        <xsd:attribute name="name" type="nonBlankString" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name used to identify this service.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseServiceType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Base support for a model-based wrapper around the POJO service (SEDA, Streaming, etc.)
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractServiceType">
+                <xsd:sequence>
+                    <xsd:element name="description" type="descriptionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                This can hold any kind of documentation related to the service. It is intended to be "human readable" only and is not used by the system.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="inbound" type="inboundCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within 'inbound' describe how a service receives messages.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <!-- minOccurs="0" to allow for <forwarding-router/> and/or default component -->
+                    <xsd:element ref="abstract-component" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The service component that is invoked when incoming messages are received. If this element is not present, the service simply bridges the inbound and outbound using a pass-through component.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="outbound" type="outboundCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within 'outbound' describe how a service sends or dispatches messages.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="async-reply" type="asyncReplyCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within 'async-reply' describe how asynchronous replies are handled.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element ref="abstract-exception-strategy" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="initialState" default="started">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The initial state of the service. Usually a service is started automatically ("started"), but this attribute can be used to disable initial startup ("stopped") or start the service in a paused state ("paused").
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="started"/>
+                            <xsd:enumeration value="stopped"/>
+                            <xsd:enumeration value="paused"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-exception-strategy" abstract="true" type="abstractExceptionStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an exception strategy element. Exception strategies define how Mule should react to errors.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="abstractExceptionStrategyType">
+        <xsd:sequence>
+            <xsd:element name="commit-transaction" type="exceptionPatternType" maxOccurs="1" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Defines when a current transaction gets committed based on the name of the exception caught. You can set a comma-separated list of wildcard patterns that will be matched against the fully qualified classname of the current exception. Patterns defined for this element will leave the current transaction (if any) untouched and allow it to be committed.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="rollback-transaction" type="exceptionPatternType" maxOccurs="1" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Defines when a current transaction gets rolled back based on the name of the exception caught. You can set a comma-separated list of wildcard patterns that will be matched against the fully qualified classname of the current exception. Patterns defined for this element will roll back the current transaction (if any).
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="enableNotifications" type="xsd:boolean">
+            <xsd:annotation>
+                <xsd:documentation>Determines whether ExceptionNotifications will be fired from this strategy when an exception occurs.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="exceptionPatternType">
+        <xsd:attribute name="exception-pattern" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>A comma-separated list of wildcard expressions that will be matched against the fully qualified classname of the current exception received by the ExceptionStrategy.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-retry-policy" abstract="true" type="abstractRetryPolicyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a retry policy element. Retry policies define how Mule should retry a failed message send/dispatch/request.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractRetryPolicyType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-retry-notifier" minOccurs="0" maxOccurs="1"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-retry-notifier" abstract="true" type="abstractRetryNotifierType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a retry notifier element. The RetryNotifier interface is a callback that allows actions to be performed after each retry. For example, when retrying connections, Mule will fire server notification events on success or failure.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractRetryNotifierType"/>
+
+    <xsd:complexType name="asyncReplyCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-inbound-endpoint" minOccurs="1" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-async-reply-router" minOccurs="0" maxOccurs="1"/>
+            <!-- TODO leaving this commented here, but I do not think there should be a transformer here -->
+            <!--<xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>-->
+        </xsd:sequence>
+        <xsd:attribute name="timeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The timeout (ms) to wait for a reply.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="failOnTimeout" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If the router times out before all expected events have been received, specifies whether an exception should be thrown (true) or the current events should be returned for processing (false). The default is false.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-async-reply-router" abstract="true" type="abstractAsyncReplyRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an async reply router element. Asynchronous replies are handled via this router.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractAsyncReplyRouterType"/>
+
+    <xsd:element name="service" type="sedaServiceType" substitutionGroup="abstract-service">
+        <xsd:annotation>
+            <xsd:documentation>
+                Describes how to receive messages, deliver them to a component, and handle the results (if any).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="sedaServiceType">
+        <xsd:complexContent>
+            <xsd:extension base="baseServiceType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-service-threading-profile" minOccurs="0"/>
+                    <xsd:element ref="abstract-queue-profile" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="queueTimeout" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The timeout used when taking messages from the service queue.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-service" type="customServiceType" substitutionGroup="abstract-service">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented service (typically used only in testing).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customServiceType">
+        <xsd:complexContent>
+            <xsd:extension base="baseServiceType">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The class to use for the service.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-service-threading-profile" abstract="true"
+                 type="abstractServiceThreadingProfileType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for the service threading profile element. Threading profiles define how thread pools are used by a service.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractServiceThreadingProfileType"/>
+
+    <!--==============================================================-->
+    <!-- Components                                              -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-component" abstract="true" type="abstractComponentType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a component element. A component is invoked when inbound messages are received by the service.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractComponentType">
+        <xsd:group ref="interceptorGroup" minOccurs="0">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Interceptors that can be used to intercept component invocation.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:group>
+    </xsd:complexType>
+
+    <xsd:element name="component" type="defaultJavaComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                A simple POJO (Plain Old Java Object) component that will be invoked by Mule when a message is received. The class or object instance to be used can be specified using a child object factory element, or via the 'class' attribute.  If the 'class' attribute is used, an object factory cannot be configured as well. Using the 'class' attribute is equivilant to using the propotype object factory ('prototype-object' child element). 
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="defaultJavaComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractComponentType">
+                <xsd:sequence>
+                    <xsd:group ref="entryPointResolvers">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Entry point resolvers that are used to determine how a message is passed to a component.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:group>
+                    <xsd:element ref="abstract-object-factory" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Object factory used to obtain the object instance that will be used for the component implementation. The object factory is responsible for object creation and may implement different patterns, such as singleton or prototype, or look up an instance from other object containers.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element ref="abstract-lifecycle-adapter-factory" minOccurs="0"/>
+                    <xsd:element name="binding" type="pojoBindingType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                A binding associates a Mule endpoint with an injected Java interface. This is like using Spring to inject a bean, but instead of calling a method on the bean, a message is sent to an endpoint.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Specifies a component class. This is a shortcut that is equivalent to providing a 'prototype-object' element.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="pooled-component" type="pooledJavaComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                A pooled POJO (Plain Old Java Object) component that will be invoked by Mule when a message is received. The instance can be specified via a factory or a class.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="pooledJavaComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="defaultJavaComponentType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-pooling-profile" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Characteristics of the object pool.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <xsd:complexType name="pojoBindingType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-outbound-endpoint" minOccurs="1" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="interface" use="required" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface to be injected. A proxy will be created that implements this interface by calling out to the endpoint.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="method" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The method on the interface that should be used. This can be omitted if the interface has a single method.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="defaultComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractComponentType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="bridge-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                Transfers a message from inbound to outbound endpoints. This element is provided for backward compatibility - it is equivalent to not specifying any component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!-- don't expose this, it's not needed -->
+    <!-- xsd:element name="pass-through-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default, "do nothing" component.
+                The message is simply transferred from inbound to outbound endpoints.
+                This is the default and need not be specified.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element -->
+
+    <xsd:element name="echo-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                Logs the message and returns the payload as the result.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="log-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                Logs the message content (or content length if it is a large message).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="null-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                Throws an exception if it receives a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+
+    <!--==============================================================-->
+    <!--   Transactions                                               -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-transaction" abstract="true" type="abstractTransactionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transaction elements. Transactions allow a series of operations to be grouped together.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="abstract-xa-transaction" abstract="true" type="abstractTransactionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for XA transaction elements. XA transactions allow a series of operations to be grouped together spanning different transports, such as JMS and JDBC.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="abstract-multi-transaction" abstract="true" type="abstractTransactionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for multi-transaction elements.
+                Multi-transactions allow a series of operations to be grouped together spanning different
+                transports, e.g. JMS and JDBC, but without the overhead of XA. The trade-off is that XA
+                reliability guarantees aren't available, and services must be ready to handle duplicates.
+                This is very similar to a 1.5 PC concept. EE-only feature.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransactionType">
+        <xsd:attribute name="action" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The type of action the transaction should take, one of the following:
+                    NONE - Never participate in a transaction.
+                    ALWAYS_BEGIN - Always start a new transaction when receiving a message. An exception will be thrown if a transaction already exists.
+                    BEGIN_OR_JOIN - If a transaction is already in progress when a message is received, join the transaction if possible. Otherwise, start a new transaction.
+                    ALWAYS_JOIN - Always expects a transaction to be in progress when a message is received. If there is no transaction, an exception is thrown.
+                    JOIN_IF_POSSIBLE - Join the current transaction if one is available. Otherwise, no transaction is created.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="NONE"/>
+                    <xsd:enumeration value="ALWAYS_BEGIN"/>
+                    <xsd:enumeration value="BEGIN_OR_JOIN"/>
+                    <xsd:enumeration value="ALWAYS_JOIN"/>
+                    <xsd:enumeration value="JOIN_IF_POSSIBLE"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="timeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Timeout for the transaction (ms).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseTransactionType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-transaction" type="customTransactionType" substitutionGroup="abstract-transaction">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-defined or otherwise unsupported third-party transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransactionType">
+        <xsd:complexContent>
+            <xsd:extension base="baseTransactionType">
+                <xsd:attribute name="factory-class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the TransactionFactory interface that will be instantiated and used to generate a transaction. This attribute and the 'factory-ref' attribute are mutually exclusive; one of the two is required.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="factory-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A bean that implements the TransactionFactory interface that will be used to generate a transaction. This attribute and the 'factory-class' attribute are mutually exclusive; one of the two is required.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="xa-transaction" type="xaTransactionType" substitutionGroup="abstract-transaction">
+        <xsd:annotation>
+            <xsd:documentation>
+                An XA transaction.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="xaTransactionType">
+        <xsd:complexContent>
+            <xsd:extension base="baseTransactionType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="transactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionManagerType">
+                <xsd:attribute name="name" type="substitutableName" default="transactionManager" use="optional">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An optional name for the transaction manager. The default value is "transactionManager".
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="websphere-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The WebSphere transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="jboss-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The JBoss transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="jndiTransactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionManagerType">
+                <xsd:sequence>
+                    <xsd:element name="environment" type="mapType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The JNDI environment.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="weblogic-transaction-manager" type="jndiTransactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The WebLogic transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="jrun-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The JRun transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="resin-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The Resin transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="jndi-transaction-manager" substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                Retrieves a named transaction manager factory from JNDI.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="jndiTransactionManagerType">
+                    <xsd:attribute name="jndiName" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The name of the manager factory to retrieve (such as java:/TransactionManager).
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="custom-transaction-manager" type="customTransactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="jndiTransactionManagerType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The class to instantiate to create a transaction manager.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--   Endpoint elements                                          -->
+    <!--==============================================================-->
+
+    <xsd:element name="endpoint" type="globalEndpointType" substitutionGroup="abstract-global-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                A global endpoint, which acts as a template that can be used to construct an inbound or outbound endpoint elsewhere in the configuration by referencing the global endpoint name. Each transport implements its own endpoint element, with a more friendly syntax, but this generic element can be used with any transport by supplying the correct address URI. For example, "vm://foo" describes a VM transport endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="globalEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractGlobalEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- extend this type for endpoints that support XA transactions -->
+    <xsd:complexType name="globalEndpointWithXaType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractGlobalEndpointType">
+                <xsd:group ref="defaultXaEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="inbound-endpoint" type="inboundEndpointType" substitutionGroup="abstract-inbound-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An inbound endpoint receives messages via the associated transport. As with global endpoints, each transport implements its own inbound endpoint element.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="inboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInboundEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- extend this type for endpoints that support XA transactions -->
+    <xsd:complexType name="inboundEndpointWithXaType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInboundEndpointType">
+                <xsd:group ref="defaultXaEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="outbound-endpoint" type="outboundEndpointType" substitutionGroup="abstract-outbound-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An outbound endpoint sends messages via the associated transport. As with global endpoints, each transport implements its own outbound endpoint element.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="outboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:complexType name="outboundEndpointWithXaType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundEndpointType">
+                <xsd:group ref="defaultXaEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- these include option/repeats - should be embedded once -->
+    <xsd:group name="defaultEndpointElements">
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="endpointTransformers"/>
+                <xsd:element ref="abstract-transaction" minOccurs="0"/>
+                <xsd:element ref="abstract-filter" minOccurs="0"/>
+                <xsd:element ref="abstract-security-filter" minOccurs="0"/>
+                <xsd:element ref="abstract-retry-policy" minOccurs="0"/>
+                <xsd:element ref="abstract-multi-transaction" minOccurs="0"/>
+                <xsd:group ref="propertiesGroup"/>
+            </xsd:sequence>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:group name="defaultXaEndpointElements">
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="endpointTransformers"/>
+                <xsd:element ref="abstract-transaction" minOccurs="0"/>
+                <xsd:element ref="abstract-xa-transaction" minOccurs="0"/>
+                <xsd:element ref="abstract-filter" minOccurs="0"/>
+                <xsd:element ref="abstract-security-filter" minOccurs="0"/>
+                <xsd:group ref="propertiesGroup"/>
+            </xsd:sequence>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:element name="abstract-security-filter" abstract="true" type="abstractSecurityFilterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for security filter elements, which control access to the system.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractSecurityFilterType"/>
+
+    <xsd:attributeGroup name="defaultEndpointAttributes">
+        <xsd:attributeGroup ref="restrictedEndpointAttributes"/>
+        <!-- these next two attributes are mutually exclusive and one is required.
+             but there is no way to define this in a schema... -->
+        <!-- endpoint references - dynamically checked to make sure not top level -->
+        <xsd:attribute name="ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A reference to a global endpoint, which is used as a template to construct this endpoint. A template fixes the address (protocol, path, host, etc.), and may specify initial values for various properties, but further properties can be defined locally (as long as they do not change the address in any way).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <!-- explicit or global endpoints -->
+        <xsd:attribute name="address" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The generic address for this endpoint. If this attribute is used, the protocol must be specified as part of the URI. Alternatively, most transports provide their own attributes for specifying the address (path, host, etc.). Note that the address attribute cannot be combined with 'ref' or with the transport-provided alternative attributes.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:attributeGroup name="restrictedEndpointAttributes">
+        <xsd:attribute name="synchronous" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, the result from the component processing the incoming message will be returned as a response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+
+        <xsd:attribute name="responseTimeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The timeout for a response if making a synchronous endpoint call
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="encoding" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    String encoding used for messages.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="connector-ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the connector associated with this endpoint. This must be specified if more than one connector is defined for this transport.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A list of the transformers that will be applied (in order) to the message before it is delivered to the component.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="responseTransformer-refs" type="xsd:NMTOKENS">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A list of the transformers that will be applied (in order) to the synchronous response before it is returned via the transport.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:complexType name="endpointRefType">
+        <xsd:attribute name="address" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The destination address for a reply message.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The reference name of a global endpoint to use. If this EndpointRef will be associated to a message such as a Reply-To address, this endpoint ref has to be available on the remote Mule instance that reads the Reply-To address.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:group name="endpointTransformers">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows the user to specify either a simple list of normal transformers or separate bracketed lists of normal and response transformers.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:choice>
+            <xsd:group ref="transformersList"/>
+            <xsd:sequence>
+                <xsd:element name="transformers" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A list of transformer elements that will be applied to the message before it is delivered to the component. Note that a list of transformers can also be specified directly (without the 'transformers' element), but then it is not possible to also specify response transformers (using the 'response-transformers' element).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:complexType>
+                        <xsd:group ref="transformersList"/>
+                    </xsd:complexType>
+                </xsd:element>
+                <xsd:element name="response-transformers" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A list of transformer elements that will be applied to the response message returned from the component.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:complexType>
+                        <xsd:group ref="transformersList"/>
+                    </xsd:complexType>
+                </xsd:element>
+            </xsd:sequence>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:group name="transformersList">
+        <xsd:annotation>
+            <xsd:documentation>
+                A list of transformers - normal or response, depending on context.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!--==============================================================-->
+    <!--   Filter elements                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="filter" type="refFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that is defined elsewhere (at the global level, or as a Spring bean).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="refFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the filter to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="not-filter" type="unitaryFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Inverts the enclosed filter. For example, if the filter would normally return true for a specific message, it will now return false, and vice versa.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="unitaryFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="and-filter" type="collectionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Returns true only if all the enclosed filters return true.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="or-filter" type="collectionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Returns true if any of the enclosed filters returns true.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="collectionFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter" minOccurs="2" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="wildcard-filter" type="wildcardFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches string messages against wildcards. It performs matches with "*", for example, "jms.events.*" would catch "jms.events.customer" and "jms.events.receipts". This filter accepts a comma-separated list of patterns, so more than one filter pattern can be matched for a given argument: "jms.events.*, jms.actions.*" will match "jms.events.system" and "jms.actions" but not "jms.queue".
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="wildcardFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="caseSensitivePatternFilterType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="expression-filter" type="expressionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that can evaluate a range of expressions. It supports some base expression types such as header, payload (payload type), regex, and wildcard.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="expressionFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="evaluator" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>The expression evaluator to use. The expression filter supports some types such as header, payload, exception, wildcard, and regex, that are built-in filters not registered with the ExpressionEvaluatorManager. All others are registered with the ExpressionEvaluatorManager. Where XPath, bean, and ONGL are used, the expression should be a boolean expression.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="substitutableName">
+                            <xsd:enumeration value="header"/>
+                            <xsd:enumeration value="payload-type"/>
+                            <xsd:enumeration value="exception-type"/>
+                            <xsd:enumeration value="wildcard"/>
+                            <xsd:enumeration value="regex"/>
+                            <xsd:enumeration value="ognl"/>
+                            <xsd:enumeration value="xpath"/>
+                            <xsd:enumeration value="jxpath"/>
+                            <xsd:enumeration value="groovy"/>
+                            <xsd:enumeration value="bean"/>
+                            <xsd:enumeration value="custom"/>
+                            <xsd:enumeration value="registry"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="expression" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>The expression that will be evaluated. This should always be a boolean expression. The syntax of the expression will be determined by the expression language being used.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="customEvaluator" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>Must be set if the evaluator is set to custom. The custom evaluator must be registered with the ExpressionEvaluatorManager if it is to be used here.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="nullReturnsTrue" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>Whether the filter should return true if the specified expression returns null.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <xsd:element name="regex-filter" type="patternFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches string messages against a regular expression. The Java regular expression engine (java.util.regex.Pattern) is used.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="patternFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="pattern" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The property name and optionally a value to use when matching. If the expression is just a property name, the filter will check that the property exists. Users can also use '=' and '!=' to determine a specific value for a property.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-property-filter" type="caseSensitivePatternFilterType"
+                 substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches properties on a message. This can be very useful, as the message properties represent all the meta information about the message from the underlying transport, so for a message received over HTTP, you can check for HTTP headers and so forth. The pattern should be expressed as a key/value pair, such as "propertyName=value". If you want to compare more than one property, you can use the logic filters for And, Or, and Not expressions. By default, the comparison is case sensitive, which you can override with the 'caseSensitive' property.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="caseSensitivePatternFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="patternFilterType">
+                <xsd:attribute name="caseSensitive" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If false, the comparison ignores case.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="exception-type-filter" type="typeFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches the type of an exception.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="payload-type-filter" type="typeFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches the type of the payload.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="typeFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="expectedType" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The expected class used in the comparison.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-filter" type="customFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented filter.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the Filter interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   Interceptor elements                                       -->
+    <!--==============================================================-->
+    <xsd:element name="abstract-interceptor-stack" abstract="true" type="abstractInterceptorStackType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for interceptor stack elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInterceptorStackType">
+        <xsd:sequence maxOccurs="unbounded">
+            <xsd:element ref="abstract-interceptor"/>
+        </xsd:sequence>
+        <xsd:attribute name="name" type="nonBlankString" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name used to identify this interceptor stack.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:element name="interceptor-stack" type="abstractInterceptorStackType" substitutionGroup="abstract-interceptor-stack"/>
+
+
+    <xsd:element name="abstract-interceptor" abstract="true" type="abstractInterceptorType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an interceptor element.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInterceptorType"/>
+
+    <xsd:group name="interceptorGroup">
+        <xsd:sequence>
+            <xsd:choice maxOccurs="unbounded">
+                <xsd:element ref="abstract-interceptor"/>
+                <xsd:element name="interceptor-stack" type="refInterceptorStackType">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A reference to a stack of intereceptors defined globally.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:complexType name="refInterceptorStackType">
+        <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the interceptor stack to use.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="timer-interceptor" type="abstractInterceptorType" substitutionGroup="abstract-interceptor">
+        <xsd:annotation>
+            <xsd:documentation>
+                The timer interceptor (ported from 1.x).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="logging-interceptor" type="abstractInterceptorType" substitutionGroup="abstract-interceptor">
+        <xsd:annotation>
+            <xsd:documentation>
+                The logging interceptor (ported from 1.x).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="custom-interceptor" type="customInterceptorType" substitutionGroup="abstract-interceptor">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented interceptor.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customInterceptorType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInterceptorType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the Interceptor interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- security filters -->
+
+    <xsd:element name="encryption-security-filter" type="encryptionSecurityFilterType"
+                 substitutionGroup="abstract-security-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that provides password-based encyption.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="encryptionSecurityFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractSecurityFilterType">
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the encryption strategy to use. This should be configured using the 'password-encryption-strategy' element, inside a 'security-manager' element at the top level.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--   Transformer elements                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="transformer" type="refTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A reference to a transformer defined elsewhere.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="refTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the transformer to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="auto-transformer" type="abstractTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that uses the transform discovery mechanism to convert the message payload. This transformer works much better when transforming custom object types rather than Java types, because there is less chance for ambiguity.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="custom-transformer" type="customTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented transformer.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the Transformer interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-properties-transformer" type="messagePropertiesTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that can add or delete message properties.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="messagePropertiesTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:choice minOccurs="1" maxOccurs="unbounded">
+                    <xsd:element name="delete-message-property" type="keyType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Delete a message property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="add-message-property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Add a message property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="rename-message-property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Rename a message property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="add-message-properties" type="mapType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Add a set of message properties.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:choice>
+                <xsd:attribute name="overwrite" type="substitutableBoolean" use="optional" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If false, a property is not added if the message already contains a property with that name.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="no-action-transformer" type="abstractTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that has no effect.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="base64-encoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that base64 encodes a string or byte array message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="base64-decoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that base64 decodes a message to give an array of bytes.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="xml-entity-encoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that encodes a string using XML entities.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="xml-entity-decoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that decodes a string containing XML entities.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="gzip-compress-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that compresses a byte array using gzip.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="gzip-uncompress-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that uncompresses a byte array using gzip.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-hex-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to a string of hexadecimal digits.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="hex-string-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a string of hexadecimal digits to a byte array.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-object-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to an object (either deserializing or converting to a string).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="object-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that serializes all objects except strings (which are converted using getBytes()).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="object-to-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that gives a human-readable description of various types (useful for debugging).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-serializable-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to an object (deserializing the object).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="serializable-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts an object to a byte array (serializing the object).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to a string.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="string-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a string to a byte array.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="append-string-transformer" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that appends a string to a string payload.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="abstractTransformerType">
+                    <xsd:attribute name="message" type="xsd:string" use="required">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The string to append.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="encrypt-transformer" type="encryptionTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that encrypts a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="decrypt-transformer" type="encryptionTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that decrypts a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="encryptionTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the encryption strategy to use. This should be configured using the password-encryption-strategy element, inside a security-manager element at the top level.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="bean-builder-transformer" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that uses expressions to configure a simple bean object.  The user can specify a bean class or factory to create and one or more expressions that are used to configure properties on the bean.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="abstractTransformerType">
+                    <xsd:sequence minOccurs="1" maxOccurs="unbounded">
+                        <xsd:element name="bean-property">
+                            <xsd:complexType>
+                                <xsd:attribute name="name" type="xsd:NMTOKEN" use="required">
+                                    <xsd:annotation>
+                                        <xsd:documentation>
+                                            The name of the bean property
+                                        </xsd:documentation>
+                                    </xsd:annotation>
+                                </xsd:attribute>
+                                <xsd:attributeGroup ref="expressionAttributes"/>
+                                <xsd:attribute name="optional" type="substitutableBoolean" use="optional">
+                                    <xsd:annotation>
+                                        <xsd:documentation>If the expression evaluates to null, whether to continue to the next expression without error.
+                                        </xsd:documentation>
+                                    </xsd:annotation>
+                                </xsd:attribute>
+                            </xsd:complexType>
+                        </xsd:element>
+                    </xsd:sequence>
+                    <xsd:attribute name="beanClass" type="xsd:NMTOKEN">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The bean class to create
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="beanFactory-ref" type="xsd:NMTOKEN">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                A Bean factory to use when creating the bean object.  The factory must implement {{org.mule.api.object.ObjectFactory}}.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="expression-transformer" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that evaluates one or more expressions on the current message. Each expression equates to a parameter in the return message. The return message for two or more expressions will be an Object[].
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="abstractTransformerType">
+                    <xsd:sequence minOccurs="1" maxOccurs="unbounded">
+                        <xsd:element name="return-argument">
+                            <xsd:annotation>
+                                <xsd:documentation>
+                                    A list of expressions, each of which is evaluated and equates to an element in the result message. If just one 'return-argument' is configured, the result will be the evaluation of that expression rather than an object array. 
+                                </xsd:documentation>
+                            </xsd:annotation>
+                            <xsd:complexType>
+                                <xsd:attributeGroup ref="expressionAttributes"/>
+                                <xsd:attribute name="optional" type="substitutableBoolean" use="optional">
+                                    <xsd:annotation>
+                                        <xsd:documentation>If the expression evaluates to null, specifies whether to continue to the next expression without error.
+                                        </xsd:documentation>
+                                    </xsd:annotation>
+                                </xsd:attribute>
+                            </xsd:complexType>
+                        </xsd:element>
+                    </xsd:sequence>
+                    <xsd:attribute name="returnSourceIfNull" type="xsd:boolean" use="optional">
+                        <xsd:annotation>
+                            <xsd:documentation>If all expressions return null on this transformer, this flag will cause the source payload to be returned without modification.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:attributeGroup name="expressionAttributes">
+        <xsd:attribute name="evaluator" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The expression evaluator to use. Expression evaluators must be registered with the ExpressionEvaluatorManager before they can be used. Using the custom evaluator allows you to define your own evaluator with the 'custom-evaluator' attribute. Note that some evaluators such as xpath, groovy, and bean are loaded from other Mule modules (XML and Scripting, respectively). These modules must be on your classpath before the evaluator can be used.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="substitutableName">
+                    <xsd:enumeration value="groovy"/>
+                    <xsd:enumeration value="header"/>
+                    <xsd:enumeration value="headers"/>
+                    <xsd:enumeration value="headers-list"/>
+                    <xsd:enumeration value="attachment"/>
+                    <xsd:enumeration value="attachments"/>
+                    <xsd:enumeration value="attachments-list"/>
+                    <xsd:enumeration value="message"/>
+                    <xsd:enumeration value="string"/>
+                    <xsd:enumeration value="map-payload"/>
+                    <xsd:enumeration value="payload"/>
+                    <xsd:enumeration value="mule"/>
+                    <xsd:enumeration value="xpath"/>
+                    <xsd:enumeration value="jxpath"/>
+                    <xsd:enumeration value="bean"/>
+                    <xsd:enumeration value="ognl"/>
+                    <xsd:enumeration value="function">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Foo Bar
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:enumeration>
+                    <xsd:enumeration value="custom"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="expression" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The expression to evaluate. The syntax of this attribute changes depending on the evaluator being used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="custom-evaluator" type="substitutableName" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>The name of the custom evaluator to use. This attribute is only used when the 'evaluator' attribute is set to "custom". You can plug in your own expression evaluators by registering them with the ExpressionEvaluatorManager.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <!--==============================================================-->
+    <!--   Shared elements                                             -->
+    <!--==============================================================-->
+
+    <xsd:element name="queue-profile" type="queueProfileType" substitutionGroup="abstract-queue-profile">
+        <xsd:annotation>
+            <xsd:documentation>
+                Specifies the properties of an internal Mule queue. Internal queues are used to queue messages for each component managed by Mule.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="queueProfileType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractQueueProfileType">
+                <xsd:attribute name="maxOutstandingMessages" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Defines the maximum number of messages that can be queued.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="persistent" type="substitutableBoolean" default="false">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether Mule messages are persisted to a store. Primarily, this is used for persisting queued messages to disk so that the internal state of the server is mirrored on disk in case the server fails and needs to be restarted. Default is false.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-security-manager" type="abstractSecurityManagerType" abstract="true">
+        <xsd:annotation>
+            <xsd:documentation>
+                A security manager is a container for security providers. More than one security manager may be configured; each contains providers from a particular module and has that module type. This element is abstract - a security-related module or transport will provide a suitable implementation.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="abstractSecurityManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                An empty holder that can be extended by modules that want to provide security managers. Typically it will contain elements called 'module:type-security-provider', which extend securityProviderType where "module" might be "acegi" and "type" might de "delegate", for example. It can also contain encryption strategies, which should follow a similar scheme and extend encryptionStrategyType.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="id" fixed="_muleSecurityManager"/>
+        <xsd:attribute name="name" fixed="_muleSecurityManager"/>
+    </xsd:complexType>
+
+    <xsd:element name="security-manager" type="securityManagerType" substitutionGroup="abstract-security-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default security manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="securityManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default security manager (type 'mule:defaultSecurityManagerType') provides basic support for security functions. Other modules (Acegi, JAAS, PGP) provide more advanced functionality.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractSecurityManagerType">
+                <xsd:sequence>
+                    <xsd:element name="custom-security-provider" type="customSecurityProviderType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                A custom implementation of SecurityProvider.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="custom-encryption-strategy" type="customEncryptionStrategyType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                A custom implementation of EncryptionStrategy.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="secret-key-encryption-strategy" type="secretKeyEncryptionStrategyType"
+                                 minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Provides secret key-based encryption using JCE.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="password-encryption-strategy" type="passwordEncryptionStrategyType"
+                                 minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Provides password-based encryption using JCE. Users must specify a password and optionally a salt and iteration count as well. The default algorithm is PBEWithMD5AndDES, but users can specify any valid algorithm supported by JCE.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="securityProviderType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A security provider is a source of specific security-related functionality.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="name" type="substitutableName" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="encryptionStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                An encryption strategy provides support for a specific encryption algorithm.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="name" type="substitutableName" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="customSecurityProviderType">
+        <xsd:complexContent>
+            <xsd:extension base="securityProviderType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="provider-ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the security provider to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="customEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A reference to the encryption strategy (which may be a Spring bean that implements the EncryptionStrategy interface).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="passwordEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:attribute name="password" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The password to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="salt" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The salt to use (this helps prevent dictionary attacks).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="iterationCount" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The number of iterations to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="secretKeyEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:attribute name="key" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The key to use. This and the 'keyFactory-ref' attribute are mutually exclusive.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="keyFactory-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the key factory to use. This should implement the ObjectFactory interface and return a byte array. This and the 'key' attribute are mutually exclusive.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="threading-profile" type="threadingProfileType"
+                 substitutionGroup="abstract-service-threading-profile">
+        <xsd:annotation>
+            <xsd:documentation>
+                The threading profile to use for the service.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <!-- this is a general threading type used by various elements here -->
+    <xsd:complexType name="threadingProfileType">
+        <xsd:complexContent>
+            <!-- this is a hack that allows us to use this general threading profile as a component threading profile
+                 without retyping everything -->
+            <xsd:extension base="abstractServiceThreadingProfileType">
+                <xsd:attribute name="maxThreadsActive" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The maximum number of threads that will be used.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="maxThreadsIdle" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The maximum number of idle or inactive threads that can be in the pool before they are destroyed.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="threadTTL" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Determines how long an inactive thread is kept in the pool before being discarded.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="poolExhaustedAction">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            When the maximum pool size or queue size is bounded, this value determines how to handle incoming tasks. Possible values are: WAIT (wait until a thread becomes available; don't use this value if the minimum number of threads is zero, in which case a thread may never become available), DISCARD (throw away the current request and return), DISCARD_OLDEST (throw away the oldest request and return), ABORT (throw a RuntimeException), and RUN (the default; the thread making the execute request runs the task itself, which helps guard against lockup).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="WAIT"/>
+                            <xsd:enumeration value="DISCARD"/>
+                            <xsd:enumeration value="DISCARD_OLDEST"/>
+                            <xsd:enumeration value="ABORT"/>
+                            <xsd:enumeration value="RUN"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="threadWaitTimeout" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            How long to wait in milliseconds when the pool exhausted action is WAIT. If the value is negative, it will wait indefinitely.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="doThreading" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether threading should be used (default is true).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="maxBufferSize" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Determines how many requests are queued when the pool is at maximum usage capacity and the pool exhausted action is WAIT. The buffer is used as an overflow.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   Exception strategies                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="default-service-exception-strategy" type="endpointExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Provide default exception handling for a service via an endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="default-connector-exception-strategy" type="endpointExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Provide default exception handling for a connector via an endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="endpointExceptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractExceptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-exception-strategy" type="customExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-defined exception strategy.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customExceptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="endpointExceptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the ExceptionListener interface. In addition, if an 'outbound-endpoint' element is specified, it is set as an "endpoint" bean property.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Custom connector element -->
+
+    <xsd:element name="custom-connector" type="customConnectorType" substitutionGroup="abstract-connector">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-defined connector.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="connectorType">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the Connector interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--  Object stores                                                     -->
+    <!--==============================================================-->
+
+
+    <xsd:complexType name="abstractObjectStoreType"/>
+
+        <xsd:element name="abstract-object-store" abstract="true" type="abstractObjectStoreType">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A placeholder for an object store that can be used by routers to maintain state.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:element>
+
+        <xsd:element name="in-memory-store" type="abstractMonitoredObjectStoreType"
+                     substitutionGroup="abstract-object-store">
+            <xsd:annotation>
+                <xsd:documentation>
+                    An optionally bounded in-memory store for message IDs with periodic expiry of old entries. The bounded size is a soft limit and is only enforced periodically by the expiry process. This means that the store may temporarily exceed its maximum size between expiry runs but will eventually shrink to its configured size.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:element>
+
+        <xsd:element name="simple-text-file-store" type="textFileObjectStoreType" substitutionGroup="abstract-object-store">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A simple object store that stores String objects by key to a text file. This store is only suitable for storing simple key value pair strings. This store is backed by an in-memory store and supports the ability to expire and apply TTL to objects in the store.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:element>
+
+        <xsd:complexType name="textFileObjectStoreType">
+            <xsd:complexContent>
+                <xsd:extension base="abstractMonitoredObjectStoreType">
+                    <xsd:attribute name="directory" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The file location (directory) where the object store will be saved. If this value is not set, Mule defaults to using 'mule.working.dir/objectstore'.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+
+        <xsd:complexType name="abstractMonitoredObjectStoreType">
+            <xsd:complexContent>
+                <xsd:extension base="abstractObjectStoreType">
+                    <xsd:attribute name="name" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                An ID for this store that can be used for logging and identification purposes.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="maxEntries" type="substitutableInt">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The maximum number of entries that this store keeps around. Specify '-1' if the store is supposed to be "unbounded".
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="entryTTL" type="substitutableInt">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The time-to-live for each message ID, specified in seconds, or '-1' for entries that should never expire. DO NOT combine this with an unbounded store!
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="expirationInterval" type="substitutableInt">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The interval for periodic bounded size enforcement and entry expiration, specified in seconds. Arbitrary positive values between one second and several hours or days are possible, but should be chosen carefully according to the expected message rate to prevent OutOfMemory conditions.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--  Routers                                                     -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-message-info-mapping" abstract="true" type="abstractMessageInfoMappingType">
+        <xsd:annotation>
+            <xsd:documentation>Maps the attributes of the current message to known message elements in Mule, namely Message ID and CorrrelationID.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractMessageInfoMappingType"/>
+
+    <!-- Inbound Router implementations -->
+
+    <xsd:complexType name="filteredInboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter" minOccurs="0"/>
+                    <!-- TODO this does not make sense here, need to re-visit <xsd:element ref="abstract-message-info-mapping" minOccurs="0"/>-->
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="idempotent-receiver-router" type="idempotentReceiverType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Ensures that only unique messages are received by a service by checking the unique ID of the incoming message. Note that the ID used can be generated from the message using an expression defined in the 'idExpression' attribute. By default, the expression used is '#[message:id]', which means the underlying endpoint must support unique message IDs for this to work. Otherwise, a UniqueIdNotSupportedException is thrown.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="idempotent-secure-hash-receiver-router" type="idempotentSecureHashReceiverType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Ensures that only unique messages are received by a service by calculating the hash of the message itself using a message digest algorithm. This provides a value with an infinitesimally small chance of a collision. This can be used to filter message duplicates. Keep in mind that the hash is calculated over the entire byte array representing the message, so any leading or trailing spaces or extraneous bytes (like padding) can produce different hash values for the same semantic message content. Care should be taken to ensure that messages do not contain extraneous bytes. This class is useful when the message does not support unique identifiers.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="idempotentReceiverType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-object-store" maxOccurs="1" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="idExpression" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Defines one or more expressions to use when extracting the ID from the message. For example, it would be possible to combine to headers as the ID of the message to provide idempotency: '#[headers:foo,bar]'. Or, you could combine the message ID with a header: '#[message:id]-#[header:foo]'. If this property is not set, '#[message:id]' will be used by default.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="idempotentSecureHashReceiverType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-object-store" maxOccurs="1" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="messageDigestAlgorithm" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The secure hashing algorithm to use. If not set, the default is SHA-256.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <xsd:element name="wire-tap-router" type="wireTapRouterType" substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                The WireTap inbound router allows you to route certain messages to a different endpoint as well as to the component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="wireTapRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="1" maxOccurs="1"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="forwarding-router" type="selectiveConsumerRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows messages to be forwarded to the outbound routers without first being processed by a component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="selective-consumer-router" type="selectiveConsumerRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Applies one or more filters to the incoming message. If the filters match, the message is forwarded to the component. Otherwise, the message is forwarded to the catch-all strategy on the router. If no catch-all strategy is configured, the message is ignored and a warning is logged.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="correlation-resequencer-router" type="baseAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Holds back a group of messages and resequences them using each message's correlation sequence property.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="selectiveConsumerRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="transformFirst" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Specifies whether transformations are applied before filtering occurs. The default is true.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-chunking-aggregator-router" type="messageChunkingAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Combines two or more messages into a single message by matching messages with a given Correlation ID. Correlation IDs are set on messages when they are dispatched by certain outbound routers, such as the Recipient List and Message Splitter routers. These messages can be aggregated back together again using this router.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="messageChunkingAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="baseAggregatorRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-message-info-mapping" minOccurs="0"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-correlation-aggregator-router" type="customCorrelationAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a custom message aggregator. Mule provides an abstract implementation that has a template method that performs the message aggregation. A common use of the aggregator router is to combine the results of multiple requests such as "ask this set of vendors for the best price of X".
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customCorrelationAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="messageChunkingAggregatorRouterType">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Fully qualified class name of the custom correlation aggregator router to be used.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="collection-aggregator-router" type="baseAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a Collection Response Router. This will return a MuleMessageCollection message type that will contain all messages received for a each correlation group.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="custom-inbound-router" type="customInboundRouterType"
+                 substitutionGroup="abstract-inbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows for custom inbound routers to be configured.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="customInboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Spring-style property elements so that custom configuration can be configured on the custom router.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of InboundRouter (fully qualified Java class name)
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:attribute name="timeout" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Defines a timeout in Milliseconds to wait for events to be aggregated. By default the router will throw an exeception if the router is waiting for a correlation group and times out before all group enties are received.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="failOnTimeout" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            When false, incomplete aggregation groups will be forwarded to a component on timeout as a java.util.List. When true (default), a CorrelationTimeoutException is thrown and RoutingNotification.CORRELATION_TIMEOUT is fired. The component doesn't receive any messages in this case.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- ResponseRouters -->
+
+    <xsd:element name="single-async-reply-router" type="asyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a Single Response Router. This will return the first message it receives on a reply endpoint and will discard the rest.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="collection-async-reply-router" type="asyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a Collection Response Router. This will return a MuleMessageCollection message type that will contain all messages received for the current correlation.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="asyncReplyRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractAsyncReplyRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The endpoint used to receive the response(s) on.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element ref="abstract-message-info-mapping" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The message info mapper used to extract key bits of the message information, such as Message ID or Correlation ID.  these properties are used by some routers and this mapping information tells Mule where to get the information from in the current message.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-async-reply-router" type="customAsyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router"/>
+    <xsd:complexType name="customAsyncReplyRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="asyncReplyRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Spring-style property elements so that custom configuration can be configured on the custom router.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A fully qualified Java class name of the router to use. The router should either extend {{org.mule.routing.response.AbstractResponseRouter}} or {{org.mule.routing.response.AbstractResponseAggregator}}.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- Outbound Router implementations -->
+
+    <!-- Outbound router element and attribute groups -->
+
+    <xsd:group name="defaultOutboundRouterElements">
+        <xsd:sequence>
+            <xsd:element name="reply-to" type="endpointRefType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Defines where the message should be routed after the recipient of the message to which this service dispatches has finished with it.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-transaction" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Defines an overall transaction that will be used for all endpoints on this router.  This is only useful when you want to define an outbound only transaction that will commit all of the transactions defined on the outbound endpoints for this router.  Note that you must still define a transaction on each of the endpoints that should take part in the transaction.  These transactions should always be configured to JOIN the existing transaction.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-message-info-mapping" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The message info mapper used to extract key bits of the message information, such as Message ID or Correlation ID.  these properties are used by some routers and this mapping information tells Mule where to get the information from in the current message.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:group name="defaultFilteredOutboundRouterElements">
+        <xsd:sequence>
+            <xsd:group ref="defaultOutboundRouterElements" />
+            <xsd:element ref="abstract-filter" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Filters the messages to be processed by this router.
+                        @Deprecated since 2.2.  Configure the filter on the endpoint instead of the router.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Filters are applied before message transformations. A transformer can be configured here to transform messages before they are filtered.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:attributeGroup name="defaultOutboundRouterAttributes">
+        <xsd:attribute name="enableCorrelation" default="IF_NOT_SET">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Specifies whether Mule should give outgoing messages a correlation ID. The default behavior is to give messages a correlation ID only if they don't already have one, so that existing correlation IDs are maintained.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="ALWAYS" />
+                    <xsd:enumeration value="NEVER" />
+                    <xsd:enumeration value="IF_NOT_SET" />
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:attributeGroup name="defaultFilteredOutboundRouterAttributes">
+        <xsd:attributeGroup ref="defaultOutboundRouterAttributes"/>
+        <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A list of the transformers that will be applied to the message in order before it is delivered to the component.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <!-- Default Outbound Router Types -->
+    <xsd:complexType name="outboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint"/>
+                    <xsd:group ref="defaultOutboundRouterElements"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultOutboundRouterAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="filteringOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint"/>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+     <xsd:complexType name="multipleEndpointFilteringOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" maxOccurs="unbounded"/>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="singleEndpointFilteringOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" maxOccurs="1"/>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--  Concrete Outbound Routers -->
+
+    <xsd:element name="pass-through-router" type="outboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                This router always matches and simply sends or dispatches message via the endpoint that is configured.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!--  FilteringOutboundRouter only uses a single endpoint. For now this needs to support multiple endpoints for MessageBuilderComponent usage only. -->
+    <xsd:element name="filtering-router" type="singleEndpointFilteringOutboundRouterType" substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Uses filters to determine whether the message matches a particular criteria and if so will route the message to the endpoint configured on the router.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="template-endpoint-router" type="filteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows endpoints to be altered at runtime based on properties set on the current message or fallback values set on the endpoint properties. Templated values are expressed using square braces around a property name.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="chaining-router" type="multipleEndpointFilteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends the message through multiple endpoints using the result of the first invocation as the input for the next.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="exception-based-router" type="multipleEndpointFilteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends a message over an endpoint by selecting the first endpoint that can connect to the transport.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="multicasting-router" type="multipleEndpointFilteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends the same message over multiple endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="endpoint-selector-router" type="endpointSelectorRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Selects the outgoing endpoint based on an expression evaluator ("header:endpoint" by default). It will first try to match the endpoint by name and then by address. The endpoints to use can be set on the router itself or be global endpoint definitions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="endpointSelectorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="multipleEndpointFilteringOutboundRouterType">
+                <xsd:attributeGroup ref="expressionAttributes"/>
+                <xsd:attribute name="default" type="xsd:NMTOKEN" use="optional">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the default endpoint to use if the expression returns null. This can be used as an 'else' condition to route messages that don't contain the expected routing information.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Splitter routers -->
+
+    <!-- Extends AbstractMessageSplitter-->
+    <xsd:complexType name="messageSplitterOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="multipleEndpointFilteringOutboundRouterType">
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Extends AbstractRoundRobinMessageSplitter -->
+    <xsd:complexType name="roundRobinSplitterType">
+        <xsd:complexContent>
+            <xsd:extension base="messageSplitterOutboundRouterType">
+                <xsd:attribute name="deterministic" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If 'disableRoundRobin' is false and this option is true (the default) then the first message part will be routed to the first endpoint, the second part to the second endpoint, etc, with the nth part going to the (n modulo number of endpoints) endpoint. If false then the messages will be distributed equally amongst all endpoints.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="disableRoundRobin" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If filters are being used on endpoints then round robin behaviour is probably not desirable. This flag switches round robin behaviour off, it is on by default.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="failIfNoMatch" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If 'disableRoundRobin' is true, there may be situations where the current split message does not match any endpoints.  this flag controls whether an exception should be thrown when a match is not found.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="list-message-splitter-router" type="roundRobinSplitterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                The Filtering List Message Splitter accepts a list of objects that is split each object being routed to different endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="expression-splitter-router" type="expressionSplitterOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Splits the message based on an expression. The expression must return one or more message parts in order to be effective.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+
+    <xsd:complexType name="expressionSplitterOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="roundRobinSplitterType">
+                <xsd:attributeGroup ref="expressionAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Messgae chunking routers -->
+    <xsd:element name="message-chunking-router" type="chunkingRouterType" substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows you to split a single message into a number of fixed-length messages that will all be routed to the same endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="chunkingRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="multipleEndpointFilteringOutboundRouterType">
+                <xsd:attribute name="messageSize" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The message chunk size (in bytes) that the current message will be split into. Note that this is mutually exclusive to the 'numberOfMessages' property.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="numberOfMessages" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The number of message peices to break the current message into.  This property is less useful than the 'message' size property since, usually messages are constricted by size. Note that this is mutually exclusive to the 'messageSize' property.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- recipient List routers -->
+    <xsd:element name="static-recipient-list-router" type="staticRecipientListRouterType" substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends the same message to multiple endpoints over the same endpoint, or implements routing-slip behavior where the next destination for the message is determined from message properties or the payload. It uses a static list of recipient endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="staticRecipientListRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                    <xsd:element name="recipients" type="listOrSetType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Static list of recipients that the outgoing message is sent to. The default delimiter is ','.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+                <xsd:attribute name="recipientsProperty" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Defines a property name on the current message where a list of endpoint names (or URIs) can be obtained. This property can return a {{java.util.List}} of values or a delimited {{java.lang.String}}. If the 'recipientsProperty' returns a string then the 'recipientsDelimiter' property is used to split the string.
+                            If the entries in the String or List define endpoint names, these will be looked up at runtime. If the entries define endpoint URIs these endpoints will be created at runtime.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="recipientsDelimiter" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The delimiter to use when splitting a String list of recipients.  the default is ','. This property is only used with the 'recipientsProperty'.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="synchronous" type="xsd:boolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            This flag controls whether the message will be sent to the recipients synchronously. Unlike other routers th recipient list router doesn't have pre-configured endpoints so the synchronicity of the endpoint cannot be honoured.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="expression-recipient-list-router" type="expressionRecipientListRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Sends the same message to multiple endpoints over the same endpoint, or implements routing-slip behavior where the next destination for the message is determined from message properties or the payload. The recipients can be extracted from the message using an expression, or you can specify a static list of recipient endpoints. (As of version 2.1)
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="expressionRecipientListRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                    <xsd:element name="recipients" type="listOrSetType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                A static list of endpoint names or URIs that will be used as recipients of the current message. If the expression on this router returns a list of endpoint names, the endpoints here will be checked as well as any global endpoints.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+                <xsd:attributeGroup ref="expressionAttributes"/>
+                <xsd:attribute name="synchronous" type="xsd:boolean">
+                    <xsd:annotation>
+                        <xsd:documentation>This flag controls whether the message will be sent to the recipients synchronously. Unlike other routers th recipient list router doesn't have pre-configured endpoints so the synchronicity of the endpoint cannot be honoured.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- custom router -->
+    <xsd:element name="custom-outbound-router" type="customOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows you to configure a custom outbound router by specifying the custom router class and by using Spring properties. 
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:group ref="defaultFilteredOutboundRouterElements"/>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Spring-style property elements so that custom configuration can be configured on the
+                                custom router.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="defaultFilteredOutboundRouterAttributes"/>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of OutboundRouter (fully qualified Java class name)
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- Catch all strategy implementations -->
+    <xsd:element name="logging-catch-all-strategy" type="loggingCatchAllStrategyType" substitutionGroup="abstract-catch-all-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Does nothing with the message but simply logs (using the WARN log level) the fact that the message was not dispatched because no routing path was defined.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="loggingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-catch-all-strategy" type="customCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="customCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Fully qualified class name of the custom catch-all strategy to be used.
+                        </xsd:documentation>
+                    </xsd:annotation>                
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="forwarding-catch-all-strategy" type="forwardingCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Forwards the message to the specified endpoint if no outbound routers match.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="forwardingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-forwarding-catch-all-strategy" type="customForwardingCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="customForwardingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="forwardingCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Fully qualified class name of the custom forwarding catch-all strategy to be used.
+                        </xsd:documentation>
+                    </xsd:annotation>                
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Message Info Mappers -->
+
+    <xsd:element name="expression-message-info-mapping" type="expressionMessageInfoMappingType"
+                 substitutionGroup="abstract-message-info-mapping">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows expressions to be configured to extract the message information.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="expressionMessageInfoMappingType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractMessageInfoMappingType">
+                <xsd:attribute name="messageIdExpression" type="xsd:string" use="required"/>
+                <xsd:attribute name="correlationIdExpression" type="xsd:string" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-message-info-mapping" type="customMessageInfoMappingType"
+                 substitutionGroup="abstract-message-info-mapping">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows configuraton of a custom implementation of MessageInfoMapping.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customMessageInfoMappingType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractMessageInfoMappingType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the MessageInfoMapping interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!--==============================================================-->
+    <!--  Lifecycle Adapters                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-lifecycle-adapter-factory" abstract="true" type="abstractLifecycleAdapterFactory"/>
+    <xsd:complexType name="abstractLifecycleAdapterFactory">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows a lifecycle adaptor factory to be implemented, which allows an alternative custom lifecycle adaptor to be used if required instead of the default implementation that propagates the Mule lifecycle to component implementations.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:complexType>
+    <xsd:complexType name="customLifecycleAdapterFactory">
+        <xsd:complexContent>
+            <xsd:extension base="abstractLifecycleAdapterFactory">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the LifecycleAdapter interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:element name="custom-lifecycle-adapter-factory" type="customLifecycleAdapterFactory"
+                 substitutionGroup="abstract-lifecycle-adapter-factory">
+        <xsd:annotation>
+            <xsd:documentation>
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!--==============================================================-->
+    <!--  Object Factories                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-object-factory" abstract="true" type="abstractObjectFactoryType"/>
+    <xsd:complexType name="abstractObjectFactoryType">
+        <xsd:annotation>
+            <xsd:documentation>
+                An object factory is used to obtain object instances. The object factory is responsible for object creation and can implement different patterns, such a singleton or prototype, or lookup an instance from other object containers.  
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="propertiesGroup">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Properties to be set on the created object.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:group>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="genericObjectFactoryType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-object-factory"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="spring-object" type="springBeanLookupType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="springBeanLookupType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Object factory used to obtain Spring bean instances. This object factory does not create any instances but rather looks them up from Spring.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="bean" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>Name of Spring bean to look up.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="singleton-object" type="singletonObjectFactoryType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="singletonObjectFactoryType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Object factory that creates and always returns a singleton object instance.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>Class name</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="prototype-object" type="prototypeObjectFactoryType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="prototypeObjectFactoryType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Object factory that creates and returns a new 'prototype' object instance every time it is called.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>Class name</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-pooling-profile" abstract="true" type="abstractPoolingProfileType"/>
+    <xsd:complexType name="abstractPoolingProfileType"/>
+
+    <xsd:element name="pooling-profile" type="poolingProfileType" substitutionGroup="abstract-pooling-profile"/>
+    <xsd:complexType name="poolingProfileType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A pooling profile is used to configure the pooling behaviour of Mule components. Each component can have its own pooling profile.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractPoolingProfileType">
+                <xsd:attribute name="maxActive" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>Controls the maximum number of Mule components that can be borrowed from a session at one time. When set to a negative value, there is no limit to the number of components that may be active at one time. When maxActive is exceeded, the pool is said to be exhausted.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="maxIdle" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>Controls the maximum number of Mule components that can sit idle in the pool at any time. When set to a negative value, there is no limit to the number of Mule components that may be idle at one time.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="initialisationPolicy" default="INITIALISE_ONE">
+                    <xsd:annotation>
+                        <xsd:documentation>Determines how components in a pool should be initialized. The possible values are: INITIALISE_NONE (will not load any components into the pool on startup), INITIALISE_ONE (will load one initial component into the pool on startup), or INITIALISE_ALL (will load all components in the pool on startup)</xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="INITIALISE_NONE"/>
+                            <xsd:enumeration value="INITIALISE_ONE"/>
+                            <xsd:enumeration value="INITIALISE_ALL"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="exhaustedAction" default="WHEN_EXHAUSTED_GROW">
+                    <xsd:annotation>
+                        <xsd:documentation>Specifies the behavior of the Mule component pool when the pool is exhausted. Possible values are: "WHEN_EXHAUSTED_FAIL", which will throw a NoSuchElementException, "WHEN_EXHAUSTED_WAIT", which will block by invoking Object.wait(long) until a new or idle object is available, or WHEN_EXHAUSTED_GROW, which will create a new Mule instance and return it, essentially making maxActive meaningless. If a positive maxWait value is supplied, it will block for at most that many milliseconds, after which a NoSuchElementException will be thrown. If maxThreadWait is a negative value, it will block indefinitely.</xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="WHEN_EXHAUSTED_GROW"/>
+                            <xsd:enumeration value="WHEN_EXHAUSTED_WAIT"/>
+                            <xsd:enumeration value="WHEN_EXHAUSTED_FAIL"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="maxWait" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>Specifies the number of milliseconds to wait for a pooled component to become available when the pool is exhausted and the exhaustedAction is set to WHEN_EXHAUSTED_BLOCK.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <!-- <xsd:attribute name="factory" type="xsd:string" default="org.mule.config.pool.CommonsPoolFactory"/> -->
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--  Utils / Standard Types                                      -->
+    <!--==============================================================-->
+
+
+    <xsd:complexType name="abstractAgentType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for agents. Not used in core, but common to several modules.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractExtensionType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsIndirectKeyStore, named as tls-client in transport namespace -->
+    <xsd:complexType name="tlsClientKeyStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configure client key stores. TLS/SSL connections are made on behalf of an entity, which can be anonymous or identified by a certificate. This interface specifies how a keystore can be used to provide the certificates (and associated private keys) necessary for identification. This is also used as the trust store if no other trust store is specified and the explicitTrustStoreOnly parameter in the server trust store configuration is false. WARNING - due to restrictions in library implementations the values specified here typically apply to all connectors using this transport.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if possible) of the keystore that contains public certificates and private keys for identification.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the keystore.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The type of keystore used (a Java class name).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsDirectKeyStore, named as tls-key-store in transport namespace -->
+    <xsd:complexType name="tlsKeyStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures key stores. TLS/SSL connections are made on behalf of an entity, which can be anonymous or identified by a certificate. This interface specifies how a keystore can be used to provide the certificates (and associated private keys) necessary for identification.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if possible) of the keystore that contains public certificates and private keys for identification.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The type of keystore used (a Java class name).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="keyPassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the private key.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the keystore.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="algorithm" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The algorithm used by the key store.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsIndirectTrustStore, named as tls-trust-store in transport namespace -->
+    <xsd:complexType name="tlsTrustStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a trust store. TLS/SSL connections are made to trusted systems. The public certificates of trusted systems are stored in a keystore (called a trust store) and used to verify that the connection made to a remote system is the expected identity.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if possible) of the keystore that contains public certificates of trusted servers.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the trust store.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsDirectTrustStore, named as tls-server in transport namespace
+         note that this extends tlsTrustStoreType, so only one of the two is needed -->
+    <xsd:complexType name="tlsServerTrustStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures a direct trust store. TLS/SSL connections are made to trusted systems. The public certificates of trusted systems are stored in a keystore (called a trust store) and used to verify that the connection made to a remote system is the expected identity.
+            </xsd:documentation>
+        </xsd:annotation>    
+        <xsd:complexContent>
+            <xsd:extension base="tlsTrustStoreType">
+                <xsd:attribute name="class" type="substitutableClass"/>
+                <xsd:attribute name="algorithm" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The algorithm used by the trust store.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <!-- should be of type TrustManagerFactory -->
+                <xsd:attribute name="factory-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Reference to a TrustManagerFactory configured as a Spring bean.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="explicitOnly" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Specifies whether the key store data should not be used when a trust store is otherwise undefined.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="requireClientAuthentication" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If a server socket is constructed directly, this attribute is used to determine whether client authentication is required. This does not apply to client connections. 
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsProtocolHandler, named as tls-protocol-handler -->
+    <xsd:complexType name="tlsProtocolHandler">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configures the global Java protocol handler. WARNING - Untested.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="property" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Sets the java.protocol.handler.pkgs system property.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:simpleType name="propertyPlaceholderType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A type that defines a Mule-style property placeholder.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:string">
+            <xsd:pattern value="(\#\[[^\]]+\]|\$\{[^\}]+\})"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableClass">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:NMTOKEN-like type that also allows for Ant-style property placeholders and a leading "[".
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:string">
+                    <xsd:pattern value="\[?[A-Za-z0-9_\.$]+"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="nonBlankString">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:string-like type that cannot be empty.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:string">
+                    <xsd:pattern value=".*[^ ]+.*"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableName">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:NMTOKEN type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutablePortNumber">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:int type that also allows for Ant-style property placeholders and restricts the int value to a valid port number.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:int">
+                    <xsd:minInclusive value="0"/>
+                    <xsd:maxInclusive value="65536"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableInt">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:int type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:int"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableLong">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:long type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:long"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableBoolean">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:boolean type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:boolean"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <!-- i found this a bit confusing, so here is some background...
+         this type is typically called from something like
+           <xsd:element name="properties" type="mapType/>
+         and the "properties" element generates a ChildMapDefinitionParser that
+         can "receive" the map entries generated by the embedded spring <entry..>
+         elements and which is then set via "setProperties" on the parent.
+         in other words, it's a map, and despite the name "properties" has
+         nothing to do with the spring <property ...> element.
+         spring elements like <entry...> are handled by
+         MuleHierarchicalBeanDefinitionParserDelegate which punts them to
+         the spring handler -->
+    <xsd:element name="properties" type="mapType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A map of Mule properties.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="mapType">
+        <xsd:complexContent>
+            <xsd:extension base="spring:mapType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:group name="propertiesGroup">
+        <xsd:sequence>
+            <xsd:element name="property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Sets a Mule property. This is a name/value pair that can be set on components, services, etc., and which provide a generic way of configuring the system. Typically, you shouldn't need to use a generic property like this, since almost all functionality is exposed via dedicated elements. However, it can be useful in configuring obscure or overlooked options and in configuring transports from the generic endpoint elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="properties" minOccurs="0"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:complexType name="listOrSetType">
+        <xsd:complexContent>
+            <xsd:extension base="spring:listOrSetType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="referenceType">
+        <xsd:attribute name="ref" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="keyType">
+        <xsd:attribute name="key" type="xsd:string"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="valueType">
+        <xsd:attribute name="value" type="xsd:string"/>
+        <xsd:attribute name="value-ref" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="keyValueType">
+        <xsd:complexContent>
+            <xsd:extension base="keyType">
+                <xsd:attribute name="value" type="xsd:string"/>
+                <xsd:attribute name="value-ref" type="xsd:NMTOKEN"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   Connector support                                          -->
+    <!--==============================================================-->
+
+    <xsd:complexType name="connectorType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractConnectorType">
+                <xsd:sequence>
+                    <!-- for normal connectors, this is for emergency use only, but it is
+                         critical for custom connector -->
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element name="receiver-threading-profile" type="threadingProfileType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The threading profile to use when a connector receives messages.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="dispatcher-threading-profile" type="threadingProfileType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The threading profile to use when a connector dispatches messages.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element ref="abstract-exception-strategy" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The exception strategy to use when errors occur in the connector.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element ref="abstract-retry-policy" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Retry policy that defines how Mule should retry if a receive/request/dispatch operation fails.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="service-overrides" type="serviceOverridesType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Service overrides allow the connector to be further configured/customized by allowing parts of the transport implementation to be overridden, for example, the message receiver or dispatcher implementation, or the message adaptor that is used.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="createMultipleTransactedReceivers" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether to create multiple concurrent receivers for this connector. This property is used by transports that support transactions, specifically receivers that extend the TransactedPollingMessageReceiver, and provides better throughput.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="numberOfConcurrentTransactedReceivers" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If createMultipleTransactedReceivers is set to true, the number of concurrent receivers that will be launched.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="dynamicNotification" type="substitutableBoolean" default="false">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Enables dynamic notifications for notifications fired by this connector. This allows listeners to be registered dynamically at runtime via the MuleContext, and the configured notification can be changed. This overrides the default value defined in the 'configuration' element.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="validateConnections" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Causes Mule to validate connections before use. Note that this is only a configuration hint,
+                            transport implementations may or may not make an extra effort to validate the connection. Default is true.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="serviceOverridesType">
+        <xsd:attribute name="messageReceiver" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="transactedMessageReceiver" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="xaTransactedMessageReceiver" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="dispatcherFactory" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="inboundTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="outboundTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="responseTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="endpointBuilder" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="messageAdapter" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="streamMessageAdapter" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="serviceFinder" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="sessionHandler" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   JNDI support                                               -->
+    <!--==============================================================-->
+
+    <xsd:complexType name="jndiConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="connectorType">
+                <xsd:sequence>
+                    <xsd:element name="jndi-provider-property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Direct setting of a JNDI property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="jndi-provider-properties" type="mapType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Direct setting of JNDI properties (allows access to the full Spring map entry).
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="jndiContext-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Set the complete context directly, via a bean reference.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiInitialFactory" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The initial context factory to use. The value of the property should be the fully qualified class name of the factory class that will create an initial context.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiProviderUrl" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The service provider to use. The value of the property should contain a URL string (such as "ldap://somehost:389").
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiUrlPkgPrefixes" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The list of package prefixes to use when loading in URL context factories. The value of the property should be a colon-separated list of package prefixes for the class name of the factory class that will create a URL context factory.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="dataReferenceType" mixed="true">
+        <xsd:attribute name="file" type="xsd:string"/>
+        <xsd:attribute name="ref" type="xsd:string"/>
+        <!--I don't like this flag, may be we could use content-type mappings... -->
+        <xsd:attribute name="binary" type="substitutableBoolean"/>
+    </xsd:complexType>
+
+    <!-- these cannot be references (unless we use qualified attribute names, which are ugly),
+         but serve as templates to cut+paste in individual transports
+
+    <xsd:attribute name="path" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A file location.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="user" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A username.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="password" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A password.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="host" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                An IP address (eg www.mulesource.com, localhost, 127.0.0.1).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="port" type="substitutablePortNumber">
+        <xsd:annotation>
+            <xsd:documentation>
+                A port number.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+    
+    -->
+
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/MuleConfigValidationSchemas/spring-beans-2.5.xsd b/xml/tests/testData/xml/MuleConfigValidationSchemas/spring-beans-2.5.xsd
new file mode 100644
index 0000000..769830c
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigValidationSchemas/spring-beans-2.5.xsd
@@ -0,0 +1,1164 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/beans"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		targetNamespace="http://www.springframework.org/schema/beans">
+
+	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Spring XML Beans Schema, version 2.5
+	Authors: Rob Harrop, Juergen Hoeller, Mark Fisher
+
+	This defines a simple and consistent way of creating a namespace
+	of JavaBeans objects, managed by a Spring BeanFactory, read by
+	XmlBeanDefinitionReader (with DefaultBeanDefinitionDocumentReader).
+
+	This document type is used by most Spring functionality, including
+	web application contexts, which are based on bean factories.
+
+	Each "bean" element in this document defines a JavaBean.
+	Typically the bean class is specified, along with JavaBean properties
+	and/or constructor arguments.
+
+	A bean instance can be a "singleton" (shared instance) or a "prototype"
+	(independent instance). Further scopes can be provided by extended
+	bean factories, for example in a web environment.
+
+	References among beans are supported, that is, setting a JavaBean property
+	or a constructor argument to refer to another bean in the same factory
+	(or an ancestor factory).
+
+	As alternative to bean references, "inner bean definitions" can be used.
+	Singleton flags of such inner bean definitions are effectively ignored:
+	inner beans are typically anonymous prototypes.
+
+	There is also support for lists, sets, maps, and java.util.Properties
+	as bean property types or constructor argument types.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<!-- base types -->
+	<xsd:complexType name="identifiedType" abstract="true">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The unique identifier for a bean. The scope of the identifier
+	is the enclosing bean factory.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:attribute name="id" type="xsd:ID">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The unique identifier for a bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Top-level <beans> tag -->
+	<xsd:element name="beans">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The top level (typically root) element. Allows the definition
+	of default values for all nested bean definitions.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="import"/>
+					<xsd:element ref="alias"/>
+					<xsd:element ref="bean"/>
+					<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="default-lazy-init" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'lazy-init' value; see the documentation for the
+	'lazy-init' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-merge" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'merge' value; see the documentation for the
+	'merge' attribute of the various collection elements.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-autowire" default="no">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'autowire' value; see the documentation for the
+	'autowire' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="no"/>
+						<xsd:enumeration value="byName"/>
+						<xsd:enumeration value="byType"/>
+						<xsd:enumeration value="constructor"/>
+						<xsd:enumeration value="autodetect"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-dependency-check" default="none">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'dependency-check' value; see the documentation for the
+	'dependency-check' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="none"/>
+						<xsd:enumeration value="simple"/>
+						<xsd:enumeration value="objects"/>
+						<xsd:enumeration value="all"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-autowire-candidates" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A default bean name pattern for identifying autowire candidates:
+	e.g. "*Service", "data*", "*Service*", "data*Service".
+	Also accepts a comma-separated list of patterns: e.g. "*Service,*Dao".
+	See the documentation for the 'autowire-candidate' attribute of the
+	'<bean/>' element for the semantic details of autowire candidate beans.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-init-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'init-method' value; see the documentation for the
+	'init-method' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-destroy-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'destroy-method' value; see the documentation for the
+	'destroy-method' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:anyAttribute namespace="##other" processContents="lax"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="description">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains informative text describing the purpose of the enclosing element.
+	Used primarily for user documentation of XML bean definition documents.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="import">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.core.io.Resource"><![CDATA[
+	Specifies an XML bean definition resource to import.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="resource" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The relative resource location of the XML (bean definition) file to import,
+	for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml".
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="alias">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines an alias for a bean (which can reside in a different definition
+	resource).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean to define an alias for.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="alias" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The alias name to define for the bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:group name="beanElements">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="constructor-arg"/>
+				<xsd:element ref="property"/>
+				<xsd:element ref="qualifier"/>
+				<xsd:element ref="lookup-method"/>
+				<xsd:element ref="replaced-method"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:attributeGroup name="beanAttributes">
+		<xsd:attribute name="name" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Can be used to create one or more aliases illegal in an (XML) id.
+	Multiple aliases can be separated by any number of spaces, commas,
+	or semi-colons (or indeed any mixture of the three).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="class" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The fully qualified name of the bean's class, except if it serves only
+	as a parent definition for child bean definitions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="parent" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the parent bean definition.
+
+	Will use the bean class of the parent if none is specified, but can
+	also override it. In the latter case, the child bean class must be
+	compatible with the parent, i.e. accept the parent's property values
+	and constructor argument values, if any.
+
+	A child bean definition will inherit constructor argument values,
+	property values and method overrides from the parent, with the option
+	to add new values. If init method, destroy method, factory bean and/or
+	factory method are specified, they will override the corresponding
+	parent settings.
+
+	The remaining settings will always be taken from the child definition:
+	depends on, autowire mode, dependency check, scope, lazy init.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="scope" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The scope of this bean: typically "singleton" (one shared instance,
+	which will be returned by all calls to getBean with the given id), or
+	"prototype" (independent instance resulting from each call to getBean).
+	Default is "singleton".
+
+	Singletons are most commonly used, and are ideal for multi-threaded
+	service objects. Further scopes, such as "request" or "session", might
+	be supported by extended bean factories (e.g. in a web environment).
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+
+	Inner bean definitions inherit the singleton status of their containing
+	bean definition, unless explicitly specified: The inner bean will be a
+	singleton if the containing bean is a singleton, and a prototype if
+	the containing bean has any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="abstract" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Is this bean "abstract", that is, not meant to be instantiated itself
+	but rather just serving as parent for concrete child bean definitions?
+	The default is "false". Specify "true" to tell the bean factory to not
+	try to instantiate that particular bean in any case.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per abstract bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="lazy-init" default="default" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean is to be lazily initialized.
+	If false, it will be instantiated on startup by bean factories
+	that perform eager initialization of singletons. The default is
+	"false".
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether bean properties are "autowired".
+	This is an automagical process in which bean references don't need
+	to be coded explicitly in the XML bean definition file, but rather the
+	Spring container works out dependencies.
+
+	There are 5 modes:
+
+	1. "no"
+	The traditional Spring default. No automagical wiring. Bean references
+	must be defined in the XML file via the <ref/> element (or "ref"
+	attribute). We recommend this in most cases as it makes documentation
+	more explicit.
+
+	2. "byName"
+	Autowiring by property name. If a bean of class Cat exposes a dog
+	property, Spring will try to set this to the value of the bean "dog"
+	in the current container. If there is no matching bean by name, nothing
+	special happens; use dependency-check="objects" to raise an error in
+	that case.
+
+	3. "byType"
+	Autowiring if there is exactly one bean of the property type in the
+	container. If there is more than one, a fatal error is raised, and
+	you cannot use byType autowiring for that bean. If there is none,
+	nothing special happens; use dependency-check="objects" to raise an
+	error in that case.
+
+	4. "constructor"
+	Analogous to "byType" for constructor arguments. If there is not exactly
+	one bean of the constructor argument type in the bean factory, a fatal
+	error is raised.
+
+	5. "autodetect"
+	Chooses "constructor" or "byType" through introspection of the bean
+	class. If a default constructor is found, "byType" gets applied.
+
+	Note that explicit dependencies, i.e. "property" and "constructor-arg"
+	elements, always override autowiring. Autowire behavior can be combined
+	with dependency checking, which will be performed after all autowiring
+	has been completed.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="no"/>
+					<xsd:enumeration value="byName"/>
+					<xsd:enumeration value="byType"/>
+					<xsd:enumeration value="constructor"/>
+					<xsd:enumeration value="autodetect"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="dependency-check" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether or not to check whether all of this
+	bean's dependencies, expressed in its properties, are satisfied.
+	The default is to perform no dependency checking.
+
+	"simple" type dependency checking includes primitives and String;
+	"objects" includes collaborators (other beans in the factory);
+	"all" includes both types of dependency checking.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="none"/>
+					<xsd:enumeration value="simple"/>
+					<xsd:enumeration value="objects"/>
+					<xsd:enumeration value="all"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="depends-on" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The names of the beans that this bean depends on being initialized.
+	The bean factory will guarantee that these beans get initialized
+	before this bean.
+
+	Note that dependencies are normally expressed through bean properties
+	or constructor arguments. This property should just be necessary for
+	other kinds of dependencies like statics (*ugh*) or database preparation
+	on startup.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire-candidate" default="default" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean should be considered when looking
+	for matching candidates to satisfy another bean's autowiring requirements.
+	Note that this does not affect explicit references by name, which will get
+	resolved even if the specified bean is not marked as an autowire candidate.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="primary" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Specifies that this bean should be given preference when multiple
+	candidates are qualified to autowire a single-valued dependency.
+	If exactly one 'primary' bean exists among the candidates, it
+	will be the autowired value.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="init-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom initialization method to invoke after setting
+	bean properties. The method must have no arguments, but may throw any
+	exception.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="destroy-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom destroy method to invoke on bean factory
+	shutdown. The method must have no arguments, but may throw any
+	exception.
+
+	Note: Only invoked on beans whose lifecycle is under the full
+	control of the factory - which is always the case for singletons,
+	but not guaranteed for any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of a factory method to use to create this object. Use
+	constructor-arg elements to specify arguments to the factory method,
+	if it takes arguments. Autowiring does not apply to factory methods.
+
+	If the "class" attribute is present, the factory method will be a static
+	method on the class specified by the "class" attribute on this bean
+	definition. Often this will be the same class as that of the constructed
+	object - for example, when the factory method is used as an alternative
+	to a constructor. However, it may be on a different class. In that case,
+	the created object will *not* be of the class specified in the "class"
+	attribute. This is analogous to FactoryBean behavior.
+
+	If the "factory-bean" attribute is present, the "class" attribute is not
+	used, and the factory method will be an instance method on the object
+	returned from a getBean call with the specified bean name. The factory
+	bean may be defined as a singleton or a prototype.
+
+	The factory method can have any number of arguments. Autowiring is not
+	supported. Use indexed constructor-arg elements in conjunction with the
+	factory-method attribute.
+
+	Setter Injection can be used in conjunction with a factory method.
+	Method Injection cannot, as the factory method returns an instance,
+	which will be used when the container creates the bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-bean" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Alternative to class attribute for factory-method usage.
+	If this is specified, no class attribute should be used.
+	This must be set to the name of a bean in the current or
+	ancestor factories that contains the relevant factory method.
+	This allows the factory itself to be configured using Dependency
+	Injection, and an instance (rather than static) method to be used.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:attributeGroup>
+
+	<xsd:element name="meta" type="metaType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Arbitrary metadata attached to a bean definition.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:complexType name="metaType">
+		<xsd:attribute name="key" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The key name of the metadata attribute being defined.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The value of the metadata attribute being defined (as a simple String).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<xsd:element name="bean">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.BeanDefinition"><![CDATA[
+	Defines a single (usually named) bean.
+
+	A bean definition may contain nested tags for constructor arguments,
+	property values, lookup methods, and replaced methods. Mixing constructor
+	injection and setter injection on the same bean is explicitly supported.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="identifiedType">
+					<xsd:group ref="beanElements"/>
+					<xsd:attributeGroup ref="beanAttributes"/>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="constructor-arg">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.ConstructorArgumentValues">
+				<![CDATA[
+	Bean definitions can specify zero or more constructor arguments.
+	This is an alternative to "autowire constructor".
+	Arguments correspond to either a specific index of the constructor
+	argument list or are supposed to be matched generically by type.
+
+	Note: A single generic argument value will just be used once, rather
+	than potentially matched multiple times (as of Spring 1.1).
+
+	constructor-arg elements are also used in conjunction with the
+	factory-method element to construct beans using static or instance
+	factory methods.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="1">
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+					<xsd:any namespace="##other" processContents="strict"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="index" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact index of the argument in the constructor argument list.
+	Only needed to avoid ambiguities, e.g. in case of 2 arguments of
+	the exact same type.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type of the constructor argument. Only needed to avoid
+	ambiguities, e.g. in case of 2 single argument constructors
+	that can both be converted from a String.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="ref" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>" element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="value" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...<value/>" element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="property" type="propertyType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Bean definitions can have zero or more properties.
+	Property elements correspond to JavaBean setter methods exposed
+	by the bean classes. Spring supports primitives, references to other
+	beans in the same or related factories, lists, maps and properties.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="qualifier">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Bean definitions can provide qualifiers to match against annotations
+	on a field or parameter for fine-grained autowire candidate resolution.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="attribute" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:sequence>
+			<xsd:attribute name="type" type="xsd:string" default="org.springframework.beans.factory.annotation.Qualifier"/>
+			<xsd:attribute name="value" type="xsd:string"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="attribute" type="metaType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A qualifier element may contain attribute child elements as key-value
+	pairs. These will be available for matching against attributes of a
+	qualifier annotation on an autowired field or parameter if present.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="lookup-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A lookup method causes the IoC container to override the given method
+	and return the bean with the name given in the bean attribute. This is
+	a form of Method Injection. It is particularly useful as an alternative
+	to implementing the BeanFactoryAware interface, in order to be able to
+	make getBean() calls for non-singleton instances at runtime. In this
+	case, Method Injection is a less invasive alternative.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the lookup method. This method must take no arguments.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean in the current or ancestor factories that
+	the lookup method should resolve to. Often this bean will be a
+	prototype, in which case the lookup method will return a distinct
+	instance on every invocation. This is useful for single-threaded objects.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="replaced-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Similar to the lookup method mechanism, the replaced-method element
+	is used to control IoC container method overriding: Method Injection.
+	This mechanism allows the overriding of a method with arbitrary code.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="arg-type"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="name" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The name of the method whose implementation must be replaced by the
+	IoC container. If this method is not overloaded, there is no need
+	to use arg-type subelements. If this method is overloaded, arg-type
+	subelements must be used for all override definitions for the method.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="replacer" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation source="java:org.springframework.beans.factory.support.MethodReplacer"><![CDATA[
+	Bean name of an implementation of the MethodReplacer interface in the
+	current or ancestor factories. This may be a singleton or prototype
+	bean. If it is a prototype, a new instance will be used for each
+	method replacement. Singleton usage is the norm.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="arg-type">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Identifies an argument for a replaced method in the event of
+	method overloading.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="match" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Specification of the type of an overloaded method argument as a String.
+	For convenience, this may be a substring of the FQN. E.g. all the
+	following would match "java.lang.String":
+	- java.lang.String
+	- String
+	- Str
+
+	As the number of arguments will be checked also, this convenience
+	can often be used to save typing.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="ref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines a reference to another bean in this factory or an external
+	factory (parent or included factory).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID and thus can 
+	be checked by the XML parser. This is therefore the preferred technique 
+	for referencing beans within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="parent" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean in a parent factory.
+						]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="idref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The id of another bean in this factory or an external factory
+	(parent or included factory).
+	While a regular 'value' element could instead be used for the
+	same effect, using idref in this case allows validation of local
+	bean ids by the XML parser, and name completion by supporting tools.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID and thus can 
+	be checked by the XML parser. This is therefore the preferred technique 
+	for referencing beans within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="value">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains a string representation of a property value.
+	The property may be a string, or may be converted to the required
+	type using the JavaBeans PropertyEditor machinery. This makes it
+	possible for application developers to write custom PropertyEditor
+	implementations that can convert strings to arbitrary target objects.
+
+	Note that this is recommended for simple objects only. Configure
+	more complex objects by populating JavaBean properties with
+	references to other beans.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type that the value should be converted to. Only needed
+	if the type of the target property or constructor argument is
+	too generic: for example, in case of a collection element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="null">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Denotes a Java null value. Necessary because an empty "value" tag
+	will resolve to an empty String, which will not be resolved to a
+	null value unless a special PropertyEditor does so.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<!-- Collection Elements -->
+	<xsd:group name="collectionElements">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:element name="list">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A list can contain multiple inner bean, ref, collection, or value elements.
+	A list can also map to an array type; the necessary conversion is performed
+	automatically.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="listOrSetType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="set">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A set can contain multiple inner bean, ref, collection, or value elements.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="listOrSetType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="map">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A mapping from a key to an object. Maps may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="mapType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="entry" type="entryType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A map entry can be an inner bean, ref, value, or collection.
+	The key of the entry is given by the "key" attribute or child element.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="props">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Props elements differ from map elements in that values must be strings.
+	Props may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="propsType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="key">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A key element can contain an inner bean, ref, value, or collection.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:group ref="collectionElements"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="prop">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The string value of the property. Note that whitespace is trimmed
+	off to avoid unwanted whitespace caused by typical XML formatting.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="key" type="xsd:string" use="required">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The key of the property entry.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="propertyType">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="1">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict"/>
+			</xsd:choice>
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the property, following JavaBean naming conventions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>" element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Collection Types -->
+
+	<!-- base type for collections that have (possibly) typed nested values -->
+	<xsd:complexType name="collectionType">
+		<xsd:attribute name="value-type" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested values. Must be a fully qualified
+	class name.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- 'list' and 'set' collection type -->
+	<xsd:complexType name="listOrSetType">
+		<xsd:complexContent>
+			<xsd:extension base="collectionType">
+				<xsd:group ref="collectionElements"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'map' element type -->
+	<xsd:complexType name="mapType">
+		<xsd:complexContent>
+			<xsd:extension base="collectionType">
+				<xsd:sequence>
+					<xsd:element ref="description" minOccurs="0"/>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="entry"/>
+					</xsd:choice>
+				</xsd:sequence>
+				<xsd:attribute name="key-type" type="xsd:string">
+					<xsd:annotation>
+						<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested entry keys. Must be a fully qualified
+	class name.
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:attribute>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'entry' element type -->
+	<xsd:complexType name="entryType">
+		<xsd:sequence>
+			<xsd:element ref="key" minOccurs="0"/>
+			<xsd:group ref="collectionElements"/>
+		</xsd:sequence>
+		<xsd:attribute name="key" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Each map element must specify its key as attribute or as child element.
+	A key attribute is always a String value.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="key-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a to a "key" element with a nested
+	"<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>"
+	element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- 'props' collection type -->
+	<xsd:complexType name="propsType">
+		<xsd:complexContent>
+			<xsd:extension base="collectionType">
+				<xsd:sequence>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="prop"/>
+					</xsd:choice>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- simple internal types -->
+	<xsd:simpleType name="defaultable-boolean">
+		<xsd:restriction base="xsd:NMTOKEN">
+			<xsd:enumeration value="default"/>
+			<xsd:enumeration value="true"/>
+			<xsd:enumeration value="false"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/MuleConfigValidationSchemas/spring-context-2.5.xsd b/xml/tests/testData/xml/MuleConfigValidationSchemas/spring-context-2.5.xsd
new file mode 100644
index 0000000..0cbb8da
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigValidationSchemas/spring-context-2.5.xsd
@@ -0,0 +1,423 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/context" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+			xmlns:beans="http://www.springframework.org/schema/beans"
+			xmlns:tool="http://www.springframework.org/schema/tool"
+			targetNamespace="http://www.springframework.org/schema/context" elementFormDefault="qualified"
+			attributeFormDefault="unqualified">
+
+	<xsd:import namespace="http://www.springframework.org/schema/beans"/>
+	<xsd:import namespace="http://www.springframework.org/schema/tool"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Defines the configuration elements for the Spring Framework's application
+	context support. Effects the activation of various configuration styles
+	for the containing Spring ApplicationContext.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<xsd:element name="property-placeholder">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Activates replacement of ${...} placeholders, resolved against the specified properties file or Properties object
+	(if any). Falls back to resolving placeholders against JVM system properties.
+	Alternatively, define a parameterized PropertyPlaceholderConfigurer bean in the context.
+			]]></xsd:documentation>
+			<xsd:appinfo>
+				<tool:annotation>
+					<tool:exports type="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+				</tool:annotation>
+			</xsd:appinfo>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:attribute name="location" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The location of the properties file to resolve placeholders against, as a Spring
+	resource location: a URL, a "classpath:" pseudo URL, or a relative file path.
+	Multiple locations may be specified, separated by commas. If neither location nor properties-ref is
+	specified, placeholders will be resolved against system properties.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="properties-ref" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation source="java:java.util.Properties"><![CDATA[
+	The bean name of a Java Properties object that will be used for property substitution.
+	If neither location nor properties-ref is specified, placeholders will be resolved against system properties.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="property-override">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Activates pushing of override values into bean properties, based on configuration
+	lines of the following format: beanName.property=value
+			]]></xsd:documentation>
+			<xsd:appinfo>
+				<tool:annotation>
+					<tool:exports type="org.springframework.beans.factory.config.PropertyOverrideConfigurer"/>
+				</tool:annotation>
+			</xsd:appinfo>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:attribute name="location" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The location of the properties file to read property overrides from, as a Spring
+	resource location: a URL, a "classpath:" pseudo URL, or a relative file path.
+	Multiple locations may be specified, separated by commas.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="properties-ref" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation source="java:java.util.Properties"><![CDATA[
+	The bean name of a Java Properties object that will be used for property overrides.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="annotation-config">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Activates various annotations to be detected in bean classes: Spring's @Required and
+	@Autowired, as well as JSR 250's @PostConstruct, @PreDestroy and @Resource (if available),
+	JAX-WS's @WebServiceRef (if available), EJB3's @EJB (if available), and JPA's
+	@PersistenceContext and @PersistenceUnit (if available). Alternatively, you may
+	choose to activate the individual BeanPostProcessors for those annotations.
+
+	Note: This tag does not activate processing of Spring's @Transactional or EJB3's
+	@TransactionAttribute annotation. Consider the use of the <tx:annotation-driven>
+	tag for that purpose.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="component-scan">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Scans the classpath for annotated components that will be auto-registered as 
+	Spring beans. By default, the Spring-provided @Component, @Repository, 
+	@Service, and @Controller stereotypes will be detected.
+
+	Note: This tag implies the effects of the 'annotation-config' tag, activating @Required,
+	@Autowired, @PostConstruct, @PreDestroy, @Resource, @PersistenceContext and @PersistenceUnit
+	annotations in the component classes, which is usually desired for autodetected components
+	(without external configuration). Turn off the 'annotation-config' attribute to deactivate
+	this default behavior, for example in order to use custom BeanPostProcessor definitions
+	for handling those annotations.
+
+	Note: You may use placeholders in package paths, but only resolved against system
+	properties (analogous to resource paths). A component scan results in new bean definition
+	being registered; Spring's PropertyPlaceholderConfigurer will apply to those bean
+	definitions just like to regular bean definitions, but it won't apply to the component
+	scan settings themselves.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element name="include-filter" type="filterType" minOccurs="0" maxOccurs="unbounded">
+					<xsd:annotation>
+						<xsd:documentation><![CDATA[
+	Controls which eligible types to include for component scanning.
+							]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:element>
+				<xsd:element name="exclude-filter" type="filterType" minOccurs="0" maxOccurs="unbounded">
+					<xsd:annotation>
+						<xsd:documentation><![CDATA[
+	Controls which eligible types to exclude for component scanning.
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:element>
+			</xsd:sequence>
+			<xsd:attribute name="base-package" type="xsd:string" use="required">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The comma-separated list of packages to scan for annotated components.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="resource-pattern" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Controls the class files eligible for component detection. Defaults to "**/*.class", the recommended value.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="use-default-filters" type="xsd:boolean" default="true">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Indicates whether automatic detection of classes annotated with @Component, @Repository, @Service, or @Controller
+	should be enabled. Default is "true".
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="annotation-config" type="xsd:boolean" default="true">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Indicates whether the implicit AutowiredAnnotationBeanPostProcessor and CommonAnnotationBeanPostProcessor should
+	 be enabled. Default is "true".
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="name-generator" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The fully-qualified classname of the BeanNameGenerator to be used for naming detected components.
+					]]></xsd:documentation>
+					<xsd:appinfo>
+						<tool:annotation>
+							<tool:expected-type type="java.lang.Class"/>
+							<tool:assignable-to type="org.springframework.beans.factory.support.BeanNameGenerator"/>
+						</tool:annotation>
+					</xsd:appinfo>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="scope-resolver" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The fully-qualified class name of the ScopeMetadataResolver to be used for resolving the scope of detected components.
+					]]></xsd:documentation>
+					<xsd:appinfo>
+						<tool:annotation>
+							<tool:expected-type type="java.lang.Class"/>
+							<tool:assignable-to type="org.springframework.context.annotation.ScopeMetadataResolver"/>
+						</tool:annotation>
+					</xsd:appinfo>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="scoped-proxy">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Indicates whether proxies should be generated for detected components, which may be necessary when using certain
+	non-singleton scopes in a proxy-style fashion. Default is to generate no such proxies.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:string">
+						<xsd:enumeration value="no"/>
+						<xsd:enumeration value="interfaces"/>
+						<xsd:enumeration value="targetClass"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="load-time-weaver">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Activates a Spring LoadTimeWeaver for this application context, available as
+	a bean with the name "loadTimeWeaver". Any bean that implements the
+	LoadTimeWeaverAware interface will then receive the LoadTimeWeaver reference
+	automatically; for example, Spring's JPA bootstrap support.
+
+	The default weaver is determined automatically. As of Spring 2.5: detecting
+	Sun's GlassFish, Oracle's OC4J, Spring's VM agent and any ClassLoader
+	supported by Spring's ReflectiveLoadTimeWeaver (for example, the
+	TomcatInstrumentableClassLoader).
+
+	The activation of AspectJ load-time weaving is specified via a simple flag
+	(the 'aspectj-weaving' attribute), with the AspectJ class transformer
+	registered through Spring's LoadTimeWeaver. AspectJ weaving will be activated
+	by default if a "META-INF/aop.xml" resource is present in the classpath.
+
+	This also activates the current application context for applying dependency
+	injection to non-managed classes that are instantiated outside of the Spring
+	bean factory (typically classes annotated with the @Configurable annotation).
+	This will only happen if the AnnotationBeanConfigurerAspect is on the classpath
+	(i.e. spring-aspects.jar), effectively activating "spring-configured" by default.
+			]]></xsd:documentation>
+			<xsd:appinfo>
+				<tool:annotation>
+					<tool:exports type="org.springframework.instrument.classloading.LoadTimeWeaver"/>
+				</tool:annotation>
+			</xsd:appinfo>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:attribute name="weaver-class" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The fully-qualified classname of the LoadTimeWeaver that is to be activated.
+					]]></xsd:documentation>
+					<xsd:appinfo>
+						<tool:annotation>
+							<tool:expected-type type="java.lang.Class"/>
+							<tool:assignable-to type="org.springframework.instrument.classloading.LoadTimeWeaver"/>
+						</tool:annotation>
+					</xsd:appinfo>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="aspectj-weaving" default="autodetect">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:string">
+						<xsd:enumeration value="on">
+							<xsd:annotation>
+								<xsd:documentation><![CDATA[
+	Switches Spring-based AspectJ load-time weaving on.
+								]]></xsd:documentation>
+							</xsd:annotation>
+						</xsd:enumeration>
+						<xsd:enumeration value="off">
+							<xsd:annotation>
+								<xsd:documentation><![CDATA[
+	Switches Spring-based AspectJ load-time weaving off.
+								]]></xsd:documentation>
+							</xsd:annotation>
+						</xsd:enumeration>
+						<xsd:enumeration value="autodetect">
+							<xsd:annotation>
+								<xsd:documentation><![CDATA[
+	Switches AspectJ load-time weaving on if a "META-INF/aop.xml" resource
+	is present in the classpath. If there is no such resource, then AspectJ
+	load-time weaving will be switched off.
+								]]></xsd:documentation>
+							</xsd:annotation>
+						</xsd:enumeration>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="spring-configured">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect">
+				<![CDATA[
+	Signals the current application context to apply dependency injection
+	to non-managed classes that are instantiated outside of the Spring bean
+	factory (typically classes annotated with the @Configurable annotation).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:simpleType>
+			<xsd:restriction base="xsd:string"/>
+		</xsd:simpleType>
+	</xsd:element>
+
+	<xsd:element name="mbean-export">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.jmx.export.annotation.AnnotationMBeanExporter"><![CDATA[
+	Activates default exporting of MBeans by detecting standard MBeans in the Spring
+	context as well as @ManagedResource annotations on Spring-defined beans.
+
+	The resulting MBeanExporter bean is defined under the name "mbeanExporter".
+	Alternatively, consider defining a custom AnnotationMBeanExporter bean explicitly.
+			]]></xsd:documentation>
+			<xsd:appinfo>
+				<tool:annotation>
+					<tool:exports type="org.springframework.jmx.export.annotation.MBeanExporter"/>
+				</tool:annotation>
+			</xsd:appinfo>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:attribute name="default-domain" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default domain to use when generating JMX ObjectNames.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="server" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The bean name of the MBeanServer to which MBeans should be exported.
+	Default is to use the platform's default MBeanServer (autodetecting
+	WebLogic 9+, WebSphere 5.1+ and the JDK 1.5+ platform MBeanServer).
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="registration">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The registration behavior, indicating how to deal with existing MBeans
+	of the same name: fail with an exception, ignore and keep the existing
+	MBean, or replace the existing one with the new MBean.
+
+	Default is to fail with an exception.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="failOnExisting"/>
+						<xsd:enumeration value="ignoreExisting"/>
+						<xsd:enumeration value="replaceExisting"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="mbean-server">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.jmx.support.MBeanServerFactoryBean"><![CDATA[
+	Exposes a default MBeanServer for the current platform.
+	Autodetects WebLogic 9+, WebSphere 5.1+ and the JDK 1.5+ platform MBeanServer.
+
+	The default bean name for the exposed MBeanServer is "mbeanServer".
+	This may be customized through specifying the "id" attribute.
+			]]></xsd:documentation>
+			<xsd:appinfo>
+				<tool:annotation>
+					<tool:exports type="javax.management.MBeanServer"/>
+				</tool:annotation>
+			</xsd:appinfo>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="beans:identifiedType">
+					<xsd:attribute name="agent-id" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The agent id of the target MBeanServer, if any.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="filterType">
+		<xsd:attribute name="type" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+    Controls the type of filtering to apply to the expression.
+
+    "annotation" indicates an annotation to be present at the type level in target components;
+    "assignable" indicates a class (or interface) that the target components are assignable to (extend/implement);
+    "aspectj" indicates an AspectJ type expression to be matched by the target components;
+    "regex" indicates a regex expression to be matched by the target components' class names;
+    "custom" indicates a custom implementation of the org.springframework.core.type.TypeFilter interface.
+
+    Note: This attribute will not be inherited by child bean definitions.
+    Hence, it needs to be specified per concrete bean definition.
+                ]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:string">
+					<xsd:enumeration value="annotation"/>
+					<xsd:enumeration value="assignable"/>
+					<xsd:enumeration value="aspectj"/>
+					<xsd:enumeration value="regex"/>
+					<xsd:enumeration value="custom"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="expression" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+    Indicates the filter expression, the type of which is indicated by "type".
+                ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/MuleConfigValidationSchemas/spring-tool-2.5.xsd b/xml/tests/testData/xml/MuleConfigValidationSchemas/spring-tool-2.5.xsd
new file mode 100644
index 0000000..17bec6d
--- /dev/null
+++ b/xml/tests/testData/xml/MuleConfigValidationSchemas/spring-tool-2.5.xsd
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/tool"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		targetNamespace="http://www.springframework.org/schema/tool"
+		elementFormDefault="qualified">
+
+	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Defines the tool support annotations for Spring's configuration namespaces.
+	Used in other namespace XSD files; not intended for direct use in config files.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<xsd:element name="annotation">
+		<xsd:complexType>
+			<xsd:sequence minOccurs="0">
+				<xsd:element name="expected-type" type="typedParameterType" minOccurs="0" maxOccurs="1"/>
+				<xsd:element name="assignable-to" type="typedParameterType" minOccurs="0" maxOccurs="1"/>
+				<xsd:element name="exports" type="exportsType" minOccurs="0" maxOccurs="1"/>
+				<xsd:element name="registers-scope" type="registersScopeType" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:sequence>
+			<xsd:attribute name="kind" default="direct">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:string">
+						<xsd:enumeration value="ref"/>
+						<xsd:enumeration value="direct"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="typedParameterType">
+		<xsd:attribute name="type" type="xsd:string" use="required"/>
+	</xsd:complexType>
+
+	<xsd:complexType name="exportsType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Indicates that an annotated type exports an application visible component.
+		]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:attribute name="type" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The type of the exported component. May be null if the type is not known until runtime.
+		]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="identifier" type="xsd:string" default="@id">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Defines an XPath query that can be executed against the node annotated with this
+	type to determine the identifier of any exported component.
+		]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<xsd:complexType name="registersScopeType">
+		<xsd:attribute name="name" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Defines the name of a custom bean scope that the annotated type registers, e.g. "conversation".
+	Such a scope will be available in addition to the standard "singleton" and "prototype" scopes
+	(plus "request", "session" and "globalSession" in a web application environment).
+		]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/NavigateToDeclDefinedWithEntity.dtd b/xml/tests/testData/xml/NavigateToDeclDefinedWithEntity.dtd
new file mode 100644
index 0000000..ccd8e84
--- /dev/null
+++ b/xml/tests/testData/xml/NavigateToDeclDefinedWithEntity.dtd
@@ -0,0 +1,2 @@
+<!ENTITY % my.mod SYSTEM "NavigateToDeclDefinedWithEntity.ent" >
+%my.mod;
diff --git a/xml/tests/testData/xml/NavigateToDeclDefinedWithEntity.ent b/xml/tests/testData/xml/NavigateToDeclDefinedWithEntity.ent
new file mode 100644
index 0000000..ee773d5
--- /dev/null
+++ b/xml/tests/testData/xml/NavigateToDeclDefinedWithEntity.ent
@@ -0,0 +1,2 @@
+<!ELEMENT mapping (#PCDATA)>
+<!ATTLIST mapping id ID #IMPLIED>
diff --git a/xml/tests/testData/xml/NavigateToDeclDefinedWithEntity.xml b/xml/tests/testData/xml/NavigateToDeclDefinedWithEntity.xml
new file mode 100644
index 0000000..5c95159
--- /dev/null
+++ b/xml/tests/testData/xml/NavigateToDeclDefinedWithEntity.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapping SYSTEM "NavigateToDeclDefinedWithEntity.dtd">
+<mapping id="qq" />
diff --git a/xml/tests/testData/xml/NoNamespaceLocation.xml b/xml/tests/testData/xml/NoNamespaceLocation.xml
new file mode 100644
index 0000000..b0875c1
--- /dev/null
+++ b/xml/tests/testData/xml/NoNamespaceLocation.xml
@@ -0,0 +1,3 @@
+<aRoot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="NoNamespaceLocation.xsd">
+  <anElement xml:space="preserve" />
+</aRoot>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/NoNamespaceLocation.xsd b/xml/tests/testData/xml/NoNamespaceLocation.xsd
new file mode 100644
index 0000000..c4dea06
--- /dev/null
+++ b/xml/tests/testData/xml/NoNamespaceLocation.xsd
@@ -0,0 +1,12 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:import namespace="http://www.w3.org/XML/1998/namespace"/>
+  <xs:element name="aRoot" type="aRootType" />
+  <xs:complexType name="aRootType">
+    <xs:sequence>
+      <xs:element name="anElement" type="anElementType"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="anElementType">
+    <xs:attribute ref="xml:space" />
+  </xs:complexType>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/NoRootTag.xml b/xml/tests/testData/xml/NoRootTag.xml
new file mode 100644
index 0000000..9789bba
--- /dev/null
+++ b/xml/tests/testData/xml/NoRootTag.xml
@@ -0,0 +1 @@
+<error descr="Top level element is not completed"> </error>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/NoSpaceBeforeAttrAndNoCdataEnd.xml b/xml/tests/testData/xml/NoSpaceBeforeAttrAndNoCdataEnd.xml
new file mode 100644
index 0000000..e086faa
--- /dev/null
+++ b/xml/tests/testData/xml/NoSpaceBeforeAttrAndNoCdataEnd.xml
@@ -0,0 +1,5 @@
+<foo bar="xxx"<error></error>baz="yyy">
+  <![CDATA[
+  ]]>
+  <error>]]></error>
+</foo>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/NonEnumeratedValuesHighlighting.xml b/xml/tests/testData/xml/NonEnumeratedValuesHighlighting.xml
new file mode 100644
index 0000000..cdeb507
--- /dev/null
+++ b/xml/tests/testData/xml/NonEnumeratedValuesHighlighting.xml
@@ -0,0 +1,21 @@
+<xsl:stylesheet version="1.0"
+                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                 exclude-result-prefixes="<error>java</error>">
+   <xsl:template match="/">
+     <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/1999/XSL/Format fop.xsd">
+       <fo:layout-master-set>
+         <fo:simple-page-master
+             margin-top="60pt"
+             margin-bottom="18pt"
+             margin-left="1cm"
+             margin-right="1cm"
+             page-width="297mm"
+             page-height="210mm"
+             master-name="first">
+           <fo:region-body margin-bottom="24pt"/>
+           <fo:region-after extent="24pt"/>
+         </fo:simple-page-master>
+       </fo:layout-master-set>
+     </fo:root>
+   </xsl:template>
+ </xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting.xml b/xml/tests/testData/xml/OasisDocumentHighlighting.xml
new file mode 100644
index 0000000..9ed7644
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
+
+<concept id="concept_0E9B27D593814C37A7E1A58E91437303">
+    <title>Roles</title>
+    <shortdesc>
+      <apiname/>
+    </shortdesc>
+
+    <conbody>
+
+        <p></p>
+        <p>></p>
+    </conbody>
+</concept>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/bookmap.dtd b/xml/tests/testData/xml/OasisDocumentHighlighting/bookmap.dtd
new file mode 100644
index 0000000..70430b2
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/bookmap.dtd
@@ -0,0 +1,120 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Bookmap DTD                                  -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//DTD DITA BookMap//EN"
+      Delivered as file "bookmap.dtd"                              -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    DTD to describe DITA Book Maps                    -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2004                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2006.                    -->
+<!--             (C) Copyright IBM Corporation 2004, 2005.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATIONS                 -->
+<!-- ============================================================= -->
+
+<!ENTITY % mapgroup-d-dec 
+                        PUBLIC 
+"-//OASIS//ENTITIES DITA Map Group Domain//EN" 
+"mapGroup.ent"                                                       >
+%mapgroup-d-dec;
+
+<!ENTITY % indexing-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Indexing Domain//EN" 
+"indexingDomain.ent"                                                 >
+%indexing-d-dec;
+
+<!ENTITY % xnaldomain-d-dec 
+                        PUBLIC 
+"-//OASIS//ENTITIES DITA XNAL Domain//EN" 
+"xnalDomain.ent"                                                     >
+%xnaldomain-d-dec;
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE DECLARATIONS              -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN EXTENSIONS                          -->
+<!-- ============================================================= -->
+<!--                    One for each extended base element, with
+                        the name of the domain(s) in which the
+                        extension was declared                     -->
+<!ENTITY % author       "author | %xnal-d-author;"                   >
+<!ENTITY % topicref     "topicref | %mapgroup-d-topicref;"           >
+<!ENTITY % index-base   "index-base | %indexing-d-index-base;"       >
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE EXTENSIONS                -->
+<!-- ============================================================= -->
+<!ENTITY % props-attribute-extensions  ""                            >
+<!ENTITY % base-attribute-extensions   ""                            >
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+<!--                    Must be declared ahead of the DTDs, which
+                        puts @domains first in order               -->
+<!ENTITY included-domains "&mapgroup-d-att; &indexing-d-att; 
+                           &xnal-d-att;"                             >
+
+<!-- ============================================================= -->
+<!--                    MAP ELEMENT INTEGRATION                    -->
+<!-- ============================================================= -->
+
+<!ENTITY % map-type PUBLIC 
+"-//OASIS//ELEMENTS DITA Map//EN" 
+"map.mod"                                                            >
+%map-type;
+
+<!ENTITY % bookmap-type PUBLIC 
+"-//OASIS//ELEMENTS DITA BookMap//EN" 
+"bookmap.mod"                                                        >
+%bookmap-type;
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ELEMENT INTEGRATION                 -->
+<!-- ============================================================= -->
+
+<!ENTITY % mapgroup-d-def  
+                        PUBLIC 
+"-//OASIS//ELEMENTS DITA Map Group Domain//EN" 
+"mapGroup.mod"                                                       >
+%mapgroup-d-def;
+
+<!ENTITY % indexing-d-def
+                        PUBLIC 
+"-//OASIS//ELEMENTS DITA Indexing Domain//EN" 
+"indexingDomain.mod"                                                 >
+%indexing-d-def;
+
+<!ENTITY % xnaldomain-d-def  
+                        PUBLIC 
+"-//OASIS//ELEMENTS DITA XNAL Domain//EN" 
+"xnalDomain.mod"                                                     >
+%xnaldomain-d-def;
+
+<!-- ================== End DITA Bookmap DTD  ==================== -->
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/bookmap.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/bookmap.mod
new file mode 100644
index 0000000..894ee62
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/bookmap.mod
@@ -0,0 +1,644 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Bookmap                                      -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA BookMap//EN" 
+      Delivered as file "bookmap.mod"                              -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Define elements and specialization atttributes    -->
+<!--             for Book Maps                                     -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2004                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2004, 2005.         -->
+<!--             All Rights Reserved.                              -->
+<!--  UPDATES:                                                     -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                   ELEMENT NAME ENTITIES                       -->
+<!-- ============================================================= -->
+                               
+<!ENTITY % bookmap         "bookmap"                                 >
+
+<!ENTITY % abbrevlist      "abbrevlist"                              >
+<!ENTITY % bookabstract    "bookabstract"                            >
+<!ENTITY % amendments      "amendments"                              >
+<!ENTITY % appendix        "appendix"                                >
+<!ENTITY % approved        "approved"                                >
+<!ENTITY % backmatter      "backmatter"                              >
+<!ENTITY % bibliolist      "bibliolist"                              >
+<!ENTITY % bookchangehistory "bookchangehistory"                     >
+<!ENTITY % bookevent       "bookevent"                               >
+<!ENTITY % bookeventtype   "bookeventtype"                           >
+<!ENTITY % bookid          "bookid"                                  >
+<!ENTITY % booklibrary     "booklibrary"                             >
+<!ENTITY % booklist        "booklist"                                >
+<!ENTITY % booklists       "booklists"                               >
+<!ENTITY % bookmeta        "bookmeta"                                >
+<!ENTITY % booknumber      "booknumber"                              >
+<!ENTITY % bookowner       "bookowner"                               >
+<!ENTITY % bookpartno      "bookpartno"                              >
+<!ENTITY % bookrestriction "bookrestriction"                         >
+<!ENTITY % bookrights      "bookrights"                              >
+<!ENTITY % booktitle       "booktitle"                               >
+<!ENTITY % booktitlealt    "booktitlealt"                            >
+<!ENTITY % chapter         "chapter"                                 >
+<!ENTITY % colophon        "colophon"                                >
+<!ENTITY % completed       "completed"                               >
+<!ENTITY % copyrfirst      "copyrfirst"                              >
+<!ENTITY % copyrlast       "copyrlast"                               >
+<!ENTITY % day             "day"                                     >
+<!ENTITY % dedication      "dedication"                              >
+<!ENTITY % draftintro      "draftintro"                              >
+<!ENTITY % edited          "edited"                                  >
+<!ENTITY % edition         "edition"                                 >
+<!ENTITY % figurelist      "figurelist"                              >
+<!ENTITY % frontmatter     "frontmatter"                             >
+<!ENTITY % glossarylist    "glossarylist"                            >
+<!ENTITY % indexlist       "indexlist"                               >
+<!ENTITY % isbn            "isbn"                                    >
+<!ENTITY % mainbooktitle   "mainbooktitle"                           >
+<!ENTITY % maintainer      "maintainer"                              >
+<!ENTITY % month           "month"                                   >
+<!ENTITY % notices         "notices"                                 >
+<!ENTITY % organization    "organization"                            >
+<!ENTITY % part            "part"                                    >
+<!ENTITY % person          "person"                                  >
+<!ENTITY % preface         "preface"                                 >
+<!ENTITY % printlocation   "printlocation"                           >
+<!ENTITY % published       "published"                               >
+<!ENTITY % publisherinformation "publisherinformation"               >
+<!ENTITY % publishtype     "publishtype"                             >
+<!ENTITY % reviewed        "reviewed"                                >
+<!ENTITY % revisionid      "revisionid"                              >
+<!ENTITY % started         "started"                                 >
+<!ENTITY % summary         "summary"                                 >
+<!ENTITY % tablelist       "tablelist"                               >
+<!ENTITY % tested          "tested"                                  >
+<!ENTITY % trademarklist   "trademarklist"                           >
+<!ENTITY % toc             "toc"                                     >
+<!ENTITY % volume          "volume"                                  >
+<!ENTITY % year            "year"                                    >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY included-domains ""                                         >
+
+<!-- ============================================================= -->
+<!--                    COMMON ATTLIST SETS                        -->
+<!-- ============================================================= -->
+
+<!-- Currently: same as topicref, minus @query -->
+<!ENTITY % chapter-atts 
+            'navtitle   CDATA                             #IMPLIED
+             href       CDATA                             #IMPLIED
+             keyref     CDATA                             #IMPLIED
+             copy-to    CDATA                             #IMPLIED
+             outputclass 
+                        CDATA                             #IMPLIED
+             %topicref-atts;
+             %univ-atts;'                                            >
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+
+
+<!--                    LONG NAME: Book Map                        -->
+<!ELEMENT bookmap       (((%title;) | (%booktitle;))?,
+                         (%bookmeta;)?, 
+                         (%frontmatter;)?,
+                         (%chapter;)*, (%part;)*, (%appendix;)*,
+                         (%backmatter;)?,
+                         (%reltable;)*)                              >
+<!ATTLIST bookmap
+             id         ID                                #IMPLIED
+             conref     CDATA                             #IMPLIED
+             anchorref  CDATA                             #IMPLIED
+             outputclass 
+                        CDATA                             #IMPLIED
+             %localization-atts;
+             %arch-atts;
+             domains    CDATA                  "&included-domains;" 
+             %topicref-atts;
+             %select-atts;                                           >
+             
+
+<!--                    LONG NAME: Book Metadata                   -->
+<!ELEMENT  bookmeta    ((%linktext;)?, (%searchtitle;)?, 
+                         (%shortdesc;)?, (%author;)*, (%source;)?, 
+                         (%publisherinformation;)*,
+                         (%critdates;)?, (%permissions;)?, 
+                         (%audience;)*, (%category;)*, 
+                         (%keywords;)*, (%prodinfo;)*, (%othermeta;)*, 
+                         (%resourceid;)*, (%bookid;)?,
+                         (%bookchangehistory;)*,
+                         (%bookrights;)*,
+                         (%data;)*)                                  >
+<!ATTLIST  bookmeta
+             lockmeta   (yes | no)                        #IMPLIED
+             %univ-atts;                                             >
+
+<!--                    LONG NAME: Front Matter                    -->
+<!ELEMENT  frontmatter  (%booklists; | %notices; | %dedication; | 
+                         %colophon; | %bookabstract; | %draftintro; | 
+                         %preface; | %topicref;)*                    >
+<!ATTLIST  frontmatter
+             keyref     CDATA                             #IMPLIED
+             query      CDATA                             #IMPLIED
+             outputclass 
+                        CDATA                             #IMPLIED
+             %topicref-atts;
+             %univ-atts;                                             >
+
+<!--                    LONG NAME: Back Matter                     -->
+<!ELEMENT  backmatter   (%booklists; | %notices; | %dedication; | 
+                         %colophon; | %amendments; | %topicref;)*    >
+<!ATTLIST  backmatter
+             keyref     CDATA                             #IMPLIED
+             query      CDATA                             #IMPLIED
+             outputclass 
+                        CDATA                             #IMPLIED
+             %topicref-atts;
+             %univ-atts;                                             >
+
+<!--                    LONG NAME: Publisher Information           -->
+<!ELEMENT publisherinformation   
+                        (((%person;) | (%organization;))*, 
+                         (%printlocation;)*, (%published;)*, 
+                         (%data;)*)                                  >
+<!ATTLIST publisherinformation
+             href       CDATA                            #IMPLIED
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;                                             >
+
+<!--                    LONG NAME: Person                          -->
+<!ELEMENT person        (%words.cnt;)*                               >
+<!ATTLIST person
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Organization                    -->
+<!ELEMENT organization  (%words.cnt;)*                               >
+<!ATTLIST organization
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Book Change History             -->
+<!ELEMENT bookchangehistory
+                        ((%reviewed;)*, (%edited;)*, (%tested;)*, 
+                         (%approved;)*, (%bookevent;)*)              >
+<!ATTLIST bookchangehistory
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Book ID                         -->
+<!ELEMENT bookid        ((%bookpartno;)*, (%edition;)?, (%isbn;)?, 
+                         (%booknumber;)?, (%volume;)*, 
+                         (%maintainer;)?)                            >
+<!ATTLIST bookid
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Summary                         -->
+<!ELEMENT summary       (%words.cnt;)*                               >
+<!ATTLIST summary
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Print Location                  -->
+<!ELEMENT printlocation (%words.cnt;)*                               >
+<!ATTLIST printlocation
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Published                       -->
+<!ELEMENT published     (((%person;) | (%organization;))*,
+                         (%publishtype;)?, (%revisionid;)?,
+                         (%started;)?, (%completed;)?, (%summary;)?, 
+                         (%data;)*)                                  >
+<!ATTLIST published
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Publish Type                    -->
+<!ELEMENT publishtype   EMPTY                                        >
+<!ATTLIST publishtype
+             %univ-atts;
+             name       CDATA                            #IMPLIED
+             datatype   CDATA                            #IMPLIED
+             href       CDATA                            #IMPLIED
+             format     CDATA                            #IMPLIED
+             type       CDATA                            #IMPLIED
+             scope      (local | peer | external)        #IMPLIED
+             outputclass
+                        CDATA                            #IMPLIED
+             value      (beta|limited|general)           #REQUIRED   >
+             
+<!--                    LONG NAME: Revision ID                     -->
+<!ELEMENT revisionid    (#PCDATA)*>
+<!ATTLIST revisionid
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+                        
+<!--                    LONG NAME: Start Date                      -->
+<!ELEMENT started       ( ((%year;), ((%month;), (%day;)?)?) | 
+                          ((%month;), (%day;)?, (%year;)) | 
+                          ((%day;), (%month;), (%year;)))            >
+<!ATTLIST started         
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+                        
+<!--                    LONG NAME: Completion Date                 -->
+<!ELEMENT completed     ( ((%year;), ((%month;), (%day;)?)?) | 
+                          ((%month;), (%day;)?, (%year;)) | 
+                          ((%day;), (%month;), (%year;)))            >
+<!ATTLIST completed       
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+                        
+<!--                    LONG NAME: Year                            -->
+<!ELEMENT year          (#PCDATA)*                                   >
+<!ATTLIST year
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+                        
+<!--                    LONG NAME: Month                           -->
+<!ELEMENT month         (#PCDATA)*                                   >
+<!ATTLIST month
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+                        
+<!--                    LONG NAME: Day                             -->
+<!ELEMENT day           (#PCDATA)*                                   >
+<!ATTLIST day
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+                        
+<!--                    LONG NAME: Reviewed                        -->
+<!ELEMENT reviewed      (((%person;) | (%organization;))*, 
+                         (%revisionid;)?, (%started;)?, 
+                         (%completed;)?, (%summary;)?, (%data;)*)    >
+<!ATTLIST reviewed
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Editeded                        -->
+<!ELEMENT edited        (((%person;) | (%organization;))*, 
+                         (%revisionid;)?, (%started;)?, 
+                         (%completed;)?, (%summary;)?, (%data;)*)    >
+<!ATTLIST edited
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Tested                          -->
+<!ELEMENT tested        (((%person;) | (%organization;))*, 
+                         (%revisionid;)?, (%started;)?,
+                         (%completed;)?, (%summary;)?, (%data;)*)    >
+<!ATTLIST tested
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Approved                        -->
+<!ELEMENT approved      (((%person;) | (%organization;))*,
+                         (%revisionid;)?, (%started;)?, 
+                         (%completed;)?, (%summary;)?, (%data;)*)    >
+<!ATTLIST approved
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Book Event                      -->
+<!ELEMENT bookevent     ((%bookeventtype;)?, 
+                         ((%person;) | (%organization;))*,
+                         (%revisionid;)?, (%started;)?, 
+                         (%completed;)?, (%summary;)?, (%data;)*)    >
+<!ATTLIST bookevent 
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Book Event Type                 -->
+<!ELEMENT bookeventtype EMPTY                                        >
+<!-- Attributes are the same as on <data> except that @name is required -->
+<!ATTLIST bookeventtype 
+             %univ-atts;
+             datatype   CDATA                            #IMPLIED
+             value      CDATA                            #IMPLIED
+             href       CDATA                            #IMPLIED
+             format     CDATA                            #IMPLIED
+             type       CDATA                            #IMPLIED
+             scope      (local | peer | external)        #IMPLIED
+             outputclass
+                        CDATA                            #IMPLIED
+             name       CDATA                            #REQUIRED   >
+
+<!--                    LONG NAME: Book Part Number                -->
+<!ELEMENT bookpartno    (%words.cnt;)*                               >
+<!ATTLIST bookpartno
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Edition                         -->
+<!ELEMENT edition       (#PCDATA)*                                   >
+<!ATTLIST edition
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: ISBN Number                     -->
+<!ELEMENT isbn          (#PCDATA)*                                   >
+<!ATTLIST isbn    
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Book Number                     -->
+<!ELEMENT booknumber    (%words.cnt;)*                               >
+<!ATTLIST booknumber   
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Volume                          -->
+<!ELEMENT volume        (#PCDATA)*                                   >
+<!ATTLIST volume
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Maintainer                      -->
+<!ELEMENT maintainer    (((%person;) | (%organization;))*, (%data;)*)>
+<!ATTLIST maintainer
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Book Rights                     -->
+<!ELEMENT bookrights    ((%copyrfirst;)?, (%copyrlast;)?,
+                         (%bookowner;), (%bookrestriction;)?, 
+                         (%summary;)?)                               >
+<!ATTLIST bookrights
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: First Copyright                 -->
+<!ELEMENT copyrfirst    (%year;)                                     >
+<!ATTLIST copyrfirst
+             %data-element-atts;                                     >
+                        
+<!--                    LONG NAME: Last Copyright                  -->
+<!ELEMENT copyrlast     (%year;)                                     >
+<!ATTLIST copyrlast
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Book Owner                      -->
+<!ELEMENT bookowner     ((%person;) | (%organization;))*             >
+<!ATTLIST bookowner 
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Book Restriction                -->
+<!ELEMENT bookrestriction   EMPTY                                        >
+<!-- Same attributes as data, except for @value -->
+<!ATTLIST bookrestriction
+             %univ-atts;
+             name       CDATA                            #IMPLIED
+             datatype   CDATA                            #IMPLIED
+             href       CDATA                            #IMPLIED
+             format     CDATA                            #IMPLIED
+             type       CDATA                            #IMPLIED
+             scope      (local | peer | external)        #IMPLIED
+             outputclass
+                        CDATA                            #IMPLIED
+             value      (confidential|restricted|licensed|unclassified) #REQUIRED>
+
+<!--                    LONG NAME: Book Title                      -->
+<!ELEMENT booktitle     ((%booklibrary;)?,(%mainbooktitle;),
+                         (%booktitlealt;)*)                          >
+<!ATTLIST booktitle
+             %id-atts;
+             %localization-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+
+<!-- The following three elements are specialized from <ph>. They are
+     titles, which have a more limited content model than phrases. The
+     content model here matches title.cnt; that entity is not reused
+     in case it is expanded in the future to include something not
+     allowed in a phrase.                                          -->
+<!--                    LONG NAME: Library Title                   -->
+<!ELEMENT booklibrary   (#PCDATA | %basic.ph.noxref; | %image;)*     >  
+<!ATTLIST booklibrary              
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+                        
+<!--                    LONG NAME: Main Book Title                 -->
+<!ELEMENT mainbooktitle (#PCDATA | %basic.ph.noxref; | %image;)*     >
+<!ATTLIST mainbooktitle              
+             keyref     CDATA                           #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                           #IMPLIED     >
+                        
+<!--                    LONG NAME: Alternate Book Title            -->
+<!ELEMENT booktitlealt  (#PCDATA | %basic.ph.noxref; | %image;)*     >
+<!ATTLIST booktitlealt              
+             keyref     CDATA                           #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                           #IMPLIED     >
+
+<!--                    LONG NAME: Draft Introduction              -->
+<!ELEMENT draftintro    ((%topicmeta;)?, (%topicref;)*)              >
+<!ATTLIST draftintro
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Book Abstract                   -->
+<!ELEMENT bookabstract  EMPTY                                        >
+<!ATTLIST bookabstract
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Dedication                      -->
+<!ELEMENT dedication    EMPTY                                        >
+<!ATTLIST dedication
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Preface                         -->
+<!ELEMENT preface       ((%topicmeta;)?, (%topicref;)*)              >
+<!ATTLIST preface
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Chapter                         -->
+<!ELEMENT chapter       ((%topicmeta;)?, (%topicref;)*)              >
+<!ATTLIST chapter
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Part                            -->
+<!ELEMENT part          ((%topicmeta;)?,
+                         ((%topicref;) | (%chapter;))* )             >
+<!ATTLIST part
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Appendix                        -->
+<!ELEMENT appendix      ((%topicmeta;)?, (%topicref;)*)              >
+<!ATTLIST appendix
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Notices                         -->
+<!ELEMENT notices       ((%topicmeta;)?, (%topicref;)*)              >
+<!ATTLIST notices
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Amendments                      -->
+<!ELEMENT amendments    EMPTY                                        >
+<!ATTLIST amendments
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Colophon                        -->
+<!ELEMENT colophon      EMPTY                                        >
+<!ATTLIST colophon
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Book Lists                      -->
+<!ELEMENT booklists     ((%toc;) |
+                         (%figurelist;) |
+                         (%tablelist;) |
+                         (%abbrevlist;) |
+                         (%trademarklist;) |
+                         (%bibliolist;) |
+                         (%glossarylist;) |
+                         (%indexlist;) |
+                         (%booklist;))*                              >
+<!ATTLIST booklists
+             keyref     CDATA                             #IMPLIED
+             %topicref-atts;
+             %id-atts;
+             %select-atts;
+             %localization-atts;                                     >
+
+<!--                    LONG NAME: Table of Contents               -->
+<!ELEMENT toc           EMPTY                                        >
+<!ATTLIST toc
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Figure List                     -->
+<!ELEMENT figurelist    EMPTY                                        >
+<!ATTLIST figurelist
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Table List                      -->
+<!ELEMENT tablelist     EMPTY                                        >
+<!ATTLIST tablelist
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Abbreviation List               -->
+<!ELEMENT abbrevlist    EMPTY                                        >
+<!ATTLIST abbrevlist
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Trademark List                  -->
+<!ELEMENT trademarklist EMPTY                                        >
+<!ATTLIST trademarklist
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Bibliography List               -->
+<!ELEMENT bibliolist    EMPTY                                        >
+<!ATTLIST bibliolist
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Glossary List                   -->
+<!ELEMENT glossarylist  ((%topicmeta;)?, (%topicref;)*)              >
+<!ATTLIST glossarylist
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Index List                      -->
+<!ELEMENT indexlist     EMPTY                                        >
+<!ATTLIST indexlist
+             %chapter-atts;                                          >
+
+<!--                    LONG NAME: Book List                       -->
+<!ELEMENT booklist      EMPTY                                        >
+<!ATTLIST booklist
+             %chapter-atts;                                          >
+
+                     
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+
+<!ATTLIST bookmap     %global-atts; class CDATA "- map/map bookmap/bookmap ">
+<!ATTLIST abbrevlist  %global-atts; class CDATA "- map/topicref bookmap/abbrevlist ">
+<!ATTLIST amendments  %global-atts; class CDATA "- map/topicref bookmap/amendments ">
+<!ATTLIST appendix    %global-atts; class CDATA "- map/topicref bookmap/appendix ">
+<!ATTLIST approved    %global-atts; class CDATA "- topic/data bookmap/approved ">
+<!ATTLIST backmatter  %global-atts; class CDATA "- map/topicref bookmap/backmatter ">
+<!ATTLIST bibliolist  %global-atts; class CDATA "- map/topicref bookmap/bibliolist ">
+<!ATTLIST bookabstract %global-atts; class CDATA "- map/topicref bookmap/bookabstract ">
+<!ATTLIST bookchangehistory %global-atts; class CDATA "- topic/data bookmap/bookchangehistory ">
+<!ATTLIST bookevent   %global-atts; class CDATA "- topic/data bookmap/bookevent ">
+<!ATTLIST bookeventtype %global-atts; class CDATA "- topic/data bookmap/bookeventtype ">
+<!ATTLIST bookid      %global-atts; class CDATA "- topic/data bookmap/bookid ">
+<!ATTLIST booklibrary %global-atts;  class CDATA "- topic/ph bookmap/booklibrary ">
+<!ATTLIST booklist    %global-atts; class CDATA "- map/topicref bookmap/booklist ">
+<!ATTLIST booklists   %global-atts; class CDATA "- map/topicref bookmap/booklists ">
+<!ATTLIST bookmeta    %global-atts; class CDATA "- map/topicmeta bookmap/bookmeta ">
+<!ATTLIST booknumber  %global-atts; class CDATA "- topic/data bookmap/booknumber ">
+<!ATTLIST bookowner   %global-atts; class CDATA "- topic/data bookmap/bookowner ">
+<!ATTLIST bookpartno  %global-atts; class CDATA "- topic/data bookmap/bookpartno ">
+<!ATTLIST bookrestriction %global-atts; class CDATA "- topic/data bookmap/bookrestriction ">
+<!ATTLIST bookrights  %global-atts; class CDATA "- topic/data bookmap/bookrights ">
+<!ATTLIST booktitle   %global-atts;  class CDATA "- topic/title bookmap/booktitle ">
+<!ATTLIST booktitlealt %global-atts;  class CDATA "- topic/ph bookmap/booktitlealt ">
+<!ATTLIST chapter     %global-atts; class CDATA "- map/topicref bookmap/chapter ">
+<!ATTLIST colophon    %global-atts; class CDATA "- map/topicref bookmap/colophon ">
+<!ATTLIST completed   %global-atts; class CDATA "- topic/ph bookmap/completed ">
+<!ATTLIST copyrfirst  %global-atts; class CDATA "- topic/data bookmap/copyrfirst ">
+<!ATTLIST copyrlast   %global-atts; class CDATA "- topic/data bookmap/copyrlast ">
+<!ATTLIST day         %global-atts; class CDATA "- topic/ph bookmap/day ">
+<!ATTLIST dedication  %global-atts; class CDATA "- map/topicref bookmap/dedication ">
+<!ATTLIST draftintro  %global-atts; class CDATA "- map/topicref bookmap/draftintro ">
+<!ATTLIST edited      %global-atts; class CDATA "- topic/data bookmap/edited ">
+<!ATTLIST edition     %global-atts; class CDATA "- topic/data bookmap/edition ">
+<!ATTLIST figurelist  %global-atts; class CDATA "- map/topicref bookmap/figurelist ">
+<!ATTLIST frontmatter %global-atts; class CDATA "- map/topicref bookmap/frontmatter ">
+<!ATTLIST glossarylist %global-atts; class CDATA "- map/topicref bookmap/glossarylist ">
+<!ATTLIST indexlist   %global-atts; class CDATA "- map/topicref bookmap/indexlist ">
+<!ATTLIST isbn        %global-atts; class CDATA "- topic/data bookmap/isbn ">
+<!ATTLIST mainbooktitle %global-atts;  class CDATA "- topic/ph bookmap/mainbooktitle ">
+<!ATTLIST maintainer  %global-atts; class CDATA "- topic/data bookmap/maintainer ">
+<!ATTLIST month       %global-atts; class CDATA "- topic/ph bookmap/month ">
+<!ATTLIST notices     %global-atts; class CDATA "- map/topicref bookmap/notices ">
+<!ATTLIST organization %global-atts; class CDATA "- topic/data bookmap/organization ">
+<!ATTLIST part        %global-atts; class CDATA "- map/topicref bookmap/part ">
+<!ATTLIST person      %global-atts; class CDATA "- topic/data bookmap/person ">
+<!ATTLIST preface     %global-atts; class CDATA "- map/topicref bookmap/preface ">
+<!ATTLIST printlocation %global-atts; class CDATA "- topic/data bookmap/printlocation ">
+<!ATTLIST published   %global-atts; class CDATA "- topic/data bookmap/published ">
+<!ATTLIST publisherinformation %global-atts; class CDATA "- topic/publisher bookmap/publisherinformation ">
+<!ATTLIST publishtype %global-atts; class CDATA "- topic/data bookmap/publishtype ">
+<!ATTLIST reviewed    %global-atts; class CDATA "- topic/data bookmap/reviewed ">
+<!ATTLIST revisionid  %global-atts; class CDATA "- topic/ph bookmap/revisionid ">
+<!ATTLIST started     %global-atts; class CDATA "- topic/ph bookmap/started ">
+<!ATTLIST summary     %global-atts; class CDATA "- topic/ph bookmap/summary ">
+<!ATTLIST tablelist   %global-atts; class CDATA "- map/topicref bookmap/tablelist ">
+<!ATTLIST tested      %global-atts; class CDATA "- topic/data bookmap/tested ">
+<!ATTLIST toc         %global-atts; class CDATA "- map/topicref bookmap/toc ">
+<!ATTLIST trademarklist %global-atts; class CDATA "- map/topicref bookmap/trademarklist ">
+<!ATTLIST volume      %global-atts; class CDATA "- topic/data bookmap/volume ">
+<!ATTLIST year        %global-atts; class CDATA "- topic/ph bookmap/year ">
+
+
+
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/commonElements.ent b/xml/tests/testData/xml/OasisDocumentHighlighting/commonElements.ent
new file mode 100644
index 0000000..23e13de
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/commonElements.ent
@@ -0,0 +1,128 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Common Element Entities                      -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+PUBLIC"-//OASIS//ENTITIES DITA Common Elements//EN"
+      Delivered as file "commonElements.ent"                       -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the definitions for elements used in    -->
+<!--             both maps and topics                              -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             June 2006                                         -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT NAME ENTITIES                      -->
+<!-- ============================================================= -->
+
+<!--                    Elements in commonElements.mod             -->
+<!ENTITY % alt          "alt"                                        >
+<!ENTITY % boolean      "boolean"                                    >
+<!ENTITY % cite         "cite"                                       >
+<!ENTITY % data         "data"                                       >
+<!ENTITY % data-about   "data-about"                                 >
+<!ENTITY % dd           "dd"                                         >
+<!ENTITY % ddhd         "ddhd"                                       >
+<!ENTITY % desc         "desc"                                       >
+<!ENTITY % dl           "dl"                                         >
+<!ENTITY % dlentry      "dlentry"                                    >
+<!ENTITY % dlhead       "dlhead"                                     >
+<!ENTITY % draft-comment 
+                        "draft-comment"                              >
+<!ENTITY % dt           "dt"                                         >
+<!ENTITY % dthd         "dthd"                                       >
+<!ENTITY % fig          "fig"                                        >
+<!ENTITY % figgroup     "figgroup"                                   >
+<!ENTITY % fn           "fn"                                         >
+<!ENTITY % foreign      "foreign"                                    >
+<!ENTITY % image        "image"                                      >
+<!ENTITY % indexterm    "indexterm"                                  >
+<!ENTITY % index-base   "index-base"                                 >
+<!ENTITY % indextermref "indextermref"                               >
+<!ENTITY % itemgroup    "itemgroup"                                  >
+<!ENTITY % keyword      "keyword"                                    >
+<!ENTITY % li           "li"                                         >
+<!ENTITY % lines        "lines"                                      >
+<!ENTITY % lq           "lq"                                         >
+<!ENTITY % note         "note"                                       >
+<!ENTITY % object       "object"                                     >
+<!ENTITY % ol           "ol"                                         >
+<!ENTITY % p            "p"                                          > 
+<!ENTITY % param        "param"                                      >
+<!ENTITY % ph           "ph"                                         >
+<!ENTITY % pre          "pre"                                        >
+<!ENTITY % q            "q"                                          >
+<!ENTITY % required-cleanup     
+                        "required-cleanup"                           >
+<!ENTITY % sl           "sl"                                         > 
+<!ENTITY % sli          "sli"                                        >
+<!ENTITY % simpletable  "simpletable"                                >
+<!ENTITY % state        "state"                                      >
+<!ENTITY % stentry      "stentry"                                    >
+<!ENTITY % sthead       "sthead"                                     >
+<!ENTITY % strow        "strow"                                      >
+<!ENTITY % term         "term"                                       >
+<!ENTITY % title        "title"                                      >
+<!ENTITY % tm           "tm"                                         >
+<!ENTITY % ul           "ul"                                         >
+<!ENTITY % unknown      "unknown"                                    >
+<!ENTITY % xref         "xref"                                       >
+
+<!--                    Elements in tblDecl.mod                    -->
+<!ENTITY % table        "table"                                      >
+<!ENTITY % colspec      "colspec"                                    >
+<!ENTITY % entry        "entry"                                      >
+<!ENTITY % row          "row"                                        >
+<!ENTITY % tbody        "tbody"                                      >
+<!ENTITY % tgroup       "tgroup"                                     >
+<!ENTITY % thead        "thead"                                      >
+
+<!--                    Elements in metaDecl.mod                   -->
+<!ENTITY % audience     "audience"                                   >
+<!ENTITY % author       "author"                                     >
+<!ENTITY % brand        "brand"                                      >
+<!ENTITY % category     "category"                                   >
+<!ENTITY % component    "component"                                  >
+<!ENTITY % copyrholder  "copyrholder"                                >
+<!ENTITY % copyright    "copyright"                                  >
+<!ENTITY % copyryear    "copyryear"                                  >
+<!ENTITY % created      "created"                                    >
+<!ENTITY % critdates    "critdates"                                  >
+<!ENTITY % featnum      "featnum"                                    >
+<!ENTITY % keywords     "keywords"                                   >
+<!ENTITY % othermeta    "othermeta"                                  >
+<!ENTITY % permissions  "permissions"                                >
+<!ENTITY % platform     "platform"                                   >
+<!ENTITY % prodinfo     "prodinfo"                                   >
+<!ENTITY % prodname     "prodname"                                   >
+<!ENTITY % prognum      "prognum"                                    >
+<!ENTITY % publisher    "publisher"                                  >
+<!ENTITY % resourceid   "resourceid"                                 >
+<!ENTITY % revised      "revised"                                    >
+<!ENTITY % series       "series"                                     >
+<!ENTITY % source       "source"                                     >
+<!ENTITY % vrm          "vrm"                                        >
+<!ENTITY % vrmlist      "vrmlist"                                    >
+
+<!-- ================== End Common Element Entities ============== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/commonElements.ent.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/commonElements.ent.rnc
new file mode 100644
index 0000000..a94a749
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/commonElements.ent.rnc
@@ -0,0 +1,144 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Common Element Entities
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+# PUBLIC"-//OASIS//ENTITIES DITA Common Elements//EN"
+#       Delivered as file "commonElements.ent"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the definitions for elements used in
+
+# both maps and topics
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# June 2006
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+# Elements in commonElements.mod
+
+alt = alt.element
+boolean = boolean.element
+cite = cite.element
+data = data.element
+data-about = data-about.element
+dd = dd.element
+ddhd = ddhd.element
+desc = desc.element
+dlentry = dlentry.element
+dlhead = dlhead.element
+draft-comment = draft-comment.element
+dt = dt.element
+dthd = dthd.element
+figgroup = figgroup.element
+fn = fn.element
+foreign = foreign.element
+image = image.element
+indexterm = indexterm.element
+indextermref = indextermref.element
+itemgroup = itemgroup.element
+li = li.element
+lines = lines.element
+lq = lq.element
+note = note.element
+object = object.element
+ol = ol.element
+p = p.element
+param = param.element
+q = q.element
+required-cleanup = required-cleanup.element
+sl = sl.element
+sli = sli.element
+simpletable = simpletable.element
+state = state.element
+stentry = stentry.element
+sthead = sthead.element
+strow = strow.element
+term = term.element
+title = title.element
+tm = tm.element
+ul = ul.element
+unknown = unknown.element
+xref = xref.element
+# Elements in tblDecl.mod
+table = table.element
+colspec = colspec.element
+entry = entry.element
+row = row.element
+tbody = tbody.element
+tgroup = tgroup.element
+thead = thead.element
+# Elements in metaDecl.mod
+audience = audience.element
+author = author.element
+brand = brand.element
+category = category.element
+component = component.element
+copyrholder = copyrholder.element
+copyright = copyright.element
+copyryear = copyryear.element
+created = created.element
+critdates = critdates.element
+featnum = featnum.element
+keywords = keywords.element
+othermeta = othermeta.element
+permissions = permissions.element
+platform = platform.element
+prodinfo = prodinfo.element
+prodname = prodname.element
+prognum = prognum.element
+publisher = publisher.element
+resourceid = resourceid.element
+revised = revised.element
+series = series.element
+source = source.element
+vrm = vrm.element
+vrmlist = vrmlist.element
+# ================== End Common Element Entities ==============
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/commonElements.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/commonElements.mod
new file mode 100644
index 0000000..66ffdb0
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/commonElements.mod
@@ -0,0 +1,764 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Common Elements                              -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA Common Elements//EN"
+      Delivered as file "commonElements.mod"                       -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the elements and specialization         -->
+<!--             attributes for content elements used in both      -->
+<!--             topics and maps.                                  -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             June 2006                                         -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2006.06.06 RDA: Add data element                           -->
+<!--    2006.06.07 RDA: Add @scale to image                        -->
+<!--    2006.06.07 RDA: Add index-base element                     -->
+<!--    2006.06.07 RDA: Make universal attributes universal        -->
+<!--                      (DITA 1.1 proposal #12)                  -->
+<!--    2006.06.07 RDA: Add unknown element                        -->
+<!--    2006.06.14 RDA: Add dir attribute to localization-atts     -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT NAME ENTITIES                      -->
+<!-- ============================================================= -->
+
+<!ENTITY % commonDefns   PUBLIC 
+                       "-//OASIS//ENTITIES DITA Common Elements//EN" 
+                       "commonElements.ent"                          >
+%commonDefns;
+
+<!-- ============================================================= -->
+<!--                    COMMON ATTLIST SETS                        -->
+<!-- ============================================================= -->
+
+
+<!--                   Phrase/inline elements of various classes   -->
+<!ENTITY % basic.ph    "%ph; | %term; | %xref; | %cite; | %q; |
+                        %boolean; | %state; | %keyword; | %tm;"      >
+
+<!--                   Elements common to most body-like contexts  -->
+<!ENTITY % basic.block "%p; | %lq; | %note; | %dl; | %ul; | %ol;|  
+                        %sl; | %pre; | %lines; | %fig; | %image; | 
+                        %object; |  %table; | %simpletable;">
+
+<!-- class groupings to preserve in a schema -->
+
+<!ENTITY % basic.phandblock     "%basic.ph; | %basic.block;"         >
+
+
+<!-- Exclusions: models modified by removing excluded content      -->
+<!ENTITY % basic.ph.noxref
+                      "%ph;|%term;|              %q;|%boolean;|%state;|%keyword;|%tm;">
+<!ENTITY % basic.ph.notm
+                      "%ph;|%term;|%xref;|%cite;|%q;|%boolean;|%state;|%keyword;     ">
+
+
+<!ENTITY % basic.block.notbl
+                      "%p;|%lq;|%note;|%dl;|%ul;|%ol;|%sl;|%pre;|%lines;|%fig;|%image;|%object;">
+<!ENTITY % basic.block.nonote
+                      "%p;|%lq;|       %dl;|%ul;|%ol;|%sl;|%pre;|%lines;|%fig;|%image;|%object;|%table;|%simpletable;">
+<!ENTITY % basic.block.nopara
+                      "    %lq;|%note;|%dl;|%ul;|%ol;|%sl;|%pre;|%lines;|%fig;|%image;|%object;|%table;|%simpletable;">
+<!ENTITY % basic.block.nolq
+                      "%p;|     %note;|%dl;|%ul;|%ol;|%sl;|%pre;|%lines;|%fig;|%image;|%object;|%table;|%simpletable;">
+<!ENTITY % basic.block.notbnofg
+                      "%p;|%lq;|%note;|%dl;|%ul;|%ol;|%sl;|%pre;|%lines;|      %image;|%object;">
+<!ENTITY % basic.block.notbfgobj
+                      "%p;|%lq;|%note;|%dl;|%ul;|%ol;|%sl;|%pre;|%lines;|      %image;">
+
+
+<!-- Inclusions: defined sets that can be added into appropriate models -->
+<!ENTITY % txt.incl             '%draft-comment;|%required-cleanup;|%fn;|%indextermref;|%indexterm;'>
+
+<!-- Metadata elements intended for specialization -->
+<!ENTITY % data.elements.incl   "%data;|%data-about;"                >
+<!ENTITY % foreign.unknown.incl "%foreign;|%unknown;"                >
+
+<!-- Predefined content model groups, based on the previous, element-only categories: -->
+<!-- txt.incl is appropriate for any mixed content definitions (those that have PCDATA) -->
+<!-- the context for blocks is implicitly an InfoMaster "containing_division" -->
+<!ENTITY % listitem.cnt         "#PCDATA | %basic.ph; | %basic.block; |%itemgroup;| %txt.incl; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % itemgroup.cnt        "#PCDATA | %basic.ph; | %basic.block; |             %txt.incl; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % title.cnt            "#PCDATA | %basic.ph.noxref; | %image; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % xreftext.cnt         "#PCDATA | %basic.ph.noxref; | %image; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % xrefph.cnt           "#PCDATA | %basic.ph.noxref; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % shortquote.cnt       "#PCDATA | %basic.ph; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % para.cnt             "#PCDATA | %basic.ph; | %basic.block.nopara; | %txt.incl; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % note.cnt             "#PCDATA | %basic.ph; | %basic.block.nonote; | %txt.incl; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % longquote.cnt        "#PCDATA | %basic.ph; | %basic.block.nolq;   | %txt.incl; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % tblcell.cnt          "#PCDATA | %basic.ph; | %basic.block.notbl;  | %txt.incl; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % desc.cnt             "#PCDATA | %basic.ph; | %basic.block.notbfgobj; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % ph.cnt               "#PCDATA | %basic.ph; | %image;              | %txt.incl; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % fn.cnt               "#PCDATA | %basic.ph; | %basic.block.notbl; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % term.cnt             "#PCDATA | %basic.ph; | %image; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % defn.cnt             "#PCDATA | %basic.ph; | %basic.block; |%itemgroup;| %txt.incl; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % pre.cnt              "#PCDATA | %basic.ph; | %txt.incl; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % fig.cnt              "%basic.block.notbnofg; | %simpletable; | %xref; | %fn;| %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % words.cnt            "#PCDATA | %keyword; | %term; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % data.cnt             "%words.cnt;|%image;|%object;|%ph;|%title;">
+
+<!-- ============================================================= -->
+<!--                    COMMON ATTLIST SETS                        -->
+<!-- ============================================================= -->
+
+<!-- Copied into metaDecl.mod -->
+<!--<!ENTITY % date-format 'CDATA'                                       >-->
+
+<!ENTITY % display-atts  
+            'scale     (50|60|70|80|90|100|110|120|140|160|
+                        180|200)                           #IMPLIED
+             frame     (top | bottom |topbot | all | 
+                        sides | none)                      #IMPLIED
+             expanse   (page | column | textline)          #IMPLIED' >
+
+<!-- Provide a default of no attribute extensions -->
+<!ENTITY % props-attribute-extensions " ">
+<!ENTITY % base-attribute-extensions  " ">
+
+<!ENTITY % filter-atts
+            'props      CDATA                              #IMPLIED
+             base       CDATA                              #IMPLIED
+             platform   CDATA                              #IMPLIED
+             product    CDATA                              #IMPLIED
+             audience   CDATA                              #IMPLIED
+             otherprops CDATA                              #IMPLIED
+             %props-attribute-extensions;
+             %base-attribute-extensions;                           ' >
+
+<!ENTITY % select-atts   
+            '%filter-atts;
+             importance 
+                       (obsolete | deprecated | optional | 
+                        default | low | normal | high | 
+                        recommended | required | urgent )  #IMPLIED
+             rev        CDATA                              #IMPLIED
+             status    (new | changed | deleted | 
+                        unchanged)                         #IMPLIED' >
+
+<!ENTITY % id-atts  
+            'id         NMTOKEN                            #IMPLIED
+             conref     CDATA                              #IMPLIED' >
+
+<!-- Attributes related to localization that are used everywhere   -->
+<!ENTITY % localization-atts  
+            'translate (yes | no)                          #IMPLIED
+             xml:lang   NMTOKEN                            #IMPLIED
+             dir       (ltr | rtl | lro | rlo)             #IMPLIED' >
+<!-- The following entity should be used when defaulting a new
+     element to translate="no", so that other (or new) localization
+     attributes will always be included.   -->
+<!ENTITY % localization-atts-translate-no  
+            'translate (yes | no)                          "no"
+             xml:lang   NMTOKEN                            #IMPLIED
+             dir       (ltr | rtl | lro | rlo)             #IMPLIED' >
+             
+<!ENTITY % univ-atts     
+            '%id-atts;
+             %select-atts;
+             %localization-atts;' >
+<!ENTITY % univ-atts-translate-no     
+            '%id-atts;
+             %select-atts;
+             %localization-atts-translate-no;' >
+
+<!ENTITY % global-atts    
+            'xtrc       CDATA                              #IMPLIED
+             xtrf       CDATA                              #IMPLIED'>
+             
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+
+<!--                    LONG NAME: Data About                      -->
+<!ELEMENT data-about  ((%data;), (%data;|%data-about;)*)>
+<!ATTLIST data-about  %univ-atts;
+             href       CDATA                            #IMPLIED
+             format     CDATA                            #IMPLIED
+             type       CDATA                            #IMPLIED
+             scope      (local | peer | external)        #IMPLIED
+             outputclass
+                        CDATA                            #IMPLIED    >
+
+<!ENTITY % data-element-atts
+            '%univ-atts;
+             name       CDATA                            #IMPLIED
+             datatype   CDATA                            #IMPLIED
+             value      CDATA                            #IMPLIED
+             href       CDATA                            #IMPLIED
+             format     CDATA                            #IMPLIED
+             type       CDATA                            #IMPLIED
+             scope      (local | peer | external)        #IMPLIED
+             outputclass
+                        CDATA                            #IMPLIED'   >
+             
+<!--                    LONG NAME: Data element                    -->
+<!ELEMENT data    (%data.cnt;)*>
+<!ATTLIST data    %data-element-atts;                                >
+
+<!--                    LONG NAME: Unknown element                 -->
+<!ELEMENT unknown ANY>
+<!ATTLIST unknown
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+                        
+<!--                    LONG NAME: Foreign content element         -->
+<!ELEMENT foreign ANY>
+<!ATTLIST foreign
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Title                           -->
+<!--                    This is referenced inside CALS table       -->
+<!ELEMENT title         (%title.cnt;)*                               > 
+<!ATTLIST title         
+             %id-atts;
+             %localization-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Short Description               -->
+<!ELEMENT shortdesc     (%title.cnt;)*                               >
+<!ATTLIST shortdesc    
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Description                     -->
+<!--                    Desc is used in context with figure and 
+                        table titles and also for content models 
+                        within linkgroup and object (for 
+                        accessibility)                             -->
+<!ELEMENT desc          (%desc.cnt;)*                                >
+<!ATTLIST desc           
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!-- ============================================================= -->
+<!--                    BASIC DOCUMENT ELEMENT DECLARATIONS        -->
+<!--                    (rich text)                                -->
+<!-- ============================================================= -->
+
+<!--                    LONG NAME: Paragraph                       -->
+<!ELEMENT p             (%para.cnt;)*                                >
+<!ATTLIST p              
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Note                            -->
+<!ELEMENT note          (%note.cnt;)*                                >
+<!ATTLIST note            
+             type       (note | tip | fastpath | restriction |
+                         important | remember| attention|
+                         caution | danger| other)        #IMPLIED             
+             spectitle  CDATA                            #IMPLIED
+             othertype  CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Long Quote (Excerpt)            -->
+<!ELEMENT lq            (%longquote.cnt;)*                           >
+<!ATTLIST lq              
+             href       CDATA                           #IMPLIED
+             keyref     CDATA                           #IMPLIED
+             type       (external | internal | 
+                         bibliographic)                 #IMPLIED
+             reftitle   CDATA                           #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Quoted text                     -->
+<!ELEMENT q             (%shortquote.cnt;)*                          >
+<!ATTLIST q              
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Simple List                     -->
+<!ELEMENT sl            (%sli;)+                                     >
+<!ATTLIST sl            
+             compact    (yes | no)                       #IMPLIED
+             spectitle  CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Simple List Item                -->
+<!ELEMENT sli           (%ph.cnt;)*                                  >
+<!ATTLIST sli             
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Unordered List                  -->
+<!ELEMENT ul            (%li;)+                                      >
+<!ATTLIST ul            
+             compact    (yes | no)                       #IMPLIED
+             spectitle  CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Ordered List                    -->
+<!ELEMENT ol            (%li;)+                                      >
+<!ATTLIST ol              
+             compact    (yes | no)                       #IMPLIED
+             spectitle  CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: List Item                       -->
+<!ELEMENT li            (%listitem.cnt;)*                            >
+<!ATTLIST li             
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Item Group                      -->
+<!ELEMENT itemgroup     (%itemgroup.cnt;)*                           >
+<!ATTLIST itemgroup       
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Definition List                 -->
+<!ELEMENT dl            ((%dlhead;)?, (%dlentry;)+)                  >
+<!ATTLIST dl              
+             compact    (yes | no)                       #IMPLIED
+             spectitle  CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Definition List Head            -->
+<!ELEMENT dlhead        ((%dthd;)?, (%ddhd;)? )                      >
+<!ATTLIST dlhead        
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Term Header                     -->
+<!ELEMENT dthd          (%title.cnt;)*                               >
+<!ATTLIST dthd           
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Definition Header               -->
+<!ELEMENT ddhd          (%title.cnt;)*                               >
+<!ATTLIST ddhd           
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Definition List Entry           -->
+<!ELEMENT dlentry       ((%dt;)+, (%dd;)+ )                          >
+<!ATTLIST dlentry       
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+
+<!--                    LONG NAME: Definition Term                 -->  
+<!ELEMENT dt            (%term.cnt;)*                                >
+<!ATTLIST dt            
+             keyref     CDATA                           #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Definition Description          -->
+<!ELEMENT dd            (%defn.cnt;)*                                >
+<!ATTLIST dd           
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Figure                          -->
+<!ELEMENT fig           ((%title;)?, (%desc;)?, 
+                         (%figgroup; | %fig.cnt;)* )                 >
+<!ATTLIST fig          
+             %display-atts;
+             spectitle  CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Figure Group                    -->
+<!ELEMENT figgroup      ((%title;)?, 
+                         (%figgroup; | %xref; | %fn; | %ph; | 
+                          %keyword;)* )                              >
+<!ATTLIST figgroup     
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Preformatted Text               -->
+<!ELEMENT pre           (%pre.cnt;)*                                 >                                
+<!ATTLIST pre          
+             %display-atts;
+             spectitle  CDATA                            #IMPLIED
+             xml:space  (preserve)               #FIXED 'preserve'
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Line Respecting Text            -->
+<!ELEMENT lines         (%pre.cnt;)*                                 >
+<!ATTLIST lines           
+             %display-atts;
+             spectitle  CDATA                            #IMPLIED
+             xml:space  (preserve)               #FIXED 'preserve'
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!-- ============================================================= -->
+<!--                   BASE FORM PHRASE TYPES                      -->
+<!-- ============================================================= -->
+
+<!--                    LONG NAME: Keyword                         -->
+<!ELEMENT keyword       (#PCDATA | %tm;)*                            >
+<!ATTLIST keyword       
+             keyref     CDATA                           #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                           #IMPLIED     >
+
+
+<!--                    LONG NAME: Term                            -->
+<!ELEMENT term          (#PCDATA | %tm;)*                            >
+<!ATTLIST term          
+             keyref     CDATA                           #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Phrase                          -->
+<!ELEMENT ph            (%ph.cnt;)*                                  >  
+<!ATTLIST ph              
+             keyref     CDATA                           #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Trade Mark                      -->
+<!ELEMENT tm            (#PCDATA | %tm;)*                            >
+<!ATTLIST tm
+             %univ-atts;
+             trademark  CDATA                           #IMPLIED
+             tmowner    CDATA                           #IMPLIED
+             tmtype     (tm | reg | service)            #REQUIRED
+             tmclass    CDATA                           #IMPLIED     >
+
+
+<!--                    LONG NAME: Boolean  (deprecated)           -->
+<!ELEMENT boolean       EMPTY                                        >
+<!ATTLIST boolean           
+             state      (yes | no)                      #REQUIRED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: State                           -->
+<!--                    A state can have a name and a string value, 
+                        even if empty or indeterminate             -->
+<!ELEMENT state         EMPTY                                        >
+<!ATTLIST state          
+             name       CDATA                            #REQUIRED
+             value      CDATA                            #REQUIRED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Image Data                      -->
+<!ELEMENT image         (%alt;)?                                     >
+<!ATTLIST image           
+             href       CDATA                            #REQUIRED
+             keyref     NMTOKEN                          #IMPLIED
+             alt        CDATA                            #IMPLIED
+             longdescref 
+                        CDATA                            #IMPLIED
+             height     NMTOKEN                          #IMPLIED
+             width      NMTOKEN                          #IMPLIED
+             align      CDATA                            #IMPLIED
+             scale      NMTOKEN                          #IMPLIED
+             placement  (inline|break)                   "inline"
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Alternate text                  -->
+<!ELEMENT alt            (%words.cnt;)*>
+<!ATTLIST alt             %univ-atts;
+                          outputclass CDATA #IMPLIED
+>
+
+<!--                    LONG NAME: Object (Streaming/Executable 
+                                   Data)                           -->
+<!ELEMENT object        ((%desc;)?, (%param;)*, 
+                         (%foreign.unknown.incl;)*)                  >
+<!ATTLIST object
+             declare    (declare)                        #IMPLIED
+             classid    CDATA                            #IMPLIED
+             codebase   CDATA                            #IMPLIED
+             data       CDATA                            #IMPLIED
+             type       CDATA                            #IMPLIED
+             codetype   CDATA                            #IMPLIED
+             archive    CDATA                            #IMPLIED
+             standby    CDATA                            #IMPLIED
+             height     NMTOKEN                          #IMPLIED
+             width      NMTOKEN                          #IMPLIED
+             usemap     CDATA                            #IMPLIED
+             name       CDATA                            #IMPLIED
+             tabindex   NMTOKEN                          #IMPLIED
+             longdescre CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Parameter                       -->
+<!ELEMENT param         EMPTY>
+<!ATTLIST param
+             %univ-atts;
+             name       CDATA                            #REQUIRED
+             value      CDATA                            #IMPLIED
+             valuetype  (data|ref|object)                #IMPLIED
+             type       CDATA                            #IMPLIED    >  
+
+
+<!--                    LONG NAME: Simple Table                    -->
+<!ELEMENT simpletable   ((%sthead;)?, (%strow;)+)                    >
+<!ATTLIST simpletable     
+             relcolwidth 
+                        CDATA                            #IMPLIED
+             keycol     NMTOKEN                          #IMPLIED
+             refcols    NMTOKENS                         #IMPLIED
+             %display-atts;
+             spectitle  CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Simple Table Head               -->
+<!ELEMENT sthead        (%stentry;)+                                 >
+<!ATTLIST sthead     
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Simple Table Row                -->
+<!ELEMENT strow         (%stentry;)*                                 >
+<!ATTLIST strow        
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Simple Table Cell (entry)       -->
+<!ELEMENT stentry       (%tblcell.cnt;)*                             >
+<!ATTLIST stentry 
+             specentry  CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Review Comments Block           -->
+<!ELEMENT draft-comment (#PCDATA | %basic.phandblock; | 
+                         %data.elements.incl; | 
+                         %foreign.unknown.incl;)*                    >
+<!ATTLIST draft-comment   
+             author     CDATA                            #IMPLIED
+             time       CDATA                            #IMPLIED
+             disposition  
+                        (issue | open | accepted | rejected |
+                         deferred| duplicate | reopened|
+                         unassigned | completed)         #IMPLIED
+             %univ-atts-translate-no;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Required Cleanup Block          -->
+<!ELEMENT required-cleanup 
+                        ANY                                          >
+<!ATTLIST required-cleanup 
+             remap      CDATA                            #IMPLIED
+             %univ-atts-translate-no;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Footnote                        -->
+<!ELEMENT fn            (%fn.cnt;)*                                  >
+<!ATTLIST fn              
+             callout    CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Index Term                      -->
+<!ELEMENT indexterm     (%words.cnt;|%indexterm;|%index-base;)*      >
+<!ATTLIST indexterm
+             keyref     CDATA                             #IMPLIED
+             start      CDATA                             #IMPLIED
+             end        CDATA                             #IMPLIED
+             %univ-atts;                                             >
+
+<!--                    LONG NAME: Index Base                      -->
+<!ELEMENT index-base    (%words.cnt;|%indexterm;)*                   >
+<!ATTLIST index-base
+             keyref     CDATA                             #IMPLIED
+             %univ-atts;                                             >
+
+<!--                    LONG NAME: Index term reference            -->
+<!ELEMENT indextermref   EMPTY>
+<!ATTLIST indextermref    keyref CDATA #REQUIRED
+                          %univ-atts;
+>
+
+<!--                    LONG NAME: Citation (bibliographic source) -->
+<!ELEMENT cite          (%xrefph.cnt;)*                              >
+<!ATTLIST cite            
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Cross Reference/Link            -->
+<!ELEMENT xref          (%xreftext.cnt; | %desc;)*                   >
+<!ATTLIST xref            
+             href       CDATA                            #IMPLIED
+             keyref     CDATA                            #IMPLIED
+             type       CDATA                            #IMPLIED
+             %univ-atts;
+             format     CDATA                            #IMPLIED
+             scope      (local | peer | external)        #IMPLIED
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!ENTITY % tableXML       PUBLIC  
+"-//OASIS//ELEMENTS DITA Exchange Table Model//EN" 
+"tblDecl.mod"                                                        >
+%tableXML;
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+             
+<!ATTLIST alt       %global-atts;  class CDATA "- topic/alt "        >
+<!ATTLIST boolean   %global-atts;  class CDATA "- topic/boolean "    >
+<!ATTLIST cite      %global-atts;  class CDATA "- topic/cite "       >
+<!ATTLIST dd        %global-atts;  class CDATA "- topic/dd "         >
+<!ATTLIST data      %global-atts;  class CDATA "- topic/data "       >
+<!ATTLIST data-about
+                    %global-atts;  class CDATA "- topic/data-about ">
+<!ATTLIST ddhd      %global-atts;  class CDATA "- topic/ddhd "       >
+<!ATTLIST desc      %global-atts;  class CDATA "- topic/desc "       >
+<!ATTLIST dl        %global-atts;  class CDATA "- topic/dl "         >
+<!ATTLIST dlentry   %global-atts;  class CDATA "- topic/dlentry "    >
+<!ATTLIST dlhead    %global-atts;  class CDATA "- topic/dlhead "     >
+<!ATTLIST draft-comment 
+                    %global-atts;  class CDATA "- topic/draft-comment ">
+<!ATTLIST dt        %global-atts;  class CDATA "- topic/dt "         >
+<!ATTLIST dthd      %global-atts;  class CDATA "- topic/dthd "       >
+<!ATTLIST fig       %global-atts;  class CDATA "- topic/fig "        >
+<!ATTLIST figgroup  %global-atts;  class CDATA "- topic/figgroup "   >
+<!ATTLIST fn        %global-atts;  class CDATA "- topic/fn "         >
+<!ATTLIST foreign   %global-atts;  class CDATA "- topic/foreign "    >
+<!ATTLIST image     %global-atts;  class CDATA "- topic/image "      >
+<!ATTLIST indexterm %global-atts;  class CDATA "- topic/indexterm "  >
+<!ATTLIST index-base %global-atts;  class CDATA "- topic/index-base ">
+<!ATTLIST indextermref 
+                    %global-atts;  class CDATA "- topic/indextermref ">
+<!ATTLIST itemgroup %global-atts;  class CDATA "- topic/itemgroup "  >
+<!ATTLIST keyword   %global-atts;  class CDATA "- topic/keyword "    >
+<!ATTLIST li        %global-atts;  class CDATA "- topic/li "         >
+<!ATTLIST lines     %global-atts;  class CDATA "- topic/lines "      >
+<!ATTLIST lq        %global-atts;  class CDATA "- topic/lq "         >
+<!ATTLIST note      %global-atts;  class CDATA "- topic/note "       >
+<!ATTLIST object    %global-atts;  class CDATA "- topic/object "     >
+<!ATTLIST ol        %global-atts;  class CDATA "- topic/ol "         >
+<!ATTLIST p         %global-atts;  class CDATA "- topic/p "          >
+<!ATTLIST param     %global-atts;  class CDATA "- topic/param "      >
+<!ATTLIST ph        %global-atts;  class CDATA "- topic/ph "         >
+<!ATTLIST pre       %global-atts;  class CDATA "- topic/pre "        >
+<!ATTLIST q         %global-atts;  class CDATA "- topic/q "          >
+<!ATTLIST required-cleanup 
+                    %global-atts;  class CDATA "- topic/required-cleanup ">
+<!ATTLIST simpletable 
+                    %global-atts;  class CDATA "- topic/simpletable ">
+<!ATTLIST sl        %global-atts;  class CDATA "- topic/sl "         >
+<!ATTLIST sli       %global-atts;  class CDATA "- topic/sli "        >
+<!ATTLIST state     %global-atts;  class CDATA "- topic/state "      >
+<!ATTLIST stentry   %global-atts;  class CDATA "- topic/stentry "    >
+<!ATTLIST sthead    %global-atts;  class CDATA "- topic/sthead "     >
+<!ATTLIST strow     %global-atts;  class CDATA "- topic/strow "      >
+<!ATTLIST term      %global-atts;  class CDATA "- topic/term "       >
+<!ATTLIST title     %global-atts;  class CDATA "- topic/title "      >
+<!ATTLIST tm        %global-atts;  class CDATA "- topic/tm "         >
+<!ATTLIST ul        %global-atts;  class CDATA "- topic/ul "         >
+<!ATTLIST unknown   %global-atts;  class CDATA "- topic/unknown "    >
+<!ATTLIST xref      %global-atts;  class CDATA "- topic/xref "       >
+
+
+<!-- ================== End Common Elements Module  ============== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/commonElements.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/commonElements.mod.rnc
new file mode 100644
index 0000000..16fb9fa
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/commonElements.mod.rnc
@@ -0,0 +1,920 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Common Elements
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA Common Elements//EN"
+#       Delivered as file "commonElements.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the elements and specialization
+
+# attributes for content elements used in both
+
+# topics and maps.
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# June 2006
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2006.06.06 RDA: Add data element
+
+# 2006.06.07 RDA: Add @scale to image
+
+# 2006.06.07 RDA: Add index-base element
+
+# 2006.06.07 RDA: Make universal attributes universal
+
+# (DITA 1.1 proposal #12)
+
+# 2006.06.07 RDA: Add unknown element
+
+# 2006.06.14 RDA: Add dir attribute to localization-atts
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+# =============================================================
+
+# COMMON ATTLIST SETS
+
+# =============================================================
+
+# Phrase/inline elements of various classes
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+basic.ph = ph | term | xref | cite | q | boolean | state | keyword | tm
+# Elements common to most body-like contexts
+basic.block =
+  p
+  | lq
+  | note
+  | dl
+  | ul
+  | ol
+  | sl
+  | pre
+  | lines
+  | fig
+  | image
+  | object
+  | table
+  | simpletable
+# class groupings to preserve in a schema
+basic.phandblock = basic.ph | basic.block
+# Exclusions: models modified by removing excluded content
+basic.ph.noxref = ph | term | q | boolean | state | keyword | tm
+basic.ph.notm = ph | term | xref | cite | q | boolean | state | keyword
+basic.block.notbl =
+  p | lq | note | dl | ul | ol | sl | pre | lines | fig | image | object
+basic.block.nonote =
+  p
+  | lq
+  | dl
+  | ul
+  | ol
+  | sl
+  | pre
+  | lines
+  | fig
+  | image
+  | object
+  | table
+  | simpletable
+basic.block.nopara =
+  lq
+  | note
+  | dl
+  | ul
+  | ol
+  | sl
+  | pre
+  | lines
+  | fig
+  | image
+  | object
+  | table
+  | simpletable
+basic.block.nolq =
+  p
+  | note
+  | dl
+  | ul
+  | ol
+  | sl
+  | pre
+  | lines
+  | fig
+  | image
+  | object
+  | table
+  | simpletable
+basic.block.notbnofg =
+  p | lq | note | dl | ul | ol | sl | pre | lines | image | object
+basic.block.notbfgobj =
+  p | lq | note | dl | ul | ol | sl | pre | lines | image
+# Inclusions: defined sets that can be added into appropriate models
+txt.incl =
+  draft-comment | required-cleanup | fn | indextermref | indexterm
+# Metadata elements intended for specialization
+data.elements.incl = data | data-about
+foreign.unknown.incl = foreign | unknown
+# Predefined content model groups, based on the previous, element-only categories:
+
+# txt.incl is appropriate for any mixed content definitions (those that have PCDATA)
+
+# the context for blocks is implicitly an InfoMaster "containing_division"
+listitem.cnt =
+  text
+  | basic.ph
+  | basic.block
+  | itemgroup
+  | txt.incl
+  | data.elements.incl
+  | foreign.unknown.incl
+itemgroup.cnt =
+  text
+  | basic.ph
+  | basic.block
+  | txt.incl
+  | data.elements.incl
+  | foreign.unknown.incl
+title.cnt =
+  text
+  | basic.ph.noxref
+  | image
+  | data.elements.incl
+  | foreign.unknown.incl
+xreftext.cnt =
+  text
+  | basic.ph.noxref
+  | image
+  | data.elements.incl
+  | foreign.unknown.incl
+xrefph.cnt =
+  text | basic.ph.noxref | data.elements.incl | foreign.unknown.incl
+shortquote.cnt =
+  text | basic.ph | data.elements.incl | foreign.unknown.incl
+para.cnt =
+  text
+  | basic.ph
+  | basic.block.nopara
+  | txt.incl
+  | data.elements.incl
+  | foreign.unknown.incl
+note.cnt =
+  text
+  | basic.ph
+  | basic.block.nonote
+  | txt.incl
+  | data.elements.incl
+  | foreign.unknown.incl
+longquote.cnt =
+  text
+  | basic.ph
+  | basic.block.nolq
+  | txt.incl
+  | data.elements.incl
+  | foreign.unknown.incl
+tblcell.cnt =
+  text
+  | basic.ph
+  | basic.block.notbl
+  | txt.incl
+  | data.elements.incl
+  | foreign.unknown.incl
+desc.cnt =
+  text
+  | basic.ph
+  | basic.block.notbfgobj
+  | data.elements.incl
+  | foreign.unknown.incl
+ph.cnt =
+  text
+  | basic.ph
+  | image
+  | txt.incl
+  | data.elements.incl
+  | foreign.unknown.incl
+fn.cnt =
+  text
+  | basic.ph
+  | basic.block.notbl
+  | data.elements.incl
+  | foreign.unknown.incl
+term.cnt =
+  text | basic.ph | image | data.elements.incl | foreign.unknown.incl
+defn.cnt =
+  text
+  | basic.ph
+  | basic.block
+  | itemgroup
+  | txt.incl
+  | data.elements.incl
+  | foreign.unknown.incl
+pre.cnt =
+  text | basic.ph | txt.incl | data.elements.incl | foreign.unknown.incl
+fig.cnt =
+  basic.block.notbnofg
+  | simpletable
+  | xref
+  | fn
+  | data.elements.incl
+  | foreign.unknown.incl
+words.cnt =
+  text | keyword | term | data.elements.incl | foreign.unknown.incl
+data.cnt = words.cnt | image | object | ph | title
+# =============================================================
+
+# COMMON ATTLIST SETS
+
+# =============================================================
+
+# Copied into metaDecl.mod
+
+# <!ENTITY % date-format 'CDATA'                                       >
+display-atts =
+  attribute scale {
+    "50"
+    | "60"
+    | "70"
+    | "80"
+    | "90"
+    | "100"
+    | "110"
+    | "120"
+    | "140"
+    | "160"
+    | "180"
+    | "200"
+  }?,
+  attribute frame {
+    "top" | "bottom" | "topbot" | "all" | "sides" | "none"
+  }?,
+  attribute expanse { "page" | "column" | "textline" }?
+# Provide a default of no attribute extensions
+filter-atts =
+  attribute props { text }?,
+  attribute base { text }?,
+  attribute platform { text }?,
+  attribute product { text }?,
+  attribute audience { text }?,
+  attribute otherprops { text }?,
+  props-attribute-extensions,
+  base-attribute-extensions
+select-atts =
+  filter-atts,
+  attribute importance {
+    "obsolete"
+    | "deprecated"
+    | "optional"
+    | "default"
+    | "low"
+    | "normal"
+    | "high"
+    | "recommended"
+    | "required"
+    | "urgent"
+  }?,
+  attribute rev { text }?,
+  attribute status { "new" | "changed" | "deleted" | "unchanged" }?
+id-atts =
+  attribute id { xsd:NMTOKEN }?,
+  attribute conref { text }?
+# Attributes related to localization that are used everywhere
+localization-atts =
+  attribute translate { "yes" | "no" }?,
+  attribute xml:lang { xsd:NMTOKEN }?,
+  attribute dir { "ltr" | "rtl" | "lro" | "rlo" }?
+# The following entity should be used when defaulting a new
+# element to translate="no", so that other (or new) localization
+# attributes will always be included.
+localization-atts-translate-no =
+  [ a:defaultValue = "no" ] attribute translate { "yes" | "no" }?,
+  attribute xml:lang { xsd:NMTOKEN }?,
+  attribute dir { "ltr" | "rtl" | "lro" | "rlo" }?
+univ-atts = id-atts, select-atts, localization-atts
+univ-atts-translate-no =
+  id-atts, select-atts, localization-atts-translate-no
+global-atts =
+  attribute xtrc { text }?,
+  attribute xtrf { text }?
+# =============================================================
+
+# ELEMENT DECLARATIONS
+
+# =============================================================
+
+# LONG NAME: Data About
+data-about.element =
+  element data-about { data-about.attlist, data, (data | data-about)* }
+data-about.attlist &=
+  univ-atts,
+  attribute href { text }?,
+  attribute format { text }?,
+  attribute type { text }?,
+  attribute scope { "local" | "peer" | "external" }?,
+  attribute outputclass { text }?
+data-element-atts =
+  univ-atts,
+  attribute name { text }?,
+  attribute datatype { text }?,
+  attribute value { text }?,
+  attribute href { text }?,
+  attribute format { text }?,
+  attribute type { text }?,
+  attribute scope { "local" | "peer" | "external" }?,
+  attribute outputclass { text }?
+# LONG NAME: Data element
+data.element = element data { data.attlist, data.cnt* }
+data.attlist &= data-element-atts
+# LONG NAME: Unknown element
+unknown.element = element unknown { unknown.attlist, any }
+unknown.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Foreign content element
+foreign.element = element foreign { foreign.attlist, any }
+foreign.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Title
+
+# This is referenced inside CALS table
+title.element = element title { title.attlist, title.cnt* }
+title.attlist &=
+  id-atts,
+  localization-atts,
+  attribute outputclass { text }?
+# LONG NAME: Short Description
+shortdesc.element = element shortdesc { shortdesc.attlist, title.cnt* }
+shortdesc.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Description
+
+# Desc is used in context with figure and 
+# table titles and also for content models 
+# within linkgroup and object (for 
+# accessibility)
+desc.element = element desc { desc.attlist, desc.cnt* }
+desc.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# =============================================================
+
+# BASIC DOCUMENT ELEMENT DECLARATIONS
+
+# (rich text)
+
+# =============================================================
+
+# LONG NAME: Paragraph
+p.element = element p { p.attlist, para.cnt* }
+p.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Note
+note.element = element note { note.attlist, note.cnt* }
+note.attlist &=
+  attribute type {
+    "note"
+    | "tip"
+    | "fastpath"
+    | "restriction"
+    | "important"
+    | "remember"
+    | "attention"
+    | "caution"
+    | "danger"
+    | "other"
+  }?,
+  attribute spectitle { text }?,
+  attribute othertype { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Long Quote (Excerpt)
+lq.element = element lq { lq.attlist, longquote.cnt* }
+lq.attlist &=
+  attribute href { text }?,
+  attribute keyref { text }?,
+  attribute type { "external" | "internal" | "bibliographic" }?,
+  attribute reftitle { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Quoted text
+q.element = element q { q.attlist, shortquote.cnt* }
+q.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Simple List
+sl.element = element sl { sl.attlist, sli+ }
+sl.attlist &=
+  attribute compact { "yes" | "no" }?,
+  attribute spectitle { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Simple List Item
+sli.element = element sli { sli.attlist, ph.cnt* }
+sli.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Unordered List
+ul.element = element ul { ul.attlist, li+ }
+ul.attlist &=
+  attribute compact { "yes" | "no" }?,
+  attribute spectitle { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Ordered List
+ol.element = element ol { ol.attlist, li+ }
+ol.attlist &=
+  attribute compact { "yes" | "no" }?,
+  attribute spectitle { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: List Item
+li.element = element li { li.attlist, listitem.cnt* }
+li.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Item Group
+itemgroup.element =
+  element itemgroup { itemgroup.attlist, itemgroup.cnt* }
+itemgroup.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Definition List
+dl.element = element dl { dl.attlist, dlhead?, dlentry+ }
+dl.attlist &=
+  attribute compact { "yes" | "no" }?,
+  attribute spectitle { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Definition List Head
+dlhead.element = element dlhead { dlhead.attlist, dthd?, ddhd? }
+dlhead.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Term Header
+dthd.element = element dthd { dthd.attlist, title.cnt* }
+dthd.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Definition Header
+ddhd.element = element ddhd { ddhd.attlist, title.cnt* }
+ddhd.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Definition List Entry
+dlentry.element = element dlentry { dlentry.attlist, dt+, dd+ }
+dlentry.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Definition Term
+dt.element = element dt { dt.attlist, term.cnt* }
+dt.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Definition Description
+dd.element = element dd { dd.attlist, defn.cnt* }
+dd.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Figure
+fig.element =
+  element fig { fig.attlist, title?, desc?, (figgroup | fig.cnt)* }
+fig.attlist &=
+  display-atts,
+  attribute spectitle { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Figure Group
+figgroup.element =
+  element figgroup {
+    figgroup.attlist, title?, (figgroup | xref | fn | ph | keyword)*
+  }
+figgroup.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Preformatted Text
+pre.element = element pre { pre.attlist, pre.cnt* }
+pre.attlist &=
+  display-atts,
+  attribute spectitle { text }?,
+  [ a:defaultValue = "preserve" ] attribute xml:space { "preserve" }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Line Respecting Text
+lines.element = element lines { lines.attlist, pre.cnt* }
+lines.attlist &=
+  display-atts,
+  attribute spectitle { text }?,
+  [ a:defaultValue = "preserve" ] attribute xml:space { "preserve" }?,
+  univ-atts,
+  attribute outputclass { text }?
+# =============================================================
+
+# BASE FORM PHRASE TYPES
+
+# =============================================================
+
+# LONG NAME: Keyword
+keyword.element = element keyword { keyword.attlist, (text | tm)* }
+keyword.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Term
+term.element = element term { term.attlist, (text | tm)* }
+term.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Phrase
+ph.element = element ph { ph.attlist, ph.cnt* }
+ph.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Trade Mark
+tm.element = element tm { tm.attlist, (text | tm)* }
+tm.attlist &=
+  univ-atts,
+  attribute trademark { text }?,
+  attribute tmowner { text }?,
+  attribute tmtype { "tm" | "reg" | "service" },
+  attribute tmclass { text }?
+# LONG NAME: Boolean  (deprecated)
+boolean.element = element boolean { boolean.attlist, empty }
+boolean.attlist &=
+  attribute state { "yes" | "no" },
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: State
+
+# A state can have a name and a string value, 
+# even if empty or indeterminate
+state.element = element state { state.attlist, empty }
+state.attlist &=
+  attribute name { text },
+  attribute value { text },
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Image Data
+image.element = element image { image.attlist, alt? }
+image.attlist &=
+  attribute href { text },
+  attribute keyref { xsd:NMTOKEN }?,
+  attribute alt { text }?,
+  attribute longdescref { text }?,
+  attribute height { xsd:NMTOKEN }?,
+  attribute width { xsd:NMTOKEN }?,
+  attribute align { text }?,
+  attribute scale { xsd:NMTOKEN }?,
+  [ a:defaultValue = "inline" ]
+  attribute placement { "inline" | "break" }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Alternate text
+alt.element = element alt { alt.attlist, words.cnt* }
+alt.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Object (Streaming/Executable 
+# Data)
+object.element =
+  element object {
+    object.attlist, desc?, param*, foreign.unknown.incl*
+  }
+object.attlist &=
+  attribute declare { "declare" }?,
+  attribute classid { text }?,
+  attribute codebase { text }?,
+  attribute data { text }?,
+  attribute type { text }?,
+  attribute codetype { text }?,
+  attribute archive { text }?,
+  attribute standby { text }?,
+  attribute height { xsd:NMTOKEN }?,
+  attribute width { xsd:NMTOKEN }?,
+  attribute usemap { text }?,
+  attribute name { text }?,
+  attribute tabindex { xsd:NMTOKEN }?,
+  attribute longdescre { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Parameter
+param.element = element param { param.attlist, empty }
+param.attlist &=
+  univ-atts,
+  attribute name { text },
+  attribute value { text }?,
+  attribute valuetype { "data" | "ref" | "object" }?,
+  attribute type { text }?
+# LONG NAME: Simple Table
+simpletable.element =
+  element simpletable { simpletable.attlist, sthead?, strow+ }
+simpletable.attlist &=
+  attribute relcolwidth { text }?,
+  attribute keycol { xsd:NMTOKEN }?,
+  attribute refcols { xsd:NMTOKENS }?,
+  display-atts,
+  attribute spectitle { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Simple Table Head
+sthead.element = element sthead { sthead.attlist, stentry+ }
+sthead.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Simple Table Row
+strow.element = element strow { strow.attlist, stentry* }
+strow.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Simple Table Cell (entry)
+stentry.element = element stentry { stentry.attlist, tblcell.cnt* }
+stentry.attlist &=
+  attribute specentry { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Review Comments Block
+draft-comment.element =
+  element draft-comment {
+    draft-comment.attlist,
+    (text
+     | basic.phandblock
+     | data.elements.incl
+     | foreign.unknown.incl)*
+  }
+draft-comment.attlist &=
+  attribute author { text }?,
+  attribute time { text }?,
+  attribute disposition {
+    "issue"
+    | "open"
+    | "accepted"
+    | "rejected"
+    | "deferred"
+    | "duplicate"
+    | "reopened"
+    | "unassigned"
+    | "completed"
+  }?,
+  univ-atts-translate-no,
+  attribute outputclass { text }?
+# LONG NAME: Required Cleanup Block
+required-cleanup.element =
+  element required-cleanup { required-cleanup.attlist, any }
+required-cleanup.attlist &=
+  attribute remap { text }?,
+  univ-atts-translate-no,
+  attribute outputclass { text }?
+# LONG NAME: Footnote
+fn.element = element fn { fn.attlist, fn.cnt* }
+fn.attlist &=
+  attribute callout { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Index Term
+indexterm.element =
+  element indexterm {
+    indexterm.attlist, (words.cnt | indexterm | index-base)*
+  }
+indexterm.attlist &=
+  attribute keyref { text }?,
+  attribute start { text }?,
+  attribute end { text }?,
+  univ-atts
+# LONG NAME: Index Base
+index-base.element =
+  element index-base { index-base.attlist, (words.cnt | indexterm)* }
+index-base.attlist &=
+  attribute keyref { text }?,
+  univ-atts
+# LONG NAME: Index term reference
+indextermref.element =
+  element indextermref { indextermref.attlist, empty }
+indextermref.attlist &=
+  attribute keyref { text },
+  univ-atts
+# LONG NAME: Citation (bibliographic source)
+cite.element = element cite { cite.attlist, xrefph.cnt* }
+cite.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Cross Reference/Link
+xref.element = element xref { xref.attlist, (xreftext.cnt | desc)* }
+xref.attlist &=
+  attribute href { text }?,
+  attribute keyref { text }?,
+  attribute type { text }?,
+  univ-atts,
+  attribute format { text }?,
+  attribute scope { "local" | "peer" | "external" }?,
+  attribute outputclass { text }?
+include "tblDecl.mod.rnc"
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+alt.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/alt " ] attribute class { text }?
+boolean.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/boolean " ] attribute class { text }?
+cite.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/cite " ] attribute class { text }?
+dd.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/dd " ] attribute class { text }?
+data.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/data " ] attribute class { text }?
+data-about.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/data-about " ] attribute class { text }?
+ddhd.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/ddhd " ] attribute class { text }?
+desc.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/desc " ] attribute class { text }?
+dl.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/dl " ] attribute class { text }?
+dlentry.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/dlentry " ] attribute class { text }?
+dlhead.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/dlhead " ] attribute class { text }?
+draft-comment.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/draft-comment " ]
+  attribute class { text }?
+dt.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/dt " ] attribute class { text }?
+dthd.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/dthd " ] attribute class { text }?
+fig.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/fig " ] attribute class { text }?
+figgroup.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/figgroup " ] attribute class { text }?
+fn.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/fn " ] attribute class { text }?
+foreign.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/foreign " ] attribute class { text }?
+image.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/image " ] attribute class { text }?
+indexterm.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/indexterm " ] attribute class { text }?
+index-base.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/index-base " ] attribute class { text }?
+indextermref.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/indextermref " ] attribute class { text }?
+itemgroup.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/itemgroup " ] attribute class { text }?
+keyword.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/keyword " ] attribute class { text }?
+li.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/li " ] attribute class { text }?
+lines.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/lines " ] attribute class { text }?
+lq.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/lq " ] attribute class { text }?
+note.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/note " ] attribute class { text }?
+object.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/object " ] attribute class { text }?
+ol.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/ol " ] attribute class { text }?
+p.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/p " ] attribute class { text }?
+param.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/param " ] attribute class { text }?
+ph.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/ph " ] attribute class { text }?
+pre.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/pre " ] attribute class { text }?
+q.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/q " ] attribute class { text }?
+required-cleanup.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/required-cleanup " ]
+  attribute class { text }?
+simpletable.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/simpletable " ] attribute class { text }?
+sl.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/sl " ] attribute class { text }?
+sli.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/sli " ] attribute class { text }?
+state.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/state " ] attribute class { text }?
+stentry.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/stentry " ] attribute class { text }?
+sthead.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/sthead " ] attribute class { text }?
+strow.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/strow " ] attribute class { text }?
+term.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/term " ] attribute class { text }?
+title.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/title " ] attribute class { text }?
+tm.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/tm " ] attribute class { text }?
+ul.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/ul " ] attribute class { text }?
+unknown.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/unknown " ] attribute class { text }?
+xref.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/xref " ] attribute class { text }?
+# ================== End Common Elements Module  ==============
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/concept.dtd b/xml/tests/testData/xml/OasisDocumentHighlighting/concept.dtd
new file mode 100644
index 0000000..00e103f
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/concept.dtd
@@ -0,0 +1,176 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Concept DTD                                  -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//DTD DITA Concept//EN"
+      Delivered as file "concept.dtd"                              -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    DTD to describe DITA Concepts                     -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2006.06.07 RDA: Added indexing domain                      -->
+<!--    2006.06.21 RDA: Added props attribute extensions           -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATIONS                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % ui-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA User Interface Domain//EN" 
+"uiDomain.ent"                                                       >
+%ui-d-dec;
+
+<!ENTITY % hi-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Highlight Domain//EN" 
+"highlightDomain.ent"                                                >
+%hi-d-dec;
+
+<!ENTITY % pr-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Programming Domain//EN" 
+"programmingDomain.ent"                                              >
+%pr-d-dec;
+
+<!ENTITY % sw-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Software Domain//EN" 
+"softwareDomain.ent"                                                 >
+%sw-d-dec;
+
+<!ENTITY % ut-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Utilities Domain//EN" 
+"utilitiesDomain.ent"                                                >
+%ut-d-dec;
+
+<!ENTITY % indexing-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Indexing Domain//EN" 
+"indexingDomain.ent"                                                 >
+%indexing-d-dec;
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE DECLARATIONS              -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN EXTENSIONS                          -->
+<!-- ============================================================= -->
+<!--                    One for each extended base element, with
+                        the name of the domain(s) in which the
+                        extension was declared                     -->
+
+<!ENTITY % pre          "pre     | %pr-d-pre;     | %sw-d-pre;     | 
+                                   %ui-d-pre;"                       >
+<!ENTITY % keyword      "keyword | %pr-d-keyword; | %sw-d-keyword; |
+                                   %ui-d-keyword;"                   >
+<!ENTITY % ph           "ph      | %pr-d-ph;      | %sw-d-ph;      | 
+                                    %hi-d-ph;     | %ui-d-ph;"       >
+<!ENTITY % fig          "fig     | %pr-d-fig;     | %ut-d-fig;"      >
+<!ENTITY % dl           "dl      | %pr-d-dl;"                        >
+<!ENTITY % index-base   "index-base | %indexing-d-index-base;"       >
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE EXTENSIONS                -->
+<!-- ============================================================= -->
+<!ENTITY % props-attribute-extensions  ""                            >
+<!ENTITY % base-attribute-extensions   ""                            >
+
+
+<!-- ============================================================= -->
+<!--                    TOPIC NESTING OVERRIDE                     -->
+<!-- ============================================================= -->
+
+<!--                    Redefine the infotype entity to exclude 
+                        other topic types and disallow nesting     -->
+<!ENTITY % concept-info-types 
+                        "concept"                                    >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+<!--                    Must be declared ahead of the DTDs, which
+                        puts @domains first in order               -->
+
+<!ENTITY included-domains 
+                        "&ui-d-att; &hi-d-att; &pr-d-att; &sw-d-att;
+                         &ut-d-att; &indexing-d-att;"                >
+
+
+<!-- ============================================================= -->
+<!--                    TOPIC ELEMENT INTEGRATION                  -->
+<!-- ============================================================= -->
+
+<!--                    Embed topic to get generic elements        -->
+<!ENTITY % topic-type   PUBLIC 
+"-//OASIS//ELEMENTS DITA Topic//EN" 
+"topic.mod"                                                          >
+%topic-type;
+
+
+<!--                    Embed concept to get specific elements     -->
+<!ENTITY % concept-typemod 
+                        PUBLIC 
+"-//OASIS//ELEMENTS DITA Concept//EN" 
+"concept.mod"                                                        >                                                     
+%concept-typemod;
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ELEMENT INTEGRATION                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % ui-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA User Interface Domain//EN" 
+"uiDomain.mod"                                                       >
+%ui-d-def;
+
+<!ENTITY % hi-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Highlight Domain//EN" 
+"highlightDomain.mod"                                                >
+%hi-d-def;
+
+<!ENTITY % pr-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Programming Domain//EN" 
+"programmingDomain.mod"                                              >
+%pr-d-def;
+
+<!ENTITY % sw-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Software Domain//EN" 
+"softwareDomain.mod"                                                 >
+%sw-d-def;
+
+<!ENTITY % ut-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Utilities Domain//EN" 
+"utilitiesDomain.mod"                                                >
+%ut-d-def;
+
+<!ENTITY % indexing-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Indexing Domain//EN"
+"indexingDomain.mod"                                                 >
+%indexing-d-def;
+
+<!-- ================== End DITA Concept DTD  ==================== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/concept.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/concept.mod
new file mode 100644
index 0000000..482f4bb7
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/concept.mod
@@ -0,0 +1,127 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Concept                                      -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA Concept//EN"
+      Delivered as file "concept.mod"                              -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Define elements and specialization atttributes    -->
+<!--             for Concepts                                      -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Removed old declaration for                -->
+<!--                    conceptClasses entity                      -->
+<!--    2006.06.07 RDA: Added <abstract> element                   -->
+<!--    2006.06.07 RDA: Make universal attributes universal        -->
+<!--                      (DITA 1.1 proposal #12)                  -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                   ARCHITECTURE ENTITIES                       -->
+<!-- ============================================================= -->
+
+<!-- default namespace prefix for DITAArchVersion attribute can be
+     overridden through predefinition in the document type shell   -->
+<!ENTITY % DITAArchNSPrefix
+                       "ditaarch"                                    >
+
+<!-- must be instanced on each topic type                          -->
+<!ENTITY % arch-atts "
+             xmlns:%DITAArchNSPrefix; 
+                        CDATA                              #FIXED
+                       'http://dita.oasis-open.org/architecture/2005/'
+             %DITAArchNSPrefix;:DITAArchVersion
+                        CDATA                              #FIXED
+                       '1.1'"                                        >
+
+
+<!-- ============================================================= -->
+<!--                   SPECIALIZATION OF DECLARED ELEMENTS         -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % concept-info-types "%info-types;">
+
+
+<!-- ============================================================= -->
+<!--                   ELEMENT NAME ENTITIES                       -->
+<!-- ============================================================= -->
+ 
+
+<!ENTITY % concept     "concept"                                     >
+<!ENTITY % conbody     "conbody"                                     >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY included-domains ""                                         >
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+
+
+<!--                    LONG NAME: Concept                         -->
+<!ELEMENT concept       ((%title;), (%titlealts;)?,
+                         (%shortdesc; | %abstract;)?, 
+                         (%prolog;)?, (%conbody;)?, (%related-links;)?,
+                         (%concept-info-types;)* )                   >
+<!ATTLIST concept        
+             id         ID                               #REQUIRED
+             conref     CDATA                            #IMPLIED
+             %select-atts;
+             %localization-atts;
+             %arch-atts;
+             outputclass 
+                        CDATA                            #IMPLIED
+             domains    CDATA                "&included-domains;"    >
+
+
+<!--                    LONG NAME: Concept Body                    -->
+<!ELEMENT conbody       ((%body.cnt;)*, (%section;|%example;)* )     >
+<!ATTLIST conbody         
+             %id-atts;
+             %localization-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+             
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+
+
+<!ATTLIST concept     %global-atts;  class CDATA "- topic/topic concept/concept ">
+<!ATTLIST conbody     %global-atts;  class CDATA "- topic/body  concept/conbody ">
+
+ 
+<!-- ================== End DITA Concept  ======================== -->
+
+
+
+
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/concept.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/concept.mod.rnc
new file mode 100644
index 0000000..249d898
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/concept.mod.rnc
@@ -0,0 +1,150 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Concept
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA Concept//EN"
+#       Delivered as file "concept.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Define elements and specialization atttributes
+
+# for Concepts
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+# UPDATES:
+
+# 2005.11.15 RDA: Removed old declaration for
+
+# conceptClasses entity
+
+# 2006.06.07 RDA: Added <abstract> element
+
+# 2006.06.07 RDA: Make universal attributes universal
+
+# (DITA 1.1 proposal #12)
+
+# =============================================================
+
+# =============================================================
+
+# ARCHITECTURE ENTITIES
+
+# =============================================================
+
+# default namespace prefix for DITAArchVersion attribute can be
+# overridden through predefinition in the document type shell
+
+# must be instanced on each topic type
+
+# =============================================================
+
+# SPECIALIZATION OF DECLARED ELEMENTS
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+conbody = conbody.element
+# =============================================================
+
+# DOMAINS ATTRIBUTE OVERRIDE
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT DECLARATIONS
+
+# =============================================================
+
+# LONG NAME: Concept
+concept.element =
+  element concept {
+    concept.attlist,
+    title,
+    titlealts?,
+    (shortdesc | abstract)?,
+    prolog?,
+    conbody?,
+    related-links?,
+    concept-info-types*
+  }
+concept.attlist &=
+  attribute id { xsd:ID },
+  attribute conref { text }?,
+  select-atts,
+  localization-atts,
+  arch-atts,
+  attribute outputclass { text }?,
+  [
+    a:defaultValue =
+      "(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                          (topic ut-d) (topic indexing-d)"
+  ]
+  attribute domains { text }?
+# LONG NAME: Concept Body
+conbody.element =
+  element conbody { conbody.attlist, body.cnt*, (section | example)* }
+conbody.attlist &=
+  id-atts,
+  localization-atts,
+  attribute outputclass { text }?
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+concept.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/topic concept/concept " ]
+  attribute class { text }?
+conbody.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/body  concept/conbody " ]
+  attribute class { text }?
+# ================== End DITA Concept  ========================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/concept.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/concept.rnc
new file mode 100644
index 0000000..0902b7a
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/concept.rnc
@@ -0,0 +1,148 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Concept DTD
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//DTD DITA Concept//EN"
+#       Delivered as file "concept.dtd"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    DTD to describe DITA Concepts
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2006.06.07 RDA: Added indexing domain
+
+# 2006.06.21 RDA: Added props attribute extensions
+
+# =============================================================
+
+# =============================================================
+
+# DOMAIN ENTITY DECLARATIONS
+
+# =============================================================
+
+include "uiDomain.ent.rnc"
+include "highlightDomain.ent.rnc"
+include "programmingDomain.ent.rnc"
+include "softwareDomain.ent.rnc"
+include "utilitiesDomain.ent.rnc"
+include "indexingDomain.ent.rnc"
+# =============================================================
+
+# DOMAIN ATTRIBUTE DECLARATIONS
+
+# =============================================================
+
+# =============================================================
+
+# DOMAIN EXTENSIONS
+
+# =============================================================
+
+# One for each extended base element, with
+# the name of the domain(s) in which the
+# extension was declared
+pre = pre.element | pr-d-pre | sw-d-pre | ui-d-pre
+keyword = keyword.element | pr-d-keyword | sw-d-keyword | ui-d-keyword
+ph = ph.element | pr-d-ph | sw-d-ph | hi-d-ph | ui-d-ph
+fig = fig.element | pr-d-fig | ut-d-fig
+dl = dl.element | pr-d-dl
+index-base = index-base.element | indexing-d-index-base
+# =============================================================
+
+# DOMAIN ATTRIBUTE EXTENSIONS
+
+# =============================================================
+props-attribute-extensions = empty
+base-attribute-extensions = empty
+# =============================================================
+
+# TOPIC NESTING OVERRIDE
+
+# =============================================================
+
+# Redefine the infotype entity to exclude 
+# other topic types and disallow nesting
+concept-info-types = concept.element
+# =============================================================
+
+# DOMAINS ATTRIBUTE OVERRIDE
+
+# =============================================================
+
+# Must be declared ahead of the DTDs, which
+# puts @domains first in order
+
+# =============================================================
+
+# TOPIC ELEMENT INTEGRATION
+
+# =============================================================
+
+# Embed topic to get generic elements
+include "topic.mod.rnc"
+# Embed concept to get specific elements
+include "concept.mod.rnc"
+# =============================================================
+
+# DOMAIN ELEMENT INTEGRATION
+
+# =============================================================
+include "uiDomain.mod.rnc"
+include "highlightDomain.mod.rnc"
+include "programmingDomain.mod.rnc"
+include "softwareDomain.mod.rnc"
+include "utilitiesDomain.mod.rnc"
+include "indexingDomain.mod.rnc"
+start = no-topic-nesting.element
+any =
+  (element * {
+     attribute * { text }*,
+     any
+   }
+   | text)*
+# ================== End DITA Concept DTD  ====================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/ditabase.dtd b/xml/tests/testData/xml/OasisDocumentHighlighting/ditabase.dtd
new file mode 100644
index 0000000..96eaddc
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/ditabase.dtd
@@ -0,0 +1,214 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA BASE DTD                                     -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//DTD DITA Composite//EN"
+      Delivered as file "ditabase.dtd"                            -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Base DTD holds all the information types          -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Updated these comments to match template   -->
+<!--    2006.06.07 RDA: Added indexing domain                      -->
+<!--    2006.06.21 RDA: Added props attribute extensions           -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATIONS                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % ui-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA User Interface Domain//EN" 
+"uiDomain.ent"                                                       >
+%ui-d-dec;
+
+<!ENTITY % hi-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Highlight Domain//EN" 
+"highlightDomain.ent"                                                >
+%hi-d-dec;
+
+<!ENTITY % pr-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Programming Domain//EN" 
+"programmingDomain.ent"                                              >
+%pr-d-dec;
+
+<!ENTITY % sw-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Software Domain//EN" 
+"softwareDomain.ent"                                                 >
+%sw-d-dec;
+
+<!ENTITY % ut-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Utilities Domain//EN" 
+"utilitiesDomain.ent"                                                >
+%ut-d-dec;
+
+<!ENTITY % indexing-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Indexing Domain//EN" 
+"indexingDomain.ent"                                                 >
+%indexing-d-dec;
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE DECLARATIONS              -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN EXTENSIONS                          -->
+<!-- ============================================================= -->
+<!--                    One for each extended base element, with
+                        the name of the domain(s) in which the
+                        extension was declared                     -->
+
+<!ENTITY % pre          "pre     | %pr-d-pre;     | %sw-d-pre;     | 
+                                   %ui-d-pre;"                       >
+<!ENTITY % keyword      "keyword | %pr-d-keyword; | %sw-d-keyword; |
+                                   %ui-d-keyword;"                   >
+<!ENTITY % ph           "ph      | %pr-d-ph;      | %sw-d-ph;      | 
+                                    %hi-d-ph;     | %ui-d-ph;"       >
+<!ENTITY % fig          "fig     | %pr-d-fig;     | %ut-d-fig;"      >
+<!ENTITY % dl           "dl      | %pr-d-dl;"                        >
+<!ENTITY % index-base   "index-base | %indexing-d-index-base;"       >
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE EXTENSIONS                -->
+<!-- ============================================================= -->
+<!ENTITY % props-attribute-extensions  ""                            >
+<!ENTITY % base-attribute-extensions   ""                            >
+
+
+<!-- ============================================================= -->
+<!--                    TOPIC NESTING OVERRIDE                     -->
+<!-- ============================================================= -->
+
+<!--                    Redefine the infotype entity to exclude 
+                        other topic types and disallow nesting     -->
+<!ENTITY % glossentry-info-types 
+                        "no-topic-nesting"                           >
+<!ENTITY % info-types   "topic | concept | task | reference |
+                         glossentry"                                 >
+
+
+<!-- ============================================================= -->
+<!--                    LOCALLY DEFINED CONTAINMENT                -->
+<!-- ============================================================= -->
+<!--                    Define a containment for topics for editor 
+                        support                                    -->
+
+<!ELEMENT dita          (%info-types;)+                              >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+<!--                    Must be declared ahead of the DTDs, which
+                        puts @domains first in order               -->
+
+<!ENTITY included-domains 
+                        "&ui-d-att; &hi-d-att; &pr-d-att; &sw-d-att;
+                         &ut-d-att; &indexing-d-att;"                >
+
+
+<!-- ============================================================= -->
+<!--                    TOPIC ELEMENT INTEGRATION                  -->
+<!-- ============================================================= -->
+<!--                    Embed topic to get generic elements        -->
+<!ENTITY % topic-type   PUBLIC 
+"-//OASIS//ELEMENTS DITA Topic//EN" 
+"topic.mod"                                                          >
+%topic-type;
+
+
+<!--                    Embed concept to get specific elements     -->
+<!ENTITY % concept-typemod 
+                        PUBLIC 
+"-//OASIS//ELEMENTS DITA Concept//EN" 
+"concept.mod"                                                        >                                                     
+%concept-typemod;
+
+<!--                    Embed task to get specific elements        -->
+<!ENTITY % task-typemod PUBLIC
+ "-//OASIS//ELEMENTS DITA Task//EN" 
+"task.mod"                                                           >
+%task-typemod;
+
+<!--                     Embed reference to get specific elements  -->
+<!ENTITY % reference-typemod 
+                         PUBLIC 
+"-//OASIS//ELEMENTS DITA Reference//EN" 
+"reference.mod"                                                      >
+%reference-typemod;
+
+<!--                    Embed glossary to get specific elements    -->
+<!ENTITY % glossary-typemod 
+                        PUBLIC 
+"-//OASIS//ELEMENTS DITA Glossary//EN" 
+"glossary.mod"                                                       >                                                     
+%glossary-typemod;
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ELEMENT INTEGRATION                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % ui-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA User Interface Domain//EN" 
+"uiDomain.mod"                                                       >
+%ui-d-def;
+
+<!ENTITY % hi-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Highlight Domain//EN" 
+"highlightDomain.mod"                                                >
+%hi-d-def;
+
+<!ENTITY % pr-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Programming Domain//EN" 
+"programmingDomain.mod"                                              >
+%pr-d-def;
+
+<!ENTITY % sw-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Software Domain//EN" 
+"softwareDomain.mod"                                                 >
+%sw-d-def;
+
+<!ENTITY % ut-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Utilities Domain//EN" 
+"utilitiesDomain.mod"                                                >
+%ut-d-def;
+
+<!ENTITY % indexing-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Indexing Domain//EN" 
+"indexingDomain.mod"                                                 >
+%indexing-d-def;
+
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTES                  -->
+<!-- ============================================================= -->
+
+<!ATTLIST dita          %global-atts;                                >
+
+
+<!-- ================== End DITA Base DTD  ======================= -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/ditabase.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/ditabase.rnc
new file mode 100644
index 0000000..d01a0eb
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/ditabase.rnc
@@ -0,0 +1,177 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA BASE DTD
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//DTD DITA Composite//EN"
+#       Delivered as file "ditabase.dtd"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Base DTD holds all the information types
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Updated these comments to match template
+
+# 2006.06.07 RDA: Added indexing domain
+
+# 2006.06.21 RDA: Added props attribute extensions
+
+# =============================================================
+
+# =============================================================
+
+# DOMAIN ENTITY DECLARATIONS
+
+# =============================================================
+
+include "uiDomain.ent.rnc"
+include "highlightDomain.ent.rnc"
+include "programmingDomain.ent.rnc"
+include "softwareDomain.ent.rnc"
+include "utilitiesDomain.ent.rnc"
+include "indexingDomain.ent.rnc"
+# =============================================================
+
+# DOMAIN ATTRIBUTE DECLARATIONS
+
+# =============================================================
+
+# =============================================================
+
+# DOMAIN EXTENSIONS
+
+# =============================================================
+
+# One for each extended base element, with
+# the name of the domain(s) in which the
+# extension was declared
+pre = pre.element | pr-d-pre | sw-d-pre | ui-d-pre
+keyword = keyword.element | pr-d-keyword | sw-d-keyword | ui-d-keyword
+ph = ph.element | pr-d-ph | sw-d-ph | hi-d-ph | ui-d-ph
+fig = fig.element | pr-d-fig | ut-d-fig
+dl = dl.element | pr-d-dl
+index-base = index-base.element | indexing-d-index-base
+# =============================================================
+
+# DOMAIN ATTRIBUTE EXTENSIONS
+
+# =============================================================
+props-attribute-extensions = empty
+base-attribute-extensions = empty
+# =============================================================
+
+# TOPIC NESTING OVERRIDE
+
+# =============================================================
+
+# Redefine the infotype entity to exclude 
+# other topic types and disallow nesting
+glossentry-info-types = no-topic-nesting.element
+info-types =
+  topic.element
+  | concept.element
+  | task.element
+  | reference.element
+  | glossentry.element
+# =============================================================
+
+# LOCALLY DEFINED CONTAINMENT
+
+# =============================================================
+
+# Define a containment for topics for editor 
+# support
+dita.element = element dita { dita.attlist, info-types+ }
+# =============================================================
+
+# DOMAINS ATTRIBUTE OVERRIDE
+
+# =============================================================
+
+# Must be declared ahead of the DTDs, which
+# puts @domains first in order
+
+# =============================================================
+
+# TOPIC ELEMENT INTEGRATION
+
+# =============================================================
+
+# Embed topic to get generic elements
+include "topic.mod.rnc"
+# Embed concept to get specific elements
+include "concept.mod.rnc"
+# Embed task to get specific elements
+include "task.mod.rnc"
+# Embed reference to get specific elements
+include "reference.mod.rnc"
+# Embed glossary to get specific elements
+include "glossary.mod.rnc"
+# =============================================================
+
+# DOMAIN ELEMENT INTEGRATION
+
+# =============================================================
+include "uiDomain.mod.rnc"
+include "highlightDomain.mod.rnc"
+include "programmingDomain.mod.rnc"
+include "softwareDomain.mod.rnc"
+include "utilitiesDomain.mod.rnc"
+include "indexingDomain.mod.rnc"
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTES
+
+# =============================================================
+dita.attlist &= global-atts
+start = dita.element
+any =
+  (element * {
+     attribute * { text }*,
+     any
+   }
+   | text)*
+# ================== End DITA Base DTD  =======================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/glossary.dtd b/xml/tests/testData/xml/OasisDocumentHighlighting/glossary.dtd
new file mode 100644
index 0000000..c6c0907
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/glossary.dtd
@@ -0,0 +1,178 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Glossary DTD                                 -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//DTD DITA Glossary//EN"
+      Delivered as file "glossary.dtd"                             -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    DTD to describe DITA Glossary topics              -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             June 2006                                         -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2006.                    -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATIONS                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % ui-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA User Interface Domain//EN" 
+"uiDomain.ent"                                                       >
+%ui-d-dec;
+
+<!ENTITY % hi-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Highlight Domain//EN" 
+"highlightDomain.ent"                                                >
+%hi-d-dec;
+
+<!ENTITY % pr-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Programming Domain//EN" 
+"programmingDomain.ent"                                              >
+%pr-d-dec;
+
+<!ENTITY % sw-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Software Domain//EN" 
+"softwareDomain.ent"                                                 >
+%sw-d-dec;
+
+<!ENTITY % ut-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Utilities Domain//EN" 
+"utilitiesDomain.ent"                                                >
+%ut-d-dec;
+
+<!ENTITY % indexing-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Indexing Domain//EN" 
+"indexingDomain.ent"                                                 >
+%indexing-d-dec;
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE DECLARATIONS              -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN EXTENSIONS                          -->
+<!-- ============================================================= -->
+<!--                    One for each extended base element, with
+                        the name of the domain(s) in which the
+                        extension was declared                     -->
+
+<!ENTITY % pre          "pre     | %pr-d-pre;     | %sw-d-pre;     | 
+                                   %ui-d-pre;"                       >
+<!ENTITY % keyword      "keyword | %pr-d-keyword; | %sw-d-keyword; |
+                                   %ui-d-keyword;"                   >
+<!ENTITY % ph           "ph      | %pr-d-ph;      | %sw-d-ph;      | 
+                                    %hi-d-ph;     | %ui-d-ph;"       >
+<!ENTITY % fig          "fig     | %pr-d-fig;     | %ut-d-fig;"      >
+<!ENTITY % dl           "dl      | %pr-d-dl;"                        >
+<!ENTITY % index-base   "index-base | %indexing-d-index-base;"       >
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE EXTENSIONS                -->
+<!-- ============================================================= -->
+<!ENTITY % props-attribute-extensions  ""                            >
+<!ENTITY % base-attribute-extensions   ""                            >
+
+
+<!-- ============================================================= -->
+<!--                    TOPIC NESTING OVERRIDE                     -->
+<!-- ============================================================= -->
+
+<!--                    Redefine the infotype entity to exclude 
+                        other topic types and disallow nesting     -->
+<!ENTITY % glossentry-info-types 
+                        "no-topic-nesting"                           >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+<!--                    Must be declared ahead of the DTDs, which
+                        puts @domains first in order               -->
+
+<!ENTITY included-domains 
+                        "&ui-d-att; &hi-d-att; &pr-d-att; &sw-d-att;
+                         &ut-d-att; &indexing-d-att;"                >
+
+
+<!-- ============================================================= -->
+<!--                    TOPIC ELEMENT INTEGRATION                  -->
+<!-- ============================================================= -->
+
+<!--                    Embed topic to get generic elements        -->
+<!ENTITY % topic-type   PUBLIC 
+"-//OASIS//ELEMENTS DITA Topic//EN" 
+"topic.mod"                                                          >
+%topic-type;
+
+<!ENTITY % concept-typemod 
+                        PUBLIC 
+"-//OASIS//ELEMENTS DITA Concept//EN" 
+"concept.mod"                                                        >                                                     
+%concept-typemod;
+
+<!--                    Embed glossary to get specific elements    -->
+<!ENTITY % glossary-typemod 
+                        PUBLIC 
+"-//OASIS//ELEMENTS DITA Glossary//EN" 
+"glossary.mod"                                                       >                                                     
+%glossary-typemod;
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ELEMENT INTEGRATION                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % ui-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA User Interface Domain//EN" 
+"uiDomain.mod"                                                       >
+%ui-d-def;
+
+<!ENTITY % hi-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Highlight Domain//EN" 
+"highlightDomain.mod"                                                >
+%hi-d-def;
+
+<!ENTITY % pr-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Programming Domain//EN" 
+"programmingDomain.mod"                                              >
+%pr-d-def;
+
+<!ENTITY % sw-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Software Domain//EN" 
+"softwareDomain.mod"                                                 >
+%sw-d-def;
+
+<!ENTITY % ut-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Utilities Domain//EN" 
+"utilitiesDomain.mod"                                                >
+%ut-d-def;
+
+<!ENTITY % indexing-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Indexing Domain//EN" 
+"indexingDomain.mod"                                                 >
+%indexing-d-def;
+
+<!-- ================== End DITA Glossary DTD  =================== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/glossary.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/glossary.mod
new file mode 100644
index 0000000..6a09c3a
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/glossary.mod
@@ -0,0 +1,129 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Glossary                                     -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA Glossary//EN"
+      Delivered as file "glossary.mod"                             -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Define elements and specialization atttributes    -->
+<!--             for Glossary topics                               -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             June 2006                                         -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2006.                    -->
+<!--             All Rights Reserved.                              -->
+<!--  UPDATES:                                                     -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                   ARCHITECTURE ENTITIES                       -->
+<!-- ============================================================= -->
+
+<!-- default namespace prefix for DITAArchVersion attribute can be
+     overridden through predefinition in the document type shell   -->
+<!ENTITY % DITAArchNSPrefix
+                       "ditaarch"                                    >
+
+<!-- must be instanced on each topic type                          -->
+<!ENTITY % arch-atts "
+             xmlns:%DITAArchNSPrefix; 
+                        CDATA                              #FIXED
+                       'http://dita.oasis-open.org/architecture/2005/'
+             %DITAArchNSPrefix;:DITAArchVersion
+                        CDATA                              #FIXED
+                       '1.1'"                                        >
+
+
+<!-- ============================================================= -->
+<!--                   SPECIALIZATION OF DECLARED ELEMENTS         -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % glossentry-info-types "no-topic-nesting">
+
+
+<!-- ============================================================= -->
+<!--                   ELEMENT NAME ENTITIES                       -->
+<!-- ============================================================= -->
+ 
+
+<!ENTITY % glossentry  "glossentry"                                  >
+<!ENTITY % glossterm   "glossterm"                                   >
+<!ENTITY % glossdef    "glossdef"                                    >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY included-domains ""                                         >
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+
+
+<!--                    LONG NAME: Glossary Entry                  -->
+<!ELEMENT glossentry     ((%glossterm;), (%glossdef;), 
+                          (%related-links;)?,
+                          (%glossentry-info-types;)* )               >
+<!ATTLIST glossentry        
+             id         ID                               #REQUIRED
+             conref     CDATA                            #IMPLIED
+             %select-atts;
+             %localization-atts;
+             %arch-atts;
+             outputclass 
+                        CDATA                            #IMPLIED
+             domains    CDATA                "&included-domains;"    >
+
+
+<!--                    LONG NAME: Glossary Term                   -->
+<!ELEMENT glossterm     (%title.cnt;)*                               >
+<!ATTLIST glossterm         
+             %id-atts;
+             %localization-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+                        
+<!--                    LONG NAME: Glossary Definition             -->
+<!ELEMENT glossdef      (%section.notitle.cnt; | %shortdesc;)*       >
+<!ATTLIST glossdef         
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+             
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+
+
+<!ATTLIST glossentry  %global-atts;  class CDATA "- topic/topic concept/concept glossentry/glossentry ">
+<!ATTLIST glossterm   %global-atts;  class CDATA "- topic/title concept/title glossentry/glossterm ">
+<!ATTLIST glossdef    %global-atts;  class CDATA "- topic/abstract concept/abstract glossentry/glossdef ">
+
+ 
+<!-- ================== End DITA Glossary ======================== -->
+
+
+
+
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/glossary.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/glossary.mod.rnc
new file mode 100644
index 0000000..f4cb07e
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/glossary.mod.rnc
@@ -0,0 +1,155 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Glossary
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA Glossary//EN"
+#       Delivered as file "glossary.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Define elements and specialization atttributes
+
+# for Glossary topics
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# June 2006
+
+#
+
+# (C) Copyright OASIS Open 2006.
+
+# All Rights Reserved.
+
+# UPDATES:
+
+# =============================================================
+
+# =============================================================
+
+# ARCHITECTURE ENTITIES
+
+# =============================================================
+
+# default namespace prefix for DITAArchVersion attribute can be
+# overridden through predefinition in the document type shell
+
+# must be instanced on each topic type
+
+# =============================================================
+
+# SPECIALIZATION OF DECLARED ELEMENTS
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+glossterm = glossterm.element
+glossdef = glossdef.element
+# =============================================================
+
+# DOMAINS ATTRIBUTE OVERRIDE
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT DECLARATIONS
+
+# =============================================================
+
+# LONG NAME: Glossary Entry
+glossentry.element =
+  element glossentry {
+    glossentry.attlist,
+    glossterm,
+    glossdef,
+    related-links?,
+    glossentry-info-types*
+  }
+glossentry.attlist &=
+  attribute id { xsd:ID },
+  attribute conref { text }?,
+  select-atts,
+  localization-atts,
+  arch-atts,
+  attribute outputclass { text }?,
+  [
+    a:defaultValue =
+      "(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                          (topic ut-d) (topic indexing-d)"
+  ]
+  attribute domains { text }?
+# LONG NAME: Glossary Term
+glossterm.element = element glossterm { glossterm.attlist, title.cnt* }
+glossterm.attlist &=
+  id-atts,
+  localization-atts,
+  attribute outputclass { text }?
+# LONG NAME: Glossary Definition
+glossdef.element =
+  element glossdef {
+    glossdef.attlist, (section.notitle.cnt | shortdesc)*
+  }
+glossdef.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+glossentry.attlist &=
+  global-atts,
+  [
+    a:defaultValue =
+      "- topic/topic concept/concept glossentry/glossentry "
+  ]
+  attribute class { text }?
+glossterm.attlist &=
+  global-atts,
+  [
+    a:defaultValue = "- topic/title concept/title glossentry/glossterm "
+  ]
+  attribute class { text }?
+glossdef.attlist &=
+  global-atts,
+  [
+    a:defaultValue =
+      "- topic/abstract concept/abstract glossentry/glossdef "
+  ]
+  attribute class { text }?
+# ================== End DITA Glossary ========================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/highlightDomain.ent b/xml/tests/testData/xml/OasisDocumentHighlighting/highlightDomain.ent
new file mode 100644
index 0000000..8e9b028
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/highlightDomain.ent
@@ -0,0 +1,46 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Highlight Domain                             -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ENTITIES DITA Highlight Domain//EN"
+      Delivered as file "higlightDomain.ent"                       -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the substitution context and domain     -->
+<!--             entity declarations for the highlight domain      -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    HIGHLIGHT DOMAIN ENTITIES                  -->
+<!-- ============================================================= -->
+
+<!ENTITY % hi-d-ph      "b | u | i | tt | sup | sub"                 >
+
+<!ENTITY   hi-d-att     "(topic hi-d)"                               >
+
+
+<!-- ================== End Highlight Domain Entities ============ -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/highlightDomain.ent.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/highlightDomain.ent.rnc
new file mode 100644
index 0000000..7919e76
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/highlightDomain.ent.rnc
@@ -0,0 +1,75 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Highlight Domain
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ENTITIES DITA Highlight Domain//EN"
+#       Delivered as file "higlightDomain.ent"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the substitution context and domain
+
+# entity declarations for the highlight domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# =============================================================
+
+# =============================================================
+
+# HIGHLIGHT DOMAIN ENTITIES
+
+# =============================================================
+
+hi-d-ph =
+  b.element
+  | u.element
+  | i.element
+  | tt.element
+  | sup.element
+  | sub.element
+# ================== End Highlight Domain Entities ============
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/highlightDomain.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/highlightDomain.mod
new file mode 100644
index 0000000..b0cd827
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/highlightDomain.mod
@@ -0,0 +1,122 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Highlight Domain                             -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA Highlight Domain//EN"
+      Delivered as file "highlightDomain.mod"                      -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Define elements and specialization attributes     -->
+<!--             for Highlight Domain                              -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Corrected descriptive names for all        -->
+<!--                    elements except bold                       -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                   ELEMENT NAME ENTITIES                       -->
+<!-- ============================================================= -->
+
+<!ENTITY % b           "b"                                           >
+<!ENTITY % i           "i"                                           >
+<!ENTITY % u           "u"                                           >     
+<!ENTITY % tt          "tt"                                          >
+<!ENTITY % sup         "sup"                                         >
+<!ENTITY % sub         "sub"                                         >
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+
+
+<!--                    LONG NAME: Bold                            -->
+<!ELEMENT b             (#PCDATA | %basic.ph; | %data.elements.incl; |
+                         %foreign.unknown.incl;)*                    >
+<!ATTLIST b              
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Underlined                      -->
+<!ELEMENT u             (#PCDATA | %basic.ph; | %data.elements.incl; |
+                         %foreign.unknown.incl;)*                    >
+<!ATTLIST u              
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Italic                          -->
+<!ELEMENT i             (#PCDATA | %basic.ph; | %data.elements.incl; |
+                         %foreign.unknown.incl;)*                    >
+<!ATTLIST i             
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Teletype (monospaced)           -->
+<!ELEMENT tt            (#PCDATA | %basic.ph; | %data.elements.incl; |
+                         %foreign.unknown.incl;)*                    >
+<!ATTLIST tt            
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Superscript                     -->
+<!ELEMENT sup           (#PCDATA | %basic.ph; | %data.elements.incl; |
+                         %foreign.unknown.incl;)*                    >
+<!ATTLIST sup          
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Subscript                       -->
+<!ELEMENT sub           (#PCDATA | %basic.ph; | %data.elements.incl; |
+                         %foreign.unknown.incl;)*                    >
+<!ATTLIST sub           
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+             
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+
+
+<!ATTLIST b           %global-atts;  class CDATA "+ topic/ph hi-d/b "  >
+<!ATTLIST i           %global-atts;  class CDATA "+ topic/ph hi-d/i "  >
+<!ATTLIST sub         %global-atts;  class CDATA "+ topic/ph hi-d/sub ">
+<!ATTLIST sup         %global-atts;  class CDATA "+ topic/ph hi-d/sup ">
+<!ATTLIST tt          %global-atts;  class CDATA "+ topic/ph hi-d/tt " >
+<!ATTLIST u           %global-atts;  class CDATA "+ topic/ph hi-d/u "  >
+
+
+<!-- ================== DITA Highlight Domain ==================== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/highlightDomain.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/highlightDomain.mod.rnc
new file mode 100644
index 0000000..9aba8ce
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/highlightDomain.mod.rnc
@@ -0,0 +1,158 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Highlight Domain
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA Highlight Domain//EN"
+#       Delivered as file "highlightDomain.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Define elements and specialization attributes
+
+# for Highlight Domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Corrected descriptive names for all
+
+# elements except bold
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT DECLARATIONS
+
+# =============================================================
+
+# LONG NAME: Bold
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+b.element =
+  element b {
+    b.attlist,
+    (text | basic.ph | data.elements.incl | foreign.unknown.incl)*
+  }
+b.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Underlined
+u.element =
+  element u {
+    u.attlist,
+    (text | basic.ph | data.elements.incl | foreign.unknown.incl)*
+  }
+u.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Italic
+i.element =
+  element i {
+    i.attlist,
+    (text | basic.ph | data.elements.incl | foreign.unknown.incl)*
+  }
+i.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Teletype (monospaced)
+tt.element =
+  element tt {
+    tt.attlist,
+    (text | basic.ph | data.elements.incl | foreign.unknown.incl)*
+  }
+tt.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Superscript
+sup.element =
+  element sup {
+    sup.attlist,
+    (text | basic.ph | data.elements.incl | foreign.unknown.incl)*
+  }
+sup.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Subscript
+sub.element =
+  element sub {
+    sub.attlist,
+    (text | basic.ph | data.elements.incl | foreign.unknown.incl)*
+  }
+sub.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+b.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph hi-d/b " ] attribute class { text }?
+i.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph hi-d/i " ] attribute class { text }?
+sub.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph hi-d/sub " ] attribute class { text }?
+sup.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph hi-d/sup " ] attribute class { text }?
+tt.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph hi-d/tt " ] attribute class { text }?
+u.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph hi-d/u " ] attribute class { text }?
+# ================== DITA Highlight Domain ====================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/indexingDomain.ent b/xml/tests/testData/xml/OasisDocumentHighlighting/indexingDomain.ent
new file mode 100644
index 0000000..6a104c3
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/indexingDomain.ent
@@ -0,0 +1,48 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Indexing Domain Entities                     -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ENTITIES DITA Indexing Domain//EN"
+      Delivered as file "indexingDomain.ent"                       -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the substitution context and domain     -->
+<!--             entity declarations for the indexing domain       -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             June 2006                                         -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2006.                    -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    ELEMENT EXTENSION ENTITY DECLARATIONS      -->
+<!-- ============================================================= -->
+
+<!ENTITY % indexing-d-index-base 
+     "index-see | index-see-also | index-sort-as">
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATION                  -->
+<!-- ============================================================= -->
+
+<!ENTITY indexing-d-att "(topic indexing-d)"                         >
+
+<!-- ================== End Indexing Domain Entities ============= -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/indexingDomain.ent.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/indexingDomain.ent.rnc
new file mode 100644
index 0000000..dc1a232
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/indexingDomain.ent.rnc
@@ -0,0 +1,72 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Indexing Domain Entities
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ENTITIES DITA Indexing Domain//EN"
+#       Delivered as file "indexingDomain.ent"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the substitution context and domain
+
+# entity declarations for the indexing domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# June 2006
+
+#
+
+# (C) Copyright OASIS Open 2006.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT EXTENSION ENTITY DECLARATIONS
+
+# =============================================================
+
+indexing-d-index-base =
+  index-see.element | index-see-also.element | index-sort-as.element
+# =============================================================
+
+# DOMAIN ENTITY DECLARATION
+
+# =============================================================
+
+# ================== End Indexing Domain Entities =============
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/indexingDomain.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/indexingDomain.mod
new file mode 100644
index 0000000..e7d3be5
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/indexingDomain.mod
@@ -0,0 +1,83 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Indexing  Domain                             -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA Indexing Domain//EN"
+      Delivered as file "indexingDomain.mod"                       -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the elements and specialization         -->
+<!--             attributes for the DITA Indexing Domain           -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             June 2006                                         -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2006.                    -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                   ELEMENT NAME ENTITIES                       -->
+<!-- ============================================================= -->
+
+<!ENTITY % index-see       "index-see"                               >
+<!ENTITY % index-see-also  "index-see-also"                          >
+<!ENTITY % index-sort-as   "index-sort-as"                           >
+
+
+<!-- ============================================================= -->
+<!--                    COMMON ATTLIST SETS                        -->
+<!-- ============================================================= -->
+
+
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS for IMAGEMAP          -->
+<!-- ============================================================= -->
+
+<!--                    LONG NAME: Index See                       -->
+<!ELEMENT index-see     (%words.cnt;|%indexterm;)*                   >
+<!ATTLIST index-see
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;                                             >
+
+<!--                    LONG NAME: Index See Also                  -->
+<!ELEMENT index-see-also
+                        (%words.cnt;|%indexterm;)*                   >
+<!ATTLIST index-see-also
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;                                             >
+
+<!--                    LONG NAME: Index Sort As                   -->
+<!ELEMENT index-sort-as (%words.cnt;)*                               >
+<!ATTLIST index-sort-as
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;                                             >
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+
+
+<!ATTLIST index-see       %global-atts; class CDATA "+ topic/index-base indexing-d/index-see ">
+<!ATTLIST index-see-also  %global-atts; class CDATA "+ topic/index-base indexing-d/index-see-also ">
+<!ATTLIST index-sort-as   %global-atts; class CDATA "+ topic/index-base indexing-d/index-sort-as ">
+ 
+<!-- ================== End Indexing Domain ====================== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/indexingDomain.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/indexingDomain.mod.rnc
new file mode 100644
index 0000000..5171b75
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/indexingDomain.mod.rnc
@@ -0,0 +1,116 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Indexing  Domain
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA Indexing Domain//EN"
+#       Delivered as file "indexingDomain.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the elements and specialization
+
+# attributes for the DITA Indexing Domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# June 2006
+
+#
+
+# (C) Copyright OASIS Open 2006.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+# =============================================================
+
+# COMMON ATTLIST SETS
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT DECLARATIONS for IMAGEMAP
+
+# =============================================================
+
+# LONG NAME: Index See
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+index-see.element =
+  element index-see { index-see.attlist, (words.cnt | indexterm)* }
+index-see.attlist &=
+  attribute keyref { text }?,
+  univ-atts
+# LONG NAME: Index See Also
+index-see-also.element =
+  element index-see-also {
+    index-see-also.attlist, (words.cnt | indexterm)*
+  }
+index-see-also.attlist &=
+  attribute keyref { text }?,
+  univ-atts
+# LONG NAME: Index Sort As
+index-sort-as.element =
+  element index-sort-as { index-sort-as.attlist, words.cnt* }
+index-sort-as.attlist &=
+  attribute keyref { text }?,
+  univ-atts
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+index-see.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/index-base indexing-d/index-see " ]
+  attribute class { text }?
+index-see-also.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/index-base indexing-d/index-see-also " ]
+  attribute class { text }?
+index-sort-as.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/index-base indexing-d/index-sort-as " ]
+  attribute class { text }?
+# ================== End Indexing Domain ======================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/map.dtd b/xml/tests/testData/xml/OasisDocumentHighlighting/map.dtd
new file mode 100644
index 0000000..d332a91
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/map.dtd
@@ -0,0 +1,115 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA MAP DTD                                      -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                        TYPICAL INVOCATION                     -->
+<!--                                                               -->
+<!-- Refer to this file by the following public identifier or an
+     appropriate system identifier:
+PUBLIC "-//OASIS//DTD DITA Map//EN"
+     Delivered as file "map.dtd"                                   -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    DTD to describe DITA maps                         -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Corrected public ID for map.mod            -->
+<!--    2005.11.15 RDA: Updated these comments to match template   -->
+<!--    2006.06.07 RDA: Added indexing domain                      -->
+<!--    2006.06.21 RDA: Added props attribute extensions           -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATIONS                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % mapgroup-d-dec 
+                        PUBLIC 
+"-//OASIS//ENTITIES DITA Map Group Domain//EN" 
+"mapGroup.ent"                                                       >
+%mapgroup-d-dec;
+
+<!ENTITY % indexing-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Indexing Domain//EN" 
+"indexingDomain.ent"                                                 >
+%indexing-d-dec;
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE DECLARATIONS              -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN EXTENSIONS                          -->
+<!-- ============================================================= -->
+<!--                    One for each extended base element, with
+                        the name of the domain(s) in which the
+                        extension was declared                     -->
+<!ENTITY % topicref     "topicref | (%mapgroup-d-topicref;)"         >
+<!ENTITY % index-base   "index-base | %indexing-d-index-base;"       >
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE EXTENSIONS                -->
+<!-- ============================================================= -->
+<!ENTITY % props-attribute-extensions  ""                            >
+<!ENTITY % base-attribute-extensions   ""                            >
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+<!--                    Must be declared ahead of the DTDs, which
+                        puts @domains first in order               -->
+
+<!ENTITY included-domains 
+                        "&mapgroup-d-att; &indexing-d-att;"          >
+
+<!-- ============================================================= -->
+<!--                    MAP ELEMENT INTEGRATION                    -->
+<!-- ============================================================= -->
+
+
+<!--                    Embed map to get generic elements          -->
+<!--    2005.11.15 RDA: Corrected public ID for map.mod. It was    -->
+<!--             "-//OASIS//Elements DITA Map Group Domain//EN"    -->
+<!ENTITY % map-type     PUBLIC 
+"-//OASIS//ELEMENTS DITA Map//EN" 
+"map.mod"                                                            >
+%map-type;
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ELEMENT INTEGRATION                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % mapgroup-d-def  
+                        PUBLIC 
+"-//OASIS//ELEMENTS DITA Map Group Domain//EN" 
+"mapGroup.mod"                                                       >
+%mapgroup-d-def;
+
+<!ENTITY % indexing-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Indexing Domain//EN" 
+"indexingDomain.mod"                                                 >
+%indexing-d-def;
+
+
+<!-- ================== End DITA Map DTD  ======================== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/map.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/map.mod
new file mode 100644
index 0000000..ea201f2
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/map.mod
@@ -0,0 +1,322 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Map                                          -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA Map//EN"
+      Delivered as file "map.mod"                                  -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the elements and specialization         -->
+<!--             attributes for the DITA Maps                      -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Corrected public ID in the comment above   -->
+<!--    2005.11.15 RDA: Removed old declaration for topicreftypes  -->
+<!--                      entity                                   -->
+<!--    2006.06.06 RDA: Removed default locktitle="yes" from       -->
+<!--                      %topicref-atts-no-toc;                   -->
+<!--                    Remove keyword declaration                 -->
+<!--                    Add reference to commonElements            -->
+<!--                    Add title element to map                   -->
+<!--                    Add data element to topicmeta              -->
+<!--                    Remove shortdesc declaration               -->
+<!--    2006.06.07 RDA: Make universal attributes universal        -->
+<!--                      (DITA 1.1 proposal #12)                  -->
+<!--    2006.06.14 RDA: Add dir attribute to localization-atts     -->
+<!--    2006.06.14 RDA: Add outputclass attribute to most elemetns -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                   ARCHITECTURE ENTITIES                       -->
+<!-- ============================================================= -->
+
+<!-- default namespace prefix for DITAArchVersion attribute can be
+     overridden through predefinition in the document type shell   -->
+<!ENTITY % DITAArchNSPrefix
+                       "ditaarch"                                    >
+
+<!-- must be instanced on each topic type                          -->
+<!ENTITY % arch-atts "
+             xmlns:%DITAArchNSPrefix; 
+                        CDATA                              #FIXED
+                       'http://dita.oasis-open.org/architecture/2005/'
+             %DITAArchNSPrefix;:DITAArchVersion
+                        CDATA                              #FIXED
+                       '1.1'"                                        >
+
+
+<!-- ============================================================= -->
+<!--                   ELEMENT NAME ENTITIES                       -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % map         "map"                                         >
+<!ENTITY % anchor      "anchor"                                      >
+<!ENTITY % linktext    "linktext"                                    >
+<!ENTITY % navref      "navref"                                      >
+<!ENTITY % relcell     "relcell"                                     >
+<!ENTITY % relcolspec  "relcolspec"                                  >
+<!ENTITY % relheader   "relheader"                                   >
+<!ENTITY % relrow      "relrow"                                      >
+<!ENTITY % reltable    "reltable"                                    >
+<!ENTITY % searchtitle "searchtitle"                                 >
+<!ENTITY % shortdesc   "shortdesc"                                   >
+<!ENTITY % topicmeta   "topicmeta"                                   >
+<!ENTITY % topicref    "topicref"                                    >
+
+
+<!-- ============================================================= -->
+<!--                    ENTITY DECLARATIONS FOR ATTRIBUTE VALUES   -->
+<!-- ============================================================= -->
+
+
+<!--                    DATE FORMAT                                -->
+<!-- Copied into metaDecl.mod -->
+<!--<!ENTITY % date-format  'CDATA'                               >-->
+
+
+<!-- ============================================================= -->
+<!--                    COMMON ATTLIST SETS                        -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % topicref-atts 
+            'collection-type 
+                        (choice | unordered | sequence | 
+                         family)                          #IMPLIED
+             type       CDATA                             #IMPLIED
+             scope      (local | peer | external)         #IMPLIED
+             locktitle  (yes|no)                          #IMPLIED
+             format     CDATA                             #IMPLIED
+             linking    (none | normal | sourceonly | targetonly)
+                                                          #IMPLIED
+             toc        (yes | no)                        #IMPLIED
+             print      (yes | no | printonly)            #IMPLIED
+             search     (yes | no)                        #IMPLIED
+             chunk      CDATA                             #IMPLIED'  >
+
+
+<!ENTITY % topicref-atts-no-toc 
+            'collection-type
+                        (choice | unordered | sequence | 
+                         family)                          #IMPLIED
+             type       CDATA                             #IMPLIED
+             scope      (local | peer | external)         #IMPLIED
+             locktitle  (yes|no)                          #IMPLIED
+             format     CDATA                             #IMPLIED
+             linking    (targetonly | sourceonly | 
+                         normal | none)                   #IMPLIED
+             toc        (yes | no)                        "no"
+             print      (yes | no | printonly)            #IMPLIED
+             search     (yes | no)                        #IMPLIED
+             chunk      CDATA                             #IMPLIED'  >
+
+
+
+<!-- ============================================================= -->
+<!--                    MODULES CALLS                              -->
+<!-- ============================================================= -->
+
+
+<!--                      Content elements common to map and topic -->
+<!ENTITY % commonElements      PUBLIC 
+"-//OASIS//ELEMENTS DITA Common Elements//EN" "commonElements.mod"   >
+%commonElements;
+
+<!--                      MetaData Elements                        -->
+<!ENTITY % metaXML      PUBLIC 
+"-//OASIS//ELEMENTS DITA Metadata//EN" "metaDecl.mod"                >
+%metaXML;
+  
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+
+<!ENTITY included-domains ""                                         >
+  
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+
+
+
+
+
+<!--                    LONG NAME: Map                             -->
+<!ELEMENT  map          ((%title;)?, (%topicmeta;)?, 
+                         (%navref;|%anchor;|%topicref;|%reltable;|
+                          %data.elements.incl;)* )                   >
+<!ATTLIST  map 
+             title      CDATA                             #IMPLIED
+             id         ID                                #IMPLIED
+             conref     CDATA                             #IMPLIED
+             anchorref  CDATA                             #IMPLIED
+             outputclass 
+                        CDATA                             #IMPLIED
+             %localization-atts;
+             %arch-atts;
+             domains    CDATA                  "&included-domains;" 
+             %topicref-atts;
+             %select-atts;                                           >
+
+
+<!--                    LONG NAME: Navigation Reference            -->
+<!ELEMENT  navref       EMPTY                                        >
+<!ATTLIST  navref
+             %univ-atts;
+             outputclass 
+                        CDATA                             #IMPLIED
+             mapref     CDATA                             #IMPLIED   >
+
+
+<!--                    LONG NAME: Topic Reference                 -->
+<!ELEMENT  topicref     ((%topicmeta;)?, 
+                         (%topicref; | %navref; | %anchor; |
+                          %data.elements.incl;)* )                   >
+<!ATTLIST  topicref
+             navtitle   CDATA                             #IMPLIED
+             href       CDATA                             #IMPLIED
+             keyref     CDATA                             #IMPLIED
+             query      CDATA                             #IMPLIED
+             copy-to    CDATA                             #IMPLIED
+             outputclass 
+                        CDATA                             #IMPLIED
+             %topicref-atts;
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Anchor                          -->
+<!ELEMENT  anchor       EMPTY                                        >
+<!ATTLIST  anchor
+             outputclass 
+                        CDATA                             #IMPLIED
+             %localization-atts;
+             id         ID                                #REQUIRED   
+             conref     CDATA                             #IMPLIED    
+             %select-atts;                                           >
+
+
+<!--                    LONG NAME: Relationship Table              -->
+<!ELEMENT  reltable     ((%topicmeta;)?, (%relheader;)?, 
+                         (%relrow;)+)                                >
+<!ATTLIST  reltable        
+             title      CDATA                             #IMPLIED
+             outputclass 
+                        CDATA                             #IMPLIED
+             %topicref-atts-no-toc;
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Relationship Header             -->
+<!ELEMENT  relheader    (%relcolspec;)+                              >
+<!ATTLIST  relheader
+             %univ-atts;                                             >        
+
+
+<!--                    LONG NAME: Relationship Column Specification
+                                                                   -->
+<!ELEMENT  relcolspec   (%topicmeta;)?                               >
+<!ATTLIST  relcolspec
+             outputclass 
+                        CDATA                             #IMPLIED
+             %topicref-atts;
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Relationship Table Row          -->
+<!ELEMENT relrow        (%relcell;)*                                 >
+<!ATTLIST relrow
+             outputclass 
+                        CDATA                             #IMPLIED
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Relationship Table Cell         -->
+<!ELEMENT relcell         ((%topicref;|%data.elements.incl;)*)>
+<!ATTLIST relcell
+             outputclass 
+                        CDATA                             #IMPLIED
+             %topicref-atts;
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Topic Metadata                  -->
+<!ELEMENT  topicmeta    ((%linktext;)?, (%searchtitle;)?, 
+                         (%shortdesc;)?, (%author;)*, (%source;)?, 
+                         (%publisher;)?, (%copyright;)*, 
+                         (%critdates;)?, (%permissions;)?, 
+                         (%audience;)*, (%category;)*, 
+                         (%keywords;)*, (%prodinfo;)*, (%othermeta;)*, 
+                         (%resourceid;)*, 
+                         (%data.elements.incl; | 
+                          %foreign.unknown.incl;)*)                  >
+<!ATTLIST  topicmeta
+             lockmeta   (yes | no)                        #IMPLIED
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Link Text                       -->
+<!ELEMENT  linktext     (%words.cnt;)*                               >
+<!ATTLIST  linktext
+             outputclass 
+                        CDATA                             #IMPLIED
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Search Title                    -->
+<!ELEMENT  searchtitle  (%words.cnt;)*                               >
+<!ATTLIST  searchtitle
+             outputclass 
+                        CDATA                             #IMPLIED
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Short Description               -->
+<!--<!ELEMENT  shortdesc    (%words.cnt;)*                        >-->
+         
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+
+
+<!ATTLIST map         %global-atts;  class CDATA "- map/map "        >
+<!ATTLIST navref      %global-atts;  class CDATA "- map/navref "     >
+<!ATTLIST topicref    %global-atts;  class CDATA "- map/topicref "   >
+<!ATTLIST anchor      %global-atts;  class CDATA "- map/anchor "     >
+<!ATTLIST reltable    %global-atts;  class CDATA "- map/reltable "   >
+<!ATTLIST relheader   %global-atts;  class CDATA "- map/relheader "  >
+<!ATTLIST relcolspec  %global-atts;  class CDATA "- map/relcolspec " >
+<!ATTLIST relrow      %global-atts;  class CDATA "- map/relrow "     >
+<!ATTLIST relcell     %global-atts;  class CDATA "- map/relcell "    >
+<!ATTLIST topicmeta   %global-atts;  class CDATA "- map/topicmeta "  >
+<!ATTLIST linktext    %global-atts;  class CDATA "- map/linktext "   >
+<!ATTLIST searchtitle %global-atts;  class CDATA "- map/searchtitle ">
+
+<!-- Shortdesc in topic uses topic/shortdesc so this one must be 
+     included, even though the element is common. -->
+<!ATTLIST shortdesc   %global-atts;  class CDATA "- map/shortdesc "  >
+
+
+<!-- ================== End DITA Map ============================= -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/map.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/map.mod.rnc
new file mode 100644
index 0000000..79228da
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/map.mod.rnc
@@ -0,0 +1,355 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Map
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA Map//EN"
+#       Delivered as file "map.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the elements and specialization
+
+# attributes for the DITA Maps
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Corrected public ID in the comment above
+
+# 2005.11.15 RDA: Removed old declaration for topicreftypes
+
+# entity
+
+# 2006.06.06 RDA: Removed default locktitle="yes" from
+
+# %topicref-atts-no-toc;
+
+# Remove keyword declaration
+
+# Add reference to commonElements
+
+# Add title element to map
+
+# Add data element to topicmeta
+
+# Remove shortdesc declaration
+
+# 2006.06.07 RDA: Make universal attributes universal
+
+# (DITA 1.1 proposal #12)
+
+# 2006.06.14 RDA: Add dir attribute to localization-atts
+
+# 2006.06.14 RDA: Add outputclass attribute to most elemetns
+
+# =============================================================
+
+# =============================================================
+
+# ARCHITECTURE ENTITIES
+
+# =============================================================
+
+# default namespace prefix for DITAArchVersion attribute can be
+# overridden through predefinition in the document type shell
+
+# must be instanced on each topic type
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+namespace ditaarch = "http://dita.oasis-open.org/architecture/2005/"
+
+arch-atts =
+  [ a:defaultValue = "1.1" ]
+  attribute ditaarch:DITAArchVersion { string "1.1" }?
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+anchor = anchor.element
+linktext = linktext.element
+navref = navref.element
+relcell = relcell.element
+relcolspec = relcolspec.element
+relheader = relheader.element
+relrow = relrow.element
+reltable = reltable.element
+searchtitle = searchtitle.element
+shortdesc = shortdesc.element
+topicmeta = topicmeta.element
+# =============================================================
+
+# ENTITY DECLARATIONS FOR ATTRIBUTE VALUES
+
+# =============================================================
+
+# DATE FORMAT
+
+# Copied into metaDecl.mod
+
+# <!ENTITY % date-format  'CDATA'                               >
+
+# =============================================================
+
+# COMMON ATTLIST SETS
+
+# =============================================================
+topicref-atts =
+  attribute collection-type {
+    "choice" | "unordered" | "sequence" | "family"
+  }?,
+  attribute type { text }?,
+  attribute scope { "local" | "peer" | "external" }?,
+  attribute locktitle { "yes" | "no" }?,
+  attribute format { text }?,
+  attribute linking {
+    "none" | "normal" | "sourceonly" | "targetonly"
+  }?,
+  attribute toc { "yes" | "no" }?,
+  attribute print { "yes" | "no" | "printonly" }?,
+  attribute search { "yes" | "no" }?,
+  attribute chunk { text }?
+topicref-atts-no-toc =
+  attribute collection-type {
+    "choice" | "unordered" | "sequence" | "family"
+  }?,
+  attribute type { text }?,
+  attribute scope { "local" | "peer" | "external" }?,
+  attribute locktitle { "yes" | "no" }?,
+  attribute format { text }?,
+  attribute linking {
+    "targetonly" | "sourceonly" | "normal" | "none"
+  }?,
+  [ a:defaultValue = "no" ] attribute toc { "yes" | "no" }?,
+  attribute print { "yes" | "no" | "printonly" }?,
+  attribute search { "yes" | "no" }?,
+  attribute chunk { text }?
+# =============================================================
+
+# MODULES CALLS
+
+# =============================================================
+
+# Content elements common to map and topic
+include "commonElements.mod.rnc"
+# MetaData Elements
+include "metaDecl.mod.rnc"
+# =============================================================
+
+# DOMAINS ATTRIBUTE OVERRIDE
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT DECLARATIONS
+
+# =============================================================
+
+# LONG NAME: Map
+map.element =
+  element map {
+    map.attlist,
+    title?,
+    topicmeta?,
+    (navref | anchor | topicref | reltable | data.elements.incl)*
+  }
+map.attlist &=
+  attribute title { text }?,
+  attribute id { xsd:ID }?,
+  attribute conref { text }?,
+  attribute anchorref { text }?,
+  attribute outputclass { text }?,
+  localization-atts,
+  arch-atts,
+  [ a:defaultValue = "(map mapgroup-d) (topic indexing-d)" ]
+  attribute domains { text }?,
+  topicref-atts,
+  select-atts
+# LONG NAME: Navigation Reference
+navref.element = element navref { navref.attlist, empty }
+navref.attlist &=
+  univ-atts,
+  attribute outputclass { text }?,
+  attribute mapref { text }?
+# LONG NAME: Topic Reference
+topicref.element =
+  element topicref {
+    topicref.attlist,
+    topicmeta?,
+    (topicref | navref | anchor | data.elements.incl)*
+  }
+topicref.attlist &=
+  attribute navtitle { text }?,
+  attribute href { text }?,
+  attribute keyref { text }?,
+  attribute query { text }?,
+  attribute copy-to { text }?,
+  attribute outputclass { text }?,
+  topicref-atts,
+  univ-atts
+# LONG NAME: Anchor
+anchor.element = element anchor { anchor.attlist, empty }
+anchor.attlist &=
+  attribute outputclass { text }?,
+  localization-atts,
+  attribute id { xsd:ID },
+  attribute conref { text }?,
+  select-atts
+# LONG NAME: Relationship Table
+reltable.element =
+  element reltable { reltable.attlist, topicmeta?, relheader?, relrow+ }
+reltable.attlist &=
+  attribute title { text }?,
+  attribute outputclass { text }?,
+  topicref-atts-no-toc,
+  univ-atts
+# LONG NAME: Relationship Header
+relheader.element = element relheader { relheader.attlist, relcolspec+ }
+relheader.attlist &= univ-atts
+# LONG NAME: Relationship Column Specification
+relcolspec.element =
+  element relcolspec { relcolspec.attlist, topicmeta? }
+relcolspec.attlist &=
+  attribute outputclass { text }?,
+  topicref-atts,
+  univ-atts
+# LONG NAME: Relationship Table Row
+relrow.element = element relrow { relrow.attlist, relcell* }
+relrow.attlist &=
+  attribute outputclass { text }?,
+  univ-atts
+# LONG NAME: Relationship Table Cell
+relcell.element =
+  element relcell { relcell.attlist, (topicref | data.elements.incl)* }
+relcell.attlist &=
+  attribute outputclass { text }?,
+  topicref-atts,
+  univ-atts
+# LONG NAME: Topic Metadata
+topicmeta.element =
+  element topicmeta {
+    topicmeta.attlist,
+    linktext?,
+    searchtitle?,
+    shortdesc?,
+    author*,
+    source?,
+    publisher?,
+    copyright*,
+    critdates?,
+    permissions?,
+    audience*,
+    category*,
+    keywords*,
+    prodinfo*,
+    othermeta*,
+    resourceid*,
+    (data.elements.incl | foreign.unknown.incl)*
+  }
+topicmeta.attlist &=
+  attribute lockmeta { "yes" | "no" }?,
+  univ-atts
+# LONG NAME: Link Text
+linktext.element = element linktext { linktext.attlist, words.cnt* }
+linktext.attlist &=
+  attribute outputclass { text }?,
+  univ-atts
+# LONG NAME: Search Title
+searchtitle.element =
+  element searchtitle { searchtitle.attlist, words.cnt* }
+searchtitle.attlist &=
+  attribute outputclass { text }?,
+  univ-atts
+# LONG NAME: Short Description
+
+# <!ELEMENT  shortdesc    (%words.cnt;)*                        >
+
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+map.attlist &=
+  global-atts,
+  [ a:defaultValue = "- map/map " ] attribute class { text }?
+navref.attlist &=
+  global-atts,
+  [ a:defaultValue = "- map/navref " ] attribute class { text }?
+topicref.attlist &=
+  global-atts,
+  [ a:defaultValue = "- map/topicref " ] attribute class { text }?
+anchor.attlist &=
+  global-atts,
+  [ a:defaultValue = "- map/anchor " ] attribute class { text }?
+reltable.attlist &=
+  global-atts,
+  [ a:defaultValue = "- map/reltable " ] attribute class { text }?
+relheader.attlist &=
+  global-atts,
+  [ a:defaultValue = "- map/relheader " ] attribute class { text }?
+relcolspec.attlist &=
+  global-atts,
+  [ a:defaultValue = "- map/relcolspec " ] attribute class { text }?
+relrow.attlist &=
+  global-atts,
+  [ a:defaultValue = "- map/relrow " ] attribute class { text }?
+relcell.attlist &=
+  global-atts,
+  [ a:defaultValue = "- map/relcell " ] attribute class { text }?
+topicmeta.attlist &=
+  global-atts,
+  [ a:defaultValue = "- map/topicmeta " ] attribute class { text }?
+linktext.attlist &=
+  global-atts,
+  [ a:defaultValue = "- map/linktext " ] attribute class { text }?
+searchtitle.attlist &=
+  global-atts,
+  [ a:defaultValue = "- map/searchtitle " ] attribute class { text }?
+# Shortdesc in topic uses topic/shortdesc so this one must be 
+# included, even though the element is common.
+shortdesc.attlist &=
+  global-atts,
+  [ a:defaultValue = "- map/shortdesc " ] attribute class { text }?
+# ================== End DITA Map =============================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/map.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/map.rnc
new file mode 100644
index 0000000..cce03e1
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/map.rnc
@@ -0,0 +1,133 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA MAP DTD
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an
+#      appropriate system identifier:
+# PUBLIC "-//OASIS//DTD DITA Map//EN"
+#      Delivered as file "map.dtd"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    DTD to describe DITA maps
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Corrected public ID for map.mod
+
+# 2005.11.15 RDA: Updated these comments to match template
+
+# 2006.06.07 RDA: Added indexing domain
+
+# 2006.06.21 RDA: Added props attribute extensions
+
+# =============================================================
+
+# =============================================================
+
+# DOMAIN ENTITY DECLARATIONS
+
+# =============================================================
+
+include "mapGroup.ent.rnc"
+include "indexingDomain.ent.rnc"
+# =============================================================
+
+# DOMAIN ATTRIBUTE DECLARATIONS
+
+# =============================================================
+
+# =============================================================
+
+# DOMAIN EXTENSIONS
+
+# =============================================================
+
+# One for each extended base element, with
+# the name of the domain(s) in which the
+# extension was declared
+topicref = topicref.element | mapgroup-d-topicref
+index-base = index-base.element | indexing-d-index-base
+# =============================================================
+
+# DOMAIN ATTRIBUTE EXTENSIONS
+
+# =============================================================
+props-attribute-extensions = empty
+base-attribute-extensions = empty
+# =============================================================
+
+# DOMAINS ATTRIBUTE OVERRIDE
+
+# =============================================================
+
+# Must be declared ahead of the DTDs, which
+# puts @domains first in order
+
+# =============================================================
+
+# MAP ELEMENT INTEGRATION
+
+# =============================================================
+
+# Embed map to get generic elements
+
+# 2005.11.15 RDA: Corrected public ID for map.mod. It was
+
+# "-//OASIS//Elements DITA Map Group Domain//EN"
+include "map.mod.rnc"
+# =============================================================
+
+# DOMAIN ELEMENT INTEGRATION
+
+# =============================================================
+include "mapGroup.mod.rnc"
+include "indexingDomain.mod.rnc"
+start = map.element
+any =
+  (element * {
+     attribute * { text }*,
+     any
+   }
+   | text)*
+# ================== End DITA Map DTD  ========================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/mapGroup.ent b/xml/tests/testData/xml/OasisDocumentHighlighting/mapGroup.ent
new file mode 100644
index 0000000..b9708a64
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/mapGroup.ent
@@ -0,0 +1,51 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Map Group Domain Entities                    -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ENTITIES DITA Map Group Domain//EN"
+      Delivered as file "mapGroup.ent"                             -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the substitution context and domain     -->
+<!--             entity declarations for the map group domain      -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    ELEMENT EXTENSION ENTITY DECLARATIONS      -->
+<!-- ============================================================= -->
+
+<!ENTITY % mapgroup-d-topicref 
+                        "topichead | topicgroup"                     >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATION                  -->
+<!-- ============================================================= -->
+
+<!ENTITY mapgroup-d-att "(map mapgroup-d)"                           >
+
+
+<!-- ================== End Map Group Domain Entities ============ -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/mapGroup.ent.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/mapGroup.ent.rnc
new file mode 100644
index 0000000..ce4725d
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/mapGroup.ent.rnc
@@ -0,0 +1,75 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Map Group Domain Entities
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ENTITIES DITA Map Group Domain//EN"
+#       Delivered as file "mapGroup.ent"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the substitution context and domain
+
+# entity declarations for the map group domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT EXTENSION ENTITY DECLARATIONS
+
+# =============================================================
+
+mapgroup-d-topicref = topichead.element | topicgroup.element
+# =============================================================
+
+# DOMAIN ENTITY DECLARATION
+
+# =============================================================
+
+# ================== End Map Group Domain Entities ============
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/mapGroup.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/mapGroup.mod
new file mode 100644
index 0000000..04d2aa3
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/mapGroup.mod
@@ -0,0 +1,83 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Map Group Domain                             -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA Map Group Domain//EN"
+      Delivered as file "mapGroup.mod"                             -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Define elements and specialization attributes     -->
+<!--             for Map Group Domain                              -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!--    2006.06.07 RDA: Make universal attributes universal        -->
+<!--                      (DITA 1.1 proposal #12)                  -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT NAME ENTITIES                      -->
+<!-- ============================================================= -->
+
+<!ENTITY % topichead    "topichead"                                  >
+<!ENTITY % topicgroup   "topicgroup"                                 >
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+
+
+<!--                    LONG NAME: Topic Head                      -->
+<!ELEMENT topichead     ((%topicmeta;)?, 
+                          (%topicref; | %navref; | %anchor; | 
+                           %data.elements.incl;)* )                  >
+<!ATTLIST topichead
+             navtitle   CDATA                            #REQUIRED
+             outputclass 
+                        CDATA                            #IMPLIED
+             %topicref-atts;
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Topic Group                     -->
+<!ELEMENT topicgroup    ((%topicmeta;)?, 
+                         (%topicref; | %navref; | %anchor; | 
+                          %data.elements.incl;)* )                   >
+<!ATTLIST topicgroup
+             outputclass 
+                        CDATA                            #IMPLIED
+             %topicref-atts;
+             %univ-atts;                                             >
+
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+
+<!ATTLIST topichead     %global-atts;  class CDATA "+ map/topicref mapgroup-d/topichead ">
+<!ATTLIST topicgroup    %global-atts;  class CDATA "+ map/topicref mapgroup-d/topicgroup ">
+
+
+<!-- ================== DITA Map Group Domain  =================== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/mapGroup.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/mapGroup.mod.rnc
new file mode 100644
index 0000000..83ef515
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/mapGroup.mod.rnc
@@ -0,0 +1,117 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Map Group Domain
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA Map Group Domain//EN"
+#       Delivered as file "mapGroup.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Define elements and specialization attributes
+
+# for Map Group Domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# 2006.06.07 RDA: Make universal attributes universal
+
+# (DITA 1.1 proposal #12)
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT DECLARATIONS
+
+# =============================================================
+
+# LONG NAME: Topic Head
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+topichead.element =
+  element topichead {
+    topichead.attlist,
+    topicmeta?,
+    (topicref | navref | anchor | data.elements.incl)*
+  }
+topichead.attlist &=
+  attribute navtitle { text },
+  attribute outputclass { text }?,
+  topicref-atts,
+  univ-atts
+# LONG NAME: Topic Group
+topicgroup.element =
+  element topicgroup {
+    topicgroup.attlist,
+    topicmeta?,
+    (topicref | navref | anchor | data.elements.incl)*
+  }
+topicgroup.attlist &=
+  attribute outputclass { text }?,
+  topicref-atts,
+  univ-atts
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+topichead.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ map/topicref mapgroup-d/topichead " ]
+  attribute class { text }?
+topicgroup.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ map/topicref mapgroup-d/topicgroup " ]
+  attribute class { text }?
+# ================== DITA Map Group Domain  ===================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/metaDecl.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/metaDecl.mod
new file mode 100644
index 0000000..56006a0
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/metaDecl.mod
@@ -0,0 +1,277 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Metadata                                     -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ENTITIES DITA Metadata//EN"
+      Delivered as file "metaDecl.mod"                             -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the elements and specialization         -->
+<!--             attributes for the DITA XML Metadata              -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!--    2006.06.06 RDA: Move indexterm into commonElements         -->
+<!--    2006.06.07 RDA: Make universal attributes universal        -->
+<!--                      (DITA 1.1 proposal #12)                  -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT NAME ENTITIES                      -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % date-format 'CDATA'                                       >
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+
+<!--                    LONG NAME: Author                          -->
+<!ELEMENT author        (%words.cnt;)*                               >
+<!ATTLIST author 
+             %univ-atts;
+             href       CDATA                            #IMPLIED
+             keyref     CDATA                            #IMPLIED
+             type       (creator | contributor)          #IMPLIED    >
+
+
+<!--                     LONG NAME: Source                         -->
+<!ELEMENT source       (%words.cnt;)*                                >
+<!ATTLIST source 
+             %univ-atts;
+             href       CDATA                            #IMPLIED
+             keyref     CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Publisher                       -->
+<!ELEMENT publisher     (%words.cnt;)*                               >
+<!ATTLIST publisher
+             href       CDATA                            #IMPLIED
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Copyright                       -->
+<!ELEMENT copyright     ((%copyryear;)+, %copyrholder;)              >
+<!ATTLIST copyright 
+             %univ-atts;
+             type      (primary | secondary)             #IMPLIED    >
+
+
+<!--                    LONG NAME: Copyright Year                  -->
+<!ELEMENT copyryear     EMPTY                                        >
+<!ATTLIST copyryear
+             year       %date-format;                    #REQUIRED
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Copyright Holder                -->
+<!ELEMENT copyrholder   (%words.cnt;)*                               >
+<!ATTLIST copyrholder
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Critical Dates                  -->
+<!ELEMENT critdates     (%created;, (%revised;)*)                    >
+<!ATTLIST critdates
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Created Date                    -->
+<!ELEMENT created       EMPTY                                        >
+<!ATTLIST created 
+             %univ-atts;
+             date       %date-format;                    #REQUIRED
+             golive     %date-format;                    #IMPLIED
+             expiry     %date-format;                    #IMPLIED    >
+
+
+<!--                    LONG NAME: Revised Date                    -->
+<!ELEMENT revised       EMPTY                                        >
+<!ATTLIST revised  
+             modified   %date-format;                    #REQUIRED
+             golive     %date-format;                    #IMPLIED
+             expiry     %date-format;                    #IMPLIED
+             %univ-atts;                                             >
+
+
+<!--                     LONG NAME: Permissions                    -->
+<!ELEMENT permissions  EMPTY                                         >
+<!ATTLIST permissions
+             %univ-atts;
+             view       (internal | classified | all | 
+                         entitled)                       #REQUIRED   >
+
+
+<!--                    LONG NAME: Category                        -->
+<!ELEMENT category      (%words.cnt;)*                               >
+<!ATTLIST category     
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Audience                        -->
+<!ELEMENT audience      EMPTY                                        >
+<!ATTLIST audience
+             type       (user | purchaser | administrator |
+                        programmer | executive | services |
+                        other)                           #IMPLIED
+             othertype  CDATA                            #IMPLIED
+             job        (installing | customizing | 
+                         administering | programming |
+                         using| maintaining | troubleshooting |
+                         evaluating | planning | migrating |
+                         other)                          #IMPLIED
+             otherjob    CDATA                           #IMPLIED
+             experiencelevel
+                         (novice | general | expert)     #IMPLIED
+             name        NMTOKEN                         #IMPLIED
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Keywords                        -->
+<!ELEMENT keywords      (%indexterm; | %keyword;)*                   >
+<!ATTLIST keywords
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Product Information             -->
+<!ELEMENT prodinfo      ((%prodname;), (%vrmlist;),
+                         (%brand; | %series; | %platform; | 
+                          %prognum; | %featnum; | %component;)* )    >
+<!ATTLIST prodinfo
+             %univ-atts;                                             >                                     
+
+
+<!--                    LONG NAME: Product Name                    -->
+<!ELEMENT prodname      (%words.cnt;)*                               > 
+<!ATTLIST prodname
+             %univ-atts;                                             >                                     
+
+
+<!--                    LONG NAME: Version Release and Modification
+                                   List                            -->
+<!ELEMENT vrmlist       (%vrm;)+                                     >
+<!ATTLIST vrmlist
+             %univ-atts;                                             >                                     
+
+
+<!--                    LONG NAME: Version Release and Modification-->
+<!ELEMENT vrm           EMPTY                                        >
+<!ATTLIST vrm
+             %univ-atts;               
+             version    CDATA                            #REQUIRED
+             release    CDATA                            #IMPLIED
+             modification 
+                        CDATA                            #IMPLIED    >
+             
+<!--                    LONG NAME: Brand                           -->
+<!ELEMENT brand         (%words.cnt;)*                               >
+<!ATTLIST brand
+             %univ-atts;                                             >                                     
+
+
+<!--                    LONG NAME: Series                          -->
+<!ELEMENT series        (%words.cnt;)*                               >
+<!ATTLIST series
+             %univ-atts;                                             >                                     
+
+
+<!--                    LONG NAME: Platform                        -->
+<!ELEMENT platform      (%words.cnt;)*                               >
+<!ATTLIST platform
+             %univ-atts;                                             >                                     
+
+
+<!--                    LONG NAME: Program Number                  -->
+<!ELEMENT prognum       (%words.cnt;)*                               >
+<!ATTLIST prognum
+             %univ-atts;                                             >                                     
+
+
+<!--                    LONG NAME: Feature Number                  -->
+<!ELEMENT featnum       (%words.cnt;)*                               >
+<!ATTLIST featnum
+             %univ-atts;                                             >                                     
+
+
+<!--                    LONG NAME: Component                       -->
+<!ELEMENT component     (%words.cnt;)*                               >
+<!ATTLIST component
+             %univ-atts;                                             >                                     
+
+
+<!--                    LONG NAME: Other Metadata                  -->
+<!--                    NOTE: needs to be HTML-equiv, at least     -->
+<!ELEMENT othermeta     EMPTY                                        >
+<!ATTLIST othermeta 
+             name       CDATA                            #REQUIRED
+             content    CDATA                            #REQUIRED
+             translate-content
+                        (yes | no)                       #IMPLIED
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Resource Identifier             -->
+<!ELEMENT resourceid    EMPTY                                        >
+<!ATTLIST resourceid
+             %select-atts;
+             %localization-atts;
+             id         CDATA                            #REQUIRED
+             conref     CDATA                            #IMPLIED
+             appname    CDATA                            #IMPLIED    >
+
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+             
+
+<!ATTLIST author      %global-atts;  class CDATA "- topic/author "      >
+<!ATTLIST source      %global-atts;  class CDATA "- topic/source "      >
+<!ATTLIST publisher   %global-atts;  class CDATA "- topic/publisher "   >
+<!ATTLIST copyright   %global-atts;  class CDATA "- topic/copyright "   >
+<!ATTLIST copyryear   %global-atts;  class CDATA "- topic/copyryear "   >
+<!ATTLIST copyrholder %global-atts;  class CDATA "- topic/copyrholder " >
+<!ATTLIST critdates   %global-atts;  class CDATA "- topic/critdates "   >
+<!ATTLIST created     %global-atts;  class CDATA "- topic/created "     >
+<!ATTLIST revised     %global-atts;  class CDATA "- topic/revised "     >
+<!ATTLIST permissions %global-atts;  class CDATA "- topic/permissions " >
+<!ATTLIST category    %global-atts;  class CDATA "- topic/category "    >
+<!ATTLIST audience    %global-atts;  class CDATA "- topic/audience "    >
+<!ATTLIST keywords    %global-atts;  class CDATA "- topic/keywords "    >
+<!ATTLIST prodinfo    %global-atts;  class CDATA "- topic/prodinfo "    >
+<!ATTLIST prodname    %global-atts;  class CDATA "- topic/prodname "    >
+<!ATTLIST vrmlist     %global-atts;  class CDATA "- topic/vrmlist "     >
+<!ATTLIST vrm         %global-atts;  class CDATA "- topic/vrm "         >
+<!ATTLIST brand       %global-atts;  class CDATA "- topic/brand "       >
+<!ATTLIST series      %global-atts;  class CDATA "- topic/series "      >
+<!ATTLIST platform    %global-atts;  class CDATA "- topic/platform "    >
+<!ATTLIST prognum     %global-atts;  class CDATA "- topic/prognum "     >
+<!ATTLIST featnum     %global-atts;  class CDATA "- topic/featnum "     >
+<!ATTLIST component   %global-atts;  class CDATA "- topic/component "   >
+<!ATTLIST othermeta   %global-atts;  class CDATA "- topic/othermeta "   >
+<!ATTLIST resourceid  %global-atts;  class CDATA "- topic/resourceid "  >
+
+<!-- ================== End Metadata  ================================ -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/metaDecl.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/metaDecl.mod.rnc
new file mode 100644
index 0000000..bbc0213
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/metaDecl.mod.rnc
@@ -0,0 +1,315 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Metadata
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ENTITIES DITA Metadata//EN"
+#       Delivered as file "metaDecl.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the elements and specialization
+
+# attributes for the DITA XML Metadata
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# 2006.06.06 RDA: Move indexterm into commonElements
+
+# 2006.06.07 RDA: Make universal attributes universal
+
+# (DITA 1.1 proposal #12)
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+date-format = string
+# =============================================================
+
+# ELEMENT DECLARATIONS
+
+# =============================================================
+
+# LONG NAME: Author
+author.element = element author { author.attlist, words.cnt* }
+author.attlist &=
+  univ-atts,
+  attribute href { text }?,
+  attribute keyref { text }?,
+  attribute type { "creator" | "contributor" }?
+# LONG NAME: Source
+source.element = element source { source.attlist, words.cnt* }
+source.attlist &=
+  univ-atts,
+  attribute href { text }?,
+  attribute keyref { text }?
+# LONG NAME: Publisher
+publisher.element = element publisher { publisher.attlist, words.cnt* }
+publisher.attlist &=
+  attribute href { text }?,
+  attribute keyref { text }?,
+  univ-atts
+# LONG NAME: Copyright
+copyright.element =
+  element copyright { copyright.attlist, copyryear+, copyrholder }
+copyright.attlist &=
+  univ-atts,
+  attribute type { "primary" | "secondary" }?
+# LONG NAME: Copyright Year
+copyryear.element = element copyryear { copyryear.attlist, empty }
+copyryear.attlist &=
+  attribute year { date-format },
+  univ-atts
+# LONG NAME: Copyright Holder
+copyrholder.element =
+  element copyrholder { copyrholder.attlist, words.cnt* }
+copyrholder.attlist &= univ-atts
+# LONG NAME: Critical Dates
+critdates.element =
+  element critdates { critdates.attlist, created, revised* }
+critdates.attlist &= univ-atts
+# LONG NAME: Created Date
+created.element = element created { created.attlist, empty }
+created.attlist &=
+  univ-atts,
+  attribute date { date-format },
+  attribute golive { date-format }?,
+  attribute expiry { date-format }?
+# LONG NAME: Revised Date
+revised.element = element revised { revised.attlist, empty }
+revised.attlist &=
+  attribute modified { date-format },
+  attribute golive { date-format }?,
+  attribute expiry { date-format }?,
+  univ-atts
+# LONG NAME: Permissions
+permissions.element = element permissions { permissions.attlist, empty }
+permissions.attlist &=
+  univ-atts,
+  attribute view { "internal" | "classified" | "all" | "entitled" }
+# LONG NAME: Category
+category.element = element category { category.attlist, words.cnt* }
+category.attlist &= univ-atts
+# LONG NAME: Audience
+audience.element = element audience { audience.attlist, empty }
+audience.attlist &=
+  attribute type {
+    "user"
+    | "purchaser"
+    | "administrator"
+    | "programmer"
+    | "executive"
+    | "services"
+    | "other"
+  }?,
+  attribute othertype { text }?,
+  attribute job {
+    "installing"
+    | "customizing"
+    | "administering"
+    | "programming"
+    | "using"
+    | "maintaining"
+    | "troubleshooting"
+    | "evaluating"
+    | "planning"
+    | "migrating"
+    | "other"
+  }?,
+  attribute otherjob { text }?,
+  attribute experiencelevel { "novice" | "general" | "expert" }?,
+  attribute name { xsd:NMTOKEN }?,
+  univ-atts
+# LONG NAME: Keywords
+keywords.element =
+  element keywords { keywords.attlist, (indexterm | keyword)* }
+keywords.attlist &= univ-atts
+# LONG NAME: Product Information
+prodinfo.element =
+  element prodinfo {
+    prodinfo.attlist,
+    prodname,
+    vrmlist,
+    (brand | series | platform | prognum | featnum | component)*
+  }
+prodinfo.attlist &= univ-atts
+# LONG NAME: Product Name
+prodname.element = element prodname { prodname.attlist, words.cnt* }
+prodname.attlist &= univ-atts
+# LONG NAME: Version Release and Modification
+# List
+vrmlist.element = element vrmlist { vrmlist.attlist, vrm+ }
+vrmlist.attlist &= univ-atts
+#                     LONG NAME: Version Release and Modification
+vrm.element = element vrm { vrm.attlist, empty }
+vrm.attlist &=
+  univ-atts,
+  attribute version { text },
+  attribute release { text }?,
+  attribute modification { text }?
+# LONG NAME: Brand
+brand.element = element brand { brand.attlist, words.cnt* }
+brand.attlist &= univ-atts
+# LONG NAME: Series
+series.element = element series { series.attlist, words.cnt* }
+series.attlist &= univ-atts
+# LONG NAME: Platform
+platform.element = element platform { platform.attlist, words.cnt* }
+platform.attlist &= univ-atts
+# LONG NAME: Program Number
+prognum.element = element prognum { prognum.attlist, words.cnt* }
+prognum.attlist &= univ-atts
+# LONG NAME: Feature Number
+featnum.element = element featnum { featnum.attlist, words.cnt* }
+featnum.attlist &= univ-atts
+# LONG NAME: Component
+component.element = element component { component.attlist, words.cnt* }
+component.attlist &= univ-atts
+# LONG NAME: Other Metadata
+
+# NOTE: needs to be HTML-equiv, at least
+othermeta.element = element othermeta { othermeta.attlist, empty }
+othermeta.attlist &=
+  attribute name { text },
+  attribute content { text },
+  attribute translate-content { "yes" | "no" }?,
+  univ-atts
+# LONG NAME: Resource Identifier
+resourceid.element = element resourceid { resourceid.attlist, empty }
+resourceid.attlist &=
+  select-atts,
+  localization-atts,
+  attribute id { text },
+  attribute conref { text }?,
+  attribute appname { text }?
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+author.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/author " ] attribute class { text }?
+source.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/source " ] attribute class { text }?
+publisher.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/publisher " ] attribute class { text }?
+copyright.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/copyright " ] attribute class { text }?
+copyryear.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/copyryear " ] attribute class { text }?
+copyrholder.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/copyrholder " ] attribute class { text }?
+critdates.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/critdates " ] attribute class { text }?
+created.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/created " ] attribute class { text }?
+revised.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/revised " ] attribute class { text }?
+permissions.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/permissions " ] attribute class { text }?
+category.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/category " ] attribute class { text }?
+audience.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/audience " ] attribute class { text }?
+keywords.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/keywords " ] attribute class { text }?
+prodinfo.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/prodinfo " ] attribute class { text }?
+prodname.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/prodname " ] attribute class { text }?
+vrmlist.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/vrmlist " ] attribute class { text }?
+vrm.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/vrm " ] attribute class { text }?
+brand.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/brand " ] attribute class { text }?
+series.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/series " ] attribute class { text }?
+platform.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/platform " ] attribute class { text }?
+prognum.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/prognum " ] attribute class { text }?
+featnum.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/featnum " ] attribute class { text }?
+component.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/component " ] attribute class { text }?
+othermeta.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/othermeta " ] attribute class { text }?
+resourceid.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/resourceid " ] attribute class { text }?
+# ================== End Metadata  ================================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/programmingDomain.ent b/xml/tests/testData/xml/OasisDocumentHighlighting/programmingDomain.ent
new file mode 100644
index 0000000..f5b5f7b
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/programmingDomain.ent
@@ -0,0 +1,55 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Programming Domain Entities                  -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      November 2005                                     -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ENTITIES DITA Programming Domain//EN"
+      Delivered as file "programmingDomain.ent"                    -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the substitution context and domain     -->
+<!--             entity declarations for the programming domain    -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Updated these comments to match template   -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    ELEMENT EXTENSION ENTITY DECLARATIONS      -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % pr-d-ph      "codeph | synph"                             >
+<!ENTITY % pr-d-pre     "codeblock"                                  >
+<!ENTITY % pr-d-keyword "option | parmname | apiname"                >
+<!ENTITY % pr-d-fig     "syntaxdiagram"                              >
+<!ENTITY % pr-d-dl      "parml"                                      >
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATION                  -->
+<!-- ============================================================= -->
+
+
+<!ENTITY pr-d-att "(topic pr-d)">
+
+<!-- ================== End Programming Domain Entities ========== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/programmingDomain.ent.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/programmingDomain.ent.rnc
new file mode 100644
index 0000000..db75cfa
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/programmingDomain.ent.rnc
@@ -0,0 +1,81 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Programming Domain Entities
+
+# VERSION:   1.1
+
+# DATE:      November 2005
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ENTITIES DITA Programming Domain//EN"
+#       Delivered as file "programmingDomain.ent"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the substitution context and domain
+
+# entity declarations for the programming domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Updated these comments to match template
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT EXTENSION ENTITY DECLARATIONS
+
+# =============================================================
+
+pr-d-ph = codeph.element | synph.element
+pr-d-pre = codeblock.element
+pr-d-keyword = option.element | parmname.element | apiname.element
+pr-d-fig = syntaxdiagram.element
+pr-d-dl = parml.element
+# =============================================================
+
+# DOMAIN ENTITY DECLARATION
+
+# =============================================================
+
+# ================== End Programming Domain Entities ==========
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/programmingDomain.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/programmingDomain.mod
new file mode 100644
index 0000000..0775934
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/programmingDomain.mod
@@ -0,0 +1,381 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA DITA Programming Domain                      -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA Programming Domain//EN"
+      Delivered as file "programmingDomain.mod"                    -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the elements and specialization         -->
+<!--             attributes for the Programming Domain             -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Updated these comments to match template   -->
+<!--    2005.11.15 RDA: Corrected Long Names for syntax groups,    -->
+<!--                    codeph, and kwd                            -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!--    2006.06.07 RDA: Make universal attributes universal        -->
+<!--                      (DITA 1.1 proposal #12)                  -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT NAME ENTITIES                      -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % apiname      "apiname"                                    >
+<!ENTITY % codeblock    "codeblock"                                  >
+<!ENTITY % codeph       "codeph"                                     >
+<!ENTITY % delim        "delim"                                      >
+<!ENTITY % kwd          "kwd"                                        >
+<!ENTITY % oper         "oper"                                       >
+<!ENTITY % option       "option"                                     >
+<!ENTITY % parmname     "parmname"                                   >
+<!ENTITY % sep          "sep"                                        >
+<!ENTITY % synph        "synph"                                      >
+<!ENTITY % var          "var"                                        >
+
+<!ENTITY % parml        "parml"                                      >
+<!ENTITY % pd           "pd"                                         >
+<!ENTITY % plentry      "plentry"                                    >
+<!ENTITY % pt           "pt"                                         >
+
+<!ENTITY % fragment     "fragment"                                   >
+<!ENTITY % fragref      "fragref"                                    >
+<!ENTITY % groupchoice  "groupchoice"                                >
+<!ENTITY % groupcomp    "groupcomp"                                  >
+<!ENTITY % groupseq     "groupseq"                                   >
+<!ENTITY % repsep       "repsep"                                     >
+<!ENTITY % synblk       "synblk"                                     >
+<!ENTITY % synnote      "synnote"                                    >
+<!ENTITY % synnoteref   "synnoteref"                                 >
+<!ENTITY % syntaxdiagram 
+                        "syntaxdiagram"                              >
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+
+
+<!--                    LONG NAME: Universal Attributes Local
+                                   Importance                      -->
+<!--                    Povide an alternative set of univ-atts that 
+                        allows importance to be redefined locally  -->
+<!ENTITY % univ-atts-no-importance
+            '%id-atts;
+             %filter-atts;
+             rev        CDATA                            #IMPLIED
+             status     (new | changed | deleted |
+                         unchanged)                      #IMPLIED
+             %localization-atts;                                 '   > 
+
+
+<!--                    LONG NAME: Code Phrase                     -->
+<!ELEMENT codeph        (#PCDATA | %basic.ph.notm; | 
+                         %data.elements.incl; | 
+                         %foreign.unknown.incl;)*                    >
+<!ATTLIST codeph      
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Code Block                      -->
+<!ELEMENT codeblock     (#PCDATA | %basic.ph.notm; | %txt.incl; |
+                         %data.elements.incl; | 
+                         %foreign.unknown.incl;)*                    >
+<!ATTLIST codeblock       
+             %display-atts;
+             spectitle  CDATA                            #IMPLIED
+             xml:space  (preserve)                  #FIXED 'preserve'
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Option                          -->
+<!ELEMENT option         (#PCDATA)>
+<!ATTLIST  option          keyref CDATA #IMPLIED
+                          %univ-atts;
+                          outputclass CDATA #IMPLIED                 >
+
+
+<!--                    LONG NAME: Variable                        -->
+<!ELEMENT var           (%words.cnt;)*                               >
+<!ATTLIST var         
+             importance (optional | required | default)  #IMPLIED
+             %univ-atts-no-importance;                             
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Parameter Name                  -->
+<!ELEMENT parmname      (#PCDATA)                                    >
+<!ATTLIST  parmname        
+             keyref      CDATA #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Syntax Phrase                   -->
+<!ELEMENT synph         (#PCDATA | %codeph; | %option; | %parmname; |
+                         %var; | %kwd; | %oper; | %delim; | %sep; | 
+                         %synph;)*                                   >
+<!ATTLIST  synph   
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Operator                        -->
+<!ELEMENT oper          (%words.cnt;)*                               >
+<!ATTLIST oper            
+             importance (optional | required | default)   #IMPLIED
+             %univ-atts-no-importance;                             
+             outputclass 
+                        CDATA                             #IMPLIED   >
+
+
+<!--                    LONG NAME: Delimiter                       -->
+<!ELEMENT delim         (%words.cnt;)*                               >
+<!ATTLIST delim           
+             importance   (optional | required)           #IMPLIED
+             %univ-atts-no-importance;
+             outputclass
+                        CDATA                             #IMPLIED   >
+
+
+<!--                    LONG NAME: Separator                       -->
+<!ELEMENT sep           (%words.cnt;)*                               >
+<!ATTLIST sep             
+             importance (optional | required)            #IMPLIED
+             %univ-atts-no-importance;                             
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: API Name                        -->
+<!ELEMENT apiname       (#PCDATA)                                    >
+<!ATTLIST apiname         
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Parameter List                  -->
+<!ELEMENT parml         (%plentry;)+                                 >
+<!ATTLIST parml           
+             compact   (yes | no)                        #IMPLIED
+             spectitle  CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Parameter List Entry            -->
+<!ELEMENT plentry       ((%pt;)+, (%pd;)+)                           >
+<!ATTLIST plentry       
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Parameter Term                  -->
+<!ELEMENT pt            (%term.cnt;)*                                > 
+<!ATTLIST pt           
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Parameter Description           -->
+<!ELEMENT pd            (%defn.cnt;)*                                >
+<!ATTLIST pd             
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Syntax Diagram                  -->
+<!ELEMENT syntaxdiagram ((%title;)?,
+                         (%groupseq; | %groupchoice; | %groupcomp; |
+                          %fragref; | %fragment; | %synblk; |
+                          %synnote; | %synnoteref;)* )               >
+<!ATTLIST syntaxdiagram   
+             %display-atts;
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Syntax Block                    -->
+<!ELEMENT synblk        ((%title;)?, 
+                         (%groupseq; | %groupchoice; | %groupcomp; |
+                          %fragref; | %fragment;| %synnote; |
+                          %synnoteref;)* )                           >
+<!ATTLIST synblk
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Sequence Group                  -->
+<!ELEMENT groupseq      ((%title;)?, (%repsep;)?,
+                         (%groupseq; | %groupchoice; | %groupcomp; |
+                          %fragref; | %kwd; | %var; | %delim; | 
+                          %oper; | %sep; | %synnote; | 
+                          %synnoteref;)* )                           >
+<!ATTLIST groupseq        
+             importance (optional | required | default)    
+                                                      #IMPLIED
+             %univ-atts-no-importance;                             
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Choice Group                    -->
+<!ELEMENT groupchoice   ((%title;)?, (%repsep;)?,
+                         (%groupseq; | %groupchoice; | %groupcomp; |
+                          %fragref;| %kwd; | %var; | %delim; |
+                          %oper; | %sep; | %synnote; | 
+                          %synnoteref;)* )                           > 
+<!ATTLIST  groupchoice     
+             importance (optional | required | default)    
+                                                      #IMPLIED
+             %univ-atts-no-importance;                             
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Composite group                 -->
+<!ELEMENT groupcomp     ((%title;)?, (%repsep;)?,
+                         (%groupseq; | %groupchoice; | %groupcomp; |
+                          %fragref; | %kwd; | %var; | %delim; |
+                          %oper; | %sep; | %synnote; | 
+                          %synnoteref;)* )                           > 
+<!ATTLIST  groupcomp       
+             importance (optional | required | default)    
+                                                      #IMPLIED
+             %univ-atts-no-importance;                             
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Fragment                        -->
+<!ELEMENT fragment      ((%title;)?, 
+                         (%groupseq; | %groupchoice; | %groupcomp; |
+                          %fragref; | %synnote; | %synnoteref;)* )   >
+<!ATTLIST fragment        
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+  
+
+
+<!--                    LONG NAME: Fragment Reference              -->
+<!ELEMENT fragref       (%xrefph.cnt;)*><!--xref-->
+<!ATTLIST fragref         
+             href       CDATA                            #IMPLIED
+             importance (optional | required)            #IMPLIED
+             %univ-atts-no-importance;                             
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Syntax Diagram Note             -->
+<!ELEMENT synnote       (#PCDATA | %basic.ph;)*                      >     
+<!ATTLIST synnote        
+             callout    CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Syntax Note Reference           -->
+<!ELEMENT synnoteref     EMPTY >
+<!ATTLIST synnoteref      
+             href       CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Repeat Separator                -->
+<!ELEMENT repsep         (%words.cnt;)*                              >
+<!ATTLIST repsep          
+            importance  (optional | required)  #IMPLIED
+             %univ-atts-no-importance;                             
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Syntax Keyword                  -->
+<!ELEMENT kwd           (#PCDATA)                                    >
+<!ATTLIST kwd             
+             keyref     CDATA                            #IMPLIED
+             importance (optional | required | default)  #IMPLIED
+             %univ-atts-no-importance;                             
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+             
+
+<!ATTLIST  apiname    %global-atts; class CDATA "+ topic/keyword pr-d/apiname "  >
+<!ATTLIST  codeblock  %global-atts; class CDATA "+ topic/pre pr-d/codeblock "    >
+<!ATTLIST  codeph     %global-atts; class CDATA "+ topic/ph pr-d/codeph "        >
+<!ATTLIST  delim      %global-atts; class CDATA "+ topic/ph pr-d/delim "         >
+<!ATTLIST  fragment   %global-atts; class CDATA "+ topic/figgroup pr-d/fragment ">
+<!ATTLIST  fragref    %global-atts; class CDATA "+ topic/xref pr-d/fragref "     >
+<!ATTLIST  groupchoice 
+                      %global-atts; class CDATA "+ topic/figgroup pr-d/groupchoice ">
+<!ATTLIST  groupcomp  %global-atts; class CDATA "+ topic/figgroup pr-d/groupcomp ">
+<!ATTLIST  groupseq   %global-atts; class CDATA "+ topic/figgroup pr-d/groupseq ">
+<!ATTLIST  kwd        %global-atts; class CDATA "+ topic/keyword pr-d/kwd "      >
+<!ATTLIST  oper       %global-atts; class CDATA "+ topic/ph pr-d/oper "          >
+<!ATTLIST  option     %global-atts; class CDATA "+ topic/keyword pr-d/option "   >
+<!ATTLIST  parml      %global-atts; class CDATA "+ topic/dl pr-d/parml "         >
+<!ATTLIST  parmname   %global-atts; class CDATA "+ topic/keyword pr-d/parmname " >
+<!ATTLIST  pd         %global-atts; class CDATA "+ topic/dd pr-d/pd "            >
+<!ATTLIST  plentry    %global-atts; class CDATA "+ topic/dlentry pr-d/plentry "  >
+<!ATTLIST  pt         %global-atts; class CDATA "+ topic/dt pr-d/pt "            >
+<!ATTLIST  repsep     %global-atts; class CDATA "+ topic/ph pr-d/repsep "        >
+<!ATTLIST  sep        %global-atts; class CDATA "+ topic/ph pr-d/sep "           >
+<!ATTLIST  synblk     %global-atts; class CDATA "+ topic/figgroup pr-d/synblk "  >
+<!ATTLIST  synnote    %global-atts; class CDATA "+ topic/fn pr-d/synnote "       >
+<!ATTLIST  synnoteref %global-atts; class CDATA "+ topic/xref pr-d/synnoteref "  >
+<!ATTLIST  synph      %global-atts; class CDATA "+ topic/ph pr-d/synph "         >
+<!ATTLIST  syntaxdiagram 
+                      %global-atts; class CDATA "+ topic/fig pr-d/syntaxdiagram ">
+<!ATTLIST  var        %global-atts; class CDATA "+ topic/ph pr-d/var "           >
+
+
+<!-- ================== End Programming Domain  ====================== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/programmingDomain.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/programmingDomain.mod.rnc
new file mode 100644
index 0000000..bb24235
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/programmingDomain.mod.rnc
@@ -0,0 +1,475 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA DITA Programming Domain
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA Programming Domain//EN"
+#       Delivered as file "programmingDomain.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the elements and specialization
+
+# attributes for the Programming Domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Updated these comments to match template
+
+# 2005.11.15 RDA: Corrected Long Names for syntax groups,
+
+# codeph, and kwd
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# 2006.06.07 RDA: Make universal attributes universal
+
+# (DITA 1.1 proposal #12)
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+codeph = codeph.element
+delim = delim.element
+kwd = kwd.element
+oper = oper.element
+option = option.element
+parmname = parmname.element
+sep = sep.element
+synph = synph.element
+var = var.element
+pd = pd.element
+plentry = plentry.element
+pt = pt.element
+fragment = fragment.element
+fragref = fragref.element
+groupchoice = groupchoice.element
+groupcomp = groupcomp.element
+groupseq = groupseq.element
+repsep = repsep.element
+synblk = synblk.element
+synnote = synnote.element
+synnoteref = synnoteref.element
+# =============================================================
+
+# ELEMENT DECLARATIONS
+
+# =============================================================
+
+# LONG NAME: Universal Attributes Local
+# Importance
+
+# Povide an alternative set of univ-atts that 
+# allows importance to be redefined locally
+univ-atts-no-importance =
+  id-atts,
+  filter-atts,
+  attribute rev { text }?,
+  attribute status { "new" | "changed" | "deleted" | "unchanged" }?,
+  localization-atts
+# LONG NAME: Code Phrase
+codeph.element =
+  element codeph {
+    codeph.attlist,
+    (text | basic.ph.notm | data.elements.incl | foreign.unknown.incl)*
+  }
+codeph.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Code Block
+codeblock.element =
+  element codeblock {
+    codeblock.attlist,
+    (text
+     | basic.ph.notm
+     | txt.incl
+     | data.elements.incl
+     | foreign.unknown.incl)*
+  }
+codeblock.attlist &=
+  display-atts,
+  attribute spectitle { text }?,
+  [ a:defaultValue = "preserve" ] attribute xml:space { "preserve" }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Option
+option.element = element option { option.attlist, text }
+option.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Variable
+var.element = element var { var.attlist, words.cnt* }
+var.attlist &=
+  attribute importance { "optional" | "required" | "default" }?,
+  univ-atts-no-importance,
+  attribute outputclass { text }?
+# LONG NAME: Parameter Name
+parmname.element = element parmname { parmname.attlist, text }
+parmname.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Syntax Phrase
+synph.element =
+  element synph {
+    synph.attlist,
+    (text
+     | codeph
+     | option
+     | parmname
+     | var
+     | kwd
+     | oper
+     | delim
+     | sep
+     | synph)*
+  }
+synph.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Operator
+oper.element = element oper { oper.attlist, words.cnt* }
+oper.attlist &=
+  attribute importance { "optional" | "required" | "default" }?,
+  univ-atts-no-importance,
+  attribute outputclass { text }?
+# LONG NAME: Delimiter
+delim.element = element delim { delim.attlist, words.cnt* }
+delim.attlist &=
+  attribute importance { "optional" | "required" }?,
+  univ-atts-no-importance,
+  attribute outputclass { text }?
+# LONG NAME: Separator
+sep.element = element sep { sep.attlist, words.cnt* }
+sep.attlist &=
+  attribute importance { "optional" | "required" }?,
+  univ-atts-no-importance,
+  attribute outputclass { text }?
+# LONG NAME: API Name
+apiname.element = element apiname { apiname.attlist, text }
+apiname.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Parameter List
+parml.element = element parml { parml.attlist, plentry+ }
+parml.attlist &=
+  attribute compact { "yes" | "no" }?,
+  attribute spectitle { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Parameter List Entry
+plentry.element = element plentry { plentry.attlist, pt+, pd+ }
+plentry.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Parameter Term
+pt.element = element pt { pt.attlist, term.cnt* }
+pt.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Parameter Description
+pd.element = element pd { pd.attlist, defn.cnt* }
+pd.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Syntax Diagram
+syntaxdiagram.element =
+  element syntaxdiagram {
+    syntaxdiagram.attlist,
+    title?,
+    (groupseq
+     | groupchoice
+     | groupcomp
+     | fragref
+     | fragment
+     | synblk
+     | synnote
+     | synnoteref)*
+  }
+syntaxdiagram.attlist &=
+  display-atts,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Syntax Block
+synblk.element =
+  element synblk {
+    synblk.attlist,
+    title?,
+    (groupseq
+     | groupchoice
+     | groupcomp
+     | fragref
+     | fragment
+     | synnote
+     | synnoteref)*
+  }
+synblk.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Sequence Group
+groupseq.element =
+  element groupseq {
+    groupseq.attlist,
+    title?,
+    repsep?,
+    (groupseq
+     | groupchoice
+     | groupcomp
+     | fragref
+     | kwd
+     | var
+     | delim
+     | oper
+     | sep
+     | synnote
+     | synnoteref)*
+  }
+groupseq.attlist &=
+  attribute importance { "optional" | "required" | "default" }?,
+  univ-atts-no-importance,
+  attribute outputclass { text }?
+# LONG NAME: Choice Group
+groupchoice.element =
+  element groupchoice {
+    groupchoice.attlist,
+    title?,
+    repsep?,
+    (groupseq
+     | groupchoice
+     | groupcomp
+     | fragref
+     | kwd
+     | var
+     | delim
+     | oper
+     | sep
+     | synnote
+     | synnoteref)*
+  }
+groupchoice.attlist &=
+  attribute importance { "optional" | "required" | "default" }?,
+  univ-atts-no-importance,
+  attribute outputclass { text }?
+# LONG NAME: Composite group
+groupcomp.element =
+  element groupcomp {
+    groupcomp.attlist,
+    title?,
+    repsep?,
+    (groupseq
+     | groupchoice
+     | groupcomp
+     | fragref
+     | kwd
+     | var
+     | delim
+     | oper
+     | sep
+     | synnote
+     | synnoteref)*
+  }
+groupcomp.attlist &=
+  attribute importance { "optional" | "required" | "default" }?,
+  univ-atts-no-importance,
+  attribute outputclass { text }?
+# LONG NAME: Fragment
+fragment.element =
+  element fragment {
+    fragment.attlist,
+    title?,
+    (groupseq
+     | groupchoice
+     | groupcomp
+     | fragref
+     | synnote
+     | synnoteref)*
+  }
+fragment.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Fragment Reference
+fragref.element = element fragref { fragref.attlist, xrefph.cnt* }
+# xref
+fragref.attlist &=
+  attribute href { text }?,
+  attribute importance { "optional" | "required" }?,
+  univ-atts-no-importance,
+  attribute outputclass { text }?
+# LONG NAME: Syntax Diagram Note
+synnote.element =
+  element synnote { synnote.attlist, (text | basic.ph)* }
+synnote.attlist &=
+  attribute callout { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Syntax Note Reference
+synnoteref.element = element synnoteref { synnoteref.attlist, empty }
+synnoteref.attlist &=
+  attribute href { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Repeat Separator
+repsep.element = element repsep { repsep.attlist, words.cnt* }
+repsep.attlist &=
+  attribute importance { "optional" | "required" }?,
+  univ-atts-no-importance,
+  attribute outputclass { text }?
+# LONG NAME: Syntax Keyword
+kwd.element = element kwd { kwd.attlist, text }
+kwd.attlist &=
+  attribute keyref { text }?,
+  attribute importance { "optional" | "required" | "default" }?,
+  univ-atts-no-importance,
+  attribute outputclass { text }?
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+apiname.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/keyword pr-d/apiname " ]
+  attribute class { text }?
+codeblock.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/pre pr-d/codeblock " ]
+  attribute class { text }?
+codeph.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph pr-d/codeph " ]
+  attribute class { text }?
+delim.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph pr-d/delim " ]
+  attribute class { text }?
+fragment.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/figgroup pr-d/fragment " ]
+  attribute class { text }?
+fragref.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/xref pr-d/fragref " ]
+  attribute class { text }?
+groupchoice.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/figgroup pr-d/groupchoice " ]
+  attribute class { text }?
+groupcomp.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/figgroup pr-d/groupcomp " ]
+  attribute class { text }?
+groupseq.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/figgroup pr-d/groupseq " ]
+  attribute class { text }?
+kwd.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/keyword pr-d/kwd " ]
+  attribute class { text }?
+oper.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph pr-d/oper " ] attribute class { text }?
+option.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/keyword pr-d/option " ]
+  attribute class { text }?
+parml.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/dl pr-d/parml " ]
+  attribute class { text }?
+parmname.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/keyword pr-d/parmname " ]
+  attribute class { text }?
+pd.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/dd pr-d/pd " ] attribute class { text }?
+plentry.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/dlentry pr-d/plentry " ]
+  attribute class { text }?
+pt.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/dt pr-d/pt " ] attribute class { text }?
+repsep.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph pr-d/repsep " ]
+  attribute class { text }?
+sep.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph pr-d/sep " ] attribute class { text }?
+synblk.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/figgroup pr-d/synblk " ]
+  attribute class { text }?
+synnote.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/fn pr-d/synnote " ]
+  attribute class { text }?
+synnoteref.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/xref pr-d/synnoteref " ]
+  attribute class { text }?
+synph.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph pr-d/synph " ]
+  attribute class { text }?
+syntaxdiagram.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/fig pr-d/syntaxdiagram " ]
+  attribute class { text }?
+var.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph pr-d/var " ] attribute class { text }?
+# ================== End Programming Domain  ======================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/reference.dtd b/xml/tests/testData/xml/OasisDocumentHighlighting/reference.dtd
new file mode 100644
index 0000000..fbfdfa4
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/reference.dtd
@@ -0,0 +1,176 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Reference DTD                                -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//DTD DITA Reference//EN"
+      Delivered as file "reference.dtd"                            -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    DTD to describe DITA References                   -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2006.06.07 RDA: Added indexing domain                      -->
+<!--    2006.06.21 RDA: Added props attribute extensions           -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATIONS                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % ui-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA User Interface Domain//EN" 
+"uiDomain.ent"                                                       >
+%ui-d-dec;
+
+<!ENTITY % hi-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Highlight Domain//EN" 
+"highlightDomain.ent"                                                >
+%hi-d-dec;
+
+<!ENTITY % pr-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Programming Domain//EN" 
+"programmingDomain.ent"                                              >
+%pr-d-dec;
+
+<!ENTITY % sw-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Software Domain//EN" 
+"softwareDomain.ent"                                                 >
+%sw-d-dec;
+
+<!ENTITY % ut-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Utilities Domain//EN" 
+"utilitiesDomain.ent"                                                >
+%ut-d-dec;
+
+<!ENTITY % indexing-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Indexing Domain//EN" 
+"indexingDomain.ent"                                                 >
+%indexing-d-dec;
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE DECLARATIONS              -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN EXTENSIONS                          -->
+<!-- ============================================================= -->
+<!--                    One for each extended base element, with
+                        the name of the domain(s) in which the
+                        extension was declared                     -->
+
+<!ENTITY % pre          "pre     | %pr-d-pre;     | %sw-d-pre;     | 
+                                   %ui-d-pre;"                       >
+<!ENTITY % keyword      "keyword | %pr-d-keyword; | %sw-d-keyword; |
+                                   %ui-d-keyword;"                   >
+<!ENTITY % ph           "ph      | %pr-d-ph;      | %sw-d-ph;      | 
+                                    %hi-d-ph;     | %ui-d-ph;"       >
+<!ENTITY % fig          "fig     | %pr-d-fig;     | %ut-d-fig;"      >
+<!ENTITY % dl           "dl      | %pr-d-dl;"                        >
+<!ENTITY % index-base   "index-base | %indexing-d-index-base;"       >
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE EXTENSIONS                -->
+<!-- ============================================================= -->
+<!ENTITY % props-attribute-extensions  ""                            >
+<!ENTITY % base-attribute-extensions   ""                            >
+
+
+<!-- ============================================================= -->
+<!--                    TOPIC NESTING OVERRIDE                     -->
+<!-- ============================================================= -->
+
+<!--                    Redefine the infotype entity to exclude 
+                        other topic types and disallow nesting     -->
+<!ENTITY % reference-info-types 
+                        "reference"                                  >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+<!--                    Must be declared ahead of the DTDs, which
+                        puts @domains first in order               -->
+
+<!ENTITY included-domains 
+                        "&ui-d-att; &hi-d-att; &pr-d-att; &sw-d-att;
+                         &ut-d-att; &indexing-d-att;"                >
+
+
+<!-- ============================================================= -->
+<!--                    TOPIC ELEMENT INTEGRATION                  -->
+<!-- ============================================================= -->
+
+<!--                    Embed topic to get generic elements        -->
+<!ENTITY % topic-type   PUBLIC 
+"-//OASIS//ELEMENTS DITA Topic//EN" 
+"topic.mod"                                                          >
+%topic-type;
+
+<!--                     Embed reference to get specific elements  -->
+<!ENTITY % reference-typemod 
+                        PUBLIC 
+"-//OASIS//ELEMENTS DITA Reference//EN" 
+"reference.mod"                                                      >
+ %reference-typemod;
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ELEMENT INTEGRATION                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % ui-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA User Interface Domain//EN" 
+"uiDomain.mod"                                                       >
+%ui-d-def;
+
+<!ENTITY % hi-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Highlight Domain//EN" 
+"highlightDomain.mod"                                                >
+%hi-d-def;
+
+<!ENTITY % pr-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Programming Domain//EN" 
+"programmingDomain.mod"                                              >
+%pr-d-def;
+
+<!ENTITY % sw-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Software Domain//EN" 
+"softwareDomain.mod"                                                 >
+%sw-d-def;
+
+<!ENTITY % ut-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Utilities Domain//EN" 
+"utilitiesDomain.mod"                                                >
+%ut-d-def;
+
+<!ENTITY % indexing-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Indexing Domain//EN" 
+"indexingDomain.mod"                                                 >
+%indexing-d-def;
+
+
+<!-- ================== End DITA Reference DTD  ================== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/reference.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/reference.mod
new file mode 100644
index 0000000..dabaace
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/reference.mod
@@ -0,0 +1,246 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Reference                                    -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA Reference//EN"
+      Delivered as file "reference.mod"                            -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the elements and specialization         -->
+<!--             attributes for Reference                          -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Removed old declaration for                -->
+<!--                    referenceClasses entity                    -->
+<!--    2005.11.15 RDA: Corrected LONG NAME for propdeschd         -->
+<!--    2006.06.07 RDA: Added <abstract> element                   -->
+<!--    2006.06.07 RDA: Make universal attributes universal        -->
+<!--                      (DITA 1.1 proposal #12)                  -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                   ARCHITECTURE ENTITIES                       -->
+<!-- ============================================================= -->
+
+<!-- default namespace prefix for DITAArchVersion attribute can be
+     overridden through predefinition in the document type shell   -->
+<!ENTITY % DITAArchNSPrefix
+                       "ditaarch"                                    >
+
+<!-- must be instanced on each topic type                          -->
+<!ENTITY % arch-atts "
+             xmlns:%DITAArchNSPrefix; 
+                        CDATA                              #FIXED
+                       'http://dita.oasis-open.org/architecture/2005/'
+             %DITAArchNSPrefix;:DITAArchVersion
+                        CDATA                              #FIXED
+                       '1.1'"                                        >
+
+
+<!-- ============================================================= -->
+<!--                   SPECIALIZATION OF DECLARED ELEMENTS         -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % reference-info-types 
+                      "%info-types;"                                 >
+
+
+<!-- ============================================================= -->
+<!--                   ELEMENT NAME ENTITIES                       -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % reference   "reference"                                   >
+<!ENTITY % refbody     "refbody"                                     >
+<!ENTITY % refsyn      "refsyn"                                      >
+<!ENTITY % properties  "properties"                                  >
+<!ENTITY % property    "property"                                    >
+<!ENTITY % proptype    "proptype"                                    >
+<!ENTITY % propvalue   "propvalue"                                   >
+<!ENTITY % propdesc    "propdesc"                                    >
+<!ENTITY % prophead    "prophead"                                    >
+<!ENTITY % proptypehd  "proptypehd"                                  >
+<!ENTITY % propvaluehd "propvaluehd"                                 >
+<!ENTITY % propdeschd  "propdeschd"                                  >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY included-domains ""                                         >
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+
+
+<!--                    LONG NAME: Reference                       -->
+<!ELEMENT reference     ((%title;), (%titlealts;)?,
+                         (%shortdesc; | %abstract;)?, 
+                         (%prolog;)?, (%refbody;)?, (%related-links;)?, 
+                         (%reference-info-types;)* )                 >
+<!ATTLIST reference
+             id         ID                               #REQUIRED
+             conref     CDATA                            #IMPLIED
+             %select-atts;
+             %localization-atts;
+             %arch-atts;
+             domains    CDATA                  "&included-domains;"
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Reference Body                  -->
+<!ELEMENT refbody       ((%section; | %refsyn; | %example; | %table; | 
+                          %simpletable; |  %properties; | 
+                          %data.elements.incl; | 
+                          %foreign.unknown.incl;)* )                 >
+<!ATTLIST refbody         
+             %id-atts;
+             %localization-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Reference Syntax                -->
+<!ELEMENT refsyn        (%section.cnt;)*                             >  
+<!ATTLIST refsyn          
+             spectitle  CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Properties                      -->
+<!ELEMENT properties    ((%prophead;)?, (%property;)+)               >
+<!ATTLIST properties      
+             relcolwidth 
+                        CDATA                           #IMPLIED
+             keycol     NMTOKEN                         #IMPLIED
+             refcols    NMTOKENS                        #IMPLIED
+             spectitle  CDATA                           #IMPLIED
+             %display-atts;
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME:  Property Head                  -->
+<!ELEMENT prophead      ((%proptypehd;)?, (%propvaluehd;)?, 
+                         (%propdeschd;)?)                            >
+<!ATTLIST prophead       
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Property Type Head              -->
+<!ELEMENT proptypehd    (%tblcell.cnt;)*                             >
+<!ATTLIST proptypehd     
+             specentry  CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Property Value Head             -->
+<!ELEMENT propvaluehd   (%tblcell.cnt;)*                             >
+<!ATTLIST propvaluehd     
+             specentry  CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Property Description Head       -->
+<!ELEMENT propdeschd    (%tblcell.cnt;)*                             >
+<!ATTLIST propdeschd    
+             specentry  CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Property                        -->
+<!ELEMENT property      ((%proptype;)?, (%propvalue;)?, 
+                         (%propdesc;)?)                              >
+<!ATTLIST property       
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Property Type                   -->
+<!ELEMENT proptype      (%ph.cnt;)*                                  >
+<!ATTLIST proptype       
+             specentry  CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Property Value                  -->
+<!ELEMENT propvalue     (%ph.cnt;)*                                  >
+<!ATTLIST propvalue      
+             specentry  CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Property Descrption             -->
+<!ELEMENT propdesc      (%desc.cnt;)*                                >
+<!ATTLIST propdesc        
+             specentry  CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+             
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+
+
+<!ATTLIST reference   %global-atts;  class  CDATA "- topic/topic       reference/reference " >
+<!ATTLIST refbody     %global-atts;  class  CDATA "- topic/body        reference/refbody "   >
+<!ATTLIST refsyn      %global-atts;  class  CDATA "- topic/section     reference/refsyn "    >
+<!ATTLIST properties  %global-atts;  class  CDATA "- topic/simpletable reference/properties ">
+<!ATTLIST property    %global-atts;  class  CDATA "- topic/strow       reference/property "  >
+<!ATTLIST proptype    %global-atts;  class  CDATA "- topic/stentry     reference/proptype "  >
+<!ATTLIST propvalue   %global-atts;  class  CDATA "- topic/stentry     reference/propvalue " >
+<!ATTLIST propdesc    %global-atts;  class  CDATA "- topic/stentry     reference/propdesc "  >
+
+<!ATTLIST prophead    %global-atts;  class  CDATA "- topic/sthead      reference/prophead "  >
+<!ATTLIST proptypehd  %global-atts;  class  CDATA "- topic/stentry     reference/proptypehd ">
+<!ATTLIST propvaluehd %global-atts;  class  CDATA "- topic/stentry     reference/propvaluehd ">
+<!ATTLIST propdeschd  %global-atts;  class  CDATA "- topic/stentry     reference/propdeschd ">
+
+ 
+<!-- ================== End DITA Reference  =========================== -->
+
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/reference.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/reference.mod.rnc
new file mode 100644
index 0000000..177990e
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/reference.mod.rnc
@@ -0,0 +1,286 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Reference
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA Reference//EN"
+#       Delivered as file "reference.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the elements and specialization
+
+# attributes for Reference
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Removed old declaration for
+
+# referenceClasses entity
+
+# 2005.11.15 RDA: Corrected LONG NAME for propdeschd
+
+# 2006.06.07 RDA: Added <abstract> element
+
+# 2006.06.07 RDA: Make universal attributes universal
+
+# (DITA 1.1 proposal #12)
+
+# =============================================================
+
+# =============================================================
+
+# ARCHITECTURE ENTITIES
+
+# =============================================================
+
+# default namespace prefix for DITAArchVersion attribute can be
+# overridden through predefinition in the document type shell
+
+# must be instanced on each topic type
+
+# =============================================================
+
+# SPECIALIZATION OF DECLARED ELEMENTS
+
+# =============================================================
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+reference-info-types = info-types
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+refbody = refbody.element
+refsyn = refsyn.element
+properties = properties.element
+property = property.element
+proptype = proptype.element
+propvalue = propvalue.element
+propdesc = propdesc.element
+prophead = prophead.element
+proptypehd = proptypehd.element
+propvaluehd = propvaluehd.element
+propdeschd = propdeschd.element
+# =============================================================
+
+# DOMAINS ATTRIBUTE OVERRIDE
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT DECLARATIONS
+
+# =============================================================
+
+# LONG NAME: Reference
+reference.element =
+  element reference {
+    reference.attlist,
+    title,
+    titlealts?,
+    (shortdesc | abstract)?,
+    prolog?,
+    refbody?,
+    related-links?,
+    reference-info-types*
+  }
+reference.attlist &=
+  attribute id { xsd:ID },
+  attribute conref { text }?,
+  select-atts,
+  localization-atts,
+  arch-atts,
+  [
+    a:defaultValue =
+      "(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                          (topic ut-d) (topic indexing-d)"
+  ]
+  attribute domains { text }?,
+  attribute outputclass { text }?
+# LONG NAME: Reference Body
+refbody.element =
+  element refbody {
+    refbody.attlist,
+    (section
+     | refsyn
+     | example
+     | table
+     | simpletable
+     | properties
+     | data.elements.incl
+     | foreign.unknown.incl)*
+  }
+refbody.attlist &=
+  id-atts,
+  localization-atts,
+  attribute outputclass { text }?
+# LONG NAME: Reference Syntax
+refsyn.element = element refsyn { refsyn.attlist, section.cnt* }
+refsyn.attlist &=
+  attribute spectitle { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Properties
+properties.element =
+  element properties { properties.attlist, prophead?, property+ }
+properties.attlist &=
+  attribute relcolwidth { text }?,
+  attribute keycol { xsd:NMTOKEN }?,
+  attribute refcols { xsd:NMTOKENS }?,
+  attribute spectitle { text }?,
+  display-atts,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME:  Property Head
+prophead.element =
+  element prophead {
+    prophead.attlist, proptypehd?, propvaluehd?, propdeschd?
+  }
+prophead.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Property Type Head
+proptypehd.element =
+  element proptypehd { proptypehd.attlist, tblcell.cnt* }
+proptypehd.attlist &=
+  attribute specentry { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Property Value Head
+propvaluehd.element =
+  element propvaluehd { propvaluehd.attlist, tblcell.cnt* }
+propvaluehd.attlist &=
+  attribute specentry { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Property Description Head
+propdeschd.element =
+  element propdeschd { propdeschd.attlist, tblcell.cnt* }
+propdeschd.attlist &=
+  attribute specentry { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Property
+property.element =
+  element property {
+    property.attlist, proptype?, propvalue?, propdesc?
+  }
+property.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Property Type
+proptype.element = element proptype { proptype.attlist, ph.cnt* }
+proptype.attlist &=
+  attribute specentry { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Property Value
+propvalue.element = element propvalue { propvalue.attlist, ph.cnt* }
+propvalue.attlist &=
+  attribute specentry { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Property Descrption
+propdesc.element = element propdesc { propdesc.attlist, desc.cnt* }
+propdesc.attlist &=
+  attribute specentry { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+reference.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/topic       reference/reference " ]
+  attribute class { text }?
+refbody.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/body        reference/refbody " ]
+  attribute class { text }?
+refsyn.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/section     reference/refsyn " ]
+  attribute class { text }?
+properties.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/simpletable reference/properties " ]
+  attribute class { text }?
+property.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/strow       reference/property " ]
+  attribute class { text }?
+proptype.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/stentry     reference/proptype " ]
+  attribute class { text }?
+propvalue.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/stentry     reference/propvalue " ]
+  attribute class { text }?
+propdesc.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/stentry     reference/propdesc " ]
+  attribute class { text }?
+prophead.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/sthead      reference/prophead " ]
+  attribute class { text }?
+proptypehd.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/stentry     reference/proptypehd " ]
+  attribute class { text }?
+propvaluehd.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/stentry     reference/propvaluehd " ]
+  attribute class { text }?
+propdeschd.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/stentry     reference/propdeschd " ]
+  attribute class { text }?
+# ================== End DITA Reference  ===========================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/reference.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/reference.rnc
new file mode 100644
index 0000000..fc415dd
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/reference.rnc
@@ -0,0 +1,148 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Reference DTD
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//DTD DITA Reference//EN"
+#       Delivered as file "reference.dtd"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    DTD to describe DITA References
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2006.06.07 RDA: Added indexing domain
+
+# 2006.06.21 RDA: Added props attribute extensions
+
+# =============================================================
+
+# =============================================================
+
+# DOMAIN ENTITY DECLARATIONS
+
+# =============================================================
+
+include "uiDomain.ent.rnc"
+include "highlightDomain.ent.rnc"
+include "programmingDomain.ent.rnc"
+include "softwareDomain.ent.rnc"
+include "utilitiesDomain.ent.rnc"
+include "indexingDomain.ent.rnc"
+# =============================================================
+
+# DOMAIN ATTRIBUTE DECLARATIONS
+
+# =============================================================
+
+# =============================================================
+
+# DOMAIN EXTENSIONS
+
+# =============================================================
+
+# One for each extended base element, with
+# the name of the domain(s) in which the
+# extension was declared
+pre = pre.element | pr-d-pre | sw-d-pre | ui-d-pre
+keyword = keyword.element | pr-d-keyword | sw-d-keyword | ui-d-keyword
+ph = ph.element | pr-d-ph | sw-d-ph | hi-d-ph | ui-d-ph
+fig = fig.element | pr-d-fig | ut-d-fig
+dl = dl.element | pr-d-dl
+index-base = index-base.element | indexing-d-index-base
+# =============================================================
+
+# DOMAIN ATTRIBUTE EXTENSIONS
+
+# =============================================================
+props-attribute-extensions = empty
+base-attribute-extensions = empty
+# =============================================================
+
+# TOPIC NESTING OVERRIDE
+
+# =============================================================
+
+# Redefine the infotype entity to exclude 
+# other topic types and disallow nesting
+reference-info-types = reference.element
+# =============================================================
+
+# DOMAINS ATTRIBUTE OVERRIDE
+
+# =============================================================
+
+# Must be declared ahead of the DTDs, which
+# puts @domains first in order
+
+# =============================================================
+
+# TOPIC ELEMENT INTEGRATION
+
+# =============================================================
+
+# Embed topic to get generic elements
+include "topic.mod.rnc"
+# Embed reference to get specific elements
+include "reference.mod.rnc"
+# =============================================================
+
+# DOMAIN ELEMENT INTEGRATION
+
+# =============================================================
+include "uiDomain.mod.rnc"
+include "highlightDomain.mod.rnc"
+include "programmingDomain.mod.rnc"
+include "softwareDomain.mod.rnc"
+include "utilitiesDomain.mod.rnc"
+include "indexingDomain.mod.rnc"
+start = no-topic-nesting.element
+any =
+  (element * {
+     attribute * { text }*,
+     any
+   }
+   | text)*
+# ================== End DITA Reference DTD  ==================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/softwareDomain.ent b/xml/tests/testData/xml/OasisDocumentHighlighting/softwareDomain.ent
new file mode 100644
index 0000000..82c6575
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/softwareDomain.ent
@@ -0,0 +1,53 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Software Domain Entities                     -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ENTITIES DITA Software Domain//EN"
+      Delivered as file "softwareDomain.ent"                       -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the substitution context and domain     -->
+<!--             entity declarations for the software domain       -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Updated these comments to match template   -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    ELEMENT EXTENSION ENTITY DECLARATIONS      -->
+<!-- ============================================================= -->
+
+<!ENTITY % sw-d-pre     "msgblock"                                   >
+<!ENTITY % sw-d-ph      "filepath | msgph  | userinput |systemoutput">
+<!ENTITY % sw-d-keyword "cmdname  | msgnum | varname"                >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATION                  -->
+<!-- ============================================================= -->
+
+<!ENTITY sw-d-att       "(topic sw-d)"                               >
+
+
+<!-- ================== End Software Domain Entities ============= -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/softwareDomain.ent.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/softwareDomain.ent.rnc
new file mode 100644
index 0000000..eeb9b53
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/softwareDomain.ent.rnc
@@ -0,0 +1,83 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Software Domain Entities
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ENTITIES DITA Software Domain//EN"
+#       Delivered as file "softwareDomain.ent"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the substitution context and domain
+
+# entity declarations for the software domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Updated these comments to match template
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT EXTENSION ENTITY DECLARATIONS
+
+# =============================================================
+
+sw-d-pre = msgblock.element
+sw-d-ph =
+  filepath.element
+  | msgph.element
+  | userinput.element
+  | systemoutput.element
+sw-d-keyword = cmdname.element | msgnum.element | varname.element
+# =============================================================
+
+# DOMAIN ENTITY DECLARATION
+
+# =============================================================
+
+# ================== End Software Domain Entities =============
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/softwareDomain.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/softwareDomain.mod
new file mode 100644
index 0000000..6fb09e7
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/softwareDomain.mod
@@ -0,0 +1,145 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Software Domain                              -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA Software Domain//EN"
+      Delivered as file "softwareDomain.mod"                       -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the elements and specialization         -->
+<!--             attributes for the Software Domain                -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Corrected the PURPOSE in this comment      -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                   ELEMENT NAME ENTITIES                       -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % msgph       "msgph"                                       >
+<!ENTITY % msgblock    "msgblock"                                    >
+<!ENTITY % msgnum      "msgnum"                                      >
+<!ENTITY % cmdname     "cmdname"                                     >
+<!ENTITY % varname     "varname"                                     >
+<!ENTITY % filepath    "filepath"                                    >
+<!ENTITY % userinput   "userinput"                                   >
+<!ENTITY % systemoutput 
+                       "systemoutput"                                >
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+
+
+<!--                    LONG NAME: Message Phrase                  -->
+<!ELEMENT msgph         (%words.cnt;)*                               >
+<!ATTLIST msgph          
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Message Block                   -->
+<!ELEMENT msgblock      (%words.cnt;)*                               >
+<!ATTLIST msgblock        
+             %display-atts;
+             spectitle  CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    
+             xml:space  (preserve)                #FIXED "preserve"  >
+
+
+<!--                    LONG NAME: Message Number                  -->
+<!ELEMENT msgnum         (#PCDATA)                                   >
+<!ATTLIST msgnum          
+             keyref      CDATA                           #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Command Name                    -->
+<!ELEMENT cmdname       (#PCDATA)                                    >
+<!ATTLIST cmdname       
+             keyref      CDATA                           #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Variable Name                   -->
+<!ELEMENT varname       (#PCDATA)                                    >
+<!ATTLIST varname         
+             keyref      CDATA                           #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: File Path                       -->
+<!ELEMENT filepath      (%words.cnt;)*                               >
+<!ATTLIST filepath       
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: User Input                      -->
+<!ELEMENT userinput     (%words.cnt;)*                               >
+<!ATTLIST userinput      
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: System Output                   -->
+<!ELEMENT systemoutput  (%words.cnt;)*                               >
+<!ATTLIST systemoutput   
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+             
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+             
+
+<!ATTLIST cmdname     %global-atts;  class CDATA "+ topic/keyword sw-d/cmdname ">
+<!ATTLIST filepath    %global-atts;  class CDATA "+ topic/ph sw-d/filepath "    >
+<!ATTLIST msgblock    %global-atts;  class CDATA "+ topic/pre sw-d/msgblock "   >
+<!ATTLIST msgnum      %global-atts;  class CDATA "+ topic/keyword sw-d/msgnum " >
+<!ATTLIST msgph       %global-atts;  class CDATA "+ topic/ph sw-d/msgph "       >
+<!ATTLIST systemoutput
+                      %global-atts;  class CDATA "+ topic/ph sw-d/systemoutput ">
+<!ATTLIST userinput   %global-atts;  class CDATA "+ topic/ph sw-d/userinput "   >
+<!ATTLIST varname     %global-atts;  class CDATA "+ topic/keyword sw-d/varname ">
+
+ 
+<!-- ================== End Software Domain ====================== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/softwareDomain.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/softwareDomain.mod.rnc
new file mode 100644
index 0000000..b90d24f
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/softwareDomain.mod.rnc
@@ -0,0 +1,163 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Software Domain
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA Software Domain//EN"
+#       Delivered as file "softwareDomain.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the elements and specialization
+
+# attributes for the Software Domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Corrected the PURPOSE in this comment
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT DECLARATIONS
+
+# =============================================================
+
+# LONG NAME: Message Phrase
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+msgph.element = element msgph { msgph.attlist, words.cnt* }
+msgph.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Message Block
+msgblock.element = element msgblock { msgblock.attlist, words.cnt* }
+msgblock.attlist &=
+  display-atts,
+  attribute spectitle { text }?,
+  univ-atts,
+  attribute outputclass { text }?,
+  [ a:defaultValue = "preserve" ] attribute xml:space { "preserve" }?
+# LONG NAME: Message Number
+msgnum.element = element msgnum { msgnum.attlist, text }
+msgnum.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Command Name
+cmdname.element = element cmdname { cmdname.attlist, text }
+cmdname.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Variable Name
+varname.element = element varname { varname.attlist, text }
+varname.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: File Path
+filepath.element = element filepath { filepath.attlist, words.cnt* }
+filepath.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: User Input
+userinput.element = element userinput { userinput.attlist, words.cnt* }
+userinput.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: System Output
+systemoutput.element =
+  element systemoutput { systemoutput.attlist, words.cnt* }
+systemoutput.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+cmdname.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/keyword sw-d/cmdname " ]
+  attribute class { text }?
+filepath.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph sw-d/filepath " ]
+  attribute class { text }?
+msgblock.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/pre sw-d/msgblock " ]
+  attribute class { text }?
+msgnum.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/keyword sw-d/msgnum " ]
+  attribute class { text }?
+msgph.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph sw-d/msgph " ]
+  attribute class { text }?
+systemoutput.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph sw-d/systemoutput " ]
+  attribute class { text }?
+userinput.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph sw-d/userinput " ]
+  attribute class { text }?
+varname.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/keyword sw-d/varname " ]
+  attribute class { text }?
+# ================== End Software Domain ======================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/task.dtd b/xml/tests/testData/xml/OasisDocumentHighlighting/task.dtd
new file mode 100644
index 0000000..fb44f71
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/task.dtd
@@ -0,0 +1,174 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Task DTD                                     -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+PUBLIC "-//OASIS//DTD DITA Task//EN"
+      Delivered as file "task.dtd"                                 -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    DTD to describe DITA Tasks                        -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2006.06.07 RDA: Added indexing domain                      -->
+<!--    2006.06.21 RDA: Added props attribute extensions           -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATIONS                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % ui-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA User Interface Domain//EN" 
+"uiDomain.ent"                                                       >
+%ui-d-dec;
+
+<!ENTITY % hi-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Highlight Domain//EN" 
+"highlightDomain.ent"                                                >
+%hi-d-dec;
+
+<!ENTITY % pr-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Programming Domain//EN" 
+"programmingDomain.ent"                                              >
+%pr-d-dec;
+
+<!ENTITY % sw-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Software Domain//EN" 
+"softwareDomain.ent"                                                 >
+%sw-d-dec;
+
+<!ENTITY % ut-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Utilities Domain//EN" 
+"utilitiesDomain.ent"                                                >
+%ut-d-dec;
+
+<!ENTITY % indexing-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Indexing Domain//EN" 
+"indexingDomain.ent"                                                 >
+%indexing-d-dec;
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE DECLARATIONS              -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN EXTENSIONS                          -->
+<!-- ============================================================= -->
+<!--                    One for each extended base element, with
+                        the name of the domain(s) in which the
+                        extension was declared                     -->
+
+<!ENTITY % pre          "pre     | %pr-d-pre;     | %sw-d-pre;     | 
+                                   %ui-d-pre;"                       >
+<!ENTITY % keyword      "keyword | %pr-d-keyword; | %sw-d-keyword; |
+                                   %ui-d-keyword;"                   >
+<!ENTITY % ph           "ph      | %pr-d-ph;      | %sw-d-ph;      | 
+                                    %hi-d-ph;     | %ui-d-ph;"       >
+<!ENTITY % fig          "fig     | %pr-d-fig;     | %ut-d-fig;"      >
+<!ENTITY % dl           "dl      | %pr-d-dl;"                        >
+<!ENTITY % index-base   "index-base | %indexing-d-index-base;"       >
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE EXTENSIONS                -->
+<!-- ============================================================= -->
+<!ENTITY % props-attribute-extensions  ""                            >
+<!ENTITY % base-attribute-extensions   ""                            >
+
+
+<!-- ============================================================= -->
+<!--                    TOPIC NESTING OVERRIDE                     -->
+<!-- ============================================================= -->
+
+<!--                    Redefine the infotype entity to exclude 
+                        other topic types and disallow nesting     -->
+<!ENTITY % task-info-types 
+                        "task"                                       >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+<!--                    Must be declared ahead of the DTDs, which
+                        puts @domains first in order               -->
+
+<!ENTITY included-domains 
+                        "&ui-d-att; &hi-d-att; &pr-d-att; &sw-d-att;
+                         &ut-d-att; &indexing-d-att;"                >
+
+
+<!-- ============================================================= -->
+<!--                    TOPIC ELEMENT INTEGRATION                  -->
+<!-- ============================================================= -->
+
+<!--                    Embed topic to get generic elements        -->
+<!ENTITY % topic-type   PUBLIC 
+"-//OASIS//ELEMENTS DITA Topic//EN" 
+"topic.mod"                                                          >
+%topic-type;
+        
+<!--                    Embed task to get specific elements        -->
+<!ENTITY % task-typemod PUBLIC 
+"-//OASIS//ELEMENTS DITA Task//EN" 
+"task.mod"                                                           >
+%task-typemod;
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ELEMENT INTEGRATION                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % ui-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA User Interface Domain//EN" 
+"uiDomain.mod"                                                       >
+%ui-d-def;
+
+<!ENTITY % hi-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Highlight Domain//EN" 
+"highlightDomain.mod"                                                >
+%hi-d-def;
+
+<!ENTITY % pr-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Programming Domain//EN" 
+"programmingDomain.mod"                                              >
+%pr-d-def;
+
+<!ENTITY % sw-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Software Domain//EN" 
+"softwareDomain.mod"                                                 >
+%sw-d-def;
+
+<!ENTITY % ut-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Utilities Domain//EN" 
+"utilitiesDomain.mod"                                                >
+%ut-d-def;
+
+<!ENTITY % indexing-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Indexing Domain//EN" 
+"indexingDomain.mod"                                                 >
+%indexing-d-def;
+
+
+<!-- ================== End DITA Task DTD  ======================= -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/task.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/task.mod
new file mode 100644
index 0000000..e77a8bb
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/task.mod
@@ -0,0 +1,409 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Task                                         -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA Task//EN"
+      Delivered as file "task.mod"                                 -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the elements and specialization         -->
+<!--             attributes for the DITA Tasks                     -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Removed old declaration for                -->
+<!--                    taskClasses entity                         -->
+<!--    2005.11.15 RDA: Corrected LONG NAME for chdeschd           -->
+<!--    2006.06.06 RDA: Changed model of choice to listitem.cnt    -->
+<!--                    for completeness                           -->
+<!--    2006.06.07 RDA: Added <abstract> element                   -->
+<!--    2006.06.07 RDA: Make universal attributes universal        -->
+<!--                      (DITA 1.1 proposal #12)                  -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                   ARCHITECTURE ENTITIES                       -->
+<!-- ============================================================= -->
+
+<!-- default namespace prefix for DITAArchVersion attribute can be
+     overridden through predefinition in the document type shell   -->
+<!ENTITY % DITAArchNSPrefix
+                       "ditaarch"                                    >
+
+<!-- must be instanced on each topic type                          -->
+<!ENTITY % arch-atts "
+             xmlns:%DITAArchNSPrefix; 
+                        CDATA                              #FIXED
+                       'http://dita.oasis-open.org/architecture/2005/'
+             %DITAArchNSPrefix;:DITAArchVersion
+                        CDATA                              #FIXED
+                       '1.1'"                                        >
+
+
+<!-- ============================================================= -->
+<!--                   SPECIALIZATION OF DECLARED ELEMENTS         -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                   ELEMENT NAME ENTITIES                       -->
+<!-- ============================================================= -->
+
+<!ENTITY % task        "task"                                        >
+<!ENTITY % taskbody    "taskbody"                                    >
+<!ENTITY % steps       "steps"                                       >
+<!ENTITY % steps-unordered 
+                       "steps-unordered"                             >
+<!ENTITY % step        "step"                                        >
+<!ENTITY % cmd         "cmd"                                         >
+<!ENTITY % substeps    "substeps"                                    >
+<!ENTITY % substep     "substep"                                     >
+<!ENTITY % tutorialinfo 
+                       "tutorialinfo"                                >
+<!ENTITY % info        "info"                                        >
+<!ENTITY % stepxmp     "stepxmp"                                     >
+<!ENTITY % stepresult  "stepresult"                                  >
+<!ENTITY % choices     "choices"                                     >
+<!ENTITY % choice      "choice"                                      >
+<!ENTITY % result      "result"                                      >
+<!ENTITY % prereq      "prereq"                                      >
+<!ENTITY % postreq     "postreq"                                     >
+<!ENTITY % context     "context"                                     >
+<!ENTITY % choicetable "choicetable"                                 >
+<!ENTITY % chhead      "chhead"                                      >
+<!ENTITY % chrow       "chrow"                                       >
+<!ENTITY % choptionhd  "choptionhd"                                  >
+<!ENTITY % chdeschd    "chdeschd"                                    >
+<!ENTITY % choption    "choption"                                    >
+<!ENTITY % chdesc      "chdesc"                                      >
+
+
+<!-- ============================================================= -->
+<!--                    SHARED ATTRIBUTE LISTS                     -->
+<!-- ============================================================= -->
+
+
+<!--                    Provide an alternative set of univ-atts 
+                        that allows importance to be redefined 
+                        locally                                    -->
+<!ENTITY % univ-atts-no-importance-task
+            '%id-atts;
+             %filter-atts;
+             rev        CDATA                            #IMPLIED
+             status     (new | changed | deleted |   
+                         unchanged)                      #IMPLIED
+             %localization-atts;                                 '   >
+
+<!ENTITY % task-info-types 
+                        "%info-types;"                               >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY included-domains ""                                         >
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+
+
+<!--                    LONG NAME: Task                            -->
+<!ELEMENT task          ((%title;), (%titlealts;)?,
+                         (%shortdesc; | %abstract;)?, 
+                         (%prolog;)?, (%taskbody;)?, 
+                         (%related-links;)?, (%task-info-types;)* )  >
+<!ATTLIST task            
+             id         ID                               #REQUIRED
+             conref     CDATA                            #IMPLIED
+             %select-atts;
+             %localization-atts;
+             %arch-atts;
+             outputclass 
+                        CDATA                            #IMPLIED
+             domains    CDATA                "&included-domains;"    >
+
+
+<!--                    LONG NAME: Task Body                       -->
+<!ELEMENT taskbody      ((%prereq;)?, (%context;)?, 
+                         (%steps; | %steps-unordered;)?, 
+                         (%result;)?, (%example;)?, (%postreq;)?)    >
+<!ATTLIST taskbody        
+             %id-atts;
+             %localization-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Prerequisites                   -->
+<!ELEMENT prereq        (%section.notitle.cnt;)*                     >
+<!ATTLIST prereq        
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Context                         -->
+<!ELEMENT context       (%section.notitle.cnt;)*                     >
+<!ATTLIST context        
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Steps                           -->
+<!ELEMENT steps         ((%step;)+)                                  >
+<!ATTLIST steps         
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Steps: Unordered                -->
+<!ELEMENT steps-unordered 
+                        ((%step;)+)                                  >
+<!ATTLIST steps-unordered 
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Step                            -->
+<!ELEMENT step          (%cmd;, 
+                         (%info;  |%substeps; | %tutorialinfo; |
+                          %stepxmp; | %choicetable; | %choices;)*, 
+                         (%stepresult;)? )                           >
+<!ATTLIST step            
+             importance (optional | required)            #IMPLIED
+             %univ-atts-no-importance-task;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--ATTLIST step          
+               importance (optional | required)          #IMPLIED  -->
+
+
+<!--                    LONG NAME: Command                         -->
+<!ELEMENT cmd            (%ph.cnt;)* >
+<!ATTLIST cmd             
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Information                     -->
+<!ELEMENT info          (%itemgroup.cnt;)*                           >
+<!ATTLIST info           
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Sub-steps                       -->
+<!ELEMENT substeps      (%substep;)+                                 >
+<!ATTLIST substeps       
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Sub-step                        -->
+<!ELEMENT substep       (%cmd;, 
+                         (%info; | %tutorialinfo; | %stepxmp;)*, 
+                         (%stepresult;)? )                           >
+<!ATTLIST substep         
+             importance (optional | required)            #IMPLIED
+             %univ-atts-no-importance-task;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--ATTLIST substep       
+               importance 
+                        (optional | required)            #IMPLIED  -->
+
+
+<!--                    LONG NAME: Tutorial Information            -->
+<!ELEMENT tutorialinfo  (%itemgroup.cnt;)*                           >
+<!ATTLIST tutorialinfo   
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Step Example                    -->
+<!ELEMENT stepxmp       (%itemgroup.cnt;)*                           >
+<!ATTLIST stepxmp       
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Choices                         -->
+<!ELEMENT choices       ((%choice;)+)                                >
+<!ATTLIST choices       
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Choice                          -->
+<!ELEMENT choice        (%listitem.cnt;)*                            >
+<!ATTLIST choice          
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Choice Table                    -->
+<!ELEMENT choicetable   ((%chhead;)?, (%chrow;)+ )                   >
+<!ATTLIST choicetable     
+             relcolwidth 
+                        CDATA                            #IMPLIED
+             keycol     NMTOKEN                          "1"
+             refcols    NMTOKENS                         #IMPLIED
+             spectitle  CDATA                            #IMPLIED
+             %display-atts;
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Choice Head                     -->
+<!ELEMENT chhead        ((%choptionhd;), (%chdeschd;) )              >
+<!ATTLIST chhead         
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Choice Option Head              -->
+<!ELEMENT choptionhd    (%tblcell.cnt;)*                             >
+<!ATTLIST choptionhd     
+             specentry  CDATA                           #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Choice Description Head         -->
+<!ELEMENT chdeschd      (%tblcell.cnt;)*                             >
+<!ATTLIST chdeschd      
+             specentry  CDATA                           #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Choice Row                      -->
+<!ELEMENT chrow         ((%choption;), (%chdesc;) )                  >
+<!ATTLIST chrow        
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Choice Option                   -->
+<!ELEMENT choption      (%tblcell.cnt;)*>
+<!ATTLIST choption        
+             specentry  CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Choice Description              -->
+<!ELEMENT chdesc        (%tblcell.cnt;)*>
+<!ATTLIST chdesc                
+             specentry  CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Step Result                     -->
+<!ELEMENT stepresult    (%itemgroup.cnt;)*                           >
+<!ATTLIST stepresult    
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Result                          -->
+<!ELEMENT result        (%section.notitle.cnt;)*                     >
+<!ATTLIST result         
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Post Requirements               -->
+<!ELEMENT postreq       (%section.notitle.cnt;)*                     >
+<!ATTLIST postreq        
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+             
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+
+
+<!ATTLIST task        %global-atts;  class  CDATA "- topic/topic task/task "        >
+<!ATTLIST taskbody    %global-atts;  class  CDATA "- topic/body task/taskbody "     >
+<!ATTLIST steps       %global-atts;  class  CDATA "- topic/ol task/steps "          >
+<!ATTLIST steps-unordered 
+                      %global-atts;  class  CDATA "- topic/ul task/steps-unordered ">
+<!ATTLIST step        %global-atts;  class  CDATA "- topic/li task/step "           >
+<!ATTLIST cmd         %global-atts;  class  CDATA "- topic/ph task/cmd "            >
+<!ATTLIST substeps    %global-atts;  class  CDATA "- topic/ol task/substeps "       >
+<!ATTLIST substep     %global-atts;  class  CDATA "- topic/li task/substep "        >
+<!ATTLIST tutorialinfo 
+                      %global-atts;  class  CDATA "- topic/itemgroup task/tutorialinfo ">
+<!ATTLIST info        %global-atts;  class  CDATA "- topic/itemgroup task/info "    >
+<!ATTLIST stepxmp     %global-atts;  class  CDATA "- topic/itemgroup task/stepxmp " >
+<!ATTLIST stepresult  %global-atts;  class  CDATA "- topic/itemgroup task/stepresult ">
+
+<!ATTLIST choices     %global-atts;  class  CDATA "- topic/ul task/choices "        >
+<!ATTLIST choice      %global-atts;  class  CDATA "- topic/li task/choice "         >
+<!ATTLIST result       %global-atts;  class  CDATA "- topic/section task/result "   >
+<!ATTLIST prereq      %global-atts;  class  CDATA "- topic/section task/prereq "    >
+<!ATTLIST postreq     %global-atts;  class  CDATA "- topic/section task/postreq "   >
+<!ATTLIST context     %global-atts;  class  CDATA "- topic/section task/context "   >
+
+<!ATTLIST choicetable %global-atts;  class  CDATA "- topic/simpletable task/choicetable ">
+<!ATTLIST chhead      %global-atts;  class  CDATA "- topic/sthead task/chhead "     >
+<!ATTLIST chrow       %global-atts;  class  CDATA "- topic/strow task/chrow "       >
+<!ATTLIST choptionhd  %global-atts;  class  CDATA "- topic/stentry task/choptionhd ">
+<!ATTLIST chdeschd    %global-atts;  class  CDATA "- topic/stentry task/chdeschd "  >
+<!ATTLIST choption    %global-atts;  class  CDATA "- topic/stentry task/choption "  >
+<!ATTLIST chdesc      %global-atts;  class  CDATA "- topic/stentry task/chdesc "    >
+
+ 
+<!-- ================== End DITA Task  =========================== -->
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/task.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/task.mod.rnc
new file mode 100644
index 0000000..499aa40
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/task.mod.rnc
@@ -0,0 +1,445 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Task
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA Task//EN"
+#       Delivered as file "task.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the elements and specialization
+
+# attributes for the DITA Tasks
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Removed old declaration for
+
+# taskClasses entity
+
+# 2005.11.15 RDA: Corrected LONG NAME for chdeschd
+
+# 2006.06.06 RDA: Changed model of choice to listitem.cnt
+
+# for completeness
+
+# 2006.06.07 RDA: Added <abstract> element
+
+# 2006.06.07 RDA: Make universal attributes universal
+
+# (DITA 1.1 proposal #12)
+
+# =============================================================
+
+# =============================================================
+
+# ARCHITECTURE ENTITIES
+
+# =============================================================
+
+# default namespace prefix for DITAArchVersion attribute can be
+# overridden through predefinition in the document type shell
+
+# must be instanced on each topic type
+
+# =============================================================
+
+# SPECIALIZATION OF DECLARED ELEMENTS
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+taskbody = taskbody.element
+steps = steps.element
+steps-unordered = steps-unordered.element
+step = step.element
+cmd = cmd.element
+substeps = substeps.element
+substep = substep.element
+tutorialinfo = tutorialinfo.element
+info = info.element
+stepxmp = stepxmp.element
+stepresult = stepresult.element
+choices = choices.element
+choice = choice.element
+result = result.element
+prereq = prereq.element
+postreq = postreq.element
+context = context.element
+choicetable = choicetable.element
+chhead = chhead.element
+chrow = chrow.element
+choptionhd = choptionhd.element
+chdeschd = chdeschd.element
+choption = choption.element
+chdesc = chdesc.element
+# =============================================================
+
+# SHARED ATTRIBUTE LISTS
+
+# =============================================================
+
+# Provide an alternative set of univ-atts 
+# that allows importance to be redefined 
+# locally
+univ-atts-no-importance-task =
+  id-atts,
+  filter-atts,
+  attribute rev { text }?,
+  attribute status { "new" | "changed" | "deleted" | "unchanged" }?,
+  localization-atts
+task-info-types = info-types
+# =============================================================
+
+# DOMAINS ATTRIBUTE OVERRIDE
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT DECLARATIONS
+
+# =============================================================
+
+# LONG NAME: Task
+task.element =
+  element task {
+    task.attlist,
+    title,
+    titlealts?,
+    (shortdesc | abstract)?,
+    prolog?,
+    taskbody?,
+    related-links?,
+    task-info-types*
+  }
+task.attlist &=
+  attribute id { xsd:ID },
+  attribute conref { text }?,
+  select-atts,
+  localization-atts,
+  arch-atts,
+  attribute outputclass { text }?,
+  [
+    a:defaultValue =
+      "(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                          (topic ut-d) (topic indexing-d)"
+  ]
+  attribute domains { text }?
+# LONG NAME: Task Body
+taskbody.element =
+  element taskbody {
+    taskbody.attlist,
+    prereq?,
+    context?,
+    (steps | steps-unordered)?,
+    result?,
+    example?,
+    postreq?
+  }
+taskbody.attlist &=
+  id-atts,
+  localization-atts,
+  attribute outputclass { text }?
+# LONG NAME: Prerequisites
+prereq.element = element prereq { prereq.attlist, section.notitle.cnt* }
+prereq.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Context
+context.element =
+  element context { context.attlist, section.notitle.cnt* }
+context.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Steps
+steps.element = element steps { steps.attlist, step+ }
+steps.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Steps: Unordered
+steps-unordered.element =
+  element steps-unordered { steps-unordered.attlist, step+ }
+steps-unordered.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Step
+step.element =
+  element step {
+    step.attlist,
+    cmd,
+    (info | substeps | tutorialinfo | stepxmp | choicetable | choices)*,
+    stepresult?
+  }
+step.attlist &=
+  attribute importance { "optional" | "required" }?,
+  univ-atts-no-importance-task,
+  attribute outputclass { text }?
+# ATTLIST step          
+# importance (optional | required)          #IMPLIED
+
+# LONG NAME: Command
+cmd.element = element cmd { cmd.attlist, ph.cnt* }
+cmd.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Information
+info.element = element info { info.attlist, itemgroup.cnt* }
+info.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Sub-steps
+substeps.element = element substeps { substeps.attlist, substep+ }
+substeps.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Sub-step
+substep.element =
+  element substep {
+    substep.attlist, cmd, (info | tutorialinfo | stepxmp)*, stepresult?
+  }
+substep.attlist &=
+  attribute importance { "optional" | "required" }?,
+  univ-atts-no-importance-task,
+  attribute outputclass { text }?
+# ATTLIST substep       
+# importance 
+#          (optional | required)            #IMPLIED
+
+# LONG NAME: Tutorial Information
+tutorialinfo.element =
+  element tutorialinfo { tutorialinfo.attlist, itemgroup.cnt* }
+tutorialinfo.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Step Example
+stepxmp.element = element stepxmp { stepxmp.attlist, itemgroup.cnt* }
+stepxmp.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Choices
+choices.element = element choices { choices.attlist, choice+ }
+choices.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Choice
+choice.element = element choice { choice.attlist, listitem.cnt* }
+choice.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Choice Table
+choicetable.element =
+  element choicetable { choicetable.attlist, chhead?, chrow+ }
+choicetable.attlist &=
+  attribute relcolwidth { text }?,
+  [ a:defaultValue = "1" ] attribute keycol { xsd:NMTOKEN }?,
+  attribute refcols { xsd:NMTOKENS }?,
+  attribute spectitle { text }?,
+  display-atts,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Choice Head
+chhead.element = element chhead { chhead.attlist, choptionhd, chdeschd }
+chhead.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Choice Option Head
+choptionhd.element =
+  element choptionhd { choptionhd.attlist, tblcell.cnt* }
+choptionhd.attlist &=
+  attribute specentry { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Choice Description Head
+chdeschd.element = element chdeschd { chdeschd.attlist, tblcell.cnt* }
+chdeschd.attlist &=
+  attribute specentry { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Choice Row
+chrow.element = element chrow { chrow.attlist, choption, chdesc }
+chrow.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Choice Option
+choption.element = element choption { choption.attlist, tblcell.cnt* }
+choption.attlist &=
+  attribute specentry { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Choice Description
+chdesc.element = element chdesc { chdesc.attlist, tblcell.cnt* }
+chdesc.attlist &=
+  attribute specentry { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Step Result
+stepresult.element =
+  element stepresult { stepresult.attlist, itemgroup.cnt* }
+stepresult.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Result
+result.element = element result { result.attlist, section.notitle.cnt* }
+result.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Post Requirements
+postreq.element =
+  element postreq { postreq.attlist, section.notitle.cnt* }
+postreq.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+task.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/topic task/task " ]
+  attribute class { text }?
+taskbody.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/body task/taskbody " ]
+  attribute class { text }?
+steps.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/ol task/steps " ]
+  attribute class { text }?
+steps-unordered.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/ul task/steps-unordered " ]
+  attribute class { text }?
+step.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/li task/step " ] attribute class { text }?
+cmd.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/ph task/cmd " ] attribute class { text }?
+substeps.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/ol task/substeps " ]
+  attribute class { text }?
+substep.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/li task/substep " ]
+  attribute class { text }?
+tutorialinfo.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/itemgroup task/tutorialinfo " ]
+  attribute class { text }?
+info.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/itemgroup task/info " ]
+  attribute class { text }?
+stepxmp.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/itemgroup task/stepxmp " ]
+  attribute class { text }?
+stepresult.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/itemgroup task/stepresult " ]
+  attribute class { text }?
+choices.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/ul task/choices " ]
+  attribute class { text }?
+choice.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/li task/choice " ]
+  attribute class { text }?
+result.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/section task/result " ]
+  attribute class { text }?
+prereq.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/section task/prereq " ]
+  attribute class { text }?
+postreq.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/section task/postreq " ]
+  attribute class { text }?
+context.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/section task/context " ]
+  attribute class { text }?
+choicetable.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/simpletable task/choicetable " ]
+  attribute class { text }?
+chhead.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/sthead task/chhead " ]
+  attribute class { text }?
+chrow.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/strow task/chrow " ]
+  attribute class { text }?
+choptionhd.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/stentry task/choptionhd " ]
+  attribute class { text }?
+chdeschd.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/stentry task/chdeschd " ]
+  attribute class { text }?
+choption.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/stentry task/choption " ]
+  attribute class { text }?
+chdesc.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/stentry task/chdesc " ]
+  attribute class { text }?
+# ================== End DITA Task  ===========================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/task.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/task.rnc
new file mode 100644
index 0000000..9bd7346
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/task.rnc
@@ -0,0 +1,147 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Task DTD
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+# PUBLIC "-//OASIS//DTD DITA Task//EN"
+#       Delivered as file "task.dtd"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    DTD to describe DITA Tasks
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2006.06.07 RDA: Added indexing domain
+
+# 2006.06.21 RDA: Added props attribute extensions
+
+# =============================================================
+
+# =============================================================
+
+# DOMAIN ENTITY DECLARATIONS
+
+# =============================================================
+
+include "uiDomain.ent.rnc"
+include "highlightDomain.ent.rnc"
+include "programmingDomain.ent.rnc"
+include "softwareDomain.ent.rnc"
+include "utilitiesDomain.ent.rnc"
+include "indexingDomain.ent.rnc"
+# =============================================================
+
+# DOMAIN ATTRIBUTE DECLARATIONS
+
+# =============================================================
+
+# =============================================================
+
+# DOMAIN EXTENSIONS
+
+# =============================================================
+
+# One for each extended base element, with
+# the name of the domain(s) in which the
+# extension was declared
+pre = pre.element | pr-d-pre | sw-d-pre | ui-d-pre
+keyword = keyword.element | pr-d-keyword | sw-d-keyword | ui-d-keyword
+ph = ph.element | pr-d-ph | sw-d-ph | hi-d-ph | ui-d-ph
+fig = fig.element | pr-d-fig | ut-d-fig
+dl = dl.element | pr-d-dl
+index-base = index-base.element | indexing-d-index-base
+# =============================================================
+
+# DOMAIN ATTRIBUTE EXTENSIONS
+
+# =============================================================
+props-attribute-extensions = empty
+base-attribute-extensions = empty
+# =============================================================
+
+# TOPIC NESTING OVERRIDE
+
+# =============================================================
+
+# Redefine the infotype entity to exclude 
+# other topic types and disallow nesting
+task-info-types = task.element
+# =============================================================
+
+# DOMAINS ATTRIBUTE OVERRIDE
+
+# =============================================================
+
+# Must be declared ahead of the DTDs, which
+# puts @domains first in order
+
+# =============================================================
+
+# TOPIC ELEMENT INTEGRATION
+
+# =============================================================
+
+# Embed topic to get generic elements
+include "topic.mod.rnc"
+# Embed task to get specific elements
+include "task.mod.rnc"
+# =============================================================
+
+# DOMAIN ELEMENT INTEGRATION
+
+# =============================================================
+include "uiDomain.mod.rnc"
+include "highlightDomain.mod.rnc"
+include "programmingDomain.mod.rnc"
+include "softwareDomain.mod.rnc"
+include "utilitiesDomain.mod.rnc"
+include "indexingDomain.mod.rnc"
+start = no-topic-nesting.element
+any =
+  (element * {
+     attribute * { text }*,
+     any
+   }
+   | text)*
+# ================== End DITA Task DTD  =======================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/tblDecl.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/tblDecl.mod
new file mode 100644
index 0000000..963daa8
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/tblDecl.mod
@@ -0,0 +1,380 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    XML EXCHANGE TABLE MODEL DECLARATION MODULE       -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!--    2006.06.07 RDA: Make universal attributes universal        -->
+<!--                      (DITA 1.1 proposal #12)                  -->
+
+<!-- ============================================================= -->
+<!--  Delivered as file "tblDecl.mod"                              -->
+<!-- ============================================================= -->
+
+
+<!-- XML EXCHANGE TABLE MODEL DECLARATION MODULE                   -->
+
+<!-- OASIS DITA 1.0 notes:
+     The Exchange Table Model replaces the original CALS-based model
+     used in development versions of the DITA definition.
+     This set of declarations defines the XML version of the Exchange
+     Table Model as adapted for OASIS DITA version 1.0.
+     The base for the DITA version of the Exchange Table Model is
+     defined at http://www.oasis-open.org/specs/tm9901.htm .
+     The DITA version specifically extends this model with these DITA-
+     specific content and attribute adaptations to the DITA processing
+     requirements:
+
+STRUCTURE:
+
+Introduce the DITA-unique <desc> element (optional after <title>); this element
+enables more consistent presentation of both figures and tables.
+
+
+ATTRIBUTES:
+
+For the <table> element, add:
+  %univ-atts; which consists of:
+    %select-atts; [for selection, conditional processing]
+    %id-atts; [for conref and linking]
+    %localization-atts (@translate + @xml:lang) [for NLS processing support]
+    %global-atts; (@xtrf + @xtrc) [for tracing and messaging support in processors]
+    @class [for specialization support]
+  @outputclass [for role designation (ie, styles, future migrations)]
+  @rowheader [for accessibility support in processing]
+  %display-atts; which consists of:
+    @scale [for presentational equivalence with other scaled exhibits: fig, pre, lines, simpletable]
+    @frame (already part of table)
+    @pgwide (already part of table, same intent as original @expanse)
+
+For <tgroup>, <thead>, <tbody>, and <row>, add:
+  %univ-atts;
+  %global-atts;
+  @class
+  @outputclass [for role designation (ie, styles, future migrations)]
+
+For <entry>, add:
+  %id-atts;
+  %global-atts
+  @class
+  @outputclass [for role designation (ie, styles, future migrations)]
+  @rev [for indication of revised content for flag-based processing]
+
+-->
+
+<!-- DITA specialization support: element redefinition for expansion -->
+
+<!ENTITY % table "table">
+<!ENTITY % tgroup "tgroup">
+<!ENTITY % colspec "colspec">
+<!ENTITY % thead "thead">
+<!ENTITY % tbody "tbody">
+<!ENTITY % row "row">
+<!ENTITY % entry "entry">
+
+<!-- The Formal Public Identifier (FPI) for this DITA adaptation of
+     the Exchange Table Model shall be:
+
+     "-//OASIS//ELEMENTS DITA Exchange Table Model//EN"
+
+     This set of declarations may be referred to using a public external
+     entity declaration and reference as shown in the following three
+     lines:
+
+     <!ENTITY % tableXML
+       PUBLIC "-//OASIS//ELEMENTS DITA Exchange Table Model//EN">
+       %tableXML;
+-->
+
+
+
+<!-- In order to use the Exchange table model, various parameter entity
+     declarations are required.  A brief description is as follows:
+
+     ENTITY NAME      WHERE USED              WHAT IT IS
+
+     %yesorno         In ATTLIST of:          An attribute declared value
+                      almost all elements     for a "boolean" attribute
+
+     %paracon         In content model of:    The "text" (logical content)
+                      <entry>                 of the model group for <entry>
+
+     %titles          In content model of:    The "title" part of the model
+                      table element           group for the table element
+
+     %tbl.table.name  In declaration of:      The name of the "table"
+                      table element           element
+
+     %tbl.table-titles.mdl In content model of: The model group for the title
+                      table elements          part of the content model for
+                                              table element
+
+     %tbl.table.mdl   In content model of:    The model group for the content
+                      table elements          model for table element,
+                                              often (and by default) defined
+                                              in terms of %tbl.table-titles.mdl
+                                              and tgroup
+
+     %tbl.table.att   In ATTLIST of:          Additional attributes on the
+                      table element           table element
+
+     %bodyatt         In ATTLIST of:          Additional attributes on the
+                      table element           table element (for backward
+                                              compatibility with the SGML
+                                              model)
+
+     %tbl.tgroup.mdl  In content model of:    The model group for the content
+                      <tgroup>                model for <tgroup>
+
+     %tbl.tgroup.att  In ATTLIST of:          Additional attributes on the
+                      <tgroup>                <tgroup> element
+
+     %tbl.thead.att   In ATTLIST of:          Additional attributes on the
+                      <thead>                 <thead> element
+
+     %tbl.tbody.att   In ATTLIST of:          Additional attributes on the
+                      <tbody>                 <tbody> element
+
+     %tbl.colspec.att In ATTLIST of:          Additional attributes on the
+                      <colspec>               <colspec> element
+
+     %tbl.row.mdl     In content model of:    The model group for the content
+                      <row>                   model for <row>
+
+     %tbl.row.att     In ATTLIST of:          Additional attributes on the
+                      <row>                   <row> element
+
+     %tbl.entry.mdl   In content model of:    The model group for the content
+                      <entry>                 model for <entry>
+
+     %tbl.entry.att   In ATTLIST of:          Additional attributes on the
+                      <entry>                 <entry> element
+
+     This set of declarations will use the default definitions shown below
+     for any of these parameter entities that are not declared before this
+     set of declarations is referenced.
+
+     Note that DITA properties are added in cumulative declarations at the end.
+-->
+
+<!-- These definitions are not directly related to the table model, but are
+     used in the default CALS table model and may be defined elsewhere (and
+     prior to the inclusion of this table module) in the referencing DTD. -->
+
+<!ENTITY % yesorno 'NMTOKEN'> <!-- no if zero(s), yes if any other value -->
+<!ENTITY % titles  'title?'>
+<!ENTITY % paracon '%tblcell.cnt;'> <!-- default for use in entry content -->
+
+<!--
+The parameter entities as defined below change and simplify the CALS table
+model as published (as part of the Example DTD) in MIL-HDBK-28001.  The
+resulting simplified DTD has support from the SGML Open vendors and is
+therefore more interoperable among different systems.
+
+These following declarations provide the Exchange default definitions
+for these entities.  However, these entities can be redefined (by giving
+the appropriate parameter entity declaration(s) prior to the reference
+to this Table Model declaration set entity) to fit the needs of the
+current application.
+
+Note, however, that changes may have significant effect on the ability to
+interchange table information.  These changes may manifest themselves
+in useability, presentation, and possible structure information degradation.
+-->
+
+<!ENTITY % tbl.table.name       "table">
+<!ENTITY % tbl.table-titles.mdl "((%title;)?, (%desc;)?)?,">
+<!ENTITY % tbl.table-main.mdl   "(%tgroup;)+">
+<!ENTITY % tbl.table.mdl        "%tbl.table-titles.mdl; %tbl.table-main.mdl;">
+<!ENTITY % tbl.table.att        "
+    pgwide      %yesorno;       #IMPLIED ">
+<!ENTITY % bodyatt              "">
+<!ENTITY % tbl.tgroup.mdl       "(%colspec;)*, (%thead;)?, %tbody;">
+<!ENTITY % tbl.tgroup.att       "">
+<!ENTITY % tbl.thead.att        "">
+<!ENTITY % tbl.tbody.att        "">
+<!ENTITY % tbl.colspec.att      "">
+<!ENTITY % tbl.row.mdl          "(%entry;)+">
+<!ENTITY % tbl.row.att          "">
+<!ENTITY % tbl.entry.mdl        "(%paracon;)*">
+<!ENTITY % tbl.entry.att        "">
+
+<!-- =====  Element and attribute declarations follow. =====  -->
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.table.name       "table"
+     ENTITY % tbl.table-titles.mdl "%titles;,"
+     ENTITY % tbl.table.mdl        "%tbl.table-titles; tgroup+"
+     ENTITY % tbl.table.att        "
+                        pgwide          %yesorno;       #IMPLIED "
+-->
+
+<!ELEMENT %tbl.table.name; (%tbl.table.mdl;)>
+
+<!ATTLIST %tbl.table.name;
+        frame           (top|bottom|topbot|all|sides|none)      #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        %tbl.table.att;
+        %bodyatt;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.tgroup.mdl    "colspec*,thead?,tbody"
+     ENTITY % tbl.tgroup.att    ""
+-->
+
+<!ELEMENT tgroup (%tbl.tgroup.mdl;) >
+
+<!ATTLIST tgroup
+        cols            NMTOKEN                                 #REQUIRED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        %tbl.tgroup.att;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.colspec.att   ""
+-->
+
+<!ELEMENT colspec EMPTY >
+
+<!ATTLIST colspec
+        colnum          NMTOKEN                                 #IMPLIED
+        colname         NMTOKEN                                 #IMPLIED
+        colwidth        CDATA                                   #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         NMTOKEN                                 #IMPLIED
+        %tbl.colspec.att;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.thead.att      ""
+-->
+
+<!ELEMENT thead ((%row;)+)>
+
+<!ATTLIST thead
+        valign          (top|middle|bottom)                     #IMPLIED
+        %tbl.thead.att;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.tbody.att     ""
+-->
+
+<!ELEMENT tbody (%row;)+>
+
+<!ATTLIST tbody
+        valign          (top|middle|bottom)                     #IMPLIED
+        %tbl.tbody.att;
+>
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % tbl.row.mdl       "entry+"
+     ENTITY % tbl.row.att       ""
+-->
+
+<!ELEMENT row (%tbl.row.mdl;)>
+
+<!ATTLIST row
+        rowsep          %yesorno;                               #IMPLIED
+        valign          (top|middle|bottom)                     #IMPLIED
+        %tbl.row.att;
+>
+
+
+<!--
+     Default declarations previously defined in this entity and
+     referenced below include:
+     ENTITY % paracon           "#PCDATA"
+     ENTITY % tbl.entry.mdl     "(%paracon;)*"
+     ENTITY % tbl.entry.att     ""
+-->
+
+<!ELEMENT entry %tbl.entry.mdl;>
+
+<!ATTLIST entry
+        colname         NMTOKEN                                 #IMPLIED
+        namest          NMTOKEN                                 #IMPLIED
+        nameend         NMTOKEN                                 #IMPLIED
+        morerows        NMTOKEN                                 #IMPLIED
+        colsep          %yesorno;                               #IMPLIED
+        rowsep          %yesorno;                               #IMPLIED
+        align           (left|right|center|justify|char)        #IMPLIED
+        char            CDATA                                   #IMPLIED
+        charoff         NMTOKEN                                 #IMPLIED
+        valign          (top|middle|bottom)                     #IMPLIED
+        %tbl.entry.att;
+>
+
+
+<!-- ============================================================= -->
+<!--                    DITA BEHAVIOR ATTRIBUTES                   -->
+<!-- ============================================================= -->
+
+<!ATTLIST %tbl.table.name;
+        rowheader   (firstcol | norowheader) #IMPLIED
+        scale (50|60|70|80|90|100|110|120|140|160|180|200) #IMPLIED
+        %univ-atts;
+        outputclass CDATA #IMPLIED>
+<!ATTLIST tgroup
+        %univ-atts;
+        outputclass CDATA #IMPLIED>
+<!ATTLIST thead
+        %univ-atts;
+        outputclass CDATA #IMPLIED>
+<!ATTLIST tbody
+        %univ-atts;
+        outputclass CDATA #IMPLIED>
+<!ATTLIST row
+        %univ-atts;
+        outputclass CDATA #IMPLIED>
+<!ATTLIST entry
+        %id-atts;
+        %localization-atts;
+        rev CDATA #IMPLIED
+        outputclass CDATA #IMPLIED>
+<!ATTLIST colspec
+        %id-atts;
+        %localization-atts;>
+
+<!-- ============================================================= -->
+<!--                    DITA SPECIALIZATION ATTRIBUTE DECLARATIONS -->
+<!-- ============================================================= -->
+
+<!ATTLIST table    %global-atts;  class CDATA "- topic/table "       >
+<!ATTLIST tgroup   %global-atts;  class CDATA "- topic/tgroup "      >
+<!ATTLIST colspec  %global-atts;  class CDATA "- topic/colspec "     >
+<!ATTLIST thead    %global-atts;  class CDATA "- topic/thead "       >
+<!ATTLIST tbody    %global-atts;  class CDATA "- topic/tbody "       >
+<!ATTLIST row      %global-atts;  class CDATA "- topic/row "         >
+<!ATTLIST entry    %global-atts;  class CDATA "- topic/entry "       >
+
+
+<!-- ================== End XML Exchange Table Model ============= -->
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/tblDecl.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/tblDecl.mod.rnc
new file mode 100644
index 0000000..0ba1e32
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/tblDecl.mod.rnc
@@ -0,0 +1,361 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    XML EXCHANGE TABLE MODEL DECLARATION MODULE
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# 2006.06.07 RDA: Make universal attributes universal
+
+# (DITA 1.1 proposal #12)
+
+# =============================================================
+
+# Delivered as file "tblDecl.mod"
+
+# =============================================================
+
+# XML EXCHANGE TABLE MODEL DECLARATION MODULE
+
+# OASIS DITA 1.0 notes:
+#      The Exchange Table Model replaces the original CALS-based model
+#      used in development versions of the DITA definition.
+#      This set of declarations defines the XML version of the Exchange
+#      Table Model as adapted for OASIS DITA version 1.0.
+#      The base for the DITA version of the Exchange Table Model is
+#      defined at http://www.oasis-open.org/specs/tm9901.htm .
+#      The DITA version specifically extends this model with these DITA-
+#      specific content and attribute adaptations to the DITA processing
+#      requirements:
+# 
+# STRUCTURE:
+# 
+# Introduce the DITA-unique <desc> element (optional after <title>); this element
+# enables more consistent presentation of both figures and tables.
+# 
+# 
+# ATTRIBUTES:
+# 
+# For the <table> element, add:
+#   %univ-atts; which consists of:
+#     %select-atts; [for selection, conditional processing]
+#     %id-atts; [for conref and linking]
+#     %localization-atts (@translate + @xml:lang) [for NLS processing support]
+#     %global-atts; (@xtrf + @xtrc) [for tracing and messaging support in processors]
+#     @class [for specialization support]
+#   @outputclass [for role designation (ie, styles, future migrations)]
+#   @rowheader [for accessibility support in processing]
+#   %display-atts; which consists of:
+#     @scale [for presentational equivalence with other scaled exhibits: fig, pre, lines, simpletable]
+#     @frame (already part of table)
+#     @pgwide (already part of table, same intent as original @expanse)
+# 
+# For <tgroup>, <thead>, <tbody>, and <row>, add:
+#   %univ-atts;
+#   %global-atts;
+#   @class
+#   @outputclass [for role designation (ie, styles, future migrations)]
+# 
+# For <entry>, add:
+#   %id-atts;
+#   %global-atts
+#   @class
+#   @outputclass [for role designation (ie, styles, future migrations)]
+#   @rev [for indication of revised content for flag-based processing]
+#
+
+# DITA specialization support: element redefinition for expansion
+
+# The Formal Public Identifier (FPI) for this DITA adaptation of
+# the Exchange Table Model shall be:
+# 
+# "-//OASIS//ELEMENTS DITA Exchange Table Model//EN"
+# 
+# This set of declarations may be referred to using a public external
+# entity declaration and reference as shown in the following three
+# lines:
+# 
+# <!ENTITY % tableXML
+#   PUBLIC "-//OASIS//ELEMENTS DITA Exchange Table Model//EN">
+#   %tableXML;
+
+# In order to use the Exchange table model, various parameter entity
+# declarations are required.  A brief description is as follows:
+# 
+# ENTITY NAME      WHERE USED              WHAT IT IS
+# 
+# %yesorno         In ATTLIST of:          An attribute declared value
+#                  almost all elements     for a "boolean" attribute
+# 
+# %paracon         In content model of:    The "text" (logical content)
+#                  <entry>                 of the model group for <entry>
+# 
+# %titles          In content model of:    The "title" part of the model
+#                  table element           group for the table element
+# 
+# %tbl.table.name  In declaration of:      The name of the "table"
+#                  table element           element
+# 
+# %tbl.table-titles.mdl In content model of: The model group for the title
+#                  table elements          part of the content model for
+#                                          table element
+# 
+# %tbl.table.mdl   In content model of:    The model group for the content
+#                  table elements          model for table element,
+#                                          often (and by default) defined
+#                                          in terms of %tbl.table-titles.mdl
+#                                          and tgroup
+# 
+# %tbl.table.att   In ATTLIST of:          Additional attributes on the
+#                  table element           table element
+# 
+# %bodyatt         In ATTLIST of:          Additional attributes on the
+#                  table element           table element (for backward
+#                                          compatibility with the SGML
+#                                          model)
+# 
+# %tbl.tgroup.mdl  In content model of:    The model group for the content
+#                  <tgroup>                model for <tgroup>
+# 
+# %tbl.tgroup.att  In ATTLIST of:          Additional attributes on the
+#                  <tgroup>                <tgroup> element
+# 
+# %tbl.thead.att   In ATTLIST of:          Additional attributes on the
+#                  <thead>                 <thead> element
+# 
+# %tbl.tbody.att   In ATTLIST of:          Additional attributes on the
+#                  <tbody>                 <tbody> element
+# 
+# %tbl.colspec.att In ATTLIST of:          Additional attributes on the
+#                  <colspec>               <colspec> element
+# 
+# %tbl.row.mdl     In content model of:    The model group for the content
+#                  <row>                   model for <row>
+# 
+# %tbl.row.att     In ATTLIST of:          Additional attributes on the
+#                  <row>                   <row> element
+# 
+# %tbl.entry.mdl   In content model of:    The model group for the content
+#                  <entry>                 model for <entry>
+# 
+# %tbl.entry.att   In ATTLIST of:          Additional attributes on the
+#                  <entry>                 <entry> element
+# 
+# This set of declarations will use the default definitions shown below
+# for any of these parameter entities that are not declared before this
+# set of declarations is referenced.
+# 
+# Note that DITA properties are added in cumulative declarations at the end.
+
+# These definitions are not directly related to the table model, but are
+# used in the default CALS table model and may be defined elsewhere (and
+# prior to the inclusion of this table module) in the referencing DTD.
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+yesorno = xsd:NMTOKEN
+# no if zero(s), yes if any other value
+paracon = tblcell.cnt
+# default for use in entry content
+
+# The parameter entities as defined below change and simplify the CALS table
+# model as published (as part of the Example DTD) in MIL-HDBK-28001.  The
+# resulting simplified DTD has support from the SGML Open vendors and is
+# therefore more interoperable among different systems.
+# 
+# These following declarations provide the Exchange default definitions
+# for these entities.  However, these entities can be redefined (by giving
+# the appropriate parameter entity declaration(s) prior to the reference
+# to this Table Model declaration set entity) to fit the needs of the
+# current application.
+# 
+# Note, however, that changes may have significant effect on the ability to
+# interchange table information.  These changes may manifest themselves
+# in useability, presentation, and possible structure information degradation.
+tbl.table-titles.mdl = (title?, desc?)?
+tbl.table-main.mdl = tgroup+
+tbl.table.mdl = tbl.table-titles.mdl | tbl.table-main.mdl
+tbl.table.att = attribute pgwide { yesorno }?
+bodyatt = empty
+tbl.tgroup.mdl = colspec*, thead?, tbody
+tbl.tgroup.att = empty
+tbl.thead.att = empty
+tbl.tbody.att = empty
+tbl.colspec.att = empty
+tbl.row.mdl = entry+
+tbl.row.att = empty
+tbl.entry.mdl = paracon*
+tbl.entry.att = empty
+# =====  Element and attribute declarations follow. =====
+
+# Default declarations previously defined in this entity and
+# referenced below include:
+# ENTITY % tbl.table.name       "table"
+# ENTITY % tbl.table-titles.mdl "%titles;,"
+# ENTITY % tbl.table.mdl        "%tbl.table-titles; tgroup+"
+# ENTITY % tbl.table.att        "
+#                    pgwide          %yesorno;       #IMPLIED "
+table.element = element table { table.attlist, tbl.table.mdl }
+table.attlist &=
+  attribute frame {
+    "top" | "bottom" | "topbot" | "all" | "sides" | "none"
+  }?,
+  attribute colsep { yesorno }?,
+  attribute rowsep { yesorno }?,
+  tbl.table.att,
+  bodyatt
+# Default declarations previously defined in this entity and
+# referenced below include:
+# ENTITY % tbl.tgroup.mdl    "colspec*,thead?,tbody"
+# ENTITY % tbl.tgroup.att    ""
+tgroup.element = element tgroup { tgroup.attlist, tbl.tgroup.mdl }
+tgroup.attlist &=
+  attribute cols { xsd:NMTOKEN },
+  attribute colsep { yesorno }?,
+  attribute rowsep { yesorno }?,
+  attribute align { "left" | "right" | "center" | "justify" | "char" }?,
+  tbl.tgroup.att
+# Default declarations previously defined in this entity and
+# referenced below include:
+# ENTITY % tbl.colspec.att   ""
+colspec.element = element colspec { colspec.attlist, empty }
+colspec.attlist &=
+  attribute colnum { xsd:NMTOKEN }?,
+  attribute colname { xsd:NMTOKEN }?,
+  attribute colwidth { text }?,
+  attribute colsep { yesorno }?,
+  attribute rowsep { yesorno }?,
+  attribute align { "left" | "right" | "center" | "justify" | "char" }?,
+  attribute char { text }?,
+  attribute charoff { xsd:NMTOKEN }?,
+  tbl.colspec.att
+# Default declarations previously defined in this entity and
+# referenced below include:
+# ENTITY % tbl.thead.att      ""
+thead.element = element thead { thead.attlist, row+ }
+thead.attlist &=
+  attribute valign { "top" | "middle" | "bottom" }?,
+  tbl.thead.att
+# Default declarations previously defined in this entity and
+# referenced below include:
+# ENTITY % tbl.tbody.att     ""
+tbody.element = element tbody { tbody.attlist, row+ }
+tbody.attlist &=
+  attribute valign { "top" | "middle" | "bottom" }?,
+  tbl.tbody.att
+# Default declarations previously defined in this entity and
+# referenced below include:
+# ENTITY % tbl.row.mdl       "entry+"
+# ENTITY % tbl.row.att       ""
+row.element = element row { row.attlist, tbl.row.mdl }
+row.attlist &=
+  attribute rowsep { yesorno }?,
+  attribute valign { "top" | "middle" | "bottom" }?,
+  tbl.row.att
+# Default declarations previously defined in this entity and
+# referenced below include:
+# ENTITY % paracon           "#PCDATA"
+# ENTITY % tbl.entry.mdl     "(%paracon;)*"
+# ENTITY % tbl.entry.att     ""
+entry.element = element entry { entry.attlist, tbl.entry.mdl }
+entry.attlist &=
+  attribute colname { xsd:NMTOKEN }?,
+  attribute namest { xsd:NMTOKEN }?,
+  attribute nameend { xsd:NMTOKEN }?,
+  attribute morerows { xsd:NMTOKEN }?,
+  attribute colsep { yesorno }?,
+  attribute rowsep { yesorno }?,
+  attribute align { "left" | "right" | "center" | "justify" | "char" }?,
+  attribute char { text }?,
+  attribute charoff { xsd:NMTOKEN }?,
+  attribute valign { "top" | "middle" | "bottom" }?,
+  tbl.entry.att
+# =============================================================
+
+# DITA BEHAVIOR ATTRIBUTES
+
+# =============================================================
+table.attlist &=
+  attribute rowheader { "firstcol" | "norowheader" }?,
+  attribute scale {
+    "50"
+    | "60"
+    | "70"
+    | "80"
+    | "90"
+    | "100"
+    | "110"
+    | "120"
+    | "140"
+    | "160"
+    | "180"
+    | "200"
+  }?,
+  univ-atts,
+  attribute outputclass { text }?
+tgroup.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+thead.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+tbody.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+row.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+entry.attlist &=
+  id-atts,
+  localization-atts,
+  attribute rev { text }?,
+  attribute outputclass { text }?
+colspec.attlist &= id-atts, localization-atts
+# =============================================================
+
+# DITA SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+table.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/table " ] attribute class { text }?
+tgroup.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/tgroup " ] attribute class { text }?
+colspec.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/colspec " ] attribute class { text }?
+thead.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/thead " ] attribute class { text }?
+tbody.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/tbody " ] attribute class { text }?
+row.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/row " ] attribute class { text }?
+entry.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/entry " ] attribute class { text }?
+# ================== End XML Exchange Table Model =============
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/topic.dtd b/xml/tests/testData/xml/OasisDocumentHighlighting/topic.dtd
new file mode 100644
index 0000000..d2ac390
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/topic.dtd
@@ -0,0 +1,168 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Topic DTD                                    -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//DTD DITA Topic//EN"
+      Delivered as file "topic.dtd"                                -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    DTD to describe DITA Topics                       -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2006.06.07 RDA: Added indexing domain                      -->
+<!--    2006.06.21 RDA: Added props attribute extensions           -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATIONS                 -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % ui-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA User Interface Domain//EN" 
+"uiDomain.ent"                                                       >
+%ui-d-dec;
+
+<!ENTITY % hi-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Highlight Domain//EN" 
+"highlightDomain.ent"                                                >
+%hi-d-dec;
+
+<!ENTITY % pr-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Programming Domain//EN" 
+"programmingDomain.ent"                                              >
+%pr-d-dec;
+
+<!ENTITY % sw-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Software Domain//EN" 
+"softwareDomain.ent"                                                 >
+%sw-d-dec;
+
+<!ENTITY % ut-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Utilities Domain//EN" 
+"utilitiesDomain.ent"                                                >
+%ut-d-dec;
+
+<!ENTITY % indexing-d-dec     PUBLIC 
+"-//OASIS//ENTITIES DITA Indexing Domain//EN" 
+"indexingDomain.ent"                                                 >
+%indexing-d-dec;
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE DECLARATIONS              -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN EXTENSIONS                          -->
+<!-- ============================================================= -->
+<!--                    One for each extended base element, with
+                        the name of the domain(s) in which the
+                        extension was declared                     -->
+
+<!ENTITY % pre          "pre     | %pr-d-pre;     | %sw-d-pre;     | 
+                                   %ui-d-pre;"                       >
+<!ENTITY % keyword      "keyword | %pr-d-keyword; | %sw-d-keyword; |
+                                   %ui-d-keyword;"                   >
+<!ENTITY % ph           "ph      | %pr-d-ph;      | %sw-d-ph;      | 
+                                    %hi-d-ph;     | %ui-d-ph;"       >
+<!ENTITY % fig          "fig     | %pr-d-fig;     | %ut-d-fig;"      >
+<!ENTITY % dl           "dl      | %pr-d-dl;"                        >
+<!ENTITY % index-base   "index-base | %indexing-d-index-base;"       >
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ATTRIBUTE EXTENSIONS                -->
+<!-- ============================================================= -->
+<!ENTITY % props-attribute-extensions  ""                            >
+<!ENTITY % base-attribute-extensions   ""                            >
+
+
+<!-- ============================================================= -->
+<!--                    TOPIC NESTING OVERRIDE                     -->
+<!-- ============================================================= -->
+
+<!--                    Redefine the infotype entity to exclude 
+                        other topic types and disallow nesting     -->
+<!ENTITY % topic-info-types 
+                        "topic"                                      >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+<!--                    Must be declared ahead of the DTDs, which
+                        puts @domains first in order               -->
+
+<!ENTITY included-domains 
+                        "&ui-d-att; &hi-d-att; &pr-d-att; &sw-d-att;
+                         &ut-d-att; &indexing-d-att;"                >
+
+
+<!-- ============================================================= -->
+<!--                    TOPIC ELEMENT INTEGRATION                  -->
+<!-- ============================================================= -->
+
+<!--                    Embed topic to get generic elements        -->
+<!ENTITY % topic-type   PUBLIC 
+"-//OASIS//ELEMENTS DITA Topic//EN" 
+"topic.mod"                                                          >
+%topic-type;
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ELEMENT INTEGRATION                 -->
+<!-- ============================================================= -->
+
+<!ENTITY % ui-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA User Interface Domain//EN" 
+"uiDomain.mod"                                                       >
+%ui-d-def;
+
+<!ENTITY % hi-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Highlight Domain//EN" 
+"highlightDomain.mod"                                                >
+%hi-d-def;
+
+<!ENTITY % pr-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Programming Domain//EN" 
+"programmingDomain.mod"                                              >
+%pr-d-def;
+
+<!ENTITY % sw-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Software Domain//EN" 
+"softwareDomain.mod"                                                 >
+%sw-d-def;
+
+<!ENTITY % ut-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Utilities Domain//EN" 
+"utilitiesDomain.mod"                                                >
+%ut-d-def;
+
+<!ENTITY % indexing-d-def     PUBLIC 
+"-//OASIS//ELEMENTS DITA Indexing Domain//EN" 
+"indexingDomain.mod"                                                 >
+%indexing-d-def;
+
+
+<!-- ================== End DITA Topic DTD  ====================== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/topic.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/topic.mod
new file mode 100644
index 0000000..cd834c4
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/topic.mod
@@ -0,0 +1,416 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA DITA Topic                                   -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA Topic//EN"
+      Delivered as file "topic.mod"                                -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the elements and specialization         -->
+<!--             attributes for the base Topic type                -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Corrected the public ID for tblDecl.mod    -->
+<!--    2005.11.15 RDA: Removed old declaration for topicreftypes  -->
+<!--                    entity                                     -->
+<!--    2005.11.15 RDA: Corrected the PURPOSE in this comment      -->
+<!--    2005.11.15 RDA: Corrected Long Names for alt, indextermref -->
+<!--    2006.06.06 RDA: Bug fixes:                                 -->
+<!--                    Added xref and fn to fig.cnt               -->
+<!--                    Remove xmlns="" from global-atts           -->
+<!--    2006.06.06 RDA: Moved shared items to commonElements file  -->
+<!--    2006.06.07 RDA: Added <abstract> element                   -->
+<!--    2006.06.07 RDA: Make universal attributes universal        -->
+<!--                      (DITA 1.1 proposal #12)                  -->
+<!--    2006.06.14 RDA: Add dir attribute to localization-atts     -->
+<!--    2006.06.20 RDA: defn.cnt now explicitly sets its content   -->
+<!--    2006.07.06 RDA: Moved class attributes in from topicAttr   -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                   ARCHITECTURE ENTITIES                       -->
+<!-- ============================================================= -->
+
+<!-- default namespace prefix for DITAArchVersion attribute can be
+     overridden through predefinition in the document type shell   -->
+<!ENTITY % DITAArchNSPrefix
+                       "ditaarch"                                    >
+
+<!-- must be instanced on each topic type                          -->
+<!ENTITY % arch-atts "
+             xmlns:%DITAArchNSPrefix; 
+                        CDATA                              #FIXED
+                       'http://dita.oasis-open.org/architecture/2005/'
+             %DITAArchNSPrefix;:DITAArchVersion
+                        CDATA                              #FIXED
+                       '1.1'"                                        >
+
+
+<!-- ============================================================= -->
+<!--                   ELEMENT NAME ENTITIES                       -->
+<!-- ============================================================= -->
+
+<!--                    Definitions of declared elements           -->
+<!ENTITY % topicDefns   PUBLIC 
+                       "-//OASIS//ENTITIES DITA Topic Definitions//EN" 
+                       "topicDefn.ent"                              >
+%topicDefns;
+
+<!--                      Content elements common to map and topic -->
+<!ENTITY % commonElements      PUBLIC 
+"-//OASIS//ELEMENTS DITA Common Elements//EN" "commonElements.mod"   >
+%commonElements;
+
+<!--                       MetaData Elements, plus indexterm       -->
+<!ENTITY % metaXML         PUBLIC 
+"-//OASIS//ELEMENTS DITA Metadata//EN" 
+"metaDecl.mod"                                                       >
+%metaXML;
+
+
+<!-- ============================================================= -->
+<!--                    ENTITY DECLARATIONS FOR ATTRIBUTE VALUES   -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    COMMON ATTLIST SETS                        -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % body.cnt             "%basic.block; | %required-cleanup; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % section.cnt          "#PCDATA | %basic.ph; | %basic.block; | %title; |  %txt.incl; | %data.elements.incl; | %foreign.unknown.incl;">
+<!ENTITY % section.notitle.cnt  "#PCDATA | %basic.ph; | %basic.block; |             %txt.incl; | %data.elements.incl; | %foreign.unknown.incl;">
+
+
+<!-- ============================================================= -->
+<!--                COMMON ENTITY DECLARATIONS                     -->
+<!-- ============================================================= -->
+
+<!-- for use within the DTD and supported topics; these will NOT work
+     outside of this DTD or dtds that specialize from it!          -->
+<!ENTITY nbsp                   "&#160;"                             >
+
+
+<!-- ============================================================= -->
+<!--                    NOTATION DECLARATIONS                      -->
+<!-- ============================================================= -->
+<!--                    DITA uses the direct reference model; 
+                        notations may be added later as required   -->
+
+
+<!-- ============================================================= -->
+<!--                    STRUCTURAL MEMBERS                         -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % info-types    'topic'                                     > 
+
+
+<!-- ============================================================= -->
+<!--                    COMMON ATTLIST SETS                        -->
+<!-- ============================================================= -->
+
+<!-- Copied into metaDecl.mod -->
+<!--<!ENTITY % date-format 'CDATA'                                >-->
+
+<!ENTITY % rel-atts      
+            'type       CDATA                              #IMPLIED
+             role      (parent | child | sibling | 
+                        friend | next | previous | cousin | 
+                        ancestor | descendant | sample | 
+                        external | other)                  #IMPLIED
+             otherrole  CDATA                              #IMPLIED' >
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION OF DECLARED ELEMENTS        -->
+<!-- ============================================================= -->
+
+<!ENTITY % topic-info-types "%info-types;">
+
+
+<!-- ============================================================= -->
+<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
+<!-- ============================================================= -->
+
+<!ENTITY included-domains ""                                         >
+  
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+
+<!--                    LONG NAME: Topic                           -->
+<!ELEMENT topic         ((%title;), (%titlealts;)?,
+                         (%shortdesc; | %abstract;)?, 
+                         (%prolog;)?, (%body;)?, (%related-links;)?,
+                         (%topic-info-types;)* )                     >
+<!ATTLIST topic           
+             id         ID                                 #REQUIRED
+             conref     CDATA                              #IMPLIED
+             %select-atts;
+             %localization-atts;
+             outputclass 
+                        CDATA                              #IMPLIED
+             %arch-atts;
+             domains    CDATA                    "&included-domains;">
+
+
+<!--                    LONG NAME: Title Alternatives              -->
+<!ELEMENT titlealts     ((%navtitle;)?, (%searchtitle;)?)            >
+<!ATTLIST titlealts      
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Navigation Title                -->
+<!ELEMENT navtitle      (%words.cnt;)*                               >
+<!ATTLIST navtitle     
+             %univ-atts;                                             >
+
+<!--                    LONG NAME: Search Title                    -->
+<!ELEMENT searchtitle   (%words.cnt;)*                               >
+<!ATTLIST searchtitle     
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Abstract                        -->
+<!ELEMENT abstract      (%section.notitle.cnt; | %shortdesc;)*       >
+<!ATTLIST abstract         
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+                        
+<!--                    LONG NAME: Short Description               -->
+<!--
+<!ELEMENT shortdesc     (%title.cnt;)*                               >
+<!ATTLIST shortdesc    
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+-->
+
+
+<!--                    LONG NAME: Body                            -->
+<!ELEMENT body          (%body.cnt; | %section; | %example;)*        >
+<!ATTLIST body            
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: No Topic nesting                -->
+<!ELEMENT no-topic-nesting EMPTY                                     >
+
+
+<!--                    LONG NAME: Section                         -->
+<!ELEMENT section       (%section.cnt;)*                             >
+<!ATTLIST section         
+             spectitle  CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Example                         -->
+<!ELEMENT example       (%section.cnt;)*                             >
+<!ATTLIST example         
+             spectitle  CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Description                     -->
+<!--                    Desc is used in context with figure and 
+                        table titles and also for content models 
+                        within linkgroup and object (for 
+                        accessibility)                             -->
+<!--
+<!ELEMENT desc          (%desc.cnt;)*                                >
+<!ATTLIST desc           
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+-->
+
+<!-- ============================================================= -->
+<!--                    PROLOG (METADATA FOR TOPICS)               -->
+<!--                    TYPED DATA ELEMENTS                        -->
+<!-- ============================================================= -->
+<!--                    typed content definitions                  -->
+<!--                    typed, localizable content                 -->
+
+<!--                    LONG NAME: Prolog                          -->
+<!ELEMENT prolog        ((%author;)*, (%source;)?, (%publisher;)?,
+                         (%copyright;)*, (%critdates;)?,
+                         (%permissions;)?, (%metadata;)*, 
+                         (%resourceid;)*,
+                         (%data.elements.incl; | 
+                          %foreign.unknown.incl;)*)                  >
+<!ATTLIST prolog        
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Metadata                        -->
+<!ELEMENT metadata       ((%audience;)*, (%category;)*, (%keywords;)*,
+                          (%prodinfo;)*, (%othermeta;)*, 
+                          (%data.elements.incl; |
+                           %foreign.unknown.incl;)*)                 >
+<!ATTLIST metadata
+              %univ-atts;        
+              mapkeyref CDATA                             #IMPLIED   >
+
+
+
+<!-- ============================================================= -->
+<!--                    BASIC DOCUMENT ELEMENT DECLARATIONS        -->
+<!--                    (rich text)                                -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                   BASE FORM PHRASE TYPES                      -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                      LINKING GROUPING                         -->
+<!-- ============================================================= -->
+
+
+<!--                    LONG NAME: Related Links                   -->
+<!ELEMENT related-links (%link; | %linklist; | %linkpool;)+          >
+<!ATTLIST related-links  
+             %rel-atts;
+             %univ-atts;
+             format     CDATA                            #IMPLIED
+             scope      (local | peer | external)        #IMPLIED
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Link                            -->
+<!ELEMENT link          ((%linktext;)?, (%desc;)?)                   >
+<!ATTLIST link            
+             href       CDATA                            #IMPLIED
+             keyref     CDATA                            #IMPLIED
+             query      CDATA                            #IMPLIED
+             %rel-atts;
+             %univ-atts;
+             format     CDATA                            #IMPLIED
+             scope      (local | peer | external)        #IMPLIED
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Link Text                       -->
+<!ELEMENT linktext      (%words.cnt;)*                               >
+<!ATTLIST linktext        
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Link List                       -->
+<!ELEMENT linklist      ((%title;)?, (%desc;)?,
+                         (%linklist; | %link;)*, (%linkinfo;)?)      >
+<!ATTLIST linklist        
+            collection-type 
+                        (unordered | sequence | choice |
+                         tree | family)                   #IMPLIED
+             duplicates (yes | no)                        #IMPLIED
+                          mapkeyref CDATA #IMPLIED
+             %rel-atts;
+             %univ-atts;
+             spectitle  CDATA                            #IMPLIED
+             format     CDATA                            #IMPLIED
+             scope      (local | peer | external)        #IMPLIED
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Link Information                -->
+<!ELEMENT linkinfo      (%desc.cnt;)*                                >
+<!ATTLIST linkinfo        
+             %univ-atts;                                             >
+
+
+<!--                    LONG NAME: Link Pool                       -->
+<!ELEMENT linkpool      (%linkpool; | %link;)*                       >
+<!ATTLIST linkpool        
+             collection-type 
+                        (unordered | sequence | choice |
+                         tree | family)                   #IMPLIED
+             duplicates (yes | no)                        #IMPLIED
+             mapkeyref  CDATA                             #IMPLIED
+             %rel-atts;
+             %univ-atts;
+             format     CDATA   #IMPLIED
+             scope      (local | peer | external)        #IMPLIED
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+
+<!-- ============================================================= -->
+<!--                    MODULES CALLS                              -->
+<!-- ============================================================= -->
+
+
+<!--                      Table Elements                           -->
+<!--    2005.11.15 RDA: Corrected the public ID for tblDecl.mod,   -->
+<!--  from the old value "-//OASIS//ELEMENTS DITA CALS Tables//EN" -->
+<!-- Tables are now part of commonElements -->
+<!--<!ENTITY % tableXML       PUBLIC  
+"-//OASIS//ELEMENTS DITA Exchange Table Model//EN" 
+"tblDecl.mod"                                                        >
+%tableXML;-->
+
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+            
+<!ATTLIST abstract  %global-atts;  class CDATA "- topic/abstract "   >
+<!ATTLIST body      %global-atts;  class CDATA "- topic/body "       >
+<!ATTLIST example   %global-atts;  class CDATA "- topic/example "    >
+<!ATTLIST link      %global-atts;  class CDATA "- topic/link "       >
+<!ATTLIST linkinfo  %global-atts;  class CDATA "- topic/linkinfo "   >
+<!ATTLIST linklist  %global-atts;  class CDATA "- topic/linklist "   >
+<!ATTLIST linkpool  %global-atts;  class CDATA "- topic/linkpool "   >
+<!ATTLIST linktext  %global-atts;  class CDATA "- topic/linktext "   >
+<!ATTLIST metadata  %global-atts;  class CDATA "- topic/metadata "   >
+<!ATTLIST navtitle  %global-atts;  class CDATA "- topic/navtitle "   >
+<!ATTLIST no-topic-nesting 
+                    %global-atts;  class CDATA "- topic/no-topic-nesting ">
+<!ATTLIST prolog    %global-atts;  class CDATA "- topic/prolog "     >
+<!ATTLIST related-links 
+                    %global-atts;  class CDATA "- topic/related-links ">
+<!ATTLIST searchtitle 
+                    %global-atts;  class CDATA "- topic/searchtitle ">
+<!ATTLIST section   %global-atts;  class CDATA "- topic/section "    >
+<!ATTLIST titlealts %global-atts;  class CDATA "- topic/titlealts "  >
+<!ATTLIST topic     %global-atts;  class CDATA "- topic/topic "      >
+
+<!-- Shortdesc in map uses map/shortdesc so this one must be 
+     included, even though the element is common. -->
+<!ATTLIST shortdesc   %global-atts;  class CDATA "- topic/shortdesc ">
+
+<!-- ================== End DITA Topic  ========================== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/topic.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/topic.mod.rnc
new file mode 100644
index 0000000..4ebbfa9
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/topic.mod.rnc
@@ -0,0 +1,505 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA DITA Topic
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA Topic//EN"
+#       Delivered as file "topic.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the elements and specialization
+
+# attributes for the base Topic type
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Corrected the public ID for tblDecl.mod
+
+# 2005.11.15 RDA: Removed old declaration for topicreftypes
+
+# entity
+
+# 2005.11.15 RDA: Corrected the PURPOSE in this comment
+
+# 2005.11.15 RDA: Corrected Long Names for alt, indextermref
+
+# 2006.06.06 RDA: Bug fixes:
+
+# Added xref and fn to fig.cnt
+
+# Remove xmlns="" from global-atts
+
+# 2006.06.06 RDA: Moved shared items to commonElements file
+
+# 2006.06.07 RDA: Added <abstract> element
+
+# 2006.06.07 RDA: Make universal attributes universal
+
+# (DITA 1.1 proposal #12)
+
+# 2006.06.14 RDA: Add dir attribute to localization-atts
+
+# 2006.06.20 RDA: defn.cnt now explicitly sets its content
+
+# 2006.07.06 RDA: Moved class attributes in from topicAttr
+
+# =============================================================
+
+# =============================================================
+
+# ARCHITECTURE ENTITIES
+
+# =============================================================
+
+# default namespace prefix for DITAArchVersion attribute can be
+# overridden through predefinition in the document type shell
+
+# must be instanced on each topic type
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+namespace ditaarch = "http://dita.oasis-open.org/architecture/2005/"
+
+arch-atts =
+  [ a:defaultValue = "1.1" ]
+  attribute ditaarch:DITAArchVersion { string "1.1" }?
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+# Definitions of declared elements
+include "topicDefn.ent.rnc"
+# Content elements common to map and topic
+include "commonElements.mod.rnc"
+# MetaData Elements, plus indexterm
+include "metaDecl.mod.rnc"
+# =============================================================
+
+# ENTITY DECLARATIONS FOR ATTRIBUTE VALUES
+
+# =============================================================
+
+# =============================================================
+
+# COMMON ATTLIST SETS
+
+# =============================================================
+body.cnt =
+  basic.block
+  | required-cleanup
+  | data.elements.incl
+  | foreign.unknown.incl
+section.cnt =
+  text
+  | basic.ph
+  | basic.block
+  | title
+  | txt.incl
+  | data.elements.incl
+  | foreign.unknown.incl
+section.notitle.cnt =
+  text
+  | basic.ph
+  | basic.block
+  | txt.incl
+  | data.elements.incl
+  | foreign.unknown.incl
+# =============================================================
+
+# COMMON ENTITY DECLARATIONS
+
+# =============================================================
+
+# for use within the DTD and supported topics; these will NOT work
+# outside of this DTD or dtds that specialize from it!
+
+# =============================================================
+
+# NOTATION DECLARATIONS
+
+# =============================================================
+
+# DITA uses the direct reference model; 
+# notations may be added later as required
+
+# =============================================================
+
+# STRUCTURAL MEMBERS
+
+# =============================================================
+info-types = topic.element
+# =============================================================
+
+# COMMON ATTLIST SETS
+
+# =============================================================
+
+# Copied into metaDecl.mod
+
+# <!ENTITY % date-format 'CDATA'                                >
+rel-atts =
+  attribute type { text }?,
+  attribute role {
+    "parent"
+    | "child"
+    | "sibling"
+    | "friend"
+    | "next"
+    | "previous"
+    | "cousin"
+    | "ancestor"
+    | "descendant"
+    | "sample"
+    | "external"
+    | "other"
+  }?,
+  attribute otherrole { text }?
+# =============================================================
+
+# SPECIALIZATION OF DECLARED ELEMENTS
+
+# =============================================================
+topic-info-types = info-types
+# =============================================================
+
+# DOMAINS ATTRIBUTE OVERRIDE
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT DECLARATIONS
+
+# =============================================================
+
+# LONG NAME: Topic
+topic.element =
+  element topic {
+    topic.attlist,
+    title,
+    titlealts?,
+    (shortdesc | abstract)?,
+    prolog?,
+    body?,
+    related-links?,
+    topic-info-types*
+  }
+topic.attlist &=
+  attribute id { xsd:ID },
+  attribute conref { text }?,
+  select-atts,
+  localization-atts,
+  attribute outputclass { text }?,
+  arch-atts,
+  [
+    a:defaultValue =
+      "(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                          (topic ut-d) (topic indexing-d)"
+  ]
+  attribute domains { text }?
+# LONG NAME: Title Alternatives
+titlealts.element =
+  element titlealts { titlealts.attlist, navtitle?, searchtitle? }
+titlealts.attlist &= univ-atts
+# LONG NAME: Navigation Title
+navtitle.element = element navtitle { navtitle.attlist, words.cnt* }
+navtitle.attlist &= univ-atts
+# LONG NAME: Search Title
+searchtitle.element =
+  element searchtitle { searchtitle.attlist, words.cnt* }
+searchtitle.attlist &= univ-atts
+# LONG NAME: Abstract
+abstract.element =
+  element abstract {
+    abstract.attlist, (section.notitle.cnt | shortdesc)*
+  }
+abstract.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Short Description
+
+# <!ELEMENT shortdesc     (%title.cnt;)*                               >
+# <!ATTLIST shortdesc    
+#              %univ-atts;
+#              outputclass 
+#                         CDATA                            #IMPLIED    >
+
+# LONG NAME: Body
+body.element =
+  element body { body.attlist, (body.cnt | section | example)* }
+body.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: No Topic nesting
+no-topic-nesting.element =
+  element no-topic-nesting { no-topic-nesting.attlist, empty }
+# LONG NAME: Section
+section.element = element section { section.attlist, section.cnt* }
+section.attlist &=
+  attribute spectitle { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Example
+example.element = element example { example.attlist, section.cnt* }
+example.attlist &=
+  attribute spectitle { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Description
+
+# Desc is used in context with figure and 
+# table titles and also for content models 
+# within linkgroup and object (for 
+# accessibility)
+
+# <!ELEMENT desc          (%desc.cnt;)*                                >
+# <!ATTLIST desc           
+#              %univ-atts;
+#              outputclass 
+#                         CDATA                            #IMPLIED    >
+
+# =============================================================
+
+# PROLOG (METADATA FOR TOPICS)
+
+# TYPED DATA ELEMENTS
+
+# =============================================================
+
+# typed content definitions
+
+# typed, localizable content
+
+# LONG NAME: Prolog
+prolog.element =
+  element prolog {
+    prolog.attlist,
+    author*,
+    source?,
+    publisher?,
+    copyright*,
+    critdates?,
+    permissions?,
+    metadata*,
+    resourceid*,
+    (data.elements.incl | foreign.unknown.incl)*
+  }
+prolog.attlist &= univ-atts
+# LONG NAME: Metadata
+metadata.element =
+  element metadata {
+    metadata.attlist,
+    audience*,
+    category*,
+    keywords*,
+    prodinfo*,
+    othermeta*,
+    (data.elements.incl | foreign.unknown.incl)*
+  }
+metadata.attlist &=
+  univ-atts,
+  attribute mapkeyref { text }?
+# =============================================================
+
+# BASIC DOCUMENT ELEMENT DECLARATIONS
+
+# (rich text)
+
+# =============================================================
+
+# =============================================================
+
+# BASE FORM PHRASE TYPES
+
+# =============================================================
+
+# =============================================================
+
+# LINKING GROUPING
+
+# =============================================================
+
+# LONG NAME: Related Links
+related-links.element =
+  element related-links {
+    related-links.attlist, (link | linklist | linkpool)+
+  }
+related-links.attlist &=
+  rel-atts,
+  univ-atts,
+  attribute format { text }?,
+  attribute scope { "local" | "peer" | "external" }?,
+  attribute outputclass { text }?
+# LONG NAME: Link
+link.element = element link { link.attlist, linktext?, desc? }
+link.attlist &=
+  attribute href { text }?,
+  attribute keyref { text }?,
+  attribute query { text }?,
+  rel-atts,
+  univ-atts,
+  attribute format { text }?,
+  attribute scope { "local" | "peer" | "external" }?,
+  attribute outputclass { text }?
+# LONG NAME: Link Text
+linktext.element = element linktext { linktext.attlist, words.cnt* }
+linktext.attlist &= univ-atts
+# LONG NAME: Link List
+linklist.element =
+  element linklist {
+    linklist.attlist, title?, desc?, (linklist | link)*, linkinfo?
+  }
+linklist.attlist &=
+  attribute collection-type {
+    "unordered" | "sequence" | "choice" | "tree" | "family"
+  }?,
+  attribute duplicates { "yes" | "no" }?,
+  attribute mapkeyref { text }?,
+  rel-atts,
+  univ-atts,
+  attribute spectitle { text }?,
+  attribute format { text }?,
+  attribute scope { "local" | "peer" | "external" }?,
+  attribute outputclass { text }?
+# LONG NAME: Link Information
+linkinfo.element = element linkinfo { linkinfo.attlist, desc.cnt* }
+linkinfo.attlist &= univ-atts
+# LONG NAME: Link Pool
+linkpool.element =
+  element linkpool { linkpool.attlist, (linkpool | link)* }
+linkpool.attlist &=
+  attribute collection-type {
+    "unordered" | "sequence" | "choice" | "tree" | "family"
+  }?,
+  attribute duplicates { "yes" | "no" }?,
+  attribute mapkeyref { text }?,
+  rel-atts,
+  univ-atts,
+  attribute format { text }?,
+  attribute scope { "local" | "peer" | "external" }?,
+  attribute outputclass { text }?
+# =============================================================
+
+# MODULES CALLS
+
+# =============================================================
+
+# Table Elements
+
+# 2005.11.15 RDA: Corrected the public ID for tblDecl.mod,
+
+# from the old value "-//OASIS//ELEMENTS DITA CALS Tables//EN"
+
+# Tables are now part of commonElements
+
+# <!ENTITY % tableXML       PUBLIC  
+# "-//OASIS//ELEMENTS DITA Exchange Table Model//EN" 
+# "tblDecl.mod"                                                        >
+# %tableXML;
+
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+abstract.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/abstract " ] attribute class { text }?
+body.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/body " ] attribute class { text }?
+example.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/example " ] attribute class { text }?
+link.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/link " ] attribute class { text }?
+linkinfo.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/linkinfo " ] attribute class { text }?
+linklist.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/linklist " ] attribute class { text }?
+linkpool.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/linkpool " ] attribute class { text }?
+linktext.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/linktext " ] attribute class { text }?
+metadata.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/metadata " ] attribute class { text }?
+navtitle.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/navtitle " ] attribute class { text }?
+no-topic-nesting.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/no-topic-nesting " ]
+  attribute class { text }?
+prolog.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/prolog " ] attribute class { text }?
+related-links.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/related-links " ]
+  attribute class { text }?
+searchtitle.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/searchtitle " ] attribute class { text }?
+section.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/section " ] attribute class { text }?
+titlealts.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/titlealts " ] attribute class { text }?
+topic.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/topic " ] attribute class { text }?
+# Shortdesc in map uses map/shortdesc so this one must be 
+# included, even though the element is common.
+shortdesc.attlist &=
+  global-atts,
+  [ a:defaultValue = "- topic/shortdesc " ] attribute class { text }?
+# ================== End DITA Topic  ==========================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/topic.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/topic.rnc
new file mode 100644
index 0000000..59a2249
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/topic.rnc
@@ -0,0 +1,146 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Topic DTD
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//DTD DITA Topic//EN"
+#       Delivered as file "topic.dtd"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    DTD to describe DITA Topics
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2006.06.07 RDA: Added indexing domain
+
+# 2006.06.21 RDA: Added props attribute extensions
+
+# =============================================================
+
+# =============================================================
+
+# DOMAIN ENTITY DECLARATIONS
+
+# =============================================================
+
+include "uiDomain.ent.rnc"
+include "highlightDomain.ent.rnc"
+include "programmingDomain.ent.rnc"
+include "softwareDomain.ent.rnc"
+include "utilitiesDomain.ent.rnc"
+include "indexingDomain.ent.rnc"
+# =============================================================
+
+# DOMAIN ATTRIBUTE DECLARATIONS
+
+# =============================================================
+
+# =============================================================
+
+# DOMAIN EXTENSIONS
+
+# =============================================================
+
+# One for each extended base element, with
+# the name of the domain(s) in which the
+# extension was declared
+pre = pre.element | pr-d-pre | sw-d-pre | ui-d-pre
+keyword = keyword.element | pr-d-keyword | sw-d-keyword | ui-d-keyword
+ph = ph.element | pr-d-ph | sw-d-ph | hi-d-ph | ui-d-ph
+fig = fig.element | pr-d-fig | ut-d-fig
+dl = dl.element | pr-d-dl
+index-base = index-base.element | indexing-d-index-base
+# =============================================================
+
+# DOMAIN ATTRIBUTE EXTENSIONS
+
+# =============================================================
+props-attribute-extensions = empty
+base-attribute-extensions = empty
+# =============================================================
+
+# TOPIC NESTING OVERRIDE
+
+# =============================================================
+
+# Redefine the infotype entity to exclude 
+# other topic types and disallow nesting
+topic-info-types = topic.element
+# =============================================================
+
+# DOMAINS ATTRIBUTE OVERRIDE
+
+# =============================================================
+
+# Must be declared ahead of the DTDs, which
+# puts @domains first in order
+
+# =============================================================
+
+# TOPIC ELEMENT INTEGRATION
+
+# =============================================================
+
+# Embed topic to get generic elements
+include "topic.mod.rnc"
+# =============================================================
+
+# DOMAIN ELEMENT INTEGRATION
+
+# =============================================================
+include "uiDomain.mod.rnc"
+include "highlightDomain.mod.rnc"
+include "programmingDomain.mod.rnc"
+include "softwareDomain.mod.rnc"
+include "utilitiesDomain.mod.rnc"
+include "indexingDomain.mod.rnc"
+start = no-topic-nesting.element
+any =
+  (element * {
+     attribute * { text }*,
+     any
+   }
+   | text)*
+# ================== End DITA Topic DTD  ======================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/topicAttr.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/topicAttr.mod
new file mode 100644
index 0000000..6bccf81
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/topicAttr.mod
@@ -0,0 +1,69 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Topic Class Entities                         -->
+<!--  VERSION:   1.0.1                                             -->
+<!--  DATE:      November 2005                                     -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ENTITIES DITA Topic Class//EN"
+      Delivered as file "topicAttr.mod"                            -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the Topic specialization attributes     -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005.                    -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Removed extra declaration for <title>      -->
+<!--                    attributes                                 -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!--    2006.05.05 RDA: Moved shared items to commonElements file  --> 
+<!--    2006.06.07 RDA: Added <abstract> element                   -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+
+<!ATTLIST abstract  %global-atts;  class CDATA "- topic/abstract "   >
+<!ATTLIST body      %global-atts;  class CDATA "- topic/body "       >
+<!ATTLIST example   %global-atts;  class CDATA "- topic/example "    >
+<!ATTLIST link      %global-atts;  class CDATA "- topic/link "       >
+<!ATTLIST linkinfo  %global-atts;  class CDATA "- topic/linkinfo "   >
+<!ATTLIST linklist  %global-atts;  class CDATA "- topic/linklist "   >
+<!ATTLIST linkpool  %global-atts;  class CDATA "- topic/linkpool "   >
+<!ATTLIST linktext  %global-atts;  class CDATA "- topic/linktext "   >
+<!ATTLIST metadata  %global-atts;  class CDATA "- topic/metadata "   >
+<!ATTLIST navtitle  %global-atts;  class CDATA "- topic/navtitle "   >
+<!ATTLIST no-topic-nesting 
+                    %global-atts;  class CDATA "- topic/no-topic-nesting ">
+<!ATTLIST prolog    %global-atts;  class CDATA "- topic/prolog "     >
+<!ATTLIST related-links 
+                    %global-atts;  class CDATA "- topic/related-links ">
+<!ATTLIST searchtitle 
+                    %global-atts;  class CDATA "- topic/searchtitle ">
+<!ATTLIST section   %global-atts;  class CDATA "- topic/section "    >
+<!ATTLIST titlealts %global-atts;  class CDATA "- topic/titlealts "  >
+<!ATTLIST topic     %global-atts;  class CDATA "- topic/topic "      >
+
+<!-- Shortdesc in map uses map/shortdesc so this one must be 
+     included, even though it is common. -->
+<!ATTLIST shortdesc   %global-atts;  class CDATA "- topic/shortdesc "  >
+
+<!-- ================== End Topic Class Entities ================= -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/topicDefn.ent b/xml/tests/testData/xml/OasisDocumentHighlighting/topicDefn.ent
new file mode 100644
index 0000000..b7062c0
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/topicDefn.ent
@@ -0,0 +1,72 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Topic Definitions                            -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+PUBLIC"-//OASIS//ENTITIES DITA Topic Definitions//EN"
+      Delivered as file "topicDefn.ent"                            -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the topic definitions                   -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Removed old declarations for spanspec and  -->
+<!--                    tfoot entities                             -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!--    2006.07.06 RDA: Moved common elements to the module        -->
+<!--                    commonElements.ent                         -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT NAME ENTITIES                      -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % topic        "topic"                                      >
+<!ENTITY % abstract     "abstract"                                   >
+<!ENTITY % body         "body"                                       >
+<!ENTITY % example      "example"                                    >
+<!ENTITY % link         "link"                                       >
+<!ENTITY % linkinfo     "linkinfo"                                   >
+<!ENTITY % linklist     "linklist"                                   >
+<!ENTITY % linkpool     "linkpool"                                   >
+<!ENTITY % linktext     "linktext"                                   >
+<!ENTITY % metadata     "metadata"                                   >
+<!ENTITY % navtitle     "navtitle"                                   >
+<!ENTITY % no-topic-nesting     
+                        "no-topic-nesting"                           >
+<!ENTITY % prolog       "prolog"                                     >
+<!ENTITY % related-links     
+                        "related-links"                              >
+<!ENTITY % searchtitle  "searchtitle"                                >
+<!ENTITY % section      "section"                                    >
+<!ENTITY % shortdesc    "shortdesc"                                  >
+<!ENTITY % titlealts    "titlealts"                                  >
+
+<!--                    Also include common elements used in topics
+                        and maps                                   -->
+<!ENTITY % commonDefns   PUBLIC 
+                       "-//OASIS//ENTITIES DITA Common Elements//EN" 
+                       "commonElements.ent"                          >
+%commonDefns;
+
+<!-- ================== End Topic Definitions Entities =========== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/topicDefn.ent.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/topicDefn.ent.rnc
new file mode 100644
index 0000000..22d131640
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/topicDefn.ent.rnc
@@ -0,0 +1,92 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Topic Definitions
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+# PUBLIC"-//OASIS//ENTITIES DITA Topic Definitions//EN"
+#       Delivered as file "topicDefn.ent"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the topic definitions
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Removed old declarations for spanspec and
+
+# tfoot entities
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# 2006.07.06 RDA: Moved common elements to the module
+
+# commonElements.ent
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+abstract = abstract.element
+body = body.element
+example = example.element
+link = link.element
+linkinfo = linkinfo.element
+linklist = linklist.element
+linkpool = linkpool.element
+linktext = linktext.element
+metadata = metadata.element
+navtitle = navtitle.element
+prolog = prolog.element
+related-links = related-links.element
+searchtitle = searchtitle.element
+section = section.element
+shortdesc = shortdesc.element
+titlealts = titlealts.element
+# Also include common elements used in topics
+# and maps
+include "commonElements.ent.rnc"
+# ================== End Topic Definitions Entities ===========
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/uiDomain.ent b/xml/tests/testData/xml/OasisDocumentHighlighting/uiDomain.ent
new file mode 100644
index 0000000..94e9b43
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/uiDomain.ent
@@ -0,0 +1,54 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA User Interface Domain Entities               -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ENTITIES DITA User Interface Domain//EN"
+      Delivered as file "uiDomain.ent"                             -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the substitution context and domain     -->
+<!--             entity declarations for the User Interface Domain -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Updated these comments to match template   -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    ELEMENT EXTENSION ENTITY DECLARATIONS      -->
+<!-- ============================================================= -->
+
+<!ENTITY % ui-d-keyword "wintitle"                                   >
+<!ENTITY % ui-d-ph      "uicontrol | menucascade"                    >
+<!ENTITY % ui-d-pre     "screen"                                     >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATION                  -->
+<!-- ============================================================= -->
+
+
+<!ENTITY ui-d-att "(topic ui-d)">
+
+
+<!-- ================== End User Interface Domain Entities ======= -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/uiDomain.ent.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/uiDomain.ent.rnc
new file mode 100644
index 0000000..14711e3
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/uiDomain.ent.rnc
@@ -0,0 +1,79 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA User Interface Domain Entities
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ENTITIES DITA User Interface Domain//EN"
+#       Delivered as file "uiDomain.ent"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the substitution context and domain
+
+# entity declarations for the User Interface Domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Updated these comments to match template
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT EXTENSION ENTITY DECLARATIONS
+
+# =============================================================
+
+ui-d-keyword = wintitle.element
+ui-d-ph = uicontrol.element | menucascade.element
+ui-d-pre = screen.element
+# =============================================================
+
+# DOMAIN ENTITY DECLARATION
+
+# =============================================================
+
+# ================== End User Interface Domain Entities =======
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/uiDomain.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/uiDomain.mod
new file mode 100644
index 0000000..3254efa
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/uiDomain.mod
@@ -0,0 +1,117 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA User Interface Domain                        -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA User Interface Domain//EN"
+      Delivered as file "uiDomain.mod"                             -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the elements and specialization         -->
+<!--             attributes for the User Interface Domain          -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Corrected LONG NAME for screen             -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                   ELEMENT NAME ENTITIES                       -->
+<!-- ============================================================= -->
+
+  
+<!ENTITY % uicontrol   "uicontrol"                                   >
+<!ENTITY % wintitle    "wintitle"                                    >
+<!ENTITY % menucascade "menucascade"                                 >
+<!ENTITY % shortcut    "shortcut"                                    >
+<!ENTITY % screen      "screen"                                      >
+
+
+<!-- ============================================================= -->
+<!--                    UI KEYWORD TYPES ELEMENT DECLARATIONS      -->
+<!-- ============================================================= -->
+
+
+<!--                    LONG NAME: User Interface Control          -->
+<!ELEMENT uicontrol     (%words.cnt; | %image; | %shortcut;)*        >
+<!ATTLIST uicontrol       
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Window Title                    -->
+<!ELEMENT wintitle      (#PCDATA)                                    >
+<!ATTLIST wintitle        
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+
+<!--                    LONG NAME: Menu Cascade                    -->
+<!ELEMENT menucascade   (%uicontrol;)+                               >
+<!ATTLIST menucascade     
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Short Cut                       -->
+<!ELEMENT shortcut      (#PCDATA)                                    >
+<!ATTLIST shortcut        
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Text Screen Capture             -->
+<!ELEMENT screen        (#PCDATA | %basic.ph.notm; | %txt.incl; |
+                         %data.elements.incl; | 
+                         %foreign.unknown.incl;)*                    >
+<!ATTLIST screen          
+             %display-atts;
+             spectitle  CDATA                            #IMPLIED
+             xml:space  (preserve)               #FIXED 'preserve'
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+             
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+             
+
+<!ATTLIST menucascade %global-atts;  class CDATA "+ topic/ph ui-d/menucascade "  >
+<!ATTLIST screen      %global-atts;  class CDATA "+ topic/pre ui-d/screen "      >
+<!ATTLIST shortcut    %global-atts;  class CDATA "+ topic/keyword ui-d/shortcut ">
+<!ATTLIST uicontrol   %global-atts;  class CDATA "+ topic/ph ui-d/uicontrol "    >
+<!ATTLIST wintitle    %global-atts;  class CDATA "+ topic/keyword ui-d/wintitle ">
+
+ 
+<!-- ================== End DITA User Interface Domain =========== -->
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/uiDomain.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/uiDomain.mod.rnc
new file mode 100644
index 0000000..634a57e
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/uiDomain.mod.rnc
@@ -0,0 +1,149 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA User Interface Domain
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA User Interface Domain//EN"
+#       Delivered as file "uiDomain.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the elements and specialization
+
+# attributes for the User Interface Domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Corrected LONG NAME for screen
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+uicontrol = uicontrol.element
+shortcut = shortcut.element
+# =============================================================
+
+# UI KEYWORD TYPES ELEMENT DECLARATIONS
+
+# =============================================================
+
+# LONG NAME: User Interface Control
+uicontrol.element =
+  element uicontrol {
+    uicontrol.attlist, (words.cnt | image | shortcut)*
+  }
+uicontrol.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Window Title
+wintitle.element = element wintitle { wintitle.attlist, text }
+wintitle.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Menu Cascade
+menucascade.element =
+  element menucascade { menucascade.attlist, uicontrol+ }
+menucascade.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Short Cut
+shortcut.element = element shortcut { shortcut.attlist, text }
+shortcut.attlist &=
+  attribute keyref { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Text Screen Capture
+screen.element =
+  element screen {
+    screen.attlist,
+    (text
+     | basic.ph.notm
+     | txt.incl
+     | data.elements.incl
+     | foreign.unknown.incl)*
+  }
+screen.attlist &=
+  display-atts,
+  attribute spectitle { text }?,
+  [ a:defaultValue = "preserve" ] attribute xml:space { "preserve" }?,
+  univ-atts,
+  attribute outputclass { text }?
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+menucascade.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph ui-d/menucascade " ]
+  attribute class { text }?
+screen.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/pre ui-d/screen " ]
+  attribute class { text }?
+shortcut.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/keyword ui-d/shortcut " ]
+  attribute class { text }?
+uicontrol.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph ui-d/uicontrol " ]
+  attribute class { text }?
+wintitle.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/keyword ui-d/wintitle " ]
+  attribute class { text }?
+# ================== End DITA User Interface Domain ===========
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/utilitiesDomain.ent b/xml/tests/testData/xml/OasisDocumentHighlighting/utilitiesDomain.ent
new file mode 100644
index 0000000..afda6b1
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/utilitiesDomain.ent
@@ -0,0 +1,53 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Utilities Domain Entities                    -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ENTITIES DITA Utilities Domain//EN"
+      Delivered as file "utilitiesDomain.ent"                      -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the substitution context and domain     -->
+<!--             entity declarations for the utilities domain      -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Removed entity "ut-d-simpletable"          -->
+<!--    2005.11.15 RDA: Updated these comments to match template   -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    ELEMENT EXTENSION ENTITY DECLARATIONS      -->
+<!-- ============================================================= -->
+
+<!ENTITY % ut-d-fig     "imagemap"                                   >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATION                  -->
+<!-- ============================================================= -->
+
+  
+<!ENTITY ut-d-att       "(topic ut-d)"                               >
+
+
+<!-- ================== End Utilities Domain Entities ============ -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/utilitiesDomain.ent.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/utilitiesDomain.ent.rnc
new file mode 100644
index 0000000..c8ff8dd
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/utilitiesDomain.ent.rnc
@@ -0,0 +1,79 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Utilities Domain Entities
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an 
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ENTITIES DITA Utilities Domain//EN"
+#       Delivered as file "utilitiesDomain.ent"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the substitution context and domain
+
+# entity declarations for the utilities domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Removed entity "ut-d-simpletable"
+
+# 2005.11.15 RDA: Updated these comments to match template
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT EXTENSION ENTITY DECLARATIONS
+
+# =============================================================
+
+ut-d-fig = imagemap.element
+# =============================================================
+
+# DOMAIN ENTITY DECLARATION
+
+# =============================================================
+
+# ================== End Utilities Domain Entities ============
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/utilitiesDomain.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/utilitiesDomain.mod
new file mode 100644
index 0000000..405513a
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/utilitiesDomain.mod
@@ -0,0 +1,119 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA Utilities Domain                             -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identifier or an
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA Utilities Domain//EN"
+      Delivered as file "utilitiesDomain.mod"                      -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the elements and specialization         -->
+<!--             attributes for the DITA Utilities Domain          -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             March 2001                                        -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2005, 2006.              -->
+<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
+<!--             All Rights Reserved.                              -->
+<!--                                                               -->
+<!--  UPDATES:                                                     -->
+<!--    2005.11.15 RDA: Updated these comments to match template   -->
+<!--    2005.11.15 RDA: Corrected the "Delivered as" system ID     -->
+<!--    2006.06.07 RDA: Make universal attributes universal        -->
+<!--                      (DITA 1.1 proposal #12)                  -->
+<!--    2006.06.14 RDA: Move univ-atts-translate-no into topic.mod -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                   ELEMENT NAME ENTITIES                       -->
+<!-- ============================================================= -->
+
+<!ENTITY % imagemap    "imagemap"                                    >
+<!ENTITY % area        "area"                                        >
+<!ENTITY % shape       "shape"                                       >
+<!ENTITY % coords      "coords"                                      >
+
+
+<!-- ============================================================= -->
+<!--                    COMMON ATTLIST SETS                        -->
+<!-- ============================================================= -->
+
+
+<!--                    Provide an alternative univ-atts that sets 
+                        translate to default 'no'                  -->
+<!-- Now uses the definition from topic.mod                        -->
+<!--<!ENTITY % univ-atts-translate-no
+            '%id-atts;
+             %select-atts;
+             translate  (yes | no)                       "no"
+             xml:lang   NMTOKEN                          #IMPLIED
+             dir       (ltr | rtl | lro | rlo)           #IMPLIED'   >-->
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS for IMAGEMAP          -->
+<!-- ============================================================= -->
+
+
+<!--                    LONG NAME: Imagemap                        -->
+<!ELEMENT imagemap      ((%image;), (%area;)+)                       >           
+<!ATTLIST imagemap        
+             %display-atts;
+             spectitle  CDATA                            #IMPLIED
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Hoptspot Area Description       -->
+<!ELEMENT area          ((%shape;), (%coords;), (%xref;))            >
+<!ATTLIST area         
+             %univ-atts;                                  
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Shape of the Hotspot            -->
+<!ELEMENT shape         (#PCDATA)                                    >
+<!ATTLIST shape           
+             keyref     CDATA                            #IMPLIED
+             %univ-atts-translate-no;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+
+<!--                    LONG NAME: Coordinates of the Hotspot      -->
+<!ELEMENT coords        (%words.cnt;)*                               >
+<!ATTLIST coords          
+             keyref     CDATA                            #IMPLIED
+             %univ-atts-translate-no;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+             
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+
+
+<!ATTLIST imagemap %global-atts;  class CDATA "+ topic/fig ut-d/imagemap " >
+<!ATTLIST area     %global-atts;  class CDATA "+ topic/figgroup ut-d/area ">
+<!ATTLIST shape    %global-atts;  class CDATA "+ topic/keyword ut-d/shape ">
+<!ATTLIST coords   %global-atts;  class CDATA "+ topic/ph ut-d/coords "    >
+
+ 
+<!-- ================== End Utilities Domain ====================== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/utilitiesDomain.mod.rnc b/xml/tests/testData/xml/OasisDocumentHighlighting/utilitiesDomain.mod.rnc
new file mode 100644
index 0000000..f7d3aba
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/utilitiesDomain.mod.rnc
@@ -0,0 +1,150 @@
+# =============================================================
+
+# HEADER
+
+# =============================================================
+
+# MODULE:    DITA Utilities Domain
+
+# VERSION:   1.1
+
+# DATE:      June 2006
+
+#
+
+# =============================================================
+
+# =============================================================
+
+# PUBLIC DOCUMENT TYPE DEFINITION
+
+# TYPICAL INVOCATION
+
+#
+
+# Refer to this file by the following public identifier or an
+#       appropriate system identifier 
+# PUBLIC "-//OASIS//ELEMENTS DITA Utilities Domain//EN"
+#       Delivered as file "utilitiesDomain.mod"
+
+# =============================================================
+
+# SYSTEM:     Darwin Information Typing Architecture (DITA)
+
+#
+
+# PURPOSE:    Declaring the elements and specialization
+
+# attributes for the DITA Utilities Domain
+
+#
+
+# ORIGINAL CREATION DATE:
+
+# March 2001
+
+#
+
+# (C) Copyright OASIS Open 2005, 2006.
+
+# (C) Copyright IBM Corporation 2001, 2004.
+
+# All Rights Reserved.
+
+#
+
+# UPDATES:
+
+# 2005.11.15 RDA: Updated these comments to match template
+
+# 2005.11.15 RDA: Corrected the "Delivered as" system ID
+
+# 2006.06.07 RDA: Make universal attributes universal
+
+# (DITA 1.1 proposal #12)
+
+# 2006.06.14 RDA: Move univ-atts-translate-no into topic.mod
+
+# =============================================================
+
+# =============================================================
+
+# ELEMENT NAME ENTITIES
+
+# =============================================================
+
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+area = area.element
+shape = shape.element
+coords = coords.element
+# =============================================================
+
+# COMMON ATTLIST SETS
+
+# =============================================================
+
+# Provide an alternative univ-atts that sets 
+# translate to default 'no'
+
+# Now uses the definition from topic.mod
+
+# <!ENTITY % univ-atts-translate-no
+# '%id-atts;
+#  %select-atts;
+#  translate  (yes | no)                       "no"
+#  xml:lang   NMTOKEN                          #IMPLIED
+#  dir       (ltr | rtl | lro | rlo)           #IMPLIED'   >
+
+# =============================================================
+
+# ELEMENT DECLARATIONS for IMAGEMAP
+
+# =============================================================
+
+# LONG NAME: Imagemap
+imagemap.element = element imagemap { imagemap.attlist, image, area+ }
+imagemap.attlist &=
+  display-atts,
+  attribute spectitle { text }?,
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Hoptspot Area Description
+area.element = element area { area.attlist, shape, coords, xref }
+area.attlist &=
+  univ-atts,
+  attribute outputclass { text }?
+# LONG NAME: Shape of the Hotspot
+shape.element = element shape { shape.attlist, text }
+shape.attlist &=
+  attribute keyref { text }?,
+  univ-atts-translate-no,
+  attribute outputclass { text }?
+# LONG NAME: Coordinates of the Hotspot
+coords.element = element coords { coords.attlist, words.cnt* }
+coords.attlist &=
+  attribute keyref { text }?,
+  univ-atts-translate-no,
+  attribute outputclass { text }?
+# =============================================================
+
+# SPECIALIZATION ATTRIBUTE DECLARATIONS
+
+# =============================================================
+imagemap.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/fig ut-d/imagemap " ]
+  attribute class { text }?
+area.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/figgroup ut-d/area " ]
+  attribute class { text }?
+shape.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/keyword ut-d/shape " ]
+  attribute class { text }?
+coords.attlist &=
+  global-atts,
+  [ a:defaultValue = "+ topic/ph ut-d/coords " ]
+  attribute class { text }?
+# ================== End Utilities Domain ======================
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/xnalDomain.ent b/xml/tests/testData/xml/OasisDocumentHighlighting/xnalDomain.ent
new file mode 100644
index 0000000..9a4617c
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/xnalDomain.ent
@@ -0,0 +1,46 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    DITA XNAL Domain Entities                         -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identfier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ENTITIES DITA XNAL Domain//EN"
+      Delivered as file "xnalDomain.ent"                           -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Declaring the substitution context and domain     -->
+<!--             entity declarations for the XNAL domain           -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             June 2006                                         -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2006.                    -->
+<!--             All Rights Reserved.                              -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    ELEMENT EXTENSION ENTITY DECLARATIONS      -->
+<!-- ============================================================= -->
+
+<!ENTITY % xnal-d-author "authorinformation"                         >
+
+
+<!-- ============================================================= -->
+<!--                    DOMAIN ENTITY DECLARATION                  -->
+<!-- ============================================================= -->
+
+<!ENTITY xnal-d-att "(topic xnal-d)"                                 >
+
+
+<!-- ================== End XNAL Domain Entities ================= -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/OasisDocumentHighlighting/xnalDomain.mod b/xml/tests/testData/xml/OasisDocumentHighlighting/xnalDomain.mod
new file mode 100644
index 0000000..3c25fef
--- /dev/null
+++ b/xml/tests/testData/xml/OasisDocumentHighlighting/xnalDomain.mod
@@ -0,0 +1,276 @@
+<!-- ============================================================= -->
+<!--                    HEADER                                     -->
+<!-- ============================================================= -->
+<!--  MODULE:    XNAL Domain                                       -->
+<!--  VERSION:   1.1                                               -->
+<!--  DATE:      June 2006                                         -->
+<!--                                                               -->
+<!-- ============================================================= -->
+
+<!-- ============================================================= -->
+<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
+<!--                    TYPICAL INVOCATION                         -->
+<!--                                                               -->
+<!--  Refer to this file by the following public identfier or an 
+      appropriate system identifier 
+PUBLIC "-//OASIS//ELEMENTS DITA XNAL Domain//EN"
+      Delivered as file "xnalDomain.mod"                           -->
+
+<!-- ============================================================= -->
+<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
+<!--                                                               -->
+<!-- PURPOSE:    Define elements and specialization atttributed    -->
+<!--             for the XNAL Domain                               -->
+<!--                                                               -->
+<!-- ORIGINAL CREATION DATE:                                       -->
+<!--             June 2006                                         -->
+<!--                                                               -->
+<!--             (C) Copyright OASIS Open 2006.                    -->
+<!--             All Rights Reserved.                              -->
+<!-- ============================================================= -->
+
+
+<!-- ============================================================= -->
+<!--                    ELEMENT NAME ENTITIES                      -->
+<!-- ============================================================= -->
+
+
+<!ENTITY % authorinformation "authorinformation"                     >
+<!ENTITY % addressdetails  "addressdetails"                          >
+<!ENTITY % administrativearea "administrativearea"                   >
+<!ENTITY % contactnumber   "contactnumber"                           >
+<!ENTITY % contactnumbers  "contactnumbers"                          >
+<!ENTITY % country         "country"                                 >
+<!ENTITY % emailaddress    "emailaddress"                            >
+<!ENTITY % emailaddresses  "emailaddresses"                          >
+<!ENTITY % firstname       "firstname"                               >
+<!ENTITY % generationidentifier "generationidentifier"               >
+<!ENTITY % honorific       "honorific"                               >
+<!ENTITY % lastname        "lastname"                                >
+<!ENTITY % locality        "locality"                                >
+<!ENTITY % localityname    "localityname"                            >
+<!ENTITY % middlename      "middlename"                              >
+<!ENTITY % namedetails     "namedetails"                             >
+<!ENTITY % organizationinfo "organizationinfo"                       >
+<!ENTITY % organizationname "organizationname"                       >
+<!ENTITY % organizationnamedetails "organizationnamedetails"         >
+<!ENTITY % otherinfo       "otherinfo"                               >
+<!ENTITY % personinfo      "personinfo"                              >
+<!ENTITY % personname      "personname"                              >
+<!ENTITY % postalcode      "postalcode"                              >
+<!ENTITY % thoroughfare    "thoroughfare"                            >
+<!ENTITY % url             "url"                                     >
+<!ENTITY % urls            "urls"                                    >
+
+<!-- ============================================================= -->
+<!--                    ELEMENT DECLARATIONS                       -->
+<!-- ============================================================= -->
+                      
+<!--                    LONG NAME: Author Information              -->
+<!ELEMENT authorinformation
+                        ((%personinfo; | %organizationinfo;)*)       >
+<!ATTLIST authorinformation     
+             %univ-atts;
+             href       CDATA                            #IMPLIED
+             keyref     CDATA                            #IMPLIED
+             type       (creator | contributor)          #IMPLIED    >
+
+<!--                    LONG NAME: Name Details                    -->
+<!ELEMENT namedetails   ((%personname; | %organizationnamedetails;)*)>
+<!ATTLIST namedetails
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Organization Details            -->
+<!ELEMENT organizationnamedetails      
+                        ((%organizationname;)?, (%otherinfo;)*)      >
+<!ATTLIST organizationnamedetails              
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Organization Name               -->
+<!ELEMENT organizationname
+                        (%ph.cnt;)*                                  >
+<!ATTLIST organizationname
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Person Name                     -->
+<!ELEMENT personname    ((%honorific;)?, 
+                         (%firstname;)*,(%middlename;)*,(%lastname;)*,
+                         (%generationidentifier;)?, (%otherinfo;)*)  >
+<!ATTLIST personname
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Honorific                       -->
+<!ELEMENT honorific     (#PCDATA)*                                   >
+<!ATTLIST honorific
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: First Name                      -->
+<!ELEMENT firstname     (#PCDATA)*                                   >
+<!ATTLIST firstname
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Middle Name                     -->
+<!ELEMENT middlename    (#PCDATA)*                                   >
+<!ATTLIST middlename
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Last Name                       -->
+<!ELEMENT lastname      (#PCDATA)*                                   >
+<!ATTLIST lastname
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Generation Identifier           -->
+<!ELEMENT generationidentifier
+                        (#PCDATA)*                                   >
+<!ATTLIST generationidentifier
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Other Information               -->
+<!ELEMENT otherinfo     (%words.cnt;)*>
+<!ATTLIST otherinfo
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Address Details                 -->
+<!ELEMENT addressdetails
+                        (%words.cnt;|%locality;|%administrativearea;|
+                         %thoroughfare;|%country;)*                  >
+<!ATTLIST addressdetails              
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Locality                        -->
+<!ELEMENT locality      (%words.cnt;|%localityname;|%postalcode;)*   >
+<!ATTLIST locality
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Locality Name                   -->
+<!ELEMENT localityname  (%words.cnt;)*                               >
+<!ATTLIST localityname
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Administrative Area             -->
+<!ELEMENT administrativearea
+                        (%words.cnt;)*                               >
+<!ATTLIST administrativearea
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass 
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Thoroughfare                    -->
+<!ELEMENT thoroughfare  (%words.cnt;)*                               >
+<!ATTLIST thoroughfare
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Postal Code                     -->
+<!ELEMENT postalcode    (#PCDATA)*                                   >
+<!ATTLIST postalcode
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Country                         -->
+<!ELEMENT country       (#PCDATA)*                                   >
+<!ATTLIST country
+             keyref     CDATA                            #IMPLIED
+             %univ-atts;
+             outputclass
+                        CDATA                            #IMPLIED    >
+
+<!--                    LONG NAME: Person Information              -->
+<!ELEMENT personinfo    ((%namedetails;)?, (%addressdetails;)?,
+                         (%contactnumbers;)?, (%emailaddresses;)?)   >
+<!ATTLIST personinfo
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Organization Information        -->
+<!ELEMENT organizationinfo
+                        ((%namedetails;)?, (%addressdetails;)?, 
+                         (%contactnumbers;)?, (%emailaddresses;)?,
+                         (%urls;)?)                                  >  
+<!ATTLIST organizationinfo 
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Contact Numbers                 -->
+<!ELEMENT contactnumbers
+                        (%contactnumber;)*                           >
+<!ATTLIST contactnumbers
+             %data-element-atts;                                     >
+                        
+<!--                    LONG NAME: Contact Number                  -->
+<!--                    Note: set the type of number using @type   -->
+<!ELEMENT contactnumber (#PCDATA)*                                   >  
+<!ATTLIST contactnumber
+             %data-element-atts;                                     >            
+                        
+<!--                    LONG NAME: Email Addresses                 -->
+<!ELEMENT emailaddresses
+                        (%emailaddress;)*                            >
+<!ATTLIST emailaddresses
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: Email Address                   -->
+<!ELEMENT emailaddress  (%words.cnt;)*                               >
+<!ATTLIST emailaddress
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: URLs                            -->
+<!ELEMENT urls          (%url;)*                                     >  
+<!ATTLIST urls
+             %data-element-atts;                                     >
+
+<!--                    LONG NAME: URL                             -->
+<!ELEMENT url           (%words.cnt;)*                               >  
+<!ATTLIST url
+             %data-element-atts;                                     >
+
+<!-- ============================================================= -->
+<!--                    SPECIALIZATION ATTRIBUTE DECLARATIONS      -->
+<!-- ============================================================= -->
+
+<!ATTLIST addressdetails %global-atts; class CDATA "+ topic/ph xnal-d/addressdetails ">
+<!ATTLIST administrativearea %global-atts; class CDATA "+ topic/ph xnal-d/administrativearea ">
+<!ATTLIST authorinformation %global-atts; class CDATA "+ topic/author xnal-d/authorinformation ">
+<!ATTLIST contactnumber %global-atts; class CDATA "+ topic/data xnal-d/contactnumber ">
+<!ATTLIST contactnumbers %global-atts; class CDATA "+ topic/data xnal-d/contactnumbers ">
+<!ATTLIST country     %global-atts; class CDATA "+ topic/ph xnal-d/country ">
+<!ATTLIST emailaddress %global-atts; class CDATA "+ topic/data xnal-d/emailaddress ">
+<!ATTLIST emailaddresses %global-atts; class CDATA "+ topic/data xnal-d/emailaddresses ">
+<!ATTLIST firstname   %global-atts; class CDATA "+ topic/data xnal-d/firstname ">
+<!ATTLIST generationidentifier %global-atts; class CDATA "+ topic/data xnal-d/generationidentifier ">
+<!ATTLIST honorific   %global-atts; class CDATA "+ topic/data xnal-d/honorific ">
+<!ATTLIST lastname    %global-atts; class CDATA "+ topic/data xnal-d/lastname ">
+<!ATTLIST locality    %global-atts; class CDATA "+ topic/ph xnal-d/locality ">
+<!ATTLIST localityname %global-atts; class CDATA "+ topic/ph xnal-d/localityname ">
+<!ATTLIST middlename  %global-atts; class CDATA "+ topic/data xnal-d/middlename ">
+<!ATTLIST namedetails %global-atts; class CDATA "+ topic/data xnal-d/namedetails ">
+<!ATTLIST organizationinfo %global-atts; class CDATA "+ topic/data xnal-d/organizationinfo ">
+<!ATTLIST organizationname %global-atts;  class CDATA "+ topic/ph xnal-d/organizationname ">
+<!ATTLIST organizationnamedetails %global-atts; class CDATA "+ topic/ph xnal-d/organizationnamedetails ">
+<!ATTLIST otherinfo   %global-atts; class CDATA "+ topic/data xnal-d/otherinfo ">
+<!ATTLIST personinfo  %global-atts; class CDATA "+ topic/data xnal-d/personinfo ">
+<!ATTLIST personname  %global-atts; class CDATA "+ topic/data xnal-d/personname ">
+<!ATTLIST postalcode  %global-atts; class CDATA "+ topic/ph xnal-d/postalcode ">
+<!ATTLIST thoroughfare %global-atts; class CDATA "+ topic/ph xnal-d/thoroughfare ">
+<!ATTLIST url         %global-atts; class CDATA "+ topic/data xnal-d/url ">
+<!ATTLIST urls        %global-atts; class CDATA "+ topic/data xnal-d/urls ">
+
+<!-- ================== End DITA XNAL Domain  =================== -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/PluginXml.xml b/xml/tests/testData/xml/PluginXml.xml
new file mode 100644
index 0000000..62a7c4d
--- /dev/null
+++ b/xml/tests/testData/xml/PluginXml.xml
@@ -0,0 +1,36 @@
+<!DOCTYPE idea-plugin PUBLIC "Plugin/DTD" "http://plugins.intellij.net/plugin.dtd">
+<idea-plugin version="2">
+    <name>Inspection Gadgets</name>
+    <id>InspectionGadgets</id>
+    <vendor>InspectionGadgets Software</vendor>
+
+    <category>inspection</category>
+    <version>1.0</version>
+    <idea-version min="4.0" max="6.0" since-build="2200"/>
+
+    <resource-bundle>com.siyeh.InspectionGadgetsBundle</resource-bundle>
+
+    <extensions defaultExtensionNs="com.intellij" xmlns="<error>com.intellij</error>">
+      <errorHandler implementation="com.intellij.diagnostic.ITNReporter"/>
+      <!--<appStarter implementation="com.intellij.diagnostic.ITNReporter"/>-->
+      <!--<formInspectionTool implementation="com.intellij.diagnostic.ITNReporter"/>-->
+      <!--<invalidPropertyKeyInspectionTool implementation="com.intellij.diagnostic.ITNReporter"/>-->
+      <!--<i18nInspectionTool implementation="com.intellij.diagnostic.ITNReporter"/>-->
+      <!--<java15InspectionTool implementation="com.intellij.diagnostic.ITNReporter"/>-->
+      <!--<junitPatcher implementation="com.intellij.diagnostic.ITNReporter"/>-->
+      <indexPatternProvider implementation="com.intellij.diagnostic.ITNReporter"/>
+      <!--<component implementation="com.intellij.diagnostic.ITNReporter"/>-->
+    </extensions>
+
+    <application-components>
+        <component>
+            <implementation-class>com.siyeh.ig.InspectionGadgetsPlugin</implementation-class>
+        </component>
+    </application-components>
+    <project-components>
+        <component>
+            <implementation-class>com.siyeh.ig.InspectionGadgetsProjectComponent</implementation-class>
+        </component>
+    </project-components>
+
+</idea-plugin>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ProblemWithImportedNsReference.xsd b/xml/tests/testData/xml/ProblemWithImportedNsReference.xsd
new file mode 100644
index 0000000..b5ad5e3
--- /dev/null
+++ b/xml/tests/testData/xml/ProblemWithImportedNsReference.xsd
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema version="1.0"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:p="urn:aaa"
+            elementFormDefault="qualified"
+  >
+  <xsd:import namespace="urn:aaa" schemaLocation="<error>urn:zzz</error>"/>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ProblemWithMemberTypes.xsd b/xml/tests/testData/xml/ProblemWithMemberTypes.xsd
new file mode 100644
index 0000000..f9b1864
--- /dev/null
+++ b/xml/tests/testData/xml/ProblemWithMemberTypes.xsd
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<xsd:schema
+    targetNamespace="http://www.something.com/2006/stuff"
+    elementFormDefault="qualified"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+    <xsd:complexType name="typeExecutable" mixed="true">
+        <xsd:attribute name="type" default="application/xml">
+            <xsd:simpleType>
+                <xsd:union memberTypes="xsd:integer	xsd:float" />
+            </xsd:simpleType>
+        </xsd:attribute>
+    </xsd:complexType>
+
+</xsd:schema>
+
diff --git a/xml/tests/testData/xml/RedefineBaseType.xml b/xml/tests/testData/xml/RedefineBaseType.xml
new file mode 100644
index 0000000..2d24e88
--- /dev/null
+++ b/xml/tests/testData/xml/RedefineBaseType.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<a:a xmlns:a="http://www.cadence.com/a" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xsi:schemaLocation="http://www.cadence.com/a RedefineBaseType_2.xsd">
+
+
+     <e1>ddd</e1>
+      <e3>dddd</e3>
+    <e2>rrr</e2>
+</a:a>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/RedefineBaseType.xsd b/xml/tests/testData/xml/RedefineBaseType.xsd
new file mode 100644
index 0000000..7f38ba7
--- /dev/null
+++ b/xml/tests/testData/xml/RedefineBaseType.xsd
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+xmlns:a="http://www.cadence.com/a"
+targetNamespace="http://www.cadence.com/a"
+elementFormDefault="unqualified"
+attributeFormDefault="unqualified">
+
+<xs:complexType name="baseType">
+<xs:sequence>
+<xs:element name="e1" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="aType">
+    <xs:complexContent>
+        <xs:extension base="a:baseType">
+            <xs:sequence>
+                <xs:element name="e2" type="xs:string"/>
+            </xs:sequence>
+        </xs:extension>
+    </xs:complexContent>
+</xs:complexType>
+
+<xs:element name="a" type="a:aType"/>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/RedefineBaseType_2.xsd b/xml/tests/testData/xml/RedefineBaseType_2.xsd
new file mode 100644
index 0000000..5a9c5c1
--- /dev/null
+++ b/xml/tests/testData/xml/RedefineBaseType_2.xsd
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:a="http://www.cadence.com/a"
+           targetNamespace="http://www.cadence.com/a"
+           elementFormDefault="unqualified"
+           attributeFormDefault="unqualified">
+
+    <xs:redefine schemaLocation="RedefineBaseType.xsd">
+        <xs:complexType name="baseType">
+            <xs:complexContent>
+                <xs:extension base="a:baseType">
+                    <xs:sequence>
+                        <xs:element name="e3"/>
+                    </xs:sequence>
+                </xs:extension>
+            </xs:complexContent>
+        </xs:complexType>
+
+    </xs:redefine>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/RedefineQualifiedType.xml b/xml/tests/testData/xml/RedefineQualifiedType.xml
new file mode 100644
index 0000000..e4e3b50
--- /dev/null
+++ b/xml/tests/testData/xml/RedefineQualifiedType.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<a:a xmlns:a="http://www.cadence.com/a" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xsi:schemaLocation="http://www.cadence.com/a RedefineQualifiedType_2.xsd">
+
+     <e1>eee</e1>
+     <e2>zzz</e2>
+</a:a>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/RedefineQualifiedType.xsd b/xml/tests/testData/xml/RedefineQualifiedType.xsd
new file mode 100644
index 0000000..de4127c
--- /dev/null
+++ b/xml/tests/testData/xml/RedefineQualifiedType.xsd
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+xmlns:a="http://www.cadence.com/a"
+targetNamespace="http://www.cadence.com/a"
+elementFormDefault="unqualified"
+attributeFormDefault="unqualified">
+
+
+    <xs:complexType name="aType">
+        <xs:sequence>
+            <xs:element name="e1" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:element name="a" type="a:aType"/>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/RedefineQualifiedType_2.xsd b/xml/tests/testData/xml/RedefineQualifiedType_2.xsd
new file mode 100644
index 0000000..05f6cbb
--- /dev/null
+++ b/xml/tests/testData/xml/RedefineQualifiedType_2.xsd
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+xmlns:a="http://www.cadence.com/a"
+targetNamespace="http://www.cadence.com/a"
+elementFormDefault="unqualified"
+attributeFormDefault="unqualified">
+
+
+    <xs:redefine schemaLocation="RedefineQualifiedType.xsd">
+        <xs:complexType name="aType">
+            <xs:complexContent>
+                <xs:extension base="a:aType">
+                    <xs:sequence>
+                        <xs:element name="e2" type="xs:string"/>
+                    </xs:sequence>
+                </xs:extension>
+            </xs:complexContent>
+        </xs:complexType>
+    </xs:redefine>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ReferencingTargetNamespace.xml b/xml/tests/testData/xml/ReferencingTargetNamespace.xml
new file mode 100644
index 0000000..501b3bd
--- /dev/null
+++ b/xml/tests/testData/xml/ReferencingTargetNamespace.xml
@@ -0,0 +1,9 @@
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+	    targetNamespace="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	    elementFormDefault="qualified"
+	    attributeFormDefault="unqualified"
+	    version="1.4">
+  <annotation/>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ResolveEntityUrl.xml b/xml/tests/testData/xml/ResolveEntityUrl.xml
new file mode 100644
index 0000000..58f3995
--- /dev/null
+++ b/xml/tests/testData/xml/ResolveEntityUrl.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping SYSTEM
+			"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
+[
+<!ENTITY % globals SYSTEM "classpath://entities.dtd">
+%globals;
+]>
+
+<hibernate-mapping <error>zzz</error>="&idgenerator;">
+  
+</hibernate-mapping>
diff --git a/xml/tests/testData/xml/ResolvedDtdElementReferences.dtd b/xml/tests/testData/xml/ResolvedDtdElementReferences.dtd
new file mode 100644
index 0000000..2711d45
--- /dev/null
+++ b/xml/tests/testData/xml/ResolvedDtdElementReferences.dtd
@@ -0,0 +1,2 @@
+<!ELEMENT aaa EMPTY>
+<!ELEMENT name (aaa)>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/ResolvingEntitiesInDtd.xml b/xml/tests/testData/xml/ResolvingEntitiesInDtd.xml
new file mode 100644
index 0000000..499dfce
--- /dev/null
+++ b/xml/tests/testData/xml/ResolvingEntitiesInDtd.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<!DOCTYPE RatingServiceSelectionRequest SYSTEM "RatingandServiceSelectionRequest.dtd" >
+<RatingServiceSelectionRequest xml:lang="en-US">
+  <Request>
+    <TransactionReference>
+      <XpciVersion>1.0001</XpciVersion>
+    </TransactionReference>
+    <RequestAction>Rate</RequestAction>
+    <RequestOption>Rate</RequestOption>
+  </Request>
+  <Shipment>
+    <Shipper>
+      <Address>
+        <PostalCode>XXXXX</PostalCode>
+        <CountryCode>US</CountryCode>
+      </Address>
+    </Shipper>
+    <ShipTo>
+      <Address>
+        <PostalCode>XXXXX</PostalCode>
+        <CountryCode>US</CountryCode>
+      </Address>
+    </ShipTo>
+    <ShipFrom>
+      <Address>
+        <PostalCode>XXXXX</PostalCode>
+        <CountryCode>US</CountryCode>
+      </Address>
+    </ShipFrom>
+    <Service>
+      <Code>XX</Code>
+    </Service>
+    <Package>
+      <PackagingType>
+        <Code>XX</Code>
+      </PackagingType>
+      <Dimensions>
+        <UnitOfMeasurement>
+          <Code>IN</Code>
+        </UnitOfMeasurement>
+        <Length>XX</Length>
+        <Width>XX</Width>
+        <Height>XX</Height>
+      </Dimensions>
+      <PackageWeight>
+        <UnitOfMeasurement>
+          <Code>LBS</Code>
+        </UnitOfMeasurement>
+        <Weight>XX</Weight>
+      </PackageWeight>
+    </Package>
+  </Shipment>
+</RatingServiceSelectionRequest>
+
diff --git a/xml/tests/testData/xml/ResolvingEntitiesInDtd/RatingandServiceSelectionRequest.dtd b/xml/tests/testData/xml/ResolvingEntitiesInDtd/RatingandServiceSelectionRequest.dtd
new file mode 100644
index 0000000..e05c7ad
--- /dev/null
+++ b/xml/tests/testData/xml/ResolvingEntitiesInDtd/RatingandServiceSelectionRequest.dtd
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XML Spy v3.5 NT beta 1 build Nov 10 2000 (http://www.xmlspy.com) by Stephanie (UPS) -->
+<!-- Copyright (c) 2000 United Parcel Service of America, Inc. All rights reserved. -->
+<!-- XPCI Rating and Service Selection Request -->
+<!--version="1.0"							 -->
+<!-- Include the standard messaging elements 		-->
+<!ENTITY % Interchange SYSTEM "XpciInterchange.dtd">
+%Interchange;
+<!-- Include the standard vocabulary elements 		-->
+<!ENTITY % Vocabulary SYSTEM "Xpcivocabulary.dtd">
+%Vocabulary;
+<!-- Rating and Service Selection Request elements -->
+<!ELEMENT RatingServiceSelectionRequest (Request, PickupType?, Shipment)>
+<!ATTLIST RatingServiceSelectionRequest
+	xml:lang NMTOKEN #IMPLIED
+>
diff --git a/xml/tests/testData/xml/ResolvingEntitiesInDtd/XpciInterchange.dtd b/xml/tests/testData/xml/ResolvingEntitiesInDtd/XpciInterchange.dtd
new file mode 100644
index 0000000..cc1bdd1
--- /dev/null
+++ b/xml/tests/testData/xml/ResolvingEntitiesInDtd/XpciInterchange.dtd
@@ -0,0 +1,63 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!--Generated by XML Authority-->
+
+<!-- Xpci Static Release Information -->
+<!-- Change History  10/21/2000 By Hal Trebes - Updated Interchange Version to 1.0001 to reflect new vocabulary entries made under this version -->
+<!-- Change History 02/09/01 By Stephanie Weaver - Update Interchange Version 1.0002 to allow for upcoming Production Release, IntegrationIndicator optional element was added to the Request Element-->
+<!ELEMENT XpciVersion (#PCDATA)>
+
+<!--<!ATTLIST XpciVersion  Version CDATA  #FIXED '1.0001' >
+-->
+<!ELEMENT AccessLicenseNumber (#PCDATA)>
+
+<!ELEMENT AccessLicenseText (#PCDATA)>
+
+<!ELEMENT CustomerContext EMPTY>
+
+<!ELEMENT Error (ErrorSeverity , ErrorCode , ErrorDescription? , MinimumRetrySeconds? , ErrorLocation* , ErrorDigest*)>
+
+<!ELEMENT ErrorCode (#PCDATA)>
+
+<!ELEMENT ErrorDescription (#PCDATA)>
+
+<!ELEMENT ErrorDigest (#PCDATA)>
+
+<!ELEMENT ErrorLocation (ErrorLocationElementName? , ErrorLocationElementReference? , ErrorLocationAttributeName?)>
+
+<!ELEMENT ErrorLocationAttributeName (#PCDATA)>
+
+<!ELEMENT ErrorLocationElementReference (#PCDATA)>
+
+<!ELEMENT ErrorLocationElementName (#PCDATA)>
+
+<!ELEMENT ErrorSeverity (#PCDATA)>
+
+<!ELEMENT IntegrationIndicator EMPTY>
+
+<!ELEMENT MinimumRetrySeconds (#PCDATA)>
+
+<!ELEMENT OnLineTool (ToolID , ToolVersion)>
+
+<!ELEMENT Password (#PCDATA)>
+
+<!ELEMENT Request (TransactionReference? , RequestAction , RequestOption* , IntegrationIndicator?)>
+
+<!ELEMENT RequestAction (#PCDATA)>
+
+<!ELEMENT RequestOption (#PCDATA)>
+
+<!ELEMENT Response (TransactionReference? , ResponseStatusCode , ResponseStatusDescription? , Error*)>
+
+<!ELEMENT ResponseStatusCode (#PCDATA)>
+
+<!ELEMENT ResponseStatusDescription (#PCDATA)>
+
+<!ELEMENT ToolID (#PCDATA)>
+
+<!ELEMENT ToolVersion (#PCDATA)>
+
+<!ELEMENT TransactionReference (CustomerContext? , XpciVersion? , ToolVersion?)>
+
+<!ELEMENT UserId (#PCDATA)>
+
diff --git a/xml/tests/testData/xml/ResolvingEntitiesInDtd/Xpcivocabulary.dtd b/xml/tests/testData/xml/ResolvingEntitiesInDtd/Xpcivocabulary.dtd
new file mode 100644
index 0000000..782806e
--- /dev/null
+++ b/xml/tests/testData/xml/ResolvingEntitiesInDtd/Xpcivocabulary.dtd
@@ -0,0 +1,533 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Generated by Turbo XML 2.3.0.100.-->
+<!-- Copyright (c) 2000 United Parcel Service of America, 
+Inc. All rights reserved. -->
+<!-- Xpci Library Version 1.0003-->
+<!--  XPCI Version 1.0002 accommodated AVLite, WWTNT and DOL-->
+<!--XPCI Version 1.0003 accommodated Local teams enhancements to PreparePickupRequest, two new DTDs,  PSBServiceRequest and PSBServiceResponse-->
+<!--XPCI Version 1.0004 accommodate changes made to the Tracking DTDs for the ATS project-->
+<!--XPCI Version 1.0005 accommodate functional requirements for the ROW September Release-->
+<!--XPCI Version 1.0006 accommodate functional requirements for the BCDN Phase II Enhancements-->
+<!--XPCI Version 1.0007 accommodate functional requirements for the Quantum View Schema-->
+<!--XPCI Version 1.0008 accommodate functional requirements for the ROW February release-->
+<!--XPCI Version 1.0009 accommodate functional requirements for the Quantum View Autoload Fall 2002 release-->
+<!--XPCI Version 1.0010 accommodate functional requirements for ROW, Shipping and Label Recovery enhancements for January 2003-->
+<!--Parameters-->
+<!ENTITY % AddressArtifacts "(ConsigneeName? , StreetNumberLow? , StreetNumberHigh? , StreetNumberOddEven? , StreetPrefix? , StreetName? , StreetType? , StreetSuffix? , BuildingName? , AddressExtendedInformation* , PoliticalDivision4? , PoliticalDivision3? , PoliticalDivision2? , PoliticalDivision1? , Country? , CountryCode? , PostcodePrimaryHigh? , PostcodePrimaryLow? , PostcodeExtendedHigh? , PostcodeExtendedLow? , ResidentialAddressIndicator?)">
+<!ENTITY % AddressInputFormat "(AddressLabelFormat |AddressKeyFormat |AddressArtifactFormat |AddressRegionalFormat)">
+<!ENTITY % AddressResultsType "(ValidAddressIndicator |AmbiguousAddressIndicator |NoCandidatesIndicator 
+|OperationCompletedIndicator )">
+<!ENTITY % EMailMessage "(EMailAddress+, Memo?, Subject?, ReplyToEMailAddress?, FromEMailAddress, FromName?, UndeliverableEMailAddress?, MessageBody+)">
+<!ENTITY % FlexAddress "(Address | AddressArtifactFormat | AddressKeyFormat | AddressTokenFormat | AddressLabelFormat | AddressRegionalFormat)">
+<!ENTITY % OddEvenChoices "(OddIndicator | EvenIndicator | BothIndicator)">
+<!ENTITY % CandidateOutputFormat "((ArtifactFormatIndicator , KeyFormatIndicator?) | (ArtifactFormatIndicator? , KeyFormatIndicator))">
+<!ENTITY % RequestedOutputIndicators "(((%CandidateOutputFormat;)?) , ReformatInputIndicator? , ModifiedRequestIndicator?)">
+<!ENTITY % BehaviorIndicators "(((CandidateListIndicator , %CandidateOutputFormat; , MaximumListSize?) | (BinaryIndicator)) , ReformatInputIndicator? , IncludeUPSPreferredIndicator?)">
+<!--Deprecated Vocabulary Elements-->
+<!ELEMENT AdditionalHandling EMPTY>
+<!ELEMENT DocumentsOnly EMPTY>
+<!ELEMENT ExtendedDestination EMPTY>
+<!ELEMENT HoldForPickup EMPTY>
+<!ELEMENT Hundredweight EMPTY>
+<!ELEMENT Modify EMPTY>
+<!ELEMENT OtherDocuments EMPTY>
+<!ELEMENT ResidentialAddress EMPTY>
+<!ELEMENT SaturdayDelivery EMPTY>
+<!ELEMENT SaturdayPickup EMPTY>
+<!ELEMENT ShipperExportDeclaration EMPTY>
+<!ELEMENT SignatureRequired EMPTY>
+<!ELEMENT Void EMPTY>
+<!ELEMENT WaybillPrint EMPTY>
+<!--Base Vocabulary-->
+<!ELEMENT AccountName (#PCDATA)>
+<!ELEMENT AccountNumber (#PCDATA)>
+<!ELEMENT AccessLicenseProfile (CountryCode, LanguageCode, AccessLicenseText?)>
+<!ELEMENT AccessLicenseText (#PCDATA)>
+<!ELEMENT Activity (ActivityLocation?, Status?, Date?, Time?)>
+<!ELEMENT ActiveThreadCount (#PCDATA)>
+<!ELEMENT ActivityLocation ((Address | AddressArtifactFormat), Code?, Description?, SignedForByName?, SignatureImage?, HTMLImage?)>
+<!ELEMENT AdditionalChargeIndicator EMPTY>
+<!ELEMENT AdditionalHandlingIndicator EMPTY>
+<!ELEMENT AdditionalHandlingCharge (CurrencyCode?, MonetaryValue)>
+<!ELEMENT AdditionalServices (#PCDATA)>
+<!ELEMENT Address (ConsigneeName?, AddressLine1?, AddressLine2?, AddressLine3?, City?, StateProvinceCode?, PostalCode?, CountryCode?, (ResidentialAddress | ResidentialAddressIndicator)?)>
+<!ELEMENT AddressArtifactFormat (%AddressArtifacts;)>
+<!ELEMENT AddressExtendedInformation (Type, Low, High?, (%OddEvenChoices;)?)>
+<!ELEMENT AddressKeyFormat (ConsigneeName?, BuildingName?, AddressLine*, (Region? | (PoliticalDivision2?, PoliticalDivision1?, PostcodePrimaryLow?, PostcodeExtendedLow?)), Urbanization?, CountryCode, ResidentialAddressIndicator?)>
+<!ELEMENT AddressLabelFormat (UserInput+, CountryCode)>
+<!ELEMENT AddressLine (#PCDATA)>
+<!ELEMENT AddressLine1 (#PCDATA)>
+<!ELEMENT AddressLine2 (#PCDATA)>
+<!ELEMENT AddressLine3 (#PCDATA)>
+<!ELEMENT AddressRegionalFormat (((Region, Urbanization?)? | (PoliticalDivision4?, PoliticalDivision3?, PoliticalDivision2?, PoliticalDivision1?, PostcodePrimaryLow?)), CountryCode, ResidentialAddressIndicator?)>
+<!ELEMENT AddressTokenFormat (#PCDATA)>
+<!ELEMENT AddShippingChargesToCODIndicator EMPTY>
+<!ELEMENT AirIndicator EMPTY>
+<!ELEMENT AlternateDeliveryTime (#PCDATA)>
+<!ELEMENT AlternateDeliveryDate (#PCDATA)>
+<!ELEMENT AlternateNumber (#PCDATA | StructuredPhoneNumber)*>
+<!ELEMENT AlternateProfileAccessNumber (#PCDATA)>
+<!ELEMENT AmbiguousAddressIndicator EMPTY>
+<!ELEMENT ArtifactFormatIndicator EMPTY>
+<!ELEMENT ASOLocationIndicator EMPTY>
+<!ELEMENT AttentionName (#PCDATA)>
+<!ELEMENT Attribute (Name, Value)>
+<!ELEMENT AutoDutyCode (#PCDATA)>
+<!ELEMENT AddressValidationOperationCommands ((QueryIndicator, %BehaviorIndicators;) | ParseAndStandardizeIndicator)>
+<!ELEMENT BarCodeDeliveryNumber (#PCDATA)>
+<!ELEMENT BarCodeIndicator EMPTY>
+<!ELEMENT BCDNPackage (Activity*, Shipper, Service, TrackingNumber?, DeliveryAttemptDate?, DeliveryAttemptTime?, RescheduledDeliveryDate?, RescheduledDeliveryTime?, ScheduledDeliveryDate?, ScheduledDeliveryTime?, COD?, DCREligibility)>
+<!ELEMENT BeginDate (#PCDATA)>
+<!ELEMENT BillDutyTaxShipChargestoShipper (BillShipper | BillThirdPartyShipper)>
+<!ELEMENT BillImporter (ImporterOfRecord, (AccountNumber | CreditCard))>
+<!ELEMENT BillingWeight (UnitOfMeasurement?, Weight)>
+<!ELEMENT BillReceiver ((AccountNumber | CreditCard), Address?)>
+<!ELEMENT BillShipper ((AccountNumber | CreditCard))>
+<!ELEMENT BillThirdParty (BillThirdPartyShipper | BillThirdPartyConsignee)>
+<!ELEMENT BillThirdPartyConsignee (ThirdParty, AccountNumber)>
+<!ELEMENT BillThirdPartyShipper (ThirdParty, AccountNumber)>
+<!ELEMENT BinaryIndicator EMPTY>
+<!ELEMENT BookNumber (#PCDATA)>
+<!ELEMENT BothIndicator EMPTY>
+<!ELEMENT BrokerCode (#PCDATA)>
+<!ELEMENT BuildingName (#PCDATA)>
+<!ELEMENT BusinessTransitDays (#PCDATA)>
+<!ELEMENT CallTagARS (Number?, Code?, ScheduledPickupDate?)>
+<!ELEMENT CallTagARSCharge (CurrencyCode?, MonetaryValue)>
+<!ELEMENT Candidate (AddressArtifactFormat?, AddressKeyFormat?, AddressTokenFormat?)>
+<!ELEMENT CandidateListIndicator EMPTY>
+<!ELEMENT CarNumber (#PCDATA)>
+<!ELEMENT CertificateOfOrigin (Type?, Number?, Code?, COCode?)>
+<!-- New Element CharSet-->
+<!ELEMENT CharSet (#PCDATA)>
+<!ELEMENT City (#PCDATA)>
+<!ELEMENT ClientSoftwareProfile (SoftwareInstaller, SoftwareProductName, SoftwareProvider, SoftwareVersionNumber)>
+<!ELEMENT ClosedIndicator EMPTY>
+<!ELEMENT ClosedTime (#PCDATA)>
+<!ELEMENT COCode (#PCDATA)>
+<!ELEMENT COD (CODFundsCode?, CODCode?, CODAmount, ControlNumber?, CODStatus?, AddShippingChargesToCODIndicator?)>
+<!ELEMENT CODAmount (CurrencyCode?, MonetaryValue)>
+<!ELEMENT CODCharge (CurrencyCode?, MonetaryValue)>
+<!ELEMENT CODCode (#PCDATA)>
+<!ELEMENT Code (#PCDATA)>
+<!ELEMENT CODFundsCode (#PCDATA)>
+<!ELEMENT CODStatus (#PCDATA)>
+<!ELEMENT Comments (#PCDATA)>
+<!ELEMENT Commodity (OriginCountryCode, CommodityCode?, PartNumber?, CurrencyCode?, TotalAmount, LineUnitAmountPrice?, Quantity, UnitOfMeasurement, MerchandiseDescription+)>
+<!ELEMENT CommodityCode (#PCDATA)>
+<!ELEMENT CompanyName (#PCDATA)>
+<!ELEMENT CompanyURL (#PCDATA)>
+<!ELEMENT CompleteSystemIndicator EMPTY>
+<!ELEMENT ConcurrentConnections (#PCDATA)>
+<!ELEMENT ConfigurationInformation (#PCDATA)>
+<!ELEMENT ConsigneeName (#PCDATA)>
+<!ELEMENT ConsigneeBilled ((AccountNumber | CreditCard)?)>
+<!ELEMENT ConsolidatedClearanceQuantity (#PCDATA)>
+<!ELEMENT Contact (Name?, Title?, EMailAddress?, PhoneNumber?, FaxNumber?, AlternateNumber?)>
+<!ELEMENT ContactInfo (Name?, PhoneNumber?)>
+<!ELEMENT ContactPhoneNumber (PhoneNumber)>
+<!ELEMENT ControlNumber (#PCDATA)>
+<!ELEMENT ControlLogReceipt (ImageFormat, GraphicImage)>
+<!ELEMENT CostAndFreight ((BillShipper | BillThirdPartyShipper), (BillImporter | BillReceiver | BillThirdPartyConsignee))>
+<!ELEMENT Country (#PCDATA)>
+<!ELEMENT CountryCode (#PCDATA)>
+<!ELEMENT CreditCard (Type, Number, ExpirationDate)>
+<!ELEMENT CurrencyCode (#PCDATA)>
+<!ELEMENT CurrentRequestBacklog (#PCDATA)>
+<!ELEMENT CustomerCenterCutoff (#PCDATA)>
+<!ELEMENT CustomerClassification (Code, Description?)>
+<!ELEMENT CustomsInvoice (Commodity, InvoiceLineTotal, CurrencyCode?, InvoiceNumber?, PONumber?, SubTotal, TotalInvoiceAmount, TermsOfShipment?, ReasonForExport, FreightCharges?, InsuranceCharges?, DiscountRebate?, OtherCharges?, Comments?)>
+<!ELEMENT DatabasesOnlyIndicator EMPTY>
+<!ELEMENT Date (#PCDATA)>
+<!ELEMENT DateTimeStamp (#PCDATA)>
+<!ELEMENT DayOfWeek (#PCDATA)>
+<!ELEMENT DCISType (#PCDATA)>
+<!ELEMENT DCISNumber (#PCDATA)>
+<!ELEMENT DCRCutoffDateInUTC (#PCDATA)>
+<!ELEMENT DCRCutoffTimeInUTC (#PCDATA)>
+<!ELEMENT DCREligibility (EligibilityError*, ModificationStatus?, EligibilityStatus?, DeliveryAttempt, DCROptions, UniquePackageIdentifier)>
+<!ELEMENT DCROptions (SameDayWillCall*, WillCall*, ReturnToSender*, FutureDelivery*)>
+<!ELEMENT DeclarationStatement (#PCDATA)>
+<!ELEMENT DelayCount (#PCDATA)>
+<!ELEMENT DelDutyPaidVATUnPaid ((BillShipper | BillThirdPartyShipper), (BillImporter | BillReceiver | BillThirdPartyConsignee))>
+<!ELEMENT DeliveryAttempt (Date?, Number?, Driver?, SLIC?, Region?, ShipperNumber?, AddressArtifactFormat, PackageCenter)>
+<!ELEMENT DeliveryAttemptDate (#PCDATA)>
+<!ELEMENT DeliveryAttemptTime (#PCDATA)>
+<!ELEMENT DeliveryConfirmation (DCISType, DCISNumber?)>
+<!ELEMENT DeliveryConfirmationCharge (CurrencyCode?, MonetaryValue)>
+<!ELEMENT DeliveryStop (BarCodeDeliveryNumber, NumberBCDNPackages?, ShipTo?, ScheduledDeliveryDate?, ScheduledDeliveryTime?, RescheduledDeliveryDate?, RescheduledDeliveryTime?, BCDNPackage+)>
+<!ELEMENT DeliveryZone (#PCDATA)>
+<!ELEMENT Description (#PCDATA)>
+<!ELEMENT DescriptionOfGoods (#PCDATA)>
+<!ELEMENT DestinationControl (#PCDATA)>
+<!ELEMENT DestinationCountryCode (#PCDATA)>
+<!ELEMENT DestinationPostalCode (#PCDATA)>
+<!ELEMENT DeveloperLicenseNumber (#PCDATA)>
+<!ELEMENT DimensionalWeight (UnitOfMeasurement?, Weight)>
+<!ELEMENT Dimensions (UnitOfMeasurement?, Length, Width, Height)>
+<!ELEMENT Disclaimer (#PCDATA)>
+<!ELEMENT DiscountRebate (#PCDATA)>
+<!ELEMENT Distance (Value, UnitOfMeasurement)>
+<!ELEMENT DocumentCode (#PCDATA)>
+<!ELEMENT DocumentsOnlyIndicator EMPTY>
+<!ELEMENT Directions (Segment, Distance?, Time?)>
+<!ELEMENT Driver (Name?, Number?, CarNumber?)>
+<!ELEMENT DrivingDirection (Directions*, TotalDistance, TotalTime)>
+<!ELEMENT DropLocation (LocationID, IVR?, AddressKeyFormat, PhoneNumber+, FaxNumber?, EMailAddress?, Disclaimer*, LocationType, Distance, SpecialInstructions*, LatestGroundDropOffTime*, LatestAirDropOffTime*, AdditionalChargeIndicator?, AdditionalServices*, Service*, NonStandardHoursOfOperation?, StandardHoursOfOperation?)>
+<!ELEMENT EarliestDeliveryTime (#PCDATA)>
+<!ELEMENT EarliestTimeReady (#PCDATA)>
+<!ELEMENT EligibilityError (Type, Number)>
+<!ELEMENT EligibilityStatus (Code, Description?)>
+<!ELEMENT EMailAddress (#PCDATA)>
+<!ELEMENT EMailContent (#PCDATA)>
+<!ELEMENT EMailMessage (EMailAddress+, Memo?, Subject?, SubjectCode?, FromEMailAddress?, FromName?, UndeliverableEMailAddress?, MessageBody*)>
+<!ELEMENT EmployerIdentificationNumber (#PCDATA)>
+<!ELEMENT EndDate (#PCDATA)>
+<!ELEMENT EstimatedArrival (BusinessTransitDays, Time?, Date, DayOfWeek?, PickupDate?, PickupTime?, TotalTransitDays?, CustomerCenterCutoff?, RestDays?, HolidayCount?, DelayCount?)>
+<!ELEMENT ExpirationDate (#PCDATA)>
+<!ELEMENT ExportCommodityControlNumber (#PCDATA)>
+<!ELEMENT ExportLicenseInformation (#PCDATA)>
+<!ELEMENT ExtendedDestinationIndicator EMPTY>
+<!ELEMENT EvenIndicator EMPTY>
+<!ELEMENT FaxDestination (FaxDestinationIndicator, FaxNumber)>
+<!ELEMENT FaxDestinationIndicator (#PCDATA)>
+<!ELEMENT FaxNumber (#PCDATA | StructuredPhoneNumber)*>
+<!ELEMENT FileName (#PCDATA)>
+<!ELEMENT FlatRate (CurrencyCode?, MonetaryValue)>
+<!ELEMENT FloorID (#PCDATA)>
+<!ELEMENT FreeOnBoard ((BillShipper | BillThirdPartyShipper), (BillImporter | BillReceiver | BillThirdPartyConsignee))>
+<!ELEMENT FreightCharges (CurrencyCode?, MonetaryValue)>
+<!ELEMENT FreightCollect (BillReceiver | BillImporter | BillThirdPartyConsignee)>
+<!--New Element FromEMailAddress-->
+<!ELEMENT FromEMailAddress (#PCDATA)>
+<!ELEMENT FromName (#PCDATA)>
+<!ELEMENT FutureDelivery (Date, DayOfWeek?)>
+<!ELEMENT Geocode (Latitude, Longitude, Quality?)>
+<!ELEMENT GeocodeCandidate (AddressKeyFormat, Geocode, LandmarkName?)>
+<!ELEMENT GraphicImage (#PCDATA)>
+<!ELEMENT GroupNumber (#PCDATA)>
+<!ELEMENT GroundIndicator EMPTY>
+<!ELEMENT Guaranteed (Code, Description?)>
+<!ELEMENT GuaranteedDaysToDelivery (#PCDATA)>
+<!ELEMENT HandlingCharge (FlatRate | Percentage)>
+<!ELEMENT HandlingChargeAmount (CurrencyCode?, MonetaryValue)>
+<!ELEMENT HazardousMaterialsCharge (CurrencyCode?, MonetaryValue)>
+<!ELEMENT HazardousMaterialsCode (#PCDATA)>
+<!ELEMENT HeartBeatStatus (ActiveThreadCount, ConcurrentConnections, MaximumConcurrentConnections, CurrentRequestBacklog, MaximumBacklog, ConfigurationInformation)>
+<!ELEMENT HeartBeatStatusCheckCommand EMPTY>
+<!ELEMENT Height (#PCDATA)>
+<!ELEMENT High (#PCDATA)>
+<!ELEMENT HoldForPickupIndicator EMPTY>
+<!ELEMENT HolidayHours (#PCDATA)>
+<!ELEMENT HTMLImage (#PCDATA)>
+<!ELEMENT HTTPUserAgent (#PCDATA)>
+<!ELEMENT HolidayCount (#PCDATA)>
+<!ELEMENT HundredWeightIndicator EMPTY>
+<!ELEMENT Image (ImageFormat, GraphicImage)>
+<!ELEMENT ImageFormat (Code, Description?)>
+<!ELEMENT ImageMap (LocationID, XCoordinate, YCoordinate)>
+<!ELEMENT ImporterOfRecord (CompanyName?, AttentionName?, PhoneNumber?, FaxDestination, Address)>
+<!ELEMENT IncludeUPSPreferredIndicator EMPTY>
+<!ELEMENT InformationLevel (#PCDATA)>
+<!ELEMENT InformationSourceCode (#PCDATA)>
+<!ELEMENT InquiryDataSource (#PCDATA)>
+<!ELEMENT InsuranceCharges (CurrencyCode?, MonetaryValue)>
+<!ELEMENT InsuredValue (CurrencyCode?, MonetaryValue)>
+<!ELEMENT InsuredValueCharge (CurrencyCode?, MonetaryValue)>
+<!ELEMENT InternationalSignatureGraphicImage (#PCDATA)>
+<!ELEMENT InvoiceLineTotal (CurrencyCode?, MonetaryValue)>
+<!ELEMENT InvoiceNumber (#PCDATA)>
+<!ELEMENT ItemizedPackageCharges (AdditionalHandlingCharge?, CODCharge?, DeliveryConfirmationCharge?, HazardousMaterialsCharge?, InsuredValueCharge?, ShipmentNotificationCharge*, VerbalConfirmationCharge?)>
+<!ELEMENT ItemizedShipmentCharges (CallTagARSCharge?, InsuredValueCharge?, SaturdayDeliveryCharge?, SaturdayPickupCharge?, ShipmentNotificationCharge*)>
+<!ELEMENT IVR (PhraseID?, TextToSpeechIndicator?)>
+<!ELEMENT KeyFormatIndicator EMPTY>
+<!ELEMENT LabelControlNumber (ProductName, ProductVersion, PrinterMakeAndModel?, PrinterDriverVersion?)>
+<!ELEMENT LabelDelivery (EMailMessage?, LabelLinkIndicator?, ResendEMailIndicator?)>
+<!ELEMENT LabelDeliveryOptions (LabelDelivery)>
+<!ELEMENT LabelImage (LabelImageFormat, GraphicImage, HTMLImage?, PDF417?, InternationalSignatureGraphicImage?, URL?)>
+<!ELEMENT LabelImageFormat (Code, Description?)>
+<!ELEMENT LabelLinkIndicator EMPTY>
+<!ELEMENT LabelPrintMethod (Code, Description?)>
+<!ELEMENT LabelResults (TrackingNumber, LabelImage?, Receipt?)>
+<!ELEMENT LabelSpecification (LabelPrintMethod?, HTTPUserAgent?, LabelStockSize?, LabelImageFormat, LabelControlNumber?)>
+<!ELEMENT LabelStockSize (UnitOfMeasurement?, Height, Width)>
+<!ELEMENT LandmarkCode (#PCDATA)>
+<!ELEMENT LandmarkName (#PCDATA)>
+<!ELEMENT LanguageCode (#PCDATA)>
+<!ELEMENT LatestAirDropOffTime (#PCDATA)>
+<!ELEMENT LatestGroundDropOffTime (#PCDATA)>
+<!ELEMENT LatestTimeReady (#PCDATA)>
+<!ELEMENT Latitude (#PCDATA)>
+<!ELEMENT Length (#PCDATA)>
+<!ELEMENT LicenseExpirationDate (#PCDATA)>
+<!ELEMENT LicenseInformation (#PCDATA)>
+<!ELEMENT LineMonetaryTotals (CurrencyCode?, MonetaryValue)>
+<!ELEMENT LineNumber (#PCDATA)>
+<!ELEMENT LineUnitAmountPrice (CurrencyCode?, MonetaryValue)>
+<!ELEMENT Location (#PCDATA)>
+<!ELEMENT LocationCriteria (LocationType*, MaximumListSize?, SearchRadius?, ServiceSearch*)>
+<!ELEMENT LocationID (#PCDATA)>
+<!ELEMENT LocationType (UPSCentersIndicator?, UPSDesignatedIndicator?, UPSLetterCentersIndicator?, ASOLocationIndicator?, LocationSubType?, UPSGoldShieldIndicator?)>
+<!ELEMENT LocationSubType (Code, Description?)>
+<!ELEMENT Longitude (#PCDATA)>
+<!ELEMENT LoopPositionNumber (#PCDATA)>
+<!ELEMENT Low (#PCDATA)>
+<!ELEMENT MapDimensions (Height, Width)>
+<!ELEMENT MapID (#PCDATA)>
+<!ELEMENT MapNavigation (Number?, MapDimensions?, ZoomFactor?, PanX?, PanY?, MapID?, MapURL?, ImageMap*)>
+<!ELEMENT MapURL (#PCDATA)>
+<!ELEMENT MarksAndNumbers (#PCDATA)>
+<!ELEMENT MaximumBacklog (#PCDATA)>
+<!ELEMENT MaximumConcurrentConnections (#PCDATA)>
+<!ELEMENT MaximumListSize (#PCDATA)>
+<!ELEMENT Message (Code, Description?)>
+<!ELEMENT Memo (#PCDATA)>
+<!ELEMENT MerchandiseDescription (#PCDATA)>
+<!ELEMENT MessageBody (MIMEType, (EMailContent | Image), CharSet?, FileName?)>
+<!ELEMENT Method (#PCDATA)>
+<!--<!ATTLIST MessageBody  id    ID     #IMPLIED
+                         idref IDREF  #IMPLIED >-->
+<!ELEMENT MIMEType (#PCDATA)>
+<!-- MIMEType must conform to RFC-822-->
+<!ELEMENT ModificationOccurredIndicator EMPTY>
+<!ELEMENT ModificationRequestIndicator EMPTY>
+<!ELEMENT ModificationStatus (Code, Description?)>
+<!ELEMENT ModifyIndicator EMPTY>
+<!ELEMENT MonetaryValue (#PCDATA)>
+<!ELEMENT Name (#PCDATA)>
+<!ELEMENT NextDayPickupIndicator EMPTY>
+<!ELEMENT NoCandidatesIndicator EMPTY>
+<!ELEMENT NoMapIndicator EMPTY>
+<!ELEMENT NonStandardHoursOfOperation (#PCDATA)>
+<!ELEMENT NotificationCode (#PCDATA)>
+<!ELEMENT Notification (NotificationCode?, AttentionName?, CompanyName?, FaxDestination?, EMailMessage?, PhoneNumber?)>
+<!ELEMENT Number (#PCDATA)>
+<!ELEMENT NumberBCDNPackages (#PCDATA)>
+<!ELEMENT NumberOfPackagesPerCommodity (#PCDATA)>
+<!ELEMENT OddIndicator EMPTY>
+<!ELEMENT OffsetToUTC (#PCDATA)>
+<!ELEMENT OnCallAir (PickupDetails?, Schedule?)>
+<!ELEMENT OpenTime (#PCDATA)>
+<!ELEMENT OperationCompletedIndicator EMPTY>
+<!ELEMENT OriginAddress (LandmarkCode?, PhoneNumber?, Geocode?, AddressKeyFormat, MaximumListSize?)>
+<!ELEMENT OriginCountryCode (#PCDATA)>
+<!ELEMENT OtherCharges (CurrencyCode?, MonetaryValue)>
+<!ELEMENT OtherDocumentsIndicator EMPTY>
+<!ELEMENT OversizePackage (#PCDATA)>
+<!ELEMENT Package (Activity*, Message*, PackagingType?, Description?, Dimensions?, DimensionalWeight?, PackageWeight?, OversizePackage?, TrackingNumber?, ReferenceNumber*, RescheduledDeliveryDate?, RescheduledDeliveryTime?, PackageServiceOptions?, AdditionalHandling?, Void?)>
+<!ELEMENT PackageActivityStatusCode (#PCDATA)>
+<!ELEMENT PackageCenter (UTCSign?, OffsetToUTC?, DCRCutoffDateInUTC?, DCRCutoffTimeInUTC?)>
+<!ELEMENT PackageDeliveryChange (DateTimeStamp, TrackingNumber, DCROptions*, DeliveryAttempt?, UniquePackageIdentifier?, Contact?)>
+<!ELEMENT PackageResults (TrackingNumber, OversizePackage?, TransportationCharges, ServiceOptionsCharges?, TotalPackageCharges?, ItemizedPackageCharges?, LabelImage?, Receipt?, CODAmount?)>
+<!ELEMENT PackageSequenceNumber (#PCDATA)>
+<!ELEMENT PackageServiceOptions (DeliveryConfirmation?, COD?, InsuredValue?, EarliestDeliveryTime?, HazardousMaterialsCode?, SignatureRequired?, HoldForPickup?, VerbalConfirmation?, LabelDelivery?, Notification*, ShipmentNotification*, ShipperReleaseIndicator?)>
+<!ELEMENT PackageWeight (UnitOfMeasurement?, Weight)>
+<!ELEMENT PackagingType (Code, Description?)>
+<!ELEMENT PageNumber (#PCDATA)>
+<!ELEMENT PanX (#PCDATA)>
+<!ELEMENT PanY (#PCDATA)>
+<!ELEMENT ParseAndStandardizeIndicator EMPTY>
+<!ELEMENT PartNumber (#PCDATA)>
+<!ELEMENT PartiesToTransaction (#PCDATA)>
+<!ELEMENT PaymentInformation ((Prepaid | FreightCollect | BillThirdParty | FreeOnBoard | CostAndFreight | DelDutyPaidVATUnPaid | BillDutyTaxShipChargestoShipper | ConsigneeBilled))>
+<!ELEMENT PaymentTerms (#PCDATA)>
+<!ELEMENT PDF417 (#PCDATA)>
+<!ELEMENT Percentage (#PCDATA)>
+<!ELEMENT PhoneExtension (#PCDATA)>
+<!ELEMENT PhoneCountryCode (#PCDATA)>
+<!ELEMENT PhoneDialPlanNumber (#PCDATA)>
+<!ELEMENT PhoneLineNumber (#PCDATA)>
+<!ELEMENT PhoneNumber (#PCDATA | StructuredPhoneNumber)*>
+<!ELEMENT PhraseID (#PCDATA)>
+<!ELEMENT PickupCountryCode (#PCDATA)>
+<!ELEMENT PickupDate (#PCDATA)>
+<!ELEMENT PickupDateRange (BeginDate, EndDate)>
+<!ELEMENT PickupDetails (PickupDate, EarliestTimeReady?, LatestTimeReady?, SuiteRoomID?, FloorID?, Location?, ContactInfo?)>
+<!ELEMENT PickupPostalCode (#PCDATA)>
+<!ELEMENT PickupSummary (Attribute+)>
+<!ELEMENT PickupTime (#PCDATA)>
+<!ELEMENT PickupType (Code, Description?)>
+<!ELEMENT PLDData (#PCDATA)>
+<!ELEMENT PODDays (#PCDATA)>
+<!ELEMENT PODDate (#PCDATA)>
+<!ELEMENT PoliticalDivision4 (#PCDATA)>
+<!ELEMENT PoliticalDivision3 (#PCDATA)>
+<!ELEMENT PoliticalDivision2 (#PCDATA)>
+<!ELEMENT PoliticalDivision1 (#PCDATA)>
+<!ELEMENT PONumber (#PCDATA)>
+<!ELEMENT PostalCode (#PCDATA)>
+<!ELEMENT PostcodeExtendedLow (#PCDATA)>
+<!ELEMENT PostcodeExtendedHigh (#PCDATA)>
+<!ELEMENT PostalCodeHighEnd (#PCDATA)>
+<!ELEMENT PostalCodeLowEnd (#PCDATA)>
+<!ELEMENT PostcodePrimaryLow (#PCDATA)>
+<!ELEMENT PostcodePrimaryHigh (#PCDATA)>
+<!ELEMENT PrepPickupTransactionId (#PCDATA)>
+<!ELEMENT Prepaid ((BillShipper | BillThirdPartyShipper), (BillImporter | BillReceiver | BillThirdPartyConsignee)?)>
+<!ELEMENT PrimaryContact (Name?, Title?, EMailAddress?, PhoneNumber?, FaxNumber?)>
+<!ELEMENT PrinterMakeAndModel (#PCDATA)>
+<!ELEMENT PrinterDriverVersion (#PCDATA)>
+<!ELEMENT ProductName (#PCDATA)>
+<!ELEMENT ProductVersion (#PCDATA)>
+<!ELEMENT ProofOfDeliveryReplyType (#PCDATA)>
+<!ELEMENT Quality (#PCDATA)>
+<!ELEMENT Quantity (#PCDATA)>
+<!ELEMENT QuantityScheduleBUnits (#PCDATA)>
+<!ELEMENT QueryIndicator EMPTY>
+<!ELEMENT Rank (#PCDATA)>
+<!ELEMENT RatedShipmentWarning (#PCDATA)>
+<!ELEMENT ReasonForExport (#PCDATA)>
+<!ELEMENT Receipt (URL?, HTMLImage?, Image?)>
+<!ELEMENT Receiver (Address, SignedForByName?)>
+<!ELEMENT ReferenceNumber (BarCodeIndicator?, Number?, Code?, Value)>
+<!ELEMENT ReformatInputIndicator EMPTY>
+<!ELEMENT Region (#PCDATA)>
+<!ELEMENT RegionalRequestIndicator EMPTY>
+<!ELEMENT RegistrationInformation (UserName, Title?, CompanyName, Address, PhoneNumber, PhoneExtension?, EMailAddress, ((ShipperNumber, PickupPostalCode, PickupCountryCode) | ShipperAccount*))>
+<!ELEMENT Remarks (#PCDATA)>
+<!ELEMENT RescheduledDeliveryDate (#PCDATA)>
+<!ELEMENT RescheduledDeliveryTime (#PCDATA)>
+<!ELEMENT ResendPLDTransactionId (#PCDATA)>
+<!ELEMENT ResidentialAddressIndicator EMPTY>
+<!ELEMENT RestDays (#PCDATA)>
+<!ELEMENT ResultsCode (#PCDATA)>
+<!ELEMENT ResultsDescription (#PCDATA)>
+<!ELEMENT ReturnService (Code)>
+<!ELEMENT ReturnToSender (Code, Description?)>
+<!ELEMENT SameDayWillCall (Date, DayOfWeek?)>
+<!ELEMENT SaturdayDeliveryIndicator EMPTY>
+<!ELEMENT SaturdayDeliveryCharge (CurrencyCode?, MonetaryValue)>
+<!ELEMENT SaturdayPickupIndicator EMPTY>
+<!ELEMENT SaturdayPickupCharge (CurrencyCode?, MonetaryValue)>
+<!ELEMENT Schedule (PickupDay?, Method?)>
+<!ELEMENT ScheduledDeliveryDate (#PCDATA)>
+<!ELEMENT ScheduledDeliveryTime (#PCDATA)>
+<!ELEMENT ScheduledPickupDate (Date)>
+<!ELEMENT SearchRadius (#PCDATA)>
+<!ELEMENT SearchResults (GeocodeCandidate+ | (Disclaimer?, DropLocation+, MapNavigation?, DrivingDirection*))>
+<!ELEMENT Segment (#PCDATA)>
+<!ELEMENT SequenceNumber (#PCDATA)>
+<!ELEMENT Service (Code, Description?)>
+<!ELEMENT ServiceOptionsCharges (CurrencyCode?, MonetaryValue)>
+<!ELEMENT ServiceSearch (Time?, GroundIndicator?, AirIndicator?, SaturdayPickupIndicator?)>
+<!ELEMENT ShipCandidate (Address)>
+<!ELEMENT ShipFrom (CompanyName?, AttentionName?, PhoneNumber?, FaxNumber?, EMailAddress?, Address?)>
+<!ELEMENT ShipTo (ShipperAssignedIdentificationNumber?, CompanyName?, AttentionName?, PhoneNumber?, TaxIdentificationNumber?, FaxNumber?, EMailAddress?, Address?, LocationID?)>
+<!ELEMENT Shipment (Description?, Shipper, ShipTo, ShipFrom?, SoldTo?, DeliveryZone?, ShipmentWeight?, PaymentInformation?, ShipmentIdentificationNumber?, ReferenceNumber*, Service?, PickupDate?, ScheduledDeliveryDate?, ScheduledDeliveryTime?, AlternateDeliveryTime?, AlternateDeliveryDate?, ReturnService?, InvoiceLineTotal?, DocumentsOnly?, Package+, ShipmentServiceOptions?, HandlingCharge?)>
+<!ELEMENT ShipmentCharges (TransportationCharges, ServiceOptionsCharges, ItemizedShipmentCharges?, HandlingChargeAmount?, TotalCharges)>
+<!ELEMENT ShipmentDigest (#PCDATA)>
+<!ELEMENT ShipmentIdentificationNumber (#PCDATA)>
+<!ELEMENT ShipmentInsuredValue (CurrencyCode?, MonetaryValue)>
+<!ELEMENT ShipmentNotification (NotificationCode?, AttentionName?, CompanyName?, FaxDestination?, EMailMessage?, PhoneNumber?, Memo?)>
+<!ELEMENT ShipmentNotificationCharge (CurrencyCode?, MonetaryValue)>
+<!ELEMENT ShipmentResults (DeliveryZone?, ShipmentCharges?, BillingWeight, ShipmentIdentificationNumber, ControlLogReceipt?, PackageResults+)>
+<!ELEMENT ShipmentSEDCASNumber (#PCDATA)>
+<!ELEMENT ShipmentServiceOptions (SaturdayPickup?, SaturdayDelivery?, OnCallAir?, CallTagARS?, ShipmentNotification*, Hundredweight?, COD?, LabelDelivery?, Notification*, CustomsInvoice?)>
+<!-- ShipmentNotification, within ShipmentServiceOptions is flagged for deprication-->
+<!ELEMENT ShipmentWeight (UnitOfMeasurement?, Weight)>
+<!ELEMENT Shipper (Name?, AttentionName?, TaxIdentificationNumber?, PhoneNumber?, FaxNumber?, ShipperNumber?, EMailAddress?, Address?)>
+<!ELEMENT ShipperAccount (ShipperNumber, PickupPostalCode, PickupCountryCode, AccountName)>
+<!ELEMENT ShipperAssignedIdentificationNumber (#PCDATA)>
+<!ELEMENT ShipperExportDeclarationIndicator EMPTY>
+<!ELEMENT ShipperExportDeclarationCode (#PCDATA)>
+<!ELEMENT ShipperExportDeclarationLineAmount (#PCDATA)>
+<!ELEMENT ShipperInformation (ShipperNumber, ShipperProperty*)>
+<!ELEMENT ShipperNumber (#PCDATA)>
+<!ELEMENT ShipperProperty (Name, Value?)>
+<!ELEMENT ShipperQuery (ShipperNumber, ShipperProperty*)>
+<!ELEMENT ShipperReleaseIndicator EMPTY>
+<!ELEMENT SignatureImage (ImageFormat, GraphicImage)>
+<!ELEMENT SignatureRequiredIndicator EMPTY>
+<!ELEMENT SignedForByName (#PCDATA)>
+<!ELEMENT SLIC (#PCDATA)>
+<!ELEMENT SoftwareInstaller (#PCDATA)>
+<!ELEMENT SoftwareProductName (#PCDATA)>
+<!ELEMENT SoftwareProvider (#PCDATA)>
+<!ELEMENT SoftwareVersionNumber (#PCDATA)>
+<!ELEMENT SoldTo (CompanyName, TaxIdentificationNumber?, Address, PhoneNumber?)>
+<!ELEMENT SpecialInstructions (Segment+)>
+<!ELEMENT StandardHoursOfOperation (#PCDATA)>
+<!ELEMENT StateProvinceCode (#PCDATA)>
+<!ELEMENT Status (StatusType, StatusCode?)>
+<!ELEMENT StatusCode (Code, Description?)>
+<!ELEMENT StatusType (Code, Description?)>
+<!ELEMENT StopSequenceNumber (#PCDATA)>
+<!ELEMENT StreetName (#PCDATA)>
+<!ELEMENT StreetNumberLow (#PCDATA)>
+<!ELEMENT StreetNumberHigh (#PCDATA)>
+<!ELEMENT StreetNumberOddEven (%OddEvenChoices;)>
+<!ELEMENT StreetPrefix (#PCDATA)>
+<!ELEMENT StreetSuffix (#PCDATA)>
+<!ELEMENT StreetType (#PCDATA)>
+<!ELEMENT StructuredPhoneNumber (PhoneCountryCode?, PhoneDialPlanNumber, PhoneLineNumber, PhoneExtension?)>
+<!ELEMENT Subject (#PCDATA)>
+<!ELEMENT SubjectCode (#PCDATA)>
+<!ELEMENT SubTotal (CurrencyCode?, MonetaryValue)>
+<!ELEMENT SuiteRoomID (#PCDATA)>
+<!ELEMENT ServiceSummary (Service, Guaranteed*, Disclaimer*, EstimatedArrival)>
+<!ELEMENT TaxIdentificationNumber (#PCDATA)>
+<!ELEMENT TermsOfShipment (#PCDATA)>
+<!ELEMENT TextToSpeechIndicator EMPTY>
+<!ELEMENT ThirdParty (CompanyName?, AttentionName?, PhoneNumber?, FaxDestination?, Address, TaxIdentificationNumber?)>
+<!ELEMENT Time (#PCDATA)>
+<!ELEMENT Title (#PCDATA)>
+<!ELEMENT TokenFormatIndicator EMPTY>
+<!ELEMENT Total (#PCDATA)>
+<!ELEMENT TotalAmount (#PCDATA)>
+<!ELEMENT TotalCharges (CurrencyCode?, MonetaryValue)>
+<!ELEMENT TotalDistance (Distance)>
+<!ELEMENT TotalPackageCharges (CurrencyCode?, MonetaryValue)>
+<!ELEMENT TotalCost (CurrencyCode?, MonetaryValue)>
+<!ELEMENT TotalInvoiceAmount (#PCDATA)>
+<!ELEMENT TotalPackagesDelivered (#PCDATA)>
+<!ELEMENT TotalPackagesInShipment (#PCDATA)>
+<!ELEMENT TotalShipments (#PCDATA)>
+<!ELEMENT TotalTime (#PCDATA)>
+<!ELEMENT TotalTransitDays (#PCDATA)>
+<!ELEMENT TrackingCandidate (TrackingNumber, DestinationPostalCode?, DestinationCountryCode?, PickupDateRange?)>
+<!ELEMENT TrackingNumber (#PCDATA)>
+<!ELEMENT TradeAgreementType (#PCDATA)>
+<!ELEMENT TransactionID (#PCDATA)>
+<!ELEMENT Translate (LanguageCode, DialectCode?, Code*)>
+<!ELEMENT TransitFrom (%FlexAddress;)>
+<!ELEMENT TransitFromList (Candidate+)>
+<!ELEMENT TransitResponse (PickupDate, TransitFrom, TransitTo, DocumentsOnlyIndicator?, AutoDutyCode?, ShipmentWeight?, InvoiceLineTotal?, Disclaimer*, ServiceSummary*, MaximumListSize?)>
+<!ELEMENT TransitTo (%FlexAddress;)>
+<!ELEMENT TransitToList (Candidate+)>
+<!ELEMENT TransportationCharges (CurrencyCode?, MonetaryValue)>
+<!ELEMENT Type (#PCDATA)>
+<!ELEMENT TypeDestinationCode (#PCDATA)>
+<!ELEMENT UltimateDestinationCountryCode (#PCDATA)>
+<!ELEMENT UndeliverableEMailAddress (#PCDATA)>
+<!ELEMENT UniquePackageIdentifier (SLIC?, CountryCode?, InformationSourceCode?, LoopPositionNumber?, GroupNumber?, StopSequenceNumber?, PackageSequenceNumber?, PackageActivityStatusCode?)>
+<!ELEMENT UnitOfMeasurement (Code, Description?)>
+<!ELEMENT UPSCentersIndicator EMPTY>
+<!ELEMENT UPSDesignatedIndicator EMPTY>
+<!ELEMENT UPSLetterCentersIndicator EMPTY>
+<!ELEMENT UPSPreferredAddress (%AddressArtifacts;)>
+<!ELEMENT Urbanization (#PCDATA)>
+<!ELEMENT URL (#PCDATA)>
+<!ELEMENT UserInput (#PCDATA)>
+<!ELEMENT UserName (#PCDATA)>
+<!ELEMENT UTCSign (#PCDATA)>
+<!ELEMENT ValidAddressIndicator EMPTY>
+<!ELEMENT ValidationRulesOnlyIndicator EMPTY>
+<!ELEMENT Value (#PCDATA)>
+<!ELEMENT VerbalConfirmation (ContactInfo?, Name?, PhoneNumber?)>
+<!ELEMENT VerbalConfirmationCharge (CurrencyCode?, MonetaryValue)>
+<!ELEMENT Version (#PCDATA)>
+<!ELEMENT VoidIndicator EMPTY>
+<!ELEMENT WaybillNumber (#PCDATA)>
+<!ELEMENT WayBillPrintIndicator EMPTY>
+<!ELEMENT Weight (#PCDATA)>
+<!ELEMENT Width (#PCDATA)>
+<!ELEMENT WillCall (Date, DayOfWeek?)>
+<!ELEMENT WillCallSearch (SLIC, PostcodePrimaryLow, CountryCode)>
+<!ELEMENT YCoordinate (#PCDATA)>
+<!ELEMENT XCoordinate (#PCDATA)>
+<!ELEMENT ZoomFactor (#PCDATA)>
+<!ELEMENT Town (#PCDATA)>
+<!ELEMENT DialectCode (#PCDATA)>
+<!ELEMENT ResendEMailIndicator EMPTY>
+<!ELEMENT UPSGoldShieldIndicator (#PCDATA)>
+<!ELEMENT PickupDay (#PCDATA)>
diff --git a/xml/tests/testData/xml/SchemaAutodetection/cs-xacml-schema-context-01.xsd b/xml/tests/testData/xml/SchemaAutodetection/cs-xacml-schema-context-01.xsd
new file mode 100644
index 0000000..b282515
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaAutodetection/cs-xacml-schema-context-01.xsd
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="urn:oasis:names:tc:xacml:1.0:context" xmlns:xacml="urn:oasis:names:tc:xacml:1.0:policy" xmlns:xacml-context="urn:oasis:names:tc:xacml:1.0:context" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<xs:import namespace="urn:oasis:names:tc:xacml:1.0:policy" schemaLocation="cs-xacml-schema-policy-01.xsd"/>
+	<!-- 	-->
+	<xs:element name="Request" type="xacml-context:RequestType"/>
+	<xs:complexType name="RequestType">
+		<xs:sequence>
+			<xs:element ref="xacml-context:Subject" maxOccurs="unbounded"/>
+			<xs:element ref="xacml-context:Resource"/>
+			<xs:element ref="xacml-context:Action"/>
+			<xs:element ref="xacml-context:Environment" minOccurs="0"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Response" type="xacml-context:ResponseType"/>
+	<xs:complexType name="ResponseType">
+		<xs:sequence>
+			<xs:element ref="xacml-context:Result" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Subject" type="xacml-context:SubjectType"/>
+	<xs:complexType name="SubjectType">
+		<xs:sequence>
+			<xs:element ref="xacml-context:Attribute" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:attribute name="SubjectCategory" type="xs:anyURI" use="optional" default="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Resource" type="xacml-context:ResourceType"/>
+	<xs:complexType name="ResourceType">
+		<xs:sequence>
+			<xs:element ref="xacml-context:ResourceContent" minOccurs="0"/>
+			<xs:element ref="xacml-context:Attribute" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="ResourceContent" type="xacml-context:ResourceContentType"/>
+	<xs:complexType name="ResourceContentType" mixed="true">
+		<xs:sequence>
+			<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:anyAttribute namespace="##any" processContents="lax"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Action" type="xacml-context:ActionType"/>
+	<xs:complexType name="ActionType">
+		<xs:sequence>
+			<xs:element ref="xacml-context:Attribute" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Environment" type="xacml-context:EnvironmentType"/>
+	<xs:complexType name="EnvironmentType">
+		<xs:sequence>
+			<xs:element ref="xacml-context:Attribute" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Attribute" type="xacml-context:AttributeType"/>
+	<xs:complexType name="AttributeType">
+		<xs:sequence>
+			<xs:element ref="xacml-context:AttributeValue"/>
+		</xs:sequence>
+		<xs:attribute name="AttributeId" type="xs:anyURI" use="required"/>
+		<xs:attribute name="DataType" type="xs:anyURI" use="required"/>
+		<xs:attribute name="Issuer" type="xs:string" use="optional"/>
+		<xs:attribute name="IssueInstant" type="xs:dateTime" use="optional"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="AttributeValue" type="xacml-context:AttributeValueType"/>
+	<xs:complexType name="AttributeValueType" mixed="true">
+		<xs:sequence>
+			<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:anyAttribute namespace="##any" processContents="lax"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Result" type="xacml-context:ResultType"/>
+	<xs:complexType name="ResultType">
+		<xs:sequence>
+			<xs:element ref="xacml-context:Decision"/>
+			<xs:element ref="xacml-context:Status"/>
+			<xs:element ref="xacml:Obligations" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute name="ResourceId" type="xs:string" use="optional"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Decision" type="xacml-context:DecisionType"/>
+	<xs:simpleType name="DecisionType">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="Permit"/>
+			<xs:enumeration value="Deny"/>
+			<xs:enumeration value="Indeterminate"/>
+			<xs:enumeration value="NotApplicable"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<!-- -->
+	<xs:element name="Status" type="xacml-context:StatusType"/>
+	<xs:complexType name="StatusType">
+		<xs:sequence>
+			<xs:element ref="xacml-context:StatusCode"/>
+			<xs:element ref="xacml-context:StatusMessage" minOccurs="0"/>
+			<xs:element ref="xacml-context:StatusDetail" minOccurs="0"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="StatusCode" type="xacml-context:StatusCodeType"/>
+	<xs:complexType name="StatusCodeType">
+		<xs:sequence>
+			<xs:element ref="xacml-context:StatusCode" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute name="Value" type="xs:anyURI" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="StatusMessage" type="xs:string"/>
+	<!-- -->
+	<xs:element name="StatusDetail" type="xacml-context:StatusDetailType"/>
+	<xs:complexType name="StatusDetailType">
+		<xs:sequence>
+			<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/xml/SchemaAutodetection/cs-xacml-schema-policy-01.xsd b/xml/tests/testData/xml/SchemaAutodetection/cs-xacml-schema-policy-01.xsd
new file mode 100644
index 0000000..3ce43da
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaAutodetection/cs-xacml-schema-policy-01.xsd
@@ -0,0 +1,250 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="urn:oasis:names:tc:xacml:1.0:policy" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xacml="urn:oasis:names:tc:xacml:1.0:policy" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<!-- -->
+	<xs:element name="PolicySet" type="xacml:PolicySetType"/>
+	<xs:complexType name="PolicySetType">
+		<xs:sequence>
+			<xs:element ref="xacml:Description" minOccurs="0"/>
+			<xs:element ref="xacml:PolicySetDefaults" minOccurs="0"/>
+			<xs:element ref="xacml:Target"/>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element ref="xacml:PolicySet"/>
+				<xs:element ref="xacml:Policy"/>
+				<xs:element ref="xacml:PolicySetIdReference"/>
+				<xs:element ref="xacml:PolicyIdReference"/>
+			</xs:choice>
+			<xs:element ref="xacml:Obligations" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute name="PolicySetId" type="xs:anyURI" use="required"/>
+		<xs:attribute name="PolicyCombiningAlgId" type="xs:anyURI" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="PolicySetIdReference" type="xs:anyURI"/>
+	<xs:element name="PolicyIdReference" type="xs:anyURI"/>
+	<!-- -->
+	<xs:element name="PolicySetDefaults" type="xacml:DefaultsType"/>
+	<xs:element name="PolicyDefaults" type="xacml:DefaultsType"/>
+	<xs:complexType name="DefaultsType">
+		<xs:sequence>
+			<xs:choice>
+				<xs:element ref="xacml:XPathVersion"/>
+			</xs:choice>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="XPathVersion" type="xs:anyURI"/>
+	<!-- -->
+	<xs:element name="Policy" type="xacml:PolicyType"/>
+	<xs:complexType name="PolicyType">
+		<xs:sequence>
+			<xs:element ref="xacml:Description" minOccurs="0"/>
+			<xs:element ref="xacml:PolicyDefaults" minOccurs="0"/>
+			<xs:element ref="xacml:Target"/>
+			<xs:element ref="xacml:Rule" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element ref="xacml:Obligations" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute name="PolicyId" type="xs:anyURI" use="required"/>
+		<xs:attribute name="RuleCombiningAlgId" type="xs:anyURI" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Description" type="xs:string"/>
+	<!-- -->
+	<xs:element name="Rule" type="xacml:RuleType"/>
+	<xs:complexType name="RuleType">
+		<xs:sequence>
+			<xs:element ref="xacml:Description" minOccurs="0"/>
+			<xs:element ref="xacml:Target" minOccurs="0"/>
+			<xs:element ref="xacml:Condition" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute name="RuleId" type="xs:anyURI" use="required"/>
+		<xs:attribute name="Effect" type="xacml:EffectType" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:simpleType name="EffectType">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="Permit"/>
+			<xs:enumeration value="Deny"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<!-- -->
+	<xs:element name="Target" type="xacml:TargetType"/>
+	<xs:complexType name="TargetType">
+		<xs:sequence>
+			<xs:element ref="xacml:Subjects"/>
+			<xs:element ref="xacml:Resources"/>
+			<xs:element ref="xacml:Actions"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Subjects" type="xacml:SubjectsType"/>
+	<xs:complexType name="SubjectsType">
+		<xs:choice>
+			<xs:element ref="xacml:Subject" maxOccurs="unbounded"/>
+			<xs:element ref="xacml:AnySubject"/>
+		</xs:choice>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Subject" type="xacml:SubjectType"/>
+	<xs:complexType name="SubjectType">
+		<xs:sequence>
+			<xs:element ref="xacml:SubjectMatch" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="AnySubject"/>
+	<!-- -->
+	<xs:element name="Resources" type="xacml:ResourcesType"/>
+	<xs:complexType name="ResourcesType">
+		<xs:choice>
+			<xs:element ref="xacml:Resource" maxOccurs="unbounded"/>
+			<xs:element ref="xacml:AnyResource"/>
+		</xs:choice>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="AnyResource"/>
+	<!-- -->
+	<xs:element name="Resource" type="xacml:ResourceType"/>
+	<xs:complexType name="ResourceType">
+		<xs:sequence>
+			<xs:element ref="xacml:ResourceMatch" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Actions" type="xacml:ActionsType"/>
+	<xs:complexType name="ActionsType">
+		<xs:choice>
+			<xs:element ref="xacml:Action" maxOccurs="unbounded"/>
+			<xs:element ref="xacml:AnyAction"/>
+		</xs:choice>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="AnyAction"/>
+	<!-- -->
+	<xs:element name="Action" type="xacml:ActionType"/>
+	<xs:complexType name="ActionType">
+		<xs:sequence>
+			<xs:element ref="xacml:ActionMatch" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="SubjectMatch" type="xacml:SubjectMatchType"/>
+	<xs:complexType name="SubjectMatchType">
+		<xs:sequence>
+			<xs:element ref="xacml:AttributeValue"/>
+			<xs:choice>
+				<xs:element ref="xacml:SubjectAttributeDesignator"/>
+				<xs:element ref="xacml:AttributeSelector"/>
+			</xs:choice>
+		</xs:sequence>
+		<xs:attribute name="MatchId" type="xs:anyURI" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="ResourceMatch" type="xacml:ResourceMatchType"/>
+	<xs:complexType name="ResourceMatchType">
+		<xs:sequence>
+			<xs:element ref="xacml:AttributeValue"/>
+			<xs:choice>
+				<xs:element ref="xacml:ResourceAttributeDesignator"/>
+				<xs:element ref="xacml:AttributeSelector"/>
+			</xs:choice>
+		</xs:sequence>
+		<xs:attribute name="MatchId" type="xs:anyURI" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="ActionMatch" type="xacml:ActionMatchType"/>
+	<xs:complexType name="ActionMatchType">
+		<xs:sequence>
+			<xs:element ref="xacml:AttributeValue"/>
+			<xs:choice>
+				<xs:element ref="xacml:ActionAttributeDesignator"/>
+				<xs:element ref="xacml:AttributeSelector"/>
+			</xs:choice>
+		</xs:sequence>
+		<xs:attribute name="MatchId" type="xs:anyURI" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="AttributeSelector" type="xacml:AttributeSelectorType"/>
+	<xs:complexType name="AttributeSelectorType">
+		<xs:attribute name="RequestContextPath" type="xs:string" use="required"/>
+		<xs:attribute name="DataType" type="xs:anyURI" use="required"/>
+		<xs:attribute name="MustBePresent" type="xs:boolean" use="optional" default="false"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="ResourceAttributeDesignator" type="xacml:AttributeDesignatorType"/>
+	<xs:element name="ActionAttributeDesignator" type="xacml:AttributeDesignatorType"/>
+	<xs:element name="EnvironmentAttributeDesignator" type="xacml:AttributeDesignatorType"/>
+	<!-- -->
+	<xs:complexType name="AttributeDesignatorType">
+		<xs:attribute name="AttributeId" type="xs:anyURI" use="required"/>
+		<xs:attribute name="DataType" type="xs:anyURI" use="required"/>
+		<xs:attribute name="Issuer" type="xs:string" use="optional"/>
+		<xs:attribute name="MustBePresent" type="xs:boolean" use="optional" default="false"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="SubjectAttributeDesignator" type="xacml:SubjectAttributeDesignatorType"/>
+	<xs:complexType name="SubjectAttributeDesignatorType">
+		<xs:complexContent>
+			<xs:extension base="xacml:AttributeDesignatorType">
+				<xs:attribute name="SubjectCategory" type="xs:anyURI" use="optional" default="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="AttributeValue" type="xacml:AttributeValueType"/>
+	<xs:complexType name="AttributeValueType" mixed="true">
+		<xs:sequence>
+			<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:attribute name="DataType" type="xs:anyURI" use="required"/>
+		<xs:anyAttribute namespace="##any" processContents="lax"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Function" type="xacml:FunctionType"/>
+	<xs:complexType name="FunctionType">
+		<xs:attribute name="FunctionId" type="xs:anyURI" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Apply" type="xacml:ApplyType"/>
+	<xs:element name="Condition" type="xacml:ApplyType"/>
+	<!-- -->
+	<xs:complexType name="ApplyType">
+		<xs:choice minOccurs="0" maxOccurs="unbounded">
+			<xs:element ref="xacml:Apply"/>
+			<xs:element ref="xacml:Function"/>
+			<xs:element ref="xacml:AttributeValue"/>
+			<xs:element ref="xacml:SubjectAttributeDesignator"/>
+			<xs:element ref="xacml:ResourceAttributeDesignator"/>
+			<xs:element ref="xacml:ActionAttributeDesignator"/>
+			<xs:element ref="xacml:EnvironmentAttributeDesignator"/>
+			<xs:element ref="xacml:AttributeSelector"/>
+		</xs:choice>
+		<xs:attribute name="FunctionId" type="xs:anyURI" use="required"/>
+		<!-- Legal types for the first and subsequent operands are defined in the accompanying table -->
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Obligations" type="xacml:ObligationsType"/>
+	<xs:complexType name="ObligationsType">
+		<xs:sequence>
+			<xs:element ref="xacml:Obligation" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="Obligation" type="xacml:ObligationType"/>
+	<xs:complexType name="ObligationType">
+		<xs:sequence>
+			<xs:element ref="xacml:AttributeAssignment" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:attribute name="ObligationId" type="xs:anyURI" use="required"/>
+		<xs:attribute name="FulfillOn" type="xacml:EffectType" use="required"/>
+	</xs:complexType>
+	<!-- -->
+	<xs:element name="AttributeAssignment" type="xacml:AttributeAssignmentType"/>
+	<xs:complexType name="AttributeAssignmentType" mixed="true">
+		<xs:complexContent mixed="true">
+			<xs:extension base="xacml:AttributeValueType">
+				<xs:attribute name="AttributeId" type="xs:anyURI" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<!-- -->
+</xs:schema>
diff --git a/xml/tests/testData/xml/SchemaAutodetection/policy.xml b/xml/tests/testData/xml/SchemaAutodetection/policy.xml
new file mode 100644
index 0000000..405cc660
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaAutodetection/policy.xml
@@ -0,0 +1,19 @@
+<x:PolicySet
+        xmlns:x="urn:oasis:names:tc:xacml:1.0:policy"
+        PolicyCombiningAlgId="" PolicySetId="">
+
+    <x:Description>xxx</x:Description>
+    <x:Target>
+        <x:Subjects>
+            <x:Subject>
+                <x:SubjectMatch MatchId="">
+                    <x:AttributeValue DataType=""/>
+                    <x:AttributeSelector RequestContextPath="" DataType=""/>
+    </x:SubjectMatch>
+            </x:Subject>
+        </x:Subjects><x:Resources><x:Resource><x:ResourceMatch MatchId=""><x:AttributeValue
+            DataType=""/><x:AttributeSelector RequestContextPath="" DataType=""/>
+    </x:ResourceMatch></x:Resource></x:Resources>
+        <x:Actions><x:AnyAction/></x:Actions>
+        </x:Target>
+</x:PolicySet>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SchemaImportHighlightingAndResolve.xsd b/xml/tests/testData/xml/SchemaImportHighlightingAndResolve.xsd
new file mode 100644
index 0000000..966bd24
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaImportHighlightingAndResolve.xsd
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.mycompany.com/schema/myns"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:beans="http://www.springframework.org/schema/beans"
+            targetNamespace="http://www.mycompany.com/schema/myns"
+            elementFormDefault="qualified" attributeFormDefault="unqualified">
+
+  <xsd:import namespace="http://www.springframework.org/schema/beans"/>
+  <xsd:import namespace="<error>http://www.springframework.org/schema/beans2</error>"/>
+
+  <xsd:element name="dateformat">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:extension base="beans:identifiedType">
+          <xsd:attribute name="lenient" type="xsd:boolean"/>
+          <xsd:attribute name="pattern" type="xsd:string" use="required"/>
+        </xsd:extension>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SchemaReferencesValidation.xsd b/xml/tests/testData/xml/SchemaReferencesValidation.xsd
new file mode 100644
index 0000000..dabe7c3
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaReferencesValidation.xsd
@@ -0,0 +1,31 @@
+<schema targetNamespace="http://www.emc.com/schemas/celerra/xml_api"
+    elementFormDefault="qualified" 
+    attributeFormDefault="unqualified"
+    xmlns="http://www.w3.org/2001/XMLSchema"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:api="http://www.emc.com/schemas/celerra/xml_api"
+  >
+    <element name="Indication">
+        <complexType>
+            <group ref="api:<error>MyGroup</error>"/>
+            <group ref="api:aaa"/>
+          <attribute ref="xml:lang"/>
+          <attribute ref="xml:base"/>
+          <attribute ref="xml:space"/>
+          <attribute ref="xml:<error>lang1</error>"/>
+        </complexType>
+    </element>
+    <group name="aaa"></group>
+  
+    <simpleType name="string" id="string">
+      <restriction base="anySimpleType">
+        <whiteSpace value="preserve" id=<error>"string.preserve"</error>/>
+      </restriction>
+    </simpleType>
+    <simpleType name="string" id="string2">
+      <restriction base="xs:anySimpleType">
+        <whiteSpace value="preserve" id=<error>"string.preserve"</error>/>
+      </restriction>
+    </simpleType>
+</schema>
+
diff --git a/xml/tests/testData/xml/SchemaUpdate.xml b/xml/tests/testData/xml/SchemaUpdate.xml
new file mode 100644
index 0000000..a782c71
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaUpdate.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<xs:book xmlns:xs="http://example.org/ns/books/" isbn="1234">
+
+  <title2>Alice in Wonderland
+  </title2>
+  <author>C S Lewis</author>
+
+  <character>
+    <name>Alice</name>
+  </character>
+
+</xs:book>
diff --git a/xml/tests/testData/xml/SchemaUpdate.xsd b/xml/tests/testData/xml/SchemaUpdate.xsd
new file mode 100644
index 0000000..3a6285eb7
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaUpdate.xsd
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+           targetNamespace="http://example.org/ns/books/"
+           elementFormDefault="unqualified">
+  <xsd:element name="book">
+    <xsd:complexType>
+
+
+      <xsd:sequence>
+        <xsd:element name="title2" type="xsd:string"/>
+        <xsd:element name="author" type="xsd:string"/>
+        <xsd:element name="character" minOccurs="0" maxOccurs="unbounded">
+          <xsd:complexType>
+            <xsd:sequence>
+              <xsd:element name="name" type="xsd:string"/>
+              <xsd:element name="friend-of" type="xsd:string" minOccurs="0"
+                          maxOccurs="unbounded"/>
+              <xsd:element name="since" type="xsd:date"/>
+              <xsd:element name="qualification" type="xsd:string"/>
+            </xsd:sequence>
+          </xsd:complexType>
+        </xsd:element>
+      </xsd:sequence>
+      <xsd:attribute name="isbn" type="xsd:string"/>
+    </xsd:complexType>
+  </xsd:element>
+</xsd:schema>
+
diff --git a/xml/tests/testData/xml/SchemaValidation.xml b/xml/tests/testData/xml/SchemaValidation.xml
new file mode 100644
index 0000000..e74e049
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaValidation.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.4"
+         xmlns="http://java.sun.com/xml/ns/j2ee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+
+         <<error>aaa</error>></<error>aaa</error>>
+</web-app>
diff --git a/xml/tests/testData/xml/SchemaValidation2.xml b/xml/tests/testData/xml/SchemaValidation2.xml
new file mode 100644
index 0000000..44cd564
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaValidation2.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	  xsi:noNamespaceSchemaLocation="SchemaValidation2.xsd">
+        <Test xsi:type="<caret>Y">
+		<Foo>Foo</Foo>
+	</Test>
+	<Test xsi:type="Z">
+		<Bar>Foo</Bar>
+	</Test>
+        <Test xsi:type="<error>Z2</error>">
+		<<error>Bar</error>>Foo</<error>Bar</error>>
+	</Test>
+</Root>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SchemaValidation2.xsd b/xml/tests/testData/xml/SchemaValidation2.xsd
new file mode 100644
index 0000000..6fd649e
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaValidation2.xsd
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema
+		xmlns:xs="http://www.w3.org/2001/XMLSchema"
+		elementFormDefault="qualified"
+		attributeFormDefault="unqualified">
+
+	<xs:complexType name="X" abstract="true"/>
+
+	<xs:complexType name="Y">
+		<xs:complexContent>
+			<xs:extension base="X">
+				<xs:sequence>
+					<xs:element name="Foo" type="xs:string"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+
+	<xs:complexType name="Z">
+		<xs:complexContent>
+			<xs:extension base="X">
+				<xs:sequence>
+					<xs:element name="Bar" type="xs:string"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+
+	<xs:element name="Root">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="Test" type="X" maxOccurs="unbounded"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/SchemaValidation3.xml b/xml/tests/testData/xml/SchemaValidation3.xml
new file mode 100644
index 0000000..6a1b19b
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaValidation3.xml
@@ -0,0 +1,5 @@
+<c:root xmlns:p="parent" xmlns:c="child">
+    <p:parent-element/>
+    
+    <c:child-element/>
+</c:root>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SchemaValidation3.xsd b/xml/tests/testData/xml/SchemaValidation3.xsd
new file mode 100644
index 0000000..6f7fc31
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaValidation3.xsd
@@ -0,0 +1,12 @@
+<xs:schema targetNamespace="parent"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:p="parent"
+    elementFormDefault="qualified">
+
+<xs:complexType name="Parent">
+        <xs:sequence>
+            <xs:element name="parent-element" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SchemaValidation3_2.xsd b/xml/tests/testData/xml/SchemaValidation3_2.xsd
new file mode 100644
index 0000000..7f682c8
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaValidation3_2.xsd
@@ -0,0 +1,20 @@
+<xs:schema targetNamespace="child"
+        xmlns:p="parent"
+        xmlns:xs="http://www.w3.org/2001/XMLSchema"
+        elementFormDefault="qualified">
+
+<xs:import namespace="parent" schemaLocation="SchemaValidation3.xsd"/>
+
+<xs:element name="root">
+        <xs:complexType>
+            <xs:complexContent>
+                <xs:extension base="p:Parent">
+                    <xs:sequence>
+                        <xs:element name="child-element" type="xs:string"/>
+                    </xs:sequence>
+                </xs:extension>
+            </xs:complexContent>
+        </xs:complexType>
+    </xs:element>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SchemaValidation4.xml b/xml/tests/testData/xml/SchemaValidation4.xml
new file mode 100644
index 0000000..1473b5f
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaValidation4.xml
@@ -0,0 +1,5 @@
+<<error>project</error> xmlns="SchemaValidation4.xsd"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+<pomVersion>3</pomVersion>
+</<error>project</error>>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SchemaValidation4.xsd b/xml/tests/testData/xml/SchemaValidation4.xsd
new file mode 100644
index 0000000..ba767f6
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaValidation4.xsd
@@ -0,0 +1,433 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'
+  elementFormDefault="qualified">
+  <xs:element name="project">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="extend" minOccurs="0"/>
+        <xs:element ref="pomVersion"/>
+        <xs:element ref="id"/>
+        <xs:element ref="name"/>
+        <xs:element ref="groupId" minOccurs="0"/>
+        <xs:element ref="currentVersion"/>
+        <xs:element ref="organization"/>
+        <xs:element ref="inceptionYear"/>
+        <xs:element ref="package" minOccurs="0"/>
+        <xs:element ref="logo" minOccurs="0"/>
+        <xs:element ref="gumpRepositoryId" minOccurs="0"/>
+        <xs:element ref="description" minOccurs="0"/>
+        <xs:element ref="shortDescription"/>
+        <xs:element ref="url" minOccurs="0" />
+        <xs:element ref="issueTrackingUrl" minOccurs="0"/>
+        <xs:element ref="siteAddress" minOccurs="0"/>
+        <xs:element ref="siteDirectory" minOccurs="0"/>
+        <xs:element ref="distributionSite" minOccurs="0"/>
+        <xs:element ref="distributionDirectory" minOccurs="0"/>
+        <xs:element ref="repository" minOccurs="0"/>
+        <xs:element ref="versions" minOccurs="0"/>
+        <xs:element ref="branches" minOccurs="0"/>
+        <xs:element ref="mailingLists" minOccurs="0"/>
+        <xs:element ref="developers"/>
+        <xs:element ref="contributors" minOccurs="0"/>
+        <xs:element ref="licenses" minOccurs="0"/>
+        <xs:element ref="dependencies" minOccurs="0"/>
+        <xs:element ref="build"/>
+        <xs:element ref="reports" minOccurs="0"/>
+        <xs:element ref="properties" minOccurs="0"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="extend" type='xs:string'/>
+  <xs:element name="connection" type='xs:string'/>
+  <xs:element name="developerConnection" type='xs:string'/>
+  <xs:element name="currentVersion" type='xs:string'/>
+  <xs:element name="description" type='xs:string'/>
+  <xs:element name="distributionSite" type='xs:string'/>
+  <xs:element name="distributionDirectory" type='xs:string'/>
+  <xs:element name="name" type='xs:string'/>
+  <xs:element name="groupId" type='xs:string'/>
+  <xs:element name="artifactId" type='xs:string'/>
+  <xs:element name="gumpRepositoryId" type='xs:string'/>
+  <xs:element name="id" type='xs:string'/>
+  <xs:element name="inceptionYear" type='xs:gYear'/>
+  <!-- not anyURI as it can contain ${pom....} -->
+  <xs:element name="issueTrackingUrl" type='xs:string'/>
+  <xs:element name="logo" type='xs:string'/>
+  <xs:element name="package" type='xs:string'/>
+  <xs:element name="pomVersion" type='xs:string'/>
+  <xs:element name="shortDescription" type='xs:string'/>
+  <xs:element name="siteAddress" type='xs:string'/>
+  <xs:element name="siteDirectory" type='xs:string'/>
+  <!-- not anyURI as it can contain ${pom....} -->
+  <xs:element name="url" type='xs:string'/>
+
+  <!-- /repository element -->
+  <xs:element name="repository">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="connection"/>
+        <xs:element ref="developerConnection" minOccurs="0"/>
+        <xs:element ref="url" minOccurs="0"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <!-- /organization element -->
+  <xs:element name="organization">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="name"/>
+        <xs:element ref="url" minOccurs="0" />
+        <xs:element ref="logo" minOccurs="0" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <!-- /versions element -->
+  <xs:element name="versions">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="version" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <!-- /versions/version element -->
+  <xs:element name="version">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="id"/>
+        <xs:element ref="name"/>
+        <xs:element ref="tag"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <!-- /versions/version/tag and branches/branch/tag-->
+  <xs:element name="tag" type='xs:string'/>
+  
+  <!-- /branches element -->
+  <xs:element name="branches">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="branch" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <!-- /branches/branch element -->
+  <xs:element name="branch">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="tag"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <!-- /mailingLists element -->
+  <xs:element name="mailingLists">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="mailingList" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <!-- /mailingLists/mailingList element -->
+  <xs:element name="mailingList">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="name"/>
+        <xs:element ref="subscribe"/>
+        <xs:element ref="unsubscribe"/>
+        <xs:element ref="archive" minOccurs="0"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <!-- /mailingLists/mailingList/subscribe element -->  
+  <xs:element name="subscribe" type='xs:string'/>
+  <!-- /mailingLists/mailingList/unsubscribe element -->  
+  <xs:element name="unsubscribe" type='xs:string'/>
+  <!-- /mailingLists/mailingList/archive element -->  
+  <xs:element name="archive" type='xs:string'/>
+  
+  <!-- /developers element -->
+  <xs:element name="developers">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="developer" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <!-- /developers/developer element -->
+  <xs:element name="developer">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="name"/>
+        <xs:element ref="id"/>
+        <xs:group ref="contactDetails" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <!-- /developers/developer/contactDetails group and
+       /contributors/contributor/contactDetails group -->
+  <xs:group name="contactDetails">
+      <xs:sequence>
+        <xs:element ref="email"/>
+        <xs:element name="organization" type='xs:string' minOccurs="0"/>
+        <xs:element ref="roles" minOccurs="0" />
+        <xs:element ref="url" minOccurs="0" />
+        <xs:element ref="timezone" minOccurs="0" />
+      </xs:sequence>
+  </xs:group>
+
+  <!-- contactDetails/email element -->
+  <xs:element name="email" type='xs:string'/>
+
+  <!-- contactDetails/roles element -->
+  <xs:element name="roles">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="role" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <!-- contactDetails/roles/role element -->
+  <xs:element name="role" type='xs:string'/>
+
+  <!-- type for contactDetails/roles/timezone element -->  
+  <xs:simpleType name="timezoneType">
+    <xs:restriction base="xs:decimal">
+      <xs:minInclusive value="-14"/>
+      <xs:maxInclusive value="+14"/>
+    </xs:restriction>
+  </xs:simpleType> 
+  
+  <!-- contactDetails/roles/timezone element
+       Stores a decimal that is the offset to GMT.
+    -->  
+  <xs:element name="timezone" type='timezoneType'/>
+
+  <!-- /contributors element -->  
+  <xs:element name="contributors">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="contributor" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <!-- /contributors/contributor element -->
+  <xs:element name="contributor">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="name"/>
+        <xs:group ref="contactDetails" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <!-- /licenses element -->
+  <xs:element name="licenses">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="license" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <!-- /licenses/license element -->
+  <xs:element name="license">
+    <xs:complexType>
+      <xs:sequence>
+        <!-- name of the license, e.g. ASL 1.1 -->
+        <xs:element ref="name" minOccurs="0"/>
+        <!-- fetchable version of the license -->
+        <xs:element ref="url" minOccurs="0" />
+        <!-- 'manual' or 'repo' -->
+        <xs:element ref="distribution" minOccurs="0" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <!-- /licenses/license/distribution element -->
+  <xs:element name="distribution">
+    <xs:simpleType>
+      <xs:restriction base="xs:string">
+        <xs:pattern value="manual|repo"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+  
+  <!-- /dependencies element -->
+  <xs:element name="dependencies">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="dependency" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <!-- /dependencies/dependency element -->
+  <xs:element name="dependency">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="id" minOccurs="0" />
+        <xs:element ref="groupId" minOccurs="0" />
+        <xs:element ref="artifactId" minOccurs="0" />
+        <xs:element name="version" type="xs:string" />
+        <xs:element ref="jar" minOccurs="0"/>
+        <xs:element ref="type" minOccurs="0"/>
+        <xs:element ref="url" minOccurs="0"/>
+        <xs:element ref="properties" minOccurs="0" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <!-- /dependencies/dependency/type element -->
+  <xs:element name="type" type='xs:string'/>
+  <!-- /dependencies/dependency/jar element -->
+  <xs:element name="jar" type='xs:string'/>
+  
+  <!-- /build element -->
+  <xs:element name="build">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="nagEmailAddress" minOccurs="0"/>
+        <xs:element ref="sourceDirectory" minOccurs="0"/>
+        <xs:element ref="sourceModifications" minOccurs="0"/>
+        <xs:element ref="unitTestSourceDirectory" minOccurs="0"/>
+        <xs:element ref="integrationUnitTestSourceDirectory" minOccurs="0"/>
+        <xs:element ref="aspectSourceDirectory" minOccurs="0"/>
+        <xs:element ref="unitTest" minOccurs="0"/>
+        <!-- no longer appears in build.java 
+        <xs:element ref="integrationUnitTest" minOccurs="0"/>
+        -->
+        <xs:element ref="resources" minOccurs="0"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <xs:element name="nagEmailAddress" type='xs:string'/>
+
+  <xs:element name="sourceDirectory" type='xs:string'/>
+  
+  <xs:element name="sourceModifications">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="sourceModification" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  
+  <xs:element name="sourceModification">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="className" type='xs:string'/>
+        <xs:element ref="includes" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element ref="excludes" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  
+  <xs:element name="unitTestSourceDirectory" type='xs:string'/>
+  <xs:element name="integrationUnitTestSourceDirectory" type='xs:string'/>
+  <xs:element name="aspectSourceDirectory" type='xs:string'/>
+  
+  <xs:element name="unitTest">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="includes" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element ref="excludes" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element ref="resources" minOccurs="0" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="includes">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="include" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="excludes">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="exclude" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="include" type='xs:string'/>
+  <xs:element name="exclude" type='xs:string'/>
+  
+  <!-- no longer appears in build.java
+  <xs:element name="integrationUnitTest">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="includes" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element ref="excludes" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  -->
+  <xs:element name="resources">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="resource" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="directory" type='xs:string'/>
+  <xs:element name="targetPath" type='xs:string'/>
+  <xs:element name="filtering" type="xs:boolean" />
+
+  <xs:element name="resource">
+    <xs:complexType>
+      <xs:sequence>
+        <!-- FIXME: I think that this defaults to basedir, need a check -->
+        <xs:element ref="directory" minOccurs="0"/>
+        <xs:element ref="targetPath" minOccurs="0"/>
+        <xs:element ref="includes" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element ref="excludes" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element ref="filtering" minOccurs="0" maxOccurs="1"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element> 
+
+  <xs:element name="reports">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="report" minOccurs="0" maxOccurs="unbounded" 
+          type="xs:string"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <xs:element name="properties">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="classloader">
+    <xs:simpleType>
+      <xs:restriction base="xs:string">
+        <xs:pattern value="root|root.maven"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/SchemaValidation5.xsd b/xml/tests/testData/xml/SchemaValidation5.xsd
new file mode 100644
index 0000000..2c4f8c7
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaValidation5.xsd
@@ -0,0 +1,41 @@
+<xs:schema targetNamespace="http://www.example.com/test"
+           xmlns="http://www.example.com/test"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified"
+           attributeFormDefault="unqualified">
+
+   <xs:complexType name="TestType4">
+      <xs:sequence>
+         <xs:element name="testelement" type="TestType11"/>
+      </xs:sequence>
+   </xs:complexType>
+
+   <xs:complexType name="TestType11">
+      <xs:sequence>
+         <xs:element name="testelement" type="TestType2"/>
+      </xs:sequence>
+   </xs:complexType>
+
+    <xs:complexType name="TestType12">
+      <xs:sequence>
+         <xs:element name="testelement" type="TestType4"/>
+      </xs:sequence>
+   </xs:complexType>
+
+   <xs:simpleType name="TestType3">
+      <xs:restriction base="TestType2">
+      </xs:restriction>
+   </xs:simpleType>
+
+   <xs:simpleType name="TestType2">
+      <xs:restriction></xs:restriction>
+   </xs:simpleType>
+
+  <xs:element name="MyElement">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="MyElement"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SchemaValidation6.xml b/xml/tests/testData/xml/SchemaValidation6.xml
new file mode 100644
index 0000000..496e5c9
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaValidation6.xml
@@ -0,0 +1,3 @@
+<userrole xmlns="aaa">
+  <label key="aaa"></label>
+</userrole>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SchemaValidation6.xsd b/xml/tests/testData/xml/SchemaValidation6.xsd
new file mode 100644
index 0000000..84f24cf
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaValidation6.xsd
@@ -0,0 +1,21 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="aaa">
+<xs:element name="userrole">
+<xs:complexType mixed="true">
+<xs:sequence minOccurs="0">
+<xs:any namespace="http://www.w3.org/1999/xhtml ##targetNamespace" minOccurs="0" maxOccurs="unbounded"></xs:any>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+
+<xs:element name="label">
+<xs:complexType>
+<xs:attribute name="key" use="required">
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:whiteSpace value="collapse"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:attribute>
+</xs:complexType>
+</xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SchemaWithXmlId.xml b/xml/tests/testData/xml/SchemaWithXmlId.xml
new file mode 100644
index 0000000..358173a
--- /dev/null
+++ b/xml/tests/testData/xml/SchemaWithXmlId.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema version="1.0"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:xml="http://www.w3.org/XML/1998/namespace"
+            elementFormDefault="qualified"
+  >
+  <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+  <xsd:element name="build" type="buildType" />
+
+  <xsd:complexType name="buildType" mixed="true">
+    <xsd:sequence>
+      <xsd:element name="statusInfo" type="statusInfoType" minOccurs="0" />
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <xsd:complexType name="statusInfoType">
+    <xsd:attribute ref="xml:id" use="optional"/>
+  </xsd:complexType>
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/Semantic.xsd b/xml/tests/testData/xml/Semantic.xsd
new file mode 100644
index 0000000..57b2d4d
--- /dev/null
+++ b/xml/tests/testData/xml/Semantic.xsd
@@ -0,0 +1,1562 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
+	xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" 
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+	targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL">
+	
+	<xsd:element name="activity" type="tActivity"/>
+	<xsd:complexType name="tActivity" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowNode">
+				<xsd:sequence>
+					<xsd:element ref="ioSpecification" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="property" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="dataInputAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="dataOutputAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="resourceRole" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="loopCharacteristics" minOccurs="0"/>
+				</xsd:sequence>
+				<xsd:attribute name="isForCompensation" type="xsd:boolean" default="false"/>
+				<xsd:attribute name="startQuantity" type="xsd:integer" default="1"/>
+				<xsd:attribute name="completionQuantity" type="xsd:integer" default="1"/>
+				<xsd:attribute name="default" type="xsd:IDREF" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="adHocSubProcess" type="tAdHocSubProcess" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tAdHocSubProcess">
+		<xsd:complexContent>
+			<xsd:extension base="tSubProcess">
+				<xsd:sequence>
+					<xsd:element name="completionCondition" type="tExpression" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="cancelRemainingInstances" type="xsd:boolean" default="true"/>
+				<xsd:attribute name="ordering" type="tAdHocOrdering"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:simpleType name="tAdHocOrdering">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="Parallel"/>
+			<xsd:enumeration value="Sequential"/>
+		</xsd:restriction>
+	</xsd:simpleType>	
+
+	<xsd:element name="artifact" type="tArtifact"/>
+	<xsd:complexType name="tArtifact" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="assignment" type="tAssignment" />
+	<xsd:complexType name="tAssignment">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="from" type="tExpression" minOccurs="1" maxOccurs="1"/>
+					<xsd:element name="to" type="tExpression" minOccurs="1" maxOccurs="1"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+	
+	<xsd:element name="association" type="tAssociation" substitutionGroup="artifact"/>
+	<xsd:complexType name="tAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tArtifact">
+				<xsd:attribute name="sourceRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="targetRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="associationDirection" type="tAssociationDirection" default="None"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:simpleType name="tAssociationDirection">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="None"/>
+			<xsd:enumeration value="One"/>
+			<xsd:enumeration value="Both"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+	<xsd:element name="auditing" type="tAuditing"/>
+	<xsd:complexType name="tAuditing">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>	
+
+	<xsd:element name="baseElement" type="tBaseElement"/>
+	<xsd:complexType name="tBaseElement" abstract="true">
+		<xsd:sequence>
+			<xsd:element ref="documentation" minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:element ref="extensionElements" minOccurs="0" maxOccurs="1" /> 
+		</xsd:sequence>
+		<xsd:attribute name="id" type="xsd:ID" use="optional"/>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:complexType>
+	
+	<xsd:element name="baseElementWithMixedContent" type="tBaseElementWithMixedContent"/>
+	<xsd:complexType name="tBaseElementWithMixedContent" abstract="true" mixed="true">
+		<xsd:sequence>
+			<xsd:element ref="documentation" minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:element ref="extensionElements" minOccurs="0" maxOccurs="1" /> 
+		</xsd:sequence>
+		<xsd:attribute name="id" type="xsd:ID" use="optional"/>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:complexType>
+
+	<xsd:element name="boundaryEvent" type="tBoundaryEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tBoundaryEvent">
+		<xsd:complexContent>
+			<xsd:extension base="tCatchEvent">
+				<xsd:attribute name="cancelActivity" type="xsd:boolean" default="true"/>
+				<xsd:attribute name="attachedToRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>			
+
+	<xsd:element name="businessRuleTask" type="tBusinessRuleTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tBusinessRuleTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask">
+				<xsd:attribute name="implementation" type="tImplementation" default="##unspecified"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="callableElement" type="tCallableElement"/>
+	<xsd:complexType name="tCallableElement">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element name="supportedInterfaceRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="ioSpecification" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="ioBinding" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="callActivity" type="tCallActivity" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tCallActivity">
+		<xsd:complexContent>
+			<xsd:extension base="tActivity">
+				<xsd:attribute name="calledElement" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="callChoreography" type="tCallChoreography" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tCallChoreography">
+		<xsd:complexContent>
+			<xsd:extension base="tChoreographyActivity">
+				<xsd:sequence>
+					<xsd:element ref="participantAssociation" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="calledChoreographyRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="callConversation" type="tCallConversation" substitutionGroup="conversationNode"/>
+	<xsd:complexType name="tCallConversation">
+		<xsd:complexContent>
+			<xsd:extension base="tConversationNode">
+				<xsd:sequence>
+					<xsd:element ref="participantAssociation" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="calledCollaborationRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="cancelEventDefinition" type="tCancelEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tCancelEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="catchEvent" type="tCatchEvent"/>
+	<xsd:complexType name="tCatchEvent" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tEvent">
+				<xsd:sequence>
+					<xsd:element ref="dataOutput" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="dataOutputAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="outputSet" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="eventDefinition" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="eventDefinitionRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="parallelMultiple" type="xsd:boolean" default="false"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="category" type="tCategory" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tCategory">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element ref="categoryValue" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="categoryValue" type="tCategoryValue"/>
+	<xsd:complexType name="tCategoryValue">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="value" type="xsd:string" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="choreography" type="tChoreography" substitutionGroup="collaboration"/>
+	<xsd:complexType name="tChoreography">
+		<xsd:complexContent>
+			<xsd:extension base="tCollaboration">
+				<xsd:sequence>
+					<xsd:element ref="flowElement" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="choreographyActivity" type="tChoreographyActivity"/>
+	<xsd:complexType name="tChoreographyActivity" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowNode">
+				<xsd:sequence>
+					<xsd:element name="participantRef" type="xsd:QName" minOccurs="2" maxOccurs="unbounded"/>
+					<xsd:element ref="correlationKey" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="initiatingParticipantRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="loopType" type="tChoreographyLoopType" default="None"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:simpleType name="tChoreographyLoopType">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="None"/>
+			<xsd:enumeration value="Standard"/>
+			<xsd:enumeration value="MultiInstanceSequential"/>
+			<xsd:enumeration value="MultiInstanceParallel"/>
+		</xsd:restriction>
+	</xsd:simpleType>	
+	
+	<xsd:element name="choreographyTask" type="tChoreographyTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tChoreographyTask">
+		<xsd:complexContent>
+			<xsd:extension base="tChoreographyActivity">
+				<xsd:sequence>
+					<xsd:element name="messageFlowRef" type="xsd:QName" minOccurs="1" maxOccurs="2"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="collaboration" type="tCollaboration" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tCollaboration">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element ref="participant" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="messageFlow" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="conversationNode" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="conversationAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="participantAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="messageFlowAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="correlationKey" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="choreographyRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="conversationLink" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="isClosed" type="xsd:boolean" default="false"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="compensateEventDefinition" type="tCompensateEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tCompensateEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:attribute name="waitForCompletion" type="xsd:boolean"/>
+				<xsd:attribute name="activityRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="complexBehaviorDefinition" type="tComplexBehaviorDefinition"/>
+	<xsd:complexType name="tComplexBehaviorDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="condition" type="tFormalExpression" minOccurs="1" maxOccurs="1"/>
+					<xsd:element name="event" type="tImplicitThrowEvent" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="complexGateway" type="tComplexGateway" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tComplexGateway">
+		<xsd:complexContent>
+			<xsd:extension base="tGateway">
+				<xsd:sequence>
+					<xsd:element name="activationCondition" type="tExpression" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="default" type="xsd:IDREF"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+	
+	<xsd:element name="conditionalEventDefinition" type="tConditionalEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tConditionalEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:sequence>
+					<xsd:element name="condition" type="tExpression"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="conversation" type="tConversation" substitutionGroup="conversationNode"/>
+	<xsd:complexType name="tConversation">
+		<xsd:complexContent>
+			<xsd:extension base="tConversationNode"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="conversationAssociation" type="tConversationAssociation"/>
+	<xsd:complexType name="tConversationAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="innerConversationNodeRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="outerConversationNodeRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="conversationLink" type="tConversationLink"/> 
+	<xsd:complexType name="tConversationLink"> 
+		<xsd:complexContent> 
+			<xsd:extension base="tBaseElement"> 
+				<xsd:attribute name="name" type="xsd:string" use="optional"/> 
+				<xsd:attribute name="sourceRef" type="xsd:QName" use="required"/> 
+				<xsd:attribute name="targetRef" type="xsd:QName" use="required"/> 
+			</xsd:extension> 
+		</xsd:complexContent> 
+	</xsd:complexType>
+  
+	<xsd:element name="conversationNode" type="tConversationNode"/>
+	<xsd:complexType name="tConversationNode" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="participantRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="messageFlowRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="correlationKey" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="correlationKey" type="tCorrelationKey"/>
+	<xsd:complexType name="tCorrelationKey">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="correlationPropertyRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="correlationProperty" type="tCorrelationProperty" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tCorrelationProperty">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element ref="correlationPropertyRetrievalExpression" minOccurs="1" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="optional"/>
+				<xsd:attribute name="type" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="correlationPropertyBinding" type="tCorrelationPropertyBinding"/>
+	<xsd:complexType name="tCorrelationPropertyBinding">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="dataPath" type="tFormalExpression" minOccurs="1" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="correlationPropertyRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="correlationPropertyRetrievalExpression" type="tCorrelationPropertyRetrievalExpression"/>
+	<xsd:complexType name="tCorrelationPropertyRetrievalExpression">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="messagePath" type="tFormalExpression" minOccurs="1" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="messageRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="correlationSubscription" type="tCorrelationSubscription"/>
+	<xsd:complexType name="tCorrelationSubscription">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="correlationPropertyBinding" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="correlationKeyRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="dataAssociation" type="tDataAssociation" />
+	<xsd:complexType name="tDataAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="sourceRef" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="targetRef" type="xsd:IDREF" minOccurs="1" maxOccurs="1"/>
+					<xsd:element name="transformation" type="tFormalExpression" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="assignment" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+	
+	<xsd:element name="dataInput" type="tDataInput" />
+	<xsd:complexType name="tDataInput">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="optional"/>
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName" />
+				<xsd:attribute name="isCollection" type="xsd:boolean" default="false"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataInputAssociation" type="tDataInputAssociation" />
+	<xsd:complexType name="tDataInputAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tDataAssociation"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataObject" type="tDataObject" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tDataObject">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName"/>
+				<xsd:attribute name="isCollection" type="xsd:boolean" default="false"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataObjectReference" type="tDataObjectReference" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tDataObjectReference">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName"/>
+				<xsd:attribute name="dataObjectRef" type="xsd:IDREF"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataOutput" type="tDataOutput" />
+	<xsd:complexType name="tDataOutput">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="optional" />
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName"/>
+				<xsd:attribute name="isCollection" type="xsd:boolean" default="false"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataOutputAssociation" type="tDataOutputAssociation" />
+	<xsd:complexType name="tDataOutputAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tDataAssociation"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataState" type="tDataState" />
+	<xsd:complexType name="tDataState">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataStore" type="tDataStore" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tDataStore">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="capacity" type="xsd:integer"/>
+				<xsd:attribute name="isUnlimited" type="xsd:boolean" default="true"/>
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="dataStoreReference" type="tDataStoreReference" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tDataStoreReference">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName"/>
+				<xsd:attribute name="dataStoreRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="documentation" type="tDocumentation"/>
+	<xsd:complexType name="tDocumentation" mixed="true">
+		<xsd:sequence>
+			<xsd:any namespace="##any" processContents="lax" minOccurs="0"/>
+		</xsd:sequence>
+		<xsd:attribute name="id" type="xsd:ID" use="optional"/>
+		<xsd:attribute name="textFormat" type="xsd:string" default="text/plain"/>
+	</xsd:complexType>
+	
+	<xsd:element name="endEvent" type="tEndEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tEndEvent">
+		<xsd:complexContent>
+			<xsd:extension base="tThrowEvent"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="endPoint" type="tEndPoint" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tEndPoint">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>		
+	
+	<xsd:element name="error" type="tError" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tError">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="errorCode" type="xsd:string"/>
+				<xsd:attribute name="structureRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="errorEventDefinition" type="tErrorEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tErrorEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:attribute name="errorRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="escalation" type="tEscalation" substitutionGroup="rootElement"/>	
+	<xsd:complexType name="tEscalation">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="escalationCode" type="xsd:string"/>
+				<xsd:attribute name="structureRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+
+	<xsd:element name="escalationEventDefinition" type="tEscalationEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tEscalationEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:attribute name="escalationRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="event" type="tEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tEvent" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowNode">
+				<xsd:sequence>
+					<xsd:element ref="property" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+	
+	<xsd:element name="eventBasedGateway" type="tEventBasedGateway" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tEventBasedGateway">
+		<xsd:complexContent>
+			<xsd:extension base="tGateway">
+				<xsd:attribute name="instantiate" type="xsd:boolean" default="false"/>
+				<xsd:attribute name="eventGatewayType" type="tEventBasedGatewayType" default="Exclusive"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+	
+	<xsd:simpleType name="tEventBasedGatewayType">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="Exclusive"/>
+			<xsd:enumeration value="Parallel"/>
+		</xsd:restriction>
+	</xsd:simpleType>	
+
+	<xsd:element name="eventDefinition" type="tEventDefinition" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tEventDefinition" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>			
+
+	<xsd:element name="exclusiveGateway" type="tExclusiveGateway" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tExclusiveGateway">
+		<xsd:complexContent>
+			<xsd:extension base="tGateway">
+				<xsd:attribute name="default" type="xsd:IDREF" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+	
+	<xsd:element name="expression" type="tExpression"/>
+	<xsd:complexType name="tExpression">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElementWithMixedContent"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="extension" type="tExtension"/>
+	<xsd:complexType name="tExtension">
+		<xsd:sequence>
+			<xsd:element ref="documentation" minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:sequence>
+		<xsd:attribute name="definition" type="xsd:QName"/>
+		<xsd:attribute name="mustUnderstand" type="xsd:boolean" use="optional" default="false"/>
+	</xsd:complexType>
+	
+	<xsd:element name="extensionElements" type="tExtensionElements" /> 
+	<xsd:complexType name="tExtensionElements">
+		<xsd:sequence>
+			<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" /> 
+		</xsd:sequence>
+	</xsd:complexType>
+
+	<xsd:element name="flowElement" type="tFlowElement"/>
+	<xsd:complexType name="tFlowElement" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="auditing" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="monitoring" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="categoryValueRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="flowNode" type="tFlowNode"/>
+	<xsd:complexType name="tFlowNode" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowElement">
+				<xsd:sequence>
+					<xsd:element name="incoming" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="outgoing" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+
+	<xsd:element name="formalExpression" type="tFormalExpression" substitutionGroup="expression"/>
+	<xsd:complexType name="tFormalExpression">
+		<xsd:complexContent>
+			<xsd:extension base="tExpression">
+				<xsd:attribute name="language" type="xsd:anyURI" use="optional"/>
+				<xsd:attribute name="evaluatesToTypeRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="gateway" type="tGateway" abstract="true"/>
+	<xsd:complexType name="tGateway">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowNode">
+				<xsd:attribute name="gatewayDirection" type="tGatewayDirection" default="Unspecified"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+	
+	<xsd:simpleType name="tGatewayDirection">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="Unspecified"/>
+			<xsd:enumeration value="Converging"/>
+			<xsd:enumeration value="Diverging"/>
+			<xsd:enumeration value="Mixed"/>
+		</xsd:restriction>
+	</xsd:simpleType>	
+	
+	<xsd:element name="globalBusinessRuleTask" type="tGlobalBusinessRuleTask" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tGlobalBusinessRuleTask">
+		<xsd:complexContent>
+			<xsd:extension base="tGlobalTask">
+				<xsd:attribute name="implementation" type="tImplementation" default="##unspecified"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="globalChoreographyTask" type="tGlobalChoreographyTask" substitutionGroup="choreography"/>
+	<xsd:complexType name="tGlobalChoreographyTask">
+		<xsd:complexContent>
+			<xsd:extension base="tChoreography">
+				<xsd:attribute name="initiatingParticipantRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	<xsd:element name="globalConversation" type="tGlobalConversation" substitutionGroup="collaboration"/>
+	<xsd:complexType name="tGlobalConversation">
+		<xsd:complexContent>
+			<xsd:extension base="tCollaboration"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="globalManualTask" type="tGlobalManualTask" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tGlobalManualTask">
+		<xsd:complexContent>
+			<xsd:extension base="tGlobalTask"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="globalScriptTask" type="tGlobalScriptTask"  substitutionGroup="rootElement"/>
+	<xsd:complexType name="tGlobalScriptTask">
+		<xsd:complexContent>
+			<xsd:extension base="tGlobalTask">
+				<xsd:sequence>
+					<xsd:element ref="script" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="scriptLanguage" type="xsd:anyURI"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="globalTask" type="tGlobalTask" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tGlobalTask">
+		<xsd:complexContent>
+			<xsd:extension base="tCallableElement">
+				<xsd:sequence>
+					<xsd:element ref="resourceRole" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="globalUserTask" type="tGlobalUserTask" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tGlobalUserTask">
+		<xsd:complexContent>
+			<xsd:extension base="tGlobalTask">
+				<xsd:sequence>
+					<xsd:element ref="rendering" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="implementation" type="tImplementation" default="##unspecified"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="group" type="tGroup" substitutionGroup="artifact"/>
+	<xsd:complexType name="tGroup">
+		<xsd:complexContent>
+			<xsd:extension base="tArtifact">
+				<xsd:attribute name="categoryValueRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="humanPerformer" type="tHumanPerformer" substitutionGroup="performer"/>
+	<xsd:complexType name="tHumanPerformer">
+		<xsd:complexContent>
+			<xsd:extension base="tPerformer"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:simpleType name="tImplementation">
+		<xsd:union memberTypes="xsd:anyURI">
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:token">
+					<xsd:enumeration value="##unspecified" /> 
+					<xsd:enumeration value="##WebService" />
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:union>
+	</xsd:simpleType>
+
+	<xsd:element name="implicitThrowEvent" type="tImplicitThrowEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tImplicitThrowEvent">
+		<xsd:complexContent>
+			<xsd:extension base="tThrowEvent"/>
+		</xsd:complexContent>
+	</xsd:complexType>				
+	
+	<xsd:element name="inclusiveGateway" type="tInclusiveGateway" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tInclusiveGateway">
+		<xsd:complexContent>
+			<xsd:extension base="tGateway">
+				<xsd:attribute name="default" type="xsd:IDREF" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+	
+	<xsd:element name="inputSet" type="tInputSet" />
+	<xsd:complexType name="tInputSet">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="dataInputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="optionalInputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="whileExecutingInputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="outputSetRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" />
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="interface" type="tInterface" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tInterface">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element ref="operation" minOccurs="1" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="required"/>
+				<xsd:attribute name="implementationRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="intermediateCatchEvent" type="tIntermediateCatchEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tIntermediateCatchEvent">
+		<xsd:complexContent>
+			<xsd:extension base="tCatchEvent"/>
+		</xsd:complexContent>
+	</xsd:complexType>			
+
+	<xsd:element name="intermediateThrowEvent" type="tIntermediateThrowEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tIntermediateThrowEvent">
+		<xsd:complexContent>
+			<xsd:extension base="tThrowEvent"/>
+		</xsd:complexContent>
+	</xsd:complexType>				
+
+	<xsd:element name="ioBinding" type="tInputOutputBinding" />
+	<xsd:complexType name="tInputOutputBinding">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="operationRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="inputDataRef" type="xsd:IDREF" use="required"/>
+				<xsd:attribute name="outputDataRef" type="xsd:IDREF" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="ioSpecification" type="tInputOutputSpecification" />
+	<xsd:complexType name="tInputOutputSpecification">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="dataInput" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="dataOutput" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="inputSet" minOccurs="1" maxOccurs="unbounded"/>
+					<xsd:element ref="outputSet" minOccurs="1" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="itemDefinition" type="tItemDefinition" substitutionGroup="rootElement"/>	
+	<xsd:complexType name="tItemDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:attribute name="structureRef" type="xsd:QName"/>
+				<xsd:attribute name="isCollection" type="xsd:boolean" default="false"/>
+				<xsd:attribute name="itemKind" type="tItemKind" default="Information"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>		
+	
+	<xsd:simpleType name="tItemKind">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="Information"/>
+			<xsd:enumeration value="Physical"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+	<xsd:element name="lane" type="tLane"/>
+	<xsd:complexType name="tLane">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="partitionElement" type="tBaseElement" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="flowNodeRef" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="childLaneSet" type="tLaneSet" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="partitionElementRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="laneSet" type="tLaneSet"/>
+	<xsd:complexType name="tLaneSet">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="lane" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="linkEventDefinition" type="tLinkEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tLinkEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:sequence>
+					<xsd:element name="source" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="target" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="loopCharacteristics" type="tLoopCharacteristics"/>
+	<xsd:complexType name="tLoopCharacteristics" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>	
+
+	<xsd:element name="manualTask" type="tManualTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tManualTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="message" type="tMessage" substitutionGroup="rootElement"/>	
+	<xsd:complexType name="tMessage">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="itemRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>		
+	
+	<xsd:element name="messageEventDefinition" type="tMessageEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tMessageEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:sequence>
+					<xsd:element name="operationRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="messageRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="messageFlow" type="tMessageFlow"/>
+	<xsd:complexType name="tMessageFlow">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="name" type="xsd:string" use="optional"/>
+				<xsd:attribute name="sourceRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="targetRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="messageRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="messageFlowAssociation" type="tMessageFlowAssociation"/>
+	<xsd:complexType name="tMessageFlowAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="innerMessageFlowRef" type="xsd:QName" use="required"/>
+				<xsd:attribute name="outerMessageFlowRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="monitoring" type="tMonitoring"/>
+	<xsd:complexType name="tMonitoring">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>	
+
+	<xsd:element name="multiInstanceLoopCharacteristics" type="tMultiInstanceLoopCharacteristics"  substitutionGroup="loopCharacteristics"/>
+	<xsd:complexType name="tMultiInstanceLoopCharacteristics">
+		<xsd:complexContent>
+			<xsd:extension base="tLoopCharacteristics">
+				<xsd:sequence>
+					<xsd:element name="loopCardinality" type="tExpression" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="loopDataInputRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="loopDataOutputRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="inputDataItem" type="tDataInput" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="outputDataItem" type="tDataOutput" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="complexBehaviorDefinition" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="completionCondition" type="tExpression" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="isSequential" type="xsd:boolean" default="false"/>
+				<xsd:attribute name="behavior" type="tMultiInstanceFlowCondition" default="All"/>
+				<xsd:attribute name="oneBehaviorEventRef" type="xsd:QName" use="optional"/>
+				<xsd:attribute name="noneBehaviorEventRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+	
+	<xsd:simpleType name="tMultiInstanceFlowCondition">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="None"/>
+			<xsd:enumeration value="One"/>
+			<xsd:enumeration value="All"/>
+			<xsd:enumeration value="Complex"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+	
+	<xsd:element name="operation" type="tOperation"/>
+	<xsd:complexType name="tOperation">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="inMessageRef" type="xsd:QName" minOccurs="1" maxOccurs="1"/>
+					<xsd:element name="outMessageRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="errorRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="required"/>
+				<xsd:attribute name="implementationRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="outputSet" type="tOutputSet" />
+	<xsd:complexType name="tOutputSet">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="dataOutputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="optionalOutputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="whileExecutingOutputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="inputSetRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="parallelGateway" type="tParallelGateway" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tParallelGateway">
+		<xsd:complexContent>
+			<xsd:extension base="tGateway"/>
+		</xsd:complexContent>
+	</xsd:complexType>	
+
+	<xsd:element name="participant" type="tParticipant"/>
+	<xsd:complexType name="tParticipant">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="interfaceRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="endPointRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="participantMultiplicity" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="processRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="participantAssociation" type="tParticipantAssociation"/>
+	<xsd:complexType name="tParticipantAssociation">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="innerParticipantRef" type="xsd:QName" minOccurs="1" maxOccurs="1"/>
+					<xsd:element name="outerParticipantRef" type="xsd:QName" minOccurs="1" maxOccurs="1"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="participantMultiplicity" type="tParticipantMultiplicity"/>
+	<xsd:complexType name="tParticipantMultiplicity">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="minimum" type="xsd:int" default="0"/>
+				<xsd:attribute name="maximum" type="xsd:int" default="1"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="partnerEntity" type="tPartnerEntity" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tPartnerEntity">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element name="participantRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="partnerRole" type="tPartnerRole" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tPartnerRole">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element name="participantRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="performer" type="tPerformer" substitutionGroup="resourceRole"/>
+	<xsd:complexType name="tPerformer">
+		<xsd:complexContent>
+			<xsd:extension base="tResourceRole"/>
+		</xsd:complexContent>
+	</xsd:complexType>	
+	
+	<xsd:element name="potentialOwner" type="tPotentialOwner" substitutionGroup="performer"/>
+	<xsd:complexType name="tPotentialOwner">
+		<xsd:complexContent>
+			<xsd:extension base="tHumanPerformer"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+    <xsd:element name="process" type="tProcess" substitutionGroup="rootElement"/>
+    <xsd:complexType name="tProcess">
+        <xsd:complexContent>
+            <xsd:extension base="tCallableElement">
+                <xsd:sequence>
+                    <xsd:element ref="auditing" minOccurs="0" maxOccurs="1"/>
+                    <xsd:element ref="monitoring" minOccurs="0" maxOccurs="1"/>
+                    <xsd:element ref="property" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element ref="laneSet" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element ref="flowElement" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element ref="resourceRole" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element ref="correlationSubscription" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element name="supports" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="processType" type="tProcessType" default="None"/>
+                <xsd:attribute name="isClosed" type="xsd:boolean" default="false"/>
+                <xsd:attribute name="isExecutable" type="xsd:boolean"/>
+                <xsd:attribute name="definitionalCollaborationRef" type="xsd:QName" use="optional"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+	<xsd:simpleType name="tProcessType">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="None"/>
+			<xsd:enumeration value="Public"/>
+			<xsd:enumeration value="Private"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+	<xsd:element name="property" type="tProperty" />
+	<xsd:complexType name="tProperty">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="itemSubjectRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="receiveTask" type="tReceiveTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tReceiveTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask">
+				<xsd:attribute name="implementation" type="tImplementation" default="##WebService"/>
+				<xsd:attribute name="instantiate" type="xsd:boolean" default="false"/>
+				<xsd:attribute name="messageRef" type="xsd:QName" use="optional"/>
+				<xsd:attribute name="operationRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+	
+	<xsd:element name="relationship" type="tRelationship"/>
+	<xsd:complexType name="tRelationship">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element name="source" type="xsd:QName" minOccurs="1" maxOccurs="unbounded"/>
+					<xsd:element name="target" type="xsd:QName" minOccurs="1" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="type" type="xsd:string" use="required"/>
+				<xsd:attribute name="direction" type="tRelationshipDirection"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+
+	<xsd:simpleType name="tRelationshipDirection">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="None"/>
+			<xsd:enumeration value="Forward"/>
+			<xsd:enumeration value="Backward"/>
+			<xsd:enumeration value="Both"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+	
+	<xsd:element name="rendering" type="tRendering"/>
+	<xsd:complexType name="tRendering">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="resource" type="tResource" substitutionGroup="rootElement"/>
+	<xsd:complexType name="tResource">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:sequence>
+					<xsd:element ref="resourceParameter" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="name" type="xsd:string" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="resourceAssignmentExpression" type="tResourceAssignmentExpression"/>
+	<xsd:complexType name="tResourceAssignmentExpression">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="expression" minOccurs="1" maxOccurs="1"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+
+	<xsd:element name="resourceParameter" type="tResourceParameter"/>
+	<xsd:complexType name="tResourceParameter">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="type" type="xsd:QName"/>
+				<xsd:attribute name="isRequired" type="xsd:boolean"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="resourceParameterBinding" type="tResourceParameterBinding"/>
+	<xsd:complexType name="tResourceParameterBinding">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement">
+				<xsd:sequence>
+					<xsd:element ref="expression" minOccurs="1" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="parameterRef" type="xsd:QName" use="required"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+
+	<xsd:element name="resourceRole" type="tResourceRole"/>
+	<xsd:complexType name="tResourceRole"> 
+		<xsd:complexContent> 
+			<xsd:extension base="tBaseElement"> 
+				<xsd:choice> 
+					<xsd:sequence> 
+						<xsd:element name="resourceRef" type="xsd:QName"/> 
+						<xsd:element ref="resourceParameterBinding" minOccurs="0" maxOccurs="unbounded"/> 
+					</xsd:sequence> 
+					<xsd:element ref="resourceAssignmentExpression" minOccurs="0" maxOccurs="1"/> 
+				</xsd:choice>
+				<xsd:attribute name="name" type="xsd:string"/>
+			</xsd:extension> 
+		</xsd:complexContent> 
+	</xsd:complexType>
+
+	<xsd:element name="rootElement" type="tRootElement"/>
+	<xsd:complexType name="tRootElement" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tBaseElement"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="scriptTask" type="tScriptTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tScriptTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask">
+				<xsd:sequence>
+					<xsd:element ref="script" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="scriptFormat" type="xsd:string"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>		
+	
+	<xsd:element name="script" type="tScript"/>
+	<xsd:complexType name="tScript" mixed="true">
+		<xsd:sequence>
+			<xsd:any namespace="##any" processContents="lax" minOccurs="0"/>
+		</xsd:sequence>
+	</xsd:complexType>	
+
+	<xsd:element name="sendTask" type="tSendTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tSendTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask">
+				<xsd:attribute name="implementation" type="tImplementation" default="##WebService"/>
+				<xsd:attribute name="messageRef" type="xsd:QName" use="optional"/>
+				<xsd:attribute name="operationRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+
+	<xsd:element name="sequenceFlow" type="tSequenceFlow" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tSequenceFlow">
+		<xsd:complexContent>
+			<xsd:extension base="tFlowElement">
+				<xsd:sequence>
+					<xsd:element name="conditionExpression"  type="tExpression" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="sourceRef" type="xsd:IDREF" use="required"/>
+				<xsd:attribute name="targetRef" type="xsd:IDREF" use="required"/>
+				<xsd:attribute name="isImmediate" type="xsd:boolean" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="serviceTask" type="tServiceTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tServiceTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask">
+				<xsd:attribute name="implementation" type="tImplementation" default="##WebService"/>
+				<xsd:attribute name="operationRef" type="xsd:QName" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+	
+	<xsd:element name="signal" type="tSignal" substitutionGroup="rootElement"/>	
+	<xsd:complexType name="tSignal">
+		<xsd:complexContent>
+			<xsd:extension base="tRootElement">
+				<xsd:attribute name="name" type="xsd:string"/>
+				<xsd:attribute name="structureRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+
+	<xsd:element name="signalEventDefinition" type="tSignalEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tSignalEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:attribute name="signalRef" type="xsd:QName"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="standardLoopCharacteristics" type="tStandardLoopCharacteristics"  substitutionGroup="loopCharacteristics"/>
+	<xsd:complexType name="tStandardLoopCharacteristics">
+		<xsd:complexContent>
+			<xsd:extension base="tLoopCharacteristics">
+				<xsd:sequence>
+					<xsd:element name="loopCondition" type="tExpression" minOccurs="0"/>
+				</xsd:sequence>
+				<xsd:attribute name="testBefore" type="xsd:boolean" default="false"/>
+				<xsd:attribute name="loopMaximum" type="xsd:integer" use="optional"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>	
+
+	<xsd:element name="startEvent" type="tStartEvent" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tStartEvent">
+		<xsd:complexContent>
+			<xsd:extension base="tCatchEvent">
+				<xsd:attribute name="isInterrupting" type="xsd:boolean" default="true"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>			
+	
+	<xsd:element name="subChoreography" type="tSubChoreography" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tSubChoreography">
+		<xsd:complexContent>
+			<xsd:extension base="tChoreographyActivity">
+				<xsd:sequence>
+					<xsd:element ref="flowElement" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="subConversation" type="tSubConversation" substitutionGroup="conversationNode"/>
+	<xsd:complexType name="tSubConversation">
+		<xsd:complexContent>
+			<xsd:extension base="tConversationNode">
+				<xsd:sequence>
+					<xsd:element ref="conversationNode" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="subProcess" type="tSubProcess" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tSubProcess">
+		<xsd:complexContent>
+			<xsd:extension base="tActivity">
+				<xsd:sequence>
+					<xsd:element ref="laneSet" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="flowElement" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="triggeredByEvent" type="xsd:boolean" default="false"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="task" type="tTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tTask">
+		<xsd:complexContent>
+			<xsd:extension base="tActivity"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:element name="terminateEventDefinition" type="tTerminateEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tTerminateEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition"/>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="textAnnotation" type="tTextAnnotation" substitutionGroup="artifact"/>
+	<xsd:complexType name="tTextAnnotation">
+		<xsd:complexContent>
+			<xsd:extension base="tArtifact">
+				<xsd:sequence>
+					<xsd:element ref="text" minOccurs="0" maxOccurs="1"/>
+				</xsd:sequence>
+				<xsd:attribute name="textFormat" type="xsd:string" default="text/plain"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="text" type="tText"/>
+	<xsd:complexType name="tText" mixed="true">
+		<xsd:sequence>
+			<xsd:any namespace="##any" processContents="lax" minOccurs="0"/>
+		</xsd:sequence>
+	</xsd:complexType>
+
+	<xsd:element name="throwEvent" type="tThrowEvent"/>
+	<xsd:complexType name="tThrowEvent" abstract="true">
+		<xsd:complexContent>
+			<xsd:extension base="tEvent">
+				<xsd:sequence>
+					<xsd:element ref="dataInput" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="dataInputAssociation" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element ref="inputSet" minOccurs="0" maxOccurs="1"/>
+					<xsd:element ref="eventDefinition" minOccurs="0" maxOccurs="unbounded"/>
+					<xsd:element name="eventDefinitionRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>			
+	
+	<xsd:element name="timerEventDefinition" type="tTimerEventDefinition" substitutionGroup="eventDefinition"/>
+	<xsd:complexType name="tTimerEventDefinition">
+		<xsd:complexContent>
+			<xsd:extension base="tEventDefinition">
+				<xsd:choice>
+					<xsd:element name="timeDate" type="tExpression" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="timeDuration" type="tExpression" minOccurs="0" maxOccurs="1"/>
+					<xsd:element name="timeCycle" type="tExpression" minOccurs="0" maxOccurs="1"/>
+				</xsd:choice>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<xsd:element name="transaction" type="tTransaction" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tTransaction">
+		<xsd:complexContent>
+			<xsd:extension base="tSubProcess">
+				<xsd:attribute name="method" type="tTransactionMethod" default="##Compensate"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+	
+	<xsd:simpleType name="tTransactionMethod">
+		<xsd:union memberTypes="xsd:anyURI">
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:token">
+					<xsd:enumeration value="##Compensate" /> 
+					<xsd:enumeration value="##Image" />
+					<xsd:enumeration value="##Store" />
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:union>
+	</xsd:simpleType>
+
+	<xsd:element name="userTask" type="tUserTask" substitutionGroup="flowElement"/>
+	<xsd:complexType name="tUserTask">
+		<xsd:complexContent>
+			<xsd:extension base="tTask">
+				<xsd:sequence>
+					<xsd:element ref="rendering" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:sequence>
+				<xsd:attribute name="implementation" type="tImplementation" default="##unspecified"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+</xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SgmlDTD.dtd b/xml/tests/testData/xml/SgmlDTD.dtd
new file mode 100644
index 0000000..fbe45bc
--- /dev/null
+++ b/xml/tests/testData/xml/SgmlDTD.dtd
@@ -0,0 +1,871 @@
+<!--
+    This is HTML 4.01 Strict DTD, which excludes the presentation
+    attributes and elements that W3C expects to phase out as
+    support for style sheets matures. Authors should use the Strict
+    DTD when possible, but may use the Transitional DTD when support
+    for presentation attribute and elements is required.
+
+    HTML 4 includes mechanisms for style sheets, scripting,
+    embedding objects, improved support for right to left and mixed
+    direction text, and enhancements to forms for improved
+    accessibility for people with disabilities.
+
+          Draft: $Date: 1999/12/24 23:37:49 $
+
+          Authors:
+              Dave Raggett <[email protected]>
+              Arnaud Le Hors <[email protected]>
+              Ian Jacobs <[email protected]>
+
+    Further information about HTML 4.01 is available at:
+
+        http://www.w3.org/TR/1999/REC-html401-19991224
+
+
+    The HTML 4.01 specification includes additional
+    syntactic constraints that cannot be expressed within
+    the DTDs.
+
+-->
+<!--
+    Typical usage:
+
+    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+            "http://www.w3.org/TR/html4/strict.dtd">
+    <html>
+    <head>
+    ...
+    </head>
+    <body>
+    ...
+    </body>
+    </html>
+
+    The URI used as a system identifier with the public identifier allows
+    the user agent to download the DTD and entity sets as needed.
+
+    The FPI for the Transitional HTML 4.01 DTD is:
+
+        "-//W3C//DTD HTML 4.01 Transitional//EN"
+
+    This version of the transitional DTD is:
+
+        http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd
+
+    If you are writing a document that includes frames, use
+    the following FPI:
+
+        "-//W3C//DTD HTML 4.01 Frameset//EN"
+
+    This version of the frameset DTD is:
+
+        http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd
+
+    Use the following (relative) URIs to refer to
+    the DTDs and entity definitions of this specification:
+
+    "strict.dtd"
+    "loose.dtd"
+    "frameset.dtd"
+    "HTMLlat1.ent"
+    "HTMLsymbol.ent"
+    "HTMLspecial.ent"
+
+-->
+
+<!--================== Imported Names ====================================-->
+<!-- Feature Switch for frameset documents -->
+<!ENTITY % HTML.Frameset "IGNORE">
+
+<!ENTITY % ContentType "CDATA"
+    -- media type, as per [RFC2045]
+    -->
+
+<!ENTITY % ContentTypes "CDATA"
+    -- comma-separated list of media types, as per [RFC2045]
+    -->
+
+<!ENTITY % Charset "CDATA"
+    -- a character encoding, as per [RFC2045]
+    -->
+
+<!ENTITY % Charsets "CDATA"
+    -- a space-separated list of character encodings, as per [RFC2045]
+    -->
+
+<!ENTITY % LanguageCode "NAME"
+    -- a language code, as per [RFC1766]
+    -->
+
+<!ENTITY % Character "CDATA"
+    -- a single character from [ISO10646]
+    -->
+
+<!ENTITY % LinkTypes "CDATA"
+    -- space-separated list of link types
+    -->
+
+<!ENTITY % MediaDesc "CDATA"
+    -- single or comma-separated list of media descriptors
+    -->
+
+<!ENTITY % URI "CDATA"
+    -- a Uniform Resource Identifier,
+       see [URI]
+    -->
+
+<!ENTITY % Datetime "CDATA" -- date and time information. ISO date format -->
+
+
+<!ENTITY % Script "CDATA" -- script expression -->
+
+<!ENTITY % StyleSheet "CDATA" -- style sheet data -->
+
+
+
+<!ENTITY % Text "CDATA">
+
+
+<!-- Parameter Entities -->
+
+<!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT" -- repeatable head elements -->
+
+<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
+
+<!ENTITY % list "UL | OL">
+
+<!ENTITY % preformatted "PRE">
+
+
+<!--================ Character mnemonic entities =========================-->
+
+<!ENTITY % HTMLlat1 PUBLIC
+   "-//W3C//ENTITIES Latin1//EN//HTML"
+   "<error descr="Cannot resolve file 'HTMLlat1.ent'">HTMLlat1.ent</error>">
+%HTMLlat1;
+
+<!ENTITY % HTMLsymbol PUBLIC
+   "-//W3C//ENTITIES Symbols//EN//HTML"
+   "<error descr="Cannot resolve file 'HTMLsymbol.ent'">HTMLsymbol.ent</error>">
+%HTMLsymbol;
+
+<!ENTITY % HTMLspecial PUBLIC
+   "-//W3C//ENTITIES Special//EN//HTML"
+   "<error descr="Cannot resolve file 'HTMLspecial.ent'">HTMLspecial.ent</error>">
+%HTMLspecial;
+<!--=================== Generic Attributes ===============================-->
+
+<!ENTITY % coreattrs
+ "id          ID             #IMPLIED  -- document-wide unique id --
+  class       CDATA          #IMPLIED  -- space-separated list of classes --
+  style       %StyleSheet;   #IMPLIED  -- associated style info --
+  title       %Text;         #IMPLIED  -- advisory title --"
+  >
+
+<!ENTITY % i18n
+ "lang        %LanguageCode; #IMPLIED  -- language code --
+  dir         (ltr|rtl)      #IMPLIED  -- direction for weak/neutral text --"
+  >
+
+<!ENTITY % events
+ "onclick     %Script;       #IMPLIED  -- a pointer button was clicked --
+  ondblclick  %Script;       #IMPLIED  -- a pointer button was double clicked--
+  onmousedown %Script;       #IMPLIED  -- a pointer button was pressed down --
+  onmouseup   %Script;       #IMPLIED  -- a pointer button was released --
+  onmouseover %Script;       #IMPLIED  -- a pointer was moved onto --
+  onmousemove %Script;       #IMPLIED  -- a pointer was moved within --
+  onmouseout  %Script;       #IMPLIED  -- a pointer was moved away --
+  onkeypress  %Script;       #IMPLIED  -- a key was pressed and released --
+  onkeydown   %Script;       #IMPLIED  -- a key was pressed down --
+  onkeyup     %Script;       #IMPLIED  -- a key was released --"
+  >
+
+<!-- Reserved Feature Switch -->
+<!ENTITY % HTML.Reserved "IGNORE">
+
+<!-- The following attributes are reserved for possible future use -->
+<![ %HTML.Reserved; [
+<!ENTITY % reserved
+ "datasrc     %URI;          #IMPLIED  -- a single or tabular Data Source --
+  datafld     CDATA          #IMPLIED  -- the property or column name --
+  dataformatas (plaintext|html) plaintext -- text or html --"
+  >
+]]>
+
+<!ENTITY % reserved "">
+
+<!ENTITY % attrs "%coreattrs; %i18n; %events;">
+
+
+<!--=================== Text Markup ======================================-->
+
+<!ENTITY % fontstyle
+ "TT | I | B | BIG | SMALL">
+
+<!ENTITY % phrase "EM | STRONG | DFN | CODE |
+                   SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
+
+<!ENTITY % special
+   "A | IMG | OBJECT | BR | SCRIPT | MAP | Q | SUB | SUP | SPAN | BDO">
+
+<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
+
+<!-- %inline; covers inline or "text-level" elements -->
+<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
+
+<!ELEMENT (%fontstyle;|%phrase;) - - (%inline;)*>
+<!ATTLIST (%fontstyle;|%phrase;)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT (SUB|SUP) - - (%inline;)*    -- subscript, superscript -->
+<!ATTLIST (SUB|SUP)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT SPAN - - (%inline;)*         -- generic language/style container -->
+<!ATTLIST SPAN
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %reserved;                   -- reserved for possible future use --
+  >
+
+<!ELEMENT BDO - - (%inline;)*          -- I18N BiDi over-ride -->
+<!ATTLIST BDO
+  %coreattrs;                          -- id, class, style, title --
+  lang        %LanguageCode; #IMPLIED  -- language code --
+  dir         (ltr|rtl)      #REQUIRED -- directionality --
+  >
+
+
+<!ELEMENT BR - O EMPTY                 -- forced line break -->
+<!ATTLIST BR
+  %coreattrs;                          -- id, class, style, title --
+  >
+
+<!--================== HTML content models ===============================-->
+
+<!--
+    HTML has two basic content models:
+
+        %inline;     character level elements and text strings
+        %block;      block-like elements e.g. paragraphs and lists
+-->
+
+<!ENTITY % block
+     "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
+      BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
+
+<!ENTITY % flow "%block; | %inline;">
+
+<!--=================== Document Body ====================================-->
+
+<!ELEMENT BODY O O (%block;|SCRIPT)+ +(<error descr="Unresolved Dtd Element Reference INS">INS</error>|<error descr="Unresolved Dtd Element Reference DEL">DEL</error>) -- document body -->
+<!ATTLIST BODY
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  onload          %Script;   #IMPLIED  -- the document has been loaded --
+  onunload        %Script;   #IMPLIED  -- the document has been removed --
+  >
+
+<!ELEMENT ADDRESS - - (%inline;)* -- information on author -->
+<!ATTLIST ADDRESS
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT DIV - - (%flow;)*            -- generic language/style container -->
+<!ATTLIST DIV
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+
+<!--================== The Anchor Element ================================-->
+
+<!ENTITY % Shape "(rect|circle|poly|default)">
+<!ENTITY % Coords "CDATA" -- comma-separated list of lengths -->
+
+<!ELEMENT A - - (%inline;)* -(A)       -- anchor -->
+<!ATTLIST A
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  charset     %Charset;      #IMPLIED  -- char encoding of linked resource --
+  type        %ContentType;  #IMPLIED  -- advisory content type --
+  name        CDATA          #IMPLIED  -- named link end --
+  href        %URI;          #IMPLIED  -- URI for linked resource --
+  hreflang    %LanguageCode; #IMPLIED  -- language code --
+  rel         %LinkTypes;    #IMPLIED  -- forward link types --
+  rev         %LinkTypes;    #IMPLIED  -- reverse link types --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  shape       %Shape;        rect      -- for use with client-side image maps --
+  coords      %Coords;       #IMPLIED  -- for use with client-side image maps --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  >
+
+<!--================== Client-side image maps ============================-->
+
+<!-- These can be placed in the same document or grouped in a
+     separate document although this isn't yet widely supported -->
+
+<!ELEMENT MAP - - ((%block;) | AREA)+ -- client-side image map -->
+<!ATTLIST MAP
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  name        CDATA          #REQUIRED -- for reference by usemap --
+  >
+
+<!ELEMENT AREA - O EMPTY               -- client-side image map area -->
+<!ATTLIST AREA
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  shape       %Shape;        rect      -- controls interpretation of coords --
+  coords      %Coords;       #IMPLIED  -- comma-separated list of lengths --
+  href        %URI;          #IMPLIED  -- URI for linked resource --
+  nohref      (nohref)       #IMPLIED  -- this region has no action --
+  alt         %Text;         #REQUIRED -- short description --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  >
+
+<!--================== The LINK Element ==================================-->
+
+<!--
+  Relationship values can be used in principle:
+
+   a) for document specific toolbars/menus when used
+      with the LINK element in document head e.g.
+        start, contents, previous, next, index, end, help
+   b) to link to a separate style sheet (rel=stylesheet)
+   c) to make a link to a script (rel=script)
+   d) by stylesheets to control how collections of
+      html nodes are rendered into printed documents
+   e) to make a link to a printable version of this document
+      e.g. a postscript or pdf version (rel=alternate media=print)
+-->
+
+<!ELEMENT LINK - O EMPTY               -- a media-independent link -->
+<!ATTLIST LINK
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  charset     %Charset;      #IMPLIED  -- char encoding of linked resource --
+  href        %URI;          #IMPLIED  -- URI for linked resource --
+  hreflang    %LanguageCode; #IMPLIED  -- language code --
+  type        %ContentType;  #IMPLIED  -- advisory content type --
+  rel         %LinkTypes;    #IMPLIED  -- forward link types --
+  rev         %LinkTypes;    #IMPLIED  -- reverse link types --
+  media       %MediaDesc;    #IMPLIED  -- for rendering on these media --
+  >
+
+<!--=================== Images ===========================================-->
+
+<!-- Length defined in strict DTD for cellpadding/cellspacing -->
+<!ENTITY % Length "CDATA" -- nn for pixels or nn% for percentage length -->
+<!ENTITY % MultiLength "CDATA" -- pixel, percentage, or relative -->
+
+<![ %HTML.Frameset; [
+<!ENTITY % MultiLengths "CDATA" -- comma-separated list of MultiLength -->
+]]>
+
+<!ENTITY % Pixels "CDATA" -- integer representing length in pixels -->
+
+
+<!-- To avoid problems with text-only UAs as well as
+   to make image content understandable and navigable
+   to users of non-visual UAs, you need to provide
+   a description with ALT, and avoid server-side image maps -->
+<!ELEMENT IMG - O EMPTY                -- Embedded image -->
+<!ATTLIST IMG
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  src         %URI;          #REQUIRED -- URI of image to embed --
+  alt         %Text;         #REQUIRED -- short description --
+  longdesc    %URI;          #IMPLIED  -- link to long description
+                                          (complements alt) --
+  name        CDATA          #IMPLIED  -- name of image for scripting --
+  height      %Length;       #IMPLIED  -- override height --
+  width       %Length;       #IMPLIED  -- override width --
+  usemap      %URI;          #IMPLIED  -- use client-side image map --
+  ismap       (ismap)        #IMPLIED  -- use server-side image map --
+  >
+
+<!-- USEMAP points to a MAP element which may be in this document
+  or an external document, although the latter is not widely supported -->
+
+<!--==================== OBJECT ======================================-->
+<!--
+  OBJECT is used to embed objects as part of HTML pages
+  PARAM elements should precede other content. SGML mixed content
+  model technicality precludes specifying this formally ...
+-->
+
+<!ELEMENT OBJECT - - (PARAM | %flow;)*
+ -- generic embedded object -->
+<!ATTLIST OBJECT
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  declare     (declare)      #IMPLIED  -- declare but don't instantiate flag --
+  classid     %URI;          #IMPLIED  -- identifies an implementation --
+  codebase    %URI;          #IMPLIED  -- base URI for classid, data, archive--
+  data        %URI;          #IMPLIED  -- reference to object's data --
+  type        %ContentType;  #IMPLIED  -- content type for data --
+  codetype    %ContentType;  #IMPLIED  -- content type for code --
+  archive     CDATA          #IMPLIED  -- space-separated list of URIs --
+  standby     %Text;         #IMPLIED  -- message to show while loading --
+  height      %Length;       #IMPLIED  -- override height --
+  width       %Length;       #IMPLIED  -- override width --
+  usemap      %URI;          #IMPLIED  -- use client-side image map --
+  name        CDATA          #IMPLIED  -- submit as part of form --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!ELEMENT PARAM - O EMPTY              -- named property value -->
+<!ATTLIST PARAM
+  id          ID             #IMPLIED  -- document-wide unique id --
+  name        CDATA          #REQUIRED -- property name --
+  value       CDATA          #IMPLIED  -- property value --
+  valuetype   (DATA|REF|OBJECT) DATA   -- How to interpret value --
+  type        %ContentType;  #IMPLIED  -- content type for value
+                                          when valuetype=ref --
+  >
+
+
+<!--=================== Horizontal Rule ==================================-->
+
+<!ELEMENT HR - O EMPTY -- horizontal rule -->
+<!ATTLIST HR
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--=================== Paragraphs =======================================-->
+
+<!ELEMENT P - O (%inline;)*            -- paragraph -->
+<!ATTLIST P
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--=================== Headings =========================================-->
+
+<!--
+  There are six levels of headings from H1 (the most important)
+  to H6 (the least important).
+-->
+
+<!ELEMENT (%heading;)  - - (%inline;)* -- heading -->
+<!ATTLIST (%heading;)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--=================== Preformatted Text ================================-->
+
+<!-- excludes markup for images and changes in font size -->
+<!ENTITY % pre.exclusion "IMG|OBJECT|BIG|SMALL|SUB|SUP">
+
+<!ELEMENT PRE - - (%inline;)* -(%pre.exclusion;) -- preformatted text -->
+<!ATTLIST PRE
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--===================== Inline Quotes ==================================-->
+
+<!ELEMENT Q - - (%inline;)*            -- short inline quotation -->
+<!ATTLIST Q
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  cite        %URI;          #IMPLIED  -- URI for source document or msg --
+  >
+
+<!--=================== Block-like Quotes ================================-->
+
+<!ELEMENT BLOCKQUOTE - - (%block;|SCRIPT)+ -- long quotation -->
+<!ATTLIST BLOCKQUOTE
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  cite        %URI;          #IMPLIED  -- URI for source document or msg --
+  >
+
+<!--=================== Inserted/Deleted Text ============================-->
+
+
+<!-- INS/DEL are handled by inclusion on BODY -->
+<!ELEMENT (INS|DEL) - - (%flow;)*      -- inserted text, deleted text -->
+<!ATTLIST (INS|DEL)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  cite        %URI;          #IMPLIED  -- info on reason for change --
+  datetime    %Datetime;     #IMPLIED  -- date and time of change --
+  >
+
+<!--=================== Lists ============================================-->
+
+<!-- definition lists - DT for term, DD for its definition -->
+
+<!ELEMENT DL - - (DT|DD)+              -- definition list -->
+<!ATTLIST DL
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT DT - O (%inline;)*           -- definition term -->
+<!ELEMENT DD - O (%flow;)*             -- definition description -->
+<!ATTLIST (DT|DD)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+
+<!ELEMENT OL - - (LI)+                 -- ordered list -->
+<!ATTLIST OL
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!-- Unordered Lists (UL) bullet styles -->
+<!ELEMENT UL - - (LI)+                 -- unordered list -->
+<!ATTLIST UL
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+
+
+<!ELEMENT LI - O (%flow;)*             -- list item -->
+<!ATTLIST LI
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--================ Forms ===============================================-->
+<!ELEMENT FORM - - (%block;|SCRIPT)+ -(FORM) -- interactive form -->
+<!ATTLIST FORM
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  action      %URI;          #REQUIRED -- server-side form handler --
+  method      (GET|POST)     GET       -- HTTP method used to submit the form--
+  enctype     %ContentType;  "application/x-www-form-urlencoded"
+  accept      %ContentTypes; #IMPLIED  -- list of MIME types for file upload --
+  name        CDATA          #IMPLIED  -- name of form for scripting --
+  onsubmit    %Script;       #IMPLIED  -- the form was submitted --
+  onreset     %Script;       #IMPLIED  -- the form was reset --
+  accept-charset %Charsets;  #IMPLIED  -- list of supported charsets --
+  >
+
+<!-- Each label must not contain more than ONE field -->
+<!ELEMENT LABEL - - (%inline;)* -(LABEL) -- form field label text -->
+<!ATTLIST LABEL
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  for         IDREF          #IMPLIED  -- matches field ID value --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  >
+
+<!ENTITY % InputType
+  "(TEXT | PASSWORD | CHECKBOX |
+    RADIO | SUBMIT | RESET |
+    FILE | HIDDEN | IMAGE | BUTTON)"
+   >
+
+<!-- attribute name required for all but submit and reset -->
+<!ELEMENT INPUT - O EMPTY              -- form control -->
+<!ATTLIST INPUT
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  type        %InputType;    TEXT      -- what kind of widget is needed --
+  name        CDATA          #IMPLIED  -- submit as part of form --
+  value       CDATA          #IMPLIED  -- Specify for radio buttons and checkboxes --
+  checked     (checked)      #IMPLIED  -- for radio buttons and check boxes --
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  readonly    (readonly)     #IMPLIED  -- for text and passwd --
+  size        CDATA          #IMPLIED  -- specific to each type of field --
+  maxlength   NUMBER         #IMPLIED  -- max chars for text fields --
+  src         %URI;          #IMPLIED  -- for fields with images --
+  alt         CDATA          #IMPLIED  -- short description --
+  usemap      %URI;          #IMPLIED  -- use client-side image map --
+  ismap       (ismap)        #IMPLIED  -- use server-side image map --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  onselect    %Script;       #IMPLIED  -- some text was selected --
+  onchange    %Script;       #IMPLIED  -- the element value was changed --
+  accept      %ContentTypes; #IMPLIED  -- list of MIME types for file upload --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->
+<!ATTLIST SELECT
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  name        CDATA          #IMPLIED  -- field name --
+  size        NUMBER         #IMPLIED  -- rows visible --
+  multiple    (multiple)     #IMPLIED  -- default is single selection --
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  onchange    %Script;       #IMPLIED  -- the element value was changed --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!ELEMENT OPTGROUP - - (OPTION)+ -- option group -->
+<!ATTLIST OPTGROUP
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  label       %Text;         #REQUIRED -- for use in hierarchical menus --
+  >
+
+<!ELEMENT OPTION - O (#PCDATA)         -- selectable choice -->
+<!ATTLIST OPTION
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  selected    (selected)     #IMPLIED
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  label       %Text;         #IMPLIED  -- for use in hierarchical menus --
+  value       CDATA          #IMPLIED  -- defaults to element content --
+  >
+
+<!ELEMENT TEXTAREA - - (#PCDATA)       -- multi-line text field -->
+<!ATTLIST TEXTAREA
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  name        CDATA          #IMPLIED
+  rows        NUMBER         #REQUIRED
+  cols        NUMBER         #REQUIRED
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  readonly    (readonly)     #IMPLIED
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  onselect    %Script;       #IMPLIED  -- some text was selected --
+  onchange    %Script;       #IMPLIED  -- the element value was changed --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!--
+  #PCDATA is to solve the mixed content problem,
+  per specification only whitespace is allowed there!
+ -->
+<!ELEMENT FIELDSET - - (#PCDATA,LEGEND,(%flow;)*) -- form control group -->
+<!ATTLIST FIELDSET
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT LEGEND - - (%inline;)*       -- fieldset legend -->
+
+<!ATTLIST LEGEND
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  >
+
+<!ELEMENT BUTTON - -
+     (%flow;)* -(A|%formctrl;|FORM|FIELDSET)
+     -- push button -->
+<!ATTLIST BUTTON
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED  -- sent to server when submitted --
+  type        (button|submit|reset) submit -- for use as form button --
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!--======================= Tables =======================================-->
+
+<!-- IETF HTML table standard, see [RFC1942] -->
+
+<!--
+ The BORDER attribute sets the thickness of the frame around the
+ table. The default units are screen pixels.
+
+ The FRAME attribute specifies which parts of the frame around
+ the table should be rendered. The values are not the same as
+ CALS to avoid a name clash with the VALIGN attribute.
+
+ The value "border" is included for backwards compatibility with
+ <TABLE BORDER> which yields frame=border and border=implied
+ For <TABLE BORDER=1> you get border=1 and frame=implied. In this
+ case, it is appropriate to treat this as frame=border for backwards
+ compatibility with deployed browsers.
+-->
+<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
+
+<!--
+ The RULES attribute defines which rules to draw between cells:
+
+ If RULES is absent then assume:
+     "none" if BORDER is absent or BORDER=0 otherwise "all"
+-->
+
+<!ENTITY % TRules "(none | groups | rows | cols | all)">
+
+<!-- horizontal placement of table relative to document -->
+<!ENTITY % TAlign "(left|center|right)">
+
+<!-- horizontal alignment attributes for cell contents -->
+<!ENTITY % cellhalign
+  "align      (left|center|right|justify|char) #IMPLIED
+   char       %Character;    #IMPLIED  -- alignment char, e.g. char=':' --
+   charoff    %Length;       #IMPLIED  -- offset for alignment char --"
+  >
+
+<!-- vertical alignment attributes for cell contents -->
+<!ENTITY % cellvalign
+  "valign     (top|middle|bottom|baseline) #IMPLIED"
+  >
+
+<!ELEMENT TABLE - -
+     (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
+<!ELEMENT CAPTION  - - (%inline;)*     -- table caption -->
+<!ELEMENT THEAD    - O (TR)+           -- table header -->
+<!ELEMENT TFOOT    - O (TR)+           -- table footer -->
+<!ELEMENT TBODY    O O (TR)+           -- table body -->
+<!ELEMENT COLGROUP - O (COL)*          -- table column group -->
+<!ELEMENT COL      - O EMPTY           -- table column -->
+<!ELEMENT TR       - O (<error descr="Unresolved Dtd Element Reference TH">TH</error>|<error descr="Unresolved Dtd Element Reference TD">TD</error>)+        -- table row -->
+<!ELEMENT (TH|TD)  - O (%flow;)*       -- table header cell, table data cell-->
+
+<!ATTLIST TABLE                        -- table element --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  summary     %Text;         #IMPLIED  -- purpose/structure for speech output--
+  width       %Length;       #IMPLIED  -- table width --
+  border      %Pixels;       #IMPLIED  -- controls frame width around table --
+  frame       %TFrame;       #IMPLIED  -- which parts of frame to render --
+  rules       %TRules;       #IMPLIED  -- rulings between rows and cols --
+  cellspacing %Length;       #IMPLIED  -- spacing between cells --
+  cellpadding %Length;       #IMPLIED  -- spacing within cells --
+  %reserved;                           -- reserved for possible future use --
+  datapagesize CDATA         #IMPLIED  -- reserved for possible future use --
+  >
+
+
+<!ATTLIST CAPTION
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--
+COLGROUP groups a set of COL elements. It allows you to group
+several semantically related columns together.
+-->
+<!ATTLIST COLGROUP
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  span        NUMBER         1         -- default number of columns in group --
+  width       %MultiLength;  #IMPLIED  -- default width for enclosed COLs --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  >
+
+<!--
+ COL elements define the alignment properties for cells in
+ one or more columns.
+
+ The WIDTH attribute specifies the width of the columns, e.g.
+
+     width=64        width in screen pixels
+     width=0.5*      relative width of 0.5
+
+ The SPAN attribute causes the attributes of one
+ COL element to apply to more than one column.
+-->
+<!ATTLIST COL                          -- column groups and properties --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  span        NUMBER         1         -- COL attributes affect N columns --
+  width       %MultiLength;  #IMPLIED  -- column width specification --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  >
+
+<!--
+    Use THEAD to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    TBODY sections are rendered in scrolling panel.
+
+    Use TFOOT to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    TBODY sections are rendered in scrolling panel.
+
+    Use multiple TBODY sections when rules are needed
+    between groups of table rows.
+-->
+<!ATTLIST (THEAD|TBODY|TFOOT)          -- table section --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  >
+
+<!ATTLIST TR                           -- table row --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  >
+
+
+
+<!-- Scope is simpler than headers attribute for common tables -->
+<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
+
+<!-- TH is for headers, TD for data, but for cells acting as both use TD -->
+<!ATTLIST (TH|TD)                      -- header or data cell --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  abbr        %Text;         #IMPLIED  -- abbreviation for header cell --
+  axis        CDATA          #IMPLIED  -- comma-separated list of related headers--
+  headers     IDREFS         #IMPLIED  -- list of id's for header cells --
+  scope       %Scope;        #IMPLIED  -- scope covered by header cells --
+  rowspan     NUMBER         1         -- number of rows spanned by cell --
+  colspan     NUMBER         1         -- number of cols spanned by cell --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  >
+
+
+<!--================ Document Head =======================================-->
+<!-- %head.misc; defined earlier on as "SCRIPT|STYLE|META|LINK|OBJECT" -->
+<!ENTITY % head.content "TITLE & BASE?">
+
+<!ELEMENT HEAD O O (%head.content;) +(%head.misc;) -- document head -->
+<!ATTLIST HEAD
+  %i18n;                               -- lang, dir --
+  profile     %URI;          #IMPLIED  -- named dictionary of meta info --
+  >
+
+<!-- The TITLE element is not considered part of the flow of text.
+       It should be displayed, for example as the page header or
+       window title. Exactly one title is required per document.
+    -->
+<!ELEMENT TITLE - - (#PCDATA) -(%head.misc;) -- document title -->
+<!ATTLIST TITLE %i18n>
+
+
+<!ELEMENT BASE - O EMPTY               -- document base URI -->
+<!ATTLIST BASE
+  href        %URI;          #REQUIRED -- URI that acts as base URI --
+  >
+
+<!ELEMENT META - O EMPTY               -- generic metainformation -->
+<!ATTLIST META
+  %i18n;                               -- lang, dir, for use with content --
+  http-equiv  NAME           #IMPLIED  -- HTTP response header name  --
+  name        NAME           #IMPLIED  -- metainformation name --
+  content     CDATA          #REQUIRED -- associated information --
+  scheme      CDATA          #IMPLIED  -- select form of content --
+  >
+
+<!ELEMENT STYLE - - %StyleSheet;        -- style info -->
+<!ATTLIST STYLE
+  %i18n;                               -- lang, dir, for use with title --
+  type        %ContentType;  #REQUIRED -- content type of style language --
+  media       %MediaDesc;    #IMPLIED  -- designed for use with these media --
+  title       %Text;         #IMPLIED  -- advisory title --
+  >
+
+<!ELEMENT SCRIPT - - %Script;          -- script statements -->
+<!ATTLIST SCRIPT
+  charset     %Charset;      #IMPLIED  -- char encoding of linked resource --
+  type        %ContentType;  #REQUIRED -- content type of script language --
+  src         %URI;          #IMPLIED  -- URI for an external script --
+  defer       (defer)        #IMPLIED  -- UA may defer execution of script --
+  event       CDATA          #IMPLIED  -- reserved for possible future use --
+  for         %URI;          #IMPLIED  -- reserved for possible future use --
+  >
+
+<!ELEMENT NOSCRIPT - - (%block;)+
+  -- alternate content container for non script-based rendering -->
+<!ATTLIST NOSCRIPT
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--================ Document Structure ==================================-->
+<!ENTITY % html.content "HEAD, BODY">
+
+<!ELEMENT HTML O O (%html.content;)    -- document root element -->
+<!ATTLIST HTML
+  %i18n;                               -- lang, dir --
+  >
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix.xml b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix.xml
new file mode 100644
index 0000000..35ad230
--- /dev/null
+++ b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.co<caret>m/xml/ns/j2ee" version="2.4"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix2.xml b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix2.xml
new file mode 100644
index 0000000..2d04020
--- /dev/null
+++ b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix2.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:q="<error>aaa</error>" xsi:schemaLocation="<error>aaa</error> aaa" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.<caret>com/xml/ns/j2ee" version="2.4"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix2_after.xml b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix2_after.xml
new file mode 100644
index 0000000..5c90f8a
--- /dev/null
+++ b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix2_after.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:q="aaa" xsi:schemaLocation="aaa aaa
+http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix3.xml b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix3.xml
new file mode 100644
index 0000000..e1de2c6
--- /dev/null
+++ b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix3.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xxx xmlns="<error>a<caret>aa</error>"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix3_after.xml b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix3_after.xml
new file mode 100644
index 0000000..669c8b2
--- /dev/null
+++ b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix3_after.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xxx xmlns="aaa" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="aaa <caret>"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix4.xml b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix4.xml
new file mode 100644
index 0000000..7b4ece8
--- /dev/null
+++ b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix4.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<x:web-app xmlns:x="http://java.sun.co<caret>m/xml/ns/j2ee" version="2.4"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix4_after.xml b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix4_after.xml
new file mode 100644
index 0000000..79532bd
--- /dev/null
+++ b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix4_after.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<x:web-app xmlns:x="http://java.sun.com/xml/ns/j2ee" version="2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix_after.xml b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix_after.xml
new file mode 100644
index 0000000..ac13da9
--- /dev/null
+++ b/xml/tests/testData/xml/SpecifyXsiSchemaLocationQuickFix_after.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/StackOverflow.xml b/xml/tests/testData/xml/StackOverflow.xml
new file mode 100644
index 0000000..39800e7
--- /dev/null
+++ b/xml/tests/testData/xml/StackOverflow.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<grammar xmlns="http://relaxng.org/ns/structure/fake/1.0">
+
+</grammar>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/StackOverflow2.xsd b/xml/tests/testData/xml/StackOverflow2.xsd
new file mode 100644
index 0000000..6bc2fa0
--- /dev/null
+++ b/xml/tests/testData/xml/StackOverflow2.xsd
@@ -0,0 +1,4 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+<xs:redefine schemaLocation="urn:aaa" xsi:schemaLocation="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+<xs:element name="book" type="xs:string"/>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/Tapestry_3_0.dtd b/xml/tests/testData/xml/Tapestry_3_0.dtd
new file mode 100644
index 0000000..d08bf36
--- /dev/null
+++ b/xml/tests/testData/xml/Tapestry_3_0.dtd
@@ -0,0 +1,547 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- $Id: Tapestry_3_0.dtd,v 1.1 2004/12/30 16:18:31 Maxim.Mossienko Exp $ -->
+<!--
+
+The DTD for Tapestry application, library, page and component specifications.
+Associated with the public identifier:
+
+	-//Apache Software Foundation//Tapestry Specification 3.0//EN
+
+The canonical location for the DTD is:
+
+	http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd
+
+For application specifications, the root element is application.
+
+For component specifications, the root element is component-specification.
+
+For page specifications, the root element is page-specification.
+
+For library specifiations, the root element is library-specification.
+
+This DTD is backwards compatible with the 1.3 DTD, with the following exceptions:
+- <field-binding> has been removed
+- attribute class of <component-specification> and <page-specification is now optional
+- attributes name and engine-class of <application> are now optional
+- added value attribute to <static-binding>
+- added value attribute to <property>
+- renamed <component-alias> to <component-type>
+- rename <set-string-property> to <set-message-property>
+- added <listener-binding> element
+- added <property-specification> element
+- renamed java-type to type inside <parameter>
+- allow values to be specified as attributes or wrapped character data in many elements
+- allow only a single <description> per element
+-->
+<!-- =======================================================
+Entity: attribute-flag
+
+For entity attributes that take a boolean value, defines 'yes' and 'no'.
+The default varies, so isn't included here.
+-->
+<!ENTITY % attribute-flag "(yes|no)">
+<!-- =======================================================
+Entity: static-value-type
+
+For entity attributes that take a string but convert it to a real
+type.  Defaults to String.
+
+-->
+<!ENTITY % static-value-type "(boolean|int|long|double|String) 'String'">
+<!ENTITY % library-content "(description?, property*, (page|component-type|service|library|extension)*)">
+<!-- =======================================================
+Element: application
+Root element
+
+Defines a Tapestry application.
+
+Attributes:
+  name: A textual name used to uniquely identify the application.
+  engine-class:  The Java class to instantiate as the application engine.
+-->
+<!ELEMENT application %library-content;>
+<!ATTLIST application
+	name CDATA #IMPLIED
+	engine-class CDATA #IMPLIED
+>
+<!-- =======================================================
+Element: bean
+Appears in: component-specification, page-specification
+
+Defines a JavaBean that will be used in some way by the component.  Beans
+are accessible via the components' beans property (which contains a property
+for each bean).  Beans are created as needed, and are discarded based on
+the lifecycle attribute.  Beans are typically used to extend the
+implementation of a component via aggregation.
+
+Attributes:
+  name: the name of the bean
+  class: the Java class to instantiate
+  lifecycle: when the reference to the bean should be discard
+  	"none" no lifecycle, the bean is created and returned, but not stored
+  	"request" the bean is retained until the end of the request cycle
+  	"page" the bean is retained for the lifespan of the page
+  	"render" the bean is retained until the end of the current page render
+
+Nothing prevents a bean for storing state; however, such state will
+not be associated with any particular session (unlike persistant page
+properties).  Further, because of page pooling, subsequent requests
+from the same client may be serviced by different instances of a page and
+(therefore) different bean instances.
+
+Beans that have the "request" lifecycle may be stored into a pool
+for later re-use (in the same or different page).
+
+The bean may have its properties set.  Properties are set on both
+newly instantiated beans, and beans that are retrieved from a pool.
+
+-->
+<!ELEMENT bean (description?, property*, (set-property | set-message-property)*)>
+<!ATTLIST bean
+	name CDATA #REQUIRED
+	class CDATA #REQUIRED
+	lifecycle (none | request | page | render) "request"
+>
+<!-- =======================================================
+Element: binding
+Appears in: component
+
+Binds a parameter of the component to a OGNL expression, relative
+to its container.  The expression may be provided as an attribute, or
+as the body of the element.  The latter case is useful when the
+expression is long, or uses problematic characters (such as a
+mix of single and double quotes).
+
+Attributes:
+  name: The name of the component parameter to bind.
+  expression: The OGNL expression.
+-->
+<!ELEMENT binding (#PCDATA)>
+<!ATTLIST binding
+	name CDATA #REQUIRED
+	expression CDATA #IMPLIED
+>
+<!-- =======================================================
+Element: configure
+Appears in: extension
+
+Configures one JavaBean property of an extension.
+
+Attributes:
+  property-name:  The name of the property to configure.
+  type: Conversion of property value.
+  value: The value to be converted and applied.  If not
+    specified, the element's character data is
+    used.
+
+-->
+<!ELEMENT configure (#PCDATA)>
+<!ATTLIST configure
+	property-name CDATA #REQUIRED
+	type %static-value-type;
+	value CDATA #IMPLIED
+>
+<!-- =======================================================
+Element: component
+Contained by: component-specification, page-specification
+
+Defines a component contained by the component being specified.
+
+Attribute:
+  id: A unique identifier for the component within the container.
+  type: The type of component, either a well known logical name, or the complete path
+    to the component's specification.
+  copy-of: The id of a previously defined component; this component will be a copy
+    of the other component.
+
+The Tapestry page loader ensures that either type or copy-of is specified, but not both.
+-->
+<!ELEMENT component (property*, (binding | inherited-binding | listener-binding | static-binding | message-binding)*)>
+<!ATTLIST component
+	id ID #REQUIRED
+	type CDATA #IMPLIED
+	copy-of IDREF #IMPLIED
+	inherit-informal-parameters %attribute-flag; "no"
+>
+<!-- =======================================================
+Element: component-type
+Contained by: application
+
+Establishes a short logic name for a particular component that is used
+within the application.
+
+Attributes:
+  type: The logical name for the component.
+  specification-path:  The complete path to the component's specification.
+-->
+<!ELEMENT component-type EMPTY>
+<!ATTLIST component-type
+	type CDATA #REQUIRED
+	specification-path CDATA #REQUIRED
+>
+<!-- =======================================================
+Element: component-specification
+Root element
+
+A component specification.  It's attributes define the Java class to
+instantiate, whether the component may wrap other elements, and whether
+informal (undeclared) parameters are allowed.  Very similar to a page-specification,
+except that component-specification allows for parameters (formal and informal).
+
+Attributes:
+  class: The Java class to instantiate for the component.
+  allow-body:  If yes (the default), the component may wrap other elements (have a body).
+  allow-informal-parameters:  If yes (the default), informal parameters (parameters that are not
+    explictily defined) are allowed.
+-->
+<!ELEMENT component-specification (description?, parameter*, reserved-parameter*, property*, (bean | component | external-asset | context-asset | private-asset | property-specification)*)>
+<!ATTLIST component-specification
+	class CDATA #IMPLIED
+	allow-body %attribute-flag; "yes"
+	allow-informal-parameters %attribute-flag; "yes"
+>
+<!-- =======================================================
+Element: context-asset
+Contained by: component-specification, page-specification
+
+An asset located in the same web application context as the running
+application.
+
+Attributes:
+  name: The name of the asset.
+  path: The path, relative to the web application context, of the resource.
+-->
+<!ELEMENT context-asset (property*)>
+<!ATTLIST context-asset
+	name CDATA #REQUIRED
+	path CDATA #REQUIRED
+>
+<!-- =======================================================
+Element: description
+Appears in: many
+
+Several elements may contain descriptions; these descriptions are
+optional.  The eventual goal is to provide help in some form of IDE.
+Currently, descriptions are optional and ignored.
+
+-->
+<!ELEMENT description (#PCDATA)>
+<!-- =======================================================
+Element: extension
+Contained by: application, library-specification
+
+Defines an extension, an object that is instantiated and configured
+(like a helper bean) and is then accessible, by name, from the
+containing library (or application).
+
+Attributes:
+  name: Name of the extension.
+  class: Java class to instantiate.
+  immediate: If true, the extension is instantiated early instead of as-needed.
+
+-->
+<!ELEMENT extension (property*, configure*)>
+<!ATTLIST extension
+	name CDATA #REQUIRED
+	class CDATA #REQUIRED
+	immediate %attribute-flag; "no"
+>
+<!-- =======================================================
+Element: external-asset
+Contained by: component-specification, page-specification
+
+Defines an asset at some external source.
+
+Attributes:
+  name: The name of the asset.
+  URL: The URL used to reference the asset.
+-->
+<!ELEMENT external-asset (property*)>
+<!ATTLIST external-asset
+	name CDATA #REQUIRED
+	URL CDATA #REQUIRED
+>
+<!-- =======================================================
+Element: inherited-binding
+Appears in: component
+
+Binds a parameter of the component to a parameter of the container.
+
+Attributes:
+  name: The name of the component parameter to bind.
+  parameter-name: The name of the container parameter to bind the
+    component parameter to.
+-->
+<!ELEMENT inherited-binding EMPTY>
+<!ATTLIST inherited-binding
+	name CDATA #REQUIRED
+	parameter-name CDATA #REQUIRED
+>
+<!-- =======================================================
+Element: library
+Appears in: application-specification, library-specification
+
+Defines a library used in the construction of the container
+(either another library, or the application itself).
+
+Attributes:
+  id: An identifier used to reference pages and components
+    provided by the library.
+  specification-path: The path to the resource that provides
+    the library specification.
+-->
+<!ELEMENT library EMPTY>
+<!ATTLIST library
+	id CDATA #REQUIRED
+	specification-path CDATA #REQUIRED
+>
+<!-- =======================================================
+Element: library-specification
+Root element
+
+Defines a library that may be used in the construction
+of an application (or another library).  An application can
+be thought of as a specialized kind of library.
+
+-->
+<!ELEMENT library-specification %library-content;>
+<!-- =======================================================
+Element: page
+Contained by: application, library-specification
+
+Defines a single page within the application.  Each application will contain
+at least one of these, to define the Home page.
+
+Attributes:
+  name: A unique name for the application.
+  specification-path:  The resource classpath of the component specification
+    for the page.
+-->
+<!ELEMENT page EMPTY>
+<!ATTLIST page
+	name CDATA #REQUIRED
+	specification-path CDATA #REQUIRED
+>
+<!-- =======================================================
+Element: listener-binding
+Appears in: component
+
+Defines an in-place script using the scripting language
+supported by Bean Scripting Framework (http://jakarta.apache.org/bsf).
+The script itself is the element's character data (often, inside
+a CDATA block).
+
+The default language is jython, though this can be overridden.
+
+Attributes:
+  name: The name of the component parameter to bind.
+  language: The language the script is written in.
+-->
+<!ELEMENT listener-binding (#PCDATA)>
+<!ATTLIST listener-binding
+	name CDATA #REQUIRED
+	language CDATA #IMPLIED
+>
+<!-- =======================================================
+Element: page-specification
+Root element
+
+A page specification.  It's attributes define the Java class to
+instantiate.  Pages are like components, except they always allow
+a body, and never allow parameters (formal or otherwise).
+
+Attributes:
+  class: The Java class to instantiate for the component.
+-->
+<!ELEMENT page-specification (description?, property*, (bean | component | external-asset | context-asset | private-asset | property-specification)*)>
+<!ATTLIST page-specification
+	class CDATA #IMPLIED
+>
+<!-- =======================================================
+Element: parameter
+Contained by: component-specification
+
+Defines a formal parameter for the component.
+
+Attributes:
+  name: A unique name for the parameter.
+  type: The name of a Java class or primitive type expected by the parameter.
+  required: If yes, then the parameter must be bound.  If no (the default),
+    then the parameter is optional.
+  property-name: The name to use, instead of the parameter name, for the
+    JavaBean property connected to this parameter.
+  direction: The normal flow of data through the component
+  			(in, form, custom, auto).
+  default-value: Specifies the default value for the parameter,
+  				if the parameter is not bound.
+-->
+<!ELEMENT parameter (description?)>
+<!ATTLIST parameter
+	name CDATA #REQUIRED
+	type CDATA #IMPLIED
+	required %attribute-flag; "no"
+	property-name CDATA #IMPLIED
+	default-value CDATA #IMPLIED
+	direction (in | form | custom | auto) "custom"
+>
+<!-- =======================================================
+Element: private-asset
+Contained by: component-specification, page-specification
+
+An asset available within the Java classpath (i.e., bundled inside a JAR or WAR).
+
+Attributes:
+  name: The name of the asset.
+  resource-path: The complete pathname of the resource.
+-->
+<!ELEMENT private-asset (property*)>
+<!ATTLIST private-asset
+	name CDATA #REQUIRED
+	resource-path CDATA #REQUIRED
+>
+<!-- =======================================================
+Element: property
+Contained by: (many other elements)
+
+Defines a key/value pair associated with the application or component specification.  Properties
+are used to capture information that doesn't fit into the DTD.  The value for the property is
+the PCDATA wrapped by the property tag (which is trimmed of leading and trailing whitespace).
+
+This should not be confused with several other tags which are used to set JavaBeans properties
+of various objects.  The <property> tag exists to allow meta-data to be stored in the specification.
+
+Attributes:
+  name: The name of the property to set.
+  value: If specified, is the value of the property, otherwise, the PCDATA is used.
+
+-->
+<!ELEMENT property (#PCDATA)>
+<!ATTLIST property
+	name CDATA #REQUIRED
+	value CDATA #IMPLIED
+>
+<!-- =======================================================
+Element: property-specification
+Appears in: page-specification, component-specification
+
+Identifies a transient or persistent property.
+
+Attributes:
+  name: The name of the property.
+  type: The type of the value, either the name of a scalar type,
+    or the fully qualified name of a class.  If omitted,
+    java.lang.Object is used.
+  persistent: If "yes", the value will be made persistant.  Default
+    is "no".
+  initial-value:  If provided, this is an OGNL expression used
+    to initialize the property.  If not specified, the
+    body of the element is used as the initial value.
+
+-->
+<!ELEMENT property-specification (#PCDATA)>
+<!ATTLIST property-specification
+	name CDATA #REQUIRED
+	type CDATA #IMPLIED
+	persistent %attribute-flag; "no"
+	initial-value CDATA #IMPLIED
+>
+<!-- =======================================================
+Element: reserved-parameter
+Appears in: component-specification
+
+Identifies a name which may not be used as an informal parameter.
+Informal parameters are typically HTML attribute names; this
+list identifies HTML attributes that are written exclusively
+by the component and may not be affected by informal parameters.
+
+Attributes:
+  name: The parameter name to reserve.
+-->
+<!ELEMENT reserved-parameter EMPTY>
+<!ATTLIST reserved-parameter
+	name CDATA #REQUIRED
+>
+<!-- =======================================================
+Element: service
+Appears in: application
+
+Defines an engine service.  You may override the default
+set of engine services or provide completely new services.
+
+Attributes:
+  name: The name of the service.
+  class: The Java class to instantiate for the service.
+
+-->
+<!ELEMENT service EMPTY>
+<!ATTLIST service
+	name CDATA #REQUIRED
+	class CDATA #REQUIRED
+>
+<!-- =======================================================
+Element: set-property
+Appears in: bean
+
+Used to initialize a property of a helper bean.  An OGNL expression
+is provided as the expression attribute, or as wrapped
+character data.
+
+Attributes:
+  name: The name of the property to be set.
+  expression: The OGNL expression that provides a value.
+-->
+<!ELEMENT set-property (#PCDATA)>
+<!ATTLIST set-property
+	name CDATA #REQUIRED
+	expression CDATA #IMPLIED
+>
+<!-- =======================================================
+Element: set-message-property
+Appears in: bean
+
+A localized string.
+
+Attributes:
+  key:  Sets a property of a string from a localized string.
+
+-->
+<!ELEMENT set-message-property EMPTY>
+<!ATTLIST set-message-property
+	name CDATA #REQUIRED
+	key CDATA #REQUIRED
+>
+<!-- =======================================================
+Element: static-binding
+Appears in: component
+
+Binds a parameter of the component to a static value defined directly
+within this specification. The value either the value ttribute, or
+the PCDATA wrapped by the element (with leading and trailing whitespace removed).
+
+Attributes:
+  name: The name of the component parameter to bind.
+  value: The value of the binding.  If not specied, the PCDATA wrapped
+    by the element is the binding.
+-->
+<!ELEMENT static-binding (#PCDATA)>
+<!ATTLIST static-binding
+	name CDATA #REQUIRED
+	value CDATA #IMPLIED
+>
+<!-- =======================================================
+Element: message-binding
+Appears in: component
+
+Binds a parameter of the component to a localized message of
+its container.
+
+Attributes:
+  name: The name of the component parameter to bind.
+  key: The key used to access a localized string.
+
+-->
+<!ELEMENT message-binding EMPTY>
+<!ATTLIST message-binding
+	name CDATA #REQUIRED
+	key CDATA #REQUIRED
+>
diff --git a/xml/tests/testData/xml/UnboundNsHighlighting.xml b/xml/tests/testData/xml/UnboundNsHighlighting.xml
new file mode 100644
index 0000000..41b129b
--- /dev/null
+++ b/xml/tests/testData/xml/UnboundNsHighlighting.xml
@@ -0,0 +1,6 @@
+<<error>a</error>:b>
+  <<error>a</error>:c/>
+  <xml:a></xml:a>
+  <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"/>
+  <jsp:root xmlns:jsp="<error></error>" version="2.0"/>
+</<error>a</error>:b>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnboundNsHighlighting2.xml b/xml/tests/testData/xml/UnboundNsHighlighting2.xml
new file mode 100644
index 0000000..1ca02e1
--- /dev/null
+++ b/xml/tests/testData/xml/UnboundNsHighlighting2.xml
@@ -0,0 +1 @@
+<<error>xs<caret>d</error>:schema/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnboundNsHighlighting2_after.xml b/xml/tests/testData/xml/UnboundNsHighlighting2_after.xml
new file mode 100644
index 0000000..54a7be1
--- /dev/null
+++ b/xml/tests/testData/xml/UnboundNsHighlighting2_after.xml
@@ -0,0 +1 @@
+<xs<caret>d:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnboundNsHighlighting3.xml b/xml/tests/testData/xml/UnboundNsHighlighting3.xml
new file mode 100644
index 0000000..a89134c
--- /dev/null
+++ b/xml/tests/testData/xml/UnboundNsHighlighting3.xml
@@ -0,0 +1 @@
+<html <error>x<caret>xx</error>:something="blubb" />
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnboundNsHighlighting3_after.xml b/xml/tests/testData/xml/UnboundNsHighlighting3_after.xml
new file mode 100644
index 0000000..7f3c2d7
--- /dev/null
+++ b/xml/tests/testData/xml/UnboundNsHighlighting3_after.xml
@@ -0,0 +1 @@
+<html xxx:something="blubb" xmlns:xxx="<caret><selection>someuri</selection>"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnboundNsHighlighting4.dtd b/xml/tests/testData/xml/UnboundNsHighlighting4.dtd
new file mode 100644
index 0000000..4f35c2f
--- /dev/null
+++ b/xml/tests/testData/xml/UnboundNsHighlighting4.dtd
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!-- Authors: Chris Taylor, Ceki Gulcu. -->
+
+<!-- A configuration element consists of optional renderer
+elements,appender elements, categories and an optional root
+element. -->
+
+<!ELEMENT log4j:configuration (renderer*, appender*,category*,root?)>
+
+<!-- The disable attribute takes a priority value such that all -->
+<!-- logging statements with a prioroty equal or below this value are -->
+<!-- disabled. -->
+
+<!-- The disableOverride attribute allows the user to override any   -->
+<!-- BasicConfigurator.disable invocations made from within the      -->
+<!-- application.                                                    -->
+
+<!-- By default, disableOverride is "null", meaning that we          -->
+<!-- do not touch the disable flag.                                  -->
+
+<!-- Setting the "debug" or "configDebug" attributes enable the printing -->
+<!-- of internal log4j logging statements.                               -->
+<!-- The "debug" and "configDebug" attributes are equivalent altough     -->
+<!-- the latter is deprecated and should no longer be used.              -->
+<!-- By default, debug and configDebug attributes are "null", meaning    -->
+<!-- that we not touch internal log4j logging settings.                  -->
+
+
+<!ATTLIST log4j:configuration
+  xmlns:log4j              CDATA #FIXED "http://jakarta.apache.org/log4j/"
+  disable                  (debug|info|warn|error|fatal|null)  "null"
+  disableOverride          (true|false|null)  "null"
+  debug                    (true|false|null)  "null"
+  configDebug              (true|false|null)  "null"
+>
+
+
+<!-- DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED -->
+<!-- WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING   -->
+<!-- DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED -->
+
+<!-- Use "log4j:configuration" above instead of the "configuration" -->
+<!-- element. -->
+
+<!-- DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED -->
+<!-- WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING   -->
+<!-- DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED -->
+
+<!ELEMENT configuration (renderer*, appender*,category*,root?)>
+<!ATTLIST configuration
+  disable                  (debug|info|warn|error|fatal|null)  "null"
+  disableOverride          (true|false|null)  "null"
+  configDebug              (true|false|null)  "null"
+>
+
+
+<!-- renderer elements allow the user to customize the conversion of  -->
+<!-- message objects to String.                                       -->
+
+<!ELEMENT renderer EMPTY>
+<!ATTLIST renderer
+  renderedClass  CDATA #REQUIRED
+  renderingClass CDATA #REQUIRED
+>
+
+<!-- Appenders must have a name and a class. -->
+<!-- Appenders may contain an error handler, a layout, optional parameters -->
+<!-- and filters. They may also reference (or include) other appenders. -->
+<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)>
+<!ATTLIST appender
+  name 		ID 	#REQUIRED
+  class 	CDATA	#REQUIRED
+>
+
+<!ELEMENT layout (param*)>
+<!ATTLIST layout
+  class		CDATA	#REQUIRED
+>
+
+
+
+<!ELEMENT filter (param*)>
+<!ATTLIST filter
+  class		CDATA	#REQUIRED
+>
+
+
+<!-- ErrorHandlers can be of any class. They can admit any number of -->
+<!-- parameters. -->
+
+<!ELEMENT errorHandler (param*)>
+<!ATTLIST errorHandler
+   class        CDATA   #REQUIRED
+>
+
+
+
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+  name		CDATA   #REQUIRED
+  value		CDATA	#REQUIRED
+>
+
+<!-- The priority class is org.apache.log4j.Priority by default -->
+<!ELEMENT priority (param*)>
+<!ATTLIST priority
+  class   CDATA	#IMPLIED
+  value	  CDATA #REQUIRED
+>
+
+<!-- If no priority element is specified, then the configurator MUST not -->
+<!-- touch the priority of the named category. -->
+<!ELEMENT category (param*, priority?, appender-ref*)>
+<!ATTLIST category
+  class         CDATA   #IMPLIED
+  name		CDATA	#REQUIRED
+  additivity	(true|false) "true"
+>
+
+<!ELEMENT appender-ref EMPTY>
+<!ATTLIST appender-ref
+  ref IDREF #REQUIRED
+>
+
+<!-- If no priority element is specified, then the configurator MUST not -->
+<!-- touch the priority of root. -->
+<!-- The root category always exists and cannot be subclassed. -->
+<!ELEMENT root (param*, priority?, appender-ref*)>
+
+
+
+<!-- ==================================================================== -->
+<!--                       A logging event                                -->
+<!-- ==================================================================== -->
+<!ELEMENT log4j:eventSet (log4j:event*)>
+<!ATTLIST log4j:eventSet
+  includesLocationInfo   (true|false) "true"
+>
+
+
+
+<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?,
+                       log4j:locationInfo?) >
+
+<!-- The timestamp format is application dependent. -->
+<!ATTLIST log4j:event
+    category   CDATA #REQUIRED
+    priority   CDATA #REQUIRED
+    thread     CDATA #REQUIRED
+    timestamp  CDATA #REQUIRED
+>
+
+<!ELEMENT log4j:message (#PCDATA)>
+<!ELEMENT log4j:NDC (#PCDATA)>
+
+<!ELEMENT log4j:throwable (#PCDATA)>
+
+<!ELEMENT log4j:locationInfo EMPTY>
+<!ATTLIST log4j:locationInfo
+  class  CDATA	#REQUIRED
+  method CDATA	#REQUIRED
+  file   CDATA	#REQUIRED
+  line   CDATA	#REQUIRED
+>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnboundNsHighlighting4.xml b/xml/tests/testData/xml/UnboundNsHighlighting4.xml
new file mode 100644
index 0000000..c14e8f8
--- /dev/null
+++ b/xml/tests/testData/xml/UnboundNsHighlighting4.xml
@@ -0,0 +1,19 @@
+<?xml version='1.0' encoding='ISO-8859-1' ?>
+<!DOCTYPE log4j:configuration SYSTEM "file:./UnboundNsHighlighting4.dtd">
+
+<log4j:configuration>
+  <appender name="CONSOLE-WARN" class="org.apache.log4j.ConsoleAppender">
+    <param name="target" value="System.err"/>
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="[%7r] %6p - %30.30c - %m \n"/>
+    </layout>
+    <filter class="org.apache.log4j.varia.LevelRangeFilter">
+      <param name="LevelMin" value="WARN"/>
+    </filter>
+  </appender>
+
+  <root>
+    <priority value="INFO"/>
+    <appender-ref ref="CONSOLE-WARN"/>
+  </root>
+</log4j:configuration>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnboundNsHighlighting5.xml b/xml/tests/testData/xml/UnboundNsHighlighting5.xml
new file mode 100644
index 0000000..12f636e
--- /dev/null
+++ b/xml/tests/testData/xml/UnboundNsHighlighting5.xml
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='ISO-8859-1' ?>
+<<error>x</error>:web-app version="2.4"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnboundNsHighlighting5_after.xml b/xml/tests/testData/xml/UnboundNsHighlighting5_after.xml
new file mode 100644
index 0000000..3352b35
--- /dev/null
+++ b/xml/tests/testData/xml/UnboundNsHighlighting5_after.xml
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='ISO-8859-1' ?>
+<x:web-app version="2.4" xmlns:x="http://java.sun.com/xml/ns/j2ee"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnboundNsHighlighting6.xml b/xml/tests/testData/xml/UnboundNsHighlighting6.xml
new file mode 100644
index 0000000..2d2f7a4
--- /dev/null
+++ b/xml/tests/testData/xml/UnboundNsHighlighting6.xml
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='ISO-8859-1' ?>
+<<info>web-app</info> version="2.4"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnboundNsHighlighting6_after.xml b/xml/tests/testData/xml/UnboundNsHighlighting6_after.xml
new file mode 100644
index 0000000..4b8a1ca
--- /dev/null
+++ b/xml/tests/testData/xml/UnboundNsHighlighting6_after.xml
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='ISO-8859-1' ?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"/>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnqualifiedAttributePsi.xml b/xml/tests/testData/xml/UnqualifiedAttributePsi.xml
new file mode 100644
index 0000000..38e842c
--- /dev/null
+++ b/xml/tests/testData/xml/UnqualifiedAttributePsi.xml
@@ -0,0 +1,3 @@
+<x xmlns='<error>foo</error>' a='bar' xmlns:z='<error>foo2</error>' z:b='bar'>
+  <z2:x xmlns='<error>foo3</error>' a2='bar' xmlns:z2='<error>foo4</error>' z2:b2='bar2'/>
+</x>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnresolvedDtdElementReferences.dtd b/xml/tests/testData/xml/UnresolvedDtdElementReferences.dtd
new file mode 100644
index 0000000..cc9443a
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdElementReferences.dtd
@@ -0,0 +1,2 @@
+<!ELEMENT name (<error>aaa</error>)>
+<!ELEMENT name2 (&<error>entity</error>;)>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml.xml b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml.xml
new file mode 100644
index 0000000..140bd0f
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE name [
+  <!ELEMENT name (<error>aaa</error>)>
+  <!ELEMENT name2 (%<error>entity</error>;)>
+]>
+<name></name>
diff --git a/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml2.xml b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml2.xml
new file mode 100644
index 0000000..a26e936
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml2.xml
@@ -0,0 +1 @@
+<name>&<error>entity</error>;</name>
diff --git a/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml2_2.xml b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml2_2.xml
new file mode 100644
index 0000000..cf0334c
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml2_2.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<name>&<error>entity</error>;</name>
diff --git a/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml2_2_after.xml b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml2_2_after.xml
new file mode 100644
index 0000000..9a20e10
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml2_2_after.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<!DOCTYPE name [
+<!ENTITY entity <caret>>
+]>
+<name>&entity;</name>
diff --git a/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml2_after.xml b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml2_after.xml
new file mode 100644
index 0000000..5031383
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml2_after.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE name [
+<!ENTITY entity <caret>>
+]>
+<name>&entity;</name>
diff --git a/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml3.xml b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml3.xml
new file mode 100644
index 0000000..661fa5f
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml3.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE name SYSTEM "<error>aaa</error>">
+<name>&<error>entity</error>;</name>
diff --git a/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml3_after.xml b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml3_after.xml
new file mode 100644
index 0000000..190d62b
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml3_after.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE name SYSTEM "aaa" [
+<!ENTITY entity <caret>>
+]>
+<name>&entity;</name>
diff --git a/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml_after.xml b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml_after.xml
new file mode 100644
index 0000000..db6e297
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml_after.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE name [
+  <!ELEMENT aaa <caret>>
+  <!ELEMENT name (aaa)>
+  <!ELEMENT name2 (%entity;)>
+]>
+<name></name>
diff --git a/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml_after2.xml b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml_after2.xml
new file mode 100644
index 0000000..8748a68
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdElementReferencesInXml_after2.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE name [
+  <!ELEMENT aaa >
+  <!ELEMENT name (aaa)>
+  <!ENTITY % entity <caret>>
+  <!ELEMENT name2 (%entity;)>
+]>
+<name></name>
diff --git a/xml/tests/testData/xml/UnresolvedDtdElementReferences_after.dtd b/xml/tests/testData/xml/UnresolvedDtdElementReferences_after.dtd
new file mode 100644
index 0000000..073c8ff
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdElementReferences_after.dtd
@@ -0,0 +1,3 @@
+<!ELEMENT aaa <caret>>
+<!ELEMENT name (aaa)>
+<!ELEMENT name2 (&entity;)>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnresolvedDtdElementReferences_after2.dtd b/xml/tests/testData/xml/UnresolvedDtdElementReferences_after2.dtd
new file mode 100644
index 0000000..3d2a25a
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdElementReferences_after2.dtd
@@ -0,0 +1,4 @@
+<!ELEMENT aaa >
+<!ELEMENT name (aaa)>
+<!ENTITY entity <caret>>
+<!ELEMENT name2 (&entity;)>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnresolvedDtdEntityReference.dtd b/xml/tests/testData/xml/UnresolvedDtdEntityReference.dtd
new file mode 100644
index 0000000..09a77fd
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdEntityReference.dtd
@@ -0,0 +1 @@
+%<error>entity</error>;
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnresolvedDtdEntityReference_after.dtd b/xml/tests/testData/xml/UnresolvedDtdEntityReference_after.dtd
new file mode 100644
index 0000000..b15d3fa
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedDtdEntityReference_after.dtd
@@ -0,0 +1,2 @@
+<!ENTITY % entity <caret>>
+%entity;
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UnresolvedSymbolForForAttribute.xml b/xml/tests/testData/xml/UnresolvedSymbolForForAttribute.xml
new file mode 100644
index 0000000..e37ad3f
--- /dev/null
+++ b/xml/tests/testData/xml/UnresolvedSymbolForForAttribute.xml
@@ -0,0 +1 @@
+<x:foo for="abc" xmlns:x="<error>foo</error>" />
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UsingDtdReference.dtd b/xml/tests/testData/xml/UsingDtdReference.dtd
new file mode 100644
index 0000000..cda7865
--- /dev/null
+++ b/xml/tests/testData/xml/UsingDtdReference.dtd
@@ -0,0 +1,2 @@
+<!ENTITY % test2 SYSTEM "UsingDtdReference2.dtd">
+%test2;
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UsingDtdReference.xml b/xml/tests/testData/xml/UsingDtdReference.xml
new file mode 100644
index 0000000..c5e2d2a
--- /dev/null
+++ b/xml/tests/testData/xml/UsingDtdReference.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!DOCTYPE root [
+ <!ENTITY % testDTD SYSTEM "UsingDtdReference.dtd">
+        %testDTD;
+]>
+<root>
+  <entry>blah</entry>
+</root>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UsingDtdReference2.dtd b/xml/tests/testData/xml/UsingDtdReference2.dtd
new file mode 100644
index 0000000..464de8e
--- /dev/null
+++ b/xml/tests/testData/xml/UsingDtdReference2.dtd
@@ -0,0 +1,3 @@
+<!ELEMENT root (entry+)>
+
+<!ELEMENT entry (#PCDATA)>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/UsingSchemaDtd.xsd b/xml/tests/testData/xml/UsingSchemaDtd.xsd
new file mode 100644
index 0000000..6a8854c
--- /dev/null
+++ b/xml/tests/testData/xml/UsingSchemaDtd.xsd
@@ -0,0 +1,318 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE schema
+  PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
+ [
+   <!ATTLIST schema
+     xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
+   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
+   <!ENTITY % p ''>
+   <!ENTITY % s ''>
+  ]>
+
+<!-- Schema for XML Signatures
+    http://www.w3.org/2000/09/xmldsig#
+    $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
+
+    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
+    of Technology, Institut National de Recherche en Informatique et en
+    Automatique, Keio University). All Rights Reserved.
+    http://www.w3.org/Consortium/Legal/
+
+    This document is governed by the W3C Software License [1] as described
+    in the FAQ [2].
+
+    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
+        targetNamespace="http://www.w3.org/2000/09/xmldsig#"
+        version="0.1" elementFormDefault="qualified">
+
+<!-- Basic Types Defined for Signatures -->
+
+<simpleType name="CryptoBinary">
+  <restriction base="base64Binary">
+  </restriction>
+</simpleType>
+
+<!-- Start Signature -->
+
+<element name="Signature" type="ds:SignatureType"/>
+<complexType name="SignatureType">
+  <sequence>
+    <element ref="ds:SignedInfo"/>
+    <element ref="ds:SignatureValue"/>
+    <element ref="ds:KeyInfo" minOccurs="0"/>
+    <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="SignatureValue" type="ds:SignatureValueType"/>
+  <complexType name="SignatureValueType">
+    <simpleContent>
+      <extension base="base64Binary">
+        <attribute name="Id" type="ID" use="optional"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+<!-- Start SignedInfo -->
+
+<element name="SignedInfo" type="ds:SignedInfoType"/>
+<complexType name="SignedInfoType">
+  <sequence>
+    <element ref="ds:CanonicalizationMethod"/>
+    <element ref="ds:SignatureMethod"/>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
+  <complexType name="CanonicalizationMethodType" mixed="true">
+    <sequence>
+      <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+  <element name="SignatureMethod" type="ds:SignatureMethodType"/>
+  <complexType name="SignatureMethodType" mixed="true">
+    <sequence>
+      <element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
+      <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- (0,unbounded) elements from (1,1) external namespace -->
+    </sequence>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- Start Reference -->
+
+<element name="Reference" type="ds:ReferenceType"/>
+<complexType name="ReferenceType">
+  <sequence>
+    <element ref="ds:Transforms" minOccurs="0"/>
+    <element ref="ds:DigestMethod"/>
+    <element ref="ds:DigestValue"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="URI" type="anyURI" use="optional"/>
+  <attribute name="Type" type="anyURI" use="optional"/>
+</complexType>
+
+  <element name="Transforms" type="ds:TransformsType"/>
+  <complexType name="TransformsType">
+    <sequence>
+      <element ref="ds:Transform" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+
+  <element name="Transform" type="ds:TransformType"/>
+  <complexType name="TransformType" mixed="true">
+    <choice minOccurs="0" maxOccurs="unbounded">
+      <any namespace="##other" processContents="lax"/>
+      <!-- (1,1) elements from (0,unbounded) namespaces -->
+      <element name="XPath" type="string"/>
+    </choice>
+    <attribute name="Algorithm" type="anyURI" use="required"/>
+  </complexType>
+
+<!-- End Reference -->
+
+<element name="DigestMethod" type="ds:DigestMethodType"/>
+<complexType name="DigestMethodType" mixed="true">
+  <sequence>
+    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Algorithm" type="anyURI" use="required"/>
+</complexType>
+
+<element name="DigestValue" type="ds:DigestValueType"/>
+<simpleType name="DigestValueType">
+  <restriction base="base64Binary"/>
+</simpleType>
+
+<!-- End SignedInfo -->
+
+<!-- Start KeyInfo -->
+
+<element name="KeyInfo" type="ds:KeyInfoType"/>
+<complexType name="KeyInfoType" mixed="true">
+  <choice maxOccurs="unbounded">
+    <element ref="ds:KeyName"/>
+    <element ref="ds:KeyValue"/>
+    <element ref="ds:RetrievalMethod"/>
+    <element ref="ds:X509Data"/>
+    <element ref="ds:PGPData"/>
+    <element ref="ds:SPKIData"/>
+    <element ref="ds:MgmtData"/>
+    <any processContents="lax" namespace="##other"/>
+    <!-- (1,1) elements from (0,unbounded) namespaces -->
+  </choice>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+  <element name="KeyName" type="string"/>
+  <element name="MgmtData" type="string"/>
+
+  <element name="KeyValue" type="ds:KeyValueType"/>
+  <complexType name="KeyValueType" mixed="true">
+   <choice>
+     <element ref="ds:DSAKeyValue"/>
+     <element ref="ds:RSAKeyValue"/>
+     <any namespace="##other" processContents="lax"/>
+   </choice>
+  </complexType>
+
+  <element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
+  <complexType name="RetrievalMethodType">
+    <sequence>
+      <element ref="ds:Transforms" minOccurs="0"/>
+    </sequence>
+    <attribute name="URI" type="anyURI"/>
+    <attribute name="Type" type="anyURI" use="optional"/>
+  </complexType>
+
+<!-- Start X509Data -->
+
+<element name="X509Data" type="ds:X509DataType"/>
+<complexType name="X509DataType">
+  <sequence maxOccurs="unbounded">
+    <choice>
+      <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
+      <element name="X509SKI" type="base64Binary"/>
+      <element name="X509SubjectName" type="string"/>
+      <element name="X509Certificate" type="base64Binary"/>
+      <element name="X509CRL" type="base64Binary"/>
+      <any namespace="##other" processContents="lax"/>
+    </choice>
+  </sequence>
+</complexType>
+
+<complexType name="X509IssuerSerialType">
+  <sequence>
+    <element name="X509IssuerName" type="string"/>
+    <element name="X509SerialNumber" type="integer"/>
+  </sequence>
+</complexType>
+
+<!-- End X509Data -->
+
+<!-- Begin PGPData -->
+
+<element name="PGPData" type="ds:PGPDataType"/>
+<complexType name="PGPDataType">
+  <choice>
+    <sequence>
+      <element name="PGPKeyID" type="base64Binary"/>
+      <element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+    <sequence>
+      <element name="PGPKeyPacket" type="base64Binary"/>
+      <any namespace="##other" processContents="lax" minOccurs="0"
+       maxOccurs="unbounded"/>
+    </sequence>
+  </choice>
+</complexType>
+
+<!-- End PGPData -->
+
+<!-- Begin SPKIData -->
+
+<element name="SPKIData" type="ds:SPKIDataType"/>
+<complexType name="SPKIDataType">
+  <sequence maxOccurs="unbounded">
+    <element name="SPKISexp" type="base64Binary"/>
+    <any namespace="##other" processContents="lax" minOccurs="0"/>
+  </sequence>
+</complexType>
+
+<!-- End SPKIData -->
+
+<!-- End KeyInfo -->
+
+<!-- Start Object (Manifest, SignatureProperty) -->
+
+<element name="Object" type="ds:ObjectType"/>
+<complexType name="ObjectType" mixed="true">
+  <sequence minOccurs="0" maxOccurs="unbounded">
+    <any namespace="##any" processContents="lax"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+  <attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
+  <attribute name="Encoding" type="anyURI" use="optional"/>
+</complexType>
+
+<element name="Manifest" type="ds:ManifestType"/>
+<complexType name="ManifestType">
+  <sequence>
+    <element ref="ds:Reference" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
+<complexType name="SignaturePropertiesType">
+  <sequence>
+    <element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
+  </sequence>
+  <attribute name="Id" type="ID" use="optional"/>
+</complexType>
+
+   <element name="SignatureProperty" type="ds:SignaturePropertyType"/>
+   <complexType name="SignaturePropertyType" mixed="true">
+     <choice maxOccurs="unbounded">
+       <any namespace="##other" processContents="lax"/>
+       <!-- (1,1) elements from (1,unbounded) namespaces -->
+     </choice>
+     <attribute name="Target" type="anyURI" use="required"/>
+     <attribute name="Id" type="ID" use="optional"/>
+   </complexType>
+
+<!-- End Object (Manifest, SignatureProperty) -->
+
+<!-- Start Algorithm Parameters -->
+
+<simpleType name="HMACOutputLengthType">
+  <restriction base="integer"/>
+</simpleType>
+
+<!-- Start KeyValue Element-types -->
+
+<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
+<complexType name="DSAKeyValueType">
+  <sequence>
+    <sequence minOccurs="0">
+      <element name="P" type="ds:CryptoBinary"/>
+      <element name="Q" type="ds:CryptoBinary"/>
+    </sequence>
+    <element name="G" type="ds:CryptoBinary" minOccurs="0"/>
+    <element name="Y" type="ds:CryptoBinary"/>
+    <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
+    <sequence minOccurs="0">
+      <element name="Seed" type="ds:CryptoBinary"/>
+      <element name="PgenCounter" type="ds:CryptoBinary"/>
+    </sequence>
+  </sequence>
+</complexType>
+
+<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
+<complexType name="RSAKeyValueType">
+  <sequence>
+    <element name="Modulus" type="ds:CryptoBinary"/>
+    <element name="Exponent" type="ds:CryptoBinary"/>
+  </sequence>
+</complexType>
+
+<!-- End KeyValue Element-types -->
+
+<!-- End Signature -->
+
+</schema>
diff --git a/xml/tests/testData/xml/ValidationOfDtdFile.dtd b/xml/tests/testData/xml/ValidationOfDtdFile.dtd
new file mode 100644
index 0000000..4c8525c
--- /dev/null
+++ b/xml/tests/testData/xml/ValidationOfDtdFile.dtd
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!ELEMENT idea-plugin EMPTY>
+<!ATTLIST idea-plugin
+    url CDATA #IMPLIED>
diff --git a/xml/tests/testData/xml/WebApp.xml b/xml/tests/testData/xml/WebApp.xml
new file mode 100644
index 0000000..2982ee1
--- /dev/null
+++ b/xml/tests/testData/xml/WebApp.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
+<ejb-jar>
+  <<error>enterprise-beans</error>>
+  </<error>enterprise-beans</error>>
+</ejb-jar>
diff --git a/xml/tests/testData/xml/WrongRegExpInSchema.xsd b/xml/tests/testData/xml/WrongRegExpInSchema.xsd
new file mode 100644
index 0000000..d458eff
--- /dev/null
+++ b/xml/tests/testData/xml/WrongRegExpInSchema.xsd
@@ -0,0 +1,13 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+<xs:simpleType name="TestType">
+<xs:restriction base="xs:string">
+<xs:pattern value="<error>[0-9]+-([0-9]+|*)</error>"/>
+</xs:restriction>
+</xs:simpleType>
+<xs:simpleType name="TestType2">
+  <xs:restriction base="xs:string">
+  <xs:pattern value="[0-9]+-([0-9]+|.*)"/>
+  </xs:restriction>
+</xs:simpleType>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/WrongRegExpInSchema2.xsd b/xml/tests/testData/xml/WrongRegExpInSchema2.xsd
new file mode 100644
index 0000000..1e149ef
--- /dev/null
+++ b/xml/tests/testData/xml/WrongRegExpInSchema2.xsd
@@ -0,0 +1,17 @@
+<schema xmlns="http://www.w3.org/2001/XMLSchema">
+  <simpleType name="element-names">
+      <list>
+        <simpleType>
+          <union memberTypes="QName">
+            <simpleType>
+              <restriction base="string">
+                <pattern value="\*"/>
+                <pattern value="\i\l\c*:\*"/>
+                <pattern value="\\l\\c*:\*"/>
+              </restriction>
+            </simpleType>
+          </union>
+        </simpleType>
+      </list>
+    </simpleType>
+</schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/WsdlValidation.wsdl b/xml/tests/testData/xml/WsdlValidation.wsdl
new file mode 100644
index 0000000..f9edec6
--- /dev/null
+++ b/xml/tests/testData/xml/WsdlValidation.wsdl
@@ -0,0 +1,353 @@
+<?xml version="1.0" ?>
+
+<definitions targetNamespace="urn:PegaRULES:SOAP:Ticketing:V20100113"
+	xmlns:tns="urn:PegaRULES:SOAP:Ticketing:V20100113"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+	xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+	xmlns:ns1="urn:Ticketing-Data-Service-CreateTicketRequest:pyXMLPage"
+	xmlns:ns2="urn:Ticketing-Data-Service-CreateTicketResponse:pyXMLPage"
+	xmlns:ns3="urn:Ticketing-Data-Service-RetrieveTicketRequest:pyXMLPage"
+	xmlns:ns4="urn:Ticketing-Data-Service-RetrieveTicketResponse:pyXMLPage"
+	xmlns:ns5="urn:Ticketing-Data-Service-searchTicketRequest:pyXMLPage"
+	xmlns:ns6="urn:Ticketing-Data-Service-searchTicketResponse:pyXMLPage"
+	xmlns:ns7="urn:Ticketing-Data-Service-ApplicationData:pyDefault"
+	xmlns:ns8="urn:Ticketing-Data-Service-TicketingData:pyDefault"
+	xmlns:ns9="urn:Ticketing-Data-Service-TicketingException:pyDefault"
+	xmlns:ns10="urn:Ticketing-Data-Service-Contact:pyDefault"
+	xmlns:ns11="urn:Ticketing-Data-Service-TicketSubject:pyDefault"
+	xmlns:ns12="urn:Ticketing-Data-Service-TicketSummary:pyDefault"
+	xmlns:ns13="urn:Ticketing-Data-Service-AppDataElement:pyDefault"
+	xmlns:ns14="urn:Ticketing-Data-Service-AppDataTable:pyDefault"
+	xmlns:ns15="urn:Ticketing-Data-Service-AppDataRow:pyDefault"
+	xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+	<types>
+		<schema targetNamespace="urn:Ticketing-Data-Service-CreateTicketRequest:pyXMLPage"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<import namespace="urn:Ticketing-Data-Service-ApplicationData:pyDefault"/>
+			<import namespace="urn:Ticketing-Data-Service-TicketingData:pyDefault"/>
+			<complexType name="pagedata">
+				<sequence>
+					<element name="appData" minOccurs="0" type="ns7:pagedata"/>
+					<element name="ticketingData" minOccurs="0" type="ns8:pagedata"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-CreateTicketResponse:pyXMLPage"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<import namespace="urn:Ticketing-Data-Service-TicketingException:pyDefault"/>
+			<complexType name="pagedata">
+				<sequence>
+					<element name="caseId" minOccurs="0" type="xsd:string"/>
+					<element name="errorResponse" minOccurs="0" maxOccurs="unbounded" type="ns9:pagedata"/>
+					<element name="ticketId" minOccurs="0" maxOccurs="unbounded" type="xsd:string"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-RetrieveTicketRequest:pyXMLPage"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<complexType name="pagedata">
+				<sequence>
+					<element name="ticketId" minOccurs="0" type="xsd:string"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-RetrieveTicketResponse:pyXMLPage"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<import namespace="urn:Ticketing-Data-Service-ApplicationData:pyDefault"/>
+			<import namespace="urn:Ticketing-Data-Service-TicketingException:pyDefault"/>
+			<import namespace="urn:Ticketing-Data-Service-TicketingData:pyDefault"/>
+			<complexType name="pagedata">
+				<sequence>
+					<element name="appData" minOccurs="0" type="ns7:pagedata"/>
+					<element name="errorResponse" minOccurs="0" maxOccurs="unbounded" type="ns9:pagedata"/>
+					<element name="status" minOccurs="0" type="xsd:string"/>
+					<element name="statusDateTime" minOccurs="0" type="xsd:dateTime"/>
+					<element name="ticketId" minOccurs="0" type="xsd:string"/>
+					<element name="ticketingData" minOccurs="0" type="ns8:pagedata"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-searchTicketRequest:pyXMLPage"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<import namespace="urn:Ticketing-Data-Service-Contact:pyDefault"/>
+			<import namespace="urn:Ticketing-Data-Service-TicketSubject:pyDefault"/>
+			<complexType name="pagedata">
+				<sequence>
+					<element name="businessDomain" minOccurs="0" type="xsd:string"/>
+					<element name="creator" minOccurs="0" type="ns10:pagedata"/>
+					<element name="requestor" minOccurs="0" type="ns10:pagedata"/>
+					<element name="ticketSubject" minOccurs="0" type="ns11:pagedata"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-searchTicketResponse:pyXMLPage"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<import namespace="urn:Ticketing-Data-Service-TicketingException:pyDefault"/>
+			<import namespace="urn:Ticketing-Data-Service-TicketSummary:pyDefault"/>
+			<complexType name="pagedata">
+				<sequence>
+					<element name="errorResponse" minOccurs="0" maxOccurs="unbounded" type="ns9:pagedata"/>
+					<element name="summary" minOccurs="0" maxOccurs="unbounded" type="ns12:pagedata"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-ApplicationData:pyDefault"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<import namespace="urn:Ticketing-Data-Service-AppDataElement:pyDefault"/>
+			<import namespace="urn:Ticketing-Data-Service-AppDataTable:pyDefault"/>
+			<complexType name="pagedata">
+				<sequence>
+					<element name="dataElement" minOccurs="0" maxOccurs="unbounded" type="ns13:pagedata"/>
+					<element name="tableElement" minOccurs="0" maxOccurs="unbounded" type="ns14:pagedata"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-TicketingData:pyDefault"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<import namespace="urn:Ticketing-Data-Service-Contact:pyDefault"/>
+			<import namespace="urn:Ticketing-Data-Service-TicketSubject:pyDefault"/>
+			<complexType name="pagedata">
+				<sequence>
+					<element name="businessDomain" minOccurs="0" type="xsd:string"/>
+					<element name="comment" minOccurs="0" type="xsd:string"/>
+					<element name="creator" minOccurs="0" type="ns10:pagedata"/>
+					<element name="event" minOccurs="0" type="xsd:string"/>
+					<element name="eventSubType" minOccurs="0" type="xsd:string"/>
+					<element name="longDescription" minOccurs="0" type="xsd:string"/>
+					<element name="referenceTag" minOccurs="0" type="xsd:string"/>
+					<element name="requestor" minOccurs="0" type="ns10:pagedata"/>
+					<element name="shortDescription" minOccurs="0" type="xsd:string"/>
+					<element name="templateName" minOccurs="0" type="xsd:string"/>
+					<element name="ticketPriority" minOccurs="0" type="xsd:string"/>
+					<element name="ticketSubject" minOccurs="0" type="ns11:pagedata"/>
+					<element name="ticketType" minOccurs="0" type="xsd:string"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-TicketingException:pyDefault"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<complexType name="pagedata">
+				<sequence>
+					<element name="code" minOccurs="0" type="xsd:string"/>
+					<element name="message" minOccurs="0" type="xsd:string"/>
+					<element name="severity" minOccurs="0" type="xsd:string"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-Contact:pyDefault"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<complexType name="pagedata">
+				<sequence>
+					<element name="alternatePhone" minOccurs="0" type="xsd:string"/>
+					<element name="contactId" minOccurs="0" type="xsd:string"/>
+					<element name="contactName" minOccurs="0" type="xsd:string"/>
+					<element name="contactType" minOccurs="0" type="xsd:string"/>
+					<element name="eMail" minOccurs="0" type="xsd:string"/>
+					<element name="phoneContactPreferred" minOccurs="0" type="xsd:boolean"/>
+					<element name="primaryPhone" minOccurs="0" type="xsd:string"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-TicketSubject:pyDefault"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<complexType name="pagedata">
+				<sequence>
+					<element name="accountId" minOccurs="0" type="xsd:string"/>
+					<element name="clientId" minOccurs="0" type="xsd:string"/>
+					<element name="domainKey" minOccurs="0" type="xsd:string"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-TicketSummary:pyDefault"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<import namespace="urn:Ticketing-Data-Service-Contact:pyDefault"/>
+			<import namespace="urn:Ticketing-Data-Service-TicketSubject:pyDefault"/>
+			<complexType name="pagedata">
+				<sequence>
+					<element name="businessDomain" minOccurs="0" type="xsd:string"/>
+					<element name="creator" minOccurs="0" type="ns10:pagedata"/>
+					<element name="requestor" minOccurs="0" type="ns10:pagedata"/>
+					<element name="shortDescription" minOccurs="0" type="xsd:string"/>
+					<element name="ticketId" minOccurs="0" type="xsd:string"/>
+					<element name="ticketSubject" minOccurs="0" type="ns11:pagedata"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-AppDataElement:pyDefault"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<complexType name="pagedata">
+				<sequence>
+					<element name="Value" minOccurs="0" type="xsd:string"/>
+					<element name="label" minOccurs="0" type="xsd:string"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-AppDataTable:pyDefault"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<import namespace="urn:Ticketing-Data-Service-AppDataRow:pyDefault"/>
+			<complexType name="pagedata">
+				<sequence>
+					<element name="dataRow" minOccurs="0" maxOccurs="unbounded" type="ns15:pagedata"/>
+					<element name="label" minOccurs="0" type="xsd:string"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:Ticketing-Data-Service-AppDataRow:pyDefault"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<import namespace="urn:Ticketing-Data-Service-AppDataElement:pyDefault"/>
+			<complexType name="pagedata">
+				<sequence>
+					<element name="columnData" minOccurs="0" maxOccurs="unbounded" type="ns13:pagedata"/>
+					<element name="rowId" minOccurs="0" type="xsd:long"/>
+				</sequence>
+			</complexType>
+		</schema>
+		<schema targetNamespace="urn:PegaRULES:SOAP:Ticketing:V20100113"
+			elementFormDefault="unqualified"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<import namespace="urn:Ticketing-Data-Service-CreateTicketRequest:pyXMLPage"/>
+			<import namespace="urn:Ticketing-Data-Service-CreateTicketResponse:pyXMLPage"/>
+			<import namespace="urn:Ticketing-Data-Service-RetrieveTicketRequest:pyXMLPage"/>
+			<import namespace="urn:Ticketing-Data-Service-RetrieveTicketResponse:pyXMLPage"/>
+			<import namespace="urn:Ticketing-Data-Service-searchTicketRequest:pyXMLPage"/>
+			<import namespace="urn:Ticketing-Data-Service-searchTicketResponse:pyXMLPage"/>
+			<element name="CreateTicket">
+				<complexType>
+					<sequence>
+							<element name="RequestData" type="ns1:pagedata"/>
+					</sequence>
+				</complexType>
+			</element>
+			<element name="CreateTicketResponse">
+				<complexType>
+					<sequence>
+							<element name="ResponseData" type="ns2:pagedata"/>
+					</sequence>
+				</complexType>
+			</element>
+			<element name="RetrieveTicket">
+				<complexType>
+					<sequence>
+							<element name="RequestData" type="ns3:pagedata"/>
+					</sequence>
+				</complexType>
+			</element>
+			<element name="RetrieveTicketResponse">
+				<complexType>
+					<sequence>
+							<element name="ResponseData" type="ns4:pagedata"/>
+					</sequence>
+				</complexType>
+			</element>
+			<element name="SearchTicket">
+				<complexType>
+					<sequence>
+							<element name="RequestData" type="ns5:pagedata"/>
+					</sequence>
+				</complexType>
+			</element>
+			<element name="SearchTicketResponse">
+				<complexType>
+					<sequence>
+							<element name="ResponseData" type="ns6:pagedata"/>
+					</sequence>
+				</complexType>
+			</element>
+		</schema>
+	</types>
+
+	<message name="CreateTicket">
+		<part name="parameters" element="tns:CreateTicket"/>
+	</message>
+
+	<message name="CreateTicketResponse">
+		<part name="parameters" element="tns:CreateTicketResponse"/>
+	</message>
+
+	<message name="RetrieveTicket">
+		<part name="parameters" element="tns:RetrieveTicket"/>
+	</message>
+
+	<message name="RetrieveTicketResponse">
+		<part name="parameters" element="tns:RetrieveTicketResponse"/>
+	</message>
+
+	<message name="SearchTicket">
+		<part name="parameters" element="tns:SearchTicket"/>
+	</message>
+
+	<message name="SearchTicketResponse">
+		<part name="parameters" element="tns:SearchTicketResponse"/>
+	</message>
+
+	<portType name="V20100113Type">
+		<operation name="CreateTicket">
+			<input message="tns:CreateTicket"/>
+			<output message="tns:CreateTicketResponse"/>
+		</operation>
+		<operation name="RetrieveTicket">
+			<input message="tns:RetrieveTicket"/>
+			<output message="tns:RetrieveTicketResponse"/>
+		</operation>
+		<operation name="SearchTicket">
+			<input message="tns:SearchTicket"/>
+			<output message="tns:SearchTicketResponse"/>
+		</operation>
+	</portType>
+
+	<binding name="V20100113Binding" type="tns:V20100113Type">
+		<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+		<operation name="CreateTicket">
+			<soap:operation style="document" soapAction="urn:PegaRULES:SOAP:Ticketing:V20100113#CreateTicket"/>
+			<input>
+				<soap:body use="literal"/>
+			</input>
+			<output>
+				<soap:body use="literal"/>
+			</output>
+		</operation>
+		<operation name="RetrieveTicket">
+			<soap:operation style="document" soapAction="urn:PegaRULES:SOAP:Ticketing:V20100113#RetrieveTicket"/>
+			<input>
+				<soap:body use="literal"/>
+			</input>
+			<output>
+				<soap:body use="literal"/>
+			</output>
+		</operation>
+		<operation name="SearchTicket">
+			<soap:operation style="document" soapAction="urn:PegaRULES:SOAP:Ticketing:V20100113#SearchTicket"/>
+			<input>
+				<soap:body use="literal"/>
+			</input>
+			<output>
+				<soap:body use="literal"/>
+			</output>
+		</operation>
+	</binding>
+
+	<service name="V20100113Service">
+		<port name="V20100113Port" binding="tns:V20100113Binding">
+			<soap:address location="http://tstw02-marish.tdbfg.com:8099/prweb/PRSOAPServlet"/>
+		</port>
+	</service>
+
+</definitions>
diff --git a/xml/tests/testData/xml/XHtmlValidation.xml b/xml/tests/testData/xml/XHtmlValidation.xml
new file mode 100644
index 0000000..6084860
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation.xml
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>Untitled Document</title>
+</head>
+
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XHtmlValidation2.xml b/xml/tests/testData/xml/XHtmlValidation2.xml
new file mode 100644
index 0000000..f8388e9
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation2.xml
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+<title>Untitled Document</title>
+</head>
+
+<body>
+</body>
+</html>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XHtmlValidation3.xml b/xml/tests/testData/xml/XHtmlValidation3.xml
new file mode 100644
index 0000000..d2cd59f
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML Basic 1.1//EN"
+ "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
+ <html xml:lang="en">
+ 
+ <head>
+ <title>City CarShare Reservation System</title>
+ </head>
+ <body>
+ <form <error>name</error>="loginForm" method="post" action="<%= request.getContextPath() %>/mlogin.do">
+ <table>
+ <tr>
+ <td align="right">Member ID:</td>
+ <td align="left"><input inputmode="latin digits" name="userid" value="" <error>CDATA</error>="aaa" <error>input</error>="zzz"/></td>
+ </tr>
+ </table>
+ </form>
+ </body>
+ </html>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-attribs-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-attribs-1.mod
new file mode 100644
index 0000000..839425e
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-attribs-1.mod
@@ -0,0 +1,142 @@
+<!-- ...................................................................... -->
+<!-- XHTML Common Attributes Module  ...................................... -->
+<!-- file: xhtml-attribs-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-attribs-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
+       SYSTEM "xhtml-attribs-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Common Attributes
+
+     This module declares many of the common attributes for the XHTML DTD.
+     %NS.decl.attrib; is declared in the XHTML Qname module.
+
+	 Note that this file was extended in XHTML Modularization Second Edition to 
+	 include declarations of "global" versions of the attribute collections.
+	 The global versions of the attributes are for use on elements in other 
+	 namespaces.  The global version of "common" includes the xmlns declaration
+	 for the prefixed version of the xhtml namespace.  If you are only using a
+	 specific attribute or an individual attribute collection, you must also
+	 include the XHTML.xmlns.attrib.prefixed PE on your elements.
+-->
+
+<!ENTITY % id.attrib
+     "id           ID                       #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.id.attrib
+     "%XHTML.prefix;:id           ID        #IMPLIED"
+>
+]]>
+
+<!ENTITY % class.attrib
+     "class        NMTOKENS                 #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.class.attrib
+     "%XHTML.prefix;:class        NMTOKENS                 #IMPLIED"
+>
+]]>
+
+<!ENTITY % title.attrib
+     "title        %Text.datatype;          #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.title.attrib
+     "%XHTML.prefix;:title        %Text.datatype;          #IMPLIED"
+>
+]]>
+
+<!ENTITY % Core.extra.attrib "" >
+
+<!ENTITY % Core.attrib
+     "%XHTML.xmlns.attrib;
+      %id.attrib;
+      %class.attrib;
+      %title.attrib;
+      xml:space    ( preserve )             #FIXED 'preserve'
+      %Core.extra.attrib;"
+>
+
+<!ENTITY % XHTML.global.core.extra.attrib "" >
+
+<![%XHTML.global.attrs.prefixed;[
+
+<!ENTITY % XHTML.global.core.attrib
+     "%XHTML.global.id.attrib;
+      %XHTML.global.class.attrib;
+      %XHTML.global.title.attrib;
+      %XHTML.global.core.extra.attrib;"
+>
+]]>
+
+<!ENTITY % XHTML.global.core.attrib "" >
+
+
+<!ENTITY % lang.attrib
+     "xml:lang     %LanguageCode.datatype;  #IMPLIED"
+>
+
+<![%XHTML.bidi;[
+<!ENTITY % dir.attrib
+     "dir          ( ltr | rtl )            #IMPLIED"
+>
+
+<!ENTITY % I18n.attrib
+     "%dir.attrib;
+      %lang.attrib;"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY XHTML.global.i18n.attrib
+     "%XHTML.prefix;:dir          ( ltr | rtl )            #IMPLIED
+      %lang.attrib;"
+>
+]]>
+<!ENTITY XHTML.global.i18n.attrib "" >
+
+]]>
+<!ENTITY % I18n.attrib
+     "%lang.attrib;"
+>
+<!ENTITY % XHTML.global.i18n.attrib
+     "%lang.attrib;"
+>
+
+<!ENTITY % Common.extra.attrib "" >
+<!ENTITY % XHTML.global.common.extra.attrib "" >
+
+<!-- intrinsic event attributes declared previously
+-->
+<!ENTITY % Events.attrib "" >
+
+<!ENTITY % XHTML.global.events.attrib "" >
+
+<!ENTITY % Common.attrib
+     "%Core.attrib;
+      %I18n.attrib;
+      %Events.attrib;
+      %Common.extra.attrib;"
+>
+
+<!ENTITY % XHTML.global.common.attrib
+     "%XHTML.xmlns.attrib.prefixed;
+      %XHTML.global.core.attrib;
+	  %XHTML.global.i18n.attrib;
+	  %XHTML.global.events.attrib;
+	  %XHTML.global.common.extra.attrib;"
+>
+
+<!-- end of xhtml-attribs-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-base-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-base-1.mod
new file mode 100644
index 0000000..47eed9f
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-base-1.mod
@@ -0,0 +1,53 @@
+<!-- ...................................................................... -->
+<!-- XHTML Base Element Module  ........................................... -->
+<!-- file: xhtml-base-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-base-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
+       SYSTEM "xhtml-base-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Base element
+
+        base
+
+     This module declares the base element type and its attributes,
+     used to define a base URI against which relative URIs in the
+     document will be resolved.
+
+     Note that this module also redeclares the content model for
+     the head element to include the base element.
+-->
+
+<!-- base: Document Base URI ........................... -->
+
+<!ENTITY % base.element  "INCLUDE" >
+<![%base.element;[
+<!ENTITY % base.content  "EMPTY" >
+<!ENTITY % base.qname  "base" >
+<!ELEMENT %base.qname;  %base.content; >
+<!-- end of base.element -->]]>
+
+<!ENTITY % base.attlist  "INCLUDE" >
+<![%base.attlist;[
+<!ATTLIST %base.qname;
+      %XHTML.xmlns.attrib;
+      href         %URI.datatype;           #REQUIRED
+>
+<!-- end of base.attlist -->]]>
+
+<!ENTITY % head.content
+    "( %HeadOpts.mix;,
+     ( ( %title.qname;, %HeadOpts.mix;, ( %base.qname;, %HeadOpts.mix; )? )
+     | ( %base.qname;, %HeadOpts.mix;, ( %title.qname;, %HeadOpts.mix; ))))"
+>
+
+<!-- end of xhtml-base-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-basic-table-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-basic-table-1.mod
new file mode 100644
index 0000000..ea73308
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-basic-table-1.mod
@@ -0,0 +1,167 @@
+<!-- ....................................................................... -->
+<!-- XHTML Basic Table Module  ............................................. -->
+<!-- file: xhtml-basic-table-1.mod
+
+     This is XHTML Basic, a proper subset of XHTML.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-basic-table-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN"
+       SYSTEM "xhtml-basic-table-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Basic Tables
+
+        table, caption, tr, th, td
+
+     This table module declares elements and attributes defining
+     a table model based fundamentally on features found in the
+     widely-deployed HTML 3.2 table model.  While this module
+     mimics the content model and table attributes of HTML 3.2
+     tables, the element types declared herein also includes all
+     HTML 4 common and most of the HTML 4 table attributes.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % table.qname  "table" >
+<!ENTITY % caption.qname  "caption" >
+<!ENTITY % tr.qname  "tr" >
+<!ENTITY % th.qname  "th" >
+<!ENTITY % td.qname  "td" >
+
+<!-- horizontal alignment attributes for cell contents
+-->
+<!ENTITY % CellHAlign.attrib
+     "align        ( left
+                   | center
+                   | right )                #IMPLIED"
+>
+
+<!-- vertical alignment attributes for cell contents
+-->
+<!ENTITY % CellVAlign.attrib
+     "valign       ( top
+                   | middle
+                   | bottom )               #IMPLIED"
+>
+
+<!-- scope is simpler than axes attribute for common tables
+-->
+<!ENTITY % scope.attrib
+     "scope        ( row | col  )           #IMPLIED"
+>
+
+<!-- table: Table Element .............................. -->
+
+<!ENTITY % table.element  "INCLUDE" >
+<![%table.element;[
+<!ENTITY % table.content
+     "( %caption.qname;?, %tr.qname;+ )"
+>
+<!ELEMENT %table.qname;  %table.content; >
+<!-- end of table.element -->]]>
+
+<!ENTITY % table.attlist  "INCLUDE" >
+<![%table.attlist;[
+<!ATTLIST %table.qname;
+      %Common.attrib;
+      summary      %Text.datatype;          #IMPLIED
+      width        %Length.datatype;        #IMPLIED
+>
+<!-- end of table.attlist -->]]>
+
+<!-- caption: Table Caption ............................ -->
+
+<!ENTITY % caption.element  "INCLUDE" >
+<![%caption.element;[
+<!ENTITY % caption.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %caption.qname;  %caption.content; >
+<!-- end of caption.element -->]]>
+
+<!ENTITY % caption.attlist  "INCLUDE" >
+<![%caption.attlist;[
+<!ATTLIST %caption.qname;
+      %Common.attrib;
+>
+<!-- end of caption.attlist -->]]>
+
+<!-- tr: Table Row ..................................... -->
+
+<!ENTITY % tr.element  "INCLUDE" >
+<![%tr.element;[
+<!ENTITY % tr.content  "( %th.qname; | %td.qname; )+" >
+<!ELEMENT %tr.qname;  %tr.content; >
+<!-- end of tr.element -->]]>
+
+<!ENTITY % tr.attlist  "INCLUDE" >
+<![%tr.attlist;[
+<!ATTLIST %tr.qname;
+      %Common.attrib;
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of tr.attlist -->]]>
+
+<!-- th: Table Header Cell ............................. -->
+
+<!-- th is for header cells, td for data,
+     but for cells acting as both use td
+-->
+
+<!ENTITY % th.element  "INCLUDE" >
+<![%th.element;[
+<!ENTITY % th.content
+     "( #PCDATA | %FlowNoTable.mix; )*"
+>
+<!ELEMENT %th.qname;  %th.content; >
+<!-- end of th.element -->]]>
+
+<!ENTITY % th.attlist  "INCLUDE" >
+<![%th.attlist;[
+<!ATTLIST %th.qname;
+      %Common.attrib;
+      abbr         %Text.datatype;          #IMPLIED
+      axis         CDATA                    #IMPLIED
+      headers      IDREFS                   #IMPLIED
+      %scope.attrib;
+      rowspan      %Number.datatype;        '1'
+      colspan      %Number.datatype;        '1'
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of th.attlist -->]]>
+
+<!-- td: Table Data Cell ............................... -->
+
+<!ENTITY % td.element  "INCLUDE" >
+<![%td.element;[
+<!ENTITY % td.content
+     "( #PCDATA | %FlowNoTable.mix; )*"
+>
+<!ELEMENT %td.qname;  %td.content; >
+<!-- end of td.element -->]]>
+
+<!ENTITY % td.attlist  "INCLUDE" >
+<![%td.attlist;[
+<!ATTLIST %td.qname;
+      %Common.attrib;
+      abbr         %Text.datatype;          #IMPLIED
+      axis         CDATA                    #IMPLIED
+      headers      IDREFS                   #IMPLIED
+      %scope.attrib;
+      rowspan      %Number.datatype;        '1'
+      colspan      %Number.datatype;        '1'
+      %CellHAlign.attrib;
+      %CellVAlign.attrib;
+>
+<!-- end of td.attlist -->]]>
+
+<!-- end of xhtml-basic-table-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-basic11-model-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-basic11-model-1.mod
new file mode 100644
index 0000000..7fdacd0
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-basic11-model-1.mod
@@ -0,0 +1,161 @@
+<!-- ....................................................................... -->
+<!-- XHTML Basic 1.1 Document Model Module  .................................... -->
+<!-- file: xhtml-basic11-model-1.mod
+
+     This is XHTML Basic, a proper subset of XHTML.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-basic11-model-1.mod,v 1.1 2006/07/05 16:29:09 matthieu Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Basic 1.1 Document Model 1.0//EN"
+       SYSTEM "xhtml-basic11-model-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- XHTML Basic Document Model
+
+     This module describes the groupings of elements that make up
+     common content models for XHTML elements.
+-->
+
+<!-- Optional Elements in head  .............. -->
+
+<!ENTITY % HeadOpts.mix
+     "( %script.qname; | %style.qname; | %meta.qname; 
+      | %link.qname; | %object.qname; )*" >
+
+<!-- script and noscript are used to contain scripts
+     and alternative content
+-->
+<!ENTITY % Script.class "| %script.qname; | %noscript.qname;" >
+
+<!-- Miscellaneous Elements  ................. -->
+
+<!ENTITY % Misc.extra "" >
+
+<!-- These elements are neither block nor inline, and can
+     essentially be used anywhere in the document body.
+-->
+<!ENTITY % Misc.class
+     "%Script.class;
+      %Misc.extra;"
+>
+
+<!-- Inline Elements  ........................ -->
+
+<!ENTITY % InlStruct.class "%br.qname; | %span.qname;" >
+
+<!ENTITY % InlPhras.class
+     "| %em.qname; | %strong.qname; | %dfn.qname; | %code.qname;
+      | %samp.qname; | %kbd.qname; | %var.qname; | %cite.qname;
+      | %abbr.qname; | %acronym.qname; | %q.qname;" >
+
+<!ENTITY % InlPres.class "" >
+
+<!ENTITY % I18n.class "" >
+
+<!ENTITY % Anchor.class "| %a.qname;" >
+
+<!ENTITY % InlSpecial.class "| %img.qname; | %object.qname;" >
+
+<!ENTITY % InlForm.class
+     "| %input.qname; | %select.qname; | %textarea.qname;
+      | %label.qname; | %button.qname;" >
+
+<!ENTITY % Inline.extra "" >
+
+<!ENTITY % Inline.class
+     "%InlStruct.class;
+      %InlPhras.class;
+      %Anchor.class;
+      %InlSpecial.class;
+      %InlForm.class;
+      %Inline.extra;"
+>
+
+<!ENTITY % InlNoAnchor.class
+     "%InlStruct.class;
+      %InlPhras.class;
+      %InlSpecial.class;
+      %InlForm.class;
+      %Inline.extra;"
+>
+
+<!ENTITY % InlNoAnchor.mix
+     "%InlNoAnchor.class;
+      %Misc.class;"
+>
+
+<!ENTITY % Inline.mix
+     "%Inline.class;
+      %Misc.class;"
+>
+
+<!-- Block Elements  ......................... -->
+
+<!ENTITY % Heading.class
+     "%h1.qname; | %h2.qname; | %h3.qname;
+      | %h4.qname; | %h5.qname; | %h6.qname;"
+>
+<!ENTITY % List.class  "%ul.qname; | %ol.qname; | %dl.qname;" >
+
+<!ENTITY % Table.class "| %table.qname;" >
+
+<!ENTITY % Form.class  "| %form.qname;" >
+
+<!ENTITY % BlkStruct.class "%p.qname; | %div.qname;" >
+
+<!ENTITY % BlkPhras.class
+     "| %pre.qname; | %blockquote.qname; | %address.qname;"
+>
+
+<!ENTITY % BlkPres.class "" >
+
+<!ENTITY % BlkSpecial.class
+     "%Table.class;
+      %Form.class;"
+>
+
+<!ENTITY % Block.extra "" >
+
+<!ENTITY % Block.class
+     "%BlkStruct.class;
+      %BlkPhras.class;
+      %BlkSpecial.class;
+      %Block.extra;"
+>
+
+<!ENTITY % Block.mix
+     "%Heading.class;
+      | %List.class;
+      | %Block.class;
+      %Misc.class;"
+>
+
+<!-- All Content Elements  ................... -->
+
+<!-- declares all content except tables
+-->
+<!ENTITY % FlowNoTable.mix
+     "%Heading.class;
+      | %List.class;
+      | %BlkStruct.class;
+      %BlkPhras.class;
+      %Form.class;
+      %Block.extra;
+      | %Inline.class;
+      %Misc.class;"
+>
+
+<!ENTITY % Flow.mix
+     "%Heading.class;
+      | %List.class;
+      | %Block.class;
+      | %Inline.class;
+      %Misc.class;"
+>
+
+<!-- end of xhtml-basic11-model-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-basic11.dtd b/xml/tests/testData/xml/XHtmlValidation3/xhtml-basic11.dtd
new file mode 100644
index 0000000..bd64bbd
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-basic11.dtd
@@ -0,0 +1,221 @@
+<!-- XHTML Basic 1.1 DTD  ...................................................... -->
+<!-- file: xhtml-basic10.dtd -->
+
+<!-- XHTML Basic 1.1 DTD
+
+     This is XHTML Basic, a proper subset of XHTML.
+
+     The Extensible HyperText Markup Language (XHTML)
+     Copyright 1998-2005 World Wide Web Consortium
+        (Massachusetts Institute of Technology, European Research Consortium
+         for Informatics and Mathematics, Keio University).
+         All Rights Reserved.
+
+     Permission to use, copy, modify and distribute the XHTML Basic DTD
+     and its accompanying documentation for any purpose and without fee is
+     hereby granted in perpetuity, provided that the above copyright notice
+     and this paragraph appear in all copies.  The copyright holders make
+     no representation about the suitability of the DTD for any purpose.
+
+     It is provided "as is" without expressed or implied warranty.
+
+        Editors:    Murray M. Altheim <mailto:[email protected]>
+                    Peter Stark       <mailto:[email protected]>
+        Revision:   $Id: xhtml-basic11.dtd,v 1.1 2006/07/05 16:29:53 matthieu Exp $ SMI
+
+-->
+<!-- This is the driver file for version 1.1 of the XHTML Basic DTD.
+
+     This DTD is identified by the PUBLIC and SYSTEM identifiers:
+
+     PUBLIC: "-//W3C//DTD XHTML Basic 1.1//EN"
+     SYSTEM: "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"
+-->
+<!ENTITY % XHTML.version  "-//W3C//DTD XHTML Basic 1.1//EN" >
+
+<!-- Use this URI to identify the default namespace:
+
+         "http://www.w3.org/1999/xhtml"
+
+     See the Qualified Names module for information
+     on the use of namespace prefixes in the DTD.
+-->
+<!ENTITY % NS.prefixed "IGNORE" >
+<!ENTITY % XHTML.prefix  "" >
+
+<!-- Reserved for use with the XLink namespace:
+-->
+<!ENTITY % XLINK.xmlns "" >
+<!ENTITY % XLINK.xmlns.attrib "" >
+
+<!-- For example, if you are using XHTML Basic 1.1 directly, use
+     the public identifier in the DOCTYPE declaration, with the namespace
+     declaration on the document element to identify the default namespace:
+
+         <?xml version="1.0"?>
+         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"
+             "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd" >
+         <html xmlns="http://www.w3.org/1999/xhtml"
+               xml:lang="en" >
+         ...
+         </html>
+-->
+
+<!-- reserved for future use with document profiles -->
+<!ENTITY % XHTML.profile  "" >
+
+<!-- Bidirectional Text features
+     This feature-test entity is used to declare elements
+     and attributes used for bidirectional text support.
+-->
+<!ENTITY % XHTML.bidi  "IGNORE" >
+
+<?doc type="doctype" role="title" { XHTML Basic 1.1 } ?>
+
+<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
+
+<!ENTITY % xhtml-events.module   "INCLUDE" >
+<!ENTITY % xhtml-bdo.module      "%XHTML.bidi;" >
+
+<!ENTITY % xhtml-model.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Basic 1.1 Document Model 1.0//EN"
+            "xhtml-basic11-model-1.mod" >
+
+<!ENTITY % xhtml-framework.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
+            "xhtml-framework-1.mod" >
+%xhtml-framework.mod;
+
+<!ENTITY % pre.content
+     "( #PCDATA
+      | %InlStruct.class;
+      %InlPhras.class;
+      %Anchor.class;
+      %Inline.extra; )*"
+>
+
+<!ENTITY % xhtml-text.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
+            "xhtml-text-1.mod" >
+%xhtml-text.mod;
+
+<!ENTITY % xhtml-hypertext.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
+            "xhtml-hypertext-1.mod" >
+%xhtml-hypertext.mod;
+
+<!ENTITY % xhtml-list.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
+            "xhtml-list-1.mod" >
+%xhtml-list.mod;
+
+<!-- Add in the value attribute to the li element -->
+<!ATTLIST %li.qname;
+      value        %Number.datatype;         #IMPLIED
+>
+
+<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
+
+<!-- Scripting Module  ........................................... -->
+<!ENTITY % xhtml-script.module "INCLUDE" >
+<![%xhtml-script.module;[
+<!ENTITY % xhtml-script.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN"
+            "xhtml-script-1.mod" >
+%xhtml-script.mod;]]>
+
+<!-- Style Sheets Module  ......................................... -->
+<!ENTITY % xhtml-style.module "INCLUDE" >
+<![%xhtml-style.module;[
+<!ENTITY % xhtml-style.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN"
+            "xhtml-style-1.mod" >
+%xhtml-style.mod;]]>
+
+<!-- Image Module  ............................................... -->
+<!ENTITY % xhtml-image.module "INCLUDE" >
+<![%xhtml-image.module;[
+<!ENTITY % xhtml-image.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
+            "xhtml-image-1.mod" >
+%xhtml-image.mod;]]>
+
+<!-- Tables Module ............................................... -->
+<!ENTITY % xhtml-table.module "INCLUDE" >
+<![%xhtml-table.module;[
+<!ENTITY % xhtml-table.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN"
+            "xhtml-basic-table-1.mod" >
+%xhtml-table.mod;]]>
+
+<!-- Forms Module  ............................................... -->
+<!ENTITY % xhtml-form.module "INCLUDE" >
+<![%xhtml-form.module;[
+<!ENTITY % xhtml-form.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN"
+            "xhtml-form-1.mod" >
+%xhtml-form.mod;]]>
+
+<!-- Link Element Module  ........................................ -->
+<!ENTITY % xhtml-link.module "INCLUDE" >
+<![%xhtml-link.module;[
+<!ENTITY % xhtml-link.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
+            "xhtml-link-1.mod" >
+%xhtml-link.mod;]]>
+
+<!-- Document Metainformation Module  ............................ -->
+<!ENTITY % xhtml-meta.module "INCLUDE" >
+<![%xhtml-meta.module;[
+<!ENTITY % xhtml-meta.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
+            "xhtml-meta-1.mod" >
+%xhtml-meta.mod;]]>
+
+<!-- Base Element Module  ........................................ -->
+<!ENTITY % xhtml-base.module "INCLUDE" >
+<![%xhtml-base.module;[
+<!ENTITY % xhtml-base.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
+            "xhtml-base-1.mod" >
+%xhtml-base.mod;]]>
+
+<!-- Param Element Module  ....................................... -->
+<!ENTITY % xhtml-param.module "INCLUDE" >
+<![%xhtml-param.module;[
+<!ENTITY % xhtml-param.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
+            "xhtml-param-1.mod" >
+%xhtml-param.mod;]]>
+
+<!-- Embedded Object Module  ..................................... -->
+<!ENTITY % xhtml-object.module "INCLUDE" >
+<![%xhtml-object.module;[
+<!ENTITY % xhtml-object.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
+            "xhtml-object-1.mod" >
+%xhtml-object.mod;]]>
+
+<!-- Inputmode Attribute Module  .................................. -->
+<!ENTITY % xhtml-inputmode.module "INCLUDE" >
+<![%xhtml-inputmode.module;[
+<!ENTITY % xhtml-inputmode.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Inputmode 1.0//EN"
+            "xhtml-inputmode-1.mod" >
+%xhtml-inputmode.mod;]]>
+
+<!-- Target Attribute Module  .................................... -->
+<!ENTITY % xhtml-target.module "INCLUDE" >
+<![%xhtml-target.module;[
+<!ENTITY % xhtml-target.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Target 1.0//EN"
+            "xhtml-target-1.mod" >
+%xhtml-target.mod;]]>
+
+
+<!ENTITY % xhtml-struct.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
+            "xhtml-struct-1.mod" >
+%xhtml-struct.mod;
+
+<!-- end of XHTML Basic 1.1 DTD  ........................................... -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-blkphras-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-blkphras-1.mod
new file mode 100644
index 0000000..fcbaf6d
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-blkphras-1.mod
@@ -0,0 +1,163 @@
+<!-- ...................................................................... -->
+<!-- XHTML Block Phrasal Module  .......................................... -->
+<!-- file: xhtml-blkphras-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-blkphras-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
+       SYSTEM "xhtml-blkphras-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Block Phrasal
+
+        address, blockquote, pre, h1, h2, h3, h4, h5, h6
+
+     This module declares the elements and their attributes used to
+     support block-level phrasal markup.
+-->
+
+<!ENTITY % address.element  "INCLUDE" >
+<![%address.element;[
+<!ENTITY % address.content
+     "( #PCDATA | %Inline.mix; )*" >
+<!ENTITY % address.qname  "address" >
+<!ELEMENT %address.qname;  %address.content; >
+<!-- end of address.element -->]]>
+
+<!ENTITY % address.attlist  "INCLUDE" >
+<![%address.attlist;[
+<!ATTLIST %address.qname;
+      %Common.attrib;
+>
+<!-- end of address.attlist -->]]>
+
+<!ENTITY % blockquote.element  "INCLUDE" >
+<![%blockquote.element;[
+<!ENTITY % blockquote.content
+     "( %Block.mix; )+"
+>
+<!ENTITY % blockquote.qname  "blockquote" >
+<!ELEMENT %blockquote.qname;  %blockquote.content; >
+<!-- end of blockquote.element -->]]>
+
+<!ENTITY % blockquote.attlist  "INCLUDE" >
+<![%blockquote.attlist;[
+<!ATTLIST %blockquote.qname;
+      %Common.attrib;
+      cite         %URI.datatype;           #IMPLIED
+>
+<!-- end of blockquote.attlist -->]]>
+
+<!ENTITY % pre.element  "INCLUDE" >
+<![%pre.element;[
+<!ENTITY % pre.content
+     "( #PCDATA
+      | %InlStruct.class;
+      %InlPhras.class;
+      | %tt.qname; | %i.qname; | %b.qname;
+      %I18n.class;
+      %Anchor.class;
+      | %script.qname; | %map.qname;
+      %Inline.extra; )*"
+>
+<!ENTITY % pre.qname  "pre" >
+<!ELEMENT %pre.qname;  %pre.content; >
+<!-- end of pre.element -->]]>
+
+<!ENTITY % pre.attlist  "INCLUDE" >
+<![%pre.attlist;[
+<!ATTLIST %pre.qname;
+      %Common.attrib;
+>
+<!-- end of pre.attlist -->]]>
+
+<!-- ...................  Heading Elements  ................... -->
+
+<!ENTITY % Heading.content  "( #PCDATA | %Inline.mix; )*" >
+
+<!ENTITY % h1.element  "INCLUDE" >
+<![%h1.element;[
+<!ENTITY % h1.qname  "h1" >
+<!ELEMENT %h1.qname;  %Heading.content; >
+<!-- end of h1.element -->]]>
+
+<!ENTITY % h1.attlist  "INCLUDE" >
+<![%h1.attlist;[
+<!ATTLIST %h1.qname;
+      %Common.attrib;
+>
+<!-- end of h1.attlist -->]]>
+
+<!ENTITY % h2.element  "INCLUDE" >
+<![%h2.element;[
+<!ENTITY % h2.qname  "h2" >
+<!ELEMENT %h2.qname;  %Heading.content; >
+<!-- end of h2.element -->]]>
+
+<!ENTITY % h2.attlist  "INCLUDE" >
+<![%h2.attlist;[
+<!ATTLIST %h2.qname;
+      %Common.attrib;
+>
+<!-- end of h2.attlist -->]]>
+
+<!ENTITY % h3.element  "INCLUDE" >
+<![%h3.element;[
+<!ENTITY % h3.qname  "h3" >
+<!ELEMENT %h3.qname;  %Heading.content; >
+<!-- end of h3.element -->]]>
+
+<!ENTITY % h3.attlist  "INCLUDE" >
+<![%h3.attlist;[
+<!ATTLIST %h3.qname;
+      %Common.attrib;
+>
+<!-- end of h3.attlist -->]]>
+
+<!ENTITY % h4.element  "INCLUDE" >
+<![%h4.element;[
+<!ENTITY % h4.qname  "h4" >
+<!ELEMENT %h4.qname;  %Heading.content; >
+<!-- end of h4.element -->]]>
+
+<!ENTITY % h4.attlist  "INCLUDE" >
+<![%h4.attlist;[
+<!ATTLIST %h4.qname;
+      %Common.attrib;
+>
+<!-- end of h4.attlist -->]]>
+
+<!ENTITY % h5.element  "INCLUDE" >
+<![%h5.element;[
+<!ENTITY % h5.qname  "h5" >
+<!ELEMENT %h5.qname;  %Heading.content; >
+<!-- end of h5.element -->]]>
+
+<!ENTITY % h5.attlist  "INCLUDE" >
+<![%h5.attlist;[
+<!ATTLIST %h5.qname;
+      %Common.attrib;
+>
+<!-- end of h5.attlist -->]]>
+
+<!ENTITY % h6.element  "INCLUDE" >
+<![%h6.element;[
+<!ENTITY % h6.qname  "h6" >
+<!ELEMENT %h6.qname;  %Heading.content; >
+<!-- end of h6.element -->]]>
+
+<!ENTITY % h6.attlist  "INCLUDE" >
+<![%h6.attlist;[
+<!ATTLIST %h6.qname;
+      %Common.attrib;
+>
+<!-- end of h6.attlist -->]]>
+
+<!-- end of xhtml-blkphras-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-blkstruct-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-blkstruct-1.mod
new file mode 100644
index 0000000..0d7ae0c
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-blkstruct-1.mod
@@ -0,0 +1,57 @@
+<!-- ...................................................................... -->
+<!-- XHTML Block Structural Module  ....................................... -->
+<!-- file: xhtml-blkstruct-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-blkstruct-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
+       SYSTEM "xhtml-blkstruct-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Block Structural
+
+        div, p
+
+     This module declares the elements and their attributes used to
+     support block-level structural markup.
+-->
+
+<!ENTITY % div.element  "INCLUDE" >
+<![%div.element;[
+<!ENTITY % div.content
+     "( #PCDATA | %Flow.mix; )*"
+>
+<!ENTITY % div.qname  "div" >
+<!ELEMENT %div.qname;  %div.content; >
+<!-- end of div.element -->]]>
+
+<!ENTITY % div.attlist  "INCLUDE" >
+<![%div.attlist;[
+<!ATTLIST %div.qname;
+      %Common.attrib;
+>
+<!-- end of div.attlist -->]]>
+
+<!ENTITY % p.element  "INCLUDE" >
+<![%p.element;[
+<!ENTITY % p.content
+     "( #PCDATA | %Inline.mix; )*" >
+<!ENTITY % p.qname  "p" >
+<!ELEMENT %p.qname;  %p.content; >
+<!-- end of p.element -->]]>
+
+<!ENTITY % p.attlist  "INCLUDE" >
+<![%p.attlist;[
+<!ATTLIST %p.qname;
+      %Common.attrib;
+>
+<!-- end of p.attlist -->]]>
+
+<!-- end of xhtml-blkstruct-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-charent-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-charent-1.mod
new file mode 100644
index 0000000..45fea10
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-charent-1.mod
@@ -0,0 +1,39 @@
+<!-- ...................................................................... -->
+<!-- XHTML Character Entities Module  ......................................... -->
+<!-- file: xhtml-charent-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-charent-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
+       SYSTEM "xhtml-charent-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Character Entities for XHTML
+
+     This module declares the set of character entities for XHTML,
+     including the Latin 1, Symbol and Special character collections.
+-->
+
+<!ENTITY % xhtml-lat1
+    PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+           "xhtml-lat1.ent" >
+%xhtml-lat1;
+
+<!ENTITY % xhtml-symbol
+    PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+           "xhtml-symbol.ent" >
+%xhtml-symbol;
+
+<!ENTITY % xhtml-special
+    PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+           "xhtml-special.ent" >
+%xhtml-special;
+
+<!-- end of xhtml-charent-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-datatypes-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-datatypes-1.mod
new file mode 100644
index 0000000..21e04dc
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-datatypes-1.mod
@@ -0,0 +1,85 @@
+<!-- ...................................................................... -->
+<!-- XHTML Datatypes Module  .............................................. -->
+<!-- file: xhtml-datatypes-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-datatypes-1.mod,v 4.1 2001/04/06 19:23:32 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
+       SYSTEM "xhtml-datatypes-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Datatypes
+
+     defines containers for the following datatypes, many of
+     these imported from other specifications and standards.
+-->
+
+<!-- Length defined for cellpadding/cellspacing -->
+
+<!-- nn for pixels or nn% for percentage length -->
+<!ENTITY % Length.datatype "CDATA" >
+
+<!-- space-separated list of link types -->
+<!ENTITY % LinkTypes.datatype "NMTOKENS" >
+
+<!-- single or comma-separated list of media descriptors -->
+<!ENTITY % MediaDesc.datatype "CDATA" >
+
+<!-- pixel, percentage, or relative -->
+<!ENTITY % MultiLength.datatype "CDATA" >
+
+<!-- one or more digits (NUMBER) -->
+<!ENTITY % Number.datatype "CDATA" >
+
+<!-- integer representing length in pixels -->
+<!ENTITY % Pixels.datatype "CDATA" >
+
+<!-- script expression -->
+<!ENTITY % Script.datatype "CDATA" >
+
+<!-- textual content -->
+<!ENTITY % Text.datatype "CDATA" >
+
+<!-- Imported Datatypes ................................ -->
+
+<!-- a single character from [ISO10646] -->
+<!ENTITY % Character.datatype "CDATA" >
+
+<!-- a character encoding, as per [RFC2045] -->
+<!ENTITY % Charset.datatype "CDATA" >
+
+<!-- a space separated list of character encodings, as per [RFC2045] -->
+<!ENTITY % Charsets.datatype "CDATA" >
+
+<!-- Color specification using color name or sRGB (#RRGGBB) values -->
+<!ENTITY % Color.datatype "CDATA" >
+
+<!-- media type, as per [RFC2045] -->
+<!ENTITY % ContentType.datatype "CDATA" >
+
+<!-- comma-separated list of media types, as per [RFC2045] -->
+<!ENTITY % ContentTypes.datatype "CDATA" >
+
+<!-- date and time information. ISO date format -->
+<!ENTITY % Datetime.datatype "CDATA" >
+
+<!-- formal public identifier, as per [ISO8879] -->
+<!ENTITY % FPI.datatype "CDATA" >
+
+<!-- a language code, as per [RFC3066] or its successor -->
+<!ENTITY % LanguageCode.datatype "CDATA" >
+
+<!-- a Uniform Resource Identifier, see [URI] -->
+<!ENTITY % URI.datatype "CDATA" >
+
+<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
+<!ENTITY % URIs.datatype "CDATA" >
+
+<!-- end of xhtml-datatypes-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-form-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-form-1.mod
new file mode 100644
index 0000000..ae9038b
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-form-1.mod
@@ -0,0 +1,291 @@
+<!-- ...................................................................... -->
+<!-- XHTML Forms Module  .................................................. -->
+<!-- file: xhtml-form-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-form-1.mod,v 4.1 2001/04/10 09:42:30 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN"
+       SYSTEM "xhtml-form-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Forms
+
+        form, label, input, select, optgroup, option,
+        textarea, fieldset, legend, button
+
+     This module declares markup to provide support for online
+     forms, based on the features found in HTML 4 forms.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % form.qname  "form" >
+<!ENTITY % label.qname  "label" >
+<!ENTITY % input.qname  "input" >
+<!ENTITY % select.qname  "select" >
+<!ENTITY % optgroup.qname  "optgroup" >
+<!ENTITY % option.qname  "option" >
+<!ENTITY % textarea.qname  "textarea" >
+<!ENTITY % fieldset.qname  "fieldset" >
+<!ENTITY % legend.qname  "legend" >
+<!ENTITY % button.qname  "button" >
+
+<!-- %BlkNoForm.mix; includes all non-form block elements,
+     plus %Misc.class;
+-->
+<!ENTITY % BlkNoForm.mix
+     "%Heading.class;
+      | %List.class;
+      | %BlkStruct.class;
+      %BlkPhras.class;
+      %BlkPres.class;
+      %Table.class;
+      %Block.extra;
+      %Misc.class;"
+>
+
+<!-- form: Form Element ................................ -->
+
+<!ENTITY % form.element  "INCLUDE" >
+<![%form.element;[
+<!ENTITY % form.content
+     "( %BlkNoForm.mix;
+      | %fieldset.qname; )+"
+>
+<!ELEMENT %form.qname;  %form.content; >
+<!-- end of form.element -->]]>
+
+<!ENTITY % form.attlist  "INCLUDE" >
+<![%form.attlist;[
+<!ATTLIST %form.qname;
+      %Common.attrib;
+      action       %URI.datatype;           #REQUIRED
+      method       ( get | post )           'get'
+      enctype      %ContentType.datatype;   'application/x-www-form-urlencoded'
+      accept-charset %Charsets.datatype;    #IMPLIED
+      accept       %ContentTypes.datatype;  #IMPLIED
+>
+<!-- end of form.attlist -->]]>
+
+<!-- label: Form Field Label Text ...................... -->
+
+<!-- Each label must not contain more than ONE field
+-->
+
+<!ENTITY % label.element  "INCLUDE" >
+<![%label.element;[
+<!ENTITY % label.content
+     "( #PCDATA
+      | %input.qname; | %select.qname; | %textarea.qname; | %button.qname;
+      | %InlStruct.class;
+      %InlPhras.class;
+      %I18n.class;
+      %InlPres.class;
+      %Anchor.class;
+      %InlSpecial.class;
+      %Inline.extra;
+      %Misc.class; )*"
+>
+<!ELEMENT %label.qname;  %label.content; >
+<!-- end of label.element -->]]>
+
+<!ENTITY % label.attlist  "INCLUDE" >
+<![%label.attlist;[
+<!ATTLIST %label.qname;
+      %Common.attrib;
+      for          IDREF                    #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of label.attlist -->]]>
+
+<!-- input: Form Control ............................... -->
+
+<!ENTITY % input.element  "INCLUDE" >
+<![%input.element;[
+<!ENTITY % input.content  "EMPTY" >
+<!ELEMENT %input.qname;  %input.content; >
+<!-- end of input.element -->]]>
+
+<!ENTITY % input.attlist  "INCLUDE" >
+<![%input.attlist;[
+<!ENTITY % InputType.class
+     "( text | password | checkbox | radio | submit
+      | reset | file | hidden | image | button )"
+>
+<!-- attribute 'name' required for all but submit & reset
+-->
+<!ATTLIST %input.qname;
+      %Common.attrib;
+      type         %InputType.class;        'text'
+      name         CDATA                    #IMPLIED
+      value        CDATA                    #IMPLIED
+      checked      ( checked )              #IMPLIED
+      disabled     ( disabled )             #IMPLIED
+      readonly     ( readonly )             #IMPLIED
+      size         %Number.datatype;        #IMPLIED
+      maxlength    %Number.datatype;        #IMPLIED
+      src          %URI.datatype;           #IMPLIED
+      alt          %Text.datatype;          #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+      accept       %ContentTypes.datatype;  #IMPLIED
+>
+<!-- end of input.attlist -->]]>
+
+<!-- select: Option Selector ........................... -->
+
+<!ENTITY % select.element  "INCLUDE" >
+<![%select.element;[
+<!ENTITY % select.content
+     "( %optgroup.qname; | %option.qname; )+"
+>
+<!ELEMENT %select.qname;  %select.content; >
+<!-- end of select.element -->]]>
+
+<!ENTITY % select.attlist  "INCLUDE" >
+<![%select.attlist;[
+<!ATTLIST %select.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      size         %Number.datatype;        #IMPLIED
+      multiple     ( multiple )             #IMPLIED
+      disabled     ( disabled )             #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+>
+<!-- end of select.attlist -->]]>
+
+<!-- optgroup: Option Group ............................ -->
+
+<!ENTITY % optgroup.element  "INCLUDE" >
+<![%optgroup.element;[
+<!ENTITY % optgroup.content  "( %option.qname; )+" >
+<!ELEMENT %optgroup.qname;  %optgroup.content; >
+<!-- end of optgroup.element -->]]>
+
+<!ENTITY % optgroup.attlist  "INCLUDE" >
+<![%optgroup.attlist;[
+<!ATTLIST %optgroup.qname;
+      %Common.attrib;
+      disabled     ( disabled )             #IMPLIED
+      label        %Text.datatype;          #REQUIRED
+>
+<!-- end of optgroup.attlist -->]]>
+
+<!-- option: Selectable Choice ......................... -->
+
+<!ENTITY % option.element  "INCLUDE" >
+<![%option.element;[
+<!ENTITY % option.content  "( #PCDATA )" >
+<!ELEMENT %option.qname;  %option.content; >
+<!-- end of option.element -->]]>
+
+<!ENTITY % option.attlist  "INCLUDE" >
+<![%option.attlist;[
+<!ATTLIST %option.qname;
+      %Common.attrib;
+      selected     ( selected )             #IMPLIED
+      disabled     ( disabled )             #IMPLIED
+      label        %Text.datatype;          #IMPLIED
+      value        CDATA                    #IMPLIED
+>
+<!-- end of option.attlist -->]]>
+
+<!-- textarea: Multi-Line Text Field ................... -->
+
+<!ENTITY % textarea.element  "INCLUDE" >
+<![%textarea.element;[
+<!ENTITY % textarea.content  "( #PCDATA )" >
+<!ELEMENT %textarea.qname;  %textarea.content; >
+<!-- end of textarea.element -->]]>
+
+<!ENTITY % textarea.attlist  "INCLUDE" >
+<![%textarea.attlist;[
+<!ATTLIST %textarea.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      rows         %Number.datatype;        #REQUIRED
+      cols         %Number.datatype;        #REQUIRED
+      disabled     ( disabled )             #IMPLIED
+      readonly     ( readonly )             #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of textarea.attlist -->]]>
+
+<!-- fieldset: Form Control Group ...................... -->
+
+<!-- #PCDATA is to solve the mixed content problem,
+     per specification only whitespace is allowed
+-->
+
+<!ENTITY % fieldset.element  "INCLUDE" >
+<![%fieldset.element;[
+<!ENTITY % fieldset.content
+     "( #PCDATA | %legend.qname; | %Flow.mix; )*"
+>
+<!ELEMENT %fieldset.qname;  %fieldset.content; >
+<!-- end of fieldset.element -->]]>
+
+<!ENTITY % fieldset.attlist  "INCLUDE" >
+<![%fieldset.attlist;[
+<!ATTLIST %fieldset.qname;
+      %Common.attrib;
+>
+<!-- end of fieldset.attlist -->]]>
+
+<!-- legend: Fieldset Legend ........................... -->
+
+<!ENTITY % legend.element  "INCLUDE" >
+<![%legend.element;[
+<!ENTITY % legend.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %legend.qname;  %legend.content; >
+<!-- end of legend.element -->]]>
+
+<!ENTITY % legend.attlist  "INCLUDE" >
+<![%legend.attlist;[
+<!ATTLIST %legend.qname;
+      %Common.attrib;
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of legend.attlist -->]]>
+
+<!-- button: Push Button ............................... -->
+
+<!ENTITY % button.element  "INCLUDE" >
+<![%button.element;[
+<!ENTITY % button.content
+     "( #PCDATA
+      | %BlkNoForm.mix;
+      | %InlStruct.class;
+      %InlPhras.class;
+      %InlPres.class;
+      %I18n.class;
+      %InlSpecial.class;
+      %Inline.extra; )*"
+>
+<!ELEMENT %button.qname;  %button.content; >
+<!-- end of button.element -->]]>
+
+<!ENTITY % button.attlist  "INCLUDE" >
+<![%button.attlist;[
+<!ATTLIST %button.qname;
+      %Common.attrib;
+      name         CDATA                    #IMPLIED
+      value        CDATA                    #IMPLIED
+      type         ( button | submit | reset ) 'submit'
+      disabled     ( disabled )             #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+>
+<!-- end of button.attlist -->]]>
+
+<!-- end of xhtml-form-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-framework-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-framework-1.mod
new file mode 100644
index 0000000..c6a22ac
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-framework-1.mod
@@ -0,0 +1,98 @@
+<!-- ...................................................................... -->
+<!-- XHTML Modular Framework Module  ...................................... -->
+<!-- file: xhtml-framework-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-framework-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
+       SYSTEM "xhtml-framework-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Modular Framework
+
+     This required module instantiates the modules needed
+     to support the XHTML modularization model, including:
+
+        +  notations
+        +  datatypes
+        +  namespace-qualified names
+        +  common attributes
+        +  document model
+        +  character entities
+
+     The Intrinsic Events module is ignored by default but
+     occurs in this module because it must be instantiated
+     prior to Attributes but after Datatypes.
+-->
+
+<!ENTITY % xhtml-arch.module "IGNORE" >
+<![%xhtml-arch.module;[
+<!ENTITY % xhtml-arch.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Base Architecture 1.0//EN"
+            "xhtml-arch-1.mod" >
+%xhtml-arch.mod;]]>
+
+<!ENTITY % xhtml-notations.module "INCLUDE" >
+<![%xhtml-notations.module;[
+<!ENTITY % xhtml-notations.mod
+     PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN"
+            "xhtml-notations-1.mod" >
+%xhtml-notations.mod;]]>
+
+<!ENTITY % xhtml-datatypes.module "INCLUDE" >
+<![%xhtml-datatypes.module;[
+<!ENTITY % xhtml-datatypes.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
+            "xhtml-datatypes-1.mod" >
+%xhtml-datatypes.mod;]]>
+
+<!-- placeholder for XLink support module -->
+<!ENTITY % xhtml-xlink.mod "" >
+%xhtml-xlink.mod;
+
+<!ENTITY % xhtml-qname.module "INCLUDE" >
+<![%xhtml-qname.module;[
+<!ENTITY % xhtml-qname.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
+            "xhtml-qname-1.mod" >
+%xhtml-qname.mod;]]>
+
+<!ENTITY % xhtml-events.module "IGNORE" >
+<![%xhtml-events.module;[
+<!ENTITY % xhtml-events.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN"
+            "xhtml-events-1.mod" >
+%xhtml-events.mod;]]>
+
+<!ENTITY % xhtml-attribs.module "INCLUDE" >
+<![%xhtml-attribs.module;[
+<!ENTITY % xhtml-attribs.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
+            "xhtml-attribs-1.mod" >
+%xhtml-attribs.mod;]]>
+
+<!-- placeholder for content model redeclarations -->
+<!ENTITY % xhtml-model.redecl "" >
+%xhtml-model.redecl;
+
+<!ENTITY % xhtml-model.module "INCLUDE" >
+<![%xhtml-model.module;[
+<!-- instantiate the Document Model module declared in the DTD driver
+-->
+%xhtml-model.mod;]]>
+
+<!ENTITY % xhtml-charent.module "INCLUDE" >
+<![%xhtml-charent.module;[
+<!ENTITY % xhtml-charent.mod
+     PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
+            "xhtml-charent-1.mod" >
+%xhtml-charent.mod;]]>
+
+<!-- end of xhtml-framework-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-hypertext-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-hypertext-1.mod
new file mode 100644
index 0000000..160c7b8
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-hypertext-1.mod
@@ -0,0 +1,54 @@
+<!-- ...................................................................... -->
+<!-- XHTML Hypertext Module  .............................................. -->
+<!-- file: xhtml-hypertext-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-hypertext-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
+       SYSTEM "xhtml-hypertext-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Hypertext
+
+        a
+
+     This module declares the anchor ('a') element type, which
+     defines the source of a hypertext link. The destination
+     (or link 'target') is identified via its 'id' attribute
+     rather than the 'name' attribute as was used in HTML.
+-->
+
+<!-- ............  Anchor Element  ............ -->
+
+<!ENTITY % a.element  "INCLUDE" >
+<![%a.element;[
+<!ENTITY % a.content
+     "( #PCDATA | %InlNoAnchor.mix; )*"
+>
+<!ENTITY % a.qname  "a" >
+<!ELEMENT %a.qname;  %a.content; >
+<!-- end of a.element -->]]>
+
+<!ENTITY % a.attlist  "INCLUDE" >
+<![%a.attlist;[
+<!ATTLIST %a.qname;
+      %Common.attrib;
+      href         %URI.datatype;           #IMPLIED
+      charset      %Charset.datatype;       #IMPLIED
+      type         %ContentType.datatype;   #IMPLIED
+      hreflang     %LanguageCode.datatype;  #IMPLIED
+      rel          %LinkTypes.datatype;     #IMPLIED
+      rev          %LinkTypes.datatype;     #IMPLIED
+      accesskey    %Character.datatype;     #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+>
+<!-- end of a.attlist -->]]>
+
+<!-- end of xhtml-hypertext-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-image-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-image-1.mod
new file mode 100644
index 0000000..251bcec
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-image-1.mod
@@ -0,0 +1,50 @@
+<!-- ...................................................................... -->
+<!-- XHTML Images Module  ................................................. -->
+<!-- file: xhtml-image-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Rovision: $Id: xhtml-image-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
+       SYSTEM "xhtml-image-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Images
+
+        img
+
+     This module provides markup to support basic image embedding.
+-->
+
+<!-- To avoid problems with text-only UAs as well as to make
+     image content understandable and navigable to users of
+     non-visual UAs, you need to provide a description with
+     the 'alt' attribute, and avoid server-side image maps.
+-->
+
+<!ENTITY % img.element  "INCLUDE" >
+<![%img.element;[
+<!ENTITY % img.content  "EMPTY" >
+<!ENTITY % img.qname  "img" >
+<!ELEMENT %img.qname;  %img.content; >
+<!-- end of img.element -->]]>
+
+<!ENTITY % img.attlist  "INCLUDE" >
+<![%img.attlist;[
+<!ATTLIST %img.qname;
+      %Common.attrib;
+      src          %URI.datatype;           #REQUIRED
+      alt          %Text.datatype;          #REQUIRED
+      longdesc     %URI.datatype;           #IMPLIED
+      height       %Length.datatype;        #IMPLIED
+      width        %Length.datatype;        #IMPLIED
+>
+<!-- end of img.attlist -->]]>
+
+<!-- end of xhtml-image-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-inlphras-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-inlphras-1.mod
new file mode 100644
index 0000000..6c7b87f
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-inlphras-1.mod
@@ -0,0 +1,203 @@
+<!-- ...................................................................... -->
+<!-- XHTML Inline Phrasal Module  ......................................... -->
+<!-- file: xhtml-inlphras-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-inlphras-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
+       SYSTEM "xhtml-inlphras-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Inline Phrasal
+
+        abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var
+
+     This module declares the elements and their attributes used to
+     support inline-level phrasal markup.
+-->
+
+<!ENTITY % abbr.element  "INCLUDE" >
+<![%abbr.element;[
+<!ENTITY % abbr.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % abbr.qname  "abbr" >
+<!ELEMENT %abbr.qname;  %abbr.content; >
+<!-- end of abbr.element -->]]>
+
+<!ENTITY % abbr.attlist  "INCLUDE" >
+<![%abbr.attlist;[
+<!ATTLIST %abbr.qname;
+      %Common.attrib;
+>
+<!-- end of abbr.attlist -->]]>
+
+<!ENTITY % acronym.element  "INCLUDE" >
+<![%acronym.element;[
+<!ENTITY % acronym.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % acronym.qname  "acronym" >
+<!ELEMENT %acronym.qname;  %acronym.content; >
+<!-- end of acronym.element -->]]>
+
+<!ENTITY % acronym.attlist  "INCLUDE" >
+<![%acronym.attlist;[
+<!ATTLIST %acronym.qname;
+      %Common.attrib;
+>
+<!-- end of acronym.attlist -->]]>
+
+<!ENTITY % cite.element  "INCLUDE" >
+<![%cite.element;[
+<!ENTITY % cite.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % cite.qname  "cite" >
+<!ELEMENT %cite.qname;  %cite.content; >
+<!-- end of cite.element -->]]>
+
+<!ENTITY % cite.attlist  "INCLUDE" >
+<![%cite.attlist;[
+<!ATTLIST %cite.qname;
+      %Common.attrib;
+>
+<!-- end of cite.attlist -->]]>
+
+<!ENTITY % code.element  "INCLUDE" >
+<![%code.element;[
+<!ENTITY % code.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % code.qname  "code" >
+<!ELEMENT %code.qname;  %code.content; >
+<!-- end of code.element -->]]>
+
+<!ENTITY % code.attlist  "INCLUDE" >
+<![%code.attlist;[
+<!ATTLIST %code.qname;
+      %Common.attrib;
+>
+<!-- end of code.attlist -->]]>
+
+<!ENTITY % dfn.element  "INCLUDE" >
+<![%dfn.element;[
+<!ENTITY % dfn.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % dfn.qname  "dfn" >
+<!ELEMENT %dfn.qname;  %dfn.content; >
+<!-- end of dfn.element -->]]>
+
+<!ENTITY % dfn.attlist  "INCLUDE" >
+<![%dfn.attlist;[
+<!ATTLIST %dfn.qname;
+      %Common.attrib;
+>
+<!-- end of dfn.attlist -->]]>
+
+<!ENTITY % em.element  "INCLUDE" >
+<![%em.element;[
+<!ENTITY % em.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % em.qname  "em" >
+<!ELEMENT %em.qname;  %em.content; >
+<!-- end of em.element -->]]>
+
+<!ENTITY % em.attlist  "INCLUDE" >
+<![%em.attlist;[
+<!ATTLIST %em.qname;
+      %Common.attrib;
+>
+<!-- end of em.attlist -->]]>
+
+<!ENTITY % kbd.element  "INCLUDE" >
+<![%kbd.element;[
+<!ENTITY % kbd.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % kbd.qname  "kbd" >
+<!ELEMENT %kbd.qname;  %kbd.content; >
+<!-- end of kbd.element -->]]>
+
+<!ENTITY % kbd.attlist  "INCLUDE" >
+<![%kbd.attlist;[
+<!ATTLIST %kbd.qname;
+      %Common.attrib;
+>
+<!-- end of kbd.attlist -->]]>
+
+<!ENTITY % q.element  "INCLUDE" >
+<![%q.element;[
+<!ENTITY % q.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % q.qname  "q" >
+<!ELEMENT %q.qname;  %q.content; >
+<!-- end of q.element -->]]>
+
+<!ENTITY % q.attlist  "INCLUDE" >
+<![%q.attlist;[
+<!ATTLIST %q.qname;
+      %Common.attrib;
+      cite         %URI.datatype;           #IMPLIED
+>
+<!-- end of q.attlist -->]]>
+
+<!ENTITY % samp.element  "INCLUDE" >
+<![%samp.element;[
+<!ENTITY % samp.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % samp.qname  "samp" >
+<!ELEMENT %samp.qname;  %samp.content; >
+<!-- end of samp.element -->]]>
+
+<!ENTITY % samp.attlist  "INCLUDE" >
+<![%samp.attlist;[
+<!ATTLIST %samp.qname;
+      %Common.attrib;
+>
+<!-- end of samp.attlist -->]]>
+
+<!ENTITY % strong.element  "INCLUDE" >
+<![%strong.element;[
+<!ENTITY % strong.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % strong.qname  "strong" >
+<!ELEMENT %strong.qname;  %strong.content; >
+<!-- end of strong.element -->]]>
+
+<!ENTITY % strong.attlist  "INCLUDE" >
+<![%strong.attlist;[
+<!ATTLIST %strong.qname;
+      %Common.attrib;
+>
+<!-- end of strong.attlist -->]]>
+
+<!ENTITY % var.element  "INCLUDE" >
+<![%var.element;[
+<!ENTITY % var.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % var.qname  "var" >
+<!ELEMENT %var.qname;  %var.content; >
+<!-- end of var.element -->]]>
+
+<!ENTITY % var.attlist  "INCLUDE" >
+<![%var.attlist;[
+<!ATTLIST %var.qname;
+      %Common.attrib;
+>
+<!-- end of var.attlist -->]]>
+
+<!-- end of xhtml-inlphras-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-inlstruct-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-inlstruct-1.mod
new file mode 100644
index 0000000..6e277a2
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-inlstruct-1.mod
@@ -0,0 +1,62 @@
+<!-- ...................................................................... -->
+<!-- XHTML Inline Structural Module  ...................................... -->
+<!-- file: xhtml-inlstruct-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-inlstruct-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
+       SYSTEM "xhtml-inlstruct-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Inline Structural
+
+        br, span
+
+     This module declares the elements and their attributes
+     used to support inline-level structural markup.
+-->
+
+<!-- br: forced line break ............................. -->
+
+<!ENTITY % br.element  "INCLUDE" >
+<![%br.element;[
+
+<!ENTITY % br.content  "EMPTY" >
+<!ENTITY % br.qname  "br" >
+<!ELEMENT %br.qname;  %br.content; >
+
+<!-- end of br.element -->]]>
+
+<!ENTITY % br.attlist  "INCLUDE" >
+<![%br.attlist;[
+<!ATTLIST %br.qname;
+      %Core.attrib;
+>
+<!-- end of br.attlist -->]]>
+
+<!-- span: generic inline container .................... -->
+
+<!ENTITY % span.element  "INCLUDE" >
+<![%span.element;[
+<!ENTITY % span.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % span.qname  "span" >
+<!ELEMENT %span.qname;  %span.content; >
+<!-- end of span.element -->]]>
+
+<!ENTITY % span.attlist  "INCLUDE" >
+<![%span.attlist;[
+<!ATTLIST %span.qname;
+      %Common.attrib;
+>
+<!-- end of span.attlist -->]]>
+
+<!-- end of xhtml-inlstruct-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-inputmode-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-inputmode-1.mod
new file mode 100644
index 0000000..fb5a69b
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-inputmode-1.mod
@@ -0,0 +1,39 @@
+<!-- ...................................................................... -->
+<!-- XHTML Inputmode Module  .............................................. -->
+<!-- file: xhtml-inputmode-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-inputmode-1.mod,v 1.1 2006/07/05 16:29:09 matthieu Exp $
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Inputmode 1.0//EN"
+       SYSTEM "xhtml-inputmode-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Inputmode 
+
+        inputmode
+
+     This module declares the 'inputmode' attribute used for suggesting the
+     input mode associated with an input or textarea element.
+-->
+
+<!-- render in this frame --> 
+<!ENTITY % Inputmode.datatype "CDATA" >
+
+<!-- add 'inputmode' attribute to 'input' element -->
+<!ATTLIST %input.qname;
+      inputmode       %Inputmode.datatype;   #IMPLIED
+>
+
+<!-- add 'inputmode' attribute to 'textarea' element -->
+<!ATTLIST %textarea.qname;
+      inputmode       %Inputmode.datatype;   #IMPLIED
+>
+
+<!-- end of xhtml-inputmode-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-lat1.ent b/xml/tests/testData/xml/XHtmlValidation3/xhtml-lat1.ent
new file mode 100644
index 0000000..ffee223
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-lat1.ent
@@ -0,0 +1,196 @@
+<!-- Portions (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+-->
+<!-- Character entity set. Typical invocation:
+    <!ENTITY % HTMLlat1 PUBLIC
+       "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
+    %HTMLlat1;
+-->
+
+<!ENTITY nbsp   "&#160;"> <!-- no-break space = non-breaking space,
+                                  U+00A0 ISOnum -->
+<!ENTITY iexcl  "&#161;"> <!-- inverted exclamation mark, U+00A1 ISOnum -->
+<!ENTITY cent   "&#162;"> <!-- cent sign, U+00A2 ISOnum -->
+<!ENTITY pound  "&#163;"> <!-- pound sign, U+00A3 ISOnum -->
+<!ENTITY curren "&#164;"> <!-- currency sign, U+00A4 ISOnum -->
+<!ENTITY yen    "&#165;"> <!-- yen sign = yuan sign, U+00A5 ISOnum -->
+<!ENTITY brvbar "&#166;"> <!-- broken bar = broken vertical bar,
+                                  U+00A6 ISOnum -->
+<!ENTITY sect   "&#167;"> <!-- section sign, U+00A7 ISOnum -->
+<!ENTITY uml    "&#168;"> <!-- diaeresis = spacing diaeresis,
+                                  U+00A8 ISOdia -->
+<!ENTITY copy   "&#169;"> <!-- copyright sign, U+00A9 ISOnum -->
+<!ENTITY ordf   "&#170;"> <!-- feminine ordinal indicator, U+00AA ISOnum -->
+<!ENTITY laquo  "&#171;"> <!-- left-pointing double angle quotation mark
+                                  = left pointing guillemet, U+00AB ISOnum -->
+<!ENTITY not    "&#172;"> <!-- not sign = angled dash,
+                                  U+00AC ISOnum -->
+<!ENTITY shy    "&#173;"> <!-- soft hyphen = discretionary hyphen,
+                                  U+00AD ISOnum -->
+<!ENTITY reg    "&#174;"> <!-- registered sign = registered trade mark sign,
+                                  U+00AE ISOnum -->
+<!ENTITY macr   "&#175;"> <!-- macron = spacing macron = overline
+                                  = APL overbar, U+00AF ISOdia -->
+<!ENTITY deg    "&#176;"> <!-- degree sign, U+00B0 ISOnum -->
+<!ENTITY plusmn "&#177;"> <!-- plus-minus sign = plus-or-minus sign,
+                                  U+00B1 ISOnum -->
+<!ENTITY sup2   "&#178;"> <!-- superscript two = superscript digit two
+                                  = squared, U+00B2 ISOnum -->
+<!ENTITY sup3   "&#179;"> <!-- superscript three = superscript digit three
+                                  = cubed, U+00B3 ISOnum -->
+<!ENTITY acute  "&#180;"> <!-- acute accent = spacing acute,
+                                  U+00B4 ISOdia -->
+<!ENTITY micro  "&#181;"> <!-- micro sign, U+00B5 ISOnum -->
+<!ENTITY para   "&#182;"> <!-- pilcrow sign = paragraph sign,
+                                  U+00B6 ISOnum -->
+<!ENTITY middot "&#183;"> <!-- middle dot = Georgian comma
+                                  = Greek middle dot, U+00B7 ISOnum -->
+<!ENTITY cedil  "&#184;"> <!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
+<!ENTITY sup1   "&#185;"> <!-- superscript one = superscript digit one,
+                                  U+00B9 ISOnum -->
+<!ENTITY ordm   "&#186;"> <!-- masculine ordinal indicator,
+                                  U+00BA ISOnum -->
+<!ENTITY raquo  "&#187;"> <!-- right-pointing double angle quotation mark
+                                  = right pointing guillemet, U+00BB ISOnum -->
+<!ENTITY frac14 "&#188;"> <!-- vulgar fraction one quarter
+                                  = fraction one quarter, U+00BC ISOnum -->
+<!ENTITY frac12 "&#189;"> <!-- vulgar fraction one half
+                                  = fraction one half, U+00BD ISOnum -->
+<!ENTITY frac34 "&#190;"> <!-- vulgar fraction three quarters
+                                  = fraction three quarters, U+00BE ISOnum -->
+<!ENTITY iquest "&#191;"> <!-- inverted question mark
+                                  = turned question mark, U+00BF ISOnum -->
+<!ENTITY Agrave "&#192;"> <!-- latin capital letter A with grave
+                                  = latin capital letter A grave,
+                                  U+00C0 ISOlat1 -->
+<!ENTITY Aacute "&#193;"> <!-- latin capital letter A with acute,
+                                  U+00C1 ISOlat1 -->
+<!ENTITY Acirc  "&#194;"> <!-- latin capital letter A with circumflex,
+                                  U+00C2 ISOlat1 -->
+<!ENTITY Atilde "&#195;"> <!-- latin capital letter A with tilde,
+                                  U+00C3 ISOlat1 -->
+<!ENTITY Auml   "&#196;"> <!-- latin capital letter A with diaeresis,
+                                  U+00C4 ISOlat1 -->
+<!ENTITY Aring  "&#197;"> <!-- latin capital letter A with ring above
+                                  = latin capital letter A ring,
+                                  U+00C5 ISOlat1 -->
+<!ENTITY AElig  "&#198;"> <!-- latin capital letter AE
+                                  = latin capital ligature AE,
+                                  U+00C6 ISOlat1 -->
+<!ENTITY Ccedil "&#199;"> <!-- latin capital letter C with cedilla,
+                                  U+00C7 ISOlat1 -->
+<!ENTITY Egrave "&#200;"> <!-- latin capital letter E with grave,
+                                  U+00C8 ISOlat1 -->
+<!ENTITY Eacute "&#201;"> <!-- latin capital letter E with acute,
+                                  U+00C9 ISOlat1 -->
+<!ENTITY Ecirc  "&#202;"> <!-- latin capital letter E with circumflex,
+                                  U+00CA ISOlat1 -->
+<!ENTITY Euml   "&#203;"> <!-- latin capital letter E with diaeresis,
+                                  U+00CB ISOlat1 -->
+<!ENTITY Igrave "&#204;"> <!-- latin capital letter I with grave,
+                                  U+00CC ISOlat1 -->
+<!ENTITY Iacute "&#205;"> <!-- latin capital letter I with acute,
+                                  U+00CD ISOlat1 -->
+<!ENTITY Icirc  "&#206;"> <!-- latin capital letter I with circumflex,
+                                  U+00CE ISOlat1 -->
+<!ENTITY Iuml   "&#207;"> <!-- latin capital letter I with diaeresis,
+                                  U+00CF ISOlat1 -->
+<!ENTITY ETH    "&#208;"> <!-- latin capital letter ETH, U+00D0 ISOlat1 -->
+<!ENTITY Ntilde "&#209;"> <!-- latin capital letter N with tilde,
+                                  U+00D1 ISOlat1 -->
+<!ENTITY Ograve "&#210;"> <!-- latin capital letter O with grave,
+                                  U+00D2 ISOlat1 -->
+<!ENTITY Oacute "&#211;"> <!-- latin capital letter O with acute,
+                                  U+00D3 ISOlat1 -->
+<!ENTITY Ocirc  "&#212;"> <!-- latin capital letter O with circumflex,
+                                  U+00D4 ISOlat1 -->
+<!ENTITY Otilde "&#213;"> <!-- latin capital letter O with tilde,
+                                  U+00D5 ISOlat1 -->
+<!ENTITY Ouml   "&#214;"> <!-- latin capital letter O with diaeresis,
+                                  U+00D6 ISOlat1 -->
+<!ENTITY times  "&#215;"> <!-- multiplication sign, U+00D7 ISOnum -->
+<!ENTITY Oslash "&#216;"> <!-- latin capital letter O with stroke
+                                  = latin capital letter O slash,
+                                  U+00D8 ISOlat1 -->
+<!ENTITY Ugrave "&#217;"> <!-- latin capital letter U with grave,
+                                  U+00D9 ISOlat1 -->
+<!ENTITY Uacute "&#218;"> <!-- latin capital letter U with acute,
+                                  U+00DA ISOlat1 -->
+<!ENTITY Ucirc  "&#219;"> <!-- latin capital letter U with circumflex,
+                                  U+00DB ISOlat1 -->
+<!ENTITY Uuml   "&#220;"> <!-- latin capital letter U with diaeresis,
+                                  U+00DC ISOlat1 -->
+<!ENTITY Yacute "&#221;"> <!-- latin capital letter Y with acute,
+                                  U+00DD ISOlat1 -->
+<!ENTITY THORN  "&#222;"> <!-- latin capital letter THORN,
+                                  U+00DE ISOlat1 -->
+<!ENTITY szlig  "&#223;"> <!-- latin small letter sharp s = ess-zed,
+                                  U+00DF ISOlat1 -->
+<!ENTITY agrave "&#224;"> <!-- latin small letter a with grave
+                                  = latin small letter a grave,
+                                  U+00E0 ISOlat1 -->
+<!ENTITY aacute "&#225;"> <!-- latin small letter a with acute,
+                                  U+00E1 ISOlat1 -->
+<!ENTITY acirc  "&#226;"> <!-- latin small letter a with circumflex,
+                                  U+00E2 ISOlat1 -->
+<!ENTITY atilde "&#227;"> <!-- latin small letter a with tilde,
+                                  U+00E3 ISOlat1 -->
+<!ENTITY auml   "&#228;"> <!-- latin small letter a with diaeresis,
+                                  U+00E4 ISOlat1 -->
+<!ENTITY aring  "&#229;"> <!-- latin small letter a with ring above
+                                  = latin small letter a ring,
+                                  U+00E5 ISOlat1 -->
+<!ENTITY aelig  "&#230;"> <!-- latin small letter ae
+                                  = latin small ligature ae, U+00E6 ISOlat1 -->
+<!ENTITY ccedil "&#231;"> <!-- latin small letter c with cedilla,
+                                  U+00E7 ISOlat1 -->
+<!ENTITY egrave "&#232;"> <!-- latin small letter e with grave,
+                                  U+00E8 ISOlat1 -->
+<!ENTITY eacute "&#233;"> <!-- latin small letter e with acute,
+                                  U+00E9 ISOlat1 -->
+<!ENTITY ecirc  "&#234;"> <!-- latin small letter e with circumflex,
+                                  U+00EA ISOlat1 -->
+<!ENTITY euml   "&#235;"> <!-- latin small letter e with diaeresis,
+                                  U+00EB ISOlat1 -->
+<!ENTITY igrave "&#236;"> <!-- latin small letter i with grave,
+                                  U+00EC ISOlat1 -->
+<!ENTITY iacute "&#237;"> <!-- latin small letter i with acute,
+                                  U+00ED ISOlat1 -->
+<!ENTITY icirc  "&#238;"> <!-- latin small letter i with circumflex,
+                                  U+00EE ISOlat1 -->
+<!ENTITY iuml   "&#239;"> <!-- latin small letter i with diaeresis,
+                                  U+00EF ISOlat1 -->
+<!ENTITY eth    "&#240;"> <!-- latin small letter eth, U+00F0 ISOlat1 -->
+<!ENTITY ntilde "&#241;"> <!-- latin small letter n with tilde,
+                                  U+00F1 ISOlat1 -->
+<!ENTITY ograve "&#242;"> <!-- latin small letter o with grave,
+                                  U+00F2 ISOlat1 -->
+<!ENTITY oacute "&#243;"> <!-- latin small letter o with acute,
+                                  U+00F3 ISOlat1 -->
+<!ENTITY ocirc  "&#244;"> <!-- latin small letter o with circumflex,
+                                  U+00F4 ISOlat1 -->
+<!ENTITY otilde "&#245;"> <!-- latin small letter o with tilde,
+                                  U+00F5 ISOlat1 -->
+<!ENTITY ouml   "&#246;"> <!-- latin small letter o with diaeresis,
+                                  U+00F6 ISOlat1 -->
+<!ENTITY divide "&#247;"> <!-- division sign, U+00F7 ISOnum -->
+<!ENTITY oslash "&#248;"> <!-- latin small letter o with stroke,
+                                  = latin small letter o slash,
+                                  U+00F8 ISOlat1 -->
+<!ENTITY ugrave "&#249;"> <!-- latin small letter u with grave,
+                                  U+00F9 ISOlat1 -->
+<!ENTITY uacute "&#250;"> <!-- latin small letter u with acute,
+                                  U+00FA ISOlat1 -->
+<!ENTITY ucirc  "&#251;"> <!-- latin small letter u with circumflex,
+                                  U+00FB ISOlat1 -->
+<!ENTITY uuml   "&#252;"> <!-- latin small letter u with diaeresis,
+                                  U+00FC ISOlat1 -->
+<!ENTITY yacute "&#253;"> <!-- latin small letter y with acute,
+                                  U+00FD ISOlat1 -->
+<!ENTITY thorn  "&#254;"> <!-- latin small letter thorn,
+                                  U+00FE ISOlat1 -->
+<!ENTITY yuml   "&#255;"> <!-- latin small letter y with diaeresis,
+                                  U+00FF ISOlat1 -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-link-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-link-1.mod
new file mode 100644
index 0000000..a7587a6
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-link-1.mod
@@ -0,0 +1,59 @@
+<!-- ...................................................................... -->
+<!-- XHTML Link Element Module  ........................................... -->
+<!-- file: xhtml-link-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-link-1.mod,v 4.1 2001/04/05 06:57:40 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
+       SYSTEM "xhtml-link-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Link element
+
+        link
+
+     This module declares the link element type and its attributes,
+     which could (in principle) be used to define document-level links
+     to external resources such as:
+
+     a) for document specific toolbars/menus, e.g. start, contents,
+        previous, next, index, end, help
+     b) to link to a separate style sheet (rel="stylesheet")
+     c) to make a link to a script (rel="script")
+     d) by style sheets to control how collections of html nodes are
+        rendered into printed documents
+     e) to make a link to a printable version of this document
+        e.g. a postscript or pdf version (rel="alternate" media="print")
+-->
+
+<!-- link: Media-Independent Link ...................... -->
+
+<!ENTITY % link.element  "INCLUDE" >
+<![%link.element;[
+<!ENTITY % link.content  "EMPTY" >
+<!ENTITY % link.qname  "link" >
+<!ELEMENT %link.qname;  %link.content; >
+<!-- end of link.element -->]]>
+
+<!ENTITY % link.attlist  "INCLUDE" >
+<![%link.attlist;[
+<!ATTLIST %link.qname;
+      %Common.attrib;
+      charset      %Charset.datatype;       #IMPLIED
+      href         %URI.datatype;           #IMPLIED
+      hreflang     %LanguageCode.datatype;  #IMPLIED
+      type         %ContentType.datatype;   #IMPLIED
+      rel          %LinkTypes.datatype;     #IMPLIED
+      rev          %LinkTypes.datatype;     #IMPLIED
+      media        %MediaDesc.datatype;     #IMPLIED
+>
+<!-- end of link.attlist -->]]>
+
+<!-- end of xhtml-link-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-list-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-list-1.mod
new file mode 100644
index 0000000..4c73ab5
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-list-1.mod
@@ -0,0 +1,129 @@
+<!-- ...................................................................... -->
+<!-- XHTML Lists Module  .................................................. -->
+<!-- file: xhtml-list-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-list-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
+       SYSTEM "xhtml-list-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Lists
+
+        dl, dt, dd, ol, ul, li
+
+     This module declares the list-oriented element types
+     and their attributes.
+-->
+
+<!ENTITY % dl.qname  "dl" >
+<!ENTITY % dt.qname  "dt" >
+<!ENTITY % dd.qname  "dd" >
+<!ENTITY % ol.qname  "ol" >
+<!ENTITY % ul.qname  "ul" >
+<!ENTITY % li.qname  "li" >
+
+<!-- dl: Definition List ............................... -->
+
+<!ENTITY % dl.element  "INCLUDE" >
+<![%dl.element;[
+<!ENTITY % dl.content  "( %dt.qname; | %dd.qname; )+" >
+<!ELEMENT %dl.qname;  %dl.content; >
+<!-- end of dl.element -->]]>
+
+<!ENTITY % dl.attlist  "INCLUDE" >
+<![%dl.attlist;[
+<!ATTLIST %dl.qname;
+      %Common.attrib;
+>
+<!-- end of dl.attlist -->]]>
+
+<!-- dt: Definition Term ............................... -->
+
+<!ENTITY % dt.element  "INCLUDE" >
+<![%dt.element;[
+<!ENTITY % dt.content
+     "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %dt.qname;  %dt.content; >
+<!-- end of dt.element -->]]>
+
+<!ENTITY % dt.attlist  "INCLUDE" >
+<![%dt.attlist;[
+<!ATTLIST %dt.qname;
+      %Common.attrib;
+>
+<!-- end of dt.attlist -->]]>
+
+<!-- dd: Definition Description ........................ -->
+
+<!ENTITY % dd.element  "INCLUDE" >
+<![%dd.element;[
+<!ENTITY % dd.content
+     "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %dd.qname;  %dd.content; >
+<!-- end of dd.element -->]]>
+
+<!ENTITY % dd.attlist  "INCLUDE" >
+<![%dd.attlist;[
+<!ATTLIST %dd.qname;
+      %Common.attrib;
+>
+<!-- end of dd.attlist -->]]>
+
+<!-- ol: Ordered List (numbered styles) ................ -->
+
+<!ENTITY % ol.element  "INCLUDE" >
+<![%ol.element;[
+<!ENTITY % ol.content  "( %li.qname; )+" >
+<!ELEMENT %ol.qname;  %ol.content; >
+<!-- end of ol.element -->]]>
+
+<!ENTITY % ol.attlist  "INCLUDE" >
+<![%ol.attlist;[
+<!ATTLIST %ol.qname;
+      %Common.attrib;
+>
+<!-- end of ol.attlist -->]]>
+
+<!-- ul: Unordered List (bullet styles) ................ -->
+
+<!ENTITY % ul.element  "INCLUDE" >
+<![%ul.element;[
+<!ENTITY % ul.content  "( %li.qname; )+" >
+<!ELEMENT %ul.qname;  %ul.content; >
+<!-- end of ul.element -->]]>
+
+<!ENTITY % ul.attlist  "INCLUDE" >
+<![%ul.attlist;[
+<!ATTLIST %ul.qname;
+      %Common.attrib;
+>
+<!-- end of ul.attlist -->]]>
+
+<!-- li: List Item ..................................... -->
+
+<!ENTITY % li.element  "INCLUDE" >
+<![%li.element;[
+<!ENTITY % li.content
+     "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %li.qname;  %li.content; >
+<!-- end of li.element -->]]>
+
+<!ENTITY % li.attlist  "INCLUDE" >
+<![%li.attlist;[
+<!ATTLIST %li.qname;
+      %Common.attrib;
+>
+<!-- end of li.attlist -->]]>
+
+<!-- end of xhtml-list-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-meta-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-meta-1.mod
new file mode 100644
index 0000000..a0200f7
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-meta-1.mod
@@ -0,0 +1,47 @@
+<!-- ...................................................................... -->
+<!-- XHTML Document Metainformation Module  ............................... -->
+<!-- file: xhtml-meta-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-meta-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
+       SYSTEM "xhtml-meta-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Meta Information
+
+        meta
+
+     This module declares the meta element type and its attributes,
+     used to provide declarative document metainformation.
+-->
+
+<!-- meta: Generic Metainformation ..................... -->
+
+<!ENTITY % meta.element  "INCLUDE" >
+<![%meta.element;[
+<!ENTITY % meta.content  "EMPTY" >
+<!ENTITY % meta.qname  "meta" >
+<!ELEMENT %meta.qname;  %meta.content; >
+<!-- end of meta.element -->]]>
+
+<!ENTITY % meta.attlist  "INCLUDE" >
+<![%meta.attlist;[
+<!ATTLIST %meta.qname;
+      %XHTML.xmlns.attrib;
+      %I18n.attrib;
+      http-equiv   NMTOKEN                  #IMPLIED
+      name         NMTOKEN                  #IMPLIED
+      content      CDATA                    #REQUIRED
+      scheme       CDATA                    #IMPLIED
+>
+<!-- end of meta.attlist -->]]>
+
+<!-- end of xhtml-meta-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-notations-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-notations-1.mod
new file mode 100644
index 0000000..ac970b6
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-notations-1.mod
@@ -0,0 +1,114 @@
+<!-- ...................................................................... -->
+<!-- XHTML Notations Module  .............................................. -->
+<!-- file: xhtml-notations-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-notations-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN"
+       SYSTEM "xhtml-notations-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Notations
+
+     defines the following notations, many of these imported from
+     other specifications and standards. When an existing FPI is
+     known, it is incorporated here.
+-->
+
+<!-- XML Notations ..................................... -->
+<!-- SGML and XML Notations ............................ -->
+
+<!-- W3C XML 1.0 Recommendation -->
+<!NOTATION w3c-xml
+     PUBLIC "ISO 8879//NOTATION Extensible Markup Language (XML) 1.0//EN" >
+
+<!-- XML 1.0 CDATA -->
+<!NOTATION cdata
+     PUBLIC "-//W3C//NOTATION XML 1.0: CDATA//EN" >
+
+<!-- SGML Formal Public Identifiers -->
+<!NOTATION fpi
+     PUBLIC "ISO 8879:1986//NOTATION Formal Public Identifier//EN" >
+
+<!-- XHTML Notations ................................... -->
+
+<!-- Length defined for cellpadding/cellspacing -->
+
+<!-- nn for pixels or nn% for percentage length -->
+<!NOTATION length
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Length//EN" >
+
+<!-- space-separated list of link types -->
+<!NOTATION linkTypes
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: LinkTypes//EN" >
+
+<!-- single or comma-separated list of media descriptors -->
+<!NOTATION mediaDesc
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: MediaDesc//EN" >
+
+<!-- pixel, percentage, or relative -->
+<!NOTATION multiLength
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: MultiLength//EN" >
+
+<!-- one or more digits (NUMBER) -->
+<!NOTATION number
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Number//EN" >
+
+<!-- integer representing length in pixels -->
+<!NOTATION pixels
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Pixels//EN" >
+
+<!-- script expression -->
+<!NOTATION script
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Script//EN" >
+
+<!-- textual content -->
+<!NOTATION text
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Text//EN" >
+
+<!-- Imported Notations ................................ -->
+
+<!-- a single character from [ISO10646] -->
+<!NOTATION character
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Character//EN" >
+
+<!-- a character encoding, as per [RFC2045] -->
+<!NOTATION charset
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Charset//EN" >
+
+<!-- a space separated list of character encodings, as per [RFC2045] -->
+<!NOTATION charsets
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Charsets//EN" >
+
+<!-- media type, as per [RFC2045] -->
+<!NOTATION contentType
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: ContentType//EN" >
+
+<!-- comma-separated list of media types, as per [RFC2045] -->
+<!NOTATION contentTypes
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: ContentTypes//EN" >
+
+<!-- date and time information. ISO date format -->
+<!NOTATION datetime
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: Datetime//EN" >
+
+<!-- a language code, as per [RFC3066] -->
+<!NOTATION languageCode
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: LanguageCode//EN" >
+
+<!-- a Uniform Resource Identifier, see [URI] -->
+<!NOTATION uri
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: URI//EN" >
+
+<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
+<!NOTATION uris
+    PUBLIC "-//W3C//NOTATION XHTML Datatype: URIs//EN" >
+
+<!-- end of xhtml-notations-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-object-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-object-1.mod
new file mode 100644
index 0000000..744f0e7
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-object-1.mod
@@ -0,0 +1,60 @@
+<!-- ...................................................................... -->
+<!-- XHTML Embedded Object Module  ........................................ -->
+<!-- file: xhtml-object-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-object-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
+       SYSTEM "xhtml-object-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Embedded Objects
+
+        object
+
+     This module declares the object element type and its attributes, used
+     to embed external objects as part of XHTML pages. In the document,
+     place param elements prior to other content within the object element.
+
+     Note that use of this module requires instantiation of the Param
+     Element Module.
+-->
+
+<!-- object: Generic Embedded Object ................... -->
+
+<!ENTITY % object.element  "INCLUDE" >
+<![%object.element;[
+<!ENTITY % object.content
+     "( #PCDATA | %Flow.mix; | %param.qname; )*"
+>
+<!ENTITY % object.qname  "object" >
+<!ELEMENT %object.qname;  %object.content; >
+<!-- end of object.element -->]]>
+
+<!ENTITY % object.attlist  "INCLUDE" >
+<![%object.attlist;[
+<!ATTLIST %object.qname;
+      %Common.attrib;
+      declare      ( declare )              #IMPLIED
+      classid      %URI.datatype;           #IMPLIED
+      codebase     %URI.datatype;           #IMPLIED
+      data         %URI.datatype;           #IMPLIED
+      type         %ContentType.datatype;   #IMPLIED
+      codetype     %ContentType.datatype;   #IMPLIED
+      archive      %URIs.datatype;          #IMPLIED
+      standby      %Text.datatype;          #IMPLIED
+      height       %Length.datatype;        #IMPLIED
+      width        %Length.datatype;        #IMPLIED
+      name         CDATA                    #IMPLIED
+      tabindex     %Number.datatype;        #IMPLIED
+>
+<!-- end of object.attlist -->]]>
+
+<!-- end of xhtml-object-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-param-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-param-1.mod
new file mode 100644
index 0000000..4d1fd2e
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-param-1.mod
@@ -0,0 +1,48 @@
+<!-- ...................................................................... -->
+<!-- XHTML Param Element Module  ..................................... -->
+<!-- file: xhtml-param-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-param-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
+       SYSTEM "xhtml-param-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Parameters for Java Applets and Embedded Objects
+
+        param
+
+     This module provides declarations for the param element,
+     used to provide named property values for the applet
+     and object elements.
+-->
+
+<!-- param: Named Property Value ....................... -->
+
+<!ENTITY % param.element  "INCLUDE" >
+<![%param.element;[
+<!ENTITY % param.content  "EMPTY" >
+<!ENTITY % param.qname  "param" >
+<!ELEMENT %param.qname;  %param.content; >
+<!-- end of param.element -->]]>
+
+<!ENTITY % param.attlist  "INCLUDE" >
+<![%param.attlist;[
+<!ATTLIST %param.qname;
+      %XHTML.xmlns.attrib;
+      %id.attrib;
+      name         CDATA                    #REQUIRED
+      value        CDATA                    #IMPLIED
+      valuetype    ( data | ref | object )  'data'
+      type         %ContentType.datatype;   #IMPLIED
+>
+<!-- end of param.attlist -->]]>
+
+<!-- end of xhtml-param-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-qname-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-qname-1.mod
new file mode 100644
index 0000000..5e8b378
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-qname-1.mod
@@ -0,0 +1,318 @@
+<!-- ....................................................................... -->
+<!-- XHTML Qname Module  ................................................... -->
+<!-- file: xhtml-qname-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-qname-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
+       SYSTEM "xhtml-qname-1.mod"
+
+     Revisions:
+#2000-10-22: added qname declarations for ruby elements
+     ....................................................................... -->
+
+<!-- XHTML Qname (Qualified Name) Module
+
+     This module is contained in two parts, labeled Section 'A' and 'B':
+
+       Section A declares parameter entities to support namespace-
+       qualified names, namespace declarations, and name prefixing
+       for XHTML and extensions.
+
+       Section B declares parameter entities used to provide
+       namespace-qualified names for all XHTML element types:
+
+         %applet.qname;   the xmlns-qualified name for <applet>
+         %base.qname;     the xmlns-qualified name for <base>
+         ...
+
+     XHTML extensions would create a module similar to this one.
+     Included in the XHTML distribution is a template module
+     ('template-qname-1.mod') suitable for this purpose.
+-->
+
+<!-- Section A: XHTML XML Namespace Framework :::::::::::::::::::: -->
+
+<!-- 1. Declare a %XHTML.prefixed; conditional section keyword, used
+        to activate namespace prefixing. The default value should
+        inherit '%NS.prefixed;' from the DTD driver, so that unless
+        overridden, the default behaviour follows the overall DTD
+        prefixing scheme.
+-->
+<!ENTITY % NS.prefixed "IGNORE" >
+<!ENTITY % XHTML.prefixed "%NS.prefixed;" >
+
+<!-- By default, we always permit XHTML attribute collections to have
+     namespace-qualified prefixes as well.
+-->
+<!ENTITY % XHTML.global.attrs.prefixed "INCLUDE" >
+<!-- By default, we allow the XML Schema attributes on the root
+     element.
+-->
+<!ENTITY % XHTML.xsi.attrs "INCLUDE" >
+
+<!-- 2. Declare a parameter entity (eg., %XHTML.xmlns;) containing
+        the URI reference used to identify the XHTML namespace:
+-->
+<!ENTITY % XHTML.xmlns  "http://www.w3.org/1999/xhtml" >
+
+<!-- 3. Declare parameter entities (eg., %XHTML.prefix;) containing
+        the default namespace prefix string(s) to use when prefixing
+        is enabled. This may be overridden in the DTD driver or the
+        internal subset of an document instance. If no default prefix
+        is desired, this may be declared as an empty string.
+
+     NOTE: As specified in [XMLNAMES], the namespace prefix serves
+     as a proxy for the URI reference, and is not in itself significant.
+-->
+<!ENTITY % XHTML.prefix  "xhtml" >
+
+<!-- 4. Declare parameter entities (eg., %XHTML.pfx;) containing the
+        colonized prefix(es) (eg., '%XHTML.prefix;:') used when
+        prefixing is active, an empty string when it is not.
+-->
+<![%XHTML.prefixed;[
+<!ENTITY % XHTML.pfx  "%XHTML.prefix;:" >
+]]>
+<!ENTITY % XHTML.pfx  "" >
+
+<!-- declare qualified name extensions here ............ -->
+<!ENTITY % xhtml-qname-extra.mod "" >
+%xhtml-qname-extra.mod;
+
+<!-- 5. The parameter entity %XHTML.xmlns.extra.attrib; may be
+        redeclared to contain any non-XHTML namespace declaration
+        attributes for namespaces embedded in XHTML. The default
+        is an empty string.  XLink should be included here if used
+        in the DTD.
+-->
+<!ENTITY % XHTML.xmlns.extra.attrib "" >
+
+<!-- The remainder of Section A is only followed in XHTML, not extensions. -->
+
+<!-- Declare a parameter entity %NS.decl.attrib; containing
+     all XML Namespace declarations used in the DTD, plus the
+     xmlns declaration for XHTML, its form dependent on whether
+     prefixing is active.
+-->
+<!ENTITY % XHTML.xmlns.attrib.prefixed
+     "xmlns:%XHTML.prefix;  %URI.datatype;   #FIXED '%XHTML.xmlns;'"
+>
+<![%XHTML.prefixed;[
+<!ENTITY % NS.decl.attrib
+     "%XHTML.xmlns.attrib.prefixed;
+      %XHTML.xmlns.extra.attrib;"
+>
+]]>
+<!ENTITY % NS.decl.attrib
+     "%XHTML.xmlns.extra.attrib;"
+>
+
+<!-- Declare a parameter entity %XSI.prefix as a prefix to use for XML
+     Schema Instance attributes.
+-->
+<!ENTITY % XSI.prefix "xsi" >
+
+<!ENTITY % XSI.xmlns "http://www.w3.org/2001/XMLSchema-instance" >
+
+<!-- Declare a parameter entity %XSI.xmlns.attrib as support for the
+     schemaLocation attribute, since this is legal throughout the DTD.
+-->
+<!ENTITY % XSI.xmlns.attrib
+     "xmlns:%XSI.prefix;  %URI.datatype;   #FIXED '%XSI.xmlns;'" >
+
+<!-- This is a placeholder for future XLink support.
+-->
+<!ENTITY % XLINK.xmlns.attrib "" >
+
+<!-- This is the attribute for the XML Schema namespace - XHTML
+     Modularization is also expressed in XML Schema, and it needs to
+	 be legal to declare the XML Schema namespace and the
+	 schemaLocation attribute on the root element of XHTML family
+	 documents.
+-->
+<![%XHTML.xsi.attrs;[
+<!ENTITY % XSI.prefix "xsi" >
+<!ENTITY % XSI.pfx "%XSI.prefix;:" >
+<!ENTITY % XSI.xmlns "http://www.w3.org/2001/XMLSchema-instance" >
+
+<!ENTITY % XSI.xmlns.attrib
+     "xmlns:%XSI.prefix;  %URI.datatype;    #FIXED '%XSI.xmlns;'"
+>
+]]>
+<!ENTITY % XSI.prefix "" >
+<!ENTITY % XSI.pfx "" >
+<!ENTITY % XSI.xmlns.attrib "" >
+
+
+<!-- Declare a parameter entity %NS.decl.attrib; containing all
+     XML namespace declaration attributes used by XHTML, including
+     a default xmlns attribute when prefixing is inactive.
+-->
+<![%XHTML.prefixed;[
+<!ENTITY % XHTML.xmlns.attrib
+     "%NS.decl.attrib;
+      %XSI.xmlns.attrib;
+      %XLINK.xmlns.attrib;"
+>
+]]>
+<!ENTITY % XHTML.xmlns.attrib
+     "xmlns        %URI.datatype;           #FIXED '%XHTML.xmlns;'
+      %NS.decl.attrib;
+      %XSI.xmlns.attrib;
+      %XLINK.xmlns.attrib;"
+>
+
+<!-- placeholder for qualified name redeclarations -->
+<!ENTITY % xhtml-qname.redecl "" >
+%xhtml-qname.redecl;
+
+<!-- Section B: XHTML Qualified Names ::::::::::::::::::::::::::::: -->
+
+<!-- 6. This section declares parameter entities used to provide
+        namespace-qualified names for all XHTML element types.
+-->
+
+<!-- module:  xhtml-applet-1.mod -->
+<!ENTITY % applet.qname  "%XHTML.pfx;applet" >
+
+<!-- module:  xhtml-base-1.mod -->
+<!ENTITY % base.qname    "%XHTML.pfx;base" >
+
+<!-- module:  xhtml-bdo-1.mod -->
+<!ENTITY % bdo.qname     "%XHTML.pfx;bdo" >
+
+<!-- module:  xhtml-blkphras-1.mod -->
+<!ENTITY % address.qname "%XHTML.pfx;address" >
+<!ENTITY % blockquote.qname  "%XHTML.pfx;blockquote" >
+<!ENTITY % pre.qname     "%XHTML.pfx;pre" >
+<!ENTITY % h1.qname      "%XHTML.pfx;h1" >
+<!ENTITY % h2.qname      "%XHTML.pfx;h2" >
+<!ENTITY % h3.qname      "%XHTML.pfx;h3" >
+<!ENTITY % h4.qname      "%XHTML.pfx;h4" >
+<!ENTITY % h5.qname      "%XHTML.pfx;h5" >
+<!ENTITY % h6.qname      "%XHTML.pfx;h6" >
+
+<!-- module:  xhtml-blkpres-1.mod -->
+<!ENTITY % hr.qname      "%XHTML.pfx;hr" >
+
+<!-- module:  xhtml-blkstruct-1.mod -->
+<!ENTITY % div.qname     "%XHTML.pfx;div" >
+<!ENTITY % p.qname       "%XHTML.pfx;p" >
+
+<!-- module:  xhtml-edit-1.mod -->
+<!ENTITY % ins.qname     "%XHTML.pfx;ins" >
+<!ENTITY % del.qname     "%XHTML.pfx;del" >
+
+<!-- module:  xhtml-form-1.mod -->
+<!ENTITY % form.qname    "%XHTML.pfx;form" >
+<!ENTITY % label.qname   "%XHTML.pfx;label" >
+<!ENTITY % input.qname   "%XHTML.pfx;input" >
+<!ENTITY % select.qname  "%XHTML.pfx;select" >
+<!ENTITY % optgroup.qname  "%XHTML.pfx;optgroup" >
+<!ENTITY % option.qname  "%XHTML.pfx;option" >
+<!ENTITY % textarea.qname  "%XHTML.pfx;textarea" >
+<!ENTITY % fieldset.qname  "%XHTML.pfx;fieldset" >
+<!ENTITY % legend.qname  "%XHTML.pfx;legend" >
+<!ENTITY % button.qname  "%XHTML.pfx;button" >
+
+<!-- module:  xhtml-hypertext-1.mod -->
+<!ENTITY % a.qname       "%XHTML.pfx;a" >
+
+<!-- module:  xhtml-image-1.mod -->
+<!ENTITY % img.qname     "%XHTML.pfx;img" >
+
+<!-- module:  xhtml-inlphras-1.mod -->
+<!ENTITY % abbr.qname    "%XHTML.pfx;abbr" >
+<!ENTITY % acronym.qname "%XHTML.pfx;acronym" >
+<!ENTITY % cite.qname    "%XHTML.pfx;cite" >
+<!ENTITY % code.qname    "%XHTML.pfx;code" >
+<!ENTITY % dfn.qname     "%XHTML.pfx;dfn" >
+<!ENTITY % em.qname      "%XHTML.pfx;em" >
+<!ENTITY % kbd.qname     "%XHTML.pfx;kbd" >
+<!ENTITY % q.qname       "%XHTML.pfx;q" >
+<!ENTITY % samp.qname    "%XHTML.pfx;samp" >
+<!ENTITY % strong.qname  "%XHTML.pfx;strong" >
+<!ENTITY % var.qname     "%XHTML.pfx;var" >
+
+<!-- module:  xhtml-inlpres-1.mod -->
+<!ENTITY % b.qname       "%XHTML.pfx;b" >
+<!ENTITY % big.qname     "%XHTML.pfx;big" >
+<!ENTITY % i.qname       "%XHTML.pfx;i" >
+<!ENTITY % small.qname   "%XHTML.pfx;small" >
+<!ENTITY % sub.qname     "%XHTML.pfx;sub" >
+<!ENTITY % sup.qname     "%XHTML.pfx;sup" >
+<!ENTITY % tt.qname      "%XHTML.pfx;tt" >
+
+<!-- module:  xhtml-inlstruct-1.mod -->
+<!ENTITY % br.qname      "%XHTML.pfx;br" >
+<!ENTITY % span.qname    "%XHTML.pfx;span" >
+
+<!-- module:  xhtml-ismap-1.mod (also csismap, ssismap) -->
+<!ENTITY % map.qname     "%XHTML.pfx;map" >
+<!ENTITY % area.qname    "%XHTML.pfx;area" >
+
+<!-- module:  xhtml-link-1.mod -->
+<!ENTITY % link.qname    "%XHTML.pfx;link" >
+
+<!-- module:  xhtml-list-1.mod -->
+<!ENTITY % dl.qname      "%XHTML.pfx;dl" >
+<!ENTITY % dt.qname      "%XHTML.pfx;dt" >
+<!ENTITY % dd.qname      "%XHTML.pfx;dd" >
+<!ENTITY % ol.qname      "%XHTML.pfx;ol" >
+<!ENTITY % ul.qname      "%XHTML.pfx;ul" >
+<!ENTITY % li.qname      "%XHTML.pfx;li" >
+
+<!-- module:  xhtml-meta-1.mod -->
+<!ENTITY % meta.qname    "%XHTML.pfx;meta" >
+
+<!-- module:  xhtml-param-1.mod -->
+<!ENTITY % param.qname   "%XHTML.pfx;param" >
+
+<!-- module:  xhtml-object-1.mod -->
+<!ENTITY % object.qname  "%XHTML.pfx;object" >
+
+<!-- module:  xhtml-script-1.mod -->
+<!ENTITY % script.qname  "%XHTML.pfx;script" >
+<!ENTITY % noscript.qname  "%XHTML.pfx;noscript" >
+
+<!-- module:  xhtml-struct-1.mod -->
+<!ENTITY % html.qname    "%XHTML.pfx;html" >
+<!ENTITY % head.qname    "%XHTML.pfx;head" >
+<!ENTITY % title.qname   "%XHTML.pfx;title" >
+<!ENTITY % body.qname    "%XHTML.pfx;body" >
+
+<!-- module:  xhtml-style-1.mod -->
+<!ENTITY % style.qname   "%XHTML.pfx;style" >
+
+<!-- module:  xhtml-table-1.mod -->
+<!ENTITY % table.qname   "%XHTML.pfx;table" >
+<!ENTITY % caption.qname "%XHTML.pfx;caption" >
+<!ENTITY % thead.qname   "%XHTML.pfx;thead" >
+<!ENTITY % tfoot.qname   "%XHTML.pfx;tfoot" >
+<!ENTITY % tbody.qname   "%XHTML.pfx;tbody" >
+<!ENTITY % colgroup.qname  "%XHTML.pfx;colgroup" >
+<!ENTITY % col.qname     "%XHTML.pfx;col" >
+<!ENTITY % tr.qname      "%XHTML.pfx;tr" >
+<!ENTITY % th.qname      "%XHTML.pfx;th" >
+<!ENTITY % td.qname      "%XHTML.pfx;td" >
+
+<!-- module:  xhtml-ruby-1.mod -->
+
+<!ENTITY % ruby.qname    "%XHTML.pfx;ruby" >
+<!ENTITY % rbc.qname     "%XHTML.pfx;rbc" >
+<!ENTITY % rtc.qname     "%XHTML.pfx;rtc" >
+<!ENTITY % rb.qname      "%XHTML.pfx;rb" >
+<!ENTITY % rt.qname      "%XHTML.pfx;rt" >
+<!ENTITY % rp.qname      "%XHTML.pfx;rp" >
+
+<!-- Provisional XHTML 2.0 Qualified Names  ...................... -->
+
+<!-- module:  xhtml-image-2.mod -->
+<!ENTITY % alt.qname     "%XHTML.pfx;alt" >
+
+<!-- end of xhtml-qname-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-script-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-script-1.mod
new file mode 100644
index 0000000..ab74c92
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-script-1.mod
@@ -0,0 +1,66 @@
+<!-- ...................................................................... -->
+<!-- XHTML Document Scripting Module  ..................................... -->
+<!-- file: xhtml-script-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-script-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN"
+       SYSTEM "xhtml-script-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Scripting
+
+        script, noscript
+
+     This module declares element types and attributes used to provide
+     support for executable scripts as well as an alternate content
+     container where scripts are not supported.
+-->
+
+<!-- script: Scripting Statement ....................... -->
+
+<!ENTITY % script.element  "INCLUDE" >
+<![%script.element;[
+<!ENTITY % script.content  "( #PCDATA )" >
+<!ENTITY % script.qname  "script" >
+<!ELEMENT %script.qname;  %script.content; >
+<!-- end of script.element -->]]>
+
+<!ENTITY % script.attlist  "INCLUDE" >
+<![%script.attlist;[
+<!ATTLIST %script.qname;
+      %XHTML.xmlns.attrib;
+	  %id.attrib;
+      charset      %Charset.datatype;       #IMPLIED
+      type         %ContentType.datatype;   #REQUIRED
+      src          %URI.datatype;           #IMPLIED
+      defer        ( defer )                #IMPLIED
+>
+<!-- end of script.attlist -->]]>
+
+<!-- noscript: No-Script Alternate Content ............. -->
+
+<!ENTITY % noscript.element  "INCLUDE" >
+<![%noscript.element;[
+<!ENTITY % noscript.content
+     "( %Block.mix; )+"
+>
+<!ENTITY % noscript.qname  "noscript" >
+<!ELEMENT %noscript.qname;  %noscript.content; >
+<!-- end of noscript.element -->]]>
+
+<!ENTITY % noscript.attlist  "INCLUDE" >
+<![%noscript.attlist;[
+<!ATTLIST %noscript.qname;
+      %Common.attrib;
+>
+<!-- end of noscript.attlist -->]]>
+
+<!-- end of xhtml-script-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-special.ent b/xml/tests/testData/xml/XHtmlValidation3/xhtml-special.ent
new file mode 100644
index 0000000..ca358b2
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-special.ent
@@ -0,0 +1,80 @@
+<!-- Special characters for XHTML -->
+
+<!-- Character entity set. Typical invocation:
+     <!ENTITY % HTMLspecial PUBLIC
+        "-//W3C//ENTITIES Special for XHTML//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
+     %HTMLspecial;
+-->
+
+<!-- Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+     New names (i.e., not in ISO 8879 list) do not clash with any
+     existing ISO 8879 entity names. ISO 10646 character numbers
+     are given for each character, in hex. values are decimal
+     conversions of the ISO 10646 values and refer to the document
+     character set. Names are Unicode names. 
+-->
+
+<!-- C0 Controls and Basic Latin -->
+<!ENTITY quot    "&#34;"> <!--  quotation mark, U+0022 ISOnum -->
+<!ENTITY amp     "&#38;#38;"> <!--  ampersand, U+0026 ISOnum -->
+<!ENTITY lt      "&#38;#60;"> <!--  less-than sign, U+003C ISOnum -->
+<!ENTITY gt      "&#62;"> <!--  greater-than sign, U+003E ISOnum -->
+<!ENTITY apos	 "&#39;"> <!--  apostrophe = APL quote, U+0027 ISOnum -->
+
+<!-- Latin Extended-A -->
+<!ENTITY OElig   "&#338;"> <!--  latin capital ligature OE,
+                                    U+0152 ISOlat2 -->
+<!ENTITY oelig   "&#339;"> <!--  latin small ligature oe, U+0153 ISOlat2 -->
+<!-- ligature is a misnomer, this is a separate character in some languages -->
+<!ENTITY Scaron  "&#352;"> <!--  latin capital letter S with caron,
+                                    U+0160 ISOlat2 -->
+<!ENTITY scaron  "&#353;"> <!--  latin small letter s with caron,
+                                    U+0161 ISOlat2 -->
+<!ENTITY Yuml    "&#376;"> <!--  latin capital letter Y with diaeresis,
+                                    U+0178 ISOlat2 -->
+
+<!-- Spacing Modifier Letters -->
+<!ENTITY circ    "&#710;"> <!--  modifier letter circumflex accent,
+                                    U+02C6 ISOpub -->
+<!ENTITY tilde   "&#732;"> <!--  small tilde, U+02DC ISOdia -->
+
+<!-- General Punctuation -->
+<!ENTITY ensp    "&#8194;"> <!-- en space, U+2002 ISOpub -->
+<!ENTITY emsp    "&#8195;"> <!-- em space, U+2003 ISOpub -->
+<!ENTITY thinsp  "&#8201;"> <!-- thin space, U+2009 ISOpub -->
+<!ENTITY zwnj    "&#8204;"> <!-- zero width non-joiner,
+                                    U+200C NEW RFC 2070 -->
+<!ENTITY zwj     "&#8205;"> <!-- zero width joiner, U+200D NEW RFC 2070 -->
+<!ENTITY lrm     "&#8206;"> <!-- left-to-right mark, U+200E NEW RFC 2070 -->
+<!ENTITY rlm     "&#8207;"> <!-- right-to-left mark, U+200F NEW RFC 2070 -->
+<!ENTITY ndash   "&#8211;"> <!-- en dash, U+2013 ISOpub -->
+<!ENTITY mdash   "&#8212;"> <!-- em dash, U+2014 ISOpub -->
+<!ENTITY lsquo   "&#8216;"> <!-- left single quotation mark,
+                                    U+2018 ISOnum -->
+<!ENTITY rsquo   "&#8217;"> <!-- right single quotation mark,
+                                    U+2019 ISOnum -->
+<!ENTITY sbquo   "&#8218;"> <!-- single low-9 quotation mark, U+201A NEW -->
+<!ENTITY ldquo   "&#8220;"> <!-- left double quotation mark,
+                                    U+201C ISOnum -->
+<!ENTITY rdquo   "&#8221;"> <!-- right double quotation mark,
+                                    U+201D ISOnum -->
+<!ENTITY bdquo   "&#8222;"> <!-- double low-9 quotation mark, U+201E NEW -->
+<!ENTITY dagger  "&#8224;"> <!-- dagger, U+2020 ISOpub -->
+<!ENTITY Dagger  "&#8225;"> <!-- double dagger, U+2021 ISOpub -->
+<!ENTITY permil  "&#8240;"> <!-- per mille sign, U+2030 ISOtech -->
+<!ENTITY lsaquo  "&#8249;"> <!-- single left-pointing angle quotation mark,
+                                    U+2039 ISO proposed -->
+<!-- lsaquo is proposed but not yet ISO standardized -->
+<!ENTITY rsaquo  "&#8250;"> <!-- single right-pointing angle quotation mark,
+                                    U+203A ISO proposed -->
+<!-- rsaquo is proposed but not yet ISO standardized -->
+
+<!-- Currency Symbols -->
+<!ENTITY euro   "&#8364;"> <!--  euro sign, U+20AC NEW -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-struct-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-struct-1.mod
new file mode 100644
index 0000000..7e6013c
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-struct-1.mod
@@ -0,0 +1,139 @@
+<!-- ...................................................................... -->
+<!-- XHTML Structure Module  .............................................. -->
+<!-- file: xhtml-struct-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-struct-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
+       SYSTEM "xhtml-struct-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Document Structure
+
+        title, head, body, html
+
+     The Structure Module defines the major structural elements and
+     their attributes.
+
+     Note that the content model of the head element type is redeclared
+     when the Base Module is included in the DTD.
+
+     The parameter entity containing the XML namespace URI value used
+     for XHTML is '%XHTML.xmlns;', defined in the Qualified Names module.
+-->
+
+<!-- title: Document Title ............................. -->
+
+<!-- The title element is not considered part of the flow of text.
+     It should be displayed, for example as the page header or
+     window title. Exactly one title is required per document.
+-->
+
+<!ENTITY % title.element  "INCLUDE" >
+<![%title.element;[
+<!ENTITY % title.content  "( #PCDATA )" >
+<!ENTITY % title.qname  "title" >
+<!ELEMENT %title.qname;  %title.content; >
+<!-- end of title.element -->]]>
+
+<!ENTITY % title.attlist  "INCLUDE" >
+<![%title.attlist;[
+<!ATTLIST %title.qname;
+      %XHTML.xmlns.attrib;
+      %I18n.attrib;
+>
+<!-- end of title.attlist -->]]>
+
+<!-- head: Document Head ............................... -->
+
+<!ENTITY % head.element  "INCLUDE" >
+<![%head.element;[
+<!ENTITY % head.content
+    "( %HeadOpts.mix;, %title.qname;, %HeadOpts.mix; )"
+>
+<!ENTITY % head.qname  "head" >
+<!ELEMENT %head.qname;  %head.content; >
+<!-- end of head.element -->]]>
+
+<!ENTITY % head.attlist  "INCLUDE" >
+<![%head.attlist;[
+<!-- reserved for future use with document profiles
+-->
+<!ENTITY % profile.attrib
+     "profile      %URI.datatype;           '%XHTML.profile;'"
+>
+
+<!ATTLIST %head.qname;
+      %XHTML.xmlns.attrib;
+      %I18n.attrib;
+      %profile.attrib;
+>
+<!-- end of head.attlist -->]]>
+
+<!-- body: Document Body ............................... -->
+
+<!ENTITY % body.element  "INCLUDE" >
+<![%body.element;[
+<!ENTITY % body.content
+     "( %Block.mix; )+"
+>
+<!ENTITY % body.qname  "body" >
+<!ELEMENT %body.qname;  %body.content; >
+<!-- end of body.element -->]]>
+
+<!ENTITY % body.attlist  "INCLUDE" >
+<![%body.attlist;[
+<!ATTLIST %body.qname;
+      %Common.attrib;
+>
+<!-- end of body.attlist -->]]>
+
+<!-- html: XHTML Document Element ...................... -->
+
+<!ENTITY % html.element  "INCLUDE" >
+<![%html.element;[
+<!ENTITY % html.content  "( %head.qname;, %body.qname; )" >
+<!ENTITY % html.qname  "html" >
+<!ELEMENT %html.qname;  %html.content; >
+<!-- end of html.element -->]]>
+
+<![%XHTML.xsi.attrs;[
+<!-- define a parameter for the XSI schemaLocation attribute -->
+<!ENTITY % XSI.schemaLocation.attrib
+     "%XSI.pfx;schemaLocation  %URIs.datatype;    #IMPLIED"
+>
+]]>
+<!ENTITY % XSI.schemaLocation.attrib "">
+
+<!ENTITY % html.attlist  "INCLUDE" >
+<![%html.attlist;[
+<!-- version attribute value defined in driver
+-->
+<!ENTITY % XHTML.version.attrib
+     "version      %FPI.datatype;           #FIXED '%XHTML.version;'"
+>
+<!-- schemaLocation attribute from XML Schema
+-->
+<!ENTITY % XSI.schemaLocation.attrib
+     "schemaLocation   %URIs.datatype;      #IMPLIED"
+>
+
+<!-- see the Qualified Names module for information
+     on how to extend XHTML using XML namespaces
+-->
+<!ATTLIST %html.qname;
+      %XHTML.xmlns.attrib;
+      %XSI.schemaLocation.attrib;
+      %XHTML.version.attrib;
+      %I18n.attrib;
+>
+<!-- end of html.attlist -->]]>
+
+<!-- end of xhtml-struct-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-style-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-style-1.mod
new file mode 100644
index 0000000..3fa8c7b
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-style-1.mod
@@ -0,0 +1,47 @@
+<!-- ...................................................................... -->
+<!-- XHTML Document Style Sheet Module  ................................... -->
+<!-- file: xhtml-style-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-style-1.mod,v 4.1 2001/04/05 06:57:40 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//DTD XHTML Style Sheets 1.0//EN"
+       SYSTEM "xhtml-style-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Style Sheets
+
+        style
+
+     This module declares the style element type and its attributes,
+     used to embed style sheet information in the document head element.
+-->
+
+<!-- style: Style Sheet Information .................... -->
+
+<!ENTITY % style.element  "INCLUDE" >
+<![%style.element;[
+<!ENTITY % style.content  "( #PCDATA )" >
+<!ENTITY % style.qname  "style" >
+<!ELEMENT %style.qname;  %style.content; >
+<!-- end of style.element -->]]>
+
+<!ENTITY % style.attlist  "INCLUDE" >
+<![%style.attlist;[
+<!ATTLIST %style.qname;
+      %XHTML.xmlns.attrib;
+      %id.attrib;
+      %title.attrib;
+      %I18n.attrib;
+      type         %ContentType.datatype;   #REQUIRED
+      media        %MediaDesc.datatype;     #IMPLIED
+>
+<!-- end of style.attlist -->]]>
+
+<!-- end of xhtml-style-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-symbol.ent b/xml/tests/testData/xml/XHtmlValidation3/xhtml-symbol.ent
new file mode 100644
index 0000000..185cea6
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-symbol.ent
@@ -0,0 +1,204 @@
+<!-- ...................................................................... -->
+<!-- ISO Math, Greek and Symbolic Character Entity Set for XHTML .......... -->
+<!-- file: xhtml-symbol.ent
+
+     Typical invocation:
+
+       <!ENTITY % xhtml-symbol
+           PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+                  "xhtml-symbol.ent" >
+       %xhtml-symbol;
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+       SYSTEM "http://www.w3.org/TR/MarkUp/DTD/xhtml-symbol.ent"
+
+     Revision:  $Id: xhtml-symbol.ent,v 4.1 2001/04/10 09:34:14 altheim Exp $ SMI
+
+     Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with conforming
+     SGML systems and applications as defined in ISO 8879, provided
+     this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+     New names (i.e., not in ISO 8879 [SGML] list) do not clash with
+     any existing ISO 8879 entity names. ISO 10646 [ISO10646] character
+     numbers are given for each character, in hex. Entity values are
+     decimal conversions of the ISO 10646 values and refer to the
+     document character set. Names are Unicode [UNICODE] names.
+-->
+
+<!-- Latin Extended-B -->
+<!ENTITY fnof     "&#402;" ><!-- latin small f with hook = function
+                              = florin, U+0192 ISOtech -->
+
+<!-- Greek -->
+<!ENTITY Alpha    "&#913;" ><!-- greek capital letter alpha, U+0391 -->
+<!ENTITY Beta     "&#914;" ><!-- greek capital letter beta, U+0392 -->
+<!ENTITY Gamma    "&#915;" ><!-- greek capital letter gamma, U+0393 ISOgrk3 -->
+<!ENTITY Delta    "&#916;" ><!-- greek capital letter delta, U+0394 ISOgrk3 -->
+<!ENTITY Epsilon  "&#917;" ><!-- greek capital letter epsilon, U+0395 -->
+<!ENTITY Zeta     "&#918;" ><!-- greek capital letter zeta, U+0396 -->
+<!ENTITY Eta      "&#919;" ><!-- greek capital letter eta, U+0397 -->
+<!ENTITY Theta    "&#920;" ><!-- greek capital letter theta, U+0398 ISOgrk3 -->
+<!ENTITY Iota     "&#921;" ><!-- greek capital letter iota, U+0399 -->
+<!ENTITY Kappa    "&#922;" ><!-- greek capital letter kappa, U+039A -->
+<!ENTITY Lambda   "&#923;" ><!-- greek capital letter lambda, U+039B ISOgrk3 -->
+<!ENTITY Mu       "&#924;" ><!-- greek capital letter mu, U+039C -->
+<!ENTITY Nu       "&#925;" ><!-- greek capital letter nu, U+039D -->
+<!ENTITY Xi       "&#926;" ><!-- greek capital letter xi, U+039E ISOgrk3 -->
+<!ENTITY Omicron  "&#927;" ><!-- greek capital letter omicron, U+039F -->
+<!ENTITY Pi       "&#928;" ><!-- greek capital letter pi, U+03A0 ISOgrk3 -->
+<!ENTITY Rho      "&#929;" ><!-- greek capital letter rho, U+03A1 -->
+<!-- there is no Sigmaf, and no U+03A2 character either -->
+<!ENTITY Sigma    "&#931;" ><!-- greek capital letter sigma, U+03A3 ISOgrk3 -->
+<!ENTITY Tau      "&#932;" ><!-- greek capital letter tau, U+03A4 -->
+<!ENTITY Upsilon  "&#933;" ><!-- greek capital letter upsilon,
+                              U+03A5 ISOgrk3 -->
+<!ENTITY Phi      "&#934;" ><!-- greek capital letter phi, U+03A6 ISOgrk3 -->
+<!ENTITY Chi      "&#935;" ><!-- greek capital letter chi, U+03A7 -->
+<!ENTITY Psi      "&#936;" ><!-- greek capital letter psi, U+03A8 ISOgrk3 -->
+<!ENTITY Omega    "&#937;" ><!-- greek capital letter omega, U+03A9 ISOgrk3 -->
+<!ENTITY alpha    "&#945;" ><!-- greek small letter alpha, U+03B1 ISOgrk3 -->
+<!ENTITY beta     "&#946;" ><!-- greek small letter beta, U+03B2 ISOgrk3 -->
+<!ENTITY gamma    "&#947;" ><!-- greek small letter gamma, U+03B3 ISOgrk3 -->
+<!ENTITY delta    "&#948;" ><!-- greek small letter delta, U+03B4 ISOgrk3 -->
+<!ENTITY epsilon  "&#949;" ><!-- greek small letter epsilon, U+03B5 ISOgrk3 -->
+<!ENTITY zeta     "&#950;" ><!-- greek small letter zeta, U+03B6 ISOgrk3 -->
+<!ENTITY eta      "&#951;" ><!-- greek small letter eta, U+03B7 ISOgrk3 -->
+<!ENTITY theta    "&#952;" ><!-- greek small letter theta, U+03B8 ISOgrk3 -->
+<!ENTITY iota     "&#953;" ><!-- greek small letter iota, U+03B9 ISOgrk3 -->
+<!ENTITY kappa    "&#954;" ><!-- greek small letter kappa, U+03BA ISOgrk3 -->
+<!ENTITY lambda   "&#955;" ><!-- greek small letter lambda, U+03BB ISOgrk3 -->
+<!ENTITY mu       "&#956;" ><!-- greek small letter mu, U+03BC ISOgrk3 -->
+<!ENTITY nu       "&#957;" ><!-- greek small letter nu, U+03BD ISOgrk3 -->
+<!ENTITY xi       "&#958;" ><!-- greek small letter xi, U+03BE ISOgrk3 -->
+<!ENTITY omicron  "&#959;" ><!-- greek small letter omicron, U+03BF NEW -->
+<!ENTITY pi       "&#960;" ><!-- greek small letter pi, U+03C0 ISOgrk3 -->
+<!ENTITY rho      "&#961;" ><!-- greek small letter rho, U+03C1 ISOgrk3 -->
+<!ENTITY sigmaf   "&#962;" ><!-- greek small letter final sigma, U+03C2 ISOgrk3 -->
+<!ENTITY sigma    "&#963;" ><!-- greek small letter sigma, U+03C3 ISOgrk3 -->
+<!ENTITY tau      "&#964;" ><!-- greek small letter tau, U+03C4 ISOgrk3 -->
+<!ENTITY upsilon  "&#965;" ><!-- greek small letter upsilon, U+03C5 ISOgrk3 -->
+<!ENTITY phi      "&#966;" ><!-- greek small letter phi, U+03C6 ISOgrk3 -->
+<!ENTITY chi      "&#967;" ><!-- greek small letter chi, U+03C7 ISOgrk3 -->
+<!ENTITY psi      "&#968;" ><!-- greek small letter psi, U+03C8 ISOgrk3 -->
+<!ENTITY omega    "&#969;" ><!-- greek small letter omega, U+03C9 ISOgrk3 -->
+<!ENTITY thetasym "&#977;" ><!-- greek small letter theta symbol, U+03D1 NEW -->
+<!ENTITY upsih    "&#978;" ><!-- greek upsilon with hook symbol, U+03D2 NEW -->
+<!ENTITY piv      "&#982;" ><!-- greek pi symbol, U+03D6 ISOgrk3 -->
+
+<!-- General Punctuation -->
+<!ENTITY bull     "&#8226;" ><!-- bullet = black small circle, U+2022 ISOpub  -->
+<!-- bullet is NOT the same as bullet operator, U+2219 -->
+<!ENTITY hellip   "&#8230;" ><!-- horizontal ellipsis = three dot leader, U+2026 ISOpub  -->
+<!ENTITY prime    "&#8242;" ><!-- prime = minutes = feet, U+2032 ISOtech -->
+<!ENTITY Prime    "&#8243;" ><!-- double prime = seconds = inches, U+2033 ISOtech -->
+<!ENTITY oline    "&#8254;" ><!-- overline = spacing overscore, U+203E NEW -->
+<!ENTITY frasl    "&#8260;" ><!-- fraction slash, U+2044 NEW -->
+
+<!-- Letterlike Symbols -->
+<!ENTITY weierp   "&#8472;" ><!-- script capital P = power set = Weierstrass p, U+2118 ISOamso -->
+<!ENTITY image    "&#8465;" ><!-- blackletter capital I = imaginary part, U+2111 ISOamso -->
+<!ENTITY real     "&#8476;" ><!-- blackletter capital R = real part symbol, U+211C ISOamso -->
+<!ENTITY trade    "&#8482;" ><!-- trade mark sign, U+2122 ISOnum -->
+<!ENTITY alefsym  "&#8501;" ><!-- alef symbol = first transfinite cardinal, U+2135 NEW -->
+<!-- alef symbol is NOT the same as hebrew letter alef, U+05D0 although
+     the same glyph could be used to depict both characters -->
+
+<!-- Arrows -->
+<!ENTITY larr     "&#8592;" ><!-- leftwards arrow, U+2190 ISOnum -->
+<!ENTITY uarr     "&#8593;" ><!-- upwards arrow, U+2191 ISOnum-->
+<!ENTITY rarr     "&#8594;" ><!-- rightwards arrow, U+2192 ISOnum -->
+<!ENTITY darr     "&#8595;" ><!-- downwards arrow, U+2193 ISOnum -->
+<!ENTITY harr     "&#8596;" ><!-- left right arrow, U+2194 ISOamsa -->
+<!ENTITY crarr    "&#8629;" ><!-- downwards arrow with corner leftwards
+                               = carriage return, U+21B5 NEW -->
+<!ENTITY lArr     "&#8656;" ><!-- leftwards double arrow, U+21D0 ISOtech -->
+<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow
+    but also does not have any other character for that function. So ? lArr can
+    be used for 'is implied by' as ISOtech suggests -->
+<!ENTITY uArr     "&#8657;" ><!-- upwards double arrow, U+21D1 ISOamsa -->
+<!ENTITY rArr     "&#8658;" ><!-- rightwards double arrow, U+21D2 ISOtech -->
+<!-- Unicode does not say this is the 'implies' character but does not have
+     another character with this function so ?
+     rArr can be used for 'implies' as ISOtech suggests -->
+<!ENTITY dArr     "&#8659;" ><!-- downwards double arrow, U+21D3 ISOamsa -->
+<!ENTITY hArr     "&#8660;" ><!-- left right double arrow, U+21D4 ISOamsa -->
+
+<!-- Mathematical Operators -->
+<!ENTITY forall   "&#8704;" ><!-- for all, U+2200 ISOtech -->
+<!ENTITY part     "&#8706;" ><!-- partial differential, U+2202 ISOtech  -->
+<!ENTITY exist    "&#8707;" ><!-- there exists, U+2203 ISOtech -->
+<!ENTITY empty    "&#8709;" ><!-- empty set = null set, U+2205 ISOamso -->
+<!ENTITY nabla    "&#8711;" ><!-- nabla = backward difference, U+2207 ISOtech -->
+<!ENTITY isin     "&#8712;" ><!-- element of, U+2208 ISOtech -->
+<!ENTITY notin    "&#8713;" ><!-- not an element of, U+2209 ISOtech -->
+<!ENTITY ni       "&#8715;" ><!-- contains as member, U+220B ISOtech -->
+<!-- should there be a more memorable name than 'ni'? -->
+<!ENTITY prod     "&#8719;" ><!-- n-ary product = product sign, U+220F ISOamsb -->
+<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
+     the same glyph might be used for both -->
+<!ENTITY sum      "&#8721;" ><!-- n-ary sumation, U+2211 ISOamsb -->
+<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
+     though the same glyph might be used for both -->
+<!ENTITY minus    "&#8722;" ><!-- minus sign, U+2212 ISOtech -->
+<!ENTITY lowast   "&#8727;" ><!-- asterisk operator, U+2217 ISOtech -->
+<!ENTITY radic    "&#8730;" ><!-- square root = radical sign, U+221A ISOtech -->
+<!ENTITY prop     "&#8733;" ><!-- proportional to, U+221D ISOtech -->
+<!ENTITY infin    "&#8734;" ><!-- infinity, U+221E ISOtech -->
+<!ENTITY ang      "&#8736;" ><!-- angle, U+2220 ISOamso -->
+<!ENTITY and      "&#8743;" ><!-- logical and = wedge, U+2227 ISOtech -->
+<!ENTITY or       "&#8744;" ><!-- logical or = vee, U+2228 ISOtech -->
+<!ENTITY cap      "&#8745;" ><!-- intersection = cap, U+2229 ISOtech -->
+<!ENTITY cup      "&#8746;" ><!-- union = cup, U+222A ISOtech -->
+<!ENTITY int      "&#8747;" ><!-- integral, U+222B ISOtech -->
+<!ENTITY there4   "&#8756;" ><!-- therefore, U+2234 ISOtech -->
+<!ENTITY sim      "&#8764;" ><!-- tilde operator = varies with = similar to, U+223C ISOtech -->
+<!-- tilde operator is NOT the same character as the tilde, U+007E,
+     although the same glyph might be used to represent both  -->
+<!ENTITY cong     "&#8773;" ><!-- approximately equal to, U+2245 ISOtech -->
+<!ENTITY asymp    "&#8776;" ><!-- almost equal to = asymptotic to, U+2248 ISOamsr -->
+<!ENTITY ne       "&#8800;" ><!-- not equal to, U+2260 ISOtech -->
+<!ENTITY equiv    "&#8801;" ><!-- identical to, U+2261 ISOtech -->
+<!ENTITY le       "&#8804;" ><!-- less-than or equal to, U+2264 ISOtech -->
+<!ENTITY ge       "&#8805;" ><!-- greater-than or equal to, U+2265 ISOtech -->
+<!ENTITY sub      "&#8834;" ><!-- subset of, U+2282 ISOtech -->
+<!ENTITY sup      "&#8835;" ><!-- superset of, U+2283 ISOtech -->
+<!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol
+     font encoding and is not included. Should it be, for symmetry?
+     It is in ISOamsn  -->
+<!ENTITY nsub     "&#8836;" ><!-- not a subset of, U+2284 ISOamsn -->
+<!ENTITY sube     "&#8838;" ><!-- subset of or equal to, U+2286 ISOtech -->
+<!ENTITY supe     "&#8839;" ><!-- superset of or equal to, U+2287 ISOtech -->
+<!ENTITY oplus    "&#8853;" ><!-- circled plus = direct sum, U+2295 ISOamsb -->
+<!ENTITY otimes   "&#8855;" ><!-- circled times = vector product, U+2297 ISOamsb -->
+<!ENTITY perp     "&#8869;" ><!-- up tack = orthogonal to = perpendicular, U+22A5 ISOtech -->
+<!ENTITY sdot     "&#8901;" ><!-- dot operator, U+22C5 ISOamsb -->
+<!-- dot operator is NOT the same character as U+00B7 middle dot -->
+
+<!-- Miscellaneous Technical -->
+<!ENTITY lceil    "&#8968;" ><!-- left ceiling = apl upstile, U+2308 ISOamsc  -->
+<!ENTITY rceil    "&#8969;" ><!-- right ceiling, U+2309 ISOamsc  -->
+<!ENTITY lfloor   "&#8970;" ><!-- left floor = apl downstile, U+230A ISOamsc  -->
+<!ENTITY rfloor   "&#8971;" ><!-- right floor, U+230B ISOamsc  -->
+<!ENTITY lang     "&#9001;" ><!-- left-pointing angle bracket = bra, U+2329 ISOtech -->
+<!-- lang is NOT the same character as U+003C 'less than'
+     or U+2039 'single left-pointing angle quotation mark' -->
+<!ENTITY rang     "&#9002;" ><!-- right-pointing angle bracket = ket, U+232A ISOtech -->
+<!-- rang is NOT the same character as U+003E 'greater than'
+     or U+203A 'single right-pointing angle quotation mark' -->
+
+<!-- Geometric Shapes -->
+<!ENTITY loz      "&#9674;" ><!-- lozenge, U+25CA ISOpub -->
+
+<!-- Miscellaneous Symbols -->
+<!ENTITY spades   "&#9824;" ><!-- black spade suit, U+2660 ISOpub -->
+<!-- black here seems to mean filled as opposed to hollow -->
+<!ENTITY clubs    "&#9827;" ><!-- black club suit = shamrock, U+2663 ISOpub -->
+<!ENTITY hearts   "&#9829;" ><!-- black heart suit = valentine, U+2665 ISOpub -->
+<!ENTITY diams    "&#9830;" ><!-- black diamond suit, U+2666 ISOpub -->
+
+<!-- end of xhtml-symbol.ent -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-target-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-target-1.mod
new file mode 100644
index 0000000..5331386
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-target-1.mod
@@ -0,0 +1,53 @@
+<!-- ...................................................................... -->
+<!-- XHTML Target Module  ................................................. -->
+<!-- file: xhtml-target-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-target-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Target 1.0//EN"
+       SYSTEM "xhtml-target-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Target 
+
+        target
+
+     This module declares the 'target' attribute used for opening windows
+-->
+
+<!-- render in this frame --> 
+<!ENTITY % FrameTarget.datatype "CDATA" >
+
+<!-- add 'target' attribute to 'a' element -->
+<!ATTLIST %a.qname;
+      target       %FrameTarget.datatype;   #IMPLIED
+>
+
+<!-- add 'target' attribute to 'area' element -->
+<!ATTLIST %area.qname;
+      target       %FrameTarget.datatype;   #IMPLIED
+>
+
+<!-- add 'target' attribute to 'link' element -->
+<!ATTLIST %link.qname;
+      target       %FrameTarget.datatype;   #IMPLIED
+>
+
+<!-- add 'target' attribute to 'form' element -->
+<!ATTLIST %form.qname;
+      target       %FrameTarget.datatype;   #IMPLIED
+>
+
+<!-- add 'target' attribute to 'base' element -->
+<!ATTLIST %base.qname;
+      target       %FrameTarget.datatype;   #IMPLIED
+>
+
+<!-- end of xhtml-target-1.mod -->
diff --git a/xml/tests/testData/xml/XHtmlValidation3/xhtml-text-1.mod b/xml/tests/testData/xml/XHtmlValidation3/xhtml-text-1.mod
new file mode 100644
index 0000000..78f45c4
--- /dev/null
+++ b/xml/tests/testData/xml/XHtmlValidation3/xhtml-text-1.mod
@@ -0,0 +1,52 @@
+<!-- ...................................................................... -->
+<!-- XHTML Text Module  ................................................... -->
+<!-- file: xhtml-text-1.mod
+
+     This is XHTML, a reformulation of HTML as a modular XML application.
+     Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+     Revision: $Id: xhtml-text-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
+       SYSTEM "xhtml-text-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- Textual Content
+
+     The Text module includes declarations for all core
+     text container elements and their attributes.
+-->
+
+<!ENTITY % xhtml-inlstruct.module "INCLUDE" >
+<![%xhtml-inlstruct.module;[
+<!ENTITY % xhtml-inlstruct.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
+            "xhtml-inlstruct-1.mod" >
+%xhtml-inlstruct.mod;]]>
+
+<!ENTITY % xhtml-inlphras.module "INCLUDE" >
+<![%xhtml-inlphras.module;[
+<!ENTITY % xhtml-inlphras.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
+            "xhtml-inlphras-1.mod" >
+%xhtml-inlphras.mod;]]>
+
+<!ENTITY % xhtml-blkstruct.module "INCLUDE" >
+<![%xhtml-blkstruct.module;[
+<!ENTITY % xhtml-blkstruct.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
+            "xhtml-blkstruct-1.mod" >
+%xhtml-blkstruct.mod;]]>
+
+<!ENTITY % xhtml-blkphras.module "INCLUDE" >
+<![%xhtml-blkphras.module;[
+<!ENTITY % xhtml-blkphras.mod
+     PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
+            "xhtml-blkphras-1.mod" >
+%xhtml-blkphras.mod;]]>
+
+<!-- end of xhtml-text-1.mod -->
diff --git a/xml/tests/testData/xml/XInclude-inc.xml b/xml/tests/testData/xml/XInclude-inc.xml
new file mode 100644
index 0000000..f126b9d
--- /dev/null
+++ b/xml/tests/testData/xml/XInclude-inc.xml
@@ -0,0 +1,5 @@
+<persistence-unit xmlns="http://example.com/persistence"
+                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                  xsi:schemaLocation="http://example.com/persistence XIncludeTestSchema.xsd">
+    <class>java.lang.String</class>
+</persistence-unit>
diff --git a/xml/tests/testData/xml/XInclude.xml b/xml/tests/testData/xml/XInclude.xml
new file mode 100644
index 0000000..361b59f
--- /dev/null
+++ b/xml/tests/testData/xml/XInclude.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<persistence xmlns="http://example.com/persistence"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xmlns:xi="http://www.w3.org/2001/XInclude"
+             xsi:schemaLocation="http://example.com/persistence XIncludeTestSchema.xsd
+             http://www.w3.org/2001/XInclude http://www.w3.org/2001/XInclude.xsd"
+             >
+  <xi:include href="XInclude-inc.xml"/>
+  <xi:include href="oxf:/apps/somefile.xml"/>
+</persistence>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XIncludeTestSchema.xsd b/xml/tests/testData/xml/XIncludeTestSchema.xsd
new file mode 100644
index 0000000..f264824
--- /dev/null
+++ b/xml/tests/testData/xml/XIncludeTestSchema.xsd
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://example.com/persistence"
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:persistence="http://example.com/persistence"
+  elementFormDefault="qualified"
+  attributeFormDefault="unqualified"
+  version="1.0">
+  <xsd:element name="persistence">
+    <xsd:complexType>
+      <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+         <xsd:element ref="persistence:persistence-unit"/>
+      </xsd:sequence>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:element name="persistence-unit">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element name="class" type="xsd:string"
+                     minOccurs="0" maxOccurs="unbounded">
+        </xsd:element>
+      </xsd:sequence>
+    </xsd:complexType>
+  </xsd:element>
+</xsd:schema>
diff --git a/xml/tests/testData/xml/XercesCachingProblem.dtd b/xml/tests/testData/xml/XercesCachingProblem.dtd
new file mode 100644
index 0000000..bdc654e
--- /dev/null
+++ b/xml/tests/testData/xml/XercesCachingProblem.dtd
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!ENTITY test "This is a test">
+
+<!ELEMENT root (#PCDATA)>
diff --git a/xml/tests/testData/xml/XercesCachingProblem.xml b/xml/tests/testData/xml/XercesCachingProblem.xml
new file mode 100644
index 0000000..c54d00d
--- /dev/null
+++ b/xml/tests/testData/xml/XercesCachingProblem.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE root PUBLIC "urn:test" "http://www.test.com/test">
+
+<root>
+    &test;
+    &test;
+</root>
diff --git a/xml/tests/testData/xml/XercesMessageOnDtd.xml b/xml/tests/testData/xml/XercesMessageOnDtd.xml
new file mode 100644
index 0000000..0a0e5d3
--- /dev/null
+++ b/xml/tests/testData/xml/XercesMessageOnDtd.xml
@@ -0,0 +1,8 @@
+<!DOCTYPE ejb-jar [
+<!ELEMENT display-name (#PCDATA)>
+<!ELEMENT ejb-jar (display-name)*>
+<error><!ELEMENT ejb-jar (display-name)*></error>
+]>
+<ejb-jar>
+    <display-name></display-name>
+</ejb-jar>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XercesMessageOnPI.xml b/xml/tests/testData/xml/XercesMessageOnPI.xml
new file mode 100644
index 0000000..7f30de8
--- /dev/null
+++ b/xml/tests/testData/xml/XercesMessageOnPI.xml
@@ -0,0 +1,5 @@
+<!-- bad comment before PI -->
+<error><?xml version="1.0" encoding="UTF-8"?></error>
+<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN" "http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd" >
+<weblogic-ejb-jar/>
+
diff --git a/xml/tests/testData/xml/XercesMessagesBinding.xml b/xml/tests/testData/xml/XercesMessagesBinding.xml
new file mode 100644
index 0000000..d6f8c05
--- /dev/null
+++ b/xml/tests/testData/xml/XercesMessagesBinding.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+    <!--
+    <!<error>-</error>-
+    -->
+</web-app>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XercesMessagesBinding2.xml b/xml/tests/testData/xml/XercesMessagesBinding2.xml
new file mode 100644
index 0000000..7321c88
--- /dev/null
+++ b/xml/tests/testData/xml/XercesMessagesBinding2.xml
@@ -0,0 +1,8 @@
+<database xmlns="XercesMessagesBinding2.xsd">
+   <table>
+       <description><p/></description>
+       <col <error>name</error>="aaa" <error>size</error>="-1">
+         <description> <p/> </description>
+       </col>
+   </table>
+</database>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XercesMessagesBinding2.xsd b/xml/tests/testData/xml/XercesMessagesBinding2.xsd
new file mode 100644
index 0000000..f6b0b9b
--- /dev/null
+++ b/xml/tests/testData/xml/XercesMessagesBinding2.xsd
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema targetNamespace="XercesMessagesBinding2.xsd"
+  xmlns:su="XercesMessagesBinding2.xsd"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  elementFormDefault="qualified"
+  attributeFormDefault="qualified">
+
+  <xs:annotation>
+    <xs:documentation>
+      This is a schema for SQLUTils version 3.4
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="database" type="su:Database">
+    <xs:key name="TableKeyColumn">
+      <xs:selector xpath="table"/>
+      <xs:field xpath="@name"/>
+    </xs:key>
+
+    <xs:keyref name="TableKeyColumnRef" refer="su:TableKeyColumn">
+      <xs:selector xpath="col" />
+      <xs:field xpath="@ref" />
+    </xs:keyref>
+
+    <xs:key name="TableKeyColumns">
+      <xs:selector xpath="table"/>
+      <xs:field xpath="@name"/>
+    </xs:key>
+
+    <xs:keyref name="TableKeyColumnsRef" refer="su:TableKeyColumns">
+      <xs:selector xpath="key" />
+      <xs:field xpath="@ref" />
+    </xs:keyref>
+  </xs:element>
+
+  <xs:complexType name="Database">
+    <xs:sequence>
+      <xs:element name="description" type="su:Description" minOccurs="0"/>
+      <xs:element name="table" type="su:Table" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="dsn" type="xs:string" use="optional"/>
+    <xs:attribute name="username" type="xs:string" use="optional"/>
+    <xs:attribute name="password" type="xs:string" use="optional"/>
+  </xs:complexType>
+
+  <xs:complexType name="Table">
+    <xs:sequence>
+      <xs:element name="description" type="su:Description"/>
+      <xs:element name="col" type="su:Column" maxOccurs="unbounded"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element name="key" type="su:Key"/>
+        <xs:element name="index" type="su:Index"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute name="dataUri" type="xs:string"/>
+    <xs:attribute name="name" type="xs:string"/>
+  </xs:complexType>
+
+  <xs:complexType name="Column">
+    <xs:sequence>
+       <xs:element name="description" type="su:Description"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:string" use="required"/>
+    
+    <xs:attribute name="type" type="xs:string" use="optional"/>
+    <xs:attribute name="null" type="xs:boolean" use="optional"/>
+    <xs:attribute name="size" type="xs:nonNegativeInteger" use="optional"/>
+    <xs:attribute name="constraint" type="xs:string" use="optional"/>
+    <xs:attribute name="pk" type="xs:boolean" use="optional"/>
+    <xs:attribute name="ref" type="xs:string" use="optional"/>
+  </xs:complexType>
+
+  <xs:complexType name="Index">
+    <xs:attribute name="name" type="xs:string" use="optional"/>
+    <xs:attribute name="unique" type="xs:boolean" use="required"/>
+    <xs:attribute name="cols" type="xs:string" use="required"/>
+  </xs:complexType>
+
+  <xs:complexType name="Key">
+    <xs:attribute name="name" type="xs:string" use="optional"/>
+    <xs:attribute name="type" type="su:KeyType" use="required"/>
+    <xs:attribute name="ref" type="xs:string" use="optional"/>
+    <xs:attribute name="cols" type="xs:string" use="required"/>
+  </xs:complexType>
+
+  <xs:simpleType name="KeyType">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="foreign"/>
+      <xs:enumeration value="primary"/>
+      <xs:enumeration value="unique"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:complexType name="Description" mixed="true">
+    <xs:sequence>
+       <xs:element name="p">
+          <xs:complexType>
+             <xs:sequence>
+                <xs:any processContents="skip" namespace="##local" minOccurs="0" maxOccurs="unbounded"/>
+             </xs:sequence>
+          </xs:complexType>
+       </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/xml/XercesMessagesBinding2_2.xml b/xml/tests/testData/xml/XercesMessagesBinding2_2.xml
new file mode 100644
index 0000000..9016cdc
--- /dev/null
+++ b/xml/tests/testData/xml/XercesMessagesBinding2_2.xml
@@ -0,0 +1,8 @@
+<database xmlns="XercesMessagesBinding2_2.xsd">
+   <table>
+       <description><p/></description>
+       <<error>col</error> size=<error>"-1"</error> name="aaa">
+         <description> <p/> </description>
+       </<error>col</error>>
+   </table>
+</database>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XercesMessagesBinding2_2.xsd b/xml/tests/testData/xml/XercesMessagesBinding2_2.xsd
new file mode 100644
index 0000000..dbb6efc
--- /dev/null
+++ b/xml/tests/testData/xml/XercesMessagesBinding2_2.xsd
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema targetNamespace="XercesMessagesBinding2_2.xsd"
+  xmlns:su="XercesMessagesBinding2_2.xsd"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  elementFormDefault="qualified"
+  attributeFormDefault="unqualified">
+
+  <xs:annotation>
+    <xs:documentation>
+      This is a schema for SQLUTils version 3.4
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="database" type="su:Database">
+    <xs:key name="TableKeyColumn">
+      <xs:selector xpath="table"/>
+      <xs:field xpath="@name"/>
+    </xs:key>
+
+    <xs:keyref name="TableKeyColumnRef" refer="su:TableKeyColumn">
+      <xs:selector xpath="col" />
+      <xs:field xpath="@ref" />
+    </xs:keyref>
+
+    <xs:key name="TableKeyColumns">
+      <xs:selector xpath="table"/>
+      <xs:field xpath="@name"/>
+    </xs:key>
+
+    <xs:keyref name="TableKeyColumnsRef" refer="su:TableKeyColumns">
+      <xs:selector xpath="key" />
+      <xs:field xpath="@ref" />
+    </xs:keyref>
+  </xs:element>
+
+  <xs:complexType name="Database">
+    <xs:sequence>
+      <xs:element name="description" type="su:Description" minOccurs="0"/>
+      <xs:element name="table" type="su:Table" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="dsn" type="xs:string" use="optional"/>
+    <xs:attribute name="username" type="xs:string" use="optional"/>
+    <xs:attribute name="password" type="xs:string" use="optional"/>
+  </xs:complexType>
+
+  <xs:complexType name="Table">
+    <xs:sequence>
+      <xs:element name="description" type="su:Description"/>
+      <xs:element name="col" type="su:Column" maxOccurs="unbounded"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element name="key" type="su:Key"/>
+        <xs:element name="index" type="su:Index"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute name="dataUri" type="xs:string"/>
+    <xs:attribute name="name" type="xs:string"/>
+  </xs:complexType>
+
+  <xs:complexType name="Column">
+    <xs:sequence>
+       <xs:element name="description" type="su:Description"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:string" use="required"/>
+    
+    <xs:attribute name="type" type="xs:string" use="optional"/>
+    <xs:attribute name="null" type="xs:boolean" use="optional"/>
+    <xs:attribute name="size" type="xs:nonNegativeInteger" use="optional"/>
+    <xs:attribute name="constraint" type="xs:string" use="optional"/>
+    <xs:attribute name="pk" type="xs:boolean" use="optional"/>
+    <xs:attribute name="ref" type="xs:string" use="optional"/>
+  </xs:complexType>
+
+  <xs:complexType name="Index">
+    <xs:attribute name="name" type="xs:string" use="optional"/>
+    <xs:attribute name="unique" type="xs:boolean" use="required"/>
+    <xs:attribute name="cols" type="xs:string" use="required"/>
+  </xs:complexType>
+
+  <xs:complexType name="Key">
+    <xs:attribute name="name" type="xs:string" use="optional"/>
+    <xs:attribute name="type" type="su:KeyType" use="required"/>
+    <xs:attribute name="ref" type="xs:string" use="optional"/>
+    <xs:attribute name="cols" type="xs:string" use="required"/>
+  </xs:complexType>
+
+  <xs:simpleType name="KeyType">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="foreign"/>
+      <xs:enumeration value="primary"/>
+      <xs:enumeration value="unique"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:complexType name="Description" mixed="true">
+    <xs:sequence>
+       <xs:element name="p">
+          <xs:complexType>
+             <xs:sequence>
+                <xs:any processContents="skip" namespace="##local" minOccurs="0" maxOccurs="unbounded"/>
+             </xs:sequence>
+          </xs:complexType>
+       </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/xml/XercesMessagesBinding3.xml b/xml/tests/testData/xml/XercesMessagesBinding3.xml
new file mode 100644
index 0000000..1757ff4
--- /dev/null
+++ b/xml/tests/testData/xml/XercesMessagesBinding3.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<!DOCTYPE struts-config PUBLIC
+        "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
+        "http://struts.apache.org/dtds/struts-config_1_2.dtd">
+
+
+<struts-config>
+
+    <data-sources>
+        <<error>data-source</error> id="  " key="fhgfh"
+                     className="java.lang.String" type="java.lang.String">
+        </<error>data-source</error>>
+    </data-sources>
+</struts-config>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XercesMessagesBinding4.xml b/xml/tests/testData/xml/XercesMessagesBinding4.xml
new file mode 100644
index 0000000..95993b8
--- /dev/null
+++ b/xml/tests/testData/xml/XercesMessagesBinding4.xml
@@ -0,0 +1,30 @@
+<project name="nc-server" default="war" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
+    <property environment="env" />
+    <property file="${user.home}/<error descr="'nc_build.properties' does not exist">nc_build.properties</error>" />
+    <property file="${basedir}/<error descr="'build.properties' does not exist">build.properties</error>" />
+    <property name="build.dir" value="${basedir}/target" />
+    <property name="compile.dir" value="${build.dir}/classes" />
+    <property name="src.gen.dir" value="${build.dir}/generated-source" />
+    <property name="lib.dir" value="${basedir}/lib" />
+    <<error descr="Failed to load type(s):
+Resource \\"org/apache/maven/artifact/ant/antlib.xml\\" not found in the classpath">typedef</error> resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant">
+        <classpath>
+            <pathelement location="${lib.dir}/maven-artifact-ant-2.0.4-dep.jar" />
+        </classpath>
+    </typedef>
+    <target name="clean" description="Cleans the build">
+        <delete dir="${build.dir}" />
+    </target>
+    <target name="init">
+        <mkdir dir="${compile.dir}" />
+        <mkdir dir="${src.gen.dir}" />
+    </target>
+    <target name="war" depends="compile">
+        <echo message="I will do something here"/>
+    </target>
+    <target name="compile" depends="init" description="Compile the java source code">
+        <echo level="verbose">Compiling Java Code</echo>
+    </target>
+    <target name="compile.schema" depends="init">
+    </target>
+</project>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XercesMessagesBinding4.xsd b/xml/tests/testData/xml/XercesMessagesBinding4.xsd
new file mode 100644
index 0000000..a2097d7d
--- /dev/null
+++ b/xml/tests/testData/xml/XercesMessagesBinding4.xsd
@@ -0,0 +1 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"></xsd:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XercesMessagesBinding5.xml b/xml/tests/testData/xml/XercesMessagesBinding5.xml
new file mode 100644
index 0000000..387da7b
--- /dev/null
+++ b/xml/tests/testData/xml/XercesMessagesBinding5.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE ejb-jar [
+<!ELEMENT display-name (#PCDATA)>
+<!ELEMENT ejb-jar (display-name)*>
+]>
+<ejb-jar<error> </error>,
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XmlPsi.xml b/xml/tests/testData/xml/XmlPsi.xml
new file mode 100644
index 0000000..ecf089c
--- /dev/null
+++ b/xml/tests/testData/xml/XmlPsi.xml
@@ -0,0 +1,6 @@
+ <test xmlns:a='abc' >
+   <foo xmlns:b='abc' b:xxx='xxx'>
+     <bar a:yyy='yyy' zzz='zzz'/>
+     <bar2 a:yyy='yyy' xmlns="def" zzz='zzz'/>
+   </foo>
+</test>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XsiSchemaLocation.xml b/xml/tests/testData/xml/XsiSchemaLocation.xml
new file mode 100644
index 0000000..4f746c5
--- /dev/null
+++ b/xml/tests/testData/xml/XsiSchemaLocation.xml
@@ -0,0 +1,4 @@
+<rap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="myschema <error>http://www.inversoft.com/schemas/rap/rap-config-1.0.xsd</error>"
+    xsi:noNamespaceSchemaLocation="<error>http://www.inversoft.com/schemas/rap/rap-config-1.0.xsd</error>">
+</rap>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XsiSchemaLocation2.xml b/xml/tests/testData/xml/XsiSchemaLocation2.xml
new file mode 100644
index 0000000..651454a
--- /dev/null
+++ b/xml/tests/testData/xml/XsiSchemaLocation2.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tst:test xmlns:tst="urn:schemas-dig-de:tst" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:test2="urn:schemas-dig-de:test2" xmlns:test3="urn:schemas-dig-de:test3"
+xmlns="http://www.w3.org/1999/xhtml" xsi:schemaLocation="urn:schemas-dig-de:tst XsiSchemaLocation2_1.xsd  urn:schemas-dig-de:test2 XsiSchemaLocation2_2.xsd urn:schemas-dig-de:test3 XsiSchemaLocation2_3.xsd">
+    <table>
+        <tr>
+            <td>
+                <<error>test2:control</error> id="xx">
+                	<test3:superControl id="xx"/>
+                        <test2:my id="id"></test2:my>
+                </<error>test2:control</error>>
+            </td>
+        </tr>
+    </table>
+</tst:test>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XsiSchemaLocation2_1.xsd b/xml/tests/testData/xml/XsiSchemaLocation2_1.xsd
new file mode 100644
index 0000000..4971c39
--- /dev/null
+++ b/xml/tests/testData/xml/XsiSchemaLocation2_1.xsd
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:schemas-dig-de:tst">
+	<xs:element name="test" >
+		<xs:complexType>
+			<xs:sequence>
+				<xs:any namespace="http://www.w3.org/1999/xhtml" maxOccurs="unbounded"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+
+</xs:schema>
diff --git a/xml/tests/testData/xml/XsiSchemaLocation2_2.xsd b/xml/tests/testData/xml/XsiSchemaLocation2_2.xsd
new file mode 100644
index 0000000..08f6a2b
--- /dev/null
+++ b/xml/tests/testData/xml/XsiSchemaLocation2_2.xsd
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified" xmlns:test2="urn:schemas-dig-de:test2" xmlns:test3="urn:schemas-dig-de:test3" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:schemas-dig-de:test2">
+    <xs:include schemaLocation="XsiSchemaLocation2_2.xsd"/>
+    <xs:import namespace="urn:schemas-dig-de:test3" schemaLocation="XsiSchemaLocation2_3.xsd"/>
+
+    <xs:complexType name="annotated">
+    </xs:complexType>
+    
+    <xs:attributeGroup name="occurs">
+    </xs:attributeGroup>
+    
+    <xs:element name="control">
+        <xs:annotation>
+            <xs:documentation>The string field</xs:documentation>
+        </xs:annotation>
+        <xs:complexType mixed="true">
+            <xs:sequence>
+                <xs:element ref="test3:superControl" minOccurs="1" maxOccurs="unbounded"/>
+                <xs:element name="my" type="test3:superControlType" minOccurs="1" maxOccurs="unbounded"/>
+            </xs:sequence>
+            <xs:attribute name="id" type="xs:string" use="required"/>
+            <xs:attribute name="flag" type="test3:Bool" use="optional"/>
+        </xs:complexType>
+    </xs:element>
+    <xs:simpleType name = "Length">
+      <xs:restriction base = "test3:Bool">
+        <xs:pattern value = "true"/>
+      </xs:restriction>
+    </xs:simpleType>
+   <xs:simpleType name = "Length">
+     <xs:restriction base = "xs:string">
+       <xs:pattern value = "111"/>
+     </xs:restriction>
+   </xs:simpleType>
+  <xs:complexType name="aaa">
+      <xs:sequence>
+          <xs:group ref = "test3:group" minOccurs = "0" maxOccurs = "unbounded"/>
+      </xs:sequence>
+      <xs:attributeGroup ref = "test3:group2" minOccurs = "0" maxOccurs = "unbounded"/>
+   </xs:complexType>
+  
+    <xs:element name="control2" type="xs:annotated"/>
+        
+    <xs:complexType name="bbb">
+      <xs:attributeGroup ref = "xs:occurs" minOccurs = "0" maxOccurs = "unbounded"/>
+      <xs:attribute ref="test3:myattribute" />
+   </xs:complexType>
+</xs:schema>
diff --git a/xml/tests/testData/xml/XsiSchemaLocation2_3.xsd b/xml/tests/testData/xml/XsiSchemaLocation2_3.xsd
new file mode 100644
index 0000000..177bd9d
--- /dev/null
+++ b/xml/tests/testData/xml/XsiSchemaLocation2_3.xsd
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified"  attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:schemas-dig-de:test3">
+
+    <xs:element name="superControl">
+        <xs:annotation>
+            <xs:documentation>The super field</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+                <xs:attribute name="_sortable" type="xs:boolean" use="optional"/>
+                <xs:attribute name="_checkbox" type="xs:boolean" use="optional"/>
+                <xs:attribute name="id" type="xs:string" use="required"/>
+                <xs:attribute name="style" type="xs:string" use="optional"/>
+        </xs:complexType>
+    </xs:element>
+
+  <xs:complexType name="superControlType">
+          <xs:attribute name="_sortable" type="xs:boolean" use="optional"/>
+          <xs:attribute name="_checkbox" type="xs:boolean" use="optional"/>
+          <xs:attribute name="id" type="xs:string" use="required"/>
+          <xs:attribute name="style" type="xs:string" use="optional"/>
+  </xs:complexType>
+  
+  <xs:group name="group">
+    <xs:annotation>
+      <xs:documentation>
+        Fake empty group to check resolve
+      </xs:documentation>
+    </xs:annotation>
+  </xs:group>
+  
+  <xs:attributeGroup name="group2">
+    <xs:annotation>
+      <xs:documentation>
+        Fake group to check resolve
+      </xs:documentation>
+    </xs:annotation>
+  </xs:attributeGroup>
+  
+  <xs:simpleType name = "Bool">
+    <xs:annotation>
+      <xs:documentation>
+        Bool would be boolean except it does not accept 1 and 0.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base = "xs:NMTOKEN" >
+      <xs:enumeration value = "true"/>
+      <xs:enumeration value = "false"/>
+    </xs:restriction>     
+  </xs:simpleType>
+  <xs:attribute name="myattribute"/>
+</xs:schema>
diff --git a/xml/tests/testData/xml/XsiSchemaLocation3.xsd b/xml/tests/testData/xml/XsiSchemaLocation3.xsd
new file mode 100644
index 0000000..3c93233
--- /dev/null
+++ b/xml/tests/testData/xml/XsiSchemaLocation3.xsd
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:schemas-dig-de:test2">
+    <xs:import namespace="urn:schemas-dig-de:test3" schemaLocation="<error>XsiSchemaLocation2.xsd</error>"/>
+    <xs:include schemaLocation="<error>XsiSchemaLocation2.xsd</error>"/>
+    <xs:import namespace="urn:schemas-dig-de:test3" schemaLocation="XsiSchemaLocation3.xsd"/>
+    <xs:include schemaLocation="XsiSchemaLocation3.xsd"/>
+    <xs:include schemaLocation="http://www.w3.org/1999/XSL/Transform"/>
+</xs:schema>
diff --git a/xml/tests/testData/xml/XsiSchemaLocation_2.xml b/xml/tests/testData/xml/XsiSchemaLocation_2.xml
new file mode 100644
index 0000000..e0e9857
--- /dev/null
+++ b/xml/tests/testData/xml/XsiSchemaLocation_2.xml
@@ -0,0 +1,34 @@
+<xs:schema 
+    targetNamespace="http://www.w3.org/2001/xml-events" 
+    xmlns:ev="http://www.w3.org/2001/xml-events" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:schemaLocation="http://www.w3.org/2001/XMLSchema 
+                        http://www.w3.org/2001/XMLSchema.xsd" 
+    elementFormDefault="unqualified" 
+    blockDefault="#all" 
+    finalDefault="#all" 
+    attributeFormDefault="unqualified">
+
+  <xs:annotation>
+    <xs:documentation>
+      This is the XML Schema for XML Events global attributes
+
+      URI: http://www.w3.org/MarkUp/SCHEMA/xml-events-attribs-1.xsd
+      $Id: xml-events-attribs-1.xsd,v 1.5 2003/08/02 09:36:54 mimasa Exp $
+    </xs:documentation>
+    <xs:documentation source="xml-events-copyright-1.xsd"/>
+  </xs:annotation>
+
+  <xs:annotation>
+    <xs:documentation>
+      XML Event Attributes
+        
+        These "global" event attributes are defined in "Attaching
+        Attributes Directly to the Observer Element" of the XML
+        Events specification.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attribute name="event" type="xs:NMTOKEN"/>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XsiType.xml b/xml/tests/testData/xml/XsiType.xml
new file mode 100644
index 0000000..7e2038b
--- /dev/null
+++ b/xml/tests/testData/xml/XsiType.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ns1:ActivationRequest xmlns:ns1="http://www.synchronoss.com/activation/ActivationRequestV1.00.xsd"
+    xmlns:ns2="http://www.synchronoss.com/activation/GenericActivationRequestV1.00.xsd"
+    xmlns:ns3="http://www.synchronoss.com/common/TypesV1.00.xsd"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.synchronoss.com/activation/ActivationRequestV1.00.xsd XsiType_GenericActivationRequestV1.00.xsd
+    http://www.synchronoss.com/common/TypesV1.00.xsd XsiType_TypesV1.00.xsd
+    http://www.synchronoss.com/activation/GenericActivationRequestV1.00.xsd XsiType_GenericActivationRequestV1.00.xsd"
+    orderNumber="orderNumber0" retailer="2" xsi:type="ns2:ct_GenericActivationRequest">
+    <ns1:Header timeStamp="2006-05-04T18:13:51.0Z">
+        <ns3:Notification notificationEmail="notificationEmail0"/>
+    </ns1:Header>
+    <ns1:Account accountType="2" accountSubType="2" serviceProvider="2"
+        liabilityIndicator="Individual">
+        <ns1:ExistingAccount>
+            <ns1:AccountIdentification>
+                <ns1:MobileNumber>0000000000</ns1:MobileNumber>
+            </ns1:AccountIdentification>
+            <ns1:ExistingFedTaxID>ExistingFedTaxID0</ns1:ExistingFedTaxID>
+        </ns1:ExistingAccount>
+    </ns1:Account>
+    <ns1:Subscriber subscriberReference="subscriberReference0" techType="2" customerType="NEW">
+        <ns1:Usage>
+            <ns1:Name>
+                <ns3:FirstName>FirstName0</ns3:FirstName>
+                <ns3:LastName>LastName0</ns3:LastName>
+                <ns3:HomePhone>0000000000</ns3:HomePhone>
+                <ns3:WorkPhone>
+                    <ns3:PhoneNumber>0000000000</ns3:PhoneNumber>
+                </ns3:WorkPhone>
+            </ns1:Name>
+            <ns1:Address>
+                <ns3:POBox>POBox0</ns3:POBox>
+                <ns3:City>City0</ns3:City>
+                <ns3:State>AA</ns3:State>
+                <ns3:PostalCode>33333</ns3:PostalCode>
+            </ns1:Address>
+        </ns1:Usage>
+        <ns1:Service>
+            <ns1:RatePlan billingCode="3333" price="39.99"/>
+            <ns1:IncludedFeature>
+                <ns1:Feature billingCode="21212" price="0.00"/>
+            </ns1:IncludedFeature>
+        </ns1:Service>
+        <ns1:ContractLength length="1" unit="years"/>
+        <ns1:Equipment>
+            <ns1:Device>
+                <ns1:SKU>33333</ns1:SKU>
+                <ns1:Make>Nokia</ns1:Make>
+            </ns1:Device>
+        </ns1:Equipment>
+    </ns1:Subscriber>
+</ns1:ActivationRequest>
diff --git a/xml/tests/testData/xml/XsiType_ActivationRequestV1.00.xsd b/xml/tests/testData/xml/XsiType_ActivationRequestV1.00.xsd
new file mode 100644
index 0000000..007ff36
--- /dev/null
+++ b/xml/tests/testData/xml/XsiType_ActivationRequestV1.00.xsd
@@ -0,0 +1,429 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2001-2009 Synchronoss Technologies, Inc. 750 Route 202 South,
+    Bridgewater, New Jersey, 08807, U.S.A.  All Rights Reserved.
+
+    This source code is part of the ConvergenceNow(R) platform and is the
+    confidential and proprietary information of Synchronoss Technologies, Inc.
+    ("Confidential Information"). You shall not disclose such Confidential
+    Information and shall use it only in accordance with the terms of the
+    license agreement you entered into with Synchronoss Technologies.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns="http://www.synchronoss.com/activation/ActivationRequestV1.00.xsd"
+    xmlns:types="http://www.synchronoss.com/common/TypesV1.00.xsd"
+    targetNamespace="http://www.synchronoss.com/activation/ActivationRequestV1.00.xsd"
+    elementFormDefault="qualified"
+    >
+    <xs:import schemaLocation="XsiType_TypesV1.00.xsd" namespace="http://www.synchronoss.com/common/TypesV1.00.xsd"/>
+    <xs:element name="ActivationRequest" type="ct_AbstractActivationRequest">
+        <xs:unique name="subscriberReference" xmlns:x="http://www.synchronoss.com/activation/ActivationRequestV1.00.xsd">
+            <xs:selector xpath="x:Subscriber"/>
+            <xs:field xpath="@subscriberReference"/>
+        </xs:unique>
+    </xs:element>
+    <xs:complexType name="ct_AbstractActivationRequest" abstract="true">
+        <xs:sequence>
+            <xs:element name="Header" type="types:ct_Header"/>
+            <xs:element name="FlexFields" type="ct_FlexFields" minOccurs="0"/>
+            <xs:element name="Account" type="ct_Account"/>
+            <xs:element name="Subscriber" type="ct_Subscriber" minOccurs="1" maxOccurs="unbounded"/>
+            <xs:element name="Shipping" type="ct_Shipping" minOccurs="0"/>
+            <xs:element name="Payments" type="ct_Payments" minOccurs="0"/>
+        </xs:sequence>
+        <xs:attribute name="orderNumber" type="types:st_NonZeroLengthString" use="required">
+            <xs:annotation>
+                <xs:documentation>Client order number associated with the order (must be unique per client)</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="retailer" type="xs:positiveInteger" use="required">
+            <xs:annotation>
+                <xs:documentation>Retailer associated with the order</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="retailerOrderNumber" type="types:st_NonZeroLengthString" use="optional">
+            <xs:annotation>
+                <xs:documentation>Retailer order number associated with the order</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <xs:complexType name="ct_Account">
+        <xs:sequence>
+            <xs:choice>
+                <xs:element name="NewAccount" type="ct_NewAccount"/>
+                <xs:element name="ExistingAccount" type="ct_ExistingAccount"/>
+                <xs:element name="PrepaidAccount" type="ct_PrepaidAccount"/>
+            </xs:choice>
+            <xs:element name="FlexFields" type="ct_FlexFields" minOccurs="0"/>
+        </xs:sequence>
+        <xs:attribute name="accountType" type="xs:positiveInteger" use="required"/>
+        <xs:attribute name="accountSubType"  type="xs:positiveInteger" use="required"/>
+        <xs:attribute name="serviceProvider" type="xs:positiveInteger" use="required"/>
+        <xs:attribute name="businessName" type="types:st_NonZeroLengthString" use="optional"/>
+        <xs:attribute name="liabilityIndicator" type="st_LiabilityIndicator" use="required"/>
+        <xs:attribute name="contractNumber" type="types:st_NonZeroLengthString" use="optional"/>
+        <xs:attribute name="langId" type="xs:positiveInteger" use="optional"/>
+    </xs:complexType>
+    <xs:simpleType name="st_LiabilityIndicator">
+        <xs:restriction base="xs:string">
+            <xs:enumeration value="Individual"/>
+            <xs:enumeration value="Corporate"/>
+            <xs:enumeration value="Consumer"/>
+            <xs:enumeration value="Business"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:complexType name="ct_NewAccount">
+        <xs:sequence>
+            <xs:element name="Liability" type="ct_Liability"/>
+            <xs:element name="CreditCheck" type="ct_CreditCheck"  minOccurs="0" />
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_Liability">
+        <xs:sequence>
+            <xs:element name="Name" type="types:ct_Name"/>
+            <xs:element name="Address" type="types:ct_Address"/>
+            <xs:element name="Authentication" type="ct_Authentication"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_Authentication">
+        <xs:sequence>
+            <xs:choice>
+                <xs:element name="FedTaxID" type="types:st_NonZeroLengthString"/>
+                <xs:sequence>
+                    <xs:element name="SSN" type="types:st_SSN"/>
+                    <xs:element name="DOB" type="types:st_YearMonthDay"/>
+                    <xs:element name="PhotoIdentity" type="types:ct_PhotoIdentity" minOccurs="0"/>
+                </xs:sequence>
+            </xs:choice>
+            <xs:element name="SecurityQuestion" type="ct_SecurityQuestion" minOccurs="0"/>
+            <xs:element name="PIN" type="types:st_NonZeroLengthString" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_SecurityQuestion">
+        <xs:sequence>
+            <xs:element name="SecurityQuestion" type="types:st_NonZeroLengthString"/>
+            <xs:element name="SecurityQuestionAnswer" type="types:st_NonZeroLengthString"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_CreditCheck">
+        <xs:sequence>
+            <xs:element name="DepositAmount" type="types:st_USCurrency" minOccurs="0"/>
+        </xs:sequence>
+        <xs:attribute name="applicationNumber" type="types:st_NonZeroLengthString" use="optional"/>
+        <xs:attribute name="numberLinesReq" type="xs:nonNegativeInteger" use="required"/>
+        <xs:attribute name="numberApprLines" type="xs:nonNegativeInteger" use="optional"/>
+        <xs:attribute name="applicationApprovalDate" type="types:st_YearMonthDay" use="optional"/>
+        <xs:attribute name="applicationExpiresDate" type="types:st_YearMonthDay" use="optional"/>
+        <xs:attribute name="creditStatus" type="st_CreditStatus" use="required"/>
+        <xs:attribute name="guid" type="types:st_NonZeroLengthString" use="optional"/>
+    </xs:complexType>
+    <xs:simpleType name="st_CreditStatus">
+        <xs:restriction base="xs:string">
+            <xs:enumeration value="Approved"/>
+            <xs:enumeration value="Deposit"/>
+            <xs:enumeration value="Pending"/>
+            <xs:enumeration value="Review"/>
+            <xs:enumeration value="Declined"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:complexType name="ct_ExistingAccount">
+        <xs:sequence>
+            <xs:element name="AccountIdentification">
+                <xs:complexType>
+                    <xs:choice>
+                        <xs:sequence>
+                            <xs:element name="MobileNumber" type="types:st_PhoneNumber"/>
+                            <xs:element name="AccountNumber" type="types:st_NonZeroLengthString" minOccurs="0"/>
+                        </xs:sequence>
+                        <xs:element name="AccountNumber" type="types:st_NonZeroLengthString"/>
+                    </xs:choice>
+                </xs:complexType>
+            </xs:element>
+            <xs:choice>
+                <xs:element name="ExistingSSN" type="types:st_SSN"/>
+                <xs:element name="ExistingLast4SSN" type="types:st_Last4SSN"/>
+                <xs:element name="ExistingFedTaxID" type="types:st_NonZeroLengthString"/>
+            </xs:choice>
+            <xs:element name="ExistingLiability" type="ct_ExistingLiability" minOccurs="0"/>
+            <xs:element name="CreditCheck" type="ct_CreditCheck" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_ExistingLiability">
+        <xs:sequence>
+            <xs:element name="Name" type="types:ct_Name" minOccurs="0"/>
+            <xs:choice>
+                <xs:element name="Address" type="types:ct_Address" minOccurs="0"/>
+                <xs:element name="PostalCode" type="types:ct_PostalCode"/>
+            </xs:choice>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_PrepaidAccount">
+        <xs:sequence>
+            <xs:element name="PrepaidLiability" type="ct_PrepaidLiability"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_PrepaidLiability">
+        <xs:sequence>
+            <xs:element name="Name" type="types:ct_Name"/>
+            <xs:element name="Address" type="types:ct_Address"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:simpleType name="st_ContractLengthUnit">
+        <xs:restriction base="xs:string">
+            <xs:enumeration value="months"/>
+            <xs:enumeration value="years"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:complexType name="ct_ContractLength">
+        <xs:attribute name="length" type="xs:nonNegativeInteger" use="required"/>
+        <xs:attribute name="unit" type="st_ContractLengthUnit" use="required"/>
+    </xs:complexType>
+    <xs:complexType name="ct_Subscriber">
+        <xs:sequence>
+            <xs:element name="Usage" type="ct_Usage"/>
+            <xs:element name="Service" type="ct_Service"/>
+            <xs:element name="ContractLength" type="ct_ContractLength" minOccurs="0"/>
+            <xs:element name="Equipment" type="ct_Equipment" minOccurs="0"/>
+            <xs:element name="ReservedMobileNumber" type="types:st_PhoneNumber" minOccurs="0"/>
+            <xs:element name="FlexFields" type="ct_FlexFields" minOccurs="0"/>
+        </xs:sequence>
+        <xs:attribute name="subscriberReference" type="types:st_NonZeroLengthString" use="required"/>
+        <xs:attribute name="group" type="st_Group" use="optional"/>
+        <xs:attribute name="techType" type="xs:positiveInteger" use="required"/>
+        <xs:attribute name="tcVersion" use="optional" type="types:st_NonZeroLengthString"/>
+        <xs:attribute name="tcAgreedDateAndTime" use="optional" type="xs:dateTime"/>
+        <xs:attribute name="customerType" type="st_CustomerType" use=" required"/>
+    </xs:complexType>
+    <xs:simpleType name="st_CustomerType">
+        <xs:restriction base="xs:string">
+            <xs:enumeration value="NEW"/>
+            <xs:enumeration value="AL"/>
+            <xs:enumeration value="ALF"/>
+            <xs:enumeration value="LNP"/>
+            <xs:enumeration value="LNPAL"/>
+            <xs:enumeration value="LNPALF"/>
+            <xs:enumeration value="UP"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="st_Group">
+        <xs:restriction base="xs:string">
+            <xs:enumeration value="SharedPlanSecondary"/>
+            <xs:enumeration value="SharedPlanPrimary"/>
+            <xs:enumeration value="SinglePlan"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:complexType name="ct_Usage">
+        <xs:sequence>
+            <xs:element name="Name" type="types:ct_Name"/>
+            <xs:element name="Address" type="types:ct_Address"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_Service">
+        <xs:sequence>
+            <xs:element name="RatePlan" minOccurs="0">
+                <xs:complexType>
+                    <xs:attribute name="systemName" type="types:st_NonZeroLengthString" use="optional"/>
+                    <xs:attribute name="billingCode" type="types:st_NonZeroLengthString" use="required"/>
+                    <xs:attribute name="price" type="types:st_USCurrency" use="required"/>
+                    <xs:attribute name="displayName" type="types:st_NonZeroLengthString" use="optional"/>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="IncludedFeature" type="ct_IncludedFeature" minOccurs="0" />
+            <xs:element name="OptionalFeature" type="ct_OptionalFeature" minOccurs="0"/>
+            <xs:element name="LnpPortIn" type="ct_LnpPortIn" minOccurs="0"/>
+        </xs:sequence>
+        <xs:attribute name="activationFee" type="types:st_USCurrency" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="ct_Equipment">
+        <xs:sequence>
+            <xs:element name="SIM" type="ct_SIM" minOccurs="0"/>
+            <xs:choice minOccurs="0">
+                <xs:element name="Device" type="ct_Device"/>
+                <xs:element name="ExistingDevice" type="ct_ExistingDevice"/>
+            </xs:choice>
+            <xs:element name="Accessory" type="ct_Accessory" minOccurs="0" maxOccurs="unbounded"/>
+            <xs:element name="Collateral" type="ct_Collateral" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_SIM">
+        <xs:sequence>
+            <xs:element name="SystemName" type="types:st_NonZeroLengthString" minOccurs="0"/>
+            <xs:element name="SKU" type="types:st_NonZeroLengthString"/>
+            <xs:element name="Make" type="types:st_NonZeroLengthString" minOccurs="0"/>
+            <xs:element name="ICCID" type="types:st_ICCID" minOccurs="0"/>
+            <xs:element name="DisplayName" type="types:st_NonZeroLengthString" minOccurs="0"/>
+        </xs:sequence>
+        <xs:attribute name="price" type="types:st_USCurrency" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="ct_Device">
+        <xs:sequence>
+            <xs:element name="SystemName" type="types:st_NonZeroLengthString" minOccurs="0"/>
+            <xs:element name="SKU" type="types:st_NonZeroLengthString"/>
+            <xs:element name="Make" type="types:st_NonZeroLengthString"/>
+            <xs:choice minOccurs="0">
+                <xs:element name="IMEI" type="types:st_IMEI"/>
+                <xs:element name="ESN" type="types:st_ESN"/>
+            </xs:choice>
+            <xs:element name="DisplayName" type="types:st_NonZeroLengthString" minOccurs="0"/>
+            <xs:element name="PhoneType" type="types:st_NonZeroLengthString" minOccurs="0"/>
+        </xs:sequence>
+        <xs:attribute name="originalPrice" type="types:st_USCurrency" use="optional"/>
+        <xs:attribute name="price" type="types:st_USCurrency" use="optional"/>
+        <xs:attribute name="discount" type="types:st_USCurrency" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="ct_ExistingDevice">
+        <xs:sequence>
+            <xs:choice>
+                <xs:element name="IMEI" type="types:st_IMEI"/>
+                <xs:element name="ESN" type="types:st_ESN"/>
+            </xs:choice>
+            <xs:element name="Manufacturer" type="types:st_NonZeroLengthString"/>
+            <xs:element name="Model" type="types:st_NonZeroLengthString"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_Accessory">
+        <xs:sequence>
+            <xs:element name="SystemName" type="types:st_NonZeroLengthString" minOccurs="0"/>
+            <xs:element name="SKU" type="types:st_NonZeroLengthString"/>
+            <xs:element name="DisplayName" type="types:st_NonZeroLengthString" minOccurs="0"/>
+        </xs:sequence>
+        <xs:attribute name="quantity" type="xs:nonNegativeInteger" use="required"/>
+        <xs:attribute name="price" type="types:st_USCurrency" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="ct_Collateral">
+        <xs:sequence>
+            <xs:element name="SystemName" type="types:st_NonZeroLengthString" minOccurs="0"/>
+            <xs:element name="SKU" type="types:st_NonZeroLengthString"/>
+            <xs:element name="Make" type="types:st_NonZeroLengthString" minOccurs="0"/>
+            <xs:element name="DisplayName" type="types:st_NonZeroLengthString" minOccurs="0"/>
+        </xs:sequence>
+        <xs:attribute name="quantity" type="xs:nonNegativeInteger" use="required"/>
+        <xs:attribute name="price" type="types:st_USCurrency" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="ct_IncludedFeature">
+        <xs:sequence>
+            <xs:element name="Feature" type="ct_PromoFeature" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_OptionalFeature">
+        <xs:sequence>
+            <xs:element name="Feature" type="ct_PromoFeature" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_PromoFeature">
+        <xs:attribute name="systemName" type="types:st_NonZeroLengthString" use="optional"/>
+        <xs:attribute name="billingCode" type="types:st_NonZeroLengthString" use="required"/>
+        <xs:attribute name="price" type="types:st_USCurrency" use="required"/>
+        <xs:attribute name="displayName" type="types:st_NonZeroLengthString" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="ct_LnpPortIn">
+        <xs:sequence>
+            <xs:element name="LnpCustomerInfo" type="ct_LnpCustomerInfo"/>
+            <xs:element name="PortingNumber" type="types:st_PhoneNumber"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_LnpCustomerInfo">
+        <xs:sequence>
+            <xs:element name="IndividualName" type="types:ct_Name"/>
+            <xs:element name="BusinessName" type="types:st_NonZeroLengthString" minOccurs="0"/>
+            <xs:element name="AuthName" type="types:ct_Name" minOccurs="0" />
+            <xs:element name="SourceAddress" type="types:ct_Address"/>
+            <xs:choice>
+                <xs:element name="SSN" type="types:st_SSN"/>
+                <xs:element name="Last4SSN" type="types:st_Last4SSN"/>
+                <xs:element name="FedTaxID" type="types:st_NonZeroLengthString"/>
+            </xs:choice>
+            <xs:element name="AccountNumber" type="types:st_NonZeroLengthString"/>
+            <xs:element name="PswdPin" type="types:st_NonZeroLengthString" minOccurs="0"/>
+            <xs:element name="FlexFields" type="ct_FlexFields" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_Shipping">
+        <xs:sequence>
+            <xs:element name="Name" type="types:ct_Name"/>
+            <xs:element name="Address" type="types:ct_Address"/>
+            <xs:element name="FlexFields" type="ct_FlexFields" minOccurs="0"/>
+        </xs:sequence>
+        <xs:attribute name="shippingSKU" type="types:st_NonZeroLengthString" use="required"/>
+        <xs:attribute name="shippingPrice" type="types:st_USCurrency" use="required"/>
+        <xs:attribute name="shippingPriceSKU" type="types:st_NonZeroLengthString" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="ct_Payments">
+        <xs:sequence>
+            <xs:element name="RecurringPayment" type="ct_RecurringPayment" minOccurs="0"/>
+            <xs:element name="OneTimePayment" type="ct_OneTimePayment" minOccurs="0"/>
+            <xs:element name="DepositPayment" type="ct_DepositPayment" minOccurs="0"/>
+            <xs:element name="CreditPayment" type="ct_CreditPayment" minOccurs="0" maxOccurs="3"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_OneTimePayment">
+        <xs:sequence>
+            <xs:element name="CreditPaymentRef" type="ct_CreditPaymentRef"/>
+        </xs:sequence>
+        <xs:attribute name="amount" type="types:st_USCurrency" use="required"/>
+        <xs:attribute name="estimatedTax" type="types:st_USCurrency" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="ct_DepositPayment">
+        <xs:choice>
+            <xs:element name="CreditPaymentRef" type="ct_CreditPaymentRef"/>
+        </xs:choice>
+        <xs:attribute name="amount" type="types:st_USCurrency" use="required"/>
+    </xs:complexType>
+    <xs:complexType name="ct_RecurringPayment">
+        <xs:sequence>
+            <xs:element name="CreditPaymentRef" type="ct_CreditPaymentRef"/>
+        </xs:sequence>
+        <xs:attribute name="amount" type="types:st_USCurrency" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="ct_PaymentContactInfo">
+        <xs:sequence>
+            <xs:element name="Name" type="types:ct_Name"/>
+            <xs:element name="Address" type="types:ct_Address"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:simpleType name="st_CreditCardType">
+        <xs:restriction base="xs:string">
+            <xs:enumeration value="American Express"/>
+            <xs:enumeration value="Discover"/>
+            <xs:enumeration value="Master Card"/>
+            <xs:enumeration value="Visa"/>
+            <xs:enumeration value="DINERS CLUB"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:complexType name="ct_CreditPayment">
+        <xs:complexContent>
+            <xs:extension base="ct_PaymentContactInfo">
+                <xs:sequence>
+                    <xs:element name="ExpirationYearMonth" type="xs:gYearMonth"/>
+                </xs:sequence>
+                <xs:attribute name="creditCardType" use="required" type="st_CreditCardType"/>
+                <xs:attribute name="creditCardNumber" type="types:st_NonZeroLengthString" use="required"/>
+                <xs:attribute name="uniqueId" type="st_CreditPaymentUniqueId" use="required"/>
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+    <xs:complexType name="ct_CreditPaymentRef">
+        <xs:attribute name="uniqueIdRef" type="st_CreditPaymentUniqueId" use="required"/>
+    </xs:complexType>
+    <xs:simpleType name="st_CreditPaymentUniqueId">
+        <xs:restriction base="xs:string">
+            <xs:enumeration value="RECURRING"/>
+            <xs:enumeration value="ONETIME"/>
+            <xs:enumeration value="DEPOSIT"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:complexType name="ct_FlexFields" final="#all">
+        <xs:sequence>
+            <xs:element name="FlexField" type="ct_FlexField" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="ct_FlexField" final="#all">
+        <xs:sequence>
+            <xs:element name="Key" type="types:st_NonZeroLengthString"/>
+            <xs:choice>
+                <xs:element name="Value" type="types:st_NonZeroLengthString"/>
+                <xs:element name="FlexFields" type="ct_FlexField"/>
+            </xs:choice>
+        </xs:sequence>
+    </xs:complexType>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XsiType_GenericActivationRequestV1.00.xsd b/xml/tests/testData/xml/XsiType_GenericActivationRequestV1.00.xsd
new file mode 100644
index 0000000..03fb9d1
--- /dev/null
+++ b/xml/tests/testData/xml/XsiType_GenericActivationRequestV1.00.xsd
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2001-2009 Synchronoss Technologies, Inc. 750 Route 202 South,
+    Bridgewater, New Jersey, 08807, U.S.A.  All Rights Reserved.
+
+    This source code is part of the ConvergenceNow(R) platform and is the
+    confidential and proprietary information of Synchronoss Technologies, Inc.
+    ("Confidential Information"). You shall not disclose such Confidential
+    Information and shall use it only in accordance with the terms of the
+    license agreement you entered into with Synchronoss Technologies.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns="http://www.synchronoss.com/activation/GenericActivationRequestV1.00.xsd"
+    targetNamespace="http://www.synchronoss.com/activation/GenericActivationRequestV1.00.xsd"
+    xmlns:gen="http://www.synchronoss.com/activation/ActivationRequestV1.00.xsd"
+    elementFormDefault="qualified">
+    <xs:import schemaLocation="XsiType_ActivationRequestV1.00.xsd" namespace="http://www.synchronoss.com/activation/ActivationRequestV1.00.xsd"/>
+    <xs:complexType name="ct_GenericActivationRequest">
+        <xs:complexContent>
+            <xs:extension base="gen:ct_AbstractActivationRequest"/>
+        </xs:complexContent>
+    </xs:complexType>
+</xs:schema>
+
diff --git a/xml/tests/testData/xml/XsiType_TypesV1.00.xsd b/xml/tests/testData/xml/XsiType_TypesV1.00.xsd
new file mode 100644
index 0000000..f16d3fb
--- /dev/null
+++ b/xml/tests/testData/xml/XsiType_TypesV1.00.xsd
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2001-2009 Synchronoss Technologies, Inc. 750 Route 202 South,
+    Bridgewater, New Jersey, 08807, U.S.A.  All Rights Reserved.
+
+    This source code is part of the ConvergenceNow(R) platform and is the
+    confidential and proprietary information of Synchronoss Technologies, Inc.
+    ("Confidential Information"). You shall not disclose such Confidential
+    Information and shall use it only in accordance with the terms of the
+    license agreement you entered into with Synchronoss Technologies.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns="http://www.synchronoss.com/common/TypesV1.00.xsd"
+    targetNamespace="http://www.synchronoss.com/common/TypesV1.00.xsd"
+    elementFormDefault="qualified">
+    <xs:complexType name="ct_Header">
+        <xs:sequence>
+            <xs:element name="Notification" type="ct_Notification"/>
+        </xs:sequence>
+        <xs:attribute name="timeStamp" type="xs:dateTime" use="required"/>
+        <xs:attribute name="transactionID" type="st_NonZeroLengthString" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="ct_Notification">
+        <xs:attribute name="notificationUrl" type="st_NonZeroLengthString" use="optional"/>
+        <xs:attribute name="notificationEmail" type="st_EmailAddress" use="required"/>
+        <xs:attribute name="secondaryEmail" type="st_EmailAddress" use="optional"/>
+    </xs:complexType>
+    <xs:simpleType name="st_EmailAddress">
+        <xs:restriction base="st_NonZeroLengthString"/>
+    </xs:simpleType>
+    <xs:simpleType name="st_NonZeroLengthString">
+        <xs:restriction base="xs:string">
+            <xs:whiteSpace value="collapse"/>
+            <xs:minLength value="1"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="st_PhoneNumber">
+        <xs:restriction base="xs:string">
+            <xs:pattern value="[0-9]{10}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:complexType name="ct_PhoneNumberwExtension">
+        <xs:sequence>
+            <xs:element name="PhoneNumber" type="st_PhoneNumber"/>
+            <xs:element name="Extension" type="st_NonZeroLengthString" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:simpleType name="st_State">
+        <xs:restriction base="xs:string">
+            <xs:enumeration value="AA"/>
+            <xs:enumeration value="AK"/>
+            <xs:enumeration value="AL"/>
+            <xs:enumeration value="AR"/>
+            <xs:enumeration value="AZ"/>
+            <xs:enumeration value="AP"/>
+            <xs:enumeration value="AE"/>
+            <xs:enumeration value="CA"/>
+            <xs:enumeration value="CO"/>
+            <xs:enumeration value="CT"/>
+            <xs:enumeration value="DC"/>
+            <xs:enumeration value="DE"/>
+            <xs:enumeration value="FL"/>
+            <xs:enumeration value="FPO"/>
+            <xs:enumeration value="GA"/>
+            <xs:enumeration value="HI"/>
+            <xs:enumeration value="IA"/>
+            <xs:enumeration value="ID"/>
+            <xs:enumeration value="IL"/>
+            <xs:enumeration value="IN"/>
+            <xs:enumeration value="KS"/>
+            <xs:enumeration value="KY"/>
+            <xs:enumeration value="LA"/>
+            <xs:enumeration value="MA"/>
+            <xs:enumeration value="MD"/>
+            <xs:enumeration value="ME"/>
+            <xs:enumeration value="MI"/>
+            <xs:enumeration value="MN"/>
+            <xs:enumeration value="MO"/>
+            <xs:enumeration value="MS"/>
+            <xs:enumeration value="MT"/>
+            <xs:enumeration value="NC"/>
+            <xs:enumeration value="ND"/>
+            <xs:enumeration value="NE"/>
+            <xs:enumeration value="NH"/>
+            <xs:enumeration value="NJ"/>
+            <xs:enumeration value="NM"/>
+            <xs:enumeration value="NV"/>
+            <xs:enumeration value="NY"/>
+            <xs:enumeration value="OH"/>
+            <xs:enumeration value="OK"/>
+            <xs:enumeration value="OR"/>
+            <xs:enumeration value="PA"/>
+            <xs:enumeration value="PR"/>
+            <xs:enumeration value="RI"/>
+            <xs:enumeration value="SC"/>
+            <xs:enumeration value="SD"/>
+            <xs:enumeration value="TN"/>
+            <xs:enumeration value="TX"/>
+            <xs:enumeration value="UT"/>
+            <xs:enumeration value="VA"/>
+            <xs:enumeration value="VI"/>
+            <xs:enumeration value="VT"/>
+            <xs:enumeration value="WA"/>
+            <xs:enumeration value="WI"/>
+            <xs:enumeration value="WV"/>
+            <xs:enumeration value="WY"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="st_PostalCode5">
+        <xs:restriction base="xs:string">
+            <xs:whiteSpace value="collapse"/>
+            <xs:length value="5"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="st_Plus4">
+        <xs:restriction base="xs:string">
+            <xs:whiteSpace value="collapse"/>
+            <xs:length value="4"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:complexType name="ct_PostalCode">
+        <xs:simpleContent>
+            <xs:extension base="st_PostalCode5">
+                <xs:attribute name="plus4" type="st_Plus4" use="optional"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+    <xs:simpleType name="st_NamePrefix">
+        <xs:restriction base="xs:string">
+            <xs:enumeration value="Mr."/>
+            <xs:enumeration value="Mrs."/>
+            <xs:enumeration value="Miss."/>
+            <xs:enumeration value="Ms."/>
+            <xs:enumeration value="Dr."/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="st_NameSuffix">
+        <xs:restriction base="xs:string">
+            <xs:enumeration value="DDS"/>
+            <xs:enumeration value="I"/>
+            <xs:enumeration value="II"/>
+            <xs:enumeration value="III"/>
+            <xs:enumeration value="IV"/>
+            <xs:enumeration value="Jr"/>
+            <xs:enumeration value="Jr."/>
+            <xs:enumeration value="JR"/>
+            <xs:enumeration value="MD"/>
+            <xs:enumeration value="PhD"/>
+            <xs:enumeration value="Sr"/>
+            <xs:enumeration value="Sr."/>
+            <xs:enumeration value="SR"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:complexType name="ct_Name">
+        <xs:sequence>
+            <xs:element name="Title" type="st_NonZeroLengthString" minOccurs="0"/>
+            <xs:element minOccurs="0" type="st_NamePrefix" name="Prefix"/>
+            <xs:element name="FirstName" type="st_NonZeroLengthString"/>
+            <xs:element name="MiddleInitial" type="st_NonZeroLengthString" minOccurs="0"/>
+            <xs:element name="LastName" type="st_NonZeroLengthString"/>
+            <xs:element minOccurs="0" name="Suffix" type="st_NameSuffix"/>
+            <xs:element name="HomePhone" type="st_PhoneNumber"/>
+            <xs:element name="WorkPhone" type="ct_PhoneNumberwExtension"/>
+            <xs:element name="EmailAddress" type="st_EmailAddress" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:simpleType name="st_SSN">
+        <xs:restriction base="xs:string">
+            <xs:pattern value="[0-9]{9}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="st_Last4SSN">
+        <xs:restriction base="xs:string">
+            <xs:pattern value="[0-9]{4}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="st_YearMonthDay">
+        <xs:restriction base="xs:string">
+            <xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:complexType name="ct_PhotoIdentity">
+        <xs:sequence>
+            <xs:element name="LicenseNumber" type="st_NonZeroLengthString"/>
+            <xs:element name="StateIssued" type="st_NonZeroLengthString"/>
+            <xs:element name="LicenseExpirationDate" type="st_YearMonthDay"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:simpleType name="st_USCurrency">
+        <xs:restriction base="xs:decimal">
+            <xs:fractionDigits value="2"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:complexType name="ct_Address">
+        <xs:sequence>
+            <xs:choice>
+                <xs:element name="POBox" type="st_NonZeroLengthString"/>
+                <xs:sequence>
+                    <xs:element name="Street1" type="st_NonZeroLengthString"/>
+                    <xs:element name="Street2" type="xs:string" minOccurs="0"/>
+                </xs:sequence>
+                <xs:sequence>
+                    <xs:element name="HouseNumber" type="st_NonZeroLengthString" minOccurs="0"/>
+                    <xs:element name="HouseNumberSuffix" type="st_NonZeroLengthString" minOccurs="0"/>
+                    <xs:element name="DirectionPrefix" type="st_NonZeroLengthString" minOccurs="0"/>
+                    <xs:element name="Direction" type="st_NonZeroLengthString" minOccurs="0"/>
+                    <xs:element name="StreetName" type="st_NonZeroLengthString"/>
+                    <xs:element name="StreetNameSuffix" type="st_NonZeroLengthString" minOccurs="0"/>
+                    <xs:element name="StreetType" type="st_NonZeroLengthString" minOccurs="0"/>
+                    <xs:element name="Structure" type="st_NonZeroLengthString" minOccurs="0"/>
+                    <xs:element name="StructureNum" type="st_NonZeroLengthString" minOccurs="0"/>
+                    <xs:element name="Level" type="st_NonZeroLengthString" minOccurs="0"/>
+                    <xs:element name="LevelNum" type="st_NonZeroLengthString" minOccurs="0"/>
+                    <xs:element name="ApartmentUnit" type="st_NonZeroLengthString" minOccurs="0"/>
+                    <xs:element name="ApartmentUnitNum" type="st_NonZeroLengthString" minOccurs="0"/>
+                </xs:sequence>
+            </xs:choice>
+            <xs:element name="City" type="st_NonZeroLengthString"/>
+            <xs:element name="State" type="st_State"/>
+            <xs:element name="PostalCode" type="ct_PostalCode"/>
+            <xs:element name="Country" type="st_NonZeroLengthString" minOccurs="0"/>
+            <xs:element name="Attention" type="st_NonZeroLengthString" minOccurs="0"/>
+        </xs:sequence>
+        <xs:attribute name="type" use="optional" type="st_AddressType"/>
+    </xs:complexType>
+    <xs:simpleType name="st_AddressType">
+        <xs:restriction base="xs:string">
+            <xs:enumeration value="United States"/>
+            <xs:enumeration value="Rural Route"/>
+            <xs:enumeration value="Military"/>
+            <xs:enumeration value="P.O. Box"/>
+            <xs:enumeration value="International"/>
+            <xs:enumeration value="Puerto Rico/USVI"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="st_ICCID">
+        <xs:restriction base="xs:string">
+            <xs:pattern value="[0-9]{20}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="st_IMEI">
+        <xs:restriction base="xs:string">
+            <xs:pattern value="[0-9]{15}"/>
+        </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType name="st_ESN">
+        <xs:restriction base="xs:string">
+            <xs:pattern value="[0-9]{18}"/>
+        </xs:restriction>
+    </xs:simpleType>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/Xslt2.xsl b/xml/tests/testData/xml/Xslt2.xsl
new file mode 100644
index 0000000..7c3a2a9
--- /dev/null
+++ b/xml/tests/testData/xml/Xslt2.xsl
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    This is a syntactically valid (but useless) XSLT 2 stylesheet to test IDEA's XSLT 2 support.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+    xmlns:myfn="<error>http://surguy.net/namespaces/myfunctions</error>"
+    exclude-result-prefixes="#all">
+
+    <xsl:character-map name="test">
+        <xsl:output-character character="a" string="b"/>
+    </xsl:character-map>
+
+    <xsl:output byte-order-mark="no" use-character-maps="test" />
+
+    <xsl:template match="/" mode="#all">
+        This is a dummy template
+        <xsl:apply-templates select="* except IgnoreMe" mode="#current">
+            <xsl:sort/>
+        </xsl:apply-templates>
+    </xsl:template>
+
+    <xsl:template match="text()">
+        <xsl:analyze-string select="." regex="[a-z]">
+            <xsl:matching-substring>Found something</xsl:matching-substring>
+            <xsl:non-matching-substring>Found nothing</xsl:non-matching-substring>
+        </xsl:analyze-string>
+    </xsl:template>
+
+    <xsl:function name="myfn:test">
+        <xsl:param name="current"></xsl:param>
+    </xsl:function>
+
+
+
+</xsl:stylesheet>
diff --git a/xml/tests/testData/xml/XsltValidation.xsl b/xml/tests/testData/xml/XsltValidation.xsl
new file mode 100644
index 0000000..2063a7f
--- /dev/null
+++ b/xml/tests/testData/xml/XsltValidation.xsl
@@ -0,0 +1,15 @@
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+
+  <xsl:template match="/*">
+    <taglib>
+      <xsl:if test="@version">
+        <tlib-version><xsl:value-of select="@version" /></tlib-version>
+      </xsl:if>
+      <xsl:if test="@version">
+        <tlib-version><xsl:value-of select="@version" /></tlib-version>
+      </xsl:if>
+    </taglib>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XsltValidation2.xsl b/xml/tests/testData/xml/XsltValidation2.xsl
new file mode 100644
index 0000000..da5562c
--- /dev/null
+++ b/xml/tests/testData/xml/XsltValidation2.xsl
@@ -0,0 +1,12 @@
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd">
+
+  <xsl:template match="/*">
+    <taglib version="2.0">
+      <xsl:if test="@version">
+        <tlib-version><xsl:value-of select="@version" /></tlib-version>
+      </xsl:if>
+    </taglib>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/XsltValidation3.xsl b/xml/tests/testData/xml/XsltValidation3.xsl
new file mode 100644
index 0000000..2a7b961
--- /dev/null
+++ b/xml/tests/testData/xml/XsltValidation3.xsl
@@ -0,0 +1,16 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  <xsl:template match="/">
+      <a>
+          <b>
+              <c>
+                  <xsl:if test="something">
+                      <d>
+                          <e></e>
+                      </d>
+                  </xsl:if>
+              </c>
+          </b>
+      </a>
+  </xsl:template>
+</xsl:stylesheet>
+
diff --git a/xml/tests/testData/xml/allUnbound.xsd b/xml/tests/testData/xml/allUnbound.xsd
new file mode 100644
index 0000000..36be69f
--- /dev/null
+++ b/xml/tests/testData/xml/allUnbound.xsd
@@ -0,0 +1,27 @@
+<schema
+    xmlns:tns="allUnbound"
+    xmlns="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="allUnbound"
+    elementFormDefault="qualified">
+
+    <complexType name="object"/>
+
+    <complexType name="all">
+        <complexContent>
+            <extension base="tns:object">
+                <all>
+                    <element name="req" type="string"/>
+                    <element name="optional" type="string" minOccurs="0"/>
+                </all>
+            </extension>
+        </complexContent>
+    </complexType>
+
+    <element name="root">
+        <complexType>
+            <sequence>
+                <element name="item" type="tns:all" maxOccurs="unbounded"/>
+            </sequence>
+        </complexType>
+    </element>
+</schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/application-client_1_4.xsd b/xml/tests/testData/xml/application-client_1_4.xsd
new file mode 100644
index 0000000..93e6af1
--- /dev/null
+++ b/xml/tests/testData/xml/application-client_1_4.xsd
@@ -0,0 +1,266 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+	    targetNamespace="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	    elementFormDefault="qualified"
+	    attributeFormDefault="unqualified"
+	    version="1.4">
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)application-client_1_4.xsds	1.17 02/11/03
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
+      Road, Palo Alto, California 94303, U.S.A. All rights
+      reserved.
+
+      Sun Microsystems, Inc. has intellectual property rights
+      relating to technology described in this document. In
+      particular, and without limitation, these intellectual
+      property rights may include one or more of the U.S. patents
+      listed at http://www.sun.com/patents and one or more
+      additional patents or pending patent applications in the
+      U.S. and other countries.
+
+      This document and the technology which it describes are
+      distributed under licenses restricting their use, copying,
+      distribution, and decompilation. No part of this document
+      may be reproduced in any form by any means without prior
+      written authorization of Sun and its licensors, if any.
+
+      Third-party software, including font technology, is
+      copyrighted and licensed from Sun suppliers.
+
+      Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
+      JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+      Cup logo are trademarks or registered trademarks of Sun
+      Microsystems, Inc. in the U.S. and other countries.
+
+      Federal Acquisitions: Commercial Software - Government Users
+      Subject to Standard License Terms and Conditions.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[
+
+	This is the XML Schema for the application client 1.4
+	deployment descriptor.  The deployment descriptor must
+	be named "META-INF/application-client.xml" in the
+	application client's jar file.  All application client
+	deployment descriptors must indicate the application
+	client schema by using the J2EE namespace:
+
+	http://java.sun.com/xml/ns/j2ee
+
+	and indicate the version of the schema by
+	using the version element as shown below:
+
+	    <application-client xmlns="http://java.sun.com/xml/ns/j2ee"
+	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+		http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd"
+	      version="1.4">
+	      ...
+	    </application-client>
+
+	The instance documents may indicate the published version of
+	the schema using the xsi:schemaLocation attribute for J2EE
+	namespace with the following location:
+
+	http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd
+
+	]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all J2EE
+      deployment descriptor elements unless indicated otherwise.
+
+      - In elements that specify a pathname to a file within the
+	same JAR file, relative filenames (i.e., those not
+	starting with "/") are considered relative to the root of
+	the JAR file's namespace.  Absolute filenames (i.e., those
+	starting with "/") also specify names in the root of the
+	JAR file's namespace.  In general, relative names are
+	preferred.  The exception is .war files where absolute
+	names are preferred for consistency with the Servlet API.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="j2ee_1_4.xsd"/>
+
+
+<!-- **************************************************** -->
+
+
+  <xsd:element name="application-client" type="j2ee:application-clientType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The application-client element is the root element of an
+	application client deployment descriptor.  The application
+	client deployment descriptor describes the EJB components
+	and external resources referenced by the application
+	client.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:unique name="env-entry-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The env-entry-name element contains the name of an
+	  application client's environment entry.  The name is a JNDI
+	  name relative to the java:comp/env context.  The name must
+	  be unique within an application client.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:env-entry"/>
+      <xsd:field    xpath="j2ee:env-entry-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="ejb-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The ejb-ref-name element contains the name of an EJB
+	  reference. The EJB reference is an entry in the application
+	  client's environment and is relative to the
+	  java:comp/env context. The name must be unique within the
+	  application client.
+
+	  It is recommended that name is prefixed with "ejb/".
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:ejb-ref"/>
+      <xsd:field    xpath="j2ee:ejb-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="res-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The res-ref-name element specifies the name of a
+	  resource manager connection factory reference.The name
+	  is a JNDI name relative to the java:comp/env context.
+	  The name must be unique within an application client.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:resource-ref"/>
+      <xsd:field    xpath="j2ee:res-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="resource-env-ref-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The resource-env-ref-name element specifies the name of
+	  a resource environment reference; its value is the
+	  environment entry name used in the application client
+	  code. The name is a JNDI name relative to the
+	  java:comp/env context and must be unique within an
+	  application client.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:resource-env-ref"/>
+      <xsd:field    xpath="j2ee:resource-env-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="message-destination-ref-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The message-destination-ref-name element specifies the
+	  name of a message destination reference; its value is
+	  the message destination reference name used in the
+	  application client code. The name is a JNDI name
+	  relative to the java:comp/env context and must be unique
+	  within an application client.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:message-destination-ref"/>
+      <xsd:field    xpath="j2ee:message-destination-ref-name"/>
+    </xsd:unique>
+  </xsd:element>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="application-clientType">
+    <xsd:sequence>
+      <xsd:group ref="j2ee:descriptionGroup"/>
+      <xsd:element name="env-entry"
+		   type="j2ee:env-entryType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="ejb-ref"
+		   type="j2ee:ejb-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:group ref="j2ee:service-refGroup"/>
+      <xsd:element name="resource-ref"
+		   type="j2ee:resource-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="resource-env-ref"
+		   type="j2ee:resource-env-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="message-destination-ref"
+		   type="j2ee:message-destination-refType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="callback-handler"
+		   type="j2ee:fully-qualified-classType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The callback-handler element names a class provided by
+	    the application.  The class must have a no args
+	    constructor and must implement the
+	    javax.security.auth.callback.CallbackHandler
+	    interface.  The class will be instantiated by the
+	    application client container and used by the container
+	    to collect authentication information from the user.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="message-destination"
+		   type="j2ee:message-destinationType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+    </xsd:sequence>
+
+    <xsd:attribute name="version"
+		   type="j2ee:dewey-versionType"
+		   fixed="1.4"
+		   use="required">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The required value for the version is 1.4.
+
+	</xsd:documentation>
+      </xsd:annotation>
+
+    </xsd:attribute>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+</xsd:schema>
+
diff --git a/xml/tests/testData/xml/badXmlns.xml b/xml/tests/testData/xml/badXmlns.xml
new file mode 100644
index 0000000..329c1dd
--- /dev/null
+++ b/xml/tests/testData/xml/badXmlns.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context=
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+</beans>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/closedTag1.xml b/xml/tests/testData/xml/closedTag1.xml
new file mode 100644
index 0000000..490e373
--- /dev/null
+++ b/xml/tests/testData/xml/closedTag1.xml
@@ -0,0 +1,3 @@
+<a>
+  <<error>b</error>></<error>c</error>>
+</a>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/def_xslt.dtd b/xml/tests/testData/xml/def_xslt.dtd
new file mode 100644
index 0000000..554a7f7
--- /dev/null
+++ b/xml/tests/testData/xml/def_xslt.dtd
@@ -0,0 +1,280 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- 
+   This DTD has been developed in order to provide entry helpers for XSLT documents 
+   conformant to the W3C XSLT 1.0 Recommendation.
+   
+   © Altova GmbH, 1999-2002. 
+-->
+
+<!ENTITY % xhtml-dtd PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+                   "xhtml1-transitional.dtd">
+%xhtml-dtd; 
+
+<!--XSL Begins here-->
+<!ENTITY % result-elements "a|abbr|acronym|address|applet|area|b|base|basefont|bdo|big|blockquote|body|br|button|caption|center|cite|code|col|colgroup|dd|del|dfn|dir|div|dl|dt|em|fieldset|font|form|h1|h2|h3|h4|h5|h6|head|hr|html|i|iframe|img|input|ins|isindex|kbd|label|legend|li|link|map|menu|meta|noframes|noscript|object|ol|optgroup|option|p|param|pre|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|ul|var">
+<!ENTITY % char-instructions "xsl:apply-templates
+  | xsl:call-template
+  | xsl:apply-imports
+  | xsl:for-each
+  | xsl:value-of
+  | xsl:copy-of
+  | xsl:number
+  | xsl:choose
+  | xsl:if
+  | xsl:text
+  | xsl:copy
+  | xsl:variable
+  | xsl:message
+  | xsl:fallback">
+<!ENTITY % instructions "%char-instructions;
+  | xsl:processing-instruction
+  | xsl:comment
+  | xsl:element
+  | xsl:attribute">
+<!ENTITY % char-template "(#PCDATA |
+  %char-instructions;)*">
+<!ENTITY % template "(#PCDATA |
+  %instructions; |
+  %result-elements;)*">
+<!-- Used for the type of an attribute value that is a URI reference.-->
+<!ENTITY % URI "CDATA">
+<!-- Used for the type of an attribute value that is a pattern.-->
+<!ENTITY % pattern "CDATA">
+<!-- Used for the type of an attribute value that is an
+     attribute value template.-->
+<!ENTITY % avt "CDATA">
+<!-- Used for the type of an attribute value that is a QName; the prefix
+     gets expanded by the XSLT processor. -->
+<!ENTITY % qname "NMTOKEN">
+<!-- Like qname but a whitespace-separated list of QNames. -->
+<!ENTITY % qnames "NMTOKENS">
+<!-- Used for the type of an attribute value that is an expression.-->
+<!ENTITY % expr "CDATA">
+<!-- Used for the type of an attribute value that consists
+     of a single character.-->
+<!ENTITY % char "CDATA">
+<!-- Used for the type of an attribute value that is a priority. -->
+<!ENTITY % priority "NMTOKEN">
+<!ENTITY % space-att "xml:space (default|preserve) #IMPLIED">
+<!-- This may be overridden to customize the set of elements allowed
+at the top-level. -->
+<!ENTITY % top-level "(xsl:import*,
+  (xsl:include
+  | xsl:strip-space
+  | xsl:preserve-space
+  | xsl:output
+  | xsl:key
+  | xsl:decimal-format
+  | xsl:attribute-set
+  | xsl:variable
+  | xsl:param
+  | xsl:template
+  | xsl:namespace-alias
+  | %result-elements;)*)">
+<!ENTITY % top-level-atts 'extension-element-prefixes CDATA #IMPLIED
+  exclude-result-prefixes CDATA #IMPLIED
+  id ID #IMPLIED
+  version NMTOKEN #REQUIRED
+  xmlns:xsl CDATA #FIXED "http://www.w3.org/1999/XSL/Transform"
+  %space-att;'>
+<!-- This entity is defined for use in the ATTLIST declaration
+for result elements. -->
+<!ENTITY % result-element-atts 'xsl:extension-element-prefixes CDATA #IMPLIED
+  xsl:exclude-result-prefixes CDATA #IMPLIED
+  xsl:use-attribute-sets %qnames; #IMPLIED
+  xsl:version NMTOKEN #IMPLIED'>
+<!ELEMENT xsl:stylesheet %top-level;>
+<!ATTLIST xsl:stylesheet
+	%top-level-atts; 
+>
+<!ELEMENT xsl:transform %top-level;>
+<!ATTLIST xsl:transform
+	%top-level-atts; 
+>
+<!ELEMENT xsl:import EMPTY>
+<!ATTLIST xsl:import
+	href %URI; #REQUIRED
+>
+<!ELEMENT xsl:include EMPTY>
+<!ATTLIST xsl:include
+	href %URI; #REQUIRED
+>
+<!ELEMENT xsl:strip-space EMPTY>
+<!ATTLIST xsl:strip-space
+	elements CDATA #REQUIRED
+>
+<!ELEMENT xsl:preserve-space EMPTY>
+<!ATTLIST xsl:preserve-space
+	elements CDATA #REQUIRED
+>
+<!ELEMENT xsl:output EMPTY>
+<!ATTLIST xsl:output
+	method %qname; #IMPLIED
+	version NMTOKEN #IMPLIED
+	encoding CDATA #IMPLIED
+	omit-xml-declaration (yes | no) #IMPLIED
+	standalone (yes | no) #IMPLIED
+	doctype-public CDATA #IMPLIED
+	doctype-system CDATA #IMPLIED
+	cdata-section-elements %qnames; #IMPLIED
+	indent (yes | no) #IMPLIED
+	media-type CDATA #IMPLIED
+>
+<!ELEMENT xsl:key EMPTY>
+<!ATTLIST xsl:key
+	name %qname; #REQUIRED
+	match %pattern; #REQUIRED
+	use %expr; #REQUIRED
+>
+<!ELEMENT xsl:decimal-format EMPTY>
+<!ATTLIST xsl:decimal-format
+	name %qname; #IMPLIED
+	decimal-separator %char; "."
+	grouping-separator %char; ","
+	infinity CDATA "Infinity"
+	minus-sign %char; "-"
+	NaN CDATA "NaN"
+	percent %char; "%"
+	per-mille %char; "&#x2030;"
+	zero-digit %char; "0"
+	digit %char; "#"
+	pattern-separator %char; ";"
+>
+<!ELEMENT xsl:namespace-alias EMPTY>
+<!ATTLIST xsl:namespace-alias
+	stylesheet-prefix CDATA #REQUIRED
+	result-prefix CDATA #REQUIRED
+>
+<!ELEMENT xsl:template (#PCDATA | %instructions; | %result-elements; | xsl:param)*>
+<!ATTLIST xsl:template
+	match %pattern; #IMPLIED
+	name %qname; #IMPLIED
+	priority %priority; #IMPLIED
+	mode %qname; #IMPLIED
+	%space-att; 
+>
+<!ELEMENT xsl:value-of EMPTY>
+<!ATTLIST xsl:value-of
+	select %expr; #REQUIRED
+	disable-output-escaping (yes | no) "no"
+>
+<!ELEMENT xsl:copy-of EMPTY>
+<!ATTLIST xsl:copy-of
+	select %expr; #REQUIRED
+>
+<!ELEMENT xsl:number EMPTY>
+<!ATTLIST xsl:number
+	level (single | multiple | any) "single"
+	count %pattern; #IMPLIED
+	from %pattern; #IMPLIED
+	value %expr; #IMPLIED
+	format %avt; "1"
+	lang %avt; #IMPLIED
+	letter-value %avt; #IMPLIED
+	grouping-separator %avt; #IMPLIED
+	grouping-size %avt; #IMPLIED
+>
+<!ELEMENT xsl:apply-templates (xsl:sort | xsl:with-param)*>
+<!ATTLIST xsl:apply-templates
+	select %expr; "node()"
+	mode %qname; #IMPLIED
+>
+<!ELEMENT xsl:apply-imports EMPTY>
+<!-- xsl:sort cannot occur after any other elements or
+any non-whitespace character -->
+<!ELEMENT xsl:for-each (#PCDATA | %instructions; | %result-elements; | xsl:sort)*>
+<!ATTLIST xsl:for-each
+	select %expr; #REQUIRED
+	%space-att; 
+>
+<!ELEMENT xsl:sort EMPTY>
+<!ATTLIST xsl:sort
+	select %expr; "."
+	lang %avt; #IMPLIED
+	data-type %avt; "text"
+	order %avt; "ascending"
+	case-order %avt; #IMPLIED
+>
+<!ELEMENT xsl:if %template;>
+<!ATTLIST xsl:if
+	test %expr; #REQUIRED
+	%space-att; 
+>
+<!ELEMENT xsl:choose (xsl:when+, xsl:otherwise?)>
+<!ATTLIST xsl:choose
+	%space-att; 
+>
+<!ELEMENT xsl:when %template;>
+<!ATTLIST xsl:when
+	test %expr; #REQUIRED
+	%space-att; 
+>
+<!ELEMENT xsl:otherwise %template;>
+<!ATTLIST xsl:otherwise
+	%space-att; 
+>
+<!ELEMENT xsl:attribute-set (xsl:attribute)*>
+<!ATTLIST xsl:attribute-set
+	name %qname; #REQUIRED
+	use-attribute-sets %qnames; #IMPLIED
+>
+<!ELEMENT xsl:call-template (xsl:with-param)*>
+<!ATTLIST xsl:call-template
+	name %qname; #REQUIRED
+>
+<!ELEMENT xsl:with-param %template;>
+<!ATTLIST xsl:with-param
+	name %qname; #REQUIRED
+	select %expr; #IMPLIED
+>
+<!ELEMENT xsl:variable %template;>
+<!ATTLIST xsl:variable
+	name %qname; #REQUIRED
+	select %expr; #IMPLIED
+>
+<!ELEMENT xsl:param %template;>
+<!ATTLIST xsl:param
+	name %qname; #REQUIRED
+	select %expr; #IMPLIED
+>
+<!ELEMENT xsl:text (#PCDATA)>
+<!ATTLIST xsl:text
+	disable-output-escaping (yes | no) "no"
+>
+<!ELEMENT xsl:processing-instruction %char-template;>
+<!ATTLIST xsl:processing-instruction
+	name %avt; #REQUIRED
+	%space-att; 
+>
+<!ELEMENT xsl:element %template;>
+<!ATTLIST xsl:element
+	name %avt; #REQUIRED
+	namespace %avt; #IMPLIED
+	use-attribute-sets %qnames; #IMPLIED
+	%space-att; 
+>
+<!ELEMENT xsl:attribute %char-template;>
+<!ATTLIST xsl:attribute
+	name %avt; #REQUIRED
+	namespace %avt; #IMPLIED
+	%space-att; 
+>
+<!ELEMENT xsl:comment %char-template;>
+<!ATTLIST xsl:comment
+	%space-att; 
+>
+<!ELEMENT xsl:copy %template;>
+<!ATTLIST xsl:copy
+	%space-att; 
+	use-attribute-sets %qnames; #IMPLIED
+>
+<!ELEMENT xsl:message %template;>
+<!ATTLIST xsl:message
+	%space-att; 
+	terminate (yes | no) "no"
+>
+<!ELEMENT xsl:fallback %template;>
+<!ATTLIST xsl:fallback
+	%space-att; 
+>
diff --git a/xml/tests/testData/xml/duplicateAttribute.xml b/xml/tests/testData/xml/duplicateAttribute.xml
new file mode 100644
index 0000000..6c6b161
--- /dev/null
+++ b/xml/tests/testData/xml/duplicateAttribute.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE tv [ <!ELEMENT tv (date)*> <!ELEMENT date (#PCDATA)> <!ATTLIST tv id ID #IMPLIED>]>
+
+<tv <error>id</error>="1" <error>id</error>="3">
+
+</tv>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/duplicateAttribute2.xml b/xml/tests/testData/xml/duplicateAttribute2.xml
new file mode 100644
index 0000000..f198151
--- /dev/null
+++ b/xml/tests/testData/xml/duplicateAttribute2.xml
@@ -0,0 +1,6 @@
+<<error>root</error> xmlns:foo="http://www.foo.org/schema"
+    xmlns:foo="http://www.bar.org/foo">
+  <a>
+    <b/>
+  </a>
+</<error>root</error>>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/duplicateAttribute2.xsd b/xml/tests/testData/xml/duplicateAttribute2.xsd
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xml/tests/testData/xml/duplicateAttribute2.xsd
diff --git a/xml/tests/testData/xml/ejb-jar_2_0.dtd b/xml/tests/testData/xml/ejb-jar_2_0.dtd
new file mode 100644
index 0000000..9a2cc7c
--- /dev/null
+++ b/xml/tests/testData/xml/ejb-jar_2_0.dtd
@@ -0,0 +1,1671 @@
+<!--
+Copyright (c) 2000 Sun Microsystems, Inc.,
+901 San Antonio Road,
+Palo Alto, California 94303, U.S.A.
+All rights reserved.
+
+Sun Microsystems, Inc. has intellectual property rights relating to
+technology embodied in the product that is described in this document.
+In particular, and without limitation, these intellectual property
+rights may include one or more of the U.S. patents listed at
+http://www.sun.com/patents and one or more additional patents or
+pending patent applications in the U.S. and in other countries.
+
+This document and the product to which it pertains are distributed
+under licenses restricting their use, copying, distribution, and
+decompilation.  This document may be reproduced and distributed but may
+not be changed without prior written authorization of Sun and its
+licensors, if any.
+
+Third-party software, including font technology, is copyrighted and
+licensed from Sun suppliers.
+
+Sun,  Sun Microsystems,  the Sun logo,  Java,  JavaServer Pages,  Java
+Naming and Directory Interface,  JDBC,  JDK,  JavaMail and  and
+Enterprise JavaBeans are trademarks or registered trademarks of Sun
+Microsystems, Inc. in the U.S. and other countries.
+
+Federal Acquisitions: Commercial Software - Government Users Subject to
+Standard License Terms and Conditions.
+
+DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
+CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
+WARRANTY OF MERCHANTABILITY, FITNESS FOR FOR A PARTICULAR PURPOSE OR
+NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH
+DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
+
+
+_________________________________________________________________________
+
+Copyright (c) 2000 Sun Microsystems, Inc.,
+901 San Antonio Road,
+Palo Alto, California 94303, E'tats-Unis.
+Tous droits re'serve's.
+
+Sun Microsystems, Inc. a les droits de proprie'te' intellectuels
+relatants a` la technologie incorpore'e dans le produit qui est de'crit
+dans ce document. En particulier, et sans la limitation, ces droits de
+proprie'te' intellectuels peuvent inclure un ou plus des brevets
+ame'ricains e'nume're's a` http://www.sun.com/patents et un ou les
+brevets plus supple'mentaires ou les applications de brevet en attente
+dans les E'tats-Unis et dans les autres pays.
+
+Ce produit ou document est prote'ge' par un copyright et distribue'
+avec des licences qui en restreignent l'utilisation, la copie, la
+distribution, et la de'compilation.  Ce documention associe n peut
+e^tre reproduite et distribuer, par quelque moyen que ce soit, sans
+l'autorisation pre'alable et e'crite de Sun et de ses bailleurs de
+licence, le cas e'che'ant.
+
+Le logiciel de'tenu par des tiers, et qui comprend la technologie
+relative aux polices de caracte`res, est prote'ge' par un copyright et
+licencie' par des fournisseurs de Sun.
+
+Sun,  Sun Microsystems,  le logo Sun,  Java,  JavaServer Pages,  Java
+Naming and Directory Interface,  JDBC,  JDK,  JavaMail et  and
+Enterprise JavaBeans sont des marques de fabrique ou des marques
+de'pose'es de Sun Microsystems, Inc. aux E'tats-Unis et dans d'autres
+pays.
+
+LA DOCUMENTATION EST FOURNIE "EN L'E'TAT" ET TOUTES AUTRES CONDITIONS,
+DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT
+EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS
+NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A
+L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE
+CONTREFAC,ON.
+-->
+
+<!--
+This is the XML DTD for the EJB 2.0 deployment descriptor.
+All EJB 2.0 deployment descriptors must include a DOCTYPE
+of the following form:
+
+  <!DOCTYPE ejb-jar PUBLIC
+	"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+	"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
+
+-->
+
+<!--
+The following conventions apply to all J2EE deployment descriptor
+elements unless indicated otherwise.
+
+- In elements that contain PCDATA, leading and trailing whitespace
+  in the data may be ignored.
+
+- In elements whose value is an "enumerated type", the value is
+  case sensitive.
+
+- In elements that specify a pathname to a file within the same
+  JAR file, relative filenames (i.e., those not starting with "/")
+  are considered relative to the root of the JAR file's namespace.
+  Absolute filenames (i.e., those starting with "/") also specify
+  names in the root of the JAR file's namespace.  In general, relative
+  names are preferred.  The exception is .war files where absolute
+  names are preferred for consistency with the servlet API.
+-->
+
+
+<!--
+The ejb-jar element is the root element of the EJB deployment
+descriptor. It contains
+
+	- an optional description of the ejb-jar file
+	- an optional display name
+	- an optional small icon file name
+	- an optional large icon file name
+	- mandatory structural information about all included
+	  enterprise beans
+	- a descriptor for container managed relationships, if any
+	- an optional application-assembly descriptor
+	- an optional name of an ejb-client-jar file for the ejb-jar.
+-->
+<!ELEMENT ejb-jar (description?, display-name?, small-icon?,
+large-icon?, enterprise-beans, relationships?, assembly-descriptor?,
+ejb-client-jar?)>
+
+<!--
+The abstract-schema-name element specifies the name of the abstract
+schema type of an entity bean with cmp-version 2.x. It is used in EJB
+QL queries.
+
+For example, the abstract-schema-name for an entity bean whose local
+interface is com.acme.commerce.Order might be Order.
+
+Used in: entity
+-->
+<!ELEMENT abstract-schema-name (#PCDATA)>
+
+<!--
+
+The acknowledge-mode element specifies whether JMS AUTO_ACKNOWLEDGE or
+DUPS_OK_ACKNOWLEDGE message acknowledgment semantics should be used
+for the onMessage message of a message-driven bean that uses bean
+managed transaction demarcation.
+
+The acknowledge-mode element must be one of the two following:
+
+	<acknowledge-mode>Auto-acknowledge</acknowledge-mode>
+	<acknowledge-mode>Dups-ok-acknowledge</acknowledgemode>
+
+Used in: message-driven
+-->
+<!ELEMENT acknowledge-mode (#PCDATA)>
+
+<!--
+The assembly-descriptor element contains application-assembly information.
+
+The application-assembly information consists of the following parts:
+the definition of security roles, the definition of method
+permissions, the definition of transaction attributes for
+enterprise beans with container-managed transaction demarcation and
+a list of methods to be excluded from being invoked.
+
+All the parts are optional in the sense that they are omitted if the
+lists represented by them are empty.
+
+Providing an assembly-descriptor in the deployment descriptor is
+optional for the ejb-jar file producer.
+
+Used in: ejb-jar
+-->
+<!ELEMENT assembly-descriptor (security-role*, method-permission*,
+container-transaction*, exclude-list?)>
+
+<!--
+The cascade-delete element specifies that, within a particular
+relationship, the lifetime of one or more entity beans is dependent
+upon the lifetime of another entity bean. The cascade-delete element
+can only be specified for an ejb-relationship-role element contained
+in an ejb-relation element in which the other ejb-relationship-role
+element specifies a multiplicity of One.
+
+Used in: ejb-relationship-role
+-->
+<!ELEMENT cascade-delete EMPTY>
+
+<!--
+The cmp-field element describes a container-managed field. The
+field element includes an optional description of the field, and the
+name of the field.
+
+Used in: entity
+-->
+<!ELEMENT cmp-field (description?, field-name)>
+
+<!--
+The cmp-version element specifies the version of an entity bean
+with container-managed persistence.
+
+The cmp-version element must be one of the two following:
+
+	<cmp-version>1.x</cmp-version>
+	<cmp-version>2.x</cmp-version>
+
+The default value of the cmp-version element is 2.x.
+
+Used in: entity
+-->
+<!ELEMENT cmp-version (#PCDATA)>
+
+<!--
+
+The cmr-field element describes the bean provider's view of a
+relationship. It consists of an optional description, and the name and
+the class type of a field in the source of a role of a
+relationship. The cmr-field-name element corresponds to the name used
+for the get and set accessor methods for the relationship. The
+cmr-field-type element is used only for collection-valued
+cmr-fields. It specifies the type of the collection that is used.
+
+Used in: ejb-relationship-role
+-->
+<!ELEMENT cmr-field (description?, cmr-field-name, cmr-field-type?)>
+
+<!--
+The cmr-field-name element specifies the name of a logical
+relationship field in the entity bean class. The name of the cmr-field
+must begin with a lowercase letter. This field is accessed by methods
+whose names consist of the name of the field specified by
+cmr-field-name in which the first letter is uppercased, prefixed by
+"get" or "set".
+
+Used in: cmr-field
+-->
+<!ELEMENT cmr-field-name (#PCDATA)>
+
+<!--
+The cmr-field-type element specifies the class of a
+collection-valued logical relationship field in the entity bean
+class. The value of the cmr-field-type element must be either:
+java.util.Collection or java.util.Set.
+
+Used in: cmr-field
+-->
+<!ELEMENT cmr-field-type (#PCDATA)>
+
+<!--
+The container-transaction element specifies how the container
+must manage transaction scopes for the enterprise bean's method
+invocations. The element consists of an optional description, a list
+of method elements, and a transaction attribute. The transaction
+attribute is to be applied to all the specified methods.
+
+Used in: assembly-descriptor
+-->
+<!ELEMENT container-transaction (description?, method+, trans-attribute)>
+
+<!--
+The description element is used to provide text describing the parent
+element.  The description element should include any information that
+the enterprise bean ejb-jar file producer wants to provide to the consumer of
+the enterprise bean ejb-jar file (i.e., to the Deployer). Typically, the tools
+used by the enterprise bean ejb-jar file consumer will display the description
+when processing the parent element that contains the description.
+
+Used in: cmp-field, cmr-field, container-transaction, ejb-jar,
+ejb-local-ref, ejb-ref, ejb-relation, ejb-relationship-role, entity,
+env-entry, exclude-list, message-driven, method, method-permission,
+query, relationship-role-source, relationships, resource-env-ref,
+resource-ref, run-as, security-identity, security-role,
+security-role-ref, session
+-->
+<!ELEMENT description (#PCDATA)>
+
+<!--
+The destination-type element specifies the type of the JMS
+destination. The type is specified by the Java interface expected to
+be implemented by the destination.
+
+The destination-type element must be one of the two following:
+
+<destination-type>javax.jms.Queue</destination-type>
+<destination-type>javax.jms.Topic</destination-type>
+
+Used in: message-driven-destination
+-->
+<!ELEMENT destination-type (#PCDATA)>
+
+<!--
+The display-name element contains a short name that is intended to be
+displayed by tools.  The display name need not be unique.
+
+Used in: ejb-jar, entity, message-driven, session
+
+Example:
+
+<display-name>Employee Self Service</display-name>
+-->
+<!ELEMENT display-name (#PCDATA)>
+
+<!--
+The ejb-class element contains the fully-qualified name of the
+enterprise bean's class.
+
+Used in: entity, message-driven, session
+
+Example:
+
+<ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
+-->
+<!ELEMENT ejb-class (#PCDATA)>
+
+<!--
+The optional ejb-client-jar element specifies a JAR file that contains
+the class files necessary for a client program to access the
+enterprise beans in the ejb-jar file.
+
+Used in: ejb-jar
+
+Example:
+
+<ejb-client-jar>employee_service_client.jar</ejb-client-jar>
+-->
+<!ELEMENT ejb-client-jar (#PCDATA)>
+
+<!--
+The ejb-link element is used in the ejb-ref or ejb-local-ref
+elements to specify that an EJB reference is linked to an
+enterprise bean.
+
+The value of the ejb-link element must be the ejb-name of an
+enterprise bean in the same ejb-jar file or in another ejb-jar
+file in the same J2EE application unit.
+
+Alternatively, the name in the ejb-link element may be composed of a
+path name specifying the ejb-jar containing the referenced enterprise
+bean with the ejb-name of the target bean appended and separated from
+the path name by "#".  The path name is relative to the ejb-jar file
+containing the enterprise bean that is referencing the enterprise bean.
+This allows multiple enterprise beans with the same ejb-name to be
+uniquely identified.
+
+Used in: ejb-local-ref, ejb-ref
+
+Examples:
+
+	<ejb-link>EmployeeRecord</ejb-link>
+
+	<ejb-link>../products/product.jar#ProductEJB</ejb-link>
+
+-->
+<!ELEMENT ejb-link (#PCDATA)>
+
+<!--
+The ejb-local-ref element is used for the declaration of a reference to
+an enterprise bean's local home. The declaration consists of:
+
+	- an optional description
+	- the EJB reference name used in the code of the enterprise bean
+	  that's referencing the enterprise bean
+	- the expected type of the referenced enterprise bean
+	- the expected local home and local interfaces of the referenced
+	  enterprise bean
+	- optional ejb-link information, used to specify the referenced
+	  enterprise bean
+
+Used in: entity, message-driven, session
+-->
+<!ELEMENT ejb-local-ref (description?, ejb-ref-name, ejb-ref-type,
+		local-home, local, ejb-link?)>
+
+<!--
+The ejb-name element specifies an enterprise bean's name. This name is
+assigned by the ejb-jar file producer to name the enterprise bean in
+the ejb-jar file's deployment descriptor. The name must be unique
+among the names of the enterprise beans in the same ejb-jar file.
+
+There is no architected relationship between the ejb-name in the
+deployment descriptor and the JNDI name that the Deployer will assign
+to the enterprise bean's home.
+
+The name for an entity bean with cmp-version 2.x must conform to the
+lexical rules for an NMTOKEN. The name for an entity bean with
+cmp-version 2.x must not be a reserved literal in EJB QL.
+
+Used in: entity, message-driven, method, relationship-role-source,
+session
+
+Example:
+
+<ejb-name>EmployeeService</ejb-name>
+-->
+<!ELEMENT ejb-name (#PCDATA)>
+
+<!--
+The ejb-ql element contains the EJB QL query string that defines
+a finder or select query. This element is defined within the scope of
+a query element whose contents specify the finder or the select method
+that uses the query. The content must be a valid EJB QL query string
+for the entity bean for which the query is specified.
+
+The ejb-ql element must be specified for all queries that are
+expressible in EJB QL.
+
+Used in: query
+
+Example:
+<query>
+    <query-method>
+        <method-name>ejbSelectPendingLineitems</method-name>
+        <method-params/>
+    </query-method>
+    <ejb-ql>SELECT OBJECT(l) FROM LineItems l WHERE l.shipped <> TRUE
+    </ejb-ql>
+</query>
+
+-->
+<!ELEMENT ejb-ql (#PCDATA)>
+
+<!--
+The ejb-ref element is used for the declaration of a reference to
+an enterprise bean's home. The declaration consists of:
+
+	- an optional description
+	- the EJB reference name used in the code of
+	  the enterprise bean that's referencing the enterprise bean
+	- the expected type of the referenced enterprise bean
+	- the expected home and remote interfaces of the referenced
+	  enterprise bean
+	- optional ejb-link information, used to specify the referenced
+	  enterprise bean
+
+Used in: entity, message-driven, session
+-->
+<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type,
+		home, remote, ejb-link?)>
+
+<!--
+The ejb-ref-name element contains the name of an EJB reference. The
+EJB reference is an entry in the enterprise bean's environment and is
+relative to the java:comp/env context.  The name must be unique
+within the enterprise bean.
+
+It is recommended that name is prefixed with "ejb/".
+
+Used in: ejb-local-ref, ejb-ref
+
+Example:
+
+<ejb-ref-name>ejb/Payroll</ejb-ref-name>
+-->
+<!ELEMENT ejb-ref-name (#PCDATA)>
+
+<!--
+The ejb-ref-type element contains the expected type of the
+referenced enterprise bean.
+
+The ejb-ref-type element must be one of the following:
+
+	<ejb-ref-type>Entity</ejb-ref-type>
+	<ejb-ref-type>Session</ejb-ref-type>
+
+Used in: ejb-local-ref, ejb-ref
+-->
+<!ELEMENT ejb-ref-type (#PCDATA)>
+
+<!--
+
+The ejb-relation element describes a relationship between two
+entity beans with container-managed persistence.  An ejb-relation
+element contains a description; an optional ejb-relation-name element;
+and exactly two relationship role declarations, defined by the
+ejb-relationship-role elements. The name of the relationship, if
+specified, is unique within the ejb-jar file.
+
+Used in: relationships
+-->
+<!ELEMENT ejb-relation (description?, ejb-relation-name?, ejb-relationship-role,
+ejb-relationship-role)>
+
+<!--
+The ejb-relation-name element provides a unique name for a relationship.
+
+Used in: ejb-relation
+-->
+<!ELEMENT ejb-relation-name (#PCDATA)>
+
+<!--
+The ejb-relationship-role element describes a role within a
+relationship. There are two roles in each relationship.
+
+The ejb-relationship-role element contains an optional description; an
+optional name for the relationship role; a specification of the
+multiplicity of the role; an optional specification of cascade-delete
+functionality for the role; the role source; and a declaration of the
+cmr-field, if any, by means of which the other side of the
+relationship is accessed from the perspective of the role source.
+
+The multiplicity and role-source element are mandatory.
+
+The relationship-role-source element designates an entity bean by
+means of an ejb-name element. For bidirectional relationships, both
+roles of a relationship must declare a relationship-role-source
+element that specifies a cmr-field in terms of which the relationship
+is accessed. The lack of a cmr-field element in an
+ejb-relationship-role specifies that the relationship is
+unidirectional in navigability and the entity bean that participates
+in the relationship is "not aware" of the relationship.
+
+Used in: ejb-relation
+
+Example:
+
+<ejb-relation>
+    <ejb-relation-name>Product-LineItem</ejb-relation-name>
+    <ejb-relationship-role>
+        <ejb-relationship-role-name>product-has-lineitems
+        </ejb-relationship-role-name>
+        <multiplicity>One</multiplicity>
+        <relationship-role-source>
+        <ejb-name>ProductEJB</ejb-name>
+        </relationship-role-source>
+     </ejb-relationship-role>
+
+-->
+<!ELEMENT ejb-relationship-role (description?, ejb-relationship-role-name?,
+multiplicity, cascade-delete?, relationship-role-source, cmr-field?)>
+
+<!--
+The ejb-relationship-role-name element defines a name for a role that
+is unique within an ejb-relation. Different relationships can use the
+same name for a role.
+
+Used in: ejb-relationship-role
+-->
+<!ELEMENT ejb-relationship-role-name (#PCDATA)>
+
+<!--
+The enterprise-beans element contains the declarations of one or more
+enterprise beans.
+-->
+<!ELEMENT enterprise-beans (session | entity | message-driven)+>
+
+<!--
+The entity element declares an entity bean. The declaration
+consists of:
+
+	- an optional description
+	- an optional display name
+	- an optional small icon file name
+	- an optional large icon file name
+	- a unique name assigned to the enterprise bean
+	  in the deployment descriptor
+	- the names of the entity bean's remote home and remote
+          interfaces, if any
+	- the names of the entity bean's local home and local
+	  interfaces, if any
+	- the entity bean's implementation class
+	- the entity bean's persistence management type
+	- the entity bean's primary key class name
+	- an indication of the entity bean's reentrancy
+	- an optional specification of the entity bean's cmp-version
+	- an optional specification of the entity bean's abstract
+	  schema name
+	- an optional list of container-managed fields
+	- an optional specification of the primary key field
+	- an optional declaration of the bean's environment entries
+	- an optional declaration of the bean's EJB references
+	- an optional declaration of the bean's local EJB references
+	- an optional declaration of the security role references
+	- an optional declaration of the security identity
+	  to be used for the execution of the bean's methods
+	- an optional declaration of the bean's resource manager
+          connection factory references
+	- an optional declaration of the bean's
+	  resource environment references
+	- an optional set of query declarations
+	  for finder and select methods for an entity
+	  bean with cmp-version 2.x.
+
+The optional abstract-schema-name element must be specified for an
+entity bean with container-managed persistence and cmp-version 2.x.
+
+The optional primkey-field may be present in the descriptor if the
+entity's persistence-type is Container.
+
+The optional cmp-version element may be present in the descriptor if
+the entity's persistence-type is Container. If the persistence-type is
+Container and the cmp-version element is not specified, its value
+defaults to 2.x.
+
+The optional home and remote elements must be specified if the entity
+bean cmp-version is 1.x.
+
+The optional home and remote elements must be specified if the entity
+bean has a remote home and remote interface.
+
+The optional local-home and local elements must be specified if the
+entity bean has a local home and local interface.
+
+Either both the local-home and the local elements or both the
+home and the remote elements must be specified.
+
+The optional query elements must be present if the persistence-type is
+Container and the cmp-version is 2.x and query methods other than
+findByPrimaryKey have been defined for the entity bean.
+
+The other elements that are optional are "optional" in the sense that
+they are omitted if the lists represented by them are empty.
+
+At least one cmp-field element must be present in the descriptor if
+the entity's persistence-type is Container and the cmp-version is 1.x,
+and none must not be present if the entity's persistence-type is Bean.
+
+Used in: enterprise-beans
+
+-->
+<!ELEMENT entity (description?, display-name?, small-icon?,
+		large-icon?, ejb-name, home?, remote?, local-home?,
+		local?, ejb-class, persistence-type, prim-key-class,
+		reentrant, cmp-version?, abstract-schema-name?,
+		cmp-field*, primkey-field?, env-entry*, ejb-ref*,
+		ejb-local-ref*, security-role-ref*, security-identity?,
+		resource-ref*, resource-env-ref*, query*)>
+
+<!--
+The env-entry element contains the declaration of an enterprise bean's
+environment entry. The declaration consists of an optional
+description, the name of the environment entry, and an optional
+value.  If a value is not specified, one must be supplied
+during deployment.
+
+Used in: entity, message-driven, session
+-->
+<!ELEMENT env-entry (description?, env-entry-name, env-entry-type,
+		env-entry-value?)>
+
+<!--
+The env-entry-name element contains the name of an enterprise bean's
+environment entry.  The name is a JNDI name relative to the
+java:comp/env context.  The name must be unique within an enterprise bean.
+
+Used in: env-entry
+
+Example:
+
+<env-entry-name>minAmount</env-entry-name>
+-->
+<!ELEMENT env-entry-name (#PCDATA)>
+
+<!--
+The env-entry-type element contains the fully-qualified Java type of
+the environment entry value that is expected by the enterprise bean's
+code.
+
+The following are the legal values of env-entry-type:
+
+	java.lang.Boolean
+	java.lang.Byte
+	java.lang.Character
+	java.lang.String
+	java.lang.Short
+	java.lang.Integer
+	java.lang.Long
+	java.lang.Float
+	java.lang.Double
+
+
+Used in: env-entry
+
+Example:
+
+<env-entry-type>java.lang.Boolean</env-entry-type>
+-->
+<!ELEMENT env-entry-type (#PCDATA)>
+
+<!--
+The env-entry-value element contains the value of an enterprise bean's
+environment entry. The value must be a String that is valid for the
+constructor of the specified type that takes a single String
+parameter, or for java.lang.Character, a single character.
+
+Used in: env-entry
+
+Example:
+
+<env-entry-value>100.00</env-entry-value>
+-->
+<!ELEMENT env-entry-value (#PCDATA)>
+
+<!--
+The exclude list element specifies one or more methods which the
+Assembler marks to be uncallable.
+
+If the method permission relation contains methods that are in the
+exclude list, the Deployer should consider those methods to be
+uncallable.
+
+Used in: assembly-descriptor
+-->
+<!ELEMENT exclude-list (description?, method+)>
+
+<!--
+The field-name element specifies the name of a container managed
+field.
+
+The name of the cmp-field of an entity bean with cmp-version 2.x must
+begin with a lowercase letter. This field is accessed by methods whose
+names consists of the name of the field specified by field-name in
+which the first letter is uppercased, prefixed by "get" or "set".
+
+The name of the cmp-field of an entity bean with cmp-version 1.x must
+denote a public field of the enterprise bean class or one of its
+superclasses.
+
+Used in: cmp-field
+
+Example:
+
+
+	<field-name>firstName</field-Name>
+
+-->
+<!ELEMENT field-name (#PCDATA)>
+
+<!--
+The home element contains the fully-qualified name of the enterprise
+bean's home interface.
+
+Used in: ejb-ref, entity, session
+
+Example:
+
+<home>com.aardvark.payroll.PayrollHome</home>
+-->
+<!ELEMENT home (#PCDATA)>
+
+<!--
+The large-icon element contains the name of a file
+containing a large (32 x 32) icon image. The file
+name is a relative path within the enterprise bean's
+ejb-jar file.
+
+The image may be either in the JPEG or GIF format.
+The icon can be used by tools.
+
+Used in: ejb-jar, entity, message-driven, session
+
+Example:
+
+<large-icon>employee-service-icon32x32.jpg</large-icon>
+-->
+<!ELEMENT large-icon (#PCDATA)>
+
+<!--
+
+The local element contains the fully-qualified name of the
+enterprise bean's local interface.
+
+Used in: ejb-local-ref, entity, session
+
+-->
+<!ELEMENT local (#PCDATA)>
+
+<!--
+
+The local-home element contains the fully-qualified name of the
+enterprise bean's local home interface.
+
+Used in: ejb-local-ref, entity, session
+-->
+<!ELEMENT local-home (#PCDATA)>
+
+<!--
+
+The message-driven element declares a message-driven bean. The
+declaration consists of:
+
+	- an optional description
+	- an optional display name
+	- an optional small icon file name
+	- an optional large icon file name
+	- a name assigned to the enterprise bean in
+	  the deployment descriptor
+	- the message-driven bean's implementation class
+	- the message-driven bean's transaction management type
+	- an optional declaration of the message-driven bean's
+	  message selector
+	- an optional declaration of the
+	  acknowledgment mode for the message-driven bean
+	  if bean-managed transaction demarcation is used
+	- an optional declaration of the
+	  intended destination type of the message-driven bean
+	- an optional declaration of the bean's environment entries
+	- an optional declaration of the bean's EJB references
+	- an optional declaration of the bean's local EJB references
+	- an optional declaration of the security
+	  identity to be used for the execution of the bean's methods
+	- an optional declaration of the bean's resource manager
+	  connection factory references
+	- an optional declaration of the bean's resource
+          environment references.
+
+Used in: enterprise-beans
+-->
+<!ELEMENT message-driven (description?, display-name?, small-icon?,
+		large-icon?, ejb-name, ejb-class, transaction-type,
+		message-selector?, acknowledge-mode?,
+		message-driven-destination?, env-entry*, ejb-ref*,
+		ejb-local-ref*, security-identity?, resource-ref*,
+		resource-env-ref*)>
+
+<!--
+The message-driven-destination element provides advice to the Deployer
+as to whether a message-driven bean is intended for a Queue or a
+Topic. The declaration consists of: the type of the message-driven
+bean's intended destination and an optional declaration of whether a
+durable or non-durable subscription should be used if the
+destination-type is javax.jms.Topic.
+
+Used in: message-driven
+-->
+<!ELEMENT message-driven-destination (destination-type,
+subscription-durability?)>
+
+<!--
+The message-selector element is used to specify the JMS message
+selector to be used in determining which messages a message-driven
+bean is to receive.
+
+Example:
+<message-selector>JMSType = `car' AND color = `blue' AND weight &gt; 2500
+</message-selector>
+
+Used in: message-driven
+-->
+<!ELEMENT message-selector (#PCDATA)>
+
+<!--
+
+The method element is used to denote a method of an enterprise
+bean's home or component interface, or, in the case of a message-driven
+bean, the bean's onMessage method, or a set of methods. The ejb-name
+element must be the name of one of the enterprise beans declared in
+the deployment descriptor; the optional method-intf element allows to
+distinguish between a method with the same signature that is multiply
+defined across in both the home and component interfaces; the
+method-name element specifies the method name; and the optional
+method-params elements identify a single method among multiple methods
+with an overloaded method name.
+
+There are three possible styles of the method element syntax:
+
+1.
+<method>
+    <ejb-name>EJBNAME</ejb-name>
+    <method-name>*</method-name>
+</method>
+
+   This style is used to refer to all the methods of the specified
+   enterprise bean's home and component interfaces.
+
+2.
+<method>
+    <ejb-name>EJBNAME</ejb-name>
+    <method-name>METHOD</method-name>
+</method>>
+
+   This style is used to refer to the specified method of the
+   specified enterprise bean. If there are multiple methods with
+   the same overloaded name, the element of this style refers to
+   all the methods with the overloaded name.
+
+
+3.
+<method>
+    <ejb-name>EJBNAME</ejb-name>
+    <method-name>METHOD</method-name>
+    <method-params>
+        <method-param>PARAM-1</method-param>
+        <method-param>PARAM-2</method-param>
+        ...
+        <method-param>PARAM-n</method-param>
+    </method-params>
+<method>
+
+
+   This style is used to refer to a single method within a set of
+   methods with an overloaded name. PARAM-1 through PARAM-n are the
+   fully-qualified Java types of the method's input parameters (if
+   the method has no input arguments, the method-params element
+   contains no method-param elements). Arrays are specified by the
+   array element's type, followed by one or more pair of square
+   brackets (e.g. int[][]). If there are multiple methods with the
+   same overloaded name, this style refers to all of the overloaded
+   methods.
+
+
+Used in: container-transaction, exclude-list, method-permission
+
+Examples:
+
+Style 1: The following method element refers to all the methods of
+the EmployeeService bean's home and component interfaces:
+
+<method>
+    <ejb-name>EmployeeService</ejb-name>
+    <method-name>*</method-name>
+</method>
+
+Style 2: The following method element refers to all the create
+methods of the EmployeeService bean's home interface(s).
+
+<method>
+    <ejb-name>EmployeeService</ejb-name>
+    <method-name>create</method-name>
+</method>
+
+
+Style 3: The following method element refers to the
+create(String firstName, String LastName) method of the
+EmployeeService bean's home interface(s).
+
+<method>
+    <ejb-name>EmployeeService</ejb-name>
+    <method-name>create</method-name>
+    <method-params>
+        <method-param>java.lang.String</method-param>
+        <method-param>java.lang.String</method-param>
+    </method-params>
+</method>
+
+
+The following example illustrates a Style 3 element with
+more complex parameter types. The method
+foobar(char s, int i, int[] iar, mypackage.MyClass mycl,
+mypackage.MyClass[][] myclaar) would be specified as:
+
+<method>
+    <ejb-name>EmployeeService</ejb-name>
+    <method-name>foobar</method-name>
+    <method-params>
+        <method-param>char</method-param>
+        <method-param>int</method-param>
+        <method-param>int[]</method-param>
+        <method-param>mypackage.MyClass</method-param>
+        <method-param>mypackage.MyClass[][]</method-param>
+    </method-params>
+</method>
+
+
+The optional method-intf element can be used when it becomes necessary
+to differentiate between a method that is multiply defined across the
+enterprise bean's home and component interfaces with the same name and
+signature.
+
+
+For example, the method element
+
+<method>
+    <ejb-name>EmployeeService</ejb-name>
+    <method-intf>Remote</method-intf>
+    <method-name>create</method-name>
+    <method-params>
+        <method-param>java.lang.String</method-param>
+        <method-param>java.lang.String</method-param>
+    </method-params>
+</method>
+
+
+can be used to differentiate the create(String, String) method defined
+in the remote interface from the create(String, String) method defined
+in the remote home interface, which would be defined as
+
+
+<method>
+    <ejb-name>EmployeeService</ejb-name>
+    <method-intf>Home</method-intf>
+    <method-name>create</method-name>
+    <method-params>
+        <method-param>java.lang.String</method-param>
+        <method-param>java.lang.String</method-param>
+    </method-params>
+</method>
+
+and the create method that is defined in the local home interface
+which would be defined as
+
+<method>
+    <ejb-name>EmployeeService</ejb-name>
+    <method-intf>LocalHome</method-intf>
+    <method-name>create</method-name>
+    <method-params>
+        <method-param>java.lang.String</method-param>
+        <method-param>java.lang.String</method-param>
+    </method-params>
+</method>
+
+
+The method-intf element can be used with all three Styles of the
+method element usage. For example, the following method element
+example could be used to refer to all the methods of the
+EmployeeService bean's remote home interface.
+
+
+<method>
+    <ejb-name>EmployeeService</ejb-name>
+    <method-intf>Home</method-intf>
+    <method-name>*</method-name>
+</method>
+
+-->
+<!ELEMENT method (description?, ejb-name, method-intf?, method-name,
+method-params?)>
+
+<!--
+
+The method-intf element allows a method element to differentiate
+between the methods with the same name and signature that are multiply
+defined across the component and home interfaces (e.g, in both an
+enterprise bean's remote and local interfaces; in both an enterprise bean's
+home and remote interfaces, etc.)
+
+The method-intf element must be one of the following:
+
+	<method-intf>Home</method-intf>
+	<method-intf>Remote</method-intf>
+	<method-intf>LocalHome</method-intf>
+	<method-intf>Local</method-intf>
+
+Used in: method
+-->
+<!ELEMENT method-intf (#PCDATA)>
+
+<!--
+The method-name element contains a name of an enterprise bean method
+or the asterisk (*) character. The asterisk is used when the element
+denotes all the methods of an enterprise bean's component and home
+interfaces.
+
+Used in: method, query-method
+-->
+<!ELEMENT method-name (#PCDATA)>
+
+<!--
+The method-param element contains the fully-qualified Java type name
+of a method parameter.
+
+Used in: method-params
+-->
+<!ELEMENT method-param (#PCDATA)>
+
+<!--
+The method-params element contains a list of the fully-qualified Java
+type names of the method parameters.
+
+Used in: method, query-method
+-->
+<!ELEMENT method-params (method-param*)>
+
+<!--
+
+The method-permission element specifies that one or more security
+roles are allowed to invoke one or more enterprise bean methods. The
+method-permission element consists of an optional description, a list
+of security role names or an indicator to state that the method is
+unchecked for authorization, and a list of method elements.
+
+The security roles used in the method-permission element must be
+defined in the security-role elements of the deployment descriptor,
+and the methods must be methods defined in the enterprise bean's
+component and/or home interfaces.
+
+
+Used in: assembly-descriptor
+-->
+<!ELEMENT method-permission (description?, (role-name+|unchecked), method+)>
+
+<!--
+The multiplicity element describes the multiplicity of the role that
+participates in a relation.
+
+The multiplicity element must be one of the two following:
+
+	<multiplicity>One</multiplicity>
+	<multiplicity>Many</multiplicity>
+
+Used in: ejb-relationship-role
+-->
+<!ELEMENT multiplicity (#PCDATA)>
+
+<!--
+The persistence-type element specifies an entity bean's persistence
+management type.
+
+The persistence-type element must be one of the two following:
+
+	<persistence-type>Bean</persistence-type>
+	<persistence-type>Container</persistence-type>
+
+Used in: entity
+-->
+<!ELEMENT persistence-type (#PCDATA)>
+
+<!--
+The prim-key-class element contains the fully-qualified name of an
+entity bean's primary key class.
+
+If the definition of the primary key class is deferred to deployment
+time, the prim-key-class element should specify java.lang.Object.
+
+Used in: entity
+
+Examples:
+
+	<prim-key-class>java.lang.String</prim-key-class>
+
+	<prim-key-class>com.wombat.empl.EmployeeID</prim-key-class>
+
+	<prim-key-class>java.lang.Object</prim-key-class>
+
+-->
+<!ELEMENT prim-key-class (#PCDATA)>
+
+<!--
+The primkey-field element is used to specify the name of the primary
+key field for an entity with container-managed persistence.
+
+The primkey-field must be one of the fields declared in the cmp-field
+element, and the type of the field must be the same as the primary key
+type.
+
+The primkey-field element is not used if the primary key maps to
+multiple container-managed fields (i.e. the key is a compound key). In
+this case, the fields of the primary key class must be public, and
+their names must correspond to the field names of the entity bean
+class that comprise the key.
+
+Used in: entity
+
+Example:
+
+	<primkey-field>EmployeeId</primkey-field>
+
+-->
+<!ELEMENT primkey-field (#PCDATA)>
+
+<!--
+The query element is used to specify a finder or select query. It
+contains
+	- an optional description of the query
+	- the specification of the finder or select
+	  method it is used by
+        - an optional specification of the result type mapping, if
+          the query is for a select method and entity objects are
+          returned.
+    	- the EJB QL query string that defines the query.
+
+Queries that are expressible in EJB QL must use the ejb-ql element to
+specify the query. If a query is not expressible in EJB QL, the
+description element should be used to describe the semantics of the
+query and the ejb-ql element should be empty.
+
+The result-type-mapping is an optional element. It can only be present
+if the query-method specifies a select method that returns entity
+objects.  The default value for the result-type-mapping element is
+"Local".
+
+
+Used in: entity
+-->
+<!ELEMENT query (description?, query-method, result-type-mapping?, ejb-ql)>
+
+<!--
+The query-method element is used to specify the method for a finder or
+select query.
+
+The method-name element specifies the name of a finder or select
+method in the entity bean's implementation class.
+
+Each method-param must be defined for a query-method using the
+method-params element.
+
+Used in: query
+
+Example:
+
+<query>
+    <description>Method finds large orders</description>
+    <query-method>
+        <method-name>findLargeOrders</method-name>
+        <method-params></method-params>
+    </query-method>
+    <ejb-ql>SELECT OBJECT(o) FROM Order o WHERE o.amount &gt; 1000</ejb-ql>
+</query>
+
+-->
+<!ELEMENT query-method (method-name, method-params)>
+
+<!--
+The reentrant element specifies whether an entity bean is reentrant or
+not.
+
+The reentrant element must be one of the two following:
+
+	<reentrant>True</reentrant>
+	<reentrant>False</reentrant>
+
+Used in: entity
+-->
+<!ELEMENT reentrant (#PCDATA)>
+
+<!--
+
+The relationship-role-source element designates the source of a role
+that participates in a relationship. A relationship-role-source
+element uniquely identifies an entity bean.
+
+Used in: ejb-relationship-role
+-->
+<!ELEMENT relationship-role-source (description?, ejb-name)>
+
+<!--
+The relationships element describes the relationships in which
+entity beans with container-managed persistence participate. The
+relationships element contains an optional description; and a list of
+ejb-relation elements, which specify the container managed
+relationships.
+
+
+Used in: ejb-jar
+-->
+<!ELEMENT relationships (description?, ejb-relation+)>
+
+<!--
+The remote element contains the fully-qualified name of the enterprise
+bean's remote interface.
+
+Used in: ejb-ref, entity, session
+
+Example:
+
+<remote>com.wombat.empl.EmployeeService</remote>
+-->
+<!ELEMENT remote (#PCDATA)>
+
+<!--
+The res-auth element specifies whether the enterprise bean code signs
+on programmatically to the resource manager, or whether the Container
+will sign on to the resource manager on behalf of the enterprise bean. In the
+latter case, the Container uses information that is supplied by the
+Deployer.
+
+The value of this element must be one of the two following:
+
+	<res-auth>Application</res-auth>
+	<res-auth>Container</res-auth>
+
+Used in: resource-ref
+-->
+<!ELEMENT res-auth (#PCDATA)>
+
+<!--
+The res-ref-name element specifies the name of a resource manager
+connection factory reference.  The name is a JNDI name relative to the
+java:comp/env context.  The name must be unique within an enterprise bean.
+
+Used in: resource-ref
+-->
+<!ELEMENT res-ref-name (#PCDATA)>
+
+<!--
+The res-sharing-scope element specifies whether connections obtained
+through the given resource manager connection factory reference can be
+shared. The value of this element, if specified, must be one of the
+two following:
+
+	<res-sharing-scope>Shareable</res-sharing-scope>
+	<res-sharing-scope>Unshareable</res-sharing-scope>
+
+The default value is Shareable.
+
+Used in: resource-ref
+-->
+<!ELEMENT res-sharing-scope (#PCDATA)>
+
+<!--
+The res-type element specifies the type of the data source. The type
+is specified by the fully qualified Java language class or interface
+expected to be implemented by the data source.
+
+Used in: resource-ref
+-->
+<!ELEMENT res-type (#PCDATA)>
+
+<!--
+The resource-env-ref element contains a declaration of an enterprise bean's
+reference to an administered object associated with a resource
+in the enterprise bean's environment.  It consists of an optional
+description, the resource environment reference name, and an
+indication of the resource environment reference type expected by
+the enterprise bean code.
+
+Used in: entity, message-driven, session
+
+Example:
+
+<resource-env-ref>
+    <resource-env-ref-name>jms/StockQueue</resource-env-ref-name>
+    <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
+</resource-env-ref>
+-->
+<!ELEMENT resource-env-ref (description?, resource-env-ref-name,
+		resource-env-ref-type)>
+
+<!--
+The resource-env-ref-name element specifies the name of a resource
+environment reference; its value is the environment entry name used in
+the enterprise bean code.  The name is a JNDI name relative to the
+java:comp/env context and must be unique within an enterprise bean.
+
+Used in: resource-env-ref
+-->
+<!ELEMENT resource-env-ref-name (#PCDATA)>
+
+<!--
+The resource-env-ref-type element specifies the type of a resource
+environment reference.  It is the fully qualified name of a Java
+language class or interface.
+
+Used in: resource-env-ref
+-->
+<!ELEMENT resource-env-ref-type (#PCDATA)>
+
+<!--
+The resource-ref element contains a declaration of an enterprise bean's
+reference to an external resource. It consists of an optional
+description, the resource manager connection factory reference name,
+the indication of the resource manager connection factory type
+expected by the enterprise bean code, the type of authentication
+(Application or Container), and an optional specification of the
+shareability of connections obtained from the resource (Shareable or
+Unshareable).
+
+Used in: entity, message-driven, session
+
+Example:
+
+    <resource-ref>
+	<res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
+	<res-type>javax.sql.DataSource</res-type>
+	<res-auth>Container</res-auth>
+	<res-sharing-scope>Shareable</res-sharing-scope>
+    </resource-ref>
+-->
+<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth,
+		res-sharing-scope?)>
+
+<!--
+
+The result-type-mapping element is used in the query element to specify
+whether an abstract schema type returned by a query for a select method
+is to be mapped to an EJBLocalObject or EJBObject type.
+
+The result-type-mapping element must be one of the following:
+
+        <result-type-mapping>Local</result-type-mapping>
+        <result-type-mapping>Remote</result-type-mapping>
+
+Used in: query
+-->
+<!ELEMENT result-type-mapping (#PCDATA)>
+
+<!--
+The role-link element is a reference to a defined security role. The
+role-link element must contain the name of one of the security roles
+defined in the security-role elements.
+
+Used in: security-role-ref
+-->
+<!ELEMENT role-link (#PCDATA)>
+
+<!--
+The role-name element contains the name of a security role.
+
+The name must conform to the lexical rules for an NMTOKEN.
+
+Used in: method-permission, run-as, security-role, security-role-ref
+-->
+<!ELEMENT role-name (#PCDATA)>
+
+<!--
+The run-as element specifies the run-as identity to be used for the
+execution of the enterprise bean. It contains an optional description, and
+the name of a security role.
+
+Used in: security-identity
+-->
+<!ELEMENT run-as (description?, role-name)>
+
+<!--
+
+The security-identity element specifies whether the caller's
+security identity is to be used for the execution of the methods of
+the enterprise bean or whether a specific run-as identity is to be
+used. It contains an optional description and a specification of the
+security identity to be used.
+
+Used in: entity, message-driven, session
+-->
+<!ELEMENT security-identity (description?, (use-caller-identity|run-as))>
+
+<!--
+The security-role element contains the definition of a security
+role. The definition consists of an optional description of the
+security role, and the security role name.
+
+Used in: assembly-descriptor
+
+Example:
+
+    <security-role>
+	<description>
+	    This role includes all employees who are authorized
+	    to access the employee service application.
+	</description>
+	<role-name>employee</role-name>
+    </security-role>
+-->
+<!ELEMENT security-role (description?, role-name)>
+
+<!--
+The security-role-ref element contains the declaration of a security
+role reference in the enterprise bean's code. The declaration consists
+of an optional description, the security role name used in the code,
+and an optional link to a security role. If the security role is not
+specified, the Deployer must choose an appropriate security role.
+
+The value of the role-name element must be the String used as the
+parameter to the EJBContext.isCallerInRole(String roleName) method
+or the HttpServletRequest.isUserInRole(String role) method.
+
+Used in: entity, session
+
+-->
+<!ELEMENT security-role-ref (description?, role-name, role-link?)>
+
+<!--
+The session element declares an session bean. The declaration consists
+of:
+	- an optional description
+	- an optional display name
+	- an optional small icon file name
+	- an optional large icon file name
+	- a name assigned to the enterprise bean
+	  in the deployment description
+	- the names of the session bean's remote home and
+	  remote interfaces, if any
+	- the names of the session bean's local home and
+	  local interfaces, if any
+	- the session bean's implementation class
+	- the session bean's state management type
+	- the session bean's transaction management type
+	- an optional declaration of the bean's environment entries
+	- an optional declaration of the bean's EJB references
+	- an optional declaration of the bean's local EJB references
+	- an optional declaration of the security role references
+	- an optional declaration of the security identity to be
+          used for the execution of the bean's methods
+	- an optional declaration of the bean's resource manager
+	  connection factory references
+	- an optional declaration of the bean's resource environment
+	  references.
+
+The elements that are optional are "optional" in the sense that they
+are omitted when if lists represented by them are empty.
+
+Either both the local-home and the local elements or both the
+home and the remote elements must be specified for the session bean.
+
+Used in: enterprise-beans
+-->
+<!ELEMENT session (description?, display-name?, small-icon?,
+large-icon?, ejb-name, home?, remote?, local-home?, local?,
+ejb-class, session-type, transaction-type, env-entry*, ejb-ref*,
+ejb-local-ref*, security-role-ref*, security-identity?, resource-ref*,
+resource-env-ref*)>
+
+<!--
+The session-type element describes whether the session bean is a
+stateful session or stateless session.
+
+The session-type element must be one of the two following:
+
+	<session-type>Stateful</session-type>
+	<session-type>Stateless</session-type>
+-->
+<!ELEMENT session-type (#PCDATA)>
+
+<!--
+The small-icon element contains the name of a file
+containing a small (16 x 16) icon image. The file
+name is a relative path within the enterprise bean's
+ejb-jar file.
+
+The image may be either in the JPEG or GIF format.
+The icon can be used by tools.
+
+Used in: ejb-jar, entity, message-driven, session
+
+Example:
+
+<small-icon>employee-service-icon16x16.jpg</small-icon>
+-->
+<!ELEMENT small-icon (#PCDATA)>
+
+<!--
+The subscription-durability element specifies whether a JMS topic
+subscription is intended to be durable or nondurable.
+
+The subscription-durability element must be one of the two following:
+
+	<subscription-durability>Durable</subscription-durability>
+	<subscription-durability>NonDurable</subscription-durability>
+
+Used in: message-driven-destination
+-->
+<!ELEMENT subscription-durability (#PCDATA)>
+
+<!--
+The trans-attribute element specifies how the container must manage
+the transaction boundaries when delegating a method invocation to an
+enterprise bean's business method.
+
+The value of trans-attribute must be one of the following:
+
+
+	<trans-attribute>NotSupported</trans-attribute>
+	<trans-attribute>Supports</trans-attribute>
+	<trans-attribute>Required</trans-attribute>
+	<trans-attribute>RequiresNew</trans-attribute>
+	<trans-attribute>Mandatory</trans-attribute>
+	<trans-attribute>Never</trans-attribute>
+
+Used in: container-transaction
+-->
+<!ELEMENT trans-attribute (#PCDATA)>
+
+<!--
+The transaction-type element specifies an enterprise bean's
+transaction management type.
+
+The transaction-type element must be one of the two following:
+
+	<transaction-type>Bean</transaction-type>
+	<transaction-type>Container</transaction-type>
+
+Used in: message-driven, session
+-->
+<!ELEMENT transaction-type (#PCDATA)>
+
+<!--
+The unchecked element specifies that a method is not checked for authorization
+by the container prior to invocation of the method.
+
+Used in: method-permission
+-->
+<!ELEMENT unchecked EMPTY>
+
+<!--
+
+The use-caller-identity element specifies that the caller's security
+identity be used as the security identity for the execution of the
+enterprise bean's methods.
+
+Used in: security-identity
+-->
+<!ELEMENT use-caller-identity EMPTY>
+
+<!--
+The ID mechanism is to allow tools that produce additional deployment
+information (i.e., information beyond the standard deployment
+descriptor information) to store the non-standard information in a
+separate file, and easily refer from these tool-specific files to the
+information in the standard deployment descriptor.
+
+Tools are not allowed to add the non-standard information into the
+standard deployment descriptor.
+-->
+
+<!ATTLIST abstract-schema-name id ID #IMPLIED>
+<!ATTLIST acknowledge-mode id ID #IMPLIED>
+<!ATTLIST assembly-descriptor id ID #IMPLIED>
+<!ATTLIST cascade-delete id ID #IMPLIED>
+<!ATTLIST cmp-field id ID #IMPLIED>
+<!ATTLIST cmp-version id ID #IMPLIED>
+<!ATTLIST cmr-field id ID #IMPLIED>
+<!ATTLIST cmr-field-name id ID #IMPLIED>
+<!ATTLIST cmr-field-type id ID #IMPLIED>
+<!ATTLIST container-transaction id ID #IMPLIED>
+<!ATTLIST description id ID #IMPLIED>
+<!ATTLIST destination-type id ID #IMPLIED>
+<!ATTLIST display-name id ID #IMPLIED>
+<!ATTLIST ejb-class id ID #IMPLIED>
+<!ATTLIST ejb-client-jar id ID #IMPLIED>
+<!ATTLIST ejb-jar id ID #IMPLIED>
+<!ATTLIST ejb-link id ID #IMPLIED>
+<!ATTLIST ejb-local-ref id ID #IMPLIED>
+<!ATTLIST ejb-name id ID #IMPLIED>
+<!ATTLIST ejb-ql id ID #IMPLIED>
+<!ATTLIST ejb-ref id ID #IMPLIED>
+<!ATTLIST ejb-ref-name id ID #IMPLIED>
+<!ATTLIST ejb-ref-type id ID #IMPLIED>
+<!ATTLIST ejb-relation id ID #IMPLIED>
+<!ATTLIST ejb-relation-name id ID #IMPLIED>
+<!ATTLIST ejb-relationship-role id ID #IMPLIED>
+<!ATTLIST ejb-relationship-role-name id ID #IMPLIED>
+<!ATTLIST enterprise-beans id ID #IMPLIED>
+<!ATTLIST entity id ID #IMPLIED>
+<!ATTLIST env-entry id ID #IMPLIED>
+<!ATTLIST env-entry-name id ID #IMPLIED>
+<!ATTLIST env-entry-type id ID #IMPLIED>
+<!ATTLIST env-entry-value id ID #IMPLIED>
+<!ATTLIST exclude-list id ID #IMPLIED>
+<!ATTLIST field-name id ID #IMPLIED>
+<!ATTLIST home id ID #IMPLIED>
+<!ATTLIST large-icon id ID #IMPLIED>
+<!ATTLIST local id ID #IMPLIED>
+<!ATTLIST local-home id ID #IMPLIED>
+<!ATTLIST message-driven id ID #IMPLIED>
+<!ATTLIST message-driven-destination id ID #IMPLIED>
+<!ATTLIST message-selector id ID #IMPLIED>
+<!ATTLIST method id ID #IMPLIED>
+<!ATTLIST method-intf id ID #IMPLIED>
+<!ATTLIST method-name id ID #IMPLIED>
+<!ATTLIST method-param id ID #IMPLIED>
+<!ATTLIST method-params id ID #IMPLIED>
+<!ATTLIST method-permission id ID #IMPLIED>
+<!ATTLIST multiplicity id ID #IMPLIED>
+<!ATTLIST persistence-type id ID #IMPLIED>
+<!ATTLIST prim-key-class id ID #IMPLIED>
+<!ATTLIST primkey-field id ID #IMPLIED>
+<!ATTLIST query id ID #IMPLIED>
+<!ATTLIST query-method id ID #IMPLIED>
+<!ATTLIST reentrant id ID #IMPLIED>
+<!ATTLIST relationship-role-source id ID #IMPLIED>
+<!ATTLIST relationships id ID #IMPLIED>
+<!ATTLIST remote id ID #IMPLIED>
+<!ATTLIST res-auth id ID #IMPLIED>
+<!ATTLIST res-ref-name id ID #IMPLIED>
+<!ATTLIST res-sharing-scope id ID #IMPLIED>
+<!ATTLIST res-type id ID #IMPLIED>
+<!ATTLIST resource-env-ref id ID #IMPLIED>
+<!ATTLIST resource-env-ref-name id ID #IMPLIED>
+<!ATTLIST resource-env-ref-type id ID #IMPLIED>
+<!ATTLIST resource-ref id ID #IMPLIED>
+<!ATTLIST result-type-mapping id ID #IMPLIED>
+<!ATTLIST role-link id ID #IMPLIED>
+<!ATTLIST role-name id ID #IMPLIED>
+<!ATTLIST run-as id ID #IMPLIED>
+<!ATTLIST security-identity id ID #IMPLIED>
+<!ATTLIST security-role id ID #IMPLIED>
+<!ATTLIST security-role-ref id ID #IMPLIED>
+<!ATTLIST session id ID #IMPLIED>
+<!ATTLIST session-type id ID #IMPLIED>
+<!ATTLIST small-icon id ID #IMPLIED>
+<!ATTLIST subscription-durability id ID #IMPLIED>
+<!ATTLIST trans-attribute id ID #IMPLIED>
+<!ATTLIST transaction-type id ID #IMPLIED>
+<!ATTLIST unchecked id ID #IMPLIED>
+<!ATTLIST use-caller-identity id ID #IMPLIED>
diff --git a/xml/tests/testData/xml/entities.dtd b/xml/tests/testData/xml/entities.dtd
new file mode 100644
index 0000000..5273245
--- /dev/null
+++ b/xml/tests/testData/xml/entities.dtd
@@ -0,0 +1 @@
+<!ENTITY idgenerator    "identity">
\ No newline at end of file
diff --git a/xml/tests/testData/xml/fop.xsd b/xml/tests/testData/xml/fop.xsd
new file mode 100644
index 0000000..91cd0e2
--- /dev/null
+++ b/xml/tests/testData/xml/fop.xsd
@@ -0,0 +1,4312 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<!--
+  Copyright 1999-2005 The Apache Software Foundation
+
+  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.
+-->
+<!-- $Id: fop.xsd,v 1.4 2005/02/02 07:33:14 jeremias Exp $ -->
+<schema xmlns = "http://www.w3.org/2001/XMLSchema" targetNamespace = "http://www.w3.org/1999/XSL/Format"  xmlns:fo = "http://www.w3.org/1999/XSL/Format" xmlns:xs = "http://www.w3.org/2001/XMLSchema" elementFormDefault = "qualified">
+
+  <annotation>
+    <documentation>
+
+      I'm not sure where to place this.
+      It applies to the page context (NOT implemented)
+      <attribute name = "size"  type = "size_Type"/>
+
+      I have not coded for the functions described in 5.10 Core Function Library
+      They need to be segregated into groups and then inserted in the types
+
+      common_functions
+      object  inherited-property-value(NCName)
+      object  from-parent( NCName)
+      object  from-nearest-specified-value( NCName)
+      object  merge-property-values( NCName)
+
+      font_functions
+      object  system-font( NCName , NCName)
+
+      length_functions
+      numeric floor( numeric)
+      numeric ceiling(numeric)
+      numeric round(numeric)
+      numeric min( numeric , numeric)
+      numeric max(numeric , numeric)
+      numeric abs( numeric)
+
+      table_cell_or_descendants_functions
+      object  from-table-column( NCName)
+
+      color_functions
+      color rgb(numeric , numeric , numeric)
+      color rgb-icc(numeric , numeric , numeric , NCName , numeric , numeric)
+      color system-color( NCName)
+
+      label_functions
+      numeric body-start()
+      numeric label-end()
+
+      (defined)
+      table-column_functions
+      numeric proportional-column-width( numeric)
+
+      This schema has been developed in order to validate XSL FO documents for FOP
+      All of the elements need to be prefixed with fo:
+      The namespace prefix is xmlns:fo = "http://www.w3.org/1999/XSL/Format".
+
+      This schema, as delivered, may either validate the full spec, or, just the FOP portion.
+      (What it validates depends upon what I was doing with it when released.)
+
+      If you want to restrict it to just those elements and attributes implemented by FOP,
+      you need to edit the <group xmlns=""/> and <attributeGroup xmlns=""/> tags to exclude the groups ending with _Not
+
+      Some schema tools complain about the placement of comments in this schema and will remove or reorder them
+      There are fop_result and fop_fail comments on specific features not implemented by FOP
+
+      FOP does not enforce the following schema requirements
+
+      fo:simple-page-master model = "(region-body,region-before?,region-after?,region-start?,region-end?)"
+      elements can be in any order
+
+      fo:table-cell model = "(%block;)+"
+      Can be empty
+
+      fo:flow model = "(%block;)+"
+      Can be empty
+
+      This schema allows the length attribute to be negative for some elements like margins.
+      There may be instances where I've entered %integer_Type; and it should be positive-integer or number
+      The schema trys to handle the text based rules re: fo:markers, fo:float, footer and fo:initial-property-set
+      But, allows you to do illegal things if you want because I couldn't figure out how to constrain against the illegal actions.
+
+      Please e-mail your comments to [email protected]
+
+      Contribution by Oleg Tkachenko
+      (Declarations able to include non-xsl children)
+      <xs:any minOccurs = "0" maxOccurs = "unbounded" namespace = "##other" processContents = "skip"/>
+      This declaration assumes that all <fo:color-profile/> elements must come before other stuff,
+      which is not required by spec, but I cannot see any way to express such constraints in schema,
+      one could use <xs:choice/> instead of <xs:sequence/>, but this way we lose control over (color-profile)+ constraint.
+
+      VCP 21-Oct-2002
+        Updated all (px|pt|mm|cm|in|em) to (px|pt|mm|cm|in|em|%) to allow percentage types.
+        Updated the restriction base of those types from NMTOKEN to string
+
+    </documentation>
+  </annotation>
+
+  <group name = "initial_property_set_List_Not">
+    <choice>
+      <element ref = "fo:initial-property-set"/>
+    </choice>
+  </group>
+
+  <annotation>
+    <documentation>
+      empty group so cannot be defined
+      <group name = "initial_property_set_List_FOP">
+        <choice/>
+      </group>
+    </documentation>
+  </annotation>
+
+  <group name = "initial_property_set_List">
+    <annotation>
+      <documentation>
+        <choice>
+          <group ref = "fo:initial_property_set_List_FOP"/>
+        </choice>
+      </documentation>
+    </annotation>
+    <choice>
+      <group ref = "fo:initial_property_set_List_Not"/>
+    </choice>
+  </group>
+  <group name = "marker_List">
+    <choice>
+      <element ref = "fo:marker"/>
+    </choice>
+  </group>
+  <group name = "inline_List_FOP">
+    <choice>
+      <element ref = "fo:character"/>
+      <element ref = "fo:external-graphic"/>
+      <element ref = "fo:instream-foreign-object"/>
+      <element ref = "fo:inline"/>
+      <element ref = "fo:leader"/>
+      <element ref = "fo:page-number"/>
+      <element ref = "fo:page-number-citation"/>
+      <element ref = "fo:basic-link"/>
+    </choice>
+  </group>
+  <group name = "inline_List_Not">
+    <choice>
+      <element ref = "fo:bidi-override"/>
+      <element ref = "fo:inline-container"/>
+      <element ref = "fo:multi-toggle"/>
+    </choice>
+  </group>
+  <group name = "inline_List">
+    <choice>
+      <group ref = "fo:inline_List_FOP"/>
+      <group ref = "fo:inline_List_Not"/>
+    </choice>
+  </group>
+  <group name = "block_List_FOP">
+    <choice>
+      <element ref = "fo:block"/>
+      <element ref = "fo:block-container"/>
+      <element ref = "fo:table"/>
+      <element ref = "fo:list-block"/>
+    </choice>
+  </group>
+  <group name = "block_List_Not">
+    <choice>
+      <element ref = "fo:table-and-caption"/>
+    </choice>
+  </group>
+  <group name = "block_List">
+    <choice>
+      <group ref = "fo:block_List_FOP"/>
+      <group ref = "fo:block_List_Not"/>
+    </choice>
+  </group>
+  <group name = "neutral_List_FOP">
+    <choice>
+      <element ref = "fo:wrapper"/>
+      <element ref = "fo:retrieve-marker"/>
+    </choice>
+  </group>
+  <group name = "neutral_List_Not">
+    <choice>
+      <element ref = "fo:multi-switch"/>
+      <element ref = "fo:multi-properties"/>
+    </choice>
+  </group>
+  <group name = "neutral_List">
+    <choice>
+      <group ref = "fo:neutral_List_FOP"/>
+      <group ref = "fo:neutral_List_Not"/>
+    </choice>
+  </group>
+  <annotation>
+    <documentation>
+      empty group so cannot be defined
+      <group name = "float_List_FOP">
+        <choice/>
+      </group>
+    </documentation>
+  </annotation>
+  <group name = "float_List_Not">
+    <choice>
+      <element ref = "fo:float"/>
+    </choice>
+  </group>
+  <group name = "float_List">
+    <annotation>
+      <documentation>
+        empty group
+        <choice>
+          <group ref = "fo:float_List_FOP"/>
+        </choice>
+      </documentation>
+    </annotation>
+    <choice>
+      <group ref = "fo:float_List_Not"/>
+    </choice>
+  </group>
+  <group name = "footnote_List">
+    <choice>
+      <element ref = "fo:footnote"/>
+    </choice>
+  </group>
+
+  <attributeGroup name = "block_properties_Not">
+    <attribute name = "page-break-after"  type = "fo:page_break_after_Type"/>
+    <attribute name = "page-break-before" type = "fo:page_break_after_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "block_properties_FOP">
+  </attributeGroup>
+  <attributeGroup name = "block_properties">
+    <attributeGroup ref = "fo:block_properties_FOP"/>
+    <attributeGroup ref = "fo:block_properties_Not"/>
+  </attributeGroup>
+
+  <attributeGroup name = "list_properties_Not">
+    <attribute name = "page-break-after"  type = "fo:page_break_after_Type"/>
+    <attribute name = "page-break-before" type = "fo:page_break_after_Type"/>
+    <attribute name = "background-position" type = "fo:background_position_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "list_properties_FOP">
+  </attributeGroup>
+  <attributeGroup name = "list_properties">
+    <attributeGroup ref = "fo:list_properties_FOP"/>
+    <attributeGroup ref = "fo:list_properties_Not"/>
+  </attributeGroup>
+
+  <attributeGroup name = "inheritable_properties_List_Not">
+    <attribute name = "auto-restore" type = "fo:auto_restore_Type"/>
+    <attribute name = "background"    type = "fo:background_Type"   />
+    <attribute name = "border-spacing" type = "fo:length_Type"/>
+    <attribute name = "caption-side" type = "fo:caption_side_Type"/>
+    <attribute name = "direction" type = "fo:direction_Type"/>
+    <attribute name = "empty-cells" type = "fo:empty_cells_Type"/>
+    <attribute name = "font" type = "xs:string"/>
+    <attribute name = "font-selection-strategy" type = "fo:font_selection_strategy_Type"/>
+    <attribute name = "font-size-adjust" type = "fo:font_size_adjust_Type"/>
+    <attribute name = "font-stretch" type = "xs:string"/>
+    <attribute name = "font-variant" type = "fo:font_variant_Type"/>
+    <attribute name = "glyph-orientation-vertical" type = "fo:orientation_Type"/>
+    <attribute name = "glyph-orientation-horizontal" type = "fo:orientation_Type"/>
+    <attribute name = "hyphenation-keep" type = "fo:hyphenation_keep_Type"/>
+    <attribute name = "hyphenation-ladder-count" type = "fo:hyphenation_ladder_count_Type"/>
+    <attribute name = "intrusion-displace" type = "fo:displace_Type"/>
+    <attribute name = "last-line-end-indent" type = "fo:last_line_end_indent_Type"/>
+    <attribute name = "line-height-shift-adjustment" type = "fo:line_height_shift_adjustment_Type"/>
+    <attribute name = "line-stacking-strategy" type = "fo:line_stacking_strategy_Type"/>
+    <attribute name = "linefeed-treatment" type = "fo:linefeed_treatment_Type"/>
+    <attribute name = "margin"        type = "fo:border_margin_width_Type"       />
+    <attribute name = "max-width"     type = "fo:max_width_Type"/>
+    <attribute name = "min-height"    type = "fo:start_indent_Type"/>
+    <attribute name = "min-width"     type = "fo:start_indent_Type"/>
+    <attribute name = "page-break-inside" type = "fo:page_break_inside_Type"/>
+    <attribute name = "reference-orientation" type = "fo:orientation_Type"/>
+    <attribute name = "score-spaces" type = "fo:score_spaces_Type"/>
+    <attribute name = "script" type = "xs:string"/>
+    <attribute name = "text-transform" type = "fo:text_transform_Type"/>
+    <attribute name = "visibility" type = "fo:visibility_Type"/>
+    <attribute name = "white-space" type = "fo:white_space_Type"/>
+    <attribute name = "white-space-treatment" type = "fo:white_space_treatment_Type"/>
+    <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/>
+    <attribute name = "writing-mode" type = "fo:writing_mode_Type"/>
+  </attributeGroup>
+
+
+  <attributeGroup name = "inheritable_properties_List_FOP">
+    <annotation>
+      <documentation>
+        Removed because I'm not sure how to handle this<attribute xmlns="" name = "xml:lang" type = "xs:string"/>
+      </documentation>
+    </annotation>
+    <attribute name = "border-bottom" type = "fo:border_side_Type"/>
+    <attribute name = "border-collapse" type = "fo:border_collapse_Type"/>
+    <attribute name = "border-color"  type = "fo:border_color_Type" />
+    <attribute name = "border-left"   type = "fo:border_side_Type"  />
+    <attribute name = "border-right"  type = "fo:border_side_Type" />
+    <attribute name = "border-separation" type = "fo:length_bp_ip_direction_Type"/>
+    <attribute name = "border-style"  type = "fo:border_multi_style_Type" />
+    <attribute name = "border-top"    type = "fo:border_side_Type"   />
+    <attribute name = "border-width"  type = "fo:border_margin_width_Type" />
+    <attribute name = "color" type = "fo:color_Type"/>
+    <attribute name = "country" type = "fo:country_Type"/>
+    <attribute name = "display-align" type = "fo:display_align_Type"/>
+    <attribute name = "end-indent" type = "fo:end_indent_Type"/>
+    <attribute name = "font-family" type = "fo:family_name_Type"/>
+    <attribute name = "font-size" type = "fo:font_size_Type"/>
+    <attribute name = "font-style" type = "fo:font_style_Type"/>
+    <attribute name = "font-weight" type = "fo:font_weight_Type"/>
+    <attribute name = "hyphenate" type = "fo:hyphenate_Type"/>
+    <attribute name = "hyphenation-character" type = "fo:hyphenation_character_Type"/>
+    <attribute name = "hyphenation-push-character-count" type = "fo:integer_Type"/>
+    <attribute name = "hyphenation-remain-character-count" type = "fo:integer_Type"/>
+    <attribute name = "keep-together" type = "fo:keep_compound_Type"/>
+    <attribute name = "keep-together.within-column" type = "fo:keep_integer_Type"/>
+    <attribute name = "keep-together.within-line" type = "fo:keep_integer_Type"/>
+    <attribute name = "keep-together.within-page" type = "fo:keep_integer_Type"/>
+    <attribute name = "language" type = "fo:language_Type"/>
+    <attribute name = "leader-alignment" type = "fo:leader_alignment_Type"/>
+    <attribute name = "leader-length" type = "fo:leader_length_Type"/>
+    <attribute name = "leader-length.maximum" type = "fo:length_Type"/>
+    <attribute name = "leader-length.minimum" type = "fo:length_Type"/>
+    <attribute name = "leader-length.optimum" type = "fo:length_Type"/>
+    <attribute name = "leader-pattern" type = "fo:leader_pattern_Type"/>
+    <attribute name = "leader-pattern-width" type = "fo:leader_pattern_width_Type"/>
+    <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/>
+    <attribute name = "line-height" type = "fo:line_height_Type"/>
+    <attribute name = "orphans" type = "fo:orphans_Type"/>
+    <attribute name = "position" type = "fo:position_Type"/>
+    <attribute name = "provisional-distance-between-starts" type = "fo:provisional_distance_between_starts_Type"/>
+    <attribute name = "provisional-label-separation" type = "fo:provisional_label_separation_Type"/>
+    <attribute name = "relative-align" type = "fo:relative_align_Type"/>
+    <attribute name = "rule-style" type = "fo:rule_style_Type"/>
+    <attribute name = "rule-thickness" type = "fo:length_Type"/>
+    <attribute name = "start-indent" type = "fo:start_indent_Type"/>
+    <attribute name = "text-align" type = "fo:text_align_Type"/>
+    <attribute name = "text-align-last" type = "fo:text_align_last_Type"/>
+    <attribute name = "text-indent" type = "fo:length_percentage_Type"/>
+    <attribute name = "white-space-collapse" type = "fo:white_space_collapse_Type"/>
+    <attribute name = "widows" type = "fo:widows_Type"/>
+    <attribute name = "wrap-option" type = "fo:wrap_option_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "inheritable_properties_List">
+    <attributeGroup ref = "fo:inheritable_properties_List_FOP"/>
+    <attributeGroup ref = "fo:inheritable_properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "break_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Inheritable
+        <attribute name = "page-break-inside" type = "fo:breaks_Type"/>
+      </documentation>
+    </annotation>
+  </attributeGroup>
+  <attributeGroup name = "break_Properties_List_FOP">
+    <attribute name = "break-after" type = "fo:breaks_Type"/>
+    <attribute name = "break-before" type = "fo:breaks_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "break_Properties_List">
+    <attributeGroup ref = "fo:break_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:break_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "text_one_Properties_List_FOP"/>
+  <attributeGroup name = "text_one_Properties_List_Not">
+    <attribute name = "text-depth" type = "fo:text_depth_Type"/>
+    <attribute name = "text-altitude" type = "fo:text_altitude_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "text_one_Properties_List">
+    <attributeGroup ref = "fo:text_one_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:text_one_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "line_height_Properties_List_FOP"/>
+  <attributeGroup name = "line_height_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Inheritable
+        <attribute name = "line-height-shift-adjustment" type = "fo:line_height_shift_adjustment_Type"/>
+        <attribute name = "line-stacking-strategy" type = "fo:line_stacking_strategy_Type"/>
+      </documentation>
+    </annotation>
+  </attributeGroup>
+  <attributeGroup name = "line_height_Properties_List">
+    <attributeGroup ref = "fo:line_height_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:line_height_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "keep_Properties_List_FOP">
+    <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "keep_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Inheritable
+        <attribute name = "keep-together" type = "fo:keep_compound_Type"/>
+        <attribute name = "keep-together.within-line" type = "fo:keep_integer_Type"/>
+        <attribute name = "keep-together.within-column" type = "fo:keep_integer_Type"/>
+        <attribute name = "keep-together.within-page" type = "fo:keep_integer_Type"/>
+      </documentation>
+    </annotation>
+    <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "keep_Properties_List">
+    <attributeGroup ref = "fo:keep_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:keep_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "block_hyphenation_Properties_List_FOP"/>
+  <attributeGroup name = "block_hyphenation_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Inheritable
+        <attribute name = "hyphenation-keep" type = "fo:hyphenation_keep_Type"/>
+        <attribute name = "hyphenation-ladder-count" type = "fo:hyphenation_ladder_count_Type"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "block_hyphenation_Properties_List">
+    <attributeGroup ref = "fo:block_hyphenation_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:block_hyphenation_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "intrusion_displace_Properties_List_FOP"/>
+  <attributeGroup name = "intrusion_displace_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Inheritable attributes
+        <attribute name = "intrusion-displace" type = "fo:displace_Type"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "intrusion_displace_Properties_List">
+    <attributeGroup ref = "fo:intrusion_displace_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:intrusion_displace_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "progression_Properties_List_FOP"/>
+  <attributeGroup name = "progression_Properties_List_Not">
+    <attribute name = "block-progression-dimension" type = "fo:margin_width_Type"/>
+    <attribute name = "block-progression-dimension.minimum" type = "fo:length_Type"/>
+    <attribute name = "block-progression-dimension.optimum" type = "fo:block_progression_dimension_optimum_Type"/>
+    <attribute name = "block-progression-dimension.maximum" type = "fo:block_progression_dimension_maximum_Type"/>
+    <attribute name = "inline-progression-dimension" type = "fo:margin_width_Type"/>
+    <attribute name = "inline-progression-dimension.minimum" type = "fo:length_Type"/>
+    <attribute name = "inline-progression-dimension.optimum" type = "fo:block_progression_dimension_optimum_Type"/>
+    <attribute name = "inline-progression-dimension.maximum" type = "fo:block_progression_dimension_maximum_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "progression_Properties_List">
+    <attributeGroup ref = "fo:progression_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:progression_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "clip_Properties_List_FOP"/>
+  <attributeGroup name = "clip_Properties_List_Not">
+    <attribute name = "clip" type = "fo:clip_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "clip_Properties_List">
+    <attributeGroup ref = "fo:clip_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:clip_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "reference_Properties_List_FOP"/>
+  <attributeGroup name = "reference_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Inherited
+        <attribute name = "reference-orientation" type = "fo:orientation_Type"/>
+        <attribute name = "writing-mode" type = "fo:writing_mode_Type"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "reference_Properties_List">
+    <attributeGroup ref = "fo:reference_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:reference_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Accessibility_Properties_List_FOP"/>
+  <attributeGroup name = "Accessibility_Properties_List_Not">
+    <attribute name = "source-document" type = "xs:string"/>
+    <attribute name = "role" type = "xs:string"/>
+  </attributeGroup>
+  <attributeGroup name = "Accessibility_Properties_List">
+    <attributeGroup ref = "fo:Accessibility_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Accessibility_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Relative_Position_Properties_List_FOP">
+    <annotation>
+      <documentation>
+        Inherited
+        <attribute name = "position" type = "fo:position_Type"/>
+      </documentation>
+    </annotation>
+    <attribute name = "top" type = "fo:top_Type"/>
+    <attribute name = "right" type = "fo:right_Type"/>
+    <attribute name = "bottom" type = "fo:bottom_Type"/>
+    <attribute name = "left" type = "fo:left_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Relative_Position_Properties_List_Not">
+    <attribute name = "relative-position" type = "fo:relative_position_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Relative_Position_Properties_List">
+    <attributeGroup ref = "fo:Relative_Position_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Relative_Position_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "absolute_or_Relative_Position_Properties_List_FOP">
+    <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+  </attributeGroup>
+  <attributeGroup name = "absolute_or_Relative_Position_Properties_List_Not">
+    <attribute name = "absolute-position" type = "fo:absolute_position_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "absolute_or_Relative_Position_Properties_List">
+    <attributeGroup ref = "fo:absolute_or_Relative_Position_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:absolute_or_Relative_Position_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Aural_Properties_List_FOP"/>
+  <attributeGroup name = "Aural_Properties_List_Not">
+    <attribute name = "azimuth" type = "fo:azimuth_Type"/>
+    <attribute name = "cue" type = "xs:string"/>
+    <attribute name = "cue-after" type = "xs:string"/>
+    <attribute name = "cue-before" type = "xs:string"/>
+    <attribute name = "elevation" type = "fo:elevation_Type"/>
+    <attribute name = "pause" type = "xs:string"/>
+    <attribute name = "pause-after" type = "xs:string"/>
+    <attribute name = "pause-before" type = "xs:string"/>
+    <attribute name = "pitch" type = "xs:string"/>
+    <attribute name = "pitch-range" type = "xs:string"/>
+    <attribute name = "play-during" type = "xs:string"/>
+    <attribute name = "richness" type = "xs:string"/>
+    <attribute name = "speak" type = "xs:string"/>
+    <attribute name = "speak-header" type = "xs:string"/>
+    <attribute name = "speak-numeral" type = "fo:speak_numeral_Type"/>
+    <attribute name = "speak-punctuation" type = "xs:string"/>
+    <attribute name = "speech-rate" type = "fo:speech_rate_Type"/>
+    <attribute name = "stress" type = "xs:string"/>
+    <attribute name = "voice-family" type = "xs:string"/>
+    <attribute name = "volume" type = "xs:string"/>
+  </attributeGroup>
+  <attributeGroup name = "Aural_Properties_List">
+    <attributeGroup ref = "fo:Aural_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Aural_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Border_Padding_and_Background_Properties_List">
+    <attributeGroup ref = "fo:Border_Properties_List"/>
+    <attributeGroup ref = "fo:Padding_Properties_List"/>
+    <attributeGroup ref = "fo:Background_Properties_List"/>
+  </attributeGroup>
+  <attributeGroup name = "Absolute_Position_Properties_List_FOP">
+    <annotation>
+      <documentation>
+        Inherited
+        <attribute name = "position" type = "fo:position_Type"/>
+      </documentation>
+    </annotation>
+    <attribute name = "top" type = "fo:top_Type"/>
+    <attribute name = "right" type = "fo:right_Type"/>
+    <attribute name = "bottom" type = "fo:bottom_Type"/>
+    <attribute name = "left" type = "fo:left_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Absolute_Position_Properties_List_Not">
+    <attribute name = "absolute-position" type = "fo:absolute_position_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Absolute_Position_Properties_List">
+    <attributeGroup ref = "fo:Absolute_Position_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Absolute_Position_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Background_Properties_List_FOP">
+    <attribute name = "background-color" type = "fo:background_color_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Background_Properties_List_Not">
+    <attribute name = "background-attachment" type = "fo:background_attachment_Type"/>
+    <attribute name = "background-image" type = "xs:string"/>
+    <attribute name = "background-repeat" type = "fo:background_repeat_Type"/>
+    <attribute name = "background-position-horizontal" type = "fo:background_position_horizontal_Type"/>
+    <attribute name = "background-position-vertical" type = "fo:background_position_vertical_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Background_Properties_List">
+    <attributeGroup ref = "fo:Background_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Background_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Border_Properties_List">
+    <attribute name = "border" type = "fo:border_Type"/>
+    <attribute name = "border-before-color" type = "fo:color_Type"/>
+    <attribute name = "border-before-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-before-width" type = "fo:border_before_width_Type"/>
+    <attribute name = "border-before-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-before-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-after-color" type = "fo:color_Type"/>
+    <attribute name = "border-after-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-after-width" type = "fo:border_before_width_Type"/>
+    <attribute name = "border-after-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-after-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-start-color" type = "fo:color_Type"/>
+    <attribute name = "border-start-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-start-width" type = "fo:border_before_width_Type"/>
+    <attribute name = "border-start-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-start-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-end-color" type = "fo:color_Type"/>
+    <attribute name = "border-end-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-end-width" type = "fo:border_before_width_Type"/>
+    <attribute name = "border-end-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-end-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-top-color" type = "fo:color_Type"/>
+    <attribute name = "border-top-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-top-width" type = "fo:border_top_width_Type"/>
+    <attribute name = "border-top-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-top-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-bottom-color" type = "fo:color_Type"/>
+    <attribute name = "border-bottom-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-bottom-width" type = "fo:border_top_width_Type"/>
+    <attribute name = "border-bottom-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-bottom-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-left-color" type = "fo:color_Type"/>
+    <attribute name = "border-left-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-left-width" type = "fo:border_top_width_Type"/>
+    <attribute name = "border-left-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-left-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-right-color" type = "fo:color_Type"/>
+    <attribute name = "border-right-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-right-width" type = "fo:border_top_width_Type"/>
+    <attribute name = "border-right-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-right-width.conditionality" type = "fo:conditionality_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Padding_Properties_List">
+    <attribute name = "padding" type = "fo:padding_before_Type"/>
+    <attribute name = "padding-before" type = "fo:padding_before_Type"/>
+    <attribute name = "padding-before.length" type = "fo:length_Type"/>
+    <attribute name = "padding-before.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-after" type = "fo:padding_before_Type"/>
+    <attribute name = "padding-after.length" type = "fo:length_Type"/>
+    <attribute name = "padding-after.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-start" type = "fo:padding_before_Type"/>
+    <attribute name = "padding-start.length" type = "fo:length_Type"/>
+    <attribute name = "padding-start.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-end" type = "fo:padding_before_Type"/>
+    <attribute name = "padding-end.length" type = "fo:length_Type"/>
+    <attribute name = "padding-end.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-top" type = "fo:padding_top_Type"/>
+    <attribute name = "padding-top.length" type = "fo:length_Type"/>
+    <attribute name = "padding-top.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-bottom" type = "fo:padding_top_Type"/>
+    <attribute name = "padding-bottom.length" type = "fo:length_Type"/>
+    <attribute name = "padding-bottom.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-left" type = "fo:padding_top_Type"/>
+    <attribute name = "padding-left.length" type = "fo:length_Type"/>
+    <attribute name = "padding-left.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-right" type = "fo:padding_top_Type"/>
+    <attribute name = "padding-right.length" type = "fo:length_Type"/>
+    <attribute name = "padding-right.conditionality" type = "fo:conditionality_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Font_Properties_List_FOP">
+    <annotation>
+      <documentation>
+        Font properties are all inheritable
+        <attribute name = "font-family" type = "fo:family_name_Type"/>
+        <attribute name = "font-size" type = "fo:font_size_Type"/>
+        <attribute name = "font-style" type = "fo:font_style_Type"/>
+        <attribute name = "font-weight" type = "fo:font_weight_Type"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "Font_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Font properties are all inheritable
+        <attribute name = "font" type = "xs:string"/>
+        <attribute name = "font-selection-strategy" type = "fo:font_selection_strategy_Type"/>
+        <attribute name = "font-size-adjust" type = "xs:string"/>
+        <attribute name = "font-stretch" type = "xs:string"/>
+        <attribute name = "font-variant" type = "fo:font_variant_Type"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "Font_Properties_List">
+    <attributeGroup ref = "fo:Font_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Font_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Hyphenation_Properties_List_FOP">
+    <annotation>
+      <documentation>
+        The hyphenation properties are all inheritable and so superceeded by that list
+        <attribute name = "country" type = "fo:country_Type"/>
+        <attribute name = "language" type = "fo:language_Type"/>
+        <attribute name = "hyphenate" type = "fo:hyphenate_Type"/>
+        <attribute name = "hyphenation-character" type = "fo:hyphenation_character_Type"/>
+        <attribute name = "hyphenation-push-character-count" type = "fo:integer_Type"/>
+        <attribute name = "hyphenation-remain-character-count" type = "fo:integer_Type"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "Hyphenation_Properties_List_Not">
+    <annotation>
+      <documentation>
+        The hyphenation properties are all inheritable and so superceeded by that list
+        <attribute name = "script" type = "xs:string"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "Hyphenation_Properties_List">
+    <attributeGroup ref = "fo:Hyphenation_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Hyphenation_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_Basic_List">
+    <attribute name = "margin-top" type = "fo:margin_width_Type"/>
+    <attribute name = "margin-bottom" type = "fo:margin_width_Type"/>
+    <attribute name = "margin-left" type = "fo:margin_width_Type"/>
+    <attribute name = "margin-right" type = "fo:margin_width_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_vertical_Space_List_FOP">
+    <annotation>
+      <documentation>
+        Indent properties are inheritable
+        <attribute name = "start-indent" type = "fo:start_indent_Type"/>
+        <attribute name = "end-indent" type = "fo:end_indent_Type"/>
+      </documentation>
+    </annotation>
+    <attribute name = "space-before.optimum" type = "fo:space_before_optimum_Type"/>
+    <attribute name = "space-after.optimum" type = "fo:space_after_optimum_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_vertical_Space_List_Not">
+    <attribute name = "space-before" type = "fo:space_Type"/>
+    <attribute name = "space-before.minimum" type = "fo:length_Type"/>
+    <attribute name = "space-before.maximum" type = "fo:length_Type"/>
+    <attribute name = "space-before.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "space-before.precedence" type = "fo:integer_Force_Type"/>
+    <attribute name = "space-after" type = "fo:space_Type"/>
+    <attribute name = "space-after.minimum" type = "fo:length_Type"/>
+    <attribute name = "space-after.maximum" type = "fo:length_Type"/>
+    <attribute name = "space-after.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "space-after.precedence" type = "fo:integer_Force_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_vertical_Space_List">
+    <attributeGroup ref = "fo:Margin_Properties_vertical_Space_List_FOP"/>
+    <attributeGroup ref = "fo:Margin_Properties_vertical_Space_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_Block_List">
+    <attributeGroup ref = "fo:Margin_Properties_Basic_List"/>
+    <attributeGroup ref = "fo:Margin_Properties_vertical_Space_List"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_Inline_List">
+    <attributeGroup ref = "fo:Margin_Properties_Basic_List"/>
+    <attributeGroup ref = "fo:Margin_Properties_Horizontal_Space_List"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_Horizontal_Space_List_FOP"/>
+  <attributeGroup name = "Margin_Properties_Horizontal_Space_List_Not">
+    <attribute name = "space-start" type = "fo:space_start_Type"/>
+    <attribute name = "space-start.minimum" type = "fo:length_Type"/>
+    <attribute name = "space-start.optimum" type = "fo:length_Type"/>
+    <attribute name = "space-start.maximum" type = "fo:length_Type"/>
+    <attribute name = "space-start.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "space-start.precedence" type = "fo:integer_Force_Type"/>
+    <attribute name = "space-end" type = "fo:space_start_Type"/>
+    <attribute name = "space-end.minimum" type = "fo:length_Type"/>
+    <attribute name = "space-end.optimum" type = "fo:length_Type"/>
+    <attribute name = "space-end.maximum" type = "fo:length_Type"/>
+    <attribute name = "space-end.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "space-end.precedence" type = "fo:integer_Force_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_Horizontal_Space_List">
+    <attributeGroup ref = "fo:Margin_Properties_Horizontal_Space_List_FOP"/>
+    <attributeGroup ref = "fo:Margin_Properties_Horizontal_Space_List_Not"/>
+  </attributeGroup>
+
+  <annotation>
+    <documentation>
+      Simple Types definitions
+    </documentation>
+  </annotation>
+  <simpleType name = "integer_Type">
+    <annotation>
+      <documentation>
+        A signed integer value which consists of an optional '+' or '-' character followed by a sequence of digits. A property may define additional constraints on the value.
+        <enumeration value = "-3"/>
+        <enumeration value = "0"/>
+        <enumeration value = "1"/>
+        <enumeration value = "+3"/>
+        <enumeration value = "5"/>
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <pattern value = "[\+\-]?\d+"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "number_Type">
+    <annotation>
+      <documentation>
+        A signed real number which consists of an optional '+' or '-' character followed by a sequence of digits followed by an optional '.' character and sequence of digits. A property may define additional constraints on the value.
+        <enumeration value = "-2.4"/>
+        <enumeration value = "2"/>
+        <enumeration value = "4"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "[\+\-]?\d+\.\d*"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "length_Type">
+    <annotation>
+      <documentation>
+        A signed length value where a 'length' is a real number plus a unit qualification. A property may define additional constraints on the value.
+        <enumeration value = "1px"/>
+        <enumeration value = "1pt"/>
+        <enumeration value = "1mm"/>
+        <enumeration value = "1cm"/>
+        <enumeration value = "1in"/>
+        <enumeration value = "1em"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "[\+\-]?\d+\.?\d*(px|pt|mm|cm|in|em|%)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "length_range_Type">
+    <annotation>
+      <documentation>
+        A compound datatype, with components: minimum, optimum, maximum. Each component is a <length xmlns=""/>. If "minimum" is greater than optimum, it will be treated as if it had been set to "optimum". If "maximum" is less than optimum, it will be treated as if it had been set to "optimum". A property may define additional constraints on the values.
+        <enumeration value = "1mm 2mm 3mm"/>
+        <enumeration value = "2mm 2mm 1mm"/>
+        <enumeration value = "3mm 2mm 1mm"/>
+      </documentation>
+    </annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:length_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "3" />
+      <xs:maxLength value = "3" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "length_conditional_Type">
+    <annotation>
+      <documentation>
+        A compound datatype, with components: length, conditionality. The length component is a <length xmlns=""/>. The conditionality component is either "discard" or "retain". A property may define additional constraints on the values.
+        <enumeration value = "1mm retain"/>
+        <enumeration value = "1mm discard"/>
+        <enumeration value = "1px retain"/>
+        <enumeration value = "1px discard"/>
+        <enumeration value = "1pt retain"/>
+        <enumeration value = "1pt discard"/>
+        <enumeration value = "1mm retain"/>
+        <enumeration value = "1mm discard"/>
+        <enumeration value = "1cm retain"/>
+        <enumeration value = "1cm discard"/>
+        <enumeration value = "1in retain"/>
+        <enumeration value = "1in discard"/>
+        <enumeration value = "1em retain"/>
+        <enumeration value = "1em discard"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "\+?\d+\.?\d*(px|pt|mm|cm|in|em|%) (retain|discard)"/>
+    </restriction>
+  </simpleType>
+  <xs:simpleType name = "length_bp_ip_direction_Type">
+    <annotation>
+      <documentation>
+        A compound datatype, with components: block-progression-direction, and inline-progression-direction. Each component is a <length xmlns=""/>. A property may define additional constraints on the values.
+        <enumeration value = "1mm 2mm"/>
+        <enumeration value = "2mm"/>
+        <enumeration value = "3mm 2mm"/>
+      </documentation>
+    </annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:length_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "2" />
+    </xs:restriction>
+  </xs:simpleType>
+  <simpleType name = "space_Type">
+    <annotation>
+      <documentation>
+        A compound datatype, with components: minimum, optimum, maximum, precedence, and conditionality. The minimum, optimum, and maximum components are <length xmlns=""/>s. The precedence component is either "force" or an <integer/>. The conditionality component is either "discard" or "retain". If "minimum" is greater than optimum, it will be treated as if it had been set to "optimum". If "maximum" is less than optimum, it will be treated as if it had been set to "optimum".
+        <enumeration value = "1mm 2mm 3mm force retain"/>
+        <enumeration value = "1mm 2mm 3mm force discard"/>
+        <enumeration value = "1mm 2mm 3mm 3 retain"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "([ ]?\+?\d+\.?\d*(px|pt|mm|cm|in|em|%)){1,3}( \+?\d+| force)?( retain| discard)?"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "angle_Type">
+    <annotation>
+      <documentation>
+        A representation of an angle consisting of an optional '+' or  '-' character immediately followed by a <number/> immediately followed by an angle unit identifier. Angle unit identifiers are: 'deg' (for degrees), 'grad' (for grads), and 'rad' (for radians). The specified values are normalized to the range 0deg to 360deg. A property may define additional constraints on the value.
+        <enumeration value = "3deg"/>
+        <enumeration value = "45deg"/>
+        <enumeration value = "-12deg"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "[\+\-]?[1-3]?\d?\d?\.?\d*(deg|grad|rad)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "percentage_Type">
+    <annotation>
+      <documentation>
+        A signed real percentage which consists of an optional '+' or '-' character followed by a sequence of digits followed by an optional '.' character and sequence of digits followed by '%'. A property may define additional constraints on the value.
+        <enumeration value = "10%"/>
+        <enumeration value = "30%"/>
+        <enumeration value = "100%"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "[\+\-]?\d+\.?\d*%"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "character_Type">
+    <annotation>
+      <documentation>
+        <enumeration value = "-"/>
+        <enumeration value = "h"/>
+        <enumeration value = "e"/>
+        <enumeration value = "l"/>
+        <enumeration value = "p"/>
+        <enumeration value = "o"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "."/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "name_Type">
+    <annotation>
+      <documentation>
+        A string of characters representing a name. It must conform to the definition of an NCName in
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = ".*"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "family_name_Type">
+    <annotation>
+      <documentation>
+        A string of characters identifying a font.
+        <enumeration value = "serif"/>
+        <enumeration value = "sans-serif"/>
+        <enumeration value = "Arial"/>
+        <enumeration value = "Times"/>
+        <enumeration value = "Courier"/>
+        <enumeration value = "Zapf Dingbats"/>
+        <enumeration value = "code39"/>
+        <enumeration value = "cyberbit"/>
+        <enumeration value = "Edwardian Script ITC"/>
+        <enumeration value = "Viner Hand ITC"/>
+        <enumeration value = "Georgia"/>
+        <enumeration value = "Bookman Old Style"/>
+        <enumeration value = "Book Antiqua"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = ".*"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "color_Type">
+    <annotation>
+      <documentation>
+        Either a string of characters representing a keyword or a color function defined in . The list of keyword color names is: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow.
+        <enumeration value = "red"/>
+        <enumeration value = "blue"/>
+        <enumeration value = "yellow"/>
+        <enumeration value = "green"/>
+      </documentation>
+    </annotation>
+    <union memberTypes = "fo:color_Hex_Type fo:color_Name_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "proportional_column_width_Type">
+    <annotation>
+      <documentation>
+        The function proportional-column-width(N[0])
+        This returns a width as a fraction of the available width as ( N[0] / sum1 ) * available space
+        The parent table must have width="x" and table-layout="fixed"
+        <enumeration value = "proportional-column-width(Number)"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "proportional-column-width\(\d+\)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "column_width_Type">
+    <annotation>
+      <documentation>
+        <length xmlns=""/>, <percentage/>, <function>proportional-column-width</function>, or <function>common-functions</function>
+        <enumeration value = "20mm"/>
+        <enumeration value = "15%"/>
+      </documentation>
+    </annotation>
+    <union memberTypes = "fo:length_percentage_Type fo:proportional_column_width_Type"/>
+  </simpleType>
+  <annotation>
+    <documentation>
+      <script/> A string of characters conforming to an ISO 15924 script code.
+    </documentation>
+  </annotation>
+  <annotation>
+    <documentation>
+      <id/>     A string of characters conforming to the definition of an NCName in and is unique within the stylesheet.
+    </documentation>
+  </annotation>
+  <annotation>
+    <documentation>
+      <idRef/>  A string of characters conforming to the definition of an NCName in and that matches an ID property value used within the stylesheet.
+    </documentation>
+  </annotation>
+  <annotation>
+    <documentation>
+      <uri-specification/> A sequence of characters that is "url(", followed by optional white space, followed by an optional single quote (') or double quote (") character, followed by a URI reference as defined in , followed by an optional single quote (') or double quote (") character, followed by optional white space, followed by ")". The two quote characters must be the same and must both be present or absent. If the URI reference contains a single quote, the two quote characters must be present and be double quotes.
+    </documentation>
+  </annotation>
+  <annotation>
+    <documentation>
+      <time/>   A <number/> immediately followed by a time unit identifier. Time unit identifiers are: 'ms' (for milliseconds) and 's' (for seconds).
+    </documentation>
+  </annotation>
+  <annotation>
+    <documentation>
+      <frequency/> A <number/> immediately followed by a frequency unit identifier. Frequency unit identifiers are: 'Hz' (for Hertz) and 'kHz' (for kilo Hertz).
+    </documentation>
+  </annotation>
+  <annotation>
+    <documentation>
+      <generic-family/> The following generic families are defined: "serif", "sans-serif", "cursive", "fantasy", and "monospace". Please see the section on generic font families for descriptions of these families. Generic font family names are keywords, and therefore must not be quoted.
+    </documentation>
+  </annotation>
+  <simpleType name = "absolute_size_Type">
+    <annotation>
+      <documentation>
+        An <absolute-size/> keyword refers to an entry in a table of font sizes computed and kept by the user agent. Possible values are: [ xx-small | x-small | small | medium | large | x-large | xx-large ] On a computer screen a scaling factor of 1.2 is suggested between adjacent indexes; if the "medium" font is 12pt, the "large" font could be 14.4pt. Different media may need different scaling factors. Also, the user agent should take the quality and availability of fonts into account when computing the table. The table may be different from one font family to another. Note. In CSS1, the suggested scaling factor between adjacent indexes was 1.5 which user experience proved to be too large.
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "xx-small"/>
+      <enumeration value = "x-small"/>
+      <enumeration value = "small"/>
+      <enumeration value = "medium"/>
+      <enumeration value = "large"/>
+      <enumeration value = "x-large"/>
+      <enumeration value = "xx-large"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "relative_size_Type">
+    <annotation>
+      <documentation>
+        A <relative-size/> keyword is interpreted relative to the table of font sizes and the font size of the parent element. Possible values are: [ larger | smaller ] For example, if the parent element has a font size of "medium", a value of "larger" will make the font size of the current element be "large". If the parent element's size is not close to a table entry, the user agent is free to interpolate between table entries or round off to the closest one. The user agent may have to extrapolate table values if the numerical value goes beyond the keywords.
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "larger"/>
+      <enumeration value = "smaller"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "clip_Type">
+    <annotation>
+      <documentation>
+        shape_Type In CSS2, the only valid <shape/> value is: rect (<top/>, <right/>, <bottom/>, <left/>) where <top/>, <bottom/> <right/>, and <left/> specify offsets from the respective sides of the box. <top/>, <right/>, <bottom/>, and <left/> may either have a <length xmlns=""/> value or "auto". Negative lengths are permitted. The value "auto" means that a given edge of the clipping region will be the same as the edge of the element's generated box (i.e., "auto" means the same as "0".) When coordinates are rounded to pixel coordinates, care should be taken that no pixels remain visible when <left/> + <right/> is equal to the element's width (or <top/> + <bottom/> equals the element's height), and conversely that no pixels remain hidden when these values are 0.
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <annotation>
+        <documentation>
+          length_Type{1,2}
+        </documentation>
+      </annotation>
+      <pattern value = "(rect\((\+?\d+\.?\d*(px|pt|mm|cm|in|em|%)|auto),(\+?\d+\.?\d*(px|pt|mm|cm|in|em|%)|auto),(\+?\d+\.?\d*(px|pt|mm|cm|in|em|%)|auto),(\+?\d+\.?\d*(px|pt|mm|cm|in|em|%)|auto)\)|auto|inherit)"/>
+    </restriction>
+  </simpleType>
+
+  <simpleType name = "border_side_Type">
+    <annotation>
+      <documentation>
+        "fo:width_Type fo:border_style_Type fo:color_Type"
+        <enumeration value="thin solid red"/>
+        <enumeration value="medium solid black"/>
+        <enumeration value="thick solid blue"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "(thin|medium|thick) (none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset) ([a-z]{3,16}|#[0-9A-F]{6})"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "border_margin_width_Type">
+    <annotation>
+      <documentation>
+        "fo:width_Type{1,4} fo:inherit_Type"
+        <enumeration value = "none"/>
+        <enumeration value = "thin"/>
+        <enumeration value = "medium"/>
+        <enumeration value = "thick"/>
+        <enumeration value = "thick thin medium none"/>
+      </documentation>
+    </annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <union memberTypes = "fo:width_Type fo:positive_length_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "4" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "border_multi_style_Type" >
+    <annotation>
+      <documentation>
+        "fo:border_style_Type{1,4} fo:inherit_Type"
+        <enumeration value = "none"/>
+        <enumeration value = "hidden"/>
+        <enumeration value = "dotted"/>
+        <enumeration value = "dashed"/>
+        <enumeration value = "solid"/>
+        <enumeration value = "double"/>
+        <enumeration value = "groove"/>
+        <enumeration value = "ridge"/>
+        <enumeration value = "inset"/>
+        <enumeration value = "outset"/>
+        <enumeration value = "solid dashed ridge groove"/>
+      </documentation>
+    </annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:border_style_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "4" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "border_color_Type" >
+    <annotation>
+      <documentation>
+        "fo:background_color_Type{1,4}"
+        <enumeration value="red"/>
+        <enumeration value="green"/>
+        <enumeration value="blue red yellow"/>
+        <enumeration value="black"/>
+        <enumeration value="black red yellow green"/>
+        <enumeration value="silver black"/>
+      </documentation>
+    </annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:color_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "4" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "max_width_Type">
+    <annotation>
+      <documentation>
+        <enumeration value="100%"/>
+        <enumeration value="160mm"/>
+      </documentation>
+    </annotation>
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:none_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "background_Type">
+    <union memberTypes = "fo:background_color_Type fo:background_image_Type fo:background_repeat_Type fo:background_attachment_Type fo:background_position_Type"/>
+  </simpleType>
+  <simpleType name = "background_position_Type">
+    <union memberTypes = "fo:background_position_percentage_Type fo:background_position_length_Type fo:background_position_base_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "background_position_percentage_Type">
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:percentage_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "2" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "background_position_length_Type">
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:length_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "2" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "background_position_base_Type">
+    <restriction base = "string">
+      <enumeration value = "top left"/>
+      <enumeration value = "top center"/>
+      <enumeration value = "top right"/>
+      <enumeration value = "center left"/>
+      <enumeration value = "center center"/>
+      <enumeration value = "center right"/>
+      <enumeration value = "bottom left"/>
+      <enumeration value = "bottom center"/>
+      <enumeration value = "bottom right"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "size_Type">
+    <union memberTypes = "fo:background_position_length_Type fo:size_base_Type"/>
+  </simpleType>
+  <simpleType name = "size_base_Type">
+    <restriction base = "string">
+      <enumeration value = "auto"/>
+      <enumeration value = "landscape"/>
+      <enumeration value = "portrait"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "vertical_align_base_Type">
+    <restriction base = "string">
+      <enumeration value = "baseline"/>
+      <enumeration value = "middle"/>
+      <enumeration value = "sub"/>
+      <enumeration value = "super"/>
+      <enumeration value = "text-top"/>
+      <enumeration value = "text-bottom"/>
+      <enumeration value = "top"/>
+      <enumeration value = "bottom"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "vertical_align_Type">
+    <union memberTypes = "fo:vertical_align_base_Type fo:percentage_Type fo:length_Type"/>
+  </simpleType>
+  <simpleType name = "leader_length_Type">
+    <annotation>
+      <documentation>
+        <enumeration value = "50% 100% 100%"/>
+      </documentation>
+    </annotation>
+    <union memberTypes = "fo:length_range_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "letter_spacing_Type">
+    <union memberTypes = "fo:normal_Type fo:length_Type fo:space_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "font_size_adjust_Type">
+    <union memberTypes = "fo:number_Type fo:none_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_start_Type">
+    <union memberTypes = "fo:space_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "normal_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "background_attachment_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "scroll"/>
+      <enumeration value = "fixed"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "background_repeat_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "repeat"/>
+      <enumeration value = "repeat-x"/>
+      <enumeration value = "repeat-y"/>
+      <enumeration value = "no-repeat"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "speech_rate_base_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "x-slow"/>
+      <enumeration value = "slow"/>
+      <enumeration value = "medium"/>
+      <enumeration value = "fast"/>
+      <enumeration value = "x-fast"/>
+      <enumeration value = "faster"/>
+      <enumeration value = "slower"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "speech_rate_Type">
+    <union memberTypes = "fo:speech_rate_base_Type fo:integer_Type"/>
+  </simpleType>
+  <simpleType name = "speak_numeral_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "digits"/>
+      <enumeration value = "continuous"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "font_variant_Type">
+    <restriction base = "string">
+      <enumeration value = "normal"/>
+      <enumeration value = "small-caps"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "line_height_Type">
+    <union memberTypes = "fo:normal_Type fo:length_Type fo:integer_Type fo:percentage_Type fo:space_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "text_shadow_Type">
+    <union memberTypes = "fo:none_Type fo:color_Type fo:length_range_Type"/>
+  </simpleType>
+  <simpleType name = "height_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:auto_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "hyphenation_character_Type">
+    <union memberTypes = "fo:character_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "content_height_Type">
+    <union memberTypes = "fo:auto_Type fo:scale_to_fit_Type fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "scale_to_fit_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "scale-to-fit"/>
+    </restriction>
+  </simpleType>
+
+  <simpleType name = "font_weight_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+      <enumeration value = "bold">
+        <annotation>
+          <documentation>
+            <fop_result>heavier than no value</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "bolder">
+        <annotation>
+          <documentation>
+            <fop_result>lighter than normal</fop_result> <fop_fail>unknown font</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "lighter">
+        <annotation>
+          <documentation>
+            <fop_result>lighter than normal</fop_result> <fop_fail>unknown font</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "100">
+        <annotation>
+          <documentation>
+            <fop_result>same as normal</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "200">
+        <annotation>
+          <documentation>
+            <fop_result>same as normal</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "300">
+        <annotation>
+          <documentation>
+            <fop_result>same as normal</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "400">
+        <annotation>
+          <documentation>
+            <fop_result>same as normal</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "500">
+        <annotation>
+          <documentation>
+            <fop_result>same as normal</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "600">
+        <annotation>
+          <documentation>
+            <fop_result>same as normal</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "700">
+        <annotation>
+          <documentation>
+            <fop_result>same as bold</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "800">
+        <annotation>
+          <documentation>
+            <fop_result>same as bold</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "900">
+        <annotation>
+          <documentation>
+            <fop_result>same as bold</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_result>lighter than normal</fop_result> <fop_fail>unknown font</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "font_style_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+      <enumeration value = "italic"/>
+      <enumeration value = "oblique"/>
+      <enumeration value = "backslant">
+        <annotation>
+          <documentation>
+            <fop_fail>unknown font</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>unknown font</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "page_break_inside_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "avoid"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "page_break_after_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "always"/>
+      <enumeration value = "avoid"/>
+      <enumeration value = "left"/>
+      <enumeration value = "right"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "white_space_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+      <enumeration value = "pre"/>
+      <enumeration value = "nowrap"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "show_destination_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "replace"/>
+      <enumeration value = "new"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "indicate_destination_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "speak_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+      <enumeration value = "none"/>
+      <enumeration value = "spell-out"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "relative_align_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "before"/>
+      <enumeration value = "baseline"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "empty_cells_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "show"/>
+      <enumeration value = "hide"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "ends_row_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "starts_row_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "static"/>
+      <enumeration value = "relative"/>
+      <enumeration value = "absolute"/>
+      <enumeration value = "fixed"/>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "conditionality_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "retain"/>
+      <enumeration value = "discard"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "keep_compound_Type">
+    <annotation>
+      <documentation>
+        A compound datatype, with components: within-line, within-column, within-page. Each component is a <keep/>.
+        <enumeration value = "2 auto always"/>
+        <enumeration value = "auto"/>
+        <enumeration value = "always"/>
+      </documentation>
+    </annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:keep_integer_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "3" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "keep_integer_Type">
+    <annotation>
+      <documentation>
+        <enumeration value = "2"/>
+        <enumeration value = "5"/>
+        <enumeration value = "10"/>
+        <enumeration value = "auto"/>
+        <enumeration value = "always"/>
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <pattern value = "(\+?\d+|auto|always)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "letter_value_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "alphabetic"/>
+      <enumeration value = "traditional"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "alignment_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "baseline"/>
+      <enumeration value = "before-edge"/>
+      <enumeration value = "text-before-edge"/>
+      <enumeration value = "middle"/>
+      <enumeration value = "central"/>
+      <enumeration value = "after-edge"/>
+      <enumeration value = "text-after-edge"/>
+      <enumeration value = "ideographic"/>
+      <enumeration value = "alphabetic"/>
+      <enumeration value = "hanging"/>
+      <enumeration value = "mathematical"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "box_alignment_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "top"/>
+      <enumeration value = "text-top"/>
+      <enumeration value = "bottom"/>
+      <enumeration value = "text-bottom"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "breaks_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "auto"/>
+      <enumeration value = "column"/>
+      <enumeration value = "page"/>
+      <enumeration value = "even-page"/>
+      <enumeration value = "odd-page"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "force_page_count_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "even"/>
+      <enumeration value = "odd"/>
+      <enumeration value = "end-on-even"/>
+      <enumeration value = "end-on-odd"/>
+      <enumeration value = "no-force"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "table_layout_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "fixed"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "scaling_method_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "integer-pixels"/>
+      <enumeration value = "resample-any-method"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "displace_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "inherit"/>
+      <enumeration value = "auto"/>
+      <enumeration value = "none"/>
+      <enumeration value = "line"/>
+      <enumeration value = "indent"/>
+      <enumeration value = "block"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "media_usage_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "paginate"/>
+      <enumeration value = "bounded-in-one-dimension"/>
+      <enumeration value = "unbounded"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "rendering_intent_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "perceptual"/>
+      <enumeration value = "relative-colorimetric"/>
+      <enumeration value = "saturation"/>
+      <enumeration value = "absolute-colorimetric"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "hyphenate_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "false"/>
+      <enumeration value = "true"/>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "suppress_at_line_break_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "suppress"/>
+      <enumeration value = "retain"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "treat_as_word_space_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "dominant_baseline_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "use-script"/>
+      <enumeration value = "no-change"/>
+      <enumeration value = "reset-size"/>
+      <enumeration value = "ideographic"/>
+      <enumeration value = "alphabetic"/>
+      <enumeration value = "hanging"/>
+      <enumeration value = "mathematical"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "orientation_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "inherit"/>
+      <enumeration value = "0"/>
+      <enumeration value = "90"/>
+      <enumeration value = "180"/>
+      <enumeration value = "270"/>
+      <enumeration value = "-90"/>
+      <enumeration value = "-180"/>
+      <enumeration value = "-270"/>
+      <enumeration value = "0deg"/>
+      <enumeration value = "90deg"/>
+      <enumeration value = "180deg"/>
+      <enumeration value = "270deg"/>
+      <enumeration value = "-90deg"/>
+      <enumeration value = "-180deg"/>
+      <enumeration value = "-270deg"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "measurement_Type">
+    <annotation>
+      <documentation>
+        Here to document the acceptable measurements
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <enumeration value = "px"/>
+      <enumeration value = "pt"/>
+      <enumeration value = "mm"/>
+      <enumeration value = "in"/>
+      <enumeration value = "cm"/>
+      <enumeration value = "em"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "positive_length_Type">
+    <restriction base = "string">
+      <pattern value = "\+?\d+\.?\d*(px|pt|mm|cm|in|em|%)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "negative_length_Type">
+    <restriction base = "string">
+      <pattern value = "-\d+\.?\d*(px|pt|mm|cm|in|em|%)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "integer_Force_Type">
+    <restriction base = "string">
+      <pattern value = "([0-9]+|force)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "padding_top_Type">
+    <union memberTypes = "fo:width_Type fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "padding_before_Type">
+    <union memberTypes = "fo:width_Type fo:length_Type fo:length_conditional_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "country_Type">
+    <annotation>
+      <documentation>
+        A string of characters conforming to an ISO 3166 country code.
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+      <enumeration value = "inherit"/>
+      <enumeration value = "AF"><annotation><documentation> country-name = "AFGHANISTAN"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "AL"><annotation><documentation> country-name = "ALBANIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "DZ"><annotation><documentation> country-name = "ALGERIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AS"><annotation><documentation> country-name = "AMERICANSAMOA"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "AD"><annotation><documentation> country-name = "ANDORRA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AO"><annotation><documentation> country-name = "ANGOLA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "AI"><annotation><documentation> country-name = "ANGUILLA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "AQ"><annotation><documentation> country-name = "ANTARCTICA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "AG"><annotation><documentation> country-name = "ANTIGUAANDBARBUDA"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "AR"><annotation><documentation> country-name = "ARGENTINA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AM"><annotation><documentation> country-name = "ARMENIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AW"><annotation><documentation> country-name = "ARUBA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "AU"><annotation><documentation> country-name = "AUSTRALIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AT"><annotation><documentation> country-name = "AUSTRIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AZ"><annotation><documentation> country-name = "AZERBAIJAN"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "BS"><annotation><documentation> country-name = "BAHAMAS"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "BH"><annotation><documentation> country-name = "BAHRAIN"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "BD"><annotation><documentation> country-name = "BANGLADESH"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "BB"><annotation><documentation> country-name = "BARBADOS"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "BY"><annotation><documentation> country-name = "BELARUS"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "BE"><annotation><documentation> country-name = "BELGIUM"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "BZ"><annotation><documentation> country-name = "BELIZE"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "BJ"><annotation><documentation> country-name = "BENIN"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "BM"><annotation><documentation> country-name = "BERMUDA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "BT"><annotation><documentation> country-name = "BHUTAN"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "BO"><annotation><documentation> country-name = "BOLIVIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "BA"><annotation><documentation> country-name = "BOSNIAANDHERZEGOVINA"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "BW"><annotation><documentation> country-name = "BOTSWANA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "BV"><annotation><documentation> country-name = "BOUVETISLAND"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "BR"><annotation><documentation> country-name = "BRAZIL"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "IO"><annotation><documentation> country-name = "BRITISHINDIANOCEANTERRITORY"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "BN"><annotation><documentation> country-name = "BRUNEIDARUSSALAM"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "BG"><annotation><documentation> country-name = "BULGARIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "BF"><annotation><documentation> country-name = "BURKINAFASO"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "BI"><annotation><documentation> country-name = "BURUNDI"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "KH"><annotation><documentation> country-name = "CAMBODIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "CM"><annotation><documentation> country-name = "CAMEROON"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "CA"><annotation><documentation> country-name = "CANADA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "CV"><annotation><documentation> country-name = "CAPEVERDE"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "KY"><annotation><documentation> country-name = "CAYMANISLANDS"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "CF"><annotation><documentation> country-name = "CENTRALAFRICANREPUBLIC"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "TD"><annotation><documentation> country-name = "CHAD"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "CL"><annotation><documentation> country-name = "CHILE"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "CN"><annotation><documentation> country-name = "CHINA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "CX"><annotation><documentation> country-name = "CHRISTMASISLAND"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "CC"><annotation><documentation> country-name = "COCOS(KEELING)ISLANDS"/ </documentation></annotation>           </enumeration>
+      <enumeration value = "CO"><annotation><documentation> country-name = "COLOMBIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "KM"><annotation><documentation> country-name = "COMOROS"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "CG"><annotation><documentation> country-name = "CONGO"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "CD"><annotation><documentation> country-name = "CONGO,THEDEMOCRATICREPUBLICOFTHE"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "CK"><annotation><documentation> country-name = "COOKISLANDS"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "CR"><annotation><documentation> country-name = "COSTARICA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "CI"><annotation><documentation> country-name = "COTED'IVOIRE"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "HR"><annotation><documentation> country-name = "CROATIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "CU"><annotation><documentation> country-name = "CUBA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "CY"><annotation><documentation> country-name = "CYPRUS"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "CZ"><annotation><documentation> country-name = "CZECHREPUBLIC"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "DK"><annotation><documentation> country-name = "DENMARK"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "DJ"><annotation><documentation> country-name = "DJIBOUTI"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "DM"><annotation><documentation> country-name = "DOMINICA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "DO"><annotation><documentation> country-name = "DOMINICANREPUBLIC"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "TP"><annotation><documentation> country-name = "EASTTIMOR"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "EC"><annotation><documentation> country-name = "ECUADOR"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "EG"><annotation><documentation> country-name = "EGYPT"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "SV"><annotation><documentation> country-name = "ELSALVADOR"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "GQ"><annotation><documentation> country-name = "EQUATORIALGUINEA"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "ER"><annotation><documentation> country-name = "ERITREA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "EE"><annotation><documentation> country-name = "ESTONIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "ET"><annotation><documentation> country-name = "ETHIOPIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "FK"><annotation><documentation> country-name = "FALKLANDISLANDS(MALVINAS)"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "FO"><annotation><documentation> country-name = "FAROEISLANDS"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "FJ"><annotation><documentation> country-name = "FIJI"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "FI"><annotation><documentation> country-name = "FINLAND"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "FR"><annotation><documentation> country-name = "FRANCE"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "GF"><annotation><documentation> country-name = "FRENCHGUIANA"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "PF"><annotation><documentation> country-name = "FRENCHPOLYNESIA"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "TF"><annotation><documentation> country-name = "FRENCHSOUTHERNTERRITORIES"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "GA"><annotation><documentation> country-name = "GABON"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "GM"><annotation><documentation> country-name = "GAMBIA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "GE"><annotation><documentation> country-name = "GEORGIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "DE"><annotation><documentation> country-name = "GERMANY"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "GH"><annotation><documentation> country-name = "GHANA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "GI"><annotation><documentation> country-name = "GIBRALTAR"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "GR"><annotation><documentation> country-name = "GREECE"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "GL"><annotation><documentation> country-name = "GREENLAND"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "GD"><annotation><documentation> country-name = "GRENADA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "GP"><annotation><documentation> country-name = "GUADELOUPE"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "GU"><annotation><documentation> country-name = "GUAM"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "GT"><annotation><documentation> country-name = "GUATEMALA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "GN"><annotation><documentation> country-name = "GUINEA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "GW"><annotation><documentation> country-name = "GUINEA-BISSAU"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "GY"><annotation><documentation> country-name = "GUYANA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "HT"><annotation><documentation> country-name = "HAITI"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "HM"><annotation><documentation> country-name = "HEARDISLANDANDMCDONALDISLANDS"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "VA"><annotation><documentation> country-name = "HOLYSEE(VATICANCITYSTATE)"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "HN"><annotation><documentation> country-name = "HONDURAS"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "HK"><annotation><documentation> country-name = "HONGKONG"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "HU"><annotation><documentation> country-name = "HUNGARY"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "IS"><annotation><documentation> country-name = "ICELAND"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "IN"><annotation><documentation> country-name = "INDIA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "ID"><annotation><documentation> country-name = "INDONESIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "IR"><annotation><documentation> country-name = "IRAN,ISLAMICREPUBLICOF"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "IQ"><annotation><documentation> country-name = "IRAQ"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "IE"><annotation><documentation> country-name = "IRELAND"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "IL"><annotation><documentation> country-name = "ISRAEL"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "IT"><annotation><documentation> country-name = "ITALY"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "JM"><annotation><documentation> country-name = "JAMAICA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "JP"><annotation><documentation> country-name = "JAPAN"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "JO"><annotation><documentation> country-name = "JORDAN"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "KZ"><annotation><documentation> country-name = "KAZAKSTAN"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "KE"><annotation><documentation> country-name = "KENYA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "KI"><annotation><documentation> country-name = "KIRIBATI"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "KP"><annotation><documentation> country-name = "KOREA,DEMOCRATICPEOPLE'SREPUBLICOF"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "KR"><annotation><documentation> country-name = "KOREA,REPUBLICOF"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "KW"><annotation><documentation> country-name = "KUWAIT"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "KG"><annotation><documentation> country-name = "KYRGYZSTAN"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "LA"><annotation><documentation> country-name = "LAOPEOPLE'SDEMOCRATICREPUBLIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "LV"><annotation><documentation> country-name = "LATVIA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "LB"><annotation><documentation> country-name = "LEBANON"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "LS"><annotation><documentation> country-name = "LESOTHO"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "LR"><annotation><documentation> country-name = "LIBERIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "LY"><annotation><documentation> country-name = "LIBYANARABJAMAHIRIYA"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "LI"><annotation><documentation> country-name = "LIECHTENSTEIN"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "LT"><annotation><documentation> country-name = "LITHUANIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "LU"><annotation><documentation> country-name = "LUXEMBOURG"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MO"><annotation><documentation> country-name = "MACAU"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "MK"><annotation><documentation> country-name = "MACEDONIA,THEFORMERYUGOSLAVREPUBLICOF"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "MG"><annotation><documentation> country-name = "MADAGASCAR"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MW"><annotation><documentation> country-name = "MALAWI"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "MY"><annotation><documentation> country-name = "MALAYSIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MV"><annotation><documentation> country-name = "MALDIVES"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "ML"><annotation><documentation> country-name = "MALI"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "MT"><annotation><documentation> country-name = "MALTA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "MH"><annotation><documentation> country-name = "MARSHALLISLANDS"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "MQ"><annotation><documentation> country-name = "MARTINIQUE"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MR"><annotation><documentation> country-name = "MAURITANIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MU"><annotation><documentation> country-name = "MAURITIUS"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "YT"><annotation><documentation> country-name = "MAYOTTE"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "MX"><annotation><documentation> country-name = "MEXICO"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "FM"><annotation><documentation> country-name = "MICRONESIA,FEDERATEDSTATESOF"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "MD"><annotation><documentation> country-name = "MOLDOVA,REPUBLICOF"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "MC"><annotation><documentation> country-name = "MONACO"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "MN"><annotation><documentation> country-name = "MONGOLIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MS"><annotation><documentation> country-name = "MONTSERRAT"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MA"><annotation><documentation> country-name = "MOROCCO"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "MZ"><annotation><documentation> country-name = "MOZAMBIQUE"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MM"><annotation><documentation> country-name = "MYANMAR"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "NA"><annotation><documentation> country-name = "NAMIBIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "NR"><annotation><documentation> country-name = "NAURU"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "NP"><annotation><documentation> country-name = "NEPAL"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "NL"><annotation><documentation> country-name = "NETHERLANDS"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "AN"><annotation><documentation> country-name = "NETHERLANDSANTILLES"/ </documentation></annotation>           </enumeration>
+      <enumeration value = "NC"><annotation><documentation> country-name = "NEWCALEDONIA"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "NZ"><annotation><documentation> country-name = "NEWZEALAND"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "NI"><annotation><documentation> country-name = "NICARAGUA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "NE"><annotation><documentation> country-name = "NIGER"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "NG"><annotation><documentation> country-name = "NIGERIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "NU"><annotation><documentation> country-name = "NIUE"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "NF"><annotation><documentation> country-name = "NORFOLKISLAND"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "MP"><annotation><documentation> country-name = "NORTHERNMARIANAISLANDS"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "NO"><annotation><documentation> country-name = "NORWAY"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "OM"><annotation><documentation> country-name = "OMAN"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "PK"><annotation><documentation> country-name = "PAKISTAN"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "PW"><annotation><documentation> country-name = "PALAU"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "PS"><annotation><documentation> country-name = "PALESTINIANTERRITORY,OCCUPIED"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "PA"><annotation><documentation> country-name = "PANAMA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "PG"><annotation><documentation> country-name = "PAPUANEWGUINEA"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "PY"><annotation><documentation> country-name = "PARAGUAY"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "PE"><annotation><documentation> country-name = "PERU"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "PH"><annotation><documentation> country-name = "PHILIPPINES"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "PN"><annotation><documentation> country-name = "PITCAIRN"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "PL"><annotation><documentation> country-name = "POLAND"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "PT"><annotation><documentation> country-name = "PORTUGAL"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "PR"><annotation><documentation> country-name = "PUERTORICO"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "QA"><annotation><documentation> country-name = "QATAR"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "RE"><annotation><documentation> country-name = "R+UNION"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "RO"><annotation><documentation> country-name = "ROMANIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "RU"><annotation><documentation> country-name = "RUSSIANFEDERATION"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "RW"><annotation><documentation> country-name = "RWANDA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "SH"><annotation><documentation> country-name = "SAINTHELENA"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "KN"><annotation><documentation> country-name = "SAINTKITTSANDNEVIS"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "LC"><annotation><documentation> country-name = "SAINTLUCIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "PM"><annotation><documentation> country-name = "SAINTPIERREANDMIQUELON"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "VC"><annotation><documentation> country-name = "SAINTVINCENTANDTHEGRENADINES"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "WS"><annotation><documentation> country-name = "SAMOA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "SM"><annotation><documentation> country-name = "SANMARINO"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "ST"><annotation><documentation> country-name = "SAOTOMEANDPRINCIPE"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "SA"><annotation><documentation> country-name = "SAUDIARABIA"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "SN"><annotation><documentation> country-name = "SENEGAL"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "SC"><annotation><documentation> country-name = "SEYCHELLES"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "SL"><annotation><documentation> country-name = "SIERRALEONE"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "SG"><annotation><documentation> country-name = "SINGAPORE"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "SK"><annotation><documentation> country-name = "SLOVAKIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "SI"><annotation><documentation> country-name = "SLOVENIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "SB"><annotation><documentation> country-name = "SOLOMONISLANDS"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "SO"><annotation><documentation> country-name = "SOMALIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "ZA"><annotation><documentation> country-name = "SOUTHAFRICA"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "GS"><annotation><documentation> country-name = "SOUTHGEORGIAANDTHESOUTHSANDWICHISLANDS"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "ES"><annotation><documentation> country-name = "SPAIN"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "LK"><annotation><documentation> country-name = "SRILANKA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "SD"><annotation><documentation> country-name = "SUDAN"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "SR"><annotation><documentation> country-name = "SURINAME"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "SJ"><annotation><documentation> country-name = "SVALBARDANDJANMAYEN"/ </documentation></annotation>           </enumeration>
+      <enumeration value = "SZ"><annotation><documentation> country-name = "SWAZILAND"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "SE"><annotation><documentation> country-name = "SWEDEN"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "CH"><annotation><documentation> country-name = "SWITZERLAND"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "SY"><annotation><documentation> country-name = "SYRIANARABREPUBLIC"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "TW"><annotation><documentation> country-name = "TAIWAN,PROVINCEOFCHINA"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "TJ"><annotation><documentation> country-name = "TAJIKISTAN"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "TZ"><annotation><documentation> country-name = "TANZANIA,UNITEDREPUBLICOF"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "TH"><annotation><documentation> country-name = "THAILAND"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "TG"><annotation><documentation> country-name = "TOGO"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "TK"><annotation><documentation> country-name = "TOKELAU"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "TO"><annotation><documentation> country-name = "TONGA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "TT"><annotation><documentation> country-name = "TRINIDADANDTOBAGO"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "TN"><annotation><documentation> country-name = "TUNISIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "TR"><annotation><documentation> country-name = "TURKEY"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "TM"><annotation><documentation> country-name = "TURKMENISTAN"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "TC"><annotation><documentation> country-name = "TURKSANDCAICOSISLANDS"/ </documentation></annotation>           </enumeration>
+      <enumeration value = "TV"><annotation><documentation> country-name = "TUVALU"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "UG"><annotation><documentation> country-name = "UGANDA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "UA"><annotation><documentation> country-name = "UKRAINE"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AE"><annotation><documentation> country-name = "UNITEDARABEMIRATES"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "GB"><annotation><documentation> country-name = "UNITEDKINGDOM"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "US"><annotation><documentation> country-name = "UNITEDSTATES"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "UM"><annotation><documentation> country-name = "UNITEDSTATESMINOROUTLYINGISLANDS"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "UY"><annotation><documentation> country-name = "URUGUAY"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "UZ"><annotation><documentation> country-name = "UZBEKISTAN"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "VU"><annotation><documentation> country-name = "VANUATU"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "VE"><annotation><documentation> country-name = "VENEZUELA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "VN"><annotation><documentation> country-name = "VIETNAM"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "VG"><annotation><documentation> country-name = "VIRGINISLANDS,BRITISH"/ </documentation></annotation>           </enumeration>
+      <enumeration value = "VI"><annotation><documentation> country-name = "VIRGINISLANDS,U.S."/ </documentation></annotation>              </enumeration>
+      <enumeration value = "WF"><annotation><documentation> country-name = "WALLISANDFUTUNA"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "EH"><annotation><documentation> country-name = "WESTERNSAHARA"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "YE"><annotation><documentation> country-name = "YEMEN"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "YU"><annotation><documentation> country-name = "YUGOSLAVIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "ZM"><annotation><documentation> country-name = "ZAMBIA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "ZW"><annotation><documentation> country-name = "ZIMBABWE"/ </documentation></annotation>                  </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "language_Type">
+  <annotation><documentation> A string of characters conforming to the ISO 639 3-letter code. (Rather odd since all of them have 2 letters)</documentation></annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+      <enumeration value = "inherit"/>
+      <enumeration value = "AY"><annotation><documentation> language-name = "AYMARA" language-family = "AMERINDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "GN"><annotation><documentation> language-name = "GUARANI" language-family = "AMERINDIAN"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "QU"><annotation><documentation> language-name = "QUECHUA" language-family = "AMERINDIAN"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "DZ"><annotation><documentation> language-name = "BHUTANI" language-family = "ASIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "MY"><annotation><documentation> language-name = "BURMESE" language-family = "ASIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "KM"><annotation><documentation> language-name = "CAMBODIAN" language-family = "ASIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "ZH"><annotation><documentation> language-name = "CHINESE" language-family = "ASIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "JA"><annotation><documentation> language-name = "JAPANESE" language-family = "ASIAN"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "KO"><annotation><documentation> language-name = "KOREAN" language-family = "ASIAN"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "LO"><annotation><documentation> language-name = "LAOTHIAN" language-family = "ASIAN"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "TH"><annotation><documentation> language-name = "THAI" language-family = "ASIAN"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "BO"><annotation><documentation> language-name = "TIBETAN" language-family = "ASIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "VI"><annotation><documentation> language-name = "VIETNAMESE" language-family = "ASIAN"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "LV"><annotation><documentation> language-name = "LATVIAN;LETTISH" language-family = "BALTIC"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "LT"><annotation><documentation> language-name = "LITHUANIAN" language-family = "BALTIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "EU"><annotation><documentation> language-name = "BASQUE" language-family = "BASQUE"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "BR"><annotation><documentation> language-name = "BRETON" language-family = "CELTIC"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "GA"><annotation><documentation> language-name = "IRISH" language-family = "CELTIC"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "GD"><annotation><documentation> language-name = "SCOTS-GAELIC" language-family = "CELTIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "CY"><annotation><documentation> language-name = "WELSH" language-family = "CELTIC"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "KN"><annotation><documentation> language-name = "KANNADA" language-family = "DRAVIDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "ML"><annotation><documentation> language-name = "MALAYALAM" language-family = "DRAVIDIAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "TA"><annotation><documentation> language-name = "TAMIL" language-family = "DRAVIDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "TE"><annotation><documentation> language-name = "TELUGU" language-family = "DRAVIDIAN"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "KL"><annotation><documentation> language-name = "GREENLANDIC" language-family = "ESKIMO"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "IK"><annotation><documentation> language-name = "INUPIAK" language-family = "ESKIMO"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "ET"><annotation><documentation> language-name = "ESTONIAN" language-family = "FINNO-UGRIC"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "FI"><annotation><documentation> language-name = "FINNISH" language-family = "FINNO-UGRIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "HU"><annotation><documentation> language-name = "HUNGARIAN" language-family = "FINNO-UGRIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "AF"><annotation><documentation> language-name = "AFRIKAANS" language-family = "GERMANIC"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "DA"><annotation><documentation> language-name = "DANISH" language-family = "GERMANIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "NL"><annotation><documentation> language-name = "DUTCH" language-family = "GERMANIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "EN"><annotation><documentation> language-name = "ENGLISH" language-family = "GERMANIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "FO"><annotation><documentation> language-name = "FAROESE" language-family = "GERMANIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "FY"><annotation><documentation> language-name = "FRISIAN" language-family = "GERMANIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "DE"><annotation><documentation> language-name = "GERMAN" language-family = "GERMANIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "IS"><annotation><documentation> language-name = "ICELANDIC" language-family = "GERMANIC"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "NO"><annotation><documentation> language-name = "NORWEGIAN" language-family = "GERMANIC"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "SV"><annotation><documentation> language-name = "SWEDISH" language-family = "GERMANIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "YI"><annotation><documentation> language-name = "YIDDISH" language-family = "GERMANIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "OM"><annotation><documentation> language-name = "AFAN-(OROMO)" language-family = "HAMITIC"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "AA"><annotation><documentation> language-name = "AFAR" language-family = "HAMITIC"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "SO"><annotation><documentation> language-name = "SOMALI" language-family = "HAMITIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "AB"><annotation><documentation> language-name = "ABKHAZIAN" language-family = "IBERO-CAUCASIAN"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "KA"><annotation><documentation> language-name = "GEORGIAN" language-family = "IBERO-CAUCASIAN"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "AS"><annotation><documentation> language-name = "ASSAMESE" language-family = "INDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "BN"><annotation><documentation> language-name = "BENGALI;BANGLA" language-family = "INDIAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "BH"><annotation><documentation> language-name = "BIHARI" language-family = "INDIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "GU"><annotation><documentation> language-name = "GUJARATI" language-family = "INDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "HI"><annotation><documentation> language-name = "HINDI" language-family = "INDIAN"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "KS"><annotation><documentation> language-name = "KASHMIRI" language-family = "INDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "MR"><annotation><documentation> language-name = "MARATHI" language-family = "INDIAN"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "NE"><annotation><documentation> language-name = "NEPALI" language-family = "INDIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "OR"><annotation><documentation> language-name = "ORIYA" language-family = "INDIAN"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "PA"><annotation><documentation> language-name = "PUNJABI" language-family = "INDIAN"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "SA"><annotation><documentation> language-name = "SANSKRIT" language-family = "INDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "SD"><annotation><documentation> language-name = "SINDHI" language-family = "INDIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "SI"><annotation><documentation> language-name = "SINGHALESE" language-family = "INDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "UR"><annotation><documentation> language-name = "URDU" language-family = "INDIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "SQ"><annotation><documentation> language-name = "ALBANIAN" language-family = "INDO-EUROPEAN(OTHER)"/ </documentation></annotation>  </enumeration>
+      <enumeration value = "HY"><annotation><documentation> language-name = "ARMENIAN" language-family = "INDO-EUROPEAN(OTHER)"/ </documentation></annotation>  </enumeration>
+      <enumeration value = "EO"><annotation><documentation> language-name = "ESPERANTO" language-family = "INTERNATIONAL-AUX."/ </documentation></annotation> </enumeration>
+      <enumeration value = "IA"><annotation><documentation> language-name = "INTERLINGUA" language-family = "INTERNATIONAL-AUX."/ </documentation></annotation> </enumeration>
+      <enumeration value = "IE"><annotation><documentation> language-name = "INTERLINGUE" language-family = "INTERNATIONAL-AUX."/ </documentation></annotation> </enumeration>
+      <enumeration value = "VO"><annotation><documentation> language-name = "VOLAPUK" language-family = "INTERNATIONAL-AUX."/ </documentation></annotation> </enumeration>
+      <enumeration value = "KU"><annotation><documentation> language-name = "KURDISH" language-family = "IRANIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "PS"><annotation><documentation> language-name = "PASHTO;PUSHTO" language-family = "IRANIAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "FA"><annotation><documentation> language-name = "PERSIAN-(farsi)" language-family = "IRANIAN"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "TG"><annotation><documentation> language-name = "TAJIK" language-family = "IRANIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "EL"><annotation><documentation> language-name = "GREEK" language-family = "LATIN/GREEK"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "LA"><annotation><documentation> language-name = "LATIN" language-family = "LATIN/GREEK"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "HA"><annotation><documentation> language-name = "HAUSA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "RW"><annotation><documentation> language-name = "KINYARWANDA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "RN"><annotation><documentation> language-name = "KURUNDI" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "LN"><annotation><documentation> language-name = "LINGALA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "SG"><annotation><documentation> language-name = "SANGHO" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "ST"><annotation><documentation> language-name = "SESOTHO" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "TN"><annotation><documentation> language-name = "SETSWANA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "SN"><annotation><documentation> language-name = "SHONA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "SS"><annotation><documentation> language-name = "SISWATI" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "SW"><annotation><documentation> language-name = "SWAHILI" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "TS"><annotation><documentation> language-name = "TSONGA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "TW"><annotation><documentation> language-name = "TWI" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "WO"><annotation><documentation> language-name = "WOLOF" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "XH"><annotation><documentation> language-name = "XHOSA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "YO"><annotation><documentation> language-name = "YORUBA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "ZU"><annotation><documentation> language-name = "ZULU" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "FJ"><annotation><documentation> language-name = "FIJI" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "ID"><annotation><documentation> language-name = "INDONESIAN" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>  </enumeration>
+      <enumeration value = "JV"><annotation><documentation> language-name = "JAVANESE" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>  </enumeration>
+      <enumeration value = "MG"><annotation><documentation> language-name = "MALAGASY" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>  </enumeration>
+      <enumeration value = "MS"><annotation><documentation> language-name = "MALAY" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "MI"><annotation><documentation> language-name = "MAORI" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "SM"><annotation><documentation> language-name = "SAMOAN" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "SU"><annotation><documentation> language-name = "SUNDANESE" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation> </enumeration>
+      <enumeration value = "TL"><annotation><documentation> language-name = "TAGALOG" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation> </enumeration>
+      <enumeration value = "TO"><annotation><documentation> language-name = "TONGA" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "CA"><annotation><documentation> language-name = "CATALAN" language-family = "ROMANCE"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "CO"><annotation><documentation> language-name = "CORSICAN" language-family = "ROMANCE"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "FR"><annotation><documentation> language-name = "FRENCH" language-family = "ROMANCE"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "GL"><annotation><documentation> language-name = "GALICIAN" language-family = "ROMANCE"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "IT"><annotation><documentation> language-name = "ITALIAN" language-family = "ROMANCE"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "MO"><annotation><documentation> language-name = "MOLDAVIAN" language-family = "ROMANCE"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "OC"><annotation><documentation> language-name = "OCCITAN" language-family = "ROMANCE"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "PT"><annotation><documentation> language-name = "PORTUGUESE" language-family = "ROMANCE"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "RM"><annotation><documentation> language-name = "RHAETO-ROMANCE" language-family = "ROMANCE"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "RO"><annotation><documentation> language-name = "ROMANIAN" language-family = "ROMANCE"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "ES"><annotation><documentation> language-name = "SPANISH" language-family = "ROMANCE"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "AM"><annotation><documentation> language-name = "AMHARIC" language-family = "SEMITIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "AR"><annotation><documentation> language-name = "ARABIC" language-family = "SEMITIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "HE"><annotation><documentation> language-name = "HEBREW" language-family = "SEMITIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "MT"><annotation><documentation> language-name = "MALTESE" language-family = "SEMITIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "TI"><annotation><documentation> language-name = "TIGRINYA" language-family = "SEMITIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "BG"><annotation><documentation> language-name = "BULGARIAN" language-family = "SLAVIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "BE"><annotation><documentation> language-name = "BYELORUSSIAN" language-family = "SLAVIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "HR"><annotation><documentation> language-name = "CROATIAN" language-family = "SLAVIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "CS"><annotation><documentation> language-name = "CZECH" language-family = "SLAVIC"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "MK"><annotation><documentation> language-name = "MACEDONIAN" language-family = "SLAVIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "PL"><annotation><documentation> language-name = "POLISH" language-family = "SLAVIC"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "RU"><annotation><documentation> language-name = "RUSSIAN" language-family = "SLAVIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "SR"><annotation><documentation> language-name = "SERBIAN" language-family = "SLAVIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "SH"><annotation><documentation> language-name = "SERBO-CROATIAN" language-family = "SLAVIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "SK"><annotation><documentation> language-name = "SLOVAK" language-family = "SLAVIC"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "SL"><annotation><documentation> language-name = "SLOVENIAN" language-family = "SLAVIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "UK"><annotation><documentation> language-name = "UKRAINIAN" language-family = "SLAVIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "AZ"><annotation><documentation> language-name = "AZERBAIJANI" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "BA"><annotation><documentation> language-name = "BASHKIR" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "KK"><annotation><documentation> language-name = "KAZAKH" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "KY"><annotation><documentation> language-name = "KIRGHIZ" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "TT"><annotation><documentation> language-name = "TATAR" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "TR"><annotation><documentation> language-name = "TURKISH" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "TK"><annotation><documentation> language-name = "TURKMEN" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "UZ"><annotation><documentation> language-name = "UZBEK" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "BI"><annotation><documentation> language-name = "BISLAMA" language-family = "[not-given]"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "MN"><annotation><documentation> language-name = "MONGOLIAN" language-family = "[not-given]"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "NA"><annotation><documentation> language-name = "NAURU" language-family = "[not-given]"/ </documentation></annotation>        </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "always_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "always"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "auto_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "baseline_base_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "baseline"/>
+      <enumeration value = "sub"/>
+      <enumeration value = "super"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "caption_side_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "before"/>
+      <enumeration value = "after"/>
+      <enumeration value = "start"/>
+      <enumeration value = "end"/>
+      <enumeration value = "top"/>
+      <enumeration value = "bottom"/>
+      <enumeration value = "left"/>
+      <enumeration value = "right"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "display_align_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "before"/>
+      <enumeration value = "center"/>
+      <enumeration value = "after"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "float_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "inherit"/>
+      <enumeration value = "before"/>
+      <enumeration value = "start"/>
+      <enumeration value = "end"/>
+      <enumeration value = "left"/>
+      <enumeration value = "right"/>
+      <enumeration value = "none"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "blank_or_not_blank_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "blank"/>
+      <enumeration value = "not-blank"/>
+      <enumeration value = "any"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "text_transform_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "capitalize"/>
+      <enumeration value = "uppercase"/>
+      <enumeration value = "lowercase"/>
+      <enumeration value = "none"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "border_collapse_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "collapse"/>
+      <enumeration value = "separate"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "line_height_shift_adjustment_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "consider-shifts"/>
+      <enumeration value = "disregard-shifts"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "white_space_collapse_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "false"/>
+      <enumeration value = "true"/>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "retrieve_position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "first-starting-within-page"/>
+      <enumeration value = "first-including-carryover"/>
+      <enumeration value = "last-starting-within-page"/>
+      <enumeration value = "last-ending-within-page"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "page_position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "first"/>
+      <enumeration value = "last"/>
+      <enumeration value = "rest"/>
+      <enumeration value = "any"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "force_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "force"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "white_space_treatment_Type">
+    <annotation>
+      <documentation>
+        <fop_fail>property ignored</fop_fail>
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "ignore"/>
+      <enumeration value = "preserve"/>
+      <enumeration value = "ignore-if-before-linefeed"/>
+      <enumeration value = "ignore-if-after-linefeed"/>
+      <enumeration value = "ignore-if-surrounding-linefeed"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "linefeed_treatment_Type">
+    <annotation>
+      <documentation>
+        <fop_fail>property is not implemented yet</fop_fail>
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "ignore"/>
+      <enumeration value = "preserve"/>
+      <enumeration value = "treat-as-space"/>
+      <enumeration value = "treat-as-zero-width-space"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "inherit_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "horizontal_position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "left"/>
+      <enumeration value = "center"/>
+      <enumeration value = "right"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "line_stacking_strategy_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "line-height"/>
+      <enumeration value = "font-height"/>
+      <enumeration value = "max-height"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "active_state_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "link"/>
+      <enumeration value = "visited"/>
+      <enumeration value = "active"/>
+      <enumeration value = "hover"/>
+      <enumeration value = "focus"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "writing_mode_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "lr-tb"/>
+      <enumeration value = "rl-tb"/>
+      <enumeration value = "tb-rl"/>
+      <enumeration value = "lr"/>
+      <enumeration value = "rl"/>
+      <enumeration value = "tb"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "direction_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "ltr"/>
+      <enumeration value = "rtl"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "wrap_option_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "no-wrap"/>
+      <enumeration value = "wrap"/>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "span_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+      <enumeration value = "all"/>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "rule_style_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+      <enumeration value = "dotted"/>
+      <enumeration value = "dashed"/>
+      <enumeration value = "solid"/>
+      <enumeration value = "double"/>
+      <enumeration value = "groove"/>
+      <enumeration value = "ridge"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "border_style_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "none"/>
+      <enumeration value = "hidden"/>
+      <enumeration value = "dotted"/>
+      <enumeration value = "dashed"/>
+      <enumeration value = "solid"/>
+      <enumeration value = "double"/>
+      <enumeration value = "groove"/>
+      <enumeration value = "ridge"/>
+      <enumeration value = "inset"/>
+      <enumeration value = "outset"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "leader_alignment_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+      <enumeration value = "reference-area"/>
+      <enumeration value = "page"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "text_decoration_Type">
+    <annotation>
+      <documentation>
+        <fop_result>not implemented</fop_result>
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+      <enumeration value = "underline"/>
+      <enumeration value = "no-underline"/>
+      <enumeration value = "overline"/>
+      <enumeration value = "no-overline"/>
+      <enumeration value = "line-through"/>
+      <enumeration value = "no-line-through"/>
+      <enumeration value = "blink"/>
+      <enumeration value = "no-blink"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "unicode_bidi_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+      <enumeration value = "embed"/>
+      <enumeration value = "bidi-override"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "odd_or_even_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "odd"/>
+      <enumeration value = "even"/>
+      <enumeration value = "any"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "once_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "once"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "retrieve_boundary_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "page"/>
+      <enumeration value = "page-sequence"/>
+      <enumeration value = "document"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "starting_state_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "show"/>
+      <enumeration value = "hide"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "leader_pattern_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "space"/>
+      <enumeration value = "rule"/>
+      <enumeration value = "dots"/>
+      <enumeration value = "use-content"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "text_align_last_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "start"/>
+      <enumeration value = "center"/>
+      <enumeration value = "end"/>
+      <enumeration value = "justify"/>
+      <enumeration value = "inside">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "outside">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "left">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "right">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "text_align_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "start"/>
+      <enumeration value = "center"/>
+      <enumeration value = "end"/>
+      <enumeration value = "justify"/>
+      <enumeration value = "inside">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "outside">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "left"/>
+      <enumeration value = "right"/>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "width_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "thin"/>
+      <enumeration value = "medium"/>
+      <enumeration value = "thick"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "vertical_position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "top"/>
+      <enumeration value = "center"/>
+      <enumeration value = "bottom"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "auto_restore_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "table_omit_footer_at_break_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "table_omit_header_at_break_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "precedence_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "score_spaces_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "scaling_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "uniform"/>
+      <enumeration value = "non-uniform"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "use_font_metrics_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "use-font-metrics"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "background_image_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "uri-specification"/>
+      <enumeration value = "none"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "hyphenation_keep_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "column"/>
+      <enumeration value = "page"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "no_limit_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "no-limit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "visibility_Type">
+    <annotation>
+      <documentation>
+        <fop_fail>property is not implemented yet</fop_fail>
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "visible"/>
+      <enumeration value = "hidden"/>
+      <enumeration value = "collapse"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "overflow_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "visible"/>
+      <enumeration value = "hidden"/>
+      <enumeration value = "scroll"/>
+      <enumeration value = "error-if-overflow"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "transparent_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "transparent"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "none_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "absolute_position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "absolute"/>
+      <enumeration value = "fixed"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "azimuth_base_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "left-side"/>
+      <enumeration value = "far-left"/>
+      <enumeration value = "left"/>
+      <enumeration value = "center-left"/>
+      <enumeration value = "center"/>
+      <enumeration value = "center-right"/>
+      <enumeration value = "right"/>
+      <enumeration value = "far-right"/>
+      <enumeration value = "right-side"/>
+      <enumeration value = "behind"/>
+      <enumeration value = "leftwards"/>
+      <enumeration value = "rightwards"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "azimuth_Type">
+    <union memberTypes = "fo:angle_Type fo:azimuth_base_Type"/>
+  </simpleType>
+  <simpleType name = "elevation_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "below"/>
+      <enumeration value = "level"/>
+      <enumeration value = "above"/>
+      <enumeration value = "higher"/>
+      <enumeration value = "lower"/>
+      <enumeration value = "0"/>
+      <enumeration value = "90"/>
+      <enumeration value = "180"/>
+      <enumeration value = "270"/>
+      <enumeration value = "0deg"/>
+      <enumeration value = "90deg"/>
+      <enumeration value = "180deg"/>
+      <enumeration value = "270deg"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "font_selection_strategy_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "character-by-character"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "font_stretch_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+      <enumeration value = "wider"/>
+      <enumeration value = "narrower"/>
+      <enumeration value = "ultra-condensed"/>
+      <enumeration value = "extra-condensed"/>
+      <enumeration value = "condensed"/>
+      <enumeration value = "semi-condensed"/>
+      <enumeration value = "semi-expanded"/>
+      <enumeration value = "expanded"/>
+      <enumeration value = "extra-expanded"/>
+      <enumeration value = "ultra-expanded"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "clear_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "start"/>
+      <enumeration value = "end"/>
+      <enumeration value = "left"/>
+      <enumeration value = "right"/>
+      <enumeration value = "both"/>
+      <enumeration value = "none"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "color_Name_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "aliceblue"/>
+      <enumeration value = "antiquewhite"/>
+      <enumeration value = "aqua"/>
+      <enumeration value = "aquamarine"/>
+      <enumeration value = "azure"/>
+      <enumeration value = "beige"/>
+      <enumeration value = "bisque"/>
+      <enumeration value = "black"/>
+      <enumeration value = "blanchedalmond"/>
+      <enumeration value = "blue"/>
+      <enumeration value = "blueviolet"/>
+      <enumeration value = "brown"/>
+      <enumeration value = "burlywood"/>
+      <enumeration value = "cadetblue"/>
+      <enumeration value = "chartreuse"/>
+      <enumeration value = "chocolate"/>
+      <enumeration value = "coral"/>
+      <enumeration value = "cornflowerblue"/>
+      <enumeration value = "cornsilk"/>
+      <enumeration value = "crimson"/>
+      <enumeration value = "cyan"/>
+      <enumeration value = "darkblue"/>
+      <enumeration value = "darkcyan"/>
+      <enumeration value = "darkgoldenrod"/>
+      <enumeration value = "darkgray"/>
+      <enumeration value = "darkgreen"/>
+      <enumeration value = "darkgrey"/>
+      <enumeration value = "darkkhaki"/>
+      <enumeration value = "darkmagenta"/>
+      <enumeration value = "darkolivegreen"/>
+      <enumeration value = "darkorange"/>
+      <enumeration value = "darkorchid"/>
+      <enumeration value = "darkred"/>
+      <enumeration value = "darksalmon"/>
+      <enumeration value = "darkseagreen"/>
+      <enumeration value = "darkslateblue"/>
+      <enumeration value = "darkslategray"/>
+      <enumeration value = "darkslategrey"/>
+      <enumeration value = "darkturquoise"/>
+      <enumeration value = "darkviolet"/>
+      <enumeration value = "deeppink"/>
+      <enumeration value = "deepskyblue"/>
+      <enumeration value = "dimgray"/>
+      <enumeration value = "dimgrey"/>
+      <enumeration value = "dodgerblue"/>
+      <enumeration value = "firebrick"/>
+      <enumeration value = "floralwhite"/>
+      <enumeration value = "forestgreen"/>
+      <enumeration value = "fuchsia"/>
+      <enumeration value = "gainsboro"/>
+      <enumeration value = "lightpink"/>
+      <enumeration value = "lightsalmon"/>
+      <enumeration value = "lightseagreen"/>
+      <enumeration value = "lightskyblue"/>
+      <enumeration value = "lightslategray"/>
+      <enumeration value = "lightslategrey"/>
+      <enumeration value = "lightsteelblue"/>
+      <enumeration value = "lightyellow"/>
+      <enumeration value = "lime"/>
+      <enumeration value = "limegreen"/>
+      <enumeration value = "linen"/>
+      <enumeration value = "magenta"/>
+      <enumeration value = "maroon"/>
+      <enumeration value = "mediumaquamarine"/>
+      <enumeration value = "mediumblue"/>
+      <enumeration value = "mediumorchid"/>
+      <enumeration value = "mediumpurple"/>
+      <enumeration value = "mediumseagreen"/>
+      <enumeration value = "mediumslateblue"/>
+      <enumeration value = "mediumspringgreen"/>
+      <enumeration value = "mediumturquoise"/>
+      <enumeration value = "mediumvioletred"/>
+      <enumeration value = "midnightblue"/>
+      <enumeration value = "mintcream"/>
+      <enumeration value = "mistyrose"/>
+      <enumeration value = "moccasin"/>
+      <enumeration value = "navajowhite"/>
+      <enumeration value = "navy"/>
+      <enumeration value = "oldlace"/>
+      <enumeration value = "olive"/>
+      <enumeration value = "olivedrab"/>
+      <enumeration value = "orange"/>
+      <enumeration value = "orangered"/>
+      <enumeration value = "orchid"/>
+      <enumeration value = "palegoldenrod"/>
+      <enumeration value = "palegreen"/>
+      <enumeration value = "paleturquoise"/>
+      <enumeration value = "palevioletred"/>
+      <enumeration value = "papayawhip"/>
+      <enumeration value = "peachpuff"/>
+      <enumeration value = "peru"/>
+      <enumeration value = "pink"/>
+      <enumeration value = "plum"/>
+      <enumeration value = "powderblue"/>
+      <enumeration value = "purple"/>
+      <enumeration value = "red"/>
+      <enumeration value = "rosybrown"/>
+      <enumeration value = "royalblue"/>
+      <enumeration value = "saddlebrown"/>
+      <enumeration value = "salmon"/>
+      <enumeration value = "ghostwhite"/>
+      <enumeration value = "gold"/>
+      <enumeration value = "goldenrod"/>
+      <enumeration value = "gray"/>
+      <enumeration value = "grey"/>
+      <enumeration value = "green"/>
+      <enumeration value = "greenyellow"/>
+      <enumeration value = "honeydew"/>
+      <enumeration value = "hotpink"/>
+      <enumeration value = "indianred"/>
+      <enumeration value = "indigo"/>
+      <enumeration value = "ivory"/>
+      <enumeration value = "khaki"/>
+      <enumeration value = "lavender"/>
+      <enumeration value = "lavenderblush"/>
+      <enumeration value = "lawngreen"/>
+      <enumeration value = "lemonchiffon"/>
+      <enumeration value = "lightblue"/>
+      <enumeration value = "lightcoral"/>
+      <enumeration value = "lightcyan"/>
+      <enumeration value = "lightgoldenrodyellow"/>
+      <enumeration value = "lightgray"/>
+      <enumeration value = "lightgreen"/>
+      <enumeration value = "lightgrey"/>
+      <enumeration value = "sandybrown"/>
+      <enumeration value = "seagreen"/>
+      <enumeration value = "seashell"/>
+      <enumeration value = "sienna"/>
+      <enumeration value = "silver"/>
+      <enumeration value = "skyblue"/>
+      <enumeration value = "slateblue"/>
+      <enumeration value = "slategray"/>
+      <enumeration value = "slategrey"/>
+      <enumeration value = "snow"/>
+      <enumeration value = "springgreen"/>
+      <enumeration value = "steelblue"/>
+      <enumeration value = "tan"/>
+      <enumeration value = "teal"/>
+      <enumeration value = "thistle"/>
+      <enumeration value = "tomato"/>
+      <enumeration value = "turquoise"/>
+      <enumeration value = "violet"/>
+      <enumeration value = "wheat"/>
+      <enumeration value = "white"/>
+      <enumeration value = "whitesmoke"/>
+      <enumeration value = "yellow"/>
+      <enumeration value = "yellowgreen"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "color_Hex_Type">
+    <restriction base = "string">
+      <pattern value = "#[0-9A-F]{6}"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "background_color_Type">
+    <union memberTypes = "fo:color_Hex_Type fo:color_Name_Type fo:inherit_Type fo:transparent_Type"/>
+  </simpleType>
+  <simpleType name = "relative_position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "static"/>
+      <enumeration value = "relative"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "speak_header_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "once"/>
+      <enumeration value = "always"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "border_Type">
+    <annotation>
+      <documentation>
+        "fo:width_Type fo:border_style_Type fo:color_Type"
+        <enumeration value="solid 4px yellow"/>
+        <enumeration value="solid 2px green"/>
+        <enumeration value="solid 1px blue"/>
+        <enumeration value="solid 1px silver"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset) \+?\d+\.?\d*(px|pt|mm|cm|in|em|%) (#[0-9A-F]{6}|[a-z]{3,16})"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "font_size_Type">
+    <union memberTypes = "fo:absolute_size_Type fo:relative_size_Type fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "alignment_baseline_Type">
+    <union memberTypes = "fo:auto_Type fo:alignment_Type fo:box_alignment_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "alignment_adjust_Type">
+    <union memberTypes = "fo:auto_Type fo:alignment_Type fo:percentage_Type fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "z_index_Type">
+    <union memberTypes = "fo:auto_Type fo:integer_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "margin_width_Type">
+    <union memberTypes = "fo:auto_Type fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "block_progression_dimension_optimum_Type">
+    <union memberTypes = "fo:auto_Type fo:length_Type"/>
+  </simpleType>
+  <simpleType name = "block_progression_dimension_maximum_Type">
+    <union memberTypes = "fo:auto_Type fo:length_Type"/>
+  </simpleType>
+  <simpleType name = "inline_progression_dimension_maximum_Type">
+    <union memberTypes = "fo:auto_Type fo:length_Type"/>
+  </simpleType>
+  <simpleType name = "inline_progression_dimension_optimum_Type">
+    <union memberTypes = "fo:auto_Type fo:length_Type"/>
+  </simpleType>
+  <simpleType name = "baseline_shift_Type">
+    <union memberTypes = "fo:baseline_base_Type fo:percentage_Type fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_start_precedence_Type">
+    <union memberTypes = "fo:integer_Type fo:force_Type"/>
+  </simpleType>
+  <simpleType name = "space_end_precedence_Type">
+    <union memberTypes = "fo:integer_Type fo:force_Type"/>
+  </simpleType>
+  <simpleType name = "space_after_precedence_Type">
+    <union memberTypes = "fo:integer_Type fo:force_Type"/>
+  </simpleType>
+  <simpleType name = "space_before_precedence_Type">
+    <union memberTypes = "fo:integer_Type fo:force_Type"/>
+  </simpleType>
+  <simpleType name = "widows_Type">
+    <union memberTypes = "fo:integer_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "orphans_Type">
+    <union memberTypes = "fo:integer_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_start_maximum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_start_minimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_end_minimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_end_optimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_before_minimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_after_maximum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_start_optimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_end_maximum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_before_optimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_before_maximum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_after_optimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_after_minimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "left_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:auto_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "bottom_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:auto_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "right_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:auto_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "top_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:auto_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "start_indent_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "last_line_end_indent_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "provisional_distance_between_starts_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "end_indent_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "extent_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "provisional_label_separation_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "length_percentage_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type"/>
+  </simpleType>
+  <simpleType name = "hyphenation_ladder_count_Type">
+    <union memberTypes = "fo:no_limit_Type fo:integer_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "background_position_horizontal_Type">
+    <union memberTypes = "fo:percentage_Type fo:length_Type fo:horizontal_position_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "background_position_vertical_Type">
+    <union memberTypes = "fo:percentage_Type fo:length_Type fo:vertical_position_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "leader_pattern_width_Type">
+    <union memberTypes = "fo:use_font_metrics_Type fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "text_altitude_Type">
+    <union memberTypes = "fo:use_font_metrics_Type fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "text_depth_Type">
+    <union memberTypes = "fo:use_font_metrics_Type fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "border_before_width_Type">
+    <union memberTypes = "fo:width_Type fo:length_Type fo:length_conditional_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "border_top_width_Type">
+    <union memberTypes = "fo:width_Type fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+
+  <annotation>
+    <documentation>
+      Element definitions
+    </documentation>
+  </annotation>
+
+  <element name = "root">
+    <complexType>
+      <sequence>
+        <element ref = "fo:layout-master-set"/>
+        <element ref = "fo:declarations" minOccurs = "0"/>
+        <element ref = "fo:page-sequence" maxOccurs = "unbounded"/>
+      </sequence>
+      <attribute name = "media-usage" type = "fo:media_usage_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "declarations">
+    <complexType>
+      <sequence>
+        <element ref = "fo:color-profile" maxOccurs = "unbounded"/>
+        <any minOccurs = "0" maxOccurs = "unbounded" namespace = "##other" processContents = "skip"/>
+      </sequence>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "color-profile">
+    <complexType>
+      <attribute name = "src" type = "xs:string" use = "required"/>
+      <attribute name = "color-profile-name" type = "xs:string" use = "required"/>
+      <attribute name = "rendering-intent" type = "fo:rendering_intent_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "layout-master-set">
+    <complexType>
+      <choice maxOccurs = "unbounded">
+        <element ref = "fo:simple-page-master"/>
+        <element ref = "fo:page-sequence-master"/>
+      </choice>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "page-sequence-master">
+    <complexType>
+      <choice maxOccurs = "unbounded">
+        <element ref = "fo:single-page-master-reference"/>
+        <element ref = "fo:repeatable-page-master-reference"/>
+        <element ref = "fo:repeatable-page-master-alternatives"/>
+      </choice>
+      <attribute name = "master-name" type = "xs:string" use = "required"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "single-page-master-reference">
+    <complexType>
+      <attribute name = "master-reference" type = "xs:string" use = "required"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "repeatable-page-master-reference">
+    <complexType>
+      <attribute name = "master-reference" type = "xs:string" use = "required"/>
+      <attribute name = "maximum-repeats" type = "fo:integer_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "repeatable-page-master-alternatives">
+    <complexType>
+      <sequence>
+        <element ref = "fo:conditional-page-master-reference" maxOccurs = "unbounded"/>
+      </sequence>
+      <attribute name = "maximum-repeats" type = "fo:integer_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "conditional-page-master-reference">
+    <complexType>
+      <attribute name = "master-reference" type = "xs:string" use = "required"/>
+      <attribute name = "page-position" type = "fo:page_position_Type"/>
+      <attribute name = "odd-or-even" type = "fo:odd_or_even_Type"/>
+      <attribute name = "blank-or-not-blank" type = "fo:blank_or_not_blank_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "simple-page-master">
+    <complexType>
+      <sequence>
+        <element ref = "fo:region-body"/>
+        <element ref = "fo:region-before" minOccurs = "0"/>
+        <element ref = "fo:region-after" minOccurs = "0"/>
+        <element ref = "fo:region-start" minOccurs = "0"/>
+        <element ref = "fo:region-end" minOccurs = "0"/>
+      </sequence>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attribute name = "master-name" type = "xs:string" use = "required"/>
+      <attribute name = "page-height" type = "fo:length_Type"/>
+      <attribute name = "page-width" type = "fo:length_Type"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "region-body">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "display-align" type = "fo:display_align_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "column-count" type = "fo:integer_Type"/>
+      <attribute name = "column-gap" type = "fo:length_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "region-name" type = "xs:string"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "region-before">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "display-align" type = "fo:display_align_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "extent" type = "fo:extent_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "precedence" type = "fo:precedence_Type"/>
+      <attribute name = "region-name" type = "xs:string"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "region-after">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "display-align" type = "fo:display_align_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "extent" type = "fo:extent_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "precedence" type = "fo:precedence_Type"/>
+      <attribute name = "region-name" type = "xs:string"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "region-start">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "display-align" type = "fo:display_align_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "extent" type = "fo:extent_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "precedence" type = "fo:precedence_Type"/>
+      <attribute name = "region-name" type = "xs:string"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "region-end">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "display-align" type = "fo:display_align_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "extent" type = "fo:extent_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "precedence" type = "fo:precedence_Type"/>
+      <attribute name = "region-name" type = "xs:string"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "page-sequence">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "country" type = "fo:country_Type"/>
+          <attribute name = "language" type = "fo:language_Type"/>
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:title" minOccurs = "0"/>
+        <element ref = "fo:static-content" minOccurs = "0" maxOccurs = "unbounded"/>
+        <element ref = "fo:flow"/>
+      </sequence>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "master-reference" type = "xs:string" use = "required"/>
+      <attribute name = "initial-page-number" type = "fo:integer_Type"/>
+      <attribute name = "force-page-count" type = "fo:force_page_count_Type"/>
+      <attribute name = "format" type = "xs:string"/>
+      <attribute name = "letter-value" type = "fo:letter_value_Type"/>
+      <attribute name = "grouping-separator" type = "fo:character_Type"/>
+      <attribute name = "grouping-size" type = "fo:integer_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "title">
+    <complexType mixed = "true">
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "color" type = "fo:color_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "visibility" type = "fo:visibility_Type"/>
+        </documentation>
+      </annotation>
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:neutral_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "static-content">
+    <complexType>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attribute name = "flow-name" type = "xs:string" use = "required"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "flow">
+    <complexType>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attribute name = "flow-name" type = "xs:string" use = "required"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "block">
+    <complexType mixed = "true">
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "color" type = "fo:color_Type"/>
+          <attribute name = "last-line-end-indent" type = "fo:last_line_end_indent_Type"/>
+          <attribute name = "linefeed-treatment" type = "fo:linefeed_treatment_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "orphans" type = "fo:orphans_Type"/>
+          <attribute name = "white-space-treatment" type = "fo:white_space_treatment_Type"/>
+          <attribute name = "text-align" type = "fo:text_align_Type"/>
+          <attribute name = "text-align-last" type = "fo:text_align_last_Type"/>
+          <attribute name = "text-indent" type = "fo:length_percentage_Type"/>
+          <attribute name = "visibility" type = "fo:visibility_Type"/>
+          <attribute name = "white-space-collapse" type = "fo:white_space_collapse_Type"/>
+          <attribute name = "widows" type = "fo:widows_Type"/>
+          <attribute name = "wrap-option" type = "fo:wrap_option_Type"/>
+        </documentation>
+      </annotation>
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:initial_property_set_List"/>
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:block_properties"/>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Hyphenation_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attributeGroup ref = "fo:text_one_Properties_List"/>
+      <attributeGroup ref = "fo:block_hyphenation_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attributeGroup ref = "fo:line_height_Properties_List"/>
+      <attribute name = "span" type = "fo:span_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "block-container">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "display-align" type = "fo:display_align_Type"/>
+        </documentation>
+      </annotation>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:block_properties"/>
+      <attributeGroup ref = "fo:Absolute_Position_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attribute name = "span" type = "fo:span_Type"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attribute name = "z-index" type = "fo:z_index_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "bidi-override">
+    <complexType mixed = "true">
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "color" type = "fo:color_Type"/>
+          <attribute name = "direction" type = "fo:direction_Type"/>
+          <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "score-spaces" type = "fo:score_spaces_Type"/>
+          <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/>
+        </documentation>
+      </annotation>
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "unicode-bidi" type = "fo:unicode_bidi_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "character">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "color" type = "fo:color_Type"/>
+          <attribute name = "glyph-orientation-horizontal" type = "fo:orientation_Type"/>
+          <attribute name = "glyph-orientation-vertical" type = "fo:orientation_Type"/>
+          <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "score-spaces" type = "fo:score_spaces_Type"/>
+          <attribute name = "text-transform" type = "fo:text_transform_Type"/>
+          <attribute name = "visibility" type = "fo:visibility_Type"/>
+          <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Hyphenation_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "treat-as-word-space" type = "fo:treat_as_word_space_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attribute name = "character" type = "fo:character_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attributeGroup ref = "fo:text_one_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+      <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+      <attribute name = "suppress-at-line-break" type = "fo:suppress_at_line_break_Type"/>
+      <attribute name = "text-decoration" type = "fo:text_decoration_Type"/>
+      <attribute name = "text-shadow" type = "fo:text_shadow_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "initial-property-set">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "color" type = "fo:color_Type"/>
+          <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "score-spaces" type = "fo:score_spaces_Type"/>
+          <attribute name = "text-transform" type = "fo:text_transform_Type"/>
+          <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "text-decoration" type = "fo:text_decoration_Type"/>
+      <attribute name = "text-shadow" type = "fo:text_shadow_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "external-graphic">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "display-align" type = "fo:display_align_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "text-align" type = "fo:text_align_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "content-height" type = "fo:content_height_Type"/>
+      <attribute name = "content-type" type = "xs:string"/>
+      <attribute name = "content-width" type = "fo:content_height_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+      <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "scaling" type = "fo:scaling_Type"/>
+      <attribute name = "scaling-method" type = "fo:scaling_method_Type"/>
+      <attribute name = "src" type = "xs:string" use = "required"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "instream-foreign-object">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "display-align" type = "fo:display_align_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "text-align" type = "fo:text_align_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "content-height" type = "fo:content_height_Type"/>
+      <attribute name = "content-type" type = "xs:string"/>
+      <attribute name = "content-width" type = "fo:content_height_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+      <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "scaling" type = "fo:scaling_Type"/>
+      <attribute name = "scaling-method" type = "fo:scaling_method_Type"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "inline">
+    <complexType mixed = "true">
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "color" type = "fo:color_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "visibility" type = "fo:visibility_Type"/>
+          <attribute name = "wrap-option" type = "fo:wrap_option_Type"/>
+        </documentation>
+      </annotation>
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List">
+        <annotation>
+          <documentation>
+            <fop_result>Border and background properties not implemented</fop_result>
+          </documentation>
+        </annotation>
+      </attributeGroup>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attribute name = "text-decoration" type = "fo:text_decoration_Type"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "inline-container">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "display-align" type = "fo:display_align_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+        </documentation>
+      </annotation>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "leader">
+    <complexType mixed = "true">
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "color" type = "fo:color_Type"/>
+          <attribute name = "leader-alignment" type = "fo:leader_alignment_Type"/>
+          <attribute name = "leader-length" type = "fo:leader_length_Type"/>
+          <attribute name = "leader-length.minimum" type = "fo:length_Type"/>
+          <attribute name = "leader-length.optimum" type = "fo:length_Type"/>
+          <attribute name = "leader-length.maximum" type = "fo:length_Type"/>
+          <attribute name = "leader-pattern" type = "fo:leader_pattern_Type"/>
+          <attribute name = "leader-pattern-width" type = "fo:leader_pattern_width_Type"/>
+          <attribute name = "rule-style" type = "fo:rule_style_Type"/>
+          <attribute name = "rule-thickness" type = "fo:length_Type"/>
+          <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "visibility" type = "fo:visibility_Type"/>
+          <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/>
+        </documentation>
+      </annotation>
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:neutral_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attributeGroup ref = "fo:text_one_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+      <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+      <attribute name = "text-shadow" type = "fo:text_shadow_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "page-number">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "score-spaces" type = "fo:score_spaces_Type"/>
+          <attribute name = "text-transform" type = "fo:text_transform_Type"/>
+          <attribute name = "visibility" type = "fo:visibility_Type"/>
+          <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/>
+          <attribute name = "wrap-option" type = "fo:wrap_option_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+      <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+      <attributeGroup ref = "fo:text_one_Properties_List"/>
+      <attribute name = "text-decoration" type = "fo:text_decoration_Type"/>
+      <attribute name = "text-shadow" type = "fo:text_shadow_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "page-number-citation">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "score-spaces" type = "fo:score_spaces_Type"/>
+          <attribute name = "text-transform" type = "fo:text_transform_Type"/>
+          <attribute name = "visibility" type = "fo:visibility_Type"/>
+          <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/>
+          <attribute name = "wrap-option" type = "fo:wrap_option_Type"/>
+        </documentation>
+      </annotation>
+      <attribute name = "ref-id" type = "xs:string" use = "required"/>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+      <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+      <attributeGroup ref = "fo:text_one_Properties_List"/>
+      <attribute name = "text-decoration" type = "fo:text_decoration_Type"/>
+      <attribute name = "text-shadow" type = "fo:text_shadow_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "table-and-caption">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "caption-side" type = "fo:caption_side_Type"/>
+          <attribute name = "text-align" type = "fo:text_align_Type"/>
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:table-caption" minOccurs = "0"/>
+        <element ref = "fo:table"/>
+      </sequence>
+      <attributeGroup ref = "fo:block_properties"/>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table-caption">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "keep-together" type = "fo:keep_compound_Type"/>
+          <attribute name = "keep-together.within-line" type = "fo:keep_integer_Type"/>
+          <attribute name = "keep-together.within-column" type = "fo:keep_integer_Type"/>
+          <attribute name = "keep-together.within-page" type = "fo:keep_integer_Type"/>
+        </documentation>
+      </annotation>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "border-collapse" type = "fo:border_collapse_Type"/>
+          <attribute name = "border-separation" type = "fo:length_bp_ip_direction_Type"/>
+          <attribute name = "border-spacing" type = "fo:length_Type"/>
+          <attribute name = "writing-mode" type = "fo:writing_mode_Type"/>
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:table-column" minOccurs = "0" maxOccurs = "unbounded"/>
+        <element ref = "fo:table-header" minOccurs = "0"/>
+        <element ref = "fo:table-footer" minOccurs = "0"/>
+        <element ref = "fo:table-body" maxOccurs = "unbounded"/>
+      </sequence>
+      <attributeGroup ref = "fo:block_properties"/>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attribute name = "table-layout" type = "fo:table_layout_Type"/>
+      <attribute name = "table-omit-footer-at-break" type = "fo:table_omit_footer_at_break_Type"/>
+      <attribute name = "table-omit-header-at-break" type = "fo:table_omit_header_at_break_Type"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table-column">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "visibility" type = "fo:visibility_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Border_Properties_List"/>
+      <attributeGroup ref = "fo:Background_Properties_List"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "column-number" type = "fo:integer_Type"/>
+      <attribute name = "column-width" type = "fo:column_width_Type"/>
+      <attribute name = "number-columns-repeated" type = "fo:integer_Type"/>
+      <attribute name = "number-columns-spanned" type = "fo:integer_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table-header">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "visibility" type = "fo:visibility_Type"/>
+        </documentation>
+      </annotation>
+      <choice>
+        <element ref = "fo:table-row" maxOccurs = "unbounded"/>
+        <element ref = "fo:table-cell" maxOccurs = "unbounded"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Properties_List"/>
+      <attributeGroup ref = "fo:Background_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table-footer">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "visibility" type = "fo:visibility_Type"/>
+        </documentation>
+      </annotation>
+      <choice>
+        <element ref = "fo:table-row" maxOccurs = "unbounded"/>
+        <element ref = "fo:table-cell" maxOccurs = "unbounded"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Properties_List"/>
+      <attributeGroup ref = "fo:Background_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table-body">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "visibility" type = "fo:visibility_Type"/>
+        </documentation>
+      </annotation>
+      <choice>
+        <element ref = "fo:table-row" maxOccurs = "unbounded"/>
+        <element ref = "fo:table-cell" maxOccurs = "unbounded"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Properties_List"/>
+      <attributeGroup ref = "fo:Background_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table-row">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "visibility" type = "fo:visibility_Type"/>
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:table-cell" maxOccurs = "unbounded"/>
+      </sequence>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Properties_List"/>
+      <attributeGroup ref = "fo:Background_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "block-progression-dimension" type = "fo:margin_width_Type"/>
+      <attribute name = "block-progression-dimension.minimum" type = "fo:length_Type"/>
+      <attribute name = "block-progression-dimension.optimum" type = "fo:block_progression_dimension_optimum_Type"/>
+      <attribute name = "block-progression-dimension.maximum" type = "fo:block_progression_dimension_maximum_Type"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "page-break-after"  type = "fo:page_break_after_Type"/>
+      <attribute name = "page-break-before" type = "fo:page_break_after_Type"/>
+    </complexType>
+  </element>
+  <element name = "table-cell">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "display-align" type = "fo:display_align_Type"/>
+          <attribute name = "relative-align" type = "fo:relative_align_Type"/>
+          <attribute name = "empty-cells" type = "fo:empty_cells_Type"/>
+        </documentation>
+      </annotation>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attribute name = "column-number" type = "fo:integer_Type"/>
+      <attribute name = "ends-row" type = "fo:ends_row_Type"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "number-columns-spanned" type = "fo:integer_Type"/>
+      <attribute name = "number-rows-spanned" type = "fo:integer_Type"/>
+      <attribute name = "starts-row" type = "fo:starts_row_Type"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "list-block">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "provisional-distance-between-starts" type = "fo:provisional_distance_between_starts_Type"/>
+          <attribute name = "provisional-label-separation" type = "fo:provisional_label_separation_Type"/>
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:list-item" maxOccurs = "unbounded"/>
+      </sequence>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attributeGroup ref = "fo:list_properties"/>
+    </complexType>
+  </element>
+  <element name = "list-item">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "relative-align" type = "fo:relative_align_Type"/>
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:list-item-label"/>
+        <element ref = "fo:list-item-body"/>
+      </sequence>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attributeGroup ref = "fo:list_properties"/>
+    </complexType>
+  </element>
+  <element name = "list-item-body">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "keep-together" type = "fo:keep_compound_Type"/>
+          <attribute name = "keep-together.within-line" type = "fo:keep_integer_Type"/>
+          <attribute name = "keep-together.within-column" type = "fo:keep_integer_Type"/>
+          <attribute name = "keep-together.within-page" type = "fo:keep_integer_Type"/>
+        </documentation>
+      </annotation>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attributeGroup ref = "fo:list_properties"/>
+    </complexType>
+  </element>
+  <element name = "list-item-label">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "keep-together" type = "fo:keep_compound_Type"/>
+          <attribute name = "keep-together.within-line" type = "fo:keep_integer_Type"/>
+          <attribute name = "keep-together.within-column" type = "fo:keep_integer_Type"/>
+          <attribute name = "keep-together.within-page" type = "fo:keep_integer_Type"/>
+        </documentation>
+      </annotation>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attributeGroup ref = "fo:list_properties"/>
+    </complexType>
+  </element>
+  <element name = "float">
+    <complexType>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attribute name = "float" type = "fo:float_Type"/>
+      <attribute name = "clear" type = "fo:clear_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "footnote">
+    <complexType>
+      <sequence>
+        <element ref = "fo:inline"/>
+        <element ref = "fo:footnote-body"/>
+      </sequence>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "footnote-body">
+    <complexType>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "basic-link">
+    <complexType mixed = "true">
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "line-height" type = "fo:line_height_Type"/>
+        </documentation>
+      </annotation>
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attribute name = "destination-placement-offset" type = "fo:length_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "external-destination" type = "xs:string"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "indicate-destination" type = "fo:indicate_destination_Type"/>
+      <attribute name = "internal-destination" type = "xs:string"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attribute name = "show-destination" type = "fo:show_destination_Type"/>
+      <attribute name = "target-processing-context" type = "xs:string"/>
+      <attribute name = "target-presentation-context" type = "xs:string"/>
+      <attribute name = "target-stylesheet" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "wrapper">
+    <complexType mixed = "true">
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "marker">
+    <complexType mixed = "true">
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+      </choice>
+      <attribute name = "marker-class-name" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "retrieve-marker">
+    <complexType>
+      <attribute name = "retrieve-class-name" type = "xs:string"/>
+      <attribute name = "retrieve-position" type = "fo:retrieve_position_Type"/>
+      <attribute name = "retrieve-boundary" type = "fo:retrieve_boundary_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "multi-switch">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "auto-restore" type = "fo:auto_restore_Type"/>
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:multi-case"/>
+      </sequence>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "multi-case">
+    <complexType mixed = "true">
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "starting-state" type = "fo:starting_state_Type"/>
+      <attribute name = "case-name" type = "xs:string"/>
+      <attribute name = "case-title" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "multi-toggle">
+    <complexType mixed = "true">
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "switch-to" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "multi-properties">
+    <complexType>
+      <sequence>
+        <element ref = "fo:multi-property-set" maxOccurs = "unbounded"/>
+        <element ref = "fo:wrapper"/>
+      </sequence>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "multi-property-set">
+    <complexType>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "active-state" type = "fo:active_state_Type" use = "required"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+</schema>
diff --git a/xml/tests/testData/xml/hibernate-configuration-3.0.dtd b/xml/tests/testData/xml/hibernate-configuration-3.0.dtd
new file mode 100644
index 0000000..a22cd7b
--- /dev/null
+++ b/xml/tests/testData/xml/hibernate-configuration-3.0.dtd
@@ -0,0 +1,52 @@
+<!-- Hibernate file-based configuration document.
+
+<!DOCTYPE hibernate-configuration PUBLIC
+	"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+	"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+An instance of this document contains property settings and references
+to mapping files for a number of SessionFactory instances to be listed
+in JNDI.
+
+-->
+
+<!ELEMENT hibernate-configuration (session-factory,security?)>
+
+<!ELEMENT property (#PCDATA)>
+<!ATTLIST property name CDATA #REQUIRED>
+
+<!ELEMENT mapping EMPTY> <!-- reference to a mapping file -->
+<!ATTLIST mapping resource CDATA #IMPLIED>
+<!ATTLIST mapping file CDATA #IMPLIED>
+<!ATTLIST mapping jar CDATA #IMPLIED>
+<!ATTLIST mapping package CDATA #IMPLIED>
+<!ATTLIST mapping class CDATA #IMPLIED>
+
+<!ELEMENT class-cache EMPTY>
+<!ATTLIST class-cache class CDATA #REQUIRED>
+<!ATTLIST class-cache region CDATA #IMPLIED>
+<!ATTLIST class-cache usage (read-only|read-write|nonstrict-read-write|transactional) #REQUIRED>
+<!ATTLIST class-cache include (all|non-lazy) "all">
+
+<!ELEMENT collection-cache EMPTY>
+<!ATTLIST collection-cache collection CDATA #REQUIRED>
+<!ATTLIST collection-cache region CDATA #IMPLIED>
+<!ATTLIST collection-cache usage (read-only|read-write|nonstrict-read-write|transactional) #REQUIRED>
+
+<!ELEMENT event (listener*)>
+<!ATTLIST event type (auto-flush|merge|create|create-onflush|delete|dirty-check|evict|flush|flush-entity|load|load-collection|lock|refresh|replicate|save-update|save|update|pre-load|pre-update|pre-insert|pre-delete|post-load|post-update|post-insert|post-delete|post-commit-update|post-commit-insert|post-commit-delete) #REQUIRED>
+
+<!ELEMENT listener EMPTY>
+<!ATTLIST listener type (auto-flush|merge|create|create-onflush|delete|dirty-check|evict|flush|flush-entity|load|load-collection|lock|refresh|replicate|save-update|save|update|pre-load|pre-update|pre-insert|pre-delete|post-load|post-update|post-insert|post-delete|post-commit-update|post-commit-insert|post-commit-delete) #IMPLIED>
+<!ATTLIST listener class CDATA #REQUIRED>
+
+<!ELEMENT session-factory (property*, mapping*, (class-cache|collection-cache)*, event*, listener*)>
+<!ATTLIST session-factory name CDATA #IMPLIED> <!-- the JNDI name -->
+
+<!ELEMENT security (grant*)>
+<!ATTLIST security context CDATA #REQUIRED> <!--the JACC contextID-->
+
+<!ELEMENT grant EMPTY>
+<!ATTLIST grant role CDATA #REQUIRED>
+<!ATTLIST grant entity-name CDATA #REQUIRED>
+<!ATTLIST grant actions CDATA #REQUIRED>
diff --git a/xml/tests/testData/xml/hibernate-mapping-3.0.dtd b/xml/tests/testData/xml/hibernate-mapping-3.0.dtd
new file mode 100644
index 0000000..de7bf3d
--- /dev/null
+++ b/xml/tests/testData/xml/hibernate-mapping-3.0.dtd
@@ -0,0 +1,1036 @@
+<!-- Hibernate Mapping DTD.
+
+<!DOCTYPE hibernate-mapping PUBLIC 
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+An instance of this XML document may contain mappings for an arbitrary 
+number of classes. The class mappings may contain associations to classes
+mapped in the same document or in another document. No class may be 
+mapped more than once. Each document may also contain definitions of an
+arbitrary number of queries, and import declarations of arbitrary classes. 
+
+-->
+
+<!--
+	The document root.
+ -->
+
+<!ELEMENT hibernate-mapping (
+	meta*, 
+	typedef*, 
+	import*, 
+	(class|subclass|joined-subclass|union-subclass)*,
+    resultset*,
+	(query|sql-query)*,
+	filter-def*,
+    database-object*
+)>
+	<!ATTLIST hibernate-mapping schema CDATA #IMPLIED>									<!-- default: none -->
+	<!ATTLIST hibernate-mapping catalog CDATA #IMPLIED>									<!-- default: none -->
+	<!ATTLIST hibernate-mapping default-cascade CDATA "none">
+	<!ATTLIST hibernate-mapping default-access CDATA "property">
+	<!ATTLIST hibernate-mapping default-lazy (true|false) "true">
+	<!ATTLIST hibernate-mapping auto-import (true|false) "true">
+	<!ATTLIST hibernate-mapping package CDATA #IMPLIED>									<!-- default: none -->
+
+<!--
+	META element definition; used to assign meta-level attributes to a class
+	or property.  Is currently used by codegenerator as a placeholder for
+	values that is not directly related to OR mappings.
+-->
+<!ELEMENT meta (#PCDATA)>
+	<!ATTLIST meta attribute CDATA #REQUIRED>
+	<!ATTLIST meta inherit (true|false) "true">
+
+<!--
+	TYPEDEF element definition; defines a new name for a Hibernate type. May
+	contain parameters for parameterizable types.
+-->
+<!ELEMENT typedef (param*)>
+	<!ATTLIST typedef class CDATA #REQUIRED>
+	<!ATTLIST typedef name CDATA #REQUIRED>
+
+<!--
+	IMPORT element definition; an explicit query language "import"
+-->
+<!ELEMENT import EMPTY>
+	<!ATTLIST import class CDATA #REQUIRED>
+	<!ATTLIST import rename CDATA #IMPLIED>	<!-- default: unqualified class name -->
+
+<!--
+	Root entity mapping.  Poorly named as entities do not have to be represented by 
+	classes at all.  Mapped entities may be represented via different methodologies 
+	(POJO, Map, Dom4j).
+-->
+<!ELEMENT class (
+ 	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+    tuplizer*,
+	(id|composite-id),
+	discriminator?,
+	natural-id?,
+	(version|timestamp)?,
+	(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,
+	((join*,subclass*)|joined-subclass*|union-subclass*),
+	loader?,sql-insert?,sql-update?,sql-delete?,
+	filter*,
+    resultset*,
+	(query|sql-query)*
+)>
+	<!ATTLIST class entity-name CDATA #IMPLIED>
+	<!ATTLIST class name CDATA #IMPLIED>                            <!-- this is the class name -->
+	<!ATTLIST class proxy CDATA #IMPLIED>							<!-- default: no proxy interface -->
+	<!ATTLIST class lazy (true|false) #IMPLIED>
+	<!ATTLIST class table CDATA #IMPLIED>							<!-- default: unqualified classname -->
+	<!ATTLIST class schema CDATA #IMPLIED>							<!-- default: none -->
+	<!ATTLIST class catalog CDATA #IMPLIED>							<!-- default: none -->
+	<!ATTLIST class subselect CDATA #IMPLIED>
+	<!ATTLIST class discriminator-value CDATA #IMPLIED>				<!-- default: unqualified class name | none -->
+	<!ATTLIST class mutable (true|false) "true">
+	<!ATTLIST class abstract (true|false) #IMPLIED>
+	<!ATTLIST class polymorphism (implicit|explicit) "implicit">
+	<!ATTLIST class where CDATA #IMPLIED>							<!-- default: none -->
+	<!ATTLIST class persister CDATA #IMPLIED>
+	<!ATTLIST class dynamic-update (true|false) "false">
+	<!ATTLIST class dynamic-insert (true|false) "false">
+	<!ATTLIST class batch-size CDATA #IMPLIED>
+	<!ATTLIST class select-before-update (true|false) "false">
+	<!ATTLIST class optimistic-lock (none|version|dirty|all) "version">
+	<!ATTLIST class check CDATA #IMPLIED>							<!-- default: none -->
+	<!ATTLIST class rowid CDATA #IMPLIED>
+	<!ATTLIST class node CDATA #IMPLIED>
+
+<!--
+    TUPLIZER element; defines tuplizer to use for a component/entity for a given entity-mode
+-->
+<!ELEMENT tuplizer EMPTY>
+    <!ATTLIST tuplizer entity-mode (pojo|dom4j|dynamic-map) #IMPLIED>   <!-- entity mode for which tuplizer is in effect -->
+    <!ATTLIST tuplizer class CDATA #REQUIRED>                           <!-- the tuplizer class to use -->
+
+<!--
+	FILTER-DEF element; top-level filter definition.
+-->
+<!ELEMENT filter-def (#PCDATA|filter-param)*>
+	<!ATTLIST filter-def name CDATA #REQUIRED> <!-- The filter name -->
+	<!ATTLIST filter-def condition CDATA #IMPLIED>
+
+<!--
+	FILTER-PARAM element; qualifies parameters found within a FILTER-DEF
+	condition.
+-->
+<!ELEMENT filter-param EMPTY>
+	<!ATTLIST filter-param name CDATA #REQUIRED> <!-- The parameter name -->
+	<!ATTLIST filter-param type CDATA #REQUIRED> <!-- The parameter type -->
+
+<!--
+	FILTER element; used to apply a filter.
+-->
+<!ELEMENT filter (#PCDATA)>
+	<!ATTLIST filter name CDATA #REQUIRED>
+	<!ATTLIST filter condition CDATA #IMPLIED>
+
+
+<!-- A join allows some properties of a class to be persisted to a second table -->
+
+<!ELEMENT join ( 
+	subselect?,
+	comment?,
+	key,
+	(property|many-to-one|component|dynamic-component|any)*,
+	sql-insert?,sql-update?,sql-delete?
+)>
+	<!ATTLIST join table CDATA #REQUIRED>
+	<!ATTLIST join schema CDATA #IMPLIED>						<!-- default: none -->
+	<!ATTLIST join catalog CDATA #IMPLIED>						<!-- default: none -->
+	<!ATTLIST join subselect CDATA #IMPLIED>
+	<!ATTLIST join fetch (join|select) "join">
+	<!ATTLIST join inverse (true|false) "false">
+	<!ATTLIST join optional (true|false) "false">
+
+<!-- A natural-id element allows declaration of the unique business key -->
+
+<!ELEMENT natural-id ( (property|many-to-one|component|dynamic-component|any)* )>
+	<!ATTLIST natural-id mutable (true|false) "false">
+
+<!-- Declares the id type, column and generation algorithm for an entity class.
+If a name attribut is given, the id is exposed to the application through the 
+named property of the class. If not, the id is only exposed to the application 
+via Session.getIdentifier() -->
+
+<!ELEMENT id (meta*,column*,type?,generator?)>
+	<!ATTLIST id name CDATA #IMPLIED>
+	<!ATTLIST id node CDATA #IMPLIED>
+	<!ATTLIST id access CDATA #IMPLIED>
+	<!ATTLIST id column CDATA #IMPLIED>
+	<!ATTLIST id type CDATA #IMPLIED>
+	<!ATTLIST id length CDATA #IMPLIED>
+	<!ATTLIST id unsaved-value CDATA #IMPLIED>					<!-- any|none|null|undefined|0|-1|... -->
+
+<!-- A composite key may be modelled by a java class with a property for each 
+key column. The class must implement java.io.Serializable and reimplement equals() 
+and hashCode(). -->
+
+<!ELEMENT composite-id ( meta*, (key-property|key-many-to-one)+ )>
+	<!ATTLIST composite-id class CDATA #IMPLIED>
+	<!ATTLIST composite-id mapped (true|false) "false">
+	<!ATTLIST composite-id name CDATA #IMPLIED>
+	<!ATTLIST composite-id node CDATA #IMPLIED>
+	<!ATTLIST composite-id access CDATA #IMPLIED>
+	<!ATTLIST composite-id unsaved-value (undefined|any|none) "undefined"> 
+
+<!-- Polymorphic data requires a column holding a class discriminator value. This
+value is not directly exposed to the application. -->
+
+<!ELEMENT discriminator ((column|formula)?)>
+	<!ATTLIST discriminator column CDATA #IMPLIED>				<!-- default: "class"|none -->
+	<!ATTLIST discriminator formula CDATA #IMPLIED>
+	<!ATTLIST discriminator type CDATA "string">
+	<!ATTLIST discriminator not-null (true|false) "true">
+	<!ATTLIST discriminator length CDATA #IMPLIED>
+	<!ATTLIST discriminator force (true|false) "false">
+	<!ATTLIST discriminator insert (true|false) "true">
+	
+<!-- Versioned data requires a column holding a version number. This is exposed to the
+application through a property of the Java class. -->
+
+<!ELEMENT version (meta*,column*)>
+	<!ATTLIST version name CDATA #REQUIRED>
+	<!ATTLIST version node CDATA #IMPLIED>
+	<!ATTLIST version access CDATA #IMPLIED>
+	<!ATTLIST version column CDATA #IMPLIED>
+	<!ATTLIST version type CDATA "integer">
+	<!ATTLIST version unsaved-value (null|negative|undefined) "undefined">
+    <!ATTLIST version generated (never|always) "never">
+    <!ATTLIST version insert (true|false) #IMPLIED>
+
+<!ELEMENT timestamp (meta*)>
+	<!ATTLIST timestamp name CDATA #REQUIRED>
+	<!ATTLIST timestamp node CDATA #IMPLIED>
+	<!ATTLIST timestamp column CDATA #IMPLIED>
+	<!ATTLIST timestamp access CDATA #IMPLIED>
+	<!ATTLIST timestamp unsaved-value (null|undefined) "null">
+    <!ATTLIST timestamp source (vm|db) "vm">
+    <!ATTLIST timestamp generated (never|always) "never">
+
+
+<!--
+	Subclass declarations are nested beneath the root class declaration to achieve
+	polymorphic persistence with the table-per-hierarchy mapping strategy.
+
+	See the note on the class element regarding <pojo/> vs. @name usage...
+-->
+<!ELEMENT subclass (
+ 	meta*,
+    tuplizer*,
+	synchronize*,
+	(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|idbag|array|primitive-array)*,
+	join*, 
+	subclass*,
+	loader?,sql-insert?,sql-update?,sql-delete?,
+    resultset*,
+	(query|sql-query)*
+)>
+	<!ATTLIST subclass entity-name CDATA #IMPLIED>
+	<!ATTLIST subclass name CDATA #IMPLIED>
+	<!ATTLIST subclass proxy CDATA #IMPLIED>							<!-- default: no proxy interface -->
+	<!ATTLIST subclass discriminator-value CDATA #IMPLIED>				<!-- default: unqualified class name | none -->
+	<!ATTLIST subclass dynamic-update (true|false) "false">
+	<!ATTLIST subclass dynamic-insert (true|false) "false">
+	<!ATTLIST subclass select-before-update (true|false) "false">
+	<!ATTLIST subclass extends CDATA #IMPLIED>							<!-- default: empty when a toplevel, otherwise the nearest class definition -->
+	<!ATTLIST subclass lazy (true|false) #IMPLIED>
+	<!ATTLIST subclass abstract (true|false) #IMPLIED>
+	<!ATTLIST subclass persister CDATA #IMPLIED>
+	<!ATTLIST subclass batch-size CDATA #IMPLIED>
+	<!ATTLIST subclass node CDATA #IMPLIED>
+
+<!--
+	Joined subclasses are used for the normalized table-per-subclass mapping strategy
+
+	See the note on the class element regarding <pojo/> vs. @name usage...
+-->
+<!ELEMENT joined-subclass (
+	meta*,
+	subselect?,
+	synchronize*,
+	comment?,
+    tuplizer*,
+	key,
+	(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*, 
+	joined-subclass*,
+	loader?,sql-insert?,sql-update?,sql-delete?,
+    resultset*,
+	(query|sql-query)*
+)>
+	<!ATTLIST joined-subclass entity-name CDATA #IMPLIED>
+	<!ATTLIST joined-subclass name CDATA #IMPLIED>
+	<!ATTLIST joined-subclass proxy CDATA #IMPLIED>				 		<!-- default: no proxy interface -->
+	<!ATTLIST joined-subclass table CDATA #IMPLIED>				 		<!-- default: unqualified class name -->
+	<!ATTLIST joined-subclass schema CDATA #IMPLIED>
+	<!ATTLIST joined-subclass catalog CDATA #IMPLIED>
+	<!ATTLIST joined-subclass subselect CDATA #IMPLIED>
+	<!ATTLIST joined-subclass dynamic-update (true|false) "false">
+	<!ATTLIST joined-subclass dynamic-insert (true|false) "false">
+	<!ATTLIST joined-subclass select-before-update (true|false) "false">
+	<!ATTLIST joined-subclass extends CDATA #IMPLIED>			 		<!-- default: none when toplevel, otherwise the nearest class definition -->
+	<!ATTLIST joined-subclass lazy (true|false) #IMPLIED>
+	<!ATTLIST joined-subclass abstract (true|false) #IMPLIED>
+	<!ATTLIST joined-subclass persister CDATA #IMPLIED>
+	<!ATTLIST joined-subclass check CDATA #IMPLIED>				 		<!-- default: none -->
+	<!ATTLIST joined-subclass batch-size CDATA #IMPLIED>
+	<!ATTLIST joined-subclass node CDATA #IMPLIED>
+
+<!--
+	Union subclasses are used for the table-per-concrete-class mapping strategy
+
+	See the note on the class element regarding <pojo/> vs. @name usage...
+-->
+<!ELEMENT union-subclass (
+ 	meta*,
+	subselect?,
+	synchronize*,
+	comment?,
+    tuplizer*,
+	(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,
+	union-subclass*,
+	loader?,sql-insert?,sql-update?,sql-delete?,
+    resultset*,
+	(query|sql-query)*
+)>
+	<!ATTLIST union-subclass entity-name CDATA #IMPLIED>
+	<!ATTLIST union-subclass name CDATA #IMPLIED>
+	<!ATTLIST union-subclass proxy CDATA #IMPLIED>						<!-- default: no proxy interface -->
+	<!ATTLIST union-subclass table CDATA #IMPLIED>						<!-- default: unqualified class name -->
+	<!ATTLIST union-subclass schema CDATA #IMPLIED>
+	<!ATTLIST union-subclass catalog CDATA #IMPLIED>
+	<!ATTLIST union-subclass subselect CDATA #IMPLIED>
+	<!ATTLIST union-subclass dynamic-update (true|false) "false">
+	<!ATTLIST union-subclass dynamic-insert (true|false) "false">
+	<!ATTLIST union-subclass select-before-update (true|false) "false">
+	<!ATTLIST union-subclass extends CDATA #IMPLIED>					<!-- default: none when toplevel, otherwise the nearest class definition -->
+	<!ATTLIST union-subclass lazy (true|false) #IMPLIED>
+	<!ATTLIST union-subclass abstract (true|false) #IMPLIED>
+	<!ATTLIST union-subclass persister CDATA #IMPLIED>
+	<!ATTLIST union-subclass check CDATA #IMPLIED>						<!-- default: none -->
+	<!ATTLIST union-subclass batch-size CDATA #IMPLIED>
+	<!ATTLIST union-subclass node CDATA #IMPLIED>
+
+<!-- Property of an entity class or component, component-element, composite-id, etc. 
+JavaBeans style properties are mapped to table columns. -->
+
+<!ELEMENT property (meta*,(column|formula)*,type?)>
+	<!ATTLIST property name CDATA #REQUIRED>
+	<!ATTLIST property node CDATA #IMPLIED>
+	<!ATTLIST property access CDATA #IMPLIED>
+	<!ATTLIST property type CDATA #IMPLIED>
+	<!ATTLIST property column CDATA #IMPLIED>
+	<!ATTLIST property length CDATA #IMPLIED>
+	<!ATTLIST property precision CDATA #IMPLIED>
+	<!ATTLIST property scale CDATA #IMPLIED>
+	<!ATTLIST property not-null (true|false) #IMPLIED>
+	<!ATTLIST property unique (true|false) "false">
+	<!ATTLIST property unique-key CDATA #IMPLIED>
+	<!ATTLIST property index CDATA #IMPLIED>				<!-- include the columns spanned by this property in an index -->
+	<!ATTLIST property update (true|false) #IMPLIED>
+	<!ATTLIST property insert (true|false) #IMPLIED>
+	<!ATTLIST property optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST property formula CDATA #IMPLIED>
+	<!ATTLIST property lazy (true|false) "false">
+    <!ATTLIST property generated (never|insert|always) "never">
+
+<!-- Declares the type of the containing property (overrides an eventually existing type
+attribute of the property). May contain param elements to customize a ParametrizableType. -->
+<!ELEMENT type (param*)>
+	<!ATTLIST type name CDATA #REQUIRED>
+	
+<!-- Declares an association between two entities (Or from a component, component element,
+etc. to an entity). -->
+
+<!ELEMENT many-to-one (meta*,(column|formula)*)>
+	<!ATTLIST many-to-one name CDATA #REQUIRED>
+	<!ATTLIST many-to-one access CDATA #IMPLIED>
+	<!ATTLIST many-to-one class CDATA #IMPLIED>
+	<!ATTLIST many-to-one entity-name CDATA #IMPLIED>
+	<!ATTLIST many-to-one column CDATA #IMPLIED>
+	<!ATTLIST many-to-one not-null (true|false) #IMPLIED>
+	<!ATTLIST many-to-one unique (true|false) "false">
+	<!ATTLIST many-to-one unique-key CDATA #IMPLIED>
+	<!ATTLIST many-to-one index CDATA #IMPLIED>
+	<!ATTLIST many-to-one cascade CDATA #IMPLIED>
+	<!ATTLIST many-to-one outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST many-to-one fetch (join|select) #IMPLIED>
+	<!ATTLIST many-to-one update (true|false) "true">
+	<!ATTLIST many-to-one insert (true|false) "true">
+	<!ATTLIST many-to-one optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST many-to-one foreign-key CDATA #IMPLIED>
+	<!ATTLIST many-to-one property-ref CDATA #IMPLIED>
+	<!ATTLIST many-to-one formula CDATA #IMPLIED>
+	<!ATTLIST many-to-one lazy (false|proxy|no-proxy) #IMPLIED>
+	<!ATTLIST many-to-one not-found (exception|ignore) "exception">
+	<!ATTLIST many-to-one node CDATA #IMPLIED>
+	<!ATTLIST many-to-one embed-xml (true|false) "true">
+	
+<!-- Declares a one-to-one association between two entities (Or from a component, 
+component element, etc. to an entity). -->
+
+<!ELEMENT one-to-one (meta*,formula*)>
+	<!ATTLIST one-to-one name CDATA #REQUIRED>
+	<!ATTLIST one-to-one formula CDATA #IMPLIED>
+	<!ATTLIST one-to-one access CDATA #IMPLIED>
+	<!ATTLIST one-to-one class CDATA #IMPLIED>
+	<!ATTLIST one-to-one entity-name CDATA #IMPLIED>
+	<!ATTLIST one-to-one cascade CDATA #IMPLIED>
+	<!ATTLIST one-to-one outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST one-to-one fetch (join|select) #IMPLIED>
+	<!ATTLIST one-to-one constrained (true|false) "false">
+	<!ATTLIST one-to-one foreign-key CDATA #IMPLIED>
+	<!ATTLIST one-to-one property-ref CDATA #IMPLIED>
+	<!ATTLIST one-to-one lazy (false|proxy|no-proxy) #IMPLIED>
+	<!ATTLIST one-to-one node CDATA #IMPLIED>
+	<!ATTLIST one-to-one embed-xml (true|false) "true">
+	
+<!-- A property embedded in a composite identifier or map index (always not-null). -->
+
+<!ELEMENT key-property (meta*,column*,type?)>
+	<!ATTLIST key-property name CDATA #REQUIRED>
+	<!ATTLIST key-property access CDATA #IMPLIED>
+	<!ATTLIST key-property type CDATA #IMPLIED>
+	<!ATTLIST key-property column CDATA #IMPLIED>
+	<!ATTLIST key-property length CDATA #IMPLIED>
+	<!ATTLIST key-property node CDATA #IMPLIED>
+
+<!-- A many-to-one association embedded in a composite identifier or map index 
+(always not-null, never cascade). -->
+
+<!ELEMENT key-many-to-one (meta*,column*)>
+	<!ATTLIST key-many-to-one name CDATA #REQUIRED>
+	<!ATTLIST key-many-to-one access CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one class CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one entity-name CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one column CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one foreign-key CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one lazy (false|proxy) #IMPLIED>
+
+<!-- An "any" association is a polymorphic association to any table with
+the given identifier type. The first listed column is a VARCHAR column 
+holding the name of the class (for that row). -->
+
+<!ELEMENT any (meta*,meta-value*,column,column+)>
+	<!ATTLIST any id-type CDATA #REQUIRED>
+	<!ATTLIST any meta-type CDATA #IMPLIED>			 	<!--- default: Hibernate.STRING -->
+	<!ATTLIST any name CDATA #REQUIRED>
+	<!ATTLIST any access CDATA #IMPLIED>
+	<!ATTLIST any insert (true|false) "true">
+	<!ATTLIST any update (true|false) "true">
+	<!ATTLIST any cascade CDATA #IMPLIED>
+	<!ATTLIST any index CDATA #IMPLIED>					<!-- include the columns spanned by this association in an index -->
+	<!ATTLIST any optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST any lazy (true|false) "false">
+	<!ATTLIST any node CDATA #IMPLIED>
+	
+<!ELEMENT meta-value EMPTY>
+	<!ATTLIST meta-value value CDATA #REQUIRED>
+	<!ATTLIST meta-value class CDATA #REQUIRED>
+
+<!-- A component is a user-defined class, persisted along with its containing entity
+to the table of the entity class. JavaBeans style properties of the component are
+mapped to columns of the table of the containing entity. A null component reference
+is mapped to null values in all columns and vice versa. Components do not support
+shared reference semantics. -->
+
+<!ELEMENT component (
+	meta*,
+    tuplizer*,
+	parent?,
+	(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|array|primitive-array)*
+)>
+	<!ATTLIST component class CDATA #IMPLIED>
+	<!ATTLIST component name CDATA #REQUIRED>
+	<!ATTLIST component access CDATA #IMPLIED>
+	<!ATTLIST component unique (true|false) "false">
+	<!ATTLIST component update (true|false) "true">
+	<!ATTLIST component insert (true|false) "true">
+	<!ATTLIST component lazy (true|false) "false">
+	<!ATTLIST component optimistic-lock (true|false) "true">
+	<!ATTLIST component node CDATA #IMPLIED>
+	
+<!-- A dynamic-component maps columns of the database entity to a java.util.Map 
+at the Java level -->
+
+<!ELEMENT dynamic-component (
+	(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|array|primitive-array)*
+)>
+	<!ATTLIST dynamic-component name CDATA #REQUIRED>
+	<!ATTLIST dynamic-component access CDATA #IMPLIED>
+	<!ATTLIST dynamic-component unique (true|false) "false">
+	<!ATTLIST dynamic-component update (true|false) "true">
+	<!ATTLIST dynamic-component insert (true|false) "true">
+	<!ATTLIST dynamic-component optimistic-lock (true|false) "true">
+	<!ATTLIST dynamic-component node CDATA #IMPLIED>
+
+<!-- properties declares that the contained properties form an alternate key. The name
+attribute allows an alternate key to be used as the target of a property-ref. -->
+
+<!ELEMENT properties (
+	(property|many-to-one|component|dynamic-component)*
+)>
+	<!ATTLIST properties name CDATA #REQUIRED>
+	<!ATTLIST properties unique (true|false) "false">
+	<!ATTLIST properties insert (true|false) "true">
+	<!ATTLIST properties update (true|false) "true">
+	<!ATTLIST properties optimistic-lock (true|false) "true">
+	<!ATTLIST properties node CDATA #IMPLIED>
+	
+<!-- The parent element maps a property of the component class as a pointer back to
+the owning entity. -->
+
+<!ELEMENT parent EMPTY>
+	<!ATTLIST parent name CDATA #REQUIRED>
+
+<!-- Collection declarations nested inside a class declaration indicate a foreign key 
+relationship from the collection table to the enclosing class. -->
+
+<!ELEMENT map (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+	key, 
+	(map-key|composite-map-key|map-key-many-to-many|index|composite-index|index-many-to-many|index-many-to-any), 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST map name CDATA #REQUIRED>
+	<!ATTLIST map access CDATA #IMPLIED>
+	<!ATTLIST map table CDATA #IMPLIED>																<!-- default: name -->
+	<!ATTLIST map schema CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST map subselect CDATA #IMPLIED>
+	<!ATTLIST map catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST map lazy (true|false|extra) #IMPLIED>
+	<!ATTLIST map mutable (true|false) "true">
+	<!ATTLIST map inverse (true|false) "false">
+	<!ATTLIST map sort CDATA "unsorted">														 	<!-- unsorted|natural|"comparator class", default: unsorted -->
+	<!ATTLIST map cascade CDATA #IMPLIED>
+	<!ATTLIST map order-by CDATA #IMPLIED>													 		<!-- default: none -->
+	<!ATTLIST map where CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST map batch-size CDATA #IMPLIED>
+	<!ATTLIST map outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST map fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST map check CDATA #IMPLIED>																<!-- default: none -->	
+	<!ATTLIST map persister CDATA #IMPLIED>														
+	<!ATTLIST map collection-type CDATA #IMPLIED>	
+	<!ATTLIST map optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST map node CDATA #IMPLIED>
+	<!ATTLIST map embed-xml (true|false) "true">
+	
+<!ELEMENT set (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+	key, 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST set name CDATA #REQUIRED>
+	<!ATTLIST set access CDATA #IMPLIED>
+	<!ATTLIST set table CDATA #IMPLIED>																<!-- default: name -->
+	<!ATTLIST set schema CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST set catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST set subselect CDATA #IMPLIED>
+	<!ATTLIST set lazy (true|false|extra) #IMPLIED>
+	<!ATTLIST set sort CDATA "unsorted">														 	<!-- unsorted|natural|"comparator class" -->
+	<!ATTLIST set inverse (true|false) "false">
+	<!ATTLIST set mutable (true|false) "true">
+	<!ATTLIST set cascade CDATA #IMPLIED>
+	<!ATTLIST set order-by CDATA #IMPLIED>													 		<!-- default: none -->
+	<!ATTLIST set where CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST set batch-size CDATA #IMPLIED>
+	<!ATTLIST set outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST set fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST set persister CDATA #IMPLIED>	
+	<!ATTLIST set collection-type CDATA #IMPLIED>														
+	<!ATTLIST set check CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST set optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST set node CDATA #IMPLIED>
+	<!ATTLIST set embed-xml (true|false) "true">
+
+<!ELEMENT bag (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+	key, 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST bag name CDATA #REQUIRED>
+	<!ATTLIST bag access CDATA #IMPLIED>
+	<!ATTLIST bag table CDATA #IMPLIED>																<!-- default: name -->
+	<!ATTLIST bag schema CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST bag catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST bag subselect CDATA #IMPLIED>
+	<!ATTLIST bag lazy (true|false|extra) #IMPLIED>
+	<!ATTLIST bag inverse (true|false) "false">
+	<!ATTLIST bag mutable (true|false) "true">
+	<!ATTLIST bag cascade CDATA #IMPLIED>
+	<!ATTLIST bag order-by CDATA #IMPLIED>													 		<!-- default: none -->
+	<!ATTLIST bag where CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST bag batch-size CDATA #IMPLIED>
+	<!ATTLIST bag outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST bag fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST bag persister CDATA #IMPLIED>															
+	<!ATTLIST bag collection-type CDATA #IMPLIED>	
+	<!ATTLIST bag check CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST bag optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST bag node CDATA #IMPLIED>
+	<!ATTLIST bag embed-xml (true|false) "true">
+
+<!ELEMENT idbag (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+	collection-id,
+	key, 
+	(element|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST idbag name CDATA #REQUIRED>
+	<!ATTLIST idbag access CDATA #IMPLIED>
+	<!ATTLIST idbag table CDATA #IMPLIED>															<!-- default: name -->
+	<!ATTLIST idbag schema CDATA #IMPLIED>														 	<!-- default: none -->
+	<!ATTLIST idbag catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST idbag subselect CDATA #IMPLIED>
+	<!ATTLIST idbag lazy (true|false|extra) #IMPLIED>
+	<!ATTLIST idbag mutable (true|false) "true">
+	<!ATTLIST idbag cascade CDATA #IMPLIED>
+	<!ATTLIST idbag order-by CDATA #IMPLIED>													 	<!-- default: none -->
+	<!ATTLIST idbag where CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST idbag batch-size CDATA #IMPLIED>
+	<!ATTLIST idbag outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST idbag fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST idbag persister CDATA #IMPLIED>															
+	<!ATTLIST idbag collection-type CDATA #IMPLIED>
+	<!ATTLIST idbag check CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST idbag optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST idbag node CDATA #IMPLIED>
+	<!ATTLIST idbag embed-xml (true|false) "true">
+
+<!ELEMENT list (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+	key, 
+	(index|list-index), 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST list name CDATA #REQUIRED>
+	<!ATTLIST list access CDATA #IMPLIED>
+	<!ATTLIST list table CDATA #IMPLIED>														 	<!-- default: name -->
+	<!ATTLIST list schema CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST list catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST list subselect CDATA #IMPLIED>
+	<!ATTLIST list lazy (true|false|extra) #IMPLIED>
+	<!ATTLIST list inverse (true|false) "false">
+	<!ATTLIST list mutable (true|false) "true">
+	<!ATTLIST list cascade CDATA #IMPLIED>
+	<!ATTLIST list where CDATA #IMPLIED>														 	<!-- default: none -->
+	<!ATTLIST list batch-size CDATA #IMPLIED>
+	<!ATTLIST list outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST list fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST list persister CDATA #IMPLIED>																
+	<!ATTLIST list collection-type CDATA #IMPLIED>
+	<!ATTLIST list check CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST list optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST list node CDATA #IMPLIED>
+	<!ATTLIST list embed-xml (true|false) "true">
+
+<!ELEMENT array (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	comment?,
+	key, 
+	(index|list-index), 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?
+)>
+	<!ATTLIST array name CDATA #REQUIRED>
+	<!ATTLIST array access CDATA #IMPLIED>
+	<!ATTLIST array table CDATA #IMPLIED>															<!-- default: name -->
+	<!ATTLIST array schema CDATA #IMPLIED>													 		<!-- default: none -->
+	<!ATTLIST array catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST array subselect CDATA #IMPLIED>
+	<!ATTLIST array inverse (true|false) "false">
+	<!ATTLIST array mutable (true|false) "true">
+	<!ATTLIST array element-class CDATA #IMPLIED>
+	<!ATTLIST array cascade CDATA #IMPLIED>
+	<!ATTLIST array where CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST array batch-size CDATA #IMPLIED>
+	<!ATTLIST array outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST array fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST array persister CDATA #IMPLIED>															
+	<!ATTLIST array collection-type CDATA #IMPLIED>
+	<!ATTLIST array check CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST array optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST array node CDATA #IMPLIED>
+	<!ATTLIST array embed-xml (true|false) "true">
+
+<!ELEMENT primitive-array (
+	meta*, 
+	subselect?,
+	cache?, 
+	synchronize*,
+	comment?,
+	key, 
+	(index|list-index), 
+	element,
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?
+)>
+	<!ATTLIST primitive-array name CDATA #REQUIRED>
+	<!ATTLIST primitive-array access CDATA #IMPLIED>
+	<!ATTLIST primitive-array table CDATA #IMPLIED>									<!-- default: name -->
+	<!ATTLIST primitive-array schema CDATA #IMPLIED>								<!-- default: none -->
+	<!ATTLIST primitive-array catalog CDATA #IMPLIED>								<!-- default: none -->
+	<!ATTLIST primitive-array subselect CDATA #IMPLIED>
+	<!ATTLIST primitive-array mutable (true|false) "true">
+	<!ATTLIST primitive-array where CDATA #IMPLIED>									<!-- default: none -->
+	<!ATTLIST primitive-array batch-size CDATA #IMPLIED>
+	<!ATTLIST primitive-array outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST primitive-array fetch (join|select|subselect) #IMPLIED>
+	<!ATTLIST primitive-array persister CDATA #IMPLIED>																
+	<!ATTLIST primitive-array collection-type CDATA #IMPLIED>
+	<!ATTLIST primitive-array check CDATA #IMPLIED>									<!-- default: none -->
+	<!ATTLIST primitive-array optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST primitive-array node CDATA #IMPLIED>
+	<!ATTLIST primitive-array embed-xml (true|false) "true">
+
+<!-- Declares the element type of a collection of basic type -->
+
+<!ELEMENT element ( (column|formula)*, type? )>
+	<!ATTLIST element column CDATA #IMPLIED>
+	<!ATTLIST element node CDATA #IMPLIED>
+	<!ATTLIST element formula CDATA #IMPLIED>
+	<!ATTLIST element type CDATA #IMPLIED>
+	<!ATTLIST element length CDATA #IMPLIED>
+	<!ATTLIST element precision CDATA #IMPLIED>
+	<!ATTLIST element scale CDATA #IMPLIED>
+	<!ATTLIST element not-null (true|false) "false">
+	<!ATTLIST element unique (true|false) "false">
+
+<!-- One to many association. This tag declares the entity-class
+element type of a collection and specifies a one-to-many relational model -->
+
+<!ELEMENT one-to-many EMPTY>
+	<!ATTLIST one-to-many class CDATA #IMPLIED>
+	<!ATTLIST one-to-many not-found (exception|ignore) "exception">
+	<!ATTLIST one-to-many node CDATA #IMPLIED>
+	<!ATTLIST one-to-many embed-xml (true|false) "true">
+	<!ATTLIST one-to-many entity-name CDATA #IMPLIED>
+	<!-- No column declaration attributes required in this case. The primary
+	key column of the associated class is already mapped elsewhere.-->
+
+<!-- Many to many association. This tag declares the entity-class
+element type of a collection and specifies a many-to-many relational model -->
+
+<!ELEMENT many-to-many (meta*,(column|formula)*,filter*)>
+	<!ATTLIST many-to-many class CDATA #IMPLIED>
+	<!ATTLIST many-to-many node CDATA #IMPLIED>
+	<!ATTLIST many-to-many embed-xml (true|false) "true">
+	<!ATTLIST many-to-many entity-name CDATA #IMPLIED>
+	<!ATTLIST many-to-many column CDATA #IMPLIED>
+	<!ATTLIST many-to-many formula CDATA #IMPLIED>
+	<!ATTLIST many-to-many not-found (exception|ignore) "exception">
+	<!ATTLIST many-to-many outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST many-to-many fetch (join|select) #IMPLIED>
+	<!ATTLIST many-to-many lazy (false|proxy) #IMPLIED>
+	<!ATTLIST many-to-many foreign-key CDATA #IMPLIED>
+	<!ATTLIST many-to-many unique (true|false) "false">
+	<!ATTLIST many-to-many where CDATA #IMPLIED>
+	<!ATTLIST many-to-many order-by CDATA #IMPLIED>
+	<!ATTLIST many-to-many property-ref CDATA #IMPLIED>
+
+<!-- A composite element allows a collection to hold instances of an arbitrary 
+class, without the requirement of joining to an entity table. Composite elements
+have component semantics - no shared references and ad hoc null value semantics. 
+Composite elements may not hold nested collections. -->
+
+<!ELEMENT composite-element ( 
+	(meta*),
+	parent?,
+	(property|many-to-one|any|nested-composite-element)* 
+)>
+	<!ATTLIST composite-element class CDATA #REQUIRED>
+	<!ATTLIST composite-element node CDATA #IMPLIED>
+
+<!ELEMENT nested-composite-element ( 
+	parent?,
+	(property|many-to-one|any|nested-composite-element)* 
+)>
+	<!ATTLIST nested-composite-element class CDATA #REQUIRED>
+	<!ATTLIST nested-composite-element name CDATA #REQUIRED>
+	<!ATTLIST nested-composite-element access CDATA #IMPLIED>
+	<!ATTLIST nested-composite-element node CDATA #IMPLIED>
+	
+<!-- Declares the column name of a foreign key. -->
+
+<!ELEMENT key (column*)>
+	<!ATTLIST key column CDATA #IMPLIED>
+	<!ATTLIST key property-ref CDATA #IMPLIED>
+	<!ATTLIST key foreign-key CDATA #IMPLIED>
+	<!ATTLIST key on-delete (cascade|noaction) "noaction">
+	<!ATTLIST key not-null (true|false) #IMPLIED>
+	<!ATTLIST key update (true|false) #IMPLIED>
+	<!ATTLIST key unique (true|false) #IMPLIED>
+	
+<!-- Declares the type and column mapping for a collection index (array or
+list index, or key of a map). -->
+
+<!ELEMENT list-index (column?)>
+	<!ATTLIST list-index column CDATA #IMPLIED>
+	<!ATTLIST list-index base CDATA "0">
+
+<!ELEMENT map-key ((column|formula)*)>
+	<!ATTLIST map-key column CDATA #IMPLIED>
+	<!ATTLIST map-key formula CDATA #IMPLIED>
+	<!ATTLIST map-key type CDATA #REQUIRED>
+	<!ATTLIST map-key length CDATA #IMPLIED>
+	<!ATTLIST map-key node CDATA #IMPLIED>
+
+<!ELEMENT index (column*)>
+	<!ATTLIST index column CDATA #IMPLIED>
+	<!ATTLIST index type CDATA #IMPLIED>			<!-- required for maps -->
+	<!ATTLIST index length CDATA #IMPLIED>
+
+<!-- Many to many association mapped to the key of a map. ie. a map keyed
+on entities. -->
+
+<!ELEMENT map-key-many-to-many ((column|formula)*)>
+	<!ATTLIST map-key-many-to-many class CDATA #IMPLIED>
+	<!ATTLIST map-key-many-to-many entity-name CDATA #IMPLIED>
+	<!ATTLIST map-key-many-to-many column CDATA #IMPLIED>
+	<!ATTLIST map-key-many-to-many formula CDATA #IMPLIED>
+	<!ATTLIST map-key-many-to-many foreign-key CDATA #IMPLIED>
+
+<!ELEMENT index-many-to-many (column*)>
+	<!ATTLIST index-many-to-many class CDATA #REQUIRED>
+	<!ATTLIST index-many-to-many entity-name CDATA #IMPLIED>
+	<!ATTLIST index-many-to-many column CDATA #IMPLIED>
+	<!ATTLIST index-many-to-many foreign-key CDATA #IMPLIED>
+
+<!-- Composite index of a map ie. a map keyed on components. -->
+
+<!ELEMENT composite-map-key ( (key-property|key-many-to-one)+ )>
+	<!ATTLIST composite-map-key class CDATA #REQUIRED>
+
+<!ELEMENT composite-index ( (key-property|key-many-to-one)+ )>
+	<!ATTLIST composite-index class CDATA #REQUIRED>
+
+<!-- A "many to any" defines a polymorphic association to any table 
+with the given identifier type. The first listed column is a VARCHAR column 
+holding the name of the class (for that row). -->
+
+<!ELEMENT many-to-any (meta-value*,column, column+)>
+	<!ATTLIST many-to-any id-type CDATA #REQUIRED>
+	<!ATTLIST many-to-any meta-type CDATA #IMPLIED>			<!--- default: Hibernate.CLASS -->
+
+<!ELEMENT index-many-to-any (column, column+)>
+	<!ATTLIST index-many-to-any id-type CDATA #REQUIRED>
+	<!ATTLIST index-many-to-any meta-type CDATA #IMPLIED>	<!--- default: Hibernate.CLASS -->
+
+<!ELEMENT collection-id (meta*, column*, generator)>
+	<!ATTLIST collection-id column CDATA #REQUIRED>
+	<!ATTLIST collection-id type CDATA #REQUIRED>
+	<!ATTLIST collection-id length CDATA #IMPLIED>
+	
+<!-- Generators generate unique identifiers. The class attribute specifies a Java 
+class implementing an id generation algorithm. -->
+
+<!ELEMENT generator (param*)>
+	<!ATTLIST generator class CDATA #REQUIRED>
+<!ELEMENT param (#PCDATA)>
+	<!ATTLIST param name CDATA #REQUIRED>
+
+<!-- The column element is an alternative to column attributes and required for 
+mapping associations to classes with composite ids. -->
+
+<!ELEMENT column (comment?)>
+	<!ATTLIST column name CDATA #REQUIRED>
+	<!ATTLIST column length CDATA #IMPLIED>						<!-- default: 255 -->
+	<!ATTLIST column precision CDATA #IMPLIED>
+	<!ATTLIST column scale CDATA #IMPLIED>
+	<!ATTLIST column not-null (true|false) #IMPLIED>		 	<!-- default: false (except for id properties) -->
+	<!ATTLIST column unique (true|false) #IMPLIED>			 	<!-- default: false (except for id properties) -->
+	<!ATTLIST column unique-key CDATA #IMPLIED>					<!-- default: no unique key -->
+	<!ATTLIST column sql-type CDATA #IMPLIED>					<!-- override default column type for hibernate type -->
+	<!ATTLIST column index CDATA #IMPLIED>
+	<!ATTLIST column check CDATA #IMPLIED>						<!-- default: no check constraint -->
+    <!ATTLIST column default CDATA #IMPLIED>                    <!-- default: no default value -->
+
+<!-- The formula and subselect elements allow us to map derived properties and 
+entities. -->
+
+<!ELEMENT formula (#PCDATA)>
+<!ELEMENT subselect (#PCDATA)>
+
+<!-- The cache element enables caching of an entity class. -->
+<!ELEMENT cache EMPTY>
+	<!ATTLIST cache usage (read-only|read-write|nonstrict-read-write|transactional) #REQUIRED>				
+	<!ATTLIST cache region CDATA #IMPLIED>						<!-- default: class or collection role name -->
+	<!ATTLIST cache include (all|non-lazy) "all">
+
+<!-- The comment element allows definition of a database table or column comment. -->
+
+<!ELEMENT comment (#PCDATA)>
+
+<!-- The loader element allows specification of a named query to be used for fetching
+an entity or collection -->
+
+<!ELEMENT loader EMPTY>
+	<!ATTLIST loader query-ref CDATA #REQUIRED>
+
+<!-- The query element declares a named Hibernate query string -->
+
+<!ELEMENT query (#PCDATA|query-param)*>
+	<!ATTLIST query name CDATA #REQUIRED>
+	<!ATTLIST query flush-mode (auto|never|always) #IMPLIED>
+	<!ATTLIST query cacheable (true|false) "false">
+	<!ATTLIST query cache-region CDATA #IMPLIED>
+	<!ATTLIST query fetch-size CDATA #IMPLIED>
+	<!ATTLIST query timeout CDATA #IMPLIED>
+	<!ATTLIST query cache-mode (get|ignore|normal|put|refresh) #IMPLIED>
+    <!ATTLIST query read-only (true|false) #IMPLIED>
+    <!ATTLIST query comment CDATA #IMPLIED>
+
+<!-- The sql-query element declares a named SQL query string -->
+
+<!ELEMENT sql-query (#PCDATA|return-scalar|return|return-join|load-collection|synchronize|query-param)*>
+	<!ATTLIST sql-query name CDATA #REQUIRED>
+    <!ATTLIST sql-query resultset-ref CDATA #IMPLIED>
+	<!ATTLIST sql-query flush-mode (auto|never|always) #IMPLIED>
+	<!ATTLIST sql-query cacheable (true|false) "false">
+	<!ATTLIST sql-query cache-region CDATA #IMPLIED>
+	<!ATTLIST sql-query fetch-size CDATA #IMPLIED>
+	<!ATTLIST sql-query timeout CDATA #IMPLIED>
+	<!ATTLIST sql-query cache-mode (get|ignore|normal|put|refresh) #IMPLIED>
+    <!ATTLIST sql-query read-only (true|false) #IMPLIED>
+    <!ATTLIST sql-query comment CDATA #IMPLIED>
+	<!ATTLIST sql-query callable (true|false) "false">
+
+<!-- The query-param element is used only by tools that generate
+finder methods for named queries -->
+
+<!ELEMENT query-param EMPTY>
+	<!ATTLIST query-param name CDATA #REQUIRED>
+	<!ATTLIST query-param type CDATA #REQUIRED>
+
+<!-- The resultset element declares a named resultset mapping definition for SQL queries -->
+<!ELEMENT resultset (return-scalar|return|return-join|load-collection)*>
+	<!ATTLIST resultset name CDATA #REQUIRED>
+
+<!--
+	Defines a return component for a sql-query.  Alias refers to the alias
+	used in the actual sql query; lock-mode specifies the locking to be applied
+	when the query is executed.  The class, collection, and role attributes are mutually exclusive;
+	class refers to the class name of a "root entity" in the object result; collection refers
+	to a collection of a given class and is used to define custom sql to load that owned collection
+	and takes the form "ClassName.propertyName"; role refers to the property path for an eager fetch
+	and takes the form "owningAlias.propertyName"
+-->
+<!ELEMENT return (return-discriminator?,return-property)*>
+	<!ATTLIST return alias CDATA #IMPLIED>
+	<!ATTLIST return entity-name CDATA #IMPLIED>
+	<!ATTLIST return class CDATA #IMPLIED>
+	<!ATTLIST return lock-mode (none|read|upgrade|upgrade-nowait|write) "read">	
+
+<!ELEMENT return-property (return-column*)> 
+	<!ATTLIST return-property name CDATA #REQUIRED>
+	<!ATTLIST return-property column CDATA #IMPLIED>
+
+<!ELEMENT return-column EMPTY> 
+	<!ATTLIST return-column name CDATA #REQUIRED>
+
+<!ELEMENT return-discriminator EMPTY> 
+	<!ATTLIST return-discriminator column CDATA #REQUIRED>
+	
+<!ELEMENT return-join (return-property)*> 
+	<!ATTLIST return-join alias CDATA #REQUIRED>
+	<!ATTLIST return-join property CDATA #REQUIRED>
+	<!ATTLIST return-join lock-mode (none|read|upgrade|upgrade-nowait|write) "read">
+
+<!ELEMENT load-collection (return-property)*> 
+	<!ATTLIST load-collection alias CDATA #REQUIRED>
+	<!ATTLIST load-collection role CDATA #REQUIRED>
+	<!ATTLIST load-collection lock-mode (none|read|upgrade|upgrade-nowait|write) "read">
+
+<!ELEMENT return-scalar EMPTY>
+	<!ATTLIST return-scalar column CDATA #REQUIRED>
+	<!ATTLIST return-scalar type CDATA #IMPLIED>
+
+<!ELEMENT synchronize EMPTY>
+	<!ATTLIST synchronize table CDATA #REQUIRED>
+	
+<!-- custom sql operations -->
+<!ELEMENT sql-insert (#PCDATA)>
+	<!ATTLIST sql-insert callable (true|false) "false">
+	<!ATTLIST sql-insert check (none|rowcount|param) #IMPLIED>
+
+<!ELEMENT sql-update (#PCDATA)>
+	<!ATTLIST sql-update callable (true|false) "false">
+	<!ATTLIST sql-update check (none|rowcount|param) #IMPLIED>
+
+<!ELEMENT sql-delete (#PCDATA)>
+	<!ATTLIST sql-delete callable (true|false) "false">
+	<!ATTLIST sql-delete check (none|rowcount|param) #IMPLIED>
+
+<!ELEMENT sql-delete-all (#PCDATA)>
+	<!ATTLIST sql-delete-all callable (true|false) "false">
+	<!ATTLIST sql-delete-all check (none|rowcount|param) #IMPLIED>
+
+<!--
+    Element for defining "auxiliary" database objects.  Must be one of two forms:
+
+    #1 :
+        <database-object>
+            <definition class="CustomClassExtendingAuxiliaryObject"/>
+        </database-object>
+
+    #2 :
+        <database-object>
+            <create>CREATE OR REPLACE ....</create>
+            <drop>DROP ....</drop>
+        </database-object>
+-->
+<!ELEMENT database-object ( (definition|(create,drop)), dialect-scope* )>
+
+<!ELEMENT definition EMPTY>
+    <!ATTLIST definition class CDATA #REQUIRED>
+
+<!ELEMENT create (#PCDATA)>
+<!ELEMENT drop (#PCDATA)>
+
+<!--
+    dialect-scope element allows scoping auxiliary-objects to a particular
+    Hibernate dialect implementation.
+-->
+<!ELEMENT dialect-scope (#PCDATA)>
+    <!ATTLIST dialect-scope name CDATA #REQUIRED>
+
diff --git a/xml/tests/testData/xml/javaee_5.xsd b/xml/tests/testData/xml/javaee_5.xsd
new file mode 100644
index 0000000..59b6575
--- /dev/null
+++ b/xml/tests/testData/xml/javaee_5.xsd
@@ -0,0 +1,2117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ The contents of this file are subject to the terms
+ of the Common Development and Distribution License
+ (the "License").  You may not use this file except
+ in compliance with the License.
+
+ You can obtain a copy of the license at
+ glassfish/bootstrap/legal/CDDLv1.0.txt or
+ https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ See the License for the specific language governing
+ permissions and limitations under the License.
+
+ When distributing Covered Code, include this CDDL
+ HEADER in each file and include the License file at
+ glassfish/bootstrap/legal/CDDLv1.0.txt.  If applicable,
+ add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your
+ own identifying information: Portions Copyright [yyyy]
+ [name of copyright owner]
+-->
+
+<xsd:schema
+     targetNamespace="http://java.sun.com/xml/ns/javaee"
+     xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+     elementFormDefault="qualified"
+     attributeFormDefault="unqualified"
+     version="5">
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)javaee_5.xsds	1.63 06/02/07
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      Copyright 2003-2005 Sun Microsystems, Inc.
+      4150 Network Circle
+      Santa Clara, California 95054
+      U.S.A
+      All rights reserved.
+
+      Sun Microsystems, Inc. has intellectual property rights
+      relating to technology described in this document. In
+      particular, and without limitation, these intellectual
+      property rights may include one or more of the U.S. patents
+      listed at http://www.sun.com/patents and one or more
+      additional patents or pending patent applications in the
+      U.S. and other countries.
+
+      This document and the technology which it describes are
+      distributed under licenses restricting their use, copying,
+      distribution, and decompilation. No part of this document
+      may be reproduced in any form by any means without prior
+      written authorization of Sun and its licensors, if any.
+
+      Third-party software, including font technology, is
+      copyrighted and licensed from Sun suppliers.
+
+      Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
+      JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+      Cup logo are trademarks or registered trademarks of Sun
+      Microsystems, Inc. in the U.S. and other countries.
+
+      Federal Acquisitions: Commercial Software - Government Users
+      Subject to Standard License Terms and Conditions.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+<xsd:annotation>
+<xsd:documentation>
+
+The following definitions that appear in the common
+shareable schema(s) of J2EE deployment descriptors should be
+interpreted with respect to the context they are included:
+
+Deployment Component may indicate one of the following:
+    j2ee application;
+    application client;
+    web application;
+    enterprise bean;
+    resource adapter;
+
+Deployment File may indicate one of the following:
+    ear file;
+    war file;
+    jar file;
+    rar file;
+
+</xsd:documentation>
+</xsd:annotation>
+
+  <xsd:import namespace="http://www.w3.org/XML/1998/namespace"
+	      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+
+  <xsd:include schemaLocation="javaee_web_services_client_1_2.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:group name="descriptionGroup">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This group keeps the usage of the contained description related
+	elements consistent across Java EE deployment descriptors.
+
+	All elements may occur multiple times with different languages,
+	to support localization of the content.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="display-name"
+		   type="javaee:display-nameType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="icon"
+		   type="javaee:iconType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:group>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="descriptionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The description type is used by a description element to
+	provide text describing the parent element.  The elements
+	that use this type should include any information that the
+	Deployment Component's Deployment File file producer wants
+	to provide to the consumer of the Deployment Component's
+	Deployment File (i.e., to the Deployer). Typically, the
+	tools used by such a Deployment File consumer will display
+	the description when processing the parent element that
+	contains the description.
+
+	The lang attribute defines the language that the
+	description is provided in. The default value is "en" (English).
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:xsdStringType">
+	<xsd:attribute ref="xml:lang"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="dewey-versionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type defines a dewey decimal that is used
+	to describe versions of documents.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="\.?[0-9]+(\.[0-9]+)*"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="display-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The display-name type contains a short name that is intended
+	  to be displayed by tools. It is used by display-name
+	  elements.  The display name need not be unique.
+
+	  Example:
+
+	  ...
+	     <display-name xml:lang="en">
+	       Employee Self Service
+	     </display-name>
+
+	  The value of the xml:lang attribute is "en" (English) by default.
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:string">
+	<xsd:attribute ref="xml:lang"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-linkType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The ejb-linkType is used by ejb-link
+	  elements in the ejb-ref or ejb-local-ref elements to specify
+	  that an EJB reference is linked to enterprise bean.
+
+	  The value of the ejb-link element must be the ejb-name of an
+	  enterprise bean in the same ejb-jar file or in another ejb-jar
+	  file in the same Java EE application unit.
+
+	  Alternatively, the name in the ejb-link element may be
+	  composed of a path name specifying the ejb-jar containing the
+	  referenced enterprise bean with the ejb-name of the target
+	  bean appended and separated from the path name by "#".  The
+	  path name is relative to the Deployment File containing
+	  Deployment Component that is referencing the enterprise
+	  bean.  This allows multiple enterprise beans with the same
+	  ejb-name to be uniquely identified.
+
+	  Examples:
+
+	      <ejb-link>EmployeeRecord</ejb-link>
+
+	      <ejb-link>../products/product.jar#ProductEJB</ejb-link>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-local-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The ejb-local-refType is used by ejb-local-ref elements for
+	the declaration of a reference to an enterprise bean's local
+	home or to the local business interface of a 3.0 bean.
+        The declaration consists of:
+
+	    - an optional description
+	    - the EJB reference name used in the code of the Deployment
+	      Component that's referencing the enterprise bean.
+	    - the optional expected type of the referenced enterprise bean
+	    - the optional expected local interface of the referenced
+              enterprise bean or the local business interface of the
+              referenced enterprise bean.
+	    - the optional expected local home interface of the referenced
+              enterprise bean. Not applicable if this ejb-local-ref refers
+              to the local business interface of a 3.0 bean.
+	    - optional ejb-link information, used to specify the
+	      referenced enterprise bean
+            - optional elements to define injection of the named enterprise
+              bean into a component field or property.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-ref-name"
+		   type="javaee:ejb-ref-nameType"/>
+      <xsd:element name="ejb-ref-type"
+		   type="javaee:ejb-ref-typeType"
+                   minOccurs="0"/>
+      <xsd:element name="local-home"
+		   type="javaee:local-homeType"
+                   minOccurs="0"/>
+      <xsd:element name="local"
+		   type="javaee:localType"
+                   minOccurs="0"/>
+      <xsd:element name="ejb-link"
+		   type="javaee:ejb-linkType"
+		   minOccurs="0"/>
+      <xsd:group ref="javaee:resourceGroup"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-ref-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The ejb-ref-name element contains the name of an EJB
+	  reference. The EJB reference is an entry in the
+	  Deployment Component's environment and is relative to the
+	  java:comp/env context.  The name must be unique within the
+	  Deployment Component.
+
+	  It is recommended that name is prefixed with "ejb/".
+
+	  Example:
+
+	  <ejb-ref-name>ejb/Payroll</ejb-ref-name>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:jndi-nameType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-ref-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The ejb-ref-typeType contains the expected type of the
+	referenced enterprise bean.
+
+	The ejb-ref-type designates a value
+	that must be one of the following:
+
+	    Entity
+	    Session
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="Entity"/>
+	<xsd:enumeration value="Session"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The ejb-refType is used by ejb-ref elements for the
+	declaration of a reference to an enterprise bean's home or
+        to the remote business interface of a 3.0 bean.
+	The declaration consists of:
+
+	    - an optional description
+	    - the EJB reference name used in the code of
+	      the Deployment Component that's referencing the enterprise
+	      bean.
+	    - the optional expected type of the referenced enterprise bean
+            - the optional remote interface of the referenced enterprise bean
+              or the remote business interface of the referenced enterprise
+              bean
+	    - the optional expected home interface of the referenced
+              enterprise bean.  Not applicable if this ejb-ref
+              refers to the remote business interface of a 3.0 bean.
+	    - optional ejb-link information, used to specify the
+	      referenced enterprise bean
+            - optional elements to define injection of the named enterprise
+              bean into a component field or property
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-ref-name"
+		   type="javaee:ejb-ref-nameType"/>
+      <xsd:element name="ejb-ref-type"
+		   type="javaee:ejb-ref-typeType"
+		   minOccurs="0"/>
+      <xsd:element name="home"
+		   type="javaee:homeType"
+		   minOccurs="0"/>
+      <xsd:element name="remote"
+		   type="javaee:remoteType"
+                   minOccurs="0"/>
+      <xsd:element name="ejb-link"
+		   type="javaee:ejb-linkType"
+		   minOccurs="0"/>
+      <xsd:group ref="javaee:resourceGroup"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="emptyType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type is used to designate an empty
+	element when used.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="env-entry-type-valuesType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  This type contains the fully-qualified Java type of the
+	  environment entry value that is expected by the
+	  application's code.
+
+	  The following are the legal values of env-entry-type-valuesType:
+
+	      java.lang.Boolean
+	      java.lang.Byte
+	      java.lang.Character
+	      java.lang.String
+	      java.lang.Short
+	      java.lang.Integer
+	      java.lang.Long
+	      java.lang.Float
+	      java.lang.Double
+
+	  Example:
+
+	  <env-entry-type>java.lang.Boolean</env-entry-type>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="java.lang.Boolean"/>
+	<xsd:enumeration value="java.lang.Byte"/>
+	<xsd:enumeration value="java.lang.Character"/>
+	<xsd:enumeration value="java.lang.String"/>
+	<xsd:enumeration value="java.lang.Short"/>
+	<xsd:enumeration value="java.lang.Integer"/>
+	<xsd:enumeration value="java.lang.Long"/>
+	<xsd:enumeration value="java.lang.Float"/>
+	<xsd:enumeration value="java.lang.Double"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="env-entryType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The env-entryType is used to declare an application's
+	environment entry. The declaration consists of an optional
+	description, the name of the environment entry, a type
+	(optional if the value is injected, otherwise required), and
+	an optional value.
+
+	It also includes optional elements to define injection of
+	the named resource into fields or JavaBeans properties.
+
+	If a value is not specified and injection is requested,
+	no injection will occur and no entry of the specified name
+	will be created.  This allows an initial value to be
+	specified in the source code without being incorrectly
+	changed when no override has been specified.
+
+	If a value is not specified and no injection is requested,
+	a value must be supplied during deployment.
+
+	This type is used by env-entry elements.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="env-entry-name"
+		   type="javaee:jndi-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      The env-entry-name element contains the name of a
+	      Deployment Component's environment entry.  The name
+	      is a JNDI name relative to the java:comp/env
+	      context.  The name must be unique within a
+	      Deployment Component. The uniqueness
+	      constraints must be defined within the declared
+	      context.
+
+	      Example:
+
+	      <env-entry-name>minAmount</env-entry-name>
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="env-entry-type"
+		   type="javaee:env-entry-type-valuesType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      The env-entry-type element contains the Java language
+	      type of the environment entry.  If an injection target
+	      is specified for the environment entry, the type may
+	      be omitted, or must match the type of the injection
+	      target.  If no injection target is specified, the type
+	      is required.
+
+	      Example:
+
+	      <env-entry-type>java.lang.Integer</env-entry-type>
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="env-entry-value"
+		   type="javaee:xsdStringType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      The env-entry-value designates the value of a
+	      Deployment Component's environment entry. The value
+	      must be a String that is valid for the
+	      constructor of the specified type that takes a
+	      single String parameter, or for java.lang.Character,
+	      a single character.
+
+	      Example:
+
+	      <env-entry-value>100.00</env-entry-value>
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:group ref="javaee:resourceGroup"/>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="fully-qualified-classType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The elements that use this type designate the name of a
+	Java class or interface.  The name is in the form of a
+	"binary name", as defined in the JLS.  This is the form
+	of name used in Class.forName().  Tools that need the
+	canonical name (the name used in source code) will need
+	to convert this binary name to the canonical name.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="generic-booleanType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type defines four different values which can designate
+	boolean values. This includes values yes and no which are
+	not designated by xsd:boolean
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="true"/>
+	<xsd:enumeration value="false"/>
+	<xsd:enumeration value="yes"/>
+	<xsd:enumeration value="no"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="homeType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The homeType defines the fully-qualified name of
+	  an enterprise bean's home interface.
+
+	  Example:
+
+	      <home>com.aardvark.payroll.PayrollHome</home>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="iconType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The icon type contains small-icon and large-icon elements
+	that specify the file names for small and large GIF, JPEG,
+	or PNG icon images used to represent the parent element in a
+	GUI tool.
+
+	The xml:lang attribute defines the language that the
+	icon file names are provided in. Its value is "en" (English)
+	by default.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="small-icon" type="javaee:pathType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      The small-icon element contains the name of a file
+	      containing a small (16 x 16) icon image. The file
+	      name is a relative path within the Deployment
+	      Component's Deployment File.
+
+	      The image may be in the GIF, JPEG, or PNG format.
+	      The icon can be used by tools.
+
+	      Example:
+
+	      <small-icon>employee-service-icon16x16.jpg</small-icon>
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="large-icon" type="javaee:pathType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      The large-icon element contains the name of a file
+	      containing a large
+	      (32 x 32) icon image. The file name is a relative
+	      path within the Deployment Component's Deployment
+	      File.
+
+	      The image may be in the GIF, JPEG, or PNG format.
+	      The icon can be used by tools.
+
+	      Example:
+
+	      <large-icon>employee-service-icon32x32.jpg</large-icon>
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+    </xsd:sequence>
+
+    <xsd:attribute ref="xml:lang"/>
+    <xsd:attribute name="id" type="xsd:ID"/>
+
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="injection-targetType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	An injection target specifies a class and a name within
+	that class into which a resource should be injected.
+
+	The injection target class specifies the fully qualified
+	class name that is the target of the injection.  The
+	Java EE specifications describe which classes can be an
+	injection target.
+
+	The injection target name specifies the target within
+	the specified class.  The target is first looked for as a
+	JavaBeans property name.  If not found, the target is
+	looked for as a field name.
+
+	The specified resource will be injected into the target
+	during initialization of the class by either calling the
+	set method for the target property or by setting a value
+	into the named field.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="injection-target-class"
+		   type="javaee:fully-qualified-classType"/>
+      <xsd:element name="injection-target-name"
+		   type="javaee:java-identifierType"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="java-identifierType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The java-identifierType defines a Java identifier.
+	The users of this type should further verify that
+	the content does not contain Java reserved keywords.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:pattern value="($|_|\p{L})(\p{L}|\p{Nd}|_|$)*"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="java-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This is a generic type that designates a Java primitive
+	type or a fully qualified name of a Java interface/type,
+	or an array of such types.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:pattern value="[^\p{Z}]*"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="jndi-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The jndi-nameType type designates a JNDI name in the
+	Deployment Component's environment and is relative to the
+	java:comp/env context.  A JNDI name must be unique within the
+	Deployment Component.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:group name="jndiEnvironmentRefsGroup">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This group keeps the usage of the contained JNDI environment
+	reference elements consistent across Java EE deployment descriptors.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="env-entry"
+		   type="javaee:env-entryType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="ejb-ref"
+		   type="javaee:ejb-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="ejb-local-ref"
+		   type="javaee:ejb-local-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:group ref="javaee:service-refGroup"/>
+      <xsd:element name="resource-ref"
+		   type="javaee:resource-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="resource-env-ref"
+		   type="javaee:resource-env-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="message-destination-ref"
+		   type="javaee:message-destination-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="persistence-context-ref"
+		   type="javaee:persistence-context-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="persistence-unit-ref"
+		   type="javaee:persistence-unit-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="post-construct"
+		   type="javaee:lifecycle-callbackType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="pre-destroy"
+		   type="javaee:lifecycle-callbackType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:group>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="lifecycle-callbackType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The lifecycle-callback type specifies a method on a
+	class to be called when a lifecycle event occurs.
+	Note that each class may have only one lifecycle callback
+        method for any given event and that the method may not
+	be overloaded.
+
+        If the lifefycle-callback-class element is missing then
+        the class defining the callback is assumed to be the
+        component class in scope at the place in the descriptor
+        in which the callback definition appears.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="lifecycle-callback-class"
+		   type="javaee:fully-qualified-classType"
+                   minOccurs="0"/>
+      <xsd:element name="lifecycle-callback-method"
+		   type="javaee:java-identifierType"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="listenerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The listenerType indicates the deployment properties for a web
+	application listener bean.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="listener-class"
+		   type="javaee:fully-qualified-classType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The listener-class element declares a class in the
+	    application must be registered as a web
+	    application listener bean. The value is the fully
+	    qualified classname of the listener class.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="local-homeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The local-homeType defines the fully-qualified
+	name of an enterprise bean's local home interface.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="localType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The localType defines the fully-qualified name of an
+	enterprise bean's local interface.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destination-linkType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The message-destination-linkType is used to link a message
+	destination reference or message-driven bean to a message
+	destination.
+
+	The Assembler sets the value to reflect the flow of messages
+	between producers and consumers in the application.
+
+	The value must be the message-destination-name of a message
+	destination in the same Deployment File or in another
+	Deployment File in the same Java EE application unit.
+
+	Alternatively, the value may be composed of a path name
+	specifying a Deployment File containing the referenced
+	message destination with the message-destination-name of the
+	destination appended and separated from the path name by
+	"#". The path name is relative to the Deployment File
+	containing Deployment Component that is referencing the
+	message destination.  This allows multiple message
+	destinations with the same name to be uniquely identified.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destination-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The message-destination-ref element contains a declaration
+	  of Deployment Component's reference to a message destination
+	  associated with a resource in Deployment Component's
+	  environment. It consists of:
+
+		  - an optional description
+		  - the message destination reference name
+		  - an optional message destination type
+		  - an optional specification as to whether
+		    the destination is used for
+		    consuming or producing messages, or both.
+		    if not specified, "both" is assumed.
+		  - an optional link to the message destination
+		  - optional injection targets
+
+	  The message destination type must be supplied unless an
+	  injection target is specified, in which case the type
+	  of the target is used.  If both are specified, the type
+	  must be assignment compatible with the type of the injection
+	  target.
+
+	  Examples:
+
+	  <message-destination-ref>
+		  <message-destination-ref-name>jms/StockQueue
+		  </message-destination-ref-name>
+		  <message-destination-type>javax.jms.Queue
+		  </message-destination-type>
+		  <message-destination-usage>Consumes
+		  </message-destination-usage>
+		  <message-destination-link>CorporateStocks
+		  </message-destination-link>
+	  </message-destination-ref>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="message-destination-ref-name"
+		   type="javaee:jndi-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The message-destination-ref-name element specifies
+	    the name of a message destination reference; its
+	    value is the environment entry name used in
+	    Deployment Component code.  The name is a JNDI name
+	    relative to the java:comp/env context and must be
+	    unique within an ejb-jar (for enterprise beans) or a
+	    Deployment File (for others).
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="message-destination-type"
+		   type="javaee:message-destination-typeType"
+		   minOccurs="0"/>
+      <xsd:element name="message-destination-usage"
+		   type="javaee:message-destination-usageType"
+		   minOccurs="0"/>
+      <xsd:element name="message-destination-link"
+		   type="javaee:message-destination-linkType"
+		   minOccurs="0"/>
+
+      <xsd:group ref="javaee:resourceGroup"/>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destination-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The message-destination-typeType specifies the type of
+	  the destination. The type is specified by the Java interface
+	  expected to be implemented by the destination.
+
+	  Example:
+
+	    <message-destination-type>javax.jms.Queue
+	    </message-destination-type>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destination-usageType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The message-destination-usageType specifies the use of the
+	message destination indicated by the reference.  The value
+	indicates whether messages are consumed from the message
+	destination, produced for the destination, or both.  The
+	Assembler makes use of this information in linking producers
+	of a destination with its consumers.
+
+	The value of the message-destination-usage element must be
+	one of the following:
+	    Consumes
+	    Produces
+	    ConsumesProduces
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="Consumes"/>
+	<xsd:enumeration value="Produces"/>
+	<xsd:enumeration value="ConsumesProduces"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destinationType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The message-destinationType specifies a message
+	  destination. The logical destination described by this
+	  element is mapped to a physical destination by the Deployer.
+
+	  The message destination element contains:
+
+		  - an optional description
+		  - an optional display-name
+		  - an optional icon
+		  - a message destination name which must be unique
+		    among message destination names within the same
+		    Deployment File.
+		  - an optional mapped name
+
+	  Example:
+
+	  <message-destination>
+		  <message-destination-name>CorporateStocks
+		  </message-destination-name>
+	  </message-destination>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="message-destination-name"
+		   type="javaee:string">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The message-destination-name element specifies a
+	    name for a message destination.  This name must be
+	    unique among the names of message destinations
+	    within the Deployment File.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="mapped-name"
+		   type="javaee:xsdStringType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      A product specific name that this message destination
+	      should be mapped to.  Each message-destination-ref
+	      element that references this message destination will
+	      define a name in the namespace of the referencing
+	      component.  (It's a name in the JNDI java:comp/env
+	      namespace.)  Many application servers provide a way to
+	      map these local names to names of resources known to the
+	      application server.  This mapped name is often a global
+	      JNDI name, but may be a name of any form.  Each of the
+	      local names should be mapped to this same global name.
+
+	      Application servers are not required to support any
+	      particular form or type of mapped name, nor the ability
+	      to use mapped names.  The mapped name is
+	      product-dependent and often installation-dependent.  No
+	      use of a mapped name is portable.
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="param-valueType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type is a general type that can be used to declare
+	parameter/value lists.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="param-name"
+		   type="javaee:string">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The param-name element contains the name of a
+	    parameter.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="param-value"
+		   type="javaee:xsdStringType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The param-value element contains the value of a
+	    parameter.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="pathType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The elements that use this type designate either a relative
+	path or an absolute path starting with a "/".
+
+	In elements that specify a pathname to a file within the
+	same Deployment File, relative filenames (i.e., those not
+	starting with "/") are considered relative to the root of
+	the Deployment File's namespace.  Absolute filenames (i.e.,
+	those starting with "/") also specify names in the root of
+	the Deployment File's namespace.  In general, relative names
+	are preferred.  The exception is .war files where absolute
+	names are preferred for consistency with the Servlet API.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-context-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The persistence-context-ref element contains a declaration
+	  of Deployment Component's reference to a persistence context
+	  associated within a Deployment Component's
+	  environment. It consists of:
+
+		  - an optional description
+		  - the persistence context reference name
+		  - an optional persistence unit name.  If not specified,
+                    the default persistence unit is assumed.
+		  - an optional specification as to whether
+		    the persistence context is Transactional or
+		    Extended.  If not specificed, Transactional is assumed.
+                  - an optional list of persistence properties
+		  - optional injection targets
+
+	  Examples:
+
+            <persistence-context-ref>
+              <persistence-context-ref-name>myPersistenceContext
+              </persistence-context-ref-name>
+            </persistence-context-ref>
+
+            <persistence-context-ref>
+              <persistence-context-ref-name>myPersistenceContext
+                </persistence-context-ref-name>
+              <persistence-unit-name>PersistenceUnit1
+                </persistence-unit-name>
+              <persistence-context-type>Extended</persistence-context-type>
+            </persistence-context-ref>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="persistence-context-ref-name"
+		   type="javaee:jndi-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The persistence-context-ref-name element specifies
+	    the name of a persistence context reference; its
+	    value is the environment entry name used in
+	    Deployment Component code.  The name is a JNDI name
+	    relative to the java:comp/env context.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="persistence-unit-name"
+		   type="javaee:string"
+		   minOccurs="0">
+        <xsd:annotation>
+	  <xsd:documentation>
+
+            The Application Assembler(or BeanProvider) may use the
+            following syntax to avoid the need to rename persistence
+            units to have unique names within a Java EE application.
+
+            The Application Assembler specifies the pathname of the
+            root of the persistence.xml file for the referenced
+            persistence unit and appends the name of the persistence
+            unit separated from the pathname by #. The pathname is
+            relative to the referencing application component jar file.
+            In this manner, multiple persistence units with the same
+            persistence unit name may be uniquely identified when the
+            Application Assembler cannot change persistence unit names.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="persistence-context-type"
+		   type="javaee:persistence-context-typeType"
+		   minOccurs="0"/>
+
+      <xsd:element name="persistence-property"
+		   type="javaee:propertyType"
+		   minOccurs="0"
+		   maxOccurs="unbounded">
+        <xsd:annotation>
+	  <xsd:documentation>
+
+            Used to specify properties for the container or persistence
+            provider.  Vendor-specific properties may be included in
+            the set of properties.  Properties that are not recognized
+            by a vendor must be ignored.  Entries that make use of the
+            namespace javax.persistence and its subnamespaces must not
+            be used for vendor-specific properties.  The namespace
+            javax.persistence is reserved for use by the specification.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:group ref="javaee:resourceGroup"/>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-context-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The persistence-context-typeType specifies the transactional
+	nature of a persistence context reference.
+
+	The value of the persistence-context-type element must be
+	one of the following:
+	    Transactional
+            Extended
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="Transactional"/>
+	<xsd:enumeration value="Extended"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-unit-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The persistence-unit-ref element contains a declaration
+	  of Deployment Component's reference to a persistence unit
+	  associated within a Deployment Component's
+	  environment. It consists of:
+
+		  - an optional description
+		  - the persistence unit reference name
+		  - an optional persistence unit name.  If not specified,
+                    the default persistence unit is assumed.
+		  - optional injection targets
+
+	  Examples:
+
+            <persistence-unit-ref>
+              <persistence-unit-ref-name>myPersistenceUnit
+              </persistence-unit-ref-name>
+            </persistence-unit-ref>
+
+            <persistence-unit-ref>
+              <persistence-unit-ref-name>myPersistenceUnit
+                </persistence-unit-ref-name>
+              <persistence-unit-name>PersistenceUnit1
+                </persistence-unit-name>
+            </persistence-unit-ref>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="persistence-unit-ref-name"
+		   type="javaee:jndi-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The persistence-unit-ref-name element specifies
+	    the name of a persistence unit reference; its
+	    value is the environment entry name used in
+	    Deployment Component code.  The name is a JNDI name
+	    relative to the java:comp/env context.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="persistence-unit-name"
+		   type="javaee:string"
+		   minOccurs="0">
+        <xsd:annotation>
+	  <xsd:documentation>
+
+            The Application Assembler(or BeanProvider) may use the
+            following syntax to avoid the need to rename persistence
+            units to have unique names within a Java EE application.
+
+            The Application Assembler specifies the pathname of the
+            root of the persistence.xml file for the referenced
+            persistence unit and appends the name of the persistence
+            unit separated from the pathname by #. The pathname is
+            relative to the referencing application component jar file.
+            In this manner, multiple persistence units with the same
+            persistence unit name may be uniquely identified when the
+            Application Assembler cannot change persistence unit names.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:group ref="javaee:resourceGroup"/>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="propertyType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	Specifies a name/value pair.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="name"
+		   type="javaee:xsdStringType">
+      </xsd:element>
+      <xsd:element name="value"
+		   type="javaee:xsdStringType">
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="remoteType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The remote element contains the fully-qualified name
+	  of the enterprise bean's remote interface.
+
+	  Example:
+
+	      <remote>com.wombat.empl.EmployeeService</remote>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="res-authType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The res-authType specifies whether the Deployment Component
+	code signs on programmatically to the resource manager, or
+	whether the Container will sign on to the resource manager
+	on behalf of the Deployment Component. In the latter case,
+	the Container uses information that is supplied by the
+	Deployer.
+
+	The value must be one of the two following:
+
+	    Application
+	    Container
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="Application"/>
+	<xsd:enumeration value="Container"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="res-sharing-scopeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The res-sharing-scope type specifies whether connections
+	obtained through the given resource manager connection
+	factory reference can be shared. The value, if specified,
+	must be one of the two following:
+
+	    Shareable
+	    Unshareable
+
+	The default value is Shareable.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+	<xsd:enumeration value="Shareable"/>
+	<xsd:enumeration value="Unshareable"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="resource-env-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The resource-env-refType is used to define
+	  resource-env-type elements.  It contains a declaration of a
+	  Deployment Component's reference to an administered object
+	  associated with a resource in the Deployment Component's
+	  environment.  It consists of an optional description, the
+	  resource environment reference name, and an optional
+	  indication of the resource environment reference type
+	  expected by the Deployment Component code.
+
+	  It also includes optional elements to define injection of
+	  the named resource into fields or JavaBeans properties.
+
+	  The resource environment type must be supplied unless an
+	  injection target is specified, in which case the type
+	  of the target is used.  If both are specified, the type
+	  must be assignment compatible with the type of the injection
+	  target.
+
+	  Example:
+
+	  <resource-env-ref>
+	      <resource-env-ref-name>jms/StockQueue
+	      </resource-env-ref-name>
+	      <resource-env-ref-type>javax.jms.Queue
+	      </resource-env-ref-type>
+	  </resource-env-ref>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="resource-env-ref-name"
+		   type="javaee:jndi-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The resource-env-ref-name element specifies the name
+	    of a resource environment reference; its value is
+	    the environment entry name used in
+	    the Deployment Component code.  The name is a JNDI
+	    name relative to the java:comp/env context and must
+	    be unique within a Deployment Component.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="resource-env-ref-type"
+		   type="javaee:fully-qualified-classType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The resource-env-ref-type element specifies the type
+	    of a resource environment reference.  It is the
+	    fully qualified name of a Java language class or
+	    interface.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:group ref="javaee:resourceGroup"/>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="resource-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The resource-refType contains a declaration of a
+	  Deployment Component's reference to an external resource. It
+	  consists of an optional description, the resource manager
+	  connection factory reference name, an optional indication of
+	  the resource manager connection factory type expected by the
+	  Deployment Component code, an optional type of authentication
+	  (Application or Container), and an optional specification of
+	  the shareability of connections obtained from the resource
+	  (Shareable or Unshareable).
+
+	  It also includes optional elements to define injection of
+	  the named resource into fields or JavaBeans properties.
+
+	  The connection factory type must be supplied unless an
+	  injection target is specified, in which case the type
+	  of the target is used.  If both are specified, the type
+	  must be assignment compatible with the type of the injection
+	  target.
+
+	  Example:
+
+	  <resource-ref>
+	      <res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
+	      <res-type>javax.sql.DataSource</res-type>
+	      <res-auth>Container</res-auth>
+	      <res-sharing-scope>Shareable</res-sharing-scope>
+	  </resource-ref>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="res-ref-name"
+		   type="javaee:jndi-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The res-ref-name element specifies the name of a
+	    resource manager connection factory reference.
+	    The name is a JNDI name relative to the
+	    java:comp/env context.
+	    The name must be unique within a Deployment File.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="res-type"
+		   type="javaee:fully-qualified-classType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The res-type element specifies the type of the data
+	    source. The type is specified by the fully qualified
+	    Java language class or interface
+	    expected to be implemented by the data source.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="res-auth"
+		   type="javaee:res-authType"
+		   minOccurs="0"/>
+
+      <xsd:element name="res-sharing-scope"
+		   type="javaee:res-sharing-scopeType"
+		   minOccurs="0"/>
+
+      <xsd:group ref="javaee:resourceGroup"/>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:group name="resourceGroup">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This group collects elements that are common to all the
+	JNDI resource elements.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="mapped-name"
+		   type="javaee:xsdStringType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+	    <![CDATA[
+
+	      A product specific name that this resource should be
+	      mapped to.  The name of this resource, as defined by the
+	      resource's name element or defaulted, is a name that is
+	      local to the application component using the resource.
+	      (It's a name in the JNDI java:comp/env namespace.)  Many
+	      application servers provide a way to map these local
+	      names to names of resources known to the application
+	      server.  This mapped name is often a global JNDI name,
+	      but may be a name of any form.
+
+	      Application servers are not required to support any
+	      particular form or type of mapped name, nor the ability
+	      to use mapped names.  The mapped name is
+	      product-dependent and often installation-dependent.  No
+	      use of a mapped name is portable.
+
+	      ]]>
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="injection-target"
+		   type="javaee:injection-targetType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:group>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="role-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The role-nameType designates the name of a security role.
+
+	The name must conform to the lexical rules for a token.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="run-asType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The run-asType specifies the run-as identity to be
+	used for the execution of a component. It contains an
+	optional description, and the name of a security role.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+		   type="javaee:role-nameType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-role-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The security-role-refType contains the declaration of a
+	security role reference in a component's or a
+	Deployment Component's code. The declaration consists of an
+	optional description, the security role name used in the
+	code, and an optional link to a security role. If the
+	security role is not specified, the Deployer must choose an
+	appropriate security role.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+		   type="javaee:role-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The value of the role-name element must be the String used
+	    as the parameter to the
+	    EJBContext.isCallerInRole(String roleName) method or the
+	    HttpServletRequest.isUserInRole(String role) method.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="role-link"
+		   type="javaee:role-nameType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The role-link element is a reference to a defined
+	    security role. The role-link element must contain
+	    the name of one of the security roles defined in the
+	    security-role elements.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-roleType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The security-roleType contains the definition of a security
+	  role. The definition consists of an optional description of
+	  the security role, and the security role name.
+
+	  Example:
+
+	      <security-role>
+	      <description>
+		  This role includes all employees who are authorized
+		  to access the employee service application.
+	      </description>
+	      <role-name>employee</role-name>
+	      </security-role>
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="javaee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+		   type="javaee:role-nameType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="string">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This is a special string datatype that is defined by Java EE as
+	a base type for defining collapsed strings. When schemas
+	require trailing/leading space elimination as well as
+	collapsing the existing whitespace, this base type may be
+	used.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:token">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="true-falseType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This simple type designates a boolean with only two
+	permissible values
+
+	- true
+	- false
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:xsdBooleanType">
+	<xsd:pattern value="(true|false)"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="url-patternType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The url-patternType contains the url pattern of the mapping.
+	It must follow the rules specified in Section 11.2 of the
+	Servlet API Specification. This pattern is assumed to be in
+	URL-decoded form and must not contain CR(#xD) or LF(#xA).
+	If it contains those characters, the container must inform
+	the developer with a descriptive error message.
+	The container must preserve all characters including whitespaces.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdAnyURIType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:anyURI.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:anyURI">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdBooleanType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:boolean.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:boolean">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdIntegerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:integer.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:integer">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdNMTOKENType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:NMTOKEN.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:NMTOKEN">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdNonNegativeIntegerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:nonNegativeInteger.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:nonNegativeInteger">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdPositiveIntegerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:positiveInteger.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:positiveInteger">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdQNameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:QName.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:QName">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdStringType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type adds an "id" attribute to xsd:string.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:string">
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+</xsd:schema>
+
diff --git a/xml/tests/testData/xml/jdo_2_0.xsd b/xml/tests/testData/xml/jdo_2_0.xsd
new file mode 100644
index 0000000..c6d0219
--- /dev/null
+++ b/xml/tests/testData/xml/jdo_2_0.xsd
@@ -0,0 +1,653 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--W3C Schema generated by XML Spy v4.2 U (http://www.xmlspy.com)-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xs:element name="array">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="column" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="embedded" minOccurs="0"/>
+				<xs:element ref="foreign-key" minOccurs="0"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="column">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="serialized">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="foreign-key" type="xs:string"/>
+			<xs:attribute name="embedded-element">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="dependent-element">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="class">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="implements" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="datastore-identity" minOccurs="0"/>
+				<xs:element ref="inheritance" minOccurs="0"/>
+				<xs:element ref="version" minOccurs="0"/>
+				<xs:element ref="join" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="foreign-key" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="index" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="unique" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="field" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="query" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="fetch-group" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string" use="required"/>
+			<xs:attribute name="identity-type">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="application"/>
+						<xs:enumeration value="datastore"/>
+						<xs:enumeration value="nondurable"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="objectid-class" type="xs:string"/>
+			<xs:attribute name="table" type="xs:string"/>
+			<xs:attribute name="requires-extent" default="true">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="persistence-capable-superclass" type="xs:string"/>
+			<xs:attribute name="detachable" default="true">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="embedded-only">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="persistence-modifier">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="persistence-capable"/>
+						<xs:enumeration value="persistence-aware"/>
+						<xs:enumeration value="non-persistent"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="collection">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="order" minOccurs="0"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="element-type" type="xs:string"/>
+			<xs:attribute name="embedded-element">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="dependent-element">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="column">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string"/>
+			<xs:attribute name="target" type="xs:string"/>
+			<xs:attribute name="target-field" type="xs:string"/>
+			<xs:attribute name="jdbc-type" type="xs:string"/>
+			<xs:attribute name="sql-type" type="xs:string"/>
+			<xs:attribute name="length" type="xs:string"/>
+			<xs:attribute name="scale" type="xs:string"/>
+			<xs:attribute name="precision" type="xs:string"/>
+			<xs:attribute name="allows-null" type="xs:string"/>
+			<xs:attribute name="default-value" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="datastore-identity">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="column" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="column" type="xs:string"/>
+			<xs:attribute name="strategy" type="xs:string"/>
+			<xs:attribute name="sequence" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="discriminator">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="column" minOccurs="0"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="column" type="xs:string"/>
+			<xs:attribute name="value" type="xs:string"/>
+			<xs:attribute name="strategy">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="value-map"/>
+						<xs:enumeration value="class-name"/>
+						<xs:enumeration value="none"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="element">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="column" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="index" minOccurs="0"/>
+				<xs:element ref="embedded" minOccurs="0"/>
+				<xs:element ref="foreign-key" minOccurs="0"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="column" type="xs:string"/>
+			<xs:attribute name="serialized">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="foreign-key" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="embedded">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="field" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="owner" minOccurs="0"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="extension">
+		<xs:complexType mixed="true">
+			<xs:attribute name="vendor-name" type="xs:string" use="required"/>
+			<xs:attribute name="key" type="xs:string"/>
+			<xs:attribute name="value" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="fetch-group">
+		<xs:complexType>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element ref="fetch-group"/>
+				<xs:element ref="field"/>
+			</xs:choice>
+			<xs:attribute name="name" type="xs:string" use="required"/>
+			<xs:attribute name="post-load">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="field">
+		<xs:complexType>
+			<xs:sequence minOccurs="0">
+				<xs:choice minOccurs="0">
+					<xs:element ref="collection"/>
+					<xs:element ref="map"/>
+					<xs:element ref="array"/>
+					<xs:element ref="column" minOccurs="0" maxOccurs="unbounded"/>
+				</xs:choice>
+				<xs:element ref="join" minOccurs="0"/>
+				<xs:element ref="element" minOccurs="0"/>
+				<xs:element ref="key" minOccurs="0"/>
+				<xs:element ref="value" minOccurs="0"/>
+				<xs:element ref="fetch-group" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="order" minOccurs="0"/>
+				<xs:element ref="embedded" minOccurs="0"/>
+				<xs:element ref="index" minOccurs="0"/>
+				<xs:element ref="foreign-key" minOccurs="0"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string" use="required"/>
+			<xs:attribute name="persistence-modifier">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="persistent"/>
+						<xs:enumeration value="transactional"/>
+						<xs:enumeration value="none"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="table" type="xs:string"/>
+			<xs:attribute name="primary-key" default="false">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="null-value" default="none">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="exception"/>
+						<xs:enumeration value="default"/>
+						<xs:enumeration value="none"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="default-fetch-group">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="embedded">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="serialized">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="dependent">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="value-factory" type="xs:string"/>
+			<xs:attribute name="foreign-key" type="xs:string"/>
+			<xs:attribute name="fetch-group" type="xs:string"/>
+			<xs:attribute name="depth" type="xs:string"/>
+			<xs:attribute name="column" type="xs:string"/>
+			<xs:attribute name="mapped-by" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="foreign-key">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="column" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="column" type="xs:string"/>
+			<xs:attribute name="deferred">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="delete-action">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="cascade"/>
+						<xs:enumeration value="restrict"/>
+						<xs:enumeration value="null"/>
+						<xs:enumeration value="default"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="update-action">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="cascade"/>
+						<xs:enumeration value="restrict"/>
+						<xs:enumeration value="default"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="unique">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="name" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="implements">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="property-field" maxOccurs="unbounded"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string" use="required"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="index">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="column" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string"/>
+			<xs:attribute name="column" type="xs:string"/>
+			<xs:attribute name="unique" default="false">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="inheritance">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="discriminator" minOccurs="0"/>
+				<xs:element ref="join" minOccurs="0"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="strategy" type="xs:string" use="required"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="interface">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="property" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string" use="required"/>
+			<xs:attribute name="requires-extent" default="true">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="jdo">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="package" maxOccurs="unbounded"/>
+				<xs:element ref="query" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="join">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="column" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="index" minOccurs="0"/>
+				<xs:element ref="foreign-key" minOccurs="0"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="table" type="xs:string"/>
+			<xs:attribute name="column" type="xs:string"/>
+			<xs:attribute name="outer" default="false">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="foreign-key" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="key">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="column" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="index" minOccurs="0"/>
+				<xs:element ref="embedded" minOccurs="0"/>
+				<xs:element ref="foreign-key" minOccurs="0"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="column" type="xs:string"/>
+			<xs:attribute name="serialized">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="foreign-key" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="map">
+		<xs:complexType>
+			<xs:sequence minOccurs="0" maxOccurs="unbounded">
+				<xs:element ref="extension"/>
+			</xs:sequence>
+			<xs:attribute name="key-type" type="xs:string"/>
+			<xs:attribute name="embedded-key">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="dependent-key">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="value-type" type="xs:string"/>
+			<xs:attribute name="embedded-value">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="dependent-value">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="order">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="column" minOccurs="0"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="column" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="owner">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="field" minOccurs="0"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="package">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="interface" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="class" maxOccurs="unbounded"/>
+				<xs:element ref="sequence" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string" use="required"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="property">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:sequence minOccurs="0">
+					<xs:element ref="join" minOccurs="0"/>
+					<xs:element ref="element" minOccurs="0"/>
+					<xs:element ref="key" minOccurs="0"/>
+					<xs:element ref="value" minOccurs="0"/>
+					<xs:element ref="order" minOccurs="0"/>
+					<xs:element ref="column"/>
+				</xs:sequence>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string" use="required"/>
+			<xs:attribute name="column" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="property-field">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string" use="required"/>
+			<xs:attribute name="field-name" type="xs:string" use="required"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="query">
+		<xs:complexType mixed="true">
+			<xs:sequence>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string"/>
+			<xs:attribute name="language" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="sequence">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string" use="required"/>
+			<xs:attribute name="sequence-name" type="xs:string" use="required"/>
+			<xs:attribute name="strategy" use="required">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="non-transactional"/>
+						<xs:enumeration value="transactional-contiguous"/>
+						<xs:enumeration value="transactional-holes-allowed"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="unique">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:choice minOccurs="0" maxOccurs="unbounded">
+					<xs:element ref="column"/>
+					<xs:element ref="field"/>
+					<xs:element ref="property"/>
+				</xs:choice>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string"/>
+			<xs:attribute name="table" type="xs:string"/>
+			<xs:attribute name="deferred" default="false">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="value">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="column" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="index" minOccurs="0"/>
+				<xs:element ref="embedded" minOccurs="0"/>
+				<xs:element ref="foreign-key" minOccurs="0"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="column" type="xs:string"/>
+			<xs:attribute name="serialized">
+				<xs:simpleType>
+					<xs:restriction base="xs:NMTOKEN">
+						<xs:enumeration value="true"/>
+						<xs:enumeration value="false"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:attribute>
+			<xs:attribute name="foreign-key" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="version">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="column" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="strategy" type="xs:string"/>
+			<xs:attribute name="column" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:notation name="JDO.2_0" public="-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"/>
+</xs:schema>
diff --git a/xml/tests/testData/xml/jsp_2_0.xsd b/xml/tests/testData/xml/jsp_2_0.xsd
new file mode 100644
index 0000000..b03c73a
--- /dev/null
+++ b/xml/tests/testData/xml/jsp_2_0.xsd
@@ -0,0 +1,307 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+	    targetNamespace="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	    elementFormDefault="qualified"
+	    attributeFormDefault="unqualified"
+	    version="2.0">
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)jsp_2_0.xsds	1.17 03/18/03
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
+      Road, Palo Alto, California 94303, U.S.A. All rights
+      reserved.
+
+      Sun Microsystems, Inc. has intellectual property rights
+      relating to technology described in this document. In
+      particular, and without limitation, these intellectual
+      property rights may include one or more of the U.S. patents
+      listed at http://www.sun.com/patents and one or more
+      additional patents or pending patent applications in the
+      U.S. and other countries.
+
+      This document and the technology which it describes are
+      distributed under licenses restricting their use, copying,
+      distribution, and decompilation. No part of this document
+      may be reproduced in any form by any means without prior
+      written authorization of Sun and its licensors, if any.
+
+      Third-party software, including font technology, is
+      copyrighted and licensed from Sun suppliers.
+
+      Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
+      JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+      Cup logo are trademarks or registered trademarks of Sun
+      Microsystems, Inc. in the U.S. and other countries.
+
+      Federal Acquisitions: Commercial Software - Government Users
+      Subject to Standard License Terms and Conditions.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      This is the XML Schema for the JSP 2.0 deployment descriptor
+      types.  The JSP 2.0 schema contains all the special
+      structures and datatypes that are necessary to use JSP files
+      from a web application.
+
+      The contents of this schema is used by the web-app_2_4.xsd
+      file to define JSP specific content.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all J2EE
+      deployment descriptor elements unless indicated otherwise.
+
+      - In elements that specify a pathname to a file within the
+	same JAR file, relative filenames (i.e., those not
+	starting with "/") are considered relative to the root of
+	the JAR file's namespace.  Absolute filenames (i.e., those
+	starting with "/") also specify names in the root of the
+	JAR file's namespace.  In general, relative names are
+	preferred.  The exception is .war files where absolute
+	names are preferred for consistency with the Servlet API.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="j2ee_1_4.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="jsp-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The jsp-configType is used to provide global configuration
+	information for the JSP files in a web application. It has
+	two subelements, taglib and jsp-property-group.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="taglib"
+		   type="j2ee:taglibType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="jsp-property-group"
+		   type="j2ee:jsp-property-groupType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="jsp-fileType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The jsp-file element contains the full path to a JSP file
+	within the web application beginning with a `/'.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:pathType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="jsp-property-groupType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The jsp-property-groupType is used to group a number of
+	files so they can be given global property information.
+	All files so described are deemed to be JSP files.  The
+	following additional properties can be described:
+
+	    - Control whether EL is ignored
+	    - Control whether scripting elements are invalid
+	    - Indicate pageEncoding information.
+	    - Indicate that a resource is a JSP document (XML)
+	    - Prelude and Coda automatic includes.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="j2ee:descriptionGroup"/>
+      <xsd:element name="url-pattern"
+		   type="j2ee:url-patternType"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="el-ignored"
+		   type="j2ee:true-falseType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Can be used to easily set the isELIgnored
+	    property of a group of JSP pages.  By default, the
+	    EL evaluation is enabled for Web Applications using
+	    a Servlet 2.4 or greater web.xml, and disabled
+	    otherwise.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="page-encoding"
+		   type="j2ee:string"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The valid values of page-encoding are those of the
+	    pageEncoding page directive.  It is a
+	    translation-time error to name different encodings
+	    in the pageEncoding attribute of the page directive
+	    of a JSP page and in a JSP configuration element
+	    matching the page.  It is also a translation-time
+	    error to name different encodings in the prolog
+	    or text declaration of a document in XML syntax and
+	    in a JSP configuration element matching the document.
+	    It is legal to name the same encoding through
+	    mulitple mechanisms.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="scripting-invalid"
+		   type="j2ee:true-falseType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Can be used to easily disable scripting in a
+	    group of JSP pages.  By default, scripting is
+	    enabled.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="is-xml"
+		   type="j2ee:true-falseType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    If true, denotes that the group of resources
+	    that match the URL pattern are JSP documents,
+	    and thus must be interpreted as XML documents.
+	    If false, the resources are assumed to not
+	    be JSP documents, unless there is another
+	    property group that indicates otherwise.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="include-prelude"
+		   type="j2ee:pathType"
+		   minOccurs="0"
+		   maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The include-prelude element is a context-relative
+	    path that must correspond to an element in the
+	    Web Application.  When the element is present,
+	    the given path will be automatically included (as
+	    in an include directive) at the beginning of each
+	    JSP page in this jsp-property-group.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="include-coda"
+		   type="j2ee:pathType"
+		   minOccurs="0"
+		   maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The include-coda element is a context-relative
+	    path that must correspond to an element in the
+	    Web Application.  When the element is present,
+	    the given path will be automatically included (as
+	    in an include directive) at the end of each
+	    JSP page in this jsp-property-group.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="taglibType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The taglibType defines the syntax for declaring in
+	the deployment descriptor that a tag library is
+	available to the application.  This can be done
+	to override implicit map entries from TLD files and
+	from the container.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="taglib-uri"
+		   type="j2ee:string">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    A taglib-uri element describes a URI identifying a
+	    tag library used in the web application.  The body
+	    of the taglib-uri element may be either an
+	    absolute URI specification, or a relative URI.
+	    There should be no entries in web.xml with the
+	    same taglib-uri value.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="taglib-location"
+		   type="j2ee:pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    the taglib-location element contains the location
+	    (as a resource relative to the root of the web
+	    application) where to find the Tag Library
+	    Description file for the tag library.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+</xsd:schema>
+
diff --git a/xml/tests/testData/xml/maven-4.0.0.xsd b/xml/tests/testData/xml/maven-4.0.0.xsd
new file mode 100644
index 0000000..4f7e708
--- /dev/null
+++ b/xml/tests/testData/xml/maven-4.0.0.xsd
@@ -0,0 +1,2213 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://maven.apache.org/POM/4.0.0" xmlns="http://maven.apache.org/POM/4.0.0">
+  <xs:element name="project" type="Model">
+    <xs:annotation>
+      <xs:documentation source="version">3.0.0+</xs:documentation>
+      <xs:documentation source="description">
+         The &lt;code&gt;&amp;lt;project&amp;gt;&lt;/code&gt; element is the root of the descriptor.
+         The following table lists all of the possible child elements.
+      </xs:documentation>
+    </xs:annotation>
+  </xs:element>
+  <xs:complexType name="Model">
+    <xs:annotation>
+      <xs:documentation source="version">3.0.0+</xs:documentation>
+      <xs:documentation source="description">
+         The &lt;code&gt;&amp;lt;project&amp;gt;&lt;/code&gt; element is the root of the descriptor.
+         The following table lists all of the possible child elements.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="parent" minOccurs="0" type="Parent">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The location of the parent project, if one exists. Values from the
+            parent project will be the default for this project if they are
+            left unspecified. The location is given as a group ID, artifact ID and version.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="modelVersion" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Declares to which version of project descriptor this POM conforms.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="groupId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            A universally unique identifier for a project. It is normal to
+            use a fully-qualified package name to distinguish it from other projects with a similar name
+            (eg. &lt;code&gt;org.apache.maven&lt;/code&gt;).
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="artifactId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The identifier for this artifact that is unique within the group given by the group ID.
+            An artifact is something that is either produced or used by a project. Examples of artifacts produced by
+            Maven for a project include: JARs, source and binary distributions, and WARs.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="packaging" minOccurs="0" type="xs:string" default="jar">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The type of artifact this project produces, for example &lt;code&gt;jar&lt;/code&gt;
+              &lt;code&gt;war&lt;/code&gt;
+              &lt;code&gt;ear&lt;/code&gt;
+              &lt;code&gt;pom&lt;/code&gt;.
+            Plugins can create their own packaging, and
+            therefore their own packaging types,
+            so this list does not contain all possible types.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="name" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The full name of the project.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="version" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The current version of the artifact produced by this project.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="description" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            A detailed description of the project, used by Maven whenever it needs to describe the project,
+            such as on the web site. While this element can be specified as CDATA to enable
+            the use of HTML tags within the description, it is discouraged to allow plain text representation.
+            If you need to modify the index page of the generated web site, you are able to specify your own instead
+            of adjusting this text.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="url" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+             The URL to the project&apos;s homepage.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="prerequisites" minOccurs="0" type="Prerequisites">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Describes the prerequisites in the build environment for this project.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="issueManagement" minOccurs="0" type="IssueManagement">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The project&apos;s issue management system information.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="ciManagement" minOccurs="0" type="CiManagement">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The project&apos;s continuous integration information.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="inceptionYear" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The year of the project&apos;s inception, specified with 4 digits.
+            This value is used when generating copyright notices as well as being informational.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="mailingLists" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            Contains information about a project&apos;s mailing lists.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="mailingList" minOccurs="0" maxOccurs="unbounded" type="MailingList"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="developers" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            Describes the committers of a project.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="developer" minOccurs="0" maxOccurs="unbounded" type="Developer"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="contributors" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            Describes the contributors to a project that are not yet committers.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="contributor" minOccurs="0" maxOccurs="unbounded" type="Contributor"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="licenses" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            This element describes all of the licenses for this project.
+            Each license is described by a &lt;code&gt;license&lt;/code&gt; element, which
+            is then described by additional elements.
+            Projects should only list the license(s) that applies to the project
+            and not the licenses that apply to dependencies.
+            If multiple licenses are listed, it is assumed that the user can select any of them, not that they
+            must accept all.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="license" minOccurs="0" maxOccurs="unbounded" type="License"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="scm" minOccurs="0" type="Scm">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Specification for the SCM used by the project, such as CVS, Subversion, etc.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="organization" minOccurs="0" type="Organization">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            This element describes various attributes of the organization to
+            which the project belongs.  These attributes are utilized when
+            documentation is created (for copyright notices and links).
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="build" minOccurs="0" type="Build">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">Information required to build the project.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="profiles" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            A listing of project-local build profiles which will modify the build process when activated.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="profile" minOccurs="0" maxOccurs="unbounded" type="Profile"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="modules" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The modules (sometimes called subprojects) to build as a part of this project.
+            Each module listed is a relative path to the directory containing the module.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="module" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="repositories" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The lists of the remote repositories for discovering dependencies and
+          extensions.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="repository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="pluginRepositories" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The lists of the remote repositories for discovering plugins for builds and reports.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="pluginRepository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="dependencies" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+              This element describes all of the dependencies associated with a
+              project.
+              These dependencies are used to construct a classpath for your
+              project during the build process. They are automatically downloaded from the
+              repositories defined in this project.
+              See &lt;a href=&quot;http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html&quot;&gt;the
+              dependency mechanism&lt;/a&gt; for more information.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="dependency" minOccurs="0" maxOccurs="unbounded" type="Dependency"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="reports" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            &lt;b&gt;Deprecated&lt;/b&gt;. Now ignored by Maven.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="reporting" minOccurs="0" type="Reporting">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            This element includes the specification of report plugins to use to generate the reports on the
+            Maven-generated site.  These reports will be run when a user executes &lt;code&gt;mvn site&lt;/code&gt;.  All of the
+            reports will be included in the navigation bar for browsing.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="dependencyManagement" minOccurs="0" type="DependencyManagement">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Default dependency information for projects that inherit from
+            this one. The dependencies in this section are not immediately resolved.
+            Instead, when a POM derived from this one declares a dependency
+            described by a matching groupId and artifactId, the version and other values from this
+            section are used for that dependency if they were not already specified.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="distributionManagement" minOccurs="0" type="DistributionManagement">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Distribution information for a project that enables deployment of the site
+          and artifacts to remote web servers and repositories respectively.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="properties" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+             Properties that can be used throughout the POM as a substitution, and are used as filters in resources
+             if enabled. The format is &lt;code&gt;&amp;lt;name&amp;gt;value&amp;lt;/name&amp;gt;&lt;/code&gt;.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Contributor">
+    <xs:annotation>
+      <xs:documentation source="version">3.0.0+</xs:documentation>
+      <xs:documentation source="description">
+        Description of a person who has contributed to the project, but who does
+        not have commit privileges. Usually, these contributions come in the
+        form of patches submitted.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="name" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The full name of the contributor.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="email" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The email address of the contributor.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="url" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The URL for the homepage of the contributor.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="organization" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The organization to which the contributor belongs.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="organizationUrl" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The URL of the organization.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="roles" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The roles the contributor plays in the project.  Each role is
+            described by a &lt;code&gt;role&lt;/code&gt; element, the body of which is a
+            role name. This can also be used to describe the contribution.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="role" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="timezone" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The timezone the contributor is in. This is a number in the range -11 to 12.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="properties" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            Properties about the contributor, such as an instant messenger handle.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Profile">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">
+        Modifications to the build process which is activated based on environmental parameters or command line arguments.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="id" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The identifier of this build profile. This used both for command line activation, and identifies
+            identical profiles to merge with during inheritance.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="activation" minOccurs="0" type="Activation">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The conditional logic which will automatically
+            trigger the inclusion of this profile.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="build" minOccurs="0" type="BuildBase">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Information required to build the project.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="modules" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The modules (sometimes called subprojects) to build as a part of this project.
+            Each module listed is a relative path to the directory containing the module.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="module" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="repositories" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The lists of the remote repositories for discovering dependencies and
+          extensions.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="repository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="pluginRepositories" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The lists of the remote repositories for discovering plugins for builds and reports.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="pluginRepository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="dependencies" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+              This element describes all of the dependencies associated with a
+              project.
+              These dependencies are used to construct a classpath for your
+              project during the build process. They are automatically downloaded from the
+              repositories defined in this project.
+              See &lt;a href=&quot;http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html&quot;&gt;the
+              dependency mechanism&lt;/a&gt; for more information.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="dependency" minOccurs="0" maxOccurs="unbounded" type="Dependency"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="reports" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            &lt;b&gt;Deprecated&lt;/b&gt;. Now ignored by Maven.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="reporting" minOccurs="0" type="Reporting">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            This element includes the specification of report plugins to use to generate the reports on the
+            Maven-generated site.  These reports will be run when a user executes &lt;code&gt;mvn site&lt;/code&gt;.  All of the
+            reports will be included in the navigation bar for browsing.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="dependencyManagement" minOccurs="0" type="DependencyManagement">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Default dependency information for projects that inherit from
+            this one. The dependencies in this section are not immediately resolved.
+            Instead, when a POM derived from this one declares a dependency
+            described by a matching groupId and artifactId, the version and other values from this
+            section are used for that dependency if they were not already specified.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="distributionManagement" minOccurs="0" type="DistributionManagement">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Distribution information for a project that enables deployment of the site
+          and artifacts to remote web servers and repositories respectively.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="properties" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+             Properties that can be used throughout the POM as a substitution, and are used as filters in resources
+             if enabled. The format is &lt;code&gt;&amp;lt;name&amp;gt;value&amp;lt;/name&amp;gt;&lt;/code&gt;.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Activation">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">
+        The conditions within the build runtime environment which will trigger
+        the automatic inclusion of the build profile.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="activeByDefault" minOccurs="0" type="xs:boolean" default="false">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Flag specifying whether this profile is active by default.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="jdk" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Specifies that this profile will be activated when a matching JDK is detected. For example, &lt;code&gt;1.4&lt;/code&gt;
+            only activates on JDKs versioned 1.4, while &lt;code&gt;!1.4&lt;/code&gt; matches any JDK that is not version 1.4.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="os" minOccurs="0" type="ActivationOS">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Specifies that this profile will be activated when matching operating system attributes are detected.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="property" minOccurs="0" type="ActivationProperty">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Specifies that this profile will be activated when this system property is specified.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="file" minOccurs="0" type="ActivationFile">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+             Specifies that this profile will be activated based on existence of a file.
+             </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="ActivationFile">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">
+        This is the file specification used to activate the profile. The missing value will be the location
+        of a file that needs to exist, and if it doesn&apos;t the profile will be activated.  On the other hand exists will test
+        for the existence of the file and if it is there the profile will be activated.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="missing" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The name of the file that must be missing to activate the profile.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="exists" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The name of the file that must exist to activate the profile.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="ActivationProperty">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">
+        This is the property specification used to activate a profile. If the value field is empty,
+        then the existence of the named property will activate the profile, otherwise it does a case-sensitive
+        match against the property value as well.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="name" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The name of the property to be used to activate a profile.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="value" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The value of the property required to activate a profile.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="ActivationOS">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">
+        This is an activator which will detect an operating system&apos;s attributes in order to activate
+        its profile.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="name" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The name of the operating system to be used to activate the profile. This must be an exact match
+          of the &lt;code&gt;${os.name}&lt;/code&gt; Java property, such as &lt;code&gt;Windows XP&lt;/code&gt;.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="family" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The general family of the OS to be used to activate the profile, such as &lt;code&gt;windows&lt;/code&gt; or &lt;code&gt;unix&lt;/code&gt;.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="arch" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The architecture of the operating system to be used to activate the profile.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="version" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The version of the operating system to be used to activate the profile.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="DependencyManagement">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">
+        Section for management of default dependency information for use in a group of POMs.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="dependencies" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The dependencies specified here are not used until they
+            are referenced in a POM within the group. This allows the
+            specification of a &quot;standard&quot; version for a particular
+            dependency.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="dependency" minOccurs="0" maxOccurs="unbounded" type="Dependency"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Dependency">
+    <xs:annotation>
+      <xs:documentation source="version">3.0.0+</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="groupId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The project group that produced the dependency, e.g.
+            &lt;code&gt;org.apache.maven&lt;/code&gt;.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="artifactId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The unique id for an artifact produced by the project group, e.g.
+            &lt;code&gt;maven-artifact&lt;/code&gt;.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="version" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The version of the dependency, e.g. &lt;code&gt;3.2.1&lt;/code&gt;. In Maven 2, this can also be
+            specified as a range of versions.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="type" minOccurs="0" type="xs:string" default="jar">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The type of dependency. This defaults to &lt;code&gt;jar&lt;/code&gt;. While it usually represents the extension on
+            the filename of the dependency, that is not always the case. A type can be mapped to a different
+            extension and a classifier.
+            The type often correspongs to the packaging used, though this is also not always the case.
+            Some examples are &lt;code&gt;jar&lt;/code&gt;, &lt;code&gt;war&lt;/code&gt;, &lt;code&gt;ejb-client&lt;/code&gt; and &lt;code&gt;test-jar&lt;/code&gt;.
+            New types can be defined by plugins that set
+            &lt;code&gt;extensions&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;, so this is not a complete list.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="classifier" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The classifier of the dependency. This allows distinguishing two artifacts that belong to the same POM but
+            were built differently, and is appended to the filename after the version. For example,
+            &lt;code&gt;jdk14&lt;/code&gt; and &lt;code&gt;jdk15&lt;/code&gt;.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="scope" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The scope of the dependency - &lt;code&gt;compile&lt;/code&gt;, &lt;code&gt;runtime&lt;/code&gt;, &lt;code&gt;test&lt;/code&gt;,
+            &lt;code&gt;system&lt;/code&gt;, and &lt;code&gt;provided&lt;/code&gt;. Used to
+            calculate the various classpaths used for compilation, testing, and so on. It also assists in determining
+            which artifacts to include in a distribution of this project. For more information, see
+            &lt;a href=&quot;http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html&quot;&gt;the
+            dependency mechanism&lt;/a&gt;.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="systemPath" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            FOR SYSTEM SCOPE ONLY. Note that use of this property is &lt;b&gt;discouraged&lt;/b&gt; and may be replaced in later
+            versions. This specifies the path on the filesystem for this dependency.
+            Requires an absolute path for the value, not relative.
+            Use a property that gives the machine specific absolute path,
+            e.g. &lt;code&gt;${java.home}&lt;/code&gt;.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="exclusions" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Lists a set of artifacts that should be excluded from this dependency&apos;s artifact list when it comes to
+            calculating transitive dependencies.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="exclusion" minOccurs="0" maxOccurs="unbounded" type="Exclusion"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="optional" minOccurs="0" type="xs:boolean" default="false">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Indicates the dependency is optional for use of this library. While the version of the dependency will be
+            taken into account for dependency calculation if the library is used elsewhere, it will not be passed on
+            transitively.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Exclusion">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="artifactId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The artifact ID of the project to exclude.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="groupId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The group ID of the project to exclude.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Reporting">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">Section for management of reports and their configuration.</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="excludeDefaults" minOccurs="0" type="xs:boolean" default="false">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">If true, then the default reports are not included in the site generation. This includes the
+            reports in the &quot;Project Info&quot; menu.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="outputDirectory" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Where to store all of the generated reports. The default is
+            &lt;code&gt;${project.build.directory}/site&lt;/code&gt;
+            .
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="plugins" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The reporting plugins to use and their configuration.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="plugin" minOccurs="0" maxOccurs="unbounded" type="ReportPlugin"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="ReportPlugin">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="groupId" minOccurs="0" type="xs:string" default="org.apache.maven.plugins">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The group ID of the reporting plugin in the repository.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="artifactId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The artifact ID of the reporting plugin in the repository.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="version" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The version of the reporting plugin to be used.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="inherited" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Whether the configuration in this plugin should be made available to projects that
+            inherit from this one.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="configuration" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The configuration of the reporting plugin.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="reportSets" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Multiple specifications of a set of reports, each having (possibly) different
+            configuration. This is the reporting parallel to an &lt;code&gt;execution&lt;/code&gt; in the build.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="reportSet" minOccurs="0" maxOccurs="unbounded" type="ReportSet"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="ReportSet">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">Represents a set of reports and configuration to be used to generate them.</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="id" minOccurs="0" type="xs:string" default="default">
+        <xs:annotation>
+          <xs:documentation source="version">0.0.0+</xs:documentation>
+          <xs:documentation source="description">The unique id for this report set, to be used during POM inheritance.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="configuration" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Configuration of the report to be used when generating this set.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="inherited" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Whether any configuration should be propagated to child POMs.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="reports" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The list of reports from this plugin which should be generated from this set.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="report" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="BuildBase">
+    <xs:annotation>
+      <xs:documentation source="version">3.0.0+</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="defaultGoal" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The default goal (or phase in Maven 2) to execute when none is specified for the project.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="resources" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            This element describes all of the classpath resources such as properties files associated with a
+            project. These resources are often included in the final package.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="resource" minOccurs="0" maxOccurs="unbounded" type="Resource"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testResources" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            This element describes all of the classpath resources such as properties files associated with a
+            project&apos;s unit tests.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="testResource" minOccurs="0" maxOccurs="unbounded" type="Resource"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="directory" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The directory where all files generated by the build are placed.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="finalName" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The filename (excluding the extension, and with no path information) that the produced artifact
+            will be called. The default value is &lt;code&gt;${artifactId}-${version}&lt;/code&gt;.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="filters" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+          The list of filter properties files that are used when filtering is enabled.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="pluginManagement" minOccurs="0" type="PluginManagement">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Default plugin information to be made available for reference by
+            projects derived from this one. This plugin configuration will not
+            be resolved or bound to the lifecycle unless referenced. Any local
+            configuration for a given plugin will override the plugin&apos;s entire
+            definition here.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="plugins" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The list of plugins to use.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="plugin" minOccurs="0" maxOccurs="unbounded" type="Plugin"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Plugin">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="groupId" minOccurs="0" type="xs:string" default="org.apache.maven.plugins">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The group ID of the plugin in the repository.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="artifactId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The artifact ID of the plugin in the repository.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="version" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The version (or valid range of verisons) of the plugin to be used.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="extensions" minOccurs="0" type="xs:boolean" default="false">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Whether to load Maven extensions (such as packaging and type handlers) from this
+            plugin. For performance reasons, this should only be enabled when necessary.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="executions" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Multiple specifications of a set of goals to execute during the build lifecycle, each having
+            (possibly) different
+            configuration.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="execution" minOccurs="0" maxOccurs="unbounded" type="PluginExecution"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="dependencies" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Additional dependencies that this project needs to introduce to the plugin&apos;s
+            classloader.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="dependency" minOccurs="0" maxOccurs="unbounded" type="Dependency"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="goals" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            &lt;b&gt;Deprecated&lt;/b&gt;. Unused by Maven.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="inherited" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Whether any configuration should be propagated to child POMs.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="configuration" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">0.0.0+</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="PluginExecution">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="id" minOccurs="0" type="xs:string" default="default">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The identifier of this execution for labelling the goals during the build, and for matching
+            exections to merge during inheritance.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="phase" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The build lifecycle phase to bind the goals in this execution to. If omitted, the goals will
+            be bound to the default specified in their metadata.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="goals" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The goals to execute with the given configuration.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="goal" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="inherited" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Whether any configuration should be propagated to child POMs.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="configuration" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">0.0.0+</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="PluginManagement">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">
+        Section for management of default plugin information for use in a group of POMs.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="plugins" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The list of plugins to use.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="plugin" minOccurs="0" maxOccurs="unbounded" type="Plugin"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Resource">
+    <xs:annotation>
+      <xs:documentation source="version">3.0.0+</xs:documentation>
+      <xs:documentation source="description">
+        This element describes all of the classpath resources associated with a project or
+        unit tests.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="targetPath" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            Describe the resource target path. For example, if you want that
+            resource to appear in a specific package
+            (&lt;code&gt;org.apache.maven.messages&lt;/code&gt;), you must specify this
+            element with this value: &lt;code&gt;org/apache/maven/messages&lt;/code&gt;.
+            This is not required if you simply put the resources in that directory structure at the source, however.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="filtering" minOccurs="0" type="xs:boolean" default="false">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            Whether resources are filtered to replace tokens with parameterised values or not.
+            The values are taken from the &lt;code&gt;properties&lt;/code&gt; element and from the properties in the files listed
+            in the &lt;code&gt;filters&lt;/code&gt; element.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="directory" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            Describe the directory where the resources are stored.
+            The path is relative to the POM.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="includes" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">A list of patterns to include, e.g. &lt;code&gt;**&amp;#47;*.xml&lt;/code&gt;.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="include" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="excludes" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">A list of patterns to exclude, e.g. &lt;code&gt;**&amp;#47;*.xml&lt;/code&gt;</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="DistributionManagement">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">
+        This elements describes all that pertains to distribution for a project.
+        It is primarily used for deployment of artifacts and the site
+        produced by the build.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="repository" minOccurs="0" type="DeploymentRepository">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Information needed to deploy the artifacts generated by the project to a remote repository.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="snapshotRepository" minOccurs="0" type="DeploymentRepository">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Where to deploy snapshots of artifacts to. If not given, it defaults to the &lt;code&gt;repository&lt;/code&gt; element.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="site" minOccurs="0" type="Site">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Information needed for deploying the web site of the project.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="downloadUrl" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The URL of the project&apos;s download page. If not given users will be referred to the homepage given by
+            &lt;code&gt;url&lt;/code&gt;. This is given to assist in locating artifacts that are not in the repository due to
+            licensing restrictions.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="relocation" minOccurs="0" type="Relocation">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Relocation information of the artifact if it has been moved to a new group ID and/or artifact ID.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="status" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Gives the status of this artifact in the remote repository. This must not be set in your local
+            project, as it is updated by tools placing it in the reposiory. Valid values are: &lt;code&gt;none&lt;/code&gt; (default),
+            &lt;code&gt;converted&lt;/code&gt; (repository manager converted this from an Maven 1 POM), &lt;code&gt;partner&lt;/code&gt;
+            (directly synced from a partner Maven 2 repository), &lt;code&gt;deployed&lt;/code&gt; (was deployed from a Maven 2
+            instance), &lt;code&gt;verified&lt;/code&gt; (has been hand verified as correct and final).
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Site">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">
+         Contains the information needed for deploying websites.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="id" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            A unique identifier for a deployment locataion. This is used to match the site to configuration in
+            the &lt;code&gt;settings.xml&lt;/code&gt; file, for example.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="name" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Human readable name of the deployment location.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="url" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+             The url of the location where website is deployed, in the form &lt;code&gt;protocol://hostname/path&lt;/code&gt;.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Relocation">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">Describes where an artifact has moved to. If any of the values are omitted, it is assumed to be the
+        same as it was before.</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="groupId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The group ID the artifact has moved to.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="artifactId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The new artifact ID of the artifact.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="version" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The new version of the artifact.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="message" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">An additional message to show the user about the move, such as the reason.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="DeploymentRepository">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">
+        Repository contains the information needed for deploying to the remote repoistory.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="uniqueVersion" minOccurs="0" type="xs:boolean" default="true">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Whether to assign snapshots a unique version comprised of the timestamp and build number, or to
+            use the same version each time</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="id" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            A unique identifier for a repository. This is used to match the repository to configuration in
+            the &lt;code&gt;settings.xml&lt;/code&gt; file, for example.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="name" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Human readable name of the repository.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="url" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+             The url of the repository, in the form &lt;code&gt;protocol://hostname/path&lt;/code&gt;.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="layout" minOccurs="0" type="xs:string" default="default">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The type of layout this repository uses for locating and storing artifacts - can be &lt;code&gt;legacy&lt;/code&gt; or
+            &lt;code&gt;default&lt;/code&gt;.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Repository">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">
+        A repository contains the information needed for establishing connections with remote repoistory.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="releases" minOccurs="0" type="RepositoryPolicy">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">How to handle downloading of releases from this repository.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="snapshots" minOccurs="0" type="RepositoryPolicy">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">How to handle downloading of snapshots from this repository.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="id" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            A unique identifier for a repository. This is used to match the repository to configuration in
+            the &lt;code&gt;settings.xml&lt;/code&gt; file, for example.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="name" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Human readable name of the repository.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="url" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+             The url of the repository, in the form &lt;code&gt;protocol://hostname/path&lt;/code&gt;.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="layout" minOccurs="0" type="xs:string" default="default">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The type of layout this repository uses for locating and storing artifacts - can be &lt;code&gt;legacy&lt;/code&gt; or
+            &lt;code&gt;default&lt;/code&gt;.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="RepositoryPolicy">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">Download policy</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="enabled" minOccurs="0" type="xs:boolean" default="true">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Whether to use this repository for downloading this type of artifact.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="updatePolicy" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The frequency for downloading updates - can be
+            &lt;code&gt;always,&lt;/code&gt;
+            &lt;code&gt;daily&lt;/code&gt;
+            (default),
+            &lt;code&gt;interval:XXX&lt;/code&gt;
+            (in minutes) or
+            &lt;code&gt;never&lt;/code&gt;
+            (only if it doesn&apos;t exist locally).
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="checksumPolicy" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            What to do when verification of an artifact checksum fails. Valid values are
+            &lt;code&gt;ignore&lt;/code&gt;
+            ,
+            &lt;code&gt;fail&lt;/code&gt;
+            or
+            &lt;code&gt;warn&lt;/code&gt;
+            (the default).
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="MailingList">
+    <xs:annotation>
+      <xs:documentation source="version">3.0.0+</xs:documentation>
+      <xs:documentation source="description">
+        This element describes all of the mailing lists associated with
+        a project. The auto-generated site references this information.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="name" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The name of the mailing list.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="subscribe" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The email address or link that can be used to subscribe to the mailing list.
+            If this is an email address, a
+            &lt;code&gt;mailto:&lt;/code&gt; link will automatically be created when
+            the documentation is created.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="unsubscribe" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The email address or link that can be used to unsubscribe to
+            the mailing list.  If this is an email address, a
+            &lt;code&gt;mailto:&lt;/code&gt; link will automatically be created
+            when the documentation is created.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="post" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The email address or link that can be used to post to
+            the mailing list.  If this is an email address, a
+            &lt;code&gt;mailto:&lt;/code&gt; link will automatically be created
+            when the documentation is created.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="archive" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The link to a URL where you can browse the mailing list archive.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="otherArchives" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The link to alternate URLs where you can browse the list archive.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="otherArchive" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Build">
+    <xs:annotation>
+      <xs:documentation source="version">3.0.0+</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="sourceDirectory" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            This element specifies a directory containing the source
+            of the project. The generated build system will compile
+            the source in this directory when the project is built.
+            The path given is relative to the project descriptor.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="scriptSourceDirectory" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            This element specifies a directory containing the script sources
+            of the project. This directory is meant to be different from the
+            sourceDirectory, in that its contents will be copied to the output
+            directory in most cases (since scripts are interpreted rather than
+            compiled).
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="testSourceDirectory" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            This element specifies a directory containing the unit test
+            source of the project. The generated build system will
+            compile these directories when the project is being tested.
+            The path given is relative to the project descriptor.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="outputDirectory" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The directory where compiled application classes are placed.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="testOutputDirectory" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The directory where compiled test classes are placed.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="extensions" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">A set of build extensions to use from this project.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="extension" minOccurs="0" maxOccurs="unbounded" type="Extension"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="defaultGoal" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The default goal (or phase in Maven 2) to execute when none is specified for the project.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="resources" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            This element describes all of the classpath resources such as properties files associated with a
+            project. These resources are often included in the final package.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="resource" minOccurs="0" maxOccurs="unbounded" type="Resource"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testResources" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            This element describes all of the classpath resources such as properties files associated with a
+            project&apos;s unit tests.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="testResource" minOccurs="0" maxOccurs="unbounded" type="Resource"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="directory" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The directory where all files generated by the build are placed.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="finalName" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The filename (excluding the extension, and with no path information) that the produced artifact
+            will be called. The default value is &lt;code&gt;${artifactId}-${version}&lt;/code&gt;.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="filters" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+          The list of filter properties files that are used when filtering is enabled.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="pluginManagement" minOccurs="0" type="PluginManagement">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Default plugin information to be made available for reference by
+            projects derived from this one. This plugin configuration will not
+            be resolved or bound to the lifecycle unless referenced. Any local
+            configuration for a given plugin will override the plugin&apos;s entire
+            definition here.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="plugins" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The list of plugins to use.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="plugin" minOccurs="0" maxOccurs="unbounded" type="Plugin"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Extension">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">Describes a build extension to utilise.</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="groupId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The group ID of the extension&apos;s artifact.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="artifactId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The artifact ID of the extension.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="version" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The version of the extension.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="IssueManagement">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">
+        Information about the issue tracking (or bug tracking) system used to manage this project.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="system" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The name of the issue management system, e.g. Bugzilla</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="url" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">URL for the issue management system used by the project.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Parent">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="artifactId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The artifact id of the parent project to inherit from.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="groupId" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The group id of the parent project to inherit from.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="version" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The version of the parent project to inherit.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="relativePath" minOccurs="0" type="xs:string" default="../pom.xml">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The relative path of the parent &lt;code&gt;pom.xml&lt;/code&gt; file within the check out.
+            The default value is &lt;code&gt;../pom.xml&lt;/code&gt;.
+            Maven looks for the parent pom first in the reactor of currently building projects, then in this location on
+            the filesystem, then the local repository, and lastly in the remote repo.
+            &lt;code&gt;relativePath&lt;/code&gt; allows you to select a different location,
+            for example when your structure is flat, or deeper without an intermediate parent pom.
+            However, the group ID, artifact ID and version are still required,
+            and must match the file in the location given or it will revert to the repository for the POM.
+            This feature is only for enhancing the development in a local checkout of that project.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Prerequisites">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">Describes the prerequisites a project can have.</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="maven" minOccurs="0" type="xs:string" default="2.0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The minimum version of Maven required to build the project, or to use this plugin.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="CiManagement">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="system" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The name of the continuous integration system, e.g. &lt;code&gt;continuum&lt;/code&gt;.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="url" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            URL for the continuous integration system used by the project if it has a web interface.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="notifiers" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Configuration for notifying developers/users when a build is
+            unsuccessful, including user information and notification mode.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="notifier" minOccurs="0" maxOccurs="unbounded" type="Notifier"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Notifier">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+      <xs:documentation source="description">
+        Configures one method for notifying users/developers when a build breaks.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="type" minOccurs="0" type="xs:string" default="mail">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">The mechanism used to deliver notifications.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="sendOnError" minOccurs="0" type="xs:boolean" default="true">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Whether to send notifications on error.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="sendOnFailure" minOccurs="0" type="xs:boolean" default="true">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Whether to send notifications on failure.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="sendOnSuccess" minOccurs="0" type="xs:boolean" default="true">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Whether to send notifications on success.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="sendOnWarning" minOccurs="0" type="xs:boolean" default="true">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">Whether to send notifications on warning.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="address" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            &lt;b&gt;Deprecated&lt;/b&gt;. Where to send the notification to - eg email address.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="configuration" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">0.0.0+</xs:documentation>
+          <xs:documentation source="description">Extended configuration specific to this notifier goes here.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="License">
+    <xs:annotation>
+      <xs:documentation source="version">3.0.0+</xs:documentation>
+      <xs:documentation source="description">
+        Describes the licenses for this project.  This is used to generate
+        the license page of the project&apos;s web site, as well as being taken into consideration in other reporting and
+        validation. The licenses listed for the project are that of the project itself, and not of dependencies.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="name" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The full legal name of the license.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="url" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The official url for the license text.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="distribution" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+              The primary method by which this project may be distributed.
+            &lt;dl&gt;
+              &lt;dt&gt;repo&lt;/dt&gt;
+              &lt;dd&gt;may be downloaded from the Maven repository&lt;/dd&gt;
+              &lt;dt&gt;manual&lt;/dt&gt;
+              &lt;dd&gt;user must manually download and install the dependency.&lt;/dd&gt;
+            &lt;/dl&gt;
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="comments" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            Addendum information pertaining to this license.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Developer">
+    <xs:annotation>
+      <xs:documentation source="version">3.0.0+</xs:documentation>
+      <xs:documentation source="description">
+        Information about one of the committers on this project.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="id" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The unique ID of the developer in the SCM.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="name" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The full name of the contributor.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="email" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The email address of the contributor.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="url" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The URL for the homepage of the contributor.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="organization" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The organization to which the contributor belongs.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="organizationUrl" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The URL of the organization.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="roles" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The roles the contributor plays in the project.  Each role is
+            described by a &lt;code&gt;role&lt;/code&gt; element, the body of which is a
+            role name. This can also be used to describe the contribution.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="role" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="timezone" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            The timezone the contributor is in. This is a number in the range -11 to 12.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="properties" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">
+            Properties about the contributor, such as an instant messenger handle.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Scm">
+    <xs:annotation>
+      <xs:documentation source="version">4.0.0</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="connection" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+              The source control management system URL
+              that describes the repository and how to connect to the
+              repository. For more information, see the
+              &lt;a href=&quot;http://maven.apache.org/scm/scm-url-format.html&quot;&gt;URL format&lt;/a&gt;
+              and &lt;a href=&quot;http://maven.apache.org/scm/scms-overview.html&quot;&gt;list of supported SCMs&lt;/a&gt;.
+              This connection is read-only.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="developerConnection" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            Just like &lt;code&gt;connection&lt;/code&gt;, but for developers, i.e. this scm connection
+            will not be read only.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="tag" minOccurs="0" type="xs:string" default="HEAD">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The tag of current code. By default, it&apos;s set to HEAD during development.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="url" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">4.0.0</xs:documentation>
+          <xs:documentation source="description">
+            The URL to the project&apos;s browsable SCM repository, such as ViewVC or Fisheye.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:complexType name="Organization">
+    <xs:annotation>
+      <xs:documentation source="version">3.0.0+</xs:documentation>
+      <xs:documentation source="description">Specifies the organization that produces this project.</xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name="name" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The full name of the organization.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="url" minOccurs="0" type="xs:string">
+        <xs:annotation>
+          <xs:documentation source="version">3.0.0+</xs:documentation>
+          <xs:documentation source="description">The URL to the organization&apos;s home page.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/mule-management.xsd b/xml/tests/testData/xml/mule-management.xsd
new file mode 100644
index 0000000..71c5c45
--- /dev/null
+++ b/xml/tests/testData/xml/mule-management.xsd
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/management/2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:mule="http://www.mulesource.org/schema/mule/core/2.0"
+            xmlns:spring="http://www.springframework.org/schema/beans"
+            targetNamespace="http://www.mulesource.org/schema/mule/management/2.0" elementFormDefault="qualified"
+            attributeFormDefault="unqualified">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:import namespace="http://www.mulesource.org/schema/mule/core/2.0"
+                schemaLocation="mule.xsd" />
+    <xsd:import namespace="http://www.springframework.org/schema/beans"
+                schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"/>
+
+    <!-- JMX Agent-->
+    <xsd:element name="jmx-server" type="jmxServerType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="jmxServerType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType">
+                <xsd:sequence>
+                    <xsd:element name="connector-server" type="connectorServerType" minOccurs="0" />
+                    <xsd:element name="credentials" type="mule:mapType" minOccurs="0" />
+                </xsd:sequence>
+                <xsd:attribute name="server-ref" type="xsd:NMTOKEN"/>
+                <xsd:attribute name="locateServer" type="mule:substitutableBoolean" default="true" />
+                <xsd:attribute name="createServer" type="mule:substitutableBoolean" default="true" />
+                <xsd:attribute name="enableStatistics" type="mule:substitutableBoolean" default="true" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="connectorServerType">
+        <xsd:attribute name="url" type="xsd:string" use="required" />
+        <xsd:attribute name="rebind" type="mule:substitutableBoolean" use="optional" default="true" />
+    </xsd:complexType>
+
+    <!-- JMX Adaptors -->
+    <xsd:element name="jmx-mx4j-adaptor" type="jmxMx4jAdaptorType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="jmxMx4jAdaptorType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType">
+                <xsd:sequence>
+                    <xsd:element name="socketFactoryProperties" type="mule:mapType" minOccurs="0" />
+                </xsd:sequence>
+                <xsd:attribute name="jmxAdaptorUrl" type="xsd:string" />
+                <xsd:attribute name="login" type="xsd:string" />
+                <xsd:attribute name="password" type="xsd:string" />
+                <xsd:attribute name="authenticationMethod" default="basic">
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="none" />
+                            <xsd:enumeration value="basic" />
+                            <xsd:enumeration value="digest" />
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="cacheXsl" type="xsd:string" default="true" />
+                <xsd:attribute name="xslFilePath" type="xsd:string" />
+                <xsd:attribute name="pathInJar" type="xsd:string" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--  JMX Agents -->
+
+    <!-- Rmi Registry Agent -->
+    <xsd:element name="rmi-server" type="rmiServerTyper" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="rmiServerTyper">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType">
+                <xsd:attribute name="serverUri" type="xsd:string" />
+                <xsd:attribute name="createRegistry" type="mule:substitutableBoolean" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="jmx-log4j" type="jmxLog4jType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="jmxLog4jType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType" />
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="jmx-default-config" type="jmxDefaultConfigType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="jmxDefaultConfigType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType">
+                <xsd:sequence>
+                    <xsd:element name="credentials" type="mule:mapType" minOccurs="0" />
+                </xsd:sequence>
+                <xsd:attribute name="registerMx4jAdapter" type="mule:substitutableBoolean" />
+                <xsd:attribute name="host" type="xsd:string" />
+                <xsd:attribute name="port" type="mule:substitutablePortNumber" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- JMX Notifications -->
+
+    <xsd:complexType name="notificationLoggerAgentType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType">
+                <xsd:attribute name="ignoreManagerNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreModelNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreComponentNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreConnectionNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreSecurityNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreManagementNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreCustomNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreAdminNotifications" type="mule:substitutableBoolean" default="false"/>
+                <xsd:attribute name="ignoreMessageNotifications" type="mule:substitutableBoolean" default="false"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="jmx-notifications" type="jmxNotificationType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="jmxNotificationType">
+        <xsd:complexContent>
+            <xsd:extension base="notificationLoggerAgentType" />
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="log4j-notifications" type="log4jNotificationType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="log4jNotificationType">
+        <xsd:complexContent>
+            <xsd:extension base="notificationLoggerAgentType">
+                <xsd:sequence>
+                    <xsd:element name="level-mapping" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:complexType>
+                            <xsd:attribute name="severity" type="serveritySimpleType" default="INFO" />
+                            <xsd:attribute name="eventId" type="xsd:string" use="required" />
+                        </xsd:complexType>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="logName" type="xsd:string" />
+                <xsd:attribute name="logConfigFile" type="xsd:string" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="chainsaw-notifications" type="chainsawNotificationType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="chainsawNotificationType">
+        <xsd:complexContent>
+            <xsd:extension base="notificationLoggerAgentType">
+                <xsd:sequence>
+                    <xsd:element name="level-mapping" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:complexType>
+                            <xsd:attribute name="severity" type="serveritySimpleType" default="INFO" />
+                            <xsd:attribute name="eventId" type="xsd:string" use="required" />
+                        </xsd:complexType>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="chainsawHost" type="xsd:string" use="required" />
+                <xsd:attribute name="chainsawPort" type="mule:substitutablePortNumber" use="required" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:simpleType name="serveritySimpleType">
+        <xsd:restriction base="xsd:NMTOKEN">
+            <xsd:enumeration value="DEBUG" />
+            <xsd:enumeration value="INFO" />
+            <xsd:enumeration value="WARN" />
+            <xsd:enumeration value="ERROR" />
+            <xsd:enumeration value="FATAL" />
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <xsd:element name="publish-notifications" type="publishNotificationType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="publishNotificationType">
+        <xsd:complexContent>
+            <xsd:extension base="notificationLoggerAgentType">
+                <xsd:attribute name="endpointAddress" type="xsd:string" use="required" />
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="yourkit-profiler" substitutionGroup="mule:abstract-extension"/>
+
+    <xsd:element name="custom-agent" type="customAgentType" substitutionGroup="mule:abstract-extension"/>
+    <xsd:complexType name="customAgentType">
+        <xsd:complexContent>
+            <xsd:extension base="mule:abstractAgentType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="xsd:NMTOKEN" use="required"/>
+                <xsd:attribute name="name" type="mule:substitutableName" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Identifies the agent in the registry.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/mule.xsd b/xml/tests/testData/xml/mule.xsd
new file mode 100644
index 0000000..595bd71
--- /dev/null
+++ b/xml/tests/testData/xml/mule.xsd
@@ -0,0 +1,3827 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xsd:schema xmlns="http://www.mulesource.org/schema/mule/core/2.0"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:spring="http://www.springframework.org/schema/beans"
+            xmlns:spring-context="http://www.springframework.org/schema/context"
+            targetNamespace="http://www.mulesource.org/schema/mule/core/2.0"
+            attributeFormDefault="unqualified"
+            elementFormDefault="qualified">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+    <xsd:import namespace="http://www.springframework.org/schema/beans"
+                schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"/>
+    <xsd:import namespace="http://www.springframework.org/schema/context"
+                schemaLocation="http://www.springframework.org/schema/context/spring-context-2.5.xsd"/>
+
+    <!--==============================================================-->
+    <!--   Structure                                                  -->
+    <!--==============================================================-->
+
+    <!-- This defines the structure in abstract terms (except for a few simple/unique things like
+         global properties).  We then provide some implementations below.  Other modules
+         can provide other implementations. -->
+
+    <xsd:element name="mule" type="muleType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Either the root element of a Mule configuration,
+                or a "top-level" element in a Spring configuration,
+                that contains further Mule elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="muleType">
+        <xsd:sequence>
+            <xsd:element name="description" type="descriptionType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        This can hold any kind of documentation consistent with the overall XML format).
+                        It is intended to be "human readable" only and is not used by the system.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="springRootElements"/>
+                <xsd:group ref="muleRootElements"/>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:group name="springRootElements">
+        <xsd:choice>
+            <xsd:element ref="spring:beans">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Allow embedding of further spring documents.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="spring:bean">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        We support direct use of spring beans via this tag.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="spring-context:property-placeholder">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        We support direct use of property placeholders via this tag.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:group name="muleRootElements">
+        <xsd:choice>
+            <xsd:element name="global-property" type="globalPropertyType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        An global property is a named string.
+                        It can be used inserted in most attribute values using the ${...} syntax.
+                        So the attribute value "${foo}" would be replaced by the value associated with
+                        the property named "foo".
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="configuration" type="configurationType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Defaults and general settings for the entire Mule system.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="notifications" type="notificationManagerType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Register listeners for notifications
+                        and associate interfaces with particular events.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="abstract-extension"/>
+            <xsd:element ref="abstract-security-manager"/>
+            <xsd:element ref="abstract-transaction-manager"/>
+            <xsd:element ref="abstract-connector"/>
+            <xsd:element ref="abstract-global-endpoint"/>
+            <xsd:element ref="abstract-transformer"/>
+            <xsd:element ref="abstract-filter"/>
+            <xsd:element ref="abstract-model"/>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:complexType name="descriptionType">
+        <xsd:complexContent mixed="true">
+            <xsd:extension base="xsd:anyType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-extension" abstract="true" type="abstractExtensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for arbitrary extensions as children of the mule element.
+                Other transports and modules may extend this if they need to add global
+                elements to the configuration (but consider the more specific elements
+                like abstract-connector first).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractExtensionType"/>
+
+    <xsd:element name="abstract-connector" abstract="true" type="abstractConnectorType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for connector elements.
+                Connector elements allow properties to be configured across all endpoints that
+                use the same transport.
+                If multiple connectors are defined for the same transport then each endpoint
+                must name which connector is being used.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractConnectorType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the connector so that other elements can reference it.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-global-endpoint" abstract="true" type="abstractGlobalEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for global endpoint elements.
+                Global endpoints are named templates that allow us to define an endpoint once
+                and refer to it in several places.
+                Currently the same template is used for both inbound and outbound endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractGlobalEndpointType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the endpoint so that other elements can reference it.
+                    This name can also be referenced in MuleClient.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-inbound-endpoint" abstract="true" type="abstractInboundEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for inbound endpoint elements.
+                Inbound endpoints receive messages from the underlying transport.
+                The message payload is then delivered to the component for processing.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInboundEndpointType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the inbound endpoint in the registry, but is of relatively little use
+                    - it cannot be referred to from MuleClient, for example.
+                    For more useful aliases, use global endpoints.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-outbound-endpoint" abstract="true" type="abstractOutboundEndpointType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for outbound endpoint elements.
+                Outbound endpoints dispatch messages to the underlying transport.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractOutboundEndpointType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the outbound endpoint in the registry, but is of relatively little use
+                    - it cannot be referred to from MuleClient, for example.
+                    For more useful aliases, use global endpoints.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-transformer" abstract="true" type="abstractTransformerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transformer elements.
+                Transformers convert message payloads.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransformerType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the transformer so that other elements can reference it.
+                    Required if the transformer is defined at the global level.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="returnClass" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class of the message generated by the transformer.
+                    This is used if transformers are auto-selected
+                    (which is somewhat incomplete at the moment?).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="ignoreBadInput" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Many transformers only accept certain classes.
+                    Such transformers are never called with inappropriate input
+                    (whatever the value of this attribute).
+                    If a transformer forms part of a chain and cannot accept the current message class,
+                    then this flag controls whether the remaining part of the chain is evaluated.
+                    If true, the next transformer is called.
+                    If false the chain ends, keeping the result generated up to that point.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="globalPropertyType">
+        <xsd:attribute name="name" type="substitutableName" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the property.
+                    This is used inside ${...}.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="value" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The value of the property.
+                    This replaces each occurence of ${...}.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- seemed pointless making these simple container types abstract -->
+    <xsd:complexType name="inboundCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-catch-all-strategy" minOccurs="0"/>
+            <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-inbound-router" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-catch-all-strategy" abstract="true" type="abstractCatchAllStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for catch-all strategy elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractCatchAllStrategyType"/>
+
+    <xsd:element name="abstract-inbound-router" abstract="true" type="abstractInboundRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for inbound router elements.
+                Inbound routers control how incoming messages are handled.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractInboundRouterType"/>
+
+    <xsd:element name="abstract-filter" abstract="true" type="abstractFilterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for filter elements.
+                Filters are used to make decisions within the Mule framework.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractFilterType">
+        <xsd:attribute name="name" type="substitutableName">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Identifies the filter so that other elements can reference it.
+                    Required if the filter is defined at the global level.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="not" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Inverts the filter's condition.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="outboundCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-catch-all-strategy" minOccurs="0"/>
+            <xsd:element ref="abstract-outbound-router" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="matchAll" type="substitutableBoolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true, the output message will be sent to all routers, otherwise only
+                    the first matching router is used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-outbound-router" abstract="true" type="abstractOutboundRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for outbound router elements.
+                Outbound routers control how outgoing messages are delivered to the outbound endpoints.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractOutboundRouterType"/>
+
+    <xsd:element name="abstract-transaction-manager" abstract="true" type="abstractTransactionManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transaction manager elements.
+                Transaction managers are used to co-ordinate transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransactionManagerType"/>
+
+    <xsd:complexType name="configurationType">
+        <xsd:sequence>
+            <xsd:element name="default-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default threading profile,
+                        used by components and by endpoints for dispatching and receiving
+                        if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-dispatcher-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default dispatching threading profile, modifies the default-threading-profile
+                        values and is used by endpoints for dispatching
+                        if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-receiver-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default receiving threading profile, modifies the default-threading-profile
+                        values and is used by endpoints for receiving
+                        if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-component-threading-profile" type="threadingProfileType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        The default component threading profile, modifies the default-threading-profile
+                        values and is used if no more specific configuration is given.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="defaultSynchronousEndpoints" type="substitutableBoolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true then connections to endpoints will wait for a response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="defaultRemoteSync" type="substitutableBoolean" default="false">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true then connections to endpoints will wait for a response from the remote service.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="defaultSynchronousEventTimeout" type="xsd:string" default="3000">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The default period (ms) to wait for a synchronous response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="defaultTransactionTimeout" type="xsd:string" default="5000">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The default timeout for transactions,
+                    used if no more specific configuration is given.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="notificationManagerType">
+        <xsd:sequence>
+            <xsd:element name="notification" type="defineNotificationType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Associate an event with an interface.
+                        Listeners which implement the interface will receive instances of the event.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="disable-notification" type="disableNotificationType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Block the association of an event with a particular interface.
+                        This filters events after the association with a particular interface
+                        (and so takes precedence).
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="notification-listener" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Register a bean as a listener with the notification system.
+                        Events are dispatched by reflection - the listener will receive all events
+                        associated with any interfaces it implements.
+                        The relationship between interfaces and events is configured by the
+                        notification and disable-notification elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                    <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The bean that will receive notifications.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                    <xsd:attribute name="subscription" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                An optional string that is compared with the event's resource identifier.
+                                Only events with matching identifiers will be sent.
+                                If no value is given, all events are sent.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="dynamic" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If the notification manager is dynamic then programatic updates to the manager
+                    (ie via Java code) will affect all messages.
+                    Otherwise, some parts of the system may cache state for
+                    efficiency and so not generate newly enabled notifications.
+                    The default value is false.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="defineNotificationType">
+        <xsd:attribute name="event-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class associated with a notification event that will be delivered to the interface.
+                    This can be used instead of the event attribute to specify a custom class.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="event" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The notification event to deliver.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface (class name) that will receive the notification event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface that will receive the notification event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="disableNotificationType">
+        <xsd:attribute name="event-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The class associated with an event that will no longer be delivered to any interface.
+                    This can be used instead of the event attribute to specify a custom class.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="event" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The event to not deliver.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface-class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface (class name) that will no longer receive an event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="interface" type="notificationTypes">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface that will no longer receive an event.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+
+    <xsd:simpleType name="notificationTypes">
+        <xsd:annotation>
+            <xsd:documentation>
+                The interface that will no longer receive an event.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:NMTOKEN">
+            <xsd:enumeration value="MANAGER"/>
+            <xsd:enumeration value="MODEL"/>
+            <xsd:enumeration value="SERVICE"/>
+            <xsd:enumeration value="SECURITY"/>
+            <xsd:enumeration value="MESSAGE"/>
+            <xsd:enumeration value="MANAGEMENT"/>
+            <xsd:enumeration value="CONNECTION"/>
+            <xsd:enumeration value="REGISTRY"/>
+            <xsd:enumeration value="CUSTOM"/>
+            <xsd:enumeration value="EXCEPTION"/>
+            <xsd:enumeration value="TRANSACTION"/>
+            <xsd:enumeration value="ROUTING"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <!--==============================================================-->
+    <!-- Models                                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-model" abstract="true" type="abstractModelType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for model elements.
+                A model provides basic settings and processing for all the services it contains.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractModelType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-exception-strategy" minOccurs="0"/>
+            <xsd:group ref="entryPointResolvers"/>
+            <xsd:element ref="abstract-service" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="name" type="nonBlankString">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name used to identify this model.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="seda-model" type="sedaModelType" substitutionGroup="abstract-model">
+        <xsd:annotation>
+            <xsd:documentation>
+                A SEDA (Staged Event Drivern Architecture) model has separate threads and
+                queues for each component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="sedaModelType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractModelType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-queue-profile" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="inherit" type="xsd:boolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If true then this model element is an extension of a previous model
+                            element with the same name.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="model" type="defaultModelType" substitutionGroup="abstract-model">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default model is a SEDA model.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="defaultModelType">
+        <xsd:complexContent>
+            <xsd:extension base="sedaModelType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Model elements -->
+
+    <xsd:element name="abstract-queue-profile" abstract="true" type="abstractQueueProfileType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for queue profile elements.
+                A queue profile controls how messages are queued before being processed.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractQueueProfileType"/>
+
+    <!-- to give a cleaner config we allow either a set or an individual entry (but not both).-->
+    <xsd:group name="entryPointResolvers">
+        <xsd:choice>
+            <xsd:element ref="abstract-entry-point-resolver-set" minOccurs="0"/>
+            <!-- we could allow many of these, but it looks ugly -->
+            <xsd:element ref="abstract-entry-point-resolver" minOccurs="0"/>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:element name="abstract-entry-point-resolver-set" abstract="true" type="abstractEntryPointResolverSetType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for entry point resolver set elements.
+                These combine a group of entry point resolvers, trying them in turn until one succeeds.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractEntryPointResolverSetType"/>
+
+    <xsd:element name="legacy-entry-point-resolver-set" type="extensibleEntryPointResolverSet"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                An extensible set of entry point resolvers (which determine how a message is passed to a component in
+                Java)
+                that already contains resolvers to implement the standard logic.
+                This is already provided by default and is only needed explicitly if
+                it will be extended with other entry point resolvers.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="entry-point-resolver-set" type="extensibleEntryPointResolverSet"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                An extensible set of entry point resolvers.
+                These determine how a message is passed to a component in Java.
+                Each entry point resolver is tried in turn until one succeeds in delivering the messge to the component.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="extensibleEntryPointResolverSet">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverSetType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-entry-point-resolver" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-entry-point-resolver-set" type="customEntryPointResolverSetType"
+                 substitutionGroup="abstract-entry-point-resolver-set">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom entry point resolver set.
+                This allows user-supplied code to determine how a message is passed to a component in Java.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customEntryPointResolverSetType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverSetType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the EntryPointResolverSet interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-entry-point-resolver" abstract="true" type="abstractEntryPointResolverType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an entry point resolver element.
+                Entry point resolvers define how payloads are delivered to Java code
+                (ie they choose the method to call).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="callable-entry-point-resolver" type="abstractEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                An entry point resolver for components that implement the Callable interface.
+                This passes a MuleEventContext to the component.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+                This element can also be used directly or as part of a set of resolvers;
+                the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractEntryPointResolverType"/>
+
+    <xsd:element name="custom-entry-point-resolver" type="customEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom entry point resolver.
+                This allows user-supplied code to determine how a message is passed to a component in Java.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+                This element can also be used directly or as part of a set of resolvers;
+                the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the EntryPointResolver interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractEntryPointResolverType">
+                <xsd:attribute name="transformFirst" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Should the message be transformer before being delivered to the component?
+                            By default, messages are transformed.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="acceptVoidMethods" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Should the resolver call void methods?
+                            By default, void methods are not considered as possible candidates for message delivery.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="property-entry-point-resolver" type="propertyEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Use a message property to select the component method to be called.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+                This element can also be used directly or as part of a set of resolvers;
+                the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="propertyEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:attribute name="property" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the message property used to select a method on the component.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="method-entry-point-resolver" type="methodEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Deliver the message to a named method.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+                This element can also be used directly or as part of a set of resolvers;
+                the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="methodEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="include-entry-point" minOccurs="1" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="reflection-entry-point-resolver" type="reflectionEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Generate a list of candidate methods from the component via reflections.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+                This element can also be used directly or as part of a set of resolvers;
+                the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="reflectionEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="baseEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element name="exclude-object-methods" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                If specified, methods in the Java Object interface are not included in
+                                the list of possible methods that can receive the message.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="exclude-entry-point" type="methodType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Explicitly exclude a named method from receiving the message.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="array-entry-point-resolver" type="complexEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Deliver the message to a method which takes a single array as argument.
+                This element can be set on the model or component;
+                the model value provides a default which individual component values can override.
+                This element can also be used directly or as part of a set of resolvers;
+                the resolvers in a set are used in turn until one is successful.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="no-arguments-entry-point-resolver" type="complexEntryPointResolverType"
+                 substitutionGroup="abstract-entry-point-resolver">
+        <xsd:annotation>
+            <xsd:documentation>
+                Call a method without arguments (the message is not passed to the component).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="complexEntryPointResolverType">
+        <xsd:complexContent>
+            <xsd:extension base="reflectionEntryPointResolverType">
+                <xsd:sequence>
+                    <xsd:element ref="include-entry-point" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="enableDiscovery" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="include-entry-point" type="methodType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A possible method for delivery.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="methodType">
+        <xsd:attribute name="method" type="nonBlankString">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the method.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--  Services                                                    -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-service" abstract="true" type="abstractServiceType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for a service element.
+                Services combine message routing with a Java (typically) component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractServiceType">
+        <xsd:attribute name="name" type="nonBlankString" use="required">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name used to identify this service.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseServiceType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Base support for a model-based wrapper around the POJO service (SEDA, Streaming, etc.)
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractServiceType">
+                <xsd:sequence>
+                    <xsd:element name="description" type="descriptionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                This can hold any kind of documentation consistent with the overall XML format).
+                                It is intended to be "human readable" only and is not used by the system.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="inbound" type="inboundCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within "inbound" describe how messages enter the service.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <!-- minOccurs="0" to allow for <forwarding-router/> and/or default component -->
+                    <xsd:element ref="abstract-component" minOccurs="0"/>
+                    <xsd:element name="outbound" type="outboundCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within "outbound" describe how messages leave the service.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="async-reply" type="asyncReplyCollectionType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The elements within "async-reply" describe how asynchronous replies are handled.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element ref="abstract-exception-strategy" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="initialState" default="started">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The initial state of the service.
+                            Usually a service is started automatically, but this attribute can block any
+                            initial startup ("stopped") or stop the service immediately after initial
+                            startup ("paused").
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="started"/>
+                            <xsd:enumeration value="stopped"/>
+                            <xsd:enumeration value="paused"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-exception-strategy" abstract="true" type="abstractExceptionStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an exception strategy element.
+                Exception strategies define how Mule should react to errors.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="abstractExceptionStrategyType">
+        <xsd:sequence>
+            <xsd:element name="commit-transaction" type="exceptionPatternType" maxOccurs="1" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Defines when a current transaction gets rolled-back depending on the name of the
+                        exception caught. Users can set a comma delimited list of wildcard patterns that wil be matched
+                        angainst the fully qualified classname of the current exception. Patterns defined for this
+                        element will leave the current transaction (if any) untouched and llow it to be committed.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="rollback-transaction" type="exceptionPatternType" maxOccurs="1" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Defines when a current transaction gets rolled-back depending on the name of the
+                        exception caught. Users can set a comma delimited list of wildcard patterns that wil be matched
+                        angainst the fully qualified classname of the current exception. Patterns defined for this
+                        element will rollback the current transaction (if any).
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="enableNotifications" type="xsd:boolean">
+            <xsd:annotation>
+                <xsd:documentation>Determines whether ExceptionNotifications wil be fired from this strategy when an
+                    exception occurs.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="exceptionPatternType">
+        <xsd:attribute name="exception-pattern" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>A comma-separate list of wildcard expressions that will be matched against the
+                    fully qualified cassname of the current exception received by the ExceptionStrategy.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="asyncReplyCollectionType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-async-reply-router" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="timeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The timeout (ms) to wait for a reply.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="failOnTimeout" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If the router times out before all expected events have been received should an exception be thrown
+                    or should the current events be returned for processing. The default is false.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-async-reply-router" abstract="true" type="abstractAsyncReplyRouterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for an async reply router element.
+                Asynchronous replies are handled via this router.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractAsyncReplyRouterType"/>
+
+    <xsd:element name="service" type="sedaServiceType" substitutionGroup="abstract-service">
+        <xsd:annotation>
+            <xsd:documentation>
+                The standard SEDA service.
+                A service describes how to receive messages, deliver them to
+                a component, and handle the results (if any).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="sedaServiceType">
+        <xsd:complexContent>
+            <xsd:extension base="baseServiceType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-component-threading-profile" minOccurs="0"/>
+                    <xsd:element ref="abstract-queue-profile" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="queueTimeout" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The timeout used when taking messages from the SEDA queue.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-service" type="customServiceType" substitutionGroup="abstract-service">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemeted service
+                (typically used only in testing).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customServiceType">
+        <xsd:complexContent>
+            <xsd:extension base="baseServiceType">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The class to use for the service.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-component-threading-profile" abstract="true"
+                 type="abstractComponentThreadingProfileType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for component threading profile element.
+                Threading profils define how thread pools interact with the component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractComponentThreadingProfileType"/>
+
+    <!--==============================================================-->
+    <!-- Components                                              -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-component" abstract="true" type="abstractComponentType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for component element.
+                A component processes data. Typically it is a Java object.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractComponentType">
+        <xsd:sequence>
+            <xsd:group ref="entryPointResolvers"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="component" type="defaultJavaComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                A simple POJO (Plain Old Java Object) component
+                that will be invoked by Mule when a message is received.
+                The instance can be specified via a factory, or via a class.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="defaultJavaComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractComponentType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-object-factory" minOccurs="0"/>
+                    <xsd:element ref="abstract-lifecycle-adapter-factory" minOccurs="0"/>
+                    <xsd:element name="binding" type="pojoBindingType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                A binding associates a Mule endpoint with an injected Java interface
+                                (this is like using Spring to inject a bean, but instead of calling a
+                                method on the bean a message is sent to an endpoint).
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Specify a component class.
+                            This is a shortcut that is equivalent to providing a prototype-object element.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="pooled-component" type="pooledJavaComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                A pooled POJO (Plain Old Java Object) component
+                that will be invoked by Mule when a message is received.
+                The instance can be specified via a factory, or via a class.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="pooledJavaComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="defaultJavaComponentType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-pooling-profile" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Characteristics of the object pool</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <xsd:complexType name="pojoBindingType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="interface" use="required" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The interface to be injected.
+                    A proxy will be created that implements this interface by calling out to the endpoint.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="method" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The method on the interface that should be used.
+                    This can be omitted if the interface has a single method.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="defaultComponentType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractComponentType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="bridge-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                This transfers a message from inbound to outbound endpoints.
+                This name is provided for backwards compatability - it is equivalent to not specifying any component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!-- don't expose this, it's not needed -->
+    <!-- xsd:element name="pass-through-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default, "do nothing" component.
+                The message is simply transferred from inbound to outbound endpoints.
+                This is the default and need not be specified.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element -->
+
+    <xsd:element name="echo-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                This logs the message and returns the payload back as the result.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="log-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                This logs the message content (or content length if it is a large message).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="null-component" type="defaultComponentType" substitutionGroup="abstract-component">
+        <xsd:annotation>
+            <xsd:documentation>
+                This will throw an exception if it receives a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+
+    <!--==============================================================-->
+    <!--   Transactions                                               -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-transaction" abstract="true" type="abstractTransactionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for transaction elements.
+                Transactions allow a series of operations to be grouped together.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractTransactionType">
+        <xsd:attribute name="action">
+            <xsd:annotation>
+                <xsd:documentation>
+                    NONE - Never participate in a transaction;
+                    ALWAYS_BEGIN - Always start a new transaction when receiving an event. An exception will be thrown
+                    if a transaction already exists;
+                    BEGIN_OR_JOIN - If a transaction is already in progress when an event is received, join the
+                    transaction, otherwise start a new transaction;
+                    ALWAYS_JOIN - Always expects a transaction to be in progress when an event is received, if there is
+                    no transaction an exception is thrown;
+                    JOIN_IF_POSSIBLE - Will join the current transaction if one is available otherwise no transaction is
+                    created.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="NONE"/>
+                    <xsd:enumeration value="ALWAYS_BEGIN"/>
+                    <xsd:enumeration value="BEGIN_OR_JOIN"/>
+                    <xsd:enumeration value="ALWAYS_JOIN"/>
+                    <xsd:enumeration value="JOIN_IF_POSSIBLE"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="timeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Timeout for transaction (ms).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseTransactionType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-transaction" type="customTransactionType" substitutionGroup="abstract-transaction">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allow access to user-defined or otherwise unsupported third party transactions.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransactionType">
+        <xsd:complexContent>
+            <xsd:extension base="baseTransactionType">
+                <xsd:attribute name="factory-class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the TransactionFactory interface.
+                            This will be instantiated and used to generate a transaction.
+                            The attribute and the "factory-ref" attribute are mutually exclusive;
+                            one of the two is required.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="factory-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A bean that implements the TransactionFactory interface.
+                            This will be used to generate a transaction.
+                            The attribute and the "factory-class" attribute are mutually exclusive;
+                            one of the two is required.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="transactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionManagerType">
+                <xsd:attribute name="name" type="substitutableName" default="transactionManager" use="optional">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An optional name for the transaction manager.
+                            The default value is "transactionManager".
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="websphere-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The Websphere transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="jboss-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The JBoss transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="jndiTransactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransactionManagerType">
+                <xsd:sequence>
+                    <xsd:element name="environment" type="mapType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The JNDI environment.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="weblogic-transaction-manager" type="jndiTransactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The Weblogic transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="jrun-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The JRun transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="resin-transaction-manager" type="transactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The Resin transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="jndi-transaction-manager" substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                Retrieve a named transaction manager factory from JNDI.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="jndiTransactionManagerType">
+                    <xsd:attribute name="jndiName" type="xsd:string">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The name of the manager factory to retrieve (eg java:/TransactionManager).
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="custom-transaction-manager" type="customTransactionManagerType"
+                 substitutionGroup="abstract-transaction-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented transaction manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransactionManagerType">
+        <xsd:complexContent>
+            <xsd:extension base="jndiTransactionManagerType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The class to instantiate to create a transaction manager.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--   Endpoint elements                                          -->
+    <!--==============================================================-->
+
+    <xsd:element name="endpoint" type="globalEndpointType" substitutionGroup="abstract-global-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An endpoint "template" which can be used to construct an inbound or outbound endpoint
+                elsewhere in the configuration by referencing the endpoint's name.
+                Each transport implements its own endpoint element, with a more friendly syntax,
+                but this generic element can be used with any transport by supplying the correct
+                address URI. For example, "vm://foo" describes a VM transport endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="globalEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractGlobalEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="inbound-endpoint" type="inboundEndpointType" substitutionGroup="abstract-inbound-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An inbound endpoint receives messages from the associated transport.
+                Each transport implements its own inbound endpoint element, with a more friendly syntax,
+                but this generic element can be used with any transport by supplying the correct
+                address URI. For example, "vm://foo" describes a VM transport endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="inboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInboundEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="outbound-endpoint" type="outboundEndpointType" substitutionGroup="abstract-outbound-endpoint">
+        <xsd:annotation>
+            <xsd:documentation>
+                An outbound endpoint sends messages to the associated transport.
+                Each transport implements its own outbound endpoint element, with a more friendly syntax,
+                but this generic element can be used with any transport by supplying the correct
+                address URI. For example, "vm://foo" describes a VM transport endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="outboundEndpointType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundEndpointType">
+                <xsd:group ref="defaultEndpointElements"/>
+                <xsd:attributeGroup ref="defaultEndpointAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- these include option/repeats - should be embedded once -->
+    <xsd:group name="defaultEndpointElements">
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:group ref="endpointTransformers"/>
+                <xsd:element ref="abstract-transaction" minOccurs="0"/>
+                <xsd:element ref="abstract-filter" minOccurs="0"/>
+                <xsd:element ref="abstract-security-filter" minOccurs="0"/>
+                <xsd:group ref="propertiesGroup"/>
+            </xsd:sequence>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:element name="abstract-security-filter" abstract="true" type="abstractSecurityFilterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for security filter elements.
+                Security filters can control access to the system, etc.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="abstractSecurityFilterType"/>
+
+    <xsd:attributeGroup name="defaultEndpointAttributes">
+        <xsd:attributeGroup ref="restrictedEndpointAttributes"/>
+        <!-- these next two attributes are mutually exclusive and one is required.
+             but there is no way to define this in a schema... -->
+        <!-- endpoint references - dynamically checked to make sure not top level -->
+        <xsd:attribute name="ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A reference to a global endpoint.
+                    If this attribute is used then the endpoint is used as a template to construct this endpoint.
+                    A template fixes the address (protocol, path, host, etc), and may specify initial values for
+                    various properties, but further properties can be defined locally (as long as they don't
+                    change the address in any way).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <!-- explicit or global endpoints -->
+        <xsd:attribute name="address" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The generic address for this endpoint.
+                    If this attribute is used then the protocol must be specified as part of the URI.
+                    Alternatively, most transports provide alternative attributes for specifying the address
+                    (path, host etc).
+                    Note that the address attribute cannot be combined with "ref" or with the transport-provided
+                    alternative attributes.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:attributeGroup name="restrictedEndpointAttributes">
+        <xsd:attribute name="synchronous" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true the result from the component processing the incoming message will be
+                    returned as a response.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="remoteSync" type="substitutableBoolean">
+            <xsd:annotation>
+                <xsd:documentation>
+                    If true the component will wait for a response to the outgoing message before
+                    replying to the incoming message.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="remoteSyncTimeout" type="substitutableInt">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The timeout for the remoteSync wait (ms).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="encoding" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    String encoding used for messages.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="connector-ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The name of the connector associated with this endpoint.
+                    This must be specified if more than one connector is defined for this transport.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A list of transformers which will be applied in order to the message before it is
+                    delivered to the component.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="responseTransformer-refs" type="xsd:NMTOKENS">
+            <xsd:annotation>
+                <xsd:documentation>
+                    A list of transformers which will be applied in order to the synchronous response
+                    before it is returned via the transport.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <xsd:complexType name="endpointRefType">
+        <xsd:attribute name="address" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The destination address for a reply message.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="ref" type="xsd:NMTOKEN">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The reference name of a global endpoint to use. If this EndpointRef will be associated to a message
+                    such as a Reply-To address, this endpoint ref has to be available on the remote Mule instance that reads the
+                    Reply-To address.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:group name="endpointTransformers">
+        <xsd:annotation>
+            <xsd:documentation>
+                This allows the user to specify either a simple list of (normal) transformers or
+                separate bracketed lists of normal and response transformers.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:choice>
+            <xsd:group ref="transformersList"/>
+            <xsd:sequence>
+                <xsd:element name="transformers" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A list of transformer elements that will be applied to the message
+                            before it is delivered to the component.
+                            Note that a list of transformers can also be specified directly
+                            (without the "transformers" element), but then it is not possible
+                            to also specify response transformers
+                            (using the "response-transformers" element).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:complexType>
+                        <xsd:group ref="transformersList"/>
+                    </xsd:complexType>
+                </xsd:element>
+                <xsd:element name="response-transformers" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A list of transformer elements that will be applied to the response message
+                            returned from the component.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:complexType>
+                        <xsd:group ref="transformersList"/>
+                    </xsd:complexType>
+                </xsd:element>
+            </xsd:sequence>
+        </xsd:choice>
+    </xsd:group>
+
+    <xsd:group name="transformersList">
+        <xsd:annotation>
+            <xsd:documentation>
+                A list of transformers - normal or response, depending on context.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!--==============================================================-->
+    <!--   Filter elements                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="filter" type="refFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that is defined elsewhere (at the global level, or as a Spring bean).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="refFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the filter to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="not-filter" type="unitaryFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Invert the enclosed filter
+                (so if it returns true for some message, this will return false, and vice-versa).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="unitaryFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="and-filter" type="collectionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Return true only if all the enclosed filters return true.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="or-filter" type="collectionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                Return true if any of the enclosed filters returns true.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="collectionFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter" minOccurs="2" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="wildcard-filter" type="wildcardFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches string messages against wildcards.
+                It performs matches with "*", i.e. "jms.events.*" would catch "jms.events.customer"
+                and "jms.events.receipts".
+                This filter accepts a comma-separated list of patterns, so more than one filter pattern can be
+                matched for a given argument: "jms.events.*, jms.actions.*" will match "jms.events.system"
+                and "jms.actions" but not "jms.queue".
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="wildcardFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="caseSensitivePatternFilterType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="expression-filter" type="expressionFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that can evaluate a range of expressions. It supports some base expression types
+                such as 'header', 'payload' (payload type), 'regex' and 'wildcard'.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="expressionFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="evaluator" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>The expression evaluator to use. The expression filter supports some types
+                            such as header, payload, exception, wildcard and regex, that are in-built filters not
+                            registered with the ExpressionEvaluatorManager. All others are registered with the
+                            ExpressionEvaluatorManager. Where XPath, bean and ongl are used, the expression should be a
+                            boolean expression.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="substitutableName">
+                            <xsd:enumeration value="header"/>
+                            <xsd:enumeration value="payload-type"/>
+                            <xsd:enumeration value="exception-type"/>
+                            <xsd:enumeration value="wildcard"/>
+                            <xsd:enumeration value="regex"/>
+                            <xsd:enumeration value="ognl"/>
+                            <xsd:enumeration value="xpath"/>
+                            <xsd:enumeration value="jxpath"/>
+                            <xsd:enumeration value="bean"/>
+                            <xsd:enumeration value="custom"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="expression" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>The expression that will be evaluated. This should always be a boolean
+                            expression.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="customEvaluator" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>Must be set if the evaluator is set to 'custom'. Also the custom evaluator
+                            must be registered with the ExpressionEvaluatorManager if it is to be used here.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="nullReturnsTrue" type="substitutableBoolean">
+                    <xsd:annotation>
+                        <xsd:documentation>If the specified expression returns null should the filter return true or
+                            false.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <xsd:element name="regex-filter" type="patternFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches string messages against a regular expression.
+                The Java regular expression engine (java.util.regex.Pattern) is used.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="patternFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="pattern" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The pattern to use when matching.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-property-filter" type="caseSensitivePatternFilterType"
+                 substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches properties on an event.
+                This can be very useful as the event properties represent all the meta information about the event
+                from the underlying transport, so for an event received over HTTP you can check for HTTP headers etc.
+                The pattern should be expressed as a key/value pair, i.e. "propertyName=value".
+                If you want to compare more than one property you can use the logic filters for And, Or and Not
+                expressions.
+                By default the comparison is case sensitive; you can set the caseSensitive property to override this.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="caseSensitivePatternFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="patternFilterType">
+                <xsd:attribute name="caseSensitive" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If false, the comparison ignores case.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="exception-type-filter" type="typeFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches the type of an exception.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="payload-type-filter" type="typeFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that matches the type of the payload.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="typeFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:attribute name="expectedType" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The expected class used in the comparison.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-filter" type="customFilterType" substitutionGroup="abstract-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented filter.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractFilterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the Filter interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- security filters -->
+
+    <xsd:element name="encryption-security-filter" type="encryptionSecurityFilterType"
+                 substitutionGroup="abstract-security-filter">
+        <xsd:annotation>
+            <xsd:documentation>
+                A filter that provides password based encyption.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="encryptionSecurityFilterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractSecurityFilterType">
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the encryption strategy to use.
+                            This should be configured using the password-encryption-strategy element,
+                            inside a security-manager element at the top level.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--   Transformer elements                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="transformer" type="refTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A reference to a transformer defined elsewhere.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="refTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:attribute name="ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the transformer to use,
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="auto-transformer" type="abstractTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that uses the transform discovery mechanism to convert the message payload. This
+                transformer works much better when transforming custom object types rather that java types since there
+                is less chance for ambiguity.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="custom-transformer" type="customTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-implemented transformer.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the Transformer interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-properties-transformer" type="messagePropertiesTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that can add or delete message properties.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="messagePropertiesTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:sequence>
+                    <xsd:element name="delete-message-property" type="keyType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Delete a message property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="add-message-property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Add a message property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="add-message-properties" type="mapType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Add a set of message properties.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="overwrite" type="substitutableBoolean" use="optional" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            If false, a property is not added if the message already contains a property with that name.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="no-action-transformer" type="abstractTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that has no effect.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="base64-encoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that base64 encodes a string or byte array message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="base64-decoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that base64 decodes a message to give an array of bytes.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="xml-entity-encoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that encodes a string using XML entities.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="xml-entity-decoder-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that decodes a string containing XML entities.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="gzip-compress-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that compresses a byte array using gzip.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="gzip-uncompress-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that uncompresses a byte array using gzip.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-hex-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to a string of hexadecimal digits.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="hex-string-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a string of hexadecimal digits to a byte array.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-object-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to an object (either deserializing or converting to a string).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="object-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that serializes all objects except strings (which are converted using getBytes()).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="object-to-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that gives a human-readable description of various types (useful for debugging).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-serializable-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to an object (ie deserializing the object).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="serializable-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts an object to a byte array (ie serializing the object).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="byte-array-to-string-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a byte array to a string.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="string-to-byte-array-transformer" type="abstractTransformerType"
+                 substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that converts a string to a byte array.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="append-string-transformer" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that appends a string to a string payload.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="abstractTransformerType">
+                    <xsd:attribute name="message" type="xsd:string" use="required">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                The string to append.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:attribute>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="encrypt-transformer" type="encryptionTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that encrypts a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="decrypt-transformer" type="encryptionTransformerType" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that decrypts a message.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="encryptionTransformerType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractTransformerType">
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the encryption strategy to use.
+                            This should be configured using the password-encryption-strategy element,
+                            inside a security-manager element at the top level.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="expression-transformer" substitutionGroup="abstract-transformer">
+        <xsd:annotation>
+            <xsd:documentation>
+                A transformer that evaluates one or more expressions on the current event. Each expression equates to a
+                parameter in the return message. The return message for 2 or more expressions will be an Object[].
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexType>
+            <xsd:complexContent>
+                <xsd:extension base="abstractTransformerType">
+                    <xsd:sequence minOccurs="1" maxOccurs="unbounded">
+                        <xsd:element name="return-argument">
+                            <xsd:complexType>
+                                <xsd:attributeGroup ref="expressionAttributes"/>
+                                <xsd:attribute name="optional" type="substitutableBoolean" use="optional">
+                                    <xsd:annotation>
+                                        <xsd:documentation>An optional expression means that if the expression evaluates
+                                            to null, it will continue to the next expression without error.
+                                        </xsd:documentation>
+                                    </xsd:annotation>
+                                </xsd:attribute>
+                            </xsd:complexType>
+                        </xsd:element>
+                    </xsd:sequence>
+                </xsd:extension>
+            </xsd:complexContent>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:attributeGroup name="expressionAttributes">
+        <xsd:attribute name="evaluator" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The expression evaluator to use. Expression Evaluators must be registered with the
+                    ExpressionEvaluatrManager before thay can be used. Using the custom evaluator allows the developer
+                    to define their on in the 'custom-evaluator' attribute. Note that some evaluators such as xpath,
+                    groovy and bean are loaded from other mule modules (xml and scripting respectively), these modules
+                    wll need to be on your classpath before the evaluator can be used.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:simpleType>
+                <xsd:restriction base="substitutableName">
+                    <xsd:enumeration value="groovy"/>
+                    <xsd:enumeration value="header"/>
+                    <xsd:enumeration value="headers"/>
+                    <xsd:enumeration value="headers-list"/>
+                    <xsd:enumeration value="attachment"/>
+                    <xsd:enumeration value="attachments"/>
+                    <xsd:enumeration value="attachments-list"/>
+                    <xsd:enumeration value="payload"/>
+                    <xsd:enumeration value="xpath"/>
+                    <xsd:enumeration value="jxpath"/>
+                    <xsd:enumeration value="bean"/>
+                    <xsd:enumeration value="ognl"/>
+                    <xsd:enumeration value="function"/>
+                    <xsd:enumeration value="custom"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+        <xsd:attribute name="expression" type="xsd:string" use="required">
+            <xsd:annotation>
+                <xsd:documentation>The expression to evaluate. The syntax of this will change depeneding on the
+                    evaluator being used.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="custom-evaluator" type="substitutableName" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>The name of the custom evaluator to use. This attribute is only used when the
+                    evaluator attribute is set to 'custom'. Users can plug in their own expression evaluators by
+                    registering them with the ExpressionEvaluatorManager.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:attributeGroup>
+
+    <!--==============================================================-->
+    <!--   Shared elements                                             -->
+    <!--==============================================================-->
+
+    <xsd:element name="queue-profile" type="queueProfileType" substitutionGroup="abstract-queue-profile">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configure the queue used on a component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="queueProfileType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractQueueProfileType">
+                <xsd:attribute name="maxOutstandingMessages" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The maximum size of the queue.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="persistent" type="substitutableBoolean" default="false">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether the queue is persistent.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-security-manager" type="abstractSecurityManagerType" abstract="true">
+        <xsd:annotation>
+            <xsd:documentation>
+                A security manager is a container for security providers. More than one
+                security manager may be configured; each contains providers from a particular
+                module and has that module's type. This element is abstract - a security
+                related module or transport will provide a suitable implementation.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="abstractSecurityManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                This is an empty holder that can be extended by modules that want to
+                provide security managers. Typically it will contain elements called
+                module:type-security-provider which extend securityProviderType
+                where "module" might be "acegi" and "type" might de "delegate", for example.
+                Alternatively (or in addition) it may contain encryption strategies,
+                which should follow a similar scheme and extend encryptionStrategyType.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="id" fixed="_muleSecurityManager"/>
+        <xsd:attribute name="name" fixed="_muleSecurityManager"/>
+    </xsd:complexType>
+
+    <xsd:element name="security-manager" type="securityManagerType" substitutionGroup="abstract-security-manager">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default security manager.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="securityManagerType">
+        <xsd:annotation>
+            <xsd:documentation>
+                The default security manager (type mule:defaultSecurityManagerType) provides
+                basic support for security functions. Other modules (eg Acegi, JAAS, PGP)
+                provide more advanced functionality.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractSecurityManagerType">
+                <xsd:sequence>
+                    <xsd:element name="custom-security-provider" type="customSecurityProviderType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Allow any implementation of UMOSecurityProvider to be used.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="custom-encryption-strategy" type="customEncryptionStrategyType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Allow any implementation of UMOEncryptionStrategy to be used.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="secret-key-encryption-strategy" type="secretKeyEncryptionStrategyType"
+                                 minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Provides secret key-based encryption using JCE.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="password-encryption-strategy" type="passwordEncryptionStrategyType"
+                                 minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Provides password-based encryption using JCE. Users must specify a password and
+                                optionally a salt and iteration count as well. The default algorithm is
+                                PBEWithMD5AndDES, but users can specify any valid algorithm supported by JCE.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="securityProviderType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A security provider is a source of a particular security-related functionality.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="name" type="substitutableName" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="encryptionStrategyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                An encryption strategy provides support for a particular encryption algorithm.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="name" type="substitutableName" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="customSecurityProviderType">
+        <xsd:complexContent>
+            <xsd:extension base="securityProviderType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="provider-ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the security provider to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="customEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="strategy-ref" type="xsd:NMTOKEN" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A reference to the encryption strategy (which may be a Spring bean that
+                            implements the EncryptionStrategy interface).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="passwordEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:attribute name="password" type="xsd:string" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The password to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="salt" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The salt to use (this helps prevent dictionary attacks).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="iterationCount" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The number of itreations to use.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="secretKeyEncryptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="encryptionStrategyType">
+                <xsd:attribute name="key" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The key to use.
+                            This and the keyFactory-ref attribute are mutually exclusive.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="keyFactory-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The name of the key factory to use.
+                            This should implement the ObjectFactory interface and return a byte array.
+                            This and the key attribute are mutually exclusive.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="component-threading-profile" type="threadingProfileType"
+                 substitutionGroup="abstract-component-threading-profile">
+        <xsd:annotation>
+            <xsd:documentation>
+                The threading profile to use on the component.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <!-- this is a general threading type used by various elements here -->
+    <xsd:complexType name="threadingProfileType">
+        <xsd:complexContent>
+            <!-- this is a hack that allows us to use this general threading profile as a component threading profile
+                 without retyping everything -->
+            <xsd:extension base="abstractComponentThreadingProfileType">
+                <xsd:attribute name="maxThreadsActive" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The maximum number of threads that will be used.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="maxThreadsIdle" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The maximum number of idle threads stored in the pool.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="threadTTL" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The time excess threads in the pool live before being discarded.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="poolExhaustedAction">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            How tasks should be handled when no more threads are available.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="WAIT"/>
+                            <xsd:enumeration value="DISCARD"/>
+                            <xsd:enumeration value="DISCARD_OLDEST"/>
+                            <xsd:enumeration value="ABORT"/>
+                            <xsd:enumeration value="RUN"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="threadWaitTimeout" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            How long to wait (when the pool exhausted action is WAIT).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="doThreading" type="substitutableBoolean" default="true">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Whether threading should be used at all (default is true).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="maxBufferSize" type="substitutableInt">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The size of the queue used (when the pool exhausted action is WAIT).
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   Exception strategies                                       -->
+    <!--==============================================================-->
+
+    <xsd:element name="default-service-exception-strategy" type="endpointExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Provide default exception handling via an endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:element name="default-connector-exception-strategy" type="endpointExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                Provide default exception handling via an endpoint.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="endpointExceptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractExceptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-exception-strategy" type="customExceptionStrategyType"
+                 substitutionGroup="abstract-exception-strategy">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-defined exception stratgey.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customExceptionStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="endpointExceptionStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the ExceptionListener interface.
+                            In addition, if an outbound-endpoint element is specified,
+                            it is set as an "endpoint" bean property.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- Custom connector element -->
+
+    <xsd:element name="custom-connector" type="customConnectorType" substitutionGroup="abstract-connector">
+        <xsd:annotation>
+            <xsd:documentation>
+                A user-defined connector.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="connectorType">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            A class that implements the Connector interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--  Routers                                                     -->
+    <!--==============================================================-->
+
+    <!-- Inbound Router implementations -->
+
+    <xsd:element name="idempotent-secure-hash-receiver-router" type="filteredInboundRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+    <xsd:element name="inbound-pass-through-router" type="filteredInboundRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+    <xsd:complexType name="filteredInboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter" minOccurs="0"/>
+                    <!-- TODO this doesn't make sense here, need to re-visit <xsd:element ref="abstract-message-info-mapping" minOccurs="0"/>-->
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-message-info-mapping" abstract="true" type="abstractMessageInfoMappingType"/>
+    <xsd:complexType name="abstractMessageInfoMappingType"/>
+
+    <xsd:element name="idempotent-receiver-router" type="filteredInboundRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+
+    <xsd:element name="wire-tap-router" type="wireTapRouterType" substitutionGroup="abstract-inbound-router"/>
+    <xsd:complexType name="wireTapRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="1" maxOccurs="1"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="forwarding-router" type="selectiveConsumerRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+
+    <xsd:element name="selective-consumer-router" type="selectiveConsumerRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+
+    <xsd:element name="correlation-resequencer-router" type="baseAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+
+    <xsd:complexType name="selectiveConsumerRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS"/>
+                <xsd:attribute name="transformFirst" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-chunking-aggregator-router" type="messageChunkingAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+    <xsd:complexType name="messageChunkingAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="baseAggregatorRouterType">
+                <xsd:attribute name="correlationExpression" type="xsd:string"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-correlation-aggregator-router" type="customCorrelationAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+    <xsd:complexType name="customCorrelationAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="messageChunkingAggregatorRouterType">
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="collection-aggregator-router" type="baseAggregatorRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+
+    <xsd:element name="custom-inbound-router" type="customInboundRouterType"
+                 substitutionGroup="abstract-inbound-router"/>
+
+    <xsd:complexType name="customInboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="baseAggregatorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteredInboundRouterType">
+                <xsd:attribute name="timeout" type="substitutableInt"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- ResponseRouters -->
+
+    <xsd:element name="single-async-reply-router" type="asyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router">
+        <xsd:annotation>
+            <xsd:documentation>Configures a Single Response Router. This will return the first event it receives on a
+                reply endpoint and will discard the rest.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:element name="collection-async-reply-router" type="asyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router">
+        <xsd:annotation>
+            <xsd:documentation>Configures a Collection Response Router. This will return a MuleMEssageCollection message
+                type that will contain all events recieved for the current correlation.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="asyncReplyRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractAsyncReplyRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-inbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element ref="abstract-message-info-mapping" minOccurs="0"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-async-reply-router" type="customAsyncReplyRouterType"
+                 substitutionGroup="abstract-async-reply-router"/>
+    <xsd:complexType name="customAsyncReplyRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="asyncReplyRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- Outbound Router implementations -->
+
+    <xsd:element name="outbound-pass-through-router" type="outboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="outboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element name="reply-to" type="endpointRefType" minOccurs="0"/>
+                    <xsd:element ref="abstract-transaction" minOccurs="0"/>
+                    <xsd:element ref="abstract-message-info-mapping" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="enableCorrelation" default="IF_NOT_SET">
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="ALWAYS"/>
+                            <xsd:enumeration value="NEVER"/>
+                            <xsd:enumeration value="IF_NOT_SET"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="filtering-router" type="filteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:element name="chaining-router" type="filteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:element name="exception-based-router" type="filteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:element name="multicasting-router" type="filteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:element name="template-endpoint-router" type="filteringOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="filteringOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="outboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-filter" minOccurs="0"/>
+                    <xsd:element ref="abstract-transformer" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="transformer-refs" type="xsd:NMTOKENS"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="endpoint-selector-router" type="endpointSelectorRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="endpointSelectorRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteringOutboundRouterType">
+                <xsd:attributeGroup ref="expressionAttributes"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="list-message-splitter-router" type="messageSplitterOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="messageSplitterOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteringOutboundRouterType">
+                <!-- this isn't exposed to the user afaict? -->
+                <!-- xsd:attribute name="multimatch" type="substitutableBoolean"/ -->
+                <xsd:attribute name="honorSynchronicity" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="message-chunking-router" type="chunkingRouterType" substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="chunkingRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteringOutboundRouterType">
+                <xsd:attribute name="messageSize" type="substitutableInt"/>
+                <xsd:attribute name="numberOfMessages" type="substitutableInt"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="static-recipient-list-router" type="staticRecipientListRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="staticRecipientListRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteringOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element name="recipients" type="listOrSetType" minOccurs="0" maxOccurs="1"/>
+                </xsd:sequence>
+                <xsd:attribute name="recipientsProperty" type="xsd:string"/>
+                <xsd:attribute name="recipientsDelimiter" type="xsd:string"/>
+                <xsd:attribute name="synchronous" type="xsd:boolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="recipient-list-router" type="recipientListRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="recipientListRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteringOutboundRouterType">
+                <xsd:attributeGroup ref="expressionAttributes"/>
+                <xsd:attribute name="synchronous" type="xsd:boolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-outbound-router" type="customOutboundRouterType"
+                 substitutionGroup="abstract-outbound-router"/>
+    <xsd:complexType name="customOutboundRouterType">
+        <xsd:complexContent>
+            <xsd:extension base="filteringOutboundRouterType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!-- Catch all strategy implementations -->
+
+    <xsd:element name="logging-catch-all-strategy" type="loggingCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="loggingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-catch-all-strategy" type="customCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="customCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="forwarding-catch-all-strategy" type="forwardingCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="forwardingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="abstract-outbound-endpoint" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-forwarding-catch-all-strategy" type="customForwardingCatchAllStrategyType"
+                 substitutionGroup="abstract-catch-all-strategy"/>
+    <xsd:complexType name="customForwardingCatchAllStrategyType">
+        <xsd:complexContent>
+            <xsd:extension base="forwardingCatchAllStrategyType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Message Info Mappers -->
+
+    <xsd:element name="expression-message-info-mapping" type="expressionMessageInfoMappingType"
+                 substitutionGroup="abstract-message-info-mapping">
+        <xsd:annotation>
+            <xsd:documentation>
+                Allows expressions to be configured to extract the message information.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <xsd:complexType name="expressionMessageInfoMappingType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractMessageInfoMappingType">
+                <xsd:attribute name="messageIdExpression" type="xsd:string" use="required"/>
+                <xsd:attribute name="correlationIdExpression" type="xsd:string" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="custom-message-info-mapping" type="customMessageInfoMappingType"
+                 substitutionGroup="abstract-message-info-mapping">
+        <xsd:annotation>
+            <xsd:documentation>
+                This allows configuraton of a custom implementation of MessageInfoMapping
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="customMessageInfoMappingType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractMessageInfoMappingType">
+                <xsd:sequence>
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the MessageInfoMapping interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!--==============================================================-->
+    <!--  Lifecycle Adapters                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-lifecycle-adapter-factory" abstract="true" type="abstractLifecycleAdapterFactory"/>
+    <xsd:complexType name="abstractLifecycleAdapterFactory">
+        <xsd:annotation>
+            <xsd:documentation>
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:complexType>
+    <xsd:complexType name="customLifecycleAdapterFactory">
+        <xsd:complexContent>
+            <xsd:extension base="abstractLifecycleAdapterFactory">
+                <xsd:attribute name="class" type="substitutableClass" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            An implementation of the LifecycleAdapter interface.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:element name="custom-lifecycle-adapter-factory" type="customLifecycleAdapterFactory"
+                 substitutionGroup="abstract-lifecycle-adapter-factory">
+        <xsd:annotation>
+            <xsd:documentation>
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!--==============================================================-->
+    <!--  Object Factories                                            -->
+    <!--==============================================================-->
+
+    <xsd:element name="abstract-object-factory" abstract="true" type="abstractObjectFactoryType"/>
+    <xsd:complexType name="abstractObjectFactoryType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A factory which will be used by Mule to create new instances of this object
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="propertiesGroup">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Properties to be set on the created object
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:group>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="genericObjectFactoryType">
+        <xsd:sequence>
+            <xsd:element ref="abstract-object-factory"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="spring-object" type="springBeanLookupType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="springBeanLookupType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="bean" type="substitutableName">
+                    <xsd:annotation>
+                        <xsd:documentation>Name of Spring bean to look up</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="singleton-object" type="singletonObjectFactoryType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="singletonObjectFactoryType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>Class name</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="prototype-object" type="prototypeObjectFactoryType" substitutionGroup="abstract-object-factory"/>
+    <xsd:complexType name="prototypeObjectFactoryType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractObjectFactoryType">
+                <xsd:attribute name="class" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>Class name</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:element name="abstract-pooling-profile" abstract="true" type="abstractPoolingProfileType"/>
+    <xsd:complexType name="abstractPoolingProfileType"/>
+
+    <xsd:element name="pooling-profile" type="poolingProfileType" substitutionGroup="abstract-pooling-profile"/>
+    <xsd:complexType name="poolingProfileType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractPoolingProfileType">
+                <xsd:attribute name="maxActive" type="xsd:string"/>
+                <xsd:attribute name="maxIdle" type="xsd:string"/>
+                <xsd:attribute name="initialisationPolicy" default="INITIALISE_ONE">
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="INITIALISE_NONE"/>
+                            <xsd:enumeration value="INITIALISE_ONE"/>
+                            <xsd:enumeration value="INITIALISE_ALL"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="exhaustedAction" default="WHEN_EXHAUSTED_GROW">
+                    <xsd:simpleType>
+                        <xsd:restriction base="xsd:NMTOKEN">
+                            <xsd:enumeration value="WHEN_EXHAUSTED_GROW"/>
+                            <xsd:enumeration value="WHEN_EXHAUSTED_WAIT"/>
+                            <xsd:enumeration value="WHEN_EXHAUSTED_FAIL"/>
+                        </xsd:restriction>
+                    </xsd:simpleType>
+                </xsd:attribute>
+                <xsd:attribute name="maxWait" type="xsd:string"/>
+                <!-- <xsd:attribute name="factory" type="xsd:string" default="org.mule.config.pool.CommonsPoolFactory"/> -->
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--  Utils / Standard Types                                      -->
+    <!--==============================================================-->
+
+
+    <xsd:complexType name="abstractAgentType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A placeholder for agents. Not used in core, but common to several modules.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="abstractExtensionType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsIndirectKeyStore, named as tls-client in transport namespace -->
+    <xsd:complexType name="tlsClientKeyStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configure client key stores.
+                TLS/SSL connections are made on behalf of an entity, which can be anonymous or identified by a
+                certificate - this interface specifies how a keystore can be used to provide the certificates
+                (and associated private keys) necessary for identification.
+                This is also used as the trust store if no other trust store is specified and the
+                explicitTrustStoreOnly parameter in the server trust store configuration is false.
+                WARNING - due to restrictions in library implementations the values specified here typically apply
+                to all connectors using this transport.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if
+                    possible) of the keystore that contains public certificates and private keys for identification.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the keystore.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The type of keystore used (a Java class name).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsDirectKeyStore, named as tls-key-store in transport namespace -->
+    <xsd:complexType name="tlsKeyStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configure key stores.
+                TLS/SSL connections are made on behalf of an entity, which can be anonymous or identified by a
+                certificate - this interface specifies how a keystore can be used to provide the certificates
+                (and associated private keys) necessary for identification.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if
+                    possible) of the keystore that contains public certificates and private keys for identification.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="class" type="substitutableClass">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The type of keystore used (a Java class name).
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="keyPassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the private key.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protect the keystore.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="algorithm" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The algorithm used by the key store.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsIndirectTrustStore, named as tls-trust-store in transport namespace -->
+    <xsd:complexType name="tlsTrustStoreType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configure a trust store.
+                TLS/SSL connections are made to trusted systems - the public certificates of trusted systems are store
+                in a keystore (called a trust store) and used to verify that the connection made to a remote system
+                "really is" the expected identity.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="path" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The location (which will be resolved relative to the current classpath and file system, if
+                    possible) of the keystore that contains public certificates of trusted servers.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="storePassword" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    The password used to protected the trust store.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsDirectTrustStore, named as tls-server in transport namespace
+         note that this extends tlsTrustStoreType, so only one of the two is needed -->
+    <xsd:complexType name="tlsServerTrustStoreType">
+        <xsd:complexContent>
+            <xsd:extension base="tlsTrustStoreType">
+                <xsd:attribute name="class" type="substitutableClass"/>
+                <xsd:attribute name="algorithm" type="xsd:string"/>
+                <!-- should be of type TrustManagerFactory -->
+                <xsd:attribute name="factory-ref" type="xsd:NMTOKEN"/>
+                <xsd:attribute name="explicitOnly" type="substitutableBoolean"/>
+                <xsd:attribute name="requireClientAuthentication" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- corresponds to TlsProtocolHandler, named as tls-protocol-handler -->
+    <xsd:complexType name="tlsProtocolHandler">
+        <xsd:annotation>
+            <xsd:documentation>
+                Configure the global Java protocol handler.
+                WARNING - Untested.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="property" type="xsd:string">
+            <xsd:annotation>
+                <xsd:documentation>
+                    Set the java.protocol.handler.pkgs system property.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:simpleType name="propertyPlaceholderType">
+        <xsd:annotation>
+            <xsd:documentation>
+                A type that defines an Ant-style property placeholder
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:string">
+            <xsd:pattern value="(\$\{[^\}]+\})"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableClass">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:NMTOKEN-like type that also allows for Ant-style property placeholders
+                and a leading [
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:string">
+                    <xsd:pattern value="\[?[A-Za-z0-9_\.$]+"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="nonBlankString">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:string-like type that cannot be empty
+                (is there a better way?)
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:string">
+                    <xsd:pattern value=".*[^ ]+.*"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableName">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:NMTOKEN type that also allows for Ant-style property placeholders.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutablePortNumber">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:int type that also allows for Ant-style property placeholders and restrict the
+                int value to a valid port number
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:int">
+                    <xsd:minInclusive value="0"/>
+                    <xsd:maxInclusive value="65536"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableInt">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:int type that also allows for Ant-style property placeholders
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:int"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableLong">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:long type that also allows for Ant-style property placeholders
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:long"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <xsd:simpleType name="substitutableBoolean">
+        <xsd:annotation>
+            <xsd:documentation>
+                A custom xsd:boolean type that also allows for Ant-style property placeholders
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="propertyPlaceholderType"/>
+            </xsd:simpleType>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:boolean"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+
+    <!-- i found this a bit confusing, so here's some background...
+         this type is typically called from something like
+           <xsd:element name="properties" type="mapType/>
+         and the "properties" element generates a ChildMapDefinitionParser that
+         can "receive" the map entries generated by the embedded spring <entry..>
+         elements and which is then set via "setProperties" on the parent.
+         in other words, it's a map, and despite the name "properties" has
+         nothing to do with the spring <property ...> element.
+         spring elements like <entry...> are handled by
+         MuleHierarchicalBeanDefinitionParserDelegate which punts them to
+         the spring handler -->
+    <xsd:element name="properties" type="mapType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Set Mule properties.
+                These are name/value pairs that can be set on components, services, etc,
+                and which provide a generic way of configuring the system.
+                In Mule v2 you typically shouldn't need to use generic properties like
+                this, since almost all functionality is exposed via dedicated elements.
+                However, they can be useful in configuring obscure or overlooked options
+                and in configuring transports from the generic endpoint elements.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="mapType">
+        <xsd:complexContent>
+            <xsd:extension base="spring:mapType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:group name="propertiesGroup">
+        <xsd:sequence>
+            <xsd:element name="property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        Set a Mule property.
+                        This is a name/value pair that can be set on components, services, etc,
+                        and which provide a generic way of configuring the system.
+                        In Mule v2 you typically shouldn't need to use a generic property like
+                        this, since almost all functionality is exposed via dedicated elements.
+                        However, it can be useful in configuring obscure or overlooked options
+                        and in configuring transports from the generic endpoint elements.
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="properties" minOccurs="0"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:complexType name="listOrSetType">
+        <xsd:complexContent>
+            <xsd:extension base="spring:listOrSetType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="referenceType">
+        <xsd:attribute name="ref" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="keyType">
+        <xsd:attribute name="key" type="xsd:string"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="valueType">
+        <xsd:attribute name="value" type="xsd:string"/>
+        <xsd:attribute name="value-ref" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="keyValueType">
+        <xsd:complexContent>
+            <xsd:extension base="keyType">
+                <xsd:attribute name="value" type="xsd:string"/>
+                <xsd:attribute name="value-ref" type="xsd:NMTOKEN"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--==============================================================-->
+    <!--   Connector support                                          -->
+    <!--==============================================================-->
+
+    <xsd:complexType name="connectorType">
+        <xsd:complexContent>
+            <xsd:extension base="abstractConnectorType">
+                <xsd:sequence>
+                    <!-- for normal connectors, this is for emergency use only, but it is
+                         critical for custom connector -->
+                    <xsd:element ref="spring:property" minOccurs="0" maxOccurs="unbounded"/>
+                    <xsd:element name="receiver-threading-profile" type="threadingProfileType" minOccurs="0"/>
+                    <xsd:element name="dispatcher-threading-profile" type="threadingProfileType" minOccurs="0"/>
+                    <xsd:element ref="abstract-exception-strategy" minOccurs="0"/>
+                    <xsd:element name="service-overrides" type="serviceOverridesType" minOccurs="0"/>
+                </xsd:sequence>
+                <xsd:attribute name="createDispatcherPerRequest" type="substitutableBoolean"/>
+                <xsd:attribute name="createMultipleTransactedReceivers" type="substitutableBoolean"/>
+                <xsd:attribute name="numberOfConcurrentTransactedReceivers" type="substitutableInt"/>
+                <xsd:attribute name="dynamicNotification" type="substitutableBoolean"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="serviceOverridesType">
+        <xsd:attribute name="messageReceiver" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="transactedMessageReceiver" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="dispatcherFactory" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="inboundTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="outboundTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="responseTransformer" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="endpointBuilder" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="messageAdapter" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="streamMessageAdapter" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="serviceFinder" type="xsd:NMTOKEN"/>
+        <xsd:attribute name="sessionHandler" type="xsd:NMTOKEN"/>
+    </xsd:complexType>
+
+    <!--==============================================================-->
+    <!--   JNDI support                                               -->
+    <!--==============================================================-->
+
+    <xsd:complexType name="jndiConnectorType">
+        <xsd:complexContent>
+            <xsd:extension base="connectorType">
+                <xsd:sequence>
+                    <xsd:element name="jndi-provider-property" type="keyValueType" minOccurs="0" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Direct setting of a JNDI property.
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="jndi-provider-properties" type="mapType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>
+                                Direct setting of JNDI properties
+                                (this allows access to the full Spring map entry).
+                            </xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="jndiContext-ref" type="xsd:NMTOKEN">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            Set the complete context directly, via a bean reference.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiInitialFactory" type="substitutableClass">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The initial context factory to use. The value
+                            of the property should be the fully qualified class name
+                            of the factory class that will create an initial context.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiProviderUrl" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The service provider to use. The value of the property
+                            should contain a URL string (e.g. "ldap://somehost:389").
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+                <xsd:attribute name="jndiUrlPkgPrefixes" type="xsd:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+                            The list of package prefixes to use when
+                            loading in URL context factories. The value
+                            of the property should be a colon-separated list of package
+                            prefixes for the class name of the factory class that will create
+                            a URL context factory.
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="dataReferenceType" mixed="true">
+        <xsd:attribute name="file" type="xsd:string"/>
+        <xsd:attribute name="ref" type="xsd:string"/>
+        <!--I don't like this flag, may be we could use content-type mappings... -->
+        <xsd:attribute name="binary" type="substitutableBoolean"/>
+    </xsd:complexType>
+
+    <!-- these cannot be references (unless we use qualified attribute names, which are ugly),
+         but serve as templates to cut+paste in individual transports
+
+    <xsd:attribute name="path" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A file location.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="user" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A username.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="password" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                A password.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="host" type="xsd:string">
+        <xsd:annotation>
+            <xsd:documentation>
+                An IP address (eg www.mulesource.com, localhost, 127.0.0.1).
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    <xsd:attribute name="port" type="substitutablePortNumber">
+        <xsd:annotation>
+            <xsd:documentation>
+                A port number.
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:attribute>
+
+    -->
+
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/mylib.jar b/xml/tests/testData/xml/mylib.jar
new file mode 100644
index 0000000..8c2612b
--- /dev/null
+++ b/xml/tests/testData/xml/mylib.jar
Binary files differ
diff --git a/xml/tests/testData/xml/nuancevoicexml-2-0.dtd b/xml/tests/testData/xml/nuancevoicexml-2-0.dtd
new file mode 100644
index 0000000..796e249
--- /dev/null
+++ b/xml/tests/testData/xml/nuancevoicexml-2-0.dtd
@@ -0,0 +1,654 @@
+<!--
+VoiceXML 2.0 DTD (20020327)
+
+Copyright 1998-2002 W3C (MIT, INRIA, Keio), All Rights Reserved.
+
+Permission to use, copy, modify and distribute the VoiceXML DTD and
+its accompanying documentation for any purpose and without fee is
+hereby granted in perpetuity, provided that the above copyright
+notice and this paragraph appear in all copies.
+
+The copyright holders make no representation about the suitability
+of the DTD for any purpose. It is provided "as is" without expressed
+or implied warranty.
+-->
+
+<!ENTITY % custom-elements   "nuance:send">
+
+<!ENTITY % bargeintype   "( speech | hotword )">
+
+<!ENTITY % boolean 	"(true|false)">
+
+<!ENTITY % content.type "CDATA">
+
+<!ENTITY % duration "CDATA">
+
+<!ENTITY % event.handler "catch | help | noinput | nomatch | error">
+
+<!ENTITY % event.name "NMTOKEN">
+
+<!ENTITY % event.names "NMTOKENS">
+
+<!-- addition of enumerate and value elements as 'allowed-within-sentence'
+audio elements.  Note that for the VWS parser, this entity must be declared
+before it is reference within the entity below. -->
+<!ENTITY % audio "#PCDATA | audio | enumerate | value">
+
+<!-- <debug> is a deprecated version of the <log> tag. -->
+<!-- definitions adapted from SSML 1.0 DTD -->
+<!-- These prompt playback entities are defined here because they are needed
+    for defining executable content -->
+<!ENTITY % structure "paragraph | p | sentence | s">
+
+<!ENTITY % sentence-elements "break | emphasis | mark | phoneme | prosody |
+say-as | voice | sub">
+
+<!ENTITY % allowed-within-sentence " %audio; | %sentence-elements; ">
+
+<!ENTITY % executable.content "%allowed-within-sentence; | assign | clear | %custom-elements; | disconnect | exit
+| goto | if | log | prompt | reprompt | return | script | %structure; | submit | throw | var | debug">
+
+<!ENTITY % expression "CDATA">
+
+<!ENTITY % variable.name "NMTOKEN">
+
+<!ENTITY % variable.names "CDATA">
+
+<!ENTITY % integer "CDATA">
+
+<!ENTITY % item.attrs "name		%variable.name;	#IMPLIED
+    cond		%expression;	#IMPLIED
+    expr		%expression;	#IMPLIED ">
+
+<!ENTITY % uri "CDATA">
+
+<!ENTITY % cache.attrs "fetchhint	(prefetch|safe)	#IMPLIED
+    fetchtimeout	%duration;	#IMPLIED
+    maxage	%integer;	#IMPLIED
+    maxstale	%integer;	#IMPLIED">
+
+<!ENTITY % next.attrs "next		%uri;		#IMPLIED
+    expr		%expression;	#IMPLIED ">
+
+<!ENTITY % submit.attrs "method		(get|post)	'get'
+    enctype		%content.type;	'application/x-www-form-urlencoded'
+    namelist	%variable.names;	#IMPLIED">
+
+<!ENTITY % throw.attrs "event      %event.name;    #IMPLIED
+    eventexpr   %expression;    #IMPLIED
+    message     CDATA       #IMPLIED
+    messageexpr %expression;    #IMPLIED">
+
+<!ENTITY % variable 	"block | field | var">
+
+
+<!--================================= Root ================================-->
+<!ELEMENT vxml (%event.handler; | form | link | menu | meta |
+property | script | var)*>
+<!ENTITY % two-zero 	"(2.0)">
+<!ATTLIST vxml
+    application	%uri;		#IMPLIED
+    base		%uri;		#IMPLIED
+    xml:lang    NMTOKENS     #IMPLIED
+    xmlns       CDATA       #FIXED "http://www.w3.org/2001/vxml"
+    xmlns:nuance CDATA       #FIXED "http://www.nuance.com"
+    xsi:schemaLocation CDATA #IMPLIED
+    version		%two-zero;     #REQUIRED
+>
+
+<!ELEMENT meta		EMPTY>
+<!ATTLIST meta
+    name		NMTOKEN		#IMPLIED
+    content		CDATA		#REQUIRED
+    http-equiv	NMTOKEN		#IMPLIED
+>
+
+
+<!--================================ Prompts ==============================-->
+<!-- Prompt is modelled on SSML 1.0 DTD speak element:
+- addition of 'bargein', 'bargeintype', 'cond', 'count' and 'timeout' attributes
+- removal of xmlns, xmlns:xsi, and xsi:schemaLocation attributes
+- version attribute fixed as "1.0"
+-->
+<!ELEMENT prompt (%allowed-within-sentence; | %structure;)*>
+<!ATTLIST prompt
+    bargein		%boolean;	#IMPLIED
+    bargeintype %bargeintype;   #IMPLIED
+    cond		%expression;	#IMPLIED
+    count		%integer;	#IMPLIED
+    xml:lang    NMTOKENS     #IMPLIED
+    timeout		%duration;	#IMPLIED
+    version CDATA #FIXED "1.0"
+>
+
+<!ELEMENT enumerate (%allowed-within-sentence; | %structure;)*>
+
+<!ELEMENT reprompt	EMPTY>
+
+
+<!--================================= Dialogs =============================-->
+<!ENTITY % input "grammar">
+
+<!ENTITY % scope 	"(document | dialog)">
+
+<!-- Voiceprint is a Nuance extension for speaker verification and identification. -->
+<!ELEMENT form (%input; | %event.handler; | filled | initial | object |
+link | property | record | script | subdialog | transfer | %variable; | nuance:voiceprint)*>
+<!ATTLIST form
+    id		ID		#IMPLIED
+    scope		%scope;		"dialog"
+>
+
+<!ENTITY % accept.attrs "accept     (exact | approximate)   'exact'">
+
+<!-- script in the menu is a Nuance extension. -->
+<!ELEMENT menu (%audio; | choice | %event.handler; | prompt | property | script)*>
+<!ATTLIST menu
+    id		ID		#IMPLIED
+    scope		%scope;		"dialog"
+    %accept.attrs;
+    dtmf		%boolean;	"false"
+>
+
+<!ELEMENT choice (%allowed-within-sentence; | %structure; | grammar)*>
+<!ATTLIST choice
+    %cache.attrs;
+    %accept.attrs;
+    dtmf		CDATA		#IMPLIED
+    %throw.attrs;
+    fetchaudio	%uri;		#IMPLIED
+    %next.attrs;
+>
+
+
+<!--================================ Audio Output ==============================-->
+<!-- definitions adapted from SSML 1.0 DTD -->
+
+<!ELEMENT paragraph (%allowed-within-sentence; | sentence | s)*>
+<!ATTLIST paragraph
+    xml:lang    NMTOKENS     #IMPLIED
+>
+
+<!ELEMENT sentence (%allowed-within-sentence;)*>
+<!ATTLIST sentence
+    xml:lang    NMTOKENS     #IMPLIED
+>
+
+<!ELEMENT p (%allowed-within-sentence; | sentence | s)*>
+<!ATTLIST p
+    xml:lang        NMTOKENS         #IMPLIED
+>
+
+<!ELEMENT s (%allowed-within-sentence;)*>
+<!ATTLIST s
+        xml:lang        NMTOKENS         #IMPLIED
+>
+
+<!ELEMENT voice (%allowed-within-sentence; | %structure;)*>
+<!ATTLIST voice
+     xml:lang        NMTOKENS         #IMPLIED
+     gender   (male | female | neutral)              #IMPLIED
+     age      %integer;                              #IMPLIED
+     variant  %integer;                              #IMPLIED
+     name     CDATA                                  #IMPLIED
+>
+
+<!ELEMENT prosody (%allowed-within-sentence; | %structure;)*>
+<!ATTLIST prosody
+     pitch      CDATA  #IMPLIED
+     contour    CDATA  #IMPLIED
+     range      CDATA  #IMPLIED
+     rate       CDATA  #IMPLIED
+     duration   %duration;  #IMPLIED
+     volume     CDATA  #IMPLIED
+>
+
+<!-- Changes to SSML 1.0 DTD audio element:
+- addition of 'expr' and caching attributes
+-->
+<!-- offsetexpr is a Nuance extension that specifies where in the audio to start playing. -->
+<!ELEMENT audio (%allowed-within-sentence; | %structure;)*>
+<!ATTLIST audio
+    src		%uri;		#IMPLIED
+    expr		%expression;		#IMPLIED
+    %cache.attrs;
+    offsetexpr  %expression;    #IMPLIED
+>
+
+<!ELEMENT emphasis (%allowed-within-sentence;)*>
+<!ATTLIST emphasis
+     level      (strong | moderate | none | reduced)  "moderate"
+>
+
+<!-- Changes to SSML 1.0 DTD say-as element:
+- addition of vxml builtins to type
+- allows value element as child
+-->
+<!-- As a Nuance extension, the type attribute is not constrained by the DTD. -->
+<!ELEMENT say-as (#PCDATA | value )*>
+<!ATTLIST say-as
+     type   CDATA            #REQUIRED
+>
+
+<!ELEMENT sub (#PCDATA)>
+<!ATTLIST sub
+    alias CDATA #REQUIRED
+>
+
+<!ELEMENT phoneme (#PCDATA)>
+<!ATTLIST phoneme
+     ph        CDATA   #REQUIRED
+     alphabet  CDATA   "ipa"
+>
+
+<!ELEMENT break EMPTY>
+
+<!-- In order to detect the case where no attribute is specified on break,
+     Nuance specifies the size as #IMPLIED rather than the 'medium' default. -->
+<!ATTLIST break
+     size      (large | medium | small | none)  #IMPLIED
+     time      %duration;                 #IMPLIED
+>
+
+<!ELEMENT mark (%allowed-within-sentence; | %structure;)*>
+<!ATTLIST mark
+     name      ID   #REQUIRED
+>
+
+<!--================================ Fields ===============================-->
+<!ELEMENT field (%audio; | %event.handler; | filled | %input; | link |
+option | prompt | property)*>
+<!ATTLIST field
+    %item.attrs;
+    type		CDATA		#IMPLIED
+    slot		NMTOKEN		#IMPLIED
+    modal		%boolean;	"false"
+>
+
+<!-- <option> is more powerful with optional <grammar>s and SSML markup. -->
+<!ELEMENT option	(%allowed-within-sentence; | %structure; | grammar)*>
+
+<!ATTLIST option
+    %accept.attrs;
+    dtmf		CDATA		#IMPLIED
+    value		CDATA		#IMPLIED
+>
+
+<!ELEMENT var		EMPTY>
+<!ATTLIST var
+    name		%variable.name;	#REQUIRED
+    expr		%expression;	#IMPLIED
+>
+
+<!ELEMENT initial	(%audio; | %event.handler; | link | prompt | property)*>
+<!ATTLIST initial
+    %item.attrs;
+>
+
+<!ELEMENT block	(%executable.content;)*>
+<!ATTLIST block
+    %item.attrs;
+>
+
+<!ELEMENT assign	EMPTY>
+<!ATTLIST assign
+    name		%variable.name;	#REQUIRED
+    expr		%expression;	#REQUIRED
+>
+
+<!ELEMENT clear	EMPTY>
+<!ATTLIST clear
+    namelist	%variable.names;	#IMPLIED
+>
+
+<!ELEMENT value	EMPTY>
+<!ATTLIST value
+    expr		%expression;	#REQUIRED
+>
+
+
+<!--================================== Events =============================-->
+<!ENTITY % event.handler.attrs "count		%integer;	#IMPLIED
+    cond		%expression;	#IMPLIED">
+
+<!ELEMENT catch	(%executable.content;)*>
+<!ATTLIST catch
+    event		%event.names;	#IMPLIED
+    %event.handler.attrs;
+>
+
+<!ELEMENT error	(%executable.content;)*>
+<!ATTLIST error
+    %event.handler.attrs;
+>
+
+<!ELEMENT help		(%executable.content;)*>
+<!ATTLIST help
+    %event.handler.attrs;
+>
+
+<!ELEMENT link		(grammar)*>
+<!ATTLIST link
+    %cache.attrs;
+    %next.attrs;
+    fetchaudio	%uri;		#IMPLIED
+    dtmf		CDATA		#IMPLIED
+    %throw.attrs;
+>
+
+<!ELEMENT noinput	(%executable.content;)*>
+<!ATTLIST noinput
+    %event.handler.attrs;
+>
+
+<!ELEMENT nomatch	(%executable.content;)*>
+<!ATTLIST nomatch
+    %event.handler.attrs;
+>
+
+<!ELEMENT throw	EMPTY>
+<!ATTLIST throw
+    %throw.attrs;
+>
+
+
+<!--============================= Grammar Input =============================-->
+<!-- definitions adapted from SRGS 1.0 DTD -->
+<!ENTITY % rule-expansion "#PCDATA | token | ruleref
+                              | item | one-of | tag ">
+
+<!-- New GRXML Spec - Added lang-list - Removed xml:lang -->
+<!ELEMENT ruleref EMPTY>
+<!ATTLIST ruleref
+     uri %uri; #IMPLIED
+     type CDATA #IMPLIED
+     special (NULL | VOID | GARBAGE) #IMPLIED
+     lang-list NMTOKENS #IMPLIED
+>
+
+<!-- New GRXML Spec - Added lang-list - Removed xml:lang -->
+<!ELEMENT token (#PCDATA)>
+<!ATTLIST token
+     lang-list NMTOKENS #IMPLIED
+>
+
+<!ELEMENT tag (#PCDATA)>
+
+<!-- New GRXML Spec - Added lang-list - Removed xml:lang -->
+<!ELEMENT one-of (item)+>
+<!ATTLIST one-of
+     lang-list NMTOKENS #IMPLIED
+>
+
+<!-- New GRXML Spec - Removed tag, xml:lang -->
+<!ELEMENT item (%rule-expansion;)*>
+<!ATTLIST item
+     repeat NMTOKEN #IMPLIED
+     repeat-prob NMTOKEN #IMPLIED
+     weight NMTOKEN #IMPLIED
+>
+
+<!ELEMENT rule (%rule-expansion; | example)*>
+<!ATTLIST rule
+    id ID #REQUIRED
+    scope (private | public) "private"
+>
+
+<!ELEMENT example (#PCDATA)>
+
+<!--
+     Nuance-extension: <grammar> also permits <nuance:redef> children, which
+     can be used to define external grammars.  The <nuance:nbest> tag allows JavaScript
+     "nbest" processing.
+-->
+<!ELEMENT grammar	( #PCDATA | rule | nuance:redef | nuance:nbest )*>
+<!ATTLIST grammar
+    scope		%scope;		#IMPLIED
+    src		%uri;		    #IMPLIED
+    type		CDATA		#IMPLIED
+    weight		CDATA		#IMPLIED
+    %cache.attrs;
+    tag-format CDATA        "Nuance"
+    version     CDATA       "1.0"
+    xml:lang    NMTOKENS		#IMPLIED
+    root		IDREF		#IMPLIED
+    mode        (voice | dtmf)  "voice"
+    expr		CDATA		#IMPLIED
+>
+
+<!-- an <redef> element describes an external grammar through a src,
+     type and name of the grammar to be resolved by this external
+     grammar -->
+<!ELEMENT nuance:redef 	EMPTY>
+<!ATTLIST nuance:redef
+    src                 %uri;		#IMPLIED
+    expr                 %uri;		#IMPLIED
+    name		CDATA           #REQUIRED
+>
+
+
+<!--============================= Audio Input =============================-->
+<!-- dest and destexpr are a Nuance extension that specify the destination uri
+     where the recorded audio should be http posted. -->
+<!ELEMENT record (%audio; | %event.handler; | filled | grammar | prompt | property)*>
+<!ATTLIST record
+    %item.attrs;
+    type		CDATA		#IMPLIED
+    beep		%boolean;	"false"
+    maxtime		%duration;	#IMPLIED
+    modal		%boolean;	"true"
+    finalsilence	%duration;	#IMPLIED
+    dtmfterm		%boolean;	"true"
+    dest		%uri;		#IMPLIED
+    destexpr		%expression;	#IMPLIED
+>
+
+
+<!--============================ Call Control ============================-->
+<!ELEMENT disconnect	EMPTY>
+
+<!-- devices is a Nuance extension used in the transfer tag. -->
+<!ENTITY % devices "NMTOKENS">
+
+<!-- type is a Nuance extension deprecating the bridge attribute and
+     allowing the specification of a third type: conditional.  A conditional
+     transfer will disconnect the system from the transfer only after party
+     A is connected to party C.
+
+     localuri and localuriexpr are a Nuance extension that allows the user
+     to specify the localuri, eg. ANI, for the outbound call.
+
+     farenddialog and farenddialogexpr are a Nuance extension that allows
+     specifying a VoiceXML dialog to execute with Party C to determine
+     whether to connect Party A to Party C.
+
+     warningtime and warningaudio are a Nuance extension to specify a
+     prompt to play the specified amount of time before ending the
+     bridge transfer due to maxtime.
+
+     devicedetection is a Nuance extension specifying the list of devices
+     that the system should attempt to detect on the transfer. -->
+<!ELEMENT transfer (%audio; | %event.handler; | filled | grammar | prompt | property)*>
+<!ATTLIST transfer
+    %item.attrs;
+    dest		%uri;		#IMPLIED
+    destexpr	%expression;	#IMPLIED
+    bridge		%boolean;	#IMPLIED
+    connecttimeout	%duration;	#IMPLIED
+    maxtime		%duration;	#IMPLIED
+    transferaudio           %uri;   #IMPLIED
+    aai         CDATA       #IMPLIED
+    aaiexpr     %expression;    #IMPLIED
+    type        (blind | bridge | conditional)  #IMPLIED
+    localuri    %uri;       #IMPLIED
+    localuriexpr    %expression;    #IMPLIED
+    farenddialog            %uri;   #IMPLIED
+    farenddialogexpr        %expression;   #IMPLIED
+    warningtime %duration;  #IMPLIED
+    warningaudio   %uri;   #IMPLIED
+    devicedetection %devices; #IMPLIED
+>
+
+
+<!--============================ Control Flow ============================-->
+<!ENTITY % if.attrs "cond		%expression;	#REQUIRED">
+
+<!ELEMENT if 		(%executable.content; | elseif | else)*>
+<!ATTLIST if
+    %if.attrs;
+>
+
+<!ELEMENT elseif	EMPTY>
+<!ATTLIST elseif
+    %if.attrs;
+>
+
+<!ELEMENT else 	EMPTY>
+
+<!ELEMENT exit		EMPTY>
+<!ATTLIST exit
+    expr		%expression;	#IMPLIED
+    namelist	%variable.names;	#IMPLIED
+>
+
+<!ELEMENT filled 	(%executable.content;)*>
+<!ATTLIST filled
+    mode		(any | all)	"all"
+    namelist	%variable.names;	#IMPLIED
+>
+
+<!ELEMENT goto		EMPTY>
+<!ATTLIST goto
+    %cache.attrs;
+    %next.attrs;
+    fetchaudio	%uri;		#IMPLIED
+    expritem	%expression;	#IMPLIED
+    nextitem	%variable.name;	#IMPLIED
+>
+
+<!-- <param> elements are allowed to have nested <param> children,
+     and an index to allow building up arrays/vectors.
+     Also, if index is specified name is not required. -->
+<!ELEMENT param	(param)*>
+<!ATTLIST param
+    name		NMTOKEN		#IMPLIED
+    expr		%expression;	#IMPLIED
+    value		CDATA		#IMPLIED
+    valuetype	(data | ref)	"data"
+    type		CDATA		#IMPLIED
+    index       CDATA       #IMPLIED
+>
+
+<!ELEMENT return	EMPTY>
+<!ATTLIST return
+    namelist	%variable.names;	#IMPLIED
+    %throw.attrs;
+>
+
+<!ELEMENT subdialog (%audio; | %event.handler; | filled | param | prompt | property)*>
+<!ATTLIST subdialog
+    %item.attrs;
+    src		%uri;		#IMPLIED
+    srcexpr	%expression;		#IMPLIED
+    %cache.attrs;
+    fetchaudio	%uri;		#IMPLIED
+    %submit.attrs;
+>
+
+<!ELEMENT submit	EMPTY>
+<!ATTLIST submit
+    %cache.attrs;
+    %next.attrs;
+    fetchaudio	%uri;		#IMPLIED
+    %submit.attrs;
+>
+
+
+<!--========================== Verification  ==============================-->
+<!-- The <voiceprint> tag is a FIA-based framework for verificaiton and identification. -->
+<!ENTITY % voiceprint.plan.attrs
+    'plan (verification | identification) "verification"
+    designation %variable.names; #IMPLIED
+    verification %variable.names; #IMPLIED
+    training %variable.names; #IMPLIED
+    completion %variable.names; #IMPLIED
+    unanalyzed %variable.names; #IMPLIED
+    adapt %boolean; #IMPLIED
+    enroll %boolean; #IMPLIED'
+>
+
+<!ENTITY % voiceprint.repository.attrs
+    'src %uri; #IMPLIED
+    srcexpr %expression; #IMPLIED
+    fetchnamelist %variable.names; #IMPLIED
+    submitnamelist %variable.names; #IMPLIED'
+>
+
+<!ELEMENT nuance:voiceprint EMPTY>
+<!ATTLIST nuance:voiceprint
+    %voiceprint.plan.attrs;
+    %voiceprint.repository.attrs;
+>
+
+
+<!--========================== Miscellaneous ==============================-->
+<!-- <debug> is a deprecated version of the <log> tag.  Both link with Nuance's logging framework. -->
+<!ELEMENT debug (#PCDATA | value)*>
+<!ATTLIST debug
+    expr			CDATA		#IMPLIED
+    dest			%uri;		#IMPLIED
+    level			NMTOKEN		#IMPLIED
+>
+
+<!ELEMENT log (#PCDATA | value)*>
+<!ATTLIST log
+    label			CDATA		#IMPLIED
+    expr			%expression;		#IMPLIED
+>
+
+<!-- <link> under <object> is a Nuance extension. -->
+<!ELEMENT object (%audio; | %event.handler; | filled | param | prompt | property | link)*>
+<!ATTLIST object
+    %item.attrs;
+    %cache.attrs;
+    classid		%uri;		#IMPLIED
+    codebase	%uri;		#IMPLIED
+    data		%uri;		#IMPLIED
+    type		CDATA		#IMPLIED
+    codetype	CDATA		#IMPLIED
+    archive		%uri;		#IMPLIED
+>
+
+<!ELEMENT property	EMPTY>
+<!ATTLIST property
+    name		NMTOKEN		#REQUIRED
+    value		CDATA		#REQUIRED
+>
+
+<!-- For debug purposes, newlines are preserved by default. -->
+<!ELEMENT script	(#PCDATA)>
+<!ATTLIST script
+    src		%uri;		#IMPLIED
+    charset		CDATA		#IMPLIED
+    %cache.attrs;
+    xml:space	(default|preserve)	#FIXED "preserve"
+>
+
+<!-- <nuance:nbest> is a Nuance extension that allows client side n-besting over
+     multiple interpretations. -->
+<!ELEMENT nuance:nbest	(#PCDATA)*>
+<!ATTLIST nuance:nbest
+    src		%uri;		#IMPLIED
+    charset		CDATA		#IMPLIED
+    %cache.attrs;
+    xml:space	(default | preserve)	#FIXED "preserve"
+>
+
+<!--========================== Custom Elements ==============================-->
+<!ELEMENT nuance:send   EMPTY >
+<!ATTLIST nuance:send
+    dest        %uri;           #IMPLIED
+    destexpr    %expression;    #IMPLIED
+    fetchaudio  %uri;           #IMPLIED
+    %submit.attrs; >
+
diff --git a/xml/tests/testData/xml/nuancevoicexml-2-0.xml b/xml/tests/testData/xml/nuancevoicexml-2-0.xml
new file mode 100644
index 0000000..8758378
--- /dev/null
+++ b/xml/tests/testData/xml/nuancevoicexml-2-0.xml
@@ -0,0 +1,18 @@
+<!DOCTYPE vxml PUBLIC "-//Nuance/DTD VoiceXML 2.0//EN" "http://www.angel.com/dtd/nuancevoicexml-2-0.dtd">
+<vxml version="2.0" application="/vxml20/ApplicationConnection" xmlns="<error>http://www.w3.org/2001/vxml</error>">
+
+        <property name="inputmodes" value="dtmf voice"/>
+
+        <var name="zipcode"/>
+        <var name="city"/>
+        <var name="state"/>
+        <var name="streetAddrInfo"/>
+
+        <form>
+                <block>
+                        <prompt version="1.0">
+                                This is a prompt
+                        </prompt>
+                </block>
+        </form>
+</vxml>
diff --git a/xml/tests/testData/xml/relaxng.xsd b/xml/tests/testData/xml/relaxng.xsd
new file mode 100644
index 0000000..5a3d36f
--- /dev/null
+++ b/xml/tests/testData/xml/relaxng.xsd
@@ -0,0 +1,342 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://relaxng.org/ns/structure/fake/1.0" xmlns:structure="http://relaxng.org/ns/structure/fake/1.0">
+  <xs:group name="pattern">
+    <xs:choice>
+      <xs:element ref="structure:element"/>
+      <xs:element ref="structure:attribute"/>
+      <xs:element ref="structure:group"/>
+      <xs:element ref="structure:interleave"/>
+      <xs:element name="choice">
+        <xs:complexType>
+          <xs:group ref="structure:open-patterns"/>
+          <xs:attributeGroup ref="structure:common-atts"/>
+        </xs:complexType>
+      </xs:element>
+      <xs:element ref="structure:optional"/>
+      <xs:element ref="structure:zeroOrMore"/>
+      <xs:element ref="structure:oneOrMore"/>
+      <xs:element ref="structure:list"/>
+      <xs:element ref="structure:mixed"/>
+      <xs:element ref="structure:ref"/>
+      <xs:element ref="structure:parentRef"/>
+      <xs:element ref="structure:empty"/>
+      <xs:element ref="structure:text"/>
+      <xs:element ref="structure:value"/>
+      <xs:element ref="structure:data"/>
+      <xs:element ref="structure:notAllowed"/>
+      <xs:element ref="structure:externalRef"/>
+      <xs:element ref="structure:grammar"/>
+    </xs:choice>
+  </xs:group>
+  <xs:element name="element">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group minOccurs="0" ref="structure:open-name-class"/>
+        <xs:group ref="structure:open-patterns"/>
+      </xs:sequence>
+      <xs:attribute name="name" type="xs:QName"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="attribute">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group minOccurs="0" ref="structure:open-name-class"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:group ref="structure:other"/>
+          <xs:group ref="structure:pattern"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="structure:common-atts"/>
+      <xs:attribute name="name" type="xs:QName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="group">
+    <xs:complexType>
+      <xs:group ref="structure:open-patterns"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="interleave">
+    <xs:complexType>
+      <xs:group ref="structure:open-patterns"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="optional">
+    <xs:complexType>
+      <xs:group ref="structure:open-patterns"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="zeroOrMore">
+    <xs:complexType>
+      <xs:group ref="structure:open-patterns"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="oneOrMore">
+    <xs:complexType>
+      <xs:group ref="structure:open-patterns"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="list">
+    <xs:complexType>
+      <xs:group ref="structure:open-patterns"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="mixed">
+    <xs:complexType>
+      <xs:group ref="structure:open-patterns"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="ref">
+    <xs:complexType>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="parentRef">
+    <xs:complexType>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="empty">
+    <xs:complexType>
+      <xs:group ref="structure:other"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="text">
+    <xs:complexType>
+      <xs:group ref="structure:other"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="value">
+    <xs:complexType mixed="true">
+      <xs:attribute name="type" type="xs:NCName"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="data">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="structure:other"/>
+        <xs:choice>
+          <xs:element ref="structure:param"/>
+          <xs:element name="except">
+            <xs:complexType>
+              <xs:group ref="structure:open-patterns"/>
+              <xs:attributeGroup ref="structure:common-atts"/>
+            </xs:complexType>
+          </xs:element>
+        </xs:choice>
+      </xs:choice>
+      <xs:attribute name="type" use="required" type="xs:NCName"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="param">
+    <xs:complexType mixed="true">
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="notAllowed">
+    <xs:complexType>
+      <xs:group ref="structure:other"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="externalRef">
+    <xs:complexType>
+      <xs:group ref="structure:other"/>
+      <xs:attribute name="href" use="required" type="xs:anyURI"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="grammar">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="structure:grammar-content">
+          <xs:attributeGroup ref="structure:common-atts"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:complexType name="grammar-content">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="structure:other"/>
+      <xs:choice>
+        <xs:element ref="structure:start"/>
+        <xs:element ref="structure:define"/>
+        <xs:element name="div">
+          <xs:complexType>
+            <xs:complexContent>
+              <xs:extension base="structure:grammar-content">
+                <xs:attributeGroup ref="structure:common-atts"/>
+              </xs:extension>
+            </xs:complexContent>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="structure:include"/>
+      </xs:choice>
+    </xs:choice>
+  </xs:complexType>
+  <xs:element name="include">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="structure:include-content">
+          <xs:attribute name="href" use="required" type="xs:anyURI"/>
+          <xs:attributeGroup ref="structure:common-atts"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:complexType name="include-content">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="structure:other"/>
+      <xs:choice>
+        <xs:element ref="structure:start"/>
+        <xs:element ref="structure:define"/>
+        <xs:element name="div">
+          <xs:complexType>
+            <xs:complexContent>
+              <xs:extension base="structure:include-content">
+                <xs:attributeGroup ref="structure:common-atts"/>
+              </xs:extension>
+            </xs:complexContent>
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+    </xs:choice>
+  </xs:complexType>
+  <xs:element name="start">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="structure:open-pattern">
+          <xs:attributeGroup ref="structure:combine-att"/>
+          <xs:attributeGroup ref="structure:common-atts"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="define">
+    <xs:complexType>
+      <xs:group ref="structure:open-patterns"/>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+      <xs:attributeGroup ref="structure:combine-att"/>
+      <xs:attributeGroup ref="structure:common-atts"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="combine-att">
+    <xs:attribute name="combine">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="choice"/>
+          <xs:enumeration value="interleave"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+  <xs:group name="open-patterns">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="structure:other"/>
+        <xs:group ref="structure:pattern"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:group>
+  <xs:complexType name="open-pattern">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="structure:other"/>
+      <xs:group ref="structure:pattern"/>
+    </xs:choice>
+  </xs:complexType>
+  <xs:group name="name-class">
+    <xs:choice>
+      <xs:element ref="structure:name"/>
+      <xs:element ref="structure:anyName"/>
+      <xs:element ref="structure:nsName"/>
+      <xs:element name="choice">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="structure:open-name-classes">
+              <xs:attributeGroup ref="structure:common-atts"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+    </xs:choice>
+  </xs:group>
+  <xs:element name="name">
+    <xs:complexType>
+      <xs:simpleContent>
+        <xs:extension base="xs:QName">
+          <xs:attributeGroup ref="structure:common-atts"/>
+        </xs:extension>
+      </xs:simpleContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="anyName">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="structure:except-name-class">
+          <xs:attributeGroup ref="structure:common-atts"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="nsName">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="structure:except-name-class">
+          <xs:attributeGroup ref="structure:common-atts"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:complexType name="except-name-class">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="structure:other"/>
+      <xs:element ref="structure:except"/>
+    </xs:choice>
+  </xs:complexType>
+  <xs:element name="except" type="structure:open-name-classes"/>
+  <xs:complexType name="open-name-classes">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="structure:other"/>
+      <xs:group ref="structure:name-class"/>
+    </xs:choice>
+  </xs:complexType>
+  <xs:group name="open-name-class">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="structure:other"/>
+        <xs:group ref="structure:name-class"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:group>
+  <xs:attributeGroup name="common-atts">
+    <xs:attribute name="ns"/>
+    <xs:attribute name="datatypeLibrary" type="xs:anyURI"/>
+    <xs:anyAttribute namespace="##other" processContents="skip"/>
+  </xs:attributeGroup>
+  <xs:group name="other">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:any namespace="##other" processContents="skip"/>
+        <xs:any namespace="##local" processContents="skip"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="any">
+    <xs:sequence>
+      <xs:any processContents="skip"/>
+    </xs:sequence>
+  </xs:group>
+</xs:schema>
diff --git a/xml/tests/testData/xml/rootTag1.xml b/xml/tests/testData/xml/rootTag1.xml
new file mode 100644
index 0000000..e976b69
--- /dev/null
+++ b/xml/tests/testData/xml/rootTag1.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE tv [ <!ELEMENT tv (date)*> <!ELEMENT date (#PCDATA)> ]>
+
+<tv>
+  <<error>xxx</error>></<error>xxx</error>>
+</tv>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/soap-encoding.xsd b/xml/tests/testData/xml/soap-encoding.xsd
new file mode 100644
index 0000000..87ea888
--- /dev/null
+++ b/xml/tests/testData/xml/soap-encoding.xsd
@@ -0,0 +1,536 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!-- Schema for the SOAP/1.1 encoding
+
+     This schema has been produced using W3C's SOAP Version 1.2 schema
+     found at:
+
+     http://www.w3.org/2001/06/soap-encoding
+
+     Copyright 2001 Martin Gudgin, Developmentor.
+	 http://www.develop.co.uk
+
+     Changes made are the following:
+     - reverted namespace to http://schemas.xmlsoap.org/soap/encoding/
+     - reverted root to only allow 0 and 1 as lexical values
+
+	 Further changes:
+
+	 - removed default value from root attribute declaration - 20030314
+
+     Original copyright:
+     
+     Copyright 2001 W3C (Massachusetts Institute of Technology,
+     Institut National de Recherche en Informatique et en Automatique,
+     Keio University). All Rights Reserved.
+     http://www.w3.org/Consortium/Legal/
+
+     This document is governed by the W3C Software License [1] as
+     described in the FAQ [2].
+
+     [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+     [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
+           targetNamespace="http://schemas.xmlsoap.org/soap/encoding/" >
+        
+ <xs:attribute name="root" >
+   <xs:annotation>
+     <xs:documentation>
+	   'root' can be used to distinguish serialization roots from other
+       elements that are present in a serialization but are not roots of
+       a serialized value graph 
+	 </xs:documentation>
+   </xs:annotation>
+   <xs:simpleType>
+     <xs:restriction base='xs:boolean'>
+	   <xs:pattern value='0|1' />
+	 </xs:restriction>
+   </xs:simpleType>
+ </xs:attribute>
+
+  <xs:attributeGroup name="commonAttributes" >
+    <xs:annotation>
+	  <xs:documentation>
+	    Attributes common to all elements that function as accessors or 
+        represent independent (multi-ref) values.  The href attribute is
+        intended to be used in a manner like CONREF.  That is, the element
+        content should be empty iff the href attribute appears
+	  </xs:documentation>
+	</xs:annotation>
+    <xs:attribute name="id" type="xs:ID" />
+    <xs:attribute name="href" type="xs:anyURI" />
+    <xs:anyAttribute namespace="##other" processContents="lax" />
+  </xs:attributeGroup>
+
+  <!-- Global Attributes.  The following attributes are intended to be usable via qualified attribute names on any complex type referencing them. -->
+       
+  <!-- Array attributes. Needed to give the type and dimensions of an array's contents, and the offset for partially-transmitted arrays. -->
+   
+  <xs:simpleType name="arrayCoordinate" >
+    <xs:restriction base="xs:string" />
+  </xs:simpleType>
+          
+  <xs:attribute name="arrayType" type="xs:string" />
+  <xs:attribute name="offset" type="tns:arrayCoordinate" />
+  
+  <xs:attributeGroup name="arrayAttributes" >
+    <xs:attribute ref="tns:arrayType" />
+    <xs:attribute ref="tns:offset" />
+  </xs:attributeGroup>    
+  
+  <xs:attribute name="position" type="tns:arrayCoordinate" /> 
+  
+  <xs:attributeGroup name="arrayMemberAttributes" >
+    <xs:attribute ref="tns:position" />
+  </xs:attributeGroup>    
+
+  <xs:group name="Array" >
+    <xs:sequence>
+      <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
+	</xs:sequence>
+  </xs:group>
+
+  <xs:element name="Array" type="tns:Array" />
+  <xs:complexType name="Array" >
+    <xs:annotation>
+	  <xs:documentation>
+	   'Array' is a complex type for accessors identified by position 
+	  </xs:documentation>
+	</xs:annotation>
+    <xs:group ref="tns:Array" minOccurs="0" />
+    <xs:attributeGroup ref="tns:arrayAttributes" />
+    <xs:attributeGroup ref="tns:commonAttributes" />
+  </xs:complexType> 
+
+  <!-- 'Struct' is a complex type for accessors identified by name. 
+       Constraint: No element may be have the same name as any other,
+       nor may any element have a maxOccurs > 1. -->
+   
+  <xs:element name="Struct" type="tns:Struct" />
+
+  <xs:group name="Struct" >
+    <xs:sequence>
+      <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
+	</xs:sequence>
+  </xs:group>
+
+  <xs:complexType name="Struct" >
+    <xs:group ref="tns:Struct" minOccurs="0" />
+    <xs:attributeGroup ref="tns:commonAttributes"/>
+  </xs:complexType> 
+
+  <!-- 'Base64' can be used to serialize binary data using base64 encoding
+       as defined in RFC2045 but without the MIME line length limitation. -->
+
+  <xs:simpleType name="base64" >
+    <xs:restriction base="xs:base64Binary" />
+  </xs:simpleType>
+
+ <!-- Element declarations corresponding to each of the simple types in the 
+      XML Schemas Specification. -->
+
+  <xs:element name="duration" type="tns:duration" />
+  <xs:complexType name="duration" >
+    <xs:simpleContent>
+      <xs:extension base="xs:duration" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="dateTime" type="tns:dateTime" />
+  <xs:complexType name="dateTime" >
+    <xs:simpleContent>
+      <xs:extension base="xs:dateTime" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+
+
+  <xs:element name="NOTATION" type="tns:NOTATION" />
+  <xs:complexType name="NOTATION" >
+    <xs:simpleContent>
+      <xs:extension base="xs:QName" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+  
+
+  <xs:element name="time" type="tns:time" />
+  <xs:complexType name="time" >
+    <xs:simpleContent>
+      <xs:extension base="xs:time" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="date" type="tns:date" />
+  <xs:complexType name="date" >
+    <xs:simpleContent>
+      <xs:extension base="xs:date" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="gYearMonth" type="tns:gYearMonth" />
+  <xs:complexType name="gYearMonth" >
+    <xs:simpleContent>
+      <xs:extension base="xs:gYearMonth" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="gYear" type="tns:gYear" />
+  <xs:complexType name="gYear" >
+    <xs:simpleContent>
+      <xs:extension base="xs:gYear" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="gMonthDay" type="tns:gMonthDay" />
+  <xs:complexType name="gMonthDay" >
+    <xs:simpleContent>
+      <xs:extension base="xs:gMonthDay" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="gDay" type="tns:gDay" />
+  <xs:complexType name="gDay" >
+    <xs:simpleContent>
+      <xs:extension base="xs:gDay" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="gMonth" type="tns:gMonth" />
+  <xs:complexType name="gMonth" >
+    <xs:simpleContent>
+      <xs:extension base="xs:gMonth" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+  
+  <xs:element name="boolean" type="tns:boolean" />
+  <xs:complexType name="boolean" >
+    <xs:simpleContent>
+      <xs:extension base="xs:boolean" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="base64Binary" type="tns:base64Binary" />
+  <xs:complexType name="base64Binary" >
+    <xs:simpleContent>
+      <xs:extension base="xs:base64Binary" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="hexBinary" type="tns:hexBinary" />
+  <xs:complexType name="hexBinary" >
+    <xs:simpleContent>
+     <xs:extension base="xs:hexBinary" >
+       <xs:attributeGroup ref="tns:commonAttributes" />
+     </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="float" type="tns:float" />
+  <xs:complexType name="float" >
+    <xs:simpleContent>
+      <xs:extension base="xs:float" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="double" type="tns:double" />
+  <xs:complexType name="double" >
+    <xs:simpleContent>
+      <xs:extension base="xs:double" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="anyURI" type="tns:anyURI" />
+  <xs:complexType name="anyURI" >
+    <xs:simpleContent>
+      <xs:extension base="xs:anyURI" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="QName" type="tns:QName" />
+  <xs:complexType name="QName" >
+    <xs:simpleContent>
+      <xs:extension base="xs:QName" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  
+  <xs:element name="string" type="tns:string" />
+  <xs:complexType name="string" >
+    <xs:simpleContent>
+      <xs:extension base="xs:string" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="normalizedString" type="tns:normalizedString" />
+  <xs:complexType name="normalizedString" >
+    <xs:simpleContent>
+      <xs:extension base="xs:normalizedString" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="token" type="tns:token" />
+  <xs:complexType name="token" >
+    <xs:simpleContent>
+      <xs:extension base="xs:token" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="language" type="tns:language" />
+  <xs:complexType name="language" >
+    <xs:simpleContent>
+      <xs:extension base="xs:language" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="Name" type="tns:Name" />
+  <xs:complexType name="Name" >
+    <xs:simpleContent>
+      <xs:extension base="xs:Name" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="NMTOKEN" type="tns:NMTOKEN" />
+  <xs:complexType name="NMTOKEN" >
+    <xs:simpleContent>
+      <xs:extension base="xs:NMTOKEN" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="NCName" type="tns:NCName" />
+  <xs:complexType name="NCName" >
+    <xs:simpleContent>
+      <xs:extension base="xs:NCName" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="NMTOKENS" type="tns:NMTOKENS" />
+  <xs:complexType name="NMTOKENS" >
+    <xs:simpleContent>
+      <xs:extension base="xs:NMTOKENS" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="ID" type="tns:ID" />
+  <xs:complexType name="ID" >
+    <xs:simpleContent>
+      <xs:extension base="xs:ID" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="IDREF" type="tns:IDREF" />
+  <xs:complexType name="IDREF" >
+    <xs:simpleContent>
+      <xs:extension base="xs:IDREF" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="ENTITY" type="tns:ENTITY" />
+  <xs:complexType name="ENTITY" >
+    <xs:simpleContent>
+      <xs:extension base="xs:ENTITY" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="IDREFS" type="tns:IDREFS" />
+  <xs:complexType name="IDREFS" >
+    <xs:simpleContent>
+      <xs:extension base="xs:IDREFS" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="ENTITIES" type="tns:ENTITIES" />
+  <xs:complexType name="ENTITIES" >
+    <xs:simpleContent>
+      <xs:extension base="xs:ENTITIES" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="decimal" type="tns:decimal" />
+  <xs:complexType name="decimal" >
+    <xs:simpleContent>
+      <xs:extension base="xs:decimal" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="integer" type="tns:integer" />
+  <xs:complexType name="integer" >
+    <xs:simpleContent>
+      <xs:extension base="xs:integer" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="nonPositiveInteger" type="tns:nonPositiveInteger" />
+  <xs:complexType name="nonPositiveInteger" >
+    <xs:simpleContent>
+      <xs:extension base="xs:nonPositiveInteger" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="negativeInteger" type="tns:negativeInteger" />
+  <xs:complexType name="negativeInteger" >
+    <xs:simpleContent>
+      <xs:extension base="xs:negativeInteger" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="long" type="tns:long" />
+  <xs:complexType name="long" >
+    <xs:simpleContent>
+      <xs:extension base="xs:long" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="int" type="tns:int" />
+  <xs:complexType name="int" >
+    <xs:simpleContent>
+      <xs:extension base="xs:int" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="short" type="tns:short" />
+  <xs:complexType name="short" >
+    <xs:simpleContent>
+      <xs:extension base="xs:short" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="byte" type="tns:byte" />
+  <xs:complexType name="byte" >
+    <xs:simpleContent>
+      <xs:extension base="xs:byte" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="nonNegativeInteger" type="tns:nonNegativeInteger" />
+  <xs:complexType name="nonNegativeInteger" >
+    <xs:simpleContent>
+      <xs:extension base="xs:nonNegativeInteger" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="unsignedLong" type="tns:unsignedLong" />
+  <xs:complexType name="unsignedLong" >
+    <xs:simpleContent>
+      <xs:extension base="xs:unsignedLong" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="unsignedInt" type="tns:unsignedInt" />
+  <xs:complexType name="unsignedInt" >
+    <xs:simpleContent>
+      <xs:extension base="xs:unsignedInt" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="unsignedShort" type="tns:unsignedShort" />
+  <xs:complexType name="unsignedShort" >
+    <xs:simpleContent>
+      <xs:extension base="xs:unsignedShort" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="unsignedByte" type="tns:unsignedByte" />
+  <xs:complexType name="unsignedByte" >
+    <xs:simpleContent>
+      <xs:extension base="xs:unsignedByte" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="positiveInteger" type="tns:positiveInteger" />
+  <xs:complexType name="positiveInteger" >
+    <xs:simpleContent>
+      <xs:extension base="xs:positiveInteger" >
+        <xs:attributeGroup ref="tns:commonAttributes" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="anyType" />
+</xs:schema>
+
diff --git a/xml/tests/testData/xml/spring-beans-2.0.xsd b/xml/tests/testData/xml/spring-beans-2.0.xsd
new file mode 100644
index 0000000..6825d93
--- /dev/null
+++ b/xml/tests/testData/xml/spring-beans-2.0.xsd
@@ -0,0 +1,1076 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/beans"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		targetNamespace="http://www.springframework.org/schema/beans">
+
+	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Spring XML Beans Schema, version 2.0
+	Authors: Rob Harrop, Juergen Hoeller
+
+	This defines a simple and consistent way of creating a namespace
+	of JavaBeans objects, managed by a Spring BeanFactory, read by
+	XmlBeanDefinitionReader (with DefaultBeanDefinitionDocumentReader).
+
+	This document type is used by most Spring functionality, including
+	web application contexts, which are based on bean factories.
+
+	Each "bean" element in this document defines a JavaBean.
+	Typically the bean class is specified, along with JavaBean properties
+	and/or constructor arguments.
+
+	A bean instance can be a "singleton" (shared instance) or a "prototype"
+	(independent instance). Further scopes can be provided by extended
+	bean factories, for example in a web environment.
+
+	References among beans are supported, that is, setting a JavaBean property
+	or a constructor argument to refer to another bean in the same factory
+	(or an ancestor factory).
+
+	As alternative to bean references, "inner bean definitions" can be used.
+	Singleton flags of such inner bean definitions are effectively ignored:
+	inner beans are typically anonymous prototypes.
+
+	There is also support for lists, sets, maps, and java.util.Properties
+	as bean property types or constructor argument types.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<!-- base types -->
+	<xsd:complexType name="identifiedType" abstract="true">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The unique identifier for a bean. The scope of the identifier
+	is the enclosing bean factory.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:attribute name="id" type="xsd:ID">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The unique identifier for a bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Top-level <beans> tag -->
+	<xsd:element name="beans">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The top level (typically root) element. Allows the definition
+	of default values for all nested bean definitions.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="import"/>
+					<xsd:element ref="alias"/>
+					<xsd:element ref="bean"/>
+					<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="default-lazy-init" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'lazy-init' value; see the documentation for the
+	'lazy-init' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-merge" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'merge' value; see the documentation for the
+	'merge' attribute of the various collection elements. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-dependency-check" default="none">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'dependency-check' value; see the documentation for the
+	'dependency-check' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="none"/>
+						<xsd:enumeration value="simple"/>
+						<xsd:enumeration value="objects"/>
+						<xsd:enumeration value="all"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-autowire" default="no">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'autowire' value; see the documentation for the
+	'autowire' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="no"/>
+						<xsd:enumeration value="byName"/>
+						<xsd:enumeration value="byType"/>
+						<xsd:enumeration value="constructor"/>
+						<xsd:enumeration value="autodetect"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-init-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'init-method' value; see the documentation for the
+	'init-method' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-destroy-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'destroy-method' value; see the documentation for the
+	'destroy-method' attribute of the '<bean>/' element. 
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="description">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains informative text describing the purpose of the enclosing
+	element.
+	Used primarily for user documentation of XML bean definition documents.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="import">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.core.io.Resource"><![CDATA[
+	Specifies an XML bean definition resource to import.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="resource" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The relative resource location of the XML (bean definition) file to import,
+	for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml".
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="alias">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines an alias for a bean (which can reside in a different definition
+	resource).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean to define an alias for.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="alias" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The alias name to define for the bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:group name="beanElements">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="constructor-arg"/>
+				<xsd:element ref="property"/>
+				<xsd:element ref="lookup-method"/>
+				<xsd:element ref="replaced-method"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:attributeGroup name="beanAttributes">
+		<xsd:attribute name="name" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Can be used to create one or more aliases illegal in an (XML) id.
+	Multiple aliases can be separated by any number of spaces, commas,
+	or semi-colons (or indeed any mixture of the three).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="class" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The fully qualified name of the bean's class, except if it pure serves as parent for child bean definitions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="parent" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the parent bean definition.
+
+	Will use the bean class of the parent if none is specified, but can
+	also override it. In the latter case, the child bean class must be
+	compatible with the parent, i.e. accept the parent's property values
+	and constructor argument values, if any.
+
+	A child bean definition will inherit constructor argument values,
+	property values and method overrides from the parent, with the option
+	to add new values. If init method, destroy method, factory bean and/or
+	factory method are specified, they will override the corresponding
+	parent settings.
+
+	The remaining settings will always be taken from the child definition:
+	depends on, autowire mode, dependency check, scope, lazy init.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="scope" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The scope of this bean: typically "singleton" (one shared instance,
+	which will be returned by all calls to getBean with the given id), or
+	"prototype" (independent instance resulting from each call to getBean).
+	Default is "singleton".
+
+	Singletons are most commonly used, and are ideal for multi-threaded
+	service objects. Further scopes, such as "request" or "session", might
+	be supported by extended bean factories (e.g. in a web environment).
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+
+	Inner bean definitions inherit the singleton status of their containing
+	bean definition, unless explicitly specified: The inner bean will be a
+	singleton if the containing bean is a singleton, and a prototype if
+	the containing bean has any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="abstract" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Is this bean "abstract", that is, not meant to be instantiated itself
+	but rather just serving as parent for concrete child bean definitions?
+	The default is "false". Specify "true" to tell the bean factory to not
+	try to instantiate that particular bean in any case.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per abstract bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="lazy-init" default="default" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean is to be lazily initialized.
+	If false, it will be instantiated on startup by bean factories
+	that perform eager initialization of singletons. The default is
+	"false".
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether bean properties are "autowired".
+	This is an automagical process in which bean references don't need
+	to be coded explicitly in the XML bean definition file, but rather the
+	Spring container works out dependencies.
+
+	There are 5 modes:
+
+	1. "no"
+	The traditional Spring default. No automagical wiring. Bean references
+	must be defined in the XML file via the <ref/> element (or "ref"
+	attribute). We recommend this in most cases as it makes documentation
+	more explicit.
+
+	2. "byName"
+	Autowiring by property name. If a bean of class Cat exposes a dog
+	property, Spring will try to set this to the value of the bean "dog"
+	in the current container. If there is no matching bean by name, nothing
+	special happens; use dependency-check="objects" to raise an error in
+	that case.
+
+	3. "byType"
+	Autowiring if there is exactly one bean of the property type in the
+	container. If there is more than one, a fatal error is raised, and
+	you cannot use byType autowiring for that bean. If there is none,
+	nothing special happens; use dependency-check="objects" to raise an
+	error in that case.
+
+	4. "constructor"
+	Analogous to "byType" for constructor arguments. If there is not exactly
+	one bean of the constructor argument type in the bean factory, a fatal
+	error is raised.
+
+	5. "autodetect"
+	Chooses "constructor" or "byType" through introspection of the bean
+	class. If a default constructor is found, "byType" gets applied.
+
+	Note that explicit dependencies, i.e. "property" and "constructor-arg"
+	elements, always override autowiring. Autowire behavior can be combined
+	with dependency checking, which will be performed after all autowiring
+	has been completed.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="no"/>
+					<xsd:enumeration value="byName"/>
+					<xsd:enumeration value="byType"/>
+					<xsd:enumeration value="constructor"/>
+					<xsd:enumeration value="autodetect"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="dependency-check" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether or not to check whether all of this
+	beans dependencies, expressed in its properties, are satisfied.
+	The default is to perform no dependency checking.
+
+	"simple" type dependency checking includes primitives and String
+	"object" includes collaborators (other beans in the factory)
+	"all" includes both types of dependency checking
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="none"/>
+					<xsd:enumeration value="simple"/>
+					<xsd:enumeration value="objects"/>
+					<xsd:enumeration value="all"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="depends-on" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The names of the beans that this bean depends on being initialized.
+	The bean factory will guarantee that these beans get initialized
+	before this bean.
+
+	Note that dependencies are normally expressed through bean properties
+	or constructor arguments. This property should just be necessary for
+	other kinds of dependencies like statics (*ugh*) or database preparation
+	on startup.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="init-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom initialization method to invoke after setting
+	bean properties. The method must have no arguments, but may throw any
+	exception.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="destroy-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom destroy method to invoke on bean factory
+	shutdown. The method must have no arguments, but may throw any
+	exception.
+
+	Note: Only invoked on beans whose lifecycle is under the full
+	control of the factory - which is always the case for singletons,
+	but not guaranteed for any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of a factory method to use to create this object. Use
+	constructor-arg elements to specify arguments to the factory method,
+	if it takes arguments. Autowiring does not apply to factory methods.
+
+	If the "class" attribute is present, the factory method will be a static
+	method on the class specified by the "class" attribute on this bean
+	definition. Often this will be the same class as that of the constructed
+	object - for example, when the factory method is used as an alternative
+	to a constructor. However, it may be on a different class. In that case,
+	the created object will *not* be of the class specified in the "class"
+	attribute. This is analogous to FactoryBean behavior.
+
+	If the "factory-bean" attribute is present, the "class" attribute is not
+	used, and the factory method will be an instance method on the object
+	returned from a getBean call with the specified bean name. The factory
+	bean may be defined as a singleton or a prototype.
+
+	The factory method can have any number of arguments. Autowiring is not
+	supported. Use indexed constructor-arg elements in conjunction with the
+	factory-method attribute.
+
+	Setter Injection can be used in conjunction with a factory method.
+	Method Injection cannot, as the factory method returns an instance,
+	which will be used when the container creates the bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-bean" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Alternative to class attribute for factory-method usage.
+	If this is specified, no class attribute should be used.
+	This must be set to the name of a bean in the current or
+	ancestor factories that contains the relevant factory method.
+	This allows the factory itself to be configured using Dependency
+	Injection, and an instance (rather than static) method to be used.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire-candidate" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean should be considered when looking
+	for candidates to satisfy another bean's autowiring requirements.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:attributeGroup>
+
+	<xsd:element name="meta" type="metaType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Arbitrary metadata attached to a bean definition.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:complexType name="metaType">
+		<xsd:attribute name="key" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The key name of the metadata parameter being defined.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The value of the metadata parameter being defined (as a simple String).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<xsd:element name="bean">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.BeanDefinition"><![CDATA[
+	Defines a single (usually named) bean.
+
+	A bean definition may contain nested tags for constructor arguments,
+	property values, lookup methods, and replaced methods. Mixing constructor
+	injection and setter injection on the same bean is explicitly supported.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="identifiedType">
+					<xsd:group ref="beanElements"/>
+					<xsd:attributeGroup ref="beanAttributes"/>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="constructor-arg">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.ConstructorArgumentValues">
+				<![CDATA[
+	Bean definitions can specify zero or more constructor arguments.
+	This is an alternative to "autowire constructor".
+	Arguments correspond to either a specific index of the constructor
+	argument list or are supposed to be matched generically by type.
+
+	Note: A single generic argument value will just be used once, rather
+	than potentially matched multiple times (as of Spring 1.1).
+
+	constructor-arg elements are also used in conjunction with the
+	factory-method element to construct beans using static or instance
+	factory methods.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="1">
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+					<xsd:any namespace="##other" processContents="strict"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="index" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact index of thr argument in the constructor argument list.
+	Only needed to avoid ambiguities, e.g. in case of 2 arguments of
+	the exact same type.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type of the constructor argument. Only needed to avoid
+	ambiguities, e.g. in case of 2 single argument constructors
+	that can both be converted from a String.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="ref" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>" element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="value" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...<value/>"
+	element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="property" type="propertyType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Bean definitions can have zero or more properties.
+	Property elements correspond to JavaBean setter methods exposed
+	by the bean classes. Spring supports primitives, references to other
+	beans in the same or related factories, lists, maps and properties.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="lookup-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A lookup method causes the IoC container to override the given method
+	and return the bean with the name given in the bean attribute. This is
+	a form of Method Injection. It is particularly useful as an alternative
+	to implementing the BeanFactoryAware interface, in order to be able to
+	make getBean() calls for non-singleton instances at runtime. In this
+	case, Method Injection is a less invasive alternative.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the lookup method. This method must take no arguments.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean in the current or ancestor factories that
+	the lookup method should resolve to. Often this bean will be a
+	prototype, in which case the lookup method will return a distinct
+	instance on every invocation. This is useful for single-threaded objects.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="replaced-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Similar to the lookup method mechanism, the replaced-method element
+	is used to control IoC container method overriding: Method Injection.
+	This mechanism allows the overriding of a method with arbitrary code.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="arg-type"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="name" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The name of the method whose implementation must be replaced by the
+	IoC container. If this method is not overloaded, there is no need
+	to use arg-type subelements. If this method is overloaded, arg-type
+	subelements must be used for all override definitions for the method.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="replacer" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation source="java:org.springframework.beans.factory.support.MethodReplacer"><![CDATA[
+	Bean name of an implementation of the MethodReplacer interface in the
+	current or ancestor factories. This may be a singleton or prototype
+	bean. If it is a prototype, a new instance will be used for each
+	method replacement. Singleton usage is the norm.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="arg-type">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Identifies an argument for a replaced method in the event of
+	method overloading.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="match" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Specification of the type of an overloaded method argument as a String.
+	For convenience, this may be a substring of the FQN. E.g. all the
+	following would match "java.lang.String":
+	- java.lang.String
+	- String
+	- Str
+
+	As the number of arguments will be checked also, this convenience
+	can often be used to save typing.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="ref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines a reference to another bean in this factory or an external
+	factory (parent or included factory).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID,
+	and thus can be checked by the XML parser, thus should be preferred
+	for references within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="parent" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean *in a parent factory*.
+						]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="idref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The id of another bean in this factory or an external factory
+	(parent or included factory).
+	While a regular 'value' element could instead be used for the
+	same effect, using idref in this case allows validation of local
+	bean ids by the XML parser, and name completion by supporting tools.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID,
+	and thus can be checked by the XML parser, thus should be preferred
+	for references within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="value">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains a string representation of a property value.
+	The property may be a string, or may be converted to the required
+	type using the JavaBeans PropertyEditor machinery. This makes it
+	possible for application developers to write custom PropertyEditor
+	implementations that can convert strings to arbitrary target objects.
+
+	Note that this is recommended for simple objects only. Configure
+	more complex objects by populating JavaBean properties with
+	references to other beans.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type that the value should be converted to. Only needed
+	if the type of the target property or constructor argument is
+	too generic: for example, in case of a collection element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="null">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Denotes a Java null value. Necessary because an empty "value" tag
+	will resolve to an empty String, which will not be resolved to a
+	null value unless a special PropertyEditor does so.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<!-- Collection Elements -->
+	<xsd:group name="collectionElements">
+		<xsd:sequence>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:element name="list" type="listOrSetType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A list can contain multiple inner bean, ref, collection, or value
+	elements. Java lists are untyped, pending generics support in Java5,
+	although references will be strongly typed. A list can also map to
+	an array type. The necessary conversion is automatically performed
+	by the BeanFactory.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="set" type="listOrSetType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A set can contain multiple inner bean, ref, collection, or value
+	elements. Java sets are untyped, pending generics support in Java5,
+	although references will be strongly typed.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="map" type="mapType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A mapping from a key to an object. Maps may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="entry" type="entryType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A map entry can be an inner bean, ref, value, or collection.
+	The key of the entry is given by the "key" attribute or child element.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="props" type="propsType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Props elements differ from map elements in that values must be strings.
+	Props may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="key">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A key element can contain an inner bean, ref, value, or collection.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:group ref="collectionElements"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="prop">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The string value of the property. Note that whitespace is trimmed
+	off to avoid unwanted whitespace caused by typical XML formatting.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="key" type="xsd:string" use="required">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The key of the property entry.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="propertyType">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="1">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict"/>
+			</xsd:choice>
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the property, following JavaBean naming conventions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>"
+	element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Collection Types -->
+
+	<!-- base collection type -->
+	<xsd:complexType name="baseCollectionType">
+		<xsd:attribute name="merge" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- base type for collections that have (possibly) typed nested values -->
+	<xsd:complexType name="typedCollectionType">
+		<xsd:complexContent>
+			<xsd:extension base="baseCollectionType">
+				<xsd:attribute name="value-type" type="xsd:string">
+					<xsd:annotation>
+						<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested values. Must be a fully qualified
+	class name.
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:attribute>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'map' element type -->
+	<xsd:complexType name="mapType">
+		<xsd:complexContent>
+			<xsd:extension base="typedCollectionType">
+				<xsd:sequence>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="entry"/>
+					</xsd:choice>
+				</xsd:sequence>
+				<xsd:attribute name="key-type" type="xsd:string">
+					<xsd:annotation>
+						<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested entry keys. Must be a fully qualified
+	class name. 	
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:attribute>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'entry' element type -->
+	<xsd:complexType name="entryType">
+		<xsd:sequence>
+			<xsd:element ref="key" minOccurs="0"/>
+			<xsd:group ref="collectionElements"/>
+		</xsd:sequence>
+		<xsd:attribute name="key" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Each map element must specify its key as attribute or as child element.
+	A key attribute is always a String value.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="key-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a to a "key" element with a nested
+	"<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>"
+	element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- 'list' and 'set' collection type -->
+	<xsd:complexType name="listOrSetType">
+		<xsd:complexContent>
+			<xsd:extension base="typedCollectionType">
+				<xsd:group ref="collectionElements"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'props' collection type -->
+	<xsd:complexType name="propsType">
+		<xsd:complexContent>
+			<xsd:extension base="baseCollectionType">
+				<xsd:sequence>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="prop"/>
+					</xsd:choice>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- simple internal types -->
+	<xsd:simpleType name="defaultable-boolean">
+		<xsd:restriction base="xsd:NMTOKEN">
+			<xsd:enumeration value="default"/>
+			<xsd:enumeration value="true"/>
+			<xsd:enumeration value="false"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/spring-beans-2.5.xsd b/xml/tests/testData/xml/spring-beans-2.5.xsd
new file mode 100644
index 0000000..769830c
--- /dev/null
+++ b/xml/tests/testData/xml/spring-beans-2.5.xsd
@@ -0,0 +1,1164 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/beans"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		targetNamespace="http://www.springframework.org/schema/beans">
+
+	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Spring XML Beans Schema, version 2.5
+	Authors: Rob Harrop, Juergen Hoeller, Mark Fisher
+
+	This defines a simple and consistent way of creating a namespace
+	of JavaBeans objects, managed by a Spring BeanFactory, read by
+	XmlBeanDefinitionReader (with DefaultBeanDefinitionDocumentReader).
+
+	This document type is used by most Spring functionality, including
+	web application contexts, which are based on bean factories.
+
+	Each "bean" element in this document defines a JavaBean.
+	Typically the bean class is specified, along with JavaBean properties
+	and/or constructor arguments.
+
+	A bean instance can be a "singleton" (shared instance) or a "prototype"
+	(independent instance). Further scopes can be provided by extended
+	bean factories, for example in a web environment.
+
+	References among beans are supported, that is, setting a JavaBean property
+	or a constructor argument to refer to another bean in the same factory
+	(or an ancestor factory).
+
+	As alternative to bean references, "inner bean definitions" can be used.
+	Singleton flags of such inner bean definitions are effectively ignored:
+	inner beans are typically anonymous prototypes.
+
+	There is also support for lists, sets, maps, and java.util.Properties
+	as bean property types or constructor argument types.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<!-- base types -->
+	<xsd:complexType name="identifiedType" abstract="true">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The unique identifier for a bean. The scope of the identifier
+	is the enclosing bean factory.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:attribute name="id" type="xsd:ID">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The unique identifier for a bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Top-level <beans> tag -->
+	<xsd:element name="beans">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The top level (typically root) element. Allows the definition
+	of default values for all nested bean definitions.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="import"/>
+					<xsd:element ref="alias"/>
+					<xsd:element ref="bean"/>
+					<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="default-lazy-init" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'lazy-init' value; see the documentation for the
+	'lazy-init' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-merge" default="false" type="xsd:boolean">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'merge' value; see the documentation for the
+	'merge' attribute of the various collection elements.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-autowire" default="no">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'autowire' value; see the documentation for the
+	'autowire' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="no"/>
+						<xsd:enumeration value="byName"/>
+						<xsd:enumeration value="byType"/>
+						<xsd:enumeration value="constructor"/>
+						<xsd:enumeration value="autodetect"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-dependency-check" default="none">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'dependency-check' value; see the documentation for the
+	'dependency-check' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="none"/>
+						<xsd:enumeration value="simple"/>
+						<xsd:enumeration value="objects"/>
+						<xsd:enumeration value="all"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+			<xsd:attribute name="default-autowire-candidates" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A default bean name pattern for identifying autowire candidates:
+	e.g. "*Service", "data*", "*Service*", "data*Service".
+	Also accepts a comma-separated list of patterns: e.g. "*Service,*Dao".
+	See the documentation for the 'autowire-candidate' attribute of the
+	'<bean/>' element for the semantic details of autowire candidate beans.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-init-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'init-method' value; see the documentation for the
+	'init-method' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="default-destroy-method" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default 'destroy-method' value; see the documentation for the
+	'destroy-method' attribute of the '<bean>/' element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:anyAttribute namespace="##other" processContents="lax"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="description">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains informative text describing the purpose of the enclosing element.
+	Used primarily for user documentation of XML bean definition documents.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="import">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.core.io.Resource"><![CDATA[
+	Specifies an XML bean definition resource to import.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="resource" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The relative resource location of the XML (bean definition) file to import,
+	for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml".
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="alias">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines an alias for a bean (which can reside in a different definition
+	resource).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean to define an alias for.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="alias" type="xsd:string" use="required">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The alias name to define for the bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:group name="beanElements">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="constructor-arg"/>
+				<xsd:element ref="property"/>
+				<xsd:element ref="qualifier"/>
+				<xsd:element ref="lookup-method"/>
+				<xsd:element ref="replaced-method"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:attributeGroup name="beanAttributes">
+		<xsd:attribute name="name" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Can be used to create one or more aliases illegal in an (XML) id.
+	Multiple aliases can be separated by any number of spaces, commas,
+	or semi-colons (or indeed any mixture of the three).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="class" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The fully qualified name of the bean's class, except if it serves only
+	as a parent definition for child bean definitions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="parent" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the parent bean definition.
+
+	Will use the bean class of the parent if none is specified, but can
+	also override it. In the latter case, the child bean class must be
+	compatible with the parent, i.e. accept the parent's property values
+	and constructor argument values, if any.
+
+	A child bean definition will inherit constructor argument values,
+	property values and method overrides from the parent, with the option
+	to add new values. If init method, destroy method, factory bean and/or
+	factory method are specified, they will override the corresponding
+	parent settings.
+
+	The remaining settings will always be taken from the child definition:
+	depends on, autowire mode, dependency check, scope, lazy init.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="scope" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The scope of this bean: typically "singleton" (one shared instance,
+	which will be returned by all calls to getBean with the given id), or
+	"prototype" (independent instance resulting from each call to getBean).
+	Default is "singleton".
+
+	Singletons are most commonly used, and are ideal for multi-threaded
+	service objects. Further scopes, such as "request" or "session", might
+	be supported by extended bean factories (e.g. in a web environment).
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+
+	Inner bean definitions inherit the singleton status of their containing
+	bean definition, unless explicitly specified: The inner bean will be a
+	singleton if the containing bean is a singleton, and a prototype if
+	the containing bean has any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="abstract" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Is this bean "abstract", that is, not meant to be instantiated itself
+	but rather just serving as parent for concrete child bean definitions?
+	The default is "false". Specify "true" to tell the bean factory to not
+	try to instantiate that particular bean in any case.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per abstract bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="lazy-init" default="default" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean is to be lazily initialized.
+	If false, it will be instantiated on startup by bean factories
+	that perform eager initialization of singletons. The default is
+	"false".
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether bean properties are "autowired".
+	This is an automagical process in which bean references don't need
+	to be coded explicitly in the XML bean definition file, but rather the
+	Spring container works out dependencies.
+
+	There are 5 modes:
+
+	1. "no"
+	The traditional Spring default. No automagical wiring. Bean references
+	must be defined in the XML file via the <ref/> element (or "ref"
+	attribute). We recommend this in most cases as it makes documentation
+	more explicit.
+
+	2. "byName"
+	Autowiring by property name. If a bean of class Cat exposes a dog
+	property, Spring will try to set this to the value of the bean "dog"
+	in the current container. If there is no matching bean by name, nothing
+	special happens; use dependency-check="objects" to raise an error in
+	that case.
+
+	3. "byType"
+	Autowiring if there is exactly one bean of the property type in the
+	container. If there is more than one, a fatal error is raised, and
+	you cannot use byType autowiring for that bean. If there is none,
+	nothing special happens; use dependency-check="objects" to raise an
+	error in that case.
+
+	4. "constructor"
+	Analogous to "byType" for constructor arguments. If there is not exactly
+	one bean of the constructor argument type in the bean factory, a fatal
+	error is raised.
+
+	5. "autodetect"
+	Chooses "constructor" or "byType" through introspection of the bean
+	class. If a default constructor is found, "byType" gets applied.
+
+	Note that explicit dependencies, i.e. "property" and "constructor-arg"
+	elements, always override autowiring. Autowire behavior can be combined
+	with dependency checking, which will be performed after all autowiring
+	has been completed.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="no"/>
+					<xsd:enumeration value="byName"/>
+					<xsd:enumeration value="byType"/>
+					<xsd:enumeration value="constructor"/>
+					<xsd:enumeration value="autodetect"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="dependency-check" default="default">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Controls whether or not to check whether all of this
+	bean's dependencies, expressed in its properties, are satisfied.
+	The default is to perform no dependency checking.
+
+	"simple" type dependency checking includes primitives and String;
+	"objects" includes collaborators (other beans in the factory);
+	"all" includes both types of dependency checking.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:NMTOKEN">
+					<xsd:enumeration value="default"/>
+					<xsd:enumeration value="none"/>
+					<xsd:enumeration value="simple"/>
+					<xsd:enumeration value="objects"/>
+					<xsd:enumeration value="all"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="depends-on" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The names of the beans that this bean depends on being initialized.
+	The bean factory will guarantee that these beans get initialized
+	before this bean.
+
+	Note that dependencies are normally expressed through bean properties
+	or constructor arguments. This property should just be necessary for
+	other kinds of dependencies like statics (*ugh*) or database preparation
+	on startup.
+
+	Note: This attribute will not be inherited by child bean definitions.
+	Hence, it needs to be specified per concrete bean definition.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="autowire-candidate" default="default" type="defaultable-boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Indicates whether or not this bean should be considered when looking
+	for matching candidates to satisfy another bean's autowiring requirements.
+	Note that this does not affect explicit references by name, which will get
+	resolved even if the specified bean is not marked as an autowire candidate.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="primary" type="xsd:boolean">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Specifies that this bean should be given preference when multiple
+	candidates are qualified to autowire a single-valued dependency.
+	If exactly one 'primary' bean exists among the candidates, it
+	will be the autowired value.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="init-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom initialization method to invoke after setting
+	bean properties. The method must have no arguments, but may throw any
+	exception.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="destroy-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the custom destroy method to invoke on bean factory
+	shutdown. The method must have no arguments, but may throw any
+	exception.
+
+	Note: Only invoked on beans whose lifecycle is under the full
+	control of the factory - which is always the case for singletons,
+	but not guaranteed for any other scope.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-method" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of a factory method to use to create this object. Use
+	constructor-arg elements to specify arguments to the factory method,
+	if it takes arguments. Autowiring does not apply to factory methods.
+
+	If the "class" attribute is present, the factory method will be a static
+	method on the class specified by the "class" attribute on this bean
+	definition. Often this will be the same class as that of the constructed
+	object - for example, when the factory method is used as an alternative
+	to a constructor. However, it may be on a different class. In that case,
+	the created object will *not* be of the class specified in the "class"
+	attribute. This is analogous to FactoryBean behavior.
+
+	If the "factory-bean" attribute is present, the "class" attribute is not
+	used, and the factory method will be an instance method on the object
+	returned from a getBean call with the specified bean name. The factory
+	bean may be defined as a singleton or a prototype.
+
+	The factory method can have any number of arguments. Autowiring is not
+	supported. Use indexed constructor-arg elements in conjunction with the
+	factory-method attribute.
+
+	Setter Injection can be used in conjunction with a factory method.
+	Method Injection cannot, as the factory method returns an instance,
+	which will be used when the container creates the bean.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="factory-bean" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Alternative to class attribute for factory-method usage.
+	If this is specified, no class attribute should be used.
+	This must be set to the name of a bean in the current or
+	ancestor factories that contains the relevant factory method.
+	This allows the factory itself to be configured using Dependency
+	Injection, and an instance (rather than static) method to be used.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:attributeGroup>
+
+	<xsd:element name="meta" type="metaType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Arbitrary metadata attached to a bean definition.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:complexType name="metaType">
+		<xsd:attribute name="key" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The key name of the metadata attribute being defined.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The value of the metadata attribute being defined (as a simple String).
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<xsd:element name="bean">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.BeanDefinition"><![CDATA[
+	Defines a single (usually named) bean.
+
+	A bean definition may contain nested tags for constructor arguments,
+	property values, lookup methods, and replaced methods. Mixing constructor
+	injection and setter injection on the same bean is explicitly supported.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="identifiedType">
+					<xsd:group ref="beanElements"/>
+					<xsd:attributeGroup ref="beanAttributes"/>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="constructor-arg">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.config.ConstructorArgumentValues">
+				<![CDATA[
+	Bean definitions can specify zero or more constructor arguments.
+	This is an alternative to "autowire constructor".
+	Arguments correspond to either a specific index of the constructor
+	argument list or are supposed to be matched generically by type.
+
+	Note: A single generic argument value will just be used once, rather
+	than potentially matched multiple times (as of Spring 1.1).
+
+	constructor-arg elements are also used in conjunction with the
+	factory-method element to construct beans using static or instance
+	factory methods.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="description" minOccurs="0"/>
+				<xsd:choice minOccurs="0" maxOccurs="1">
+					<xsd:element ref="bean"/>
+					<xsd:element ref="ref"/>
+					<xsd:element ref="idref"/>
+					<xsd:element ref="value"/>
+					<xsd:element ref="null"/>
+					<xsd:element ref="list"/>
+					<xsd:element ref="set"/>
+					<xsd:element ref="map"/>
+					<xsd:element ref="props"/>
+					<xsd:any namespace="##other" processContents="strict"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="index" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact index of the argument in the constructor argument list.
+	Only needed to avoid ambiguities, e.g. in case of 2 arguments of
+	the exact same type.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type of the constructor argument. Only needed to avoid
+	ambiguities, e.g. in case of 2 single argument constructors
+	that can both be converted from a String.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="ref" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>" element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="value" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...<value/>" element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="property" type="propertyType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Bean definitions can have zero or more properties.
+	Property elements correspond to JavaBean setter methods exposed
+	by the bean classes. Spring supports primitives, references to other
+	beans in the same or related factories, lists, maps and properties.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="qualifier">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Bean definitions can provide qualifiers to match against annotations
+	on a field or parameter for fine-grained autowire candidate resolution.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element ref="attribute" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:sequence>
+			<xsd:attribute name="type" type="xsd:string" default="org.springframework.beans.factory.annotation.Qualifier"/>
+			<xsd:attribute name="value" type="xsd:string"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="attribute" type="metaType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A qualifier element may contain attribute child elements as key-value
+	pairs. These will be available for matching against attributes of a
+	qualifier annotation on an autowired field or parameter if present.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="lookup-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A lookup method causes the IoC container to override the given method
+	and return the bean with the name given in the bean attribute. This is
+	a form of Method Injection. It is particularly useful as an alternative
+	to implementing the BeanFactoryAware interface, in order to be able to
+	make getBean() calls for non-singleton instances at runtime. In this
+	case, Method Injection is a less invasive alternative.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="name" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the lookup method. This method must take no arguments.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the bean in the current or ancestor factories that
+	the lookup method should resolve to. Often this bean will be a
+	prototype, in which case the lookup method will return a distinct
+	instance on every invocation. This is useful for single-threaded objects.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="replaced-method">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Similar to the lookup method mechanism, the replaced-method element
+	is used to control IoC container method overriding: Method Injection.
+	This mechanism allows the overriding of a method with arbitrary code.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:choice minOccurs="0" maxOccurs="unbounded">
+					<xsd:element ref="arg-type"/>
+				</xsd:choice>
+			</xsd:sequence>
+			<xsd:attribute name="name" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The name of the method whose implementation must be replaced by the
+	IoC container. If this method is not overloaded, there is no need
+	to use arg-type subelements. If this method is overloaded, arg-type
+	subelements must be used for all override definitions for the method.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="replacer" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation source="java:org.springframework.beans.factory.support.MethodReplacer"><![CDATA[
+	Bean name of an implementation of the MethodReplacer interface in the
+	current or ancestor factories. This may be a singleton or prototype
+	bean. If it is a prototype, a new instance will be used for each
+	method replacement. Singleton usage is the norm.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="arg-type">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Identifies an argument for a replaced method in the event of
+	method overloading.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="match" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Specification of the type of an overloaded method argument as a String.
+	For convenience, this may be a substring of the FQN. E.g. all the
+	following would match "java.lang.String":
+	- java.lang.String
+	- String
+	- Str
+
+	As the number of arguments will be checked also, this convenience
+	can often be used to save typing.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="ref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Defines a reference to another bean in this factory or an external
+	factory (parent or included factory).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID and thus can 
+	be checked by the XML parser. This is therefore the preferred technique 
+	for referencing beans within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="parent" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean in a parent factory.
+						]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="idref">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The id of another bean in this factory or an external factory
+	(parent or included factory).
+	While a regular 'value' element could instead be used for the
+	same effect, using idref in this case allows validation of local
+	bean ids by the XML parser, and name completion by supporting tools.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:restriction base="xsd:anyType">
+					<xsd:attribute name="bean" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+					<xsd:attribute name="local" type="xsd:IDREF">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The name of the referenced bean. The value must be a bean ID and thus can 
+	be checked by the XML parser. This is therefore the preferred technique 
+	for referencing beans within the same bean factory XML file.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:restriction>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="value">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Contains a string representation of a property value.
+	The property may be a string, or may be converted to the required
+	type using the JavaBeans PropertyEditor machinery. This makes it
+	possible for application developers to write custom PropertyEditor
+	implementations that can convert strings to arbitrary target objects.
+
+	Note that this is recommended for simple objects only. Configure
+	more complex objects by populating JavaBean properties with
+	references to other beans.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="type" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The exact type that the value should be converted to. Only needed
+	if the type of the target property or constructor argument is
+	too generic: for example, in case of a collection element.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="null">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Denotes a Java null value. Necessary because an empty "value" tag
+	will resolve to an empty String, which will not be resolved to a
+	null value unless a special PropertyEditor does so.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<!-- Collection Elements -->
+	<xsd:group name="collectionElements">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:choice>
+		</xsd:sequence>
+	</xsd:group>
+
+	<xsd:element name="list">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A list can contain multiple inner bean, ref, collection, or value elements.
+	A list can also map to an array type; the necessary conversion is performed
+	automatically.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="listOrSetType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="set">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A set can contain multiple inner bean, ref, collection, or value elements.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="listOrSetType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="map">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A mapping from a key to an object. Maps may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="mapType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="entry" type="entryType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A map entry can be an inner bean, ref, value, or collection.
+	The key of the entry is given by the "key" attribute or child element.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="props">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Props elements differ from map elements in that values must be strings.
+	Props may be empty.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="propsType">
+					<xsd:attribute name="merge" type="defaultable-boolean">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	Enables/disables merging for collections when using parent/child beans.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="key">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	A key element can contain an inner bean, ref, value, or collection.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:group ref="collectionElements"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="prop">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	The string value of the property. Note that whitespace is trimmed
+	off to avoid unwanted whitespace caused by typical XML formatting.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType mixed="true">
+			<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
+			<xsd:attribute name="key" type="xsd:string" use="required">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The key of the property entry.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="propertyType">
+		<xsd:sequence>
+			<xsd:element ref="description" minOccurs="0"/>
+			<xsd:choice minOccurs="0" maxOccurs="1">
+				<xsd:element ref="meta"/>
+				<xsd:element ref="bean"/>
+				<xsd:element ref="ref"/>
+				<xsd:element ref="idref"/>
+				<xsd:element ref="value"/>
+				<xsd:element ref="null"/>
+				<xsd:element ref="list"/>
+				<xsd:element ref="set"/>
+				<xsd:element ref="map"/>
+				<xsd:element ref="props"/>
+				<xsd:any namespace="##other" processContents="strict"/>
+			</xsd:choice>
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The name of the property, following JavaBean naming conventions.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>" element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- Collection Types -->
+
+	<!-- base type for collections that have (possibly) typed nested values -->
+	<xsd:complexType name="collectionType">
+		<xsd:attribute name="value-type" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested values. Must be a fully qualified
+	class name.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- 'list' and 'set' collection type -->
+	<xsd:complexType name="listOrSetType">
+		<xsd:complexContent>
+			<xsd:extension base="collectionType">
+				<xsd:group ref="collectionElements"/>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'map' element type -->
+	<xsd:complexType name="mapType">
+		<xsd:complexContent>
+			<xsd:extension base="collectionType">
+				<xsd:sequence>
+					<xsd:element ref="description" minOccurs="0"/>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="entry"/>
+					</xsd:choice>
+				</xsd:sequence>
+				<xsd:attribute name="key-type" type="xsd:string">
+					<xsd:annotation>
+						<xsd:documentation source="java:java.lang.Class"><![CDATA[
+	The default Java type for nested entry keys. Must be a fully qualified
+	class name.
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:attribute>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- 'entry' element type -->
+	<xsd:complexType name="entryType">
+		<xsd:sequence>
+			<xsd:element ref="key" minOccurs="0"/>
+			<xsd:group ref="collectionElements"/>
+		</xsd:sequence>
+		<xsd:attribute name="key" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Each map element must specify its key as attribute or as child element.
+	A key attribute is always a String value.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="key-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a to a "key" element with a nested
+	"<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<value>...</value>"
+	element.
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="value-ref" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	A short-cut alternative to a nested "<ref bean='...'/>".
+				]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<!-- 'props' collection type -->
+	<xsd:complexType name="propsType">
+		<xsd:complexContent>
+			<xsd:extension base="collectionType">
+				<xsd:sequence>
+					<xsd:choice minOccurs="0" maxOccurs="unbounded">
+						<xsd:element ref="prop"/>
+					</xsd:choice>
+				</xsd:sequence>
+			</xsd:extension>
+		</xsd:complexContent>
+	</xsd:complexType>
+
+	<!-- simple internal types -->
+	<xsd:simpleType name="defaultable-boolean">
+		<xsd:restriction base="xsd:NMTOKEN">
+			<xsd:enumeration value="default"/>
+			<xsd:enumeration value="true"/>
+			<xsd:enumeration value="false"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/spring-context-2.5.xsd b/xml/tests/testData/xml/spring-context-2.5.xsd
new file mode 100644
index 0000000..0cbb8da
--- /dev/null
+++ b/xml/tests/testData/xml/spring-context-2.5.xsd
@@ -0,0 +1,423 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/context" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+			xmlns:beans="http://www.springframework.org/schema/beans"
+			xmlns:tool="http://www.springframework.org/schema/tool"
+			targetNamespace="http://www.springframework.org/schema/context" elementFormDefault="qualified"
+			attributeFormDefault="unqualified">
+
+	<xsd:import namespace="http://www.springframework.org/schema/beans"/>
+	<xsd:import namespace="http://www.springframework.org/schema/tool"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Defines the configuration elements for the Spring Framework's application
+	context support. Effects the activation of various configuration styles
+	for the containing Spring ApplicationContext.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<xsd:element name="property-placeholder">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Activates replacement of ${...} placeholders, resolved against the specified properties file or Properties object
+	(if any). Falls back to resolving placeholders against JVM system properties.
+	Alternatively, define a parameterized PropertyPlaceholderConfigurer bean in the context.
+			]]></xsd:documentation>
+			<xsd:appinfo>
+				<tool:annotation>
+					<tool:exports type="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+				</tool:annotation>
+			</xsd:appinfo>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:attribute name="location" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The location of the properties file to resolve placeholders against, as a Spring
+	resource location: a URL, a "classpath:" pseudo URL, or a relative file path.
+	Multiple locations may be specified, separated by commas. If neither location nor properties-ref is
+	specified, placeholders will be resolved against system properties.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="properties-ref" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation source="java:java.util.Properties"><![CDATA[
+	The bean name of a Java Properties object that will be used for property substitution.
+	If neither location nor properties-ref is specified, placeholders will be resolved against system properties.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="property-override">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Activates pushing of override values into bean properties, based on configuration
+	lines of the following format: beanName.property=value
+			]]></xsd:documentation>
+			<xsd:appinfo>
+				<tool:annotation>
+					<tool:exports type="org.springframework.beans.factory.config.PropertyOverrideConfigurer"/>
+				</tool:annotation>
+			</xsd:appinfo>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:attribute name="location" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The location of the properties file to read property overrides from, as a Spring
+	resource location: a URL, a "classpath:" pseudo URL, or a relative file path.
+	Multiple locations may be specified, separated by commas.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="properties-ref" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation source="java:java.util.Properties"><![CDATA[
+	The bean name of a Java Properties object that will be used for property overrides.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="annotation-config">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Activates various annotations to be detected in bean classes: Spring's @Required and
+	@Autowired, as well as JSR 250's @PostConstruct, @PreDestroy and @Resource (if available),
+	JAX-WS's @WebServiceRef (if available), EJB3's @EJB (if available), and JPA's
+	@PersistenceContext and @PersistenceUnit (if available). Alternatively, you may
+	choose to activate the individual BeanPostProcessors for those annotations.
+
+	Note: This tag does not activate processing of Spring's @Transactional or EJB3's
+	@TransactionAttribute annotation. Consider the use of the <tx:annotation-driven>
+	tag for that purpose.
+			]]></xsd:documentation>
+		</xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="component-scan">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Scans the classpath for annotated components that will be auto-registered as 
+	Spring beans. By default, the Spring-provided @Component, @Repository, 
+	@Service, and @Controller stereotypes will be detected.
+
+	Note: This tag implies the effects of the 'annotation-config' tag, activating @Required,
+	@Autowired, @PostConstruct, @PreDestroy, @Resource, @PersistenceContext and @PersistenceUnit
+	annotations in the component classes, which is usually desired for autodetected components
+	(without external configuration). Turn off the 'annotation-config' attribute to deactivate
+	this default behavior, for example in order to use custom BeanPostProcessor definitions
+	for handling those annotations.
+
+	Note: You may use placeholders in package paths, but only resolved against system
+	properties (analogous to resource paths). A component scan results in new bean definition
+	being registered; Spring's PropertyPlaceholderConfigurer will apply to those bean
+	definitions just like to regular bean definitions, but it won't apply to the component
+	scan settings themselves.
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:sequence>
+				<xsd:element name="include-filter" type="filterType" minOccurs="0" maxOccurs="unbounded">
+					<xsd:annotation>
+						<xsd:documentation><![CDATA[
+	Controls which eligible types to include for component scanning.
+							]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:element>
+				<xsd:element name="exclude-filter" type="filterType" minOccurs="0" maxOccurs="unbounded">
+					<xsd:annotation>
+						<xsd:documentation><![CDATA[
+	Controls which eligible types to exclude for component scanning.
+						]]></xsd:documentation>
+					</xsd:annotation>
+				</xsd:element>
+			</xsd:sequence>
+			<xsd:attribute name="base-package" type="xsd:string" use="required">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The comma-separated list of packages to scan for annotated components.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="resource-pattern" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Controls the class files eligible for component detection. Defaults to "**/*.class", the recommended value.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="use-default-filters" type="xsd:boolean" default="true">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Indicates whether automatic detection of classes annotated with @Component, @Repository, @Service, or @Controller
+	should be enabled. Default is "true".
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="annotation-config" type="xsd:boolean" default="true">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Indicates whether the implicit AutowiredAnnotationBeanPostProcessor and CommonAnnotationBeanPostProcessor should
+	 be enabled. Default is "true".
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="name-generator" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The fully-qualified classname of the BeanNameGenerator to be used for naming detected components.
+					]]></xsd:documentation>
+					<xsd:appinfo>
+						<tool:annotation>
+							<tool:expected-type type="java.lang.Class"/>
+							<tool:assignable-to type="org.springframework.beans.factory.support.BeanNameGenerator"/>
+						</tool:annotation>
+					</xsd:appinfo>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="scope-resolver" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The fully-qualified class name of the ScopeMetadataResolver to be used for resolving the scope of detected components.
+					]]></xsd:documentation>
+					<xsd:appinfo>
+						<tool:annotation>
+							<tool:expected-type type="java.lang.Class"/>
+							<tool:assignable-to type="org.springframework.context.annotation.ScopeMetadataResolver"/>
+						</tool:annotation>
+					</xsd:appinfo>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="scoped-proxy">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	Indicates whether proxies should be generated for detected components, which may be necessary when using certain
+	non-singleton scopes in a proxy-style fashion. Default is to generate no such proxies.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:string">
+						<xsd:enumeration value="no"/>
+						<xsd:enumeration value="interfaces"/>
+						<xsd:enumeration value="targetClass"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="load-time-weaver">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Activates a Spring LoadTimeWeaver for this application context, available as
+	a bean with the name "loadTimeWeaver". Any bean that implements the
+	LoadTimeWeaverAware interface will then receive the LoadTimeWeaver reference
+	automatically; for example, Spring's JPA bootstrap support.
+
+	The default weaver is determined automatically. As of Spring 2.5: detecting
+	Sun's GlassFish, Oracle's OC4J, Spring's VM agent and any ClassLoader
+	supported by Spring's ReflectiveLoadTimeWeaver (for example, the
+	TomcatInstrumentableClassLoader).
+
+	The activation of AspectJ load-time weaving is specified via a simple flag
+	(the 'aspectj-weaving' attribute), with the AspectJ class transformer
+	registered through Spring's LoadTimeWeaver. AspectJ weaving will be activated
+	by default if a "META-INF/aop.xml" resource is present in the classpath.
+
+	This also activates the current application context for applying dependency
+	injection to non-managed classes that are instantiated outside of the Spring
+	bean factory (typically classes annotated with the @Configurable annotation).
+	This will only happen if the AnnotationBeanConfigurerAspect is on the classpath
+	(i.e. spring-aspects.jar), effectively activating "spring-configured" by default.
+			]]></xsd:documentation>
+			<xsd:appinfo>
+				<tool:annotation>
+					<tool:exports type="org.springframework.instrument.classloading.LoadTimeWeaver"/>
+				</tool:annotation>
+			</xsd:appinfo>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:attribute name="weaver-class" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The fully-qualified classname of the LoadTimeWeaver that is to be activated.
+					]]></xsd:documentation>
+					<xsd:appinfo>
+						<tool:annotation>
+							<tool:expected-type type="java.lang.Class"/>
+							<tool:assignable-to type="org.springframework.instrument.classloading.LoadTimeWeaver"/>
+						</tool:annotation>
+					</xsd:appinfo>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="aspectj-weaving" default="autodetect">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:string">
+						<xsd:enumeration value="on">
+							<xsd:annotation>
+								<xsd:documentation><![CDATA[
+	Switches Spring-based AspectJ load-time weaving on.
+								]]></xsd:documentation>
+							</xsd:annotation>
+						</xsd:enumeration>
+						<xsd:enumeration value="off">
+							<xsd:annotation>
+								<xsd:documentation><![CDATA[
+	Switches Spring-based AspectJ load-time weaving off.
+								]]></xsd:documentation>
+							</xsd:annotation>
+						</xsd:enumeration>
+						<xsd:enumeration value="autodetect">
+							<xsd:annotation>
+								<xsd:documentation><![CDATA[
+	Switches AspectJ load-time weaving on if a "META-INF/aop.xml" resource
+	is present in the classpath. If there is no such resource, then AspectJ
+	load-time weaving will be switched off.
+								]]></xsd:documentation>
+							</xsd:annotation>
+						</xsd:enumeration>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="spring-configured">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect">
+				<![CDATA[
+	Signals the current application context to apply dependency injection
+	to non-managed classes that are instantiated outside of the Spring bean
+	factory (typically classes annotated with the @Configurable annotation).
+			]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:simpleType>
+			<xsd:restriction base="xsd:string"/>
+		</xsd:simpleType>
+	</xsd:element>
+
+	<xsd:element name="mbean-export">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.jmx.export.annotation.AnnotationMBeanExporter"><![CDATA[
+	Activates default exporting of MBeans by detecting standard MBeans in the Spring
+	context as well as @ManagedResource annotations on Spring-defined beans.
+
+	The resulting MBeanExporter bean is defined under the name "mbeanExporter".
+	Alternatively, consider defining a custom AnnotationMBeanExporter bean explicitly.
+			]]></xsd:documentation>
+			<xsd:appinfo>
+				<tool:annotation>
+					<tool:exports type="org.springframework.jmx.export.annotation.MBeanExporter"/>
+				</tool:annotation>
+			</xsd:appinfo>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:attribute name="default-domain" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The default domain to use when generating JMX ObjectNames.
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="server" type="xsd:string">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The bean name of the MBeanServer to which MBeans should be exported.
+	Default is to use the platform's default MBeanServer (autodetecting
+	WebLogic 9+, WebSphere 5.1+ and the JDK 1.5+ platform MBeanServer).
+					]]></xsd:documentation>
+				</xsd:annotation>
+			</xsd:attribute>
+			<xsd:attribute name="registration">
+				<xsd:annotation>
+					<xsd:documentation><![CDATA[
+	The registration behavior, indicating how to deal with existing MBeans
+	of the same name: fail with an exception, ignore and keep the existing
+	MBean, or replace the existing one with the new MBean.
+
+	Default is to fail with an exception.
+					]]></xsd:documentation>
+				</xsd:annotation>
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:NMTOKEN">
+						<xsd:enumeration value="failOnExisting"/>
+						<xsd:enumeration value="ignoreExisting"/>
+						<xsd:enumeration value="replaceExisting"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="mbean-server">
+		<xsd:annotation>
+			<xsd:documentation source="java:org.springframework.jmx.support.MBeanServerFactoryBean"><![CDATA[
+	Exposes a default MBeanServer for the current platform.
+	Autodetects WebLogic 9+, WebSphere 5.1+ and the JDK 1.5+ platform MBeanServer.
+
+	The default bean name for the exposed MBeanServer is "mbeanServer".
+	This may be customized through specifying the "id" attribute.
+			]]></xsd:documentation>
+			<xsd:appinfo>
+				<tool:annotation>
+					<tool:exports type="javax.management.MBeanServer"/>
+				</tool:annotation>
+			</xsd:appinfo>
+		</xsd:annotation>
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="beans:identifiedType">
+					<xsd:attribute name="agent-id" type="xsd:string">
+						<xsd:annotation>
+							<xsd:documentation><![CDATA[
+	The agent id of the target MBeanServer, if any.
+							]]></xsd:documentation>
+						</xsd:annotation>
+					</xsd:attribute>
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="filterType">
+		<xsd:attribute name="type" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+    Controls the type of filtering to apply to the expression.
+
+    "annotation" indicates an annotation to be present at the type level in target components;
+    "assignable" indicates a class (or interface) that the target components are assignable to (extend/implement);
+    "aspectj" indicates an AspectJ type expression to be matched by the target components;
+    "regex" indicates a regex expression to be matched by the target components' class names;
+    "custom" indicates a custom implementation of the org.springframework.core.type.TypeFilter interface.
+
+    Note: This attribute will not be inherited by child bean definitions.
+    Hence, it needs to be specified per concrete bean definition.
+                ]]></xsd:documentation>
+			</xsd:annotation>
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:string">
+					<xsd:enumeration value="annotation"/>
+					<xsd:enumeration value="assignable"/>
+					<xsd:enumeration value="aspectj"/>
+					<xsd:enumeration value="regex"/>
+					<xsd:enumeration value="custom"/>
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="expression" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+    Indicates the filter expression, the type of which is indicated by "type".
+                ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/spring-tool-2.5.xsd b/xml/tests/testData/xml/spring-tool-2.5.xsd
new file mode 100644
index 0000000..17bec6d
--- /dev/null
+++ b/xml/tests/testData/xml/spring-tool-2.5.xsd
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<xsd:schema xmlns="http://www.springframework.org/schema/tool"
+		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		targetNamespace="http://www.springframework.org/schema/tool"
+		elementFormDefault="qualified">
+
+	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+
+	<xsd:annotation>
+		<xsd:documentation><![CDATA[
+	Defines the tool support annotations for Spring's configuration namespaces.
+	Used in other namespace XSD files; not intended for direct use in config files.
+		]]></xsd:documentation>
+	</xsd:annotation>
+
+	<xsd:element name="annotation">
+		<xsd:complexType>
+			<xsd:sequence minOccurs="0">
+				<xsd:element name="expected-type" type="typedParameterType" minOccurs="0" maxOccurs="1"/>
+				<xsd:element name="assignable-to" type="typedParameterType" minOccurs="0" maxOccurs="1"/>
+				<xsd:element name="exports" type="exportsType" minOccurs="0" maxOccurs="1"/>
+				<xsd:element name="registers-scope" type="registersScopeType" minOccurs="0" maxOccurs="unbounded"/>
+			</xsd:sequence>
+			<xsd:attribute name="kind" default="direct">
+				<xsd:simpleType>
+					<xsd:restriction base="xsd:string">
+						<xsd:enumeration value="ref"/>
+						<xsd:enumeration value="direct"/>
+					</xsd:restriction>
+				</xsd:simpleType>
+			</xsd:attribute>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:complexType name="typedParameterType">
+		<xsd:attribute name="type" type="xsd:string" use="required"/>
+	</xsd:complexType>
+
+	<xsd:complexType name="exportsType">
+		<xsd:annotation>
+			<xsd:documentation><![CDATA[
+	Indicates that an annotated type exports an application visible component.
+		]]></xsd:documentation>
+		</xsd:annotation>
+		<xsd:attribute name="type" type="xsd:string">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	The type of the exported component. May be null if the type is not known until runtime.
+		]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="identifier" type="xsd:string" default="@id">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Defines an XPath query that can be executed against the node annotated with this
+	type to determine the identifier of any exported component.
+		]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+	<xsd:complexType name="registersScopeType">
+		<xsd:attribute name="name" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[
+	Defines the name of a custom bean scope that the annotated type registers, e.g. "conversation".
+	Such a scope will be available in addition to the standard "singleton" and "prototype" scopes
+	(plus "request", "session" and "globalSession" in a web application environment).
+		]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+
+</xsd:schema>
diff --git a/xml/tests/testData/xml/struts-config_1_2.dtd b/xml/tests/testData/xml/struts-config_1_2.dtd
new file mode 100644
index 0000000..fd0dc15
--- /dev/null
+++ b/xml/tests/testData/xml/struts-config_1_2.dtd
@@ -0,0 +1,686 @@
+<!--
+     DTD for the Struts Application Configuration File
+
+     To support validation of your configuration file, include the following
+     DOCTYPE element at the beginning (after the "xml" declaration):
+
+     <!DOCTYPE struts-config PUBLIC
+       "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
+       "http://struts.apache.org/dtds/struts-config_1_2.dtd">
+
+     $Id: struts-config_1_2.dtd,v 1.8 2004/04/06 23:30:23 husted Exp $
+-->
+
+
+<!-- ========== Defined Types ============================================= -->
+
+
+<!-- An "AttributeName" is the identifier of a page, request, session, or
+     application scope attribute.
+-->
+<!ENTITY % AttributeName "CDATA">
+
+
+<!-- A "BeanName" is the identifier of a JavaBean, such as a form bean,
+     and also serves as the name of the corresponding scripting variable
+     and the name of the JSP attribute under which the bean is accessed.
+     Therefore, it must conform to the rules for a Java identifier.
+-->
+<!ENTITY % BeanName "CDATA">
+
+
+<!-- A "Boolean" is the string representation of a boolean (true or false)
+     variable.
+-->
+<!ENTITY % Boolean "(true|false|yes|no)">
+
+
+<!-- A "ClassName" is the fully qualified name of a Java class that is
+     instantiated to provide the functionality of the enclosing element.
+-->
+<!ENTITY % ClassName "CDATA">
+
+
+<!-- An "Integer" is a character string consisting solely of numeric digits,
+     optionally preceeded by a minus sign, that can be converted to a
+     32-bit integer.
+-->
+<!ENTITY % Integer "CDATA">
+
+
+<!-- A "Location" is a relative path, delimited by "/" characters, that
+     defines the location of a resource relative to the location of the
+     Struts configuration file itself.
+-->
+<!ENTITY % Location "#PCDATA">
+
+
+<!-- A "PropName" is the name of a JavaBeans property, and must begin with
+     a lower case letter and contain only characters that are legal in a
+     Java identifier.
+-->
+<!ENTITY % PropName "CDATA">
+
+
+<!-- A "RequestPath" is an module-relative URI path, beginning with a
+     slash, that identifies a mapped resource (such as a JSP page or a servlet)
+     within this web application.
+-->
+<!ENTITY % RequestPath "CDATA">
+
+
+<!-- The name of a JSP bean scope within which such a form bean may be
+     accessed.
+-->
+<!ENTITY % RequestScope "(request|session)">
+
+
+<!-- ========== Top Level Elements ======================================== -->
+
+
+<!-- The "struts-config" element is the root of the configuration file
+     hierarchy, and contains nested elements for all of the other
+     configuration settings.
+-->
+<!ELEMENT struts-config (display-name?, description?, data-sources?, form-beans?, global-exceptions?, global-forwards?, action-mappings?, controller?, message-resources*, plug-in*)>
+<!ATTLIST struts-config  id             ID              #IMPLIED>
+
+
+<!-- The "data-sources" element describes a set of DataSource objects [JDBC 2.0
+     Standard Extension]. The individual DataSource objects are configured through
+     nested <data-source> elements.
+-->
+<!ELEMENT data-sources (data-source*)>
+<!ATTLIST data-sources   id             ID              #IMPLIED>
+
+
+<!-- The "data-source" element describes a DataSource object [JDBC 2.0 Standard
+     Extension] that will be instantiated, configured, and made available as a
+     servlet context attribute (or "application-scope bean"). Any object can be
+     specified so long as it implements [javax.sql.DataSource] and can be
+     configured entirely from JavaBean properties. The following attributes
+     are required:
+
+     className       The configuration bean for this DataSource object. If
+                     specified, the object must be a subclass of the default
+                     configuration bean.
+                     ["org.apache.struts.config.DataSourceConfig"]
+
+     key             Servlet context attribute key under which this data source
+                     will be stored.  Default is the value specified by string
+                     constant defined by Globals.DATA_SOURCE_KEY. The application
+                     module prefix (if any) is appended to the key
+                     (${key}$prefix}).
+                     [org.apache.struts.Globals.DATA_SOURCE_KEY]
+
+                     NOTE: The application module prefix includes the leading
+                     slash, so the default datasource for a module named "foo" is
+                     stored under "org.apache.struts.action.DATA_SOURCE/foo".
+
+     type          Fully qualified Java class name for this data source object.
+                     The class must implement DataSource [javax.sql.DataSource],
+                     and the object must be configurable entirely from JavaBean
+                     properties.
+-->
+<!ELEMENT data-source (set-property*)>
+<!ATTLIST data-source    id             ID              #IMPLIED>
+<!ATTLIST data-source    className      %ClassName;     #IMPLIED>
+<!ATTLIST data-source    key            %AttributeName; #IMPLIED>
+<!ATTLIST data-source    type           %ClassName;     #REQUIRED>
+
+
+<!-- The "form-beans" element describes the set of form bean descriptors for this
+     module. The following attributes are defined:
+
+     type            Fully qualified Java class to use when instantiating
+                     ActionFormBean objects. If specified, the object must be a
+                     subclass of the default class type.
+
+                     WARNING:  For Struts 1.0, this value is ignored.  You
+                     can set the default implementation class name with the
+                     "formBean" initialization parameter to the Struts
+                     controller servlet.
+-->
+<!ELEMENT form-beans (form-bean*)>
+<!ATTLIST form-beans     id             ID              #IMPLIED>
+<!ATTLIST form-beans     type           %ClassName;     #IMPLIED>
+
+
+<!-- The "form-bean" element describes an ActionForm subclass
+     [org.apache.struts.action.ActionForm] that can be referenced by an "action"
+     element.
+
+
+The "form-bean" element describes a particular form bean, which is a
+     JavaBean that implements the org.apache.struts.action.ActionForm
+     class.  The following attributes are defined:
+
+     className       The configuration bean for this form bean object. If
+                     specified, the object must be a subclass of the default
+                     configuration bean.
+                     ["org.apache.struts.config.FormBeanConfig"]
+
+     name            The unique identifier for this form bean. Referenced by the
+                     <action> element to specify which form bean to use with its
+                     request.
+
+     type            Fully qualified Java class name of the ActionForm subclass
+                     to use with this form bean.
+-->
+<!ELEMENT form-bean (icon?, display-name?, description?, set-property*, form-property*)>
+<!ATTLIST form-bean      id             ID              #IMPLIED>
+<!ATTLIST form-bean      className      %ClassName;     #IMPLIED>
+<!ATTLIST form-bean      dynamic        %Boolean;       #IMPLIED>
+<!ATTLIST form-bean      name           %BeanName;      #REQUIRED>
+<!ATTLIST form-bean      type           %ClassName;     #REQUIRED>
+
+
+<!-- The "form-property" element describes a JavaBean property that can be used to
+     configure an instance of a DynaActionForm or a subclass thereof. This element
+     is only utilized when the "type" attribute of the enclosing "form-bean" element
+     is [org.apache.struts.action.DynaActionForm] or a subclass of DynaActionForm. If
+     a custom DynaActionForm subclass is used, then the "dynamic" attribute of the
+     enclosing <form-bean> element must be set to "true". Since Struts 1.1.
+
+     className       The configuration bean for this form property object. If
+                     specified, the object must be a subclass of the default
+                     configuration bean.
+                     ["org.apache.struts.config.FormPropertyConfig"]
+
+     initial         String representation of the initial value for this property.
+                     If not specified, primitives will be initialized to zero and
+                     objects initialized to the zero-argument instantiation of that
+                     object class.  For example, Strings will be initialized to ""
+
+
+     name            The name of the JavaBean property described by this element.
+
+     size            The number of array elements to create if the value of the
+                     "type" attribute specifies an array, but there is no value
+                     specified for the "initial" attribute.
+
+     type            Fully qualified Java class name of the field underlying this
+                     property, optionally followed by "[]" to indicate that the
+                     field is indexed.
+-->
+<!ELEMENT form-property  (set-property*)>
+<!ATTLIST form-property  className      %ClassName;     #IMPLIED>
+<!ATTLIST form-property  initial        CDATA           #IMPLIED>
+<!ATTLIST form-property  name           %PropName;      #REQUIRED>
+<!ATTLIST form-property  size           %Integer;       #IMPLIED>
+<!ATTLIST form-property  type           %ClassName;     #REQUIRED>
+
+
+<!-- The "global-exceptions" element describes a set of exceptions that might be
+     thrown by an Action object. The handling of individual exception types is
+     configured through nested exception elements. An <action> element may
+     override a global exception handler by registering a local exception handler
+     for the same exception type. Since Struts 1.1.
+-->
+<!ELEMENT global-exceptions (exception*)>
+<!ATTLIST global-exceptions id          ID              #IMPLIED>
+
+
+<!-- The "exception" element registers an ExceptionHandler for an exception type.
+     The following attributes are defined:
+
+    bundle           Servlet context attribute for the message resources bundle
+                     associated with this handler. The default attribute is the
+                     value specified by the string constant declared at
+                     Globals.MESSAGES_KEY.
+                     [org.apache.struts.Globals.MESSAGES_KEY]
+
+    className        The configuration bean for this ExceptionHandler object.
+                     If specified, className must be a subclass of the default
+                     configuration bean
+                     ["org.apache.struts.config.ExceptionConfig"]
+
+    handler          Fully qualified Java class name for this exception handler.
+                     ["org.apache.struts.action.ExceptionHandler"]
+
+    key              The key to use with this handler's message resource bundle
+                     that will retrieve the error message template for this
+                     exception.
+
+    path             The module-relative URI to the resource that will complete
+                     the request/response if this exception occurs.
+
+    scope            The context ("request" or "session") that is used to access
+                     the ActionError object [org.apache.struts.action.ActionError]
+                     for this exception.
+
+    type             Fully qualified Java class name of the exception type to
+                     register with this handler.
+-->
+<!ELEMENT exception (icon?, display-name?, description?, set-property*)>
+<!ATTLIST exception      id             ID              #IMPLIED>
+<!ATTLIST exception      bundle         %AttributeName; #IMPLIED>
+<!ATTLIST exception      className      %ClassName;     #IMPLIED>
+<!ATTLIST exception      handler        %ClassName;     #IMPLIED>
+<!ATTLIST exception      key            CDATA           #REQUIRED>
+<!ATTLIST exception      path           %RequestPath;    #IMPLIED>
+<!ATTLIST exception      scope          %RequestScope;   #IMPLIED>
+<!ATTLIST exception      type           %ClassName;     #REQUIRED>
+
+
+<!-- The "global-forwards" element describes a set of ActionForward objects
+     [org.apache.struts.action.ActionForward] that are available to all Action
+     objects as a return value. The individual ActionForwards are configured
+     through nested <forward> elements. An <action> element may override a global
+     forward by defining a local <forward> of the same name.
+
+     type            Fully qualified Java class to use when instantiating
+                     ActionForward objects.  If specified, the object must be a
+                     subclass of the default class type.
+
+                     WARNING:  For Struts 1.0, this value is ignored.  You
+                     can set the default implementation class name with the
+                     "forward" initialization parameter to the Struts
+                     controller servlet.
+-->
+<!ELEMENT global-forwards (forward*)>
+<!ATTLIST global-forwards id            ID              #IMPLIED>
+<!ATTLIST global-forwards type          %ClassName;     #IMPLIED>
+
+
+<!-- The "forward" element describes an ActionForward that is to be made
+     available to an Action as a return value. An ActionForward is referenced by
+     a logical name and encapsulates a URI. A "forward" element may be used to
+     describe both global and local ActionForwards. Global forwards are available
+     to all the Action objects in the module. Local forwards can be
+     nested within an <action> element and only available to an Action object
+     when it is invoked through that ActionMapping.
+
+     className       Fully qualified Java class name of ActionForward
+                     subclass to use for this object.
+                     ["org.apache.struts.action.ActionForward"]
+
+    contextRelative  Set this to "true" if, in a modular application, the path
+                     attribute starts with a slash "/" and should be considered
+                     relative to the entire web application rather than the module.
+                     Since Struts 1.1.
+                     DEPRECATED.
+                     [false]
+
+     module          The module prefix to use with this path. This value should
+                     begin with a slash ("/").
+
+     name            The unique identifier for this forward. Referenced by the
+                     Action object at runtime to select - by its logical name -
+                     the resource that should complete the request/response.
+
+     path            The module-relative or context-relative path to the resources
+                     that is encapsulated by the logical name of this ActionForward.
+                     If the path is to be considered context-relative when used in
+                     a modular application, then the contextRelative attribute
+                     should be set to "true". This value should begin with a slash
+                     ("/") character.
+
+     redirect        Set to "true" if a redirect instruction should be issued to
+                     the user-agent so that a new request is issued for this
+                     forward's resource. If true,  RequestDispatcher.Redirect is
+                     called. If "false", RequestDispatcher.forward is called instead.
+                     [false]
+-->
+<!ELEMENT forward (icon?, display-name?, description?, set-property*)>
+<!ATTLIST forward        id             ID              #IMPLIED>
+<!ATTLIST forward        className      %ClassName;     #IMPLIED>
+<!ATTLIST forward        contextRelative %Boolean;      #IMPLIED>
+<!ATTLIST forward        module         %RequestPath;   #IMPLIED>
+<!ATTLIST forward        name           CDATA           #REQUIRED>
+<!ATTLIST forward        path           %RequestPath;   #REQUIRED>
+<!ATTLIST forward        redirect       %Boolean;       #IMPLIED>
+
+
+<!-- The "action-mappings" element describes a set of ActionMapping objects
+     [org.apache.struts.action.ActionMapping] that are available to process
+     requests matching the url-pattern our ActionServlet registered with the
+     container. The individual ActionMappings are configured through nested
+     <action> elements. The following attributes are defined:
+
+     type           Fully qualified Java class to use when instantiating
+                    ActionMapping objects. If specified, the object must be a
+                    subclass of the default class type.
+
+                    WARNING:  For Struts 1.0, this value is ignored.  You
+                    can set the default implementation class name with the
+                    "mapping" initialization parameter to the Struts
+                    controller servlet.
+-->
+<!ELEMENT action-mappings (action*)>
+<!ATTLIST action-mappings id             ID              #IMPLIED>
+<!ATTLIST action-mappings type           %ClassName;     #IMPLIED>
+
+
+<!-- The "action" element describes an ActionMapping object that is to be used
+     to process a request for a specific module-relative URI. The following
+     attributes are defined:
+
+     attribute       Name of the request-scope or session-scope attribute that
+                     is used to access our ActionForm bean, if it is other than
+                     the bean's specified "name". Optional if "name" is specified,
+                     else not valid.
+
+     className       The fully qualified Java class name of the ActionMapping
+                     subclass to use for this action mapping object. Defaults to
+                     the type specified by the enclosing <action-mappings>
+                     element or to "org.apache.struts.action.ActionMapping" if
+                     not specified.
+                     ["org.apache.struts.action.ActionMapping"]
+
+     forward         Module-relative path of the servlet or other resource that
+                     will process this request, instead of the Action class
+                     specified by "type".  The path WILL NOT be processed
+                     through the "forwardPattern" attribute that is configured
+                     on the "controller" element for this module.
+                     Exactly one of "forward", "include", or "type" must be
+                     specified.
+
+     include         Module-relative path of the servlet or other resource that
+                     will process this request, instead of the Action class
+                     specified by "type".  The path WILL NOT be processed
+                     through the "forwardPattern" attribute that is configured
+                     on the "controller" element for this module.
+                     Exactly one of "forward", "include", or "type" must be
+                     specified.
+
+     input           Module-relative path of the action or other resource to
+                     which control should be returned if a validation error is
+                     encountered. Valid only when "name" is specified. Required
+                     if "name" is specified and the input bean returns
+                     validation errors. Optional if "name" is specified and the
+                     input bean does not return validation errors.
+
+     name            Name of the form bean, if any, that is associated with this
+                     action mapping.
+
+     path            The module-relative path of the submitted request, starting
+                     with a "/" character, and without the filename extension if
+                     extension mapping is used.
+
+                     NOTE:  Do *not* include a period in your path name,
+                     because it will look like a filename extension and
+                     cause your Action to not be located.
+
+     parameter       General-purpose configuration parameter that can be used to
+                     pass extra information to the Action object selected by
+                     this action mapping.
+
+     prefix          Prefix used to match request parameter names to ActionForm
+                     property names, if any. Optional if "name" is specified,
+                     else not allowed.
+
+     roles           Comma-delimited list of security role names that are allowed
+                     access to this ActionMapping object. Since Struts 1.1.
+
+     scope           The context ("request" or "session") that is used to
+                     access our ActionForm bean, if any.  Optional if "name" is
+                     specified, else not valid.
+
+     suffix          Suffix used to match request parameter names to ActionForm
+                     bean property names, if any. Optional if "name" is
+                     specified, else not valid.
+
+     type            Fully qualified Java class name of the Action subclass
+                     [org.apache.struts.action.Action] that will process requests
+                     for this action mapping. Not valid if either the "forward"
+                     or "include" attribute is specified.  Exactly one of
+                     "forward", "include", or "type" must be specified.
+
+     unknown         Set to "true" if this object should be configured as the
+                     default action mapping for this module. If a request does not
+                     match another object, it will be passed to the ActionMapping
+                     object with unknown set to "true". Only one ActionMapping
+                     can be marked as "unknown" within a module.
+                     [false]
+
+     validate        Set to "true" if the validate method of the ActionForm bean
+                     should be called prior to calling the Action object for this
+                     action mapping, or set to "false" if you do not want the
+                     validate method called.
+                     [true]
+-->
+<!ELEMENT action (icon?, display-name?, description?, set-property*, exception*, forward*)>
+<!ATTLIST action         id             ID              #IMPLIED>
+<!ATTLIST action         attribute      %BeanName;      #IMPLIED>
+<!ATTLIST action         className      %ClassName;     #IMPLIED>
+<!ATTLIST action         forward        %RequestPath;   #IMPLIED>
+<!ATTLIST action         include        %RequestPath;   #IMPLIED>
+<!ATTLIST action         input          %RequestPath;   #IMPLIED>
+<!ATTLIST action         name           %BeanName;      #IMPLIED>
+<!ATTLIST action         parameter      CDATA           #IMPLIED>
+<!ATTLIST action         path           %RequestPath;   #REQUIRED>
+<!ATTLIST action         prefix         CDATA           #IMPLIED>
+<!ATTLIST action         roles          CDATA           #IMPLIED>
+<!ATTLIST action         scope          %RequestScope;  #IMPLIED>
+<!ATTLIST action         suffix         CDATA           #IMPLIED>
+<!ATTLIST action         type           %ClassName;     #IMPLIED>
+<!ATTLIST action         unknown        %Boolean;       #IMPLIED>
+<!ATTLIST action         validate       %Boolean;       #IMPLIED>
+
+
+<!-- The "controller" element describes the ControllerConfig bean
+     [org.apache.struts.config.ControllerConfig] that encapsulates
+     a module's runtime configuration. The following
+     attributes are defined:
+
+     bufferSize      The size of the input buffer used when processing
+                     file uploads.
+                     [4096]
+
+     className       Fully qualified Java class name of the
+                     ControllerConfig subclass for this controller object.
+                     If specified, the object must be a subclass of the
+                     default class.
+                     ["org.apache.struts.config.ControllerConfig"]
+
+     contentType     Default content type (and optional character encoding) to
+                     be set on each response. May be overridden by the Action,
+                     JSP, or other resource to which the request is forwarded.
+                     ["text/html"]
+
+     forwardPattern  Replacement pattern defining how the "path" attribute of a
+                     <forward> element is mapped to a context-relative URL when
+                     it starts with a slash (and when the contextRelative
+                     property is false). This value may consist of any
+                     combination of the following:
+                     - "$M" - Replaced by the module prefix of this module
+                     - "$P" - Replaced by the "path" attribute of the  selected
+                     "forward" element
+                     - "$$" - Causes a literal dollar sign to be rendered
+                     - "$x" - (Where "x" is any character not defined above)
+                     Silently swallowed, reserved for future use
+                     If not specified, the default forwardPattern is "$M$P",
+                     which is consistent with the previous behavior of
+                     forwards.  Since Struts 1.1.  ["$M$P"]
+
+     inputForward    Set to "true" if you want the "input" attribute of
+                     <action> elements to be the name of a local or global
+                     ActionForward, which will then be used to calculate the
+                     ultimate URL. Set to "false" (the default) to treat the
+                     "input" parameter of <action> elements as a
+                     module-relative path to the resource
+                     to be used as the input form. Since Struts 1.1.
+                     [false]
+
+     locale          Set to "true" if you want a Locale object stored in the
+                     user's session if not already present.
+                     [true]
+
+     maxFileSize     The maximum size (in bytes) of a file to be accepted as a
+                     file upload.  Can be expressed as a number followed by a
+                     "K", "M", or "G", which are interpreted to mean kilobytes,
+                     megabytes, or gigabytes, respectively.
+                     ["250M"]
+
+     memFileSize     The maximum size (in bytes) of a file whose contents will
+                     be retained in memory after uploading. Files larger than
+                     this threshold will be written to some alternative storage
+                     medium, typically a hard disk. Can be expressed as a number
+                     followed by a "K", "M", or "G", which are interpreted to
+                     mean kilobytes, megabytes, or gigabytes, respectively.
+                     ["256K"]
+
+     multipartClass  The fully qualified Java class name of the multipart
+                     request handler class to be used with this module.
+                     ["org.apache.struts.upload.CommonsMultipartRequestHandler"]
+
+     nocache         Set to "true" if you want the controller to add HTTP
+                     headers for defeating caching to every response from
+                     this module.  [false]
+
+     pagePattern     Replacement pattern defining how the "page" attribute of
+                     custom tags using it is mapped to a context-relative URL
+                     of the corresponding resource.  This value may consist of
+                     any combination of the following:
+                     - "$M" - Replaced by the module prefix of this module
+                     - "$P" - Replaced by the value of the "page" attribute
+                     - "$$" - Causes a literal dollar sign to be rendered
+                     - "$x" - (Where "x" is any character not defined above)
+                              Silently swallowed, reserved for future use
+                     If not specified, the default forwardPattern is
+                     "$M$P", which is consistent with previous hard coded
+                     behavior of URL evaluation for "page" attributes.
+                     ["$M$P"]
+
+     processorClass  The fully qualified Java class name of the
+                     RequestProcessor subclass to be used with this module.
+                     ["org.apache.struts.action.RequestProcessor"]
+
+     tempDir         Temporary working directory to use when processing
+                     file uploads.
+                     [{Directory provided by servlet container}]
+-->
+<!ELEMENT controller     (set-property*)>
+<!ATTLIST controller     id             ID              #IMPLIED>
+<!ATTLIST controller     bufferSize     %Integer;       #IMPLIED>
+<!ATTLIST controller     className      %ClassName;     #IMPLIED>
+<!ATTLIST controller     contentType    CDATA           #IMPLIED>
+<!ATTLIST controller     forwardPattern CDATA           #IMPLIED>
+<!ATTLIST controller     inputForward   %Boolean;       #IMPLIED>
+<!ATTLIST controller     locale         %Boolean;       #IMPLIED>
+<!ATTLIST controller     maxFileSize    CDATA           #IMPLIED>
+<!ATTLIST controller     memFileSize    CDATA           #IMPLIED>
+<!ATTLIST controller     multipartClass %ClassName;     #IMPLIED>
+<!ATTLIST controller     nocache        %Boolean;       #IMPLIED>
+<!ATTLIST controller     pagePattern    CDATA           #IMPLIED>
+<!ATTLIST controller     processorClass %ClassName;     #IMPLIED>
+<!ATTLIST controller     tempDir        CDATA           #IMPLIED>
+
+
+<!-- The "message-resources" element describes a MessageResources object with
+     message templates for this module. The following attributes are defined:
+
+     className       The configuration bean for this message resources object.
+                     If specified, the object must be a subclass of the default
+                     configuration bean.
+                     ["org.apache.struts.config.MessageResourcesConfig"]
+
+     factory         Fully qualified Java class name of the
+                     MessageResourcesFactory subclass to use for this message
+                     resources object.
+                     ["org.apache.struts.util.PropertyMessageResourcesFactory"]
+
+     key             Servlet context attribute under which this message
+                     resources bundle will be stored. The default attribute is
+                     the value specified by the string constant at
+                     [Globals.MESSAGES_KEY]. The module prefix (if
+                     any) is appended to the key (${key}${prefix}).
+                     [org.apache.struts.Globals.MESSAGES_KEY]
+
+                     NOTE: The module  prefix includes the leading
+                     slash, so the default message resource bundle for a module
+                     named "foo" is stored under
+                     "org.apache.struts.action.MESSAGE/foo".
+
+     null            Set to "true" if you want our message resources to return a
+                     null string for unknown message keys, or "false" to return a
+                     message with the bad key value.
+
+     parameter       Configuration parameter to be passed to the createResources
+                     method of our factory object.
+-->
+<!ELEMENT message-resources (set-property*)>
+<!ATTLIST message-resources id          ID              #IMPLIED>
+<!ATTLIST message-resources className   %ClassName;     #IMPLIED>
+<!ATTLIST message-resources factory     %ClassName;     #IMPLIED>
+<!ATTLIST message-resources key         %AttributeName; #IMPLIED>
+<!ATTLIST message-resources null        %Boolean;       #IMPLIED>
+<!ATTLIST message-resources parameter   CDATA           #REQUIRED>
+
+
+<!-- The "plug-in" element specifies the fully qualified class name of a
+     general-purpose application plug-in module that receives notification of
+     application startup and shutdown events. An instance of the specified class
+     is created for each element, and can be configured with nested <set-property>
+     elements. The following attributes are supported:
+
+     className       Fully qualified Java class name of the plug-in class; must
+                     implement [org.apache.struts.action.PlugIn].
+-->
+<!ELEMENT plug-in           (set-property*)>
+<!ATTLIST plug-in           id          ID              #IMPLIED>
+<!ATTLIST plug-in           className   %ClassName;     #REQUIRED>
+
+
+<!-- ========== Subordinate Elements ====================================== -->
+
+
+<!-- The "description" element contains descriptive (paragraph length) text
+     about the surrounding element, suitable for use in GUI tools.
+-->
+<!ELEMENT description    (#PCDATA)>
+<!ATTLIST description    id             ID              #IMPLIED>
+
+
+<!-- The "display-name" element contains a short (one line) description of
+     the surrounding element, suitable for use in GUI tools.
+-->
+<!ELEMENT display-name (#PCDATA)>
+<!ATTLIST display-name   id             ID              #IMPLIED>
+
+
+<!-- The "icon" element contains a small-icon and large-icon element which
+     specify the location, relative to the Struts configuration file, for small
+     and large images used to represent the surrounding element in GUI tools.
+-->
+<!ELEMENT icon           (small-icon?, large-icon?)>
+<!ATTLIST icon           id             ID              #IMPLIED>
+
+
+<!-- The "large-icon" element specifies the location, relative to the Struts
+     configuration file, of a resource containing a large (32x32 pixel)
+     icon image.
+-->
+<!ELEMENT large-icon     (%Location;)>
+<!ATTLIST large-icon     id             ID              #IMPLIED>
+
+
+<!-- The "set-property" element specifies the method name and initial value of
+     an additional JavaBean configuration property. When the object representing
+     the surrounding element is instantiated, the accessor for the indicated
+     property is called and passed the indicated value. The "set-property"
+     element is especially useful when a custom subclass is used with
+     <data-source>, <forward>, <action>, or <plug-in> elements. The subclass
+     can be passed whatever other properties may be required to configure the
+     object without changing how the struts-config is parsed.
+
+     property        Name of the JavaBeans property whose setter method
+                     will be called.
+
+     value           String representation of the value to which this
+                     property will be set, after suitable type conversion
+-->
+<!ELEMENT set-property   EMPTY>
+<!ATTLIST set-property   id             ID              #IMPLIED>
+<!ATTLIST set-property   property       %PropName;      #REQUIRED>
+<!ATTLIST set-property   value          CDATA           #REQUIRED>
+
+
+<!-- The "small-icon" element specifies the location, relative to the Struts
+     configuration file, of a resource containing a small (16x16 pixel)
+     icon image.
+-->
+<!ELEMENT small-icon     (%Location;)>
+<!ATTLIST small-icon     id             ID              #IMPLIED>
+
diff --git a/xml/tests/testData/xml/web-app_2_3.dtd b/xml/tests/testData/xml/web-app_2_3.dtd
new file mode 100644
index 0000000..5e3ab01
--- /dev/null
+++ b/xml/tests/testData/xml/web-app_2_3.dtd
@@ -0,0 +1,1063 @@
+<!--
+Copyright (c) 2000 Sun Microsystems, Inc.,
+901 San Antonio Road,
+Palo Alto, California 94303, U.S.A.
+All rights reserved.
+
+Sun Microsystems, Inc. has intellectual property rights relating to
+technology embodied in the product that is described in this document.
+In particular, and without limitation, these intellectual property
+rights may include one or more of the U.S. patents listed at
+http://www.sun.com/patents and one or more additional patents or
+pending patent applications in the U.S. and in other countries.
+
+This document and the product to which it pertains are distributed
+under licenses restricting their use, copying, distribution, and
+decompilation.  This document may be reproduced and distributed but may
+not be changed without prior written authorization of Sun and its
+licensors, if any.
+
+Third-party software, including font technology, is copyrighted and
+licensed from Sun suppliers.
+
+Sun,  Sun Microsystems,  the Sun logo,  Java,  JavaServer Pages,  Java
+Naming and Directory Interface,  JDBC,  JDK,  JavaMail and  and
+Enterprise JavaBeans are trademarks or registered trademarks of Sun
+Microsystems, Inc. in the U.S. and other countries.
+
+Federal Acquisitions: Commercial Software - Government Users Subject to
+Standard License Terms and Conditions.
+
+DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
+CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
+WARRANTY OF MERCHANTABILITY, FITNESS FOR FOR A PARTICULAR PURPOSE OR
+NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH
+DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
+
+
+_________________________________________________________________________
+
+Copyright (c) 2000 Sun Microsystems, Inc.,
+901 San Antonio Road,
+Palo Alto, California 94303, E'tats-Unis.
+Tous droits re'serve's.
+
+Sun Microsystems, Inc. a les droits de proprie'te' intellectuels
+relatants a` la technologie incorpore'e dans le produit qui est de'crit
+dans ce document. En particulier, et sans la limitation, ces droits de
+proprie'te' intellectuels peuvent inclure un ou plus des brevets
+ame'ricains e'nume're's a` http://www.sun.com/patents et un ou les
+brevets plus supple'mentaires ou les applications de brevet en attente
+dans les E'tats-Unis et dans les autres pays.
+
+Ce produit ou document est prote'ge' par un copyright et distribue'
+avec des licences qui en restreignent l'utilisation, la copie, la
+distribution, et la de'compilation.  Ce documention associe n peut
+e^tre reproduite et distribuer, par quelque moyen que ce soit, sans
+l'autorisation pre'alable et e'crite de Sun et de ses bailleurs de
+licence, le cas e'che'ant.
+
+Le logiciel de'tenu par des tiers, et qui comprend la technologie
+relative aux polices de caracte`res, est prote'ge' par un copyright et
+licencie' par des fournisseurs de Sun.
+
+Sun,  Sun Microsystems,  le logo Sun,  Java,  JavaServer Pages,  Java
+Naming and Directory Interface,  JDBC,  JDK,  JavaMail et  and
+Enterprise JavaBeans sont des marques de fabrique ou des marques
+de'pose'es de Sun Microsystems, Inc. aux E'tats-Unis et dans d'autres
+pays.
+
+LA DOCUMENTATION EST FOURNIE "EN L'E'TAT" ET TOUTES AUTRES CONDITIONS,
+DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT
+EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS
+NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A
+L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE
+CONTREFAC,ON.
+-->
+
+<!--
+This is the XML DTD for the Servlet 2.3 deployment descriptor.
+All Servlet 2.3 deployment descriptors must include a DOCTYPE
+of the following form:
+
+  <!DOCTYPE web-app PUBLIC
+	"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+	"http://java.sun.com/dtd/web-app_2_3.dtd">
+
+-->
+
+<!--
+The following conventions apply to all J2EE deployment descriptor
+elements unless indicated otherwise.
+
+- In elements that contain PCDATA, leading and trailing whitespace
+  in the data may be ignored.
+
+- In elements whose value is an "enumerated type", the value is
+  case sensitive.
+
+- In elements that specify a pathname to a file within the same
+  JAR file, relative filenames (i.e., those not starting with "/")
+  are considered relative to the root of the JAR file's namespace.
+  Absolute filenames (i.e., those starting with "/") also specify
+  names in the root of the JAR file's namespace.  In general, relative
+  names are preferred.  The exception is .war files where absolute
+  names are preferred for consistency with the servlet API.
+-->
+
+
+<!--
+The web-app element is the root of the deployment descriptor for
+a web application.
+-->
+<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
+context-param*, filter*, filter-mapping*, listener*, servlet*,
+servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
+error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,
+login-config?, security-role*, env-entry*, ejb-ref*,  ejb-local-ref*)>
+
+<!--
+The auth-constraint element indicates the user roles that should
+be permitted access to this resource collection. The role-name
+used here must either correspond to the role-name of one of the
+security-role elements defined for this web application, or be
+the specially reserved role-name "*" that is a compact syntax for
+indicating all roles in the web application. If both "*" and
+rolenames appear, the container interprets this as all roles.
+If no roles are defined, no user is allowed access to the portion of
+the web application described by the containing security-constraint.
+The container matches role names case sensitively when determining
+access.
+
+
+Used in: security-constraint
+-->
+<!ELEMENT auth-constraint (description?, role-name*)>
+
+<!--
+The auth-method element is used to configure the authentication
+mechanism for the web application. As a prerequisite to gaining access to any web resources which are protected by an authorization
+constraint, a user must have authenticated using the configured
+mechanism. Legal values for this element are "BASIC", "DIGEST",
+"FORM", or "CLIENT-CERT".
+
+Used in: login-config
+-->
+<!ELEMENT auth-method (#PCDATA)>
+
+<!--
+The context-param element contains the declaration of a web
+application's servlet context initialization parameters.
+
+Used in: web-app
+-->
+<!ELEMENT context-param (param-name, param-value, description?)>
+
+<!--
+The description element is used to provide text describing the parent
+element.  The description element should include any information that
+the web application war file producer wants to provide to the consumer of
+the web application war file (i.e., to the Deployer). Typically, the tools
+used by the web application war file consumer will display the description
+when processing the parent element that contains the description.
+
+Used in: auth-constraint, context-param, ejb-local-ref, ejb-ref,
+env-entry, filter, init-param, resource-env-ref, resource-ref, run-as,
+security-role, security-role-ref, servlet, user-data-constraint,
+web-app, web-resource-collection
+-->
+<!ELEMENT description (#PCDATA)>
+
+<!--
+The display-name element contains a short name that is intended to be
+displayed by tools.  The display name need not be unique.
+
+Used in: filter, security-constraint, servlet, web-app
+
+Example:
+
+<display-name>Employee Self Service</display-name>
+-->
+<!ELEMENT display-name (#PCDATA)>
+
+<!--
+The distributable element, by its presence in a web application
+deployment descriptor, indicates that this web application is
+programmed appropriately to be deployed into a distributed servlet
+container
+
+Used in: web-app
+-->
+<!ELEMENT distributable EMPTY>
+
+<!--
+The ejb-link element is used in the ejb-ref or ejb-local-ref
+elements to specify that an EJB reference is linked to an
+enterprise bean.
+
+The name in the ejb-link element is composed of a
+path name specifying the ejb-jar containing the referenced enterprise
+bean with the ejb-name of the target bean appended and separated from
+the path name by "#".  The path name is relative to the war file
+containing the web application that is referencing the enterprise bean.
+This allows multiple enterprise beans with the same ejb-name to be
+uniquely identified.
+
+Used in: ejb-local-ref, ejb-ref
+
+Examples:
+
+	<ejb-link>EmployeeRecord</ejb-link>
+
+	<ejb-link>../products/product.jar#ProductEJB</ejb-link>
+
+-->
+<!ELEMENT ejb-link (#PCDATA)>
+
+<!--
+The ejb-local-ref element is used for the declaration of a reference to
+an enterprise bean's local home. The declaration consists of:
+
+	- an optional description
+	- the EJB reference name used in the code of the web application
+	  that's referencing the enterprise bean
+	- the expected type of the referenced enterprise bean
+	- the expected local home and local interfaces of the referenced
+	  enterprise bean
+	- optional ejb-link information, used to specify the referenced
+	  enterprise bean
+
+Used in: web-app
+-->
+<!ELEMENT ejb-local-ref (description?, ejb-ref-name, ejb-ref-type,
+		local-home, local, ejb-link?)>
+
+<!--
+The ejb-ref element is used for the declaration of a reference to
+an enterprise bean's home. The declaration consists of:
+
+	- an optional description
+	- the EJB reference name used in the code of
+	  the web application that's referencing the enterprise bean
+	- the expected type of the referenced enterprise bean
+	- the expected home and remote interfaces of the referenced
+	  enterprise bean
+	- optional ejb-link information, used to specify the referenced
+	  enterprise bean
+
+Used in: web-app
+-->
+<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type,
+		home, remote, ejb-link?)>
+
+<!--
+The ejb-ref-name element contains the name of an EJB reference. The
+EJB reference is an entry in the web application's environment and is
+relative to the java:comp/env context.  The name must be unique
+within the web application.
+
+It is recommended that name is prefixed with "ejb/".
+
+Used in: ejb-local-ref, ejb-ref
+
+Example:
+
+<ejb-ref-name>ejb/Payroll</ejb-ref-name>
+-->
+<!ELEMENT ejb-ref-name (#PCDATA)>
+
+<!--
+The ejb-ref-type element contains the expected type of the
+referenced enterprise bean.
+
+The ejb-ref-type element must be one of the following:
+
+	<ejb-ref-type>Entity</ejb-ref-type>
+	<ejb-ref-type>Session</ejb-ref-type>
+
+Used in: ejb-local-ref, ejb-ref
+-->
+<!ELEMENT ejb-ref-type (#PCDATA)>
+
+<!--
+The env-entry element contains the declaration of a web application's
+environment entry. The declaration consists of an optional
+description, the name of the environment entry, and an optional
+value.  If a value is not specified, one must be supplied
+during deployment.
+-->
+<!ELEMENT env-entry (description?, env-entry-name, env-entry-value?,
+env-entry-type)>
+
+<!--
+The env-entry-name element contains the name of a web applications's
+environment entry.  The name is a JNDI name relative to the
+java:comp/env context.  The name must be unique within a web application.
+
+Example:
+
+<env-entry-name>minAmount</env-entry-name>
+
+Used in: env-entry
+-->
+<!ELEMENT env-entry-name (#PCDATA)>
+
+<!--
+The env-entry-type element contains the fully-qualified Java type of
+the environment entry value that is expected by the web application's
+code.
+
+The following are the legal values of env-entry-type:
+
+	java.lang.Boolean
+	java.lang.Byte
+	java.lang.Character
+	java.lang.String
+	java.lang.Short
+	java.lang.Integer
+	java.lang.Long
+	java.lang.Float
+	java.lang.Double
+
+Used in: env-entry
+-->
+<!ELEMENT env-entry-type (#PCDATA)>
+
+<!--
+The env-entry-value element contains the value of a web application's
+environment entry. The value must be a String that is valid for the
+constructor of the specified type that takes a single String
+parameter, or for java.lang.Character, a single character.
+
+Example:
+
+<env-entry-value>100.00</env-entry-value>
+
+Used in: env-entry
+-->
+<!ELEMENT env-entry-value (#PCDATA)>
+
+<!--
+The error-code contains an HTTP error code, ex: 404
+
+Used in: error-page
+-->
+<!ELEMENT error-code (#PCDATA)>
+
+<!--
+The error-page element contains a mapping between an error code
+or exception type to the path of a resource in the web application
+
+Used in: web-app
+-->
+<!ELEMENT error-page ((error-code | exception-type), location)>
+
+<!--
+The exception type contains a fully qualified class name of a
+Java exception type.
+
+Used in: error-page
+-->
+<!ELEMENT exception-type (#PCDATA)>
+
+<!--
+The extension element contains a string describing an
+extension. example: "txt"
+
+Used in: mime-mapping
+-->
+<!ELEMENT extension (#PCDATA)>
+
+<!--
+Declares a filter in the web application. The filter is mapped to
+either a servlet or a URL pattern in the filter-mapping element, using
+the filter-name value to reference. Filters can access the
+initialization parameters declared in the deployment descriptor at
+runtime via the FilterConfig interface.
+
+Used in: web-app
+-->
+<!ELEMENT filter (icon?, filter-name, display-name?, description?,
+filter-class, init-param*)>
+
+<!--
+The fully qualified classname of the filter.
+
+Used in: filter
+-->
+<!ELEMENT filter-class (#PCDATA)>
+
+<!--
+Declaration of the filter mappings in this web application. The
+container uses the filter-mapping declarations to decide which filters
+to apply to a request, and in what order. The container matches the
+request URI to a Servlet in the normal way. To determine which filters
+to apply it matches filter-mapping declarations either on servlet-name,
+or on url-pattern for each filter-mapping element, depending on which
+style is used. The order in which filters are invoked is the order in
+which filter-mapping declarations that match a request URI for a
+servlet appear in the list of filter-mapping elements.The filter-name
+value must be the value of the <filter-name> sub-elements of one of the
+<filter> declarations in the deployment descriptor.
+
+Used in: web-app
+-->
+<!ELEMENT filter-mapping (filter-name, (url-pattern | servlet-name))>
+
+<!--
+The logical name of the filter. This name is used to map the filter.
+Each filter name is unique within the web application.
+
+Used in: filter, filter-mapping
+-->
+<!ELEMENT filter-name (#PCDATA)>
+
+<!--
+The form-error-page element defines the location in the web app
+where the error page that is displayed when login is not successful
+can be found. The path begins with a leading / and is interpreted
+relative to the root of the WAR.
+
+Used in: form-login-config
+-->
+<!ELEMENT form-error-page (#PCDATA)>
+
+<!--
+The form-login-config element specifies the login and error pages
+that should be used in form based login. If form based authentication
+is not used, these elements are ignored.
+
+Used in: login-config
+-->
+<!ELEMENT form-login-config (form-login-page, form-error-page)>
+
+<!--
+The form-login-page element defines the location in the web app
+where the page that can be used for login can be found. The path
+begins with a leading / and is interpreted relative to the root of the WAR.
+
+Used in: form-login-config
+-->
+<!ELEMENT form-login-page (#PCDATA)>
+
+<!--
+The home element contains the fully-qualified name of the enterprise
+bean's home interface.
+
+Used in: ejb-ref
+
+Example:
+
+<home>com.aardvark.payroll.PayrollHome</home>
+-->
+<!ELEMENT home (#PCDATA)>
+
+<!--
+The http-method contains an HTTP method (GET | POST |...).
+
+Used in: web-resource-collection
+-->
+<!ELEMENT http-method (#PCDATA)>
+
+<!--
+The icon element contains small-icon and large-icon elements that
+specify the file names for small and a large GIF or JPEG icon images
+used to represent the parent element in a GUI tool.
+
+Used in: filter, servlet, web-app
+-->
+<!ELEMENT icon (small-icon?, large-icon?)>
+
+<!--
+The init-param element contains a name/value pair as an
+initialization param of the servlet
+
+Used in: filter, servlet
+-->
+<!ELEMENT init-param (param-name, param-value, description?)>
+
+<!--
+The jsp-file element contains the full path to a JSP file within
+the web application beginning with a `/'.
+
+Used in: servlet
+-->
+<!ELEMENT jsp-file (#PCDATA)>
+
+<!--
+The large-icon element contains the name of a file
+containing a large (32 x 32) icon image. The file
+name is a relative path within the web application's
+war file.
+
+The image may be either in the JPEG or GIF format.
+The icon can be used by tools.
+
+Used in: icon
+
+Example:
+
+<large-icon>employee-service-icon32x32.jpg</large-icon>
+-->
+<!ELEMENT large-icon (#PCDATA)>
+
+<!--
+The listener element indicates the deployment properties for a web
+application listener bean.
+
+Used in: web-app
+-->
+<!ELEMENT listener (listener-class)>
+
+<!--
+The listener-class element declares a class in the application must be
+registered as a web application listener bean. The value is the fully qualified classname of the listener class.
+
+
+Used in: listener
+-->
+<!ELEMENT listener-class (#PCDATA)>
+
+<!--
+The load-on-startup element indicates that this servlet should be
+loaded (instantiated and have its init() called) on the startup
+of the web application. The optional contents of
+these element must be an integer indicating the order in which
+the servlet should be loaded. If the value is a negative integer,
+or the element is not present, the container is free to load the
+servlet whenever it chooses. If the value is a positive integer
+or 0, the container must load and initialize the servlet as the
+application is deployed. The container must guarantee that
+servlets marked with lower integers are loaded before servlets
+marked with higher integers. The container may choose the order
+of loading of servlets with the same load-on-start-up value.
+
+Used in: servlet
+-->
+<!ELEMENT load-on-startup (#PCDATA)>
+
+<!--
+
+The local element contains the fully-qualified name of the
+enterprise bean's local interface.
+
+Used in: ejb-local-ref
+
+-->
+<!ELEMENT local (#PCDATA)>
+
+<!--
+
+The local-home element contains the fully-qualified name of the
+enterprise bean's local home interface.
+
+Used in: ejb-local-ref
+-->
+<!ELEMENT local-home (#PCDATA)>
+
+<!--
+The location element contains the location of the resource in the web
+application relative to the root of the web application. The value of
+the location must have a leading `/'.
+
+Used in: error-page
+-->
+<!ELEMENT location (#PCDATA)>
+
+<!--
+The login-config element is used to configure the authentication
+method that should be used, the realm name that should be used for
+this application, and the attributes that are needed by the form login
+mechanism.
+
+Used in: web-app
+-->
+<!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)>
+
+<!--
+The mime-mapping element defines a mapping between an extension
+and a mime type.
+
+Used in: web-app
+-->
+<!ELEMENT mime-mapping (extension, mime-type)>
+
+<!--
+The mime-type element contains a defined mime type. example:
+"text/plain"
+
+Used in: mime-mapping
+-->
+<!ELEMENT mime-type (#PCDATA)>
+
+<!--
+The param-name element contains the name of a parameter. Each parameter
+name must be unique in the web application.
+
+
+Used in: context-param, init-param
+-->
+<!ELEMENT param-name (#PCDATA)>
+
+<!--
+The param-value element contains the value of a parameter.
+
+Used in: context-param, init-param
+-->
+<!ELEMENT param-value (#PCDATA)>
+
+<!--
+The realm name element specifies the realm name to use in HTTP
+Basic authorization.
+
+Used in: login-config
+-->
+<!ELEMENT realm-name (#PCDATA)>
+
+<!--
+The remote element contains the fully-qualified name of the enterprise
+bean's remote interface.
+
+Used in: ejb-ref
+
+Example:
+
+<remote>com.wombat.empl.EmployeeService</remote>
+-->
+<!ELEMENT remote (#PCDATA)>
+
+<!--
+The res-auth element specifies whether the web application code signs
+on programmatically to the resource manager, or whether the Container
+will sign on to the resource manager on behalf of the web application. In the
+latter case, the Container uses information that is supplied by the
+Deployer.
+
+The value of this element must be one of the two following:
+
+	<res-auth>Application</res-auth>
+	<res-auth>Container</res-auth>
+
+Used in: resource-ref
+-->
+<!ELEMENT res-auth (#PCDATA)>
+
+<!--
+The res-ref-name element specifies the name of a resource manager
+connection factory reference.  The name is a JNDI name relative to the
+java:comp/env context.  The name must be unique within a web application.
+
+Used in: resource-ref
+-->
+<!ELEMENT res-ref-name (#PCDATA)>
+
+<!--
+The res-sharing-scope element specifies whether connections obtained
+through the given resource manager connection factory reference can be
+shared. The value of this element, if specified, must be one of the
+two following:
+
+	<res-sharing-scope>Shareable</res-sharing-scope>
+	<res-sharing-scope>Unshareable</res-sharing-scope>
+
+The default value is Shareable.
+
+Used in: resource-ref
+-->
+<!ELEMENT res-sharing-scope (#PCDATA)>
+
+<!--
+The res-type element specifies the type of the data source. The type
+is specified by the fully qualified Java language class or interface
+expected to be implemented by the data source.
+
+Used in: resource-ref
+-->
+<!ELEMENT res-type (#PCDATA)>
+
+<!--
+The resource-env-ref element contains a declaration of a web application's
+reference to an administered object associated with a resource
+in the web application's environment.  It consists of an optional
+description, the resource environment reference name, and an
+indication of the resource environment reference type expected by
+the web application code.
+
+Used in: web-app
+
+Example:
+
+<resource-env-ref>
+    <resource-env-ref-name>jms/StockQueue</resource-env-ref-name>
+    <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
+</resource-env-ref>
+-->
+<!ELEMENT resource-env-ref (description?, resource-env-ref-name,
+		resource-env-ref-type)>
+
+<!--
+The resource-env-ref-name element specifies the name of a resource
+environment reference; its value is the environment entry name used in
+the web application code.  The name is a JNDI name relative to the
+java:comp/env context and must be unique within a web application.
+
+Used in: resource-env-ref
+-->
+<!ELEMENT resource-env-ref-name (#PCDATA)>
+
+<!--
+The resource-env-ref-type element specifies the type of a resource
+environment reference.  It is the fully qualified name of a Java
+language class or interface.
+
+Used in: resource-env-ref
+-->
+<!ELEMENT resource-env-ref-type (#PCDATA)>
+
+<!--
+The resource-ref element contains a declaration of a web application's
+reference to an external resource. It consists of an optional
+description, the resource manager connection factory reference name,
+the indication of the resource manager connection factory type
+expected by the web application code, the type of authentication
+(Application or Container), and an optional specification of the
+shareability of connections obtained from the resource (Shareable or
+Unshareable).
+
+Used in: web-app
+
+Example:
+
+    <resource-ref>
+	<res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
+	<res-type>javax.sql.DataSource</res-type>
+	<res-auth>Container</res-auth>
+	<res-sharing-scope>Shareable</res-sharing-scope>
+    </resource-ref>
+-->
+<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth,
+		res-sharing-scope?)>
+
+<!--
+The role-link element is a reference to a defined security role. The
+role-link element must contain the name of one of the security roles
+defined in the security-role elements.
+
+Used in: security-role-ref
+-->
+<!ELEMENT role-link (#PCDATA)>
+
+<!--
+The role-name element contains the name of a security role.
+
+The name must conform to the lexical rules for an NMTOKEN.
+
+Used in: auth-constraint, run-as, security-role, security-role-ref
+-->
+<!ELEMENT role-name (#PCDATA)>
+
+<!--
+The run-as element specifies the run-as identity to be used for the
+execution of the web application. It contains an optional description, and
+the name of a security role.
+
+Used in: servlet
+-->
+<!ELEMENT run-as (description?, role-name)>
+
+<!--
+The security-constraint element is used to associate security
+constraints with one or more web resource collections
+
+Used in: web-app
+-->
+<!ELEMENT security-constraint (display-name?, web-resource-collection+,
+auth-constraint?, user-data-constraint?)>
+
+<!--
+The security-role element contains the definition of a security
+role. The definition consists of an optional description of the
+security role, and the security role name.
+
+Used in: web-app
+
+Example:
+
+    <security-role>
+	<description>
+	    This role includes all employees who are authorized
+	    to access the employee service application.
+	</description>
+	<role-name>employee</role-name>
+    </security-role>
+-->
+<!ELEMENT security-role (description?, role-name)>
+
+<!--
+The security-role-ref element contains the declaration of a security
+role reference in the web application's code. The declaration consists
+of an optional description, the security role name used in the code,
+and an optional link to a security role. If the security role is not
+specified, the Deployer must choose an appropriate security role.
+
+The value of the role-name element must be the String used as the
+parameter to the EJBContext.isCallerInRole(String roleName) method
+or the HttpServletRequest.isUserInRole(String role) method.
+
+Used in: servlet
+
+-->
+<!ELEMENT security-role-ref (description?, role-name, role-link?)>
+
+<!--
+The servlet element contains the declarative data of a
+servlet. If a jsp-file is specified and the load-on-startup element is
+present, then the JSP should be precompiled and loaded.
+
+Used in: web-app
+-->
+<!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
+(servlet-class|jsp-file), init-param*, load-on-startup?, run-as?, security-role-ref*)>
+
+<!--
+The servlet-class element contains the fully qualified class name
+of the servlet.
+
+Used in: servlet
+-->
+<!ELEMENT servlet-class (#PCDATA)>
+
+<!--
+The servlet-mapping element defines a mapping between a servlet
+and a url pattern
+
+Used in: web-app
+-->
+<!ELEMENT servlet-mapping (servlet-name, url-pattern)>
+
+<!--
+The servlet-name element contains the canonical name of the
+servlet. Each servlet name is unique within the web application.
+
+Used in: filter-mapping, servlet, servlet-mapping
+-->
+<!ELEMENT servlet-name (#PCDATA)>
+
+<!--
+The session-config element defines the session parameters for
+this web application.
+
+Used in: web-app
+-->
+<!ELEMENT session-config (session-timeout?)>
+
+<!--
+The session-timeout element defines the default session timeout
+interval for all sessions created in this web application. The
+specified timeout must be expressed in a whole number of minutes.
+If the timeout is 0 or less, the container ensures the default
+behaviour of sessions is never to time out.
+
+Used in: session-config
+-->
+<!ELEMENT session-timeout (#PCDATA)>
+
+<!--
+The small-icon element contains the name of a file
+containing a small (16 x 16) icon image. The file
+name is a relative path within the web application's
+war file.
+
+The image may be either in the JPEG or GIF format.
+The icon can be used by tools.
+
+Used in: icon
+
+Example:
+
+<small-icon>employee-service-icon16x16.jpg</small-icon>
+-->
+<!ELEMENT small-icon (#PCDATA)>
+
+<!--
+The taglib element is used to describe a JSP tag library.
+
+Used in: web-app
+-->
+<!ELEMENT taglib (taglib-uri, taglib-location)>
+
+<!--
+the taglib-location element contains the location (as a resource
+relative to the root of the web application) where to find the Tag
+Libary Description file for the tag library.
+
+Used in: taglib
+-->
+<!ELEMENT taglib-location (#PCDATA)>
+
+<!--
+The taglib-uri element describes a URI, relative to the location
+of the web.xml document, identifying a Tag Library used in the Web
+Application.
+
+Used in: taglib
+-->
+<!ELEMENT taglib-uri (#PCDATA)>
+
+<!--
+The transport-guarantee element specifies that the communication
+between client and server should be NONE, INTEGRAL, or
+CONFIDENTIAL. NONE means that the application does not require any
+transport guarantees. A value of INTEGRAL means that the application
+requires that the data sent between the client and server be sent in
+such a way that it can't be changed in transit. CONFIDENTIAL means
+that the application requires that the data be transmitted in a
+fashion that prevents other entities from observing the contents of
+the transmission. In most cases, the presence of the INTEGRAL or
+CONFIDENTIAL flag will indicate that the use of SSL is required.
+
+Used in: user-data-constraint
+-->
+<!ELEMENT transport-guarantee (#PCDATA)>
+
+<!--
+The url-pattern element contains the url pattern of the mapping. Must
+follow the rules specified in Section 11.2 of the Servlet API
+Specification.
+
+Used in: filter-mapping, servlet-mapping, web-resource-collection
+-->
+<!ELEMENT url-pattern (#PCDATA)>
+
+<!--
+The user-data-constraint element is used to indicate how data
+communicated between the client and container should be protected.
+
+Used in: security-constraint
+-->
+<!ELEMENT user-data-constraint (description?, transport-guarantee)>
+
+<!--
+The web-resource-collection element is used to identify a subset
+of the resources and HTTP methods on those resources within a web
+application to which a security constraint applies. If no HTTP methods
+are specified, then the security constraint applies to all HTTP
+methods.
+
+Used in: security-constraint
+-->
+<!ELEMENT web-resource-collection (web-resource-name, description?,
+url-pattern*, http-method*)>
+
+<!--
+The web-resource-name contains the name of this web resource
+collection.
+
+Used in: web-resource-collection
+-->
+<!ELEMENT web-resource-name (#PCDATA)>
+
+<!--
+The welcome-file element contains file name to use as a default
+welcome file, such as index.html
+
+Used in: welcome-file-list
+-->
+<!ELEMENT welcome-file (#PCDATA)>
+
+<!--
+The welcome-file-list contains an ordered list of welcome files
+elements.
+
+Used in: web-app
+-->
+<!ELEMENT welcome-file-list (welcome-file+)>
+
+<!--
+The ID mechanism is to allow tools that produce additional deployment
+information (i.e., information beyond the standard deployment
+descriptor information) to store the non-standard information in a
+separate file, and easily refer from these tool-specific files to the
+information in the standard deployment descriptor.
+
+Tools are not allowed to add the non-standard information into the
+standard deployment descriptor.
+-->
+
+<!ATTLIST auth-constraint id ID #IMPLIED>
+<!ATTLIST auth-method id ID #IMPLIED>
+<!ATTLIST context-param id ID #IMPLIED>
+<!ATTLIST description id ID #IMPLIED>
+<!ATTLIST display-name id ID #IMPLIED>
+<!ATTLIST distributable id ID #IMPLIED>
+<!ATTLIST ejb-link id ID #IMPLIED>
+<!ATTLIST ejb-local-ref id ID #IMPLIED>
+<!ATTLIST ejb-ref id ID #IMPLIED>
+<!ATTLIST ejb-ref-name id ID #IMPLIED>
+<!ATTLIST ejb-ref-type id ID #IMPLIED>
+<!ATTLIST env-entry id ID #IMPLIED>
+<!ATTLIST env-entry-name id ID #IMPLIED>
+<!ATTLIST env-entry-type id ID #IMPLIED>
+<!ATTLIST env-entry-value id ID #IMPLIED>
+<!ATTLIST error-code id ID #IMPLIED>
+<!ATTLIST error-page id ID #IMPLIED>
+<!ATTLIST exception-type id ID #IMPLIED>
+<!ATTLIST extension id ID #IMPLIED>
+<!ATTLIST filter id ID #IMPLIED>
+<!ATTLIST filter-class id ID #IMPLIED>
+<!ATTLIST filter-mapping id ID #IMPLIED>
+<!ATTLIST filter-name id ID #IMPLIED>
+<!ATTLIST form-error-page id ID #IMPLIED>
+<!ATTLIST form-login-config id ID #IMPLIED>
+<!ATTLIST form-login-page id ID #IMPLIED>
+<!ATTLIST home id ID #IMPLIED>
+<!ATTLIST http-method id ID #IMPLIED>
+<!ATTLIST icon id ID #IMPLIED>
+<!ATTLIST init-param id ID #IMPLIED>
+<!ATTLIST jsp-file id ID #IMPLIED>
+<!ATTLIST large-icon id ID #IMPLIED>
+<!ATTLIST listener id ID #IMPLIED>
+<!ATTLIST listener-class id ID #IMPLIED>
+<!ATTLIST load-on-startup id ID #IMPLIED>
+<!ATTLIST local id ID #IMPLIED>
+<!ATTLIST local-home id ID #IMPLIED>
+<!ATTLIST location id ID #IMPLIED>
+<!ATTLIST login-config id ID #IMPLIED>
+<!ATTLIST mime-mapping id ID #IMPLIED>
+<!ATTLIST mime-type id ID #IMPLIED>
+<!ATTLIST param-name id ID #IMPLIED>
+<!ATTLIST param-value id ID #IMPLIED>
+<!ATTLIST realm-name id ID #IMPLIED>
+<!ATTLIST remote id ID #IMPLIED>
+<!ATTLIST res-auth id ID #IMPLIED>
+<!ATTLIST res-ref-name id ID #IMPLIED>
+<!ATTLIST res-sharing-scope id ID #IMPLIED>
+<!ATTLIST res-type id ID #IMPLIED>
+<!ATTLIST resource-env-ref id ID #IMPLIED>
+<!ATTLIST resource-env-ref-name id ID #IMPLIED>
+<!ATTLIST resource-env-ref-type id ID #IMPLIED>
+<!ATTLIST resource-ref id ID #IMPLIED>
+<!ATTLIST role-link id ID #IMPLIED>
+<!ATTLIST role-name id ID #IMPLIED>
+<!ATTLIST run-as id ID #IMPLIED>
+<!ATTLIST security-constraint id ID #IMPLIED>
+<!ATTLIST security-role id ID #IMPLIED>
+<!ATTLIST security-role-ref id ID #IMPLIED>
+<!ATTLIST servlet id ID #IMPLIED>
+<!ATTLIST servlet-class id ID #IMPLIED>
+<!ATTLIST servlet-mapping id ID #IMPLIED>
+<!ATTLIST servlet-name id ID #IMPLIED>
+<!ATTLIST session-config id ID #IMPLIED>
+<!ATTLIST session-timeout id ID #IMPLIED>
+<!ATTLIST small-icon id ID #IMPLIED>
+<!ATTLIST taglib id ID #IMPLIED>
+<!ATTLIST taglib-location id ID #IMPLIED>
+<!ATTLIST taglib-uri id ID #IMPLIED>
+<!ATTLIST transport-guarantee id ID #IMPLIED>
+<!ATTLIST url-pattern id ID #IMPLIED>
+<!ATTLIST user-data-constraint id ID #IMPLIED>
+<!ATTLIST web-app id ID #IMPLIED>
+<!ATTLIST web-resource-collection id ID #IMPLIED>
+<!ATTLIST web-resource-name id ID #IMPLIED>
+<!ATTLIST welcome-file id ID #IMPLIED>
+<!ATTLIST welcome-file-list id ID #IMPLIED>
diff --git a/xml/tests/testData/xml/web-app_2_4.xsd b/xml/tests/testData/xml/web-app_2_4.xsd
new file mode 100644
index 0000000..9e4f58dc
--- /dev/null
+++ b/xml/tests/testData/xml/web-app_2_4.xsd
@@ -0,0 +1,1242 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+	    targetNamespace="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	    elementFormDefault="qualified"
+	    attributeFormDefault="unqualified"
+	    version="2.4">
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)web-app_2_4.xsds	1.61 04/04/16
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+      Copyright 2003-2007 Sun Microsystems, Inc. All rights reserved.
+
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+
+      Contributor(s):
+
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[
+
+	This is the XML Schema for the Servlet 2.4 deployment descriptor.
+	The deployment descriptor must be named "WEB-INF/web.xml" in the
+	web application's war file.  All Servlet deployment descriptors
+	must indicate the web application schema by using the J2EE
+	namespace:
+
+	http://java.sun.com/xml/ns/j2ee
+
+	and by indicating the version of the schema by
+	using the version element as shown below:
+
+	    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	      xsi:schemaLocation="..."
+	      version="2.4">
+	      ...
+	    </web-app>
+
+	The instance documents may indicate the published version of
+	the schema using the xsi:schemaLocation attribute for J2EE
+	namespace with the following location:
+
+	http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
+
+	]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all J2EE
+      deployment descriptor elements unless indicated otherwise.
+
+      - In elements that specify a pathname to a file within the
+	same JAR file, relative filenames (i.e., those not
+	starting with "/") are considered relative to the root of
+	the JAR file's namespace.  Absolute filenames (i.e., those
+	starting with "/") also specify names in the root of the
+	JAR file's namespace.  In general, relative names are
+	preferred.  The exception is .war files where absolute
+	names are preferred for consistency with the Servlet API.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="j2ee_1_4.xsd"/>
+  <xsd:include schemaLocation="jsp_2_0.xsd"/>
+
+
+<!-- **************************************************** -->
+
+
+  <xsd:element name="web-app" type="j2ee:web-appType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The web-app element is the root of the deployment
+	descriptor for a web application.  Note that the sub-elements
+	of this element can be in the arbitrary order. Because of
+	that, the multiplicity of the elements of distributable,
+	session-config, welcome-file-list, jsp-config, login-config,
+	and locale-encoding-mapping-list was changed from "?" to "*"
+	in this schema.  However, the deployment descriptor instance
+	file must not contain multiple elements of session-config,
+	jsp-config, and login-config. When there are multiple elements of
+	welcome-file-list or locale-encoding-mapping-list, the container
+	must concatinate the element contents.  The multiple occurance
+	of the element distributable is redundant and the container
+	treats that case exactly in the same way when there is only
+	one distributable.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:unique name="web-app-servlet-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The servlet element contains the name of a servlet.
+	  The name must be unique within the web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:servlet"/>
+      <xsd:field    xpath="j2ee:servlet-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-filter-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The filter element contains the name of a filter.
+	  The name must be unique within the web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:filter"/>
+      <xsd:field    xpath="j2ee:filter-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-ejb-local-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The ejb-local-ref-name element contains the name of an EJB
+	  reference. The EJB reference is an entry in the web
+	  application's environment and is relative to the
+	  java:comp/env context.  The name must be unique within
+	  the web application.
+
+	  It is recommended that name is prefixed with "ejb/".
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:ejb-local-ref"/>
+      <xsd:field    xpath="j2ee:ejb-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-ejb-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The ejb-ref-name element contains the name of an EJB
+	  reference. The EJB reference is an entry in the web
+	  application's environment and is relative to the
+	  java:comp/env context.  The name must be unique within
+	  the web application.
+
+	  It is recommended that name is prefixed with "ejb/".
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:ejb-ref"/>
+      <xsd:field    xpath="j2ee:ejb-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-resource-env-ref-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The resource-env-ref-name element specifies the name of
+	  a resource environment reference; its value is the
+	  environment entry name used in the web application code.
+	  The name is a JNDI name relative to the java:comp/env
+	  context and must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:resource-env-ref"/>
+      <xsd:field    xpath="j2ee:resource-env-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-message-destination-ref-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The message-destination-ref-name element specifies the name of
+	  a message destination reference; its value is the
+	  environment entry name used in the web application code.
+	  The name is a JNDI name relative to the java:comp/env
+	  context and must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:message-destination-ref"/>
+      <xsd:field    xpath="j2ee:message-destination-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-res-ref-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The res-ref-name element specifies the name of a
+	  resource manager connection factory reference.  The name
+	  is a JNDI name relative to the java:comp/env context.
+	  The name must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:resource-ref"/>
+      <xsd:field    xpath="j2ee:res-ref-name"/>
+    </xsd:unique>
+
+    <xsd:unique name="web-app-env-entry-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The env-entry-name element contains the name of a web
+	  application's environment entry.  The name is a JNDI
+	  name relative to the java:comp/env context.  The name
+	  must be unique within a web application.
+
+	</xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:selector xpath="j2ee:env-entry"/>
+      <xsd:field    xpath="j2ee:env-entry-name"/>
+    </xsd:unique>
+
+    <xsd:key name="web-app-role-name-key">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  A role-name-key is specified to allow the references
+	  from the security-role-refs.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:security-role"/>
+      <xsd:field    xpath="j2ee:role-name"/>
+    </xsd:key>
+
+    <xsd:keyref name="web-app-role-name-references"
+		refer="j2ee:web-app-role-name-key">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The keyref indicates the references from
+	  security-role-ref to a specified role-name.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:servlet/j2ee:security-role-ref"/>
+      <xsd:field    xpath="j2ee:role-link"/>
+    </xsd:keyref>
+  </xsd:element>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="auth-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The auth-constraintType indicates the user roles that
+	should be permitted access to this resource
+	collection. The role-name used here must either correspond
+	to the role-name of one of the security-role elements
+	defined for this web application, or be the specially
+	reserved role-name "*" that is a compact syntax for
+	indicating all roles in the web application. If both "*"
+	and rolenames appear, the container interprets this as all
+	roles.  If no roles are defined, no user is allowed access
+	to the portion of the web application described by the
+	containing security-constraint.  The container matches
+	role names case sensitively when determining access.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="j2ee:descriptionType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+		   type="j2ee:role-nameType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="auth-methodType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The auth-methodType is used to configure the authentication
+	mechanism for the web application. As a prerequisite to
+	gaining access to any web resources which are protected by
+	an authorization constraint, a user must have authenticated
+	using the configured mechanism. Legal values are "BASIC",
+	"DIGEST", "FORM", "CLIENT-CERT", or a vendor-specific
+	authentication scheme.
+
+	Used in: login-config
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="dispatcherType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The dispatcher has four legal values: FORWARD, REQUEST, INCLUDE,
+	and ERROR. A value of FORWARD means the Filter will be applied
+	under RequestDispatcher.forward() calls.  A value of REQUEST
+	means the Filter will be applied under ordinary client calls to
+	the path or servlet. A value of INCLUDE means the Filter will be
+	applied under RequestDispatcher.include() calls.  A value of
+	ERROR means the Filter will be applied under the error page
+	mechanism.  The absence of any dispatcher elements in a
+	filter-mapping indicates a default of applying filters only under
+	ordinary client calls to the path or servlet.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:enumeration value="FORWARD"/>
+	<xsd:enumeration value="INCLUDE"/>
+	<xsd:enumeration value="REQUEST"/>
+	<xsd:enumeration value="ERROR"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="encodingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The encodingType defines IANA character sets.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="[^\s]+"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="error-codeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The error-code contains an HTTP error code, ex: 404
+
+	Used in: error-page
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:xsdPositiveIntegerType">
+	<xsd:pattern value="\d{3}"/>
+	<xsd:attribute name="id" type="xsd:ID"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="error-pageType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The error-pageType contains a mapping between an error code
+	or exception type to the path of a resource in the web
+	application.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:choice>
+	<xsd:element name="error-code"
+		     type="j2ee:error-codeType"/>
+
+	<xsd:element name="exception-type"
+		     type="j2ee:fully-qualified-classType">
+	  <xsd:annotation>
+	    <xsd:documentation>
+
+	      The exception-type contains a fully qualified class
+	      name of a Java exception type.
+
+	    </xsd:documentation>
+	  </xsd:annotation>
+	</xsd:element>
+      </xsd:choice>
+
+      <xsd:element name="location"
+		   type="j2ee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The location element contains the location of the
+	    resource in the web application relative to the root of
+	    the web application. The value of the location must have
+	    a leading `/'.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filter-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	Declaration of the filter mappings in this web
+	application is done by using filter-mappingType.
+	The container uses the filter-mapping
+	declarations to decide which filters to apply to a request,
+	and in what order. The container matches the request URI to
+	a Servlet in the normal way. To determine which filters to
+	apply it matches filter-mapping declarations either on
+	servlet-name, or on url-pattern for each filter-mapping
+	element, depending on which style is used. The order in
+	which filters are invoked is the order in which
+	filter-mapping declarations that match a request URI for a
+	servlet appear in the list of filter-mapping elements.The
+	filter-name value must be the value of the filter-name
+	sub-elements of one of the filter declarations in the
+	deployment descriptor.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="filter-name"
+		   type="j2ee:filter-nameType"/>
+      <xsd:choice>
+	<xsd:element name="url-pattern"
+		     type="j2ee:url-patternType"/>
+	<xsd:element name="servlet-name"
+		     type="j2ee:servlet-nameType"/>
+      </xsd:choice>
+      <xsd:element name="dispatcher"
+		   type="j2ee:dispatcherType"
+		   minOccurs="0" maxOccurs="4"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filter-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The logical name of the filter is declare
+	by using filter-nameType. This name is used to map the
+	filter.  Each filter name is unique within the web
+	application.
+
+	Used in: filter, filter-mapping
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:extension base="j2ee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filterType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The filterType is used to declare a filter in the web
+	application. The filter is mapped to either a servlet or a
+	URL pattern in the filter-mapping element, using the
+	filter-name value to reference. Filters can access the
+	initialization parameters declared in the deployment
+	descriptor at runtime via the FilterConfig interface.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="j2ee:descriptionGroup"/>
+      <xsd:element name="filter-name"
+		   type="j2ee:filter-nameType"/>
+      <xsd:element name="filter-class"
+		   type="j2ee:fully-qualified-classType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The fully qualified classname of the filter.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="init-param"
+		   type="j2ee:param-valueType"
+		   minOccurs="0" maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The init-param element contains a name/value pair as
+	    an initialization param of a servlet filter
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="form-login-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The form-login-configType specifies the login and error
+	pages that should be used in form based login. If form based
+	authentication is not used, these elements are ignored.
+
+	Used in: login-config
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+
+      <xsd:element name="form-login-page"
+		   type="j2ee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The form-login-page element defines the location in the web
+	    app where the page that can be used for login can be
+	    found.  The path begins with a leading / and is interpreted
+	    relative to the root of the WAR.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="form-error-page"
+		   type="j2ee:war-pathType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The form-error-page element defines the location in
+	    the web app where the error page that is displayed
+	    when login is not successful can be found.
+	    The path begins with a leading / and is interpreted
+	    relative to the root of the WAR.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="http-methodType">
+    <xsd:annotation>
+
+      <xsd:documentation>
+
+	The http-method contains an HTTP method recognized by the
+	web-app, for example GET, POST, ...
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:enumeration value="GET"/>
+	<xsd:enumeration value="POST"/>
+	<xsd:enumeration value="PUT"/>
+	<xsd:enumeration value="DELETE"/>
+	<xsd:enumeration value="HEAD"/>
+	<xsd:enumeration value="OPTIONS"/>
+	<xsd:enumeration value="TRACE"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="locale-encoding-mapping-listType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The locale-encoding-mapping-list contains one or more
+	locale-encoding-mapping(s).
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="locale-encoding-mapping"
+		   type="j2ee:locale-encoding-mappingType"
+		   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="locale-encoding-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The locale-encoding-mapping contains locale name and
+	encoding name. The locale name must be either "Language-code",
+	such as "ja", defined by ISO-639 or "Language-code_Country-code",
+	such as "ja_JP".  "Country code" is defined by ISO-3166.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="locale"
+		   type="j2ee:localeType"/>
+      <xsd:element name="encoding"
+		   type="j2ee:encodingType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="localeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The localeType defines valid locale defined by ISO-639-1
+	and ISO-3166.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="[a-z]{2}(_|-)?([\p{L}\-\p{Nd}]{2})?"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="login-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The login-configType is used to configure the authentication
+	method that should be used, the realm name that should be
+	used for this application, and the attributes that are
+	needed by the form login mechanism.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="auth-method"
+		   type="j2ee:auth-methodType"
+		   minOccurs="0"/>
+      <xsd:element name="realm-name"
+		   type="j2ee:string" minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The realm name element specifies the realm name to
+	    use in HTTP Basic authorization.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="form-login-config"
+		   type="j2ee:form-login-configType"
+		   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mime-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The mime-mappingType defines a mapping between an extension
+	and a mime type.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The extension element contains a string describing an
+	  extension. example: "txt"
+
+	</xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:element name="extension"
+		   type="j2ee:string"/>
+      <xsd:element name="mime-type"
+		   type="j2ee:mime-typeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mime-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The mime-typeType is used to indicate a defined mime type.
+
+	Example:
+	"text/plain"
+
+	Used in: mime-mapping
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:pattern value="[^\p{Cc}^\s]+/[^\p{Cc}^\s]+"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="nonEmptyStringType">
+    <xsd:annotation>
+      <xsd:documentation>
+	This type defines a string which contains at least one
+	character.
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:minLength value="1"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The security-constraintType is used to associate
+	security constraints with one or more web resource
+	collections
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="display-name"
+		   type="j2ee:display-nameType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="web-resource-collection"
+		   type="j2ee:web-resource-collectionType"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="auth-constraint"
+		   type="j2ee:auth-constraintType"
+		   minOccurs="0"/>
+      <xsd:element name="user-data-constraint"
+		   type="j2ee:user-data-constraintType"
+		   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servlet-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servlet-mappingType defines a mapping between a
+	servlet and a url pattern.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="servlet-name"
+		   type="j2ee:servlet-nameType"/>
+      <xsd:element name="url-pattern"
+		   type="j2ee:url-patternType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servlet-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servlet-name element contains the canonical name of the
+	servlet. Each servlet name is unique within the web
+	application.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:extension base="j2ee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servletType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The servletType is used to declare a servlet.
+	It contains the declarative data of a
+	servlet. If a jsp-file is specified and the load-on-startup
+	element is present, then the JSP should be precompiled and
+	loaded.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="j2ee:descriptionGroup"/>
+      <xsd:element name="servlet-name"
+		   type="j2ee:servlet-nameType"/>
+      <xsd:choice>
+	<xsd:element name="servlet-class"
+		     type="j2ee:fully-qualified-classType">
+	  <xsd:annotation>
+	    <xsd:documentation>
+
+	      The servlet-class element contains the fully
+	      qualified class name of the servlet.
+
+	    </xsd:documentation>
+	  </xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="jsp-file"
+		     type="j2ee:jsp-fileType"/>
+
+      </xsd:choice>
+
+      <xsd:element name="init-param"
+		   type="j2ee:param-valueType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="load-on-startup"
+		   type="j2ee:xsdIntegerType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The load-on-startup element indicates that this
+	    servlet should be loaded (instantiated and have
+	    its init() called) on the startup of the web
+	    application. The optional contents of these
+	    element must be an integer indicating the order in
+	    which the servlet should be loaded. If the value
+	    is a negative integer, or the element is not
+	    present, the container is free to load the servlet
+	    whenever it chooses. If the value is a positive
+	    integer or 0, the container must load and
+	    initialize the servlet as the application is
+	    deployed. The container must guarantee that
+	    servlets marked with lower integers are loaded
+	    before servlets marked with higher integers. The
+	    container may choose the order of loading of
+	    servlets with the same load-on-start-up value.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="run-as"
+		   type="j2ee:run-asType"
+		   minOccurs="0"/>
+      <xsd:element name="security-role-ref"
+		   type="j2ee:security-role-refType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="session-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The session-configType defines the session parameters
+	for this web application.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="session-timeout"
+		   type="j2ee:xsdIntegerType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The session-timeout element defines the default
+	    session timeout interval for all sessions created
+	    in this web application. The specified timeout
+	    must be expressed in a whole number of minutes.
+	    If the timeout is 0 or less, the container ensures
+	    the default behaviour of sessions is never to time
+	    out. If this element is not specified, the container
+	    must set its default timeout period.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="transport-guaranteeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The transport-guaranteeType specifies that the communication
+	between client and server should be NONE, INTEGRAL, or
+	CONFIDENTIAL. NONE means that the application does not
+	require any transport guarantees. A value of INTEGRAL means
+	that the application requires that the data sent between the
+	client and server be sent in such a way that it can't be
+	changed in transit. CONFIDENTIAL means that the application
+	requires that the data be transmitted in a fashion that
+	prevents other entities from observing the contents of the
+	transmission. In most cases, the presence of the INTEGRAL or
+	CONFIDENTIAL flag will indicate that the use of SSL is
+	required.
+
+	Used in: user-data-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:enumeration value="NONE"/>
+	<xsd:enumeration value="INTEGRAL"/>
+	<xsd:enumeration value="CONFIDENTIAL"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="user-data-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The user-data-constraintType is used to indicate how
+	data communicated between the client and container should be
+	protected.
+
+	Used in: security-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="j2ee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="transport-guarantee"
+		   type="j2ee:transport-guaranteeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="war-pathType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The elements that use this type designate a path starting
+	with a "/" and interpreted relative to the root of a WAR
+	file.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:pattern value="/.*"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="web-app-versionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type contains the recognized versions of
+	web-application supported. It is used to designate the
+	version of the web application.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="2.4"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="web-appType">
+
+    <xsd:choice minOccurs="0" maxOccurs="unbounded">
+      <xsd:group ref="j2ee:descriptionGroup"/>
+      <xsd:element name="distributable"
+		   type="j2ee:emptyType"/>
+      <xsd:element name="context-param"
+		   type="j2ee:param-valueType">
+
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The context-param element contains the declaration
+	    of a web application's servlet context
+	    initialization parameters.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:element name="filter"
+		   type="j2ee:filterType"/>
+      <xsd:element name="filter-mapping"
+		   type="j2ee:filter-mappingType"/>
+      <xsd:element name="listener"
+		   type="j2ee:listenerType"/>
+      <xsd:element name="servlet"
+		   type="j2ee:servletType"/>
+      <xsd:element name="servlet-mapping"
+		   type="j2ee:servlet-mappingType"/>
+      <xsd:element name="session-config"
+		   type="j2ee:session-configType"/>
+      <xsd:element name="mime-mapping"
+		   type="j2ee:mime-mappingType"/>
+      <xsd:element name="welcome-file-list"
+		   type="j2ee:welcome-file-listType"/>
+      <xsd:element name="error-page"
+		   type="j2ee:error-pageType"/>
+      <xsd:element name="jsp-config"
+		   type="j2ee:jsp-configType"/>
+      <xsd:element name="security-constraint"
+		   type="j2ee:security-constraintType"/>
+      <xsd:element name="login-config"
+		   type="j2ee:login-configType"/>
+      <xsd:element name="security-role"
+		   type="j2ee:security-roleType"/>
+      <xsd:group ref="j2ee:jndiEnvironmentRefsGroup"/>
+      <xsd:element name="message-destination"
+		   type="j2ee:message-destinationType"/>
+      <xsd:element name="locale-encoding-mapping-list"
+		   type="j2ee:locale-encoding-mapping-listType"/>
+    </xsd:choice>
+
+    <xsd:attribute name="version"
+		   type="j2ee:web-app-versionType"
+		   use="required"/>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="web-resource-collectionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The web-resource-collectionType is used to identify a subset
+	of the resources and HTTP methods on those resources within
+	a web application to which a security constraint applies. If
+	no HTTP methods are specified, then the security constraint
+	applies to all HTTP methods.
+
+	Used in: security-constraint
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="web-resource-name"
+		   type="j2ee:string">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The web-resource-name contains the name of this web
+	    resource collection.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="description"
+		   type="j2ee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="url-pattern"
+		   type="j2ee:url-patternType"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="http-method"
+		   type="j2ee:http-methodType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="welcome-file-listType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The welcome-file-list contains an ordered list of welcome
+	files elements.
+
+	Used in: web-app
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="welcome-file"
+		   type="xsd:string"
+		   maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The welcome-file element contains file name to use
+	    as a default welcome file, such as index.html
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+</xsd:schema>
+
diff --git a/xml/tests/testData/xml/web-jsptaglibrary_1_2.dtd b/xml/tests/testData/xml/web-jsptaglibrary_1_2.dtd
new file mode 100644
index 0000000..369f41e
--- /dev/null
+++ b/xml/tests/testData/xml/web-jsptaglibrary_1_2.dtd
@@ -0,0 +1,462 @@
+<!--
+
+   This is the DTD defining the JavaServer Pages 1.2 Tag Library
+   descriptor (.tld) (XML) file format/syntax.
+
+   A Tag Library is a JAR file containing a valid instance of a Tag Library
+   Descriptor (taglib.tld) file in the META-INF subdirectory, along with the
+   appropriate implementing classes, and other resources required to
+   implement the tags defined therein.
+
+   Use is subject to license terms.
+  -->
+
+<!NOTATION WEB-JSPTAGLIB.1_2 PUBLIC
+          "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN">
+
+<!--
+This is the XML DTD for the JSP 1.2 Tag Library Descriptor.
+All JSP 1.2 tag library descriptors must include a DOCTYPE
+of the following form:
+
+  <!DOCTYPE taglib
+        PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
+	"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+
+-->
+
+<!--
+The taglib tag is the document root, it defines:
+
+tlib-version	the version of the tag library implementation
+
+jsp-version	the version of JSP the tag library depends upon
+
+short-name	a simple default short name that could be used by
+		a JSP authoring tool to create names with a mnemonic
+		value; for example, the it may be used as the prefered
+		prefix value in taglib directives
+
+uri		a uri uniquely identifying this taglib
+
+display-name    the display-name element contains a short name that
+                is intended to be displayed by tools
+small-icon      optional small-icon that can be used by tools
+
+large-icon      optional large-icon that can be used by tools
+
+description	a simple string describing the "use" of this taglib,
+		should be user discernable
+
+validator       optional TagLibraryValidator information
+
+listener        optional event listener specification
+
+
+-->
+
+<!ELEMENT taglib (tlib-version, jsp-version, short-name, uri?,
+                  display-name?, small-icon?, large-icon?, description?,
+                  validator?, listener*, tag+) >
+
+<!ATTLIST taglib id ID #IMPLIED
+	  xmlns CDATA #FIXED
+		"http://java.sun.com/JSP/TagLibraryDescriptor"
+>
+
+<!--
+Describes this version (number) of the taglibrary (dewey decimal)
+
+#PCDATA ::= [0-9]*{ "."[0-9] }0..3
+-->
+
+<!ELEMENT tlib-version (#PCDATA) >
+
+<!--
+Describes the JSP version (number) this taglibrary requires in
+order to function (dewey decimal)
+
+The default is 1.2
+
+#PCDATA ::= [0-9]*{ "."[0-9] }0..3
+-->
+
+<!ELEMENT jsp-version  (#PCDATA) >
+
+<!--
+Defines a short (default) short-name to be used for tags and
+variable names used/created by this tag library.  Do not use
+white space, and do not start with digits or underscore.
+
+#PCDATA ::= NMTOKEN
+-->
+
+<!ELEMENT short-name      (#PCDATA) >
+
+<!--
+Defines a public URI that uniquely identifies this version of
+the taglibrary.  Leave it empty if it does not apply.
+-->
+
+<!ELEMENT uri	 (#PCDATA) >
+
+<!--
+Defines an arbitrary text string descirbing the tag library
+-->
+
+<!ELEMENT description	(#PCDATA) >
+
+<!--
+
+Defines an optional validator that can be used to
+validate the conformance of a JSP page to using this tag library.
+-->
+
+<!ELEMENT validator (validator-class, init-param*, description?) >
+
+
+<!--
+
+Defines the TagLibraryValidator class that can be used to
+validate the conformance of a JSP page to using this tag library.
+-->
+
+<!ELEMENT validator-class (#PCDATA) >
+
+
+<!--
+
+The init-param element contains a name/value pair as an
+initialization param
+-->
+
+<!ELEMENT init-param (param-name, param-value, description?)>
+
+<!--
+
+The param-name element contains the name of a parameter.
+-->
+
+<!ELEMENT param-name (#PCDATA)>
+
+<!--
+
+The param-value element contains the value of a parameter.
+-->
+
+<!ELEMENT param-value (#PCDATA)>
+
+
+<!--
+
+Defines an optional event listener object to be instantiated and
+registered automatically.
+-->
+
+<!ELEMENT listener (listener-class) >
+
+<!--
+
+The listener-class element declares a class in the application that
+must be registered as a web application listener bean.  See the
+Servlet 2.3 specification for details.
+-->
+
+<!ELEMENT listener-class (#PCDATA) >
+
+
+<!--
+The tag defines a unique tag in this tag library.  It has one
+attribute, id.
+
+The tag element may have several subelements defining:
+
+name              The unique action name
+
+tag-class         The tag handler class implementing
+                  javax.servlet.jsp.tagext.Tag
+
+tei-class         An optional subclass of
+                  javax.servlet.jsp.tagext.TagExtraInfo
+
+body-content      The body content type
+
+display-name      A short name that is intended to be displayed
+                  by tools
+
+small-icon        Optional small-icon that can be used by tools
+
+large-icon        Optional large-icon that can be used by tools
+
+description       Optional tag-specific information
+
+variable          Optional scripting variable information
+
+attribute         All attributes of this action
+
+example           Optional informal description of an example of a
+                  use of this tag
+
+-->
+
+<!ELEMENT tag (name, tag-class, tei-class?, body-content?, display-name?,
+               small-icon?, large-icon?, description?, variable*, attribute*,
+               example?) >
+
+<!--
+Defines the subclass of javax.serlvet.jsp.tagext.Tag that implements
+the request time semantics for this tag. (required)
+
+#PCDATA ::= fully qualified Java class name
+-->
+
+<!ELEMENT tag-class (#PCDATA) >
+
+<!--
+Defines the subclass of javax.servlet.jsp.tagext.TagExtraInfo for
+this tag. (optional)
+
+If this is not given, the class is not consulted at translation time.
+
+#PCDATA ::= fully qualified Java class name
+-->
+
+<!ELEMENT tei-class (#PCDATA) >
+
+<!--
+Provides a hint as to the content of the body of this tag. Primarily
+intended for use by page composition tools.
+
+There are currently three values specified:
+
+tagdependent	The body of the tag is interpreted by the tag
+		implementation itself, and is most likely in a
+		different "langage", e.g embedded SQL statements.
+
+JSP		The body of the tag contains nested JSP syntax
+
+empty		The body must be empty
+
+The default (if not defined) is JSP
+
+#PCDATA ::=  tagdependent | JSP | empty
+
+-->
+
+<!ELEMENT body-content (#PCDATA) >
+
+<!--
+
+The display-name element contains a short name that is intended
+to be displayed by tools.
+-->
+
+<!ELEMENT display-name (#PCDATA) >
+
+
+<!--
+
+The large-icon element contains the name of a file containing a large
+(32 x 32) icon image.  The file name is a relative path within the
+tag library.  The image must be either in the JPEG or GIF format, and
+the file name must end with the suffix ".jpg" or ".gif" respectively.
+The icon can be used by tools.
+-->
+
+<!ELEMENT large-icon (#PCDATA) >
+
+<!--
+
+The small-icon element contains the name of a file containing a large
+(32 x 32) icon image.  The file name is a relative path within the
+tag library.  The image must be either in the JPEG or GIF format, and
+the file name must end with the suffix ".jpg" or ".gif" respectively.
+The icon can be used by tools.
+-->
+
+<!ELEMENT small-icon (#PCDATA) >
+
+<!--
+
+The example element contains an informal description of an example
+of the use of a tag.
+-->
+
+<!ELEMENT example (#PCDATA) >
+
+<!--
+
+The variable tag provides information on the scripting variables
+defined by this tag.  It is a (translation time) error for a tag
+that has one or more variable subelements to have a TagExtraInfo
+class that returns a non-null object.
+
+The subelements of variable are of the form:
+
+name-given               The variable name as a constant
+
+name-from-attribute      The name of an attribute whose (translation
+                         time) value will give the name of the
+                         variable.  One of name-given or
+                         name-from-attribute is required.
+
+variable-class           Name of the class of the variable.
+                         java.lang.String is default.
+
+declare                  Whether the variable is declared or not.
+                         True is the default.
+
+scope                    The scope of the scripting varaible
+                         defined.  NESTED is default.
+
+description              Optional description of this variable
+
+-->
+
+<!ELEMENT variable ( (name-given | name-from-attribute), variable-class?,
+                    declare?, scope?, description?) >
+
+<!--
+
+The name for the scripting variable.  One of name-given or
+name-from-attribute is required.
+-->
+
+<!ELEMENT name-given (#PCDATA) >
+
+<!--
+
+The name of an attribute whose (translation-time) value will give
+the name of the variable.  One of name-given or name-from-attribute
+is required.
+-->
+
+<!ELEMENT name-from-attribute (#PCDATA) >
+
+<!--
+
+The optional name of the class for the scripting variable.  The
+default is java.lang.String.
+-->
+
+<!ELEMENT variable-class (#PCDATA) >
+
+<!--
+
+Whether the scripting variable is to be defined or not.  See
+TagExtraInfo for details.  This element is optional and "true"
+is the default.
+-->
+
+<!ELEMENT declare (#PCDATA) >
+
+<!--
+
+The scope of the scripting variable.  See TagExtraInfo for details.
+The element is optional and "NESTED" is the default.  Other legal
+values are "AT_BEGIN" and "AT_END".
+-->
+
+<!ELEMENT scope (#PCDATA) >
+
+<!--
+
+The attribute tag defines an attribute for the nesting tag
+
+An attribute definition is composed of:
+	
+- the attributes name (required)
+- if the attribute is required or optional (optional)
+- if the attributes value may be dynamically calculated at runtime
+  by a scriptlet expression (optional)
+- the type of the attributes value (optional)
+- an informal description of the meaning of the attribute (optional)
+
+-->
+
+
+<!--
+The attribute tag defines an attribute for the nesting tag
+
+An attribute definition is composed of:
+
+- the attributes name (required)
+
+- if the attribute is required or optional (optional)
+
+- if the attributes value may be dynamically calculated at runtime
+  by a scriptlet expression (optional)
+
+- the type of the attributes value (optional)
+
+- an informal description of the meaning of the attribute (optional)
+-->
+
+<!ELEMENT attribute (name, required? , rtexprvalue?, type?, description?) >
+
+<!--
+Defines the canonical name of a tag or attribute being defined
+
+#PCDATA ::= NMTOKEN
+-->
+
+<!ELEMENT name	(#PCDATA) >
+
+<!--
+Defines if the nesting attribute is required or optional.
+
+#PCDATA ::= true | false | yes | no
+
+If not present then the default is "false", i.e the attribute
+is optional.
+-->
+
+<!ELEMENT required    (#PCDATA) >
+
+<!--
+Defines if the nesting attribute can have scriptlet expressions as
+a value, i.e the value of the attribute may be dynamically calculated
+at request time, as opposed to a static value determined at translation
+time.
+
+#PCDATA ::= true | false | yes | no
+
+If not present then the default is "false", i.e the attribute
+has a static value
+-->
+
+<!ELEMENT rtexprvalue (#PCDATA) >
+
+
+<!--
+
+Defines the Java type of the attributes value.  For static values
+(those determined at translation time) the type is always
+java.lang.String.
+-->
+
+<!ELEMENT type (#PCDATA) >
+
+
+<!-- ID attributes -->
+
+<!ATTLIST tlib-version id ID #IMPLIED>
+<!ATTLIST jsp-version id ID #IMPLIED>
+<!ATTLIST short-name id ID #IMPLIED>
+<!ATTLIST uri id ID #IMPLIED>
+<!ATTLIST description id ID #IMPLIED>
+<!ATTLIST example id ID #IMPLIED>
+<!ATTLIST tag id ID #IMPLIED>
+<!ATTLIST tag-class id ID #IMPLIED>
+<!ATTLIST tei-class id ID #IMPLIED>
+<!ATTLIST body-content id ID #IMPLIED>
+<!ATTLIST attribute id ID #IMPLIED>
+<!ATTLIST name id ID #IMPLIED>
+<!ATTLIST required id ID #IMPLIED>
+<!ATTLIST rtexprvalue id ID #IMPLIED>
+
+
+<!ATTLIST param-name id ID #IMPLIED>
+<!ATTLIST param-value id ID #IMPLIED>
+<!ATTLIST listener id ID #IMPLIED>
+<!ATTLIST listener-class id ID #IMPLIED>
diff --git a/xml/tests/testData/xml/web-jsptaglibrary_2_0.xsd b/xml/tests/testData/xml/web-jsptaglibrary_2_0.xsd
new file mode 100644
index 0000000..79a8b5d
--- /dev/null
+++ b/xml/tests/testData/xml/web-jsptaglibrary_2_0.xsd
@@ -0,0 +1,1010 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema
+     targetNamespace="http://java.sun.com/xml/ns/j2ee"
+     xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+     elementFormDefault="qualified"
+     attributeFormDefault="unqualified"
+     version="2.0">
+
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)web-jsptaglibrary_2_0.xsds	1.38 10/08/03
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
+      Road, Palo Alto, California 94303, U.S.A. All rights
+      reserved.
+
+      Sun Microsystems, Inc. has intellectual property rights
+      relating to technology described in this document. In
+      particular, and without limitation, these intellectual
+      property rights may include one or more of the U.S. patents
+      listed at http://www.sun.com/patents and one or more
+      additional patents or pending patent applications in the
+      U.S. and other countries.
+
+      This document and the technology which it describes are
+      distributed under licenses restricting their use, copying,
+      distribution, and decompilation. No part of this document
+      may be reproduced in any form by any means without prior
+      written authorization of Sun and its licensors, if any.
+
+      Third-party software, including font technology, is
+      copyrighted and licensed from Sun suppliers.
+
+      Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
+      JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+      Cup logo are trademarks or registered trademarks of Sun
+      Microsystems, Inc. in the U.S. and other countries.
+
+      Federal Acquisitions: Commercial Software - Government Users
+      Subject to Standard License Terms and Conditions.
+
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[
+
+	This is the XML Schema for the JSP Taglibrary
+	descriptor.  All Taglibrary descriptors must
+	indicate the tag library schema by using the Taglibrary
+	namespace:
+
+	http://java.sun.com/xml/ns/j2ee
+
+	and by indicating the version of the schema by
+	using the version element as shown below:
+
+	    <taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	      xsi:schemaLocation="..."
+	      version="2.0">
+	      ...
+	    </taglib>
+
+	The instance documents may indicate the published
+	version of the schema using xsi:schemaLocation attribute
+	for J2EE namespace with the following location:
+
+	http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd
+
+	]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="j2ee_1_4.xsd"/>
+
+
+<!-- **************************************************** -->
+
+
+  <xsd:element name="taglib" type="j2ee:tldTaglibType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The taglib tag is the document root.
+	The definition of taglib is provided
+	by the tldTaglibType.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:unique name="tag-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The taglib element contains, among other things, tag and
+	  tag-file elements.
+	  The name subelements of these elements must each be unique.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:tag|j2ee:tag-file"/>
+      <xsd:field    xpath="j2ee:name"/>
+    </xsd:unique>
+
+    <xsd:unique name="function-name-uniqueness">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  The taglib element contains function elements.
+	  The name subelements of these elements must each be unique.
+
+	</xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="j2ee:function"/>
+      <xsd:field    xpath="j2ee:name"/>
+    </xsd:unique>
+
+  </xsd:element>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="body-contentType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Specifies the type of body that is valid for a tag.
+	This value is used by the JSP container to validate
+	that a tag invocation has the correct body syntax and
+	by page composition tools to assist the page author
+	in providing a valid tag body.
+
+	There are currently four values specified:
+
+	tagdependent    The body of the tag is interpreted by the tag
+			implementation itself, and is most likely
+			in a different "language", e.g embedded SQL
+			statements.
+
+	JSP             The body of the tag contains nested JSP
+			syntax.
+
+	empty           The body must be empty
+
+	scriptless      The body accepts only template text, EL
+			Expressions, and JSP action elements.  No
+			scripting elements are allowed.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:enumeration value="tagdependent"/>
+	<xsd:enumeration value="JSP"/>
+	<xsd:enumeration value="empty"/>
+	<xsd:enumeration value="scriptless"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="extensibleType" abstract="true">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The extensibleType is an abstract base type that is used to
+	define the type of extension-elements. Instance documents
+	must substitute a known type to define the extension by
+	using xsi:type attribute to define the actual type of
+	extension-elements.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="functionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The function element is used to provide information on each
+	function in the tag library that is to be exposed to the EL.
+
+	The function element may have several subelements defining:
+
+	description         Optional tag-specific information
+
+	display-name        A short name that is intended to be
+			    displayed by tools
+
+	icon                Optional icon element that can be used
+			    by tools
+
+	name                A unique name for this function
+
+	function-class      Provides the name of the Java class that
+			    implements the function
+
+	function-signature  Provides the signature, as in the Java
+			    Language Specification, of the Java
+			    method that is to be used to implement
+			    the function.
+
+	example             Optional informal description of an
+			    example of a use of this function
+
+	function-extension  Zero or more extensions that provide extra
+			    information about this function, for tool
+			    consumption
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="j2ee:descriptionGroup"/>
+      <xsd:element name="name"
+		   type="j2ee:tld-canonical-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    A unique name for this function.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="function-class"
+		   type="j2ee:fully-qualified-classType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Provides the fully-qualified class name of the Java
+	    class containing the static method that implements
+	    the function.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+
+      </xsd:element>
+      <xsd:element name="function-signature"
+		   type="j2ee:string">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Provides the signature, of the static Java method that is
+	    to be used to implement the function.  The syntax of the
+	    function-signature element is as follows:
+
+		FunctionSignature ::= ReturnType S MethodName S?
+				      '(' S? Parameters? S? ')'
+
+                ReturnType        ::= Type
+
+		MethodName        ::= Identifier
+
+		Parameters        ::=   Parameter
+				      | ( Parameter S? ',' S? Parameters )
+
+                Parameter         ::= Type
+
+		Where:
+
+ 		    * Type is a basic type or a fully qualified
+		      Java class name (including package name),
+		      as per the 'Type' production in the Java
+		      Language Specification, Second Edition,
+		      Chapter 18.
+
+                    * Identifier is a Java identifier, as per
+		      the 'Identifier' production in the Java
+		      Language Specification, Second
+		      Edition, Chapter 18.
+
+	    Example:
+
+	    java.lang.String nickName( java.lang.String, int )
+
+	  </xsd:documentation>
+	</xsd:annotation>
+
+      </xsd:element>
+      <xsd:element name="example"
+		   type="j2ee:xsdStringType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The example element contains an informal description
+	    of an example of the use of this function.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+
+      </xsd:element>
+      <xsd:element name="function-extension"
+		   type="j2ee:tld-extensionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Function extensions are for tool use only and must not affect
+	    the behavior of a container.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="tagFileType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	Defines an action in this tag library that is implemented
+	as a .tag file.
+
+	The tag-file element has two required subelements:
+
+	description       Optional tag-specific information
+
+	display-name      A short name that is intended to be
+			  displayed by tools
+
+	icon              Optional icon element that can be used
+			  by tools
+
+	name              The unique action name
+
+	path              Where to find the .tag file implementing this
+			  action, relative to the root of the web
+			  application or the root of the JAR file for a
+			  tag library packaged in a JAR.  This must
+			  begin with /WEB-INF/tags if the .tag file
+			  resides in the WAR, or /META-INF/tags if the
+			  .tag file resides in a JAR.
+
+	example           Optional informal description of an
+			  example of a use of this tag
+
+	tag-extension     Zero or more extensions that provide extra
+			  information about this tag, for tool
+			  consumption
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="j2ee:descriptionGroup"/>
+      <xsd:element name="name"
+		   type="j2ee:tld-canonical-nameType"/>
+      <xsd:element name="path"
+		   type="j2ee:pathType"/>
+      <xsd:element name="example"
+		   type="j2ee:xsdStringType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The example element contains an informal description
+	    of an example of the use of a tag.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+
+      </xsd:element>
+      <xsd:element name="tag-extension"
+		   type="j2ee:tld-extensionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Tag extensions are for tool use only and must not affect
+	    the behavior of a container.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="tagType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The tag defines a unique tag in this tag library.  It has one
+	attribute, id.
+
+	The tag element may have several subelements defining:
+
+	description       Optional tag-specific information
+
+	display-name      A short name that is intended to be
+			  displayed by tools
+
+	icon              Optional icon element that can be used
+			  by tools
+
+	name              The unique action name
+
+	tag-class         The tag handler class implementing
+			  javax.servlet.jsp.tagext.JspTag
+
+	tei-class         An optional subclass of
+			  javax.servlet.jsp.tagext.TagExtraInfo
+
+	body-content      The body content type
+
+	variable          Optional scripting variable information
+
+	attribute         All attributes of this action that are
+			  evaluated prior to invocation.
+
+	dynamic-attributes Whether this tag supports additional
+			   attributes with dynamic names.  If
+			   true, the tag-class must implement the
+			   javax.servlet.jsp.tagext.DynamicAttributes
+			   interface.  Defaults to false.
+
+	example           Optional informal description of an
+			  example of a use of this tag
+
+	tag-extension     Zero or more extensions that provide extra
+			  information about this tag, for tool
+			  consumption
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:group ref="j2ee:descriptionGroup"/>
+      <xsd:element name="name"
+		   type="j2ee:tld-canonical-nameType"/>
+      <xsd:element name="tag-class"
+		   type="j2ee:fully-qualified-classType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Defines the subclass of javax.serlvet.jsp.tagext.JspTag
+	    that implements the request time semantics for
+	    this tag. (required)
+
+	  </xsd:documentation>
+	</xsd:annotation>
+
+      </xsd:element>
+      <xsd:element name="tei-class"
+		   type="j2ee:fully-qualified-classType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Defines the subclass of javax.servlet.jsp.tagext.TagExtraInfo
+	    for this tag. (optional)
+
+	    If this is not given, the class is not consulted at
+	    translation time.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="body-content"
+		   type="j2ee:body-contentType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Specifies the format for the body of this tag.
+	    The default in JSP 1.2 was "JSP" but because this
+	    is an invalid setting for simple tag handlers, there
+	    is no longer a default in JSP 2.0.  A reasonable
+	    default for simple tag handlers is "scriptless" if
+	    the tag can have a body.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="variable"
+		   type="j2ee:variableType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="attribute"
+		   type="j2ee:tld-attributeType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="dynamic-attributes"
+		   type="j2ee:generic-booleanType"
+		   minOccurs="0"/>
+      <xsd:element name="example"
+		   type="j2ee:xsdStringType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The example element contains an informal description
+	    of an example of the use of a tag.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+
+      </xsd:element>
+      <xsd:element name="tag-extension"
+		   type="j2ee:tld-extensionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Tag extensions are for tool use only and must not affect
+	    the behavior of a container.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="tld-attributeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The attribute element defines an attribute for the nesting
+	tag.  The attributre element may have several subelements
+	defining:
+
+	description     a description of the attribute
+
+	name            the name of the attribute
+
+	required        whether the attribute is required or
+			optional
+
+	rtexprvalue     whether the attribute is a runtime attribute
+
+	type            the type of the attributes
+
+	fragment        whether this attribute is a fragment
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="j2ee:descriptionType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="name"
+		   type="j2ee:java-identifierType"/>
+      <xsd:element name="required"
+		   type="j2ee:generic-booleanType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Defines if the nesting attribute is required or
+	    optional.
+
+	    If not present then the default is "false", i.e
+	    the attribute is optional.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+
+      <xsd:choice>
+	<xsd:sequence>
+	  <xsd:element name="rtexprvalue"
+		       type="j2ee:generic-booleanType"
+		       minOccurs="0">
+	    <xsd:annotation>
+	      <xsd:documentation>
+
+		Defines if the nesting attribute can have scriptlet
+		expressions as a value, i.e the value of the
+		attribute may be dynamically calculated at request
+		time, as opposed to a static value determined at
+		translation time.
+
+		If not present then the default is "false", i.e the
+		attribute has a static value
+
+	      </xsd:documentation>
+	    </xsd:annotation>
+
+	  </xsd:element>
+	  <xsd:element name="type"
+		       type="j2ee:fully-qualified-classType"
+		       minOccurs="0">
+	    <xsd:annotation>
+	      <xsd:documentation>
+
+		Defines the Java type of the attributes value.  For
+		static values (those determined at translation time)
+		the type is always java.lang.String.
+
+	      </xsd:documentation>
+	    </xsd:annotation>
+	  </xsd:element>
+	</xsd:sequence>
+	<xsd:element name="fragment"
+		     type="j2ee:generic-booleanType"
+		     minOccurs="0">
+	  <xsd:annotation>
+	    <xsd:documentation>
+
+	      "true" if this attribute is of type
+	      javax.jsp.tagext.JspFragment, representing dynamic
+	      content that can be re-evaluated as many times
+	      as needed by the tag handler.  If omitted or "false",
+	      the default is still type="java.lang.String"
+
+	    </xsd:documentation>
+	  </xsd:annotation>
+	</xsd:element>
+      </xsd:choice>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="tld-canonical-nameType">
+
+    <xsd:annotation>
+      <xsd:documentation>
+
+	Defines the canonical name of a tag or attribute being
+	defined.
+
+	The name must conform to the lexical rules for an NMTOKEN.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:xsdNMTOKENType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="tld-extensionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The tld-extensionType is used to indicate
+	extensions to a specific TLD element.
+
+	It is used by elements to designate an extension block
+	that is targeted to a specific extension designated by
+	a set of extension elements that are declared by a
+	namespace. The namespace identifies the extension to
+	the tool that processes the extension.
+
+	The type of the extension-element is abstract. Therefore,
+	a concrete type must be specified by the TLD using
+	xsi:type attribute for each extension-element.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="extension-element"
+		   type="j2ee:extensibleType"
+		   maxOccurs="unbounded"/>
+    </xsd:sequence>
+
+    <xsd:attribute name="namespace"
+		   use="required"
+		   type="xsd:anyURI"/>
+    <xsd:attribute name="id" type="xsd:ID"/>
+
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="tldTaglibType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The taglib tag is the document root, it defines:
+
+	description     a simple string describing the "use" of this
+			taglib, should be user discernable
+
+	display-name    the display-name element contains a
+			short name that is intended to be displayed
+			by tools
+
+	icon            optional icon that can be used by tools
+
+	tlib-version    the version of the tag library implementation
+
+	short-name      a simple default short name that could be
+			used by a JSP authoring tool to create
+			names with a mnemonic value; for example,
+			the it may be used as the prefered prefix
+			value in taglib directives
+
+	uri             a uri uniquely identifying this taglib
+
+	validator       optional TagLibraryValidator information
+
+	listener        optional event listener specification
+
+	tag             tags in this tag library
+
+	tag-file        tag files in this tag library
+
+	function        zero or more EL functions defined in this
+			tag library
+
+	taglib-extension zero or more extensions that provide extra
+			information about this taglib, for tool
+			consumption
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="j2ee:descriptionGroup"/>
+      <xsd:element name="tlib-version"
+		   type="j2ee:dewey-versionType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Describes this version (number) of the taglibrary.
+	    It is described as a dewey decimal.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+
+      </xsd:element>
+
+      <xsd:element name="short-name"
+		   type="j2ee:tld-canonical-nameType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Defines a simple default name that could be used by
+	    a JSP authoring tool to create names with a
+	    mnemonicvalue; for example, it may be used as the
+	    preferred prefix value in taglib directives.  Do
+	    not use white space, and do not start with digits
+	    or underscore.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+
+      </xsd:element>
+      <xsd:element name="uri"
+		   type="j2ee:xsdAnyURIType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Defines a public URI that uniquely identifies this
+	    version of the taglibrary.  Leave it empty if it
+	    does not apply.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+
+      </xsd:element>
+      <xsd:element name="validator"
+		   type="j2ee:validatorType"
+		   minOccurs="0">
+      </xsd:element>
+      <xsd:element name="listener"
+		   type="j2ee:listenerType"
+		   minOccurs="0" maxOccurs="unbounded">
+      </xsd:element>
+      <xsd:element name="tag"
+		   type="j2ee:tagType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="tag-file"
+		   type="j2ee:tagFileType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="function"
+		   type="j2ee:functionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="taglib-extension"
+		   type="j2ee:tld-extensionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Taglib extensions are for tool use only and must not affect
+	    the behavior of a container.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="version"
+		   type="j2ee:dewey-versionType"
+		   fixed="2.0"
+		   use="required">
+      <xsd:annotation>
+	<xsd:documentation>
+
+	  Describes the JSP version (number) this taglibrary
+	  requires in order to function (dewey decimal)
+
+	</xsd:documentation>
+      </xsd:annotation>
+
+    </xsd:attribute>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="validatorType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	A validator that can be used to validate
+	the conformance of a JSP page to using this tag library is
+	defined by a validatorType.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="j2ee:descriptionType"
+		   minOccurs="0"
+		   maxOccurs="unbounded"/>
+      <xsd:element name="validator-class"
+		   type="j2ee:fully-qualified-classType">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Defines the TagLibraryValidator class that can be used
+	    to validate the conformance of a JSP page to using this
+	    tag library.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="init-param"
+		   type="j2ee:param-valueType"
+		   minOccurs="0" maxOccurs="unbounded">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The init-param element contains a name/value pair as an
+	    initialization param.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+
+      </xsd:element>
+
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="variable-scopeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	This type defines scope of the scripting variable.  See
+	TagExtraInfo for details.  The allowed values are,
+	"NESTED", "AT_BEGIN" and "AT_END".
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:simpleContent>
+      <xsd:restriction base="j2ee:string">
+	<xsd:enumeration value="NESTED"/>
+	<xsd:enumeration value="AT_BEGIN"/>
+	<xsd:enumeration value="AT_END"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="variableType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+	The variableType provides information on the scripting
+	variables defined by using this tag.  It is a (translation
+	time) error for a tag that has one or more variable
+	subelements to have a TagExtraInfo class that returns a
+	non-null value from a call to getVariableInfo().
+
+	The subelements of variableType are of the form:
+
+	description              Optional description of this
+				 variable
+
+	name-given               The variable name as a constant
+
+	name-from-attribute      The name of an attribute whose
+				 (translation time) value will
+				 give the name of the
+				 variable.  One of name-given or
+				 name-from-attribute is required.
+
+	variable-class           Name of the class of the variable.
+				 java.lang.String is default.
+
+	declare                  Whether the variable is declared
+				 or not.  True is the default.
+
+	scope                    The scope of the scripting varaible
+				 defined.  NESTED is default.
+
+      </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:sequence>
+      <xsd:element name="description"
+		   type="j2ee:descriptionType"
+		   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:choice>
+	<xsd:element name="name-given"
+		     type="j2ee:java-identifierType">
+	  <xsd:annotation>
+	    <xsd:documentation>
+
+	      The name for the scripting variable.
+
+	    </xsd:documentation>
+	  </xsd:annotation>
+	</xsd:element>
+
+	<xsd:element name="name-from-attribute"
+		     type="j2ee:java-identifierType">
+	  <xsd:annotation>
+	    <xsd:documentation>
+
+	      The name of an attribute whose
+	      (translation-time) value will give the name of
+	      the variable.
+
+	    </xsd:documentation>
+	  </xsd:annotation>
+	</xsd:element>
+      </xsd:choice>
+      <xsd:element name="variable-class"
+		   type="j2ee:fully-qualified-classType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The optional name of the class for the scripting
+	    variable.  The default is java.lang.String.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+
+      </xsd:element>
+
+      <xsd:element name="declare"
+		   type="j2ee:generic-booleanType"
+		   minOccurs="0">
+
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    Whether the scripting variable is to be defined
+	    or not.  See TagExtraInfo for details.  This
+	    element is optional and "true" is the default.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+      <xsd:element name="scope"
+		   type="j2ee:variable-scopeType"
+		   minOccurs="0">
+	<xsd:annotation>
+	  <xsd:documentation>
+
+	    The element is optional and "NESTED" is the default.
+
+	  </xsd:documentation>
+	</xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+  </xsd:complexType>
+
+</xsd:schema>
+
diff --git a/xml/tests/testData/xml/wrongRootTag1.xml b/xml/tests/testData/xml/wrongRootTag1.xml
new file mode 100644
index 0000000..6bd0d3e
--- /dev/null
+++ b/xml/tests/testData/xml/wrongRootTag1.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE tv [ <!ELEMENT tv (date)*> <!ELEMENT date (#PCDATA)> ]>
+
+<<error>xx</error>>
+
+</<error>xx</error>>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/wsdl11.xsd b/xml/tests/testData/xml/wsdl11.xsd
new file mode 100644
index 0000000..14b5bef
--- /dev/null
+++ b/xml/tests/testData/xml/wsdl11.xsd
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<!-- 
+ 
+Copyright 2001 - 2005, International Business Machines Corporation and Microsoft Corporation
+All Rights Reserved
+
+License for WSDL Schema Files
+
+The Authors grant permission to copy and distribute the WSDL Schema 
+Files in any medium without fee or royalty as long as this notice and 
+license are distributed with them.  The originals of these files can 
+be located at:
+
+http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd
+
+THESE SCHEMA FILES ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS 
+OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THESE FILES, INCLUDING, BUT NOT 
+LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, 
+NON-INFRINGEMENT OR TITLE.  THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, 
+INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR 
+RELATING TO ANY USE OR DISTRIBUTION OF THESE FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner, 
+including advertising or publicity pertaining to these files or any program 
+or service that uses these files, written prior permission.  Title to copyright 
+in these files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+
+--> 
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+           targetNamespace="http://schemas.xmlsoap.org/wsdl/"
+           elementFormDefault="qualified" >
+   
+  <xs:complexType mixed="true" name="tDocumentation" >
+    <xs:sequence>
+      <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax" />
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="tDocumented" >
+    <xs:annotation>
+      <xs:documentation>
+      This type is extended by  component types to allow them to be documented
+      </xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="documentation" type="wsdl:tDocumentation" minOccurs="0" />
+    </xs:sequence>
+  </xs:complexType>
+	 
+  <xs:complexType name="tExtensibleAttributesDocumented" abstract="true" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tDocumented" >
+        <xs:annotation>
+          <xs:documentation>
+          This type is extended by component types to allow attributes from other namespaces to be added.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:anyAttribute namespace="##other" processContents="lax" />    
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tExtensibleDocumented" abstract="true" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tDocumented" >
+        <xs:annotation>
+          <xs:documentation>
+          This type is extended by component types to allow elements from other namespaces to be added.
+          </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+          <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
+        </xs:sequence>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:element name="definitions" type="wsdl:tDefinitions" >
+    <xs:key name="message" >
+      <xs:selector xpath="wsdl:message" />
+      <xs:field xpath="@name" />
+    </xs:key>
+    <xs:key name="portType" >
+      <xs:selector xpath="wsdl:portType" />
+      <xs:field xpath="@name" />
+    </xs:key>
+    <xs:key name="binding" >
+      <xs:selector xpath="wsdl:binding" />
+      <xs:field xpath="@name" />
+    </xs:key>
+    <xs:key name="service" >
+      <xs:selector xpath="wsdl:service" />
+      <xs:field xpath="@name" />
+    </xs:key>
+    <xs:key name="import" >
+      <xs:selector xpath="wsdl:import" />
+      <xs:field xpath="@namespace" />
+    </xs:key>
+  </xs:element>
+
+  <xs:group name="anyTopLevelOptionalElement" >
+    <xs:annotation>
+      <xs:documentation>
+      Any top level optional element allowed to appear more then once - any child of definitions element except wsdl:types. Any extensibility element is allowed in any place.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:element name="import" type="wsdl:tImport" />
+      <xs:element name="types" type="wsdl:tTypes" />                     
+      <xs:element name="message"  type="wsdl:tMessage" >
+        <xs:unique name="part" >
+          <xs:selector xpath="wsdl:part" />
+          <xs:field xpath="@name" />
+        </xs:unique>
+      </xs:element>
+      <xs:element name="portType" type="wsdl:tPortType" />
+      <xs:element name="binding"  type="wsdl:tBinding" />
+      <xs:element name="service"  type="wsdl:tService" >
+        <xs:unique name="port" >
+          <xs:selector xpath="wsdl:port" />
+          <xs:field xpath="@name" />
+        </xs:unique>
+	  </xs:element>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="tDefinitions" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:sequence>
+          <xs:group ref="wsdl:anyTopLevelOptionalElement"  minOccurs="0"   maxOccurs="unbounded" />
+        </xs:sequence>
+        <xs:attribute name="targetNamespace" type="xs:anyURI" use="optional" />
+        <xs:attribute name="name" type="xs:NCName" use="optional" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+   
+  <xs:complexType name="tImport" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
+        <xs:attribute name="namespace" type="xs:anyURI" use="required" />
+        <xs:attribute name="location" type="xs:anyURI" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+   
+  <xs:complexType name="tTypes" >
+    <xs:complexContent>   
+      <xs:extension base="wsdl:tExtensibleDocumented" />
+    </xs:complexContent>   
+  </xs:complexType>
+     
+  <xs:complexType name="tMessage" >
+    <xs:complexContent>   
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:sequence>
+          <xs:element name="part" type="wsdl:tPart" minOccurs="0" maxOccurs="unbounded" />
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+      </xs:extension>
+    </xs:complexContent>   
+  </xs:complexType>
+
+  <xs:complexType name="tPart" >
+    <xs:complexContent>   
+      <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+        <xs:attribute name="element" type="xs:QName" use="optional" />
+        <xs:attribute name="type" type="xs:QName" use="optional" />    
+      </xs:extension>
+    </xs:complexContent>   
+  </xs:complexType>
+
+  <xs:complexType name="tPortType" >
+    <xs:complexContent>   
+      <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
+        <xs:sequence>
+          <xs:element name="operation" type="wsdl:tOperation" minOccurs="0" maxOccurs="unbounded" />
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+      </xs:extension>
+    </xs:complexContent>   
+  </xs:complexType>
+   
+  <xs:complexType name="tOperation" >
+    <xs:complexContent>   
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+	    <xs:sequence>
+          <xs:choice>
+            <xs:group ref="wsdl:request-response-or-one-way-operation" />
+            <xs:group ref="wsdl:solicit-response-or-notification-operation" />
+          </xs:choice>
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+        <xs:attribute name="parameterOrder" type="xs:NMTOKENS" use="optional" />
+      </xs:extension>
+    </xs:complexContent>   
+  </xs:complexType>
+    
+  <xs:group name="request-response-or-one-way-operation" >
+    <xs:sequence>
+      <xs:element name="input" type="wsdl:tParam" />
+	  <xs:sequence minOccurs='0' >
+	    <xs:element name="output" type="wsdl:tParam" />
+		<xs:element name="fault" type="wsdl:tFault" minOccurs="0" maxOccurs="unbounded" />
+      </xs:sequence>
+    </xs:sequence>
+  </xs:group>
+
+  <xs:group name="solicit-response-or-notification-operation" >
+    <xs:sequence>
+      <xs:element name="output" type="wsdl:tParam" />
+	  <xs:sequence minOccurs='0' >
+	    <xs:element name="input" type="wsdl:tParam" />
+		<xs:element name="fault" type="wsdl:tFault" minOccurs="0" maxOccurs="unbounded" />
+	  </xs:sequence>
+    </xs:sequence>
+  </xs:group>
+        
+  <xs:complexType name="tParam" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
+        <xs:attribute name="name" type="xs:NCName" use="optional" />
+        <xs:attribute name="message" type="xs:QName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tFault" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
+        <xs:attribute name="name" type="xs:NCName"  use="required" />
+        <xs:attribute name="message" type="xs:QName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+     
+  <xs:complexType name="tBinding" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:sequence>
+          <xs:element name="operation" type="wsdl:tBindingOperation" minOccurs="0" maxOccurs="unbounded" />
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+        <xs:attribute name="type" type="xs:QName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+    
+  <xs:complexType name="tBindingOperationMessage" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:attribute name="name" type="xs:NCName" use="optional" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+  
+  <xs:complexType name="tBindingOperationFault" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="tBindingOperation" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:sequence>
+          <xs:element name="input" type="wsdl:tBindingOperationMessage" minOccurs="0" />
+          <xs:element name="output" type="wsdl:tBindingOperationMessage" minOccurs="0" />
+          <xs:element name="fault" type="wsdl:tBindingOperationFault" minOccurs="0" maxOccurs="unbounded" />
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+     
+  <xs:complexType name="tService" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:sequence>
+          <xs:element name="port" type="wsdl:tPort" minOccurs="0" maxOccurs="unbounded" />
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+     
+  <xs:complexType name="tPort" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibleDocumented" >
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+        <xs:attribute name="binding" type="xs:QName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:attribute name="arrayType" type="xs:string" />
+  <xs:attribute name="required" type="xs:boolean" />
+  <xs:complexType name="tExtensibilityElement" abstract="true" >
+    <xs:attribute ref="wsdl:required" use="optional" />
+  </xs:complexType>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/wsdl11_soapbinding.xsd b/xml/tests/testData/xml/wsdl11_soapbinding.xsd
new file mode 100644
index 0000000..0458e6c
--- /dev/null
+++ b/xml/tests/testData/xml/wsdl11_soapbinding.xsd
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<!-- 
+ 
+Copyright 2001 - 2005, International Business Machines Corporation and Microsoft Corporation
+All Rights Reserved
+
+License for WSDL Schema Files
+
+The Authors grant permission to copy and distribute the WSDL Schema 
+Files in any medium without fee or royalty as long as this notice and 
+license are distributed with them.  The originals of these files can 
+be located at:
+
+http://schemas.xmlsoap.org/wsdl/soap/2003-02-11.xsd
+
+THESE SCHEMA FILES ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS 
+OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THESE FILES, INCLUDING, BUT NOT 
+LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, 
+NON-INFRINGEMENT OR TITLE.  THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, 
+INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR 
+RELATING TO ANY USE OR DISTRIBUTION OF THESE FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner, 
+including advertising or publicity pertaining to these files or any program 
+or service that uses these files, written prior permission.  Title to copyright 
+in these files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+
+--> 
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+           xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+           targetNamespace="http://schemas.xmlsoap.org/wsdl/soap/" >
+
+  <xs:import namespace = "http://schemas.xmlsoap.org/wsdl/" />
+
+  <xs:simpleType name="encodingStyle" >
+    <xs:annotation>
+      <xs:documentation>
+      "encodingStyle" indicates any canonicalization conventions followed in the contents of the containing element.  For example, the value "http://schemas.xmlsoap.org/soap/encoding/" indicates the pattern described in SOAP specification
+      </xs:documentation>
+    </xs:annotation>
+    <xs:list itemType="xs:anyURI" />
+  </xs:simpleType>
+
+  <xs:element name="binding" type="soap:tBinding" />
+  <xs:complexType name="tBinding" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibilityElement" >
+        <xs:attribute name="transport" type="xs:anyURI" use="required" />
+        <xs:attribute name="style" type="soap:tStyleChoice" use="optional" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:simpleType name="tStyleChoice" >
+    <xs:restriction base="xs:string" >
+      <xs:enumeration value="rpc" />
+      <xs:enumeration value="document" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="operation" type="soap:tOperation" />
+  <xs:complexType name="tOperation" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibilityElement" >
+        <xs:attribute name="soapAction" type="xs:anyURI" use="optional" />
+        <xs:attribute name="style" type="soap:tStyleChoice" use="optional" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:element name="body" type="soap:tBody" />
+  <xs:attributeGroup name="tBodyAttributes" >
+    <xs:attribute name="encodingStyle" type="soap:encodingStyle" use="optional" />	   
+    <xs:attribute name="use" type="soap:useChoice" use="optional" />
+    <xs:attribute name="namespace" type="xs:anyURI" use="optional" />
+  </xs:attributeGroup>
+  <xs:complexType name="tBody" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibilityElement" >
+        <xs:attribute name="parts" type="xs:NMTOKENS" use="optional" />
+        <xs:attributeGroup ref = "soap:tBodyAttributes" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+  
+  <xs:simpleType name="useChoice" >
+    <xs:restriction base="xs:string" >
+      <xs:enumeration value="literal" />
+      <xs:enumeration value="encoded" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="fault" type="soap:tFault" />
+  <xs:complexType name="tFaultRes" abstract="true" >
+    <xs:complexContent>
+      <xs:restriction base="soap:tBody" >
+	    <xs:attribute ref="wsdl:required" use="optional" /> 
+        <xs:attribute name="parts" type="xs:NMTOKENS" use="prohibited" />
+		<xs:attributeGroup ref="soap:tBodyAttributes" />
+      </xs:restriction>
+    </xs:complexContent>  	
+  </xs:complexType>
+  <xs:complexType name="tFault" >
+    <xs:complexContent>
+      <xs:extension base="soap:tFaultRes">
+        <xs:attribute name="name" type="xs:NCName" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+
+  <xs:element name="header" type="soap:tHeader" />
+  <xs:attributeGroup name="tHeaderAttributes" >
+    <xs:attribute name="message" type="xs:QName" use="required" />
+    <xs:attribute name="part" type="xs:NMTOKEN" use="required" />
+    <xs:attribute name="use" type="soap:useChoice" use="required" />
+    <xs:attribute name="encodingStyle" type="soap:encodingStyle" use="optional" />
+    <xs:attribute name="namespace" type="xs:anyURI" use="optional" />      
+  </xs:attributeGroup>
+  <xs:complexType name="tHeader" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibilityElement" >
+        <xs:sequence>
+          <xs:element ref="soap:headerfault" minOccurs="0" maxOccurs="unbounded" />
+        </xs:sequence>
+		<xs:attributeGroup ref="soap:tHeaderAttributes" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:element name="headerfault" type="soap:tHeaderFault" />
+  <xs:complexType name="tHeaderFault" >
+	<xs:attributeGroup ref="soap:tHeaderAttributes" />
+  </xs:complexType>
+
+  <xs:element name="address" type="soap:tAddress" />
+  <xs:complexType name="tAddress" >
+    <xs:complexContent>
+      <xs:extension base="wsdl:tExtensibilityElement" >
+        <xs:attribute name="location" type="xs:anyURI" use="required" />
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/xhtml-lat1.ent b/xml/tests/testData/xml/xhtml-lat1.ent
new file mode 100644
index 0000000..2a33e09
--- /dev/null
+++ b/xml/tests/testData/xml/xhtml-lat1.ent
@@ -0,0 +1,196 @@
+<!-- Portions (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+-->
+<!-- Character entity set. Typical invocation:
+    <!ENTITY % HTMLlat1 PUBLIC
+       "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
+    %HTMLlat1;
+-->
+
+<!ENTITY nbsp   "&#160;"> <!-- no-break space = non-breaking space,
+                                  U+00A0 ISOnum -->
+<!ENTITY iexcl  "&#161;"> <!-- inverted exclamation mark, U+00A1 ISOnum -->
+<!ENTITY cent   "&#162;"> <!-- cent sign, U+00A2 ISOnum -->
+<!ENTITY pound  "&#163;"> <!-- pound sign, U+00A3 ISOnum -->
+<!ENTITY curren "&#164;"> <!-- currency sign, U+00A4 ISOnum -->
+<!ENTITY yen    "&#165;"> <!-- yen sign = yuan sign, U+00A5 ISOnum -->
+<!ENTITY brvbar "&#166;"> <!-- broken bar = broken vertical bar,
+                                  U+00A6 ISOnum -->
+<!ENTITY sect   "&#167;"> <!-- section sign, U+00A7 ISOnum -->
+<!ENTITY uml    "&#168;"> <!-- diaeresis = spacing diaeresis,
+                                  U+00A8 ISOdia -->
+<!ENTITY copy   "&#169;"> <!-- copyright sign, U+00A9 ISOnum -->
+<!ENTITY ordf   "&#170;"> <!-- feminine ordinal indicator, U+00AA ISOnum -->
+<!ENTITY laquo  "&#171;"> <!-- left-pointing double angle quotation mark
+                                  = left pointing guillemet, U+00AB ISOnum -->
+<!ENTITY not    "&#172;"> <!-- not sign = angled dash,
+                                  U+00AC ISOnum -->
+<!ENTITY shy    "&#173;"> <!-- soft hyphen = discretionary hyphen,
+                                  U+00AD ISOnum -->
+<!ENTITY reg    "&#174;"> <!-- registered sign = registered trade mark sign,
+                                  U+00AE ISOnum -->
+<!ENTITY macr   "&#175;"> <!-- macron = spacing macron = overline
+                                  = APL overbar, U+00AF ISOdia -->
+<!ENTITY deg    "&#176;"> <!-- degree sign, U+00B0 ISOnum -->
+<!ENTITY plusmn "&#177;"> <!-- plus-minus sign = plus-or-minus sign,
+                                  U+00B1 ISOnum -->
+<!ENTITY sup2   "&#178;"> <!-- superscript two = superscript digit two
+                                  = squared, U+00B2 ISOnum -->
+<!ENTITY sup3   "&#179;"> <!-- superscript three = superscript digit three
+                                  = cubed, U+00B3 ISOnum -->
+<!ENTITY acute  "&#180;"> <!-- acute accent = spacing acute,
+                                  U+00B4 ISOdia -->
+<!ENTITY micro  "&#181;"> <!-- micro sign, U+00B5 ISOnum -->
+<!ENTITY para   "&#182;"> <!-- pilcrow sign = paragraph sign,
+                                  U+00B6 ISOnum -->
+<!ENTITY middot "&#183;"> <!-- middle dot = Georgian comma
+                                  = Greek middle dot, U+00B7 ISOnum -->
+<!ENTITY cedil  "&#184;"> <!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
+<!ENTITY sup1   "&#185;"> <!-- superscript one = superscript digit one,
+                                  U+00B9 ISOnum -->
+<!ENTITY ordm   "&#186;"> <!-- masculine ordinal indicator,
+                                  U+00BA ISOnum -->
+<!ENTITY raquo  "&#187;"> <!-- right-pointing double angle quotation mark
+                                  = right pointing guillemet, U+00BB ISOnum -->
+<!ENTITY frac14 "&#188;"> <!-- vulgar fraction one quarter
+                                  = fraction one quarter, U+00BC ISOnum -->
+<!ENTITY frac12 "&#189;"> <!-- vulgar fraction one half
+                                  = fraction one half, U+00BD ISOnum -->
+<!ENTITY frac34 "&#190;"> <!-- vulgar fraction three quarters
+                                  = fraction three quarters, U+00BE ISOnum -->
+<!ENTITY iquest "&#191;"> <!-- inverted question mark
+                                  = turned question mark, U+00BF ISOnum -->
+<!ENTITY Agrave "&#192;"> <!-- latin capital letter A with grave
+                                  = latin capital letter A grave,
+                                  U+00C0 ISOlat1 -->
+<!ENTITY Aacute "&#193;"> <!-- latin capital letter A with acute,
+                                  U+00C1 ISOlat1 -->
+<!ENTITY Acirc  "&#194;"> <!-- latin capital letter A with circumflex,
+                                  U+00C2 ISOlat1 -->
+<!ENTITY Atilde "&#195;"> <!-- latin capital letter A with tilde,
+                                  U+00C3 ISOlat1 -->
+<!ENTITY Auml   "&#196;"> <!-- latin capital letter A with diaeresis,
+                                  U+00C4 ISOlat1 -->
+<!ENTITY Aring  "&#197;"> <!-- latin capital letter A with ring above
+                                  = latin capital letter A ring,
+                                  U+00C5 ISOlat1 -->
+<!ENTITY AElig  "&#198;"> <!-- latin capital letter AE
+                                  = latin capital ligature AE,
+                                  U+00C6 ISOlat1 -->
+<!ENTITY Ccedil "&#199;"> <!-- latin capital letter C with cedilla,
+                                  U+00C7 ISOlat1 -->
+<!ENTITY Egrave "&#200;"> <!-- latin capital letter E with grave,
+                                  U+00C8 ISOlat1 -->
+<!ENTITY Eacute "&#201;"> <!-- latin capital letter E with acute,
+                                  U+00C9 ISOlat1 -->
+<!ENTITY Ecirc  "&#202;"> <!-- latin capital letter E with circumflex,
+                                  U+00CA ISOlat1 -->
+<!ENTITY Euml   "&#203;"> <!-- latin capital letter E with diaeresis,
+                                  U+00CB ISOlat1 -->
+<!ENTITY Igrave "&#204;"> <!-- latin capital letter I with grave,
+                                  U+00CC ISOlat1 -->
+<!ENTITY Iacute "&#205;"> <!-- latin capital letter I with acute,
+                                  U+00CD ISOlat1 -->
+<!ENTITY Icirc  "&#206;"> <!-- latin capital letter I with circumflex,
+                                  U+00CE ISOlat1 -->
+<!ENTITY Iuml   "&#207;"> <!-- latin capital letter I with diaeresis,
+                                  U+00CF ISOlat1 -->
+<!ENTITY ETH    "&#208;"> <!-- latin capital letter ETH, U+00D0 ISOlat1 -->
+<!ENTITY Ntilde "&#209;"> <!-- latin capital letter N with tilde,
+                                  U+00D1 ISOlat1 -->
+<!ENTITY Ograve "&#210;"> <!-- latin capital letter O with grave,
+                                  U+00D2 ISOlat1 -->
+<!ENTITY Oacute "&#211;"> <!-- latin capital letter O with acute,
+                                  U+00D3 ISOlat1 -->
+<!ENTITY Ocirc  "&#212;"> <!-- latin capital letter O with circumflex,
+                                  U+00D4 ISOlat1 -->
+<!ENTITY Otilde "&#213;"> <!-- latin capital letter O with tilde,
+                                  U+00D5 ISOlat1 -->
+<!ENTITY Ouml   "&#214;"> <!-- latin capital letter O with diaeresis,
+                                  U+00D6 ISOlat1 -->
+<!ENTITY times  "&#215;"> <!-- multiplication sign, U+00D7 ISOnum -->
+<!ENTITY Oslash "&#216;"> <!-- latin capital letter O with stroke
+                                  = latin capital letter O slash,
+                                  U+00D8 ISOlat1 -->
+<!ENTITY Ugrave "&#217;"> <!-- latin capital letter U with grave,
+                                  U+00D9 ISOlat1 -->
+<!ENTITY Uacute "&#218;"> <!-- latin capital letter U with acute,
+                                  U+00DA ISOlat1 -->
+<!ENTITY Ucirc  "&#219;"> <!-- latin capital letter U with circumflex,
+                                  U+00DB ISOlat1 -->
+<!ENTITY Uuml   "&#220;"> <!-- latin capital letter U with diaeresis,
+                                  U+00DC ISOlat1 -->
+<!ENTITY Yacute "&#221;"> <!-- latin capital letter Y with acute,
+                                  U+00DD ISOlat1 -->
+<!ENTITY THORN  "&#222;"> <!-- latin capital letter THORN,
+                                  U+00DE ISOlat1 -->
+<!ENTITY szlig  "&#223;"> <!-- latin small letter sharp s = ess-zed,
+                                  U+00DF ISOlat1 -->
+<!ENTITY agrave "&#224;"> <!-- latin small letter a with grave
+                                  = latin small letter a grave,
+                                  U+00E0 ISOlat1 -->
+<!ENTITY aacute "&#225;"> <!-- latin small letter a with acute,
+                                  U+00E1 ISOlat1 -->
+<!ENTITY acirc  "&#226;"> <!-- latin small letter a with circumflex,
+                                  U+00E2 ISOlat1 -->
+<!ENTITY atilde "&#227;"> <!-- latin small letter a with tilde,
+                                  U+00E3 ISOlat1 -->
+<!ENTITY auml   "&#228;"> <!-- latin small letter a with diaeresis,
+                                  U+00E4 ISOlat1 -->
+<!ENTITY aring  "&#229;"> <!-- latin small letter a with ring above
+                                  = latin small letter a ring,
+                                  U+00E5 ISOlat1 -->
+<!ENTITY aelig  "&#230;"> <!-- latin small letter ae
+                                  = latin small ligature ae, U+00E6 ISOlat1 -->
+<!ENTITY ccedil "&#231;"> <!-- latin small letter c with cedilla,
+                                  U+00E7 ISOlat1 -->
+<!ENTITY egrave "&#232;"> <!-- latin small letter e with grave,
+                                  U+00E8 ISOlat1 -->
+<!ENTITY eacute "&#233;"> <!-- latin small letter e with acute,
+                                  U+00E9 ISOlat1 -->
+<!ENTITY ecirc  "&#234;"> <!-- latin small letter e with circumflex,
+                                  U+00EA ISOlat1 -->
+<!ENTITY euml   "&#235;"> <!-- latin small letter e with diaeresis,
+                                  U+00EB ISOlat1 -->
+<!ENTITY igrave "&#236;"> <!-- latin small letter i with grave,
+                                  U+00EC ISOlat1 -->
+<!ENTITY iacute "&#237;"> <!-- latin small letter i with acute,
+                                  U+00ED ISOlat1 -->
+<!ENTITY icirc  "&#238;"> <!-- latin small letter i with circumflex,
+                                  U+00EE ISOlat1 -->
+<!ENTITY iuml   "&#239;"> <!-- latin small letter i with diaeresis,
+                                  U+00EF ISOlat1 -->
+<!ENTITY eth    "&#240;"> <!-- latin small letter eth, U+00F0 ISOlat1 -->
+<!ENTITY ntilde "&#241;"> <!-- latin small letter n with tilde,
+                                  U+00F1 ISOlat1 -->
+<!ENTITY ograve "&#242;"> <!-- latin small letter o with grave,
+                                  U+00F2 ISOlat1 -->
+<!ENTITY oacute "&#243;"> <!-- latin small letter o with acute,
+                                  U+00F3 ISOlat1 -->
+<!ENTITY ocirc  "&#244;"> <!-- latin small letter o with circumflex,
+                                  U+00F4 ISOlat1 -->
+<!ENTITY otilde "&#245;"> <!-- latin small letter o with tilde,
+                                  U+00F5 ISOlat1 -->
+<!ENTITY ouml   "&#246;"> <!-- latin small letter o with diaeresis,
+                                  U+00F6 ISOlat1 -->
+<!ENTITY divide "&#247;"> <!-- division sign, U+00F7 ISOnum -->
+<!ENTITY oslash "&#248;"> <!-- latin small letter o with stroke,
+                                  = latin small letter o slash,
+                                  U+00F8 ISOlat1 -->
+<!ENTITY ugrave "&#249;"> <!-- latin small letter u with grave,
+                                  U+00F9 ISOlat1 -->
+<!ENTITY uacute "&#250;"> <!-- latin small letter u with acute,
+                                  U+00FA ISOlat1 -->
+<!ENTITY ucirc  "&#251;"> <!-- latin small letter u with circumflex,
+                                  U+00FB ISOlat1 -->
+<!ENTITY uuml   "&#252;"> <!-- latin small letter u with diaeresis,
+                                  U+00FC ISOlat1 -->
+<!ENTITY yacute "&#253;"> <!-- latin small letter y with acute,
+                                  U+00FD ISOlat1 -->
+<!ENTITY thorn  "&#254;"> <!-- latin small letter thorn,
+                                  U+00FE ISOlat1 -->
+<!ENTITY yuml   "&#255;"> <!-- latin small letter y with diaeresis,
+                                  U+00FF ISOlat1 -->
\ No newline at end of file
diff --git a/xml/tests/testData/xml/xhtml-special.ent b/xml/tests/testData/xml/xhtml-special.ent
new file mode 100644
index 0000000..ca358b2
--- /dev/null
+++ b/xml/tests/testData/xml/xhtml-special.ent
@@ -0,0 +1,80 @@
+<!-- Special characters for XHTML -->
+
+<!-- Character entity set. Typical invocation:
+     <!ENTITY % HTMLspecial PUBLIC
+        "-//W3C//ENTITIES Special for XHTML//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
+     %HTMLspecial;
+-->
+
+<!-- Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+     New names (i.e., not in ISO 8879 list) do not clash with any
+     existing ISO 8879 entity names. ISO 10646 character numbers
+     are given for each character, in hex. values are decimal
+     conversions of the ISO 10646 values and refer to the document
+     character set. Names are Unicode names. 
+-->
+
+<!-- C0 Controls and Basic Latin -->
+<!ENTITY quot    "&#34;"> <!--  quotation mark, U+0022 ISOnum -->
+<!ENTITY amp     "&#38;#38;"> <!--  ampersand, U+0026 ISOnum -->
+<!ENTITY lt      "&#38;#60;"> <!--  less-than sign, U+003C ISOnum -->
+<!ENTITY gt      "&#62;"> <!--  greater-than sign, U+003E ISOnum -->
+<!ENTITY apos	 "&#39;"> <!--  apostrophe = APL quote, U+0027 ISOnum -->
+
+<!-- Latin Extended-A -->
+<!ENTITY OElig   "&#338;"> <!--  latin capital ligature OE,
+                                    U+0152 ISOlat2 -->
+<!ENTITY oelig   "&#339;"> <!--  latin small ligature oe, U+0153 ISOlat2 -->
+<!-- ligature is a misnomer, this is a separate character in some languages -->
+<!ENTITY Scaron  "&#352;"> <!--  latin capital letter S with caron,
+                                    U+0160 ISOlat2 -->
+<!ENTITY scaron  "&#353;"> <!--  latin small letter s with caron,
+                                    U+0161 ISOlat2 -->
+<!ENTITY Yuml    "&#376;"> <!--  latin capital letter Y with diaeresis,
+                                    U+0178 ISOlat2 -->
+
+<!-- Spacing Modifier Letters -->
+<!ENTITY circ    "&#710;"> <!--  modifier letter circumflex accent,
+                                    U+02C6 ISOpub -->
+<!ENTITY tilde   "&#732;"> <!--  small tilde, U+02DC ISOdia -->
+
+<!-- General Punctuation -->
+<!ENTITY ensp    "&#8194;"> <!-- en space, U+2002 ISOpub -->
+<!ENTITY emsp    "&#8195;"> <!-- em space, U+2003 ISOpub -->
+<!ENTITY thinsp  "&#8201;"> <!-- thin space, U+2009 ISOpub -->
+<!ENTITY zwnj    "&#8204;"> <!-- zero width non-joiner,
+                                    U+200C NEW RFC 2070 -->
+<!ENTITY zwj     "&#8205;"> <!-- zero width joiner, U+200D NEW RFC 2070 -->
+<!ENTITY lrm     "&#8206;"> <!-- left-to-right mark, U+200E NEW RFC 2070 -->
+<!ENTITY rlm     "&#8207;"> <!-- right-to-left mark, U+200F NEW RFC 2070 -->
+<!ENTITY ndash   "&#8211;"> <!-- en dash, U+2013 ISOpub -->
+<!ENTITY mdash   "&#8212;"> <!-- em dash, U+2014 ISOpub -->
+<!ENTITY lsquo   "&#8216;"> <!-- left single quotation mark,
+                                    U+2018 ISOnum -->
+<!ENTITY rsquo   "&#8217;"> <!-- right single quotation mark,
+                                    U+2019 ISOnum -->
+<!ENTITY sbquo   "&#8218;"> <!-- single low-9 quotation mark, U+201A NEW -->
+<!ENTITY ldquo   "&#8220;"> <!-- left double quotation mark,
+                                    U+201C ISOnum -->
+<!ENTITY rdquo   "&#8221;"> <!-- right double quotation mark,
+                                    U+201D ISOnum -->
+<!ENTITY bdquo   "&#8222;"> <!-- double low-9 quotation mark, U+201E NEW -->
+<!ENTITY dagger  "&#8224;"> <!-- dagger, U+2020 ISOpub -->
+<!ENTITY Dagger  "&#8225;"> <!-- double dagger, U+2021 ISOpub -->
+<!ENTITY permil  "&#8240;"> <!-- per mille sign, U+2030 ISOtech -->
+<!ENTITY lsaquo  "&#8249;"> <!-- single left-pointing angle quotation mark,
+                                    U+2039 ISO proposed -->
+<!-- lsaquo is proposed but not yet ISO standardized -->
+<!ENTITY rsaquo  "&#8250;"> <!-- single right-pointing angle quotation mark,
+                                    U+203A ISO proposed -->
+<!-- rsaquo is proposed but not yet ISO standardized -->
+
+<!-- Currency Symbols -->
+<!ENTITY euro   "&#8364;"> <!--  euro sign, U+20AC NEW -->
diff --git a/xml/tests/testData/xml/xhtml-symbol.ent b/xml/tests/testData/xml/xhtml-symbol.ent
new file mode 100644
index 0000000..63c2abf
--- /dev/null
+++ b/xml/tests/testData/xml/xhtml-symbol.ent
@@ -0,0 +1,237 @@
+<!-- Mathematical, Greek and Symbolic characters for XHTML -->
+
+<!-- Character entity set. Typical invocation:
+     <!ENTITY % HTMLsymbol PUBLIC
+        "-//W3C//ENTITIES Symbols for XHTML//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent">
+     %HTMLsymbol;
+-->
+
+<!-- Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+     New names (i.e., not in ISO 8879 list) do not clash with any
+     existing ISO 8879 entity names. ISO 10646 character numbers
+     are given for each character, in hex. values are decimal
+     conversions of the ISO 10646 values and refer to the document
+     character set. Names are Unicode names. 
+-->
+
+<!-- Latin Extended-B -->
+<!ENTITY fnof     "&#402;"> <!-- latin small letter f with hook = function
+                                    = florin, U+0192 ISOtech -->
+
+<!-- Greek -->
+<!ENTITY Alpha    "&#913;"> <!-- greek capital letter alpha, U+0391 -->
+<!ENTITY Beta     "&#914;"> <!-- greek capital letter beta, U+0392 -->
+<!ENTITY Gamma    "&#915;"> <!-- greek capital letter gamma,
+                                    U+0393 ISOgrk3 -->
+<!ENTITY Delta    "&#916;"> <!-- greek capital letter delta,
+                                    U+0394 ISOgrk3 -->
+<!ENTITY Epsilon  "&#917;"> <!-- greek capital letter epsilon, U+0395 -->
+<!ENTITY Zeta     "&#918;"> <!-- greek capital letter zeta, U+0396 -->
+<!ENTITY Eta      "&#919;"> <!-- greek capital letter eta, U+0397 -->
+<!ENTITY Theta    "&#920;"> <!-- greek capital letter theta,
+                                    U+0398 ISOgrk3 -->
+<!ENTITY Iota     "&#921;"> <!-- greek capital letter iota, U+0399 -->
+<!ENTITY Kappa    "&#922;"> <!-- greek capital letter kappa, U+039A -->
+<!ENTITY Lambda   "&#923;"> <!-- greek capital letter lamda,
+                                    U+039B ISOgrk3 -->
+<!ENTITY Mu       "&#924;"> <!-- greek capital letter mu, U+039C -->
+<!ENTITY Nu       "&#925;"> <!-- greek capital letter nu, U+039D -->
+<!ENTITY Xi       "&#926;"> <!-- greek capital letter xi, U+039E ISOgrk3 -->
+<!ENTITY Omicron  "&#927;"> <!-- greek capital letter omicron, U+039F -->
+<!ENTITY Pi       "&#928;"> <!-- greek capital letter pi, U+03A0 ISOgrk3 -->
+<!ENTITY Rho      "&#929;"> <!-- greek capital letter rho, U+03A1 -->
+<!-- there is no Sigmaf, and no U+03A2 character either -->
+<!ENTITY Sigma    "&#931;"> <!-- greek capital letter sigma,
+                                    U+03A3 ISOgrk3 -->
+<!ENTITY Tau      "&#932;"> <!-- greek capital letter tau, U+03A4 -->
+<!ENTITY Upsilon  "&#933;"> <!-- greek capital letter upsilon,
+                                    U+03A5 ISOgrk3 -->
+<!ENTITY Phi      "&#934;"> <!-- greek capital letter phi,
+                                    U+03A6 ISOgrk3 -->
+<!ENTITY Chi      "&#935;"> <!-- greek capital letter chi, U+03A7 -->
+<!ENTITY Psi      "&#936;"> <!-- greek capital letter psi,
+                                    U+03A8 ISOgrk3 -->
+<!ENTITY Omega    "&#937;"> <!-- greek capital letter omega,
+                                    U+03A9 ISOgrk3 -->
+
+<!ENTITY alpha    "&#945;"> <!-- greek small letter alpha,
+                                    U+03B1 ISOgrk3 -->
+<!ENTITY beta     "&#946;"> <!-- greek small letter beta, U+03B2 ISOgrk3 -->
+<!ENTITY gamma    "&#947;"> <!-- greek small letter gamma,
+                                    U+03B3 ISOgrk3 -->
+<!ENTITY delta    "&#948;"> <!-- greek small letter delta,
+                                    U+03B4 ISOgrk3 -->
+<!ENTITY epsilon  "&#949;"> <!-- greek small letter epsilon,
+                                    U+03B5 ISOgrk3 -->
+<!ENTITY zeta     "&#950;"> <!-- greek small letter zeta, U+03B6 ISOgrk3 -->
+<!ENTITY eta      "&#951;"> <!-- greek small letter eta, U+03B7 ISOgrk3 -->
+<!ENTITY theta    "&#952;"> <!-- greek small letter theta,
+                                    U+03B8 ISOgrk3 -->
+<!ENTITY iota     "&#953;"> <!-- greek small letter iota, U+03B9 ISOgrk3 -->
+<!ENTITY kappa    "&#954;"> <!-- greek small letter kappa,
+                                    U+03BA ISOgrk3 -->
+<!ENTITY lambda   "&#955;"> <!-- greek small letter lamda,
+                                    U+03BB ISOgrk3 -->
+<!ENTITY mu       "&#956;"> <!-- greek small letter mu, U+03BC ISOgrk3 -->
+<!ENTITY nu       "&#957;"> <!-- greek small letter nu, U+03BD ISOgrk3 -->
+<!ENTITY xi       "&#958;"> <!-- greek small letter xi, U+03BE ISOgrk3 -->
+<!ENTITY omicron  "&#959;"> <!-- greek small letter omicron, U+03BF NEW -->
+<!ENTITY pi       "&#960;"> <!-- greek small letter pi, U+03C0 ISOgrk3 -->
+<!ENTITY rho      "&#961;"> <!-- greek small letter rho, U+03C1 ISOgrk3 -->
+<!ENTITY sigmaf   "&#962;"> <!-- greek small letter final sigma,
+                                    U+03C2 ISOgrk3 -->
+<!ENTITY sigma    "&#963;"> <!-- greek small letter sigma,
+                                    U+03C3 ISOgrk3 -->
+<!ENTITY tau      "&#964;"> <!-- greek small letter tau, U+03C4 ISOgrk3 -->
+<!ENTITY upsilon  "&#965;"> <!-- greek small letter upsilon,
+                                    U+03C5 ISOgrk3 -->
+<!ENTITY phi      "&#966;"> <!-- greek small letter phi, U+03C6 ISOgrk3 -->
+<!ENTITY chi      "&#967;"> <!-- greek small letter chi, U+03C7 ISOgrk3 -->
+<!ENTITY psi      "&#968;"> <!-- greek small letter psi, U+03C8 ISOgrk3 -->
+<!ENTITY omega    "&#969;"> <!-- greek small letter omega,
+                                    U+03C9 ISOgrk3 -->
+<!ENTITY thetasym "&#977;"> <!-- greek theta symbol,
+                                    U+03D1 NEW -->
+<!ENTITY upsih    "&#978;"> <!-- greek upsilon with hook symbol,
+                                    U+03D2 NEW -->
+<!ENTITY piv      "&#982;"> <!-- greek pi symbol, U+03D6 ISOgrk3 -->
+
+<!-- General Punctuation -->
+<!ENTITY bull     "&#8226;"> <!-- bullet = black small circle,
+                                     U+2022 ISOpub  -->
+<!-- bullet is NOT the same as bullet operator, U+2219 -->
+<!ENTITY hellip   "&#8230;"> <!-- horizontal ellipsis = three dot leader,
+                                     U+2026 ISOpub  -->
+<!ENTITY prime    "&#8242;"> <!-- prime = minutes = feet, U+2032 ISOtech -->
+<!ENTITY Prime    "&#8243;"> <!-- double prime = seconds = inches,
+                                     U+2033 ISOtech -->
+<!ENTITY oline    "&#8254;"> <!-- overline = spacing overscore,
+                                     U+203E NEW -->
+<!ENTITY frasl    "&#8260;"> <!-- fraction slash, U+2044 NEW -->
+
+<!-- Letterlike Symbols -->
+<!ENTITY weierp   "&#8472;"> <!-- script capital P = power set
+                                     = Weierstrass p, U+2118 ISOamso -->
+<!ENTITY image    "&#8465;"> <!-- black-letter capital I = imaginary part,
+                                     U+2111 ISOamso -->
+<!ENTITY real     "&#8476;"> <!-- black-letter capital R = real part symbol,
+                                     U+211C ISOamso -->
+<!ENTITY trade    "&#8482;"> <!-- trade mark sign, U+2122 ISOnum -->
+<!ENTITY alefsym  "&#8501;"> <!-- alef symbol = first transfinite cardinal,
+                                     U+2135 NEW -->
+<!-- alef symbol is NOT the same as hebrew letter alef,
+     U+05D0 although the same glyph could be used to depict both characters -->
+
+<!-- Arrows -->
+<!ENTITY larr     "&#8592;"> <!-- leftwards arrow, U+2190 ISOnum -->
+<!ENTITY uarr     "&#8593;"> <!-- upwards arrow, U+2191 ISOnum-->
+<!ENTITY rarr     "&#8594;"> <!-- rightwards arrow, U+2192 ISOnum -->
+<!ENTITY darr     "&#8595;"> <!-- downwards arrow, U+2193 ISOnum -->
+<!ENTITY harr     "&#8596;"> <!-- left right arrow, U+2194 ISOamsa -->
+<!ENTITY crarr    "&#8629;"> <!-- downwards arrow with corner leftwards
+                                     = carriage return, U+21B5 NEW -->
+<!ENTITY lArr     "&#8656;"> <!-- leftwards double arrow, U+21D0 ISOtech -->
+<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow
+    but also does not have any other character for that function. So lArr can
+    be used for 'is implied by' as ISOtech suggests -->
+<!ENTITY uArr     "&#8657;"> <!-- upwards double arrow, U+21D1 ISOamsa -->
+<!ENTITY rArr     "&#8658;"> <!-- rightwards double arrow,
+                                     U+21D2 ISOtech -->
+<!-- Unicode does not say this is the 'implies' character but does not have 
+     another character with this function so rArr can be used for 'implies'
+     as ISOtech suggests -->
+<!ENTITY dArr     "&#8659;"> <!-- downwards double arrow, U+21D3 ISOamsa -->
+<!ENTITY hArr     "&#8660;"> <!-- left right double arrow,
+                                     U+21D4 ISOamsa -->
+
+<!-- Mathematical Operators -->
+<!ENTITY forall   "&#8704;"> <!-- for all, U+2200 ISOtech -->
+<!ENTITY part     "&#8706;"> <!-- partial differential, U+2202 ISOtech  -->
+<!ENTITY exist    "&#8707;"> <!-- there exists, U+2203 ISOtech -->
+<!ENTITY empty    "&#8709;"> <!-- empty set = null set, U+2205 ISOamso -->
+<!ENTITY nabla    "&#8711;"> <!-- nabla = backward difference,
+                                     U+2207 ISOtech -->
+<!ENTITY isin     "&#8712;"> <!-- element of, U+2208 ISOtech -->
+<!ENTITY notin    "&#8713;"> <!-- not an element of, U+2209 ISOtech -->
+<!ENTITY ni       "&#8715;"> <!-- contains as member, U+220B ISOtech -->
+<!ENTITY prod     "&#8719;"> <!-- n-ary product = product sign,
+                                     U+220F ISOamsb -->
+<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
+     the same glyph might be used for both -->
+<!ENTITY sum      "&#8721;"> <!-- n-ary summation, U+2211 ISOamsb -->
+<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
+     though the same glyph might be used for both -->
+<!ENTITY minus    "&#8722;"> <!-- minus sign, U+2212 ISOtech -->
+<!ENTITY lowast   "&#8727;"> <!-- asterisk operator, U+2217 ISOtech -->
+<!ENTITY radic    "&#8730;"> <!-- square root = radical sign,
+                                     U+221A ISOtech -->
+<!ENTITY prop     "&#8733;"> <!-- proportional to, U+221D ISOtech -->
+<!ENTITY infin    "&#8734;"> <!-- infinity, U+221E ISOtech -->
+<!ENTITY ang      "&#8736;"> <!-- angle, U+2220 ISOamso -->
+<!ENTITY and      "&#8743;"> <!-- logical and = wedge, U+2227 ISOtech -->
+<!ENTITY or       "&#8744;"> <!-- logical or = vee, U+2228 ISOtech -->
+<!ENTITY cap      "&#8745;"> <!-- intersection = cap, U+2229 ISOtech -->
+<!ENTITY cup      "&#8746;"> <!-- union = cup, U+222A ISOtech -->
+<!ENTITY int      "&#8747;"> <!-- integral, U+222B ISOtech -->
+<!ENTITY there4   "&#8756;"> <!-- therefore, U+2234 ISOtech -->
+<!ENTITY sim      "&#8764;"> <!-- tilde operator = varies with = similar to,
+                                     U+223C ISOtech -->
+<!-- tilde operator is NOT the same character as the tilde, U+007E,
+     although the same glyph might be used to represent both  -->
+<!ENTITY cong     "&#8773;"> <!-- approximately equal to, U+2245 ISOtech -->
+<!ENTITY asymp    "&#8776;"> <!-- almost equal to = asymptotic to,
+                                     U+2248 ISOamsr -->
+<!ENTITY ne       "&#8800;"> <!-- not equal to, U+2260 ISOtech -->
+<!ENTITY equiv    "&#8801;"> <!-- identical to, U+2261 ISOtech -->
+<!ENTITY le       "&#8804;"> <!-- less-than or equal to, U+2264 ISOtech -->
+<!ENTITY ge       "&#8805;"> <!-- greater-than or equal to,
+                                     U+2265 ISOtech -->
+<!ENTITY sub      "&#8834;"> <!-- subset of, U+2282 ISOtech -->
+<!ENTITY sup      "&#8835;"> <!-- superset of, U+2283 ISOtech -->
+<!ENTITY nsub     "&#8836;"> <!-- not a subset of, U+2284 ISOamsn -->
+<!ENTITY sube     "&#8838;"> <!-- subset of or equal to, U+2286 ISOtech -->
+<!ENTITY supe     "&#8839;"> <!-- superset of or equal to,
+                                     U+2287 ISOtech -->
+<!ENTITY oplus    "&#8853;"> <!-- circled plus = direct sum,
+                                     U+2295 ISOamsb -->
+<!ENTITY otimes   "&#8855;"> <!-- circled times = vector product,
+                                     U+2297 ISOamsb -->
+<!ENTITY perp     "&#8869;"> <!-- up tack = orthogonal to = perpendicular,
+                                     U+22A5 ISOtech -->
+<!ENTITY sdot     "&#8901;"> <!-- dot operator, U+22C5 ISOamsb -->
+<!-- dot operator is NOT the same character as U+00B7 middle dot -->
+
+<!-- Miscellaneous Technical -->
+<!ENTITY lceil    "&#8968;"> <!-- left ceiling = APL upstile,
+                                     U+2308 ISOamsc  -->
+<!ENTITY rceil    "&#8969;"> <!-- right ceiling, U+2309 ISOamsc  -->
+<!ENTITY lfloor   "&#8970;"> <!-- left floor = APL downstile,
+                                     U+230A ISOamsc  -->
+<!ENTITY rfloor   "&#8971;"> <!-- right floor, U+230B ISOamsc  -->
+<!ENTITY lang     "&#9001;"> <!-- left-pointing angle bracket = bra,
+                                     U+2329 ISOtech -->
+<!-- lang is NOT the same character as U+003C 'less than sign' 
+     or U+2039 'single left-pointing angle quotation mark' -->
+<!ENTITY rang     "&#9002;"> <!-- right-pointing angle bracket = ket,
+                                     U+232A ISOtech -->
+<!-- rang is NOT the same character as U+003E 'greater than sign' 
+     or U+203A 'single right-pointing angle quotation mark' -->
+
+<!-- Geometric Shapes -->
+<!ENTITY loz      "&#9674;"> <!-- lozenge, U+25CA ISOpub -->
+
+<!-- Miscellaneous Symbols -->
+<!ENTITY spades   "&#9824;"> <!-- black spade suit, U+2660 ISOpub -->
+<!-- black here seems to mean filled as opposed to hollow -->
+<!ENTITY clubs    "&#9827;"> <!-- black club suit = shamrock,
+                                     U+2663 ISOpub -->
+<!ENTITY hearts   "&#9829;"> <!-- black heart suit = valentine,
+                                     U+2665 ISOpub -->
+<!ENTITY diams    "&#9830;"> <!-- black diamond suit, U+2666 ISOpub -->
diff --git a/xml/tests/testData/xml/xhtml1-transitional.xsd b/xml/tests/testData/xml/xhtml1-transitional.xsd
new file mode 100644
index 0000000..2137115
--- /dev/null
+++ b/xml/tests/testData/xml/xhtml1-transitional.xsd
@@ -0,0 +1,2773 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xs:schema [
+<!ENTITY % HTMLlat1 PUBLIC
+       "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+       "xhtml-lat1.ent">
+    %HTMLlat1;
+
+    <!ENTITY % HTMLsymbol PUBLIC
+       "-//W3C//ENTITIES Symbols for XHTML//EN"
+       "xhtml-symbol.ent">
+    %HTMLsymbol;
+
+    <!ENTITY % HTMLspecial PUBLIC
+       "-//W3C//ENTITIES Special for XHTML//EN"
+       "xhtml-special.ent">
+    %HTMLspecial;
+]>
+
+<xs:schema version="1.0" xml:lang="en"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.w3.org/1999/xhtml"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:xml="http://www.w3.org/XML/1998/namespace"
+    elementFormDefault="qualified">
+
+  <xs:annotation>
+    <xs:documentation>
+    XHTML 1.0 (Second Edition) Transitional in XML Schema
+
+    This is the same as HTML 4 Transitional except for
+    changes due to the differences between XML and SGML.
+
+    Namespace = http://www.w3.org/1999/xhtml
+
+    For further information, see: http://www.w3.org/TR/xhtml1
+
+    Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
+    All Rights Reserved.
+
+    The DTD version is identified by the PUBLIC and SYSTEM identifiers:
+
+    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+
+    $Id: xhtml1-transitional.xsd,v 1.5 2002/08/28 09:53:29 mimasa Exp $
+    </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>
+    ================ Character mnemonic entities =========================
+
+    XHTML entity sets are identified by the PUBLIC and SYSTEM identifiers:
+
+    PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent"
+
+    PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent"
+
+    PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+    SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent"
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Imported Names ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="ContentType">
+    <xs:annotation>
+      <xs:documentation>
+      media type, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="ContentTypes">
+    <xs:annotation>
+      <xs:documentation>
+      comma-separated list of media types, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Charset">
+    <xs:annotation>
+      <xs:documentation>
+      a character encoding, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Charsets">
+    <xs:annotation>
+      <xs:documentation>
+      a space separated list of character encodings, as per [RFC2045]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="LanguageCode">
+    <xs:annotation>
+      <xs:documentation>
+      a language code, as per [RFC3066]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:language"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Character">
+    <xs:annotation>
+      <xs:documentation>
+      a single character, as per section 2.2 of [XML]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:length value="1" fixed="true"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Number">
+    <xs:annotation>
+      <xs:documentation>
+      one or more digits
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger">
+      <xs:pattern value="[0-9]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="tabindexNumber">
+    <xs:annotation>
+      <xs:documentation>
+      tabindex attribute specifies the position of the current element
+      in the tabbing order for the current document. This value must be
+      a number between 0 and 32767. User agents should ignore leading zeros.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="Number">
+      <xs:minInclusive value="0"/>
+      <xs:maxInclusive value="32767"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="LinkTypes">
+    <xs:annotation>
+      <xs:documentation>
+      space-separated list of link types
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKENS"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="MediaDesc">
+    <xs:annotation>
+      <xs:documentation>
+      single or comma-separated list of media descriptors
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[^,]+(,\s*[^,]+)*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="URI">
+    <xs:annotation>
+      <xs:documentation>
+      a Uniform Resource Identifier, see [RFC2396]
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:anyURI"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="UriList">
+    <xs:annotation>
+      <xs:documentation>
+      a space separated list of Uniform Resource Identifiers
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Datetime">
+    <xs:annotation>
+      <xs:documentation>
+      date and time information. ISO date format
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:dateTime"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Script">
+    <xs:annotation>
+      <xs:documentation>
+      script expression
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="StyleSheet">
+    <xs:annotation>
+      <xs:documentation>
+      style sheet data
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Text">
+    <xs:annotation>
+      <xs:documentation>
+      used for titles etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="FrameTarget">
+    <xs:annotation>
+      <xs:documentation>
+      render in this frame
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKEN">
+      <xs:pattern value="_(blank|self|parent|top)|[A-Za-z]\c*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Length">
+    <xs:annotation>
+      <xs:documentation>
+      nn for pixels or nn% for percentage length
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[-+]?(\d+|\d+(\.\d+)?%)"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="MultiLength">
+    <xs:annotation>
+      <xs:documentation>
+      pixel, percentage, or relative
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Pixels">
+    <xs:annotation>
+      <xs:documentation>
+      integer representing length in pixels
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger"/>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    these are used for image maps
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="Shape">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="rect"/>
+      <xs:enumeration value="circle"/>
+      <xs:enumeration value="poly"/>
+      <xs:enumeration value="default"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Coords">
+    <xs:annotation>
+      <xs:documentation>
+      comma separated list of lengths
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern
+          value="[-+]?(\d+|\d+(\.\d+)?%)(,\s*[-+]?(\d+|\d+(\.\d+)?%))*"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="ImgAlign">
+    <xs:annotation>
+      <xs:documentation>
+      used for object, applet, img, input and iframe
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="top"/>
+      <xs:enumeration value="middle"/>
+      <xs:enumeration value="bottom"/>
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Color">
+    <xs:annotation>
+      <xs:documentation>
+      a color using sRGB: #RRGGBB as Hex values
+
+      There are also 16 widely known color names with their sRGB values:
+
+      Black  = #000000    Green  = #008000
+      Silver = #C0C0C0    Lime   = #00FF00
+      Gray   = #808080    Olive  = #808000
+      White  = #FFFFFF    Yellow = #FFFF00
+      Maroon = #800000    Navy   = #000080
+      Red    = #FF0000    Blue   = #0000FF
+      Purple = #800080    Teal   = #008080
+      Fuchsia= #FF00FF    Aqua   = #00FFFF
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[A-Za-z]+|#[0-9A-Fa-f]{3}|#[0-9A-Fa-f]{6}"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Generic Attributes ===============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attributeGroup name="coreattrs">
+    <xs:annotation>
+      <xs:documentation>
+      core attributes common to most elements
+      id       document-wide unique id
+      class    space separated list of classes
+      style    associated style info
+      title    advisory title/amplification
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="id" type="xs:ID"/>
+    <xs:attribute name="class" type="xs:NMTOKENS"/>
+    <xs:attribute name="style" type="StyleSheet"/>
+    <xs:attribute name="title" type="Text"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="i18n">
+    <xs:annotation>
+      <xs:documentation>
+      internationalization attributes
+      lang        language code (backwards compatible)
+      xml:lang    language code (as per XML 1.0 spec)
+      dir         direction for weak/neutral text
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="lang" type="LanguageCode"/>
+    <xs:attribute ref="xml:lang"/>
+    <xs:attribute name="dir">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="ltr"/>
+          <xs:enumeration value="rtl"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="events">
+    <xs:annotation>
+      <xs:documentation>
+      attributes for common UI events
+      onclick     a pointer button was clicked
+      ondblclick  a pointer button was double clicked
+      onmousedown a pointer button was pressed down
+      onmouseup   a pointer button was released
+      onmousemove a pointer was moved onto the element
+      onmouseout  a pointer was moved away from the element
+      onkeypress  a key was pressed and released
+      onkeydown   a key was pressed down
+      onkeyup     a key was released
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="onclick" type="Script"/>
+    <xs:attribute name="ondblclick" type="Script"/>
+    <xs:attribute name="onmousedown" type="Script"/>
+    <xs:attribute name="onmouseup" type="Script"/>
+    <xs:attribute name="onmouseover" type="Script"/>
+    <xs:attribute name="onmousemove" type="Script"/>
+    <xs:attribute name="onmouseout" type="Script"/>
+    <xs:attribute name="onkeypress" type="Script"/>
+    <xs:attribute name="onkeydown" type="Script"/>
+    <xs:attribute name="onkeyup" type="Script"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="focus">
+    <xs:annotation>
+      <xs:documentation>
+      attributes for elements that can get the focus
+      accesskey   accessibility key character
+      tabindex    position in tabbing order
+      onfocus     the element got the focus
+      onblur      the element lost the focus
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="accesskey" type="Character"/>
+    <xs:attribute name="tabindex" type="tabindexNumber"/>
+    <xs:attribute name="onfocus" type="Script"/>
+    <xs:attribute name="onblur" type="Script"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="attrs">
+    <xs:attributeGroup ref="coreattrs"/>
+    <xs:attributeGroup ref="i18n"/>
+    <xs:attributeGroup ref="events"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="TextAlign">
+    <xs:annotation>
+      <xs:documentation>
+      text alignment for p, div, h1-h6. The default is
+      align="left" for ltr headings, "right" for rtl
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="align">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="left"/>
+          <xs:enumeration value="center"/>
+          <xs:enumeration value="right"/>
+          <xs:enumeration value="justify"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Text Elements ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="special.extra">
+    <xs:choice>
+      <xs:element ref="object"/>
+      <xs:element ref="applet"/>
+      <xs:element ref="img"/>
+      <xs:element ref="map"/>
+      <xs:element ref="iframe"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="special.basic">
+    <xs:choice>
+      <xs:element ref="br"/>
+      <xs:element ref="span"/>
+      <xs:element ref="bdo"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="special">
+    <xs:choice>
+      <xs:group ref="special.basic"/>
+      <xs:group ref="special.extra"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle.extra">
+    <xs:choice>
+      <xs:element ref="big"/>
+      <xs:element ref="small"/>
+      <xs:element ref="font"/>
+      <xs:element ref="basefont"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle.basic">
+    <xs:choice>
+      <xs:element ref="tt"/>
+      <xs:element ref="i"/>
+      <xs:element ref="b"/>
+      <xs:element ref="u"/>
+      <xs:element ref="s"/>
+      <xs:element ref="strike"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="fontstyle">
+    <xs:choice>
+      <xs:group ref="fontstyle.basic"/>
+      <xs:group ref="fontstyle.extra"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase.extra">
+    <xs:choice>
+      <xs:element ref="sub"/>
+      <xs:element ref="sup"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase.basic">
+    <xs:choice>
+      <xs:element ref="em"/>
+      <xs:element ref="strong"/>
+      <xs:element ref="dfn"/>
+      <xs:element ref="code"/>
+      <xs:element ref="q"/>
+      <xs:element ref="samp"/>
+      <xs:element ref="kbd"/>
+      <xs:element ref="var"/>
+      <xs:element ref="cite"/>
+      <xs:element ref="abbr"/>
+      <xs:element ref="acronym"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="phrase">
+    <xs:choice>
+      <xs:group ref="phrase.basic"/>
+      <xs:group ref="phrase.extra"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="inline.forms">
+    <xs:choice>
+      <xs:element ref="input"/>
+      <xs:element ref="select"/>
+      <xs:element ref="textarea"/>
+      <xs:element ref="label"/>
+      <xs:element ref="button"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="misc.inline">
+    <xs:annotation>
+      <xs:documentation>
+      these can only occur at block level
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:element ref="ins"/>
+      <xs:element ref="del"/>
+      <xs:element ref="script"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="misc">
+    <xs:annotation>
+      <xs:documentation>
+      these can only occur at block level
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice>
+      <xs:element ref="noscript"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="inline">
+    <xs:choice>
+      <xs:element ref="a"/>
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="inline.forms"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="Inline" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      "Inline" covers inline or "text-level" element
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="inline"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Block level elements ==============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="heading">
+    <xs:choice>
+      <xs:element ref="h1"/>
+      <xs:element ref="h2"/>
+      <xs:element ref="h3"/>
+      <xs:element ref="h4"/>
+      <xs:element ref="h5"/>
+      <xs:element ref="h6"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="lists">
+    <xs:choice>
+      <xs:element ref="ul"/>
+      <xs:element ref="ol"/>
+      <xs:element ref="dl"/>
+      <xs:element ref="menu"/>
+      <xs:element ref="dir"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="blocktext">
+    <xs:choice>
+      <xs:element ref="pre"/>
+      <xs:element ref="hr"/>
+      <xs:element ref="blockquote"/>
+      <xs:element ref="address"/>
+      <xs:element ref="center"/>
+      <xs:element ref="noframes"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:group name="block">
+    <xs:choice>
+      <xs:element ref="p"/>
+      <xs:group ref="heading"/>
+      <xs:element ref="div"/>
+      <xs:group ref="lists"/>
+      <xs:group ref="blocktext"/>
+      <xs:element ref="isindex"/>
+      <xs:element ref="fieldset"/>
+      <xs:element ref="table"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:complexType name="Flow" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      "Flow" mixes block and inline and is used for list items etc.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:element ref="form"/>
+      <xs:group ref="inline"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Content models for exclusions =====================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:complexType name="a.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      a elements use "Inline" excluding a
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="special"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="inline.forms"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="pre.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      pre uses "Inline" excluding img, object, applet, big, small,
+      font, or basefont
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="a"/>
+      <xs:group ref="special.basic"/>
+      <xs:group ref="fontstyle.basic"/>
+      <xs:group ref="phrase.basic"/>
+      <xs:group ref="inline.forms"/>
+      <xs:group ref="misc.inline"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="form.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      form uses "Flow" excluding form
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:group ref="block"/>
+      <xs:group ref="inline"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:complexType name="button.content" mixed="true">
+    <xs:annotation>
+      <xs:documentation>
+      button uses "Flow" but excludes a, form, form controls, iframe
+      </xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="p"/>
+      <xs:group ref="heading"/>
+      <xs:element ref="div"/>
+      <xs:group ref="lists"/>
+      <xs:group ref="blocktext"/>
+      <xs:element ref="table"/>
+      <xs:element ref="br"/>
+      <xs:element ref="span"/>
+      <xs:element ref="bdo"/>
+      <xs:element ref="object"/>
+      <xs:element ref="applet"/>
+      <xs:element ref="img"/>
+      <xs:element ref="map"/>
+      <xs:group ref="fontstyle"/>
+      <xs:group ref="phrase"/>
+      <xs:group ref="misc"/>
+    </xs:choice>
+  </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Document Structure ==================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="html">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="head"/>
+        <xs:element ref="body"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Document Head =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:group name="head.misc">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="script"/>
+        <xs:element ref="style"/>
+        <xs:element ref="meta"/>
+        <xs:element ref="link"/>
+        <xs:element ref="object"/>
+        <xs:element ref="isindex"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:group>
+
+  <xs:element name="head">
+    <xs:annotation>
+      <xs:documentation>
+      content model is "head.misc" combined with a single
+      title and an optional base element in any order
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="head.misc"/>
+        <xs:choice>
+          <xs:sequence>
+            <xs:element ref="title"/>
+            <xs:group ref="head.misc"/>
+            <xs:sequence minOccurs="0">
+              <xs:element ref="base"/>
+              <xs:group ref="head.misc"/>
+            </xs:sequence>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element ref="base"/>
+            <xs:group ref="head.misc"/>
+            <xs:element ref="title"/>
+            <xs:group ref="head.misc"/>
+          </xs:sequence>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="profile" type="URI"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="title">
+    <xs:annotation>
+      <xs:documentation>
+      The title element is not considered part of the flow of text.
+      It should be displayed, for example as the page header or
+      window title. Exactly one title is required per document.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="base">
+    <xs:annotation>
+      <xs:documentation>
+      document base URI
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="target" type="FrameTarget"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="meta">
+    <xs:annotation>
+      <xs:documentation>
+      generic metainformation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="http-equiv"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="content" use="required"/>
+      <xs:attribute name="scheme"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="link">
+    <xs:annotation>
+      <xs:documentation>
+      Relationship values can be used in principle:
+
+      a) for document specific toolbars/menus when used
+         with the link element in document head e.g.
+           start, contents, previous, next, index, end, help
+      b) to link to a separate style sheet (rel="stylesheet")
+      c) to make a link to a script (rel="script")
+      d) by stylesheets to control how collections of
+         html nodes are rendered into printed documents
+      e) to make a link to a printable version of this document
+         e.g. a PostScript or PDF version (rel="alternate" media="print")
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="charset" type="Charset"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="hreflang" type="LanguageCode"/>
+      <xs:attribute name="type" type="ContentType"/>
+      <xs:attribute name="rel" type="LinkTypes"/>
+      <xs:attribute name="rev" type="LinkTypes"/>
+      <xs:attribute name="media" type="MediaDesc"/>
+      <xs:attribute name="target" type="FrameTarget"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="style">
+    <xs:annotation>
+      <xs:documentation>
+      style info, which may include CDATA sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="type" use="required" type="ContentType"/>
+      <xs:attribute name="media" type="MediaDesc"/>
+      <xs:attribute name="title" type="Text"/>
+      <xs:attribute ref="xml:space" fixed="preserve"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="script">
+    <xs:annotation>
+      <xs:documentation>
+      script statements, which may include CDATA sections
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="charset" type="Charset"/>
+      <xs:attribute name="type" use="required" type="ContentType"/>
+      <xs:attribute name="language"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="defer">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="defer"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute ref="xml:space" fixed="preserve"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="noscript">
+    <xs:annotation>
+      <xs:documentation>
+      alternate content container for non script-based rendering
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ======================= Frames =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="iframe">
+    <xs:annotation>
+      <xs:documentation>
+      inline subwindow
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attribute name="longdesc" type="URI"/>
+          <xs:attribute name="name" type="xs:NMTOKEN"/>
+          <xs:attribute name="src" type="URI"/>
+          <xs:attribute name="frameborder" default="1">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="1"/>
+                <xs:enumeration value="0"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="marginwidth" type="Pixels"/>
+          <xs:attribute name="marginheight" type="Pixels"/>
+          <xs:attribute name="scrolling" default="auto">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="yes"/>
+                <xs:enumeration value="no"/>
+                <xs:enumeration value="auto"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="align" type="ImgAlign"/>
+          <xs:attribute name="height" type="Length"/>
+          <xs:attribute name="width" type="Length"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="noframes">
+    <xs:annotation>
+      <xs:documentation>
+      alternate content container for non frame-based rendering
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Document Body ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="body">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="onload" type="Script"/>
+          <xs:attribute name="onunload" type="Script"/>
+          <xs:attribute name="background" type="URI"/>
+          <xs:attribute name="bgcolor" type="Color"/>
+          <xs:attribute name="text" type="Color"/>
+          <xs:attribute name="link" type="Color"/>
+          <xs:attribute name="vlink" type="Color"/>
+          <xs:attribute name="alink" type="Color"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="div">
+    <xs:annotation>
+      <xs:documentation>
+      generic language/style container
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Paragraphs =======================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="p">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Headings =========================================
+
+    There are six levels of headings from h1 (the most important)
+    to h6 (the least important).
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="h1">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h2">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h3">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h4">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h5">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="h6">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="TextAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Lists ============================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="ULStyle">
+    <xs:annotation>
+      <xs:documentation>
+      Unordered list bullet styles
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="disc"/>
+      <xs:enumeration value="square"/>
+      <xs:enumeration value="circle"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="ul">
+    <xs:annotation>
+      <xs:documentation>
+      Unordered list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="type" type="ULStyle"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="OLStyle">
+    <xs:annotation>
+      <xs:documentation>
+      Ordered list numbering style
+
+      1   arabic numbers      1, 2, 3, ...
+      a   lower alpha         a, b, c, ...
+      A   upper alpha         A, B, C, ...
+      i   lower roman         i, ii, iii, ...
+      I   upper roman         I, II, III, ...
+
+      The style is applied to the sequence number which by default
+      is reset to 1 for the first list item in an ordered list.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:element name="ol">
+    <xs:annotation>
+      <xs:documentation>
+      Ordered (numbered) list
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="type" type="OLStyle"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="start" type="Number"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="menu">
+    <xs:annotation>
+      <xs:documentation>
+      single column list (DEPRECATED)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dir">
+    <xs:annotation>
+      <xs:documentation>
+      multiple column list (DEPRECATED)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="li"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="LIStyle">
+    <xs:annotation>
+      <xs:documentation>
+      LIStyle is constrained to: "(ULStyle|OLStyle)"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:element name="li">
+    <xs:annotation>
+      <xs:documentation>
+      list item
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="type" type="LIStyle"/>
+          <xs:attribute name="value" type="Number"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    definition lists - dt for term, dd for its definition
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="dl">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="dt"/>
+        <xs:element ref="dd"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="compact">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dt">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dd">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Address ==========================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="address">
+    <xs:annotation>
+      <xs:documentation>
+      information on author
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="inline"/>
+        <xs:group ref="misc.inline"/>
+        <xs:element ref="p"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Horizontal Rule ==================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="hr">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="noshade">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="noshade"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="size" type="Pixels"/>
+      <xs:attribute name="width" type="Length"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Preformatted Text ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="pre">
+    <xs:annotation>
+      <xs:documentation>
+      content is "Inline" excluding
+         "img|object|applet|big|small|sub|sup|font|basefont"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="pre.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="width" type="Number"/>
+          <xs:attribute ref="xml:space" fixed="preserve"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Block-like Quotes ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="blockquote">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Text alignment ===================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="center">
+    <xs:annotation>
+      <xs:documentation>
+      center content
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Inserted/Deleted Text ============================
+
+    ins/del are allowed in block and inline content, but its
+    inappropriate to include block content within an ins element
+    occurring in inline content.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="ins">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+          <xs:attribute name="datetime" type="Datetime"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="del">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+          <xs:attribute name="datetime" type="Datetime"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== The Anchor Element ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="a">
+    <xs:annotation>
+      <xs:documentation>
+      content is "Inline" except that anchors shouldn't be nested
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="a.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="focus"/>
+          <xs:attribute name="charset" type="Charset"/>
+          <xs:attribute name="type" type="ContentType"/>
+          <xs:attribute name="name" type="xs:NMTOKEN"/>
+          <xs:attribute name="href" type="URI"/>
+          <xs:attribute name="hreflang" type="LanguageCode"/>
+          <xs:attribute name="rel" type="LinkTypes"/>
+          <xs:attribute name="rev" type="LinkTypes"/>
+          <xs:attribute name="shape" default="rect" type="Shape"/>
+          <xs:attribute name="coords" type="Coords"/>
+          <xs:attribute name="target" type="FrameTarget"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ===================== Inline Elements ================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="span">
+    <xs:annotation>
+      <xs:documentation>
+      generic language/style container
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="bdo">
+    <xs:annotation>
+      <xs:documentation>
+      I18N BiDi over-ride
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attributeGroup ref="events"/>
+          <xs:attribute name="lang" type="LanguageCode"/>
+          <xs:attribute ref="xml:lang"/>
+          <xs:attribute name="dir" use="required">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="ltr"/>
+                <xs:enumeration value="rtl"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="br">
+    <xs:annotation>
+      <xs:documentation>
+      forced line break
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attribute name="clear" default="none">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="all"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="none"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="em">
+    <xs:annotation>
+      <xs:documentation>
+      emphasis
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="strong">
+    <xs:annotation>
+      <xs:documentation>
+      strong emphasis
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="dfn">
+    <xs:annotation>
+      <xs:documentation>
+      definitional
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="code">
+    <xs:annotation>
+      <xs:documentation>
+      program code
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="samp">
+    <xs:annotation>
+      <xs:documentation>
+      sample
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="kbd">
+    <xs:annotation>
+      <xs:documentation>
+      something user would type
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="var">
+    <xs:annotation>
+      <xs:documentation>
+      variable
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="cite">
+    <xs:annotation>
+      <xs:documentation>
+      citation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="abbr">
+    <xs:annotation>
+      <xs:documentation>
+      abbreviation
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="acronym">
+    <xs:annotation>
+      <xs:documentation>
+      acronym
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="q">
+    <xs:annotation>
+      <xs:documentation>
+      inlined quote
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="cite" type="URI"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="sub">
+    <xs:annotation>
+      <xs:documentation>
+      subscript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="sup">
+    <xs:annotation>
+      <xs:documentation>
+      superscript
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tt">
+    <xs:annotation>
+      <xs:documentation>
+      fixed pitch font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="i">
+    <xs:annotation>
+      <xs:documentation>
+      italic font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="b">
+    <xs:annotation>
+      <xs:documentation>
+      bold font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="big">
+    <xs:annotation>
+      <xs:documentation>
+      bigger font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="small">
+    <xs:annotation>
+      <xs:documentation>
+      smaller font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="u">
+    <xs:annotation>
+      <xs:documentation>
+      underline
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="s">
+    <xs:annotation>
+      <xs:documentation>
+      strike-through
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="strike">
+    <xs:annotation>
+      <xs:documentation>
+      strike-through
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="basefont">
+    <xs:annotation>
+      <xs:documentation>
+      base font size
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="size" use="required"/>
+      <xs:attribute name="color" type="Color"/>
+      <xs:attribute name="face"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="font">
+    <xs:annotation>
+      <xs:documentation>
+      local change to font
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="coreattrs"/>
+          <xs:attributeGroup ref="i18n"/>
+          <xs:attribute name="size"/>
+          <xs:attribute name="color" type="Color"/>
+          <xs:attribute name="face"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ==================== Object ======================================
+
+    object is used to embed objects as part of HTML pages.
+    param elements should precede other content. Parameters
+    can also be expressed as attribute/value pairs on the
+    object element itself when brevity is desired.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="object">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="param"/>
+        <xs:group ref="block"/>
+        <xs:element ref="form"/>
+        <xs:group ref="inline"/>
+        <xs:group ref="misc"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="declare">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="declare"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="classid" type="URI"/>
+      <xs:attribute name="codebase" type="URI"/>
+      <xs:attribute name="data" type="URI"/>
+      <xs:attribute name="type" type="ContentType"/>
+      <xs:attribute name="codetype" type="ContentType"/>
+      <xs:attribute name="archive" type="UriList"/>
+      <xs:attribute name="standby" type="Text"/>
+      <xs:attribute name="height" type="Length"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="usemap" type="URI"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="tabindex" type="Number"/>
+      <xs:attribute name="align" type="ImgAlign"/>
+      <xs:attribute name="border" type="Pixels"/>
+      <xs:attribute name="hspace" type="Pixels"/>
+      <xs:attribute name="vspace" type="Pixels"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="param">
+    <xs:annotation>
+      <xs:documentation>
+      param is used to supply a named property value.
+      In XML it would seem natural to follow RDF and support an
+      abbreviated syntax where the param elements are replaced
+      by attribute value pairs on the object start tag.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="value"/>
+      <xs:attribute name="valuetype" default="data">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="data"/>
+            <xs:enumeration value="ref"/>
+            <xs:enumeration value="object"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="type" type="ContentType"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Java applet ==================================
+
+    One of code or object attributes must be present.
+    Place param elements before other content.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="applet">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="param"/>
+        <xs:group ref="block"/>
+        <xs:element ref="form"/>
+        <xs:group ref="inline"/>
+        <xs:group ref="misc"/>
+      </xs:choice>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attribute name="codebase" type="URI"/>
+      <xs:attribute name="archive"/>
+      <xs:attribute name="code"/>
+      <xs:attribute name="object"/>
+      <xs:attribute name="alt" type="Text"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="width" use="required" type="Length"/>
+      <xs:attribute name="height" use="required" type="Length"/>
+      <xs:attribute name="align" type="ImgAlign"/>
+      <xs:attribute name="hspace" type="Pixels"/>
+      <xs:attribute name="vspace" type="Pixels"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Images ===========================================
+
+    To avoid accessibility problems for people who aren't
+    able to see the image, you should provide a text
+    description using the alt and longdesc attributes.
+    In addition, avoid the use of server-side image maps.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="img">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="src" use="required" type="URI"/>
+      <xs:attribute name="alt" use="required" type="Text"/>
+      <xs:attribute name="name" type="xs:NMTOKEN"/>
+      <xs:attribute name="longdesc" type="URI"/>
+      <xs:attribute name="height" type="Length"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="usemap" type="URI">
+  <xs:annotation>
+    <xs:documentation>
+          usemap points to a map element which may be in this document
+          or an external document, although the latter is not widely supported
+          </xs:documentation>
+  </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name="ismap">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="ismap"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align" type="ImgAlign"/>
+      <xs:attribute name="border" type="Length"/>
+      <xs:attribute name="hspace" type="Pixels"/>
+      <xs:attribute name="vspace" type="Pixels"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== Client-side image maps ============================
+
+    These can be placed in the same document or grouped in a
+    separate document although this isn't yet widely supported
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="map">
+    <xs:complexType>
+      <xs:choice>
+        <xs:choice maxOccurs="unbounded">
+          <xs:group ref="block"/>
+          <xs:element ref="form"/>
+          <xs:group ref="misc"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="area"/>
+      </xs:choice>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attributeGroup ref="events"/>
+      <xs:attribute name="id" use="required" type="xs:ID"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style" type="StyleSheet"/>
+      <xs:attribute name="title" type="Text"/>
+      <xs:attribute name="name"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="area">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="shape" default="rect" type="Shape"/>
+      <xs:attribute name="coords" type="Coords"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="nohref">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="nohref"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="alt" use="required" type="Text"/>
+      <xs:attribute name="target" type="FrameTarget"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ================ Forms ===============================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="form">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="form.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="action" use="required" type="URI"/>
+          <xs:attribute name="name" type="xs:NMTOKEN"/>
+          <xs:attribute name="method" default="get">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="get"/>
+                <xs:enumeration value="post"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="enctype" type="ContentType"
+              default="application/x-www-form-urlencoded"/>
+          <xs:attribute name="onsubmit" type="Script"/>
+          <xs:attribute name="onreset" type="Script"/>
+          <xs:attribute name="accept" type="ContentTypes"/>
+          <xs:attribute name="accept-charset" type="Charsets"/>
+          <xs:attribute name="target" type="FrameTarget"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="label">
+    <xs:annotation>
+      <xs:documentation>
+      Each label must not contain more than ONE field
+      Label elements shouldn't be nested.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="for" type="xs:IDREF"/>
+          <xs:attribute name="accesskey" type="Character"/>
+          <xs:attribute name="onfocus" type="Script"/>
+          <xs:attribute name="onblur" type="Script"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="InputType">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="text"/>
+      <xs:enumeration value="password"/>
+      <xs:enumeration value="checkbox"/>
+      <xs:enumeration value="radio"/>
+      <xs:enumeration value="submit"/>
+      <xs:enumeration value="reset"/>
+      <xs:enumeration value="file"/>
+      <xs:enumeration value="hidden"/>
+      <xs:enumeration value="image"/>
+      <xs:enumeration value="button"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="input">
+    <xs:annotation>
+      <xs:documentation>
+      form control
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="type" default="text" type="InputType"/>
+      <xs:attribute name="name">
+  <xs:annotation>
+    <xs:documentation>
+          the name attribute is required for all but submit &amp; reset
+          </xs:documentation>
+  </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name="value"/>
+      <xs:attribute name="checked">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="checked"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="readonly">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="readonly"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="size"/>
+      <xs:attribute name="maxlength" type="Number"/>
+      <xs:attribute name="src" type="URI"/>
+      <xs:attribute name="alt"/>
+      <xs:attribute name="usemap" type="URI"/>
+      <xs:attribute name="onselect" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+      <xs:attribute name="accept" type="ContentTypes"/>
+      <xs:attribute name="align" type="ImgAlign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="select">
+    <xs:annotation>
+      <xs:documentation>
+      option selector
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="optgroup"/>
+        <xs:element ref="option"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="size" type="Number"/>
+      <xs:attribute name="multiple">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="multiple"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="tabindex" type="tabindexNumber"/>
+      <xs:attribute name="onfocus" type="Script"/>
+      <xs:attribute name="onblur" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="optgroup">
+    <xs:annotation>
+      <xs:documentation>
+      option group
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="option"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="label" use="required" type="Text"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="option">
+    <xs:annotation>
+      <xs:documentation>
+      selectable choice
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="selected">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="selected"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="label" type="Text"/>
+      <xs:attribute name="value"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="textarea">
+    <xs:annotation>
+      <xs:documentation>
+      multi-line text field
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="focus"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="rows" use="required" type="Number"/>
+      <xs:attribute name="cols" use="required" type="Number"/>
+      <xs:attribute name="disabled">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="disabled"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="readonly">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="readonly"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="onselect" type="Script"/>
+      <xs:attribute name="onchange" type="Script"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="fieldset">
+    <xs:annotation>
+      <xs:documentation>
+      The fieldset element is used to group form fields.
+      Only one legend element should occur in the content
+      and if present should only be preceded by whitespace.
+
+      NOTE: this content model is different from the XHTML 1.0 DTD,
+      closer to the intended content model in HTML4 DTD
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:sequence>
+        <xs:element ref="legend"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:group ref="block"/>
+          <xs:element ref="form"/>
+          <xs:group ref="inline"/>
+          <xs:group ref="misc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="LAlign">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="top"/>
+      <xs:enumeration value="bottom"/>
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="legend">
+    <xs:annotation>
+      <xs:documentation>
+      fieldset label
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="accesskey" type="Character"/>
+          <xs:attribute name="align" type="LAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="button">
+    <xs:annotation>
+      <xs:documentation>
+      Content is "Flow" excluding a, form and form controls
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="button.content">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attributeGroup ref="focus"/>
+          <xs:attribute name="name"/>
+          <xs:attribute name="value"/>
+          <xs:attribute name="type" default="submit">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="button"/>
+                <xs:enumeration value="submit"/>
+                <xs:enumeration value="reset"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="disabled">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="disabled"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="isindex">
+    <xs:annotation>
+      <xs:documentation>
+      single-line text input control (DEPRECATED)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="coreattrs"/>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="prompt" type="Text"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    ======================= Tables =======================================
+
+    Derived from IETF HTML table standard, see [RFC1942]
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="TFrame">
+    <xs:annotation>
+      <xs:documentation>
+      The border attribute sets the thickness of the frame around the
+      table. The default units are screen pixels.
+
+      The frame attribute specifies which parts of the frame around
+      the table should be rendered. The values are not the same as
+      CALS to avoid a name clash with the valign attribute.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="void"/>
+      <xs:enumeration value="above"/>
+      <xs:enumeration value="below"/>
+      <xs:enumeration value="hsides"/>
+      <xs:enumeration value="lhs"/>
+      <xs:enumeration value="rhs"/>
+      <xs:enumeration value="vsides"/>
+      <xs:enumeration value="box"/>
+      <xs:enumeration value="border"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="TRules">
+    <xs:annotation>
+      <xs:documentation>
+      The rules attribute defines which rules to draw between cells:
+
+      If rules is absent then assume:
+          "none" if border is absent or border="0" otherwise "all"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="none"/>
+      <xs:enumeration value="groups"/>
+      <xs:enumeration value="rows"/>
+      <xs:enumeration value="cols"/>
+      <xs:enumeration value="all"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="TAlign">
+    <xs:annotation>
+      <xs:documentation>
+      horizontal placement of table relative to document
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="center"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:attributeGroup name="cellhalign">
+    <xs:annotation>
+      <xs:documentation>
+      horizontal alignment attributes for cell contents
+
+      char        alignment char, e.g. char=':'
+      charoff     offset for alignment char
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="align">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="left"/>
+          <xs:enumeration value="center"/>
+          <xs:enumeration value="right"/>
+          <xs:enumeration value="justify"/>
+          <xs:enumeration value="char"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="char" type="Character"/>
+    <xs:attribute name="charoff" type="Length"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="cellvalign">
+    <xs:annotation>
+      <xs:documentation>
+      vertical alignment attributes for cell contents
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="valign">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="top"/>
+          <xs:enumeration value="middle"/>
+          <xs:enumeration value="bottom"/>
+          <xs:enumeration value="baseline"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:element name="table">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="caption"/>
+        <xs:choice>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="colgroup"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="thead"/>
+        <xs:element minOccurs="0" ref="tfoot"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="tbody"/>
+          <xs:element maxOccurs="unbounded" ref="tr"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="summary" type="Text"/>
+      <xs:attribute name="width" type="Length"/>
+      <xs:attribute name="border" type="Pixels"/>
+      <xs:attribute name="frame" type="TFrame"/>
+      <xs:attribute name="rules" type="TRules"/>
+      <xs:attribute name="cellspacing" type="Length"/>
+      <xs:attribute name="cellpadding" type="Length"/>
+      <xs:attribute name="align" type="TAlign"/>
+      <xs:attribute name="bgcolor" type="Color"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="CAlign">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="top"/>
+      <xs:enumeration value="bottom"/>
+      <xs:enumeration value="left"/>
+      <xs:enumeration value="right"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:element name="caption">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Inline">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="align" type="CAlign"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    Use thead to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    tbody sections are rendered in scrolling panel.
+
+    Use tfoot to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    tbody sections are rendered in scrolling panel.
+
+    Use multiple tbody sections when rules are needed
+    between groups of table rows.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="thead">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tfoot">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tbody">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="tr"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="colgroup">
+    <xs:annotation>
+      <xs:documentation>
+      colgroup groups a set of col elements. It allows you to group
+      several semantically related columns together.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="col"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="span" default="1" type="Number"/>
+      <xs:attribute name="width" type="MultiLength"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="col">
+    <xs:annotation>
+      <xs:documentation>
+      col elements define the alignment properties for cells in
+      one or more columns.
+
+      The width attribute specifies the width of the columns, e.g.
+
+          width=64        width in screen pixels
+          width=0.5*      relative width of 0.5
+
+      The span attribute causes the attributes of one
+      col element to apply to more than one column.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="span" default="1" type="Number"/>
+      <xs:attribute name="width" type="MultiLength"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="tr">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="th"/>
+        <xs:element ref="td"/>
+      </xs:choice>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attributeGroup ref="cellhalign"/>
+      <xs:attributeGroup ref="cellvalign"/>
+      <xs:attribute name="bgcolor" type="Color"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:simpleType name="Scope">
+    <xs:annotation>
+      <xs:documentation>
+      Scope is simpler than headers attribute for common tables
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="row"/>
+      <xs:enumeration value="col"/>
+      <xs:enumeration value="rowgroup"/>
+      <xs:enumeration value="colgroup"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    th is for headers, td for data and for cells acting as both
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="th">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="abbr" type="Text"/>
+          <xs:attribute name="axis"/>
+          <xs:attribute name="headers" type="xs:IDREFS"/>
+          <xs:attribute name="scope" type="Scope"/>
+          <xs:attribute name="rowspan" default="1" type="Number"/>
+          <xs:attribute name="colspan" default="1" type="Number"/>
+          <xs:attributeGroup ref="cellhalign"/>
+          <xs:attributeGroup ref="cellvalign"/>
+          <xs:attribute name="nowrap">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="nowrap"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="bgcolor" type="Color"/>
+          <xs:attribute name="width" type="Length"/>
+          <xs:attribute name="height" type="Length"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="td">
+    <xs:complexType mixed="true">
+      <xs:complexContent>
+        <xs:extension base="Flow">
+          <xs:attributeGroup ref="attrs"/>
+          <xs:attribute name="abbr" type="Text"/>
+          <xs:attribute name="axis"/>
+          <xs:attribute name="headers" type="xs:IDREFS"/>
+          <xs:attribute name="scope" type="Scope"/>
+          <xs:attribute name="rowspan" default="1" type="Number"/>
+          <xs:attribute name="colspan" default="1" type="Number"/>
+          <xs:attributeGroup ref="cellhalign"/>
+          <xs:attributeGroup ref="cellvalign"/>
+          <xs:attribute name="nowrap">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="nowrap"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="bgcolor" type="Color"/>
+          <xs:attribute name="width" type="Length"/>
+          <xs:attribute name="height" type="Length"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/tests/testData/xml/xlink.xsd b/xml/tests/testData/xml/xlink.xsd
new file mode 100644
index 0000000..cbe6de5
--- /dev/null
+++ b/xml/tests/testData/xml/xlink.xsd
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink">
+  <xs:attribute name="href"/>
+  <xs:attribute name="type"/>
+  <xs:attribute name="role"/>
+  <xs:attribute name="arcrole"/>
+  <xs:attribute name="title"/>
+  <xs:attribute name="show">
+    <xs:simpleType>
+      <xs:restriction base="xs:token">
+        <xs:enumeration value="new"/>
+        <xs:enumeration value="replace"/>
+        <xs:enumeration value="embed"/>
+        <xs:enumeration value="other"/>
+        <xs:enumeration value="none"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:attribute>
+  <xs:attribute name="actuate">
+    <xs:simpleType>
+      <xs:restriction base="xs:token">
+        <xs:enumeration value="onLoad"/>
+        <xs:enumeration value="onRequest"/>
+        <xs:enumeration value="other"/>
+        <xs:enumeration value="none"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:attribute>
+  <xs:attribute name="label" type="xs:NMTOKEN"/>
+  <xs:attribute name="from" type="xs:NMTOKEN"/>
+  <xs:attribute name="to" type="xs:NMTOKEN"/>
+</xs:schema>
diff --git a/xml/tests/testData/xml/xml.xsd b/xml/tests/testData/xml/xml.xsd
new file mode 100644
index 0000000..f88d795
--- /dev/null
+++ b/xml/tests/testData/xml/xml.xsd
@@ -0,0 +1,13 @@
+<?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:attribute name="id" type="xs:ID"/>
+  <xs:attribute name="lang"/>
+  <xs:attribute name="base"/>
+  <xs:attribute name="space">
+    <xs:simpleType>
+      <xs:restriction base="xs:token">
+        <xs:enumeration value="preserve"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:attribute>
+</xs:schema>
diff --git a/xml/tests/xml-tests.iml b/xml/tests/xml-tests.iml
new file mode 100644
index 0000000..a6274e3
--- /dev/null
+++ b/xml/tests/xml-tests.iml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="true" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" scope="TEST" name="JUnit4" level="project" />
+    <orderEntry type="module" module-name="xml" />
+    <orderEntry type="module" module-name="testFramework-java" />
+    <orderEntry type="library" name="Xerces" level="project" />
+    <orderEntry type="library" scope="TEST" name="Groovy" level="project" />
+    <orderEntry type="module" module-name="idea-ui" scope="TEST" />
+    <orderEntry type="module" module-name="java-impl" scope="TEST" />
+    <orderEntry type="module" module-name="ant" scope="TEST" />
+    <orderEntry type="module" module-name="xpath" scope="TEST" />
+    <orderEntry type="module" module-name="dom-impl" scope="TEST" />
+    <orderEntry type="library" name="XmlBeans" level="project" />
+  </component>
+  <component name="copyright">
+    <Base>
+      <setting name="state" value="1" />
+    </Base>
+  </component>
+</module>
+